diff --git a/.github/workflows/busy_beaver_ci.yml b/.github/workflows/busy_beaver_ci.yml index 8d76b767..c8ecfa22 100644 --- a/.github/workflows/busy_beaver_ci.yml +++ b/.github/workflows/busy_beaver_ci.yml @@ -40,8 +40,8 @@ jobs: sudo apt-get install -y -qq bubblewrap >/dev/null sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 - - uses: actions/checkout@v5 - - uses: leanprover/lean-action@v1 + - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5 + - uses: leanprover/lean-action@fe408643ea7367d8c0404a8be3975bb145f5fb64 # v1 with: build-args: "BusyBeaver BusyBeaverChallenge" env: diff --git a/BusyBeaver.lean b/BusyBeaver.lean index 3211ccb6..476f8e6a 100644 --- a/BusyBeaver.lean +++ b/BusyBeaver.lean @@ -112,6 +112,191 @@ public import BusyBeaver.BB33.M_1RB2LA1LA_2LA0RA2RC_HHH1RB2RA public import BusyBeaver.BB33.M_1RB2LC1RC_2LCHHH2RB_2LA0LB0RA public import BusyBeaver.BB33.M_1RB2RA1LC_2LC1RB2RB_HHH2LA1LA + +-- BB(6) Halt proofs +public import BusyBeaver.BB6.Halt.M_1RB0LB_0LC0RE_1LA1LD_0LB1LD_1RA0RF_1RAHHH +public import BusyBeaver.BB6.Halt.M_1RB0LB_0LC0RE_1LA1LD_0LB1LF_1RA1RD_0LBHHH +public import BusyBeaver.BB6.Halt.M_1RB0LB_0LC0RE_1LA1LD_0LB1RF_1RA1RD_HHH1LC +public import BusyBeaver.BB6.Halt.M_1RB0LC_1LC0RE_1RF1LD_1LA0LB_1RD1RA_1LBHHH +public import BusyBeaver.BB6.Halt.M_1RB0LD_1LC0RD_1RE0RA_1LE0RF_1LA1RC_0LBHHH +public import BusyBeaver.BB6.Halt.M_1RB0LD_1RC0RF_1LC1LA_0LEHHH_1LF0RB_0RC0RE +public import BusyBeaver.BB6.Halt.M_1RB0LE_0RC0RB_1LD0LD_1RA1LC_HHH1LF_1LA0LC +public import BusyBeaver.BB6.Halt.M_1RB0LF_1RCHHH_1LD0RF_1RA0LE_0LD1LD_0RD0RB +public import BusyBeaver.BB6.Halt.M_1RB0RA_1LC0RE_1LD0LC_1RA1LE_1LC0LF_0RAHHH +public import BusyBeaver.BB6.Halt.M_1RB0RB_1RC0RD_1LD1RC_1RF0LE_1LC1LE_HHH0RA +public import BusyBeaver.BB6.Halt.M_1RB0RC_1LC1RF_1RA1LD_1RD0LE_1LD1LC_0REHHH +public import BusyBeaver.BB6.Halt.M_1RB0RC_1RC0LD_1LD1RA_1LF0LE_HHH0RD_1LB0LA +public import BusyBeaver.BB6.Halt.M_1RB0RD_1LC0RA_HHH1RD_1RA1LE_1RC0LF_1LE0LB +public import BusyBeaver.BB6.Halt.M_1RB0RD_1LC1RE_1LA0LD_0RE0RF_1LC1RA_0LEHHH +public import BusyBeaver.BB6.Halt.M_1RB0RD_1RC0LC_1RE1RA_0LD1LA_0LF0LD_0REHHH +public import BusyBeaver.BB6.Halt.M_1RB0RE_1RC0RA_0LD0LB_0LA1LE_1LC1LF_0LAHHH +public import BusyBeaver.BB6.Halt.M_1RB0RF_0RC1RD_0LDHHH_1LE1RA_1LA0LF_0RD0RC +public import BusyBeaver.BB6.Halt.M_1RB0RF_1LC1RE_1LD0LC_0LE0RE_1RA1LD_1RBHHH +public import BusyBeaver.BB6.Halt.M_1RB0RF_1RC0RB_1LD1RA_1LE0LD_1RB0LA_0LDHHH +public import BusyBeaver.BB6.Halt.M_1RB1LA_0LB1LC_1RD0LD_0LA0RE_1RC1RF_0LDHHH +public import BusyBeaver.BB6.Halt.M_1RB1LC_1RC1RE_0LF1RD_0RA0LD_HHH1RC_1LA0LA +public import BusyBeaver.BB6.Halt.M_1RB1RA_1LC0RD_1LD1LB_1RA0LE_0LB1LF_1RCHHH +public import BusyBeaver.BB6.Halt.M_1RB1RA_1LC0RE_1LD1LB_1RA0LE_1RA0LF_0LBHHH +public import BusyBeaver.BB6.Halt.M_1RB1RC_1LC0LF_1RF0LD_0RE1LB_1RCHHH_1LD0RA +public import BusyBeaver.BB6.Halt.M_1RB1RC_1LC1RD_1LD0LE_1LA0LD_0LB1RF_HHH0LF +public import BusyBeaver.BB6.Halt.M_1RB1RE_1LC0LB_1LD1LC_0RA1RF_1RD1RE_HHH1LB +public import BusyBeaver.BB6.Halt.M_1RB1RE_1LC0RC_0RA0LD_1LB1LE_0RC1LF_HHH1RA +public import BusyBeaver.BB6.Halt.M_1RB1RE_1RC1LE_1LD0RA_1LF0LA_1LB0LC_HHH1RA +public import BusyBeaver.BB6.Halt.M_1RB1RF_0RC0RE_0RD1RA_1LE0LA_1LB0LD_0RDHHH +public import BusyBeaver.BB6.Halt.M_1RB1RF_1LC0RA_HHH0LD_1RE1LD_0LF0LB_1RA1LE +public import BusyBeaver.BB6.Halt.M_1RBHHH_1LC1RE_1LA0LD_0RE1LC_1LC1RF_1RB0RD + +-- BB(6) NonHalt proofs +public import BusyBeaver.BB6.NonHalt.M_1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC +public import BusyBeaver.BB6.NonHalt.M_1RB0LA_0RC1LE_0RD1RE_1LA1RF_1RB0LD_1RCHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RCHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0LB_1LC1LB_1RD1LA_0RE0RE_0RA1RF_HHH1RD +public import BusyBeaver.BB6.NonHalt.M_1RB0LC_0LC1RE_1LD1LC_1LA1RD_HHH1RF_0RA0RF +public import BusyBeaver.BB6.NonHalt.M_1RB0LC_1LA0RE_0RD0LA_1RE1RA_0LD1RF_0RBHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0LC_1LA0RE_0RD1LF_1LC1LB_0LD0RB_0LAHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0LC_1LC0RB_0LE0LD_1LCHHH_0RA1LF_1LA1LF +public import BusyBeaver.BB6.NonHalt.M_1RB0LC_1LC0RE_1LA1LD_1LA1LB_0RF1RA_HHH0RE +public import BusyBeaver.BB6.NonHalt.M_1RB0LC_1LC0RE_1LA1LD_1LA1LF_0RB1RA_1LCHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0LD_1LC1RB_0LA0LD_1LE0RB_1RF0RE_HHH0RD +public import BusyBeaver.BB6.NonHalt.M_1RB0LD_1RC0RA_1RD1RF_1LA0LE_1RE1LD_0RBHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0LD_1RC1RF_0RD1RA_1LE1RC_0LA0LD_0RCHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0LE_1LC1RA_HHH1LD_0RB1LF_1RD1LA_0LA0RD +public import BusyBeaver.BB6.NonHalt.M_1RB0LE_1LC1RD_1LA0LC_1RA1RE_0RF0RB_1LCHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0LE_1RC0LF_0LD0RC_1RA1LD_1LB0LE_HHH0RE +public import BusyBeaver.BB6.NonHalt.M_1RB0LE_1RC0RC_1LD0RB_1LA0LE_1LD1LF_1LDHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0LE_1RC1LA_1LD1RE_1LB0LD_1RF0RC_1RBHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0LF_0RCHHH_1RD0RA_1LE0RC_0LA0LE_1LE1LB +public import BusyBeaver.BB6.NonHalt.M_1RB0RA_0LC0LA_1RF1LD_1LE0LD_1LC1LF_HHH1RA +public import BusyBeaver.BB6.NonHalt.M_1RB0RA_0RC0LD_1LA1RF_1LE1LD_1LB1RE_HHH1RA +public import BusyBeaver.BB6.NonHalt.M_1RB0RA_0RC0LE_1LD1RF_1LB1RD_1LD1LE_HHH1RA +public import BusyBeaver.BB6.NonHalt.M_1RB0RA_0RC0RE_0LDHHH_1LE1LD_1LF0LD_1RA0RD +public import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA +public import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF1LB_HHH0RA +public import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0LD_1LE1LD_0LB0RF_1RA1LB_1RAHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LB0RC +public import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC +public import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_0LCHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LCHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LDHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RA_1RC0LC_0LD1RF_1RA1LE_1LD0LB_0REHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RA_1RC0LE_1LD0RA_HHH1LE_0RE0LF_1LB1LC +public import BusyBeaver.BB6.NonHalt.M_1RB0RA_1RC0RC_1LD0LE_1RA1LC_1LC1LF_0LCHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RA_1RC0RD_1LD1LE_1LF0LC_0LDHHH_1RA1LD +public import BusyBeaver.BB6.NonHalt.M_1RB0RA_1RC0RE_1RDHHH_1LE1LD_1LF0LD_1RA1LE +public import BusyBeaver.BB6.NonHalt.M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LAHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LBHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_1LEHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RB_1LC0RA_1LE0LD_1LC1LF_1RA0LD_1LCHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RB_1RC1LC_0LD1RA_1LF1LE_0LA1LC_1LBHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RC_1LC0LD_1RA1RC_1RA1LE_0LB1RE_HHH1RA +public import BusyBeaver.BB6.NonHalt.M_1RB0RC_1LC1LF_1LD0LB_1RE1LC_1RA0RE_0LCHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RC_1LC1RA_0RF0LD_1LE0RB_1LB0LD_HHH1RD +public import BusyBeaver.BB6.NonHalt.M_1RB0RC_1LC1RD_1RA1LE_1LA0RD_0LE1RF_1LBHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RD_0LC0RA_1LA1LC_1RE0LF_0RA1RF_1LBHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RD_0LC1RA_0RA1LB_1RE1LB_1LF1LB_HHH1LE +public import BusyBeaver.BB6.NonHalt.M_1RB0RD_0RC0LB_0RD1RD_1LE1RA_1RC1LF_HHH1LA +public import BusyBeaver.BB6.NonHalt.M_1RB0RD_1RC1RF_1LD0LE_1RA0LC_1RE1LC_0RAHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RD_1RCHHH_1LD1LC_1LE0LC_1RF0RC_1RA0RF +public import BusyBeaver.BB6.NonHalt.M_1RB0RD_1RCHHH_1LD1LE_1LE0LC_1RF1LD_1RA0RF +public import BusyBeaver.BB6.NonHalt.M_1RB0RE_1LC0LE_1LD0LC_1RA0LA_1RA1RF_1RAHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RE_1LC0RA_0RA0LD_1LEHHH_1RF0LF_0LC0RA +public import BusyBeaver.BB6.NonHalt.M_1RB0RE_1LC0RA_1LD0LB_1LA1LF_1LE1RA_0LCHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RE_1LC0RE_1LD0LD_1RA0LC_1RA1RF_1RAHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RAHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RDHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0LBHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0RAHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RDHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1REHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RE_1LC1RD_1LD0LC_1RA0RF_1RDHHH_0RD0LA +public import BusyBeaver.BB6.NonHalt.M_1RB0RE_1LC1RF_HHH0LD_0LE1LB_1LF1LD_1RD0RA +public import BusyBeaver.BB6.NonHalt.M_1RB0RE_1RC0RB_0RD0RF_0LEHHH_1LF1LE_1LA0LE +public import BusyBeaver.BB6.NonHalt.M_1RB0RE_1RC1LF_0LD0RE_HHH1LE_1RA0LB_1LB0LC +public import BusyBeaver.BB6.NonHalt.M_1RB0RE_1RC1RE_1LD1RA_1LA0LD_0RA0LF_1LDHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RE_1RCHHH_0LD1LE_0RE1LD_1RF0LC_0RA1RE +public import BusyBeaver.BB6.NonHalt.M_1RB0RF_1LC0LF_1LD0LC_0LE0LA_1LFHHH_1RA1RF +public import BusyBeaver.BB6.NonHalt.M_1RB0RF_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH +public import BusyBeaver.BB6.NonHalt.M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_0RFHHH_1RA1RF +public import BusyBeaver.BB6.NonHalt.M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_1RFHHH_1RA1RE +public import BusyBeaver.BB6.NonHalt.M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RB +public import BusyBeaver.BB6.NonHalt.M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RF +public import BusyBeaver.BB6.NonHalt.M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RA0LB +public import BusyBeaver.BB6.NonHalt.M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RE0LB +public import BusyBeaver.BB6.NonHalt.M_1RB0RF_1RC1RF_1LD0RE_HHH0LE_1LA0LE_0RA0LC +public import BusyBeaver.BB6.NonHalt.M_1RB0RF_1RC1RF_1LD1RA_HHH0LE_1LA0LE_0RA0LC +public import BusyBeaver.BB6.NonHalt.M_1RB1LA_0RC0RD_1LC1LA_1RE1RD_1LF0LA_HHH0LE +public import BusyBeaver.BB6.NonHalt.M_1RB1LA_1LA1RC_1RD0RB_1LE0LF_HHH1LD_0LE1LA +public import BusyBeaver.BB6.NonHalt.M_1RB1LA_1LC0RA_0LD1RC_HHH0LE_0LF1LE_1RF1LB +public import BusyBeaver.BB6.NonHalt.M_1RB1LA_1RC0LE_1RD0LF_0LA0RD_1LC0LE_HHH0RE +public import BusyBeaver.BB6.NonHalt.M_1RB1LB_1LC0LF_1LD0RC_1RE0LA_1RE1RC_HHH0LE +public import BusyBeaver.BB6.NonHalt.M_1RB1LB_1LC1RB_1RF1LD_0LE0LC_0RCHHH_1LA0RF +public import BusyBeaver.BB6.NonHalt.M_1RB1LB_1RC0LA_1LD1RF_1RB0LE_HHH1LA_1RD0RD +public import BusyBeaver.BB6.NonHalt.M_1RB1LC_1LA1RB_1LD0LA_1RE0RF_HHH1RD_0RE1RB +public import BusyBeaver.BB6.NonHalt.M_1RB1LC_1RC1LB_1LD0RB_0LE1RD_HHH0LF_0LA1LF +public import BusyBeaver.BB6.NonHalt.M_1RB1LD_0RC0RB_0LD1RE_0LA1LC_0RB0RF_1LCHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1LD_0RC1RC_1LA1RE_HHH1LE_1RF0RC_0RB0LF +public import BusyBeaver.BB6.NonHalt.M_1RB1LD_1LC1RA_0LD0LC_0RE1RB_1RD0RF_0RBHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1LD_1RC0RB_1LA0RE_1LC1LE_1LF0LA_0REHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1LD_1RC0RB_1LA1RE_1LF0LA_1LA0RD_1LCHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD0LF_1RDHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_0LDHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_1LAHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1LE_1LC0RF_1LA0RD_1LC1RC_1LB0LB_HHH1RD +public import BusyBeaver.BB6.NonHalt.M_1RB1LE_1LC1RD_0LA1LA_HHH1RE_1LF0LA_0LC0RF +public import BusyBeaver.BB6.NonHalt.M_1RB1LF_0RC0RB_0LD1LA_1LC0LE_0LAHHH_1LA1LF +public import BusyBeaver.BB6.NonHalt.M_1RB1LF_1LC1RB_1RE1LD_1LB0LC_1LA0RE_1LDHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LA_1LA0LE +public import BusyBeaver.BB6.NonHalt.M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LE_1LA0LE +public import BusyBeaver.BB6.NonHalt.M_1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1RA_1LC1LE_1RF1LD_1RE0LD_0LB0RA_HHH0RC +public import BusyBeaver.BB6.NonHalt.M_1RB1RA_1LC1RE_0LD0LD_0LE1LF_1LA0RA_HHH1LC +public import BusyBeaver.BB6.NonHalt.M_1RB1RA_1RC0RA_1LD0LA_1LE0LD_1LF0LB_1REHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1RA_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1RA_1RC1LB_0LD0RA_1RF1LE_HHH1LF_1LC0LF +public import BusyBeaver.BB6.NonHalt.M_1RB1RA_1RC1LB_1LD0RA_1LA0LE_HHH0LF_0RC0LB +public import BusyBeaver.BB6.NonHalt.M_1RB1RC_0LA1RF_1RD0LE_1LC0RB_0RA0LC_0RDHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1RC_1LC0LE_0RA1RD_1RF1LB_1LD0LA_HHH0RC +public import BusyBeaver.BB6.NonHalt.M_1RB1RC_1LC0RA_1RA0LD_0RE0LF_0LBHHH_0RF0RE +public import BusyBeaver.BB6.NonHalt.M_1RB1RC_1LC0RF_1RE0LD_1LB0LD_HHH1RF_0LF0RA +public import BusyBeaver.BB6.NonHalt.M_1RB1RC_1LC1RE_HHH1LD_0LE0LD_1RA0RF_1LD1RB +public import BusyBeaver.BB6.NonHalt.M_1RB1RC_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1RD_1LC0RB_0RD0LC_1LB0LE_1RF0RE_1RAHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1RE_0RC0RA_0LD0LF_1LA1LD_0RB0LD_1LCHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1RE_1LC1RB_1RA0LD_1RC0LB_0RFHHH_0LD1RA +public import BusyBeaver.BB6.NonHalt.M_1RB1RE_1LC1RD_1LD0LC_1RA0RF_0RDHHH_0RD0LB +public import BusyBeaver.BB6.NonHalt.M_1RB1RF_0RC1RE_1LD1RB_0LE0LC_1RA0LC_0RBHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1RF_1LC0LE_1RD0LB_1RA0RC_1RE1LB_0RDHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1RF_1LC0LF_HHH0LD_0LE1LD_0RF0LB_1RA1RE +public import BusyBeaver.BB6.NonHalt.M_1RB1RF_1LC0RD_HHH0LD_1LE0LD_1RA0RF_0RE0LB +public import BusyBeaver.BB6.NonHalt.M_1RB1RF_1LC1RE_HHH0LD_1LE0LD_1RA0RF_0RE0LB +public import BusyBeaver.BB6.NonHalt.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LA0LB_0RBHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LB0LB_0RBHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_0RBHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RAHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1REHHH +public import BusyBeaver.BB6.NonHalt.M_1RB1RF_1RC1RA_1LD0LA_HHH0LE_0LF1LE_0RA0LC +public import BusyBeaver.BB6.NonHalt.M_1RBHHH_0LC1RF_1LE0RD_0RB1RC_1RD0LE_0RC1RA +public import BusyBeaver.BB6.NonHalt.M_1RBHHH_0RC0LD_1RD1RC_1LB0LE_1LF0RA_0LD1LA +public import BusyBeaver.BB6.NonHalt.M_1RBHHH_0RC0RA_1RD1RC_1LE1LF_0LB0LD_0LE0RC +public import BusyBeaver.BB6.NonHalt.M_1RBHHH_0RC1LF_0RD1RB_1LE1RC_0LB0LE_0LE0LA +public import BusyBeaver.BB6.NonHalt.M_1RBHHH_0RC1LF_1LC1LD_1RE0RA_0RD1RF_0LD0LF +public import BusyBeaver.BB6.NonHalt.M_1RBHHH_1LC0LF_1RD1LB_1RE0RD_1LB0RB_1LB0LA +public import BusyBeaver.BB6.NonHalt.M_1RBHHH_1LC0RC_0LD0LC_1RE1RA_0RD1LF_0LE0LF +public import BusyBeaver.BB6.NonHalt.M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_0RA0RC +public import BusyBeaver.BB6.NonHalt.M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_1RA0RC +public import BusyBeaver.BB6.NonHalt.M_1RBHHH_1LC1LD_1LD0LB_1RE1LC_1RF0RE_1RA0RC +public import BusyBeaver.BB6.NonHalt.M_1RBHHH_1LC1RE_1LD0LC_1LE1LC_1RF0RE_1RA0RB +public import BusyBeaver.BB6.NonHalt.M_1RBHHH_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA +public import BusyBeaver.BB6.NonHalt.M_1RBHHH_1RC0RF_1LD1RB_1LE0LD_1RB0LB_1RB1RA +public import BusyBeaver.BB6.NonHalt.M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC +public import BusyBeaver.BB6.NonHalt.M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RB0LC +public import BusyBeaver.BB6.NonHalt.M_1RBHHH_1RC1LF_1LD1RE_1LB0LD_1RA0RC_1RC0LE +public import BusyBeaver.BB6.NonHalt.M_1RBHHH_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC +public import BusyBeaver.BB6.NonHalt.M_1RBHHH_1RC1RE_1LD0RC_0RE0LD_1LC0LF_1RA0RF + /-! # Busy Beaver Holdouts (`BusyBeaver`) diff --git a/BusyBeaver/BB33/M_1RB0LB0RC_2LC2LA1RA_1RA1LCHHH.lean b/BusyBeaver/BB33/M_1RB0LB0RC_2LC2LA1RA_1RA1LCHHH.lean index ae98ecfc..ba3cd93a 100644 --- a/BusyBeaver/BB33/M_1RB0LB0RC_2LC2LA1RA_1RA1LCHHH.lean +++ b/BusyBeaver/BB33/M_1RB0LB0RC_2LC2LA1RA_1RA1LCHHH.lean @@ -55,8 +55,9 @@ def start : State := .A 1 1 /-- Encoding of `State` into Turing machine configurations. -/ def encode : State → Cfg (Fin 3) (Fin 3) | .A a c => - ((default <+ ([1, 0] : List (Fin 3)) ^ c) {{A}}> - (([1] : List (Fin 3)) ^ a +> ((2 : Fin 3) >> default))) + Cfg.headRight A + (default <+ ([1, 0] : List (Fin 3)) ^ c) + (([1] : List (Fin 3)) ^ a +> ((2 : Fin 3) >> default)) /-- Accelerated transition function on `State` (`none` indicates halting). -/ def next : State → Option State diff --git a/BusyBeaver/BB33/M_1RB2LC1RC_2LCHHH2RB_2LA0LB0RA.lean b/BusyBeaver/BB33/M_1RB2LC1RC_2LCHHH2RB_2LA0LB0RA.lean index cc7d9774..f75efa1d 100644 --- a/BusyBeaver/BB33/M_1RB2LC1RC_2LCHHH2RB_2LA0LB0RA.lean +++ b/BusyBeaver/BB33/M_1RB2LC1RC_2LCHHH2RB_2LA0LB0RA.lean @@ -72,7 +72,8 @@ def start : State := .A 0 1 /-- Encoding of `State` into Turing machine configurations. -/ def encode : State → Cfg (Fin 3) (Fin 3) | .A a c => - ((default <+ ([1] : List (Fin 3))) <+ ([2] : List (Fin 3)) ^ a) <{{C}} + Cfg.headLeft C + (((default <+ ([1] : List (Fin 3))) <+ ([2] : List (Fin 3)) ^ a)) (([2, 0] : List (Fin 3)) ^ c +> default) /-- Accelerated transition function on `State` (`none` indicates halting). -/ diff --git a/BusyBeaver/BB33/M_1RB2RA1LC_2LC1RB2RB_HHH2LA1LA.lean b/BusyBeaver/BB33/M_1RB2RA1LC_2LC1RB2RB_HHH2LA1LA.lean index b3c1d6e2..86250ad2 100644 --- a/BusyBeaver/BB33/M_1RB2RA1LC_2LC1RB2RB_HHH2LA1LA.lean +++ b/BusyBeaver/BB33/M_1RB2RA1LC_2LC1RB2RB_HHH2LA1LA.lean @@ -72,8 +72,9 @@ def start : State := .A 2 0 0 @[simp] def encode : State → Cfg (Fin 3) (Fin 3) | .A a b c => - (((default <+ ([2, 1] : List (Fin 3)) ^ a) <+ ([1] : List (Fin 3)) ^ (2 * b + 2)) <{{A}} - (([1] : List (Fin 3)) ^ (2 * (c + 2)) +> default)) + Cfg.headLeft A + (((default <+ ([2, 1] : List (Fin 3)) ^ a) <+ ([1] : List (Fin 3)) ^ (2 * b + 2))) + (([1] : List (Fin 3)) ^ (2 * (c + 2)) +> default) /-- Ligocki and savask's 7-rule mod-6 Collatz-like map for Bigfoot (`none` indicates halting at $a = 0, b \equiv 1 \pmod 6$). -/ diff --git a/BusyBeaver/BB6/Accelerations/M_1RB1RA_1LC0RC_HHH0LD_0LE0RF_1RE0RA_0LF1LB.lean b/BusyBeaver/BB6/Accelerations/M_1RB1RA_1LC0RC_HHH0LD_0LE0RF_1RE0RA_0LF1LB.lean index 6a20bc93..3fb18e32 100644 --- a/BusyBeaver/BB6/Accelerations/M_1RB1RA_1LC0RC_HHH0LD_0LE0RF_1RE0RA_0LF1LB.lean +++ b/BusyBeaver/BB6/Accelerations/M_1RB1RA_1LC0RC_HHH0LD_0LE0RF_1RE0RA_0LF1LB.lean @@ -974,7 +974,7 @@ private theorem mode_EB_n_00_closed (L R : List (ℕ × ℕ)) : private theorem cfg_EL_n_00_nil_eq (R : List (ℕ × ℕ)) : cfg_EL_n_00 [] R = cfg_EB_n_00 [] R := by - unfold cfg_EL_n_00 cfg_EB_n_00 Cfg.headLeft + unfold cfg_EL_n_00 cfg_EB_n_00; try unfold Cfg.headLeft simp [encLeft_nil] private theorem mode_EL_n_00_closed (L R : List (ℕ × ℕ)) : diff --git a/BusyBeaver/BB6/Accelerations/M_1RB1RE_1LC0RC_1RA1LD_1RB0LA_0LC1RF_HHH1RD.lean b/BusyBeaver/BB6/Accelerations/M_1RB1RE_1LC0RC_1RA1LD_1RB0LA_0LC1RF_HHH1RD.lean index ecb3befa..9540570d 100644 --- a/BusyBeaver/BB6/Accelerations/M_1RB1RE_1LC0RC_1RA1LD_1RB0LA_0LC1RF_HHH1RD.lean +++ b/BusyBeaver/BB6/Accelerations/M_1RB1RE_1LC0RC_1RA1LD_1RB0LA_0LC1RF_HHH1RD.lean @@ -322,7 +322,7 @@ private theorem step_B_single_ge4 (L : List ℕ) (e₀ c : ℕ) : ListBlank.append_pow_succ ([1] : List (Fin 2)) c] simp only [list_pow_succ, list_pow_zero, List.cons_append, List.nil_append, ListBlank.append_cons, ListBlank.append_nil] - rw [Cfg.headLeft_cons] + try rw [Cfg.headLeft_cons] bb_steps exact ((shift_B_cons L e₀ [] (c + 4)).trans hturn).trans (reaches_drainD (4 :: bumpHeadBy (2 * e₀) L) [] c) @@ -362,7 +362,7 @@ private theorem step_B_cons_ge2 (L : List ℕ) (e₀ e₁ : ℕ) (E₂ : List ListBlank.append_pow_succ ([1] : List (Fin 2)) (2 * e₁)] simp only [list_pow_succ, list_pow_zero, List.cons_append, List.nil_append, ListBlank.append_cons, ListBlank.append_nil] - rw [Cfg.headLeft_cons] + try rw [Cfg.headLeft_cons] bb_steps exact ((shift_B_cons L e₀ ((e₁ + 2) :: E₂) c).trans hturn).trans (reaches_drainD (4 :: bumpHeadBy (2 * e₀) L) (e₁ :: E₂) c) diff --git a/BusyBeaver/BB6/Halt/M_1RB0LB_0LC0RE_1LA1LD_0LB1LD_1RA0RF_1RAHHH.lean b/BusyBeaver/BB6/Halt/M_1RB0LB_0LC0RE_1LA1LD_0LB1LD_1RA0RF_1RAHHH.lean new file mode 100644 index 00000000..0fe5ac24 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB0LB_0LC0RE_1LA1LD_0LB1LD_1RA0RF_1RAHHH.lean @@ -0,0 +1,403 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.RleCarryData + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.M_1RB0LB_0LC0RE_1LA1LD_0LB1LD_1RA0RF_1RAHHH + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LB_0LC0RE_1LA1LD_0LB1LD_1RA0RF_1RAHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +namespace Solution + +open Counter BusyBeaver.RleCarryEngine + +set_option maxRecDepth 4000000 in +instance : HasRleCarryRules target_tm where + carry_Z := fun l r => + ⟨46, + Counter.wmultiStep_sound (tm := target_tm) 46 ⟨B, 1, [0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, + 1, 1, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + carry_P := fun l r => + ⟨16, + Counter.wmultiStep_sound (tm := target_tm) 16 ⟨B, 1, [0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, + 1, 1, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + carry_PMUTM := fun l r => + ⟨68, + Counter.wmultiStep_sound (tm := target_tm) 68 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, + 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, + 1]⟩ l r rfl⟩ + carry_PTTW := fun l r => + ⟨102, + Counter.wmultiStep_sound (tm := target_tm) 102 ⟨B, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, + 1]⟩ l r rfl⟩ + carry_PTTT := fun l r => + ⟨72, + Counter.wmultiStep_sound (tm := target_tm) 72 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, + 1]⟩ l r rfl⟩ + carry_PTTTM := fun l r => + ⟨85, + Counter.wmultiStep_sound (tm := target_tm) 85 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, + 1, 1, 0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, + 1, 1, 0, 1]⟩ l r rfl⟩ + turn_UM := fun r => + ⟨53, + Counter.cmultiStep_sound (tm := target_tm) 53 ⟨B, 1, [0, 1, 1, 0, 1], [0, 1, 0, 0, 1, 0, 0, 1, + 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1], []⟩ r rfl⟩ + turn_UMT := fun r => + ⟨83, + Counter.cmultiStep_sound (tm := target_tm) 83 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 0, 1], [0, 1, 0, 0, + 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1], []⟩ r rfl⟩ + turn_ZT := fun l r => + ⟨53, + Counter.wmultiStep_sound (tm := target_tm) 53 ⟨B, 1, [0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, + 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_WM := fun l r => + ⟨47, + Counter.wmultiStep_sound (tm := target_tm) 47 ⟨B, 1, [0, 1, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, + 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_PT := fun l r => + ⟨97, + Counter.wmultiStep_sound (tm := target_tm) 97 ⟨B, 1, [0, 1, 1, 1, 0, 1, 0, 0, 1, 1], [0, 1, 0, + 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_ZM := fun l r => + ⟨47, + Counter.wmultiStep_sound (tm := target_tm) 47 ⟨B, 1, [0, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, + 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + turn_PTW := fun l r => + ⟨119, + Counter.wmultiStep_sound (tm := target_tm) 119 ⟨B, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, + 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1], []⟩ l r rfl⟩ + turn_PTM := fun l r => + ⟨83, + Counter.wmultiStep_sound (tm := target_tm) 83 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1], + [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_PTT := fun l r => + ⟨87, + Counter.wmultiStep_sound (tm := target_tm) 87 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, + 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1], []⟩ l r rfl⟩ + turn_ZMU := fun l r => + ⟨93, + Counter.wmultiStep_sound (tm := target_tm) 93 ⟨B, 1, [0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, + 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_ZTM := fun l r => + ⟨103, + Counter.wmultiStep_sound (tm := target_tm) 103 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1], + [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_ZTT := fun l r => + ⟨105, + Counter.wmultiStep_sound (tm := target_tm) 105 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, + 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_ZTW := fun l r => + ⟨105, + Counter.wmultiStep_sound (tm := target_tm) 105 ⟨B, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, + 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_MUTW := fun l r => + ⟨119, + Counter.wmultiStep_sound (tm := target_tm) 119 ⟨B, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1], + [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_PTTM := fun l r => + ⟨137, + Counter.wmultiStep_sound (tm := target_tm) 137 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, + 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1], + []⟩ l r rfl⟩ + turn_ZTTW := fun l r => + ⟨137, + Counter.wmultiStep_sound (tm := target_tm) 137 ⟨B, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], + []⟩ l r rfl⟩ + turn_ZTTM := fun l r => + ⟨91, + Counter.wmultiStep_sound (tm := target_tm) 91 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, + 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], + []⟩ l r rfl⟩ + turn_ZPMU := fun l r => + ⟨135, + Counter.wmultiStep_sound (tm := target_tm) 135 ⟨B, 1, [0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, + 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], + []⟩ l r rfl⟩ + turn_ZMUTM := fun l r => + ⟨133, + Counter.wmultiStep_sound (tm := target_tm) 133 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, + 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], + []⟩ l r rfl⟩ + turn_PTTTW := fun l r => + ⟨173, + Counter.wmultiStep_sound (tm := target_tm) 173 ⟨B, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, + 0, 1, 1, 1], []⟩ l r rfl⟩ + carry_MU_to_pmuCfg := fun l r => + ⟨15, + Counter.wmultiStep_sound (tm := target_tm) 15 ⟨B, 1, [0, 1, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, + 1, 0, 1]⟩ + ⟨D, 1, [], [1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + pmu_step := fun l r => + ⟨50, + Counter.wmultiStep_sound (tm := target_tm) 50 ⟨D, 1, [0, 1, 0, 0, 1, 1], [1, 0, 0, 1, 0, 0, 1, + 1, 0, 1]⟩ + ⟨D, 1, [], [1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + pmuCfg_Z_turn := fun l r => + ⟨30, + Counter.wmultiStep_sound (tm := target_tm) 30 ⟨D, 1, [0, 0, 0, 0, 1, 1], [1, 0, 0, 1, 0, 0, 1, + 1, 0, 1, 1, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + pmuCfg_M_to_carry := fun l r => + ⟨5, + Counter.wmultiStep_sound (tm := target_tm) 5 ⟨D, 1, [0, 1, 1], [1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [0, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + pmuCfg_T_to_carry := fun l r => + ⟨5, + Counter.wmultiStep_sound (tm := target_tm) 5 ⟨D, 1, [0, 1, 1, 1], [1, 0, 0, 1, 0, 0, 1, 1, 0, + 1]⟩ + ⟨B, 1, [0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + carry_PTU := fun l r => + ⟨24, + Counter.wmultiStep_sound (tm := target_tm) 24 ⟨B, 1, [0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1], [0, + 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + turn_PTMT := fun l r => + ⟨137, + Counter.wmultiStep_sound (tm := target_tm) 137 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, + 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1], + []⟩ l r rfl⟩ + turn_ZTTT := fun l r => + ⟨137, + Counter.wmultiStep_sound (tm := target_tm) 137 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], + []⟩ l r rfl⟩ + turn_ZTTTM := fun l r => + ⟨123, + Counter.wmultiStep_sound (tm := target_tm) 123 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, + 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, + 0, 1, 1], []⟩ l r rfl⟩ + turn_ZTU_halt := fun l r => + ⟨_, ⟨26, + Counter.wmultiStep_sound (tm := target_tm) 26 ⟨B, 1, [0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [0, + 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨F, 1, [0, 0, 1, 1, 0, 1, 1, 1], [0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl⟩, rfl⟩ + r0_Z := fun l r => + ⟨10, + Counter.wmultiStep_sound (tm := target_tm) 10 ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [1, 0, + 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + r0_P := fun l r => + ⟨40, + Counter.wmultiStep_sound (tm := target_tm) 40 ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [0, 0, + 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + r0_PTTTM_TAIL := fun l r => + ⟨13, + Counter.wmultiStep_sound (tm := target_tm) 13 ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [1, 0, + 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + r1_Z := fun l r => + ⟨10, + Counter.wmultiStep_sound (tm := target_tm) 10 ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, + 1], [1, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + r1_P := fun l r => + ⟨58, + Counter.wmultiStep_sound (tm := target_tm) 58 ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, + 1], [0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + r1OddShort_Z := fun l r => + ⟨10, + Counter.wmultiStep_sound (tm := target_tm) 10 ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 1, 1, 0, + 1]⟩ + ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + r1Odd_P := fun l r => + ⟨8, + Counter.wmultiStep_sound (tm := target_tm) 8 ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, + 1], [0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + wSweep_start := fun l => + ⟨2, + Counter.rcmultiStep_sound (tm := target_tm) 2 ⟨B, 0, [1, 1], []⟩ + ⟨D, 1, [], [1]⟩ l rfl⟩ + wSweep_step := fun l r => + ⟨4, + Counter.wmultiStep_sound (tm := target_tm) 4 ⟨D, 1, [0, 0, 1, 1], [1]⟩ + ⟨D, 1, [], [1, 0, 0, 1, 1]⟩ l r rfl⟩ + dSweep_step := fun l r => + ⟨4, + Counter.wmultiStep_sound (tm := target_tm) 4 ⟨E, 1, [0, 1, 1], [0, 0, 1, 1]⟩ + ⟨E, 1, [0, 1, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + dSweep_end := fun l => + ⟨3, + Counter.rcmultiStep_sound (tm := target_tm) 3 ⟨E, 1, [0, 1, 1], []⟩ + ⟨B, 0, [1, 1, 0, 0, 1, 1], []⟩ l rfl⟩ + tSweep_step := fun l r => + ⟨20, + Counter.wmultiStep_sound (tm := target_tm) 20 ⟨E, 0, [0, 0, 0, 0, 1, 1], [0, 0, 1, 1]⟩ + ⟨E, 0, [0, 0, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + tSweep_end := fun l => + ⟨2, + Counter.rcmultiStep_sound (tm := target_tm) 2 ⟨E, 0, [0, 0, 0, 0, 1, 1], []⟩ + ⟨B, 0, [1, 1, 0, 0, 0, 0, 1, 1], []⟩ l rfl⟩ + r0_to_dSweep := fun l r => + ⟨6, + Counter.wmultiStep_sound (tm := target_tm) 6 ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [1, 0, + 1, 1]⟩ + ⟨E, 1, [0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + r1_to_dSweep := fun l r => + ⟨6, + Counter.wmultiStep_sound (tm := target_tm) 6 ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, + 1], [1, 0, 1, 1]⟩ + ⟨E, 1, [0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + r1Odd_to_tSweep := fun l r => + ⟨8, + Counter.wmultiStep_sound (tm := target_tm) 8 ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, + 1], [1, 0, 1, 1]⟩ + ⟨E, 0, [0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + wSweep_Z_to_dSweep := fun l r => + ⟨9, + Counter.wmultiStep_sound (tm := target_tm) 9 ⟨D, 1, [0, 0, 0, 0, 1, 1], [1]⟩ + ⟨E, 1, [0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + wSweep_ZT_to_dSweep := fun l r => + ⟨45, + Counter.wmultiStep_sound (tm := target_tm) 45 ⟨D, 1, [0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 0, + 1, 1]⟩ + ⟨E, 1, [0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + wSweep_PT_to_carry := fun l r => + ⟨34, + Counter.wmultiStep_sound (tm := target_tm) 34 ⟨D, 1, [0, 1, 1, 1, 0, 1, 0, 0, 1, 1], [1, 0, 0, + 1, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1]⟩ l r rfl⟩ + wSweep_ZMT_to_tSweep := fun l r => + ⟨65, + Counter.wmultiStep_sound (tm := target_tm) 65 ⟨D, 1, [0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], + [1, 0, 0, 1, 1]⟩ + ⟨E, 0, [0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + cfgR_Z_to_TW := fun l => + ⟨14, + Counter.rcmultiStep_sound (tm := target_tm) 14 ⟨B, 0, [1, 1, 0, 0, 0, 0, 1, 1], []⟩ + ⟨B, 0, [1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l rfl⟩ + cfgR_TW_to_t3Cfg := fun l => + ⟨24, + Counter.rcmultiStep_sound (tm := target_tm) 24 ⟨B, 0, [1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 1, 0, 1, 1]⟩ l rfl⟩ + t3_step := fun l r => + ⟨56, + Counter.wmultiStep_sound (tm := target_tm) 56 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1], [0, + 1, 0, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + t3Cfg_Z_zero_to_carry := fun l => + ⟨96, + Counter.rcmultiStep_sound (tm := target_tm) 96 ⟨B, 1, [0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 1, + 0, 1, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1]⟩ l rfl⟩ + t3Cfg_Z_succ_to_r0 := fun l r => + ⟨31, + Counter.wmultiStep_sound (tm := target_tm) 31 ⟨B, 1, [0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 1, 0, + 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + t3Cfg_TZ_to_r1OddShort := fun l r => + ⟨45, + Counter.wmultiStep_sound (tm := target_tm) 45 ⟨B, 1, [0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, + 0, 1]⟩ + ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + r1OddShortCfg_evalWK0_to_carry := fun l => + ⟨144, + Counter.rcmultiStep_sound (tm := target_tm) 144 ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 1, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1]⟩ l rfl⟩ + t3Cfg_TTZ_to_r0 := fun l r => + ⟨65, + Counter.wmultiStep_sound (tm := target_tm) 65 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, + 1], [0, 1, 0, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + +set_option maxRecDepth 4000000 in +theorem init_to_ckpt0 : + (init []) [target_tm]⊢* (carryCfg target_tm (evalRleAux default ckptRle_0) (evalWK 1)) := by + have h1 : evalRleAux default ckptRle_0 = + [0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, + 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, + 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, + 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1] +> default := rfl + rw [h1] + exact stepStar_trans ⟨1120, Counter.bmultiStep_sound (tm := target_tm) 1120 ⟨A, 0, [], []⟩ ⟨D, 0, + [0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, + 1, 0, 1, 1, 0, 1], [1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1]⟩ rfl⟩ + (stepStar_trans ⟨1120, Counter.bmultiStep_sound (tm := target_tm) 1120 _ ⟨A, 1, [1, 0, 0, 0, 1, + 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1], [0, 1, + 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, + 0, 0, 1, 1]⟩ rfl⟩ + (stepStar_trans ⟨1120, Counter.bmultiStep_sound (tm := target_tm) 1120 _ ⟨B, 0, [1, 1, 0, 0, 1, + 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, + 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, + 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1], [0, 1, 1, 0, 0, 1, 1]⟩ rfl⟩ + (stepStar_trans ⟨1120, Counter.bmultiStep_sound (tm := target_tm) 1120 _ ⟨B, 0, [0, 0, 0, 0, 1, + 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1], [0, 1, 1, 0, 1, 0, + 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, + 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, + 0, 1, 1]⟩ rfl⟩ + (stepStar_trans ⟨1120, Counter.bmultiStep_sound (tm := target_tm) 1120 _ ⟨B, 0, [1, 1, 0, 0, 1, + 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, + 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, + 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1], [0, 1, 1]⟩ rfl⟩ + ⟨1124, Counter.bmultiStep_sound (tm := target_tm) 1124 _ ⟨B, 1, [0, 0, 0, 0, 1, 1, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, + 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, + 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, + 0, 0, 1, 1, 0, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1]⟩ rfl⟩)))) + +end Solution + +public section + +open Solution BusyBeaver.RleCarryEngine in +theorem is_halt : IsHalt target := by + rcases runCarryTruncChunks_sound (target_tm := target_tm) + [3746, 3999, 4000, 4000, 4000, 4000, 4000, 3298] 30 ckptRle_0 1 default + runCarryTruncChunks_ckpt0 with ⟨cfg', hstep, hnone⟩ + exact ⟨cfg', stepStar_trans init_to_ckpt0 hstep, hnone⟩ + +end + +end BusyBeaver.M_1RB0LB_0LC0RE_1LA1LD_0LB1LD_1RA0RF_1RAHHH diff --git a/BusyBeaver/BB6/Halt/M_1RB0LB_0LC0RE_1LA1LD_0LB1LF_1RA1RD_0LBHHH.lean b/BusyBeaver/BB6/Halt/M_1RB0LB_0LC0RE_1LA1LD_0LB1LF_1RA1RD_0LBHHH.lean new file mode 100644 index 00000000..0a323875 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB0LB_0LC0RE_1LA1LD_0LB1LF_1RA1RD_0LBHHH.lean @@ -0,0 +1,2287 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0LB_0LC0RE_1LA1LD_0LB1LF_1RA1RD_0LBHHH + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LB_0LC0RE_1LA1LD_0LB1LF_1RA1RD_0LBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {zG_ zL_ α β γ : Type*} [Inhabited zG_] [Inhabited zL_] +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +-- ============================================================================ +-- Section 5: Specific Turing Machine: Suspect 117 (Holdout #737) +-- ============================================================================ +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +-- ============================================================================ +-- Section 6: Four Sound Concrete Steppers (`wstep`, `cstep`, `rcstep`, `bstep`) +-- ============================================================================ + +abbrev CCfg := Counter.CCfg (Fin 2) (Fin 6) +abbrev wmultiStep := Counter.wmultiStep target_tm +abbrev cmultiStep := Counter.cmultiStep target_tm +abbrev rcmultiStep := Counter.rcmultiStep target_tm +abbrev bmultiStep := Counter.bmultiStep target_tm + +-- ============================================================================ +-- Section 6.3: Token & RLE Encoding (`Tok`, `Mode`, `Rle`, `evalRle`, `evalRStack`, `evalWK`) +-- ============================================================================ + +inductive Tok + | U | M | W | Z | T | P | PTTTM_TAIL + deriving DecidableEq, Repr + +inductive Mode + | R0 | R1 | R1_ODD + deriving DecidableEq, Repr + +def isZpWord : List Tok → Bool + | [] => true + | .Z :: ts => isZpWord ts + | .P :: ts => isZpWord ts + | _ :: _ => false + +def revWord : List Tok → List Tok + | [] => [] + | t :: ts => revWord ts ++ [t] + +@[simp] theorem revWord_nil : revWord [] = [] := rfl +@[simp] theorem revWord_cons (t : Tok) (ts : List Tok) : revWord (t :: ts) = revWord ts ++ [t] := rfl + +@[simp] theorem revWord_append (w₁ w₂ : List Tok) : + revWord (w₁ ++ w₂) = revWord w₂ ++ revWord w₁ := by + induction w₁ with + | nil => simp + | cons t ts ih => simp [ih, List.append_assoc] + +@[simp] theorem revWord_revWord (w : List Tok) : revWord (revWord w) = w := by + induction w with + | nil => rfl + | cons t ts ih => simp [ih] + +@[simp] theorem isZpWord_append (w₁ w₂ : List Tok) : + isZpWord (w₁ ++ w₂) = (isZpWord w₁ && isZpWord w₂) := by + induction w₁ with + | nil => simp [isZpWord] + | cons t ts ih => + cases t <;> simp [isZpWord, ih] + +@[simp] theorem isZpWord_revWord (w : List Tok) : + isZpWord (revWord w) = isZpWord w := by + induction w with + | nil => rfl + | cons t ts ih => + simp [isZpWord_append, ih] + cases t <;> simp [isZpWord, Bool.and_comm] + +def tokL : Tok → List (Fin 2) + | .U => [0, 1] + | .M => [0, 1, 1] + | .W => [0, 0, 1, 1] + | .Z => [0, 0, 0, 0, 1, 1] + | .T => [0, 1, 1, 1] + | .P => [0, 1, 0, 0, 1, 1] + | .PTTTM_TAIL => [] + +def tokR : Tok → List (Fin 2) + | .Z => [1, 0, 1, 1, 0, 1] + | .P => [0, 0, 1, 1, 0, 1] + | .PTTTM_TAIL => [1, 0, 1, 0, 0, 1, 1, 0, 1] + | _ => [] + +def wordL : List Tok → List (Fin 2) := encWords tokL +def wordR : List Tok → List (Fin 2) := encWords tokR + +@[simp] theorem wordL_nil : wordL [] = [] := encWords_nil tokL +@[simp] theorem wordL_cons (t : Tok) (ts : List Tok) : wordL (t :: ts) = tokL t ++ wordL ts := encWords_cons tokL t ts +@[simp] theorem wordL_append (w₁ w₂ : List Tok) : wordL (w₁ ++ w₂) = wordL w₁ ++ wordL w₂ := encWords_append tokL w₁ w₂ +@[simp] theorem wordR_nil : wordR [] = [] := encWords_nil tokR +@[simp] theorem wordR_cons (t : Tok) (ts : List Tok) : wordR (t :: ts) = tokR t ++ wordR ts := encWords_cons tokR t ts +@[simp] theorem wordR_append (w₁ w₂ : List Tok) : wordR (w₁ ++ w₂) = wordR w₁ ++ wordR w₂ := encWords_append tokR w₁ w₂ + +abbrev Rle := List (List Tok × Nat) + +def evalRle : Rle → ListBlank (Fin 2) + | [] => default + | (w, c) :: rest => ((wordL w) ^ c) +> evalRle rest + +def evalRStack : Rle → ListBlank (Fin 2) → ListBlank (Fin 2) + | [], r_end => r_end + | (w, c) :: rest, r_end => ((wordR w) ^ c) +> evalRStack rest r_end + +@[simp] theorem evalRle_nil : evalRle [] = default := rfl +@[simp] theorem evalRle_cons (w : List Tok) (c : Nat) (rest : Rle) : + evalRle ((w, c) :: rest) = ((wordL w) ^ c) +> evalRle rest := rfl + +@[simp] theorem evalRStack_nil (r_end : ListBlank (Fin 2)) : evalRStack [] r_end = r_end := rfl +@[simp] theorem evalRStack_cons (w : List Tok) (c : Nat) (rest : Rle) (r_end : ListBlank (Fin 2)) : + evalRStack ((w, c) :: rest) r_end = ((wordR w) ^ c) +> evalRStack rest r_end := rfl + +def pushRle (w : List Tok) (c : Nat) (rle : Rle) : Rle := + if c == 0 || w.isEmpty then rle + else match rle with + | (w', c') :: rest => + if w == w' then (w, c + c') :: rest + else (w, c) :: rle + | [] => [(w, c)] + +@[simp] theorem evalRle_pushRle (w : List Tok) (c : Nat) (rle : Rle) : + evalRle (pushRle w c rle) = ((wordL w) ^ c) +> evalRle rle := by + unfold pushRle + by_cases hc : c = 0 + · subst hc; simp + · by_cases hw : w = [] + · subst hw; simp + · have hcond : (c == 0 || w.isEmpty) = false := by + cases w with + | nil => contradiction + | cons _ _ => simp [hc] + rw [hcond] + cases rle with + | nil => rfl + | cons hd rest => + rcases hd with ⟨w', c'⟩ + by_cases hww : w = w' + · subst hww; simp [list_pow_add] + · have hbeq : (w == w') = false := beq_false_of_ne hww + simp [hbeq] + +@[simp] theorem evalRStack_pushRle (w : List Tok) (c : Nat) (rs : Rle) (r_end : ListBlank (Fin 2)) : + evalRStack (pushRle w c rs) r_end = ((wordR w) ^ c) +> evalRStack rs r_end := by + unfold pushRle + by_cases hc : c = 0 + · subst hc; simp + · by_cases hw : w = [] + · subst hw; simp + · have hcond : (c == 0 || w.isEmpty) = false := by + cases w with + | nil => contradiction + | cons _ _ => simp [hc] + rw [hcond] + cases rs with + | nil => rfl + | cons hd rest => + rcases hd with ⟨w', c'⟩ + by_cases hww : w = w' + · subst hww; simp [list_pow_add] + · have hbeq : (w == w') = false := beq_false_of_ne hww + simp [hbeq] + +@[simp] def pushToksLtr : List Tok → Rle → Rle + | [], rle => rle + | t :: ts, rle => pushToksLtr ts (pushRle [t] 1 rle) + +def popLastTok : Rle → Option (Tok × Rle) + | [] => none + | ([], _) :: rest => popLastTok rest + | (t :: ts, c) :: rest => + if c == 0 then popLastTok rest + else + let rest' := if c == 1 then rest else (t :: ts, c - 1) :: rest + some (t, pushRle ts 1 rest') + +theorem popLastTok_sound : ∀ (rle : Rle) (t : Tok) (rle' : Rle), + popLastTok rle = some (t, rle') → + evalRle rle = tokL t +> evalRle rle' + | [], _, _, h => by nomatch h + | ([], c) :: rest, t, rle', h => by + simp only [popLastTok] at h + have ih := popLastTok_sound rest t rle' h + simpa using! ih + | (t₀ :: ts, 0) :: rest, t, rle', h => by + simp only [popLastTok, beq_self_eq_true, ↓reduceIte] at h + have ih := popLastTok_sound rest t rle' h + simpa using! ih + | (t₀ :: ts, c + 1) :: rest, t, rle', h => by + simp only [popLastTok, Nat.add_one_ne_zero, beq_iff_eq, ↓reduceIte, + Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + cases c with + | zero => + simp [pow_succ_list] + | succ c' => + simp [pow_succ_list] + +-- ============================================================================ +-- Section 6.4: Named Configurations & 59 Verified Micro-Step Lemmas +-- ============================================================================ + +def evalWK (k1 : Nat) : ListBlank (Fin 2) := + [1, 0, 1, 1] +> ((([0, 0, 1, 1] : List (Fin 2)) ^ k1) +> default) + +def cfgR (l : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some B, ⟨0, [1, 1] +> l, default⟩⟩ + +def carryCfg (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some B, ⟨1, l, [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1] +> r⟩⟩ + +def r0Cfg (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some E, ⟨0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1] +> l, r⟩⟩ + +def r1Cfg (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some E, ⟨0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1] +> l, r⟩⟩ + +def r1OddShortCfg (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some B, ⟨1, [1, 1, 0, 0, 0, 0, 1, 1] +> l, r⟩⟩ + +def r1OddCfg (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + r1OddShortCfg (tokL .Z +> l) r + +def wSweepCfg (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some D, ⟨1, l, [1] +> r⟩⟩ + +def dSweepCfg (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some E, ⟨1, [0, 1, 1] +> l, r⟩⟩ + +def tSweepCfg (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some E, ⟨0, [0, 0, 0, 0, 1, 1] +> l, r⟩⟩ + +def t3Cfg (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some B, ⟨1, l, [0, 1, 0, 0, 1] +> r⟩⟩ + +def pmuCfg (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some D, ⟨1, l, [1, 0, 0, 1, 0, 0, 1, 1, 0, 1] +> r⟩⟩ + +theorem init_to_carry0 : + (init []) [target_tm]⊢^{307} (carryCfg (tokL .M +> (tokL .U +> default)) (evalWK 1)) := + bmultiStep_sound 307 ⟨A, 0, [], []⟩ + ⟨B, 1, [0, 1, 1, 0, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1]⟩ rfl + +theorem carry_Z (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .Z +> l) r) [target_tm]⊢^{48} (carryCfg l (tokR .Z +> r)) := + wmultiStep_sound 48 ⟨B, 1, [0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1]⟩ l r rfl + +theorem carry_P (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .P +> l) r) [target_tm]⊢^{16} (carryCfg l (tokR .P +> r)) := + wmultiStep_sound 16 ⟨B, 1, [0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl + +theorem carry_PMUTM (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .M +> (tokL .T +> (tokL .U +> (tokL .M +> (tokL .P +> l))))) r) [target_tm]⊢^{68} (carryCfg l (((tokR .Z) ^ 2) +> (tokR .P +> r))) := + wmultiStep_sound 68 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl + +theorem carry_PTTW (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .W +> (((tokL .T) ^ 2) +> (tokL .P +> l))) r) [target_tm]⊢^{104} (carryCfg l (((tokR .Z) ^ 3) +> r)) := + wmultiStep_sound 104 ⟨B, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1]⟩ l r rfl + +theorem carry_PTTT (l r : ListBlank (Fin 2)) : + (carryCfg (((tokL .T) ^ 3) +> (tokL .P +> l)) r) [target_tm]⊢^{72} (carryCfg l (((tokR .Z) ^ 2) +> (tokR .P +> r))) := + wmultiStep_sound 72 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl + +theorem carry_PTTTM (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .M +> (((tokL .T) ^ 3) +> (tokL .P +> l))) r) [target_tm]⊢^{85} (carryCfg l (((tokR .Z) ^ 2) +> (tokR .PTTTM_TAIL +> r))) := + wmultiStep_sound 85 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl + +theorem turn_UM (r : ListBlank (Fin 2)) : + (carryCfg (tokL .M +> (tokL .U +> default)) r) [target_tm]⊢^{57} (r1Cfg (tokL .M +> (tokL .U +> default)) r) := + cmultiStep_sound 57 ⟨B, 1, [0, 1, 1, 0, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1], []⟩ r rfl + +theorem turn_UMT (r : ListBlank (Fin 2)) : + (carryCfg (tokL .T +> (tokL .M +> (tokL .U +> default))) r) [target_tm]⊢^{89} (r1Cfg (tokL .Z +> (tokL .U +> default)) r) := + cmultiStep_sound 89 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 0, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1], []⟩ r rfl + +theorem turn_ZT (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .T +> (tokL .Z +> l)) r) [target_tm]⊢^{57} (r1Cfg (tokL .M +> (tokL .T +> l)) r) := + wmultiStep_sound 57 ⟨B, 1, [0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl + +theorem turn_WM (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .M +> (tokL .W +> l)) r) [target_tm]⊢^{51} (r1Cfg (tokL .T +> l) r) := + wmultiStep_sound 51 ⟨B, 1, [0, 1, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl + +theorem turn_PT (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .T +> (tokL .P +> l)) r) [target_tm]⊢^{105} (r0Cfg (tokL .P +> (tokL .T +> l)) r) := + wmultiStep_sound 105 ⟨B, 1, [0, 1, 1, 1, 0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl + +theorem turn_ZM (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .M +> (tokL .Z +> l)) r) [target_tm]⊢^{51} (r1Cfg (tokL .P +> l) r) := + wmultiStep_sound 51 ⟨B, 1, [0, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl + +theorem turn_PTW (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .W +> (tokL .T +> (tokL .P +> l))) r) [target_tm]⊢^{127} (r1OddCfg (tokL .Z +> (tokL .U +> (tokL .M +> l))) r) := + wmultiStep_sound 127 ⟨B, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1], []⟩ l r rfl + +theorem turn_PTM (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .M +> (tokL .T +> (tokL .P +> l))) r) [target_tm]⊢^{89} (r1Cfg (tokL .Z +> (tokL .T +> l)) r) := + wmultiStep_sound 89 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl + +theorem turn_PTT (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .T +> (tokL .T +> (tokL .P +> l))) r) [target_tm]⊢^{93} (r1Cfg (tokL .Z +> (tokL .U +> (tokL .M +> l))) r) := + wmultiStep_sound 93 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1], []⟩ l r rfl + +theorem turn_ZMU (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .U +> (tokL .M +> (tokL .Z +> l))) r) [target_tm]⊢^{101} (r1OddCfg (tokL .T +> (tokL .T +> l)) r) := + wmultiStep_sound 101 ⟨B, 1, [0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1], []⟩ l r rfl + +theorem turn_ZTM (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .M +> (tokL .T +> (tokL .Z +> l))) r) [target_tm]⊢^{111} (r0Cfg (tokL .P +> (tokL .M +> (tokL .T +> l))) r) := + wmultiStep_sound 111 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl + +theorem turn_ZTT (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .T +> (tokL .T +> (tokL .Z +> l))) r) [target_tm]⊢^{115} (r0Cfg (tokL .P +> (tokL .W +> (tokL .T +> l))) r) := + wmultiStep_sound 115 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl + +theorem turn_ZTW (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .W +> (tokL .T +> (tokL .Z +> l))) r) [target_tm]⊢^{115} (r0Cfg (tokL .Z +> (tokL .W +> (tokL .T +> l))) r) := + wmultiStep_sound 115 ⟨B, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl + +theorem turn_MUTW (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .W +> (tokL .T +> (tokL .U +> (tokL .M +> l)))) r) [target_tm]⊢^{127} (r1OddCfg (tokL .Z +> (tokL .T +> l)) r) := + wmultiStep_sound 127 ⟨B, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl + +theorem turn_PTTM (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .M +> (tokL .T +> (tokL .T +> (tokL .P +> l)))) r) [target_tm]⊢^{147} (r0Cfg (tokL .P +> (tokL .Z +> (tokL .U +> (tokL .M +> l)))) r) := + wmultiStep_sound 147 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1], []⟩ l r rfl + +theorem turn_ZTTW (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .W +> (tokL .T +> (tokL .T +> (tokL .Z +> l)))) r) [target_tm]⊢^{147} (r0Cfg (tokL .Z +> (tokL .Z +> (tokL .P +> l))) r) := + wmultiStep_sound 147 ⟨B, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl + +theorem turn_ZTTM (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .M +> (tokL .T +> (tokL .T +> (tokL .Z +> l)))) r) [target_tm]⊢^{99} (r1Cfg (tokL .Z +> (tokL .W +> (tokL .T +> l))) r) := + wmultiStep_sound 99 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl + +theorem turn_ZPMU (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .U +> (tokL .M +> (tokL .P +> (tokL .Z +> l)))) r) [target_tm]⊢^{147} (r0Cfg (tokL .P +> (tokL .M +> (tokL .W +> (tokL .T +> l)))) r) := + wmultiStep_sound 147 ⟨B, 1, [0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl + +theorem turn_ZMUTM (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .M +> (tokL .T +> (tokL .U +> (tokL .M +> (tokL .Z +> l))))) r) [target_tm]⊢^{143} (r0Cfg (tokL .P +> (tokL .Z +> (tokL .P +> l))) r) := + wmultiStep_sound 143 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl + +theorem turn_PTTTW (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .W +> (tokL .T +> (tokL .T +> (tokL .T +> (tokL .P +> l))))) r) [target_tm]⊢^{185} (r0Cfg (tokL .Z +> (tokL .Z +> (tokL .Z +> (tokL .T +> l)))) r) := + wmultiStep_sound 185 ⟨B, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl + +theorem carry_MU_to_pmuCfg (l r : ListBlank (Fin 2)) : + (carryCfg (tokL .U +> (tokL .M +> l)) r) [target_tm]⊢^{15} (pmuCfg l (tokR .P +> r)) := + wmultiStep_sound 15 ⟨B, 1, [0, 1, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨D, 1, [], [1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl + +theorem pmu_step (l r : ListBlank (Fin 2)) : + (pmuCfg (tokL .P +> l) r) [target_tm]⊢^{52} (pmuCfg l (tokR .Z +> r)) := + wmultiStep_sound 52 ⟨D, 1, [0, 1, 0, 0, 1, 1], [1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨D, 1, [], [1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1]⟩ l r rfl + +theorem pmuCfg_Z_turn (l r : ListBlank (Fin 2)) : + (pmuCfg (tokL .Z +> l) (tokR .Z +> r)) [target_tm]⊢^{36} (r0Cfg (tokL .M +> (tokL .W +> (tokL .T +> l))) r) := + wmultiStep_sound 36 ⟨D, 1, [0, 0, 0, 0, 1, 1], [1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl + +theorem pmuCfg_TM_halt (l r : ListBlank (Fin 2)) : + (pmuCfg (tokL .M +> (tokL .T +> l)) r) [target_tm]⊢^{21} (⟨some F, ⟨1, [] +> l, [1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1] +> r⟩⟩) := + wmultiStep_sound 21 ⟨D, 1, [0, 1, 1, 0, 1, 1, 1], [1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨F, 1, [], [1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl + +theorem r0_Z (l r : ListBlank (Fin 2)) : + (r0Cfg l (tokR .Z +> r)) [target_tm]⊢^{12} (r0Cfg (tokL .Z +> l) r) := + wmultiStep_sound 12 ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl + +theorem r0_P (l r : ListBlank (Fin 2)) : + (r0Cfg l (tokR .P +> r)) [target_tm]⊢^{44} (r0Cfg (tokL .P +> l) r) := + wmultiStep_sound 44 ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl + +theorem r0_PTTTM_TAIL (l r : ListBlank (Fin 2)) : + (r0Cfg l (tokR .PTTTM_TAIL +> r)) [target_tm]⊢^{15} (r1Cfg (tokL .Z +> l) r) := + wmultiStep_sound 15 ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl + +theorem r1_Z (l r : ListBlank (Fin 2)) : + (r1Cfg l (tokR .Z +> r)) [target_tm]⊢^{12} (r0Cfg (tokL .M +> (tokL .Z +> l)) r) := + wmultiStep_sound 12 ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl + +theorem r1_P (l r : ListBlank (Fin 2)) : + (r1Cfg l (tokR .P +> r)) [target_tm]⊢^{62} (r1OddCfg (tokL .P +> l) r) := + wmultiStep_sound 62 ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], [0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl + +theorem r1OddShort_Z (l r : ListBlank (Fin 2)) : + (r1OddShortCfg l (tokR .Z +> r)) [target_tm]⊢^{12} (r1OddShortCfg (tokL .Z +> l) r) := + wmultiStep_sound 12 ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl + +theorem r1Odd_P (l r : ListBlank (Fin 2)) : + (r1OddCfg l (tokR .P +> r)) [target_tm]⊢^{10} (r1Cfg (tokL .Z +> l) r) := + wmultiStep_sound 10 ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl + +theorem wSweep_start (l : ListBlank (Fin 2)) : + (cfgR l) [target_tm]⊢^{2} (wSweepCfg l default) := + rcmultiStep_sound 2 ⟨B, 0, [1, 1], []⟩ + ⟨D, 1, [], [1]⟩ l rfl + +theorem wSweep_step (l r : ListBlank (Fin 2)) : + (wSweepCfg (tokL .W +> l) r) [target_tm]⊢^{4} (wSweepCfg l ([0, 0, 1, 1] +> r)) := + wmultiStep_sound 4 ⟨D, 1, [0, 0, 1, 1], [1]⟩ + ⟨D, 1, [], [1, 0, 0, 1, 1]⟩ l r rfl + +theorem dSweep_step (l r : ListBlank (Fin 2)) : + (dSweepCfg l ([0, 0, 1, 1] +> r)) [target_tm]⊢^{6} (dSweepCfg (tokL .W +> l) r) := + wmultiStep_sound 6 ⟨E, 1, [0, 1, 1], [0, 0, 1, 1]⟩ + ⟨E, 1, [0, 1, 1, 0, 0, 1, 1], []⟩ l r rfl + +theorem dSweep_end (l : ListBlank (Fin 2)) : + (dSweepCfg l default) [target_tm]⊢^{5} (cfgR (tokL .W +> l)) := + rcmultiStep_sound 5 ⟨E, 1, [0, 1, 1], []⟩ + ⟨B, 0, [1, 1, 0, 0, 1, 1], []⟩ l rfl + +theorem tSweep_step (l r : ListBlank (Fin 2)) : + (tSweepCfg l ([0, 0, 1, 1] +> r)) [target_tm]⊢^{22} (tSweepCfg (tokL .T +> l) r) := + wmultiStep_sound 22 ⟨E, 0, [0, 0, 0, 0, 1, 1], [0, 0, 1, 1]⟩ + ⟨E, 0, [0, 0, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl + +theorem tSweep_end (l : ListBlank (Fin 2)) : + (tSweepCfg l default) [target_tm]⊢^{2} (cfgR (tokL .Z +> l)) := + rcmultiStep_sound 2 ⟨E, 0, [0, 0, 0, 0, 1, 1], []⟩ + ⟨B, 0, [1, 1, 0, 0, 0, 0, 1, 1], []⟩ l rfl + +theorem r0_to_dSweep (l r : ListBlank (Fin 2)) : + (r0Cfg l ([1, 0, 1, 1] +> r)) [target_tm]⊢^{6} (dSweepCfg (tokL .Z +> (tokL .Z +> l)) r) := + wmultiStep_sound 6 ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 1, 1]⟩ + ⟨E, 1, [0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl + +theorem r1_to_dSweep (l r : ListBlank (Fin 2)) : + (r1Cfg l ([1, 0, 1, 1] +> r)) [target_tm]⊢^{6} (dSweepCfg (tokL .Z +> (tokL .M +> (tokL .Z +> l))) r) := + wmultiStep_sound 6 ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 1, 1]⟩ + ⟨E, 1, [0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl + +theorem r1Odd_to_tSweep (l r : ListBlank (Fin 2)) : + (r1OddCfg l ([1, 0, 1, 1] +> r)) [target_tm]⊢^{10} (tSweepCfg (tokL .Z +> (tokL .Z +> l)) r) := + wmultiStep_sound 10 ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 1, 1]⟩ + ⟨E, 0, [0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl + +theorem wSweep_Z_to_dSweep (l r : ListBlank (Fin 2)) : + (wSweepCfg (tokL .Z +> l) r) [target_tm]⊢^{9} (dSweepCfg (tokL .T +> l) r) := + wmultiStep_sound 9 ⟨D, 1, [0, 0, 0, 0, 1, 1], [1]⟩ + ⟨E, 1, [0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl + +theorem wSweep_ZT_to_dSweep (l r : ListBlank (Fin 2)) : + (wSweepCfg (tokL .T +> (tokL .Z +> l)) ([0, 0, 1, 1] +> r)) [target_tm]⊢^{47} (dSweepCfg (tokL .Z +> (tokL .P +> l)) r) := + wmultiStep_sound 47 ⟨D, 1, [0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1]⟩ + ⟨E, 1, [0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl + +theorem wSweep_PT_to_carry (l r : ListBlank (Fin 2)) : + (wSweepCfg (tokL .T +> (tokL .P +> l)) ([0, 0, 1, 1] +> r)) [target_tm]⊢^{34} (carryCfg l ([1, 0, 1, 1] +> r)) := + wmultiStep_sound 34 ⟨D, 1, [0, 1, 1, 1, 0, 1, 0, 0, 1, 1], [1, 0, 0, 1, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1]⟩ l r rfl + +theorem wSweep_ZMT_to_tSweep (l r : ListBlank (Fin 2)) : + (wSweepCfg (tokL .T +> (tokL .M +> (tokL .Z +> l))) ([0, 0, 1, 1] +> r)) [target_tm]⊢^{69} (tSweepCfg (tokL .Z +> (tokL .P +> l)) r) := + wmultiStep_sound 69 ⟨D, 1, [0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1]⟩ + ⟨E, 0, [0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl + +theorem cfgR_Z_to_TW (l : ListBlank (Fin 2)) : + (cfgR (tokL .Z +> l)) [target_tm]⊢^{16} (cfgR (tokL .W +> (tokL .T +> l))) := + rcmultiStep_sound 16 ⟨B, 0, [1, 1, 0, 0, 0, 0, 1, 1], []⟩ + ⟨B, 0, [1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l rfl + +theorem cfgR_TW_to_t3Cfg (l : ListBlank (Fin 2)) : + (cfgR (tokL .W +> (tokL .T +> l))) [target_tm]⊢^{24} (t3Cfg l (evalWK 0)) := + rcmultiStep_sound 24 ⟨B, 0, [1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 1, 0, 1, 1]⟩ l rfl + +theorem t3_step (l r : ListBlank (Fin 2)) : + (t3Cfg (((tokL .T) ^ 3) +> l) r) [target_tm]⊢^{56} (t3Cfg l (((tokR .Z) ^ 2) +> r)) := + wmultiStep_sound 56 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1], [0, 1, 0, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1]⟩ l r rfl + +theorem t3Cfg_Z_zero_to_carry (l : ListBlank (Fin 2)) : + (t3Cfg (tokL .Z +> l) (evalWK 0)) [target_tm]⊢^{104} (carryCfg l (evalWK 1)) := + rcmultiStep_sound 104 ⟨B, 1, [0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 1, 0, 1, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1]⟩ l rfl + +theorem t3Cfg_Z_succ_to_r0 (l r : ListBlank (Fin 2)) : + (t3Cfg (tokL .Z +> l) (tokR .Z +> r)) [target_tm]⊢^{35} (r0Cfg (tokL .P +> l) r) := + wmultiStep_sound 35 ⟨B, 1, [0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl + +theorem t3Cfg_TZ_to_r1OddShort (l r : ListBlank (Fin 2)) : + (t3Cfg (tokL .T +> (tokL .Z +> l)) r) [target_tm]⊢^{47} (r1OddShortCfg (tokL .M +> (tokL .T +> l)) r) := + wmultiStep_sound 47 ⟨B, 1, [0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1]⟩ + ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl + +theorem r1OddShortCfg_evalWK0_to_carry (l : ListBlank (Fin 2)) : + (r1OddShortCfg l (evalWK 0)) [target_tm]⊢^{156} (carryCfg l (evalWK 1)) := + rcmultiStep_sound 156 ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 1, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1]⟩ l rfl + +theorem t3Cfg_TTZ_to_r0 (l r : ListBlank (Fin 2)) : + (t3Cfg (((tokL .T) ^ 2) +> (tokL .Z +> l)) r) [target_tm]⊢^{71} (r0Cfg (tokL .W +> (tokL .T +> l)) r) := + wmultiStep_sound 71 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl + + +theorem r1Odd_Z (l r : ListBlank (Fin 2)) : + (r1OddCfg l (tokR .Z +> r)) [target_tm]⊢^{12} (r1OddCfg (tokL .Z +> l) r) := + r1OddShort_Z (tokL .Z +> l) r + +-- ============================================================================ +-- Section 6.5: Loop & Suffix Transition Lemmas +-- ============================================================================ + +theorem wSweep_loop : ∀ (n : Nat) (l r : ListBlank (Fin 2)), + (wSweepCfg (((tokL .W) ^ n) +> l) r) [target_tm]⊢* + (wSweepCfg l ((([0, 0, 1, 1] : List (Fin 2)) ^ n) +> r)) + | 0, l, r => stepStar_refl _ _ + | n + 1, l, r => by + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans ⟨4, wSweep_step (((tokL .W) ^ n) +> l) r⟩ ?_ + have ih := wSweep_loop n l ([0, 0, 1, 1] +> r) + rwa [pow_succ_right, listblank_append_assoc] + +theorem dSweep_loop : ∀ (n : Nat) (l r : ListBlank (Fin 2)), + (dSweepCfg l ((([0, 0, 1, 1] : List (Fin 2)) ^ n) +> r)) [target_tm]⊢* + (dSweepCfg (((tokL .W) ^ n) +> l) r) + | 0, l, r => stepStar_refl _ _ + | n + 1, l, r => by + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans ⟨6, dSweep_step l ((([0, 0, 1, 1] : List (Fin 2)) ^ n) +> r)⟩ ?_ + have ih := dSweep_loop n (tokL .W +> l) r + rwa [pow_succ_right, listblank_append_assoc] + +theorem tSweep_loop : ∀ (n : Nat) (l r : ListBlank (Fin 2)), + (tSweepCfg l ((([0, 0, 1, 1] : List (Fin 2)) ^ n) +> r)) [target_tm]⊢* + (tSweepCfg (((tokL .T) ^ n) +> l) r) + | 0, l, r => stepStar_refl _ _ + | n + 1, l, r => by + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans ⟨22, tSweep_step l ((([0, 0, 1, 1] : List (Fin 2)) ^ n) +> r)⟩ ?_ + have ih := tSweep_loop n (tokL .T +> l) r + rwa [pow_succ_right, listblank_append_assoc] + +theorem t3_loop : ∀ (q : Nat) (l r : ListBlank (Fin 2)), + (t3Cfg (((tokL .T) ^ (3 * q)) +> l) r) [target_tm]⊢* + (t3Cfg l (((tokR .Z) ^ (2 * q)) +> r)) + | 0, l, r => stepStar_refl _ _ + | q + 1, l, r => by + have h3 : 3 * (q + 1) = 3 + 3 * q := by omega + have h2 : 2 * (q + 1) = 2 * q + 2 := by omega + rw [h3, list_pow_add, listblank_append_assoc] + refine stepStar_trans ⟨56, t3_step (((tokL .T) ^ (3 * q)) +> l) r⟩ ?_ + have ih := t3_loop q l (((tokR .Z) ^ 2) +> r) + rwa [h2, list_pow_add, listblank_append_assoc] + +theorem pmu_loop : ∀ (m : Nat) (l r : ListBlank (Fin 2)), + (pmuCfg (((tokL .P) ^ m) +> l) r) [target_tm]⊢* + (pmuCfg l (((tokR .Z) ^ m) +> r)) + | 0, l, r => stepStar_refl _ _ + | m + 1, l, r => by + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans ⟨52, pmu_step (((tokL .P) ^ m) +> l) r⟩ ?_ + have ih := pmu_loop m l (tokR .Z +> r) + rwa [pow_succ_right, listblank_append_assoc] + +theorem r0_Z_loop : ∀ (m : Nat) (l r : ListBlank (Fin 2)), + (r0Cfg l (((tokR .Z) ^ m) +> r)) [target_tm]⊢* + (r0Cfg (((tokL .Z) ^ m) +> l) r) + | 0, l, r => stepStar_refl _ _ + | m + 1, l, r => by + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans ⟨12, r0_Z l (((tokR .Z) ^ m) +> r)⟩ ?_ + have ih := r0_Z_loop m (tokL .Z +> l) r + rwa [pow_succ_right, listblank_append_assoc] + +theorem r0_P_loop : ∀ (m : Nat) (l r : ListBlank (Fin 2)), + (r0Cfg l (((tokR .P) ^ m) +> r)) [target_tm]⊢* + (r0Cfg (((tokL .P) ^ m) +> l) r) + | 0, l, r => stepStar_refl _ _ + | m + 1, l, r => by + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans ⟨44, r0_P l (((tokR .P) ^ m) +> r)⟩ ?_ + have ih := r0_P_loop m (tokL .P +> l) r + rwa [pow_succ_right, listblank_append_assoc] + +theorem r1OddShort_Z_loop : ∀ (m : Nat) (l r : ListBlank (Fin 2)), + (r1OddShortCfg l (((tokR .Z) ^ m) +> r)) [target_tm]⊢* + (r1OddShortCfg (((tokL .Z) ^ m) +> l) r) + | 0, l, r => stepStar_refl _ _ + | m + 1, l, r => by + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans ⟨12, r1OddShort_Z l (((tokR .Z) ^ m) +> r)⟩ ?_ + have ih := r1OddShort_Z_loop m (tokL .Z +> l) r + rwa [pow_succ_right, listblank_append_assoc] + +theorem cfgR_ZW_to_TW (n : Nat) (l : ListBlank (Fin 2)) : + (cfgR (((tokL .W) ^ n) +> (tokL .Z +> l))) [target_tm]⊢* + (cfgR (((tokL .W) ^ (n + 1)) +> (tokL .T +> l))) := by + refine stepStar_trans ⟨2, wSweep_start _⟩ ?_ + refine stepStar_trans (wSweep_loop n (tokL .Z +> l) default) ?_ + refine stepStar_trans ⟨9, wSweep_Z_to_dSweep l _⟩ ?_ + refine stepStar_trans (dSweep_loop n (tokL .T +> l) default) ?_ + rw [pow_succ_list, listblank_append_assoc] + exact ⟨5, dSweep_end _⟩ + +theorem r0_end (k1 : Nat) (l : ListBlank (Fin 2)) : + (r0Cfg l (evalWK k1)) [target_tm]⊢* (carryCfg l (evalWK (k1 + 2))) := by + unfold evalWK + refine stepStar_trans ⟨6, r0_to_dSweep l _⟩ ?_ + refine stepStar_trans (dSweep_loop k1 (tokL .Z +> (tokL .Z +> l)) default) ?_ + refine stepStar_trans ⟨5, dSweep_end _⟩ ?_ + rw [← listblank_append_assoc, ← pow_succ_list] + refine stepStar_trans (cfgR_ZW_to_TW (k1 + 1) (tokL .Z +> l)) ?_ + refine stepStar_trans ⟨2, wSweep_start _⟩ ?_ + refine stepStar_trans (wSweep_loop (k1 + 2) (tokL .T +> (tokL .Z +> l)) default) ?_ + rw [pow_succ_list [0, 0, 1, 1] (k1 + 1), listblank_append_assoc] + refine stepStar_trans ⟨47, wSweep_ZT_to_dSweep l _⟩ ?_ + refine stepStar_trans (dSweep_loop (k1 + 1) (tokL .Z +> (tokL .P +> l)) default) ?_ + refine stepStar_trans ⟨5, dSweep_end _⟩ ?_ + rw [← listblank_append_assoc, ← pow_succ_list] + refine stepStar_trans (cfgR_ZW_to_TW (k1 + 2) (tokL .P +> l)) ?_ + refine stepStar_trans ⟨2, wSweep_start _⟩ ?_ + refine stepStar_trans (wSweep_loop (k1 + 3) (tokL .T +> (tokL .P +> l)) default) ?_ + rw [pow_succ_list [0, 0, 1, 1] (k1 + 2), listblank_append_assoc] + exact ⟨34, wSweep_PT_to_carry l _⟩ + +theorem r1_end (kf1 : Nat) (l : ListBlank (Fin 2)) : + (r1Cfg l (evalWK kf1)) [target_tm]⊢* + (t3Cfg (((tokL .T) ^ (kf1 + 1)) +> (tokL .Z +> (tokL .P +> l))) (evalWK 0)) := by + unfold evalWK + refine stepStar_trans ⟨6, r1_to_dSweep l _⟩ ?_ + refine stepStar_trans (dSweep_loop kf1 (tokL .Z +> (tokL .M +> (tokL .Z +> l))) default) ?_ + refine stepStar_trans ⟨5, dSweep_end _⟩ ?_ + rw [← listblank_append_assoc, ← pow_succ_list] + refine stepStar_trans (cfgR_ZW_to_TW (kf1 + 1) (tokL .M +> (tokL .Z +> l))) ?_ + refine stepStar_trans ⟨2, wSweep_start _⟩ ?_ + refine stepStar_trans (wSweep_loop (kf1 + 2) (tokL .T +> (tokL .M +> (tokL .Z +> l))) default) ?_ + rw [pow_succ_list [0, 0, 1, 1] (kf1 + 1), listblank_append_assoc] + refine stepStar_trans ⟨69, wSweep_ZMT_to_tSweep l _⟩ ?_ + refine stepStar_trans (tSweep_loop (kf1 + 1) (tokL .Z +> (tokL .P +> l)) default) ?_ + refine stepStar_trans ⟨2, tSweep_end _⟩ ?_ + refine stepStar_trans ⟨16, cfgR_Z_to_TW _⟩ ?_ + exact ⟨24, cfgR_TW_to_t3Cfg _⟩ + +theorem r1Odd_end (kf1 : Nat) (l : ListBlank (Fin 2)) : + (r1OddCfg l (evalWK kf1)) [target_tm]⊢* + (t3Cfg (((tokL .T) ^ kf1) +> (tokL .Z +> (tokL .Z +> l))) (evalWK 0)) := by + unfold evalWK + refine stepStar_trans ⟨10, r1Odd_to_tSweep l _⟩ ?_ + refine stepStar_trans (tSweep_loop kf1 (tokL .Z +> (tokL .Z +> l)) default) ?_ + refine stepStar_trans ⟨2, tSweep_end _⟩ ?_ + refine stepStar_trans ⟨16, cfgR_Z_to_TW _⟩ ?_ + exact ⟨24, cfgR_TW_to_t3Cfg _⟩ + +def stepZtToCarry (rle2 : Rle) (n : Nat) : Rle × Nat := + let q := n / 3 + let rem := n % 3 + if rem == 0 then + if q == 0 then + (rle2, 1) + else + (pushRle [.Z] (2 * q - 1) (pushRle [.P] 1 rle2), 2) + else if rem == 1 then + (pushRle [.Z] (2 * q) (pushToksLtr [.T, .M] rle2), 1) + else + (pushRle [.Z] (2 * q) (pushToksLtr [.T, .W] rle2), 2) + +theorem stepZtToCarry_sound (rle2 : Rle) (n : Nat) : + (t3Cfg (((tokL .T) ^ n) +> (tokL .Z +> evalRle rle2)) (evalWK 0)) [target_tm]⊢* + (carryCfg (evalRle (stepZtToCarry rle2 n).1) (evalWK (stepZtToCarry rle2 n).2)) := by + dsimp -failIfUnchanged only [stepZtToCarry] + generalize hq : n / 3 = q + generalize hrem : n % 3 = rem + have hdiv : n = 3 * q + rem := by omega + have hlt : rem < 3 := by omega + rw [hdiv, list_pow_add, listblank_append_assoc] + refine stepStar_trans (t3_loop q (((tokL .T) ^ rem) +> (tokL .Z +> evalRle rle2)) (evalWK 0)) ?_ + rcases (by omega : rem = 0 ∨ rem = 1 ∨ rem = 2) with rfl | rfl | rfl + · simp only [beq_self_eq_true, ↓reduceIte, pow_zero_list, listblank_append_nil] + cases q with + | zero => + simp only [beq_self_eq_true, ↓reduceIte, Nat.mul_zero, pow_zero_list, listblank_append_nil] + exact ⟨104, t3Cfg_Z_zero_to_carry (evalRle rle2)⟩ + | succ q' => + have hq_ne : (q' + 1 == 0) = false := rfl + have h2q : 2 * (q' + 1) = 1 + (2 * (q' + 1) - 1) := by omega + have h2q_sub : 1 + (2 * (q' + 1) - 1) - 1 = 2 * (q' + 1) - 1 := by omega + rw [hq_ne, h2q, list_pow_add, pow_succ_list, pow_zero_list, List.append_nil, listblank_append_assoc] + simp only [Bool.false_eq_true, ↓reduceIte, evalRle_pushRle, pow_succ_list, pow_zero_list, + List.append_nil, wordL_cons, wordL_nil, h2q_sub] + refine stepStar_trans ⟨35, t3Cfg_Z_succ_to_r0 (evalRle rle2) _⟩ ?_ + refine stepStar_trans (r0_Z_loop (2 * (q' + 1) - 1) (tokL .P +> evalRle rle2) (evalWK 0)) ?_ + exact r0_end 0 _ + · have hr0 : (1 == 0) = false := rfl + rw [hr0] + simp only [Bool.false_eq_true, beq_self_eq_true, ↓reduceIte, pow_succ_list, pow_zero_list, + List.append_nil, pushToksLtr, evalRle_pushRle, wordL_cons, wordL_nil] + refine stepStar_trans ⟨47, t3Cfg_TZ_to_r1OddShort (evalRle rle2) _⟩ ?_ + refine stepStar_trans (r1OddShort_Z_loop (2 * q) (tokL .M +> (tokL .T +> evalRle rle2)) (evalWK 0)) ?_ + exact ⟨156, r1OddShortCfg_evalWK0_to_carry _⟩ + · have hr0 : (2 == 0) = false := rfl + have hr1 : (2 == 1) = false := rfl + rw [hr0, hr1] + simp only [Bool.false_eq_true, ↓reduceIte, pushToksLtr, evalRle_pushRle, pow_succ_list, + pow_zero_list, List.append_nil, wordL_cons, wordL_nil] + refine stepStar_trans ⟨71, t3Cfg_TTZ_to_r0 (evalRle rle2) _⟩ ?_ + refine stepStar_trans (r0_Z_loop (2 * q) (tokL .W +> (tokL .T +> evalRle rle2)) (evalWK 0)) ?_ + exact r0_end 0 _ + + +-- ============================================================================ +-- Section 6.6: RLE Combinators & Sweep Soundness Lemmas +-- ============================================================================ + +def popTok (t_exp : Tok) (rle : Rle) : Option Rle := + match popLastTok rle with + | some (t, rle') => if t == t_exp then some rle' else none + | none => none + +theorem popTok_sound (t_exp : Tok) (rle rle' : Rle) (h : popTok t_exp rle = some rle') : + evalRle rle = tokL t_exp +> evalRle rle' := by + unfold popTok at h + cases hp : popLastTok rle with + | none => rw [hp] at h; nomatch h + | some p => + rcases p with ⟨t, r⟩ + rw [hp] at h + simp only [beq_iff_eq] at h + split at h + · rename_i heq + injection h with hr + rw [← heq, ← hr] + exact popLastTok_sound rle t r hp + · nomatch h + +def popToks : List Tok → Rle → Option Rle + | [], rle => some rle + | t :: ts, rle => + match popTok t rle with + | some rle' => popToks ts rle' + | none => none + +theorem popToks_sound : ∀ (ts : List Tok) (rle rle' : Rle), + popToks ts rle = some rle' → + evalRle rle = wordL ts +> evalRle rle' + | [], rle, rle', h => by + injection h with hr + subst hr + rfl + | t :: ts, rle, rle', h => by + unfold popToks at h + cases h1 : popTok t rle with + | none => rw [h1] at h; nomatch h + | some r1 => + rw [h1] at h + have ih := popToks_sound ts r1 rle' h + have hp := popTok_sound t rle r1 h1 + rw [hp, ih, wordL_cons, listblank_append_assoc] + +def matchHeadAnyCount (w_exp : List Tok) (rle : Rle) : Option (Nat × Rle) := + match rle with + | (w, c) :: rest => if w == w_exp && c > 0 then some (c, rest) else none + | [] => none + +theorem matchHeadAnyCount_sound (w_exp : List Tok) (rle rest : Rle) (c : Nat) + (h : matchHeadAnyCount w_exp rle = some (c, rest)) : + c > 0 ∧ evalRle rle = ((wordL w_exp) ^ c) +> evalRle rest := by + cases rle with + | nil => nomatch h + | cons hd tl => + rcases hd with ⟨w, c0⟩ + unfold matchHeadAnyCount at h + simp only [Bool.and_eq_true, beq_iff_eq, decide_eq_true_eq] at h + split at h + · rename_i hwc + rcases hwc with ⟨rfl, hc0⟩ + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + exact ⟨hc0, rfl⟩ + · nomatch h + +def popPrefixCount (pref : List Tok) (w_exp : List Tok) (rle : Rle) : Option (Nat × Rle) := + match popToks pref rle with + | some r1 => matchHeadAnyCount w_exp r1 + | none => none + +theorem popPrefixCount_sound (pref w_exp : List Tok) (rle r3 : Rle) (b : Nat) + (h : popPrefixCount pref w_exp rle = some (b, r3)) : + b > 0 ∧ evalRle rle = wordL pref +> (((wordL w_exp) ^ b) +> evalRle r3) := by + unfold popPrefixCount at h + cases h1 : popToks pref rle with + | none => rw [h1] at h; nomatch h + | some r1 => + rw [h1] at h + rcases matchHeadAnyCount_sound w_exp r1 r3 b h with ⟨hb, hr1⟩ + rw [popToks_sound pref rle r1 h1, hr1] + exact ⟨hb, rfl⟩ + +theorem carry_word : ∀ (w : List Tok) (l r : ListBlank (Fin 2)), + isZpWord w = true → + (carryCfg (wordL w +> l) r) [target_tm]⊢* + (carryCfg l (wordR (revWord w) +> r)) + | [], l, r, _ => stepStar_refl _ _ + | .Z :: ts, l, r, h => by + simp only [isZpWord] at h + rw [wordL_cons, listblank_append_assoc] + refine stepStar_trans ⟨_, carry_Z (wordL ts +> l) r⟩ ?_ + have ih := carry_word ts l (tokR .Z +> r) h + simpa [revWord, wordR_append, listblank_append_assoc] using! ih + | .P :: ts, l, r, h => by + simp only [isZpWord] at h + rw [wordL_cons, listblank_append_assoc] + refine stepStar_trans ⟨_, carry_P (wordL ts +> l) r⟩ ?_ + have ih := carry_word ts l (tokR .P +> r) h + simpa [revWord, wordR_append, listblank_append_assoc] using! ih + | .U :: _, _, _, h => by nomatch h + | .M :: _, _, _, h => by nomatch h + | .W :: _, _, _, h => by nomatch h + | .T :: _, _, _, h => by nomatch h + | .PTTTM_TAIL :: _, _, _, h => by nomatch h + +theorem carry_pow : ∀ (c : Nat) (w : List Tok) (l r : ListBlank (Fin 2)), + isZpWord w = true → + (carryCfg (((wordL w) ^ c) +> l) r) [target_tm]⊢* + (carryCfg l (((wordR (revWord w)) ^ c) +> r)) + | 0, _, l, r, _ => stepStar_refl _ _ + | c + 1, w, l, r, hw => by + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans (carry_word w (((wordL w) ^ c) +> l) r hw) ?_ + have ih := carry_pow c w l (wordR (revWord w) +> r) hw + rwa [pow_succ_right, listblank_append_assoc] + +def popCarrySpecial (rle rs : Rle) : Option (Rle × Rle) := + match popToks [.M, .T, .U, .M, .P] rle with + | some r' => some (r', pushRle [.Z] 2 (pushRle [.P] 1 rs)) + | none => match popToks [.M, .T, .T, .T, .P] rle with + | some r' => some (r', pushRle [.Z] 2 (pushRle [.PTTTM_TAIL] 1 rs)) + | none => match popToks [.W, .T, .T, .P] rle with + | some r' => some (r', pushRle [.Z] 3 rs) + | none => match popToks [.T, .T, .T, .P] rle with + | some r' => some (r', pushRle [.Z] 2 (pushRle [.P] 1 rs)) + | none => none + +theorem popCarrySpecial_sound (rle rs rle' rs' : Rle) (r_end : ListBlank (Fin 2)) + (h : popCarrySpecial rle rs = some (rle', rs')) : + (carryCfg (evalRle rle) (evalRStack rs r_end)) [target_tm]⊢* + (carryCfg (evalRle rle') (evalRStack rs' r_end)) := by + unfold popCarrySpecial at h + cases h1 : popToks [.M, .T, .U, .M, .P] rle with + | some r1 => + rw [h1] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨hr1, hrs⟩ + rw [← hr1, ← hrs, popToks_sound _ _ _ h1] + simp only [wordL_cons, List.append_nil, listblank_append_assoc, + evalRStack_pushRle, pow_succ_list, pow_zero_list, wordR_cons] + exact ⟨_, carry_PMUTM (evalRle r1) (evalRStack rs r_end)⟩ + | none => + rw [h1] at h + cases h2 : popToks [.M, .T, .T, .T, .P] rle with + | some r1 => + rw [h2] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨hr1, hrs⟩ + rw [← hr1, ← hrs, popToks_sound _ _ _ h2] + simp only [wordL_cons, List.append_nil, listblank_append_assoc, + evalRStack_pushRle, pow_succ_list, pow_zero_list, wordR_cons] + exact ⟨_, carry_PTTTM (evalRle r1) (evalRStack rs r_end)⟩ + | none => + rw [h2] at h + cases h3 : popToks [.W, .T, .T, .P] rle with + | some r1 => + rw [h3] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨hr1, hrs⟩ + rw [← hr1, ← hrs, popToks_sound _ _ _ h3] + simp only [wordL_cons, List.append_nil, listblank_append_assoc, + evalRStack_pushRle, pow_succ_list, pow_zero_list, wordR_cons] + exact ⟨_, carry_PTTW (evalRle r1) (evalRStack rs r_end)⟩ + | none => + rw [h3] at h + cases h4 : popToks [.T, .T, .T, .P] rle with + | some r1 => + rw [h4] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨hr1, hrs⟩ + rw [← hr1, ← hrs, popToks_sound _ _ _ h4] + simp only [wordL_cons, List.append_nil, listblank_append_assoc, + evalRStack_pushRle, pow_succ_list, pow_zero_list, wordR_cons] + exact ⟨_, carry_PTTT (evalRle r1) (evalRStack rs r_end)⟩ + | none => + rw [h4] at h + nomatch h + +def popCarryLoop : Nat → Rle → Rle → Rle × Rle + | 0, rle, rs => (rle, rs) + | fuel + 1, rle, rs => + match rle with + | (w, c) :: rest => + if isZpWord w then + popCarryLoop fuel rest (pushRle (revWord w) c rs) + else match popCarrySpecial rle rs with + | some (rle', rs') => popCarryLoop fuel rle' rs' + | none => (rle, rs) + | [] => ([], rs) + +theorem popCarryLoop_sound : ∀ (fuel : Nat) (rle rs : Rle) (r_end : ListBlank (Fin 2)), + (carryCfg (evalRle rle) (evalRStack rs r_end)) [target_tm]⊢* + (carryCfg (evalRle (popCarryLoop fuel rle rs).1) (evalRStack (popCarryLoop fuel rle rs).2 r_end)) + | 0, rle, rs, r_end => stepStar_refl _ _ + | fuel + 1, [], rs, r_end => stepStar_refl _ _ + | fuel + 1, (w, c) :: rest, rs, r_end => by + simp only [popCarryLoop] + split + · rename_i hw + simp only [evalRle_cons] + refine stepStar_trans (carry_pow c w (evalRle rest) (evalRStack rs r_end) hw) ?_ + rw [← evalRStack_pushRle (revWord w) c rs r_end] + exact popCarryLoop_sound fuel rest (pushRle (revWord w) c rs) r_end + · cases hp : popCarrySpecial ((w, c) :: rest) rs with + | none => exact stepStar_refl _ _ + | some p => + rcases p with ⟨rle', rs'⟩ + refine stepStar_trans (popCarrySpecial_sound ((w, c) :: rest) rs rle' rs' r_end hp) ?_ + exact popCarryLoop_sound fuel rle' rs' r_end + +theorem r0_word : ∀ (w : List Tok) (l r : ListBlank (Fin 2)), + isZpWord w = true → + (r0Cfg l (wordR w +> r)) [target_tm]⊢* + (r0Cfg (wordL (revWord w) +> l) r) + | [], l, r, _ => stepStar_refl _ _ + | .Z :: ts, l, r, h => by + simp only [isZpWord] at h + rw [wordR_cons, listblank_append_assoc] + refine stepStar_trans ⟨_, r0_Z l (wordR ts +> r)⟩ ?_ + have ih := r0_word ts (tokL .Z +> l) r h + simpa [revWord, wordL_append, listblank_append_assoc] using! ih + | .P :: ts, l, r, h => by + simp only [isZpWord] at h + rw [wordR_cons, listblank_append_assoc] + refine stepStar_trans ⟨_, r0_P l (wordR ts +> r)⟩ ?_ + have ih := r0_word ts (tokL .P +> l) r h + simpa [revWord, wordL_append, listblank_append_assoc] using! ih + | .U :: _, _, _, h => by nomatch h + | .M :: _, _, _, h => by nomatch h + | .W :: _, _, _, h => by nomatch h + | .T :: _, _, _, h => by nomatch h + | .PTTTM_TAIL :: _, _, _, h => by nomatch h + +theorem r0_pow : ∀ (c : Nat) (w : List Tok) (l r : ListBlank (Fin 2)), + isZpWord w = true → + (r0Cfg l (((wordR w) ^ c) +> r)) [target_tm]⊢* + (r0Cfg (((wordL (revWord w)) ^ c) +> l) r) + | 0, _, l, r, _ => stepStar_refl _ _ + | c + 1, w, l, r, hw => by + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans (r0_word w l (((wordR w) ^ c) +> r) hw) ?_ + have ih := r0_pow c w (wordL (revWord w) +> l) r hw + rwa [pow_succ_right, listblank_append_assoc] + +def allZpStack : Rle → Bool + | [] => true + | (it, _) :: rest => isZpWord it && allZpStack rest + +def copyRStack : Rle → Rle → Option Rle + | rle, [] => some rle + | rle, (item, count) :: rest => + if isZpWord item then copyRStack (pushRle (revWord item) count rle) rest + else none + +theorem copyRStack_sound : ∀ (rs : Rle) (rle rle' : Rle) (r_end : ListBlank (Fin 2)), + copyRStack rle rs = some rle' → + allZpStack rs = true ∧ + (r0Cfg (evalRle rle) (evalRStack rs r_end)) [target_tm]⊢* + (r0Cfg (evalRle rle') r_end) + | [], rle, rle', r_end, h => by + injection h with hr + subst hr + exact ⟨rfl, stepStar_refl _ _⟩ + | (w, c) :: rest, rle, rle', r_end, h => by + unfold copyRStack at h + split at h + · rename_i hw + rcases copyRStack_sound rest (pushRle (revWord w) c rle) rle' r_end h with ⟨hrest, hstep⟩ + simp only [allZpStack, hw, hrest, Bool.and_self] + refine ⟨trivial, ?_⟩ + simp only [evalRStack_cons] + refine stepStar_trans (r0_pow c w (evalRle rle) (evalRStack rest r_end) hw) ?_ + simpa [evalRle_pushRle] using! hstep + · nomatch h + +def HasRoundtrip (R : Nat → ListBlank (Fin 2)) : Prop := + ∀ (l : ListBlank (Fin 2)) (k1 : Nat), + (r0Cfg l (R k1)) [target_tm]⊢* (carryCfg l (R (k1 + 2))) + +theorem hasRoundtrip_evalWK : HasRoundtrip evalWK := + fun l k1 => r0_end k1 l + +theorem hasRoundtrip_Z {R : Nat → ListBlank (Fin 2)} (hR : HasRoundtrip R) : + HasRoundtrip (fun k1 => tokR .Z +> R k1) := by + intro l k1 + refine stepStar_trans ⟨_, r0_Z l (R k1)⟩ ?_ + refine stepStar_trans (hR (tokL .Z +> l) k1) ?_ + exact ⟨_, carry_Z l (R (k1 + 2))⟩ + +theorem hasRoundtrip_P {R : Nat → ListBlank (Fin 2)} (hR : HasRoundtrip R) : + HasRoundtrip (fun k1 => tokR .P +> R k1) := by + intro l k1 + refine stepStar_trans ⟨_, r0_P l (R k1)⟩ ?_ + refine stepStar_trans (hR (tokL .P +> l) k1) ?_ + exact ⟨_, carry_P l (R (k1 + 2))⟩ + +theorem hasRoundtrip_word : ∀ (w : List Tok) {R : Nat → ListBlank (Fin 2)}, + isZpWord w = true → HasRoundtrip R → + HasRoundtrip (fun k1 => wordR w +> R k1) + | [], _, _, hR => hR + | .Z :: ts, _, hw, hR => by + simp only [isZpWord] at hw + intro l k1 + dsimp -failIfUnchanged only + rw [wordR_cons, listblank_append_assoc] + exact hasRoundtrip_Z (hasRoundtrip_word ts hw hR) l k1 + | .P :: ts, _, hw, hR => by + simp only [isZpWord] at hw + intro l k1 + dsimp -failIfUnchanged only + rw [wordR_cons, listblank_append_assoc] + exact hasRoundtrip_P (hasRoundtrip_word ts hw hR) l k1 + | .U :: _, _, hw, _ => by nomatch hw + | .M :: _, _, hw, _ => by nomatch hw + | .W :: _, _, hw, _ => by nomatch hw + | .T :: _, _, hw, _ => by nomatch hw + | .PTTTM_TAIL :: _, _, hw, _ => by nomatch hw + +theorem hasRoundtrip_pow : ∀ (c : Nat) (w : List Tok) {R : Nat → ListBlank (Fin 2)}, + isZpWord w = true → HasRoundtrip R → + HasRoundtrip (fun k1 => ((wordR w) ^ c) +> R k1) + | 0, _, _, _, hR => hR + | c + 1, w, _, hw, hR => by + intro l k1 + simp only [pow_succ_list, listblank_append_assoc] + exact hasRoundtrip_word w hw (hasRoundtrip_pow c w hw hR) l k1 + +theorem hasRoundtrip_stack : ∀ (rs : Rle) {R : Nat → ListBlank (Fin 2)}, + allZpStack rs = true → HasRoundtrip R → + HasRoundtrip (fun k1 => evalRStack rs (R k1)) + | [], _, _, hR => hR + | (w, c) :: rest, _, hrs, hR => by + simp only [allZpStack, Bool.and_eq_true] at hrs + rcases hrs with ⟨hw, hrest⟩ + intro l k1 + simp only [evalRStack_cons] + exact hasRoundtrip_pow c w hw (hasRoundtrip_stack rest hrest hR) l k1 + +def r1PhaseCfg (phase : Bool) (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + if phase then r1OddCfg l r else r1Cfg l r + +@[simp] theorem r1PhaseCfg_false (l r : ListBlank (Fin 2)) : r1PhaseCfg false l r = r1Cfg l r := rfl +@[simp] theorem r1PhaseCfg_true (l r : ListBlank (Fin 2)) : r1PhaseCfg true l r = r1OddCfg l r := rfl + +def stepR1StarWord : List Tok → Bool → List Tok × Nat × Bool + | [], phase => ([], 0, phase) + | t :: ts, false => + let (out, res, p2) := stepR1StarWord ts (t != .Z) + (out ++ [.P], res + (if t == .Z then 1 else 0), p2) + | t :: ts, true => + let (out, res, p2) := stepR1StarWord ts (t != .P) + (out ++ [.Z], res, p2) + +theorem stepR1StarWord_phase_inv : ∀ (w : List Tok) (phase : Bool), + isZpWord w = true → + (stepR1StarWord w (!phase)).2.2 = !(stepR1StarWord w phase).2.2 + | [], phase, _ => rfl + | .Z :: ts, false, hw => by + simp only [isZpWord] at hw + simpa [stepR1StarWord] using! stepR1StarWord_phase_inv ts false hw + | .Z :: ts, true, hw => by + simp only [isZpWord] at hw + simpa [stepR1StarWord] using! (stepR1StarWord_phase_inv ts false hw).symm + | .P :: ts, false, hw => by + simp only [isZpWord] at hw + simpa [stepR1StarWord] using! stepR1StarWord_phase_inv ts true hw + | .P :: ts, true, hw => by + simp only [isZpWord] at hw + simpa [stepR1StarWord] using! (stepR1StarWord_phase_inv ts true hw).symm + | .U :: _, _, hw => by nomatch hw + | .M :: _, _, hw => by nomatch hw + | .W :: _, _, hw => by nomatch hw + | .T :: _, _, hw => by nomatch hw + | .PTTTM_TAIL :: _, _, hw => by nomatch hw + +theorem stepR1StarWord_sound : ∀ (w : List Tok) (phase : Bool) (l : ListBlank (Fin 2)) + {R : Nat → ListBlank (Fin 2)}, + isZpWord w = true → HasRoundtrip R → + ∀ (k1 : Nat), + (r1PhaseCfg phase l (wordR w +> R k1)) [target_tm]⊢* + (r1PhaseCfg (stepR1StarWord w phase).2.2 + (wordL (stepR1StarWord w phase).1 +> l) + (R (k1 + 2 * (stepR1StarWord w phase).2.1))) + | [], phase, l, R, _, _, k1 => by + simp [stepR1StarWord] + try exact stepStar_refl _ _ + | .Z :: ts, false, l, R, hw, hR, k1 => by + simp only [isZpWord] at hw + have hR' : HasRoundtrip (fun k => wordR ts +> R k) := hasRoundtrip_word ts hw hR + simp only [stepR1StarWord, bne_self_eq_false, beq_self_eq_true, ↓reduceIte, + wordR_cons, listblank_append_assoc, r1PhaseCfg_false] + refine stepStar_trans ⟨_, r1_Z l (wordR ts +> R k1)⟩ ?_ + refine stepStar_trans (hR' (tokL .M +> (tokL .Z +> l)) k1) ?_ + dsimp -failIfUnchanged only + refine stepStar_trans ⟨_, turn_ZM l (wordR ts +> R (k1 + 2))⟩ ?_ + have ih := stepR1StarWord_sound ts false (tokL .P +> l) hw hR (k1 + 2) + have hadd : k1 + 2 + 2 * (stepR1StarWord ts false).2.1 = + k1 + 2 * ((stepR1StarWord ts false).2.1 + 1) := by omega + rw [hadd] at ih + simpa [wordL_append, listblank_append_assoc] using! ih + | .P :: ts, false, l, R, hw, hR, k1 => by + simp only [isZpWord] at hw + have hne : (Tok.P != Tok.Z) = true := rfl + have heq : (Tok.P == Tok.Z) = false := rfl + simp only [stepR1StarWord, hne, heq, Bool.false_eq_true, ↓reduceIte, Nat.add_zero, + wordR_cons, listblank_append_assoc, r1PhaseCfg_false] + refine stepStar_trans ⟨_, r1_P l (wordR ts +> R k1)⟩ ?_ + have ih := stepR1StarWord_sound ts true (tokL .P +> l) hw hR k1 + simpa [wordL_append, listblank_append_assoc] using! ih + | .Z :: ts, true, l, R, hw, hR, k1 => by + simp only [isZpWord] at hw + have hne : (Tok.Z != Tok.P) = true := rfl + simp only [stepR1StarWord, hne, wordR_cons, listblank_append_assoc, r1PhaseCfg_true] + refine stepStar_trans ⟨_, r1Odd_Z l (wordR ts +> R k1)⟩ ?_ + have ih := stepR1StarWord_sound ts true (tokL .Z +> l) hw hR k1 + simpa [wordL_append, listblank_append_assoc] using! ih + | .P :: ts, true, l, R, hw, hR, k1 => by + simp only [isZpWord] at hw + have hne : (Tok.P != Tok.P) = false := rfl + simp only [stepR1StarWord, hne, wordR_cons, listblank_append_assoc, r1PhaseCfg_true] + refine stepStar_trans ⟨_, r1Odd_P l (wordR ts +> R k1)⟩ ?_ + have ih := stepR1StarWord_sound ts false (tokL .Z +> l) hw hR k1 + simpa [wordL_append, listblank_append_assoc] using! ih + | .U :: _, _, _, _, hw, _, _ => by nomatch hw + | .M :: _, _, _, _, hw, _, _ => by nomatch hw + | .W :: _, _, _, _, hw, _, _ => by nomatch hw + | .T :: _, _, _, _, hw, _, _ => by nomatch hw + | .PTTTM_TAIL :: _, _, _, _, hw, _, _ => by nomatch hw + +theorem stepR1Star_same_pow : ∀ (c : Nat) (w : List Tok) (phase : Bool) (l : ListBlank (Fin 2)) + {R : Nat → ListBlank (Fin 2)}, + isZpWord w = true → + (stepR1StarWord w phase).2.2 = phase → + HasRoundtrip R → + ∀ (k1 : Nat), + (r1PhaseCfg phase l (((wordR w) ^ c) +> R k1)) [target_tm]⊢* + (r1PhaseCfg phase (((wordL (stepR1StarWord w phase).1) ^ c) +> l) + (R (k1 + 2 * (c * (stepR1StarWord w phase).2.1)))) + | 0, w, phase, l, R, _, _, _, k1 => by + simp + try exact stepStar_refl _ _ + | c + 1, w, phase, l, R, hw, hsame, hR, k1 => by + have hR' : HasRoundtrip (fun k => ((wordR w) ^ c) +> R k) := hasRoundtrip_pow c w hw hR + rw [pow_succ_list, listblank_append_assoc] + have h1 := stepR1StarWord_sound w phase l hw hR' k1 + rw [hsame] at h1 + refine stepStar_trans h1 ?_ + dsimp -failIfUnchanged only + have ih := stepR1Star_same_pow c w phase (wordL (stepR1StarWord w phase).1 +> l) hw hsame hR + (k1 + 2 * (stepR1StarWord w phase).2.1) + have hadd : k1 + 2 * (stepR1StarWord w phase).2.1 + 2 * (c * (stepR1StarWord w phase).2.1) = + k1 + 2 * ((c + 1) * (stepR1StarWord w phase).2.1) := by + have : (c + 1) * (stepR1StarWord w phase).2.1 = + c * (stepR1StarWord w phase).2.1 + (stepR1StarWord w phase).2.1 := Nat.succ_mul c _ + omega + rw [hadd] at ih + rwa [pow_succ_right, listblank_append_assoc] + +theorem stepR1Star_alt_pow : ∀ (q : Nat) (w : List Tok) (phase : Bool) (l : ListBlank (Fin 2)) + {R : Nat → ListBlank (Fin 2)}, + isZpWord w = true → + (stepR1StarWord w (stepR1StarWord w phase).2.2).2.2 = phase → + HasRoundtrip R → + ∀ (k1 : Nat), + let s1 := stepR1StarWord w phase + let s2 := stepR1StarWord w s1.2.2 + (r1PhaseCfg phase l (((wordR w) ^ (2 * q)) +> R k1)) [target_tm]⊢* + (r1PhaseCfg phase (((wordL (s2.1 ++ s1.1)) ^ q) +> l) + (R (k1 + 2 * (q * (s1.2.1 + s2.2.1))))) + | 0, w, phase, l, R, _, _, _, k1 => by + simp + try exact stepStar_refl _ _ + | q + 1, w, phase, l, R, hw, halt, hR, k1 => by + dsimp -failIfUnchanged only + have h2q : 2 * (q + 1) = 1 + (1 + 2 * q) := by omega + rw [h2q, list_pow_add, list_pow_add, pow_succ_list, pow_zero_list, List.append_nil, + listblank_append_assoc, listblank_append_assoc] + have hR2 : HasRoundtrip (fun k => ((wordR w) ^ (2 * q)) +> R k) := + hasRoundtrip_pow (2 * q) w hw hR + have hR1 : HasRoundtrip (fun k => wordR w +> (((wordR w) ^ (2 * q)) +> R k)) := + hasRoundtrip_word w hw hR2 + refine stepStar_trans (stepR1StarWord_sound w phase l hw hR1 k1) ?_ + dsimp -failIfUnchanged only + refine stepStar_trans + (stepR1StarWord_sound w (stepR1StarWord w phase).2.2 + (wordL (stepR1StarWord w phase).1 +> l) hw hR2 + (k1 + 2 * (stepR1StarWord w phase).2.1)) ?_ + dsimp -failIfUnchanged only + rw [halt] + have ih := stepR1Star_alt_pow q w phase + (wordL ((stepR1StarWord w (stepR1StarWord w phase).2.2).1 ++ + (stepR1StarWord w phase).1) +> l) + hw halt hR + (k1 + 2 * (stepR1StarWord w phase).2.1 + + 2 * (stepR1StarWord w (stepR1StarWord w phase).2.2).2.1) + dsimp -failIfUnchanged only at ih + have hadd : + k1 + 2 * (stepR1StarWord w phase).2.1 + + 2 * (stepR1StarWord w (stepR1StarWord w phase).2.2).2.1 + + 2 * (q * ((stepR1StarWord w phase).2.1 + + (stepR1StarWord w (stepR1StarWord w phase).2.2).2.1)) = + k1 + 2 * ((q + 1) * ((stepR1StarWord w phase).2.1 + + (stepR1StarWord w (stepR1StarWord w phase).2.2).2.1)) := by + have : (q + 1) * ((stepR1StarWord w phase).2.1 + + (stepR1StarWord w (stepR1StarWord w phase).2.2).2.1) = + q * ((stepR1StarWord w phase).2.1 + + (stepR1StarWord w (stepR1StarWord w phase).2.2).2.1) + + ((stepR1StarWord w phase).2.1 + + (stepR1StarWord w (stepR1StarWord w phase).2.2).2.1) := Nat.succ_mul q _ + omega + rw [hadd] at ih + have hw_app : + wordL (stepR1StarWord w (stepR1StarWord w phase).2.2).1 +> + (wordL (stepR1StarWord w phase).1 +> l) = + wordL ((stepR1StarWord w (stepR1StarWord w phase).2.2).1 ++ + (stepR1StarWord w phase).1) +> l := by + rw [wordL_append, listblank_append_assoc] + rw [hw_app, pow_succ_right, listblank_append_assoc] + exact ih + +theorem evalRle_pushRle_one (w : List Tok) (rle : Rle) : + evalRle (pushRle w 1 rle) = wordL w +> evalRle rle := by + rw [evalRle_pushRle, pow_succ_list, pow_zero_list, List.append_nil] + +def sweepStarLoop : Rle → Bool → Nat → Rle → Rle × Bool × Nat + | rle, phase, totalRes, [] => (rle, phase, totalRes) + | rle, phase, totalRes, (item, count) :: rest => + let (out1, res1, nextPhase) := stepR1StarWord item phase + if nextPhase == phase then + sweepStarLoop (pushRle out1 count rle) phase (totalRes + count * res1) rest + else + let (out2, res2, _) := stepR1StarWord item nextPhase + let q := count / 2 + let rem := count % 2 + let rle1 := pushRle (out2 ++ out1) q rle + let resAfterQ := totalRes + q * (res1 + res2) + if rem == 1 then + sweepStarLoop (pushRle out1 1 rle1) nextPhase (resAfterQ + res1) rest + else + sweepStarLoop rle1 phase resAfterQ rest + +theorem sweepStarLoop_sound : ∀ (rs : Rle) (rle : Rle) (phase : Bool) (totalRes : Nat) + {R : Nat → ListBlank (Fin 2)}, + allZpStack rs = true → HasRoundtrip R → + ∀ (k1 : Nat), + let res := sweepStarLoop rle phase totalRes rs + (r1PhaseCfg phase (evalRle rle) (evalRStack rs (R (k1 + 2 * totalRes)))) [target_tm]⊢* + (r1PhaseCfg res.2.1 (evalRle res.1) (R (k1 + 2 * res.2.2))) + | [], rle, phase, totalRes, R, _, _, k1 => stepStar_refl _ _ + | (item, count) :: rest, rle, phase, totalRes, R, hrs, hR, k1 => by + simp only [allZpStack, Bool.and_eq_true] at hrs + rcases hrs with ⟨hitem, hrest⟩ + have hR_rest : HasRoundtrip (fun k => evalRStack rest (R k)) := + hasRoundtrip_stack rest hrest hR + dsimp -failIfUnchanged only [sweepStarLoop] + by_cases hsame : (stepR1StarWord item phase).2.2 = phase + · have hbeq : ((stepR1StarWord item phase).2.2 == phase) = true := beq_iff_eq.mpr hsame + rw [hbeq] + simp only [↓reduceIte, evalRStack_cons] + refine stepStar_trans + (stepR1Star_same_pow count item phase (evalRle rle) hitem hsame hR_rest (k1 + 2 * totalRes)) ?_ + dsimp -failIfUnchanged only + have hadd : k1 + 2 * totalRes + 2 * (count * (stepR1StarWord item phase).2.1) = + k1 + 2 * (totalRes + count * (stepR1StarWord item phase).2.1) := by omega + rw [hadd, ← evalRle_pushRle] + exact sweepStarLoop_sound rest (pushRle (stepR1StarWord item phase).1 count rle) + phase (totalRes + count * (stepR1StarWord item phase).2.1) hrest hR k1 + · have hbeq : ((stepR1StarWord item phase).2.2 == phase) = false := beq_false_of_ne hsame + rw [hbeq] + simp only [Bool.false_eq_true, ↓reduceIte] + have hnot : (stepR1StarWord item phase).2.2 = !phase := by + cases phase <;> cases h : (stepR1StarWord item false).2.2 <;> + cases h2 : (stepR1StarWord item true).2.2 <;> simp_all + have halt : (stepR1StarWord item (stepR1StarWord item phase).2.2).2.2 = phase := by + rw [hnot, stepR1StarWord_phase_inv item phase hitem] + cases phase <;> cases h : (stepR1StarWord item false).2.2 <;> + cases h2 : (stepR1StarWord item true).2.2 <;> simp_all + generalize hq : count / 2 = q + generalize hrem : count % 2 = rem + have hdiv : count = 2 * q + rem := by omega + simp only [evalRStack_cons] + rw [hdiv, list_pow_add, listblank_append_assoc] + have hR_rem : HasRoundtrip (fun k => ((wordR item) ^ rem) +> evalRStack rest (R k)) := + hasRoundtrip_pow rem item hitem hR_rest + refine stepStar_trans + (stepR1Star_alt_pow q item phase (evalRle rle) hitem halt hR_rem (k1 + 2 * totalRes)) ?_ + dsimp -failIfUnchanged only + rw [← evalRle_pushRle] + have hadd1 : k1 + 2 * totalRes + + 2 * (q * ((stepR1StarWord item phase).2.1 + + (stepR1StarWord item (stepR1StarWord item phase).2.2).2.1)) = + k1 + 2 * (totalRes + q * ((stepR1StarWord item phase).2.1 + + (stepR1StarWord item (stepR1StarWord item phase).2.2).2.1)) := by omega + rw [hadd1] + rcases (by omega : rem = 0 ∨ rem = 1) with rfl | rfl + · have h01 : (0 == 1) = false := rfl + rw [h01] + simp only [Bool.false_eq_true, ↓reduceIte, pow_zero_list, listblank_append_nil] + exact sweepStarLoop_sound rest _ phase _ hrest hR k1 + · simp only [beq_self_eq_true, ↓reduceIte, pow_succ_list, pow_zero_list, List.append_nil] + refine stepStar_trans + (stepR1StarWord_sound item phase _ hitem hR_rest _) ?_ + dsimp -failIfUnchanged only + rw [← evalRle_pushRle_one] + have hadd2 : k1 + 2 * (totalRes + q * ((stepR1StarWord item phase).2.1 + + (stepR1StarWord item (stepR1StarWord item phase).2.2).2.1)) + + 2 * (stepR1StarWord item phase).2.1 = + k1 + 2 * (totalRes + q * ((stepR1StarWord item phase).2.1 + + (stepR1StarWord item (stepR1StarWord item phase).2.2).2.1) + + (stepR1StarWord item phase).2.1) := by omega + rw [hadd2] + exact sweepStarLoop_sound rest _ _ _ hrest hR k1 + +-- ============================================================================ +-- Section 6.7: Turnaround, Special Loops, and Macro-Step Soundness +-- ============================================================================ + +def modeCfg : Mode → ListBlank (Fin 2) → ListBlank (Fin 2) → Cfg (Fin 2) (Fin 6) + | .R0, l, r => r0Cfg l r + | .R1, l, r => r1Cfg l r + | .R1_ODD, l, r => r1OddCfg l r + +@[simp] theorem modeCfg_R0 (l r : ListBlank (Fin 2)) : modeCfg .R0 l r = r0Cfg l r := rfl +@[simp] theorem modeCfg_R1 (l r : ListBlank (Fin 2)) : modeCfg .R1 l r = r1Cfg l r := rfl +@[simp] theorem modeCfg_R1_ODD (l r : ListBlank (Fin 2)) : modeCfg .R1_ODD l r = r1OddCfg l r := rfl + +def stepOneTok (rle : Rle) (mode : Mode) (t : Tok) : Option (Rle × Mode) := + match mode, t with + | .R0, .PTTTM_TAIL => some (pushRle [.Z] 1 rle, .R1) + | .R0, .Z => some (pushRle [.Z] 1 rle, .R0) + | .R0, .P => some (pushRle [.P] 1 rle, .R0) + | .R1, .Z => some (pushToksLtr [.Z, .M] rle, .R0) + | .R1, .P => some (pushRle [.P] 1 rle, .R1_ODD) + | .R1_ODD, .Z => some (pushRle [.Z] 1 rle, .R1_ODD) + | .R1_ODD, .P => some (pushRle [.Z] 1 rle, .R1) + | _, _ => none + +theorem stepOneTok_sound (rle rle' : Rle) (mode mode' : Mode) (t : Tok) (r : ListBlank (Fin 2)) + (h : stepOneTok rle mode t = some (rle', mode')) : + (modeCfg mode (evalRle rle) (tokR t +> r)) [target_tm]⊢* + (modeCfg mode' (evalRle rle') r) := by + cases mode with + | R0 => + cases t with + | Z => + simp only [stepOneTok, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + simp only [modeCfg, evalRle_pushRle_one, wordL_cons, wordL_nil, List.append_nil] + exact ⟨_, r0_Z (evalRle rle) r⟩ + | P => + simp only [stepOneTok, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + simp only [modeCfg, evalRle_pushRle_one, wordL_cons, wordL_nil, List.append_nil] + exact ⟨_, r0_P (evalRle rle) r⟩ + | PTTTM_TAIL => + simp only [stepOneTok, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + simp only [modeCfg, evalRle_pushRle_one, wordL_cons, wordL_nil, List.append_nil] + exact ⟨_, r0_PTTTM_TAIL (evalRle rle) r⟩ + | U => nomatch h + | M => nomatch h + | W => nomatch h + | T => nomatch h + | R1 => + cases t with + | Z => + simp only [stepOneTok, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + simp only [modeCfg, pushToksLtr, evalRle_pushRle_one, wordL_cons, wordL_nil, List.append_nil] + exact ⟨_, r1_Z (evalRle rle) r⟩ + | P => + simp only [stepOneTok, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + simp only [modeCfg, evalRle_pushRle_one, wordL_cons, wordL_nil, List.append_nil] + exact ⟨_, r1_P (evalRle rle) r⟩ + | U => nomatch h + | M => nomatch h + | W => nomatch h + | T => nomatch h + | PTTTM_TAIL => nomatch h + | R1_ODD => + cases t with + | Z => + simp only [stepOneTok, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + simp only [modeCfg, evalRle_pushRle_one, wordL_cons, wordL_nil, List.append_nil] + exact ⟨_, r1Odd_Z (evalRle rle) r⟩ + | P => + simp only [stepOneTok, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + simp only [modeCfg, evalRle_pushRle_one, wordL_cons, wordL_nil, List.append_nil] + exact ⟨_, r1Odd_P (evalRle rle) r⟩ + | U => nomatch h + | M => nomatch h + | W => nomatch h + | T => nomatch h + | PTTTM_TAIL => nomatch h + +def stepOneWord : Rle → Mode → List Tok → Option (Rle × Mode) + | rle, mode, [] => some (rle, mode) + | rle, mode, t :: ts => + match stepOneTok rle mode t with + | some (rle1, mode1) => stepOneWord rle1 mode1 ts + | none => none + +theorem stepOneWord_sound : ∀ (w : List Tok) (rle rle' : Rle) (mode mode' : Mode) (r : ListBlank (Fin 2)), + stepOneWord rle mode w = some (rle', mode') → + (modeCfg mode (evalRle rle) (wordR w +> r)) [target_tm]⊢* + (modeCfg mode' (evalRle rle') r) + | [], rle, rle', mode, mode', r, h => by + simp only [stepOneWord, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + try exact stepStar_refl _ _ + | t :: ts, rle, rle', mode, mode', r, h => by + unfold stepOneWord at h + cases ht : stepOneTok rle mode t with + | none => rw [ht] at h; nomatch h + | some p => + rcases p with ⟨rle1, mode1⟩ + rw [ht] at h + rw [wordR_cons, listblank_append_assoc] + refine stepStar_trans (stepOneTok_sound rle rle1 mode mode1 t (wordR ts +> r) ht) ?_ + exact stepOneWord_sound ts rle1 rle' mode1 mode' r h + +theorem r1_PP_pow : ∀ (q : Nat) (l r : ListBlank (Fin 2)), + (r1Cfg l (((wordR [.P]) ^ (2 * q)) +> r)) [target_tm]⊢* + (r1Cfg (((wordL [.Z, .P]) ^ q) +> l) r) + | 0, l, r => stepStar_refl _ _ + | q + 1, l, r => by + have h2 : 2 * (q + 1) = 1 + (1 + 2 * q) := by omega + rw [h2, list_pow_add, list_pow_add, pow_succ_list, pow_zero_list, List.append_nil, + wordR_cons, wordR_nil, List.append_nil, listblank_append_assoc, listblank_append_assoc] + refine stepStar_trans ⟨_, r1_P l _⟩ ?_ + refine stepStar_trans ⟨_, r1Odd_P (tokL .P +> l) _⟩ ?_ + have ih := r1_PP_pow q (wordL [.Z, .P] +> l) r + have hw : tokL .Z +> (tokL .P +> l) = wordL [.Z, .P] +> l := by + simp [wordL_cons, wordL_nil, listblank_append_assoc] + rw [hw, pow_succ_right, listblank_append_assoc] + exact ih + +theorem r1Odd_PP_pow : ∀ (q : Nat) (l r : ListBlank (Fin 2)), + (r1OddCfg l (((wordR [.P]) ^ (2 * q)) +> r)) [target_tm]⊢* + (r1OddCfg (((wordL [.P, .Z]) ^ q) +> l) r) + | 0, l, r => stepStar_refl _ _ + | q + 1, l, r => by + have h2 : 2 * (q + 1) = 1 + (1 + 2 * q) := by omega + rw [h2, list_pow_add, list_pow_add, pow_succ_list, pow_zero_list, List.append_nil, + wordR_cons, wordR_nil, List.append_nil, listblank_append_assoc, listblank_append_assoc] + refine stepStar_trans ⟨_, r1Odd_P l _⟩ ?_ + refine stepStar_trans ⟨_, r1_P (tokL .Z +> l) _⟩ ?_ + have ih := r1Odd_PP_pow q (wordL [.P, .Z] +> l) r + have hw : tokL .P +> (tokL .Z +> l) = wordL [.P, .Z] +> l := by + simp [wordL_cons, wordL_nil, listblank_append_assoc] + rw [hw, pow_succ_right, listblank_append_assoc] + exact ih + +def stepOneBounceFuel : Nat → List Tok → Nat → Rle → Mode → Option (Rle × Mode) + | _, _, 0, rle, mode => some (rle, mode) + | 0, _, _ + 1, _, _ => none + | fuel + 1, item, count + 1, rle, mode => + if mode == .R0 && isZpWord item then + some (pushRle (revWord item) (count + 1) rle, .R0) + else if item == [.P] && mode == .R1 && count >= 1 then + let q := (count + 1) / 2 + let rem := (count + 1) % 2 + stepOneBounceFuel fuel [.P] rem (pushRle [.Z, .P] q rle) .R1 + else if item == [.P] && mode == .R1_ODD && count >= 1 then + let q := (count + 1) / 2 + let rem := (count + 1) % 2 + stepOneBounceFuel fuel [.P] rem (pushRle [.P, .Z] q rle) .R1_ODD + else + match stepOneWord rle mode item with + | some (rle1, mode1) => stepOneBounceFuel fuel item count rle1 mode1 + | none => none + +theorem stepOneBounceFuel_sound : ∀ (fuel : Nat) (item : List Tok) (count : Nat) + (rle rle' : Rle) (mode mode' : Mode) (r : ListBlank (Fin 2)), + stepOneBounceFuel fuel item count rle mode = some (rle', mode') → + (modeCfg mode (evalRle rle) (((wordR item) ^ count) +> r)) [target_tm]⊢* + (modeCfg mode' (evalRle rle') r) + | _, _, 0, rle, rle', mode, mode', r, h => by + simp only [stepOneBounceFuel, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + try exact stepStar_refl _ _ + | 0, _, _ + 1, _, _, _, _, _, h => by nomatch h + | fuel + 1, item, count + 1, rle, rle', mode, mode', r, h => by + unfold stepOneBounceFuel at h + split at h + · rename_i hcond + simp only [Bool.and_eq_true, beq_iff_eq] at hcond + rcases hcond with ⟨rfl, hitem⟩ + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + simp only [modeCfg_R0, evalRle_pushRle] + exact r0_pow (count + 1) item (evalRle rle) r hitem + · split at h + · rename_i hcond2 + simp only [Bool.and_eq_true, beq_iff_eq, ge_iff_le, decide_eq_true_eq] at hcond2 + rcases hcond2 with ⟨⟨rfl, rfl⟩, _⟩ + generalize hq : (count + 1) / 2 = q at h + generalize hrem : (count + 1) % 2 = rem at h + have hdiv : count + 1 = 2 * q + rem := by omega + rw [hdiv, list_pow_add, listblank_append_assoc] + simp only [modeCfg_R1] + refine stepStar_trans (r1_PP_pow q (evalRle rle) (((wordR [.P]) ^ rem) +> r)) ?_ + rw [← evalRle_pushRle] + exact stepOneBounceFuel_sound fuel [.P] rem (pushRle [.Z, .P] q rle) rle' .R1 mode' r h + · split at h + · rename_i hcond3 + simp only [Bool.and_eq_true, beq_iff_eq, ge_iff_le, decide_eq_true_eq] at hcond3 + rcases hcond3 with ⟨⟨rfl, rfl⟩, _⟩ + generalize hq : (count + 1) / 2 = q at h + generalize hrem : (count + 1) % 2 = rem at h + have hdiv : count + 1 = 2 * q + rem := by omega + rw [hdiv, list_pow_add, listblank_append_assoc] + simp only [modeCfg_R1_ODD] + refine stepStar_trans (r1Odd_PP_pow q (evalRle rle) (((wordR [.P]) ^ rem) +> r)) ?_ + rw [← evalRle_pushRle] + exact stepOneBounceFuel_sound fuel [.P] rem (pushRle [.P, .Z] q rle) rle' .R1_ODD mode' r h + · cases hw : stepOneWord rle mode item with + | none => rw [hw] at h; nomatch h + | some p => + rcases p with ⟨rle1, mode1⟩ + rw [hw] at h + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans (stepOneWord_sound item rle rle1 mode mode1 (((wordR item) ^ count) +> r) hw) ?_ + exact stepOneBounceFuel_sound fuel item count rle1 rle' mode1 mode' r h + +def simpleOneBounceCarry : Rle → Mode → Rle → Nat → Option (Rle × Nat) + | rle, mode, [], k1 => + if mode == .R0 then + some (rle, k1 + 2) + else none + | rle, mode, (item, count) :: rest, k1 => + match stepOneBounceFuel 3 item count rle mode with + | some (rle', mode') => simpleOneBounceCarry rle' mode' rest k1 + | none => none + +theorem simpleOneBounceCarry_sound : ∀ (rs : Rle) (rle rle' : Rle) (mode : Mode) (k1 kOut : Nat), + simpleOneBounceCarry rle mode rs k1 = some (rle', kOut) → + (modeCfg mode (evalRle rle) (evalRStack rs (evalWK k1))) [target_tm]⊢* + (carryCfg (evalRle rle') (evalWK kOut)) + | [], rle, rle', mode, k1, kOut, h => by + unfold simpleOneBounceCarry at h + split at h + · rename_i hm + rw [beq_iff_eq] at hm; subst hm + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + exact r0_end k1 (evalRle rle) + · nomatch h + | (item, count) :: rest, rle, rle', mode, k1, kOut, h => by + unfold simpleOneBounceCarry at h + cases hb : stepOneBounceFuel 3 item count rle mode with + | none => rw [hb] at h; nomatch h + | some p => + rcases p with ⟨rle1, mode1⟩ + rw [hb] at h + simp only [evalRStack_cons] + refine stepStar_trans (stepOneBounceFuel_sound 3 item count rle rle1 mode mode1 _ hb) ?_ + exact simpleOneBounceCarry_sound rest rle1 rle' mode1 k1 kOut h + +def hasSpecial : Rle → Bool + | [] => false + | (it, _) :: rest => (it == [.PTTTM_TAIL]) || hasSpecial rest + +def runRightSweepStarCarry (rle : Rle) (mode : Mode) (rStack : Rle) (k1 : Nat) : Option (Rle × Nat) := + if mode == .R0 then + match copyRStack rle rStack with + | some rle' => some (rle', k1 + 2) + | none => none + else if hasSpecial rStack then + simpleOneBounceCarry rle mode rStack k1 + else if allZpStack rStack then + let initPhase := mode != .R1 + let (rle1, finalPhase, totalRes) := sweepStarLoop rle initPhase 0 rStack + let kFinal1 := k1 + 2 * totalRes + if !finalPhase then + some (stepZtToCarry (pushRle [.P] 1 rle1) (kFinal1 + 1)) + else + some (stepZtToCarry (pushRle [.Z] 1 rle1) kFinal1) + else none + +theorem runRightSweepStarCarry_sound (rle rStack rOut : Rle) (mode : Mode) (k1 kOut : Nat) + (h : runRightSweepStarCarry rle mode rStack k1 = some (rOut, kOut)) : + (modeCfg mode (evalRle rle) (evalRStack rStack (evalWK k1))) [target_tm]⊢* + (carryCfg (evalRle rOut) (evalWK kOut)) := by + unfold runRightSweepStarCarry at h + split at h + · rename_i hm + rw [beq_iff_eq] at hm; subst hm + cases hc : copyRStack rle rStack with + | none => rw [hc] at h; nomatch h + | some rle' => + rw [hc] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨h1, h2⟩ + rw [← h1, ← h2] + simp only [modeCfg_R0] + refine stepStar_trans (copyRStack_sound rStack rle rle' (evalWK k1) hc).2 ?_ + exact r0_end k1 (evalRle rle') + · rename_i hm + split at h + · exact simpleOneBounceCarry_sound rStack rle rOut mode k1 kOut h + · split at h + · rename_i hall + have hphase : modeCfg mode (evalRle rle) (evalRStack rStack (evalWK k1)) = + r1PhaseCfg (mode != .R1) (evalRle rle) (evalRStack rStack (evalWK (k1 + 2 * 0))) := by + cases mode with + | R0 => exfalso; exact hm rfl + | R1 => rfl + | R1_ODD => rfl + rw [hphase] + refine stepStar_trans + (sweepStarLoop_sound rStack rle (mode != .R1) 0 hall hasRoundtrip_evalWK k1) ?_ + dsimp -failIfUnchanged only at h ⊢ + generalize hsw : sweepStarLoop rle (mode != .R1) 0 rStack = sw at h ⊢ + rcases sw with ⟨rle1, finalPhase, totalRes⟩ + dsimp -failIfUnchanged only at h ⊢ + cases finalPhase with + | false => + change some (stepZtToCarry (pushRle [.P] 1 rle1) (k1 + 2 * totalRes + 1)) = some (rOut, kOut) at h + simp only [Option.some.injEq] at h + have h1 := congrArg Prod.fst h + have h2 := congrArg Prod.snd h + dsimp -failIfUnchanged only at h1 h2 + rw [← h1, ← h2] + simp only [r1PhaseCfg_false] + refine stepStar_trans (r1_end (k1 + 2 * totalRes) (evalRle rle1)) ?_ + have hzt := stepZtToCarry_sound (pushRle [.P] 1 rle1) (k1 + 2 * totalRes + 1) + rw [evalRle_pushRle_one] at hzt + exact hzt + | true => + change some (stepZtToCarry (pushRle [.Z] 1 rle1) (k1 + 2 * totalRes)) = some (rOut, kOut) at h + simp only [Option.some.injEq] at h + have h1 := congrArg Prod.fst h + have h2 := congrArg Prod.snd h + dsimp -failIfUnchanged only at h1 h2 + rw [← h1, ← h2] + simp only [r1PhaseCfg_true] + refine stepStar_trans (r1Odd_end (k1 + 2 * totalRes) (evalRle rle1)) ?_ + have hzt := stepZtToCarry_sound (pushRle [.Z] 1 rle1) (k1 + 2 * totalRes) + rw [evalRle_pushRle_one] at hzt + exact hzt + · nomatch h + +inductive StepCarryRes + | halt + | next (rle : Rle) (k1 : Nat) + | err + deriving DecidableEq, Repr + +def StepCarryValid (cfg : Cfg (Fin 2) (Fin 6)) : StepCarryRes → Prop + | .halt => ∃ cfg', (cfg [target_tm]⊢* cfg') ∧ (step target_tm cfg').isNone + | .next rOut kOut => cfg [target_tm]⊢* carryCfg (evalRle rOut) (evalWK kOut) + | .err => False + +theorem stepCarryValid_of_stepStar {cfg₁ cfg₂ : Cfg (Fin 2) (Fin 6)} {res : StepCarryRes} + (hstep : cfg₁ [target_tm]⊢* cfg₂) (hval : StepCarryValid cfg₂ res) : + StepCarryValid cfg₁ res := by + cases res with + | halt => + rcases hval with ⟨cfg', h2, hnone⟩ + exact ⟨cfg', stepStar_trans hstep h2, hnone⟩ + | next rOut kOut => + exact stepStar_trans hstep hval + | err => exact hval + +def finishTurn (rle : Rle) (mode : Mode) (rStack : Rle) (k1 : Nat) : StepCarryRes := + match runRightSweepStarCarry rle mode rStack k1 with + | some (rOut, kOut) => .next rOut kOut + | none => .err + +theorem finishTurn_sound (rle : Rle) (mode : Mode) (rStack : Rle) (k1 : Nat) + (hne : finishTurn rle mode rStack k1 ≠ .err) : + StepCarryValid (modeCfg mode (evalRle rle) (evalRStack rStack (evalWK k1))) + (finishTurn rle mode rStack k1) := by + unfold finishTurn at hne ⊢ + cases hr : runRightSweepStarCarry rle mode rStack k1 with + | none => rw [hr] at hne; exfalso; exact hne rfl + | some p => + rcases p with ⟨rOut, kOut⟩ + exact runRightSweepStarCarry_sound rle rStack rOut mode k1 kOut hr + +def stepTurnaround (r2 : Rle) (rStack : Rle) (k1 : Nat) : StepCarryRes := + if r2 == [([.M], 1), ([.U], 1)] then + finishTurn [([.M], 1), ([.U], 1)] .R1 rStack k1 + else if r2 == [([.T], 1), ([.M], 1), ([.U], 1)] then + finishTurn [([.Z], 1), ([.U], 1)] .R1 rStack k1 + else match popToks [.T, .Z] r2 with + | some r' => finishTurn (pushToksLtr [.T, .M] r') .R1 rStack k1 + | none => match popToks [.M, .W] r2 with + | some r' => finishTurn (pushToksLtr [.T] r') .R1 rStack k1 + | none => match popToks [.T, .P] r2 with + | some r' => finishTurn (pushToksLtr [.T, .P] r') .R0 rStack k1 + | none => match popToks [.M, .Z] r2 with + | some r' => finishTurn (pushToksLtr [.P] r') .R1 rStack k1 + | none => match popToks [.W, .T, .P] r2 with + | some r' => finishTurn (pushToksLtr [.M, .U, .Z] r') .R1_ODD rStack k1 + | none => match popToks [.M, .T, .P] r2 with + | some r' => finishTurn (pushToksLtr [.T, .Z] r') .R1 rStack k1 + | none => match popToks [.T, .T, .P] r2 with + | some r' => finishTurn (pushToksLtr [.M, .U, .Z] r') .R1 rStack k1 + | none => match popToks [.U, .M, .Z] r2 with + | some r' => finishTurn (pushToksLtr [.T, .T] r') .R1_ODD rStack k1 + | none => match popToks [.M, .T, .Z] r2 with + | some r' => finishTurn (pushToksLtr [.T, .M, .P] r') .R0 rStack k1 + | none => match popToks [.T, .T, .Z] r2 with + | some r' => finishTurn (pushToksLtr [.T, .W, .P] r') .R0 rStack k1 + | none => match popToks [.W, .T, .U, .M] r2 with + | some r' => finishTurn (pushToksLtr [.T, .Z] r') .R1_ODD rStack k1 + | none => match popToks [.M, .T, .T, .P] r2 with + | some r' => finishTurn (pushToksLtr [.M, .U, .Z, .P] r') .R0 rStack k1 + | none => match popToks [.W, .T, .T, .Z] r2 with + | some r' => finishTurn (pushToksLtr [.P, .Z, .Z] r') .R0 rStack k1 + | none => match popToks [.M, .T, .T, .Z] r2 with + | some r' => finishTurn (pushToksLtr [.T, .W, .Z] r') .R1 rStack k1 + | none => match popToks [.U, .M, .P, .Z] r2 with + | some r' => finishTurn (pushToksLtr [.T, .W, .M, .P] r') .R0 rStack k1 + | none => match popToks [.M, .T, .U, .M, .Z] r2 with + | some r' => finishTurn (pushToksLtr [.P, .Z, .P] r') .R0 rStack k1 + | none => match popToks [.W, .T, .T, .T, .P] r2 with + | some r' => finishTurn (pushToksLtr [.T, .Z, .Z, .Z] r') .R0 rStack k1 + | none => .err + +theorem turnBranch_sound (pat out : List Tok) (mode : Mode) (r2 r' rStack : Rle) (k1 : Nat) + (hp : popToks pat r2 = some r') + (hturn : (carryCfg (wordL pat +> evalRle r') (evalRStack rStack (evalWK k1))) [target_tm]⊢* + (modeCfg mode (evalRle (pushToksLtr out r')) (evalRStack rStack (evalWK k1)))) + (hne : finishTurn (pushToksLtr out r') mode rStack k1 ≠ .err) : + StepCarryValid (carryCfg (evalRle r2) (evalRStack rStack (evalWK k1))) + (finishTurn (pushToksLtr out r') mode rStack k1) := by + rw [popToks_sound pat r2 r' hp] + exact stepCarryValid_of_stepStar hturn (finishTurn_sound (pushToksLtr out r') mode rStack k1 hne) + +theorem stepTurnaround_sound (r2 rStack : Rle) (k1 : Nat) + (hne : stepTurnaround r2 rStack k1 ≠ .err) : + StepCarryValid (carryCfg (evalRle r2) (evalRStack rStack (evalWK k1))) + (stepTurnaround r2 rStack k1) := by + unfold stepTurnaround at hne ⊢ + split + · rename_i h1 + rw [if_pos h1] at hne + rw [beq_iff_eq] at h1; subst h1 + refine stepCarryValid_of_stepStar ?_ (finishTurn_sound [([.M], 1), ([.U], 1)] .R1 rStack k1 hne) + simp only [evalRle_cons, evalRle_nil, pow_succ_list, pow_zero_list, List.append_nil, + wordL_cons, wordL_nil, modeCfg_R1] + exact ⟨_, turn_UM (evalRStack rStack (evalWK k1))⟩ + · rename_i h1 + rw [if_neg h1] at hne + split + · rename_i h2 + rw [if_pos h2] at hne + rw [beq_iff_eq] at h2; subst h2 + refine stepCarryValid_of_stepStar ?_ (finishTurn_sound [([.Z], 1), ([.U], 1)] .R1 rStack k1 hne) + simp only [evalRle_cons, evalRle_nil, pow_succ_list, pow_zero_list, List.append_nil, + wordL_cons, wordL_nil, modeCfg_R1] + exact ⟨_, turn_UMT (evalRStack rStack (evalWK k1))⟩ + · rename_i h2 + rw [if_neg h2] at hne + cases hp0 : popToks [.T, .Z] r2 with + | some r' => + rw [hp0] at hne; dsimp -failIfUnchanged only at hne ⊢ + refine turnBranch_sound [.T, .Z] [.T, .M] .R1 r2 r' rStack k1 hp0 ?_ hne + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc, pushToksLtr, evalRle_pushRle_one, modeCfg] + exact ⟨_, turn_ZT (evalRle r') (evalRStack rStack (evalWK k1))⟩ + | none => + rw [hp0] at hne; dsimp -failIfUnchanged only at hne ⊢ + cases hp1 : popToks [.M, .W] r2 with + | some r' => + rw [hp1] at hne; dsimp -failIfUnchanged only at hne ⊢ + refine turnBranch_sound [.M, .W] [.T] .R1 r2 r' rStack k1 hp1 ?_ hne + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc, pushToksLtr, evalRle_pushRle_one, modeCfg] + exact ⟨_, turn_WM (evalRle r') (evalRStack rStack (evalWK k1))⟩ + | none => + rw [hp1] at hne; dsimp -failIfUnchanged only at hne ⊢ + cases hp2 : popToks [.T, .P] r2 with + | some r' => + rw [hp2] at hne; dsimp -failIfUnchanged only at hne ⊢ + refine turnBranch_sound [.T, .P] [.T, .P] .R0 r2 r' rStack k1 hp2 ?_ hne + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc, pushToksLtr, evalRle_pushRle_one, modeCfg] + exact ⟨_, turn_PT (evalRle r') (evalRStack rStack (evalWK k1))⟩ + | none => + rw [hp2] at hne; dsimp -failIfUnchanged only at hne ⊢ + cases hp3 : popToks [.M, .Z] r2 with + | some r' => + rw [hp3] at hne; dsimp -failIfUnchanged only at hne ⊢ + refine turnBranch_sound [.M, .Z] [.P] .R1 r2 r' rStack k1 hp3 ?_ hne + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc, pushToksLtr, evalRle_pushRle_one, modeCfg] + exact ⟨_, turn_ZM (evalRle r') (evalRStack rStack (evalWK k1))⟩ + | none => + rw [hp3] at hne; dsimp -failIfUnchanged only at hne ⊢ + cases hp4 : popToks [.W, .T, .P] r2 with + | some r' => + rw [hp4] at hne; dsimp -failIfUnchanged only at hne ⊢ + refine turnBranch_sound [.W, .T, .P] [.M, .U, .Z] .R1_ODD r2 r' rStack k1 hp4 ?_ hne + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc, pushToksLtr, evalRle_pushRle_one, modeCfg] + exact ⟨_, turn_PTW (evalRle r') (evalRStack rStack (evalWK k1))⟩ + | none => + rw [hp4] at hne; dsimp -failIfUnchanged only at hne ⊢ + cases hp5 : popToks [.M, .T, .P] r2 with + | some r' => + rw [hp5] at hne; dsimp -failIfUnchanged only at hne ⊢ + refine turnBranch_sound [.M, .T, .P] [.T, .Z] .R1 r2 r' rStack k1 hp5 ?_ hne + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc, pushToksLtr, evalRle_pushRle_one, modeCfg] + exact ⟨_, turn_PTM (evalRle r') (evalRStack rStack (evalWK k1))⟩ + | none => + rw [hp5] at hne; dsimp -failIfUnchanged only at hne ⊢ + cases hp6 : popToks [.T, .T, .P] r2 with + | some r' => + rw [hp6] at hne; dsimp -failIfUnchanged only at hne ⊢ + refine turnBranch_sound [.T, .T, .P] [.M, .U, .Z] .R1 r2 r' rStack k1 hp6 ?_ hne + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc, pushToksLtr, evalRle_pushRle_one, modeCfg] + exact ⟨_, turn_PTT (evalRle r') (evalRStack rStack (evalWK k1))⟩ + | none => + rw [hp6] at hne; dsimp -failIfUnchanged only at hne ⊢ + cases hp7 : popToks [.U, .M, .Z] r2 with + | some r' => + rw [hp7] at hne; dsimp -failIfUnchanged only at hne ⊢ + refine turnBranch_sound [.U, .M, .Z] [.T, .T] .R1_ODD r2 r' rStack k1 hp7 ?_ hne + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc, pushToksLtr, evalRle_pushRle_one, modeCfg] + exact ⟨_, turn_ZMU (evalRle r') (evalRStack rStack (evalWK k1))⟩ + | none => + rw [hp7] at hne; dsimp -failIfUnchanged only at hne ⊢ + cases hp8 : popToks [.M, .T, .Z] r2 with + | some r' => + rw [hp8] at hne; dsimp -failIfUnchanged only at hne ⊢ + refine turnBranch_sound [.M, .T, .Z] [.T, .M, .P] .R0 r2 r' rStack k1 hp8 ?_ hne + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc, pushToksLtr, evalRle_pushRle_one, modeCfg] + exact ⟨_, turn_ZTM (evalRle r') (evalRStack rStack (evalWK k1))⟩ + | none => + rw [hp8] at hne; dsimp -failIfUnchanged only at hne ⊢ + cases hp9 : popToks [.T, .T, .Z] r2 with + | some r' => + rw [hp9] at hne; dsimp -failIfUnchanged only at hne ⊢ + refine turnBranch_sound [.T, .T, .Z] [.T, .W, .P] .R0 r2 r' rStack k1 hp9 ?_ hne + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc, pushToksLtr, evalRle_pushRle_one, modeCfg] + exact ⟨_, turn_ZTT (evalRle r') (evalRStack rStack (evalWK k1))⟩ + | none => + rw [hp9] at hne; dsimp -failIfUnchanged only at hne ⊢ + cases hp10 : popToks [.W, .T, .U, .M] r2 with + | some r' => + rw [hp10] at hne; dsimp -failIfUnchanged only at hne ⊢ + refine turnBranch_sound [.W, .T, .U, .M] [.T, .Z] .R1_ODD r2 r' rStack k1 hp10 ?_ hne + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc, pushToksLtr, evalRle_pushRle_one, modeCfg] + exact ⟨_, turn_MUTW (evalRle r') (evalRStack rStack (evalWK k1))⟩ + | none => + rw [hp10] at hne; dsimp -failIfUnchanged only at hne ⊢ + cases hp11 : popToks [.M, .T, .T, .P] r2 with + | some r' => + rw [hp11] at hne; dsimp -failIfUnchanged only at hne ⊢ + refine turnBranch_sound [.M, .T, .T, .P] [.M, .U, .Z, .P] .R0 r2 r' rStack k1 hp11 ?_ hne + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc, pushToksLtr, evalRle_pushRle_one, modeCfg] + exact ⟨_, turn_PTTM (evalRle r') (evalRStack rStack (evalWK k1))⟩ + | none => + rw [hp11] at hne; dsimp -failIfUnchanged only at hne ⊢ + cases hp12 : popToks [.W, .T, .T, .Z] r2 with + | some r' => + rw [hp12] at hne; dsimp -failIfUnchanged only at hne ⊢ + refine turnBranch_sound [.W, .T, .T, .Z] [.P, .Z, .Z] .R0 r2 r' rStack k1 hp12 ?_ hne + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc, pushToksLtr, evalRle_pushRle_one, modeCfg] + exact ⟨_, turn_ZTTW (evalRle r') (evalRStack rStack (evalWK k1))⟩ + | none => + rw [hp12] at hne; dsimp -failIfUnchanged only at hne ⊢ + cases hp13 : popToks [.M, .T, .T, .Z] r2 with + | some r' => + rw [hp13] at hne; dsimp -failIfUnchanged only at hne ⊢ + refine turnBranch_sound [.M, .T, .T, .Z] [.T, .W, .Z] .R1 r2 r' rStack k1 hp13 ?_ hne + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc, pushToksLtr, evalRle_pushRle_one, modeCfg] + exact ⟨_, turn_ZTTM (evalRle r') (evalRStack rStack (evalWK k1))⟩ + | none => + rw [hp13] at hne; dsimp -failIfUnchanged only at hne ⊢ + cases hp14 : popToks [.U, .M, .P, .Z] r2 with + | some r' => + rw [hp14] at hne; dsimp -failIfUnchanged only at hne ⊢ + refine turnBranch_sound [.U, .M, .P, .Z] [.T, .W, .M, .P] .R0 r2 r' rStack k1 hp14 ?_ hne + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc, pushToksLtr, evalRle_pushRle_one, modeCfg] + exact ⟨_, turn_ZPMU (evalRle r') (evalRStack rStack (evalWK k1))⟩ + | none => + rw [hp14] at hne; dsimp -failIfUnchanged only at hne ⊢ + cases hp15 : popToks [.M, .T, .U, .M, .Z] r2 with + | some r' => + rw [hp15] at hne; dsimp -failIfUnchanged only at hne ⊢ + refine turnBranch_sound [.M, .T, .U, .M, .Z] [.P, .Z, .P] .R0 r2 r' rStack k1 hp15 ?_ hne + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc, pushToksLtr, evalRle_pushRle_one, modeCfg] + exact ⟨_, turn_ZMUTM (evalRle r') (evalRStack rStack (evalWK k1))⟩ + | none => + rw [hp15] at hne; dsimp -failIfUnchanged only at hne ⊢ + cases hp16 : popToks [.W, .T, .T, .T, .P] r2 with + | some r' => + rw [hp16] at hne; dsimp -failIfUnchanged only at hne ⊢ + refine turnBranch_sound [.W, .T, .T, .T, .P] [.T, .Z, .Z, .Z] .R0 r2 r' rStack k1 hp16 ?_ hne + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc, pushToksLtr, evalRle_pushRle_one, modeCfg] + exact ⟨_, turn_PTTTW (evalRle r') (evalRStack rStack (evalWK k1))⟩ + | none => + rw [hp16] at hne; dsimp -failIfUnchanged only at hne ⊢ + exfalso; exact hne rfl + +theorem wordL_Z_pow (n : Nat) : (wordL [.Z]) ^ n = (tokL .Z) ^ n := rfl +theorem wordL_P_pow (n : Nat) : (wordL [.P]) ^ n = (tokL .P) ^ n := rfl + +theorem special_ZTM_loop : ∀ (n : Nat) (l : ListBlank (Fin 2)) {R : Nat → ListBlank (Fin 2)}, + HasRoundtrip R → ∀ (k1 : Nat), + (carryCfg (tokL .M +> (tokL .T +> (((tokL .Z) ^ (n + 1)) +> l))) (R k1)) [target_tm]⊢* + (r0Cfg (((tokL .P) ^ (n + 1)) +> (tokL .M +> (tokL .T +> l))) (R (k1 + 2 * n))) + | 0, l, R, _, k1 => by + simp only [Nat.zero_add, pow_succ_list, pow_zero_list, List.append_nil, Nat.mul_zero, Nat.add_zero] + exact ⟨_, turn_ZTM l (R k1)⟩ + | n + 1, l, R, hR, k1 => by + rw [pow_succ_list (tokL .Z) (n + 1), listblank_append_assoc] + refine stepStar_trans ⟨_, turn_ZTM (((tokL .Z) ^ (n + 1)) +> l) (R k1)⟩ ?_ + refine stepStar_trans (hR (tokL .P +> (tokL .M +> (tokL .T +> (((tokL .Z) ^ (n + 1)) +> l)))) k1) ?_ + refine stepStar_trans ⟨_, carry_P (tokL .M +> (tokL .T +> (((tokL .Z) ^ (n + 1)) +> l))) (R (k1 + 2))⟩ ?_ + refine stepStar_trans (special_ZTM_loop n l (hasRoundtrip_P hR) (k1 + 2)) ?_ + dsimp -failIfUnchanged only + refine stepStar_trans ⟨_, r0_P (((tokL .P) ^ (n + 1)) +> (tokL .M +> (tokL .T +> l))) (R (k1 + 2 + 2 * n))⟩ ?_ + have hadd : k1 + 2 + 2 * n = k1 + 2 * (n + 1) := by omega + rw [hadd, ← listblank_append_assoc, ← pow_succ_list (tokL .P) (n + 1)] + try exact stepStar_refl _ _ + +theorem special_PT_loop : ∀ (n : Nat) (l : ListBlank (Fin 2)) {R : Nat → ListBlank (Fin 2)}, + HasRoundtrip R → ∀ (k1 : Nat), + (carryCfg (tokL .T +> (((tokL .P) ^ (n + 1)) +> l)) (R k1)) [target_tm]⊢* + (r0Cfg (((tokL .P) ^ (n + 1)) +> (tokL .T +> l)) (R (k1 + 2 * n))) + | 0, l, R, _, k1 => by + simp only [Nat.zero_add, pow_succ_list, pow_zero_list, List.append_nil, Nat.mul_zero, Nat.add_zero] + exact ⟨_, turn_PT l (R k1)⟩ + | n + 1, l, R, hR, k1 => by + rw [pow_succ_list (tokL .P) (n + 1), listblank_append_assoc] + refine stepStar_trans ⟨_, turn_PT (((tokL .P) ^ (n + 1)) +> l) (R k1)⟩ ?_ + refine stepStar_trans (hR (tokL .P +> (tokL .T +> (((tokL .P) ^ (n + 1)) +> l))) k1) ?_ + refine stepStar_trans ⟨_, carry_P (tokL .T +> (((tokL .P) ^ (n + 1)) +> l)) (R (k1 + 2))⟩ ?_ + refine stepStar_trans (special_PT_loop n l (hasRoundtrip_P hR) (k1 + 2)) ?_ + dsimp -failIfUnchanged only + refine stepStar_trans ⟨_, r0_P (((tokL .P) ^ (n + 1)) +> (tokL .T +> l)) (R (k1 + 2 + 2 * n))⟩ ?_ + have hadd : k1 + 2 + 2 * n = k1 + 2 * (n + 1) := by omega + rw [hadd, ← listblank_append_assoc, ← pow_succ_list (tokL .P) (n + 1)] + try exact stepStar_refl _ _ + +theorem special_ZTW_loop : ∀ (n : Nat) (l : ListBlank (Fin 2)) {R : Nat → ListBlank (Fin 2)}, + HasRoundtrip R → ∀ (k1 : Nat), + (carryCfg (tokL .W +> (tokL .T +> (((tokL .Z) ^ (n + 1)) +> l))) (R k1)) [target_tm]⊢* + (r0Cfg (((tokL .Z) ^ (n + 1)) +> (tokL .W +> (tokL .T +> l))) (R (k1 + 2 * n))) + | 0, l, R, _, k1 => by + simp only [Nat.zero_add, pow_succ_list, pow_zero_list, List.append_nil, Nat.mul_zero, Nat.add_zero] + exact ⟨_, turn_ZTW l (R k1)⟩ + | n + 1, l, R, hR, k1 => by + rw [pow_succ_list (tokL .Z) (n + 1), listblank_append_assoc] + refine stepStar_trans ⟨_, turn_ZTW (((tokL .Z) ^ (n + 1)) +> l) (R k1)⟩ ?_ + refine stepStar_trans (hR (tokL .Z +> (tokL .W +> (tokL .T +> (((tokL .Z) ^ (n + 1)) +> l)))) k1) ?_ + refine stepStar_trans ⟨_, carry_Z (tokL .W +> (tokL .T +> (((tokL .Z) ^ (n + 1)) +> l))) (R (k1 + 2))⟩ ?_ + refine stepStar_trans (special_ZTW_loop n l (hasRoundtrip_Z hR) (k1 + 2)) ?_ + dsimp -failIfUnchanged only + refine stepStar_trans ⟨_, r0_Z (((tokL .Z) ^ (n + 1)) +> (tokL .W +> (tokL .T +> l))) (R (k1 + 2 + 2 * n))⟩ ?_ + have hadd : k1 + 2 + 2 * n = k1 + 2 * (n + 1) := by omega + rw [hadd, ← listblank_append_assoc, ← pow_succ_list (tokL .Z) (n + 1)] + try exact stepStar_refl _ _ + +def stepSpecialLoops (r2 rStack : Rle) (k1 : Nat) : Option StepCarryRes := + match popPrefixCount [.M, .T] [.Z] r2 with + | some (b, r3) => + match copyRStack (pushRle [.P] b (pushToksLtr [.T, .M] r3)) rStack with + | some r4 => some (.next r4 (k1 + 2 * b)) + | none => some .err + | none => match popPrefixCount [.T] [.P] r2 with + | some (b, r3) => + match copyRStack (pushRle [.P] b (pushRle [.T] 1 r3)) rStack with + | some r4 => some (.next r4 (k1 + 2 * b)) + | none => some .err + | none => match popPrefixCount [.W, .T] [.Z] r2 with + | some (b, r3) => + match copyRStack (pushRle [.Z] b (pushToksLtr [.T, .W] r3)) rStack with + | some r4 => some (.next r4 (k1 + 2 * b)) + | none => some .err + | none => match popPrefixCount [.U, .M] [.P] r2 with + | some (mVal, r3) => + match popTok .Z r3 with + | some r4 => + let r5 := pushRle [.P] 1 (pushRle [.Z] (mVal - 1) (pushToksLtr [.T, .W, .M] r4)) + some (finishTurn r5 .R0 rStack k1) + | none => + match popToks [.M, .T] r3 with + | some _ => some .halt + | none => some .err + | none => none + +theorem stepSpecialLoops_sound (r2 rStack : Rle) (k1 : Nat) (res : StepCarryRes) + (h : stepSpecialLoops r2 rStack k1 = some res) (hne : res ≠ .err) : + StepCarryValid (carryCfg (evalRle r2) (evalRStack rStack (evalWK k1))) res := by + unfold stepSpecialLoops at h + revert h + cases hp1 : popPrefixCount [.M, .T] [.Z] r2 with + | some p1 => + rcases p1 with ⟨b, r3⟩ + dsimp -failIfUnchanged only + rcases popPrefixCount_sound [.M, .T] [.Z] r2 r3 b hp1 with ⟨hb, hr2⟩ + cases hc1 : copyRStack (pushRle [.P] b (pushToksLtr [.T, .M] r3)) rStack with + | none => + intro h; injection h with h'; subst h'; exfalso; exact hne rfl + | some r4 => + intro h; injection h with h'; subst h' + rcases copyRStack_sound rStack (pushRle [.P] b (pushToksLtr [.T, .M] r3)) r4 (evalWK (k1 + 2 * (b - 1))) hc1 with ⟨hrs, hcopy⟩ + have hb1 : b = (b - 1) + 1 := by omega + have hR := hasRoundtrip_stack rStack hrs hasRoundtrip_evalWK + rw [hr2, wordL_Z_pow, hb1] + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc] + refine stepStar_trans (special_ZTM_loop (b - 1) (evalRle r3) hR k1) ?_ + rw [← hb1] + simp only [pushToksLtr, evalRle_pushRle, wordL_cons, wordL_nil, + List.append_nil, pow_succ_list, pow_zero_list] at hcopy + refine stepStar_trans hcopy ?_ + have hadd : k1 + 2 * (b - 1) + 2 = k1 + 2 * b := by omega + rw [← hadd] + exact r0_end (k1 + 2 * (b - 1)) (evalRle r4) + | none => + dsimp -failIfUnchanged only + cases hp2 : popPrefixCount [.T] [.P] r2 with + | some p2 => + rcases p2 with ⟨b, r3⟩ + dsimp -failIfUnchanged only + rcases popPrefixCount_sound [.T] [.P] r2 r3 b hp2 with ⟨hb, hr2⟩ + cases hc2 : copyRStack (pushRle [.P] b (pushRle [.T] 1 r3)) rStack with + | none => + intro h; injection h with h'; subst h'; exfalso; exact hne rfl + | some r4 => + intro h; injection h with h'; subst h' + rcases copyRStack_sound rStack (pushRle [.P] b (pushRle [.T] 1 r3)) r4 (evalWK (k1 + 2 * (b - 1))) hc2 with ⟨hrs, hcopy⟩ + have hb1 : b = (b - 1) + 1 := by omega + have hR := hasRoundtrip_stack rStack hrs hasRoundtrip_evalWK + rw [hr2, wordL_P_pow, hb1] + simp only [wordL_cons, wordL_nil, List.append_nil] + refine stepStar_trans (special_PT_loop (b - 1) (evalRle r3) hR k1) ?_ + rw [← hb1] + simp only [evalRle_pushRle, wordL_cons, wordL_nil, + List.append_nil, pow_succ_list, pow_zero_list] at hcopy + refine stepStar_trans hcopy ?_ + have hadd : k1 + 2 * (b - 1) + 2 = k1 + 2 * b := by omega + rw [← hadd] + exact r0_end (k1 + 2 * (b - 1)) (evalRle r4) + | none => + dsimp -failIfUnchanged only + cases hp3 : popPrefixCount [.W, .T] [.Z] r2 with + | some p3 => + rcases p3 with ⟨b, r3⟩ + dsimp -failIfUnchanged only + rcases popPrefixCount_sound [.W, .T] [.Z] r2 r3 b hp3 with ⟨hb, hr2⟩ + cases hc3 : copyRStack (pushRle [.Z] b (pushToksLtr [.T, .W] r3)) rStack with + | none => + intro h; injection h with h'; subst h'; exfalso; exact hne rfl + | some r4 => + intro h; injection h with h'; subst h' + rcases copyRStack_sound rStack (pushRle [.Z] b (pushToksLtr [.T, .W] r3)) r4 (evalWK (k1 + 2 * (b - 1))) hc3 with ⟨hrs, hcopy⟩ + have hb1 : b = (b - 1) + 1 := by omega + have hR := hasRoundtrip_stack rStack hrs hasRoundtrip_evalWK + rw [hr2, wordL_Z_pow, hb1] + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc] + refine stepStar_trans (special_ZTW_loop (b - 1) (evalRle r3) hR k1) ?_ + rw [← hb1] + simp only [pushToksLtr, evalRle_pushRle, wordL_cons, wordL_nil, + List.append_nil, pow_succ_list, pow_zero_list] at hcopy + refine stepStar_trans hcopy ?_ + have hadd : k1 + 2 * (b - 1) + 2 = k1 + 2 * b := by omega + rw [← hadd] + exact r0_end (k1 + 2 * (b - 1)) (evalRle r4) + | none => + dsimp -failIfUnchanged only + cases hp4 : popPrefixCount [.U, .M] [.P] r2 with + | none => intro h; nomatch h + | some p4 => + rcases p4 with ⟨mVal, r3⟩ + dsimp -failIfUnchanged only + rcases popPrefixCount_sound [.U, .M] [.P] r2 r3 mVal hp4 with ⟨hm, hr2⟩ + rw [hr2, wordL_P_pow] + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc] + cases hz : popTok .Z r3 with + | some r4 => + intro h; injection h with h'; subst h' + refine stepCarryValid_of_stepStar + ⟨_, carry_MU_to_pmuCfg (((tokL .P) ^ mVal) +> evalRle r3) (evalRStack rStack (evalWK k1))⟩ ?_ + refine stepCarryValid_of_stepStar + (pmu_loop mVal (evalRle r3) (tokR .P +> evalRStack rStack (evalWK k1))) ?_ + rw [popTok_sound .Z r3 r4 hz] + have hm1 : mVal = 1 + (mVal - 1) := by omega + rw [hm1, list_pow_add, pow_succ_list, pow_zero_list, List.append_nil, listblank_append_assoc] + refine stepCarryValid_of_stepStar + ⟨_, pmuCfg_Z_turn (evalRle r4) (((tokR .Z) ^ (mVal - 1)) +> (tokR .P +> evalRStack rStack (evalWK k1)))⟩ ?_ + refine stepCarryValid_of_stepStar + (r0_Z_loop (mVal - 1) (tokL .M +> (tokL .W +> (tokL .T +> evalRle r4))) (tokR .P +> evalRStack rStack (evalWK k1))) ?_ + refine stepCarryValid_of_stepStar + ⟨_, r0_P (((tokL .Z) ^ (mVal - 1)) +> (tokL .M +> (tokL .W +> (tokL .T +> evalRle r4)))) (evalRStack rStack (evalWK k1))⟩ ?_ + have hr5 : tokL .P +> (((tokL .Z) ^ (mVal - 1)) +> (tokL .M +> (tokL .W +> (tokL .T +> evalRle r4)))) = + evalRle (pushRle [.P] 1 (pushRle [.Z] (mVal - 1) (pushToksLtr [.T, .W, .M] r4))) := by + simp [pushToksLtr, evalRle_pushRle, wordL_cons, wordL_nil, pow_succ_list, pow_zero_list] + rw [← hm1, hr5] + exact finishTurn_sound _ .R0 rStack k1 hne + | none => + dsimp -failIfUnchanged only + cases hmt : popToks [.M, .T] r3 with + | none => + intro h; injection h with h'; subst h'; exfalso; exact hne rfl + | some r4 => + intro h; injection h with h'; subst h' + refine stepCarryValid_of_stepStar + ⟨_, carry_MU_to_pmuCfg (((tokL .P) ^ mVal) +> evalRle r3) (evalRStack rStack (evalWK k1))⟩ ?_ + refine stepCarryValid_of_stepStar + (pmu_loop mVal (evalRle r3) (tokR .P +> evalRStack rStack (evalWK k1))) ?_ + rw [popToks_sound [.M, .T] r3 r4 hmt] + simp only [wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc] + exact ⟨_, ⟨_, pmuCfg_TM_halt (evalRle r4) (((tokR .Z) ^ mVal) +> (tokR .P +> evalRStack rStack (evalWK k1)))⟩, rfl⟩ + +def stepCarry (rle : Rle) (k1 : Nat) : StepCarryRes := + let (r2, rStack) := popCarryLoop 80 rle [] + if !hasSpecial rStack then + match stepSpecialLoops r2 rStack k1 with + | some res => res + | none => stepTurnaround r2 rStack k1 + else + stepTurnaround r2 rStack k1 + +theorem stepCarry_sound (rle : Rle) (k1 : Nat) (hne : stepCarry rle k1 ≠ .err) : + StepCarryValid (carryCfg (evalRle rle) (evalWK k1)) (stepCarry rle k1) := by + have hp := popCarryLoop_sound 80 rle [] (evalWK k1) + simp only [evalRStack_nil] at hp + refine stepCarryValid_of_stepStar hp ?_ + unfold stepCarry at hne ⊢ + dsimp -failIfUnchanged only at hne ⊢ + generalize hpop : popCarryLoop 80 rle [] = p at hne ⊢ + rcases p with ⟨r2, rStack⟩ + dsimp -failIfUnchanged only at hne ⊢ + split + · rename_i hns + rw [if_pos hns] at hne + cases hsl : stepSpecialLoops r2 rStack k1 with + | some res => + rw [hsl] at hne + exact stepSpecialLoops_sound r2 rStack k1 res hsl hne + | none => + rw [hsl] at hne + exact stepTurnaround_sound r2 rStack k1 hne + · rename_i hns + rw [if_neg hns] at hne + exact stepTurnaround_sound r2 rStack k1 hne + +def runCarry : Nat → Rle → Nat → Bool + | 0, _, _ => false + | n + 1, rle, k1 => + match stepCarry rle k1 with + | .halt => true + | .next rle' k1' => runCarry n rle' k1' + | .err => false + +theorem runCarry_sound : ∀ (n : Nat) (rle : Rle) (k1 : Nat), + runCarry n rle k1 = true → + ∃ cfg', ((carryCfg (evalRle rle) (evalWK k1)) [target_tm]⊢* cfg') ∧ + (step target_tm cfg').isNone + | 0, _, _, h => by nomatch h + | n + 1, rle, k1, h => by + unfold runCarry at h + cases hs : stepCarry rle k1 with + | halt => + have hv := stepCarry_sound rle k1 (by rw [hs]; nofun) + rwa [hs] at hv + | next rle' k1' => + rw [hs] at h + have hv := stepCarry_sound rle k1 (by rw [hs]; nofun) + rw [hs] at hv + rcases runCarry_sound n rle' k1' h with ⟨cfg', h2, hnone⟩ + exact ⟨cfg', stepStar_trans hv h2, hnone⟩ + | err => + rw [hs] at h; nomatch h + +def initRle : Rle := pushToksLtr [.U, .M] [] + +theorem init_to_initRle : + (init []) [target_tm]⊢* (carryCfg (evalRle initRle) (evalWK 1)) := by + have h : evalRle initRle = tokL .M +> (tokL .U +> default) := rfl + rw [h] + exact ⟨307, init_to_carry0⟩ + + +end Solution + +open Solution + +-- ============================================================================ +-- Section 7: Final Halting Theorem (`holdout_0791_halt`) +-- ============================================================================ + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +theorem runCarry_2605 : runCarry 2605 initRle 1 = true := rfl + + + +public section + +open Solution in +theorem is_halt : IsHalt target := by + rcases runCarry_sound 2605 initRle 1 runCarry_2605 with ⟨cfg', hstep, hnone⟩ + exact ⟨cfg', stepStar_trans init_to_initRle hstep, hnone⟩ + +end + +end BusyBeaver.M_1RB0LB_0LC0RE_1LA1LD_0LB1LF_1RA1RD_0LBHHH diff --git a/BusyBeaver/BB6/Halt/M_1RB0LB_0LC0RE_1LA1LD_0LB1RF_1RA1RD_HHH1LC.lean b/BusyBeaver/BB6/Halt/M_1RB0LB_0LC0RE_1LA1LD_0LB1RF_1RA1RD_HHH1LC.lean new file mode 100644 index 00000000..fe1eca8c --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB0LB_0LC0RE_1LA1LD_0LB1RF_1RA1RD_HHH1LC.lean @@ -0,0 +1,107 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.RleCarryData + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.M_1RB0LB_0LC0RE_1LA1LD_0LB1RF_1RA1RD_HHH1LC + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LB_0LC0RE_1LA1LD_0LB1RF_1RA1RD_HHH1LC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +namespace Solution + +open Counter BusyBeaver.RleCarryEngine + +def bc0 : CCfg (Fin 2) (Fin 6) := ⟨A, 0, [], []⟩ +def bc1 : CCfg (Fin 2) (Fin 6) := + ⟨A, 0, + [1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, + 0, 1, 1, 0, 1, 1, 0, 1], + [0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1]⟩ +def bc2 : CCfg (Fin 2) (Fin 6) := + ⟨A, 0, + [1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, + 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, + 1, 0, 1], + [1, 0, 0, 1, 1]⟩ +def bc3 : CCfg (Fin 2) (Fin 6) := + ⟨A, 1, + [1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, + 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1], + [0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, + 0, 0, 1, 1]⟩ +def bc4 : CCfg (Fin 2) (Fin 6) := + ⟨A, 0, + [1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, + 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, + 1, 0, 0, 0, 0, 1, 1, 0, 1], + [0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1]⟩ +def bc5 : CCfg (Fin 2) (Fin 6) := + ⟨A, 0, + [1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, + 0, 1], + [1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, + 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, + 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1]⟩ +def bc6 : CCfg (Fin 2) (Fin 6) := + ⟨B, 1, + [0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, + 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, + 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, + 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1], + [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1]⟩ + +-- Each `bmultiStep_sound` chunk reduces 1,500 (or 928) TM steps via `rfl`. +set_option maxRecDepth 2000000 in +theorem step_bc1 : (evalBCfg bc0) [tm521]⊢* (evalBCfg bc1) := + ⟨1500, Counter.bmultiStep_sound (tm := tm521) 1500 bc0 bc1 rfl⟩ +set_option maxRecDepth 2000000 in +theorem step_bc2 : (evalBCfg bc1) [tm521]⊢* (evalBCfg bc2) := + ⟨1500, Counter.bmultiStep_sound (tm := tm521) 1500 bc1 bc2 rfl⟩ +set_option maxRecDepth 2000000 in +theorem step_bc3 : (evalBCfg bc2) [tm521]⊢* (evalBCfg bc3) := + ⟨1500, Counter.bmultiStep_sound (tm := tm521) 1500 bc2 bc3 rfl⟩ +set_option maxRecDepth 2000000 in +theorem step_bc4 : (evalBCfg bc3) [tm521]⊢* (evalBCfg bc4) := + ⟨1500, Counter.bmultiStep_sound (tm := tm521) 1500 bc3 bc4 rfl⟩ +set_option maxRecDepth 2000000 in +theorem step_bc5 : (evalBCfg bc4) [tm521]⊢* (evalBCfg bc5) := + ⟨1500, Counter.bmultiStep_sound (tm := tm521) 1500 bc4 bc5 rfl⟩ +set_option maxRecDepth 2000000 in +theorem step_bc6 : (evalBCfg bc5) [tm521]⊢* (evalBCfg bc6) := + ⟨928, Counter.bmultiStep_sound (tm := tm521) 928 bc5 bc6 rfl⟩ + +set_option maxRecDepth 2000000 in +theorem init_to_ckpt0 : + (init []) [tm521]⊢* (carryCfg tm521 (evalRleAux default ckptRle_0) (evalWK 1)) := by + have h1 : evalRleAux default ckptRle_0 = bc6.l +> default := rfl + rw [h1] + exact stepStar_trans step_bc1 (stepStar_trans step_bc2 (stepStar_trans step_bc3 + (stepStar_trans step_bc4 (stepStar_trans step_bc5 step_bc6)))) + +end Solution + +public section + +open Solution BusyBeaver.RleCarryEngine in +theorem is_halt : IsHalt target := by + rcases runCarryTruncChunks_sound (target_tm := tm521) + [3746, 3999, 4000, 4000, 4000, 4000, 4000, 3298] 30 ckptRle_0 1 default + runCarryTruncChunks_ckpt0 with ⟨cfg', hstep, hnone⟩ + exact ⟨cfg', stepStar_trans init_to_ckpt0 hstep, hnone⟩ + +end + +end BusyBeaver.M_1RB0LB_0LC0RE_1LA1LD_0LB1RF_1RA1RD_HHH1LC diff --git a/BusyBeaver/BB6/Halt/M_1RB0LC_1LC0RE_1RF1LD_1LA0LB_1RD1RA_1LBHHH.lean b/BusyBeaver/BB6/Halt/M_1RB0LC_1LC0RE_1RF1LD_1LA0LB_1RD1RA_1LBHHH.lean new file mode 100644 index 00000000..a67e7737 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB0LC_1LC0RE_1RF1LD_1LA0LB_1RD1RA_1LBHHH.lean @@ -0,0 +1,618 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.HaltShared + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.M_1RB0LC_1LC0RE_1RF1LD_1LA0LB_1RD1RA_1LBHHH + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LC_1LC0RE_1RF1LD_1LA0LB_1RD1RA_1LBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +@[simp] theorem isVarA_tm : BusyBeaver.SymRunEngine.isVarA target_tm = true := rfl + +namespace Solution + +open BusyBeaver.RleStackEngine BusyBeaver.SymRunEngine + +def A : Fin 6 := 4 +def B : Fin 6 := 3 +def C : Fin 6 := 0 +def D : Fin 6 := 2 +def E : Fin 6 := 5 + +@[simp] theorem init_nil : + (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = ⟨some C, ⟨0, default, default⟩⟩ := rfl + +macro "finish" : tactic => `(tactic| ( + refine ⟨0, ?_⟩ + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, pow_succ_list, pow_zero_list, + cons_append_list, nil_append_list, listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, zero_cons_default, default_head, + default_tail, enc1_nil, encM_nil, encM_cons_zero, encM_cons_run, + encLeft_cons_head, cons_one_encLeft_tail, encRight_cons_head, cons_one_encRight_tail, + encM_cons_run_head, cons_one_encM_cons_run_tail, multiStep_zero] + try rfl)) + +macro "step" : tactic => `(tactic| ( + try refine stepPlus_stepStar ?_ + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, pow_succ_list, pow_zero_list, + cons_append_list, nil_append_list, listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, default_head, default_tail, + encM_nil, encM_cons_zero, encM_cons_run, encLeft_cons_head, cons_one_encLeft_tail, + encRight_cons_head, cons_one_encRight_tail, encM_cons_run_head, cons_one_encM_cons_run_tail] + apply step_stepStar_stepPlus (by rfl) + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, pow_succ_list, + pow_zero_list, cons_append_list, nil_append_list, listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, + default_head, default_tail, encM_nil, encM_cons_zero, encM_cons_run, encLeft_cons_head, + cons_one_encLeft_tail, encRight_cons_head, cons_one_encRight_tail, encM_cons_run_head, + cons_one_encM_cons_run_tail])) + +macro "execute" n:num : tactic => `(tactic| ( + iterate $n step + finish)) + +theorem step_BB_nil (R : List MItem) : + (cfgBB target_tm [] R) [target_tm]⊢⁺ cfgCB target_tm [] (bumpM R) := by + unfold cfgBB cfgCB; dsimp only [isVarA_tm, ite_true, ite_false] + rw [← encM_bumpM] + execute 1 + +theorem step_BB_zero (L1 R : List MItem) : + (cfgBB target_tm (.zero :: L1) R) [target_tm]⊢⁺ cfgCB target_tm L1 (bumpM R) := by + unfold cfgBB cfgCB; dsimp only [isVarA_tm, ite_true, ite_false] + rw [← encM_bumpM] + execute 1 + +theorem step_BB_run0 (L1 R : List MItem) : + (cfgBB target_tm (.run 0 :: L1) R) [target_tm]⊢⁺ cfgBB target_tm L1 (.run 0 :: R) := by + unfold cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + execute 8 + +theorem step_BB_run1 (L1 R : List MItem) : + (cfgBB target_tm (.run 1 :: L1) R) [target_tm]⊢⁺ cfgBB target_tm L1 (.run 0 :: bumpM R) := by + unfold cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + simp only [encM_cons_run] + rw [← encM_bumpM] + execute 3 + +theorem step_BB_run2 (L1 R : List MItem) : + (cfgBB target_tm (.run 2 :: L1) R) [target_tm]⊢⁺ cfgDL target_tm L1 (.run 0 :: .run 0 :: bumpM + R) := by + unfold cfgBB cfgDL; dsimp only [isVarA_tm, ite_true, ite_false] + simp only [encM_cons_run] + rw [← encM_bumpM] + execute 5 + +theorem step_BB_run3 (L1 R : List MItem) : + (cfgBB target_tm (.run 3 :: L1) R) [target_tm]⊢⁺ cfgBB target_tm (.run 0 :: .zero :: .zero :: + L1) (bumpM R) := by + unfold cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + simp only [encM_cons_run, encM_cons_zero] + rw [← encM_bumpM] + execute 9 + +theorem step_BB_run_ge4 (d : ℕ) (L1 R : List MItem) : + (cfgBB target_tm (.run (d + 4) :: L1) R) [target_tm]⊢⁺ cfgBB target_tm (.run 0 :: .zero :: + .run d :: L1) (bumpM R) := by + unfold cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + simp only [encM_cons_run, encM_cons_zero] + rw [← encM_bumpM] + execute 9 + +theorem cyc_R_A (k : ℕ) (V s : ListBlank (Fin 2)) : + (⟨some A, ⟨0, (0 : Fin 2) >> V, (([1] : List (Fin 2)) ^ k) +> s⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢* + ⟨some A, ⟨0, (0 : Fin 2) >> ((([0] : List (Fin 2)) ^ k) +> V), s⟩⟩ := by + induction k generalizing V with + | zero => finish + | succ k ih => + have h1 : + (⟨some A, ⟨0, (0 : Fin 2) >> V, (([1] : List (Fin 2)) ^ (k + 1)) +> s⟩⟩ : Cfg (Fin 2) (Fin + 6)) + [target_tm]⊢⁺ + ⟨some A, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> V, (([1] : List (Fin 2)) ^ k) +> s⟩⟩ := by + execute 3 + have h2 := ih ((0 : Fin 2) >> V) + have h12 := stepPlus_stepStar (stepPlus_stepStar_stepPlus h1 h2) + have h_eq : + (([0] : List (Fin 2)) ^ k) +> ((0 : Fin 2) >> V) = + (([0] : List (Fin 2)) ^ (k + 1)) +> V := by + rw [zeros_append_cons_zero k V] + simp only [pow_succ_list, cons_append_list, nil_append_list, listblank_append_cons] + rwa [h_eq] at h12 + +theorem exit_R_A (W R1 : List MItem) : + (⟨some A, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> encM W, (0 : Fin 2) >> encM R1⟩⟩ : + Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + cfgCB target_tm (.run 0 :: .run 0 :: W) R1 := by + unfold cfgCB; dsimp only [isVarA_tm, ite_true, ite_false] + execute 13 + + +theorem step_DL_run0 (L1 R : List MItem) : + (cfgDL target_tm (.run 0 :: L1) R) [target_tm]⊢⁺ cfgBB target_tm L1 (bumpM R) := by + unfold cfgDL cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + rw [← encM_bumpM] + execute 1 + +theorem step_DL_run1 (L1 R : List MItem) : + (cfgDL target_tm (.run 1 :: L1) R) [target_tm]⊢⁺ cfgDL target_tm L1 (.run 0 :: bumpM R) := by + unfold cfgDL; dsimp only [isVarA_tm, ite_true, ite_false] + simp only [encM_cons_run] + rw [← encM_bumpM] + execute 3 + +theorem step_DL_run2 (d0 : ℕ) (L1 R1 : List MItem) : + (cfgDL target_tm (.run 2 :: L1) (.run d0 :: R1)) [target_tm]⊢⁺ + cfgCB target_tm (.run 0 :: .run 0 :: List.replicate (d0 + 1) .zero ++ L1) R1 := by + unfold cfgDL; dsimp only [isVarA_tm, ite_true, ite_false] + have h1 : + ((encM (.run 2 :: L1)) <{{D}} (encM (.run d0 :: R1))) + [target_tm]⊢⁺ + ⟨some A, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> encM L1, + (([1] : List (Fin 2)) ^ (d0 + 1)) +> ((0 : Fin 2) >> encM R1)⟩⟩ := by + execute 6 + have h2 := cyc_R_A (d0 + 1) ((0 : Fin 2) >> (0 : Fin 2) >> encM L1) ((0 : Fin 2) >> encM R1) + have h12 := stepPlus_stepStar_stepPlus h1 h2 + have h_z1 := zeros_append_cons_zero (d0 + 1) ((0 : Fin 2) >> encM L1) + have h_z2 := zeros_append_cons_zero (d0 + 1) (encM L1) + rw [h_z1, h_z2, encM_replicate_zero] at h12 + exact stepPlus_trans h12 (exit_R_A (List.replicate (d0 + 1) .zero ++ L1) R1) + +theorem step_CB_nil (L : List MItem) : + (cfgCB target_tm L []) [target_tm]⊢⁺ cfgDL target_tm (bumpM L) [.run 0] := by + unfold cfgCB cfgDL; dsimp only [isVarA_tm, ite_true, ite_false] + rw [← encM_bumpM] + execute 2 + +theorem step_CB_zero (L R1 : List MItem) : + (cfgCB target_tm L (.zero :: R1)) [target_tm]⊢⁺ cfgDL target_tm (bumpM L) (bumpM R1) := by + unfold cfgCB cfgDL; dsimp only [isVarA_tm, ite_true, ite_false] + rw [← encM_bumpM L, ← encM_bumpM R1] + execute 2 + +theorem step_CB_run0_nil (L : List MItem) : + (cfgCB target_tm L [.run 0]) [target_tm]⊢⁺ cfgBB target_tm (.run 0 :: bumpM L) [] := by + unfold cfgCB cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + simp only [encM_cons_run] + rw [← encM_bumpM] + execute 3 + +theorem step_CB_run0_zero (L R2 : List MItem) : + (cfgCB target_tm L (.run 0 :: .zero :: R2)) [target_tm]⊢⁺ cfgBB target_tm (.run 0 :: bumpM L) + R2 := by + unfold cfgCB cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + simp only [encM_cons_run] + rw [← encM_bumpM] + execute 3 + +theorem step_CB_run0_run0 (L R2 : List MItem) : + (cfgCB target_tm L (.run 0 :: .run 0 :: R2)) [target_tm]⊢⁺ cfgBB target_tm (.run 0 :: .zero :: + bumpM L) R2 := by + unfold cfgCB cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + simp only [encM_cons_run, encM_cons_zero] + rw [← encM_bumpM] + execute 6 + +theorem step_CB_run0_run_pos (d2 : ℕ) (L R2 : List MItem) : + (cfgCB target_tm L (.run 0 :: .run (d2 + 1) :: R2)) [target_tm]⊢⁺ + cfgCB target_tm (.run 0 :: .run 0 :: List.replicate d2 .zero ++ bumpM L) R2 := by + unfold cfgCB; dsimp only [isVarA_tm, ite_true, ite_false] + have h1 : + (⟨some C, ⟨0, encM L, encM (.run 0 :: .run (d2 + 1) :: R2)⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ⟨some A, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> encM (bumpM L), + (([1] : List (Fin 2)) ^ (d2 + 1)) +> ((0 : Fin 2) >> encM R2)⟩⟩ := by + rw [← encM_bumpM L] + execute 5 + have h2 := cyc_R_A (d2 + 1) ((0 : Fin 2) >> encM (bumpM L)) ((0 : Fin 2) >> encM R2) + have h12 := stepPlus_stepStar_stepPlus h1 h2 + have h_z1 := zeros_append_cons_zero (d2 + 1) (encM (bumpM L)) + have h_z2 : + ((([0] : List (Fin 2)) ^ (d2 + 1)) +> encM (bumpM L)) = + (0 : Fin 2) >> ((([0] : List (Fin 2)) ^ d2) +> encM (bumpM L)) := by + simp only [pow_succ_list, cons_append_list, nil_append_list, listblank_append_cons] + rw [h_z1, h_z2, encM_replicate_zero] at h12 + exact stepPlus_trans h12 (exit_R_A (List.replicate d2 .zero ++ bumpM L) R2) + +theorem step_CB_run1 (L R1 : List MItem) : + (cfgCB target_tm L (.run 1 :: R1)) [target_tm]⊢⁺ cfgCB target_tm (.run 0 :: bumpM L) R1 := by + unfold cfgCB; dsimp only [isVarA_tm, ite_true, ite_false] + simp only [encM_cons_run] + rw [← encM_bumpM] + execute 3 + +theorem step_CB_run2 (L R1 : List MItem) : + (cfgCB target_tm L (.run 2 :: R1)) [target_tm]⊢⁺ cfgBB target_tm (bumpM L) (.run 0 :: .zero :: + R1) := by + unfold cfgCB cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + rw [← encM_bumpM] + execute 5 + +theorem step_CB_run_ge3 (d : ℕ) (L R1 : List MItem) : + (cfgCB target_tm L (.run (d + 3) :: R1)) [target_tm]⊢⁺ cfgBB target_tm (bumpM L) (.run 0 :: + .run d :: R1) := by + unfold cfgCB cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + rw [← encM_bumpM] + execute 5 + + +theorem init_to_CB : (init []) [target_tm]⊢⁺ cfgCB target_tm [] [.run 1, .run 0] := by + rw [init_nil] + unfold cfgCB; dsimp only [isVarA_tm, ite_true, ite_false] + execute 18 + +theorem step_DL_zero_halt (L1 R1 : List MItem) : + (cfgDL target_tm (.zero :: L1) (.run 0 :: R1)) [target_tm]⊢⁺ + ⟨some E, ⟨1, (1 : Fin 2) >> encM L1, (0 : Fin 2) >> encM R1⟩⟩ := by + unfold cfgDL; dsimp only [isVarA_tm, ite_true, ite_false] + execute 1 + + +instance : HasSymRunRules target_tm where + step_BB_nil := step_BB_nil + step_BB_zero := step_BB_zero + step_BB_run0 := step_BB_run0 + step_BB_run1 := step_BB_run1 + step_BB_run2 := step_BB_run2 + step_BB_run3 := step_BB_run3 + step_BB_run_ge4 := step_BB_run_ge4 + step_DL_run0 := step_DL_run0 + step_DL_run1 := step_DL_run1 + step_DL_run2 := step_DL_run2 + step_CB_nil := step_CB_nil + step_CB_zero := step_CB_zero + step_CB_run0_nil := step_CB_run0_nil + step_CB_run0_zero := step_CB_run0_zero + step_CB_run0_run0 := step_CB_run0_run0 + step_CB_run0_run_pos := step_CB_run0_run_pos + step_CB_run1 := step_CB_run1 + step_CB_run2 := step_CB_run2 + step_CB_run_ge3 := step_CB_run_ge3 + +def initSymCyc3 : SymMode × List SymTok × List SymTok := + (.CB, [.item (.run 0), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), .item + (.run 1), .item (.run 1), .item (.run 1), .item (.run 0), .item .zero, .item (.run 1), + .repB1 46, .item (.run 0)], [.item (.run 79), .item (.run 0), .item (.run 1), .item .zero, + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1)]) + +def symChk4096 : SymMode × List SymTok × List SymTok := + (.CB, [.item (.run 0), .item (.run 0), .item .zero, .item (.run 1), .item (.run 1), .item (.run + 0), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 2), .rep12 + 69932, .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item .zero, .item + (.run 1), .repB1 349284, .item (.run 0)], [.item (.run 0), .item (.run 1), .item (.run 1), + .item (.run 0), .item (.run 1), .item (.run 2), .item (.run 1), .item (.run 1), .item (.run + 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 1), .item (.run 1)]) + +def symChk8192 : SymMode × List SymTok × List SymTok := + (.CB, [.item (.run 1), .rep12 293731192, .item (.run 2), .repB1 1468655224, .item (.run 0)], + [.item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item (.run 6), .item (.run + 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1), .item + (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), + .item (.run 0), .item (.run 2), .item (.run 3), .item (.run 0), .item (.run 1), .item .zero + , .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1)]) + +def symChk12288 : SymMode × List SymTok × List SymTok := + (.CB, [], [.item (.run 1), .repB1 7401584263016, .item (.run 1), .item (.run 1), .item (.run 0) + , .item (.run 1), .rep2 1, .item (.run 0), .item (.run 1), .item .zero, .item (.run + 7401584264101), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run + 2), .item (.run 3), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run + 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item .zero, .item (.run + 0), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item + (.run 1), .item (.run 1), .item (.run 1), .item (.run 2), .item (.run 3), .item (.run 1)]) + +def symChk16384 : SymMode × List SymTok × List SymTok := + (.DL, [.item (.run 0), .item (.run 1), .rep2 5828399623694162, .item (.run 1), .item (.run 0), + .item .zero, .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0) + , .item (.run 1), .item (.run 2), .repB1 11656799247386921, .item (.run 0)], [.item (.run 0) + , .item (.run 11656799247388309), .item (.run 0), .item (.run 1), .item (.run 1), .item + (.run 0), .item (.run 2), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), + .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 2), .item (.run + 1), .item (.run 1), .item (.run 1), .item (.run 3), .item (.run 3), .item (.run 1), .item + (.run 1), .item (.run 1), .item (.run 5), .item (.run 3), .item (.run 1), .item (.run 1)]) + +def symChk20480 : SymMode × List SymTok × List SymTok := + (.DL, [.item (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 0), .item (.run 1), .rep12 9179181364734787724, .item (.run 1), .item (.run 0), .item + (.run 1), .item (.run 0), .item .zero, .item (.run 1), .repB1 45895906823673936877, .item + (.run 0)], [.item (.run 0), .item (.run 0), .item (.run 1), .item (.run 2), .item (.run 0), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 2), .item (.run 1), .item (.run + 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 0), .item (.run 1), .item .zero, .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 1), .item (.run 1), .item (.run 1)]) + +def symChk24576 : SymMode × List SymTok × List SymTok := + (.DL, [.repB1 192751300452273201788429, .item (.run 0)], [.item (.run 0), .item (.run 0), .item + (.run 1), .item (.run 1), .rep12 38550260090454640358104, .item (.run 0), .item (.run 2), + .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run + 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), .item + (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), + .item (.run 1), .item (.run 0), .item (.run 1), .item .zero, .item (.run 0), .item (.run 1) + , .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), + .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 1), .item .zero + , .item (.run 3), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .item + (.run 0), .item (.run 1), .item .zero, .item (.run 1)]) + +def symChk28672 : SymMode × List SymTok × List SymTok := + (.CB, [.item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .item + (.run 1), .item (.run 0), .item (.run 1), .rep12 161901426063024309850221340, .item (.run 2) + , .repB1 809507130315121549251104250, .item (.run 0)], [.item (.run 1), .item (.run 0), + .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 2), .item (.run + 5), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 1), .item (.run 1)]) + +def symChk32768 : SymMode × List SymTok × List SymTok := + (.CB, [.item (.run 0), .item (.run 0), .item .zero, .item (.run 1), .repB1 + 3399726966787864888523559563277, .item (.run 0)], [.item (.run 0), .item (.run 1), .item + (.run 1), .rep12 679945393357572977704711913207, .item (.run 0), .item (.run 1), .item (.run + 0), .item (.run 1), .item (.run 2), .item (.run 1), .item (.run 4), .item (.run 1), .item + (.run 1), .item (.run 1), .item (.run 2), .item (.run 3), .item (.run 0), .item (.run 1), + .item (.run 2), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run + 1), .item (.run 1), .item (.run 1), .item (.run 1)]) + +def symChk36864 : SymMode × List SymTok × List SymTok := + (.CB, [.item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item + (.run 1), .item (.run 2), .repB1 8566800475893506045311193103085396, .item (.run 0)], [.item + (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .rep2 + 4283400237946753022655596551544268, .item (.run 0), .item (.run 1), .item .zero, .item (.run + 8566800475893506045311193103088524), .item (.run 1), .item (.run 2), .item (.run 0), .item + (.run 1), .item (.run 1), .item (.run 1), .item (.run 2), .item (.run 3), .item (.run 1), + .item (.run 1)]) + +def symChk40960 : SymMode × List SymTok × List SymTok := + (.CB, [.item (.run 1), .repB1 59964023182123780301115281865963814445, .item (.run 0)], [.item + (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), + .rep12 11992804636424756060223056373192763585, .item (.run 0), .item (.run 1), .item (.run + 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 2), .item (.run 2), .item + (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1), + .item (.run 2), .item (.run 3), .item (.run 1), .item (.run 7), .item (.run 1), .item (.run + 1), .item (.run 1), .item (.run 1)]) + +def symChk45056 : SymMode × List SymTok × List SymTok := + (.CB, [.item (.run 0), .item (.run 0), .item .zero, .item (.run 1), .rep12 + 28331309434081290173749125880312046958998, .item (.run 1), .item (.run 0), .item (.run 1), + .item (.run 0), .item .zero, .item (.run 1), .repB1 + 141656547170406450868745629401560234791159, .item (.run 0)], [.item (.run 1), .item (.run 0) + , .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .item + (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), + .item (.run 0), .item (.run 1), .item (.run 2), .item (.run 3), .item (.run 0), .item (.run + 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1), .item + (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 0), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item .zero + , .item (.run 7), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1)]) + +def symChk49152 : SymMode × List SymTok × List SymTok := + (.BB, [.item (.run 0), .item (.run 1), .rep2 1, .item (.run 0), .item (.run 1), .item (.run 1), + .item (.run 1), .repB1 535429780494748407225024473657428158523986309, .item (.run 0)], + [.item (.run 0), .item (.run 1), .item (.run 2), .item (.run + 535429780494748407225024473657428158523990526), .item (.run 1), .item (.run 1), .item (.run + 0), .item (.run 1), .item .zero, .item (.run 1), .item (.run 0), .item (.run 1), .item (.run + 1), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item + .zero, .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run + 1), .item (.run 1), .item (.run 1)]) + +def symChk53248 : SymMode × List SymTok × List SymTok := + (.CB, [], [.item (.run 1), .repB1 1873892351078590533629325742230370269117066257558, .item (.run + 0), .item (.run 2), .item (.run 0), .item (.run 1), .item (.run 1), .rep12 + 374778470215718106725865148446074053823413252433, .item (.run 0), .item (.run 1), .item + (.run 0), .item (.run 1), .item .zero, .item (.run 1), .item (.run 6), .item (.run 1), .item + (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), + .item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 2), .item (.run + 1), .item (.run 1), .item (.run 1), .item (.run 5), .item (.run 1), .item (.run 6), .item + (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 2), .item (.run 1), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run + 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1)]) + +def symChk57344 : SymMode × List SymTok × List SymTok := + (.DL, [.item (.run 1), .item (.run 0), .item (.run 1), .rep2 + 996031434861122243531684763682732439419162283857463, .item (.run 1), .item (.run 0), .item + .zero, .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item + .zero, .item (.run 1), .repB1 1992062869722244487063369527365464878838324567709997, .item + (.run 0)], [.item (.run 1992062869722244487063369527365464878838324567714920), .item (.run + 1), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item + (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run + 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 1), .item (.run 1), .item (.run 1), .item (.run 1)]) + +def symChk61440 : SymMode × List SymTok × List SymTok := + (.DL, [.item (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 0), .item (.run 1), .rep12 661776688146251534887371767366373046443244305364132822, + .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item .zero, .item (.run 1) + , .repB1 3308883440731257674436858836831865232216221526820658827, .item (.run 0)], [.item + (.run 4), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), + .item .zero, .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0) + , .item (.run 1), .item (.run 2), .item (.run 1), .item (.run 2), .item (.run 1), .item + (.run 1), .item (.run 0), .item (.run 2), .item (.run 1), .item (.run 1), .item (.run 1), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run + 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1)]) + +def symChk65536 : SymMode × List SymTok × List SymTok := + (.DL, [.rep12 659540004931999983852102031802319817808504446014405329671, .item (.run 1), .item + (.run 0), .item (.run 1), .item (.run 0), .item .zero, .item (.run 1), .repB1 + 3297700024659999919260510159011599089042522230072026642750, .item (.run 0)], [.item (.run 0) + , .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item + (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), + .item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item (.run + 1), .item (.run 2), .item (.run 4), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 1), .item .zero, .item (.run 1), .item (.run 3), .item (.run 1), .item (.run 1), .item + (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run + 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1)]) + +def symChk69632 : SymMode × List SymTok × List SymTok := + (.CB, [.item (.run 0), .item (.run 0), .item .zero, .item (.run 1), .item (.run 1), .item (.run + 0), .item (.run 1), .item (.run 0), .item .zero, .item (.run 1), .repB1 + 2629243525178812812679392664523750958759518709707280000200843, .item (.run 0)], [.item (.run + 1), .item (.run 0), .item (.run 1), .item (.run 1), .rep2 + 1314621762589406406339696332261875479379759354853640000103353, .item (.run 0), .item (.run + 1), .item (.run 2), .item (.run + 2629243525178812812679392664523750958759518709707280000206708), .item (.run 1), .item (.run + 1), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 0), .item + (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 2), .item (.run 3), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run + 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run + 1), .item (.run 1), .item (.run 1), .item (.run 1)]) + +def symChk70511 : SymMode × List SymTok × List SymTok := + (.HALT, [.item .zero, .item .zero, .item (.run 1), .item (.run 1), .item (.run 0), .item (.run + 1), .item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 2), .rep12 + 2077426982857333580388655932463210634081595029892171852015193, .item (.run 2), .repB1 + 10387134914286667901943279662316053170407975149460859260070043, .item (.run 0)], [.item + (.run 0), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), + .item (.run 1), .item .zero, .item (.run 3), .item (.run 1), .item (.run 1), .item (.run 1) + , .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run + 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 1), .item (.run 1), .item (.run 1)]) + + +set_option maxRecDepth 200000 in +theorem test_elem_rfl : + runElemFast 1 1 11 4 (.CB, [], [.run 1, .run 0]) = (initSymCyc3.1, encSymL initSymCyc3.2.1, + encSymR initSymCyc3.2.2) := by decide +kernel + +set_option maxRecDepth 200000 in +theorem sym_chk1 : stepSym4096 initSymCyc3 = symChk4096 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk2 : stepSym4096 symChk4096 = symChk8192 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk3 : stepSym4096 symChk8192 = symChk12288 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk4 : stepSym4096 symChk12288 = symChk16384 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk5 : stepSym4096 symChk16384 = symChk20480 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk6 : stepSym4096 symChk20480 = symChk24576 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk7 : stepSym4096 symChk24576 = symChk28672 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk8 : stepSym4096 symChk28672 = symChk32768 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk9 : stepSym4096 symChk32768 = symChk36864 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk10 : stepSym4096 symChk36864 = symChk40960 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk11 : stepSym4096 symChk40960 = symChk45056 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk12 : stepSym4096 symChk45056 = symChk49152 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk13 : stepSym4096 symChk49152 = symChk53248 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk14 : stepSym4096 symChk53248 = symChk57344 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk15 : stepSym4096 symChk57344 = symChk61440 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk16 : stepSym4096 symChk61440 = symChk65536 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk17 : stepSym4096 symChk65536 = symChk69632 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk18 : iterStep stepSym 15 (iterStep stepSym16 6 (iterStep stepSym256 3 symChk69632)) + = symChk70511 := by decide +kernel + + + +end Solution + +public section + +open Solution BusyBeaver.RleStackEngine BusyBeaver.SymRunEngine in +theorem is_halt : IsHalt target := by + have h0 : (init []) [target_tm]⊢* ((evalM target_tm) (.CB, [], [.run 1, .run 0])) := + stepPlus_stepStar init_to_CB + have h1 : ((evalM target_tm) (.CB, [], [.run 1, .run 0])) [target_tm]⊢* ((evalSym target_tm) + initSymCyc3) := by + have h := runElemFast_sound (target_tm := target_tm) 1 1 11 4 (.CB, [], [.run 1, .run 0]) + rw [test_elem_rfl] at h + exact h + have hc1 : ((evalSym target_tm) initSymCyc3) [target_tm]⊢* ((evalSym target_tm) symChk4096) := + by rw [← sym_chk1]; exact stepSym4096_sound initSymCyc3 + have hc2 : ((evalSym target_tm) symChk4096) [target_tm]⊢* ((evalSym target_tm) symChk8192) := by + rw [← sym_chk2]; exact stepSym4096_sound symChk4096 + have hc3 : ((evalSym target_tm) symChk8192) [target_tm]⊢* ((evalSym target_tm) symChk12288) := + by rw [← sym_chk3]; exact stepSym4096_sound symChk8192 + have hc4 : ((evalSym target_tm) symChk12288) [target_tm]⊢* ((evalSym target_tm) symChk16384) := + by rw [← sym_chk4]; exact stepSym4096_sound symChk12288 + have hc5 : ((evalSym target_tm) symChk16384) [target_tm]⊢* ((evalSym target_tm) symChk20480) := + by rw [← sym_chk5]; exact stepSym4096_sound symChk16384 + have hc6 : ((evalSym target_tm) symChk20480) [target_tm]⊢* ((evalSym target_tm) symChk24576) := + by rw [← sym_chk6]; exact stepSym4096_sound symChk20480 + have hc7 : ((evalSym target_tm) symChk24576) [target_tm]⊢* ((evalSym target_tm) symChk28672) := + by rw [← sym_chk7]; exact stepSym4096_sound symChk24576 + have hc8 : ((evalSym target_tm) symChk28672) [target_tm]⊢* ((evalSym target_tm) symChk32768) := + by rw [← sym_chk8]; exact stepSym4096_sound symChk28672 + have hc9 : ((evalSym target_tm) symChk32768) [target_tm]⊢* ((evalSym target_tm) symChk36864) := + by rw [← sym_chk9]; exact stepSym4096_sound symChk32768 + have hc10 : ((evalSym target_tm) symChk36864) [target_tm]⊢* ((evalSym target_tm) symChk40960) := + by rw [← sym_chk10]; exact stepSym4096_sound symChk36864 + have hc11 : ((evalSym target_tm) symChk40960) [target_tm]⊢* ((evalSym target_tm) symChk45056) := + by rw [← sym_chk11]; exact stepSym4096_sound symChk40960 + have hc12 : ((evalSym target_tm) symChk45056) [target_tm]⊢* ((evalSym target_tm) symChk49152) := + by rw [← sym_chk12]; exact stepSym4096_sound symChk45056 + have hc13 : ((evalSym target_tm) symChk49152) [target_tm]⊢* ((evalSym target_tm) symChk53248) := + by rw [← sym_chk13]; exact stepSym4096_sound symChk49152 + have hc14 : ((evalSym target_tm) symChk53248) [target_tm]⊢* ((evalSym target_tm) symChk57344) := + by rw [← sym_chk14]; exact stepSym4096_sound symChk53248 + have hc15 : ((evalSym target_tm) symChk57344) [target_tm]⊢* ((evalSym target_tm) symChk61440) := + by rw [← sym_chk15]; exact stepSym4096_sound symChk57344 + have hc16 : ((evalSym target_tm) symChk61440) [target_tm]⊢* ((evalSym target_tm) symChk65536) := + by rw [← sym_chk16]; exact stepSym4096_sound symChk61440 + have hc17 : ((evalSym target_tm) symChk65536) [target_tm]⊢* ((evalSym target_tm) symChk69632) := + by rw [← sym_chk17]; exact stepSym4096_sound symChk65536 + have hc18 : ((evalSym target_tm) symChk69632) [target_tm]⊢* ((evalSym target_tm) symChk70511) := + by + rw [← sym_chk18] + exact stepStar_trans (iterStep_sound stepSym256 (evalSym target_tm) + (stepSym256_sound (target_tm := target_tm)) 3 + symChk69632) + (stepStar_trans (iterStep_sound stepSym16 (evalSym target_tm) + (stepSym16_sound (target_tm := target_tm)) 6 _) + (iterStep_sound stepSym (evalSym target_tm) + (stepSym_sound (target_tm := target_tm)) 15 _)) + have h_to_halt_sym : (init []) [target_tm]⊢* ((evalSym target_tm) symChk70511) := + stepStar_trans h0 (stepStar_trans h1 (stepStar_trans hc1 (stepStar_trans hc2 + (stepStar_trans hc3 (stepStar_trans hc4 (stepStar_trans hc5 (stepStar_trans hc6 + (stepStar_trans hc7 (stepStar_trans hc8 (stepStar_trans hc9 (stepStar_trans hc10 + (stepStar_trans hc11 (stepStar_trans hc12 (stepStar_trans hc13 (stepStar_trans hc14 + (stepStar_trans hc15 (stepStar_trans hc16 (stepStar_trans hc17 hc18)))))))))))))))))) + have h_final := step_DL_zero_halt + (encSymL symChk70511.2.1.tail) + (encSymR symChk70511.2.2.tail) + exact ⟨_, stepStar_trans h_to_halt_sym (stepPlus_stepStar h_final), rfl⟩ + +end + +end BusyBeaver.M_1RB0LC_1LC0RE_1RF1LD_1LA0LB_1RD1RA_1LBHHH diff --git a/BusyBeaver/BB6/Halt/M_1RB0LD_1LC0RD_1RE0RA_1LE0RF_1LA1RC_0LBHHH.lean b/BusyBeaver/BB6/Halt/M_1RB0LD_1LC0RD_1RE0RA_1LE0RF_1LA1RC_0LBHHH.lean new file mode 100644 index 00000000..07584786 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB0LD_1LC0RD_1RE0RA_1LE0RF_1LA1RC_0LBHHH.lean @@ -0,0 +1,4937 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.Excursion +public import BusyBeaver.Calculi.Longitudinal + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0LD_1LC0RD_1RE0RA_1LE0RF_1LA1RC_0LBHHH + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LD_1LC0RD_1RE0RA_1LE0RF_1LA1RC_0LBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +@[reducible] def holdout_0491_tm : Machine (Fin 2) (Fin 6) := target_tm +abbrev qc : Machine (Fin 2) (Fin 6) + | 0,0 => some (some 1,Stmt.write 1 Dir.left) + | 0,1 => some (some 3,Stmt.write 0 Dir.right) + | 1,0 => some (some 2,Stmt.write 1 Dir.right) + | 1,1 => some (some 3,Stmt.write 0 Dir.left) + | 2,0 => some (some 4,Stmt.write 1 Dir.left) + | 2,1 => some (some 0,Stmt.write 0 Dir.left) + | 3,0 => some (some 4,Stmt.write 1 Dir.right) + | 3,1 => some (some 5,Stmt.write 0 Dir.left) + | 4,0 => some (some 0,Stmt.write 1 Dir.right) + | 4,1 => some (some 2,Stmt.write 1 Dir.left) + | 5,0 => some (some 1,Stmt.write 0 Dir.right) + | 5,1 => none +set_option maxHeartbeats 2000000 +set_option maxRecDepth 200000 +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0=some config:=rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1=step M config:=rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1)=Option.bind (multiStep M config n) (step M):= by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default=default:= by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head=0:=rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail=default:=rfl +@[simp] theorem append_nil (s : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> s=s:=rfl +@[simp] theorem append_cons (a : Fin 2) (l : List (Fin 2)) (s : ListBlank (Fin 2)) : + (a :: l) +> s=a >> (l +> s):=rfl +@[simp] theorem append_assoc (l1 l2 : List (Fin 2)) (s : ListBlank (Fin 2)) : + (l1 ++ l2) +> s=l1 +> (l2 +> s):= by + induction l1 with + | nil => rfl + | cons a l1 ih => simp [ih] +@[simp] theorem pow_zero_list {α : Type*} (l : List α) : l ^ (0 : ℕ)=[]:=rfl +@[simp] theorem pow_succ_list {α : Type*} (l : List α) (n : ℕ) : l ^ (n + 1)=l ++ l ^ n:=rfl +theorem qb {α : Type*} (l : List α) (m n : ℕ) : l ^ (m + n)=l ^ m ++ l ^ n:= by + induction m with + | zero => simp [Nat.zero_add] + | succ m ih => simp [pow_succ_list,Nat.succ_add,ih,List.append_assoc] +theorem pow_shift {α : Type*} (l : List α) (n : ℕ) : l ^ n ++ l=l ^ (n + 1):= by + induction n with + | zero => simp [pow_succ_list] + | succ n ih => simp [pow_succ_list,List.append_assoc,ih] +@[simp] theorem nil_pow_list {α : Type*} (n : ℕ) : ([] : List α) ^ n=[]:= by + induction n with + | zero => rfl + | succ n ih => exact ih +theorem commute_power {x v w : List (Fin 2)} {a b : ℕ} + (h : x ++ v ^ a=w ^ b ++ x) (k : ℕ) : + x ++ v ^ (k * a)=w ^ (k * b) ++ x:= + BusyBeaver.Excursion.commute_pow_left h k +theorem qD {w : List (Fin 2)} (h : BusyBeaver.Longitudinal.BoundedConfig.all0 w=true) : + w +> default=default:= + BusyBeaver.Longitudinal.BoundedConfig.all0_spec h +theorem qM {w : List (Fin 2)} (h : BusyBeaver.Longitudinal.BoundedConfig.all0 w=true) (n : ℕ) : + (w ^ n) +> default=default:= by + induction n with + | zero => rfl + | succ n ih => + rw [pow_succ_list,append_assoc,ih,qD h] +theorem qA {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢^{1} c₂:= by simp [h] +theorem qm {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢* c₂:=⟨1,qA tm c₁ c₂ h⟩ +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m)=(multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m):= by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,multiStep_succ,ih,Option.bind_assoc] + simp_rw [multiStep_succ] +theorem qu {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c3 : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c3) : + c₁ [tm]⊢^{n+m} c3:= by + rw [multiStep_add,h₁]; simp [h₂] +theorem q0 {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c3) : c₁ [tm]⊢* c3:= by + obtain ⟨n,hn⟩:=h₁; obtain ⟨m,hm⟩:=h₂ + exact ⟨n + m,qu tm c₁ c₂ c3 n m hn hm⟩ +theorem qE {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂:= by obtain ⟨n,_,hn⟩:=h; exact ⟨n,hn⟩ +theorem qn {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c3) : c₁ [tm]⊢⁺ c3:= by + obtain ⟨n,n_pos,hn⟩:=h₁; obtain ⟨m,hm⟩:=h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),qu tm c₁ c₂ c3 n m hn hm⟩ +theorem qt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c3) : c₁ [tm]⊢⁺ c3 := + qn (step_stepPlus tm c₁ c₂ h₁) h₂ +local macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +local macro "step_tm" : tactic => + `(tactic| (try refine qE ?_) <;> + refine qt (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,zero_cons_default,default_head,default_tail]) +local macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm))) +local macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) +local macro "execute90" : tactic => + `(tactic| execute <;> execute) +def q4 {α : Type*} (n : ℕ) (f : ℕ → α) : α := + Nat.casesOn n (f Nat.zero) (fun m => f (Nat.succ m)) +@[simp] theorem strictNat_eq {α : Type*} (n : ℕ) (f : ℕ → α) : q4 n f=f n:= by + cases n <;> rfl +def W : List (Fin 2):=[1,1,1,1,0,1,1,1,1,1] +inductive Digit where + | D0 | D1 | D2 | D3 | D4 | D5 +deriving DecidableEq +def qS {α : Type*} (d : Digit) (f : Digit → α) : α := + match d with + | .D0 => f .D0 + | .D1 => f .D1 + | .D2 => f .D2 + | .D3 => f .D3 + | .D4 => f .D4 + | .D5 => f .D5 +@[simp] theorem strictDigit_eq {α : Type*} (d : Digit) (f : Digit → α) : qS d f=f d:= by + cases d <;> rfl +def Digit.index : Digit → ℕ + | .D0 => 0 | .D1 => 1 | .D2 => 2 | .D3 => 3 | .D4 => 4 | .D5 => 5 +def qo : Digit → List (Fin 2) + | .D0 => [0,1] + | .D1 => [1,1,1,1] + | .D2 => [0,1,1,1,1,1] + | .D3 => [1,1,1,1,1,1,1,1] + | .D4 => [0,1,1,1,1,1,1,1,1,1] + | .D5 => [1,1,1,1,1,1,1,1,1,1,1,1] +def next : Digit → Digit + | .D0 => .D1 | .D1 => .D2 | .D2 => .D3 | .D3 => .D4 | .D4 => .D5 | .D5 => .D0 +def take : Digit → ℕ + | .D1 | .D3 => 1 + | _ => 0 +def give : Digit → ℕ + | .D1 | .D3 | .D5 => 1 + | _ => 0 +def qO : Digit → ℕ + | .D5 => 1 + | _ => 0 +def qd (tm : Machine (Fin 2) (Fin 6)) (q : Fin 6) : ℕ → ListBlank (Fin 2) → ListBlank (Fin 2) → Prop + | 0,r,r' => r=r' + | t + 1,r,r' => + ∃ r1,(∀ l,(([1,0,1] +> l) {{q}}> r) [tm]⊢* (l <{{q}} ([1] +> r1))) ∧ + qd tm q t r1 r' +theorem sideCalls_add {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} {t u : ℕ} {r1 r2 r3 : ListBlank (Fin 2)} + (h₁ : qd tm q t r1 r2) (h₂ : qd tm q u r2 r3) : + qd tm q (t + u) r1 r3:= by + induction t generalizing r1 with + | zero => + rw [Nat.zero_add] + change r1=r2 at h₁ + subst h₁ + exact h₂ + | succ t ih => + rcases h₁ with ⟨rm,hstep,hrest⟩ + rw [Nat.succ_add] + exact ⟨rm,hstep,ih hrest⟩ +theorem qT {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} {t u : ℕ} {r1 r3 : ListBlank (Fin 2)} + (h : qd tm q (t + u) r1 r3) : + ∃ r2,qd tm q t r1 r2 ∧ qd tm q u r2 r3:= by + induction t generalizing r1 with + | zero => + rw [Nat.zero_add] at h + exact ⟨r1,rfl,h⟩ + | succ t ih => + rw [Nat.succ_add] at h + rcases h with ⟨rm,hstep,hrest⟩ + rcases ih hrest with ⟨r2,h₁,h₂⟩ + exact ⟨r2,⟨rm,hstep,h₁⟩,h₂⟩ +def q2 (tm : Machine (Fin 2) (Fin 6)) (q : Fin 6) (t u : ℕ) (w1 w2 : List (Fin 2)) : Prop := + ∀ r1 r2,qd tm q u r1 r2 → qd tm q t (w1 +> r1) (w2 +> r2) +theorem qh (tm : Machine (Fin 2) (Fin 6)) (q : Fin 6) (w : List (Fin 2)) : + q2 tm q 0 0 w w:= by + intro r1 r2 h + change r1=r2 at h + subst h + rfl +theorem segCalls_nil (tm : Machine (Fin 2) (Fin 6)) (q : Fin 6) (t : ℕ) : + q2 tm q t t [] []:= by + intro r1 r2 h + exact h +theorem q5 {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} {t u v : ℕ} + {w1 w2 v1 v2 : List (Fin 2)} + (h₁ : q2 tm q t u w1 w2) (h₂ : q2 tm q u v v1 v2) : + q2 tm q t v (w1 ++ v1) (w2 ++ v2):= by + intro r1 r2 hr + rw [append_assoc,append_assoc] + exact h₁ (v1 +> r1) (v2 +> r2) (h₂ r1 r2 hr) +theorem qB {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} {t1 u1 t2 u2 : ℕ} + {w1 w2 w3 : List (Fin 2)} + (h₁ : q2 tm q t1 u1 w1 w2) (h₂ : q2 tm q t2 u2 w2 w3) : + q2 tm q (t1 + t2) (u1 + u2) w1 w3:= by + intro r1 r3 hr + rcases qT hr with ⟨r2,hr₁,hr₂⟩ + exact sideCalls_add (h₁ r1 r2 hr₁) (h₂ r2 r3 hr₂) +theorem qk {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} {w1 w2 : List (Fin 2)} + (h : ∀ l r,(([1,0,1] +> l) {{q}}> (w1 +> r)) [tm]⊢* (l <{{q}} ([1] +> w2 +> r))) : + q2 tm q 1 0 w1 w2:= by + intro r1 r2 hr + change r1=r2 at hr + subst hr + exact ⟨w2 +> r1,fun l => h l r1,rfl⟩ +theorem qJ {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} {w1 w_mid w2 : List (Fin 2)} + (hR : ∀ l r,(([1,0,1] +> l) {{q}}> (w1 +> r)) [tm]⊢* (([1,0,1] +> w_mid +> l) {{q}}> r)) + (hL : ∀ l r,((w_mid +> l) <{{q}} ([1] +> r)) [tm]⊢* (l <{{q}} ([1] +> w2 +> r))) : + q2 tm q 1 1 w1 w2:= by + intro r1 r2 hr + rcases hr with ⟨r',hcall,rfl⟩ + refine ⟨w2 +> r',fun l => ?_,rfl⟩ + exact q0 (hR l r1) (q0 (hcall (w_mid +> l)) (hL l r')) +theorem wall_n {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (hwall1 : q2 tm q 1 1 W W) (n : ℕ) : + q2 tm q 1 1 (W ^ n) (W ^ n):= by + induction n with + | zero => exact segCalls_nil tm q 1 + | succ n ih => + rw [pow_succ_list] + exact q5 hwall1 ih +theorem walls {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (hwall1 : q2 tm q 1 1 W W) (t n : ℕ) : + q2 tm q t t (W ^ n) (W ^ n):= by + induction t with + | zero => exact qh tm q (W ^ n) + | succ t ih => + have h1:=qB (wall_n hwall1 n) ih + rwa [Nat.add_comm 1 t] at h1 +theorem prefix_rule {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (hwall1 : q2 tm q 1 1 W W) + {t u a b c : ℕ} {p p' : Digit} + (h : q2 tm q t u (qo p ++ W ^ b) (W ^ a ++ qo p' ++ W ^ c)) (k : ℕ) : + q2 tm q t u (W ^ k ++ (qo p ++ W ^ b)) (W ^ (k + a) ++ qo p' ++ W ^ c):= by + have hw:=walls hwall1 t k + have hc:=q5 hw h + simpa only [qb,List.append_assoc] using hc +structure Effect where + phase : Digit + used : ℕ + given : ℕ + sent : ℕ +deriving DecidableEq +def qx : Digit → ℕ → Effect + | p,0 => ⟨p,0,0,0⟩ + | p,t + 1 => + let a:=qx (next p) t + ⟨a.phase,take p + a.used,give p + a.given,qO p + a.sent⟩ +theorem total_spec {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (hwall1 : q2 tm q 1 1 W W) + (hone : ∀ p n,q2 tm q 1 (qO p) (qo p ++ W ^ (take p + n)) (W ^ (give p) ++ qo (next p) ++ W ^ n)) + (t : ℕ) (p : Digit) (n : ℕ) : + let a:=qx p t + q2 tm q t a.sent (qo p ++ W ^ (a.used + n)) (W ^ a.given ++ qo a.phase ++ W ^ n):= by + induction t generalizing p n with + | zero => + dsimp -failIfUnchanged [qx] + simpa only [Nat.zero_add,pow_zero_list,List.nil_append] using qh tm q (qo p ++ W ^ n) + | succ t ih => + dsimp -failIfUnchanged [qx] + have h1:=hone p ((qx (next p) t).used + n) + have h2:=prefix_rule hwall1 (ih (next p) n) (give p) + rw [← List.append_assoc] at h2 + have h3:=qB h1 h2 + rw [Nat.add_comm 1 t,← Nat.add_assoc] at h3 + exact h3 +theorem total_add (p : Digit) (t u : ℕ) : + qx p (t + u) = + let a:=qx p t + let b:=qx a.phase u + ⟨b.phase,a.used + b.used,a.given + b.given,a.sent + b.sent⟩:= by + induction t generalizing p with + | zero => + rw [Nat.zero_add] + dsimp -failIfUnchanged only [qx] + rcases qx p u with ⟨ph,us,gv,sn⟩ + simp only [Nat.zero_add] + | succ t ih => + rw [Nat.succ_add] + dsimp -failIfUnchanged only [qx] + rw [ih (next p)] + dsimp -failIfUnchanged only + congr 1 <;> omega +theorem total_six (p : Digit) : qx p 6=⟨p,2,3,1⟩:= by + cases p <;> rfl +theorem total_period (p : Digit) (k r : ℕ) : + qx p (k * 6 + r) = + let a:=qx p r + ⟨a.phase,k * 2 + a.used,k * 3 + a.given,k + a.sent⟩:= by + induction k with + | zero => + simp only [Nat.zero_mul,Nat.zero_add] + | succ k ih => + have h_eq : (k + 1) * 6 + r=6 + (k * 6 + r):= by omega + rw [h_eq,total_add,total_six] + dsimp -failIfUnchanged only + rw [ih] + dsimp -failIfUnchanged only + congr 1 <;> omega +def qy (p : Digit) (t : ℕ) : Effect := + q4 (t / 6) (fun k => + q4 (t % 6) (fun r => + match qx p r with + | ⟨ph,u,g,s⟩ => + qS ph (fun ph' => + q4 (k * 2 + u) (fun u' => + q4 (k * 3 + g) (fun g' => + q4 (k + s) (fun s' => + ⟨ph',u',g',s'⟩)))))) +theorem totalN_spec (p : Digit) (t : ℕ) : qy p t=qx p t:= by + unfold qy + simp only [strictNat_eq,strictDigit_eq] + have h_div : t=(t / 6) * 6 + t % 6:=(Nat.div_add_mod' t 6).symm + conv_rhs => rw [h_div,total_period] +theorem totalN_rule {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (hwall1 : q2 tm q 1 1 W W) + (hone : ∀ p n,q2 tm q 1 (qO p) (qo p ++ W ^ (take p + n)) (W ^ (give p) ++ qo (next p) ++ W ^ n)) + (p : Digit) (t n : ℕ) (h : (qy p t).used ≤ n) : + let a:=qy p t + q2 tm q t a.sent (qo p ++ W ^ n) (W ^ a.given ++ qo a.phase ++ W ^ (n - a.used)):= by + dsimp -failIfUnchanged only + have h_spec:=total_spec hwall1 hone t p (n - (qy p t).used) + rw [← totalN_spec p t] at h_spec + dsimp -failIfUnchanged only at h_spec + have h_add : (qy p t).used + (n - (qy p t).used)=n:=Nat.add_sub_of_le h + rwa [h_add] at h_spec +abbrev qv:=List (Digit × ℕ) +def q8 : qv → List (Fin 2) + | [] => [] + | (p,n) :: xs => qo p ++ W ^ n ++ q8 xs +def qZ : ℕ → qv → Option (ℕ × qv) + | t,[] => if t == 0 then some (0,[]) else none + | t,(p,n) :: xs => + match qy p t with + | ⟨ph,u,g,s⟩ => + if u ≤ n then + match qZ s xs with + | some (e,ys) => + q4 (n - u + e) (fun m => + some (g,(ph,m) :: ys)) + | none => none + else none +theorem batch_spec {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (hwall1 : q2 tm q 1 1 W W) + (hone : ∀ p n,q2 tm q 1 (qO p) (qo p ++ W ^ (take p + n)) (W ^ (give p) ++ qo (next p) ++ W ^ n)) + (t : ℕ) (xs : qv) (e : ℕ) (ys : qv) (h : qZ t xs=some (e,ys)) : + q2 tm q t 0 (q8 xs) (W ^ e ++ q8 ys):= by + induction xs generalizing t e ys with + | nil => + unfold qZ at h + split_ifs at h with ht + injection h with hpair + injection hpair with he hys + subst he hys + have ht0 : t=0:=beq_iff_eq.mp ht + subst ht0 + exact qh tm q [] + | cons pn xs ih => + rcases pn with ⟨p,n⟩ + unfold qZ at h + dsimp -failIfUnchanged only at h + split_ifs at h with hle + cases hb : qZ (qy p t).sent xs with + | none => rw [hb] at h; contradiction + | some eys => + rcases eys with ⟨e',ys'⟩ + rw [hb] at h + simp only [strictNat_eq] at h + injection h with hpair + injection hpair with he hys + subst he hys + have h1:=totalN_rule hwall1 hone p t n hle + have h2:=ih (qy p t).sent e' ys' hb + have h3:=q5 h1 h2 + simpa only [q8,qb,List.append_assoc] using h3 +theorem calls_spec {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (hemit : ∀ r,(default <{{q}} ([1] +> r)) [tm]⊢* (([1,0,1] +> default) {{q}}> r)) + (t : ℕ) (r r' : ListBlank (Fin 2)) (h : qd tm q t r r') : + (([1,0,1] +> default) {{q}}> r) [tm]⊢* (([1,0,1] +> default) {{q}}> r'):= by + induction t generalizing r with + | zero => + change r=r' at h + subst h + exact ⟨0,rfl⟩ + | succ t ih => + rcases h with ⟨r1,hstep,hrest⟩ + exact q0 (hstep default) (q0 (hemit r1) (ih r1 hrest)) +theorem batch_root {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (hemit : ∀ r,(default <{{q}} ([1] +> r)) [tm]⊢* (([1,0,1] +> default) {{q}}> r)) + (hwall1 : q2 tm q 1 1 W W) + (hone : ∀ p n,q2 tm q 1 (qO p) (qo p ++ W ^ (take p + n)) (W ^ (give p) ++ qo (next p) ++ W ^ n)) + (t : ℕ) (xs : qv) (e : ℕ) (ys : qv) (k : ℕ) (r : ListBlank (Fin 2)) + (h : qZ t xs=some (e,ys)) : + (([1,0,1] +> default) {{q}}> ((W ^ k) +> (q8 xs) +> r)) [tm]⊢* + (([1,0,1] +> default) {{q}}> ((W ^ (k + e)) +> (q8 ys) +> r)):= by + apply calls_spec hemit t + have hw:=walls hwall1 t k + have hb:=batch_spec hwall1 hone t xs e ys h + have hc:=q5 hw hb r r rfl + simpa only [qb,List.append_assoc,append_assoc] using hc +abbrev Runs:=List (List (Fin 2) × ℕ) +def q3 {α : Type*} (r : Runs) (f : Runs → α) : α := + match r with + | [] => f [] + | head :: tail => f (head :: tail) +@[simp] theorem strictRuns_eq {α : Type*} (r : Runs) (f : Runs → α) : q3 r f=f r:= by + cases r <;> rfl +def Runs.denote : Runs → ListBlank (Fin 2) + | [] => default + | (w,n) :: xs => (w ^ n) +> Runs.denote xs +def Runs.push (w : List (Fin 2)) (n : ℕ) (xs : Runs) : Runs := + match w with + | [] => xs + | b :: w' => + if n == 0 then xs + else match xs with + | [] => q4 n (fun n' => [(b :: w',n')]) + | (v,m) :: ys => + if (b :: w') == v then + q4 (n + m) (fun nm => (b :: w',nm) :: ys) + else + q4 n (fun n' => (b :: w',n') :: (v,m) :: ys) +theorem Runs.push_spec (w : List (Fin 2)) (n : ℕ) (xs : Runs) : + Runs.denote (Runs.push w n xs)=(w ^ n) +> Runs.denote xs:= by + cases w with + | nil => simp [Runs.push,nil_pow_list] + | cons b w' => + unfold Runs.push + simp only [strictNat_eq] + by_cases hn : (n == 0)=true + · have hn0 : n=0:=beq_iff_eq.mp hn + subst hn0 + simp + · rw [if_neg hn] + cases xs with + | nil => rfl + | cons vm ys => + rcases vm with ⟨v,m⟩ + dsimp -failIfUnchanged only + by_cases hv : ((b :: w') == v)=true + · have hv_eq : b :: w'=v:=beq_iff_eq.mp hv + subst hv_eq + rw [if_pos hv,Runs.denote,Runs.denote,qb,append_assoc] + · rw [if_neg hv]; rfl +def Runs.pop : Runs → Fin 2 × Runs + | [] => (0,[]) + | ([],_) :: xs => Runs.pop xs + | (b :: w,n) :: xs => + if n == 0 then Runs.pop xs + else if n == 1 then + match w with + | [] => (b, xs) + | b2 :: w' => q3 (Runs.push (b2 :: w') 1 xs) (fun xs2 => (b, xs2)) + else + q4 (n - 1) (fun n' => + q3 (Runs.push (b :: w) n' xs) (fun xs1 => + q3 (Runs.push w 1 xs1) (fun xs2 => + (b,xs2)))) +theorem Runs.pop_spec (xs : Runs) : + Runs.denote xs=(Runs.pop xs).1 >> Runs.denote (Runs.pop xs).2:= by + induction xs with + | nil => + simp only [Runs.pop,Runs.denote,zero_cons_default] + | cons wn xs ih => + rcases wn with ⟨w,n⟩ + cases w with + | nil => + simpa [Runs.pop,Runs.denote,nil_pow_list] using ih + | cons b w => + unfold Runs.pop + by_cases hn : (n == 0)=true + · have hn0 : n=0:=beq_iff_eq.mp hn + subst hn0 + simpa [Runs.denote] using ih + · rw [if_neg hn] + by_cases hn1 : (n == 1)=true + · rw [if_pos hn1] + have hn1_eq : n=1:=beq_iff_eq.mp hn1 + subst hn1_eq + cases w with + | nil => simp [Runs.denote,pow_succ_list] + | cons b2 w' => + simp [strictRuns_eq,Runs.push_spec,Runs.denote,pow_succ_list] + · rw [if_neg hn1] + simp only [strictNat_eq,strictRuns_eq] + rw [Runs.push_spec,Runs.push_spec,Runs.denote] + have hn_pos : 0 < n:=Nat.pos_of_ne_zero (by intro h0; subst h0; exact hn rfl) + have hn_eq : n=(n - 1) + 1:=(Nat.sub_add_cancel hn_pos).symm + conv_lhs => rw [hn_eq,pow_succ_list] + simp [pow_succ_list,append_assoc] +def Runs.remove : List (Fin 2) → Runs → Option Runs + | [],xs => q3 xs (fun xs' => some xs') + | b :: w,xs => + match Runs.pop xs with + | (b',xs') => if b == b' then Runs.remove w xs' else none +theorem Runs.remove_spec {w : List (Fin 2)} {xs ys : Runs} + (h : Runs.remove w xs=some ys) : + Runs.denote xs=w +> Runs.denote ys:= by + induction w generalizing xs with + | nil => + unfold Runs.remove at h + simp only [strictRuns_eq] at h + injection h with hys; subst hys; rfl + | cons b w ih => + unfold Runs.remove at h + dsimp -failIfUnchanged only at h + split_ifs at h with hb + have hb_eq : b=(Runs.pop xs).1:=beq_iff_eq.mp hb + rw [Runs.pop_spec xs,← hb_eq,ih h] + rfl +def strip_prefix : List (Fin 2) → List (Fin 2) → Option (List (Fin 2) × List (Fin 2)) + | [], v => some ([], v) + | w, [] => some (w, []) + | b1 :: w', b2 :: v' => if b1 == b2 then strip_prefix w' v' else none + +theorem strip_prefix_spec {w v w_rem v_rem : List (Fin 2)} + (h : strip_prefix w v = some (w_rem, v_rem)) : + (w_rem = [] → v = w ++ v_rem) ∧ (v_rem = [] → w = v ++ w_rem) := by + induction w generalizing v with + | nil => + unfold strip_prefix at h + injection h with hp; injection hp with hw hv + subst hw hv + refine ⟨fun _ => rfl, fun hv0 => ?_⟩ + subst hv0; rfl + | cons b1 w' ih => + cases v with + | nil => + unfold strip_prefix at h + injection h with hp; injection hp with hw hv + subst hw hv + refine ⟨fun hw0 => by contradiction, fun _ => rfl⟩ + | cons b2 v' => + unfold strip_prefix at h + split_ifs at h with hb + have hb_eq : b1 = b2 := beq_iff_eq.mp hb + subst hb_eq + rcases ih h with ⟨ih1, ih2⟩ + refine ⟨fun hw0 => congrArg (b1 :: ·) (ih1 hw0), fun hv0 => congrArg (b1 :: ·) (ih2 hv0)⟩ + +def Runs.remove_word : ℕ → List (Fin 2) → Runs → Option Runs + | 0, w, xs => Runs.remove w xs + | _ + 1, [], xs => q3 xs (fun xs' => some xs') + | _ + 1, w, [] => Runs.remove w [] + | fuel + 1, w, (v, nv) :: ys => + if nv == 0 then Runs.remove_word fuel w ys + else + match strip_prefix w v with + | some ([], v_rem) => + q4 (nv - 1) (fun nv' => + q3 (Runs.push v nv' ys) (fun ys1 => + q3 (Runs.push v_rem 1 ys1) (fun ys2 => some ys2))) + | some (w_rem, []) => + q4 (nv - 1) (fun nv' => + q3 (Runs.push v nv' ys) (fun ys1 => + Runs.remove_word fuel w_rem ys1)) + | _ => none + +theorem Runs.remove_word_spec {fuel : ℕ} {w : List (Fin 2)} {xs ys : Runs} + (h : Runs.remove_word fuel w xs = some ys) : + Runs.denote xs = w +> Runs.denote ys := by + induction fuel generalizing w xs ys with + | zero => exact Runs.remove_spec h + | succ fuel ih => + cases w with + | nil => + unfold Runs.remove_word at h + simp only [strictRuns_eq] at h + injection h with hys; subst hys; rfl + | cons b1 w' => + cases xs with + | nil => + unfold Runs.remove_word at h + exact Runs.remove_spec h + | cons vn ys0 => + rcases vn with ⟨v, nv⟩ + unfold Runs.remove_word at h + by_cases hnv : (nv == 0) = true + · rw [if_pos hnv] at h + have hnv0 : nv = 0 := beq_iff_eq.mp hnv + subst hnv0 + simpa [Runs.denote] using ih h + · rw [if_neg hnv] at h + have hnv_pos : 0 < nv := Nat.pos_of_ne_zero (by intro h0; subst h0; exact hnv rfl) + have hnv_eq : nv = 1 + (nv - 1) := (Nat.add_sub_of_le hnv_pos).symm + have h_v_pow : v ^ nv = v ++ v ^ (nv - 1) := by + conv_lhs => rw [hnv_eq, qb, pow_succ_list, pow_zero_list, List.append_nil] + cases hsp : strip_prefix (b1 :: w') v with + | none => rw [hsp] at h; contradiction + | some wv => + rcases wv with ⟨w_rem, v_rem⟩ + rw [hsp] at h + rcases strip_prefix_spec hsp with ⟨hsp1, hsp2⟩ + cases w_rem with + | nil => + dsimp -failIfUnchanged only at h + simp only [strictNat_eq, strictRuns_eq] at h + injection h with hys; subst hys + have hv_eq := hsp1 rfl + have h_v_pow2 : v ^ nv = (b1 :: w' ++ v_rem) ++ v ^ (nv - 1) := + h_v_pow.trans (congrArg (· ++ v ^ (nv - 1)) hv_eq) + rw [Runs.denote, h_v_pow2, Runs.push_spec, Runs.push_spec] + simp [pow_succ_list, append_assoc] + | cons bw w_tail => + cases v_rem with + | nil => + dsimp -failIfUnchanged only at h + simp only [strictNat_eq, strictRuns_eq] at h + have hw_eq := hsp2 rfl + have h_ih := ih h + rw [Runs.push_spec] at h_ih + rw [Runs.denote, h_v_pow, append_assoc, h_ih, hw_eq, append_assoc] + | cons bv v_tail => + dsimp -failIfUnchanged only at h + contradiction +def qGcd : ℕ → ℕ → ℕ → ℕ + | 0, m, _ => m + | fuel + 1, m, n => if n == 0 then m else qGcd fuel n (m % n) +def Runs.skip_block (w : List (Fin 2)) (limit : ℕ) (x v : List (Fin 2)) (m : ℕ) (ys : Runs) : Option (ℕ × Runs) := + if w.length == v.length then + if (x ++ v) == (w ++ x) then + if m ≤ limit then + if 0 < m then + q3 (Runs.push x 1 ys) (fun zs => some (m, zs)) + else none + else + if 0 < limit then + q4 (m - limit) (fun m' => + q3 (Runs.push v m' ys) (fun ys1 => + q3 (Runs.push x 1 ys1) (fun zs => + some (limit, zs)))) + else none + else none + else + q4 (qGcd 8 w.length v.length) (fun g => + q4 (w.length / g) (fun a => + q4 (v.length / g) (fun b => + q4 (min (limit / b) (m / a)) (fun k => + if 0 < k then + if k * b ≤ limit then + if k * a ≤ m then + if (x ++ v ^ a) == (w ^ b ++ x) then + q4 (k * b) (fun kb => + q4 (m - k * a) (fun m' => + q3 (Runs.push v m' ys) (fun ys1 => + q3 (Runs.push x 1 ys1) (fun zs => + some (kb,zs))))) + else none + else none + else none + else none)))) +theorem Runs.skip_block_spec {w : List (Fin 2)} {limit : ℕ} {x v : List (Fin 2)} {m : ℕ} {ys : Runs} {n : ℕ} {zs : Runs} + (h : Runs.skip_block w limit x v m ys=some (n,zs)) : + n ≤ limit ∧ x +> (v ^ m) +> Runs.denote ys=(w ^ n) +> Runs.denote zs:= by + unfold Runs.skip_block at h + simp only [strictNat_eq,strictRuns_eq] at h + by_cases hlen : (w.length == v.length) = true + · rw [if_pos hlen] at h + split_ifs at h with heq hm_lim hm_pos hlim_pos + · injection h with hpair; injection hpair with hn hzs; subst hn hzs + refine ⟨hm_lim, ?_⟩ + rw [Runs.push_spec] + have hx1 : x ^ (1 : ℕ) = x := by simp [pow_succ_list] + rw [hx1] + have heq1 : x ++ v ^ 1 = w ^ 1 ++ x := by simpa [pow_succ_list] using beq_iff_eq.mp heq + have hk_comm := commute_power heq1 m + simp only [Nat.mul_one] at hk_comm + rw [← append_assoc, hk_comm, append_assoc] + · injection h with hpair; injection hpair with hn hzs; subst hn hzs + refine ⟨le_rfl, ?_⟩ + rw [Runs.push_spec, Runs.push_spec] + have hx1 : x ^ (1 : ℕ) = x := by simp [pow_succ_list] + rw [hx1] + have hlim_le : limit ≤ m := Nat.le_of_not_le hm_lim + have hm_eq : m = limit + (m - limit) := (Nat.add_sub_of_le hlim_le).symm + have heq1 : x ++ v ^ 1 = w ^ 1 ++ x := by simpa [pow_succ_list] using beq_iff_eq.mp heq + have hk_comm := commute_power heq1 limit + simp only [Nat.mul_one] at hk_comm + conv_lhs => rw [hm_eq, qb] + rw [append_assoc (v ^ limit), ← append_assoc x, hk_comm, append_assoc] + · rw [if_neg hlen] at h + split_ifs at h with hk hkb hka heq + injection h with hpair + injection hpair with hn hzs + subst hn hzs + refine ⟨hkb,?_⟩ + rw [Runs.push_spec,Runs.push_spec] + have hx1 : x ^ (1 : ℕ)=x:= by simp [pow_succ_list] + rw [hx1] + have hm_eq:=(Nat.add_sub_of_le hka).symm + have hk_comm:=commute_power (beq_iff_eq.mp heq) (min (limit / (v.length / qGcd 8 w.length v.length)) (m / (w.length / qGcd 8 w.length v.length))) + have h_lhs : x +> (v ^ m) +> Runs.denote ys = + (x ++ v ^ (min (limit / (v.length / qGcd 8 w.length v.length)) (m / (w.length / qGcd 8 w.length v.length)) * (w.length / qGcd 8 w.length v.length))) +> + (v ^ (m - min (limit / (v.length / qGcd 8 w.length v.length)) (m / (w.length / qGcd 8 w.length v.length)) * (w.length / qGcd 8 w.length v.length))) +> Runs.denote ys:= by + conv_lhs => rw [hm_eq,qb] + rw [append_assoc (v ^ _),← append_assoc x] + rw [h_lhs,hk_comm,append_assoc] +def Runs.skip_periodic (w : List (Fin 2)) (n : ℕ) (xs : Runs) : Option (ℕ × Runs) := + match xs with + | (x,nx) :: (v,m) :: ys => + if nx == 1 then Runs.skip_block w n x v m ys + else Runs.skip_block w n [] x nx ((v,m) :: ys) + | [(v,m)] => Runs.skip_block w n [] v m [] + | [] => none +theorem Runs.skip_periodic_spec {w : List (Fin 2)} {n : ℕ} {xs : Runs} {k : ℕ} {ys : Runs} + (h : Runs.skip_periodic w n xs=some (k,ys)) : + k ≤ n ∧ Runs.denote xs=(w ^ k) +> Runs.denote ys:= by + unfold Runs.skip_periodic at h + rcases xs with _ | ⟨⟨x,nx⟩,_ | ⟨⟨v,m⟩,ys'⟩⟩ + · contradiction + · simpa [Runs.denote] using Runs.skip_block_spec h + · simp only [] at h + split_ifs at h with hnx + · have hnx1 : nx=1:=beq_iff_eq.mp hnx + subst hnx1 + have hx1 : x ^ (1 : ℕ)=x:= by simp [pow_succ_list] + simpa [Runs.denote,hx1] using Runs.skip_block_spec h + · simpa [Runs.denote] using Runs.skip_block_spec h +def Runs.skip (w : List (Fin 2)) (n : ℕ) (xs : Runs) : Option (ℕ × Runs) := + match xs with + | [] => none + | (v,m) :: ys => + if w == v then + q4 (min n m) (fun k => + q4 (m - k) (fun m' => + q3 (Runs.push v m' ys) (fun zs => + some (k,zs)))) + else Runs.skip_periodic w n ((v,m) :: ys) +theorem Runs.skip_spec {w : List (Fin 2)} {n : ℕ} {xs : Runs} {k : ℕ} {ys : Runs} + (h : Runs.skip w n xs=some (k,ys)) : + k ≤ n ∧ Runs.denote xs=(w ^ k) +> Runs.denote ys:= by + rcases xs with _ | ⟨⟨v,m⟩,ys'⟩ + · contradiction + · unfold Runs.skip at h + simp only [strictNat_eq,strictRuns_eq] at h + split_ifs at h with hwv + · injection h with hpair + injection hpair with hk hys + subst hk hys + have hwv_eq : w=v:=beq_iff_eq.mp hwv + subst hwv_eq + refine ⟨Nat.min_le_left n m,?_⟩ + rw [Runs.denote,Runs.push_spec,← append_assoc,← qb] + have hm_eq : m=min n m + (m - min n m):=(Nat.add_sub_of_le (Nat.min_le_right n m)).symm + rw [← hm_eq] + · exact Runs.skip_periodic_spec h +def Runs.remove_fast_step (fuel : ℕ) (w : List (Fin 2)) (n : ℕ) (xs : Runs) (rec : ℕ → Runs → Option Runs) : Option Runs := + match Runs.skip w n xs with + | some (k,ys) => q4 (n - k) (fun n' => rec n' ys) + | none => + match Runs.remove_word 16 w xs with + | some ys => q4 (n - 1) (fun n' => rec n' ys) + | none => none + +def Runs.remove_fast : ℕ → List (Fin 2) → ℕ → Runs → Option Runs + | 0,_,n,xs => if n == 0 then q3 xs (fun xs' => some xs') else none + | fuel + 1,w,n,xs => + if n == 0 then q3 xs (fun xs' => some xs') + else if n ≤ 5 then Runs.remove_word 16 (w ^ n) xs + else match xs with + | (x, nx) :: (v, m) :: ys => + if nx == 1 && w.length == v.length && m + 1 == n && (x ++ v) == (w ++ x) then + Runs.remove_word 16 w ((x, 1) :: ys) + else Runs.remove_fast_step fuel w n xs (Runs.remove_fast fuel w) + | _ => Runs.remove_fast_step fuel w n xs (Runs.remove_fast fuel w) + +theorem Runs.remove_fast_step_spec {fuel : ℕ} {w : List (Fin 2)} {n : ℕ} {xs ys : Runs} + (hn_pos : 0 < n) + (ih : ∀ {n' : ℕ} {xs' ys' : Runs}, Runs.remove_fast fuel w n' xs' = some ys' → Runs.denote xs' = (w ^ n') +> Runs.denote ys') + (h : Runs.remove_fast_step fuel w n xs (Runs.remove_fast fuel w) = some ys) : + Runs.denote xs = (w ^ n) +> Runs.denote ys := by + unfold Runs.remove_fast_step at h + cases hskip : Runs.skip w n xs with + | some kys => + rcases kys with ⟨k,zs⟩ + rw [hskip] at h + simp only [strictNat_eq] at h + rcases Runs.skip_spec hskip with ⟨hkn,hden⟩ + rw [hden,ih h,← append_assoc,← qb,Nat.add_sub_of_le hkn] + | none => + rw [hskip] at h + cases hrem : Runs.remove_word 16 w xs with + | none => rw [hrem] at h; contradiction + | some zs => + rw [hrem] at h + simp only [strictNat_eq] at h + rw [Runs.remove_word_spec hrem,ih h] + have hn_eq : n=(n - 1) + 1:=(Nat.sub_add_cancel hn_pos).symm + conv_rhs => rw [hn_eq,pow_succ_list,append_assoc] + +theorem Runs.remove_fast_spec {fuel : ℕ} {w : List (Fin 2)} {n : ℕ} {xs ys : Runs} + (h : Runs.remove_fast fuel w n xs=some ys) : + Runs.denote xs=(w ^ n) +> Runs.denote ys:= by + induction fuel generalizing n xs ys with + | zero => + unfold Runs.remove_fast at h + simp only [strictRuns_eq] at h + split_ifs at h with hn + injection h with hys; subst hys + have hn0 : n=0:=beq_iff_eq.mp hn; subst hn0 + simp + | succ fuel ih => + unfold Runs.remove_fast at h + simp only [strictRuns_eq] at h + split_ifs at h with hn hn5 + · injection h with hys; subst hys + have hn0 : n=0:=beq_iff_eq.mp hn; subst hn0 + simp + · exact Runs.remove_word_spec h + · have hn_pos : 0 < n:=Nat.pos_of_ne_zero (by intro h0; subst h0; exact hn rfl) + rcases xs with _ | ⟨⟨x, nx⟩, _ | ⟨⟨v, m⟩, ys'⟩⟩ + · exact Runs.remove_fast_step_spec hn_pos ih h + · exact Runs.remove_fast_step_spec hn_pos ih h + · dsimp -failIfUnchanged only at h + split_ifs at h with hfast + · simp only [Bool.and_eq_true, beq_iff_eq] at hfast + rcases hfast with ⟨⟨⟨hnx1, _⟩, hmn⟩, hxveq⟩ + subst hnx1 hmn + have hx1 : x ^ (1 : ℕ) = x := by simp [pow_succ_list] + have heq1 : x ++ v ^ 1 = w ^ 1 ++ x := by simpa [pow_succ_list] using hxveq + have hk_comm := commute_power heq1 m + simp only [Nat.mul_one] at hk_comm + have hrem := Runs.remove_word_spec h + simp only [Runs.denote, hx1] at hrem + rw [Runs.denote, Runs.denote, hx1, ← append_assoc, hk_comm, append_assoc, hrem, ← append_assoc, pow_shift] + · exact Runs.remove_fast_step_spec hn_pos ih h +def Runs.size : Runs → ℕ + | [] => 0 + | (w,n) :: xs => w.length * n + Runs.size xs +def Runs.zeros : Runs → Bool + | [] => true + | (w,_) :: xs => if BusyBeaver.Longitudinal.BoundedConfig.all0 w then Runs.zeros xs else false +theorem Runs.zeros_spec {xs : Runs} (h : Runs.zeros xs=true) : Runs.denote xs=default:= by + induction xs with + | nil => rfl + | cons wn xs ih => + rcases wn with ⟨w,n⟩ + unfold Runs.zeros at h + split_ifs at h with hw + rw [Runs.denote,ih h,qM hw n] +structure RMConfig where + left : Runs + right : Runs + state : Fin 6 + dir : Dir +deriving DecidableEq +def RMConfig.denote (c : RMConfig) : Cfg (Fin 2) (Fin 6) := + match c.dir with + | .left => Runs.denote c.left <{{c.state}} Runs.denote c.right + | .right => Runs.denote c.left {{c.state}}> Runs.denote c.right +def RM.raw (tm : Machine (Fin 2) (Fin 6)) (c : RMConfig) : Option RMConfig := + match c.dir with + | .left => + match Runs.pop c.left with + | (b,l) => + match tm c.state b with + | none => none + | some (none,_) => none + | some (some q',Stmt.write b' .left) => + q3 (Runs.push [b'] 1 c.right) (fun r' => + some ⟨l,r',q',.left⟩) + | some (some q',Stmt.write b' .right) => + q3 (Runs.push [b'] 1 l) (fun l' => + some ⟨l',c.right,q',.right⟩) + | .right => + match Runs.pop c.right with + | (b,r) => + match tm c.state b with + | none => none + | some (none,_) => none + | some (some q',Stmt.write b' .left) => + q3 (Runs.push [b'] 1 r) (fun r' => + some ⟨c.left,r',q',.left⟩) + | some (some q',Stmt.write b' .right) => + q3 (Runs.push [b'] 1 c.left) (fun l' => + some ⟨l',r,q',.right⟩) +theorem RM.raw_spec {tm : Machine (Fin 2) (Fin 6)} {c c' : RMConfig} + (h : RM.raw tm c=some c') : + (c.denote) [tm]⊢* (c'.denote):= by + rcases c with ⟨l,r,q,d⟩ + unfold RM.raw at h + cases d + · dsimp -failIfUnchanged only at h + have hpop:=Runs.pop_spec l + cases htm : tm q (Runs.pop l).1 with + | none => rw [htm] at h; contradiction + | some qa => + rcases qa with ⟨ _ | q',⟨b',_ | _⟩⟩ + · rw [htm] at h; contradiction + · rw [htm] at h; contradiction + · rw [htm] at h + simp only [strictRuns_eq] at h + injection h with hc'; subst hc' + apply qm + unfold RMConfig.denote step + dsimp -failIfUnchanged only + rw [hpop,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,htm,Runs.push_spec] + simp only [pow_succ_list,pow_zero_list,List.append_nil,append_cons,append_nil] + rfl + · rw [htm] at h + simp only [strictRuns_eq] at h + injection h with hc'; subst hc' + apply qm + unfold RMConfig.denote step + dsimp -failIfUnchanged only + rw [hpop,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,htm,Runs.push_spec] + simp only [pow_succ_list,pow_zero_list,List.append_nil,append_cons,append_nil] + rfl + · dsimp -failIfUnchanged only at h + have hpop:=Runs.pop_spec r + cases htm : tm q (Runs.pop r).1 with + | none => rw [htm] at h; contradiction + | some qa => + rcases qa with ⟨ _ | q',⟨b',_ | _⟩⟩ + · rw [htm] at h; contradiction + · rw [htm] at h; contradiction + · rw [htm] at h + simp only [strictRuns_eq] at h + injection h with hc'; subst hc' + apply qm + unfold RMConfig.denote step + dsimp -failIfUnchanged only + rw [hpop,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,htm,Runs.push_spec] + simp only [pow_succ_list,pow_zero_list,List.append_nil,append_cons,append_nil] + rfl + · rw [htm] at h + simp only [strictRuns_eq] at h + injection h with hc'; subst hc' + apply qm + unfold RMConfig.denote step + dsimp -failIfUnchanged only + rw [hpop,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,htm,Runs.push_spec] + simp only [pow_succ_list,pow_zero_list,List.append_nil,append_cons,append_nil] + rfl +def ql (d : Dir) (c : RMConfig) : RMConfig := + match d,c.dir with + | .left,.right => + match Runs.pop c.right with + | (b,r') => + q3 (Runs.push [b] 1 c.left) (fun l' => + ⟨l',r',c.state,.left⟩) + | .right,.left => + match Runs.pop c.left with + | (b,l') => + q3 (Runs.push [b] 1 c.right) (fun r' => + ⟨l',r',c.state,.right⟩) + | _,_ => c +theorem qV (d : Dir) (c : RMConfig) : (ql d c).denote=c.denote:= by + rcases c with ⟨l,r,q,cd⟩ + cases d <;> cases cd <;> try rfl + · unfold ql RMConfig.denote + simp only [strictRuns_eq] + rw [Runs.push_spec,Runs.pop_spec r] + simp only [pow_succ_list,pow_zero_list,List.append_nil,append_cons,append_nil, + Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons] + · unfold ql RMConfig.denote + simp only [strictRuns_eq] + rw [Runs.push_spec,Runs.pop_spec l] + simp only [pow_succ_list,pow_zero_list,List.append_nil,append_cons,append_nil, + Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons] +theorem qa1 (d : Dir) (c : RMConfig) : (ql d c).dir=d:= by + rcases c with ⟨l,r,q,cd⟩ + cases d <;> cases cd <;> simp [ql] +theorem qL (d : Dir) (c : RMConfig) : (ql d c).state=c.state:= by + rcases c with ⟨l,r,q,cd⟩ + cases d <;> cases cd <;> simp [ql] +structure Scan where + q : Fin 6 + dir : Dir + scan_in : List (Fin 2) + scan_out : List (Fin 2) + context : List (Fin 2) +def q7 (tm : Machine (Fin 2) (Fin 6)) (s : Scan) : Prop := + ∀ (n : ℕ) (l r : ListBlank (Fin 2)), + match s.dir with + | .right => + ((s.context.reverse +> l) {{s.q}}> ((s.scan_in ^ n) +> r)) [tm]⊢* + ((s.context.reverse +> (s.scan_out.reverse ^ n) +> l) {{s.q}}> r) + | .left => + (((s.scan_in.reverse ^ n) +> l) <{{s.q}} (s.context +> r)) [tm]⊢* + (l <{{s.q}} (s.context +> (s.scan_out ^ n) +> r)) +theorem qI {tm : Machine (Fin 2) (Fin 6)} {s : Scan} (hd : s.dir=.right) + (hbase : ∀ l r,((s.context.reverse +> l) {{s.q}}> (s.scan_in +> r)) [tm]⊢* + ((s.context.reverse +> s.scan_out.reverse +> l) {{s.q}}> r)) : + q7 tm s:= by + unfold q7 + intro n l r + rw [hd] + dsimp -failIfUnchanged only + induction n generalizing l r with + | zero => exact ⟨0,rfl⟩ + | succ n ih => + rw [pow_succ_list,append_assoc] + have h1:=hbase l ((s.scan_in ^ n) +> r) + have h2:=ih (s.scan_out.reverse +> l) r + rw [← append_assoc (s.scan_out.reverse ^ n) s.scan_out.reverse l,pow_shift] at h2 + exact q0 h1 h2 +theorem qg {tm : Machine (Fin 2) (Fin 6)} {s : Scan} (hd : s.dir=.left) + (hbase : ∀ l r,((s.scan_in.reverse +> l) <{{s.q}} (s.context +> r)) [tm]⊢* + (l <{{s.q}} (s.context +> s.scan_out +> r))) : + q7 tm s:= by + unfold q7 + intro n l r + rw [hd] + dsimp -failIfUnchanged only + induction n generalizing l r with + | zero => exact ⟨0,rfl⟩ + | succ n ih => + rw [pow_succ_list,append_assoc] + have h1:=hbase ((s.scan_in.reverse ^ n) +> l) r + have h2:=ih l (s.scan_out +> r) + rw [← append_assoc (s.scan_out ^ n) s.scan_out r,pow_shift] at h2 + exact q0 h1 h2 +def qj:=Runs.remove_fast 32 +def qr (s : Scan) (n : ℕ) (l r : Runs) : Option (Runs × Runs) := + match s.dir with + | .left => + match Runs.remove_word 16 s.context r,qj s.scan_in.reverse n l with + | some r',some l' => + q3 (Runs.push s.scan_out n r') (fun r1 => + q3 (Runs.push s.context 1 r1) (fun r2 => + some (l',r2))) + | _,_ => none + | .right => + match Runs.remove_word 16 s.context.reverse l,qj s.scan_in n r with + | some l',some r' => + q3 (Runs.push s.scan_out.reverse n l') (fun l1 => + q3 (Runs.push s.context.reverse 1 l1) (fun l2 => + some (l2,r'))) + | _,_ => none +theorem qN {tm : Machine (Fin 2) (Fin 6)} {s : Scan} {n : ℕ} {l r l' r' : Runs} + (hv : q7 tm s) (h : qr s n l r=some (l',r')) : + (RMConfig.denote ⟨l,r,s.q,s.dir⟩) [tm]⊢* (RMConfig.denote ⟨l',r',s.q,s.dir⟩):= by + unfold q7 at hv + rcases s with ⟨q,d,sin,sout,ctx⟩ + have hv_n:=hv n + unfold qr qj at h + cases d + · dsimp -failIfUnchanged only at h hv_n + cases hr : Runs.remove_word 16 ctx r with + | none => rw [hr] at h; contradiction + | some r0 => + rw [hr] at h + cases hl : Runs.remove_fast 32 sin.reverse n l with + | none => rw [hl] at h; contradiction + | some l0 => + rw [hl] at h + simp only [strictRuns_eq] at h + injection h with hpair + injection hpair with hl' hr' + subst hl' hr' + unfold RMConfig.denote + dsimp -failIfUnchanged only + rw [Runs.push_spec,Runs.push_spec,Runs.remove_word_spec hr,Runs.remove_fast_spec hl] + have hc1 : ctx ^ (1 : ℕ)=ctx:= by simp [pow_succ_list] + rw [hc1] + exact hv_n (Runs.denote l0) (Runs.denote r0) + · dsimp -failIfUnchanged only at h hv_n + cases hl : Runs.remove_word 16 ctx.reverse l with + | none => rw [hl] at h; contradiction + | some l0 => + rw [hl] at h + cases hr : Runs.remove_fast 32 sin n r with + | none => rw [hr] at h; contradiction + | some r0 => + rw [hr] at h + simp only [strictRuns_eq] at h + injection h with hpair + injection hpair with hl' hr' + subst hl' hr' + unfold RMConfig.denote + dsimp -failIfUnchanged only + rw [Runs.push_spec,Runs.push_spec,Runs.remove_word_spec hl,Runs.remove_fast_spec hr] + have hc1 : ctx.reverse ^ (1 : ℕ)=ctx.reverse:= by simp [pow_succ_list] + rw [hc1] + exact hv_n (Runs.denote l0) (Runs.denote r0) +def use_scan (s : Scan) (n : ℕ) (c : RMConfig) : Option RMConfig := + if c.state == s.q then + let z:=ql s.dir c + match qr s n z.left z.right with + | some (l,r) => some ⟨l,r,s.q,s.dir⟩ + | none => none + else none +theorem use_scan_spec {tm : Machine (Fin 2) (Fin 6)} {s : Scan} {n : ℕ} {c c' : RMConfig} + (hv : q7 tm s) (h : use_scan s n c=some c') : + (c.denote) [tm]⊢* (c'.denote):= by + unfold use_scan at h + split_ifs at h with hq + have hq_eq : c.state=s.q:=beq_iff_eq.mp hq + rw [← qV s.dir c] + have hd_z : (ql s.dir c).dir=s.dir:=qa1 s.dir c + have hq_z : (ql s.dir c).state=s.q:= by rw [qL,hq_eq] + rcases hz : ql s.dir c with ⟨l,r,qz,dz⟩ + rw [hz] at hd_z hq_z h + dsimp -failIfUnchanged only at hd_z hq_z h + subst hd_z hq_z + cases hs : qr s n l r with + | none => rw [hs] at h; contradiction + | some lr => + rcases lr with ⟨l',r'⟩ + rw [hs] at h + injection h with hc'; subst hc' + exact qN hv hs +def Runs.remove_one (w : List (Fin 2)) (xs : Runs) : Option Runs := + match xs with + | (v, 1) :: ys => + if w == v then q3 ys (fun ys' => some ys') + else Runs.remove_word 16 w xs + | _ => Runs.remove_word 16 w xs +theorem Runs.remove_one_spec {w : List (Fin 2)} {xs ys : Runs} + (h : Runs.remove_one w xs = some ys) : + Runs.denote xs = w +> Runs.denote ys := by + unfold Runs.remove_one at h + rcases xs with _ | ⟨⟨v, _ | _ | m⟩, rest⟩ + · exact Runs.remove_word_spec h + · exact Runs.remove_word_spec h + · simp only [Nat.zero_add] at h ⊢ + split_ifs at h with hwv + · simp only [strictRuns_eq] at h + injection h with hys; subst hys + have hwv_eq : w = v := beq_iff_eq.mp hwv + subst hwv_eq + simp [Runs.denote, pow_succ_list] + · exact Runs.remove_word_spec h + · exact Runs.remove_word_spec h +def Runs.remove_exact (w : List (Fin 2)) (n : ℕ) (xs : Runs) : Option Runs := + if n == 0 then q3 xs (fun xs' => some xs') + else match xs with + | (v, m) :: ys => + if w == v then + if n == m then q3 ys (fun ys' => some ys') + else qj w n xs + else qj w n xs + | [] => none +theorem Runs.remove_exact_spec {w : List (Fin 2)} {n : ℕ} {xs ys : Runs} + (h : Runs.remove_exact w n xs = some ys) : + Runs.denote xs = (w ^ n) +> Runs.denote ys := by + unfold Runs.remove_exact at h + split_ifs at h with hn0 + · simp only [strictRuns_eq] at h + injection h with hys; subst hys + have hn : n = 0 := beq_iff_eq.mp hn0; subst hn + simp + · rcases xs with _ | ⟨⟨v, m⟩, rest⟩ + · contradiction + · dsimp -failIfUnchanged only at h + split_ifs at h with hwv hnm + · simp only [strictRuns_eq] at h + injection h with hys; subst hys + have hwv_eq : w = v := beq_iff_eq.mp hwv + have hnm_eq : n = m := beq_iff_eq.mp hnm + subst hwv_eq hnm_eq + rfl + · exact Runs.remove_fast_spec h + · exact Runs.remove_fast_spec h +def qi : qv → Runs → Option Runs + | [],r => q3 r (fun r' => some r') + | (p,n) :: xs,r => + match Runs.remove_one (qo p) r with + | none => none + | some r1 => + match Runs.remove_exact W n r1 with + | none => none + | some r2 => qi xs r2 +theorem qF {xs : qv} {r r' : Runs} + (h : qi xs r=some r') : + Runs.denote r=(q8 xs) +> Runs.denote r':= by + induction xs generalizing r with + | nil => + unfold qi at h + simp only [strictRuns_eq] at h + injection h with hr'; subst hr'; rfl + | cons pn xs ih => + rcases pn with ⟨p,n⟩ + unfold qi at h + cases hr1 : Runs.remove_one (qo p) r with + | none => rw [hr1] at h; contradiction + | some r1 => + rw [hr1] at h + dsimp -failIfUnchanged only at h + cases hr2 : Runs.remove_exact W n r1 with + | none => rw [hr2] at h; contradiction + | some r2 => + rw [hr2] at h + dsimp -failIfUnchanged only at h + rw [Runs.remove_one_spec hr1,Runs.remove_exact_spec hr2,ih h,q8,append_assoc,append_assoc] +def qw : qv → Runs → Runs + | [],r => r + | (p,n) :: xs,r => + q3 (qw xs r) (fun r1 => + q3 (Runs.push W n r1) (fun r2 => + Runs.push (qo p) 1 r2)) +theorem qU (xs : qv) (r : Runs) : + Runs.denote (qw xs r)=(q8 xs) +> Runs.denote r:= by + induction xs with + | nil => rfl + | cons pn xs ih => + rcases pn with ⟨p,n⟩ + unfold qw q8 + simp only [strictRuns_eq] + rw [Runs.push_spec,Runs.push_spec,ih] + have hw1 : (qo p) ^ (1 : ℕ)=qo p:= by simp [pow_succ_list] + rw [hw1,append_assoc,append_assoc] +def qC (q : Fin 6) (u : List (Fin 2)) (t k : ℕ) (xs : qv) (c : RMConfig) : Option RMConfig := + if c.state == q then + let z:=ql .right c + match Runs.remove_word 16 u.reverse z.left,Runs.remove_exact W k z.right,qZ t xs with + | some l0,some r0,some (e,ys) => + if Runs.zeros l0 then + match qi xs r0 with + | some r1 => + q4 (k + e) (fun ke => + q3 (qw ys r1) (fun r2 => + q3 (Runs.push W ke r2) (fun r3 => + some ⟨z.left,r3,q,.right⟩))) + | none => none + else none + | _,_,_ => none + else none +theorem qP {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (hrule : ∀ t xs e ys k r,qZ t xs=some (e,ys) → + (([1,0,1] +> default) {{q}}> ((W ^ k) +> (q8 xs) +> r)) [tm]⊢* + (([1,0,1] +> default) {{q}}> ((W ^ (k + e)) +> (q8 ys) +> r))) + {t k : ℕ} {xs : qv} {c c' : RMConfig} + (h : qC q [1,0,1] t k xs c=some c') : + (c.denote) [tm]⊢* (c'.denote):= by + unfold qC at h + split_ifs at h with hq + have hq_eq : c.state=q:=beq_iff_eq.mp hq + rw [← qV .right c] + have hd_z : (ql .right c).dir=.right:=qa1 .right c + have hq_z : (ql .right c).state=q:= by rw [qL,hq_eq] + rcases hz : ql .right c with ⟨l,r,qz,dz⟩ + rw [hz] at hd_z hq_z h + dsimp -failIfUnchanged only at hd_z hq_z h + subst hd_z hq_z + cases hl0 : Runs.remove_word 16 ([1,0,1] : List (Fin 2)).reverse l with + | none => rw [hl0] at h; contradiction + | some l0 => + rw [hl0] at h + cases hr0 : Runs.remove_exact W k r with + | none => rw [hr0] at h; contradiction + | some r0 => + rw [hr0] at h + cases hb : qZ t xs with + | none => rw [hb] at h; contradiction + | some eys => + rcases eys with ⟨e,ys⟩ + rw [hb] at h + dsimp -failIfUnchanged only at h + split_ifs at h with hz0 + cases hrc : qi xs r0 with + | none => rw [hrc] at h; contradiction + | some r1 => + rw [hrc] at h + simp only [strictNat_eq,strictRuns_eq] at h + injection h with hc'; subst hc' + unfold RMConfig.denote + dsimp -failIfUnchanged only + have hl_den : Runs.denote l=[1,0,1] +> default:= by + rw [Runs.remove_word_spec hl0,Runs.zeros_spec hz0] + rfl + rw [hl_den,Runs.push_spec,qU,Runs.remove_exact_spec hr0,qF hrc] + exact hrule t xs e ys k (Runs.denote r1) hb +def periodic (w : List (Fin 2)) (r : Runs) : Bool := + match (match r with + | (x,nx) :: (v,_) :: _ => if nx == 1 then (x,v) else ([],x) + | (v,_) :: _ => ([],v) + | [] => ([],[])) with + | (x, v) => + q4 (qGcd 8 w.length v.length) (fun g => + q4 (w.length / g) (fun a => + q4 (v.length / g) (fun b => + (x ++ v ^ a) == (w ^ b ++ x)))) +def match_digit (v : List (Fin 2)) : Option Digit := + if v == [0,1] then some .D0 + else if v == [1,1,1,1] then some .D1 + else if v == [0,1,1,1,1,1] then some .D2 + else if v == [1,1,1,1,1,1,1,1] then some .D3 + else if v == [0,1,1,1,1,1,1,1,1,1] then some .D4 + else if v == [1,1,1,1,1,1,1,1,1,1,1,1] then some .D5 + else none +def cannot_start_W (r : Runs) : Bool := + match r with + | [] => true + | (v, _) :: rest => + if v == [0,1] || v == [0,1,1,1,1,1] || v == [0,1,1,1,1,1,1,1,1,1] || + v == [1,1,1,1,1,1,1,1] || v == [1,1,1,1,1,1,1,1,1,1,1,1] then true + else if v == [1] then rest.isEmpty + else if v == [1,1,1,1] then + match rest with + | (w2, n2) :: _ => w2 == W && 0 < n2 + | [] => true + else false +def qf : ℕ → List (Fin 2) → Runs → ℕ × Runs + | 0,_,r => (0,r) + | fuel + 1,w,r => + match r with + | [] => (0,[]) + | (v,m) :: ys => + if w == v then + if w == W && cannot_start_W ys then (m,ys) + else + match qf fuel w ys with + | (n,s') => q4 (m + n) (fun kn => (kn,s')) + else if w == W && cannot_start_W r then (0,r) + else + match (if periodic w r then q4 (Runs.size (r.take 2)) (fun sz => Runs.skip w sz r) else none) with + | some (k,s) => + match qf fuel w s with + | (n,s') => q4 (k + n) (fun kn => (kn,s')) + | none => + match Runs.remove_word 16 w r with + | some s => + match qf fuel w s with + | (n,s') => q4 (1 + n) (fun n1 => (n1,s')) + | none => (0,r) +def first_bad : ℕ → Digit → ℕ → ℕ + | 0,_,_ => 1 + | fuel + 1,p,n => + if take p ≤ n then 1 + first_bad fuel (next p) (n - take p) else 1 +def unsafe_bound (p : Digit) (n : ℕ) : ℕ := + q4 (n / 2) (fun q => + q4 (n % 2) (fun r => + q4 (first_bad 6 p r) (fun fb => + 6 * q + fb))) +def choose_opt_slow (r : Runs) : Option (Digit × ℕ × Runs) := + match Runs.pop r with + | (b,r1) => + if b == 0 then + match Runs.remove_word 16 [1] r1 with + | none => none + | some r_d0 => + match qf 32 W r_d0 with + | (n0,rt0) => + if 0 < n0 then some (.D0,n0,rt0) + else match Runs.remove_word 16 [1,1,1,1] r_d0 with + | none => some (.D0,0,r_d0) + | some r_d2 => + match qf 32 W r_d2 with + | (n2,rt2) => + if 0 < n2 then some (.D2,n2,rt2) + else match Runs.remove_word 16 [1,1,1,1] r_d2 with + | none => some (.D2,0,r_d2) + | some r_d4 => + match qf 32 W r_d4 with + | (n4,rt4) => some (.D4,n4,rt4) + else + match Runs.remove_word 16 [1,1,1] r1 with + | none => none + | some r_d1 => + match qf 32 W r_d1 with + | (n1,rt1) => + if 0 < n1 then some (.D1,n1,rt1) + else match Runs.remove_word 16 [1,1,1,1] r_d1 with + | none => some (.D1,0,r_d1) + | some r_d3 => + match qf 32 W r_d3 with + | (n3,rt3) => + if 0 < n3 then some (.D3,n3,rt3) + else match Runs.remove_word 16 [1,1,1,1] r_d3 with + | none => some (.D3,0,r_d3) + | some r_d5 => + match qf 32 W r_d5 with + | (n5,rt5) => some (.D5,n5,rt5) +def choose_opt (r : Runs) : Option (Digit × ℕ × Runs) := + match r with + | (v, 1) :: (w, n) :: rest => + if w == W && 0 < n && cannot_start_W rest then + match match_digit v with + | some d => some (d, n, rest) + | none => choose_opt_slow r + else choose_opt_slow r + | _ => choose_opt_slow r +def qq : ℕ → Runs → Option ℕ → ℕ × qv + | 0,_,_ => (0,[]) + | fuel + 1,r,cap => + match choose_opt r with + | none => (0,[]) + | some (p,n,r2) => + q4 (unsafe_bound p n - 1) (fun t0 => + q4 (match cap with | none => t0 | some u => min t0 u) (fun t => + q4 ((t + p.index) / 6) (fun child => + if child == 0 then (t,[(p,n)]) + else + match qq fuel r2 (some child) with + | (u,xs) => + q4 (min t (6 * u + 5 - p.index)) (fun t' => + (t',(p,n) :: xs))))) +def qK (c : RMConfig) : Option (ℕ × ℕ × qv) := + let z:=ql .right c + match qf 32 W z.right with + | (k,r2) => + match qq 32 r2 none with + | (t,xs) => if t == 0 then none else some (t,k,xs) +def qY (q : Fin 6) (c : RMConfig) : Option RMConfig := + match qK c with + | some (t,k,xs) => qC q [1,0,1] t k xs c + | none => none +theorem qa0 {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (hrule : ∀ t xs e ys k r,qZ t xs=some (e,ys) → + (([1,0,1] +> default) {{q}}> ((W ^ k) +> (q8 xs) +> r)) [tm]⊢* + (([1,0,1] +> default) {{q}}> ((W ^ (k + e)) +> (q8 ys) +> r))) + {c c' : RMConfig} (h : qY q c=some c') : + (c.denote) [tm]⊢* (c'.denote):= by + unfold qY at h + cases hp : qK c with + | none => rw [hp] at h; contradiction + | some tkx => + rcases tkx with ⟨t,k,xs⟩ + rw [hp] at h + exact qP hrule h +def qe (s : Scan) (keep : ℕ) (c : RMConfig) : Option RMConfig := + let z:=ql s.dir c + let w:=match s.dir with | .left => s.scan_in.reverse | .right => s.scan_in + let src:=match s.dir with | .left => z.left | .right => z.right + q4 ((qf 32 w src).1 - keep) (fun n => use_scan s n c) +theorem q9 {tm : Machine (Fin 2) (Fin 6)} {s : Scan} {keep : ℕ} {c c' : RMConfig} + (hv : q7 tm s) (h : qe s keep c=some c') : + (c.denote) [tm]⊢* (c'.denote):= by + unfold qe at h + simp only [strictNat_eq] at h + exact use_scan_spec hv h +def qX (c : Cfg (Fin 2) (Fin 6)) : Cfg (Fin 2) (Fin 6) := + ⟨c.q,⟨c.tape.1,c.tape.right,c.tape.left⟩⟩ +theorem qH (c : Cfg (Fin 2) (Fin 6)) : + step holdout_0491_tm (qX c)=(step qc c).map qX:= by + rcases c with ⟨_ | ⟨q,hq⟩,⟨⟨b,hb⟩,l,r⟩⟩ + · rfl + · rcases q with _ | _ | _ | _ | _ | _ | q <;> try omega + all_goals (rcases b with _ | _ | b <;> first | omega | rfl) +theorem qG (c : Cfg (Fin 2) (Fin 6)) (n : ℕ) : + multiStep holdout_0491_tm (qX c) n=(multiStep qc c n).map qX:= by + induction n with + | zero => rfl + | succ n ih => + rw [multiStep_succ,multiStep_succ,ih] + cases multiStep qc c n with + | none => rfl + | some c' => simp [qH] +theorem qW (h : IsHalt qc) : IsHalt holdout_0491_tm:= by + rcases h with ⟨cfg,⟨n,hn⟩,hnone⟩ + refine ⟨qX cfg,⟨n,?_⟩,?_⟩ + · have h1:=qG (init []) n + rw [hn] at h1 + exact h1 + · rw [qH,Option.isNone_map] + exact hnone +theorem wall_1 : q2 qc C 1 1 W W:= by + apply qJ (w_mid:=[1,0,1,1,0,0,1,1,0,1]) + · intro l r; dsimp -failIfUnchanged [W,ListBlank.append]; execute90 + · intro l r; dsimp -failIfUnchanged [W,ListBlank.append]; execute90 +theorem inc0 : q2 qc C 1 0 (qo .D0) (qo .D1):= by + apply qk + intro l r; dsimp -failIfUnchanged [qo,ListBlank.append]; execute90 +theorem inc1 : q2 qc C 1 0 (qo .D1 ++ W) (W ++ qo .D2):= by + apply qk + intro l r; dsimp -failIfUnchanged [qo,W,ListBlank.append]; execute90 +theorem inc2 : q2 qc C 1 0 (qo .D2) (qo .D3):= by + apply qk + intro l r; dsimp -failIfUnchanged [qo,ListBlank.append]; execute90 +theorem inc3 : q2 qc C 1 0 (qo .D3 ++ W) (W ++ qo .D4):= by + apply qk + intro l r; dsimp -failIfUnchanged [qo,W,ListBlank.append]; execute90 +theorem inc4 : q2 qc C 1 0 (qo .D4) (qo .D5):= by + apply qk + intro l r; dsimp -failIfUnchanged [qo,ListBlank.append]; execute90 +theorem inc5 : q2 qc C 1 1 (qo .D5) (W ++ qo .D0):= by + apply qJ (w_mid:=[1,0,1,1,0,1,1,0,1,1,0,1]) + · intro l r; dsimp -failIfUnchanged [qo,W,ListBlank.append]; execute90 + · intro l r; dsimp -failIfUnchanged [qo,W,ListBlank.append]; execute90 +theorem one (p : Digit) (n : ℕ) : + q2 qc C 1 (qO p) + (qo p ++ W ^ (take p + n)) + (W ^ (give p) ++ qo (next p) ++ W ^ n):= by + cases p + · dsimp -failIfUnchanged only [take,give,qO,next] + simpa only [Nat.zero_add,pow_zero_list,List.nil_append] using + q5 inc0 (qh qc C (W ^ n)) + · dsimp -failIfUnchanged only [take,give,qO,next] + have h:=q5 inc1 (qh qc C (W ^ n)) + have h1 : 1 + n=n + 1:= by omega + rw [h1,pow_succ_list,pow_succ_list,pow_zero_list,List.append_nil] + simpa only [List.append_assoc] using h + · dsimp -failIfUnchanged only [take,give,qO,next] + simpa only [Nat.zero_add,pow_zero_list,List.nil_append] using + q5 inc2 (qh qc C (W ^ n)) + · dsimp -failIfUnchanged only [take,give,qO,next] + have h:=q5 inc3 (qh qc C (W ^ n)) + have h1 : 1 + n=n + 1:= by omega + rw [h1,pow_succ_list,pow_succ_list,pow_zero_list,List.append_nil] + simpa only [List.append_assoc] using h + · dsimp -failIfUnchanged only [take,give,qO,next] + simpa only [Nat.zero_add,pow_zero_list,List.nil_append] using + q5 inc4 (qh qc C (W ^ n)) + · dsimp -failIfUnchanged only [take,give,qO,next] + have h:=q5 inc5 (wall_n wall_1 n) + rw [Nat.zero_add,pow_succ_list,pow_zero_list,List.append_nil] + simpa only [List.append_assoc] using h +theorem emit (r : ListBlank (Fin 2)) : + (default <{{C}} ([1] +> r)) [qc]⊢* (([1,0,1] +> default) {{C}}> r):= by + dsimp -failIfUnchanged [ListBlank.append]; execute90 +theorem batch_step (t : ℕ) (xs : qv) (e : ℕ) (ys : qv) (k : ℕ) (r : ListBlank (Fin 2)) + (h : qZ t xs=some (e,ys)) : + (([1,0,1] +> default) {{C}}> ((W ^ k) +> (q8 xs) +> r)) [qc]⊢* + (([1,0,1] +> default) {{C}}> ((W ^ (k + e)) +> (q8 ys) +> r)) := + batch_root emit wall_1 one t xs e ys k r h +def scan_0 : Scan:=⟨E,.left,[0,1,1,0,0,1,1,0,1,1],[1,1,1,1,0,1,1,1,1,1],[]⟩ +theorem scan_0_valid : q7 qc scan_0:= by + apply qg rfl + intro l r; dsimp -failIfUnchanged [scan_0,List.reverse,List.reverseAux,ListBlank.append]; execute90 +def scan_1 : Scan:=⟨D,.left,[1,0,1,1,0,0,1,1,0,1],[1,1,1,1,1,0,1,1,1,1],[0,1,0]⟩ +theorem scan_1_valid : q7 qc scan_1:= by + apply qg rfl + intro l r; dsimp -failIfUnchanged [scan_1,List.reverse,List.reverseAux,ListBlank.append]; execute90 +def scan_2 : Scan:=⟨A,.left,[1,1,0,1,1,0,0,1,1,0],[1,1,1,1,0,1,1,1,1,1],[0,1]⟩ +theorem scan_2_valid : q7 qc scan_2:= by + apply qg rfl + intro l r; dsimp -failIfUnchanged [scan_2,List.reverse,List.reverseAux,ListBlank.append]; execute90 +def scan_3 : Scan:=⟨D,.right,[1,1,0,1,1,1,1,1,1,1],[0,0,1,1,0,1,1,0,1,1],[0]⟩ +theorem scan_3_valid : q7 qc scan_3:= by + apply qI rfl + intro l r; dsimp -failIfUnchanged [scan_3,List.reverse,List.reverseAux,ListBlank.append]; execute90 +def scan_4 : Scan:=⟨E,.left,[0,1,1,0,1,1],[1,1,1,1,0,1],[]⟩ +theorem scan_4_valid : q7 qc scan_4:= by + apply qg rfl + intro l r; dsimp -failIfUnchanged [scan_4,List.reverse,List.reverseAux,ListBlank.append]; execute90 +def scan_5 : Scan:=⟨D,.left,[1,0,1,1,0,1],[1,0,1,1,1,1],[0]⟩ +theorem scan_5_valid : q7 qc scan_5:= by + apply qg rfl + intro l r; dsimp -failIfUnchanged [scan_5,List.reverse,List.reverseAux,ListBlank.append]; execute90 +def scan_6 : Scan:=⟨A,.left,[1,1,0,1,1,0],[0,1,1,1,1,1],[]⟩ +theorem scan_6_valid : q7 qc scan_6:= by + apply qg rfl + intro l r; dsimp -failIfUnchanged [scan_6,List.reverse,List.reverseAux,ListBlank.append]; execute90 +def scan_7 : Scan:=⟨D,.right,[1,1,1],[0,1,1],[0]⟩ +theorem scan_7_valid : q7 qc scan_7:= by + apply qI rfl + intro l r; dsimp -failIfUnchanged [scan_7,List.reverse,List.reverseAux,ListBlank.append]; execute90 +def run_raw (tm : Machine (Fin 2) (Fin 6)) : ℕ → RMConfig → Option RMConfig + | 0,c => some c + | n + 1,c => + match RM.raw tm c with + | some c' => run_raw tm n c' + | none => none +theorem run_raw_spec {n : ℕ} {c c' : RMConfig} + (h : run_raw qc n c=some c') : + (c.denote) [qc]⊢* (c'.denote):= by + induction n generalizing c with + | zero => + injection h with heq; subst heq; exact ⟨0,rfl⟩ + | succ n ih => + unfold run_raw at h + cases hr : RM.raw qc c with + | none => rw [hr] at h; contradiction + | some c₁ => + rw [hr] at h + exact q0 (RM.raw_spec hr) (ih h) +def qs (op arg : ℕ) (c : RMConfig) : Option RMConfig := + match op with + | 0 => run_raw qc arg c + | 1 => qY C c + | 2 => qe scan_0 arg c + | 3 => qe scan_1 arg c + | 4 => qe scan_2 arg c + | 5 => qe scan_3 arg c + | 6 => qe scan_4 arg c + | 7 => qe scan_5 arg c + | 8 => qe scan_6 arg c + | 9 => qe scan_7 arg c + | _ => none +theorem qp {op arg : ℕ} {c c' : RMConfig} + (h : qs op arg c=some c') : + (c.denote) [qc]⊢* (c'.denote):= by + unfold qs at h + rcases op with _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | op + · exact run_raw_spec h + · exact qa0 batch_step h + · exact q9 scan_0_valid h + · exact q9 scan_1_valid h + · exact q9 scan_2_valid h + · exact q9 scan_3_valid h + · exact q9 scan_4_valid h + · exact q9 scan_5_valid h + · exact q9 scan_6_valid h + · exact q9 scan_7_valid h + · contradiction +def qR : ℕ → ℕ → ℕ → RMConfig → Option RMConfig + | 0,_,_,c => some c + | n + 1,op,arg,c => + match qs op arg c with + | some c' => qR n op arg c' + | none => none +theorem run_rep1_spec {n op arg : ℕ} {c c' : RMConfig} + (h : qR n op arg c=some c') : + (c.denote) [qc]⊢* (c'.denote):= by + induction n generalizing c with + | zero => + injection h with heq; subst heq; exact ⟨0,rfl⟩ + | succ n ih => + unfold qR at h + cases ho : qs op arg c with + | none => rw [ho] at h; contradiction + | some c₁ => + rw [ho] at h + exact q0 (qp ho) (ih h) +def qQ : ℕ → ℕ → ℕ → ℕ → ℕ → RMConfig → Option RMConfig + | 0,_,_,_,_,c => some c + | n + 1,op1,arg1,op2,arg2,c => + match qs op1 arg1 c with + | some c₁ => + match qs op2 arg2 c₁ with + | some c₂ => qQ n op1 arg1 op2 arg2 c₂ + | none => none + | none => none +theorem run_rep2_spec {n op1 arg1 op2 arg2 : ℕ} {c c' : RMConfig} + (h : qQ n op1 arg1 op2 arg2 c=some c') : + (c.denote) [qc]⊢* (c'.denote):= by + induction n generalizing c with + | zero => + injection h with heq; subst heq; exact ⟨0,rfl⟩ + | succ n ih => + unfold qQ at h + cases ho1 : qs op1 arg1 c with + | none => rw [ho1] at h; contradiction + | some c₁ => + rw [ho1] at h; dsimp -failIfUnchanged only at h + cases ho2 : qs op2 arg2 c₁ with + | none => rw [ho2] at h; contradiction + | some c₂ => + rw [ho2] at h; dsimp -failIfUnchanged only at h + exact q0 (qp ho1) (q0 (qp ho2) (ih h)) + +def norm_qv : qv → qv + | [] => [] + | (p, n) :: rest => + let rest' := norm_qv rest + if n == 0 then + match p, rest' with + | .D1, (.D1, n2) :: tail => (.D3, n2) :: tail + | .D1, (.D3, n2) :: tail => (.D5, n2) :: tail + | .D3, (.D1, n2) :: tail => (.D5, n2) :: tail + | .D1, (.D5, n2) :: tail => (.D5, 0) :: (.D1, n2) :: tail + | .D3, (.D3, n2) :: tail => (.D5, 0) :: (.D1, n2) :: tail + | .D3, (.D5, n2) :: tail => (.D5, 0) :: (.D3, n2) :: tail + | _, _ => (p, 0) :: rest' + else (p, n) :: rest' + +theorem norm_qv_spec (xs : qv) : q8 (norm_qv xs) = q8 xs := by + induction xs with + | nil => rfl + | cons pn rest ih => + rcases pn with ⟨p, n⟩ + unfold norm_qv + dsimp -failIfUnchanged only + split_ifs with hn0 + · have hn : n = 0 := beq_iff_eq.mp hn0 + subst hn + rcases hrest : norm_qv rest with _ | ⟨⟨p2, n2⟩, tail⟩ + · simp [q8, ← ih, hrest] + · cases p <;> cases p2 <;> + simp [q8, qo, pow_zero_list, List.append_assoc, ← ih, hrest] + · simp [q8, ih] + +def qZ_fast : ℕ → qv → Option (ℕ × qv) + | t, [] => if t == 0 then some (0, []) else none + | t, (p, n) :: xs => + if t == 0 then some (0, (p, n) :: xs) + else + match qy p t with + | ⟨ph, u, g, s⟩ => + if u ≤ n then + match qZ_fast s xs with + | some (e, ys) => + q4 (n - u + e) (fun m => + some (g, (ph, m) :: ys)) + | none => none + else none + +theorem qZ_fast_spec {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (hwall1 : q2 tm q 1 1 W W) + (hone : ∀ p n, q2 tm q 1 (qO p) (qo p ++ W ^ (take p + n)) (W ^ (give p) ++ qo (next p) ++ W ^ n)) + (t : ℕ) (xs : qv) (e : ℕ) (ys : qv) (h : qZ_fast t xs = some (e, ys)) : + q2 tm q t 0 (q8 xs) (W ^ e ++ q8 ys) := by + induction xs generalizing t e ys with + | nil => + unfold qZ_fast at h + split_ifs at h with ht + injection h with hpair; injection hpair with he hys; subst he hys + have ht0 : t = 0 := beq_iff_eq.mp ht; subst ht0 + exact qh tm q [] + | cons pn xs ih => + rcases pn with ⟨p, n⟩ + unfold qZ_fast at h + dsimp -failIfUnchanged only at h + split_ifs at h with ht hle + · injection h with hpair; injection hpair with he hys; subst he hys + have ht0 : t = 0 := beq_iff_eq.mp ht; subst ht0 + simpa using qh tm q (q8 ((p, n) :: xs)) + · cases hb : qZ_fast (qy p t).sent xs with + | none => rw [hb] at h; contradiction + | some eys => + rcases eys with ⟨e', ys'⟩ + rw [hb] at h + simp only [strictNat_eq] at h + injection h with hpair; injection hpair with he hys; subst he hys + have h1 := totalN_rule hwall1 hone p t n hle + have h2 := ih (qy p t).sent e' ys' hb + have h3 := q5 h1 h2 + simpa only [q8, qb, List.append_assoc] using h3 + +theorem batch_fast_step (t : ℕ) (xs : qv) (e : ℕ) (ys : qv) (k : ℕ) (r : ListBlank (Fin 2)) + (h : qZ_fast t xs = some (e, ys)) : + (([1,0,1] +> default) {{C}}> ((W ^ k) +> (q8 xs) +> r)) [qc]⊢* + (([1,0,1] +> default) {{C}}> ((W ^ (k + e)) +> (q8 ys) +> r)) := by + apply calls_spec emit t + have hw := walls wall_1 t k + have hb := qZ_fast_spec wall_1 one t xs e ys h + have hc := q5 hw hb r r rfl + simpa only [qb, List.append_assoc, append_assoc] using hc + +def qZ_many : List ℕ → ℕ → qv → Option (ℕ × qv) + | [], k, xs => some (k, xs) + | t :: ts, k, xs => + match qZ_fast t xs with + | some (e, ys) => q4 (k + e) (fun k' => qZ_many ts k' (norm_qv ys)) + | none => none + +theorem qZ_many_spec (ts : List ℕ) (k : ℕ) (xs : qv) (ke : ℕ) (ys : qv) (r : ListBlank (Fin 2)) + (h : qZ_many ts k xs = some (ke, ys)) : + (([1,0,1] +> default) {{C}}> ((W ^ k) +> (q8 xs) +> r)) [qc]⊢* + (([1,0,1] +> default) {{C}}> ((W ^ ke) +> (q8 ys) +> r)) := by + induction ts generalizing k xs with + | nil => + unfold qZ_many at h + injection h with hpair; injection hpair with hke hys; subst hke hys + exact ⟨0, rfl⟩ + | cons t ts ih => + unfold qZ_many at h + cases hb : qZ_fast t xs with + | none => rw [hb] at h; contradiction + | some eys => + rcases eys with ⟨e, ys1⟩ + rw [hb] at h + simp only [strictNat_eq] at h + have h1 := batch_fast_step t xs e ys1 k r hb + have h2 := ih (k + e) (norm_qv ys1) h + rw [norm_qv_spec] at h2 + exact q0 h1 h2 + +def qC_many (q : Fin 6) (u : List (Fin 2)) (ts : List ℕ) (k : ℕ) (xs : qv) (c : RMConfig) : Option RMConfig := + if c.state == q then + let z := ql .right c + match Runs.remove_word 16 u.reverse z.left, Runs.remove_exact W k z.right, qZ_many ts k xs with + | some l0, some r0, some (ke, ys) => + if Runs.zeros l0 then + match qi xs r0 with + | some r1 => + q3 (qw ys r1) (fun r2 => + q3 (Runs.push W ke r2) (fun r3 => + some ⟨z.left, r3, q, .right⟩)) + | none => none + else none + | _, _, _ => none + else none + +theorem qP_many {ts : List ℕ} {k : ℕ} {xs : qv} {c c' : RMConfig} + (h : qC_many C [1,0,1] ts k xs c = some c') : + (c.denote) [qc]⊢* (c'.denote) := by + unfold qC_many at h + split_ifs at h with hq + have hq_eq : c.state = C := beq_iff_eq.mp hq + rw [← qV .right c] + have hd_z : (ql .right c).dir = .right := qa1 .right c + have hq_z : (ql .right c).state = C := by rw [qL, hq_eq] + rcases hz : ql .right c with ⟨l, r, qz, dz⟩ + rw [hz] at hd_z hq_z h + dsimp -failIfUnchanged only at hd_z hq_z h + subst hd_z hq_z + cases hl0 : Runs.remove_word 16 ([1,0,1] : List (Fin 2)).reverse l with + | none => rw [hl0] at h; contradiction + | some l0 => + rw [hl0] at h + cases hr0 : Runs.remove_exact W k r with + | none => rw [hr0] at h; contradiction + | some r0 => + rw [hr0] at h + cases hb : qZ_many ts k xs with + | none => rw [hb] at h; contradiction + | some keys => + rcases keys with ⟨ke, ys⟩ + rw [hb] at h + dsimp -failIfUnchanged only at h + split_ifs at h with hz0 + cases hrc : qi xs r0 with + | none => rw [hrc] at h; contradiction + | some r1 => + rw [hrc] at h + simp only [strictNat_eq, strictRuns_eq] at h + injection h with hc'; subst hc' + unfold RMConfig.denote + dsimp -failIfUnchanged only + have hl_den : Runs.denote l = [1,0,1] +> default := by + rw [Runs.remove_word_spec hl0, Runs.zeros_spec hz0] + rfl + rw [hl_den, Runs.push_spec, qU, Runs.remove_exact_spec hr0, qF hrc] + exact qZ_many_spec ts k xs ke ys (Runs.denote r1) hb + +def Runs.toList : Runs → List (Fin 2) + | [] => [] + | (w, n) :: xs => w ^ n ++ Runs.toList xs + +def Runs.push_runs : Runs → Runs → Runs + | [], ys => ys + | (w, n) :: xs, ys => q3 (Runs.push_runs xs ys) (fun zs => Runs.push w n zs) + +theorem Runs.push_runs_spec (xs ys : Runs) : + Runs.denote (Runs.push_runs xs ys) = Runs.toList xs +> Runs.denote ys := by + induction xs with + | nil => rfl + | cons wn xs ih => + rcases wn with ⟨w, n⟩ + simp only [Runs.push_runs, Runs.toList, strictRuns_eq, Runs.push_spec, ih, append_assoc] + +structure MacroRule where + q1 : Fin 6 + d1 : Dir + l_in : List (Fin 2) + r_in : List (Fin 2) + q2 : Fin 6 + d2 : Dir + l_out : Runs + r_out : Runs + +abbrev cfg_of := @Counter.cfg_of (Fin 2) (Fin 6) + +def MacroRule.Valid (tm : Machine (Fin 2) (Fin 6)) (m : MacroRule) : Prop := + ∀ (l r : ListBlank (Fin 2)), + (cfg_of m.q1 m.d1 (m.l_in +> l) (m.r_in +> r)) [tm]⊢* + (cfg_of m.q2 m.d2 (Runs.toList m.l_out +> l) (Runs.toList m.r_out +> r)) + +abbrev LocalState := Counter.LocalState (Fin 2) (Fin 6) +abbrev step_local := @Counter.step_local (Fin 2) (Fin 6) +abbrev step_local_spec := @Counter.step_local_spec (Fin 2) (Fin 6) _ _ +abbrev run_local := @Counter.run_local (Fin 2) (Fin 6) +abbrev run_local_spec := @Counter.run_local_spec (Fin 2) (Fin 6) _ _ + +theorem check_macro_spec {tm : Machine (Fin 2) (Fin 6)} {n : ℕ} {m : MacroRule} + (h : run_local tm n ⟨m.l_in, m.r_in, m.q1, m.d1⟩ = some ⟨Runs.toList m.l_out, Runs.toList m.r_out, m.q2, m.d2⟩) : + MacroRule.Valid tm m := by + intro L R + exact run_local_spec h L R + +def apply_macro (m : MacroRule) (c : RMConfig) : Option RMConfig := + if c.state == m.q1 then + let z := ql m.d1 c + match Runs.remove_word 16 m.l_in z.left, Runs.remove_word 16 m.r_in z.right with + | some l', some r' => + q3 (Runs.push_runs m.l_out l') (fun l1 => + q3 (Runs.push_runs m.r_out r') (fun r1 => + some ⟨l1, r1, m.q2, m.d2⟩)) + | _, _ => none + else none + +theorem apply_macro_spec {tm : Machine (Fin 2) (Fin 6)} {m : MacroRule} {c c' : RMConfig} + (hv : MacroRule.Valid tm m) (h : apply_macro m c = some c') : + (c.denote) [tm]⊢* (c'.denote) := by + unfold apply_macro at h + split_ifs at h with hq + have hq_eq : c.state = m.q1 := beq_iff_eq.mp hq + rw [← qV m.d1 c] + have hd_z : (ql m.d1 c).dir = m.d1 := qa1 m.d1 c + have hq_z : (ql m.d1 c).state = m.q1 := by rw [qL, hq_eq] + rcases hz : ql m.d1 c with ⟨l, r, qz, dz⟩ + rw [hz] at hd_z hq_z h + dsimp -failIfUnchanged only at hd_z hq_z h + subst hd_z hq_z + cases hl : Runs.remove_word 16 m.l_in l with + | none => rw [hl] at h; contradiction + | some l' => + rw [hl] at h + cases hr : Runs.remove_word 16 m.r_in r with + | none => rw [hr] at h; contradiction + | some r' => + rw [hr] at h + simp only [strictRuns_eq] at h + injection h with hc'; subst hc' + have h_lhs : (RMConfig.mk l r m.q1 m.d1).denote = cfg_of m.q1 m.d1 (m.l_in +> Runs.denote l') (m.r_in +> Runs.denote r') := by + cases m.d1 <;> simp [RMConfig.denote, cfg_of, Counter.cfg_of, Runs.remove_word_spec hl, Runs.remove_word_spec hr] + have h_rhs : (RMConfig.mk (Runs.push_runs m.l_out l') (Runs.push_runs m.r_out r') m.q2 m.d2).denote = + cfg_of m.q2 m.d2 (Runs.toList m.l_out +> Runs.denote l') (Runs.toList m.r_out +> Runs.denote r') := by + cases m.d2 <;> simp [RMConfig.denote, cfg_of, Counter.cfg_of, Runs.push_runs_spec] + rw [h_lhs, h_rhs] + exact hv (Runs.denote l') (Runs.denote r') + +def macro_10 : MacroRule := ⟨D, .right, [0,1,1,0,1], [1,0], D, .left, [], [([0,1,0],1),([1],4)]⟩ +theorem macro_10_valid : MacroRule.Valid qc macro_10 := check_macro_spec (n := 10) (by decide +kernel) + +def macro_20 : MacroRule := ⟨D, .left, [1,0,1,1,0,1,1,0,1,1,0,1], [0], D, .left, [], [([0,1,0],1),([1,1,1,1,1,0,1,1,1,1],1)]⟩ +theorem macro_20_valid : MacroRule.Valid qc macro_20 := check_macro_spec (n := 20) (by decide +kernel) + +def macro_50 : MacroRule := ⟨C, .right, [1,0], [1,1,1,1,0,1,1,1,1,1,1,1], D, .right, [([0],1),([1,1,0,1,1,0,1,1,0,0],1),([1,1,0],1)], []⟩ +theorem macro_50_valid : MacroRule.Valid qc macro_50 := check_macro_spec (n := 50) (by decide +kernel) + +def macro_339 : MacroRule := ⟨D, .left, [1,0,1,1,0,0,1,1,0,1,1,0,1,1,0,0,1,1,0,1,1,0,1,1,0,0,1,1,0,1,1,0,1,1,0,0,1,1,0,1,1,0,1,1,0,0,1,1,0,1,1,0,1,1,0,0,1,1,0,1,0,0,0], [0,1,0], C, .right, [([1],1),([0],1),([1],1)], [([0,1],1),([0,1,1,1,1,1],2),(W,4),([1,1,1,1,0,1,1,1,1],1)]⟩ +theorem macro_339_valid : MacroRule.Valid qc macro_339 := check_macro_spec (n := 339) (by decide +kernel) + +def run_raw_fast (n : ℕ) (c : RMConfig) : Option RMConfig := + if n == 20 then apply_macro macro_20 c + else if n == 50 then apply_macro macro_50 c + else if n == 339 then apply_macro macro_339 c + else if n == 10 then apply_macro macro_10 c + else run_raw qc n c + +theorem run_raw_fast_spec {n : ℕ} {c c' : RMConfig} + (h : run_raw_fast n c = some c') : + (c.denote) [qc]⊢* (c'.denote) := by + unfold run_raw_fast at h + split_ifs at h + · exact apply_macro_spec macro_20_valid h + · exact apply_macro_spec macro_50_valid h + · exact apply_macro_spec macro_339_valid h + · exact apply_macro_spec macro_10_valid h + · exact run_raw_spec h + +def qs_direct (op n : ℕ) (c : RMConfig) : Option RMConfig := + match op with + | 0 => run_raw_fast n c + | 2 => use_scan scan_0 n c + | 3 => use_scan scan_1 n c + | 4 => use_scan scan_2 n c + | 5 => use_scan scan_3 n c + | 6 => use_scan scan_4 n c + | 7 => use_scan scan_5 n c + | 8 => use_scan scan_6 n c + | 9 => use_scan scan_7 n c + | _ => none + +theorem qs_direct_spec {op n : ℕ} {c c' : RMConfig} + (h : qs_direct op n c = some c') : + (c.denote) [qc]⊢* (c'.denote) := by + unfold qs_direct at h + rcases op with _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | op + · exact run_raw_fast_spec h + · contradiction + · exact use_scan_spec scan_0_valid h + · exact use_scan_spec scan_1_valid h + · exact use_scan_spec scan_2_valid h + · exact use_scan_spec scan_3_valid h + · exact use_scan_spec scan_4_valid h + · exact use_scan_spec scan_5_valid h + · exact use_scan_spec scan_6_valid h + · exact use_scan_spec scan_7_valid h + · contradiction + +def qQ_direct (op1 op2 : ℕ) : List (ℕ × ℕ) → RMConfig → Option RMConfig + | [], c => some c + | (n1, n2) :: rest, c => + match qs_direct op1 n1 c with + | some c1 => + match qs_direct op2 n2 c1 with + | some c2 => qQ_direct op1 op2 rest c2 + | none => none + | none => none + +theorem qQ_direct_spec {op1 op2 : ℕ} {ns : List (ℕ × ℕ)} {c c' : RMConfig} + (h : qQ_direct op1 op2 ns c = some c') : + (c.denote) [qc]⊢* (c'.denote) := by + induction ns generalizing c with + | nil => + injection h with heq; subst heq; exact ⟨0, rfl⟩ + | cons p rest ih => + rcases p with ⟨n1, n2⟩ + unfold qQ_direct at h + cases ho1 : qs_direct op1 n1 c with + | none => rw [ho1] at h; contradiction + | some c1 => + rw [ho1] at h; dsimp -failIfUnchanged only at h + cases ho2 : qs_direct op2 n2 c1 with + | none => rw [ho2] at h; contradiction + | some c2 => + rw [ho2] at h; dsimp -failIfUnchanged only at h + exact q0 (qs_direct_spec ho1) (q0 (qs_direct_spec ho2) (ih h)) + +inductive Cmd where + | one (op arg : ℕ) + | rep1 (cnt op arg : ℕ) + | rep2 (cnt op1 arg1 op2 arg2 : ℕ) + | batch (ts : List ℕ) (k : ℕ) (xs : qv) + | scan (op n : ℕ) + | scan2 (op1 op2 : ℕ) (ns : List (ℕ × ℕ)) +def exec_cmd (cmd : Cmd) (c : RMConfig) : Option RMConfig := + match cmd with + | .one op arg => qs op arg c + | .rep1 cnt op arg => qR cnt op arg c + | .rep2 cnt op1 arg1 op2 arg2 => qQ cnt op1 arg1 op2 arg2 c + | .batch ts k xs => qC_many C [1,0,1] ts k xs c + | .scan op n => qs_direct op n c + | .scan2 op1 op2 ns => qQ_direct op1 op2 ns c +theorem exec_cmd_spec {cmd : Cmd} {c c' : RMConfig} + (h : exec_cmd cmd c=some c') : + (c.denote) [qc]⊢* (c'.denote):= by + cases cmd with + | one op arg => exact qp h + | rep1 cnt op arg => exact run_rep1_spec h + | rep2 cnt op1 arg1 op2 arg2 => exact run_rep2_spec h + | batch ts k xs => exact qP_many h + | scan op n => exact qs_direct_spec h + | scan2 op1 op2 ns => exact qQ_direct_spec h +def q6 : List Cmd → RMConfig → Option RMConfig + | [],c => some c + | cmd :: rest,c => + match exec_cmd cmd c with + | some c' => q6 rest c' + | none => none +theorem q1 {cs : List Cmd} {c c' : RMConfig} + (h : q6 cs c=some c') : + (c.denote) [qc]⊢* (c'.denote):= by + induction cs generalizing c with + | nil => + injection h with heq; subst heq; exact ⟨0,rfl⟩ + | cons cmd rest ih => + unfold q6 at h + cases hc : exec_cmd cmd c with + | none => rw [hc] at h; contradiction + | some c₁ => + rw [hc] at h; dsimp -failIfUnchanged only at h + exact q0 (exec_cmd_spec hc) (ih h) +def isHalted (tm : Machine (Fin 2) (Fin 6)) (c : RMConfig) : Bool := + let b:=match c.dir with + | .left => (Runs.pop c.left).1 + | .right => (Runs.pop c.right).1 + (tm c.state b).isNone +theorem isHalted_spec {c : RMConfig} (h : isHalted qc c=true) : + (step qc c.denote).isNone:= by + rcases c with ⟨l,r,q,d⟩ + unfold isHalted at h + cases d + · dsimp -failIfUnchanged only at h + unfold RMConfig.denote step + dsimp -failIfUnchanged only + rw [Runs.pop_spec l,Turing.ListBlank.head_cons] + cases htm : qc q (Runs.pop l).1 with + | none => rfl + | some _ => rw [htm] at h; contradiction + · dsimp -failIfUnchanged only at h + unfold RMConfig.denote step + dsimp -failIfUnchanged only + rw [Runs.pop_spec r,Turing.ListBlank.head_cons] + cases htm : qc q (Runs.pop r).1 with + | none => rfl + | some _ => rw [htm] at h; contradiction +set_option maxHeartbeats 4000000 +def cfg_0 : RMConfig:=⟨[],[],A,.right⟩ +def cfg_1 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],14),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],8),([1],3)],C,.right⟩ +def cfg_2 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],241),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],53),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],5),([1],3)],C,.right⟩ +def cfg_3 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],647),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1107),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],264),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],25),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],15),([1],3)],C,.right⟩ +def cfg_4 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],2447),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],9145),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],5808),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],632),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],57),([1],3)],C,.right⟩ +def cfg_5 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],139729),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],15624),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],40628),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],5261),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],5160),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],524),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],33),([1],3)],C,.right⟩ +def cfg_6 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],839807),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1811737),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1103222),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],232638),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],17301),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1373),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],4512),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],416),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],9),([1],3)],C,.right⟩ +def cfg_7 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],279935),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1492283),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],11819877),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],793479),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],181014),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],8697),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],4223),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],368),([1],3)],C,.right⟩ +def cfg_8 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],13436929),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],7775802),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],5381133),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],652474),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],11679909),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],770151),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],177126),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],8049),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],4115),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],344),([1],3)],C,.right⟩ +def cfg_9 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],451477011),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],21742666),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],16636277),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],57393613),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1208971),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],11528278),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],744879),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],172914),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],7347),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3998),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],318),([1],3)],C,.right⟩ +def cfg_10 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],2734414851),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1842187633),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],126986568),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],229349196),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],52354765),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],369163),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],11388310),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],721551),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],169026),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],6699),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3890),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],294),([1],3)],C,.right⟩ +def cfg_11 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],2902376449),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1988686442),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],15670412907),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1277209393),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],32823528),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],213655356),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],49739125),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],11260007),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],700167),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],165462),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],6105),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3791),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],272),([1],3)],C,.right⟩ +def cfg_12 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],11913785351),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],98528659453),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],43845250986),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],9080552433),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],14474075415),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1077819811),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],207776700),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],48759349),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],11096711),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],672951),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],160926),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],5349),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3665),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],244),([1],3)],C,.right⟩ +def cfg_13 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],626913312769),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],243867188622),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],13026910521),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],65876924410),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],38403295146),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],8173559793),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],14322909975),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1052625571),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],203577660),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],48059509),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],10980071),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],653511),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],157686),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],4809),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3575),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],224),([1],3)],C,.right⟩ +def cfg_14 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],17145729646246),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],505981945839),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1037065005185),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2777645236624),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],23429668859),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],31328752554),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],6994469361),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],14126394903),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1019873059),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],198118908),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],47149717),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],10828439),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],628239),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],153474),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],4107),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3458),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],198),([1],3)],C,.right⟩ +def cfg_15 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],90752743557389),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],110070725690864),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],37325785004977),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],5644560578121),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],9105470814445),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],118673488085),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2624579983774),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],25342601129),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],5996777457),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],13960112919),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],992159395),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],193499964),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],46379893),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],10700135),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],606855),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],149910),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3513),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3359),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],176),([1],3)],C,.right⟩ +def cfg_16 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],4592766929338371),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],123825256253571),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],306313064936501),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],364891287778978),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],6795949950050),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],556254735633),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],8257419840697),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2582132728221),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],18268058537),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],4817687025),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],13763597847),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],959406883),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],188041212),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],45470101),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],10548503),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],581583),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],145698),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2811),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3242),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],150),([1],3)],C,.right⟩ +def cfg_17 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],4874877920083969),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],25556429845487524),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1709142197372564),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3068205663580327),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],155407234188137),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],339740315987584),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2604121318151),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],8022327348409),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2542950646173),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],11737711529),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3729295857),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],13582199319),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],929173795),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],183002364),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],44630293),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],10408535),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],558255),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],141810),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2163),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3134),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],126),([1],3)],C,.right⟩ +def cfg_18 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],22993523763921719),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],51981972515675869),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],146293703117781586),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],15182639638593206),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2763525793575078),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],104627255853929),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],331276986265216),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1193566364423),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],7787234856121),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2503768564125),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],5207364521),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2640904689),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],13400800791),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],898940707),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],177963516),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],43790485),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],10268567),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],534927),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],137922),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1515),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3026),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],102),([1],3)],C,.right⟩ +def cfg_19 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],29249267520503809),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],813965834913967086),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],604654236871710051),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],137176979921917522),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],13663185772615862),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2510283482578854),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],62420204021225),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],324242477626432),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],21148257959),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],7591831838377),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2471201394501),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1552513520),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],13219402263),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],868707619),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],172924668),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],42950677),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],10128599),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],511599),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],134034),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],867),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2918),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],78),([1],3)],C,.right⟩ +def cfg_20 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],227527202966565959),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],878274055253804511),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],22084482590786306),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],798063893976589425),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],602003913382147107),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],136735259340323698),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],13589565675683558),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2498013466423470),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],60375201328661),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],323901643844338),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],7552649756328),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2464671047493),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],464122352),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],13038003735),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],838474531),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],167885820),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],42110869),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],9988631),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],488271),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],130146),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],219),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2810),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],54),([1],3)],C,.right⟩ +def cfg_21 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],5768519355599781893),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],327824879050489010),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1568295479115420465),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],21594293168954344),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],739226421390733018),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],793293023825066099),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],601208768356893219),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],136602735169448050),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],13567478313870950),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2494332239454702),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],59761663500533),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],323799387539650),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],7535607038880),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2461830594585),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],12951363545),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],824034499),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],165479148),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],41709757),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],9921779),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],477129),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],128289),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2684),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],26),([1],3)],C,.right⟩ +def cfg_22 : RMConfig:=⟨[([1],1),([0],1),([1,1,0,1,1,0,1,1,0,0],2564),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],127569),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],472809),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],9895859),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],41554237),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],164546028),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],818435779),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],12917771225),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],2461629040665),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],7534397715360),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],323792131598530),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],59718127853813),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],2494071025574382),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],13565911030589030),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],136593331469756530),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],601152346158744099),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],792954490636171379),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],737195222257364698),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],9407098368744424),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],1495172310314160944),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],3690655947539779712),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],34650830869133740991),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],575691254228742226),([1,1,0],4),([1,1,0,1,1,0,1,1,0,0],4738381338321616897),([1,1,0],1),([1],1)],[([0],2),([1],1),([0],1),([1],5)],F,.left⟩ +def cmds_0 : List Cmd:=[ + .scan 0 84, + .batch [1] 0 [(.D0,0)], + .scan 0 120, + .batch [1] 0 [(.D0,0)], + .scan 0 149, + .batch [1] 0 [(.D0,0)], + .batch [1] 1 [(.D2,0)], + .scan 0 35, + .scan 9 4, + .scan 0 109, + .batch [1] 0 [(.D0,0)], + .batch [1] 2 [(.D2,0)], + .scan 0 58, + .scan 9 4, + .scan 0 2, + .scan 8 3, + .scan 0 131, + .batch [1] 0 [(.D0,0)], + .batch [3] 1 [(.D2,2)], + .scan 0 58, + .scan 9 6, + .scan 0 95, + .scan 7 4, + .scan 0 157, + .batch [1] 0 [(.D0,0)], + .batch [3] 3 [(.D0,1)], + .scan 0 50, + .scan 5 3, + .scan 9 3, + .scan 0 2, + .scan 8 3, + .scan 0 323, + .batch [1] 0 [(.D0,0)], + .batch [1] 5 [(.D2,0)], + .scan 0 50, + .scan 5 4, + .scan 0 32, + .scan 8 3, + .scan 0 281, + .batch [1] 0 [(.D0,0)], + .batch [3] 1 [(.D2,5)], + .scan 0 58, + .scan 9 6, + .scan 5 3, + .scan 0 29, + .scan 2 4, + .scan 6 3, + .scan 0 151, + .batch [1] 0 [(.D0,0)], + .batch [5] 3 [(.D0,4)], + .scan 0 50, + .scan 5 4, + .scan 9 4, + .scan 0 166, + .scan 7 4, + .scan 0 289, + .batch [1] 0 [(.D0,0)], + .batch [17,2,2,2] 1 [(.D2,5),(.D0,2)], + .batch [2] 12 [(.D1,1)], + .scan 0 50, + .scan 5 12, + .scan 9 3, + .scan 0 2, + .scan 8 3, + .scan 4 6, + .scan 0 569, + .batch [1] 0 [(.D0,0)], + .batch [1] 14 [(.D2,0)], + .scan 0 50, + .scan 5 13, + .scan 0 32, + .scan 8 3, + .scan 0 42, + .scan 3 7, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [3] 1 [(.D2,14)], + .scan 0 58, + .scan 9 6, + .scan 5 12, + .scan 0 29, + .scan 2 13, + .scan 6 3, + .scan 0 151, + .batch [1] 0 [(.D0,0)], + .batch [5] 3 [(.D0,13)], + .scan 0 50, + .scan 5 4, + .scan 9 4, + .scan 5 11, + .scan 0 10, + .scan 3 11, + .scan 0 309, + .batch [1] 0 [(.D0,0)], + .batch [17,2,2,2] 1 [(.D2,5),(.D0,11)], + .batch [4] 12 [(.D1,10)] +] +theorem chunk_0_ok : q6 cmds_0 cfg_0=some cfg_1:= by decide +kernel +def cmds_1 : List Cmd:=[ + .scan 0 50, + .scan 5 13, + .scan 9 4, + .scan 5 8, + .scan 0 10, + .scan 3 8, + .scan 0 20, + .scan 3 8, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [33] 1 [(.D2,14),(.D0,8)], + .scan 0 50, + .scan2 5 9 [(16,4),(5,4)], + .scan 5 6, + .scan 0 10, + .scan2 3 0 [(6,20),(5,20)], + .scan 3 11, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [53,12,2,2,2] 1 [(.D2,17),(.D0,6),(.D0,6)], + .batch [2] 36 [(.D1,1)], + .batch [4,4] 37 [(.D5,1),(.D1,6)], + .scan 0 50, + .scan 5 40, + .scan 9 4, + .scan 5 5, + .scan 0 10, + .scan 3 5, + .scan 0 20, + .scan 3 35, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [33] 1 [(.D2,41),(.D0,5)], + .scan 0 50, + .scan2 5 9 [(16,4),(32,4)], + .scan 5 3, + .scan 0 10, + .scan2 3 0 [(3,20),(32,20)], + .scan 3 11, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [53,12,2,2,2] 1 [(.D2,17),(.D0,33),(.D0,3)], + .batch [2] 36 [(.D1,1)], + .batch [24] 37 [(.D5,28),(.D1,3)], + .scan 0 50, + .scan2 5 9 [(48,4),(22,4)], + .scan 0 78, + .scan 7 4, + .scan 3 22, + .scan 0 20, + .scan 3 43, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [141] 1 [(.D2,49),(.D0,23),(.D0,1)], + .scan 0 50, + .scan2 5 9 [(70,4),(13,4),(16,3)], + .scan 0 2, + .scan 8 3, + .scan 4 16, + .scan 0 18, + .scan 2 13, + .scan 6 3, + .scan 0 72, + .scan 2 64, + .scan 0 489, + .batch [1] 0 [(.D0,0)], + .batch [43,8,4] 72 [(.D0,14),(.D0,17),(.D2,0)], + .scan 0 50, + .scan 5 98, + .scan 9 4, + .scan 5 14, + .scan 0 32, + .scan 8 3, + .scan 0 42, + .scan 3 13, + .scan 0 20, + .scan 3 93, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [33] 1 [(.D2,99),(.D0,15)], + .scan 0 50, + .scan2 5 9 [(16,4),(90,4)], + .scan 5 12, + .scan 0 29, + .scan 2 13, + .scan 6 3, + .scan 0 72, + .scan 2 89, + .scan 6 3, + .scan 0 72, + .scan 2 10, + .scan 0 489, + .batch [1] 0 [(.D0,0)], + .batch [35] 18 [(.D0,91),(.D0,13)], + .scan 0 50, + .scan2 5 9 [(34,4),(81,4)], + .scan 5 11, + .scan 0 10, + .scan2 3 0 [(11,20),(81,20)], + .scan 3 29, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [107,26,6,2,2] 1 [(.D2,35),(.D0,82),(.D0,11)], + .batch [2] 72 [(.D1,1)], + .batch [12] 73 [(.D5,74),(.D3,10)], + .scan 0 50, + .scan2 5 9 [(78,4),(71,4)], + .scan 5 9, + .scan 0 10, + .scan2 3 0 [(9,20),(71,20)], + .scan 3 73, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [213] 1 [(.D2,79),(.D0,72),(.D0,9)], + .scan 0 50, + .scan2 5 9 [(106,4),(25,4),(62,4)], + .scan 5 7, + .scan 0 10, + .scan2 3 0 [(7,20),(62,20),(25,20)], + .scan 3 101, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [323,80,18,6,2,2] 1 [(.D2,107),(.D0,26),(.D0,63),(.D0,7)], + .batch [2] 216 [(.D1,1)], + .batch [20,6,2] 217 [(.D5,6),(.D5,59),(.D1,7)], + .batch [2] 231 [(.D1,1)], + .batch [18] 232 [(.D5,58),(.D2,6)] +] +theorem chunk_1_ok : q6 cmds_1 cfg_1=some cfg_2:= by decide +kernel +def cmds_2 : List Cmd:=[ + .scan 0 50, + .scan2 5 9 [(240,4),(53,4)], + .scan 5 5, + .scan 0 10, + .scan2 3 0 [(5,20),(53,20)], + .scan 3 235, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [213] 1 [(.D2,241),(.D0,54),(.D0,5)], + .scan 0 50, + .scan2 5 9 [(106,4),(187,4),(44,4)], + .scan 5 3, + .scan 0 10, + .scan2 3 0 [(3,20),(44,20),(187,20)], + .scan 3 101, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [323,80,18,6,2,2] 1 [(.D2,107),(.D0,188),(.D0,45),(.D0,3)], + .batch [2] 216 [(.D1,1)], + .batch [144] 217 [(.D5,168),(.D5,41),(.D1,3)], + .scan 0 50, + .scan2 5 9 [(288,4),(132,4),(35,4)], + .scan 0 78, + .scan 7 4, + .scan2 3 0 [(35,20),(132,20)], + .scan 3 283, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [861] 1 [(.D2,289),(.D0,133),(.D0,36),(.D0,1)], + .scan 0 50, + .scan2 5 9 [(430,4),(73,4),(96,4),(29,3)], + .scan 0 2, + .scan 8 3, + .scan 4 29, + .scan 0 18, + .scan 2 96, + .scan 6 3, + .scan 0 72, + .scan 2 72, + .scan 6 3, + .scan 0 72, + .scan 2 424, + .scan 0 489, + .batch [1] 0 [(.D0,0)], + .batch [223,54,14,4,20] 432 [(.D0,74),(.D0,97),(.D0,30),(.D2,0)], + .scan 0 50, + .scan2 5 9 [(588,4),(79,4)], + .scan 5 26, + .scan 0 32, + .scan 8 3, + .scan 0 42, + .scan2 3 0 [(25,20),(79,20)], + .scan 3 583, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [213] 1 [(.D2,589),(.D0,80),(.D0,27)], + .scan 0 50, + .scan2 5 9 [(106,4),(535,4),(70,4)], + .scan 5 24, + .scan 0 29, + .scan 2 25, + .scan 6 3, + .scan 0 72, + .scan 2 69, + .scan 6 3, + .scan 0 72, + .scan 2 534, + .scan 6 3, + .scan 0 72, + .scan 2 100, + .scan 0 489, + .batch [1] 0 [(.D0,0)], + .batch [215] 108 [(.D0,536),(.D0,71),(.D0,25)], + .scan 0 50, + .scan2 5 9 [(214,4),(481,4),(61,4)], + .scan 5 23, + .scan 0 10, + .scan2 3 0 [(23,20),(61,20),(481,20)], + .scan 3 209, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [647,162,38,10,2,2,2] 1 [(.D2,215),(.D0,482),(.D0,62),(.D0,23)], + .batch [2] 432 [(.D1,1)], + .batch [72] 433 [(.D5,444),(.D5,55),(.D3,22)], + .scan 0 50, + .scan2 5 9 [(468,4),(426,4),(52,4)], + .scan 5 21, + .scan 0 10, + .scan2 3 0 [(21,20),(52,20),(426,20)], + .scan 3 463, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1293] 1 [(.D2,469),(.D0,427),(.D0,53),(.D0,21)], + .scan 0 50, + .scan2 5 9 [(646,4),(145,4),(372,4),(43,4)], + .scan 5 19, + .scan 0 10, + .scan2 3 0 [(19,20),(43,20),(372,20),(145,20)], + .scan 3 641, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1943,486,120,30,8,2,2] 1 [(.D2,647),(.D0,146),(.D0,373),(.D0,44),(.D0,19)], + .batch [2] 1296 [(.D1,1)], + .batch [110,30,6,2] 1297 [(.D5,36),(.D5,354),(.D5,40),(.D1,19)], + .batch [2] 1371 [(.D1,1)], + .batch [118] 1372 [(.D1,349),(.D4,39),(.D2,18)], + .scan 0 50, + .scan2 5 9 [(1430,4),(318,4),(34,4)], + .scan 5 17, + .scan 0 10, + .scan2 3 0 [(17,20),(34,20),(318,20)], + .scan 3 1425, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1293] 1 [(.D2,1431),(.D0,319),(.D0,35),(.D0,17)] +] +theorem chunk_2_ok : q6 cmds_2 cfg_2=some cfg_3:= by decide +kernel +def cmds_3 : List Cmd:=[ + .scan 0 50, + .scan2 5 9 [(646,4),(1107,4),(264,4),(25,4)], + .scan 5 15, + .scan 0 10, + .scan2 3 0 [(15,20),(25,20),(264,20),(1107,20)], + .scan 3 641, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1943,486,120,30,8,2,2] 1 [(.D2,647),(.D0,1108),(.D0,265),(.D0,26),(.D0,15)], + .batch [2] 1296 [(.D1,1)], + .batch [864] 1297 [(.D5,998),(.D5,246),(.D5,22),(.D1,15)], + .scan 0 50, + .scan2 5 9 [(1728,4),(782,4),(210,4),(16,4)], + .scan 5 13, + .scan 0 10, + .scan2 3 0 [(13,20),(16,20),(210,20),(782,20)], + .scan 3 1723, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [5189,1296,324,80,22,6,140] 1 [(.D2,1729),(.D0,783),(.D0,211),(.D0,17),(.D0,13)], + .scan 0 50, + .scan2 5 9 [(3528,4),(459,4),(156,4),(7,4)], + .scan 5 11, + .scan 0 10, + .scan2 3 0 [(11,20),(7,20),(156,20),(459,20)], + .scan 3 3523, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [5613,1296,432,432] 1 [(.D2,3529),(.D0,460),(.D0,157),(.D0,8),(.D0,11)], + .batch [864] 3887 [(.D5,1585),(.D5,135),(.D5,102),(.D1,9)], + .scan 0 50, + .scan2 5 9 [(4318,4),(1369,4),(99,4),(96,4)], + .scan 5 7, + .scan 0 10, + .scan2 3 0 [(7,20),(96,20),(99,20),(1369,20)], + .scan 3 4313, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [7773] 1 [(.D2,4319),(.D0,1370),(.D0,100),(.D0,97),(.D0,7)], + .scan 0 50, + .scan2 5 9 [(3886,4),(2375,4),(1045,4),(45,4),(87,4)], + .scan 5 5, + .scan 0 10, + .scan2 3 0 [(5,20),(87,20),(45,20),(1045,20),(2375,20)], + .scan 3 3881, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [11663,2916,728,180,46,12,2,2,2] 1 [(.D2,3887),(.D0,2376),(.D0,1046),(.D0,46),(.D0,88),(.D0,5)], + .batch [2] 7776 [(.D1,1)], + .batch [2952,792,216,72] 7777 [(.D5,1726),(.D5,937),(.D5,27),(.D5,84),(.D1,5)], + .batch [72] 9793 [(.D5,718),(.D5,769),(.D1,1)], + .batch [144] 9829 [(.D5,700),(.D5,766),(.D1,80),(.D5,3)], + .scan 0 50, + .scan2 5 9 [(9900,4),(664,4),(760,4),(78,4)], + .scan 5 3, + .scan 0 10, + .scan2 3 0 [(3,20),(78,20),(760,20),(664,20)], + .scan 3 9895, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [7773] 1 [(.D2,9901),(.D0,665),(.D0,761),(.D0,79),(.D0,3)], + .scan 0 50, + .scan2 5 9 [(3886,4),(7957,4),(340,4),(706,4),(69,4)], + .scan 0 78, + .scan 7 4, + .scan2 3 0 [(69,20),(706,20),(340,20),(7957,20)], + .scan 3 3881, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [11663,2916,728,180,46,12,2,2,2] 1 [(.D2,3887),(.D0,7958),(.D0,341),(.D0,707),(.D0,70),(.D0,1)], + .batch [2] 7776 [(.D1,1)], + .batch [2592] 7777 [(.D5,7308),(.D5,232),(.D5,688),(.D5,66),(.D1,1)], + .scan 0 50, + .scan2 5 9 [(9072,4),(6660,4),(124,4),(670,4),(63,3)], + .scan 0 2, + .scan 8 3, + .scan 4 63, + .scan 0 18, + .scan 2 670, + .scan 6 3, + .scan 0 72, + .scan 2 123, + .scan 6 3, + .scan 0 72, + .scan 2 6659, + .scan 6 3, + .scan 0 72, + .scan 2 9066, + .scan 0 489, + .batch [1] 0 [(.D0,0)], + .batch [2255,336] 9074 [(.D0,6661),(.D0,125),(.D0,671),(.D0,64),(.D2,0)], + .scan 0 50, + .scan2 5 9 [(10368,4),(6012,4),(16,4),(652,4)], + .scan 5 60, + .scan 0 32, + .scan 8 3, + .scan 0 42, + .scan2 3 0 [(59,20),(652,20),(16,20),(6012,20)], + .scan 3 10363, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1869,432,144,72,72] 1 [(.D2,10369),(.D0,6013),(.D0,17),(.D0,653),(.D0,61)], + .batch [1008] 1295 [(.D5,9721),(.D5,5904),(.D1,649),(.D1,61)], + .scan 0 50, + .scan2 5 9 [(1798,4),(9469,4),(5862,4),(641,4)], + .scan 5 58, + .scan 0 29, + .scan 2 59, + .scan 6 3, + .scan 0 72, + .scan 2 640, + .scan 6 3, + .scan 0 72, + .scan 2 5861, + .scan 6 3, + .scan 0 72, + .scan 2 9468, + .scan 6 3, + .scan 0 72, + .scan 2 1792, + .scan 0 489, + .batch [1] 0 [(.D0,0)], + .batch [1295] 1800 [(.D0,9470),(.D0,5863),(.D0,642),(.D0,59)] +] +theorem chunk_3_ok : q6 cmds_3 cfg_3=some cfg_4:= by decide +kernel +def cmds_4 : List Cmd:=[ + .scan 0 50, + .scan2 5 9 [(2446,4),(9145,4),(5808,4),(632,4)], + .scan 5 57, + .scan 0 10, + .scan2 3 0 [(57,20),(632,20),(5808,20),(9145,20)], + .scan 3 2441, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [7343,430] 1 [(.D2,2447),(.D0,9146),(.D0,5809),(.D0,633),(.D0,57)], + .scan 0 50, + .scan2 5 9 [(3886,4),(503,4),(8821,4),(5754,4),(623,4)], + .scan 5 55, + .scan 0 10, + .scan2 3 0 [(55,20),(623,20),(5754,20),(8821,20),(503,20)], + .scan 3 3881, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [9081,2268,552,144,36,12,12] 1 [(.D2,3887),(.D0,504),(.D0,8822),(.D0,5755),(.D0,624),(.D0,55)], + .batch [12] 6053 [(.D5,860),(.D1,1)], + .batch [2572,646,162,38,10,2,384] 6059 [(.D5,857),(.D5,8736),(.D1,5741),(.D3,621),(.D1,55)], + .scan 0 50, + .scan2 5 9 [(7965,4),(8498,4),(5700,4),(614,4)], + .scan 5 53, + .scan 0 10, + .scan2 3 0 [(53,20),(614,20),(5700,20),(8498,20)], + .scan 3 7960, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [7773] 1 [(.D2,7966),(.D0,8499),(.D0,5701),(.D0,615),(.D0,53)], + .scan 0 50, + .scan2 5 9 [(3886,4),(6022,4),(8174,4),(5646,4),(605,4)], + .scan 5 51, + .scan 0 10, + .scan2 3 0 [(51,20),(605,20),(5646,20),(8174,20),(6022,20)], + .scan 3 3881, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [11663,2916,728,180,46,12,2,2,2] 1 [(.D2,3887),(.D0,6023),(.D0,8175),(.D0,5647),(.D0,606),(.D0,51)], + .batch [2] 7776 [(.D1,1)], + .batch [5184] 7777 [(.D5,5373),(.D5,8066),(.D5,5628),(.D5,602),(.D1,51)], + .scan 0 50, + .scan2 5 9 [(10368,4),(4077,4),(7850,4),(5592,4),(596,4)], + .scan 5 49, + .scan 0 10, + .scan2 3 0 [(49,20),(596,20),(5592,20),(7850,20),(4077,20)], + .scan 3 10363, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [31109,7776,1944,486,122,30,6,4,860] 1 [(.D2,10369),(.D0,4078),(.D0,7851),(.D0,5593),(.D0,597),(.D0,49)], + .scan 0 50, + .scan2 5 9 [(21168,4),(2134,4),(7526,4),(5538,4),(587,4)], + .scan 5 47, + .scan 0 10, + .scan2 3 0 [(47,20),(587,20),(5538,20),(7526,20),(2134,20)], + .scan 3 21163, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [38433,8220] 1 [(.D2,21169),(.D0,2135),(.D0,7527),(.D0,5539),(.D0,588),(.D0,47)], + .scan 0 50, + .scan2 5 9 [(23326,4),(9505,4),(190,4),(7202,4),(5484,4),(578,4)], + .scan 5 45, + .scan 0 10, + .scan2 3 0 [(45,20),(578,20),(5484,20),(7202,20),(190,20),(9505,20)], + .scan 3 23321, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [20661,5112,1296,288,144] 1 [(.D2,23327),(.D0,9506),(.D0,191),(.D0,7203),(.D0,5485),(.D0,579)], + .batch [41976] 13751 [(.D5,16451),(.D5,8359),(.D3,7171),(.D3,5479),(.D3,578),(.D0,45)], + .scan 0 50, + .scan2 5 9 [(34738,4),(5957,4),(6610,4),(6879,4),(5430,4),(569,4)], + .scan 5 43, + .scan 0 10, + .scan2 3 0 [(43,20),(569,20),(5430,20),(6879,20),(6610,20),(5957,20)], + .scan 3 34733, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [104219,26054,6514,1628,406,102,26,6,2,2] 1 [(.D2,34739),(.D0,5958),(.D0,6611),(.D0,6880),(.D0,5431),(.D0,570),(.D0,43)], + .batch [2] 69480 [(.D1,1)], + .batch [500,126,32,6,4,2,2] 69481 [(.D5,166),(.D1,5646),(.D1,6719),(.D5,5403),(.D5,565),(.D2,42)], + .batch [3808] 69817 [(.D1,5617),(.D1,6715),(.D2,5403),(.D0,565),(.D3,42)], + .scan 0 50, + .scan2 5 9 [(71720,4),(4664,4),(6555,4),(5376,4),(560,4)], + .scan 5 41, + .scan 0 10, + .scan2 3 0 [(41,20),(560,20),(5376,20),(6555,20),(4664,20)], + .scan 3 71715, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [46653] 1 [(.D2,71721),(.D0,4665),(.D0,6556),(.D0,5377),(.D0,561),(.D0,41)], + .scan 0 50, + .scan2 5 9 [(23326,4),(60057,4),(2720,4),(6231,4),(5322,4),(551,4)], + .scan 5 39, + .scan 0 10, + .scan2 3 0 [(39,20),(551,20),(5322,20),(6231,20),(2720,20),(60057,20)], + .scan 3 23321, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [69983,17496,4374,1092,272,70,18,2,2,2] 1 [(.D2,23327),(.D0,60058),(.D0,2721),(.D0,6232),(.D0,5323),(.D0,552),(.D0,39)], + .batch [2] 46656 [(.D1,1)], + .batch [31104] 46657 [(.D5,56168),(.D5,2072),(.D5,6123),(.D5,5304),(.D5,548),(.D1,39)], + .scan 0 50, + .scan2 5 9 [(62208,4),(48392,4),(776,4),(5907,4),(5268,4),(542,4)], + .scan 5 37, + .scan 0 10, + .scan2 3 0 [(37,20),(542,20),(5268,20),(5907,20),(776,20),(48392,20)], + .scan 3 62203, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [83949,20952,5184,1296,360,72,27864] 1 [(.D2,62209),(.D0,48393),(.D0,777),(.D0,5908),(.D0,5269),(.D0,543),(.D0,37)], + .scan 0 50, + .scan2 5 9 [(69838,4),(27289,4),(42572,4),(5585,4),(5214,4),(533,4)], + .scan 5 35, + .scan 0 10, + .scan2 3 0 [(35,20),(533,20),(5214,20),(5585,20),(42572,20),(27289,20)], + .scan 3 69833, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [209519,52380,13094,3274,818,204,52,12,2,2,2] 1 [(.D2,69839),(.D0,27290),(.D0,42573),(.D0,5586),(.D0,5215),(.D0,534),(.D0,35)], + .batch [2] 139680 [(.D1,1)], + .batch [96] 139681 [(.D5,15648),(.D1,40633),(.D3,5262),(.D5,5160),(.D5,524),(.D5,33)] +] +theorem chunk_4_ok : q6 cmds_4 cfg_4=some cfg_5:= by decide +kernel +def cmds_5 : List Cmd:=[ + .scan 0 50, + .scan2 5 9 [(139728,4),(15624,4),(40628,4),(5261,4),(5160,4),(524,4)], + .scan 5 33, + .scan 0 10, + .scan2 3 0 [(33,20),(524,20),(5160,20),(5261,20),(40628,20),(15624,20)], + .scan 3 139723, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [279933] 1 [(.D2,139729),(.D0,15625),(.D0,40629),(.D0,5262),(.D0,5161),(.D0,525),(.D0,33)], + .scan 0 50, + .scan2 5 9 [(139966,4),(69745,4),(3960,4),(38684,4),(4937,4),(5106,4),(515,4)], + .scan 5 31, + .scan 0 10, + .scan2 3 0 [(31,20),(515,20),(5106,20),(4937,20),(38684,20),(3960,20),(69745,20)], + .scan 3 139961, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [419903,104976,26244,6560,1638,412,102,26,6,2,2] 1 [(.D2,139967),(.D0,69746),(.D0,3961),(.D0,38685),(.D0,4938),(.D0,5107),(.D0,516),(.D0,31)], + .batch [2] 279936 [(.D1,1)], + .batch [1308,336,72,24,12] 279937 [(.D5,46416),(.D5,72),(.D5,38036),(.D5,4829),(.D5,5088),(.D5,512),(.D1,31)], + .batch [12] 280813 [(.D5,45978),(.D1,1)], + .batch [30804] 280819 [(.D5,45975),(.D1,38025),(.D2,4827),(.D1,5089),(.D0,513),(.D2,30)], + .scan 0 50, + .scan2 5 9 [(296220,4),(38274,4),(36740,4),(4613,4),(5052,4),(506,4)], + .scan 5 29, + .scan 0 10, + .scan2 3 0 [(29,20),(506,20),(5052,20),(4613,20),(36740,20),(38274,20)], + .scan 3 296215, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [279933] 1 [(.D2,296221),(.D0,38275),(.D0,36741),(.D0,4614),(.D0,5053),(.D0,507),(.D0,29)], + .scan 0 50, + .scan2 5 9 [(139966,4),(226237,4),(26610,4),(34796,4),(4289,4),(4998,4),(497,4)], + .scan 5 27, + .scan 0 10, + .scan2 3 0 [(27,20),(497,20),(4998,20),(4289,20),(34796,20),(26610,20),(226237,20)], + .scan 3 139961, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [419903,104976,26244,6560,1638,412,102,26,6,2,2] 1 [(.D2,139967),(.D0,226238),(.D0,26611),(.D0,34797),(.D0,4290),(.D0,4999),(.D0,498),(.D0,27)], + .batch [2] 279936 [(.D1,1)], + .batch [186624] 279937 [(.D5,202908),(.D5,22722),(.D5,34148),(.D5,4181),(.D5,4980),(.D5,494),(.D1,27)], + .scan 0 50, + .scan2 5 9 [(373248,4),(156252,4),(14946,4),(32852,4),(3965,4),(4944,4),(488,4)], + .scan 5 25, + .scan 0 10, + .scan2 3 0 [(25,20),(488,20),(4944,20),(3965,20),(32852,20),(14946,20),(156252,20)], + .scan 3 373243, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1119749,279936,69984,17496,4374,1094,274,68,16,6,31100] 1 [(.D2,373249),(.D0,156253),(.D0,14947),(.D0,32853),(.D0,3966),(.D0,4945),(.D0,489),(.D0,25)], + .scan 0 50, + .scan2 5 9 [(762048,4),(86269,4),(3282,4),(30908,4),(3641,4),(4890,4),(479,4)], + .scan 5 23, + .scan 0 10, + .scan2 3 0 [(23,20),(479,20),(4890,20),(3641,20),(30908,20),(3282,20),(86269,20)], + .scan 3 762043, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [354597,88560,22176,5616,1368,360,72] 1 [(.D2,762049),(.D0,86270),(.D0,3283),(.D0,30909),(.D0,3642),(.D0,4891),(.D0,480),(.D0,23)], + .batch [72] 236375 [(.D5,643861),(.D5,66571),(.D1,1)], + .batch [201096] 236411 [(.D5,643843),(.D5,66568),(.D5,30361),(.D4,3550),(.D0,4876),(.D4,476),(.D1,23)], + .scan 0 50, + .scan2 5 9 [(336958,4),(593569,4),(58189,4),(28964,4),(3317,4),(4836,4),(470,4)], + .scan 5 21, + .scan 0 10, + .scan2 3 0 [(21,20),(470,20),(4836,20),(3317,20),(28964,20),(58189,20),(593569,20)], + .scan 3 336953, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1010879,252720,63180,15794,3948,988,246,62,16,2,2,2] 1 [(.D2,336959),(.D0,593570),(.D0,58190),(.D0,28965),(.D0,3318),(.D0,4837),(.D0,471),(.D0,21)], + .batch [2] 673920 [(.D1,1)], + .batch [55296] 673921 [(.D5,537408),(.D5,48829),(.D5,27404),(.D1,3058),(.D5,4793),(.D4,463),(.D4,19)], + .scan 0 50, + .scan2 5 9 [(701568,4),(523584,4),(46525,4),(27020,4),(2993,4),(4782,4),(461,4)], + .scan 5 19, + .scan 0 10, + .scan2 3 0 [(19,20),(461,20),(4782,20),(2993,20),(27020,20),(46525,20),(523584,20)], + .scan 3 701563, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1679613] 1 [(.D2,701569),(.D0,523585),(.D0,46526),(.D0,27021),(.D0,2994),(.D0,4783),(.D0,462),(.D0,19)], + .scan 0 50, + .scan2 5 9 [(839806,4),(281665,4),(453600,4),(34861,4),(25076,4),(2669,4),(4728,4),(452,4)], + .scan 5 17, + .scan 0 10, + .scan2 3 0 [(17,20),(452,20),(4728,20),(2669,20),(25076,20),(34861,20),(453600,20),(281665,20)], + .scan 3 839801, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [2519423,629856,157464,39366,9840,2460,614,154,38,10,2,2,2] 1 [(.D2,839807),(.D0,281666),(.D0,453601),(.D0,34862),(.D0,25077),(.D0,2670),(.D0,4729),(.D0,453),(.D0,17)], + .batch [2] 1679616 [(.D1,1)], + .batch [425090,106274,26568,6642,1660,416,102,28,6,2] 1679617 [(.D5,141696),(.D5,430272),(.D5,30973),(.D5,24428),(.D5,2561),(.D5,4710),(.D5,449),(.D1,17)], + .batch [2] 1963011 [(.D1,1)], + .batch [92158] 1963012 [(.D1,406657),(.D0,27038),(.D2,23772),(.D5,2452),(.D0,4693),(.D0,447),(.D4,15)], + .scan 0 50, + .scan2 5 9 [(2009090,4),(383616,4),(23197,4),(23132,4),(2345,4),(4674,4),(443,4)], + .scan 5 15, + .scan 0 10, + .scan2 3 0 [(15,20),(443,20),(4674,20),(2345,20),(23132,20),(23197,20),(383616,20)], + .scan 3 2009085, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1679613] 1 [(.D2,2009091),(.D0,383617),(.D0,23198),(.D0,23133),(.D0,2346),(.D0,4675),(.D0,444),(.D0,15)], + .scan 0 50, + .scan2 5 9 [(839806,4),(1589187,4),(313632,4),(11533,4),(21188,4),(2021,4),(4620,4),(434,4)], + .scan 5 13, + .scan 0 10, + .scan2 3 0 [(13,20),(434,20),(4620,20),(2021,20),(21188,20),(11533,20),(313632,20),(1589187,20)], + .scan 3 839801, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [2519423,629856,157464,39366,9840,2460,614,154,38,10,2,2,2] 1 [(.D2,839807),(.D0,1589188),(.D0,313633),(.D0,11534),(.D0,21189),(.D0,2022),(.D0,4621),(.D0,435),(.D0,13)], + .batch [2] 1679616 [(.D1,1)], + .batch [825696,206496,51624,12888,3240,864,216,3024] 1679617 [(.D5,1449218),(.D5,290304),(.D5,7645),(.D5,20540),(.D5,1913),(.D5,4602),(.D5,431),(.D1,13)], + .scan 0 50, + .scan2 5 9 [(2231640,4),(1173206,4),(244302,4),(19245,4),(1697,4),(4566,4),(425,4)], + .scan 5 11, + .scan 0 10, + .scan2 3 0 [(11,20),(425,20),(4566,20),(1697,20),(19245,20),(244302,20),(1173206,20)], + .scan 3 2231635, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1679613] 1 [(.D2,2231641),(.D0,1173207),(.D0,244303),(.D0,19246),(.D0,1698),(.D0,4567),(.D0,426),(.D0,11)] +] +theorem chunk_5_ok : q6 cmds_5 cfg_5=some cfg_6:= by decide +kernel +def cmds_6 : List Cmd:=[ + .scan 0 50, + .scan2 5 9 [(839806,4),(1811737,4),(1103222,4),(232638,4),(17301,4),(1373,4),(4512,4),(416,4)], + .scan 5 9, + .scan 0 10, + .scan2 3 0 [(9,20),(416,20),(4512,20),(1373,20),(17301,20),(232638,20),(1103222,20),(1811737,20)], + .scan 3 839801, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [2519423,629856,157464,39366,9840,2460,614,154,38,10,2,2,2] 1 [(.D2,839807),(.D0,1811738),(.D0,1103223),(.D0,232639),(.D0,17302),(.D0,1374),(.D0,4513),(.D0,417),(.D0,9)], + .batch [2] 1679616 [(.D1,1)], + .batch [1119744] 1679617 [(.D5,1671768),(.D5,1079894),(.D5,228750),(.D5,16653),(.D5,1265),(.D5,4494),(.D5,413),(.D1,9)], + .scan 0 50, + .scan2 5 9 [(2239488,4),(1391832,4),(1033238,4),(220974,4),(15357,4),(1049,4),(4458,4),(407,4)], + .scan 5 7, + .scan 0 10, + .scan2 3 0 [(7,20),(407,20),(4458,20),(1049,20),(15357,20),(220974,20),(1033238,20),(1391832,20)], + .scan 3 2239483, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [6718469,1679616,419904,104976,26244,6560,1642,410,102,24,6,4,186620] 1 [(.D2,2239489),(.D0,1391833),(.D0,1033239),(.D0,220975),(.D0,15358),(.D0,1050),(.D0,4459),(.D0,408),(.D0,7)], + .scan 0 50, + .scan2 5 9 [(4572288,4),(971929,4),(963254,4),(209310,4),(13413,4),(725,4),(4404,4),(398,4)], + .scan 5 5, + .scan 0 10, + .scan2 3 0 [(5,20),(398,20),(4404,20),(725,20),(13413,20),(209310,20),(963254,20),(971929,20)], + .scan 3 4572283, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [10077693] 1 [(.D2,4572289),(.D0,971930),(.D0,963255),(.D0,209311),(.D0,13414),(.D0,726),(.D0,4405),(.D0,399),(.D0,5)], + .scan 0 50, + .scan2 5 9 [(5038846,4),(2052865,4),(552025,4),(893270,4),(197646,4),(11469,4),(401,4),(4350,4),(389,4)], + .scan 5 3, + .scan 0 10, + .scan2 3 0 [(3,20),(389,20),(4350,20),(401,20),(11469,20),(197646,20),(893270,20),(552025,20),(2052865,20)], + .scan 3 5038841, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [15116543,3779136,944784,236196,59048,14760,3690,924,232,56,16,2,2,2] 1 [(.D2,5038847),(.D0,2052866),(.D0,552026),(.D0,893271),(.D0,197647),(.D0,11470),(.D0,402),(.D0,4351),(.D0,390),(.D0,3)], + .batch [2] 10077696 [(.D1,1)], + .batch [3639170,909794,227448,56862,14214,3556,888,222,56,12,4,2] 10077697 [(.D5,1213056),(.D5,412057),(.D5,869942),(.D5,193758),(.D5,10821),(.D5,293),(.D5,4332),(.D5,386),(.D1,3)], + .batch [2] 12503811 [(.D1,1)], + .batch [311038] 12503812 [(.D1,209882),(.D0,836247),(.D0,188143),(.D0,9886),(.D0,138),(.D2,4306),(.D5,382),(.D4,1)], + .scan 0 50, + .scan2 5 9 [(12659330,4),(132121,4),(823286,4),(185982,4),(9525,4),(77,4),(4296,4),(380,4)], + .scan 0 78, + .scan 7 4, + .scan2 3 0 [(380,20),(4296,20),(77,20),(9525,20),(185982,20),(823286,20),(132121,20)], + .scan 3 12659325, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1835133,435456,124416,15552,15552,15552] 1 [(.D2,12659331),(.D0,132122),(.D0,823287),(.D0,185983),(.D0,9526),(.D0,78),(.D0,4297),(.D0,381),(.D0,1)], + .batch [546936,136752,34176,8556,2136,528,144,36,264] 1220831 [(.D5,12048915),(.D5,30385),(.D5,806330),(.D5,183156),(.D5,9054),(.D1,4284),(.D2,378),(.D1,1)], + .scan 0 50, + .scan2 5 9 [(1585594,4),(11866533,4),(801255,4),(182310,4),(8913,4),(4259,4),(374,3)], + .scan 0 2, + .scan 8 3, + .scan 4 374, + .scan 0 18, + .scan 2 4259, + .scan 6 3, + .scan 0 72, + .scan 2 8912, + .scan 6 3, + .scan 0 72, + .scan 2 182309, + .scan 6 3, + .scan 0 72, + .scan 2 801254, + .scan 6 3, + .scan 0 72, + .scan 2 11866532, + .scan 6 3, + .scan 0 72, + .scan 2 1585588, + .scan 0 489, + .batch [1] 0 [(.D0,0)], + .batch [93311] 1585596 [(.D0,11866534),(.D0,801256),(.D0,182311),(.D0,8914),(.D0,4260),(.D0,375),(.D2,0)], + .scan 0 50, + .scan2 5 9 [(1632250,4),(11843205,4),(797367,4),(181662,4),(8805,4),(4241,4)], + .scan 5 371, + .scan 0 32, + .scan 8 3, + .scan 0 42, + .scan2 3 0 [(370,20),(4241,20),(8805,20),(181662,20),(797367,20),(11843205,20)], + .scan 3 1632245, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [279933] 1 [(.D2,1632251),(.D0,11843206),(.D0,797368),(.D0,181663),(.D0,8806),(.D0,4242),(.D0,372)], + .scan 0 50, + .scan2 5 9 [(139966,4),(1562267,4),(11831541,4),(795423,4),(181338,4),(8751,4),(4232,4)], + .scan 5 369, + .scan 0 29, + .scan 2 370, + .scan 6 3, + .scan 0 72, + .scan 2 4231, + .scan 6 3, + .scan 0 72, + .scan 2 8750, + .scan 6 3, + .scan 0 72, + .scan 2 181337, + .scan 6 3, + .scan 0 72, + .scan 2 795422, + .scan 6 3, + .scan 0 72, + .scan 2 11831540, + .scan 6 3, + .scan 0 72, + .scan 2 1562266, + .scan 6 3, + .scan 0 72, + .scan 2 139960, + .scan 0 489, + .batch [1] 0 [(.D0,0)], + .batch [279935] 139968 [(.D0,1562268),(.D0,11831542),(.D0,795424),(.D0,181339),(.D0,8752),(.D0,4233),(.D0,370)] +] +theorem chunk_6_ok : q6 cmds_6 cfg_6=some cfg_7:= by decide +kernel +def cmds_7 : List Cmd:=[ + .scan 0 50, + .scan2 5 9 [(279934,4),(1492283,4),(11819877,4),(793479,4),(181014,4),(8697,4),(4223,4)], + .scan 5 368, + .scan 0 10, + .scan2 3 0 [(368,20),(4223,20),(8697,20),(181014,20),(793479,20),(11819877,20),(1492283,20)], + .scan 3 279929, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [839807,209952,52488,13122,3278,820,206,52,12,2,2,2] 1 [(.D2,279935),(.D0,1492284),(.D0,11819878),(.D0,793480),(.D0,181015),(.D0,8698),(.D0,4224),(.D0,368)], + .batch [2] 559872 [(.D1,1)], + .batch [93312] 559873 [(.D5,1445626),(.D5,11812101),(.D5,792183),(.D5,180798),(.D5,8661),(.D5,4217),(.D3,367)], + .scan 0 50, + .scan2 5 9 [(606528,4),(1422298,4),(11808213,4),(791535,4),(180690,4),(8643,4),(4214,4)], + .scan 5 366, + .scan 0 10, + .scan2 3 0 [(366,20),(4214,20),(8643,20),(180690,20),(791535,20),(11808213,20),(1422298,20)], + .scan 3 606523, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1679613] 1 [(.D2,606529),(.D0,1422299),(.D0,11808214),(.D0,791536),(.D0,180691),(.D0,8644),(.D0,4215),(.D0,366)], + .scan 0 50, + .scan2 5 9 [(839806,4),(186625,4),(1352314,4),(11796549,4),(789591,4),(180366,4),(8589,4),(4205,4)], + .scan 5 364, + .scan 0 10, + .scan2 3 0 [(364,20),(4205,20),(8589,20),(180366,20),(789591,20),(11796549,20),(1352314,20),(186625,20)], + .scan 3 839801, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [2519423,629856,157464,39366,9840,2460,614,154,38,10,2,2,2] 1 [(.D2,839807),(.D0,186626),(.D0,1352315),(.D0,11796550),(.D0,789592),(.D0,180367),(.D0,8590),(.D0,4206),(.D0,364)], + .batch [2] 1679616 [(.D1,1)], + .batch [139970,34994,8748,2188,546,138,32,10,2] 1679617 [(.D5,46656),(.D5,1328986),(.D5,11792661),(.D5,788943),(.D5,180258),(.D5,8571),(.D5,4202),(.D1,364)], + .batch [2] 1772931 [(.D1,1)], + .batch [155518] 1772932 [(.D1,1321211),(.D0,11791366),(.D0,788728),(.D0,180223),(.D0,8566),(.D4,4201),(.D2,363)], + .scan 0 50, + .scan2 5 9 [(1850690,4),(1282330,4),(11784885,4),(787647,4),(180042,4),(8535,4),(4196,4)], + .scan 5 362, + .scan 0 10, + .scan2 3 0 [(362,20),(4196,20),(8535,20),(180042,20),(787647,20),(11784885,20),(1282330,20)], + .scan 3 1850685, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1679613] 1 [(.D2,1850691),(.D0,1282331),(.D0,11784886),(.D0,787648),(.D0,180043),(.D0,8536),(.D0,4197),(.D0,362)], + .scan 0 50, + .scan2 5 9 [(839806,4),(1430787,4),(1212346,4),(11773221,4),(785703,4),(179718,4),(8481,4),(4187,4)], + .scan 5 360, + .scan 0 10, + .scan2 3 0 [(360,20),(4187,20),(8481,20),(179718,20),(785703,20),(11773221,20),(1212346,20),(1430787,20)], + .scan 3 839801, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [2519423,629856,157464,39366,9840,2460,614,154,38,10,2,2,2] 1 [(.D2,839807),(.D0,1430788),(.D0,1212347),(.D0,11773222),(.D0,785704),(.D0,179719),(.D0,8482),(.D0,4188),(.D0,360)], + .batch [2] 1679616 [(.D1,1)], + .batch [1119744] 1679617 [(.D5,1290818),(.D5,1189018),(.D5,11769333),(.D5,785055),(.D5,179610),(.D5,8463),(.D5,4184),(.D1,360)], + .scan 0 50, + .scan2 5 9 [(2239488,4),(1010882,4),(1142362,4),(11761557,4),(783759,4),(179394,4),(8427,4),(4178,4)], + .scan 5 358, + .scan 0 10, + .scan2 3 0 [(358,20),(4178,20),(8427,20),(179394,20),(783759,20),(11761557,20),(1142362,20),(1010882,20)], + .scan 3 2239483, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [6718469,1679616,419904,104976,26244,6560,1642,410,102,24,6,4,186620] 1 [(.D2,2239489),(.D0,1010883),(.D0,1142363),(.D0,11761558),(.D0,783760),(.D0,179395),(.D0,8428),(.D0,4179),(.D0,358)], + .scan 0 50, + .scan2 5 9 [(4572288,4),(590979,4),(1072378,4),(11749893,4),(781815,4),(179070,4),(8373,4),(4169,4)], + .scan 5 356, + .scan 0 10, + .scan2 3 0 [(356,20),(4169,20),(8373,20),(179070,20),(781815,20),(11749893,20),(1072378,20),(590979,20)], + .scan 3 4572283, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [10077693] 1 [(.D2,4572289),(.D0,590980),(.D0,1072379),(.D0,11749894),(.D0,781816),(.D0,179071),(.D0,8374),(.D0,4170),(.D0,356)], + .scan 0 50, + .scan2 5 9 [(5038846,4),(2052865,4),(171075,4),(1002394,4),(11738229,4),(779871,4),(178746,4),(8319,4),(4160,4)], + .scan 5 354, + .scan 0 10, + .scan2 3 0 [(354,20),(4160,20),(8319,20),(178746,20),(779871,20),(11738229,20),(1002394,20),(171075,20),(2052865,20)], + .scan 3 5038841, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [15116543,3779136,944784,236196,59048,14760,3690,924,232,56,16,2,2,2] 1 [(.D2,5038847),(.D0,2052866),(.D0,171076),(.D0,1002395),(.D0,11738230),(.D0,779872),(.D0,178747),(.D0,8320),(.D0,4161),(.D0,354)], + .batch [2] 10077696 [(.D1,1)], + .batch [559932,139992,35004,8748,2184,552,132,36,12] 10077697 [(.D5,1213056),(.D5,31107),(.D5,979066),(.D5,11734341),(.D5,779223),(.D5,178638),(.D5,8301),(.D5,4157),(.D1,354)], + .batch [995316] 10450993 [(.D5,1026408),(.D1,973883),(.D0,11733478),(.D0,779080),(.D0,178615),(.D4,8297),(.D2,4157),(.D2,353)], + .scan 0 50, + .scan2 5 9 [(10948650,4),(777579,4),(932410,4),(11726565,4),(777927,4),(178422,4),(8265,4),(4151,4)], + .scan 5 352, + .scan 0 10, + .scan2 3 0 [(352,20),(4151,20),(8265,20),(178422,20),(777927,20),(11726565,20),(932410,20),(777579,20)], + .scan 3 10948645, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [10077693] 1 [(.D2,10948651),(.D0,777580),(.D0,932411),(.D0,11726566),(.D0,777928),(.D0,178423),(.D0,8266),(.D0,4152),(.D0,352)], + .scan 0 50, + .scan2 5 9 [(5038846,4),(8429227,4),(357675,4),(862426,4),(11714901,4),(775983,4),(178098,4),(8211,4),(4142,4)], + .scan 5 350, + .scan 0 10, + .scan2 3 0 [(350,20),(4142,20),(8211,20),(178098,20),(775983,20),(11714901,20),(862426,20),(357675,20),(8429227,20)], + .scan 3 5038841, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [15116543,3779136,944784,236196,59048,14760,3690,924,232,56,16,2,2,2] 1 [(.D2,5038847),(.D0,8429228),(.D0,357676),(.D0,862427),(.D0,11714902),(.D0,775984),(.D0,178099),(.D0,8212),(.D0,4143),(.D0,350)], + .batch [2] 10077696 [(.D1,1)], + .batch [3918732,979692,244920,61236,15300,3840,948,240,72,12] 10077697 [(.D5,7589418),(.D5,217707),(.D5,839098),(.D5,11711013),(.D5,775335),(.D5,177990),(.D5,8193),(.D5,4139),(.D1,350)], + .batch [12] 12690193 [(.D5,6283170),(.D1,1)], + .batch [248904] 12690199 [(.D5,6283167),(.D5,802813),(.D3,11704966),(.D5,774327),(.D5,177822),(.D3,8166),(.D0,4135),(.D5,348)], + .scan 0 50, + .scan2 5 9 [(12814650,4),(6220941,4),(792442,4),(11703237,4),(774039,4),(177774,4),(8157,4),(4133,4)], + .scan 5 348, + .scan 0 10, + .scan2 3 0 [(348,20),(4133,20),(8157,20),(177774,20),(774039,20),(11703237,20),(792442,20),(6220941,20)], + .scan 3 12814645, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [10077693] 1 [(.D2,12814651),(.D0,6220942),(.D0,792443),(.D0,11703238),(.D0,774040),(.D0,177775),(.D0,8158),(.D0,4134),(.D0,348)], + .scan 0 50, + .scan2 5 9 [(5038846,4),(10295227,4),(5801037,4),(722458,4),(11691573,4),(772095,4),(177450,4),(8103,4),(4124,4)], + .scan 5 346, + .scan 0 10, + .scan2 3 0 [(346,20),(4124,20),(8103,20),(177450,20),(772095,20),(11691573,20),(722458,20),(5801037,20),(10295227,20)], + .scan 3 5038841, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [15116543,3779136,944784,236196,59048,14760,3690,924,232,56,16,2,2,2] 1 [(.D2,5038847),(.D0,10295228),(.D0,5801038),(.D0,722459),(.D0,11691574),(.D0,772096),(.D0,177451),(.D0,8104),(.D0,4125),(.D0,346)], + .batch [2] 10077696 [(.D1,1)], + .batch [6718464] 10077697 [(.D5,9455418),(.D5,5661069),(.D5,699130),(.D5,11687685),(.D5,771447),(.D5,177342),(.D5,8085),(.D5,4121),(.D1,346)] +] +theorem chunk_7_ok : q6 cmds_7 cfg_7=some cfg_8:= by decide +kernel +def cmds_8 : List Cmd:=[ + .scan 0 50, + .scan2 5 9 [(13436928,4),(7775802,4),(5381133,4),(652474,4),(11679909,4),(770151,4),(177126,4),(8049,4),(4115,4)], + .scan 5 344, + .scan 0 10, + .scan2 3 0 [(344,20),(4115,20),(8049,20),(177126,20),(770151,20),(11679909,20),(652474,20),(5381133,20),(7775802,20)], + .scan 3 13436923, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [40310789,10077696,2519424,629856,157464,39366,9842,2460,616,152,40,8,4,1119740] 1 [(.D2,13436929),(.D0,7775803),(.D0,5381134),(.D0,652475),(.D0,11679910),(.D0,770152),(.D0,177127),(.D0,8050),(.D0,4116),(.D0,344)], + .scan 0 50, + .scan2 5 9 [(27433728,4),(5256379,4),(4961229,4),(582490,4),(11668245,4),(768207,4),(176802,4),(7995,4),(4106,4)], + .scan 5 342, + .scan 0 10, + .scan2 3 0 [(342,20),(4106,20),(7995,20),(176802,20),(768207,20),(11668245,20),(582490,20),(4961229,20),(5256379,20)], + .scan 3 27433723, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [60466173] 1 [(.D2,27433729),(.D0,5256380),(.D0,4961230),(.D0,582491),(.D0,11668246),(.D0,768208),(.D0,176803),(.D0,7996),(.D0,4107),(.D0,342)], + .scan 0 50, + .scan2 5 9 [(30233086,4),(12317185,4),(2736955,4),(4541325,4),(512506,4),(11656581,4),(766263,4),(176478,4),(7941,4),(4097,4)], + .scan 5 340, + .scan 0 10, + .scan2 3 0 [(340,20),(4097,20),(7941,20),(176478,20),(766263,20),(11656581,20),(512506,20),(4541325,20),(2736955,20),(12317185,20)], + .scan 3 30233081, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [90699263,22674816,5668704,1417176,354294,88572,22142,5536,1386,344,88,20,6,2,2] 1 [(.D2,30233087),(.D0,12317186),(.D0,2736956),(.D0,4541326),(.D0,512507),(.D0,11656582),(.D0,766264),(.D0,176479),(.D0,7942),(.D0,4098),(.D0,340)], + .batch [2] 60466176 [(.D1,1)], + .batch [21835010,5458754,1364688,341172,85294,21324,5330,1332,334,84,20,4,2] 60466177 [(.D5,7278336),(.D5,1897147),(.D5,4401357),(.D5,489178),(.D5,11652693),(.D5,765615),(.D5,176370),(.D5,7923),(.D5,4094),(.D1,340)], + .batch [2] 75022851 [(.D1,1)], + .batch [1866238] 75022852 [(.D1,684092),(.D0,4199182),(.D0,455483),(.D0,11647078),(.D0,764680),(.D0,176215),(.D2,7897),(.D5,4090),(.D4,338)], + .scan 0 50, + .scan2 5 9 [(75955970,4),(217531,4),(4121421,4),(442522,4),(11644917,4),(764319,4),(176154,4),(7887,4),(4088,4)], + .scan 5 338, + .scan 0 10, + .scan2 3 0 [(338,20),(4088,20),(7887,20),(176154,20),(764319,20),(11644917,20),(442522,20),(4121421,20),(217531,20)], + .scan 3 75955965, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [3915585,978888,244716,61176,15300,3816,960,252,48,24] 1 [(.D2,75955971),(.D0,217532),(.D0,4121422),(.D0,442523),(.D0,11644918),(.D0,764320),(.D0,176155),(.D0,7888),(.D0,4089)], + .batch [9207552] 2610383 [(.D5,74650779),(.D3,4085167),(.D2,436480),(.D2,11643910),(.D5,764151),(.D3,176127),(.D0,7883),(.D3,4088),(.D0,338)], + .scan 0 50, + .scan2 5 9 [(7214158,4),(72348891,4),(3701518,4),(372538,4),(11633253,4),(762375,4),(175830,4),(7833,4),(4079,4)], + .scan 5 336, + .scan 0 10, + .scan2 3 0 [(336,20),(4079,20),(7833,20),(175830,20),(762375,20),(11633253,20),(372538,20),(3701518,20),(72348891,20)], + .scan 3 7214153, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [21642479,5410620,1352654,338164,84540,21134,5284,1322,330,82,20,6,5268252] 1 [(.D2,7214159),(.D0,72348892),(.D0,3701519),(.D0,372539),(.D0,11633254),(.D0,762376),(.D0,175831),(.D0,7834),(.D0,4080),(.D0,336)], + .scan 0 50, + .scan2 5 9 [(17062443,4),(69829469,4),(3281614,4),(302554,4),(11621589,4),(760431,4),(175506,4),(7779,4),(4070,4)], + .scan 5 334, + .scan 0 10, + .scan2 3 0 [(334,20),(4070,20),(7779,20),(175506,20),(760431,20),(11621589,20),(302554,20),(3281614,20),(69829469,20)], + .scan 3 17062438, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [51187333,9278840] 1 [(.D2,17062444),(.D0,69829470),(.D0,3281615),(.D0,302555),(.D0,11621590),(.D0,760432),(.D0,175507),(.D0,7780),(.D0,4071),(.D0,334)], + .scan 0 50, + .scan2 5 9 [(30233086,4),(1945900,4),(67310045,4),(2861710,4),(232570,4),(11609925,4),(758487,4),(175182,4),(7725,4),(4061,4)], + .scan 5 332, + .scan 0 10, + .scan2 3 0 [(332,20),(4061,20),(7725,20),(175182,20),(758487,20),(11609925,20),(232570,20),(2861710,20),(67310045,20),(1945900,20)], + .scan 3 30233081, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [35026221,8756556,2189136,547272,136824,34212,8556,2136,528,144,36] 1 [(.D2,30233087),(.D0,1945901),(.D0,67310046),(.D0,2861711),(.D0,232571),(.D0,11609926),(.D0,758488),(.D0,175183),(.D0,7726),(.D0,4062)], + .batch [52682556] 23350811 [(.D5,18557681),(.D3,66985729),(.D1,2807658),(.D5,223561),(.D5,11608424),(.D4,758237),(.D4,175140),(.D3,7719),(.D4,4060),(.D0,332)], + .scan 0 50, + .scan2 5 9 [(49692088,4),(5387042,4),(64790622,4),(2441806,4),(162586,4),(11598261,4),(756543,4),(174858,4),(7671,4),(4052,4)], + .scan 5 330, + .scan 0 10, + .scan2 3 0 [(330,20),(4052,20),(7671,20),(174858,20),(756543,20),(11598261,20),(162586,20),(2441806,20),(64790622,20),(5387042,20)], + .scan 3 49692083, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [96966777,24241680,6060420,1515120,378768,94704,23664,5928,1476,372,96,12,38917980] 1 [(.D2,49692089),(.D0,5387043),(.D0,64790623),(.D0,2441807),(.D0,162587),(.D0,11598262),(.D0,756544),(.D0,174859),(.D0,7672),(.D0,4053),(.D0,330)], + .scan 0 50, + .scan2 5 9 [(84103498,4),(7640339,4),(62271200,4),(2021902,4),(92602,4),(11586597,4),(754599,4),(174534,4),(7617,4),(4043,4)], + .scan 5 328, + .scan 0 10, + .scan2 3 0 [(328,20),(4043,20),(7617,20),(174534,20),(754599,20),(11586597,20),(92602,20),(2021902,20),(62271200,20),(7640339,20)], + .scan 3 84103493, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [137526129,34381524,8595384,2148840,537204,134304,33588,8388,2100,528,120,36,12,12] 1 [(.D2,84103499),(.D0,7640340),(.D0,62271201),(.D0,2021903),(.D0,92603),(.D0,11586598),(.D0,754600),(.D0,174535),(.D0,7618),(.D0,4044),(.D0,328)], + .batch [29904828] 91684085 [(.D5,38261456),(.D1,60997811),(.D4,1809670),(.D1,57231),(.D1,11580703),(.D0,753617),(.D1,174371),(.D1,7591),(.D0,4039),(.D3,327)], + .scan 0 50, + .scan2 5 9 [(106636498,4),(30785249,4),(59751775,4),(1601998,4),(22618,4),(11574933,4),(752655,4),(174210,4),(7563,4),(4034,4)], + .scan 5 326, + .scan 0 10, + .scan2 3 0 [(326,20),(4034,20),(7563,20),(174210,20),(752655,20),(11574933,20),(22618,20),(1601998,20),(59751775,20),(30785249,20)], + .scan 3 106636493, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [87943965,21982752,5497632,1373760,344736,85536,20736,7776,40919904] 1 [(.D2,106636499),(.D0,30785250),(.D0,59751776),(.D0,1601999),(.D0,22619),(.D0,11574934),(.D0,752656),(.D0,174211),(.D0,7564),(.D0,4035),(.D0,326)], + .scan 0 50, + .scan2 5 9 [(79088398,4),(67092299,4),(24194549,4),(58653325,4),(1418923,4),(11563270,4),(750711,4),(173886,4),(7509,4),(4025,4)], + .scan 5 324, + .scan 0 10, + .scan2 3 0 [(324,20),(4025,20),(7509,20),(173886,20),(750711,20),(11563270,20),(1418923,20),(58653325,20),(24194549,20),(67092299,20)], + .scan 3 79088393, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [237265199,59316300,14829074,3707268,926818,231704,57924,14482,3620,906,226,56,16,2,2,2] 1 [(.D2,79088399),(.D0,67092300),(.D0,24194550),(.D0,58653326),(.D0,1418924),(.D0,11563271),(.D0,750712),(.D0,173887),(.D0,7510),(.D0,4026),(.D0,324)], + .batch [2] 158176800 [(.D1,1)], + .batch [7740576] 158176801 [(.D5,53910898),(.D5,21997649),(.D5,58287175),(.D1,1357899),(.D3,11553100),(.D0,749017),(.D2,173604),(.D2,7462),(.D1,4018),(.D5,322)], + .scan 0 50, + .scan2 5 9 [(162047088,4),(51975754,4),(21675125,4),(58233421,4),(1348939,4),(11551606,4),(748767,4),(173562,4),(7455,4),(4016,4)], + .scan 5 322, + .scan 0 10, + .scan2 3 0 [(322,20),(4016,20),(7455,20),(173562,20),(748767,20),(11551606,20),(1348939,20),(58233421,20),(21675125,20),(51975754,20)], + .scan 3 162047083, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [362797053] 1 [(.D2,162047089),(.D0,51975755),(.D0,21675126),(.D0,58233422),(.D0,1348940),(.D0,11551607),(.D0,748768),(.D0,173563),(.D0,7456),(.D0,4017),(.D0,322)], + .scan 0 50, + .scan2 5 9 [(181398526,4),(71347825,4),(36859210,4),(19155701,4),(57813517,4),(1278955,4),(11539942,4),(746823,4),(173238,4),(7401,4),(4007,4)], + .scan 5 320, + .scan 0 10, + .scan2 3 0 [(320,20),(4007,20),(7401,20),(173238,20),(746823,20),(11539942,20),(1278955,20),(57813517,20),(19155701,20),(36859210,20),(71347825,20)], + .scan 3 181398521, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [544195583,136048896,34012224,8503056,2125764,531440,132858,33216,8304,2076,520,128,34,8,2,2] 1 [(.D2,181398527),(.D0,71347826),(.D0,36859211),(.D0,19155702),(.D0,57813518),(.D0,1278956),(.D0,11539943),(.D0,746824),(.D0,173239),(.D0,7402),(.D0,4008),(.D0,320)], + .batch [2] 362797056 [(.D1,1)], + .batch [123344210,30836054,7709014,1927254,481812,120452,30114,7528,1884,470,118,30,6,2] 362797057 [(.D5,41114736),(.D5,31820362),(.D5,18315893),(.D5,57673549),(.D5,1255627),(.D5,11536054),(.D5,746175),(.D5,173130),(.D5,7383),(.D5,4004),(.D1,320)], + .batch [2] 445026531 [(.D1,1)], + .batch [12900958] 445026532 [(.D1,24967907),(.D0,17173818),(.D2,57483203),(.D3,1223903),(.D5,11530767),(.D2,745294),(.D5,172983),(.D1,7360),(.D4,4000),(.D4,318)] +] +theorem chunk_8_ok : q6 cmds_8 cfg_8=some cfg_9:= by decide +kernel +def cmds_9 : List Cmd:=[ + .scan 0 50, + .scan2 5 9 [(451477010,4),(21742666,4),(16636277,4),(57393613,4),(1208971,4),(11528278,4),(744879,4),(172914,4),(7347,4),(3998,4)], + .scan 5 318, + .scan 0 10, + .scan2 3 0 [(318,20),(3998,20),(7347,20),(172914,20),(744879,20),(11528278,20),(1208971,20),(57393613,20),(16636277,20),(21742666,20)], + .scan 3 451477005, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [362797053] 1 [(.D2,451477011),(.D0,21742667),(.D0,16636278),(.D0,57393614),(.D0,1208972),(.D0,11528279),(.D0,744880),(.D0,172915),(.D0,7348),(.D0,3999),(.D0,318)], + .scan 0 50, + .scan2 5 9 [(181398526,4),(360777747,4),(6626122,4),(14116853,4),(56973709,4),(1138987,4),(11516614,4),(742935,4),(172590,4),(7293,4),(3989,4)], + .scan 5 316, + .scan 0 10, + .scan2 3 0 [(316,20),(3989,20),(7293,20),(172590,20),(742935,20),(11516614,20),(1138987,20),(56973709,20),(14116853,20),(6626122,20),(360777747,20)], + .scan 3 181398521, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [544195583,136048896,34012224,8503056,2125764,531440,132858,33216,8304,2076,520,128,34,8,2,2] 1 [(.D2,181398527),(.D0,360777748),(.D0,6626123),(.D0,14116854),(.D0,56973710),(.D0,1138988),(.D0,11516615),(.D0,742936),(.D0,172591),(.D0,7294),(.D0,3990),(.D0,316)], + .batch [2] 362797056 [(.D1,1)], + .batch [28570944,7142736,1785696,446412,111600,27900,6984,1752,432,108,36,12,12] 362797057 [(.D5,330544658),(.D5,1587274),(.D5,13277045),(.D5,56833741),(.D5,1115659),(.D5,11512726),(.D5,742287),(.D5,172482),(.D5,7275),(.D5,3986),(.D1,316)], + .batch [33961704] 381844369 [(.D5,321021002),(.D1,13012499),(.D5,56789650),(.D5,1108311),(.D2,11511502),(.D0,742084),(.D4,172448),(.D4,7269),(.D3,3986),(.D2,315)], + .scan 0 50, + .scan2 5 9 [(398825220,4),(312530576,4),(11597427,4),(56553805,4),(1069003,4),(11504950,4),(740991,4),(172266,4),(7239,4),(3980,4)], + .scan 5 314, + .scan 0 10, + .scan2 3 0 [(314,20),(3980,20),(7239,20),(172266,20),(740991,20),(11504950,20),(1069003,20),(56553805,20),(11597427,20),(312530576,20)], + .scan 3 398825215, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [362797053] 1 [(.D2,398825221),(.D0,312530577),(.D0,11597428),(.D0,56553806),(.D0,1069004),(.D0,11504951),(.D0,740992),(.D0,172267),(.D0,7240),(.D0,3981),(.D0,314)], + .scan 0 50, + .scan2 5 9 [(181398526,4),(308125957,4),(297414032,4),(9078003,4),(56133901,4),(999019,4),(11493286,4),(739047,4),(171942,4),(7185,4),(3971,4)], + .scan 5 312, + .scan 0 10, + .scan2 3 0 [(312,20),(3971,20),(7185,20),(171942,20),(739047,20),(11493286,20),(999019,20),(56133901,20),(9078003,20),(297414032,20),(308125957,20)], + .scan 3 181398521, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [544195583,136048896,34012224,8503056,2125764,531440,132858,33216,8304,2076,520,128,34,8,2,2] 1 [(.D2,181398527),(.D0,308125958),(.D0,297414033),(.D0,9078004),(.D0,56133902),(.D0,999020),(.D0,11493287),(.D0,739048),(.D0,171943),(.D0,7186),(.D0,3972),(.D0,312)], + .batch [2] 362797056 [(.D1,1)], + .batch [241864704] 362797057 [(.D5,277892868),(.D5,292375184),(.D5,8238195),(.D5,55993933),(.D5,975691),(.D5,11489398),(.D5,738399),(.D5,171834),(.D5,7167),(.D5,3968),(.D1,312)], + .scan 0 50, + .scan2 5 9 [(483729408,4),(217426692,4),(282297488,4),(6558579,4),(55713997,4),(929035,4),(11481622,4),(737103,4),(171618,4),(7131,4),(3962,4)], + .scan 5 310, + .scan 0 10, + .scan2 3 0 [(310,20),(3962,20),(7131,20),(171618,20),(737103,20),(11481622,20),(929035,20),(55713997,20),(6558579,20),(282297488,20),(217426692,20)], + .scan 3 483729403, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1451188229,362797056,90699264,22674816,5668704,1417176,354294,88574,22144,5534,1384,348,86,22,6,40310780] 1 [(.D2,483729409),(.D0,217426693),(.D0,282297489),(.D0,6558580),(.D0,55713998),(.D0,929036),(.D0,11481623),(.D0,737104),(.D0,171619),(.D0,7132),(.D0,3963),(.D0,310)], + .scan 0 50, + .scan2 5 9 [(987614208,4),(126727429,4),(267180944,4),(4039155,4),(55294093,4),(859051,4),(11469958,4),(735159,4),(171294,4),(7077,4),(3953,4)], + .scan 5 308, + .scan 0 10, + .scan2 3 0 [(308,20),(3953,20),(7077,20),(171294,20),(735159,20),(11469958,20),(859051,20),(55294093,20),(4039155,20),(267180944,20),(126727429,20)], + .scan 3 987614203, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [2176782333] 1 [(.D2,987614209),(.D0,126727430),(.D0,267180945),(.D0,4039156),(.D0,55294094),(.D0,859052),(.D0,11469959),(.D0,735160),(.D0,171295),(.D0,7078),(.D0,3954),(.D0,308)], + .scan 0 50, + .scan2 5 9 [(1088391166,4),(443418625,4),(36028165,4),(252064400,4),(1519731,4),(54874189,4),(789067,4),(11458294,4),(733215,4),(170970,4),(7023,4),(3944,4)], + .scan 5 306, + .scan 0 10, + .scan2 3 0 [(306,20),(3944,20),(7023,20),(170970,20),(733215,20),(11458294,20),(789067,20),(54874189,20),(1519731,20),(252064400,20),(36028165,20),(443418625,20)], + .scan 3 1088391161, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [3265173503,816293376,204073344,51018336,12754584,3188646,797160,199290,49824,12456,3114,776,196,48,12,2,2,2] 1 [(.D2,1088391167),(.D0,443418626),(.D0,36028166),(.D0,252064401),(.D0,1519732),(.D0,54874190),(.D0,789068),(.D0,11458295),(.D0,733216),(.D0,170971),(.D0,7024),(.D0,3945),(.D0,306)], + .batch [2] 2176782336 [(.D1,1)], + .batch [104311392,26077860,6519456,1629864,407472,101880,25464,6360,1596,396,96,36,56046600,14011560,3502872,875808,218880,54792,13680,3384,864,216,72] 2176782337 [(.D5,262020096),(.D5,5795077),(.D5,247025552),(.D5,679923),(.D5,54734221),(.D5,765739),(.D5,11454406),(.D5,732567),(.D5,170862),(.D5,7005),(.D5,3941),(.D1,306)], + .batch [72] 2283687637 [(.D5,208567446),(.D5,242946009),(.D1,1)], + .batch [23992560] 2283687673 [(.D5,208567428),(.D5,242946006),(.D1,54620901),(.D1,746853),(.D3,11451259),(.D4,732042),(.D1,170776),(.D4,6990),(.D3,3939),(.D3,305)], + .scan 0 50, + .scan2 5 9 [(2295683952,4),(202569288,4),(241946316,4),(54454285,4),(719083,4),(11446630,4),(731271,4),(170646,4),(6969,4),(3935,4)], + .scan 5 304, + .scan 0 10, + .scan2 3 0 [(304,20),(3935,20),(6969,20),(170646,20),(731271,20),(11446630,20),(719083,20),(54454285,20),(241946316,20),(202569288,20)], + .scan 3 2295683947, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [362797053] 1 [(.D2,2295683953),(.D0,202569289),(.D0,241946317),(.D0,54454286),(.D0,719084),(.D0,11446631),(.D0,731272),(.D0,170647),(.D0,6970),(.D0,3936),(.D0,304)], + .scan 0 50, + .scan2 5 9 [(181398526,4),(2204984689,4),(187452744,4),(239426892,4),(54034381,4),(649099,4),(11434966,4),(729327,4),(170322,4),(6915,4),(3926,4)], + .scan 5 302, + .scan 0 10, + .scan2 3 0 [(302,20),(3926,20),(6915,20),(170322,20),(729327,20),(11434966,20),(649099,20),(54034381,20),(239426892,20),(187452744,20),(2204984689,20)], + .scan 3 181398521, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [544195583,136048896,34012224,8503056,2125764,531440,132858,33216,8304,2076,520,128,34,8,2,2] 1 [(.D2,181398527),(.D0,2204984690),(.D0,187452745),(.D0,239426893),(.D0,54034382),(.D0,649100),(.D0,11434967),(.D0,729328),(.D0,170323),(.D0,6916),(.D0,3927),(.D0,302)], + .batch [2] 362797056 [(.D1,1)], + .batch [241864704] 362797057 [(.D5,2174751600),(.D5,182413896),(.D5,238587084),(.D5,53894413),(.D5,625771),(.D5,11431078),(.D5,728679),(.D5,170214),(.D5,6897),(.D5,3923),(.D1,302)], + .scan 0 50, + .scan2 5 9 [(483729408,4),(2114285424,4),(172336200,4),(236907468,4),(53614477,4),(579115,4),(11423302,4),(727383,4),(169998,4),(6861,4),(3917,4)], + .scan 5 300, + .scan 0 10, + .scan2 3 0 [(300,20),(3917,20),(6861,20),(169998,20),(727383,20),(11423302,20),(579115,20),(53614477,20),(236907468,20),(172336200,20),(2114285424,20)], + .scan 3 483729403, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1451188229,362797056,90699264,22674816,5668704,1417176,354294,88574,22144,5534,1384,348,86,22,6,40310780] 1 [(.D2,483729409),(.D0,2114285425),(.D0,172336201),(.D0,236907469),(.D0,53614478),(.D0,579116),(.D0,11423303),(.D0,727384),(.D0,169999),(.D0,6862),(.D0,3918),(.D0,300)], + .scan 0 50, + .scan2 5 9 [(987614208,4),(2023586161,4),(157219656,4),(234388044,4),(53194573,4),(509131,4),(11411638,4),(725439,4),(169674,4),(6807,4),(3908,4)], + .scan 5 298, + .scan 0 10, + .scan2 3 0 [(298,20),(3908,20),(6807,20),(169674,20),(725439,20),(11411638,20),(509131,20),(53194573,20),(234388044,20),(157219656,20),(2023586161,20)], + .scan 3 987614203, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [2176782333] 1 [(.D2,987614209),(.D0,2023586162),(.D0,157219657),(.D0,234388045),(.D0,53194574),(.D0,509132),(.D0,11411639),(.D0,725440),(.D0,169675),(.D0,6808),(.D0,3909),(.D0,298)], + .scan 0 50, + .scan2 5 9 [(1088391166,4),(443418625,4),(1932886897,4),(142103112,4),(231868620,4),(52774669,4),(439147,4),(11399974,4),(723495,4),(169350,4),(6753,4),(3899,4)], + .scan 5 296, + .scan 0 10, + .scan2 3 0 [(296,20),(3899,20),(6753,20),(169350,20),(723495,20),(11399974,20),(439147,20),(52774669,20),(231868620,20),(142103112,20),(1932886897,20),(443418625,20)], + .scan 3 1088391161, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [3265173503,816293376,204073344,51018336,12754584,3188646,797160,199290,49824,12456,3114,776,196,48,12,2,2,2] 1 [(.D2,1088391167),(.D0,443418626),(.D0,1932886898),(.D0,142103113),(.D0,231868621),(.D0,52774670),(.D0,439148),(.D0,11399975),(.D0,723496),(.D0,169351),(.D0,6754),(.D0,3900),(.D0,296)], + .batch [2] 2176782336 [(.D1,1)], + .batch [786060290,196515074,49128768,12282192,3070548,767638,191910,47976,11994,3000,750,186,48,12,2] 2176782337 [(.D5,262020096),(.D5,1902653809),(.D5,137064264),(.D5,231028812),(.D5,52634701),(.D5,415819),(.D5,11396086),(.D5,722847),(.D5,169242),(.D5,6735),(.D5,3896),(.D1,296)], + .batch [2] 2700822531 [(.D1,1)], + .batch [67184638] 2700822532 [(.D1,1858983794),(.D0,129785929),(.D0,229815757),(.D0,52432526),(.D0,382124),(.D0,11390471),(.D0,721912),(.D0,169087),(.D2,6709),(.D5,3892),(.D4,294)] +] +theorem chunk_9_ok : q6 cmds_9 cfg_9=some cfg_10:= by decide +kernel +def cmds_10 : List Cmd:=[ + .scan 0 50, + .scan2 5 9 [(2734414850,4),(1842187633,4),(126986568,4),(229349196,4),(52354765,4),(369163,4),(11388310,4),(721551,4),(169026,4),(6699,4),(3890,4)], + .scan 5 294, + .scan 0 10, + .scan2 3 0 [(294,20),(3890,20),(6699,20),(169026,20),(721551,20),(11388310,20),(369163,20),(52354765,20),(229349196,20),(126986568,20),(1842187633,20)], + .scan 3 2734414845, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [2176782333] 1 [(.D2,2734414851),(.D0,1842187634),(.D0,126986569),(.D0,229349197),(.D0,52354766),(.D0,369164),(.D0,11388311),(.D0,721552),(.D0,169027),(.D0,6700),(.D0,3891),(.D0,294)], + .scan 0 50, + .scan2 5 9 [(1088391166,4),(2190219267,4),(1751488369,4),(111870024,4),(226829772,4),(51934861,4),(299179,4),(11376646,4),(719607,4),(168702,4),(6645,4),(3881,4)], + .scan 5 292, + .scan 0 10, + .scan2 3 0 [(292,20),(3881,20),(6645,20),(168702,20),(719607,20),(11376646,20),(299179,20),(51934861,20),(226829772,20),(111870024,20),(1751488369,20),(2190219267,20)], + .scan 3 1088391161, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [3265173503,816293376,204073344,51018336,12754584,3188646,797160,199290,49824,12456,3114,776,196,48,12,2,2,2] 1 [(.D2,1088391167),(.D0,2190219268),(.D0,1751488370),(.D0,111870025),(.D0,226829773),(.D0,51934862),(.D0,299180),(.D0,11376647),(.D0,719608),(.D0,168703),(.D0,6646),(.D0,3882),(.D0,292)], + .batch [2] 2176782336 [(.D1,1)], + .batch [1451188224] 2176782337 [(.D5,2008820738),(.D5,1721255281),(.D5,106831176),(.D5,225989964),(.D5,51794893),(.D5,275851),(.D5,11372758),(.D5,718959),(.D5,168594),(.D5,6627),(.D5,3878),(.D1,292)], + .scan 0 50, + .scan2 5 9 [(2902376448,4),(1646023682,4),(1660789105,4),(96753480,4),(224310348,4),(51514957,4),(229195,4),(11364982,4),(717663,4),(168378,4),(6591,4),(3872,4)], + .scan 5 290, + .scan 0 10, + .scan2 3 0 [(290,20),(3872,20),(6591,20),(168378,20),(717663,20),(11364982,20),(229195,20),(51514957,20),(224310348,20),(96753480,20),(1660789105,20),(1646023682,20)], + .scan 3 2902376443, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [8707129349,2176782336,544195584,136048896,34012224,8503056,2125764,531440,132862,33216,8304,2076,518,130,32,6,4,241864700] 1 [(.D2,2902376449),(.D0,1646023683),(.D0,1660789106),(.D0,96753481),(.D0,224310349),(.D0,51514958),(.D0,229196),(.D0,11364983),(.D0,717664),(.D0,168379),(.D0,6592),(.D0,3873),(.D0,290)], + .scan 0 50, + .scan2 5 9 [(5925685248,4),(1101828099,4),(1570089841,4),(81636936,4),(221790924,4),(51095053,4),(159211,4),(11353318,4),(715719,4),(168054,4),(6537,4),(3863,4)], + .scan 5 288, + .scan 0 10, + .scan2 3 0 [(288,20),(3863,20),(6537,20),(168054,20),(715719,20),(11353318,20),(159211,20),(51095053,20),(221790924,20),(81636936,20),(1570089841,20),(1101828099,20)], + .scan 3 5925685243, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [13060694013] 1 [(.D2,5925685249),(.D0,1101828100),(.D0,1570089842),(.D0,81636937),(.D0,221790925),(.D0,51095054),(.D0,159212),(.D0,11353319),(.D0,715720),(.D0,168055),(.D0,6538),(.D0,3864),(.D0,288)], + .scan 0 50, + .scan2 5 9 [(6530347006,4),(2660511745,4),(557632515,4),(1479390577,4),(66520392,4),(219271500,4),(50675149,4),(89227,4),(11341654,4),(713775,4),(167730,4),(6483,4),(3854,4)], + .scan 5 286, + .scan 0 10, + .scan2 3 0 [(286,20),(3854,20),(6483,20),(167730,20),(713775,20),(11341654,20),(89227,20),(50675149,20),(219271500,20),(66520392,20),(1479390577,20),(557632515,20),(2660511745,20)], + .scan 3 6530347001, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [19591041023,4897760256,1224440064,306110016,76527504,19131876,4782968,1195740,298936,74736,18684,4670,1168,290,72,18,6,2,2] 1 [(.D2,6530347007),(.D0,2660511746),(.D0,557632516),(.D0,1479390578),(.D0,66520393),(.D0,219271501),(.D0,50675150),(.D0,89228),(.D0,11341655),(.D0,713776),(.D0,167731),(.D0,6484),(.D0,3855),(.D0,286)], + .batch [2] 13060694016 [(.D1,1)], + .batch [4716361730,1179090434,294772608,73693152,18423288,4605822,1151454,287866,71966,17992,4496,1126,282,68,18,4,2] 13060694017 [(.D5,1572120576),(.D5,376233987),(.D5,1449157489),(.D5,61481544),(.D5,218431692),(.D5,50535181),(.D5,65899),(.D5,11337766),(.D5,713127),(.D5,167622),(.D5,6465),(.D5,3851),(.D1,286)], + .batch [2] 16204935171 [(.D1,1)], + .batch [342641676,60466162] 16204935172 [(.D1,114213892),(.D0,1405487474),(.D0,54203209),(.D0,217218637),(.D0,50333006),(.D0,32204),(.D0,11332151),(.D0,712192),(.D0,167467),(.D2,6439),(.D5,3847),(.D4,284)], + .scan 0 50, + .scan2 5 9 [(16406489090,4),(13436931,4),(1388691313,4),(51403848,4),(216752076,4),(50255245,4),(19243,4),(11329990,4),(711831,4),(167406,4),(6429,4),(3845,4)], + .scan 5 284, + .scan 0 10, + .scan2 3 0 [(284,20),(3845,20),(6429,20),(167406,20),(711831,20),(11329990,20),(19243,20),(50255245,20),(216752076,20),(51403848,20),(1388691313,20),(13436931,20)], + .scan 3 16406489085, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [241864785,60466188,15116544,3779136,944784,236196,59040,14760,3696,936,228,60,12] 1 [(.D2,16406489091),(.D0,13436932),(.D0,1388691314),(.D0,51403849),(.D0,216752077),(.D0,50255246),(.D0,19244),(.D0,11329991),(.D0,711832),(.D0,167407),(.D0,6430)], + .batch [408628788,102145536,25520832,6391872,1586304,404352,108864,31104,263015424] 161243183 [(.D5,16325867499),(.D1,1386451826),(.D0,51030601),(.D0,216689869),(.D0,50244878),(.D0,17516),(.D0,11329703),(.D0,711784),(.D2,167398),(.D5,6428),(.D0,3846),(.D0,284)], + .scan 0 50, + .scan2 5 9 [(565159720,4),(16123909230,4),(1352792113,4),(45420648,4),(215754876,4),(50089045,4),(11318327,4),(709887,4),(167082,4),(6375,4),(3836,4)], + .scan 5 282, + .scan 0 10, + .scan2 3 0 [(282,20),(3836,20),(6375,20),(167082,20),(709887,20),(11318327,20),(50089045,20),(215754876,20),(45420648,20),(1352792113,20),(16123909230,20)], + .scan 3 565159715, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1695479165,423869790,57433378] 1 [(.D2,565159721),(.D0,16123909231),(.D0,1352792114),(.D0,45420649),(.D0,215754877),(.D0,50089046),(.D0,11318328),(.D0,709888),(.D0,167083),(.D0,6376),(.D0,3837),(.D0,282)], + .scan 0 50, + .scan2 5 9 [(1088391166,4),(20964137,4),(16033209966,4),(1337675569,4),(42901224,4),(215334972,4),(50019061,4),(11306663,4),(707943,4),(166758,4),(6321,4),(3827,4)], + .scan 5 280, + .scan 0 10, + .scan2 3 0 [(280,20),(3827,20),(6321,20),(166758,20),(707943,20),(11306663,20),(50019061,20),(215334972,20),(42901224,20),(1337675569,20),(16033209966,20),(20964137,20)], + .scan 3 1088391161, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [377354493,94338612,23584656,5896152,1474044,368508,92124,23040,5760,1440,360,96,12,12,12] 1 [(.D2,1088391167),(.D0,20964138),(.D0,16033209967),(.D0,1337675570),(.D0,42901225),(.D0,215334973),(.D0,50019062),(.D0,11306664),(.D0,707944),(.D0,166759),(.D0,6322),(.D0,3828)], + .batch [2092925796] 251569661 [(.D5,962606336),(.D1,16029715944),(.D4,1337093232),(.D0,42804169),(.D0,215318797),(.D2,50016365),(.D3,11306214),(.D5,707868),(.D1,166747),(.D2,6319),(.D1,3828),(.D0,280)], + .scan 0 50, + .scan2 5 9 [(1298032558,4),(439374887,4),(15942510701,4),(1322559025,4),(40381800,4),(214915068,4),(49949077,4),(11294999,4),(705999,4),(166434,4),(6267,4),(3818,4)], + .scan 5 278, + .scan 0 10, + .scan2 3 0 [(278,20),(3818,20),(6267,20),(166434,20),(705999,20),(11294999,20),(49949077,20),(214915068,20),(40381800,20),(1322559025,20),(15942510701,20),(439374887,20)], + .scan 3 1298032553, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [3894097679,973524420,243381104,60845274,15211320,3802830,950706,237678,59418,14856,3714,928,234,56,16,2,2,2] 1 [(.D2,1298032559),(.D0,439374888),(.D0,15942510702),(.D0,1322559026),(.D0,40381801),(.D0,214915069),(.D0,49949078),(.D0,11295000),(.D0,706000),(.D0,166435),(.D0,6268),(.D0,3819),(.D0,278)], + .batch [2] 2596065120 [(.D1,1)], + .batch [669108380,167277096,41819274,10454820,2613704,653424,163356,40840,10212,2552,636,160,42,8,4,2,2] 2596065121 [(.D5,223036126),(.D5,15906454241),(.D1,1316549616),(.D1,39380233),(.D2,214748140),(.D3,49921256),(.D1,11290363),(.D1,705227),(.D5,166305),(.D1,6247),(.D2,3815),(.D2,277)], + .batch [69880468] 3042137377 [(.D1,15869281553),(.D5,1310354167),(.D1,38347658),(.D5,214576044),(.D1,49892574),(.D1,11285583),(.D2,704430),(.D2,166173),(.D0,6224),(.D5,3811),(.D4,276)], + .scan 0 50, + .scan2 5 9 [(3077077610,4),(15851811435,4),(1307442481,4),(37862376,4),(214495164,4),(49879093,4),(11283335,4),(704055,4),(166110,4),(6213,4),(3809,4)], + .scan 5 276, + .scan 0 10, + .scan2 3 0 [(276,20),(3809,20),(6213,20),(166110,20),(704055,20),(11283335,20),(49879093,20),(214495164,20),(37862376,20),(1307442481,20),(15851811435,20)], + .scan 3 3077077605, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [2176782333] 1 [(.D2,3077077611),(.D0,15851811436),(.D0,1307442482),(.D0,37862377),(.D0,214495165),(.D0,49879094),(.D0,11283336),(.D0,704056),(.D0,166111),(.D0,6214),(.D0,3810),(.D0,276)], + .scan 0 50, + .scan2 5 9 [(1088391166,4),(2532882027,4),(15761112171,4),(1292325937,4),(35342952,4),(214075260,4),(49809109,4),(11271671,4),(702111,4),(165786,4),(6159,4),(3800,4)], + .scan 5 274, + .scan 0 10, + .scan2 3 0 [(274,20),(3800,20),(6159,20),(165786,20),(702111,20),(11271671,20),(49809109,20),(214075260,20),(35342952,20),(1292325937,20),(15761112171,20),(2532882027,20)], + .scan 3 1088391161, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [3265173503,816293376,204073344,51018336,12754584,3188646,797160,199290,49824,12456,3114,776,196,48,12,2,2,2] 1 [(.D2,1088391167),(.D0,2532882028),(.D0,15761112172),(.D0,1292325938),(.D0,35342953),(.D0,214075261),(.D0,49809110),(.D0,11271672),(.D0,702112),(.D0,165787),(.D0,6160),(.D0,3801),(.D0,274)], + .batch [2] 2176782336 [(.D1,1)], + .batch [1451188224] 2176782337 [(.D5,2351483498),(.D5,15730879083),(.D5,1287287089),(.D5,34503144),(.D5,213935292),(.D5,49785781),(.D5,11267783),(.D5,701463),(.D5,165678),(.D5,6141),(.D5,3797),(.D1,274)] +] +theorem chunk_10_ok : q6 cmds_10 cfg_10=some cfg_11:= by decide +kernel +def cmds_11 : List Cmd:=[ + .scan 0 50, + .scan2 5 9 [(2902376448,4),(1988686442,4),(15670412907,4),(1277209393,4),(32823528,4),(213655356,4),(49739125,4),(11260007,4),(700167,4),(165462,4),(6105,4),(3791,4)], + .scan 5 272, + .scan 0 10, + .scan2 3 0 [(272,20),(3791,20),(6105,20),(165462,20),(700167,20),(11260007,20),(49739125,20),(213655356,20),(32823528,20),(1277209393,20),(15670412907,20),(1988686442,20)], + .scan 3 2902376443, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [8707129349,2176782336,544195584,136048896,34012224,8503056,2125764,531440,132862,33216,8304,2076,518,130,32,6,4,241864700] 1 [(.D2,2902376449),(.D0,1988686443),(.D0,15670412908),(.D0,1277209394),(.D0,32823529),(.D0,213655357),(.D0,49739126),(.D0,11260008),(.D0,700168),(.D0,165463),(.D0,6106),(.D0,3792),(.D0,272)], + .scan 0 50, + .scan2 5 9 [(5925685248,4),(1444490859,4),(15579713643,4),(1262092849,4),(30304104,4),(213235452,4),(49669141,4),(11248343,4),(698223,4),(165138,4),(6051,4),(3782,4)], + .scan 5 270, + .scan 0 10, + .scan2 3 0 [(270,20),(3782,20),(6051,20),(165138,20),(698223,20),(11248343,20),(49669141,20),(213235452,20),(30304104,20),(1262092849,20),(15579713643,20),(1444490859,20)], + .scan 3 5925685243, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [13060694013] 1 [(.D2,5925685249),(.D0,1444490860),(.D0,15579713644),(.D0,1262092850),(.D0,30304105),(.D0,213235453),(.D0,49669142),(.D0,11248344),(.D0,698224),(.D0,165139),(.D0,6052),(.D0,3783),(.D0,270)], + .scan 0 50, + .scan2 5 9 [(6530347006,4),(2660511745,4),(900295275,4),(15489014379,4),(1246976305,4),(27784680,4),(212815548,4),(49599157,4),(11236679,4),(696279,4),(164814,4),(5997,4),(3773,4)], + .scan 5 268, + .scan 0 10, + .scan2 3 0 [(268,20),(3773,20),(5997,20),(164814,20),(696279,20),(11236679,20),(49599157,20),(212815548,20),(27784680,20),(1246976305,20),(15489014379,20),(900295275,20),(2660511745,20)], + .scan 3 6530347001, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [19591041023,4897760256,1224440064,306110016,76527504,19131876,4782968,1195740,298936,74736,18684,4670,1168,290,72,18,6,2,2] 1 [(.D2,6530347007),(.D0,2660511746),(.D0,900295276),(.D0,15489014380),(.D0,1246976306),(.D0,27784681),(.D0,212815549),(.D0,49599158),(.D0,11236680),(.D0,696280),(.D0,164815),(.D0,5998),(.D0,3774),(.D0,268)], + .batch [2] 13060694016 [(.D1,1)], + .batch [4716361730,1179090434,294772608,73693152,18423288,4605822,1151454,287866,71966,17992,4496,1126,282,68,18,4,2] 13060694017 [(.D5,1572120576),(.D5,718896747),(.D5,15458781291),(.D5,1241937457),(.D5,26944872),(.D5,212675580),(.D5,49575829),(.D5,11232791),(.D5,695631),(.D5,164706),(.D5,5979),(.D5,3770),(.D1,268)], + .batch [2] 16204935171 [(.D1,1)], + .batch [403107838] 16204935172 [(.D1,456876652),(.D0,15415111276),(.D0,1234659122),(.D0,25731817),(.D0,212473405),(.D0,49542134),(.D0,11227176),(.D0,694696),(.D0,164551),(.D2,5953),(.D5,3766),(.D4,266)], + .scan 0 50, + .scan2 5 9 [(16406489090,4),(356099691,4),(15398315115,4),(1231859761,4),(25265256,4),(212395644,4),(49529173,4),(11225015,4),(694335,4),(164490,4),(5943,4),(3764,4)], + .scan 5 266, + .scan 0 10, + .scan2 3 0 [(266,20),(3764,20),(5943,20),(164490,20),(694335,20),(11225015,20),(49529173,20),(212395644,20),(25265256,20),(1231859761,20),(15398315115,20),(356099691,20)], + .scan 3 16406489085, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [6409794465,1602448608,400612140,100153044,25038252,6259572,1564884,391236,97812,24444,6120,1524,384,84,24,12] 1 [(.D2,16406489091),(.D0,356099692),(.D0,15398315116),(.D0,1231859762),(.D0,25265257),(.D0,212395645),(.D0,49529174),(.D0,11225016),(.D0,694336),(.D0,164491),(.D0,5944),(.D0,3765),(.D0,266)], + .batch [752383572] 4273196303 [(.D5,14269890939),(.D1,15338965168),(.D4,1221968103),(.D0,23616647),(.D5,212120876),(.D4,49483378),(.D1,11217384),(.D0,693064),(.D2,164278),(.D3,5908),(.D5,3758),(.D3,265)], + .scan 0 50, + .scan2 5 9 [(4649388088,4),(14081795046,4),(15307615851,4),(1216743217,4),(22745832,4),(211975740,4),(49459189,4),(11213351,4),(692391,4),(164166,4),(5889,4),(3755,4)], + .scan 5 264, + .scan 0 10, + .scan2 3 0 [(264,20),(3755,20),(5889,20),(164166,20),(692391,20),(11213351,20),(49459189,20),(211975740,20),(22745832,20),(1216743217,20),(15307615851,20),(14081795046,20)], + .scan 3 4649388083, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [13060694013] 1 [(.D2,4649388089),(.D0,14081795047),(.D0,15307615852),(.D0,1216743218),(.D0,22745833),(.D0,211975741),(.D0,49459190),(.D0,11213352),(.D0,692392),(.D0,164167),(.D0,5890),(.D0,3756),(.D0,264)], + .scan 0 50, + .scan2 5 9 [(6530347006,4),(1384214585,4),(13537599462,4),(15216916587,4),(1201626673,4),(20226408,4),(211555836,4),(49389205,4),(11201687,4),(690447,4),(163842,4),(5835,4),(3746,4)], + .scan 5 262, + .scan 0 10, + .scan2 3 0 [(262,20),(3746,20),(5835,20),(163842,20),(690447,20),(11201687,20),(49389205,20),(211555836,20),(20226408,20),(1201626673,20),(15216916587,20),(13537599462,20),(1384214585,20)], + .scan 3 6530347001, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [19591041023,4897760256,1224440064,306110016,76527504,19131876,4782968,1195740,298936,74736,18684,4670,1168,290,72,18,6,2,2] 1 [(.D2,6530347007),(.D0,1384214586),(.D0,13537599463),(.D0,15216916588),(.D0,1201626674),(.D0,20226409),(.D0,211555837),(.D0,49389206),(.D0,11201688),(.D0,690448),(.D0,163843),(.D0,5836),(.D0,3747),(.D0,262)], + .batch [2] 13060694016 [(.D1,1)], + .batch [887470250,221867564,55466890,13866722,3466680,866670,216670,54168,13542,3384,846,212,52,14,4,1253972610] 13060694017 [(.D5,295823416),(.D5,13356200934),(.D5,15186683499),(.D5,1196587825),(.D5,19386600),(.D5,211415868),(.D5,49365877),(.D5,11197799),(.D5,689799),(.D5,163734),(.D5,5817),(.D5,3743),(.D1,262)], + .scan 0 50, + .scan2 5 9 [(14279327155,4),(12993403879,4),(15126217323,4),(1186510129,4),(17706984,4),(211135932,4),(49319221,4),(11190023,4),(688503,4),(163518,4),(5781,4),(3737,4)], + .scan 5 260, + .scan 0 10, + .scan2 3 0 [(260,20),(3737,20),(5781,20),(163518,20),(688503,20),(11190023,20),(49319221,20),(211135932,20),(17706984,20),(1186510129,20),(15126217323,20),(12993403879,20)], + .scan 3 14279327150, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [13060694013] 1 [(.D2,14279327156),(.D0,12993403880),(.D0,15126217324),(.D0,1186510130),(.D0,17706985),(.D0,211135933),(.D0,49319222),(.D0,11190024),(.D0,688504),(.D0,163519),(.D0,5782),(.D0,3738),(.D0,260)], + .scan 0 50, + .scan2 5 9 [(6530347006,4),(11014153652,4),(12449208295,4),(15035518059,4),(1171393585,4),(15187560,4),(210716028,4),(49249237,4),(11178359,4),(686559,4),(163194,4),(5727,4),(3728,4)], + .scan 5 258, + .scan 0 10, + .scan2 3 0 [(258,20),(3728,20),(5727,20),(163194,20),(686559,20),(11178359,20),(49249237,20),(210716028,20),(15187560,20),(1171393585,20),(15035518059,20),(12449208295,20),(11014153652,20)], + .scan 3 6530347001, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [19591041023,4897760256,1224440064,306110016,76527504,19131876,4782968,1195740,298936,74736,18684,4670,1168,290,72,18,6,2,2] 1 [(.D2,6530347007),(.D0,11014153653),(.D0,12449208296),(.D0,15035518060),(.D0,1171393586),(.D0,15187561),(.D0,210716029),(.D0,49249238),(.D0,11178360),(.D0,686560),(.D0,163195),(.D0,5728),(.D0,3729),(.D0,258)], + .batch [2] 13060694016 [(.D1,1)], + .batch [8707129344] 13060694017 [(.D5,9925762483),(.D5,12267809767),(.D5,15005284971),(.D5,1166354737),(.D5,14347752),(.D5,210576060),(.D5,49225909),(.D5,11174471),(.D5,685911),(.D5,163086),(.D5,5709),(.D5,3725),(.D1,258)], + .scan 0 50, + .scan2 5 9 [(17414258688,4),(7748980147,4),(11905012711,4),(14944818795,4),(1156277041,4),(12668136,4),(210296124,4),(49179253,4),(11166695,4),(684615,4),(162870,4),(5673,4),(3719,4)], + .scan 5 256, + .scan 0 10, + .scan2 3 0 [(256,20),(3719,20),(5673,20),(162870,20),(684615,20),(11166695,20),(49179253,20),(210296124,20),(12668136,20),(1156277041,20),(14944818795,20),(11905012711,20),(7748980147,20)], + .scan 3 17414258683, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [52242776069,13060694016,3265173504,816293376,204073344,51018336,12754584,3188646,797162,199290,49822,12456,3114,780,194,48,12,4,1451188220] 1 [(.D2,17414258689),(.D0,7748980148),(.D0,11905012712),(.D0,14944818796),(.D0,1156277042),(.D0,12668137),(.D0,210296125),(.D0,49179254),(.D0,11166696),(.D0,684616),(.D0,162871),(.D0,5674),(.D0,3720),(.D0,256)], + .scan 0 50, + .scan2 5 9 [(35554111488,4),(4483806644,4),(11360817127,4),(14854119531,4),(1141160497,4),(10148712,4),(209876220,4),(49109269,4),(11155031,4),(682671,4),(162546,4),(5619,4),(3710,4)], + .scan 5 254, + .scan 0 10, + .scan2 3 0 [(254,20),(3710,20),(5619,20),(162546,20),(682671,20),(11155031,20),(49109269,20),(209876220,20),(10148712,20),(1141160497,20),(14854119531,20),(11360817127,20),(4483806644,20)], + .scan 3 35554111483, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [78364164093] 1 [(.D2,35554111489),(.D0,4483806645),(.D0,11360817128),(.D0,14854119532),(.D0,1141160498),(.D0,10148713),(.D0,209876221),(.D0,49109270),(.D0,11155032),(.D0,682672),(.D0,162547),(.D0,5620),(.D0,3711),(.D0,254)], + .scan 0 50, + .scan2 5 9 [(39182082046,4),(15963070465,4),(1218633140,4),(10816621543,4),(14763420267,4),(1126043953,4),(7629288,4),(209456316,4),(49039285,4),(11143367,4),(680727,4),(162222,4),(5565,4),(3701,4)], + .scan 5 252, + .scan 0 10, + .scan2 3 0 [(252,20),(3701,20),(5565,20),(162222,20),(680727,20),(11143367,20),(49039285,20),(209456316,20),(7629288,20),(1126043953,20),(14763420267,20),(10816621543,20),(1218633140,20),(15963070465,20)], + .scan 3 39182082041, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [117546246143,29386561536,7346640384,1836660096,459165024,114791256,28697814,7174452,1793612,448404,112102,28026,7004,1752,438,108,28,8,2,2] 1 [(.D2,39182082047),(.D0,15963070466),(.D0,1218633141),(.D0,10816621544),(.D0,14763420268),(.D0,1126043954),(.D0,7629289),(.D0,209456317),(.D0,49039286),(.D0,11143368),(.D0,680728),(.D0,162223),(.D0,5566),(.D0,3702),(.D0,252)], + .batch [2] 78364164096 [(.D1,1)], + .batch [2344355508,586088892,146522208,36630564,9157644,2289396,572352,143100,35760,8952,2232,552,144,36,8186161428] 78364164097 [(.D5,9432723456),(.D5,130241972),(.D5,10635223015),(.D5,14733187179),(.D5,1121005105),(.D5,6789480),(.D5,209316348),(.D5,49015957),(.D5,11139479),(.D5,680079),(.D5,162114),(.D5,5547),(.D5,3698),(.D1,252)], + .scan 0 50, + .scan2 5 9 [(84020148480,4),(6604731264,4),(10272425961,4),(14672721003,4),(1110927409,4),(5109864,4),(209036412,4),(48969301,4),(11131703,4),(678783,4),(161898,4),(5511,4),(3692,4)], + .scan 5 250, + .scan 0 10, + .scan2 3 0 [(250,20),(3692,20),(5511,20),(161898,20),(678783,20),(11131703,20),(48969301,20),(209036412,20),(5109864,20),(1110927409,20),(14672721003,20),(10272425961,20),(6604731264,20)], + .scan 3 84020148475, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [78364164093] 1 [(.D2,84020148481),(.D0,6604731265),(.D0,10272425962),(.D0,14672721004),(.D0,1110927410),(.D0,5109865),(.D0,209036413),(.D0,48969302),(.D0,11131704),(.D0,678784),(.D0,161899),(.D0,5512),(.D0,3693),(.D0,250)], + .scan 0 50, + .scan2 5 9 [(39182082046,4),(64429107457,4),(3339557760,4),(9728230377,4),(14582021739,4),(1095810865,4),(2590440,4),(208616508,4),(48899317,4),(11120039,4),(676839,4),(161574,4),(5457,4),(3683,4)], + .scan 5 248, + .scan 0 10, + .scan2 3 0 [(248,20),(3683,20),(5457,20),(161574,20),(676839,20),(11120039,20),(48899317,20),(208616508,20),(2590440,20),(1095810865,20),(14582021739,20),(9728230377,20),(3339557760,20),(64429107457,20)], + .scan 3 39182082041, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [117546246143,29386561536,7346640384,1836660096,459165024,114791256,28697814,7174452,1793612,448404,112102,28026,7004,1752,438,108,28,8,2,2] 1 [(.D2,39182082047),(.D0,64429107458),(.D0,3339557761),(.D0,9728230378),(.D0,14582021740),(.D0,1095810866),(.D0,2590441),(.D0,208616509),(.D0,48899318),(.D0,11120040),(.D0,676840),(.D0,161575),(.D0,5458),(.D0,3684),(.D0,248)], + .batch [2] 78364164096 [(.D1,1)], + .batch [40520998668,10130249676,1591527720] 78364164097 [(.D5,57898760448),(.D5,2251166592),(.D5,9546831849),(.D5,14551788651),(.D5,1090772017),(.D5,1750632),(.D5,208476540),(.D5,48875989),(.D5,11116151),(.D5,676191),(.D5,161466),(.D5,5439),(.D5,3680),(.D1,248)], + .scan 0 50, + .scan2 5 9 [(104485552128,4),(44838066432,4),(74384256,4),(9184034793,4),(14491322475,4),(1080694321,4),(71016,4),(208196604,4),(48829333,4),(11108375,4),(674895,4),(161250,4),(5403,4),(3674,4)], + .scan 5 246, + .scan 0 10, + .scan2 3 0 [(246,20),(3674,20),(5403,20),(161250,20),(674895,20),(11108375,20),(48829333,20),(208196604,20),(71016,20),(1080694321,20),(14491322475,20),(9184034793,20),(74384256,20),(44838066432,20)], + .scan 3 104485552123, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [8033499789,2008374912,502093728,125523432,31380840,7845192,1961280,490320,122616,30672,7632,1944,432,144,72] 1 [(.D2,104485552129),(.D0,44838066433),(.D0,74384257),(.D0,9184034794),(.D0,14491322476),(.D0,1080694322),(.D0,71017),(.D0,208196605),(.D0,48829334),(.D0,11108376),(.D0,674896),(.D0,161251),(.D0,5404)], + .batch [317765952] 5355666503 [(.D5,101807718877),(.D5,44391760890),(.D1,9171637418),(.D1,14489256247),(.D0,1080349950),(.D3,13621),(.D1,208187039),(.D5,48827739),(.D0,11108110),(.D3,674851),(.D5,161243),(.D4,5402)], + .batch [79455168,19844352,4976640,1228608,311040,93312,15552] 5514549479 [(.D5,101728277389),(.D5,44378520642),(.D5,9169430709),(.D5,14488888461),(.D5,1080288652),(.D1,3406),(.D2,208185336),(.D0,48827456),(.D4,11108062),(.D4,674843),(.D4,161241),(.D5,5402),(.D0,3675)], + .batch [15552] 5567511815 [(.D5,101701796221),(.D5,44374107114),(.D5,9168695121),(.D5,14488765863),(.D5,1080268219),(.D1,1)], + .batch [12692531520] 5567519591 [(.D5,101701792333),(.D5,44374106466),(.D5,9168695013),(.D5,14488765845),(.D5,1080268216),(.D5,208184768),(.D0,48827361),(.D1,11108047),(.D3,674841),(.D0,161242),(.D0,5402),(.D1,3675),(.D0,246)] +] +theorem chunk_11_ok : q6 cmds_11 cfg_11=some cfg_12:= by decide +kernel +def cmds_12 : List Cmd:=[ + .scan 0 50, + .scan2 5 9 [(11913785350,4),(98528659453,4),(43845250986,4),(9080552433,4),(14474075415,4),(1077819811,4),(207776700,4),(48759349,4),(11096711,4),(672951,4),(160926,4),(5349,4),(3665,4)], + .scan 5 244, + .scan 0 10, + .scan2 3 0 [(244,20),(3665,20),(5349,20),(160926,20),(672951,20),(11096711,20),(48759349,20),(207776700,20),(1077819811,20),(14474075415,20),(9080552433,20),(43845250986,20),(98528659453,20)], + .scan 3 11913785345, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [35741356055,8935339014,2233834752,558458688,139614672,34903668,8725916,2181480,545370,136342,34086,8522,2130,532,134,34,8,2,2] 1 [(.D2,11913785351),(.D0,98528659454),(.D0,43845250987),(.D0,9080552434),(.D0,14474075416),(.D0,1077819812),(.D0,207776701),(.D0,48759350),(.D0,11096712),(.D0,672952),(.D0,160927),(.D0,5350),(.D0,3666),(.D0,244)], + .batch [2] 23827570704 [(.D1,1)], + .batch [5118170448] 23827570705 [(.D5,96543028560),(.D3,43514312505),(.D2,9025396020),(.D2,14464882680),(.D0,1076287689),(.D5,207521346),(.D3,48716791),(.D4,11089618),(.D0,671770),(.D2,160729),(.D5,5316),(.D3,3660),(.D3,243)], + .scan 0 50, + .scan2 5 9 [(26386655928,4),(95263485948,4),(43301055402,4),(8989853169,4),(14458958871,4),(1075300387,4),(207356796,4),(48689365,4),(11085047,4),(671007,4),(160602,4),(5295,4),(3656,4)], + .scan 5 242, + .scan 0 10, + .scan2 3 0 [(242,20),(3656,20),(5295,20),(160602,20),(671007,20),(11085047,20),(48689365,20),(207356796,20),(1075300387,20),(14458958871,20),(8989853169,20),(43301055402,20),(95263485948,20)], + .scan 3 26386655923, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [78364164093] 1 [(.D2,26386655929),(.D0,95263485949),(.D0,43301055403),(.D0,8989853170),(.D0,14458958872),(.D0,1075300388),(.D0,207356797),(.D0,48689366),(.D0,11085048),(.D0,671008),(.D0,160603),(.D0,5296),(.D0,3657),(.D0,242)], + .scan 0 50, + .scan2 5 9 [(39182082046,4),(6795614905,4),(91998312444,4),(42756859818,4),(8899153905,4),(14443842327,4),(1072780963,4),(206936892,4),(48619381,4),(11073383,4),(669063,4),(160278,4),(5241,4),(3647,4)], + .scan 5 240, + .scan 0 10, + .scan2 3 0 [(240,20),(3647,20),(5241,20),(160278,20),(669063,20),(11073383,20),(48619381,20),(206936892,20),(1072780963,20),(14443842327,20),(8899153905,20),(42756859818,20),(91998312444,20),(6795614905,20)], + .scan 3 39182082041, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [117546246143,29386561536,7346640384,1836660096,459165024,114791256,28697814,7174452,1793612,448404,112102,28026,7004,1752,438,108,28,8,2,2] 1 [(.D2,39182082047),(.D0,6795614906),(.D0,91998312445),(.D0,42756859819),(.D0,8899153906),(.D0,14443842328),(.D0,1072780964),(.D0,206936893),(.D0,48619382),(.D0,11073384),(.D0,669064),(.D0,160279),(.D0,5242),(.D0,3648),(.D0,240)], + .batch [2] 78364164096 [(.D1,1)], + .batch [795803690,198950924,49737730,12434432,3108610,777152,194286,48574,12144,3036,758,190,48,12,2] 78364164097 [(.D5,265267896),(.D5,90909921276),(.D5,42575461290),(.D5,8868920817),(.D5,14438803479),(.D5,1071941155),(.D5,206796924),(.D5,48596053),(.D5,11069495),(.D5,668415),(.D5,160170),(.D5,5223),(.D5,3644),(.D1,240)], + .batch [2] 78894699891 [(.D1,1)], + .batch [8530284078] 78894699892 [(.D5,90865709960),(.D2,42568092738),(.D0,8867692726),(.D4,14438598797),(.D2,1071907042),(.D2,206791239),(.D4,48595105),(.D1,11069338),(.D3,668389),(.D5,160166),(.D2,5223),(.D0,3645),(.D2,239)], + .scan 0 50, + .scan2 5 9 [(83159841930,4),(88733138940,4),(42212664234,4),(8808454641,4),(14428725783,4),(1070261539,4),(206516988,4),(48549397,4),(11061719,4),(667119,4),(159954,4),(5187,4),(3638,4)], + .scan 5 238, + .scan 0 10, + .scan2 3 0 [(238,20),(3638,20),(5187,20),(159954,20),(667119,20),(11061719,20),(48549397,20),(206516988,20),(1070261539,20),(14428725783,20),(8808454641,20),(42212664234,20),(88733138940,20)], + .scan 3 83159841925, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [78364164093] 1 [(.D2,83159841931),(.D0,88733138941),(.D0,42212664235),(.D0,8808454642),(.D0,14428725784),(.D0,1070261540),(.D0,206516989),(.D0,48549398),(.D0,11061720),(.D0,667120),(.D0,159955),(.D0,5188),(.D0,3639),(.D0,238)], + .scan 0 50, + .scan2 5 9 [(39182082046,4),(63568800907,4),(85467965436,4),(41668468650,4),(8717755377,4),(14413609239,4),(1067742115,4),(206097084,4),(48479413,4),(11050055,4),(665175,4),(159630,4),(5133,4),(3629,4)], + .scan 5 236, + .scan 0 10, + .scan2 3 0 [(236,20),(3629,20),(5133,20),(159630,20),(665175,20),(11050055,20),(48479413,20),(206097084,20),(1067742115,20),(14413609239,20),(8717755377,20),(41668468650,20),(85467965436,20),(63568800907,20)], + .scan 3 39182082041, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [117546246143,29386561536,7346640384,1836660096,459165024,114791256,28697814,7174452,1793612,448404,112102,28026,7004,1752,438,108,28,8,2,2] 1 [(.D2,39182082047),(.D0,63568800908),(.D0,85467965437),(.D0,41668468651),(.D0,8717755378),(.D0,14413609240),(.D0,1067742116),(.D0,206097085),(.D0,48479414),(.D0,11050056),(.D0,665176),(.D0,159631),(.D0,5134),(.D0,3630),(.D0,236)], + .batch [2] 78364164096 [(.D1,1)], + .batch [52242776064] 78364164097 [(.D5,57038453898),(.D5,84379574268),(.D5,41487070122),(.D5,8687522289),(.D5,14408570391),(.D5,1066902307),(.D5,205957116),(.D5,48456085),(.D5,11046167),(.D5,664527),(.D5,159522),(.D5,5115),(.D5,3626),(.D1,236)], + .scan 0 50, + .scan2 5 9 [(104485552128,4),(43977759882,4),(82202791932,4),(41124273066,4),(8627056113,4),(14398492695,4),(1065222691,4),(205677180,4),(48409429,4),(11038391,4),(663231,4),(159306,4),(5079,4),(3620,4)], + .scan 5 234, + .scan 0 10, + .scan2 3 0 [(234,20),(3620,20),(5079,20),(159306,20),(663231,20),(11038391,20),(48409429,20),(205677180,20),(1065222691,20),(14398492695,20),(8627056113,20),(41124273066,20),(82202791932,20),(43977759882,20)], + .scan 3 104485552123, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [313456656389,78364164096,19591041024,4897760256,1224440064,306110016,76527504,19131876,4782968,1195744,298934,74734,18684,4670,1168,294,72,18,6,8707129340] 1 [(.D2,104485552129),(.D0,43977759883),(.D0,82202791933),(.D0,41124273067),(.D0,8627056114),(.D0,14398492696),(.D0,1065222692),(.D0,205677181),(.D0,48409430),(.D0,11038392),(.D0,663232),(.D0,159307),(.D0,5080),(.D0,3621),(.D0,234)], + .scan 0 50, + .scan2 5 9 [(213324668928,4),(24386718859,4),(78937618428,4),(40580077482,4),(8536356849,4),(14383376151,4),(1062703267,4),(205257276,4),(48339445,4),(11026727,4),(661287,4),(158982,4),(5025,4),(3611,4)], + .scan 5 232, + .scan 0 10, + .scan2 3 0 [(232,20),(3611,20),(5025,20),(158982,20),(661287,20),(11026727,20),(48339445,20),(205257276,20),(1062703267,20),(14383376151,20),(8536356849,20),(40580077482,20),(78937618428,20),(24386718859,20)], + .scan 3 213324668923, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [438960939489,31224045084] 1 [(.D2,213324668929),(.D0,24386718860),(.D0,78937618429),(.D0,40580077483),(.D0,8536356850),(.D0,14383376152),(.D0,1062703268),(.D0,205257277),(.D0,48339446),(.D0,11026728),(.D0,661288),(.D0,158983),(.D0,5026),(.D0,3612),(.D0,232)], + .scan 0 50, + .scan2 5 9 [(235092492286,4),(95778422785,4),(4795677835,4),(75672444924,4),(40035881898,4),(8445657585,4),(14368259607,4),(1060183843,4),(204837372,4),(48269461,4),(11015063,4),(659343,4),(158658,4),(4971,4),(3602,4)], + .scan 5 230, + .scan 0 10, + .scan2 3 0 [(230,20),(3602,20),(4971,20),(158658,20),(659343,20),(11015063,20),(48269461,20),(204837372,20),(1060183843,20),(14368259607,20),(8445657585,20),(40035881898,20),(75672444924,20),(4795677835,20),(95778422785,20)], + .scan 3 235092492281, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [517933206357,129483301536,32370825312,8092706328,2023176672,505794096,126448560,31612176,7903008,1975752,493992,123408,30888,7704,1944,504,144,72,72] 1 [(.D2,235092492287),(.D0,95778422786),(.D0,4795677836),(.D0,75672444925),(.D0,40035881899),(.D0,8445657586),(.D0,14368259608),(.D0,1060183844),(.D0,204837373),(.D0,48269462),(.D0,11015064),(.D0,659344),(.D0,158659),(.D0,4972),(.D0,3603),(.D0,230)], + .batch [187344270466,46836067618,11709016904,2927254228,731813556,182953388,45738348,11434588,2858646,714662,178666,44666,11166,2790,700,174,44,10,2,2,2] 345288804263 [(.D5,62448090155),(.D5,67004355763),(.D1,74873165285),(.D4,39902668625),(.D4,8423455373),(.D2,14364559239),(.D0,1059567116),(.D2,204734584),(.D5,48252330),(.D2,11012208),(.D1,658868),(.D5,158579),(.D4,4958),(.D2,3600),(.D1,230)], + .batch [2] 470184984576 [(.D1,1)], + .batch [17549392668] 470184984577 [(.D5,56596340736),(.D1,73138496114),(.D4,39613557096),(.D5,8375270118),(.D3,14356528363),(.D3,1058228636),(.D1,204511505),(.D3,48215150),(.D3,11006012),(.D4,657834),(.D3,158407),(.D5,4929),(.D3,3596),(.D4,228)], + .scan 0 50, + .scan2 5 9 [(478959680910,4),(52208992569,4),(72407271418,4),(39491686314,4),(8354958321,4),(14353143063,4),(1057664419,4),(204417468,4),(48199477,4),(11003399,4),(657399,4),(158334,4),(4917,4),(3593,4)], + .scan 5 228, + .scan 0 10, + .scan2 3 0 [(228,20),(3593,20),(4917,20),(158334,20),(657399,20),(11003399,20),(48199477,20),(204417468,20),(1057664419,20),(14353143063,20),(8354958321,20),(39491686314,20),(72407271418,20),(52208992569,20)], + .scan 3 478959680905, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [470184984573] 1 [(.D2,478959680911),(.D0,52208992570),(.D0,72407271419),(.D0,39491686315),(.D0,8354958322),(.D0,14353143064),(.D0,1057664420),(.D0,204417469),(.D0,48199478),(.D0,11003400),(.D0,657400),(.D0,158335),(.D0,4918),(.D0,3594),(.D0,228)], + .scan 0 50, + .scan2 5 9 [(235092492286,4),(361413434767,4),(32617951545,4),(69142097914,4),(38947490730,4),(8264259057,4),(14338026519,4),(1055144995,4),(203997564,4),(48129493,4),(10991735,4),(655455,4),(158010,4),(4863,4),(3584,4)], + .scan 5 226, + .scan 0 10, + .scan2 3 0 [(226,20),(3584,20),(4863,20),(158010,20),(655455,20),(10991735,20),(48129493,20),(203997564,20),(1055144995,20),(14338026519,20),(8264259057,20),(38947490730,20),(69142097914,20),(32617951545,20),(361413434767,20)], + .scan 3 235092492281, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [705277476863,176319369216,44079842304,11019960576,2754990144,688747536,172186884,43046720,10761678,2690422,672606,168150,42038,10510,2628,656,162,42,10,2,2,2] 1 [(.D2,235092492287),(.D0,361413434768),(.D0,32617951546),(.D0,69142097915),(.D0,38947490731),(.D0,8264259058),(.D0,14338026520),(.D0,1055144996),(.D0,203997565),(.D0,48129494),(.D0,10991736),(.D0,655456),(.D0,158011),(.D0,4864),(.D0,3585),(.D0,226)], + .batch [2] 470184984576 [(.D1,1)], + .batch [313456656384] 470184984577 [(.D5,322231352718),(.D5,26087604537),(.D5,68053706746),(.D5,38766092202),(.D5,8234025969),(.D5,14332987671),(.D5,1054305187),(.D5,203857596),(.D5,48106165),(.D5,10987847),(.D5,654807),(.D5,157902),(.D5,4845),(.D5,3581),(.D1,226)] +] +theorem chunk_12_ok : q6 cmds_12 cfg_12=some cfg_13:= by decide +kernel +def cmds_13 : List Cmd:=[ + .scan 0 50, + .scan2 5 9 [(626913312768,4),(243867188622,4),(13026910521,4),(65876924410,4),(38403295146,4),(8173559793,4),(14322909975,4),(1052625571,4),(203577660,4),(48059509,4),(10980071,4),(653511,4),(157686,4),(4809,4),(3575,4)], + .scan 5 224, + .scan 0 10, + .scan2 3 0 [(224,20),(3575,20),(4809,20),(157686,20),(653511,20),(10980071,20),(48059509,20),(203577660,20),(1052625571,20),(14322909975,20),(8173559793,20),(38403295146,20),(65876924410,20),(13026910521,20),(243867188622,20)], + .scan 3 626913312763, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1406906336445,351726584040,87931646064,21982911480,5495727888,1373931936,343482984,85870800,21467664,5366880,1341792,335448,83808,20952,5256,1296,360,72] 1 [(.D2,626913312769),(.D0,243867188623),(.D0,13026910522),(.D0,65876924411),(.D0,38403295147),(.D0,8173559794),(.D0,14322909976),(.D0,1052625572),(.D0,203577661),(.D0,48059510),(.D0,10980072),(.D0,653512),(.D0,157687),(.D0,4810),(.D0,3576),(.D0,224)], + .batch [157539132072] 937937557583 [(.D5,157944533977),(.D5,165705725490),(.D1,63705772658),(.D4,38041436520),(.D5,8113250022),(.D3,14312858347),(.D3,1050950300),(.D1,203298449),(.D3,48012974),(.D3,10972316),(.D4,652218),(.D3,157471),(.D5,4773),(.D5,3569),(.D3,223)], + .scan 0 50, + .scan2 5 9 [(1016707123618,4),(118559750959,4),(159141594987,4),(62611750906,4),(37859099562,4),(8082860529,4),(14307793431,4),(1050106147,4),(203157756,4),(47989525,4),(10968407,4),(651567,4),(157362,4),(4755,4),(3566,4)], + .scan 5 222, + .scan 0 10, + .scan2 3 0 [(222,20),(3566,20),(4755,20),(157362,20),(651567,20),(10968407,20),(47989525,20),(203157756,20),(1050106147,20),(14307793431,20),(8082860529,20),(37859099562,20),(62611750906,20),(159141594987,20),(118559750959,20)], + .scan 3 1016707123613, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [2134075517289,533518879320,133379719824,20135791020] 1 [(.D2,1016707123619),(.D0,118559750960),(.D0,159141594988),(.D0,62611750907),(.D0,37859099563),(.D0,8082860530),(.D0,14307793432),(.D0,1050106148),(.D0,203157757),(.D0,47989526),(.D0,10968408),(.D0,651568),(.D0,157363),(.D0,4756),(.D0,3567),(.D0,222)], + .scan 0 50, + .scan2 5 9 [(1410554953726,4),(311429646755,4),(1013504815,4),(139550553963,4),(59346577402,4),(37314903978,4),(7992161265,4),(14292676887,4),(1047586723,4),(202737852,4),(47919541,4),(10956743,4),(649623,4),(157038,4),(4701,4),(3557,4)], + .scan 5 220, + .scan 0 10, + .scan2 3 0 [(220,20),(3557,20),(4701,20),(157038,20),(649623,20),(10956743,20),(47919541,20),(202737852,20),(1047586723,20),(14292676887,20),(7992161265,20),(37314903978,20),(59346577402,20),(139550553963,20),(1013504815,20),(311429646755,20)], + .scan 3 1410554953721, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [109458520197,27364630032,6841157472,1710289296,427572360,106893072,26723304,6680808,1670184,417528,104472,26136,6480,1584,432,144] 1 [(.D2,1410554953727),(.D0,311429646756),(.D0,1013504816),(.D0,139550553964),(.D0,59346577403),(.D0,37314903979),(.D0,7992161266),(.D0,14292676888),(.D0,1047586724),(.D0,202737853),(.D0,47919542),(.D0,10956744),(.D0,649624),(.D0,157039),(.D0,4702)], + .batch [2796785791776] 72972346751 [(.D5,1374068780351),(.D5,305348617859),(.D3,139381636495),(.D4,59318424490),(.D1,37310211827),(.D1,7991379241),(.D4,14292546549),(.D5,1047565000),(.D3,202734232),(.D1,47918939),(.D0,10956643),(.D1,649607),(.D5,157035),(.D1,4702),(.D0,3558),(.D0,220)], + .scan 0 50, + .scan2 5 9 [(1471365242638,4),(674872332407,4),(188815876535,4),(119959512940,4),(56081403898,4),(36770708394,4),(7901462001,4),(14277560343,4),(1045067299,4),(202317948,4),(47849557,4),(10945079,4),(647679,4),(156714,4),(4647,4),(3548,4)], + .scan 5 218, + .scan 0 10, + .scan2 3 0 [(218,20),(3548,20),(4647,20),(156714,20),(647679,20),(10945079,20),(47849557,20),(202317948,20),(1045067299,20),(14277560343,20),(7901462001,20),(36770708394,20),(56081403898,20),(119959512940,20),(188815876535,20),(674872332407,20)], + .scan 3 1471365242633, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [4414095727919,1103523931980,275880982994,68970245748,17242561438,4310640360,1077660090,269415020,67353756,16838440,4209608,1052404,263100,65774,16444,4112,1026,258,64,18,2,2,2] 1 [(.D2,1471365242639),(.D0,674872332408),(.D0,188815876536),(.D0,119959512941),(.D0,56081403899),(.D0,36770708395),(.D0,7901462002),(.D0,14277560344),(.D0,1045067300),(.D0,202317949),(.D0,47849558),(.D0,10945080),(.D0,647680),(.D0,156715),(.D0,4648),(.D0,3549),(.D0,218)], + .batch [2] 2942730485280 [(.D1,1)], + .batch [1288934375900,322233593976,80558398494,20139599624,5034899904,1258724976,314681244,78670312,19667580,4916894,1229224,307304,76828,19206,4802,1200,300,76,18,6,2,2] 2942730485281 [(.D5,429644791966),(.D1,147944619796),(.D5,113147636817),(.D4,54946091211),(.D0,36581489614),(.D0,7869925538),(.D3,14272304266),(.D3,1044191287),(.D4,202171946),(.D2,47825224),(.D4,10941023),(.D3,647004),(.D0,156602),(.D3,4629),(.D0,3546),(.D2,217)], + .batch [20270096308] 3802020069217 [(.D1,76337154467),(.D1,101213059263),(.D3,52956994952),(.D3,36249973570),(.D5,7814672864),(.D2,14263095487),(.D1,1042656491),(.D4,201916146),(.D3,47782591),(.D4,10933918),(.D0,645820),(.D4,156404),(.D2,4596),(.D4,3539),(.D5,216)], + .scan 0 50, + .scan2 5 9 [(3812155117370,4),(71269630389,4),(100368471916,4),(52816230394,4),(36226512810,4),(7810762737,4),(14262443799,4),(1042547875,4),(201898044,4),(47779573,4),(10933415,4),(645735,4),(156390,4),(4593,4),(3539,4)], + .scan 5 216, + .scan 0 10, + .scan2 3 0 [(216,20),(3539,20),(4593,20),(156390,20),(645735,20),(10933415,20),(47779573,20),(201898044,20),(1042547875,20),(14262443799,20),(7810762737,20),(36226512810,20),(52816230394,20),(100368471916,20),(71269630389,20)], + .scan 3 3812155117365, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1282853347029,320713336740,80178334188,20044583544,5011145892,1252786464,313196616,78299160,19574796,4893696,1223424,305856,76464,19116,4776,1200,288,72,24,12] 1 [(.D2,3812155117371),(.D0,71269630390),(.D0,100368471917),(.D0,52816230395),(.D0,36226512811),(.D0,7810762738),(.D0,14262443800),(.D0,1042547876),(.D0,201898045),(.D0,47779574),(.D0,10933416),(.D0,645736),(.D0,156391),(.D0,4594),(.D0,3540),(.D0,216)], + .batch [12] 855235564679 [(.D5,3384537335031),(.D1,1)], + .batch [185106463008] 855235564685 [(.D5,3384537335028),(.D1,88490200185),(.D1,50836518440),(.D0,35896560818),(.D3,7755770739),(.D0,14253278467),(.D2,1041020320),(.D2,201643452),(.D0,47737142),(.D4,10926343),(.D4,644556),(.D5,156194),(.D4,4560),(.D3,3534),(.D3,215)], + .scan 0 50, + .scan2 5 9 [(947788796188,4),(3338260719276,4),(80777430892,4),(49551056890,4),(35682317226,4),(7720063473,4),(14247327255,4),(1040028451,4),(201478140,4),(47709589,4),(10921751,4),(643791,4),(156066,4),(4539,4),(3530,4)], + .scan 5 214, + .scan 0 10, + .scan2 3 0 [(214,20),(3530,20),(4539,20),(156066,20),(643791,20),(10921751,20),(47709589,20),(201478140,20),(1040028451,20),(14247327255,20),(7720063473,20),(35682317226,20),(49551056890,20),(80777430892,20),(3338260719276,20)], + .scan 3 947788796183, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [2821109907453] 1 [(.D2,947788796189),(.D0,3338260719277),(.D0,80777430893),(.D0,49551056891),(.D0,35682317227),(.D0,7720063474),(.D0,14247327256),(.D0,1040028452),(.D0,201478141),(.D0,47709590),(.D0,10921752),(.D0,643792),(.D0,156067),(.D0,4540),(.D0,3531),(.D0,214)], + .scan 0 50, + .scan2 5 9 [(1410554953726,4),(242511319325,4),(3220714473132,4),(61186389868,4),(46285883386,4),(35138121642,4),(7629364209,4),(14232210711,4),(1037509027,4),(201058236,4),(47639605,4),(10910087,4),(641847,4),(155742,4),(4485,4),(3521,4)], + .scan 5 212, + .scan 0 10, + .scan2 3 0 [(212,20),(3521,20),(4485,20),(155742,20),(641847,20),(10910087,20),(47639605,20),(201058236,20),(1037509027,20),(14232210711,20),(7629364209,20),(35138121642,20),(46285883386,20),(61186389868,20),(3220714473132,20),(242511319325,20)], + .scan 3 1410554953721, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [4231664861183,1057916215296,264479053824,66119763456,16529940864,4132485216,1033121304,258280326,64570080,16142520,4035630,1008908,252226,63056,15766,3942,984,246,62,16,2,2,2] 1 [(.D2,1410554953727),(.D0,242511319326),(.D0,3220714473133),(.D0,61186389869),(.D0,46285883387),(.D0,35138121643),(.D0,7629364210),(.D0,14232210712),(.D0,1037509028),(.D0,201058237),(.D0,47639606),(.D0,10910088),(.D0,641848),(.D0,155743),(.D0,4486),(.D0,3522),(.D0,212)], + .batch [2] 2821109907456 [(.D1,1)], + .batch [22256481110,5564120280,1391030070,347757516,86939378,21734844,5433712,1358430,339606,84902,21226,5306,1326,330,84,22,6,308510771690] 2821109907457 [(.D5,7418827036),(.D5,3181532391084),(.D5,54656042860),(.D5,45197492218),(.D5,34956723114),(.D5,7599131121),(.D5,14227171863),(.D5,1036669219),(.D5,200918268),(.D5,47616277),(.D5,10906199),(.D5,641199),(.D5,155634),(.D5,4467),(.D5,3518),(.D1,212)], + .scan 0 50, + .scan2 5 9 [(2990202947375,4),(3103168226989,4),(41595348844,4),(43020709882,4),(34593926058,4),(7538664945,4),(14217094167,4),(1034989603,4),(200638332,4),(47569621,4),(10898423,4),(639903,4),(155418,4),(4431,4),(3512,4)], + .scan 5 210, + .scan 0 10, + .scan2 3 0 [(210,20),(3512,20),(4431,20),(155418,20),(639903,20),(10898423,20),(47569621,20),(200638332,20),(1034989603,20),(14217094167,20),(7538664945,20),(34593926058,20),(43020709882,20),(41595348844,20),(3103168226989,20)], + .scan 3 2990202947370, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [2821109907453] 1 [(.D2,2990202947376),(.D0,3103168226990),(.D0,41595348845),(.D0,43020709883),(.D0,34593926059),(.D0,7538664946),(.D0,14217094168),(.D0,1034989604),(.D0,200638333),(.D0,47569622),(.D0,10898424),(.D0,639904),(.D0,155419),(.D0,4432),(.D0,3513),(.D0,210)], + .scan 0 50, + .scan2 5 9 [(1410554953726,4),(2284925470512,4),(2985621980845,4),(22004307820,4),(39755536378,4),(34049730474,4),(7447965681,4),(14201977623,4),(1032470179,4),(200218428,4),(47499637,4),(10886759,4),(637959,4),(155094,4),(4377,4),(3503,4)], + .scan 5 208, + .scan 0 10, + .scan2 3 0 [(208,20),(3503,20),(4377,20),(155094,20),(637959,20),(10886759,20),(47499637,20),(200218428,20),(1032470179,20),(14201977623,20),(7447965681,20),(34049730474,20),(39755536378,20),(22004307820,20),(2985621980845,20),(2284925470512,20)], + .scan 3 1410554953721, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [4231664861183,1057916215296,264479053824,66119763456,16529940864,4132485216,1033121304,258280326,64570080,16142520,4035630,1008908,252226,63056,15766,3942,984,246,62,16,2,2,2] 1 [(.D2,1410554953727),(.D0,2284925470513),(.D0,2985621980846),(.D0,22004307821),(.D0,39755536379),(.D0,34049730475),(.D0,7447965682),(.D0,14201977624),(.D0,1032470180),(.D0,200218429),(.D0,47499638),(.D0,10886760),(.D0,637960),(.D0,155095),(.D0,4378),(.D0,3504),(.D0,208)], + .batch [2] 2821109907456 [(.D1,1)], + .batch [1671187767768,209552170536] 2821109907457 [(.D5,2049832978223),(.D5,2946439898797),(.D5,15473960812),(.D5,38667145210),(.D5,33868331946),(.D5,7417732593),(.D5,14196938775),(.D5,1031630371),(.D5,200078460),(.D5,47476309),(.D5,10882871),(.D5,637311),(.D5,154986),(.D5,4359),(.D5,3500),(.D1,208)], + .scan 0 50, + .scan2 5 9 [(3761479876608,4),(1579647993647,4),(2868075734701,4),(2413266796,4),(36490362874,4),(33505534890,4),(7357266417,4),(14186861079,4),(1029950755,4),(199798524,4),(47429653,4),(10875095,4),(636015,4),(154770,4),(4323,4),(3494,4)], + .scan 5 206, + .scan 0 10, + .scan2 3 0 [(206,20),(3494,20),(4323,20),(154770,20),(636015,20),(10875095,20),(47429653,20),(199798524,20),(1029950755,20),(14186861079,20),(7357266417,20),(33505534890,20),(36490362874,20),(2413266796,20),(2868075734701,20),(1579647993647,20)], + .scan 3 3761479876603, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1563796884669,390949221168,97737305184,24434326080,6108581952,1527145488,381786048,95446512,23861952,5965488,1490832,372816,93312,23328,5616,1296,864] 1 [(.D2,3761479876609),(.D0,1579647993648),(.D0,2868075734702),(.D0,2413266797),(.D0,36490362875),(.D0,33505534891),(.D0,7357266418),(.D0,14186861080),(.D0,1029950756),(.D0,199798525),(.D0,47429654),(.D0,10875096),(.D0,636016),(.D0,154771),(.D0,4324),(.D0,3495)], + .batch [2473599488112] 1042531256303 [(.D5,3240214248457),(.D5,1492770388955),(.D5,2853596133919),(.D3,36088151742),(.D5,33438499701),(.D1,7346093887),(.D2,14184998991),(.D4,1029640407),(.D0,199746800),(.D1,47421033),(.D5,10873658),(.D3,635776),(.D3,154731),(.D2,4317),(.D4,3493),(.D0,206)], + .scan 0 50, + .scan2 5 9 [(2279331000358,4),(2621814376429,4),(1389703743617,4),(2836418359696,4),(33225189371,4),(32961339306,4),(7266567153,4),(14171744535,4),(1027431331,4),(199378620,4),(47359669,4),(10863431,4),(634071,4),(154446,4),(4269,4),(3485,4)], + .scan 5 204, + .scan 0 10, + .scan2 3 0 [(204,20),(3485,20),(4269,20),(154446,20),(634071,20),(10863431,20),(47359669,20),(199378620,20),(1027431331,20),(14171744535,20),(7266567153,20),(32961339306,20),(33225189371,20),(2836418359696,20),(1389703743617,20),(2621814376429,20)], + .scan 3 2279331000353, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [6837993001079,1709498250270,427374562566,106843640642,26710910160,6677727540,1669431886,417357972,104339492,26084872,6521220,1630304,407574,101896,25472,6370,1592,396,100,26,6,2,2] 1 [(.D2,2279331000359),(.D0,2621814376430),(.D0,1389703743618),(.D0,2836418359697),(.D0,33225189372),(.D0,32961339307),(.D0,7266567154),(.D0,14171744536),(.D0,1027431332),(.D0,199378621),(.D0,47359670),(.D0,10863432),(.D0,634072),(.D0,154447),(.D0,4270),(.D0,3486),(.D0,204)], + .batch [2] 4558662000720 [(.D1,1)], + .batch [1301555907216] 4558662000721 [(.D5,2241925876368),(.D5,1326388993607),(.D1,2825865901362),(.D3,31466446316),(.D0,32668215464),(.D5,7217713179),(.D1,14163602207),(.D1,1026074277),(.D5,199152444),(.D3,47321974),(.D2,10857149),(.D0,633025),(.D2,154272),(.D2,4240),(.D1,3481),(.D3,203)], + .scan 0 50, + .scan2 5 9 [(5209439954328,4),(1916536899564,4),(1272157497473,4),(2816827318672,4),(29960015867,4),(32417143722,4),(7175867889,4),(14156627991,4),(1024911907,4),(198958716,4),(47289685,4),(10851767,4),(632127,4),(154122,4),(4215,4),(3476,4)], + .scan 5 202, + .scan 0 10, + .scan2 3 0 [(202,20),(3476,20),(4215,20),(154122,20),(632127,20),(10851767,20),(47289685,20),(198958716,20),(1024911907,20),(14156627991,20),(7175867889,20),(32417143722,20),(29960015867,20),(2816827318672,20),(1272157497473,20),(1916536899564,20)], + .scan 3 5209439954323, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [15628319862989,1298339581744] 1 [(.D2,5209439954329),(.D0,1916536899565),(.D0,1272157497474),(.D0,2816827318673),(.D0,29960015868),(.D0,32417143723),(.D0,7175867890),(.D0,14156627992),(.D0,1024911908),(.D0,198958717),(.D0,47289686),(.D0,10851768),(.D0,632128),(.D0,154123),(.D0,4216),(.D0,3477),(.D0,202)], + .scan 0 50, + .scan2 5 9 [(8463329722366,4),(977775093145,4),(1211259422700,4),(1154611251329,4),(2797236277648,4),(26694842363,4),(31872948138,4),(7085168625,4),(14141511447,4),(1022392483,4),(198538812,4),(47219701,4),(10840103,4),(630183,4),(153798,4),(4161,4),(3467,4)], + .scan 5 200, + .scan 0 10, + .scan2 3 0 [(200,20),(3467,20),(4161,20),(153798,20),(630183,20),(10840103,20),(47219701,20),(198538812,20),(1022392483,20),(14141511447,20),(7085168625,20),(31872948138,20),(26694842363,20),(2797236277648,20),(1154611251329,20),(1211259422700,20),(977775093145,20)], + .scan 3 8463329722361, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [17599951676637,4399987919148,1099996979796,274999244940,68749811244,17187452796,4296863196,1074215808,268553952,67138488,16784628,4196160,1049040,262260,65556,16392,4092,1020,252,72,24,7790037490474,1947509372620,486877343156,121719335788,30429833948,7607458486,1901864622,475466156,118866538,29716634,7429158,1857292,464322,116082,29018,7254,1816,452,114,28,8,438140403024] 1 [(.D2,8463329722367),(.D0,977775093146),(.D0,1211259422701),(.D0,1154611251330),(.D0,2797236277649),(.D0,26694842364),(.D0,31872948139),(.D0,7085168626),(.D0,14141511448),(.D0,1022392484),(.D0,198538813),(.D0,47219702),(.D0,10840104),(.D0,630184),(.D0,153799),(.D0,4162),(.D0,3468),(.D0,200)] +] +theorem chunk_13_ok : q6 cmds_13 cfg_13=some cfg_14:= by decide +kernel +def cmds_14 : List Cmd:=[ + .scan 0 50, + .scan2 5 9 [(17145729646245,4),(505981945839,4),(1037065005185,4),(2777645236624,4),(23429668859,4),(31328752554,4),(6994469361,4),(14126394903,4),(1019873059,4),(198118908,4),(47149717,4),(10828439,4),(628239,4),(153474,4),(4107,4),(3458,4)], + .scan 5 198, + .scan 0 10, + .scan2 3 0 [(198,20),(3458,20),(4107,20),(153474,20),(628239,20),(10828439,20),(47149717,20),(198118908,20),(1019873059,20),(14126394903,20),(6994469361,20),(31328752554,20),(23429668859,20),(2777645236624,20),(1037065005185,20),(505981945839,20)], + .scan 3 17145729646240, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [9107675025129,2276918756280,569229689064,142307422260,35576855568,8894213892,2223553476,555888372,138972096,34743024,8685756,2171424,542868,135720,33924,8484,2124,516,132,36,12] 1 [(.D2,17145729646246),(.D0,505981945840),(.D0,1037065005186),(.D0,2777645236625),(.D0,23429668860),(.D0,31328752555),(.D0,6994469362),(.D0,14126394904),(.D0,1019873060),(.D0,198118909),(.D0,47149718),(.D0,10828440),(.D0,628240),(.D0,153475),(.D0,4108),(.D0,3459),(.D0,198)], + .batch [797182124100] 6071783350079 [(.D5,14109837971206),(.D1,952734680880),(.D0,2763590182574),(.D2,21087159851),(.D4,30938334386),(.D2,6929399667),(.D0,14115549955),(.D2,1018065568),(.D2,197817660),(.D0,47099510),(.D4,10820071),(.D4,626844),(.D5,153242),(.D4,4068),(.D1,3453),(.D4,196)], + .scan 0 50, + .scan2 5 9 [(6470374412128,4),(13910542440181,4),(919518759041,4),(2758054195600,4),(20164495355,4),(30784556970,4),(6903770097,4),(14111278359,4),(1017353635,4),(197699004,4),(47079733,4),(10816775,4),(626295,4),(153150,4),(4053,4),(3449,4)], + .scan 5 196, + .scan 0 10, + .scan2 3 0 [(196,20),(3449,20),(4053,20),(153150,20),(626295,20),(10816775,20),(47079733,20),(197699004,20),(1017353635,20),(14111278359,20),(6903770097,20),(30784556970,20),(20164495355,20),(2758054195600,20),(919518759041,20),(13910542440181,20)], + .scan 3 6470374412123, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [16926659444733] 1 [(.D2,6470374412129),(.D0,13910542440182),(.D0,919518759042),(.D0,2758054195601),(.D0,20164495356),(.D0,30784556971),(.D0,6903770098),(.D0,14111278360),(.D0,1017353636),(.D0,197699005),(.D0,47079734),(.D0,10816776),(.D0,626296),(.D0,153151),(.D0,4054),(.D0,3450),(.D0,196)], + .scan 0 50, + .scan2 5 9 [(8463329722366,4),(2238709550945,4),(13205264963317,4),(801972512897,4),(2738463154576,4),(16899321851,4),(30240361386,4),(6813070833,4),(14096161815,4),(1014834211,4),(197279100,4),(47009749,4),(10805111,4),(624351,4),(152826,4),(3999,4),(3440,4)], + .scan 5 194, + .scan 0 10, + .scan2 3 0 [(194,20),(3440,20),(3999,20),(152826,20),(624351,20),(10805111,20),(47009749,20),(197279100,20),(1014834211,20),(14096161815,20),(6813070833,20),(30240361386,20),(16899321851,20),(2738463154576,20),(801972512897,20),(13205264963317,20),(2238709550945,20)], + .scan 3 8463329722361, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [25389989167103,6347497291776,1586874322944,396718580736,99179645184,24794911296,6198727824,1549681956,387420488,96855120,24213780,6053446,1513362,378342,94584,23646,5912,1476,370,92,24,6,2,2] 1 [(.D2,8463329722367),(.D0,2238709550946),(.D0,13205264963318),(.D0,801972512898),(.D0,2738463154577),(.D0,16899321852),(.D0,30240361387),(.D0,6813070834),(.D0,14096161816),(.D0,1014834212),(.D0,197279101),(.D0,47009750),(.D0,10805112),(.D0,624352),(.D0,152827),(.D0,4000),(.D0,3441),(.D0,194)], + .batch [2] 16926659444736 [(.D1,1)], + .batch [2484463791650,621115947914,155278986978,38819746744,9704936688,2426234172,606558542,151639636,37909908,9477476,2369370,592342,148086,37022,9256,2312,580,144,36,8,4,1328636873490] 16926659444737 [(.D5,828154597216),(.D5,12970172471029),(.D5,762790430849),(.D5,2731932807568),(.D5,15810930683),(.D5,30058962858),(.D5,6782837745),(.D5,14091122967),(.D5,1013994403),(.D5,197139132),(.D5,46986421),(.D5,10801223),(.D5,623703),(.D5,152718),(.D5,3981),(.D5,3437),(.D1,194)], + .scan 0 50, + .scan2 5 9 [(19247287075915,4),(12499987486454,4),(684426266753,4),(2718872113552,4),(13634148347,4),(29696165802,4),(6722371569,4),(14081045271,4),(1012314787,4),(196859196,4),(46939765,4),(10793447,4),(622407,4),(152502,4),(3945,4),(3431,4)], + .scan 5 192, + .scan 0 10, + .scan2 3 0 [(192,20),(3431,20),(3945,20),(152502,20),(622407,20),(10793447,20),(46939765,20),(196859196,20),(1012314787,20),(14081045271,20),(6722371569,20),(29696165802,20),(13634148347,20),(2718872113552,20),(684426266753,20),(12499987486454,20)], + .scan 3 19247287075910, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [16926659444733] 1 [(.D2,19247287075916),(.D0,12499987486455),(.D0,684426266754),(.D0,2718872113553),(.D0,13634148348),(.D0,29696165803),(.D0,6722371570),(.D0,14081045272),(.D0,1012314788),(.D0,196859197),(.D0,46939766),(.D0,10793448),(.D0,622408),(.D0,152503),(.D0,3946),(.D0,3432),(.D0,192)], + .scan 0 50, + .scan2 5 9 [(8463329722366,4),(15015622214732,4),(11794710009590,4),(566880020609,4),(2699281072528,4),(10368974843,4),(29151970218,4),(6631672305,4),(14065928727,4),(1009795363,4),(196439292,4),(46869781,4),(10781783,4),(620463,4),(152178,4),(3891,4),(3422,4)], + .scan 5 190, + .scan 0 10, + .scan2 3 0 [(190,20),(3422,20),(3891,20),(152178,20),(620463,20),(10781783,20),(46869781,20),(196439292,20),(1009795363,20),(14065928727,20),(6631672305,20),(29151970218,20),(10368974843,20),(2699281072528,20),(566880020609,20),(11794710009590,20),(15015622214732,20)], + .scan 3 8463329722361, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [25389989167103,6347497291776,1586874322944,396718580736,99179645184,24794911296,6198727824,1549681956,387420488,96855120,24213780,6053446,1513362,378342,94584,23646,5912,1476,370,92,24,6,2,2] 1 [(.D2,8463329722367),(.D0,15015622214733),(.D0,11794710009591),(.D0,566880020610),(.D0,2699281072529),(.D0,10368974844),(.D0,29151970219),(.D0,6631672306),(.D0,14065928728),(.D0,1009795364),(.D0,196439293),(.D0,46869782),(.D0,10781784),(.D0,620464),(.D0,152179),(.D0,3892),(.D0,3423),(.D0,190)], + .batch [2] 16926659444736 [(.D1,1)], + .batch [11284439629824] 16926659444737 [(.D5,13605067261003),(.D5,11559617517302),(.D5,527697938561),(.D5,2692750725520),(.D5,9280583675),(.D5,28970571690),(.D5,6601439217),(.D5,14060889879),(.D5,1008955555),(.D5,196299324),(.D5,46846453),(.D5,10777895),(.D5,619815),(.D5,152070),(.D5,3873),(.D5,3419),(.D1,190)], + .scan 0 50, + .scan2 5 9 [(22568879259648,4),(10783957353547,4),(11089432532726,4),(449333774465,4),(2679690031504,4),(7103801339,4),(28607774634,4),(6540973041,4),(14050812183,4),(1007275939,4),(196019388,4),(46799797,4),(10770119,4),(618519,4),(151854,4),(3837,4),(3413,4)], + .scan 5 188, + .scan 0 10, + .scan2 3 0 [(188,20),(3413,20),(3837,20),(151854,20),(618519,20),(10770119,20),(46799797,20),(196019388,20),(1007275939,20),(14050812183,20),(6540973041,20),(28607774634,20),(7103801339,20),(2679690031504,20),(449333774465,20),(11089432532726,20),(10783957353547,20)], + .scan 3 22568879259643, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [67706637778949,16926659444736,4231664861184,1057916215296,264479053824,66119763456,16529940864,4132485216,1033121304,258280326,64570082,16142520,4035630,1008906,252228,63058,15764,3940,986,246,60,16,6,1880739938300] 1 [(.D2,22568879259649),(.D0,10783957353548),(.D0,11089432532727),(.D0,449333774466),(.D0,2679690031505),(.D0,7103801340),(.D0,28607774635),(.D0,6540973042),(.D0,14050812184),(.D0,1007275940),(.D0,196019389),(.D0,46799798),(.D0,10770120),(.D0,618520),(.D0,151855),(.D0,3838),(.D0,3414),(.D0,188)], + .scan 0 50, + .scan2 5 9 [(46078128488448,4),(6552292492364,4),(10384155055862,4),(331787528321,4),(2660098990480,4),(3838627835,4),(28063579050,4),(6450273777,4),(14035695639,4),(1004756515,4),(195599484,4),(46729813,4),(10758455,4),(616575,4),(151530,4),(3783,4),(3404,4)], + .scan 5 186, + .scan 0 10, + .scan2 3 0 [(186,20),(3404,20),(3783,20),(151530,20),(616575,20),(10758455,20),(46729813,20),(195599484,20),(1004756515,20),(14035695639,20),(6450273777,20),(28063579050,20),(3838627835,20),(2660098990480,20),(331787528321,20),(10384155055862,20),(6552292492364,20)], + .scan 3 46078128488443, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [89547510173757,12012446494656] 1 [(.D2,46078128488449),(.D0,6552292492365),(.D0,10384155055863),(.D0,331787528322),(.D0,2660098990481),(.D0,3838627836),(.D0,28063579051),(.D0,6450273778),(.D0,14035695640),(.D0,1004756516),(.D0,195599485),(.D0,46729814),(.D0,10758456),(.D0,616576),(.D0,151531),(.D0,3784),(.D0,3405),(.D0,186)], + .scan 0 50, + .scan2 5 9 [(50779978334206,4),(20688139321345,4),(2320627631180,4),(9678877578998,4),(214241282177,4),(2640507949456,4),(573454331,4),(27519383466,4),(6359574513,4),(14020579095,4),(1002237091,4),(195179580,4),(46659829,4),(10746791,4),(614631,4),(151206,4),(3729,4),(3395,4)], + .scan 5 184, + .scan 0 10, + .scan2 3 0 [(184,20),(3395,20),(3729,20),(151206,20),(614631,20),(10746791,20),(46659829,20),(195179580,20),(1002237091,20),(14020579095,20),(6359574513,20),(27519383466,20),(573454331,20),(2640507949456,20),(214241282177,20),(9678877578998,20),(2320627631180,20),(20688139321345,20)], + .scan 3 50779978334201, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [80265256034685,20066313938688] 1 [(.D2,50779978334207),(.D0,20688139321346),(.D0,2320627631181),(.D0,9678877578999),(.D0,214241282178),(.D0,2640507949457),(.D0,573454332),(.D0,27519383467),(.D0,6359574514),(.D0,14020579096),(.D0,1002237092),(.D0,195179581),(.D0,46659830),(.D0,10746792),(.D0,614632),(.D0,151207),(.D0,3730),(.D0,3396)], + .batch [5016578438016,1254144632832,313536158208,78384039552,19596079872,4898973312,1224720000,306156672,76515840,19222272,4758912,1213056,279936,93312,93312] 50165784986687 [(.D5,25697085840863),(.D5,16507657239121),(.D5,1623880617476),(.D5,9562753076714),(.D5,194887198463),(.D5,2637282268837),(.D3,35840895),(.D1,27429781228),(.D2,6344640807),(.D4,14018090144),(.D0,1001822267),(.D4,195110442),(.D5,46648306),(.D1,10744872),(.D2,614311),(.D3,151153),(.D5,3720),(.D5,3394),(.D0,184)], + .batch [93312] 53510170674239 [(.D5,24024892997087),(.D5,16228958431825),(.D5,1577430816260),(.D5,9555011443178),(.D5,193596926207),(.D5,2637067223461),(.D1,1)], + .batch [72074678921278,11648554204610] 53510170720895 [(.D5,24024892973759),(.D5,16228958427937),(.D5,1577430815612),(.D5,9555011443070),(.D5,193596926189),(.D5,2637067223458),(.D5,27423807743),(.D3,6343645227),(.D4,14017924214),(.D4,1001794611),(.D2,195105834),(.D0,46647539),(.D4,10744742),(.D3,614290),(.D5,151149),(.D1,3721),(.D0,3394),(.D1,184)], + .scan 0 50, + .scan2 5 9 [(95371787283838,4),(3094084692287,4),(12740490381025,4),(996019474460,4),(9458109552878,4),(177446611157,4),(2634375504286,4),(26975187881,4),(6268875249,4),(14005462551,4),(999717667,4),(194759676,4),(46589845,4),(10735127,4),(612687,4),(150882,4),(3675,4),(3386,4)], + .scan 5 182, + .scan 0 10, + .scan2 3 0 [(182,20),(3386,20),(3675,20),(150882,20),(612687,20),(10735127,20),(46589845,20),(194759676,20),(999717667,20),(14005462551,20),(6268875249,20),(26975187881,20),(2634375504286,20),(177446611157,20),(9458109552878,20),(996019474460,20),(12740490381025,20),(3094084692287,20)], + .scan 3 95371787283833, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [55693524461193,13923381115296,3480845278824,870211319700,217552829928,54388207476,13597051872,3399262956,849815748,212453928,53113488,13278384,3319596,829884,207468,51876,12960,3240,816,216,48,12,12] 1 [(.D2,95371787283839),(.D0,3094084692288),(.D0,12740490381026),(.D0,996019474461),(.D0,9458109552879),(.D0,177446611158),(.D0,2634375504287),(.D0,26975187882),(.D0,6268875250),(.D0,14005462552),(.D0,999717668),(.D0,194759677),(.D0,46589846),(.D0,10735128),(.D0,612688),(.D0,150883),(.D0,3676),(.D0,3387)], + .batch [12] 37129016307461 [(.D5,76807279130108),(.D1,1)], + .batch [89183617899264] 37129016307467 [(.D5,76807279130105),(.D5,12224809598976),(.D5,910072677452),(.D5,9443785086710),(.D5,175059200129),(.D5,2633977602448),(.D1,26908870909),(.D3,6257822421),(.D0,14003620414),(.D0,999410645),(.D4,194708505),(.D3,46581317),(.D3,10733706),(.D5,612450),(.D1,150844),(.D2,3669),(.D4,3385),(.D0,182)], + .scan 0 50, + .scan2 5 9 [(81720825257098,4),(54511374655289,4),(8508825519840,4),(290741997596,4),(9340563306734,4),(157855570133,4),(2631110330782,4),(26430992297,4),(6178175985,4),(13990346007,4),(997198243,4),(194339772,4),(46519861,4),(10723463,4),(610743,4),(150558,4),(3621,4),(3377,4)], + .scan 5 180, + .scan 0 10, + .scan2 3 0 [(180,20),(3377,20),(3621,20),(150558,20),(610743,20),(10723463,20),(46519861,20),(194339772,20),(997198243,20),(13990346007,20),(6178175985,20),(26430992297,20),(2631110330782,20),(157855570133,20),(9340563306734,20),(290741997596,20),(8508825519840,20),(54511374655289,20)], + .scan 3 81720825257093, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [188400814443069,47100203610768,11775050902800,2943762725376,735940681344,183985170336,45996292368,11499073200,2874768192,718692480,179672688,44918064,11229840,2807136,702000,175392,44064,11232,2592,432,432,432] 1 [(.D2,81720825257099),(.D0,54511374655290),(.D0,8508825519841),(.D0,290741997597),(.D0,9340563306735),(.D0,157855570134),(.D0,2631110330783),(.D0,26430992298),(.D0,6178175986),(.D0,13990346008),(.D0,997198244),(.D0,194339773),(.D0,46519862),(.D0,10723464),(.D0,610744),(.D0,150559),(.D0,3622),(.D0,3378),(.D0,180)], + .batch [56761661328118,2931447686762] 125600542962119 [(.D5,18920553776039),(.D5,44044662741779),(.D5,6764373534255),(.D1,9292106307135),(.D3,149779403534),(.D2,2629764303016),(.D4,26206654336),(.D0,6140786326),(.D4,13984114397),(.D0,996159642),(.D1,194166673),(.D2,46491011),(.D3,10718655),(.D1,609943),(.D0,150425),(.D5,3599),(.D2,3374),(.D2,179)], + .scan 0 50, + .scan2 5 9 [(155447097469558,4),(3997276522319,4),(41557449866159,4),(6349838054985,4),(9223017060589,4),(138264529109,4),(2627845157278,4),(25886796713,4),(6087476721,4),(13975229463,4),(994678819,4),(193919868,4),(46449877,4),(10711799,4),(608799,4),(150234,4),(3567,4),(3368,4)], + .scan 5 178, + .scan 0 10, + .scan2 3 0 [(178,20),(3368,20),(3567,20),(150234,20),(608799,20),(10711799,20),(46449877,20),(193919868,20),(994678819,20),(13975229463,20),(6087476721,20),(25886796713,20),(2627845157278,20),(138264529109,20),(9223017060589,20),(6349838054985,20),(41557449866159,20),(3997276522319,20)], + .scan 3 155447097469553, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [71950977401769,17987744350440,4496936087604,1124234021904,281058505464,70264626372,17566156584,4391539152,1097884800,274471200,68617800,17154444,4288608,1072152,268044,67008,16740,4200,1044,264,60,12] 1 [(.D2,155447097469559),(.D0,3997276522320),(.D0,41557449866160),(.D0,6349838054986),(.D0,9223017060590),(.D0,138264529110),(.D0,2627845157279),(.D0,25886796714),(.D0,6087476722),(.D0,13975229464),(.D0,994678820),(.D0,193919869),(.D0,46449878),(.D0,10711800),(.D0,608800),(.D0,150235),(.D0,3568),(.D0,3369)], + .batch [85570850579112] 47967318267833 [(.D5,131463438335642),(.D5,40891237112440),(.D1,6238802596033),(.D0,9204511150764),(.D5,135180210805),(.D4,2627331104227),(.D3,25801121205),(.D5,6073197470),(.D2,13972849588),(.D3,994282174),(.D4,193853760),(.D1,46438860),(.D1,10709964),(.D0,608494),(.D0,150184),(.D4,3558),(.D5,3367),(.D0,178)] +] +theorem chunk_14_ok : q6 cmds_14 cfg_14=some cfg_15:= by decide +kernel +def cmds_15 : List Cmd:=[ + .scan 0 50, + .scan2 5 9 [(90752743557388,4),(110070725690864,4),(37325785004977,4),(5644560578121,4),(9105470814445,4),(118673488085,4),(2624579983774,4),(25342601129,4),(5996777457,4),(13960112919,4),(992159395,4),(193499964,4),(46379893,4),(10700135,4),(606855,4),(149910,4),(3513,4),(3359,4)], + .scan 5 176, + .scan 0 10, + .scan2 3 0 [(176,20),(3359,20),(3513,20),(149910,20),(606855,20),(10700135,20),(46379893,20),(193499964,20),(992159395,20),(13960112919,20),(5996777457,20),(25342601129,20),(2624579983774,20),(118673488085,20),(9105470814445,20),(5644560578121,20),(37325785004977,20),(110070725690864,20)], + .scan 3 90752743557383, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [272258230672169,68064557668040,17016139417012,4254034854252,1063508713562,265877178390,66469294600,16617323648,4154330914,1038582728,259645680,64911420,16227856,4056966,1014240,253560,63390,15848,3960,990,250,62,16,2,41058127630152] 1 [(.D2,90752743557389),(.D0,110070725690865),(.D0,37325785004978),(.D0,5644560578122),(.D0,9105470814446),(.D0,118673488086),(.D0,2624579983775),(.D0,25342601130),(.D0,5996777458),(.D0,13960112920),(.D0,992159396),(.D0,193499965),(.D0,46379894),(.D0,10700136),(.D0,606856),(.D0,149911),(.D0,3514),(.D0,3360),(.D0,176)], + .scan 0 50, + .scan2 5 9 [(202034550929853,4),(84680736523762,4),(33094120143793,4),(4939283101257,4),(8987924568301,4),(99082447061,4),(2621314810270,4),(24798405545,4),(5906078193,4),(13944996375,4),(989639971,4),(193080060,4),(46309909,4),(10688471,4),(604911,4),(149586,4),(3459,4),(3350,4)], + .scan 5 174, + .scan 0 10, + .scan2 3 0 [(174,20),(3350,20),(3459,20),(149586,20),(604911,20),(10688471,20),(46309909,20),(193080060,20),(989639971,20),(13944996375,20),(5906078193,20),(24798405545,20),(2621314810270,20),(99082447061,20),(8987924568301,20),(4939283101257,20),(33094120143793,20),(84680736523762,20)], + .scan 3 202034550929848, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [606103652789563,3256087220930] 1 [(.D2,202034550929854),(.D0,84680736523763),(.D0,33094120143794),(.D0,4939283101258),(.D0,8987924568302),(.D0,99082447062),(.D0,2621314810271),(.D0,24798405546),(.D0,5906078194),(.D0,13944996376),(.D0,989639972),(.D0,193080061),(.D0,46309910),(.D0,10688472),(.D0,604912),(.D0,149587),(.D0,3460),(.D0,3351),(.D0,174)], + .scan 0 50, + .scan2 5 9 [(304679870005246,4),(49694615927230,4),(59290747356658,4),(28862455282609,4),(4234005624393,4),(8870378322157,4),(79491406037,4),(2618049636766,4),(24254209961,4),(5815378929,4),(13929879831,4),(987120547,4),(192660156,4),(46239925,4),(10676807,4),(602967,4),(149262,4),(3405,4),(3341,4)], + .scan 5 172, + .scan 0 10, + .scan2 3 0 [(172,20),(3341,20),(3405,20),(149262,20),(602967,20),(10676807,20),(46239925,20),(192660156,20),(987120547,20),(13929879831,20),(5815378929,20),(24254209961,20),(2618049636766,20),(79491406037,20),(8870378322157,20),(4234005624393,20),(28862455282609,20),(59290747356658,20),(49694615927230,20)], + .scan 3 304679870005241, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [894503086690161,223625771672532,55906442918136,13976610729528,3494152682388,873538170588,218384542656,54596135664,13649033916,3412258476,853064616,213266160,53316540,13329132,3332280,833076,208260,52080,13008,3264,804,204,48,24,19536523325584,4884130831398,1221032707848,305258176962,76314544242,19078636060,4769659016,1192414752,298103688,74525922,18631482,4657870,1164468,291116,72780,18196,4548,1136,286,72,18,2,2,2] 1 [(.D2,304679870005247),(.D0,49694615927231),(.D0,59290747356659),(.D0,28862455282610),(.D0,4234005624394),(.D0,8870378322158),(.D0,79491406038),(.D0,2618049636767),(.D0,24254209962),(.D0,5815378930),(.D0,13929879832),(.D0,987120548),(.D0,192660157),(.D0,46239926),(.D0,10676808),(.D0,602968),(.D0,149263),(.D0,3406),(.D0,3342),(.D0,172)], + .batch [64088763089020] 609359740010496 [(.D1,49922948961810),(.D3,27301155550135),(.D4,3973789002314),(.D4,8827008885144),(.D4,72263166535),(.D2,2616844930183),(.D0,24053425531),(.D1,5781914858),(.D1,13924302487),(.D0,986190990),(.D1,192505231),(.D0,46214105),(.D0,10672504),(.D1,602251),(.D4,149142),(.D1,3386),(.D1,3339),(.D2,171)], + .scan 0 50, + .scan2 5 9 [(641404121555005,4),(33900758189554,4),(24630790421425,4),(3528728147529,4),(8752832076013,4),(59900365013,4),(2614784463262,4),(23710014377,4),(5724679665,4),(13914763287,4),(984601123,4),(192240252,4),(46169941,4),(10665143,4),(601023,4),(148938,4),(3351,4),(3332,4)], + .scan 5 170, + .scan 0 10, + .scan2 3 0 [(170,20),(3332,20),(3351,20),(148938,20),(601023,20),(10665143,20),(46169941,20),(192240252,20),(984601123,20),(13914763287,20),(5724679665,20),(23710014377,20),(2614784463262,20),(59900365013,20),(8752832076013,20),(3528728147529,20),(24630790421425,20),(33900758189554,20)], + .scan 3 641404121555000, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [609359740010493] 1 [(.D2,641404121555006),(.D0,33900758189555),(.D0,24630790421426),(.D0,3528728147530),(.D0,8752832076014),(.D0,59900365014),(.D0,2614784463263),(.D0,23710014378),(.D0,5724679666),(.D0,13914763288),(.D0,984601124),(.D0,192240253),(.D0,46169942),(.D0,10665144),(.D0,601024),(.D0,148939),(.D0,3352),(.D0,3333),(.D0,170)], + .scan 0 50, + .scan2 5 9 [(304679870005246,4),(489064186552382,4),(8510769022450,4),(20399125560241,4),(2823450670665,4),(8635285829869,4),(40309323989,4),(2611519289758,4),(23165818793,4),(5633980401,4),(13899646743,4),(982081699,4),(191820348,4),(46099957,4),(10653479,4),(599079,4),(148614,4),(3297,4),(3323,4)], + .scan 5 168, + .scan 0 10, + .scan2 3 0 [(168,20),(3323,20),(3297,20),(148614,20),(599079,20),(10653479,20),(46099957,20),(191820348,20),(982081699,20),(13899646743,20),(5633980401,20),(23165818793,20),(2611519289758,20),(40309323989,20),(8635285829869,20),(2823450670665,20),(20399125560241,20),(8510769022450,20),(489064186552382,20)], + .scan 3 304679870005241, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [914039610015743,228509902503936,57127475625984,14281868906496,3570467226624,892616806656,223154201664,55788550416,13947137604,3486784400,871696098,217924026,54481006,13620252,3405062,851266,212816,53206,13302,3324,830,208,54,12,2,2,2] 1 [(.D2,304679870005247),(.D0,489064186552383),(.D0,8510769022451),(.D0,20399125560242),(.D0,2823450670666),(.D0,8635285829870),(.D0,40309323990),(.D0,2611519289759),(.D0,23165818794),(.D0,5633980402),(.D0,13899646744),(.D0,982081700),(.D0,191820349),(.D0,46099958),(.D0,10653480),(.D0,599080),(.D0,148615),(.D0,3298),(.D0,3324),(.D0,168)], + .batch [2] 609359740010496 [(.D1,1)], + .batch [853907401488,213476850372,53369212596,13342303152,3335575788,833893956,208473480,52118364,13029588,3257412,814356,203580,50904,12720,3168,792,204,48,24,67516880578596] 609359740010497 [(.D5,438284208218173),(.D5,47439300082),(.D5,18988570606513),(.D5,2588358178377),(.D5,8596103747821),(.D5,33778976981),(.D5,2610430898590),(.D5,22984420265),(.D5,5603747313),(.D5,13894607895),(.D5,981241891),(.D5,191680380),(.D5,46076629),(.D5,10649591),(.D5,598431),(.D5,148506),(.D5,3279),(.D5,3320),(.D1,168)], + .scan 0 50, + .scan2 5 9 [(643687451900790,4),(421120352273026,4),(16167460699058,4),(2118173193801,4),(8517739583725,4),(20718282965,4),(2608254116254,4),(22621623209,4),(5543281137,4),(13884530199,4),(979562275,4),(191400444,4),(46029973,4),(10641815,4),(597135,4),(148290,4),(3243,4),(3314,4)], + .scan 5 166, + .scan 0 10, + .scan2 3 0 [(166,20),(3314,20),(3243,20),(148290,20),(597135,20),(10641815,20),(46029973,20),(191400444,20),(979562275,20),(13884530199,20),(5543281137,20),(22621623209,20),(2608254116254,20),(20718282965,20),(8517739583725,20),(2118173193801,20),(16167460699058,20),(421120352273026,20)], + .scan 3 643687451900785, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [483316105046397,120829026238272,5214608725824] 1 [(.D2,643687451900791),(.D0,421120352273027),(.D0,16167460699059),(.D0,2118173193802),(.D0,8517739583726),(.D0,20718282966),(.D0,2608254116255),(.D0,22621623210),(.D0,5543281138),(.D0,13884530200),(.D0,979562276),(.D0,191400445),(.D0,46029974),(.D0,10641816),(.D0,597136),(.D0,148291),(.D0,3244),(.D0,3315),(.D0,166)], + .scan 0 50, + .scan2 5 9 [(304679870005246,4),(491347516898167,4),(395730363105922,4),(11935795837874,4),(1412895716937,4),(8400193337581,4),(1127241941,4),(2604988942750,4),(22077427625,4),(5452581873,4),(13869413655,4),(977042851,4),(190980540,4),(45959989,4),(10630151,4),(595191,4),(147966,4),(3189,4),(3305,4)], + .scan 5 164, + .scan 0 10, + .scan2 3 0 [(164,20),(3305,20),(3189,20),(147966,20),(595191,20),(10630151,20),(45959989,20),(190980540,20),(977042851,20),(13869413655,20),(5452581873,20),(22077427625,20),(2604988942750,20),(1127241941,20),(8400193337581,20),(1412895716937,20),(11935795837874,20),(395730363105922,20),(491347516898167,20)], + .scan 3 304679870005241, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [157777800231165,39444449917824,9861112502784,2465278219008,616319508096,154079853696,38519940096,9630078336,2407449600,601862400,150418944,37698048,9331200,2426112,559872,93312,93312,93312] 1 [(.D2,304679870005247),(.D0,491347516898168),(.D0,395730363105923),(.D0,11935795837875),(.D0,1412895716938),(.D0,8400193337582),(.D0,1127241942),(.D0,2604988942751),(.D0,22077427626),(.D0,5452581874),(.D0,13869413656),(.D0,977042852),(.D0,190980541),(.D0,45959990),(.D0,10630152),(.D0,595192),(.D0,147967),(.D0,3190),(.D0,3306)], + .batch [574298006739840] 105185200138559 [(.D5,252087269935967),(.D5,482582083553287),(.D5,394269457548442),(.D5,11692311578294),(.D5,1372315007007),(.D5,8393429885926),(.D1,2604801069094),(.D4,22046115349),(.D4,5447363160),(.D5,13868543870),(.D4,976897887),(.D0,190956380),(.D3,45955963),(.D2,10629480),(.D3,595080),(.D2,147948),(.D0,3187),(.D2,3305),(.D0,164)], + .scan 0 50, + .scan2 5 9 [(392334203508478,4),(108512768251007,4),(458652999939127,4),(390281276946082,4),(11027614811234,4),(1261532212497,4),(8374966086841,4),(2601723769245,4),(21533232041,4),(5361882609,4),(13854297111,4),(974523427,4),(190560636,4),(45890005,4),(10618487,4),(593247,4),(147642,4),(3135,4),(3296,4)], + .scan 5 162, + .scan 0 10, + .scan2 3 0 [(162,20),(3296,20),(3135,20),(147642,20),(593247,20),(10618487,20),(45890005,20),(190560636,20),(974523427,20),(13854297111,20),(5361882609,20),(21533232041,20),(2601723769245,20),(8374966086841,20),(1261532212497,20),(11027614811234,20),(390281276946082,20),(458652999939127,20),(108512768251007,20)], + .scan 3 392334203508473, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1177002610525439,294250652631360,73562663157840,18390665789460,4597666447364,1149416611840,287354152962,71838538238,17959634560,4489908642,1122477158,280619290,70154822,17538706,4384676,1096170,274042,68510,17128,4284,1070,268,66,18,2,2,2] 1 [(.D2,392334203508479),(.D0,108512768251008),(.D0,458652999939128),(.D0,390281276946083),(.D0,11027614811235),(.D0,1261532212498),(.D0,8374966086842),(.D0,2601723769246),(.D0,21533232042),(.D0,5361882610),(.D0,13854297112),(.D0,974523428),(.D0,190560637),(.D0,45890006),(.D0,10618488),(.D0,593248),(.D0,147643),(.D0,3136),(.D0,3297),(.D0,162)], + .batch [2] 784668407016960 [(.D1,1)], + .batch [129371202998780,32342800749696,8085700187424,2021425046856,505356261714,126339065430,31584766356,7896191588,1974047898,493511974,123377994,30844500,7711124,1927780,481946,120486,30120,7530,1884,472,116,30,6,4,2,2] 784668407016961 [(.D5,43123734332926),(.D5,447754827619447),(.D5,388464914892802),(.D5,10724887802354),(.D5,1211077711017),(.D5,8366557003261),(.D5,2600322255315),(.D5,21299646386),(.D3,5322951667),(.D1,13847808622),(.D2,973442012),(.D1,190380401),(.D1,45859967),(.D4,10613480),(.D1,592414),(.D4,147503),(.D2,3112),(.D3,3293),(.D2,161)], + .batch [29218111167748] 870915875682817 [(.D1,440567538563959),(.D5,387267033383554),(.D5,10525240884146),(.D5,1177803224649),(.D5,8361011255533),(.D5,2599397964027),(.D5,21145597838),(.D5,5297276909),(.D0,13843529495),(.D5,972728824),(.D1,190261537),(.D2,45840155),(.D5,10610179),(.D0,591863),(.D5,147411),(.D3,3097),(.D1,3291),(.D4,160)], + .scan 0 50, + .scan2 5 9 [(885524931266690,4),(433263010772021,4),(386049612084898,4),(10322337334370,4),(1143985966353,4),(8355375045817,4),(2598458595741,4),(20989036457,4),(5271183345,4),(13839180567,4),(972004003,4),(190140732,4),(45820021,4),(10606823,4),(591303,4),(147318,4),(3081,4),(3287,4)], + .scan 5 160, + .scan 0 10, + .scan2 3 0 [(160,20),(3287,20),(3081,20),(147318,20),(591303,20),(10606823,20),(45820021,20),(190140732,20),(972004003,20),(13839180567,20),(5271183345,20),(20989036457,20),(2598458595741,20),(8355375045817,20),(1143985966353,20),(10322337334370,20),(386049612084898,20),(433263010772021,20)], + .scan 3 885524931266685, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [609359740010493] 1 [(.D2,885524931266691),(.D0,433263010772022),(.D0,386049612084899),(.D0,10322337334371),(.D0,1143985966354),(.D0,8355375045818),(.D0,2598458595742),(.D0,20989036458),(.D0,5271183346),(.D0,13839180568),(.D0,972004004),(.D0,190140733),(.D0,45820022),(.D0,10606824),(.D0,591304),(.D0,147319),(.D0,3082),(.D0,3288),(.D0,160)], + .scan 0 50, + .scan2 5 9 [(304679870005246,4),(733184996264067,4),(407873021604917,4),(381817947223714,4),(9617059857506,4),(1026439720209,4),(8335784004793,4),(2595193422237,4),(20444840873,4),(5180484081,4),(13824064023,4),(969484579,4),(189720828,4),(45750037,4),(10595159,4),(589359,4),(146994,4),(3027,4),(3278,4)], + .scan 5 158, + .scan 0 10, + .scan2 3 0 [(158,20),(3278,20),(3027,20),(146994,20),(589359,20),(10595159,20),(45750037,20),(189720828,20),(969484579,20),(13824064023,20),(5180484081,20),(20444840873,20),(2595193422237,20),(8335784004793,20),(1026439720209,20),(9617059857506,20),(381817947223714,20),(407873021604917,20),(733184996264067,20)], + .scan 3 304679870005241, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [914039610015743,228509902503936,57127475625984,14281868906496,3570467226624,892616806656,223154201664,55788550416,13947137604,3486784400,871696098,217924026,54481006,13620252,3405062,851266,212816,53206,13302,3324,830,208,54,12,2,2,2] 1 [(.D2,304679870005247),(.D0,733184996264068),(.D0,407873021604918),(.D0,381817947223715),(.D0,9617059857507),(.D0,1026439720210),(.D0,8335784004794),(.D0,2595193422238),(.D0,20444840874),(.D0,5180484082),(.D0,13824064024),(.D0,969484580),(.D0,189720829),(.D0,45750038),(.D0,10595160),(.D0,589360),(.D0,146995),(.D0,3028),(.D0,3279),(.D0,158)], + .batch [2] 609359740010496 [(.D1,1)], + .batch [406239826673664] 609359740010497 [(.D5,682405017929858),(.D5,399409691882549),(.D5,380407392269986),(.D5,9381967365218),(.D5,987257638161),(.D5,8329253657785),(.D5,2594105031069),(.D5,20263442345),(.D5,5150250993),(.D5,13819025175),(.D5,968644771),(.D5,189580860),(.D5,45726709),(.D5,10591271),(.D5,588711),(.D5,146886),(.D5,3009),(.D5,3275),(.D1,158)], + .scan 0 50, + .scan2 5 9 [(812479653347328,4),(580845061261442,4),(382483032437813,4),(377586282362530,4),(8911782380642,4),(908893474065,4),(8316192963769,4),(2591928248733,4),(19900645289,4),(5089784817,4),(13808947479,4),(966965155,4),(189300924,4),(45680053,4),(10583495,4),(587415,4),(146670,4),(2973,4),(3269,4)], + .scan 5 156, + .scan 0 10, + .scan2 3 0 [(156,20),(3269,20),(2973,20),(146670,20),(587415,20),(10583495,20),(45680053,20),(189300924,20),(966965155,20),(13808947479,20),(5089784817,20),(19900645289,20),(2591928248733,20),(8316192963769,20),(908893474065,20),(8911782380642,20),(377586282362530,20),(382483032437813,20),(580845061261442,20)], + .scan 3 812479653347323, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [2437438960041989,609359740010496,152339935002624,38084983750656,9521245937664,2380311484416,595077871104,148769467776,37192366944,9298091736,2324522934,581130734,145282684,36320670,9080168,2270040,567510,141880,35468,8868,2218,554,138,34,8,4,67706637778940] 1 [(.D2,812479653347329),(.D0,580845061261443),(.D0,382483032437814),(.D0,377586282362531),(.D0,8911782380643),(.D0,908893474066),(.D0,8316192963770),(.D0,2591928248734),(.D0,19900645290),(.D0,5089784818),(.D0,13808947480),(.D0,966965156),(.D0,189300925),(.D0,45680054),(.D0,10583496),(.D0,587416),(.D0,146671),(.D0,2974),(.D0,3270),(.D0,156)], + .scan 0 50, + .scan2 5 9 [(1658812625584128,4),(428505126258819,4),(357093043270709,4),(373354617501346,4),(8206504903778,4),(791347227921,4),(8296601922745,4),(2588663075229,4),(19356449705,4),(4999085553,4),(13793830935,4),(964445731,4),(188881020,4),(45610069,4),(10571831,4),(585471,4),(146346,4),(2919,4),(3260,4)], + .scan 5 154, + .scan 0 10, + .scan2 3 0 [(154,20),(3260,20),(2919,20),(146346,20),(585471,20),(10571831,20),(45610069,20),(188881020,20),(964445731,20),(13793830935,20),(4999085553,20),(19356449705,20),(2588663075229,20),(8296601922745,20),(791347227921,20),(8206504903778,20),(373354617501346,20),(357093043270709,20),(428505126258819,20)], + .scan 3 1658812625584123, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [3656158440062973] 1 [(.D2,1658812625584129),(.D0,428505126258820),(.D0,357093043270710),(.D0,373354617501347),(.D0,8206504903779),(.D0,791347227922),(.D0,8296601922746),(.D0,2588663075230),(.D0,19356449706),(.D0,4999085554),(.D0,13793830936),(.D0,964445732),(.D0,188881021),(.D0,45610070),(.D0,10571832),(.D0,585472),(.D0,146347),(.D0,2920),(.D0,3261),(.D0,154)], + .scan 0 50, + .scan2 5 9 [(1828079220031486,4),(744773015568385,4),(276165191256195,4),(331703054103605,4),(369122952640162,4),(7501227426914,4),(673800981777,4),(8277010881721,4),(2585397901725,4),(18812254121,4),(4908386289,4),(13778714391,4),(961926307,4),(188461116,4),(45540085,4),(10560167,4),(583527,4),(146022,4),(2865,4),(3251,4)], + .scan 5 152, + .scan 0 10, + .scan2 3 0 [(152,20),(3251,20),(2865,20),(146022,20),(583527,20),(10560167,20),(45540085,20),(188461116,20),(961926307,20),(13778714391,20),(4908386289,20),(18812254121,20),(2585397901725,20),(8277010881721,20),(673800981777,20),(7501227426914,20),(369122952640162,20),(331703054103605,20),(276165191256195,20),(744773015568385,20)], + .scan 3 1828079220031481, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [5484237660094463,1371059415023616,342764853755904,85691213438976,21422803359744,5355700839936,1338925209984,334731302496,83682825624,20920706406,5230176600,1307544150,326886038,81721510,20430378,5107592,1276900,319224,79806,19952,4986,1248,312,78,18,6,2,2] 1 [(.D2,1828079220031487),(.D0,744773015568386),(.D0,276165191256196),(.D0,331703054103606),(.D0,369122952640163),(.D0,7501227426915),(.D0,673800981778),(.D0,8277010881722),(.D0,2585397901726),(.D0,18812254122),(.D0,4908386290),(.D0,13778714392),(.D0,961926308),(.D0,188461117),(.D0,45540086),(.D0,10560168),(.D0,583528),(.D0,146023),(.D0,2866),(.D0,3252),(.D0,152)], + .batch [2] 3656158440062976 [(.D1,1)], + .batch [1320279436689410,330069859172354,82517464793088,20629366198272,5157341549568,1289335387392,322333846848,80583461712,20145865428,5036466358,1259116590,314779146,78694788,19673696,4918422,1229608,307400,76852,19212,4802,1200,300,76,20,4,2] 3656158440062977 [(.D5,440093145563136),(.D5,225385212921987),(.D5,323239724381237),(.D5,367712397686434),(.D5,7266134934626),(.D5,634618899729),(.D5,8270480534713),(.D5,2584309510557),(.D5,18630855593),(.D5,4878153201),(.D5,13773675543),(.D5,961086499),(.D5,188321148),(.D5,45516757),(.D5,10556279),(.D5,582879),(.D5,145914),(.D5,2847),(.D5,3248),(.D1,152)], + .batch [2] 4536344731189251 [(.D1,1)], + .batch [112844396298238] 4536344731189252 [(.D1,152036355328132),(.D0,311014914782262),(.D0,365674929419939),(.D0,6926556890211),(.D0,578022558994),(.D0,8261047811258),(.D0,2582737389982),(.D0,18368835498),(.D0,4834483186),(.D0,13766397208),(.D0,959873444),(.D0,188118973),(.D0,45483062),(.D0,10550664),(.D0,581944),(.D0,145759),(.D2,2821),(.D5,3244),(.D4,150)] +] +theorem chunk_15_ok : q6 cmds_15 cfg_15=some cfg_16:= by decide +kernel +def cmds_16 : List Cmd:=[ + .scan 0 50, + .scan2 5 9 [(4592766929338370,4),(123825256253571,4),(306313064936501,4),(364891287778978,4),(6795949950050,4),(556254735633,4),(8257419840697,4),(2582132728221,4),(18268058537,4),(4817687025,4),(13763597847,4),(959406883,4),(188041212,4),(45470101,4),(10548503,4),(581583,4),(145698,4),(2811,4),(3242,4)], + .scan 5 150, + .scan 0 10, + .scan2 3 0 [(150,20),(3242,20),(2811,20),(145698,20),(581583,20),(10548503,20),(45470101,20),(188041212,20),(959406883,20),(13763597847,20),(4817687025,20),(18268058537,20),(2582132728221,20),(8257419840697,20),(556254735633,20),(6795949950050,20),(364891287778978,20),(306313064936501,20),(123825256253571,20)], + .scan 3 4592766929338365, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [2228854612564305,557213653141068,139303413285264,34825853321316,8706463330320,2176615832580,544153958160,136038489528,34009622388,8502405588,2125601412,531400356,132850080,33212520,8303124,2075784,518952,129732,32436,8112,2016,504,132,36,12] 1 [(.D2,4592766929338371),(.D0,123825256253572),(.D0,306313064936502),(.D0,364891287778979),(.D0,6795949950051),(.D0,556254735634),(.D0,8257419840698),(.D0,2582132728222),(.D0,18268058538),(.D0,4817687026),(.D0,13763597848),(.D0,959406884),(.D0,188041213),(.D0,45470102),(.D0,10548504),(.D0,581584),(.D0,145699),(.D0,2812),(.D0,3243),(.D0,150)], + .batch [114058714996212] 1485903075042863 [(.D5,3849815391816939),(.D1,285675522227574),(.D0,361451697327491),(.D0,6222684874803),(.D0,460710556426),(.D0,8241495810830),(.D0,2579478723244),(.D0,17825724375),(.D2,4743964665),(.D2,13751310787),(.D5,957359040),(.D0,187699906),(.D0,45413217),(.D3,10539023),(.D2,580003),(.D3,145435),(.D1,2768),(.D5,3235),(.D4,148)], + .scan 0 50, + .scan2 5 9 [(1542932432540968,4),(3821300713067886,4),(280923075769397,4),(360659622917794,4),(6090672473186,4),(438708489489,4),(8237828799673,4),(2578867554717,4),(17723862953,4),(4726987761,4),(13748481303,4),(956887459,4),(187621308,4),(45400117,4),(10536839,4),(579639,4),(145374,4),(2757,4),(3233,4)], + .scan 5 148, + .scan 0 10, + .scan2 3 0 [(148,20),(3233,20),(2757,20),(145374,20),(579639,20),(10536839,20),(45400117,20),(187621308,20),(956887459,20),(13748481303,20),(4726987761,20),(17723862953,20),(2578867554717,20),(8237828799673,20),(438708489489,20),(6090672473186,20),(360659622917794,20),(280923075769397,20),(3821300713067886,20)], + .scan 3 1542932432540963, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [3656158440062973] 1 [(.D2,1542932432540969),(.D0,3821300713067887),(.D0,280923075769398),(.D0,360659622917795),(.D0,6090672473187),(.D0,438708489490),(.D0,8237828799674),(.D0,2578867554718),(.D0,17723862954),(.D0,4726987762),(.D0,13748481304),(.D0,956887460),(.D0,187621309),(.D0,45400118),(.D0,10536840),(.D0,579640),(.D0,145375),(.D0,2758),(.D0,3234),(.D0,148)], + .scan 0 50, + .scan2 5 9 [(1828079220031486,4),(628892822525225,4),(3668960778065262,4),(255533086602293,4),(356427958056610,4),(5385394996322,4),(321162243345,4),(8218237758649,4),(2575602381213,4),(17179667369,4),(4636288497,4),(13733364759,4),(954368035,4),(187201404,4),(45330133,4),(10525175,4),(577695,4),(145050,4),(2703,4),(3224,4)], + .scan 5 146, + .scan 0 10, + .scan2 3 0 [(146,20),(3224,20),(2703,20),(145050,20),(577695,20),(10525175,20),(45330133,20),(187201404,20),(954368035,20),(13733364759,20),(4636288497,20),(17179667369,20),(2575602381213,20),(8218237758649,20),(321162243345,20),(5385394996322,20),(356427958056610,20),(255533086602293,20),(3668960778065262,20),(628892822525225,20)], + .scan 3 1828079220031481, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [5484237660094463,1371059415023616,342764853755904,85691213438976,21422803359744,5355700839936,1338925209984,334731302496,83682825624,20920706406,5230176600,1307544150,326886038,81721510,20430378,5107592,1276900,319224,79806,19952,4986,1248,312,78,18,6,2,2] 1 [(.D2,1828079220031487),(.D0,628892822525226),(.D0,3668960778065263),(.D0,255533086602294),(.D0,356427958056611),(.D0,5385394996323),(.D0,321162243346),(.D0,8218237758650),(.D0,2575602381214),(.D0,17179667370),(.D0,4636288498),(.D0,13733364760),(.D0,954368036),(.D0,187201405),(.D0,45330134),(.D0,10525176),(.D0,577696),(.D0,145051),(.D0,2704),(.D0,3225),(.D0,146)], + .batch [2] 3656158440062976 [(.D1,1)], + .batch [972638857559930,243159714389984,60789928597494,15197482149376,3799370537342,949842634336,237460658586,59365164644,14841291162,3710322790,927580698,231895176,57973794,14493446,3623362,905840,226462,56616,14154,3536,886,222,54,14,4,190097858327010] 3656158440062977 [(.D5,324212952519976),(.D5,3618180799731054),(.D5,247069756879925),(.D5,355017403102882),(.D5,5150302504034),(.D5,281980161297),(.D5,8211707411641),(.D5,2574513990045),(.D5,16998268841),(.D5,4606055409),(.D5,13728325911),(.D5,953528227),(.D5,187061436),(.D5,45306805),(.D5,10521287),(.D5,577047),(.D5,144942),(.D5,2685),(.D5,3221),(.D1,146)], + .scan 0 50, + .scan2 5 9 [(4399633274266435,4),(3516620843062639,4),(230143097435189,4),(352196293195426,4),(4680117519458,4),(203615997201,4),(8198646717625,4),(2572337207709,4),(16635471785,4),(4545589233,4),(13718248215,4),(951848611,4),(186781500,4),(45260149,4),(10513511,4),(575751,4),(144726,4),(2649,4),(3215,4)], + .scan 5 144, + .scan 0 10, + .scan2 3 0 [(144,20),(3215,20),(2649,20),(144726,20),(575751,20),(10513511,20),(45260149,20),(186781500,20),(951848611,20),(13718248215,20),(4545589233,20),(16635471785,20),(2572337207709,20),(8198646717625,20),(203615997201,20),(4680117519458,20),(352196293195426,20),(230143097435189,20),(3516620843062639,20)], + .scan 3 4399633274266430, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [3656158440062973] 1 [(.D2,4399633274266436),(.D0,3516620843062640),(.D0,230143097435190),(.D0,352196293195427),(.D0,4680117519459),(.D0,203615997202),(.D0,8198646717626),(.D0,2572337207710),(.D0,16635471786),(.D0,4545589234),(.D0,13718248216),(.D0,951848612),(.D0,186781501),(.D0,45260150),(.D0,10513512),(.D0,575752),(.D0,144727),(.D0,2650),(.D0,3216),(.D0,144)], + .scan 0 50, + .scan2 5 9 [(1828079220031486,4),(3485593664250692,4),(3364280908060015,4),(204753108268085,4),(347964628334242,4),(3974840042594,4),(86069751057,4),(8179055676601,4),(2569072034205,4),(16091276201,4),(4454889969,4),(13703131671,4),(949329187,4),(186361596,4),(45190165,4),(10501847,4),(573807,4),(144402,4),(2595,4),(3206,4)], + .scan 5 142, + .scan 0 10, + .scan2 3 0 [(142,20),(3206,20),(2595,20),(144402,20),(573807,20),(10501847,20),(45190165,20),(186361596,20),(949329187,20),(13703131671,20),(4454889969,20),(16091276201,20),(2569072034205,20),(8179055676601,20),(86069751057,20),(3974840042594,20),(347964628334242,20),(204753108268085,20),(3364280908060015,20),(3485593664250692,20)], + .scan 3 1828079220031481, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [5484237660094463,1371059415023616,342764853755904,85691213438976,21422803359744,5355700839936,1338925209984,334731302496,83682825624,20920706406,5230176600,1307544150,326886038,81721510,20430378,5107592,1276900,319224,79806,19952,4986,1248,312,78,18,6,2,2] 1 [(.D2,1828079220031487),(.D0,3485593664250693),(.D0,3364280908060016),(.D0,204753108268086),(.D0,347964628334243),(.D0,3974840042595),(.D0,86069751058),(.D0,8179055676602),(.D0,2569072034206),(.D0,16091276202),(.D0,4454889970),(.D0,13703131672),(.D0,949329188),(.D0,186361597),(.D0,45190166),(.D0,10501848),(.D0,573808),(.D0,144403),(.D0,2596),(.D0,3207),(.D0,142)], + .batch [2] 3656158440062976 [(.D1,1)], + .batch [1093795542649728,273448885685760,68362221405888,17090555347584,4272638844672,1068159726720,267039923904,66759977088,16690002048,4172492736,1043134848,260775936,65178432,16314048,4074624,1010880,248832,77760,15552] 3656158440062977 [(.D5,3180913794245443),(.D5,3313500929725807),(.D5,196289778545717),(.D5,346554073380514),(.D5,3739747550306),(.D5,46887669009),(.D5,8172525329593),(.D5,2567983643037),(.D5,15909877673),(.D5,4424656881),(.D5,13698092823),(.D5,948489379),(.D5,186221628),(.D5,45166837),(.D5,10497959),(.D5,573159),(.D5,144294),(.D5,2577),(.D5,3203),(.D1,142)], + .batch [15552] 4385355468506497 [(.D5,2816315280023683),(.D5,3252734510688847),(.D5,186162042039557),(.D5,344866117296154),(.D5,3458421536246),(.D1,1)], + .batch [163174150515456] 4385355468514273 [(.D5,2816315280019795),(.D5,3252734510688199),(.D5,186162042039449),(.D5,344866117296136),(.D5,3458421536243),(.D1,8164710718092),(.D5,2566681207787),(.D4,15692805131),(.D1,4388478125),(.D5,13692063030),(.D5,947484414),(.D4,186054134),(.D2,45138922),(.D4,10493306),(.D5,572384),(.D0,144166),(.D2,2556),(.D2,3200),(.D4,140)], + .scan 0 50, + .scan2 5 9 [(4466942543772000,4),(2775521742390931,4),(3245935587750055,4),(185028888216425,4),(344677258325632,4),(3426945041159,4),(8159464635577,4),(2565806860701,4),(15547080617,4),(4364190705,4),(13688015127,4),(946809763,4),(185941692,4),(45120181,4),(10490183,4),(571863,4),(144078,4),(2541,4),(3197,4)], + .scan 5 140, + .scan 0 10, + .scan2 3 0 [(140,20),(3197,20),(2541,20),(144078,20),(571863,20),(10490183,20),(45120181,20),(185941692,20),(946809763,20),(13688015127,20),(4364190705,20),(15547080617,20),(2565806860701,20),(8159464635577,20),(3426945041159,20),(344677258325632,20),(185028888216425,20),(3245935587750055,20),(2775521742390931,20)], + .scan 3 4466942543771995, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [3656158440062973] 1 [(.D2,4466942543772001),(.D0,2775521742390932),(.D0,3245935587750056),(.D0,185028888216426),(.D0,344677258325633),(.D0,3426945041160),(.D0,8159464635578),(.D0,2565806860702),(.D0,15547080618),(.D0,4364190706),(.D0,13688015128),(.D0,946809764),(.D0,185941693),(.D0,45120182),(.D0,10490184),(.D0,571864),(.D0,144079),(.D0,2542),(.D0,3198),(.D0,140)], + .scan 0 50, + .scan2 5 9 [(1828079220031486,4),(3552902933756257,4),(2623181807388307,4),(3220545598582951,4),(180797223355241,4),(343971980848768,4),(3309398795015,4),(8139873594553,4),(2562541687197,4),(15002885033,4),(4273491441,4),(13672898583,4),(944290339,4),(185521788,4),(45050197,4),(10478519,4),(569919,4),(143754,4),(2487,4),(3188,4)], + .scan 5 138, + .scan 0 10, + .scan2 3 0 [(138,20),(3188,20),(2487,20),(143754,20),(569919,20),(10478519,20),(45050197,20),(185521788,20),(944290339,20),(13672898583,20),(4273491441,20),(15002885033,20),(2562541687197,20),(8139873594553,20),(3309398795015,20),(343971980848768,20),(180797223355241,20),(3220545598582951,20),(2623181807388307,20),(3552902933756257,20)], + .scan 3 1828079220031481, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [5484237660094463,1371059415023616,342764853755904,85691213438976,21422803359744,5355700839936,1338925209984,334731302496,83682825624,20920706406,5230176600,1307544150,326886038,81721510,20430378,5107592,1276900,319224,79806,19952,4986,1248,312,78,18,6,2,2] 1 [(.D2,1828079220031487),(.D0,3552902933756258),(.D0,2623181807388308),(.D0,3220545598582952),(.D0,180797223355242),(.D0,343971980848769),(.D0,3309398795016),(.D0,8139873594554),(.D0,2562541687198),(.D0,15002885034),(.D0,4273491442),(.D0,13672898584),(.D0,944290340),(.D0,185521789),(.D0,45050198),(.D0,10478520),(.D0,569920),(.D0,143755),(.D0,2488),(.D0,3189),(.D0,138)], + .batch [2] 3656158440062976 [(.D1,1)], + .batch [2437438960041984] 3656158440062977 [(.D5,3248223063751008),(.D5,2572401829054099),(.D5,3212082268860583),(.D5,179386668401513),(.D5,343736888356480),(.D5,3270216712967),(.D5,8133343247545),(.D5,2561453296029),(.D5,14821486505),(.D5,4243258353),(.D5,13667859735),(.D5,943450531),(.D5,185381820),(.D5,45026869),(.D5,10474631),(.D5,569271),(.D5,143646),(.D5,2469),(.D5,3185),(.D1,138)], + .scan 0 50, + .scan2 5 9 [(4874877920083968,4),(2638863323740512,4),(2470841872385683,4),(3195155609415847,4),(176565558494057,4),(343266703371904,4),(3191852548871,4),(8120282553529,4),(2559276513693,4),(14458689449,4),(4182792177,4),(13657782039,4),(941770915,4),(185101884,4),(44980213,4),(10466855,4),(567975,4),(143430,4),(2433,4),(3179,4)], + .scan 5 136, + .scan 0 10, + .scan2 3 0 [(136,20),(3179,20),(2433,20),(143430,20),(567975,20),(10466855,20),(44980213,20),(185101884,20),(941770915,20),(13657782039,20),(4182792177,20),(14458689449,20),(2559276513693,20),(8120282553529,20),(3191852548871,20),(343266703371904,20),(176565558494057,20),(3195155609415847,20),(2470841872385683,20),(2638863323740512,20)], + .scan 3 4874877920083963, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [14624633760251909,3656158440062976,914039610015744,228509902503936,57127475625984,14281868906496,3570467226624,892616806656,223154201664,55788550416,13947137604,3486784400,871696102,217924026,54481004,13620252,3405064,851264,212818,53204,13300,3326,832,206,52,14,4,406239826673660] 1 [(.D2,4874877920083969),(.D0,2638863323740513),(.D0,2470841872385684),(.D0,3195155609415848),(.D0,176565558494058),(.D0,343266703371905),(.D0,3191852548872),(.D0,8120282553530),(.D0,2559276513694),(.D0,14458689450),(.D0,4182792178),(.D0,13657782040),(.D0,941770916),(.D0,185101885),(.D0,44980214),(.D0,10466856),(.D0,567976),(.D0,143431),(.D0,2434),(.D0,3180),(.D0,136)], + .scan 0 50, + .scan2 5 9 [(9952875753504768,4),(1724823713724769,4),(2318501937383059,4),(3169765620248743,4),(172333893632873,4),(342561425895040,4),(3074306302727,4),(8100691512505,4),(2556011340189,4),(13914493865,4),(4092092913,4),(13642665495,4),(939251491,4),(184681980,4),(44910229,4),(10455191,4),(566031,4),(143106,4),(2379,4),(3170,4)], + .scan 5 134, + .scan 0 10, + .scan2 3 0 [(134,20),(3170,20),(2379,20),(143106,20),(566031,20),(10455191,20),(44910229,20),(184681980,20),(939251491,20),(13642665495,20),(4092092913,20),(13914493865,20),(2556011340189,20),(8100691512505,20),(3074306302727,20),(342561425895040,20),(172333893632873,20),(3169765620248743,20),(2318501937383059,20),(1724823713724769,20)], + .scan 3 9952875753504763, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [21936950640377853] 1 [(.D2,9952875753504769),(.D0,1724823713724770),(.D0,2318501937383060),(.D0,3169765620248744),(.D0,172333893632874),(.D0,342561425895041),(.D0,3074306302728),(.D0,8100691512506),(.D0,2556011340190),(.D0,13914493866),(.D0,4092092914),(.D0,13642665496),(.D0,939251492),(.D0,184681981),(.D0,44910230),(.D0,10455192),(.D0,566032),(.D0,143107),(.D0,2380),(.D0,3171),(.D0,134)], + .scan 0 50, + .scan2 5 9 [(10968475320188926,4),(4468638093410305,4),(810784103709025,4),(2166162002380435,4),(3144375631081639,4),(168102228771689,4),(341856148418176,4),(2956760056583,4),(8081100471481,4),(2552746166685,4),(13370298281,4),(4001393649,4),(13627548951,4),(936732067,4),(184262076,4),(44840245,4),(10443527,4),(564087,4),(142782,4),(2325,4),(3161,4)], + .scan 5 132, + .scan 0 10, + .scan2 3 0 [(132,20),(3161,20),(2325,20),(142782,20),(564087,20),(10443527,20),(44840245,20),(184262076,20),(936732067,20),(13627548951,20),(4001393649,20),(13370298281,20),(2552746166685,20),(8081100471481,20),(2956760056583,20),(341856148418176,20),(168102228771689,20),(3144375631081639,20),(2166162002380435,20),(810784103709025,20),(4468638093410305,20)], + .scan 3 10968475320188921, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [32905425960566783,8226356490141696,2056589122535424,514147280633856,128536820158464,32134205039616,8033551259904,2008387814976,502096953744,125524238436,31381059608,7845264900,1961316226,490329056,122582266,30645566,7661392,1915346,478836,119710,29928,7482,1872,468,116,28,8,2,2] 1 [(.D2,10968475320188927),(.D0,4468638093410306),(.D0,810784103709026),(.D0,2166162002380436),(.D0,3144375631081640),(.D0,168102228771690),(.D0,341856148418177),(.D0,2956760056584),(.D0,8081100471482),(.D0,2552746166686),(.D0,13370298282),(.D0,4001393650),(.D0,13627548952),(.D0,936732068),(.D0,184262077),(.D0,44840246),(.D0,10443528),(.D0,564088),(.D0,142783),(.D0,2326),(.D0,3162),(.D0,132)], + .batch [2] 21936950640377856 [(.D1,1)], + .batch [7921676620136450,1980419155034114,495104788758528,123776197189632,30944049297408,7736012324352,1934003081088,483500770272,120875192568,30218798142,7554699534,1888674886,472168722,118042178,29510544,7377636,1844410,461102,115276,28820,7204,1802,450,112,30,6,2] 21936950640377857 [(.D5,2640558873378816),(.D5,506104233703777),(.D5,2115382024046227),(.D5,3135912301359271),(.D5,166691673817961),(.D5,341621055925888),(.D5,2917577974535),(.D5,8074570124473),(.D5,2551657775517),(.D5,13188899753),(.D5,3971160561),(.D5,13622510103),(.D5,935892259),(.D5,184122108),(.D5,44816917),(.D5,10439639),(.D5,563439),(.D5,142674),(.D5,2307),(.D5,3158),(.D1,132)], + .batch [2] 27218068387135491 [(.D1,1)], + .batch [198033264421926,49508316105480,12377079026370,3094269756594,773567439146,193391859786,48347964948,12086991238,3021747810,755436950,188859238,47214810,11803704,2950926,737730,184434,46106,11526,2884,720,180,44,12,4,68837004204476] 27218068387135492 [(.D1,66011088140642),(.D0,2042033166452372),(.D0,3123687491760296),(.D0,164654205551466),(.D0,341281477881473),(.D0,2860981633800),(.D0,8065137401018),(.D0,2550085654942),(.D0,12926879658),(.D0,3927490546),(.D0,13615231768),(.D0,934679204),(.D0,183919933),(.D0,44783222),(.D0,10434024),(.D0,562504),(.D0,142519),(.D2,2281),(.D5,3154),(.D4,130)], + .scan 0 50, + .scan2 5 9 [(27384509065519012,4),(2013822067377812,4),(3118985641914535,4),(163870563910505,4),(341150870941312,4),(2839213810439,4),(8061509430457,4),(2549480993181,4),(12826102697,4),(3910694385,4),(13612432407,4),(934212643,4),(183842172,4),(44770261,4),(10431863,4),(562143,4),(142458,4),(2271,4),(3152,4)], + .scan 5 130, + .scan 0 10, + .scan2 3 0 [(130,20),(3152,20),(2271,20),(142458,20),(562143,20),(10431863,20),(44770261,20),(183842172,20),(934212643,20),(13612432407,20),(3910694385,20),(12826102697,20),(2549480993181,20),(8061509430457,20),(2839213810439,20),(341150870941312,20),(163870563910505,20),(3118985641914535,20),(2013822067377812,20)], + .scan 3 27384509065519007, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [3656158440062973] 1 [(.D2,27384509065519013),(.D0,2013822067377813),(.D0,3118985641914536),(.D0,163870563910506),(.D0,341150870941313),(.D0,2839213810440),(.D0,8061509430458),(.D0,2549480993182),(.D0,12826102698),(.D0,3910694386),(.D0,13612432408),(.D0,934212644),(.D0,183842173),(.D0,44770262),(.D0,10431864),(.D0,562144),(.D0,142459),(.D0,2272),(.D0,3153),(.D0,130)], + .scan 0 50, + .scan2 5 9 [(1828079220031486,4),(26470469455503269,4),(1861482132375188,4),(3093595652747431,4),(159638899049321,4),(340445593464448,4),(2721667564295,4),(8041918389433,4),(2546215819677,4),(12281907113,4),(3819995121,4),(13597315863,4),(931693219,4),(183422268,4),(44700277,4),(10420199,4),(560199,4),(142134,4),(2217,4),(3143,4)], + .scan 5 128, + .scan 0 10, + .scan2 3 0 [(128,20),(3143,20),(2217,20),(142134,20),(560199,20),(10420199,20),(44700277,20),(183422268,20),(931693219,20),(13597315863,20),(3819995121,20),(12281907113,20),(2546215819677,20),(8041918389433,20),(2721667564295,20),(340445593464448,20),(159638899049321,20),(3093595652747431,20),(1861482132375188,20),(26470469455503269,20)], + .scan 3 1828079220031481, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [5484237660094463,1371059415023616,342764853755904,85691213438976,21422803359744,5355700839936,1338925209984,334731302496,83682825624,20920706406,5230176600,1307544150,326886038,81721510,20430378,5107592,1276900,319224,79806,19952,4986,1248,312,78,18,6,2,2] 1 [(.D2,1828079220031487),(.D0,26470469455503270),(.D0,1861482132375189),(.D0,3093595652747432),(.D0,159638899049322),(.D0,340445593464449),(.D0,2721667564296),(.D0,8041918389434),(.D0,2546215819678),(.D0,12281907114),(.D0,3819995122),(.D0,13597315864),(.D0,931693220),(.D0,183422269),(.D0,44700278),(.D0,10420200),(.D0,560200),(.D0,142135),(.D0,2218),(.D0,3144),(.D0,128)], + .batch [2] 3656158440062976 [(.D1,1)], + .batch [2437438960041984] 3656158440062977 [(.D5,26165789585498020),(.D5,1810702154040980),(.D5,3085132323025063),(.D5,158228344095593),(.D5,340210500972160),(.D5,2682485482247),(.D5,8035388042425),(.D5,2545127428509),(.D5,12100508585),(.D5,3789762033),(.D5,13592277015),(.D5,930853411),(.D5,183282300),(.D5,44676949),(.D5,10416311),(.D5,559551),(.D5,142026),(.D5,2199),(.D5,3140),(.D1,128)] +] +theorem chunk_16_ok : q6 cmds_16 cfg_16=some cfg_17:= by decide +kernel +def cmds_17 : List Cmd:=[ + .scan 0 50, + .scan2 5 9 [(4874877920083968,4),(25556429845487524,4),(1709142197372564,4),(3068205663580327,4),(155407234188137,4),(339740315987584,4),(2604121318151,4),(8022327348409,4),(2542950646173,4),(11737711529,4),(3729295857,4),(13582199319,4),(929173795,4),(183002364,4),(44630293,4),(10408535,4),(558255,4),(141810,4),(2163,4),(3134,4)], + .scan 5 126, + .scan 0 10, + .scan2 3 0 [(126,20),(3134,20),(2163,20),(141810,20),(558255,20),(10408535,20),(44630293,20),(183002364,20),(929173795,20),(13582199319,20),(3729295857,20),(11737711529,20),(2542950646173,20),(8022327348409,20),(2604121318151,20),(339740315987584,20),(155407234188137,20),(3068205663580327,20),(1709142197372564,20),(25556429845487524,20)], + .scan 3 4874877920083963, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [14624633760251909,3656158440062976,914039610015744,228509902503936,57127475625984,14281868906496,3570467226624,892616806656,223154201664,55788550416,13947137604,3486784400,871696102,217924026,54481004,13620252,3405064,851264,212818,53204,13300,3326,832,206,52,14,4,406239826673660] 1 [(.D2,4874877920083969),(.D0,25556429845487525),(.D0,1709142197372565),(.D0,3068205663580328),(.D0,155407234188138),(.D0,339740315987585),(.D0,2604121318152),(.D0,8022327348410),(.D0,2542950646174),(.D0,11737711530),(.D0,3729295858),(.D0,13582199320),(.D0,929173796),(.D0,183002365),(.D0,44630294),(.D0,10408536),(.D0,558256),(.D0,141811),(.D0,2164),(.D0,3135),(.D0,126)], + .scan 0 50, + .scan2 5 9 [(9952875753504768,4),(24642390235471781,4),(1556802262369940,4),(3042815674413223,4),(151175569326953,4),(339035038510720,4),(2486575072007,4),(8002736307385,4),(2539685472669,4),(11193515945,4),(3638596593,4),(13567082775,4),(926654371,4),(182582460,4),(44560309,4),(10396871,4),(556311,4),(141486,4),(2109,4),(3125,4)], + .scan 5 124, + .scan 0 10, + .scan2 3 0 [(124,20),(3125,20),(2109,20),(141486,20),(556311,20),(10396871,20),(44560309,20),(182582460,20),(926654371,20),(13567082775,20),(3638596593,20),(11193515945,20),(2539685472669,20),(8002736307385,20),(2486575072007,20),(339035038510720,20),(151175569326953,20),(3042815674413223,20),(1556802262369940,20),(24642390235471781,20)], + .scan 3 9952875753504763, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [21936950640377853] 1 [(.D2,9952875753504769),(.D0,24642390235471782),(.D0,1556802262369941),(.D0,3042815674413224),(.D0,151175569326954),(.D0,339035038510721),(.D0,2486575072008),(.D0,8002736307386),(.D0,2539685472670),(.D0,11193515946),(.D0,3638596594),(.D0,13567082776),(.D0,926654372),(.D0,182582461),(.D0,44560310),(.D0,10396872),(.D0,556312),(.D0,141487),(.D0,2110),(.D0,3126),(.D0,124)], + .scan 0 50, + .scan2 5 9 [(10968475320188926,4),(4468638093410305,4),(23728350625456037,4),(1404462327367316,4),(3017425685246119,4),(146943904465769,4),(338329761033856,4),(2369028825863,4),(7983145266361,4),(2536420299165,4),(10649320361,4),(3547897329,4),(13551966231,4),(924134947,4),(182162556,4),(44490325,4),(10385207,4),(554367,4),(141162,4),(2055,4),(3116,4)], + .scan 5 122, + .scan 0 10, + .scan2 3 0 [(122,20),(3116,20),(2055,20),(141162,20),(554367,20),(10385207,20),(44490325,20),(182162556,20),(924134947,20),(13551966231,20),(3547897329,20),(10649320361,20),(2536420299165,20),(7983145266361,20),(2369028825863,20),(338329761033856,20),(146943904465769,20),(3017425685246119,20),(1404462327367316,20),(23728350625456037,20),(4468638093410305,20)], + .scan 3 10968475320188921, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [32905425960566783,8226356490141696,2056589122535424,514147280633856,128536820158464,32134205039616,8033551259904,2008387814976,502096953744,125524238436,31381059608,7845264900,1961316226,490329056,122582266,30645566,7661392,1915346,478836,119710,29928,7482,1872,468,116,28,8,2,2] 1 [(.D2,10968475320188927),(.D0,4468638093410306),(.D0,23728350625456038),(.D0,1404462327367317),(.D0,3017425685246120),(.D0,146943904465770),(.D0,338329761033857),(.D0,2369028825864),(.D0,7983145266362),(.D0,2536420299166),(.D0,10649320362),(.D0,3547897330),(.D0,13551966232),(.D0,924134948),(.D0,182162557),(.D0,44490326),(.D0,10385208),(.D0,554368),(.D0,141163),(.D0,2056),(.D0,3117),(.D0,122)], + .batch [2] 21936950640377856 [(.D1,1)], + .batch [7921676620136450,1980419155034114,495104788758528,123776197189632,30944049297408,7736012324352,1934003081088,483500770272,120875192568,30218798142,7554699534,1888674886,472168722,118042178,29510544,7377636,1844410,461102,115276,28820,7204,1802,450,112,30,6,2] 21936950640377857 [(.D5,2640558873378816),(.D5,23423670755450789),(.D5,1353682349033108),(.D5,3008962355523751),(.D5,145533349512041),(.D5,338094668541568),(.D5,2329846743815),(.D5,7976614919353),(.D5,2535331907997),(.D5,10467921833),(.D5,3517664241),(.D5,13546927383),(.D5,923295139),(.D5,182022588),(.D5,44466997),(.D5,10381319),(.D5,553719),(.D5,141054),(.D5,2037),(.D5,3113),(.D1,122)], + .batch [2] 27218068387135491 [(.D1,1)], + .batch [677066377789438] 27218068387135492 [(.D1,22983577609887654),(.D0,1280333491439253),(.D0,2996737545924776),(.D0,143495881245546),(.D0,337755090497153),(.D0,2273250403080),(.D0,7967182195898),(.D0,2533759787422),(.D0,10205901738),(.D0,3473994226),(.D0,13539649048),(.D0,922082084),(.D0,181820413),(.D0,44433302),(.D0,10375704),(.D0,552784),(.D0,140899),(.D2,2011),(.D5,3109),(.D4,120)], + .scan 0 50, + .scan2 5 9 [(27556601576030210,4),(22814311015440293,4),(1252122392364692,4),(2992035696079015,4),(142712239604585,4),(337624483556992,4),(2251482579719,4),(7963554225337,4),(2533155125661,4),(10105124777,4),(3457198065,4),(13536849687,4),(921615523,4),(181742652,4),(44420341,4),(10373543,4),(552423,4),(140838,4),(2001,4),(3107,4)], + .scan 5 120, + .scan 0 10, + .scan2 3 0 [(120,20),(3107,20),(2001,20),(140838,20),(552423,20),(10373543,20),(44420341,20),(181742652,20),(921615523,20),(13536849687,20),(3457198065,20),(10105124777,20),(2533155125661,20),(7963554225337,20),(2251482579719,20),(337624483556992,20),(142712239604585,20),(2992035696079015,20),(1252122392364692,20),(22814311015440293,20)], + .scan 3 27556601576030205, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [21936950640377853] 1 [(.D2,27556601576030211),(.D0,22814311015440294),(.D0,1252122392364693),(.D0,2992035696079016),(.D0,142712239604586),(.D0,337624483556993),(.D0,2251482579720),(.D0,7963554225338),(.D0,2533155125662),(.D0,10105124778),(.D0,3457198066),(.D0,13536849688),(.D0,921615524),(.D0,181742653),(.D0,44420342),(.D0,10373544),(.D0,552424),(.D0,140839),(.D0,2002),(.D0,3108),(.D0,120)], + .scan 0 50, + .scan2 5 9 [(10968475320188926,4),(22072363915935747,4),(21900271405424549,4),(1099782457362068,4),(2966645706911911,4),(138480574743401,4),(336919206080128,4),(2133936333575,4),(7943963184313,4),(2529889952157,4),(9560929193,4),(3366498801,4),(13521733143,4),(919096099,4),(181322748,4),(44350357,4),(10361879,4),(550479,4),(140514,4),(1947,4),(3098,4)], + .scan 5 118, + .scan 0 10, + .scan2 3 0 [(118,20),(3098,20),(1947,20),(140514,20),(550479,20),(10361879,20),(44350357,20),(181322748,20),(919096099,20),(13521733143,20),(3366498801,20),(9560929193,20),(2529889952157,20),(7943963184313,20),(2133936333575,20),(336919206080128,20),(138480574743401,20),(2966645706911911,20),(1099782457362068,20),(21900271405424549,20),(22072363915935747,20)], + .scan 3 10968475320188921, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [32905425960566783,8226356490141696,2056589122535424,514147280633856,128536820158464,32134205039616,8033551259904,2008387814976,502096953744,125524238436,31381059608,7845264900,1961316226,490329056,122582266,30645566,7661392,1915346,478836,119710,29928,7482,1872,468,116,28,8,2,2] 1 [(.D2,10968475320188927),(.D0,22072363915935748),(.D0,21900271405424550),(.D0,1099782457362069),(.D0,2966645706911912),(.D0,138480574743402),(.D0,336919206080129),(.D0,2133936333576),(.D0,7943963184314),(.D0,2529889952158),(.D0,9560929194),(.D0,3366498802),(.D0,13521733144),(.D0,919096100),(.D0,181322749),(.D0,44350358),(.D0,10361880),(.D0,550480),(.D0,140515),(.D0,1948),(.D0,3099),(.D0,118)], + .batch [2] 21936950640377856 [(.D1,1)], + .batch [14624633760251904] 21936950640377857 [(.D5,20244284695904258),(.D5,21595591535419301),(.D5,1049002479027860),(.D5,2958182377189543),(.D5,137070019789673),(.D5,336684113587840),(.D5,2094754251527),(.D5,7937432837305),(.D5,2528801560989),(.D5,9379530665),(.D5,3336265713),(.D5,13516694295),(.D5,918256291),(.D5,181182780),(.D5,44327029),(.D5,10357991),(.D5,549831),(.D5,140406),(.D5,1929),(.D5,3095),(.D1,118)], + .scan 0 50, + .scan2 5 9 [(29249267520503808,4),(16588126255841282,4),(20986231795408805,4),(947442522359444,4),(2941255717744807,4),(134248909882217,4),(336213928603264,4),(2016390087431,4),(7924372143289,4),(2526624778653,4),(9016733609,4),(3275799537,4),(13506616599,4),(916576675,4),(180902844,4),(44280373,4),(10350215,4),(548535,4),(140190,4),(1893,4),(3089,4)], + .scan 5 116, + .scan 0 10, + .scan2 3 0 [(116,20),(3089,20),(1893,20),(140190,20),(548535,20),(10350215,20),(44280373,20),(180902844,20),(916576675,20),(13506616599,20),(3275799537,20),(9016733609,20),(2526624778653,20),(7924372143289,20),(2016390087431,20),(336213928603264,20),(134248909882217,20),(2941255717744807,20),(947442522359444,20),(20986231795408805,20),(16588126255841282,20)], + .scan 3 29249267520503803, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [87747802561511429,21936950640377856,5484237660094464,1371059415023616,342764853755904,85691213438976,21422803359744,5355700839936,1338925209984,334731302496,83682825624,20920706406,5230176602,1307544150,326886036,81721510,20430378,5107596,1276898,319224,79806,19950,4990,1248,312,78,18,6,2437438960041980] 1 [(.D2,29249267520503809),(.D0,16588126255841283),(.D0,20986231795408806),(.D0,947442522359445),(.D0,2941255717744808),(.D0,134248909882218),(.D0,336213928603265),(.D0,2016390087432),(.D0,7924372143290),(.D0,2526624778654),(.D0,9016733610),(.D0,3275799538),(.D0,13506616600),(.D0,916576676),(.D0,180902845),(.D0,44280374),(.D0,10350216),(.D0,548536),(.D0,140191),(.D0,1894),(.D0,3090),(.D0,116)], + .scan 0 50, + .scan2 5 9 [(59717254521028608,4),(11103888595746819,4),(20072192185393061,4),(795102587356820,4),(2915865728577703,4),(130017245021033,4),(335508651126400,4),(1898843841287,4),(7904781102265,4),(2523359605149,4),(8472538025,4),(3185100273,4),(13491500055,4),(914057251,4),(180482940,4),(44210389,4),(10338551,4),(546591,4),(139866,4),(1839,4),(3080,4)], + .scan 5 114, + .scan 0 10, + .scan2 3 0 [(114,20),(3080,20),(1839,20),(139866,20),(546591,20),(10338551,20),(44210389,20),(180482940,20),(914057251,20),(13491500055,20),(3185100273,20),(8472538025,20),(2523359605149,20),(7904781102265,20),(1898843841287,20),(335508651126400,20),(130017245021033,20),(2915865728577703,20),(795102587356820,20),(20072192185393061,20),(11103888595746819,20)], + .scan 3 59717254521028603, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [131621703842267133] 1 [(.D2,59717254521028609),(.D0,11103888595746820),(.D0,20072192185393062),(.D0,795102587356821),(.D0,2915865728577704),(.D0,130017245021034),(.D0,335508651126401),(.D0,1898843841288),(.D0,7904781102266),(.D0,2523359605150),(.D0,8472538026),(.D0,3185100274),(.D0,13491500056),(.D0,914057252),(.D0,180482941),(.D0,44210390),(.D0,10338552),(.D0,546592),(.D0,139867),(.D0,1840),(.D0,3081),(.D0,114)], + .scan 0 50, + .scan2 5 9 [(65810851921133566,4),(26811828560461825,4),(5619650935652355,4),(19158152575377317,4),(642762652354196,4),(2890475739410599,4),(125785580159849,4),(334803373649536,4),(1781297595143,4),(7885190061241,4),(2520094431645,4),(7928342441,4),(3094401009,4),(13476383511,4),(911537827,4),(180063036,4),(44140405,4),(10326887,4),(544647,4),(139542,4),(1785,4),(3071,4)], + .scan 5 112, + .scan 0 10, + .scan2 3 0 [(112,20),(3071,20),(1785,20),(139542,20),(544647,20),(10326887,20),(44140405,20),(180063036,20),(911537827,20),(13476383511,20),(3094401009,20),(7928342441,20),(2520094431645,20),(7885190061241,20),(1781297595143,20),(334803373649536,20),(125785580159849,20),(2890475739410599,20),(642762652354196,20),(19158152575377317,20),(5619650935652355,20),(26811828560461825,20)], + .scan 3 65810851921133561, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [197432555763400703,49358138940850176,12339534735212544,3084883683803136,771220920950784,192805230237696,48201307559424,12050326889856,3012581722464,753145430616,188286357654,47071589412,11767897352,2941974340,735493584,183873396,45968348,11492088,2873022,718254,179566,44892,11222,2806,702,174,44,10,2,2,2] 1 [(.D2,65810851921133567),(.D0,26811828560461826),(.D0,5619650935652356),(.D0,19158152575377318),(.D0,642762652354197),(.D0,2890475739410600),(.D0,125785580159850),(.D0,334803373649537),(.D0,1781297595144),(.D0,7885190061242),(.D0,2520094431646),(.D0,7928342442),(.D0,3094401010),(.D0,13476383512),(.D0,911537828),(.D0,180063037),(.D0,44140406),(.D0,10326888),(.D0,544648),(.D0,139543),(.D0,1786),(.D0,3072),(.D0,112)], + .batch [2] 131621703842267136 [(.D1,1)], + .batch [47530059720818690,11882514930204674,2970628732551168,742657183137792,185664295784448,46416073946112,11604018486528,2901004621632,725251155408,181312788852,45328197214,11332049304,2833012326,708253080,177063270,44265818,11066454,2766612,691654,172914,43230,10806,2702,676,168,42,12,2] 131621703842267137 [(.D5,15843353240272896),(.D5,3791571715620867),(.D5,18853472705372069),(.D5,591982674019988),(.D5,2882012409688231),(.D5,124375025206121),(.D5,334568281157248),(.D5,1742115513095),(.D5,7878659714233),(.D5,2519006040477),(.D5,7746943913),(.D5,3064167921),(.D5,13471344663),(.D5,910698019),(.D5,179923068),(.D5,44117077),(.D5,10322999),(.D5,543999),(.D5,139434),(.D5,1767),(.D5,3068),(.D1,112)], + .batch [2] 163308410322812931 [(.D1,1)], + .batch [3453038526726156,609359740010482] 163308410322812932 [(.D1,1151012842242052),(.D0,18413379559808934),(.D0,518633816426133),(.D0,2869787600089256),(.D0,122337556939626),(.D0,334228703112833),(.D0,1685519172360),(.D0,7869226990778),(.D0,2517433919902),(.D0,7484923818),(.D0,3020497906),(.D0,13464066328),(.D0,909484964),(.D0,179720893),(.D0,44083382),(.D0,10317384),(.D0,543064),(.D0,139279),(.D2,1741),(.D5,3064),(.D4,110)], + .scan 0 50, + .scan2 5 9 [(165339609456181250,4),(135413275557891,4),(18244112965361573,4),(490422717351572,4),(2865085750243495,4),(121553915298665,4),(334098096172672,4),(1663751348999,4),(7865599020217,4),(2516829258141,4),(7384146857,4),(3003701745,4),(13461266967,4),(909018403,4),(179643132,4),(44070421,4),(10315223,4),(542703,4),(139218,4),(1731,4),(3062,4)], + .scan 5 110, + .scan 0 10, + .scan2 3 0 [(110,20),(3062,20),(1731,20),(139218,20),(542703,20),(10315223,20),(44070421,20),(179643132,20),(909018403,20),(13461266967,20),(3003701745,20),(7384146857,20),(2516829258141,20),(7865599020217,20),(1663751348999,20),(334098096172672,20),(121553915298665,20),(2865085750243495,20),(490422717351572,20),(18244112965361573,20),(135413275557891,20)], + .scan 3 165339609456181245, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [2437438960042065,609359740010508,152339935002624,38084983750656,9521245937664,2380311484416,595077871104,148769467776,37192366944,9298091736,2324522940,581130732,145282680,36320676,9080172,2270028,567504,141876,35484,8868,2220,552,132,36,12] 1 [(.D2,165339609456181251),(.D0,135413275557892),(.D0,18244112965361574),(.D0,490422717351573),(.D0,2865085750243496),(.D0,121553915298666),(.D0,334098096172673),(.D0,1663751349000),(.D0,7865599020218),(.D0,2516829258142),(.D0,7384146858),(.D0,3003701746),(.D0,13461266968),(.D0,909018404),(.D0,179643133),(.D0,44070422),(.D0,10315224),(.D0,542704),(.D0,139219),(.D0,1732)], + .batch [21395297538146292] 1624959306694703 [(.D5,164527129802833899),(.D1,18221544086101926),(.D0,486661237474965),(.D0,2864458836930728),(.D0,121449429746538),(.D0,334080681913985),(.D0,1660848972552),(.D0,7865115290810),(.D0,2516748636574),(.D0,7370709930),(.D0,3001462258),(.D0,13460893720),(.D0,908956196),(.D0,179632765),(.D0,44068694),(.D0,10314936),(.D0,542656),(.D2,139210),(.D5,1730),(.D0,3063),(.D0,110)], + .scan 0 50, + .scan2 5 9 [(12322608075767848,4),(159178305418297326,4),(17330073355345829,4),(338082782348948,4),(2839695761076391,4),(117322250437481,4),(333392818695808,4),(1546205102855,4),(7846007979193,4),(2513564084637,4),(6839951273,4),(2913002481,4),(13446150423,4),(906498979,4),(179223228,4),(44000437,4),(10303559,4),(540759,4),(138894,4),(1677,4),(3053,4)], + .scan 5 108, + .scan 0 10, + .scan2 3 0 [(108,20),(3053,20),(1677,20),(138894,20),(540759,20),(10303559,20),(44000437,20),(179223228,20),(906498979,20),(13446150423,20),(2913002481,20),(6839951273,20),(2513564084637,20),(7846007979193,20),(1546205102855,20),(333392818695808,20),(117322250437481,20),(2839695761076391,20),(338082782348948,20),(17330073355345829,20),(159178305418297326,20)], + .scan 3 12322608075767843, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [36967824227303549,9241956056825886,2310489014206472,577622253551616,144405563387904,36101390846976,9025347711744,2256336927936,564084231984,141021057996,35255264500,8813816126,2203454032,550863506,137715876,34428970,8607242,2151810,537954,134488,33624,8406,2100,524,132,34,8,2,2] 1 [(.D2,12322608075767849),(.D0,159178305418297327),(.D0,17330073355345830),(.D0,338082782348949),(.D0,2839695761076392),(.D0,117322250437482),(.D0,333392818695809),(.D0,1546205102856),(.D0,7846007979194),(.D0,2513564084638),(.D0,6839951274),(.D0,2913002482),(.D0,13446150424),(.D0,906498980),(.D0,179223229),(.D0,44000438),(.D0,10303560),(.D0,540760),(.D0,138895),(.D0,1678),(.D0,3054),(.D0,108)], + .batch [13721878589865958] 24645216151535700 [(.D1,157124537405669352),(.D4,16987778686574500),(.D0,281033670887061),(.D0,2830187575832744),(.D0,115737552896874),(.D0,333128702439041),(.D0,1502185726728),(.D0,7838671416506),(.D0,2512341324190),(.D0,6636157866),(.D0,2879036914),(.D0,13440489496),(.D0,905555492),(.D0,179065981),(.D0,43974230),(.D0,10299192),(.D2,540031),(.D5,138773),(.D2,1657),(.D1,3051),(.D2,107)], + .scan 0 50, + .scan2 5 9 [(31506155446468678,4),(153694067758202861,4),(16416033745330085,4),(185742847346324,4),(2814305771909287,4),(113090585576297,4),(332687541218944,4),(1428658856711,4),(7826416938169,4),(2510298911133,4),(6295755689,4),(2822303217,4),(13431033879,4),(903979555,4),(178803324,4),(43930453,4),(10291895,4),(538815,4),(138570,4),(1623,4),(3044,4)], + .scan 5 106, + .scan 0 10, + .scan2 3 0 [(106,20),(3044,20),(1623,20),(138570,20),(538815,20),(10291895,20),(43930453,20),(178803324,20),(903979555,20),(13431033879,20),(2822303217,20),(6295755689,20),(2510298911133,20),(7826416938169,20),(1428658856711,20),(332687541218944,20),(113090585576297,20),(2814305771909287,20),(185742847346324,20),(16416033745330085,20),(153694067758202861,20)], + .scan 3 31506155446468673, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [94518466339406039,23629616584851510,5907404146212876,1476851036553218,369212759138304,92303189784576,23075797446144,5768949361536,1442237340384,360559335096,90139833774,22534958446,5633739612,1408434902,352108726,88027182,22006794,5501700,1375424,343854,85966,21492,5372,1342,336,84,20,6,2,2] 1 [(.D2,31506155446468679),(.D0,153694067758202862),(.D0,16416033745330086),(.D0,185742847346325),(.D0,2814305771909288),(.D0,113090585576298),(.D0,332687541218945),(.D0,1428658856712),(.D0,7826416938170),(.D0,2510298911134),(.D0,6295755690),(.D0,2822303218),(.D0,13431033880),(.D0,903979556),(.D0,178803325),(.D0,43930454),(.D0,10291896),(.D0,538816),(.D0,138571),(.D0,1624),(.D0,3045),(.D0,106)], + .batch [2] 63012310892937360 [(.D1,1)], + .batch [932847009398736] 63012310892937361 [(.D5,148443041850458080),(.D1,15540862760705956),(.D1,39881016575637),(.D0,2789995466780840),(.D0,109038868054890),(.D0,332012254965377),(.D0,1316111147784),(.D0,7807658986682),(.D0,2507172585886),(.D0,5774701482),(.D0,2735460850),(.D0,13416560152),(.D0,901567268),(.D0,178401277),(.D0,43863446),(.D2,10280727),(.D5,536954),(.D4,138260),(.D2,1572),(.D4,3035),(.D5,104)], + .scan 0 50, + .scan2 5 9 [(63478734397636728,4),(148209830098108396,4),(15501994135314341,4),(33402912343700,4),(2788915782742183,4),(108858920715113,4),(331982263742080,4),(1311112610567,4),(7806825897145,4),(2507033737629,4),(5751560105,4),(2731603953,4),(13415917335,4),(901460131,4),(178383420,4),(43860469,4),(10280231,4),(536871,4),(138246,4),(1569,4),(3035,4)], + .scan 5 104, + .scan 0 10, + .scan2 3 0 [(104,20),(3035,20),(1569,20),(138246,20),(536871,20),(10280231,20),(43860469,20),(178383420,20),(901460131,20),(13415917335,20),(2731603953,20),(5751560105,20),(2507033737629,20),(7806825897145,20),(1311112610567,20),(331982263742080,20),(108858920715113,20),(2788915782742183,20),(33402912343700,20),(15501994135314341,20),(148209830098108396,20)], + .scan 3 63478734397636723, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [21645087198718461] 1 [(.D2,63478734397636729),(.D0,148209830098108397),(.D0,15501994135314342),(.D0,33402912343701),(.D0,2788915782742184),(.D0,108858920715114),(.D0,331982263742081),(.D0,1311112610568),(.D0,7806825897146),(.D0,2507033737630),(.D0,5751560106),(.D0,2731603954),(.D0,13415917336),(.D0,901460132),(.D0,178383421),(.D0,43860470),(.D0,10280232),(.D0,536872),(.D0,138247),(.D0,1570),(.D0,3036)], + .batch [5411271799679616,1352817949919472,338204487479760,84551121870480,21137780467728,5284445116608,1321111279152,330277820112,82569454704,20642364000,5160590784,1290147264,322536816,80634528,20158848,5039280,1259712,314928,79056,19440,5184,1296,432,432] 10822543599359231 [(.D5,58067462597957113),(.D5,147307951464828460),(.D5,15351681029767685),(.D3,8350728085925),(.D4,2784740418699220),(.D5,108163026707953),(.D0,331866281407554),(.D3,1291782221480),(.D4,7803604165630),(.D1,2506496782378),(.D4,5662067563),(.D4,2716688529),(.D1,13413431432),(.D3,901045814),(.D1,178314368),(.D3,43848961),(.D4,10278313),(.D0,536552),(.D3,138193),(.D5,1560),(.D5,3034),(.D0,104)], + .batch [17126931262885344] 14430058132479047 [(.D5,56263705331397205),(.D5,147007325253735142),(.D5,15301576661252132),(.D1,2783348630684900),(.D1,107931062038900),(.D1,331827620629379),(.D0,1285338758451),(.D2,7802530255126),(.D4,2506317797292),(.D1,5632236717),(.D2,2711716722),(.D2,13412602797),(.D0,900907709),(.D2,178291350),(.D0,43845125),(.D0,10277674),(.D1,536446),(.D2,138175),(.D5,1557),(.D1,3034),(.D1,104)] +] +theorem chunk_17_ok : q6 cmds_17 cfg_17=some cfg_18:= by decide +kernel +def cmds_18 : List Cmd:=[ + .scan 0 50, + .scan2 5 9 [(22993523763921718,4),(51981972515675869,4),(146293703117781586,4),(15182639638593206,4),(2763525793575078,4),(104627255853929,4),(331276986265216,4),(1193566364423,4),(7787234856121,4),(2503768564125,4),(5207364521,4),(2640904689,4),(13400800791,4),(898940707,4),(177963516,4),(43790485,4),(10268567,4),(534927,4),(137922,4),(1515,4),(3026,4)], + .scan 5 102, + .scan 0 10, + .scan2 3 0 [(102,20),(3026,20),(1515,20),(137922,20),(534927,20),(10268567,20),(43790485,20),(177963516,20),(898940707,20),(13400800791,20),(2640904689,20),(5207364521,20),(2503768564125,20),(7787234856121,20),(1193566364423,20),(331276986265216,20),(104627255853929,20),(2763525793575078,20),(15182639638593206,20),(146293703117781586,20),(51981972515675869,20)], + .scan 3 22993523763921713, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [68980571291765159,17245142822941290,4311285705735320,1077821426433832,269455356608456,67363839152116,16840959788028,4210239947006,1052559986752,263139996690,65784999170,16446249792,4111562448,1027890612,256972654,64243164,16060790,4015198,1003800,250950,62738,15684,3922,980,244,62,16,2,2,2] 1 [(.D2,22993523763921719),(.D0,51981972515675870),(.D0,146293703117781587),(.D0,15182639638593207),(.D0,2763525793575079),(.D0,104627255853930),(.D0,331276986265217),(.D0,1193566364424),(.D0,7787234856122),(.D0,2503768564126),(.D0,5207364522),(.D0,2640904690),(.D0,13400800792),(.D0,898940708),(.D0,177963517),(.D0,43790486),(.D0,10268568),(.D0,534928),(.D0,137923),(.D0,1516),(.D0,3027),(.D0,102)], + .batch [2] 45987047527843440 [(.D1,1)], + .batch [6607934797763376] 45987047527843441 [(.D5,48149718555022248),(.D5,145654994124339316),(.D5,15076188139686161),(.D5,2745783877090571),(.D0,101670269773179),(.D2,330784155251758),(.D2,1111427862180),(.D1,7773545105748),(.D5,2501486939063),(.D4,4827093677),(.D5,2577526215),(.D3,13390237713),(.D2,897180194),(.D3,177670098),(.D0,43741583),(.D4,10260416),(.D3,533569),(.D5,137696),(.D0,1478),(.D1,3021),(.D4,100)], + .scan 0 50, + .scan2 5 9 [(49291014926725128,4),(46497734855581404,4),(145379663507765842,4),(15030299703590582,4),(2738135804407974,4),(100395590992745,4),(330571708788352,4),(1076020118279,4),(7767643815097,4),(2500503390621,4),(4663168937,4),(2550205425,4),(13385684247,4),(896421283,4),(177543612,4),(43720501,4),(10256903,4),(532983,4),(137598,4),(1461,4),(3017,4)], + .scan 5 100, + .scan 0 10, + .scan2 3 0 [(100,20),(3017,20),(1461,20),(137598,20),(532983,20),(10256903,20),(43720501,20),(177543612,20),(896421283,20),(13385684247,20),(2550205425,20),(4663168937,20),(2500503390621,20),(7767643815097,20),(1076020118279,20),(330571708788352,20),(100395590992745,20),(2738135804407974,20),(15030299703590582,20),(145379663507765842,20),(46497734855581404,20)], + .scan 3 49291014926725123, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [131621703842267133] 1 [(.D2,49291014926725129),(.D0,46497734855581405),(.D0,145379663507765843),(.D0,15030299703590583),(.D0,2738135804407975),(.D0,100395590992746),(.D0,330571708788353),(.D0,1076020118280),(.D0,7767643815098),(.D0,2500503390622),(.D0,4663168938),(.D0,2550205426),(.D0,13385684248),(.D0,896421284),(.D0,177543613),(.D0,43720502),(.D0,10256904),(.D0,532984),(.D0,137599),(.D0,1462),(.D0,3018),(.D0,100)], + .scan 0 50, + .scan2 5 9 [(65810851921133566,4),(16385588966158345,4),(41013497195486940,4),(144465623897750098,4),(14877959768587958,4),(2712745815240870,4),(96163926131561,4),(329866431311488,4),(958473872135,4),(7748052774073,4),(2497238217117,4),(4118973353,4),(2459506161,4),(13370567703,4),(893901859,4),(177123708,4),(43650517,4),(10245239,4),(531039,4),(137274,4),(1407,4),(3008,4)], + .scan 5 98, + .scan 0 10, + .scan2 3 0 [(98,20),(3008,20),(1407,20),(137274,20),(531039,20),(10245239,20),(43650517,20),(177123708,20),(893901859,20),(13370567703,20),(2459506161,20),(4118973353,20),(2497238217117,20),(7748052774073,20),(958473872135,20),(329866431311488,20),(96163926131561,20),(2712745815240870,20),(14877959768587958,20),(144465623897750098,20),(41013497195486940,20),(16385588966158345,20)], + .scan 3 65810851921133561, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [197432555763400703,49358138940850176,12339534735212544,3084883683803136,771220920950784,192805230237696,48201307559424,12050326889856,3012581722464,753145430616,188286357654,47071589412,11767897352,2941974340,735493584,183873396,45968348,11492088,2873022,718254,179566,44892,11222,2806,702,174,44,10,2,2,2] 1 [(.D2,65810851921133567),(.D0,16385588966158346),(.D0,41013497195486941),(.D0,144465623897750099),(.D0,14877959768587959),(.D0,2712745815240871),(.D0,96163926131562),(.D0,329866431311489),(.D0,958473872136),(.D0,7748052774074),(.D0,2497238217118),(.D0,4118973354),(.D0,2459506162),(.D0,13370567704),(.D0,893901860),(.D0,177123709),(.D0,43650518),(.D0,10245240),(.D0,531040),(.D0,137275),(.D0,1408),(.D0,3009),(.D0,98)], + .batch [2] 131621703842267136 [(.D1,1)], + .batch [16251340937908250,4062835234477064,1015708808619264,253927202154816,63481800538704,15870450134676,3967612533670,991903133418,247975783356,61993945838,15498486460,3874621614,968655404,242163850,60540962,15135240,3783810,945954,236488,59124,14780,3694,924,230,58,14,4,2] 131621703842267137 [(.D5,5417113645969416),(.D5,39185417975455452),(.D5,144160944027744850),(.D5,14827179790253750),(.D5,2704282485518502),(.D5,94753371177833),(.D5,329631338819200),(.D5,919291790087),(.D5,7741522427065),(.D5,2496149825949),(.D5,3937574825),(.D5,2429273073),(.D5,13365528855),(.D5,893062051),(.D5,176983740),(.D5,43627189),(.D5,10241351),(.D5,530391),(.D5,137166),(.D5,1389),(.D5,3005),(.D1,98)], + .batch [2] 142455931134205971 [(.D1,1)], + .batch [11013224662938958] 142455931134205972 [(.D1,38282565701127217),(.D0,144010468648690145),(.D0,14802100560411300),(.D4,2700102613878093),(.D3,94056725904432),(.D5,329515231273633),(.D1,899940532494),(.D4,7738297217466),(.D0,2495612291017),(.D4,3847985669),(.D3,2414341548),(.D2,13363040268),(.D4,892647286),(.D5,176914613),(.D4,43615668),(.D0,10239432),(.D2,530071),(.D3,137113),(.D5,1380),(.D5,3004),(.D2,97)], + .scan 0 50, + .scan2 5 9 [(147962543465675450,4),(35529259535392476,4),(143551584287734354,4),(14725619833585334,4),(2687355826073766,4),(91932261270377,4),(329161153834624,4),(840927625991,4),(7728461733049,4),(2493973043613,4),(3574777769,4),(2368806897,4),(13355451159,4),(891382435,4),(176703804,4),(43580533,4),(10233575,4),(529095,4),(136950,4),(1353,4),(2999,4)], + .scan 5 96, + .scan 0 10, + .scan2 3 0 [(96,20),(2999,20),(1353,20),(136950,20),(529095,20),(10233575,20),(43580533,20),(176703804,20),(891382435,20),(13355451159,20),(2368806897,20),(3574777769,20),(2493973043613,20),(7728461733049,20),(840927625991,20),(329161153834624,20),(91932261270377,20),(2687355826073766,20),(14725619833585334,20),(143551584287734354,20),(35529259535392476,20)], + .scan 3 147962543465675445, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [131621703842267133] 1 [(.D2,147962543465675451),(.D0,35529259535392477),(.D0,143551584287734355),(.D0,14725619833585335),(.D0,2687355826073767),(.D0,91932261270378),(.D0,329161153834625),(.D0,840927625992),(.D0,7728461733050),(.D0,2493973043614),(.D0,3574777770),(.D0,2368806898),(.D0,13355451160),(.D0,891382436),(.D0,176703805),(.D0,43580534),(.D0,10233576),(.D0,529096),(.D0,136951),(.D0,1354),(.D0,3000),(.D0,96)], + .scan 0 50, + .scan2 5 9 [(65810851921133566,4),(115057117505108667,4),(30045021875298012,4),(142637544677718610,4),(14573279898582710,4),(2661965836906662,4),(87700596409193,4),(328455876357760,4),(723381379847,4),(7708870692025,4),(2490707870109,4),(3030582185,4),(2278107633,4),(13340334615,4),(888863011,4),(176283900,4),(43510549,4),(10221911,4),(527151,4),(136626,4),(1299,4),(2990,4)], + .scan 5 94, + .scan 0 10, + .scan2 3 0 [(94,20),(2990,20),(1299,20),(136626,20),(527151,20),(10221911,20),(43510549,20),(176283900,20),(888863011,20),(13340334615,20),(2278107633,20),(3030582185,20),(2490707870109,20),(7708870692025,20),(723381379847,20),(328455876357760,20),(87700596409193,20),(2661965836906662,20),(14573279898582710,20),(142637544677718610,20),(30045021875298012,20),(115057117505108667,20)], + .scan 3 65810851921133561, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [197432555763400703,49358138940850176,12339534735212544,3084883683803136,771220920950784,192805230237696,48201307559424,12050326889856,3012581722464,753145430616,188286357654,47071589412,11767897352,2941974340,735493584,183873396,45968348,11492088,2873022,718254,179566,44892,11222,2806,702,174,44,10,2,2,2] 1 [(.D2,65810851921133567),(.D0,115057117505108668),(.D0,30045021875298013),(.D0,142637544677718611),(.D0,14573279898582711),(.D0,2661965836906663),(.D0,87700596409194),(.D0,328455876357761),(.D0,723381379848),(.D0,7708870692026),(.D0,2490707870110),(.D0,3030582186),(.D0,2278107634),(.D0,13340334616),(.D0,888863012),(.D0,176283901),(.D0,43510550),(.D0,10221912),(.D0,527152),(.D0,136627),(.D0,1300),(.D0,2991),(.D0,94)], + .batch [2] 131621703842267136 [(.D1,1)], + .batch [87747802561511424] 131621703842267137 [(.D5,104088642184919738),(.D5,28216942655266524),(.D5,142332864807713362),(.D5,14522499920248502),(.D5,2653502507184294),(.D5,86290041455465),(.D5,328220783865472),(.D5,684199297799),(.D5,7702340345017),(.D5,2489619478941),(.D5,2849183657),(.D5,2247874545),(.D5,13335295767),(.D5,888023203),(.D5,176143932),(.D5,43487221),(.D5,10218023),(.D5,526503),(.D5,136518),(.D5,1281),(.D5,2987),(.D1,94)], + .scan 0 50, + .scan2 5 9 [(175495605123022848,4),(82151691544541882,4),(24560784215203548,4),(141723505067702866,4),(14420939963580086,4),(2636575847739558,4),(83468931548009,4),(327750598880896,4),(605835133703,4),(7689279651001,4),(2487442696605,4),(2486386601,4),(2187408369,4),(13325218071,4),(886343587,4),(175863996,4),(43440565,4),(10210247,4),(525207,4),(136302,4),(1245,4),(2981,4)], + .scan 5 92, + .scan 0 10, + .scan2 3 0 [(92,20),(2981,20),(1245,20),(136302,20),(525207,20),(10210247,20),(43440565,20),(175863996,20),(886343587,20),(13325218071,20),(2187408369,20),(2486386601,20),(2487442696605,20),(7689279651001,20),(605835133703,20),(327750598880896,20),(83468931548009,20),(2636575847739558,20),(14420939963580086,20),(141723505067702866,20),(24560784215203548,20),(82151691544541882,20)], + .scan 3 175495605123022843, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [526486815369068549,131621703842267136,32905425960566784,8226356490141696,2056589122535424,514147280633856,128536820158464,32134205039616,8033551259904,2008387814976,502096953744,125524238436,31381059608,7845264904,1961316224,490329058,122582264,30645564,7661392,1915350,478836,119708,29928,7482,1870,468,116,30,6,4,14624633760251900] 1 [(.D2,175495605123022849),(.D0,82151691544541883),(.D0,24560784215203549),(.D0,141723505067702867),(.D0,14420939963580087),(.D0,2636575847739559),(.D0,83468931548010),(.D0,327750598880897),(.D0,605835133704),(.D0,7689279651002),(.D0,2487442696606),(.D0,2486386602),(.D0,2187408370),(.D0,13325218072),(.D0,886343588),(.D0,175863997),(.D0,43440566),(.D0,10210248),(.D0,525208),(.D0,136303),(.D0,1246),(.D0,2982),(.D0,92)], + .scan 0 50, + .scan2 5 9 [(358303527126171648,4),(49246265583975099,4),(19076546555109084,4),(140809465457687122,4),(14268600028577462,4),(2611185858572454,4),(79237266686825,4),(327045321404032,4),(488288887559,4),(7669688609977,4),(2484177523101,4),(1942191017,4),(2096709105,4),(13310101527,4),(883824163,4),(175444092,4),(43370581,4),(10198583,4),(523263,4),(135978,4),(1191,4),(2972,4)], + .scan 5 90, + .scan 0 10, + .scan2 3 0 [(90,20),(2972,20),(1191,20),(135978,20),(523263,20),(10198583,20),(43370581,20),(175444092,20),(883824163,20),(13310101527,20),(2096709105,20),(1942191017,20),(2484177523101,20),(7669688609977,20),(488288887559,20),(327045321404032,20),(79237266686825,20),(2611185858572454,20),(14268600028577462,20),(140809465457687122,20),(19076546555109084,20),(49246265583975099,20)], + .scan 3 358303527126171643, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [789730223053602813] 1 [(.D2,358303527126171649),(.D0,49246265583975100),(.D0,19076546555109085),(.D0,140809465457687123),(.D0,14268600028577463),(.D0,2611185858572455),(.D0,79237266686826),(.D0,327045321404033),(.D0,488288887560),(.D0,7669688609978),(.D0,2484177523102),(.D0,1942191018),(.D0,2096709106),(.D0,13310101528),(.D0,883824164),(.D0,175444093),(.D0,43370582),(.D0,10198584),(.D0,523264),(.D0,135979),(.D0,1192),(.D0,2973),(.D0,90)], + .scan 0 50, + .scan2 5 9 [(394865111526801406,4),(160870971362770945,4),(16340839623408315,4),(13592308895014620,4),(139895425847671378,4),(14116260093574838,4),(2585795869405350,4),(75005601825641,4),(326340043927168,4),(370742641415,4),(7650097568953,4),(2480912349597,4),(1397995433,4),(2006009841,4),(13294984983,4),(881304739,4),(175024188,4),(43300597,4),(10186919,4),(521319,4),(135654,4),(1137,4),(2963,4)], + .scan 5 88, + .scan 0 10, + .scan2 3 0 [(88,20),(2963,20),(1137,20),(135654,20),(521319,20),(10186919,20),(43300597,20),(175024188,20),(881304739,20),(13294984983,20),(2006009841,20),(1397995433,20),(2480912349597,20),(7650097568953,20),(370742641415,20),(326340043927168,20),(75005601825641,20),(2585795869405350,20),(14116260093574838,20),(139895425847671378,20),(13592308895014620,20),(16340839623408315,20),(160870971362770945,20)], + .scan 3 394865111526801401, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1184595334580404223,296148833645101056,74037208411275264,18509302102818816,4627325525704704,1156831381426176,289207845356544,72301961339136,18075490334784,4518872583696,1129718145924,282429536480,70607384118,17651846032,4412961506,1103240376,275810094,68952526,17238132,4309532,1077382,269346,67338,16832,4210,1052,262,66,18,2,2,2] 1 [(.D2,394865111526801407),(.D0,160870971362770946),(.D0,16340839623408316),(.D0,13592308895014621),(.D0,139895425847671379),(.D0,14116260093574839),(.D0,2585795869405351),(.D0,75005601825642),(.D0,326340043927169),(.D0,370742641416),(.D0,7650097568954),(.D0,2480912349598),(.D0,1397995434),(.D0,2006009842),(.D0,13294984984),(.D0,881304740),(.D0,175024189),(.D0,43300598),(.D0,10186920),(.D0,521320),(.D0,135655),(.D0,1138),(.D0,2964),(.D0,88)], + .batch [2] 789730223053602816 [(.D1,1)], + .batch [96702557457948972,24175639364487252,6043909841121816,1510977460280448,377744365070124,94436091267528,23609022816876,5902255704216,1475563926060,368890981512,92222745384,23055686340,5763921588,1440980400,360245088,90061272,22515324,5628828,1407204,351816,87948,21996,5484,1368,348,84,24,12] 789730223053602817 [(.D5,95060119441637376),(.D5,5372364303219387),(.D5,11764229674983132),(.D5,139590745977666130),(.D5,14065480115240630),(.D5,2577332539682982),(.D5,73595046871913),(.D5,326104951434880),(.D5,331560559367),(.D5,7643567221945),(.D5,2479823958429),(.D5,1216596905),(.D5,1975776753),(.D5,13289946135),(.D5,880464931),(.D5,174884220),(.D5,43277269),(.D5,10183031),(.D5,520671),(.D5,135546),(.D5,1119),(.D5,2960),(.D1,88)], + .batch [66258345348633876] 854198594692235473 [(.D5,62825933622321048),(.D1,10868835624446569),(.D0,139441513635910037),(.D4,14040608058281281),(.D0,2573187196856425),(.D2,72904156400820),(.D1,325989803023032),(.D1,312369157393),(.D1,7640368654950),(.D5,2479290863930),(.D0,1127747823),(.D2,1960968573),(.D2,13287478105),(.D3,880053593),(.D1,174815665),(.D2,43265843),(.D3,10181127),(.D3,520354),(.D1,135494),(.D5,1110),(.D5,2959),(.D2,87)], + .scan 0 50, + .scan2 5 9 [(887327767366552410,4),(46261347285162579,4),(8108071234920156,4),(138981386237655634,4),(13963920158572214,4),(2560405880238246,4),(70773936964457,4),(325634766450304,4),(253196395271,4),(7630506527929,4),(2477647176093,4),(853799849,4),(1915310577,4),(13279868439,4),(878785315,4),(174604284,4),(43230613,4),(10175255,4),(519375,4),(135330,4),(1083,4),(2954,4)], + .scan 5 86, + .scan 0 10, + .scan2 3 0 [(86,20),(2954,20),(1083,20),(135330,20),(519375,20),(10175255,20),(43230613,20),(174604284,20),(878785315,20),(13279868439,20),(1915310577,20),(853799849,20),(2477647176093,20),(7630506527929,20),(253196395271,20),(325634766450304,20),(70773936964457,20),(2560405880238246,20),(13963920158572214,20),(138981386237655634,20),(8108071234920156,20),(46261347285162579,20)], + .scan 3 887327767366552405, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [789730223053602813] 1 [(.D2,887327767366552411),(.D0,46261347285162580),(.D0,8108071234920157),(.D0,138981386237655635),(.D0,13963920158572215),(.D0,2560405880238247),(.D0,70773936964458),(.D0,325634766450305),(.D0,253196395272),(.D0,7630506527930),(.D0,2477647176094),(.D0,853799850),(.D0,1915310578),(.D0,13279868440),(.D0,878785316),(.D0,174604285),(.D0,43230614),(.D0,10175256),(.D0,519376),(.D0,135331),(.D0,1084),(.D0,2955),(.D0,86)], + .scan 0 50, + .scan2 5 9 [(394865111526801406,4),(689895211603151707,4),(13355921324595795,4),(2623833574825692,4),(138067346627639890,4),(13811580223569590,4),(2535015891071142,4),(66542272103273,4),(324929488973440,4),(135650149127,4),(7610915486905,4),(2474382002589,4),(309604265,4),(1824611313,4),(13264751895,4),(876265891,4),(174184380,4),(43160629,4),(10163591,4),(517431,4),(135006,4),(1029,4),(2945,4)], + .scan 5 84, + .scan 0 10, + .scan2 3 0 [(84,20),(2945,20),(1029,20),(135006,20),(517431,20),(10163591,20),(43160629,20),(174184380,20),(876265891,20),(13264751895,20),(1824611313,20),(309604265,20),(2474382002589,20),(7610915486905,20),(135650149127,20),(324929488973440,20),(66542272103273,20),(2535015891071142,20),(13811580223569590,20),(138067346627639890,20),(2623833574825692,20),(13355921324595795,20),(689895211603151707,20)], + .scan 3 394865111526801401, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1184595334580404223,296148833645101056,74037208411275264,18509302102818816,4627325525704704,1156831381426176,289207845356544,72301961339136,18075490334784,4518872583696,1129718145924,282429536480,70607384118,17651846032,4412961506,1103240376,275810094,68952526,17238132,4309532,1077382,269346,67338,16832,4210,1052,262,66,18,2,2,2] 1 [(.D2,394865111526801407),(.D0,689895211603151708),(.D0,13355921324595796),(.D0,2623833574825693),(.D0,138067346627639891),(.D0,13811580223569591),(.D0,2535015891071143),(.D0,66542272103274),(.D0,324929488973441),(.D0,135650149128),(.D0,7610915486906),(.D0,2474382002590),(.D0,309604266),(.D0,1824611314),(.D0,13264751896),(.D0,876265892),(.D0,174184381),(.D0,43160630),(.D0,10163592),(.D0,517432),(.D0,135007),(.D0,1030),(.D0,2946),(.D0,84)], + .batch [2] 789730223053602816 [(.D1,1)], + .batch [42974028079323612,10743507019830912,2685876754957740,671469188739420,167867297184852,41966824296228,10491706074060,2622926518500,655731629628,163932907404,40983226848,10245806712,2561451684,640362924,160090740,40022676,10005672,2501412,625356,156348,39072,9780,2448,612,144,36,12] 789730223053602817 [(.D5,624084359682018138),(.D5,2387446004406867),(.D5,795754354794204),(.D5,137762666757634642),(.D5,13760800245235382),(.D5,2526552561348774),(.D5,65131717149545),(.D5,324694396481152),(.D5,96468067079),(.D5,7604385139897),(.D5,2473293611421),(.D5,128205737),(.D5,1794378225),(.D5,13259713047),(.D5,875426083),(.D5,174044412),(.D5,43137301),(.D5,10159703),(.D5,516783),(.D5,134898),(.D5,1011),(.D5,2942),(.D1,84)], + .batch [12] 818379575106485233 [(.D5,609759683655576930),(.D1,1)], + .batch [7161240373075068,1790310093268776,447577523317200,111894380829288,27973595207328,6993398801844,1748349700452,437087425116,109271856276,27317964060,6829491024,1707372756,426843180,106710804,26677692,6669432,1667364,416844,104196,26052,6516,1632,396,108,24,12] 818379575106485239 [(.D5,609759683655576927),(.D5,397846687393059),(.D3,137696348813067785),(.D3,13749747254474240),(.D2,2524710396221917),(.D1,64824689628403),(.D5,324643225227628),(.D5,87939524825),(.D5,7602963716188),(.D3,2473056707470),(.D1,88721746),(.D1,1787797561),(.D0,13258616270),(.D1,875243288),(.D4,174013946),(.D0,43132224),(.D1,10158858),(.D0,516643),(.D4,134874),(.D3,1008),(.D2,2942)], + .batch [1488792306306192,372198054868992,93049523794944,23262365832192,5815616652288,1453909201920,363462183936,90880662528,22694971392,5683820544,1431032832,362797056,80621568,20155392,20155392] 823153735355201959 [(.D5,607372603531218567),(.D1,137630041031835609),(.D1,13738695957602211),(.D2,2522868513409912),(.D3,64517709159735),(.D5,324592061816184),(.D4,79412289584),(.D1,7601542510316),(.D2,2472819839824),(.D3,49243805),(.D0,1781217904),(.D0,13257519661),(.D4,875060518),(.D1,173983486),(.D4,43127146),(.D1,10158012),(.D0,516502),(.D2,134851),(.D1,1004),(.D5,2941),(.D2,83)], + .batch [20155392] 824146263561730543 [(.D5,606876339427954275),(.D5,137547330347958226),(.D5,13724910843622646),(.D5,2520570994413318),(.D5,64134789326969),(.D5,324528241844056),(.D5,68775627563),(.D5,7599769733311),(.D5,2472524376990),(.D1,1)], + .batch [1576093324695552] 824146263571808239 [(.D5,606876339422915427),(.D5,137547330347118418),(.D5,13724910843482678),(.D5,2520570994389990),(.D5,64134789323081),(.D5,324528241843408),(.D5,68775627455),(.D5,7599769733293),(.D5,2472524376987),(.D5,1773010601),(.D1,13256151778),(.D4,874832538),(.D2,173945488),(.D3,43120814),(.D5,10156955),(.D1,516326),(.D5,134822),(.D2,999),(.D2,2940),(.D3,83)], + .scan 0 50, + .scan2 5 9 [(824934310234156014,4),(606482316091741539,4),(137481659791922770,4),(13713965750950070,4),(2518746812301222,4),(63830758974953,4),(324477570118720,4),(60330340007,4),(7598362185385,4),(2472289785669,4),(1733912048,4),(13249635351,4),(873746467,4),(173764476,4),(43090645,4),(10151927,4),(515487,4),(134682,4),(975,4),(2936,4)], + .scan 5 82, + .scan 0 10, + .scan2 3 0 [(82,20),(2936,20),(975,20),(134682,20),(515487,20),(10151927,20),(43090645,20),(173764476,20),(873746467,20),(13249635351,20),(1733912048,20),(2472289785669,20),(7598362185385,20),(60330340007,20),(324477570118720,20),(63830758974953,20),(2518746812301222,20),(13713965750950070,20),(137481659791922770,20),(606482316091741539,20)], + .scan 3 824934310234156009, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [21936950640377853] 1 [(.D2,824934310234156015),(.D0,606482316091741540),(.D0,137481659791922771),(.D0,13713965750950071),(.D0,2518746812301223),(.D0,63830758974954),(.D0,324477570118721),(.D0,60330340008),(.D0,7598362185386),(.D0,2472289785670),(.D0,1733912049),(.D0,13249635352),(.D0,873746468),(.D0,173764477),(.D0,43090646),(.D0,10151928),(.D0,515488),(.D0,134683),(.D0,976),(.D0,2937),(.D0,82)], + .scan 0 50, + .scan2 5 9 [(10968475320188926,4),(819450072574061551,4),(605568276481725795,4),(137329319856920146,4),(13688575761782966,4),(2514515147440038,4),(63125481498089,4),(324360023872576,4),(40739298983,4),(7595097011881,4),(2471745590085,4),(1643212784,4),(13234518807,4),(871227043,4),(173344572,4),(43020661,4),(10140263,4),(513543,4),(134358,4),(921,4),(2927,4)], + .scan 5 80, + .scan 0 10, + .scan2 3 0 [(80,20),(2927,20),(921,20),(134358,20),(513543,20),(10140263,20),(43020661,20),(173344572,20),(871227043,20),(13234518807,20),(1643212784,20),(2471745590085,20),(7595097011881,20),(40739298983,20),(324360023872576,20),(63125481498089,20),(2514515147440038,20),(13688575761782966,20),(137329319856920146,20),(605568276481725795,20),(819450072574061551,20)], + .scan 3 10968475320188921, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [32905425960566783,8226356490141696,2056589122535424,514147280633856,128536820158464,32134205039616,8033551259904,2008387814976,502096953744,125524238436,31381059608,7845264900,1961316226,490329056,122582266,30645566,7661392,1915346,478836,119710,29928,7482,1872,468,116,28,8,2,2] 1 [(.D2,10968475320188927),(.D0,819450072574061552),(.D0,605568276481725796),(.D0,137329319856920147),(.D0,13688575761782967),(.D0,2514515147440039),(.D0,63125481498090),(.D0,324360023872577),(.D0,40739298984),(.D0,7595097011882),(.D0,2471745590086),(.D0,1643212785),(.D0,13234518808),(.D0,871227044),(.D0,173344573),(.D0,43020662),(.D0,10140264),(.D0,513544),(.D0,134359),(.D0,922),(.D0,2928),(.D0,80)], + .batch [2] 21936950640377856 [(.D1,1)], + .batch [14624633760251904] 21936950640377857 [(.D5,817621993354030062),(.D5,605263596611720547),(.D5,137278539878585938),(.D5,13680112432060598),(.D5,2513104592486310),(.D5,62890389005801),(.D5,324320841790528),(.D5,34208951975),(.D5,7594008620713),(.D5,2471564191557),(.D5,1612979696),(.D5,13229479959),(.D5,870387235),(.D5,173204604),(.D5,42997333),(.D5,10136375),(.D5,512895),(.D5,134250),(.D5,903),(.D5,2924),(.D1,80)] +] +theorem chunk_18_ok : q6 cmds_18 cfg_18=some cfg_19:= by decide +kernel +def cmds_19 : List Cmd:=[ + .scan 0 50, + .scan2 5 9 [(29249267520503808,4),(813965834913967086,4),(604654236871710051,4),(137176979921917522,4),(13663185772615862,4),(2510283482578854,4),(62420204021225,4),(324242477626432,4),(21148257959,4),(7591831838377,4),(2471201394501,4),(1552513520,4),(13219402263,4),(868707619,4),(172924668,4),(42950677,4),(10128599,4),(511599,4),(134034,4),(867,4),(2918,4)], + .scan 5 78, + .scan 0 10, + .scan2 3 0 [(78,20),(2918,20),(867,20),(134034,20),(511599,20),(10128599,20),(42950677,20),(172924668,20),(868707619,20),(13219402263,20),(1552513520,20),(2471201394501,20),(7591831838377,20),(21148257959,20),(324242477626432,20),(62420204021225,20),(2510283482578854,20),(13663185772615862,20),(137176979921917522,20),(604654236871710051,20),(813965834913967086,20)], + .scan 3 29249267520503803, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [87747802561511429,21936950640377856,5484237660094464,1371059415023616,342764853755904,85691213438976,21422803359744,5355700839936,1338925209984,334731302496,83682825624,20920706406,5230176602,1307544150,326886036,81721510,20430378,5107596,1276898,319224,79806,19950,4990,1248,312,78,18,6,2437438960041980] 1 [(.D2,29249267520503809),(.D0,813965834913967087),(.D0,604654236871710052),(.D0,137176979921917523),(.D0,13663185772615863),(.D0,2510283482578855),(.D0,62420204021226),(.D0,324242477626433),(.D0,21148257960),(.D0,7591831838378),(.D0,2471201394502),(.D0,1552513521),(.D0,13219402264),(.D0,868707620),(.D0,172924669),(.D0,42950678),(.D0,10128600),(.D0,511600),(.D0,134035),(.D0,868),(.D0,2919),(.D0,78)], + .scan 0 50, + .scan2 5 9 [(59717254521028608,4),(808481597253872623,4),(603740197261694307,4),(137024639986914898,4),(13637795783448758,4),(2506051817717670,4),(61714926544361,4),(324124931380288,4),(1557216935,4),(7588566664873,4),(2470657198917,4),(1461814256,4),(13204285719,4),(866188195,4),(172504764,4),(42880693,4),(10116935,4),(509655,4),(133710,4),(813,4),(2909,4)], + .scan 5 76, + .scan 0 10, + .scan2 3 0 [(76,20),(2909,20),(813,20),(133710,20),(509655,20),(10116935,20),(42880693,20),(172504764,20),(866188195,20),(13204285719,20),(1461814256,20),(2470657198917,20),(7588566664873,20),(1557216935,20),(324124931380288,20),(61714926544361,20),(2506051817717670,20),(13637795783448758,20),(137024639986914898,20),(603740197261694307,20),(808481597253872623,20)], + .scan 3 59717254521028603, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [7846579446888957,1961644860882432,490411212701184,122602804015104,30650697644544,7662676930560,1915669232640,478918987776,119726387712,29930757120,7484368896,1874451456,466933248,117573120,30233088,3359232,3359232,3359232] 1 [(.D2,59717254521028609),(.D0,808481597253872624),(.D0,603740197261694308),(.D0,137024639986914899),(.D0,13637795783448759),(.D0,2506051817717671),(.D0,61714926544362),(.D0,324124931380289),(.D0,1557216936),(.D0,7588566664874),(.D0,2470657198918),(.D0,1461814257),(.D0,13204285720),(.D0,866188196),(.D0,172504765),(.D0,42880694),(.D0,10116936),(.D0,509656),(.D0,133711),(.D0,814),(.D0,2910)], + .batch [3359232] 5231052964032767 [(.D5,57101728039012225),(.D5,808045676173536559),(.D5,603667543748304963),(.D5,137012531068016674),(.D5,13635777630299054),(.D5,2505715458859386),(.D5,61658866734647),(.D5,324115588078669),(.D1,1)], + .batch [20193266319593472] 5231052965712383 [(.D5,57101728038172417),(.D5,808045676173396591),(.D5,603667543748281635),(.D5,137012531068012786),(.D5,13635777630298406),(.D5,2505715458859278),(.D5,61658866734629),(.D5,324115588078666),(.D5,7588307128716),(.D3,2470613942892),(.D0,1454604919),(.D3,13203084163),(.D1,865987937),(.D0,172471388),(.D3,42875131),(.D0,10116009),(.D0,509501),(.D1,133685),(.D5,809),(.D2,2909),(.D0,76)], + .scan 0 50, + .scan2 5 9 [(15327686125509118,4),(52053411458274049,4),(807204290076746863,4),(603527312732173347,4),(136989159231994738,4),(13631882324295398,4),(2505066241192110,4),(61550663790101,4),(324097554254578,4),(7585301491368,4),(2470113003333,4),(1371114992,4),(13189169175,4),(863668771,4),(172084860,4),(42810709,4),(10105271,4),(507711,4),(133386,4),(759,4),(2900,4)], + .scan 5 74, + .scan 0 10, + .scan2 3 0 [(74,20),(2900,20),(759,20),(133386,20),(507711,20),(10105271,20),(42810709,20),(172084860,20),(863668771,20),(13189169175,20),(1371114992,20),(2470113003333,20),(7585301491368,20),(324097554254578,20),(61550663790101,20),(2505066241192110,20),(13631882324295398,20),(136989159231994738,20),(603527312732173347,20),(807204290076746863,20),(52053411458274049,20)], + .scan 3 15327686125509113, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [45983058376527359,11495764594131840,2873941148532960,718485287133240,179621321783310,44905330445826,11226332611458,2806583152862,701645788216,175411447056,43852861764,10963215440,2740803858,685200966,171300240,42825060,10706266,2676566,669142,167286,41822,10456,2612,654,162,42,10,2,2,2] 1 [(.D2,15327686125509119),(.D0,52053411458274050),(.D0,807204290076746864),(.D0,603527312732173348),(.D0,136989159231994739),(.D0,13631882324295399),(.D0,2505066241192111),(.D0,61550663790102),(.D0,324097554254579),(.D0,7585301491369),(.D0,2470113003334),(.D0,1371114993),(.D0,13189169176),(.D0,863668772),(.D0,172084861),(.D0,42810710),(.D0,10105272),(.D0,507712),(.D0,133387),(.D0,760),(.D0,2901),(.D0,74)], + .batch [2] 30655372251018240 [(.D1,1)], + .batch [11718493223371776] 30655372251018241 [(.D5,49498797104022528),(.D5,806778521017704943),(.D5,603456351222333027),(.D5,136977332313688018),(.D5,13629911171244278),(.D5,2504737715683590),(.D5,61495909538681),(.D1,324088428546009),(.D5,7583780539940),(.D0,2469859511429),(.D1,1328866342),(.D3,13182127734),(.D2,862495198),(.D0,171889265),(.D5,42778110),(.D0,10099839),(.D4,506805),(.D3,133236),(.D4,734),(.D4,2896),(.D2,73)], + .scan 0 50, + .scan2 5 9 [(36514618862704128,4),(46569173798179584,4),(806290250466731119,4),(603374972797170723,4),(136963769242827634,4),(13627650659434214,4),(2504360963715246,4),(61433117543957,4),(324077963213554,4),(7582036317864,4),(2469568807749,4),(1280415728,4),(13174052631,4),(861149347,4),(171664956,4),(42740725,4),(10093607,4),(505767,4),(133062,4),(705,4),(2891,4)], + .scan 5 72, + .scan 0 10, + .scan2 3 0 [(72,20),(2891,20),(705,20),(133062,20),(505767,20),(10093607,20),(42740725,20),(171664956,20),(861149347,20),(13174052631,20),(1280415728,20),(2469568807749,20),(7582036317864,20),(324077963213554,20),(61433117543957,20),(2504360963715246,20),(13627650659434214,20),(136963769242827634,20),(603374972797170723,20),(806290250466731119,20),(46569173798179584,20)], + .scan 3 36514618862704123, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [109543856588112389,22077847254154744] 1 [(.D2,36514618862704129),(.D0,46569173798179585),(.D0,806290250466731120),(.D0,603374972797170724),(.D0,136963769242827635),(.D0,13627650659434215),(.D0,2504360963715247),(.D0,61433117543958),(.D0,324077963213555),(.D0,7582036317865),(.D0,2469568807750),(.D0,1280415729),(.D0,13174052632),(.D0,861149348),(.D0,171664957),(.D0,42740726),(.D0,10093608),(.D0,505768),(.D0,133063),(.D0,706),(.D0,2892),(.D0,72)], + .scan 0 50, + .scan2 5 9 [(65810851921133566,4),(3609192902137345,4),(41084936138085120,4),(805376210856715375,4),(603222632862168099,4),(136938379253660530,4),(13623418994573030,4),(2503655686238382,4),(61315571297813,4),(324058372172530,4),(7578771144360,4),(2469024612165,4),(1189716464,4),(13158936087,4),(858629923,4),(171245052,4),(42670741,4),(10081943,4),(503823,4),(132738,4),(651,4),(2882,4)], + .scan 5 70, + .scan 0 10, + .scan2 3 0 [(70,20),(2882,20),(651,20),(132738,20),(503823,20),(10081943,20),(42670741,20),(171245052,20),(858629923,20),(13158936087,20),(1189716464,20),(2469024612165,20),(7578771144360,20),(324058372172530,20),(61315571297813,20),(2503655686238382,20),(13623418994573030,20),(136938379253660530,20),(603222632862168099,20),(805376210856715375,20),(41084936138085120,20),(3609192902137345,20)], + .scan 3 65810851921133561, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [64965472238472237,16241368059618048,4060342014904512,1015085503726128,253771375931532,63442843982892,15860710995708,3965177748924,991294437240,247823609316,61955902332,15488975568,3872243904,968060964,242015244,60503808,15125964,3781488,945360,236340,59100,14772,3696,912,240,48,24] 1 [(.D2,65810851921133567),(.D0,3609192902137346),(.D0,41084936138085121),(.D0,805376210856715376),(.D0,603222632862168100),(.D0,136938379253660531),(.D0,13623418994573031),(.D0,2503655686238383),(.D0,61315571297814),(.D0,324058372172531),(.D0,7578771144361),(.D0,2469024612166),(.D0,1189716465),(.D0,13158936088),(.D0,858629924),(.D0,171245053),(.D0,42670742),(.D0,10081944),(.D0,503824),(.D0,132739),(.D0,652),(.D0,2883)], + .batch [117184932233717736] 43310314825648151 [(.D5,44155694508309491),(.D3,40483403987728897),(.D0,805275955498322672),(.D0,603205923635769316),(.D0,136935594382594067),(.D0,13622954849395287),(.D0,2503578328708759),(.D2,61302678376209),(.D5,324056223352263),(.D2,7578413007649),(.D5,2468964922713),(.D1,1179768223),(.D1,13157278048),(.D4,858353583),(.D2,171198996),(.D2,42663065),(.D5,10080664),(.D0,503611),(.D4,132702),(.D5,645),(.D3,2882),(.D0,70)], + .scan 0 50, + .scan2 5 9 [(101902780942507018,4),(14859461449880057,4),(35600698477990657,4),(804462171246699631,4),(603070292927165475,4),(136912989264493426,4),(13619187329711846,4),(2502950408761518,4),(61198025051669,4),(324038781131506,4),(7575505970856,4),(2468480416581,4),(1099017200,4),(13143819543,4),(856110499,4),(170825148,4),(42600757,4),(10070279,4),(501879,4),(132414,4),(597,4),(2873,4)], + .scan 5 68, + .scan 0 10, + .scan2 3 0 [(68,20),(2873,20),(597,20),(132414,20),(501879,20),(10070279,20),(42600757,20),(170825148,20),(856110499,20),(13143819543,20),(1099017200,20),(2468480416581,20),(7575505970856,20),(324038781131506,20),(61198025051669,20),(2502950408761518,20),(13619187329711846,20),(136912989264493426,20),(603070292927165475,20),(804462171246699631,20),(35600698477990657,20),(14859461449880057,20)], + .scan 3 101902780942507013, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [267470306097841053,66867576524460252,16716894131115072,4179223532778768,1044805883194692,261201470798664,65300367699660,16325091924912,4081272981228,1020318245316,255079561320,63769890336,15942472596,3985618140,996404544,249101136,62275284,15568812,3892212,973044,243264,60804,15216,3792,960,228,60,12,38238036729680024,9559509182420006,2389877295605002,597469323901250,149367330975312,37341832743828,9335458185958,2333864546490,583466136624,145866534156,36466633538,9116658384,2279164596,569791150,142447788,35611946,8902986,2225746,556436,139110,34776,8694,2176,542,136,36,8,2,2] 1 [(.D2,101902780942507019),(.D0,14859461449880058),(.D0,35600698477990658),(.D0,804462171246699632),(.D0,603070292927165476),(.D0,136912989264493427),(.D0,13619187329711847),(.D0,2502950408761519),(.D0,61198025051670),(.D0,324038781131507),(.D0,7575505970857),(.D0,2468480416582),(.D0,1099017201),(.D0,13143819544),(.D0,856110500),(.D0,170825149),(.D0,42600758),(.D0,10070280),(.D0,501880),(.D0,132415),(.D0,598),(.D0,2874),(.D0,68)], + .batch [3533301511640032] 203805561885014040 [(.D1,30999786195806203),(.D5,803695352533002222),(.D0,602942489808215908),(.D0,136891688744668499),(.D0,13615637243074359),(.D0,2502358727655271),(.D4,61099411533961),(.D0,324022345545222),(.D5,7572766706475),(.D5,2468023872518),(.D0,1022926524),(.D4,13131137763),(.D3,853996870),(.D4,170472876),(.D1,42542046),(.D3,10060494),(.D1,500249),(.D1,132143),(.D1,553),(.D0,2866),(.D5,66)], + .scan 0 50, + .scan2 5 9 [(205572212640834055,4),(30116460817896194,4),(803548131636683887,4),(602917952992162851,4),(136887599275326322,4),(13614955664850662,4),(2502245131284654,4),(61080478805525,4),(324019190090482,4),(7572240797352,4),(2467936220997,4),(1008317936,4),(13128702999,4),(853591075,4),(170405244,4),(42530773,4),(10058615,4),(499935,4),(132090,4),(543,4),(2864,4)], + .scan 5 66, + .scan 0 10, + .scan2 3 0 [(66,20),(2864,20),(543,20),(132090,20),(499935,20),(10058615,20),(42530773,20),(170405244,20),(853591075,20),(13128702999,20),(1008317936,20),(2467936220997,20),(7572240797352,20),(324019190090482,20),(61080478805525,20),(2502245131284654,20),(13614955664850662,20),(136887599275326322,20),(602917952992162851,20),(803548131636683887,20),(30116460817896194,20)], + .scan 3 205572212640834050, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [131621703842267133] 1 [(.D2,205572212640834056),(.D0,30116460817896195),(.D0,803548131636683888),(.D0,602917952992162852),(.D0,136887599275326323),(.D0,13614955664850663),(.D0,2502245131284655),(.D0,61080478805526),(.D0,324019190090483),(.D0,7572240797353),(.D0,2467936220998),(.D0,1008317937),(.D0,13128703000),(.D0,853591076),(.D0,170405245),(.D0,42530774),(.D0,10058616),(.D0,499936),(.D0,132091),(.D0,544),(.D0,2865),(.D0,66)], + .scan 0 50, + .scan2 5 9 [(65810851921133566,4),(172666786680267272,4),(24632223157801730,4),(802634092026668143,4),(602765613057160227,4),(136862209286159218,4),(13610723999989478,4),(2501539853807790,4),(60962932559381,4),(323999599049458,4),(7568975623848,4),(2467392025413,4),(917618672,4),(13113586455,4),(851071651,4),(169985340,4),(42460789,4),(10046951,4),(497991,4),(131766,4),(489,4),(2855,4)], + .scan 5 64, + .scan 0 10, + .scan2 3 0 [(64,20),(2855,20),(489,20),(131766,20),(497991,20),(10046951,20),(42460789,20),(169985340,20),(851071651,20),(13113586455,20),(917618672,20),(2467392025413,20),(7568975623848,20),(323999599049458,20),(60962932559381,20),(2501539853807790,20),(13610723999989478,20),(136862209286159218,20),(602765613057160227,20),(802634092026668143,20),(24632223157801730,20),(172666786680267272,20)], + .scan 3 65810851921133561, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [197432555763400703,49358138940850176,12339534735212544,3084883683803136,771220920950784,192805230237696,48201307559424,12050326889856,3012581722464,753145430616,188286357654,47071589412,11767897352,2941974340,735493584,183873396,45968348,11492088,2873022,718254,179566,44892,11222,2806,702,174,44,10,2,2,2] 1 [(.D2,65810851921133567),(.D0,172666786680267273),(.D0,24632223157801731),(.D0,802634092026668144),(.D0,602765613057160228),(.D0,136862209286159219),(.D0,13610723999989479),(.D0,2501539853807791),(.D0,60962932559382),(.D0,323999599049459),(.D0,7568975623849),(.D0,2467392025414),(.D0,917618673),(.D0,13113586456),(.D0,851071652),(.D0,169985341),(.D0,42460790),(.D0,10046952),(.D0,497992),(.D0,131767),(.D0,490),(.D0,2856),(.D0,64)], + .batch [2] 131621703842267136 [(.D1,1)], + .batch [87747802561511424] 131621703842267137 [(.D5,161698311360078343),(.D5,22804143937770242),(.D5,802329412156662895),(.D5,602714833078826019),(.D5,136853745956436850),(.D5,13609313445035750),(.D5,2501304761315502),(.D5,60923750477333),(.D5,323993068702450),(.D5,7567887232680),(.D5,2467210626885),(.D5,887385584),(.D5,13108547607),(.D5,850231843),(.D5,169845372),(.D5,42437461),(.D5,10043063),(.D5,497343),(.D5,131658),(.D5,471),(.D5,2852),(.D1,64)], + .scan 0 50, + .scan2 5 9 [(175495605123022848,4),(139761360719700487,4),(19147985497707266,4),(801720052416652399,4),(602613273122157603,4),(136836819296992114,4),(13606492335128294,4),(2500834576330926,4),(60845386313237,4),(323980008008434,4),(7565710450344,4),(2466847829829,4),(826919408,4),(13098469911,4),(848552227,4),(169565436,4),(42390805,4),(10035287,4),(496047,4),(131442,4),(435,4),(2846,4)], + .scan 5 62, + .scan 0 10, + .scan2 3 0 [(62,20),(2846,20),(435,20),(131442,20),(496047,20),(10035287,20),(42390805,20),(169565436,20),(848552227,20),(13098469911,20),(826919408,20),(2466847829829,20),(7565710450344,20),(323980008008434,20),(60845386313237,20),(2500834576330926,20),(13606492335128294,20),(136836819296992114,20),(602613273122157603,20),(801720052416652399,20),(19147985497707266,20),(139761360719700487,20)], + .scan 3 175495605123022843, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [526486815369068549,131621703842267136,32905425960566784,8226356490141696,2056589122535424,514147280633856,128536820158464,32134205039616,8033551259904,2008387814976,502096953744,125524238436,31381059608,7845264904,1961316224,490329058,122582264,30645564,7661392,1915350,478836,119708,29928,7482,1870,468,116,30,6,4,14624633760251900] 1 [(.D2,175495605123022849),(.D0,139761360719700488),(.D0,19147985497707267),(.D0,801720052416652400),(.D0,602613273122157604),(.D0,136836819296992115),(.D0,13606492335128295),(.D0,2500834576330927),(.D0,60845386313238),(.D0,323980008008435),(.D0,7565710450345),(.D0,2466847829830),(.D0,826919409),(.D0,13098469912),(.D0,848552228),(.D0,169565437),(.D0,42390806),(.D0,10035288),(.D0,496048),(.D0,131443),(.D0,436),(.D0,2847),(.D0,62)], + .scan 0 50, + .scan2 5 9 [(358303527126171648,4),(106855934759133704,4),(13663747837612802,4),(800806012806636655,4),(602460933187154979,4),(136811429307825010,4),(13602260670267110,4),(2500129298854062,4),(60727840067093,4),(323960416967410,4),(7562445276840,4),(2466303634245,4),(736220144,4),(13083353367,4),(846032803,4),(169145532,4),(42320821,4),(10023623,4),(494103,4),(131118,4),(381,4),(2837,4)], + .scan 5 60, + .scan 0 10, + .scan2 3 0 [(60,20),(2837,20),(381,20),(131118,20),(494103,20),(10023623,20),(42320821,20),(169145532,20),(846032803,20),(13083353367,20),(736220144,20),(2466303634245,20),(7562445276840,20),(323960416967410,20),(60727840067093,20),(2500129298854062,20),(13602260670267110,20),(136811429307825010,20),(602460933187154979,20),(800806012806636655,20),(13663747837612802,20),(106855934759133704,20)], + .scan 3 358303527126171643, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [789730223053602813] 1 [(.D2,358303527126171649),(.D0,106855934759133705),(.D0,13663747837612803),(.D0,800806012806636656),(.D0,602460933187154980),(.D0,136811429307825011),(.D0,13602260670267111),(.D0,2500129298854063),(.D0,60727840067094),(.D0,323960416967411),(.D0,7562445276841),(.D0,2466303634246),(.D0,736220145),(.D0,13083353368),(.D0,846032804),(.D0,169145533),(.D0,42320822),(.D0,10023624),(.D0,494104),(.D0,131119),(.D0,382),(.D0,2838),(.D0,60)], + .scan 0 50, + .scan2 5 9 [(394865111526801406,4),(160870971362770945,4),(73950508798566920,4),(8179510177518338,4),(799891973196620911,4),(602308593252152355,4),(136786039318657906,4),(13598029005405926,4),(2499424021377198,4),(60610293820949,4),(323940825926386,4),(7559180103336,4),(2465759438661,4),(645520880,4),(13068236823,4),(843513379,4),(168725628,4),(42250837,4),(10011959,4),(492159,4),(130794,4),(327,4),(2828,4)], + .scan 5 58, + .scan 0 10, + .scan2 3 0 [(58,20),(2828,20),(327,20),(130794,20),(492159,20),(10011959,20),(42250837,20),(168725628,20),(843513379,20),(13068236823,20),(645520880,20),(2465759438661,20),(7559180103336,20),(323940825926386,20),(60610293820949,20),(2499424021377198,20),(13598029005405926,20),(136786039318657906,20),(602308593252152355,20),(799891973196620911,20),(8179510177518338,20),(73950508798566920,20),(160870971362770945,20)], + .scan 3 394865111526801401, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1184595334580404223,296148833645101056,74037208411275264,18509302102818816,4627325525704704,1156831381426176,289207845356544,72301961339136,18075490334784,4518872583696,1129718145924,282429536480,70607384118,17651846032,4412961506,1103240376,275810094,68952526,17238132,4309532,1077382,269346,67338,16832,4210,1052,262,66,18,2,2,2] 1 [(.D2,394865111526801407),(.D0,160870971362770946),(.D0,73950508798566921),(.D0,8179510177518339),(.D0,799891973196620912),(.D0,602308593252152356),(.D0,136786039318657907),(.D0,13598029005405927),(.D0,2499424021377199),(.D0,60610293820950),(.D0,323940825926387),(.D0,7559180103337),(.D0,2465759438662),(.D0,645520881),(.D0,13068236824),(.D0,843513380),(.D0,168725629),(.D0,42250838),(.D0,10011960),(.D0,492160),(.D0,130795),(.D0,328),(.D0,2829),(.D0,58)], + .batch [2] 789730223053602816 [(.D1,1)], + .batch [285180358324912130,71295089581228034,17823772395307008,4455943098826752,1113985774706688,278496443676672,69624110919168,17406027729792,4351506932448,1087876733112,271969183278,67992295818,16998073956,4249518490,1062379622,265594906,66398726,16599682,4149920,1037478,259372,64842,16212,4052,1012,254,64,14,4,2] 789730223053602817 [(.D5,95060119441637376),(.D5,62982033478377992),(.D5,6351430957486850),(.D5,799587293326615663),(.D5,602257813273818147),(.D5,136777575988935538),(.D5,13596618450452198),(.D5,2499188928884910),(.D5,60571111738901),(.D5,323934295579378),(.D5,7558091712168),(.D5,2465578040133),(.D5,615287792),(.D5,13063197975),(.D5,842673571),(.D5,168585660),(.D5,42227509),(.D5,10008071),(.D5,491511),(.D5,130686),(.D5,309),(.D5,2825),(.D1,58)], + .batch [2] 979850461936877571 [(.D1,1)], + .batch [24374389600419838] 979850461936877572 [(.D1,47138680238105097),(.D0,3710872084108035),(.D0,799147200181052528),(.D0,602184464416224292),(.D0,136765351179336563),(.D0,13594580982185703),(.D0,2498849350840495),(.D0,60514515398166),(.D0,323924862855923),(.D0,7556519591593),(.D0,2465316020038),(.D0,571617777),(.D0,13055919640),(.D0,841460516),(.D0,168383485),(.D0,42193814),(.D0,10002456),(.D0,490576),(.D0,130531),(.D2,283),(.D5,2821),(.D4,56)], + .scan 0 50, + .scan2 5 9 [(992037656737087490,4),(41045082838000136,4),(2695272517423874,4),(798977933586605167,4),(602156253317149731,4),(136760649329490802,4),(13593797340544742,4),(2498718743900334,4),(60492747574805,4),(323921234885362,4),(7555914929832,4),(2465215243077,4),(554821616,4),(13053120279,4),(840993955,4),(168305724,4),(42180853,4),(10000295,4),(490215,4),(130470,4),(273,4),(2819,4)], + .scan 5 56, + .scan 0 10, + .scan2 3 0 [(56,20),(2819,20),(273,20),(130470,20),(490215,20),(10000295,20),(42180853,20),(168305724,20),(840993955,20),(13053120279,20),(554821616,20),(2465215243077,20),(7555914929832,20),(323921234885362,20),(60492747574805,20),(2498718743900334,20),(13593797340544742,20),(136760649329490802,20),(602156253317149731,20),(798977933586605167,20),(2695272517423874,20),(41045082838000136,20)], + .scan 3 992037656737087485, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [291089431881778533,72772357970444544,18193089492611136,4548272373152784,1137068093288232,284267023322040,71066755830528,17766688957704,4441672239336,1110418059816,277604515008,69401128752,17350282224,4337570520,1084392648,271098144,67774536,16943616,4235976,1058904,264744,66168,16560,4176,1008,288,66935163424093992] 1 [(.D2,992037656737087491),(.D0,41045082838000137),(.D0,2695272517423875),(.D0,798977933586605168),(.D0,602156253317149732),(.D0,136760649329490803),(.D0,13593797340544743),(.D0,2498718743900335),(.D0,60492747574806),(.D0,323921234885363),(.D0,7555914929833),(.D0,2465215243078),(.D0,554821617),(.D0,13053120280),(.D0,840993956),(.D0,168305725),(.D0,42180854),(.D0,10000296),(.D0,490216),(.D0,130471),(.D0,274),(.D0,2820),(.D0,56)] +] +theorem chunk_19_ok : q6 cmds_19 cfg_19=some cfg_20:= by decide +kernel +def cmds_20 : List Cmd:=[ + .scan 0 50, + .scan2 5 9 [(227527202966565958,4),(878274055253804511,4),(22084482590786306,4),(798063893976589425,4),(602003913382147107,4),(136735259340323698,4),(13589565675683558,4),(2498013466423470,4),(60375201328661,4),(323901643844338,4),(7552649756328,4),(2464671047493,4),(464122352,4),(13038003735,4),(838474531,4),(167885820,4),(42110869,4),(9988631,4),(488271,4),(130146,4),(219,4),(2810,4)], + .scan 5 54, + .scan 0 10, + .scan2 3 0 [(54,20),(2810,20),(219,20),(130146,20),(488271,20),(9988631,20),(42110869,20),(167885820,20),(838474531,20),(13038003735,20),(464122352,20),(2464671047493,20),(7552649756328,20),(323901643844338,20),(60375201328661,20),(2498013466423470,20),(13589565675683558,20),(136735259340323698,20),(602003913382147107,20),(798063893976589425,20),(22084482590786306,20),(878274055253804511,20)], + .scan 3 227527202966565953, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [682581608899697879,107148614153904934] 1 [(.D2,227527202966565959),(.D0,878274055253804512),(.D0,22084482590786307),(.D0,798063893976589426),(.D0,602003913382147108),(.D0,136735259340323699),(.D0,13589565675683559),(.D0,2498013466423471),(.D0,60375201328662),(.D0,323901643844339),(.D0,7552649756329),(.D0,2464671047494),(.D0,464122353),(.D0,13038003736),(.D0,838474532),(.D0,167885821),(.D0,42110870),(.D0,9988632),(.D0,488272),(.D0,130147),(.D0,220),(.D0,2811),(.D0,54)], + .scan 0 50, + .scan2 5 9 [(394865111526801406,4),(30094647203165255,4),(845368629293237727,4),(16600244930691842,4),(797149854366573681,4),(601851573447144483,4),(136709869351156594,4),(13585334010822374,4),(2497308188946606,4),(60257655082517,4),(323882052803314,4),(7549384582824,4),(2464126851909,4),(373423088,4),(13022887191,4),(835955107,4),(167465916,4),(42040885,4),(9976967,4),(486327,4),(129822,4),(165,4),(2801,4)], + .scan 5 52, + .scan 0 10, + .scan2 3 0 [(52,20),(2801,20),(165,20),(129822,20),(486327,20),(9976967,20),(42040885,20),(167465916,20),(835955107,20),(13022887191,20),(373423088,20),(2464126851909,20),(7549384582824,20),(323882052803314,20),(60257655082517,20),(2497308188946606,20),(13585334010822374,20),(136709869351156594,20),(601851573447144483,20),(797149854366573681,20),(16600244930691842,20),(845368629293237727,20),(30094647203165255,20)], + .scan 3 394865111526801401, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [541703649656974617,135425912414243652,33856478103560904,8464119525890220,2116029881472552,529007470368144,132251867592048,33062966898012,8265741724488,2066435431128,516608857788,129152214444,32288053608,8072013408,2018003340,504500832,126125208,31531308,7882824,1970712,492684,123168,30780,7704,1932,480,108,36,12,12] 1 [(.D2,394865111526801407),(.D0,30094647203165256),(.D0,845368629293237728),(.D0,16600244930691843),(.D0,797149854366573682),(.D0,601851573447144484),(.D0,136709869351156595),(.D0,13585334010822375),(.D0,2497308188946607),(.D0,60257655082518),(.D0,323882052803315),(.D0,7549384582825),(.D0,2464126851910),(.D0,373423089),(.D0,13022887192),(.D0,835955108),(.D0,167465917),(.D0,42040886),(.D0,9976968),(.D0,486328),(.D0,129823),(.D0,166),(.D0,2802)], + .batch [12] 361135766437983077 [(.D5,214297228307809868),(.D1,1)], + .batch [642891684923429596,26459949317512196] 361135766437983083 [(.D5,214297228307809865),(.D5,840352854759376850),(.D1,15764282508381697),(.D1,797010527296188658),(.D0,601828352268746980),(.D0,136705999154757011),(.D0,13584688978089111),(.D0,2497200683491063),(.D0,60239737506594),(.D2,323879066540660),(.D3,7548886872382),(.D1,2464043900170),(.D0,359597799),(.D2,13020582976),(.D5,835571071),(.D3,167401911),(.D4,42030217),(.D1,9975190),(.D3,486031),(.D5,129773),(.D2,157),(.D5,2800),(.D0,52)], + .scan 0 50, + .scan2 5 9 [(695811583558453978,4),(46959319747574417,4),(812463203332670942,4),(11116007270597378,4),(796235814756557937,4),(601699233512141859,4),(136684479361989490,4),(13581102345961190,4),(2496602911469742,4),(60140108836373,4),(323862461762290,4),(7546119409320,4),(2463582656325,4),(282723824,4),(13007770647,4),(833435683,4),(167046012,4),(41970901,4),(9965303,4),(484383,4),(129498,4),(111,4),(2792,4)], + .scan 5 50, + .scan 0 10, + .scan2 3 0 [(50,20),(2792,20),(111,20),(129498,20),(484383,20),(9965303,20),(41970901,20),(167046012,20),(833435683,20),(13007770647,20),(282723824,20),(2463582656325,20),(7546119409320,20),(323862461762290,20),(60140108836373,20),(2496602911469742,20),(13581102345961190,20),(136684479361989490,20),(601699233512141859,20),(796235814756557937,20),(11116007270597378,20),(812463203332670942,20),(46959319747574417,20)], + .scan 3 695811583558453973, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [845267755456339533,211316938864084872,52829234716021212,13207308679005300,3301827169751340,825456792437832,206364198109452,51591049527360,12897762381852,3224440595460,806110148868,201527537220,50381884296,12595471068,3148867764,787216956,196804236,49201056,12300264,3075072,768756,192192,48060,12000,3012,756,180,48,601892944063305120] 1 [(.D2,695811583558453979),(.D0,46959319747574418),(.D0,812463203332670943),(.D0,11116007270597379),(.D0,796235814756557938),(.D0,601699233512141860),(.D0,136684479361989491),(.D0,13581102345961191),(.D0,2496602911469743),(.D0,60140108836374),(.D0,323862461762291),(.D0,7546119409321),(.D0,2463582656326),(.D0,282723825),(.D0,13007770648),(.D0,833435684),(.D0,167046013),(.D0,41970902),(.D0,9965304),(.D0,484384),(.D0,129499),(.D0,112),(.D0,2793),(.D0,50)], + .scan 0 50, + .scan2 5 9 [(864458309002545568,4),(263582429057181194,4),(779557777372104160,4),(5631769610502914,4),(795321775146542193,4),(601546893577139235,4),(136659089372822386,4),(13576870681100006,4),(2495897633992878,4),(60022562590229,4),(323842870721266,4),(7542854235816,4),(2463038460741,4),(192024560,4),(12992654103,4),(830916259,4),(166626108,4),(41900917,4),(9953639,4),(482439,4),(129174,4),(57,4),(2783,4)], + .scan 5 48, + .scan 0 10, + .scan2 3 0 [(48,20),(2783,20),(57,20),(129174,20),(482439,20),(9953639,20),(41900917,20),(166626108,20),(830916259,20),(12992654103,20),(192024560,20),(2463038460741,20),(7542854235816,20),(323842870721266,20),(60022562590229,20),(2495897633992878,20),(13576870681100006,20),(136659089372822386,20),(601546893577139235,20),(795321775146542193,20),(5631769610502914,20),(779557777372104160,20),(263582429057181194,20)], + .scan 3 864458309002545563, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [2593374927007636709,648343731751909176,162085932937977294,40521483234494324,10130370808623580,2532592702155896,633148175538972,158287043884744,39571760971188,9892940242796,2473235060698,618308765174,154577191294,38644297824,9661074456,2415268614,603817154,150954288,37738572,9434644,2358660,589664,147418,36854,9214,2304,576,144,36,8,176001963433042032,37422720285530400] 1 [(.D2,864458309002545569),(.D0,263582429057181195),(.D0,779557777372104161),(.D0,5631769610502915),(.D0,795321775146542194),(.D0,601546893577139236),(.D0,136659089372822387),(.D0,13576870681100007),(.D0,2495897633992879),(.D0,60022562590230),(.D0,323842870721267),(.D0,7542854235817),(.D0,2463038460742),(.D0,192024561),(.D0,12992654104),(.D0,830916260),(.D0,166626109),(.D0,41900918),(.D0,9953640),(.D0,482440),(.D0,129175),(.D0,58),(.D0,2784),(.D0,48)], + .scan 0 50, + .scan2 5 9 [(1835628959864377353,4),(66149873293780492,4),(746652351411537376,4),(147531950408450,4),(794407735536526449,4),(601394553642136611,4),(136633699383655282,4),(13572639016238822,4),(2495192356516014,4),(59905016344085,4),(323823279680242,4),(7539589062312,4),(2462494265157,4),(101325296,4),(12977537559,4),(828396835,4),(166206204,4),(41830933,4),(9941975,4),(480495,4),(128850,4),(3,4),(2774,4)], + .scan 5 46, + .scan 0 10, + .scan2 3 0 [(46,20),(2774,20),(3,20),(128850,20),(480495,20),(9941975,20),(41830933,20),(166206204,20),(828396835,20),(12977537559,20),(101325296,20),(2462494265157,20),(7539589062312,20),(323823279680242,20),(59905016344085,20),(2495192356516014,20),(13572639016238822,20),(136633699383655282,20),(601394553642136611,20),(794407735536526449,20),(147531950408450,20),(746652351411537376,20),(66149873293780492,20)], + .scan 3 1835628959864377348, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [95600703864676461,23900175966168576,5975043991542144,1493760997885536,373440249471600,93360062367792,23340015591840,5835003898176,1458750974976,364687743744,91171935936,22792983984,5698245456,1424561472,356140800,89035200,22258800,5564160,1391472,347760,86832,21600,5616,1296] 1 [(.D2,1835628959864377354),(.D0,66149873293780493),(.D0,746652351411537377),(.D0,147531950408451),(.D0,794407735536526450),(.D0,601394553642136612),(.D0,136633699383655283),(.D0,13572639016238823),(.D0,2495192356516015),(.D0,59905016344086),(.D0,323823279680243),(.D0,7539589062313),(.D0,2462494265158),(.D0,101325297),(.D0,12977537560),(.D0,828396836),(.D0,166206205),(.D0,41830934),(.D0,9941976),(.D0,480496),(.D0,128851),(.D0,4)], + .batch [29941617302063856,7312316880125952] 63733802576450615 [(.D5,1803762058576152046),(.D5,60838723079076274),(.D5,745767159709086673),(.D5,794383146878125042),(.D0,601390455532403044),(.D0,136633016365366355),(.D0,13572525179857335),(.D0,2495173383785767),(.D4,59901854222377),(.D2,323822752659958),(.D2,7539501225598),(.D5,2462479625705),(.D4,98885387),(.D5,12977130908),(.D2,828329060),(.D3,166194909),(.D0,41829051),(.D1,9941662),(.D5,480443),(.D4,128841),(.D5,2),(.D0,2775)], + .batch [124309386962141184] 82360769667545519 [(.D5,1794448575030604594),(.D5,59286475821485032),(.D5,745508451832821466),(.D5,794340028898747507),(.D5,601383269202506787),(.D5,136631818643716978),(.D5,13572325559582438),(.D5,2495140113739950),(.D5,59896309214741),(.D5,323821828492018),(.D5,7539347197608),(.D5,2462453954373),(.D5,94606832),(.D5,12976417815),(.D5,828210211),(.D5,166175100),(.D5,41825749),(.D5,9941111),(.D5,480351),(.D5,128826),(.D1,2775),(.D0,46)], + .scan 0 50, + .scan2 5 9 [(144515463148616110,4),(1763371228290069298,4),(54106918031395816,4),(744645192201139930,4),(794196152293467251,4),(601359289768293411,4),(136627822071348082,4),(13571659464187622,4),(2495029097840814,4),(59877806564885,4),(323818744717042,4),(7538833235112,4),(2462368293957,4),(80330096,4),(12974038359,4),(827813635,4),(166109004,4),(41814733,4),(9939275,4),(480045,4),(128775,4),(2765,4)], + .scan 5 44, + .scan 0 10, + .scan2 3 0 [(44,20),(2765,20),(128775,20),(480045,20),(9939275,20),(41814733,20),(166109004,20),(827813635,20),(12974038359,20),(80330096,20),(2462368293957,20),(7538833235112,20),(323818744717042,20),(59877806564885,20),(2495029097840814,20),(13571659464187622,20),(136627822071348082,20),(601359289768293411,20),(794196152293467251,20),(744645192201139930,20),(54106918031395816,20),(1763371228290069298,20)], + .scan 3 144515463148616105, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [433546389445848335,108386597361462084,27096649340365520,6774162335091378,1693540583772846,423385145943210,105846286485804,26461571621452,6615392905362,1653848226342,413462056584,103365514146,25841378538,6460344632,1615086160,403771538,100942884,25235722,6308930,1577232,394308,98578,24644,6162,1540,386,96,24,6,2,2] 1 [(.D2,144515463148616111),(.D0,1763371228290069299),(.D0,54106918031395817),(.D0,744645192201139931),(.D0,794196152293467252),(.D0,601359289768293412),(.D0,136627822071348083),(.D0,13571659464187623),(.D0,2495029097840815),(.D0,59877806564886),(.D0,323818744717043),(.D0,7538833235113),(.D0,2462368293958),(.D0,80330097),(.D0,12974038360),(.D0,827813636),(.D0,166109005),(.D0,41814734),(.D0,9939276),(.D0,480046),(.D0,128776),(.D0,2766),(.D0,44)], + .batch [2] 289030926297232224 [(.D1,1)], + .batch [35278061743189728] 289030926297232225 [(.D5,1739285317765299945),(.D5,50092599610600924),(.D1,743976139131007449),(.D1,794084643448445172),(.D0,601340704960789732),(.D0,136624724603430803),(.D0,13571143219534743),(.D4,2494943057065334),(.D2,59863466435639),(.D0,323816354695502),(.D0,7538434898189),(.D1,2462301904471),(.D4,69265181),(.D5,12972194207),(.D4,827506276),(.D5,166057778),(.D4,41806195),(.D3,9937853),(.D0,479809),(.D2,128736),(.D2,2759),(.D4,42)], + .scan 0 50, + .scan2 5 9 [(306669957168827088,4),(1730465802329502513,4),(48622680371301352,4),(743731152591124186,4),(794043812358464627,4),(601333899779126307,4),(136623590406486898,4),(13570954186710758,4),(2494911551594670,4),(59858215523861,4),(323815479543538,4),(7538289039528,4),(2462277594693,4),(65213552,4),(12971518935,4),(827393731,4),(166039020,4),(41803069,4),(9937331,4),(479721,4),(128721,4),(2756,4)], + .scan 5 42, + .scan 0 10, + .scan2 3 0 [(42,20),(2756,20),(128721,20),(479721,20),(9937331,20),(41803069,20),(166039020,20),(827393731,20),(12971518935,20),(65213552,20),(2462277594693,20),(7538289039528,20),(323815479543538,20),(59858215523861,20),(2494911551594670,20),(13570954186710758,20),(136623590406486898,20),(601333899779126307,20),(794043812358464627,20),(743731152591124186,20),(48622680371301352,20),(1730465802329502513,20)], + .scan 3 306669957168827083, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [789730223053602813] 1 [(.D2,306669957168827089),(.D0,1730465802329502514),(.D0,48622680371301353),(.D0,743731152591124187),(.D0,794043812358464628),(.D0,601333899779126308),(.D0,136623590406486899),(.D0,13570954186710759),(.D0,2494911551594671),(.D0,59858215523862),(.D0,323815479543539),(.D0,7538289039529),(.D0,2462277594694),(.D0,65213553),(.D0,12971518936),(.D0,827393732),(.D0,166039021),(.D0,41803070),(.D0,9937332),(.D0,479722),(.D0,128722),(.D0,2757),(.D0,42)], + .scan 0 50, + .scan2 5 9 [(394865111526801406,4),(109237401405426385,4),(1697560376368935729,4),(43138442711206888,4),(742817112981108442,4),(793891472423462003,4),(601308509789959203,4),(136619358741625714,4),(13570248909233894,4),(2494794005348526,4),(59838624482837,4),(323812214370034,4),(7537744843944,4),(2462186895429,4),(50097008,4),(12968999511,4),(826973827,4),(165969036,4),(41791405,4),(9935387,4),(479397,4),(128667,4),(2747,4)], + .scan 5 40, + .scan 0 10, + .scan2 3 0 [(40,20),(2747,20),(128667,20),(479397,20),(9935387,20),(41791405,20),(165969036,20),(826973827,20),(12968999511,20),(50097008,20),(2462186895429,20),(7537744843944,20),(323812214370034,20),(59838624482837,20),(2494794005348526,20),(13570248909233894,20),(136619358741625714,20),(601308509789959203,20),(793891472423462003,20),(742817112981108442,20),(43138442711206888,20),(1697560376368935729,20),(109237401405426385,20)], + .scan 3 394865111526801401, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1184595334580404223,296148833645101056,74037208411275264,18509302102818816,4627325525704704,1156831381426176,289207845356544,72301961339136,18075490334784,4518872583696,1129718145924,282429536480,70607384118,17651846032,4412961506,1103240376,275810094,68952526,17238132,4309532,1077382,269346,67338,16832,4210,1052,262,66,18,2,2,2] 1 [(.D2,394865111526801407),(.D0,109237401405426386),(.D0,1697560376368935730),(.D0,43138442711206889),(.D0,742817112981108443),(.D0,793891472423462004),(.D0,601308509789959204),(.D0,136619358741625715),(.D0,13570248909233895),(.D0,2494794005348527),(.D0,59838624482838),(.D0,323812214370035),(.D0,7537744843945),(.D0,2462186895430),(.D0,50097009),(.D0,12968999512),(.D0,826973828),(.D0,165969037),(.D0,41791406),(.D0,9935388),(.D0,479398),(.D0,128668),(.D0,2748),(.D0,40)], + .batch [2] 789730223053602816 [(.D1,1)], + .batch [130279648452878450,32569912113219614,8142478028304904,2035619507076224,508904876769058,127226219192264,31806554798064,7951638699516,1987909674880,496977418722,124244354678,31061088670,7765272168,1941318042,485329512,121332378,30333092,7583274,1895818,473954,118488,29622,7408,1850,462,118,30,6,2] 789730223053602817 [(.D5,43426549484292816),(.D5,1686591901048746801),(.D5,41310363491175400),(.D5,742512433111103194),(.D5,793840692445127795),(.D5,601300046460236835),(.D5,136617948186671986),(.D5,13570013816741606),(.D5,2494754823266478),(.D5,59832094135829),(.D5,323811125978866),(.D5,7537563445416),(.D5,2462156662341),(.D5,45058160),(.D5,12968159703),(.D5,826833859),(.D5,165945708),(.D5,41787517),(.D5,9934739),(.D5,479289),(.D5,128649),(.D5,2744),(.D1,40)], + .batch [2] 876583322022188451 [(.D1,1)], + .batch [58796769571982878] 876583322022188452 [(.D1,1679354142801364666),(.D2,40104070449945044),(.D1,742311384270898136),(.D2,793807184305093619),(.D0,601294461770231140),(.D0,136617017405004371),(.D4,13569858686463670),(.D2,2494728968220156),(.D4,59827784961442),(.D0,323810407783136),(.D4,7537443746127),(.D5,2462136712460),(.D2,41733180),(.D1,12967605541),(.D4,826741498),(.D1,165930316),(.D2,41784952),(.D0,9934312),(.D3,479218),(.D5,128637),(.D1,2743),(.D3,39)], + .scan 0 50, + .scan2 5 9 [(905981706808179890,4),(1664654950408368945,4),(37654205051112424,4),(741903073371092698,4),(793739132488459379,4),(601283119800792099,4),(136615127076764530,4),(13569543631757030,4),(2494676459102382,4),(59819033441813,4),(323808949196530,4),(7537200648360,4),(2462096196165,4),(34980464,4),(12966480087,4),(826553923,4),(165899052,4),(41779741,4),(9933443,4),(479073,4),(128613,4),(2738,4)], + .scan 5 38, + .scan 0 10, + .scan2 3 0 [(38,20),(2738,20),(128613,20),(479073,20),(9933443,20),(41779741,20),(165899052,20),(826553923,20),(12966480087,20),(34980464,20),(2462096196165,20),(7537200648360,20),(323808949196530,20),(59819033441813,20),(2494676459102382,20),(13569543631757030,20),(136615127076764530,20),(601283119800792099,20),(793739132488459379,20),(741903073371092698,20),(37654205051112424,20),(1664654950408368945,20)], + .scan 3 905981706808179885, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [789730223053602813] 1 [(.D2,905981706808179891),(.D0,1664654950408368946),(.D0,37654205051112425),(.D0,741903073371092699),(.D0,793739132488459380),(.D0,601283119800792100),(.D0,136615127076764531),(.D0,13569543631757031),(.D0,2494676459102383),(.D0,59819033441814),(.D0,323808949196531),(.D0,7537200648361),(.D0,2462096196166),(.D0,34980465),(.D0,12966480088),(.D0,826553924),(.D0,165899053),(.D0,41779742),(.D0,9933444),(.D0,479074),(.D0,128614),(.D0,2739),(.D0,38)], + .scan 0 50, + .scan2 5 9 [(394865111526801406,4),(708549151044779187,4),(1631749524447802161,4),(32169967391017960,4),(740989033761076954,4),(793586792553456755,4),(601257729811624995,4),(136610895411903346,4),(13568838354280166,4),(2494558912856238,4),(59799442400789,4),(323805684023026,4),(7536656452776,4),(2462005496901,4),(19863920,4),(12963960663,4),(826134019,4),(165829068,4),(41768077,4),(9931499,4),(478749,4),(128559,4),(2729,4)], + .scan 5 36, + .scan 0 10, + .scan2 3 0 [(36,20),(2729,20),(128559,20),(478749,20),(9931499,20),(41768077,20),(165829068,20),(826134019,20),(12963960663,20),(19863920,20),(2462005496901,20),(7536656452776,20),(323805684023026,20),(59799442400789,20),(2494558912856238,20),(13568838354280166,20),(136610895411903346,20),(601257729811624995,20),(793586792553456755,20),(740989033761076954,20),(32169967391017960,20),(1631749524447802161,20),(708549151044779187,20)], + .scan 3 394865111526801401, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1184595334580404223,296148833645101056,74037208411275264,18509302102818816,4627325525704704,1156831381426176,289207845356544,72301961339136,18075490334784,4518872583696,1129718145924,282429536480,70607384118,17651846032,4412961506,1103240376,275810094,68952526,17238132,4309532,1077382,269346,67338,16832,4210,1052,262,66,18,2,2,2] 1 [(.D2,394865111526801407),(.D0,708549151044779188),(.D0,1631749524447802162),(.D0,32169967391017961),(.D0,740989033761076955),(.D0,793586792553456756),(.D0,601257729811624996),(.D0,136610895411903347),(.D0,13568838354280167),(.D0,2494558912856239),(.D0,59799442400790),(.D0,323805684023027),(.D0,7536656452777),(.D0,2462005496902),(.D0,19863921),(.D0,12963960664),(.D0,826134020),(.D0,165829069),(.D0,41768078),(.D0,9931500),(.D0,478750),(.D0,128560),(.D0,2730),(.D0,36)], + .batch [2] 789730223053602816 [(.D1,1)], + .batch [526486815369068544] 789730223053602817 [(.D5,642738299123645618),(.D5,1620781049127613233),(.D5,30341888170986472),(.D5,740684353891071706),(.D5,793536012575122547),(.D5,601249266481902627),(.D5,136609484856949618),(.D5,13568603261787878),(.D5,2494519730774190),(.D5,59792912053781),(.D5,323804595631858),(.D5,7536475054248),(.D5,2461975263813),(.D5,14825072),(.D5,12963120855),(.D5,825994051),(.D5,165805740),(.D5,41764189),(.D5,9930851),(.D5,478641),(.D5,128541),(.D5,2726),(.D1,36)], + .scan 0 50, + .scan2 5 9 [(1052973630738137088,4),(511116595281378482,4),(1598844098487235377,4),(26685729730923496,4),(740074994151061210,4),(793434452618454131,4),(601232339822457891,4),(136606663747042162,4),(13568133076803302,4),(2494441366610094,4),(59779851359765,4),(323802418849522,4),(7536112257192,4),(2461914797637,4),(4747376,4),(12961441239,4),(825714115,4),(165759084,4),(41756413,4),(9929555,4),(478425,4),(128505,4),(2720,4)], + .scan 5 34, + .scan 0 10, + .scan2 3 0 [(34,20),(2720,20),(128505,20),(478425,20),(9929555,20),(41756413,20),(165759084,20),(825714115,20),(12961441239,20),(4747376,20),(2461914797637,20),(7536112257192,20),(323802418849522,20),(59779851359765,20),(2494441366610094,20),(13568133076803302,20),(136606663747042162,20),(601232339822457891,20),(793434452618454131,20),(740074994151061210,20),(26685729730923496,20),(1598844098487235377,20),(511116595281378482,20)], + .scan 3 1052973630738137083, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1116072769124892669,279018113917059072,69754606843428864,17438690892939264,4359555176988672,1089888794247168,272393834397696,68176822763520,16926659444736,4231664861184,1253826625536,156728328192,541713756094562304] 1 [(.D2,1052973630738137089),(.D0,511116595281378483),(.D0,1598844098487235378),(.D0,26685729730923497),(.D0,740074994151061211),(.D0,793434452618454132),(.D0,601232339822457892),(.D0,136606663747042163),(.D0,13568133076803303),(.D0,2494441366610095),(.D0,59779851359766),(.D0,323802418849523),(.D0,7536112257193),(.D0,2461914797638),(.D0,4747377),(.D0,12961441240),(.D0,825714116),(.D0,165759085),(.D0,41756414),(.D0,9929556),(.D0,478426),(.D0,128506),(.D0,2721),(.D0,34)], + .scan 0 50, + .scan2 5 9 [(1014905260190269438,4),(545521000643002369,4),(426541156932189362,4),(1584748192095703857,4),(24336411999001576,4),(739683441195740890,4),(793369193792567411,4),(601221463351476771,4),(136604851001878642,4),(13567830952609382,4),(2494391012577774,4),(59771459021045,4),(323801020126402,4),(7535879136672,4),(2461875944217,4),(12958921817,4),(825294211,4),(165689100,4),(41744749,4),(9927611,4),(478101,4),(128451,4),(2711,4)], + .scan 5 32, + .scan 0 10, + .scan2 3 0 [(32,20),(2711,20),(128451,20),(478101,20),(9927611,20),(41744749,20),(165689100,20),(825294211,20),(12958921817,20),(2461875944217,20),(7535879136672,20),(323801020126402,20),(59771459021045,20),(2494391012577774,20),(13567830952609382,20),(136604851001878642,20),(601221463351476771,20),(793369193792567411,20),(739683441195740890,20),(24336411999001576,20),(1584748192095703857,20),(426541156932189362,20),(545521000643002369,20)], + .scan 3 1014905260190269433, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [3044715780570808319,761178945142702080,190294736285675520,47573684071418880,11893421017854720,2973355254463680,743338813615920,185834703403980,46458675850994,11614668962748,2903667240688,725916810170,181479202542,45369800638,11342450160,2835612540,708903134,177225784,44306444,11076612,2769154,692288,173070,43270,10818,2702,676,170,42,10,2,2,2] 1 [(.D2,1014905260190269439),(.D0,545521000643002370),(.D0,426541156932189363),(.D0,1584748192095703858),(.D0,24336411999001577),(.D0,739683441195740891),(.D0,793369193792567412),(.D0,601221463351476772),(.D0,136604851001878643),(.D0,13567830952609383),(.D0,2494391012577775),(.D0,59771459021046),(.D0,323801020126403),(.D0,7535879136673),(.D0,2461875944218),(.D0,12958921818),(.D0,825294212),(.D0,165689101),(.D0,41744750),(.D0,9927612),(.D0,478102),(.D0,128452),(.D0,2712),(.D0,32)], + .batch [2] 2029810520380538880 [(.D1,1)], + .batch [113126716260089856] 2029810520380538881 [(.D5,376370123944624128),(.D5,398349344149126322),(.D5,1580049556631860017),(.D5,23553306088360936),(.D5,739552923543967450),(.D5,793347440850605171),(.D5,601217837861149731),(.D5,136604246753490802),(.D5,13567730244544742),(.D5,2494374227900334),(.D5,59768661574805),(.D5,323800553885362),(.D5,7535801429832),(.D1,2461862993078),(.D3,12956763294),(.D5,824934457),(.D3,165629142),(.D0,41734757),(.D2,9925946),(.D0,477824),(.D5,128405),(.D0,2704),(.D5,30)], + .scan 0 50, + .scan2 5 9 [(2086373878510583808,4),(348088444879601664,4),(393635730971622578,4),(1579263954435609393,4),(23422372388985832,4),(739531101260738266,4),(793343803803400307,4),(601217231686615587,4),(136604145724401778,4),(13567713406363238,4),(2494371421536750,4),(59768193847541,4),(323800475930818,4),(7535788437408,4),(2461860827673,4),(12956402393,4),(824874307,4),(165619116,4),(41733085,4),(9925667,4),(477777,4),(128397,4),(2702,4)], + .scan 5 30, + .scan 0 10, + .scan2 3 0 [(30,20),(2702,20),(128397,20),(477777,20),(9925667,20),(41733085,20),(165619116,20),(824874307,20),(12956402393,20),(2461860827673,20),(7535788437408,20),(323800475930818,20),(59768193847541,20),(2494371421536750,20),(13567713406363238,20),(136604145724401778,20),(601217231686615587,20),(793343803803400307,20),(739531101260738266,20),(23422372388985832,20),(1579263954435609393,20),(393635730971622578,20),(348088444879601664,20)], + .scan 3 2086373878510583803, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [4738381338321616893] 1 [(.D2,2086373878510583809),(.D0,348088444879601665),(.D0,393635730971622579),(.D0,1579263954435609394),(.D0,23422372388985833),(.D0,739531101260738267),(.D0,793343803803400308),(.D0,601217231686615588),(.D0,136604145724401779),(.D0,13567713406363239),(.D0,2494371421536751),(.D0,59768193847542),(.D0,323800475930819),(.D0,7535788437409),(.D0,2461860827674),(.D0,12956402394),(.D0,824874308),(.D0,165619117),(.D0,41733086),(.D0,9925668),(.D0,477778),(.D0,128398),(.D0,2703),(.D0,30)], + .scan 0 50, + .scan2 5 9 [(2369190669160808446,4),(901778543930179585,4),(150655889116200960,4),(360730305011055794,4),(1573779716775514929,4),(22508332778970088,4),(739378761325735642,4),(793318413814233203,4),(601213000021754403,4),(136603440446924914,4),(13567595860117094,4),(2494351830495726,4),(59764928674037,4),(323799931735234,4),(7535697738144,4),(2461845711129,4),(12953882969,4),(824454403,4),(165549132,4),(41721421,4),(9923723,4),(477453,4),(128343,4),(2693,4)], + .scan 5 28, + .scan 0 10, + .scan2 3 0 [(28,20),(2693,20),(128343,20),(477453,20),(9923723,20),(41721421,20),(165549132,20),(824454403,20),(12953882969,20),(2461845711129,20),(7535697738144,20),(323799931735234,20),(59764928674037,20),(2494351830495726,20),(13567595860117094,20),(136603440446924914,20),(601213000021754403,20),(793318413814233203,20),(739378761325735642,20),(22508332778970088,20),(1573779716775514929,20),(360730305011055794,20),(150655889116200960,20),(901778543930179585,20)], + .scan 3 2369190669160808441, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [7107572007482425343,1776893001870606336,444223250467651584,111055812616912896,27763953154228224,6940988288557056,1735247072139264,433811768034816,108452942008704,27113235502176,6778308875544,1694577218886,423644304720,105911076180,26477769044,6619442262,1654860564,413715142,103428786,25857198,6464298,1616076,404018,101004,25252,6312,1578,396,98,24,6,2,2] 1 [(.D2,2369190669160808447),(.D0,901778543930179586),(.D0,150655889116200961),(.D0,360730305011055795),(.D0,1573779716775514930),(.D0,22508332778970089),(.D0,739378761325735643),(.D0,793318413814233204),(.D0,601213000021754404),(.D0,136603440446924915),(.D0,13567595860117095),(.D0,2494351830495727),(.D0,59764928674038),(.D0,323799931735235),(.D0,7535697738145),(.D0,2461845711130),(.D0,12953882970),(.D0,824454404),(.D0,165549133),(.D0,41721422),(.D0,9923724),(.D0,477454),(.D0,128344),(.D0,2694),(.D0,28)], + .batch [2] 4738381338321616896 [(.D1,1)], + .batch [1520740297210134530,380185074302533634,95046268575633408,23761567143908352,5940391785977088,1485097946494272,371274486623568,92818621655892,23204655413974,5801163853494,1450290963372,362572740842,90643185210,22660796304,5665199076,1416299770,354074942,88518736,22129682,5532420,1383106,345776,86446,21612,5402,1350,336,84,22,6,2] 4738381338321616897 [(.D5,506913432403378176),(.D5,84845037195067392),(.D5,349761829690866866),(.D5,1571951637555483441),(.D5,22203652908964840),(.D5,739327981347401434),(.D5,793309950484510835),(.D5,601211589466800675),(.D5,136603205354432626),(.D5,13567556678035046),(.D5,2494345300148718),(.D5,59763840282869),(.D5,323799750336706),(.D5,7535667505056),(.D5,2461840672281),(.D5,12953043161),(.D5,824314435),(.D5,165525804),(.D5,41717533),(.D5,9923075),(.D5,477345),(.D5,128325),(.D5,2690),(.D1,28)], + .batch [2] 5752208203128373251 [(.D1,1)], + .batch [1078395383513090,269598845878272,67399711469568,16849927867392,4212481966848,1053120491712,263280122928,65820030732,16455007684,4113751920,1028437980,257109494,64277374,16069344,4017336,1004334,251084,62770,15692,3924,982,246,60,14,4,2] 5752208203128373252 [(.D1,359465127837697),(.D0,335680901012995251),(.D0,1569604816109171506),(.D0,21812516001246185),(.D0,739262791862781659),(.D0,793299085570407540),(.D0,601209778647783460),(.D0,136602903551263091),(.D0,13567506377506791),(.D0,2494336916727343),(.D0,59762443045974),(.D0,323799517463891),(.D2,7535628692920),(.D3,2461834203592),(.D1,12951965047),(.D3,824134750),(.D0,165495857),(.D3,41712542),(.D3,9922244),(.D2,477207)], + .batch [2] 5752927133384048645 [(.D1,1)], + .batch [31184444431466494] 5752927133384048646 [(.D1,335620990158355635),(.D0,1569594830966731570),(.D0,21810851810839529),(.D0,739262514497713883),(.D0,793299039342896244),(.D0,601209770943198244),(.D0,136602902267165555),(.D0,13567506163490535),(.D0,2494336881057967),(.D0,59762437101078),(.D0,323799516473075),(.D0,7535628527785),(.D0,2461834176070),(.D2,12951960459),(.D1,824133986),(.D0,165495730),(.D4,41712520),(.D5,9922240),(.D4,477206),(.D2,128302),(.D3,2687),(.D4,26)] +] +theorem chunk_20_ok : q6 cmds_20 cfg_20=some cfg_21:= by decide +kernel +def cmds_21 : List Cmd:=[ + .scan 0 50, + .scan2 5 9 [(5768519355599781892,4),(327824879050489010,4),(1568295479115420465,4),(21594293168954344,4),(739226421390733018,4),(793293023825066099,4),(601208768356893219,4),(136602735169448050,4),(13567478313870950,4),(2494332239454702,4),(59761663500533,4),(323799387539650,4),(7535607038880,4),(2461830594585,4),(12951363545,4),(824034499,4),(165479148,4),(41709757,4),(9921779,4),(477129,4),(128289,4),(2684,4)], + .scan 5 26, + .scan 0 10, + .scan2 3 0 [(26,20),(2684,20),(128289,20),(477129,20),(9921779,20),(41709757,20),(165479148,20),(824034499,20),(12951363545,20),(2461830594585,20),(7535607038880,20),(323799387539650,20),(59761663500533,20),(2494332239454702,20),(13567478313870950,20),(136602735169448050,20),(601208768356893219,20),(793293023825066099,20),(739226421390733018,20),(21594293168954344,20),(1568295479115420465,20),(327824879050489010,20)], + .scan 3 5768519355599781887, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [789730223053602813] 1 [(.D2,5768519355599781893),(.D0,327824879050489011),(.D0,1568295479115420466),(.D0,21594293168954345),(.D0,739226421390733019),(.D0,793293023825066100),(.D0,601208768356893220),(.D0,136602735169448051),(.D0,13567478313870951),(.D0,2494332239454703),(.D0,59761663500534),(.D0,323799387539651),(.D0,7535607038881),(.D0,2461830594586),(.D0,12951363546),(.D0,824034500),(.D0,165479149),(.D0,41709758),(.D0,9921780),(.D0,477130),(.D0,128290),(.D0,2685),(.D0,26)], + .scan 0 50, + .scan2 5 9 [(394865111526801406,4),(5571086799836381189,4),(294919453089922226,4),(1562811241455326001,4),(20680253558938600,4),(739074081455730394,4),(793267633835898995,4),(601204536692032035,4),(136602029891971186,4),(13567360767624806,4),(2494312648413678,4),(59758398327029,4),(323798843344066,4),(7535516339616,4),(2461815478041,4),(12948844121,4),(823614595,4),(165409164,4),(41698093,4),(9919835,4),(476805,4),(128235,4),(2675,4)], + .scan 5 24, + .scan 0 10, + .scan2 3 0 [(24,20),(2675,20),(128235,20),(476805,20),(9919835,20),(41698093,20),(165409164,20),(823614595,20),(12948844121,20),(2461815478041,20),(7535516339616,20),(323798843344066,20),(59758398327029,20),(2494312648413678,20),(13567360767624806,20),(136602029891971186,20),(601204536692032035,20),(793267633835898995,20),(739074081455730394,20),(20680253558938600,20),(1562811241455326001,20),(294919453089922226,20),(5571086799836381189,20)], + .scan 3 394865111526801401, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1184595334580404223,296148833645101056,74037208411275264,18509302102818816,4627325525704704,1156831381426176,289207845356544,72301961339136,18075490334784,4518872583696,1129718145924,282429536480,70607384118,17651846032,4412961506,1103240376,275810094,68952526,17238132,4309532,1077382,269346,67338,16832,4210,1052,262,66,18,2,2,2] 1 [(.D2,394865111526801407),(.D0,5571086799836381190),(.D0,294919453089922227),(.D0,1562811241455326002),(.D0,20680253558938601),(.D0,739074081455730395),(.D0,793267633835898996),(.D0,601204536692032036),(.D0,136602029891971187),(.D0,13567360767624807),(.D0,2494312648413679),(.D0,59758398327030),(.D0,323798843344067),(.D0,7535516339617),(.D0,2461815478042),(.D0,12948844122),(.D0,823614596),(.D0,165409165),(.D0,41698094),(.D0,9919836),(.D0,476806),(.D0,128236),(.D0,2676),(.D0,24)], + .batch [2] 789730223053602816 [(.D1,1)], + .batch [526486815369068544] 789730223053602817 [(.D5,5505275947915247620),(.D5,283950977769733298),(.D5,1560983162235294513),(.D5,20375573688933352),(.D5,739023301477396186),(.D5,793259170506176627),(.D5,601203126137078307),(.D5,136601794799478898),(.D5,13567321585542758),(.D5,2494306118066670),(.D5,59757309935861),(.D5,323798661945538),(.D5,7535486106528),(.D5,2461810439193),(.D5,12948004313),(.D5,823474627),(.D5,165385836),(.D5,41694205),(.D5,9919187),(.D5,476697),(.D5,128217),(.D5,2672),(.D1,24)], + .scan 0 50, + .scan2 5 9 [(1052973630738137088,4),(5373654244072980484,4),(262014027129355442,4),(1557327003795231537,4),(19766213948922856,4),(738921741520727770,4),(793242243846731891,4),(601200305027170851,4),(136601324614494322,4),(13567243221378662,4),(2494293057372654,4),(59755133153525,4),(323798299148482,4),(7535425640352,4),(2461800361497,4),(12946324697,4),(823194691,4),(165339180,4),(41686429,4),(9917891,4),(476481,4),(128181,4),(2666,4)], + .scan 5 22, + .scan 0 10, + .scan2 3 0 [(22,20),(2666,20),(128181,20),(476481,20),(9917891,20),(41686429,20),(165339180,20),(823194691,20),(12946324697,20),(2461800361497,20),(7535425640352,20),(323798299148482,20),(59755133153525,20),(2494293057372654,20),(13567243221378662,20),(136601324614494322,20),(601200305027170851,20),(793242243846731891,20),(738921741520727770,20),(19766213948922856,20),(1557327003795231537,20),(262014027129355442,20),(5373654244072980484,20)], + .scan 3 1052973630738137083, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [3158920892214411269,789730223053602816,197432555763400704,49358138940850176,12339534735212544,3084883683803136,771220920950784,192805230237696,48201307559424,12050326889856,3012581722464,753145430616,188286357654,47071589414,11767897354,2941974338,735493584,183873396,45968350,11492088,2873022,718254,179564,44890,11222,2806,702,176,42,12,4,87747802561511420] 1 [(.D2,1052973630738137089),(.D0,5373654244072980485),(.D0,262014027129355443),(.D0,1557327003795231538),(.D0,19766213948922857),(.D0,738921741520727771),(.D0,793242243846731892),(.D0,601200305027170852),(.D0,136601324614494323),(.D0,13567243221378663),(.D0,2494293057372655),(.D0,59755133153526),(.D0,323798299148483),(.D0,7535425640353),(.D0,2461800361498),(.D0,12946324698),(.D0,823194692),(.D0,165339181),(.D0,41686430),(.D0,9917892),(.D0,476482),(.D0,128182),(.D0,2667),(.D0,22)], + .scan 0 50, + .scan2 5 9 [(2149821162757029888,4),(5176221688309579781,4),(229108601168788658,4),(1551842766135137073,4),(18852174338907112,4),(738769401585725146,4),(793216853857564787,4),(601196073362309667,4),(136600619337017458,4),(13567125675132518,4),(2494273466331630,4),(59751867980021,4),(323797754952898,4),(7535334941088,4),(2461785244953,4),(12943805273,4),(822774787,4),(165269196,4),(41674765,4),(9915947,4),(476157,4),(128127,4),(2657,4)], + .scan 5 20, + .scan 0 10, + .scan2 3 0 [(20,20),(2657,20),(128127,20),(476157,20),(9915947,20),(41674765,20),(165269196,20),(822774787,20),(12943805273,20),(2461785244953,20),(7535334941088,20),(323797754952898,20),(59751867980021,20),(2494273466331630,20),(13567125675132518,20),(136600619337017458,20),(601196073362309667,20),(793216853857564787,20),(738769401585725146,20),(18852174338907112,20),(1551842766135137073,20),(229108601168788658,20),(5176221688309579781,20)], + .scan 3 2149821162757029883, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [4738381338321616893] 1 [(.D2,2149821162757029889),(.D0,5176221688309579782),(.D0,229108601168788659),(.D0,1551842766135137074),(.D0,18852174338907113),(.D0,738769401585725147),(.D0,793216853857564788),(.D0,601196073362309668),(.D0,136600619337017459),(.D0,13567125675132519),(.D0,2494273466331631),(.D0,59751867980022),(.D0,323797754952899),(.D0,7535334941089),(.D0,2461785244954),(.D0,12943805274),(.D0,822774788),(.D0,165269197),(.D0,41674766),(.D0,9915948),(.D0,476158),(.D0,128128),(.D0,2658),(.D0,20)], + .scan 0 50, + .scan2 5 9 [(2369190669160808446,4),(965225828176625665,4),(4978789132546179077,4),(196203175208221874,4),(1546358528475042609,4),(17938134728891368,4),(738617061650722522,4),(793191463868397683,4),(601191841697448483,4),(136599914059540594,4),(13567008128886374,4),(2494253875290606,4),(59748602806517,4),(323797210757314,4),(7535244241824,4),(2461770128409,4),(12941285849,4),(822354883,4),(165199212,4),(41663101,4),(9914003,4),(475833,4),(128073,4),(2648,4)], + .scan 5 18, + .scan 0 10, + .scan2 3 0 [(18,20),(2648,20),(128073,20),(475833,20),(9914003,20),(41663101,20),(165199212,20),(822354883,20),(12941285849,20),(2461770128409,20),(7535244241824,20),(323797210757314,20),(59748602806517,20),(2494253875290606,20),(13567008128886374,20),(136599914059540594,20),(601191841697448483,20),(793191463868397683,20),(738617061650722522,20),(17938134728891368,20),(1546358528475042609,20),(196203175208221874,20),(4978789132546179077,20),(965225828176625665,20)], + .scan 3 2369190669160808441, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [7107572007482425343,1776893001870606336,444223250467651584,111055812616912896,27763953154228224,6940988288557056,1735247072139264,433811768034816,108452942008704,27113235502176,6778308875544,1694577218886,423644304720,105911076180,26477769044,6619442262,1654860564,413715142,103428786,25857198,6464298,1616076,404018,101004,25252,6312,1578,396,98,24,6,2,2] 1 [(.D2,2369190669160808447),(.D0,965225828176625666),(.D0,4978789132546179078),(.D0,196203175208221875),(.D0,1546358528475042610),(.D0,17938134728891369),(.D0,738617061650722523),(.D0,793191463868397684),(.D0,601191841697448484),(.D0,136599914059540595),(.D0,13567008128886375),(.D0,2494253875290607),(.D0,59748602806518),(.D0,323797210757315),(.D0,7535244241825),(.D0,2461770128410),(.D0,12941285850),(.D0,822354884),(.D0,165199213),(.D0,41663102),(.D0,9914004),(.D0,475834),(.D0,128074),(.D0,2649),(.D0,18)], + .batch [2] 4738381338321616896 [(.D1,1)], + .batch [1711082149949472770,427770537487368194,106942634371842048,26735658592960512,6683914648240128,1670978662060032,417744665515008,104436166378752,26109041594688,6527260398672,1631815099668,407953774918,101988443730,25497110930,6374277732,1593569434,398392358,99598090,24899522,6224880,1556220,389056,97266,24314,6078,1522,380,94,24,6,2] 4738381338321616897 [(.D5,570360716649824256),(.D5,4912978280625045509),(.D5,185234699888032946),(.D5,1544530449255011121),(.D5,17633454858886120),(.D5,738566281672388314),(.D5,793183000538675315),(.D5,601190431142494755),(.D5,136599678967048306),(.D5,13566968946804326),(.D5,2494247344943598),(.D5,59747514415349),(.D5,323797029358786),(.D5,7535214008736),(.D5,2461765089561),(.D5,12940446041),(.D5,822214915),(.D5,165175884),(.D5,41659213),(.D5,9913355),(.D5,475725),(.D5,128055),(.D5,2645),(.D1,18)], + .batch [2] 5879102771621265411 [(.D1,1)], + .batch [146246337602519038] 5879102771621265412 [(.D1,4817918161183408134),(.D0,169391346647760051),(.D0,1541889890381632306),(.D0,17193361713322985),(.D0,738492932814794459),(.D0,793170775729076340),(.D0,601188393674228260),(.D0,136599339389003891),(.D0,13566912350463591),(.D0,2494237912220143),(.D0,59745942294774),(.D0,323796767338691),(.D0,7535170338721),(.D0,2461757811226),(.D0,12939232986),(.D0,822012740),(.D0,165142189),(.D0,41653598),(.D0,9912420),(.D0,475570),(.D2,128029),(.D5,2641),(.D4,16)], + .scan 0 50, + .scan2 5 9 [(5952225940422524930,4),(4781356576782778373,4),(163297749247655090,4),(1540874290814948145,4),(17024095118875624,4),(738464721715719898,4),(793166073879230579,4),(601187610032587299,4),(136599208782063730,4),(13566890582640230,4),(2494234284249582,4),(59745337633013,4),(323796666561730,4),(7535153542560,4),(2461755011865,4),(12938766425,4),(821934979,4),(165129228,4),(41651437,4),(9912059,4),(475509,4),(128019,4),(2639,4)], + .scan 5 16, + .scan 0 10, + .scan2 3 0 [(16,20),(2639,20),(128019,20),(475509,20),(9912059,20),(41651437,20),(165129228,20),(821934979,20),(12938766425,20),(2461755011865,20),(7535153542560,20),(323796666561730,20),(59745337633013,20),(2494234284249582,20),(13566890582640230,20),(136599208782063730,20),(601187610032587299,20),(793166073879230579,20),(738464721715719898,20),(17024095118875624,20),(1540874290814948145,20),(163297749247655090,20),(4781356576782778373,20)], + .scan 3 5952225940422524925, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [4738381338321616893] 1 [(.D2,5952225940422524931),(.D0,4781356576782778374),(.D0,163297749247655091),(.D0,1540874290814948146),(.D0,17024095118875625),(.D0,738464721715719899),(.D0,793166073879230580),(.D0,601187610032587300),(.D0,136599208782063731),(.D0,13566890582640231),(.D0,2494234284249583),(.D0,59745337633014),(.D0,323796666561731),(.D0,7535153542561),(.D0,2461755011866),(.D0,12938766426),(.D0,821934980),(.D0,165129229),(.D0,41651438),(.D0,9912060),(.D0,475510),(.D0,128020),(.D0,2640),(.D0,16)], + .scan 0 50, + .scan2 5 9 [(2369190669160808446,4),(4767630605842120707,4),(4583924021019377669,4),(130392323287088306,4),(1535390053154853681,4),(16110055508859880,4),(738312381780717274,4),(793140683890063475,4),(601183378367726115,4),(136598503504586866,4),(13566773036394086,4),(2494214693208558,4),(59742072459509,4),(323796122366146,4),(7535062843296,4),(2461739895321,4),(12936247001,4),(821515075,4),(165059244,4),(41639773,4),(9910115,4),(475185,4),(127965,4),(2630,4)], + .scan 5 14, + .scan 0 10, + .scan2 3 0 [(14,20),(2630,20),(127965,20),(475185,20),(9910115,20),(41639773,20),(165059244,20),(821515075,20),(12936247001,20),(2461739895321,20),(7535062843296,20),(323796122366146,20),(59742072459509,20),(2494214693208558,20),(13566773036394086,20),(136598503504586866,20),(601183378367726115,20),(793140683890063475,20),(738312381780717274,20),(16110055508859880,20),(1535390053154853681,20),(130392323287088306,20),(4583924021019377669,20),(4767630605842120707,20)], + .scan 3 2369190669160808441, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [7107572007482425343,1776893001870606336,444223250467651584,111055812616912896,27763953154228224,6940988288557056,1735247072139264,433811768034816,108452942008704,27113235502176,6778308875544,1694577218886,423644304720,105911076180,26477769044,6619442262,1654860564,413715142,103428786,25857198,6464298,1616076,404018,101004,25252,6312,1578,396,98,24,6,2,2] 1 [(.D2,2369190669160808447),(.D0,4767630605842120708),(.D0,4583924021019377670),(.D0,130392323287088307),(.D0,1535390053154853682),(.D0,16110055508859881),(.D0,738312381780717275),(.D0,793140683890063476),(.D0,601183378367726116),(.D0,136598503504586867),(.D0,13566773036394087),(.D0,2494214693208559),(.D0,59742072459510),(.D0,323796122366147),(.D0,7535062843297),(.D0,2461739895322),(.D0,12936247002),(.D0,821515076),(.D0,165059245),(.D0,41639774),(.D0,9910116),(.D0,475186),(.D0,127966),(.D0,2631),(.D0,14)], + .batch [2] 4738381338321616896 [(.D1,1)], + .batch [3158920892214411264] 4738381338321616897 [(.D5,4372765494315319298),(.D5,4518113169098244101),(.D5,119423847966899378),(.D5,1533561973934822193),(.D5,15805375638854632),(.D5,738261601802383066),(.D5,793132220560341107),(.D5,601181967812772387),(.D5,136598268412094578),(.D5,13566733854312038),(.D5,2494208162861550),(.D5,59740984068341),(.D5,323795940967618),(.D5,7535032610208),(.D5,2461734856473),(.D5,12935407193),(.D5,821375107),(.D5,165035916),(.D5,41635885),(.D5,9909467),(.D5,475077),(.D5,127947),(.D5,2627),(.D1,14)], + .scan 0 50, + .scan2 5 9 [(6317841784428822528,4),(3583035271261716482,4),(4386491465255976965,4),(97486897326521522,4),(1529905815494759217,4),(15196015898844136,4),(738160041845714650,4),(793115293900896371,4),(601179146702864931,4),(136597798227110002,4),(13566655490147942,4),(2494195102167534,4),(59738807286005,4),(323795578170562,4),(7534972144032,4),(2461724778777,4),(12933727577,4),(821095171,4),(164989260,4),(41628109,4),(9908171,4),(474861,4),(127911,4),(2621,4)], + .scan 5 12, + .scan 0 10, + .scan2 3 0 [(12,20),(2621,20),(127911,20),(474861,20),(9908171,20),(41628109,20),(164989260,20),(821095171,20),(12933727577,20),(2461724778777,20),(7534972144032,20),(323795578170562,20),(59738807286005,20),(2494195102167534,20),(13566655490147942,20),(136597798227110002,20),(601179146702864931,20),(793115293900896371,20),(738160041845714650,20),(15196015898844136,20),(1529905815494759217,20),(97486897326521522,20),(4386491465255976965,20),(3583035271261716482,20)], + .scan 3 6317841784428822523, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [18953525353286467589,4738381338321616896,1184595334580404224,296148833645101056,74037208411275264,18509302102818816,4627325525704704,1156831381426176,289207845356544,72301961339136,18075490334784,4518872583696,1129718145924,282429536480,70607384122,17651846030,4412961508,1103240376,275810094,68952524,17238130,4309532,1077384,269346,67336,16836,4208,1050,264,66,16,6,526486815369068540] 1 [(.D2,6317841784428822529),(.D0,3583035271261716483),(.D0,4386491465255976966),(.D0,97486897326521523),(.D0,1529905815494759218),(.D0,15196015898844137),(.D0,738160041845714651),(.D0,793115293900896372),(.D0,601179146702864932),(.D0,136597798227110003),(.D0,13566655490147943),(.D0,2494195102167535),(.D0,59738807286006),(.D0,323795578170563),(.D0,7534972144033),(.D0,2461724778778),(.D0,12933727578),(.D0,821095172),(.D0,164989261),(.D0,41628110),(.D0,9908172),(.D0,474862),(.D0,127912),(.D0,2622),(.D0,12)], + .scan 0 50, + .scan2 5 9 [(12898926976542179328,4),(2398439936681312259,4),(4189058909492576261,4),(64581471365954738,4),(1524421577834664753,4),(14281976288828392,4),(738007701910712026,4),(793089903911729267,4),(601174915038003747,4),(136597092949633138,4),(13566537943901798,4),(2494175511126510,4),(59735542112501,4),(323795033974978,4),(7534881444768,4),(2461709662233,4),(12931208153,4),(820675267,4),(164919276,4),(41616445,4),(9906227,4),(474537,4),(127857,4),(2612,4)], + .scan 5 10, + .scan 0 10, + .scan2 3 0 [(10,20),(2612,20),(127857,20),(474537,20),(9906227,20),(41616445,20),(164919276,20),(820675267,20),(12931208153,20),(2461709662233,20),(7534881444768,20),(323795033974978,20),(59735542112501,20),(2494175511126510,20),(13566537943901798,20),(136597092949633138,20),(601174915038003747,20),(793089903911729267,20),(738007701910712026,20),(14281976288828392,20),(1524421577834664753,20),(64581471365954738,20),(4189058909492576261,20),(2398439936681312259,20)], + .scan 3 12898926976542179323, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [28430288029929701373] 1 [(.D2,12898926976542179329),(.D0,2398439936681312260),(.D0,4189058909492576262),(.D0,64581471365954739),(.D0,1524421577834664754),(.D0,14281976288828393),(.D0,738007701910712027),(.D0,793089903911729268),(.D0,601174915038003748),(.D0,136597092949633139),(.D0,13566537943901799),(.D0,2494175511126511),(.D0,59735542112502),(.D0,323795033974979),(.D0,7534881444769),(.D0,2461709662234),(.D0,12931208154),(.D0,820675268),(.D0,164919277),(.D0,41616446),(.D0,9906228),(.D0,474538),(.D0,127858),(.D0,2613),(.D0,10)], + .scan 0 50, + .scan2 5 9 [(14215144014964850686,4),(5791354969059753985,4),(1213844602100908035,4),(3991626353729175557,4),(31676045405387954,4),(1518937340174570289,4),(13367936678812648,4),(737855361975709402,4),(793064513922562163,4),(601170683373142563,4),(136596387672156274,4),(13566420397655654,4),(2494155920085486,4),(59732276938997,4),(323794489779394,4),(7534790745504,4),(2461694545689,4),(12928688729,4),(820255363,4),(164849292,4),(41604781,4),(9904283,4),(474213,4),(127803,4),(2603,4)], + .scan 5 8, + .scan 0 10, + .scan2 3 0 [(8,20),(2603,20),(127803,20),(474213,20),(9904283,20),(41604781,20),(164849292,20),(820255363,20),(12928688729,20),(2461694545689,20),(7534790745504,20),(323794489779394,20),(59732276938997,20),(2494155920085486,20),(13566420397655654,20),(136596387672156274,20),(601170683373142563,20),(793064513922562163,20),(737855361975709402,20),(13367936678812648,20),(1518937340174570289,20),(31676045405387954,20),(3991626353729175557,20),(1213844602100908035,20),(5791354969059753985,20)], + .scan 3 14215144014964850681, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [42645432044894552063,10661358011223638016,2665339502805909504,666334875701477376,166583718925369344,41645929731342336,10411482432835584,2602870608208896,650717652052224,162679413013056,40669853253264,10167463313316,2541865828328,635466457080,158866614270,39716653570,9929163392,2482290846,620572714,155143178,38785794,9696448,2424114,606026,151506,37878,9468,2368,594,146,36,10,2,2,2] 1 [(.D2,14215144014964850687),(.D0,5791354969059753986),(.D0,1213844602100908036),(.D0,3991626353729175558),(.D0,31676045405387955),(.D0,1518937340174570290),(.D0,13367936678812649),(.D0,737855361975709403),(.D0,793064513922562164),(.D0,601170683373142564),(.D0,136596387672156275),(.D0,13566420397655655),(.D0,2494155920085487),(.D0,59732276938998),(.D0,323794489779395),(.D0,7534790745505),(.D0,2461694545690),(.D0,12928688730),(.D0,820255364),(.D0,164849293),(.D0,41604782),(.D0,9904284),(.D0,474214),(.D0,127804),(.D0,2604),(.D0,8)], + .batch [2] 28430288029929701376 [(.D1,1)], + .batch [10266492899696836610,2566623224924209154,641655806231052288,160413951557763072,40103487889440768,10025871972360192,2506467993090048,626616998272512,156654249568128,39163562392032,9790890598008,2447722649502,611930662374,152982665596,38245666398,9561416600,2390354148,597588538,149397134,37349284,9337322,2334330,583582,145896,36474,9120,2280,570,140,36,10,2] 28430288029929701377 [(.D5,3422164299898945536),(.D5,818979490574106627),(.D5,3925815501808041989),(.D5,20707570085199026),(.D5,1517109260954538801),(.D5,13063256808807400),(.D5,737804581997375194),(.D5,793056050592839795),(.D5,601169272818188835),(.D5,136596152579663986),(.D5,13566381215573606),(.D5,2494149389738478),(.D5,59731188547829),(.D5,323794308380866),(.D5,7534760512416),(.D5,2461689506841),(.D5,12927848921),(.D5,820115395),(.D5,164825964),(.D5,41600893),(.D5,9903635),(.D5,474105),(.D5,127785),(.D5,2600),(.D1,8)], + .batch [2] 35274616629727592451 [(.D1,1)], + .batch [525335419252022182,131333854813005456,32833463703251400,8208365925812832,2052091481453280,513022870363248,128255717590848,32063929397712,8015982349464,2003995587384,500998896792,125249724216,31312431072,7828107696,1957026960,489256776,122314176,30578472,7644672,1911168,477792,119448,29808,7488,1944,432,72,72,72] 35274616629727592452 [(.D1,248618773924282372),(.D0,3830755382366404614),(.D0,4864216844926131),(.D0,1514468702081159986),(.D0,12623163663244265),(.D0,737731233139781339),(.D0,793043825783240820),(.D0,601167235349922340),(.D0,136595813001619571),(.D0,13566324619232871),(.D0,2494139957015023),(.D0,59729616427254),(.D0,323794046360771),(.D0,7534716842401),(.D0,2461682228506),(.D0,12926635866),(.D0,819913220),(.D0,164792269),(.D0,41595278),(.D0,9902700),(.D0,473950),(.D2,127759),(.D5,2596),(.D4,6)], + .batch [29505133324291968] 35624840242562273919 [(.D5,73506967506941637),(.D5,3801570081296847824),(.D1,1513657999273672297),(.D1,12488046528662984),(.D4,737708713617351124),(.D3,793040072529502451),(.D0,601166609807632612),(.D4,136595708744571282),(.D2,13566307243058156),(.D2,2494137060985903),(.D1,59729133755734),(.D5,323793965915517),(.D2,7534703434858),(.D5,2461679993915),(.D4,12926263433),(.D1,819851148),(.D5,164781923),(.D2,41593553),(.D3,9902412),(.D5,473901),(.D3,127752),(.D4,2594),(.D5,6)], + .scan 0 50, + .scan2 5 9 [(35639592809224419902,4),(66130684175868645,4),(3800340700741668992,4),(1513453102514475824,4),(12453897068796904,4),(737703022040706778,4),(793039123933395059,4),(601166451708281379,4),(136595682394679410,4),(13566302851409510,4),(2494136329044462,4),(59729011765493,4),(323793945583810,4),(7534700046240,4),(2461679429145,4),(12926169305,4),(819835459,4),(164779308,4),(41593117,4),(9902339,4),(473889,4),(127749,4),(2594,4)], + .scan 5 6, + .scan 0 10, + .scan2 3 0 [(6,20),(2594,20),(127749,20),(473889,20),(9902339,20),(41593117,20),(164779308,20),(819835459,20),(12926169305,20),(2461679429145,20),(7534700046240,20),(323793945583810,20),(59729011765493,20),(2494136329044462,20),(13566302851409510,20),(136595682394679410,20),(601166451708281379,20),(793039123933395059,20),(737703022040706778,20),(12453897068796904,20),(1513453102514475824,20),(3800340700741668992,20),(66130684175868645,20)], + .scan 3 35639592809224419897, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [1190352315165635637,297588078791408892,74397019697852220,18599254924463064,4649813731115772,1162453432778940,290613358194732,72653339548680,18163334887176,4540833721788,1135208430444,283802107608,70950526908,17737631724,4434407928,1108601988,277150500,69287628,17321904,4330476,1082616,270660,67668,16920,4224,1044,276,72,12] 1 [(.D2,35639592809224419903),(.D0,66130684175868646),(.D0,3800340700741668993),(.D0,1513453102514475825),(.D0,12453897068796905),(.D0,737703022040706779),(.D0,793039123933395060),(.D0,601166451708281380),(.D0,136595682394679411),(.D0,13566302851409511),(.D0,2494136329044463),(.D0,59729011765494),(.D0,323793945583811),(.D0,7534700046241),(.D0,2461679429146),(.D0,12926169306),(.D0,819835460),(.D0,164779309),(.D0,41593118),(.D0,9902340),(.D0,473890),(.D0,127750),(.D0,2595),(.D0,6)], + .batch [525207486350128236] 793568210110423751 [(.D5,35242808704169208027),(.D1,3789318920045690886),(.D0,1511616139065146140),(.D3,12147736493908624),(.D2,737651995278225398),(.D5,793030619472981496),(.D2,601165034298212452),(.D3,136595446159667923),(.D4,13566263478907595),(.D5,2494129766960810),(.D4,59727918084884),(.D3,323793763303709),(.D3,7534669666224),(.D2,2461674365809),(.D5,12925325416),(.D2,819694811),(.D3,164755867),(.D3,41589211),(.D0,9901689),(.D2,473781),(.D0,127732),(.D0,2592),(.D2,5)], + .scan 0 50, + .scan2 5 9 [(1056171953285487868,4),(35111506832581675968,4),(3767435274781102208,4),(1507968864854381360,4),(11539857458781160,4),(737550682105704154,4),(793013733944227955,4),(601162220043420195,4),(136594977117202546,4),(13566185305163366,4),(2494116738003438,4),(59725746591989,4),(323793401388226,4),(7534609346976,4),(2461664312601,4),(12923649881,4),(819415555,4),(164709324,4),(41581453,4),(9900395,4),(473565,4),(127695,4),(2585,4)], + .scan 5 4, + .scan 0 10, + .scan2 3 0 [(4,20),(2585,20),(127695,20),(473565,20),(9900395,20),(41581453,20),(164709324,20),(819415555,20),(12923649881,20),(2461664312601,20),(7534609346976,20),(323793401388226,20),(59725746591989,20),(2494116738003438,20),(13566185305163366,20),(136594977117202546,20),(601162220043420195,20),(793013733944227955,20),(737550682105704154,20),(11539857458781160,20),(1507968864854381360,20),(3767435274781102208,20),(35111506832581675968,20)], + .scan 3 1056171953285487863, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [3168515859856463609,792128964964115900,198032241241028976,49508060310257244,12377015077564312,3094253769391076,773563442347770,193390860586942,48347715146736,12086928786684,3021732196670,755433049168,188858262294,47214565572,11803641392,2950910350,737727588,184431896,46107972,11526994,2881748,720438,180108,45028,11258,2814,702,178,44,10,2,2,2] 1 [(.D2,1056171953285487869),(.D0,35111506832581675969),(.D0,3767435274781102209),(.D0,1507968864854381361),(.D0,11539857458781161),(.D0,737550682105704155),(.D0,793013733944227956),(.D0,601162220043420196),(.D0,136594977117202547),(.D0,13566185305163367),(.D0,2494116738003439),(.D0,59725746591990),(.D0,323793401388227),(.D0,7534609346977),(.D0,2461664312602),(.D0,12923649882),(.D0,819415556),(.D0,164709325),(.D0,41581454),(.D0,9900396),(.D0,473566),(.D0,127696),(.D0,2586),(.D0,4)], + .batch [85615587529944238] 2112343906570975740 [(.D1,34935478173700761324),(.D4,3738097164967616434),(.D0,1503079179885467065),(.D1,10724909963962112),(.D0,737414857523234313),(.D5,792991096513816315),(.D4,601158447138351588),(.D3,136594348299691112),(.D3,13566080502244794),(.D1,2494099270850344),(.D2,59722835399807),(.D0,323792916189530),(.D2,7534528480527),(.D0,2461650834860),(.D5,12921403591),(.D4,819041173),(.D5,164646927),(.D5,41571054),(.D2,9898662),(.D3,473277),(.D0,127648),(.D2,2577),(.D5,2)], + .scan 0 50, + .scan2 5 9 [(2155151700335947858,4),(34914074276818275263,4),(3734529848820535424,4),(1502484627194286896,4),(10625817848765416,4),(737398342170701530,4),(792988343955060851,4),(601157988378559011,4),(136594271839725682,4),(13566067758917222,4),(2494097146962414,4),(59722481418485,4),(323792857192642,4),(7534518647712,4),(2461649196057,4),(12921130457,4),(818995651,4),(164639340,4),(41569789,4),(9898451,4),(473241,4),(127641,4),(2576,4)], + .scan 0 166, + .scan 7 4, + .scan2 3 0 [(2576,20),(127641,20),(473241,20),(9898451,20),(41569789,20),(164639340,20),(818995651,20),(12921130457,20),(2461649196057,20),(7534518647712,20),(323792857192642,20),(59722481418485,20),(2494097146962414,20),(13566067758917222,20),(136594271839725682,20),(601157988378559011,20),(792988343955060851,20),(737398342170701530,20),(10625817848765416,20),(1502484627194286896,20),(3734529848820535424,20),(34914074276818275263,20)], + .scan 3 2155151700335947853, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [4738381338321616893] 1 [(.D2,2155151700335947859),(.D0,34914074276818275264),(.D0,3734529848820535425),(.D0,1502484627194286897),(.D0,10625817848765417),(.D0,737398342170701531),(.D0,792988343955060852),(.D0,601157988378559012),(.D0,136594271839725683),(.D0,13566067758917223),(.D0,2494097146962415),(.D0,59722481418486),(.D0,323792857192643),(.D0,7534518647713),(.D0,2461649196058),(.D0,12921130458),(.D0,818995652),(.D0,164639341),(.D0,41569790),(.D0,9898452),(.D0,473242),(.D0,127642),(.D0,2577),(.D0,2)], + .scan 0 50, + .scan2 5 9 [(2369190669160808446,4),(970556365755543635,4),(34716641721054874559,4),(3701624422859968640,4),(1497000389534192432,4),(9711778238749672,4),(737246002235698906,4),(792962953965893747,4),(601153756713697827,4),(136593566562248818,4),(13565950212671078,4),(2494077555921390,4),(59719216244981,4),(323792312997058,4),(7534427948448,4),(2461634079513,4),(12918611033,4),(818575747,4),(164569356,4),(41558125,4),(9896507,4),(472917,4),(127587,4),(2567,4)], + .scan 7 3, + .scan2 3 0 [(2567,20),(127587,20),(472917,20),(9896507,20),(41558125,20),(164569356,20),(818575747,20),(12918611033,20),(2461634079513,20),(7534427948448,20),(323792312997058,20),(59719216244981,20),(2494077555921390,20),(13565950212671078,20),(136593566562248818,20),(601153756713697827,20),(792962953965893747,20),(737246002235698906,20),(9711778238749672,20),(1497000389534192432,20),(3701624422859968640,20),(34716641721054874559,20),(970556365755543635,20)], + .scan 3 2369190669160808441, + .scan 0 339, + .batch [1] 0 [(.D0,0)], + .batch [7107572007482425343,1776893001870606336,444223250467651584,111055812616912896,27763953154228224,6940988288557056,1735247072139264,433811768034816,108452942008704,27113235502176,6778308875544,1694577218886,423644304720,105911076180,26477769044,6619442262,1654860564,413715142,103428786,25857198,6464298,1616076,404018,101004,25252,6312,1578,396,98,24,6,2,2] 1 [(.D2,2369190669160808447),(.D0,970556365755543636),(.D0,34716641721054874560),(.D0,3701624422859968641),(.D0,1497000389534192433),(.D0,9711778238749673),(.D0,737246002235698907),(.D0,792962953965893748),(.D0,601153756713697828),(.D0,136593566562248819),(.D0,13565950212671079),(.D0,2494077555921391),(.D0,59719216244982),(.D0,323792312997059),(.D0,7534427948449),(.D0,2461634079514),(.D0,12918611034),(.D0,818575748),(.D0,164569357),(.D0,41558126),(.D0,9896508),(.D0,472918),(.D0,127588),(.D0,2568),(.D0,0)], + .batch [2] 4738381338321616896 [(.D1,1)], + .scan 0 50, + .scan2 5 9 [(4738381338321616896,4),(575691254228742226,4),(34650830869133740991,4),(3690655947539779712,4),(1495172310314160944,4),(9407098368744424,4),(737195222257364698,4),(792954490636171379,4),(601152346158744099,4),(136593331469756530,4),(13565911030589030,4),(2494071025574382,4),(59718127853813,4),(323792131598530,4),(7534397715360,4),(2461629040665,4),(12917771225,4),(818435779,4),(164546028,4),(41554237,4),(9895859,4),(472809,4),(127569,4)], + .scan 5 2564, + .scan 0 62 +] +theorem chunk_21_ok : q6 cmds_21 cfg_21=some cfg_22:= by decide +kernel +theorem halted_final : isHalted qc cfg_22=true:= by decide +kernel +theorem init_eq_cfg_0 : cfg_0.denote=init []:=rfl +theorem tm104_halt : IsHalt qc:= by + refine ⟨cfg_22.denote,?_,isHalted_spec halted_final⟩ + rw [← init_eq_cfg_0] + refine q0 (q1 chunk_0_ok) ?_ + refine q0 (q1 chunk_1_ok) ?_ + refine q0 (q1 chunk_2_ok) ?_ + refine q0 (q1 chunk_3_ok) ?_ + refine q0 (q1 chunk_4_ok) ?_ + refine q0 (q1 chunk_5_ok) ?_ + refine q0 (q1 chunk_6_ok) ?_ + refine q0 (q1 chunk_7_ok) ?_ + refine q0 (q1 chunk_8_ok) ?_ + refine q0 (q1 chunk_9_ok) ?_ + refine q0 (q1 chunk_10_ok) ?_ + refine q0 (q1 chunk_11_ok) ?_ + refine q0 (q1 chunk_12_ok) ?_ + refine q0 (q1 chunk_13_ok) ?_ + refine q0 (q1 chunk_14_ok) ?_ + refine q0 (q1 chunk_15_ok) ?_ + refine q0 (q1 chunk_16_ok) ?_ + refine q0 (q1 chunk_17_ok) ?_ + refine q0 (q1 chunk_18_ok) ?_ + refine q0 (q1 chunk_19_ok) ?_ + refine q0 (q1 chunk_20_ok) ?_ + refine q0 (q1 chunk_21_ok) ?_ + exact ⟨0,rfl⟩ +theorem holdout_0491_halt : + IsHalt holdout_0491_tm := + qW tm104_halt + +public section + +theorem is_halt : IsHalt target := holdout_0491_halt + +end + +end BusyBeaver.M_1RB0LD_1LC0RD_1RE0RA_1LE0RF_1LA1RC_0LBHHH diff --git a/BusyBeaver/BB6/Halt/M_1RB0LD_1RC0RF_1LC1LA_0LEHHH_1LF0RB_0RC0RE.lean b/BusyBeaver/BB6/Halt/M_1RB0LD_1RC0RF_1LC1LA_0LEHHH_1LF0RB_0RC0RE.lean new file mode 100644 index 00000000..2937a176 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB0LD_1RC0RF_1LC1LA_0LEHHH_1LF0RB_0RC0RE.lean @@ -0,0 +1,685 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0LD_1RC0RF_1LC1LA_0LEHHH_1LF0RB_0RC0RE + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LD_1RC0RF_1LC1LA_0LEHHH_1LF0RB_0RC0RE" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + +abbrev b0 : Fin 2 := 0 +abbrev b1 : Fin 2 := 1 + +inductive ReachHalt : Cfg (Fin 2) (Fin 6) → Prop + | done {c} : (step target_tm c).isNone → ReachHalt c + | next {c c'} : step target_tm c = some c' → ReachHalt c' → ReachHalt c + +def Reaches (c c' : Cfg (Fin 2) (Fin 6)) : Prop := + ReachHalt c' → ReachHalt c + +theorem Reaches.refl (c : Cfg (Fin 2) (Fin 6)) : Reaches c c := id + +theorem Reaches.trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} (h₁ : Reaches c₁ c₂) (h₂ : Reaches c₂ c₃) : + Reaches c₁ c₃ := + fun h => h₁ (h₂ h) + +theorem multiStep_succ_of_step {c c' : Cfg (Fin 2) (Fin 6)} (n : ℕ) + (h : step target_tm c = some c') : + multiStep target_tm c (n + 1) = multiStep target_tm c' n := by + unfold multiStep + rw [Function.iterate_succ_apply] + change (Option.bind · (step target_tm))^[n] (step target_tm c) = _ + rw [h] + +theorem ReachHalt.to_isHalt {c : Cfg (Fin 2) (Fin 6)} (h : ReachHalt c) : + ∃ cfg, (c [target_tm]⊢* cfg) ∧ (step target_tm cfg).isNone := by + induction h with + | done hnone => exact ⟨_, ⟨0, rfl⟩, hnone⟩ + | next hstep _ ih => + rcases ih with ⟨cfg, ⟨n, hn⟩, hnone⟩ + exact ⟨cfg, ⟨n + 1, by rw [multiStep_succ_of_step n hstep, hn]⟩, hnone⟩ + +@[reducible] def c0 (l : ListBlank (Fin 2)) : ListBlank (Fin 2) := ListBlank.cons b0 l +@[reducible] def c1 (l : ListBlank (Fin 2)) : ListBlank (Fin 2) := ListBlank.cons b1 l + +def cfg (q : Fin 6) (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some q, ⟨r.head, l, r.tail⟩⟩ + +@[simp] theorem zero_cons_default : ListBlank.cons b0 default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = b0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +theorem init_eq_cfg : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = cfg A default default := rfl + +theorem step_cfg_right {q q' : Fin 6} {b a : Fin 2} + (h : target_tm q b = some (some q', Stmt.write a Dir.right)) + (l r : ListBlank (Fin 2)) : + step target_tm (cfg q l (ListBlank.cons b r)) = some (cfg q' (ListBlank.cons a l) r) := by + simp [cfg, step, h, Turing.Tape.write, Turing.Tape.move] + +theorem step_cfg_left {q q' : Fin 6} {b a : Fin 2} + (h : target_tm q b = some (some q', Stmt.write a Dir.left)) + (c : Fin 2) (l r : ListBlank (Fin 2)) : + step target_tm (cfg q (ListBlank.cons c l) (ListBlank.cons b r)) = + some (cfg q' l (ListBlank.cons c (ListBlank.cons a r))) := by + simp [cfg, step, h, Turing.Tape.write, Turing.Tape.move] + +theorem step_cfg_right_nil {q q' : Fin 6} {a : Fin 2} + (h : target_tm q b0 = some (some q', Stmt.write a Dir.right)) + (l : ListBlank (Fin 2)) : + step target_tm (cfg q l default) = some (cfg q' (ListBlank.cons a l) default) := by + simpa using! step_cfg_right h l default + +theorem step_cfg_left_nil {q q' : Fin 6} {a : Fin 2} + (h : target_tm q b0 = some (some q', Stmt.write a Dir.left)) + (c : Fin 2) (l : ListBlank (Fin 2)) : + step target_tm (cfg q (ListBlank.cons c l) default) = + some (cfg q' l (ListBlank.cons c (ListBlank.cons a default))) := by + simpa using! step_cfg_left h c l default + +theorem step_cfg_left_lnil {q q' : Fin 6} {b a : Fin 2} + (h : target_tm q b = some (some q', Stmt.write a Dir.left)) + (r : ListBlank (Fin 2)) : + step target_tm (cfg q default (ListBlank.cons b r)) = + some (cfg q' default (ListBlank.cons b0 (ListBlank.cons a r))) := by + simpa using! step_cfg_left h b0 default r + +theorem reach_right {q q' : Fin 6} {b a : Fin 2} + (h : target_tm q b = some (some q', Stmt.write a Dir.right)) + {l r : ListBlank (Fin 2)} {target : Cfg (Fin 2) (Fin 6)} + (hr : Reaches (cfg q' (ListBlank.cons a l) r) target) : + Reaches (cfg q l (ListBlank.cons b r)) target := + fun ht => ReachHalt.next (step_cfg_right h l r) (hr ht) + +theorem reach_left {q q' : Fin 6} {b a : Fin 2} + (h : target_tm q b = some (some q', Stmt.write a Dir.left)) + {c : Fin 2} {l r : ListBlank (Fin 2)} {target : Cfg (Fin 2) (Fin 6)} + (hr : Reaches (cfg q' l (ListBlank.cons c (ListBlank.cons a r))) target) : + Reaches (cfg q (ListBlank.cons c l) (ListBlank.cons b r)) target := + fun ht => ReachHalt.next (step_cfg_left h c l r) (hr ht) + +theorem reach_right_nil {q q' : Fin 6} {a : Fin 2} + (h : target_tm q b0 = some (some q', Stmt.write a Dir.right)) + {l : ListBlank (Fin 2)} {target : Cfg (Fin 2) (Fin 6)} + (hr : Reaches (cfg q' (ListBlank.cons a l) default) target) : + Reaches (cfg q l default) target := + fun ht => ReachHalt.next (step_cfg_right_nil h l) (hr ht) + +theorem reach_left_nil {q q' : Fin 6} {a : Fin 2} + (h : target_tm q b0 = some (some q', Stmt.write a Dir.left)) + {c : Fin 2} {l : ListBlank (Fin 2)} {target : Cfg (Fin 2) (Fin 6)} + (hr : Reaches (cfg q' l (ListBlank.cons c (ListBlank.cons a default))) target) : + Reaches (cfg q (ListBlank.cons c l) default) target := + fun ht => ReachHalt.next (step_cfg_left_nil h c l) (hr ht) + +theorem reach_left_lnil {q q' : Fin 6} {b a : Fin 2} + (h : target_tm q b = some (some q', Stmt.write a Dir.left)) + {r : ListBlank (Fin 2)} {target : Cfg (Fin 2) (Fin 6)} + (hr : Reaches (cfg q' default (ListBlank.cons b0 (ListBlank.cons a r))) target) : + Reaches (cfg q default (ListBlank.cons b r)) target := + fun ht => ReachHalt.next (step_cfg_left_lnil h r) (hr ht) + +macro "step_tm" : tactic => `(tactic| + first + | refine reach_right rfl ?_ + | refine reach_left rfl ?_ + | refine reach_right_nil rfl ?_ + | refine reach_left_nil rfl ?_ + | refine reach_left_lnil rfl ?_) + +macro "exec_tm" n:num : tactic => `(tactic| ( + iterate $n step_tm + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, zero_cons_default] + exact Reaches.refl _)) + +-- ============================================================================ +-- Canonical Tape Encodings `L0`, `R1`, and `G(a, m)` +-- ============================================================================ + +def L0 : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, l => l + | n + 1, l => c0 (L0 n l) + +def R1 : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, r => r + | n + 1, r => c1 (R1 n r) + +theorem L0_add (m n : Nat) (l : ListBlank (Fin 2)) : L0 (m + n) l = L0 m (L0 n l) := by + induction m with + | zero => simp [L0] + | succ m ih => simp [L0, Nat.succ_add, ih] + +theorem R1_add (m n : Nat) (r : ListBlank (Fin 2)) : R1 (m + n) r = R1 m (R1 n r) := by + induction m with + | zero => simp [R1] + | succ m ih => simp [R1, Nat.succ_add, ih] + +theorem R1_snoc : ∀ (c : Nat) (r : ListBlank (Fin 2)), R1 c (c1 r) = c1 (R1 c r) + | 0, _ => rfl + | c + 1, r => by simp [R1, R1_snoc c r] + +/-- Canonical hub `G(a, m) := 0^∞ 1 0^a 11 0^{3m + 5} C> 0^∞`. -/ +def G (a m : Nat) : Cfg (Fin 2) (Fin 6) := + cfg C (L0 (3 * m + 5) (c1 (c1 (L0 a (c1 default))))) default + +theorem init_to_G5 : Reaches (cfg A default default) (G 5 0) := by + unfold G + exec_tm 45 + +-- ============================================================================ +-- Inner Sweep Lemmas (`sweep_C0`, `sweep_B111`, `pump_A`) +-- ============================================================================ + +theorem sweep_C0 : ∀ (c : Nat) (l r : ListBlank (Fin 2)), + Reaches (cfg C (L0 c l) (c0 r)) (cfg C l (c0 (R1 c r))) + | 0, l, r => Reaches.refl _ + | c + 1, l, r => by + simp only [L0] + refine reach_left rfl ?_ + have heq : c1 (R1 c r) = R1 (c + 1) r := rfl + rw [← heq, ← R1_snoc c r] + exact sweep_C0 c l (c1 r) + +theorem exit_11_C0 (c : Nat) (l : ListBlank (Fin 2)) : + Reaches (cfg C (L0 c (c1 (c1 l))) default) (cfg A l (R1 (c + 3) default)) := by + have hs : Reaches (cfg C (L0 c (c1 (c1 l))) default) (cfg C (c1 (c1 l)) (c0 (R1 c default))) := by + simpa using! sweep_C0 c (c1 (c1 l)) default + refine Reaches.trans hs ?_ + step_tm + step_tm + have heq : c1 (c1 (c1 (R1 c default))) = R1 (c + 3) default := by + rw [show c + 3 = 3 + c by omega, R1_add 3 c default]; rfl + dsimp only [c0, c1, b0, b1] at heq ⊢ + rw [heq] + exact Reaches.refl _ + +theorem sweep_B111 : ∀ (k : Nat) (l r : ListBlank (Fin 2)), + Reaches (cfg B l (R1 (3 * k) r)) (cfg B (L0 (3 * k) l) r) + | 0, l, r => Reaches.refl _ + | k + 1, l, r => by + have h1 : R1 (3 * (k + 1)) r = c1 (c1 (c1 (R1 (3 * k) r))) := by + rw [show 3 * (k + 1) = 3 + 3 * k by omega, R1_add 3 (3 * k) r]; rfl + have h2 : L0 (3 * (k + 1)) l = L0 (3 * k) (c0 (c0 (c0 l))) := by + rw [show 3 * (k + 1) = 3 * k + 3 by omega, L0_add (3 * k) 3 l]; rfl + rw [h1, h2] + step_tm + step_tm + step_tm + exact sweep_B111 k (c0 (c0 (c0 l))) r + +theorem finish_A0_mod3 (k : Nat) (u : ListBlank (Fin 2)) : + Reaches (cfg A u (c0 (R1 (3 * k + 9) default))) + (cfg C (L0 5 (c1 (c1 (L0 (3 * k + 8) (c1 u))))) default) := by + have hr : R1 (3 * k + 9) default = R1 (3 * (k + 3)) default := rfl + rw [hr] + step_tm + refine Reaches.trans (sweep_B111 (k + 3) (c1 u) default) ?_ + have hl : L0 (3 * (k + 3)) (c1 u) = L0 1 (L0 (3 * k + 8) (c1 u)) := by + rw [← L0_add 1 (3 * k + 8) (c1 u)] + congr 1; omega + rw [hl] + simp only [L0] + exec_tm 22 + +theorem pump_A : ∀ (c : Nat) (l : ListBlank (Fin 2)) (k : Nat), + Reaches (cfg A (L0 c l) (c0 (R1 (3 * k + 1) default))) + (cfg A l (c0 (R1 (3 * (k + c) + 1) default))) + | 0, l, k => by simpa [L0] using! Reaches.refl _ + | c + 1, l, k => by + simp only [L0] + have hr : R1 (3 * k + 1) default = R1 (3 * k) (c1 default) := R1_add (3 * k) 1 default + rw [hr] + step_tm + refine Reaches.trans (sweep_B111 k (c1 (c0 (L0 c l))) (c1 default)) ?_ + step_tm + step_tm + have hl : c0 (c0 (L0 (3 * k) (c1 (c0 (L0 c l))))) = + L0 (3 * k + 2) (c1 (c0 (L0 c l))) := by + rw [show 3 * k + 2 = 2 + 3 * k by omega, L0_add 2 (3 * k)]; rfl + dsimp only [c0, c1, b0, b1] at hl ⊢ + rw [hl] + refine Reaches.trans (by simpa using! sweep_C0 (3 * k + 2) (c1 (c0 (L0 c l))) default) ?_ + step_tm + step_tm + have hnext : c0 (c1 (c1 (R1 (3 * k + 2) default))) = c0 (R1 (3 * (k + 1) + 1) default) := by + rw [show 3 * (k + 1) + 1 = 2 + (3 * k + 2) by omega, R1_add 2 (3 * k + 2) default]; rfl + dsimp only [c0, c1, b0, b1] at hnext ⊢ + rw [hnext] + simpa [Nat.add_assoc, Nat.add_comm 1 c] using! pump_A c l (k + 1) + +-- ============================================================================ +-- Exact Macro-Transition Rules on `G(a, m)` +-- ============================================================================ + +theorem G_halt (m : Nat) : ReachHalt (G 0 m) := by + unfold G + apply exit_11_C0 (3 * m + 5) (c1 default) + have hr : R1 (3 * m + 5 + 3) default = c1 (R1 (3 * m + 7) default) := by + rw [show 3 * m + 5 + 3 = 1 + (3 * m + 7) by omega, R1_add 1 (3 * m + 7) default]; rfl + rw [hr] + exact ReachHalt.next (step_cfg_left rfl b1 default (R1 (3 * m + 7) default)) + (ReachHalt.done (by have hM : target_tm 3 b1 = none := rfl; simp [cfg, step, hM])) + +theorem G_mod1 (m : Nat) : Reaches (G 1 m) (G (3 * m + 8) 0) := by + unfold G + refine Reaches.trans (exit_11_C0 (3 * m + 5) (L0 1 (c1 default))) ?_ + have hr : R1 (3 * m + 5 + 3) default = c1 (R1 (3 * m + 7) default) := by + rw [show 3 * m + 5 + 3 = 1 + (3 * m + 7) by omega, R1_add 1 (3 * m + 7) default]; rfl + rw [hr] + simp only [L0] + iterate 6 step_tm + try simp only [zero_cons_default] + have hr2 : c1 (c1 (R1 (3 * m + 7) default)) = R1 (3 * m + 9) default := by + rw [show 3 * m + 9 = 2 + (3 * m + 7) by omega, R1_add 2 (3 * m + 7) default]; rfl + dsimp only [c0, c1, b0, b1] at hr2 ⊢ + rw [hr2] + exact finish_A0_mod3 m default + +theorem G_mod2 (m : Nat) : Reaches (G 2 m) (G (3 * m + 8) 0) := by + unfold G + refine Reaches.trans (exit_11_C0 (3 * m + 5) (L0 2 (c1 default))) ?_ + have hr : R1 (3 * m + 5 + 3) default = c1 (c1 (R1 (3 * m + 6) default)) := by + rw [show 3 * m + 5 + 3 = 2 + (3 * m + 6) by omega, R1_add 2 (3 * m + 6) default]; rfl + rw [hr] + simp only [L0] + iterate 8 step_tm + try simp only [zero_cons_default] + have hr2 : c1 (c1 (c1 (R1 (3 * m + 6) default))) = R1 (3 * m + 9) default := by + rw [show 3 * m + 9 = 3 + (3 * m + 6) by omega, R1_add 3 (3 * m + 6) default]; rfl + dsimp only [c0, c1, b0, b1] at hr2 ⊢ + rw [hr2] + exact finish_A0_mod3 m default + +theorem G_mod3 (m : Nat) : Reaches (G 3 m) (G (3 * m + 14) 0) := by + unfold G + refine Reaches.trans (exit_11_C0 (3 * m + 5) (L0 3 (c1 default))) ?_ + have hr : R1 (3 * m + 5 + 3) default = c1 (c1 (c1 (c1 (R1 (3 * m + 4) default)))) := by + rw [show 3 * m + 5 + 3 = 4 + (3 * m + 4) by omega, R1_add 4 (3 * m + 4) default]; rfl + rw [hr] + simp only [L0] + iterate 24 step_tm + try simp only [zero_cons_default] + have hr2 : c1 (c1 (c1 (c1 (c1 (c1 (c1 (c1 (c1 (c1 (c1 (R1 (3 * m + 4) default))))))))))) = + R1 (3 * (m + 2) + 9) default := by + rw [show 3 * (m + 2) + 9 = 11 + (3 * m + 4) by omega, R1_add 11 (3 * m + 4) default]; rfl + dsimp only [c0, c1, b0, b1] at hr2 ⊢ + rw [hr2] + simpa [show 3 * (m + 2) + 8 = 3 * m + 14 by omega] using! finish_A0_mod3 (m + 2) default + +theorem G_step4 (a m : Nat) : Reaches (G (a + 4) m) (G a (3 * m + 9)) := by + unfold G + have hl0 : L0 (a + 4) (c1 default) = L0 4 (L0 a (c1 default)) := by + rw [← L0_add 4 a (c1 default)] + congr 1; omega + rw [hl0] + refine Reaches.trans (exit_11_C0 (3 * m + 5) (L0 4 (L0 a (c1 default)))) ?_ + have hr : R1 (3 * m + 5 + 3) default = c1 (c1 (c1 (R1 (3 * m + 5) default))) := by + rw [show 3 * m + 5 + 3 = 3 + (3 * m + 5) by omega, R1_add 3 (3 * m + 5) default]; rfl + rw [hr] + simp only [L0] + iterate 13 step_tm + have hr2 : c1 (c1 (c1 (c1 (c1 (c1 (R1 (3 * m + 5) default)))))) = + R1 (3 * (m + 3)) (c1 (c1 default)) := by + have h6 : c1 (c1 (c1 (c1 (c1 (c1 (R1 (3 * m + 5) default)))))) = R1 6 (R1 (3 * m + 5) default) := rfl + rw [h6, ← R1_add 6 (3 * m + 5) default, + show 6 + (3 * m + 5) = 3 * (m + 3) + 2 by omega, + R1_add (3 * (m + 3)) 2 default] + rfl + dsimp only [c0, c1, b0, b1] at hr2 ⊢ + rw [hr2] + refine Reaches.trans (sweep_B111 (m + 3) (c1 (L0 a (c1 default))) (c1 (c1 default))) ?_ + iterate 5 step_tm + have hl2 : c0 (L0 (3 * (m + 3)) (c1 (L0 a (c1 default)))) = + L0 (3 * m + 10) (c1 (L0 a (c1 default))) := by + rw [show 3 * m + 10 = 1 + 3 * (m + 3) by omega, L0_add 1 (3 * (m + 3))]; rfl + dsimp only [c0, c1, b0, b1] at hl2 ⊢ + rw [hl2] + refine Reaches.trans (by simpa [R1] using! pump_A (3 * m + 10) (c1 (L0 a (c1 default))) 0) ?_ + step_tm + have hr3 : c1 (R1 (3 * (3 * m + 10)) default) = R1 (3 * (3 * m + 10)) (c1 default) := + R1_add (3 * (3 * m + 10)) 1 default + dsimp only [c0, c1, b0, b1] at hr3 ⊢ + rw [hr3] + refine Reaches.trans (sweep_B111 (3 * m + 10) (c1 (c1 (L0 a (c1 default)))) (c1 default)) ?_ + step_tm + step_tm + have hfin : c0 (c0 (L0 (3 * (3 * m + 10)) (c1 (c1 (L0 a (c1 default)))))) = + L0 (3 * (3 * m + 9) + 5) (c1 (c1 (L0 a (c1 default)))) := by + rw [show 3 * (3 * m + 9) + 5 = 2 + 3 * (3 * m + 10) by omega, + L0_add 2 (3 * (3 * m + 10))]; rfl + dsimp only [c0, c1, b0, b1] at hfin ⊢ + rw [hfin] + exact Reaches.refl _ + +-- ============================================================================ +-- Euler Totient Modular Tower (`MSeq`, `pow3_mod_pow2`, `pow3ModBin`) +-- ============================================================================ + +def MSeq : Nat → Nat + | 0 => 0 + | k + 1 => 3 * MSeq k + 9 + +theorem G_drain : ∀ (k r : Nat), Reaches (G (4 * k + r) 0) (G r (MSeq k)) + | 0, r => by simpa [MSeq] using! Reaches.refl _ + | k + 1, r => by + have hsplit : 4 * (k + 1) + r = (4 * k + r) + 4 := by omega + rw [hsplit] + exact Reaches.trans (G_drain k (r + 4)) (by simpa [MSeq] using! G_step4 r (MSeq k)) + +theorem two_MSeq_add_nine : ∀ k : Nat, 2 * MSeq k + 9 = 3 ^ (k + 2) + | 0 => rfl + | k + 1 => by + have ih := two_MSeq_add_nine k + simp only [MSeq] + rw [show 3 ^ (k + 1 + 2) = 3 * 3 ^ (k + 2) by ring] + omega + +theorem two_TSeq_add_one (k : Nat) : 2 * (3 * MSeq k + 13) + 1 = 3 ^ (k + 3) := by + have ih := two_MSeq_add_nine k + rw [show 3 ^ (k + 3) = 3 * 3 ^ (k + 2) by ring] + omega + +/-- Euler totient congruence `2^(e + 3) ∣ 3^(2^(e + 1)) - 1` for all `e : Nat`. -/ +theorem pow2_dvd_pow3_sub1 : ∀ e : Nat, 2 ^ (e + 3) ∣ 3 ^ (2 ^ (e + 1)) - 1 + | 0 => by decide + | e + 1 => by + rcases pow2_dvd_pow3_sub1 e with ⟨q, hq⟩ + have hge1 : 1 ≤ 3 ^ (2 ^ (e + 1)) := Nat.one_le_pow _ _ (by decide) + have h3 : 3 ^ (2 ^ (e + 1)) = 2 ^ (e + 3) * q + 1 := by omega + have hsq : 3 ^ (2 ^ (e + 1 + 1)) = + 2 ^ (e + 1 + 3) * (q + 2 ^ (e + 2) * q * q) + 1 := by + have hexp : 2 ^ (e + 1 + 1) = 2 ^ (e + 1) + 2 ^ (e + 1) := by ring + rw [hexp, Nat.pow_add, h3] + ring + exact ⟨q + 2 ^ (e + 2) * q * q, by omega⟩ + +theorem pow3_add_period (e k : Nat) : + 3 ^ (k + 2 ^ (e + 1)) % 2 ^ (e + 3) = 3 ^ k % 2 ^ (e + 3) := by + rcases pow2_dvd_pow3_sub1 e with ⟨q, hq⟩ + have hge1 : 1 ≤ 3 ^ (2 ^ (e + 1)) := Nat.one_le_pow _ _ (by decide) + have h3 : 3 ^ (2 ^ (e + 1)) = 2 ^ (e + 3) * q + 1 := by omega + have hrew : 3 ^ (k + 2 ^ (e + 1)) = 2 ^ (e + 3) * (3 ^ k * q) + 3 ^ k := by + rw [Nat.pow_add, h3]; ring + rw [hrew, Nat.mul_add_mod] + +theorem pow3_mod_pow2 (e : Nat) : ∀ k : Nat, + 3 ^ k % 2 ^ (e + 3) = 3 ^ (k % 2 ^ (e + 1)) % 2 ^ (e + 3) := by + intro k + induction k using Nat.strongRecOn with + | ind k ih => + by_cases hlt : k < 2 ^ (e + 1) + · rw [Nat.mod_eq_of_lt hlt] + · have hge : k ≥ 2 ^ (e + 1) := by omega + have hpos : 0 < 2 ^ (e + 1) := by positivity + have hsub : k = (k - 2 ^ (e + 1)) + 2 ^ (e + 1) := by omega + rw [hsub, pow3_add_period, ih (k - 2 ^ (e + 1)) (by omega), Nat.add_mod_right] + +theorem two_mul_add_one_mod (x m : Nat) (hm : 0 < m) : + (2 * x + 1) % (2 * m) = 2 * (x % m) + 1 := by + have hx := Nat.div_add_mod x m + have hrem : x % m < m := Nat.mod_lt x hm + have hrew : 2 * x + 1 = 2 * m * (x / m) + (2 * (x % m) + 1) := by nlinarith + have hlt : 2 * (x % m) + 1 < 2 * m := by omega + rw [hrew, Nat.mul_add_mod, Nat.mod_eq_of_lt hlt] + +theorem div4_mod (a m : Nat) (hm : 0 < m) : + (a % (4 * m)) / 4 = (a / 4) % m := by + have hdiv4 := Nat.div_add_mod a 4 + have hrem4 : a % 4 < 4 := Nat.mod_lt a (by decide) + have hdivm := Nat.div_add_mod (a / 4) m + have hremm : (a / 4) % m < m := Nat.mod_lt (a / 4) hm + have ha : a = 4 * m * ((a / 4) / m) + (4 * ((a / 4) % m) + a % 4) := by nlinarith + have hlt : 4 * ((a / 4) % m) + a % 4 < 4 * m := by nlinarith + nth_rw 1 [ha] + rw [Nat.mul_add_mod, Nat.mod_eq_of_lt hlt] + omega + +theorem mod_eq_of_add_one (X Y m : Nat) (h : (X + 1) % m = (Y + 1) % m) : X % m = Y % m := by + by_cases hm : m = 0 + · subst hm; simpa using! h + · have hx := Nat.div_add_mod X m + have hy := Nat.div_add_mod Y m + have hltX : X % m < m := Nat.mod_lt X (by omega) + have hltY : Y % m < m := Nat.mod_lt Y (by omega) + by_cases hx1 : X % m + 1 = m <;> by_cases hy1 : Y % m + 1 = m + · omega + · have hX : (X + 1) % m = 0 := by + have : X + 1 = m * (X / m + 1) + 0 := by nlinarith + rw [this, Nat.mul_add_mod]; simp + have hY : (Y + 1) % m = Y % m + 1 := by + have : Y + 1 = m * (Y / m) + (Y % m + 1) := by nlinarith + rw [this, Nat.mul_add_mod, Nat.mod_eq_of_lt (by omega)] + omega + · have hY : (Y + 1) % m = 0 := by + have : Y + 1 = m * (Y / m + 1) + 0 := by nlinarith + rw [this, Nat.mul_add_mod]; simp + have hX : (X + 1) % m = X % m + 1 := by + have : X + 1 = m * (X / m) + (X % m + 1) := by nlinarith + rw [this, Nat.mul_add_mod, Nat.mod_eq_of_lt (by omega)] + omega + · have hX : (X + 1) % m = X % m + 1 := by + have : X + 1 = m * (X / m) + (X % m + 1) := by nlinarith + rw [this, Nat.mul_add_mod, Nat.mod_eq_of_lt (by omega)] + have hY : (Y + 1) % m = Y % m + 1 := by + have : Y + 1 = m * (Y / m) + (Y % m + 1) := by nlinarith + rw [this, Nat.mul_add_mod, Nat.mod_eq_of_lt (by omega)] + omega + +theorem mod_eq_of_add_five (X Y m : Nat) (h : (X + 5) % m = (Y + 5) % m) : X % m = Y % m := by + apply mod_eq_of_add_one + apply mod_eq_of_add_one + apply mod_eq_of_add_one + apply mod_eq_of_add_one + apply mod_eq_of_add_one + simpa [Nat.add_assoc] using! h + +theorem TSeq_mod_half (k m : Nat) (hm : 0 < m) : + (3 * MSeq k + 13) % m = (3 ^ (k + 3) % (2 * m)) / 2 := by + have h1 := two_TSeq_add_one k + have h2 := two_mul_add_one_mod (3 * MSeq k + 13) m hm + rw [← h1, h2] + omega + +theorem TSeq_mod_congr (e a r_mod : Nat) + (ha : a % 2 ^ (e + 3) = r_mod) : + (3 * MSeq (a / 4) + 13) % 2 ^ (e + 2) = (3 * MSeq (r_mod / 4) + 13) % 2 ^ (e + 2) := by + have hdiv_mod : (a / 4) % 2 ^ (e + 1) = r_mod / 4 := by + have hsplit : 2 ^ (e + 3) = 4 * 2 ^ (e + 1) := by ring + rw [hsplit] at ha + rw [← div4_mod a (2 ^ (e + 1)) (by positivity), ha] + have hp1 := pow3_mod_pow2 e (a / 4 + 3) + have hp2 := pow3_mod_pow2 e (r_mod / 4 + 3) + have hexp_eq : (a / 4 + 3) % 2 ^ (e + 1) = (r_mod / 4 + 3) % 2 ^ (e + 1) := by + rw [← Nat.mod_add_mod (a / 4) (2 ^ (e + 1)) 3, hdiv_mod] + rw [hexp_eq] at hp1 + have h3eq : 3 ^ (a / 4 + 3) % 2 ^ (e + 3) = 3 ^ (r_mod / 4 + 3) % 2 ^ (e + 3) := + hp1.trans hp2.symm + have hpow : 2 ^ (e + 3) = 2 * 2 ^ (e + 2) := by ring + rw [TSeq_mod_half (a / 4) (2 ^ (e + 2)) (by positivity), + TSeq_mod_half (r_mod / 4) (2 ^ (e + 2)) (by positivity), + ← hpow, h3eq] + +theorem MSeq_mod_step (e a r_mod : Nat) (ha : a % 2 ^ (e + 3) = r_mod) : + (3 * MSeq (a / 4) + 8) % 2 ^ (e + 2) = (3 * MSeq (r_mod / 4) + 8) % 2 ^ (e + 2) := by + apply mod_eq_of_add_five + simpa [show (3 * MSeq (a / 4) + 8) + 5 = 3 * MSeq (a / 4) + 13 by omega, + show (3 * MSeq (r_mod / 4) + 8) + 5 = 3 * MSeq (r_mod / 4) + 13 by omega] using + TSeq_mod_congr e a r_mod ha + +theorem MSeq_mod_step3 (e a r_mod : Nat) (ha : a % 2 ^ (e + 3) = r_mod) : + (3 * MSeq (a / 4) + 14) % 2 ^ (e + 2) = (3 * MSeq (r_mod / 4) + 14) % 2 ^ (e + 2) := by + have h := TSeq_mod_congr e a r_mod ha + rw [show 3 * MSeq (a / 4) + 14 = (3 * MSeq (a / 4) + 13) + 1 by omega, + show 3 * MSeq (r_mod / 4) + 14 = (3 * MSeq (r_mod / 4) + 13) + 1 by omega, + ← Nat.mod_add_mod (3 * MSeq (a / 4) + 13) (2 ^ (e + 2)) 1, + h, + Nat.mod_add_mod (3 * MSeq (r_mod / 4) + 13) (2 ^ (e + 2)) 1] + +theorem a_mod4_eq (e a r_mod : Nat) (ha : a % 2 ^ (e + 3) = r_mod) : + a % 4 = r_mod % 4 := by + have h4dvd : 4 ∣ 2 ^ (e + 3) := ⟨2 ^ (e + 1), by ring⟩ + rw [← ha, Nat.mod_mod_of_dvd a h4dvd] + +theorem step_mod1 (e a r_mod : Nat) (ha : a % 2 ^ (e + 3) = r_mod) (_ : r_mod < 2 ^ (e + 3)) + (hr4 : r_mod % 4 = 1) : + ∃ a', Reaches (G a 0) (G a' 0) ∧ a' % 2 ^ (e + 2) = (3 * MSeq (r_mod / 4) + 8) % 2 ^ (e + 2) := by + refine ⟨3 * MSeq (a / 4) + 8, ?_, MSeq_mod_step e a r_mod ha⟩ + have hm4 := a_mod4_eq e a r_mod ha + have hd4 := Nat.div_add_mod a 4 + have ha4 : a = 4 * (a / 4) + 1 := by omega + nth_rw 1 [ha4] + exact Reaches.trans (G_drain (a / 4) 1) (G_mod1 (MSeq (a / 4))) + +theorem step_mod2 (e a r_mod : Nat) (ha : a % 2 ^ (e + 3) = r_mod) (_ : r_mod < 2 ^ (e + 3)) + (hr4 : r_mod % 4 = 2) : + ∃ a', Reaches (G a 0) (G a' 0) ∧ a' % 2 ^ (e + 2) = (3 * MSeq (r_mod / 4) + 8) % 2 ^ (e + 2) := by + refine ⟨3 * MSeq (a / 4) + 8, ?_, MSeq_mod_step e a r_mod ha⟩ + have hm4 := a_mod4_eq e a r_mod ha + have hd4 := Nat.div_add_mod a 4 + have ha4 : a = 4 * (a / 4) + 2 := by omega + nth_rw 1 [ha4] + exact Reaches.trans (G_drain (a / 4) 2) (G_mod2 (MSeq (a / 4))) + +theorem step_mod3 (e a r_mod : Nat) (ha : a % 2 ^ (e + 3) = r_mod) (_ : r_mod < 2 ^ (e + 3)) + (hr4 : r_mod % 4 = 3) : + ∃ a', Reaches (G a 0) (G a' 0) ∧ a' % 2 ^ (e + 2) = (3 * MSeq (r_mod / 4) + 14) % 2 ^ (e + 2) := by + refine ⟨3 * MSeq (a / 4) + 14, ?_, MSeq_mod_step3 e a r_mod ha⟩ + have hm4 := a_mod4_eq e a r_mod ha + have hd4 := Nat.div_add_mod a 4 + have ha4 : a = 4 * (a / 4) + 3 := by omega + nth_rw 1 [ha4] + exact Reaches.trans (G_drain (a / 4) 3) (G_mod3 (MSeq (a / 4))) + +/-- Fast binary squaring `(3 ^ n) % m` in `fuel = 16` steps (depth <= 16, zero big ints!). -/ +def pow3ModBin : Nat → Nat → Nat → Nat + | 0, _, m => 1 % m + | fuel + 1, n, m => + if n = 0 then 1 % m + else + let half := pow3ModBin fuel (n / 2) m + let sq := (half * half) % m + if n % 2 = 1 then (3 * sq) % m else sq + +theorem pow3ModBin_eq : ∀ (fuel n m : Nat), n < 2 ^ fuel → pow3ModBin fuel n m = 3 ^ n % m + | 0, n, m, hn => by + have h0 : n = 0 := by omega + subst h0; rfl + | fuel + 1, n, m, hn => by + simp only [pow3ModBin] + split_ifs with h0 hodd + · subst h0; rfl + · have hlt : n / 2 < 2 ^ fuel := by + have : 2 ^ (fuel + 1) = 2 * 2 ^ fuel := by ring + omega + rw [pow3ModBin_eq fuel (n / 2) m hlt] + have hsq : (3 ^ (n / 2) % m * (3 ^ (n / 2) % m)) % m = 3 ^ (2 * (n / 2)) % m := by + rw [← Nat.mul_mod, ← Nat.pow_add, show n / 2 + n / 2 = 2 * (n / 2) by omega] + rw [hsq] + rw [Nat.mul_mod_mod, show 3 * 3 ^ (2 * (n / 2)) = 3 ^ (2 * (n / 2) + 1) by ring] + rw [show 2 * (n / 2) + 1 = n by omega] + · have hlt : n / 2 < 2 ^ fuel := by + have : 2 ^ (fuel + 1) = 2 * 2 ^ fuel := by ring + omega + rw [pow3ModBin_eq fuel (n / 2) m hlt] + rw [← Nat.mul_mod, ← Nat.pow_add, show n / 2 + n / 2 = n by omega] + +theorem MSeq_fast_step1 (e r_mod : Nat) (hlt : r_mod / 4 + 3 < 2 ^ 16) : + (3 * MSeq (r_mod / 4) + 8) % 2 ^ (e + 2) = + (pow3ModBin 16 (r_mod / 4 + 3) (2 ^ (e + 3)) / 2 + 5 * 2 ^ (e + 2) - 5) % 2 ^ (e + 2) := by + apply mod_eq_of_add_five + have h5 : 5 ≤ 5 * 2 ^ (e + 2) := by + have : 1 ≤ 2 ^ (e + 2) := Nat.one_le_pow _ _ (by decide) + omega + have hpow : 2 ^ (e + 3) = 2 * 2 ^ (e + 2) := by ring + have h1 : (3 * MSeq (r_mod / 4) + 8) + 5 = 3 * MSeq (r_mod / 4) + 13 := by omega + rw [h1, TSeq_mod_half (r_mod / 4) (2 ^ (e + 2)) (by positivity), ← hpow, + ← pow3ModBin_eq 16 (r_mod / 4 + 3) (2 ^ (e + 3)) hlt] + have hadd : (pow3ModBin 16 (r_mod / 4 + 3) (2 ^ (e + 3)) / 2 + 5 * 2 ^ (e + 2) - 5) + 5 = + 2 ^ (e + 2) * 5 + pow3ModBin 16 (r_mod / 4 + 3) (2 ^ (e + 3)) / 2 := by omega + have hlt2 : pow3ModBin 16 (r_mod / 4 + 3) (2 ^ (e + 3)) / 2 < 2 ^ (e + 2) := by + have hlt3 : 3 ^ (r_mod / 4 + 3) % 2 ^ (e + 3) < 2 ^ (e + 3) := + Nat.mod_lt _ (by positivity) + rw [← pow3ModBin_eq 16 (r_mod / 4 + 3) (2 ^ (e + 3)) hlt] at hlt3 + omega + rw [hadd, Nat.mul_add_mod, Nat.mod_eq_of_lt hlt2] + +theorem MSeq_fast_step3 (e r_mod : Nat) (hlt : r_mod / 4 + 3 < 2 ^ 16) : + (3 * MSeq (r_mod / 4) + 14) % 2 ^ (e + 2) = + (pow3ModBin 16 (r_mod / 4 + 3) (2 ^ (e + 3)) / 2 + 1) % 2 ^ (e + 2) := by + have hpow : 2 ^ (e + 3) = 2 * 2 ^ (e + 2) := by ring + rw [show 3 * MSeq (r_mod / 4) + 14 = (3 * MSeq (r_mod / 4) + 13) + 1 by omega, + ← Nat.mod_add_mod (3 * MSeq (r_mod / 4) + 13) (2 ^ (e + 2)) 1, + TSeq_mod_half (r_mod / 4) (2 ^ (e + 2)) (by positivity), ← hpow, + ← pow3ModBin_eq 16 (r_mod / 4 + 3) (2 ^ (e + 3)) hlt] + +theorem tower_halts : ReachHalt (G 5 0) := by + have s0 : (5 : Nat) % 2 ^ 17 = 5 := by decide + rcases step_mod1 14 5 5 s0 (by decide) (by decide) with ⟨a1, r1, h1⟩ + rw [MSeq_fast_step1 14 5 (by decide), show (pow3ModBin 16 (5 / 4 + 3) (2 ^ 17) / 2 + 5 * 2 ^ 16 - 5) % 2 ^ 16 = 35 by decide] at h1 + rcases step_mod3 13 a1 35 h1 (by decide) (by decide) with ⟨a2, r2, h2⟩ + rw [MSeq_fast_step3 13 35 (by decide), show (pow3ModBin 16 (35 / 4 + 3) (2 ^ 16) / 2 + 1) % 2 ^ 15 = 23038 by decide] at h2 + rcases step_mod2 12 a2 23038 h2 (by decide) (by decide) with ⟨a3, r3, h3⟩ + rw [MSeq_fast_step1 12 23038 (by decide), show (pow3ModBin 16 (23038 / 4 + 3) (2 ^ 15) / 2 + 5 * 2 ^ 14 - 5) % 2 ^ 14 = 255 by decide] at h3 + rcases step_mod3 11 a3 255 h3 (by decide) (by decide) with ⟨a4, r4, h4⟩ + rw [MSeq_fast_step3 11 255 (by decide), show (pow3ModBin 16 (255 / 4 + 3) (2 ^ 14) / 2 + 1) % 2 ^ 13 = 4741 by decide] at h4 + rcases step_mod1 10 a4 4741 h4 (by decide) (by decide) with ⟨a5, r5, h5⟩ + rw [MSeq_fast_step1 10 4741 (by decide), show (pow3ModBin 16 (4741 / 4 + 3) (2 ^ 13) / 2 + 5 * 2 ^ 12 - 5) % 2 ^ 12 = 2147 by decide] at h5 + rcases step_mod3 9 a5 2147 h5 (by decide) (by decide) with ⟨a6, r6, h6⟩ + rw [MSeq_fast_step3 9 2147 (by decide), show (pow3ModBin 16 (2147 / 4 + 3) (2 ^ 12) / 2 + 1) % 2 ^ 11 = 990 by decide] at h6 + rcases step_mod2 8 a6 990 h6 (by decide) (by decide) with ⟨a7, r7, h7⟩ + rw [MSeq_fast_step1 8 990 (by decide), show (pow3ModBin 16 (990 / 4 + 3) (2 ^ 11) / 2 + 5 * 2 ^ 10 - 5) % 2 ^ 10 = 175 by decide] at h7 + rcases step_mod3 7 a7 175 h7 (by decide) (by decide) with ⟨a8, r8, h8⟩ + rw [MSeq_fast_step3 7 175 (by decide), show (pow3ModBin 16 (175 / 4 + 3) (2 ^ 10) / 2 + 1) % 2 ^ 9 = 253 by decide] at h8 + rcases step_mod1 6 a8 253 h8 (by decide) (by decide) with ⟨a9, r9, h9⟩ + rw [MSeq_fast_step1 6 253 (by decide), show (pow3ModBin 16 (253 / 4 + 3) (2 ^ 9) / 2 + 5 * 2 ^ 8 - 5) % 2 ^ 8 = 127 by decide] at h9 + rcases step_mod3 5 a9 127 h9 (by decide) (by decide) with ⟨a10, r10, h10⟩ + rw [MSeq_fast_step3 5 127 (by decide), show (pow3ModBin 16 (127 / 4 + 3) (2 ^ 8) / 2 + 1) % 2 ^ 7 = 69 by decide] at h10 + rcases step_mod1 4 a10 69 h10 (by decide) (by decide) with ⟨a11, r11, h11⟩ + rw [MSeq_fast_step1 4 69 (by decide), show (pow3ModBin 16 (69 / 4 + 3) (2 ^ 7) / 2 + 5 * 2 ^ 6 - 5) % 2 ^ 6 = 3 by decide] at h11 + rcases step_mod3 3 a11 3 h11 (by decide) (by decide) with ⟨a12, r12, h12⟩ + rw [MSeq_fast_step3 3 3 (by decide), show (pow3ModBin 16 (3 / 4 + 3) (2 ^ 6) / 2 + 1) % 2 ^ 5 = 14 by decide] at h12 + rcases step_mod2 2 a12 14 h12 (by decide) (by decide) with ⟨a13, r13, h13⟩ + rw [MSeq_fast_step1 2 14 (by decide), show (pow3ModBin 16 (14 / 4 + 3) (2 ^ 5) / 2 + 5 * 2 ^ 4 - 5) % 2 ^ 4 = 7 by decide] at h13 + rcases step_mod3 1 a13 7 h13 (by decide) (by decide) with ⟨a14, r14, h14⟩ + rw [MSeq_fast_step3 1 7 (by decide), show (pow3ModBin 16 (7 / 4 + 3) (2 ^ 4) / 2 + 1) % 2 ^ 3 = 1 by decide] at h14 + rcases step_mod1 0 a14 1 h14 (by decide) (by decide) with ⟨a15, r15, h15⟩ + rw [MSeq_fast_step1 0 1 (by decide), show (pow3ModBin 16 (1 / 4 + 3) (2 ^ 3) / 2 + 5 * 2 ^ 2 - 5) % 2 ^ 2 = 0 by decide] at h15 + have ha15 : a15 = 4 * (a15 / 4) + 0 := by omega + have hfin : ReachHalt (G a15 0) := by + rw [ha15] + exact G_drain (a15 / 4) 0 (G_halt (MSeq (a15 / 4))) + exact r1 (r2 (r3 (r4 (r5 (r6 (r7 (r8 (r9 (r10 (r11 (r12 (r13 (r14 (r15 hfin)))))))))))))) + +public section + +theorem is_halt : IsHalt target := by + rw [IsHalt, init_eq_cfg] + exact ReachHalt.to_isHalt (init_to_G5 tower_halts) + +end + +end BusyBeaver.M_1RB0LD_1RC0RF_1LC1LA_0LEHHH_1LF0RB_0RC0RE diff --git a/BusyBeaver/BB6/Halt/M_1RB0LE_0RC0RB_1LD0LD_1RA1LC_HHH1LF_1LA0LC.lean b/BusyBeaver/BB6/Halt/M_1RB0LE_0RC0RB_1LD0LD_1RA1LC_HHH1LF_1LA0LC.lean new file mode 100644 index 00000000..d3285688 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB0LE_0RC0RB_1LD0LD_1RA1LC_HHH1LF_1LA0LC.lean @@ -0,0 +1,5246 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0LE_0RC0RB_1LD0LD_1RA1LC_HHH1LF_1LA0LC + + +local macro "normalize" : tactic => `(tactic| ( + try simp only [ListBlank.append_cons, ListBlank.append_nil, + ListBlank.head_cons, ListBlank.tail_cons, + ListBlank.head_default, ListBlank.head_default_fin, ListBlank.tail_default, + ListBlank.cons_zero_default, ListBlank.cons_default_default, + list_pow_zero, list_pow_succ, + List.nil_append, List.cons_append, List.append_nil, + Nat.mul_zero, Nat.mul_add, Nat.mul_one])) +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LE_0RC0RB_1LD0LD_1RA1LC_HHH1LF_1LA0LC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +noncomputable section +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +def LC : List Nat → ListBlank (Fin 2) + | [] => default + | a :: l => (0 : Fin 2) >> ((([1] : List (Fin 2)) ^ a) +> LC l) + +def RC : List Nat → ListBlank (Fin 2) + | [] => default + | a :: r => (([1] : List (Fin 2)) ^ a) +> ((0 : Fin 2) >> RC r) + +def CfgS (l : List Nat) (b : Nat) (r : List Nat) : Cfg (Fin 2) (Fin 6) := + Cfg.headLeft C ((([1] : List (Fin 2)) ^ b) +> LC l) (RC r) + +def CfgT (l : List Nat) (b : Nat) (r : List Nat) : Cfg (Fin 2) (Fin 6) := + Cfg.headRight B ((([1] : List (Fin 2)) ^ b) +> LC l) (RC r) + +def CfgU (l : List Nat) (b : Nat) (r : List Nat) : Cfg (Fin 2) (Fin 6) := + Cfg.headLeft F ((([1] : List (Fin 2)) ^ b) +> LC l) (RC r) + +def CfgV (l : List Nat) (b : Nat) (r : List Nat) : Cfg (Fin 2) (Fin 6) := + Cfg.headLeft A ((([1] : List (Fin 2)) ^ b) +> LC l) (RC r) + +theorem Lblank : LC [] = LC [0] := by + simp only [LC]; normalize + +theorem Rblank (r : List Nat) : RC r = RC (r ++ [0]) := by + induction r with + | nil => simp only [RC, List.nil_append]; normalize + | cons a r ih => simp only [List.cons_append, RC, ← ih] + +theorem Szero (l : List Nat) (a : Nat) (r : List Nat) : + ReachesStar target_tm (CfgS (0 :: a :: l) 0 r) (CfgU l a (1 :: r)) := by + simp only [CfgS, CfgU, LC, RC]; normalize; bb_steps + +theorem Sleft (l : List Nat) (a c : Nat) (r : List Nat) : + ReachesStar target_tm (CfgS ((1 + a) :: l) 0 (c :: r)) (CfgS l a ((2 + c) :: r)) := by + rw [Nat.add_comm 1 a, Nat.add_comm 2 c] + simp only [CfgS, LC, RC]; normalize; bb_steps + +theorem Sone (l : List Nat) (a : Nat) (r : List Nat) : + ReachesStar target_tm (CfgS (a :: l) 1 r) (CfgT l (2 + a) r) := by + rw [Nat.add_comm 2 a] + simp only [CfgS, CfgT, LC]; normalize; bb_steps + +theorem Spos (l : List Nat) (a : Nat) (r : List Nat) : + ReachesStar target_tm (CfgS l (2 + a) r) (CfgS l a (1 :: r)) := by + rw [Nat.add_comm 2 a] + simp only [CfgS, RC]; normalize; bb_steps + +theorem Tzero (l : List Nat) (a : Nat) (r : List Nat) : + ReachesStar target_tm (CfgT l a (0 :: 0 :: r)) (CfgU l a (1 :: r)) := by + simp only [CfgT, CfgU, RC]; normalize; bb_steps + +theorem Tmix (l : List Nat) (a c : Nat) (r : List Nat) : + ReachesStar target_tm (CfgT l a (0 :: (1 + c) :: r)) (CfgT l (2 + a) (c :: r)) := by + rw [Nat.add_comm 1 c, Nat.add_comm 2 a] + simp only [CfgT, RC]; normalize; bb_steps + +theorem Tpos (l : List Nat) (a c : Nat) (r : List Nat) : + ReachesStar target_tm (CfgT l a ((1 + c) :: r)) (CfgT (a :: l) 0 (c :: r)) := by + rw [Nat.add_comm 1 c] + simp only [CfgT, LC, RC]; normalize; bb_steps + +theorem Uzero (l : List Nat) (a c : Nat) (r : List Nat) : + ReachesStar target_tm (CfgU (a :: l) 0 (c :: r)) (CfgV l a ((1 + c) :: r)) := by + rw [Nat.add_comm 1 c] + simp only [CfgU, CfgV, LC, RC]; normalize; bb_steps + +theorem Upos (l : List Nat) (a : Nat) (r : List Nat) : + ReachesStar target_tm (CfgU l (1 + a) r) (CfgS l a (0 :: r)) := by + rw [Nat.add_comm 1 a] + simp only [CfgU, CfgS, RC]; normalize; bb_steps + +theorem Vzero (l : List Nat) (a : Nat) (r : List Nat) : + ReachesStar target_tm (CfgV (a :: l) 0 r) (CfgT l (1 + a) r) := by + rw [Nat.add_comm 1 a] + simp only [CfgV, CfgT, LC]; normalize; bb_steps + +theorem HV (l : List Nat) (r : List Nat) : + HaltsFrom target_tm (CfgV l 1 r) := by + cases l with + | nil => + refine ⟨Cfg.headLeft E default ((0 : Fin 2) >> RC r), ?_, ?_⟩ + · simp only [CfgV, LC]; normalize; bb_steps + · bb_halt + | cons a l => + refine ⟨Cfg.headLeft E ((0 : Fin 2) >> ((([1] : List (Fin 2)) ^ a) +> LC l)) ((0 : Fin 2) >> RC r), ?_, ?_⟩ + · simp only [CfgV, LC]; normalize; bb_steps + · bb_halt + +theorem Vpos (l : List Nat) (a : Nat) (r : List Nat) : + ReachesStar target_tm (CfgV l (2 + a) r) (CfgU l a (1 :: r)) := by + rw [Nat.add_comm 2 a] + simp only [CfgV, CfgU, RC]; normalize; bb_steps + +theorem rep_snoc (x n : Nat) (l : List Nat) : + List.replicate n x ++ x :: l = List.replicate (1 + n) x ++ l := by + rw [Nat.add_comm 1 n, List.replicate_succ', List.append_assoc, List.singleton_append] + +theorem Slefts (n : Nat) (l : List Nat) (a : Nat) (r : List Nat) : + ReachesStar target_tm (CfgS l (n * 2 + a) r) (CfgS l a (List.replicate n 1 ++ r)) := by + induction n generalizing r with + | zero => simp; try exact ReachesStar.refl _ _ + | succ n ih => + have h1 : (n + 1) * 2 + a = 2 + (n * 2 + a) := by omega + rw [h1] + exact (Spos l (n * 2 + a) r).trans ((ih (1 :: r)).trans (by rw [rep_snoc, Nat.add_comm 1 n]; try exact ReachesStar.refl _ _)) + +theorem Trights (n : Nat) (l : List Nat) (a : Nat) (r : List Nat) : + ReachesStar target_tm (CfgT l a ((1 + n) :: r)) (CfgT (List.replicate n 0 ++ a :: l) 0 (0 :: r)) := by + induction n generalizing l a with + | zero => simpa using Tpos l a 0 r + | succ n ih => + have h1 : 1 + (n + 1) = 1 + (1 + n) := by omega + rw [h1] + exact (Tpos l a (1 + n) r).trans ((ih (a :: l) 0).trans (by rw [rep_snoc, Nat.add_comm 1 n]; try exact ReachesStar.refl _ _)) + +theorem Tmixs (n : Nat) (l : List Nat) (a : Nat) (r : List Nat) : + ReachesStar target_tm (CfgT l a (0 :: (List.replicate n 1 ++ r))) (CfgT l (n * 2 + a) (0 :: r)) := by + induction n generalizing a with + | zero => simp; try exact ReachesStar.refl _ _ + | succ n ih => + simp only [List.replicate_succ, List.cons_append] + exact (Tmix l a 0 (List.replicate n 1 ++ r)).trans ((ih (2 + a)).trans (by + have h1 : n * 2 + (2 + a) = (n + 1) * 2 + a := by omega + rw [h1]; try exact ReachesStar.refl _ _)) + +theorem Inc (l : List Nat) (a b : Nat) (r : List Nat) : + ReachesStar target_tm (CfgS (a :: l) (5 + b * 2) (0 :: r)) (CfgS ((2 + a) :: l) (1 + b * 2) (0 :: 1 :: r)) := by + have h1 : 5 + b * 2 = (2 + b) * 2 + 1 := by omega + rw [h1] + refine (Slefts (2 + b) (a :: l) 1 (0 :: r)).trans ?_ + refine (Sone l a (List.replicate (2 + b) 1 ++ 0 :: r)).trans ?_ + have hrep : List.replicate (2 + b) 1 ++ 0 :: r = 1 :: (List.replicate (1 + b) 1 ++ 0 :: r) := by + rw [Nat.add_comm 2 b, Nat.add_comm 1 b, List.replicate_succ, List.cons_append] + rw [hrep] + refine (Tpos l (2 + a) 0 (List.replicate (1 + b) 1 ++ 0 :: r)).trans ?_ + refine (Tmixs (1 + b) ((2 + a) :: l) 0 (0 :: r)).trans ?_ + refine (Tzero ((2 + a) :: l) ((1 + b) * 2 + 0) r).trans ?_ + have h2 : (1 + b) * 2 + 0 = 1 + (1 + b * 2) := by omega + rw [h2] + exact Upos ((2 + a) :: l) (1 + b * 2) (1 :: r) + +theorem Incs (n k : Nat) (l : List Nat) (a : Nat) (r : List Nat) : + ReachesStar target_tm (CfgS (a :: l) (n * 4 + 1 + k * 2) (0 :: r)) + (CfgS ((n * 2 + a) :: l) (1 + k * 2) (0 :: (List.replicate n 1 ++ r))) := by + induction n generalizing a r with + | zero => simp; try exact ReachesStar.refl _ _ + | succ n ih => + have h1 : (n + 1) * 4 + 1 + k * 2 = 5 + (n * 2 + k) * 2 := by omega + rw [h1] + refine (Inc l a (n * 2 + k) r).trans ?_ + have h2 : 1 + (n * 2 + k) * 2 = n * 4 + 1 + k * 2 := by omega + rw [h2] + refine (ih (2 + a) (1 :: r)).trans ?_ + have h3 : n * 2 + (2 + a) = (n + 1) * 2 + a := by omega + rw [h3, rep_snoc, Nat.add_comm 1 n] + try exact ReachesStar.refl _ _ + +theorem init_step : ReachesStar target_tm (init []) (CfgT [] 1 []) := by + simp only [CfgT, LC, RC]; normalize; bb_steps + +theorem S_odd3_lemma (n : Nat) (l : List Nat) (x : Nat) (r : List Nat) : + ReachesStar target_tm (CfgS (x :: l) (n * 4 + 7) (0 :: r)) + (CfgS l (x + n * 2 + 1) (0 :: 1 :: 2 :: (List.replicate (n + 1) 1 ++ r))) := by + have h1 : n * 4 + 7 = (n + 1) * 4 + 1 + 1 * 2 := by omega + rw [h1] + refine (Incs (n + 1) 1 l x r).trans ?_ + refine (Spos (((n + 1) * 2 + x) :: l) 1 (0 :: (List.replicate (n + 1) 1 ++ r))).trans ?_ + refine (Sone l ((n + 1) * 2 + x) (1 :: 0 :: (List.replicate (n + 1) 1 ++ r))).trans ?_ + refine (Tpos l (2 + ((n + 1) * 2 + x)) 0 (0 :: (List.replicate (n + 1) 1 ++ r))).trans ?_ + refine (Tzero ((2 + ((n + 1) * 2 + x)) :: l) 0 (List.replicate (n + 1) 1 ++ r)).trans ?_ + refine (Uzero l (2 + ((n + 1) * 2 + x)) 1 (List.replicate (n + 1) 1 ++ r)).trans ?_ + refine (Vpos l ((n + 1) * 2 + x) (2 :: (List.replicate (n + 1) 1 ++ r))).trans ?_ + have h4 : (n + 1) * 2 + x = 1 + (x + n * 2 + 1) := by omega + rw [h4] + exact Upos l (x + n * 2 + 1) (1 :: 2 :: (List.replicate (n + 1) 1 ++ r)) + +theorem S_odd1_lemma (n m : Nat) (l : List Nat) (x : Nat) (r : List Nat) : + ReachesStar target_tm (CfgS (x :: l) (n * 4 + 5) (0 :: (List.replicate m 1 ++ r))) + (CfgT l ((n + 1 + m) * 2 + (2 + ((n + 1) * 2 + x))) (0 :: r)) := by + have h1 : n * 4 + 5 = (n + 1) * 4 + 1 + 0 * 2 := by omega + rw [h1] + refine (Incs (n + 1) 0 l x (List.replicate m 1 ++ r)).trans ?_ + refine (Sone l ((n + 1) * 2 + x) (0 :: (List.replicate (n + 1) 1 ++ (List.replicate m 1 ++ r)))).trans ?_ + have h3 : List.replicate (n + 1) 1 ++ (List.replicate m 1 ++ r) = List.replicate (n + 1 + m) 1 ++ r := by + rw [← List.append_assoc, ← List.replicate_add] + rw [h3] + exact Tmixs (n + 1 + m) l (2 + ((n + 1) * 2 + x)) r + +theorem T_21_lemma (k : Nat) (l : List Nat) (a : Nat) (r : List Nat) : + ReachesStar target_tm (CfgT l a (0 :: 2 :: (List.replicate k 1 ++ r))) + (CfgT ((2 + a) :: l) (k * 2) (0 :: r)) := by + refine (Tmix l a 1 (List.replicate k 1 ++ r)).trans ?_ + refine (Tpos l (2 + a) 0 (List.replicate k 1 ++ r)).trans ?_ + simpa using Tmixs k ((2 + a) :: l) 0 r + +theorem T_end_lemma (l : List Nat) (a : Nat) : + ReachesStar target_tm (CfgT l (1 + a) [0]) (CfgS l a [0, 1]) := by + have h1 : CfgT l (1 + a) [0] = CfgT l (1 + a) [0, 0] := by + simp only [CfgT]; rw [Rblank [0]]; rfl + rw [h1] + refine (Tzero l (1 + a) []).trans ?_ + exact Upos l a [1] + +theorem S_even_empty_lemma (q m : Nat) (r : List Nat) : + ReachesStar target_tm (CfgS [] ((q + 1) * 2) (0 :: (List.replicate m 1 ++ r))) + (CfgS [0, 1] (q * 2 + 1) (0 :: (List.replicate (m + 1) 1 ++ r))) := by + have h1 : (q + 1) * 2 = (q + 1) * 2 + 0 := by omega + rw [h1] + refine (Slefts (q + 1) [] 0 (0 :: (List.replicate m 1 ++ r))).trans ?_ + have h2 : CfgS [] 0 (List.replicate (q + 1) 1 ++ 0 :: (List.replicate m 1 ++ r)) = + CfgS [0, 0] 0 (1 :: (List.replicate q 1 ++ 0 :: (List.replicate m 1 ++ r))) := by + simp only [CfgS] + rw [Lblank, LC, Lblank, ← LC] + rw [List.replicate_succ, List.cons_append] + rw [h2] + refine (Szero [] 0 (1 :: (List.replicate q 1 ++ 0 :: (List.replicate m 1 ++ r)))).trans ?_ + have h3 : CfgU [] 0 (1 :: 1 :: (List.replicate q 1 ++ 0 :: (List.replicate m 1 ++ r))) = + CfgU [0] 0 (1 :: 1 :: (List.replicate q 1 ++ 0 :: (List.replicate m 1 ++ r))) := by + simp only [CfgU, Lblank] + rw [h3] + refine (Uzero [] 0 1 (1 :: (List.replicate q 1 ++ 0 :: (List.replicate m 1 ++ r)))).trans ?_ + have h4 : CfgV [] 0 ((1 + 1) :: 1 :: (List.replicate q 1 ++ 0 :: (List.replicate m 1 ++ r))) = + CfgV [0] 0 ((1 + 1) :: 1 :: (List.replicate q 1 ++ 0 :: (List.replicate m 1 ++ r))) := by + simp only [CfgV, Lblank] + rw [h4] + refine (Vzero [] 0 ((1 + 1) :: 1 :: (List.replicate q 1 ++ 0 :: (List.replicate m 1 ++ r)))).trans ?_ + refine (Trights 1 [] 1 (1 :: (List.replicate q 1 ++ 0 :: (List.replicate m 1 ++ r)))).trans ?_ + have h5 : (0 :: 1 :: (List.replicate q 1 ++ 0 :: (List.replicate m 1 ++ r))) = + (0 :: (List.replicate (q + 1) 1 ++ 0 :: (List.replicate m 1 ++ r))) := by + rw [List.replicate_succ, List.cons_append] + rw [h5] + refine (Tmixs (q + 1) [0, 1] 0 (0 :: (List.replicate m 1 ++ r))).trans ?_ + refine (Tzero [0, 1] ((q + 1) * 2 + 0) (List.replicate m 1 ++ r)).trans ?_ + have h6 : (q + 1) * 2 + 0 = 1 + (q * 2 + 1) := by omega + have h7 : (1 :: (List.replicate m 1 ++ r)) = (List.replicate (m + 1) 1 ++ r) := by + rw [List.replicate_succ, List.cons_append] + rw [h6, h7] + exact Upos [0, 1] (q * 2 + 1) (List.replicate (m + 1) 1 ++ r) + + +def Cn (n : Nat) : Cfg (Fin 2) (Fin 6) := CfgS [] n [0, 1] + +theorem step_odd1_r (l : List Nat) (x fa m : Nat) (r : List Nat) (h : fa % 4 = 1) : + ReachesStar target_tm + (CfgS (x :: l) fa (0 :: (List.replicate (m + 1) 1 ++ r))) + (CfgT l (x + fa + 2 * m + 3) (0 :: r)) := by + by_cases h1 : fa = 1 + · subst h1 + refine (Sone l x (0 :: (List.replicate (m + 1) 1 ++ r))).trans ?_ + refine (Tmixs (m + 1) l (2 + x) r).trans ?_ + have heq : (m + 1) * 2 + (2 + x) = x + 1 + 2 * m + 3 := by omega + rw [heq]; try exact ReachesStar.refl _ _ + · have hfa : (fa / 4 - 1) * 4 + 5 = fa := by omega + rw [← hfa] + refine (S_odd1_lemma (fa / 4 - 1) (m + 1) l x r).trans ?_ + have heq : (fa / 4 - 1 + 1 + (m + 1)) * 2 + (2 + ((fa / 4 - 1 + 1) * 2 + x)) = + x + ((fa / 4 - 1) * 4 + 5) + 2 * m + 3 := by omega + rw [heq]; try exact ReachesStar.refl _ _ + +theorem step_odd1_end (l : List Nat) (x fa : Nat) (h : fa % 4 = 1) : + ReachesStar target_tm (CfgS (x :: l) fa [0, 1]) (CfgS l (x + fa + 2) [0, 1]) := by + have hr : ([0, 1] : List Nat) = 0 :: (List.replicate (0 + 1) 1 ++ []) := rfl + rw [hr] + refine (step_odd1_r l x fa 0 [] h).trans ?_ + have heq : x + fa + 2 * 0 + 3 = 1 + (x + fa + 2) := by omega + rw [heq] + exact T_end_lemma l (x + fa + 2) + +theorem step_odd3_r (l : List Nat) (x fa : Nat) (r : List Nat) (h1 : fa % 4 = 3) (h2 : 2 ≤ x + fa / 2) : + ReachesStar target_tm + (CfgS (x :: l) fa (0 :: r)) + (CfgS l (x + fa / 2 - 2) (0 :: 1 :: 2 :: (List.replicate (fa / 4) 1 ++ r))) := by + by_cases hfa3 : fa = 3 + · subst hfa3 + have hx : x = 1 + (x - 1) := by omega + have h3 : (3 : Nat) = 2 + 1 := rfl + rw [h3] + refine (Spos (x :: l) 1 (0 :: r)).trans ?_ + refine (Sone l x (1 :: 0 :: r)).trans ?_ + refine (Tpos l (2 + x) 0 (0 :: r)).trans ?_ + refine (Tzero ((2 + x) :: l) 0 r).trans ?_ + refine (Uzero l (2 + x) 1 r).trans ?_ + refine (Vpos l x (2 :: r)).trans ?_ + have hx2 : x + (2 + 1) / 2 - 2 = x - 1 := by omega + have hr2 : List.replicate ((2 + 1) / 4) 1 ++ r = r := rfl + rw [hx2, hr2] + conv_lhs => rw [hx] + exact Upos l (x - 1) (1 :: 2 :: r) + · have h := S_odd3_lemma (fa / 4 - 1) l x r + have hfa : (fa / 4 - 1) * 4 + 7 = fa := by omega + have hdiv2 : x + (fa / 4 - 1) * 2 + 1 = x + fa / 2 - 2 := by omega + have hdiv4 : fa / 4 - 1 + 1 = fa / 4 := by omega + rw [hfa, hdiv2, hdiv4] at h + exact h + +theorem step_even_1 (fa : Nat) (r : List Nat) (h1 : fa % 2 = 0) (h2 : 2 ≤ fa) : + ReachesStar target_tm + (CfgS [] fa (0 :: 1 :: r)) + (CfgS [0, 1] (fa - 1) (0 :: 1 :: 1 :: r)) := by + have h := S_even_empty_lemma (fa / 2 - 1) 1 r + have hr1 : (0 :: (List.replicate 1 1 ++ r) : List Nat) = 0 :: 1 :: r := rfl + have hr2 : (0 :: (List.replicate (1 + 1) 1 ++ r) : List Nat) = 0 :: 1 :: 1 :: r := rfl + have hfa : (fa / 2 - 1 + 1) * 2 = fa := by omega + have hfa2 : (fa / 2 - 1) * 2 + 1 = fa - 1 := by omega + rw [hr1, hr2, hfa, hfa2] at h + exact h + +theorem step_down_nil4 (fa : Nat) (r : List Nat) (h1 : fa % 8 = 4) (h2 : 12 ≤ fa) : + let arec_0 := fa / 4 - 3 + ReachesStar target_tm + (CfgS [] fa (0 :: 1 :: r)) + (CfgS [] arec_0 (0 :: 1 :: 2 :: (List.replicate (arec_0 / 2 + 1) 1 ++ 2 :: (List.replicate (arec_0 + 4) 1 ++ r)))) := by + intro arec_0 + have hev : fa % 2 = 0 := by omega + have hge2 : 2 ≤ fa := by omega + refine (step_even_1 fa r hev hge2).trans ?_ + have hodd1 : (fa - 1) % 4 = 3 := by omega + have hge7_1 : 2 ≤ 0 + (fa - 1) / 2 := by omega + refine (step_odd3_r [1] 0 (fa - 1) (1 :: 1 :: r) hodd1 hge7_1).trans ?_ + have hrep1 : List.replicate ((fa - 1) / 4) 1 ++ 1 :: 1 :: r = List.replicate (arec_0 + 4) 1 ++ r := by + have hlen : (fa - 1) / 4 = arec_0 + 2 := by omega + rw [hlen, rep_snoc, rep_snoc] + have hadd : 1 + (1 + (arec_0 + 2)) = arec_0 + 4 := by omega + rw [hadd] + have ha1 : 0 + (fa - 1) / 2 - 2 = 2 * arec_0 + 3 := by omega + rw [hrep1, ha1] + have hodd2 : (2 * arec_0 + 3) % 4 = 3 := by omega + have hge7_2 : 2 ≤ 1 + (2 * arec_0 + 3) / 2 := by omega + refine (step_odd3_r [] 1 (2 * arec_0 + 3) (1 :: 2 :: (List.replicate (arec_0 + 4) 1 ++ r)) hodd2 hge7_2).trans ?_ + have hrep2 : List.replicate ((2 * arec_0 + 3) / 4) 1 ++ 1 :: 2 :: (List.replicate (arec_0 + 4) 1 ++ r) = + List.replicate (arec_0 / 2 + 1) 1 ++ 2 :: (List.replicate (arec_0 + 4) 1 ++ r) := by + have hlen : (2 * arec_0 + 3) / 4 = arec_0 / 2 := by omega + rw [hlen, rep_snoc, Nat.add_comm 1 (arec_0 / 2)] + have ha2 : 1 + (2 * arec_0 + 3) / 2 - 2 = arec_0 := by omega + rw [hrep2, ha2]; try exact ReachesStar.refl _ _ + +theorem step_leaf_mod4_2 (arec_0 : Nat) (r : List Nat) (h1 : arec_0 % 4 = 2) : + ReachesStar target_tm + (CfgS [] arec_0 (0 :: 1 :: r)) + (CfgT [1] (arec_0 + 4) (0 :: r)) := by + have hev : arec_0 % 2 = 0 := by omega + have hge2 : 2 ≤ arec_0 := by omega + refine (step_even_1 arec_0 r hev hge2).trans ?_ + have hodd1 : (arec_0 - 1) % 4 = 1 := by omega + have hr : (0 :: 1 :: 1 :: r : List Nat) = 0 :: (List.replicate (1 + 1) 1 ++ r) := rfl + rw [hr] + refine (step_odd1_r [1] 0 (arec_0 - 1) 1 r hodd1).trans ?_ + have ha : 0 + (arec_0 - 1) + 2 * 1 + 3 = arec_0 + 4 := by omega + rw [ha]; try exact ReachesStar.refl _ _ + +theorem step_leaf_mod8_0 (arec_0 : Nat) (r : List Nat) (h1 : arec_0 % 8 = 0) (h2 : 8 ≤ arec_0) : + let ah := arec_0 / 2 + ReachesStar target_tm + (CfgS [] arec_0 (0 :: 1 :: r)) + (CfgT [ah + 3] (ah + 2) (0 :: r)) := by + intro ah + have hev : arec_0 % 2 = 0 := by omega + have hge2 : 2 ≤ arec_0 := by omega + refine (step_even_1 arec_0 r hev hge2).trans ?_ + have hodd3 : (arec_0 - 1) % 4 = 3 := by omega + have hge7 : 2 ≤ 0 + (arec_0 - 1) / 2 := by omega + refine (step_odd3_r [1] 0 (arec_0 - 1) (1 :: 1 :: r) hodd3 hge7).trans ?_ + have hrep : List.replicate ((arec_0 - 1) / 4) 1 ++ 1 :: 1 :: r = List.replicate (ah / 2 + 1) 1 ++ r := by + have hlen : (arec_0 - 1) / 4 = ah / 2 - 1 := by omega + rw [hlen, rep_snoc, rep_snoc] + have hadd : 1 + (1 + (ah / 2 - 1)) = ah / 2 + 1 := by omega + rw [hadd] + have ha1 : 0 + (arec_0 - 1) / 2 - 2 = ah - 3 := by omega + rw [hrep, ha1] + have hodd1 : (ah - 3) % 4 = 1 := by omega + have hr : (0 :: 1 :: 2 :: (List.replicate (ah / 2 + 1) 1 ++ r) : List Nat) = + 0 :: (List.replicate (0 + 1) 1 ++ (2 :: (List.replicate (ah / 2 + 1) 1 ++ r))) := rfl + rw [hr] + refine (step_odd1_r [] 1 (ah - 3) 0 (2 :: (List.replicate (ah / 2 + 1) 1 ++ r)) hodd1).trans ?_ + have ha2 : 1 + (ah - 3) + 2 * 0 + 3 = ah + 1 := by omega + rw [ha2] + refine (T_21_lemma (ah / 2 + 1) [] (ah + 1) r).trans ?_ + have ha3 : 2 + (ah + 1) = ah + 3 := by omega + have ha4 : (ah / 2 + 1) * 2 = ah + 2 := by omega + rw [ha3, ha4]; try exact ReachesStar.refl _ _ + +theorem step_up_nil4 (arec_0 q_top : Nat) (l r : List Nat) (h1 : arec_0 % 2 = 0) (h2 : 2 ≤ q_top) : + ReachesStar target_tm + (CfgT l (q_top - 2) (0 :: 2 :: (List.replicate (arec_0 / 2 + 1) 1 ++ 2 :: (List.replicate (arec_0 + 4) 1 ++ r)))) + (CfgT ((arec_0 + 4) :: q_top :: l) (2 * arec_0 + 8) (0 :: r)) := by + refine (T_21_lemma (arec_0 / 2 + 1) l (q_top - 2) (2 :: (List.replicate (arec_0 + 4) 1 ++ r))).trans ?_ + have hq : 2 + (q_top - 2) = q_top := by omega + have ha1 : (arec_0 / 2 + 1) * 2 = arec_0 + 2 := by omega + rw [hq, ha1] + refine (T_21_lemma (arec_0 + 4) (q_top :: l) (arec_0 + 2) r).trans ?_ + have hp : 2 + (arec_0 + 2) = arec_0 + 4 := by omega + have ha2 : (arec_0 + 4) * 2 = 2 * arec_0 + 8 := by omega + rw [hp, ha2]; try exact ReachesStar.refl _ _ + +theorem step_start_loop (arec_0 q_top : Nat) (l : List Nat) (h1 : arec_0 % 2 = 0) (h2 : 2 ≤ q_top) : + ReachesStar target_tm + (CfgT l (q_top - 2) (0 :: 2 :: (List.replicate (arec_0 / 2 + 1) 1 ++ 2 :: (List.replicate (arec_0 + 4) 1 ++ [])))) + (CfgS ((q_top + (2 * arec_0 + 10)) :: l) (arec_0 + 3) [0, 1]) := by + refine (step_up_nil4 arec_0 q_top l [] h1 h2).trans ?_ + have ha1 : 2 * arec_0 + 8 = 1 + (2 * arec_0 + 7) := by omega + rw [ha1] + refine (T_end_lemma ((arec_0 + 4) :: q_top :: l) (2 * arec_0 + 7)).trans ?_ + have hodd3 : (2 * arec_0 + 7) % 4 = 3 := by omega + have hge2 : 2 ≤ (arec_0 + 4) + (2 * arec_0 + 7) / 2 := by omega + refine (step_odd3_r (q_top :: l) (arec_0 + 4) (2 * arec_0 + 7) [1] hodd3 hge2).trans ?_ + have hrep : List.replicate ((2 * arec_0 + 7) / 4) 1 ++ [1] = List.replicate (arec_0 / 2 + 2) 1 ++ [] := by + have hlen : (2 * arec_0 + 7) / 4 = arec_0 / 2 + 1 := by omega + have h1' : ([1] : List Nat) = 1 :: [] := rfl + rw [hlen, h1', rep_snoc] + have hadd : 1 + (arec_0 / 2 + 1) = arec_0 / 2 + 2 := by omega + rw [hadd] + have ha2 : (arec_0 + 4) + (2 * arec_0 + 7) / 2 - 2 = 2 * arec_0 + 5 := by omega + rw [hrep, ha2] + have hodd1 : (2 * arec_0 + 5) % 4 = 1 := by omega + have hr : (0 :: 1 :: 2 :: (List.replicate (arec_0 / 2 + 2) 1 ++ []) : List Nat) = + 0 :: (List.replicate (0 + 1) 1 ++ (2 :: (List.replicate (arec_0 / 2 + 2) 1 ++ []))) := rfl + rw [hr] + refine (step_odd1_r l q_top (2 * arec_0 + 5) 0 (2 :: (List.replicate (arec_0 / 2 + 2) 1 ++ [])) hodd1).trans ?_ + have ha3 : q_top + (2 * arec_0 + 5) + 2 * 0 + 3 = q_top + 2 * arec_0 + 8 := by omega + rw [ha3] + refine (T_21_lemma (arec_0 / 2 + 2) l (q_top + 2 * arec_0 + 8) []).trans ?_ + have hq2 : 2 + (q_top + 2 * arec_0 + 8) = q_top + (2 * arec_0 + 10) := by omega + have ha4 : (arec_0 / 2 + 2) * 2 = 1 + (arec_0 + 3) := by omega + rw [hq2, ha4] + exact T_end_lemma ((q_top + (2 * arec_0 + 10)) :: l) (arec_0 + 3) + +theorem step_down_cons_r (l : List Nat) (x0 fa : Nat) (r : List Nat) (h1 : fa % 4 = 3) (h2 : 2 ≤ x0 + fa / 2) : + ReachesStar target_tm + (CfgS (x0 :: l) fa (0 :: 1 :: r)) + (CfgS l (x0 + fa / 2 - 2) (0 :: 1 :: 2 :: (List.replicate (fa / 4 + 1) 1 ++ r))) := by + refine (step_odd3_r l x0 fa (1 :: r) h1 h2).trans ?_ + rw [rep_snoc, Nat.add_comm 1 (fa / 4)] + try exact ReachesStar.refl _ _ + +theorem step_up_cons_r (fa q_top : Nat) (l_in r : List Nat) (h1 : fa % 4 = 3) (h2 : 2 ≤ q_top) : + ReachesStar target_tm + (CfgT l_in (q_top - 2) (0 :: 2 :: (List.replicate (fa / 4 + 1) 1 ++ r))) + (CfgT (q_top :: l_in) (fa / 2 + 1) (0 :: r)) := by + refine (T_21_lemma (fa / 4 + 1) l_in (q_top - 2) r).trans ?_ + have hq : 2 + (q_top - 2) = q_top := by omega + have ha : (fa / 4 + 1) * 2 = fa / 2 + 1 := by omega + rw [hq, ha]; try exact ReachesStar.refl _ _ + +theorem step_up_walk_odd3 (fa q_top : Nat) (l_in : List Nat) (h1 : fa % 4 = 3) (h2 : 2 ≤ q_top) : + ReachesStar target_tm + (CfgT l_in (q_top - 2) (0 :: 2 :: (List.replicate (fa / 4 + 1) 1 ++ []))) + (CfgS (q_top :: l_in) (fa / 2) [0, 1]) := by + refine (step_up_cons_r fa q_top l_in [] h1 h2).trans ?_ + have ha : fa / 2 + 1 = 1 + fa / 2 := by omega + rw [ha] + exact T_end_lemma (q_top :: l_in) (fa / 2) + +theorem step_cons_mod3_r (l : List Nat) (x0 x1 fa : Nat) (r : List Nat) + (h1 : fa % 4 = 3) (h2 : (x0 + fa / 2) % 4 = 3) : + ReachesStar target_tm + (CfgS (x0 :: x1 :: l) fa (0 :: 1 :: r)) + (CfgT ((x1 + (x0 + fa / 2 + 3)) :: l) (fa / 2 + 1) (0 :: r)) := by + have hge2 : 2 ≤ x0 + fa / 2 := by omega + refine (step_down_cons_r (x1 :: l) x0 fa r h1 hge2).trans ?_ + have hodd1 : (x0 + fa / 2 - 2) % 4 = 1 := by omega + have hr : (0 :: 1 :: 2 :: (List.replicate (fa / 4 + 1) 1 ++ r) : List Nat) = + 0 :: (List.replicate (0 + 1) 1 ++ (2 :: (List.replicate (fa / 4 + 1) 1 ++ r))) := rfl + rw [hr] + refine (step_odd1_r l x1 (x0 + fa / 2 - 2) 0 (2 :: (List.replicate (fa / 4 + 1) 1 ++ r)) hodd1).trans ?_ + have ha1 : x1 + (x0 + fa / 2 - 2) + 2 * 0 + 3 = (x1 + (x0 + fa / 2 + 3)) - 2 := by omega + rw [ha1] + exact step_up_cons_r fa (x1 + (x0 + fa / 2 + 3)) l r h1 (by omega) + +theorem step_walk_odd3_mod3 (l : List Nat) (x0 x1 fa : Nat) + (h1 : fa % 4 = 3) (h2 : (x0 + fa / 2) % 4 = 3) : + ReachesStar target_tm + (CfgS (x0 :: x1 :: l) fa [0, 1]) + (CfgS ((x1 + (x0 + fa / 2 + 3)) :: l) (fa / 2) [0, 1]) := by + refine (step_cons_mod3_r l x0 x1 fa [] h1 h2).trans ?_ + have ha : fa / 2 + 1 = 1 + fa / 2 := by omega + rw [ha] + exact T_end_lemma ((x1 + (x0 + fa / 2 + 3)) :: l) (fa / 2) + +theorem step_plus_6 (m : Nat) (h1 : m % 2 = 0) (h2 : m % 8 ≠ 4) (h3 : 6 ≤ m) : + ReachesStar target_tm (Cn m) (Cn (m + 6)) := by + rcases (by omega : m % 4 = 2 ∨ (m % 8 = 0 ∧ 8 ≤ m)) with hm2 | ⟨hm8, hmge⟩ + · refine (step_leaf_mod4_2 m [] hm2).trans ?_ + have ha1 : m + 4 = 1 + (m + 3) := by omega + rw [ha1] + refine (T_end_lemma [1] (m + 3)).trans ?_ + have hodd : (m + 3) % 4 = 1 := by omega + refine (step_odd1_end [] 1 (m + 3) hodd).trans ?_ + have ha2 : 1 + (m + 3) + 2 = m + 6 := by omega + rw [ha2]; try exact ReachesStar.refl _ _ + · refine (step_leaf_mod8_0 m [] hm8 hmge).trans ?_ + have ha1 : m / 2 + 2 = 1 + (m / 2 + 1) := by omega + rw [ha1] + refine (T_end_lemma [m / 2 + 3] (m / 2 + 1)).trans ?_ + have hodd : (m / 2 + 1) % 4 = 1 := by omega + refine (step_odd1_end [] (m / 2 + 3) (m / 2 + 1) hodd).trans ?_ + have ha2 : (m / 2 + 3) + (m / 2 + 1) + 2 = m + 6 := by omega + rw [ha2]; try exact ReachesStar.refl _ _ + +theorem finish_even_spec (fa_f : Nat) (h1 : fa_f % 2 = 0) (h2 : 6 ≤ fa_f) : + ReachesStar target_tm (Cn fa_f) (Cn (fa_f + 6 * (((fa_f - 4) / 2) % 4))) := by + rcases (by omega : ((fa_f - 4) / 2) % 4 = 0 ∨ ((fa_f - 4) / 2) % 4 = 1 ∨ + ((fa_f - 4) / 2) % 4 = 2 ∨ ((fa_f - 4) / 2) % 4 = 3) with hr0 | hr1 | hr2 | hr3 + · rw [hr0, Nat.mul_zero, Nat.add_zero]; try exact ReachesStar.refl _ _ + · rw [hr1, Nat.mul_one] + exact step_plus_6 fa_f h1 (by omega) h2 + · rw [hr2] + refine (step_plus_6 fa_f h1 (by omega) h2).trans ?_ + exact step_plus_6 (fa_f + 6) (by omega) (by omega) (by omega) + · rw [hr3] + refine (step_plus_6 fa_f h1 (by omega) h2).trans ?_ + refine (step_plus_6 (fa_f + 6) (by omega) (by omega) (by omega)).trans ?_ + exact step_plus_6 (fa_f + 6 + 6) (by omega) (by omega) (by omega) + + +def val (g_f t x w : Nat) : Nat := x + 4 * ((w / g_f) * t) + +theorem dvd_eight_of_dvd (g_f w : Nat) (hg8 : g_f % 8 = 0) (hw : g_f ∣ w) : w % 8 = 0 := by + have h8 : 8 ∣ w := Nat.dvd_trans (Nat.dvd_of_mod_eq_zero hg8) hw + exact Nat.mod_eq_zero_of_dvd h8 + +theorem val_mod2 (g_f t x w : Nat) : (val g_f t x w) % 2 = x % 2 := by + dsimp [val]; omega + +theorem val_mod4 (g_f t x w : Nat) : (val g_f t x w) % 4 = x % 4 := by + dsimp [val]; omega + +theorem val_mod8 (g_f t x w : Nat) (hg0 : 0 < g_f) (hg8 : g_f % 8 = 0) + (hw : g_f ∣ w) (hw2 : g_f ∣ (w / 2)) : + (val g_f t x w) % 8 = x % 8 := by + have hw8 := dvd_eight_of_dvd g_f w hg8 hw + have hw_eq : w = 2 * (w / 2) := by omega + rcases hw2 with ⟨k, hk⟩ + have hweq : w = g_f * (2 * k) := by rw [hw_eq, hk]; ring + have hdiv : w / g_f = 2 * k := by rw [hweq, Nat.mul_div_right _ hg0] + dsimp [val] + rw [hdiv] + have hring : 4 * ((2 * k) * t) = 8 * (k * t) := by ring + rw [hring] + omega + +theorem val_add (g_f t x1 w1 x2 w2 : Nat) (hg0 : 0 < g_f) (hw1 : g_f ∣ w1) (hw2 : g_f ∣ w2) : + val g_f t (x1 + x2) (w1 + w2) = val g_f t x1 w1 + val g_f t x2 w2 := by + rcases hw1 with ⟨k1, rfl⟩ + rcases hw2 with ⟨k2, rfl⟩ + have hsum : g_f * k1 + g_f * k2 = g_f * (k1 + k2) := by ring + dsimp [val] + rw [hsum, Nat.mul_div_right _ hg0, Nat.mul_div_right _ hg0, Nat.mul_div_right _ hg0] + ring + +theorem val_div2 (g_f t x w : Nat) (hg0 : 0 < g_f) (hg8 : g_f % 8 = 0) + (hw : g_f ∣ w) (hw2 : g_f ∣ (w / 2)) : + (val g_f t x w) / 2 = val g_f t (x / 2) (w / 2) := by + have hw8 := dvd_eight_of_dvd g_f w hg8 hw + have hw_eq : w = 2 * (w / 2) := by omega + rcases hw2 with ⟨k, hk⟩ + have hweq : w = g_f * (2 * k) := by rw [hw_eq, hk]; ring + have hdiv1 : w / g_f = 2 * k := by rw [hweq, Nat.mul_div_right _ hg0] + have hdiv2 : (w / 2) / g_f = k := by rw [hk, Nat.mul_div_right _ hg0] + dsimp [val] + rw [hdiv1, hdiv2] + have hring : 4 * ((2 * k) * t) = 2 * (4 * (k * t)) := by ring + rw [hring] + omega + +theorem val_div4 (g_f t x w : Nat) (hg0 : 0 < g_f) (hg8 : g_f % 8 = 0) + (hw : g_f ∣ w) (hw4 : g_f ∣ (w / 4)) : + (val g_f t x w) / 4 = val g_f t (x / 4) (w / 4) := by + have hw8 := dvd_eight_of_dvd g_f w hg8 hw + have hw_eq : w = 4 * (w / 4) := by omega + rcases hw4 with ⟨k, hk⟩ + have hweq : w = g_f * (4 * k) := by rw [hw_eq, hk]; ring + have hdiv1 : w / g_f = 4 * k := by rw [hweq, Nat.mul_div_right _ hg0] + have hdiv4 : (w / 4) / g_f = k := by rw [hk, Nat.mul_div_right _ hg0] + dsimp [val] + rw [hdiv1, hdiv4] + have hring : 4 * ((4 * k) * t) = 4 * (4 * (k * t)) := by ring + rw [hring] + omega + +theorem dvd_half_of_dvd_qtr (g_f w : Nat) (hg8 : g_f % 8 = 0) + (hw : g_f ∣ w) (hw4 : g_f ∣ (w / 4)) : g_f ∣ (w / 2) := by + have hw8 := dvd_eight_of_dvd g_f w hg8 hw + have hw_eq : w / 2 = 2 * (w / 4) := by omega + rcases hw4 with ⟨k, hk⟩ + refine ⟨2 * k, ?_⟩ + rw [hw_eq, hk]; ring + +theorem val_ge (g_f t x w : Nat) : x ≤ val g_f t x w := by + dsimp [val]; omega + +theorem val_add_const (g_f t x c w : Nat) : val g_f t (x + c) w = val g_f t x w + c := by + dsimp [val]; omega + +theorem val_sub_const (g_f t x c w : Nat) (h : c ≤ x) : val g_f t (x - c) w = val g_f t x w - c := by + dsimp [val]; omega + +theorem val_mul2 (g_f t x w : Nat) (hg0 : 0 < g_f) (hg8 : g_f % 8 = 0) + (hw : g_f ∣ w) (hw2 : g_f ∣ (w / 2)) (hx : x % 2 = 0) : + 2 * val g_f t (x / 2) (w / 2) = val g_f t x w := by + have h := val_div2 g_f t x w hg0 hg8 hw hw2 + have hm := val_mod2 g_f t x w + omega + +theorem val_2mul (g_f t x w : Nat) (hg0 : 0 < g_f) (hg8 : g_f % 8 = 0) + (hw : g_f ∣ w) (hw2 : g_f ∣ (w / 2)) : + 2 * val g_f t x (w / 2) = val g_f t (2 * x) w := by + have hw8 := dvd_eight_of_dvd g_f w hg8 hw + have hw_eq : w = 2 * (w / 2) := by omega + rcases hw2 with ⟨k, hk⟩ + have hweq : w = g_f * (2 * k) := by rw [hw_eq, hk]; ring + have hdiv1 : w / g_f = 2 * k := by rw [hweq, Nat.mul_div_right _ hg0] + have hdiv2 : (w / 2) / g_f = k := by rw [hk, Nat.mul_div_right _ hg0] + dsimp [val] + rw [hdiv1, hdiv2] + ring + +theorem div_2_2_eq_div_4 (w : Nat) : w / 2 / 2 = w / 4 := by omega + +theorem val_step_down_nil4 (g_f t fa w : Nat) (r : List Nat) + (hg0 : 0 < g_f) (hg8 : g_f % 8 = 0) (hw : g_f ∣ w) (hwq : g_f ∣ (w / 2 / 2)) + (h1 : fa % 8 = 4) (h2 : 12 ≤ fa) : + let arec_0 := fa / 4 - 3 + let w_qtr := w / 2 / 2 + let AREC := val g_f t arec_0 w_qtr + ReachesStar target_tm + (CfgS [] (val g_f t fa w) (0 :: 1 :: r)) + (CfgS [] AREC (0 :: 1 :: 2 :: (List.replicate (AREC / 2 + 1) 1 ++ 2 :: (List.replicate (AREC + 4) 1 ++ r)))) := by + intro arec_0 w_qtr AREC + have hw4 : g_f ∣ (w / 4) := by rw [← div_2_2_eq_div_4]; exact hwq + have hwh : g_f ∣ (w / 2) := dvd_half_of_dvd_qtr g_f w hg8 hw hw4 + have hm8 : (val g_f t fa w) % 8 = 4 := by rw [val_mod8 g_f t fa w hg0 hg8 hw hwh, h1] + have hge12 : 12 ≤ val g_f t fa w := by have := val_ge g_f t fa w; omega + have h := step_down_nil4 (val g_f t fa w) r hm8 hge12 + dsimp only at h + have harec : (val g_f t fa w) / 4 - 3 = AREC := by + dsimp [AREC, arec_0, w_qtr] + rw [div_2_2_eq_div_4, val_div4 g_f t fa w hg0 hg8 hw hw4, val_sub_const _ _ _ _ _ (by omega)] + rw [harec] at h + exact h + +theorem val_step_leaf_mod4_2 (g_f t arec_0 w_qtr : Nat) (r : List Nat) + (h1 : arec_0 % 4 = 2) : + ReachesStar target_tm + (CfgS [] (val g_f t arec_0 w_qtr) (0 :: 1 :: r)) + (CfgT [val g_f t 1 0] (val g_f t (arec_0 + 6) w_qtr - 2) (0 :: r)) := by + have hm4 : (val g_f t arec_0 w_qtr) % 4 = 2 := by rw [val_mod4, h1] + have h := step_leaf_mod4_2 (val g_f t arec_0 w_qtr) r hm4 + have h1_0 : val g_f t 1 0 = 1 := by dsimp [val]; simp + have ha : val g_f t arec_0 w_qtr + 4 = val g_f t (arec_0 + 6) w_qtr - 2 := by dsimp [val]; omega + rw [h1_0, ← ha] + exact h + +theorem val_step_leaf_mod8_0 (g_f t arec_0 w_qtr : Nat) (r : List Nat) + (hg0 : 0 < g_f) (hg8 : g_f % 8 = 0) (hwq : g_f ∣ w_qtr) (hwqh : g_f ∣ (w_qtr / 2)) + (h1 : arec_0 % 8 = 0) (h2 : 8 ≤ arec_0) : + let ah := arec_0 / 2 + let wq_h := w_qtr / 2 + ReachesStar target_tm + (CfgS [] (val g_f t arec_0 w_qtr) (0 :: 1 :: r)) + (CfgT [val g_f t (ah + 3) wq_h] (val g_f t (ah + 4) wq_h - 2) (0 :: r)) := by + intro ah wq_h + have hm8 : (val g_f t arec_0 w_qtr) % 8 = 0 := by rw [val_mod8 g_f t arec_0 w_qtr hg0 hg8 hwq hwqh, h1] + have hge8 : 8 ≤ val g_f t arec_0 w_qtr := by have := val_ge g_f t arec_0 w_qtr; omega + have h := step_leaf_mod8_0 (val g_f t arec_0 w_qtr) r hm8 hge8 + dsimp only at h + have hah : (val g_f t arec_0 w_qtr) / 2 = val g_f t ah wq_h := val_div2 g_f t arec_0 w_qtr hg0 hg8 hwq hwqh + have ha1 : val g_f t ah wq_h + 3 = val g_f t (ah + 3) wq_h := by dsimp [val]; omega + have ha2 : val g_f t ah wq_h + 2 = val g_f t (ah + 4) wq_h - 2 := by dsimp [val]; omega + rw [hah, ha1, ha2] at h + exact h + +theorem val_step_up_nil4 (g_f t arec_0 w_half q_top w_qtop : Nat) (l r : List Nat) + (hg0 : 0 < g_f) (hg8 : g_f % 8 = 0) (hwh : g_f ∣ w_half) (hwq : g_f ∣ (w_half / 2)) + (h1 : arec_0 % 2 = 0) (h2 : 2 ≤ q_top) : + let w_qtr := w_half / 2 + let AREC := val g_f t arec_0 w_qtr + let QTOP := val g_f t q_top w_qtop + ReachesStar target_tm + (CfgT l (QTOP - 2) (0 :: 2 :: (List.replicate (AREC / 2 + 1) 1 ++ 2 :: (List.replicate (AREC + 4) 1 ++ r)))) + (CfgT (val g_f t (arec_0 + 4) w_qtr :: QTOP :: l) (val g_f t (2 * arec_0 + 10) w_half - 2) (0 :: r)) := by + intro w_qtr AREC QTOP + have hm2 : AREC % 2 = 0 := by dsimp [AREC]; rw [val_mod2, h1] + have hq2 : 2 ≤ QTOP := by dsimp [QTOP]; have := val_ge g_f t q_top w_qtop; omega + have h := step_up_nil4 AREC QTOP l r hm2 hq2 + have hpo : AREC + 4 = val g_f t (arec_0 + 4) w_qtr := by dsimp [AREC, val]; omega + have hpt : 2 * AREC + 8 = val g_f t (2 * arec_0 + 10) w_half - 2 := by + have hmul := val_2mul g_f t arec_0 w_half hg0 hg8 hwh hwq + have hadd10 : val g_f t (2 * arec_0 + 10) w_half = val g_f t (2 * arec_0) w_half + 10 := by dsimp [val]; omega + dsimp [AREC, w_qtr] + omega + refine h.trans ?_ + rw [hpo, hpt] + try exact ReachesStar.refl _ _ + +theorem val_step_start_loop (g_f t arec_0 wQtr wHalf q_top w_qtop : Nat) (l : List Nat) + (hg0 : 0 < g_f) (hg8 : g_f % 8 = 0) (hwH : g_f ∣ wHalf) (hwQ : g_f ∣ wQtr) (hwqt : g_f ∣ w_qtop) + (hWQ : wQtr = wHalf / 2) (h1 : arec_0 % 2 = 0) (h2 : 2 ≤ q_top) : + let AREC := val g_f t arec_0 wQtr + let QTOP := val g_f t q_top w_qtop + ReachesStar target_tm + (CfgT l (QTOP - 2) (0 :: 2 :: (List.replicate (AREC / 2 + 1) 1 ++ 2 :: (List.replicate (AREC + 4) 1 ++ [])))) + (CfgS (val g_f t (q_top + (2 * arec_0 + 10)) (w_qtop + wHalf) :: l) (val g_f t (arec_0 + 3) wQtr) [0, 1]) := by + intro AREC QTOP + have hm2 : AREC % 2 = 0 := by dsimp [AREC]; rw [val_mod2, h1] + have hq2 : 2 ≤ QTOP := by dsimp [QTOP]; have := val_ge g_f t q_top w_qtop; omega + have h := step_start_loop AREC QTOP l hm2 hq2 + have hx0 : QTOP + (2 * AREC + 10) = val g_f t (q_top + (2 * arec_0 + 10)) (w_qtop + wHalf) := by + rw [val_add g_f t q_top w_qtop (2 * arec_0 + 10) wHalf hg0 hwqt hwH] + have hmul := val_2mul g_f t arec_0 wHalf hg0 hg8 hwH (by rw [← hWQ]; exact hwQ) + dsimp [QTOP, AREC] + rw [hWQ] + have hadd10 : val g_f t (2 * arec_0 + 10) wHalf = val g_f t (2 * arec_0) wHalf + 10 := by dsimp [val]; omega + omega + have hfa : AREC + 3 = val g_f t (arec_0 + 3) wQtr := by dsimp [AREC, val]; omega + rw [hx0, hfa] at h + exact h + +theorem val_step_down_cons_r (g_f t x0 w_x fa w : Nat) (l r : List Nat) + (hg0 : 0 < g_f) (hg8 : g_f % 8 = 0) (hwx : g_f ∣ w_x) (hw : g_f ∣ w) (hwh : g_f ∣ (w / 2)) + (h1 : fa % 4 = 3) (h2 : 2 ≤ x0 + fa / 2) : + let FA := val g_f t fa w + ReachesStar target_tm + (CfgS (val g_f t x0 w_x :: l) FA (0 :: 1 :: r)) + (CfgS l (val g_f t (x0 + fa / 2 - 2) (w_x + w / 2)) (0 :: 1 :: 2 :: (List.replicate (FA / 4 + 1) 1 ++ r))) := by + intro FA + have hm4 : FA % 4 = 3 := by dsimp [FA]; rw [val_mod4, h1] + have hdiv2 : FA / 2 = val g_f t (fa / 2) (w / 2) := val_div2 g_f t fa w hg0 hg8 hw hwh + have hge2 : 2 ≤ val g_f t x0 w_x + FA / 2 := by + rw [hdiv2]; have := val_ge g_f t x0 w_x; have := val_ge g_f t (fa / 2) (w / 2); omega + have h := step_down_cons_r l (val g_f t x0 w_x) FA r hm4 hge2 + have ha : val g_f t x0 w_x + FA / 2 - 2 = val g_f t (x0 + fa / 2 - 2) (w_x + w / 2) := by + rw [hdiv2, ← val_add g_f t x0 w_x (fa / 2) (w / 2) hg0 hwx hwh, val_sub_const _ _ _ _ _ h2] + rw [ha] at h + exact h + +theorem val_step_up_cons_r (g_f t fa w q_top w_qtop : Nat) (l_in r : List Nat) + (hg0 : 0 < g_f) (hg8 : g_f % 8 = 0) (hw : g_f ∣ w) (hwh : g_f ∣ (w / 2)) + (h1 : fa % 4 = 3) (h2 : 2 ≤ q_top) : + let FA := val g_f t fa w + let QTOP := val g_f t q_top w_qtop + ReachesStar target_tm + (CfgT l_in (QTOP - 2) (0 :: 2 :: (List.replicate (FA / 4 + 1) 1 ++ r))) + (CfgT (QTOP :: l_in) (val g_f t (fa / 2 + 3) (w / 2) - 2) (0 :: r)) := by + intro FA QTOP + have hm4 : FA % 4 = 3 := by dsimp [FA]; rw [val_mod4, h1] + have hq2 : 2 ≤ QTOP := by dsimp [QTOP]; have := val_ge g_f t q_top w_qtop; omega + have h := step_up_cons_r FA QTOP l_in r hm4 hq2 + have hdiv2 : FA / 2 = val g_f t (fa / 2) (w / 2) := val_div2 g_f t fa w hg0 hg8 hw hwh + have ha : FA / 2 + 1 = val g_f t (fa / 2 + 3) (w / 2) - 2 := by + rw [hdiv2]; dsimp [val]; omega + rw [ha] at h + exact h + +theorem val_step_up_walk_odd3 (g_f t fa w q_top w_qtop : Nat) (l_in : List Nat) + (hg0 : 0 < g_f) (hg8 : g_f % 8 = 0) (hw : g_f ∣ w) (hwh : g_f ∣ (w / 2)) + (h1 : fa % 4 = 3) (h2 : 2 ≤ q_top) : + let FA := val g_f t fa w + let QTOP := val g_f t q_top w_qtop + ReachesStar target_tm + (CfgT l_in (QTOP - 2) (0 :: 2 :: (List.replicate (FA / 4 + 1) 1 ++ []))) + (CfgS (QTOP :: l_in) (val g_f t (fa / 2) (w / 2)) [0, 1]) := by + intro FA QTOP + have hm4 : FA % 4 = 3 := by dsimp [FA]; rw [val_mod4, h1] + have hq2 : 2 ≤ QTOP := by dsimp [QTOP]; have := val_ge g_f t q_top w_qtop; omega + have h := step_up_walk_odd3 FA QTOP l_in hm4 hq2 + have hdiv2 : FA / 2 = val g_f t (fa / 2) (w / 2) := val_div2 g_f t fa w hg0 hg8 hw hwh + rw [hdiv2] at h + exact h + +theorem val_step_cons_mod3_r (g_f t x0 w_x x1 w_x1 fa w : Nat) (l r : List Nat) + (hg0 : 0 < g_f) (hg8 : g_f % 8 = 0) (hwx : g_f ∣ w_x) (hwx1 : g_f ∣ w_x1) (hw : g_f ∣ w) (hwh : g_f ∣ (w / 2)) + (h1 : fa % 4 = 3) (h2 : (x0 + fa / 2) % 4 = 3) : + ReachesStar target_tm + (CfgS (val g_f t x0 w_x :: val g_f t x1 w_x1 :: l) (val g_f t fa w) (0 :: 1 :: r)) + (CfgT (val g_f t (x1 + (x0 + fa / 2 + 3)) (w_x1 + (w_x + w / 2)) :: l) (val g_f t (fa / 2 + 3) (w / 2) - 2) (0 :: r)) := by + have hm4_1 : (val g_f t fa w) % 4 = 3 := by rw [val_mod4, h1] + have hdiv2 : (val g_f t fa w) / 2 = val g_f t (fa / 2) (w / 2) := val_div2 g_f t fa w hg0 hg8 hw hwh + have hrec : val g_f t x0 w_x + (val g_f t fa w) / 2 = val g_f t (x0 + fa / 2) (w_x + w / 2) := by + rw [hdiv2, ← val_add g_f t x0 w_x (fa / 2) (w / 2) hg0 hwx hwh] + have hm4_2 : (val g_f t x0 w_x + (val g_f t fa w) / 2) % 4 = 3 := by + rw [hrec, val_mod4, h2] + have h := step_cons_mod3_r l (val g_f t x0 w_x) (val g_f t x1 w_x1) (val g_f t fa w) r hm4_1 hm4_2 + have hx_new : val g_f t x1 w_x1 + (val g_f t x0 w_x + (val g_f t fa w) / 2 + 3) = + val g_f t (x1 + (x0 + fa / 2 + 3)) (w_x1 + (w_x + w / 2)) := by + rw [hrec, ← val_add_const g_f t (x0 + fa / 2) 3 (w_x + w / 2), + ← val_add g_f t x1 w_x1 (x0 + fa / 2 + 3) (w_x + w / 2) hg0 hwx1 (Nat.dvd_add hwx hwh)] + have ha_new : (val g_f t fa w) / 2 + 1 = val g_f t (fa / 2 + 3) (w / 2) - 2 := by + rw [hdiv2]; dsimp [val]; omega + refine h.trans ?_ + rw [hx_new, ha_new] + try exact ReachesStar.refl _ _ + +theorem val_step_walk_odd3_mod3 (g_f t x0 w_x x1 w_x1 fa w : Nat) (l : List Nat) + (hg0 : 0 < g_f) (hg8 : g_f % 8 = 0) (hwx : g_f ∣ w_x) (hwx1 : g_f ∣ w_x1) (hw : g_f ∣ w) (hwh : g_f ∣ (w / 2)) + (h1 : fa % 4 = 3) (h2 : (x0 + fa / 2) % 4 = 3) : + ReachesStar target_tm + (CfgS (val g_f t x0 w_x :: val g_f t x1 w_x1 :: l) (val g_f t fa w) [0, 1]) + (CfgS (val g_f t (x1 + (x0 + fa / 2 + 3)) (w_x1 + (w_x + w / 2)) :: l) (val g_f t (fa / 2) (w / 2)) [0, 1]) := by + refine (val_step_cons_mod3_r g_f t x0 w_x x1 w_x1 fa w l [] hg0 hg8 hwx hwx1 hw hwh h1 h2).trans ?_ + have ha : val g_f t (fa / 2 + 3) (w / 2) - 2 = 1 + val g_f t (fa / 2) (w / 2) := by dsimp [val]; omega + rw [ha] + exact T_end_lemma _ _ + +theorem val_step_odd1_end (g_f t x0 w_x fa w : Nat) (l : List Nat) + (hg0 : 0 < g_f) (hwx : g_f ∣ w_x) (hw : g_f ∣ w) (h1 : fa % 4 = 1) : + ReachesStar target_tm + (CfgS (val g_f t x0 w_x :: l) (val g_f t fa w) [0, 1]) + (CfgS l (val g_f t (x0 + (fa + 2)) (w_x + w)) [0, 1]) := by + have hm4 : (val g_f t fa w) % 4 = 1 := by rw [val_mod4, h1] + have h := step_odd1_end l (val g_f t x0 w_x) (val g_f t fa w) hm4 + have ha : val g_f t x0 w_x + val g_f t fa w + 2 = val g_f t (x0 + (fa + 2)) (w_x + w) := by + rw [val_add g_f t x0 w_x (fa + 2) w hg0 hwx hw] + dsimp [val]; omega + rw [ha] at h + exact h + + +def valid (rb rs rd : Nat) : Prop := + ∀ t, ReachesStar target_tm (Cn (rb + rs * t)) (Cn (rb + rd + rs * t)) + +inductive LList where + | nil : LList + | cons : Nat → Nat → LList → LList + +inductive InnRes where + | none : InnRes + | some : Nat → Nat → Nat → LList → InnRes + +def excNil4Leaf8Aux (p_top w_half po_0 w_qtr g ah wq_h : Nat) : InnRes := + InnRes.some (Nat.gcd g wq_h) p_top w_half + (LList.cons po_0 w_qtr (LList.cons (Nat.add ah 4) wq_h (LList.cons (Nat.add ah 3) wq_h LList.nil))) + +def excNil4Leaf8 (p_top w_half po_0 w_qtr arec_0 g : Nat) : InnRes := + Bool.rec + InnRes.none + (excNil4Leaf8Aux p_top w_half po_0 w_qtr g (Nat.div arec_0 2) (Nat.div w_qtr 2)) + (Nat.ble 8 arec_0) + +def excNilRecWrapSome (p_top w_half po_0 w_qtr g_out q_top w_qtop : Nat) (l_inner : LList) : InnRes := + InnRes.some g_out p_top w_half (LList.cons po_0 w_qtr (LList.cons q_top w_qtop l_inner)) + +def excNilRecWrap (p_top w_half po_0 w_qtr : Nat) (res : InnRes) : InnRes := + InnRes.rec InnRes.none (excNilRecWrapSome p_top w_half po_0 w_qtr) res + +def excNil4StepAux2 (ih : Nat → Nat → Nat → InnRes) (g w_half arec_0 w_qtr p_top po_0 : Nat) : InnRes := + Bool.rec + (Bool.rec + (excNilRecWrap p_top w_half po_0 w_qtr (ih arec_0 w_qtr (Nat.gcd g w_qtr))) + (excNil4Leaf8 p_top w_half po_0 w_qtr arec_0 g) + (Nat.beq (Nat.mod arec_0 8) 0)) + (InnRes.some (Nat.gcd g w_qtr) p_top w_half + (LList.cons po_0 w_qtr (LList.cons (Nat.add arec_0 6) w_qtr (LList.cons 1 0 LList.nil)))) + (Nat.beq (Nat.mod arec_0 4) 2) + +def excNil4StepAux1 (ih : Nat → Nat → Nat → InnRes) (g arec_0 w_half : Nat) : InnRes := + excNil4StepAux2 ih g w_half arec_0 (Nat.div w_half 2) (Nat.add (Nat.mul 2 arec_0) 10) (Nat.add arec_0 4) + +def excNil4Step (_ : Nat) (ih : Nat → Nat → Nat → InnRes) (fa w g : Nat) : InnRes := + Bool.rec + InnRes.none + (excNil4StepAux1 ih g (Nat.sub (Nat.div fa 4) 3) (Nat.div w 2)) + (Bool.and (Nat.ble 12 fa) (Nat.beq (Nat.mod fa 8) 4)) + +def excNilBase (_ _ _ : Nat) : InnRes := InnRes.none + +def excNil4 (fuel fa w g : Nat) : InnRes := + Nat.rec excNilBase excNil4Step fuel fa w g + +def excConsWrapSome (p_top w_half g_out q_top w_qtop : Nat) (l_inner : LList) : InnRes := + InnRes.some g_out p_top w_half (LList.cons q_top w_qtop l_inner) + +def excConsWrap (p_top w_half : Nat) (res : InnRes) : InnRes := + InnRes.rec InnRes.none (excConsWrapSome p_top w_half) res + +def excConsNilLeaf8Aux (p_top w_half g ah wr_h : Nat) : InnRes := + InnRes.some (Nat.gcd g wr_h) p_top w_half (LList.cons (Nat.add ah 4) wr_h (LList.cons (Nat.add ah 3) wr_h LList.nil)) + +def excConsNilLeaf8 (p_top w_half arec_0 w_rec g : Nat) : InnRes := + Bool.rec + InnRes.none + (excConsNilLeaf8Aux p_top w_half g (Nat.div arec_0 2) (Nat.div w_rec 2)) + (Nat.ble 8 arec_0) + +def excConsNilBody2 (w_half g w_rec p_top arec_0 : Nat) : InnRes := + Bool.rec + (Bool.rec + (excConsWrap p_top w_half (excNil4 20 arec_0 w_rec (Nat.gcd g w_half))) + (excConsNilLeaf8 p_top w_half arec_0 w_rec (Nat.gcd g w_half)) + (Nat.beq (Nat.mod arec_0 8) 0)) + (InnRes.some (Nat.gcd g w_half) p_top w_half (LList.cons (Nat.add arec_0 6) w_rec (LList.cons 1 0 LList.nil))) + (Nat.beq (Nat.mod arec_0 4) 2) + +def excConsNilBody1 (fa_half x2n1 w_x w_half : Nat) (g : Nat) : InnRes := + Bool.rec + InnRes.none + (excConsNilBody2 w_half g (Nat.add w_x w_half) (Nat.add fa_half 3) (Nat.sub x2n1 2)) + (Nat.ble 2 x2n1) + +def excConsNilAux (x0_0 w_x g fa_half w_half : Nat) : InnRes := + excConsNilBody1 fa_half (Nat.add x0_0 fa_half) w_x w_half g + +def excConsNil (x0_0 w_x fa w g : Nat) : InnRes := + excConsNilAux x0_0 w_x g (Nat.div fa 2) (Nat.div w 2) + +def excConsStepAux2 (x1_0 w_x1 : Nat) (l_rest2 : LList) (ih : Nat → Nat → Nat → Nat → Nat → InnRes) + (fa_half x2n1 w_half g1 w_rec : Nat) : InnRes := + Bool.rec + (Bool.rec + InnRes.none + (excConsWrap (Nat.add fa_half 3) w_half (ih x1_0 w_x1 (Nat.sub x2n1 2) w_rec g1)) + (Nat.ble 5 x2n1)) + (InnRes.some g1 (Nat.add fa_half 3) w_half + (LList.cons (Nat.add x1_0 (Nat.add x2n1 3)) (Nat.add w_x1 w_rec) l_rest2)) + (Nat.beq (Nat.mod x2n1 4) 3) + +def excConsStepAux1 (x1_0 w_x1 : Nat) (l_rest2 : LList) (ih : Nat → Nat → Nat → Nat → Nat → InnRes) + (x0_0 w_x g fa_half w_half : Nat) : InnRes := + excConsStepAux2 x1_0 w_x1 l_rest2 ih fa_half (Nat.add x0_0 fa_half) w_half (Nat.gcd g w_half) (Nat.add w_x w_half) + +def excConsStep (x1_0 w_x1 : Nat) (l_rest2 : LList) (ih : Nat → Nat → Nat → Nat → Nat → InnRes) + (x0_0 w_x fa w g : Nat) : InnRes := + excConsStepAux1 x1_0 w_x1 l_rest2 ih x0_0 w_x g (Nat.div fa 2) (Nat.div w 2) + +def excCons (l_rest : LList) (x0_0 w_x fa w g : Nat) : InnRes := + LList.rec excConsNil excConsStep l_rest x0_0 w_x fa w g + +inductive CmpRule where + | none : CmpRule + | some : Nat → Nat → CmpRule + +def sInit : Nat := 1099511627776 +def sInit4 : Nat := 4398046511104 + +def finishRule (n_orig fa g : Nat) : CmpRule := + Bool.rec + CmpRule.none + (CmpRule.some (Nat.div sInit4 g) + (Nat.sub (Nat.add fa (Nat.mul 6 (Nat.mod (Nat.div (Nat.sub fa 4) 2) 4))) n_orig)) + (Bool.and (Nat.ble (Nat.add n_orig 1) fa) (Bool.and (Nat.ble 8 g) (Nat.beq (Nat.mod g 8) 0))) + +def walkCallUnified (ih_compile : Nat → Nat → LList → Nat → Nat → Nat → CmpRule) + (fa_half w_half g_out q_top w_qtop : Nat) (l_inner : LList) : CmpRule := + ih_compile q_top w_qtop l_inner fa_half w_half g_out + +def walkNil (n_orig : Nat) (x0_0 _ fa _ g : Nat) : CmpRule := + Bool.rec + CmpRule.none + (finishRule n_orig (Nat.add x0_0 (Nat.add fa 2)) g) + (Nat.beq (Nat.mod fa 4) 1) + +def walkConsOdd3Aux2 (ih_compile : Nat → Nat → LList → Nat → Nat → Nat → CmpRule) + (x1_0 w_x1 : Nat) (l_rest2 : LList) (ih_walk : Nat → Nat → Nat → Nat → Nat → CmpRule) + (fa_half x2n1 w_half g1 w_rec : Nat) : CmpRule := + Bool.rec + (Bool.rec + CmpRule.none + (InnRes.rec CmpRule.none (walkCallUnified ih_compile fa_half w_half) + (excCons l_rest2 x1_0 w_x1 (Nat.sub x2n1 2) w_rec g1)) + (Nat.ble 5 x2n1)) + (ih_walk (Nat.add x1_0 (Nat.add x2n1 3)) (Nat.add w_x1 w_rec) fa_half w_half g1) + (Nat.beq (Nat.mod x2n1 4) 3) + +def walkConsOdd3Aux1 (ih_compile : Nat → Nat → LList → Nat → Nat → Nat → CmpRule) + (x1_0 w_x1 : Nat) (l_rest2 : LList) (ih_walk : Nat → Nat → Nat → Nat → Nat → CmpRule) + (x0_0 w_x g fa_half w_half : Nat) : CmpRule := + walkConsOdd3Aux2 ih_compile x1_0 w_x1 l_rest2 ih_walk fa_half (Nat.add x0_0 fa_half) w_half (Nat.gcd g w_half) (Nat.add w_x w_half) + +def walkConsOdd3 (ih_compile : Nat → Nat → LList → Nat → Nat → Nat → CmpRule) + (x1_0 w_x1 : Nat) (l_rest2 : LList) (ih_walk : Nat → Nat → Nat → Nat → Nat → CmpRule) + (x0_0 w_x fa w g : Nat) : CmpRule := + walkConsOdd3Aux1 ih_compile x1_0 w_x1 l_rest2 ih_walk x0_0 w_x g (Nat.div fa 2) (Nat.div w 2) + +def walkCons (ih_compile : Nat → Nat → LList → Nat → Nat → Nat → CmpRule) + (x1_0 w_x1 : Nat) (l_rest2 : LList) (ih_walk : Nat → Nat → Nat → Nat → Nat → CmpRule) + (x0_0 w_x fa w g : Nat) : CmpRule := + Bool.rec + (Bool.rec + CmpRule.none + (walkConsOdd3 ih_compile x1_0 w_x1 l_rest2 ih_walk x0_0 w_x fa w g) + (Nat.beq (Nat.mod fa 4) 3)) + (ih_walk x1_0 w_x1 (Nat.add x0_0 (Nat.add fa 2)) (Nat.add w_x w) g) + (Nat.beq (Nat.mod fa 4) 1) + +def compileStep (n_orig : Nat) (_ : Nat) (ih : Nat → Nat → LList → Nat → Nat → Nat → CmpRule) + (x0_0 w_x : Nat) (l_rest : LList) (fa w g : Nat) : CmpRule := + LList.rec (walkNil n_orig) (walkCons ih) l_rest x0_0 w_x fa w g + +def compileBase (_ _ : Nat) (_ : LList) (_ _ _ : Nat) : CmpRule := CmpRule.none + +def compileLoop (fuel n_orig x0_0 w_x : Nat) (l_rest : LList) (fa w g : Nat) : CmpRule := + Nat.rec compileBase (compileStep n_orig) fuel x0_0 w_x l_rest fa w g + +def wHalfInit : Nat := 549755813888 +def wQtrInit : Nat := 274877906944 +def wEighthInit : Nat := 137438953472 + +def fastCompileSome (n arec_0 g_out q_top w_qtop : Nat) (l_inner : LList) : CmpRule := + compileLoop 40 n + (Nat.add q_top (Nat.add (Nat.mul 2 arec_0) 10)) + (Nat.add w_qtop wHalfInit) + l_inner + (Nat.add arec_0 3) + wQtrInit + g_out + +def fastCompileLeaf8Aux (n arec_0 ah : Nat) : CmpRule := + fastCompileSome n arec_0 wEighthInit (Nat.add ah 4) wEighthInit (LList.cons (Nat.add ah 3) wEighthInit LList.nil) + +def fastCompileLeaf8 (n arec_0 : Nat) : CmpRule := + Bool.rec + CmpRule.none + (fastCompileLeaf8Aux n arec_0 (Nat.div arec_0 2)) + (Nat.ble 8 arec_0) + +def fastCompileAux (n arec_0 : Nat) : CmpRule := + Bool.rec + (Bool.rec + (InnRes.rec CmpRule.none (fastCompileSome n arec_0) (excNil4 20 arec_0 wQtrInit wQtrInit)) + (fastCompileLeaf8 n arec_0) + (Nat.beq (Nat.mod arec_0 8) 0)) + (fastCompileSome n arec_0 wQtrInit (Nat.add arec_0 6) wQtrInit (LList.cons 1 0 LList.nil)) + (Nat.beq (Nat.mod arec_0 4) 2) + +def fastCompile (n : Nat) : CmpRule := + Bool.rec + CmpRule.none + (fastCompileAux n (Nat.sub (Nat.div n 4) 3)) + (Bool.and (Nat.ble 12 n) (Nat.beq (Nat.mod n 8) 4)) + +-- Specifications and Proofs + +def evalLList (g_f t : Nat) : LList → List Nat + | .nil => [] + | .cons x w l => val g_f t x w :: evalLList g_f t l + +def LList.weightSum : LList → Nat + | .nil => 0 + | .cons _ w l => w + l.weightSum + +def LList.AllDvd (g : Nat) : LList → Prop + | .nil => True + | .cons _ w l => g ∣ w ∧ l.AllDvd g + +def LList.LastOdd : LList → Nat → Prop + | .nil, x0 => x0 % 2 = 1 + | .cons x1 _ l, x0 => x0 % 2 = 0 ∧ l.LastOdd x1 + +theorem LList.AllDvd_mono {g1 g2 : Nat} {l : LList} (h : g1 ∣ g2) (hl : l.AllDvd g2) : l.AllDvd g1 := by + induction l with + | nil => trivial + | cons x w l ih => exact ⟨Nat.dvd_trans h hl.1, ih hl.2⟩ + +theorem LList.LastOdd_add_even (l : LList) (x d : Nat) (h1 : l.LastOdd x) (h2 : d % 2 = 0) : + l.LastOdd (x + d) := by + cases l with + | nil => dsimp [LList.LastOdd] at h1 ⊢; omega + | cons x1 w1 l2 => + rcases h1 with ⟨h1a, h1b⟩ + exact ⟨by omega, h1b⟩ + +@[simp] theorem nat_add_eq (a b : Nat) : Nat.add a b = a + b := rfl +@[simp] theorem nat_sub_eq (a b : Nat) : Nat.sub a b = a - b := rfl +@[simp] theorem nat_mul_eq (a b : Nat) : Nat.mul a b = a * b := rfl +@[simp] theorem nat_div_eq (a b : Nat) : Nat.div a b = a / b := rfl +@[simp] theorem nat_mod_eq (a b : Nat) : Nat.mod a b = a % b := rfl + +theorem excNil4_zero (fa w g : Nat) : excNil4 0 fa w g = .none := rfl +theorem excNil4_succ (fuel fa w g : Nat) : + excNil4 (fuel + 1) fa w g = excNil4Step fuel (excNil4 fuel) fa w g := rfl +theorem excCons_nil (x0_0 w_x fa w g : Nat) : + excCons .nil x0_0 w_x fa w g = excConsNil x0_0 w_x fa w g := rfl +theorem excCons_cons (x1_0 w_x1 : Nat) (l_rest2 : LList) (x0_0 w_x fa w g : Nat) : + excCons (.cons x1_0 w_x1 l_rest2) x0_0 w_x fa w g = + excConsStep x1_0 w_x1 l_rest2 (excCons l_rest2) x0_0 w_x fa w g := rfl + +def InnRes.NilValid (g_f t fa w g : Nat) : InnRes → Prop + | .none => True + | .some g_out q_top w_qtop l_in => + g_out ∣ g ∧ + fa % 2 = 0 ∧ + 2 ≤ q_top ∧ + l_in.LastOdd q_top ∧ + (0 < g_f → g_f % 8 = 0 → g_f ∣ w → g_f ∣ g_out → + g_f ∣ w_qtop ∧ + l_in.AllDvd g_f ∧ + w_qtop + l_in.weightSum = w ∧ + ∀ r, ReachesStar target_tm + (CfgS [] (val g_f t fa w) (0 :: 1 :: r)) + (CfgT (evalLList g_f t l_in) (val g_f t q_top w_qtop - 2) (0 :: r))) + +theorem dvd_of_eq_mul (g a b k : Nat) (h : a = k * b) (hb : g ∣ b) : g ∣ a := by + rcases hb with ⟨m, rfl⟩ + refine ⟨k * m, ?_⟩ + rw [h]; ring + +theorem excNil4_spec (g_f t fuel fa w g : Nat) : + InnRes.NilValid g_f t fa w g (excNil4 fuel fa w g) := by + induction fuel generalizing fa w g with + | zero => trivial + | succ fuel ih => + rw [excNil4_succ] + dsimp only [excNil4Step, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hcond : Bool.and (Nat.ble 12 fa) (Nat.beq (fa % 8) 4) <;> dsimp only [Bool.rec] + · trivial + · rcases Bool.and_eq_true_iff.mp hcond with ⟨hc1, hc2⟩ + have hfa12 : 12 ≤ fa := Nat.le_of_ble_eq_true hc1 + have hfa8 : fa % 8 = 4 := Nat.eq_of_beq_eq_true hc2 + dsimp only [excNil4StepAux1, excNil4StepAux2, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hm4 : Nat.beq ((fa / 4 - 3) % 4) 2 <;> dsimp only [Bool.rec] + · cases hm8 : Nat.beq ((fa / 4 - 3) % 8) 0 <;> dsimp only [Bool.rec] + · have hih := ih (fa / 4 - 3) (w / 2 / 2) (Nat.gcd g (w / 2 / 2)) + cases hres : excNil4 fuel (fa / 4 - 3) (w / 2 / 2) (Nat.gcd g (w / 2 / 2)) with + | none => + dsimp only [excNilRecWrap, InnRes.rec, InnRes.NilValid] + | some g_out q_top w_qtop l_inner => + rw [hres] at hih + dsimp only [excNilRecWrap, InnRes.rec, excNilRecWrapSome, InnRes.NilValid] + rcases hih with ⟨hg_dvd, harec2, hq2, hlo, hih_imp⟩ + rcases Nat.dvd_gcd_iff.mp hg_dvd with ⟨hgo_g, hgo_wq⟩ + refine ⟨hgo_g, by omega, by omega, ⟨by omega, by omega, hlo⟩, ?_⟩ + intro hg0 hg8 hw hgout + have hwq : g_f ∣ (w / 2 / 2) := Nat.dvd_trans hgout hgo_wq + have hwh : g_f ∣ (w / 2) := dvd_half_of_dvd_qtr g_f w hg8 hw (by rw [← div_2_2_eq_div_4]; exact hwq) + rcases hih_imp hg0 hg8 hwq hgout with ⟨hwqt, hall, hsum, hreach⟩ + have hw8 := dvd_eight_of_dvd g_f w hg8 hw + refine ⟨hwh, ⟨hwq, hwqt, hall⟩, ?_, ?_⟩ + · dsimp [LList.weightSum]; omega + · intro r + refine (val_step_down_nil4 g_f t fa w r hg0 hg8 hw hwq hfa8 hfa12).trans ?_ + refine (hreach _).trans ?_ + exact val_step_up_nil4 g_f t (fa / 4 - 3) (w / 2) q_top w_qtop (evalLList g_f t l_inner) r + hg0 hg8 hwh hwq harec2 hq2 + · have harec8 : (fa / 4 - 3) % 8 = 0 := Nat.eq_of_beq_eq_true hm8 + dsimp only [excNil4Leaf8, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hge8 : Nat.ble 8 (fa / 4 - 3) <;> dsimp only [Bool.rec] + · trivial + · have harec_ge8 : 8 ≤ fa / 4 - 3 := Nat.le_of_ble_eq_true hge8 + dsimp only [excNil4Leaf8Aux, InnRes.NilValid, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + refine ⟨Nat.gcd_dvd_left _ _, by omega, by omega, ?_, ?_⟩ + · dsimp [LList.LastOdd]; omega + · intro hg0 hg8 hw hgout + have hwqh : g_f ∣ (w / 2 / 2 / 2) := (Nat.dvd_gcd_iff.mp hgout).2 + have hw8 := dvd_eight_of_dvd g_f w hg8 hw + have hwq : g_f ∣ (w / 2 / 2) := dvd_of_eq_mul g_f (w / 2 / 2) (w / 2 / 2 / 2) 2 (by omega) hwqh + have hwh : g_f ∣ (w / 2) := dvd_of_eq_mul g_f (w / 2) (w / 2 / 2 / 2) 4 (by omega) hwqh + refine ⟨hwh, ⟨hwq, hwqh, hwqh, trivial⟩, ?_, ?_⟩ + · dsimp [LList.weightSum]; omega + · intro r + refine (val_step_down_nil4 g_f t fa w r hg0 hg8 hw hwq hfa8 hfa12).trans ?_ + refine (val_step_leaf_mod8_0 g_f t (fa / 4 - 3) (w / 2 / 2) _ hg0 hg8 hwq hwqh harec8 harec_ge8).trans ?_ + exact val_step_up_nil4 g_f t (fa / 4 - 3) (w / 2) ((fa / 4 - 3) / 2 + 4) (w / 2 / 2 / 2) + [val g_f t ((fa / 4 - 3) / 2 + 3) (w / 2 / 2 / 2)] r + hg0 hg8 hwh hwq (by omega) (by omega) + · have harec4 : (fa / 4 - 3) % 4 = 2 := Nat.eq_of_beq_eq_true hm4 + dsimp only [InnRes.NilValid, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + refine ⟨Nat.gcd_dvd_left _ _, by omega, by omega, ?_, ?_⟩ + · dsimp [LList.LastOdd]; omega + · intro hg0 hg8 hw hgout + have hwq : g_f ∣ (w / 2 / 2) := (Nat.dvd_gcd_iff.mp hgout).2 + have hwh : g_f ∣ (w / 2) := dvd_half_of_dvd_qtr g_f w hg8 hw (by rw [← div_2_2_eq_div_4]; exact hwq) + have hw8 := dvd_eight_of_dvd g_f w hg8 hw + refine ⟨hwh, ⟨hwq, hwq, Nat.dvd_zero g_f, trivial⟩, ?_, ?_⟩ + · dsimp [LList.weightSum]; omega + · intro r + refine (val_step_down_nil4 g_f t fa w r hg0 hg8 hw hwq hfa8 hfa12).trans ?_ + refine (val_step_leaf_mod4_2 g_f t (fa / 4 - 3) (w / 2 / 2) _ harec4).trans ?_ + exact val_step_up_nil4 g_f t (fa / 4 - 3) (w / 2) (fa / 4 - 3 + 6) (w / 2 / 2) + [val g_f t 1 0] r hg0 hg8 hwh hwq (by omega) (by omega) + +def InnRes.ConsValid (g_f t : Nat) (l_rest : LList) (x0_0 w_x fa w g : Nat) : InnRes → Prop + | .none => True + | .some g_out q_top w_qtop l_in => + g_out ∣ g ∧ + 2 ≤ q_top ∧ + l_in.LastOdd q_top ∧ + (0 < g_f → g_f % 8 = 0 → g_f ∣ w_x → l_rest.AllDvd g_f → g_f ∣ w → g_f ∣ g_out → + g_f ∣ w_qtop ∧ + l_in.AllDvd g_f ∧ + w_qtop + l_in.weightSum = w_x + l_rest.weightSum + w ∧ + ∀ r, ReachesStar target_tm + (CfgS (evalLList g_f t (LList.cons x0_0 w_x l_rest)) (val g_f t fa w) (0 :: 1 :: r)) + (CfgT (evalLList g_f t l_in) (val g_f t q_top w_qtop - 2) (0 :: r))) + +theorem excCons_spec (g_f t : Nat) (l_rest : LList) (x0_0 w_x fa w g : Nat) + (hfa : fa % 4 = 3) (hlo : l_rest.LastOdd x0_0) : + InnRes.ConsValid g_f t l_rest x0_0 w_x fa w g (excCons l_rest x0_0 w_x fa w g) := by + induction l_rest generalizing x0_0 w_x fa w g with + | nil => + have hx0 : x0_0 % 2 = 1 := hlo + rw [excCons_nil] + dsimp only [excConsNil, excConsNilAux, excConsNilBody1, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hge2 : Nat.ble 2 (x0_0 + fa / 2) <;> dsimp only [Bool.rec] + · trivial + · have hx2n1_ge2 : 2 ≤ x0_0 + fa / 2 := Nat.le_of_ble_eq_true hge2 + dsimp only [excConsNilBody2, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hm4 : Nat.beq ((x0_0 + fa / 2 - 2) % 4) 2 <;> dsimp only [Bool.rec] + · cases hm8 : Nat.beq ((x0_0 + fa / 2 - 2) % 8) 0 <;> dsimp only [Bool.rec] + · have hnil := excNil4_spec g_f t 20 (x0_0 + fa / 2 - 2) (w_x + w / 2) (Nat.gcd g (w / 2)) + cases hres : excNil4 20 (x0_0 + fa / 2 - 2) (w_x + w / 2) (Nat.gcd g (w / 2)) with + | none => + dsimp only [excConsWrap, InnRes.rec, InnRes.ConsValid] + | some g_out q_top w_qtop l_inner => + rw [hres] at hnil + dsimp only [excConsWrap, InnRes.rec, excConsWrapSome, InnRes.ConsValid] + rcases hnil with ⟨hg_dvd, _, hq2, hlo_in, hnil_imp⟩ + rcases Nat.dvd_gcd_iff.mp hg_dvd with ⟨hgo_g, hgo_wh⟩ + refine ⟨hgo_g, by omega, ⟨by omega, hlo_in⟩, ?_⟩ + intro hg0 hg8 hwx _ hw hgout + have hwh : g_f ∣ (w / 2) := Nat.dvd_trans hgout hgo_wh + have hwrec : g_f ∣ (w_x + w / 2) := Nat.dvd_add hwx hwh + rcases hnil_imp hg0 hg8 hwrec hgout with ⟨hwqt, hall, hsum, hreach⟩ + have hw8 := dvd_eight_of_dvd g_f w hg8 hw + refine ⟨hwh, ⟨hwqt, hall⟩, ?_, ?_⟩ + · dsimp [LList.weightSum]; omega + · intro r + refine (val_step_down_cons_r g_f t x0_0 w_x fa w [] r hg0 hg8 hwx hw hwh hfa hx2n1_ge2).trans ?_ + refine (hreach _).trans ?_ + exact val_step_up_cons_r g_f t fa w q_top w_qtop (evalLList g_f t l_inner) r hg0 hg8 hw hwh hfa hq2 + · have harec8 : (x0_0 + fa / 2 - 2) % 8 = 0 := Nat.eq_of_beq_eq_true hm8 + dsimp only [excConsNilLeaf8, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hge8 : Nat.ble 8 (x0_0 + fa / 2 - 2) <;> dsimp only [Bool.rec] + · trivial + · have harec_ge8 : 8 ≤ x0_0 + fa / 2 - 2 := Nat.le_of_ble_eq_true hge8 + dsimp only [excConsNilLeaf8Aux, InnRes.ConsValid, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + have hg_dvd : Nat.gcd (Nat.gcd g (w / 2)) ((w_x + w / 2) / 2) ∣ g := + Nat.dvd_trans (Nat.gcd_dvd_left _ _) (Nat.gcd_dvd_left _ _) + refine ⟨hg_dvd, by omega, ?_, ?_⟩ + · dsimp [LList.LastOdd]; omega + · intro hg0 hg8 hwx _ hw hgout + rcases Nat.dvd_gcd_iff.mp hgout with ⟨hg1, hwrh⟩ + have hwh : g_f ∣ (w / 2) := (Nat.dvd_gcd_iff.mp hg1).2 + have hwrec : g_f ∣ (w_x + w / 2) := Nat.dvd_add hwx hwh + have hw8 := dvd_eight_of_dvd g_f w hg8 hw + have hwrec8 := dvd_eight_of_dvd g_f (w_x + w / 2) hg8 hwrec + refine ⟨hwh, ⟨hwrh, hwrh, trivial⟩, ?_, ?_⟩ + · dsimp [LList.weightSum]; omega + · intro r + refine (val_step_down_cons_r g_f t x0_0 w_x fa w [] r hg0 hg8 hwx hw hwh hfa hx2n1_ge2).trans ?_ + refine (val_step_leaf_mod8_0 g_f t (x0_0 + fa / 2 - 2) (w_x + w / 2) _ hg0 hg8 hwrec hwrh harec8 harec_ge8).trans ?_ + exact val_step_up_cons_r g_f t fa w ((x0_0 + fa / 2 - 2) / 2 + 4) ((w_x + w / 2) / 2) + [val g_f t ((x0_0 + fa / 2 - 2) / 2 + 3) ((w_x + w / 2) / 2)] r + hg0 hg8 hw hwh hfa (by omega) + · have harec4 : (x0_0 + fa / 2 - 2) % 4 = 2 := Nat.eq_of_beq_eq_true hm4 + dsimp only [InnRes.ConsValid, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + refine ⟨Nat.gcd_dvd_left _ _, by omega, ?_, ?_⟩ + · dsimp [LList.LastOdd]; omega + · intro hg0 hg8 hwx _ hw hgout + have hwh : g_f ∣ (w / 2) := (Nat.dvd_gcd_iff.mp hgout).2 + have hwrec : g_f ∣ (w_x + w / 2) := Nat.dvd_add hwx hwh + have hw8 := dvd_eight_of_dvd g_f w hg8 hw + refine ⟨hwh, ⟨hwrec, Nat.dvd_zero g_f, trivial⟩, ?_, ?_⟩ + · dsimp [LList.weightSum]; omega + · intro r + refine (val_step_down_cons_r g_f t x0_0 w_x fa w [] r hg0 hg8 hwx hw hwh hfa hx2n1_ge2).trans ?_ + refine (val_step_leaf_mod4_2 g_f t (x0_0 + fa / 2 - 2) (w_x + w / 2) _ harec4).trans ?_ + exact val_step_up_cons_r g_f t fa w (x0_0 + fa / 2 - 2 + 6) (w_x + w / 2) + [val g_f t 1 0] r hg0 hg8 hw hwh hfa (by omega) + | cons x1_0 w_x1 l_rest2 ih => + rcases hlo with ⟨hx0, hlo2⟩ + rw [excCons_cons] + dsimp only [excConsStep, excConsStepAux1, excConsStepAux2, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hm3 : Nat.beq ((x0_0 + fa / 2) % 4) 3 <;> dsimp only [Bool.rec] + · cases hge5 : Nat.ble 5 (x0_0 + fa / 2) <;> dsimp only [Bool.rec] + · trivial + · have hx2n1_ge5 : 5 ≤ x0_0 + fa / 2 := Nat.le_of_ble_eq_true hge5 + have hx2n1_ne3 : (x0_0 + fa / 2) % 4 ≠ 3 := Nat.ne_of_beq_eq_false hm3 + have hfa_sub : (x0_0 + fa / 2 - 2) % 4 = 3 := by omega + have hih := ih x1_0 w_x1 (x0_0 + fa / 2 - 2) (w_x + w / 2) (Nat.gcd g (w / 2)) hfa_sub hlo2 + cases hres : excCons l_rest2 x1_0 w_x1 (x0_0 + fa / 2 - 2) (w_x + w / 2) (Nat.gcd g (w / 2)) with + | none => + dsimp only [excConsWrap, InnRes.rec, InnRes.ConsValid] + | some g_out q_top w_qtop l_inner => + rw [hres] at hih + dsimp only [excConsWrap, InnRes.rec, excConsWrapSome, InnRes.ConsValid] + rcases hih with ⟨hg_dvd, hq2, hlo_in, hih_imp⟩ + rcases Nat.dvd_gcd_iff.mp hg_dvd with ⟨hgo_g, hgo_wh⟩ + refine ⟨hgo_g, by omega, ⟨by omega, hlo_in⟩, ?_⟩ + intro hg0 hg8 hwx hl_dvd hw hgout + have hwh : g_f ∣ (w / 2) := Nat.dvd_trans hgout hgo_wh + have hwrec : g_f ∣ (w_x + w / 2) := Nat.dvd_add hwx hwh + rcases hih_imp hg0 hg8 hl_dvd.1 hl_dvd.2 hwrec hgout with ⟨hwqt, hall, hsum, hreach⟩ + have hw8 := dvd_eight_of_dvd g_f w hg8 hw + refine ⟨hwh, ⟨hwqt, hall⟩, ?_, ?_⟩ + · dsimp [LList.weightSum] at hsum ⊢; omega + · intro r + refine (val_step_down_cons_r g_f t x0_0 w_x fa w (evalLList g_f t (LList.cons x1_0 w_x1 l_rest2)) r + hg0 hg8 hwx hw hwh hfa (by omega)).trans ?_ + refine (hreach _).trans ?_ + exact val_step_up_cons_r g_f t fa w q_top w_qtop (evalLList g_f t l_inner) r hg0 hg8 hw hwh hfa hq2 + · have hx2n1_3 : (x0_0 + fa / 2) % 4 = 3 := Nat.eq_of_beq_eq_true hm3 + dsimp only [InnRes.ConsValid, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + refine ⟨Nat.gcd_dvd_left _ _, by omega, ⟨by omega, LList.LastOdd_add_even l_rest2 x1_0 (x0_0 + fa / 2 + 3) hlo2 (by omega)⟩, ?_⟩ + intro hg0 hg8 hwx hl_dvd hw hgout + have hwh : g_f ∣ (w / 2) := (Nat.dvd_gcd_iff.mp hgout).2 + have hw8 := dvd_eight_of_dvd g_f w hg8 hw + refine ⟨hwh, ⟨Nat.dvd_add hl_dvd.1 (Nat.dvd_add hwx hwh), hl_dvd.2⟩, ?_, ?_⟩ + · dsimp [LList.weightSum]; omega + · intro r + exact val_step_cons_mod3_r g_f t x0_0 w_x x1_0 w_x1 fa w (evalLList g_f t l_rest2) r + hg0 hg8 hwx hl_dvd.1 hw hwh hfa hx2n1_3 + +def walk (n_orig : Nat) (ih : Nat → Nat → LList → Nat → Nat → Nat → CmpRule) + (l_rest : LList) (x0_0 w_x fa w g : Nat) : CmpRule := + LList.rec (walkNil n_orig) (walkCons ih) l_rest x0_0 w_x fa w g + +theorem compileLoop_zero (n_orig x0_0 w_x : Nat) (l_rest : LList) (fa w g : Nat) : + compileLoop 0 n_orig x0_0 w_x l_rest fa w g = .none := rfl + +theorem compileLoop_succ (fuel n_orig x0_0 w_x : Nat) (l_rest : LList) (fa w g : Nat) : + compileLoop (fuel + 1) n_orig x0_0 w_x l_rest fa w g = + walk n_orig (compileLoop fuel n_orig) l_rest x0_0 w_x fa w g := rfl + +theorem walk_nil (n_orig : Nat) (ih : Nat → Nat → LList → Nat → Nat → Nat → CmpRule) + (x0_0 w_x fa w g : Nat) : + walk n_orig ih .nil x0_0 w_x fa w g = walkNil n_orig x0_0 w_x fa w g := rfl + +theorem walk_cons (n_orig : Nat) (ih : Nat → Nat → LList → Nat → Nat → Nat → CmpRule) + (x1_0 w_x1 : Nat) (l_rest2 : LList) (x0_0 w_x fa w g : Nat) : + walk n_orig ih (.cons x1_0 w_x1 l_rest2) x0_0 w_x fa w g = + walkCons ih x1_0 w_x1 l_rest2 (walk n_orig ih l_rest2) x0_0 w_x fa w g := rfl + +def CmpRule.LoopValid (n_orig x0_0 w_x : Nat) (l_rest : LList) (fa w g : Nat) : CmpRule → Prop + | .none => True + | .some rs rd => + ∃ g_f, + 8 ≤ g_f ∧ + g_f % 8 = 0 ∧ + g_f ∣ g ∧ + rs = sInit4 / g_f ∧ + (∀ t, g_f ∣ wHalfInit → g_f ∣ w_x → l_rest.AllDvd g_f → g_f ∣ w → + w_x + l_rest.weightSum + w = sInit → + ReachesStar target_tm + (CfgS (evalLList g_f t (LList.cons x0_0 w_x l_rest)) (val g_f t fa w) [0, 1]) + (Cn (n_orig + rd + rs * t))) + +theorem val_finish_even (g t n_orig fa_f : Nat) + (hg8_le : 8 ≤ g) (hg8 : g % 8 = 0) (hwh_init : g ∣ wHalfInit) + (hge_n : n_orig + 1 ≤ fa_f) (hn12 : 12 ≤ n_orig) (hfaf2 : fa_f % 2 = 0) : + ReachesStar target_tm + (CfgS [] (val g t fa_f sInit) [0, 1]) + (Cn (n_orig + (fa_f + 6 * (((fa_f - 4) / 2) % 4) - n_orig) + (sInit4 / g) * t)) := by + have hg0 : 0 < g := by omega + have hsinit : g ∣ sInit := dvd_of_eq_mul g sInit wHalfInit 2 rfl hwh_init + have hsinit2 : g ∣ (sInit / 2) := hwh_init + have hmod8 : (val g t fa_f sInit) % 8 = fa_f % 8 := val_mod8 g t fa_f sInit hg0 hg8 hsinit hsinit2 + have hge_val : fa_f ≤ val g t fa_f sInit := val_ge g t fa_f sInit + have hval_even : (val g t fa_f sInit) % 2 = 0 := by omega + have hval_ge6 : 6 ≤ val g t fa_f sInit := by omega + have h := finish_even_spec (val g t fa_f sInit) hval_even hval_ge6 + have hrem : (((val g t fa_f sInit) - 4) / 2) % 4 = ((fa_f - 4) / 2) % 4 := by omega + rcases hsinit with ⟨k, hk⟩ + have hs4 : sInit4 = g * (4 * k) := by + have : sInit4 = 4 * sInit := rfl + rw [this, hk]; ring + have hdiv1 : sInit / g = k := by rw [hk, Nat.mul_div_right _ hg0] + have hdiv4 : sInit4 / g = 4 * k := by rw [hs4, Nat.mul_div_right _ hg0] + have h4kt : 4 * ((sInit / g) * t) = (sInit4 / g) * t := by + rw [hdiv1, hdiv4]; ring + have htarget : val g t fa_f sInit + 6 * ((((val g t fa_f sInit) - 4) / 2) % 4) = + n_orig + (fa_f + 6 * (((fa_f - 4) / 2) % 4) - n_orig) + (sInit4 / g) * t := by + rw [hrem] + dsimp [val] + omega + rw [htarget] at h + exact h + +theorem walk_spec (n_orig : Nat) (ih : Nat → Nat → LList → Nat → Nat → Nat → CmpRule) + (hih_compile : ∀ x0_0 w_x l_rest fa w g, l_rest.LastOdd x0_0 → + CmpRule.LoopValid n_orig x0_0 w_x l_rest fa w g (ih x0_0 w_x l_rest fa w g)) + (hn12 : 12 ≤ n_orig) + (l_rest : LList) (x0_0 w_x fa w g : Nat) (hlo : l_rest.LastOdd x0_0) : + CmpRule.LoopValid n_orig x0_0 w_x l_rest fa w g (walk n_orig ih l_rest x0_0 w_x fa w g) := by + induction l_rest generalizing x0_0 w_x fa w g with + | nil => + have hx0 : x0_0 % 2 = 1 := hlo + rw [walk_nil] + dsimp only [walkNil, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hm1 : Nat.beq (fa % 4) 1 <;> dsimp only [Bool.rec] + · trivial + · have hfa1 : fa % 4 = 1 := Nat.eq_of_beq_eq_true hm1 + dsimp only [finishRule, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hcond : Bool.and (Nat.ble (n_orig + 1) (x0_0 + (fa + 2))) (Bool.and (Nat.ble 8 g) (Nat.beq (g % 8) 0)) <;> + dsimp only [Bool.rec] + · trivial + · dsimp only [CmpRule.LoopValid] + rcases Bool.and_eq_true_iff.mp hcond with ⟨hc1, hc23⟩ + rcases Bool.and_eq_true_iff.mp hc23 with ⟨hc2, hc3⟩ + have hge_n : n_orig + 1 ≤ x0_0 + (fa + 2) := Nat.le_of_ble_eq_true hc1 + have hg8_le : 8 ≤ g := Nat.le_of_ble_eq_true hc2 + have hg8 : g % 8 = 0 := Nat.eq_of_beq_eq_true hc3 + refine ⟨g, hg8_le, hg8, Nat.dvd_refl g, rfl, ?_⟩ + intro t hwh_init hwx _ hw hsum + have hg0 : 0 < g := by omega + have hwsum : w_x + w = sInit := by dsimp [LList.weightSum] at hsum; omega + refine (val_step_odd1_end g t x0_0 w_x fa w [] hg0 hwx hw hfa1).trans ?_ + rw [hwsum] + exact val_finish_even g t n_orig (x0_0 + (fa + 2)) hg8_le hg8 hwh_init hge_n hn12 (by omega) + | cons x1_0 w_x1 l_rest2 ih_walk => + rcases hlo with ⟨hx0, hlo2⟩ + rw [walk_cons] + dsimp only [walkCons, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hm1 : Nat.beq (fa % 4) 1 <;> dsimp only [Bool.rec] + · cases hm3 : Nat.beq (fa % 4) 3 <;> dsimp only [Bool.rec] + · trivial + · have hfa3 : fa % 4 = 3 := Nat.eq_of_beq_eq_true hm3 + dsimp only [walkConsOdd3, walkConsOdd3Aux1, walkConsOdd3Aux2, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hx3 : Nat.beq ((x0_0 + fa / 2) % 4) 3 <;> dsimp only [Bool.rec] + · cases hge5 : Nat.ble 5 (x0_0 + fa / 2) <;> dsimp only [Bool.rec] + · trivial + · have hx2n1_ge5 : 5 ≤ x0_0 + fa / 2 := Nat.le_of_ble_eq_true hge5 + have hx2n1_ne3 : (x0_0 + fa / 2) % 4 ≠ 3 := Nat.ne_of_beq_eq_false hx3 + have hfa_sub : (x0_0 + fa / 2 - 2) % 4 = 3 := by omega + have hexc0 := excCons_spec 0 0 l_rest2 x1_0 w_x1 (x0_0 + fa / 2 - 2) (w_x + w / 2) (Nat.gcd g (w / 2)) hfa_sub hlo2 + cases hexc : excCons l_rest2 x1_0 w_x1 (x0_0 + fa / 2 - 2) (w_x + w / 2) (Nat.gcd g (w / 2)) with + | none => + dsimp only [InnRes.rec, CmpRule.LoopValid] + | some g_out q_top w_qtop l_inner => + rw [hexc] at hexc0 + rcases hexc0 with ⟨hg_dvd, hq2, hlo_in, _⟩ + dsimp only [InnRes.rec, walkCallUnified] + have hcomp := hih_compile q_top w_qtop l_inner (fa / 2) (w / 2) g_out hlo_in + cases hres : ih q_top w_qtop l_inner (fa / 2) (w / 2) g_out with + | none => + dsimp only [CmpRule.LoopValid] + | some rs rd => + rw [hres] at hcomp + rcases hcomp with ⟨g_f, hg8_le, hg8, hgf_gout, hrs, hcomp_imp⟩ + have hgf_g1 : g_f ∣ Nat.gcd g (w / 2) := Nat.dvd_trans hgf_gout hg_dvd + rcases Nat.dvd_gcd_iff.mp hgf_g1 with ⟨hgf_g, hwh⟩ + refine ⟨g_f, hg8_le, hg8, hgf_g, hrs, ?_⟩ + intro t hwh_init hwx hl_dvd hw hsum + have hg0 : 0 < g_f := by omega + have hw8 := dvd_eight_of_dvd g_f w hg8 hw + have hwrec : g_f ∣ (w_x + w / 2) := Nat.dvd_add hwx hwh + have hexc_t := excCons_spec g_f t l_rest2 x1_0 w_x1 (x0_0 + fa / 2 - 2) (w_x + w / 2) (Nat.gcd g (w / 2)) hfa_sub hlo2 + rw [hexc] at hexc_t + rcases hexc_t.2.2.2 hg0 hg8 hl_dvd.1 hl_dvd.2 hwrec hgf_gout with ⟨hwqt, hall_in, hsum_in, hreach_in⟩ + refine (val_step_down_cons_r g_f t x0_0 w_x fa w (evalLList g_f t (LList.cons x1_0 w_x1 l_rest2)) [] + hg0 hg8 hwx hw hwh hfa3 (by omega)).trans ?_ + refine (hreach_in _).trans ?_ + refine (val_step_up_walk_odd3 g_f t fa w q_top w_qtop (evalLList g_f t l_inner) + hg0 hg8 hw hwh hfa3 hq2).trans ?_ + exact hcomp_imp t hwh_init hwqt hall_in hwh (by dsimp [LList.weightSum] at hsum ⊢; omega) + · have hx2n1_3 : (x0_0 + fa / 2) % 4 = 3 := Nat.eq_of_beq_eq_true hx3 + have hlo_new : l_rest2.LastOdd (x1_0 + (x0_0 + fa / 2 + 3)) := + LList.LastOdd_add_even l_rest2 x1_0 (x0_0 + fa / 2 + 3) hlo2 (by omega) + have hwk := ih_walk (x1_0 + (x0_0 + fa / 2 + 3)) (w_x1 + (w_x + w / 2)) (fa / 2) (w / 2) (Nat.gcd g (w / 2)) hlo_new + cases hres : walk n_orig ih l_rest2 (x1_0 + (x0_0 + fa / 2 + 3)) (w_x1 + (w_x + w / 2)) (fa / 2) (w / 2) (Nat.gcd g (w / 2)) with + | none => + dsimp only [CmpRule.LoopValid] + | some rs rd => + rw [hres] at hwk + rcases hwk with ⟨g_f, hg8_le, hg8, hgf_g1, hrs, hwk_imp⟩ + rcases Nat.dvd_gcd_iff.mp hgf_g1 with ⟨hgf_g, hwh⟩ + refine ⟨g_f, hg8_le, hg8, hgf_g, hrs, ?_⟩ + intro t hwh_init hwx hl_dvd hw hsum + have hg0 : 0 < g_f := by omega + have hw8 := dvd_eight_of_dvd g_f w hg8 hw + refine (val_step_walk_odd3_mod3 g_f t x0_0 w_x x1_0 w_x1 fa w (evalLList g_f t l_rest2) + hg0 hg8 hwx hl_dvd.1 hw hwh hfa3 hx2n1_3).trans ?_ + exact hwk_imp t hwh_init (Nat.dvd_add hl_dvd.1 (Nat.dvd_add hwx hwh)) hl_dvd.2 hwh + (by dsimp [LList.weightSum] at hsum ⊢; omega) + · have hfa1 : fa % 4 = 1 := Nat.eq_of_beq_eq_true hm1 + have hwk := ih_walk x1_0 w_x1 (x0_0 + (fa + 2)) (w_x + w) g hlo2 + cases hres : walk n_orig ih l_rest2 x1_0 w_x1 (x0_0 + (fa + 2)) (w_x + w) g with + | none => + dsimp only [CmpRule.LoopValid] + | some rs rd => + rw [hres] at hwk + rcases hwk with ⟨g_f, hg8_le, hg8, hgf_g, hrs, hwk_imp⟩ + refine ⟨g_f, hg8_le, hg8, hgf_g, hrs, ?_⟩ + intro t hwh_init hwx hl_dvd hw hsum + have hg0 : 0 < g_f := by omega + refine (val_step_odd1_end g_f t x0_0 w_x fa w (evalLList g_f t (LList.cons x1_0 w_x1 l_rest2)) + hg0 hwx hw hfa1).trans ?_ + exact hwk_imp t hwh_init hl_dvd.1 hl_dvd.2 (Nat.dvd_add hwx hw) + (by dsimp [LList.weightSum] at hsum ⊢; omega) + +theorem compileLoop_spec (fuel n_orig x0_0 w_x : Nat) (l_rest : LList) (fa w g : Nat) + (hn12 : 12 ≤ n_orig) (hlo : l_rest.LastOdd x0_0) : + CmpRule.LoopValid n_orig x0_0 w_x l_rest fa w g (compileLoop fuel n_orig x0_0 w_x l_rest fa w g) := by + induction fuel generalizing x0_0 w_x l_rest fa w g with + | zero => trivial + | succ fuel ih => + rw [compileLoop_succ] + exact walk_spec n_orig (compileLoop fuel n_orig) + (fun x0_0 w_x l_rest fa w g hlo => ih x0_0 w_x l_rest fa w g hlo) + hn12 l_rest x0_0 w_x fa w g hlo + +def CmpRule.Valid (n : Nat) : CmpRule → Prop + | .none => True + | .some rs rd => valid n rs rd + +theorem fastCompileSome_spec (n arec_0 g_out q_top w_qtop : Nat) (l_inner : LList) + (hn12 : 12 ≤ n) (hn8 : n % 8 = 4) (harec_eq : arec_0 = n / 4 - 3) + (hgo_wq : g_out ∣ wQtrInit) (harec2 : arec_0 % 2 = 0) (hq2 : 2 ≤ q_top) + (hlo : l_inner.LastOdd q_top) + (hmid : ∀ g_f t, 0 < g_f → g_f % 8 = 0 → g_f ∣ g_out → + g_f ∣ w_qtop ∧ + l_inner.AllDvd g_f ∧ + w_qtop + l_inner.weightSum = wQtrInit ∧ + ∀ r, ReachesStar target_tm + (CfgS [] (val g_f t arec_0 wQtrInit) (0 :: 1 :: r)) + (CfgT (evalLList g_f t l_inner) (val g_f t q_top w_qtop - 2) (0 :: r))) : + CmpRule.Valid n (fastCompileSome n arec_0 g_out q_top w_qtop l_inner) := by + unfold fastCompileSome + rw [nat_mul_eq, nat_add_eq, nat_add_eq, nat_add_eq, nat_add_eq] + have hlo_start : l_inner.LastOdd (q_top + (2 * arec_0 + 10)) := + LList.LastOdd_add_even l_inner q_top (2 * arec_0 + 10) hlo (by omega) + have hloop := compileLoop_spec 40 n (q_top + (2 * arec_0 + 10)) (w_qtop + wHalfInit) l_inner (arec_0 + 3) wQtrInit g_out hn12 hlo_start + cases hres : compileLoop 40 n (q_top + (2 * arec_0 + 10)) (w_qtop + wHalfInit) l_inner (arec_0 + 3) wQtrInit g_out with + | none => + dsimp only [CmpRule.Valid] + | some rs rd => + rw [hres] at hloop + dsimp only [CmpRule.Valid, valid] + rcases hloop with ⟨g_f, hg8_le, hg8, hgf_gout, hrs, hloop_imp⟩ + have hg0 : 0 < g_f := by omega + have hwQ : g_f ∣ wQtrInit := Nat.dvd_trans hgf_gout hgo_wq + have hwH : g_f ∣ wHalfInit := dvd_of_eq_mul g_f wHalfInit wQtrInit 2 rfl hwQ + have hsinit : g_f ∣ sInit := dvd_of_eq_mul g_f sInit wQtrInit 4 rfl hwQ + intro t + rcases hmid g_f t hg0 hg8 hgf_gout with ⟨hwqt, hall_in, hsum_in, hreach_mid⟩ + have hval_n : n + rs * t = val g_f t n sInit := by + rcases hsinit with ⟨k, hk⟩ + have hs4 : sInit4 = g_f * (4 * k) := by + have : sInit4 = 4 * sInit := rfl + rw [this, hk]; ring + have hdiv1 : sInit / g_f = k := by rw [hk, Nat.mul_div_right _ hg0] + have hdiv4 : sInit4 / g_f = 4 * k := by rw [hs4, Nat.mul_div_right _ hg0] + dsimp [val] + rw [hrs, hdiv1, hdiv4] + ring + change ReachesStar target_tm (CfgS [] (n + rs * t) [0, 1]) (Cn (n + rd + rs * t)) + rw [hval_n] + have hdown := val_step_down_nil4 g_f t n sInit [] hg0 hg8 hsinit hwQ hn8 hn12 + dsimp only at hdown + rw [← harec_eq] at hdown + have hwq_eq : sInit / 2 / 2 = wQtrInit := rfl + rw [hwq_eq] at hdown + refine hdown.trans ?_ + refine (hreach_mid _).trans ?_ + refine (val_step_start_loop g_f t arec_0 wQtrInit wHalfInit q_top w_qtop (evalLList g_f t l_inner) + hg0 hg8 hwH hwQ hwqt rfl harec2 hq2).trans ?_ + have hsum_tot : (w_qtop + wHalfInit) + l_inner.weightSum + wQtrInit = sInit := by + have : wHalfInit + wQtrInit + wQtrInit = sInit := rfl + omega + exact hloop_imp t hwH (Nat.dvd_add hwqt hwH) hall_in hwQ hsum_tot + +theorem fastCompile_spec (n : Nat) : CmpRule.Valid n (fastCompile n) := by + unfold fastCompile + rw [nat_div_eq, nat_sub_eq, nat_mod_eq] + cases hcond : Bool.and (Nat.ble 12 n) (Nat.beq (n % 8) 4) <;> dsimp only [Bool.rec] + · trivial + · rcases Bool.and_eq_true_iff.mp hcond with ⟨hc1, hc2⟩ + have hn12 : 12 ≤ n := Nat.le_of_ble_eq_true hc1 + have hn8 : n % 8 = 4 := Nat.eq_of_beq_eq_true hc2 + unfold fastCompileAux + rw [nat_mod_eq, nat_mod_eq, nat_add_eq] + cases hm4 : Nat.beq ((n / 4 - 3) % 4) 2 <;> dsimp only [Bool.rec] + · cases hm8 : Nat.beq ((n / 4 - 3) % 8) 0 <;> dsimp only [Bool.rec] + · have hnil0 := excNil4_spec 0 0 20 (n / 4 - 3) wQtrInit wQtrInit + cases hres : excNil4 20 (n / 4 - 3) wQtrInit wQtrInit with + | none => + dsimp only [InnRes.rec, CmpRule.Valid] + | some g_out q_top w_qtop l_inner => + rw [hres] at hnil0 + rcases hnil0 with ⟨hgo_wq, harec2, hq2, hlo, _⟩ + dsimp only [InnRes.rec] + refine fastCompileSome_spec n (n / 4 - 3) g_out q_top w_qtop l_inner hn12 hn8 rfl hgo_wq harec2 hq2 hlo ?_ + intro g_f t hg0 hg8 hgf_gout + have hnil_t := excNil4_spec g_f t 20 (n / 4 - 3) wQtrInit wQtrInit + rw [hres] at hnil_t + exact hnil_t.2.2.2.2 hg0 hg8 (Nat.dvd_trans hgf_gout hgo_wq) hgf_gout + · have harec8 : (n / 4 - 3) % 8 = 0 := Nat.eq_of_beq_eq_true hm8 + unfold fastCompileLeaf8 + rw [nat_div_eq] + cases hge8 : Nat.ble 8 (n / 4 - 3) <;> dsimp only [Bool.rec] + · trivial + · have harec_ge8 : 8 ≤ n / 4 - 3 := Nat.le_of_ble_eq_true hge8 + unfold fastCompileLeaf8Aux + rw [nat_add_eq, nat_add_eq] + have hw8_wq : wEighthInit ∣ wQtrInit := dvd_of_eq_mul wEighthInit wQtrInit wEighthInit 2 (by decide) (Nat.dvd_refl _) + refine fastCompileSome_spec n (n / 4 - 3) wEighthInit ((n / 4 - 3) / 2 + 4) wEighthInit + (LList.cons ((n / 4 - 3) / 2 + 3) wEighthInit LList.nil) + hn12 hn8 rfl hw8_wq (by omega) (by omega) (by dsimp [LList.LastOdd]; omega) ?_ + intro g_f t hg0 hg8 hgf_w8 + have hwQ : g_f ∣ wQtrInit := Nat.dvd_trans hgf_w8 hw8_wq + refine ⟨hgf_w8, ⟨hgf_w8, trivial⟩, by dsimp [LList.weightSum]; decide, ?_⟩ + intro r + exact val_step_leaf_mod8_0 g_f t (n / 4 - 3) wQtrInit r hg0 hg8 hwQ hgf_w8 harec8 harec_ge8 + · have harec4 : (n / 4 - 3) % 4 = 2 := Nat.eq_of_beq_eq_true hm4 + refine fastCompileSome_spec n (n / 4 - 3) wQtrInit (n / 4 - 3 + 6) wQtrInit + (LList.cons 1 0 LList.nil) + hn12 hn8 rfl (Nat.dvd_refl _) (by omega) (by omega) (by dsimp [LList.LastOdd]; omega) ?_ + intro g_f t hg0 hg8 hgf_wq + refine ⟨hgf_wq, ⟨Nat.dvd_zero g_f, trivial⟩, by dsimp [LList.weightSum], ?_⟩ + intro r + exact val_step_leaf_mod4_2 g_f t (n / 4 - 3) wQtrInit r harec4 + +-- Fast evaluator for Stage 2 and its soundness proof + +inductive NList where + | nil : NList + | cons : Nat → NList → NList + +def nlistWrap1Some (p_top q_top : Nat) (l_in : NList) (_ : NList) : NList := + NList.cons p_top (NList.cons q_top l_in) + +def nlistWrap1 (p_top : Nat) (res : NList) : NList := + NList.rec NList.nil (nlistWrap1Some p_top) res + +def nlistWrap2Some (p_top po_0 q_top : Nat) (l_in : NList) (_ : NList) : NList := + NList.cons p_top (NList.cons po_0 (NList.cons q_top l_in)) + +def nlistWrap2 (p_top po_0 : Nat) (res : NList) : NList := + NList.rec NList.nil (nlistWrap2Some p_top po_0) res + +def evalNil4Leaf8Aux (p_top po_0 ah : Nat) : NList := + NList.cons p_top (NList.cons po_0 (NList.cons (Nat.add ah 4) (NList.cons (Nat.add ah 3) NList.nil))) + +def evalNil4Leaf8 (p_top po_0 arec_0 : Nat) : NList := + Bool.rec NList.nil (evalNil4Leaf8Aux p_top po_0 (Nat.div arec_0 2)) (Nat.ble 8 arec_0) + +def evalNil4StepAux2 (ih : Nat → NList) (arec_0 p_top po_0 : Nat) : NList := + Bool.rec + (Bool.rec + (nlistWrap2 p_top po_0 (ih arec_0)) + (evalNil4Leaf8 p_top po_0 arec_0) + (Nat.beq (Nat.mod arec_0 8) 0)) + (NList.cons p_top (NList.cons po_0 (NList.cons (Nat.add arec_0 6) (NList.cons 1 NList.nil)))) + (Nat.beq (Nat.mod arec_0 4) 2) + +def evalNil4StepAux1 (ih : Nat → NList) (arec_0 : Nat) : NList := + evalNil4StepAux2 ih arec_0 (Nat.add (Nat.mul 2 arec_0) 10) (Nat.add arec_0 4) + +def evalNil4Step (_ : Nat) (ih : Nat → NList) (fa : Nat) : NList := + Bool.rec + NList.nil + (evalNil4StepAux1 ih (Nat.sub (Nat.div fa 4) 3)) + (Bool.and (Nat.ble 12 fa) (Nat.beq (Nat.mod fa 8) 4)) + +def evalNilBase (_ : Nat) : NList := NList.nil + +def evalNil4 (fuel fa : Nat) : NList := + Nat.rec evalNilBase evalNil4Step fuel fa + +def evalConsNilLeaf8Aux (p_top ah : Nat) : NList := + NList.cons p_top (NList.cons (Nat.add ah 4) (NList.cons (Nat.add ah 3) NList.nil)) + +def evalConsNilLeaf8 (p_top arec_0 : Nat) : NList := + Bool.rec NList.nil (evalConsNilLeaf8Aux p_top (Nat.div arec_0 2)) (Nat.ble 8 arec_0) + +def evalConsNilBody2 (p_top arec_0 : Nat) : NList := + Bool.rec + (Bool.rec + (nlistWrap1 p_top (evalNil4 20 arec_0)) + (evalConsNilLeaf8 p_top arec_0) + (Nat.beq (Nat.mod arec_0 8) 0)) + (NList.cons p_top (NList.cons (Nat.add arec_0 6) (NList.cons 1 NList.nil))) + (Nat.beq (Nat.mod arec_0 4) 2) + +def evalConsNilBody1 (fa_half x2n1 : Nat) : NList := + Bool.rec NList.nil (evalConsNilBody2 (Nat.add fa_half 3) (Nat.sub x2n1 2)) (Nat.ble 2 x2n1) + +def evalConsNilAux (x0_0 fa_half : Nat) : NList := + evalConsNilBody1 fa_half (Nat.add x0_0 fa_half) + +def evalConsNil (x0_0 fa : Nat) : NList := + evalConsNilAux x0_0 (Nat.div fa 2) + +def evalConsStepAux2 (x1_0 : Nat) (l_rest2 : NList) (ih : Nat → Nat → NList) (fa_half x2n1 : Nat) : NList := + Bool.rec + (Bool.rec + NList.nil + (nlistWrap1 (Nat.add fa_half 3) (ih x1_0 (Nat.sub x2n1 2))) + (Nat.ble 5 x2n1)) + (NList.cons (Nat.add fa_half 3) (NList.cons (Nat.add x1_0 (Nat.add x2n1 3)) l_rest2)) + (Nat.beq (Nat.mod x2n1 4) 3) + +def evalConsStepAux1 (x1_0 : Nat) (l_rest2 : NList) (ih : Nat → Nat → NList) (x0_0 fa_half : Nat) : NList := + evalConsStepAux2 x1_0 l_rest2 ih fa_half (Nat.add x0_0 fa_half) + +def evalConsStep (x1_0 : Nat) (l_rest2 : NList) (ih : Nat → Nat → NList) (x0_0 fa : Nat) : NList := + evalConsStepAux1 x1_0 l_rest2 ih x0_0 (Nat.div fa 2) + +def evalCons (l_rest : NList) (x0_0 fa : Nat) : NList := + NList.rec evalConsNil evalConsStep l_rest x0_0 fa + +def finishEval (fa : Nat) : Nat := + Bool.rec 0 + (Nat.add fa (Nat.mul 6 (Nat.mod (Nat.div (Nat.sub fa 4) 2) 4))) + (Bool.and (Nat.ble 6 fa) (Nat.beq (Nat.mod fa 2) 0)) + +def evalWalkNil (x0_0 fa : Nat) : Nat := + Bool.rec 0 (finishEval (Nat.add x0_0 (Nat.add fa 2))) (Nat.beq (Nat.mod fa 4) 1) + +def evalWalkConsOdd3Aux2 (ih_eval : NList → Nat → Nat) (x1_0 : Nat) (l_rest2 : NList) + (ih_walk : Nat → Nat → Nat) (fa_half x2n1 : Nat) : Nat := + Bool.rec + (Bool.rec + 0 + (ih_eval (evalCons l_rest2 x1_0 (Nat.sub x2n1 2)) fa_half) + (Nat.ble 5 x2n1)) + (ih_walk (Nat.add x1_0 (Nat.add x2n1 3)) fa_half) + (Nat.beq (Nat.mod x2n1 4) 3) + +def evalWalkConsOdd3Aux1 (ih_eval : NList → Nat → Nat) (x1_0 : Nat) (l_rest2 : NList) + (ih_walk : Nat → Nat → Nat) (x0_0 fa_half : Nat) : Nat := + evalWalkConsOdd3Aux2 ih_eval x1_0 l_rest2 ih_walk fa_half (Nat.add x0_0 fa_half) + +def evalWalkConsOdd3 (ih_eval : NList → Nat → Nat) (x1_0 : Nat) (l_rest2 : NList) + (ih_walk : Nat → Nat → Nat) (x0_0 fa : Nat) : Nat := + evalWalkConsOdd3Aux1 ih_eval x1_0 l_rest2 ih_walk x0_0 (Nat.div fa 2) + +def evalWalkCons (ih_eval : NList → Nat → Nat) (x1_0 : Nat) (l_rest2 : NList) + (ih_walk : Nat → Nat → Nat) (x0_0 fa : Nat) : Nat := + Bool.rec + (Bool.rec 0 (evalWalkConsOdd3 ih_eval x1_0 l_rest2 ih_walk x0_0 fa) (Nat.beq (Nat.mod fa 4) 3)) + (ih_walk x1_0 (Nat.add x0_0 (Nat.add fa 2))) + (Nat.beq (Nat.mod fa 4) 1) + +def evalStepCons (ih_eval : NList → Nat → Nat) (x0_0 : Nat) (l_rest : NList) (_ : Nat → Nat) (fa : Nat) : Nat := + NList.rec evalWalkNil (evalWalkCons ih_eval) l_rest x0_0 fa + +def evalStepNil (_ : Nat) : Nat := 0 + +def evalStep (_ : Nat) (ih : NList → Nat → Nat) (l : NList) (fa : Nat) : Nat := + NList.rec evalStepNil (evalStepCons ih) l fa + +def evalBase (_ : NList) (_ : Nat) : Nat := 0 + +def evalLoop (fuel : Nat) (l : NList) (fa : Nat) : Nat := + Nat.rec evalBase evalStep fuel l fa + +def fastEvalStartCons (arec_0 q_top : Nat) (l_inner : NList) (_ : Nat) : Nat := + evalLoop 40 (NList.cons (Nat.add q_top (Nat.add (Nat.mul 2 arec_0) 10)) l_inner) (Nat.add arec_0 3) + +def fastEvalFromList (arec_0 : Nat) (l : NList) : Nat := + NList.rec 0 (fastEvalStartCons arec_0) l + +def fastEvalLeaf8Aux (arec_0 ah : Nat) : Nat := + evalLoop 40 (NList.cons (Nat.add (Nat.add ah 4) (Nat.add (Nat.mul 2 arec_0) 10)) (NList.cons (Nat.add ah 3) NList.nil)) (Nat.add arec_0 3) + +def fastEvalLeaf8 (arec_0 : Nat) : Nat := + Bool.rec 0 (fastEvalLeaf8Aux arec_0 (Nat.div arec_0 2)) (Nat.ble 8 arec_0) + +def fastEvalAux (arec_0 : Nat) : Nat := + Bool.rec + (Bool.rec + (fastEvalFromList arec_0 (evalNil4 20 arec_0)) + (fastEvalLeaf8 arec_0) + (Nat.beq (Nat.mod arec_0 8) 0)) + (evalLoop 40 (NList.cons (Nat.add (Nat.add arec_0 6) (Nat.add (Nat.mul 2 arec_0) 10)) (NList.cons 1 NList.nil)) (Nat.add arec_0 3)) + (Nat.beq (Nat.mod arec_0 4) 2) + +def fastEval (n : Nat) : Nat := + Bool.rec 0 (fastEvalAux (Nat.sub (Nat.div n 4) 3)) (Bool.and (Nat.ble 12 n) (Nat.beq (Nat.mod n 8) 4)) + +def NList.toList : NList → List Nat + | .nil => [] + | .cons x l => x :: l.toList + +def NList.LastOdd : NList → Nat → Prop + | .nil, x0 => x0 % 2 = 1 + | .cons x1 l, x0 => x0 % 2 = 0 ∧ l.LastOdd x1 + +theorem NList.LastOdd_add_even (l : NList) (x d : Nat) (h1 : l.LastOdd x) (h2 : d % 2 = 0) : + l.LastOdd (x + d) := by + cases l with + | nil => dsimp [NList.LastOdd] at h1 ⊢; omega + | cons x1 l2 => + rcases h1 with ⟨h1a, h1b⟩ + exact ⟨by omega, h1b⟩ + +theorem evalNil4_zero (fa : Nat) : evalNil4 0 fa = .nil := rfl +theorem evalNil4_succ (fuel fa : Nat) : evalNil4 (fuel + 1) fa = evalNil4Step fuel (evalNil4 fuel) fa := rfl +theorem evalCons_nil (x0_0 fa : Nat) : evalCons .nil x0_0 fa = evalConsNil x0_0 fa := rfl +theorem evalCons_cons (x1_0 : Nat) (l_rest2 : NList) (x0_0 fa : Nat) : + evalCons (.cons x1_0 l_rest2) x0_0 fa = evalConsStep x1_0 l_rest2 (evalCons l_rest2) x0_0 fa := rfl + +def NList.NilValid (fa : Nat) : NList → Prop + | .nil => True + | .cons q_top l_in => + fa % 2 = 0 ∧ + 2 ≤ q_top ∧ + l_in.LastOdd q_top ∧ + ∀ r, ReachesStar target_tm (CfgS [] fa (0 :: 1 :: r)) (CfgT l_in.toList (q_top - 2) (0 :: r)) + +theorem evalNil4_spec (fuel fa : Nat) : NList.NilValid fa (evalNil4 fuel fa) := by + induction fuel generalizing fa with + | zero => trivial + | succ fuel ih => + rw [evalNil4_succ] + dsimp only [evalNil4Step, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hcond : Bool.and (Nat.ble 12 fa) (Nat.beq (fa % 8) 4) <;> dsimp only [Bool.rec] + · trivial + · rcases Bool.and_eq_true_iff.mp hcond with ⟨hc1, hc2⟩ + have hfa12 : 12 ≤ fa := Nat.le_of_ble_eq_true hc1 + have hfa8 : fa % 8 = 4 := Nat.eq_of_beq_eq_true hc2 + dsimp only [evalNil4StepAux1, evalNil4StepAux2, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hm4 : Nat.beq ((fa / 4 - 3) % 4) 2 <;> dsimp only [Bool.rec] + · cases hm8 : Nat.beq ((fa / 4 - 3) % 8) 0 <;> dsimp only [Bool.rec] + · have hih := ih (fa / 4 - 3) + cases hres : evalNil4 fuel (fa / 4 - 3) with + | nil => + dsimp only [nlistWrap2, NList.rec, NList.NilValid] + | cons q_top l_inner => + rw [hres] at hih + rcases hih with ⟨harec2, hq2, hlo, hreach⟩ + dsimp only [nlistWrap2, NList.rec, nlistWrap2Some, NList.NilValid, NList.toList] + refine ⟨by omega, by omega, ⟨by omega, by omega, hlo⟩, ?_⟩ + intro r + refine (step_down_nil4 fa r hfa8 hfa12).trans ?_ + refine (hreach _).trans ?_ + have hup := step_up_nil4 (fa / 4 - 3) q_top l_inner.toList r harec2 hq2 + have hpt : 2 * (fa / 4 - 3) + 8 = 2 * (fa / 4 - 3) + 10 - 2 := by omega + rw [hpt] at hup + exact hup + · have harec8 : (fa / 4 - 3) % 8 = 0 := Nat.eq_of_beq_eq_true hm8 + dsimp only [evalNil4Leaf8, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hge8 : Nat.ble 8 (fa / 4 - 3) <;> dsimp only [Bool.rec] + · trivial + · have harec_ge8 : 8 ≤ fa / 4 - 3 := Nat.le_of_ble_eq_true hge8 + dsimp only [evalNil4Leaf8Aux, NList.NilValid, NList.toList, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + refine ⟨by omega, by omega, by dsimp [NList.LastOdd]; omega, ?_⟩ + intro r + refine (step_down_nil4 fa r hfa8 hfa12).trans ?_ + refine (step_leaf_mod8_0 (fa / 4 - 3) _ harec8 harec_ge8).trans ?_ + have hup := step_up_nil4 (fa / 4 - 3) ((fa / 4 - 3) / 2 + 4) [(fa / 4 - 3) / 2 + 3] r (by omega) (by omega) + have ha1 : (fa / 4 - 3) / 2 + 2 = (fa / 4 - 3) / 2 + 4 - 2 := by omega + have ha2 : 2 * (fa / 4 - 3) + 8 = 2 * (fa / 4 - 3) + 10 - 2 := by omega + rw [← ha1, ha2] at hup + exact hup + · have harec4 : (fa / 4 - 3) % 4 = 2 := Nat.eq_of_beq_eq_true hm4 + dsimp only [NList.NilValid, NList.toList, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + refine ⟨by omega, by omega, by dsimp [NList.LastOdd]; omega, ?_⟩ + intro r + refine (step_down_nil4 fa r hfa8 hfa12).trans ?_ + refine (step_leaf_mod4_2 (fa / 4 - 3) _ harec4).trans ?_ + have hup := step_up_nil4 (fa / 4 - 3) (fa / 4 - 3 + 6) [1] r (by omega) (by omega) + have ha1 : fa / 4 - 3 + 4 = fa / 4 - 3 + 6 - 2 := by omega + have ha2 : 2 * (fa / 4 - 3) + 8 = 2 * (fa / 4 - 3) + 10 - 2 := by omega + rw [← ha1, ha2] at hup + exact hup + +def NList.ConsValid (l_rest : NList) (x0_0 fa : Nat) : NList → Prop + | .nil => True + | .cons q_top l_in => + 2 ≤ q_top ∧ + l_in.LastOdd q_top ∧ + ∀ r, ReachesStar target_tm (CfgS (x0_0 :: l_rest.toList) fa (0 :: 1 :: r)) (CfgT l_in.toList (q_top - 2) (0 :: r)) + +theorem evalCons_spec (l_rest : NList) (x0_0 fa : Nat) + (hfa : fa % 4 = 3) (hlo : l_rest.LastOdd x0_0) : + NList.ConsValid l_rest x0_0 fa (evalCons l_rest x0_0 fa) := by + induction l_rest generalizing x0_0 fa with + | nil => + have hx0 : x0_0 % 2 = 1 := hlo + rw [evalCons_nil] + dsimp only [evalConsNil, evalConsNilAux, evalConsNilBody1, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hge2 : Nat.ble 2 (x0_0 + fa / 2) <;> dsimp only [Bool.rec] + · trivial + · have hx2n1_ge2 : 2 ≤ x0_0 + fa / 2 := Nat.le_of_ble_eq_true hge2 + dsimp only [evalConsNilBody2, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hm4 : Nat.beq ((x0_0 + fa / 2 - 2) % 4) 2 <;> dsimp only [Bool.rec] + · cases hm8 : Nat.beq ((x0_0 + fa / 2 - 2) % 8) 0 <;> dsimp only [Bool.rec] + · have hnil := evalNil4_spec 20 (x0_0 + fa / 2 - 2) + cases hres : evalNil4 20 (x0_0 + fa / 2 - 2) with + | nil => + dsimp only [nlistWrap1, NList.rec, NList.ConsValid] + | cons q_top l_inner => + rw [hres] at hnil + rcases hnil with ⟨_, hq2, hlo_in, hreach⟩ + dsimp only [nlistWrap1, NList.rec, nlistWrap1Some, NList.ConsValid, NList.toList] + refine ⟨by omega, ⟨by omega, hlo_in⟩, ?_⟩ + intro r + refine (step_down_cons_r [] x0_0 fa r hfa hx2n1_ge2).trans ?_ + refine (hreach _).trans ?_ + have hup := step_up_cons_r fa q_top l_inner.toList r hfa hq2 + have ha : fa / 2 + 1 = fa / 2 + 3 - 2 := by omega + rw [ha] at hup + exact hup + · have harec8 : (x0_0 + fa / 2 - 2) % 8 = 0 := Nat.eq_of_beq_eq_true hm8 + dsimp only [evalConsNilLeaf8, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hge8 : Nat.ble 8 (x0_0 + fa / 2 - 2) <;> dsimp only [Bool.rec] + · trivial + · have harec_ge8 : 8 ≤ x0_0 + fa / 2 - 2 := Nat.le_of_ble_eq_true hge8 + dsimp only [evalConsNilLeaf8Aux, NList.ConsValid, NList.toList, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + refine ⟨by omega, by dsimp [NList.LastOdd]; omega, ?_⟩ + intro r + refine (step_down_cons_r [] x0_0 fa r hfa hx2n1_ge2).trans ?_ + refine (step_leaf_mod8_0 (x0_0 + fa / 2 - 2) _ harec8 harec_ge8).trans ?_ + have hup := step_up_cons_r fa ((x0_0 + fa / 2 - 2) / 2 + 4) [(x0_0 + fa / 2 - 2) / 2 + 3] r hfa (by omega) + have ha1 : (x0_0 + fa / 2 - 2) / 2 + 2 = (x0_0 + fa / 2 - 2) / 2 + 4 - 2 := by omega + have ha2 : fa / 2 + 1 = fa / 2 + 3 - 2 := by omega + rw [← ha1, ha2] at hup + exact hup + · have harec4 : (x0_0 + fa / 2 - 2) % 4 = 2 := Nat.eq_of_beq_eq_true hm4 + dsimp only [NList.ConsValid, NList.toList, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + refine ⟨by omega, by dsimp [NList.LastOdd]; omega, ?_⟩ + intro r + refine (step_down_cons_r [] x0_0 fa r hfa hx2n1_ge2).trans ?_ + refine (step_leaf_mod4_2 (x0_0 + fa / 2 - 2) _ harec4).trans ?_ + have hup := step_up_cons_r fa (x0_0 + fa / 2 - 2 + 6) [1] r hfa (by omega) + have ha1 : x0_0 + fa / 2 - 2 + 4 = x0_0 + fa / 2 - 2 + 6 - 2 := by omega + have ha2 : fa / 2 + 1 = fa / 2 + 3 - 2 := by omega + rw [← ha1, ha2] at hup + exact hup + | cons x1_0 l_rest2 ih => + rcases hlo with ⟨hx0, hlo2⟩ + rw [evalCons_cons] + dsimp only [evalConsStep, evalConsStepAux1, evalConsStepAux2, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hm3 : Nat.beq ((x0_0 + fa / 2) % 4) 3 <;> dsimp only [Bool.rec] + · cases hge5 : Nat.ble 5 (x0_0 + fa / 2) <;> dsimp only [Bool.rec] + · trivial + · have hx2n1_ge5 : 5 ≤ x0_0 + fa / 2 := Nat.le_of_ble_eq_true hge5 + have hx2n1_ne3 : (x0_0 + fa / 2) % 4 ≠ 3 := Nat.ne_of_beq_eq_false hm3 + have hfa_sub : (x0_0 + fa / 2 - 2) % 4 = 3 := by omega + have hih := ih x1_0 (x0_0 + fa / 2 - 2) hfa_sub hlo2 + cases hres : evalCons l_rest2 x1_0 (x0_0 + fa / 2 - 2) with + | nil => + dsimp only [nlistWrap1, NList.rec, NList.ConsValid] + | cons q_top l_inner => + rw [hres] at hih + rcases hih with ⟨hq2, hlo_in, hreach⟩ + dsimp only [nlistWrap1, NList.rec, nlistWrap1Some, NList.ConsValid, NList.toList] + refine ⟨by omega, ⟨by omega, hlo_in⟩, ?_⟩ + intro r + refine (step_down_cons_r (x1_0 :: l_rest2.toList) x0_0 fa r hfa (by omega)).trans ?_ + refine (hreach _).trans ?_ + have hup := step_up_cons_r fa q_top l_inner.toList r hfa hq2 + have ha : fa / 2 + 1 = fa / 2 + 3 - 2 := by omega + rw [ha] at hup + exact hup + · have hx2n1_3 : (x0_0 + fa / 2) % 4 = 3 := Nat.eq_of_beq_eq_true hm3 + dsimp only [NList.ConsValid, NList.toList, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + refine ⟨by omega, ⟨by omega, NList.LastOdd_add_even l_rest2 x1_0 (x0_0 + fa / 2 + 3) hlo2 (by omega)⟩, ?_⟩ + intro r + have h := step_cons_mod3_r l_rest2.toList x0_0 x1_0 fa r hfa hx2n1_3 + have ha : fa / 2 + 1 = fa / 2 + 3 - 2 := by omega + rw [ha] at h + exact h + +def evalWalk (ih_eval : NList → Nat → Nat) (l_rest : NList) (x0_0 fa : Nat) : Nat := + NList.rec evalWalkNil (evalWalkCons ih_eval) l_rest x0_0 fa + +theorem evalLoop_zero (l : NList) (fa : Nat) : evalLoop 0 l fa = 0 := rfl +theorem evalLoop_nil (fuel fa : Nat) : evalLoop fuel .nil fa = 0 := by cases fuel <;> rfl +theorem evalLoop_succ_cons (fuel x0_0 : Nat) (l_rest : NList) (fa : Nat) : + evalLoop (fuel + 1) (.cons x0_0 l_rest) fa = evalWalk (evalLoop fuel) l_rest x0_0 fa := rfl +theorem evalWalk_nil (ih_eval : NList → Nat → Nat) (x0_0 fa : Nat) : + evalWalk ih_eval .nil x0_0 fa = evalWalkNil x0_0 fa := rfl +theorem evalWalk_cons (ih_eval : NList → Nat → Nat) (x1_0 : Nat) (l_rest2 : NList) (x0_0 fa : Nat) : + evalWalk ih_eval (.cons x1_0 l_rest2) x0_0 fa = + evalWalkCons ih_eval x1_0 l_rest2 (evalWalk ih_eval l_rest2) x0_0 fa := rfl + +def EvalValid (l : NList) (fa res : Nat) : Prop := + res = 0 ∨ ReachesStar target_tm (CfgS l.toList fa [0, 1]) (Cn res) + +theorem evalWalk_spec (ih_eval : NList → Nat → Nat) + (hih_nil : ∀ fa, ih_eval .nil fa = 0) + (hih_cons : ∀ x0_0 l_rest fa, l_rest.LastOdd x0_0 → EvalValid (.cons x0_0 l_rest) fa (ih_eval (.cons x0_0 l_rest) fa)) + (l_rest : NList) (x0_0 fa : Nat) (hlo : l_rest.LastOdd x0_0) : + EvalValid (.cons x0_0 l_rest) fa (evalWalk ih_eval l_rest x0_0 fa) := by + induction l_rest generalizing x0_0 fa with + | nil => + rw [evalWalk_nil] + dsimp only [evalWalkNil, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hm1 : Nat.beq (fa % 4) 1 <;> dsimp only [Bool.rec] + · exact Or.inl rfl + · have hfa1 : fa % 4 = 1 := Nat.eq_of_beq_eq_true hm1 + dsimp only [finishEval, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hcond : Bool.and (Nat.ble 6 (x0_0 + (fa + 2))) (Nat.beq ((x0_0 + (fa + 2)) % 2) 0) <;> dsimp only [Bool.rec] + · exact Or.inl rfl + · rcases Bool.and_eq_true_iff.mp hcond with ⟨hc1, hc2⟩ + have hge6 : 6 ≤ x0_0 + (fa + 2) := Nat.le_of_ble_eq_true hc1 + have heven : (x0_0 + (fa + 2)) % 2 = 0 := Nat.eq_of_beq_eq_true hc2 + refine Or.inr ?_ + dsimp only [NList.toList] + have h1 := step_odd1_end [] x0_0 fa hfa1 + have ha : x0_0 + fa + 2 = x0_0 + (fa + 2) := by omega + rw [ha] at h1 + exact h1.trans (finish_even_spec (x0_0 + (fa + 2)) heven hge6) + | cons x1_0 l_rest2 ih_walk => + rcases hlo with ⟨hx0, hlo2⟩ + rw [evalWalk_cons] + dsimp only [evalWalkCons, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hm1 : Nat.beq (fa % 4) 1 <;> dsimp only [Bool.rec] + · cases hm3 : Nat.beq (fa % 4) 3 <;> dsimp only [Bool.rec] + · exact Or.inl rfl + · have hfa3 : fa % 4 = 3 := Nat.eq_of_beq_eq_true hm3 + dsimp only [evalWalkConsOdd3, evalWalkConsOdd3Aux1, evalWalkConsOdd3Aux2, nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq] + cases hx3 : Nat.beq ((x0_0 + fa / 2) % 4) 3 <;> dsimp only [Bool.rec] + · cases hge5 : Nat.ble 5 (x0_0 + fa / 2) <;> dsimp only [Bool.rec] + · exact Or.inl rfl + · have hx2n1_ge5 : 5 ≤ x0_0 + fa / 2 := Nat.le_of_ble_eq_true hge5 + have hx2n1_ne3 : (x0_0 + fa / 2) % 4 ≠ 3 := Nat.ne_of_beq_eq_false hx3 + have hfa_sub : (x0_0 + fa / 2 - 2) % 4 = 3 := by omega + have hexc := evalCons_spec l_rest2 x1_0 (x0_0 + fa / 2 - 2) hfa_sub hlo2 + cases hres : evalCons l_rest2 x1_0 (x0_0 + fa / 2 - 2) with + | nil => + exact Or.inl (hih_nil (fa / 2)) + | cons q_top l_inner => + rw [hres] at hexc + rcases hexc with ⟨hq2, hlo_in, hreach_in⟩ + rcases hih_cons q_top l_inner (fa / 2) hlo_in with h0 | hstep + · exact Or.inl h0 + · refine Or.inr ?_ + dsimp only [NList.toList] at hstep ⊢ + refine (step_down_cons_r (x1_0 :: l_rest2.toList) x0_0 fa [] hfa3 (by omega)).trans ?_ + refine (hreach_in _).trans ?_ + exact (step_up_walk_odd3 fa q_top l_inner.toList hfa3 hq2).trans hstep + · have hx2n1_3 : (x0_0 + fa / 2) % 4 = 3 := Nat.eq_of_beq_eq_true hx3 + have hlo_new : l_rest2.LastOdd (x1_0 + (x0_0 + fa / 2 + 3)) := + NList.LastOdd_add_even l_rest2 x1_0 (x0_0 + fa / 2 + 3) hlo2 (by omega) + rcases ih_walk (x1_0 + (x0_0 + fa / 2 + 3)) (fa / 2) hlo_new with h0 | hstep + · exact Or.inl h0 + · refine Or.inr ?_ + dsimp only [NList.toList] at hstep ⊢ + exact (step_walk_odd3_mod3 l_rest2.toList x0_0 x1_0 fa hfa3 hx2n1_3).trans hstep + · have hfa1 : fa % 4 = 1 := Nat.eq_of_beq_eq_true hm1 + rcases ih_walk x1_0 (x0_0 + (fa + 2)) hlo2 with h0 | hstep + · exact Or.inl h0 + · refine Or.inr ?_ + dsimp only [NList.toList] at hstep ⊢ + have h1 := step_odd1_end (x1_0 :: l_rest2.toList) x0_0 fa hfa1 + have ha : x0_0 + fa + 2 = x0_0 + (fa + 2) := by omega + rw [ha] at h1 + exact h1.trans hstep + +theorem evalLoop_spec (fuel x0_0 : Nat) (l_rest : NList) (fa : Nat) (hlo : l_rest.LastOdd x0_0) : + EvalValid (.cons x0_0 l_rest) fa (evalLoop fuel (.cons x0_0 l_rest) fa) := by + induction fuel generalizing x0_0 l_rest fa with + | zero => exact Or.inl rfl + | succ fuel ih => + rw [evalLoop_succ_cons] + exact evalWalk_spec (evalLoop fuel) (evalLoop_nil fuel) + (fun x0_0 l_rest fa hlo => ih x0_0 l_rest fa hlo) + l_rest x0_0 fa hlo + +theorem fastEval_spec (n : Nat) : + fastEval n = 0 ∨ ReachesStar target_tm (Cn n) (Cn (fastEval n)) := by + unfold fastEval + rw [nat_div_eq, nat_sub_eq, nat_mod_eq] + cases hcond : Bool.and (Nat.ble 12 n) (Nat.beq (n % 8) 4) <;> dsimp only [Bool.rec] + · exact Or.inl rfl + · rcases Bool.and_eq_true_iff.mp hcond with ⟨hc1, hc2⟩ + have hn12 : 12 ≤ n := Nat.le_of_ble_eq_true hc1 + have hn8 : n % 8 = 4 := Nat.eq_of_beq_eq_true hc2 + unfold fastEvalAux + rw [nat_mod_eq, nat_mod_eq, nat_add_eq, nat_mul_eq, nat_add_eq, nat_add_eq, nat_add_eq] + cases hm4 : Nat.beq ((n / 4 - 3) % 4) 2 <;> dsimp only [Bool.rec] + · cases hm8 : Nat.beq ((n / 4 - 3) % 8) 0 <;> dsimp only [Bool.rec] + · have hnil := evalNil4_spec 20 (n / 4 - 3) + cases hres : evalNil4 20 (n / 4 - 3) with + | nil => + dsimp only [fastEvalFromList, NList.rec] + exact Or.inl rfl + | cons q_top l_inner => + rw [hres] at hnil + rcases hnil with ⟨harec2, hq2, hlo, hreach_mid⟩ + dsimp only [fastEvalFromList, NList.rec] + unfold fastEvalStartCons + rw [nat_mul_eq, nat_add_eq, nat_add_eq, nat_add_eq] + have hlo_start : l_inner.LastOdd (q_top + (2 * (n / 4 - 3) + 10)) := + NList.LastOdd_add_even l_inner q_top (2 * (n / 4 - 3) + 10) hlo (by omega) + rcases evalLoop_spec 40 (q_top + (2 * (n / 4 - 3) + 10)) l_inner (n / 4 - 3 + 3) hlo_start with h0 | hstep + · exact Or.inl h0 + · refine Or.inr ?_ + refine (step_down_nil4 n [] hn8 hn12).trans ?_ + refine (hreach_mid _).trans ?_ + exact (step_start_loop (n / 4 - 3) q_top l_inner.toList harec2 hq2).trans hstep + · have harec8 : (n / 4 - 3) % 8 = 0 := Nat.eq_of_beq_eq_true hm8 + unfold fastEvalLeaf8 + rw [nat_div_eq] + cases hge8 : Nat.ble 8 (n / 4 - 3) <;> dsimp only [Bool.rec] + · exact Or.inl rfl + · have harec_ge8 : 8 ≤ n / 4 - 3 := Nat.le_of_ble_eq_true hge8 + unfold fastEvalLeaf8Aux + rw [nat_add_eq, nat_mul_eq, nat_add_eq, nat_add_eq, nat_add_eq, nat_add_eq] + have hlo_start : (NList.cons ((n / 4 - 3) / 2 + 3) NList.nil).LastOdd (((n / 4 - 3) / 2 + 4) + (2 * (n / 4 - 3) + 10)) := by + dsimp [NList.LastOdd]; omega + rcases evalLoop_spec 40 (((n / 4 - 3) / 2 + 4) + (2 * (n / 4 - 3) + 10)) + (NList.cons ((n / 4 - 3) / 2 + 3) NList.nil) (n / 4 - 3 + 3) hlo_start with h0 | hstep + · exact Or.inl h0 + · refine Or.inr ?_ + refine (step_down_nil4 n [] hn8 hn12).trans ?_ + refine (step_leaf_mod8_0 (n / 4 - 3) _ harec8 harec_ge8).trans ?_ + have hst := step_start_loop (n / 4 - 3) ((n / 4 - 3) / 2 + 4) [(n / 4 - 3) / 2 + 3] (by omega) (by omega) + have ha : (n / 4 - 3) / 2 + 2 = (n / 4 - 3) / 2 + 4 - 2 := by omega + rw [← ha] at hst + exact hst.trans hstep + · have harec4 : (n / 4 - 3) % 4 = 2 := Nat.eq_of_beq_eq_true hm4 + have hlo_start : (NList.cons 1 NList.nil).LastOdd ((n / 4 - 3 + 6) + (2 * (n / 4 - 3) + 10)) := by + dsimp [NList.LastOdd]; omega + rcases evalLoop_spec 40 ((n / 4 - 3 + 6) + (2 * (n / 4 - 3) + 10)) + (NList.cons 1 NList.nil) (n / 4 - 3 + 3) hlo_start with h0 | hstep + · exact Or.inl h0 + · refine Or.inr ?_ + refine (step_down_nil4 n [] hn8 hn12).trans ?_ + refine (step_leaf_mod4_2 (n / 4 - 3) _ harec4).trans ?_ + have hst := step_start_loop (n / 4 - 3) (n / 4 - 3 + 6) [1] (by omega) (by omega) + have ha : n / 4 - 3 + 4 = n / 4 - 3 + 6 - 2 := by omega + rw [← ha] at hst + exact hst.trans hstep + +-- Part 1: RuleTrie, chainRight, jumpRight, runEvalJump, and runTwoStage + +inductive OptRule where + | none : OptRule + | some : Nat → Nat → Nat → OptRule + +inductive RuleTrie where + | empty : RuleTrie + | pass : RuleTrie → RuleTrie → RuleTrie → RuleTrie → RuleTrie + | rule : Nat → Nat → Nat → RuleTrie → RuleTrie → RuleTrie → RuleTrie → RuleTrie + +def applies (base stride n : Nat) : Bool := + Bool.rec + false + (Bool.rec + (Nat.beq (Nat.mod (Nat.sub n base) stride) 0) + false + (Nat.beq stride 0)) + (Nat.ble base n) + +def lookupPass (_ _ _ _ : RuleTrie) (ih0 ih1 ih2 ih3 : Nat → OptRule → OptRule) + (rem : Nat) (best : OptRule) : OptRule := + Bool.rec + (Bool.rec (ih3 (Nat.div rem 4) best) (ih1 (Nat.div rem 4) best) (Nat.beq (Nat.mod rem 4) 1)) + (Bool.rec (ih2 (Nat.div rem 4) best) (ih0 (Nat.div rem 4) best) (Nat.beq (Nat.mod rem 4) 0)) + (Nat.beq (Nat.mod rem 2) 0) + +def lookupRule (rb rs rd : Nat) (_ _ _ _ : RuleTrie) (ih0 ih1 ih2 ih3 : Nat → OptRule → OptRule) + (rem : Nat) (_ : OptRule) : OptRule := + Bool.rec + (Bool.rec (ih3 (Nat.div rem 4) (OptRule.some rb rs rd)) (ih1 (Nat.div rem 4) (OptRule.some rb rs rd)) (Nat.beq (Nat.mod rem 4) 1)) + (Bool.rec (ih2 (Nat.div rem 4) (OptRule.some rb rs rd)) (ih0 (Nat.div rem 4) (OptRule.some rb rs rd)) (Nat.beq (Nat.mod rem 4) 0)) + (Nat.beq (Nat.mod rem 2) 0) + +def lookupEmpty (_ : Nat) (best : OptRule) : OptRule := best + +def trieLookup (t : RuleTrie) (rem : Nat) (best : OptRule) : OptRule := + RuleTrie.rec lookupEmpty lookupPass lookupRule t rem best + +def setRootEmpty (rb rs rd : Nat) : RuleTrie := + RuleTrie.rule rb rs rd RuleTrie.empty RuleTrie.empty RuleTrie.empty RuleTrie.empty + +def setRootPass (rb rs rd : Nat) (c0 c1 c2 c3 : RuleTrie) (_ _ _ _ : RuleTrie) : RuleTrie := + RuleTrie.rule rb rs rd c0 c1 c2 c3 + +def setRootRule (rb rs rd _ _ _ : Nat) (c0 c1 c2 c3 : RuleTrie) (_ _ _ _ : RuleTrie) : RuleTrie := + RuleTrie.rule rb rs rd c0 c1 c2 c3 + +def trieSetRoot (rb rs rd : Nat) (t : RuleTrie) : RuleTrie := + RuleTrie.rec (setRootEmpty rb rs rd) (setRootPass rb rs rd) (setRootRule rb rs rd) t + +def singleStep (rb rs rd : Nat) (_ : Nat) (ih : Nat → Nat → RuleTrie) (rem_b rem_s : Nat) : RuleTrie := + Bool.rec + (Bool.rec + (Bool.rec + (Bool.rec + (RuleTrie.pass RuleTrie.empty RuleTrie.empty RuleTrie.empty (ih (Nat.div rem_b 4) (Nat.div rem_s 4))) + (RuleTrie.pass RuleTrie.empty (ih (Nat.div rem_b 4) (Nat.div rem_s 4)) RuleTrie.empty RuleTrie.empty) + (Nat.beq (Nat.mod rem_b 4) 1)) + (Bool.rec + (RuleTrie.pass RuleTrie.empty RuleTrie.empty (ih (Nat.div rem_b 4) (Nat.div rem_s 4)) RuleTrie.empty) + (RuleTrie.pass (ih (Nat.div rem_b 4) (Nat.div rem_s 4)) RuleTrie.empty RuleTrie.empty RuleTrie.empty) + (Nat.beq (Nat.mod rem_b 4) 0)) + (Nat.beq (Nat.mod rem_b 2) 0)) + (Bool.rec + (RuleTrie.pass RuleTrie.empty (setRootEmpty rb rs rd) RuleTrie.empty (setRootEmpty rb rs rd)) + (RuleTrie.pass (setRootEmpty rb rs rd) RuleTrie.empty (setRootEmpty rb rs rd) RuleTrie.empty) + (Nat.beq (Nat.mod rem_b 2) 0)) + (Nat.beq rem_s 2)) + (setRootEmpty rb rs rd) + (Nat.ble rem_s 1) + +def singleBase (_ _ : Nat) : RuleTrie := RuleTrie.empty + +def trieSingleton (rb rs rd rem_b rem_s : Nat) : RuleTrie := + Nat.rec singleBase (singleStep rb rs rd) 16 rem_b rem_s + +def storePass (rb rs rd : Nat) (c0 c1 c2 c3 : RuleTrie) + (ih0 ih1 ih2 ih3 : Nat → Nat → RuleTrie) (rem_b rem_s : Nat) : RuleTrie := + Bool.rec + (Bool.rec + (Bool.rec + (Bool.rec + (RuleTrie.pass c0 c1 c2 (ih3 (Nat.div rem_b 4) (Nat.div rem_s 4))) + (RuleTrie.pass c0 (ih1 (Nat.div rem_b 4) (Nat.div rem_s 4)) c2 c3) + (Nat.beq (Nat.mod rem_b 4) 1)) + (Bool.rec + (RuleTrie.pass c0 c1 (ih2 (Nat.div rem_b 4) (Nat.div rem_s 4)) c3) + (RuleTrie.pass (ih0 (Nat.div rem_b 4) (Nat.div rem_s 4)) c1 c2 c3) + (Nat.beq (Nat.mod rem_b 4) 0)) + (Nat.beq (Nat.mod rem_b 2) 0)) + (Bool.rec + (RuleTrie.pass c0 (trieSetRoot rb rs rd c1) c2 (trieSetRoot rb rs rd c3)) + (RuleTrie.pass (trieSetRoot rb rs rd c0) c1 (trieSetRoot rb rs rd c2) c3) + (Nat.beq (Nat.mod rem_b 2) 0)) + (Nat.beq rem_s 2)) + (RuleTrie.rule rb rs rd c0 c1 c2 c3) + (Nat.ble rem_s 1) + +def storeRule (rb rs rd ob os od : Nat) (c0 c1 c2 c3 : RuleTrie) + (ih0 ih1 ih2 ih3 : Nat → Nat → RuleTrie) (rem_b rem_s : Nat) : RuleTrie := + Bool.rec + (Bool.rec + (Bool.rec + (Bool.rec + (RuleTrie.rule ob os od c0 c1 c2 (ih3 (Nat.div rem_b 4) (Nat.div rem_s 4))) + (RuleTrie.rule ob os od c0 (ih1 (Nat.div rem_b 4) (Nat.div rem_s 4)) c2 c3) + (Nat.beq (Nat.mod rem_b 4) 1)) + (Bool.rec + (RuleTrie.rule ob os od c0 c1 (ih2 (Nat.div rem_b 4) (Nat.div rem_s 4)) c3) + (RuleTrie.rule ob os od (ih0 (Nat.div rem_b 4) (Nat.div rem_s 4)) c1 c2 c3) + (Nat.beq (Nat.mod rem_b 4) 0)) + (Nat.beq (Nat.mod rem_b 2) 0)) + (Bool.rec + (RuleTrie.rule ob os od c0 (trieSetRoot rb rs rd c1) c2 (trieSetRoot rb rs rd c3)) + (RuleTrie.rule ob os od (trieSetRoot rb rs rd c0) c1 (trieSetRoot rb rs rd c2) c3) + (Nat.beq (Nat.mod rem_b 2) 0)) + (Nat.beq rem_s 2)) + (RuleTrie.rule rb rs rd c0 c1 c2 c3) + (Nat.ble rem_s 1) + +def trieStore (rb rs rd : Nat) (t : RuleTrie) (rem_b rem_s : Nat) : RuleTrie := + RuleTrie.rec (trieSingleton rb rs rd) (storePass rb rs rd) (storeRule rb rs rd) t rem_b rem_s + +def storeIf (rb rs rd : Nat) (t : RuleTrie) : RuleTrie := + Bool.rec + t + (trieStore rb rs rd t (Nat.div rb 8) (Nat.div rs 8)) + (Nat.ble (Nat.add rb rs) 34357641212) + +inductive ChainRes where + | mk : Nat → Nat → RuleTrie → ChainRes + +def chainJoinStore (n m d_new : Nat) (t' : RuleTrie) : ChainRes := + ChainRes.mk m d_new (storeIf n m d_new t') + +def chainJoinBody (n rs rd cs cd : Nat) (t' : RuleTrie) : ChainRes := + Bool.rec + (Bool.rec + (ChainRes.mk rs rd t') + (chainJoinStore n cs (Nat.add rd cd) t') + (Nat.beq (Nat.mod cs rs) 0)) + (Bool.rec + (ChainRes.mk rs rd t') + (chainJoinStore n rs (Nat.add rd cd) t') + (Nat.beq (Nat.mod rs cs) 0)) + (Nat.ble cs rs) + +def chainJoin (n rs rd : Nat) (res : ChainRes) : ChainRes := + ChainRes.rec (chainJoinBody n rs rd) res + +def chainStepSome (ih : RuleTrie → Nat → Nat → Nat → ChainRes) + (t : RuleTrie) (n rs rd n_next sb ss sd : Nat) : ChainRes := + Bool.rec + (ChainRes.mk rs rd t) + (chainJoin n rs rd (ih t n_next ss sd)) + (applies sb ss n_next) + +def chainStepAux (ih : RuleTrie → Nat → Nat → Nat → ChainRes) + (t : RuleTrie) (n rs rd n_next : Nat) : ChainRes := + OptRule.rec + (ChainRes.mk rs rd t) + (chainStepSome ih t n rs rd n_next) + (trieLookup t (Nat.div n_next 8) OptRule.none) + +def chainStep (_ : Nat) (ih : RuleTrie → Nat → Nat → Nat → ChainRes) + (t : RuleTrie) (n rs rd : Nat) : ChainRes := + chainStepAux ih t n rs rd (Nat.add n rd) + +def chainBase (t : RuleTrie) (_ rs rd : Nat) : ChainRes := + ChainRes.mk rs rd t + +def chainRight (fuel : Nat) (t : RuleTrie) (n rs rd : Nat) : ChainRes := + Nat.rec chainBase chainStep fuel t n rs rd + +def jumpStepSome (ih : Nat → Nat) (n sb ss sd : Nat) : Nat := + Bool.rec n (ih (Nat.add n sd)) (applies sb ss n) + +def jumpStep (t : RuleTrie) (_ : Nat) (ih : Nat → Nat) (n : Nat) : Nat := + OptRule.rec n (jumpStepSome ih n) (trieLookup t (Nat.div n 8) OptRule.none) + +def jumpRight (fuel : Nat) (t : RuleTrie) (n : Nat) : Nat := + Nat.rec (fun n => n) (jumpStep t) fuel n + +def runEvalJumpStepAux (t : RuleTrie) (ih : Nat → Nat) (n next : Nat) : Nat := + Bool.rec n (ih (jumpRight 20 t next)) (Nat.ble (Nat.add n 1) next) + +def runEvalJumpStep (t : RuleTrie) (_ : Nat) (ih : Nat → Nat) (n : Nat) : Nat := + runEvalJumpStepAux t ih n (fastEval n) + +def runEvalJump (t : RuleTrie) (steps n : Nat) : Nat := + Nat.rec (fun n => n) (runEvalJumpStep t) steps n + +def runAdvAfterChainBody (ih : Nat → RuleTrie → Nat) (n rd ss sd : Nat) (t' : RuleTrie) : Nat := + Bool.rec + (ih (Nat.add n sd) t') + (ih (Nat.add n sd) (storeIf n ss sd t')) + (Nat.beq sd rd) + +def runAdvAfterChain (ih : Nat → RuleTrie → Nat) (n rd : Nat) (res : ChainRes) : Nat := + ChainRes.rec (runAdvAfterChainBody ih n rd) res + +def runAdvStepSome (ih : Nat → RuleTrie → Nat) (n : Nat) (t : RuleTrie) (rs rd : Nat) : Nat := + Bool.rec + (ih (jumpRight 20 t (Nat.add n rd)) t) + (runAdvAfterChain ih n rd (chainRight 20 t n rs rd)) + (Nat.ble (Nat.add n rs) 34357641212) + +def runAdvStep (_ : Nat) (ih : Nat → RuleTrie → Nat) (n : Nat) (t : RuleTrie) : Nat := + CmpRule.rec + (runEvalJumpStepAux t (fun n' => ih n' t) n (fastEval n)) + (runAdvStepSome ih n t) + (fastCompile n) + +def runAdvBase (steps2 : Nat) (n : Nat) (t : RuleTrie) : Nat := + runEvalJump t steps2 n + +def runTwoStage (steps1 steps2 n : Nat) (t : RuleTrie) : Nat := + Nat.rec (runAdvBase steps2) runAdvStep steps1 n t + +-- Soundness of RuleTrie, chainRight, jumpRight, runEvalJump, and runTwoStage + +def OptRule.Valid : OptRule → Prop + | .none => True + | .some rb rs rd => valid rb rs rd + +def RuleTrie.Valid : RuleTrie → Prop + | .empty => True + | .pass c0 c1 c2 c3 => + RuleTrie.Valid c0 ∧ RuleTrie.Valid c1 ∧ RuleTrie.Valid c2 ∧ RuleTrie.Valid c3 + | .rule rb rs rd c0 c1 c2 c3 => + valid rb rs rd ∧ RuleTrie.Valid c0 ∧ RuleTrie.Valid c1 ∧ RuleTrie.Valid c2 ∧ RuleTrie.Valid c3 + +theorem applies_spec (rb rs n : Nat) (h : applies rb rs n = true) : + rb ≤ n ∧ rs ≠ 0 ∧ (n - rb) % rs = 0 := by + unfold applies at h + cases h1 : Nat.ble rb n <;> rw [h1] at h <;> dsimp only [Bool.rec] at h + · contradiction + · cases h2 : Nat.beq rs 0 <;> rw [h2] at h <;> dsimp only [Bool.rec] at h + · have h1' := Nat.le_of_ble_eq_true h1 + have h2' : rs ≠ 0 := by + intro h0; subst h0; revert h2; decide + have h3' := Nat.eq_of_beq_eq_true h + exact ⟨h1', h2', h3'⟩ + · contradiction + +theorem valid_zero (n rs rd : Nat) (hv : valid n rs rd) : + ReachesStar target_tm (Cn n) (Cn (n + rd)) := by + have h := hv 0 + rw [Nat.mul_zero, Nat.add_zero, Nat.add_zero] at h + exact h + +theorem valid_of_applies (sb ss sd n : Nat) (hv : valid sb ss sd) (ha : applies sb ss n = true) : + valid n ss sd := by + rcases applies_spec sb ss n ha with ⟨h1, _, h3⟩ + rcases Nat.dvd_of_mod_eq_zero h3 with ⟨k, hk⟩ + intro t + have h := hv (k + t) + have he1 : sb + ss * (k + t) = n + ss * t := by + have : ss * (k + t) = ss * k + ss * t := by ring + omega + have he2 : sb + sd + ss * (k + t) = n + sd + ss * t := by + have : ss * (k + t) = ss * k + ss * t := by ring + omega + rw [← he1, ← he2] + exact h + +theorem apply_rule (rb rs rd n : Nat) (hv : valid rb rs rd) (ha : applies rb rs n = true) : + ReachesStar target_tm (Cn n) (Cn (n + rd)) := + valid_zero n rs rd (valid_of_applies rb rs rd n hv ha) + +theorem join_rules_1 (n rs rd cs cd : Nat) (h1 : valid n rs rd) (h2 : valid (n + rd) cs cd) + (hm : rs % cs = 0) : valid n rs (rd + cd) := by + rcases Nat.dvd_of_mod_eq_zero hm with ⟨k, hk⟩ + intro t + have hr1 := h1 t + have hr2 := h2 (k * t) + have hmul : cs * (k * t) = rs * t := by rw [hk]; ring + rw [hmul] at hr2 + have heq : n + rd + cd + rs * t = n + (rd + cd) + rs * t := by omega + rw [heq] at hr2 + exact hr1.trans hr2 + +theorem join_rules_2 (n rs rd cs cd : Nat) (h1 : valid n rs rd) (h2 : valid (n + rd) cs cd) + (hm : cs % rs = 0) : valid n cs (rd + cd) := by + rcases Nat.dvd_of_mod_eq_zero hm with ⟨k, hk⟩ + intro t + have hr1 := h1 (k * t) + have hr2 := h2 t + have hmul : rs * (k * t) = cs * t := by rw [hk]; ring + rw [hmul] at hr1 + have heq : n + rd + cd + cs * t = n + (rd + cd) + cs * t := by omega + rw [heq] at hr2 + exact hr1.trans hr2 + +theorem trieLookup_spec (t : RuleTrie) (rem : Nat) (best : OptRule) + (ht : RuleTrie.Valid t) (hb : OptRule.Valid best) : + OptRule.Valid (trieLookup t rem best) := by + induction t generalizing rem best with + | empty => exact hb + | pass c0 c1 c2 c3 ih0 ih1 ih2 ih3 => + dsimp only [trieLookup, RuleTrie.rec, lookupPass] + cases Nat.beq (Nat.mod rem 2) 0 <;> cases Nat.beq (Nat.mod rem 4) 0 <;> cases Nat.beq (Nat.mod rem 4) 1 <;> + dsimp only [Bool.rec] + · exact ih3 (Nat.div rem 4) best ht.2.2.2 hb + · exact ih1 (Nat.div rem 4) best ht.2.1 hb + · exact ih3 (Nat.div rem 4) best ht.2.2.2 hb + · exact ih1 (Nat.div rem 4) best ht.2.1 hb + · exact ih2 (Nat.div rem 4) best ht.2.2.1 hb + · exact ih2 (Nat.div rem 4) best ht.2.2.1 hb + · exact ih0 (Nat.div rem 4) best ht.1 hb + · exact ih0 (Nat.div rem 4) best ht.1 hb + | rule rb rs rd c0 c1 c2 c3 ih0 ih1 ih2 ih3 => + dsimp only [trieLookup, RuleTrie.rec, lookupRule] + cases Nat.beq (Nat.mod rem 2) 0 <;> cases Nat.beq (Nat.mod rem 4) 0 <;> cases Nat.beq (Nat.mod rem 4) 1 <;> + dsimp only [Bool.rec] + · exact ih3 (Nat.div rem 4) (OptRule.some rb rs rd) ht.2.2.2.2 ht.1 + · exact ih1 (Nat.div rem 4) (OptRule.some rb rs rd) ht.2.2.1 ht.1 + · exact ih3 (Nat.div rem 4) (OptRule.some rb rs rd) ht.2.2.2.2 ht.1 + · exact ih1 (Nat.div rem 4) (OptRule.some rb rs rd) ht.2.2.1 ht.1 + · exact ih2 (Nat.div rem 4) (OptRule.some rb rs rd) ht.2.2.2.1 ht.1 + · exact ih2 (Nat.div rem 4) (OptRule.some rb rs rd) ht.2.2.2.1 ht.1 + · exact ih0 (Nat.div rem 4) (OptRule.some rb rs rd) ht.2.1 ht.1 + · exact ih0 (Nat.div rem 4) (OptRule.some rb rs rd) ht.2.1 ht.1 + +theorem trieSetRoot_spec (rb rs rd : Nat) (t : RuleTrie) + (hr : valid rb rs rd) (ht : RuleTrie.Valid t) : + RuleTrie.Valid (trieSetRoot rb rs rd t) := by + cases t with + | empty => exact ⟨hr, trivial, trivial, trivial, trivial⟩ + | pass c0 c1 c2 c3 => exact ⟨hr, ht.1, ht.2.1, ht.2.2.1, ht.2.2.2⟩ + | rule ob os od c0 c1 c2 c3 => exact ⟨hr, ht.2.1, ht.2.2.1, ht.2.2.2.1, ht.2.2.2.2⟩ + +theorem trieSingleton_gen_spec (fuel rb rs rd rem_b rem_s : Nat) (hr : valid rb rs rd) : + RuleTrie.Valid (Nat.rec singleBase (singleStep rb rs rd) fuel rem_b rem_s) := by + induction fuel generalizing rem_b rem_s with + | zero => trivial + | succ fuel ih => + dsimp only [Nat.rec, singleStep, setRootEmpty] + cases Nat.ble rem_s 1 <;> dsimp only [Bool.rec, RuleTrie.Valid] + · cases Nat.beq rem_s 2 <;> dsimp only [Bool.rec, RuleTrie.Valid] + · have hih := ih (Nat.div rem_b 4) (Nat.div rem_s 4) + cases Nat.beq (Nat.mod rem_b 2) 0 <;> cases Nat.beq (Nat.mod rem_b 4) 0 <;> cases Nat.beq (Nat.mod rem_b 4) 1 <;> + dsimp only [Bool.rec, RuleTrie.Valid] + · exact ⟨trivial, trivial, trivial, hih⟩ + · exact ⟨trivial, hih, trivial, trivial⟩ + · exact ⟨trivial, trivial, trivial, hih⟩ + · exact ⟨trivial, hih, trivial, trivial⟩ + · exact ⟨trivial, trivial, hih, trivial⟩ + · exact ⟨trivial, trivial, hih, trivial⟩ + · exact ⟨hih, trivial, trivial, trivial⟩ + · exact ⟨hih, trivial, trivial, trivial⟩ + · cases Nat.beq (Nat.mod rem_b 2) 0 <;> dsimp only [Bool.rec, RuleTrie.Valid] + · exact ⟨trivial, ⟨hr, trivial, trivial, trivial, trivial⟩, trivial, ⟨hr, trivial, trivial, trivial, trivial⟩⟩ + · exact ⟨⟨hr, trivial, trivial, trivial, trivial⟩, trivial, ⟨hr, trivial, trivial, trivial, trivial⟩, trivial⟩ + · exact ⟨hr, trivial, trivial, trivial, trivial⟩ + +theorem trieStore_spec (rb rs rd : Nat) (t : RuleTrie) (rem_b rem_s : Nat) + (hr : valid rb rs rd) (ht : RuleTrie.Valid t) : + RuleTrie.Valid (trieStore rb rs rd t rem_b rem_s) := by + induction t generalizing rem_b rem_s with + | empty => exact trieSingleton_gen_spec 16 rb rs rd rem_b rem_s hr + | pass c0 c1 c2 c3 ih0 ih1 ih2 ih3 => + dsimp only [trieStore, RuleTrie.rec, storePass] + cases Nat.ble rem_s 1 <;> dsimp only [Bool.rec, RuleTrie.Valid] + · cases Nat.beq rem_s 2 <;> dsimp only [Bool.rec, RuleTrie.Valid] + · have hi0 := ih0 (Nat.div rem_b 4) (Nat.div rem_s 4) ht.1 + have hi1 := ih1 (Nat.div rem_b 4) (Nat.div rem_s 4) ht.2.1 + have hi2 := ih2 (Nat.div rem_b 4) (Nat.div rem_s 4) ht.2.2.1 + have hi3 := ih3 (Nat.div rem_b 4) (Nat.div rem_s 4) ht.2.2.2 + cases Nat.beq (Nat.mod rem_b 2) 0 <;> cases Nat.beq (Nat.mod rem_b 4) 0 <;> cases Nat.beq (Nat.mod rem_b 4) 1 <;> + dsimp only [Bool.rec, RuleTrie.Valid] + · exact ⟨ht.1, ht.2.1, ht.2.2.1, hi3⟩ + · exact ⟨ht.1, hi1, ht.2.2.1, ht.2.2.2⟩ + · exact ⟨ht.1, ht.2.1, ht.2.2.1, hi3⟩ + · exact ⟨ht.1, hi1, ht.2.2.1, ht.2.2.2⟩ + · exact ⟨ht.1, ht.2.1, hi2, ht.2.2.2⟩ + · exact ⟨ht.1, ht.2.1, hi2, ht.2.2.2⟩ + · exact ⟨hi0, ht.2.1, ht.2.2.1, ht.2.2.2⟩ + · exact ⟨hi0, ht.2.1, ht.2.2.1, ht.2.2.2⟩ + · cases Nat.beq (Nat.mod rem_b 2) 0 <;> dsimp only [Bool.rec, RuleTrie.Valid] + · exact ⟨ht.1, trieSetRoot_spec rb rs rd c1 hr ht.2.1, ht.2.2.1, trieSetRoot_spec rb rs rd c3 hr ht.2.2.2⟩ + · exact ⟨trieSetRoot_spec rb rs rd c0 hr ht.1, ht.2.1, trieSetRoot_spec rb rs rd c2 hr ht.2.2.1, ht.2.2.2⟩ + · exact ⟨hr, ht.1, ht.2.1, ht.2.2.1, ht.2.2.2⟩ + | rule ob os od c0 c1 c2 c3 ih0 ih1 ih2 ih3 => + dsimp only [trieStore, RuleTrie.rec, storeRule] + cases Nat.ble rem_s 1 <;> dsimp only [Bool.rec, RuleTrie.Valid] + · cases Nat.beq rem_s 2 <;> dsimp only [Bool.rec, RuleTrie.Valid] + · have hi0 := ih0 (Nat.div rem_b 4) (Nat.div rem_s 4) ht.2.1 + have hi1 := ih1 (Nat.div rem_b 4) (Nat.div rem_s 4) ht.2.2.1 + have hi2 := ih2 (Nat.div rem_b 4) (Nat.div rem_s 4) ht.2.2.2.1 + have hi3 := ih3 (Nat.div rem_b 4) (Nat.div rem_s 4) ht.2.2.2.2 + cases Nat.beq (Nat.mod rem_b 2) 0 <;> cases Nat.beq (Nat.mod rem_b 4) 0 <;> cases Nat.beq (Nat.mod rem_b 4) 1 <;> + dsimp only [Bool.rec, RuleTrie.Valid] + · exact ⟨ht.1, ht.2.1, ht.2.2.1, ht.2.2.2.1, hi3⟩ + · exact ⟨ht.1, ht.2.1, hi1, ht.2.2.2.1, ht.2.2.2.2⟩ + · exact ⟨ht.1, ht.2.1, ht.2.2.1, ht.2.2.2.1, hi3⟩ + · exact ⟨ht.1, ht.2.1, hi1, ht.2.2.2.1, ht.2.2.2.2⟩ + · exact ⟨ht.1, ht.2.1, ht.2.2.1, hi2, ht.2.2.2.2⟩ + · exact ⟨ht.1, ht.2.1, ht.2.2.1, hi2, ht.2.2.2.2⟩ + · exact ⟨ht.1, hi0, ht.2.2.1, ht.2.2.2.1, ht.2.2.2.2⟩ + · exact ⟨ht.1, hi0, ht.2.2.1, ht.2.2.2.1, ht.2.2.2.2⟩ + · cases Nat.beq (Nat.mod rem_b 2) 0 <;> dsimp only [Bool.rec, RuleTrie.Valid] + · exact ⟨ht.1, ht.2.1, trieSetRoot_spec rb rs rd c1 hr ht.2.2.1, ht.2.2.2.1, trieSetRoot_spec rb rs rd c3 hr ht.2.2.2.2⟩ + · exact ⟨ht.1, trieSetRoot_spec rb rs rd c0 hr ht.2.1, ht.2.2.1, trieSetRoot_spec rb rs rd c2 hr ht.2.2.2.1, ht.2.2.2.2⟩ + · exact ⟨hr, ht.2.1, ht.2.2.1, ht.2.2.2.1, ht.2.2.2.2⟩ + +theorem storeIf_spec (rb rs rd : Nat) (t : RuleTrie) (hr : valid rb rs rd) (ht : RuleTrie.Valid t) : + RuleTrie.Valid (storeIf rb rs rd t) := by + unfold storeIf + cases Nat.ble (Nat.add rb rs) 34357641212 <;> dsimp only [Bool.rec] + · exact ht + · exact trieStore_spec rb rs rd t (Nat.div rb 8) (Nat.div rs 8) hr ht + +def ChainRes.Valid (n : Nat) : ChainRes → Prop + | .mk cs cd t' => valid n cs cd ∧ RuleTrie.Valid t' + +theorem chainJoin_spec (n rs rd : Nat) (res : ChainRes) + (hr : valid n rs rd) (hres : ChainRes.Valid (n + rd) res) : + ChainRes.Valid n (chainJoin n rs rd res) := by + rcases res with ⟨cs, cd, t'⟩ + rcases hres with ⟨hcs, ht'⟩ + dsimp only [chainJoin, ChainRes.rec, chainJoinBody, chainJoinStore, nat_add_eq, nat_mod_eq] + cases Nat.ble cs rs <;> dsimp only [Bool.rec] + · cases hm : Nat.beq (cs % rs) 0 <;> dsimp only [Bool.rec, ChainRes.Valid] + · exact ⟨hr, ht'⟩ + · have hjoin := join_rules_2 n rs rd cs cd hr hcs (Nat.eq_of_beq_eq_true hm) + exact ⟨hjoin, storeIf_spec n cs (rd + cd) t' hjoin ht'⟩ + · cases hm : Nat.beq (rs % cs) 0 <;> dsimp only [Bool.rec, ChainRes.Valid] + · exact ⟨hr, ht'⟩ + · have hjoin := join_rules_1 n rs rd cs cd hr hcs (Nat.eq_of_beq_eq_true hm) + exact ⟨hjoin, storeIf_spec n rs (rd + cd) t' hjoin ht'⟩ + +theorem chainRight_spec (fuel : Nat) (t : RuleTrie) (n rs rd : Nat) + (ht : RuleTrie.Valid t) (hr : valid n rs rd) : + ChainRes.Valid n (chainRight fuel t n rs rd) := by + induction fuel generalizing t n rs rd with + | zero => exact ⟨hr, ht⟩ + | succ fuel ih => + dsimp only [chainRight, Nat.rec, chainStep, chainStepAux, nat_add_eq] + have hlu := trieLookup_spec t (Nat.div (n + rd) 8) OptRule.none ht trivial + cases hl : trieLookup t (Nat.div (n + rd) 8) OptRule.none with + | none => dsimp only [OptRule.rec, ChainRes.Valid]; exact ⟨hr, ht⟩ + | some sb ss sd => + rw [hl] at hlu + dsimp only [OptRule.rec, chainStepSome] + cases hap : applies sb ss (n + rd) <;> dsimp only [Bool.rec, ChainRes.Valid] + · exact ⟨hr, ht⟩ + · have hnext := valid_of_applies sb ss sd (n + rd) hlu hap + exact chainJoin_spec n rs rd (chainRight fuel t (n + rd) ss sd) hr + (ih t (n + rd) ss sd ht hnext) + +theorem jumpRight_spec (fuel : Nat) (t : RuleTrie) (n : Nat) (ht : RuleTrie.Valid t) : + ReachesStar target_tm (Cn n) (Cn (jumpRight fuel t n)) := by + induction fuel generalizing n with + | zero => try exact ReachesStar.refl _ _ + | succ fuel ih => + dsimp only [jumpRight, Nat.rec, jumpStep] + have hlu := trieLookup_spec t (Nat.div n 8) OptRule.none ht trivial + cases hl : trieLookup t (Nat.div n 8) OptRule.none with + | none => dsimp only [OptRule.rec]; try exact ReachesStar.refl _ _ + | some sb ss sd => + rw [hl] at hlu + dsimp only [OptRule.rec, jumpStepSome, nat_add_eq] + cases hap : applies sb ss n <;> dsimp only [Bool.rec] + · try exact ReachesStar.refl _ _ + · exact (apply_rule sb ss sd n hlu hap).trans (ih (n + sd)) + +theorem runEvalJump_spec (t : RuleTrie) (steps n : Nat) (ht : RuleTrie.Valid t) : + ReachesStar target_tm (Cn n) (Cn (runEvalJump t steps n)) := by + induction steps generalizing n with + | zero => try exact ReachesStar.refl _ _ + | succ steps ih => + dsimp only [runEvalJump, Nat.rec, runEvalJumpStep, runEvalJumpStepAux, nat_add_eq] + cases hle : Nat.ble (n + 1) (fastEval n) <;> dsimp only [Bool.rec] + · try exact ReachesStar.refl _ _ + · have hgt : n + 1 ≤ fastEval n := Nat.le_of_ble_eq_true hle + rcases fastEval_spec n with h0 | hstep + · omega + · exact hstep.trans ((jumpRight_spec 20 t (fastEval n) ht).trans (ih (jumpRight 20 t (fastEval n)))) + +theorem runTwoStage_spec (steps1 steps2 n : Nat) (t : RuleTrie) (ht : RuleTrie.Valid t) : + ReachesStar target_tm (Cn n) (Cn (runTwoStage steps1 steps2 n t)) := by + induction steps1 generalizing n t with + | zero => + dsimp only [runTwoStage, Nat.rec, runAdvBase] + exact runEvalJump_spec t steps2 n ht + | succ steps1 ih => + dsimp only [runTwoStage, Nat.rec, runAdvStep] + have hcomp := fastCompile_spec n + cases hc : fastCompile n with + | none => + dsimp only [CmpRule.rec, runEvalJumpStepAux, nat_add_eq] + cases hle : Nat.ble (n + 1) (fastEval n) <;> dsimp only [Bool.rec] + · try exact ReachesStar.refl _ _ + · have hgt : n + 1 ≤ fastEval n := Nat.le_of_ble_eq_true hle + rcases fastEval_spec n with h0 | hstep + · omega + · exact hstep.trans ((jumpRight_spec 20 t (fastEval n) ht).trans (ih (jumpRight 20 t (fastEval n)) t ht)) + | some rs rd => + rw [hc] at hcomp + dsimp only [CmpRule.rec, runAdvStepSome, nat_add_eq] + cases Nat.ble (n + rs) 34357641212 <;> dsimp only [Bool.rec] + · exact (valid_zero n rs rd hcomp).trans + ((jumpRight_spec 20 t (n + rd) ht).trans (ih (jumpRight 20 t (n + rd)) t ht)) + · have hch := chainRight_spec 20 t n rs rd ht hcomp + rcases hcr : chainRight 20 t n rs rd with ⟨ss, sd, t'⟩ + rw [hcr] at hch + rcases hch with ⟨hss, ht'⟩ + dsimp only [runAdvAfterChain, ChainRes.rec, runAdvAfterChainBody, nat_add_eq] + have hstep := valid_zero n ss sd hss + cases Nat.beq sd rd <;> dsimp only [Bool.rec] + · exact hstep.trans (ih (n + sd) t' ht') + · exact hstep.trans (ih (n + sd) (storeIf n ss sd t') (storeIf_spec n ss sd t' hss ht')) + + +structure Ops where + num : Type + sample : num → Nat + con : Nat → num + add : num → num → num + sub : num → num → Option num + div : num → Nat → Option (num × Nat) + eq : num → num → Bool + +structure Laws (o : Ops) (v : o.num → Nat) : Prop where + con_ok : ∀ x, v (o.con x) = x + add_ok : ∀ x y, v (o.add x y) = v x + v y + sub_ok : ∀ x y z, o.sub x y = some z → v z + v y = v x + div_ok : ∀ x n q d, o.div x n = some (q, d) → v q * n + d = v x + eq_ok : ∀ x y, o.eq x y = true → v x = v y + +inductive Phase where + | PS | PT | PU | PV + deriving DecidableEq + +structure Frame (num : Type) where + p : Phase + l : List (num × num) + a : num + r : List (num × num) + +def push (o : Ops) (x n : o.num) (l : List (o.num × o.num)) : List (o.num × o.num) := + if o.eq n (o.con 0) then l else + match l with + | (y, m) :: l' => if o.eq x y then (y, o.add n m) :: l' else (x, n) :: l + | [] => [(x, n)] + +def pop (o : Ops) : List (o.num × o.num) → Option (o.num × List (o.num × o.num)) + | [] => some (o.con 0, []) + | (x, n) :: l' => + if o.eq n (o.con 0) then pop o l' + else match o.sub n (o.con 1) with + | some n' => some (x, if o.eq n' (o.con 0) then l' else (x, n') :: l') + | none => none + +def near (o : Ops) : List (o.num × o.num) → o.num + | [] => o.con 0 + | (x, _) :: _ => x + +def expand (o : Ops) (v : o.num → Nat) : List (o.num × o.num) → List Nat + | [] => [] + | (x, n) :: l' => List.replicate (v n) (v x) ++ expand o v l' + +def meaning (o : Ops) (v : o.num → Nat) (x : Frame o.num) : Cfg (Fin 2) (Fin 6) := + match x.p with + | .PS => CfgS (expand o v x.l) (v x.a) (expand o v x.r) + | .PT => CfgT (expand o v x.l) (v x.a) (expand o v x.r) + | .PU => CfgU (expand o v x.l) (v x.a) (expand o v x.r) + | .PV => CfgV (expand o v x.l) (v x.a) (expand o v x.r) + +theorem push_ok (o : Ops) (v : o.num → Nat) (H : Laws o v) (x n : o.num) (l : List (o.num × o.num)) : + expand o v (push o x n l) = List.replicate (v n) (v x) ++ expand o v l := by + unfold push + cases h1 : o.eq n (o.con 0) + · simp only [Bool.false_eq_true, ↓reduceIte] + cases l with + | nil => simp [expand] + | cons ym l' => + rcases ym with ⟨y, m⟩ + cases h2 : o.eq x y + · simp [h2, expand] + · simp only [h2, ↓reduceIte, expand, H.add_ok, H.eq_ok _ _ h2, List.replicate_add, List.append_assoc] + · simp only [↓reduceIte, H.eq_ok _ _ h1, H.con_ok, List.replicate_zero, List.nil_append] + +theorem pop_ok (o : Ops) (v : o.num → Nat) (H : Laws o v) (l : List (o.num × o.num)) (x : o.num) (l' : List (o.num × o.num)) + (hp : pop o l = some (x, l')) : + LC (expand o v l) = LC (v x :: expand o v l') ∧ RC (expand o v l) = RC (v x :: expand o v l') := by + induction l generalizing x l' with + | nil => + simp only [pop, Option.some.injEq, Prod.mk.injEq] at hp + rcases hp with ⟨rfl, rfl⟩ + simp only [expand, H.con_ok] + exact ⟨Lblank, Rblank []⟩ + | cons yn l ih => + rcases yn with ⟨y, n⟩ + simp only [pop] at hp + cases h1 : o.eq n (o.con 0) + · simp only [h1, Bool.false_eq_true, ↓reduceIte] at hp + cases h2 : o.sub n (o.con 1) with + | none => simp [h2] at hp + | some k => + simp only [h2, Option.some.injEq, Prod.mk.injEq] at hp + rcases hp with ⟨rfl, rfl⟩ + have hk := H.sub_ok n (o.con 1) k h2 + rw [H.con_ok] at hk + cases h3 : o.eq k (o.con 0) + · simp only [h3, Bool.false_eq_true, ↓reduceIte, expand, ← hk, List.replicate_succ, List.cons_append, and_self] + · simp only [h3, ↓reduceIte, expand, ← hk, H.eq_ok _ _ h3, H.con_ok, List.replicate, List.cons_append, List.nil_append, and_self] + · simp only [h1, ↓reduceIte] at hp + simp only [expand, H.eq_ok _ _ h1, H.con_ok, List.replicate_zero, List.nil_append] + exact ih x l' hp + +def drain_T (o : Ops) : Nat → List (o.num × o.num) → o.num → List (o.num × o.num) → + List (o.num × o.num) × o.num × List (o.num × o.num) + | 0, l, a, r2 => (l, a, r2) + | fuel + 1, l, a, (d2, n2) :: (d1, k) :: r3 => + if o.eq d2 (o.con 2) && o.eq n2 (o.con 1) && o.eq d1 (o.con 1) then + drain_T o fuel (push o (o.add (o.con 2) a) (o.con 1) l) (o.add k k) r3 + else + (l, a, (d2, n2) :: (d1, k) :: r3) + | _ + 1, l, a, r2 => (l, a, r2) + +theorem drain_T_spec (o : Ops) (v : o.num → Nat) (H : Laws o v) (fuel : Nat) + (l : List (o.num × o.num)) (a : o.num) (r2 : List (o.num × o.num)) : + let res := drain_T o fuel l a r2 + ReachesStar target_tm + (CfgT (expand o v l) (v a) (0 :: expand o v r2)) + (CfgT (expand o v res.1) (v res.2.1) (0 :: expand o v res.2.2)) := by + induction fuel generalizing l a r2 with + | zero => try exact ReachesStar.refl _ _ + | succ fuel ih => + rcases r2 with _ | ⟨⟨d2, n2⟩, _ | ⟨⟨d1, k⟩, r3⟩⟩ + · try exact ReachesStar.refl _ _ + · try exact ReachesStar.refl _ _ + · dsimp only [drain_T] + cases h1 : o.eq d2 (o.con 2) <;> cases h2 : o.eq n2 (o.con 1) <;> cases h3 : o.eq d1 (o.con 1) <;> + simp only [Bool.and_self, Bool.and_false, Bool.false_and, Bool.false_eq_true, ↓reduceIte] + any_goals try exact ReachesStar.refl _ _ + have hd2 := H.eq_ok _ _ h1; rw [H.con_ok] at hd2 + have hn2 := H.eq_ok _ _ h2; rw [H.con_ok] at hn2 + have hd1 := H.eq_ok _ _ h3; rw [H.con_ok] at hd1 + have hexp : expand o v ((d2, n2) :: (d1, k) :: r3) = 2 :: (List.replicate (v k) 1 ++ expand o v r3) := by + simp only [expand, hd2, hn2, hd1, List.replicate, List.cons_append, List.nil_append] + rw [hexp] + refine (T_21_lemma (v k) (expand o v l) (v a) (expand o v r3)).trans ?_ + have hpush : expand o v (push o (o.add (o.con 2) a) (o.con 1) l) = (2 + v a) :: expand o v l := by + simp only [push_ok o v H, H.con_ok, H.add_ok, List.replicate, List.cons_append, List.nil_append] + have hadd : v (o.add k k) = v k * 2 := by + rw [H.add_ok]; omega + rw [← hpush, ← hadd] + exact ih (push o (o.add (o.con 2) a) (o.con 1) l) (o.add k k) r3 + +def step_PV (o : Ops) (l : List (o.num × o.num)) (a : o.num) (r : List (o.num × o.num)) : + Option (Option (Frame o.num)) := + if Nat.beq (o.sample a) 0 then + if o.eq a (o.con 0) then + match pop o l with + | some (x, l') => some (some ⟨.PT, l', o.add (o.con 1) x, r⟩) + | none => none + else none + else if Nat.beq (o.sample a) 1 then + if o.eq a (o.con 1) then some none else none + else + match o.sub a (o.con 2) with + | some a' => some (some ⟨.PU, l, a', push o (o.con 1) (o.con 1) r⟩) + | none => none + +theorem step_PV_spec (o : Ops) (v : o.num → Nat) (H : Laws o v) + (l : List (o.num × o.num)) (a : o.num) (r : List (o.num × o.num)) : + match step_PV o l a r with + | some (some y) => ReachesStar target_tm (CfgV (expand o v l) (v a) (expand o v r)) (meaning o v y) + | some none => HaltsFrom target_tm (CfgV (expand o v l) (v a) (expand o v r)) + | none => True := by + unfold step_PV + split_ifs with h1 h2 h3 h4 + · cases hp : pop o l with + | none => trivial + | some xl => + rcases xl with ⟨x, l'⟩ + dsimp only [meaning] + have ha := H.eq_ok _ _ h2; rw [H.con_ok] at ha + have hpop := (pop_ok o v H l x l' hp).1 + rw [ha, CfgV, hpop, ← CfgV, H.add_ok, H.con_ok] + exact Vzero (expand o v l') (v x) (expand o v r) + · trivial + · have ha := H.eq_ok _ _ h4; rw [H.con_ok] at ha + rw [ha] + exact HV (expand o v l) (expand o v r) + · trivial + · cases hs : o.sub a (o.con 2) with + | none => trivial + | some a' => + dsimp only [meaning] + have hsub := H.sub_ok a (o.con 2) a' hs; rw [H.con_ok] at hsub + have ha : v a = 2 + v a' := by omega + rw [ha, push_ok o v H, H.con_ok] + simpa [List.replicate] using Vpos (expand o v l) (v a') (expand o v r) + +def step_PU (o : Ops) (l : List (o.num × o.num)) (a : o.num) (r : List (o.num × o.num)) : + Option (Option (Frame o.num)) := + if Nat.blt 0 (o.sample a) then + match o.sub a (o.con 1) with + | some a' => some (some ⟨.PS, l, a', push o (o.con 0) (o.con 1) r⟩) + | none => none + else if o.eq a (o.con 0) then + match pop o l, pop o r with + | some (x, l'), some (c, r') => + some (some ⟨.PV, l', x, push o (o.add (o.con 1) c) (o.con 1) r'⟩) + | _, _ => none + else none + +theorem step_PU_spec (o : Ops) (v : o.num → Nat) (H : Laws o v) + (l : List (o.num × o.num)) (a : o.num) (r : List (o.num × o.num)) : + match step_PU o l a r with + | some (some y) => ReachesStar target_tm (CfgU (expand o v l) (v a) (expand o v r)) (meaning o v y) + | some none => HaltsFrom target_tm (CfgU (expand o v l) (v a) (expand o v r)) + | none => True := by + unfold step_PU + split_ifs with h1 h2 + · cases hs : o.sub a (o.con 1) with + | none => trivial + | some a' => + dsimp only [meaning] + have hsub := H.sub_ok a (o.con 1) a' hs; rw [H.con_ok] at hsub + have ha : v a = 1 + v a' := by omega + rw [ha, push_ok o v H] + simpa [List.replicate, H.con_ok] using Upos (expand o v l) (v a') (expand o v r) + · cases hpl : pop o l with + | none => trivial + | some xl => + cases hpr : pop o r with + | none => trivial + | some cr => + rcases xl with ⟨x, l'⟩; rcases cr with ⟨c, r'⟩ + dsimp only [meaning] + have ha := H.eq_ok _ _ h2; rw [H.con_ok] at ha + rw [ha, CfgU, (pop_ok o v H l x l' hpl).1, (pop_ok o v H r c r' hpr).2, ← CfgU] + rw [push_ok o v H] + simpa [List.replicate, H.con_ok, H.add_ok] using Uzero (expand o v l') (v x) (v c) (expand o v r') + · trivial + +def step_PT (o : Ops) (l : List (o.num × o.num)) (a : o.num) (r : List (o.num × o.num)) : + Option (Option (Frame o.num)) := + match pop o r with + | some (c, r') => + if Nat.blt 0 (o.sample c) then + match o.sub c (o.con 1) with + | some n => + some (some ⟨.PT, push o (o.con 0) n (push o a (o.con 1) l), o.con 0, + push o (o.con 0) (o.con 1) r'⟩) + | none => none + else if o.eq c (o.con 0) then + match r' with + | (d, n) :: r'' => + if Nat.beq (o.sample d) 1 then + if o.eq d (o.con 1) then + some (some ⟨.PT, l, o.add a (o.add n n), push o (o.con 0) (o.con 1) r''⟩) + else none + else + match pop o ((d, n) :: r'') with + | some (d0, r2) => + if Nat.beq (o.sample d0) 0 then + if o.eq d0 (o.con 0) then + some (some ⟨.PU, l, a, push o (o.con 1) (o.con 1) r2⟩) + else none + else + match o.sub d0 (o.con 1) with + | some d' => + some (some ⟨.PT, l, o.add (o.con 2) a, push o d' (o.con 1) r2⟩) + | none => none + | none => none + | [] => some (some ⟨.PU, l, a, push o (o.con 1) (o.con 1) []⟩) + else none + | none => none + +theorem step_PT_spec (o : Ops) (v : o.num → Nat) (H : Laws o v) + (l : List (o.num × o.num)) (a : o.num) (r : List (o.num × o.num)) : + match step_PT o l a r with + | some (some y) => ReachesStar target_tm (CfgT (expand o v l) (v a) (expand o v r)) (meaning o v y) + | some none => HaltsFrom target_tm (CfgT (expand o v l) (v a) (expand o v r)) + | none => True := by + unfold step_PT + cases hpr : pop o r with + | none => trivial + | some cr => + rcases cr with ⟨c, r'⟩ + dsimp only + have hrc := (pop_ok o v H r c r' hpr).2 + split_ifs with h1 h2 + · cases hs : o.sub c (o.con 1) with + | none => trivial + | some n => + dsimp only [meaning] + have hsub := H.sub_ok c (o.con 1) n hs; rw [H.con_ok] at hsub + have hc : v c = 1 + v n := by omega + rw [CfgT, hrc, ← CfgT, hc] + rw [push_ok o v H, push_ok o v H, push_ok o v H] + simpa [List.replicate, H.con_ok] using Trights (v n) (expand o v l) (v a) (expand o v r') + · have hc := H.eq_ok _ _ h2; rw [H.con_ok] at hc + cases r' with + | nil => + dsimp only [meaning] + rw [CfgT, hrc, hc, expand, Rblank [0], ← CfgT] + rw [push_ok o v H, expand] + simpa [List.replicate, H.con_ok] using Tzero (expand o v l) (v a) [] + | cons dn r'' => + rcases dn with ⟨d, n⟩ + dsimp only + split_ifs with h3 h4 + · dsimp only [meaning] + have hd := H.eq_ok _ _ h4; rw [H.con_ok] at hd + rw [CfgT, hrc, hc, expand, hd, ← CfgT] + rw [push_ok o v H, H.add_ok, H.add_ok] + have ha : v a + (v n + v n) = v n * 2 + v a := by omega + rw [ha] + simpa [List.replicate, H.con_ok] using Tmixs (v n) (expand o v l) (v a) (expand o v r'') + · trivial + · cases hpr2 : pop o ((d, n) :: r'') with + | none => trivial + | some dr2 => + rcases dr2 with ⟨d0, r2⟩ + dsimp only + have hrc2 := (pop_ok o v H ((d, n) :: r'') d0 r2 hpr2).2 + split_ifs with h5 h6 + · dsimp only [meaning] + have hd0 := H.eq_ok _ _ h6; rw [H.con_ok] at hd0 + rw [CfgT, hrc, hc, RC, hrc2, hd0, ← RC, ← CfgT] + rw [push_ok o v H] + simpa [List.replicate, H.con_ok] using Tzero (expand o v l) (v a) (expand o v r2) + · trivial + · cases hs2 : o.sub d0 (o.con 1) with + | none => trivial + | some d' => + dsimp only [meaning] + have hsub := H.sub_ok d0 (o.con 1) d' hs2; rw [H.con_ok] at hsub + have hd0 : v d0 = 1 + v d' := by omega + rw [CfgT, hrc, hc, RC, hrc2, hd0, ← RC, ← CfgT] + rw [push_ok o v H] + simpa [List.replicate, H.con_ok, H.add_ok] using Tmix (expand o v l) (v a) (v d') (expand o v r2) + · trivial + +def step_PS_odd3 (o : Ops) (l : List (o.num × o.num)) (a : o.num) (r : List (o.num × o.num)) : + Option (Option (Frame o.num)) := + match o.sub a (o.con 7), pop o l, pop o r with + | some b, some (xv, l'), some (c, r') => + match o.div b 4 with + | some (n, 0) => + if o.eq c (o.con 0) then + some (some ⟨.PS, l', o.add xv (o.add (o.add n n) (o.con 1)), + push o (o.con 0) (o.con 1) + (push o (o.con 1) (o.con 1) + (push o (o.con 2) (o.con 1) + (push o (o.con 1) (o.add n (o.con 1)) r')))⟩) + else none + | some (_, _ + 1) => none + | none => none + | _, _, _ => none + +theorem step_PS_odd3_spec (o : Ops) (v : o.num → Nat) (H : Laws o v) + (l : List (o.num × o.num)) (a : o.num) (r : List (o.num × o.num)) : + match step_PS_odd3 o l a r with + | some (some y) => ReachesStar target_tm (CfgS (expand o v l) (v a) (expand o v r)) (meaning o v y) + | some none => HaltsFrom target_tm (CfgS (expand o v l) (v a) (expand o v r)) + | none => True := by + unfold step_PS_odd3 + cases hs : o.sub a (o.con 7) with + | none => trivial + | some b => + cases hpl : pop o l with + | none => trivial + | some xvl' => + cases hpr : pop o r with + | none => trivial + | some cr' => + rcases xvl' with ⟨xv, l'⟩; rcases cr' with ⟨c, r'⟩ + dsimp only + cases hd : o.div b 4 with + | none => trivial + | some nd => + rcases nd with ⟨n, d⟩ + cases d with + | succ d => trivial + | zero => + dsimp only + split_ifs with hc0 + · dsimp only [meaning] + have hsub := H.sub_ok a (o.con 7) b hs; rw [H.con_ok] at hsub + have hdiv := H.div_ok b 4 n 0 hd + have ha : v a = v n * 4 + 7 := by omega + have hc := H.eq_ok _ _ hc0; rw [H.con_ok] at hc + rw [CfgS, (pop_ok o v H l xv l' hpl).1, (pop_ok o v H r c r' hpr).2, hc, ← CfgS, ha] + rw [push_ok o v H, push_ok o v H, push_ok o v H, push_ok o v H] + have hna : v (o.add xv (o.add (o.add n n) (o.con 1))) = v xv + v n * 2 + 1 := by + simp only [H.add_ok, H.con_ok]; omega + rw [hna] + simpa [List.replicate, H.con_ok, H.add_ok] using S_odd3_lemma (v n) (expand o v l') (v xv) (expand o v r') + · trivial + +def step_PS_odd1_qmr2 (o : Ops) (q1 : o.num) (r' : List (o.num × o.num)) : o.num × List (o.num × o.num) := + match r' with + | (d1, m) :: r2 => if o.eq d1 (o.con 1) then (o.add q1 m, r2) else (q1, r') + | [] => (q1, []) + +def step_PS_odd1_finish (o : Ops) : List (o.num × o.num) × o.num × List (o.num × o.num) → + Option (Option (Frame o.num)) + | (l2, a2, []) => + if Nat.ble 1 (o.sample a2) then + match o.sub a2 (o.con 1) with + | some a3 => some (some ⟨.PS, l2, a3, [(o.con 0, o.con 1), (o.con 1, o.con 1)]⟩) + | none => some (some ⟨.PT, l2, a2, push o (o.con 0) (o.con 1) []⟩) + else some (some ⟨.PT, l2, a2, push o (o.con 0) (o.con 1) []⟩) + | (l2, a2, r3) => some (some ⟨.PT, l2, a2, push o (o.con 0) (o.con 1) r3⟩) + +theorem S_odd1_q_lemma (q1 m : Nat) (l : List Nat) (x : Nat) (r : List Nat) : + ReachesStar target_tm (CfgS (x :: l) (q1 * 4 + 1) (0 :: (List.replicate m 1 ++ r))) + (CfgT l ((q1 + m) * 2 + (2 + (q1 * 2 + x))) (0 :: r)) := by + have h1 : q1 * 4 + 1 = q1 * 4 + 1 + 0 * 2 := by omega + rw [h1] + refine (Incs q1 0 l x (List.replicate m 1 ++ r)).trans ?_ + refine (Sone l (q1 * 2 + x) (0 :: (List.replicate q1 1 ++ (List.replicate m 1 ++ r)))).trans ?_ + have h3 : List.replicate q1 1 ++ (List.replicate m 1 ++ r) = List.replicate (q1 + m) 1 ++ r := by + rw [← List.append_assoc, ← List.replicate_add] + rw [h3] + exact Tmixs (q1 + m) l (2 + (q1 * 2 + x)) r + +def step_PS_odd1 (o : Ops) (l : List (o.num × o.num)) (a : o.num) (r : List (o.num × o.num)) : + Option (Option (Frame o.num)) := + match o.sub a (o.con 1), pop o l, pop o r with + | some b, some (xv, l'), some (c, r') => + match o.div b 4 with + | some (q1, 0) => + if o.eq c (o.con 0) then + let qmr2 := step_PS_odd1_qmr2 o q1 r' + let a_init := o.add (o.add qmr2.1 qmr2.1) (o.add (o.con 2) (o.add (o.add q1 q1) xv)) + step_PS_odd1_finish o (drain_T o 64 l' a_init qmr2.2) + else none + | some (_, _ + 1) => none + | none => none + | _, _, _ => none + +theorem step_PS_odd1_spec (o : Ops) (v : o.num → Nat) (H : Laws o v) + (l : List (o.num × o.num)) (a : o.num) (r : List (o.num × o.num)) : + match step_PS_odd1 o l a r with + | some (some y) => ReachesStar target_tm (CfgS (expand o v l) (v a) (expand o v r)) (meaning o v y) + | some none => HaltsFrom target_tm (CfgS (expand o v l) (v a) (expand o v r)) + | none => True := by + unfold step_PS_odd1 + cases hs : o.sub a (o.con 1) with + | none => trivial + | some b => + cases hpl : pop o l with + | none => trivial + | some xvl' => + cases hpr : pop o r with + | none => trivial + | some cr' => + rcases xvl' with ⟨xv, l'⟩; rcases cr' with ⟨c, r'⟩ + dsimp only + cases hd : o.div b 4 with + | none => trivial + | some nd => + rcases nd with ⟨q1, d⟩ + cases d with + | succ d => trivial + | zero => + dsimp only + cases hc0 : o.eq c (o.con 0) + · simp only [Bool.false_eq_true, ↓reduceIte] + · simp only [↓reduceIte] + have hsub := H.sub_ok a (o.con 1) b hs; rw [H.con_ok] at hsub + have hdiv := H.div_ok b 4 q1 0 hd + have ha : v a = v q1 * 4 + 1 := by omega + have hc := H.eq_ok _ _ hc0; rw [H.con_ok] at hc + rw [CfgS, (pop_ok o v H l xv l' hpl).1, (pop_ok o v H r c r' hpr).2, hc, ← CfgS, ha] + let qmr2 := step_PS_odd1_qmr2 o q1 r' + let a_init := o.add (o.add qmr2.1 qmr2.1) (o.add (o.con 2) (o.add (o.add q1 q1) xv)) + have hstep1 : ReachesStar target_tm + (CfgS (v xv :: expand o v l') (v q1 * 4 + 1) (0 :: expand o v r')) + (CfgT (expand o v l') (v a_init) (0 :: expand o v qmr2.2)) := by + cases r' with + | nil => + have ha_init : v a_init = (v q1 + 0) * 2 + (2 + (v q1 * 2 + v xv)) := by + dsimp [a_init, qmr2, step_PS_odd1_qmr2]; simp only [H.add_ok, H.con_ok]; omega + rw [ha_init] + simpa [qmr2, step_PS_odd1_qmr2, expand] using S_odd1_q_lemma (v q1) 0 (expand o v l') (v xv) [] + | cons d1m r2 => + rcases d1m with ⟨d1, m⟩ + dsimp only [qmr2, step_PS_odd1_qmr2] + cases hd1 : o.eq d1 (o.con 1) + · simp only [hd1, Bool.false_eq_true, ↓reduceIte] + have ha_init : v a_init = (v q1 + 0) * 2 + (2 + (v q1 * 2 + v xv)) := by + dsimp [a_init, qmr2, step_PS_odd1_qmr2]; simp only [hd1, Bool.false_eq_true, ↓reduceIte, H.add_ok, H.con_ok]; omega + rw [ha_init] + simpa using S_odd1_q_lemma (v q1) 0 (expand o v l') (v xv) (expand o v ((d1, m) :: r2)) + · simp only [hd1, ↓reduceIte] + have hd1_eq := H.eq_ok _ _ hd1; rw [H.con_ok] at hd1_eq + have ha_init : v a_init = (v q1 + v m) * 2 + (2 + (v q1 * 2 + v xv)) := by + dsimp [a_init, qmr2, step_PS_odd1_qmr2]; simp only [hd1, ↓reduceIte, H.add_ok, H.con_ok]; omega + rw [ha_init, expand, hd1_eq] + exact S_odd1_q_lemma (v q1) (v m) (expand o v l') (v xv) (expand o v r2) + have hdrain := drain_T_spec o v H 64 l' a_init qmr2.2 + have hstep2 := hstep1.trans hdrain + generalize hres : drain_T o 64 l' a_init qmr2.2 = res at hstep2 ⊢ + rcases res with ⟨l2, a2, r3⟩ + dsimp only [step_PS_odd1_finish] at hstep2 ⊢ + cases r3 with + | cons x xs => + dsimp only [meaning] + rw [push_ok o v H] + simpa [List.replicate, H.con_ok] using hstep2 + | nil => + dsimp only + split_ifs with hge + · cases hs2 : o.sub a2 (o.con 1) with + | none => + dsimp only [meaning] + rw [push_ok o v H] + simpa [List.replicate, H.con_ok] using hstep2 + | some a3 => + dsimp only [meaning] + have hsub2 := H.sub_ok a2 (o.con 1) a3 hs2; rw [H.con_ok] at hsub2 + have ha2 : v a2 = 1 + v a3 := by omega + rw [expand, ha2] at hstep2 + refine hstep2.trans ?_ + simpa [expand, List.replicate, H.con_ok] using T_end_lemma (expand o v l2) (v a3) + · dsimp only [meaning] + rw [push_ok o v H] + simpa [List.replicate, H.con_ok] using hstep2 + +def step_PS_even_empty (o : Ops) (a : o.num) (r : List (o.num × o.num)) : Option (Frame o.num) := + match r with + | (z, nz) :: r1 => + if o.eq z (o.con 0) && o.eq nz (o.con 1) then + match o.sub a (o.con 2) with + | some b => + match o.div b 2 with + | some (q, 0) => + let (m1, r2) := + match r1 with + | (d1, m) :: r2 => if o.eq d1 (o.con 1) then (o.add m (o.con 1), r2) else (o.con 1, r1) + | [] => (o.con 1, []) + some ⟨.PS, [(o.con 0, o.con 1), (o.con 1, o.con 1)], + o.add (o.add q q) (o.con 1), + push o (o.con 0) (o.con 1) (push o (o.con 1) m1 r2)⟩ + | _ => none + | none => none + else none + | [] => none + +theorem step_PS_even_empty_spec (o : Ops) (v : o.num → Nat) (H : Laws o v) + (a : o.num) (r : List (o.num × o.num)) (y : Frame o.num) + (h : step_PS_even_empty o a r = some y) : + ReachesStar target_tm (CfgS [] (v a) (expand o v r)) (meaning o v y) := by + unfold step_PS_even_empty at h + rcases r with _ | ⟨⟨z, nz⟩, r1⟩; · simp at h + dsimp only at h + cases hz : o.eq z (o.con 0) <;> cases hnz : o.eq nz (o.con 1) <;> + simp only [hz, hnz, Bool.and_self, Bool.and_false, Bool.false_and, Bool.false_eq_true, ↓reduceIte] at h <;> + try contradiction + cases hs : o.sub a (o.con 2) with + | none => simp [hs] at h + | some b => + rw [hs] at h + dsimp only at h + cases hd : o.div b 2 with + | none => simp [hd] at h + | some qd => + rcases qd with ⟨q, d⟩ + cases d with + | succ d => simp [hd] at h + | zero => + simp only [hd, Option.some.injEq] at h + subst h + dsimp only [meaning] + have hzv := H.eq_ok _ _ hz; rw [H.con_ok] at hzv + have hnzv := H.eq_ok _ _ hnz; rw [H.con_ok] at hnzv + have hsub := H.sub_ok a (o.con 2) b hs; rw [H.con_ok] at hsub + have hdiv := H.div_ok b 2 q 0 hd + have ha : v a = (v q + 1) * 2 := by omega + have hq : v (o.add (o.add q q) (o.con 1)) = v q * 2 + 1 := by + simp only [H.add_ok, H.con_ok]; omega + have hl : expand o v [(o.con 0, o.con 1), (o.con 1, o.con 1)] = [0, 1] := by + simp [expand, H.con_ok] + rw [ha, hq, hl, expand, hzv, hnzv, List.replicate, List.replicate, List.singleton_append] + rw [push_ok o v H, push_ok o v H] + cases r1 with + | nil => + simpa [List.replicate, H.con_ok, expand] using S_even_empty_lemma (v q) 0 [] + | cons d1m r2 => + rcases d1m with ⟨d1, m⟩ + dsimp only + cases hd1 : o.eq d1 (o.con 1) + · simp only [hd1, Bool.false_eq_true, ↓reduceIte] + simpa [List.replicate, H.con_ok] using S_even_empty_lemma (v q) 0 (expand o v ((d1, m) :: r2)) + · simp only [hd1, ↓reduceIte] + have hd1v := H.eq_ok _ _ hd1; rw [H.con_ok] at hd1v + rw [expand, hd1v] + simpa [List.replicate, H.con_ok, H.add_ok] using S_even_empty_lemma (v q) (v m) (expand o v r2) + +def step_PS_base (o : Ops) (l : List (o.num × o.num)) (a : o.num) (r : List (o.num × o.num)) : + Option (Option (Frame o.num)) := + if Nat.ble 2 (o.sample a) then + match o.div a 2 with + | some (n, d) => some (some ⟨.PS, l, o.con d, push o (o.con 1) n r⟩) + | none => none + else if Nat.beq (o.sample a) 1 then + if o.eq a (o.con 1) then + match pop o l with + | some (x, l') => some (some ⟨.PT, l', o.add (o.con 2) x, r⟩) + | none => none + else none + else if o.eq a (o.con 0) then + match pop o l with + | some (x, l') => + if Nat.blt 0 (o.sample x) then + match o.sub x (o.con 1), pop o r with + | some x', some (c, r') => + some (some ⟨.PS, l', x', push o (o.add (o.con 2) c) (o.con 1) r'⟩) + | _, _ => none + else if o.eq x (o.con 0) then + match pop o l' with + | some (y, l'') => some (some ⟨.PU, l'', y, push o (o.con 1) (o.con 1) r⟩) + | none => none + else none + | none => none + else none + +theorem step_PS_base_spec (o : Ops) (v : o.num → Nat) (H : Laws o v) + (l : List (o.num × o.num)) (a : o.num) (r : List (o.num × o.num)) : + match step_PS_base o l a r with + | some (some y) => ReachesStar target_tm (CfgS (expand o v l) (v a) (expand o v r)) (meaning o v y) + | some none => HaltsFrom target_tm (CfgS (expand o v l) (v a) (expand o v r)) + | none => True := by + unfold step_PS_base + split_ifs with h1 h2 h3 h4 + · cases hd : o.div a 2 with + | none => trivial + | some nd => + rcases nd with ⟨n, d⟩ + dsimp only [meaning] + have hdiv := H.div_ok a 2 n d hd + rw [← hdiv, H.con_ok, push_ok o v H, H.con_ok] + exact Slefts (v n) (expand o v l) d (expand o v r) + · cases hpl : pop o l with + | none => trivial + | some xl' => + rcases xl' with ⟨x, l'⟩ + dsimp only [meaning] + have ha := H.eq_ok _ _ h3; rw [H.con_ok] at ha + rw [CfgS, (pop_ok o v H l x l' hpl).1, ha, ← CfgS, H.add_ok, H.con_ok] + exact Sone (expand o v l') (v x) (expand o v r) + · trivial + · cases hpl : pop o l with + | none => trivial + | some xl' => + rcases xl' with ⟨x, l'⟩ + dsimp only + have ha := H.eq_ok _ _ h4; rw [H.con_ok] at ha + have hlc := (pop_ok o v H l x l' hpl).1 + split_ifs with h5 h6 + · cases hs : o.sub x (o.con 1) with + | none => trivial + | some x' => + cases hpr : pop o r with + | none => trivial + | some cr' => + rcases cr' with ⟨c, r'⟩ + dsimp only [meaning] + have hsub := H.sub_ok x (o.con 1) x' hs; rw [H.con_ok] at hsub + have hx : v x = 1 + v x' := by omega + rw [CfgS, hlc, (pop_ok o v H r c r' hpr).2, ha, hx, ← CfgS] + rw [push_ok o v H] + simpa [List.replicate, H.con_ok, H.add_ok] using Sleft (expand o v l') (v x') (v c) (expand o v r') + · cases hpl2 : pop o l' with + | none => trivial + | some yl'' => + rcases yl'' with ⟨y, l''⟩ + dsimp only [meaning] + have hx := H.eq_ok _ _ h6; rw [H.con_ok] at hx + have hlc2 := (pop_ok o v H l' y l'' hpl2).1 + rw [CfgS, hlc, hx, LC, hlc2, ← LC, ha, ← CfgS] + rw [push_ok o v H] + simpa [List.replicate, H.con_ok] using Szero (expand o v l'') (v y) (expand o v r) + · trivial + · trivial + +def step_PS (o : Ops) (l : List (o.num × o.num)) (a : o.num) (r : List (o.num × o.num)) : + Option (Option (Frame o.num)) := + if (Nat.ble 5 (o.sample a) && Nat.beq (o.sample a % 2) 1 || Nat.beq (o.sample a % 4) 1) && Nat.beq (o.sample (near o r)) 0 then + if o.eq (near o r) (o.con 0) then + if Nat.beq (o.sample a % 4) 3 && Nat.ble 7 (o.sample a) then + step_PS_odd3 o l a r + else if Nat.beq (o.sample a % 4) 1 then + step_PS_odd1 o l a r + else none + else none + else if Nat.ble 2 (o.sample a) && Nat.beq (o.sample a % 2) 0 then + match l with + | [] => + match step_PS_even_empty o a r with + | some y => some (some y) + | none => step_PS_base o [] a r + | _ => step_PS_base o l a r + else step_PS_base o l a r + +theorem step_PS_spec (o : Ops) (v : o.num → Nat) (H : Laws o v) + (l : List (o.num × o.num)) (a : o.num) (r : List (o.num × o.num)) : + match step_PS o l a r with + | some (some y) => ReachesStar target_tm (CfgS (expand o v l) (v a) (expand o v r)) (meaning o v y) + | some none => HaltsFrom target_tm (CfgS (expand o v l) (v a) (expand o v r)) + | none => True := by + unfold step_PS + split_ifs with h1 h2 h3 h4 h5 + · exact step_PS_odd3_spec o v H l a r + · exact step_PS_odd1_spec o v H l a r + · trivial + · trivial + · cases l with + | cons _ _ => exact step_PS_base_spec o v H _ a r + | nil => + dsimp only + cases he : step_PS_even_empty o a r with + | some y => exact step_PS_even_empty_spec o v H a r y he + | none => exact step_PS_base_spec o v H [] a r + · exact step_PS_base_spec o v H l a r + +def step (o : Ops) (x : Frame o.num) : Option (Option (Frame o.num)) := + match x.p with + | .PS => step_PS o x.l x.a x.r + | .PT => step_PT o x.l x.a x.r + | .PU => step_PU o x.l x.a x.r + | .PV => step_PV o x.l x.a x.r + +theorem step_spec (o : Ops) (v : o.num → Nat) (H : Laws o v) (x : Frame o.num) : + match step o x with + | some (some y) => ReachesStar target_tm (meaning o v x) (meaning o v y) + | some none => HaltsFrom target_tm (meaning o v x) + | none => True := by + rcases x with ⟨p, l, a, r⟩ + cases p + · exact step_PS_spec o v H l a r + · exact step_PT_spec o v H l a r + · exact step_PU_spec o v H l a r + · exact step_PV_spec o v H l a r + +def withNat {α : Type*} (x : Nat) (k : Nat → α) : α := + match x + 1 with + | 0 => k 0 + | v + 1 => k v + +theorem withNat_eq {α : Type*} (x : Nat) (k : Nat → α) : withNat x k = k x := rfl + +def nadd (x y : Nat) : Nat := withNat (x + y) id +def nsub (x y : Nat) : Option Nat := if Nat.ble y x then withNat (x - y) some else none +def ndiv (x n : Nat) : Option (Nat × Nat) := + if Nat.beq n 0 then none else withNat (x / n) fun q => withNat (x % n) fun r => some (q, r) + +abbrev numbers : Ops where + num := Nat + sample x := x + con x := x + add := nadd + sub := nsub + div := ndiv + eq := Nat.beq + +theorem number_laws : Laws numbers id where + con_ok _ := rfl + add_ok _ _ := rfl + sub_ok x y z h := by + dsimp [numbers, nsub, withNat] at h + cases hle : Nat.ble y x <;> rw [hle] at h + · contradiction + · simp only [↓reduceIte, Option.some.injEq] at h + subst h + have := Nat.le_of_ble_eq_true hle + dsimp [id]; omega + div_ok x n q d h := by + dsimp [numbers, ndiv, withNat] at h + cases hne : Nat.beq n 0 <;> rw [hne] at h + · simp only [Bool.false_eq_true, ↓reduceIte, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + dsimp [id] + rw [Nat.mul_comm] + exact Nat.div_add_mod x n + · contradiction + eq_ok x y h := Nat.eq_of_beq_eq_true h + + +def den : Frame Nat → Cfg (Fin 2) (Fin 6) := meaning numbers id +def normal (n : Nat) : Frame Nat := ⟨.PS, [], n, [(0, 1), (1, 1)]⟩ +def initial : Frame Nat := ⟨.PT, [], 1, []⟩ + +def cut (o : Ops) (x : Frame o.num) : Option o.num := + match x.p, x.l, x.r with + | .PS, [], [(z, n), (u, m)] => + if o.eq z (o.con 0) && o.eq n (o.con 1) && o.eq u (o.con 1) && o.eq m (o.con 1) then + some x.a + else none + | _, _, _ => none + +theorem cut_spec (o : Ops) (v : o.num → Nat) (H : Laws o v) (x : Frame o.num) (a : o.num) + (h : cut o x = some a) : + meaning o v x = CfgS [] (v a) [0, 1] := by + rcases x with ⟨p, l, b, r⟩ + cases p <;> try simp [cut] at h + cases l <;> try simp [cut] at h + rcases r with _ | ⟨⟨z, n⟩, _ | ⟨⟨u, m⟩, _ | _⟩⟩ <;> try simp [cut] at h + rcases h with ⟨⟨⟨⟨h1, h2⟩, h3⟩, h4⟩, rfl⟩ + have hz := H.eq_ok _ _ h1; rw [H.con_ok] at hz + have hn := H.eq_ok _ _ h2; rw [H.con_ok] at hn + have hu := H.eq_ok _ _ h3; rw [H.con_ok] at hu + have hm := H.eq_ok _ _ h4; rw [H.con_ok] at hm + simp [meaning, expand, hz, hn, hu, hm] + +def run_to_20Step (x : Frame Nat) (ih : Frame Nat → Bool) : Bool := + match step numbers x with + | some (some y) => ih y + | _ => false + +def run_to_20 : Nat → Frame Nat → Bool + | 0, _ => false + | fuel + 1, x => + match cut numbers x with + | some n => + if Nat.beq n 20 then true + else run_to_20Step x (run_to_20 fuel) + | none => run_to_20Step x (run_to_20 fuel) + +theorem run_to_20Step_spec (x : Frame Nat) (ih : Frame Nat → Bool) + (hih : ∀ y, ih y = true → ReachesStar target_tm (den y) (Cn 20)) + (h : run_to_20Step x ih = true) : + ReachesStar target_tm (den x) (Cn 20) := by + unfold run_to_20Step at h + have hs := step_spec numbers id number_laws x + cases hst : step numbers x with + | none => rw [hst] at h; contradiction + | some oy => + cases oy with + | none => rw [hst] at h; contradiction + | some y => + rw [hst] at h hs + exact hs.trans (hih y h) + +theorem run_to_20_spec (fuel : Nat) (x : Frame Nat) (h : run_to_20 fuel x = true) : + ReachesStar target_tm (den x) (Cn 20) := by + induction fuel generalizing x with + | zero => contradiction + | succ fuel ih => + unfold run_to_20 at h + cases hcut : cut numbers x with + | none => + rw [hcut] at h + exact run_to_20Step_spec x (run_to_20 fuel) ih h + | some n => + rw [hcut] at h + dsimp only at h + cases h20 : Nat.beq n 20 <;> rw [h20] at h + · exact run_to_20Step_spec x (run_to_20 fuel) ih h + · have hn20 : n = 20 := Nat.eq_of_beq_eq_true h20 + subst hn20 + unfold den + rw [cut_spec numbers id number_laws x 20 hcut] + try exact ReachesStar.refl _ _ + +def run_to_halt : Nat → Frame Nat → Bool + | 0, _ => false + | fuel + 1, x => + match step numbers x with + | some (some y) => run_to_halt fuel y + | some none => true + | none => false + +theorem run_to_halt_spec (fuel : Nat) (x : Frame Nat) (h : run_to_halt fuel x = true) : + HaltsFrom target_tm (den x) := by + induction fuel generalizing x with + | zero => contradiction + | succ fuel ih => + unfold run_to_halt at h + have hs := step_spec numbers id number_laws x + cases hst : step numbers x with + | none => rw [hst] at h; contradiction + | some oy => + cases oy with + | none => rw [hst] at hs; exact hs + | some y => + rw [hst] at h hs + exact HaltsFrom.of_reachesStar hs (ih y h) + +theorem phase_a_eq : run_to_20 50 initial = true := by decide +kernel +theorem phase_c_eq : run_to_halt 200 (normal 34357641212) = true := by decide +kernel + +-- Kernel-optimized (`F`) copies of the Stage-1 combinators: every intermediate +-- `Aux`/`Body`/`Wrap` helper is inlined (definitionally equal to the originals above). + +def excNilRecWrapSomeF (p_top w_half po_0 w_qtr g_out q_top w_qtop : Nat) (l_inner : LList) : InnRes := + InnRes.some g_out p_top w_half (LList.cons po_0 w_qtr (LList.cons q_top w_qtop l_inner)) + +def excNil4StepF (_ : Nat) (ih : Nat → Nat → Nat → InnRes) (fa w g : Nat) : InnRes := + Bool.rec + InnRes.none + (Bool.rec + (Bool.rec + (InnRes.rec InnRes.none + (excNilRecWrapSomeF + (Nat.add (Nat.mul 2 (Nat.sub (Nat.div fa 4) 3)) 10) + (Nat.div w 2) + (Nat.add (Nat.sub (Nat.div fa 4) 3) 4) + (Nat.div (Nat.div w 2) 2)) + (ih (Nat.sub (Nat.div fa 4) 3) (Nat.div (Nat.div w 2) 2) (Nat.gcd g (Nat.div (Nat.div w 2) 2)))) + (Bool.rec + InnRes.none + (InnRes.some + (Nat.gcd g (Nat.div (Nat.div (Nat.div w 2) 2) 2)) + (Nat.add (Nat.mul 2 (Nat.sub (Nat.div fa 4) 3)) 10) + (Nat.div w 2) + (LList.cons (Nat.add (Nat.sub (Nat.div fa 4) 3) 4) (Nat.div (Nat.div w 2) 2) + (LList.cons (Nat.add (Nat.div (Nat.sub (Nat.div fa 4) 3) 2) 4) (Nat.div (Nat.div (Nat.div w 2) 2) 2) + (LList.cons (Nat.add (Nat.div (Nat.sub (Nat.div fa 4) 3) 2) 3) (Nat.div (Nat.div (Nat.div w 2) 2) 2) LList.nil)))) + (Nat.ble 8 (Nat.sub (Nat.div fa 4) 3))) + (Nat.beq (Nat.mod (Nat.sub (Nat.div fa 4) 3) 8) 0)) + (InnRes.some + (Nat.gcd g (Nat.div (Nat.div w 2) 2)) + (Nat.add (Nat.mul 2 (Nat.sub (Nat.div fa 4) 3)) 10) + (Nat.div w 2) + (LList.cons (Nat.add (Nat.sub (Nat.div fa 4) 3) 4) (Nat.div (Nat.div w 2) 2) + (LList.cons (Nat.add (Nat.sub (Nat.div fa 4) 3) 6) (Nat.div (Nat.div w 2) 2) (LList.cons 1 0 LList.nil)))) + (Nat.beq (Nat.mod (Nat.sub (Nat.div fa 4) 3) 4) 2)) + (Bool.and (Nat.ble 12 fa) (Nat.beq (Nat.mod fa 8) 4)) + +def excNilBaseF (_ _ _ : Nat) : InnRes := InnRes.none + +def excNil4F (fuel fa w g : Nat) : InnRes := + Nat.rec excNilBaseF excNil4StepF fuel fa w g + +def excConsWrapSomeF (p_top w_half g_out q_top w_qtop : Nat) (l_inner : LList) : InnRes := + InnRes.some g_out p_top w_half (LList.cons q_top w_qtop l_inner) + +def excConsNilF (x0_0 w_x fa w g : Nat) : InnRes := + Bool.rec + InnRes.none + (Bool.rec + (Bool.rec + (InnRes.rec InnRes.none (excConsWrapSomeF (Nat.add (Nat.div fa 2) 3) (Nat.div w 2)) + (excNil4F 20 (Nat.sub (Nat.add x0_0 (Nat.div fa 2)) 2) (Nat.add w_x (Nat.div w 2)) (Nat.gcd g (Nat.div w 2)))) + (Bool.rec + InnRes.none + (InnRes.some + (Nat.gcd (Nat.gcd g (Nat.div w 2)) (Nat.div (Nat.add w_x (Nat.div w 2)) 2)) + (Nat.add (Nat.div fa 2) 3) + (Nat.div w 2) + (LList.cons (Nat.add (Nat.div (Nat.sub (Nat.add x0_0 (Nat.div fa 2)) 2) 2) 4) (Nat.div (Nat.add w_x (Nat.div w 2)) 2) + (LList.cons (Nat.add (Nat.div (Nat.sub (Nat.add x0_0 (Nat.div fa 2)) 2) 2) 3) (Nat.div (Nat.add w_x (Nat.div w 2)) 2) LList.nil))) + (Nat.ble 8 (Nat.sub (Nat.add x0_0 (Nat.div fa 2)) 2))) + (Nat.beq (Nat.mod (Nat.sub (Nat.add x0_0 (Nat.div fa 2)) 2) 8) 0)) + (InnRes.some + (Nat.gcd g (Nat.div w 2)) + (Nat.add (Nat.div fa 2) 3) + (Nat.div w 2) + (LList.cons (Nat.add (Nat.sub (Nat.add x0_0 (Nat.div fa 2)) 2) 6) (Nat.add w_x (Nat.div w 2)) (LList.cons 1 0 LList.nil))) + (Nat.beq (Nat.mod (Nat.sub (Nat.add x0_0 (Nat.div fa 2)) 2) 4) 2)) + (Nat.ble 2 (Nat.add x0_0 (Nat.div fa 2))) + +def excConsStepF (x1_0 w_x1 : Nat) (l_rest2 : LList) (ih : Nat → Nat → Nat → Nat → Nat → InnRes) + (x0_0 w_x fa w g : Nat) : InnRes := + Bool.rec + (Bool.rec + InnRes.none + (InnRes.rec InnRes.none (excConsWrapSomeF (Nat.add (Nat.div fa 2) 3) (Nat.div w 2)) + (ih x1_0 w_x1 (Nat.sub (Nat.add x0_0 (Nat.div fa 2)) 2) (Nat.add w_x (Nat.div w 2)) (Nat.gcd g (Nat.div w 2)))) + (Nat.ble 5 (Nat.add x0_0 (Nat.div fa 2)))) + (InnRes.some + (Nat.gcd g (Nat.div w 2)) + (Nat.add (Nat.div fa 2) 3) + (Nat.div w 2) + (LList.cons (Nat.add x1_0 (Nat.add (Nat.add x0_0 (Nat.div fa 2)) 3)) (Nat.add w_x1 (Nat.add w_x (Nat.div w 2))) l_rest2)) + (Nat.beq (Nat.mod (Nat.add x0_0 (Nat.div fa 2)) 4) 3) + +def excConsF (l_rest : LList) (x0_0 w_x fa w g : Nat) : InnRes := + LList.rec excConsNilF excConsStepF l_rest x0_0 w_x fa w g + +def walkCallUnifiedF (ih_compile : Nat → Nat → LList → Nat → Nat → Nat → CmpRule) + (fa_half w_half g_out q_top w_qtop : Nat) (l_inner : LList) : CmpRule := + ih_compile q_top w_qtop l_inner fa_half w_half g_out + +def walkNilF (n_orig : Nat) (x0_0 _ fa _ g : Nat) : CmpRule := + Bool.rec + CmpRule.none + (Bool.rec + CmpRule.none + (CmpRule.some (Nat.div 4398046511104 g) + (Nat.sub (Nat.add (Nat.add x0_0 (Nat.add fa 2)) (Nat.mul 6 (Nat.mod (Nat.div (Nat.sub (Nat.add x0_0 (Nat.add fa 2)) 4) 2) 4))) n_orig)) + (Bool.and (Nat.ble (Nat.add n_orig 1) (Nat.add x0_0 (Nat.add fa 2))) (Bool.and (Nat.ble 8 g) (Nat.beq (Nat.mod g 8) 0)))) + (Nat.beq (Nat.mod fa 4) 1) + +def walkConsF (ih_compile : Nat → Nat → LList → Nat → Nat → Nat → CmpRule) + (x1_0 w_x1 : Nat) (l_rest2 : LList) (ih_walk : Nat → Nat → Nat → Nat → Nat → CmpRule) + (x0_0 w_x fa w g : Nat) : CmpRule := + Bool.rec + (Bool.rec + CmpRule.none + (Bool.rec + (Bool.rec + CmpRule.none + (InnRes.rec CmpRule.none (walkCallUnifiedF ih_compile (Nat.div fa 2) (Nat.div w 2)) + (excConsF l_rest2 x1_0 w_x1 (Nat.sub (Nat.add x0_0 (Nat.div fa 2)) 2) (Nat.add w_x (Nat.div w 2)) (Nat.gcd g (Nat.div w 2)))) + (Nat.ble 5 (Nat.add x0_0 (Nat.div fa 2)))) + (ih_walk + (Nat.add x1_0 (Nat.add (Nat.add x0_0 (Nat.div fa 2)) 3)) + (Nat.add w_x1 (Nat.add w_x (Nat.div w 2))) + (Nat.div fa 2) + (Nat.div w 2) + (Nat.gcd g (Nat.div w 2))) + (Nat.beq (Nat.mod (Nat.add x0_0 (Nat.div fa 2)) 4) 3)) + (Nat.beq (Nat.mod fa 4) 3)) + (ih_walk x1_0 w_x1 (Nat.add x0_0 (Nat.add fa 2)) (Nat.add w_x w) g) + (Nat.beq (Nat.mod fa 4) 1) + +def compileStepF (n_orig : Nat) (_ : Nat) (ih : Nat → Nat → LList → Nat → Nat → Nat → CmpRule) + (x0_0 w_x : Nat) (l_rest : LList) (fa w g : Nat) : CmpRule := + LList.rec (walkNilF n_orig) (walkConsF ih) l_rest x0_0 w_x fa w g + +def compileBaseF (_ _ : Nat) (_ : LList) (_ _ _ : Nat) : CmpRule := CmpRule.none + +def fastCompileSomeF (n arec_0 g_out q_top w_qtop : Nat) (l_inner : LList) : CmpRule := + Nat.rec compileBaseF (compileStepF n) 40 + (Nat.add q_top (Nat.add (Nat.mul 2 arec_0) 10)) + (Nat.add w_qtop 549755813888) + l_inner + (Nat.add arec_0 3) + 274877906944 + g_out + +def fastCompileF (n : Nat) : CmpRule := + Bool.rec + CmpRule.none + (Bool.rec + (Bool.rec + (InnRes.rec CmpRule.none (fastCompileSomeF n (Nat.sub (Nat.div n 4) 3)) + (excNil4F 20 (Nat.sub (Nat.div n 4) 3) 274877906944 274877906944)) + (Bool.rec + CmpRule.none + (Nat.rec compileBaseF (compileStepF n) 40 + (Nat.add (Nat.add (Nat.div (Nat.sub (Nat.div n 4) 3) 2) 4) (Nat.add (Nat.mul 2 (Nat.sub (Nat.div n 4) 3)) 10)) + (Nat.add 137438953472 549755813888) + (LList.cons (Nat.add (Nat.div (Nat.sub (Nat.div n 4) 3) 2) 3) 137438953472 LList.nil) + (Nat.add (Nat.sub (Nat.div n 4) 3) 3) + 274877906944 + 137438953472) + (Nat.ble 8 (Nat.sub (Nat.div n 4) 3))) + (Nat.beq (Nat.mod (Nat.sub (Nat.div n 4) 3) 8) 0)) + (Nat.rec compileBaseF (compileStepF n) 40 + (Nat.add (Nat.add (Nat.sub (Nat.div n 4) 3) 6) (Nat.add (Nat.mul 2 (Nat.sub (Nat.div n 4) 3)) 10)) + (Nat.add 274877906944 549755813888) + (LList.cons 1 0 LList.nil) + (Nat.add (Nat.sub (Nat.div n 4) 3) 3) + 274877906944 + 274877906944) + (Nat.beq (Nat.mod (Nat.sub (Nat.div n 4) 3) 4) 2)) + (Bool.and (Nat.ble 12 n) (Nat.beq (Nat.mod n 8) 4)) + +-- fastEvalF: zero intermediate Aux/Body/Wrap defs! + +def nlistWrap1SomeF (p_top q_top : Nat) (l_in : NList) (_ : NList) : NList := + NList.cons p_top (NList.cons q_top l_in) + +def nlistWrap2SomeF (p_top po_0 q_top : Nat) (l_in : NList) (_ : NList) : NList := + NList.cons p_top (NList.cons po_0 (NList.cons q_top l_in)) + +def evalNil4StepF (_ : Nat) (ih : Nat → NList) (fa : Nat) : NList := + Bool.rec + NList.nil + (Bool.rec + (Bool.rec + (NList.rec NList.nil + (nlistWrap2SomeF (Nat.add (Nat.mul 2 (Nat.sub (Nat.div fa 4) 3)) 10) (Nat.add (Nat.sub (Nat.div fa 4) 3) 4)) + (ih (Nat.sub (Nat.div fa 4) 3))) + (Bool.rec NList.nil + (NList.cons (Nat.add (Nat.mul 2 (Nat.sub (Nat.div fa 4) 3)) 10) + (NList.cons (Nat.add (Nat.sub (Nat.div fa 4) 3) 4) + (NList.cons (Nat.add (Nat.div (Nat.sub (Nat.div fa 4) 3) 2) 4) + (NList.cons (Nat.add (Nat.div (Nat.sub (Nat.div fa 4) 3) 2) 3) NList.nil)))) + (Nat.ble 8 (Nat.sub (Nat.div fa 4) 3))) + (Nat.beq (Nat.mod (Nat.sub (Nat.div fa 4) 3) 8) 0)) + (NList.cons (Nat.add (Nat.mul 2 (Nat.sub (Nat.div fa 4) 3)) 10) + (NList.cons (Nat.add (Nat.sub (Nat.div fa 4) 3) 4) + (NList.cons (Nat.add (Nat.sub (Nat.div fa 4) 3) 6) (NList.cons 1 NList.nil)))) + (Nat.beq (Nat.mod (Nat.sub (Nat.div fa 4) 3) 4) 2)) + (Bool.and (Nat.ble 12 fa) (Nat.beq (Nat.mod fa 8) 4)) + +def evalNilBaseF (_ : Nat) : NList := NList.nil + +def evalNil4F (fuel fa : Nat) : NList := + Nat.rec evalNilBaseF evalNil4StepF fuel fa + +def evalConsNilF (x0_0 fa : Nat) : NList := + Bool.rec + NList.nil + (Bool.rec + (Bool.rec + (NList.rec NList.nil (nlistWrap1SomeF (Nat.add (Nat.div fa 2) 3)) + (evalNil4F 20 (Nat.sub (Nat.add x0_0 (Nat.div fa 2)) 2))) + (Bool.rec NList.nil + (NList.cons (Nat.add (Nat.div fa 2) 3) + (NList.cons (Nat.add (Nat.div (Nat.sub (Nat.add x0_0 (Nat.div fa 2)) 2) 2) 4) + (NList.cons (Nat.add (Nat.div (Nat.sub (Nat.add x0_0 (Nat.div fa 2)) 2) 2) 3) NList.nil))) + (Nat.ble 8 (Nat.sub (Nat.add x0_0 (Nat.div fa 2)) 2))) + (Nat.beq (Nat.mod (Nat.sub (Nat.add x0_0 (Nat.div fa 2)) 2) 8) 0)) + (NList.cons (Nat.add (Nat.div fa 2) 3) + (NList.cons (Nat.add (Nat.sub (Nat.add x0_0 (Nat.div fa 2)) 2) 6) (NList.cons 1 NList.nil))) + (Nat.beq (Nat.mod (Nat.sub (Nat.add x0_0 (Nat.div fa 2)) 2) 4) 2)) + (Nat.ble 2 (Nat.add x0_0 (Nat.div fa 2))) + +def evalConsStepF (x1_0 : Nat) (l_rest2 : NList) (ih : Nat → Nat → NList) (x0_0 fa : Nat) : NList := + Bool.rec + (Bool.rec + NList.nil + (NList.rec NList.nil (nlistWrap1SomeF (Nat.add (Nat.div fa 2) 3)) + (ih x1_0 (Nat.sub (Nat.add x0_0 (Nat.div fa 2)) 2))) + (Nat.ble 5 (Nat.add x0_0 (Nat.div fa 2)))) + (NList.cons (Nat.add (Nat.div fa 2) 3) + (NList.cons (Nat.add x1_0 (Nat.add (Nat.add x0_0 (Nat.div fa 2)) 3)) l_rest2)) + (Nat.beq (Nat.mod (Nat.add x0_0 (Nat.div fa 2)) 4) 3) + +def evalConsF (l_rest : NList) (x0_0 fa : Nat) : NList := + NList.rec evalConsNilF evalConsStepF l_rest x0_0 fa + +def evalWalkNilF (x0_0 fa : Nat) : Nat := + Bool.rec 0 + (Bool.rec 0 + (Nat.add (Nat.add x0_0 (Nat.add fa 2)) (Nat.mul 6 (Nat.mod (Nat.div (Nat.sub (Nat.add x0_0 (Nat.add fa 2)) 4) 2) 4))) + (Bool.and (Nat.ble 6 (Nat.add x0_0 (Nat.add fa 2))) (Nat.beq (Nat.mod (Nat.add x0_0 (Nat.add fa 2)) 2) 0))) + (Nat.beq (Nat.mod fa 4) 1) + +def evalWalkConsF (ih_eval : NList → Nat → Nat) (x1_0 : Nat) (l_rest2 : NList) + (ih_walk : Nat → Nat → Nat) (x0_0 fa : Nat) : Nat := + Bool.rec + (Bool.rec 0 + (Bool.rec + (Bool.rec + 0 + (ih_eval (evalConsF l_rest2 x1_0 (Nat.sub (Nat.add x0_0 (Nat.div fa 2)) 2)) (Nat.div fa 2)) + (Nat.ble 5 (Nat.add x0_0 (Nat.div fa 2)))) + (ih_walk (Nat.add x1_0 (Nat.add (Nat.add x0_0 (Nat.div fa 2)) 3)) (Nat.div fa 2)) + (Nat.beq (Nat.mod (Nat.add x0_0 (Nat.div fa 2)) 4) 3)) + (Nat.beq (Nat.mod fa 4) 3)) + (ih_walk x1_0 (Nat.add x0_0 (Nat.add fa 2))) + (Nat.beq (Nat.mod fa 4) 1) + +def evalStepConsF (ih_eval : NList → Nat → Nat) (x0_0 : Nat) (l_rest : NList) (_ : Nat → Nat) (fa : Nat) : Nat := + NList.rec evalWalkNilF (evalWalkConsF ih_eval) l_rest x0_0 fa + +def evalStepNilF (_ : Nat) : Nat := 0 + +def evalStepF (_ : Nat) (ih : NList → Nat → Nat) (l : NList) (fa : Nat) : Nat := + NList.rec evalStepNilF (evalStepConsF ih) l fa + +def evalBaseF (_ : NList) (_ : Nat) : Nat := 0 + +def fastEvalStartConsF (arec_0 q_top : Nat) (l_inner : NList) (_ : Nat) : Nat := + Nat.rec evalBaseF evalStepF 40 (NList.cons (Nat.add q_top (Nat.add (Nat.mul 2 arec_0) 10)) l_inner) (Nat.add arec_0 3) + +def fastEvalF (n : Nat) : Nat := + Bool.rec 0 + (Bool.rec + (Bool.rec + (NList.rec 0 (fastEvalStartConsF (Nat.sub (Nat.div n 4) 3)) (evalNil4F 20 (Nat.sub (Nat.div n 4) 3))) + (Bool.rec 0 + (Nat.rec evalBaseF evalStepF 40 + (NList.cons (Nat.add (Nat.add (Nat.div (Nat.sub (Nat.div n 4) 3) 2) 4) (Nat.add (Nat.mul 2 (Nat.sub (Nat.div n 4) 3)) 10)) + (NList.cons (Nat.add (Nat.div (Nat.sub (Nat.div n 4) 3) 2) 3) NList.nil)) + (Nat.add (Nat.sub (Nat.div n 4) 3) 3)) + (Nat.ble 8 (Nat.sub (Nat.div n 4) 3))) + (Nat.beq (Nat.mod (Nat.sub (Nat.div n 4) 3) 8) 0)) + (Nat.rec evalBaseF evalStepF 40 + (NList.cons (Nat.add (Nat.add (Nat.sub (Nat.div n 4) 3) 6) (Nat.add (Nat.mul 2 (Nat.sub (Nat.div n 4) 3)) 10)) (NList.cons 1 NList.nil)) + (Nat.add (Nat.sub (Nat.div n 4) 3) 3)) + (Nat.beq (Nat.mod (Nat.sub (Nat.div n 4) 3) 4) 2)) + (Bool.and (Nat.ble 12 n) (Nat.beq (Nat.mod n 8) 4)) + + +-- Certificate machinery (v5): no rule tries in the kernel. +-- +-- A global rule table holds packed entries `x = (rb - 4) / 8 + 2^32 * (rd / 8 + 2^20 * log2 rs)` +-- (58 bits), 256 per block numeral `tb_j` (first entry least significant), reached through the +-- balanced block selector `blkF`. Chunk theorems replay the exact hybrid reference run: every +-- trie lookup of the reference is replaced by an explicit 15-bit table reference read from the +-- chunk stream, and every rule the reference stores is appended to the table (the chunk checks +-- that the next table entry is exactly that rule). Stream format per step: a 7-bit header +-- `kind + 4 * cnt`, then `cnt` 15-bit references (first reference least significant): +-- kind 0: `fastEval` step, then `cnt` jumps; +-- kind 1: `fastCompile` base rule step, then `cnt` jumps; +-- kind 2: `fastCompile` base rule, a chain of `cnt` looked-up rules, and the joined rules +-- (deepest first, then the base join) appended to the table. + +theorem fastEvalF_eq (n : Nat) : fastEvalF n = fastEval n := rfl + +theorem fastCompileF_eq (n : Nat) : fastCompileF n = fastCompile n := rfl + +def tRbF (x : Nat) : Nat := Nat.add (Nat.mul 8 (Nat.mod x 4294967296)) 4 + +def tRsF (x : Nat) : Nat := Nat.pow 2 (Nat.mod (Nat.div x 4503599627370496) 64) + +def tRdF (x : Nat) : Nat := Nat.mul 8 (Nat.mod (Nat.div x 4294967296) 1048576) + +-- Rule table: block `j` holds entries `256 j .. 256 j + 255`. + +def tb_0 : Nat := + 0x48006600005f99da0016800017cff38005700005f42d500300000179ff5c042600005a59d10108f000169704403c000005abfd300168000167ff78006600005999cc0018c000166733000600000599fd200168000164ff4802e20000565dd100b7f0001598048019e000054bfd10066f000153084c002a00005495d2000f0000151674c03fc0000505dd20072000013a574401c5c0004e98110051000013c674c003c00004e59d300168000137ff78018000004c7fd1005f40001320b48012600004b59d2006000001276744017dc00049dc1b00168000125ff30005700004982d3001980001246750008400004895d3000f0000121674800c000004799d1002f700011e7048011a0000467fd10045f00011a0854012600004559d600a6800010aff5000c0000041ffd1002f70001080844006600004259d200300000104ff4400bdc000414215001980001036748027c00003e5dd0009e70000f9805c008400003dd9d3004680000f2ff400117c0003cc213001980000f167440063c0003c5c1500ff00000e1776800de0000377fcf0036c0000de0b3c00d800003785d5001980000dc674c008400003695d4006f00000d3674401b9c00034dc11005580000d4ff440096000035ffd3001680000d1ff58012600003359d3003f00000c9774800de0000317fd10036f0000c608440084000031d9d4001980000c4674c008400003095d2000f00000c16748005a00002fffd3001980000be674c005a00002f3fda003000000b9ff3c00bd00002e82cf002e80000ba1744012600002d59d100a680000aaff400297c0002ac210009000000ac674001da00002b7fd3001980000a967400063c0002a5c14001680000a7ff58006600002999d4001680000a4ff440066000028d9da009f00000997740027900002660d00090000009a6740018000002759d1002100000976768011a000024bfd00045c0000930b4000c000002519d3000a80000925758003c00002459d200ff0000081774003f9c00020601000c00000085674001da0000227fd00060000008b6740011a0000233fd00030000008e674400de00001f7fcf0036f00007e0844006600001f19d30021000007a57400081c0001e9821000f0000079672c003840001e5d9300168000077ff44012600001cd9d0004920000736d4000c000001d3fd000288000075774c005a00001c7fd40049800006d674400fc00001a5dd5002100000676748005a0000197fd2001980000646750008400001895d0002070000626040005a000018bfd7000f00000616744005a000017ffd40019800005e6744005a0000173fd600300000059ff3c00bdc0001682130049800005567380123c000155c10003f0000051773800fa8000145f500037800004dff3c00dc80001381500019800004c6768005a000012bfcd0015c00004b0b40002a00001295d1000f00000496750005a000011ffd100198000046674c005a0000113fce0015f0000450838005400001145d4001980000436740005a0000107fd00049800003d675000fc00000e5dd30021000003767380081c0000ddc1000168000035ff40006600000d19d200168000032ff340057c0000cc20d001500000331744002a00000c95d3000f00000316740005a00000bffd00019800002e6740005a00000b3fce0016200002d053c006600000ad9cd0019200002b6d40005a00000a7fd000498000025673801248000095b4e003a8000026573800c0000009bfd2003f0000021773800f9c00008600e003d80000218f3800c000000899cf0021000001f67380082800007db4e00120000020574c005a0000077fd40019800001c67300063c000071c100016800001aff48002a00000695cb0009f00001a6044003c00000659d100168000017ff40006600000599ce000f00000157740001e0000053fd20019800001367340063c00004dc1200168000011ff38006600000419ce0016800000eff340058800003c14e000a800000e5748003c00000359ce0016800000bff300058800003014e0019800000a673000648000029b5b000f0000009772c003900000260cb000d80000098f38001e0000023fcd000a80000085744003c000001d9cb000ea0000076d50005a0000017fcc0015f0000060830005400000185cc000f0000006772c0030000001a9cc000a8000005572c0028800001574b00048000005b748003c00000119cb000e7000004702c00360000011fcd000f0000003772c003a800000df4b00090000003d740001e000000bfcb00018000002e74c002400000095ca000870000026028001e0000009bcb00060000001f72800168000007f4a00030000002272c001e0000005fca000720000018528001800000065c900048000001af54000600000059c60000f0000017028000c0000004dcb00060000000d7240016800000374900030000001072800060000002fca00018000000a730000c0000001dc80002a0000007d24000600000017c900018000000472000060000000bc6000150000003228000600000005c6000120000001d18000300000002c5000090000000e14000180000001440000300000002 + +def tb_1 : Nat := + 0x4c078000015dd9d301200000583674c035a000161ffd400198000571675804da0001577fd30135f00055e0850006600015719da0021000055a575401bc000154d9d500168000551ff5802220001525dd30087f000549805001c800015095d300717000542605800fc00014f99d60016800053cff5404e600014a59d30138f000529705403fc0001465dd300fe7000519804c011a0001493fd300300000526675001c800014495d3007170005126050060000013e95d3017f70004fa6050009600013dffd30024f0004f80850018000013c7fd500a980004e7674c02a3c00139dc1b00d680004d9ff4c035700013682d300a680004dcff4c024000013799d3006000004e16758012600013559d600a680004caff5001800001313fd3005f70004c50850036600012dd9d300d8f0004b7704c02e200012e5dd4006000004b1676804da0001277fd20135c00049e0b5c05220001225dd30147f000489805401c800012095d3007170004826054003c00012059d40046800047cff4c0117c0011f42130030000047e675000c000011e7fd401098000469675000c000011999d3002f700046670500d1a00010c7fd30345f000432084c0b9a00010dffd302d00000439674c0b0400010e95d3024f0000441774c054000011459d301410000452575003000001097fd7003a8000422574c00e7c00108981500cf0000415674c0339c001055c1300858000419ff68029a000102bfd000a5c00040b0b5400c0000101ffd400498000403675003000000fdd9d5015f00003e1774c0579c000f86013006000003f1675000de0000f77fd5001980003dc675402400000f4d9d3008f70003d3705001800000f359d3005f70003cd705802400000f119d3008f70003c47050029a0000ee7fd300a5f0003ba084c01da0000ef3fd3006000003be674c011a0000efffd7012000003a7ff4c047dc000ea0213010980003a9675000660000e999d6001680003a4ff6002e20000e65dd400678000392ff6400660000e459d30018c000391734c00600000e45fd901800000379674c05fdc000de5c130171000037a574805400000df19d600c0000036d674c02fdc000db5c1300768000371ff4c01800000dcd9d400600000367675401440000d895d4000f0000361675800c00000d799e100468000359ff4401164000d683910045000035a175003c00000d2bfd300ef700034b085400c00000d1ffdb00498000343674c01230000d0dcd3004800003437f4c00ea0000d115d300300000344ff54027c0000ce5dd601d1000031c674c0741c000c71c1301b7800031dff4c06840000c7d9d301800000321774c02040000cc59d300720000332574c019e0000ccbfdb012f0000309774804b90000c260d20120000030a677000de0000c17fd10036c0003060b6801260000c059d30048c000301734c01200000c05fd3003a8000302574800c60000c0b9d200300000302ff58005a0000bfffdb003000002fcff4800bd0000bf42d3003000002f9ff4c04260000ba59d7001680002e7ff6800660000b999d4014100002d257480501c000b49812013680002d2ff48033c0000b65dd4010e00002c177480435c000b06015008100002b967480201c000ae5c14001680002b7ff4c01800000ac7fd300c000002a5ff4802fdc000a9821200a980002a7675800660000a919d3002100002a2575c003c0000a859e200c00000295674802fc4000a55d9200b10000296574801da0000a67fd300a6800028aff4c00c00000a1ffd30049800028367480123c000a0dc1300c00000277674802fdc0009ddc1b00468000272ff54006600009c59d300ff0000261775800de0000977fd70019800025c6770008400009695d00020400025a6340007e0000969bd00018000025ae77001bc000094d9d1006e4000253734401b6000094dfd1006000002545770005a0000947fd30049800024d675000fc0000925dd30051000024467480141c000911c1700210000242575000fc00008f99d2003e700023e7048009600008fffdb0016800023cff4c00c000008e7fd401098000229674c005a000089ffd300198000226674c005a0000893fd900b88000219774402df00008660d300678000212ff5c002a00008495d3000f0000211675805c400007e95d2017070001fa604c003c00007e59d5001680001f7ff54018000007c7fd1005f70001f2084c012600007b59e2006000001e76744017c400079dd91005100001e8574c014400007895d2005070001e2604800c000007919d3000f00001e1674c00c000007799d6004680001d9ff50012600007559d600a680001caff4c00c0000071ffd6003000001c4ff4c0066000070d9d3009f00001b9775c008400006dd9d5006000001b16748017dc0006c5c12004680001b2ff5804da0000677fd20135f00019e084803fc0000685dd30019800019c675004bc0000625dd2012e7000189804803c000006359d200e1000018e5748029a0000647fd200900000193674801da0000653fd20021000019a574c00de0000617fd4003a8000182574800e7c000609812001980001846750003c00006059d30016800017fff + +def tb_2 : Nat := + 0x58019e000324bfd900198000c91676c060000031e59d3017f4000c79735c060000031859d5017f7000c6170540480000319d9d400ff0000c69776801da0003167fdb00f00000c4aff6c10620003025dd40417c000c09836c025e0002ffffd50096c000c000b54020400030059d4007f8000c017f6400c00002ff3fdb01698000be6675005a30002f99cd501410000bd2575404380002f05dd900810000bb9674802010002ee5cdc00168000bb7ff5816800002d77fd4059f7000b5e085011a60002dc59d404500000b72ff5008a60002e559d401698000ba1675800ea0002d695d40039f000b5a606c01bc0002d4d9da00168000b51ff5802220002d25dd600b10000b3e675002c1c002cf9c1a00168000b3cff5c04e60002ca59da00ff0000b19774c03f90002c660e203210000ae767500c804002b9dd9402c10000aed675009de0002bc7fd402178000af7ff5007c80002be95d900d68000ad9ff6801260002b559ce0048c000ad57358029a0002b2bfd602d00000a9dff500b3dc002a7821401998000ab1675004e60002add9d701488000a89776801c80002a095d300714000a82634c01c20002a09bd300690000a82e768003c0002a059cb000e4000a81735417c400028895d405f07000a22605016da0002897fd404f68000a31ff5006c000029999d401800000a69675001da00029e7fd700cf0000a15674c0339c002855c1600a68000a0aff7800c0000281ffd1002f4000a080b6009a20002785dd40267c0009e18350096600027899d4022980009e5675005a600027c59d4010980009f76760014400027719d4005070009dc706c0240000274d9d3008f40009d3737803c000027119d400ef40009c47350035a0002717fd501c680009a7ff500717c0026a021b003000009a4ff5000bd00026942db00b88000999775c020400026459d4008070009917054060000025e59d900c0000096d674c02fd00025b5cd300be800096d7f4c02c400025b95d700b10000962575002c1c00258981b003f000095e675000f90002579cd40025800095fff5c011a0002567fdc01200000947ff50047d00025202d40109800094967540126000250d9d30048f0009437078027c00024e5de201d1000091c674c07404002471d9301c2000091d578404bc0002425dd2012e1000909864804b600024263d600378000905ff58012600024059d30048f0009017068005a00023fffd6003000008fcff4800bdc0023f4215015000008e7ff54006600023999d802d000008b967500b3d00022e5cd402ce80008b97f500b0400022e95d4024f00008c17764054000022919d4014f40008a4735004da0002297fd5003000008a1676c030000022559d200bf4000895734802fa0002255fd602268000872ff6c006600021c59d10018c0008717344006000021c5fdb0136800085dff4c04d700021782d90019800085c675c008400021695d6006f00008536758005a0002147fd500fa8000842575003e7c002109814008880008497774015600020f3fd40054c00083d0b5408e20002065dd40237f000819805004e600020a59d500720000812575406000001fe95db002580007f7ff4c00930001fe02dc006000007f1ff5802a60001f9d9d600d680007d9ff4c0357c001f6821c00f000007caff5003bd0001f2c2d9006000007c4ff4c017d0001f142d3004980007c6675403660001edd9d7006000007b1675804da0001e77fd90210000077cff50083d0001df42d401e0000077fff5007260001e059d401ba8000782575006000001e17fd401488000789775c00c00001de7fd501098000769676400c00001d999d3002f400076673540d1a0001cc7fd600c00000725ff6404260001c559d40108c000715735004200001c55fd400fa8000716575001260001c859d4003a80007225758029a0001c2bfd700798000703675001e3c001c0dc1500c000006f7675c057c0001b85ddd003780006ddff5c00660001b719d600f000006cd675003bdc001b35c14009000006d3675404da0001ae7fd40135f0006ba085002400001b119d3007680006c5ff5804e60001a999d40138f0006a6705004800001a9ffdd00cf0000699775003390001a660d600678000692ff5400660001a459d30018f0006917054060000019e59d7012000006676750047dc00199dc1400c0000066d6754018000019859d4005f70006617050014400019895dd00768000659ff5001d700019682d40046800065cff5000c000019799da00f0000064aff4c03bd000192c2d5041880006097750105fc00182601402e9800061c67500b400001877fd4011880006397750036600018f59d400798000643675001800001913fd400300000647ff60020400018059d400807000601705001c800018095d400378000605ff54005a00017fffda003000005fcff500540000179ffd3014f70005e8084c04e600017a59d5001980005e6675c050400017495d5008100005b96754005a00016dffd4013980005a4674c04e3c001691c13012000005a5ff5000c000016859d3002f70005a17050030000016559d200bf70005957050089a00015cbfd30225f00057308 + +def tb_3 : Nat := + 0x70025e0005ffffd6003000017fcff6405a60005f999d902d000017b967540b3d0005ee5cd5024f00017c1775c005a0005edffda05a0000175dff50167d0005d782df003a800175a576401bc0005d4d9de00888001749774c021f0005d260d30079800174a676802c40005cf99d60016800173cff5c04e60005ca59d600ff000171977600c840005b9d9d4032070016e77060035a0005b67fd6004980016d5677c029a0005b2bfe102d0000169dff500b3c4005a7839402ce800169e17500a620005a85ddf01488001689777001c80005a095d7000f0001681675c1b0000058559d506bf70016157068029a000582bfd700300001607ff7c09a20005785dd9005100015dc675001410005771cd7009000015d3675803c000057119d400ef70015c4705807da0005693fd501f5f0015a50854078000056999d800b88001599777c020400056459d4008040015917358090000055b59d5023f700156d705c02c400055895d6003f000155e675000f9c005579c1700468001559ff780480000551ffd700e880015397754039fc0054e601601d1000151c676c04bc0005425ddb00378001505ff70012600054059d6001680014ffff6c00c000053f3fdc043980014b9675410e300052e5cd5016980014e66758054000052919d4014f70014a4707803c000052559d500ef40014957364089a00051cbfd30225c0014730b5c006600051c59d60136800145dff64006600051719da0021000145a576c01bc000514d9d800168001451ff58054000050f3fd5014f700143d088011400004fdffd5044f40013f80b5410aa0004fe95d502aa8001412576801800004fc7fd800a980013e76768035a0004f67fd600f000013caff5003bdc004f2c216006000013c4ff6c04e60004ec59d50138c0013b1735404800004ecbfde0136800139dff6008400004df3fde00300001379ff6c04e60004d999d50138c0013667368101a0004c97fd50405c0013260b540fc00004c9d9d80109800131567500423c004c55c1a00a6800130aff6801e60004c0d9d40078c001303735001aa0004c115de021f00012e1775408790004b860d5021000012e2675407800004b959d5012000012f1676400de0004b77fdb001980012dc676803c00004b359d400ef40012cd7350029a0004b47fd9027000012a6675409bd0004a99cd600cf0001299776c019e0004a4bfd10066c0012930b64035a0004967fd500d5c00125a0b6403c0000492bfd904998001201675412630004805cd504500001205ff58011a00047f3fd50045f0011fd085c0aaa00047495d502a9f0011d2605405a600047999da010e00011c17748043500047060d200ff00011c26748033c00047159d90637800115dff5418db00045782d5050100011716754025e00046dffdf003a800115a575000e700045698da010e00011497754043500045260d500ff000114a6754033c00045359d500858001151ff6c02c400044f99d400b0400113e7350025e00044fffdb0016800113cff6018c00004367fd5062f70010da08541566000439d9d504b000010f1ff5408e20004465dda004980010d56788029a000432bfd000a590010cb0e400294000432c5d602d0000109dff8405220004225dd30147c001089835c19c800040895d5067170010226054020400042059d60175800100aff5405d3c00402c21a04698000fc4675411a30003f11cd503798000fd367540ba60003f719d502d00000fddff540a620003f85dd501398000ff76770071a0003e9ffd401c5c000fa80b5006c00003ea59da00300000fa4ff7402e20003e65dd100b79000f99864402dc0003e663d100798000f9d676402040003e459d801800000f79676c03000003db59d900f00000f5e675403bd0003d79cd500b10000f625760011a0003d67fda01698000f43675405a30003d0dcd501200000f47ff5804bc0003c25dd600378000f05ff6801260003c059d900168000effff5800c00003bf3fd701500000ee7ff6000660003b999d700300000ea1676803000003a559d602268000e72ff6405400003977fd5014f4000e5e0b5c006600039719db00210000e5a575801bc000394d9da00168000e51ff5c03ea00039095d600558000e3cff500153c0038f422002388000e19775008df00038660d700720000e125764060000037e95d6012f0000de7675404b9c00379dc1500858000df1ff54009600037dffd900d68000dd9ff6803c0000372bfd900600000dc4ff6c036600036dd9d300d8c000db7734c032a00036e15da01968000d9dff54065700036782d702100000d7cff50083dc0035f421701398000d69675404e3c0035a5c1e00300000d66675c0d1a00034c7fd600c00000d25ff7806c0000342bfd501af4000d0b0b54042600034559d400c00000d19ff5c04e600033dd9d50138f000cf7705401e6000340d9d400600000d04ff68065a0003377fd50195c000cde0b54057c0003385ddd01098000ccd675404230003335cd500c00000cd1ff5402a6000334d9de01368000cb9ff5004d700032e82d401068000cbcff6404e600032999d40138c000ca67358033c0003265dd400ce7000c9980 + +def tb_4 : Nat := + 0x5804da000924bfd901800002479676c060000091859db00768002459ff5c03c0000912bfd7041880024097760025e0008ffffd50096f002400087000c00008ff3fe2016980023e6675005a24008f99d9802d000023b9675c005a0008edffd80649800235367581923c008d4dc1605da800235a576c005a0008d47fda0150000233cff58053d0008cf42d60139800233e676c04e60008ca59d30138c002329734c04aa0008ca95d30120000232aff6c03fc0008c65ddd032100022e767500c810008b9dcd4031200022e85760035a0008b67fdb004980022d5677c12fc0008a25dd604be400228983580dda0008a77fd7007200022825760003c0008a059da06c0000221567541afd0008855cd506000002221675c035a000881ffd600d5f002208086409a20008785ddd005100021dc675c0240000874d9db00f000021c4676c07da0008693fd501f5c0021a50b5c02e20008665ddf00810002191676c090000085b59d5023f400216d737002c400085895d400b04002162635002be0008589bd400a80002162e750029a000858bfd400900002164676400fc00085799e100468002159ff44011700085682d701200002147ff50047dc00852021700e88002139776c074400084719d301d0400211c736c04bc0008425dd9009780020ffff58025b00084002d600810002101676411a600082e59d60468c0020b97374054000082919d700f00002095675403bdc008255c1702400002071675808fdc0081c5c1b0136800205dff60006600081719da0021000205a5778075600080f3fd601d4c00203d0b58060000081095d600858002051ff5c11400007fdffd5044f7001ff8085c01800007fc7fd902700001fcaff5809bd0007f2c2d601800001fd9ff7401800007f13fda01398001fb167600d1a0007df3fd60345c001f7d0b6800c00007de7fd701398001f66675404e3c007d99c1805100001f156758143dc007c55c1604068001f25ff6804800007c0d9d6011f4001f03736c087c0007b85dd800378001eddff8000660007b719cc00189001edc766c10bc0007a65dd6042e4001e9983580d800007a999d602268001eb9ff700c84000799d9d603204001e6773580c4800079a15d602c10001e6d6758080400079e59d600810001e916788035a0007967fd500d59001e5a0e54024000079799d800f00001e4aff60126600078059d50498f001e017064011a00077f3fd50045c001dfd0b680aaa00077495d502a9c001dd263540aa40007749bd502a18001dd2e7540a80000774bfdb010e0001dc1775c19c800075695d606717001d5a605818de0007577fd708058001cd9ff582013c00736821601d58001d3cff5806fc00074f99d601800001d42575804380007525ddc03c00001c9dff580efd00072782d602898001cb1675803c0000732bfdd01488001c89777c19c800070895d506714001c22635419c20007089bd506690001c22e754199e000708bfd506510001c24675418de0007097fde01758001c0aff5405d3000702c2e006300001ba7ff5818bd0006ea02d604698001bc467540f660006f359da00e88001b997758039f0006e660d600300001ba4ff6802040006e459d901800001b79676807da0006d67fd601f5c001b5a0b58071a0006d73fd601b00001b5e675806000006d859d601710001b62575c05a60006d0d9d50168f001b4370880e7c0006c25dd6039e1001b09865809c00006c719e000378001b05ff5c01260006c059da00468001afcff5801170006bf42db01500001ae7ff4c053d0006ba02d700198001ae6676c11400006a859d6044f4001aa1735811040006a895d604200001aa46754101a0006a97fd502d00001ab9676403000006a559dc02268001a72ff6805a600069719d60168c001a5c735805400006977fd501188001a61776001bc000694d9d700168001a51ff6803ea00069095d400f9c001a42635003e40006909bd400f18001a42e75003c0000690bfd400d98001a446788015600068f3fd400549001a3d0e50015000068f45d802388001a19776c01c800068495d300714001a12634c01c20006849bd300690001a12e7800abc000679d9d602ae40019e773580a8000067a15d6024f00019ed6758081600067c7fd6018000019fa576c0c0000066dd9d602ff40019b77358089a0006713fd601f680019c7ff58071a000672bfd6012000019d56758035a0006767fd703a6800197cff580e97c0065f42160196800199dff6804e600065a59d50138c001969735404aa00065a95d50120000196aff6000c000065999d703468001931ff8003000006497fd200bf40019260b700ba600063dd9d602e8c0018f773580b6a00063e15d602c880018f9775808a6000640d9d601b0000190aff5c065a0006377fd50195f0018de085c090000062e7fd6023f70018ba0858042600063359d500c000018d1ff7008220006265dd60207c001899835804e600062999da00678001892ff64066600061e59d60198c0018797358006600062459db01800001861675405fd0006185cd501710001862575c059a000612bfd60165f00184b085801da0006167fd70418800180977 + +def tb_5 : Nat := + 0x840180000dfc7fda006000037c4ff7c1200000ddf3fd7047f400377d0b5c04e6000dec59db01698003766675c05a3000dd99cdb051000037156758143d000dc55cd9037680036ddff5c0dd7000db782d7033f00036e1775c0780000dbdd9d70120000370367741122000da65dd70447c00369983640fde000d967fd703f6f00365a085c0ec4000d9799d703210003667676403c0000d92bfdc004680035fcff640ee2000d705dd703b7f0035c1805c0aaa000d7495da0672000355a575819c5000d5698e1080580034d9ff582012400d36839607bf00034de67581cbc000d39d9dd03c0000349dff7024c0000d02bfd7092f400340b0b5c1eea000d0895d707800003425ff6c1c62000ce65dd70717c003399835c18c0000ce9ffd6051000033b9ff680204000ce459d901800003379676407da000cd67fdb0169800334367680e7c000cc25dd6039e4003309837800de000cc17fdc004980033016778011a000cbf3fd9016980032e6675c05a3000cb99cd7015000032e7ff601440000ca559d7050f4003295735c1140000ca859dc02268003272ff68062a000c9695d70189c00325a635c05a6000c9719d8006f00032536768005a000c947fdd0150000323cff5c053d000c8f42d700fa8003242576808e2000c865dda06a6800317cff5c1a97000c5f42d70496800319dff5c0c00000c6dd9d602df00031b9776405a6000c5999d70168c003166735c04e6000c5a59da03468003131ff880300000c497fd200bf10031260e4802fa000c4985d9048000030ddff5c11fd000c3782d702e980030f767700900000c2e7fd6023f40030ba0b740822000c265de000678003092ff600666000c1e59dd02e6800304aff5c0b97000c12c2d701f68003059ff5c0600000c1859da041880030097760025e000bffffd901998002fe667580663000bf99cd902d00002fb96768005a000bedffda05a00002f5dff7000ea000bd695db006f0002f53676c005a000bd47fda00888002f49776c02c4000bcf99df01500002f296758053d000bca5cde04200002ee76758107d000bb9dcd900d68002ed9ff6403c0000bb2bfd600ef4002ecb0b6c0b40000ba77fd402cf4002e9e0b5c0522000ba25dd700720002e825768003c000ba059dd06c00002e156768029a000b82bfda00300002e07ff6409a2000b785dd40267f002de180600144000b7719dc00900002dd367600e7c000b665dd6039e7002d9980580b9a000b693fd700810002d9167700bc4000b5895d602f04002d62636c0216000b567fd60084c002d5a0b5c0480000b51ffda00e88002d397754039f000b4e60e103000002d0977580bfc400b42619800498002d016784011a000b3f3fd600459002cfd0e5800c0000b3f99d804398002cb9675c0900000b2559d6023f7002c957064089a000b1cbfdb00198002c7167640540000b1719d6014f4002c5c735c0084000b1695dc006f0002c536778005a000b147fd705a00002bf7ff58167dc00afe021700600002bf1ff6002a6000af9d9da00d68002bd9ff5c0a26000aec59d60288f002bb1705808a6000aedd9d601500002bc4ff8004da000ae77fd902100002b7cff5c00c0000ade7fd701398002b66676c101a000ac97fda01098002b156774029a000ac2bfd700798002b03675c087c000ab85dd5021e7002ae1806000de000ab77fd700198002adc676803c0000ab359db02700002aa6676804da000aa4bfd60135c002a930b5c0ae6000a99d9d502b8f002a6770540666000a9e59df00d68002a59ff6003c0000a92bfd904998002a01676c0bc4000a7495d602f040029d263800438000a705dda0637800295dff5418db000a5782d7003a800295a57740438000a525ddd00b1000293e6780005a000a4f3fce0015900293d0e6018c0000a367fda004980028d56774029a000a32bfd7041880028897758105fc00a22601c06720002822576c177c0009f119d605de40027c4735c071a0009e9ffda003000027a4ff6802e20009e65ddc00810002791675c06000009de59df00c0000276d677803c00009d799de00468002759ff5c05a60009d0d9d90270000271c675409bd0009c71cd701b00002701675806bdc009c05c1601668002705ff6c005a0009bfffdf018000026e7ff5805fd0009ba02d7001980026e6676810800009a919d5041f40026a4736800c00009a859d3002f40026a1736003000009a559dd0376800265dff580dd700099782da0019800265c6764008400099695d700858002651ff580213c00994822100fa800264257800a380009865dd6028d4002619836c01c800098495da018000025fa574c05fd00097e98d3015f00025fc676408160009767fd60204c0025da0b6803c0000972bfda006000025c4ff5c036600096dd9da0196800259dff78084000095f3fdb01398002569676400c000095999db03468002531ff4c0d1700094c82db0270000250aff5809bd000942c2db013980024f7675404e300093ddcd5012a80024f85754046200093e5dd7019680024ddff68042600093359d50108c0024cd735c04da00092e7fdf013980024a66764054000092459d6014f700249170 + +def tb_6 : Nat := + 0x580cc00013df99d603000004f81676c00c00013de7fda06498004f15675c19230013c55cda01200004f036778087c0013b85dda00378004eddff6800660013b719df042f0004e99775810b84013a6619603768004ea4ff7c0c84001399d9de00d68004e59ff7003c0001392bfdb04998004e016774011a00137f3fdc02aa8004dd2576c04380013705de012378004c9dff5c48db00132782d70e778004cd9ff8805220013225dd301479004c89868419c800130895e201758004c0aff5405d2401302c39a06300004ba7ff8403a20012e65dd600e79004b99868406000012de59de01f68004b59ff6814220012c25dd70507c004b09836400de0012c17fd900900004afcff5c023d0012bf42db01500004ae7ff6c11a60012a859d70468c004aa1736803000012a559de02268004a72ff60008400129695db006f0004a536768044400129095d701104004a426380015600128f3fd902388004a19776801c800128495db02af00049e767680c0000126dd9db04e00004969675c137d00125a5cd9003000049666764101a0012497fd70405c0049260b680ba600123dd9da05df0004899775c177900122660d703d680048b9ff64019e001224bfdb018000048616770185a0011ffffd70615c0048000b5c15fc0012025dda019980047e667600b400011ee59dc05b6800475dff5c16d70011d782d8003a800475a576c01bc0011d4d9dc00888004749777402c40011cf99dc057000046e7675c15bd0011b9dcd7015000047296768035a0011b67fda00f000046caff780b400011a77fda01488004689776801c80011a095d90775800460aff5c1dd3001182c2d706cf0004615676c0a620011785dd70297c0045e18368014400117719dc042f0004599775c10b900116660d7037680045a4ff6c020400116459da04968004547ff5c125700115202d703768004559ff5c0cc000115799d702f1000456257780fa20011425dd703e7c004509835c0ae600114719e000378004505ff4400da401141839100360004506177c012600114059d300489004501766410e600112e59d902400004495675808fd0011255cdb02268004472ff6005a600111719d70168c00445c7368008400111695d9006f00044536768005a0011147fda05a000043f7ff58167d0010fe02df006000043f1ff70035a0010f67fda028980043b167580a230010ec5ce00136800439dff6808400010df3fda00300004379ff7404e60010d999d904068004325ff6804260010c559e000a6800430aff7801e60010c0d9de021f00042e1777000de0010b77fd8001980042dc676403c00010b359da027000042a6676404da0010a4bfde02b9800426767540ae3001099dcd502aa80042685754096600109b59d900d68004259ff6803c0001092bfd90499800420167840ffc0010705dd703fe10041c1865c0ff600107063d703c000041c5675c0bc400107495da0637800415dff7000ea00105695db010e0004149776802c400104f99da0016800413cff7818c00010367fd5062f40040da0b64012600103559d900a680040caff7c10620010225dd60417c00408983743144000ff119d70c504003fc47368071a000fe9ffe000300003fa4ff6002e2000fe65dd800810003f9167780600000fde59d900c00003f6d676803c0000fd799db00468003f59ff6809c0000fc719db01b00003f01675806bd000fc05cdb00168003effff880666000fb999d701989003ee6765c0600000fb9ffe004200003ea4676403c0000fa559d700ef4003e9573680dda000f977fd9003a8003e5a575c00e7000f9698da00858003e51ff580213000f9482d803888003e19775c0e1fc00f86601701500003e3cff7007c8000f7e95d701f14003dfa63680816000f767fd900f00003dcaff6c0180000f713fe100d98003db7674c0362400f6ddd9901968003d9dff600de6000f5999d70378c003d66735c0d26000f5a59d902d00003cddff5c0b3d000f3782da01098003ccd676804da000f2e7fdb01398003ca6676c0540000f2459d6014f4003c9173780600000f1e59d901f68003c59ff5c07d7c00f16821701b00003c5e678403c0000f12bfd300ef1003c4b0e741062000f025dde00978003bffff6800c0000eff3fd801698003be6675005a3c00ef99c1a02d00003bb96770005a000eedffd806498003b536770005a000ed47fd901500003b3cff7008e2000ec65dd70237c003b19836c0c84000eb9d9df00d68003ad9ff880126000eb559ce00489003ad5767814c4000ea095d705304003a82635c12fc000ea25ddd000f0003a81676c1e5a000e81ffd70795c003a080b5c1d9a000e82bfd706c00003a15677809a2000e785dd9005100039dc67680240000e74d9d900f000039c4676407da000e693fda00b88003999776c0b04000e5b59d702c0400396d737c03c0000e5799d700ef400395e7368059a000e51ffd70165c0039480b7003a2000e4e5dda01d1000391c677c04bc000e425dde015000038a4676803c0000e2559db02400003871675808fd000e1c5cdd0136800385dff740066000e1719dc01f6800383cff5c07d7000e0f42da045000037f7ff + +def tb_7 : Nat := + 0x640744001a4719d9012f00069097768025e001a3fffdb05b980068a4676016e3001a291cd8046980068b967580666001a3999da00f0000689567680900001a1c59dd0136800685dff680066001a1719db01f6800683cff6801800019fc7fd9027000067caff7001800019f13fdc0480000677cff7005a60019d999da0510000671567640dda0019b77fd90448800669977640fde0019967fd900f0000664aff68138000197f3fd804df40065fd0b60126600198059d903b880065c1777019c800195695db080580064d9ff58201300193682da03c0000649dff6824c0001902bfde0799800639167601e630018e45cd807188006399775c19800018e93fde01800006379676807da0018d67fdf0169800634367640e7c0018c25dd6039e7006309806400de0018c17fdb004980063016774011a0018bf3fd9016980062e6676414400018a559de02268006272ff78062a00189695d9006f00062536768005a0018947fdb0150000623cff8808e20018865dd402379006219865006000018893fdb032100061e7675c0c81001879dcd70072000621257681a9a00185f3fd90169800616667740d1a00184c7fdb00c00006125ff7812000018377fdb024000060b9ff6808220018265dda00678006092ff70066600181e59da02e6800604aff6c10620018025dd900978005fffff6006660017f999d60198f005fe670680b400017ee59db00168005fb7ff6416800017d77fd9003a8005f5a576401bc0017d4d9de00168005f51ff7802220017d25dda00b10005f3e678005400017ca59d804200005ee76758107dc017b9dc1900d68005ed9ff8003c00017b2bfdf02d00005e9dff6807260017a059d701c8c005e81735c06ea0017a095d806c00005e156764029a001782bfdf00300005e07ff6c09a20017785dd900510005ddc67680240001774d9db039f0005d9977580e7900176660db03720005d62575c0dc500175898da00858005d59ff6c082200174e5dd70207c005d3983640c000017425dd602ff7005d09807000de0017417fdb00498005d016778011a00173f3fd60045c005cfd0b6410e600172e59de04668005c72ff5c119700171cc2df00198005c716768054000171719dc00900005c53675c023d001714dcdb00168005c51ff7c1aa60016f9d9d706a8c005be7735c1a6a0016fa15d706498005bed675c18000016fc7fdb00d68005bd9ff680f000016e77fd703bf4005b9e0b6408400016df3fdf05700005b25ff5c15bd0016c982d701698005b66676404260016c559e200a68005b0aff700b400016b77fd702cf4005ade0b5c0a620016b85dda01098005acd675c04230016b35cd902700005aa6677c04da0016a4bfd803900005a59ff5c0e3d00169682dd00f00005a4aff60126600168059df02f100059d2576804380016705dd90637800595dff6c05220016525dd70147c005949836402c400164f99de0016800593cff6818c00016367fd9004980058d56768029a001632bfdb0a8a8005822575c2a2700160898da05df00057c4678007da0015e93fd701f590057a50e5c07800015e999d900b88005799776c02040015e459d90240000576d675c08fd0015db5cd900f0000575e6764011a0015d67fdb03d9800571c675c0f630015c71cdf01c680056ffff5c07170015c002da018000056e7ff6810e60015a919d70438c0056a4738400c00015a859da00c0000569567840dda0015977fd60375900565e0e580dd400159785d6033f0005661776c006600159719dd0021000565a5770060000159095d7017f400564263600a380015865dd6028d7005619806c01c800158495d8018000055fa576808160015767fde00f000055caff6401800015713fd90270000559dff5c09bd00156782de0210000557cff6804e600155a59dd0030000556667880d1a00154c7fd3034590055320e4c0d1400154c85d303300005533678009c0001542bfda013980054f767680a8000153359d7029f40054cd736809c000152999d7026f40054a67360054000152459d9018000054796770060000151859db00768005459ff8816800014ffffd7059f10054000e5c167a00150005d705898005401675c14220015025dda003000053fcff6805a60014f999da02d000053b96764005a0014d47fd90150000533cff7004e60014ca59d800ff000531977640c840014b9d9dc00d680052d9ff7c01260014b559db04bf0005289776802040014a059d70080400528173741b0000148559d9033f00051e1775c0cf900147860dc005100051dc6764060000147119d7017f40051c4736407da0014693fda01398005191675c04e30014645cde0240000516d676c02c400145895e2003f000515e675000f84014579d9b00468005159ff740f6600144719d703d8c00511c735c082200144e5dd8012f00051097768025e00143fffd9046980050b96764054000142919d90466800505dff5c119700141782d7033000050716774006600141719da0021000505a5768075600140f3fda07200004fcaff5c1c7d0013f2c2d704b00004ff1ff6801800013f13fdb01398004fb1677c0d1a0013df3fd603459004f7d0e + +def tb_8 : Nat := + 0x800f660021c719d901c680086ffff6810e60021a919dc003000086a1676410da0021977fd80435c00865e0b68006600219719e20021000865a57400080402196999b0180000864257700a380021865de200720008612574c01c44021849999018000085fa577008160021767fda00f000085caff6c01800021713fe00270000859dff64084000215f3fda0030000856667680d1a00214c7fe00270000850aff6c04e600213dd9da02a000084cd676409c000212999db01500008491676c060000211e59db01800008461677001da0021167fd905d000083fcff60173d0020ff42d805a000083ffff6805a60020f999da09468008351ff6025170020d482d80930000835367600b9a0020edffde0150000833cff8404e60020ca59d900ff000831977680c840020b9d9db012000082d56760047d0020b55cda04bf000828977681d0400208559d807404008215736002040020a059da033f00081e17768014400207719da018000081c4676807da0020693fde01398008191676c090000205b59da00b10008162576c00fc00205799df00468008159ff6c0f6600204719db012f0008109776811a600202e59da015000080a46768119a0020177fdb003a800805a576000e700201698d901d5800803cff701c80001ff2bfd900600007fc4ff700dda001fde7fd80375c007f7a0b701da6001fc0d9d80768c007f0373601926001fc559db021f0007ee177800144001fb719d800504007edc736c10bc001fa65dda03210007e676780035a001f967fdd05d00007dfcff60173d001f7f42d805898007e0167780aaa001f7495d9010e0007dc1776448de001f277fdb01488007c89776c19c8001f0895d901758007c0aff7018c0001ee9ffd900e88007b9977680204001ee459dc01800007b79676807da001ed67fde05088007b09776800de001ec17fdb00900007afcff740540001eb9ffde04698007aa167740300001ea559d902268007a72ff6805a6001e9719db00210007a5a576c0600001e9095d8017f4007a42636c0156001e8f3fda02aa8007a1257600aa7001e8498db02af00079e767680c00001e6dd9e104e00007969676810da001e497fd80435c0079260b840ba6001e3dd9d905df0007899777c019e001e24bfdd0199800787967680600001e1859db061680077ffff700b40001dee59da05b6800775dff7000ea001dd695dd006f0007753676c005a001dd47fde00888007749776402c4001dcf99d9073680076caff601cd7001db2c2d8064680076d9ff6015c0001db9d9d7024f0007719776c0b40001da77fde01488007689777401c8001da095db0775800760aff680a62001d785ddc005100075dc677012c0001d6459d804af4007591736010bc001d665ddc04968007547ff7c0fa2001d425ddb00378007505ff6c0126001d4059d9004680074fcff6410e6001d2e59da02400007495677c089a001d1cbfdc0169800745c676c0084001d1695db05b680073f7ff6016d7001cfe02db006000073f1ff680600001cf67fd8017f40073da0b6c0a26001cec59db0136800739dff680900001cde7fd8023f400737a0b7804e6001cd999db04068007325ff6806c0001cc2bfd801af400730b0b6c01e6001cc0d9db021f00072e1777800de001cb77fda001980072dc676c03c0001cb359da027000072a6676804da001ca4bfdb02b980072676768035a001c967fda00f0000724aff741266001c8059da03ff00071c1775c0ff9001c7060dc0637800715dff7c00ea001c5695d9010e0007149776402c4001c4f99d90016800713cff8019e6001c3559d80678c0070d57368029a001c32bfdb0418800708977683144001bf119df01c68006fa7ff6800c0001be93fd900b88006f9977800204001be459da02400006f6d676008fd001bdb5cda00f00006f5e677006c0001bd0d9d801af4006f43736409c0001bc719dc01b00006f016770005a001bbfffd905b98006ea4676016e3001ba91cd801998006ee6676403c0001ba559dc03768006e5dff6800ea001b9695dc00858006e51ff700e22001b865dd70387c006e19837807c8001b7e95dd02058006dd9ff7403c0001b72bfde00600006dc4ff840366001b6dd9db01968006d9dff740de6001b5999dd05b68006d0aff5c16d7001b42c2e202d00006cddff5c0b3c401b37839702ce8006cde175c0a62001b385dd901098006ccd676804da001b2e7fdd01398006ca667680540001b2459e001800006c79676c07da001b167fd701f5c006c5a0b6c03c0001b12bfde04188006c09776c025e001affffdf00300006bfcff6c05a6001af999dd02d00006bb96778005a001aedffde06498006b5367581923001ad4dcda00168006b51ff6c0540001acf3fdd02388006b1977640c84001ab9d9e000d68006ad9ff4c0356401ab6839a00498006ad5677814c4001aa095d9000f0006a81676c1e5a001a81ffdb034980069d367600d23001a74dcd802b980069dc676803c0001a7119da01f680069a4ff6802e2001a665dda02c1000696d676c03c0001a5799e201668006947ff5c0596401a52039701650006948175c0540001a5259db00e8800693977 + +def tb_9 : Nat := + 0x6810bc0029665dd7042e400a5998368020400296459db0496800a547ff700fa20029425dd90037800a505ff64012600294059da0046800a4fcff6810e600292e59da0240000a495676c089a00291cbfdf018a800a45a5760062700291698dc006f000a4536764005a0029147fdc05a0000a3f7ff6c01800028fc7fd900a9800a3e76764035a0028f67fdb0289800a3b1676404da0028e77fdf0210000a37cff7000c00028de7fd90139800a366677c101a0028c97fda0109800a3156764029a0028c2bfdb0079800a303676400de0028b77fdb0109800a2cd676004230028b35cda0270000a2a6678804da0028a4bfd60135900a2930e5804d40028a4c5d60120000a294675803c00028a5d9dc02b9800a2676768035a0028967fd900f0000a24aff70126600288059d903ff000a1c1776818de0028577fda003a800a15a576804380028525ddb00b1000a13e6774005a00284f3fda0630000a0d9ff84012600283559e100a6800a0caff7810620028225dd90c510009fc46770071a0027e9ffd900300009fa4ff780ae60027de59d802b8c009f79736004e60027e459e100c00009f6d674c02fc4027db5d9a00f00009f5e6770011a0027d67fe101698009f43678809c00027c719d5026f1009f1c767406c00027c059dd00168009effff6406660027b999d70198c009ee6736810800027a919dc00f00009e9567680dda0027977fdf00858009e51ff7c15ea00277e95d80579c009dfa636808160027767fdc00f00009dcaff7401800027713fdb00d98009db76784065a0027677fd501959009d9e0e54065400276785d5015f0009da1776424c0002742bfd8092f4009d0b0b6c0b400027377fdd01098009ccd678404da00272e7fdb01398009ca6676c054000272459db01800009c79678407da0027167fd900f00009c4aff6c10620027025dd900978009bffff6800c00026ff3fd904398009bb9676010e30026ee5cdd00168009bb7ff6419800026d47fd8065f4009b520b7805400026cf3fd902388009b19775c08dfc026c6601a03210009ae76764035a0026b67fd900498009ad5676814c40026a095df000f0009a81677c1e5a002681ffdc026880099e17768014400267719db009000099d3676c03c000267119dd01f680099a4ff6802e20026665ddf02c1000996d676403c000265799dc01668009947ff6803a200264e5ddb01d1000991c676404bc0026425dd9009780098ffff6811a600262e59db015000098a4676803c000262559e202400009871675808fc40261c5d9602310009872576404da0026177fd90019800985c676407da00260f3fdb045000097f7ff7001800025fc7fda027000097caff6801800025f13fd90480000977cff8805a60025d999d701689009766765c05400025d9ffd701398009769676814400025c559e0037680096ddff5c0dd64025b78397037500096de176811220025a65ddb03f78009659ff5c0fdb00259682da00f0000964aff6c126600258059d9004680095fcff6c0ee20025705dd703b7c0095c1837019c800255695d9080580094d9ff640f000025277fd90930000940aff701c620024e65dda00810009391678806000024de59d3017f1009379767007da0024d67fda01698009343676800de0024c17fdb004980093016764011a0024bf3fde016980092e667641cda00249cbfd80735c0092730b68062a00249695de00858009251ff60021300249482d90150000923cff6408e20024865dd9032100091e7675c0c81c02479dc1701f200091fa57681a9a00245f3fda0169800916667840d1a00244c7fd900c00009125ff7412000024377fdd024000090b9ff6408220024265dd900678009092ff701200002412bfd8047f400904b0b6c10620024025dde02310008fe6676008c10023f99cda02d00008fb9677416800023d77fe1003a8008f5a576801bc0023d4d9dc00168008f51ff6402220023d25dd900b10008f3e677805400023ca59db04200008ee76770035a0023b67fdb00f00008ecaff6c0b400023a77fd901c98008e8167881b0000238559d506bf1008e157678029a002382bfdb00300008e07ff6c09a20023785ddd00e10008dd367600381002374dcda07110008d6257601c4100235898da00858008d59ff6c082200234e5dd903000008d09776c00de0023417fdb00900008cfcff60023d00233f42de08a00008c72ff60227d00231cc2da00198008c716768054000231719db00900008c536764005a0023147fda07800008bd9ff601dfd0022f682d806a98008be767640f000022e77fdd02100008b7cff7815c00022c97fd900a68008b0aff640f660022b359d803d8c008acd73600b400022b77fda02700008aa6676804da0022a4bfdb03900008a59ff70162600228059d80588c008a0173680bc400227495db010e00089c1776c18de0022577fd901488008949776802c400224f99d90016800893cff8819e600223559d8067890088d57664029a002232bfdd0a8a80088225764177c0021f119da01f680087a4ff5c07d70021e942d900b88008799776c02040021e459da0240000876d676803c00021d799d900468008759ff + +def tb_10 : Nat := + 0x6804da0032177fda0210000c83cff64083d00320f42db0450000c7f7ff6c01800031fc7fde0270000c7caff683b400031b77fd90ecf400c6de0b642d660031c559d90a50000c725ff6419260031d999d90619800c769676413800031df3fd902d0000c79dff6406660031ec59dc0448800c69977780fde0031967fdd00f0000c64aff6c138000317f3fda03b8800c5c1777c19c800315695da0805800c4d9ff740f000031277fe00930000c40aff682c400030d67fd90b0f400c35a0b6424660030de59d90799800c39167601e000030e4bfdb0169800c34367780e7c0030c25ddd0037800c305ff7401260030c059da0046800c2fcff7805a60030b999dd0510000c2956768089a00309cbfdb018a800c25a577c01bc003094d9db0016800c251ff68054000308f3fdb06a6800c17cff6805a600305999dc0346800c131ff6803000030497fde0480000c0ddff6c08220030265ddd0067800c092ff68066600301e59db02e6800c04aff6810620030025dda0097800bfffff6411a6002fee59d80468c00bfb97368005a002fedffdb05a0000bf5dff6c00ea002fd695de006f000bf536770005a002fd47fda0088800bf49776c02c4002fcf99db0150000bf29676813da002fb67fd804f5c00beda0b7803c0002fb2bfd902d0000be9dff640726002fa059df0766800be0aff601d97002f82c2da0030000be07ff6409a2002f785dde0051000bddc676c0240002f74d9d9039f000bd99776c0dc8002f5895dc0085800bd59ff740822002f4e5ddb0300000bd0977580bfd002f4260d90037800bd05ff6c0126002f4059d90046800bcfcff8010e6002f2e59d50438900bcb9765410aa002f2e95db0466800bc72ff7c0066002f1c59d90150000bc5c67640240002f14d9d7008f700bc537068005a002f147fdb06a9800bbe76764035a002ef67fde03c0000bb9dff680840002edf3fd90570000bb25ff840426002ec559d40108900bb157668029a002ec2bfde02d0000baddff800426002eb359e20270000baa6675409bc402ea99d950256800baa7ff6404da002ea4bfd9010e000b9c1777c18de002e577fda0148800b949777802c4002e4f99da0016800b93cff6818c0002e367fda0049800b8d56778029a002e32bfdd0a8a800b822576c177c002df119d901f6800b7a4ff7402e2002de65ddc0081000b79167780900002ddb59df00f0000b75e6780011a002dd67fdb03d9800b71c6768071a002dbfffd90439800b6a4677800c0002da859e100c0000b69567680dda002d977fdb0019800b65c67680600002d9095e00300000b61257600bfd002d8498da0385800b5d9ff600e13002d7682d900f0000b5caff740180002d713fdc0270000b59dff680840002d5f3fdb0139800b569676400c0002d5999db0346800b531ff6409c0002d42bfdc0139800b4f767640a80002d3359dd0270000b4a667700b40002d1e59d802cf400b47973680600002d1859d90076800b459ff5001d7c02d16821905a0000b3ffff5c167d002d0002db0030000b3fcff6805a6002cf999df02d0000b3b967881980002cd4d9d7065f100b353765c1944002cd515d705f1000b35a5778005a002cd47fdf0150000b33cff6804e6002cca59e00420000b2e76760107d002cb9dcdf00d6800b2d9ff640126002cb559da04bf000b28977680204002ca059da06c0000b21567680cfc002c785dde0180000b1c4676c07da002c693fdb0139800b19167640900002c5b59db00b1000b162576c00fc002c5799dd0046800b159ff640f66002c4719da01c6800b0ffff600717002c4002df0469800b0b967680540002c2919e00466800b05dff780084002c1695dd01d5800b03cff681c80002bf2bfdb0060000afc4ff6804e6002bec59e10346800af7cff7800c0002bde7fda0649800af15676c0480002bc0d9dd021f000aee1777c00de002bb77fdc0019800aedc676410bc002ba65dda0321000ae676784035a002b967fdb00f0000ae4aff6c1266002b8059db0046800adfcff680aaa002b7495d9010e000adc1776848de002b277fde0148800ac89776819c8002b0895da0175800ac0aff6c18c0002ae9ffd900e8800ab9977640204002ae459d90180000ab79676407da002ad67fd90508800ab09775c141fc02ac260210037800ab05ff6c0240002abf3fda0150000aae7ff6811a6002aa859d900c0000aa956768089a002a9cbfdd0169800aa5c676c0240002a94d9d8008f400aa5373700444002a9095d90055800aa3cff7808e2002a865ddc0072000aa1257640abc002a79d9d602ae700a9e7706c0c00002a6dd9da04e0000a969678800c0002a5999d3002f100a9667670101a002a497fdb02e9800a8f76774177c002a265ddc0067800a892ff640666002a1e59d90616800a7ffff5c1857c02a00021b0199800a7e66764221a0029d77fd80885c00a75e0b6c02a60029d4d9d800a8c00a7537378005a0029d47fd90088800a749776802c40029cf99de0570000a6e7676c035a0029b67fdd00f0000a6caff640b400029a77fdc0148800a689776c01c80029a095de0775800a60aff6c0a620029785dda0051000a5dc67 + +def tb_11 : Nat := + 0x6809c0003aa999df0136800ea92ff6c0e40003a967fdc087a800e9d2576421e7003a7498d90589800ea0167680438003a705ddd0637800e95dff7c0522003a525dda00b1000e93e6780005a003a4f3fdb0679800e8d5676019e3003a355cdc00a6800e8caff702a2a003a0895e201f6800e7a4ff7002e20039e65ddb0081000e791676809000039db59da00f0000e75e6778011a0039d67fde05a0000e6ffff64167d0039c002d903d9800e71c677006000039b9ffdd0030000e6a1677010da0039977fdd0019800e65c6768068400399095d901a0400e64263680a380039865ddb0072000e6125774060000397e95e002f5800e5caff640bd3003972c2db0060000e5c4ff6c09c00039677fdb0210000e57cff6c04e600395a59de0376800e531ff640dd700394c82da0270000e50aff6c04e600393dd9db02a0000e4cd676c09c000392999db0450000e4616764113d0039185cd902d0000e479677001da0039167fdf05d0000e3fcff6805a60038f999da0946800e351ff8405400038cf3fd6014f100e33d0e6804e60038ca59de00ff000e31977680c840038b9d9da0120000e2d5676c12fc0038a25de20741000e21567601d004038855d9a0390000e1dc67640e3d0038771cd9033f000e1e17768060000387119da01f6800e1a4ff6804e600386459da0240000e16d676c02c400385895dc0085800e159ff64021300385682da03d9800e11c677004bc0038425dda0651000e0a4676419410038291cd90501000e0b96768119a0038177fdd01d5800e03cff7c04e60037ec59df0376800df79ff6c1da60037c0d9da021f000dee1777801440037b719da042f000de99776c0c84003799d9da00d6800de59ff7c21ea00377495d90879c00ddd26364174000377f3fdc010e000ddc1776c48de0037277fda0148800dc89776819c800370895db0175800dc0aff6818c00036e9ffe000e8800db99777802040036e459df0508800db09776800de0036c17fdb0090000dafcff6c05400036b9ffdb0469800daa167880b9a00369cbfd902e5900da730e640b9400369cc5d902d0000da7467640a8000369dd9df0169800da5c676c008400369695de0180000da425768015600368f3fde02aa800da12576c0abc003679d9de0300000d9b76774138000365a59da0436800d925ff700ba600363dd9dc05df000d899776c019e003624bfe00319800d86167640c630036185cda0616800d7ffff7828800035d77fd90a1f400d75e0b6411a60035ee59d90199800d7e6676c00ea0035d695da0085800d751ff6402130035d482da0088800d74977841cda0035b2bfd80735900d6cb0e601a400035b559da02d0000d69dff8405220035a25ddc0072000d68257741dd6003582bfdb0298800d5e17768140400356459d90500400d5917368125a003551ffda03e8800d509775c0f9f00354260da0037800d505ff6c012600354059dc0046800d4fcff6810e600352e59da0240000d49567740ec400351695d903b0400d45a63640e4000351719d90376800d45dff64090000351c59dc006f000d453676816da0034fdffde0060000d3f1ff7406000034f67fdb0289800d3b1676804da0034e77fdb0240000d379ff6804e60034d999db0406800d325ff6c06c00034c2bfdd0079800d3036768087c0034b85ddc0051000d2dc676401410034b71cde00f0000d2cd67680e9a0034a4bfd903a5c00d2930b680ae6003499d9e10a5f000d1c17764297840347061990660000d2016764071a003492bfda0672000d15a576419c500345698dc010e000d149777802c400344f99dc0016800d13cff8419e600343559d80678900d0d57668029a003432bfdc0418800d089776c31440033f119db0030000cfa4ff6c02e20033e65dda02c1000cf6d67640b010033db5ce102a0000cf4367640a7c4033d0dd990291000cf445764095a0033d1ffd90136800cf59ff6c09c00033c719db01b0000cf01677003c00033a559da03b1000ce5a57640ec100339698d90376800ce5dff6c0e220033865ddb04e7800cdcaff64139b003372c2d903f7800cdd9ff640c84003379d9d901f2000cdfa576804e600336dd9d90138c00cdb7736c065a0033677fdd0379800cd66676816da003342bfdb02d0000ccddff70042600333359db0136800ccb9ff6c102600331e59d90408c00cc7973640a2600332459d90270000cc92ff6c07da0033167fda00f0000cc4aff6810620033025dda0097800cbffff6806660032f999d90198c00cbe673680b9a0032edffd902e5c00cbb80b640b400032ee59db0649800cb53676c005a0032d47fdd0150000cb3cff6c08e20032c65ddb0321000cae7678804800032b559d9011f100cad5767c14c40032a095de000f000ca8167681e5a003281ffdb0349800c9d3676803c000327119da01f6800c9a4ff6802e20032665dda03b1000c95e67640ec10032579cd902c1000c96d675c080400325e59df0166800c947ff6803a200324e5ddc01d1000c91c676804bc0032425de20097800c8ffff58025a40324003960096000c90017681aa600322559d906a8c00c895736416e600322919de0240000c87167 + +def tb_12 : Nat := + 0x7004800043c0d9dc021f0010ee1777000de0043b77fdc00198010edc676810bc0043a65ddb03210010e67676c035a0043967fda00f00010e4aff70126600438059da00468010dfcff6c0aaa00437495da010e0010dc1776848de0043277fde01488010c89776c19c800430895da01758010c0aff7418c00042e9ffda00e88010b99777402040042e459da01800010b79676c07da0042d67fde05088010b09777c085e0042b9ffd90216c010ae80b64031e0042bf3fdc04698010aa1677c03000042a559da02268010a72ff6805a600429719db00900010a53676c044400429095db00558010a3cff6c0aaa00428495d902a9c010a12636c0abc004279d9df030000109b76770138000425a59e205df0010899775c17784042266197052680108a4ff5c144000422999da020100108796764080100421e5cdb01800010861677c185a0041ffffe2019980107e6675806624041f99d9a00a980107536768005a0041d47fdc00888010749776802c40041cf99dc057000106e76770035a0041b67fdb00f000106caff6c0b400041a77fdd01488010689777c01c80041a095db0a0e00105e17764283500417860de005100105dc676c10bc0041665ddc00810010591677c0fa20041425ddd00378010505ff68012600414059da004680104fcff68228000411cbfd9089f40104730b6419e600412559df018a801045a576c02160041147fd90084c0104520b8816800040fdffd6059f10103f80e6801800040fc7fdb00a980103e7674c02a30040f9dcd3009a80103e85770035a0040f67fdf0136801039dff7808400040df3fdf00300010379ff8004e60040d999d501389010366767814400040c559d9050f4010315737001e60040c0d9da021f00102e1776800de0040b77fda03f0001026767640fbd004099dcde01c6801024aff640717004092c2de089880101c17764225f00407060dd0637801015dff6c00ea00405695da010e0010149776c02c400404f99db0016801013cff6818c00040367fda0c51000ffc46784071a003fe9ffd401c5900ffa80e500714003fea05e20030000ffa4ff5000bc403fe9439b02b9800ff79676c06c0003fd799d901af400ff5e7374011a003fd67fda0169800ff43676c09c0003fc719db01b0000ff016768005a003fbfffda0420000fea4676c119a003f977fd90465c00fe5e0b880300003f947fd900bf100fe520e6402fa003f9485d900a9800fe53676815ea003f7e95dd0205800fdd9ff680540003f713fd9014f400fdc50b680366003f6dd9e20ac6800fd0aff642b16403f42c3990a20000fd156764245a003f497fd90856800fd31ff641440003f5999db03d9800fccd67640f63003f335cdf0136800fcb9ff6804e6003f2999db0150000fc9167680600003f1e59da02e6800fc4aff640b97003f12c2da0418800fc09777c025e003effffdb0030000fbfcff7010e6003eee59e00016800fbb7ff781980003ed47fe20388800fb1977640e1e403ec6619902d0000fb24ff640a26003eca59da0321000fae76768035a003eb67fda0049800fad5676c14c4003ea095dd000f000fa81676c1e5a003e81ffde0268800f9e1777c0384003e74d9d900e0400f9d373680b04003e5b59da00f0000f95e6778059a003e51ffdb00e8800f93977880744003e4719da012f000f909776c025e003e3fffdf0469800f8b967680540003e2919db00f0000f895676c0900003e1c59dc0136800f85dff680066003e1719dd01f6800f83cff841140003dfdffd5044f100f7f80e54113a003dfe05d50439800f7f967680180003dfc7fda0270000f7caff6c0180003df13fda0480000f77cff6805a6003dd999da0510000f71567681efc003da65dd907be400f699836c2604003d8059d90980400f6017364139e003d92bfdb0046800f5fcff6c28aa003d5695d90a29c00f55a637c2016003d367fdd03c0000f49dff7424c0003d02bfde0718800f39977780204003ce459dd039f000f309776800de003cc17fdf0049800f3016774011a003cbf3fe2018a800f25a575c0626403c96999e0085800f251ff700540003c8f3fdf0238800f219776c0c84003c79d9dc04b0000f131ff6412bd003c4c82dc00c0000f125ff680822003c265ddb0067800f092ff681200003c12bfdf0418800f0097770145e003bedffd90516c00efb80b641404003bee59d90231000efe667741680003bd77fda006f000ef536770005a003bd47fdd0088800ef4977840540003bca59db0420000eee76768125a003ba77fd90495c00ee9e0b64071a003bb2bfdb01c9800ee8167681b00003b8559e100a6800ee0aff7800c0003b81ffdf0349800edd367640d23003b74dcdb0711000ed6257700216003b567fde0208800ed3977700c00003b425dda0037800ed05ff680240003b3f3fdf08b9800ec71676422e3003b1c5cd908a0000ec72ff6019e6003b2559db01e0000ec536764077d003b14dcdb0016800ec51ff6c1e00003af67fdd03c0000eb9dff681e00003ac97fd9077f400eb260b740426003ac559dd00a6800eb0aff880f66003ab359d803d8900eacd76600e40003ab47fd802e9800eadc67 + +def tb_13 : Nat := + 0x700ae6004c99d9dd00d68013259ff7003c0004c92bfda0499801320167800ffc004c705ddb003a801315a5768213c004c3559d9084e40130d573640756004c4f3fd901bf001313e676c029a004c32bfda041880130897768071a004be9ffdb00300012fa4ff6c04e6004be459d90138c012f9173780900004bdb59e000f00012f5e677806c0004bd0d9df04200012f016764107d004bc05cde0a200012e5dff64287d004b9782d906a98012e95676c00ea004b9695db03888012e19777007c8004b7e95dc02058012dd9ff6803c0004b72bfdc00600012dc4ff6c0366004b6dd9da01968012d9dff680de6004b5999da05b68012d0aff680b40004b377fe002400012cb9ff6408fd004b2e82da01398012ca6676c0540004b2459db01800012c79677007da004b167fda00f00012c4aff6c1062004b025dda00978012bffff7000c0004aff3fe101698012be667680b40004aee59db00168012bb7ff881926004ad4d9d606489012b53765818ea004ad515de00168012b51ff680540004acf3fda02388012b1977680fde004ab67fd903f6c012ada0b6c0126004ab559dc07a58012a07ff641e93004a8202da034980129d3676c03c0004a7119de01f680129a4ff6c02e2004a665dde02c1001296d676803c0004a5799da01668012947ff7003a2004a4e5de2039780128ffff640e5a404a40039903000012909777c16e6004a2919e200f00012895675403bc404a255da102400012871676804da004a177fda01f6801283cff6811400049fdffe1006000127f1ff840b400049f13fd902cf10127c50e640ae60049f199da0480001277cff7805a60049d999e2051000127156758143c4049c55d9b118680125fcff64461700497f42d90ca6801264aff642eda0049967fd907bf0012699777028aa00495695d90a29c01255a636820160049367fe20930001240aff5c24bc404902c39a07998012391676c06000048de59de01f68012359ff6805a60048d0d9db042000123016764107d0048c05cd903d68012305ff68011a0048bf3fda08a00012272ff64227d00489cc2d906798012295677802160048947fd90084c0122520b68054000488f3fda02388012219776c0c84004879d9de06a6801217cff6812c000484c7fd904af40121320b6803000048497fda048000120ddff6c090000482e7fde020880120997784066600481e59d60198901207976740b9a004812bfde04188012009777414040047ee59d905004011fb97370005a0047edffda06600011f51ff64197d0047d482d906498011f536764176a0047d695da00888011f49776c02c40047cf99dc01500011f296768179a0047b2bfd905e5c011ecb0b6413da0047b67fe002d00011e9dff7807260047a059db07968011e07ff641e5700478202d907668011e0aff8009a20047785ddb00e10011dd367640381004774dcda039f0011d99776c0dc800475895db02088011d39776c0cde0047417fd90336c011d060b70012600474059dd00468011cfcff68228000471cbfd9089f4011c730b68006600471c59e001500011c5c6758053c4047171d9b00900011c53677c005a0047147fdc00d68011bd9ff6806c00046c2bfd901af4011b0b0b6c0b400046b77fde01098011acd67700e9a0046a4bfd903a5c011a930b801200004692bfd8047f1011a4b0e681e2a00467495d80789c0119d2637804380046705dd2010d10119c18648043200467063da0780001194977641dfd00465260da00c7801193cff64031b00464f42db063000118d9ff6c03c0004632bfd900ef40118cb0b6c2a2a00460895db05df00117c4678007da0045e93fdc01398011791676404e30045e45cda0750001171c67641d3d0045c71cd903768011759ff640cc00045d799da01c680116ffff7006000045b9ffdd043980116a4676800c00045a859db00c0001169567680dda0045977fda0019801165c6768008400459695db01800011642576c0c0000458495db038580115d9ff7403c0004572bfda04e0001157cff64137d00455f42d902d0001159dff6c04e600455a59da0030001156667680d1a00454c7fdf0270001150aff7004e600453dd9dd02a000114cd676c09c000452999db045000114616764113d0045185cd902d00011479677801da0045167fdb003000113fcff7c05a60044f999e102d000113b967540b3c4044ee5d9502c100113ba577819800044d4d9d7065f4011353736c0a800044ca59d9029f40113297364059a0044cf3fe104f680112d9ff6413d64044b68399042000112e7678401260044b559dc04bf0011289776c02040044a059da06c0001121567680e4000447719d9038f40111dc736c12c000446459d904af401119173640dda0044693fe10240001116d675408fc40445b5d9b00b10011162576800fc00445799db00468011159ff680f6600444719db01c680110ffff6828e600441719d90a38c01105c736428800044177fd905b980110a4676c008400441695dd01d5801103cff781c800043f2bfe000600010fc4ff7004e60043ec59db03468010f7cff6c00c00043de7fe206498010f15675c19224043c55d9705400010f25ff + +def tb_14 : Nat := + 0x6c0240005674d9de00f000159c4678007da0056693fd501f590159a50e7802e20056665dda02c1001596d6770095a005651ffd90255c0159480b7c03a200564e5dd500e790159398654039c00564e63d500a9801593d6768074400564719e0063000158b9676418bc40562e5d9901f680158fcff64071a00563fffda015000158a4678403c000562559da02400015871676c1e5a0055fdffd90795c0157f80b640d1a00560f3fd90150001585c676c01800055fc7fdd027000157caff6c01800055f13fda05e98015766676417a30055d99cdf0510001571567680dda0055b77fe203f78015659ff5c0fda405596839c04998015601676c0ffc0055705dd903fe40155c1837819c800555695dc1c0e0015399776470350054e660d914f5801540aff642f160055277fdb00810015391676c06000054de59e001f68015359ff7c05a60054d0d9dd00378015305ff6801260054c059da01b000152e6676406bd0054b99cdf08c1001525a5764230100549698de00858015251ff7005a600545999de03468015131ff7015000054377fd9053f40150de0b68090000542e7fda06f0001504aff641bbd005412c2d902700015092ff6c10620054025dde00168014fb7ff6816800053d77fda003a8014f5a576c01bc0053d4d9db00168014f51ff680a260053ca59d90288c014f29736404e60053cf99de04200014ee76768035a0053b67fe000f00014ecaff680b400053a77fda08898014e15676422230053855cda00a68014e0aff6c00c0005381ffdb02688014de177680384005374d9df07110014d62577c02160053567fdb02088014d3977680cde0053417fd90336c014d060b68024000533f3fdb08a00014c72ff70006600531c59dc01500014c5c676c0240005314d9de07968014bd9ff641e570052f682da05d00014b7cff64173d0052df42da05700014b25ff6804260052c559db06f00014aa667641bbd0052a99cd904800014acd676c04da0052a4bfde03900014a59ff80162600528059d805889014a01766015000052817fe002f100149d2576804380052705dda0637801495dff7407e600524f99d901f8c01493e73681a4000523559d9068f40148d573682cc400520895d90b304014822636c1f560051e93fd907d4c0147a50b6c04e60051e459d90138c014791737809000051db59dd00f0001475e676810800051c719d9041f401471c73680d1a0051b9ffd90345c0146e80b8810e60051a919d7043890146a4765c10800051a97fdf0450001465c6764113d0051971cdd0021001465a577c060000519095de028e0014619776801c800518495dd038580145d9ff640e1300517682e200f000145caff5003bc405172c39a006000145c4ff6809c00051677fda0349801456967640d2300515a5ce00030001456667740d1a00514c7fda0270001450aff6804e600513dd9db02a000144cd67740f0000512459d903bf40144917370060000511e59da01800014461676c01da0051167fdd073980143e667641ce30050f99cda0150001433cff6c04e60050ca59e0042000142e76764107d0050b9dcda012000142d5677412fc0050a25ddb0741001421567840cfc0050785dd7033e10141e1865c0cf600507863d7030000141e5676c060000507119db01f680141a4ff6c04e600506459da0240001416d677c02c400505895de003f001415e6768011a0050567fda03d9801411c677804bc0050425ddf046980140b9676c054000502919dd0466801405dff6c00ea00501695db08f58013fcaff6423d3004ff2c2e001998013fb167640663004fec5ce107698013f036780087c004fb85ddc00510013edc676810bc004fa65ddd03210013e676768035a004f967fdc05d00013dfcff700aaa004f7495dc148e0013c8977645235004f2260d913458013c9dff7019c8004f0895db07a58013ba7ff641e93004eea02dd01698013b91676405a3004ee45cdb01800013b79677c07da004ed67fde05088013b09776c00de004ec17fda00900013afcff680540004eb9ffda04698013aa167680300004ea559db03900013a5c67640e3d004e971cda00210013a5a576c0600004e9095da00558013a3cff800abc004e79d9dc04e00013969678010da004e497fda02e980138f76768191a004e24bfd90645c0138930b680666004e1e59db061680137ffff840666004df999db05b6801375dff6801bc004dd4d9db00168013751ff680222004dd25dda0ab7801369dff642adb004da782d907e780136caff680522004da25dda0072001368257681dd6004d82bfdd029880135e1776c0144004d7719db04b00013591676c125a004d51ffda03e88013509776800de004d417fdd00498013501676c1b00004d2559d906bf401349573641200004d2e59dc02268013472ff7805a6004d1719db0021001345a576c01bc004d14d9df05b680133f7ff6c0180004cfc7fe0018000133d9ff680a26004cec59da0136801339dff700900004cde7fda013980133666768101a004cc97fdf01b0001330aff6c01e6004cc0d9da003780132ddff840066004cb719da00f000132cd677409c0004ca999dd01368013292ff + +def tb_15 : Nat := + 0x743000005f82bfd90bff4017e0b0b641266005fa059df00300017e07ff800ae6005f7719d902b8c017ddc736c0240005f74d9da07110017d6257641c41005f5898dc00858017d59ff680822005f4e5ddc03000017d0977701200005f2e59d9047f4017cb97368119a005f1cbfdb00198017c71677807da005f147fd901f5c017c520b640780005f14d9db06a98017be76768125a005ee77fd90495c017b9e0b780840005edf3fdc06798017b15676419e3005ec55cdb00a68017b0aff6c0b40005eb77fda01098017acd678816da005e92bfd905b59017a4b0e6c1e2a005e7495df0745801795dff641d13005e5782da00b1001793e676c005a005e4f3fdf063000178d9ff740126005e3559da00a680178caff682a2a005e0895da05df00177c467680abc005de65dd902ae401779983700204005de459da0240001776d676c03c0005dd799db00468017759ff680f66005dc719db01c680176ffff840600005db9ffdb046980176a1676411a3005da85cdb0376801765dff680066005d9719da0021001765a57740600005d9095da03000017612576c0e16005d767fdc015000175c4ff64053d005d7142db0270001759dff6c0840005d5f3fdb01398017569677c0ea6005d3dd9d903a8c0174f773681440005d2999d9050f40174a6736c0b40005d1e59da064680173fcff641917005cff42d9061680173ffff8805a6005cf999e102d000173b967681980005cd4d9dd00168017351ff740540005ccf3fdd0139801732967681080005cb9d9dc00d680172d9ff6c1422005ca25dd90507c017289836c0204005ca059dd033f00171e177680144005c7719da018000171c4676c04e6005c6459da02f1001716257640bc1005c5898da003f001715e6768011a005c567fde05a000170ffff64167d005c4002da046980170b967740540005c2919db0466801705dff780066005c1719dc0021001705a57680756005c0f3fe007200016fcaff680180005bf13fdd01398016fb1676c0d1a005bdf3fda00300016f79ff781926005bc559db01200016f036768087c005bb85ddd00378016eddff740066005bb719de07500016e6767641d3d005b99dce000d68016e59ff7403c0005b92bfdb04998016e016768011a005b7f3fdb02aa8016dd257784d16005b277fd91344c016c9e0b680522005b225dde06720016c22577c05d6005b02bfdb06300016ba7ff742880005ac17fd90a1f4016b060b6427a2005ac25dd904e00016b59ff640ba6005ade59d901698016b9167880240005abf3fd7008f1016afd0e5c01e6005abf99d700600016affff6c0b9a005a9cbfd902e5c016a730b6805a6005a9719dc00900016a5367780444005a9095e2028e0016a1977640a34405a86619e00720016a12576c16bc005a6dd9d905ae40169b7737c1380005a5a59dc00300016966676c0ba6005a3dd9da05df00168997788019e005a24bfd1006690168930e440198005a24c5d10051001689467680c66005a1859d90318c01686173681ec00059f999d907af40167e6736824c00059d4d9d9092f40167537370005a0059d47fdd0139801673e676404e30059cf9cda057000166e7676c035a0059b67fda00f000166caff6c01c80059a095dd0775801660aff700a620059785ddb005100165dc678010bc0059665dd7042e1016599866c020400596459db04968016547ff700fa20059425ddb00c780164fcff64031b00593f42d900810016501677c10e600592e59e202400016495675808fc4059255d9a02268016472ff78062a00591695db006f0016453677016da0058fdffd905b5c0163f80b7c01800058fc7fdb040980163b1676410230058ec5cd9018000163d9ff7c0d1a0058df3fd90345c01637d0b7000c00058de7fde05400016325ff6414fd0058c982de01098016315676804800058c0d9d9011f4016303736c087c0058b85ddd014100162cd676405010058b35cde027000162a6676c04da0058a4bfdb02b980162676780035a0058967fda05898016201676416230058805ce00a36801615dff6428d700585782db010e0016149776802c400584f99da0016801613cff8018c00058367fdb004980160d5676c029a005832bfda041880160897770385e0057e9ffd90e16c015fa80b880ba60057de59d902e89015f79766405a60057e459dd00c00015f6d676c03c00057d799df00468015f59ff6c05a60057d0d9da02700015f1c676806c00057c059da00168015effff8016e60057a919d905b8c015ea4736803c00057a559dd03768015e5dff6800ea00579695de00858015e51ff7415ea00577e95db02058015dd9ff6801800057713fe100d98015db76774065a0057677fdc0c000015cddff642ffd00573782da01098015ccd677004da00572e7fda01398015ca6676c054000572459de01800015c79676807da0057167fde05088015c097764141f00570260da04500015bb7ff64113d0056ee02dd07b00015b3cff641ebd0056cf42e205598015ae7676415624056b9dda106510015a82576419410056a098d901200015ad5676c003c0056a059da07968015a07ff7409a20056785dde005100159dc67 + +def tb_16 : Nat := + 0x8401da0069167fd40075901a45a0e7017400068ff3fdb0169801a3e6677c251a0068d47fdf0289801a32967680a230068ca5cdb0321001a2e7677404800068b559db04bf001a289776c2b4400687719da0ad0401a1dc73681d0400688559e101f6801a1a4ff7c04e600686459de0240001a16d676c02c400685895db0085801a159ff800f6600684719e1012f001a109776c194400682919dd0466801a05dff70084000680f3fda020f401a03d0b6800ea00681695dc07800019fc4ff641dfd0067f142d907200019fcaff7838e20067b85dda0e37c019ee1836830660067c0d9da0af98019f15676812c00067de7fda04800019f7cff6c01440067b719dd042f0019e99776c0c84006799d9dc09888019dc17768261f00677060da087a8019dd2577848de0067277fe001488019c89776c19c800670895dc01758019c0aff7418c00066e9ffdb09e88019b097768279f0066c260da04e00019b59ff680ba60066de59da01698019b91676c00de0066c17fe101e00019ae7ff68077d0066ba02da00900019afcff8811a60066a859d704689019aa1765c116a0066a895db018a8019a5a5768062700669698db01d58019a3cff68075300668f42da01800019a42576002160066947fe002aa8019a12576c0abc006679d9de030000199b7676c245a0066497fda0915c0199260b68138000665a59db02e980198f7677c177c0066265ddd061680197ffff6c296a0065d695da0a59c01975a636828800065d77fd9048000197b7ff6c02220065d25ddd07e780196caff681f9b0065b2c2db02d0001969dff6c05220065a25ddb00720019682576c28380065785dda0a0d40195e183681dd6006582bfdd05010019591677c125a006551ffdc03e88019509778000de0065417fdb004980195016774011a00653f3fdd043980194b9676c090000652559de042000194536768107d006514dcda03b1001945a577c11a60064ec59da0468c0193b1736807800064f67fda010980193e7676c04da0064e77fdb02400019379ff6c213c0064b85dda084e40192e1836818c00064c0d9da05b6801930aff6814400064c559dd005100192dc6780125a0064a4bfda0495c0192930b6c0ae6006499d9dc01bf001913e676806f900644f9cdd0016801913cff6c1c80006432bfda071f40190cb0b6819e600643559db04188019089776c385e0063e9ffda0e16c018fa80b6831440063f119d707e7801900aff7003a20063e65dda00e7c018f9983740b040063db59de05100018f1c6768143d0063c71cda02a00018f43676c1e000063a919da077f4018ea47368071a0063bfffda01b00018f016780128400639695da04a04018e5a636803c00063a559db040e0018e197768103500638660da00858018e51ff78188400636dd9da06204018db77368139e006372bfdf05100018d666768143d0063599cdb05b68018d0aff780f6600633359da03d8c018ccd73680b400063377fdb01368018cb9ff740b9a006312bfda02e5c018c4b0b6807da0063167fde04188018c097778025e0062ffffdf02e68018bb7ff7019260062d4d9e006c00018ae767681afd0062b9dcda039f0018b1977680a800062ca59da01668018b3cff6805400062cf99e10df68018a07ff6837d6406282039a0df50018a081768378000628259da0dc68018a0aff6819800062a059da06510018a825768177c0062a25dda01200018ad567780d26006274d9db00f000189c4677407da0062693fdd00b8801899977740ec400625799db01668018947ff7403a200624e5de1012f001890977881d0400622559da074010188957668194400622919da009780188ffff84090000621c59db0210001883cff7011400061fdffdb006000187f1ff7c09c00061f2bfdc0ed000186ddff8811220061a65dd70447901869986780fde0061967fdc098880185c17768261f00617060da05d000185fcff68168000617fffda05898018601677c39de0061367fda0e76c0184da0b6819c800615695d60651001855c676c60000060d67fda17ff401835a0b6833c0006102bfda0c49801841567682dea00610895da03c0001849dff7005a60060d0d9dc039f0018309777000de0060c17fdf009000182fcff68023d0060bf42dd06798018295676819e30060a55cda016980182e66780089a00609cbfdb018a801825a576c01bc006094d9db00168018251ff84054000608f3fd7014f101823d0e6c1566006079d9d90558c0181e7736408e20060865ddb03468018131ff8003000060497fdb0ac9801807967682b2300601e5cda09300018092ff6823a6006025d9da08c88018099776820a6006028d9da081000180a4ff681fe600602999da06c000180b9ff681a4000602f3fda058980180cd676812000060377fd7044880180e1777c1bfc0060025dda06fe10180098668174000600719da02e6801804aff5c0b4000601319d702400018055676c025e005fffffdd04800017fb7ff6411fd005fee02dc05a00017f5dff6c00ea005fd695db006f0017f53676c005a005fd47fde00888017f49776802c4005fcf99da01500017f29677413da005fb67fda00f00017ecaff + +def tb_17 : Nat := + 0x6c19c800730895db0175801cc0aff741c620072e65dda0717c01cb99836c02040072e459db0180001cb79677007da0072d67fdc0720001cae7ff681c7d0072ba02dc0469801caa1676c0b9a00729cbfda02e5c01ca730b8405a600729719d60168901ca5c76700240007294d9dc0166801ca3cff68059700728f42dc07e0001c96967681f7d00725a5cdf0180001c861676c185a0071ffffdd0016801c751ff7402220071d25ddb00b1001c73e676c15c00071b9d9dc0496801c69dff6812570071a782da01c6801c6caff7812000071665dda047f401c599836c21fc0071425dda087e401c509837800de0071417fdc0049801c501676c011a00713f3fdd08a0001c472ff7020400070fc7fda080f401c3f20b681ec00070fdffda0210001c451ff6807e6007114d9da018a801c45a576c02a60070f9d9de0379801c36667680de30070d99cda0240001c379ff6c16da0070c2bfda05b5c01c30b0b6814400070c559db0079801c3036778087c0070b85ddd0037801c2ddff7c1da6007099d9da0768c01c26773680de60070a999d90109801c2cd6770297c0070705dda0a5e401c1c18368071a007092bfdb0672001c15a576819c500705698e2010e001c149775404344070526195010c801c1498f6c1bde0070367fda06f6c01c0da0b68031e00704f3fdb0508801c0897764141f00702260d900f0001c0caff743144006ff119dc01f6801bfa4ff6807d7006fe942e002b9801bf7967600ae2406fde5d9c01f6801bf59ff6807d7006fd682da01b0001bf5e676c05a6006fd0d9dc0420001bf016768107d006fc05cde0016801beffff6c0666006fb999db0420001bea4676c2a84006f7e95da0aa0401bdfa6368149a006f947fda04a1001be5a5768119a006f977fde0355801bdc4ff680d53006f7142df0ac6801bd0aff642b17006f42c2e20649801bca667681922406f299d9a0630001bca7ff681440006f2e7fda03d9801bccd677c0540006f2459dd0180001bc7967880b9a006f12bfd902e5901bc4b0e781062006f025ddf0097801bbffff6c1200006eedffda047f401bbb80b6811a6006eee59da0199801bbe667741980006ed47fdb0388801bb1977640e1f006ec660dc00d6801bad9ff740126006eb559db0531001ba8257701e5a006e81ffdb0268801b9e177781d04006e5b59da0740401b96d73681200006e665dda03c7801b9a4ff680744006e7119da00e1001b9d3678003c0006e5799db024f001b93977680939006e4e60e10300001b90977680bfc406e42619c0097801b8ffff7811a6006e2e59db0150001b8a4677804da006e177fdc0019801b85c677007da006e0f3fdb0270001b7caff741380006ddf3fda04df401b77d0b7805a6006dd999de0510001b715676c1efc006da65ddb0981001b60167880f00006d277fd603bf101b49e0e7824c0006d02bfe10718801b399775c1c5e406ce661a00561001b34367681581006cd0dcda03f7801b359ff680804006cde59db03d6801b305ff680f57006cc182db0049801b3016770011a006cbf3fdc08a0001b272ff64227d006c9cc2dc0360001b23cff680d7d006c8f42da0210001b251ff6807e6006c94d9db0559801b1e767681563006c79dcdb0c16801b125ff683057006c4982da0b56801b131ff682040006c5999db06c0001b0b9ff641afd006c2e82de0208801b0997758081e406c2661960150001b0a4ff70019e006c24bfdc0480001b04aff6c3c2a006bd695da0f09c01af5a63683b40006bd77fda0930001afb7ff682466006bee59e0006f001af536770005a006bd47fdc0139801af3e676804e3006bcf9cdb0150001af29676c1080006bb9d9dd0496801ae9dff6c2226006b8559da0888c01ae1573680726006ba059db0420001add36768107d006b74dcda00d6801ae07ff6c1c44006b5895db0508801ad097768141f006b4260da0208801ad39776c00de006b417fdb0090001acfcff7022e6006b1c59db01e0001ac53676c005a006b147fdd0b40001ab9dff682cfd006ae782da0780001abd9ff8406c0006ac2bfda01af101ab0b0e741926006aa999da0648c01aaa673680f66006ab359e204c6801aa59ff681316406a96839a0450001aa6167680fc0006a99d9de087a801a9d2576c0438006a705ddb00b1001a93e6778005a006a4f3fde0720001a8caff681c7d006a32c2da0679801a8d5676c2a2a006a0895dc05df001a7c4676c0cc00069e459da032f401a79173680abc0069e65dda01f6801a7a4ff6c09000069db59db00f0001a75e6770011a0069d67fdd05a0001a6ffff6c06000069b9ffdb08a0001a65dff68227d00699782da0469801a6a1676810e60069a919db01ba801a642576806e700699098dd028e001a619778401c800698495dc0955801a57cff68255300695f42da0745801a59dff6816bc00696dd9da04d5801a5c4ff6811d6006972bfda0385801a5d9ff7004e600695a59dc0376801a531ff8409c0006942bfd6026f101a50b0e58072600694559dc0139801a4f76788144000692999da050f101a4a6766813da006929ffda03d6801a4b9ff680a8000693359dc0450001a46167 + +def tb_18 : Nat := + 0x6c0522007da25ddb0072001f68257781dd6007d82bfdb04b0001f591676c125a007d51ffdc03e8801f509777400de007d417fe00049801f5016770239a007d1cbfda08e5c01f4730b681b00007d2559e10169801f45c675c05a2407d171d9e0021001f45a576c01bc007d14d9dc05b6801f3f7ff700180007cfc7fe00409801f3b167681023007cec5ce00136801f39dff6c0de6007cd999da0378c01f3667374101a007cc97fdf0229801f303676808a3007cc0dcdc021f001f2e1778400de007cb77fcf0036901f2de0e740426007cb359da0108c01f2cd73781980007c99d9da065f401f26773680e9a007ca4bfe10660001f2016768197c407c805d9a0616801f205ff68071a007c92bfdc0a36801f15dff6828d7007c5782db003a801f15a576c213c007c3559de04bf001f089776812f9007c2260dd0e17801efa7ff68385b007bea02db0169801ef91676805a3007be45cdb04e0001ef436768137d007bd0dcda0330001ef5e676c1080007bc059e10016801eeffff300056407bc0039d0a20001ee5dff6c0300007b947fda00bf401ee520b6c0e22007b865ddb01f2001edfa576c0816007b767fdb00f0001edcaff740180007b713fdb00d9801edb76788065a007b677fdb0379801ed66676c16da007b42bfdb02d0001ecddff880de6007b2999da0378901eca676680d80007b29ffda0240001ecb9ff6c0b40007b1e59da02cf401ec79737007da007b167fde00f0001ec4aff6c1062007b025ddd0097801ebffff7c00c0007aff3fe20169801ebe667700b40007aee59db0016801ebb7ff6c1926007ad4d9de0166801eb3cff680597007acf42db0238801eb1977800fde007ab67fd903f6901eada0e6c15ea007aa095da0579c01ea8263840d26007a74d9dd0750001e95e67681d3d007a579cda0660001e96d67680e7c007a665dda02e6801e9a4ff88059a007a51ffdc00e8801e93977702544007a2919da0950401e8a473680e5e007a3fffdb0466801e85dff681197007a1782da0330001e87167780840007a0f3fda020f401e83d0b8011400079fdffdc0330001e7c4ff680cbd0079f142da02d0001e7caff7412000079df3fde0169801e766676c830400795695da20c0401e55a63685a5a00797f3fda11b6801e64aff7420160079367fdb0180001e37967740d800078d0d9da035f401e343737810800078c059db0046801e2fcff6c228000789cbfdb018a801e25a5778075600788f3fda01d4c01e23d0b6802160078947fdf0238801e21977700c84007879d9de0b56801e131ff682d5700784c82e000c0001e125ff6c12000078377fe00240001e0b9ff84102600781e59da0408901e079766809c0007824bfde06ff001e00977681bf900780260e20517801dfb7ff68145a4077ee039a0516001dfb8176814040077ee59d90231001dfe6677419800077d47fdb0088801df49776c08040077ca59da0200401df29736c179a0077b2bfdc02d0001de9dff6c2580007781ffda095f401de080b8409a20077785ddf0480001dd99776811fd00776660da00e1001ddd367700dc800775895dc028e001dd3977680a3500774e60de0337801dd05ff70012600774059dc0046801dcfcff6c228000771cbfdb0019801dc71676c0780007714d9da01df401dc537370005a0077147fdb06a9801dbe76774035a0076f67fdc0b40001db25ff682cfd0076c982da05d0001db7cff6c06c00076c2bfe002d0001daddff5c0b3c4076b7839702ce801dade178812c00076a4bfda04af101da930e680de60076a999db0480001da4aff6011fd007692c2db078a801d9d2576c031e00764f3fde11aa801d822576846a700760898da0720001d8caff6819e600763559db07d5801d7a4ff681f530075e942dc0139801d79167781d400075c719db01c6801d6ffff6c17a60075a859da05e8c01d6a1736816e60075a919db0436801d65dff6810d700759782e20019801d65c676c008400759695db0180001d64257700c0000758495de0475801d5caff6811d3007572c2da0385801d5d9ff6c138000755f3fdc0169801d566676805a30075599cdc0346801d531ff8009c0007542bfdb0a99801d46167682a630075185cda0649801d4a667680f6600753359dc0076801d459ff7016800074ffffdb0ac9801d35367682b230074d4dcda0469801d3b9676806660074f999db02a0001d329677013da0074b67fd904f5c01d2da0b8412fc0074a25ddb0741001d21567681d010074855cdd0390001d1dc67741bc000745b59da06ef401d16d736812c000746459dc00b1001d162576c00fc00745799e00046801d159ff880f6600744719d703d8901d11c766c300000741719da0bff401d05c7368071a00743fffdf0ab0001cfb167682abd0073ec5cda0976801cfc4ff68245a0073f2bfda01f6801d03cff700d1a0073df3fdc0030001cf79ff6c26220073b85dda0987c01cee183681da60073c0d9dd0480001ce99776811fd0073a660da0051001cedc676c0c84007399d9db00d6801ce59ff8403c0007392bfde0499801ce01676c011a00737f3fdb02aa801cdd2576c48de0073277fdb0148801cc8977 + +def tb_19 : Nat := + 0x6c16da0088fdffe1006000223f1ff7010260088ec59db0346802237cff6c00c00088de7fdb05400022325ff7808a60088c0d9da0228c022303736c087c0088b85ddc014100222cd67700e9a0088a4bfda03a5c0222930b6c0ae6008899d9dd066000222016768197d0088805cde0c30002213e676830bd00884f9cda0b7f0022149776829c400885695da0a36802215dff6c005a00884f3fdf067980220d5676819e30088355cdc00a680220caff8810620088225dd604179022089866c385e0087e9ffde02e98021f7967640ba30087de5cdb00c00021f6d676c04da0087d67fda0135c021f5a0b6c05a60087d0d9db02700021f1c677c06c00087c059db00168021effff841aa60087a559da06a89021e95766817a60087a859da05b98021ea467700ec400879695da03b04021e5a636c02160087947fdf057a8021dfa577c0bd6008772bfda02f4c021dcb0b6c01800087713fdf00d98021db76778065a0087677fdf0c000021cddff6c042600873359db01368021cb9ff7404e600872999df01500021c916770060000871e59e201f68021c59ff5c07d6408716839f05088021c0977841ec00086cf3fd907af1021b3d0e6c2ee60086a059da0bb8c021a8173682eaa0086a095da06798021ad5676815660086b9d9de07968021a07ff6c09a20086785ddc00e100219d367680381008674dce100f000219c4675003bc4086711da101f680219a4ff6c0de600865b59da0378c02196d736c095a008651ffdd02b9802191c67680ae30086471cdf078000218a467681dfd0086291cda063000218b967700cc000861c59da032f4021871737c1e5a0085fdffdb006000217f1ff6c22e60085d999da08b8c02176673680b400085f13fdc088680216ddff6822170085b782dc05898021601676816230085805cdb0672002155a576c70380084e65ddd01f68021359ff6c14220084c25dda0507c021309838402040084c059da00804021301736c06c00084b999db09468021251ff68251700849482da08c1002125a576c480000844c7fda11ff40211320b683ae600845999da0d50002117cff641aa6008479d9d903888021219776c15000084377fdc024000210b9ff6c1bc0008412bfdf04188021009777408c40083f999db02e68020fb7ff680b970083ee02db05a00020f5dff6c00ea0083d695db00858020f51ff6802130083d482dc02898020f29677c10800083b9d9e000d68020ed9ff8003c00083b2bfd600ef1020ecb0e780b400083a77fdb08898020e15676c029a008382bfdc00300020e07ff7009a20083785ddf00e10020dd36778267c00834e5dda099e4020d3983681e5a0083567fdf03378020d05ff78024000833f3fdc08a00020c72ff8007e6008314d9da01f8c020c53736805a600831719df0d668020b7cff6835970082df42da07968020bd9ff6c15c00082c97fdb01098020b1567742eda0082967fda0bb5c020a5a0b68209a0082a4bfda06f00020aa66774162600828059de03ff00209c177680ff900827060dd0637802095dff6c222600823559da0888c0208d5736807e600824f99df0b3100208225780243c0081e459da090e402079173681f560081e93fdd0750002071c67681d3d0081c71cda0330002075e67800d1a0081b9ffdb046980206a1676811a30081a85cdc0471002065a576811c100819698da0450002065c6770060000819095db028e0020619776c01c800818495de038580205d9ff8805400081713fda014f10205c50e6804e600817199db0270002059dff700d2600815a59db05e6802050aff681797008142c2da03768020531ff7804e600813dd9df066000204916768197d0081245cde01800020461676c01da0081167fdb11d0002033cff68473d0080cf42da10800020351ff681ce60080f999db01398020329677c15000080b559da053f40202d5736810800080b9d9db14400020191676850fd0080645cda130680201a4ff68444000807119da0f9000201dc67683cfc0080785dda0c0000202156774090000805b59dc00f0002015e676803bd0080579cde00468020159ff880f6600804719dd012f00201097770025e00803fffdc0a5a802005a5768296700801698da0a20002005dff6816e600802919de08f5801ffcaff6c0666007fec59db0376801ff79ff6c1da6007fc0d9de021f001fee1777c0144007fb719db03f7801fe59ff680fdb007f9682de05d0001fdfcff6c0aaa007f7495df148e001fc89777c19c8007f0895db07a5801fba7ff6c0ba6007ede59da02e8c01fb79736805a6007ee459db06ff001fb0977681bf9007ec260dd00c7801fafcff68031b007ebf42dc0150001fae7ff7011a6007ea859dc00c0001fa95677c0ec4007e9695da03b0401fa5a63680e40007e9719dc0180001fa4257780156007e8f3fde0559801f9e767681563007e79dcdb07e0001f96967681f7d007e5a5cdb0720001f8f767681c7d007e3ddcdb0646801f892ff880666007e1e59dc0796801f7ffff681e57007e0002de0199801f7e667740b40007dee59db05f1001f75a576817c1007dd698df0016801f751ff6c0222007dd25de00ab7801f69dff + +def tb_20 : Nat := + 0x681dfc409452619c0016802513cff6c19e600943559db04bf0025089776812f900942260e20c510024fc4675c31404093f11d970b610024fd3676c071a0093e9ffdd00300024fa4ff7802e20093e65ddc02700024f1c677806c00093c059dd05d00024ea46764173d0093a91cdd00f00024e95678010da0093947fda0435c024e520b7c0e220093865de104e78024dcaff64139a409372c39d02d00024d9dff680b3d00936782e208868024cddff682216409337839b01098024ccd677004da00932e7fe104098024c79678007da0093167fdc10698024b53676841a30092d4dcda0a200024bb7ff681ce60092f999da05a00024bffff6814220093025dde00168024b51ff6c05400092cf3fdd02388024b19777c0c840092b9d9db01200024ad56764047d0092b55cdb05310024a825770003c0092a059de0ae000249d367682b7d009274dcdb08b68024947ff6822d700925202da0750002495e67680e7c0092665dda02e680249a4ff6c0ae600924719da02b8c02491c736c071a00923fffda01c5c0249000b6c23a600921c59da08e8c02487173701e5a0091fdffda0795c0247f80b680d1a00920f3fe1006000247f1ff7409c00091f2bfde1318802469977684c5f0091a660db03f78024659ff8403c0009192bfde04e000245fcff7828aa00915695da0a29c02455a636c2f160091277fda0bc4c02449e0b6c24c0009102bfdf0c798024343676831e30090d0dcdb039f0024309776c00de0090c17fe200498024301678006c00090b999da01af40242e6737014400090a559dc03b1002425a57680ec100909698db006f00242536770005a0090947fdb06a980241e767681aa3009079dcde06a6802417cff6c12c000904c7fda04af40241320b6c15000090377fda053f40240de0b80090000902e7fdb00678024092ff781200009012bfda047f402404b0b843b40008fd77fda0ecf1023f5e0e683a62008fd85dda0d998023f71676824c0008fedffda09198023fb9676812c0008fffffe2006f0023f53674401b8408fd4dd9b00168023f51ff7c0540008fca59db05e68023ecaff681797008fb2c2df0c000023e0aff700ba6008f7719da02e8c023ddc73700240008f74d9e007110023d62576c0216008f567fdb02088023d39777c0c00008f425ddc00810023d0167640201008f405cdf04800023cb96780119a008f1cbfdb00198023c7167702280008ef9d9da089f4023be7736807da008f147fdb04968023b9dff742226008ec559da0888c023b1573740dda008eb77fda0375c023ade0b6c0426008eb359e002700023aa6676c16da008e92bfd905b5c023a4b0b6c1e2a008e7495dd0745802395dff7407e6008e4f99da01f8c02393e736c1cda008e32bfda0735c0238cb0b681a40008e3559da064680238d9ff6c2a2a008e0895db0081002379167880900008ddb59d7023f102376d767c011a008dd67fde03d9802371c676c0d1a008db9ffda0345c0236e80b6c11a6008da859dd00c0002369567880e40008d9719da038f102365c766c0084008d9695db04d580235c4ff681353008d7142de0270002359dff840d26008d5a59da0348c02356973780dda008d4c7fd90375c0235320b6c0ea6008d3dd9db051000234a6676c0b40008d1e59de07c680233fcff681f17008cff42e1043980233b9676810e2408cee5d9f066000233536778005a008cd47fdf0150002333cff84035a008cb67fdb0fd980231dc67683f63008c771cda0f8880231e177683126008c8559da0589802328167681422008ca25dde018000231c4677c07da008c693fdc01398023191678000fc008c5799de00468023159ff7c2826008c2e59da0a08c0230b973681680008c3fffdc05b6802305dff6816d7008c1782df0019802305c676c0084008c1695db01d5802303cff7c1200008bdf3fda047f4022f7d0b701da6008bc0d9da0768c022f037378087c008bb85ddb00378022eddff700066008bb719db08268022e59ff682097008b9682da07500022e67677403c0008b92bfdc04998022e016778011a008b7f3fdb17388022c8977685cdf008b2260da15f00022c9dff680ee2008b705ddf0e178022ba7ff68385b008aea02da07e78022c0aff882880008ac17fd90a1f1022b060e6c2826008a9719da0a08c022a5c73682280008a9cbfda06798022a95676816e6008aa859dc00900022a53676c0444008a9095db028e0022a1977640a35008a8660db00720022a12578416bc008a6dd9e2051000229666768143c408a599d9f04068022925ff780ba6008a3dd9db05df00228997778019e008a24bfdc0319802286167881ec00089f999d907af10227e6767824c00089d4d9db00168022751ff781aa60089b9d9da06a8c0226e7736804e60089cf99df00d680226d9ff6c03c00089b2bfdb041880226897764105f0089a260dc0072002268257801dd6008982bfdf029880225e17778265e008951ffda0996c0225480b68140400896459da04800022599776c0fa20089425dde09678022472ff68259b00891cc2da074100224956768140400892e59da00c780224fcff6c062a00891695db006f002245367 + +def tb_21 : Nat := + 0x780f66009fc719da03d8c027f1c737006c0009fc059de01b00027ee6676806bd009fb99ce008868027e5dff682217009f9782e100c00027e51ff6402fd009f9482db07800027dd9ff681dfd009f7682dc0cf00027d0aff6833bd009f42c2da02298027db767800f66009f3359e001368027cb9ff700a26009f2459da0288c027c917374245a009effffda0915c027c000b6821fc009f025dda04668027c4aff8000c0009eff3fdf04398027bb9676c005a009eedffdc06600027b51ff6c0e22009ec65de109720027a82576825c5009ea098da04410027ad567680fde009eb67fdf000f0027a8167701e5a009e81ffdc026880279e177740384009e74d9e0039f002799977640e79009e6660d902e680279a4ff7c145e009e51ffda0516c0279480b680ec4009e5799dc00e88027939776c0744009e4719e001c680278ffff680716409e40039c046980278b967740900009e2559da023f402789573700900009e1c59e00136802785dff4c04d6409e17839b0210002783cff68083d009e0f42e0045000277f7ff7470e6009d8059da1c38c02760173684ae2009da65dda0af98027715676817a6009dd999dd004680275fcff7c28aa009d5695db080580274d9ff700f00009d277fe007188027399776c0204009ce459db04e000273436764137d009cd0dcd903768027359ff880e7c009cc25ddb0081002730167680201009cc05cdf004680272fcff6c2280009c9cbfdd018a802725a57740216009c947fdc0238802721977700c84009c79d9dd04b00027131ff800300009c497fdb06c000270b9ff7409c0009c24bfda026f40270930b802262009c025dda0897c027009837c145e009bedffdb05a00026f5dff6c00ea009bd695db00858026f51ff680213009bd482dc00888026f49778802c4009bcf99d400b01026f3e766c0540009bca59dc04200026ee7677c1980009ba059da065f4026e81736c1d9a009b82bfda0765c026e0b0b8000c0009b81ffdb03498026dd367701c44009b5895db00858026d59ff780822009b4e5ddd03000026d09776c2604009b1c59da09804026c717368031e009b3f3fdc01e00026c53677c005a009b147fdd07800026bd9ff840f00009ae77fd703bf1026b9e0e5c0e22009ae85ddb08898026b1567682223009ac55ce000a68026b0aff740f66009ab359db03a68026a92ff680e97009aa4c2e103900026a59ff5c0e3c409a96839703198026a61676c21ea009a7495db0745802695dff681d13009a5782de014880269497788031e009a4f3fda00c6902693d0e6c2a2a009a0895e205df00267c4675817784099f11d9604ef00267d3676c07da0099e93fdf00b88026799777002040099e459db03768026759ff680dd70099d682da0330002675e678016800099bfffdb018000266e7ff6c10e60099a919de003000266a1678010da0099977fdc0019802665c6770128400998495da04a04026612636810bc0099865ddb018000265fa576c0bd6009972bfde006000265c4ff7c09c00099677fdc0210002657cff8404e600995a59db03768026531ff700ea600993dd9da03a8c0264f773740a8000993359dc027000264a66770114000991859db00768026459ff6c17400098ff3fdb0c00002633cff682ffd0098cf42da0ab00026351ff6c08e20098c65dda0237c026319837024000098a25dda08ff4026289836811040098b559db0741002621567702cc400985895da0b30402616263682a0000985b59da0840002619167681c1a0098693fda051000261c4676c02160098567fe1050880261097768141e40984261a10af2002605a57682bc500981698da0ab7802605dff70075600980f3fe207800025fc4ff641dfc4097f1439907698025fc6676c04e60097ec59dc03768025f79ff7009c00097b719da026f4025edc73801d40009799d9da074f4025e67736c04380097705ddd12378025c9dff7c24c0009702bfda092f4025c0b0b681eea00970895df07188025b9977681c5f0096e660db00810025b91676c0dda0096d67fd90375c025b5a0b6c14220096c25de200c78025afcff68031a4096bf43a101500025ae7ff7011a60096a859dd02e68025a72ff640b9700969cc2db01698025a5c676c0c0000968495da02ff4025a1263700abc009679d9db030000259b7677c138000965a59db072000258f767681c7d00963ddce105df0025899775c1778409626619d00678025892ff6c0c6600961859db1036802575dff6840d70095d782de003a802575a577406fc0095cf99da01be402573e736804380095d25ddd073680256caff6c10620095a25dda0417c025689836c01c80095a095db0775802560aff840a620095785ddc0e010025501676838010095405cda0db78025505ff6836000095425dda09978025547ff70011a00953f3fdb0a2a802545a576828a700951698da06798025495676c01bc009514d9de061680253f1ff6818570094fc82db018000253d9ff7406c00094c2bfe000798025303677009c00094b719da026f40252dc736c03c00094b359db10bf00251c1776842f900947060da0cc0002520167681980009499d9e10780002514977 + +def tb_22 : Nat := + 0x6807d700abe942de0139802af91676c090000abdb59dd00f0002af5e676c06c000abd0d9db0420002af016774005a00abbfffdc0a20002ae5dff6c021600ab947fde0388802ae19776c07c800ab7e95de0205802add9ff74054000ab713fda014f402adc50b78036600ab6dd9dd0fd6802acb9ff683f5700ab2e82da0d96802acddff682b1a00ab42bfda0510002ad6667740a2600ab2459da0288c02ac917374060000ab1e59db01f6802ac59ff7c142200ab025dda0507c02ac098380031e00aaff3fda00c6c02abfd0b700b9a00aaedffda02e5c02abb80b6c192600aad4d9db0016802ab51ff801f2600aab559da07c8c02aad573681e0000aab67fda0388802ab19776c14c400aaa095db07a5802aa07ff7810e600aa7119da0438c02a9c4736c07da00aa693fdd00b8802a99977840b0400aa5b59d702c0102a96d766c0cfc00aa4e5dda033e402a9398368095a00aa51ffdb0397802a8ffff640e5b00aa4002de05b9802a8a4676c03c000aa2559db0240002a871677c054000aa1719da014f402a85c73701a9a00a9fc7fda06a5c02a7f20b68191a00a9fdffdb02d0002a7c4ff640b3d00a9f142dd05e9802a766676817a300a9d99cdb0a2a802a55a576c2f1600a9277fda0bc4c02a49e0b6c24c000a902bfdc0919802a3796768246300a8de5cdb01f6802a359ff78162600a8c059da0588c02a301736c29c400a89695da0a70402a25a6368239a00a89cbfdd0085802a251ff781aa600a879d9da06a8c02a1e773680e2200a8865ddb06a6802a17cff7830c000a82e7fda0c2f402a0ba0b6827c000a8377fda0570002a125ff6c082200a8265ddb0067802a092ff88066600a81e59db02e6802a04aff6c106200a8025ddc05010029fb9676c005a00a7edffde07998029f3e67681e6300a7cf9cda06e88029f49776c054000a7ca59dc08b68029e9dff6822d700a7a782dc01c98029e8167701e5a00a781ffdb02688029de1777c038400a774d9dc07110029d6257681c4100a75898de00858029d59ff7c0cde00a7417fdb00498029d016780011a00a73f3fdd0a098029c5c6768282300a7171cda08b98029c71676c005a00a7147fdb06a98029be76770035a00a6f67fdb03c00029b9dff7c1e0000a6c97fd9077f4029b260b88120000a6b77fda047f1029ade0e6c042600a6b359de03a68029a92ff70120000a692bfdc089880299c17768225f00a67060de0e7780298d9ff6839db00a63682da0847802993cff7c03c000a632bfdc0a8a80298225780177c00a5f119dc01f680297a4ff6c04e600a5e459e2043980296a4677403c000a5a559da00ef402969573700c0000a58495e0038580295d9ff6c03c000a572bfdf061980295696768186300a55a5cdb05e6802950aff68179700a542c2da03768029531ff7c04e600a53dd9e002a000294cd678009c000a52999dc04500029461676c01da00a5167fdb05a000293ffff7805a600a4f999db02d000293b9676c198000a4d4d9e202a0002932967640a7c40a4ca5d990291002932a576c13da00a4b67fdb004980292d5676c12fc00a4a25ddd00810029281676c090000a45b59dc00b100291625784021600a4567fda0084c02915a0b80296a00a41695da0a59c02905a636c075600a40f3fdb07200028fcaff6c018000a3f13fdb01398028fb1677000c000a3de7fdb06498028f156778048000a3c0d9db021f0028ee1777000de00a3b77fde00198028edc67841d4000a399d9da074f4028e677370035a00a3967fdb05898028e016768162300a3805cdb148e0028c897768523500a32260da13458028c9dff7019c800a30895dd03768028b59ff680dd700a2d682de05088028b09775c141e40a2c2619b02178028ae7ff6c11a600a2a859e200c00028a956770108000a294d9da041f4028a5373680e4000a29719df00558028a3cff7c0aaa00a28495dc02af00289e7676c0c0000a26dd9db04e00028969676c177c00a2265ddc0381002886167680e0100a2185cdb061680287ffff6c066600a1f999dc0886802875dff7c052200a1d25dda0147c0287498368030000a1d47fdb062100286e76768188100a1b9dcde00d680286d9ff7403c000a1b2bfdd02d0002869dff78283800a1785ddb005100285dc677010bc00a1665ddb008100285916774125a00a151ffdb03e88028509777800de00a1417fe00aba802845a57682ae700a11698da09300028472ff68024000a13f3fdf00858028451ff7c168000a0fdffe1010980283e76768042300a0f9dcdd00d680283d9ff800a2600a0ec59db0136802839dff80084000a0df3fd4020f102837d0e5007e600a0df99df00300028379ff7c04e600a0d999db051000283156770029a00a0c2bfdb00798028303676c174000a0a999da05cf40282a673680d8000a0b359da025680282ddff7c16da00a092bfda05b5c02824b0b70226200a0705ddb0637802815dff7000ea00a05695e001bf002813e676806f900a04f9cde0016802813cff6c2ce200a0225dda0b37c0280898374385e009fe9ffda0e16c027fa80b7000c0009fe93fdd02b98027f79678006c0009fd799db00468027f59ff + +def tb_23 : Nat := + 0x6c011a00b7d67fdc0169802df43676c27c000b7a919da09ef402dea4736810da00b7bfffda0420002df01676c119a00b7977fda0465c02de5e0b6c030000b7947fda00bf402de520b7c15ea00b77e95e00205802ddd9ff7c03c000b772bfdb0139802ddb7676804e300b76ddcde0196802dd9dff70300000b7377fdb0240002dcb9ff6808fd00b72e82e10289802dc9167680a2300b7245cdb0180002dc79676c1bfc00b7025dda06fe402dc09836c031e00b6ff3fd900c6c02dbfd0b6c300000b6cf3fda0bff402db3d0b6c156600b6b9d9d90558c02dae77378194400b6a095e009ff002d9e1776827f840b678619a09fd802d9e18f68270000b67959e20051002d9dc6750014040b6771d9f0090002d9d3677403c000b67119df01f6802d9a4ff8402e200b6665ddb0517802d947ff68145b00b65202db00e8802d939776c200400b62e59da0800402d8b973680e5e00b63fffe10240002d895676808fc40b6255d9c09d6802d7f7ff68275700b5fe02dc0060002d7f1ff6c09c000b5f2bfe00060002d7c4ff6c2be600b5c559da0af8c02d715736c1efc00b5a65dda07be402d699836c0fde00b5967fde00f0002d64aff6c126600b58059dc03ff002d5c1776c19c800b55695e11c0e002d3997764703440b4e6619e0081002d3916770060000b4de59dc01f6802d359ff6c05a600b4d0d9db039f002d309776c00de00b4c17fdb0aba802d25a57682ae700b49698da01f9802d2e6676c021600b4947fdd0d50002d17cff64353d00b45f42dd0169802d166676c0d1a00b44c7fde0540002d0ddff70352200b4025dda0d47c02d009836824c000b412bfdb0231002cfe667700b4000b3ee59db0016802cfb7ff74192600b3d4d9da0648c02cf537368176a00b3d695df0016802cf51ff6c1aa600b3b9d9da06a8c02cee77378071a00b3b2bfda01c5c02cecb0b8830c000b381ffda0c2f102ce080e68306600b38259da0c00002ce0aff682d6600b38559dc0268802cde177881fc800b35895da07f1102cd6266681fc200b3589bda0741002cd6d6768140400b36459da0480002cd997784021600b3567fd60084902cd5a0e78082200b34e5ddd0c67802cc72ff68319b00b31cc2da03c7802ccfcff78006600b31c59dd0150002cc5c6778024000b314d9db0796802cbd9ff804ce600b2a999da1338c02caa67368312600b2c559da0b40002cb25ff7404da00b2a4bfde0390002ca59ff74162600b28059df02f1002c9d2576c24fc00b24f99da093e402c93e73681d1600b2577fde1996802c7a4ff68665700b1e942da11c1002c822577004e600b1e459db0240002c76d676c03c000b1d799db0ba0002c6a467682e7d00b1a91cda0766802c6e7ff6c00c000b1a859dc0450002c65c6784008400b19695db0180002c642576c0a3800b1865ddb00f0002c5caff74192600b15999da0648c02c5667368186600b15a59da02d0002c59dff780d1a00b14c7fe103c0002c49167640efc40b1245d9903b1002c49257640e9a00b124bfdb0180002c479677007da00b1167fda01f5c02c45a0b6c1ce600b0f999db0946802c351ff6c108000b0b9d9dd05df002c2897768177900b0a260dd0741002c215677c0cfc00b0785ddb0051002c1dc6778060000b07119e001f6802c1a4ff7c04e600b06459de02f1002c16257680bc100b05898dd003f002c15e6778153c00b0425dda054e402c1098368108000b04719de0097802c0ffff7c11a600b02e59df0150002c0a4676c119a00b0177fdc003a802c05a578423d600aff2bfd908f4902bfcb0e64201600aff67fd90685802bff1ff6c066600afec59db0376802bf79ff6c1da600afc0d9db021f002bee17780014400afb719d80050102bedc767c1d4000af99d9da074f402be6773741a9a00af7f3fda06a5c02bdfd0b6c0aaa00af7495db148e002bc89776c19c800af0895e107a5802bba7ff6c05a600aee459dc0180002bb79676c07da00aed67fdb0508802bb09778800de00aec17fdc01a1002ba425768068100ae9098e20300002ba1257680bfc40ae84999a028e002ba19776c0abc00ae79d9dc0300002b9b7676c138000ae5a59db0436802b925ff6c312600ae1859da0c48c02b86173682b2600ae1e59da0930002b892ff78185a00adffffdd0199802b7e6677c0b4000adee59e005b6802b75dff6c00ea00add695dd0051002b5dc676c11a600ad4059da0468c02b5017368108000ad417fde06c0002b4956784089a00ad1cbfd30225902b4730e4c089400ad1cc5d30210002b474677405a600ad1719dc0021002b45a577001bc00ad14d9db05b6802b3f7ff84018000acfc7fdb0180002b3d9ff74180000acde7fda05ff402b37a0b680f0000ace77fdb06f0002b30aff681bbd00acc2c2da0540002b325ff7c01e600acc0d9db021f002b2e1777c0d8000aca999da035f402b2a6736c04da00aca4bfdb02b9802b2676784035a00ac967fd500d5902b25a0e8403c000ac92bfdb0898802b1c17768225f00ac7060db0637802b15dff7000ea00ac5695e008f5802b0caff6823d300ac32c2db1069802afc4676841a300abf11ce001f6802afa4ff + +def tb_24 : Nat := + 0x7416da00c342bfe003d98030ccd677004da00c32e7fe010200030bb7ff6c407d00c2ee02db0d398030be6676c2f4000c2ff3fdb0ba00030bffff6c2c2200c3025ddb06f00030c4aff6c180000c3167fdb04098030c796778342600c2b9d9db0d08c030ae7736c192600c2d4d9df0df68030a07ff6837d700c28202dd043980309c4676c10e300c2711cdb034980309d367781f1a00c251ffdb07c5c0309480b6c198000c25799db06210030962576c15c000c25b59db02af0030999776c07da00c2693fdd00e880309397778074400c24719e1012f00309097778331e00c20f3fdb0cc6c03083d0b6c2ade00c2177fdb09810030871676c259e00c21cbfdb0741003089567681a0400c22859e104b000307f1ff6c12bd00c1fc82db045000307f7ff7409c000c1f2bfdf0ed000306ddff74112200c1a65ddf03f78030659ff7c262200c1705de226778030359ff6c99da40c0d6839b2631003035e676c920400c0de59db1b67803040aff6c39de00c1367fda0da100304e767701c2600c0a559db0708c030295736c024000c0bf3fda006000302ffff7801bc00c094d9df00168030251ff801aa600c079d9db06a8c0301e7736c054000c08f3fd70139803023e6770204000c05999da080f403016673681a9a00c05f3fd70690003017e67700d1a00c04c7fdd0b898030079676c2e2300c01e5cdb00c00030125ff701e5a00bfffffdb0795c0300000b6c1bfc00c0025dda06f0003000a6788120000bfedffd9047f102ffb80e70168000bfd77fdc003a802ff5a577001bc00bfd4d9dc0016802ff51ff6c022200bfd25de006f7802fed9ff681bda40bfb6839a0621002fee76768080400bfca59df0cf0002fe0aff6833bd00bf82c2de0030002fe07ff6c0ae600bf7719dc0090002fdd3676c1e5a00bf567fda0795c02fd5a0b6c142200bf425dda0507c02fd09836c020400bf4059dd0480002fcb96770120000bf1c59da047f402fc71738407da00bf147fdc06a9802fbe7677c1a9a00bedf3fda06a5c02fb7d0b74029a00bec2bfe002d0002faddff6c0de600bea999da0378c02faa6737416da00be92bfdc078a802f9d257701d1600be577fdb0148802f949776c18c000be367fdd0049802f8d5676c510000bde459da143f402f79173684efc00bde65dda1110002f7c467682cc400be0895e20330002f75e67680cbc40bdd79d9a02f1002f7625774011a00bdd67fe005a0002f6ffff68167d00bdc002db0180002f6e7ff7011a600bda859dc00c0002f69567740dda00bd977fdf01ba802f642576806e700bd9098da003a802f65a57741a1600bd767fda0684c02f5da0b78054000bd713fdf0270002f59dff7c04e600bd5a59db0376802f531ff6c0ea600bd3dd9dc07e0002f47967681f7d00bd1e5ce00180002f46167701ec000bcf999da07af402f3e673880b4000bcee59db0676802f351ff6819d700bcd482df0150002f33cff7c04e600bcca59db04f6802f2d9ff6813d700bcb682dd0508802f2897788020400bca059d70080102f281766c1b0000bc8559dc033f002f1e177840f1e00bc693fda03c6902f1a50e68074400bc7119dc0139802f191676c245a00bc3fffda0915c02f1000b680dda00bc567fda0330002f15e677816e600bc2919da05b8c02f0a4737c119a00bc177fdf0019802f05c676c008400bc1695db08f5802efcaff6823d300bbf2c2de0199802efb16768066300bbec5cdc0346802ef7cff6c19e600bbc559da0678c02ef157370048000bbc0d9db0256802eeddff68095700bbb782db0019802eedc676c1d4000bb99d9db00d6802ee59ff6c03c000bb92bfdc0499802ee01677c0bc400bb7495da02f0402edd2636c4d1600bb277fdd07ba802ec2257681ee700bb0898db0175802ec0aff7018c000bae9ffe10a20002eb05ff80024000babf3fe20150002eae7ff4c053c40baba039b0469802eaa167780b9a00ba9cbfdb01f9802ea53676807e300ba94dcdb0111002ea42577c0a3800ba865ddb0072002ea12577016bc00ba6dd9db04e0002e969677c00c000ba5999e20406802e925ff5c101640ba49839c02e9802e8f76770191a00ba24bfda0645c02e8930b6c504000b9d47fda140f402e7520b684fe600b9d4d9da0ac9802e7e6676c04e600b9cf99df0646802e6d9ff68191700b9b682db0508802e6897768141f00b9a260e10072002e682576c1dd600b982bfdb0298802e5e17780014400b97719dd042f002e5997770125a00b951ffdb03e8802e5097780031e00b93f3fdf0439802e4b96788090000b92559db03b1002e45a57680ec100b91698dc006f002e453676c16da00b8fdffdb0060002e3f1ff78102600b8ec59db0346802e37cff6c00c000b8de7fdc0540002e325ff6c042600b8c559dc033f002e2e177680cf900b8b860de0141002e2cd676c09c000b8a999dd0136802e292ff70035a00b8967fdb0fc0002e15dff683efd00b85782db003a802e15a576c1bde00b8367fda06f6c02e0da0b68031e00b84f3fdc0049802e0d56774029a00b832bfdb1230002dfa7ff6848bd00b7ea02db02e9802df796784030000b7db59de00f0002df5e67 + +def tb_25 : Nat := + 0x7416da00d0c2bfdc00798034303678000de00d0b77fdf076980342676774297c00d0705de1080580340d9ff6c201240d036839b072f00340e7676c075600d04f3fdc050880340897780314400cff119e001f68033fa4ff6807d640cfe9439c02b98033f7967780d8000cfd0d9db035f4033f43736c07da00cfd67fdc05d00033ee6676c173d00cfb99cdb04368033effff6c108000cfc059dd04200033ea467802a8400cf7e95dc042f0033db7676c10b900cf6ddcdb03558033dc4ff680bd600cf72bfdc0ac68033d0aff84246600cf1e59db09189033c79766c1e6600cf2459db06498033ca66778106200cf025de100978033bffff54025a40cf0003a104800033bb7ff78198000ced47fdd03f78033ad9ff6c0fdb00ceb682dd00498033ad5677014c400cea095dd000f0033a81677827fc00ce785ddb09fe40339e1837820c400ce5799db0830403395e736c1d0400ce5b59e2024f00339397768093840ce4e619c009780338ffff7c11a600ce2e59dd015000338a46770119a00ce177fdb0465c03385e0b6c0cc000ce1c59e10019803385c678807da00ce0f3fd701f5903383d0e5c068400ce1095dd027000337caff70138000cddf3fde0e388033699776c38df00cda660db06798033715677c260400cd8059e2004680335fcff54011640cd7f4395003000335fe677048c000cd367fda122f40334da0b6828aa00cd5695dc03c0003349dff7424c000cd02bfdd10500033305ff6c413d00ccc182db0c798033343676c2c4000ccd67fe1004680332fcff58011640ccbf4396003000332fe6780228000cc9cbfdf0360003323cff70156600cc79d9df06c000330b9ff70082200cc265ddc00678033092ff7c120000cc12bfe10f0a8032f5a57700c3c00cbca59db030e4032f29736c06fc00cbcf99db010e0032f49776c021600cbd47fdc04200032ee76780348000cb8559db0d1f4032e15736c125a00cba77fdf04200032dd3677c1c4400cb5895de058e0032d09776c163500cb4260de00378032d05ff74024000cb3f3fdf0a998032c53676c2a6300cb14dcdb08b98032c716770005a00cb147fe00b400032b9dff7424c000cac2bfdb092f4032b0b0b6c222600cac559db07800032b25ff640de600cad999dd098880329c1776c261f00ca7060db087a80329d2578802c400ca4f99df0016803293cff741c8000ca32bfe1090f0032791676c243900c9e45cde0240003276d677403c000c9d799dd00468032759ff701c8000c9b9ffdb071f40326e80b6c168000c9bfffd9058980327016784228000c9977fda089f103265e0e6814a600c9a559df01ba803264257780a3800c9865ddc09c7803257cff6c271b00c95f42de0d6980324a6676c35a300c9299cdb0af980324cd676c216600c93dd9db0720003250aff6c12c000c94c7fdb0169803256667782a5a00c8ff3fdb0a95c0323fd0b6c131a00c9167fdb0450003246167803fc000c8b9d9db0fef40322e7736c333c00c8c65ddb0bd00032329676c2a5a00c8cf3fdb09468032351ff70177c00c8a25ddb05de4032289836c048000c8b559de0ad100321dc677012c000c86459db04af4032191736c0dda00c8693fdb018000321c467780bc400c85895db02f040321626370021600c8567fde0b5980320a4676c2d6300c8291cdb05088032109776c0f6600c84719df0676803203cff6c19d700c80f42db0466803205dff801e0000c7f13fe20e898031edc676c3a2240c7b71d9b0e388031ee1777c1d4000c799d9db074f4031e67737c035a00c7967fe11bc00031c9dff6c6efc40c727839b18000031cd9ff6c262200c7705dde01488031c89777419c800c70895dc01758031c0aff7018c000c6e9ffe009e88031b09777c00de00c6c17fdf09300031a72ff6c24bd00c69cc2db06498031aa1676c07e600c6b999db01e00031ae7ff70062a00c69695df01d58031a3cff78305a00c6497fdb0c15c0319260b780ba600c63dd9de05df00318997780265e00c5ffffdb0996c0318000b6c0e0400c61859da020100318796770296a00c5d695e100888031749774c021e40c5d26193008700317498f701f9e00c5b2bfdd02d0003169dff70052200c5a25de1007200316825770283800c5785de2050100315916764140040c5645d9904f200315925764139e00c564bfd9048000315997770125a00c551ffde04698031501676c11a300c5405cdb04200031505ff6c0fa200c5425de0048000314b9676c11fc40c52e5d9b004680314fcff74090000c52559e009d680313f7ff6c275700c4fe02db042000314536774168000c4e77fdb059f403139e0b6c11a600c4ec59da033000313c4ff70090000c4de7fde098880312e1776c261f00c4b860e007a10031267676c1e8100c499dcdb04e78031292ff6c120000c4a65ddb03b100312a6676c050400c4b359db005100312dc678423d600c432bfdb08f490310cb0e6c213c00c43559db01d5803113cff6c06fc00c44f99dc04188031089777c385e00c3e9ffe000e88030f997768039e40c3e6619d07d10030f1c676c1f4100c3c71cdb02c10030f6d6764080400c3de59dc07800030ea467 + +def tb_26 : Nat := + 0x6c4afd00de5a5cdb0ae000379e7676c20c400de8495db05868037a3cff6c14c400de9095db03b10037a5a5778191a00de24bfdd01998037879677024c000ddf999db092f40377e6736c1e5a00ddffffde02d000377b9677c17c400ddd695e0006f0037753677c027c00ddd25ddb009e4037749837c300000dda25ddb0bff1037689866c2ade00dda77fe1007200376825778297c00dd7719db0a5e40375dc736c283800dd785dde04968037547ff74259e00dd1cbfdb0966c0374730b6c020400dd4059de0169803745c6770024000dd14d9db008f403745373883b4000dcd999db0ecf1037366766c365a00dcde7fdb0b56803739dff6c288000dcec59db079680373d9ff6c185a00dcfc7fdc088680372ddff6c221700dcb782db084f00372e1776c18c000dcc0d9db05b6803730aff74372600dc8059db0dc8c037201736c24c000dc92bfdb07698037267676c12c000dca4bfdb010980372cd678028da00dc577fdc003a803715a577005a600dbe459df04e00036f43677c108000dbc059dd00168036effff84288000db977fd90a1f1036e5e0e780e2200db865ddc01f20036dfa577c081600db767fde00f00036dcaff7c018000db713fdc00d98036db76780144000db5999db050f1036d66766c138000db5a59e205b68036d0aff5c16d640db42c39d02d00036cddff800b4000db1e59dc06ff0036c09776c1bf900db0260db02e68036c4aff84031e00daff3fdb00c69036bfd0e6c02c400daff99dc00168036bb7ff74192600dad4d9df03f78036ad9ff7015ea00daa095dd13a58036947ff6c4e9300da5202db123f003695e676c453c00da5b59db0aef00369d3676c1e9600da81ffde0ea0003685dff6c3a7d00da1782db0a3980368a4676c120000da3fffdf066000367f7ff6c197d00d9fe02db0210003683cff84120000d9df3fd7047f103677d0e8805a600d9d999df20c1003655a577c723c00d8e459db1c8e4036391736c53d600d902bfdb0bc5803649dff70060000d8de59de036000363436778119a00d8bf3fdb0465c0362fd0b6c108000d8c059e108a00036272ff64227c40d89cc39c018a803625a5770103800d8865ddb040d4036219836c075600d88f3fdd054000360ddff6c14fd00d83782dc12768035f51ff6c49d700d7d482db0c168035fb7ff6c300000d7ee59db06ff0036009777c022200d7d25ddc02010035f296774179a00d7b2bfdd02d00035e9dff70258000d781ffde10200035d05ff6c407d00d74182db0ce88035d39776c2b8000d7567fdb0a5a8035d62576c1ba200d7665ddb03498035dd3677c024000d73f3fdb008f4035cfd0b74228000d71cbfdf00198035c716784078000d714d9dc06c00035be7676c1afd00d6f9dcdd01b00035b0aff7c0b4000d6b77fdc04b00035a92ff6812bd00d6a4c2e204800035a4aff7c1e2a00d67495dd0955803593cff6c255300d64f42db088e003594977681d1600d6577fdd198000357a4ff6c65fd00d5e942db11aa80358225778294000d5bfffdb0a4f40357000b6c222600d5c719db04b00035759ff6c04e600d5e459df05e980356a1678010da00d5977fde003a803565a576c00e700d59698df0180003564257701dd600d572bfdb0774c0355cb0b6c0c0000d58495dd04e0003557cff7c05a600d55999dd03468035531ff7009c000d542bfdf0a9980354616778185a00d4ffffdb0615c0354000b702b2600d4d4d9df02a00035329677813da00d4b67fde004980352d56788300000d48559db0bff1035215766c150000d4a059e1039000351dc67640e3c40d4771da206f0003516d67681bbc40d45b5da20420003511c676c107c40d4471da10c00003505c67682ffc40d4171d9a0be6803505dff7037da00d3df3fdb0df5c034f7d0b6c2ac000d3ec59dc09b88034ee1776c26df00d3b860e204800034e99776811fc40d3a6619c03210034e676770035a00d3967fde00f00034e4aff78138000d37f3fdb04df4034dfd0b7c0aaa00d37495dd13458034c9dff6c4d1300d32782dc01488034c89777019c800d30895de01758034c0aff701c6200d2e65ddc00810034b91677c060000d2de59dc01f68034b59ff7439c000d29cbfdb0e6f4034a730b6c2e2600d2a859db07200034ae7ff68174000d2bf3fdc01698034a5c677007da00d28f3fdb01f5c034a3d0b6c024000d294d9dc1c398034879676c70e300d21e5cdb1a388034899776c516600d23dd9db11700034925ff6c35a600d25999db0d398034969676c216600d26dd9db055980349e767680aaa00d28495e1079680347ffff6c1e5700d20002e00a20003475dff68287c40d1d7839a08e980347716768120000d1edffda046980347b9677c030000d1d47fdb00bf40347520b6c02a600d1d4d9de00b1003473e6770125a00d1a77fde10488034599776c411f00d16660db0bc880345e1776824c000d182bfda01ba80346825770240000d1425ddb08ff4034509837c00de00d1417fdd004980345016778011a00d13f3fdd10b000343f1ff6c42bd00d0fc82db08a00034472ff7002a600d0f9d9dc03c0003439dff680efd00d0e782dc0379803436667 + +def tb_27 : Nat := + 0x681cd640ee32c3a10a8a803b8225774223800ede65ddb088d403b7998384020400ede459df0240003b76d678003c000edd799e20046803b759ff701c8000edb9ffdb071f403b6e80b7011a600eda859e100c0003b69567740ec400ed9695db03b0403b65a636c0e4000ed9719dd0480003b612576811fd00ed8498dd04d5803b5c4ff7809c000ed677fe00510003b4a6677c300000ecee59db0bff403b3b9736c24c000ecf999db07c6803b3fcff681e5a00ecffffde0660003b3536770005a00ecd47fdc0150003b33cff74156600ecb9d9da0558c03b2e7737c035a00ecb67fde0fd9803b1dc6788060000ec7119d7017f103b1c4767c1a9a00ec567fdb06a5c03b15a0b6c198000ec5799db0621003b162576c15c000ec5b59db0330003b191677c282600ec2e59dc05b6803b05dff80006600ec1719dc0021003b05a5778075600ec0f3fe00c00003af7cff6c2ffc40ebdf439b08b9803afb1676c1e0000ebf13fe10030003af79ff78262200ebb85ddb0987c03aee1836c1da600ebc0d9df0037803aeddff78006600ebb719dc0826803ae59ff74742200eb225ddb1d07c03ac89836c174000eb7f3fdb0589803ae01677860de00eac17fdb1836c03ab060b6c385e00eae9ffdc0a99803aa5c676c2a6300ea971cdc028e003aa1977702afc00ea5999db0abe403a966736c2a3c00ea5a59db05af003a9b7677c101a00ea497fe008c8803a899776c231f00ea2660dd0067803a892ff780c6600ea1859dc10f6803a751ff6c43d700e9d482db10e0003a753676c40da00e9d77fdb07b0003a7e667741aa600e9b9d9de01c6803a6caff6c071700e9b2c2e10418803a68977701f9e00e982bfdb07e6c03a60b0b84406200e9425ddb1017c03a509836c30c000e951ffdb0799803a59167702bc800e91695db0af1403a45a636c259e00e91cbfdf05b6803a3f7ff741ec000e8df3fdb07af403a37d0b6c11a600e8ec59db01e0003a3d9ff8400c000e8de7fdd0540003a325ff70112200e8b85ddb0447c03a2e1836c08a600e8c0d9da01b0003a30aff70139e00e8a4bfdb04e6c03a2930b6c050400e8b359df02b9803a2676780198000e88059da065f103a2017668185a00e8817fda01c6803a24aff8019e600e83559dc00a6803a0caff700ba600e7de59dc00c00039f6d678804da00e7d67fda01359039f5a0e7005a600e7d0d9dd02700039f1c677006c000e7c059de00168039effff881aa600e7a559de03b10039e5a5770021600e7947fdd02f58039dcaff78018000e7713fdf02700039d9dff6c09bd00e76782e00d098039ccd676c342300e7335cdb0c000039cddff7004da00e72e7fdc06000039c59ff6c17fd00e71682db04098039c79676c0a2600e72459dc07b00039b3cff742ee600e6a059e107968039a07ff7c09a200e6785ddc03c780399a4ff6c0f1b00e66942db01d100399c4676c038400e674d9de0379803996d6780095a00e651ffde0d698039871676c35a300e61c5cdb0a3980398a4676c23a600e62e59db02b9803991c677c1fda00e5fc7fdb07f5c0397f20b6c1e5a00e5fdffde08b980397666774221a00e5b77fe11c0e00393997770080400e4de59da02004039379737807da00e4d67fdc05088039309777c08c400e4b999db023040392e6736c020400e4c059dc09468039251ff70480000e44c7fe2054000390ddff6414fc40e4378399050880390e17784090000e42e7fe006f0003904aff80192600e3f999db0648c038fe673700b9a00e3edffde05a00038f5dff8400ea00e3d695dd00858038f51ff7813da00e3b67fdb04f5c038eda0b74312600e38559db0c48c038e15736c0f0000e3a77fdd00a68038e0aff700de600e374d9db0378c038dd3736c0a6200e3785ddc16068038c72ff6c581700e31cc2db0d668038cfcff6c335a00e3417fdb0c9f0038d09776c267c00e34e5ddd0f600038b7cff6c3d7d00e2df42db01f98038c53677415c000e2c97fdf01098038b156784450000e28059db113f1038a01766c2eda00e2967fe012c000388d5676c4afd00e2355cdb0a36803895dff6c0ffc00e2705ddf0b3100388225784417c00e1c719db105e103871c766c37bc00e1d0d9db0c858038759ff6c30fc00e1d799db090f00387916768223800e1e65de1034680386e7ff84103800e1865ddb040d4038619837401c800e18495e2038580385d9ff640e1240e176839902af00385e767780f0000e1677fdb03bf403859e0b6c054000e1713fe1034980385696778179a00e142bfe20b100038459ff6c2c3c40e116839b0a998038461676c246600e11e59db07998038491676c192600e12999db03d980384cd6774474000e0cf3fdc013980383296770660000e06459db197f4038191736c150000e0b559dd05a000380ffff6c167d00e04002db050880381097770066600dfec59de03768037f79ff7c1da600dfc0d9dc02700037edc676c09bd00dfb71ce008268037e59ff6c209700df9682dc05d00037dfcff700aaa00df7495e102e98037b7967701bfc00dec25de102178037ae7ff6c085b00deba02db00c78037afcff84030000dea559dc12c0003796967 + +def tb_28 : Nat := + 0x6c27f900fe7860dd039f003f9997770145e00fe51ffde02b9803f91c676c0ae300fe471cdd0630003f8b9676c18bd00fe2e5cdb01c6803f8ffff8416da00fe177fdb05b5903f85e0e6c120000fe1c59db0240003f8956774084000fe0f3fe10450003f7f7ff74c78000fd367fdb31df403f4da0b6ca76a00fd5695db1fb0003f5fcff6c7da600fd8059db15e8803f699776c0cc000fdf13fda02d0003f7caff7c0f0000fd277fdd0930003f40aff701c6200fce65ddd0081003f3916770138000fcd0d9dd039f003f3097770020400fcc059dd0046803f2fcff84228000fc9cbfd9089f103f2730e6419e600fca559de018a803f25a5774021600fc947fdd0150003f23cff7408e200fc865de109c7803f17cff6c271a40fc5f439b07b7803f19dff8012c000fc4c7fde00c0003f125ff701b0000fc2e7fe005a0003ef5dff7000ea00fbd695de0085803ef51ff78022200fbd25ddd00b1003ef3e6770054000fbca59df0030003ee07ff700d2600fb74d9e10796803ed59ff6c1e5700fb5682e00208803ed397770260400fb1c59dd0d36803eb9dff6c34d700fae782db0976803ebd9ff6c07da00fb147fde0889803eb156770029a00fac2bfde03a6803ea92ff7c302a00fa7495db0c09c03e9d263781d1600fa577fdf0148803e949777c031e00fa4f3fda00c6c03e93d0b801c8000fa32bfdb071f403e8cb0b80177c00f9f119dd01f6803e7a4ff7802e200f9e65ddd03f7803e759ff6c0fdb00f9d682dc05a0003e6ffff7410e600f9a919dc0030003e6a16770006600f99719dd0621003e5fa576c188100f97e98db04a1003e61257780bd600f972bfdc0990003e531ff6c263d00f94c82db0619803e569676c138000f95f3fdb02d0003e59dff74360000f9167fdb0d7f403e45a0b6c342600f91859db08b9803e4a6676c192600f93359db03a9803e4f76774174000f8ff3fdc0238803e3197774410400f88559db1040403e215736c240000f8a25de00508803e10977742bc800f81695df01d5803e03cff801e0000f7f13fe10139803dfb167740dda00f7de7fdc09d9803dedc676c276300f7b71cde10a1003ddd2576c428100f77498db0826803de59ff6c1d4000f799d9e1010e003ddc177708a0000f6e65ddb227f403db99836c6d9e00f702bfdb19f2003dc225774020400f6e459dc0508803db097780259e00f69cbfdb0966c03da730b6c1a0400f6a859db0217803dae7ff6c031e00f6bf3fde0169803da5c6774068400f69095db01a0403da4263700c0000f68495dc05af003d9b7676c16b900f66ddcdc04e0003d969677c1c8000f63dd9e105df003d89977700e0400f61859db0380403d861737c40da00f5d77fdd01f9803d73e676c07e300f5cf9ce00736803d6caff70106200f5a25de10072003d68257781dd600f582bfdf0a2a803d45a5774185a00f4fc7fdc0d69803d303676c35a300f4c0dcdb0cf0003d30aff6c2d0000f4c97fdb0739803d366676c180000f4de7fdb03c0003d39dff7809c000f4b719e100f0003d2cd675003bc40f4b35d9e10bf003d1c1777402c400f44f99de0016803d13cff8019e600f43559de04bf003d0897770385e00f3e9ffdb0e16c03cfa80b70192600f3d0d9db0648c03cf43736c126600f3d799db03a9803cf6d676c03a200f3e65dde09f0003cea4676c27bd00f3a91cdb0420003cf0167743ae600f35999db0eb8c03cd66736c2d0000f3677fdb09a9803cdb7676c21c000f372bfde0990003cccd676c263d00f3335cdb0886803ccddff78641a00f2cf3fdb1905c03cb3d0b6c5eda00f2d47fdb17a0003cb53676c455a00f2edffdb0736803cc59ff6c150000f31e59e00679803cad5676c19e300f2b55cdb0559803cae7677414c400f2a095dc000f003ca8167704e5a00f251ffdb1395c03c9480b6c2b8000f274d9de02b9803c91c6774071a00f23fffdc08e9803c8716770299a00f1f2bfdb0a65c03c7cb0b6c1fda00f1fc7fdb0796803c7f7ff804c6200f1a65ddd03f7803c659ff7403c000f192bfdd0f0a803c55a576c3c2700f15698dd0930003c40aff70406200f0c25ddb1017c03c309836c31e600f0d0d9dd0037803c305ff70012600f0c059df0510003c2956770108000f094d9db041f403c253736c0ec400f09695e10b56803c131ff6c2d5700f04c82dd0540003c0ddff88090000f02e7fd6023f103c0ba0e5808a600f02ed9d60210003c0bcff8009c000f024bfdb026f403c0930b884fe600efd4d9db13f8903bf53766c4e2a00efd695db1350003bf5dff6c36c000efedffdb0480003c04aff7421c000efb2bfdb086f403becb0b6c0a2600efca59db0139803bf3e6770300000ef82bfde02e9803bddc677c082200ef4e5dd70207903bd398670200400ef2e59db0800403bcb9736c0e0400ef4059db0337803bd05ff70120000ef1c59db047f403bc71737434da00eee77fdb0d35c03bb9e0b6c228000eef9d9e10889803bb156768222240eec55d9a0780003bb25ff780dda00eeb77fdd0109803bacd677809c000eea999dc05b6803ba4aff701e2a00ee7495de0745803b95dff7407e600ee4f99e10736803b8caff + +def tb_29 : Nat := + 0x7c0780010cf67fdb01df40433da0b841bc0010cc2bfda06ef104330b0e681926010cc559dc029880432e1776c0a5f010cb860e0005100432dc67680141010cb71ce101368043292ff800ae6010c99d9dd00d68043259ff7803c0010c92bfdd089880431c1777418de010c577fe219998042fc4676c6662410bf11d9b13ba8043022576c3522010c225ddb093000430caff6c2226010c3559dd05700042f6d676c15bd010bdb5cdb03300042f91676c07da010be93fdc01b00042f4367701080010bc059dc00168042effff882880010b977fdc00c00042e51ff6c02fd010b9482df057a8042dfa576c15e7010b7e98de02058042dd9ff7442c0010b2e7fdb10af4042cba0b881740010aff3fdb05cf1042bfd0e6c16e6010aff99db05a00042bffff6c1422010b025ddc01698042be6677c005a010ad47fdc0cfa8042a82576c33e7010aa098db07c98042ad567781e96010a81ffdd063000429a4ff6c18bd010a6942db043980429c4677c0de6010a5b59db0378c04296d73800e5e010a3fffe205b980428a4676016e2410a291d9805a000428a5ff7403c0010a2559e10150004285c6768053c410a171d9d06a680427f1ff7c0b400109f13fdc05e98042766677014400109c559df1bb1004255a576c6ec101095698de0bc5804249dff7c24c0010902bfdd0b100042359ff6c2c3d0108d682db0919804237967703fea01089695db0ff9c04225a636c16260108c059dc00858042251ff74354001085f3fdb0d4f404217d0b6c1aa6010879d9e10e388042099776c38de410826619b0c3000420b9ff78019e010824bfe002e6804204aff7010620108025ddf05010041fb9678423a60107ca59db08e8c041f29736c1e660107cf99e008b68041e9dff7007260107a059dc09ff0041de1776c27f901077860e208778041d59ff6c21da410756839b07f20041d62576c12000107665de205898041d01676c16224107405d9b05400041d05ff74011a01073f3fdc0a098041c5c6770029a0107147fdb00a5c041c520b701aa60106f9d9e200d68041bd9ff740f000106e77fdc07800041b25ff8816260106b359db05889041acd766c12660106b719db04800041addff740e9a0106a4bfdc04800041a4aff8422620106705dda089790419c18670871e0105e93fdb21c6c0417a50b6c7f440105f119db19f20041822576c3d9e010632bfdb0e7780418d9ff8004e60105e459e00a9680416e7ff682a570105ba02da091680416ffff7810e60105a919dd0d9680415caff6c3657010572c2db0ca680415d9ff6c248401058495db06210041642576c128401059695db0480004165c676c119a0105977fdb00f0004169567743000010542bfdb0bff404150b0b6c186601055a59dd013980414f767780a8001053359dc07368041459ff6c1cd701051682db06c00041461677416800104ffffe0019980413e6676c06630104f99ce002d000413b9677019800104d4d9dd079680412d9ff6c1e570104b682dc004980412d56770470401045b59db11c0404116d736c3e0401046459db0ad100411dc676c1d0401048559dd07200040fcaff7801800103f13fe201398040fb1675404e24103ec5d95012a8040fb2577c04800103c0d9de021f0040ee1777800de0103b77fde00198040edc67705dfc0103225ddb177e4040c89836c0bc401037495e00e178040ba7ff6c385b0102ea02db07e78040c0aff8005a60102e459da0168c040b91737021fc0102c25ddb087e4040b09836c0dda0102d67fdc02178040ae7ff8411a60102a859de0de000409b7676c377d01026ddcdb0ae000409e7676c20c401028495db05868040a3cff6c14c401029095db04200040a53677c138001025a59df072000408f767641c7d01023ddcd904368040925ff88177c0102265ddc099780407ffff6c265b01020002db03810040861677c221a0101d77fdf01488040749778418840101b9d9de00d680406d9ff7814220101a25ddb0507c040689836c0f000101a77fdf007200406825774297c01017719db0a5e40405dc7378125a010151ffdc03e88040509777000de0101417fdd0aba804045a577018960100fdffdb0624c0403f80b8407800100f67fdb01df10403da0e6c04260100f9d9e1028980403b1677404da0100e77fdc0210004037cff8800c00100de7fcf002f104037a0e7804e60100d999e0051000403156770029a0100c2bfe100798040303677417400100a999dc05b6804024aff8422620100705dd9089790401c1867818de0100577fdc0d488040089776c351f01002260db0210004013cff6c07e601004f99db014880401497770385e00ffe9ffdd0030003ffa4ff7812c000ffd67fdb04af403ff5a0b6c11a600ffd799e20739803fee6676c1ce240ffb99d9b05a0003feffff6c162600ffc059db03d9803ff1c6778251a00ff947fdb0945c03fe520b6c221a00ff977fde0780003fdd9ff7c33c000ff42bfdf0510003fcb9ff6c143d00ff2e82de0469803fbb9676c11a300feee5cdc0016803fbb7ff80198000fed47fdc0388803fb19777c260400fea059db0980403fa81736c25c800fea095dc09ff003f9e177 + +def tb_30 : Nat := + 0x700540011ccf3fdc01398047329678413da011cb67fda04f590472da0e743126011c8559db0c48c047215736c1626011ca059e1033f00471e177700f1e011c693fda03c6c0471a50b742940011c3fffdb0a4f40471000b7816e6011c2919dc0480004705c676c11fd011c171cdd08f58046fcaff700666011bec59df03768046eddff6c0dd7011bb782df07500046e676770035a011b967fdf00f00046e4aff746b40011b277fdb1acf4046c9e0b6c1e2a011b7495db04e00046dfcff8405d6011b02bfdd10500046b05ff6c413d011ac182dc00900046afcff840540011ab9ffe104e00046a53676c137d011a94dcdc01110046a4257700a38011a865ddc00720046a1257842a3c011a5a59db0a8e4046969737800c0011a5999dc04068046925ff7424c0011a24bfdb092f40468930b8450400119d47fe20139804673e676404e24119cf9d9c0b4f0046689776c2d390119a260db064680466d9ff741f9e011982bfdb07e6c04660b0b780a620119785ddc04800046599776c11fd01196660df09000046509776c23fd01194260db05178046547ff7c140401192e59db050040464b97388090001192559dc03b1004645a577c18960118fdffdb0624c0463f80b7001800118fc7fe10750004637cff6c1d3c4118df439b0540004639dff8400c00118de7fdc05400046325ff8004260118c559e2048000462cd676c11fc4118b35d9b039000462dc676c0dda0118b77fdb033f00462e1777409c00118a999dd04c68046259ff6c131701189682db03f0004626767843f000118577fda0fbf104615e0e683a2601185c59da098880461c1778000ea01185695dd080580460d9ff6c201301183682df02e98045f7967640ba24117de5da000c00045f6d677004da0117d67fdb0135c045f5a0b882d660117a919db0b589045ea4766c2d000117a97fdb07398045ee6676c16800117bfffde04668045e5dff7003000117947fdd057a8045dfa57700bd6011772bfdb02f4c045dcb0b7004e601176dd9dc01968045d9dff84090001172e7fdc04098045c79676c102301171e5cdb02898045c9167701bfc0117025ddd0c000045b3cff7415660116b9d9e106510045a82577028380116785ddb0a0d40459e1836c1e96011681ffdc005100459dc677007da0116693fdc00b880459997778145e011651ffdd080100458b96770090001162559da023f40458957380329a0115f2bfdb0ca5c0457cb0b6c28da0115fc7fdb09d680457f7ff802d660115c559db0b58c04571573781efc0115a65ddc03f78045659ff8003c0011592bfdc0a71004555a576c29c101155698e21c0e0045399777c0fde0114d67fdb03f6c04535a0b6c08040114de59dc039f0045309777800de0114c17fdd0aba804525a577002160114947fe10d50004517cff64353c41145f43990b40004519dff7c05a601145999dc03468045131ff7815000114377fdf0f798044fe6676c3de24113f99d9b0de00044fffff6c35220114025ddd02d00044fb96770005a0113edffdd0d098044ee7676c34230113b9dcdb06600044f51ff6c19260113d4d9dc01c68044ecaff745a2a01135895db1689c044d62636c3de6011374d9db0e988044de1776c30c0011381ffdf00858044d59ff743a2601131c59db0e88c044c71736c39c001131cbfdb05d00044cfcff88054001131719dd08268044bd9ff6c20970112f682dc18000044a59ff6c5ffd01129682db14700044a92ff6c4ce60112a999dc05898044a0167740bc401127495de093f004493e677474400111db59db1d0f404476d736c6b400111e459db199680447a4ff8003c00111d799de0ba000446a4677000c00111a859dd0450004465c6770060001119095dc028e004461977740fde0111767fda03f6c0445da0b70192601115999df03468044531ff74282601112459db0a08c044491736c192601113359da03a980444f76778060001111e59de093000443e6676c24bd0110f99cdb01f68044459ff88251a0110d47fd8094590443520e741aa60110b9d9db06a8c0442e7736c0a260110ca59dc0a8000441e1776c29fd01107860e107a10044162576c1e8101105898db04b00044191676c0dda0110693fe1003f004415e6770153c0110425ddc009780440ffff7011a601102e59e005b6804405dff6c16d701101782dc0ac98043fb1676c2b23010fec5cdb09300043fcaff700dda010fde7fdc07698043f036770087c010fb85ddf00510043edc67701d40010f99d9de06a68043dfcff8019c8010f0895e0090f0043b91676c2439010ee45cde03768043b59ff6c0dd7010ed682dc05088043b09777c3dc8010e8495db0f714043a12636c331e010e8f3fdb0c720043a42576c2bc8010e9695db0ad10043a5c676c1d04010ea559db06810043aa1676c085e010eb9ffdb00c78043afcff700abc010e79d9e1030000439b767781380010e5a59e204368043925ff6010d6410e49839c07b000437e6676c1ebd010df99cdc02d000437b9677017c4010dd695db05f0404375a6388239a010d1cbfdb08e590434730e7005a6010d1719dc064680433f7ff6c1917010cfe02db0090004345367 + +def tb_31 : Nat := + 0x6c4617012d7f42db1140004b601677048c0012d367fe003c0004b49dff7c24c0012d02bfe00718804b39977701584012cd0d9e00466804b2fcff6c1197012cbf42db0420004b30167840d80012c8f3fda035f104b23d0e7c68e2012c265ddb1a37c04b099836c60c0012c2e7fdb1170004b125ff78019e012c24bfde0480004b04aff84005a012bd47fde0139804af3e6778281a012ba77fdb0a05c04ae9e0b6c15c0012bb9d9dc1440004ad59ff6c50fd012b5682db13ba804ad62576c32a6012b74d9e10e89804ac71676c3a23012b1c5cdb05d0004acfcff6c1500012b417fdc0d36804ab9dff6c34d7012ae782db01f6804ac51ff801e00012ac97fdc01b0004ab0aff6806bd012ac2c2dd04c6804aa59ff681317012a9682dc087a804a9d257702238012a525ddb088d404a949836c1d16012a577fdc00c7804a93cff6c031b012a4f42dc0720004a8caff8041a60129f119db1068904a7c4767416800129bfffdd0e68804a619776c399f01298660db0bda804a642576c28800129977fdc0072004a6125778255601295f3fdf0139804a56967880dda01294c7fd90375904a5320e7409c0012942bfe00510004a4a66768143d0129299cde0450004a461678817400128ff3fd805cf104a3fd0e6016e60128ff99de0ab0004a351ff6c2abd0128d482de0289804a329677003fc0128c65de20441004a2d5676c11004128b55d9b03f7804a2d9ff78444001287119db110f404a1c4736c3e4001287719de01f6804a1a4ff74090001285b59de0510004a11c676c143d0128471cdb0136804a159ff7004bc0128425dde0ab7804a05dff6c2adb01281782e107800049fc4ff7812000127a65ddb047f4049e9983840fde0127967fdb03f6c049e5a0b8426220127705ddc12378049c9dff7805220127225de007e78049c0aff6c1f9b012702c2e106300049ba7ff7030000126b9ffdb0bff4049ae80b6c28800126c17fdc04698049aa167800b9a01269cbfdc060a8049a12576c182701268498db03600049a3cff7016bc01266dd9db05ae40499b7737c477c0126265ddb11de4049899836c300001263dd9dc0381004986167680e010126185ce0061680497ffff782b800125d47fdb0adf40497520b7c21c00125b2bfdb086f40496cb0b704e6601256459db1398c049591736c3a620125785ddb048a8049682576c10620125a25ddd04968049547ff7c0fa20125425ddd00378049505ff7c024001253f3fdb008f40494fd0b7410e601252e59dd06600049453676c197d012514dce205b680493f7ff6016d64124fe039c046980493b1678422800124b719db089f10492dc766c221a0124b77fde04968049292ff884e2a01245695db1389904915a666c4da601245719db1350004915dff6c34620124705ddb0c0a80491d2576c246601248059e101bf004913e676806f841244f9d9f0016804913cff8468e20123e65ddb1a379048f99866c65400123e9ffdb0b38804908977800b040123db59e105100048f1c6768143c4123c71da20c210048e5a576c3080412396999b0c000048e5c676c2f9a0123977fdb08700048e956774144001235999dc05400048c79676c14fd01231e5ce002e68048c4aff7810620123025de102e68048bb7ff7819260122d4d9de06c00048ae7677437da012281ffdc034980489d367880b9a0122693fdb02e590489a50e8802e20122665dde03b1004895e6784074401224719dc012f004890977741d0401222559da074040488957370090001221c59df066000487f7ff6c197d0121fe02de02d000487caff6c0b3d0121f2c2de0ed000486ddff7011220121a65ddc03f78048659ff7839de0121367fe219698048343676c65a24120d0dd9b195a8048344576c64800120d1ffde00378048305ff7802400120bf3fdd067980482956780089a01209cbfde0360004823cff6c0d7d01208f42db02100048251ff6c07e6012094d9dd0d698048166676c35a30120599cdd04068048125ff6c101701204982de11c88048009776c471f01200260db0db0004804aff781680011fd77fe201488047f49776c051e411fd2619b00c00047f51ff6c02a6011fd4d9dd06f78047ed9ff681bdb011fb682dc0cf00047e0aff7c0ae6011f7719d902b89047ddc7688209a011f567fdb08259047d5a0e6c1e84011f5895e105088047d0977700204011f4059de04800047cb9677419da011f147fdb0675c047c520b6c1200011f1c59dc0d500047b7cff6c353d011edf42de06798047b1567701bc0011ea999db06ef4047aa6736c0dda011eb77fde05b68047a4aff743b40011e577fdb0ecf404795e0b801bde011e367fdb06f6c0478da0b6c031e011e4f3fe0004980478d567845100011de459dc0a9680476e7ff6c2a57011dba02db091680476ffff6c1d40011dc719db03768047759ff6c0cc0011dd799dd05298047695676c14a3011da55ce005310047642576c14c1011d9098e007d580475c4ff6c1f53011d7142db068580475d9ff7024c0011d4c7fdb092f40475320b6c16e6011d5a59db0480004757cff700ea6011d3dd9dd07b000473e667840b40011cee59dd06768047351ff + +def tb_32 : Nat := + 0x7424c0013d82bfdb092f404f60b0b6c06ea013da095dc02e9804f5dc67680ba3013d771cde0d2f004f509776c34b9013d4260db0946804f547ff7800de013d417fe108e6804f472ff682396413d1cc39d0169804f45c67700084013d1695de0060004f3f1ff781026013cec59de0780004f325ff6c1dfd013cc982dc0229804f303677400de013cb77fe20109804f2cd67680422413cb35d9c0660004f26767701980013c8059da065f404f201738428da013c577fda0a35904f15e0e682400013c5c59de0d48804f089776c351f013c2260db0889804f0d567782a00013bbfffdb0a7f404ef000b6c29a6013bc059db0649804ef4367742880013b977fdc0990004edc4ff6c263d013b7142db0930004edcaff6c2100013b767fdb063a804edfa576c1122013b865ddd0270004ed9dff6c09bd013b6782dd0f79804eca6676c3de3013b299cdb0e40004ecb9ff6c3000013b377fdb0930004ed0aff7c131a013b167fdb04c5c04ec5a0b7403c0013b12bfde04b0004ebffff6c12bd013b0002dc0030004ebfcff7405a6013af999de02d0004ebb967741f1a013acf3fdb07c5c04eb3d0b6c1980013ad4d9dc0630004ead9ff6c18bd013ab682dc0d20004ea07ff6c347d013a8202df0349804e9d367801d40013a5799de0166804e947ff7c03a2013a4e5de20951004e8a467682540413a291d9d0676804e83cff6c19d7013a0f42dc0450004e7f7ff780cc00139f13fdd0480004e77cff7c05a60139d999de28c6804e4d9ff6ca31701393682de1489804e391676852230138e45cda0cf0004e40aff7013800138d0d9db04df404e343737010800138c059dd0c46804e23cff6c311701388f42db0a71004e25a576c239a01389cbfdd0238804e21977780c84013879d9dd0b56804e131ff701b0001382e7fdb06bf404e0ba0b7c102601381e59da0408c04e07973701bfc0138025ddc0517804dfb7ff68145b0137ee02df0660004df51ff842d000137a77fdb0b3f104de9e0e6c21c00137b2bfdb0289804df2967702f220137785ddb0bc7c04dde1837812000137665ddf0372004dd6257840a3801374e5ddc0337804dd05ff7c012601374059dd0046804dcfcff7c2ac00137147fdb0aaf404dc520b6c2a66013714d9db08b9804dc7167741e000136f67fdb077f404dbda0b742d000136c97fdc0480004daddff6c11fd0136b782dd04b0004da92ff8852620136525ddb1497904d949866c4e2a01365695db1350004d95dff6c302a01367495dc1272004d822576c49c501360898df090f004d791676c24390135e45ce20c00004d65c676c2ffc4135971d9b0be6804d65dff6c1ec00135a859de04a1004d612576c128101358498db01a1004d642577011d6013572bfdf0649804d566676c19230135599ce10346804d531ff7009c0013542bfdf0b10004d459ff6c2c3d01351682dd05a0004d3ffff7849800134b67fdb125f404d2da0b6c35a60134ca59e20049804d2d5677012fc0134a25ddd0ad1004d1dc676c2b410134771ce206f0004d16d677802c401345895dc0085804d159ff6c021301345682dd03d9804d11c67705ac00133ec59db16af404cfb1737800c00133de7fdc0e08804ce99776c381f0133a660dc04e7804ce4aff6c139b013392c2db03f7804ce59ff74126601338059e003ff004cdc1776c0ff901337060db02f1004cdd2577c8a000132e65ddb227f404cb99836c6d9e013302bfdb19f2004cc22576c4e000133225de003f7804cb59ff6c0fdb0132d682db0201004cb7967841c800132b9ffdf0469804caa16774114001329719db044f404ca5c7380059a01328f3fdc0559804c9e767681563013279dcdf07e0004c96967743c0001321e59da0eff404c879736833fc0132265dda0720004c8f76770060001321859e21036804c75dff6c40d64131d7839e00a9804c7536774005a0131d47fe10088804c74977782ade0131a77fdb0ab6c04c69e0b6c18840131b9d9dc0081004c591677022da0131417fdb08b5c04c5060b74012601314059de08e6804c472ff6c239701311cc2de0810004c3f1ff7806000130f67fdb017f404c3da0b700f000130e77fde0379804c366677400de0130b77fdc0769804c2676784297c0130705dda0a5e104c1c186801e000130525ddb077f404c14983700ae6012fde59de01f6804bf59ff74005a012fbfffdd13b0004bdc4ff6c4ebd012f7142db105a804bdfa576c16e6012fa919df00d9804bdb767742b1a012f42bfdd0649804bca667681923012f299cdc0150004bc91677c0600012f1e59df02e6804bc4aff70025e012effffdd0ae0004bb51ff6c2b7d012ed482df00d6804bad9ff780126012eb559dd0540004ba81676c14fd012ea05cdd09a9804b96d676c26a3012e5b5ce000f0004b95e6770153c012e425ddb054e404b909836c1080012e4719e20097804b8ffff7811a6012e2e59dc0480004b871676c11fd012e1c5cdb0240004b895678804da012e177fdf0019804b85c677807da012e0f3fdd04b0004b7f1ff6812bd012dfc82df0750004b77cff6c1d3d012ddf42df0169804b76667741440012dc559dc1186804b5fcff + +def tb_33 : Nat := + 0x6c22e3014ef9dcdf0d200053b15676c347d014ec55cdf03768053addff740de6014ea999db0378c053aa67370521a014e577fdb1485c05395e0b6c3504014e7495e017a000537c4676c5e7d014df11cdb11c1005382257700abc014de65dde02c1005376d676c0b01014ddb5cde00f0005375e6770011a014dd67fe208700053695676c21bc414da55d9b07b000536a167780e40014d9719da038f405365c73701d16014d677fdb0744c05359e0b700d26014d5a59dc03768053531ff844d40014cff3fdb134f10533fd0e6c4ce6014cff99db132000533ffff6c2e26014d1e59db08b980534a6677010e6014cee59da0438c0533b973841980014cd4d9dc00168053351ff740540014ccf3fdd055980532e7677c4566014c7119db1158c0531c4737407da014c693fde01398053191677c0bc4014c5895df003f005315e6780011a014c567fdc0a0980530b9678816da014c177fda05b5905305e0e681200014c1c59e009768052fc4ff6c25d7014bf142db09168052fcaff6c07da014c0f3fe004800052f7cff6811fc414bdf439e00300052f79ff781da6014bc0d9de021f0052ee177800144014bb719db00501052edc7674245a014b92bfdb0915c052e4b0b7c1266014b8059df00468052dfcff709540014ae9ffdb254f4052ba80b702880014ac17fdf00900052afcff702700014a6dd9db09bf40529b7736c1044014a8495db039f0052a1977741440014a5999da050f40529667380101a014a497fdc02e980528f76784191a014a24bfdb064590528930e740c66014a1859dd07b000527e66774035a0149b67fde057a8052682576c15e70149a098db0508805268977701dd6014982bfdc029880525e17770265e014951ffe00d500052472ff6c353d01491cc2dc081000523f1ff6c203d0148fc82db07b000523f7ff6c07e6014914d9df040980523b167782b800148c0d9db0adf4052303736c22da0148c97fdb03768052379ff780d800148b359db035f40522cd73780e9a0148a4bfdd09198052201676c24630148805cdd0c30005213e6778029a014832bfde04188052089777044040147de59db11004051f79737c1b000147a559db06bf4051e95736c17400147a919de03b10051e5a577c180001477e95db05ff4051dfa63780bd6014772bfdc01398051db7676c04e301476ddcdc01968051d9dff8030000147377fd90bff1051cde0e780de601472999db0378c051ca6736c090001472e7fdc01500051c916778060001471e59e101f68051c59ff7014220147025de005178051bb7ff68145b0146ee02da00c78051bfcff701ec00146cf3fdc13500051a07ff6c4d3d01468202de034980519d3676c0d23014674dcdc00f000519c4677c07da0146693fde0889805191c676c22230146471cdb05d00051947ff801e0001462919dd0330005187167701e5a0145fdffe111a000516ddff6c467c4145b7839b0e298051715676c24660145d999dc08400051659ff6820fd01459682df0589805160167700ffc0145705ddd24810051379676c92010144de5cdb22800051399777407da0144d67fe005898051301676c16230144c05ce2247680510b9ff6c91d641442e839b223680510ddff6c73da01444c7fdb0af68051251ff702c220144025ddb0b07c051009837008c40143f999dd0bd00050f29676c2f3d0143ca5cdb09468050f51ff6c23040143d695db08868050f5dff7410800143b9d9df00f00050ecaff740b400143a77fde09600050e07ff6c257d01438202db09300050e0aff8409a20143785ddf00e10050dd36770267c01434e5de003378050d05ff74024001433f3fde08a00050c72ff8007e6014314d9dc0d668050b7cff8848c00142967fdb122f1050a5a0e6c3a800142a4bfdb06798050b15677c162601428059e203ff00509c177680ff8414270619e0637805095dff784eea01420895db13b9c0508226370243c0141e459e00750005071c6778236a01419695db08d9c05065a637c060001419095df068580505d9ff6c1a1301417682db03000050612578005400141713fda014f40505c50b8016e601415a59db05b8c05056973801c8001413dd9db071f40504f77374198001412459dc01800050479677c060001411859de18c000502d5676c62fd0140b55cdb13800050329676c491a0140cf3fe200f0005015e676803bc4140579d9c00468050159ff880f6601404719de012f00501097778025e01403fffdf0a5a805005a577023d6013ff2bfdc0e98804fee1776c3a5f013fb860db0c79804ff03676c1440013fde7fe00051004fedc677c10bc013fa65de109c7804fdfcff6c271a413f7f439b0981004fe0167705ce2013f225ddb1737c04fc89837019c8013f0895e01255804fafcff6c4953013ebf42db118e004fb09776c2a3c013ede59e10150004fae7ff840300013ea559e103b1004fa5a57780600013e9095e00055804fa3cff701566013e79d9dc16e0004f879676c5b7d013e1e5cdb1546804f892ff6c3c00013e3dd9e10796804f7ffff700666013df999df02d0004f7b96770005a013dd47fe10b40004f69dff6c2cfc413da7839b0870004f6caff + +def tb_34 : Nat := + 0x800300015f947fe114700057d0aff6c51bc415f42c39b09a98057db767780f66015f3359dc01368057cb9ff780a26015f2459dd09168057bffff7800c0015eff3fe104398057bb9676010e2415eee5da206768057b51ff6c19d6415ed4839b06600057b53677033ea015ea095db0cf9c057a82637c003c015ea059de07968057a07ff8009a2015e785dd4026790579e18650099c015e7863dc00e100579d367800e7c015e665ddd05178057947ff7c03a2015e4e5ddd039780578ffff6c0e5b015e4002db0300005790977780900015e2559df0136805785dff841980015dfdffdb065f40577f80b740cc0015df13fda032f40577c50b8070e6015d8059dd004680575fcff7428aa015d5695de0bc5805749dff6c2f13015d2782dc0930005740aff701c62015ce65ddc09000057309776c23fd015cc260db056100573436770031e015cbf3fdb00c6c0572fd0b800216015c947fe00150005723cff7808e2015c865ddf032100571e767701a9a015c5f3fdd04b00057131ff700300015c497fdd09300057092ff6c24bd015c24c2dd0898805700977881ba2015bd25ddb06e79056f49866c1980015bd47fdb05da8056f5a578802c4015bcf99de05700056ee7676c15bd015bb9dce206600056e816768197c415ba05d9a06510056e8257741e5a015b81ffdb0795c056e080b880a38015b4e5ddb028d1056d39867c0c00015b425dde0b610056c53676c2d81015b14dcdc00168056c51ff781e00015af67fdc03c00056b9dff8824c0015ac2bfdb092f1056b0b0e780f66015ab359dc07368056a59ff6c1cd7015a9682dc11088056949776c441f015a5260db0fc0005695dff70031e015a4f3fe1067980568d56778029a015a32bfdd106980567c4676c41a30159f11cdf02af0056799776c0ab90159e660e1008100567916770245a0159bfffdb0915c0567000b8817a60159a859db05e890566a1766c176a0159a895db05b980566a4677010da0159977fe20019805665c6778128401598495dd04d580565c4ff6c135301597142db047580565caff7c084001595f3fdc0139805656967781c8001593dd9db071f40564f773780a8001593359de027000564a6678475fc0158a25ddb1d7e4056289836c51fc0158c65ddb1246805633cff6c191a0158ff3fe012720056162576c49c501585898e1058e0056109776c163441584261a00af2005605a577c075601580f3fdc07800055fc4ff7812c00157de7fdb04af4055f7a0b841da60157c0d9de02700055edc67701d40015799d9dd13458055c9dff6c4d1301572782dd09300055c0aff741c620156e65ddd09c78055afcff6c271b0156bf42db09378055b05ff6c24000156c25ddb03f78055b59ff7005400156b9ffe104698055aa167700b9a01569cbfdc018a8055a5a576c062701569698e201800055a42576005fc4156909998017e8055a426f8016bc015679d9db05ae40559e773841f8001565a59db07df4055969737433fc0156265ddb0cfe40558998378019e015624bfdc138a805575a576c4e270155d698db1350005575dff7806fc0155cf99dc073680556caff703a620155785ddb0e97c0555e1836c3000015582bfdb048a8055682577c380401554059de004680554fcff7010260154ec59db0408c0553b173700dda0154de7fda0375c05537a0b8815000154c97fda053f10553260e6812000154cc7fe101b0005530aff6006bc4154c2c39e027000552dc678064bc0154525ddb192e4055149836c608401545695db11af00551c1777802c401544f99de0016805513cff805e260153f119db1788c054fc4736c2ce20154225de001f68054fa4ff6c07d70153e942dc00b88054f99777c15840153d0d9da05604054f4373680ec40153d799e002700054f1c677806c00153c059de05d00054ea4677403c00153a559dc04368054e51ff880e220153865dd703879054e198674139e015372bfde02d00054d9dff700de601535999df08868054cddff68221701533782df02400054cb9ff6c08fd01532e82dc04098054c79677807da0153167fe100168054b51ff700c840152b9d9dc0ae000549d3677c76da0151fdffdb1db5c0547f80b6c588001521c59db0d3680548ffff6c2dc001524719dc006000547f1ff7c09c00151f2bfe21318805469977684c5e4151a6619c04e7805464aff6c139b015192c2e004e000545fcff7085bc0150d0d9db216e4054343736c53d6015102bfde01b000542e6678414400150a559d7050f105429576840ec401509695df00858054251ff6c021301509482dd0d50005417cff6c353d01505f42dd0c3000540b9ff6c30bd01502e82db09f000540ddff7408220150265de204e7805404aff6c139a415012c39b03f78054059ff6c080401501e59dd0ed00053f5dff683b3d014fd782dc003a8053f5a578801bc014fd4d9dd01500053f3e676c053d014fcf9cdb009f0053f497774479a014f82bfdb11e5c053e0b0b840ba6014f7719da02e89053ddc76780240014f74d9dd07110053d6257701638014f425ddb058d4053d09836c0a38014f4e5de100810053d016774119a014f1cbfe108b98053be767 + +def tb_35 : Nat := + 0x7c1d40016f99d9dd06a6805bdfcff709540016ee9ffdb254f405bba80b6c76aa016f0895db1738805bc8977840ba6016ede59db02e8c05bb7973801cda016ec17fdb0735c05bb060b6c1bfc016ec25ddf0a99805ba5c67682a63016e971cda0709805ba9567681926016ea859da01e0005bae7ff7c0684016e9095e10300005ba12578416bc016e6dd9db05ae105b9b7766c1356016e713fdc1b76805b7ffff6c6dd7016e0002db1560005b861676c245a016e497fdf0199805b7e667740b40016dee59e005b6805b75dff700300016dd47fdb00bf405b7520b6c02a6016dd4d9e01708805b5e177685c1f016d7860da1470005b60aff6833ea016da095da0c88805b68977682d00016da77fde0051005b5dc677012c0016d6459dc0496805b547ff80089a016d1cbfdf0169805b45c678001bc016d14d9dc0616805b3f1ff6c1857016cfc82dd0780005b379ff6c1dfd016cde82dc0769805b303676c1da3016cc0dcdd0270005b2dc676c09bd016cb71cde0360005b2a66770131a016c967fdb04c5c05b25a0b6c0fc0016c99d9e100f0005b24aff7823d6016c32bfe01260005afa4ff6c497d016be942dc0139805af9167880cc0016bd799db032f105af5e766c0bc4016bd895df05e6805aeffff6c1797016bc002db05d0005af0167802880016b977fe2003a805ae5a575c00e6416b96999c040e005ae19776c1035016b8660dc03f7805add9ff6c0fdb016b7682dd0150005adc4ff700366016b6dd9de0fd6805acb9ff780600016b1e59dc06ff005ac09776c1bf9016b0260e000c7805abfcff7005a6016af999dd0e29805aad5676c38a3016ab55cdb0660005ab51ff744440016a7119db110f405a9c4736c335a016a81ffe202af005a999776c0ab8416a66619e02c1005a96d67843240016a2919db0c8f105a8a4766c1b5a016a3fffdc0480005a85c676c11fd016a171cdb0330005a871677422e60169d999db08b8c05a766737814400169c559e11186805a5fcff64461641697f43991140005a6016778a0e60168de59db2838c05a379736c7c80016902bfdb15f0005a49dff701e000168c059db077f405a30173701aa6016879d9dc12d6805a0b9ff6c4b5701682e82e10409805a079676c102241681e5d9b0270005a092ff7830000167ee59db0bff4059fb9736c1bfc0168025de007b00059f3e676c1ebd0167cf9ce00a068059e9dff6c28170167a782de03498059dd3676c0d23016774dce007110059d62577c02160167567fdc02088059d3977740cde0167417fdc00900059cfcff6c023d01673f42df0a098059c5c67700240016714d9de07968059bd9ff6c1e570166f682db06c00059be767742d000166c97fdb0b3f4059b260b8412000166b77fe104b00059a92ff6c12bc4166a4c39b03798059aa667781200016692bfdd0e7780598d9ff7803c0016632bfde0a8a80598225774177c0165f119e201f680597a4ff7c2f400165b9ffdb0bcf40596e80b7810e60165a919e000f00059695676803bc4165a55d9c05310059642576814c101659098da03b1005965a57680e4001659719df038580595d9ff781c2601655a59db0708c05956973781c8001653dd9db071f40594f773800a8001653359e2027000594a6675c09bc4165299d97025680594a7ff88191a0164ff3fdb064590593fd0e6c18c00164ff99db061680593ffff7c05a60164f999dc0bd00059329676c2f3d0164ca5cdb0930005935367782a000164a059db0a7f4059281736c27fc0164a25ddb054000592d5677002160164567fe005a000590ffff68167d01644002dd0a5a805905a577437560163df3fdb0dd4c058f7d0b6c2a3c0163ec59db09558058fc4ff6c23d60163f2bfde00300058f79ff78095a0163b77fdb0255c058ede0b8000660163b719dc07500058e676778035a0163967fdc087a8058dd2576c21e701637498db05d00058dfcff7c6c0001630895db1aff4058c2263881e960162e9ffda07a49058ba80e68177c0162f119e001698058b9167800dda0162d67fda03759058b5a0e680cc00162d799df05088058b0977701d040162a559db07404058a95736c1a040162a859e201110058a42575c04404162909997010f8058a426f7c015601628f3fdf02aa8058a1257880abc016279d9d602ae10589e776703c0001623dd9db0eff40588f7736c1f8001625a59e01036805875dff6c40d70161d782db07b000587e6678805220161d25dda0147905874986701bde0161b67fdb06f6c0586da0b8003c00161b2bfe002d0005869dff7801c80161a095dd0a0e00585e1777812000161665ddb047f40585998384145e016151ffdb0516c0585480b7416800160fdffdc010980583e76774035a0160f67fdc028980583b167700d1a0160df3fdb0345c05837d0b7400c00160de7fdd01398058366677816da0160c2bfdb05b5c05830b0b743000016092bfdb0bff405824b0b6c19260160a999e00672005815a576c19c501605698e20016805813cff8000c0015fe93fdd02b98057f79677406c0015fd799dd04200057f1c676c107d015fc71cde01b00057f01677006c0015fb999de08868057e5dff + +def tb_36 : Nat := + 0x6c05a60180d0d9e20ae000601e767702b7c418079dd9c0831006021257701efc0180865ddc0586806023cff7010da0180947fdc0420006025367700ec401809695db0390006025c676c089a01809cbfe00b898060079676c2e2241801e5d9b09f00060092ff881680017fd77fd4059f105ff5e0e7c00ea017fd695e1006f005ff536780005a017fd47fdc0780005fed9ff6c1dfd017fb682de0cf0005fe0aff7000c0017f81ffdf0349805fdd3676c0d23017f74dcdd11a0005fcb9676c467d017f2e5cdb0d20005fd01676c327c017f425ddd01f6805fc51ff781aa6017ef9d9dd06a6805fb7cff7819e6017ec559e000a6805fb0aff700b40017eb77fdd0930005fa4aff6c24bd017e92c2de078a805f9d257781d16017e577fe00210005f93cff6c083d017e4f42db01f9805f93e678819e6017e3559db0678905f8d576705dc0017dd799db176f405f75e736c5a00017ddb59e005a0005f6ffff7c17a6017da859db05e8c05f6a173880dda017d977fdd01ba805f64257781a16017d767fdc0150005f5c4ff7409c0017d677fdd0210005f57cff7004e6017d5a59e00f00005f479676c3bfd017d1e5cdb0720005f4f767700600017d1859df07b0005f3e6677c0b40017cee59de07c6805f33cff6c1f17017ccf42df0139805f329677827fc017ca25ddb09fe405f28983840204017ca059e109ff005f1e1776c27f8417c78619c03c7805f1a4ff7804e6017c6459dd0ed0005f0a4676c3b3d017c291cdd0466805f05dff740066017c1719e00ab0005efb1676c2abd017bec5cdb0916805efcaff841e66017bc0d9db0798c05ef03737c4080017b8059db101f405ee01736c2e1a017b92bfdb0a96805ee59ff6c2700017b99d9db0270005eedc677c0bc4017b7495e11b00005ec22576c6bfd017b0898e107a5805eba7ff6c1e93017aea02dc0a20005eb05ff700240017abf3fdd0750005ea72ff6c1d3d017a9cc2dd0598805ea19776c165e417a86619b030a805ea4257741440017a5999db050f405e9667384101a017a497fdf02e9805e8f7677c191a017a24bfe01b90005e6d9ff6c6e3c4179b6839b1ab9805e6e7676c55260179cf99dc057a805e682576c15e70179a098e1042f005e5997778020401796459e00496805e547ff7412c001793f3fdb04af405e4fd0b7010e601792e59e00420005e453676c107d017914dcdc0a20005e3b1676c287d0178ec5cdb0616805e3f1ff8022da0178c97fdb08b5c05e3260b6c0dda0178de7fe10448805e2e1776c111f0178b860e10141005e2cd676405004178b35d990051005e2dc67740e9a0178a4bfdb03a5c05e2930b700ae6017899d9df00d6805e259ff7c1d0401783559db0740405e0d5737c029a017832bfe015d9805df6d676c57630177db5cdb1519805df79677403c00177d799e101b0005df43676c06bd0177d0dcdc1491005ddfa576c524101777e98db0f16805de51ff6c395a0177977fe00205805ddd9ff7403c0017772bfe102d0005dd9dff6c0b3c41776783a00c00005dcddff70132601772459db04c8c05dc91738083c40176a095db20f0405da82636c6a800176b9d9db1546805db3cff6c251a0176ff3fdb087f005dc097780003c0176a059dc0051005d9dc67700240017674d9e000f0005d9c4677407da0176693fdd00b8805d9997774410401762559db1040405d895736c380401762e59db0600005d9397784275a0175fdffe10060005d7f1ff705e80017592bfdb179f405d64b0b6c5ac00175967fdb12b8805d699777c22620175705ddb0897c05d5c183808a000174e65ddb227f105d399867402040174e459df0180005d379677407da0174d67fe11dd0005d17cff6c773c41745f439b1080005d251ff6c3fea01749695db0540005d305ff6c14220174c25ddd0169805d1666770221a0174377fdb0885c05d0de0b7c35220174025dde0660005cf53676c197d0173d4dce10016805cf51ff7021c00173b2bfdb086f405cecb0b7030c0017381ffda0c2f405ce080b7c09a20173785ddd07f2005cd6257681fc501735898dc0085805cd59ff70082201734e5ddd0c67805cc72ff7c006601731c59dd0150005cc5c67740240017314d9e01ad0005caa6676c6b3d0172a99cde0136805ca92ff700e400172967fdd02f1005c9d257748b560171e93fdb22d4c05c7a50b7c4d4001719719db134f405c65c736c3c000171a859db0ed0005c6a4676c0cc00171d799dc0021005c65a577020160171767fdb0804c05c5da0b6c10380171865ddf0739805c566676c1ce30171599cdd0346805c531ff78192601713359da0648c05c4cd73700f0001712459df0376805c459ff6c0dd701711682dc1309805c329676c4c230170ca5cdb11d0005c33cff6c42000170d47fe00741005c21567740cfc0170785ddd01d1005c1c4676c07410170711cdd01f6805c1a4ff7004e601706459df02f1005c162577800fc01705799dc054f005c1097788025e01703fffdd0469805c0b96788054001702919d4014f105c0a4768823d6016ff2bfe20ee9805bedc676c3ba2416fb71d9b0e98805bee1776c31e6016fc0d9db0510005bf79ff + +def tb_37 : Nat := + 0x7837da0193df3fdf09b88064ee1778012000193a65de003210064e676784035a0193967fe005d00064dfcff70173d01937f42de15f00064c9dff7057bd01932782de06720064c22577405d6019302bfde07188064b99778402040192e459d400801064b91765001c80192e495de01f68064b59ff8039c001929cbfde01698064a5c678007da01928f3fde1c398064879676c70e301921e5cde12768064751ff7049d64191d4839c12600064753677046da0191d77fdc0c0000647b967701e5a0191ffffdf0139806473e677004e30191cf9cde0a06806469dff7028170191a782df194880645097770651f01914260dc10488064599776c306601917719dd00378064505ff88012601914059dd004680644fcff7442c00190fc7fe000a980643e76778125a0190e77fdc0495c06439e0b7416da0190c2bfdf007980643036788087c0190b85dd5021e10642e1865408760190b863dd0a5f00641c1777839de0190367fdc0e76c0640da0b701e000190525ddc0672006415a57883144018ff119d70c501063fc4767807da018fe93fde02b98063f79677c0d80018fd0d9de05d00063ee667781080018fa919dd0ed00063db767703b3d018f6ddcdc0aa10063dfa576822bc018f865ddf0ac68063d0aff882466018f1e59de02e68063c4aff881062018f025dd404179063c098678025e018effffdd12600063ad9ff70497d018eb682dc0e688063b19777030c0018ecf3fdc0ae00063b51ff702b26018ed4d9dc04800063bb7ff780126018eb559e2000f0063a81677427fc018e785ddd0831006395e6774153c018e425ddc054e406390983701080018e4719dc024f00639397778025e018e3fffdd046980638b967800540018e2919e10019806385c677c1a9a018dfc7fdc06a5c0637f20b7809c0018df2bfdf04e0006377cff8838e2018da65ddb0e379063699866c27c0018db77fdf09810063601677849da018d367fdc1275c0634da0b806600018cc17fdc197f40633060b780240018cbf3fdc008f40632fd0b7c3000018c8f3fdc0bff406323d0b702280018c9cbfdf055980631e76774305a018c497fdf08c880630997770231f018c2660dc06c000630b9ff88019e018c24bfdf0480006304aff7c1080018bb9d9dd10bf0062d09777042f9018b4260dc0b310062d6257702100018b6459dc07bf0062d9977701080018b74d9da03900062ddc67680cfc018b785ddd00378062d05ff780240018b3f3fdf0ab00062c51ff702abd018b1482dc0a998062c53676c28aa018b1695db0a098062c5c67882d00018ae77fda0b3f1062b9e0e7c24c0018ac2bfdb092f4062b0b0b882c40018a967fdb0b0f1062a5a0e6c1926018aa999de098880629c177841e00018a525dda077f1062949866819c8018a5695dd0016806293cff7c1c80018a32bfdd15d9806276d677057630189db5cdc1399806279167704c620189e65ddc106980627c467702a2a018a0895e000468062759ff801c800189b9ffdd01ba806264257740a380189865de10d6980624a6676c35a24189299d9d0c0000623e667702ffd0188f99cdc0a9680623fcff6c299a0188ffffe20ff000622e7676c3fbc4188b9dda00ad100621dc677412c001886459e103768062159ff700dd701885682dc02f10062162578019da01880f3fe007800061fc4ff783a260187b719db0e88c061edc7380209a0187967fdc0825c061e5a0b701d40018799d9de1d088061c897770741f01872260dc1bc00061c9dff7805d6018702bfe006300061ba7ff7427a20186c25de000378061b05ff782aea01869695dc0ab9c061a5a637024c001869cbfdb07098061a956788075601868f3fda01d49061a3d0e801566018679d9db0558c0619e7736c0aaa01868495dd0c168061925ff8002160185d47fde00888061749777c1f9e0185b2bfde02d0006169dff78140401856459e004968061547ff882ca601852559dc0b289061495767023a601852e59dc04b000614fcff7011a601854059dd09d680613f7ff8409000184de7fdd098880612e1777c1e84018499d9dd10d1006115a5768434101845698da0a5f00611c17764254401847495dd08f580610caff6c23d3018432c2e10418806108977783c000183e65ddc0eff1060f998670385e0183e9ffde07d10060f1c677c22bc0183865ddb08ae4060e19836c128401839695da04800060e5c6768119a0183977fde0b310060d66676c2cc10183599cdb06210060db76768151e0183713fe205b68060d0aff7c0f6601833359df01368060cb9ff7c74a60182b9d9dc1d28c060ae7737040800182edffdb10098060bb9677837da018281ffe0043980609c4678822bc01824e5ddc08ae106093986701f1a018251ffdb06a68060959ff74074401824719dd012f00609097784331e01820f3fdb0cc6906083d0e6c2b4401821719df15f000606ddff7057bd0181b782dc072000607caff7018c00181f67fdc04b000607f1ff7c11220181a65de003f78060659ff7826220181705ddd26778060359ff6c99db0180d682de0c498060295677031230180a55cdc05400060305ff6c14220180c25ddb03d9806031c67 + +def tb_38 : Nat := + 0x7809c001a7c719df00168069effff7c296a01a79695dc0a59c069e5a63701aa601a7a559e0057a8069dfa576015e641a77e999805598069dfc67600fea01a78495df03558069dc4ff700d5301a77142dc02f58069dcaff7409c001a7677fdf0d098069ccd678004da01a72e7fdf06000069c59ff801ec001a6cf3fdd0bb98069a8167741e5a01a681ffe2063000699a4ff7018bc41a669439c043980699c467740de601a65b59dd10b00069766677042bd01a5d99cdc07f680697f1ff74221a01a5b77fdf364980693796770d92301a4de5cdc344880693997770b4c001a502bfdc183a806955a576c472201a5705ddb0e1000695fcff6c372601a58059db0930006964aff6c210001a5967fdf06ff006930977701bf901a4c260de023100692e66784251a01a4947fdf12000069131ff7c150001a4377fe00d398068fe6677034e301a3f99cdc06f0006904aff7c168001a3d77fe0003a8068f5a57840c3c01a3ca59dc030e4068f297370021601a3d47fde11400068e15677044fd01a3855cdc04f68068ed9ff80029a01a382bfe103798068dd3676c0de241a374dd9b030a8068dda576c0ba601a37719e216068068c72ff6c581641a31cc39b13e00068c95677c3d8001a2df3fe005700068b25ff80042601a2c559e2240000688d567708ffc41a2355d9c1d86806893cff7075c001a24f99dc1b76806895dff70450001a28059df0b3100688225778417c01a1c719db105e406871c73740d1a01a1b9ffde08da806865a5770236701a19698dc046980686a1677c120001a18495dc047f40686126370103801a1865ddd0745806859dff701d1301a16782dc038580685d9ff880d2601a15a59d90348906856976640cea01a15a95dd05e6806850aff80738001a0cf3fdc1cdf406833d0b702c4001a1167fdf01398068329677c660001a06459dd03768068159ff6c0dd701a05682db0330006815e676c0bc401a05895dd05a000680ffff7c53a6019fec59dc14e8c067fb173704d40019ff2bfdb0c30006803cff6c296a01a01695e20d500067edc6770353c419fb71d9c0cff0067ee177702b80019fc0d9e108268067e59ff881740019f7f3fd805cf1067dfd0e840aaa019f7495df2c8e0067b097770b235019ec260dc258f0067b796770903c019ee459dc22a58067ba7ff6c71d6019f02bfdb1b000067c22576c5238019f225ddf02178067ae7ff8411a6019ea859e2072000678f767681c7c419e3ddd9a071100678f85774191a019e24bfe009300067753677024bd019dd4dcdc08c1006775a5770221a019dd77fde009f006774977743000019da25ddb0bff4067689837c5e38019d425ddc178d406750983704e96019d51ffdc0f0f00675916770297c019d7719dd09678067472ff7807e6019d14d9dc01f8c06745373783b40019cd999db0ecf40673667384221a019cb77fdb088590672de0e8029c4019c5695dc0a70406715a637028da019c577fe0084f00670d5678405a6019be459df19710066dfa577065c1019b7e98dc177f0066e1977704fda019b947fdc13710066e5a57704cda019b977fdc0fc00066e956770245a019bbfffdc09000066f0167701d40019bc719dc04e00066f4367880816019b767fd602049066dda0e7c03c0019b72bfe000600066dc4ff801440019b5999df05b68066d0aff780b40019b377fe003798066ca667680de3019b299cdf06ff0066c097774031e019aff3fdb00c6c066bfd0b7c10e6019aee59db0438c066bb97384005a019aedffe006498066b5367740fde019ab67fe1057a8066a8257844e96019a51ffdd066000667f7ff8919a60198e459dc46689066391767117a20198e65ddc3ed0006640aff70c7800199367fdc29da806655a57708da20199705ddc1fb000665fcff7024660199d999dc07b0006677cff700cc00199f13fe003600066343677c119a0198bf3fde08a00066272ff7c062a01989695e1040e0066219776c103441988661a10e778066131ff6c39db01984c82e1054000660ddff6c14fc419837839b050880660e1778863000197d47fdc18bf1065f520e7062a60197d4d9dc12600065fb7ff70192601981e59db04b00066092ff7802220197d25ddf02010065f296778179a0197b2bfdd02d00065e9dff782580019781ffe210b00065cfcff7042bc41973f439c10698065d01677040800197417fdb0fe88065d097780228001971cbfde00198065c716784305a0196c97fdb0c159065b260e6c2d5a0196cc7fdb08100065b66676c1a9a0196df3fde01b00065b0aff7c1e000196a4bfdc077f4065a930b781200019692bfdf078a80659d25788255601964f3fdb0954906593d0e6c24fc01964f99dd198000657a4ff7429400195bfffdd0436806565dff8800ea01959695db0039906565a668023d6019572bfdc08f4c0655cb0b7c05a601955999dd03468065531ff8009c0019542bfde10b000653ffff7042bd01950002dc0a9980654616768246601951e59dd07e000652d567701f7d0194b55cdc079680652d9ff701b000194b9d9dc02a000653296784300001948559e200f0006515e676c03bc4194579da10420006511c67 + +def tb_39 : Nat := + 0x8030c001bc2e7fdc0c2f406f0ba0b7015c001bc497fe20b08806f009776c2c1e41bc02619b06f0006f04aff6c09c001bc24bfe00ab7806ef5dff702adb01bbd782df010e006ef497770043501bbd260dc0085806ef51ff7802c401bbcf99dd11e6806ee0aff6c479701bb82c2db0a80006ee81676c22da01bba77fde0030006ee07ff780d2601bb74d9de099f006ed397770267901bb4e60dc0796806ed59ff78320401bb1c59dc0c80406ec71738434da01bae77fdb0d35906eb9e0e80029a01bac2bfe203d9806eacd67740e9a01baa4bfdf1350006e95dff704d3d01ba5782dc0c0a806e9d25774052201ba525dde00c7806e93cff805e2601b9f119dc1788c06e7c4737046aa01ba0895dc0720006e8caff7807da01b9e93fe004b0006e759ff7012bd01b9d682de05a0006e6ffff7816e601b9a919dc05b8c06e6a4738000c001b9a859de0621006e5fa57740bd601b972bfdf0990006e531ff744d4001b8ff3fdc134f406e3fd0b70360001b9167fdd0c00006e33cff8408e201b8c65dde1041006e21567886ec401b81695dc1bb0106e05a66706e4001b81719dc1b76806e05dff7042fc01b8425ddc0f90006e11c67702eda01b8567fdb0b31006e1625784075601b80f3fd601d4906e03d0e801e0001b7f13fde0139806dfb167740dda01b7de7fe009d9806dedc676c276241b7b71d9b0988806dee17774428401b77495e2238e006db9977708e3441b6e6619c22a5806dba7ff7071d601b702bfe00081006db9167740dda01b6d67fdd0508806db09777405a601b69719de01a1006da42577c0c0001b68495df04e0006d969677840da01b5d77fde01f9806d73e677c106201b5a25de107e7806d60aff701f9a41b582c39c0741006d615677c6c2a01b51695dc1b09c06d45a6370438001b53f3fdb1099806d501676c414001b5417fe00685806d3f1ff701a1301b4fc82e00180006d3d9ff780d8001b4b359dc035f406d2cd737009c001b4b719dd10bf006d1c177741a4001b43559dc068f406d0d57374192601b3d0d9db0648c06cf43738427c001b3a919db09ef106cea4766c228001b3ae59db05d0006cee6676c10da01b3bfffdd0526806ce51ff70149701b39482df0eb9806cd6667888a5a01b2cf3fdc2295906cb3d0e70851a01b2d47fdc0990006cccd677419e601b2b559e00531006ca825778003c01b2a059e11396806c947ff78120001b23fffdc047f406c9000b700ae601b24719df08e9806c8716784299a01b1f2bfdb0a65906c7cb0e6c25da01b1f67fe01710006c659ff705c3d01b19682dc1318806c699778403c001b192bfe10bc5806c49dff682f1241b127839e0930006c40aff84406201b0c25de10037806c305ff80012601b0c059e201b0006c2e6676806bc41b0b99d9a0196806c2e7ff7c144001b0a559de0420006c25367841b0001b079d9db06bf406c1e77380425a01b0377fdc1095c06c0de0b702d5a01b04c7fdb0810006c1666774090001b02e7fde13f9806bf53676c4fe301afd4dce20886806becaff70221641afb2c39c0796806bed9ff700a8001afca59e10c00006be0aff642ffc41af82c3990b59806be1567800ba601af7719de0801006bcb96778120001af1c59e10889806bb1567880dda01aeb77fda0375906bade0e78042601aeb359e10270006baa6678816da01ae92bfde078a806b9d257881d1601ae577fd90744906b95e0e64069601ae6dffde0736806b8caff7c2a2a01ae0895e1088e006b799776c223441ade6619b07d5806b7a4ff7403c001add799dd0046806b759ff781c8001adb9ffe10469806b6a16780030001ada559de03b1006b65a5780120001ad8495df04d5806b5c4ff7c47a601ad2999dc11e8c06b4a67370336601ad3dd9dc0ba0006b50aff7024c001ad4c7fdc05e9806b566677016e601ad5a59dc0480006b57cff743b4001acee59dc0ecf406b3b973702a5a01acff3fe10660006b353675c197c41acd4dda00016806b351ff74035a01acb67fdd0fd9806b1dc6778060001ac7119de06a6806b159ff74282601ac2e59de05b6806b05dff7c006601ac1719e10021006b05a5778300001abdf3fdb0bff406af7d0b7400c001abde7fe20988806aee1776c261e41abb8619d0037806aeddff78210001ab967fdc083f406ae5a0b80742201ab225ddb1d07906ac89866c6f0001ab277fe20a99806aa5c676c2a6241aa971d9b0930006aa72ff842cc401aa5999dc0b30106a9667670188401aa6dd9e10381006a86167700e0101aa185ce110f6806a751ff781aa601a9b9d9e101c6806a6caff6c071641a9b2c39e1b0a806a45a57706c2701a91698dc1018806a5097774375601a8df3fdc0dd4c06a37d0b70189601a8fdffdc0085806a451ff7415c001a8c97fdc056f406a3260b78112201a8b85de004e7806a292ff84558001a84f3fdc155f106a13d0e70552601a84f99dc1498806a1497770246601a88059dc0480006a24aff7419e601a83559de00a6806a0caff74106201a8225dde11010069f796770440101a7de5cdc0e178069fa7ff84030001a7db59e102a00069f4367700a7d01a7d0dcdc01368069f59ff + +def tb_40 : Nat := + 0x80600001d2f67fdc17ff4074bda0b703f6601d31719dc0e898074c716778600001d2967fe205898074a0167880bc401d27495d602f010749d266580bbe01d2749be01d10007476d677c03c001d1d799dd0ba000746a4678000c001d1a859dd0450007465c6784008401d19695de01800074642577c0a3801d1865de103f780745d9ff680fda41d17683a000f000745caff78192601d15999df0a09807449167802ac001d0f999dc0aaf40743e673781aa601d0b9d9df05df007428977842a0001d0785ddb0a7f10741e18674014401d07719df07a10074162577800fc01d05799de054f00741097774025e01d03fffe1046980740b9675811a241d02e5d9f03768073f79ff781da601cfc0d9e1021f0073ee177881e8401cf99d9dc07a01073e6776701d0401cf9b59dc04800073e9977740dda01ced67fdf05088073b0977743dc801ce8495e1030000739b76780245a01ce497fdc0915c0739260b80312601ce1859e105f1007375a57785e3801cd785ddb178d40735e1836c021601cdd47fe20e010073501676c380041cd405d9b0db78073505ff6c265e01cd51ffdb050100735916784294001cd1719dc0a4f107345c7670239a01cd1cbfe0064680733f7ff80078001ccf67fdd0cf0007330aff7033bd01ccc2c2dc06000073379ff8404da01cca4bfe203900073259ff700e3c41cc96839e098880731c17770261f01cc7060dd0637807315dff80666601cbf119db1998c072fc4738015c001cbdb59de00f00072f5e677c06c001cbd0d9e100168072effff78288001cb977fdf00c00072e51ff84660001cb2e7fdc197f4072cba0b70234001cb713fdc08700072dcaff701e0001cb767fdc057a8072dfa577834e601caf999dc0d38c072be673702f4001caff3fdc0ba00072bffff70180001cb167fdb04098072c79676c0a2601cb2459de00168072b51ff7c33ea01caa095dd05b980728a4677803c001ca2559de024000728716774054001ca1719dd06a680727f1ff740b4001c9f13fe105e98072766676817a241c9d99d9d0510007271567749dda01c9277fdc2775c07249e0b706ec401c95695e20930007240aff802c4001c8d67fde0ffa807225a5778021601c8947fe00d50007217cff7838e201c8265ddb0e37c0720998374019e01c824bfdf0199807207967800b9a01c812bfe111b68071e9dff7046d641c7a7839c0ee68071ecaff70240001c7ca59dc07b00071f3e678021de01c7567fdb0876c071d5a0b88174001c73f3fdc05cf1071cfd0e70162601c74059e20a098071c5c6768282241c7171d9e00a68071c51ff881aa601c6f9d9d706a89071be77678125a01c6e77fdc0495c071b9e0b781e0001c6c97fde05898071acd676c162301c6b35cdf08268071a4aff70209641c692c39e089880719c17778871e01c5e93fdf100980716a46770402301c5a91cdc0bd000716e7ff70294001c5bfffe10d9680715caff6c365641c572c39d0c00007150aff840f6601c53359dc03d890714cd76700ba601c53719dc02d000714ddff841cda01c5167fdd05a000713ffff74066601c4f999dd02d000713b96784198001c4d4d9e0079680712d9ff6c1e5641c4b683a007200070fcaff74018001c3f13fdd0af98070f1567702be301c3c55cdc04b00070f79ff70120001c3df3fe128bf0070c897770a2f901c32260dc11400070e016770329a01c392bfdc0bb68070e59ff702b8001c399d9dc07bf0070e9977700e4001c3b719dc03768070eddff700cfc01c3b85de20e178070ba7ff6c385a41c2ea039e087f0070b097784085e01c2b9ffdd05298070a95677014a301c2a55cde0de000709b76774177c01c2265ddd019980707e66784221a01c1d77fd80885907075e0e600b9a01c1edffdf0d4880706897770351f01c1a260dc084000706d9ff701da601c1b9d9dc01f9807073e6770052201c1d25ddd007200706825788297c01c17719db0a5e10705dc7674251a01c151ffdc0945c0705480b7012c001c16459de03e880705097780189601c0fdffdf046980703b1677011a301c0ec5cdc01e000703d9ff7404da01c0e77fde0210007037cff7400c001c0de7fe0013980703666778144001c0c559e000a6807030aff78192601c0a999dc0648c0702a6737c16da01c092bfdd089880701c17778352201c0225ddd0030006ffa4ff7c12c001bfd67fe20739806fee66774251a01bf947fde0cf0006fd0aff74144001bf2e7fdd0ba0006fbffff6c2e7d01bf0002db0289806fc91677c120001beedffdc047f406fbb80b7011a601beee59de0660006fb51ff840e2201bec65ddf0981006fa81678027fc01be785ddb09fe106f9e186780e7c01be665de20517806f947ff68145a41be52039d02b9806f91c677418c001be2e59df07c6806f83cff701f1701be0f42dc05b6806f85dff74114001bdfdffdd31e0006f4d9ff7c0f0001bd277fdf0930006f40aff781c6201bce65de00081006f391677c138001bcd0d9e1039f006f3097778020401bcc059e00046806f2fcff74228001bc9cbfe00085806f251ff740e2201bc865ddc0387c06f2198374271e01bc5f3fdb09c6c06f17d0b + +def tb_41 : Nat := + 0x7804e601e86459dd0510007a11c678404bc01e8425de10ab7807a05dff6c2ada41e817839b0981007a071677c5f2201e7b85ddc17c79079ee1867056a601e7c0d9dc09900079fc4ff740fde01e7967fde1bc00079c9dff706efd01e72782dd01488079c89777c385e01e6e9ffdc0e16c079ba80b701f9e01e702bfde0c000079ae7ff7c11a601e6a859dd02e68079a72ff7c182a01e68495df05af00799b76774477c01e6265de00381007986167742b8001e5d47fdf139980795916774125a01e551ffde04200079505ff70107d01e54182e0009000794fcff6c023c41e53f439d04b00079366676c12bd01e4d99cdb03768079379ff84228001e4b719dd04968079292ff784e2a01e45695db1389c07915a6388075601e44f3fdc01d4907913d0e8873e601e3db59dc1cf89078f6d767070e601e3de59dc1a388078f997778144001e3c719e10a2f0078db7676c28b901e36ddcdd05100078d666778150001e31e59e102e68078c4aff680b9641e312c39d04188078c097778025e01e2ffffe201998078be66764066241e2f99d9d02e68078bb7ff74342601e2b9d9dc0d08c078ae7737c37da01e281ffdf02e680789a4ff6c0b9701e26942e000b8807899977880ec401e25799d903b0107895e76640dc801e25895de024f0078939776c093901e24e60e0012f007890977781d0401e22559de02400078871678004da01e2177fe003f78078659ff74600001e1367fdc17ff40784da0b74774001e0bf3fdc1dcf40782fd0b70750001e0c17fdc1d088078309777065a601e0d0d9e106798078295676819e241e0a55d9d02268078272ff740d8001e08f3fdd0d6980781666778101a01e0497fe111c8807800977781ba201dfd25ddc06e7c077f498370198001dfd47fe106f78077ed9ff7400c001df81ffe002b98077ddc677836c001df4059dc0daf4077d01737034bc01df425ddc0a2f0077d397770209a01df567fde0af68077c51ff702bd701df1482e00d500077b7cff6c353c41dedf439b0b400077b9dff8435a601dea999dc0d689077aa676702be601deb359dc09f00077addff7c16da01de92bfdd0ed0007795dff74052201de525ddd06f780778d9ff7c012601de3559dd05298077695678014c401dd9095e111058077531ff70441301dd4c82dc07d580775c4ff780ea601dd3dd9dd07b000773e6677c0b4001dcee59df06768077351ff88054001dccf3fdf013980773296778450001dc8559dc113f4077215737013da01dcb67fdf033f00771e177880f1e01dc693fe10a5000770ffff6c293c41dc40039b09b88077109776c222601dc4719db04b00077159ff8416e601dc2919da05b890770a47684120001dc1719db047f107705c7678245a01dbf2bfdc0915c076fcb0b78270001dbc559db09bf4076f1573800dda01dbb77fdb03759076ede0e6c0cfc01dbb85dde00198076edc677c1d4001db99d9df00d68076e59ff8803c001db92bfe007ba8076c22577405d601db02bfe010500076b05ff6c413c41dac183a000900076afcff74054001dab9ffde04698076aa167800a3801da865de00a8f0076969677410da01da497fdc0435c0769260b7424c001da24bfe01549807673e6770552301d9cf9cdc14100076751ff782d3c01d9a25de107e7807660aff6c1f9a41d982c39b0741007661567881c6201d9665ddc0717907659986700ba601d97719dd0e0100764b96770380101d92e5cdc090000765097774090001d92559df03b1007645a57801a1601d8fc7fdc0684c0763f20b70189601d8fdffdd0750007637cff6c1d3d01d8df42de05700076325ff7015bd01d8c982de01098076315677c120001d8b359db047f40762cd7374131a01d8967fe20fc0007615dff7400ea01d85695de080580760d9ff84582601d7de59dc16089075f7976704c8001d7e9ffdb05088076089776c03c001d832bfde01368075f59ff802d6601d7a919db0b58c075ea47380119a01d7977fe200c00075e51ff6802fc41d794839a00a98075e53677c15ea01d77e95df02f58075dcaff80065a01d7677fe112498075c796770492301d71e5cdc0e400075cb9ff70342601d73359df06ff0075c097788031e01d6ff3fd900c69075bfd0e6402c401d6ff99e20c000075b3cff682ffc41d6cf439e05598075ae76784194401d6a095d906501075a826664193e01d6a09bd905df0075a897778014401d67719e0018000759c4676c05fd01d6711cdf01f680759a4ff8402e201d6665de206000075939777017fc41d64e619c05178075947ff78200401d62e59df024000758956784329a01d5f2bfdb0ca590757cb0e6c2eda01d5f67fdd0b59807571567741efc01d5a65de103f78075659ff7403c001d592bfdf0f0a807555a57703c2701d55698de20058075359ff70801301d4d682de01698075343677c0e7c01d4c25de100378075305ff742aea01d49695df00858075251ff7c354001d45f3fdf04b00075131ff7012bd01d44c82dd14b98074fe6677052e301d3f99cdc1288807500977740b4001d3ee59e00d098074ee76778071a01d3b2bfdf168a8074d62576c5a2701d35898dd00858074d59ff + +def tb_42 : Nat := + 0x78271e01ff7f3fdb09c6c07fdfd0b845ce201ff225dde0a2a807fa5a577028a701fe9698dc0679807fa95677016e601fea859de01d5807fa3cff70075301fe8f42df0559807f9e7677c5b8001fe1e59de0930007f7e6677024bd01fdf99cdd0660007f753676c197d01fdd4dce002e9807f5dc6784359a01fd417fdc0d65907f5060e7034bc01fd425ddd0049807f5016774294001fd1719dc0a4f407f45c7384008401fd1695df0a8f007f3b167702a3901fcec5cdc0685807f3f1ff70189601fcfdffdd0136807f39dff841e0001fcc97fdb077f107f3260e6c1b0001fccc7fe00229807f3036774095a01fcb77fdc0255c07f2de0b7c042601fcb359df0660007f2676778198001fc8059dd177f007f08977705df901fc2260e20e17807efa7ff68385a41fbea03a10a80007eeffff6c29fc41fbc0039f0a20007ee5dff88264001fb713fdb098f107edc50e6c25e601fb7199de0270007ed9dff8016da01fb12bfdc05b5c07ec4b0b70131a01fb167fde0030007ebfcff7805a601faf999e00a96807eb3cff702a5701facf42e10630007ead9ff6c18bc41fab683a10d20007ea07ff801d4001fa5799dd0166807e947ff8442c001fa0f3fdc10af107e83d0e703b6a01fa1695dc0eb9807e85c67703a8001fa177fdc0a39807e8a4677c1ec001f9df3fdc07af407e77d0b8005a601f9d999e028c6807e4d9ff74522601f8e459e104e0007e343676c137c41f8d0dd9b04d1007e344576c125a01f8d1ffdb0376807e359ff84108001f8c059e00c46807e23cff7408e201f8865ddd0409807e079677c1bfc01f8025ddf0517807dfb7ff7c198001f7d47fe21708807dde177705c1e41f778619c14a0007de07ff702d0001f7a77fdf0480007dd99777824de01f7417fdc0936c07dd060b70180001f74e5de212c0007dbd9ff704afc41f6f6839c11e9807dbe767702d0001f7147fdc0b29807dc536770024001f73f3fde0fc0007daddff703efd01f6b782dd04b0007da92ff74526201f6525ddb1497c07d949836c346201f6705ddf1272007d8225778417c01f5c719dc105e407d71c7370243c01f5e459dd0c00007d65c676c2ffd01f5971ce10916807d5caff70245641f572c39c0826807d5d9ff70128401f58495de0c00007d50aff702ffd01f542c2dc0990007d531ff70192601f55999de2359807d2d567708d6301f4b55cdc2310007d2d9ff70786601f4ca59dc10b0007d3ffff702c4001f5167fde04bf007d28977801bc001f45b59e10136807d159ff7004d701f45682de04e7807ce4aff80126601f38059e003ff007cdc1777c8a0001f2e65ddd13d1007ca5c67704f4101f2971cdc0f81007caa167702c5e01f2b9ffdc03f7807cb59ff781d4001f279d9dc074f407c9e7737007da01f28f3fdd16e0007c87967705b7d01f21e5cde0180007c861677440da01f1d77fdb1035c07c75e0b6c1ec001f1f999dd00a9807c7536788005a01f1d47fde0088807c749777c5a0001f1785ddc167f407c5e1837031c801f1a095dc0ab7807c69dff88120001f1665dda047f107c5998688020401f16459e108b6807c505ff6c22d641f14183a10930007c472ff7024bc41f11cc39c0709807c4956770024001f13f3fe003c0007c39dff740de601f0d999de084f007c2e1776c213901f0b860db0630007c303678400de01f0b77fdd0769807c2676774477c01f0525ddc11de407c1498384614401eff119db1850107bfc4766c300001f0225de104b0007bf79677012bc41efde5da00796807beffff701e5701efc002dc0780007bf0167700d8001efd0d9e013b0007bdc4ff88036601ef6dd9dd0ac6807bd0aff78192601ef2999df0180007bc7967840b9a01ef12bfe10097807bbffff882b8001eed47fdb0adf107bb520e6c2b2601eed4d9dd06a9807bae7676c1aa301eeb9dce10120007bad56770047c41eeb55d9d0540007ba816788450001ee5b59dc113f107b96d767039fc01ee665ddc09ff007b9e1778003c001ee5799de054f007b9097780140401ee2e59dc0500107b8b97678120001ee1c59de0136807b85dff781b0001edfc7fdc06bf407b7f20b70084001ee0f3fe20750007b77cff6c1d3c41eddf439b02d0007b7c4ff7805a601edd999e00510007b7156778461a01ed7f3fe103c0007b49dff7824c001ed02bfde0718807b3997784158401ecd0d9de2a9f007b0997770aa7841ec26619c2896807b0b9ff70419a01ec8f3fdc0d06807b272ff70119a01ecbf3fdd1461007af536770518101ebd4dcdc13f2007af5a5770139e01ec12bfde1440007ad59ff741e0001eac97fde01b0007ab0aff7c192601eaa999dd04c6807aa59ff7c21ea01ea7495dd088e007a949777c031e01ea4f3fdf1cb0007a6ffff7072bd01e9c002dc1710007a759ff705b2601e9d799dc15d9807a76d67704e6601e9e459dc1069807a7c4677841d601e942bfdc1074c07a50b0b70381601e94c7fdc0a8f007a5696774192601e92999dc0648c07a4a67380131a01e9167fdc04c5c07a45a0b74420001e8d47fdc107f407a3520b780a2601e8ca59e20441007a2d56774444001e87119dd01f6807a1a4ff + +def tb_43 : Nat := + 0x74254402177495da09504085dd2637c4d160217277fdd09300085c0aff741c620216e65dde09c78085afcff84062a02169695dd01800085a425780019e021624bfe1138a808575a578406fc0215cf99da01be108573e76801cda0215b2bfdf0e9880855e177747bde0214fc7fdc1ef6c0853f20b706384021514d9dc1872008545a5770391e02153f3fe0040980853b1677c0dda0214de7fdd05400085325ff6814fd0214c982e101b0008530aff7c01e60214c0d9e11b9f008514977706e78421452619c141f00851c1778402c402144f99dd17a00084fc467705e7d0213f11cdf01f68084fa4ff8402e20213e65dde05610084f43677c10800213c059dc041f4084f01737c03c00213a559e204368084e51ff6810d6421394839a04200084e5367740e220213865dde04e78084dcaff880de602135999d703789084d667688221a0213377fdf01f68084c59ff7842000212d47fdc107f4084b520b7c0e220212c65ddb0387c084b19837c4500021274d9dc113f40849d3737019800212a059db06510084a825778785a0211fc7fdc1e15c0847f20b7076da0211fdffdf027000847caff744c620211a65dde04e7808464aff78138002117f3fe00a2a808455a577c10800210c059db041f4084301736c0f5a0210c17fdf01b000842e667845a5a02105f3fdc1695908417d0e70521a0210677fdc0ff000841e76770251a0210947fdc093000842536770230402109695de0c3000840b9ff7808220210265dde04e7808404aff6c139b021012c2dd0ed00083f5dff8400ea020fd695de006f0083f5367780540020fcf99de01500083f296774479a020f82bfe00a8a8083d6257702a27020f5898dc03798083dd367781638020f425ddd05010083cb967701401020f2e5cde04668083c72ff7c5766020ec559dc15d8c083b15737022e6020ef9d9df03768083addff780de6020ea999e01486808395dff8407e6020e4f99da01f8908393e76745e80020df119de02af008379977740b04020ddb59df00f0008375e6788011a020dd67fde03d9808371c678821c0020da559dd0390008365c677c1284020d8495db04a0408361263781d16020d677fe103768083531ff784d40020cff3fdb134f40833fd0b7c10e6020cee59df0660008335367740540020ccf3fde055980832e76780035a020cb67fe2115980831c4676c4562420c711d9d01f680831a4ff8810aa020c5895dc04299083162667010a4020c589bdc0379808316d678800fc020c5799de00468083159ff7c2826020c2e59dd05d0008305c6770173d020c171ce109768082fc4ff6c25d6420bf1439b09600082fc667741200020bdf3fdd00300082f79ff742622020bb85ddc0987c082ee183781380020b7f3fdc04df4082dfd0b809540020ae9ffdd0a200082b05ff740240020abf3fde145980829b767705163020a6ddcdc0a998082a5367741440020a5999dd04068082925ff782b260209f999dc0ac8c0827e6737824c00209d4d9de06c000826e7676c1afd0209b9dcdd00d680826d9ff8033c0020982bfdc0cef408260b0b7015ea0209a095e0029880825e17784265e020951ffde0d500082472ff7820400208fc7fdf0ee9808230367703ba30208c0dcdf102000822016770407d0208805cdc07068082292ff700d800208b359e00c30008213e677c1a4002083559db068f40820d5737412fc0208225ddc04be4082089838044040207de59db11001081f7976801e000207c059db077f4081f01736c17400207c719db03600081f43676c07da0207d67fdd06c00081e95677426c402077e95dc09b04081dfa63880bd6020772bfda02f49081dcb0e8004e602076dd9e101968081d9dff7430000207377fe001500081c9167740dda0207167fdc0375c081c5a0b7814220207025ddd05178081bb7ff884d40020681ffdb134f1081a080e6c4ce602068259db13200081a0aff7807da0206693fe20889808191c676c22224206471d9b06b8808193977741e0002062919e20ac680817f7ff702b164205fe039c0676808183cff8867800205967fdc19df108165a0e7057a20205a65ddc11a000816ddff7c26220205705ddc0987c0815c1837492040204de59e101f68081359ff5807d64204d683a205898081301676c16224204c05d9b05400081305ff743fc00203b9d9dc0fef4080ee773702f400203ca59dd00d68080ed9ff7403c00203b2bfe002d00080e9dff8832a6020374d9dc0ca89080dd3767030ea02037695dc0c198080ddc67702f220203785ddc09600080e07ff740cde0203417fe000900080cfcff742a66020314d9dc0a98c080c53737c359a0202df3fe012300080a59ff84162602028059de03ff00809c177744eea02020895df090f008079167800d1a0201b9ffe210e000805d9ff70437c420176839c0d5a80806125770296a02019095dc08da808065a578405400201713fdf0cd980804f76770336302013ddcdc05b980805696780198002012459df01800080461677463000200b559e21680008016d676c59fc42005b5d9e01368080159ff7004d702005682de012f0080109777c3a6201ffb85ddf0051007fedc67 + +def tb_44 : Nat := + 0x781284022e8495dc04a0408ba12637007da022e8f3fdf2125808b7ffff708493022e0002dc05af008b9b7677c0666022df999dd02d0008b7b9678016da022dd77fde00c0008b751ff785c22022d785ddf0051008b5dc677c12c0022d6459df0496808b547ff782ca6022d2559db0b28c08b49573841e00022cde7fde0769808b303677409c0022cb719dd0360008b2a6677403c0022c92bfdd1800008b0caff705ffd022c32c2dc0f0a808b15a576c3b40022c577fe21260008afa4ff6c497c422be9439b1230008afa7ff7c179a022bbfffdd0a5a808ae5a57702967022b9698de03f7808add9ff7c0540022b713fdf00d9808adb767883f5a022b2e7fda0fd5908acba0e683e9a022b2f3fda0ea0008accd677c0a26022b2459e20180008ac796788031e022aff3fda00c6908abfd0e6802c4022aff99de0169808abe667784440022ab559dc110f408aad573804440022a7119e102af008a99977740b04022a5b59de0c90008a8a4676c323d022a291cdf0480008a85c677c3d800229d999dc0f5f408a766737c14400229c559dd1186808a5fcff7cbee60228c059dc2fb8c08a3017370a0e60228de59df0af6808a251ff6c2bd702289482df06a9808a1e767844b5a02282e7fdd0409808a079676c102302281e5cde13b00089f3e67704ebd0227cf9cdc0c000089fb967741e5a0227567fdc0795c089d5a0b740cde0227417fdf0a098089c5c67780240022714d9dd12d68089b25ff704b570226c982dc07968089bd9ff7412000226b77fda047f4089ade0b8012c00226a4bfdb04af4089a930b806e400226367fdc1b8f40898da0b7034620226705ddd00f000898caff7841a60225f119dc1068c0897c47374371a0225b9ffdc0dc5c0896e80b7410e60225a919e000f00089695677c14c402259095e0068580895d9ff701a1302257682e0072000894f767740a8002253359e0027000894a667842a5a0224ff3fdc0a9590893fd0e7805a60224f999e10bd00089329677c2a000224a059df0f00008919167683bfd0224645cda0a5000891dc67840dda0224567fdc0375c08915a0b700bc402245895dd05a000890ffff7c296a02241695de0dd58088f7cff7c1e660223c0d9dc0798c088f03737019e60223c559df07500088e6767748a960222e9ffdc22a4c088ba80b7071d6022302bfdc1b000088c22578405a60222e459da01689088b9176840dda0222d67fde07410088a95677414c402229095dc05304088a426374015602228f3fdd11af00888f7677046b902223ddcdd1adf008874977706b790221d260dc1996808875dff7044400221f999dc0960008886167781bde0221b67fe200f000886caff7c0b400221a77fdd01488088689777401c80221a095e109978088547ff70265b02215202dc04800088599778010800221417fdb041f40885060b742aea02211695de00858088451ff7416800220fdffde010980883e76780035a0220f67fdd028980883b167800d1a0220df3fdb0345908837d0e8800c00220de7fdd01398088366677446da022092bfdc11b5c08824b0b7016da0220c2bfde0016808813cff7c6540021fe9ffdb194f4087fa80b800ba6021fde59dc02e89087f79767806c0021fd799e004200087f1c67780d80021fb999dc035f4087ee67374221a021f977fdd00c00087e51ff746126021f3359dc1848c087ccd737051c0021f42bfe001368087cb9ff7c2e80021effffdc0b9f4087c000b7400c0021eff3fdd04398087bb96774003c021ea059df0ae000879d367702b7d021e74dcdc09ff00879e177800e7c021e665ddd05178087947ff741200021e3fffdc047f40879000b740dda021e177fdc0375c08785e0b780cc0021df13fe01c398087601677c011a021d7f3fe20a2a808755a576428a6421d5699990a09808755c677c53d6021d02bfdc14f4c08740b0b702f16021d277fe107188087399777c031e021cbf3fe100858087251ff7c0540021c8f3fde0c00008717cff702ffd021c5f42dc055980871e7677c12c0021c4c7fe000c00087125ff8024c0021c24bfdb092f10870930e6c2322021c265dde089880870097774145e021bedffdf07968086e07ff7433a2021b4e5ddc0ce7c086d3983702b80021b567fdc0a5a8086d6257842dde021b147fdc0b76c086c520b702d84021b14d9e107800086bd9ff601dfc421af6839e03c00086b9dff7824c0021ac2bfdb092f4086b0b0b840f66021ab359df07368086a59ff7c4422021a525ddd00c7808693cff8019e6021a3559df00a680868caff7841a60219f119dd02af00867997780265e0219bfffdc0996c0867000b7c17a60219a859db05e8c0866a1738010da0219977fe1099000865c4ff70263c421971439c097980865c6677024c0021972bfdc04ba8086612577409c00219677fdf0349808656967700d2302195a5ce13c3f00861097770f0f8421842619c36b100861625770ae0002188559dc243f008628977706cfc0218c65ddc06c0008646167742bc802181695dd09558085fc4ff7025530217f142df0c198085f03677030630217c0dcdc04b00085f79ff7c2700021799d9dc09bf4085e6773 + +def tb_45 : Nat := + 0x782f7c02482919dc0bde40920a4738419da02480f3fdb0675909203d0e6c128402481695dd07800091fc4ff743a260247b719de07500091e676784035a0247967fde1bc00091c9dff6c6efd02472782e106720091c22577846380246c25ddc118d4091b0983701e960246e9ffdd00378091b05ff8424c002469cbfdb092f1091a730e740d8002468f3fdc035f4091a3d0b741566024679d9e00c168091925ff84177c0246265dde099780917ffff7402220245d25dde01ba8091682577006e70245a098df0f0f009159167703c390245645ce109000091501677023fd0245405cde048000914b9676c11fd02452e5ce0024000914956778275a0244fdffdf05a0009139dff882f220244b85ddc0bc790912e1867026a60244c0d9dc03798091366677c434402445695de08f580910caff8848c00243e9ffdc122f1090fa80e7041a60243f119dd00e88090f9977802cc402435999db0b301090d66766c1ede0243677fe005b68090d0aff880f6602433359da03d89090ccd76680ba602433719e011568090bb7ff7045570242ee02e00d098090ae7677437da024281ffe0043980909c4678003a202424e5de001d1009091c677404bc0242425dde0cc7809083cff743b400241b77fe103f78090659ff7426220241705dde26778090359ff7815000240c17fdb053f40903060b7c01bc024094d9de00168090251ff741aa6024079d9de16e0009007967705b7d02401e5cdc0b568090131ff74305a023fedffdc0c15c08ffb80b883780023fb67fdc0ddf108feda0e701ba2023fd25ddc0660008ff51ff701926023fd4d9dc05da808ff5a578433c0023f82bfda0cef108fe0b0e8000c0023f81ffe114e9808fcb9677053a2423f2e5d9c10b0008fcfcff7041a6023f4059dc0349808fdd3677c19da023f147fdc0675c08fc520b743540023edf3fdc0d4f408fb7d0b8819e6023ec559d90678908fb157680029a023ec2bfe102d0008faddff7c24c0023e92bfdd10e0008f93cff70437d023e4f42dc0ed0008f95dff8819e6023e3559e21770008f75e676c5dbc423dd79d9f0046808f759ff802880023d977fdc0a1f408f65e0b701aa6023da559dc05e9808f6a167881a16023d767fda0684908f5da0e681200023d7e95e00150008f5c4ff7409c0023d677fde0210008f57cff7804e6023d5a59dd1080008f461677041fd023d185cdc0f00008f47967742a00023cee59dc0a7f408f3b973801f1a023ccf3fdb07c5908f33d0e7827fc023ca25de00081008f2816778371a023c693fdc0dc5c08f1a50b7027fc023c785dde1009808f0a467704023023c291cdd0466808f05dff740066023c1719df0ab0008efb1677c6c00023b0895de11c5808eb05ff704713023ac182dc07a5808eba7ff800240023abf3fe00750008ea72ff741662023a865ddd0b31008e96667702cc1023a599cdc0621008e9b7677c101a023a497fdd24c0008e6d9ff7092fd0239b682dc1e79808e73e677024c0023a24bfde057a808e6825788297c02397719db0a5e108e5dc766c28380239785ddf042f008e5997778020402396459de0946808e4fcff70251702393f42e20439808e4b96774090002392559df0e40008e3b1677038fd0238ec5cdc0420008e453678039000238b359dc0e3f408e2cd737033fc0238b85ddc09c0008e315677022da0238c97fe103a6808e292ff6c0e964238a4c39e02b9808e2676774477c0238525ddc11de408e1498370434402385695dc1096808e15dff841f9e023832bfdc07e6908e0cb0e701d0402383559e000f0008df5e6778590402377e95dc1640408ddfa637006c00237d0d9dd0205808ddd9ff7403c0023772bfe010c9808dc91677043230237245ce220f1008da82576c83c04236a0999d000f008da81677827fc0236785dda09fe408d9e18374014402367719de0090008d9d3678803c002367119dd01f6808d9a4ff7402e20236665ddd1041008d895677cac620234e65ddc2b17908d399867022620235705de00081008d3916780851a02345f3fdc2145c08d17d0b704fda0234947fdc0376808d359ff7c05a602345999e00886808d0ddff74005a0233d47fe20870008cecaff6c21bc4233b2c39b0780008ced9ff88296a02335895dc0a59908cd62667802160233567fdf0c67808cc72ff7c006602331c59dd0090008cc5367806b400232a999e10136808ca92ff780e400232967fdf0589808ca0167840bc402327495e022d5808c7a4ff7820160231767fe20739808c566676c1ce24231599d9b0709808c56967800d1a02314c7fdd0649808c4cd677c0f0002312459de1680008c329677059fd0230ca5cdc0376808c459ff7827fc0230a25ddb09fe408c28983740cfc0230785de201d1008c1c4676c07404230711d9e01f6808c1a4ff800bc402305895e1003f008c15e6780153c0230425dda054e108c1098680025e02303fffdd0469808c0b96774054002302919dd0d96808bfcaff703657022ff2c2dc04a1008c05a57843ba6022fb719de0750008be67677c1a9a022f7f3fde2550008bba7ff802880022ec17fdc0a1f408bb060b700ba6022ede59e00a99808ba5c67 + +def tb_46 : Nat := + 0x7078bd02605682dc1ab98098191677c168002603fffde13500097fcaff6c4d3d025ff2c2df05100097f79ff70143d025fde82de07698097f03677c2a5a025f967fdc0a95c097e5a0b84ac80025ee9ffdc2b1f4097ba80b708dea025f0895dc087a8097dd257780ba6025ede59dd09168097ae7ff702457025eba02dd00c00097a9567786780025e3dd9dc19df40978f77388191a025e24bfd9064590978930e7c0666025e1e59e00c0000977b967702ffc425dee5d9e05f1009775a578001bc025dd4d9dd009f009774977783000025da25de200720097682574c01c4425da0999f04968097547ff800fa2025d425ddf09678097472ff7805a6025d1719dd0f60009736667703d7d025cd99cdf165000972016770593d025c805cdc0ff00097267677828da025c577fdd088980970d567702223025c355cdd12d68096fa7ff6c4b57025bea02db04bf009708977801080025bc059e200168096effff880300025b947fda00bf1096e520e6802a6025b94d9df03888096e1977740fde025b767fdc03f6c096dda0b7803c0025b72bfdf00600096dc4ff8017a6025b5999dc05e89096d66767c0b40025b377fdf02d00096c7967741f1a025aff3fdc07c5c096bfd0b7410e6025aee59dd039f0096b19776c0e79025ac660db01668096b3cff740fde025ab67fde0ea0009685dff7419800259fdffe0033000967c4ff7c12000259df3fdd016980967666778830402595695dd1c8f0096391676c72390258e45cdf04e000963436770137d0258d0dcde046680962fcff74228002589cbfe014100096131ff70503d02584c82dc059880962197778192602581e59db0648c09607973744bfc0257d25ddc12fe4095f4983841f9e0257b2bfdc07e69095ecb0e701bde0257b67fdf02d00095e9dff8866000257417fdc197f1095d060e7065220257425ddf00900095cfcff7c228002571cbfe000198095c7167840780025714d9de12d68095b25ff704b570256c982dc07968095bd9ff8006c00256c2bfde02d00095addff8424c0025692bfdc092f1095a4b0e741e2a02567495e0198000957a4ff6c65fc4255e9439b178980957c4678029400255bfffde05e980956a1677810da0255977fde003a809565a577c315602555f3fdc0c54c09557d0b7405a602555999de0d098095461677034230255185cde061680953ffff7835a60254ca59dc0d68c095329737813da0254b67fe0004980952d567840e4002547719e106f0009516d677403c002545799db00ef409515e7388108002544719dd1c2f0094e99777070b90253a660dc17af0094ee17780139e025392bfdc04e69094e4b0e700fde0253967fde04e00094dfcff844d160253277fdb13449094c9e0e6c3e160253367fe209300094c0aff7024bc425302c39c07ba8094c225780419a02529cbfdc1065c094a730b7c9cc00251ffffdc272f40948000b707e6602521e59dc03600094a3cff7828800251d77fda0a1f409475e0b7403000251d47fdd00888094749777802c40251cf99df057000946e76778537c0251665ddc14de4094599837424de0251417fdc0936c0945060b88012602514059e0004680944fcff7406000250f67fdc017f40943da0b7c33c00250c2bfdc0cef409430b0b701ce60250d999dd029880942e177700a5f0250b860e0003780942ddff801da6025099d9df0a5f00941c1777420160250367fdb0804c0940da0b804566024ff119dc1158c093fc4737c07da024fe93fe106198093f4367701863024fd0dcdf0aa10093dfa5780603c024f1e59dc180e4093c7973705a3c024f2459dc0ef58093d0aff7c0b9a024f12bfde04188093c097778025e024effffdf06600093b51ff780e22024ec65ddf03f78093ad9ff800126024eb559df05400093a81677014fd024ea05ce209ff00939e1776c27f8424e78619e0831009395e677c093c024e4e5ddd0300009390977680bfd024e4260dd050100938b967701401024e2e5cdd0480009385c677011fd024e171ce001f6809383cff7412c0024dfc7fdf027000937caff784c62024da65ddc1317c09369983782604024d8059de004680935fcff7c4140024cc17fe0004680932fcff802280024c9cbfdd0360009323cff7445c0024c497fdc116f40931260b881b00024c2e7fd906bf10930ba0e741bc0024c12bfdc06ef409304b0b7009c0024c24bfdf0f0a8092f5a5780513c024b8559dc144e4092e1573701cbc024bb9d9de04200092dd367801638024b425de000378092d05ff7c0240024b3f3fe00a998092c5367782d5a024ae77fdc0b55c092b9e0b8424c0024ac2bfdb092f1092b0b0e802c40024a967fdf098880929c1778002c4024a4f99dd0016809293cff7c1c80024a32bfde0a8a80928225778243c0249e459e00240009276d67743f000249977fdc0fbf409265e0b8806ea02499095da01b99092642666806e40249909bda00c00092651ff6800ea02499695df028e009261977785cc402492999dc173040924a67370488402493dd9de0a9680923fcff7805a60248f999e00ff000922e7677842c002487719dc10af40921dc737c1e8402485895dc07a0409216263 + +def tb_47 : Nat := + 0x6c0fda4279d6839b03b1009e75e67781c800279b9ffdc071f409e6e80b8010e60279a919e00466809e65dff70119702799782df063a809e5fa577018e702797e98df1710009e459ff705c3d02791682df05d0009e3fcff7830000278cf3fe21279809e215677049e24278855d9c0b38809e28977842eda0278567fdb0bb5c09e15a0b7414220278425dda0507c09e10983802bc802781695dd01d5809e03cff841e000277f13fe20139809dfb167840dda0277de7fde1a7a809ddd2577069e702777498dc1129809de6767780dda0276d67fde0e70009da72ff7039bd02769cc2e00169809da5c6780068402769095e214af009d8f7677052b842763ddd9c14a0009d8f8577047160276497fdc0d8f009d969677022bc02766dd9dd05df009d89977744ede0275d77fdc13b6c09d75e0b781dd6027582bfde10e0009d4fcff6c437d02753f42e00180009d3d9ff783f660274b719dc0fd8c09d2dc737403c00274b359e010bf009d1c177741e000274525dda077f409d149838002c402744f99e00016809d13cff7819e602743559e21e51009cea4677079404273a91d9c1461009cf43677c03c00273a559dd0436809ce51ff78641a0272cf3fde0679809cad56784597c02724719dc165e109c91c7670523802724e5ddc13a5809c947ff7c071a02723fffdd2668809c6997770999f0271a660dc1350009c7caff7c0fde0271967fe100f0009c64aff7c3c2a02715695e00bc5809c49dff8024c0027102bfdf1050009c305ff70413d0270c182df01f9809c2e6677007e30270b99cdd0510009c29567842b80027079d9dc0adf409c1e7737c2d5a02704c7fdf0540009c0ddff7c090002702e7fe00270009c092ff744fe6026fd4d9e10016809bf51ff8821c0026fb2bfdb086f109becb0e6c1e00026fb67fde0ee9809bddc67703ba3026f771cdf0826809bd59ff6c2097026f5682db07a1009bd62576c10bc026f665de00208809bd39777c66de026ee77fdc19b6c09bb9e0b703204026f1c59e10889809bb1567800dda026eb77fe20109809bacd675c0422426eb35d9e0270009baa66778521a026e577fdc1485c09b95e0b703504026e7495df01f9809b93e67741cda026e32bfdf0a8a809b82257780204026de459dd0240009b76d677803c0026dd799e10046809b759ff7c3126026da559dc0c48c09b69573702e26026da859e104d5809b5c4ff681352426d71439a04bf009b5c6676811d6026d72bfe00270009b59dff7829a6026d3dd9db0a68c09b4f7736c1b00026d4c7fdb0379809b566676c0d26026d5a59e20510009b4a66764143c426d299d9f02d0009b47967743000026cee59db0bff409b3b973881b00026cb9d9dc06bf109b2e776700e7c026cc65ddc02a0009b3296770059a026ccf3fdd00d6809b2d9ff783f66026c7719dd0180009b1c467742826026c2e59de05d0009b05c6770173d026c171cde01f6809b03cff7007d7026c0f42df0c00009af7cff782622026bb85ddd0037809aeddff7894bc026b225ddc252e409ac89837860de026ac17fe10300009aa1257700bfd026a8498de0ec5809a925ff703b13026a4982e208c8809a899776c231e426a2661a10319809a86167805e800269b9d9dc179f409a6e77378071a0269b2bfe20418809a6897764105e4269a261a21800009a50977705ffc426942619c1500009a5397770505e026951ffde0b61009a45367702d81026914dcde05b6809a3f7ff841ec00268df3fdb07af109a37d0e6c16800268e77fde0be9809a26767702fa3026899dcdc0930009a292ff78198002688059e00c46809a13cff6c311702684f42db0c30009a13e677819e602683559de04bf009a089777012f902682260de0e178099fa7ff78071a0267bfffdc01c5c099f000b781aa60267a559da06a8c099e95737c0ec402679695dd06000099dfa577017fc42677e99a002f58099dcaff7801800267713fdd02700099d9dff7c455a0266edffdc1155c099bb80b7030fc0267025ddc08268099c4aff701cda0267167fe013698099a8167704da24266a05d9c135a8099a8257741e5a026681ffe0026880999e177881d0402665b59dc0740109996d767012000266665ddf02568099947ff781fda0265fc7fe1088680996ddff6822164265b783a1183a809955a576c60e702655698df1c0e009939977880fde0264d67fdc03f6909935a0e801ce60264b999dc0738c0992e67374821a0264377fdc2085c0990de0b706d1a02644c7fdd024000990b9ff801bc0026412bfde06498098fe66778221a0263d77fdc0885c098f5e0b8000ea0263d695e000858098f51ff840a260263ca59e004f68098ed9ff6c13d64263b683a00c498098e156780029a026382bfe128e00098b7cff70a37c4262df439c26d00098b9dff708c400262f67fdc1b798098c536770660002631cbfdd01098098b156778450002628059db113f4098a0173744b0002623559dd105f009871c677c0d1a0261b9ffe00471009865a577c01c802618495dd038580985d9ff780d2602615a59e005e6809850aff7c2c400261167fdb0b0f409845a0b8047400260cf3fdd1e300098159ff + +def tb_48 : Nat := + 0x704016429017839c0ed000a407167702e8002902919dc0a5000a40b96770179a02903fffe0181980a3edc67706062428fb71d9c17c880a3ee1777056a6028fc0d9dc0e4000a3f79ff8437da028f7f3fdc0df590a3dfd0e70209a028f967fdf02aa80a3dd257845238028f225ddf067200a3c2257800dda028ed67fdf05af00a39b7677016b9028e6ddcdf04e000a3969677410da028e497fde0c4980a3861677c9ffc028d785ddc27fe40a35e1837041c4028dd695dc0a8000a37b967743804028d4059db0e0040a35017374239a028d1cbfdb08e5c0a34730b742640028cf67fdc098f40a33da0b701ec0028cfdffe1060000a3379ff6817fc428cde839a05d000a337cff781bc0028cc2bfdf02e980a32dc67700ba3028cb71ce2036000a32a667680d7c428ca99da2013680a3292ff7c0ae6028c99d9df00d680a3259ff8403c0028c92bfe1089880a31c17768225e428c7061a2063780a315dff5418da428c57839d199980a2fc4678415c0028bdb59db056f10a2f6d766c12c0028bde59dd00f000a2f5e677842c0028b2e7fde060000a2c59ff6c17fd028b1682dd05d000a2bfcff6c173d028aff42e20a9980a2b5367702a62428ad4dd9c045000a2bb7ff7010e6028aee59dd001680a2b51ff7c5280028a81ffdc149f40a2a080b8018c0028a693fdd037980a296d67840cfc028a4e5ddd039780a28ffff7816e6028a2919df00f000a289567740540028a1719e106a680a27f1ff740b400289f13fe00bc580a249dff7424c0028902bfe10b1000a2359ff6c2c3c4288d683a01dd000a217cff70773d02885f42dc108000a2251ff7438e20288265de2006780a2092ff78066602881e59e202e680a204aff5c0b96428812c39d091980a1fb9677024630287ee5cde08b680a1e9dff7451000287567fdc143f40a1d5a0b702f220287785ddf058980a1d01676c16230287405cdf004680a1cfcff7848c00286f67fdc122f40a1bda0b7045660286f9d9dc0ab000a1c51ff840f000286e77fdd0d0980a1acd677034230286b35ce003a680a1a92ff7434620286705ddc0d17c0a19c1837c8c040285e459dc230040a179173782a5a0285b9ffdf0d9680a15caff7c3000028542bfdf013980a14f767800a8002853359df0cd680a13ffff70335702850002de019980a13e667800b400284ee59e00df680a12d9ff7037d64284b683a024c780a103cff70931b02840f42dc22f200a105a57708b4402841719dc189780a10ffff705b4402844719dc12f780a1159ff704ac402845799dc127200a116257841c800283f2bfd7071f10a0fcb0e5c18c00283f67fe0006000a0fc4ff7c04e60283ec59de09c000a0f15676c26fd0283c55cdb037680a0f79ff7404800283c0d9df021f00a0ee1777800de0283b77fde001980a0edc678436c002838059db0daf40a0e01736c209a0283967fdb075000a0e676780965a0282e9ffdc2595c0a0ba80b8805a60282e459e00f0000a0aa167703bfd0282a85cdc0a9680a0ae7ff7403000282a559de04e000a096967841c8002823dd9de05df00a089977782cc40281f999dc0b3040a07e67388221a0281d77fe0062100a06e76778035a0281b67fde050880a0689777c01c80281a095de04b000a0591676c12bd0281645ce0049680a0547ff843b6a02811695dc0ed9c0a045a637010800281417fde080580a03d9ff7020130280f682dc072f00a03e767780a260280ec59df013680a039dff7809000280de7fdc023f40a037a0b8404e60280d999dd051000a0315678804800280c0d9dc011f10a0303767004440280c115e20e4f00a01c177703938428070619e063780a015dff7c6e40027fe93fdc1b8f409ffa50b706d80027fe9ffde04b0009ff59ff781ce6027fb999db0738c09fee67384251a027f947fdb0945909fe520e781e00027f767fe00cf0009fd0aff741440027f2e7fdd0ba0009fbffff7c11a6027eee59df0676809fb51ff7019d7027ed482dd0d09809fa8167703423027ea05cdf0ae0009f9d367702b7d027e74dce207d1009f91c67701f40427e471d9c0600009f939778418c0027e2e59db062f109f8b976800840027e0f3fda020f109f83d0e6800ea027e1695de0450009f7f7ff80c780027d367fdb31df109f4da0e740f00027d277fe00930009f40aff8421fc027cc25ddc087e409f309837c031e027cbf3fdc00c6c09f2fd0b742280027c9cbfe0018a809f25a577c0216027c947fe20150009f23cff7c08e2027c865ddd09c7809f17cff8812c0027c4c7fd904af109f1320e780300027c497fdd11c8809f0097770471f027c0260dc0930009f092ff84145e027bedffd90516909efb80e801680027bd77fde0088809ef49777c02c4027bcf99de1336809ee0aff704cd7027b82c2dd0030009ee07ff7c2b80027b567fdc0adf409ed5a0b740822027b4e5ddf0300009ed0977805ade027ae77fdc16b6909eb9e0e782226027ac559dd0480009eacd677011fd027ab35ce003a6809ea92ff78302a027a7495de0745809e95dff740522027a525de200c7809e93cff741c80027a32bfde05df009e7c4678407da0279e93fe103f7809e759ff + +def tb_49 : Nat := + 0x88150002a8b559dc053f10aa2d57680444002a87119e201f680aa1a4ff80090002a85b59e2051000aa11c676c143c42a8471d9e0be680aa05dff702f9702a81782dd021000aa03cff781e0002a7f13fdd0e3880a9ee17778120002a7a65ddd03f780a9e59ff78262202a7705ddd063000a9ba7ff744d4002a69cbfdc134f40a9a730b7041a602a6a859dd1d9880a98997770765f02a62660dc0bb980a99b767742b8002a5d47fdd087000a96caff7c60c002a551ffdc182f40a95480b880fa202a5425dd703e790a9509868800de02a5417fdd009000a94fcff7c10e602a52e59dd05b680a93f7ff78246602a4d999dc0918c0a93667378228002a4b719db089f40a92dc7380125a02a4a4bfdd138a80a915a5774005a02a44f3fdf051000a8f1c6774308402a39695db0c2040a8e5a6384144002a35999da050f10a8d667684264002a33359db098f10a8ccd7680209a02a312bfdc0825c0a8c4b0b7c106202a3025ddd009780a8bffff78066602a2f999dd02e680a8bb7ff84192602a2d4d9e2063000a89a4ff7018bc42a26943a000b880a899977780ec402a25799e1024f00a8939776c093842a24e61a201d100a891c67740dda02a2177fdc0375c0a885e0b78198002a1fdffde02d000a87caff803b4002a1b77fd90ecf10a86de0e7c472202a1705ddc11c7c0a85c18370210002a1967fe10e7780a84d9ff6839da42a136839f196980a8343676c65a302a0d0dce1039f00a8309777800de02a0c17fdf067980a82956778089a02a09cbfe0036000a823cff7c101a02a0497fdd11c880a8009777c145e029fedffdb0516c0a7fb80b781680029fd77fdd014880a7f49776c051f029fd260df06f780a7ed9ff743480029f81ffdc0d1f40a7e080b7c0ae6029f7719e1082680a7d59ff6c2097029f5682de050880a7d09777c1404029f2e59dc050040a7cb9738819da029f147fdb067590a7c520e6c1980029f14d9de13c980a7b1567704f23029ec55ce10ca680a7a4aff703296429e92c39f0ed000a795dff780522029e525dde06f780a78d9ff7814c4029d9095de07d580a75c4ff7c58e6029d1859dc1638c0a7461737052e6029d1e59dc11e980a74a667703366029d3dd9e107b000a73e667681ebc429cf99d9e02d000a73b9678019da029cd47fda067590a73520e881e00029cb67fdc077f10a72da0e700a26029cca59dd033f00a71e17780385e029c3fffdc0e16c0a71000b7816e6029c2919df08f580a6fcaff742d66029bc559dc0b58c0a6f1573740dda029bb77fe2075000a6e6767641d3c429b99dd9906f000a6e6d6774071a029b92bfdc01c5c0a6e4b0b741eea029b0895de017580a6c0aff7c4140029ac17fdf01e000a6ae7ff70077d029aba02df046980a6aa167781380029a94d9de0ea000a696967703a7d029a5a5cdc041100a6a1257700e7c029a865dde003000a6966678834da029a24bfdc0d3590a68930e70333c029a265ddc06f000a68f7678850400299d47fda140f10a67520e8804e60299cf99e0133680a660aff704cd6429982c3a00d8000a6509777035fd02994260dd050100a64b96778090002992559e109d680a63f7ff7027570298fe02dd07b000a637cff701ebd0298df42df003000a6379ff7419260298c559dc0648c0a6315738012000298b359df04c680a6259ff743f000298577fe2003a80a615a575000e642985699a2080580a60d9ff6c2012429836839b072f00a60e7676c075602984f3fdd02e980a5f79677432400297a919dc0c8f40a5ea47378119a0297977fdf063a80a5dfa577018e702977e98dd11c580a5cddff70471302973782dc05c580a5d9dff7010bc02976dd9df024000a5cb9ff742f400296ff3fdc0bcf40a5bfd0b702c220297025de00c0000a5b3cff8815660296b9d9dd065100a5a82577c2f7c02967119dc0bde40a59c47370297c02967719df07c680a5947ff701f1702965202dc02af00a5999777403a202964e5de0080100a58b96768200042962e5da20ee680a57caff703b964295f2c39e0b5980a57156774139e029592bfdc04e6c0a564b0b88126602958059d5049890a5601767499fc0294e65ddc267e40a539983800fde0294d67fe2016980a5343675405a24294d0dd95015a80a534457780f5a0294c17fdc03d5c0a53060b7c2aea02949695de0dd580a517cff70375302945f42df016980a51666778221a0294377fdc0885c0a50de0b7c3de60293f999db0f78c0a4fe673840b400293ee59df0d2000a4ee76770347d0293b9dce1185100a4d625770614102935898dd008580a4d59ff7c054002931719df082680a4bd9ff7c81ea02927495dc2079c0a49d26370762602928059de093f00a493e678803c00291d799d500ef10a475e7684120002919719dc047f10a465c7670119a0291977fdd002100a465a577c20160291767fdc0804c0a45da0b7010380291865ddd00f000a45caff7c282602912459de093000a43e66774251a0290d47fdf06a980a42e76788177c0290a25dda05de10a42898668125a0290a77fde0ad100a41dc67702b410290771cdd07a100a4162577c00fc02905799e1100680a405dff + +def tb_50 : Nat := + 0x6c22e602c19719de018000b064257881a1602c1767fdb068490b05da0e74054002c1713fdd05b980b0569677c1c8002c13dd9e0066000b049167780c0002c11859dc02ff40b04617388630002c0b559db18bf10b02d5766c61da02c0b67fdb17a000b02e767805a0002c05b59db167f40b016d737803c002c05799dd042000b011c6770107d02c0471ce1012f00b01097784025e02c03fffe00a5a80b005a57805f7c02bfb719dc17de40afedc73705e3802bfb85ddd042f00afe99777c271e02bf7f3fe0300000afafcff70bffd02bebf42dc1daa80afc225778054002beb9ffdd046980afaa1677c030002bea559e103b100afa5a5784060002be9095dd005580afa3cff7c8f4002bdffffdc23cf40af8000b7070e602be1e59dd046980af7b9677011a302bdee5ce0066000af75367742d5a02bda77fdc0b55c0af69e0b70027c02bdd25de1093000af60aff6c24bc42bd82c39b088980af615677800de02bd417fde004980af5016778191a02bcfdffdc0645c0af3f80b70024002bd14d9df006000af3f1ff7804da02bce77fde078000af325ff7c00de02bcb77fe0010980af2cd67785bda02bc577fdc16f5c0af15e0b70330002bc8059df0d4880af089776c351e42bc22619b093000af0caff88385e02bbe9ffde0a8000aeeffff7c288002bb977fe10c0000aed9dff702ffc42bb67839c0a6980aedb7677c3de602bb2999db0f78c0aeca67378131a02bb167fe000f000aec4aff7812c002baffffe0019980aebe66770066242baf99da102d000aebb967801f1a02bacf3fde169980ae9d367705a6302ba74dcdc135000aea07ff801d4002ba5799e2016680ae947ff8803a202ba4e5de1095100ae8a4677c19da02ba0f3fde078000ae7c4ff701dfd02b9f142e0048000ae77cff7405a602b9d999de28c680ae4d9ff88522602b8e459da148890ae3917668502202b8e65ddf154680ae23cff70551702b88f42dc090000ae301677c0c8402b879d9dd00c000ae125ff742b2602b81e59dc0ac8c0ae079737449da02b7d47fdc1275c0adf520b70305a02b7edffe10b4000ade9dff80412202b7665ddc1047c0add9983840dc802b75895de038100add0167700e0102b7405cde0ab000adc51ff7c1e0002b6f67fe20b4000adb25ff682cfc42b6c9839a0a8000adb31ff681ce602b6d999e0093000ada92ff7024bc42b6a4c39e149880ad94977806e0402b5e459dc1b8040ad79173741d4002b5c719de0c0000ad65c677c128402b58495e20abf00ad56667702af842b5599d9c0a8f00ad5696770255602b55f3fe1034680ad531ff80360002b5167fdc0d7f40ad45a0b80168002b4ffffde126000ad2d9ff88012602b4b559df0f9000ad1dc67703e3d02b4771ce006f000ad16d677c02c402b45895e1045f00ad11c6770117842b4471da119f680acf7cff7067d642b3df43a2003000acf79ff7c5e2602b38059dc1788c0ace0173704bc002b392bfdf03ff00acdc177748a0002b2e65dde03f780acb59ff781c8002b2b9ffdf045000aca5c6780024002b294d9e0016680aca3cff7c3c0002b21e59dd11b680ac75dff7046d702b1d782dc079680ac7ffff8002a602b1d4d9e1008880ac74977782ade02b1a77fe0048000ac5997784260402b14059dc098040ac501737024de02b1417fde08e680ac472ff80204002b0fc7fde018000ac3d9ff781ce602b0d999dc0738c0ac3667374213c02b0b85ddf003780ac2ddff78472202b0705ddc11c7c0ac1c183781e0002b0525dde185100abfc4676c614102aff11cdd01f680abfa4ff7c12c002afd67fdc04af40abf5a0b7c162602afc059db0588c0abf017378036602af6dd9e00ac680abd0aff740b9a02af12bfdd041880abc09777c2dde02aed47fdc0b76c0abb520b781aa602aeb9d9df00d680abad9ff80012602aeb559e1079680aba07ff8826a602ae5b59db09a890ab96d766c1ba202ae665ddd00f000ab95e6780179a02ae3fffdc05e5c0ab9000b8411a602ae2e59e005b680ab85dff7016d642ae1783a2001980ab85c678807da02ae0f3fd701f590ab83d0e7c12c002adfc7fdd075000ab77cff7405a602add999e2051000ab71567789dda02ad277fdc2775c0ab49e0b708eda02ad367fe0093000ab40aff741c6202ace65ddd09c780ab2fcff70271b02acbf42de08a000ab272ff7c0d8002ac8f3fdd1a3880ab0997780019e02ac24bfe0048000ab04aff6011fc42ac12c39e0f7980aaf53676c3de302abd4dce2001680aaf51ff78281a02aba77fdf22c980aac7167708b2302ab1c5cde14b680aab25ff7052d702aac982e007f980aaaa667701fe302aaa99ce104c680aaa59ff78a56602a9f119dc2958c0aa7c473708dea02aa0895dc18f000aa8caff70474002aa4f3fdc110880aa94977741a9a02a9d67fdb06a5c0aa75a0b6c198002a9d799db057000aa76d677c168002a9bfffe10e6880aa6197778271e02a95f3fdc09c6c0aa57d0b8804e602a95a59d5013890aa569768009c002a942bfde013980aa4f76778144002a92999df045000aa461677401da02a9167fe005d000aa3fcff802ac002a8d47fdf028980aa32967 + +def tb_51 : Nat := + 0x741ba202dbd25ddb06e7c0b6f49838802c402dbcf99df057000b6ee76778198002dba059de0a5a80b6d62576c296702db5898de028e00b6d39776c0a3502db4e60e1030000b6d0977781e5a02daf67fdc0795c0b6bda0b7c33c002dac2bfdc0cef40b6b0b0b880f6602dab359dd1f8000b68d567707dfd02da355cdc190680b693cff7060fc02da525de000a680b68caff8841a602d9f119db106890b67c476740abc02d9e65ddf008100b6791677c3c0002d9a859dc0eff40b66a17374114002d99719dc044f40b665c7384128402d98495de027000b659dff88084002d95f3fe1085980b64f76770216302d93ddcde02a000b64cd6778114002d91859e11d7f00b6289778449c802d85895df058e00b6109776c163502d84260df0af200b605a577830c002d7de7fdc0c2f40b5f7a0b781da602d7c0d9de027000b5edc677c4d1602d7277fdf093000b5c0aff841c6202d6e65dda071790b5b99867c271e02d6bf3fdf05b980b5aa1677016e302d6a85cdf05f100b5a42577017c102d69098dc047100b5a5a577416bc02d679d9e107e000b59696778019e02d624bfe2154980b573e6770552242d5cf9d9e23d000b550167708f3d02d5405cdc15cf00b55e17780011a02d53f3fe010b000b53f1ff6c42bd02d4fc82db0a9980b54536778330002d4c97fdc0cbf40b53260b701e0002d4de7fe001b000b530aff8401e602d4c0d9de027000b52dc677464bc02d4525ddb192e40b5149837802c402d44f99de001680b513cff785e2602d3f119e001f680b4fa4ff7809c002d3c719e101b000b4f016778174002d3a919df00f000b4e9567781efc02d3865ddc07be40b4e19837c139e02d372bfde02d000b4d9dff74300002d3377fdc0bff40b4cde0b78090002d32e7fde106980b4b536774005a02d2d47fdd038880b4b19777c260402d2a059dc098040b4a81737025c802d2a095e0289680b47f7ff70a25702d1fe02dd02d000b47caff700b3d02d1f2c2e1131880b46997774271e02d17f3fdc09c6c0b45fd0b7428aa02d15695de01b000b42e6677c144002d0a559df020880b40997774139e02d012bfdf0ed000b3f5dff7c02a602cfd4d9dc00a8c0b3f53737c054002cfcf99de015000b3f29677c479a02cf82bfdf02e980b3ddc677c024002cf74d9de060f00b3d016770183902cf405cdd048000b3cb96788119a02cf1cbfd7046590b3c730e74348002cec559dd037680b3addff800de602cea999de168000b393e677059fd02ce4f9cde17a000b37c4677803c002cdd799dd042000b371c6770107d02cdc71cdd087000b3695676c21bd02cda55ce0039000b365c6774128402cd8495dd215580b33fcff70855302ccff42dc0e0580b3531ff702a3c02cd5a59dd0a9980b335367702a6302ccd4dcdf016680b333cff70059702cccf42df00d680b32d9ff74456602cc7119df01f680b31a4ff7c04e602cc6459dd02f100b3162577400fc02cc5799dd004680b3159ff803f0002cc177fdc0fbf40b305e0b74006602cc1719dd097680b2fc4ff74120002cbdf3fe2003000b2f79ff841da602cbc0d9e2021f00b2ee17778014402cbb719db005040b2edc737c245a02cb92bfde049980b2e016774011a02cb7f3fdd300000b2afcff70bffd02cabf42dc2f7000b2b05ff782a6602ca94d9db0a98c0b2a53737c3b4002ca5999dc0ecf40b29667374101a02ca497fe0093000b2892ff7024bd02ca24c2dc08c880b289977800c6602ca1859df07b000b27e6677424c002c9d4d9de06c000b26e7677c035a02c9b67fdf057a80b2682577483d602c91cbfdc20f4c0b24730b704e9602c951ffdc0a0e00b25e17784306602c8ec59dc0c18c0b23b1737c2b8002c8c0d9e2036000b22cd676c0d7c42c8b35da203a680b2292ff680e9642c8a4c39e069000b20d56778029a02c832bfe0041880b20897788620402c7c059dc188010b1f01767060de02c7c17fdc16d100b1f1c67741b0002c7a559db06bf40b1e9573780ec402c79695de02f580b1dcaff743b4002c7377fdc0ecf40b1cde0b700b4002c7677fde037980b1ca6677c0b4002c71e59dc02cf40b1c79738807da02c7167fde0a2000b1bb7ff70287d02c6ee02e11e4980b19d36770792302c674dcdc1b0000b1a07ff800b9a02c6693fdc02e5c0b19a50b78222602c64719de078000b18a467800cc002c61c59e2193680b16ddff7064d642c5b7839c10b000b17666778372602c58059dc0dc8c0b16017384a20002c4de59dc287f10b137976709c0002c4e459dc267f00b1399777c07da02c4d67fdf058980b1301678891da02c42e7fe2190980b0f296770642242c3ca5d9c18fa80b0f2a57705f4002c3cf3fdc17b980b0f3e67705a0002c3d47fdc0d3980b0fe6677c108002c3b9d9dd00d680b0ed9ff7403c002c3b2bfdf02d000b0e9dff7c258002c381ffe100e100b0dd36778335a02c3417fdc0cd5c0b0d060b80024002c33f3fde01f980b0c5367787e5a02c2967fdc1f95c0b0a5a0b704f8002c2c559dd058980b0a0167740ffc02c2705dde063780b095dff784eea02c20895dd034680b06e7ff88236a02c19695db08d990b065a66 + +def tb_52 : Nat := + 0x78005a02f3d47fe0170880bcde177705c1f02f37860dc14a000bce07ff7c3bd602f31cbfdc0ef4c0bcc730b700a3802f34e5de2001980bcc716744006242f31c5da1015000bcc5c67746b4002f2a999de013680bca92ff74246602f28059dc0918c0bca0173840bc402f27495e022d580bc7a4ff7804e602f1e459df135000bc65c67743d8002f15999dc0f5f40bc5667370209a02f1767fe2064980bc4cd6768192242f1335d9a055980bc4dc6768150002f1377fde073680bc459ff701cd702f11682e2074100bc2156780074402f07119e101f680bc1a4ff7410aa02f05895dc0429c0bc162637800fc02f05799df05e680bc0ffff70179702f04002de015000bc0a4677c128402f01695db04a040bc05a637423d602eff2bfdd0ee980bbedc676c3ba302efb71ce2075000bbe6767681d3c42ef99dd9a06f000bbe6d677c1a9a02ef7f3fe2283980bbb796770a0e242eede5d9c26b980bbb9167741cda02eec17fdd0a9980bba5c6778068402ee9095dd030000bba1257680bfd02ee8498dd05af00bb9b7676c16b902ee6ddcdd1d1000bb7e66770743d02edf99ce102d000bb7b9677416da02edd77fe017c880bb5e177705f1f02ed7860de005100bb5dc677451c002ed2559dc146f40bb4957370251a02ed51ffe0022680bb472ff7405a602ed1719df002100bb45a577c01bc02ed14d9e109d980bb2dc6770276242ecb71d9c09c000bb2ddff70262202ecb85dde036000bb2a6677416da02ec92bfdc05b5c0bb24b0b7c3c2a02ec5695db0f09c0bb15a638023d602ec32bfdd126000bafa4ff8011a602ebd799dc0468c0baf5e73700de602ebdb59dd05e680baeffff74288002eb977fde003a80bae5a577c255602eb713fdc0954c0badc50b70201602eb767fde10b000bacb9ff7042bd02eb2e82de018000bac7967781f1a02eaff3fdc07c5c0babfd0b78114002eaedffdc044f40babb80b8038a602eab559e2111000ba9c4676c443c42ea711d9b102000ba9d367800abc02ea665ddb02ae40ba99983800b0402ea5b59de0b2680ba7f1ff702c9702e9fc82e108b980ba766676c22e242e9d99da0051000ba7156778461a02e97f3fdf283980ba379677449da02e8947fdc1275c0ba2520b74762602e81e59dc1d88c0ba0797370660002e82e7fdf0c0000b9fb967741ec002e7cf99dd0a0680b9e9dff74072602e7a059e1079680b9e07ff7c0d2602e774d9df054000b9d05ff7014fd02e74182dd0a9980b9c5c67702a6302e7171cde082680b9bd9ff70209702e6f682e10b4000b9b25ff6c2cfc42e6c9839b0a8000b9b31ff6c1ce602e6d999db05d000b9b7cff7c120002e692bfdd089880b99c1778439de02e6367fda0e7690b98da0e68368402e639d9e100f000b98caff6403bc42e632c39f0a8a80b98225788177c02e5f119de01f680b97a4ff742f4002e5b9ffe200f000b9695677c20c402e58495dc083040b961263740e1602e5767fe1072000b94f767780a8002e53359dd027000b94a66780114002e51859dd064680b93fcff6c191702e4ff42e2016980b93e66778594002e4a059dc164f40b92817378189602e43fffdc0624c0b91000b7c296a02e41695e00dd580b8f7cff6c375242e3df439f003000b8f79ff801da602e3c0d9db0768c0b8f037378095a02e3b77fde001980b8edc677c209a02e3967fdc0825c0b8e5a0b7c1e9602e2e9ffda07a4c0b8ba80b8005a602e2e459dd037680b8b59ff74142202e2c25de10b6100b8a5367702d8102e294dcdf011100b8a425774015602e28f3fdd02aa80b8a12577c0abc02e279d9df186000b88616770617d02e2185cdc14df00b8899777440da02e1d77fdd014880b874977801f9e02e1b2bfdc07e6c0b86cb0b740b4002e1a77fde007200b86825784283802e1785dd90a0d10b85e186641e9602e181ffde048000b8599777c021602e1147fdf05a000b83f7ff7c078002e0f67fdc01df40b83da0b78180002e0de7fdc05ff40b837a0b70174002e0df3fde05b680b830aff7c300002e092bfdd089880b81c1777c19c802e05695dd01bf00b813e6774005a02e04f3fdd195000b7fa7ff7800c002dfe93fe002b980b7f79678006c002dfd799df042000b7f1c677c06c002dfc059df00c000b7e51ff7451c002df42bfdb146f40b7d0b0b880f6602df3359d903d890b7ccd76640ba602df3719df091680b7bffff8000c002deff3fdd043980b7bb9677419da02ded47fdb0675c0b7b520b74342602dea059dc0d08c0b7a8173841e5a02de81ffde026880b79e17784120002de665ddc047f10b799986700f1e02de693fdf051780b7947ff7803a202de4e5ddf039780b78ffff7c11a602de2e59e0024000b7895677404da02de177fdd066000b77f7ff7c0cc002ddf13fe01c3980b76016784011a02dd7f3fdf0a2a80b755a57882f1602dd277fdb0bc490b749e0e7c90ea02dc9695dc2439c0b725a63708ac002dc9cbfdc1a1000b72fcff70652202dcc25ddc104880b7399777c021602dc947fde015000b723cff8408e202dc865de1032100b71e7677c27c002dc24bfdc09ef40b70930b7c226202dc025ddd051780b6fb7ff + +def tb_53 : Nat := + 0x800540030e2919e20b2680c37f1ff742c96430dfc839d0b1000c37f367742b1a030dfdffdd067680c383cff741200030e1719dd046680c385dff7809c0030df2bfe104e000c377cff68137c430ddf439e17b980c360167745ee3030d805cdd0e3880c3699777849da030d367fe01d4000c3305ff7474fd030cc182de115980c31e767744563030c79dcdd0c0000c323cff702ac0030c947fdf0c1680c3125ff7824c0030c24bfdd092f40c30930b742322030c265ddf169980c2f2967745a63030bca5cdd138a80c2f5a57744d40030bd77fdd048000c304aff801080030bb9d9de009000c2cfcff882d00030ae77fdf144000c2a59ff7450fd030a9682dd0f7980c2aa6677424c0030ac2bfde098880c29c17784211e030a4f3fdd084690c293d0e7420c4030a4f99dd078000c29497780011a0309d67fdf072000c26e7ff84296a03099095dd0a59c0c2642637422800309977fe009c780c257cff8435a603092999e00c0000c23e6677c573c0308a25ddd15ce40c228983743fc00308b9d9de037680c2159ff88474003080f3fdd11cf10c203d0e742d6603082919db0a0980c20b9678058260307b719dd160890c1edc76741e000307f13fde082680c1e59ff7c8dea03070895dd2379c0c1c22637474220307225dde063000c1ba7ff7800de0306c17fdf0aba80c1a5a5778075603068f3fde055980c19e7677c72ea0305d695dc1cb9c0c175a637049800305ffffdc11c880c18097770312603061859dc08c880c189977701b0003062e7fde008580c1751ff781f9e0305b2bfde02d000c169dff7c05220305a25ddf0a8000c15e1777029fd03057860e1050100c15916788125a030551ffd7049590c15480e5c120003055259e20b2980c14956784275a0304fdffdb09d590c13f80e8816800304e77fdb059f10c139e0e6c15a20304e85de1024000c1379ff8026220304b85dde07a100c12676784434403045695df08f580c10caff8410620304225dde16d100c0f1c67745b410303c71cdd0f0000c0f997770391e0303e93fde078000c0ea4678022bc0303865de10b3100c0d66676c2cc04303599da005b680c0d0aff88144003032e7fdd050f10c0cba0e74138003032f3fdd03d980c0ccd677c74a60302b9d9e008af00c0939777022b903024e60df012f00c09097778d2000301705ddd347f40c05c18374abde0301967fdd2a8100c06616774a884030199d9dd270000c0699777498c40301a999dd22d100c06dc67748ade0301b77fdd228000c06e177747d040301c559dd13e780c07caff74331e03020f3fdb0c7200c0842577c99de0300d67fde0c4980c029567782b80030079d9dc0adf40c01e7737c204003005999e1034680c0131ff782e2603001e59de079680bffffff78120002ffedffe205a000bff5dff84005a02ffd47fe1037980bfdd367700de302ff74dce0048000bfc71677c07da02ff147fe106a980bfbe767841a9a02fedf3fda06a590bfb7d0e88300002fe92bfdc0bff10bfa4b0e70192602fea999e2074580bf95dff78084002fe4f3fde067980bf8d5676c19e302fe355ce217b680bf759ff705ed642fdd6839d05a000bf6ffff8817a602fda859db05e890bf6a1766c176a02fda895db05b980bf6a46784030002fda559de068580bf5d9ff7c0f0002fd677fdc03bf40bf59e0b7c40e602fd1e59dc1038c0bf479738824c002fcf999dc092f10bf3e676740b4002fcee59e0013980bf329677c27fc02fca25ddb09fe10bf289866c22da02fca77fdb054000bf2d56774020402fca059de09ff00bf1e1776c27f902fc7860e1050100bf1916770140102fc645cdf0ed000bf0a46780119a02fc177fd7046590bf05e0e7c006602fc1719df0ab000befb167880d1a02fbdf3fe1079980bef036778408002fb8059dd02f100bedd2577c6c0002fb0895de07a580beba7ff74300002fab9ffdc0bff40beae80b702ac002fabf3fdf075000bea72ff78166202fa865de1051000be966676c143c42fa599d9e040680be925ff84191a02fa24bfda064590be8930e746e4002f9b67fdb1b8f40be6da0b743f6602f97719dc0fd8c0be5dc73703e2202f9785ddd042f00be599777c020402f96459df049680be547ff7c12c002f93f3fde067980be495677019e302f9255cdf042000be45367784b5a02f8c97fdc12d5c0be3260b88050402f8b359df03a680be292ff780e4002f8967fdc038f40be25a0b78442202f8525ddb1107c0be149836c3fea02f85695de074100be0d56774029a02f832bfe015d980bdf6d677c03c002f7d799df01b000bdf4367785a5a02f7767fdc1695c0bddda0b8003c002f772bfe002d000bdd9dff6c0b3d02f76782dd25ba80bda82577096e702f6a098dd000f00bda816780074402f67119dc01d040bd9c47370038402f674d9e001f680bd9a4ff7c02e202f6665de2104100bd895676c410042f6255d9e09d680bd7f7ff740b4002f5f13fdb02cf40bd7c50b88020402f4e459df018000bd3796780774002f45f3fdb1dcf40bd17d0b7c05a602f45999de15cf00bd0097770573902f40260e2050100bcfb9676c140042f3ee5d9e066000bcf5367 + +def tb_54 : Nat := + 0x741356032d713fdf066000cb3536784005a032cd47fde015000cb33cff781566032cb9d9df00d680cb2d9ff7c42c0032c2e59dd10af40cb0b973741a9a032c567fde05b680cb05dff800066032c1719de0dd580caf7cff743753032bdf42e2003000caf79ff7c2700032bb77fdd09bf40caede0b742622032bb85ddf084000cae59ff807422032b225de1183780cab05ff6c60da432ac183a20ec880caa1977743b1e432a86619d0c3a80caa4257742ca6032a94d9dd0a9980caa5c67844140032a1859dd104f40ca8617374333c032a265ddc06f000ca8f7678043da0329d47fe10dd580ca37cff7037524328df439f057000ca325ff7c11220328b85dde04e780ca292ff7c6f6603283559dd1bd8c0ca0d57374558003284f3fde00a680ca0caff8044040327de59dc110010c9f7976840a800327d0d9de027000c9f1c6778308403279695dd0c2040c9e5a6374071a0327bfffdf008580c9e51ff8415ea03277e95e105c580c9d9dff741712432767839d042f00c9db767740d560327713fe10e4000c9cb9ff7438fd03272e82dd0d0980c9ccd678418000327167fe011d000c9b3cff74473d0326cf42dd0a2000c9bb7ff6c28260326ee59db05d000c9bfcff6c14220327025de1079680c9a07ff7c42c00325d999df088680c96ddff781bfc0324c25de0023100c92e66780251a0324947fde120000c9131ff8852e60323f999dd14b890c8fe676744c800323ffffdd128880c9009777439c0032412bfdd078000c90b9ff7415000324377fde02e680c8fb7ff84176a0323d695dd05d9c0c8f5a6378450003238559e1198000c8c72ff7465fc43231cc39d037980c8dd3678853400322c97fdd14cf10c8b260e7450400322cc7fdd10c980c8b6667743d800322df3fdb0d5000c8b9dff6c26400322f67fde010980c8b156778900003223559dc23ff40c88d573786e400321c719dd1b8f40c871c73742cc403220895de034680c86e7ff84236a03219695dc08d990c865a667022e603219719e0074580c859dff840d2603215a59df05e680c850aff8473800320cf3fdc1cdf10c833d0e706e400320d47fde013980c8329677c0dda0320567fe105a000c80ffff6c167c432040039e14e980c7fb167783540031fb719dc0d4f40c7edc7384b238031ec25dde138000c796967744dfd031e5a5ce1072000c78f76780191a031e24bfde0ac980c77e667742b23031df99ce009cf00c774977742739031dd260dd093000c7753677c259e031d1cbfdf01f980c7453677c221a031cb77fdf183a80c715a577460e7031c5698dd0dc980c72016778213c031c3559df12d680c6fa7ff7805a6031be459e2035580c6dc4ff740d52431b71439d033f00c6dc667740bd6031b72bfde00d980c6db76778365a031b377fdd0d95c0c6cde0b742b1a031b42bfdd051000c6d6667801bfc031b025de013a580c6947ff7c54000319fdffdd14ff40c67f80b743a80031a177fdb0d6980c6871677c0d800318d0d9e20d0680c6272ff74341643189cc39d046680c62fcff884ede0318377fdd13b690c60de0e7439de03184c7fdb0b3100c6166676c271e03185f3fe218c000c5f51ff7808040317ca59de05e680c5ecaff840b400317a77fe010b000c5cfcff7042bd03173f42e008a000c5c72ff7c006603171c59df08a000c5be76770227d0316f9dcdc01e000c5c536780305a0316c97fdb0c15c0c5b260b7806c00316c2bfdf0c0a80c59d25774302703167498dd048000c5a4aff80255603164f3fe2198000c57a4ff8829400315bfffdb0a4f10c57000e6c28e60315c059e105e980c56a1678010da0315977fe2093000c55caff7424bc431572c39d084000c55d9ff7412ea03158495dd01ba80c5642577400ea03159695df04b000c5531ff7412bd03154c82dd016980c5566677809c0031542bfde10b000c53ffff841f800314b559dc07df10c52d5767803c003145799de1e1680c4f7cff7478570313df42dd102000c505c6774401a0314177fdd042000c511c677812000313a65ddf032100c4e676784035a0313967fde1bc000c4c9dff746efd03132782dd05d000c4dfcff70162603138059de014880c4c89777c19c803130895df017580c4c0aff8402040312e459de018000c4b79678407da0312d67fe1016980c4a5c677807da03128f3fdf1c3980c487967802d000311a77fdd0b3f40c469e0b7404e60311cf99e1003780c4505ff80011a03113f3fdf10b000c43f1ff8402a60310f9d9de049680c439dff8424c00310c2bfdd092f10c430b0e7422260310c559dd037980c43666788087c0310b85ddf0a5f00c41c1778039de0310367fdf050880c40897778391e030fe93fdd0e46c0c3fa50b880ae6030fde59de036000c3f4367781740030fb999de042000c3ea4677c3b40030f6dd9de0ac680c3d0aff802466030f1e59db0918c0c3c7973780b9a030f12bfe204b000c3bffff7412bc430f0003a1126000c3ad9ff70497c430eb6839c118980c3ae767780126030eb559e00a0e00c39e177742834430e78619f083100c395e6788153c030e425ddc054e10c39098678025e030e3fffdf046980c38b967 + +def tb_55 : Nat := + 0x743f624347171d9d05d000d1cfcff84029a0347147fde049680d1b9dff841e000346c97fd9077f10d1b260e641b000346cc7fd9037980d1b66678016260346b359de082680d1a4aff702097034692c2e0089880d19c17778871e0345e93fdf29a000d150aff74a67d034542c2dd1da000d15caff7472c00345767fdd100980d16a467842c400345167fdd0b0f40d145a0b740f6603453359e205a000d13ffff780b400344ee59e0066000d135367781e5a0344b67fe1004980d12d567845a0003445b59dc167f10d116d7670510003446459e21a2680d0fcaff7468964343f2c39d130680d103cff6c44c403441695db111000d105c676c1b5a03443fffdb051000d111c676c04da0344567fdb00f000d115e678401800343f13fd3005f10d0fc50e882be60343c559dc0af890d0f15767017a60343d999e0180000d0b0977745ffd0342c260dd0f8100d0b9167743c000342e65ddd0e1780d0ba7ff7c085e0342b9ffdf052980d0a956784378003426dd9e20c0000d08f767702ffc43423ddd9c0bf100d08f85770245a0342497fdf05df00d0899777c265e0341ffffe2019980d07e66778221a0341d77fdf0dba80d0682577436e70341a098dd0d4880d0689777030000341a77fe00a5f00d05dc6780251a034151ffdf0af200d045a57742bc503411698de062580d03f7ff8011a60340ec59df013680d039dff8008400340df3fde013980d0366678814400340c559d9050f10d03157678029a0340c2bfde064980d02a6677c16da034092bfdf138000d008977744dfd03402260de0e1780cffa7ff7c00c0033fe93fde0be980cfee667742fa3033fb99cdd04b000cff59ff88251a033f947fde147000cfd0aff7451bd033f42c2dd078000cfdd9ff841440033f2e7fdf0ba000cfbffff781200033eedffde038880cfb1977804e00033e785ddd137f10cf9e186742604033ea059de039f00cf9997780145e033e51ffe202b980cf91c676c0ae2433e471da10c1680cf7f7ff743056433dfe039d07c680cf83cff701740033e1719df31e000cf4d9ff845022033ce65ddd140790cf399867433c0033d02bfe0008100cf39167781380033cd0d9e1042000cf3016774107d033cc05ce008e680cf272ff742396433c9cc39f018a80cf25a57800216033c947fe2038880cf21977700e1e433c8661a209c780cf17cff782c22033c025ddb0b07c0cf00983782bc8033bd695dd0af140cef5a63742ade033bd77fde01bf00cef3e677406f9033bcf9cdd010e00cef4977780540033bca59e111e680cee0aff6c4796433b82c39b114000cee15678000c0033b81ffe1034980cedd36780267c033b4e5de10c8100cec7167786900033ab359dd1a3f40ceacd7374599a033ac2bfdd15c000ceb15677452da033ac97fdd0d3680ceb9dff840e9a033aa4bfda03a590cea930e7c5262033a525ddd1497c0ce94983744d40033a577fdc0d1880ce9c17778031e033a4f3fdf178980ce7c4677807da0339e93fde05b980ce6a46788365a033972bfdd0d9590ce5cb0e74329a0339767fdd0aa100ce5fa5774248403398495dd048000ce65c6774119a0339977fe0099000ce531ff7c4d400338ff3fe10c0000ce33cff682ffc4338cf439e104100ce21567786ec403381695dc1bb040ce05a637825560337f13fdd0954c0cdfc50b8404e60337ec59df037680cdf79ff8027660337b719e210a100cddd2576c4280433774999b109f80cddd26f6c37da03377f3fde238e00cdb9977708e350336e660e0008100cdb9167800dda0336d67fe1050880cdb09777c259e03369cbfe0030000cda125778558003361859dd155f40cd8617374477c0336265ddd0c0000cd8f76774245a0336497fe0103680cd75dff7807e60335cf99de041880cd689778049260334b359dd1248c0cd2cd73743ba60334c0d9dd0e7000cd30aff8042fc0334705de0083100cd13e677020c103344f9cdc078000cd149777c1a4003343559de12d680ccfa7ff704b570333ea02dc04bf00cd089778019260333d0d9e109f000ccea4677cdf260332b559dd37c8c0ccad57374c5400332cf3fdd300000ccb51ff743ae603335999e0053100cca825780003c0332a059df139680cc947ff78120003323fffdf0a6680cc7caff805c400331967fe20ffa80cc55a57743fe6433156999d0fc000cc55dff7426220331705ddd05d000cc5fcff7853d6033102bfdd14f4c0cc40b0b742f160331277fe2101880cc309776c405e4330c261a006c000cc1e76780425a0330377fde024000cc0b9ff8059a6032fd4d9dd1668c0cbf53737409c0033024bfde0c0000cbe0aff800ba6032f7719de123000cbcb9677448bd032f2e5cdd0a2f00cbd397770209a032f567fe1048000cbc71678834da032ee77fdb0d3590cbb9e0e6c25da032ef67fde010980cbacd677c09c0032ea999df078a80cb9d257841d16032e577fe001f980cb93e67881cda032e32bfdf072000cb6e7ff8011a6032da859de00c000cb69567780ec4032d9695de048000cb6125784963c032cee59dd258e10cb3b976748556032cff3fdd16bf00cb4a66774513c032d3359dd11af00cb4f767 + +def tb_56 : Nat := + 0x701b000361fc7fdc066000d87f7ff784c620361a65ddc1317c0d869983880fde0361967fe1180000d84d9ff705ffc43613683a01dd000d82fcff88228003609cbfdd089f10d82730e840d8003608f3fdb035f10d823d0e78101a0360497fdf11c880d8009776c471e43600261a1141780d7e07ff74505b035f8202dd13e780d7e0aff741f9e035fb2bfdd06f780d7ed9ff800ae6035f7719df0db000d7d01677835a6035ea999dc0d68c0d7aa6737816da035e92bfe10ed000d795dff6c3b3c435e5783a1014880d7949775c051e435e5261a1052980d7695676c14a2435da55d9e163680d7531ff7458d7035d4c82dd053100d7642576c0ec4035d9695e103a980d74f767841ec0035cf999de1a4000d7215677468fd035c855cdd090000d732967741f1a035ccf3fdd067680d7351ff781c1a035c693fdd0705c0d71a50b882940035c3fffe10a3980d705c677428e2435c171d9d05b980d70a46778245a035bf2bfe20b5980d6f1567742d62435bc55d9d064980d6f6667741440035bde7fdd04e000d6f7cff740666035bec59e00ae000d6e6767742b7d035b99dcdd039000d6edc67740dda035bb77fde00d680d6e59ff806f00035b277fdd1bbf40d6c9e0b801eea035b0895de10e000d6afcff74437d035abf42dd105000d6b05ff780540035ab9ffe1046980d6aa1678417c4035a9095dc05f040d6a4263701380035a94d9db045000d6a5c677c0a38035a865de1007200d6a1257842a3c035a5a59e2043680d6925ff7010d6435a4983a0093000d6892ff6c24bc435a24c39f209880d66897774825f0359a260dd154980d673e67783c000359665ddd0eff40d659983742a000359785ddd07e780d660aff7c090003592559e003b100d645a577c1a160358fc7fdf075000d637cff7c131a0358967fde0fc000d615dff8400ea03585695de080580d60d9ff7858260357de59dc1608c0d5f7973782d660357a919e0052680d5e51ff74149703579482dd046680d5e5dff7c21c0035772bfdd086f40d5dcb0b8404e603576dd9e006ff00d5c097778031e0356ff3fde115980d5ae7677445630356b9dcdd0c0000d5b3cff7c19440356a095de01f680d59a4ff8002e20356665ddf060000d59397780200403562e59e2024000d5895677c1efc0355a65dde03f780d5659ff7880160354d67fde039f00d530977842bc803549695dd0af140d525a638802160354947fd8008490d52520e7c354003545f3fe104b000d5131ff8852e60353f999dc14b890d4fe676880b400353ee59e1001680d4fb7ff8834260353b9d9db0d0890d4ee7766c27a20353c65ddb08e980d4f296778071a0353b2bfe0168a80d4d62577c02160353567fe0180000d4bd9ff8460000352967fdb17ff10d4a5a0e78162603528059de02f100d49d25780993c0351db59dd264e40d476d737424fc03524f99e1003000d46a16784114003519719d9044f10d465c7684068403519095dd01a040d464263840a380351865dde04e780d45caff74139b035172c2dd03f780d45d9ff84192603515999da064890d45667678851a0350d47fdd2145c0d43520b7460000350f999dd10c680d4459ff743b4003511e59dd0d5000d44916774264003513359de06a980d42e76784417c0350785ddd105e10d41e18674177c0350a25ddf005100d41dc677c1e8403505895e0003f00d415e6780153c0350425dde046980d40b967784200034fec59dd107f40d3fb1737416da0350177fde037680d3f79ff7c1da6034fc0d9de021f00d3ee17784e1de034ed67fdd387690d3b5a0e74da04034ede59dd350100d3b916774ce5e034ee9ffdd2bf200d3c2257749600034f225ddd10f200d3dd25774391e034f7f3fdd087780d3e59ff741e84034f99d9e2050880d3b09777c3dc8034e8495db0f7140d3a1263780abc034e79d9de091680d3925ff7c3126034e1859e007b000d37e6676c1ebc434df99da102d000d37b9677817c4034dd695e12fdf00d345c6774bf78434d171d9d258f00d350167749516034d417fdd178e00d35e1776c53d6034d82bfdf064680d33f7ff780780034cf67fe20cf000d330aff7033bc434cc2c3a1029880d32e1777c0144034cb719de11af00d31c1777446b9034c7060dd082680d3259ff741d40034c99d9dd049680d3292ff740d80034ca999de199980d2fc4678015c0034bdb59de00f000d2f5e677c1080034bc059de001680d2effff802880034b977fde00c000d2e51ff7834e6034af999de093000d2b53676c24bd034ad4dcdb02e680d2bb7ff84005a034ad47fde0cfa80d2a8257803756034a693fdc0dd4c0d29a50b800de6034a5b59de06d680d28ffff701b57034a4002dc033f00d2939777803c0034a2559df06a680d27f1ff7c0b400349f13fe105e980d2766678414400349c559e0277680d249dff7824c0034902bfe20b1000d2359ff7c3fea03489695e00d5000d217cff8038e20348265de0006780d2092ff80066603481e59e206ff00d200977741bf843480261a216b780d1e9dff745ada4347a783a001c980d1e81675c07224347a05d9e09ff00d1de1777821de0347567fe10fd980d1c5c67 + +def tb_57 : Nat := + 0x742a570381ba02e210e000e05d9ff7805400381713fe10cd980e04f7677c198003812459e0018000e046167805eda0380567fdd17b5c0e015a0b745a0003805b59de03d980e011c6784545a037ff2bfdd151590dffcb0e74308403801695dd01c680e00ffff7c0144037fb719de042f00dfe99777c5ce2037f225ddf067200dfc2257800756037e8f3fe1055980df9e767785b80037e1e59e2093000df7e6677024bc437df99d9f093000df753677424bd037dd4dcdf001680df751ff782d00037da77fdb0b3f40df69e0b8024c0037d82bfde02e980df5dc678836c0037d4059dd0daf10df5017674359a037d417fde0a8f00df3b1678004da037ce77fdf09a980df303677426a3037cc0dcdd078000df325ff88095a037cb77fdc025590df2de0e801da6037c99d9dd0768c0df26773801980037c8059e0177f00df089777c625e037bbfffdd1896c0def000b785880037b677fdd161f40ded9e0b744ec0037b713fdd135000dedcaff783de6037b2999e004e000debfcff74137c437aff439d04c980debfe677412c0037affffe1016980debe667882a5a037acf3fdc0a9590deb3d0e70251a037ad47fdc093000deb53677818c0037ab67fe10d2000dea07ff8822da037a51ffdd08b590de9480e8442c0037a0f3fde045000de7f7ff8824660379d999dd091890de76676741ec00379df3fe13d5000de3916774f53c4378e45d9d28c680de4d9ff8424000378c059dd08ff40de301737413800378d0d9e00c4680de23cff8408e20378865de00e7780de131ff7039db03784c82de00c000de125ff781b0003782e7fe1040980de0796778145e0377edffde228000ddaddff7489fd0376b782dd12c000ddbd9ff8412c00376a4bfdf149880dd9497788417c0375c719dc105e10dd71c767037bc0375d0d9dc0c8580dd759ff7c300003759719e2091680dd5caff783000037542bfde235980dd2d5677c12fc0374a25dde12f780dd159ff744bdb03745682dd11c100dd16d67742b4403747719de03d980dd11c677c5ac00373ec59de166680dce4aff745997037392c2dd117f00dce99777033fc0373b85ddc037680dcf79ff88126603738059df365100dca5c6774d9410372971cdd228000dcb99777c1d40037279d9df16e000dc8796784060003721859df103680dc75dff6c40d70371d782df00a980dc75367805c7c0371785ddd171e40dc5e18374027c0371d25de0048000dc5997784020403716459e212c000dc3d9ff744afc4370f6839d11e980dc3e7677445000370fc7fdd093000dc472ff780f000370e77fdf037980dc3666780213c0370b85ddf11df00dc14977847404036fde59dd1d0010dbf7976746144036ff119e1079680dbeffff701e56436fc003a013b000dbdc4ff7c0366036f6dd9e20ac680dbd0aff781926036f2999df015000dbc91677c1062036f025ddf009780dbbffff7c4626036eb9d9dd1188c0dbae773742b80036ed47fe1066000dba816774197c436ea05d9d065100dba8257740480036eb559e2114000db96d677803c0036e5799df054f00db909776c1539036e4260df048000db871678804da036e177fde06c000db7f1ff8022e6036dd999dd08b8c0db76673741d40036ddf3fde118680db5fcff7848c0036d367fda122f10db4da0e880f00036d277fe0093000db40aff781584036cd0d9e02a9f00db09977805184036bd4d9df1f9680dad59ff747e57036b5682dd0b5680dae9dff701b00036bb9d9dc015000daf3e677c8d00036ac97fdd233f40dab260b746f00036ae77fdc108000dac51ff703a26036b1c59e201b000dab0aff7c2c40036a967fdd0b0f40daa5a0b80031e036a4f3fdb00c690da93d0e841c80036a32bfda071f10da8cb0e84ae2a03698495dd2b89c0da6126374ac620369865ddd288a80da642577472c00369bfffde107580da50aff88192603692999dc064890da4a67678131a0369167fdf028980da3296780554403687119dd155040da1c4737411040368b559df01f680da1a4ff88090003685b59e0051000da11c678404bc0368425de1228000d9ee1777489fd0367b860dd144780d9fc4ff742ade0368177fe01bc000d9c9dff7c685e0366b9ffdd1a16c0d9ae80b74385e0366e9ffde046980d9aa1677c0b9a03669cbfde060a80d9a12577c477c0366265de1038100d9861677c43da0365d47fdd10f5c0d97520b888280036551ffdd209f10d95480e74702603656459dd170880d95e1777421c00365b2bfde042000d9505ff8016da0364fdffdf046980d93b1678434da0364a4bfdd0d3590d92930e7430000364a999dd099000d92cd677422800364b719de138a80d915a5778308403639695e00a2f00d8db76788144003635999e0099000d8ccd676c263d0363335cdf054000d8c796780025e0362ffffdf019980d8be6678034260362b9d9e10df680d8a07ff800d26036274d9de0b7000d891c67742dbd0362471cdd099f00d8939777422da036251ffdd075000d895e67740e7c0362665ddd02e680d89a4ff781d0403622559df024000d8871677804da0362177fe0093000d87caff7024bc4361f2c39c084000d87d9ff + +def tb_58 : Nat := + 0x746600039fe93fdd195000e7fa7ff881080039fc719db041f10e7f1c766c06c0039fd0d9e0036000e7ee66788221a039f977fda088590e7e5e0e681440039fa559de00c000e7e51ff7c6126039f3359de013680e7cb9ff842f40039eff3fdd0bcf10e7bfd0e742ee6039eff99dd0ba000e7bffff7c10e6039eee59df000f00e7a81677839fc039e665ddd0e7e40e799983742b80039e74d9e1051780e7947ff841200039e3fffdc047f10e79000e700ae6039e4719e10a2000e785dff74287c439e17839d08e980e787167741aa6039e2559e2066000e77f7ff6c197c439dfe039e033000e77c4ff8853d6039d02bfdc14f490e740b0e781c62039ce65dde090000e73097778031e039cbf3fdf0c0000e717cff7815c0039c497fdd056f40e71260b784722039c025ddd11c7c0e7009837424c0039c24bfdf0bd000e6e8167702f3d039ba05cdc057000e6ee767881e5a039b81ffdb079590e6e080e6c1e00039b8259df0e7780e6c51ff7439db039b1482e20b4000e6b9dff742cfc439ae7839e093000e6b0aff7c4422039a525de000c780e693cff7819e6039a3559df00a680e68caff7841a60399f119df02af00e67997778265e0399bfffde043680e665dff8026400399713fdc098f40e65c50b780d2603995a59de45ff00e6109777517f903984260dd407100e61625774270003993359dc072000e64f7677c2bc803981695de0c1980e5f0367782700039799d9e11c7580e5c0aff7471d2439702c39d1b0000e5c2257744d160397277fe2071880e5b997778271e0396bf3fde08da80e5a5a5774236703969698dd075000e5a72ff84060003969095e10d8f00e59696770363903965a5cdc05af00e59e7677c33fc0396265dde178e00e55e177745e3503957860dd08f580e56caff847bde0394fc7fe1040980e53b167780dda0394de7fe0054000e5325ff786e7c0394525ddf00b100e513e677c5e800393f119e202af00e4f9977740ab84393e6619d01f680e4fa4ff7c15840393d0d9e1042000e4f0167782bda0393947fdd0af5c0e4e520b741b000393a559de04e780e4dcaff7c192603935999dd0648c0e4d667378221a0393377fe1064980e4c796770192303931e5cdc024000e4cb9ff8407da0393167fde06a980e4ae767741aa30392b9dcdd038880e4b19777c785a0391fc7fe2158880e46997774561e4391a661a104e780e464aff6c139a439192c3a004e000e45fcff7c85bc0390d0d9e0042000e430167805a5a03905f3fdc1695c0e417d0b7830c003902e7fde020880e40997780139e039012bfe20ed000e3f5dff7800ea038fd695de006f00e3f5367780540038fcf99e1015000e3f29677c479a038f82bfdf0a8a80e3d6257841638038f425de1050100e3cb967701400438f2e5d9c00c780e3cfcff78119a038f1cbfde1cc980e3aa667747323038ea99cdd195000e3addff745766038ec559dc0d5000e3b9dff80b880038df119dd2e1f40e37c473745a00038e4f99dd148680e395dff880abc038de65dd902ae10e3799867c011a038dd67fe003d980e371c67803000038d9719dd0bff40e365c737421c0038da559e004a100e361257801d16038d677fe1034980e356967880dda038d4c7fd9037590e35320e884d40038cff3fde043980e33b96780005a038cd47fdf015000e333cff781566038cb9d9e200d680e32d9ff884566038c7119df01f680e31a4ff7800fc038c5799e0004680e3159ff782826038c2e59df05d000e305c677825da038bf13fdf048000e2f7cff7c00c0038bde7fe00e4780e2dfcff74391b038b7f42dd096780e2e4aff7021de038b967fdc005100e2edc677c9540038ae9ffe20a2000e2b05ff800240038abf3fd7008f10e2afd0e7c5166038a6dd9e1051000e2966677c101a038a497fe002e980e28f76780191a038a24bfdb0645c0e28930b782b260389f999e2093000e2753676424bc4389d4dd9908c100e275a57801b000389b9d9de0cf000e260aff7c0a620389785de00d5000e2472ff7c20400388fc7fe00ee980e23036780714003884f99dd1c4f40e213e7374408003888059dc09c000e2267677c12fc0388225de1110100e1f79677c1e000387c059e106c000e1e95676c1afc4387a55da109b100e1dfa577c04e603876dd9e1019680e1d9dff7c132603872459dd04c8c0e1c9173740de603872999df037680e1c59ff7c145e0386edffde07b000e1b3cff844d40038681ffe1043980e19c4677010e24386711d9c034980e19d3677807da0386693fdf0ac680e17f7ff702b170385fe02e119e000e1659ff70677d03859682de098880e15c1777c92040384de59e1078000e130167741dfd0384c05cdf2f7f00e10097770bdf903840260dc247680e10b9ff7c48840383b9d9dd122040e0ee7737c03c00383b2bfe002d000e0e9dff8432a6038374d9dc0ca8c0e0dd37384267c03834e5de0009000e0cfcff7c2a66038314d9e10d6680e0b7cff6835964382df439a0b5680e0b9dff8867c803820895dd19f110e0822667467c20382089bdd138000e088977743d9e038232bfdd0ec100e08d56778243c0381e459de0a9680e06e7ff + +def tb_59 : Nat := + 0x78084003bd5f3fe1013980ef5696788420003bd1859dc107f10ef461767041c403bd1895e20a8000ef3b9677029fc43bcee5d9f013980ef32967782a0003bca059dd0a7f40ef281737427fc03bca25dde0dc680ef1a4ff88119a03bc177fe1001980ef05c67842ac003bbec59e01df100eedd2577077c103bb7498dc1b0000eee016770599a03bb92bfdc0ae000eef036770270003bbc559e22cc580eeb05ff74b31243bac1839d22a580eeba7ff746c0003bb0895de009000eeafcff78054003bab9ffe0075000eea72ff78166203ba865de10b3100ee96667702cc043ba599da0040680ee925ff7c930003b9b67fdf057a80ee6825778297c03b97719db0a5e40ee5dc737c12c003b96459dd04af40ee5917378251a03b93f3fde043980ee4b9677c090003b92559e20e4000ee2cd677038fc43b8b35d9f066000ee2676774197d03b899dcdd03a680ee292ff88477c03b8525ddc11de10ee1498680770403b7db59dd1dc040edf6d73741f9e03b832bfe1164100eddfa5770590043b77e999c10c680ede51ff80081603b7767fdf00f000eddcaff880b4003b7677fe020f100eda825788003c03b6a059e109ff00ed9e1777c014403b67719e102e680ed9a4ff740b9643b66943a200b880ed9997778341a03b5f13fdc0d05c0ed7c50b7028da03b5fc7fe02b1880ed3997788020403b4e459e02b3680ed0ddff74acd703b43782dd22b000ed1666774851a03b45f3fe218c000ecf51ff7462fc43b3d4839d18a980ecf536770498003b3edffdc124980ecfb967703de603b3f999e0087000ececaff8430c003b381ffde0a5a80ecd625770296703b35898de008580ecd59ff786b4003b2a999e004c680eca59ff74131643b29683a122d580ec7a4ff6c8b5243b1e9439b20df00ec7c4676c6c0003b20895df14aa80ec65a577052a703b19698dc148980ec65c677040e603b1a859e1080580ec5d9ff6c201243b17683a00a8000ec531ff7429fd03b14c82dd073980ec5666780192603b13359df03c000ec491677c5a0003b0ca59e201d100ec1c4677807da03b0693fdf013980ec19167800bc403b05895e0058e00ec1097774163443b04261a0009780ec0ffff7c11a603b02e59e0015000ec0a4677c3ba603afb719e1075000ebe67677cafda03aee9ffdd2bf5c0ebba80b78288003aec17fde0a9980eba5c6778128403ae8495df046980eb7b9677411a303adee5cde05b680eb75dff7c030003add47fde170880eb5e17778140403ad6459dd050040eb5917378125a03ad51ffdf022680eb472ff84204003acfc7fdd080f40eb3f20b7407e603ad14d9dd018a80eb45a577c0d8003aca999df00f000eb24aff84600003ac32bfdc17ff10eb0cb0e705d6603ac3559de126000eafa4ff8404e603abe459e2040e00eae19776c103443ab8661a103f780eadd9ff6c0fda43ab7683a0022980eadb7677408a303ab6ddcdf1adf00eac0977746b7903ab0260dd13e000eac796774498003ab2459de016980eabe66778444003aab559e0111000ea9c4678015c003aa5b59dd056f40ea96d73740abc03aa665de20c9000ea8a46778120003aa1719df147000ea715677451bd03a9c55cdd0f6000ea766677025da03a9f13fdf118680ea5fcff80bee603a8c059e111a000ea1e76774467d03a879dcdd0af680ea251ff804b5a03a82e7fe2040980ea07967804ec003a7cf99df16b000e9dd367705abd03a774dcdc136680e9e07ff702f4003a7a059dc0a0680e9e9dff78082203a74e5de0033780e9d05ff640cda43a741839e009000e9cfcff7c2a6603a714d9dd0a98c0e9c537380120003a6b77fe204b000e9a92ff846e4003a6367fdc1b8f10e98da0e8803c003a632bfde106980e97c4678410e603a5a919de062100e96425774188103a59098de068580e95d9ff7c1c2603a55a59df072000e94f767800a8003a53359de027000e94a667782a5a03a4ff3fdc0a95c0e93fd0b8005a603a4f999de0bd000e93296778660003a46459dd197f40e919173742a0003a4a059de037680e9159ff80168003a43fffe20a5a80e905a5768296643a41699a2079980e8f0367701e6243a3c0dd9c078a80e8f0457701c8003a3c2bfe0027000e8edc677009bd03a3b71cdc025680e8eddff781d4003a399d9e1095100e8dd25770254103a37498de22a580e8ba7ff8005a603a2e459e0074100e8a95676c1d0043a2a55d9f053100e8a42577c015603a28f3fdf02aa80e8a12578046bc03a23dd9e21adf00e874977706b7843a1d261a006f780e86d9ff6c1bda43a1b6839e050880e86897774141f03a1a260dd03c000e869dff7c01c803a1a095e00a0e00e85e1778036de03a1417fdd0db6c0e85060b74265e03a151ffdc050100e85916784168003a0fdffdf010980e83e767880d8003a0ec59dd035f10e83b17674089a03a0f13fde034680e837cff7c00c003a0de7fe111b680e824aff7046d643a092c39c10c680e8259ff703fc003a099d9dc0c0000e82a66778432603a04f99dc10c8c0e813e73703c2a03a05695dc0ed000e815dff80005a03a04f3fde1de980e7f5e677477a3039fd79cdd1c3980e7f7967 + +def tb_60 : Nat := + 0x7801bc03ddd4d9e2009f00f7749776c027843ddd261a10c0000f7689778001c803dda095e00a5f00f75dc676c297903dd771cde04b000f759167880fa203dd425de20ad100f745c67742b4043dd171d9f0f6000f73666778821a03dc577fdd2085c0f715e0b74594003dc8059df088980f70d567784b5a03dbe9ffdf064980f6f436770192303dbd0dcdf042000f6f01677828da03db977fdd0a35c0f6e5e0b84030003db947fe103f780f6dd9ff700fda43db76839f006000f6dc4ff7817a603db5999dc05e8c0f6d66737009c003db677fde05b680f6d0aff78192603db2999dd0648c0f6ca673880b4003db1e59da02cf10f6c7976801f1a03daff3fdc07c590f6bfd0e7c10e603daee59e027c000f685dff749efd03da1782dd192000f6947ff84198003d9fdffde033000f67c4ff7c120003d9df3fe2016980f6766677c723c03d8e459e104e000f63436784119a03d8bf3fdb046590f62fd0e802e2603d81e59dd0b8890f607976741e0003d82e7fe012ff00f5f49778890de03d7417fdd243690f5d060e742ade03d7a77fdd07e780f5ecaff7c024003d73f3fdf08b980f5c71677422e303d71c5ce101e000f5c5367784b5a03d6c97fde048000f5addff7411fd03d6b782de093000f5a4aff7024bd03d692c2df078a80f59d25780b49603d5bfffdd2d24c0f57000b748b5603d5e93fdf05e980f56a1677810da03d5977fe0003a80f565a577c060003d59095e20dbf00f5566677436f843d5599d9d0d8f00f55696774315603d55f3fe0061680f53ffff7c13da03d4b67fe0004980f52d56778300003d48559db0bff40f521573780e4003d47719e206f000f516d6778108003d44719db041f40f511c737c300003d41719e01c2f00f4e997780139e03d392bfe004e000f4dfcff7c0aaa03d37495e21c7580f4c0aff7471d243d302c3a1091980f4b796770246303d2de5cdc079980f4b916778de5a03d1ffffdd3795c0f48000b74419a03d29cbfdf0a2000f475dff7c030003d1d47fe0008880f4749778802c403d1cf99de057000f46e7677c24de03d1417fe0009000f44fcff74023d03d13f42de0f8880f42e177743e1f03d0b860dd0cf000f430aff8000de03d0b77fdf076980f42676778434403d05695dd10d040f415a637c201603d0367fde115980f3fc46780186603cfd0d9e0149100f3dfa5774524103cf7e98dd09f000f3ea46784603c03cf1e59dc180e10f3c7976800b9a03cf12bfde009780f3bffff7c0e2203cec65dde024f00f3939777c0c0003ce425de2050100f38b96770140043ce2e5d9f05d000f385c6774173d03ce171cde01f680f383cff7812c003cdfc7fde004680f35fcff80011a03ccbf3fde08a000f3272ff8445c003cc497fdc116f10f31260e7042c003cc4c7fdf06c000f30b9ff841bc003cc12bfdc06ef10f304b0e783c2a03cbd695de144f00f2e156784108003cb74d9df071100f2d625780163803cb425ddf0b2980f2c5367742ca303cb14dcde0b5680f2b9dff78510003ca967fdd143f40f2a5a0b743de603caa999de00b100f293e677c005a03ca4f3fdf11aa80f2822577446a703ca0898df090f00f27916788090003c9db59e110f680f265dff7443d643c997839d085680f26e7ff7404da03c9d67fe001ba80f264257885cc403c92999dc173010f24a676802a5a03c8ff3fde016980f23e667783fc003c8b9d9e210b000f21dc677042bc43c8771d9c105f00f21e17770348003c88559e1067680f203cff881e0003c7f13fde0e8980f1edc67841d4003c799d9e000d680f1e59ff786f0003c7277fe2014880f1c897778600003c6c25ddd17ff40f1b09838800de03c6c17fde093000f1a72ff800d8003c68f3fe2055980f19e7676c156243c679dda102e980f18f7677c177c03c6265dde099780f17ffff7c2b8003c5d47fdc0adf40f17520b80022203c5d25ddf0c7200f1682577431c503c5a098dd0ab780f169dff84120003c52e59de0c1680f13f7ff74305703c4fe02de07a100f1267677823d603c432bfdf123000f0fa7ff7048bd03c3ea02de00e880f0f997784600003c3865ddd17ff40f0e1983743d4403c3a919e10b3100f0d666778264003c33359dd098f40f0ccd7378455a03c2edffe20d0980f0ae7676c342243c2b9dd9b09e880f0b19778837da03c281ffe10c0000f0947ff742ffd03c25202e202b980f091c67740ae243c2471d9f012f00f09097788331e03c20f3fe104b000f07f1ff7c210003c1967fdd083f40f065a0b7c262203c1705dde267780f0359ff78150003c0c17fde0aba80f025a57702ae703c09698dc093000f0272ff8001bc03c094d9e206a980f01e7676c1aa243c079dd9b03fa80f0212576c0e2203c0865ddf22f680effb7ff748bd703bfee02dd16e000f00796780378003bfb67fe20cf000efe0aff8000c003bf81ffdf0d5000efb7cff7819e603bec559e2037680efaddff740dd643beb7839e1de980ef75e677477a303bdd79cdd067980ef8d56778179a03bdbfffdd05e5c0ef7000b802f6a03bd9095dd0bd9c0ef6426374288003bd977fe207d580ef5c4ff741f5243bd71439d077580ef5caff + +def tb_61 : Nat := + 0x80810003ffd67fdd203f40fff5a0b746e4003ffe93fde073980ffee66780251a03ff947fe0078000ffdd9ff7c33c003ff42bfdf051000ffcb9ff802e8003feffffdb0b9f10ffc000e6c2c2203ff025ddf046980ffbb96784342603fea059dc0d0890ffa81767033ea03fea095de0ae000ff9d367802f9a03fe177fdd0be590ff85e0e78198003fdfdffdd065f40ff7f80b7cd68003fd277fdd359f40ff49e0b848ac003fc9cbfdd22af10ff2730e74684003fcbf3fdd19c980ff3016774652203fcc25ddd15a980ff3436774432603fce459dd104880ff3997780062a03fc9695e00dd580ff17cff74375243fc5f439d040e00ff2197774075603fc8f3fde04b000ff131ff80030003fc497fde11c880ff0097778145e03fbedffde05a000fef5dff80030003fbd47fdc00bf40fef520b7c022203fbd25dde13e780fee0aff744f9b03fb82c2e2003000fee07ff4400bc43fb82039e0ae000fed59ff80082203fb4e5dde030000fed0977807d0403fac559dd1f4040feb1573745ade03fae77fe2048000feacd677011fc43fab35da003a680fea92ff84302a03fa7495e0074580fe95dff84052203fa525ddf00c780fe93cff782a2a03fa0895de05df00fe7c467840abc03f9e65ddd02ae10fe799867c2c5e03f9b9ffdd0b16c0fe6e80b78228003f9977fdd089f40fe65e0b8824c003f972bfdd092f10fe5cb0e74210003f9767fdd063a80fe5fa5778a38003f8cf3fdd28df40fe33d0b74738003f8ff3fdd171000fe459ff8478c003f8567fdd1e2f40fe15a0b7449e603f88559e1050880fe109777c331e03f80f3fdd0cc6c0fe03d0b7c04e603f7ec59e01df100fddd2577477c103f77498de010e00fddc1777899de03f6d67fdd2676c0fdb5a0b748c0403f6e459de0e7000fda72ff8805a603f69719df165000fd8f76774593d03f63ddcdd0f3000fd9696780177c03f6265de113b780fd75dff704eda43f5d7839c0e1780fd7b7ff70265e03f5ffffde093000fd6caff7424bd03f5b2c2e0077580fd60aff78438003f53f3fdf006f00fd45367781e5a03f4f67fdd0795c0fd3da0b883f6603f4b719dc0fd890fd2dc76703f0003f4b77fdc0f8880fd2e1777c03c003f4b359e010bf00fd1c17780031e03f44f3fdd00c6c0fd13d0b7819e603f43559e21e5100fcea4677803c003f3a559df043680fce51ff7c612603f33359dd1848c0fcccd737819e603f2b559e01b9000fc91c67746e3c43f2471d9e1fb780fc49dff747edb03f12782dd13f200fc55a5774139e03f192bfe01b7980fc2e667746de303f0b99cdd198000fc305ff74652203f0c25ddf051000fc29567802b8003f079d9de0b5680fc131ff7809c003f024bfe013f980fbf536784005a03efd47fe2175980fbddc67745d6243ef771d9d147000fbe0aff78209a03ef567fdf020880fbd397778890403eec559dd224040fbb15737466de03eee77fdf037680fbaddff7c243c03ede459dd090e40fb791737c090003eddb59de00f000fb75e6780312603eda559dc0c4890fb69576803dda03ed677fdd0f75c0fb59e0b74341a03ed713fdd083100fb612577c29a603ed3dd9de051000fb4a667780b4003ed1e59df0c0000fb3b9677c060003ec7119df06a680fb159ff84282603ec2e59da0a0890fb0b97678174003ec1719e101f680fb03cff7007d643ec0f439f003000faf79ff8400de03ebb77fe1001980faedc6780f59a03eac17fdd3d65c0fab060b7494bc03eb225dde030000faa1257803b1603ea497fdc0ec490fa9260e78232203ea265de1038100fa86167740e0103ea185ce2196680fa6caff74659643e9b2c39d17a000fa6e7677c2d8403e914d9de07e000fa379ff741f7d03e8de82e1112980fa267677444a303e899dce1066000fa2016778311a03e84f3fde067980fa0d5678812fc03e8225ddc04be10fa089867c385e03e7e9ffe005a000f9effff74167d03e7c002dd03d980f9f1c677c1aa603e7a559e203b100f9e5a57680ec043e79699a2060000f9dfa577c09c003e7677fde0d0980f9ccd6780455a03e6edffdf1b0000f9a07ff746bfd03e68202dd136980f9a81677c09a203e6785de0074100f996d67701d0103e65b5cde025680f9947ff841fda03e5fc7fe008b980f97666778830403e55695dd20c040f955a6384703803e4e65de103f780f9359ff7c1ce603e4b999df208680f90ddff7c090003e42e7fde06f000f904aff78192603e3f999e1088680f8f5dff70221643e3d783a2003a80f8f5a57800c3c03e3ca59dd030e40f8f29738013da03e3b67fde114000f8a0167884b0003e23559db12bf10f88d5766c311a03e24f3fdb0c3000f893e67842cc403e20895e2105f00f871c67880d1a03e1b9ffd9034590f86e80e6407da03e1bf3fde046980f86a1677811c403e19695e003c000f859dff7c0d2603e15a59e005e680f850aff782c4003e1167fdf300000f8159ff74bffd03e05682de18f000f7fcaff7463bd03dff2c2e2051000f7f79ff70143c43dfde839c04e000f7f7cff782a5a03df967fe12b2000f7ba7ff7c0ba603dede59e1091680f7ae7ff88030003dea559e105f100f775a57 + +def tb_62 : Nat := + 0x74227d04209cc2e20360010823cff808ce20420025ddd2337c108009837445c00420497fe005a00107f5dff800522041fd25ddf14178107e07ff74505b041f8202df02b98107ddc6784209a041f567fdf05088107d09777c1404041f2e59e01a400107b15677468fd041ec55cdf0ca68107a4aff703297041e92c2de101881079497774405f041e5260de06f781078d9ff780126041e3559e114400107791677853c4041d9095dd14f0410764263743f00041da559de07d581075c4ff8058e6041d1859de0a8001073b9677429fd041cee5ce10df681072d9ff7437d6441cb6839f0f8881071e177743e1f041c7860de04a1010705a57701281041c1698e0144f0106f1567745139041bc55cdf03768106eddff800066041bb719df07500106e67677c071a041b92bfe0228a8106c2257748a27041b0898de01758106c0aff8048c0041ab9ffdd122f4106ae80b7811a6041aa859df04e00106a53677c3a80041a5a59e0003001069666788851a0419d47fdd214591067520e7434da041a24bfde0139810673e6780573c0419785ddd15ce41065e183744cda041982bfdf0d800106509777c140404192e59de02400106495677c275a0418fdffe207b0010637cff701ebc4418df439e00300106379ff8019260418c559de048001062cd677c5bda0418577fdd16f5c10615e0b741cda0418967fdf003a810615a57846c960417e9ffdd1b24c105fa80b7423d6041832bfde02e98105f79677803000417db59e204668105e5dff681196441797839e02400105cb9ff7c5eaa0416a095dd17a9c105a82637445660416b9d9df0bdf01059c467801f1a041651ffde00e8810593977785b9e0415f2bfdd16e6c1057cb0b74290404162559de0b59810571567881efc0415a65dda07be1105699867c139e041592bfe1267f0105399777099f84414e661a103f78105359ff6c0fda4414d6839f0169810534367800f5a0414c17fde1890010517cff74623d04145f42e201698105166675c05a24414599da0088681050ddff843de60413f999e128c68104d59ff74a31704135682dd28410104d62577446da0413b2bfdd0ff00104ee767740b9a0413edffdf0fd98104c5c67743f630413171ce231e0010493e6774c77c44124f9d9d312f01049497774bf9a0412577fdd28a101049d2577496c004128059de1e00010475e677477fd0411d79ce20ba001046a467682e7c4411a91da104a1010465a57741280441196999d0480010465c677c23d6041172bfdd08f4c1045cb0b7420160411767fdf09900104531ff70263d04114c82e00b89810447967742e2304111e5cdf09468104351ff7832220410a25ddd0c87c10428983782b4404107719df003f010415e6778401a0410177fdc1005c10405e0b846066040fb719e00df68103dfcff780aaa040f7495de148e0103c89777819c8040f0895de090f0103b9167800dda040ed67fdf147a8103a12577051e7040e8498de05af01039b7678010da040e497fdf0c498103861677c9ffc040d785dde0e01010350167882640040cf67fdc098f11033da0e7022e6040cf9d9dc081001033f1ff781800040cde7fde06f0010330aff780ba6040cb719de036001032a6677804da040ca4bfde02b98103267677c071a040c92bfdd01c5c10324b0b841980040bd799dd065f1102f5e767c401a040b977fdc1005c102e5e0b70179a040bbfffdc05d00102f01677c18ea040b7e95dc0639c102dfa63880816040b767fde01500102dc4ff7c5ac0040b167fdd16af4102c5a0b881740040aff3fdb05cf1102bfd0e7c2a66040ad4d9dc0a98c102b5373845280040a81ffdf09a9810296d677426a3040a5b5cde033f0102939777c0e5e040a3fffde05b981028a467840cc0040a1c59dd032f4102871737c0540040a1719df097681027c4ff7425d70409f142df26aa810255a57709aa704095698dc0af9810271567882f160409277fda0bc4910249e0e8824c0040902bfe000678102092ff78066604081e59de02e6810204aff7c24660407ee59e100168101fb7ff7823a60407ca59de08b68101e9dff78162604074059de12768101bd9ff7449d70406f682e210bf01019c1777442f8440670619d08268101a4aff788c040405e459de0a9681016e7ff8810e60405a919e21d7001014cd677475bc4405335d9d1c8001014dc6774719a0405377fdd1ad001014f76774665a040542bfde0e7001013e6677439bd0404f99cdd0cd681013ffff880b400404ee59de12ff010128977744bf90404a260dd0e4001012d5677437da0404b67fde24c7810103cff841e000403f13fdd077f1100fc50e7804e60403ec59de09c00100f15678000660403b719de0db00100e016778965a0402e9ffde01698100b916780378004026dd9e104e00100969677c1c8004023dd9de05df010089977782cc40401f999e00886810075dff7805220401d25de000d681006d9ff8014220401a25de200720100682577c3c3c04016459dd0f0e4100591737c0a260400ec59de03768100379ff740dd70400de82df01398100366678414400400c559e2141f01001c17774507844007061a10637810015dff + +def tb_63 : Nat := + 0x785a0004405b59df00f0011015e678804bc0440425de2009781100ffff7c296a04401695de17df010fedc678010bc043fa65ddf09c7810fdfcff78c000043ebf3fde0150010fae7ff800300043ea559e203b1010fa5a57680ec0443e96999f0055810fa3cff788f40043dffffdf0469810f7b967781980043dd4d9e10b56810f69dff702d56443da783a01948810f5097774651f043d4260dd0c19810f5dc67780126043d4059df08e6810f472ff7c1ec0043cfdffdd07af410f3f80b880180043cfc7fd1005f110f3f20e7804da043ce77fe00780010f325ff780504043cb359dd0140410f2cd73785bda043c577fe00d48810f0897778385e043be9ffe00a80010eeffff84a980043b167fdd2a5f410ec5a0b749666043b2999dd1620010ed9dff744ec0043b713fe005a0010ebffff74167d043b0002df0469810ebb9677411a3043aee5cdd0199810ebe6677c7980043a74d9dd1e5f410e9d373781d40043a5799e00166810e947ff7c03a2043a4e5dde0951010e8a4678037da0439f13fdd0df5c10e7c50b8017a60439d999dd05e8c10e7667380a31a0439367fe01489810e39167846a80043879d9dd1a9f410e1e773745dfc0438865ddd1546810e23cff7c305a0438497fdd0c15c10e1260b7c2b2604381e59df1276810df51ff7c2d000437a77fdb0b3f410de9e0b7c41220437665ddf0372010dd6257780a3804374e5de10381010dd0167882bda0437147fdd0af5910dc520e742b80043714d9de3088810d9497774c21f04365260dd1bf0010da92ff745d000436b77fdd12c0010db25ff7c6e040435e459df0750010d71c6778300004359719de0abf010d56667702af90435599cde0346810d531ff7c36000435167fe01800010d2d9ff745ffc4434b6839d1309810d329677c01260434b559de1680010d16d677459fd04345b5cdd0f90010d1dc677879560433df3fdd1e54c10cf7d0b746c3c0433ec59dd045f010d11c678800c00433de7fe21b88810cdc177746e1e443370619d1a7a810cdd257745e2604338059df2280010cb9977780fde0432d67fdf0720010cae7ff7c11a60432a859e104e0010ca536774137d043294dcde0166810ca3cff7c34e604325a59dc0d38c10c969738082da0431d77fdd20b5910c75e0e74420004321859df009f010c749777402790431d260e00ab7810c69dff7c2f220431785dda0bc7c10c5e1837812000431665de01267810c472ff74499b04311cc2dd0981010c501678006000430f67fdf0739810c366678448000430705ddd11ff110c1c186741e84043099d9de0780010c14977786144042ff119e104b0010bf59ff781626042fc059e114a0010bdb76774527d042f6ddcdd13c6810bdc4ff844f80042f1e59dd13df410bc7973744980042f2459dd1110010bca667880b9a042f12bfde0418810bc0977784884042eb9d9dd1220410bae773742dde042ed47fe100d6810bad9ff78335a042e81ffdd0cd5c10ba080b78179a042e3fffdf05b6810b85dff7016d7042e1782de0019810b85c678007da042e0f3fe00c00010b77cff742ffc442ddf439d0720010b7caff8805a6042dd999de2c86810b49dff74b217042d2782e20930010b40aff781c62042ce65dde08a0010b272ff780d80042c8f3fe01a38810b09977783de6042bd4d9e10139810af3e676804e2442bcf9da00a06810ae9dff788b26042b1c59de14b6810ab25ff781fe6042aa999de06a6810a759ff80774004295f3fdd1dcf410a57d0b7450220429865ddf0139810a56967780dda04294c7fdf03a9810a4f767740ea304293ddcde0510010a4a6678001da0429167fde05d0010a3fcff7815000428b559dc053f410a2d5737010800428b9d9e21110010a1c4676c443c4428711da10139810a19167802f9a0428177fe107800109fc4ff7838e20427b85de004800109e9977780fde0427967fdf09888109dc177781f9e042702bfe106300109ba7ff7c4d4004269cbfe11d9881098997770765e442626619c17b981098f76778265e0425ffffdc099691098000e7024000426025de00ae00109751ff8021c00425b2bfdb086f11096cb0e6c04e60425cf99df1c1881095097774705f04254260dd18300109547ff88031e04253f3fdd00c691094fd0e7841400424fdffdd104f41093f80b742a66042514d9de091981093666784125a0424a4bfda049591092930e680d800424a999df138a810915a577806fc04244f99de1a388108f99776c68df0423e660de02c10108f6d677c14400423c719df0c210108e5a577c28bc04236dd9de08268108c4aff8810620423025ddf00978108bffff7806660422f999df02e68108bb7ff8419260422d4d9e006c00108ae76778509a0422693fdd1425c1089a50b744500042274d9de00b8810899977800ec404225799de024f0108939777c074404224719df0be6810885dff742f9704221782dd08700108895678419800421fdffe102d001087caff6c0b3c4421f2c39b01e001087d9ff8447220421705de00e7781084d9ff7865a60420d0d9de039f0108309778800de0420c17fe1009001082fcff68023c4420bf439e08a00108272ff + +def tb_64 : Nat := + 0x7805220461a25de2007201186825784145e046151ffdf04200118505ff782aea04611695e000858118451ff8852620460705ddd149791181c1867819c804605695df01bf011813e6780005a04604f3fe219500117fa7ff6c653c445fea039b17898117fc4678400c0045fe93fe00a398117f01677428e3045fc05cdd08898117f1c677411a6045fd799e20a368117e5dff7028d6445f9783a000c00117e51ff8451c0045f42bfe003d98117ccd67800f00045f2459dc03bf4117c917388251a045eff3fdd09459117bfd0e7424c0045eff99df04398117bb967843426045ea059dc0d089117a8176881e5a045e81ffd707959117a080e7809a2045e785de004800117999777011fd045e6660e00240011789567780900045e1c59e10136811785dff781980045dfdffde1f69811760167747da3045d805ce11636811749dff7458d6445d27839d0a71011755a578090ea045c9695e000858117251ff780540045c8f3fdf032101171e7677c8bda045bedffdd22f5c116fb80b74777c045c025ddd15468117092ff74305a045c497fdd0b568117131ff801ba2045bd25dde00b10116f3e67781980045ba059df11f10116d62577447c1045b5898e103000116d0977842d84045b14d9e007968116bd9ff8433c0045ac2bfdc0cef1116b0b0e7c7e00045a3559e000a681168caff844c620459e65ddd13179116799867449800459e93fde0081011679167803c000459a859df0450011665c67781d160459677fdd0744c11659e0b88084004595f3fe1085981164f767800a8004593359e1027001164a6677c114004591859e11d7f0116289777849c804585895df058e01161097778075604580f3fe110a10115dd25770428104577498de330f0115aa16774cc390456a85cdd2d558115afcff748e380456e65ddd1c758115c0aff7816bc045679d9e107e001159696780359a045624bfdd0d65c1158930b848f4004554059de0cc00115325ff7806c00454c2bfde00798115303678009c00454b719da026f11152dc7668095a0454b77fdf192f0115149778002c404544f99de17898114fc4677807da0453e93fdf06198114f43677018630453d0dce202700114f1c678806c00453c059d601af1114f01768017400453a919de08af0114e19777422b904538660e007b78114d9dff741edb04536782e00c000114cddff84090004532e7fdf10698114b536788005a0452d47fdf03888114b19777826040452a059df289681147f7ff7c0b400451f2bfe0131881146997788271e04517f3fdc09c691145fd0e70260404518059df0a2a811455a5778963c0450c059dc258e4114301738806c00450b999de05100114295677c02160450947fdf2070011404aff7481bd045012c2dd1b8881140997774660004502e7fe00f798113f5367743de3044fd4dcdf14d00113ddc6774533d044f771cdf0d200113d016774347d044f405ce104800113cb9676411fc444f2e5da10d200113be76774347d044ef9dcdf03768113addff7867e6044e4f99dd19f8c11393e73785e80044df119e00570011376d677015bd044ddb5ce00420011371c677c21c0044da559e00390011365c677c1284044d8495e2215581133fcff708552444cff439e079681132d9ff741e57044cb682dd06c001132e76774059a044ccf3fdf115981131c467840cc0044c6459dd032f411319173840bc4044c5895e2003f011315e677c011a044c567fde0fc0011305dff8425da044bf13fdf04800112f7cff8400c0044bde7fdf021f0112ee177780144044bb719e10db00112e01677436bd044b805ce100468112dfcff80c000044abf3fdc2fff1112afd0e7c2a66044a94d9df12d68112925ff744b57044a4982dd0ed00112966678024c0044a24bfdc092f11128930e804fe60449d4d9dd13f8c11275373742b260449f999de06c001126e7677c83d604491cbfdf0c1981123b1677c0d800448b359e003a68112292ff786f6604483559dd1bd8c1120d57374552604484f99e000a681120caff8010620448225ddf06c00111e9567800ec404479695e10ed00111cddff703b3c44473783a203798111ca6676c0de24447299d9b03600111ca7ff840b4004471e59e001f68111c59ff7828800446edffe11e4981119d3677c0b9a0446693fe00889811191c67781e0004462919e10dc981116016778c0000444c059dd2fff41113017374a9da0444d67fdd28800111379677891da04442e7fdb2475c1110ba0b7c78000443b67fdd1dff4110eda0b7474a60443b9d9dd19098110f29677c03c00443b2bfe00c300110e07ff7430bd04438202de02688110de1777c0384044374d9de0cd68110d05ff8824c004431cbfdd092f1110c730e74132604432e59de01f98110c5367807e5a0442967fdc1f959110a5a0e7c162604428059e10637811095dff884eea04420895db13b99110822666c4ee40442089bdb0d488110889776c24c0044232bfde105f011071c677041790441c71ce2034681106e7ff80236a04419695e10180011064257841a160441767fe1015001105c4ff781c8004413dd9df096001104616774257d0441185ce018c001102d567 + +def tb_65 : Nat := + 0x783dda0484e77fdd0f75c12139e0b7c44a6048499d9dd1128c1212677378777c0484225ddd1dde41210898374671a048432bfdf0f000120f9977841e000483a919da077f1120ea4766818c00483ae59da03600120ee6677c22bc0483865de00b310120d66677816da048342bfdf01368120cb9ff8874a60482b9d9dc1d289120ae7768837da048281ffde043981209c4677822bc04824e5ddf15f001206ddff8411220481a65de003f78120659ff8026220481705de032c101202956774cb004480a55d9d2c4781202fcff74aede0480c17fde0ae001201e7677c204004805999e203468120131ff7c1e5a047fffffde0480011ffb7ff781680047fd77fdf003a811ff5a577c01bc047fd4d9de0016811ff51ff8051c0047f82bfdc146f411fe0b0b7c0de6047f74d9e11620011fc716774587d047f1c5ce108a0011fbe76774227d047ef9dce00d20011fb156774347d047ec55cde00a6811fb0aff804e2a047e7495dd1389c11f9d263743000047e92bfde0210011f93cff7819e6047e3559de17b6811f759ff705ed7047dd682e105a0011f6ffff68167c447dc0039a0589811f701677c17a6047da859de00c0011f69567780dda047d977fde1609811f47967745823047d1e5cdd05d0011f57cff740f00047d677fde0930011f3e6677024bd047cf99cdf02d0011f3b967801f1a047ccf3fdf0139811f329677c0204047ca059e109ff011f1e177801404047c6459e11e00011efb1677477fd047bec5cdd1350011f05c67744cda047c177fe10346811ef7cff781e66047bc0d9df07a5811eba7ff843000047ab9ffdc0bff111eae80e784c26047a6dd9dd1308c11e9b77374356a047a8495dd0ce8811ea197778245a047a497fdd0915c11e9260b7c0ba6047a3dd9de0646811e892ff846e400479b67fdf0fd9811e5dc677c10bc0479665de00081011e5916778125a047951ffde0b29811e49567742ca30479255cde0420011e45367784b5a0478c97fe00141011e2cd67841cda0478967fdd0735911e25a0e741980047899d9de1108811e14977881d0404783559db0740111e0d5767c029a047832bfde15d9811df6d67780a800477d0d9dd029f411df4373785a5a0477767fdf03c0011dd9dff740efd04776782de0c00011dcddff8096ea0476a095df000f011da81678427fc0476785dde01d1011d9c4677c731a0475fdffdd1cc5c11d7f80b744bc004762559dd02af011d999777801800475fc7fdf02d0011d7c4ff7c80e20475705ddc2037c11d5c183808a000474e65dde1fc6811d17cff747f1704745f42e11738811d00977745cdf04740260de0016811cf51ff7c5c220473785de21cb0011caa6677472bc4472a99d9d1a40011cacd677457000472c559dd0976811cbd9ff740780047314d9e20136811ca92ff7c246604728059df2700011c79167749bfd0471e45cdd25c6811c7a4ff884d4004719719db134f111c65c7688264004713359dd098f111c4cd76841cda0471167fe01d08811c2897770741f0470a260de0741011c21567882cc404705895dd0b30111c16266742cbe0470589bdd0a80011c16d6774210004706459dd0706811c1a4ff74144004707119e2003f011c15e6784179a04703fffdc05e5911c1000e7816e604702919dd05b8c11c0a47378128404701695df08f5811bfcaff803ba6046fb719e10750011be676784bb80046ede59dd2edf411bb797374afda046ee9ffe20736811bb05ff6c1cd6446ec183a101a1011ba42577c0c00046e8495df05af011b9b7677c7440046df999df0886811b75dff742217046dd782de17c8811b5e1777c0144046d7719e01470011b4956778089a046d1cbfde0021011b45a577801bc046d14d9de0f0a811b15a578023d6046c32bfe01260011afa4ff7811a6046bd799e105e6811aeffff6c1796446bc0039e003a811ae5a57806816046b2e7fdd1a04c11acba0b742556046b713fde07c6811abfcff7c1140046aedffde21e8811a9997774879f046a6660dd1f39811a9c467883240046a2919de0b26811a7f1ff8837260469c559dd0dc8911a7157678461a04697f3fe11276811a251ff7c762604681e59df0c000119fb9678807260467a059de07968119e07ff800d26046774d9de07110119d6257783f000466b77fdd0fbf4119ade0b8812c00466a4bfe104800119a4aff803d9e046632bfdd0f66c1198cb0b802a2a04660895de07d581197a4ff741f530465e942df0bd001196e7ff7820c404658495e2038581195d9ff600e1244657683a00709811956967801c8004653dd9de02a001194cd6784114004651859e1064681193fcff843c0004646459e102f10119162576c0bc104645898de062581190ffff8861800463de7fdd185f1118f7a0e7460c00463df3fe107698118f03677c095a0463b77fdb02559118ede0e7800660463b719df237a8118c2257708de704630898e207a58118ba7ff7805a60462e459df03768118b59ff782d84046294d9e001110118a42577c015604628f3fde02af01189e76778618004621859e21036811875dff6c40d64461d783a10148811874977781f9e0461b2bfdf02d0011869dff + +def tb_66 : Nat := + 0x78021604a7947fe2057a8129dfa57880d5604a7713fdc03549129dc50e7804da04a72e7fde0a200129bb7ff6c287d04a6ee02de07b00129b3cff7c4ce604a61c59dd1338c1298717374174004a651ffdd0469812995e67793e0004a4de59dd4f7f4129379737464da04a5b77fe106ff0129309778008c404a4b999e109468129251ff88480004a44c7fda11ff11291320e7c150004a4377fe1024001290b9ff7834e604a3f999df02e68128fb7ff80168004a3d77fe211400128e15677044fc44a3855d9c0a800128e81677022da04a3a77fde00a68128e0aff800de604a374d9de16068128c72ff7815c004a2c97fde01098128b156778900004a23559df0b3101288225784417c04a1c719df0480012861257788b1a04a0cf3fdd22c5c12833d0b7c660004a06459de0d500127edc6784209a049f967fdf2c8e0127b09777c085e049eb9ffe104698127aa167880300049ea559df12c0012796967781c80049e3dd9e207e0012787967741f7c449e1e5da2093001277e6676c24bc449df99d9f093001277536788027c049dd25ddf0c720127682577431c5049da098e1178e012750977803b40049cd999df088681272ddff7c3726049c8059db0dc8c127201737829c4049c5695de084f01270d567804b5a049be9ffdf01698126f91677c65c4049b7e95df02058126dd9ff8003c0049b72bfde00600126dc4ff7c0366049b6dd9e105100126d6667840b40049b377fdf03798126ca6677c0b40049b1e59df06ff0126c09777c1404049aee59dd05004126bb97384005a049aedffde06498126b5367880e7c049ac65ddb039e1126b19866c0b9a049ac93fdb02a00126b2967844e96049a51ffe00ea0012685dff7933260498e459dd4cc8c1263917374c0ea04995695e1036001263436784119a0498bf3fe008a00126272ff7c062a04989695de040e0126219777839de04984c7fde054001260ddff7863000497d47fdc18bf4125f520b8002220497d25de205e68125ecaff6417964497b2c3a10c300125e07ff7430bd04978202de10b00125cfcff78228004971cbfe000198125c71677822800496f9d9df0c168125b25ff8806c00496c2bfd901af1125b0b0e781e000496a4bfe004800125a4aff801e2a04967495de0955812593cff78a6e60495a859dd29b8c1256a173748f400495bfffe00471012565a577411c104959698de08f581255caff78138004955f3fdf01698125566677816da049542bfdd05b5c12550b0b8042c00494ffffde0ac98125353677c4f8004948559dd13df412521573782a0004945b59dc0a7f412516d73700e4004947719de00f0012515e677c108004944719df0c00012505c678437da0493df3fdb0df59124f7d0e7c26e20493b85dde04800124e9977780c84049399d9e105d00124dfcff70173c44937f43a215f00124c9dff7057bc449327839f01488124c89778422380492e65ddd088d1124b9986741e960492e9ffde00810124b91677c06000492de59e201f68124b59ff7839c004929cbfe101698124a5c677807da04928f3fe11c398124879676c70e244921e5d9b1aa00124892ff6c68e20492265ddf12768124751ff80281a0491a77fdf194881245097778020404914059dd00804124501737846800490f9d9dd119f41243e7737443da0490fc7fe00496812439dff7c18c00490c0d9dd062f41243037380635a0490367fdd18d5c1240da0b7814220490225de20c510123fc4678007da048fe93fe103600123f4367801740048fb999e119968123d0aff746656448f42c39e09198123c7967800b9a048f12bfdf04188123c097780025e048effffe105310123a825778003c048ea059de05b981238a4677416e3048e291ce00466812385dff8809c0048df2bfd6026f11237cb0e781380048ddf3fe10e388123699777c2604048d8059e0127681234d9ff880f00048d277fde19800123305ff840240048cbf3fdc008f11232fd0e883000048c8f3fdc0bff112323d0e80537c048c265ddd14de41230998378019e048c24bfdf0480012304aff784866048bca59dc1218c122f2973703c2a048bd695df04200122ee767803480048b8559e211868122cfcff744616448b3f439d11400122d01677443da048b417fdf0ab00122c51ff842d00048ae77fe009300122b0aff782c40048a967fdb0b0f4122a5a0b802622048a705dde0780012294977681dfd048a5260e000b1012293e67785b260489d799dd16c8c12275e73781c800489b9ffdf08a0012265dff78384004895f3fdd0e0f412257d0b7411220489865de10d6981224a66778177c0488a25ddf0ad101221dc677c209a0488567fdd0825c12215a0b7819da04880f3fdf07800121fc4ff7c3a260487b719de08268121e59ff8474220487225de001758121c0aff7818c00486e9ffde0a200121b05ff74287d0486c182de01d58121a3cff781566048679d9de28d1012175a5774a3410485d698de00858121751ff8802220485d25de207e781216caff681f9a4485b2c3a002d0012169dff7805220485a25dde0a8001215e17784140404856459de04968121547ff782ca604852559dc0b28c12149573 + +def tb_67 : Nat := + 0x7c42c004c9d999dd10af413276673742b1a04c9f13fdd07f681327f1ff78d6da04c902bfdd35b5c13240b0b74b21a04c9277fde0b100132359ff84021604c8947fd9008491322520e78354004c85f3fe00e3881320997778080404c81e59dd02004132079737c0b9a04c812bfe104188132009777c140404c7ee59e011b68131e9dff88072604c7a059df09ff0131de1777821de04c7567fdf05d00131cfcff70173d04c73f42de0a098131c5c67781aa604c6f9d9e207800131b25ff80162604c6b359de08268131a4aff80871e04c5e93fe1100981316a46770402244c5a91da00d9681315caff7c3f6604c53359dd0fd8c1314cd737434e604c53dd9e207368131459ff6c1cd644c51683a2079681312d9ff78012604c4b559de1680013116d677059fd04c45b5ce21306813103cff6c4c1644c40f439e07200130fcaff84385e04c2e9ffe1087f0130b097778085e04c2b9ffdf0c0001308f767702ffd04c23ddcde0f7681307ffff743dd704c20002de0a20013075dff74287d04c1d782de0ad101305dc67742b4104c1771ce200378130505ff78189604c0fdffdf046981303b1677805a604c0d999dd0168c1303667380144004c0c559de00a6813030aff88192604c0a999dc064891302a676700f6604c0b359e20ed0013015dff743b3c44c05783a00d4881300897778385e04bfe9ffe004e0012ff59ff74137d04bfd682de0739812fee6677c431a04bf767fdd10c5c12fdda0b8833c004bf42bfda0cef112fd0b0e8454c004beedffdd152f412fbb80b7442c004beffffe00660012fb51ff7c0e2204bec65ddf0981012fa81677827fc04be785de0039f012f9997778145e04be51ffdf10b0012f83cff7442bd04be0f42dd08e9812f8b9677ce7c004bd277fdd39ef412f49e0b74d8c004bd367fe00930012f40aff78020404bce459e104e0012f343677c0e7c04bcc25de10081012f301678028aa04bc9695dd0a29c12f25a6378021604bc947fde1980012f0b9ff7465fd04bc2e82dd0d50012f17cff882c2204bc025ddf0ab7812ef5dff7c00ea04bbd695df0150012ef296780485a04bb81ffdd1215c12ee080b80320404bb1c59df0d36812eb9dff780f6604bab359e216f6812e95dff745bd644ba57839d10bf012e9c177845e2604b9f119dc1788912e7c4768807da04b9e93fde04b0012e759ff7c00c004b9a859e10450012e65c6770113c44b9971d9f0c85812e531ff74321304b94c82e21041012e215676c410044b8855d9e1bb1012e05a5784075604b80f3fde0780012dfc4ff78354004b7b719dd0d4f412dedc7378020404b6e459e211e6812da72ff74479644b69cc39d0f00012daa1677421fc04b6c25de0030a812da4257740c2704b69098df0300012da125788138004b65a59d704df112d969767c420004b61859dc107f412d861737033fc04b6265ddc0720012d8f7678840da04b5d77fda1035912d75e0e682a5a04b5edffe20736812d6caff84106204b5a25de107e7812d60aff7c6c2a04b51695de0685812d3f1ff7c35a604b4c0d9e20360012d2cd67700d7c44b4b35d9e18f0012d13e677463bd04b44f9cdf1966812cfa7ff74659704b3ea02df13e0012cd6667744f7d04b3599ce02296812cb3cff708a5704b2cf42e0000f012ca8167784e5a04b251ffe20480012c8ffff7011fc44b240039c03e8812c909777c23a604b21c59df0a66812c7caff785c4004b1967fdf00f0012c64aff7c3c2a04b15695e10bc5812c49dff8024c004b102bfdf0037812c305ff80012604b0c059de01b0012c2e6677c144004b0a559df06c0012c1e76778425a04b0377fdf04b0012c092ff7412bd04b024c2e013f9812bf536778221a04afb2bfdc0885c12becb0b7c300004af82bfde02e9812bddc677828bc04af4e5ddc0a2e412bd398388200404af2e59db0800112bcb97684120004af1c59de0d36812bb9dff78222604aec559df0270012baa6678016da04ae92bfe1078a812b9d2577c1d1604ae577fde01f9812b93e67881cda04ae32bfe10a8a812b822577c223804ade65dde02c1012b76d67700b0104addb5ce00856812b6e7ff74215704adba02dd0136812b759ff78030004ada559e003b1012b65a5778120004ad8495e11530012b353677454bc44acd4dd9e0016812b351ff7c054004accf3fde0559812b2e7678848c004ac7119dd122f112b1c4767442c004ac7719e10fc0012b05dff743efc44ac17839e0019812b05c6784008404ac1695e101d5812b03cff80300004abdf3fdb0bff112af7d0e8026e204abb85ddd09b7c12aee18384742204ab225de20a99812aa5c677c10bc04aa865ddc042e412aa198370068404aa9095de0b31012a96667702cc104aa599cdf0ccf012a8997770333904aa2660df0381012a861678443da04a9d47fe006a9812a6e76788071a04a9b2bfde0c00012a60aff702ffd04a982c2dc0418812a68977846c2a04a91695de04e7812a292ff84558004a84f3fe00720012a0caff741c7d04a832c2e015198129f796774546244a7de5d9e00c00129f6d67780a8004a7d0d9df01b00129f016788005a04a7bfffde0a5a8129e5a57 + +def tb_68 : Nat := + 0x782c4004e9167fdd0b0f413a45a0b804c2604e8ca59dd1308c13a329737803fc04e8c65ddf0441013a2d5676c110104e8b55ce11440013a191677450fd04e8645cdd1306813a1a4ff78090004e85b59e0063f013a109777418f844e84261a00ab7813a05dff7c5f2204e7b85de104800139e99776c11fc44e7a6619f0f600139ba7ff743d7d04e6ea02e10c000139ae7ff8423c404e68495dd08f04139a12637c16bc04e66dd9de156001398616774557d04e6185cdf061681397ffff804d4004e5b2bfdd134f11396cb0e742da204e5d25de013998139591678022da04e5417fdd08b5c1395060b88024004e53f3fdf043981394b96778198004e514d9df05b681393f7ff7811a604e4ec59de0d5001392dc6774353d04e4b71ce01821013915a5774608104e45698df01d5813913cff70075304e44f42e01cf98138f6d677073e304e3db5ce005100138f1c6778308404e39695e10a2f0138db767783a8004e33359dd0e9f4138ccd7384150004e31e59e002e68138c4aff8012c004e2ffffdd04af4138c000b78066604e2f999df1de68138a07ff74779704e28202dd0ff00138ae767840d2604e274d9e202e681389a4ff7c0ec404e25799e1024f01389397778074404e24719de012f013890977801d0404e22559de0136813885dff8024c004e1f2bfdc092f41387cb0b844c6204e1a65ddc13179138699867c0fde04e1967fe23c4981382956774f12244e0a55d9d35d001382fcff805bda04e0497fdd16f5c1381260b744bc004e05999dd0586813823cff78472204e0025dde05178137fb7ff881ba204dfd25ddc06e79137f49868833c004df82bfe102e98137ddc67740ba244df771da00d500137b7cff6c353c44dedf439f0d698137aa6677816da04de92bfde1ed681376e7ff707b5704ddba02dc144001377916788296a04dd9095dd0a5991376426674296404dd909bdd09600137651ff74236a04dd9695df11058137531ff800ea604dd3dd9de09600137461676c257d04dd185cdb07e0013747967782a0004dcee59dd0a7f41373b9738804e604dcca59d3013891373297680450004dc8559e2033f01371e177780f1e04dc693fde0a5001370ffff80245a04dbf2bfdf01998136fb16780270004dbc559e203768136eddff84006604dbb719df00f00136e4aff786b4004db277fde07ba8136c225788471604dac17fdd11c49136b060e78024004dabf3fe005b98136aa1677416e304daa85ce105f10136a4257780a3804da865de100720136a1257782a3c04da5a59e007e7813660aff881c6204d9665ddf13f2013645a57744fc504d91698dd1041013649567781a1604d8fc7fe00cc00136325ff7432fd04d8c982e2048001362cd677809c004d8a999de1486813615dff74521704d85782e016098135f796788030004d7db59e201368135f59ff6c04d644d7d6839e0b598135ea467780bd604d772bfde01398135db7677c1bfc04d7025dde00c78135bfcff88300004d6cf3fdf06510135a825784283804d6785ddb0a0d11359e18678060004d67119e100b881359997778180004d64e5ddc05ff41359398378090004d62559e00ca681357caff7c5c4004d5967fdd170f413565a0b744c6204d5a65ddf0ffa813555a57743fe704d55698e020058135359ff840e7c04d4c25de100378135305ff7c2d0004d4947fdd0b3f41352520b7c12c004d44c7fde0d098134ee76780071a04d3b2bfe1168a8134d625778621604d2f67fdd1884c134bda0b7c162604d28059de02f101349d25778744004d1db59de0bd001346a167742f3d04d1a85cdf0471013465a577411c104d19698df028e0134619777c0fde04d1767fde00f001345caff7c192604d15999de03468134531ff7c282604d12459de09468134351ff84177c04d0a25dde0a8001341e177881fc804d05895dd07f1113416266741fc204d0589bdd0741013416d6774140404d06459e0050101340b96774140044d02e5d9f05b6813405dff7c2b2604cfec59e107698133f03677c087c04cfb85de107a10133e676780b58004cee459dc2d5f4133b917370914404cf0895dc1ddf0133c897770254404cf7495dc06a68133dfcff7c21fc04cec25ddd087e4133b09837c488404ce79d9dd122041339e7737c0c0004ce6dd9de09168133925ff78312604ce1859de07b001337e667780b4004cdee59df05f1013375a57885e3804cd785ddb178d11335e1866c549604cd81ffde0e010133501677c294004cd1719dc0a4f413345c7378191a04ccfdffde01e001333d9ff783e2204ccb85ddd0f87c1332e18388014404ccb719da005011332dc76880d8004cca999df01368133292ff7c0e4004cc967fdc038f413325a0b88262204cc705ddc098791331c186787f4404cbf119dd1fd04132fc4737815c004cbdb59df01b00132f436778108004cbc059df00168132effff88288004cb977fe100c00132e51ff84660004cb2e7fe00d398132be6677034e244caf99d9f09300132b536780005a04cad47fe10cfa8132a825778375604ca693fde0379813296d67781b5a04ca3fffe006a9813289567741aa304ca255ce00240013287167 + +def tb_69 : Nat := + 0x840dda050eb77fe003798143aa6677c07e6050e4f99e21a4f014379977746938450de661a103b1014375e67740ec0450dd79d9f00468143759ff800f66050dc719df08310143612577420c1050d8498e00745814359dff780d26050d5a59e0135001433fcff78005a050cd47fe006a981432e767741aa3050cb9dcde00d681432d9ff784566050c7119df0621014316257741881050c5898dd03300143191677800fc050c5799e000468143159ff842826050c2e59de0f468142fc4ff743d17050bf142de25500142ba7ff843000050a3dd9dd0bff41428f77374245a050a497fde06468142892ff802b260509f999e20930014275367801b000509b9d9de0dc6814260aff743717050982c2de029881425e17784265e050951ffe00d500142472ff8020400508fc7fdf10200142201677830c005084f99e1069001420d5676c1a3c4508355d9b064681420d9ff7857000507de59dd15bf4141f7973781e000507c059e013668141dcaff744d97050772c2dd10710141dfa577804e605076dd9e001968141d9dff803de605072999dd0f78c141ca67378054005072459e1087f0141c09777421f905070260de0cc78141b3cff74331b0506cf42de13500141a07ff7810e605067119dc0438c1419c4737c222605064719de124681417f7ff7449170505fe02de19e00141659ff8426220505705dde058981413016778bdfc0504025de202310140fe6676008c04503f99d9e14868140e9dff7452170503a782dd11b68140ecaff74431a0503b67fe20ca98140dd367780f1e05033f3fdd03c6c140cfd0b7860000502df3fdd17ff4140b7d0b8048c00502967fe003ff01409c1778818de0502577fe11cc98140791677473230501e45cdf0750014071c67780d1a0501b9ffde10e001405d9ff70437d05017682de015001405c4ff7c336605013dd9e0066001404916778060005011e59df01800140461678004da0500567fde03d9814011c678004bc0500425dde13e7813ffcaff704f9b04fff2c2dc0af2014005a577c3a6204ffb85de00051013fedc677810bc04ffa65dde1738813fc89777819c804ff0895df1255813fafcff8828aa04fe9695dc0a29913fa5a6680075604fe8f3fdf0559813f9e767885b8004fe1e59db16df113f87976880b4004fdee59de0676813f751ff7419d704fdd482de0b40013f69dff7824c004fd82bfde02e9813f5dc678822da04fcc97fdd08b5913f3260e7808a604fcc0d9e00360013f2cd67740d7d04fcb35cdf0660013f26767842a0004fbbfffdf0a20013ee5dff8809c004fb677fdb026f113ed9e0e783de604fb2999de05b6813ec4aff7c12c004faffffe00030013ebfcff4800bc44faff439f0169813ebe667782a5a04facf3fe10630013ead9ff78348004fa81ffde0349813e9d367801d4004fa5799de1216813e83cff74485704fa0f42dd0ba0013e8a46778114004f9fdffdf07b0013e77cff7805a604f9d999e028c6813e4d9ff7c65a604f8d0d9dd1968c13e3437384108004f8c059de0c46813e23cff7842c004f84c7fdd10af413e1320b78030004f8497fdf06c0013e0b9ff7c2c2204f8025ddd0b07c13e0098388145e04f7edffe20660013df51ff64197c44f7d4839e1708813dde177705c1f04f77860e20480013dd99776811fc44f766619a03c7813dda4ff8424de04f7417fdc0936913dd060e7c4b0004f6f67fdc12bf413dbda0b843f0004f6b77fdc0fbf113dade0e7033c004f6c2bfdf2bba813d8225774aee704f60898dd1948813d9497780417c04f5c719de1516813d5caff74545704f572c2dd10a1013d6125780300004f542bfe02359813d2d5678012fc04f4a25de006f0013d16d677c04da04f4567fde03d9813d11c67785ac004f3ec59e004e7813ce4aff6c139a44f392c39e0499813ce0167800ffc04f3705de12280013cb99776c89fc44f2e6619b2197813cba7ff806c8404f279d9dd1b20413c9e77380618004f21859dd185f413c861737c43da04f1d47fdd10f5c13c7520b74438004f1d4d9e11680013c5e17778120004f1665dde0081013c591678424c004f11cbfe20990013c3d9ff70263c44f0f6839c08b9813c3e767780f0004f0e77fdf0037813c2ddff7cc66604eff119dd3198c13bfc47374652204f0525de004b0013bf7967781e5a04efbfffde13b0013bdc4ff80036604ef6dd9e21110013bca66774443c44ef299d9e0150013bc9167780b9a04ef12bfe10097813bbffff7c2b8004eed47fe107c9813bad567741f2244eeb55d9e1680013b96d677459fd04ee5b5cdd0cd6813ba07ff7803c004ee5799de0501013b8b96770140104ee2e5ce20136813b85dff801b0004edfc7fe20750013b77cff6c1d3c44eddf43a20169813b7666778144004edc559e01186813b5fcff8048c004ed367fe003c0013b49dff7c158404ecd0d9e02a9f013b099777c7ede04eba77fdd1fb6c13ae9e0b7456c404ebcf99df0d41013a9d25774350104ea7498e10955813a93cff74255244ea4f43a21cb0013a6ffff7072bc44e9c0039c1c99813a701677839a204e9865dde0072013a612578841d604e942bfdc1074913a50b0e + +def tb_70 : Nat := + 0x8007da0530693fde0139814c19167780bc405305895df003f014c15e6778153c0530425dde0097814c0ffff8488e6052fb719dd2238914bedc76744d40052ff2bfdd05b9814c0a467801a9a052f7f3fda06a5914bdfd0e809540052ee9ffde0a20014bb05ff782a66052e9719e004a1014ba12577c8496052dffffe20199814b7e66778221a052dd77fdd0885c14b75e0b800300052dd47fe01708814b5e1777c0144052d7719e104b0014b5916784125a052d51ffe20b29814b495676c2ca2452d255d9b08e9814b4b967781a9a052cfc7fdc06a5c14b3f20b700240052d14d9df0780014b379ff782a5a052c967fdd0a95c14b25a0b741740052ca999de2b50014afa4ff74ad3d052be942dd18f0014b0caff7c0cc0052bd799db032f414af5e737c179a052bbfffe10e68814ae197774399f052b8660e003f7814add9ff7c0540052b713fdf00d9814adb7677c3f5a052b2e7fe20180014ac7967781bfc052b025ddf00c7814abfcff8405a6052af999e01110014aad567784440052a7119e202af014a99977841200052a1719db047f114a85c76883d800529d999dc0f5f114a766768414400529c559df4140014a301677504fd0528c05cdf06a9814a1e767844b5a05282e7fde16b00149dd3677c267c05274e5ddd099e4149d3983840f1e05273f3fdd03c69149cfd0e740e0405274059df0a098149c5c67840240052714d9de1c068149a92ff7470170526a4c2dd17568149addff786e400526367fe0115981497c4677445630525f11cde12f0014969567744bbd0525a55cdd120001496a4678414c405259095de068581495d9ff781c2605255a59de051001494a66774143d0525299cde0a9681493fcff8005a60524f999df0bd00149329677c3c0005246459df03768149159ff7c1e660523c0d9de02700148edc67841d40052399d9de09510148dd2577c903c0522e459dd240e4148b9173880dda0522d67fde05088148b09777c1d040522a559df338581486d9ff74ce124521b6839d2c8e0148749778003c00521b2bfe002d0014869dff782f220521785ddd0bc7c1485e1837406ea0521a095de09978148547ff7810800521417fe006a981483e767741aa30520f9dcde05d0014837cff74173d0520df42e200300148379ff788ee605204f99dd23b8c14813e73744bc0052092bfdf19500147fa7ff800ba6051fde59e001b00147f5e67781080051fc719e003600147ee667788b1a051f2e7fdd22c5c147cba0b748640051f3359dd09468147e51ff802e80051effffdc0b9f1147c000e702c22051f025dde17da8147a8257745f67051ea098dd0ae00147b51ff741200051eedffdd04698147bb967882bbc051e74d9dd0aee11479d376742a00051e7695dd0a5f01479dc67742838051e785dde039f014799977804104051e2559dd1040414789573743804051e2e59dd099781478ffff7c275a051dfdffdd09d5c1477f80b8870e6051d8059da1c38914760176685e80051d92bfdf004681475fcff7c28aa051d5695de14f5814740aff781c62051ce65de009000147309777c28aa051c9695db0a29c14725a63780216051c947fdf0150014723cff803000051c5f3fdc0bff114717d0e7027c0051c677fdf04b00147131ff780300051c497fdf09300147092ff802262051c025de10cb10146f3e677432c0451bcf9d9d0c000146f4977742dde051bd47fdf0bd00146e81677c1e5a051b81ffe00fe88146d0977743f9f051b4260de0b778146c51ff841e00051af67fe103c00146b9dff8824c0051ac2bfdf03d98146acd67781d04051a3559dd074041468d5737c029a051a32bfe0106981467c46778311a0519bfffdd0c45c1467000b7c17a60519a859de0436814665dff7826400519713fdf09c001464cd677026fd0519335ce13c3f0146109778481840517c0d9dd20604145f037374511e0517f13fe109c00145e676788725a0517277fdd1c959145c9e0e74635a0517367fdd0a5f0145dc1778468400516bf3fdd1a0f1145afd0e7465220516c25ddd10488145b99777805400516b9ffe207500145a72ff701d3c45169cc39f018a8145a5a57803c3c05165a59dd0f0e41459697384019e051624bfe101bf014573e67788c040514ec59dd230041453b173840dda0514de7fe206f0014530aff741bbc4514c2c39e1b9f0145149777c02c405144f99e119968144fa4ff7466564513e9439d19668144fa7ff7c10800513c059e205d00144ea46764173c4513a91d9904800144eb9676406c00513b999de04368144e51ff800b400513677fde03798144d666778221a0513377fde06498144c79678407da0513167fdf114001449d36780785a0511fc7fe1027001447caff7c6000051192bfdd17ff414464b0b80138005117f3fde0a2a814455a577885bc0510d0d9e104200144301677c06c00510b999de1696814417cff8030c005102e7fe2020881440997780139e051012bfdf0f0a8143f5a57743c27050fd698e0006f0143f5367800540050fcf99e101500143f29677c71c4050f5895dd1c704143d626388259e050f1cbfdd09669143c730e885766050ec559dc15d89143b1576 + +def tb_71 : Nat := + 0x8000ea05559695de018001556425788315605555f3fdc0c54915557d0e7029160555677fe1061681553ffff6c185645550003a20d698155329677035a24554ca5da104f681552d9ff7801260554b559de0c000155215677c1bc005545b59de0510015511c6774143d0554471cde0c00015505c6778845a055392bfdd2115c154e4b0b74809a0553967fe004e00154dfcff780aaa05537495de09300154c0aff7024bd055302c2de09198154b796780419a05529cbfe10a20015475dff8007e60551cf99dd01f8c15473e737405220551d25de014df01545997784260405514059dd098041545017378011a05513f3fdf10b001543f1ff780b400550b77fdd02cf41542de0b841da6055099d9e10a5f01541c1777c19c805505695de195f0153fc467746579054ff11cdf06198153f436780603c054f1e59e000978153bffff781200054eedffe106600153b51ff60197c454ed483a103888153b1977800fde054eb67fdb03f69153ada0e781500054ea059e109ff01539e17784093c054e4e5de2095101538a467742540454e291d9d080101538b9677819da054e0f3fdd0675c15383d0b881c80054df2bfdd071f11537cb0e804c62054da65de0004681535fcff844140054cc17fdb104f11533060e6c4062054cc25dde0049815330167782280054c9cbfde1b9001530b9ff746e3d054c2e82dd14d00153125ff78513c054b8559e104200152dd367781c44054b5895de058e0152d09777800de054b417fe000900152cfcff782a66054b14d9e00b568152b9dff7c24c0054ac2bfde0b100152a59ff882622054a705ddb098791529c186801e00054a525dde00b1015293e677c1cda054a32bfdd0735c1528cb0b802a2a054a0895e0090f0152791677809000549db59e100468152759ff7c45ea05499095dd1179c15264263800a380549865dde0ff001522e7678042c005487719df07a1015216257882f7c05482919dc0bde11520a476702a3c05482e59df0676815203cff7c035a0547967fe01bc00151c9dff8405220547225de106720151c22578046380546c25dde14d00151925ff74533d05464982dd08b981519e7677c177c0546265de2099781517ffff6c265a454600039b0900015180977882b800545d47fdc0adf11517520e702b260545d4d9df0b40015169dff742cfd0545a782dd087001516caff7c3c3c05456459e109000151501677c120005452e59e2024001514956788275a0544fdffe005a0015139dff842f220544b85ddf07a101512676784434405445695da10d0115115a6668425a0544577fe108f581510caff7848c00543e9ffdf08b98150f1c677422e30543c71ce0102f0150e19777040b905438660de0b310150d66678816da054342bfde03d98150ccd6778455a0542edffde0d098150ae7677c48c005427119dd122f41509c473881f1a054251ffdb07c591509480e8803a205424e5dde01d1015091c678037da05420f3fdd0df5c15083d0b7812c00541fc7fdf1318815069977744c5f0541a660e103f78150659ff8415000540c17fdb053f11503060e7c2aea05409695df006f01502536780762605401e59dd1d8891500797674480005404c7fde19f6814fed9ff7467d7053fb682dd1276814ff51ff7c33c0053f82bfde0030014fe07ff7c53a6053f2e59dc14e8c14fcb9737c19da053f147fdf13c9814fb1567744f23053ec55cdf0930014fa4aff7c5d66053e3559dd1758c14f8d573885dc0053dd799e00046814f759ff781680053dbfffdf01ba814f64257801a16053d767fde0150014f5c4ff801200053d5f3fdd047f414f57d0b8004e6053d5a59df22c6814f33cff748b17053ccf42dd1b00014f3b9677804e6053cca59de0081014f281677c3cc0053bec59dd0f2f414efb173741200053c1719e111c5814eb05ff704712453ac1839e0090014eafcff780540053ab9ffde0750014ea72ff84a8ea0539a095dd2a39c14e6826378297c05397719e00946814e4fcff7c42000538ec59dd107f414e3b1737839000538b359df03a6814e292ff800ae6053899d9df19c6814e0caff746717053832c2dd1920014e0d5677c57660537db59de00f0014df5e677817160537677fdd05c4c14dd9e0b740bd6053772bfde10c9814dc91677883c40536a095e10a0e014d9e177742834453678619f00f0014d9c467787fda0535f13fdd1ff5c14d7c50b744bc005362559dd02af014d99977845e80053592bfdb179f114d64b0e84ac620534e65dde0081014d3916780851a05345f3fe10169814d1666778221a0534377fdf18a9814cf53677062a30533d4dcde0886814cecaff7422170533b2c2de0c30014ce07ff78296a05335895e00085814cd59ff84082205334e5ddf0c67814cc72ff7c006605331c59e10150014cc5c67786d800532a999dd1b5f414caa6738004da0532a4bfe10390014ca59ff7c162605328059e002f1014c9d257788b560531e93fde14aa814c65a578820160531767fde0346814c531ff78282605312459dd0a08c14c49173805a000530ca59e209ff014c289776c27f84530a2619f0741014c2156778144005307119dd050f414c1c473 + +def tb_72 : Nat := + 0x841c800579b9ffe00439815e6a46778119a0579977fdf063a815e5fa57780bd6057972bfdf05d0015e3fcff7c49e605788559dc1278c15e21573782eda0578567fdf0955815dfc4ff7425530577f142de0139815dfb1678869ea05777495dc1a79915ddd2667c04380577705de02301015db9167708c010576e45ce00376815db59ff8039c005769cbfde0169815da5c677c068405769095de14af015d8f7677052b905763ddcdf1b90015d73e67746e3d0575cf9cdd1996815d75dff781cda0575b2bfde048a815d682577012270575a098e20775815d60aff5c1dd2457582c39f0a2a815d45a577801bc057514d9de0180015d3d9ff803f660574b719de11af015d1c1777446b905747060e10831015d13e677420c045744f9d9e0016815d13cff8819e605743559e104bf015d089777879440573a919dc1e50415cea4737c4bc005735999dd12ef415cd667380641a0572cf3fe20679815cad5676c19e24572b55d9f165f015c91c677059790572471ce201c6815c8ffff680716457240039f0f0a815c55a57782f160571277fe00930015c40aff8041400570c17fdc104f115c3060e8407e60570b999dc01f8915c2e676843fc0057079d9dd0fef415c1e773842d5a05704c7fe10540015c0ddff6814fc457037839a0508815c0e1777c090005702e7fde0270015c092ff785040056fd47fdd140f415bf520b803ba6056f7719e10826815bd59ff780822056f4e5de019b7815bb9dff782226056ec559de0376815baddff7c0426056eb359e00270015baa66780521a056e577fe201f9815b93e677c4704056e0895dd11c0415b82263842238056de65de00330015b75e67740cbd056dd79cdf0046815b759ff783126056da559df0480015b61257881356056d713fde0270015b59dff781440056d2999e102d0015b47967784980056cd4d9dd125f415b353737c1b00056cb9d9dc06bf415b2e7738042c0056c7719dd10af415b1dc7384209a056c567fdd0825915b15a0e741f80056c5799e00fd9815b05c67743f62456c171d9d0fc0015b05dff8007da056c0f3fde0c00015af7cff882622056bb85dde0051015aedc67740141056bb71ce01837815ab05ff7830ea056a9095dc0c39c15aa4263702ca6056a94d9df0300015aa1257843b16056a497fde08c8815a8997788019e056a24bfe10319815a86167845e800569b9d9e001c6815a6caff7810620569a25dde1800015a50977705ffd05694260e205b6815a3f7ff6416d64568fe039f07b0015a37cff7c00c00568de7fe10540015a325ff6414fc4568c983990480015a331ff7c198005688059de0c46815a13cff7c12fc0568225dde04e00159f59ff70137d0567d682dc03a98159f6d677c0f660567c719dc03d8c159f1c7380071a0567bfffe106a98159e95678823d6056772bfdd08f49159dcb0e8001800567713fde0f798159ccd67743de30567335ce111568159bb7ff804da60566a059de0741015996d67881fda0565fc7fdb07f591597f20e7822e60565d999df088681596ddff7c60ea05655695e01c0e015939977801ce60564b999de29b6815904aff74a6d7056412c2dd22c681590b9ff8019260563f999e008868158f5dff7800ea0563d695e004f68158ed9ff80312605638559e028e00158b7cff8015c00562c97fdf1df10158822577477c105620898e113a581586e7ff744e930561ba02df046981586a1677811c405619695de040e0158619778401c805618495de0745815859dff741d1305616782de05e6815850aff882c400561167fdf23d001580ffff748f3d05604002e013500157fcaff7c1440055fde7fe107698157f03677c2a5a055f967fde2b200157ba7ff880ba6055ede59da02e89157b79767c3600055ea859dd0d7f4157aa17378191a055e24bfdf0199815787967783000055dee59dc0bff41577b9737801bc055dd4d9df007201576825778297c055d7719df04b00157591677c125a055d51ffdf03e881575097784259e055d1cbfdb096691574730e8005a6055d1719df25b00157201677496bd055c805ce10a36815715dff7886a6055bd0d9dd21a8c156f4373746d80055be9ffde04200156f016780005a055bbfffdf0a200156e5dff780300055b947fdf03888156e197784139e055b72bfdd04e69156dcb0e840180055b713fde05b68156d0aff880b40055b377fde03798156ca6677c0b40055b1e59e012600156b536774497d055ad4dcdd0c168156bb7ff743000055aee59de20b68156947ff7482d7055a5202dd0d110156a8257741e5a055ab67fe00ea0015685dff7826400559f13fdd098f41567c50b7812000559df3fdf216f0156343677485b90558d0dce0046681562fcff7c15000558377fe106498156079676c192245581e5da21ae68155ecaff746b964557b2c39f02d00155e9dff7866000557417fdc197f4155d060b84024005573f3fdb008f1155cfd0e84228005571cbfd9089f1155c730e78006605571c59de01e00155c53677c06c00556c2bfe102d00155addff8424c0055692bfe110e0015593cff74437c45564f439f198001557a4ff7829400555bfffe005e981556a167 + +def tb_73 : Nat := + 0x783ba6059bb719dd0ee8c166edc73743b40059bb77fde07500166e676788725a059b277fdd1c959166c9e0e74635a059b367fdd0a5f0166dc177742544059b7495df10500166b05ff8411a6059aa859e00ea00166969678000c0059a5999e10d368166892ff7850400599d47fde0139816673e67844cda059982bfde0d80016650977881d0405992559dd074011664957678275a0598fdffde0ac981662cd67742b230598b35ce004c68166259ff6c131645989683a00ffa816615a57743fe705985698e0080581660d9ff784c800597e9ffdb131f4165fa80b780ea60597db59dd03a8c165f6d738043da0597977fdd10f5c165e5e0b7c18ea05977e95e114058165cb9ff74501305972e82e205598165ae7677c1f1a059651ffde08e981658b9677423a305962e5cde0ee681657caff703b970595f2c2e20b598165715676c2d624595c55d9b0649816576667781efc0595a65dde09810165601677426010595805cdf2a768165359ff74a9d70594d682de0169816534367882aea05949695da0ab9916525a666824c005949cbfe20dd5816517cff70375245945f439e016981651666780221a0594377fdf0f798164fe667840b400593ee59df18510164d62577c3c3c05931c59dd0f0e4164c717378054005931719e108268164bd9ff6c20964592f6839b00a68164c51ff8081ea05927495df1d10016476d677803c00591d799de0ba001646a4677c120005919719dc047f416465c7384209a0591767fdd082591645da0e7410bc0591865de20a800164531ff7429fc45914c839d073981645666784282605912459db0a0891644917684060005911e59e10ff001642e767743fbc4590b9dd9d0ccf016431977742f400590ca59de05df016428977802b4405907719de1006816405dff806066058fb719e102aa8163dd2577c5238058f225de106720163c225778243c058ee459de03768163b59ff8416bc058e6dd9df04e0016396967804200058e1859dd107f4163861737c9ffc058d785dde26778163379ff7499db058cde82dd207781633d9ff745b9e058d1cbfe206f0016330aff780ba6058cb719de036001632a6677804da058ca4bfdf00d68163259ff7c03c0058c92bfe00637816315dff807c26058bdb59dd1f08c162f6d738843da058b977fdd10f59162e5e0e741b5a058bbfffde063a8162dfa57780816058b767fdf01500162dc4ff7c52da058a81ffdd14b5c162a080b7c1ae2058a4e5ddd06b7c16293983802544058a2919dd095041628a4738003c0058a2559de024001628716778a5ea05895695dd2979c16255a63782f160589277fe014400162359ff7450fd0588d682df1dd0016217cff783a80058824bfdd0e9f41620930b80066605881e59de02e6816204aff7824c00587edffdd092f4161fb80b7c23a60587ca59e108b68161e9dff6822d64587a783a119c98161d01677467230587405cdf00468161cfcff8448c00586f67fdc122f1161bda0e840f000586e77fe210b00161a92ff7442bc4586a4c39d0f798161aa667882a5a0585b9ffda0a9591616e80e68251a0585bf3fde043981616a46784365a058572bfe10c00016150aff6c2ffc458542c39b09900161531ff8804e605853dd9d5013891614f776780a8005853359e0019981613e667780b400584ee59e20df681612d9ff7c14220584a25ddc0507c1612898378931e05840f3fe007200160fcaff7801800583f13fe009c00160f15677c0cfc0583b85ddd033e4160ee1838000de0583b77fde25968160ba7ff7805a60582e459de0f000160aa1677c3a8005826dd9dd0e9f41609b77380138005825a59de072001608f767802cc40581f999df0886816075dff8405220581d25dde062101606e76780035a0581b67fe1007201606825780297c05817719e104b001605916778125a058151ffe1080581603d9ff7020124580f683a10136816039dff4804d64580e783a002400160379ff8804e60580d999de06300160303677418bd0580c0dcdd05b6816030aff7c17400580a999e20e4f01601c1777c6e40057fe93fe204b0015ff59ff6c12bc457fd683a00739815fee66778251a057f947fe00780015fdd9ff8833c0057f42bfdf0676815fb51ff7c0e7c057e665dde07d1015f91c67701f41057e471cdf0630015f8b9677816da057e177fdb05b5c15f85e0b840840057e0f3fe00450015f7f7ff7cc780057d367fdf0cf0015f40aff7433bd057d02c2df0799815f39167701e63057ce45ce1087f015f3097784031e057cbf3fdc00c6915f2fd0e7828aa057c9695dd0a29c15f25a63800216057c947fe00150015f23cff7c08e2057c865dde0e77815f131ff7439db057c4c82e000c0015f125ff785b80057bedffdd16df415efb80b781680057bd77fdf0088815ef49778002c4057bcf99e10b10015ed59ff742c3d057b5682e10508815ed097774141f057b4260df16b7815eb9dff705adb057ae782e00889815eb156778209a057aa4bfdd0825c15ea930b80302a057a7495e20745815e95dff681d12457a57839f11aa815e822577446a7057a0898e005df015e7c4677c07da0579e93fe100b8815e79977 + +def tb_74 : Nat := + 0x74521645bd82c39e1018816f5097770405f05bd4260e00037816f505ff80012605bd4059de08e6816f472ff7c05a605bd1719e10646816f3f7ff7c018005bcfc7fdf0409816f3b167801e0005bcc97fde0448816f2e17770111f05bcb860df0037816f2ddff78042605bcb359e216f6816f15dff705bd645bc57839f0d48816f0897778385e05bbe9ffe00a80016eeffff84288005bb977fdf0c00016ed9dff702ffd05bb6782df0f79816eca6678803c005bb12bfe004b0016ebffff78066605baf999dc0198c16ebe6737c0b4005baee59e207c6816eb3cff6c1f1645bacf439b0676816eb51ff781d4005ba5799de0166816e947ff7803a205ba4e5de00780016e7c4ff7c120005b9df3fe22a30016e4d9ff74a8bc45b936839d222a816e55a5778522605b8e459e11546816e23cff70551645b88f439c13f6816e251ff704dc405b89695e20238816e219777c0c8405b879d9df0b56816e131ff78a50005b7a77fdd293f416de9e0b74780005b7d47fdd0b89816e0796778412205b7665dde0372016dd62577c0a3805b74e5de10381016dd0167801e0005b6f67fdb077f116dbda0e842d0005b6c97fe20930016da92ff88526205b6525dde1b81016d79167804d4005b59719dd134f416d65c737c128405b58495de0346816d531ff78360005b5167fdf05a0016d3ffff7c498005b4b67fdb125f116d2da0e7c012605b4b559df0f90016d1dc67781bc005b45b59df00b1016d1625784117c05b44719de19f6816cf7cff7067d705b3df42e10030016cf79ff7c0ffc05b3705de02677816cb59ff7499db05b2d682e00720016cae7ff7811a605b2a859df0450016ca5c6778024005b294d9de0166816ca3cff7834e605b25a59df0f00016c8796778498005b1d4d9dd125f416c7537384005a05b1d47fe00ab7816c69dff78120005b1665ddf0981016c5016788239a05b11cbfdb08e5916c4730e6c1b0005b12559de0810016c3f1ff80060005b0f67fe10739816c36667701ce245b0d99d9c0600016c379ff7c221a05b0b77fdd0885c16c2de0b7c472205b0705de00780016c14977841a9a05afd67fdd06a5c16bf5a0b7c005a05afbfffdf13b0016bdc4ff842b1a05af42bfdf0649816bca6677c49da05aed47fdd1275c16bb520b741bfc05af025de006a9816bae76778035a05aeb67fde0049816bad56788150005aea059db053f116ba81767c1e5a05ae81ffdf09a9816b96d67781b5a05ae3fffdd06d5c16b9000b8416da05ae177fde01f6816b83cff8812c005adfc7fda04af116b7f20e7c372605adc559dd0dc8c16b715737422e605add999e02776816b49dff7c24c005ad02bfe11980016b272ff7465fc45ac9cc39d10e0016b2fcff800d8005ac8f3fde1aa0016b092ff746a7d05ac24c2e00480016b04aff883de605abd4d9db0f78916af537678005a05abd47fe00a06816ae9dff8052da05aac97fde07f9816aaa6677c131a05aa967fe12959816a7c46770a56245a9f11d9f0c46816a6ffff74311705a9c002df0e68816a6197780271e05a95f3fde0139816a569677c0dda05a94c7fe00270016a50aff8804e605a93dd9e20510016a4a6677c114005a91859de0646816a3fcff74191705a8ff42de0ab0016a351ff7c0a2605a8ca59de0540016a2d56778444005a87119de01f6816a1a4ff88090005a85b59de0510016a11c67802f9a05a8177fe109900169fc4ff74263c45a7f1439e13800169c8977704dfd05a72260de07e78169c0aff7cae0005a551ffdd2b7f41695480b744d4005a5b2bfdf00378169505ff7c132605a52e59dd04c8c1694b9737c198005a514d9e20ed0016936667743b3c45a4d99d9d0d968169379ff74288005a4ec59df08a001692dc6778125a05a4a4bfe21549816913e6774552245a44f9da11a4f0168f997774693845a3e6619e02c10168f6d6778594005a36dd9dd164f4168db77384144005a35999df09900168ccd6778209a05a312bfdf04188168c09778808c405a2f999dd02301168be6768424c005a2d4d9dd092f4168b5373781b0005a2b9d9de0df68168a07ff7818c005a2693fdc062f41689a50b7802e205a2665de101d1016891c6784275a05a1fdffdd09d5c1687f80b800b4005a1f2bfe00ed001686ddff7c472205a1705dde0e7781684d9ff7c0e7c05a0c25dde009001682fcff8419e605a0a559e002268168272ff780d8005a08f3fe10d698168166676c35a245a0599d9b0c00016817cff84101a05a0497fdb040591681260e845b80059fedffdd16df4167fb80b801680059fd77fe108400167ed9ff7420fc459fb6839f0fd98167ddc67743f63059f771cde08268167d59ff8019da059f147fe20ca68167a4aff843b40059e577fe00148816794977801bde059e367fde004981678d567785100059de459df0fc0016769567703efd059da55ce00531016764257801f56059d713fdf16398167461677c1ec0059cf999e102d001673b9677c1e00059cb67fdc077f41672da0b7c3126059c8559df115681670ffff744557059c4002e205b981670a4677c1284059c1695e108f58166fcaff6823d2459bf2c39a06858166ff1ff + +def tb_75 : Nat := + 0x80300005e092bfdb0bff117824b0e6c2c4005e0967fdb0a39817826767843c2a05e05695dd0f09c17815a63846d5605dfe93fdd1b549177fa50e746c9605dfe9ffdd01d5817813cff8006c005dfd799e204200177f1c677c06c005dfc059de0a368177e5dff7028d705df9782df00c00177e51ff78612605df3359dd1848c177ccd73840f0005df2459df09168177bffff7800c005deff3fe0026881779e17788120005de665ddf05178177947ff7c0e5e05de3fffde046981778b96778090005de2559df0240017787167802b1a05ddf13fdd0ac5c1777c50b741e5a05ddfdffde1c398177601677c011a05dd7f3fe10a2a817755a577c2f1605dd277fe1243a817725a577090e645dc96999f00858177251ff80054005dc8f3fe10238817721977780c8405dc79d9df09f00177092ff80226205dc025dde0cb10176f3e677432c105dbcf9cdd0c000176f49777c15c005dbb9d9e206600176e8167781e5a05db81ffe10a5a8176d62577c0a3805db4e5ddf03000176d0977881e5a05daf67fdc07959176bda0e780f6605dab359de202681768caff74809705da32c2e104d581765c4ff6c135245d97143a00270017659dff84216605d93dd9e202a001764cd675c0a7c45d9335d9701b001764dc677c09c005d92999de1d7f0176289777c49c805d85895e207698175f0367601da245d7c0dd98075a8175f0457601bc005d7c2bfe202700175edc676809bc45d7b71da010a10175dd257804d1605d7277fdb13449175c9e0e6c3e1605d7367fdf09300175c0aff7c1c6205d6e65de109c78175afcff6c271a45d6bf439f05f10175a425778363c05d65a59dd0d8e4175969737833fc05d6265de100678175892ff78552605d5cf99dc1548c17573e73848f4005d54059de004681754fcff8842c005d4fc7fdb10af11753f20e6c414005d4fdffe00cc00175325ff7806c005d4c2bfdf00798175303678009c005d4b719e00016817513cff885e2605d3f119db17889174fc4767807da05d3e93fe006198174f43677c06c005d3c059e100f00174e95675c03bc45d3a55da102d00174d9dff680b3c45d36783a00e400174cb9ff7438fd05d32e82e106000174c59ff7017fd05d31682e010698174b53677c348005d2a059dd0d1f4174a8173740e7c05d2c65dde289681747f7ff7ce60405d0c059dd3980417430173744fc805d15695e201b001742e66780144005d0a559de03b1017425a5778021605d0947fe10d50017417cff6c353c45d05f439b0b40017419dff7c4ede05cfd77fdd13b6c173f5e0b80054005cfca59e011e68173e0aff6c479645cf82c3a102e98173ddc677c024005cf74d9e0060f0173d01677c239a05cf1cbfdd08e5c173c730b7822e605cef9d9df14100173aa66774503d05cea99cdd10968173addff805e8005cdf119de0570017376d678003c005cdd799de1020017365c6774407d05cd971cdd0c900173695677c156605ccb9d9de00d681732d9ff7c04e605cc6459de1336817305dff744cd705cc1782dd03768173159ff740cc005cc5799de0e400172f79ff7438fd05cbde82dd0e100172f7cff74264005cbf13fe107698172f036780087c05cbb85de000510172edc677c245a05cb92bfe104998172e016784eb8005ca94d9dd3adf4172a537374c11a05cabf3fdf0ed00172966678834da05ca24bfdd0d3591728930e881ec005c9f999e00ff001726e767743fbd05c9b9dce000d681726d9ff7c15ea05c9a095de2d0f01723b16774b43905c8ec5cdf0ae0017230367880d8005c8b359de03a68172292ff7c246605c88059e00c30017213e67881a4005c83559e000a681720caff78106205c8225de00a710171e5a577429c105c79698de06000171dfa57880bd605c772bfe212498171ca66774492245c7299d9f02d00171c79678407da05c7167fe11e4981719d367840b9a05c6693fdc02e591719a50e88222605c64719e2078001718a467681dfc45c6291da20330017187167680cbc45c61c5d9e193681716ddff7064d705c5b782e10dc981716016788a20005c4de59e101f68171359ff7c162605c4c059de247681710b9ff88642605c3ca59e104200170ee76784125a05c3a77fdd04959170e9e0e74071a05c3b2bfdf09600170e07ff7c09a205c3785dde00e10170dd36784335a05c3417fdc0cd59170d060e70327c05c3425ddf00900170cfcff78228005c31cbfe201f98170c53676807e245c314dd9a018a8170c5a57847e5a05c2967fe213ba81708225778417c05c1c719de0c21017065a5774308105c19698df0e2981704f7677438a305c13ddcdd07098170569677c198005c12459e0030001704616778630005c0b559de1680017016d678403c005c05799df054f01701097774153845c04261a2009781700ffff78296a05c01695de17df016fedc677c37da05bf7f3fdd0df5c16fdfd0b78c00005bebf3fe00150016fae7ff7814a605bea559dd0528c16fa95737c0ec405be9695e10180016fa425788909605bdffffdd2424916f8000e748e3805be025ddd1e0f016f8616774723c05be1e59de0ac9816f75367742b2305bdd4dce21486816f60aff + +def tb_76 : Nat := + 0x781f800604de7fde07b0018137cff7816800604e77fe110d1018115a577c10620604225de007800180ea4678822bc0603865ddb08ae1180e19866c149a0603947fdf33210180ae76778cc810602b9dcde15f78180cb9ff78530406033359de10e78180d0aff783cde0603497fde0e778180d31ff782cc406035999db0b010180d69677c04bc0602425de00c498180295677031224600a55d9c05d001802fcff882b80060079d9e116e0018007967785b7c46001e5d9e0b568180131ff782bda06004dffde0810018016667681fda060059ffda07e0018016967841e5a05ffffffe00480017ffb7ff78168005ffd77fde003a817ff5a577801bc05ffd4d9df0016817ff51ff7851c005ff82bfde0379817fdd36788468005ff2e59db119f117fcb97678120005ff1c59e201f6817fc51ff6407d645ff1483a206a6817fb7cff7819e605fec559de00a6817fb0aff7c300005fe92bfdc0bff417fa4b0b80084005fe4f3fe20679817f8d567785eda05fdd67fde0b89817f6a167742e2305fda85cdf00c0017f69567780dda05fd977fe101ba817f64257801a1605fd767fdf03c0017f59dff80084005fd5f3fe20930017f3e667782a5a05fccf3fdd0a95c17f33d0b8804e605fcca59df09ff017f28977802a0005fc785ddd0a7f117f1e1867c119a05fc177fe10019817f05c67842ac005fbec59df0346817ef7cff7c1e6605fbc0d9e01020017ee01678077c405fb0895dd1df0417ec2263881e9605fae9ffdb07a4917eba80e6c177c05faf119df0598817ea19777c188405fa6dd9db0620417e9b77380101a05fa497fde02e9817e8f76784191a05fa24bfe00679817e4956784108005f914d9e012d6817e325ff78112205f8b85ddf0141017e2cd677c0e9a05f8a4bfe00390017e259ff700e3c45f89683a01108817e14977841d0405f83559de1680017df6d677459fd05f7db5ce200f0017df5e678406c005f7d0d9e01696817ddd9ff8403c005f772bfdf02d0017dd9dff78300005f7377fe22fc8817d9e17774bf1e45f678619d25c9817da816778074405f67119df00b8817d999777c410405f62559e009d6817d7f7ff7c018005f5fc7fde2308817d5c177748c1f05f57060de2280017d399776c89fd05f4e660e00081017d391677c060005f4de59e101f6817d359ff78774005f45f3fdf0169817d1666788573c05f4025ddc15ce117d009867046da05f412bfde0501017cfb9676c140105f3ee5ce00660017cf5367785c2205f3785de107f2017cd62577c3bd605f31cbfe00019817cc71677c054005f31719de0090017cc536780701a05f2a4bfdd1c05c17ca930b808b5605f1e93fe10139817c79167784d4005f19719de0649817c4cd67881cda05f1167fdc0735917c45a0e701b0005f11859dc0540017c4796778742205f0a25dde0741017c21567880cfc05f0785de201d1017c1c4678407da05f0693fe20469817c15e677411a245f0579da005e6817c0ffff8411a605f02e59e104a1017c05a577c1a9a05ef7f3fde2839817bb796770a0e305eede5ce1288f017b7b96774a23845edee5d9d25bf017b7e6677422bc05ee6dd9de1d7f017b5e1777475f905ed7860e10051017b5dc67785a5a05ed1cbfdd1695c17b4730b88365a05ecde7fdc0d95917b37a0e701e5a05ecf67fdf09d9817b2dc6770276305ecb71ce00360017b2a66784530405ec5695dd14c0417b15a637823d605ec32bfde16c9817af5e67745b2305ebd79ce01041017ae5a5774410105eb9698dd1006817ae5dff88255605eb713fdc0954917adc50e7023d605eb72bfe010b0017acb9ff780a2605eb2459df1110017a9c467780abc05ea665dde02c1017a96d6784324005ea2919e00b26817a7f1ff8422e605e9d999df0510017a7156784461a05e97f3fdf2839817a3796788f00005e7ee59dd3bff1179fb97674e4c005e7f999dd36ff017a0097774c00005e81e59df1b168179e07ff746c5705e78202dd13800179e81677446da05e7a77fe103498179dd3677c1c4405e75895df05400179d05ff7c2d0005e6c97fdf04800179addff78120005e692bfde00f001798caff7c2a2a05e60895e005df01797c4678007da05e5e93fde100981796a46774402305e5a91cde00f00179695677c2a3c05e55a59dd0a8e417956973880a8005e53359de06c0017946167741afd05e5185cdf07b001793e667741ebd05e4f99ce2165001792816770593c45e4a05d9c15cf017928977783c0005e46459de02f101791625788189605e43fffdc062491791000e70163805e4425ddc045f017911c677c296a05e41695de0dd58178f7cff7c00c005e3de7fe207698178f03676c1da245e3c0dd9b075a8178f04576c1bc005e3c2bfdf08268178e59ff788dea05e30895de01698178b91677c4f8005e294d9dd13df4178a53737421fc05e2c25de001110178a425784618005e21859de196681786caff74659705e1b2c2dd117f01787497788106205e1a25ddd04179178689868001c805e1a095e005178178547ff7c108005e1417fde0aba817845a577c168005e0fdffdf01e001783d9ff7c04e605e0d999e005b6817830aff + +def tb_77 : Nat := + 0x7418c00626693fe00fc0018987167703efd06261c5cdc02568189947ff8042c00625d999df088681896ddff7cd9260624de59e006ff0189309778875de06244c7fde1d7691891320e782dde0624947fde0af2018925a577808c40624b999db00c781892fcff805e800623edffde179f4188fb80b7852e60623f999df05da8188f5a57886e400621c719dd1b8f118871c7688236a06219695e004800188612577c0d2606215a59e205e6818850aff681796462142c3a11cf68188159ff7873d706205682de19800188191676c611a0620693fdf05a001880ffff8053a6061fec59e00d500187edc6780209a061f967fdf072001878f767802b26061df999dd0ac891877e67684b73c061d425dde2dce418750983785904061da095de15cf01876897778521a061da77fde09cf01877497774251a061dd47fe209678187472ff7c07e6061d14d9e12f91018715a5778be41061c5698de175681872ddff785c7c061cb85dde0ed0018736667844b5a061be9ffe01da00186db76778767d061b6ddcde1cc68186dc4ff78719a061b72bfde19710186dfa5780365a061b377fe006498186c7967741923061b1e5cdd03798186ca667841f1a061aff3fde07c59186bfd0e781bfc061b025ddf12300186ad9ff7848bd061ab682de0e388186b1977783000061acf3fde0a998186b5367781140061aedffdd04398186bb9677c54000619fdffe14b49818634367792d230618d0dcde47e98186379677919a60618e459df129f018621977784a7906188660de0e91018625a5778341a06189cbfdd0ae001862956784bc040617ca59de2f004185f297378b4000617d25dde2c778185f51ff78b1840617d4d9de13b781860ddff743cde0618497fe005e68185ecaff800b400617a77fe109600185e07ff8806c00616c2bfe107800185a92ff701dfc4616a4c39f22d581857a4ff788b530615e942de0955818593cff8429400615bfffdf05e981856a1678810da0615977fda0435918565e0e7c4b0006154c7fde12bf41855320b78384006155f3fde0c00018559dff7824c0061572bfe00270018550aff8842c00614ffffdc10af11854000e7c2b260614d4d9e207e001852d567885dc006145799de176f118515e76785a0006145b59dd1440018519167743e4006147719dd0c0001852156780785a0613df3fdd1e159184f7d0e8038e20613a65dde0e379184e99867826e20613b85ddb07998184f0367840c84061399d9e01c968184c9dff78725706132782df06720184c22578805d6061302bfe107188184b9977681c5e4612e661a200810184b91677c474006129719de11cf4184a5c7378419a06129cbfde0e400184a95677836000612a859e001f68184a3cff8870e606121e59e112768184751ff7c93000611417fde24bf41845060b7892220611425dde20a00184547ff78702606116459de1b88818459977782d000611a77fdd087001846caff741aa60611b9d9e100498184501677c011a06113f3fe110b001843f1ff7c02a60610f9d9e20496818439dff7012564610e7839c036001843b1677c24c00610c2bfdd092f418430b0b7c52620610705dde1497c1841c1837828e6061099d9de07800184292ff7819260610a999de02d001842ddff780a620610b85de00e478183fa4ff801740060fb999e204200183ea46754107c460fa91d9f0ac68183d0aff883000060f12bfde0bff1183c4b0e782466060f1e59e117100183ad9ff785c3c460eb6839e04b00183bffff845dc0060e5799de176f118395e76785cc4060e5895de1680018396d67783cfc060e785dde0cd68183a07ff781500060ea059e2054f01839097788025e060e3fffdf046981838b9678031da060dfc7fde0c75c1837f20b781740060e1719e004e0018377cff8049da060d367fdf0c168183125ff7c87fc060b425dde21fe4182d0983784500060b8559de0a800182e81677822da060ba77fe200378182d05ff800240060b3f3fe015f00182b9dff7857bd060ae782de0ab00182c51ff845100060a967fdd143f1182a5a0e802622060a705ddf0847818293cff74211b060a4f42e01cf9818276d677473e30609db5cdd072001828caff7c296a06099095e2028e018261977580a3446098661a0173101824a667785cc10609299cde122101824f76778271e06095f3fdb07b7818259dff8430000608f999dc0bff11823e67684573c0608a25de20f81018219167743e004608645d9d0f0001821997774391e0608693fdd0ad101821dc67682a000608785de027d98181edc67789f624607b71d9e11d0018203cff743fea06081695e008268181e59ff808dea06070895df09e88181b09778400de0606c17fdf0aba8181a5a5788075606068f3fe0055981819e7677c305a0606497fe11cba818175a578402160605d47fd9008491817520e8421c00605b2bfde086f11816cb0e800b400605a77fe10a8001815e17784140406056459e2199681813f7ff7866564604fe039e0fc0018149567783b4006052919de0d8001814b96778125a060551ffe01909818126767786423060499dcde116881812e177783d260604c0d9de0919818136667 + +def tb_78 : Nat := + 0x8806660644f999db019891913e676840b400644ee59e00df681912d9ff7837d64644b6839f004981912d5677c6a1a0643f13fde1a85c190fc50b78689a0643f2bfdf0af98190f1567890b5a0642b9ffde42d59190ae80e79061a0642bf3fde40bf0190b097778eeda0642d67fde38400190b916778a2fc0643225ddc27768190c9dff7050c406437495e105298190a95677014a24642a55da10de001909b76788177c0642265de1099781907ffff7c06660641f999e00886819075dff8436ea0641a095df13a58190547ff784e9306415202de0a5f01905dc67840fa20641425de10af2019045a578418960640fdffdb062491903f80e8804da0640e77fe101398190366678816da0640c2bfde05b5919030b0e8019260640a999df21cf01900897778873906402260de0e4f01901c1777816da064092bfe00e17818ffa7ff7c00c0063fe93fe20be9818fee667742fa2463fb99da20946818fe51ff8051c0063f42bfe109e8818fb197778279f063ec660e11461018f9d367785181063e74dcde1380018f9e17774445e063e81ffe2039f018f99977640e78463e6661a107d1018f91c67781f40463e471d9e0517818f947ff8818c0063e2e59e20c16818f7f7ff80c780063d367fe01969818f343677865a3063cd0dcde1489818f39167785022063ce65ddf08e6818f272ff742397063c9cc2df018a818f25a57841038063c865dde040d118f219867c271e063c5f3fdf0c30018f0b9ff882c22063c025de001bf018ef3e67800540063bca59df11e6818ee0aff840de6063b74d9de0378c18edd373806900063ab359e003a6818ea92ff845262063a525ddd1497918e949867c5e260639f119e201f6818e7a4ff8840260639a919de1008918e6a476782f400639b9ffde0a50018e6ffff7812c00639d67fdc0469818e75e677c365a063972bfdd0d95c18e5cb0b8073800638ff3fde1cdf118e3fd0e785c400639167fde0990018e531ff7c30000638cf3fe01279818e215677849e30638855cde0238818e31977886ec406381695e00955818dfc4ff840dda0637de7fe11a7a818ddd2577869e6463774999e09d9818dedc67840fde0636d67fde03f6918db5a0e7808040636de59e20967818da72ff6c259a46369cc3a00169818da5c67847ec006361859de1faf418d86173783cc006365a59de0a50018d9b767781d40063679d9de04a1018da12577807da06368f3fde01a1018da42578048c00635cf99de122f418d73e737840da0635d77fdf0736818d6caff8810620635a25dda0417918d689867d32000634705dde4c7f418d1c18378ef040634b359de3ad1018d2dc6778e1840634c0d9de2977818d3f1ff74a45e0634fdffdd2361018d45367748bc806351695dd1f41018d4956774631e06353f3fdd07e7818d60aff804b5a0633e9ffdf0649818cf43677c27c00633a919df0526818ce51ff80df260632b559e00531018ca8257844e96063251ffde13a4c18c9480b80120006323fffe214f5818c40aff7453d2463102c3a006c0018c1e767844b5a06302e7fde12d5c18c0ba0b78425a0630377fdc0c16818c125ff84abc0062f82bfde2aef118be0b0e787bc0062fb2bfde1e00018bed9ff7859a6062fd4d9dd15fa818bf5a57805466062f2e59de1518918bcb976783462062f4e5dde02e9818bddc67680a62062f785de10480018bc7167845700062ec559de15bf118bb15767834da062ee77fe00480018bacd677811fd062eb35cde0376818baddff7c1e2a062e7495e10745818b95dff847fe6062dd799de1ff8918b75e76787c26062ddb59de1cc9818b79167787122062de65dde1b90018b7a4ff784eea062e0895de0930018b8caff782226062e3559de01f9818b93e6780011a062dd67fdf0720018b6e7ff8414a6062da559de0528918b695767811a6062da859e203b1018b65a576c0ec0462d9699a2258f018b3b96780059a062ccf3fde0165918b33d0e801566062cb9d9e000d6818b2d9ff7c3f66062c7719e11230018b0b9677848bc462c2e5d9e0826818b159ff8816da062c177fdf0df6818af7cff7837d6462bdf439e01f6818b03cff7c2100062b967fdf3540018ab05ff78d4fd062ac182de1d08818ac89777c67e6062a5999de19f8c18a96673783b22062a865ddd0c90018aa3cff7430ea062a9095e01050018a861678501c406291695de4070418a45a6378959a062982bfde1df1018a682577875fc0629a25dde1966818a6caff7861da0629b67fde17a0018a6e7677848c00629cf99de10f6818a751ff8837560628df3fe10570018a325ff7015bc4628c9839f0448818a2e17780139e0628a4bfe01bd9818a0d56780029a062832bfe115d98189f6d677857624627db5d9e15198189f79677849800627e93fde12300189fa7ff7c0a800627d0d9e002700189f1c677c308406279695e100858189e51ff8815ea06277e95df05c58189d9dff74171306276782df0e400189cb9ff7c18000627167fe11d898189a81677876224626a05d9e1d7a8189a82577847400626cf3fdd10800189b51ff841e5a062681ffe209a9818996d677426a246265b5d9d06e8818999977 + +def tb_79 : Nat := + 0x787d3d066d7f42de0dc9819b715677822e6066dd999e203c0019b49dff804122066ce65dde1047919b399867cfc00066bd4d9de3eff419af537378aa7c066c265ddf1f96819ad59ff848d00066ac97fdd233f119ab260e748a00066acc7fdd1f39819ab66677c06c0066ac2bfdf0b10019aa59ff7ccdc806698495de3371419a61263781f9e066a32bfde00c7819a93cff8041d6066942bfdf0649819a4a6678042000668d47fdf00ff019a319777c554406687119e20750019a11c67781d3c4668471d9f012f019a109777c74220667225dde1d07c199c8983786f000667277fdf1a178199ae7ff7c0b9a06669cbfe2178e019989977785e34466626619e11af01998f7677816bc06666dd9df03810199861677c43da0665d47fe004200199505ff8443800664fdffde10df41993f80b782ca6066514d9dd070981994956774132606652e59dd009001994fcff8411a60664ec59e004b00199366677c34da0664a4bfdd0d35c1992930b843cfc06635999de0f3e1198d66767828bc06636dd9df0ed00198c7967783b3d06631e5cde09900198ccd67880b9a0662edffd902e59198bb80e7c34260662b9d9e00df68198a07ff803ae606624719de0eb8c19891c73801d0406622559df02400198871678004da0662177fdf1318819869977806fde0661367fde1bf6c1984da0b8477400660bf3fdc1dcf11982fd0e7c228006609cbfdd089f41982730b840d8006608f3fdf0d6981981666780101a0660497fe011c881980097784805e065f81ffde2016c197e080b783000065fd25ddd0b778197f51ff74145e065fedffe102b98197ddc677c36c0065f4059e005b68197a4aff843b40065e577fe201488197949777c7c80065db9ffdd1f1f41976e80b7c14a6065da559e116368197531ff7c2580065d1859df07b001973e667800b40065cee59e21a400197215677468fc465c855d9d13800197281677437da065cb67fe01da00196fcaff78767d065bf2c2de1489819705c677851c0065c177fde100981970a467782940065c3fffe117100196e59ff785c3d065b9682de16398196e6767783ba6065bb719de0b598196f1567844380065abf3fdd10df1196afd0e7c11a6065aa859df09300196892ff7c82620659a25de00f00019659977743bfc46596661a10e0101964b96770380046592e5d9c09c781964fcff8428da0658fc7fde0a35c1963f20b780ec406591695df12300196259ff7848bd06589682de0d6981962a667782be60658b359de09b881962e1777819e60658c559de05700196325ff7c00ea06585695e0080581960d9ff8458260657de59e101f68195f59ff7407d70657d682e00b598195ea46784365a065772bfde0d959195dcb0e78329a0657767fde0aa10195dfa5778149a0657947fdd04a10195e5a577c04e606576dd9e01ba68195bfcff786e970656ff42de1adf0195c097778575a0657167fde13e00195c796774498006572459dd0fd68195cb9ff8045660656b9d9df06510195a82577c37560656693fde0dd4c1959a50b782f7c06567119de0aef01959d36778297c06567719dd0a0e01959e177801ae206564e5dde06b791959398680200406562e59e202400195895678860000655c559dd17ff11957157674329a0655f2bfe207bf019569977800fde0655967fdf00f0019564aff80bc400654d67fde2f0f419535a0b783c2a06555695dc089881955c1778405a60654d0d9df02d00194fb9678802160653567fdf35898194a016778d6230652805cde30000194a59ff78b1c00652a4bfde18000194bd9ff7041a6065314d9df003001946a16784068406519095e0077581945caff781dd3065172c2df0649819456667801aa60650b9d9e1046981940b9677c1da6064fc0d9e038778193b59ff74e1db064ed682df147a8193a12577851e7064e8498e202af01939e767880c00064e6dd9d602ff11939b77684245a064e497fdc091591939260e7c3126064e1859e107b001937e6677c0b40064dee59e1362581933f7ff78d893064cfe02de2fdf019345c6774b9d6064d1cbfe101e001933d9ff6c077c464cf6839b010981933e7677c0a62064cb85ddf005101932dc678046bc064c705ddf0637819315dff806666064bf119e206600192f5e6778197c464bd79d9e05700192f6d6784005a064bbfffe20d398192be6678424c0064ad4d9e00d110192a8257783441064aa098e205b981928a4678003c0064a2559df02400192871677c0540064a1719df06a681927f1ff7c0b400649f13fe00af9819271567782be30649c55cde05e9819276667809dda0649277fe00930019240aff7c6c2a06489695de1b09c19225a63782c400648d67fdf1c758192092ff7871d3064824c2de1c0e01920997778681606482e7fde0dd5819217cff781cbc064879d9e001998192079678076da0647a77fde1db5c191e9e0b7854000647ca59de0c000191fb967781bfc0648025de10bc88191de177782f1f06477860e008778191d59ff7c3f6606471719dd0fd8c191c5c737c1aa60646f9d9e004968191b9dff7c1e000646c97fe02a6001917a4ff78a97d0645e942de089881919c177 + +def tb_80 : Nat := + 0x7869bd069192c2de158881a46997784c1e60690d0d9de3078c1a434373783c2a06915695e0042001a4301678006c00690b999e022c681a40b9ff788b1706902e82de169681a417cff8008220690265ddf13b781a3f5dff784edb068fd782de04e781a404aff8001bc068fd4d9e0015001a3f3e677c2a2a068f5895e1058e01a3d0977881404068f2e59e2046681a3c72ff807326068ea999df02af01a379977800b04068ddb59e200f001a375e6788011a068dd67fe00fd981a365c67783f63068d971ce004a101a3612577c2a3c068d5a59de0a8e41a356973781d16068d677fdf1b0001a33b967786bfd068cee5cde16c681a33fcff783c00068d1e59e0066001a33536784059a068ccf3fde016591a333d0e881566068cb9d9da055891a32e7766808e2068cc65ddf00d681a32d9ff804d40068c693fde134f11a31a50e784566068c7119df042a81a3162577010a7068c5898e0003f01a315e67842940068c2e59de0a4f11a30b976881740068c1719dc05cf11a305c768025da068bf13fe2048001a2f7cff8800c0068bde7fe13d2001a2ba7ff78f47d068aea02de17d001a2dfcff785e26068b8059de12f001a2e4aff782622068bb85de20a2001a2b05ff7c0240068abf3fdf145981a29b7677c1440068a5999e0040681a2925ff804fe60689f999de13f8c1a27e6737824c0068a24bfde08c881a28997780431a0689b67fde10c591a26da0e783fc00689b9d9de094681a2751ff8033c0068982bfe1029881a25e1777c7bde0688fc7fde1ef6c1a23f20b785b9e06891cbfde0d8001a25097788c72606883559de31c891a20d57678ace606884f99de1f0981a220167783ba60688c0d9dc0cc001a2325ff8812fc0688225ddc04be11a2089867c1b000687a559e202f581a1dcaff7c0dda0687167fe0051781a1bb7ff881ec00686cf3fdf178981a19c467785e230686711cde135001a1a07ff8007da0686693fe2100981a18a4677440224686291d9d088981a191c67842b1a0685fdffdf19e001a1659ff8026220685705ddf248101a1379677c1e000684c059df00d681a0ed9ff7c03c00683b2bfe10f7981a0dd367783de3068374dce10cd681a0d05ff783356468341839e0c9f01a0d0977882ca6068314d9de0b2891a0c53767824c006831cbfe135aa81a08225778d6a6468208999e1bb881a09c177745ee606828059dd123001a0a59ff882a5a0681b9ffdd0a9591a06e80e8048c00681713fde122f41a05c50b7843800681767fe2133981a049167784ce24681245d9e0f7981a04cd6778336606813dd9dc0ba001a050aff7c060006811e59e01a4001a02d5677868fd0680b55ce01b9001a011c67786e3d0680471cde17b681a0159ff745dc006805799e12400019fedc67788ffc467fb71d9e23af019fee177788640067fc0d9de1516819ffcaff74308406801695e0042f019fe99778419c8067f0895e01c80019fa5a577471fd067e9698dd1255819fafcff7c783c067e1e59de1e0e419f87973781cbc067e79d9de01d5819fa3cff7c4980067dd4d9de125f419f753737824c0067df999e10016819f751ff803066067d7719de0c18c19f5dc737824c0067d82bfdf0db0019f501677436bd067d405ce10a50019f45c6770293c467d171d9f0136819f39dff7c095a067cb77fe10dc9819f20167783722467c805d9e0769819f267677cc05a067bbfffde3015c19ef000b785dfc067c225ddc12c0019f0d567885880067b677fdd161f119ed9e0e803de6067b2999df10c6819ead9ff784317067ab682de0a96819eb3cff7c3480067a81ffdf0349819e9d3677c22da067a51ffdd08b5c19e9480b8054000679fdffde14ff419e7f80b7842c0067a0f3fe04669819e391677919a30678e45cde31e0019e4d9ff7824660679d999e1177f019e21977785df8467886619e1546819e23cff784dc406789695de0900019e30167881b0006782e7fdb06bf119e0ba0e7c102606781e59e10c16819dfb7ff7830570677ee02df1d68819dde17774759f06777860e10480019dd997788aede0676b77fde2bb6919dade0e786fde0676f67fde0937819dd05ff7c12c00676a4bfe01498819d9497784bb4406759719de2ed0119d65c76788b440675c719de1b81019d791677849c806760895e22359819d2d567708d624674b55d9f04bf019d28977880f6606744719e116b0019cfb1677c599a067392bfdd1665919ce4b0e7c22620673705dde0897c19cdc1837cd94406729719df0750019c9e7677c5b8006721e59df1036819c75dff8002a60671d4d9df0501019c591677814010671645cdf1b76819c3d9ff786dd70670f682de19f6819c3f1ff7822da0671417fe003c0019c39dff7c7080066f6dd9de1c1f419bdb773786d1a066f713fde17f1019bdfa57781e5a066fbfffe00ac6819bd0aff801926066f2999e20466819bc4aff741196466f12c3a20660019ba81678048c0066e5799de122f419b95e73784500066e5b59e1054f019b909776c1538466e42619f0981019b87167782601066e1c5cde0501019b8b967881fda066dfc7fde07f5919b7f20e780d1a066e0f3fe01f50019b5fcff + +def tb_81 : Nat := + 0x7c02e206b6665ddf104101ad895678111de06b3d47fde4476c1acf520b79118406b3d4d9de2bb781ad0ddff7899de06b44c7fde233101ad166677c528006b381ffde149f41ace080b7821c006b3b2bfe00a5a81acd625780ace606b2a999de2b38c1acaa6737841a606b314d9de0fd981acc5c67783a2606b31c59de0e7001acc72ff80de0006b19695de377f11ac65a6678dd7c06b19719de22d581ac7a4ff7c201606b1767fe010c981ac4cd6778432306b1335cde0a8001ac531ff7c5a0006b0ca59e1147f01ac1e1777451f846b078619d114001ac215677427fc06b0a25de1013981ac1916784360006b02e59de0d7f11ac0b97678245a06b03fffde087f01ac10977780cc006b05799e0015001ac0a4677c365a06aff2bfdf0ee981abedc677cafda06aee9ffe00a2001abb05ff802a6606ae9719e204a101aba125770128046ae8499a2258f01ab7b96778963846adee5d9e22bf01ab7e66778849606adffffdc1b0f01ab861678016da06add77fdf00c001ab751ff7c354006ad1cbfde0d4f41ab4730b782ca606ad2559df081001ab3f1ff74203d06acfc82e10ee981ab30367743ba306acc0dcdd078001ab379ff7c09c006acb719df04c681ab259ff7c03c006ac92bfdf180001ab0caff80498006abe93fe014aa81aae5a577852a706ab9698de0a5001aaeffff7828e606abc059de046981aaf5e67780de606abdb59df00c781aabfcff8005a606aaf999e2168001aa96d677859fc46aa5b5d9e13bf01aa9997778444006aa7119e1147001aa715677451bc46a9c55da2118681aa5fcff7d60e606a81e59de5838c1aa079737950c006a82e7fde480001aa17cff79056606a879d9de3ab001aa251ff78bee606a8c059dc2a3001aa359ff84a98006a774d9de2a5f41a9dd373784ec006a7cf99dc0c1681a9fb7ff80267c06a74e5dde099e41a9d3983781e5a06a7567fe2033781a9d05ff7c024006a73f3fdf0a9981a9c5367804b5a06a6c97fdc12d591a9b260e80120006a6b77fdf0dc681a96e7ff7c10e606a5a919e1062101a964257841c2606a55a59e1072001a94f767880a8006a53359e00a9681a93fcff8434e606a4ca59de0d38c1a93297388660006a46459dd197f11a9191767463fc06a4665ddd184681a91a4ff74534006a47719e1037681a9159ff84168006a43fffda059f11a91000e68142206a4425ddf0a5a81a905a577c375606a3df3fdf095101a8dd257848a9606a2e9ffe1016981a8b91677c14c406a29095e2005581a8a3cff800aaa06a28495df11af01a88f767846b7c06a1d25ddf228001a845a577889fd06a11698de17c581a8505ff785e3806a1425dde13a581a8547ff84021606a1147fe105a001a83f7ff7c042606a0f9d9df036001a83b167740d7d06a0ec5cdf034681a837cff8804e606a0d999e111b681a824aff80432606a04f99e01e0001a7f5e677877fd069fd79cdf100681a7e5dff784017069f9782de078001a7ee667781740069fc059de042001a7f1c678804da069f2e7fd4013591a7cba0e7c2f40069eff3fdd0bcf41a7bfd0b8810e6069eee59df137101a7a8257704dc1069ea098dc067681a7b51ff84003c069ea059e20e7f01a7999777439f8469e66619f048001a78ffff7c2880069e177fdd0a1f41a785e0b881980069dfdffe2033001a77c4ff680cbc469df143a026aa81a755a57749aa7069d5698dd1c8001a75fcff7c53d6069d02bfe0071881a739977842400069cc25ddb08ff11a73098680031e069cbf3fdb00c691a72fd0e883000069c5f3fe1057001a7125ff7415bc469c4983a011c881a70097784145e069bedffdf079981a6f3e67701e63069bcf9cdc06e881a6f4977842f40069ba059dc0bcf11a6e8176881e5a069b81ffe00b4001a6b9dff842c40069a967fdd0b0f11a6a5a0e741e00069aa4bfe200a681a68caff8041a60699f119e202af01a6799776c0ab84699e661a2099781a66ffff70265a4699c0039c098101a670167700fde0699d67fe00c0001a659dff782ffd06996782de099001a65c4ff800d2606995a59e045ff01a6109777517f8469842619f0af201a605a578430660697c0d9e209c001a5e67677026fc469799dd9c096001a5e6d67701a7c0697a65ddf095101a5dd2578471d6069702bfe1071881a5b997780271e0696bf3fdf015001a5ae7ff7c060006969095e10cff01a5899776c33f846962661a22b8001a55e17778adfc469578619e291781a5607ff78a39e069582bfde1ce781a56caff784fc80695d695dd13b781a575dff7c8c040694ec59de230041a53b173787bde0694fc7fe0037681a5379ff8415000694c97fe2022981a5303677408a24694c0dd9d021a81a5304577c6e7c0694525de017a001a4fc4677c20400693d0d9de080f41a4f4373780abc0693e65de00f1681a4e51ff783c5706939482de042001a4f016780139e069372bfe1064981a4d66677419224693599da2088681a4cddff7c192606931e59e201f681a4c59ff805ca60692b9d9de172891a4ae7767850220692c65dde108001a4b51ff7cbd5a0691fc7fde2f55c1a47f20b784500069274d9df1a7001a464aff + +def tb_82 : Nat := + 0x7c01c806dda095e10f0f01b759167783c3906dd645ce01a3101b7366677868c106dcd99cde0ad101b745c6788821a06dc577fdd208591b715e0e80222606dc3559e112d681b6fa7ff84192606dbd0d9e1042001b6f01678428da06db977fdd0a3591b6e5e0e7c030006db947fe1078001b6dd9ff781dfc46db7683a2015001b6dc4ff78053c46db7143a005b681b6d0aff80192606db2999df07c681b6bfcff7c10e606daee59df09ff01b6b19777427f906dac660dd066001b6b5367840fde06dab67fe12e2001b67f7ff78b87d06d9fe02de27c001b685dff800cc006d9f13fe0016981b67666784830406d95695e11c8f01b6391676c723846d8e45da111e681b6272ff78479646d89cc39e094681b62fcff78138006d8d0d9df141001b6131ff882e2606d81e59e112ff01b5f4977704bf846d7d261a024c781b5cfcff78931a46d73f439e243781b5d05ff74505e06d781ffdf01e001b5c536780120006d6b77fdd047f11b5ade0e8024c006d692bfe1078a81b59d2578010da06d5977fe10dbf01b556667844e0006d4ca59de137f41b53297380450006d48559de113f41b52157378150006d4b559df039001b51dc67841bc006d45b59df00f001b515e6780108006d44719df0c0001b505c677c70bc06d3a65de1258f01b4b796778963906d2de5cde1c7581b4c0aff746c0006d30895e10a2001b475dff88030006d1d47fdb00bf11b47520e88022206d1d25de1062101b46e76778188106d1b9dce11e1681b4505ff78785646d141839e1ddf01b45097778537c06d1665de10f8881b42e1777c00de06d0b77fe010d101b415a5788201606d0367fe2115981b3fc46770456246cff11d9f01f681b3fa4ff806aaa06cf7e95de1aa9c1b3dfa6378186606cfd0d9df180f01b3c79677c0b9a06cf12bfe204b001b3bffff7812bc46cf00039f048001b3bb7ff7c27a206cec65dde09e7c1b3b19837c0c0006ce425de1050101b38b9677c174006ce1719e104b001b37f1ff847c2606cd8059de1f08c1b36017378562206cda65ddd075001b377cff80011a06cd7f3fdf2fb981b33016774bee306ccc05cdd2f7001b3305ff747c8006cd02bfdc15f001b349dff880d8006cc8f3fdf117001b3125ff803c2a06cbd695e0144f01b2e156784108006cb74d9e1071101b2d6257802d5a06cae77fdf110881b29497774441f06ca5260e000b101b293e6784005a06ca4f3fdf11aa81b2822577c243c06c9e459df133681b265dff784cd706c99782de037681b2759ff8806ea06c99095e00ff001b22e76788aa9a06c80f3fde2aa591b203d0e7890c006c82919de18d681b2159ff78614406c85895de156001b2191677842c006c87719df078001b1fc4ff843a2606c7b719e000d681b1e59ff886f0006c7277fe0194881b1b097778651f06c6c260e1003781b1b05ff8424c006c69cbfe0036001b1a3cff7c156606c679d9e11e7681b17ffff7879d646c600039e14df01b189977783c0006c63dd9df0ae001b1751ff7c022206c5d25ddf0c7201b168257803c3c06c56459df0d8001b14b9677835fd06c52e5cde090001b1501677c434406c45695e008f581b10caff8448c006c3e9ffdf00e881b0f99777c600006c3865ddd17ff41b0e198380264006c33359e2115681b0bb7ff70455646c2ee039c0e7001b0be667846c0006c281ffde1aff11b0a080e7c3fa206c2425dde0fe7c1b090983783ae606c24719de0ce881b09397778300006c251ffdf117781b07f1ff7845db06c1fc82e1114001b06ddff7444fc46c1b783a2084001b0659ff7420fc46c19683a1098881b05c1778899de06c0d67fe2054001b0305ff84021606c0947fde0084c1b02520b7c1aa606c079d9e222f681affb7ff748bd646bfee039d1e7681affffff8033c006bf82bfe01b9001afc51ff786e3d06bf1482de151981afcb96778426606bf4059e10d5001afb7cff70353c46bedf439f067981afb15677c0dda06beb77fdd0375c1afade0b7c684006be4f3fdd1a0f41af93d0b7424c006be92bfe11de981af75e677477a246bdd79da005e681af6ffff802f6a06bd9095e20a4581af59dff78291246bd67839e08af01af5b767781f5606bd713fe2021001af57cff7c2a0006bcee59e007c681af33cff882a0006bca059dd0a7f11af2817680371a06bc693fe1147001af05dff7851bc46bc17839e100981af0a46770294006bc3fffe1001981af05c6780a28406bb7495de28a041aedd263782ac006bbec59e0009001aeafcff80054006bab9ffe20ce881aea197778339e46ba86619e075001aea72ff842cc406ba5999df040681ae925ff84930006b9b67fdc24bf11ae6da0e7c15ea06b9a095e00a5f01ae5dc677c12c006b96459e2043981ae4b9677c090006b92559df22e001ae26767788b7d06b899dcde1c8001ae2cd67786cfc06b8b85dde0e4001ae3b1677028da06b8fc7fe21dc101adf6d6774770046b7db5d9d1d0101adf79677c081606b7767fe100f001addcaff7c4e6606b72459de1398c1adc9173780b4006b7677fdf210001ada81677883fc46b6a05d9e20f101ada82578027fc06b6785ddf005101ad9dc67 + +def tb_83 : Nat := + 0x746e400708947fe0020101c20796778080047081e5da102e681c204aff8424660707ee59dc091891c1fb9767019260707f999df001681c1fb7ff8023a60707ca59e008b681c1e9dff7c51000707567fe0058981c1d01677c42fc0706705ddd10be41c19c183802a5a0705b9ffe0301981c13e66778c0630704f99cde21a981c14cd67787c2607053dd9e102d001c13b96780931e07040f3fe2012001c0f036758047c4703c0dd96011101c0f045780408007038059de101f41c0e01737809c00703b719de025681c0eddff84965a0702e9ffdc259591c0ba80e8805a60702e459df0f0001c0aa1677c03000702a559e1072001c08f76788177c0702265de20b3101c07e667702cc04701f99da1014881c0749777c18840701b9d9e0065101c0682577819410701a098de05df01c0689777c3c3c07016459df028981c03b167800dda0700de7fdf064981c0315677819230700c55cdf012001c03036770047d0700c0dce2141f01c01c1778476da06ff42bfde1db591bfd0b0e78431a06ff767fe1051001bfcb9ff7c2e8006feffffe00ae001bfb51ff782b7d06fed482e20d0981bfa8167842b8006fe74d9df175681bf85dff785d5706fe1782de11a001bf8b967782dc006fe4719dd08b681bf947ff80198006fdfdffdf22b001bf272ff748abd06fc9cc2df0f6001bf17cff783d7d06fc5f42de059881bf219778012c006fc4c7fe0051781befb7ff80168006fbd77fe1153001bee0aff7854bc46fb82c39e034981bef29677807e606fbcf99de014881bef497778030006fbd47fe1003001bee07ff842b8006fb567fe2030001bed0977843ec406fa7495de0fb041be9d26384223806fa525dde088d11be9498684031e06fa4f3fe00a8a81be8225788177c06f9f119df0dc681be6e7ff78371706f9ba02de02af01be7997780228006f9977fe1321001be33cff78c83c46f8cf439e261001be3fcff7824c006f972bfdf1e3001be159ff84142206f8425de10cc781be03cff74331a46f80f439f078001bdfc4ff7c04e606f7ec59e01eff01bddc177787bf906f77060de1df101bddd25774354006f7b719e00e7001bda72ff88177c06f6265de013b781bd75dff8024c006f5b2bfdf048a81bd6825784615606f53f3fde185491bd4fd0e78603c06f54059e00a2a81bd45a577c01bc06f514d9e0079681bd3d9ff88432606f4b359de10c891bd2cd76783f6606f4b719e0074101bd0d567781d0106f4355cde00c781bd13cff7c900006f3a559de23ff41bce9573788c4006f3a919de192001bcf43677c10da06f3947fe043bf01bc69977790ef906f1a660de1d5681bc8ffff786e4006f24719dd18d681bc947ff807ede06f1277fe21b7981bc2e667746de246f0b99da2051001bc295678009c006f024bfdf001681bbf51ff807e0006ef567fde1f7f41bbd5a0b785d6606ef7719e0020881bbd397784890406eec559dd224011bbb15767c929a06ee32bfde24a5c1bb8cb0b7875c006ee4f99de1b7681bb95dff7850c406ee7495de06f001bbaa66778120006eeb359e00a8a81bb822577c243c06ede459e1024001bb76d677c011a06edd67fe00c4981bb695677c678006ed3dd9de19df41bb4f773783dda06ed677fe102d001bb479678037da06ecb67fde0df591bb2da0e78348006ecb9d9de07c681bb33cff84282606ec2e59e205d001bb05c6770173c46ec171da00df681baf7cff7837d646ebdf439e01f681bb03cff7c00c006ebde7fe209c001baeddff7826fc46ebb7839f49ba81baa42577926e706ea9098de3d8001bab05ff78952206eb225de10ec581ba925ff7c840006e9a25dde20ff41ba6898378739e06e9b2bfde1b2101ba6e767780e0406ea1859df180001ba509777c2d8406e914d9e105b681ba3f7ff7c198006e88059e00c4681ba13cff8019e606e83559e104bf01ba089777c385e06e7e9ffdf04e001b9f59ff7c26c406e77e95de09b041b9dfa637810da06e7947fe105c581b9d9dff78171246e767839e042f01b9db767780d5606e7713fe00d0981b9ccd677c6c0006e681ffe1026881b99e17784265e06e651ffde0996c1b99480b781d0406e65b59e1156001b97f1ff78557d06e5fc82e10b3101b92e667782cc046e4b99d9e0b1781b92e7ff78271e06e4bf3fde090001b930977780fde06e4d67fdf208681b90ddff7c090006e42e7fe006f001b904aff88192606e3f999db064891b8fe6767c230406e3d695de08c041b8f5a6378221a06e3d77fe0030f01b8f296781050006e2c559de413f41b8b15737900da06e2c97fde3ac681b8b7cff78ad9a06e31cbfde11e681b8e0aff78450006e38559e212c001b88d5677c417c06e1c719e0034681b86e7ff8811c406e19695da047011b865a667c103806e1865ddf070981b856967781c2306e15a5cdf300001b8159ff8863c006dff2bfdd18ef11b7fcb0e743fea06e01695df2b2001b7ba7ff7c0ba606dede59df091681b7ae7ff7c030006dea559df19e001b78f76784674406ddd695de19d041b775a63784f8006ddee59de111001b77e667781f8006de1e59e0006f01b77536788027c06ddd25de00c0001b768977 + +def tb_84 : Nat := + 0x78051e4731d2619e00c001cc751ff7c5a000731785dde167f41cc5e1838812000731665ddf120001cc1c1777447fd07307060e201f681cbfa4ff845280072f6dd9e113e001cbc7967840b9a072f12bfe0122101cbae76780035a072eb67fe10d2001cba07ff78347d072e8202e005e681cb8ffff802880072e177fde0a1f41cb85e0b840066072e1719e2016981cb766678024c0072d02bfe0071881cb39977882280072c9cbfdf036001cb23cff8468e2072c265ddb1a3791cb09986805184072bd4d9de146041caf537378139e072c12bfdf001681caf51ff80b826072b1c59de2e08c1cac7173782d00072ba77fe014b681cab25ff881fe6072aa999dc07f891caaa676701626072ab359e22e2001ca7c46774b87c4729f11da106a681ca759ff847c2607295a59de1f08c1ca5697378774007295f3fdd147a81ca61257840dda07294c7fdf03a981ca4f76784131a0729167fde04c591ca45a0e8017400728ff3fe0127981ca2d5677849e30728b55cde0d3981ca329677c510007286459de143f41ca19173784c1a0728693fdf098881c9dc177806d9e072702bfde1b66c1c9c0b0b784e000727225ddf063001c9ba7ff7c4d4007269cbfe21d9881c98997780265e0725ffffdc0996c1c98000b8470620725425de000c781c94fcff8824660724d999dc091891c936676701f800724de7fe108a001c92dc6788608407245695de182011c915a66781d40072499d9e101bf01c913e6780005a07244f3fe11a3881c8f9977880b040723db59d902c011c8f6d767c14400723c719e00c2101c8e5a577c28bc07236dd9e20ea001c8ccd67743a7c4723335da1082681c8c4aff702096472312c3a0019981c8be6677c0b9a0722edffe0213001c89a4ff7884bd07226942de1b0001c8a07ff7834260722b9d9e200b881c8999777c180007224e5dde05ff41c8939837c074407224719e20be681c885dff742f96472217839d0ab001c8871677c8da20721705dde2367c1c85c1837846800721b77fe0096781c8272ff78259b07209cc2de00c781c82fcff80aec0071fedffde2baf41c7fb80b789a620720025dde14d001c8125ff7c1ba2071fd25dde06e7c1c7f49837c505e071f81ffdf082681c7d59ff7c1422071f425de03c0001c79497778effd071e5260de2be781c7a4aff7898c4071ea999de1f4101c7b156778631e071edf3fde0b7781c7c51ff781404071f2e59e0004981c78d5677c5100071de459e207d581c75c4ff6c1f52471d71439b077581c75caff8858e6071d1859dc163891c7461767058aa071d1895e00a8001c73b9677429fc471cee5d9f0f8881c71e1778061c8071c1695de187141c705a63784f44071c2919dd0e1781c70ffff7c513c071bc559e2037681c6eddff800066071bb719e001c681c6e4aff700716471b92c3a0017581c6c0aff7c1380071a94d9df0ea001c6969677c85da0719d47fde2175c1c67520b78359a071a24bfe2013981c673e67848d3c0719425dde234e41c65098378573c0719785de1050101c64b9676c140047192e5da0024001c64956784275a0718fdffdf07b001c637cff8000c00718de7fe216f681c615dff745bd647185783a0003a81c615a577c6c960717e9ffdf0c9001c5ea46788719a0717377fde1c6591c5cde0e78419a0717677fde0aa101c5dfa5778149a0717947fe0024001c5cb9ff802f400716ff3fdf17aa81c5a8257882f7c07167119dc0bde11c59c476702bbc071674d9e016e781c57caff745b9b0715f2c2e20b5981c5715677c329a071592bfde0ca5c1c564b0b7c126607158059e0267f01c539977880fde0714d67fdf016981c53436780719a07145f3fde1c65c1c517d0b780f5a0714c17fe0016981c5166678060000713f999de17ff11c4fe67678221a0714377fe228c681c4d59ff74a31647135683a10fd981c4c5c67743f624713171d9f104101c465a5778410107119698de102001c465c678823d6071172bfdd08f491c45cb0e8878000710d47fde1dff11c43520e7852e60710f999de0b8981c4479678032220710a25ddf07a101c4162577c00fc07105799e2100681c405dff846066070fb719e010a101c3dd257784281070f7498de0df681c3dfcff845238070f225de2090f01c3b91676c2438470ee45d9b088e01c3b9977845fc4070e8495de17f041c3a12638416bc070e6dd9e1091681c3925ff782456470e49839f0c4981c3861677c9ffc070d785de00e0101c35016780239a070d1cbfe1099001c33d9ff841800070cde7fe006f001c330aff880ba6070cb719dc02e891c32dc768804da070ca4bfe02a3001c2fc46778a8bd070bf11cde109681c315dff78297c070c705dde01c681c324aff7c1980070bd799dd065f41c2f5e7380401a070b977fe1063a81c2dfa577c0d56070b713fde0354c1c2dc50b7c5ac0070b167fdf0a9981c2b5367847926070a5b59de1e4891c296d76786e22070a665dde1ad001c29a4ff785280070a81ffe1039781c28ffff7c0cc0070a1c59df015001c285c67849aaa07095695e014f581c240aff7853d3070902c2df371881c20997774dc5f07082660dd28e001c217cff + +def tb_85 : Nat := + 0x7c1200075e665de1060001d7939777417fd075e4e60e1080101d78b967742000475e2e5da0013681d785dff800216075c947fe2015001d723cff7c8bda075bedffdf06e881d6f49778002c4075bcf99df11f101d6d6257840c00075b425ddf1fe781d6b0aff787f9b075ac2c2de12f781d6bd9ff782dde075b147fe2235981d68d567788d62475a355d9e1ce001d693cff803c000759a859e1045001d665c6770113c4759971da20be681d659dff782f96475967839e0a5001d65b7677825da0759713fe2021001d657cff7c46e607591859de11b8c1d6461737835a607592999de0af981d64cd6778216607593dd9df1d7f01d6289778816380758425ddf0af201d605a5780075607580f3fdf139981d5f0367784e630757c0dcde0c3001d5f79ff7c4c4407577495de131041d5dd26380cc3c0756a859df07e001d596967851a0007554059de467f41d550173788ac00755cf99de20f101d575a5778359a075624bfdf10f681d53f1ff7843d70754fc82e10cc001d5325ff7032fc4754c983a0007981d530367886e7c0754525dde1b9e11d51498678507c0754705de001f681d4fa4ff8418660753d0d9e2027001d4f1c678040bc0753865dde102e41d4e1983781e000753a919e013b781d4cddff784edb07533782de07b781d4d9dff84090007532e7fdf166981d4b53677859a30752d4dcde060001d4c59ff7c005a0752d47fe0038881d4b19778026040752a059dc098011d4a817684a25a0751fdffe202d001d47caff700b3c4751f2c39f09c781d45fcff80963c0750c059df06c001d429567781afd0750a55cdf03b101d425a578081c0075012bfe20f7981d3f5367743de2474fd4dd9d0f0a81d3f5a577c0a80074fca59dd029f41d3f29737c5340074f7719df0db001d3d01677836bd074f405ce1048001d3cb9677c3480074ef9d9e10d2001d3b15676c347c474ec55da0037681d3addff805e80074df119e00a8001d371c677829fd074dc71cde066001d375e677815c0074ddb59df087001d3695677c20c4074d8495de083041d3612637c8556074cff3fdf0a9981d335367801e5a074cb67fdd079591d32da0e8000fc074c5799e00fc001d305dff7c0066074c1719df048001d2f7cff802826074bb719de0a0891d2edc767826e2074bb85dde079981d2f03678436c0074b8059e0004681d2dfcff88c000074abf3fdf0a9981d2a53677c4b5a074a497fdf093001d2892ff804fe60749d4d9e2274681d2472ff789d1647491cc39e252001d24956778777c0749425dde19f681d2547ff7819440749a095e10c1981d23b16788b70007483559de2dbf11d20d576789cc007484f99de11e681d2292ff7839000748b359df1d4001d1f01677874fd0747c05cde15c001d1f79677812fc0748225de206c001d1e95677c47160747377fde11c4c1d1cde0b7c21000747167fde083f11d1c5a0e78192607471e59de04c981d1c91678028800746edffe0213001d19a4ff7884bc474669439e1e4981d19d3677c719a0745b77fdd1c65c1d16de0b88c0000744c059dd2fff11d1301768491da07442e7fdf1e0001d0ed9ff8003c00743b2bfe20e9881d0de177783a5e474378619e0c3001d0e07ff840384074374d9e00cd681d0d05ff882ca6074314d9de0b2891d0c53767824c007431cbfe01f9681d0a59ff7c0ffc0742705de2034681d06e7ff841a160741767fe2015001d05c4ff8816e607415a59db05b891d056976801c8007413dd9e1096001d04616780bd0007405b59de2f3f41d016d737c108007404719e10c2101d005a5778308107401698de01c681d00ffff885f7c073fb719dc17de11cfedc768410bc073fa65de109c781cfdfcff80c000073ebf3fe0046981cfaa167840300073ea559e023d001cf7ffff881980073dd4d9db065f11cf753767c2d5a073da77fe219c981cf50167786722473d405d9e198001cf505ff786522073d425de208e681cf472ff7c1ec0073cfdffdf0bc881cf2e177782f1f073cb860e016f681cf15dff806d80073be9ffde1b5f41cefa80b84d380073b167fde34df41cec5a0b881d40073a5799da074f11ce95e76681c44073a5895e1024f01ce93977780939073a4e60e0095101ce8a467804f800739d999de13df41ce766737837da0739f13fdd0ac681ce7f7ff89901a0738497fde640591ce1260e798d1a07384c7fde57f001ce1e76779533c0738865dde3d5001ce39167842b2607381e59dc0ac891ce079768449da0737d47fe10b4001cde9dff844eea07375895de13b9c1cdd62637841220737665de0028e01cdd3977840e0407374059e0308881cd94977846e040735e459e0075001cd71c6780300007359719e20f6001cd56667783d7c4735599da0034681cd531ff8861260734b559de184891cd2d5767860000734b67fe0168001cd16d677c7c1a0733df3fde1f0591ccf7d0e78144007344719e21bb881ccdc177786ede47337061a2228001ccb99776c89fc4732e661a003f781ccb59ff7c1c800732b9ffe1046981ccaa1677c1380073294d9e0016681cca3cff8434e607325a59df20b681cc75dff7482d70731d782e1014881cc74977 + +def tb_86 : Nat := + 0x78265b07855202e00f7681e139dff7c09000784de7fe01ddf01e1089777c79440783a919de1e5041e0ea473785b440783c719e108af01e0e197780439e078342bfde10e6c1e0d0b0b800f6607833359e01d2981e0ae7678048c007827119de122f41e09c4738822bc07824e5de10fc781e083cff743f1a47820f439d030001e0909778857c00781b77fdc15ef11e06de0e8811220781a65de0472981e01e767791ca3078079dcde3c4981e02956778c0000780d67fe1081001e01666768203c4780599d9f034681e0131ff802e2607801e59df079681dffffff881200077fedffe205a001dff5dff8400ea077fd695e1006f01dff536784005a077fd47fe117e981dfdd367785fa3077f74dcde147001dfe0aff7c5880077f1c59e0166681dfb0aff785997077ec2c2de15c001dfb1567783d1a077edf3fde08a001dfbe767807380077e4f3fde1cdf41df93d0b786b40077e577fde138a81df9d2578019e6077e3559e017b681df759ff881680077dbfffdf00c001df69567800dda077d977fe11e4981df47967787923077d1e5cde084001df5d9ff8824c0077cf999e102d001df3b967882a00077ca059de0a7f11df28176801e66077bc0d9e1102001dee0167840bc4077b7495df1b0001dec22577c1e96077ae9ffe00c0001deae7ff844c26077a6dd9e0091681de925ff840ba6077a3dd9e2064681de892ff7c6e400779b67fe00fd981de5dc677c10bc0779665de20b2981de49567742ca24779255d9d08e981de4b967881080077914d9db041f11de45376804b5a0778c97fdf044881de2e1778405040778b359e1073681de259ff741cd647789683a0110881de1497788029a077832bfe015d981ddf6d67840a800777d0d9e0169681dddd9ff7c0f000777677fe10c0001ddcddff7c96ea0776a095df000f01dda81677c27fc0776785de001d101dd9c4677c731a0775fdffe202d001dd7c4ff6c0b3c4775f143a1228001dd39977807f1a07745f3fe1050101dcfb9678019da0773d47fde0675c1dcf520b7c72c00772a999dd1caf41dcaa6737c294007728059de0a4f41dca01737c9c000771e459e21d0881dc2897770741e4770a261a0074101dc21567802cc407705895dd0b3041dc162637c189607703fffde0624c1dc1000b8816e607702919dd05b891dc0a4767c23d6076ff2bfdf0ee981dbedc67841d40076f99d9df2ee001dbb796774bb7d076ede5cdf073681dbb05ff802a66076e9719e0030001dba12578016bc076e6dd9e11d1001db7e66770743c476df99da2088681db75dff742216476dd7839d02e681db7b7ff805304076d2559de14c041db4957380089a076d1cbfe1006f01db453677c821a076c92bfde2085c1db24b0b786b40076ca999dd177001db2dc67745400076cc0d9dd0d9681db379ff843c2a076c5695df1b5581dafa4ff786d53076be942e0046981daf5e67802880076b977fe0003a81dae5a5780723c076b2459de1c8e41dac9173786816076b2e7fdd0a2f01dadb76780251a076aff3fde0945c1dabfd0b7c1140076aedffdf0f5101da8a467783d41076a291ce20b2681da7f1ff702c964769fc839c0ac681da7f7ff807d4007697f3fde1f4f41da5fd0b7837260769c559df3ab001da251ff78eabd07689482df1d8981da079677c4ec00767cf99de13af41d9f3e7380281a0767a77fdf01c981d9e8167801e5a076781ffe10a5a81d9d625778296707675898e10fd981d9c5c67743f624767171d9d05d001d9cfcff7415000767417fe017e681d9addff785f964766b7839e136681d9b25ff78209a0766f67fdf04b001d9a92ff8834620766705dde0d1791d99c18680871e0765e93fde21c6c1d97a50b7867c807660895de0f6781d98caff842f400765b9ffe1052981d9695677814a24765a55da1038581d95d9ff80432607653359de10c8c1d94cd737838a607653dd9df027001d94a6677c114007651859e0064681d93fcff7c954007646459de254f41d9191737859400764a059df02f101d91625780189607643fffdf1fc981d8f0367787f230763c0dcde186001d8f79ff84ae8407630895de2ba041d8c226378209a0763967fe007a581d8ba7ff8005a60762e459df037681d8b59ff8414220762c25de00b6101d8a53677c044407629095e102aa81d8a1257800abc076279d9e1186001d8861678840da0761d77fdf014881d874977881f9e0761b2bfdc07e691d86cb0e7c0b400761a77fdf014881d8689777c505e076151ffde1416c1d85480b783c000761665dde0a8001d85e1777c10800761417fe2008581d8451ff64021247611483a0290881d81c17778a41f07607060de207001d824aff7851c00760c2bfdd0eb981d8366677436000760de7fdd0d5001d837cff741e000760f67fdd06a981d83e76780005a07604f3fdf195001d7fa7ff7c00c0075fe93fe0153001d7e51ff7854bd075f9482de147001d7e5dff782fa6075fb999de0a3981d7f01678851c0075f42bfdb146f11d7d0b0e7c5466075eee59de1518c1d7bb973784380075eff3fde10b001d7bffff781e66075f2459de051001d7cb9ff8027fc075e785dde09fe11d79e186 + +def tb_87 : Nat := + 0x8066de07aee77fde19b6c1ebb9e0b78320407af1c59e0088981ebb15677c0dda07aeb77fdf037981ebaa667780de307aea99cdf05b681eba4aff803b4007ae577fde0ecf41eb95e0b8807e607ae4f99e111c101eb8225778470107ae0898df088e01eb799777c330007ada859de0cbf41eb6a17378215a07adb9ffe000c001eb695678020c407ad8495de083041eb6126380135607ad713fe211e981eb4a6677047a247ad299d9f153001eb353677454bd07acd4dce0001681eb351ff7c008407ac1695df15b881eaee1777856df07abb860df258001eac89777895fc47ab22619e087781eae59ff7c60de07aac17fe20a9981eaa5c67882cc407aa5999e20ccf01ea8997770333847aa26619f038101ea861677c43da07a9d47fdf087001ea6caff7821bd07a9b2c2e20c0001ea60aff702ffc47a982c39c048a81ea6825780de0007a8a4bfde377f41ea2930b78ca6207a8b85dde2e5001ea325ff78a38007a8df3fdf156001ea13cff70557d07a84f42df1cf981e9f6d677873e307a7db5cde1c3981e9f7967782ce207a8225dde072001ea0caff840a8007a7d0d9e10a5a81e9e5a5770296647a79699a0008581e9e51ff8404da07a72e7fe1060001e9c59ff84288007a6edffe007b001e9b3cff7c4ce607a61c59dd1338c1e987173853e0007a4de59dd4f7f11e93797675380007a4e459dd4d7f01e939977841bfc07a4c25ddf0b7781e9251ff782ddb07a49482e1054001e90ddff7c090007a42e7fe00d3981e8fe6677c0b9a07a3edffe105a001e8f5dff7c0c3c07a3ca59e011e681e8e0aff78479707a382c2e2160681e8c72ff8015c007a2c97fe10b3101e882257802a3c07a15a59dd0a8e41e856973808b1a07a0cf3fe1013981e832967847800079fec59dd1dff41e7fb17374245a07a03fffe00d5001e7edc677c209a079f967fe005d001e7dfcff7c0aaa079f7495e12c8e01e7b097784085e079eb9ffdf046981e7aa1677c0300079ea559df12c001e796967801c80079e3dd9df07e001e787967741f7d079e1e5ce2093001e77e6678824c0079dd4d9dc092f11e7753767c3444079da095de0d1041e768263845e38079d425de022b781e72ddff788ada479cb7839e1a3101e736667782d84079d14d9df0dc981e7201678429c4079c5695df016981e6f91678465c4079b7e95df020581e6dd9ff8403c0079b72bfe0006001e6dc4ff7c0366079b6dd9e0051001e6d66678016da079b42bfe2064981e6ca667781922479b299d9f02d001e6c7967881404079aee59dd050011e6bb9767408c4079af999df001681e6bb7ff840e7c079ac65ddf097201e6a82577425c5079aa098df13a581e6947ff7c3a80079a177fdf018001e637967880d800798d0d9da035f11e63437680119a0798bf3fe0040e01e6219778063000797d47fe022c681e5cfcff788b1707973f42de121681e5e07ff7822da0797a77fe008a001e5c72ff7c305a0796c97fe10c0a81e59d25778302707967498e029b981e56a1677c11c407959695e008f581e55caff80138007955f3fe1016981e5566676805a24795599da005b681e550aff8003c007945799e2042001e511c677c300007941719e117af01e4ee177785eb90793b860df048001e4e99777c035a0793967fdf05d001e4dfcff7c5ce20793225dde1737c1e4c89837c3e040792e459de0f8041e4b9173783c000792e65dde07e781e4c0aff7c06000792de59e0106681e4a72ff78419707929cc2e02fe981e473e6778bfa30791cf9cde2eb001e4751ff80020407914059df081001e43666778203d0790d99ce2021f01e42e1777c1e84079099d9dc07a041e4267737c3144078ff119e1081001e3f436778203d078fd0dcde04b001e3f7967888e1a078f42bfde238591e3d0b0e7827c0078fa919e2091981e3c79677c61c8078ea095de187141e3a8263784d04078eb559de12f781e3ad9ff80003c078ea059e01dd001e38a46778773d078e291cde181681e38ffff745dfc078e425ddd123001e395e677c0066078e1719e206a681e37f1ff701a96478dfc83a0075001e377cff781d3c478ddf43a20e3881e369977842604078d8059e2163681e349dff7858d6478d2783a00c9001e323cff78323c478c8f43a214df01e309977745378478c26619d12d681e30b9ff88019e078c24bfe1048001e304aff841080078bb9d9e10d2001e2e15676c347c478b855d9b066001e2e81678470da078b147fde1c35c1e2c520b78461a078b3f3fdf0b4001e2b9dff8424c0078ac2bfe00b1001e2a59ff805b260789d799df004681e2759ff841c800789b9ffdf08a001e265dff84384007895f3fdd0e0f11e257d0e7430000789677fdf0d6981e24a6676c35a30789299ce01bf001e22e767746fbd0788b9dcdf082681e2159ff842d6607882919db0b5891e20a4768019da07880f3fdf078001e1fc4ff7c8dea07870895de2379c1e1c2263801e960786e9ffde07a4c1e1ba80b8028800786c17fe00c9001e1a3cff78323d07868f42e2055981e19e7678002160785d47fe1087001e16caff7821bc4785b2c3a2041881e16897778105e4785a261a0099781e1547ff + +def tb_88 : Nat := + 0x7c492607d71e59e106ff01f5c097780031e07d6ff3fdf0c0001f5b3cff802eaa07d6a095de0ba9c1f5a826388074407d67119de01d011f59c47678038407d674d9e001f681f59a4ff7c02e207d6665de20a4101f58956778290047d6255da20ca681f57caff7c5c4007d5967fe1003781f5305ff84354007d45f3fe104b001f5131ff7c5e8007d3edffdd179f41f4fb80b745e2607d3ee59e00d0981f4ee76784762607d28059de1d8891f4a0176800bc407d27495df093f01f493e678803c007d1d799df047101f465a577c0fde07d1767fe200f001f45caff84264007d14c7fde098f41f45320b84282607d12459df0ab001f43e66788251a07d0d47fe10a8001f41e177801fc807d05895dd07f141f416263842a3c07d02e59de0a8e11f40b97678163807d0425de005b681f405dff7c2b2607cfec59e1037681f3f79ff7c262207cfb85dde0987c1f3ee18384b58007cee459dc2d5f11f3b91767c488407ce79d9df030001f39b76788245a07ce497fe00c4981f3861677c1ec007cdf999df02d001f37b9677c17c407cdd695e1064681f33f7ff80078007ccf67fdf005101f32dc67880d8007cca999e0013681f3292ff7c0e4007cc967fe2295981f2fc46778a56247cbf11d9e0fc001f315dff8015c007cbdb59e102a001f2f4367780a7d07cbd0dce1042001f2f016784005a07cbbfffdf198001f2cb9ff7c59a607cad4d9de1668c1f2b537384344407caa095de0d1041f2a826380375607ca693fe2037981f296d676c0de247ca5b5da106d681f28ffff701b5647ca4003a00b1001f2359ff80774007c85f3fde1dcf41f217d0b78420007c8947fe202e681f204aff7c106207c8025ddf050101f1fb9677c46da07c7a77fdc11b5c1f1e9e0b88072607c7a059df09ff01f1de1778821de07c7567fdf05d001f1cfcff7c282607c71719e0075001f1be767781d3d07c6f9dce019c681f1a4aff78671647c692c39e11a001f1acd6778305a07c6c97fe13a6981f16a46778e9a247c5a91d9e2a6001f17a4ff7c365a07c572bfdf0fd981f14cd677c1cda07c5167fdf106981f1353677441a307c4d4dcdd0a0981f13b967741ce607c4f999e0079681f12d9ff7c012607c4b559df168001f116d677c4c1a07c40f3fdb1305c1f103d0b801c8007c3f2bfdf341881f0c897774d05f07c32260dd0b5981f0f156784385e07c2e9ffe2016981f0b9167882a5a07c2b9ffde0a9591f0ae80e78251a07c2bf3fdf1f0981f08f767787c2307c23ddcde130981f09b767843dda07c1ffffe00a2001f075dff80352207c1a25de00ad101f05dc6784359a07c1417fde0d6591f05060e7834bc07c1425ddf0aba81f045a5788189607c0fdffe004b001f0366677812bc47c0d99d9e037681f0379ff780d1a07c0df3fe205b681f030aff7816d647c0c2c3a00c0001f024aff782ffc47c092c39e0b1001f0259ff7828e607c099d9df0ed001f015dff743b3d07c05782e21b6001effa7ff786d7c47bfea039e199981effc467801ce607bfb999e1222001efbb7ff78887d07beee02df09e881efb197778279f07bec660e1098101efa81676c260047bea05da109ff01ef9e1778422da07be51ffde08b591ef9480e8442c007be0f3fdd10af11ef83d0e743a8007be177fe2093001ef40aff7c0e7c07bcc25ddf00c781ef2fcff78031b07bcbf42e1008581ef251ff882c2207bc025de10ab781eef5dff702ada47bbd7839f003a81eef5a5788043807bbd25ddc010d11eef49867c080407bbca59de020041eef29737ce2da07bae77fde38b5c1eeb9e0b78ae0007bb1c59de1eff01eed397778558007bb74d9de121681eee07ff80029a07bac2bfe203d981eeacd67805bda07ba577fdd16f5c1ee95e0b7c666607b9f119de1998c1ee7c47378084007ba4f3fe006a681ee759ff781a9707b9d682e20b8981ee6a167782e2247b9a85d9e0b7a81ee6a257782d6607b9a919df218881ee3197774861f07b8c660dd1f5001ee33cff80afc807b81695de2bf141ee05a637c075607b80f3fe00e8981ededc67783a2247b7b71d9e0c1981edf03677812c007b7de7fdf342f01edb997774d0b907b6e660e0008101edb91677c479a07b69cbfdd11e5c1eda730b7c16bc07b66dd9e004e001ed969677c420007b61859df196681ed6caff78659707b5b2c2de123001ed73e67841f9e07b582bfe11b0a81ed45a57801a1607b4fc7fdf018001ed3d9ff8035a607b4c0d9e21c5001ed13e6778713c47b44f9d9e1b9f01ed1497778507c07b4705ddf196681ecfa7ff8440e607b3a919dd103891ecea476844f8007b35999dd13df11ecd667674419a07b3677fe0229681ecb3cff882eaa07b2a095dd0ba991eca8266742ce207b2a25de10d6981ec871677835a307b21c5ce10a6681ec7caff845c4007b1967fdc170f11ec65a0e7c03c007b192bfdf0f0a81ec55a577c2f1607b1277fdf194881ec3097778651f07b0c260df003781ec305ff88012607b0c059e001b001ec2e66784144007b0a559df0ae001ec1e767782b7d07b079dce0109681ec0ddff80720007afb2bfde1c7f41ebecb0b84300007af82bfe002e981ebddc67 + +def tb_89 : Nat := + 0x7c99de0804d67fdd2676c20135a0b88bdfc0804025ddc2f7e12010098670ad9a080412bfdf02310200fe66780521a0803a77fdf099f0200d3977800f1e08033f3fe012300200a59ff88162608028059df0a36820095dff7828d708025782e11cc9820079167841d400801c719da074f120071c766813800801d0d9da03768200759ff800d1a0801b9ffe010e002005d9ff8005400801713fe2018002004796784060008011859e02f40020016d6774bcfd08005b5ce20510020011c6778143c4800471da2042f01ffe997788840007ff225dde20ff11ffc8986787ede07ff277fde0c7201ffdd25784456607fe79d9de1158c1ff9e77378300007fe8f3fe016e001ff879678819da07fdd47fdd067591ff7520e842d0007fda77fe2093001ff60aff800ba607fd7719e10d6681ff505ff7c2aea07fd1695dd0ab9c1ff45a63742a6607fd1719e10a8f01ff3b1677c22da07fcc97fdd08b5c1ff3260b8408a607fcc0d9e0036001ff2cd6780afda07fbe9ffde2bf5c1fefa80b78777c07fc225de00a2001fee5dff80264007fb713fe005b681fec4aff8412c007faffffdb04af11fec000e8030c007facf3fde0c2f41feb3d0b78066607faf999df063001fead9ff80348007fa81ffdf075001fe95e6780114007f9fdffe007b001fe77cff701ebc47f9df43a0016981fe766677c108007f8c059e210b001fe131ff7442bc47f84c839d0d6981fe1666774300007f85f3fdd055981fe1e76780030007f8497fdf06c001fe0b9ff84198007f7d47fe1170881fdde17784120007f7665ddf1bf781fdbd9ff786fdb07f6f682e13b7a81fd8225778ede707f60898e2257581fd5caff7895d247f572c39e1c5f01fd65c677cfba607f47719de3ee8c1fd1dc7378d06207f4a25dde2f5981fd2d5677c04da07f4567fe203d981fd11c67845ac007f3ec59df117f01fce99777045f907f3a660e2098101fce016778260047f3805d9f447781fc751ff7911db07f1d482de338101fc8616778c80407f21e59de1b2101fc9e767845c2207f1785dde1707c1fc5e18380120007f1665de0008101fc591677c22da07f1417fe1093001fc472ff7c264007f0f67fdc098f41fc3da0b800f0007f0e77fdf0c0001fc2ddff782ffd07f0b782de0bc881fc2e1777cc66607eff119e004b001fbf7967841e5a07efbfffe013b001fbdc4ff84060007ef1e59df009781fbbffff7c2b8007eed47fdf07c981fbad567741f2307eeb55cdd078001fbad9ff805a0007ee5b59e20a5001fb8b96778293c47ee2e5d9f13c681fb77cff784f1707eddf42de0c7681fb7f1ff7816da07ee177fe0067981fb715677819e307edc55ce223b681fb4d9ff788ed647ed36839f03c001fb49dff7c56a607ecd0d9de15a8c1fb3437378412207ece65de14a5681fae9dff79295647eba7839e478681faecaff79170007ebb9d9de3f0001faf536780c00007eae77fde2fff41fab9e0b788b2607eb1c59e20f7981faaa667783de247eaa99d9e0d0981faacd677824c007eac2bfe10d4101fa9d257841c8007ea32bfe11cb001fa6ffff8001c807e98495e01b8581fa459ff786e1307e91682e0140881fa3197778501f07e8c660de130981fa329678818fc07e8425ddf0ab781fa05dff805f2207e7b85de2048001f9e99778416bc07e66dd9df061681f97ffff7c4d4007e5b2bfdd134f41f96cb0b804e6607e56459df094681f94fcff78251707e53f42de08b681f9505ff7c10e607e52e59e0066001f9453677c16da07e4fdffe0046981f93b16780354007e4b719dd0d4f11f92dc767c67da07e44f3fde19f5c1f913d0b78608407e45695e0113101f8e5a577844c107e39698df0a2f01f8db76788209a07e312bfde082591f8c4b0e88192607e2f999de064891f8be6767812c007e2ffffdf034981f89d367800b9a07e2693fe200b881f89997780108007e24719de041f41f891c738004bc07e2425de20ab781f885dff782ada47e217839e098101f8871678824c007e1f2bfe0131881f86997784f12607e0a559e028bf01f80097778a2f907e00260de16f681f8125ff7c378007dfb67fde0ddf41f7eda0b8833c007df82bfdf02e981f7ddc678497da07dedf3fde25f591f7b7d0e78629a07df147fe0175981f78d567745d6307de355cdd171001f78d9ff74406207de525de01ed681f76e7ff7c296a07dd9095dd0a59c1f7642637c441607dd4c7fe10d0981f74616778342307dd185ce10a8001f73b9677429fc47dcee5da1015001f733cff8451fc07dc785dde147e11f71e1867c16e607dc2919df048001f705c677c34da07dbb77fde0d35c1f6ede0b88035a07db967fdf00f001f6e4aff806b4007db277fe007ba81f6c22577c471607dac17fdd11c4c1f6b060b7c2eaa07da9095de0ba9c1f6a42637816e607daa859e0028e01f6a19777c01c807da8495df133681f660aff784cd707d982c2e1071881f659977841a1607d8fc7fe0027001f62a66780521a07d8577fe01e4981f5f796778792247d7de5d9e084001f60d9ff7c119a07d7977fdf00c001f5e51ff880bd607d772bfdb02f491f5dcb0e8004e607d76dd9e0019681f5d9dff + +def tb_90 : Nat := + 0x7c04da0832a4bfe022d5820c7a4ff7c52aa08319695df0f3f020c56667783cf90831599ce20a09820c491677428224831245da00330020c19167780cbd0830645ce1003f020c15e6784025e08303fffe12239820bedc678437da082f7f3fde0df5920bdfd0e80bdc0082ec17fde2f6f420bb060b802a66082e9719e125c6820b7ffff789717082e0002e00886820b75dff846066082d7719de1818920b5dc76785f22082d785de104b0020b5916784125a082d51ffe20d50020b472ff78353c482d1cc39f0169820b45c67801a9a082cfc7fdf0780020b379ff7c4800082c967fde11ff420b25a0b80ad40082be93fdf0139820af9167800cc0082bd799e105e6820aeffff7c39a2082b865de20547820adc4ff78151a482b71439e04e7820adcaff840366082b6dd9e20fd6820acb9ff840a26082b2459df0180020ac7967841bfc082b025ddf00c7820abfcff888e26082a7119de2388920a9c4767849e6082ab559df02af020a99977804f44082a1719de13d0120a85c76783d44082a2919e20af6820a251ff6c2bd648289483a106a9820a1e7677c4b5a08282e7fdf099f0209d39777c0f1e08273f3fdd03c6c209cfd0b84282608271719e01b9002098d9ff8491260825a559de2448920969576788d660825a919de115982097c4678414c408259095e0068582095d9ff80144008252999e00a9682093fcff7c34e60824ca59de0d38c20932973802a000824a059df03768209159ff843fea08241695dd0ff9c20905a638455bc0823c0d9de156e4208f0373841d40082399d9e109510208dd2577c903c0822e459df03768208b59ff7c3dc808228495de0f714208a126378331e08228f3fde0c720208a425784d1d60821b2bfde347492086cb0e78ce160821b67fe20bc882085e177742f1e48217861a204200208505ff6c107c482141839f12c002083d9ff784afd0820f682de11e982083e7677843800820fdffde0b400208451ff8017400820df3fdd05cf120837d0e888ee608204f99dd23b8920813e76748c220820525ddd21fa820815a5788659a081fe9ffde19659207fa80e7c0ba6081fde59e005d00207f1c6778173d081fc71ce126268207cb9ff789896481f2e839e24f00207ccd67842bbc081e74d9e2039f020799977804104081e2559df09d682077f7ff7c7da6081d8059de1f68c2076017384011a081d7f3fe10a2a820755a578453d6081d02bfe00718820739977802400081cc25de100c782072fcff7c28aa081c9695e110b00207131ff7842bd081c4c82e200c00207125ff7c24c0081c24bfdf15498206f3e67785523081bcf9cde0db00206fb7ff882f40081ba059e10b778206c51ff841e00081af67fdf10c98206acd67784323081ab35cde0cf00206b0aff881cda081a967fdb07359206a5a0e884422081a525ddb1107920694986801d04081a3559e200a682068caff8872c00819bfffde1caf12067000e784c620819e65de00436820665dff8826400819713fe105b98206569677416e308195a5ce03c3f0206109778481840817c0d9e109c00205e676784725a0817277fe11b600205ae7ff786d7d0816ba02de1a100205afcff881d4008169cbfdf018a8205a5a57803c3c08165a59e10cff0205899777c019e081624bfdf138a820575a577c06fc0815cf99e0073682056caff843a620815785de103768205379ff7c1bc00814c2bfdd06ef420530b0b7c6e7c0814525ddf00b1020513e6784665a0813e93fdf00b88204f99778817400813a919e100f00204e9567802d000813677fde0b3f4204d9e0b7821c0081372bfe003798204d666780221a0813377fe006498204c79678407da0813167fe1114002049d36788821a0811f2bfde208592047cb0e809c2a08115695de2709c20455a6378738008117f3fde1800020464aff8485bc0810d0d9e101b002042e667885a5a08105f3fdf222a8203f5a577888a7080fd698de1320020404aff7838e20810265de01f800203d6257787dfd080f5898de030f0203f29677806fc080fcf99e003768203addff7c07e6080e4f99df00468203759ff7c3126080da559de0c48c203695737c0dda080d4c7fe0178982033b967785e22480cee5da1066002033536780005a080cd47fe1078002032d9ff781dfc480cb6839e06a982032e767884566080c7119df0621020316257741881080c5898e0003f020315e67802940080c2e59de0a4f12030b976803d1a080bf13fdf17a00202e4aff745e7d080b92c2dd0e898202edc677438e2080bb85ddd04b00202f79ff88a8c0080ae9ffde2a2f1202ba80e78a1a6080af119de24000202c0aff787062080b225ddf2b0982028f76778ac23080a3ddcde1f0982029b767742ac0080abf3fe006468202892ff80a200080982bfde287f420260b0b786ae60809b9d9de13f9820275367840a620809785ddf09978202547ff84408008088059dc101f1202201768030c008084f99e015c00201f79677456fc4807de5da107800201f0167884d9a080772bfdd13659201dcb0e7c065a0807677fe00f798201ca667804d40080681ffe00a80020191c677829fd0806471ce1098882015c177 + +def tb_91 : Nat := + 0x842c400861167fdf11d0021833cff808f4008603fffdd23cf12181000e80ac80085ee9ffdf10698217aa1677841a3085ea85ce020e68217892ff788397085e24c2de1aa002178f767840666085e1e59e00c0002177b9677c3444085da095de0d1042176826378327c085da25de00a5f02175dc677c12c0085d6459df03e882175097784259e085d1cbfe12719821720167789c62485c805d9e20b9821726767784326085cd999e02be00216f436778af7d085bd0dce104200216f016784005a085bbfffe10a200216e5dff840e22085b865de005e98216d66678416da085b42bfe002d00216cddff880de6085b2999e102d00216c7967884980085ad4d9dd125f1216b53768012000859df3fe14399821634367790e630858d0dcde222a821655a5784845a08584c7fde2115c2161320b78341a08589cbfdf21300215ecaff7884bd0857b2c2de1b498215f29677865220857d25de002d00215e9dff8066000857417fe108a00215c72ff84521a0856c2bfde14859215b0b0e883000085692bfde0bff1215a4b0e7c438008564f3fdd10df421593d0b7c66000855e93fe10a5002156ffff84315608555f3fdf04b00215531ff7412bd08554c82e025c982152d5677897230854b55cde258002152d9ff7882260854ca59de132002153ffff80300008548559df06f0021516d6780300008541719df21168214e4aff748456485392c3a0078a8214dd257781e2708537498e113458214c9dff8024c0085302bfe109198214b79677c419a08529cbfe1273002147ffff8446260851b9d9de1188c2146e7737830660851cf99de0b6882147497780011a08513f3fdf10b002143f1ff8039c00850c2bfdd0e6f121430b0e7437260850c559dd08b98214366677c0b400850b77fe20769821426767681da2485099dd9a0709821426d676812c00850a4bfe10a5f02141c1777c19c808505695df06198213f43678427c0084fa919dc09ef1213ea4767c603c084f1e59e202e68213c4aff8024c0084eedffde092f4213bb80b7812c0084effffe206600213b51ff841e00084eb67fde077f1213ada0e7c27fc084e785de10a800213939777829fd084e4e60df095102138a467742541084e291ce00676821383cff84f000084d02bfde3bff121340b0e78cb40084d277fde1ce002135fcff787266084d8059e100498213301677c011a084cbf3fe21b9002130b9ff746e3c484c2e83a0144f0212e1567801638084b425de100378212d05ff7c521a084ac2bfde1485c212b0b0b7c2c40084a967fe2098882129c177801e00084a525de200b1021293e67881cda084a32bfdd073592128cb0e7c03c00849d799e1028e02126197780cc840848b9d9de332042122e773788cc40848f999de21c782123fcff7c78c00847967fde1e2f4211e5a0b787566084799d9dd16098211edc677c19c808470895df1af58211a72ff786bd308469cc2de11c58211b05ff7c0ba608463dd9df14778211751ff7851db0845d482df0900021150167881b0008452559de06bf121149576803dda0844e77fde0f75c21139e0b7c2f220844b85ddf07a10211267678822e60843c719dd08b89210f1c76740ea60843db59e2102f0210e19777040b8484386619f0b310210d66677c16da084342bfe003d98210ccd6780455a0842edffe20d098210ae7677c1f1a084251ffdf00e882109397780074408424719e012a682107f1ff784a970841fc82de0df6821083cff7c4c620841a65ddf03f78210659ff7cffea08409695de3ff9c21025a6378d5000840c17fde30000210359ff7cde5a083fb67fde3795c20feda0b78768008401e59de06c002101e7677c33c0083f82bfdf14e9820fcb967884f26083ec559dd13c8920fb15767c029a083ec2bfe20930020fa4aff6c24bc483e92c39f1759820f8d567845dc0083dd799e00046820f759ff841680083dbfffdf01ba820f64257801a16083d767fe00150020f5c4ff7ca200083ccf3fde287f420f33d0b7816e6083d5a59de0480020f57cff802a00083ca059de0a7f420f2817384b400083bec59de2cff420efb173787740083c2919e01df1020edd257846c00083b0895e01255820eafcff784953083abf42e10150020eae7ff801d40083a9cbfe014d0020e925ff74533c483a49839d10c9820e9666788d26608397719de3498920e5dc7678a8ea0839a095e1042f020e5997784380408392e59de0e00120e4b97678271e08393f3fe00e40020e2cd677c0e9a0838a4bfdf1c80020e0caff7871fd083832c2df15d9820df6d678003c00837d799e01c06820dd9dff78701708376782e210c9820dc91677043224837245d9c10ba820dc92577042c0083724bfdc0f79820dca66770390008372e7fe020f1020da8257807fda0835f13fdf17a0020d64aff88851a08345f3fdc2145920d17d0e8805a608345999e10886820d0ddff6c221648343783a118a9820cf53677062a24833d4dd9c183a820cf5a5780221a0833b2bfe20c30020ce07ff80296a08335895df028e020cd3977780a3508334e60e10c67820cc72ff68319a48331cc39a0801020ccb96784006608331c59df0150020cc5c67 + +def tb_92 : Nat := + 0x741fd70889fc82e00bc5822249dff8851000888d67fdd143f122235a0e84774008885f3fdc1dcf122217d0e706f000888677fdc172982221e767803a80088824bfe00480022204aff7811fd088812c2e109300221fb7ff7c23a60887ca59e100468221cfcff8457c00886e77fde15ef1221b9e0e8042c00886a4bfdd10af4221a930b84365a088572bfe00c00022150aff8404e608853dd9e202a002214cd678011a60884ee59de046892213b9768437da0884b67fdf050882212897780931e08840f3fe207200220fcaff5c1c7c4883f2c3a100600220fc4ff7c380408838059de0e004220e01737801440883b719e025968220ba7ff8005a60882e459df0ea002209b76788300008823dd9de0bff12208f776782b1a088242bfde09168220925ff7c665a0881d77fde1995c22075e0b7844400881f999e106510220682577819410881a098de05df02206897784297c08817719e009468220547ff78251708815202df0eda822045a57842f160880e77fde0bc4922039e0e782a3c0880ec59e10379822036667780de24880d99da006300220303677418bd0880c0dce005d002202a6677c51c0087f42bfde146f421fd0b0b8019da087ed47fdc0675921fb520e800e7c087e665de007d1021f91c677c18c0087e2e59df0210021f83cff7cd8c0087d367fde362f421f4da0b7c33c0087d02bfe00799821f391677c21fc087cc25de100c7821f2fcff8028aa087c9695e20150021f23cff8408e2087c865de00e77821f131ff885e80087bedffde179f121efb80e784a22087c025de005a0021ef5dff7c0300087bd47fe10139821ef3e677804e2487bcf9da20508821ed097774141e487b42619f16b7821eb9dff8842c0087aa4bfde10af121ea930e783426087ab359df1560021e93cff78557d087a4f42de1498821e94977784d40087a577fdf11aa821e82257801f560879e93fde07d4c21e7a50b7c02e20879e65ddf03f7821e759ff88119a0879977fdc0465921e65e0e7003c00879a559e105d0021e3fcff8079e608788559de1e78c21e21573842eda0878567fdf0ffa821e05a57743fe708781698df0955821dfc4ff7c0dda0877de7fdf1b88821ddc177786e1f08777060e22301021db9167708c004876e45da21350021da5c67784d3c4876971d9e11e6821da72ff84068408769095db01a0121da42668052bc08763dd9e21b90021d73e67746e3c4875cf9d9d19d1021d75a578401bc087514d9e00180021d3d9ff8086220874705dde2187c21d1c1838420c408744f99e10016821d13cff7c2ce20874225dde0b37c21d089838079440873a919e000f0021ce95677c4bc008735999df0990021cccd677c92c40872a095de24b0421ca8263787e000872b559e1165f021c91c6780071a08723fffe02a60021c659ff74a97d08719682df00f0021c64aff802f160871277fe11050021c305ff7c3fc0087079d9e10540021c0ddff8009c0087024bfe11410021bf51ff8021c0086fb2bfe11710021bd59ff785c3d086f5682e019b7821bb9dff882226086ec559e20376821baddff800426086eb359e218f0021b93e677863bc486e4f9d9e16f6821b95dff884704086e0895dd11c0121b822667446fe086e089bdd0b4f021b889777c2238086de65ddf03f7821b759ff780fdb086dd682de03b1021b75e67780b04086ddb59df03b1021b65a577c1356086d713fe10270021b59dff5c09bc486d6783a20f79821b4a667783de2486d299da102d0021b479677c1b00086cb9d9e11dd0021af7cff78773c486bdf439e11d0021b03cff783f66086c1719e20030021af79ff842766086bb719de09d8921aedc76782700086bb77fe049a1021aa4257792681086a9098de3d66821ab05ff7c0c00086a8495e0178e021a89977785e35086a2660df0319821a861678460000869425ddf18c7821a37cff78631b0868df42de1117821a3f7ff7c00c00868de7fdf0540021a325ff807a4008684f3fde1e8f421a13d0b78492608688059e01e300219f59ff7878bd0867d682de19500219fa7ff782ce20868225de003d98219f1c6788308408679695de0c201219e5a667821c00867a559e108f58219dcaff803f6608673359de0fd8c219ccd7384455a0866edffdf13698219a81678827fc0866785ddd09fe12199e186801d0408665b59df0d698219871678842c00865d999de10af121976676783d1a0865df3fde0ac682197c4ff7c221a0865b77fdf183a821955a578470380864e65ddf03f78219359ff700fdb0864d682e029b6821904aff803c2a0863d695de0f09c218f5a63783b400863d77fe100858218f51ff6802124863d4839f02898218f29677c13da0863b67fe20c498218e15676c31224863855d9b05898218e81677c029a086382bfdf28e00218b7cff70a37d0862df42e105700218b25ff5c15bc4862c9839704b00218b31ff88c0ea08620895de303992188226678c0e40862089bde29c88218889777896c0086232bfde250982188d56778492608628059e113a582186e7ff7c11a60861a859e00471021865a578410380861865de00745821859dff8424c0086142bfde092f121850b0e + +def tb_93 : Nat := + 0x7c4aa608b4b559de12a8c22d2d573883e4008b47719dc0f8f122d1dc7670300008b48559e206f0022d16d677c117c08b44719dc045e422d11c737c00c008b3de7fe03201022caa16778c80108b2a85cde2d97822cae7ff7899de08b2d67fe10450022ca5c676c113c48b2971da00166822ca3cff843c0008b21e59da0eff122c8797668359a08b224bfe01260022c753677c005a08b1d47fe21680022c5e1777859fc48b178619e0c72022c6825788120008b1665ddf0981022c501678043da08b0fc7fde10f5c22c3f20b84162608afc059e10016822beffff844ec008af713fdb13af122bdc50e6c4d4008af72bfdf0ba0022bd0aff782e7d08af42c2e00649822bca6677c0b4008af1e59dc02cf422bc79738449da08aed47fdd1275922bb520e741e5a08aeffffe00780022bad9ff781dfc48aeb6839f0540022ba81677c1e5a08ae81ffe006d6822b8ffff8411a608ae2e59df05b6822b85dff84006608ae1719e204b0022b7f1ff80372608adc559df30a6822b40aff78c29708ad02c2e11aa0022b092ff746a7c48ac24c3a10480022b04aff8804e608abcf99e12cd0022ac716778b33d08ab1c5ce21cb0022aaa6677872bc48aaa99d9f04c6822aa59ff80d68008a9bfffde359f122a7000e78d62608a9c059de3000022a759ff7c39a208a9865ddf0376822a531ff8809c008a942bfe10a99822a46167782a6308a9185cde0649822a4a66788191a08a8ff3fdd0645922a3fd0e802ac008a8d47fe00540022a2d56780444008a87119e001f6822a1a4ff8804e608a86459d70138922a1917688144008a84719e2492f0229c89777924b848a722619e47e68229c9dff78d6bc08a7705dde2c268229e59ff78a0bc08a7a65dde23af0229ee1777855da08a7f13fde0df6822a03cff801f9e08a702bfe040b002297ffff7502bd08a60002dd371882298997774660008a69cbfe12b800229547ff800fa208a5425de100378229505ff88132608a52e59dd04c892294b97684701a08a4a4bfde1c0592292930e785dc008a4b719de0ed00229366677c552608a44f99dd1548c22913e73800b0408a3db59e205100228f1c6780594008a36dd9df05100228d66677c264008a33359e004188228c09777c2d8408a2d4d9de0b604228b53737808c408a2f999e20df68228a07ff8002e208a2665ddf01d1022891c67886dda08a1b77fde1b7592286de0e78329a08a1f2bfde09d682287f7ff84472208a1705de20e7782284d9ff7c0e7c08a0c25de000c782282fcff78031b08a0bf42e2067982282956788161a08a08f3fde0585922823d0e7c35a608a05999e004068228125ff845b80089fedffe00de00227ed9ff78377c489fb683a108268227d59ff882826089f2e59de0a089227cb976781626089f4059df06768227c51ff8481c0089e92bfde206f1227a4b0e843b40089e577fe114400227791677c3f00089da559e12340022746167788cfd089d185cde0d0682275c4ff7c1ec0089cf999df09468227351ff782517089cd482df078002272d9ff883126089c8559db0c4892272157688455a089c3fffdd115592271000e741c1a089c693fdf0a5a822705a57782967089c1698e008f58226fcaff7c3ba6089bb719dd0ee89226edc767c725a089b277fdd1c95c226c9e0b8411a6089aa859df20e68226892ff788397089a24c2de17b68226925ff784ec0089a5999de13800226969678050400899d47fdf1336822660aff704cd7089982c2df029882265e177882b260898b359dd0ac892262cd767c09c00898a999df0ffa822615a578020160898367fe003a98225f6d67845cc408977e95de17301225dfa667846da0897947fde10f68225e5dff84501608972e7fdf17d00225b3cff745f3d0896cf42df05598225ae7678848c008967119dd122f12259c4768423a608962e59dd08e892258b976843b9a0895f2bfe21318822569977784c5e4895a661a0098102256016788a9da0894d67fdd2a75922535a0e843a4408949695de0e90122525a668060000893f999de17ff4224fe6737c0b400893ee59e00d200224ee7677c614408935895e201500224c5c678081ea08927495e0264f022476d677899390891db5ce200f0022475e67802e800891a919df0480022465c6784209a0891767fe00a800224531ff7429fd08914c82e10a098224491677c060008911e59e0192002242e76778647d0890b9dcde12768224351ff88177c0890a25de012b1022415e67784ac10890579cde127202241625780401a0890177fdf18198223edc67706063088fb71ce10df68223dfcff840aaa088f7495df148e0223c89778419c8088f0895e0090f0223b9167840dda088ed67fdb03759223b5a0e7c51ea088e8495e105af02239b7678899de088cde7fdd2676922337a0e882766088cb719de09d892232dc76800d80088ca999e100d68223259ff8003c0088c92bfdf089882231c1777c18de088c577fe21f098222f6d67747c22488bdb5d9f10f68222e5dff7443d7088b9782e202058222dd9ff840540088b713fda014f1222dc50e7c18c0088a693fdf06b8822293977800900088a1c59df07f682227f1ff + +def tb_94 : Nat := + 0x78783848dfde5d9e1b558237fa4ff80108008dfc719e018498237ccd677c0f0008df2459e009168237bffff68245648df0003a100300237bfcff7c7d4008de81ffdd1f4f4237a080b745ee608dea059dd0ab00237b51ff7c1ba208de665dde06e7c2379998384120008de3fffde047f12379000e780ae608de4719e1046982378b96780090008de2559df02400237871678070e608dd8059df004682375fcff802f1608dd277fe2243a823725a5784021608dc947fe20388823721977780e1e48dc8661a0032102371e7677c2d5a08dc4c7fdc0b55c2371320b8427c008dc24bfdc09ef12370930e88226208dc025dda08979237009868415c008dbb9d9e10df68236e07ff7837d708db8202df0fe88236d0977783f9f08db4260de0ce88236d39777c2d8408db14d9e014868236b0aff78521708dac2c2e003d98236acd6780809a08da32bfdf106982367c467843c0008d9a859df08f10236612577423c108d98498e004d582365c4ff7c216608d93dd9e1051002364a66778143c48d9299da021cf02362897778873908d8a260df127202361625780163808d8425de10af2023605a577c075608d80f3fdf26aa8235dd257789aa708d77498de16098235edc67784e6608d7c0d9e213458235c9dff8424c008d702bfda092f1235c0b0e7c1c6208d6e65de009c78235afcff8416e608d6a859e20d8f02359696774363848d65a5d9d08af02359b76780905a08d53f3fde2415c2354fd0b8839c008d4c2bfde0e6f123530b0e7c01e608d4c0d9e235e68234fa4ff78d79648d3e9439e35b68234fa7ff78cfc008d3f119de1c66823513cff78714008d44f99de1b9f02351497780186608d3d0d9df04200234f016778107d08d3c05ce106c00234e9567781afc48d3a55da00ca68234dcaff78329708d372c2e017100234c59ff785c3d08d31682de11100234cb9ff783b4008d3377fdf3981023430167881b0008d0a559de06bf123429576800ec408d09695e000858234251ff7c354008d05f3fe00c3002340b9ff844ede08cfd77fdd13b69233f5e0e8802a608cfd4d9dc00a89233f537680054008cfcf99df07110233d6257883bd608cf1cbfde0ef49233c730e782a3c08cf2e59e214100233aa66774503c48cea99d9d11a00233acd6780ce4008cddb59de338f423376d7378b88008cdf119e01110023365c6778443d08cd971ce131f6823333cff74c7d648cccf439d30a68233351ff74c24008ccd4d9dd25f682333fcff80156608ccb9d9e0135002331a4ff744d3c48cc6943a10139823319167804cda08cc177fe00e400232f79ff7c1da608cbc0d9e009678232e4aff78259a48cb92c39e08778232e59ff7c34da08ca24bfdd0d35c2328930b880c6608ca1859d90318923286176640c2a08ca1895e007b002327e66784431a08c9b67fde10c592326da0e783fc008c9b9d9e1057a82326825784b43c08c8ec59df036002322cd67800e9a08c8a4bfdf09198232201678830c008c84f99da0c2f123213e76802d3c08c8225dde0b4e423208983781cda08c832bfe018810231f016770620108c7c05ce010710231dfa577841c108c77e98de0a710231e5a5784603c08c71e59de180e4231c79737854fc08c72999de11c58231cddff8007da08c7167fdf286982319d36778a1a308c674dcdf02e682319a4ff7c64da08c5b77fdf364982313796778d92308c4de5cde11c882315c1778807da08c4d67fe105898231301678891da08c42e7fdf19098230f296770642308c3ca5ce104968230e9dff84258008c381ffdf02688230de17780038408c374d9e20d668230cfcff78359648c33f439e0d200230d016784228008c31cbfd8089f1230c730e8955a608c1c719de5568923071c7679386608c1e459de450a82308225778c54008c2577fde2b1882309c177789c6608c28059de21900230a59ff80308408c19695e2080582305d9ff78201248c17683a01bc002302d567786efd08c0b55ce21680023016d678418fc08c0425dde063e1230109867c025e08c03fffe017df022fedc678437da08bf7f3fdd0df5922fdfd0e80c00008bebf3fdf03b1022fa5a577c060008be9095e22425822f7ffff802b2608bdd4d9df1486822f60aff74521708bd82c2e21018822f5097770405e48bd42619c0c30022f547ff7c259e08bd1cbfde0966c22f4730b78020408bd4059df0169822f45c67841a9a08bcfc7fde06a5c22f3f20b7c102608bcec59e00cff022f2e1777833f908bcb860de08b6822f325ff8400de08bcb77fe0243f022f089777890f848bc2261a114a0022ee5dff78527c48bb9783a00c00022ed9dff7c16da08bb12bfde05b5c22ec4b0b880b4008baee59df07c6822eb3cff8077a608ba5799de1de8c22e95e737c254408ba2919df0c00022e77cff782ffd08b9df42e03eb9822e3916778fae308b8e45cde2a30022e4d9ff7c08e208b8865de12940022de9dff74a4fc48b7a783a00372022dd62577c0a3808b74e5de003c7822dcfcff780f1b08b73f42e11230022dbd9ff7848bc48b6f6839f0930022da92ff7024bd08b6a4c2e10abf022d56667880d1a08b54c7fe10d80022d459ff + +def tb_95 : Nat := + 0x786d1a090f713fde17f10243dfa57783540090fa919de09300243ee667881e5a090effffde07959243c000e7c4980090eb67fe10a0e02439e1778820c4090e5799db0830124395e766c1fc8090e5895df054f024390977801d40090ddf3fde074f124377d0e811dc0090cc17fde476f42433060b78a8c0090d367fe0009002432fcff80777c090b425ddd1dde4242d0983743480090b8559df00378242d05ff842d00090b147fde0b3f4242c520b7c2d00090ae77fe214400242a59ff7c4740090a4f3fde11cf424293d0b8803c00909d799e2072002426e7ff6c1c7c4909ba039b05d002426fcff7c296a09099095e2028e0242619777c30000908f999e00f81024219167743e010908645ce01546824203cff78551709080f42de0ed002420a4678058260907b719e010188241b097778405f0906c260e10af20241a5a57782bc509069698e213458241925ff784d12490649839e0f0f0241969677828bc09066dd9de072f02419e7678430000905a25dde0bff424168983782ade0905a77fdf050102415916780125a090551ffdf09d682413f7ff8416800904e77fe102400241379ff7c61c809045695de1871424115a637c10620904225de227000240e1977789bfc490386619e1e510240ea467882cc409035999e005b68240d0aff80144009032e7fdd050f4240cba0b8474a60902b9d9e00df68240a07ff8822bc09024e5ddf01d1024091c678404bc0902425de203468240131ff84750008ffd77fde1d3f123ff5e0e785e8008ffedffde1320023ffffff7c01bc08ffd4d9df0016823ff51ff8051c008ff82bfe00379823fdd3677c468008ff2e59e20480023fc71676811fc48ff1c5d9f06a9823fbe7677c1a9a08fedf3fe20679823fb156780029a08fec2bfdf0c00023fa4aff7c1e2a08fe7495df0745823f95dff84030008fda559e00376823f65dff7c06ea08fd9095e20a45823f59dff78291248fd67839e07d5823f5c4ff7c084008fd5f3fdf0930023f3e667802a5a08fccf3fe00139823f329677c3e0408fc6459de0f80423f19173782a0008fc785de20ed0023f0a4676c3b3c48fc291d9f0466823f05dff88006608fc1719df0346823ef7cff7c1e6608fbc0d9e02e11023ec225778b84108fb0898df0bb9823e9b767782ee308fa6ddce00510023e96667841bc008fa3dd9de06ef423e8f77388191a08fa24bfe10496823e547ff8012c008f93f3fe10a99823e45367782a6308f914dcdf0141023e2cd67800e9a08f8a4bfe23259823df6d6778c96248f7db5d9e3199823df796778720008f832bfde1bd9823e0d56778526208f8525de000f0023df5e678406c008f7d0d9df1786823ddcaff785e1708f772c2e202d0023dd9dff80300008f7377fdf2fc8823d9e17774bf1f08f67860e001d1023d9c4677c07da08f6693fdf1041023d895677c28da08f5fc7fde0a35c23d7f20b848c2208f5705de22280023d3997784020408f4e459e10180023d379678807da08f4d67fe11dd0023d17cff7c6b4008f3ee59de1acf423cfb973881fc808f35895e00ef5823cc72ff703bd248f31cc3a00019823cc71677c054008f31719e00090023cc53677ca04408f27495de2810423c9d26378948008f28059de1c06823ca92ff7c8b5608f1e93fe11489823c65c6778522248f1971d9f243f023c289777890f908f0a260e20741023c215677c0cfc08f0785de201d1023c1c4678407da08f0693fdf0469823c0b967847cbc08ef99d9dd1f2e423be6773745f7c08efb719e206a6823bdfcff84a0e608eede59df3c00023b7b96778effd08edee5cde3930023b7e667784dc408ee9095dd11d0023ba5c678075fc08ed785ddf0d96823b379ff70365708ecde82df09d9823b2dc6784608408ec5695de1820423b15a638023d608ec32bfe016c9823af5e6784665a08eb713fde1995923adc50e78410408eb9695df1bc0023aad567786efd08eab55cde0d96823abb7ff78251a08eaff3fe01110023a9c4677c4f8008e9d999de13df423a766737c144008e9c559e03c000239fb9677c6c5a08e781ffdf07110239d625780021608e7567fe205400239d05ff7014fc48e741839f1e000239b25ff7877fd08e6c982de12c00239bd9ff84120008e6b77fdf04b00239a92ff80120008e692bfdf171002398d9ff745c3d08e63682e200f002398caff842a2a08e60895df05df02397c46780480008e5a919de11ff42396a4738403c008e5a559e108310239612577c2a3c08e55a59df072002394f7677c1ec008e4f999e1255002391916778953d08e4645cdf0dd58238f7cff8400c008e3de7fe007698238f0367848dea08e30895e201698238b91677c4f8008e294d9e101110238a42578416bc08e279d9dd05ae42389e773740c0008e28495e1186002388616788659a08e1b2bfdd196592386cb0e80106208e1a25ddd0417c238689837c2a0008e1785dde0a7f42385e18380108008e1417fe00aba823845a5784021608e1147fe105a002383f7ff84078008e0f67fdc01df12383da0e7c1ce608e0d999de0738c238366738446da08e092bfde11b5923824b0e843c2a08e05695df1e0f0237f7967 + +def tb_96 : Nat := + 0x781bc00940a999e2089882501c1777c54c0093f947fde152f424fe520b7c6600093f2e7fde197f424fcba0b882e80093effffdb0b9f124fc000e802b80093ed47fde0adf424fb520b845c22093e785dde1707924f9e1867c0384093e74d9df02b9824f91c677c18c0093e2e59df0c16824f7f7ff743057093dfe02e231e0024f4d9ff885022093ce65ddf0900024f301677823fd093cc05cdf08e6824f272ff88062a093c9695e20085824f251ff7c0e22093c865ddf09c7824f17cff7c30c0093c2e7fe10030024ee07ff7c0d26093b74d9df0c81024ec716788779a093aa4bfde1de5924ea930e885262093a525de11851024e7c4677861404939f11da006a6824e759ff781a970939d682e105a0024e6ffff64167c4939c003a01350024e5caff784d3d093972c2e10990024e531ff844d400938ff3fdc134f124e3fd0e8008e20938c65ddf3681024dfb16778da010937ec5cde3547824dfc4ff78afc809381695e10376824df79ff8427660937b719db09d8924dedc7684428409377495e0240f024db91677890390936e45cdf0376824db59ff7c14220936c25de10967824da72ff80068409369095e105af024d9b76780965a0935d77fde2595c24d75e0b7c24c00935b2bfde092f424d6cb0b80b6400934fc7fde2d8f424d3f20b789c2a09351695e21249824d2cd677449224934b35da00831024d13e67881a4009343559dc068f124d0d5767c27c00933a919df0526824ce51ff7c14c40932a095e2000f024ca81678035a609321c59de0d68c24c8717388299a0931f2bfe01710024c659ff843fea09315695e00231024c2e6677408c10930b99cdd0081024c301677c24c0093094d9dd092f424c25373801b00093079d9e018a9824bf53677862a3092fd4dce00886824becaff803ba6092f7719de0ee8c24bddc737c5ac0092f1c59de16af424bc71738434da092ee77fe00889824bb1567840dda092eb77fe20379824baa667780de2492ea99da205b6824ba4aff7c1d16092e577fe001f9824b93e67881cda092e32bfe20046824b759ff7cba00092cee59de2e7f424b3b973787ec0092d2999de08f1024b612577811c4092d9695e20660024b3536780005a092cd47fe20fd9824b1dc67683f62492c771da210b0024b0b9677442bc492c2e5da209c0024aeddff7426fc492bb7839f1837824ab05ff842cc4092a5999e110f6824a751ff801aa60929b9d9e00dc6824a60aff743717092982c2dd01c6824a6caff7c6c2a09291695df0dd5824a37cff8411220928b85de020c1024a0d5677883010928355ce104bf024a089777812f909282260df00c00249f6d677c0a800927d0d9e10f168249e51ff783c5709279482de0e910249e5a577c15ea09277e95df05c58249d9dff7c390009272e7fdf06000249c59ff7c2ee60926a059da0bb89249a81767c1e5a092681ffe009a9824996d677426a309265b5ce010b002497666788d9260924de59dc364892493797670d3260924e459e2093002492e6677824bc4924b99d9e091682492e7ff781f1a0924bf3fe209468249251ff68251649249483a026b98248fe667789ae30923f99cde198002490b9ff7c23040923d695de08c04248f5a63800c3c0923ca59e011e68248e0aff784797092382c2e019800248c72ff7465fd09231cc2e114d00248b25ff7d32ea09219695de4cb9c24865a63790f800921b9ffde4099824871c6778942609223559df04800248612577c1d160921677fdf034982485696784179a092142bfe01ce0024833cff840dda0920567fdf05a002480ffff88b238091ec25ddc2c8d1247b0986709e16091ed67fdf1aa002478f767786a7d091e3ddce206468247892ff805262091dd25dde1497c247749837c6000091d425ddd17ff42475098384259e091d1cbfe20ed0024736667846c96091be9ffde1b24c246fa80b840d56091b713fe106ff0246c09777c031e091aff3fe006498246b53677c1e5a091ab67fdd0795c246ada0b740e7c091ac65de1018002463796784062a09189695e2040e024621977844ede0918377fe218c00245f51ff8802220917d25ddf0ab78245e9dff782adb0917a782de07e78245ecaff7c2580091781ffe210b00245cfcff88228009171cbfe00c168245b25ff8824c00916a4bfde092f1245a930e88255609164f3fdf198002457a4ff8029400915bfffdf05e982456a1677c10da0915977fe0093002455caff7424bd091572c2e104e0024557cff64137c49155f439f1de98245353677877a30914d4dcde132002453ffff841f800914b559e01680024516d677459fd09145b5ce028bf0244ee17778a2f90913b860de1f068244f7cff8005d6091302bfdf07188244b99777c02040912e459e00e700244a72ff8405a609129719e01e300244879677878bc49121e5d9e0f300244969678865220911425ddc1947924450986705580091151ffdc10c98244591677c00de0911417fe1004682444fcff8442c00910fc7fdf00a982443e7677c371a0910c2bfde0dc5c24430b0b7c087c0910b85de00e7782440d9ff804404090fde59de11001243f7976847080090f6dd9de1c1f1243db776 + +def tb_97 : Nat := + 0x7044fd096e5b5ce10501025b8b9678004da096e177fe20f79825b76667783de2496dd99d9e0e10025b77cff7c9dda096d277fde2775c25b49e0b788eda096d367fe00930025b40aff7c1c62096ce65ddf3000025b0997778bffc496c2661a11f96825ad59ff808d00096ac97fe201b0025ab0aff842238096a525ddb088d125a949867c031e096a4f3fdf0720025a8caff7cae2a09698495e016bf025a4a667785af90969299ce11546825a351ff7855164968d4839e0c00025a3e667782a5a0968ff3fe10289825a329677c03fc0968c65de21551025a1c4677455404968711da001f6825a1a4ff7c04e609686459df0510025a11c677c04bc0968425ddf08778259e59ff7421db09679682dd04800259e9977886f000967277fdc1bbf1259c9e0e7060000967367fe001488259c8977881d4009669cbfde074f1259a730e842ee609666dd9de0bb8c2599b7737c0e0409661859df20a00259547ff74827d09655202e00f49825945367783d23096514dcde08e982594b9678416da0964fdffdf04b002593666784594009636dd9de164f4258db7737c144009635999e009900258ccd6784150009631e59e100978258bffff8006660962f999df02e68258bb7ff840d26096274d9df0c9f02589097778327909624260df0a6682587caff7829970961f2c2e2180002584d9ff8877400960bf3fdf0360025823cff7c35a609605999e115cf025800977785738496002619f14178257e07ff800ae6095f7719e00af68257c51ff7c3540095edf3fdf21f0025795dff7887bd095e5782de13200257a4aff7c0522095e525de206f782578d9ff6c1bda495e36839b062102578e7677c7c80095db9ffdf05298257695677c6780095d3dd9de19df42574f7737c2580095d1859df07b002573e667800b40095cee59e22b9682570ffff78ae56495c40039e214682571a4ff8828e6095c1719e214700256f15677851bc495bc55da00ae00256e676780725a095b277fde1c95c256c9e0b881eea095b0895da07b99256c2266681ee4095b089be201758256c0aff7c5a66095aa859de1698c256aa1737848c0095ab9ffe1028e0256a19777c2a3c095a5a59e204368256925ff7c24c0095a24bfdf1d0102564b96778740109592e5ce00240025649567840ec409591695e005700256325ff8004260958c559e206f002562a667741bbc4958a99d9d048002562cd677c3fea09585695de0ff9c25615a637c80160957d67fde2004c255f5a0b78783c0957de59e108700255dcaff7421bc495772c39f01398255db767844f8009571e59dd13df4255c797380297c09567719dd0a5e42559dc73800abc0956665dde02ae12559998680180009564e5de0080102558b9677c090009562559e107bf0255699777c139e095592bfde04e6c25564b0b7c85bc0954d0d9de216e4255343737c3a4409549695de0e90425525a638802160954947fe114b98254fe6677c0b400953ee59e000168254fb7ff8034260953b9d9e200858254d59ff8060000952f67fdf18000254a59ff88bb260951db59de2ec8925476d7678b2260951e459de11b9825493e677821ea09527495df0c9002546a46774323d0951a91cdf003002546a1677c114009519719df01a1025464257880a380951865ddf384f02541e17778e13909507860de2dcf025428977789fc00950b9d9e0005102541dc678000fc09505799e1009782540ffff847f26094fc0d9de1fc8c253f0373786180094fde7fde14e98253fb16788ea5a094ed67fde3a959253b5a0e843dc8094e8495e005af02539b7677816b9094e6ddcdf07b002537e667880b40094dee59df029882532e177840144094cb719df17e6825315dff785f97094c5782e01f098252f6d67787c23094bdb5ce002a00252f4367780a7d094bd0dce00a368252e5dff7828d7094b9782e21a400252cb9ff7868fc494b2e839e0a698252db767782640094b713fe01ad002529a4ff786b3d094a6942e00379825296d67883240094a2919de0c8f12528a4767c0cc0094a1c59de032f4252871737c0540094a1719e106a682527f1ff840b400949f13fe105e98252766677c14400949c559df2776825249dff8451000948d67fde143f125235a0e8402160948947fe00d50025217cff8038e20948265de101998252079677c5ade0947a77fdd16b6c251e9e0b8007260947a059df00a68251c51ff7c1aa60946f9d9e00c168251b25ff7830564946c983a005898251acd677c42fc0946705dde10be12519c186892d9e094542bfde4b66925150b0e78fd9e094572bfe00b100251459ff8416800944ffffe2019982513e6678424c00944d4d9de092f425135373841f800944b559de07df12512d5767c5a0009445b59e11a268250fcaff8801800943f13fe00af98250f15678060000942c25de105298250a95677c378009426dd9e00c0002508f76784177c0942265de0019982507e6678459040941a095de16404250682637c0fa20941425de10136825039dff8008400940df3fe200300250379ff8819260940c559de064892503157680329a094092bfde0ca5925024b0e782eda0940967fde0ae0025026767 + +def tb_98 : Nat := + 0x786c2a099c9695de19800267272ff784380099cbf3fde10188267309777c7140099bedffde1c4f4266fb80b785ce2099c025de20bd00266e8167801e5a099b81ffe10ce88266d39778439de099b147fdf0b400266b9dff742cfd099ae782e114400266a59ff7850fc499a9683a11108826694977801c80099a32bfde071f42668cb0b803e040999a859de0f8042666a17380371a0999713fde0dc5c2665c50b8009c00999677fe1543a826605a577950e709981698de49488266109777c7caa09977495de1f29c265dd263785766099799d9df1c758265c0aff7471d3099702c2df07188265b99777c2c5e0996b9ffde0b16c265ae80b7c296a09969095de0a59c265a42637c363c09965a59e10cff026589977804fc80995d695dd13f1426575a637c10260994ec59df08b68265325ff7822d70994c982e01c50026513e6778713d09944f9ce202af0264f99778415840993d0d9e004200264f01678839fc0993865dde0e7e1264e1986782fc409939095e00b310264d6667782cc04993599d9f0ed00264c7967783b3d09931e5ce117e982649d367785fa3099274dce11e1682647f1ff80139e099192bfe004e002645fcff8028aa09915695e1216f0264343677c06c00990b999e21696826417cff844c80099012bfde131f126404b0e7838e20990265ddf0ed00263f5dff7c0d26098fca59de0348c263f29737807e6098fcf99de00a98263f5367882a2a098f5895dc0a899263d6266702a24098f589bdc09d98263d6d67701e66098f6459dc07188263d99777c1638098f425ddf05010263cb9677d3d40098df119de4f4f42637c4737884c0098ea999e202af0263799777c0b04098ddb59df00f0026375e6784011a098dd67fdf0c00026365c677c1284098d8495e20745826359dff6c1d12498d67839f0349826356967840dda098d4c7fe0135002633fcff882a66098cd4d9de0a98926335376840540098ccf3fdf063002632d9ff7818bd098cb682e0115982631c467800216098c567fde0084c26315a0b8837da098bdf3fde0df59262f7d0e8800c0098bde7fe00e478262dfcff849540098ae9ffdf00900262afcff845166098a6dd9df051002629666784101a098a497fe102e982628f767801b000989b9d9df00d682626d9ff843e220989785dde0f87c2625e18380265e098951ffe10d500262472ff6c353c49891cc39b0b298262495678420400988fc7fe00ee982623036780714009884f99df069002620d5678812fc0988225de211010261f79677c1b000987a559df09b10261dfa577c0bd6098772bfe101398261db7677c30000987377fe104c98261c9167880dda0987167fdc03759261c5a0e7c14220987025de21b000261a07ff786bfc49868203a2043982619c467882b1a0985fdffdf19e00261659ff84b8260984de59de2e0892613797678b2260984e459de2c088261399777c1e000984c059e12f7f0261009777c035a0983b67fe100f00260ecaff7c32a6098374d9e0099f0260d397780024009833f3fe00a998260c536784359a0982df3fe01bb882609c177746edf09827060e019f20260822577467c509820898e10e2982604f7677838a309813ddce106600260491677c060009811e59e10180026046167805eda0980567fe018f0025ffcaff7863bd097ff2c2de0508826010977840144097fb719e20df6825fdfcff7837d6497f7f43a11738825fc8977807200097e9695e101d5825fa3cff700752497e8f43a00559825f9e7678424c0097dd4d9dd092f125f753768851c0097d82bfde146f125f60b0e844266097d4059de1098925f50176842940097d1719e10bc5825f39dff782f12497ce7839f0256825f2ddff7c1980097c8059e11897825eeffff74625a497bc003a02b50025ec4aff78ad3d097b12c2de2599825eca6678405a6097af999e00a96825eb3cff7c4d40097a81ffde134f425ea080b7c0d26097a74d9e208b6825e947ff8042c0097a0f3fdc10af425e83d0b8035a60979d999de0d68c25e766737830000979df3fdf3d50025e3916774f53d0978e45ce00c46825e23cff7c08e20978865de20e77825e131ff7039da49784c839c0b31025e1666770271e09785f3fdf0b89825e07967782e2309781e5cde0780025e0b9ff7c8a000977785dde227f425dde1837c12000977665de00937825dd05ff7c9cc00976a4bfde272f425da930b8852620976525de11272025d8225780417c0975c719e00c00025d65c6784245a097572bfe13418825d2897778d05f0974a260de2f59825d2d56784b6040973ec59de2d80425cfb173785b4409744719e21b00025ce0167786bfc4973805d9f03ff025cdc17788d94409729719dd3650125ca5c7674c8040972a859e10750025c9e7677c060009721859e000a9825c75367805c7c0971785ddf0081025c591678822da0971417fdf12c0025c3d9ff744afd0970f682e00739825c36667781ce30970d99ce0084f025c2e177807404096fde59e00796825beffff804ec0096f713fe100d9825bdb7677c2b1a096f42bfe10799825bc9167781e63096f245cdf0466825bc4aff741197096f12c2e01140025b96d67 + +def tb_99 : Nat := + 0x7443d709c99782df01ba827264257805cc409c92999e0220982721dc6778882309c8771cde115982722e767801e8409c85895e00bdf02720a4677c19da09c80f3fdf07800271fc4ff7c576609c799d9de15d8c271e677380035a09c7967fdf1d088271c897778741f09c72260e218378271b05ff7860da49c6c183a20c900271a3cff78323c49c68f439e0aba8271a5a5780156609c679d9e00c168271925ff88177c09c6265de014778271751ff7851da49c5d483a200888271749778431c809c5a095e00f0f02715916788120009c52e59e21d7f02712e1777875f849c4b8619e11b6827139dff7c61c809c45695de1871427115a63846c9609c3e9ffde1b24c270fa80b7c63a209c3865dde18e7c270e1983802cc409c35999e227f00270ae767789fbc49c2b9dd9e1ae68270bb7ff8037da09c281ffe20c000270947ff742ffc49c25203a002b9827091c67740ae309c2471ce2012f0270909777c12c009c1fc7fdf114002706ddff7444fd09c1b782e208400270659ff84262209c1705de236e102702536778db8049c094dd9e3672027025a5778aede09c0c17fdf00168270251ff888bda09bfedffdf0de0026fed9ff70377d09bfb682e20cf0026fe0aff8000c009bf81ffe01b60026fc51ff746d7d09bf1482dd14e9826fcb96780354009bedf3fdf09f0026faddff7827bd09beb782e01a10026f93cff88beaa09bd9095de2fa9926f6426678bea409bd909bde2eb0026f651ff78b8aa09bd9695de2df0026f65dff788f4009bdbfffe207d5826f5c4ff7c09c009bd677fdf0349826f56967780d2309bd5a5cdf1080026f461677c2a0009bcee59e107c6826f33cff8404e609bcca59e22850026f0a46778a13c49bc291d9e1980026f1916778611a09bc693fdf0466826f05dff7c006609bc1719df1df1026edd2577cb31609bac17fdd2cc4c26eb060b7c432609ba5999de10c8c26e9667384930009b9b67fe10fc0026e49567783efc49b9255d9e0d80026e4b96784198009b899d9df11df026e149777c770409b7db59e000f0026df5e6788081609b7767fe000f0026ddcaff7c432609b72459e220f1026da82577c003c09b6a059e009ff026d9e17788014409b67719df0090026d9d3677c0b9a09b6693fdd02e5c26d9a50b7c02e209b6665ddf1041026d895677c929a09b592bfde24a5c26d64b0b7cac6209b4e65ddc2b17c26d3998380020409b4e459e02b36826d0ddff80630009b3d47fdd18bf426cf520b8821c009b3b2bfdf0c30026ce07ff8033a209b34e5dde0ce7c26cd3983782b8009b3567fe00c81026cc716774320109b31c5ce101e0026cc536774077d09b314dce01f96826ca59ff787e5649b296839f087a826c9d2577421e709b27498e022d5826c7a4ff8852aa09b19695dc14a9926c65a6688201609b1767fe00a80026c531ff7c192609b13359e003c0026c49167845a0009b0ca59df147f026c1e1777451f909b07860e202f1026c16257680bc049b058999a02ef826c1626f80163809b0425de20097826c0ffff8411a609b02e59df0d96826bfcaff7c1d4009af99d9e12bf6826bba7ff88af2609ad2559de2bc8926b4957678828009ad51ffde1c09826b5916780089a09ad1cbfdf0810026b3f1ff7c3ba609acc0d9df0270026b2dc67840d8009aca999e104c6826b259ff6c131649ac9683a100f0026b24aff80600009ac32bfe11399826af9167784e6309abe45cdf1371026ae5a57744dc109ab9698dd0916826aeffff74240009abc059dd0330026af5e67880fde09ab767fe10229826adb767846b7c09ab025ddf0570026a96d6780324009aa2919e211a0026a1e76774467c49a879dd9d0ef1026a212577439fc09a8865ddf0409826a07967804ec009a7cf99df05400269d05ff7814fd09a74182e10b298269c5367782ca309a714dcdf12d68269b25ff8012c009a6a4bfe01b9002698d9ff8003c009a632bfdf1e3002696e7ff7878bd09a5ba02e1072002694f7677c0a8009a53359df2e6682690ffff78b99709a44002de28c68269159ff78954009a46459df0a5a826905a5784375609a3df3fe002700268edc677c428409a37495de10a04268dd2637c903c09a2e459de240e4268b91737c1d0409a2a559e100558268a3cff880aaa09a28495d902a99268a12668846bc09a23dd9dc11ae12688f7767041d609a242bfdc0ec58268925ff702a3c09a25a59df1adf026874977841bde09a1b67fe0057a8268682577815e709a1a098e00db78268505ff802aea09a11695df00858268451ff7c168009a0fdffe203768268379ff780dd649a0de839f01398268366677c46da09a092bfe010e0026813cff78437d09a04f42e022098267f1c67788823099fc71ce003600267ee66780221a099f977fe219098267ccd67786422499f335d9e15300267d0aff80341a099eff3fde0d05c267bfd0b8410e6099eee59df13710267a825784003c099ea059df13968267947ff784e57099e5202df048002678ffff7c2880099e177fe0066002677f7ff7ca76a099d5695de29d9c26755a638853d6099d02bfdf1ce0026723cff78737d099c8f42de1b900267251ff + +def tb_100 : Nat := + 0x8077c409f77495e0375f027da5c6778dd7909f6971cde35f5827da72ff789e1609f6d67fe11650027d8f76774593d09f63ddce105df027d89977884ede09f5d77fdf0dba827d682577836e709f5a098e20775827d60aff7c6c2a09f51695de1b09c27d45a638003c009f4b359e010bf027d1c1777c1e0009f4525de000c7827d13cff802ce209f4225dde0b37c27d0898380794409f3a919e10526827ce51ff78149709f39482e01906827cb3cff80882609f24719de2208927c91c767cecc409f0b999de3b30427c2e67384144009f0a559e00ae0027c1e767844b5a09f02e7fde12d5c27c0ba0b78425a09f0377fdf1669827bf53677859a309efd4dcdf0016827bf51ff805d6609ef7719dd1758c27bddc738028bc09ef4e5dde0a2e127bd39868096de09eeb77fde25b6927bade0e880de609eea999dd0378927baa67688521a09ee577fdc1485927b95e0e7c2a2a09ee0895e1090f027b7916784090009eddb59df0136827b759ff7804d709edd682e00f76827b59dff8429a609ed3dd9e00660027b353677c1e5a09ecb67fdd0795c27b2da0b741b0009ecb9d9e106a6827b159ff7c282609ec2e59e207c6827b03cff781f1649ec0f43a00c00027af7cff8400c009ebde7fe20988827aee1777c00de09ebb77fe10019827aedc6784f59a09eac17fdd3d65927ab060e7c30ea09ea9095e211c5827a925ff78471249ea4983a01966827a6caff74659709e9b2c2df0418827a689777c600009e9425de10b61027a453677c16da09e8fdffdf1909827a2676778642309e899dce0177f027a08977785df909e82260de12c0027a0d56784385e09e7e9ffdf04e00279f59ff800ec409e79695df06000279dfa577017fd09e77e98e01e600279bb7ff78797d09e6ee02e11b000279a07ff8809a209e6785de10fc0027987167783efd09e61c5cdf07f682797f1ff8822e609e5d999da08b8927976676681d4009e5df3fe13ccf02793997778f33849e4e661a1073982792e667701ce249e4b99d9c072002792e7ff70174009e4bf3fe0208682790ddff70821649e43783a1024002790b9ff880c3c09e3ca59dd030e1278f297674075609e3cf3fdd01bf0278f3e677c13da09e3b67fe03c498278b156774f12309e2c55cdd3b400278b25ff74d74009e2df3fdd26700278c72ff7433c009e382bfdf240002788d567788ffd09e2355cdf0b310278822577c417c09e1c719df0ce882786197778339f09e18660de08da827865a57880fde09e1767fdd03f692785da0e800f0009e1677fe005e6827850aff84ec4009e0567fde3b0f427815a0b80780009dfde7fde1dff4277f7a0b7c1da609dfc0d9df35b68277ba7ff78d6d709deea02e102e98277b79677c245a09deb9ffe004698277aa1677c030009dea559df19e002778f76780191a09de24bfdf05f1027775a5788043809ddd25dde010d1277749867c300009dda25de0007202776825788297c09dd7719db0a5e12775dc7684251a09dd51ffde0945c2775480b7c0fa209dd425de00ad1027745c67803d8009dcd999df0af68276e51ff782bd709db9482e203888276e19775c0e1e49db86619f03f78276dd9ff8003c009db72bfe000600276dc4ff8452e609db1e59de14b8c276c79737847a609db2999de0ba00276d0aff7c1f1a09daff3fe104398276bb9676c10e249daee5d9f09ff0276b19777c0fde09dab67fe027c0027685dff7c198009d9fdffe201698276766677c830409d95695e11c8f02763916788138009d8d0d9dc04df1276343767c228009d89cbfdf14100276131ff7c2e2609d81e59dd0b88c27607973884bfc09d7d25de100900275cfcff7c078009d714d9e1281102759d25778a04109d67498de20868275a4aff785d5a09d6b77fe22d2582756ffff74b49249d5c003a00471027565a577811c109d59698e101800275642577c36fc09d55999dd0dbe4275566737c414009d51859dd104f42754617388185a09d4ffffdf0d698275329678013da09d4b67fe0004982752d5677c5a0009d45b59de167f427516d73783e4009d47719e000f0027515e6780408009d41719de101f127505c7680139e09d392bfe004e00274dfcff7c246609d2de59e200888274749778002c409d1cf99e01a4f02745997778693909d16660e009378274505ff7024da49d14183a0009002744fcff883f0009d0b77fde0fbf12742de0e80635a09d0367fde18d5c2740da0b7c4d4009cfe93fde134f4273fa50b80186609cfd0d9df180f0273c796780106209cf025ddf05178273bb7ff78145b09ceee02e0138002739e177744dfc49ce78619d09810273a81677425c809cea095dd04410273ad5678820c409ce5799df050102738b9678870bc09cda65dde1c2e1273699867837da09cddf3fde06a682737f1ff7c260409cd8059df300002733016778bffd09ccc05cdf004682732fcff7c300009cc8f3fde0bff427323d0b7c45c009cc497fe106c002730b9ff7c1bc009cc12bfdf27798272dd367789de309cb74dcde23598272e156780163809cb425de100378272d05ff80031e09ca4f3fde00c6927293d0e80090009c9db59df10f6827265dff + +def tb_101 : Nat := + 0x7c01da0a29167fe21080028a351ff7841fc4a28d4839e0739828a3e6678859400a287119de164f128a1c4768407da0a28693fdf0139828a19167801d400a284719dd074f428a11c73802f9a0a28177fdf07800289fc4ff8436000a27705dde0d7f4289dc183884e000a27225ddc137f1289c89867c385e0a26e9ffde0e16c289ba80b844d400a269cbfdc134f1289a730e7c76620a26265de214778289751ff7851da4a25d4839e13f2028975a577c21c00a25b2bfdf00c782894fcff74031b0a253f42e004968289292ff804e2a0a245695df01d5828913cff7807530a244f42e122098288f1c677888224a23c71d9e1cf98288f6d678830840a239695e10a2f0288db7677c3a800a233359dd0e9f4288ccd738430fc0a23025dde0c3e4288c098380025e0a22ffffe204800288bb7ff7811fc4a22ee03a006c00288ae7678862400a225799de188f128895e7678537c0a22665de20420028891c6778107c4a22471da00be6828885dff7c19800a21fdffdf0ed002886ddff7c47220a21705de00e7782884d9ff8075000a20c17fde1d3f42883060b7874220a20c25de0009002882fcff8830000a208f3fde0bff128823d0e88145e0a1fedffdb05169287fb80e8016800a1fd77fdf08268287d59ff8414220a1f425de21a400287b15677468fc4a1ec55d9d13c68287b7cff80329a0a1e92bfdf2b9982877916778ae630a1de45cde175982878d567785c400a1e367fe0330002874616778cbfd0a1d185cde1cc682875c4ff8861da0a1cb67fde187592872da0e843e220a1c785ddd0f8792871e186804f440a1c2919dd13d042870a473880dda0a1bb77fe000198286edc67841d400a1b99d9e101c68286e4aff7c8a2a0a1b0895e013a58286ae7ff784e930a1aba02e109498286a53677825230a1a94dce000300286966677c851a0a19d47fdd2145c2867520b8814040a192e59e10c1682863f7ff7830570a18fe02df07b0028637cff7c19e60a18c559de0678c28631573846dda0a18577fde1b75928615e0e7c6c960a17e9ffe010398285ea4677840e30a17a91cde03a98285f6d6780119a0a17977fe218000285cddff745ffc4a1737839d0c000285d9dff7418ea0a177e95df0e100285bfcff78383d0a16ff42e10bdf02859c46780aba20a15a65dde2ae7c28569983788ca60a15c559de17d002857caff84139e0a1592bfdc04e6928564b0e7c12660a158059e2267f0285399777c0fde0a14d67fe0088682850ddff7c3de60a13f999df28c68284d59ff80c7800a124f99dd31df428493e737c12840a119695dd04a0428465a63842e260a111e59e0093002843e66780251a0a10d47fdf1efa828416257787be70a105898de175982841dc678400fc0a105799e128200283edc6778a07c4a0fb71d9f0df68283dfcff7037d70a0f7f42e22a300283b59ff78a8bc4a0ed6839e26b98283b91677876aa0a0f0895de17388283c89778451ea0a0e8495e10a8f028396967782a390a0e5a5cdf04368283925ff849ffc0a0d785de2099002833d9ff7ca1a60a0bf119dd2868c282fc473743b400a0c577fdf06600282f5e678418ea0a0b7e95e202058282dd9ff8460000a0b167fde17ff4282c5a0b8817400a0aff3fe000168282b51ff801b5a0a0a3fffde06d5c2829000b7c23a60a0a1c59de08e8c282871738805400a0a1719e1097682827c4ff7425d64a09f143a126aa828255a57802f160a09277fe00930028240aff80dc620a08265de200678282092ff7c005a0a07edffdf28c98281acd6778a3230a06b35cde1bc00281b9dff7860000a06f67fe110bf02819c1778875c00a053359e1114002813b9677844fc4a04ee5da03f468280fc4ff78fd170a03f142de3ee68280fcaff78df1a0a040f3fe0021f0280ee1778800660a03b719df43b00280aa167790ebd0a02a85cde34b00280b916778cd1a0a02e9ffdf00c00280a95678837800a026dd9db0ddf12809b7767c13800a025a59e1072002808f76780665a0a01d77fde1995c28075e0b7844400a01f999df076982806e767781da30a01b9dcdf00d682806d9ff8014220a01a25de1007202806825780125a0a0151ffdf16e002803d9ff745b7d0a00f682dd0eda828045a578012c00a00d999de04af1280366767c04800a00c0d9df141f02801c1777450790a007060dd0b86828024aff80810009ffd67fe01080027fe51ff7841fd09ff9482e20780027fdd9ff681dfc49ff7683a10cf0027fd0aff7c2e8009feffffdf0676827fb51ff7c342609fea059e21650027f91c6778593c49fe471d9e0e7f027f9997788f00009fd277fde3bff127f49e0e78e10009fd367fdf22b0027f272ff88062a09fc9695df0dd5827f17cff74375309fc5f42e00570027f125ff7815bd09fc4982e11417827ee07ff78505a49fb82039f0ce8827ed397778339f09fb4e60df0480027eacd677c302a09fa7495e00745827e95dff7c052209fa525de200c7827e93cff881c8009fa32bfdb071f127e8cb0e884c6209f9e65dde1317927e799867841a609f9f119e10b17827e6e7ff84474009f972bfde11cf127e5cb0e7d1c4009f8567fde470f427e15a0b + +def tb_102 : Nat := + 0x881e5a0a5af67fdf0cf00296b0aff80029a0a5a32bfdf1318829679977744c5f0a59e660e20f8102966a167783e004a59a85d9e099782966ffff8012840a598495df0955829657cff7825530a595f42e1085982964f767800a800a593359e104500296461677c75fc0a58a25de11800029610977785ffc4a5842619f07698295f03678009c00a57b719df10a10295dd2577ce4000a569095de38ff4295a42637c363c0a565a59de0d8e42959697384359a0a5624bfdd0d6592958930e7c8f400a554059e1004682954fcff7c42c00a54fc7fe1192f0295149776c64b84a545261a000b1029513e6780005a0a544f3fdf02700294f1c678006c00a53c059e005d00294ea46780419a0a53677fde1065c294d9e0b8830000a53377fdc0bff1294cde0e7c09000a532e7fe006000294c59ff8441a60a52d4d9e200168294b51ff84c85e0a51fdffde3216c2947f80b840b400a51f2bfe009c782945fcff7c23040a509695de08c0429425a638081c00a5012bfdf0f798293f53677c0a800a4fca59e014d00293ddc678002400a4f74d9e204800293cb9677c34800a4ef9d9df0d200293b1567880dda0a4eb77fe23709829376d6778dc224a4ddb5d9e34c982937916778d1220a4de65dde319982937c4678003c00a4dd799df0420029371c678485560a4cff3fdf0a998293353678863c00a4c7119de18ef12931c476840cc00a4c6459df02f10293162578000fc0a4c5799e200468293159ff7c3f660a4c1719de0fd8c29305c737c25da0a4bf13fe104800292f7cff8000c00a4bde7fe007698292f03677c38040a4b8059de0e004292e017388011a0a4b7f3fdf30000292afcff844b5a0a4a497fdd12d592929260e7c24c00a4a24bfdf13f98292753678483d60a491cbfdc20f492924730e8430660a48ec59e00ae0029230367840d800a48b359e203a68292292ff8810620a48225ddf18810291f0167880ec40a479695df06000291dfa57800bd60a4772bfdf0ed00291cddff800de60a472999e202e682919a4ff848f9a0a45b77fde23e592916de0e782ac00a461c59df0dc982916016785c9da0a43b67fde72759290eda0e79c6800a43b9d9de547682910b9ff8830c00a4381ffdd0c2f1290e080e7430000a4382bfe116068290c72ff7858164a431cc3a221900290a59ff78863c4a429683a205898290a0167880ffc0a42705ddf13a582906e7ff784e930a41ba02e208da829065a576c23664a4196999f01800290642577c1a160a41767fdf015002905c4ff7c16e60a415a59e218c002902d567845dc00a405799de176f129015e768810800a404719dc041f129011c768004bc0a40425de0009782900ffff84296a0a401695e21c0e028fe99777870344a3fa6619f35b9828faa16778d6e30a3ea85cde3150028fae7ff7c03000a3ea559e203b1028fa5a578401560a3e8f3fe21948828f5097774651e4a3d4261a20037828f505ff841ec00a3cfdffe20409828f3b1676810224a3cec5d9a02d0028f3c4ff8022da0a3cc97fde08b5c28f3260b7c11220a3cb85de01897828eeffff78625b0a3bc002df2a60028ec59ff8416800a3affffdd059f128ec000e8479800a3a74d9e208b6828e947ff7822d64a3a5203a100e8828e93977805d1e0a39f13fde1746c28e7c50b8817a60a39d999dd05e8928e7667680a31a0a39367fe21489828e39167846a800a3879d9e10ac9828e079678449da0a37d47fe10b40028de9dff8441220a37665ddc1047928dd9986840dc80a375895df060f028dd01677818390a37405cdf0af6828dc51ff742bd70a371482e14c09828d791677930230a35e45ce00750028d71c678442840a358495de10a0428d61263846e160a35167fde1b84c28d45a0b7838160a354c7fe21800028d2d9ff8001260a34b559e10b17828cae7ff782c5b0a32ba02df04e0028ca5367843a800a325a59de0e9f428c969737c82da0a31d77fe000a9828c7536784027c0a31d25ddd009e128c74986842ade0a31a77fdb0ab6928c69e0e6c1f9e0a31b2bfe10bc8828c5e177885b9e0a311cbfde16e6928c4730e7838040a314059e00810028c3f1ff8406000a30f67fdb017f128c3da0e801ce60a30d999df084f028c2e1778048000a30705de021c7828bfa4ff78871b0a2fe942de1fd1028bfc4678012c00a2fd67fdf1a29828bdb7677868a30a2f6ddcdf13e0028bc7967744f7d0a2f1e5cdf02e6828bc4aff805c400a2eb67fde170f128bada0e7858e60a2eb9d9e20049828bad5677c5dc00a2e5799de176f428b95e73785a000a2e5b59df0a50028b8b96778293d0a2e2e5ce20210028b83cff78083c4a2e0f439f0c00028b77cff742ffd0a2ddf42e00169828b766678843800a2cbf3fde10df128b2fd0e7842660a2cc059de0c79828b3436780019e0a2c24bfdf0480028b04aff7c3e400a2bd47fde0f8f428af520b8404e60a2bcf99e10a06828ae9dff6c28164a2ba7839b0736828aecaff7db6660a29f119de6d98c28a7c4737911000a2a967fde3f79828aaa66778de000a2ac97fe02476828a57cff7891d70a295f42e10139828a56967841c800a293dd9de071f428a4f773 + +def tb_103 : Nat := + 0x7c24c00a8ac2bfe2149882a29c17778525e4a8a70619f083102a293e677820c10a8a4f9cdf073682a28caff741cd70a8a32c2e00fc002a265dff783efc4a8997839f1b7982a24a667786de30a89299cdf1bf002a22e7678842c00a887719de10af12a21dc7678417c0a88785de1082682a2159ff7c2d660a882919e10df682a1fc4ff7837d64a87f143a0017582a1c0aff88c4380a85d25dde310d12a17498678c2160a85d47fde300002a175a57781cbc0a8679d9e107e782a16caff880b400a85a77fe010c982a1591677843230a85645cde0bc882a15e1777c85da0a84de7fde2175c2a137a0b787cda0a84e77fde0fc002a149567841e000a83a919e10b3102a0d66678426400a833359de098f12a0ccd768474a60a82b9d9e10df682a0a07ff7c72c00a820f3fde1caf42a083d0b783fa20a82425dde0ce882a0939778057c00a81b77fdf044882a0699778026220a81705de232c102a02956774cb004a80a55da012f002a016667784bbc4a80599d9f034682a0131ff882e260a801e59e0006f029ff536780521a0a7f82bfde1485c29fe0b0b7c58800a7f1c59e20745829f95dff7c97800a7dbfffde25df429f7000b7881000a7dd67fde0889829f8d5678031da0a7d767fde0c75c29f5da0b7817c40a7d9095de0436829f65dff8488260a7cee59de2208929f3b976787ce60a7cf999e007c6829f33cff8404e60a7cca59df09ff029f1e1777c5ee60a7b8059de17b8c29ee01737c0bc40a7b7495df1b00029ec22577c30000a7ab9ffe11f09829e8f767787c230a7a3ddcde1c20029e925ff7c875a0a79b67fde21d5c29e6da0b8410bc0a79665de00081029e591677cabfc0a78b85dde2afe429e2e183789ada0a78c97fde13e0029e45367783f000a792559df0141029e2cd67841cda0a78967fe11849829e0d5677861224a78355da200a6829e0caff84cb400a77677fde32cf129dd9e0e78c0000a7772bfde2f10029ddd9ff7861e60a77d0d9e131ba829da825778c6e64a76a0999e10c9829dc916780003c0a76a059e109ff029d9e177847a5e0a75fdffde1e96c29d7f80b8480e20a75705de02280029d399778008040a74de59dd0200429d379737cdbfc0a74025dde36fe429d009837c14040a73ee59e20660029cf53676c197c4a73d4dd9b05f1029cf5a57845c7c0a73785dde171e429cde1837c5c040a731c59dd1700429cc7173745b9e0a731cbfdd0a80029cd39778004da0a72a4bfe10919829ca01677024624a72805da11350029c65c677c3d800a715999e00990029c4cd6774263d0a71335cdf0736829c459ff8049c80a705895de1271429c162638800fc0a705799df05e6829c0ffff884d400a6ff2bfde134f129bfcb0e78296a0a701695df0ee9829bedc677c1d400a6f99d9df2ee0029bb7967802a660a6e9719df01a1029ba4257840c000a6e8495e005af029b9b7678874400a6df999e00886829b75dff7c51c00a6d2559df0390029b45c67780e3d0a6d171cdf05b6829b24aff8060000a6c32bfde17ff429b0cb0b8449800a6be93fdf0a50029aeffff78293d0a6bc002e01a40029acb9ff7868fd0a6b2e82e20289829ac9167680a224a6b245d9a027a829ac92576809c00a6b24bfe00180029ac796784305a0a6aedffde0c15c29abb80b8092a60a6a5b59de24a8c29a96d737c32400a6a2919e018f0029a715677863bd0a69c55cde13e0029a7666780e7000a68de59de39bf429a379737c49da0a68947fe21d89829a079677076224a681e5da001c98299e81677c1e5a0a67567fde0795c299d5a0b7c3f660a671719dd0fd8c299c5c7380209a0a66f67fdf14700299a92ff7851bd0a66a4c2e004800299a4aff7c22620a66705de00f6782998caff8810e60a65a919e200f0029969567882eda0a65767fde0bb592995da0e801c260a655a59df04500299461677c191a0a64ff3fe216500299281677c3c000a646459df02f1029916257807a160a63de7fde1e84c298f7a0b7879560a63df3fdf07698298f036780095a0a63b77fe008400298e59ff7820fd0a639682e1237a8298c2257841e960a62e9ffe204e00298b59ff78137c4a62d6839f05088298b09777c31c80a629095de0c714298a42638801560a628f3fdf02aa8298a125788ad160a61d77fde2b44929875e0e786c3c0a621859df0148829874977882ade0a61a77fde0ab6929869e0e803a380a61665ddd0e8d4298599837c145e0a6151ffe004200298505ff842d000a61147fde0b3f12984520e8051c00a60c2bfdd146f429830b0b8452620a60705ddf0016829813cff7c65400a5fe9ffe000300297fa4ff8428da0a5f977fe214700297d0aff800f660a5f3359e103c00297c916780251a0a5eff3fdd0945c297bfd0b8410e60a5eee59df0d098297a8167841e5a0a5e81ffe006e8829799977781b9f0a5e6660df06000297939777c20040a5e2e59dd080042978b9738009000a5e2559df0376829785dff780dd70a5e1782e13c00029749dff78effc4a5d27839e25c98297601678890ea0a5c9695e1032102971e7678461440a5b5895de18504296d6263800a380a5b4e5ddf03000296d0977 + +def tb_104 : Nat := + 0x8000c00ab9a859df045002ae65c6770113d0ab9971ce20c8582ae531ff7432124ab94c839d090f02ae569677c86220ab8c65de0104102ae215677c761a0ab80f3fde1d85c2ae03d0b8822e60ab7ec59de08b892adfb1767c499e0ab69cbfde1266c2ada730b800c2a0ab69095df05af02ad9b7678440da0ab5d77fe201f982ad73e676c07e24ab5cf9da2073682ad6caff7c10620ab5a25ddf07e782ad60aff701f9b0ab582c2e11b0a82ad45a578820160ab4f67fde080492ad3da0e781cbc0ab4f9d9e00d6982ad30367880d800ab4b359df103982acea4677440e30ab3a91ce213e002acd66677c8a5a0ab2cf3fdf0baa82aca8257742ea70ab2a098e0000f02aca81678460000ab192bfde17ff12ac64b0e843c2a0ab15695e00bc582ac49dff8424c00ab102bfdf101882ac309778400de0ab0c17fdf004982ac301678810800ab094d9db041f12ac25376841b000ab079d9e0154682ac092ff7855170ab024c2e1148682abe0aff7852164aaf82c3a0151982abcb9677854624aaf2e5d9e0d1882abd39778412000aaf1c59df193682abaddff7864d70aaeb782de15c002abb15678804260aaeb359e1027002abaa6677c16da0aae92bfe2074582ab95dff7c2a2a0aae0895e10b1782ab6e7ff782c5b0aadba02df046982ab6a1678811c40aad9695de047012ab65a667c25560aad713fde0954c2ab5c50b8847a60aad2999df153002ab3536784059a0aaccf3fde016592ab33d0e885e260aac7119de178892ab1c476883f000aac177fdf003a82ab05a577800e70aac1698df01d582ab03cff8830000aabdf3fe0087782aae59ff7421db0aab9682df1d0882aac89778060de0aaac17fdf0a9982aaa5c678860000aaa265dde17ff12aa899867c43da0aa9d47fe106a982aa6e76784071a0aa9b2bfe0270a82aa45a57789c270aa91698e01a4782aa13cff78691b0aa84f42e0072002aa0caff8054660aa7de59e005d002a9f1c6778173d0aa7c71cde036002a9f43678006c00aa7c059e0001682a9effff800d560aa7713fdf073682a9c59ff781cd70aa71682e22b5002a99a4ff78ad3c4aa669439e252002a9a07ff7876260aa6a059de11d002a9b3cff844ce60aa61c59df567f02a9309777959f90aa4c260e2023102a92e6676c08c04aa4b99d9b021782a92e7ff7c251a0aa4947fdf120002a9131ff7c09000aa42e7fdf030f02a8f29678845000aa38559df042002a8dd36778107d0aa374dcdf256682a8b7cff7895970aa2df42e2105f02a871c676c41784aa1c71d9f0c2102a865a577430810aa19698e0048002a8612577c90000aa0ca59de23ff42a8329737c78000a9fec59df157682a7e59ff7855d70a9f9682e105d002a7dfcff7c0aaa0a9f7495e1021782a7ae7ff7c11a60a9ea859df00c002a7a9567844b000a9e5a59df0f0002a787967783bfd0a9e1e5ce2093002a7753677c5e380a9d425de10b6102a745367742d810a9d14dce20ed002a73666780221a0a9cb77fe0259682a6fa7ff7896570a9bea02de12c002a70d5678405a60a9be459e2020582a6dd9ff8803c00a9b72bfe1013982a6db7677804e30a9b6ddce0051002a6d66678016da0a9b42bfe102d002a6c79677c005a0a9aedffdf09e882a6b197778279f0a9ac660df097202a6a82577c4e960a9a51ffe10ea002a685dff6c3a7c4a9a17839f4e4982a6379677939230a98de5ce2036002a63436788119a0a98bf3fe208a002a6272ff84062a0a989695e0310e02a5f497778c4350a97d260de308582a5f51ff785f160a98377fde128582a6131ff7c08040a97ca59e005e682a5ecaff8030c00a9781ffe2196982a5c71677865a24a971c5d9e195002a5c72ff8452da0a96c97fde14b592a5b260e7825da0a96f67fe201b002a5b0aff8030000a9692bfde0bff12a5a4b0e88de000a959695de377f12a565a6678dd160a95977fde330f02a56a167887aa60a948559de1ea892a521576784aa60a94b559e10f9002a511c67783e3c4a94471d9e0b7002a515e678437da0a93df3fe109b882a4ee1777c21de0a93967fde0876c2a4e5a0b781e840a9399d9e005d002a4dfcff8405220a93225de2088e02a4b99778408040a92de59de020042a4b79737c3f660a929719de0fd8c2a4a5c737c78c00a921e59de1e2f42a48797388281a0a91a77fdc0a0592a469e0e701cda0a91b2bfe1194882a450977805ade0a90e77fde16b6c2a439e0b7848840a90f9d9e1037982a436667680de24a90d99d9f07a102a4267678445660a8ff119de115892a3fc4768007da0a8fe93fe202b982a3f79677c0d800a8fd0d9e205d002a3ee6676c173c4a8fb99da0042002a3ea46784665a0a8f42bfe0009782a3bffff804aa60a8eb559dd12a8c2a3ad5737c14c40a8ea095e0182582a38ffff7860930a8e4002de178e02a3909777c00660a8e1719df06a682a37f1ff8009c00a8df2bfdf131882a369977784c5f0a8da660e2127682a34d9ff7049d64a8d3683a003c002a349dff8068400a8cbf3fde1a0f42a32fd0b7c30000a8c8f3fdf055982a31e76780139e0a8c12bfde04e692a304b0e7c34800a8b8559df0b4002a2b9dff + +def tb_105 : Nat := + 0x80a76a0ae45695de29d9c2b915a637846e60ae4b719e101d582b913cff7c73e60ae3db59e0051002b8f1c677c59400ae36dd9de164f42b8db773844f800ae31e59de13df42b8c79737c0b9a0ae312bfe004b002b8bffff887e000ae281ffde1f7f12b8a080e7846260ae2b9d9df034982b89d367800b9a0ae2693fdf00b882b8999778829040ae22559de0a4012b889576780c000ae2425ddf0a6682b87caff7829970ae1f2c2df131882b869977800fde0ae1967fdf06f782b7ed9ff7c0ba60adf7719e00db002b7d0167802bda0adf147fdf0d5002b7b7cff8835a60adea999e2110582b7531ff7044124add4c839c0d8f02b7569677c695a0adcd47fde1a55c2b73520b784f800adcee59e2015002b733cff8045000adc8559df033f02b71e1778812000adc1719e1091682b6fcaff7024564adbf2c3a2019982b6fb1676806624adbec5da009c002b6f15677c0dda0adbb77fdf075002b6e67677c035a0adb967fdf345002b6b05ff78d13d0adac182de228a82b6c22578019260adaa859de0648c2b6aa1737c17c40ada9095df030002b6a1257780bfd0ada8498df2d3f02b673e6778b4f90ad9cf9cde17f582b6892ff783b160ada497fe20b4f02b6689776c2d384ad9a2619b073682b66caff7c1f9e0ad982bfdf071882b659977701c5f0ad96660e0134582b6325ff784d130ad8c982e2010982b6315678012000ad8b359e21f3682b60d9ff787cd64ad836839e173102b615a57785bda0ad8577fe1160982b5f79677c03000ad7db59e20fc002b5e5dff783efc4ad797839f00c002b5e51ff7c15ea0ad77e95e205c582b5d9dff7817124ad767839e042f02b5db7677c49260ad71e59df0cc782b5b3cff78331b0ad6cf42e2055982b5ae7678001440ad67719e1037682b59a4ff780dd64ad66943a200b882b5999778038040ad62e59de0e0012b58b9767c3b9a0ad5f2bfde0ee5c2b57cb0b845c400ad5967fe1200582b5359ff7080124ad4d683a1016982b5343677c0e7c0ad4c25ddf003782b5305ff842d000ad4947fdf0d5002b517cff7c5e800ad3edffe20ed002b4ecaff783b3c4ad3b2c39e0de002b4ed9ff7c5a2a0ad35895e1308582b4a59ff78c2124ad29683a10c3002b493e677830bc4ad24f9d9e0b7f02b4949777828da0ad2577fe21e0002b475e677877fc4ad1d79da1104102b465a577841004ad196999e102002b465c67840a380ad1865de103f782b45d9ff841ce60ad15999de073892b4566768435400ad12459de0d4f12b449176802ac00ad0f999e00ff002b42e767783fbd0ad0b9dce205df02b4289778849c80ad05895de127112b41626680153c0ad0425ddf050102b40b9677414010ad02e5ce10ac982b3fb1677c0dda0acfde7fe2076982b3f036784087c0acfb85ddf07a102b3e6767701e810acf99dcdf2d6002b3b9167845e380acd785ddf036002b32a667800e400acc967fe0098882b31c1778898c40acbd799de263012b2f5e767895040acbdb59e10a2002b2e5dff7c03000acb947fdf198002b2cb9ff8034e60acaf999e0001682b2b51ff7c33ea0acaa095e01ecf02b289567787b390aca255cde182582b28ffff78453c0aca5b59e0024002b2871678842c00ac9d999dd10af12b2766768802160ac8947fe01b8882b209977786e1f0ac82660e004e782b204aff78139b0ac812c2df041882b2009778814040ac7ee59d9050012b1fb9767c46da0ac7a77fe201c982b1e816780391e0ac73f3fde0e4692b1cfd0e802d000ac6e77fde0b3f42b1b9e0b8816260ac6b359df10bf02b19c1777842f84ac67061a021c782b17a4ff7c40260ac5a919df0d9682b15caff843f660ac53359dd0fd892b14cd767c1cda0ac5167fdf106982b135367841e5a0ac4b67fdf3b3882b0c897778ecdf0ac32260df0e1782b0ba7ff6c385b0ac2ea02df016982b0b9167889b7c0ac1a25dde26de12b06898678965a0ac1a77fde199682b075dff8800de0ac1417fe10a8f02b03b167782a390ac0ec5cdf034682b037cff740d164ac0df43a0067982b0315677819e30ac0c55ce006f002b02a667781bbd0ac0a99ce005b682b024aff6816d64ac092c39a04c682b0259ff843b400ac0577fe212f782aff59ff784bda4abfd6839e0e4782affa4ff8460000abf767fde17ff12afdda0e7842000abf947fe00cf002afd0aff7c54c00abeedffe1038882afb19778426040abea059e20ae002af9d367782b7c4abe74dd9e0a7102af9da577829400abe7719e0039f02af9997784571e0abe0f3fde15c692af83d0e84e7c00abd277fdd39ef12af49e0e7c24c00abd02bfdf056102af343677815810abcd0dce1039f02af309778002040abcc059df004682af2fcff7c28aa0abc9695e2250e02af009777894344abc02619e1c7582af092ff7868160abc2e7fe00ab782aef5dff8004380abbd25de200b102aef3e678405400abbca59e0121682aee07ff8432040abb1c59e00d3682aeb9dff7c22260abac559e100a682aeb0aff846b400aba577fde1acf12ae95e0e8008400aba4f3fdd020f42ae93d0b845e260ab9f119e201f682ae7a4ff8029400ab9bfffde0a4f42ae7000b + +def tb_106 : Nat := + 0x7c725a0b17277fdd1c95c2c5c9e0b8868400b16bf3fe008a002c5a72ff78227d0b169cc2de05b982c5aa167883c3c0b165a59dd0f0e12c5969767428bc0b166dd9dd072f02c59e7678833fc0b16265de2006782c5892ff7c4e2a0b15d695df01bf02c573e67881cda0b15b2bfdf0e9882c55e1777c99de0b14de7fde2676c2c537a0b801bc00b14c2bfdf007982c5303678871400b144f99de1c4f12c513e7684665a0b13e93fe100b882c4f99778015840b13d0d9df05d002c4ea4677c03c00b13a559df02d002c4d9dff7c51000b13167fde143f42c4c5a0b7849260b131e59de0c0002c4cddff8842000b12d47fdc107f12c4b520e7c0e220b12c65ddf032102c4ae7678445000b1274d9e11e1682c47f1ff7c09c00b11f2bfe004e002c45fcff7cbee60b10c059de2fb8c2c43017378ae660b10d0d9e201b002c42e667848b1a0b102e7fde22c592c40ba0e78821a0b10377fe004e782c404aff843c2a0b0fd695e0006f02c3f53678005400b0fcf99e2058e02c3d09776c16344b0f4261a0096782c3c72ff74259b0b0f1cc2df15d982c3b15677c0dda0b0eb77fe0037982c3aa66788521a0b0e577fdb148592c395e0e84693c0b0de65ddf03b102c375e67740ec10b0dd79ce1004682c3759ff800f660b0dc719df087002c3695677c1b000b0d4c7fde06bf42c35320b7c19800b0cd4d9e206c002c32e767781afc4b0cb9dd9e016682c333cff8061440b0c5895de185042c3162637848c00b0c7119e0008582c3159ff7802130b0c5682e10a0982c30b9677c9b9a0b0b92bfde26e5c2c2e4b0b8413800b0b7f3fdc04df12c2dfd0e7c30000b0a3dd9e0111002c27e66778443d0b09f99ce0093002c275367801b000b09b9d9df19f682c2547ff7867d70b095202de105f02c25e1778035400b091cbfdf0ee982c2303678840800b088059e212c002c20d567784afc4b08355d9f30a682c1dcaff78c2970b0772c2de1d4002c1f0167840b400b07677fde02cf12c1d9e0e7c3de60b072999e0264782c19a4ff78991b0b066942de245102c19c46778805e0b0681ffe0088982c191c677cd6bc0b05705dde35ae42c15c18378b09a0b05967fdf267782c1359ff88dce60b03f999de373892c0fe67678d4220b04025de0213002c0dd3677884bd0b0374dcdf099f02c0d397788b7de0b02967fde2df692c0a5a0e786f1e0b02df3fe1058982c0a01678418de0b02577fdf1cc982c079167841d400b01c719e0066002c049167840c000b011859de02ff42c0461737cbd000b005b59e0013682c0159ff8014220b00425dde050792c010986848a000affb85dde227f42bfee1838001440affb719e10df682bfdfcff7837d64aff7f43a0300002bfafcff78bffd0afebf42de1daa82bfc22578007560afe8f3fe2093002bf7e6677cacda0afd417fde2b35c2bf5060b78abfc0afd425dde1dd002bf5dc67786b9a0afd82bfde11b682bf69dff7c2aea0afd1695df0a8f02bf3b1678822da0afcc97fe2058982bf2cd677816224afcb35d9e048002bf2ddff8419800afc99d9df066002bf201677c965a0afbe9ffdd2595c2befa80b7c2a000afbbfffe10a2002bee5dff8809c00afb677fdf003002bebfcff8405a60afaf999e010c682bead9ff7843164afab683a217b982be95e67785ee24afa579d9e106982be9d3677ca8c00af9367fde2a2f42be4da0b8865a60af8d0d9dd196892be343767458260af8de59df042002be30167842c220af8025ddf051782bdfb7ff7c19800af7d47fe11b8882bdd9977786e1e4af76661a0093782bdd05ff7c3f000af6b77fe12bba82bd8225780417c0af5c719e2211682bd50aff7884564af542c39e1ea682bd531ff808d660af4b559df0ad102bd1dc677c1bc00af45b59e1013682bd159ff88b0220af3a65dde2c0792bce9986789e220af3b85dde1a8982bcfb16788139e0af392bfdf228002bcb9977846c840af279d9e1186002bc861678443da0af1d47fdf168002bc5e1778436de0af1417fde0db692bc5060e7814040af16459df093002bc472ff7024bd0af11cc2e0099002bc3d9ff803e220af0b85dde0f87c2bc2e183781ce60af0d999e1003782bc2ddff84c6660aeff119dd319892bbfc4768412c00aefde59e0111002bbca66774443d0aef299cdf02d002bbc7967780b3d0aef1e5ce206ff02bbc0977781bf84aef02619f009782bbbffff802b800aeed47fdf07c982bbad5678026040aee1c59de098042bb871738004da0aee177fe006c002bb7f1ff7c1d400aeddf3fe0016982bb766677c0f000aed277fe0093002bb40aff7caa7c0aec265de0144002bad59ff7c24c00aeac2bfdd092f42bab0b0b7c1c800aea32bfdf1cb002ba6ffff807d400ae942bfde1f4f42ba50b0b783b6a0ae98495e01e1982ba329677878630ae8ca5ce0054002ba2d5677814fd0ae8b55ce117c882b9ee1777c12000ae7a65de21fb782b9c9dff747eda4ae72783a10f6002b9ba7ff7c11a60ae6a859df08f102b9a1257846dda0ae5ffffde1b75c2b98000b7c4d400ae5b2bfe2139982b9591676c4e624ae5645da008b682b9505ff7c02400ae53f3fe1043982b94b967 + +def tb_107 : Nat := + 0x8824c00b4ac2bfe2149882d29c17778525e4b4a7061a2078002d294977801f9e0b4a32bfde07e692d28cb0e8445ea0b499095df028e02d261977805cc40b492999e0016982d23e6678082800b487719de209f42d21dc738475660b4799d9dd1d58c2d1e677380035a0b47967fe21bc002d1c9dff7c19c80b470895e0118e02d1b097784259e0b469cbfdd096692d1a730e7c5ee60b463dd9de17b8c2d18f77384177c0b46265de0099782d17ffff842d000b45a77fdd0b3f12d169e0e843c3c0b456459df090002d1501677c09000b452559e009d682d13f7ff7c2f220b44b85de110e782d0d0aff78439a4b4342c3a0346982d09c46778d1a30b42711cde223982d0ae7677854c00b42edffdf07c682d0947ff8803a20b424e5de20fc782d083cff783f1a4b420f439e030002d0909777c0fde0b41967fe0300002d0359ff74bffd0b40d682e0054002d0305ff842aea0b409695e1006f02d0253678476260b401e59e126e682cfe0aff789b964b3f82c3a1151982cfcb9677854624b3f2e5da013c982cfb15678824c00b3e92bfdf177002cf75e677c3f000b3d977fde0fbf42cf65e0b7c1a160b3d767fe105d002cf57cff78173c4b3d5f439e03c002cf59dff848b1a0b3ccf3fdd22c592cf33d0e80391e0b3c693fde0e46c2cf1a50b8840260b3c2919dc100892cf0a476843cc00b3bec59df1df102cedd2577c6c000b3b0895e111c582ceb05ff7c78000b3a497fde1dff42ce9260b7867e60b3a5999de093002cea72ff7807800b3ab9ffdf0e8e02ce59977783a350b396660e1008102ce5916780251a0b393f3fdf043982ce4b96784479a0b38a4bfde11e592ce2930e840ae60b3899d9e115d982cdf6d676c57624b37db5da1173102cddfa57785cc04b377e99a1418e02cd9e1777906344b3678619e378002cda8257785a3c0b372459e200e102cd9d3677403804b3674dd9d007202cd9da5780ac620b34e65ddf21c782cd17cff78871b0b345f42df016982cd166677c08220b334e5de20c6782ccc72ff7c05400b331719e11c9682cca92ff7872564b32a4c39f039002cca59ff8416260b328059df02f102cc9d25784fe160b31767fde3f8492cc5da0e78de000b319695df073982cc56667888f400b30ca59de23cf12cc32976788a5a0b30cf3fde10c682cc459ff7835400b312459e109ff02cc28977801d040b308559e1282002cbedc6778a07c4b2fb71d9e05e682cc0ffff7c1a9a0b2f7f3fe0195a82cba12577865670b2e8498de14b982cba5c677c06660b2df999e0170882cb5e1777c12c00b2d6459df049682cb547ff802ca60b2d2559df022682cb472ff7c05a60b2d1719e20e2682cb379ff7838964b2cde839e082682cb3d9ff841da60b2cc0d9df372002caf916778dc7d0b2be45cde35e682cafa4ff7c39a20b2b865de203f782cadd9ff8405400b2b713fe100d982cadb7677c0a260b2b2459e1018002cac7967801f1a0b2aff3fde07c592cabfd0e8405a60b2af999e0111002caad567884efc0b2a665dde13be12ca99986803d440b2a2919dd0f5042ca8a4738412000b2a1719df0f6002ca766678414400b29c559e1414002ca301677c2bda0b28947fe106a982ca1e7677c4b5a0b282e7fe217b982c9f3e67745ee24b27cf9d9d170882c9f49777440800b27edffe20a0982c9c5c678002400b2714d9e048f002c97c4677923bd0b25f11cde379682c98d9ff7c60840b259095de182042c9642638044400b24f999de110f42c93e673783e9a0b24ff3fe10bd002c932967842a000b24a059db0a7f12c928176803fea0b241695e10dd582c8f7cff841e660b23c0d9df09c002c8e67677826fd0b2399dce22d6002c8b916778b57c4b22e45d9e2bf682c8ba7ff7c0dda0b22d67fe10c4982c8a95677831224b22a55da0338582c86d9ff7c03c00b21b2bfdf02d002c869dff8093000b21147fde24bf42c84520b7890ea0b211695de198002c8505ff7855800b2151ffe106a982c83e7677c035a0b20f67fe0060002c8379ff7817fd0b20de82e023d002c813cff788f3d0b204f42df02e982c7f79678006c00b1fd799e2078002c7ee667781dfc4b1fb99d9e05e682c7effff7817400b1fc059df2e6682c7bffff78b9970b1f0002e022c982c79d367788b230b1e74dcde17e982c7a81677c4f800b1e2559de13df42c78957384275a0b1dfdffe0033002c77c4ff8470e60b1d8059e0004682c75fcff8428aa0b1d5695e0250e02c7309777894350b1cc260de1c0e02c7399778428aa0b1c9695e201d582c723cff7807524b1c8f439f0c0002c717cff8412c00b1c4c7fe209f002c7092ff7827bc4b1c24c3a2089882c7009777c32c40b1bcf99dd0cb042c6f3e73842f400b1ba059e00fe882c6d09777c4bde0b1af67fde12f6c2c6bda0b840f000b1ae77fe0093002c6b0aff880f660b1ab359df073682c6a59ff8044220b1a525de207e782c68caff781f9a4b1a32c3a0106982c67c4678448c00b19a859de122f42c66a1737c4e000b195a59de137f42c65697378371a0b19713fe209c002c64cd677026fc4b19335da03c3f02c6109777c81840b17c0d9df09c002c5e6767 + +def tb_108 : Nat := + 0x8007da0b79e93fe003f782de759ff7c10e60b79a919e10aa102de5fa57782a810b797e98df1a0582de459ff7868130b791682e005d002de3fcff8049e60b788559e21bb102de05a57786ec04b7816999e1b9002de05c67786dda0b78177fde10bf02de109778425560b77f13fdd095492ddfc50e7c12c00b77de7fde04af42ddf7a0b7c8c040b76e459e1037682ddb59ff640dd64b76d683a00e7002dda72ff800c2a0b769095de0309c2dda426388c0fc0b75cf99de303e12dd73e76844cda0b7582bfde133592dd60b0e782f040b75a095df068582dd3f1ff781a130b74fc82e0115982dd2dc677845624b74b71d9f19e002dd13e6778677d0b744f9cde192f02dd14977801a400b743559de068f42dd0d5737c12fc0b74225de112f002dcd6667744bbc4b73599d9d0f7682dcd9dff8426400b733359db098f12dcccd766c22800b733719e0190682dcb3cff8819e60b72b559df053102dca825784071a0b723fffe02a6002dc659ff7c03c00b7192bfdf14f582dc40aff7853d30b7102c2df105002dc305ff7c07e60b70b999df0ff002dc1e7677c2d5a0b704c7fe1054002dc0ddff8409000b702e7fdf1ef002dbecaff787bbd0b6fb2c2de168002dbf51ff803ba60b6f7719df082682dbd59ff8034260b6eb359de0d08c2dbacd737830000b6eb77fe0027002dbaa66780521a0b6e577fe001f982db93e678047040b6e0895df088e02db799778402040b6de459e2004682db759ff803fea0b6d9695de0ff9c2db65a638012000b6d8495df04d582db5c4ff8033660b6d3dd9de0cd8c2db4f7737c1f800b6d1e59de07df42db479738864800b6cb9d9de191f12db2e77680209a0b6c567fdd0825c2db15a0b8430c00b6bde7fde0c2f42daf7a0b8826220b6bb85de0258002dac89777895fd0b6b2260e0183782dab05ff8824c00b6a24bfde092f12da8930e7c0c660b6a1859e117a002da6e767849de60b6914d9de2778c2da453737870620b69425de005b682da3f7ff881ec00b68df3fe1003002da379ff7c15000b68c97fe10be982da267678419800b688059e012c002da0d567784afd0b68355ce008b982d9f1c677822e30b67c71ce201c682d9effff7007164b67c0039f06a982d9e95677c0ec40b679695e0006002d9dc4ff7c83400b66edffde20cf42d9bb80b7c4da60b66a059df099782d9947ff78265b0b665202df0d6982d987167801fda0b65fc7fe0114002d96ddff7844fc4b65b7839f1c0e02d9399777c1ce60b64b999e0300002d8fe66778bffd0b63f99ce0088682d8f5dff7c0a260b63ca59df0c4982d8e156784029a0b6382bfdf28e002d8b7cff7c15c00b62c97fe0124982d8a01677449224b62805d9f13a582d86e7ff7c23c40b618495de08f042d8612637821fc0b61865ddf10f682d8459ff7843d70b611682e123d002d80ffff80b8260b5ede59de2e08c2d7b7973881f800b5e1e59de07df12d7879768047c40b5dd695de11f042d775a638001c80b5da095e1049682d7547ff840fa20b5d425ddf096782d7472ff8405a60b5d1719e00a3682d715dff8428800b5b977fe004e782d6dcaff74139b0b5b72c2e005e982d6d666784221a0b5b377fde088592d6cde0e8419260b5b1e59de0648c2d6c79737c49800b5ad4d9e02f5682d685dff78bd570b5a1782e1216f02d63436780119a0b58bf3fe01cb002d6131ff7472bd0b584c82e1054002d60ddff7c19260b581e59e11ae682d5ecaff840b400b57a77fe11a1002d5cfcff78683c4b573f43a108a002d5c72ff8053400b56c97fde14cf42d5b260b7807e60b5714d9e101b002d5b0aff840b400b56b77fe0093002d5a4aff8843800b564f3fe2103982d56a1677840e24b55a85d9e102a82d56a2577840260b55a919e0043682d565dff8000ea0b559695e20dd582d557cff7837524b555f439f04b002d5531ff8834260b551859dc0d0892d5461767033ea0b551895dc0b8982d5479678035a60b54ca59e004f682d52d9ff7c3f660b547719de0fd8c2d51dc737831260b548559e106f002d516d6780dc1a0b537f3fde3705c2d4dfd0b78c89a0b5392bfde111002d505c677c57c00b53277fde15ef42d4c9e0b848ac00b529cbfde22af12d4a730e7882260b52a559de1fc982d4aa1677851000b52d67fde124982d4b79677c9cc00b51ffffe10a2002d475dff8807e60b51cf99dd01f892d473e767c15c00b51b9d9e0098102d4501677c39c00b50c2bfdd0e6f42d430b0b7c297c0b50705ddf09f002d3ea4677027bd0b4fa91cdf0aa102d3dfa5784603c0b4f1e59df02e682d3c4aff8810620b4f025de2009782d3bffff842b800b4ed47fde0adf12d3b520e800e220b4ec65ddf03f782d3ad9ff7c01260b4eb559e20f3f02d39e177783cf84b4e7861a0083102d395e677c093c0b4e4e5de0095102d38a46780365a0b4df2bfde0d95c2d37cb0b782c9a0b4dfc7fe2131882d369977704c5e4b4da661a0098102d36016780011a0b4d7f3fe1105002d3305ff7c02400b4cbf3fde008f42d32fd0b7ce8aa0b4bd695de3a29c2d2f5a6378ac800b4c12bfde243002d30b9ff8057c00b4ae77fde15ef42d2b9e0b + +def tb_109 : Nat := + 0x78611a0ba8693fde165002ea1c4677c09000ba85b59e010f682ea05dff7843d70ba81782df099002e9fc4ff74263d0ba7f142e00d8002e9dc1777435fd0ba77060e15c1782e97ffff79705a4ba600039e528002e989977786d9e0ba702bfe12b8002e9547ff8400de0ba5417fe00ed002e936667743b3d0ba4d99ce119e002e913e6778677c4ba44f9d9f1a4f02e8f99777469390ba3e660df1b6002e8d6667786d7d0ba3599ce1099002e8ccd678030fc0ba3025dde0c3e12e8c09868808c40ba2f999df093002e8b536788093c0ba24e5ddf087002e8895677021bd0ba2255ce209d682e87f7ff7427564ba1fe039d058682e883cff800b400ba1f2bfdf0ed002e86ddff7c9f840ba0d0d9de27e042e8343738400de0ba0c17fdf070982e829567781c230ba0a55ce0022682e8272ff7c43260ba05999de10c8c2e8166737c5b800b9fedffdf084002e7ed9ff7420fd0b9fb682e1050102e7cb9677014004b9f2e5da10ca682e7a4aff7c3b400b9e577fe0014882e794977881bde0b9e367fe2053102e7642576c14c04b9d90999b052f82e76426f6c10da0b9d947fe207d582e75c4ff8458e60b9d1859e107b002e73e667800b400b9cee59df067682e7351ff801e000b9cb67fe00c4982e72156780455a0b9c3fffe032d002e6c9dff78cb3d0b9b2782de163982e6e67678024c00b9b02bfdd092f42e6c0b0b8041400b9ac17fdf01e002e6ae7ff7c11a60b9aa859e0003002e6966677c34da0b9a24bfdc0d35c2e68930b7ca2000b9982bfde287f42e660b0b7855260b99cf99df029882e65e1778853040b992559de14c012e6495767c46da0b98de7fde11b5c2e637a0b78461a0b98df3fdf04c682e6259ff7c3fea0b985695df080582e60d9ff889f000b97977fde27bf12e5e5e0e788d660b97a919de16c982e5f6d678818ea0b977e95dc063992e5dfa667c50160b972e7fdf17d002e5b3cff7c48c00b967119dd122f42e59c473841f1a0b9651ffe0232982e571567788ca30b95c55cde17d002e57caff842aea0b949695e00dd582e517cff8827c00b94377fde09ef12e50de0e7812c00b944c7fe10f7982e4fe6677c0b400b93ee59e00d2002e4ee7678461440b935895e00f0f02e4c71678425da0b92f67fde097592e4bda0e8881ea0b927495dc207992e49d2668024fc0b924f99e21d1002e476d676c743c4b91db5d9f082682e45d9ff7420970b917682df0a0982e4491677c06000b911e59e0093002e43e667883fc00b90b9d9e210b002e41dc677842bc4b90771d9e105f02e41e177881f800b905799dd07df12e415e7684a0800b8fb719de281f12e3edc767c37da0b8f7f3fdf02aa82e3dd2577c19c80b8f0895e2210002e3a12577883fc4b8e84999e1e0002e3a42577846380b8ec25dde0c8582e3b59ff7c16bc0b8e6dd9e02d6782e330aff78b59b0b8cc2c2df0a3982e3267677828e30b8c99dcde078002e3292ff7819260b8ca999e100d682e3259ff8003c00b8c92bfdf063782e315dff7c7c260b8bdb59df10f682e2e5dff8026400b8b713fde098f12e2dc50e7821000b8b767fe1060002e2c59ff8418c00b8a693fdb062f12e29a50e8025440b8a2919e200f002e2895677c28da0b89fc7fde0a35c2e27f20b7d26000b88d67fde497f42e235a0b78d5000b89277fe01dd002e217cff8040e60b881e59de103892e2079768454000b87ca59de14ff42e1f297378305a0b87edffdf19c982e1d016788011a0b873f3fe0123002e1bd9ff7c0f000b86e77fe110b002e1a92ff7cc0660b85e459dd3018c2e179173842a5a0b85b9ffdf11d002e15caff78473d0b8572c2df0c0002e150aff8004e60b853dd9df0f7682e13ffff783dd70b850002e0019982e13e6678414220b84a25ddf2be782e0fcaff78af9b0b83f2c2df019982e0fb1677806630b83ec5ce009c002e0f15677c00de0b83b77fe0001982e0edc677c36c00b838059e144a002e09b76779127d0b826ddcde360002e0aa167789c000b82e459e204e002e0969678033fc0b82265dde0cfe42e089983802cc40b81f999e2088682e075dff7c05220b81d25de006f782e06d9ff781bda4b81b683a2050882e0689776c141e4b81a2619f007202e0682577c297c0b817719df137102e045a57784dc10b811698e1080582e03d9ff840a260b80ec59df013682e039dff8009000b80de7fe1013982e0366678030000b80a999de0bff42e02a67384393c0b80705de1063782e015dff886e400b7fe93fdc1b8f12dffa50e8412c00b7fd67fe2073982dfee66780431a0b7f767fde10c5c2dfdda0b8454660b7eee59dd151892dfbb9767443800b7eff3fdd10b002dfbffff8819da0b7ed47fdf17e982df9d367745fa30b7e74dce2039f02df999778438040b7e2e59de0e0012df8b9767c1f1a0b7e0f3fde07c5c2df83d0b8811400b7dfdffdf087f02df309777c031e0b7cbf3fe0015002df23cff8808e20b7c865ddf1d4002def51ff7874fd0b7bd482de1c8002def5dff8402c40b7bcf99df0b1002ded59ff8814220b7b425de116b782deb9dff8022260b7ac559e1021002de93cff74083c4b7a4f43a205df02de7c467 + +def tb_110 : Nat := + 0x8442840bd77495dc10a012f5dd26670427e0bd7749bdc0df682f5dfcff70209a0bd7967fdf134582f5c9dff8024c00bd702bfe2071882f5b99777c16e60bd6a859e105f102f5a4257806bd60bd624bfde1af4c2f58930b786a380bd6265de0391982f55016778e4630bd5405ce010f682f53f1ff7843d70bd4fc82e10cc002f5325ff8009c00bd4b719e019e002f513e6774677d0bd44f9ce2001682f513cff885e260bd3f119e005d002f4ea4677c03c00bd3a559e007bf02f4e197784139e0bd372bfe002d002f4d9dff8439000bd32e7fdf060002f4c59ff8034800bd2a059df3e7f02f46997778f9f90bd1a660de2b6682f47caff84e6040bd0c059e201b002f42e66780461a0bd05f3fde1185c2f417d0b7810da0bd0947fdf0c3002f40b9ff8008220bd0265ddf00a982f3f53678805400bcfcf99db014f12f3f3e767c479a0bcf82bfdf02e982f3ddc678402400bcf74d9df071102f3d625788183c0bcf4059dc060e12f3d01767017160bcf417fe008e682f3c72ff8473260bcea999de1cc892f3aa676805a000bce4f99e2066002f375e6778197c4bcdd79d9f421682f333cff7908570bcccf42de40b002f3353677c509a0bcc693fde1425c2f31a50b7848c00bcc7119e1013982f3191677ca3800bcbc0d9de28df42f2f03737885da0bcbde7fe2021f02f2ee1778001440bcbb719e1091682f2e4aff6c24564bcb92c3a1049982f2e016788eb800bca94d9dd3adf12f2a537674e9c40bca9695dd3a5002f2a5c67843b400bca5999dc0ecf12f2966768834da0bca24bfdf031982f286167883fc00bc9b9d9dd0fef12f26e77674333c0bc9c65ddd0a8002f273e6774251a0bc9d47fdf00d682f26d9ff840d800bc8b359e20cc002f2201677832fc4bc8805d9e066002f2267677c30c00bc84f99e2069002f20d56780029a0bc832bfe21c9982f1f01677872624bc7c05da20a7102f1e5a577429c04bc79699a008f582f1dcaff7823d30bc772c2e101f682f1c59ff8828800bc6edffdc0a1f12f1bb80e7028260bc6ee59dc05d002f1bfcff7c79260bc674d9e2088982f191c67801e000bc62919df033002f1871677ca2000bc4de59dc287f42f1379737c07da0bc4d67fdf042002f0ee76784125a0bc3a77fe1096002f0e07ff8409a20bc3785de0009002f0cfcff807e5a0bc2967fe10fc002f095dff743efc4bc257839d098882f09c177804eea0bc20895e01e0002f0642577877fd0bc19098de1c8002f065a577c1a160bc1767fe10e2982f04f7678819800bc12459da065f12f049176880c000bc11859dc02ff12f046176700bc40bc11895e1009782f00ffff84c0c00bbf7f3fde302f12efdfd0e7888e60bbfb719e0315002efae7ff78c53d0bbeba02df018002efa42577c90960bbdffffdd2424c2ef8000b807d400bbd82bfde1f4f42ef60b0b8001260bbd4059e2064682ef3f7ff7019164bbcfe03a2006002ef3f1ff801e000bbcc97fe00d4882ef0897780625e0bbbbfffde1896c2eef000b7c28800bbb977fe00c0002eed9dff80131a0bbb167fe100f002eec4aff8012c00bbaffffe107c682eeb3cff805a660bba74d9e2067682ee83cff6c19d64bba0f439b048002ee85c67841e000bb9f13fdc077f12ee7c50e7012c00bb9fc7fe2048002ee77cff80a8c00bb9367fdd2a2f42ee4da0b84a7400bb88f3fde29cf12ee23d0e7c08e20bb8865de0038102edd0167802ac00bb7147fdf078002edbd9ff882d000bb6c97fdf093002eda92ff8852620bb6525de02ed102ed65c6778bb410bb5971cdf0abf02ed566678049800bb4b67fe1004982ed2d567841e840bb45895de07a042ed162637c117c0bb44719df1a2682ecf79ff7868970bb3de82e1178982ece0167705e224bb3805da103ff02ecdc1778099de0bb2d67fe21e3002ec879677878bc4bb21e5d9e0f3002ec969677807da0bb28f3fdf127682ec751ff7849d70bb1d482e1008882ec74977802ade0bb1a77fe208e682ec472ff8026400bb0f67fde098f42ec3da0b80221a0bb0b77fdd088592ec2de0e8447220bb0705ddc11c792ec1c186801e000bb0525de2185102ebfc4677c1a9a0bafd67fdf058982ebf016780005a0bafbfffe013b002ebdc4ff8403660baf6dd9df0ac682ebd0aff8019260baf2999df02d002ebc79678049da0baed47fe006a982ebae7677c19800baea059de065f42eba81737804800baeb559e2079682eba07ff8026a60bae5b59df05b682eb85dff7c00660bae1719e206a682eb7f1ff781a964badfc83a20dc982eb715677437224badc55da1277682eb49dff709dd64bad2783a1093002eb40aff8866000bac9cbfe1036002eb23cff7c7c800bac12bfde1f1f42eb04b0b803de60babd4d9df015002eaf3e6778053d0babcf9ce00a0682eae9dff7c8b260bab1c59e214b682eab25ff7052d64baac9839c0f4682eab7cff8033000baa967fde0cbf12eaa5a0e84a5660ba9f119e009c782ea57cff8412c00ba94c7fde04af42ea5320b7c09c00ba942bfe0051002ea4a6678411400ba91859e1138002ea32967784dfd0ba8ca5cde10f682ea351ff8066000ba86459de197f42ea19173 + +def tb_111 : Nat := + 0x7072000c05d77fe00b40030169dff7c2cfd0c05a782df087003016caff781f260c05b559de0139830173e6784a9800c04fdffdf2a5f13013f80e7c43260c056459df10488301599777c2f220c05785ddf09600301607ff7c24c00c0582bfdf01ba8301682578064260c0499d9e019c683010caff7c67170c0432c2df10d1030115a578410620c04225de016d10300f1c67841e000c03a919e133210300ae76778cc804c02b9dda01cb0030091c677872bd0c02471cde1adf0300939777869000c0250d9de19f68300947ff7848c00c027119de114003009d3677837da0c0281ffe1012f0300909778099de0c00d67fe00c49830029567802b800c0079d9e016e00300079678012000bffedffe1066002fff51ff78197d0bffd482de064982fff536778176a0bffd695df298982ffcb96778a6230bff2e5cde17e982ffdd3677c19da0bff147fde0675c2ffc520b7c1aa60bfef9d9df06a682ffb7cff7c1e2a0bfe7495e1074582ff95dff8008400bfe4f3fe2067982ff8d5678090000bfda559de23ff12ff69576788d000bfda859df053102ff642577814c10bfd9098e0068582ff5d9ff840f000bfd677fdc03bf12ff59e0e8808400bfd5f3fdf103982ff47967802f400bfcca59de0bcf42ff329738427fc0bfca25de10a8002ff1e1777c14040bfc6459df0ed002ff0a4677c00660bfc1719df0ab002fefb1678440800bfb8059e107a582feba7ff884d400bfa9cbfdd134f12fea730e7444a60bfaa559dd106982feaa1678016620bfa865de2051002fe9666780101a0bfa497fdf093002fe892ff7824bd0bfa24c2df301982fe5916774c0630bf9645cdd2f9882fe5997774ada60bf97719df049682fe547ff8412c00bf93f3fdb04af12fe4fd0e6c11a60bf94059df067982fe495677c10800bf914d9e212d682fe325ff704b564bf8c9839c0d9682fe379ff840e9a0bf8a4bfdf039002fe259ff8044220bf8525ddf074102fe0d567805dc00bf7d799de176f42fdf5e737c06c00bf7d0d9e0169682fddd9ff7c03c00bf772bfe13bc882fd9e17778ef1e4bf678619f03c782fd9a4ff780f1b0bf66942e100b882fd999778401800bf5fc7fdf460982fd391677918230bf4e45cde458882fd399778406000bf4de59e001f682fd359ff882d840bf3d4d9de0b6012fcf537680005a0bf3d47fdf1efa82fcd6257787be70bf35898e10ef582fcc72ff8405400bf31719df0c0a82fc9d2577430270bf27498df25f682fc531ff7897d70bf14c82de22b002fc566678836000bf1167fde0d7f12fc45a0e7c9e220bf0785dde2787c2fc1e1837891260bf08559df01d102fc1c4677c07da0bf0693fe0046982fc15e677411a30bf0579ce005e682fc0ffff7c11a60bf02e59df04a102fc05a57807cbc0bef99d9e006a682fbdfcff7ca23c0bedee59dd288e42fb7b9738077400bed7719de1dcf12fb5dc767c60840bed1695de182042fb45a637860000bed1719df006f02fb453677c365a0becde7fe109d982fb2dc677c53040bec5695e0300002fae5a5778bffd0beb9698de1fbf02faf5e677c25560beb713fe010b002facb9ff8010260beb1e59de0408c2fac7973801f1a0beaff3fdf120002fa8a4677847fd0bea291cde057002fa96d67802c9a0be9fc7fdf08b982fa766678014400be9c559e2118682fa5fcff84a0e60be8de59e11b1682f9e07ff7c0d260be774d9e0008582f9d59ff8015000be7417fe112c002f9bd9ff744afc4be6f6839d11e982f9be767742ca60be714d9e00b4002f9b25ff8812c00be6a4bfe001f682f97a4ff7c64aa0be58495de1929c2f9612637843e60be5a559df072002f94f7678859400be4a059e0181682f90ffff7860570be44002de11f102f9162578438160be3de7fde0e04c2f8f7a0b80095a0be3b77fdf2b2002f8ba7ff78ac7d0be2ea02df05af02f89e7677c61800be21859e0007202f8682578012000be1665de2042002f8505ff7c2d000be1147fde0b3f42f84520b8007800be0f67fe2013982f8366677c30000be092bfdf0f0a82f815a577c6d560bdfe93fdd1b54c2f7fa50b7c0ae60bdfde59df01b002f7f5e678010800bdfc719df1c0982f7c91677870230bdf245cdf1f8002f7a07ff787dfd0bde8202e0026882f79e1777c12000bde665de2051782f7947ff800e5e0bde3fffdb039692f79000e8423a60bde1c59de08e8c2f787173781aa60bde2559df0a2a82f755a57842f160bdd277fdf243a82f725a578405400bdc8f3fdf023882f7219777c39de0bdc4c7fde0e76c2f71320b8448840bdbb9d9de122042f6ee7738019800bdba059e011f102f6d62577847c10bdb5898e2028e02f6d3977840c000bdb425ddf0b6102f6c5367881e5a0bdaf67fe20cf002f6b0aff7c0cc00bd9e459dd032f42f6791737c3c000bd9a859df08f102f6612577c13560bd9713fe0027002f659dff8408400bd95f3fdf085982f64f767800a800bd93359e1027002f64a6678411400bd91859e1058e02f6109777c2bc80bd81695e001d582f603cff8830c00bd7de7fdc0c2f12f5f7a0e7030000bd7df3fdc08b982f5fb167801da60bd7c0d9e0027002f5edc67 + +def tb_112 : Nat := + 0x7c39bc4c369cc3a12119830d861677c84630c36185ce01230030d73e67801cda0c35b2bfe00ec1030d0d567783b010c34355cde0831030d13e678019260c33d0d9e10526830ce51ff88df260c32b559dd37c8930cad57680755a0c323fffdf1d55c30c9000b7c635a0c3251ffdf1770030c95e677c40800c3274d9df0540030ca8167893d400c3102bfdf4f4f130c40b0e7ce96a0c315695de33e8830c5c17778a9800c31967fde2668830c69977784d400c31f2bfde10e0030c7f1ff7823a60c321c59e21a40030bb15677c68fc4c2ec55d9f0480030bc71678812000c2eb359de047f130bacd768416da0c2e92bfe1078a830b9d2578014a60c2da559e003b1030b65a578812000c2d8495da047f130b612666810380c2d865de22bef030b353677cafb84c2cd4dd9f258f030b3b967748afc0c2cf999dd198f030b47967881b000c2cb9d9df06bf130b2e7767c059a0c2ccf3fe210b0030b1dc677c42bc4c2c771da00df6830af7cff80d5000c2ac17fde353f130ab060e8467e60c2a5999de19f8930a966768041400c2a1859e157ff030a2e1777d5ff90c28b860df53b6830a325ff7d3ec00c28d999df4e76830a379ff7d391a0c28df3fdf4c36830a39dff7d1a5a0c28fdffdf4071030a45a5778fb9a0c291cbfde357f030a5097780139e0c28a4bfe000a6830a0caff8457660c27db59e002700309f1c67802f160c27677fdf0bc49309d9e0e7c18000c277e95e10e400309cb9ff80fa260c261c59df3e88c309871737cbb260c265b59df2c088309999777c94800c2681ffdf1d898309a816780d9260c24de59e01d778309131ff7875db0c244c82e105da8308f5a5780513c0c238559de144e4308e1573780c3c0c23ca59dc01bf0308f3e6780c0000c22c559de2fff4308b157378bbda0c22c97fde29868308b7cff78689a0c231cbfde11868308cfcff7810800c2374d9e0240003088d567886e400c21c719e00480030861257841d160c21677fdc0744930859e0e7013560c21713fe205e6830850aff8078660c20ca59de1e18c308329737873800c20cf3fe114e98307fb1678835400c1fb719e208268307e59ff6c20964c1f96839b07500307e6767813c260c1e5a59de4f08c3079697378ee260c1ea859de37200307ae7ff78d7400c1ebf3fde35088307b097778c0000c1ed67fde087a8307dd257841c800c1e3dd9e0111003077e6677c443c4c1df99d9f06468307892ff88df800c1c3559df37df13070d5767cc59a0c1c4f3fdf2f91030715a5778bd5a0c1c577fde25200307201678451000c1be459df143f4306f91737c4b5a0c1be9ffdb11100306fc46780365a0c1b377fe206498306c79677419224c1b1e5da019200306947ff78647d0c1a5202de057a8306a82578977a20c18865ddf5de79306219867d676a0c189695df4b498306343677927800c18d67fe03c000305b0aff7ceffd0c16c2c2df3a500305b25ff7cd3800c16df3fdf2e398305be7677c9e400c17147fdf27798305c53677c96660c171c59df25800305c72ff7c84660c172e59df1ce00305cfcff7c72660c174059df0c300305e07ff7c30000c1782bfdf04998305e81678042c00c14ffffe01f50030515e677c7d3d0c14579cdf1e60030516d677c1f800c14b559e24c068304c9dff7d30164c1327839f36168304dfcff7cc11a0c13967fdf2f700304e67677cb13c0c13a65ddf28200304edc677c9f3c0c13b85ddf1e168304f7cff746b400c13ec59e001488304c89778419c80c130895e001758304c0aff8402040c12e459e001800304b79678047400c129719de11cf1304a5c768870e60c121e59db1c389304879768049da0c11d47fdc1275c3047520b8493000c11417fde24bf13045060e8002400c113f3fdf008f43044fd0b84125a0c10e77fe221c78303fa4ff7c871a4c0fe9439f1fd10303fc4677c4e000c10225dde0f6783040caff7839de0c10367fdc0847830413cff8018660c0fd0d9de0618c303f4373780ae60c0fde59e005d00303ee667843b400c0f6dd9dc0ecf1303db7767037da0c0f713fe00c000303c4aff782ffd0c0f12c2e017598303ad5677c5d630c0eb55cdf17100303ad9ff7858e60c0eb9d9e01d5683038ffff7c75570c0e4002df1cbf0303909777c6e400c0e4719df1770030395e678009c00c0df2bfe0127683034d9ff80bca60c0c79d9de2f28c3031e7737877400c0cbf3fde1d898303301677875000c0cc17fdd1d088303309777433c00c0d02bfe00c168303125ff6830564c0c4983a000378302d05ff8002400c0b3f3fe215f00302b9dff7857bc4c0ae783a21dc883029c1777c771e4c0a70619f14400302a59ff744da60c0a99d9e2028e030261977888cc40c08f999df233013023e6767c5cc40c092999de15f783024b9ff80a31a0c08567fdf28c5c30215a0b7c95400c086459df24cf0302199777c573c0c08a25ddd111003022d567889f660c07b719e008268301e59ff88ac800c06e9ffdf2b1f1301ba80e7ca5660c06f119df24f00301c0aff7c8dea0c070895e200378301b05ff8007560c068f3fe01d400301751ff7c74fd0c05d482df1cba830175a57 + +def tb_113 : Nat := + 0x781bfc0c63025de00df68318a07ff803ae60c624719e007410318895678004da0c62177fe11c488318699777c711e4c61a6619f093003187caff800d800c608f3fe204068318125ff8436c00c5f4059e125b00317aa6677896bc4c5ea99d9e18468317b7cff7858da0c5ee77fde0af68317c51ff7024000c5f1c59e005b68317a4aff8840620c5e525ddf10179317949867c3b400c5e577fe105298317695678858da0c5d4c7fdd163593175320e800b400c5cee59e01a40031721567801c1a0c5c693fe035d00316afcff7cd73d0c5abf42df24f00316c0aff788dea0c5b0895de1d088316c8977786f000c5b277fdd087a8316dd2578805400c5ab9ffe1087f0316a19777821f84c5a86619e05f10316a4257803cde0c5a497fdf0f36c3169260b7c2c040c5a5a59de062103169b7678482620c59a25de010410316495677c41010c59255cdf0e0103164b967848eda0c58967fdf23b5931625a0e7c7bc00c58a999df1186831637cff7c39000c58ec59df0a3683163f1ff78275a0c58fdffe016098315f79678835400c57a919df0d4f1315ea4767c07da0c57d67fdd01b00315f5e67806e9a0c56ff3fe011598315ae7678419440c56a095e10dd583159a4ff7837524c566943a20240031589567807efc0c55a65ddf1fbe4315699837c60000c55c559dd12f0031576667840fde0c55967fe000f0031564aff8414220c54c25ddf0507c3153098380631e0c545f3fdf18c6c31517d0b7c2dde0c54947fdf0af2031525a577408c40c54b999e10ee68314ecaff783b964c53b2c39e0df68314ed9ff7834800c53b9d9de09000314f2967880bc40c527495e00d6683145caff7c35970c5172c2df05f10314642577c11c40c519695e021468314351ff881aa60c50b9d9db06a893142e7766c0e220c50c65de1105f03141e1778801440c507719e114e98313fb1677c53a30c4fec5ce2021f0313ee1778533c80c4e8495df4cf14313a12637ce1de0c4ed67fe0030003139b76788245a0c4e497fe202d003137b9678017c40c4dd695e2380583133d9ff7ce0124c4cf6839f362583133f7ff78c1bc0c4d14d9e00637831315dff8066660c4bf119e119800312cb9ff7065fc4c4b2e839c09a98312db7678034e60c4af999e009300312b53678434440c4aa095e0182583128ffff7860930c4a4002de114f031296d67783a380c4a665dde0dd583129a4ff702f7c0c4a7119e006a98312895677c1aa30c4a255ce102400312871678405400c4a1719e106a683127f1ff800b400c49f13fe20af9831271567782be24c49c55da12776831249dff709dd64c492783a00930031240aff846c2a0c489695e01c758312092ff8006660c481e59e20bc88311de177782f1e4c4778619e09600311e07ff8021de0c47567fe107500311be7677c1d3d0c46f9dcdf00a68311c51ff80125a0c46e77fe207800311b25ff80e9400c44ffffdf3a4f43114000b7cd2c00c45167fdf34398311461677cb5e60c453359df29a0031150aff749cc00c454c7fe0046983113b9677c11a24c44ee5d9f019983113e6678037da0c44b67fe1004983112d567885a000c445b59e11a868310fc4ff786a164c43f143a00af98310f15678187800c423dd9df61df43108f7737d57800c426dd9df52e003109e7677d20000c42a559df47400310aa1677d0b5a0c42b9ffe00b3103107e6677c2cc10c41f99cdf099783107ffff80221a0c41d77fe121600310547ff7c857c4c4152039f1cc98310591677c60660c417719df0dba8310682578054000c40fdffdf14ff43103f80b7c3b6a0c411695df0d500310472ff7c10800c41417fe005b6831030aff7816d70c40c2c2e0064983102a66784873c0c40225de00e17830ffa7ff8000c00c3fe93fe00be9830fee6678051c00c3f42bfe21530030fbb7ff7c54bc4c3eee039f1519830fbb9677c42c00c3effffdf1018830fc09777c14400c3f2e7fe009e8830fb19778060000c3e665ddf17ff430f999837c51840c3e74d9e207d1030f91c6780491a0c3dfdffdf1245c30f7f80b7c18c00c3e2e59e24b49830f343677d2d224c3cd0dd9f49e0030f359ff7d19a60c3ce459df31e0030f4d9ff88341a0c3c9cbfdf0d05930f2730e7c10800c3cc059dd03d6830f305ff84062a0c3c9695e00dd5830f17cff7c37524c3c5f439f040e030f219777807560c3c8f3fe10c30030f0b9ff8057ea0c3bd695df15f9c30ef5a637c2c220c3c025de001bf030ef3e6780479a0c3b82bfe033d9830eacd677ccf630c3ab35cdf1999830ec71677c43800c3b3f3fdf1018830ed09777c34620c3b4e5ddf0b10030ed59ff7c0de60c3b74d9e11906830e93cff7c64164c3a4f439f183f030e949777c5bda0c3a577fdf03a6830ea92ff845e260c39f119e001f6830e7a4ff8040260c39a919de1008c30e6a47384365a0c3972bfe028e0030e33cff7ca37d0c38cf42df1ce0030e3fcff8049e60c388559e01bb1030e05a578025560c37f13fe142b8830db99777d0ade4c36e6619f1f2a830ddd2577c5ac00c37967fdf0e89830dedc677c12c00c37de7fe003f7830db59ff780fdb0c36d682e20e70030da72ff + +def tb_114 : Nat := + 0x7cee7c4c9d02c39f26aa832755a578024000c9cc25de10cc7832723cff7c331a4c9c8f439f0b778327251ff7c2bc80c9c9695df09678327272ff7c031e0c9cbf3fe00c00032717cff8815c00c9c497fe00cb10326f3e677c32c10c9bcf9ce113668326e07ff7c4d964c9b82039f0bd00326e8167849a800c9ae77fdf269f1326b9e0e7c6d800c9b147fde1b498326c5367783fa20c9b425dde0ce88326d39778424c00c9ac2bfe0067983268d56788029a0c9a32bfe0106983267c46788311a0c99bfffdf0c4593267000e7c0abc0c99e65de10a20032665dff78287c4c9997839e06a98326695677817a60c99a859e045ff0326109778025560c97f13fe109c00325e67678425440c977495e02d558325afcff7cb5530c96bf42df238e0325b99777c71d60c9702bfe101500325ae7ff84236a0c969695e101800325a4257880dda0c94de7fda0375932537a0e680d1a0c94df3fe205400325325ff806e7c0c94525de100b1032513e67885e800c93f119dc179f1324fc4768021c00c9372bfdf086f4324dcb0b8019260c935999e008868324cddff8069c00c9192bfde1a6f132464b0e80d2660c90c059df3498c324301737cc1e60c90d0d9de2400032440aff888b1a0c902e7fde22c593240ba0e78821a0c90377fe00208832409977804ede0c8fd77fde13b69323f5e0e8000ea0c8fd695e0006f0323f53678005400c8fcf99e21cc98323aa6677473224c8ea99d9d1a598323acd6780b8800c8df119e202af032379977840b040c8ddb59db02c0132376d768403c00c8dd799e00d2003232e7677c347d0c8cb9dcdf07c6832333cff7c19da0c8cd47fe200d683232d9ff80665a0c8bf13fdf1995c322fc50b7c40800c8c1719df1006832305dff7c29400c8c2e59e247400322b05ff7d1cfc4c8ac1839f3d200322ba7ff78bc220c8b225de100900322afcff8451660c8a6dd9e0180003227e6677c5ffd0c89f99ce11db6832260aff7c76d64c8982c39f16410322682577c431a0c89b67fe1219003223f1ff7c863d0c88fc82e136888322089777cda1e4c8822619f31c983220d56778ad400c884f3fe11f410321e95677c7d004c87a55d9f18810321f0167785b440c87c719de11010321f7967848eda0c87167fdf23b5c321c5a0b7c81000c872459df1ef00321ca6677c6dda0c87377fdf0f768321d9dff7c37800c876dd9df0d068321dc4ff7c329a0c8772bfdf09b10321dfa577010da0c87947fe20a200321bb7ff7c287c4c86ee039f0a098321bb9677c17400c86ff3fe007b00321b3cff885e260c867119de178893219c4768007da0c86693fe124810321379676c92004c84de5d9b23010321391678803c00c83b2bfe14c200320791677d307d0c81e45cdf43110320822577cdf800c823559df291f03209c1778048c00c81713fe035d0032011c677cd73d0c80471cdf1a4003202d5677854000c80ca59e0282f031fe99777ca0b90c7fa660df2400031fedc678449800c7dd4d9de125f131f753768030660c7d7719e10ab0031f3b167782abd0c7cec5ce10136831f39dff8430000c7cb77fdf0bff131f2de0e7c26a60c7cc0d9e23016831eeffff78c0564c7bc003a01620031ed9dff803de60c7b2999e00c00031ebe6677c2ffc4c7af99d9f0a96831ebfcff78299a0c7affffde05b6831ec4aff8434800c7a81ffe10349831e9d367881b000c782e7fe00c16831dfb7ff84c0de0c76b77fdf3036931dade0e8412c00c76a4bfe22ed1031d65c6784545a0c7542bfde1515931d50b0e784a9a0c754c7fde0916831d5caff808d660c74b559e003d9831d11c6780b45a0c7392bfdf2d15931ce4b0e7c5ac00c73ec59e10898831cdc177841d400c7279d9e116e0031c87967705b7c4c721e5da111b6831c75dff7c46d64c71d783a200a9831c753676002a24c71d4dda01b76831c3d9ff786dd64c70f6839e11e6831c472ff800f000c70e77fe11d01031bf79678470800c6f6dd9e01110031bca6677c443d0c6f299ce205b6831bc4aff7c16d64c6f12c3a01639831bae7677c58e30c6eb9dcdf04b0031bbffff88153c0c6e425de10981031b87167801fda0c6dfc7fde07f5c31b7f20b807d400c6d7f3fe003c0031b49dff8041220c6ce65de23f00031af536778fbfc4c6bd4dd9e2f86831b04aff847e5a0c6b567fe22340031ab25ff8806c00c6ac2bfe00b10031aa59ff742c3c4c6a9683a01108831a9497778441f0c6a5260de0988831a9c17784cdc80c698495e01075831a50aff8419260c692999e004c6831a459ff8055440c687119e001f6831a1a4ff8422260c684719df0888931a11c768804bc0c68425de12af78319e59ff78abdb0c679682de22800319ee1778843da0c65d47fdd10f593197520e7441c40c65d695e224c00319505ff7c92fc4c6541839f24888319509777c82800c6551ffe010e003193f7ff8434da0c64a4bfe0138a831915a5788c0000c639695de2fff1318e5a66788f7c0c63c719dd1ecf0318f6d677470380c63e65ddd01d5831913cff84783c0c631e59df1e0e4318c79737c3cfc0c635999e109300318be6677824bc4c62f99d9e07968318bffff + +def tb_115 : Nat := + 0x7c31c80cd37495de09c78334dfcff78139e0cd392bfe10a20033475dff8018840cd1b9d9e230d683343d9ff7cc3564cd0f6839f300003343e7677cbd5a0cd0fc7fdf1ea683344fcff7c79800cd14059df1e168334505ff8400de0cd0b77fe0080583340d9ff8807da0ccfe93fe1180f0333c7967840b9a0ccf12bfe004b00333bffff7812bd0ccf0002e01e000333939777877fd0cce4e60de1bb1033395e67784e000cce785de10300033390977842b440cce1719df0ad0133385c767c2ade0cce177fdf065103338a4677c14040cce2e59e001f6833383cff807d400ccd7f3fdf1f4f43335fd0b7c7c260ccd8059e014d00333125ff7c533c4ccc4983a014400332a59ff7450fc4cca9683a1110883329497774441e4cca5261a000b1033293e67844cda0cc9977fde1335933265e0e809de60cc8f999df2778c3323e6737c98400cc8ff3fdf1b7983324a6677c38400cc95f3fdf0448833261977883fc00cc8b9d9e132268331fc4ff7cc8964cc7f1439f2aa6833203cff803a260cc7b719e023e68331c9dff7c8f970cc72782df08268331e59ff8048840cc679d9df122043319e7737c331e0cc68f3fdf0af20331a5a577c259e0cc69cbfe20ae00331751ff883c3c0cc56459dc0f0e13315917684305a0cc4fdffdd0c1593313f80e8464260cc499d9de1908c331267737845a20cc4b85ddd07e00331379ff8443440cc45695e008f583310caff802cc40cc35999e1117783307f1ff8126000cc0d67fdf497f433035a0b7c8c220cc1705ddf19800330659ff7c56220cc1a65ddf114003306ddff8015000cc0c17fe00aba833025a57881cbc0cc079d9df072e13301e7767c02160cc0947fe10de0032fed9ff804f260cbec559df13c8c32fb15737c35400cbedf3fe01a10032f93cff84179a0cbdbfffdd05e5932f7000e8060c00cbd5f3fdf182f432f57d0b7c58800cbd677fdf13b0032f5c4ff7c2f6a0cbd9095e10a80032f3b967804e000cbca059df137f432f281737c24000cbcca59df07c6832f33cff80371a0cbc693fe269f0032eb05ff7da7bc4cbac1839f582a832ec22577cf4aa0cbb7495df3a39832ee01677c7ce60cbbec59df1489832f05c677c51c00cbc177fe10090032eafcff8005400cbab9ffe12a3a832e682577ca8e70cb9a098df24c0032e6d9ff848b800cb899d9e211df032e149778452260cb72459df1488c32dc91738884000cb6a059e109ff032d9e1778410bc0cb6665ddf042e132d999867c0dda0cb6693fdf0180032d9c4678441040cb62559e00a5a832cd62578002160cb3567fe22b39832caa66778ace24cb2a99d9e28c9832cacd677891260cb2c559de1800032cbd9ff8513040cb19695df44c0132c65a667c35040cb27495de0a50032ca016778131a0cb2967fe210c9832c4cd677843224cb1335da203c0032c49167845a000cb0ca59e11da0032bfcaff7c767c4caff2c39f14aa832c05a577c40260cb02919df0eb9832c0b9677c29400cb03fffe10ee9832bedc6784cd1a0caee9ffdf3345c32bba80b8028800caec17fe00a99832ba5c678012840cae8495e22b45832b75dff7cad124cadd7839f25a5832b7b7ff7c963c0cadee59e01708832b5e1778014040cad6459e00496832b547ff8835400cad1cbfde0d4f132b4730e8420400cacfc7fe21159832b2dc677c45624cacb71d9f1108832b2e1777c3ba60cacc0d9dd0e70032b30aff80209a0cac967fdf0825932b25a0e8803c00cac92bfe225d5832abfcff7c97524caaff439f250e032ac09777880160cab167fde1e0f032ac79677828bc0cab6dd9de0955832adc4ff7820160cab767fde0600032adfa577810380cab865de00169832abe6678896000ca9c559df257f132a715767c44400caa1719de0fc0032a871677832400caa2919e01186832a5fcff8560e60ca81e59de5838932a0797684cffc0ca74e5ddf33fe4329d39837ca9800ca774d9de297f0329de177789c5a0ca781ffe103c78329cfcff7c0f1a4ca73f439f03810329d0167805d5a0ca6b77fdf17559329ade0e7c4b5a0ca6c97fdc0b568329b9dff88c6660ca5f119df319893297c4767caeea0ca60895df213003298caff7881000ca6367fde11c883299c1777812c00ca6a4bfe00621032964257881a160ca5767fdc068493295da0e8843260ca53359df10c893294cd767c38a60ca53dd9df0cf0032950aff7c1c260ca55a59e2027003294a667802a5a0ca4ff3fe01980032919167800dda0ca4567fe005a003290ffff88296a0ca41695e00dd58328f7cff8045660ca399d9de1158c328e67737828260ca3b719de09f00328eddff781e660ca3c0d9e101698328b9167883f000ca2a559de0fbf1328a95767821fc0ca2c25de014af03288f7677c52b90ca23ddcdf03000328a12578001c80ca1a095e12280032845a577889fc4ca116999e225f032845c677883d60ca11cbfe1072f03283e7677c1cb90ca0f9dcdf062583283f7ff84401a0c9f977fde10059327e5e0e8803000c9f947fe10bd00327bfcff84265e0c9e3fffdf099693279000e8428800c9e177fe2066003277f7ff800cc00c9df13fe13ba0032740aff + +def tb_116 : Nat := + 0x7c26400d0cf67fe006f0034330aff800d800d0ca999e001368343292ff840ae60d0c99d9e22a300342fc46778a8bc4d0bf11da206600342f5e6780401a0d0b977fe009900342dc4ff7c263c4d0b71439f08400342dd9ff7c18ea0d0b7e95e005d00342bfcff84867c0d0a4e5ddf219e4342939837c79800d0a5b59df1ae683429a4ff8016e60d0a2919e103300342871678805400d0a1719e002010342079678822da0d07a77fe214400341d59ff7050fc4d075683a012768341bd9ff840b400d04ee59e112ff034128977744bf90d04a260e024c7834103cff8027000d03c559e01fbf0340899777c7ef90d022660df19e003408f7677c4b000d025a59e00b3103407e667846dda0d00f67fde1b7593403da0e784dc40d011695e003768340379ff8819260d00c559de06489340315768404800d00c0d9e1141f03401c17780b6c40cffb999de2db0433fee6737899de0cffd67fde21c7833ffa4ff84b99a0cfeffffdf2e65933fc000e7c8b1a0cff2e7fdf1db6833fd0aff845d5a0cfe177fde1755933f85e0e8019800cfdfdffe05850033f272ff7d613c4cfc9cc39f35a0033f49dff883d800cfc5f3fde0f5f133f17d0e80145e0cfbedffe105a0033ef5dff8054c00cfb82bfde152f433ee0b0b800c000cfb425de023c1033eacd67788f010cfab35cde1f41033eb156788809a0cfa32bfdf2025933e8cb0e7c641a0cfa4f3fdf183f033e949777c5bda0cfa577fdf0fb1033e9d257842a2a0cfa0895e008a0033e65dff80c8400cf8cf3fde320f433e33d0b8414220cf8425de21447833dfc4ff7c511a4cf7f1439f0cc7833e03cff8404e60cf7ec59e02677833db59ff8839c00cf69cbfdc0e6f133da730e8876620cf6265ddf1d97933d899867c5ee60cf63dd9de1099833d9696784739e0cf5b2bfdf1ce6933d6cb0e7c56c40cf5cf99df13b7833d75dff84122a0cf5a095e01855833d4fcff7861530cf53f42e10a99833d453677c2a630cf514dce00796833d3d9ff8043260cf4b359de10c8c33d2cd738860fc0cf4525dde183e133d149868490000cf3a559de23ff133ce95768410da0cf3947fe237c9833cad56778df224cf2b55d9e3150033cb3cff7861260cf33359e243bf033c69977790ef84cf1a6619e30a6833c7caff807ede0cf1277fe00ff0033c1e7677c3fbd0cf079dce00b56833c131ff801e000cf02e7fdd077f433c0ba0b8409c00cf024bfdb026f133c0930e804fe60cefd4d9e10016833bf51ff847e000cef567fe02449833bb15677c91224ceec55da024a6833b8caff802a2a0cee0895e1090f033b79167880cc00cedd799df032f133b75e7684011a0cedd67fe00c49833b69567800b400ced1e59e12b50033b1c4677cad3c4cec711d9f29d0033b1dc677c67da0cecb67fdf1920033b2e767845a000cec1719df167f133b05c767c42c00cec2e59e10df6833af7cff8400c00cebde7fe10300033aa1257885e380cea265ddf178d133a899867c3b160cea497fe12100033a689778460000ce9425de10b61033a4536780365a0ce8de7fdf0d95c33a37a0b885e260ce88059df1788933a201767c44a60ce899d9dd0e70033a292ff80311a0ce84f3fe20679833a0d5676819e24ce8355da104bf033a0897784385e0ce7e9ffe10c498339e95677831224ce7a55d9e05a00339effff7416260ce7c059e209b10339dfa577826c04ce77e99a11b000339a07ff8470380ce4e65de12bb783390ddff7caeda4ce437839f0b3103392e6678409000ce42e7fe206498338fe667814a000ce28059df527f1338a01767d05000ce2c559e112c003388d5678011a60ce1a859e00471033865a578410380ce1865de210f68338459ff7843d64ce11683a018f00337fcaff885c400cdf967fdf170f1337e5a0e7c3ba60cdfb719df0c798337f03677814400cdfde7fe12b200337ba7ff88245a0cdeb9ffdc09159337ae80e701f1a0cdebf3fe004698337aa1678403000cdea559e21a400337753677c68fc4cddd4dd9f19d1033775a57883c3c0cdd6459de0f0e133759176783a380cdd665de1087f0337509777821f90cdd4260e114a00336e5dff7c527c4cdb97839f0a698336f01677c19260cdbd0d9e005b68336d0aff8019260cdb2999e202d00336c79678410e60cdaee59e109ff0336b197780d51e0cd9f13fdf3546c3367c50b7cc85e0cd9fdffdf2bb7833685dff8812000cd9df3fe00169833676667893cda0cd89cbfdf4f3593362730e7cf5400cd8e459e142600335c53677d097d0cd714dcdf40800335c71677d019a0cd71cbfdf37c68335cfcff7cdcda0cd7417fdf12ff0335f4977804b5a0cd6c97fe00db00335a4aff7c36bc4cd692c39f04800335addff8112260cd48559df4488c335215737ccd260cd4ca59df30a98335353677c97800cd4ffffdf1fc98335461677c54c00cd542bfdf12c00335531ff7c3de60cd55999df0e10033557cff7c06ea0cd59095e2039003351dc678003c00cd45799e00420033511c678030000cd41719e11c2f0334e99777070b84cd3a661a0699783347ffff7da65b0cd20002df32010334b79677cc2040cd2e459df28e78334c0aff + +def tb_117 : Nat := + 0x781a9a0d4dd67fe108700353695678085560d4cff3fe10a99835335367801e5a0d4cb67fe218000353159ff7c5ffc4d4c56839f17b9835315e677c5dea0d4c5895df14898353191677c4d400d4c693fe00fc0035305dff8800660d4c1719e104800352f7cff8424c00d4a24bfe213f9835275367744fe24d49d4dd9d1350035275dff801b000d49b9d9e227468352472ff80e7660d483559df39d8c3520d5737c78000d48a4bfdf0c1983523b1678475000d47c059e008400351c59ff88c4e60d462919df313893518a4767ca6e60d464719df213003519a4ff787ce60d467119e01c6683516ddff7471964d45b783a0247683510b9ff8078000d43b67fdd1dff1350eda0e807e5a0d42967fe2098883509c1777c261e4d427061a2034683506e7ff8848c00d41713fdf122f13505c50e7c43800d41767fdf0a5a835064257881c800d413dd9db071f13504f77680e2800d405b59df389f435016d737c25800d411859dd07e00350479678403c00d405799e00420035011c678437da0d3f7f3fdf0df5934fdfd0e84c0000d3ebf3fdc2fff134fafd0e70bdc00d3ec17fdc2f38834fb09778005400d3eb9ffe100c0034fa9567840ec40d3e9695e00b56834f69dff8067260d3d4059de19c8c34f5017384239a0d3d1cbfe107b0034f3f7ff8016800d3ce77fde059f434f39e0b7811a60d3cec59e00141034f2cd67805bda0d3c577fe01b60034efa7ff81df9a0d38497fdf77e5c34e1260b7daf400d3879d9df13e0034e766677849da0d39df3fe03f00034d949777cfbfd0d365260df0e77834dc51ff7c0f1e0d373f3fdf0381034dd0167888b440d35c719df22d0134d71c767c81840d35d0d9df1ef7834d759ff7c6e040d35e459e00c00034d65c67804a9a0d354c7fdf12a5c34d5320b7c3d800d355999de0916834d5caff8497260d34b559df25c8934d2d5767c36000d35167fe01680034d16d67807c1a0d33df3fe12df0034c75dff7cb7bc4d31d7839f0d39834c969678405220d31d25de11680034c5e1778012000d31665de02b80034c2e17778adfd0d30b860de2331034c36667787ede0d30e77fde1bf7834c3d9ff7869de0d30fc7fde1267834c472ff8848000d30705ddd11ff134c1c186881e000d30525ddb077f134c149868061440d2ff119e201f6834bfa4ff8028e60d2fc059de0a38c34bf01737812c00d2fd67fe01221034bae7678837da0d2e81ffdf0df5934ba080e7c19800d2ea059df0120034bad56780179a0d2e3fffe00a20034b85dff84f0000d2d277fdf3bff134b49e0e7c52260d2dc559df0f79834b766677c38400d2ddf3fdf06c0034b7f1ff7c08400d2e0f3fe008a0034b272ff800d800d2c8f3fe02e99834af53677cba630d2bd4dce10016834af51ff801fe60d2aa999e12e20034a7c467840ea60d293dd9e20510034a4a66780131a0d29167fde04c5c34a45a0b8017400d28ff3fe01279834a2d5678451000d286459e21546834a03cff7855164d280f439e1371034a05a57784cda0d28177fde087f034a10977781d400d284719e00e388349ee1778021de0d27967fde0876c349e5a0b8426220d27705de11b678349c0aff786d9a4d2702c39e19f20349c22578418c00d26e9ffe1408003493f7ff7d01fd0d24fe02df303003494fcff7cbe800d25417fdf2f688349509777cae000d2551ffdf135003496caff8024660d24d999e008a003492dc678406fc0d244f99e01a4f0348f99777c69384d23e661a202c10348f6d678814400d23c719e20c210348e5a5788209a0d2312bfe004b00348bffff7812bd0d230002e001998348be6678084c00d22693fe000b88348999778818000d224e5dde05ff134893986842f9a0d22177fe12bb00347fb7ff841ba20d1fd25dde06e79347f498684505e0d1f81ffe03c00034794977841bde0d1e367fe11440034779167881f560d1d713fe01639834746167802a000d1cee59e20df683472d9ff843e220d1c785de0144f0346f1567800e400d1bb719df038f1346edc7688ae840d1b0895df2ba01346c22667c8f9a0d1b277fdf09168346e4aff7c209a0d1b967fe001758346c0aff8448c00d1ab9ffe004698346aa1678413800d1a94d9e221768346751ff7885d64d19d483a00139834673e6780aa400d192559df2a8f4346495737ca1400d192e59df234f03465097778693c0d19665de01186834637cff7c46164d18df439f09d683463f7ff8800c00d18de7fe0048003462cd67805bda0d18577fe00c900345ea4678809000d172e7fda023f1345cba0e842f400d16ff3fdc0bcf1345bfd0e845eaa0d16a095e10bdf03459c46784329a0d1592bfde0ca5934564b0e8412660d158059e1267f03453997780719a0d145f3fe11041034465a577841004d119699a008f583445caff849e400d10d47fdf278f13443520e7c26400d114c7fe00c88834428977802b440d107719e1003f034415e678052380d0f225de2090f0343b91678076800d0e6dd9df1d9f43439b7737c5fc40d0e8495de087f0343b097780245a0d0e497fde0915c3439260b849ffc0d0d785de008e68343472ff803e400d0cde7fdf0f8f434337a0b + +def tb_118 : Nat := + 0x7c2d000d85a77fdf087003616caff842a000d85785de209978361547ff78265a4d855203a00b29836149567803dda0d84e77fe202400361379ff6008fc4d84de83a019968360d0aff7c66570d8342c2e2346983609c4677cd1a24d82711d9f337983609d3677cc0c00d8281ffdf22398360ae7677c14400d832e7fe008af036093977803f1e0d820f3fdd0fc6c36083d0b8878c00d81967fdf1e2f136065a0e7c68e20d81a65de0472983601e7678420400d805999e103468360131ff842e260d801e59e10796835ffffff8012000d7fedffe005a0035ff5dff84005a0d7fd47fe12e09835fc71677cb8230d7f1c5cdf17e9835fdd3677852800d7f81ffe11666835fb0aff7859964d7ec2c3a00679835f8d567805eda0d7dd67fe105a0035f6ffff800dda0d7d977fe01f80035f281677c7dfd0d7ca05cdf1eff035f289777c54000d7cca59df13c6835f33cff7c30000d7cee59df0930035f3e667800d1a0d7bdf3fe107a5835eba7ff8830000d7ab9ffe21309835e9b767744c224d7a6ddd9d1009835e9e76780245a0d7a497fe124c0035e6d9ff7c92fc4d79b6839f0930035e892ff8410bc0d79665de00b29835e495678410800d7914d9e212d6835e325ff8411220d78b85de0183f035e149777c60f90d785260df0736835e259ff8877040d77db59df1dc0135df6d767c1f9e0d7832bfe21696835ddd9ff705a564d777683a103c0035dd9dff740efc4d776783a20c00035dcddff8496ea0d76a095dc25b9935da82668807440d767119dc01d0135d9c47684731a0d75fdffe002d0035d7c4ff850ae20d74e65ddf42b7935d399867c80e20d75705de021c7835d17cff7c871b0d745f42df0201035d379678019da0d73d47fe20a50035ca016778293c4d72805da2507f035c289777d41f84d70a2619f3376835c459ff7cc0000d712459df2c40035c4cd677c97da0d714c7fdf22b0035c566677c6dda0d71767fe20741035c2156780455a0d703fffdf1155935c1000e7c2dc00d705799df0b31035c162578016e60d702919e004a1035c05a578423d60d6ff2bfe10ee9835bedc6784d8c00d6ede59df362f435bb79738816bc0d6e6dd9e12596835b75dff7c96564d6dd7839f1d10035b7e667885f220d6d785ddc17c7935b5e1867055800d6d81ffdc1530035b60aff8853040d6d2559de14c0135b4957678265e0d6d51ffe10226835b472ff80062a0d6d1695df0189c35b45a6384821a0d6c92bfde2085935b24b0e787e5a0d6c967fe00f0a835b15a578011a60d6bd799e21006835ae5dff7c40164d6b9783a0003a835ae5a5780723c0d6b2459e021e8835a99977843d440d6a2919de0f50135a8a476802c9a0d69fc7fe01f50035a5fcff88eac00d68947fde3aaf135a2520e78bee60d68c059e11d89835a079678007260d67a059e028458359addff7ca1124d66b7839f105f0359c5c677c19560d673f3fe00d1883599c17778345f0d667060e021c783597a4ff8843e60d65a559df10f89359695768020c40d658495e2144f03594cd677c51384d65335d9f11af03594f7678009c00d652999e1045003594616788191a0d64ff3fe102f10359162578809c00d63b719de026f1358edc7684cd1a0d62e9ffdf3345c358ba80b7cae840d630895de10a10358dd257840dda0d62d67fe110698358a53677c41a30d6294dce001110358a42578461800d621859e11036835875dff880b400d61a77fe2014883586897788505e0d6151ffde141693585480e783e040d616459e104200358505ff802aea0d611695e000858358451ff80a4220d60705de001bf035813e6784005a0d604f3fe119500357fa7ff8019da0d5ed47fe204800357999778012000d5e1c59de047f435787173841e5a0d5dfdffdf0795c3577f80b887da60d5d8059dd1f6893576017680e9c40d5c9695de3a70435725a637858da0d5d277fe100858357251ff881ba20d5bd25de000b10356f3e67802f400d5ba059de0bcf4356e81738447c40d5b5895e022e78356b0aff7c8b9a4d5ac2c39f15f78356bd9ff808d660d5a3559de2358c3568d5738051000d59e459df143f4356791737c4efc0d59e65dde111003567c467803c000d59a859e00450035665c67802f9a0d59677fde0be5c35659e0b844f260d591859df13c8c356461738475fc0d58a25de0058e0356109778017c40d569095e205af03559e7676c16b84d5679dda1577683553f1ff7d5dd70d54fc82df468003555016778e1fc0d55785de00cc00355325ff8006c00d54c2bfe11b9f0355149778861440d53f119de18501354fc47678031e0d544f3fe201f68354fa4ff6c07d64d53e943a208898354f1c677c22224d53c71d9f06198354f43678040bc0d53865de000168354b51ff800e220d52c65de009810354a816784f9fc0d51a65ddf3e7e1354699867cad9a0d51f2bfdf28f683547f1ff7ca25a0d51fdffe109c783545fcff8028aa0d515695e106c0035429567781afc4d50a55da20f798353f5367743de24d4fd4dda214d00353ddc6774533c4d4f771da10db00353d01678434800d4ef9d9e20a80035371c677829fc4d4dc71d9e0810035374367 + +def tb_119 : Nat := + 0x843a260db7b719e20081036db916780479a0db69cbfe01966836d6caff8830000db582bfdf0bff136d60b0e8886400db4fc7fdf218f136d3f20e7c84c00db4fdffdf1b79836d453678435a60db4c0d9db0d68936d303766c356a0db4c115e01c50036d13e6778713d0db44f9ce11966836cfa7ff8440e60db3a919e13676836cb3cff7cd9d64db2cf439f13e0036cd6667842eaa0db2a095e013a5836c947ff784e930db25202e217d0036c7caff7c5f3c4db1f2c39f0d69836c871678803c00db192bfe10f0a836c55a57802f160db1277fe11948836c309778000de0db0c17fe20049836c301678006c00db0b999e10ff0036c1e7677c3fbd0db079dce11096836c0ddff7042564db03783a104b0036c092ff7412bc4db024c3a01c80036becaff8430000daf82bfe202e9836bddc678028bc0daf4e5de019b7836bb9dff8422260daec559e20376836baddff880de60daea999de0378936baa6768416da0dae92bfe00ed0036b95dff8007e60dae4f99e11a4f036b799777c69384dade6619f11c1036b82257880b040daddb59dc02c0136b76d768433000dada859e20831036b612577820c04dad8499a00150036b33cff8007560dac0f3fe015b8836aee1778410bc0daa865ddc042e136aa1986842cc40daa5999e00ccf036a899778443da0da9d47fe00870036a6caff8030000da982bfe13780036a292ff78ddfc4da8a4c39e33d9836a2cd678055800da84f3fe21cf98369f6d677873e24da7db5da002a00369f43678010800da7c059de041f4369f01738450160da72e7fdf1404c369cba0b7c4b3c0da73359df05c58369d9dff844ce60da61c59e1198003690b9ff7c65fd0da42e82df174003690ddff8834e60da3f999dc0d389368fe676840b9a0da3edffe205da8368f5a577c17664da3d699a1030f0368f296784479a0da382bfde11e59368e0b0e800de60da374d9e016068368c72ff8453400da2c97fdf14cf1368b260e8804260da2c559e0240003688d56780db000da15a59df36bf4368569737cb0c40da18495df27b1036865a577c7b5a0da1b9ffdf1b90036871c67888b1a0da0cf3fdd22c5936833d0e8118260d9fb719df4608c367edc737ce2e60d9fec59df23d003680ffff7c6ae60da06459e005d00367dfcff840aaa0d9f7495e100c00367a9567881c800d9e3dd9e1093003677e6678824c00d9dd4d9e13a4583672ddff7ce9124d9cb783a2084f03670d5676421384d9c355da101698366f9167846dda0d9b767fdf1b759366dda0e8805400d9b713fdf014f1366dc50e8414400d9b5999e20c000366ca6677c2ffc4d9b299da102d00366c7967800e7c0d9ac65de113a58366947ff803a800d9a177fe24cc98366391677533224d98e45da20360036634367804a7c0d98865ddf129e1366219867c3a440d989695df0d068366272ff8839de0d984c7fdb0e7693661320e8015000d98377fe018c00365f51ff8095400d973f3fdf254f4365cfd0b7c0a260d97ca59e208a00365c72ff80305a0d96c97fdb0c159365b260e807a400d964f3fdf1e8f436593d0b7c54ea0d967495df0db00365a4aff7c24c00d96a4bfe20471036565a577411c04d959699a208f583655caff7023d24d9572c39c080583655d9ff7012000d958495e004e0036557cff881c800d9542bfdf071f136550b0e7c12c00d954c7fe11b79836535367786de30d94d4dce013e0036521567802a000d945b59e000f0036515e678010800d944719e103210364e676784035a0d93967fe117388364c8977843e040d92e459de0f801364b917688419a0d929cbfde10659364a730e7839000d92a559de0d800364aa167880d800d928f3fde035f1364a3d0e780c2a0d929095de01f98364a5367814ee60d914059df53b8c364501737d4ce20d91425ddf39f0036469dff7cbfa60d91cf99e111a003643e7678020400d90d999e0084f03642e1777c21390d90b860df063003643036780777c0d90225dde1dde43640898378635a0d90367fe034b00363c79677cd2bd0d8f1e5cdf2b968363d0aff7c83400d8f6dd9df12000363ea4677c20400d8fd0d9e106ff0363c0977781bf84d8f0261a0000f0363a81678070bc0d8da65ddf1c2e4363699837c37da0d8ddf3fdf091683637caff887ede0d8d277fdf1fb6936349e0e8866000d8cc17fdc197f13633060e809cc00d8c24bfdf272f43630930b7c9b220d8c265ddf1e000363125ff7c47a60d8c79d9df0c90036323cff805a660d8bca59df1698c362f2973809dda0d8ae77fdf27759362b9e0e7c70da0d8b147fe114400362a59ff7c50fc4d8a9683a200b1036293e678078000d89d799df1dff436275e737c1cda0d8a32bfe200468362759ff881c800d89b9ffe208a0036265dff8038400d895f3fe21bf003622e767746fbc4d88b9dda005df036228977842b440d887719da0ad013621dc7684209a0d88567fe20676836203cff881e000d87f13fe1237a8361c2257841e960d86e9ffde07a49361ba80e78177c0d86f119e20a200361b05ff74287c4d86c183a00c900361a3cff84a3440d85d695e100858361751ff8432220d85a25ddf0c87c36168983 + +def tb_120 : Nat := + 0x8422da0df1417fe00930037c472ff8430000df0b77fde0bff137c2de0e84c6660deff119e004b0037bf7967884ec00def713fe01260037bc916778497d0def245cde1110037bca66780119a0def12bfdf0465c37bc4b0b8810620def025de00097837bbffff805a000dee5b59dd167f437b96d738803c00dee5799d700ef137b95e768429400dee2e59e113c6837b77cff784f164deddf43a20679837b715677819e24dedc55da203c0037b49dff85295a0deba77fe03000037ab9dff80ac620de9865ddf2b17c37a61983886e160de9167fde1b84937a45a0e786c3c0de91859de16bf037a4a6678450220de8c65de01680037a16d677859fd0de85b5cde1440037a191678418fc0de8425de00ab7837a05dff844d400de5b2bfe21ce003794fcff7c737c4de53f439f1c500379505ff8410e60de52e59e006600379453678811a60de4ec59da046893793b1768035400de4b719e119f6837913cff7867d64de44f43a011310378e5a578428bc0de36dd9e00ea00378ccd6788209a0de312bfe006498378be6677819230de2f99ce1213003789d3677c84bd0de274dcdf1de68378a07ff8010800de24719e1012f037890977882ade0de2177fe2131883786997784f1260de0a559e00de00377ed9ff78377c4ddfb683a10d698377aa6678034260ddd1859e21246837733cff7c49164ddccf439f10f68377351ff7c2a000ddcee59e0198003771a4ff7c65fd0ddc6942df15b883771e1777c49e60ddc8559e00a5003770ffff8412000ddc1719e00ab00376fb167782abd0ddbec5ce20d368376eddff7834d64ddbb783a009300376e4aff7c24bc4ddb92c39f08400376e59ff7c1da60ddb99d9e01ad00376c9dff8802400ddabf3fe1028e0376a1977882a3c0dda5a59db0a8e137696976848ac00dd9cf99dd22af137673e767485da0dd9d47fdd0d668376892ff884cda0dd982bfde1335937660b0e841c620dd9665de21a7783763f1ff7c69da4dd8fc839f1a1783763f7ff7c4fc80dd91695e014b983762a6677c52e30dd8a99cdf124983762cd677837260dd8c559de0cc00376325ff80521a0dd8577fe01e498375f79678003000dd7db59e201968375d9dff801f1a0dd6ff3fdf07c5c375bfd0b8830000dd6cf3fe20a0e03759e1778807440dd67119e202af0375999777c0ab84dd66661a00600037593977805b9e0dd5f2bfdf16e6c3757cb0b7c29040dd62559e117100375659ff80d5000dd4c17fdf353f43753060b7cd4220dd4c25ddf31698375343677cc0000dd4d67fdf0ffa837555a578834260dd3b9d9e230d68374bd9ff7cc3564dd2f6839f28b00374c5c677c635a0dd3567fdf18510374d62578876260dd28059e002f103749d2578024fc0dd24f99e10471037465a577411c04dd19699a2080583745d9ff7c20124dd176839f040e0374619778403c00dd172bfe214b983743e6677c52e24dd0f99d9f135003743fcff7c36000dd1167fdf0b8983744796780251a0dd0d47fe0170883741e1777c5c1e4dd078619f0c88837428977884a040dd02e59df128013740b9767c1fc80dd05895e10ac98373fb167881e840dcf99d9e1030003739b7678831260dce1859da0c489373861766830ea0dce1895e007b003737e667800b400dcdee59e2258f0373501677896384dcd405da2064683733f7ff6c19164dccfe03a201e003733d9ff843e220dccb85de0036003732a6678804da0dcca4bfe103900373259ff8815c00dcbdb59e006c00372f01677c1afd0dcbc05cdf02a00372f436784005a0dcbbfffe124600372cb9ff7c917d0dcb2e82df0ae00372e51ff806b9a0dca693fdf1ae5c3729a50b7c34440dcaa095e006d683728ffff80d6da0dc902bfe11dd0037217cff78773c4dc85f439e1bc0037219dff785ca60dc879d9e11320037204aff7c4c7c4dc812c39f1039837207967783a800dc824bfe211b68371e9dff8427fc0dc7785de10a098371c5c6789871a0dc572bfdf61c593715cb0e7d50c00dc5a919df442683717a4ff7c671a0dc692bfe1004983712d567885a000dc45b59e01306837103cff88385e0dc2e9ffe001698370b9167802a5a0dc2b9ffde0a95c370ae80b843dda0dc1ffffe00a20037075dff8060660dc17719df1818c3705dc7380359a0dc1417fde0d65c3705060b802aea0dc11695e109198370366677c24624dc0d99da105b6837030aff806b400dc0577fdf1acf437015e0b7c30000dc092bfe01b60036ffa7ff786d7d0dbfea02e00c19836fee6677c30630dbfb99cdf04e0036ff59ff84b0220dbec65ddf2c07c36fb19837c88800dbeedffde1da0036fbffff8003840dbe74d9e008b6836f947ff7822d70dbe5202e25b69836f391677d6da24dbce45d9f5ae8836f399777d4f400dbd02bfdf4aa0036f49dff7d1b800dbd367fdf10b0036f83cff84031e0dbcbf3fde00c6936f2fd0e8828aa0dbc9695dd0a29936f25a668802160dbc947fe11980036f0b9ff842c220dbc025ddb0b07936f00986882ade0dbbd77fe238b6836eb9dff78e2d64dbae783a00889836eb1567800f660dbab359e00450036e65c6780afc80db81695e201d5836e03cff + +def tb_121 : Nat := + 0x7ca1040e29c559df2331038a766677c4f440e2a1719e02e698389dd36778b9a30e2774dcde17b98389f3e6784267c0e274e5de21b9003898d9ff8491260e25a559e20bb683895d9ff7c2ed64e257683a00709838956967881c800e253dd9db071f13894f7768814400e252999dd050f13894a676802a5a0e24ff3fe10d39838932967809f660e23b719df27d8c388edc737c95a60e23c0d9df1dd00388f7cff7c3fea0e241695e010a10388dd2577c42810e237498e003768388b59ff843dc80e228495e00e9883885e1777c3a5f0e217860e109978388547ff884b000e20f67fde12bf13883da0e8417400e20df3fe000300388379ff808ee60e204f99e205d00387f1c6778173c4e1fc71da0237a8387a82577c8de70e1ea098df10098387bb9678841040e1e2559dd1040138789576743d440e1e2919e109d683877f7ff887da60e1d8059de1f689387601768029c40e1d5695df0a70438755a638070380e1ce65ddf1c0d1387399868024000e1cc25de100858387251ff844b000e1c497fdf12bf13871260e7c48000e1c4c7fdf0d50038717cff8424c00e1c24bfe215498386f3e677855224e1bcf9da10bd00386e8167801e000e1af67fe110c98386acd677843224e1ab35da21f8003868d5677c7dfc4e1a355d9f1906838693cff7c60fc0e1a525de11d5683866ffff7c75564e19c003a0099003865c4ff883de60e193359df0f7893864cd767c16e60e195a59e03c3f03861097789885e0e16b9ffdf62169385ae80e7d831e0e16bf3fdf46b78385c9dff7ccdc80e177495df2a210385e67677c81840e17c0d9e1018a8385a5a57883c3c0e165a59e00cff03858997784019e0e1624bfe00a66838530aff7c29970e14c2c2e01c188385149777c705e4e145261a100b1038513e6788693c0e13e65ddf1a4e1384f99867c665a0e13e93fe00f510384ea4677c3d410e13a91cdf09810384f016780149a0e13947fdf0525c384e520b882d000e13677fde0b3f1384d9e0e800de60e135999e008868384cddff8064800e12b9d9df191f1384ae7767c57fc0e12c65ddf12768384b51ff8485bc0e10d0d9e01c66838417cff7c71970e105f42df05d003842e6678488aa0e0fd695e21f800383d6257787dfc4e0f58999e14f58383e0aff8407e60e0e4f99e11e468383759ff7c79170e0dd682df1e00038375e677874400e0ddb59de1a4f038379977804b000e0d5a59df12bf4383569737c3dda0e0d677fdf0831038361257840dda0e0d4c7fe01e000383351ff7c77fd0e0cd482df1de98383353677c5e260e0cee59e1115983831c4678018840e0c5895e0003f038315e6780665a0e0bf13fdf1995c382fc50b7c29400e0c2e59e017a00382e4aff745e7c4e0b92c3a12a300382ba7ff78a8bd0e0aea02e006468382892ff84265e0e0951ffe21c500381f79677c713c4e07de5da107800381f0167884d9a0e0772bfe201968381d9dff883de60e072999dd0f789381ca6768405400e072459e015468381b3cff7855170e06cf42de087f0381c0977804d400e0681ffe0043983819c46780491a0e05fdffe019e00381659ff80c0000e04d67fdf2fff138135a0e7cb8260e04de59e005898381301678832a60e0374d9e203c78380cfcff740f1a4e033f439d03810380d016784a8c00e02967fdf2a2f1380a5a0e7c60000e02df3fe105898380a01678028da0e02577fe12419838071c677c90624e01c71d9f1cc9838079167880d1a0e01b9ffe010e003805d9ff8005400e01713fe113398380491677c4ce30e01245ce0018003804796788c3000e005b59df30bf138016d767c69000e00b559e00510038011c6778143d0e00471ce01516837ffcaff7854570dfff2c2e01318837fe99777c4c5f0dffa660df0ee9837fedc678019c80dff0895e11255837fafcff6c49524dfebf439b11c5837fb05ff84d0e60dfdee59df3438937f7b9767cc5a60dfdf999df2839837f879677c45660dfe79d9e00b40037f69dff8024c00dfd82bfe10aba837f45a57804d160dfcc97fdf1344c37f3260b802a000dfbbfffe013b0037edc4ff7c4ebd0dfb7142e105b6837ec4aff7016d64dfb12c3a104b0037ebffff8430c00dfacf3fde0c2f137eb3d0e8018c00dfab67fe20d20037ea07ff6c347c4dfa82039b0589837ea8167880d260dfa74d9d80348937e9d376600b6a0dfa7695e01216837e83cff7448570dfa0f42e00450037e7f7ff84a31a0df9367fdb28c5937e4da0e8065a60df8d0d9e10420037e3016788311a0df88f3fdb0c45937e23d0e6c2bda0df8947fe010b0037e131ff8003000df8497fe106c0037e0b9ff80b6220df7785ddf2d87c37dde1837c5a000df7d47fdf1020037dfb7ff7c2c220df8025de02077837dbd9ff7c81da4df6f6839f0db7837dd05ff8183c00df572bfdf60ef437d5cb0b7d2f660df5c719df3b7a837d8225778a4220df6525de23ee9837d1dc6778fba24df4771d9e3b59837d21567841bc00df45b59e116b0037cfb1678845fc0df3a65ddc117e137ce99868826040df38059e203ff037cdc1776c0ff84df37061a01b88837c599777c6e1f0df16660df1708837c5e177 + +def tb_122 : Nat := + 0x7de53c4e5eea039f77898397bc4677dcc800e5f02bfdf56aa8397dd2577d38c00e5f967fdf43998397f03677cf0c00e5fde7fdf37200397fcaff7c8f400e603fffe110698397aa16780839a0e5e24bfe10d9983977b9677c36624e5dee5da2066003977536778197c4e5dd4dda00d1103976825780297c0e5d7719e104b00397591678821fc0e5d425ddf087e13975098684005a0e5bbfffe00a200396e5dff8003000e5b947fe20eb98396d66677c3ae24e5b599d9f08d00396dc4ff7c21c00e5b72bfdf07800396dd9ff8016da0e5b42bfe006498396ca6677c19230e5b299ce015300396b53677c54bd0e5ad4dce120b68396947ff8460c00e59f13fde182f13967c50e7855800e59fc7fde150003967f7ff8015000e58377fe021300395ecaff8071400e57417fdf1c4f4395d060b8825260e571c59df09489395c71767c24c00e571cbfe114868395b0aff8030000e5692bfe010e0039593cff8466000e55e93fe00bda839564257782f670e559098de0a5a839565a577828800e55977fe111058395531ff7c44130e554c82e225c983952d5677897224e54b55da00c00039521567880e400e547719e106f0039516d678014400e544719e00c00039505c6784845a0e5392bfe1078a8394dd257884d160e53277fe009300394c0aff8424660e52de59e057198394501677d5c630e51405cdf4d988394599777ce2e60e51b9d9df3349839473e6784011a0e513f3fe110d1039415a577c43410e505698e013d103938a4677c4f410e4e291cdf0a800393939778819da0e4e0f3fdd0675939383d0e810c800e4d02bfdf431f439340b0b7ce7c00e4d277fdf072003937caff84011a0e4cbf3fe208a00393272ff886e400e4c2e7fe22a498392e15677ca9224e4b855d9f1d298392ee7677c57ea0e4bd695e2058e0392d09776c16344e4b42619b028e0392d3977842ca60e4b14d9df0b28c392c537380521a0e4ac2bfde14859392b0b0e8844220e4a525ddf11079392949868003c00e49d799e000468392759ff8045ea0e499095e235af03922e7677cd6b84e48b9dd9f25bf03923e6678478c00e47967fde1e2f1391e5a0e846bd60e469cbfde1af49391a730e840ba60e463dd9e214778391751ff7851da4e45d483a119c98391501677c67230e45405cdf10c9839159167841b000e452559e01b3f03912e1777c6cf84e44b8619f0f76839139dff80afda0e43e9ffdf2bf5c390fa80b7c671a0e4432bfe008b98390f1c678040bc0e43865de10b310390d66678416da0e4342bfe003d98390ccd6784455a0e42edffe20d098390ae7678448c00e427119dd122f13909c4767445000e4274d9e107c68390947ff8803a20e424e5de201d1039091c67884c620e41a65ddd1317939069986840fde0e41967fe13ffa839025a5780e0160e3fb67fdf3804938feda0e7ca8960e3fedffdf1e0f0390079678033c00e3f82bfe20030038fe07ff8453a60e3f2e59e11a40038fb15677c68fc4e3ec55da100a6838fb0aff840b400e3eb77fe12089838f8d5677c82224e3e355d9f1a10038f93cff845dc00e3dd799e005e6838f6ffff7c17970e3dc002e10a20038f65dff70287c4e3d9783a101ba838f64257841a160e3d767fe12880038f33cff78a1fc4e3ccf43a00139838f32967882a000e3ca059de0a7f138f28176812bc40e3b7495df4af0438edd2637cb4000e3bec59de2250038f05c6788b5560e3abf3fdf2d54938eafd0e7cb3160e3ac17fe00150038eae7ff841d400e3a9cbfdb074f138ea730e6c14a60e3aa559e04969838e5dc677d25a30e39771cdf3f0a838e682577c53400e3a497fe003a6838e292ff8457660e37db59e200f0038df5e6780701a0e37677fe020f1038da8257802f7c0e367119de0bde438d9c473782bbc0e3674d9de0a5f038d9dc677828380e36785de01ff6838d7c4ff805e800e3592bfe00886838cecaff8430c00e3381ffe00a5a838cd6257840a380e334e5de20dd1038cc5c677c37404e33171d9f0c81038cc71678004da0e32a4bfe122d5838c7a4ff8052aa0e319695e10f3f038c56667783cf84e31599d9e08f5838c5caff880d1a0e314c7fe231c9838c215677cc7224e30855d9f2a88838c289777c82260e30ca59df0a09838c491678014400e307119e202f1038c162578000fc0e305799e02239838bedc67882a660e2e9719da0a98938ba5c766824c00e2e9cbfe22fe6838b75dff7cbf964e2dd7839f2a46838b7b7ff7ca8c00e2dee59df2760038b7e6677c971a0e2dffffe22eb0038b472ff7cbabc4e2d1cc39f2160038b547ff7c73260e2d6459df1819838b5dc678405a60e2d1719e10780038b379ff8048000e2c967fde11ff138b25a0e7834e60e2ca999e02b50038afa4ff880cc00e2bd799e1144f038ae19777c51390e2b8660e015f7838acb9ff7c57db0e2b2e82df0621038adb7677c151e0e2b713fe00409838ac79677c10230e2b1e5ce006ff038ac0977888e260e2a7119e202af038a999778a37de0e282e7fdf8df6938a0ba0e7e2ede0e28377fdf81c7838a17cff7dec840e2879d9df7477838a251ff7da6040e28c059df39c7838a5fcff + +def tb_123 : Nat := + 0x78445b0e98fe02de074103a649567884aa60e98b359df12a893a62cd767c1f800e98de7fe0027003a62a6678053040e985695df14c043a615a638420160e98367fe1132003a5fa7ff800ea60e97db59e0055983a5ae767848b800e962e59df22df13a58b9767c67da0e9651ffdf123003a59c467803b9a0e95f2bfe0131883a569977784c5f0e95a660e22a7683a5359ff8005a60e94d0d9e000f003a475e67802e800e91a919e1048003a465c67844a9a0e914c7fdf12a5c3a45320b7c209a0e91767fe01eff03a4289777c7bf90e90a260df192003a42e767808ade0e90177fdf22b6c3a405e0b7c4ac40e905799e2181983a3edc678037da0e8f7f3fe00f8103a3b91677c3e010e8ee45ce0147a83a3a125781a6160e8cde7fdf6984c3a337a0b7d0c380e8d785ddf1b0f03a3861677c3b160e8e497fdf0a8f03a3969678034e60e8ca999df0d38c3a32a6737c27660e8cb719e0013683a3292ff8412000e8c92bfdf047f13a324b0e7c0e400e8c967fe1089883a31c1778418de0e8c577fe01f0983a2f6d678043da0e8b977fe0063a83a2dfa578008160e8b767fe0015003a2dc4ff809c660e8ad4d9de2718c3a2b53737872000e8aff3fde16b003a2c59ff846b9a0e8a693fdf1ae593a29a50e7c52da0e8a81ffe106b883a2939778432040e8a1c59df0c8043a2871737c29040e8a2559de095103a28a46780a5ea0e895695e0144003a2359ff803a800e8824bfe0048003a204aff8824c00e87edffdd092f13a1fb80e88e2da0e86e77fdf38b593a1b9e0e7c8b1a0e873f3fdf228003a1d01677873da0e87567fe03ee983a16a4677cfba30e85a91cdf3ab003a16e7ff7cc0660e85e459e21d7003a14cd677c75bc4e85335d9f1ad003a14f7677c665a0e8542bfe2114003a13b9677c44fc4e84ee5da10df683a12d9ff8414220e84a25de224c783a103cff70931a4e840f43a0072003a0fcaff88965a0e82e9ffe0016983a0b916784665a0e81d77fde199593a075e0e8405220e81d25de1094683a0547ff7825164e815203a10f3f03a0366677c3cf84e80d99d9f0bc583a039dff8817400e80a999da05cf13a02a67684393c0e80705de036f7839fe51ff7cdbdb0e7f9482df2db1039fee6677c99de0e7fd67fdf21c7839ffa4ff88dc620e7e665ddf3717939f999867ccde60e7e74d9df2899839fa81677c6e400e7ed47fdf1519839fbb967801f440e7e4719e10cf0039f40aff7433bc4e7d02c3a010b0039f131ff7c42bd0e7c4c82e017a0039efb7ff785e7d0e7bee02e205a0039ef5dff8403000e7bd47fe13b40039eb9dff7cecfc4e7ae7839f2488839ed09777c86220e7b4e5ddf1f80039ed59ff7c52800e7b81ffdf1470039ee0aff7c04e60e7bcf99e210b0039ea92ff8055800e7a4f3fe111aa839e82257881f560e79e93fde07d4939e7a50e8402e20e79e65de003f7839e759ff842d660e79a919de0b58939e6a47688119a0e79977fe00930039e5caff7c24bd0e7972c2e00bb6839e159ff843fea0e781695dd0ff9939e05a66743f660e781719dd0fc0039e05dff8025560e77f13fe00139839dfb167840dda0e77de7fe11b88839ddc177808c040e76e459e21350039da5c678806840e769095e01b90039d73e67801cda0e75b2bfe0048a839d68257808a000e751695de227f439d45a637861560e753f3fe0006f039d4536780185a0e74fc7fe20180039d3d9ff6005fc4e74f683a20831039d13e6788005a0e744f3fe10b38839d089778079440e73a919e213e0039cd66677c4f7c4e73599da10990039cccd6780597c0e724719e12d16839c64aff7cb4564e7192c39f2c26839c659ff7ca0bc0e71a65de21ad0039c49dff7c6b3c4e712783a10930039c40aff8488e60e7079d9df2238c39c1e7737c49260e70b999e01410039bf51ff8421c00e6fb2bfe02241039bb15677c89004e6ec55da20376839baddff88ccfc0e6de65ddf333e139b799867caac40e6e0895df2026839b8caff7c63c00e6e4f99e103f7839b759ff8412000e6d8495e004d5839b5c4ff8809c00e6d677fe00f79839b4a667783de30e6d299ce01530039b353677c54bd0e6cd4dce018d6839b159ff7863570e6c5682de10b0039b1dc678078000e6bde7fdf1dff439af7a0b7c77400e6bdf3fe009d9839aedc67805e380e6a265de00067839a892ff840c660e6a1859e005df039a689777817790e69a260e01800039a509778400c00e68de7fe10540039a325ff887a400e684f3fde1e8f139a13d0e7879e60e684f99e203d98399f1c67700f624e67c71da215168399dcaff7c54564e6772c39f0c210399e5a57803f660e673359e00741039996d678042c00e65d999de10af43997667388221a0e65b77fe1183a839955a57881ce60e64b999e20f0a8398f5a57783c264e63d699a104f68398ed9ff8431260e638559e128e00398b7cff8815c00e62c97fe1303a83988225784603c0e61a859df180e43986a1737c4e960e61b9ffe20471039865a578010380e61865de007b7839859dff7c1edb0e616782e20930039850aff8473800e60cf3fdf1cdf139833d0e7c6e400e60d47fe279500397ba7ff + +def tb_124 : Nat := + 0x8918800ed1fdffdf461f13b47f80e7d07400ed20f3fdf3e8983b4871677ca1a60ed274d9df1d8983b4a81677850220ed2c65de115e883b46997774579e4ed1a661a1398103b4301678402160ed0947fe00d5003b417cff8830c00ed02e7fdb0c2f13b40ba0e84d5ea0ecf5895df3579c3b3d62637cb9a60ecf74d9df2dd983b3ddc677cabc00ecf82bfdf190983b3f29677c5ee60ecfcf99df166983b3f53677c57000ecfd77fdf06f003b404aff803bd60ecf1cbfde0ef4c3b3c730b8022e60ecef9d9e2141003b3aa66780ce400ecddb59e2111003b365c6778443c4ecd971d9e0d8003b36956784dd400eccb9d9df374f13b32e7767cc7da0ecccf3fe00e4003b2f79ff89939e0eca24bfdf64e693b28930e7d5ec40eca5999df48e103b2a53677cf91e0ecabf3fdf0e0103b2e01677c259e0ecb92bfe003a683b2292ff8424660ec88059db091893b2201768030c00ec84f99e0188103b1f01678068160ec7167fdf1a0493b1c5a0e7c603c0ec71e59e1286983b19d367880b9a0ec6693fe2133983b187167784ce24ec61c5d9e100983b18a4678064da0ec5b77fe02bf683b10b9ff7cafd70ec42e82df078003b1301678064260ec3ca59e1147f03b0de1777c51f90ec37860df121683b0e07ff7c22da0ec3a77fdf05e683b0ecaff84359a0ec33f3fe008a003b0c72ff8155a60ec1c719de5568c3b071c738030840ec19695e0080583b05d9ff7820130ec17682e2148983b0491677c52224ec1245d9f0e2983b04f767806f000ec0b559e2168003b016d678018fc0ec0425de1009783b00ffff885f7c0ebfb719e23df683afafcff7cf7d64ebebf439f0df683afdfcff8428aa0ebe9695df0a29c3afa5a637c19e60ebea559de05b983afaa16780521a0ebd82bfe0101883af5097784259e0ebd1cbfde096693af4730e8405a60ebd1719e10cff03af2e17780c95a0ebbe9ffdf3255c3aefa80b7c90fc0ebc225de220a003aed9dff7c827c4ebb67839f14a003aee5dff8419260ebaf999de064893aebe676840b400ebaee59e0016683ae947ff8003a20eba4e5de1095103ae8a4678449da0eb9df3fdf127593ae77d0e7c37da0eb9f13fe03eb983ae39167845dfc0eb8865ddf177e13ae219868039de0eb84c7fdf0e76c3ae1320b88a5000eb7a77fe2104883add9977800f1e0eb73f3fe1093003ada92ff800d1a0eb54c7fe20d8003ad459ff7035fc4eb516839c0d0983ad46167884aa60eb4b559de12a893ad2d576885a000eb45b59df167f13ad16d768414400eb44719df050f13ad11c768067da0eb3df3fe2216003ac753677c857c4eb1d4dd9f20b683ac75dff84005a0eb1d47fe0008883ac74977805a000eb1785dde167f43ac5e1838843da0eb0fc7fde10f593ac3f20e78425a0eb0fdffe24f2003abeffff7d3c7c4eafc0039f4f0983abf01677d26000eafd67fdf44d003abfa4ff7d0b660eaff119df2a8883ac149777c8c220eb0705ddf114003ac2ddff7844220eb0b85dde08b983ac36667884ec00eaf713fe10ba003abd0aff782e7c4eaf42c3a2064983abca667880b400eaf1e59dc02cf13abc79768869000eaeb559df1a3f13abad5767c67da0eaeb67fdf192003abae7677c49da0eaed47fe2054003aba8167881b5a0eae3fffdd06d593ab9000e7418fc0eae425de0046983ab8b9678416da0eae177fe001f683ab83cff8849e60eadc559df127893ab71576803e400eabd47fde0f8f43aaf520b8404e60eabcf99e1027003aa50aff801f260ea8b559df07c8c3aa2d5738007da0ea8693fe0013983aa191678014400ea84719e0492f03a9c89777924b90ea72260e007e783a9c0aff8902c00ea5ffffdd40af13a98000e80bda20ea5425ddf2f67c3a9509837cae000ea551ffe1003783a9505ff802ca60ea514d9df0b28c3a9453737c13260ea52e59e21c0683a9292ff8455260ea44f99e21a4f03a8f9977800b040ea3db59e01b6003a8db7677c6d7d0ea36ddce1099003a8ccd6784209a0ea312bfe10f7983a8b53677c3de30ea2d4dce006c003a8ae7678018c00ea2693fe200b883a8999778007440ea24719e2087003a8895677021bc4ea2255da11b7683a86ddff8081000ea1367fdf203f43a84da0b8474220ea0c25ddf1d07c3a83098380031e0ea0bf3fe20c0003a823cff7c2ffc4ea08f43a20d6983a8166676c35a24ea0599da040c683a7d59ff7d03170e9f5682df38a003a7ddc677cd79a0e9f81ffdf28c683a7ed9ff7c873c0e9fd25ddf208683a7f5dff7c6b9a0e9fedffdf15cf03a8009778481c00e9e92bfe0175983a78d5677c5d630e9e355cdf171003a78d9ff7c40620e9e525de10fc003a769567703efc4e9da55da1094683a7351ff7825164e9cd483a1078003a72d9ff8031260e9c8559e1115683a70ffff84296a0e9c1695e217df03a6edc677c5f784e9bb71da1075003a6e676780725a0e9b277fe040b003a6892ff7d02bc4e9a24c39f337983a6966677c7f260e9aa859df1b6003a6ae7ff7c66000e9ac17fde093003a6c0aff8004e60e99cf99e1133683a660aff8836000e99425ddc0d7f13a65098670265e0e9951ffe0111783a63f7ff + +def tb_125 : Nat := + 0x8013800f155f3fe207e003c52d567805a000f145b59e12c0883c4b99777cb01e4f12e6619f24f003c4c0aff7c8dea0f130895de1d0883c4c89778402040f12e459e0037683c4b59ff780dd70f12d682e00e7003c4a72ff8405a60f129719e030a683c4751ff7cc2970f11d482df1e3003c487967882d000f11a77fdd0b3f13c469e0e8400de0f11417fe0004983c45016788011a0f113f3fe10dc683c430aff7837164f10c2c3a0007983c43036788087c0f10b85de118d683c40d9ff7c63564f1036839f10d103c415a578058260f0fde59df160893c3f7976801e5a0f0effffde0795c3c3c000b781bfc0f0f025de2126003c3ad9ff8015ea0f0ea095de0579c3c3a82638819440f0e2919df065013c38a4767c14040f0e2e59e00b2683c37f1ff742c970f0dfc82e1075003c377cff8002400f0cbf3fe1415983c2ee7677d05630f0bb9dcdf3d3983c2f29677c9a800f0c24bfdf1d7003c3125ff88777c0f0b425ddd1dde13c2d09867461440f0b5895e0003783c2d05ff802d000f0b147fe2261003c293cff7c983c4f0a4f439f1dc883c29c1778873e60f09db59dd1cf893c276d76746ae60f09e459e000f003c275e67800a380f09865de20d6983c24a66780551a0f080f3fe02d1683c1c0aff7cb4570f0702c2df2ba103c1c22578840620f06c25dde101793c1b0986782c400f06d67fe01e3783c1925ff7c78db0f064982df122103c19e7677c2bc80f069695e01dc883c1749777c771f0f05d260df1d4003c1751ff80125a0f0551ffe00b2983c14956784275a0f04fdffe005a003c139dff8009000f04de7fe1187203c115a578434380f04225ddf0d0d43c108983849c000f03865dde26ff43c0e1983802cc40f035999e205b683c0d0aff80ac800f0281ffdf2b1f43c0a080b8010e60f027119e208af03c0939778807440f024719e01d4003bff5dff7874fd0effd782e1003a83bff5a578001bc0effd4d9e0147003bfe0aff801a9a0efedf3fe0067983bfb156780029a0efec2bfe00c0003bfa4aff841e2a0efe7495e1074583bf95dff8081000efdd67fde203f43bf75a0b7822260efe3559e000c003bf69567800dda0efd977fe00c5583bf57cff7c31530efd5f42df0a4583bf59dff8065a60efcf999df196893bf3e676802a5a0efccf3fe2013983bf329678466000efc6459df197f43bf19173844cda0efc177fdf133593bf05e0e841e660efbc0d9e154c003be9b7677d52fd0efa6ddcdf490683bea72ff7d06da0efab9ffdf35b683beba7ff7cb8440efb0895de131103bedd257841bc00efa3dd9e2064683be892ff8405040ef8b359e2360003bdf6d677cd7fc4ef7db5da21a2683bddcaff7c68964ef772c39f193683bddd9ff7c0a800ef7d0d9e00c0003bdcddff80bf220ef6785de201d103bd9c4678807da0ef6693fe110f983bd895677c43e24ef6255da0230883bd5c177808a000ef4e65de2008103bd391678877400ef45f3fe21c3983bcfb9677c70e24ef3ee5d9f173883bd009778405400ef31719e1281103bc9d257848b560ef1e93fe0064983bc4cd67801d040ef08559e1033f03bc1e1778407440ef07119e001f683bc1a4ff84f0000eedee59de3bff13bb7b976845b9e0eed1cbfde16e693bb4730e7853040eed2559e209d983bb2dc6784845a0eec32bfdf211593bb0cb0e7c81c00eec3559df182103bb15a5778245a0eec92bfe2111003ba9c467880abc0eea665de190d683b9e07ff7e43570ee78202df75c003b9fb9677da7000ee81e59df39c003ba3796784296a0ee75895df0a59c3b9d62638002160ee7567fe0048003b9addff8012c00ee6a4bfe01b9003b98d9ff7c6e3d0ee63682e000f003b98caff8041a60ee5f119df1068c3b97c4738048000ee5a919e000f003b969567841ec00ee4f999dd07af13b93e6768495400ee46459e002f103b916257881e660ee3c0d9df079893b8f037680b8440ee30895df2e1043b8c22637c2a5a0ee3967fde027003b8edc67844f800ee294d9e2388683b86caff7ce2164ee1b2c39f1f2003b8861677c1b000ee279d9df041103b8a12578810620ee1a25de20a8003b85e1777829fc4ee17861a0099783b8547ff78265b0ee15202e0042003b8505ff802aea0ee11695e10f3f03b8366677c3cf84ee0d99d9f0e0583b8379ff7c20160ee0f67fdf062583b83f7ff8406c00edfd799d901af13b7f5e7680401a0edf977fdf1005c3b7e5e0b7c17400edfc059e0190983b7ccd677c64230edf335ce103c003b7c9167847d400ede81ffe01f3983b6f3e677c7ce30edbcf9cdf128883b700977843fa20edb425de10b6103b6c53678061800edab359df185f43b6acd737c521a0edac2bfe2202683b68caff7480964eda32c3a2106983b67c4678413560ed9713fe1085983b64f7678814400ed92999e1127203b616257809aaa0ed77495e1238e03b5b99777c8e344ed6e6619f1c7583b5c0aff808c040ed65a59df230043b5969737c55c80ed69095df0f8103b5aa1678056c40ed5cf99de15b043b573e7388905a0ed53f3fde241593b54fd0e8439c00ed4c2bfe235e683b4fa4ff8018660ed3d0d9e1042003b4f0167 + +def tb_126 : Nat := + 0x8041400f2a1859e110f683ca751ff801aa60f29b9d9e00dc683ca60aff846c2a0f291695e22f3883ca089777cbcde4f2822619f2b2003ca0caff7ca9e60f283559df0ea003ca292ff7c26e20f28b85de100c003c9f6d67840a800f27d0d9e205c583c9d9dff8447400f26cf3fdd11cf13c9b3d0e802ee60f26a059e00fc003c987167809ae60f23f999e011e683c8e0aff8066000f231cbfe014d003c8b25ff74533d0f22c982e1074583c859dff840d260f215a59e022c683c833cff7c8b170f20cf42e21ab983c819167786ae24f20645d9e198003c81a4ff80245a0f203fffdf091593c81000e80a9800f1f967fde2a5f43c7e5a0b7888e60f1fb719e0087a83c7dd2577421e70f1f7498e0068103c7aa167741a010f1ea85cdd021783c7ae7ff84191a0f1e24bfe2149883c77497778525e4f1dd2619e13f983c7753678030000f1da25de1180003c7509778068c40f1cd999df1a3043c7366737c2d840f1d14d9e0035583c6dc4ff740d530f1b7142e014b983c6c79677852e30f1b1e5cde0e7003c6cddff80031e0f1aff3fe1045003c6bb7ff74113d0f1aee02e0064983c6b5367841e5a0f1ab67fdd079593c6ada0e8015ea0f1aa095e05b6983c6391677d6da30f18e45cdf3eda83c655a5780419a0f189cbfdf1065c3c62730b7c1f1a0f18bf3fe0018a83c625a578410380f18865de013b783c60ddff744edb0f183782e018c003c5f51ff8002220f17d25de20ab783c5e9dff782ada4f17a783a1096003c5e07ff8842c00f173f3fe208a003c5c72ff8455800f164f3fdf155f13c593d0e8866000f15e93fe20a5003c56ffff8417a60f15a859e0093003c55caff + +def bsel_0_1 (j : Nat) : Nat := + Bool.rec (tb_1) (tb_0) (Nat.ble j 0) + +def bsel_2_3 (j : Nat) : Nat := + Bool.rec (tb_3) (tb_2) (Nat.ble j 2) + +def bsel_0_3 (j : Nat) : Nat := + Bool.rec (bsel_2_3 j) (bsel_0_1 j) (Nat.ble j 1) + +def bsel_4_5 (j : Nat) : Nat := + Bool.rec (tb_5) (tb_4) (Nat.ble j 4) + +def bsel_6_7 (j : Nat) : Nat := + Bool.rec (tb_7) (tb_6) (Nat.ble j 6) + +def bsel_4_7 (j : Nat) : Nat := + Bool.rec (bsel_6_7 j) (bsel_4_5 j) (Nat.ble j 5) + +def bsel_0_7 (j : Nat) : Nat := + Bool.rec (bsel_4_7 j) (bsel_0_3 j) (Nat.ble j 3) + +def bsel_8_9 (j : Nat) : Nat := + Bool.rec (tb_9) (tb_8) (Nat.ble j 8) + +def bsel_10_11 (j : Nat) : Nat := + Bool.rec (tb_11) (tb_10) (Nat.ble j 10) + +def bsel_8_11 (j : Nat) : Nat := + Bool.rec (bsel_10_11 j) (bsel_8_9 j) (Nat.ble j 9) + +def bsel_12_13 (j : Nat) : Nat := + Bool.rec (tb_13) (tb_12) (Nat.ble j 12) + +def bsel_14_15 (j : Nat) : Nat := + Bool.rec (tb_15) (tb_14) (Nat.ble j 14) + +def bsel_12_15 (j : Nat) : Nat := + Bool.rec (bsel_14_15 j) (bsel_12_13 j) (Nat.ble j 13) + +def bsel_8_15 (j : Nat) : Nat := + Bool.rec (bsel_12_15 j) (bsel_8_11 j) (Nat.ble j 11) + +def bsel_0_15 (j : Nat) : Nat := + Bool.rec (bsel_8_15 j) (bsel_0_7 j) (Nat.ble j 7) + +def bsel_16_17 (j : Nat) : Nat := + Bool.rec (tb_17) (tb_16) (Nat.ble j 16) + +def bsel_18_19 (j : Nat) : Nat := + Bool.rec (tb_19) (tb_18) (Nat.ble j 18) + +def bsel_16_19 (j : Nat) : Nat := + Bool.rec (bsel_18_19 j) (bsel_16_17 j) (Nat.ble j 17) + +def bsel_20_21 (j : Nat) : Nat := + Bool.rec (tb_21) (tb_20) (Nat.ble j 20) + +def bsel_22_23 (j : Nat) : Nat := + Bool.rec (tb_23) (tb_22) (Nat.ble j 22) + +def bsel_20_23 (j : Nat) : Nat := + Bool.rec (bsel_22_23 j) (bsel_20_21 j) (Nat.ble j 21) + +def bsel_16_23 (j : Nat) : Nat := + Bool.rec (bsel_20_23 j) (bsel_16_19 j) (Nat.ble j 19) + +def bsel_24_25 (j : Nat) : Nat := + Bool.rec (tb_25) (tb_24) (Nat.ble j 24) + +def bsel_26_27 (j : Nat) : Nat := + Bool.rec (tb_27) (tb_26) (Nat.ble j 26) + +def bsel_24_27 (j : Nat) : Nat := + Bool.rec (bsel_26_27 j) (bsel_24_25 j) (Nat.ble j 25) + +def bsel_28_29 (j : Nat) : Nat := + Bool.rec (tb_29) (tb_28) (Nat.ble j 28) + +def bsel_30_31 (j : Nat) : Nat := + Bool.rec (tb_31) (tb_30) (Nat.ble j 30) + +def bsel_28_31 (j : Nat) : Nat := + Bool.rec (bsel_30_31 j) (bsel_28_29 j) (Nat.ble j 29) + +def bsel_24_31 (j : Nat) : Nat := + Bool.rec (bsel_28_31 j) (bsel_24_27 j) (Nat.ble j 27) + +def bsel_16_31 (j : Nat) : Nat := + Bool.rec (bsel_24_31 j) (bsel_16_23 j) (Nat.ble j 23) + +def bsel_0_31 (j : Nat) : Nat := + Bool.rec (bsel_16_31 j) (bsel_0_15 j) (Nat.ble j 15) + +def bsel_32_33 (j : Nat) : Nat := + Bool.rec (tb_33) (tb_32) (Nat.ble j 32) + +def bsel_34_35 (j : Nat) : Nat := + Bool.rec (tb_35) (tb_34) (Nat.ble j 34) + +def bsel_32_35 (j : Nat) : Nat := + Bool.rec (bsel_34_35 j) (bsel_32_33 j) (Nat.ble j 33) + +def bsel_36_37 (j : Nat) : Nat := + Bool.rec (tb_37) (tb_36) (Nat.ble j 36) + +def bsel_38_39 (j : Nat) : Nat := + Bool.rec (tb_39) (tb_38) (Nat.ble j 38) + +def bsel_36_39 (j : Nat) : Nat := + Bool.rec (bsel_38_39 j) (bsel_36_37 j) (Nat.ble j 37) + +def bsel_32_39 (j : Nat) : Nat := + Bool.rec (bsel_36_39 j) (bsel_32_35 j) (Nat.ble j 35) + +def bsel_40_41 (j : Nat) : Nat := + Bool.rec (tb_41) (tb_40) (Nat.ble j 40) + +def bsel_42_43 (j : Nat) : Nat := + Bool.rec (tb_43) (tb_42) (Nat.ble j 42) + +def bsel_40_43 (j : Nat) : Nat := + Bool.rec (bsel_42_43 j) (bsel_40_41 j) (Nat.ble j 41) + +def bsel_44_45 (j : Nat) : Nat := + Bool.rec (tb_45) (tb_44) (Nat.ble j 44) + +def bsel_46_47 (j : Nat) : Nat := + Bool.rec (tb_47) (tb_46) (Nat.ble j 46) + +def bsel_44_47 (j : Nat) : Nat := + Bool.rec (bsel_46_47 j) (bsel_44_45 j) (Nat.ble j 45) + +def bsel_40_47 (j : Nat) : Nat := + Bool.rec (bsel_44_47 j) (bsel_40_43 j) (Nat.ble j 43) + +def bsel_32_47 (j : Nat) : Nat := + Bool.rec (bsel_40_47 j) (bsel_32_39 j) (Nat.ble j 39) + +def bsel_48_49 (j : Nat) : Nat := + Bool.rec (tb_49) (tb_48) (Nat.ble j 48) + +def bsel_50_51 (j : Nat) : Nat := + Bool.rec (tb_51) (tb_50) (Nat.ble j 50) + +def bsel_48_51 (j : Nat) : Nat := + Bool.rec (bsel_50_51 j) (bsel_48_49 j) (Nat.ble j 49) + +def bsel_52_53 (j : Nat) : Nat := + Bool.rec (tb_53) (tb_52) (Nat.ble j 52) + +def bsel_54_55 (j : Nat) : Nat := + Bool.rec (tb_55) (tb_54) (Nat.ble j 54) + +def bsel_52_55 (j : Nat) : Nat := + Bool.rec (bsel_54_55 j) (bsel_52_53 j) (Nat.ble j 53) + +def bsel_48_55 (j : Nat) : Nat := + Bool.rec (bsel_52_55 j) (bsel_48_51 j) (Nat.ble j 51) + +def bsel_56_57 (j : Nat) : Nat := + Bool.rec (tb_57) (tb_56) (Nat.ble j 56) + +def bsel_58_59 (j : Nat) : Nat := + Bool.rec (tb_59) (tb_58) (Nat.ble j 58) + +def bsel_56_59 (j : Nat) : Nat := + Bool.rec (bsel_58_59 j) (bsel_56_57 j) (Nat.ble j 57) + +def bsel_60_61 (j : Nat) : Nat := + Bool.rec (tb_61) (tb_60) (Nat.ble j 60) + +def bsel_62_63 (j : Nat) : Nat := + Bool.rec (tb_63) (tb_62) (Nat.ble j 62) + +def bsel_60_63 (j : Nat) : Nat := + Bool.rec (bsel_62_63 j) (bsel_60_61 j) (Nat.ble j 61) + +def bsel_56_63 (j : Nat) : Nat := + Bool.rec (bsel_60_63 j) (bsel_56_59 j) (Nat.ble j 59) + +def bsel_48_63 (j : Nat) : Nat := + Bool.rec (bsel_56_63 j) (bsel_48_55 j) (Nat.ble j 55) + +def bsel_32_63 (j : Nat) : Nat := + Bool.rec (bsel_48_63 j) (bsel_32_47 j) (Nat.ble j 47) + +def bsel_0_63 (j : Nat) : Nat := + Bool.rec (bsel_32_63 j) (bsel_0_31 j) (Nat.ble j 31) + +def bsel_64_65 (j : Nat) : Nat := + Bool.rec (tb_65) (tb_64) (Nat.ble j 64) + +def bsel_66_67 (j : Nat) : Nat := + Bool.rec (tb_67) (tb_66) (Nat.ble j 66) + +def bsel_64_67 (j : Nat) : Nat := + Bool.rec (bsel_66_67 j) (bsel_64_65 j) (Nat.ble j 65) + +def bsel_68_69 (j : Nat) : Nat := + Bool.rec (tb_69) (tb_68) (Nat.ble j 68) + +def bsel_70_71 (j : Nat) : Nat := + Bool.rec (tb_71) (tb_70) (Nat.ble j 70) + +def bsel_68_71 (j : Nat) : Nat := + Bool.rec (bsel_70_71 j) (bsel_68_69 j) (Nat.ble j 69) + +def bsel_64_71 (j : Nat) : Nat := + Bool.rec (bsel_68_71 j) (bsel_64_67 j) (Nat.ble j 67) + +def bsel_72_73 (j : Nat) : Nat := + Bool.rec (tb_73) (tb_72) (Nat.ble j 72) + +def bsel_74_75 (j : Nat) : Nat := + Bool.rec (tb_75) (tb_74) (Nat.ble j 74) + +def bsel_72_75 (j : Nat) : Nat := + Bool.rec (bsel_74_75 j) (bsel_72_73 j) (Nat.ble j 73) + +def bsel_76_77 (j : Nat) : Nat := + Bool.rec (tb_77) (tb_76) (Nat.ble j 76) + +def bsel_78_79 (j : Nat) : Nat := + Bool.rec (tb_79) (tb_78) (Nat.ble j 78) + +def bsel_76_79 (j : Nat) : Nat := + Bool.rec (bsel_78_79 j) (bsel_76_77 j) (Nat.ble j 77) + +def bsel_72_79 (j : Nat) : Nat := + Bool.rec (bsel_76_79 j) (bsel_72_75 j) (Nat.ble j 75) + +def bsel_64_79 (j : Nat) : Nat := + Bool.rec (bsel_72_79 j) (bsel_64_71 j) (Nat.ble j 71) + +def bsel_80_81 (j : Nat) : Nat := + Bool.rec (tb_81) (tb_80) (Nat.ble j 80) + +def bsel_82_83 (j : Nat) : Nat := + Bool.rec (tb_83) (tb_82) (Nat.ble j 82) + +def bsel_80_83 (j : Nat) : Nat := + Bool.rec (bsel_82_83 j) (bsel_80_81 j) (Nat.ble j 81) + +def bsel_84_85 (j : Nat) : Nat := + Bool.rec (tb_85) (tb_84) (Nat.ble j 84) + +def bsel_86_87 (j : Nat) : Nat := + Bool.rec (tb_87) (tb_86) (Nat.ble j 86) + +def bsel_84_87 (j : Nat) : Nat := + Bool.rec (bsel_86_87 j) (bsel_84_85 j) (Nat.ble j 85) + +def bsel_80_87 (j : Nat) : Nat := + Bool.rec (bsel_84_87 j) (bsel_80_83 j) (Nat.ble j 83) + +def bsel_88_89 (j : Nat) : Nat := + Bool.rec (tb_89) (tb_88) (Nat.ble j 88) + +def bsel_90_91 (j : Nat) : Nat := + Bool.rec (tb_91) (tb_90) (Nat.ble j 90) + +def bsel_88_91 (j : Nat) : Nat := + Bool.rec (bsel_90_91 j) (bsel_88_89 j) (Nat.ble j 89) + +def bsel_92_93 (j : Nat) : Nat := + Bool.rec (tb_93) (tb_92) (Nat.ble j 92) + +def bsel_94_95 (j : Nat) : Nat := + Bool.rec (tb_95) (tb_94) (Nat.ble j 94) + +def bsel_92_95 (j : Nat) : Nat := + Bool.rec (bsel_94_95 j) (bsel_92_93 j) (Nat.ble j 93) + +def bsel_88_95 (j : Nat) : Nat := + Bool.rec (bsel_92_95 j) (bsel_88_91 j) (Nat.ble j 91) + +def bsel_80_95 (j : Nat) : Nat := + Bool.rec (bsel_88_95 j) (bsel_80_87 j) (Nat.ble j 87) + +def bsel_64_95 (j : Nat) : Nat := + Bool.rec (bsel_80_95 j) (bsel_64_79 j) (Nat.ble j 79) + +def bsel_96_97 (j : Nat) : Nat := + Bool.rec (tb_97) (tb_96) (Nat.ble j 96) + +def bsel_98_99 (j : Nat) : Nat := + Bool.rec (tb_99) (tb_98) (Nat.ble j 98) + +def bsel_96_99 (j : Nat) : Nat := + Bool.rec (bsel_98_99 j) (bsel_96_97 j) (Nat.ble j 97) + +def bsel_100_101 (j : Nat) : Nat := + Bool.rec (tb_101) (tb_100) (Nat.ble j 100) + +def bsel_102_103 (j : Nat) : Nat := + Bool.rec (tb_103) (tb_102) (Nat.ble j 102) + +def bsel_100_103 (j : Nat) : Nat := + Bool.rec (bsel_102_103 j) (bsel_100_101 j) (Nat.ble j 101) + +def bsel_96_103 (j : Nat) : Nat := + Bool.rec (bsel_100_103 j) (bsel_96_99 j) (Nat.ble j 99) + +def bsel_104_105 (j : Nat) : Nat := + Bool.rec (tb_105) (tb_104) (Nat.ble j 104) + +def bsel_106_107 (j : Nat) : Nat := + Bool.rec (tb_107) (tb_106) (Nat.ble j 106) + +def bsel_104_107 (j : Nat) : Nat := + Bool.rec (bsel_106_107 j) (bsel_104_105 j) (Nat.ble j 105) + +def bsel_108_109 (j : Nat) : Nat := + Bool.rec (tb_109) (tb_108) (Nat.ble j 108) + +def bsel_110_111 (j : Nat) : Nat := + Bool.rec (tb_111) (tb_110) (Nat.ble j 110) + +def bsel_108_111 (j : Nat) : Nat := + Bool.rec (bsel_110_111 j) (bsel_108_109 j) (Nat.ble j 109) + +def bsel_104_111 (j : Nat) : Nat := + Bool.rec (bsel_108_111 j) (bsel_104_107 j) (Nat.ble j 107) + +def bsel_96_111 (j : Nat) : Nat := + Bool.rec (bsel_104_111 j) (bsel_96_103 j) (Nat.ble j 103) + +def bsel_112_113 (j : Nat) : Nat := + Bool.rec (tb_113) (tb_112) (Nat.ble j 112) + +def bsel_114_115 (j : Nat) : Nat := + Bool.rec (tb_115) (tb_114) (Nat.ble j 114) + +def bsel_112_115 (j : Nat) : Nat := + Bool.rec (bsel_114_115 j) (bsel_112_113 j) (Nat.ble j 113) + +def bsel_116_117 (j : Nat) : Nat := + Bool.rec (tb_117) (tb_116) (Nat.ble j 116) + +def bsel_118_119 (j : Nat) : Nat := + Bool.rec (tb_119) (tb_118) (Nat.ble j 118) + +def bsel_116_119 (j : Nat) : Nat := + Bool.rec (bsel_118_119 j) (bsel_116_117 j) (Nat.ble j 117) + +def bsel_112_119 (j : Nat) : Nat := + Bool.rec (bsel_116_119 j) (bsel_112_115 j) (Nat.ble j 115) + +def bsel_120_121 (j : Nat) : Nat := + Bool.rec (tb_121) (tb_120) (Nat.ble j 120) + +def bsel_122_123 (j : Nat) : Nat := + Bool.rec (tb_123) (tb_122) (Nat.ble j 122) + +def bsel_120_123 (j : Nat) : Nat := + Bool.rec (bsel_122_123 j) (bsel_120_121 j) (Nat.ble j 121) + +def bsel_124_125 (j : Nat) : Nat := + Bool.rec (tb_125) (tb_124) (Nat.ble j 124) + +def bsel_124_126 (j : Nat) : Nat := + Bool.rec (tb_126) (bsel_124_125 j) (Nat.ble j 125) + +def bsel_120_126 (j : Nat) : Nat := + Bool.rec (bsel_124_126 j) (bsel_120_123 j) (Nat.ble j 123) + +def bsel_112_126 (j : Nat) : Nat := + Bool.rec (bsel_120_126 j) (bsel_112_119 j) (Nat.ble j 119) + +def bsel_96_126 (j : Nat) : Nat := + Bool.rec (bsel_112_126 j) (bsel_96_111 j) (Nat.ble j 111) + +def bsel_64_126 (j : Nat) : Nat := + Bool.rec (bsel_96_126 j) (bsel_64_95 j) (Nat.ble j 95) + +def bsel_0_126 (j : Nat) : Nat := + Bool.rec (bsel_64_126 j) (bsel_0_63 j) (Nat.ble j 63) + +def blkF (j : Nat) : Nat := bsel_0_126 j + + +def entF (g : Nat) : Nat := + Nat.land (Nat.shiftRight (blkF (Nat.div g 256)) (Nat.mul 58 (Nat.mod g 256))) 288230376151711743 + +inductive JRes where + | fail : JRes + | ok : Nat → Nat → JRes + +def jWithF (ih : Nat → Nat → JRes) (lim p x' g e : Nat) : JRes := + Bool.rec JRes.fail (ih (Nat.add p (tRdF e)) x') + (Bool.and (Nat.ble (Nat.add g 1) lim) (applies (tRbF e) (tRsF e) p)) + +def jStepF (lim : Nat) (_ : Nat) (ih : Nat → Nat → JRes) (p x : Nat) : JRes := + jWithF ih lim p (Nat.div x 32768) (Nat.mod x 32768) (entF (Nat.mod x 32768)) + +def jumpsF (lim cnt p x : Nat) : JRes := + Nat.rec JRes.ok (jStepF lim) cnt p x + +inductive P1Res where + | fail : P1Res + | ok : Nat → Nat → LList → P1Res + +def p1WithF (ih : Nat → Nat → LList → P1Res) (lim p x' : Nat) (acc : LList) (g e : Nat) : P1Res := + Bool.rec P1Res.fail (ih (Nat.add p (tRdF e)) x' (LList.cons p e acc)) + (Bool.and (Nat.ble (Nat.add g 1) lim) (applies (tRbF e) (tRsF e) p)) + +def p1StepF (lim : Nat) (_ : Nat) (ih : Nat → Nat → LList → P1Res) (p x : Nat) (acc : LList) : P1Res := + p1WithF ih lim p (Nat.div x 32768) acc (Nat.mod x 32768) (entF (Nat.mod x 32768)) + +def pass1F (lim cnt p x : Nat) (acc : LList) : P1Res := + Nat.rec P1Res.ok (p1StepF lim) cnt p x acc + +inductive P2Res where + | fail : P2Res + | ok : Nat → Nat → Nat → P2Res + +def emitF (k : Nat → Nat → Nat → P2Res) (q s' d' pos e : Nat) : P2Res := + Bool.rec P2Res.fail (k s' d' (Nat.add pos 1)) + (Bool.and (Nat.beq (tRbF e) q) (Bool.and (Nat.beq (tRsF e) s') (Nat.beq (tRdF e) d'))) + +def joinEmitF (k : Nat → Nat → Nat → P2Res) (q si di s d pos : Nat) : P2Res := + Bool.rec + (Bool.rec P2Res.fail (emitF k q s (Nat.add di d) pos (entF pos)) (Nat.beq (Nat.mod s si) 0)) + (Bool.rec P2Res.fail (emitF k q si (Nat.add di d) pos (entF pos)) (Nat.beq (Nat.mod si s) 0)) + (Nat.ble s si) + +def p2EndF (bn bs bd s d pos : Nat) : P2Res := + joinEmitF P2Res.ok bn bs bd s d pos + +def p2StepF (q e : Nat) (_ : LList) (ih : Nat → Nat → Nat → P2Res) (s d pos : Nat) : P2Res := + joinEmitF ih q (tRsF e) (tRdF e) s d pos + +def p2FoldF (bn bs bd : Nat) (rest : LList) (s d pos : Nat) : P2Res := + LList.rec (p2EndF bn bs bd) p2StepF rest s d pos + +def p2NilF (bn bs bd pos : Nat) : P2Res := + emitF P2Res.ok bn bs bd pos (entF pos) + +def p2ConsF (bn bs bd pos : Nat) (_ e : Nat) (rest : LList) (_ : P2Res) : P2Res := + p2FoldF bn bs bd rest (tRsF e) (tRdF e) pos + +def pass2F (bn bs bd pos : Nat) (acc : LList) : P2Res := + LList.rec (p2NilF bn bs bd pos) (p2ConsF bn bs bd pos) acc + +inductive CRes where + | fail : CRes + | ok : Nat → Nat → Nat → CRes + +def jOkF (pos p x : Nat) : CRes := CRes.ok p pos x + +def stEF (pos n cnt x : Nat) : CRes := + Bool.rec CRes.fail (JRes.rec CRes.fail (jOkF pos) (jumpsF pos cnt (fastEvalF n) x)) + (Nat.ble (Nat.add n 1) (fastEvalF n)) + +def stBSomeF (pos cnt x n _ rd : Nat) : CRes := + JRes.rec CRes.fail (jOkF pos) (jumpsF pos cnt (Nat.add n rd) x) + +def stBF (pos n cnt x : Nat) : CRes := + CmpRule.rec CRes.fail (stBSomeF pos cnt x n) (fastCompileF n) + +def p2OkF (n x' : Nat) (_ d pos : Nat) : CRes := CRes.ok (Nat.add n d) pos x' + +def stCAfterF (n pos rs rd : Nat) (_ x' : Nat) (acc : LList) : CRes := + P2Res.rec CRes.fail (p2OkF n x') (pass2F n rs rd pos acc) + +def stCSomeF (pos cnt x n rs rd : Nat) : CRes := + P1Res.rec CRes.fail (stCAfterF n pos rs rd) (pass1F pos cnt (Nat.add n rd) x LList.nil) + +def stCF (pos n cnt x : Nat) : CRes := + CmpRule.rec CRes.fail (stCSomeF pos cnt x n) (fastCompileF n) + +def stKindF (n pos kind cnt x : Nat) : CRes := + Bool.rec + (Bool.rec + (Bool.rec CRes.fail (stCF pos n cnt x) (Nat.beq kind 2)) + (stBF pos n cnt x) + (Nat.beq kind 1)) + (stEF pos n cnt x) + (Nat.beq kind 0) + +def stepF (n pos x : Nat) : CRes := + stKindF n pos (Nat.mod (Nat.mod x 128) 4) (Nat.div (Nat.mod x 128) 4) (Nat.div x 128) + +def cStepF (_ : Nat) (ih : Nat → Nat → Nat → CRes) (n pos x : Nat) : CRes := + CRes.rec CRes.fail ih (stepF n pos x) + +def runCF (steps n pos x : Nat) : CRes := + Nat.rec CRes.ok cStepF steps n pos x + +def finCF (m pos' : Nat) (n pos _ : Nat) : Bool := + Bool.and (Nat.beq n m) (Nat.beq pos pos') + +def chunk5F (steps n m pos pos' x : Nat) : Bool := + CRes.rec false (finCF m pos') (runCF steps n pos x) + +-- Soundness of the v5 certificate machinery. + +def EntV (x : Nat) : Prop := valid (tRbF x) (tRsF x) (tRdF x) + +/-- The first `p` table entries are valid rules. -/ +def TabV (p : Nat) : Prop := ∀ g, g < p → EntV (entF g) + +theorem TabV_zero : TabV 0 := fun g hg => absurd hg (Nat.not_lt_zero g) + +theorem TabV_succ (p : Nat) (hp : TabV p) (h : EntV (entF p)) : TabV (p + 1) := by + intro g hg + rcases Nat.lt_or_ge g p with h1 | h1 + · exact hp g h1 + · have hgp : g = p := by omega + subst hgp + exact h + +theorem ref_spec (lim p g : Nat) (hT : TabV lim) + (h : Bool.and (Nat.ble (Nat.add g 1) lim) (applies (tRbF (entF g)) (tRsF (entF g)) p) = true) : + valid p (tRsF (entF g)) (tRdF (entF g)) := by + rcases Bool.and_eq_true_iff.mp h with ⟨h1, h2⟩ + have hg : g + 1 ≤ lim := Nat.le_of_ble_eq_true h1 + exact valid_of_applies _ _ _ p (hT g (by omega)) h2 + +theorem jumpsF_spec (lim : Nat) (hT : TabV lim) (cnt : Nat) : + ∀ p x p' x', jumpsF lim cnt p x = JRes.ok p' x' → ReachesStar target_tm (Cn p) (Cn p') := by + induction cnt with + | zero => + intro p x p' x' h + change JRes.ok p x = JRes.ok p' x' at h + injection h with h1 h2 + subst h1 + try exact ReachesStar.refl _ _ + | succ cnt ih => + intro p x p' x' h + change jStepF lim cnt (Nat.rec (motive := fun _ => Nat → Nat → JRes) JRes.ok (jStepF lim) cnt) p x = + JRes.ok p' x' at h + unfold jStepF jWithF at h + revert h + cases hc : Bool.and (Nat.ble (Nat.add (Nat.mod x 32768) 1) lim) + (applies (tRbF (entF (Nat.mod x 32768))) (tRsF (entF (Nat.mod x 32768))) p) <;> + dsimp only [Bool.rec] <;> intro h + · cases h + · exact (valid_zero p _ _ (ref_spec lim p _ hT hc)).trans (ih _ _ p' x' h) + +/-- `acc` lists the looked-up rules of a chain (last first) with the positions they were applied at; +the chain starts at `p0` and ends at `p`. -/ +def ChainOK (p0 : Nat) : LList → Nat → Prop + | .nil, p => p = p0 + | .cons q e rest, p => p = q + tRdF e ∧ valid q (tRsF e) (tRdF e) ∧ ChainOK p0 rest q + +theorem pass1F_spec (lim p0 : Nat) (hT : TabV lim) (cnt : Nat) : + ∀ p x acc p' x' acc', ChainOK p0 acc p → pass1F lim cnt p x acc = P1Res.ok p' x' acc' → + ChainOK p0 acc' p' := by + induction cnt with + | zero => + intro p x acc p' x' acc' hacc h + change P1Res.ok p x acc = P1Res.ok p' x' acc' at h + injection h with h1 h2 h3 + subst h1 + subst h3 + exact hacc + | succ cnt ih => + intro p x acc p' x' acc' hacc h + change p1StepF lim cnt (Nat.rec (motive := fun _ => Nat → Nat → LList → P1Res) P1Res.ok (p1StepF lim) cnt) + p x acc = P1Res.ok p' x' acc' at h + unfold p1StepF p1WithF at h + revert h + cases hc : Bool.and (Nat.ble (Nat.add (Nat.mod x 32768) 1) lim) + (applies (tRbF (entF (Nat.mod x 32768))) (tRsF (entF (Nat.mod x 32768))) p) <;> + dsimp only [Bool.rec] <;> intro h + · cases h + · refine ih _ _ _ p' x' acc' ?_ h + exact ⟨rfl, ref_spec lim p _ hT hc, hacc⟩ + +theorem emitF_spec (k : Nat → Nat → Nat → P2Res) (q s' d' pos : Nat) (hv : valid q s' d') (hT : TabV pos) + (s d pos' : Nat) (h : emitF k q s' d' pos (entF pos) = P2Res.ok s d pos') : + TabV (pos + 1) ∧ k s' d' (pos + 1) = P2Res.ok s d pos' := by + revert h + unfold emitF + cases hc : Bool.and (Nat.beq (tRbF (entF pos)) q) + (Bool.and (Nat.beq (tRsF (entF pos)) s') (Nat.beq (tRdF (entF pos)) d')) <;> + dsimp only [Bool.rec] <;> intro h + · cases h + · rcases Bool.and_eq_true_iff.mp hc with ⟨h1, h23⟩ + rcases Bool.and_eq_true_iff.mp h23 with ⟨h2, h3⟩ + refine ⟨TabV_succ pos hT ?_, h⟩ + show valid (tRbF (entF pos)) (tRsF (entF pos)) (tRdF (entF pos)) + rw [Nat.eq_of_beq_eq_true h1, Nat.eq_of_beq_eq_true h2, Nat.eq_of_beq_eq_true h3] + exact hv + +theorem joinEmitF_spec (k : Nat → Nat → Nat → P2Res) (q si di s d pos : Nat) + (h1 : valid q si di) (h2 : valid (q + di) s d) (hT : TabV pos) (s0 d0 pos0 : Nat) + (h : joinEmitF k q si di s d pos = P2Res.ok s0 d0 pos0) : + ∃ s' d', valid q s' d' ∧ TabV (pos + 1) ∧ k s' d' (pos + 1) = P2Res.ok s0 d0 pos0 := by + revert h + unfold joinEmitF + cases Nat.ble s si <;> dsimp only [Bool.rec] + · cases hm : Nat.beq (Nat.mod s si) 0 <;> dsimp only [Bool.rec] <;> intro h + · cases h + · have hv : valid q s (di + d) := join_rules_2 q si di s d h1 h2 (Nat.eq_of_beq_eq_true hm) + obtain ⟨hT', hk⟩ := emitF_spec k q s (Nat.add di d) pos hv hT s0 d0 pos0 h + exact ⟨s, Nat.add di d, hv, hT', hk⟩ + · cases hm : Nat.beq (Nat.mod si s) 0 <;> dsimp only [Bool.rec] <;> intro h + · cases h + · have hv : valid q si (di + d) := join_rules_1 q si di s d h1 h2 (Nat.eq_of_beq_eq_true hm) + obtain ⟨hT', hk⟩ := emitF_spec k q si (Nat.add di d) pos hv hT s0 d0 pos0 h + exact ⟨si, Nat.add di d, hv, hT', hk⟩ + +theorem p2FoldF_spec (bn bs bd : Nat) (hb : valid bn bs bd) (rest : LList) : + ∀ q s d pos s0 d0 pos0, ChainOK (bn + bd) rest q → valid q s d → TabV pos → + p2FoldF bn bs bd rest s d pos = P2Res.ok s0 d0 pos0 → valid bn s0 d0 ∧ TabV pos0 := by + induction rest with + | nil => + intro q s d pos s0 d0 pos0 hrest hv hT h + have hq : q = bn + bd := hrest + subst hq + change joinEmitF P2Res.ok bn bs bd s d pos = P2Res.ok s0 d0 pos0 at h + obtain ⟨s', d', hv', hT', hk⟩ := joinEmitF_spec P2Res.ok bn bs bd s d pos hb hv hT s0 d0 pos0 h + injection hk with e1 e2 e3 + subst e1 + subst e2 + subst e3 + exact ⟨hv', hT'⟩ + | cons q' e rest ih => + intro q s d pos s0 d0 pos0 hrest hv hT h + rcases hrest with ⟨hq, hv', hrest'⟩ + subst hq + change joinEmitF (p2FoldF bn bs bd rest) q' (tRsF e) (tRdF e) s d pos = P2Res.ok s0 d0 pos0 at h + obtain ⟨s', d', hv2, hT', hk⟩ := joinEmitF_spec _ q' (tRsF e) (tRdF e) s d pos hv' hv hT s0 d0 pos0 h + exact ih q' s' d' (pos + 1) s0 d0 pos0 hrest' hv2 hT' hk + +theorem pass2F_spec (bn bs bd pos : Nat) (hb : valid bn bs bd) (hT : TabV pos) (acc : LList) (p' : Nat) + (hacc : ChainOK (bn + bd) acc p') (s0 d0 pos0 : Nat) (h : pass2F bn bs bd pos acc = P2Res.ok s0 d0 pos0) : + valid bn s0 d0 ∧ TabV pos0 := by + cases acc with + | nil => + change emitF P2Res.ok bn bs bd pos (entF pos) = P2Res.ok s0 d0 pos0 at h + obtain ⟨hT', hk⟩ := emitF_spec P2Res.ok bn bs bd pos hb hT s0 d0 pos0 h + injection hk with e1 e2 e3 + subst e1 + subst e2 + subst e3 + exact ⟨hb, hT'⟩ + | cons q e rest => + rcases hacc with ⟨_, hv, hrest⟩ + change p2FoldF bn bs bd rest (tRsF e) (tRdF e) pos = P2Res.ok s0 d0 pos0 at h + exact p2FoldF_spec bn bs bd hb rest q (tRsF e) (tRdF e) pos s0 d0 pos0 hrest hv hT h + +theorem stEF_spec (pos n cnt x : Nat) (hT : TabV pos) (n' pos' x' : Nat) + (h : stEF pos n cnt x = CRes.ok n' pos' x') : + TabV pos' ∧ ReachesStar target_tm (Cn n) (Cn n') := by + revert h + unfold stEF + cases hle : Nat.ble (Nat.add n 1) (fastEvalF n) <;> dsimp only [Bool.rec] <;> intro h + · cases h + · have hgt : n + 1 ≤ fastEval n := by + rw [← fastEvalF_eq] + exact Nat.le_of_ble_eq_true hle + have hreach : ReachesStar target_tm (Cn n) (Cn (fastEvalF n)) := by + rw [fastEvalF_eq] + rcases fastEval_spec n with h0 | hs + · omega + · exact hs + revert h + cases hj : jumpsF pos cnt (fastEvalF n) x with + | fail => intro h; cases h + | ok p x1 => + intro h + change CRes.ok p pos x1 = CRes.ok n' pos' x' at h + injection h with e1 e2 e3 + subst e1 + subst e2 + exact ⟨hT, hreach.trans (jumpsF_spec pos hT cnt _ _ p x1 hj)⟩ + +theorem stBF_spec (pos n cnt x : Nat) (hT : TabV pos) (n' pos' x' : Nat) + (h : stBF pos n cnt x = CRes.ok n' pos' x') : + TabV pos' ∧ ReachesStar target_tm (Cn n) (Cn n') := by + have hcomp := fastCompile_spec n + rw [← fastCompileF_eq] at hcomp + unfold stBF at h + revert h hcomp + cases fastCompileF n with + | none => intro h _; cases h + | some rs rd => + intro h hcomp + have hb : valid n rs rd := hcomp + change JRes.rec CRes.fail (jOkF pos) (jumpsF pos cnt (Nat.add n rd) x) = CRes.ok n' pos' x' at h + revert h + cases hj : jumpsF pos cnt (Nat.add n rd) x with + | fail => intro h; cases h + | ok p x1 => + intro h + change CRes.ok p pos x1 = CRes.ok n' pos' x' at h + injection h with e1 e2 e3 + subst e1 + subst e2 + exact ⟨hT, (valid_zero n rs rd hb).trans (jumpsF_spec pos hT cnt _ _ p x1 hj)⟩ + +theorem stCF_spec (pos n cnt x : Nat) (hT : TabV pos) (n' pos' x' : Nat) + (h : stCF pos n cnt x = CRes.ok n' pos' x') : + TabV pos' ∧ ReachesStar target_tm (Cn n) (Cn n') := by + have hcomp := fastCompile_spec n + rw [← fastCompileF_eq] at hcomp + unfold stCF at h + revert h hcomp + cases fastCompileF n with + | none => intro h _; cases h + | some rs rd => + intro h hcomp + have hb : valid n rs rd := hcomp + change P1Res.rec CRes.fail (stCAfterF n pos rs rd) (pass1F pos cnt (Nat.add n rd) x LList.nil) = + CRes.ok n' pos' x' at h + revert h + cases h1 : pass1F pos cnt (Nat.add n rd) x LList.nil with + | fail => intro h; cases h + | ok p x1 acc => + intro h + have hacc : ChainOK (n + rd) acc p := + pass1F_spec pos (n + rd) hT cnt (Nat.add n rd) x LList.nil p x1 acc rfl h1 + change P2Res.rec CRes.fail (p2OkF n x1) (pass2F n rs rd pos acc) = CRes.ok n' pos' x' at h + revert h + cases h2 : pass2F n rs rd pos acc with + | fail => intro h; cases h + | ok s0 d0 pos0 => + intro h + change CRes.ok (Nat.add n d0) pos0 x1 = CRes.ok n' pos' x' at h + injection h with e1 e2 e3 + subst e1 + subst e2 + obtain ⟨hv, hT'⟩ := pass2F_spec n rs rd pos hb hT acc p hacc s0 d0 pos0 h2 + exact ⟨hT', valid_zero n s0 d0 hv⟩ + +theorem stepF_spec (n pos x : Nat) (hT : TabV pos) (n' pos' x' : Nat) + (h : stepF n pos x = CRes.ok n' pos' x') : + TabV pos' ∧ ReachesStar target_tm (Cn n) (Cn n') := by + unfold stepF stKindF at h + revert h + cases Nat.beq (Nat.mod (Nat.mod x 128) 4) 0 <;> cases Nat.beq (Nat.mod (Nat.mod x 128) 4) 1 <;> + cases Nat.beq (Nat.mod (Nat.mod x 128) 4) 2 <;> dsimp only [Bool.rec] <;> intro h + all_goals first + | cases h + | exact stEF_spec _ _ _ _ hT n' pos' x' h + | exact stBF_spec _ _ _ _ hT n' pos' x' h + | exact stCF_spec _ _ _ _ hT n' pos' x' h + +theorem runCF_spec (steps : Nat) : + ∀ n pos x n' pos' x', TabV pos → runCF steps n pos x = CRes.ok n' pos' x' → + TabV pos' ∧ ReachesStar target_tm (Cn n) (Cn n') := by + induction steps with + | zero => + intro n pos x n' pos' x' hT h + change CRes.ok n pos x = CRes.ok n' pos' x' at h + injection h with e1 e2 e3 + subst e1 + subst e2 + exact ⟨hT, ReachesStar.refl _ _⟩ + | succ steps ih => + intro n pos x n' pos' x' hT h + change CRes.rec CRes.fail (Nat.rec (motive := fun _ => Nat → Nat → Nat → CRes) CRes.ok cStepF steps) + (stepF n pos x) = CRes.ok n' pos' x' at h + revert h + cases hs : stepF n pos x with + | fail => intro h; cases h + | ok n1 pos1 x1 => + intro h + obtain ⟨hT1, hr1⟩ := stepF_spec n pos x hT n1 pos1 x1 hs + obtain ⟨hT2, hr2⟩ := ih n1 pos1 x1 n' pos' x' hT1 h + exact ⟨hT2, hr1.trans hr2⟩ + +theorem chunk5F_spec (steps n m pos pos' x : Nat) (hT : TabV pos) (h : chunk5F steps n m pos pos' x = true) : + TabV pos' ∧ ReachesStar target_tm (Cn n) (Cn m) := by + unfold chunk5F at h + revert h + cases hr : runCF steps n pos x with + | fail => intro h; cases h + | ok n1 pos1 x1 => + intro h + change Bool.and (Nat.beq n1 m) (Nat.beq pos1 pos') = true at h + rcases Bool.and_eq_true_iff.mp h with ⟨h1, h2⟩ + have e1 : n1 = m := Nat.eq_of_beq_eq_true h1 + have e2 : pos1 = pos' := Nat.eq_of_beq_eq_true h2 + subst e1 + subst e2 + exact runCF_spec steps n pos x n1 pos1 x1 hT hr + +-- Chunk streams. + +def cs_0 : Nat := + 0x234449a0a09b2135c1ed8e0e3818269060e32182670609981826384c5141c48301770c12f825d827c1c1c2c304b311ee24258060e0812a812c0544220e98308bc0c22e8303950c22d8304960c1248303860c22c024384841c0dec306eb0c0d78304700c11a4304670c1b88303d20c118022e018b1a1b78301740c1b6c3044f0c1b603044703fe027c03000022c1110301460c2268302680c225c304300c10a8306cb0c2248304180c1b14303880c10242028a0d80181ff03fd07f81aec903730c0fd40708a07e6181b580f500023044103ea06c4382c90606bc18163060d5a183550607b821e0506a30c0f285588a02e8180b9060f2c181e0860d2a181dd83b907700edc0a3160284184358601cc18434060d12180e90610c8181d006073c18430060730181ca86072203d85038e0c0e302aa0a0cf2181c38385070819c89037806e6281b88606d81807e8606d21880501b60c1990306620c0d3c01580021a0a943012f0c0d244218a068c0d0c1a00183011e58298860cae1819e083a08921260886500c0cd819a864d1c0cc401580021a20d03032a06520ca0192025b2c0c881900a063a1831f0610561831d860a081818286060613fc17f02fc2420803021f0c0bd0302f20c0bbc1768a07f40ba80708e102e180708609da183120609ca181680620141878302c20c18683080b0c0aa8304d20c04bc302a305420a80307120c18182be860980180bb86097800ac0010e0ff409f41de0e0c0a181388604e01804503b00c0398304a90c09682fd825504a825d0125849e048e17d5305f00c25b43021f0c1fa0309680c1794307e30c11d4305de0c1f780ce019b03301178b03410c1748301740c05c8304510c1734305ca0c0ee8305c60c0508300e10c1704307cb02601f2021701232a16f4305b80c14343041a0c16c43040f060802c8001110818181c4060810182d48605e818179060f760fec500e10c0fdc303730c0508300e10c0fcc3036c0c1664307b003be282ca060b24183d5060f5006d8502b60c1628303db0c0ab0307a10c1e7c305800c1e70303c802ee280ba0602e4183cb06078009fc0478e0f261813a060ae0182b780c31403843078c0c077c307860c094c307830c090c0aa8a036c183bf060ef61811b82310930382aa060ef018c0487750702120c0011106f6182a4860ee0181b60601fa1833406059c180db060ed21829e06120a180978607a4183b086068a18262860eba183ad86067608340158002221d60305260c0554305230c03d8308f70a1d383074d0868283a5051614096c302590c1d14302530c10803024a0c14343050b0c14243073a0c1ce03073705f82820286044203685072f05e4280b58605da181fd8609e613c00a0008f240384304ed0c13a83072809ca280ef86059c18270060e441826d860e3e180d78498121c70304d20c1c64304ce0c1330302990c1314307120c1c4025e8a09741813e060e161824c05028c18258060e0a1812c86074c183800601661837d860938181ca8601901807b06092c1824906070c1810f86070618243060908180b0860dd6181af0608e0182348608ce182318607a4180cb8608bc1822c87d8141a6c306db0c113c306d80c09e0303ba0c1110306d50284283690604d0181958608681821603271410a8306cb0c03e024c0a0d901820c060d8a181c406081018202008f101afc27c0a0b461835e86bb141ae80a10a01c2181f98606d81835a8603be182ca060b24181af06058c18356860d54181ed8607b41e84503d20c1a8c3069e0c05d0302880c1e58303c10c1a54303ba0c1a4c0a30a028418016060d1a180730603c2180ef860d12180e90604a618059860740181cf06048c180db060730181c98050000434064060cfc0e385038b0c0e28051009f00c00008b06790c0e183021f0c0e0c308530c1524303730c0dc43036c0c03f4306680c1880303620c1990306620c0d40302a50c197c32f02fc1c06483100a068a18262860682180c0828f14195c300e10c194c07b0a0a5018328060a461819988f712192c3064a0c8c2828b0604b61812c8606401808a010f018e00089063f10562831d860a08181828606041831b0605f81841006043e1817a0605e4180b5860c580fec500e10c18a00708a09da1816c81ec141394301df0c0b383061e0c023c3061a0c0ad0303db0c0ab0302aa0c13483012f0c18403060e0c18303057d0c1300301770c12f4304ba0c09f0303bc0c09d802f808f1c09c4300f60c1804303b00c0398304a90c0964305fc0c093412600f80930482fb860be8031c0010e0be0182f6038614087c303830c1218305e706f6282f2860fc61823a860bbc182ed0607a4180cb008f141178303410c1158281740c05c8304510c1734305cb0774282e3060b880384505c10c0cac307c808580c9c705bd0c16e03050d0c1068305b10c16b83040c0c0e20305ab0b522817a060b4a168c503fb0c00ac0010907ee181b9860284180708607e6181b6060b32182cb8603be182ca060b24183d50609b40554501b60c0ad8302b40c16241560a0b0e1e7c505800c1e703079a0c05d03057a0f2c282bb07931409d0305700c1e3c3002c0c1e242b481df1c1e18302530c1e0c3024302aa240db060efa15643bd8e0716182aa060eee182a783831415303037b0c1524307700c0db0300fd0c150c3100a036c183b4860a781829d82a51404bc303d20c1d84303450c03683075d0c1d6c3033b041a00ac000900eb018293060a4a148c500f60c05140010a0e9c1828e0608660008501e60c14583025b0c0964307450c094c3041f011e24125060a1a18285860a121839d060e701831b0605f8182028604461839784f902d6381768609e813cc27900e12413b4304ea0c07b0304e50c138c1670a09c01826f04dd09b63838f8607b61838e0609a41838c86099c1826606053218262860e24180bb86097800ac0010d09741813e060e161825981461412c0307050c0964303a500be023c684a501662825104a00938381ca86093403d8504960c1248303860c122824484861c1210301610c1bac3035e0c11c0304690c119c304630c0f48302fc0c1178306de0c05d0306db0c113c306d80c09e0303ba0c1110301460c11043690a04d01821b04341410c03042a0c1b2c3041d0d902820c060d8a181c406081018202860d80181ff04f5120fec306bb0c0dcc301420c0384303f30c0db0306b407dc0fb41f585942c16483035e0c0b18306ad0c1aa8303db0c1a981ea03d21c1a8c3069e0c05d0301720c1e58303c10c1a54303ba0c1a48301460c05000478907681a34500e60c0eb00ef8a0d12180e906074602cc503a00c0e783039c036c281cc06072a180640601ec181c7060716182aa060cf2181c306043e181c1860cde0dec505490c0dcc303710c0db0300fd0c0da41670a036c18332060cc4181a806054a180978607a4181a4029f140d1430343068228298860cae18070860ca60ce42940e0ca018291860c9a1832586065e1470506460c14583025b0c0964303200c0c743063e0c0c5c2858a06220c2c0638002241410303050c0c08306360c0bf0302fb04462810f8605e8181790602d6181768607f6180708609e00508500e10c13b4306240c1394301dd031628167060c3c18161060c341815a82af0558381550609a418097860c201830706052e0a5001580022415f4304c00c05dc304bd0c0a181e0028204f8481de060c0a181388601ec1830086075e04a40158002220398304a90c0964305fc0c17e4305f70c17d4305f00c17b83021f0c087810a84861c17a0305e50c11e83340a08ea182ef060bb211880ce83d2240bf03045e0c0d04304550218280ba0602e418228860b9a182e5060774182e306018618070860b821813281eb069838097012d0860382de860b7018286860834182d8860b5c1820606071018204060b521817a0609f0181ff062b140fec300e10c0fdc302e00c0508300e10c0fcc3036c0c1664303ee07d8280ef860b28182c9060b2216401610e07c0180db06056c1815a0607b618156060b0a04bc505840b04282c0060afe15f4503c80218280ba0602e4181e2016b140f043057507742813a060ae0182b781421403843056c0ad4049409102c22c077c3056703a428129860ac215801cf0e048c181b1060ab8156c0640e0ab00e385038b0c155030553070c2810f860706182a60606f6182a4860a900dc45036c0c03f4306680c0b38301b60c15002380a0a781829d819f0a88380978607a41829b829f140d14300da0c14cc2988a0a6003845052b0c14a82940a0a4c1813c06066c110806380022403d8301460c148021f0a065c0998504340c0798305160c096c302590c144c18e8a04a618210060494180e1808d005600089050b0c1424305060a08282818302141400301970c1014302230c13ec27d02f100560008b016b0c0bb4303fb0c13cc2780140011e440708609da182750603d8182728603be181670609c01826f02c214136c304d90568281ed8609aa0aa8504d20c13441e90a099c182660605301260504c50c131026104c01c05dc304bd0c12e83027c0c12e025b02711c03d8301460c12c0304ad095612a4702590c0e983025504a207282a21201661825105f7141270303950c0320300f60c1254054034c1c1248303860c087c303830c1218304840c0dec3047f08f811d47010e0518282380603740d88504670c11881a60a033802780478d05f81822f0608b21748501740c114c2288a089e18227044c1409e0303ba0c110c07a8001180244301420c110021f0a04d018195860868182180608541821204201409283041c08342820c06082610442060e0710182038196011e3420286080610001790e0b46181fd8607f20fdc502e00c05083002b0004241f98606d8181f803ef0b2e380ef860b28182c90606bc181630607c40f840db0e07bc0ad0503db0c0f682c2812f1c0f48303d1079e0f381e602952c0f281e401771c02ec01580021c05c00478a0af0141e086077e0ef0503ba0c0ee42b80a028c180618601c2181d983b0140398301250246240ef860ac80e98501d20c094c300b30c0e803039e0c0918303620c0e60303950c0320300490c0e383038b0c1550305510450048816112070c1810f860706181c0837f06f20140001160a92181b98606e2181b60601fa181b381df140b38301b60c0d801af0a06ba14f0503500c0a943012f0c0a88302fc0c0a7c303450c1314303400306023c685310c14b80b90a01c21819d833a09303829406067009e0505230c0ccc0a30a066203845032f065c09987032a0a322828b0604b61812c86063e023c5031d0c0c7018d024a1c0c5c18b031306c444188830c141410303050c0c08304ff03342817e0605f6088406d0e00f40d88502f40c0bc83016b0c083c0248a07f6180708609e2180708609da1816c82d7141394301df0c01500478a09be0b201630e05841816082ba05700ad8902b40c0f6c302ac0c0aa8304d20c04bc302a3099c2814e0299140a5c14a8a0afa182600602ee1825e002b00043414303c004fe023c8827c0c0ef03027604e8281388601ec1813784b0140ec0300e60c12a008d83621a09643025704ac12907024d07402824f0246140904120023e047a0320b023b092c28247822a091603689021f0c0878109808f1a12183037d041605847047d06e62823d036703ba062c904750c074423581bc08d24823301a70344118c903d20c065c3045e0c0d043045502ee280ba0602e41822886041a05a007b0e0896055c13c0e0774182218148028c380618601c21821d013a04d03819586025c04b421701232210a40ea81150844094cb00fc01f609287050d0c056801580021c1058067830c1c103c1828a0818181c40608101820200800802087c902f40c13e0303fe05da281fd8601c2181fb8606e6180a10601c2181f98606d8181f804ea140fb82728a03be181f501b6140b280e90a03a0180e70605841826d86036c1815b06056006c4502ae0c0ab0303d907ae03c8702a20c0f442660a079c1314504c30c0a4c0528a07900a30500bb00560008682880c0f1007f85441c0f04303bf096e281dd0604e8181dc00f6140244301420c0384303b30958280930603c2180ef8607540ea012b8113240748302530c01ec304a10c0e78302460c06d83023f0c08f80d88a01901802486071c181c58607140e205022d045608a4703860c087c303830c0e042420a06f6181ba83f7140b80303710c0db03006b0004281b406059c180db0606c00740504700c0d681ab8a054e1815286025e181e90605f81814f86068a182628608b0180c084c0140cfc19f02881c03843033b089e2802486089009f05015805842813c06066c0cd0500f60c05183033100582821f06065c0cac504340c04b00ca81461c0ca00ef8a04b61812c8603ac1818e8604a618210060494180e180e6140c5818a0a061e034402602c2241048300c6071c2811b0606041818082ff0458380cb86080a181118603101810e8605e200b05016b0c083c24c0a07f6180160605ce0b840618e01c21816e82dc01fa3809a80f900e20b08902d70c0b5009102c21c077c302ce0c0b34166035e1c0738300240c0b0406f02781c0ae006b0a0568181ed860358181550605500a94500f20c0f48302a1053e280c8011f0102007800d8003340a643007d0166280c480d6140f243017e01ec280bb8605140a240708e050c0f045027c0c09e81010a04ec032c502710c03d8301460c09b8136826c04d0481d781e41404983025f04bc096c702590c0e983025504a62805986049807185024904900e6c702410730281ca86019018014008f1408e811b8233045e48117022d045608a009102c234089c110818b1c087c3021e042828108816b140df40b2001e0036000cb037b0c0dd80fd82e01c0db80fa81f303e207c01b41a03b6076816501d2240d783035b057e0380040801e0036000cf01ba036c281ab01ab03520d409019f033c04bc703d20c065c30194068806380c6807d0166681a002921406040c0028c1c05d0302880c05b40b58a041a0384500490c09f80b0027b02b205601611a04f0181dd06029605280a480f6240514001090186180160604d404f0040801e0036000cd013900d600087032b0c04b800f001b000648096012b064c049409102c234077408e011b0234046408c03203c0450088831b1c03f007c8071058448125060388180ad00e1140c4c06c030f01a201301611a06160250500c6071a02fc11b12046202a41178e07101804f009d05f83817c8225058438111007c03103810e8605e4181428605da1817602eb05d2380160605ca09c4503730c05083002b00022009f004f0066381b60600d8180f70603d81816981e114077c300790c06d8302ca021e031c0011206bc181630600481816082b91406d8300d60c0ad0301af01ec280d606035606a0502a8033e01b0700f20c06700cd0a0542064c5029b0c063806e0a01b41814a86052603405017f0c05dc301740c05c83002c0c05ac3028405060a047015e040e2813d02781407fc0500a0196180fd0601ec180a3060284180160604d80cb45026704c8098c1309201cc180f08603be1808d80af14076030257022409d0701d20c094c300b30c09301250a049205680708e04840ae4501b60c0c3801802c21c08f80d8009a009e00ccb00c80c03d83023801800b387023706042818006014402805022d045608a00910023000264113822314087c3021e042405c870211050a28107820c02ca38077009a009e00cc9020a04120b941389203f20518501f703ec04f802780332c07cc09b80f61c03f4301ef03da0b4c0f1025d2c0b38300ae00c00008702cb0c04380bb8a039e07341600e037402bc501b5056006c80d781ae035a0aa8f01a703400384702a50c029c05180500004481510605f81814f860320063c14c8e01b4180c48187030a380c0828f120430300bc0c05c8300e10c0a143020e0c01243027e02c009ec07a8001280810302780c08003014b04e22802486028c180618601c21813586027201b05026505ae280f40603cc180948128024e0784901df0c096c302590c075402602c21c04500e90a04a40a14500fc01f428125060388180ad86048406e006c81b624035c06a00d2029a480d800ca019038063023801800b3890235034a02cc7023101ec2805400f21403c03022c0c06581610a0450021c043022624088c3021f0c08700bb8a042405c400980e12405ac3020f01ec280b28602c21807602c214038430208040a080c10081fc03f4680fc8091140508300e10c07d0301f302702807e8603dc180f5812f1407a40f381e503c604940919a03be1802a02c21402bc301d903ae07500881203a018082816f0036000c900230006280e601c90390071c0e281bd03767806f02021402bc300d501c2280da01b30360026802780333406bc0248a018a0508501ab046803d8701a70342280cf80fd1404bc3019c0458280cb860324015001180032406400900a031c01fc07b0e01b4180c480d501c2380c1003f1402943017e0050023c7010b00a00008700bc0c05c00120a01c21807f806c140838300490c05980b100ec0046000cb015e040c03d8702040c055001180031c08003005f0046000c7014a01902807b060122180618600581809f013d03e43809c80fd1404d409a01ec1c07a0301e60c04a40708a01cc180f08603ba03685011b036c2808c806e01fa380eb0602261808806021c04340828104020204000b59e00f61807d0601f003d8501c40c056c300e001be03780aa00230006680578601ae053c5014d0c06c4300c80c0124300c5018806a8700be017a02e80d312034002a80248e015004bc500f00c02780120a032e180c9008801c63808f808300483803f807e00fa02cc9007a036c2806a806f030401a8051806702fc012808626017600b40b800242400b03016b0c05a80b4802c1c0124301650c03b804d00500004440af860058180ae815c0092380ac002414054c03c8a02a405440a8014e019a580658602940250500490c0518300c30c00b03013e00a22809e00821404e03006c0c04d407d0a026604c809880f22404b80230a025804a85012900582809306024a038c50121023c047403e80b32c01e4300af0c04640698a022e04580328e02261808780c81404380860a020a040c500240c040007f806c1c01ec300fa0c03e00248a02c803bc07700ed01d803a4074012644056c300e001042806f015300f23805700721403583014f0c0534300ce0198026c700940c0124300c501862806000791402f809d8a017204dc05b00b500f65807c80ac0058380248600d8180978601e01804f002300063804e00ea012400909008e011a022403c9201c6180900600481806e0600fa02c80010e00f402bc500d60c01b803680300046000cb00d00c0198089005f00bc043c027004b009288085804f00663805d80e1140408040801e003a008c0019a00581807f80fd1401ec300fa0c00b0300f60c03d007980f1008c48077009b1403b00120a0058180930601ca03900160e0092180410600481806e80db00a8023c900af0c0358300d4007e280688065140280300cb0c026c300940c012430048003c006c00192018400c00118003240384300790c0144300bd00922804106017002dc0248e01fa1803d8601f4180160600921803606014e0294500f00c0118300240c02700758a00481801606011a00b0500790c021c026008f1c021404200821c0090300dc0c0368300790c02bc300d60c034c3003f0c0340300650c027c03100cb1c026802900941c012430048008e0308020003e00a800e4028a20178180140025010438012060058180248600d6000c5007b0c02c405800ab1c00b0300280046000c7006c0c029c0680a01440334500460c00903009b0c025404980911c00903002c0c02340708a00f21804380651400ac0018a0092180410600481803f80491401f403d8a00f2180578600e201c00160e00dc01b05003f0c028c0288a00ca1804f806114017c0120a013618027002b000638024860122180228044011600fc9002c0c01e4300510c0130017802c1c0124300820c00903002c0c01243006c0c016401580031c01e43007800ec01d00309200e200905002c0c01243006c0c01603006900d0013c01992009a18032006300e4380230600481802e805c00b6016402b805600a278027002c14012430048008c2801180021400b0300430084010402c1200581803c8600ee1803286005818024860044007c0230e00481801b860092180360600b200b050054004828027802114013801b8a006a18030000314009c3002e0c00b0300490c010800a80121c00fc300370c0154300510c00c401f8a006e1801a86004400540090e004e1801206006e1801a860084005850030005c2801b86007a00f001d002e2400e001b00320024480188030005c3801606005000905003b0c007800e0a005c1801b86006a1801086002c1801800241400b0300350c008800b0a004e18012060054005850028005c28014800700063800b06004e18011800414008000c000b002a0048b001e0022003c7001a002e00487001100200064700160c001030011002800487000d001800287000e000e001400212000600005000a0c0024004000a1c0010300040c001c0020a000c180030600060008500030002280008000140000302 + +def cs_1 : Nat := + 0xd880c16a4302f40c3610300e10c36086bf036c1c166430d7b0b24283d5061aea1815a061ae2186b8079f1416003057f1dec246b60602e4182bc061ad2359c2b80e0ade5264480e10c1e30301df0c1e18307850f06286b09253141dec30d5c0c493430d5906f6286aa0d520cd0386a7060ed21829e06120a186a4861a90351019d820d259654742061a8209e050d3f1a7c34f4290043d00046453e8614f61812d861a70108050d341a66142c705090c1ce8307380c34b4302230c29a4300ff0a88241768607f618692061a4213a40478e2448181670609c018391061a34346468a84d1033806640009c099c18266061a22131450d0f0e202c1468d0d028c28258060e0a1812c86074c1837f806b000230059860df61824e06072a180640601ec1867d8492140e1830cf807062867b048300043467a0cf306bc382380619e0119864b80012033b80ce0199000240676045e14116422b0a19d01836c0602aa186720ce3144438220043d0004341340619bc1821806085418365860d941b2420b808f221b1430cd6080a28360060b46185070619a0333c1f98e199a1ad4501df0c1650305920c1ba0282c50002206628607b6184ff0607a4183518616e2180ba06197e32f865e89f32432e03068d0c32d46598a03be183448603a41812881ca0a88380598607401865506036c181cc061950329c8e4038b2432986518a1942182a48606e61864f036c1403f430c9b23762864d0350140a94309c80c3248304c50c32402988a0cae1864689bc1432306450a0c9c192c50c850a2c286418c8123463863c86060a1863b86361431d463a0c7205e4480b586133e18070861338188c88618d0319c633061e240b083061a0c0ad030c600c1850309812f1c317c62f060c1c15f4304c00c31685828a09741862b83bc1418143014a25c8286298601140ec030c4d189809602a211189431246240c47188858243061880183f18608ea186d08522de181e9060bac17541a08e08ac1861c8172141144311650c1718309550c40902832b0c1f24305bc04a207282a211185e1820d0622b21861683881430ac17a0a1850181fb8606e61861200e1140fcc3036b0930282cc860b2e1860f87aa14306c0db0a056c1860b86125a182c0060f381855886182430446078e18161807086123e182b3810f25c83860382461406d8309180c2ffc2aa0a0aa6089c87f0e17f6185fc8549141dc030bf60a88284850506c4143b48606b40d589dc8e120a180978607a4185f68bec098a385f4860a56183ac060a4c1847d0601ec185f18be108683828c8617ba1812c860e8a18129860840185eb8617ac14245073a0c1ce030bd10c088c308e10c2f345e604ed1c2f2416b8a178e2f182700e11a4185e10bbf177c2ef45de04cc342ee430bb80518285db0bb31182382580621c809602a20e074c1845e06117209041cb808f222eb845b0a1758124850baa174e120c0011106f6183758617482e8c2348e1742118c503d20c118022f0a0dbc185ce8f8014113c306d80c111c1dd0a08881847b85218210f40010d1722225c504300c10a8306cb0c2e3020c0a0d88455c503880c2e1c30b861708281b98617002df81b60e1106185bd035e140b18306ad0c1aa830b7516e62dc85b801722c1e5830b6d16d82da8701420c2d940730a10d0182b203a500be023c88b61074601649659116be09242d98001202180303980c2d6c5ac8a071c185ab8b5516a4214c90b502382281b580f500023007e861098185a486641442181ab13b91c0d40302a50c04bc30b44168224298860cae1819e083b14194030b3a0c962841a06166839e450b31063a2831e80f801ea000480b2d10522828206060a18594061040185920b2316442c8458f8817340384304ed0c1890304e50c0b401670a0c3c18161061626202c50b1116202c3c587060c2c2c242600a160e12f450b030c0a2857f8afe0760380730609521857c85f01425b4306300c1fa030aec0bca28575047514177830ae70682282e90602e81834c0615bc1734505ca0c2b6c2e30a0284180708615ae4088505bd0c2b542868a15a616c4505ae0c45581a58001180e2030acf0b52285668acc15962b24172814a25c8780fc88f71205000478a01c218562036b01ea0004805990c2b042ca0a1ffc1855d0ffa140ab030ff70c16003079c0c2ac430ab002e4287f9060f261813a061fda2a943c60e1fd4185508fe7142a743bf0a0ef6181c586152e493450d580c3f7c30a9406d8285490a91152006d8907690c0d681ab02a901ea0004a8a8c0698241e9060a6e2714503440e2a24262860eba18542852b143f34302780c2a0424c0a028c1853f874d11e63453e0fc5141d1430a7708402853a850d143f0030fbe0c29b830a6d1f76285338d27143490300e10c13b430a5f0e500b54688110c296c52d0a5914b0295c1ed9a0e3818269060e321852984cb00043414c86098a185278a4e097438525870b1403d8301460c12c030a4704b0151068a4509482802c92cb12290824e0a072a180640601ec1851e8a3c070c3810f8607061824306146e28d851a835e2428cc51904671c3e1434d8a1f00145140a27144c2894222161444183690614400cac504340c3dd030a1a14302836406083018362860710187b5061424334450f660c038430a0a14121ad4701df0c165030a0506bc28163060d5a1835506140027fc4fe86a3242dc430f5413f027dc4fb03ba2c27cc301420c3d30300e60c3d2430f460c02cc30f430c27987a00a072a1879e8613c01550506790c276479b8a13ac27544ea09d306d85807e8613a00b38501b60c0d803740a1e58184e509c8140a7c309c4098a281a0860a621832b8601c2184de89bb06700554909b90c9a2832586136c184da825b140964303200c0c7430f150c1410303050c0c08306360c0bf0302fb21fc2878686134426844d012cb2226745e50a13342660782099505845830d060568184c882ac140aa424c0a1df8184c68610143be030989098028777898504f8384c18605143ba8300e60c25e84bc8ee31c25cc2fa8a12de17b40c500012025b01c18a12d4179c6ab0d0bca1876c8612c425804845e0c25782e90a12ba05c850ecf0c25644ab89551c25504a98952129e25382869a1d90182d7061d8a1817a061286184a100e1140fdc303730c24fc0708a1d78182cb861022181f5036214164830eb50c06d8302b60c0ad03092f0c24b8496079c1c3ab0309270c24943092412461e3c7092112403a8c707830c091830e9e122c24543bb92122418488837b1415243090e121a3a4870e900c241c4830e8c1c24084808e881c3a18308fd0a4c2847d88f9028c383a7060a381821a061cf61847802580a88383a2861cea1847608eb0a16382848611d039b8509600a1014302230c238846f88de09da482750611b0235c46a8e11a8234c46808cf119c233438c9e099c184650299141314312180c05dc304bd0c231446208c3118248727861c9a1845e061174181ca86116c1837a8511680e18508b10c121030e430c11c030e3f0c22a045382fc1c229436f0a11461b6c5044f0c1b60302780c227844e81461c2268302680c22602180a112a1b2c50893083028715061b101844686c014168c303fb0c22281b98a0280023c480e10c0fcc30e210c0d78302c60c1ab43087b035e1260688780c1a8c30b710c05d0301720c384c43803ba1c0ee46b28a028c180a10610d6180730610d21a24501d20c21941d00a073c184308398140e543004e25962842e038e14216842c86791c215c42b03820d304842a0549140dcc30df80c212c3320a10920d40508471be02842208421080386f5860056000850de90c20dc3258a106818323060a2c1812d8604b2181900613601831f0610561831d86104c2094118849824208c17e0a10401810f8605e8181790602d61827a8607f61807086102e1840b04ed14189030813102228408061e14203830c80d500560008a880b0c20244040807100c1838b08030c15f430dba0ffa1fec707f80fee09c4707f50c02281d8060fe61fc812c8e0bf8182fc860fdc36a03f48da4241f8c307e20fc22b8c04f008f2a0bf0307db0682286cd8608a2186cb860b8c183e807cf0b8238195860f92183e38d8e141068305b10c16b8307c10f803620707be05e8283de07bb0f7200ac001161b02181f9860f64166450d7a0c1648307ab1aea2815a060f481e8c3d08e0f3e183cf079c1435b0301720c1e5830d680c09d0307910f1e28070860f18180ef860f0e1e143c18e1ac0183be80c70004383be077a13bc383bc021f143560307730ee415208e0911aa2183b6876c0ed61da490768120a286a4861a8e183ad860eb41d642930e0eac148c504980c05183074e0c29f43074a0e92096c70d370c1d0c1250a0a1a18285860e781cec39c8d2d24088c30a690c1cb8396872c1a4848691061a3c077c506200a13803072309b62868c061a2a1c682670e09981814c86098a18388828f141c403878d0c1c1c2038387060e060e98b04a40c02cc306fc0df40e54706f80dee1258704920c0e18306300c0e0c304860c121030d560a1bac3035e0c11c0304690c1b902318a07a41817e0608bc1836f8ce8141b60306d70774282218498142888306d304d02836806cf085c048c886cd0d962836506c90d8e1b183618d88321014306c00c1af835e83f905ca052806380023a1ae80a0008f1a0384303f30c0db0306b50c1acc35905921c1ac035786ae07bc0ac80280001381aa44ff0a033802780478d0d482dc4501740c05c8307960c32f0306930d221a40347868e01cc686598603ba06280008c0d14043c0638002221a1c34303a01c1a1034181b61c0e60303950c03203067e0cfa19f0652920cec19d46508e0cdc0dcc5036f00a000087066b0cd419a0706670ccc1990706620c19841528a138e25805065c0cb61314703410c196432b8a01c2184de060a5018328864f0c9c19304db160c8a3208506410a19004d60a0c7818e831c823109305831b0605f81831a0630140bd0302f20c18b4316062a01c2484ce060c4c1890504e400460004601df0c0b383061e0c023c2861a0c0ad0306160c2a185030986120c2068307060c1a15f45060a05182825e8609741813e060c0e2604482710c03d8306010c1800046802b000444254860bfc17f0505f90c17dc30c460c31103021101fe1510685e90bcc17880c500012a11cc1f38a0bbc182ec86e214175c2eb05d50682482e981741405c8304510c17384ac0a0b8e17102e185c12416fc3e48a0b7c16e42db041a2416c82d70a081602a01a60e0710184a3060b4c309c2d085a006e6580a10601c2182ce036c141664305970c3078307a90b1e136c7058d0b18305c7092d0c0f380c5890afe15f85588e02e81849386181e186058601c21848f05680f0c382b10782049216d08855e06c42860005570716382aa8553044e43f890bfb0c0dec3054a0a900dbc02800022a0db0300fd0c150c2a101b61c1da43053c0c14ec29d053907a4483b086068a182628617d218295860a5414a429388fa2414885f10a0a381821a060a34145c28a85140a2614481299e0840185eb86062c0c4c1b10e0a121828305050a0608c424c1617a218110818b142384302ed0c2374304ee09d4280f5834c121394308d50c1380308d109b82f04704d50552126068efc0c1c64304ce0c133030bb90c1c483028c0c2ed43070b0c12cc25904b01c1c1025502591c129825284a3117212741ca9a116c1824b0609241824605174e12141bd8e0dd6181af0608e0182348608ce18232046108c0117c36f1602e8182298452089e38227044b011e385cc05088a051850441088010fc13412112e1821806085418212042111243820c060d8a1820504090808023c886c00c2e0c1fc83f806e6481fa802b0004341f98607e2220c505920c0d78302c60c1ab01ef86aa1c2dd0306a30c2dc4301740c05c8307960c0f04306950c2da41db01421c0ed01d98c4f0002401d683ac07561a24901d20c219030cac0a0e7c1ce039a07320e54b0b590c0e3c5ab0a0cf2185a9066f06f80de00fc81450002701b9036c1403f43036906c806d8706640c0d741ad035806a0481a7012f142d0c30b3e068414c47052e067a0cf041d9206700cdc59c8e06620cc041a0e16680c8c5980e063c18f85082b0c0c4418685041c0c1430b2712c02417d82f7043e3817a0605e41817784f5122c78308170c0b7827602da05b20b602729a05a00b3c30e82c70586186406a802b0004984058605541826906025e18586860c18182be86051e141460609780a1c5808db72418143014a018e000868afd0c0ec0300e60c12a430af80c08ec37a8a12da1811007e7042208404b41608fa07e40fc07e32411d00e985dd037406dc5731a0682182e90602e8180b984511417300b385ca1c0ee8305c60c0508300e10c170021c0a0f9604c03e48e0b7809440e500fe0b6e2860c850d0c1068305b00616032420783040168102c05400a7014c028805084086c16a003d00ae00e608701461a05e41856580e1140fdc303730c0508300e10c0fcc3036c0c166430ac00c165030abe157a2aec702b60c2ae41ed8a05581855b079f1416003079c0c2ac430ab00d302455703c1141e4c302740c2aa055380e11c1e3030aa30f0c281298615400918501b60c1df83077b0c2a6428a971ab4286ac06152c15245054806de01400011106d81807e860cd01816706036c183b4860a7818546012f140f48307610c0d14304c50c1d743075b0c14ac30a840a4c280aa850a461807b06028c183a70614fa1853d8614f40964507450c094c304200c29d43a00914e6142450a710e7028537060808023c48a6c14d405ac704f50c349c30d240c0384304ed0c13a830a5d0c077c30a5b09c0283910612681438f8607b61838e061df81438c8614a61330502990c131430a4f149a2825d0604f8183858601ec180a3060960183828604b2181d306094818059860df61824e06072a180640601ec1851e8492140e183021f0c0e0c304860c121030a360dd6281af0608e0182348608ce185180a2f145c28b4516017434114c0b680ff0a8848106802b000434227044b011e3451303ba14111030a220c1b4830a200f982821a06143a10a8506cb0c09283041c0b682020c060d8a18051009f00c0000890a13080a2850905a314283c5060a01c218505036c141ad4301df0c165030a050dd024163060d5a183550607b618353034c140f48306a30c2dc4309fa13f21e58703c10c0efc6db8a0774184f9860284184f8868d140398309ee13da1a24709eb04a6280598613d00e78502460c27941cc0a072a184f189e1140e2c305540c19e43048c0c27601c18a13ac1524501f911ee241b88606d81807e860cd01816706036c183320613980d40509ca138e25807029f0c0d14304c50c0d04305310c195c300e10c26f42940a0ca018291860c9a1832586136c1828b0602360d840008c04b21819006063a184d6863b141410303050c0c08306360c0bf0308200c269017a0a134403fc2a20d134003845099d09da284cd02d514265c4cb061e1c0b083061a0c0ad0303db0c0ab0302aa0c0aa064a8a025e1830806131618305029301460140001120980184c38986050c2ab09027c0c36dc306050c25fc4bf097d0760480730609521812c8612f017e4505f70c17d43023b0dea242f6048c1418c0283830c25a84b40a0bca184b3096512c81768903d20c0bf03045e0c0d04304560a05d0301720c256c2e68a12b21718509550c25504a989520b7809440e505443a16e03050d0c25302d88a0b5c184a48948128c3817a060b4a334448d2600460004600e10c0fdc303730c0508300e10c24f449e05991c165c301df0c1650305920c24d826d8a036c1815b0605681849786125a182c0060f3818495017414249c309250c09d0305700c1e3c30921123e2848e8253141e0c302460c246848c838b1c1550307770c153c1c106981c15303037b0c15243090e06d8284860bf31424243b48a120e24145090407a4283b086068a18480075d1423f82958a0a54112424c0e02b0023c488fb01ec280a3060e9c1828e06086818479051614046c1b10a04b2183a28611da108050a180c14343050b0c14243073a0c239c31b0a05f8182028604461847102ed14237001580011813b4304ea0c23602728a11aa182700611a41826c82b200a00008901af09302438e0609a41838c86099c1826606053218262860e24180bb86160a1425d0604f8183858611821846007051422f81d30a094a02c80010d1174181ca86116c1824b060924181c30611621824206115c22b41af0e08e01845504671422a01e90a05f81822f060dbc180ba060db618227860db01813c06113c1110501460c2268302680c10d8479890860182148641121b2c308920c106030890071028204060808023c486c00c334430d270a1aec301f911ee240a10601c2181f986110a22102c90e06bc18163060d5a183550607b61843c060d46185b88602e8180b90610e421c434a8e07741834906028c180a10610d6180730610d0183448603a418432060740181cf0610c0181cc06072601400010d01901824c06071c181c5860aa81833c86070c1810f860706184298606ec05280638000200dcc30850109e213842612036c183320606ba0d681ab02a90930541a806054a1842303d214210c303450c21003083f0cae2801580011220f041c85231c19343033100560004608340c1918305160c096c302590c0c803031d0c18f83082b0c18ec30826060a28181060c6c1817e0610401810f8605e8181790602d61827a8607f6180708609e005000478e01c218276860c481840981df140b383061d058a00086880e0c34284058605541826906025e18308060c1c18306060afa183ff87fe160a383fd8604f40554506050c09c4304980a1804303b00c0398307f204b01510705fc0c17e43049e153c283f687ec0fd61fa83f4160fcc1794507e30c11cc1f3890bba1b94507df0c0bf03045e0c0d04307d90fae05c8704510c1f503e983ba1c30d4287d001c2282e0860656183e4860b7a183e3050d141068305b10c16b83040c0c028804f806000024020389601416a4302f40c1ef05650a01c2183db87b60f6a0384903f30c0db0305990c1ec03d705941c1648307aa0c1ea03d382b61c0ad0307a40558283d0860f3e181e7018b121e703079b02e8280b9060f2c183ca87931409d0303b80930283c78601c2183c5012312077c30567021e031c001110f0a1e0812485b4221e040db0a0efc183bd860ef41550507780c60283ba854c140de402800021c1dc83b80a0ede03f4506680c1db00db0a0ed21829e06120a183b203d2141d883b0075f0eba483ad860a56183ac060a4c1813c060a461807b06028c183a70614fa1853d8604b6183a3874604a63821006049418286860a1618284860e741839c060e6e1cd82028e0446183990502d6181768607f403b00478e09e6205c5072b0e5413a8707280e4e2044706200c1380307220c136c3072007b62838e871b0e323815089c5141330302990c1314307120c29343070e0e1a1c3007b12028c18258060e0a1812c86074c1825206016618251049e153c3824e06072a180640601ec1824b060924181c306043e181c186090c182420606f6183758606bc182380608d2182338608c6181e90605f81822f060dbc1836e86dc089e3836c0604f0181dd06088818511060da418134060da010d0504300c10a8306cb0c1b28364841700460004a06c4081602a01a6120d861020504050c1b00303fe09ea2835e83f905ca05280638002322830300e10c0fcc3036c0c1ad4301df0c1650305920c0d78302c60c1ab83550a07b6184ff0607a41835102940056000888b710c05d0301720c1e58306970d2c0ee8709f30c1a400708a07663140500e60c049409102c21c077c30564074a017c0479103a418129860166181260a18141a101230a06c4141cc06072a18064060cfc19f454c00f500025433d86791419d810f8a0ce8214c505490c0dcc303710c0db0300fd0c19a0306670ccc0d80374100cc4181a7802b0004380cf85441427203065c068a2826286068218298860cae18070860ca603d40008c0a50183288523141938198802b0004484db060a2c183220259140c80306400c7e0c5c18b031306c46831e0504140c14303020c18d8302fc0c18d010f8a05e8181790602d6184cf8601c2184ce060c4c0b640f5834c241394301df0c0b383061e0c0b083061a0c0ad03061605582830a061306960004806100c18383060c0c15f43028f0c05dc304bd0c12e83027c0c0ef0306050c09c4300f60c1804303af025200ac0011201cc182548604b2182fe060bf2182fb860bec17c0505ef0bd60e0c704860c17a42f28a0fc61823a860bbc182ed0607a4182eb05d50680060c047950ba4180ba0602e418228860b9c172c0ff809f00c00004c05c511ee284aa860b8218195860f92182de0251039401ac000940b7214345041a0c16c8207830401640008a840c0c0e20309460c0bd0305a50b4816880709207ee180fc88f7120508300e10c0fcc3036b0930242cc860b2e182cb05950b24383d50609b6181b106056c182c5892f1424b4305800c1e7030ab10c05d0309270c15d82ba857304e8482b8878f1403843091f0c1e18305620f062812306036c1848b8558071a18809038b0c1550307770c153c2a7054c1c0dec305490c1dc03036c0c03f430543059c280db060ed2181ad0356055203d4000940ecc180978607a4183b086068a18262860a6614c83ad8e0a561829504490930342930611f41807b060a421d385051c0c10d0305190c145c12d8a04b2183a28604a618210060a1e14345050b0c14243073a0c1ce03050109fc1014702230c2384302ed0c2374304ec0a88282750605ae182728611aa1827006 + +def cs_2 : Nat := + 0x4e406192418b0015fe14195c315fb0c57e4315f70c57d8af90c7f1c31e4303050c57b8315ec0c05ac3062c1a4e28af38628259638af295e3140b083061a0c0ac802800021c3180315db0c57603057d0c575462d04bd1c1fe414000011a5740309810a09c4315cc076028e750259145720304860c3100315c208ea282ef060bb418adf95be0ba438add04511456dc2e281450002404aa860b8218195860f92182de86185e1820d062b6056b8515ac0c309c01580011856a8ad495a8326648ad2062b46165c50c1f0f52023c7159f056c28ace05870b080f442658002325668e0a0a156218acb8c0b1403843091f0c1e183158e06c42848c062b141ddc515852b081dc071cbc0c2428301b60c55fc29e0a2af604bc503d20c55e05f48a2ae855cc0ac008f2423e8304980c55b83156c2ad609647051313602412986084018ab31564141ce8307380c2f402020023000040ab0155f2abc556caac162aac55505154f2a9a28aa586096018872862a8a22f0508ba0c5508315400c2ea85d38483000444a9f86eb1454f0315390c54e0a9b9535173a1b6cb044f0c1b603152f0c54b80a30a218210f40010e2a5a10c05152a0d9628a9406c5140e20315232a440dcc7151e0c220c3151b2a325460355122a2a183cb062a2054345b2808d259654a850689142d844320a16be09242da0e07380d8850397011e24a83062a0a54105a80371240db0300fd0c53f4a7e06621c53dc1528a025e185a203461080384e0060cae18a78860ca018a77060c901f3050b350c53a43063e0c2cb431d8a29cc0c1450b280c2080314e01b9c249658629b60b640f5834b0002502728629b05358011800120534c314d2299a532ca6494c62c0398304a90c2be48210a2980087c507e80c2bb081c08f71a52eca5c94b71c52d8a5a86981a52c8305c902aa28a5786295c0384514ac0b7a28a5494a70b5c382060629482b3c2d406302452741fb8a06e618a4c8629302b101b60e07e013a40478d292c3ff850aba3e5828156061fee18a47948e156238a4586155c2ab0487930c5220a430a29085208514800c51fc1c58a28fa51ec7ef8e15280dac07a80012051dca39853c1c3f58314720ec2281a286098a1829989c01251b4a3581551c2a0407b0a28ce29fc3a688f32251983a28a28c418a300628be5178a2e9be701fe1510d0a6707f6286920601c2182768637c4184088528a81c70504d20c1c6430fa90c0a64304c50c512030a4b0e145734704980a510ca210a4704b24852287001402cc3143e0c0e543143c093028a1d021f140e0c304860c50d0a178a1f0c1836d8628561b54a4c8d284a5090a110f742428681250a30661820c0628383db850f6a0c3da030a0f0d745264694162826220016a9103be18a089410058c38356860d5418a0506280e50145140128004ffc073121e92189fe13fb27f44fe0913f71e7a289fa0627e64fc4513ef0c4fac4e806201a06d8306640c4f949f18a27c44f849ef93de0a5c1a60c93dc27b01940713d60c4f544db0a27a4189e88320140c74309ad1052289e693cc06043831b0605f8189e3861e1a184d109a11e16387848627861868513bd2776281550609a4189db93b52766389d886275c187750627584eac4b989712425bc4b68a274a1876e0627484e8cdb00e08bc189d0939e144e749ce139927267098b139105e8284a186271c4e309c5938a1d78582cb8603ba06280008c0b28182c90627044e0415b0e0568184978626f81875606124e184928626ec189b98626e24dc09b69587242448309111aac282a48626ce3a40513620c4d7c308fe067660fc6935c26b2283a70626ac4d5473d8e11e00964513501cea289a70509144d24302fc0c101431347268c4d089a012267c344c488ca0e2a28262862430180bb86097a18997861c9e18995932a26520e54908b60c125831326116066f4713231c86282380626404c7c98e13192460fc310c80a0554313140c2268302680c4c3c3130e26184c2820412260e182d18607f6189821499120384313011c400f9c712ff25fc1ab47087b07b62897e12fb16e2380ba060d301497a9720141a48301460c4bc4fbf8901cc1897686021e4b90492eb073c2897386072601400010d01901842e1c67144b80312db07062842a03762b9a3896c12d725aa384248c98124b4896812cd01c2486f48625924b1c96312c525880964d12c2063a2896012bf257c4ae818116257220805021f0c4ad41790a02d6181768607f61895812af255a389560dc8144aa46e28a101618952860c18182be86253a77245129c2530281d806252a182fe060bf21894887e3141f883f087df1c4a309450a1b36189441287250c4a109032b0c1f243127f0c16d02927d0b5c2893c84081449dc3127301c2286c08624e049bc93683e72449ac15a0a24ce183cf8624c6186b60602e4183cb0624be497892e80e12449680ef8a24ae1892a877e1469cc3124e249869b42a411c12c492c9248a248c352450d460a6606040bf00f50002609211241247c12609123b247429f4712370c48d49198a0e8018285862460088c50a690c48a891312241c1880304e00c488868c0a3496182660624361314507120c485c9098a0e001405986241a482451207240c087c703830c480c901037b1c480490011ff23fc47f0b11fb23f41178711f70c1b60311f508882836a94991247bc31a1d0860288f6863a881b1c3630cd5241014311eb3432285060601c218c998623d0479c8f28e341a0f78159005000045435486a606960004803d20c47840ba0a02e4188ee8cbc144768311d503be28d008623a6188e891ce07260140001150190188e506238a7480511c406e2288df91bc06ba55f4899f30a2720311b30c46c432c852e0d304407086235a46b08d591a5240c80311a30c467c1810a0c6c1817e0618e61810e028c120bc8311971338288c902d512077c302ce0c46381610a0c3203549658d231846285060e0c461030501771c2c14304ba0c45f830386051c5734300f60c18043060001cc288bd11781417e4305f70c45d48ba04861c66e8304750c17783116f0c45b43116a22d0114471ce00a45888120a22c045788ad040c240e20309460c454c0a080011803843114b0c45288a48c1e1c451c8a211410b00488a0113d2278303c9113a227244dc70c060c15780db0a22622a64485550eee285fd86225615283b80e225403f4511270c4494abe8a2246447c88f018b222fa43111b2234445828e1208681888886084018287874014142c30508011e248808738142f44310fe0a238007f85441c43f046e8a21f21816b8621f0138c3100e21ec43d438e0e09a418268819c013c023c884ce0c43bc87707121c05dc310eb0e162887384af087034aa38621c20e4c028000222437424b0a21b60e18510d90c1bac3035e0c43542348a08ce1886910cd21963836c0617301886310c4112e3885f842a1442f485d06c51c10285c38a0d801885b8b7f1442cc8588a216042bc85710ad16e8583518616e2180ba06214c1e58503c10c428c8508a076832d85109e0c426c84d0cac1a42641c884981c42483109116a419bc1be037803f223dcf03722b482807e86211a42288449905242d0c3108013802883f907916700ccc47b9620f041cc19106412241c43107020da0318e339120d82ca05106a0c0bd0302f100560004602ef09ea2458f06102e188318631de184058620a83bf05034c0c2c34310501dec201478602ee188250b02141814315cd0a41201d80a208c12a450af80c17c03096d0c40f82f38d561a40e8310370680060c0479208ac140ba06205a18815860774188141027204c170491023318028810041a14407880702f41c402c565802b0002401fb86200e401880299332462ac5600a31521806a92cb122ae4bed8a1ff23fe0bca0e314418a45861fe4187f88ff01fdc387f6189a143f9c30fe61fca62587147c0c3f847ef8a0a90470448fde1fba19a0702ce0c623830fd41fa63f487e88fd00a56687e70278143f30c3f8a1f903f1c7e28e1f883f0c7e11460243f0030fbf1f7a10100479130e4186938630de182768609d4187d98811143ec47d784db1c39803186309a4287d5986014617030fa201ec280a2800110615c318550c3e6c7cd04a21b56447cc184f14126028f930c0e183021f0c3e407c78f8e1f18487c5846f000434372861f103e18506db0c113c310c70046000460f7d3076283690628461821a061eea1b2c5024a0c1b2030f71306028c17061414569050f621ec2609c70f5f0d5a28355061eb827f850f591eb02dc470f560782287a8863036187a70f4c14039830f4a13d65868700b30c3d0c302460c3d0479f89e30cfc719cb038b0c3cec79d03861c3ce04eb03762b9a481b9861e68602050f301e5e3cb84e60c982a27288da8a053e1879384c5143c94bfd89bd08921260b17f80c5fd8309b60c3c6812d8a2fe21818e86135a20a4497ed0c3c4878882fc1c5fa0309a201fe1510697e40c5f8830f050c3c0c78102b41c0f6c30eff055203d40009009a418097862faa1877b052fa41877703bc143bb07758ee709524877297c8145f183096d0c18c0303820d302476e85e5145efc30ed61daa1178703400306023c685d20c05d0317b70c2554313950b785868705b80c143430ec80c5eb476185a519a2481fd8601c218bd38ebf1d7c5e90917a20c5e787598eb21d6224b4b05800c3ab8bc80eaa04e8486b2861d4e3a94517891d403a743bb921224182a6062f0418bbf0e8f1d1a1d84903450c5de4305260c3a04308f70a1d383051c0c39f473d8a1cf214bb8060a1a187390e711ce039b8902fc0c39b07358e691c23709658a1cd0399c7328e1cc8137c3740d1cc41c7c517db0a397472e0e5b2eb24838a862eac1825e86097418729870b1439447280e4d1c22f0308ba0c0e54308b60c5d10317420c120c001091c841ba0484700c390071e8a1c781178506de0c38e471c0e371c6c38d471a0e321c6238c044baa086018215060d961820e9833145cb4202008f1a38a02d18a07f61871303731438947120e231c44387c70f0e1d07bc0ac8028000158386c70d0e192e461a60a8e152e4028349061c20383c4358e1c1a21a051715074674a06971207380d8870e05072a2870200f614380854c8913bc1833c86070c1810f862e0e182a4861bf437e46fa8df406ba55f4d0df31be437c44219206881c54488400c37ac300e10c6b2030de70c96286f3064614145830de304b0151068de12dde286ed0dd91bb04f1c88dd61baa375007f85442c0bb430dd11ba03738680e10c5b746e3861e1c371430dc41b86134870dc10c2028b688ef6125b3c307fa04f61260703bc0c260428db5093028b64062d8a18b61860bee186d50da4145b00305de0c36806cf845e1c36746ce16b81c3650316b31b2216f4716af1b16455c703880c3620285a90c0bd030d840c4b2c296a41afa1664716a10c1ea830d760568286b90d701ade5e5090d6e1ada1a60707960c5a5430d6401c2283c6061022183c3062d1c186b08d5f0ab0719c90d5c0c493430d591aac28b420d501a9e35346a6090534352430d481a8814ac707580c35046a00d3f1a7c34f469e0d3b1a74096d30d381a6a59d4705090c1ce830d2f1a5c088c70a690c34a81768a1a4e18692061a464890502ce0c137c374091a36346868c8d17099c586890d111a20343c6870d0d1a1212bc21c250e0a1812c86074a017c0478e1a08340c2510dab221270303950c0320300f60c33ec67d0cf919f00e0834c1919ec33d4b268e19e233c02338e19dc0f4850cec19d61b7870ce80c1b60301550a59046710ce119c0337c66e842a3c1b2c306ca0d921060715250c335866a06c01c334428a0e0c58d0316310c077c30cca19920d78702c60c33181ed8a1986067004f008f221a8c30b710c05d0316250c32e43468a196a32d04088e0d12180e90604a61802c92cb140e8030caa0c06d8303980c58483160e0c19d03390a0a921864f8c9e193a3270b03162c0818152861928324c2628e1920323c6470c8d0ca8586460c8b2bee38afa862be61863d03051431dc63b15eb33ba44638099f1403843099c0c4644315e218ca0b0870c6305682830b00c5293230aed862bb01862e04c014316862c84ba1c315c62b0c552b9a48ae58618a0186268c4c1896571c6228c4218821f8d104750c1778305da0c0f48315bd0c1748315b90c1144305ce0b965c80705c60c2554305c10c0cac30c310b78586870c2f0c1068311590c30b46160c2b04380a30a8c272596241fb8606e618ad3863266181b6060b32186100c1f1838306c1b115056c1860b86182c16005079c0c15ec215960c30306050c090f0c48ac686036c18601052b12185fe8bfb14560c307700c2fd807e8a17e806d85054008de00086853c0c24143012f0c2fb8abb8a17d21819d983f121d60305260c14943aa0901ec18ab68be00a32385ee8617b82f6c5ed0bd917ae585eb0bd517a82f4c5e902233423843155c179424aad062aae2f144690e2aa62eec263818b2255343154b0c12c0310e50c0e98308bc0c2ebcaa10a17582eac5d50ba8240dec30ba52a762e88a9c9207a418230045c03163436f06173a2e705cd8b9a2a5e5822206172622685152c0c2e3c2150a0d9618a93862a4a185c48b8714548430b812a3c28441862a3418163060d5a185bb151416de15e08950f0c52642950b0c0eb04088916c42d845b00b5f16bc2d741cc1e2a0c181c6862014540c314ff0a0db0300fd0c2130314fb0c2d1c1a80a168c2d145a2034610805859e8b3c29e23819c0155122ce819892cb1a2cdc59b0b31165e18f8b0b2d1658141070b2a16522c94a700b1c163613b4f0b191630535c7061e0c0b0830b1316245344714cc0c5328314c80c531457e0afb095248a608612da1810f8615da52f050aea22e4242ef0615ce2b882e90e02e8180b90615bc173024c0d0b941856d8ada02843856c0ad720421f202170123322b58a540a294c18207830400b24b2c90ad10710285678ace293a2b205639499344b2c28ac415862b08a4a921ffc18a4906156e2ad855a83ce03140004c057f1dec285590ab0155e3fc890aaa04e828a428aa41fd4385508aa0153c38a40060ef6181c58628f8186ac061fbe18a3c0628ea0d88507690c2a347eb0a07a4183b086068a180c586150c51b050fcd0c055430a811500051870a7f14fa28a32860e8a1853b8a7614ea29d05398508011e747df060e6e258048a6d1f7429a053383fb2c3490300e10c13b430a5f14ba280ef8628a61826a93b914295452a0a5314a429442629a289018a22860930180a3060960185238a46148a1c00900b30c290852083951c0320300f60c50e430a3a147228e0a1992285c28c47c30e145250a850a23088010f40011128461847985143a286c50d024a241b2030a160d8a281c4061ed4185090a10141e283407096282818503859414503c30a030d5a28500940913f82dc49140413ea27cc714990a3d30309ef1e9027b07a3120166187a18613cc27944f2039524278c4f113f41c19e4309d913b00e0834c1227dc27482a20d27d2180db0627cc144e60c98124f8c3029f0c27100c58a068218298860cae180708627b4189eb060c9618325032a0a3023dc893d20c0964309b2063a284d689ab0a0838182861350269c4d308202426904d189a213422680965991e12189e1060c341815a06132226404c784d2244ed830ef80c26244c413b013084eb8b0ee912f80398713aa0c4e9c3096f12dc25b04b5896a12d240e047ba12f7e184b102fc141178313a00c25744ae0ecf1c4e6c313980c253080912e41c16b830ec50c25144a18a271a181fb8606e6189c4861d760fc0274808f2224e80ef8a127024dc75a8e036c184990931125e389bd892b125424a44940925344dd449113731c1e0c302460c4db448a0e9a1c2444488090f26cc487480626c22410481935e120014cc4e01e1d0c1847e8158011e349ac08f71223d828e0a086818479032810223847808ef0e8a3873a86269a1847488e811ce239847288e421fc789a28609d41899f88d6267a3846588ca1192062c888c7118c12f47132e11845d3868e4d0c22f0308ba0c22e045b0a116a4c94508b10c121030e42115822ac455046619306498f0626361845188a2089e388640502aa18989889c1136226444c0896261a784498417011e3471506081018446888c0b46381fd862606180a106110e0fcc50e2010fe1ba0702c60c21f043d83db1c21dc0ce009e011e4435186079415ec4087410e64bd8706920c21b40a10a10d821a8434886710cc21946561e10c4218442f885e01905842e085b25be216096d8383344b64303730c37dc1b4805400460004a084b1094212464c1125a218967861bd618070861bd01d505083706624b2c688340c1918305160c096c302590c0c803082e0c7a28607031722102831d8625781495c061042207c17a0e103a03fc2a20e1036349c480e10c205c30816102a0b640f5834c2a3720312a80c2038406880c254820143061a10004a743fe129b241fd43fa03b01c1fcc6d8090bf61c00509760c4a40307e40fc41f843ef9205f818945061b341f582288e1b2c5c80505c60c4a0c3e7032b1c1f283e387c60e80443e205b1141f0893d090f7c1ef493987b81b02581f98624dc186bd060b2418935060f4a49983d107a00f3c1e746b61e0f301e5850d680c09d03125c0c1e383c60a0f1049583c102490b68546b00624a6183be0d5c14356830d580c1dcc3b907711aa248924076a248a383b207631a8c1d783ad9624801891e860ea205185074e0c1d343a592371c34dc312330c14343050b0c48bc3073414d228914861a441891206059c18392072312683839017db1448746898a0e2e1c544871424302890a8d0b093038909070209483837e920c14482037a8a0924181c306043e183780486141210306ed0dd6281af0608e0182348623f8181e90605f81822f060dbe339c36d06d923e858222060daa1b508f78e0da01b3c36706cd0d981b2836486c70d8c3355506c20d802835f06bd07f20b94ae6960d741ae40708e326400044036c0c220016a8923ca1835806af0d5c1aac8f1160d4a4780501740c05c8307960c32ec34a11da1c32cc308110a1a280e90a23a6188e8060730181c98050000230972062394188e3060cdc07e447b8d0cd846f41b388112446ec306620c198464a8a1390188d9065a06823832c86580cac26f0905280c46a8306450c88190c190122346188cf86380c6e25809119a0a0bd0302f12596288cb06133818635850c46077c502ce0c1878302c20c186c15a0a231218443070e0c1a3bd85060a05160004684bd0c12e83027c0c181c30302711c12603026f095e10e070600011a4b2c684a90c45e0305fa0bf0311870c440c084407f85441c17a42f307e31c11d4305de0c176c8b605d422d24834c0502da03fc2a20e22ca188b18622be188ae05b30002308ac860818181c406128c188a9060b3c16742ce059b0b32582cb86183a164c8a30e228618496860b0244fc501740c249c30c0e0ae4302c700e10c44dc305620f04157c2af01b62c44c42ab112f1a2fe82a6837b1c15282a411c0000240ad20601fa18893860a8011bc0010d0a7a4488507610c0d14304c50c2fa0298052d0a564888c05250ea83888a860a381828d9111141440287850e0a18142888087383c2f4027e84fc11c24827a8511b813bc27704eb09ce1394d04e309c41380710f40c135426a04d30e324826784cc142ee430711098212fc5da920e1412d08740e2a8e18870849b2e8c3824b8492140e18310d809001ba88b91206bc182380608d2182338621a2180ba0621941140227044d2a5e588628621861821b0435085c048c8842b21782820c060d8a182050409080c1b00910b60c0fd496589027c01400010e2162182c90606bc18163062158181ee087703380278047960d461834e83c7078c05c8903c407862ab0706950c42801da886b1c42742b203a703a44843206074242605039107200e3c1c6038a071219e4f0b520cde0df01bc01f911ee641b9036d06d4422c1b1160cc81884406069c0d305034906900d1c8409220fc1883c8b3806660cc883b06480f9874839832206420c7831e80f801ea00050082b0c41b8303050c2c9c17e906905ec0bd417982ef05dc2c79304f005be418c710590c342840502ad05543815402a605482c3014e029a0c18782be8609801814606209609e813c827604ea09c857e9e075e09880730e09521857c060be0184b686207e1881c85e103c040d4572845c0316781a0018608aa05e034d9502e605b40b6102b2407fc0a60c351a0508300e10c170009c81362044482de161901fc16e09050d0c0568071101d1c403c0bb003405e44856592cb140fdc303730c0508300e10c0fcc3100320041ec04089220003ff8502b60c3fe8302ac0c3fe02c00a1fea2ac45148b0c3fc830ff104e8287f7060f18187f58253142a8054f09036c18929861fc80e2c5147c0c356030fdf0c1dc030fde0a882433406059c187ed0fd91fb03f5c1e9161fa80d1038a8e098a187e8875b1414ac30fcd0c09e0305230c3f2c7e5074e1c3f2053d8a1f8a183a2862c34142100628c0187e0061f7e29b8504050c3ef01768a1a4e187db80e11413b4304ea0c3ecc0ef8a1f601826f008f14136c3071f0c3eb47d60efc1c1c6430faa1f503e9c7d2921f4809f05070b0c03d8301460c3e7c3828a1f3a0e98504a40c3e6837d8a0938187cb80c81403d830f930c0e183021f0c0e0c30f8f0908287c6061f1611c0504690c119c3142c0c1b6c3020d25962836c061ef8187bd8a22141b4830f770c10d030f740c1b2c3024a0c10702da0a0830187b80388143dac7b48f6701c2487b1861ec4077c50f60281e28163060d5a183550607b6184ff06033802780478d0d46185b8861eaa181e0861ea2187a809f314050830f4c0c039830f490c3d18300b30c3d0c302460c3d041ca8a1e7a181c5860aa81833b8123120e1830f381e6a281b9862382147998f320cd03816706036c187970f2c144f8c309c50c0d14304c50c0d0430f241e463c88790121e3e148c50f1d0c96284db060a2c1812d861e320c805031d0c3c5430f14060a287890636140bf030f0f1e1a284d1016b143c307848a1334139450f050c023c28f020564014000112035e1260502ac0c0aa8304d20c0d3030efa1df0282be861de63bbc25d0e1ddc36dc50eec1dd4280730609521812c861dc817dc50ee10be0284b686043e181c1861db8182f2861db045bc503d20c0bf03045e0c0d04305d20c05d030ed11da03b34709550c4e542de8a0b7018286861d90187638ec605e8384a18607f618070861d823b000a10e01c21875e8597143ae42ca0a1d6e3ad875a00d525965815a061d62161c2c203d109960008d03ce0316283ce061d5a3aac4928e04e8182b8060f1e18752861d483a887508e9f241550307770c24483054c0c3a5c74b0e941c3a4c7488e8e1c3a30307610c0d1430e891d0e1d60705260c3a04308f70c1d383051c0c39f4479032803ba06280009804b61873c0e771cec09289050d0c39c87388506081c1880a88e709fe02780479205f81873602231439a4308dd0c39a0274808f1a399430e6409c028469060e3e181ed860e3818269060e321872d04cc140a6430e571cac05dc704bd0c12e83027c0c1c2c308c10c230038204a81cf2487268611781845d06072a1824d04981439242490a1c8e22c4504840c390c304700c38fc30e3d0c0bf03045e0c1b783069b0c38e071b8e361c6a22788f9191c64226850e30086c23cc704300c10a8306cb0c224830e2c1c5638a4202920d80182d18607f61835d8606e61871292cb12388c7110e1f1c3c38741ef02b200a00005283db0c21dc0ce009e011e4435102940056000480e181c2e05c870e140c07fc04f806000044834906028c180a10610d6180730610d0187058e0a10c8387040e0710c0381cc06072a1870204981238081c58a0aa81833c86044e43f8506300c37f04298a0a92181b9861bf206d850df40cc4286f982a51437c0308430c0d14308400c37ac300e10c37a43033311ee2432586106818323060a2c186f18259140c8030de01bbe37786ee8ddb2c376831b0a05f818410061bac0bd050dd402d62827a851ba20384508170c038430dcb1b943724167120c3c186e2861b880aa8504d20c04bc302a31a26286df8dbe0afa386dd04bd141fec303bc0c181430db501ec286da0db301cc383f902591436b82fc8a1b56146d407e7042203fc2a2151b48186d1847514177830da005f82822f061b3a366c50d991b30171870d940c364c6c907c91c16f430d8f1b1a36302d7120818181c406 + +def cs_3 : Nat := + 0x35803077e0c69d06ad0a1ab01930c0534d41da03b30e34d01892006247a18d30860a4010f40010d34be34dc512330c1d0029a59245e28d2b0634aa3488512240c0b3831a4f09b409dc00090349a18d25860e2e0a6451a490c691c29a453484482471a3e347a18c071a3a0c120c001090dda1ba88b90e346c68d43728e346668c84b00d346068b851a2a34526898d0d920d7c283851a140c0fcc3036c0c1ad431a11341e28d058174141a60307960c68108ec808d259644d0181df146808d0011d01c67f81ca8a25c8188e506238c1833701f911ee3433611be1467d83310a236e18cf919f01467b822424061a46a8319e833c8678417e1218e61817a0605e4188ca92cb122670311910c6764302ce0c675c1610a0c368bb0519d20c460c3060a02ee28ce704ba149018299cb01ec2830086400a18254863386670450c440c1218319bb33703684699b50c1a60299b10c4594311630c66b48ae8a0b647098519ab33542518711520c669ccd119a01c450c305870b080f4426580022a666c301740c249c319970c665489b8a332044d05257a0c663432575238000046036c0c03f4311270c1da4319870c1d84303440e2a240c58533064464505220a42148021e80022c14703197a32ea7f0c719700c0bb43196c0c659c87a0a32c665785195d32b628cab10e74f8038872864ab018ca8062e1418ca586eb141ba0284700c6520ca390d11c05d031942173028c9f90c31495183193c0c105c047892a4a18c9c06326a0fd49658d07e618c9883e6000230c9782c61464b45ba0a324e64945192007822834a86323a18c8d06322e0e8484ba5d224644833b81231a94cc3252f0c64208438c981c6414319023ed224c80252720ec19203e5834b000071291031e57a8384158620da0318e338e31fa63ec518f20c63bc318ed0c63a4401890afa182600602ee18c700631b002349658d095039e448af80c41082896d0c40fc325050c94040ba0a319693d461a8d02841807086318818c6098bd317638c5c90091462ccc5918b1316062bcc569a20009d8c502b60c629cc5324e4155c2ab0b189f1fdc28c4e189a142a8054f0a036c189298649b618c4a189349ae3926a06311e6224504c50c3f4429812cb1a6210c4198820a4648c3f0520087a000888fc80e94997870fc50c1d14302530c1080324c430ec10147187307f628c380bca1413a4047894978183910630ce6198f7b0e30c492d45070b0c03d8324b10c6150c299851495661287c78483000485252863088610c7c30e0db618c1f85493e1924e86307060dd24d0e0d9018c191831492660a4924910c6094c1217db1c27f8303d20c60852460a15581834a86303860692438e49066050c0998121e7a58c0789de1419e43180d301860281b892301260181b10e48e82714483450c5ffcbff246f1c14583025b0c91a4297ef48cc29231a928140b0830f020568281ed860558189dc8609a4180978648b018be717cc2f9609602a21548a201e81b08001205f0cbe1244c1c0f48317bd2f789118bd9920b7019220062f5e5eb0bd597aa2f4e5264c80e10c5e9475c93841c5e802979c2f34282c006382814bc88604e8186b2850f1e192168613bc183bb8612241947c06485018bbea4252eec23dc8a4200c5dc8bb78a181c14343241a0c39b8317682ece9054717632ec2285e1850e3e18baf1bde141348304d14be424bac860e2a18baa828c1412f4304ba0c09f0317512ea0393c724030c5d10317420c8ff03173d2e788fd8723f30c5ce071808971c5cccb9923e91c168c303fb0c1aec323e20c8f7c317db0c21e0306a30c5c9470a0a2e40141dc83b801ea00008171c2e365c6804692cb2a8f44323cf0c8f343170e0c8f24245818a00024010f862e105c18b829703245c086f98c951c21192f9094784151df862df01934516f7447c251db862de418190062ddc20981821d28245ba8309600c5ba06eb25bc1a375007f85441c0bb4316e3475a291d506474e183080647461fec523a10c5b251cf0a0bee186d486472e5af91ca0e2d723650516b40c8e443238e0810291c596a8471238b5196a22d405a7cb4f07a4018a52650969c0b0028e0a051ad818b4c057700d60004816950c1e3c3237a2d228de070d610efc28b458d5c145a24b4416851c3538316820a7828b40236c141d60323690c8d9c3167b14f628b3c8d38083e008c0009446c01839d060e7018b38235a140bb4323550c8d4830d1a1a323458716632cc459807234d0c59783234a0c5964b2c049c1c5958b2a84981a594831651467c120c001112c9c592c67804672433b92f90a466c1822c845505160004823320c590c3690a04d01836808f31258f91940a2c7658e919216362c6859190062708182c90606bc18163060d5c0f791760d2c5858ad18c0e2c5005d0516250c32e03068d0c587c308110c1a243161c2c3428e9406074018b0b1615461838b06960c2c163278ad21501fa18b03960414580c8da8a192419181862bfa57ec515f90c57dc315f62be831e4703050c57bcaf60a02d6184cf862bce5798af295e20c3a0b140011d058418aef95de18c038aed862bb018aeb22e514574862b8db71a573c1388a2b9831404a2de0c5720304860c17a481c08f71c5708ae085de1c45bc322d408ac25169062b6e30d4489550c1704315b42b6616f470c2f0c1068315b0185a3db8715ac0c30a0322c52b4c5690695a32b448afc6a2bc0c5670acd959a0f38482bd852b2e56500708e123c2044507860c56380db0a18041915786455a18e5e0617e6180db06454e19152862af28a885229e0a4c2847d062ae055bd14c02580a88583a2862ad01080515662aca14180631c672a5588ab0a28f2ab25558aaaa2893c552c3154921ca28aa29544117438aa19540142ea85d40a44fe18a9e062a721913d86307e14a988b981289cc3089a0c54b4a95952a0848107c047992a505494483880c899c3151d2b48284418644c418a8b15112a205434a859644b81912d0616be0e78522550c0e603150744a053fc715a40c53f91260a4492181a606448c18a7a0657140cf041d0448480c443280616740cc49658e10681859a86166226c04863d143028a738629cc5394593819600460004c08200c53880708a29b61890502d50a5360a6b14d529a64911794c701cc3825486298219113860fd018a5e0644462b9c1a00183011e54a5b14b502e438a5906296252c0a5714ad295816f0b0d1e4432182060629485288522110c0dcc301420c8834305990c88283149329223fdc722040c52307f90a0f2618a44148743fa38a400643f4190fc0615285690521f50c3f58321f10c0d143018b0c1d74321ed0c87a83146737de290f40614ee107c0478d28c0190f0945b14877830d240c4b2c284ed0c6f88308110c5150def0a09a418a260a5309960008907150c1314314480c511807b0a439809602a20e28801805986287e0e545143c287650e803d0361000260a1b04861486f830f860c1b6c3142b284c86e8721b60c1b2030417011e250d90528343da050f660c5058a0a0a03be190d6140e0d5a38355062814190d386434a189fea1a0144fdc9fb13f54332489f78627d64fa4513e80cc8289f29ea9144f889f093df27bc195cb21920c4f5d0c70a136a39e45218b0c26c030f150c861411884981a18d8313c91040287868642fe189e2052786186406a92cb244ef49de02a901ea0004a04d20c85d04c4828f1c4ec4313af1dd231407216d275025bc76f92274c3b70521670c11700c58a2742257434c0e42c04e489c8a5bc2216946688942b04e202cb8e03be182ca060b24190a8138026fe16240629499344dece0a091d58184938626f04dd8513730c851830e9a0c4da43037549e02509f0626c4189af09000a66270088e860c4d709ad1357426c6c94b13520c4d409a7a1301c4d24309600a10143212b0c4cf86898a266c13145071102fc03d40001002ee1899893302e9c3508f86116c1837a85264c22c4521160c11bc001094224228c22999b000d60004c1318262e4c5898a12262409a05130f0c8424313080b46286938526080508512cb0a84042a0fd0d580d886a0fb0c83e097d069b1c05c8312f70d24280a30625e24bc097792ed240748312eb049216d0712e70c4b980640a25c4189700641d01896d20e314212464c0a41be4b2c50de90c836812c05441c8354320d125782495c92b7043e3895a99dd1205ac302ed0c4ac50630a25584aa8520c10c202806294991a4a943060c0c4a8094f929c0fea09bd3e01a18a01494b05fc1417e4320b30c82c43128c0fb60d000c1808f2c366c320ab0c0cac312810f8e1f1839f80012816d02927d384c250510624ee1904f861b021904d926c24d68bb0912670c49949320d6c1c4984930208f24b649684089a24b0822451a730c820c3b98d531c8204312462488351c7207c01ec2903c1239246c39e491235246848c828592246048b0915a06d244a0b38d04e00c4888d2689243c1890e206514486029217242475846920f241c4834d1f9140ba181c18640b21902b0640a047e48fc11f64098588f891f04092388f72046141014311eb0d7c283870a0c0c4b2c303f30c80ec8f31a0c198a483548f5a1497c8311e10d36288ef11dd19765c80911db23aa204469a010c474c311d1239c0e54712e40c4728311c74054288df91bc4b94388dc11b51446d08d891b001c249012860c82188d186403e1827f809e011e3417e062334192de0533ba188cb86282596388c904e51446403100a402a188c6918c23125b509060e0c80403118051ba290058604e2188be117b400a388bd05fe3544382fc860bee18fff863372178c491720c1778305da0c45b431ff622ce45988b21ff122ae688aa915422a605089114d22987fa460e83e72a7f9c31fe222767f792bf11180c18fed86226418fec8617f618feb063fa61889303621244948921123223e447888e8be93c7f3019707cc1823cc291122216442828592220c7f0c5110004462887e9fbd1443e4301eb069824fdc863f6c18269060e3218689853f62181460621d61c28ae68e21d24398870a5d224437437a893f501886d06eb140d78310d521a8119c71fa00c1b603152f0c7e6c31f980c7e5831f930c1afccee893f201885983f116f834fc6060d461885401741442982bc0a15581485190a00282000481f7f0a6460eb089213642681d00e3ef81884906212294cc510900a8828fb6908532022714910810c41fd293014500024083c10741441c43107020da0318e33913ec2188348630140bd0302f20c0bbc27a8a163c1883290631463bc3080a018a52646905409a4280978616180a7038a8e20a015f45028f0a0a3031f520c1814302710c41208239046095039e4a90442084244b686208040e851037206240c0817902d2c40a91100a077418f9f863e7618f9c863e6e1880598b4124020f9903f31c62b4310004ec62415b063e5818f948ff61fea3fd0a45961fe67c9050fec1fd6586870fe83e3a3f9054c921fc418f8d060ee018f8c06059c18c468fd53e240cecc1f953e1a18f85863e103f18f830e1f80187df8fbd0808023c898720c0fec3186f0c2f28304ea0c3ecc7d91efa1c1c7c318640c3eacc2f8a4f0e202c14b0fa4480c287d10498143e80c2b8a1f3a758448f9b30a4287cc0f9725c83807b061f26181c3060c6018f738a360dd445c8898450c11a430f8828582836d86089e1836c061efa3dec7bd232f223ddc30433000220f6d061ee41b2051ed60c60b47b28f631c7b4430f5f0d580d8870f5d1eb83d6871ec81eae7b18706950c606c30f4e1e9a039870f4a1e8c287a28f4314091831eb61e7a2854c853d6618f580606e618f55861e603cbc7970f2d3d52584e2853d4c1879297fc145fe030f1d06624b2c709b60c7a7030f190c822418e861e2c3c507899e97245fa0309a201fe151070f0c278828bf1061e0818741628002243c0cbef8907b61877f82aa1413483034c0c3be877c8ef61c5f4831e880c7a142540e791c7a08317c60c25b43021f0c3b78f3e8a1db479e8503410c17483069b0c5edc309550c5ecc30ecb0a1a287649e6b1286381fd86259614f33862f4418f30243514160031e5b1d523aa0f2b923caa1874d060702120c0010e2f022438ad20d3c9c181a2862ef218293061d021847b860e9c1828e061cfa6c945025b0c5dc0307400a790030e6d3c7628f1c053c6c18bb0861cc43980503db0c78c4302990c5d58304bd0c0a185560a1ca61c280a500c7000250f1308be3ac23445e061174181ca861c943924248012324391c7230e451c88390472008a84be484f0d860dbc18f0c06465414215061c5c22485172e0c38a0668891a4e14f03061c4a38911ef8e1c36386870c97230d305870a8e1225e638f00863bfc18b8a8e092e2638702a5d212381024c091c042a6007a800120277830dff2e14286fe970714152431dec2e0228ef486068a1842006107e14b834c0d2596186f4863bc2186f30de51bc8378c6f11ddc3437686ec8dd81bae77606e982ed3c37446e80dce1a038431dd30c3718ee70efc1a3704b6a092da236f46dd8d0ff6181de060c0a18b65062d9018b62861b5c25d8505f70c36a86d296c01c368431dbb0c76e030d940c76d031db00818281c4060810182d4864b78149390d2712360ced48d7c1af60f9cb07a90046000060d7645d824ed105801476786b585781c5a506b28a3b34183c501231435883c30a2d1c18ec9077b1435746ad0a3b1c18ec6061a9476106a1875824760073c8a3af0186988506018c719c91d730c29a431d6f0c0fec30d240c348c68f8a0c401468e1d671a26346890d111a20343c6870d0d1a129f01087050c096430d051a08340c37d9219fe33f867e8cfc19f633e867c8cf819ee756950cf146742867725f212754830ce80c339813c0a3a9a1866d9d44082e023c886c50c750035f99dd1a168c306bd07f293c071633199c33346660ccb3a746816306198c5f6c50cc319841a8c70b710c1a6c296240d2623dc69d300c74b465886891c0748302530c02cc30cac0c32a8301b60c32a4b090a2c1c186508606ea93c049d1d0c326864c09054a18e8b063a2618e8706190a9978495f30c742430c7718ec57b070c7018de03847099c0c464431d020c318d1760a0c2c03140a08c2bb618aeb88031473ec31cf90c73d462a15cb1c0ec031cf00c11d4305de0c1768303d20c56f4305d20c56e4319b10c459430c350a255430c3306562861885bd1430c061711591c30b46160c2b4b784861483f71407e447b891848308c1f98e06d8181f804e9011e346100c1f18385678902b60c305c30c16182a1e7070c132b2c28e63159014301c54f09036c18601062b12185fe8bfc2b06383b8063978185fa0bf217e214f0909050c2fbce5a8a17d2185f3875814149830be5093024e578617ba18e5586394a2f3c4708e2aba18aad06393c18aa98bbb17742ee05db954a096623dd104af08702887286074c1845e06175e2eb8ba30e3926185d31c8d17421b88903d20c54d8306de0c721c5cb800118111031c820c54b030b8f08521904686cb0c2e305c58b8a17121024202008f3a548431c770c2df02951a0c2de035603621c2dd8a8a0b6f16dc543cb0b662a16284340638dc0e5c0118001202d6c5ad038e1c540c30b50169c569068b4c1098285a48b48168e326089c5b448c28e2c033c1074112120316167653b851c560c71405959c4d179448e23860c3c18161063884185848b08299438a6406387612a073c8e15f22bc04b68e0c60185768aec207023dc88aea22e4282ef0638641834d8602e41856f05cc0930382e50638581856c14ab142b5856a8ad4294c482d70615a23db849c1f0284285629c1915824e1090ffd0f500d88714920c2adc55b0ab515687050a9c120c703831c0b1546564069c090c2a749298a0ef61854c861fc4186ac06152c0dd52780e15285690494760c1da430a8d15180d3070a8a28e0241a286098a18dfb061f9a180aa8637e418df78628ca1853c0a7714ec29d453a0a7314e43ef910a6f37d08778704f31b9c280708617941452f872809c8008c0009403be18a29860e3818dee06289018a228601ec180a306095e10dc0008c379e5100500b30c6f2d2e90a01901851f1439146f14a1906e81c6f04a1609145250a48f90e1446288451007cb06960004c0a1e3774507c70a17142c549468a141ed428dd98628281850393841428145020a030d580d88a9ba713f66e90709f213e227c0dd01213d23d0c51b9a0c6e58309da3720275c9f709d20a88689f486036c18332061398272c9f18e138a184e209c3068238298860a5c1a60480e10c4f604dd13d61c0cc4965890c940ca828c08f72426d44da02591c6dfc31b7d0c0c1431b790c26904d1a17e13404b2ca8f090c4f083061a0c2648db80efc1c4ed83098b13146da84c189812a6d944bd93aa1c4e9c3096f12dc25b04b5896a12d2259c76c096336c0a84af93a0146d703139b0c4e6030ec80c709828ec4128e6d48709422596241fb8606e61849f893e1d783849d09393694380db06368a16240629499246d0860697201c6cf4307830c091831b3712266cd09b2890c1214687480636584d7c50e860c23f447e13591c23d847a84341c23c84789b221c23b420f808f1c4d3431b1c11c64d14704ea0c6c50308cb119423242629236221899708c2118022fc72696117a22ec45c1746246c24308b0337a28242061c8422b045588aa11524c74453131b446c0c306d80c055429afe112a109020f808f2a224c20b808f1c38a830d880a6bd466889111622284448142246bc031aed06bc281628002126ba443d087910ec2dc4b1ae60c21b8d710a35bc4ba851ad825c828d6912dd12215042903731c37e03084b1094212464c1125a2189670841107e20f841e8de8107020dc41b08350c8cb8194081114096c302590c190429ac00c20ac3063b0c4ae81810a1046258049ab90c20740b58a10360fec500e10c205c30816102a0b640f5834c2a3720312a80c6abc31aa82534573469aa50c4a503f887f00fde4a3c3f307e50fc882c03ef25f25c06580118001184a2831a980c365c305c60c6a443e60a0f9449fc507c420244b90707c224f21efcd460d802596681f98624dc186bd060b24189350635041e6c3cc87980af0586b40604e8183c887900f1c1e28091950f1049583c102490b68586b0060efe69cc5124d0c356031a6e0ede151071a6b0c69a03123f02b0023c6923d0c1d4447b8a0e9e697850d362c3424919860a1a1828586245c34b039a9a562448a02798dce1a34843948d1e0e4c0b38b1a500c1c8038f1a4b1a1c5c38a8a349218d2300f5000234d2206348218d1f860924181c3060de268e8506ee346e28087028b0002302380608d2188fe06033802780478e12c01422f06345c1822206345018d102046141b083609a160d78684c9659a0d700db0506b623ca28d0706a90d506828901740c1a60307960c681430cb30c1a2cd008a23a432b0491d00c0e603039300a000087067f239219ec33b81232a47183066e0cda19b08df1223744f984835d2afa288db86139018cf80633da18294062352192832399e724468c319e20c31cc3021c05182817906232a18a431406270c4c1894cec9e059c1830e82c50002300478633a818ce9060c1a182c30501772412f4304ba0c09f0319c92b9a2424c060c048014504a90c45e0319c00bec410870c440c17a8cdd0a22e4142ef99b51417402288a39be17208b18e22be188ae860b6416bc2060e1edc184a30622a2167ccd283f009d2023cc85970c667c8a289341a45082c585890b10161c2c205833336880ba06124e18ccb05710ade15b807096226c5640519903fb6288988556225e38cc6860a9415208e08e06d603d40008c01fa18893860a8014f829e91210a701d84d03440e2a240c586330418cbf05222a1828e060a364440b0d0d32ea44105196f11c013dc1769232d60b545196509be1ba0690f40c6588304cf099a2ee47195a176809ec07a800128655c315470c654845b0a092e124c1c30e329811d81af0e08de0008484690c119c310d10c05d031942088e111886292218410e050436086a10c07193c0c1064362040d326e1afc1ff90b503f223dd20b7f0c0fcc310b10c1648306e80a0f8c85583de45d8445ba060d4618c9203c532400f087a896323a18c8c810f25c83443206322a18c898616a419bc1be0b4f2464288460a0cc8188438351320a38c818620fa20e822424062241e459c0333066441dcb107306440c8483892357a1883706060a18c7d0b1d05d063c8918ef0c63b4318e9052e0a5877b120980180bb8631be09c0ce30e31b00980254025c15f0582f80612da1881f86319a40d850340030c11540bc01753194680ff814c0b8a051c0a1813f318640843e4232a5462fc2db8a181a1d00298ba20383620718b733ba24c5a0505ca5734503730c5264300e10c62bcf978a31521815b06314e0ab0518a5314662847f9121fe2017c0478d1fdc183c6063134187f386036c183bf06312e51f050d580c3f7c318921fbc03f4718910c4028c478fd4068a380c585310a18c420fcd140554287540c61fc3187c0c3f14307450c094c304200c61e0c3b98751c1014318720c0fec3187009da282750630d83ec0518680c619c7300a3dec1838c8630c261705070b0c03d83185930b06154706ff00d6000461853093828c28184e309a6130c25838334612031847308a28c220467143e18306db0c60fc2983e1ef828c1e183a1eee38c1c0a1d0852190489836049428c1986083018c1806305e60ac7b108112460a01630a304a6090bed8d1eb4181e9060d4618c100f55140f0430f510a60700a10a303260607a48e302c60547a18e30266044509e30cfc719c7180f0aa82833c86070c18c06180a238234c0482ce1406d83180430040a7c703450c5ffc1a08a2ffa5fe4bfb89b62414583025b0c5fc84d80a1e2a18bf717eb145fa8bf497e72fca5f8c7829a011e18bef8507b6181560605541826906025e18beb17d42fa67a20917cd0c0398317cb04b001ac000902f925f1cbe2821f245f0c76e0a2f825efc503d20c0bf03045e0c5eecbdd17b92f705ed4f399a0b7018bd88ec8145eb8317ac1a4e24bd517a8144b2c317a52f4428bcf02b6140ad030eb1125a282c0060f3818bc88604e8182b8060f1e18bc6178a141550307770c3a682854c0c5e0cbbf8a1208067004f008f225df0bbd977a2eee3a04b01460c5dd0bb99e441c5dc8bb80a0a1a18f1f073a1439b8317682ecc28bb297641cd013a8917631cc8137c3741111a41838f862ebc1c70504d20c1c64317590c0a64317560c2c14304ba0c09ec24c0a2ea212cc47b8d2e9c18ba5974a2e925d20ba3162e8818ba1062e825d00b9f8e3f245cf417e0a2e765ce80ba0e1c7038dc71b0e351c6658b9b862e6a18b9984290c8238b9897302e5e1b00905a30c0fec306bb0c5c9c71280e11c388c7110e1f1c3c38743551a07b61843c060d4618b928e13077e09e813b8001300ee8306920c23dc281420c5c680730a2e305c5851714073028b881df7145c383170d2e180e18706300c5c20b8301f911ee44b81862e045bfc50df00c5bf41a207151c5becb7d00e11c37a43033311ee28b7b8834145bd428b0a2de418190062dde186ed04ff013c023c882fc0c5ba0b730a2dc818176861ba24b2c416e12dc05b78716db2db45b60716d7069828308062da65b40ee48e2d9a5b30b650e2d8e02349658d2d8c5b0c505f70c36a03f399bd1c5b08b6096bf2d7a48b5e16ba145ae43e812cb1a5ad0316b22d6028b5696ac1b1038b5516a91b0838b5396a5145a8cb508a0f52023c48d7401aa4b2c6969e1ae228b4d860b00183ce061ad818b4c0796145a543078f0c5a4cb4901df1c5a40b470a2d1818b45877a13bc38926863b1c14b42861a9c183b4860a78183b3062cfe7614507580c35040aa8a1a7e34f869e874e241d344798914f618b3c96771459d82848a0e741828182310930386960404011e34b37966e01fe1510902ed0c59b0b358d221c599cb3316650e444868d0d191a2a13440ce009e011e74b3184cb000434b30061a1e29345165e0c5974b2e165b2cb41290b00b30c59601208397011e44b2b00c81403d8316520c0e183165019ec12107164e08e0286780466193038eaa0619d811700c58e0dbc18b23164504f038b2086d5293234220043d0004381340619bc1821701231458f4b1e1d451c58ec66b0404011e44b1c1637141c38b1999331458c80ef8a0b28181f386021c0a2c402c60c33143162c13fc28b1506a31458a034d892c481a4c47b8d0d204b2c4868d0c587c301df0c1a243161c04a62805986074018b0b01b6145850b09960e1c19d033880011858301b98a193c5690485440c581c64d0c9700024064a86 + +def cs_4 : Nat := + 0xfff863372178c511720c1778307dd069600046116d0ca89432a1f0c45348a61fe922907f9cb1fe222767f7889c0c062c44d0311333fb2285fd28f81244ad2bb09225415105112606c429509111c3f98445021a16541818883110414a818310fd21f8237001580012843e4301eb06982487c10f73f6c382690609a297c848d130c7ec43028c0c43ac87529f621c44886e90dc21b65c288a9f30c0438145800118a7bc8699fa01c1b603152f0c7e6c310bf0852190469f960c7e4c310b83f202885990b23f1642a9ad51653c61885310a52148428c850014100027043586213c194ef0cac12426484a038f07182778b29da0c424084729d421067da4ab1d60ca744331d40c41c08370a3ec218835a5bc120bc830b200c2c7496589538c18c778610161882a105320a44144828104f0980781458001107d48306050c09c431048208e41182540e792c41102f80a1dbe1882031b914a6d03102c2e4028f9f102414408cc5f85b701f003d4000993e721880f101014402c80510083e6644c55900120003ffc15b161ff4194d1061fe6c68048fec6ad8247f41f1e1451f030fe14eac282a411c1147c5c1b388111a3f6cc468fd53e240cecc1f991f9c055450fcc30fc3f254c6921f80187df8fbd0808023c8b18f0c34980118001183edc7db0fb51f68a610b0fae3dec294bf861f483e8d4bc0e52ec187ce8f9c1f363e682510dab34a5c47cb0f951f26481c3061f227ba0518450c1b9428f881f0e1b6c7044f0c1b6030f7d1ef63de83691228461821a063db4187b91833143dc5a9b0a52bc3d90f688e1ebe3d787ae9ecb24a5507ab0aac1a1a543181b0ca5403294d0c3d144f402490b660000a0a9e0a7ad879f0a991a7acc3180b0c0dcc31eab0ca5049f18a1e503c9c0c58d52781878f8f1e2fec3878d9e9c145fc430f1752647a584b0112fd018bf3061e183c28bf10e1e0a18f478f012fb63477f93b91213483034c0ca47c331390c5f3c31e851dcc3b947720dab2a5f183096d0c01e81b08001183b7876e847d62ae4548886068006100008c0ba41876917b71417109658a2f6619484861d9279b450d270c038431e661d7a0fb816a922f4419480860b001947f063ca8561c509120c1530317811d2a793870e8a2ef03a0c07a8001281498308fb093028740074e14147030e7d1cf8096c7176f1430287399e3f1cde39b4f1d0e6a11ba78f1b061cc8398d4720e07b618f188605321968706160a1425d061ca63948f138e11781845d06072a1946b0e481c8e39187228e441c82390071f0e3c565ab8b23863c2cd32c504300c10a418f8023000041468062e5c187140cd114349c31e060ca32d1ef0e1c519038594621a3c0218eff06517c77f051df90c77dc30e021c0238006ff8dfe51726986785516c18ef486068a181a183400308000480deb0c038430de90c7784328ad1bc2b3706a8a80c37446e808171c4b2c31dd30c3718ee78a3b9818b688dbd2d9e38ee4850778184c0853b8a14b64062d8a1944c861b561944b060bbc19858863b70183e812cb1276d03288e0c0e2030d880c361d2de0a1b0aa224507a9011e28ed2865108194408d6a50fe38ecd0650f81543d060f0a1e0812485b424a1dc30d5d249a28ec7063b18194380d423b0034e4ebc161a6234c0eb98e0e641869504f5120fec30d240c75ac306200c3470eb38d131c34486888d101a1e34386868d091a10c1f9302580a882942e04a21b563942c1d592c981ba089d5619de33b86769d522c33a03284b0c753430cdb3a88105c047920d8a18ea08619a21850706508474e466402c62474d83283a0cc79028cc02c4a28e9806506a180e9062c3418e94050740183420a9e1406d83282c0c583831d200a3280e8e8a2c0818152863a2a32458220e6084186428c842be638e848650421940f060c504b2c491910c740463228181c185806294991a576c315d80c31701478a6064154080c5318a4314091cf00c30f861e916f1c0f48315bd0c30e8adc8a186e7380505c60c255430c330f9828e6c864ffab8a84a7f92b58286148c2506e6393fa0c2206d8382cc864fe0306c1b10e056c1860b864fd6193f406398c30206038c0518082460d0bff13bc293f00bf917f01dc091cbc0c9f70309050c2fbd7ff8933004b2c4a7d40c2f985f28be4395c2f7c28b8e793c72ac327ce0c55705e50a179207ac1a60d393c193e2954b142ec88728a074c1845e064f7618e490ba70906000890ba6391c281e9062a6c1836f063910188f905172689c00008c2a58185c78429063e008c00094171a2e305c58b8a38f458a908638ee185be052a34185bc0b774f4a54385b58b6616ca0234965a516c671b85ae279e24540c30b50169c0db07279a0c2d245a41c601c9e60327960c2ced5ec8938aa2cb93c68b1a388e5830f06058418e21064f0c1858189811270f03277f0c2bb85768aec08fac55cb0aea15d2177871c3108ac285700adf4eea3456e1c2b2932353b8064edc182d70615a22b413b48e4ece147ff062924197d00ab41566704891c0e0c702c55195901c702012280011a2a749290001181dec3038b0c2a5c3bc007a06c20004a0d580c9d58314780c6ffc30a8e4ea02a2c54514702ac4502818b0a6fd830fcd0c09e031bf20c6fbc32f8514f29d145388a704e7a5164f0d240c4b2c304ed0c6f88301df0c5148bed8909aa0aa407a8001226f6c52814481c5114304980c23dc28a484e6028e9406379629000640e4e5418de306378250b0527241448288c5108f772c9c8828a17142c285538f92376618a09888009c8008c00094140e28185028a0414061ab01b11d4e306e8c34988f7229c557a90a4e2418dcd06372c1938689d127d2380db0627cc153821ea91427142a7010c14c4309bf137c9bf07064b0c9be4326f4136626c84d81236f826a81828e36f2184d209a342fc26804cf0f09344f040118000181868326ea131c2634b6a1113162628db5098313025537386274e19371096212c03536c8636b8189cd862730184a6094b12949b484a285a519a2789c68612820dcc526cd1d760fc0274808f2a9b2c303620a6d1449826c31c6cf09b9091d12381e0812485b43c0918326b9366a2848489084d6c38743064d644d6047b8e4d5e10cc0008c4d5a1873a86269a1935293441794382750636264cf0268a5f2229a8431b10160a2934e064d2a6c2c508b511685c28688b2090600086a68f0c6c0845090c81a227cd7f8a26161871506111c6bd85268011106bc071aee0a21f533cb1e41a6b98326740c6b8029ad90c6b4c42aa66e1c37e032ed30c4b4432668065414600a280012820c841882580a884819006105c20b4416063b244ae8412082312c044d5c86356c1440d881a259634278014100003175f0814255434408061d5dc234d578635504a683fb1aa5249928289600a4a2831a970faa6a5470c350a6a443e5834b0002403e507c70f8c1f1531b964c6818c998524dc186bd0607ce183d58d7401aa4b2c8a62734f8286b40604e8183c8879034ee383c412571435803077f24a0243bc07761ab038d37865d2a18d33853025963892006247a183a887500e9e697491b0e793434d8b0d090e861d082868e0a16193058624509cec4a6060c4028d2787210e401c78d25955d041838a0713348c1c24d22160dfa482d2e90d347e1824906070c1837886f00dde97dc9035e0c11c0304690c1b90371094be41817e06565a18d1686d72e40348f9063450192f5864bd21435c06b74bc2392ef06a50d48c7908869b0c1a60287960c681430cb30c9758311d20d0a473c1b112072e023c4a5d20c19fc8e4867b0cee048ca91c60c9738311bb0c198c8db8a236a18cf80633da18294064b86188d18633c20bf050c730c18bccee8a4b70188c4088e059c1830eaee11218717208a33a4192d611811412f4304ba0c09f0319c90c08180c3010600011a4b2cf04a90c17f8d510a4b4217c46220e4b3c182f0259c141740cd8894b2e45882e1115f244574325920b5a0e20705ab0b5445442cf99a62c165c3199f228a16392c60581227c15ece869b0a249c325822596212bf06332215752bc9fd9246634325750a8e15182a212224c15052b8147022c450284c50c66083197d0a4844547032e0f9824cbc864ace192b28632d61398cb30e21e62f0026b196109a297c8ca55d0c65685da04b95bf84887204a732a6392ab064aa411c82380e0dca142338621a0591c481740c9530310c30c95183042b2176107420e05b300026020c86c4081a64dc35f83ff216c785bf86326614858860b24181af0607c642b050b740c1a8814a12cb1c94f03191c3efe28c8c810f25c83843206322a18c89864a6619297860cc819295834e069a640c9107e0c94a03252263a8284158620da0c281821d282494703105d0a63b09dc894a2a15f45028f0a05dc3250f338a09a52860af70be808f011d8495046017b01138224207ee9282864a061927c98c41463003050d0c62ec318b80c4024324f00c07e40a280011a5264280e10c93b16d60949d2939c524e4155c2ab06989e0c3fb83078c0c3facb0d0a5b40141b10549ba625c7f10e0eeaa3e04a7560c935c31891059c29269818b14621431884150805600479202aa183aa0530fc148021e80022261f0324ca0e8a28b0c806b000231263a4c514930d8c78a07f6196c20509d418c360a5b09be1ba0907220c619c38f8a49701c64524b50c1c28ae68a01ec19258860e001925706495818c2406494a1925186494492842278e493e1924e863070287421486412260d850c0a0d901820b808f123dc07b70a492660a4524925ace0f6c709fe0c0f48306a30c92303248b0d2a292448649109210518131e8297486a47f0c91f03247b070c28c06180a06e23923c06036c1923a86068a192388648e0145850e790c5fc818e8a431015233a464140b08317df0a917922e82aa1c3bf03012f0c915cbe78a2f9a1804692cb125f2c12c8a48a65f0c4b505e71aac55226054be41817e06565a1522317b31416e0324412f5c28bd60d271490f4300e10c90ed21c82b41c5e6400088486890ccbc88e00be023c50d650c15bca4c89485a182aa06485624485054c0c90a030e8c0c90983242248429074707400a78f828300c638ce4920ca417149058bb1b1061a2f0c30e5f000021207861df8192069759140a643240a097a2946e8504f818ba888c114393c32402116c287248490024638ba10647fa5cf44b00e47ec191f9862e6e187180897145ccc2150a47d4168c50d270c1aec323e347be281ed8647b28f616780e07741834906028c180a10647a85c6186e00b20002511e817101c0812609170e0c8f2c10f8a59ce0dcc517030c8f14323c42dfa0d14723bf0c37a43064d0c8ee91dc16f21c8ed4b778a1bb413fc04f008f220bf0323b22dc8291d796e2148eb4323a91b884ee4716d7025e28308064748151d116c8145b1944c8a0bee186d4864730191caacc3148e4d1c92cbf1c8e30323890c8e1c307aa0c35d4323850c35c02c203d109960008a97940a8e086b60a47005a545237d46f628b4807850f0409242da162d18151ba09dd0002306ad062d0e18b4203671022383b60362141da43157d0c24143236c0c3a102a3690c8da053e8a14f618b3c8d386410351b0060e741839c061a5a191ac016b1413d43235646a42964c0d1509a297c889663099600086a34f469a28b2f0646921c00500b30c596024e0a46881807b0646840e18523402c9c11bc0011119e0119c51d540c5924306de0c8cccb210a0da4181340619bc1821806465258ecb1c8e464a18b1a0646421650505920c1ba0282c60c1ab81ef22ec1c8c683162a0d440a5001580012858a034d892c481a4c47b8d19701834686462c077c52314462602cc70cac0a8c383230c0c3284323090c5824300fd0cb188302a50c46d430c920c8c0c306570c8c0464606510ea844afb862bec57cc5063c018c719c722fa18ee13fc04f008f2a57b03016b0c267c315e713382917882c2141868302b40c8ba8aed034c1c57603057d0c8b94304ba0c5740309810a09c4322e00c8b78315c80c66f430c400c57088b90a45b08b5d16b22d32b6e1718d09550c1704307cc0c1f24322cd0b721cfc0009045968b24515ac0c30a0322c507e628ad206458218ad0062b3e03549658d2b3824b45159a0f3828558862b2e15c42b79499228ad848f8a4568b09050c020c8ac115722ab17e6480db062afe55f4522a50c0f48322a358302914e80f61455b83229804b01510687450c58683229645282839d0646ba145e886452019145862a9ebfb05154b0c12bc21b80011a8a191420a117418aa10645022ea85d3848300045513f862a78185d086e21489ec322770db02913aa2741134391370644d818a941525120e203226857e82913222632a2a383cb062a205434a858e44ba896d5f48e10c0181cc062a0c191282fcc140db0300fd0c8930322490c89205a20b411a14c4306570c53c4306500c890041a0a166a18a7486447688e4522370c88d89e38929c21807086579c19119abca05843911922301488b02548a44521911407e81452f032225577e1a60694b20c172830adb186a24a57002b000230a5618be00d6000082218384c242060657661910886442005085220d0c16643220a0c5248302ac0c2ad82c203d109960008aa2052916287f9060aea5c8051488290a1e2c01180012887f4314800c87e8321f928f0290fa8643e651c8a380d068a190f7875d1487b013c0a43d4195ca0643d2879d0f32b9024877c6920a43b813b450a5f0e5013900118001282044321d80c1348307190c3ea4302990c1314321d2288a2807b06439a18a20063a5018a1f064ba418a1e00f6148708303830c1218321bf437a1b6c7142b1444290dda1b6141b20321b428380e2070f6a0c3da030f660cada4301df0c86b4321ab435486a50d392434c3d24521a00c4fdd23f8a13c02778513f33724249f715a412ad60301b60c19903219556a214b834c1227b8bd08513d60c4f5537c01450002409e9064318862878a8e430c190c202fc144f1c3218142fe290bea17c42f2390bc04d21485d4313b10c4eb83217142dabcac7216c274a290b4a16612c425809045e0c858c321610c85750ada1581d760fc0274808f3c165c301df0c1650305920c8544322ec0a24bc3214d1d582849386181a5c80413760c85210a2136e1c2448313690c15243213e0c84f49af09000a662700a8e860c4d709ac08f71c1d3832136364a2909a064264190980626921909704051484a899f84e30c404899f04ce144cd4321260e242814606160a18997864242848045b0e092c1957f06422e84550898e089e1836c0604f01898a0611341813406421684289838e420a0fec52af10c840c9808e211c83f435603621c83f107c31e41a05d0301720c83d4292f30a83cc978886b1c0398308690ac87584681d20c83bc320ee4ba20004600c80c4b88320ea41d24b64720e210964f9872ad70c838030de90c837096109b01c834532b8a419c1810f8641961906504f514349c320c60c8311061080b1c4a94308030c3bd8320bb0c82e4320b8252a28d51060bf2190598641601f792f90e415e82b50558e0f98143e4860f8e1f183a00d083419052a0a21482850500d811c82703209924ce283cf860f3c70504a09402e4282bb806b0002310480641181892b0782049216d09208a24a02954d06410481fc50d470caa4c320790c81dc91a87431430483a00640e681c450a690c81b8306200c81ad0348a243c182660640cc4860520630e0028e940640c081781c18e40b21902b0640a2188fb86219015026061444188f78640941b3421232082281183204323d6b9b070a0c0c4b2c299330c80f031a0d07bc8bb0691e20c80e901c81721c80d4311da0c80c83203123a62952d8601901901711c61480a832a530cc4288db86405246cc511b1235e28965854048679412c0544220c8030c7f0c46842a01e12c0246398605e81900da01914a904301df0c0b383118e011e2430d0623184624b6a0e0c1c1900884bd14a3743200c2b9a2824c0604de9f00520050c800c305f90c36ac320003ffa11d470da10c176831ff93fee288b28622c618ff9060710182d5b0a914454c0a10a2596182ce15a4127fa831fe83fc628ff00c06147f708990a225e18fec1fd73fa87f48892853c34448c88f911e098a485f4863f9a18fe5111114107c0478a3f8c14285860a1218fe18617a2181118611c218fde8621f218fdd9fb9147ed830efc0c13452f909099c18fd81218147ebcfd68a21d0188728621c418fd5063f501886c863f4c1ba0490d50dca24233863f427e78a978e3f387e64fcb0e3f281afc178802b000250fc8063f1c18fc686a3140f282bd8a0d3618fc20607821885190a0293234435863efca77c5109916b2288490653b418fb88501fa18fb70532020a780008d21021883f907a1441e129086411a0c795ea0a20e0b73051f6220d4292de0605e41859006163c1840b8620c40b544905d0a7d68fac0a025e185868620a03bd85028f0c7d50826093ea209c451f4f0c7d3430af712e228fa59f4a207e3881c85e31440dc1a08a0ba4180ba0602e666c003580012040ac303ba0c7cfc31023317e16dc50c113e7218f9b8620164024503f70c7cc81f98a3e5e18f9702b6143fe830ff9314828c51063e4e3fc851f231fda4b2c71f221fce28f8f8fe2147c68307700c7c60306200a62352f9093e283f380aa8d3e1618f84863e0e7c0c7df8fbd080a587de04f5140fec30fb7259628f7f9efe3df838f7c8934121c7c31ef73de828c2e063de423dc498570c7bbd4ba0a3dda1807a80011028f424801231c7bac10f8a3dce28d8375047307cc0004c18450c11a431ee30c7b882278a0db018f6f863dbc7b74f6e1eda24092831ed81ee23dc07b712305a4b2c51ed30c7b494ad8a07bc8bac0000c3d987b2451ec60c1a5431ec43d8428f60a94d1402cc31ebc048c294a406153214f59863016180fc88f7143cd0c0383671022494a009cc1930349f186138a14f53a93c145fe031e9f136c28f4e9e9b3d343c54917ed0c7a60f4a97e61ca4ac30f070c3c1431e913d1ca48c71e8d3d185f547057d0c3bcc7788a3d12a46851e820c3b84821093d00087c503820d3028f3f0ed91479e8303400306023c71e7802e828bdb863cea5ecc505b80c79c07640a3cd6250c50d270c79a4f338a3cc8a404505800c796c02f808f1815c031e570c7958f29054c1c5e0831e4d28e0241a20715145de0742093c9223ec24c0e028c18f239e463c883812d863c861d0049e400c258029e3b0c237431e360c399026f86e81c78d01ed8a3c621814c863c5a78b0f158e530e145734d1e283c4a7890f1197462c7884723a6921c121030e430c11c030e40115097c869e1b0c7868f0b17351a783c2150a0d9618449062e5c18f051e083c0ea330928c72e482870a83ba14780cf011dfe1c5c541d19d281c5c4c31dfa3bee287010a99142778306790c0e18306300c37f03390a06ea93c0528b60c77a01a409c51c0d1431de63bca77906f40753000260ef10de60654146047b954cbc146f1825800d6000481ddc0ca2904100a3bae5b9051dd61ba237406e71201c218eea0dc514773c31dcc0c5b48316cf0c1fec303bc0c2604296ca0c5b20316c50c7708ee08daa0fcc40e047b992d80182ef063b74acb451db93b6c76d07288e0c3db8304080c16a03180a3b5a3610512cb0a76a41f804e9011e44b50863b4e76994420e3b3c05c8507960c7670ecd9d9903be48ac8063b2ca1dc50d5c0c7640b438a3b1a352451d850c3a1029d810c75e0305090c1ce831d7414d228eb7861a4e18eb6a8611475a826f86e81a75a46890d111a20343c6870d0d1a1212c130704095039e4702590c0e9830d041a061bec7049c0c0e54300c80c03d830cfb19f433e4b27923ab6755c52c880c754cea806d81c09e031d4c08521904686cb0c7514306c50c75082d18a508c19191052c62180ef863a74181630650781466183d2141a8c31d343a66589471d313a5a077c706890c074831d2a01662865606195418e928397011e38b088a99127488e900a0a9218e8f1d19054a38e8b063a2257ec51d0d191028afa862be618e8486504218e83863a0c267051d043a0428e800c601457681a60939fa31701478e39f0a37451cf60a314c137a7c01c0ec031cef0bc62823a861b4218e73819c0332000481ce50ba428e718451144594305c60c2554310240c0cac328000c16e43a00a083418e6aa7f92b583861392cb140fdc31cd318484b2c699330c0db031ccf4fe22815b06399a732c5079c0c2ac431cc94fcc28ac68639862460515890c7300315830c1dc0315800c72e83054008de00086853c0c1d983034b0002205f71576031638e5a052b141d6031cb211f428e589caf14145c73c8939587298508e10c557431ca0393a2f0c727c21772285dc017714552c304b00c551c31d610c22f031c963922aff870d560a723c0ce0199000240a9b0639147220504440c720831c81390071f85c60417011e683628638f6548450b8157e8245be0538eabb84486ad0c9e903cb0a2a1c2da447b8d2932145b2808d2596344340638e054185038e0c540c30b5006e2281b60601fa184260616924f9849c6138be9e58706500c53b831c5557a824e2800c638ce34e2706388e1830eaee1127110e218b09051e48a6506387c70f4a608e12da1831806386a18a5d060bbc18e1981741470bca590a0b9418e16a7701470a4314a60c16b831c220c9da4300e10c706456093841c705ca490a156e2ad855a8580241e7031c13381e703071c090c9d703055838ce281c5863808700c7ef8e28f018a3b060ed2193a88507a4183b086068a182628637ee6fd413c0e37e223dc48a7f0e9a23cc68a7c14f409602a2120e8a1853b8a7614ea29d07e01614e28d7450a6e0c6fa10ef0a4e7614df29be414be1ca016a9603be18a29860e3818ded818b12512031bd601ec28dea04b0149cc031d280a6f30300c80c03d40000837906f1851bc20c6f00511a32f1a6ef821a0a377a1b2050a162a4a287b7051ed418dda1414146eb430a050dd028dd59ba7079415ec91ba50284287a606373e27acb0d0e3a50144f402490b6834dcd9b970cf2389f88627dc274807e8e27d218dc70664143cb031b8d37186e2869b89138024dc380e1144f603280a27ac18dc1a6f9144f48302590c6dfc31b7c081c01500118001286decdbd09a4134685fcb1b762782023c7061a0c8bb031b72131a5b5070ef80c6da84c189811a6d98313a912f025d86897312e22936f85e5143b6431b61565a28daf1b5c146d68dac8ec81c16b830ec50c6d4831b5107ee281b98627121875e061274204451b4a0c06d831b4736886cf09b9091d2c34683c102490b660004802460c6cdc4890a366a18484854008de00088a6b60c3a18308fd02b0023c693590c23d819707cc1a10d030e7b0c6c8428989b01a39d43134d0c6c701118a268a18d8b1b154d4238d88864d32393c51b0f11782845d0636186c2451b08360e9a2871f92263c18d829b03144320282780c6c009858a11203db8504080c6bdc6938a2606180a10635e01933e06058a000851ae92fb62443ba5f2121a8c30b710c6b98306920c6b8d3390a35b46b490740e25b218d670df814212c42512d31c6b3496703430680060c047991bd618965861bd01d4c0008c106e0cc49658e106818d63051614096c302590c6b08d600a357a1431d8625781495c0635749950526520c6ad0278014100024040b08150c48386e40635626ab84018d355218d5286252a182fe060bf218948060fc882c451a9b251428d4c061b2e18d4a1a934c723931b850f84828851a8e07e628d440d792708382c906350a989834d8e34f8186b40604e81892e0634f01e2092b8e + +def cs_5 : Nat := + 0x3878193bf86043e18e1a864ef6182ef066e42140ba0602e418a59060b9418e159499129dc03276e0c9dace110a4ed2185629c1a143ff8314920cdc543ce0a382301b451c0e0c7030314820c9d7028558071a01500118000280e2c30fe20c356030fdf0c51e031bff0c1da431bfc0c2a283b08a4e9e9d38dfb0e150805600478d04f018df90637de197c3854e8abdf44a73f4e76280708609da18df1064e729ce0def0e37b6062c4a73543a02807b06028c193e006379e87245272f3798293960a3e28705c288a7280cdbac2a7250c288c51094231c9c850db0a142e6edc5271f0c6ecc314140c9c6c30a0514086ea8727190c9c5d3899b994ba444dcb064e1c1938481b6149c1db6b0a053e193808613801432b8625961937e060c961937c864de8df60526f336f80318e3391060a18dbc13c712db050bf8a1e121937726ed4dd635374898b13146dac926e84dca9b8c726d90c6d703139b0c4e5c3a00a1d90182d7064da6189c68607ee180fc81450002313668ebb07e013a4047954d946d2449b09342406d831b460c6d0c31b3c741058640358001281e0c302460cda8830e900c6cc0326b56d3825358064d5c9aa84a6a84d4c28274808f126c50326a24d3c9a6c45f1d612ada3831b090c9a48284830004253478636061836c0602aa18d7f862616193418d88146bd46688a4d0219e7e864cfa0b185267a0c99d8437086d2932453390635b218d6920e81499b830df80cbb4c312d10c99a4305160c096c302590c0c8031ac00c6af4288290c995c312b80c6ae4326554ca42807086102e1975f02d903d60d309264f1020187577091355e18d54864c98991975a8e12c0109450679a0186cb860b8c18d49064c7218d47864c626a34503f30c1ec81f804e9011e446bc93841498b09350a6cba186b40604e819b2c866cac183c0836214987030d5a0c356031a6f0c985930a92401c9850d308a4c201869b86246619307050b14982c312290c9821e570a0e401c7890f0e5d0419e5506348e18d21870014690431a3f0c12483170a0ad8c4cde8a0ddcb9e05035e0c11bc001094bea1b903710e07a41817e06565a18d170623e418d1406344081143618d882497a4306b82b48252f0864bbe192ee01721497692ec8cb31c9758311d2049803e007a80012897541cc0a4ba41433f91c90cf619dc091954ba09738511bb0c9728311b70c271c0cb0023000240cf80633da18224240612971063f8a6c1c186398605e818179064b7418804861e0c0b08325b14b6096bc582914b5409f0519ca0c1260286020c00023401580012812a073c8a22f0192d1061888192cf0622e4192ce060ba066c4525973fe8282df87c84654352caa593140e20309460c45442cf99a61c165c319a00c96392c3057a0af0492c1864afc1970d064af27f645198d0c15283b80a06d8192ba112606c2000482572068a280c58533041888c864ad495a4cbc8e4ace192b32561126598310f40c957d2ae8a6b8c9018419570c4394319530c9558325530c11bc0010908d218233864a9e05d05254b088a23dc690c30c9518325446b70285bf863266181f88b7c1416483035e0cd6b430b740c1a8c3253b0d2a2929c191a140e8ce94094a6c644c525344a6019907252c0c6408fb48920fa20e822424062494a0335950c20ac32dcc0a0c143251b78562882e8631da19ac6864a269449abf0437000251286862084184b686207e1928325023192a6bc9357a0c6300307400c93c8203819600460004a18b80c4024303f70c0dcc301420c0384324ec315229ab88649cc6278524e20f18292700fe71406d8324dd49b83560727560a935c335650c934c2628a1fa214c09658e499c1813c060a46192662d90129329264a4c86ab0492619872140fec324bf0c13a8335520a1c88324b90cd52c324b6496892cd258920e0019257064956c4c848f8f09060008698471f1611bc00111494619a9e983f14928124f18381ee84924d86c8141060318300c9254335320c27f8303d20c1a8c3248d6a5629244866a5018c098f414ba43479e8648fa91ecb850e6a4418c0486201406d8324750c91cd2388a6a3419235b517143c54335150c023c317df0cd4483245b48b49164be69201cc19a850648a691385244c0c912c0cb0023000241224b506149109a818a2f5834980118001205ea8bd394991a0384334fd0c90d9a7ca43269ee45218242f2f185e2474f0a99342778334f20c90a92148e8c1c9095c370a69d65dc9c330d4838d3a4534e50c905968b0a11a419208a410481c903472d04cb00047838a8648142c145240804f829a6d061c9e19201862e88191ff23fd47f0391fa869b148fc844f044301ea0004a17370cd32c334c90cd31c323e50d7629a618607b619a600607741897985028c180a10647a88f491e823ce61ae551e5807a06c20000834b20c5c0c323c50cd2b8323be259628d64050c9a19a53a3b6694a386ed04ff013c023c889600ad288334a00c8eb91d5b49a1c5b502a3a40cd25c3239f1b56286d486472e36804b00d692019a4706471818b5396a406d603d4000942d4635ec1f38d7006186ba86470a18b4d862f28151c123814700a1fc8a37d46f420446a3795964291ba861ab418ec70546e43538507690c8dbc4828a46d8187420546d215a37060e949978523620c8d803073a0c8d7428d2d0c8d68304f50a8d591a898681ab26431663099829a310646988d2ce940e68b818b2b12e41403d8323422e14251a0233c148ce831d540c5924316470ad144306d20c09a0306d011e624218066896191922846148c88334460c16483035e0cbb843231c2c583d686a3180cb1c8316250c32e032317462c8c55a1ca311462058581b121461a7480523090c5824300fd0c581c64d0c981c325432306460a8c1032b924602ebe0515f70c8bf430c790c8be8af70a45f003fc2a20e133e191798545e2023c506197ba22815a0645d4576c522e81dec2517307f905000004815d00c1814315cd0c8b80322df2b902916e22db681c39a060612aa182e0860f960d2c0008c0f9219166a2cc45968b291640c2834cff83036c0c568c1f704e400460004a15a00c8af59fc8a45741455886456e199fa0645688ac850c0100a8008c0009067de180db06455055ec1a60e07a4199f30667c818ab688f3128a683a28a2c34199ef860e74191ae8617a21914806451619144862a9412cc47b8d0960191431545094a74a0888b904820e5c04791175c126807a8001228a055ff0a450089f913ea27c679a599e522711289b83226c0c89ac1c40a44d054741b580f50002519e1860af0159df0b657fc8359de0610c0181cc0616b60e4424c0e676c181b6060a88151260644921912422461427003052e0d3028a78864482ceb05223d29d2299d406446e1911b13c7125384312cb0caf38333a20cce7c3339d0c5304322280fce66f4714bc0c88955e00a4eea182e50615b617140a280012088743221c4434885d5d9924424ce485220e07e013a40479144165248500c5293225103338b142ab85560a440287fc5148438100914000912900190fdb3831487d4321f343e22988a0566fe199be8643d4195ca0666f08790521df4e76250ee21db43b4077c921d80c875c38c8a1f521838a86098a199b5060930155be86288018e9406148409041cb808f220e54333620c870c1c18a337a199ae3a4614cd68321bb436e1b20721b44364290d8a1b01ecc395b486435e86b17708d6698199a406433e6e601cb808f228670313f40c86690cc2b581c06d8306640cccf82b33a0c4f58313d54df2255a505666a86205218504621260733320c20803332f0cccb43332a0c85d4313b10c85c9992896644190b4a16842ca858c921600b5c2998a215a42aa077c905940c854d0a88a056818497866618190a585766710389bb0642908518509120c85042b0cf0c4d9c484854008de0008b213d26be29e8a064274183a70665f8189a90626a09aa84a1300c84bd97b0a42561997806266a19093071102fc03d40009505181858286265e1997406092c1957f0665c618227862190140aa86262623dc522710a09a0332da0ccb5c32af10c840d0808a41fe83f107c8e0d36140b90625ec1907a32cc1402349658a10d21590eb08d03a4190778641dc97484a0ed25c4299620641c6189698641c01906ea0dc41ac835106716419a832c520ca41920fec720c7655e28952860c18182be86253c1905d32a71482d82fc8a41661905886653c82b105407c924829820d0a65341994c0641361648532940c1e7c312630cca4432092411e4b2c7208d411682290442a9a2cca1830d470caa4c320780e9a23cc6a07740ea282868664f819038206d1a3e381670640d681a890f0e099600084a06640c8818c252123a5019936a05b40b03558920560c8144311f70c1b603204d1444288f786409447b45204740868104706ba29322501f83f31480f031a0c198a288f10664b680dd01a8e23b202349658d40641992b0654b497440008c405e80b90160e4054199278633e61592606649419013a026064039010a020403c0bf09119a0c0bd03201b4034a904708110c18802a0160c342900a029c0e2a3591d0651ba1500602711403d8306010c80188bd35f51c25d832001645c286d0860bb418ffc9ff6336001ac0009422ca188b1863fe4187b6800110c88c2b2210c4b2c2859c2b4828ff506643a1990d86643218fed32143fa035908063f9e7f399050e0840185eb863f8a142451fc30c2f4020200230002401118611c21887e1e381213b8274808f1a7eec87c08d51c7ed4def0a1df81438c863f66c7e44b1f70c439d3e0092a8e18871063f5418fd40621b218fd306e8127e8c304670cc7b8331ea3f2a549471f940d7e677471f900c42cc1f88b7c1c7e34fc40b711c7e194f08a3f067e084358e63bc18fbe05071e0e304ef0e53b418847860a8814fb69084142d0c310810cc758329d10c7d8c838106d081c0150011800138c740325bc0c0bc830b200c2c78308170c418c31f5b3eb4a70c7012f0c2c34329bd0c130031f543ea6c70871f4f0c41182540e791cc6f82b1bc0c40e8331b70c17483069b0c05cccd88a3e840ee8538f40c7cf0f9d1f371c402cc5a0907ee198d5863e60c6a051f2c0cc694318a20cc68831f25633a28f8f947c147c6c3b80a3e301816706311c18f8a1f0e3e1638f8486632818f8103fb147c018c50a3df61c7c51ef73deaa5e869ef2028c28f783182147bb4304980c3e4c3317c0c7ba4c228a08d218f723177141b6031edf0cc5cc30a180c7b60f6bb16a1c3d8c31ed23d9e1aa8731650c7b18306950cc58431ec13d7e280598662b8194a4063d6a7ad0c058e06e618f56293f3006389f186053e18f539ea301ea000480f1f0ea828f4f9e9e629426b44140001305fb433145525c24f4a1e931e0a398a006627a182be863d147a24f430e3d0418770904214c4d0331320a79f8bdf8a3cf2acb4503410cc4a831e76624e282db8a1814c49031e6d0c79a8f349e683cc8798c2c01a3cba15c051e58622e7944bc0890e2b4868f278345145de07420a3c92792047b8e621a791412d8e3c86143451e4105f828f1d08e209ea3446e863c6e5d84531030c78c072d04cb00024014c8661f878a4530f90cc3d0304840c390c304700c787431e1b0c7869c210a61da1821232081222483172e0cc3a0330e40c78102b0df1c1a0eb0408922e2c18b898661b218b87060aa81833c863be8087c51df23be277b8abe02a901ea0004e1dea622828ef31de53bc837a491de23bbe2932f062de418eeeb0c714775d66b0a3bace07c512cb0ac2f831dd03b9828b69062d9e183fd863b8e1814516ca0c7710b628a3b847704edf8e1b4645c850da10c76f18571db53b62441c4060810182d486614e18070863b5418b50866146768c4b0a10c767584f0a3b2e7658eca0d3b227640ec70e612818ec2861d0818ec11d793aec14180631c673475d0eb89d6f1c349c31d6d3ad875a827012610e18eb237d8140e98330790c09041cb80230002412e90525c81407b0660e419837063aa81983510c812055429d4d0c1b2c31d450c1b14330640c2838316340c333444002d51a204431d3a0cbb8431d3760ba29ad4802b00023182c9d323a6274b8886890c74ad8290a074019bdb06609c14e91b04b14c33c330473a307458730440c7438315f50c57cc31d090ca080af599dd1c741c31d060c504b2c69d043a02023c730370c73f981a8939f473d851cf3076028e7884751473a0e739ce639ca7390e719ce239c0882e30639ba7370e6d9cd92430bc3041a0cc06c30c280c0fdc31cd32b4e28c998639a0c04c500d5259629808060f38185588639927320ac68e39863008515890c7300315830ce38c31cbc0c2fd01b1090ed21829e0639700d3051cb65ff828e59aff91472c4e5805171cf248e561ca73942557491ca0393ebfb87154d0c726c2580a2a8c01ac0008c074c18e4bafe5140dec31c8f391654d872fe10c47c831c835fb4549c706c50c71ec5c310b449e048e3c08831471d41628001181ab432fd30c54385b481450002400a10638e221a051c7016b60e4424c12071c18a818629fe14e3280fd14213030b4927cc257e3860ca018a770638ae714451c4d179424e2386388abf0051c3f5f7488a469c38386e70d8a5d12386870cce182fb124172832fae0c70a431c28384c24e11064ed218070863836705d1040e5f4218e0a065f367034a410e4eb818e030a9912be4c54b03760294031c0009838026ffc4854008de000869bfd07a4283b086068a180c5855f12055451bf337e06fb83a2925f04187df0614dc197bd064e76157ba9be3102234a2917db121c7031bdc0c511d46e8a5ede18dea27c0146f3d0e4890166193968525c81824c0637906f1cde10e3780288d1978d5eca18dde9833146edc31bb61ed428dda1baf4e36397ad855eb2157aa8613e232d849ba1016628dce2f4f146e4832f4b0c4fa431b8e27cc2879606371a6e30dc50d37126e217a20e5e84184dca3bb14bcfc31b8204b001ac0009036fe18dbe865e7418dbb1b750c343815a0636e44ed850ef80c6da84c189811a6d98313aa0c6d8d7948a2f7e19793065e4819791060b5c187628636a418da8a4f014c55c31b4e1d782978b8636966d217879b3e36762a78caf0c0c6cd09b2890c1214487480636601847f033b307e389ad8626b21847b032e0f9830d939b25126c8830e750c4d3432f020c6c5d77f8a3624bbec51b0f094a74a0708b904820e5c047915dec1977a06263c19777862190140aa8636009a144aeea0a6be0d7b8d2600460004a93030c050830887326628d7706058c1843e20fb1421e0335aa0ac79031ae725e62976d8635b46b5496c8e5daa1976986359a4b3c50deb0c6b286f48a25901911f05358c997850e790a096431ac2105c18f87082b0c6af132b8a1046258051aba356c293290635686acd75f02d903d60d30c92aa0a6ac4d581aa91c6a94312950c17f0309760c4a3c3f31038028a0004a2eb50cbacc31a97336228d4a855d5cd9903a00d35201f0893d0e5d5418d441a87350cba9091a7c0c69ec13a0a24b81974e8634ec1df851a74249a286ac0634e069b0d340e24801891e8634c2183a70634be69703a18a18246968d2ca6090808023ca9a560c6954b34891a3e18167060e48488450d180c692c326010a1c503890a348e1973f865cf818d1d06090818d1c2e751468ccd1902fc1c68c0d17ae701cb9b031a140c0fcc315a40c1ad431a11341ca9986ae640c68203cb0a340c680c4088d5cba67fd72d8e25c8188e50633f6470c52e560cb950319f30ab944319ee33d446a872e4c33c428639864b781417906232a4b2c486282596248c88633b46760ceb99d65c8254ce8829c0e2a348c1865c7a18ce728dd14673171c8a0c0219002863388670d2d0823b0de80d2c0009c1886c4c8484860c66eccdc19b7336c1a60a84510c459431ff40a66b48ae05b41c456432e276446288a9065c48188a186125a18ccd860d3614ccc999714b870319934af27f647198e4aea47000009006d81807e8633121da4519870c51c0319853308660ccbf12222a1819707cb069600048997a4ace28cb80605da18cb60632ce43cc5e017db24658c26784cb000444caeb5c604f603d4000945bf818aa3864ab018ca806070c196fa860dd018ca4adf2141a6c319430cb7b03254546542821590bb3c163420c060d8a18c9c06326a2dfc503f30c64c4c982de51c64b4c9589324e649034c0d324218c8f991d14646d6ed09322619299037862ae352978632104220519050c6410c8025281cd654318ff20dc296e48631e2418816a8e20ba18c7718ea1463901478a02ee192880631b218c6bb1be1263544b68a207e19282865b7818c65a4f50b8c380a106259614c6190210f908ca892db63178b6d072db20cb6b0302b60cb69cc50189f1fda4b2caada20c3f9c3189924a628c4b98955b3493580358001306244c4824d21c621cc428a5b266204c3f8e30fa29e9bec0e0a2626c0482530c108032d880808023c718731a4e296c20509d418c36186a0e44396c00630c461854bd0d6a901824c06496218c2a185330a292acc25184834611cc232d7628584836d86089e1924f86493a196b83539141b2032d6d0c924432d6707b628c1103d214b58c303c10c1a5432d5e490c3d202b21d612ab56d23f8a301e603833c8e5aa6470452d4f300a91d4731140ab52d23726f91c14583025b0c91a4317ef2fdc3c4827f809e011e6523206011e18bef8607b6180629499125f6477e0a069819a86852f9c5f31a850e48a201e81b0800120b4e8325f20cb4d4bda17b2488048bd797ac2f565ea8bd492cb3490e8324380c5e7121a8a0b0018e0a052f24d3dc4978e0ade050400090485a18bc39587145e1547c092f065df84838766245df52129776028c4920fa8ed145dc8bb8850d1c906830e6e0cb464317632ec45d80730115a2618269060e3218bac862eb0b438504bd0c12e83027c0cb420ba70969ae18ba2062e868ff052d020c8fcc32cfe0cb3e91f406bf33ba44b9503fb141aec323e20c8f7c3172610f028351862e4a384c7a88d077418b8e971c2e368f4c917182e2e5c501cb808f285c4070200f5000240b87064792122c0c5000120087c32ce81bf20d88723c50c37c0316fd2df88ef8b7c96f806660514e16f7447c28b7aa65e145bcc1900a2de05bacb74a3b124b358282ed0cb348323aa0c5b5cb6b06101c8e90323a10c5b24b6316c40bee486d486598c18b5c96b62d68391c886471e1965e862d465a88b50169f470a58b4e1794121e703079b0d36291bf862d2c1e3c52cb468fc16cc000102d18191ba86595ad1e0534750cb2a8316802cfe761019d983f2a3a103167d46ce296518646c4191b0060e741839c062ce0d19c502ed0c8d54323512cc8b26472c960c8d3430d0d11ee291a486ff00d6000482c8f04820e5c047922cac595407b0e2ca418b28a33f14b23031d540c5928b23894662055452c840c09a030cde0cb20432c7e464428b1908111458bcb17035e1c0b1830cc50cb1d0b15162958e448b120693028a000480690259624346862c3e18b0f05643ac239189060166186560558ca8c2c65306760c6058b06960c2c165824900fd0c581cb0296032c043248b16001920270072c5c0c323032887541c57dc32c580c0c14315ef2bda03fc2a212133e18af395e62bca578830eaee1320b0832c4e2bba576c715d80c5758aea95d31c5748ae895cf2b9a48ae60c50148b78315c92b88b10c6ac3f1b42282ed0645aa19169062b6e56d8ada902422b0e4315b2083428ad815af2b583980c05458a56981b580f5000250ad195a22b4038acf80d5259639616857f1dea000481598585428ac9159014b0903158b2b14154c245818a000261156863978185f986036c1915386454a1960d0645401447d0658248a6450513136025607862acc5594ab1ac0c67b258aa5862a92551c4ac030cb00030baa174e120c001112a7e54f8a9d86e524cf403227b0c60fc295312a6089cc7089a0c54b4a95a26c1c89a83152444ccc55c6951f2a38898872bf00c89703225a0cafa431509072e008c0009057ca181b60657c218a7b94f60698391230657b818a7914f029dc3911f05166a18a75063e1488e4314e629ca2ca0708200c53889658929b653682728e57962c4c40500c52932555e406298688a4514c00c60283f40615d811f58ab8d4448195e0064eea155dca21b1488643040c0caecc314a00c0dcc301420c8834305990c882832bab0c88103148c155c2ab0707930cae8ca421483290287e8b21f728f451e50fa9215180d305147228e02188a05098a183ae8643d851a90f50e5728190f40628c41853a8740148790321de0c29880a08001180384304ed0c6f88308110cae24304d20cae1400088053218262862890195bf86439a18a2006016618a1fa5d21250f0a1d943a286eadd8b21be0c50b0304533362295b886283e1836406083018a0e038814adb030a0f0d74526472b690c20442ab660c1aa8314096b54250d386434a195af8656b84fcc9f913ef244fac4e806201aad5832b540cad48313dc27b4295a606136a046c1b0800120862c309b00c86202a185279618d872b440c26912de0942fe18784865680189de93bc2772382690642e84ed09d82406224ebc7750a566485ac52b300c859c313a242c6290b0139242b8389c7ab28142044285940c164832b1f125e289be0612541a680008c124e1958d0626e42474b0d0e42884dbc9b5a141224da09b389090a8011bc0011a26c4189b00e8614ac44321340cac2c313490c2580284050ccbd02933e266eac0c707120c4cc899893302e9c4908f25d21222d8304960c84642a1160c11c0321122634abe898988f72aabdc3130f0c84243130819a228982aaf1140384313011c422907f0641f61957692f90d303897b92f31223dc2aae70c0748312eb25d24b9c712e625c82897192e0144b7432ad90c4b510700a25948368961a0d524cae032acd0c602495a92b401fe1510904f50c4ac506288161794490618641821840500c5293234953080314ab08303b00c4a5894989761c4a44946b2a21c4a309458d9b1c82ac307cc0c4a0493f8a0834190520624f4183df25bc12827c312715556249330585069835552879b0d36355511259553a389280655341892592480a8011bc00115552a351829989c024aa4c32a910caa3432a890c1380312222440487d540920e241903106241e4838906920a40ba598990640b035584a05523faa9ec72a760ca9cc304050c47ad7360a1418188f511e954d4388f10607a4188f0869a00023152f91dc23b64754408963402188e98654b6188e611c90cf619e0011800130a95832a532372a94472a4e2596290128606401863f86403e1831b0623384668482f40c0bc8311972326a90471190231e463804792547818307062308b8f4511800ff20a0000091401618ae6865464188bd11790bf2386d585 + +def cs_6 : Nat := + 0xd42e0c10a2f823b64503d20c0bf032b2d0cd418305b80c9104bd6a5bc1c5eb01fd8a487a189658569fa18bcd0669f41813a060ae0183c78669ea1550534f351f025214061d18192130669da1d004a41a0c9064bb40e6c21fc4a0b48611a418730065a261877e0669c21c54534dd0ca374324060ad368334d969b0d354697420c8ff51fc0a699ed338719227122d331a6534c81a4e49a62b4c3145f6c334c1077429a5e8145000230a4c8547a85c6186e8e47a08f345170e0cd2d5a590a2e0619a5834ae14d2b1a55864d1cd29c6f1b7d81cd294316ea0c25802a3b259ac251d78dd12596311d616dd0c40351d50669341830806474819a4b86692a182fb864736191cc066922d23d1c592721a4e59a45b48a691235d4923850c5a6c317940ad2143348446fa8de84089146f018b460646ea149268668f4d1e048d4e0c1da43053c0c2414334710eb028b3e0646d01d344798d68da8d885167692bc265e08668d434b45346805da291ab235130d03964c86822e191a78d0f0e202c149165e0c8d28300b30c59601208397011e4a08805093015a2c06821a1919d053aa819a2a345368a23836906689ed1391950d689619a24b448688c39a2286e8140b18334420a58b07ad09463019639062c4a1834812cb121a343343c0cd0e4e9409074019187064616329833b063024d0d91848a6868d0cda190c952446d428c920cebf0306570c8c04afc8a2bee19a158c79150398315ec0c05ac334246846d08606f1145d819a0e062bb01877b0545ca1825d062ba01830286682ad05116f0e2b90182430618801916c86681630d4509550c1704307cc0c1f24322cd603c25a01062b5819a0033ff06d83916086457e1915e0667f2199fb86156218acb85710ade52648a2b6584e2a05f051230199f801b614cfa82b3e9033806640001045468a804b3e52ada23cc6a2986fb0283a2862c3201ac0008c67be1828300c638ce3839c0617a010100478d45201914586451214aa504b3028a0004827c00a8a18aa284a53a504445c8241072e023c90bae2e8c2a054862a7e1ba88b90e2a7818a9c8644f254cc522772190259e586679289b05226a0c3db8322682a3c299e1860f2c199df0b657fc8399de0610c0181cc068134199db836b01ea0004800fd0c892d2e50a44921a04986030205f807a800120195c346210a0ce00aa8a448088f8494eb0a2cc44d80a675288dc52236104028a7086674ace919d10e673e199cf222912ce6d9ccc07c1c9dd4322200c52bc3221d0c52b02de161a1c8860e130922ae159caa211148840a4c8944185690485990c52593b18a44101815606156c16101e884cb0004559c58667141e4c521ff0cce1d9c321fa1c87e454a036b01ea0004aa1f50d0194303450cce019bf21ea1ccded9bd337643b82f28a9be20c077c333711df82438c8666dccdb59b6336a24cda59b43367016648a1f06072a190e2064384181c18666becd799ad0e66b0199abc04414284c202008f1a50603335156d22840886435a199a6b348148680333450c4fd0321990c4fbc345d30c06d8306640cccf82b33b27ac290c70656941999bc03114ccc8308200c86050bf09a02596459968642f03bf052b3b0c4ec12030a1306260453324274e29991066640195968642c61a011066632182cb866624cc441f38e42a21815a06125e190a6892a0d363849386124a189ba856f29323a00906660ccc158678d801c1a00486660484e850520087a0008632fc0acbed97d21301c4d24332f60c84ac332f00c849c332ee05182858286265e199740665ccabf8532e30c113c332e004f02898a0611341996e32d9111a1afccee9665b0abc4532d565a22907e20f91405d0301720c4bd8306920ccb30300e60c4bb43493d0a83bc320ee072a280640625c419961a0e614cb04312d30c838031ac80c837106a8a65701895c93c71218c0320cb0c83281768a07f6190628816179439957080a018a5264892a50c18303057d0c4a74ee400f500024094e07f5338a10dc00094654e182fe06654a4a442f18e41621994f20aa25064090907cc0c1f243127f0cca7194db2997f784994a060f3e18931866522182bc05411e4b2c4925a1022299468665121904306650c19942aa931481e4332810a14343327c0c29a43206d1a3e281670664ee1890f060998199398640c61290500b30cc9b58990940b219935a0511447dc306d80c813030a220c47bc33f900c81183326414182807086326400044203c0c6831a210923c41992e0623ba32ecb900e23b41901906406247486560e64aa0320532520c80a832a5408c9399260a23621964297017100025007086404a1818f802300023063f86403e1900f096012c91d92332441ca904301df0c0b383118e011e2830d0640261991e323a14a3742b2370c03d4000880c02183003fe414c8c991885f71cc8b8305de0cc8ad9151ce01c7fd0332260710299118622a65264500e10c16701b580f5000240ff5063fd07f88607027300025190d86643218fec8664287f405321117d228fe6866414182100617ae182858692bc188820617a21990188e1147ef4310f90cfd2031fb60c1348304d103380664000901a2618fd88663ee198fb154714c7d22778963e443606ab0d3f4c0d7851fa30cc7c18f7b1ec7e6a0bc401580013ac7a58f431e61cc790281740cc7881e08a3f02198f01f7e53bc32b091f7c0c4248331da3ee2298ec9f6e142d0c31f690ac75d4e88a63a819c898663a0192de06639ca724531cc102e288318631de18fad29c31404bc329c00ac7142828f0c7d508260963867d3c51f4d0cc6f8331bc0c40e831f470a17483069b0a40b4329af0c0ee831f3f0c408cc5fbe9b1c40802da0a6360c6b8503f70cc6b0c568a63523fe8531a50c3fd42bd893e4f01b449f240c7c896d009633619c72860ee018f8c06059c18c47063e287c3451f0b0c7c24331940c61c830d270cc6302b18930d628f7d066310c6185297a0cfb7430f9f0e09091073183630203d870f930cc5f4f738a360dd445c8b317b0dca24f71863dc460fc486d80ce2e036a94991ac5cc30a180cc5b83182e0c3d8c331670c0f791760962ca198b20f5114c584331603a50258aea948142a6429eb22e14298ac8373147aac3293f3006298a9029f14c544bfc0a629a198a617ed14c51d495891e0e198a1313f1dfe0aa407a800130c4f43313b2fa428f449e86143b947720dab1c5f18331350706298989e7a140d0431e780d3624bdb0959186a38f3a9e731416e0331240cc48830d270c79a5c3f09623a1988e1e5c1415c030ea71242b09c731180c5e0448715a41a7938303450c5de431e491d0229888310d51da398861e430e8038f1f976b140bf031e3a11c413d46b1093c6a236016a922ec2198818662041c544be760cc3e4330f40a121030e430c11c031e1d0c786c31e1a3c2c5cd46b0ed0c1b2c330eb2e5c298740661cac38d87097162477f0330d90c5c38305540c19dc09189070c1810f8661a21586786619c77a4530ca7cae6b2073e540c1458316f20c378566e0951484f1c4b0c661862586030be14773877e0961785b48530ba0ff6281de060c0a1985b96c77fc83585abe3f145b00330b33b762985786615a0e2050d880c16a4330a801c228ed5061af60f9c530a56142283cb06613a2044515900cc2683bd09de1cc25cec687644be444ec2033b307e383ac0650da18ebb9674221038284008f141ce831d740e6424eb78607f619844863ad41380530870c1c14302590c75842b0790cc1dc1ca8a25c81807a800110c1c467c31321ac1b831d540cc1ac330693a9a28365863a8a18a928560c81850706464418b1886102218e9c86e8120b1831d360cc174306a30cc164b12069311ee44e989d2e141590eb089021e4b90530520c32b0330503a4a0e60716120cc12c330cf0ac12031d15031629822063a1c18afa8687681981fb03e18e08bd48b03b0cc0e8e800616018a5264a95db0c73f4e7d8a39f218e7a827114c0c0303b00c73c03302b0bbc28e7383d214c0a031ce333622981285c6142554305c10c0cac33020185e2820d06603830a0503f70c734c61212cb1a64cc3036c0c733dbbf896024c0405300f156228e649cc71456343300a2b1228e600617f2c33c5300517ec01ac0009060061da45053c0c24143034c0cbffc2affc0c1d6032ff90cbfdc30bdd0c72b0e5290fe1a23843375f0a7280e4f0a5fdc197f6954a096623dc8afea21ca281d306094a74a049c966eaa281bd86391e0f48515360cbf84304440c720832fda2a4e297ec2fd738ee384418638ea0b18506ac06c4293d2057812543c301420c2d95ff20910d019eca065f9e540c52fcd2b482807e86169418a7d865f8c71645033802aa257e21c561471400631c671a713831c46162c2830eaee112bef8a660a160e2c1452fbc1dbe2431805386a18a5d060bbc18e19869b1470bd3ba8a5f60beb851c290c2b4c80912e41c16b831c220cbea40708a5f4c157d1865f42183ce065f3818a41062900183bd860716197ca06573c197c88769149d44325f20abe381a28a098a197c50637e223dc49bef0cbe1c307450cbe045398508011e447df0614dc197bd8d2414bdd4df10a5ee8514c52f7237b6062c72f7137ac126072f6d0c9cc031d280a9cb432f6a01ec28de42727021c0a2c00094378418de00a230da4397b2867aa018ddb861edc187b5065ebc18dd686281e18dd59ba8146e94a4c8913e232d851ba00c02cc309e8049216d072f4e0cf0008c0009027e2197a58613a0188042f470c273064c08371a6e309f00e371214c452f440c4f68309b906660514000905e80ad28502590cbcf0dbe8a5e741979a865e668bac0008c7a5e184c58803126da84c189811a6d95ff20a2754189d3865e5218bdf865e4c15792065e46bc807628e36a41978e0606e61849f802b00023475d83f0892c3578b863694181b1055e26183c1865e1c6cdc2a7821e05e00004caf0b1d20297850e86144d6c313590c6ca0304340cbc18d910a4d54149a686363a189a20bca12bc00d888a5df61977c8611741977b065de81898e896014bbc036c0a5ddc6c013428d1c54182040635ee0fec5088a62ae240a1065dc86bb8482c60cf3e4308780c1a8c30b710c6b9507a8a25e61976e2ed914839832ed65da8f3b470deb0c038430de90c4b20308340cbb2c73c8a6fb01976305105618414864cae1895c065d86bb04d5a081724bb0175e9ab1355e48d54865d764a54505fc0cbae094787e620700514000985d6cbacc51a980cbac575736640e8044d47860f8449e852eab5d50282c906350a6a0c507980af0283cab3881409d03125c0cba71946891ac018929865d301974ba6181469ac31a680c4900307560ea824d30860e9c18d2f8d362c343974687401269653048404011e4439a0732146954b348a1a3e1816706795c1839001af01ea00048121e0cba0de550a242c197402e7b043e38d1d0609081973b847307cc000482e7408d229e50865ce41973786c20d7e677489a190cb9ad735036c1c22002720023000241733065cca05c8507960c681432e615cba473c1b0800028b9700640a2394190160623861972bae541419840cf806b0002417288633dc11212030d23529be44ae4e0c18d003d03610002412de0505e4188cb060c504b2c511910c188c4088a00a8008c0008c5c86197208633a20a7014c00f50000508c1865c7cb8f12030e5c74180452e3784882971a061886c4c8484860c66eccdc0da11a66d02e9869b1c05c8319b10a459432e2e5c5a456472e2922a2c55c6ae240c450c3092d0c666c301740c249c319970cb8703257c0d08a03198c1aac2a1128606d81970b1127141da4319870c1d84331140a062c32e11222a2828e0678b414cb79fc01213d42996c0cb80832e000c6575ae324061c655c32dfa5bf2125c24801232a0e1832df50c0d78304700cb7c832df032842e5c000905bdab7acc9e0e082e023c486c50c64dc35f99dd1c64d41fa92cb1cb79cc9885921c64bc162800118b78c32de10cb77c30f510cd6983191a0cb768319130c94c81bc31571c643033c350cb748c818a320094a0525230c6af43106e0cb724318f20cb71cc768a31d2200c50ef60c130032dc331c028c6c868488156e085f01425b432dbf31a00628000904a021a6c53c1b0c0508312cb0ab6e56db24f31cb6d56d824eb1c62a4302b60cb6992728a5b48196d18fe7140d882925200022126d865b38d59452d970c1314318850cb64c3aa0930fe18c3e061f8a196c6825314108032d8a5b0e92fc704ea0cd548287220cb5fcc320930c461854bd0d5af8b5ed2588e77dc3e3c241800222611c7c5846f0004456bb142c141b6c3044f0c927c32d735ae460cc6ad6e492229dee061eb4152f9055ac618556055ac2b57c52d5c0c91f0306790cb5556a781b61c91d4303450cef2c2ad4a5a92d45c72d470c919032d442fbe296a080c5293234155065a7cb4f569e3bbe2491443180a5a74181e9065a6c19f4d86488019dd9243d14b4c521d0a487019dd6860b00183ce062f221813a061aca19694242d141550315870c24483054c0c90a033ba30cee7c3177270cc24286865a3839b852d190c5d8d8830a11a41968aa40f141348307190c5d64302990c5d58304bd0cb431685ad0a480649a6a851c8e9a48523fc0cb408323f30cb3f832cfb0c334432cf80d76291f10647be18bed8610f018351862e4a384c7a88e2e4014979852e385c6d1e98e47a218b8a0397011e35676acec479439675acea478a3842325f2125bf41a28a477e1967123b9148edc316f20c0c80316ef0c376827f809e011e444b006476218b720609ea19669064754191d386599e8e904a3a03b8a28b64b4951436ac32cc8598c28b5c87d000560004816b40c8e4432cc059785a9cb5215a428ed5432cbb0f382965c96980af038b4a860f1e1965b2cb3596039657065958b2a852ca9594e59f0723670cb28c323620c59d8284008f1ab28439c0a7678181768646aa191a8986812b26432c960cb251d998946921bfc035800120b24033b2d0c594833b290cb234eaa0a466c18b2386466419642ac830da023cc8ac825900ec74705940c0f9c32c7858ee331472c750cb1c832c710d204b2c6ac6f2c3e284088558d88c4851d280cb1a1633bb061c01ac0008858c419630061924191818658b81962dac5a58b20c14915ef2bd6677472c5358a4579caf322f02cb1456270616018a5264b15db0cb13162595d22ba049624a2e01473a9bec092b8e310d8990e090c18620065880182ed0645aa18add19b11256dc2e30a12aa182e086587016f0b0d0e185e1820d06459218ad60658628b14ad315a424eb4c322bc0cb0bc5588a585419613862b201915906123018ac5055309160628000944558e38c4ac2017e6280db06454e1960e2c1a14b060308fa0ceb0032c112ad0c8206baba0e742960686580eb0196018e5800195ff953f0dd445c892bfc57f689e4a9992089e18a988b981489cc32bf8755628a941525123db83226662ae255fa0616f81513083de45d8355f8a25c14896832bea44aa281cb808f12af943036c0caf88a7b8c951c0d3028b441682255ee06067820e82242406240ce013b80011853b832bd71668046c1b080012853a43063e0c88e433a910c2080314e2259624a6d82d903d60d30882d50aaf3032bc80d091032bc5444e283f40629781911206578018a590675041910c8622ae195d98657640dcc501420c8834305990caeb55d58a440615ec4aba8671029d371c09149d70321fa0c87dd3ab0928f0195ceba6814ae6d88a0a098a183ae8643da155cb2b941487a0314620ce9782ab900c51642a73b0a038432b8d37c4280ef8643b0195c4144c1f523814c86098a19eae065700873452b7b56f4ade5d2586302a50d8cde89437c195ba2b7356e086e450e84290c82755b7ab6e083039d200656d819d1e8656d2195b42b66141aa83140a0c869c321a50c4ff50cf9b98072e023caab5d0c4fbc313eb13a0188072b574328295a906569cad349e90e4316184d806568e8618506360cad147868a56843c245217b0ce8801550a07aa01ac0008c42ea1959cba1d14e86c32b300cacbc22e018a0002410b186742a182d28cd114aca55932b250b24495910626f670504ab1d124e2958d93731485183054f043c0bc00009026d21986786562a4d885135f0c3a1832b0f426e2909a065616189a48605f81820286560eac144ab030c1c483028c0c4cc49980e4f1c847c308b60c1258321190a8458304700c844c32afa7fe62957b86261e190840d8814e7a428d270cabc80708a73c81907f0641f6195770555d8abac47b8d55cc21a42b21d6122ab915710a25ce1956f92e2144b80312dd0aab6956b8955aa186f48655a41496109b014cae032ace0c832c300ff0a882827a865592195638641821840586254a195622abe4172381d8065578182fc8641661955ca0ae14366c320ab0caac5cd88a08341905206556049dc512750c36009658a55528260512660b0a0d3072aa5769e29550a08c14496092a92531caa7154da0811caa5832a94551e48dc72a8d0caa24304e00c488839001af01ea0004a121e0caa04307120c818833995347e2502e0630140e0c320590c815437206e21ca9f153b0a54e8101452a7154dc0384719330aa9a8311e20c0f48311e10d34000462a610c476c8ea88111c680432a5d54b49748680c80ca96152bb24f1ca94432a4f0c8094303200ca9288d08a0c6c184b00518e6192de0533ba1900c865484a8fc52a3e231a804c7060e0c46108c089230012e85200a130224ae6865464188bd35f51425d8305f70c7ffc319ba0c45c8305dd03740d84000100fba0d2c0008c22da19512865440e548ff50e3fcc0f3803e8059005400500031c729c44d8ac780c700025150d91341244c454c8954302fec52a16729029ca305542466009658e3f9a1821a065416442052a09540c2950290f9140b5c310f811aa29500aa000e32382670653fc0a3051fad0ca7e0310dd0dea294fa90da0dd411cc1f3000130a7c94f80a3f40188640553d87e6c51f980ca7a4fc98a0d80194f390b3840e38fc60653caa78c529e10c0f0431f810c21ac3109e0ca7818ee0a53b8a7685109001fa294ea0b43144204331d60ca744329d0722628fb08620d4194e602f2142c80329c8538e63bc7080b0c7d603034b00022058686537a182600602ee18fa9061302141388671fc7d34510442084284b686536ea6d54d78e535ca6b54d61f39247cdc331ae0c4020f998a315a156d606534a7cb0529a115601a6068ff3633e00ac000901fd8d5b0538e80c51f0329945326a64802a0023000260c468fd53e26394c838dd0a4010f400116531a187e0061f7e3ef42028e53140fec5318c0a2f28284e9011e294c2061cc018f7b063de8194bd0552f0154bb0630aa194ba0652e41824c0662fe14b8505043e18f7406308a194b5a969141b6c329670db029c5d0628461821a063db4194b1a96152bc7b4c89ed01ec02814087028b0002614ad8652b0194ab29533036394a806529ca52c50a9e0a7ae43038b0ca51cc058a528ac5500ee818a0002514a106138a18793818b14a4f033eb30aa4e42a6f90a7a70317f10c26bc0000852647a584b00d2fd018bf306525618783851e0a1878197df145f6c2a9230c0f540358001180d303291e0afa2989c853d1018f43065230a45c4b68e522aa44c529110cc4b4285d20c1a6c3290d12aa289ca98be00d60004829090ca42148292cb1a799c317a20ca4043290051fc29c3b051224182a6062f022438ad20d3c9c1988a0551e81498528f2028c28290043d00043428e063c881812d862ee018286863c80187369e3a11c4083c07a800130237431e3511b00b546b1060c78cc328e33c60396826580022c1c5429755051600046a8df51ba28f14863c4e182529d281222e8303950ca36030e471c8c39147220e413c3a6946a86de14a34c2180a085419468062e5c18f048607f618f0306706a0f791760e61c819461869214780431dfe0ca300efc8a1c081260530d70c155030dff070c286feb0d114a2e145b0a3bd2181a2029801ea0000808400c37ac300e10c6b2031de10ca2b8328a709ea29c0f8601c218ee986703418ee606702e1945003bc1418143289d5138a26cb61925130a25c2ef0e3b7618edb96b7186a343e812cb1476d03288e0ca2342040a0b521817a061b081944486700618ed2865108194408796145a5430d64005600046078c0c3588ac8096ff41943b866fea18ec7053b18194380e8414a1b43286c1a621ce871d7221fc29433286550c89cec828610c0b3830d1c3ad029befa7c0141c143285f50bca160eac964c0dd06542786591014ea90619d0194261d4c0852190488cdb3a8a294249d4114a1205070a6f821ba04a83e3a6c2941db1e4121a6c316240d260514000903a601941a86506658684a83107402865506036c18654961115323865306760c603541530cf147474316040ca0a0e8b0a60881941295f51457c863f8a5046a08940f0e1338188c8863a0418e7f860c2c0314a4c8c2bb618aec065028a04d4088e501ea03823a8e1b42188b78507a418ade860ba418adc8633621540285c61425543280350029ff8727fb0c9fdc303730c9fd0c99892b48142cc864fe40ad85058b0b120314a4c914fd415fc77a8001209fa031cc70c301c54f0906c41448c064fc6ddb98678e4fbe56004a7db2afa283b3064fae18cc012cb122f9c74180f50002402930617ca126051cae0a3023dc6a7d13956293e7a7cc179207ac1a615393a2f0c5375c0c9f00310e50c75842a7bd392a293dca7b608c40d2c0009407a4193d9a7b2390e2e60927b1390428a9606171e10a43208d0848c82050b8c17162e28e3d12170c42d12780e170254741b580f50002505be062a34193d4864f4c193d0860758204449c6f0c9e74e338a4f38dcf45279b6e72293cca794089203d4000944f2471585278c389c293c5861d5dc234161063884193c28b07160a38a6406 + +def cs_7 : Nat := + 0x153c1535e851d201935ba6b54d689abc479954d5c39d4542d80c13a834de309a297c86a6a24d3c9a707368e0c6c24308b10c12103268f0c6c0c306d80c09e031aff0c4c2c3268308102a165864d0052645267e858e2933d064cec99d5339a670250b083266e0c37dc5a5095da4212464b8001204b44326690c145830e790c0964303200c6b003082b0c996495e0a257018d5c25bc12995440d8d271c038430dce0abafc3264f255028d5786355219326264a120bf0307db625a28d4c064c7c30d44a63b0cd9903a0094c6e1614f064c5e1ec81f844962298b5316262b6cba486b4064c48d9603c7287c20d9583261e0efe493c4ee800128986c6ac0a4c301614606851219308061a6e183a18a18150a103260c24509cec6a60834a02613e9a4b12ba0831a490c691c325ff348228d1f860920048c483860c97e4325f806bc292fb25f54be80f48902fc0c97c0d170a4bdc689c36984382297b12f525e31c97892ef06a50d48c790ac25e0d096c09281231a975c8e98a4baa0e5c0478d4ba41833f91ca1497412e791ba27cc44331064b929720cf80e4b8c97161278e33c4192df25bc1296ed2dd25b30c3c48047864b6296c12d7a5ab848e58ce495cd1203d8306029500292d2b5f514968830c440c967c8b90a0bbf1f004a59b8474282df87c84654352caa59222ae387b70664461a11999a507e11258885970c667c8a289341d08b52c2a5831c44dc32e1a0c95e8325784aec24ad2054ae8e5184c2220c1314319820c44643421d9a505868719753f86292b3196c14659426f86e81b347c0d780f500024610c066b8c9018519570c4394325594aaa5c286a55408e0292a8846715083c3254d218629e22864a88d6dc85ab157222dfc32542840e292a006e8140f8c85583de45d84529f86a31494f02c1fe0c219032536322419dc0919183f419296a52a20fc39294064a4820ac5106e0d45a02a51c0c9464c768a4a2c19289a5124a203928631be14410830edf0a941d28325046af448c5fbe9b141434324f30c62e0318b40c93c0303730c5264300e10c93b127535711d0754324e249c2938126f81b62d073526d24d949ae49ab28683921a0e3866ac01413c060a461926624cb838239aab061a4e1926044961092f4c340a30ce397c0008d497092de0da24b01f3a7584c86ff00d60004624ae0c92b0318480c9294324a30cd4f8341ac0d06a0304180cd4d8335340cd4c8309fe0c923dad509491a922c7a88e30385264535280c92043247f0c91f66528a6a441a0cb0506c41923a86832419a8d06831e190c4066a2a18047862fbe19a8906831018046802b000230be5b7d814914cbe1896a0bce3558aa44c0c912c4b00982fe192214c8704380a2c000946a021921f00e114d3f117609486cd3e521934f72305d52168a4858d3c8541710c909447d80f5000245a75ad1e01f003d4000944838906e63b0d482d1c0c508d20d0589a700a4816d37452408480c28ba884b311ee3472786480618ba20647fd319c523f60c8fcc30e3244e225a65866992191f50cd1148f941fca4f01c8f8d1ef03de45d8451ed34c0140ee8312f30a23dc281420c8f511e923d0479c8f31a5a1a6964191e3a3c514d2b8341410a37a43064d0d04f51daa3b42dd4491d9b4a214d280341382dae0d2c00090474cb334523a22d8eff907239f473a36a472399692029a4706471a8e24523870c1ea830d750c8e18b4d8a2f28151c123814700a1fc9237d46f88de4b46125960191b99d8e148dc91b8a3708246491b60646d68da4523680e9a23cc6c11f0c8d8d1b0873a1c1ce030d2d0cd19c3020f01ea00046235646a6b264741170cd18834113468cd170723450930251a12341821a39a2b063aa818b24860dbc19a28860da41821b8001103378304300cd12c341030c58d0323212708282c90606bc1918ea31c46368c6092c720c589034988f71a1a409658a462e8c5918ab43946228c41187a30d194298b063157123278ad20901fa1963106054a1a077230246028c00afb962bed0ed0522fb45f48be517c22f7133e691798581c01517722ec15036c322e80afa2917328dd148b8c4c0892b9a19d708545bf19b04c0d245b52f6c689550c4090322cf0f908ca86c0cc0ccff83036c0c8b0915f8981861915d0515621915c22b6456acfc8922b167dc2428722a981720d2c000904be4159f306453a12605229b4534144c4d8122c341914b229545268a485e896452018aab1553099600088a2890c552c327c00c8a1914288ba1c8a0a0548a814e199e52270000230a96a32a1289b03226b44d289a1132b3c32c89799df8a67768960522550a0e603225444a053fc7224f449d2e706a2490d024c309c00c890d121408d1c88f511e33a81c88dc32236446a5384700e10caf38333a1011e299cf8644590910522290ace6830aec08fac55c6c07c0c88882e50a295e18a5712cb1301dc32212442052647220e0b322a03886440f01bc5406d0d01ac314843812293ae0643f687e55cf0d43ea190f9a1f243e0cdfc9337d0c87ad5ca0a66f2199ba8680b8204452b890a875d0eb0a5309960008a82990c062c2b36a0c03d832b7c00d60000614400c87210e3a1c643884a02686090c1a0250666b41a0238666aa1a02106282c504c44002d52286bd0d7334b280e5010b901a6690190d0a19d433700e62e996432e86590caab5224e8b43219027aa9be46a18d666c290c3a18443064f1c9332f0cccb10bd4b3e1c85da59d8942e52cdc5216c12d8c4c86c0255656290b0868040189c20642a685491760e125e19986064296852a5918e80241874d0526d2190a0213f427a4d784800533138071e8a064276148021e800120cbf0313520c4d413550a42601a000864258cbc0521270acbb43212442464cbc732e72e8c2837a8642321997186307e1436c0602aa19ff985421a10e04b2da0c84146938926085264532d40cffa907d20f70d304907a867fcc1907920f1927a350784af31483b50758965881907212d3148385fed0a419a8331fe920c8418ecab840500c5293294952029c0e2a3905f057d1482ec320ba417082ddfe412416882c9fe1a0a7414c16d0d20a524f42994c0641381904ca0970f3e3893186652219fdb057f6619943061a8e195498640f4ca045050d0c81cc91810fe1a81c103786201cfe8c320677f3cc9c4720617f362902acd7f148144311f70c1b6033f930c47bc33f900c811d9318a408080fcc998e407afe2052a660cfe1101b2034406680c50182a5a4ba485017b2521447108e08954a814cf986405280a08d88659812055fbc867eec188cd064b7815fb80610221900bbf6c14805014e07151ac8e83200d7ed22824c06400efd94489760c8005916847307cc0004a05de0c45bc31ff93fec66c469ce00c458c31ff122ae28ff79fee644238070863fd87fad90e8e643618fee1131153238fed4a6b14c84033f513f947f242101217ae19fa686220603d40008d3f8443f8508e10c7ef8fde3f481c7edcfda07191c7eccfd91faf3f5c439d3e0192a8c01ac0008c21c2974849fab21b6122c0c5000128436431fa63f4a7e8c704670cc7b833f390c7e503600a3f2242ce1038d7e5e19f96067e527dfc49f7e53bc32b071f7c0c7de8848c7801c7dc4305440c7db831901138a288408663ac194e8863ec6c74851f62539a28faf99dd122c8030b1e0c7d74fae1f5b9464481a6063eaca6f4504c00cfc30fa895cd1c4120628093e9c7d318de0e3e927d1c484560a7d10fa1beff1c7d01f7d9f38635c48f9ab1ab14fbdc30ab9035e03d400091634a18c51063e4e7c98f929f223e407c7cf8e3eed447c5c1b388111a0b383188e0cfb9dc6e8520087a0008a9f0814f4df60731930808023c71f021a4e28f8031891f6607740c5000130fb7c31ef73dea7bcdf6e927db6194b9060930198bf853dd618c051ee91f1611bc0011108d218f721ee2307e34864053dbe198b9863db2fb2cc170e3da619f639ecd62ca387ab0aac141a54331610cc57c300b30c7af054f093d7215f5d9eb0140dcc33eb80c7aa4289c50ac54031ea03d3e7a798a521882c5fb4331460cfac03313f1dfe4ee47313c3d163bd869e8a93aa2a4e9863d02c4d0503830cfa8c33ea10c0d0431e783ceefa7473e9b0c79c0f379e6d1cfa58bca0a3cba359453e8c3ca0793c1a2029801ea0004e9e4a7d08051873e811cf228f218740127904f1e9e3c3c7049f3d063c685f6c49e310c0a64330ff0cc3e431e213c40121070e430c11bc001091c8022a12f90e3c38f9b4530ed0c7834f058a2e5c198740661c819871067ccc1986e862e2618efd441a14c35c289de0c19dc091893be877ccef91df1516c58ef5034514f96033e540c7778b790a7ca019f27057c9818965853ba87744ee80dc12da858b688ef61236ec31dc801ea000463e440c5b2831dc41b5e01ac000107c7e18edf05de1476f18571db5511c48ed78d8814c2a431dad24e4349c700e10c76a8316a10cc290330a10c76764b6093b2e7658ec9838d00a8008c0009c3b22c25851d8d0ec897c869d850c760df131d757c4648693867c3c137c3740d610e18eb21d633ac23583c04a21b56341208397011e38eaf1d5d3ab8c1c891d5b509e296440660d61813c063a9d0dd049d450c549431d4219a22942305464418b18863a7874ec1630e7c1018e9ab0593a6524fc886890cf81431d27195428e92839814f80431d1f7bfa745ce89903a1e74321da0e3a1219410863a10c0ec53df20cc0dc31cfe39fa73f0e7d49282cf7b031cf108e60f98000907bce459451cde7bbca00070c2f0c7358e6aa7fb1a30a0303f70c734ce691cd139a0733dbbf9a7ba219808063828142bd867b967310e618c0100a8008c0009c3984730051cbf71c628ac00617e80d88487690c55f431cb8396ef6f873dbc0cf6e0e56bdb56ebe49ed9062a9a18e4da7c0144394303a60c725ce4b1c9406f649ed38460565a357f0863908720d7ee8d2a4a197eb067b361a4718638e69e902bc0e2a1e180a1067b2c18e381c6938ce38e3314ff127194e32084c1c71897e31c5a0ca048a770638ae7148e279c4605a0015001180014071157df1c40387ebeecb3d830cf5fa4620a444018e168ad815ae40843e4232a329db03a00938507090059000120708831c200a038433d74382cbe8471c140cf5bce048a380e7018e02af9338047004a3b1e0ed219eb60628e01988a05098a19eb4067aca6fb57c10e14e28d7007a80012229b831be91a4c008c0009137ccbdd4df18811246f8026a82a901ea0004a1bdb031625eae0637ac126051bd437a70c78700b30c6f349720a3792f54cde1c890246ef8479897aa0197b084376c6ed5ea51bae281e5a442865eaa187a606374274a049b9c5e9c19dc0919127e2197a58627d2197a3861e581a43c867a786e1cdc313da226e10dc189b61c6e08dc089b2136048dbe865e6edb0c9658d7a66191760636e46db877c0e36d86d9851b6436c69b7c23eb1572a3b603ee834b000240db09b5f36bd37c82e6049834bc88305ae0c3b14309458b6e28da89b5006e639e8f06369a6d2cda42f0f367c6cec1231e367015e8d06121215002378002229ad830e860c23f40ac008f1a4d6047b8a365018d939b25126c8c73a8a363e6c744bd0b0c6c4934c974e1c6c3cd874bbb1a6c3045a88b42e144577a06263c197778621901413c065dd818d7c9af835ee6bd098196028419e7e8635dc181630635d621e051ae80d3a0a2c0009035ce6b9176d8e79e2839852ed50cbb4c33ced0c37ac31aca35902896406358ef39c51ac46fb028d611abf01f003d400094105619e700679bc15761064ca418d5a1ab35d7e389550679b06aa8d528e252a182fd86ff00d60004885f90c4a40307e4654428d4d9a9a35326a5492eaf0cf33831a8e326629e649a853509203091a7b69ee2492e065d38ca302d980012069d89298a5d30186ac06797669a491f815800460004c123d0c6988290043d000445e5a8634b469653048404011e54d2bae8814694cd293cae1c346031a4b0cba0833caa0c691c32e7f0cb9ecd1e1a3b09060004a1a385ce868d1e5092793ab9bc36106bf33ba54d0c8634264b2c519330c684835a8a34226840d05869b246820d039a06340607740c5000138f24c300c80c472433d8677024645e470633f218cfb25ca1446dc319f233e2f22472e4e0c31cc319df33ba288cb0633b64644519da33b0675cceb19d533a6673ceae3d0cf1fc33c7d0c671421b8000188014319c43386670862212090c18cdd99b8336e66d80b916336214e70053fe819716065c5415e390522a419712062286184968633386668ccca58129325570e0678ce44b4245818a000250cc74225140db0305440cf18c319870c6619e2eae101cb8383197b32f465e0cb884f52a65b03196732c8658ccaf995d32b8b7f0f10e50c654c304970920048c683860c65343194a78942834d865bdc196f6064a8c18c9e993b32751e4493c400c0fcc33c3d0cb78c31927324cb77c7191f6b4c24c8d9917322c644833b81233294cc3252f0cf0d4319050c64123bc8a99dc03e007a800122f0b8318fd31f53f18718f320ba28c7718eb31c8638c0bb9631c26364518d7637c28c6a8edf1440fc318d10d1d9833c1a186a24c6380e114631033c12317262d072db20a62a4318a85b4e62816d2123138d5b050fe70c62643bf0a312e62556cd8e7810b65c53c060cf0103187d30f6144c4d8122c34199040577f8156c306497e1a24b0577ea61a052d800c6188c30985d6a904824c0649606159df78e77cf1d04486db0c113c3183e307a927473be10c1b2032d6b492a292488677b819ded06304260807aa0578222ab0306950cb57924318175ab66041de99a77a015de6a474138a38c003bcb12145830e790c5fc8bf82d471c918cbf0808f1c5f7c303db0c0314a4c892fb20f5403580002004bc324580ceef4be5b7d81a9144be22d3a1a5ef9ddc17b12f60eed00709a2f4a5e8d21c0e775a18bca052f265e48bc7978e2f1a90b4d17872f0c5e1547c112f065e01dd108f724908033b9c2eda9068717690332000462d190c5d8cbb117601cc048baf175d1df83438c862eb45d60bab975451ba5813e065a1219a6b8669aa15dc6065a04191f9862e705cd452cfa47d05cacb950d272c1aec323e20c8f781ef22ec1a5c9843ba5f21ad6a8297252e440ee87171d8dc428b8c1717479e391e68661ae151e506043e1967486478a18b7f16fd2df88ef8b7cace1345bdcb7b16f52de85bccb78bb6c2dd037592de292dc81827a862dc68eb0b6e8620228ea4b6cbb652da8491d196ce8d9035db00dab148e6c32cc52d785aeddad16b52d645ac565fa259785a9cb533b55245a70b4d079c1ced3c3237f0ced3032cb468fe28b46062d165a29656968668ea54b41157d12b2a0307580ced0c3167b0e940ca00ee818a0002611b10646c01a5e08646ba15d9e062cda8d5453b3759303454268a5f22cb25830d0f0e202c147165e0cd17c32c8f2caeecb0b2a0cfb0920048cebb290cb23032c880c5928b243b251ab210304380c337832c810cec7c316322c60ec68374115dc214b16bb152c50589cb1296197018346862c3e18b0f068914b1a831d280a32b033b0b0cec1831608760228b0015ff2bfa57f0afc9619101562bb428120c10e940a75e005ac522f50c579caf322f01c023c33aeb9d8e2940a85589419d71ac4814eb8431cea6fb028ae495c41880396200622de1916a04561456e8cd88a2b6e56d8ada9024231980315b20b6829d6b0618501916295a606d839d6922bf14eb4032c2d2b32566161492cb2aeb2c322b20a562cac515871c8ab0ac115801a2428283620c8a9c3157b069828abc957833004b2c9229e2ae414943aa11582655a83a28e581e19d5dac0d14552c315492a8e25601862a862eb0248012324aff833ab50ccf403227b0c113c33aae2a5c23dc6889a0ceaa8a9543741a54a0a928a2a488998a903aa644c20f791761e57de543112e0e44b41912c062a120e5c0478e57ca18ad20557c219d4e14f5448c38a7a14f3753038197cd2d122cd4314ea57a828a73867522189e38629c45371d4602d524af2ca6a2bc81c530ca6122271c52f8a5ea2241caf00314b20caee8a5522191c1030314a429468844731570a05083220d0c0fc224b09292c9d881b0800120aeac322040ce9d4333880ce9c433a6b43e855f015480f50002607eb0643e21988a06031618a373a6414ae503146628c851887146143c251710ef121a4818a2b8bca14297c39402d51c077c31454289c3bf07144c1f522814c862894f570514460930290e686439218e9406287e50f5d261436286a86f8d142c0c1b6c32b710c86d8318330c5074a0e141b56d848a0b9416282a204492b660c1aa83140b280e50190d29227fa867c9fcba3327e1174cd13e827cc289f293e456a302408b33a0c4f5c9eaa6f91aad28313d10c82249e789ad1050000483a2709fe0278047915688184d225bc1285fc313c40c4f0c9df45c01c13483217427692cec73a1d0ce86c32b300c859c33a170ce8509c8a5bc1a4e3d59383ee05aa440ef860b28189c1ba0e144df4495069b1c4de49bc4b231ce820b0c806b0002410a2136f26d64da9d0316365697c8493607a28295881354426839585134e269623a0bb59605f8189a4212b14e7dc99b13340e2448999459a2658847899417463412583132626484c8c72106e82a11c0321122634abec7131226224c410849226104c19cf38e01c21908003e600003107e92fd41f639cef8172144bdc9798a25e4ab9843485643ac2540e90673b421841cb808f22ab78312e325c24b74712da41c44b59ce912739f15f8532b80cab3495b39ca00d60004a020f01ea0004639c4255c830c720c10c202c312a60c182955f9299076039cdd9292737082c4939b5251282a894287cc2c4a0494005b41a49f4e130a41441893c209f1449c62ae8a8ab61955292627355155091a730caa683124b2494aa54921a07d2caa3c91c2a8c22104554406201413803399c2438486c0c59124301903106732d150c5120440b229cc88654ec19539860808023c4b98b0c28303398754d2d108691e307a4288f091df730280c891a010c475152d11cd2398472433d86770246848e391c4238235cbd05549c46b901211a606405863f86403e1827f809e011e348ce119a144664cee8972da464816a8d72d61951d118b0c1c388c211811446008bfa00b1c45f5518ca801ce57c8bb91763ffe49cae0522e4188b8916f1445b1896895448456150f8e72aa19ca7998f049216d091fdb0ce5283112c225695d86912a225244a1ca21254181950406220043f84aa040c13ba24b0905ae19c9d061df814268a5f21243c18fc8a02ee19c9910e321ba437086d970a32436886b835e1ce4b8310c80a54bc31f9a086c23cc690bf217c7e54a92923f2619c93067248154f186214c429485210a3214421acd109e0ca77c33919212428848c78012424084729d421064208fb39920f041d58ea0e20e041bcfb08e20d641a0833a9c9222c749658a538c18c778620aae42c5028b000220fa9060c0a1813886720215c7e062082a6d8529b37e022881603ba14e3d031f3b0c7ce4338f10c402c80529a72008e3bcb1f2c0ca68830ff33e463fbd4cd0fe95330647f10671ca19c71863e2e0d9c4088d1fb7129451f0d0ce37c30a7392bc2624d8630e4186938671b0a60cf7c8934243eb8c3183d500d60000a297c1f4ce3407d10fa152ec69c658f99718c3e501c3161f227b9c7c68f8b1f1406e81b0800140e2f9d230a307e1436c0671723de47bb8d1eec3dd61ba0d716614f6b06715e19c55295814a5507ab0aac1c0efc13d02770000407a80f4f52a038f5f851e8a3d107a11eb61e7c3cf0f599e3d5e05280638001200dcc31eab0ca50830f283d4c2949e0671383c7478e0f1b1e3439e4d17f10c3c5d4991e961e203c3c78717e63ce25430f050c7a3c7808f001dfe3bf82691a1df6a47c531390c5f3c31e851dcd274c73ea60c25b43021f0c3b7876e8edb5222481a08608aa0a2c0008c1da527242e281450002507661e73123b2c76538821a0fec30ec270f83ae875c93842a7980bcd092f281947e8ea71d4c795074e091234a3e02b8713c9a3a2c7453e872a1498308fb01ea00046b86c0c39f9c348a2ee019c319e381278d83385b1cc4397c000902fb614f180e5a0996000888e582eaa39545829151ba19c299e26117c7584884a53a502445d064ba415c261e1b1438e9c210a46541821486411438b8f058a2e5c19c1e8607f618713315712e0e14618e113c024870683ac102239c18853bf218efb86705a182a486516c18ef40def6228386f6883f812034965861bd4379c19892cb22a2b46f0acdc1b10243381f0c3730ee98a1b8c77386e10dc11b80e0586dd9d3b92181de060c0a18b65062d9018b62861b5c36b42fb8e512c182ef063b743678edc0e1b2a76cc6c81db01b140e20d0d880c361c6c30d85510e5a84b0d773b4a29442066ffc5a5450d642596243c60650f418b47063b24357943a8d1ab2355cec60e6fe125808838361000251bf59d721a561cc888d2a09ea28693861a4aa184502ce0cdf902b7e01a0e09647285d0ca160eac964c19e4df48ea88cea19ce60fd30ce602aa28ea6866f9614a92863a82182d186141c19be186198c331141d0e16e219bde86197232d8528340ac80e9413980012924f430caf3a50246560619560d885282c0c32986520ca26f6248b0206054a19bd61d1314c108337a90c31e81821d281af7d82a81d259624636919114de846318c6218c048aed034c14575c62eb79d1cc0c83379b0cc0b033795187830ecade92187430e434c0d186e4594505c60c30d1bc58a5000193ff064ff619bc2b15712de0c305990c9fc430c19182e293f50c141826565460734f732dde0315890cddbdc718a2b00153ee060ecc185f7affe17d62fa85f38e8434dd985ee8a39542f613e69fc024557430bc917907278727c80cdd6831d610a22f0327ba175add54727b608c40d2c00010173e11815968e08b21154145800120721c5cc0a0888185c98b9217222e405c78b8e171b0dc910b86170a71dc708830c2de83740a16f02ddd3d2950e16d62d985b28b646e829e745ac150364dcf05a68b4c169445b9c864f3018e2c864f2219b9a060c3c1858a1c42149e1830b03160070ec57d277e15dedca4eb7231b4228e188ae115c02b7c56f0add15b870aca4ca54ee0193b68ad315a416b89371b383e2b193b30abf4ec66855d0ab91570dc5a1a016381c19b888aa238123854e8a9c0ef63854c85152e1de003d03610002506ac064eac1854a0a9328ea2a3c547275015162a28544b11454131431bf60c2a1054181551c6fc447b8a14fe1d344798d6e081939d8514c22f2851be20c2044314530c2959b7bbd5c1c8740304980a2924524431e1c290db7780c7000241395064e4e28d0de10e6dcd0c5c5100a1f862a59b72063764282ca098a08140e281a1860a0314049c65536df0c27a643f8a373418dcb066db4180db06139a9c104e509c9138a59380860a6219b69060c961937c866d966dfc536c90c6de4336c4133a266c9e0808f2c1868326ea131c2634b6a1213162628db58e4dce189d3864dc61936c8636b6256c4ad139a12ad0bb0d36b612884e34736b00c9b3475d893b85ca44499b6ac36842499b53891b153c7535e856d3e6cc053d13041a00ac000906d3819358064d586c8428989b02239d43134c221029b4a88da892c34d89933c11989a8491b110c9a703368e0c6c24308b2115e9a3845288a436042284450089f35fc22561ba312616184480f6d00003044742cb14da10443888635da21f843ea67a3d20e0326740c6b7c4319ad810bad9fcb0df706d20150011800128bb4c30847108c97c86a6681066d9dc41803202cd9d0312ba10484ae071ab8103c6ad87081b1034206440c2ebe10283720f0810101e6ab8401916cdc1932407e00fb84a28936681b2c1f483e89a922cd9943e207c34c661ed03d9926e3c35e8303e70c49a8326280f2e1e543ca34f72ad9603c7287c1a1e2194605b3000042149060efe4940536520eeaa3e06a6170edc69ac7364e0c4900307560ea829b2407481a6c1d11b21960a161930547f91448a43363e0c693c390c27d243a1c613009a6c7509e0506fd24161be4d1f920924183793633141ba0284700c1b94306e40dc4292f90612c0103701a2d0dae1b582221634501a132864bd219b1286b623c81ac52ef06a50d481a7c0ba260d30183cb06340a18659860d161a2a49e8e6c384740506810d0019fc8e4867b0cf44718f25cc33ee19a48dd13e62ad858309c70cba67bd8969133da182242406149708cf306411a468c319e10c6a46687062f0c5cd82470054004600006061f0c38186c30b99d105381c54f36020c2c14304ba0c1821afca5a61d09102b5f50cd7c8621b1321a9678305e00bbf1efc2e885d00b9ed7b02df87c84654a48ae866bce3db84b5e2846666941f844962a1660ccf91450b1c9634b069b0c249c325820ada44dc735db4af428cc6866bae03f4511260a8295c4705350a68660419d983f2ad7483032e0f982828d91100a2265d4fe1964ac813d4535cc0c43cc5e004d632c213452f91a4ab8131c0c58d6b8eb7ec258b5c4249558335c00c11a82330c981a43443069b0c9530325480c95183193c0cd6e0303f52596281fa42071416483010e05160004635ad0c2dd0306a2079694ec1df83bd6b4c68c8c83a407460e881d09097072c644d125330c6430286640cd668c811080030205f807a80013907d83252720ec88f872dcf0c7a0c6018b8316062ad640183251c4c416815b98ec055694541498291051e840bb866b1240f82f38d562263400c50001189408c64a9af1c93f4318bf0b6e03e007b81c301ce93ccf18b80c4024303f70c0dcc301420c0384341d80cd5c4324e480da28c4f061fda4b2c5078b004600046356c0c3f9c301b60c937526d8a0eeaa3e048a9606ec0528063800128935c324d40d072433562499c2813c060a4618c3f8630f819aad0604a619263a4c41f7e1cdc4b0156aac19aaaa4bf151258335520cd53d25c8a497013452f90d30c2a5e84870b0c1260324b10c1290324ae0c92b033542494a28c220466193039a9f983e144c5c7c00094493a18c1c0f7414d4e4286c80c1060335360cd4d5a99b5304be445ad50530403d502bb806b000251a9586491219a940649021879e8648f81923d970a14d488341960cd47d23a8a622819238866a341873c866a2e1878a866a2cd450bef8e6a241877e05025e1922c062f9a1807306 + +def cs_8 : Nat := + 0x511c187b7051b1019c03851b0b62a0538030ce009c00b7ff1a76683078c0cdff1bfd0a50ee19bfb1d8e14dfcdbf849611cdfb0307320d3bf8337e91a4829bf38620150f5c337e10cdf603285d0d3bb8374096fa618673983f133bac31d4d0d0f3c315250c750035f82f100560004a05a30cdf15be18a50781541cb5aa122dc430cc02c481a4c47b916f78a0d02b21d612324f43161a0c74a0337b86f6c29bdab7b4194c19d8318163a40186501d1c193646e81b0010e05160005037b0192a25bd71d0e14dea8e848a50417be4537a5133829bd237a2143180337a0502a24e7d8639f219bcd03b014c0b0337960c97c82b7936f222a75d86186a19c4306500419400064ffc19bc4b7876f08de05bbf957ba21860b864fd470504a7e80cdde5bb90a9d5819bb6c38c14ddad3eb8a33004b2c5376a9d4428e55864f9a7f005375f0a55683375e6ebadd6c1d3121178185d7cbb714dd543375207a428a9b060dbc1a7478623e410e4106172210d84798d38fe19ba5952114dd144418a6e8939dd3d08e6e830d945150116a625b9e8616982d285373a38b82cfc0c20001287164327910cdcce467890c3c180478638825340401000120dcb4a640a4f04193bf866e5219b92b721122b8056f94b21c2b70e160a4ee0193b6c8bf12dc79b8e0a868c19b8d149214dc60e070a6e2418e04864eb819b880a99143f883077551ee000460fdf0c51e031bff0c2a393a80a8b151451c0ab1140a062c30a86150a0cecc1f91150805600478d6e10dc1db8337024e7c5939d8601c219b7e36fb102234a2917db146f782b6f77ab829b7b04981223dc2b6f43a5025b7792e41428f8a1c170a1a9ca029bc20cdba42a7220cdb8c50a5e7500460004a1bb30c505030a07140d0c34727190c9c5834e1b0a6e68336dc6db429b6c066414db582829f0c9c04336d46da6192c709b60d382c336c90c6de4336c42788249e0808f14186834dff276c2a6fe1b6a130609d81398001309b9c32f2b0a9b884b109601cdaf66f905cc0930489cd388614dae9b5a26d31cdac9b580a4d9c19b5781b614dab0da18a6d5419b5236a36d42da79359964d6019356861cea1a6f3864d4c19b4a4de3bb603535086362219b48368f116a22d0245818a000270459048300043534708a52c8e38d8108a1219035b46130b14bba8336886d0a28d770510fa99e8548380c21b843694991a6b80326700ad9f9336b1571ad9f57698a6cf699a0195051811ee55b3c866cecd9d66e23cde226ae4326540d36e8015800118205c32ebe10283720708100c3abb8469aae100625b369aa418a0353250505f81abbb056cd2142e3064c7619b33064c6818c99866cc2d9802c90e24d41931486901419a7b856cb01e3943e0d6cac19b2acda314d9483baa8f81a986031a6b0c69a0312400c48f4336454c202869b161a14d9083a0096c82d9009148e6c7c1a6c6427e14d8f5b1e1a411cd8dc24801231a5c28236346c6011bc0011108d2188fe0607a419b162b2d1268b8311f20cd8a4d105dee1c97a42cd6e07ce252ef06a50d48c790901740c1a60285780c681430cb30cd8826b20a072e023c483950c19fedd289238a19d03388001229738311ba27cc25b0b91b514d851b09b6124b8467983209a6c2067884b60d6c16292dc866c0e18757708d6c0a18ce8829c0e2a392d7066c021fe414000012290182b5fc00560004635f76bea29afa35f16bde392cd066bdc45702da0d6bd2d78a11999a507e11258c83ee05aa26b92058e4b1a380ba066bc0960c511370d34d8335da9a662a69825700a6e0a78000946228180c58533020cecc1f8e6ba41a696869a50586849975220603d4000914aca19ae5996509be1ba08cd2032c429ae535c732ae39ae2066b84d6fc2378002221b942b5be21a229adea54c14d6edadd042b2176782cb35b7216ac55c6b5b2326625ad8b5b006bc381f190ab07bc8bb088b740c1a8c3253c0a6474335a40c2190303a1212e97486b5a04a6628c86050cc819ace359899f039aca86105619ac803051507b8318ef0c63b09dc894a2c1826006051819ac598d112d5f1abdd6e51a1d00335776aecd5d52781262ae140a10601c21a0ec066ae219272861fe2d3dc54cd50a1e303189a0cb680301b60d334030d580c3f7c335676accd58c6b5626ac0240aa860a4618c3f866ab8932ae2a8e04a619263a4c41f7e1cdc4b015837a1a6610609d419aa9056a9ed539aa58e30c2a5e85070b0c1260324b01f3a7584684a40c92b833543996c29aa0353f307c2898b90156a7732c0535390cd4e020c0a6a6c19a9ab5336a6097c8886a30c92303352c491229a9498131e82974888f3d0cb55c335256a46d481a8fa474138a681a28648e219a8d825b1491a430f150d32616a10a6a24182690606981522c066a18039854c910c9130325f20c0bf032b2d0c911c33e9b0ad4126428a6a00d3fda7e22ec225e68334f9b6062813a060ae0183c78669ead3d1a79854c2490a0334ef82dc29a76874012d3a42b4e682d2285e1860e3e19689861df819a70b4df82bc3425d0669b85d4425988f722d365a6c17441d1bd034c670cd33da6734cd98c80fecb4c610cd309a6097201ad2f447b892932151ea23d1153164334b698ac28b818698a61a62834aa989c39a530dda09fe0278047956948d28da50a3ad248ea8323a70a5b502a3a33b9003d40009069308e78505f70cd24d1cb8da012c04662006987618b4f07a4018a52648969b0c160032382769e29a42348246f038b46065960186ad0668f45a14534750c1da43053c0cd1ca6168a46d219a37069854191b00668d6d1a86960404011e566128668cab26451663099600086b463766625a2f86016619a2e0668b6d1691a1170a23043432339192e000462c880d3040306d20cd13da2704301cd12c34c0aac4829a22835e14d1106628a688058a9ad50d58e418b128619701834686462c20445343b074029a1c4bfe152fe834bf7686246d47065c6228251818681201607585190e000444bee0d0398315eb33ba2a2bc866848d08da10861a24d07a06d8a502a15a0c95d52ba63946e862ba0183028697c273a812c006b000250ae406090c1962185681c1a5ed8612aa19a0307cc141f24322cd185e29165ac341430ad2de0a97a456904a2c10ccfed15e0a67f4cfe05588e456e199fab3f214246034bc70c8a9c333e94be4259f30667ca55b8522990ccf88b0d0967be199ef235d14cf751480a451619144862a96182580667aecf559ea40a9252ed03153b0dca28a9c8644f6199e686679489c44b3c92a550dd0751250acf1d9e28967881e5854ba40acef512a8a0730199dc33b7676aced19d994f7192a7a049866762195c533af972e299d68b3514cea99d4b3a79722499d34b8dab6c35119222f298a313c00094673c88a44cb8a0cce611100a295e1910e8644361910c8622ae159ca94a0148840a4c8a441a199c84b7d128820280c52932247fb866718ce299c40e2910521543e0d96e851fc54c8e6708ce0a0328e67032dbc5337b66f4cdd90ee0bca2c6f88301dd031400046b3711df82838c8696d21a5b286287c192e90566c650e83180e66c12d6d9ada1bb283e559abb35514284c202008f1c3da03335166a02044721ad0d2d443219f37300e5c047914338189fa064332189f715a414cd099a086641c86555a90a6676cce50c70e6670ccdd99a3332244f1c33330665a29995066652cca259c8d966e19991a16942ce395968642c6190b08666288564503ee05aa265970642a21815a06125e19986857a0af0382bb338814cc29984b306660acc11981a13db3e08a58e8665fccbf054b1a269d2578688e82ed62597ba12b14ac14332ef96262825e86265c12cc47b8d65d019973211914cb8c332e165c00554693140c226834b060d2c04332d541fc2907e20f863c839967b2ce25ec3834906659a0398512ed0ccb259644af31c4b90320eb0acb159608a1092325c0008c657c6b2054ae90c834495e09656e087c532b565662469386418c1995812a514200c28ef60a4a783129c0feac8d06b2a80bf829952b2a441623a56a850656183e4232a121f1c3e307401b2b3504e0a4133156c4879f0c498c332920f2c299484ac614ca302d98000188228d398a6510820892307644be455942b28440f01d34219800130ca04307400cc9f0307320ac9e81670a40d64888d268e34961826580021081983890a64e2140598664da087817800012081606ab0964d6c9a993486d82447d48f90a0daa5264491ef0c8128366c3741a81143618d881d2a98300e10c64cc2b25f3418d10872a660cc9703325a23b42992c325764aa4b908b25364a2c941927202923640628000a06494189658640486795bec0e6492468c5201f0c807817e0a951a806d5220e64862044506200a80543061a0cc8f82ca840ca37433f690c1260332340b2a0034a7e0cc8bc2ef0a94f0c8a0ffa0d644c3db8532230cc888965897eb21990fb21d14c872a6e0a3fb21990bb21133004b2c91fcd0cc82d9040917ae1888406640cc8145e88e64067f0051fbd0c13ba24b097e9018fdb0609a418268a5f214344c2b1f90cc7e18fb31f563e8c7cd8f931f13f4c1ba131fa30cc7c18f7b1eca9804a5280616e21834d8663c42ab0510a3214052646b1e063bec775f931263b4423c54a410a2d0c31f690d28f8310710ce44c354ab0a96f0331ce639b28d87106205aa2482e8663921409786638ec714484c00c7d50826096386c7058e031be24c6f0331b90c7d1c285d20cc6d48168a535e198d9b8f4147cec31f390d2878331ad9436298d49f2c12c694331a43e4f01b471f240cc6798cd8a71ca198ccb1980c4034c4706941e198cbb196632838c3906631c61bc54a080c7be449a0a63107bdd4bf8e630afb74518570d27f424c0a62fe158be9ee814c5ed8bd29691a7b88c1f890db0198bab17462e07b60f6b16305c18505036b01ea000489ed23d9c28355063d987b218f20d62c8c58cf620f4e9106558b01d2812c574f5c8a07161a4f38593ca18f55865280273064c0c93c0198a8b14f3d3e9be4949db0cc51cbf20a2fc4198a1545414c4f077d098b10064589db13914c4dc331367d4c2a4e7866262fa845312d0ac4ae4e50a625016dc07c00f5000251892b122140fec3311f0cc4743311c3cb609cc000901aca1a4de8562301988b1e4e14c450317790d26d8349b40cc431f3f8a935c1817e066214c424f1b0e620c198823102053239f3b0661f022d8530f40c121030e430c11c031e1d0c38f15968a7cda198768686e815875b0ea61cf10908c99861ba2986dd41c145c38309de0a19dc091892e1418318062e0e182a486619cc330530ca7cb028ef10de60654146047b954cbc186f1b7d814c32586430c6618413c00a0800138c300eea080e0c320354015800138773c349840cc2e985c8db71a1814330b72d902985abe3e1b541f9881c0145000270b60066166c2c4530ae3b6616f0b0d1292f01985585a91525d031daa0cc2998529d9f1815e03309f2b202984d0d5c14c25cec687644be4458498e8301ea00048286d0d25843495e0d2f0431d740e64258460d2714c224349580cc21c30704848829bec063ac21583d30774ba43583ab07460e439837063aa81983510c7004600048494c0cc1a0ea2041492bc498333065141c3919105199a22002720023000251830b060058c3941e0660bc1a8c5305a0cc16182ac93d1cc14c6560a60a14f3c516120c748833a06710002418253047033e01ac00094608cc1158210d608257cc5303f607c31c03160d26004660e8347d114c0e8e800616018a5264a95db0d24ac31cf90c73d8295cb0cc0b8e780a92461a4908660501a48f06923819c43052048183e606922e1980eb01c6030381fb867bac1980b15a414c0518091ccd182c5e50ab00f0af62a485866016c029bb90e600ec0198029cbc25240c33002120a2809786396a197fe8e841272c829287541c72c4e57051811ee4428b8e791072b0e5290fe1a7f0032ff391f0297f7065fda552c548f50c7584288bc0cbf981bd8a391e97c852fe35fc447c870b9344e22a4748691cc2e055fa0e16f60d840008c38eabb844afd55fa854385b488f72a050830b65011a00ac0009010d0197e8c8db152364305440cbf24a7d8a91a81a5cb8691a418e28865f86bf0830f0e5f8018a65065f7825b45021f0c2bb4576047d62ae44a5d061b421646306918816461064ed81d004c8bf0c709829c220d22e831c1a0cbe917d08a3828157ce063812193ae060ef6197cb2f95573c397c8854008de000891bfc0cbe3d7c72f8d098a497c48277000230df90614fe1d344798d28ca1828989b014be0d7be8a14dc197bda73b13228032f745ee722706af715ee0bdba18f123a50197b5af6a0930397b4af679120397b2865ec86edc50f6e0a3da831bb42826220016a915ebabd6c4c8850cbd597aa1ba01c02cc30f430cbd417a6af4b1cbd257a42f4690f24a43b065e8abd0de9c8e90e41979ec86f14bce832f350cbccd1760a7a5e184c58803126dac32f2d275225e04bb12274e19794862f7e18db0845e146d7a6f905cc093046431865e3cbc741b98e127e4b2c50ebc0c6d3031b49126c24d0701b60cbc3cd9e8a0f0409242da0e5e1cbc3578589090a8011bc0011e90ae189ad8626b218d940608660000448510cbc166f38a5e04189a2865e00da4452efc7a0e2577c1b0c116a22d0b85155de819778c84414bbb97768e2a1c362032ee70cbb98a4c895dc8bb8c1630e79f21843c066b54145b88690701976eaedc5db04b7492ed79064286f586259618d64065d9a00ac0008c106819765aec96fb03576306357a1831d8625781895c06904437385481e355c2008000905d78baec3f98db0226a8832eb85d6f205c72eb25d62babc726370abab57559a881af4481f386901c1a40605901419a7b850f2215bca4c8d5d3d0a4852e9a5d302974b9a6f1469ac3364e0cba49748ae900a4010f4000988ff819746850d14ba317452e895d0e0b38b3cae0c1c800d780f500024490f065d061c50388817e01ea0004c1a470cba0173e0a5cf4121052e780d1fa433ca10cb9c832e700cb9b63f1ae690d6a49733ae650d30343cb06340a19730ae5d239e0d88947dc0c472433d86770246490160623861972bd2ab1267cc2ae510c67ba6ac8a23529be44ae4e0c466832e4a5c924658747d10cb91e3e70a0c4014ceb8023000231720865c80460c547c804f82a3e3065c6e12a008d836100025171aae335c654a486d0968f80140b90608a218e70058f74b8a852e2922a207e40a2800028b89032e220b0e16101e884cb000464ccd860d36182bd0578129604a4c895c3a95f05257a0d1eb8325760c569032e16728c2970a2e1328e0341a286031615708ae0e1334b432e095c0cb814cb6125c06658c26784cb0004556ffadfc12b7e96fcadf8070c496fb06e81211c032df35be0650c74794085642ec20e841c0b660004e04180c54942ade878802a3c503e712b798c96992b1ab78432de01ea2296ee991a14b768319130d1dfc0fc81450002416eb2dd412b748c811f691c640267c0a4a46184158620dc196e4867856196e398ec277234c75060afa18260065b86b708c6c8e8488163b48612da196dfadbe5b7af06c914990ab6e96dcadb88ebe48c54867ba2163ad06313f33544ada35b40280db0624a614c4b8fe2151d5032d970c1314341c70cb64c3a980001861fc3187c0c3f1432d8d5b18b62e3a492892c156c1872214b6056bf47441cefbc324a50cb5e036d8a307e1924f865ae6b5c8c198e5adcb5a96b40e1eb4196b2ad641558396b0d20d1e901590eb0955ab81923e065aad1ccc524750c0d1432d4d8e5c28bf797ee1e2413fc04f008f34919032d445a86b5056a013b92b1c98324520cb4e4be08ed80fba0d2c000994be41569a244714fa6c317b136ae29dd997a729323a38c862f4019dd6865a561e70517900aecce20702740c15c032d282f185e2474f0a992a155032d251d342547c05485019dd1865a429074507400ab470bb58a5a34b45c5e18c5a2ab44c4ad120e322872d04cb00023038a862eaa0a2c0008d160a1a37c065a0d1bd052d045a04291f98659feb3ec503fe041e03d4000918dd81967b2cf52fb63843c060d46196789720141a48346e20c8f4432cee8dbc2a36d861be01a36c0682821a36a8659c0378dbec0e06401966e062dd41817e06476218b720659a8b34da4e8e693419667acce8d903a36305093c09140008c599146a06ce8d9a0d3054b5cc3f6145ad0323910cb30165f3b542d3c1e9006294993b1af832cb946fe2943f86596f1ad91ba8d595c196562cab8d608da4923670cb28c316791a70c8206967692bc263558676781964ea355148d4832c981a2a13452f911592c1964a165e14b2496480a76581260496520ceca4346a00c5924316470ab219642ac8319bc4a34d2c7b2708381f30001111a55a210a7628d6a8496280d3629638ac7058deb1b80ef9658d8b1a851d280b1a2dd828c9e2b484963240f314b18032c5f46062962ec683a2d03a340058cf54588af295e20c3a0b140009c8cf01a763868ce41a33706588e5720519bd0c310033ade0c45bc322d50d4540346640ce218285c0086e000462c3a185e282da064592196192c31a2923a8a30675a015617857b12b0a832c270cb09961289181c5628ac38a4558e38c5464c0c0d8832c1d583944ec722a00a23e832c150cb0456078a75752f044ac0d0d190032c000d18f03463657f4113c746330c89cc346300d4494303880c899c3151e0c220c322620cafc4a8505643ac24512d0657d4218050397011e255f28606d81a31286025e195ef14f481203631086972e195ec8557aeaf58a748e57a81911c867522184100657a2536c16c81eb06985416a855798195e4c24414af155e22bc329784911206577e1a604a7750caef032bb6576aaed2304925760aebd5d7460424aea55d42ba674dc702012280013a9d7032ba143ee9d58694780cae755ce2b9b06880a6007a80013a131432b9866fa295cb146714fe1d3447995572629dd9040d28c0195c89459143490300e10cae355c608111cae2432b88a1a22814c865704f570545e50caded5bd2b7974948708b2b77286850b82330c982cadd15b9ab728bc449d200656daadad5b545db241aa83140a0cad895b0d0aa37300e5c0479974646e48513ef0d174c2ab5756a8295a9068b98ad28513d10c822418e868b901827f809e011e355a2ab4356844f108a17b0ce88015480f500024159ea17514ace559b8956681159806565e117852b2b0ae8509c8a5bc1c250c345b50cac882937c0d16c032b1b7412250a3061d341958b05491516a43135e120014cc4e0121d0c1a2d28642681a83f495e1223a0bb58912c01820286560ecbc052b04243029581459a2e9c3508f25d2125d18286f50cabfc9918e420dd04823780021284484518453336001ac0009855f8abe09878e8b1c1957a0d260046000482af22596290808665a21907d8655dc195762aeb028c395738655c883bc512e70d160c312df0cee048c6aadb55b44b4c72ad50a6b20320db0cab4106892bb01ea0004a2ace0c4ad4cee8a5598ab2d5648e4186190608610140314a4c8d254a195622ac2120ec0312963544282fc862522178c4aab9556a0610000901b3619055128320483555892810f8e1f183a0160834190520655601ef810e028b00025093a851b021a2ae868ab619553c55614aa7a2a88a552eaa515488e551caa295422069244874150829e00024154086243019031067328817c52a8062642902c0d5500023229f04620696000482a7c54eea9d153945382ca9b15350a23c4181e9064070195308623b680c851a010ca97552e00c81d14b032a510ce5dc320250c190422a4a549213fc04f008f2a0bf03119a0a96f0282f20c806432a4223200b387451d0c0a7038a885470a8d852a355468a8cd00192545a17dc52a2b72b82823a865452a8a08b68e544ca881ca98c1d07ce5950e394d3fbe3950daa1a22622a64945090ca858895006b000245ca3068a0a18fe64d2d1210d032a0d89fc29502aa0305ae38fdc8589eca7fc6898d89e618fd68653f01a2778653eaa7d14f929ef08cc3260ca9ee218e008c0009053d87e6821b08f3227e60329e9326c1010047900d80194f39f8e147e30329e553c87e10703c10c7e043086b0c4278329e03ef8294ee29db89aa394eb0553a6c758529d10ca7418e908539ea734529cc5396a724744c620ba24405865386181a6065380154df04c0140a30329bb53745734739010d12e830edf0b12dc344b353567cdc7100b3168254d49f2f14b6b0344ab0ca68d4cf44a91ca66028fe20aa6514c9a992059c4a2528653207c2c5298d0ca62e24d8a5314349c5318c0a2f28344960aa6147300a30c60f54035800120a5fc2985c0c7bc4329771f3a75846a9753dda294b8317f125c283021f0c7ba0318450ca5acf718a748c154b3a9667174387bb860868187bac37412a58d4b0a95e3da6454ae9ece14a5603447c1ea01a4c47b9152a0194a7294c52947ae48838b0d11d4329455288a5087029e00002149f1ea301ea0004817f80c5fd8326f90a3c6873c8a2fe21818e86526618bf4062fcc18bf20652543c1450f032fbc0000629251dfe4ee470efc0c04bc3291f0aa474be78a52341a23006522b3d5823eb15722a44948804561a1a6c3290d710c24f3986521219484290501c238f338652067980bcd0d5200a3f64de8d51f63a685054c0c5e0831e4d28e02588a0651e805600478d8896194784d2d12791030e790ca3ac2868a935c19474063c7019473b10612a390328e33c6229470a8e0887638f14863c4e1845e0651b60e54528d80b10cea158a51aa591c4c42c0c10a834f3c0c5cb831e090c0fec31e060ca33546489518814f00863bfc194600e054ba434efb8661ae182aa06882c1945d28b83bde38ef4865168210050deb0c4b2c328b11bce0cc496591515c19454b81f14a288ee98a7034186e096d414e0586dd8a5140a27d44f43fd1b5c25d407a8001410fe46d0893b761944928913b6839447a88d080e0658011800130c2a4302f40c3610328872d4229c01863b4a18ed18687d218b4a8650fc1e305287b50f2a1e143a9250e8a1ce1f08e3b021a1ef063ae619433286550c83490928610c0b38343d70cdf7c2580a0e0a1942fa85e50b239427865910194270ce7307e39426284a879e3a1e6868796194218687921941da8380d3638b12869dbc1941a05643ac235419a832506232b09282f06c4294168ca60cec18c09282a0a92294148c9a1930394141d15031400048b0440ca094642a65e1aa0921d90a5038464451d01011e2940c060c2c03140a0800120a05d40a8a8750a0418180e874a45c848da10ca02d2f9092b78c4b4485d20ca01c2288a500a30d44b8860d0e693feae2a1a9fec30c2949e0281b9864fe864cc527f30b32293f927ee4fda9fb13f49cc734301c54f09036c18601064fc69f84527df4fbc9f70727d94fae293eb27d502b0023c943870a9f493e89caa3f8c453e7a7cc2ab4393e5375c1412c0315470a9ef93de8baf976e493dcb751140f48343793910293d8a7b0172210d84799538fe183658686e4193d6a7ac11063a740054f52193d3064f42184340638de193cfa79c6e785690943610c9e653cb0a4f2471555ea0e86ba193c5861d5dc2393c49c4129a0200c8a7872990293c1064efc3b7c5021f0c70d4314ba0c9de8e190a02e81834c06296419110064ee49dc05276e0c9dac5688f6d0002413b54346149d8c314920cdc54e0a094ec09d7ce060e381218a40064eb60e2c5147c0c9d607ef8a573c193aa0769146ff030a8a28e026198274d1f9a380aa864e946fbc52f870c9d157be8a4e7e3490500e10c2f282d0d709c8008c00090864a9cdd39b27354e681260c81460c9f002a731863829396272b4e5038de1064e4a1a18b8f77129c8830a175ec22938f8637661938e9bad150c30501c8e11c9c6938ba7134e226e58b270b5e9629384a7084e0e9c1814f964e021937fc090124b2c2a6fb7a7228325864df005140008d4de809600358001209bccdbe00c638ce441828636f21a17c861e121937726ed4dd40f540358001309ba66fe8a85e29b884b10960249b64326d827362a1760536ae182d7064da6189c68649e0180fc8145000231367064d9806d8526c70a9b0c31b3c7412243c186 + +def cs_9 : Nat := + 0x1ac80cab4403580011915f83457d8af84ad4178802b0002600b58609ea1a2bbaac71515d62ba55321d15ca2b7d9bd1b15b50598a55724a32bbb0e1b361a2b445678acb40f08c5620c827c30d810d157a2ad8a554c1955101dd03140004845540d154432a960d153954611081caa24304df0dd02503486243c19540868a8d1515cca9a3f25150c3454240b035586a0560d14f03453a0d14e0319330aa9a8345358a68a98c711de406a2acc9068a5ea97552d8e25c81a295aa5414a944345298a5019046aa4a403e2a29202fc15148d2de0a05e41952206b30a1a28f451b401e0a2c000948a34802c502710ca8c8320030c17e4345133ffc66f46b95c0a11d4305de0c45bc2916c625a25512868a17982c49fe70ce5392bf0954367f6c5113115322550c0bfa51f03628385224e19509868a0714095060e89ff13f0544fb89f22a27b5db01313d62798953f6154fc063f54194fae1d81513b431f9f219460fc686d80d13a8310bf9e7c2627406c015656031f8b32562a270063f08185560689ba7dfc4c4db89b5135c729d80d134c310810d13454e88a899e7d845106a0d1328344c9898c41747080b0ca70c3012f0ca700290501dea0004644c189804130709810b12fa25e0a71f81876f86896e16259ca201312c625829a732640004a1f2f0cb6b02c4ab0ca6883299d0c7c84329980d129ec9506201b129a2510953187c15d2f0e14e725784c49c893261bc70bca0d1258229840c1c7c344938924a5e86a9780c3e825008a1f3a7584529740c7bb4304980a3e4c303860c18c02c48b8915645074487890a29c5d06890610d05448152c6a5854af923da03d817ad8e3d9c187ae9ecb1511f07a80693028a0004a447b88f22854f0652901a23bc476528ac554929420c0a7c344710b11c1f598a2fec184db0688df11b84d80e52661878789a44b783623617e4143c1c329280a3c0cbef00011a0f6c344671df8281a60688cac4e4544633d0c2a23006522b3d5881c014500025076d3ea1140d04305d20c05d0344580c5ecc30ecb0e7e0004658ec0d115875c93841ca4043445370ec2874d0588a05e0448715a425113d88a0a889ca3c847b8e0a4010f40010d0a3819476868890e19854446935c2947406888878d8531060d110a2200a0e2a156870651be12e850e536a9024f138611781a5dd86072a1872517441510d0328d52c8e25469a32a133cf82c42a885310a22138e2662ae65466068844a3104c41f883d107620d112e1c184ef0551761945c868827104588a0e0686c4b44c40f0056000461ac80c7784328ae0d10243381e1b9c24070863ba61a202c40488071004906050d0ff544c8a87f70fe0edb96b7186a561fb0687eaa238543f30b522817a0624e4349c558a80ce00c30d7645d8261f5a882150fa06b212cb1b0f9d43d0a6ff216cc0008c3b281a1f21d8e147630328710c76043286c50d428eb986b12a194308687b30f621ea8d87a9622c50cf168ac28eaa063aa2591c4c3d1509994f06b7cb0b0f3a1e637c10dd04a1e5283b63c83434d862c481a4c0a28001210f1d41a8a50665868543c519542a1e1282c14329833b06301d0ef431d1c193646e89f3118776a0a24998e8770a0972918e2be61a1d9068fa2148c886b0c61a1d68616018a5264915db0d0eaec2f0a874a45c8505de0c1f741a580011b0e8cade8a0ba418adc8608a21a1cf06873b0e713fcdede249fdc301f9028a0004627f50c5690305990d0e503058b0b120314a4c914fd470504a7e80c9f983158d0c0d8834391871e293ef9cbc150e30307660d0e285f48a17ce3a10485260c2f9407b0a395c146047b8d4fa272a8fe30eb07618e4f06870412c0543803ac22a1bfa7b94f6e361bed82e150ddc30b91086c23cc69c7f0d0dd02c37117121024202008f2b0db830b8157e8285be062a34185bc06ad149e98343680758204471c6f0d0d94343644f36dce05a38c982a9e64e2c8ab0341a1ae864f161878502c20d0d6e1ac89160626044a78102360d840009086aa18c051c350c52e830da10c70c83069b0c05c83434e444024e159499149dc03434b869228e1005868e9d8c5434486870d0071c0e0d0cfa19e94801cbe5c30a990c51f03077551f0253ab06867051d41b08000201da43275006960004643348662287e686865f38fc5432d28ca2abf486afce1a1950bca150ca21930a37b6062c4c3230d0c880a30a09601a18f064e5e6f2d2e88001209cb13950a4e5018de106377e1a18b8a200f960d2c00094862d5f6c50a14bcec24dd98628281938d86861c9c64527174e266e652e91186155f34543070d0c1434304860614c4706570c03843430085fe9be00a280012a9bd4326f336f80318e339185f66de4542fa85f09bb9376a6eb2d5ef8342f34db22a6f905cc0930389cd86273018dab850b5c1a17489422596352780562ae153670685ca1a1711b46150b80d9e8a85bf0b7a16e89090a8011bc0011d365967c0526b54d6629358064d5c9aa84c2d909d42a6f1ddb0135e98342d63612293490609081b0260536061836c0604f018d7f86859f5e64542cb0b5e5833cfd0a99f5770894cf41933b2674146b80326700c6b4896e8985830b017698e25a219334032a0a3023dc8a65e0c39e4342ba064028d60061056184148525781495c06357096f04d7800a0384342b05d7e2abbd86355e19b3615cd150aa417e0aaeec19e6806352a182e30685450a86150429f07e658937061af41a14c8685310a5da7b8e852a1e219468e85241a1488d5a141dd547c09851d0a3530a2612250a22143d7651b0a166ca0985049820d280e84ff09f0d248e348c03d40008c84f018d208684ed09d41c30e4bf21a1388506bc1823780021309b83426c05f82822e018a000232134844415099d2f58a4bd000ac0008c0d705690486b623c80f9c725df0d097e12ea5d61c47486560a4baa0e5c01180012097482d74a0c97412e619f91b09552e50a236e188da8633e018cf606541414a03424f0d093831a007a06c20004a25bc0a0bc8325ba059c2830f0684935ce425e8e84906724ae68d01ec192d30609521a12199c114310d899090bd4e570504750d08f92cd0a4b30188af86ae561611bb2231508d41f702d51a66803422f0a960896589226e192be0684531eb85422606d8292ba112715088c0c589844265f85421fae2a2ab89868437347cbed8e843018cad86842e551c519530b08512a9010e05160004a046f00022023486842308412a5844511ee56107420d84190828c9996840e181f386840b08105ba0e840508060ff88642494d8c8906770246460fdb59906960004899023ed2260fb0699f015aca8683e2b730551680b07b83105d0d07b20f5d6ee31c04ab76060be01876f85207e192834ceb15078ab728a0a1a1927986316e67744c1de83bac55c694990d076a0ec0a49d2629c0629499230754324e250f8252702da01307420e6877551f0453ab068399072e0e5188524d5802c1c483869330c3e12838506f86938e497e18275066aa414c34056a9a1925c5db01306d12580f9d074a09cc000980e00160d8a4ac146120324a50d32d02b53e0d06b60d484181d0699a9a0a4924b5a048f5a0c0f48341a18341067a0cea4812c3cf4356ad0d06620cb0a06c41a0ca4193832291ad23496831c919d6a28e011e18bef868315062054185ad3e260c10648981922582fc1506020be8a990a18bd517a729323a0be34fd1490d9a7ca43204e84a0bc850aa8192158e9a1505c048225f21b05b8334ec0c907120d0a69ca1ab498582d15a40507150cd3743415d82b65d38724030c5d10356870d054c2a3f30c5cdc317350cd324356810d05343414c2fb625a600682921a4854148828f59d87010a9801ea0004e34b40d0518b818a59ca1a0a1a3bf146b202c140827c286ed04ff013c023c902fc0d04f1a500a8274184052ccd0d04d91cf85f71d04cd1cc0a692019a46a38f148e2c9390d271a5a9cb5215a41a5a8e4b8890f541a097169e0f480314a4c958258160055651690629a40868256b2c050d5a0c5a1c341260c150023780021b0490b3fc9661a3a10323690d048608f8a46c418b3b495e1304711ae891a5a19a338609ea166118659321a08b86822d044c0598e68b81a08806821ed1605410d0c8ce83410b466c2836f0682121b48504380c337834106820b040c716340d04041f38a81fe0b140008c46388c68523180d6a8c340fbac362ab0b230e1503e0340f7193c5690680fd0cb18830c950d03ba0480981d61864405ac101863c8681cc1917c016b148bd4322f200560004634200c1868340dd81b62aafe8645cc12e8515d00d03641388a81af035a0698e97b619c4305819e1f30487c90d032d80c09458c1206315a307dc0b548c0c58186299fb86156218acb85710ade52648cbca0ccfc830c020acfb848509036c1915422a51502e1151a2a01c8a7407a80011855b8340b504a6299ef860e74191ae8517a21914806815a8a245154a096623dc6c0ab450c55142529d282a22e834bb70d02a4340a867962a051a26c1489ac7b70a678a159e1860af0199df86813d027604e409a228940a7f8a06d81807e86812d02551240b44168254298860cae18a7886811d022c5223b29ce2911b86972218a7086259618a6d82d903d60d308c085673e2aad9864452159cd0615d811f58ab8d80fa9dd44c07a295e28a5712cb1301dc340730d56a0340710c0ab032206440a2ac034c1180da1a0358643fa193ae0680d3019d0f9947228e0581a28666fe190f68528d014a338a7f0e9a23cc8c05f0ccdd43405e57122a02c061f521814c8603161a02a00f6148734321c90c02cc3143e0c97482c04f809a28cde8666ba18a1586d5293232023183314cd54340420d01010d7a1ac5dc2459a5e28914cd20321a00ccd14333430d00ec1b10927cc1af3286745a15e9c86431c189e906666c190c30643082580493c70b00b599613bd13220314a4c99967c1959d017e01ea00048402942e4cc94733220d009e011c01f1022489c20542a68541ee88e80341624062949923006200b0a8029004850e9a0c8504330cf0b00340008880143a185135ca628283a706426e1909a0642641a001a12f425c10100479565e819fffa12714849890c0a05181858286265e19ffd06f51484642bff77fec1b60702780cffcc322710a10e033ff1420a349c6bfef7fda2507fde2b141a6c33fe925ea5c7c000907fcc19ff20510d21590eb08e7fc683bc54af30cff85fefb2c11aff750700a7fb419066d9c614ff48693897fa019fe788031415f433fcc7f942905b09761482cc332a20cff10320a60b6826a910665301904e064133156c5079f0cfee59488a4124824053fb4650c286a3867f5a81e453fac7f54c9f073fa70c0b3833fa4099600086bfa13a5025fcd85aa1215fcb91f714431c011800118fe4c33f927f202aa808614181901f99331480ec8f203e71cfe2033f877f092a80711da0c47544088a95361952d867f0019fbf3f7d236e39926067ef6fde453f74bbb428639867ee4fdc44088e0c4019fb6a0140c1c39fb584ba1480300a500c7000241fb432341480190018a0bf219fb10da112fd7cffc9ff6336249faf3f5da9cc341c406128c19fad80e114fd6431fe9183a0f9c73f577eacfd54fed32162cfd51fa90a084019fa7bf4d14fd305e80404011e44111867e9443f0f1c0e09dd12584bf497e8a2877e060e3218fd99fb114c7dc310e74f8024872867e8313bc4bf3f21b228fd306e814fcf42338a63da2e60531eb0cfcdc85bcd101c7e3833f2e63c824fc31f8414fcadf941f7c1a4248329da0cfc8c07e8a7e44fc80fb48e3ece194e8863ec6e44c53f1c05e828179067e333f1850dce0a418c33f157e24a70073f10051e29f86863e9e19f848515f0198de06207419f82bf0402e838816867e00e3d053efb71e22480598b4140fdc31f330a7cc0f973dd11a2ae40d780f50000418d286314418f93c06d127c94f912da01cc66c33eee7dd8fbacc47127dd2fb998ca0e7dc8fb8451efb1cc02aa3c185c14fb78f781eef1f363e682510dab3aa5c8304980c3e4c354730cfb5433ed47da429f689edf14c5c87bac3741a286033ecb305c29f653ec707bc8bac000953d987b218f20da8ce19f62316114c57c33ec062b829f5f546114c55c2beb80cfad9f5ab1501c5fe031e9f3d3cc5290c4127d64c51853eaf525026a2a0662783be84c5880322fab1f55bea82f8c48f400630140e0c33ea30c79e83312d0a79e034d000018fa782db80f801ea0000a31240c79b433e970c79741dc00f5000245f46178214fa29f43897d0805185543a0a790c3a0097cfa18f1d8611ba19f3dbe793c623838a867ceec3e451e212e8429f39be727ce2f9c2e8b167cda19f3606cb1422483172d0808023c6b0e80cf9a0f02087ccc19f31be627cc2f981f2fbe5e3be818c109df23be2a2d8754140cf95cd64097ca81932f067ca4f94053e4e0cc30c280e10c7750407061901aa00ac000983ba03704585829e000251f2416cf14f919f220a3b8a18ee20db014f8fc316c00c1778354010c3db833e397c714fe8680e10cf8d5f1a30a33b4645f19be323b2ec26493e2f0cf8b5f160e841af8a433e241a4e29f103e1c3ac8096493e197c314fa00118001280e54312e40a126033e167c2af8518359204f018ea64f3e141b2c31d450cf841f078a0e1cf834b188a102218e9d065dc218e9b8cc34be4343518660b274c982b8e0ac875844be06195829bdb05a79e18e919d22194239867857bfc19efe1d0e14321532f0a87681863d516812a08430c7045ea2581d86607219ef81cfe606a39ef7057bda73c48b90ea77a1861a867bbca00053ddc083429eed3dd97bb0734c612002b000270c99000112f751ee88a7ba01e7053dce7b96301c122800128c024337720a7300315830c1dc0315800c2fd01b10a7b86f709ee00e7b7c19edebdba14f6dded90a2a9a14e4d84af086e0004815470a75842bdab0cf6a9ed4bda6088848e41c8e914549433d9f0cf6724718a91c219ecc950f1452642bd977b28241c7062a06197e6067b1c19ec694fb15235033d8b29dc28e2b9c50081c0150011800130713833d877b0a28e1fafba445235ec23d7f14888032fae0cf5e8e1405ae1cf5e53b48a01c218e0dafa314f5cce0a0a7ae29d7051c061532297c9a756147004a3a83610002403b4867ad818a38067ad4131453d680af59832f820cf589eb09be828b244692065eea6f8c0ef8ec11e1426a82a901ea000481bdc0c512033d5b7ab22a18f060166193968601901824c067aa6dbac548900cf549ea80a7a9e6edaf3b0d7a946eb45140f0d221432f550c3d3033d487a8a28dc9057a86f5097a38e1e581a43c867a786e1c9658d27b209dc0008c27ac18dc189b6146e09bec09136426c04bd365e7429e998645d8197978b0b053c000483d2e36d628db306275225e04bb0e7a565efc52f260a6d7a6f905cc0930497909b571416b833d247a46f4846b1570a6d3875d83f0892c48da60636966d217879b3e36760918d3d1c366a28748064d6c19e89820d0056000483d127a226ca071b27364a28d91064d54149a6867a1af42c53d0a5df22845d067a0abbd05131e0cbbbc306d80c09e032eec0c38a831af85dce249818679fef3f451aee0c0b1831ae92fb629e7c06a3142dc433cf50cbb6c33cf3359c37dc5a51179de6b349670343625a5441fc09012f3ac9640a065f34b452eca0c096c337d80cf395e713ce1257049761061036349c552e70c372033cd90c6a9433cd60bf61bfc03580012825d8312900d4b7431a9baeec29e68051b2e19757863520bab0552d50cf325751869a0002424060634f6d3dc4925c0cf30de613cc01ab049e5db64e1448fc0ac008f1af2e4d308a0e9c19e5992331469697458a8ff219744061a3e1816706795ef2b490f0e5d0419e559a4714b9f8d1f895cf818d1d06090600084bca30af28433c9f34322695c053266181b6067930b99851a0b0d3629e4a86340c680c4088d79284b9055ba50af23d72b0a791846dc52e510cf2208d4a6f91ab9383119a0a0bd033c84232c28314002b0002306358533b46760ceb99d65c825affb06790446044ae3b0c6730ce584981af1f1e3dd2984b44486220678f54a54504510cf1e08b18a5c58188ac865c5019e38bc702286382c3858407a2132c0011533361834d8633329604a4c8d78d4f1a4cc7257622f1982a20a3312150023780022214f4890a5f21a1d8433c5d5c202888a86065c1f2c1a5800122b8203196f3f8025e2c3c575c0439700065bfc18cab8621ca19e281950140e1833c4d06bc29e25869b14f120c9fa5481c95183193c0c10524af092a4a19e21478e1464cc33c3d0cb78c3192732481a60699210cf0e8c8dadda1cf0e12998a786ef0d453c34a4bc29aca86785ef0b5e158e31de18c7747701463902600a0518192880531b218c6b8af81549343103f0cf079e0ebc1c29324807086782c10bc011800121491432db049d6296d606056c196d398a05b483a91e86781b48e8552380cf029e03bc0330fc148021e80023cf004307450ceffc2100a5b12196c3065b08182750677eeefd0c315f95241c2c300f60c92c07ce9d611aefbc33be75aee29df33be5307c2898b901577c6b5c4518330b4860318285dc225dee98224be435decbbd81ea23a9068f480ac8758483bd50aef4c32d540cef38303450cef2c2a65e0c39e4317f2135e000462d470cb5143008f0c5f7c317db0c0ab0317d909a4280978648b019ddfa45214b4e66478a07a419ddc867768038452d2f0c90e033bae77581e707179204e828bc7078f14eeaddd48a2f0a1530524280cee8847b8a773e19dce86483418bb5865a321a8f1071f14b44c2bb97bb602472d04cb000439dc986160a1946e86480c1568486480614ba206771819dc5bb8a7713473835f99dd325ca869389770c8f849658d7708ee0ddc0c6e5245c80351c70d4714323cd0cc35c323c92e14283180659d219dbb0df0145bf4b7e23be2df2b384b3b730aedc433b6f0cedb432cd60aeda9db4b49d1aed9832ccd0ced8ddb0049e048a0000a239b0b46a06ce8d9a0d3045dad16b30f908ca8916b22d5e70986acbf0cb2f433b542d3c1e9006294992a5a70bca0976a235b053b4e76982965a862d181565806595c186a706768cb2a050e840aed11da116791a70c820aa3600c1ce833b3e767a13d46bb3a7672ecd91a6922cbc19a2f86766215d96867656eca453b283aa828b25045908aa0a2c00094466418b21a32f1210e0306d011e628b1f23273a8810524af1658fe19d8e8676380b18534420aec58316250c32e03068d0c32d409281231aec402bb0e3a50281d00658cc19d8380fd14ec091818a58b818afc8675ecb15da140e75e94598522f50d458c3008f0cebb4aec0a58941a8ae0645c019d70515714eb7833add75b8eb6cadb95b62b6a1704f2c38317c01ac0001075b2eb5c6140ea29056904d1460c8af032c2e0ceb34315920f0c29d6551421569c8315800aeb1c0db0a758b44f44bac3583029d613ac0141d1433abf757c552c715492a8e25d5c3ab757fc39d59953c1454e433ab1089e29d58089a14eaac351250c54911338a7550afb65d20d44b819d51abe915445c23aa106d828a7f4b9c12ea74322460caf7033a99065f34b473a96a21629d49ba91144f1c214e20056000463a8e5798295e406751215d43860fd018a5e064448195df86981252c832bbc0cea05d4022151c884433a7d74f8e9ec2cc9296fa155d50ab60b080f44265800234881032ba70ce9cdd393a6c1ce9a0321f10c0d14304c50c14cc0c0817e01ea0004a3a640cae5031466b8aa28a310628c0195c80674b89cec512cb0a2f2833a5903be290ec061df8155c30574aa131453a53a19825d28a1c91474a03143f4ba425d2686437c18a16050db6195b886436c18c19860830190d905747ee8f442b690c077c33a3a0d5428a0506280e5010b900e434a195af867468195ac06a150195aa0656a302404b33a0cad30313d20c862c309b00a3c5433a280c4f249e38a1e1a190bf09a0259635d122b4014e88433a1fa13a2559b86743619d0d216612c4258093a170ce8543138f564e0fb816a9103be189c20607ce15d070626f818495069b12249c32b1a0ce8243508926d2289b4213e14e805d002b111ae7f55858a26921817e06080a19979805400460004839f80ce7d8999459b1c84792e9092e8c19cf821191484583046f00042683686262410e05130f0ce7adcf489260b5508512cb0ae7959688a73c4e7805505d0c23dc2b9de927a29ced0861072e023c8aade0c4b8c96f86770246450740625b4cb04492d455aa29ce8b9cd559c39ce58509ea1956486738683045080b0ce70032abe417229cdf39bb0bf239cdc20b114e6d46cd06981882ac3032b0c4a043e387c60e8049cd839af4144383df25bc12e6b681b8a24ce1955306735869cc520860c820432a960caa4c32a910ce685cd004e01ce679ccd20621ce6618990a40b219cc82a7abbe23953b0623dd77b8484050c810428a0c0ce62032a660a0f4832a630ce602cc90a72fe474c52a5b0c4732dd289238e47108e0000120e5e832a4f0c8094303200c468c339730c6c288ce0c731496f0299dd0ae5b48c904e400460004a396b0a46350098a72ce803c145800120a8d83200a1302241388672c4e57c4bb0e1b5615caf395d08ea382ef0622de19cacaa2514a8765390972aa19ca806226818899912d091606280009417f4a3e04912b4aec28fe986224e19ca2067280a8205393d21fa43f0f1c1221f21816b867272fd14504d20c1c6430d130a7ec4301770ce4c54fc0921ba4370fd40e21b41ba88b90e06bc19c969f9f21940834015800130e4b05cc0a72547e6051f950d8845581a58001287e4c310b8216f34406b9230d4629c904fd33f0238fbf8632307584429df0ce4702b918212042394ea10833ed265c8ba9d11441c4339130c7d843106b4b7824cee8616401858f0620ca418816a8d20ba1440586721805dc5390504ec09cc00090720712f0538fd1dbe25c7c869f7418816171f000230f9f863e7619c79b8f1153ebe2570971de187fd0653422ac034c0d533a18f908671d2e39cf8d0e0ee018f8b836710223a7d4063e1a19c700fc015126c318720c349c338da71aaa5fc738d10ce33dc668a718e19c6238c2143e2c23780021c1b94338c0717a1b60738b9465e247bb8611e614f6d06716618f6b06715c7b407b02f5b22e2b54aa8a0d2a18c0d86529eff9049ebe2c3201ac00090529618123063d6c3cf854c8e93ce15c52037314e289c50cf7b1ce27dc4e29391a3c6ec810a2fe21878ba933143c3c4d225bc1ae25dc4b29281b3d901ed8a1dfe4ee44b89206982948f86627218f44069ebb274824f0245000251f53067118087c54f5608fac55c6b88b068229c45388814e21831e730a3b2c39f800118e208303fb0c038431e670ce1ecf301799000240bca0651fc19c3b0670eae1d1c389e4d28e058745177914149830e810ce1b034d2d0ce1a9c330970cae179c2d9e33240f6c31e301cb4132c0011105321968705160a19c2b385570a422e893850709c28b2385708419c20842a14e100b968404011e44f04861a4e19c1db839127800fbf897066a2f8efd8361000250efc86883419c17054914e0a0ef48a704c21005083f812025c120de914e0894568de159b849c10b820259635c0e381a147730338183b9229c0a8605145b28316c80c36c0328990c17dc328960ce03d8588a3b6e5adc61a8d87ec18eda06 + +def cs_10 : Nat := + 0x4ed21807086a6e418e0ad36e154db0307690cf5b031bfa622828262867ad01a9afaf8114e725788af7d0a29b831beba6b66f84df01bde2c6f74debd3571d4d54300b30c6f34de5534e911e8cbca2f650c6ef4ddcaf611d4d28348850cbd5431ba27a8e28dce2f4e37286e4892f4b0c27403100a7a80187960690f06e284bd3c370e6e189ed123708bcfc5533737006df00631c672abcddb6192cb18f4cc31b73a662262c4010001286db0db39b6436c69b7c23eb1573a5efc3532a36bb925c705ae0c3b102d5900c06c20004a53240d4c858ab89c92613a40118001214c74d9d1b381cf46831b32d10225e89820d005600048135b0c4d6431b280d920829b234d5424d8f9b1d146c5d77f26a0031645e8486361e6c38d869b0ce1265977a06908c14d829b02307e3836c0602aa18d802685134c14d7994991c6bc4d77aee11a6bac43ba5f21c6ba05b88aa5f46b8cd700da5f014d670df71694357692ad7126b34d661acba5e44976705358e6b18d629ac43586bb18c882b0cf38033cde0cf3702e4590d4b9c31ab2a5c46a9894a923544182fc8635406a7e96d8e5d5cd9903a00d799c14d471a89a5a469f4d3d9a7a24b87974e8634ec69d574c0e34e2f2ecd349a649b3854d311a607966696cd2d1a5934b0695cd2a9a54a58cb8d268634961574106795418d23865cfc68fc52e7b347868ecd1cd2bc794068c5e4f22343218d0a9933134ad4352b234126820d039a0634062044f3c9233fc9748692e40c67f0cfd866e62ae4572b06a55614cf986a54ef2208d4a6f8028a0004c3c860c4668319df05e4288ca92cb12676c63589c8346754ce99183244604319ce339a6730ce584982c180434a800b4a64cdf84861d4a5034c09336001ac0008c39c014cd73c761466b171399a922a2c55caae23ae4a24ccf199d33386668ccc9998332a44d8ac780c70002b0cc9a57a1466392bb0a06d818cc519890a8011bc000940a7a44852f90d330cf17c5197c32f665e8cbc197105da692b086a4fa6560aa38e32a618ca8994f5bea38ca519495be24340b2395328a6510c9f993e4a8c5a936479005e200ac000948f1c18c99000110f0f0c97aee11a64b4c958aa4c864844991f6b4c28c8d9917322c644c925330c94bc31908320e641469904b6be25aca8631feb730498fd4a3400ac0009031e663c292a828c234944318d731ac6354c6a18d34a0a696de06783618c6398c6782e3a922855b6418c555240313f33548989c31363f9c73c0b0b48e0352350a621e0e38a78066202917987a04a658c3cbbfc12efe43187030dc61b5dfb125b001a913185b30b54885df7184977cf1d0513a460c113c3521c493860e56b81836306a10702d9800148b5b0c1524911cb59c0d780f5000240c1125f21260877d409303c3d444d2110cef403520b0a6001de517f5065007740c50001385fce9030aa40618bef862fb614bed17d92fb00d309350d0ceef6b4f8948a25f1169d0da3f65e9a8fa97a022eeb4305800d47c4bc617891d3c2a64b17872f0c5e14bc251ec2cee7c2d1e669d228bb5865a321a8f1175f2ebc5d7477e152eb74774ba997525a105d38d24030c5d15dc60a5a04191f98659fc1a8e8172907f293c0923e12596251ef8677041835186a3925c80551c70d4710b8a17112e211068b170fc6b2283180676f01567285a3785be11dd8d2dee5bd8b7a96f42de65bc5db616e82dceb359504f50c5b8d1d616dd0c40468da8547465b391d016cba362586d486a35a8e3c551a576a85a78b4ed1a22c5a64b4c05781c5a582b794991ab2d0b48168f2d1848b45968a595a5a18b4196822afa78b40167f92cc3474205768618b3dc11f1459e4b3c16762ce72f04b235d0cecf03166d46a859a46bb380cb2583234d0ceccc3345f0cb23cb2bbb2c2ca85948b1651467c120c0011159148ce84ac880c5928b243b251c590d1970001185900b1fac811cb1f8b1a96322c60ec68087028b00028016306a2f8589034988f7245888b10961f1cec402961c2c3201ac000902c30585dd84160f760a3278ad21d2c10ec0032e0344053003d40009ca2d8ebe050c880cb15da1409a2d015d79062bd14588af295e20c3a0b140009c2bc1457c415d975d029d728675c21916f06a2ac570dd6f0e0fba0d2c451520c56e8adc15b72b6c56d48121a8cc01a8a68675ab7b78495aba29229d6915a175a03961695992b30b0a4ac9bacb348ac8351420a8ab0ac10bf600d60004a0bf30c0d88322a70c55ecabd513b1c8a78ab905250ea84a89b15692ad0107c01180013144cc3154a096623dc6ac050cb00a5dd895800195ff06756654f4a9d227b24113c33aaf0c226833aaa2a5454a689291a2461688d950a0ac8758488b61074674a0722580d445c2abe50c5690314fe97382a8888b441682368873a9757b234a768b3515442c322390cea4059389601a4f1c2d10529b344055e3808d00560004e50fe750e2a87da2232970af00927750b43d910c1c261c1030350f22940281b98602841910686292e5258a4a62b622880ca46948c2914ce20aba7028fe2a6473a6c0ce9a03147228e02988a0628de51b9d31946822519f86d09a1c229dc20f802300025286f1459125160a2b945637c44840886a1a651355c30d0e2a14a251449288c51110e696288274a04d0c6286850c0a1612748c195b886283e14a0f50bc1542dca092b6591c248a0650b21542b49f593eaa150489f293e456a24f75d169627ae4f549ea13d327a24f409e793ce744e4f295a22e278c85f84d012cb243c24350a074422826906a1384ec89d793ad5668549d3096a0bce35588a16612c42580713a2565626cfd9390271eac9c9c381dd03140005013840c4e0d58f937e26fa4dea8471926e94229d01136426c45a84305a1081a83f934a12c0349a4212a268341e495074264e12587132626484c8c9911321a0d8abe898ad0698b1ca6832e250144c0908089a0c419cf00525ee0ee41dc00f50002509792ae71524f4339da25d0e760750590b41571228a73a01995c06559a4ad9ce492b309ea5a82712ac102607740c500013083043080b0ce7002d04718a026821b9b91341009411281250016d0ad03c0c49e82d0390c49c55558924d140d0512500c82148e000011940b832a8f2470aa308841255121826f86e812e67090e121b03140004a07120c485c90a50241d40883621523ea110c07a80012aa9d8311eebbdc288f62041141ae8a4c8a730ea9a5a210d23c697c84d017730114c471a010c475152d11cd2398472c8e391c4238285cbd06a028188d2201f1446768068a23324661cb70e72d616804829c0e2a3680386a00a188beaa32153ffc319b90bc406280009108ea1a7fd0622d8c4b44cff7543b29c8739550d3fd0311340c44cc8978a225844ae1128e9fdc1950606727c195030621fa43f087d90fa03d60d30cb93a0c1348310f19fca28146067264438f0ed8e9fc21ba04b92d3f3e4328c1f912190145cc053f3410d84798d9fb842e4c9b0404011e5485c10b79a2039c9190a921501a6c94fd60c427d4ef0cac1ae470329da0c424084729d421064208fb39a9f9641ca7e48e20d641a0833a9c9244198832906205aa44c77869f8418146053ea4184c08404e219c7f904589743882090402076a6cc81738f6327cfc3102399c603d40009094401880f10119f62e3b87fe1f2c32a68830ff33e463fbd4cd0fe95330687f1061fc23f81c718e3e2e3f707edc4a43e240cecc1f9d71c219c6f69df143f0624d0404011e447de020f01ea000480d270ce364338d40d3e707d00f9f60fa046c1b08001393e58245818a0002407c89ee71f1a3e2c7c50f89717e78c1f86219015c5c8f791eee387bb0f751ee6a588938b10ae2bc338aa52ae1a981a58001293e287a986951d3e1d4a78f4b1e943d1e7c249e73c7ac02b1570ac5542a9420c3ca07938f263d484a7bc051e3219044cf710ce25430f050d3d9c77e0a1df6a47877b97d10ff20a000009c2f9e1a7aec9d21dc45f189096d0c18c034f57d33a2476985d2143b48bdb0ece1d985eccb0ecb1d94e20868d270a3b09c3e0eba1d724e10b1e611d603abe7a8054f043c0bc0000a051f019c389e4d1d163a29f439502b0023c48e821d0039fe7a49270cc15c32063c6a236016a8e70b818bed863c60396872c8e582eaa39545829d1ca8e150504a53a50265dd854ba419c268e3b9e82391950508541a79e062e5a10100478d1c500ff810780f5000250693863c0c1a79b1e001c1d3ccc928be2e243818702a5d22b10682b82c88282586786516c1a795851bda37b001580012037a86f383312596454568de159b83a20486703e1a792861b8c77386e10dc11b80e05cd0db9077828302863b8a18b64061b601a78e0dab14a255f1e0a0bbc1a78c069e2a186c4069e18a2201f300012035dc6bb22ec1ca210337ff0a35906b1878c1ca1e8337fa0c76486af28751b3c00ec587661adfc24b00d326fd675c86958a693c34a86948d271d3bec306200cdf9034ef76fb02942e869de433a46730ce53a9833721e79e0d8845581a5800120750066985a31c2838337c2198f3b8941cb5aa2c33046601624197474c0b28340ac8758468cb0195e32b865611195606d85282c0d3b5c316040c3254337ad0cc1082b7a90c31e863c3df518e2a0749659a9d9a1a7650c612bb63a7628639f031630778e39de30fe75f15bc625a5861d0c391870de3c90c350c30d06198c3239b2493ff064ff430a9bc30e6f06181f84496129fc430c1918309fa860a0c132b2a3041bbc2217fe2ff9bb78bf72b005a1c606120a1a75327d414dda034e9f179c557474e9b0cdd703375a0c2ec45d84e9439242ea53db9a173e54d850b9e9d1e285ca4e8c153a1030b7c0d3a002ce7d2a022d4c6b73c169a9e6873738168e32606a7980c9e582a7910cdcce4678a162a2c50e2094d016149e18d0b03160070ec57d277e15dedc9c575ce694c70c4570e0ac15bc2b7456e1c2b15b22b6056b90210f908ca9ace65384c267308ffd1579396ce088aae07800a00000a515542aa672b0e9ca4be5c50a990a3f8830d580c2a5854ace4d1510062ca8a86150a0cecc1f919c8418df90614fe1d344798e6e0429bcdf48a664e76585308a60a1b03852e608f1538d8a238a4c43a04424c059c6618521b6ef147e28f8a1c170a3338b9b758a9c569c88536e40d389538c1ba313e89c557a889ea13d227a04f39b9a5c6e58336d913a01880681b60d385432700625a24298866da29bec4dc8333028a0004c09b8136edb34736c90c6de09e3899c0c26504c9ce00131937f4d26e6c940244b989700002330360612be257822b0d9bea4e6054def12844b2c6b6b00c9b3475d893b4d9648499b6ac36842499b53891b048c79b51069bd819e89820d005600048369b028a0004626b00c9ab0d90dc551c9aa82cde70cda5446d04ea1d379135008c86d224534e064d2e1845a88b42e143845908afc0962290d8108a11140da2d1130b0c2240447cddc1d376533c887535ca4bd4437886e10da52652cdd06cfc99b44288df7169469769084910904b4494dca0c8225b3a069b88f37854dc1103a20726df081303ba0628000a01020203cd578e6cda6a906280d9b6c1f6c3ed4db24c765a6d687b207e112588c29b0a1eb03d58d740f4c98a03cb87950f281e49b2c078e0f1a987c3c20d607c1dfc92787796ca41dd43ba4da05d281d94035800158699c3ae123f02b0023cacd9c0b3665b2107401a44202a60b0c48a139d894c0c1c966c7ae8224d8e8d2187019b0e482037b06f30de4d8ca138aa06bc182380608d218372046206960004825f20c0bf034d7b23e428d1386d3087034d105dee14979cd0a0a9ae61a6c506990f2c28d0211d90d180494091959ace19b0f059ac280b04a5cc33ee19a48dd06650cc667ccf09c70cba67c0719ed0c112407a8000189708cf306411c31fc2cd5518e62a6a936080c440b3894d4e0c1e96b430484bd2ca3742cd45ae6a24254860bfc17f5af90c436264552cf060bc0177e3df85d10ba0173daf69e22b816d0535e71edc25af14233334a166a69fa58c0b0244f82bda502e818493869a7095f8535dc225a15423d7126bb01669825700a6e14d829a8534330214b1ae8ae0d0002b2696869a5444082814d2624d72ccb284e19a4413412ae9a9a3a192ab066b7e11c423504661930588681647121a6c3254b088a23dc690c30cf1142842b2176782c6b5b7216a0fd85bf9207e80fc45bd83e90b24581f203e321560f781ee992807a7342514d030d1dfc1ba252f1c19903359b0d07d834cf80b33d20f70a20b40adcc7602ab4a2a0a4c14884c0440a3033589207c179c6ab114a0a1a675866af41a67386316e6774410090d337e66f4cdd01c24a66dccda49ca3a66b8fee141e303189a0d334e669356a1a3560327560c935c324d40d333666601551d3324c3f8a30f8192655c55145868335580cd5582ccc309d429aa906997c19aa586496a19aa40501ec19258860e0014c29d3e91092b033542308f866400090494619a9f983e144c5c809249d0c60e050ecf3e1ad4e4306c80d32b8c180a6a6ad4cda9803d2241a8c318201ea815e07352b0c922432488490721fc74ca948fe256ab866a4819a910648f01a65103451491c43351a0c096c324690b326e64c8a992e13485034c0cd43428eec1dd23140680e60d324a64803d21c0bf03045e0d322df4d89991016643678d14038434c83486a2afb28669ee146b28698fcd3d44ef0d69e6153053ba60eca01ac00090120897c84cc7969da143474c7898ec2a639cc720e3e392078609a419a70829914d374304ba0c09ec07a800118d36835f520d1bd034c68be9438c91389198c80fec54c622fb62a62fb4bd028c380a106be8e19a5c861c042a6007a800121315834c5598a93144734a80cd29434c4b05f829a5106475e37449658d47585b743100d693a16624cc48599a39a4b86473c182fb864736191cc0698801661d86470a186b8058407a2132c001150b001af988669088df51bd081124d1fc3168c0a8dd434c3368f4d1e06cc320a8011bc001112afa1448286985d30b1a370e68da59e469c3208228d8034bc10b30a1a3404f51b308c34c219840d18873b330b30680598a982c008c0008c82201824c0546845c284cc1368ac2a6094c0f4666590436a9499328cbc2df140cd12c34c0c9810241630668841518d062c54d6a84daa30d301065c0a196c16f8306687274a048cac0c58581b10946181a5fd0697ee0a94511b50c3248323030d02402cbf21910265f7c0e6157be42cbebbdec291760681b61940a861dec14aea95d3152f9a5f286051d2f868ac8997c066f003580012031003340e0cd030338860a40903032b0d2f5ef710abdc016f6f0597a88b04515a00d2f3d9fc8a45741855886456e1a5e506817c1a5e4cbc867d4359f483d214cf9835ecf0c8a64307450c5868333df0c1ce83235d0c2f4434bbe2aac554c26580022a8a243154b0c9f00322862a8a1294e941211741a5db8645022ea85d3848300045913f86bd7c199e80644f4114ccd8006b0002519e68667961a5d6cbab07103a5d4b3c3152e999df8aab961a5d08397011e3604d06676e0db0505440d2e7034b9b44902d105a0911380160480429e21832806675818a758629d21a5c986972218a700dce132e3834b8c673c530474b8a0c9dd4322200b2e1a5c2a21b1c88643040c0d7a602b3920c8830ad20a07e112584a20a0c5248302ac0c3fdc3220515601a6074b780d2ddef478a6706190fa157d132dc988a0a96e17a159b98ea1b0165b6337109a43838c8696d52d98a1f0e4ba4190e206287418c0503830d2d6ca1586d52932490dd941f152d6030f6a0c50602b351282c504c44002d52c077c321ac5dc2265a9219f37300e5c04795668a1a5a713f33724389f7868ba6180db069692ccf85333b7a722a5a313d2152d0c2a18412c02441006430285f84d012cb24ccb434b3e0aacec313b10c4eb834b3842d825b18991142d2859c5045e0cacac2cb326632242cb86965c190a88605681a5954b2812249c34b2596462600906660ccc158678e427c1a58fcb1e0e9c3909b86963618474176b1484b8202008f1d2c5e58b21271b2c4c28b050d2c465885e341d2c342278a9616ffcc4889a0ccb7196d0a960578b454afe0d36240b90695f44bcc4b2cb3efe29ff206ccd61649e8541de1a57a12e4132bc65778965821a576a0e01437a434ae90c834495e09419c183180641961a5728d27132b84332af0d2b7e56f4add41764494e07f564683905c07f31b6038d5106654a82cc54ad795aa28195860f9010bc0118001201f1c3e307401b2b3e565caca0f3c7050ab2910c15e02a0900c82303328d0d780c320860d2b0a5600a40f01d344798d7f561a55f4abd0e643655d060c401aefd8720035e03d400095956e133055df80d2ad00598a64dac4c8520590d2abc31a2b041a00ac00090955b77c44caab95552aa6ef712954e0384519330c80f031a0c68828bac000909546c96c34c0d95401a54f2032152a6c2b25525c829017202c1480a832a540d2a503324a0c0384320250c0c80311a30c807c35dda0d776032a410d2a2e54520151d0378320130d2a1546e897ed21807b0695052a0054a7d1b5629916917214368434a790c7fd034a76128c299108694e2452c51fea0cc87431fe00ac5703c74a6e225e2a535866423836449fcc9a5a259050694cc2f5c5050b0d257829fc30c2f4434a6094bc43e474a5c94b7296838c92099c1a52c31f714c7d88728a63e913bc4b1f221b22a52a4a52bb44fcd894a500cc7902869b0d7670290a3214052646b1e063bc28fbd80f5000236522ca4314c765f908a948042000c0817e01ea0004c4a3f20e2298e906947696f054a380d28d834a35946928ce518a9bf053003d4000a1638a180bf00f5000234faa1f5214c70c8240c501c7d3430af80cc6ec81f05e71aac4651531b71411582869b0d28a08158a07741a5129f3b1528802ca1e0c93c02b1ac3e5e298d49f2c1328607fa857b1a7c9e0368a634014f912da012c66c31f1a0c1dc0361ad0d284a5089f1471c245c6e8520087a0008954830cc6503318f0c349c3186f0cc62831efa0d28143297a0a7bc847b881f3ec1f408d83610002524ffc9fcbab8398bd846914a5a4331770c1b60338b80daa52646b1721eeb0dd068a180c7b60f6b0a93e327c2ea98e0d541a4f749ec1527ad8b000b31d27a854c893d661a4f2863d561a4f1c9e162a2facc91e9f4df22a4ed86ba8a184cd04e4004600048314262802989e8693b12758f410e93a32742e9d0d939879e034d8d2f6e1989386938c79c0dab8e3cda181fd86623e1988e8693801a4dfc9bd14c45d47c0a2f0418f2694701526e64dc31121ac4418870a936214f200605f818f1d8693561a4d41e342fb639881071515269987c8acae618242061c841ba0484700d26864d01e1a3c2c5cd4b30ed0d0dd02b0eb2e5a10100479161cf10904c99a2e262a4cac994932619e49170a0c18c0330d10a15243498e0d741c3498a9313741070de159b82586386618cc30c4b0c03ba8203a06f113b9c3bf0530bc2da23bd86c9820c36dc34980b9fe2a4bfc97d92f6398578692f236205497692ea76a8749710b25bc305780cc278307860d25a43309761282a4b30692c8760451d780c14243495d611a28eb78692b6c2244c9580d255c3828a92aa0e98530790cc1dd2e90925c81807b0660e41a4a8494f929d2530943740d25283628a60c819423062c681a4a308111474e43740a058c18e9b06198697c84c94160b42a49f860d12180e90660a41865606927458485304b0cc33c33047192a2a499863a261a49895f5150ed02b03f607c31c117a92b9841981d3037153b1c3492c60642a49495cb1431403302c0ac0ac6d08939ce97c84b0280cc0983491d710c242e0860f981a48c05b4132456489bdd61c64c8000892b4818e67b77f13243c35cab0cc0303158d0d24245fe8bfa51f04248285600a5600530030a8011bc000902afa1848286069814e5a8639680cecc1f8d0eb01a47eaff71523ed7fa8a3f8019baf8591f01a47bafed2a9412cc47b965fd4551c548f411782a479051aac164778608c0acb452fe10d23b0e410a91d5721c548e591c92384727a40af024a870b69028a0004848df2a162a46f3d941523717e6836c1d23604260a29f61a46acb9712bf10e2aabd41c71400631c671c7138348cf0c187832fc00b232c35c730c087c30aed15d811f58ab919192177852fb30cbec4348c20c70a4348bf0c16b8348bc9176706872fa30cbe84348b75f36dc486c8b591681dec7038b0cbe50314780d22b831bfc0c0f4832f8e6228240c58691526fc851bef0c5194348a65f042a4528a6e15228d7bc0a5ee9823c4af7237b82a44c00f5000231eac84912c02cc5272d0d22517b40a37841a4489bbe0866000483d500b22307b70a1ed4197af06140e0fa81b0800121221e4432f551c3d3032f520c02cc30f430cbd3c31b920d21f09f48a7a80144e60c981321ea43b0a370e4b2c52f420c4f58348720a0964348705e742979a86b854164360ef8146dac31b660d21a57958a4dbe11f58ab8d1db218db0845c0314000482f240d2190da90a5e381a42fdc19123af032f170a6d28303620d7044307830cbc38d9c0a5e1624242a0046f00045642b8611fa05600478d90ab215021a0e90a49aa84c8505e04289a204ec00d6000485bfc0c9a64ba7097a0e165dd85361822d445a048b03140004c4848263c2977810c812bbb8d8026851b210c6c40a90824c0c5483f5dc86bb8682c60d20f443ba5f21a1a8c30b710c6b98312f30cbb7176c12dd1a4b643483390604b2c69ac80d20b7231895d96096c537d80abb183482810522a41312b815208c3482035522a40dc8195d704a3c3f3047d62ae7640b86353019758aeaf1498dc32eac0d2044303e70d203e4060a90141a404c8085d3a3a1490624a61974c0690061974a85900248fc0ac008f2448f431a610d1ffa3fe0ab78618d2ca6090808023c947f90aba2030d1f0d1fd63fa0d181c692c347f28fe11fbcd1d128fd668dc547ea8fd068c0d1686d72e40697380634321a3f195a4141ad431a114bba1a981a58000291f80347df34084765ff2115cc2b978547ddb74a208e3060cdcc55c4c7d833e624cf919ef625a34cf705281446a833c860c31cc325bc0c6774347d38fa2288c88633b218167068f9ab904519d20c460c35b910d1f1d71b84a91c670d2d10a18881824306a52417740dd03610002523e0068f7c1144547bd8f78b8a48a9128f7296200629499231ede3db47b50af415e0ac7b35c382970d068f611eb8525760d1eb2dbe0a0a8011bc0010d0a7a44852f90d8f4e0d1014c00f50002500c5848f481828e065c1018cb79fbf00d60004802ed0d1e897010a32c6133c2658002231e782adfc0b6dc8ca80a2e1418ca6860dd014238065be4196f82dee151e5820c0a2a4a18c9c068f1a00ac0008c8f140f9c5192f5dc2256f1865bc218c90850d2a18c8e866b48156ed06322419dc0918d8f0014c86058efb6d884db5f0b1de0d5e8a8eed1dd63ba47722463a830ef60d1db96e1a5101d1dae122095b8208ec37a034b0002504b6865b7e941452dbc0cf06c301420c4b2c2c7620d1d816d60a8eb8b6a45189f99aa26da30606c41492985b686196ce24d41293483018b0b1d456ca0a30fc148021e80022261f03474e5b1a5868732080b1d216c20a8e8ed5484c7465b0028c315f95151d1033bef0c9294347410d1d0239fc73eb6541b20b2d6e3050bb846c73b13fc281e9065ac6181e0865ac348347a405643ac25639bad571419e432d555aa02523a09c5151cc1de58a8e5f1cb2395c72924b50406294991c0aa407a8001191c9e391095a741a3902d361416e03471db6140504000908e351c6238b9794221e7035b030cd3dc285700d1c444ef0a2b0e1874d060a981a385c70a773e3920e868e111c1d68c2414892c5968b0611a41a3808efc131bfa37e829801ea0004a46fb8df51be070e490922008c000902e84191fd88aa08cc32608c6f28de2b3f8751ce0d7e0bc4015800128168c346ed47c24b2c6a3df0c5f6c288780c1a8c32cf00c0ee8306920d1b8cb8c30dd1c8f3c346df8db837c0723c20a8ef80158001191b5433b710d7410303200cb370296ea0c2580346cf59ac2827a8659a41a365a3a714b33d6668a8d9019665061b561a36186598618b5a0647221966051a42d485690946c0597670506c6bb0aee01ac0009050fe183c7868d711ad63598e8d648d9c546ae8d5a59da4af118d591aa81768e46aa191a8986814b26068addb01ab254688818b1b6ad03345f0cb240346a42ca42a3512c8d591038b24868d3cec9452c8559078ca86c69b0c1650305920d1a5e34a469358e232e0b46910c077c3469001662a34680fd1503cc2ac600c3248346872bfa323432a128d0ab1505467e58a2b13c746748ce42a3370645bc1a33606337a18620068cd1199d16a8ea2a016332068cc6409052c390c30bc3465d58682af6f0658634524551460ceb40246530d194848f8a2b20196120618041915786b4e41a3268362148a9c3464958302a3234645b4d239d5d4bc114b034346400cb00032bff44fe2a31c068c6a54c4a978e2a5c23dc4abf8755454aa1ba12a24a187b70644ce18a8f0616f819131068c5a896855a560c0e60346282b482a312860698191230629e90240494f10c19403461e57ae53ac694e90d187230dc61a104048a7112cb14af38304e50caf3032bc80c12a432bc5750e243f4068c2518455e00e4eea1a3072218384c388ab034b0002315d9868c12180a106441a181f8449612aeb715b09440615ec52ba80f26295d2062900190fd0643ee9d5852b9e0b17ec32b9b068a28262860eba199be86572c519c53f874d08660000c62a50b17cca300a43c814a2c851a481a2f8ab8da1b03a2f745edb44e3a2f484c514f570345e6b44228a1b19bd151792d0aab704372287679f198bc41a2f02b6c143d9832b690d17722ed140a1c869c321a47fc8255af86b4181a2eac5d31517462e7c5cd1d172c4d80a8b901a2e3ab45134896f08c5c48b8517042691242ea1a2df45bc56603acff068b7516e62db8e8b6ce8385137c0d16c62d7a1461c3a68321410ac33c345a90d67c0345a78b4d169283f495e2a4d24345a1080a2acf38656061a2cf028c15167108f8a116c1a2cba11915165a2caa1131d16482aaf70c2261195098b1c15cf4861a4e162c6458a8b131621576817435675032ae70d16183458555be83ac712e00c83a032ada25a62907006 + +def cs_11 : Nat := + 0x1b7206376618a0a06c10a1938c866dbe15b6f36dd6db8db6db6c13e6349c10794819600460004a89c50c9c04360786da09be46b6cd0cdb228b40936f04f1c4b6c427882b0390681bc16700859bfa19b5fb6bec0d83703485c0ca17031866d6425058ab8de1500fc224b0dc0ba1b02d866d4e1e0c560576d382535788f313c27030e750cda613530a6d29378eed80e6d26da44536906d1e6c24708b209082b026053604228436c0e6d189a144aeea0cda21b423cfd1c99f0360440cda0db4126721cda05b40367d6cf8d9ed334032a0a3023dd2b67704b229b3b36759b8a38d5c25bc126ad834dba01c22840b86c0724aa8512a80c6ab8401000118d9bd3232eb51c0658011800118d9adb340d971c17183263b0cd994d478a853c181f986c0600f9c5126a0c98a43480a0cd96db2d77681b80a82b6544c302974a866c9c18920069b3817011861a6e19b22601e24509cec8b63e0d806c360189b0c97486b6376c6c5c286b6346c60d8bdb174d7f2c97c83362c08bc28d170623e419b14b628e09039b12e8281580382869b0c05c8305780cd88809281231ad881b0f0a0730192e9060cff6e944b61a4b9867e473618c0042affeb6116c2067888b60d0c5e0bc8736090cd81c30f0a0c38186d175800120d811b01096c02d8012030e6bf2969855ff20d7fbf811069a0002412cd066bdcd7a9af4b5e60b2e5aff5a58cf546380ba06bfd01889b158f018e0004835de6bb4d76074d304ae051c0703450c062c2b5d46ba2b8386851c0d34a0b0d094ace1a693056b9b348c4dfd90cd70cca9049a01ea0004ab5c26b8211a4735be21a0591c735bd6b797f38c9e126b72d6c81f98ebf96d6bdad7192b221a8c342000cd6983191a0c2190303a1212e97486dfc40cd6783320abf8094a0535950c6af4335920ad63cc778a31da1928b06051e19ac6358b6afad5f1abdb5790e8076fd983f7140dcc314990c4b2c2c1d80c93a4c5380c529324666c05bf5615ab7878b004600048356c0c3f9c301b60cd5a830d580c9d58335676acd0724735626ac0240aa860a4618c3f0520087a00088b55c6ab6094c735596aac2a66106892c19aa9df9814d529aa40a6a8ed51837f806b000251257066a86d509aa0b5406a7ed4f2fc69e6a7216fc5066a6c1b7d6352f6a5cd4b5a96352a6a52604c7a0a5d25291fc33526bf0229a8eb51c6a3639e4924690a3c5434c990ddac830efc0cd43da868a6a18ff904cc910c9130325f20cd42159689488e19a82b5046a0239a8034ff69f88bb08979a0ad3eda7b891aca182b78141000232fb006774e19a77b4ee69da1d008a41a0cd39ab498911a418730065a26182690669c2d37da6f07f905000004c34dc69b77d45a6a9169a6d3444df4b98ca29a62f68e12d309a6097201cd2f5a5e34bb98b845a5c86696cd2d5a598df906c459a5823c4478436f9fb4a9694d9d848df3c47585b7402a0023000261a4e86474e18585829e0002311d19dc801ea000483498692a2424f0245000231a49b492987ad23261d96690e5a6c505800cd21af97347f1a5a3032cb00cd1eef948a1a9c19a3a053c157c90323690cd1bda3696791a70c820af9f20ad1ada350d2c0808023cab46809ea2af8e86822e19a31b46146921bfc035800132d17a60b8a68b6d169a2cc10d24d15c677019c03320004a4c100cd142f89b44d68997c40b4c080cd111a210a68808c6052c720c58943343f687cd0f5a1d8cac2cd0e1a1bb436686b7bf84e38196004600052065c622829a17342d97e239a164bee150398334268af226f7b06683cd06c1a5800122d069a0cb418682e315c6db991302165f0b4138cd834cde856820d0384b40d680ed0183e5834b0002603e4232a128b3580f096806d0065e98e67f8cfedd680dbdb21915b8667eacfcc48c0e67e00d88533ea0ccfa59f433e767ca55b447999978a199f1161a12cf7c35ecb0ccf75147955709be1ba0aa28b0ccf699ec04af086e0004a5ec30ccf4d9e933d01ccf3d9e733cc97584a89285678f2ea0533c40af02a5d205bd68181cb808f137ac4340930d7aa4333af675cceb59d5dea2446c4f1ceb3a6971ace8d119222f298a3140f339e44522a5c5066730ce5c56d8c352288743221b0c8860e130a672cce559ca33936722ce419c7b38e671a3fdd5338c96f0290ff86bd1e1af460667032db8a340ebd0acdd286c0e66e4cdc59b8336f96d087490e81d96ca1852153e91297482b36366c2cd825adb35b66b32d60f5e760acd4af38b34f669ccd350d30f480ac875852b347668a249fa0627e66e48513ef0d799c9f309bcca1af3113d54df236f2fb333278e3af2d86967c19994b328967239992866646cc804b31d6639008875e510ccc4e596b310661e0ad0b0589018a52646de4b0c249435e4480122a58e8665fc84dc54b1a65f3ba0075e3b0cac1435e380c2c143132e096623dc6d54a0ccb99972f5c81ccb8597032df2628491388465b8cb6d96c55422378b434afd0d789d07a8a25e619966b2caccd636f1086658e83ac4b2c565844b4c732be657acaec732b9656e18c06b2b56566286938695c21595855321218303057d0c82ec332a965506a8875e0f0cca803e60a653a49fc55e0b0d99483058407a2132c001110f3c70504de070cca41947b28d1aca2433288410449183b225f228ca1594232836502442868640e648c087f0e0e6200044327a0c402993c1a4b14c9d59398a64e218e940564dec9b2efa10c822c9a036a94991a1b4c21c0940941b361ba0d64cac9939208e01c2181f98664befe2052a660ac96c34c0964b44765ff20e64b0c95d92ab25464a6c945928324e649ac92c965aebbc0199248c7f1446843201e12c02a546b2456486c9083101695101a06f05647a2c2c14f000120c8f10088b051ca374332370c03d4000880c0219919ee1d14c8bc6d08994f0c8a1913ddc92216ac806036100024591100e114fd643321f643d770c6912f0b76f99069fcc9a5a45905b208127f18291080d76e19025db61a43f0f1c096400fd2053f450a1348307190c344c29fb10d76ae5298a3f461aed13f3615293d8f38b711c1a6c331e263c27e0475d9a0d290c34a410c2d0c331d8947c298ea0563a41aa5586639f7638510630c41742ca320c0d30331c7638a24260063ea8413055d880cc6f481d0a6370174855d810cc6d2ebf0a20475b94531b16360c6bd8d6b1ac6354c6a58d3b1a54cc6918d1b1a01b75c83319a6332c66016712311a06700cc8001207c51c708abad8c6547de020f01ea0004c318e6318298c5063df41aeb206bac2198c25d5e143e4c35d5c0cc5ed8bd317962f0c5daeabb16e3cc5a828f630cc59c303de45d824f661ec863c8398b2316362c2398b0315ebaa0381c58662b52794531550d2788349e00d75218a7314c6290c51c786099d09d801ac000a82fc4198a13141627d7500949d50cc4d8be30a626ac4c84dd3a0c0d043312b6252c4a189331256246349ceb1203cc87980bcd116238796da7b8d6236c46988cb116db12541a2862ef219889066220c43ee948e621625804dd2462105d8475d206202f9d8730f90cc3d0330f21c841ba06b0f03c3a2ae8b057cda1987730ec61d6c3a9874c99934c36d86d170e1c1550330d561a818c0730d10cc33c3498e0d263033e540c145835d040cc32586430c67c984986030bfdac43a4c2066174c2e585c060524c2dcb63bfe41b25f833e3c0b25ec35cfa0b25e035cf50cc2a09658a3b520fc224b0d614cc29585130a0b9e05a4b485612ec255849875824c249848b0909782498475ce814c224349580c75a61ea8a0e0a19bec0560f6c1e983bb076b9bec1c467c3132434f8831d540cc1a88640960d394f04dcda0b73554230a464418666888005aa36e69305f198c06bc07a800130c179ad50a60b2589034988f723732d82a5cc91cc141827092c222a645304b0cc129824b046608a7438b30412be431f81b080012bb46181eb03c6074c0e27639a9256198190539ea0528063800120314cce284370002418171cef0bc40628000946056368451ce74be424e72845612c09d8128c351ac08c812096043245c5301d922829278067bac1980b30156028c049808b00f601cc03115ca80d7294349030cc0083b30a069818e5a865ffa3a1055c9c0cbfe05ee8a5fecbfd17f9aff122bfb832fed2a9412cc47b92d9e0181d30611781ae488691de1ae4686b914197ee8591ce184418691c6197eaafd42a1e380a1062a16181d6081114bf457e7950116a64646c860a881ae3f0691a8197e2ecd715b35035c770c3abb846afc00cbef57de2fb90c60497dba77b14368432fb45f65230872fad5f58beafa43119174197d3065f48be88e0a0d5f3a70245275c0cbe5c2dc625f24be457c827512d716c32f8b37e2051400090e1b4197c386b8aa197c18fbe14bdf24510a5ef0157ba2f73d9543ae272f6c01663ae2506b88d223d1978d377c23cc4dc430c0e2030f6a0c6ed0a09888009c8008c000985eba503c548850d70f97a90901661a43f86b872bd282a20eb86d21e0dc50d3712270055c315e8321c875c2e0cbced79a0023000246e15057a5e197971b6a96723579693aa14bcac32f290cbca179309c9361a4310ec4644636e0db15715706428ebb07e112586af170d7054303620abc4c35c0f0d703032f0a5e124d6c753140c6ca032f0790a22ae00065e064d105e50e5e00bbf577e2efa5df0bbdd779268b08cc326155bf90d6fdc32ee95dce297731499156fc833cf90c21e032ee063c82976f5be95db4bb5e4189acd259c0d0d896a5107f0240492cb0c6b20312c80cbb31765aec95d90bb18b082b0cbb1532b8a5d89208c5481f0cbaf175d87f31b604975cdbd85d6cbad2deaaeaeeee074d4786b7a619753480e14ba89750b4f71c1e442b794991b6f3035bca0d6f2032e950cd9382ae925d22ba403a7125d1f6f0c55bc00c4029e5706349a18d25868fe218d2386b7721addb865cf01a3f486794218d181a2d0dae5c808ae71b75eb9a1733c7e02c15e031a0423b2ff906ae615cbeb97097211b74a1572c11c314b95e955895ca667c8cf7b12d236e782ae50790c25725db99232a4b2c8ae485c8eb918310115c88186d175800122b90171fdb911cb8e991a0a5c6eb8dadc685de24b8c40b880011866c431ce00d6e1c32e295c4cb88eb92925c44161c2c203d109960008c8581227c15ec7069a00022170f999714b87570d0a4af41570c25761456902ae165c2ab85170994702a0d14304c50d1e9032e0ab6ee958472e035c02b7fd6fe11b6e65c2852df60dd024237800212b7cf5f60a8f2810ac85d9e0b221060315250ab7a23c70a8f140f980008c5bccb7916f08eb6d0196eeaddc5bb438c8906770246356ebadd6786a3a3bd868ef219aca86357a1883706a4b619e15865b8e63b09dc8e31d41877b06051e1adaa18d87fc834254011b06c2000482dc12084284b686b6a0196dddb4b5b6ab6c892dac0cf74432da90cb696da30a06c418929865b3ab67126a0e5b2e196cb188514b64c3aa0a30fe196c80614f409600358001216ce75e00a09d4196c19868156cce3a1ad7a77de496bcad78748c3822786307c2898b900eb654b5bed93bbdc24b59ad92095ac2b581dea8d5aae196ab473206c2000486ba90cc45035b1b0d6c642a4640cb5116a1ad415a800aa8b47260d1c8832d3b4be426d88055a676c344db0b0b1c64324380ceeb435b050cb4a96948d651cb4a0bc617891d3c2a64a85540cb49569228f81aee9c363740cb484bb938661c1d0032d1c5a36b46968b8bc32d1c0032d1209a206700cc8000298dac302990cb43828b050b1be032d065a0ab411680c1532a8fc844f11f21cb3fd67e2cf959f00fe52781ab5d2b3d1679acf2b5ca58979868dc25c69ff20d47a21967746ddc6b23a36d86108c97c84a3c20cb38e36a8a59c0b37d66f16ef24b36417e0a47621966b05b5a0191d386b596b331665acc95990b31d6622cc22d645abce132e5980b2f9daa8e8d7c1a35d857700d600048acb8596f1ad91ba09dd000261da406b58019652f32a148d883167692bc29650a35d14ecf035ab80cb26d64d2c951a22062caac945926b249648bb2d2cb239d948a591a33b80ce019900025119b062c8e16d5606b5501563cc69614b1d435aa30b6a804088ab53818059868d18196322c632c06271c0cb002300027162fbafc156a442ac558cf5458c72c5158a057681a580012919c462b8db71d19b832c478cd8296228c4014b1048b78a45aa1961e95b7186a344aa865876b0e961b85b424b0d032c328cb22a8a3065860b0bc2bd8d58524b2c4891f0d69d86010a5844b085610090a24b07ad370a583214943aa0d758019608ac10d60639606868c7eb011600abff57fb6988c1f9e2a622e5c0008c44e61b57c06a24a187b70644ccc55c4abf40a2df02abf257e254282b21d612aafaed2b0a57ceaf94515a40caf895f0034c1caf795ee94f11caf6ca770ab49b2e5452bd40c88e433a90164e25806abd257a2af3c16a92579aaf255e35a4315d811f58ab9d4448195e0abbe75043ad1e86b470aeb715b0e5752aea15d32ba55744ae875621d573c195ceab9c5736ae6826296573087b44ab96572aae4ca311228c0195c8ab8f571c038495a2a03ba06280009057121ad13860532195c12b818bca3ad106eb914addd0df0ab42d178420a495e22e90035a1156d0ad964709107bc8bac0008c2814195b12b6156c0ad7af351556b3682452b520d6818313d10c82244d806568f00c4506360cad155a1c5c31c85ec33a210cacf559d898b7a19d0d865662acbd5968e42c61acfe050b4a0ff810780f50002522da03e712ac883137b38282558e857a0af03958dab19428c3874d06b3e61958aab14b3e039e8a068b4a1909a0656184d24502fc0cac21583ab051cac103890a5605166c52b0156001258759e20a11c0321121146e918759dd55ecabd557a0d272cabc8015800118e790320fe0c21ecbed8955da1a680008cb3a81957459d01421841cb808f1aab7d56eaadcb396ab5caa0e00cab5106d8a55a0834495d80f50002515668630156718359c3738c29563862552203a06f0e10140314a4c8eaa6415562623a140ec032abd12ea03d4000902522178c5456a0c366c320aa25064090745660c1068320a40caac1557aaae555b1574b2aa8554eaa8c72a9e8aa0aa6154bc54d2d669c9111a4d1c692c3121c2436062c692180a818833995347e2accf8640b0355852a7db33914dc9659154d8a9ac8f10e4be41553186d46a1a298850d1524f44d98e25c82b5170654a219cbb85bbc018320855494a92431b0e549031cc525bc0c677432a440b147c2aa3ec3fe2814e07151566043597e8a2a295168dab1565e4291720d65d48b6312d1b65cc3596e0d65a550caa18542ea85950ab9463aa850fe68a11e615506aa09220043f8959610c7ee42c4f653fe1338744f30c7eb4329f989de254faa9f453e4a7c54f729ed53d8a7ad4f529e9326c1010047b50d7e67744c4e40ca79acaa29e11c2ab031f810c7dfc299183ac22aca706b296a760529d60b6524329d10d1338359460d650c5900a898ca7144058e53880d304a9c00b64f83028c0d64ec339010b12e830edf0b12dc3593471e2248058acb00560004829a9315a296d605534a2ae40d780f5000256c96a99a2c3201ac000945330194cad92a53231290f89033b307e7625105d3be16c91865314a6254c40bca24a6194c2a9823dec48f7a0652f4154bc0652ee61545297552e4294b8296f52dc18c091ee80d86682c4880ae9183591171728cbc68f770c23cc28f7586e8294b1a96152bc7b4c9295d52b6294ac0688f8a5494a7bfe424a5394a6294a52920e2cb44750d641c3029f0ca4f8f52097d661549c85526ea4d878c86412226c0329323d2c25806a9302fcc29495865254a4a04c4680d63e03292206982a23206523aa470f430e88c01948aa9145224a441487817434a435486290b521563ac9659970fc19481a9025200a3f64de96b1d0182a6062f041b6c48551eaa3d00ac008f22a3c847b8a51e0a3bd4768e1cf219475874012a3a87369e3a11c413d4b08dd0ca39d47328e41ca38d47158d81c394daa4093c4e1946e28db4ba43546c06b1a01546aa8d451a68ca88842a0c38b820e841c0b660004a172d0808023c7383d0c349c30e2662ae25466a8c914a31029e003efe2a7998688381a20d052e1c184ef0651761ac601dee2af80aa407a800130c330328b4516637ac712cb0ca2c545828ae1ca2a5c0f0dce1aa289450b81a1d62cc2b8170ca28144fa89ed2bc461fd06616216c569db30b7858689288f511aa231854924b78174ab05511219c01853b4a18ed18551041543f8650fca1f04d89e50ed6269439286d2da5202c3db0b625139d8950c214310066fc81ac470660fa046c1b0800121622a77706e81aa13c31d540ca1386740ab104df2c4c3cd0d0f2c3284487922ac3d817414589434ede0aa0dac3b8ab0e619416a82bb0da39414960414a0a1413b0441ca0972918950490ec540fd86524a068631a2eb00024063006502e5760543a850250e95406a80c501697c8f280908aa0a2c00090500e66c452805186a29c43068736193fcdede156154331570a9fd93f983f009d2008c00098b09a9f985158d0c0d88289180c9f8d3f158434fb655f015480f50002813ec8bef5ffe36c1f002300023347e864fa49f453e8583a179207ac1a61db070193e0062a8e16c1a864f729edc4a5f20d0dec327b14f609ebc5c7cf3e2a9eba1b88b890812101004799b052193d5a7a9149e9c5b30b657fc8481d601dd0314000481c6e072e023c7279f86c62a1b086b038193c927904f1c3b46e864f127108527874f089e08758100a18c031c350c52e83580b0c1a6c306980c52c832773b00a293b6c8bf149dafa430ab004193b18644101a1a106affc18e04864eb8193ad8a99143f88357f60c51e0327544ea69d4470a8a28e02abf80602aa153a570da149d213a3c32b1a4b2c28bca0d43602c3254e6e9cd939aa7344e6623dce84b00d5f8c357e04e4e043814580012adbac2a7250b0c5c7bb8a4e441a18986142979d849bb30d5f5c3430d0d5f44dcab3431d5f34357ca138a29380864dfe195c526fe4dfa0cc4965914df005140008d4dec9bcd3790305249bc1b6192cb1a4f102a6ee4dda9bac6d7be0d0bc537226da4db18194aa6d64daa16b8726d2a648289c6864da2c55c526ce0c9b301b10a368c18da1864d83703c50a9e0cda88326b84d6e9ad535a26b1af54693543696149a91351d7a54d3ada38b70930a22c4304840c9a4134410c81a055431afe112b0dd06a6850d0b342c2cb0d5e583267e4cfabb846a67baf2228d6912dd1299b58ab891bee2d2852ed255ae24968864cd499785265d6fb0283208535801932d5783144ae0326564caa994c965911b9c1575f864c9e204030eaee1226abc31aa90c99313250a12c016bbb064c7e98f931ea63b24d9903a00a351e1a14f064c5e98babb88e90141931236580f1ca1f088788651a2930f261d4c369868d3796851648fc0ac008f2298513090a0e9e697491b0e792434dc3260f4c1c44207260c24522a1400684fc1974106795418d23854bfe97f8d1f8d0924181c30684e616bad06aeae97c8509600a97c0d1686d72e40492f71a270da610e0957504bc897892f0425e2d09703574d0c97552ea03951c19fedd2894ba0973c8dd8e06ba55f015480f5000252ba325c7ae8697112e0360e3496f92de0aae7e18757708d011e1ab9d25aa04f603d40009433925734484980a969d2d2a5a43382492d0572f14177e3e00a4b3696652cb25954b280e20d25908468292c7d725135c852c2257e1c95f52bd0a4af095d8495a40c95d12b9c2221c062c35fe10c65f83421e0c65d488180f50002412b3256114659834d1f2fb62a10c06ae20156fe062a8e192aca5552e1436b86064aa2119864c0e4a9e1a6c557070cf1142c20b0d3440325424a8295001af126b5a1929fb5aa150800341fe0c0e8ce940a4a6c94d60fc93e6235be60fb094a535bd85251f4a3c947528c98ec277269ac686addc63805250e4a123b7c756e90d5b943050d0c93cc318b80c4024303f70c93bca4c8901c21ab6d24e949d10754956d606c42ab68a4d60a8835ab28683921a0e386499e0554485230d5b220e024c749883efc39b89603a930d26124c1498092f925e87223c92e42a4b8496f06d12580f9d074a09cc000a00e0018c29d3e91292b52539847c3344525186835c1a0d58a1d9e7c3a0d4064930925d24a8e4924b5a040f5a0c923dad509833e1924486df46192408648fc0e3402a00230002520cca47a6a443923ca477d7523923997ff625a35238265e1491ad2348a431019233ad4514008c000882fbe15a8893b915062033fe40ad42832453489e91307244b489505fc72442488290fcbd60d2600460004e569a0cd3f121be787486305e4aa42ccf062a0b809044be435213b4eb483c907120da41948315a4d10bc30d058d206240b82bc4a0ae0669b418ba7064806191ffd68715054c2a3f447de5cd46a3ec0c8fa91f3567f1c8f8d1ef03de45d8491ed34bf8dca38b900647ac0518514990b59dd1e586301cd2c8323c759ca25a570647806b205064d0d59b0323b34764b3586a3af1ba24b2c6c1390c8e991d20a692e1ab300647328e56d648ecea2191c696a72d485690896a392e2243d5061ae8f7444a3861ae016101e884cb0004651c1d65246fd593c923750a8dccb438aac90191b6d64314d1b832364ac7f2f04707380c34b43235a0c8d5eb1cac981a2b76c0a41170d30782d634982e251a284981558c51a0233d68ac4964405466c1919a3451141b483232d46588ca86b44b0d040c323220b5890283e70c1ba03561f2c54d6a875aa30c589430cb80d58643160c62ae24b04860a881963106192a16b060c881358202d6050c58349801180012ad088322f145df58006b41c0c8ba1173d5fb1a8b8c3028a45c48b80522df8cd82a06922da681839c4306204815167a2ce8196c0608a2c60c0db0322c22b402a061862b3415fc77a8001208ae6af840be1c8ac59f78a45528aa115303d224cf98333e40c8a6e05a0a452f5788522900c5558aa984cb000445144862a9412cc47b8d450f57625dd8d4505bbf84c0a644ee43206b3cb0c54b51950a2a550dd04d5d16784897eae69267781843006072e023c4d5c80c893d1274b9c1c53dc64a8a4490891c4e00eab841aadf223b447488e2add14e01b9c7407086579c1aadb06446488c5116222b44525a04006297819112abbf0d30351112220142b6c61a88443d01d910a8d44257a585220e07e112586a20b44102aad28680da160358643fc87f10fda1f9573c550fa157d1356710f785331380490f68643d6519f86c84330002519bc8666ea1aaca0643b2875d0eb21d543a8062cd336a0c126032b7d0a87243558d287803d400010438687050e0335c437850ac36a9499439aa82c0440d0104507f2411cada4355830c86990d1557a80744aabb86432686410c7a18d666a26b441400014155c036e9a0b55a90bc217742ed2cecb2172664a290b6216a804aaca80b880013100883401f1022290aa556112853a59409aab816009064286850452140427e84f6cf8117a281909da13942704d48955540a4d3a4af0a425e84b9096d55024849c332ed0d5531091554a1a846d08c8a65c48448451ba4624113c310c80a0554313140c843421c0965b2223435f99dd228415082130402820004a32d40d54f80b90a41ea19ff30641e483c40e90e41e083b92e90d7fc01996206aa6c19070bfd9419e83350663fd24190831d95720c0aa64b505f20bd253a772007a80013154ad05b20b5aa4cff00b20a54146ca5d04f209c2b547504b079e38284504a209341248245fd996410482006a305331380595498640f481dd03b050d2481cd03955121cfe8c3550e0d542c2a05740a0acb469a2b307e25027204d0daa5264886d308702502520487f1c3aa7f86a9f8188f1067f0880d901a2033406280c152d9e405fb8d0511c42382299278633e619014a028649439fbc20227eea807500e25bc32fdc032018402e805a06f1240280a7014c00f500025191d06a9dc190042007400c80110012001dc3678ffd87dd0696000481ff93fec66c4691650c7fd031ff3a9c82807086a9be7fa0ff10c0e04e60004c6e0f0ac864354d90cc83c0c588a9aa7f20fe30d7e9a18882063f84088c508e10d5334354ca0c7eccfd91faf3f5c439d3e01a2a8e14871063f567ea0510d90d531486a86e51c119c331ed172e0004631ea3f2efcd869f913f1efcb8fc39f863f0afca8f31de0c7df0354b80a7dc431f703edc2aa59063ed218fb38620f094843208da95a16a55863ebe0bc850b200d3f182d4a70c04bc31f56638a2814785a93e18fa8549b637640f82f38d56327d24fa38908ac16a4c1f422e4036a4b063e6a7ccc53ef70c7cb4f95091fea15ec4d48d0d86b4306200a623833ee7db9226a418663281aa3e867dc21b2d806a8f27bc847b8d7db618f770498147bb0f759eea3dd38668b04690cfb48306d80c7b7c331721eeb0dd069ed97d98287b186a8d27b30f651ec70d2a58f621ec37d8238e94063d782a784a9480cfaf0331570a7ab14a009cc193044f5509c512c5403545c0a3c528b40a628aa4b853eb00d51503313c3d163bd4000903d14c4dc4c9d30a7a072c40a070619f51863cf6c4b44d4480c79c6a219e6e7d2c7978f2e83b801ea000523e8c3ca0793d88a113c94fa1453e820c790cf2154381cf9e8331030c78c31b5890e2a1987f014a018e0004830f83c4550b824180022a390c3046f000426a15863c387868f0cb0ed2478344490a2e5a10100478d61d0194648561c41986f9dff2e2c38b8986a83814b87060aa81833c86a83077bc53e5a0cf96031de23bc0777ae82123bbaa2909e38d618a19861853bab5028ee696d22436ec287fb0cf91031dc50c7710ee1be3e3b8076f8eded4003b62869fe86615214ed69dac259634ed483f0892c364b8866146768c51d9f0af8c431d973b2c76506be2f0a76343b225f21b25982d3ee7c453bf868d270cf8764ac0a610e18eb21d633ac23583c863abf4f958388cf86264569f10559101583510c812055429d4e3a8e75183629260c818e9f9d3e199a220016a95a7ac74e0e9b8cc34be454e9ae52e927e382b21d6112f81431d276f6c2a9e7867c0218e8fbdfd3a2ec110953cb3a16742b07c123a107418314002b000250e821d033a0018580629499334f05ef70a7bd818e789ce97bd038e6f3ddf14c07829cd660357b7868c280c93c0353b27ba628e671ccd182c5e5089c140a2ac433dcb3988c02471cc2398272fce5f1cbdca10683b4862afa169d21cb639680cecc1f957b781a9cfbdb614f6c53e104c7031640aa68639367268aa38e074c1a9cb0d5612f6a031c8a9d1e28e423da238fa549491c7b38f271e05be1291c618e39afd31471c80a10a7b2c1a9c3838e147198a7f8aa7082d284d381972e28a770638ae7148e27c8cf254df17dd22291cf60c33d7e385e9dd007a80012870b97d70a385218e1405ae142b447b70a + +def cs_12 : Nat := + 0xbf4c248e091be2d95ff210d9be1246e48d911b36820b4927cc2246acb9711234f66a08389a2f2841c47081878248ce2994217de0edf1018c0248ca91923684648c6092310248c2089db03a008294c1245eecc310705d104085f421245baf9b6e243365ec8b315323326904573c12457a751100f4822f8e06880a6007a80012922aa454ce3f1922a17c388914cbe04539c95e21229439b896019228e450af74c11e43655045ee34d5c43d5909b2a021bcc092250de4272818dbac24891911cf5406488c1eda000465e750046000462f5e089c6c26c9e083d3024882910321fc62f4e0cee048c6487dd92a2243d8f2c1121ea43bec91184f6823d390921c82025800d6000466c8c08bcd425c2a09b22421b6b0921a82486990d1219cbdf905e4c1324d8490c94c9043d2109217c9c4881d760fc224b0c5e2e12e0a8406c41178984b81e1363c8490b5215c44856d8ea23cc648521cea224281b1d104d10276006b00024242726992e9a046c1b0800131212e5dd88909321224230c908abbb97760c9087210b6360c907ebb9133e0c907d20f641e483b907520e0c12f30920d896c88906720c09658c905d20b64166c6320df6022ec609b18024826904b6f7064820d0b22240dc8195d704a3c3f3047d62ae7240c3cd011b15c24815902621755aea707d40d84000949021b14440d6809b1382480724a62174c04b790124016c471048f422612091ff974708b786117458434ac10d2a96680046000480d1f09b0dcd26888fe7b0cc37819bd21b0c026c2e08b9c021a1909b0982088005aa20d089a0e54cc323f0048fbf1f7add50c8fba47284202c091f663ec0661033e01ac000988fadb07c411a94df221e430423341017a0433ba1360c0418d6123e704059c136098433a4108c1848f92123e3c7c410670d2d0823b0de80d2c000981886c4c8419bd094a486d0888f80123df19b111b00c8a8b157191ee48a1888f6f1eda3da857a0af0523d999954afc323d8ebfd1095d8247ac8f56150023780022814f4890a5f2191e9c1a288098a123d2cd2d10b82021970080bb4247a278aa223d02dfe111e72db904970920048ca479b329a203740408de000842df121a0591c62df032842e5c000908f2c10524af0c8f2664e04478e091e30c97aee1191e24c9399240d30423c38695106474235a408b768247828f0021297848efb1df0c804cf70c901f2c1a5800141af7c26bdc8ee663a860ef50002235eb848ed612a44476a1dbe235e9845b78123b2c76401c2323b1048ec11d763ae475b8eb31d601b11c24a6123ab47555b2e300c584d78c123a82d9011af0c20420091d2a3a3b55219aef826bbc091d15df788308f86684474109aed2d95885adc60a17708c8e763d68425f20860877d40815581239cc7378e6c19dc091948e691cc75d38cd74a116a082ac111ca2393c72218b4e824720b62021f4d848e3b1c7238d47188e2e5e50c1c14091c523898d6519ae5c21587091c3547c08d72410bb9386611ae2d68c888e061238147011df83237f46fd8df9ae1c834d5091bd0223fc09ae08b9c173408660004a46ef19a222376a3e2108f781ef22ec191ba443ba5f2181a8c22cf0080ee8212f3091b8e3701714072e008c00098d6ea1236cc6d78daa31db8848da71b4a368e761202580246cf8d9c13d4616e347585b74310108d96d26846b66091b20246c60836ac246c4b59222361239110b30165e888d811afe35e0c8d7415bca4c8cd6acb2b0b41157d21ad50246ae8d5a8d8066b5109ea223546b4e111a9e3535ab418d17c246a58d4833ec2480123291a8a350a336191a7a34eac8559063378a469c2708201f3000111acf822c6f196a04940919010221359b84d66a123452c6011f49826b31091a16340088cfd19e044674f3ac22337a2de1119b02466a8cd3ac828a910a2a012332c6638cc519808465e8cbb1972f6f108cb21232b4655585e0f20145800131ac482159008b0902464eb4e822d39048c9b192d9f50c8c93191f5830c8c88b0344463f58052eec62c000918f02463644f62357d848c65abe04226a080e202226708afd020b7c0889841ef22ec1918b7969088c52101cc048c51189d5f12249200d302224609188e31088972e1230f2bd7166a325ca84d5c4115e80429b60b640f5834c200b5424618578e02340158000290910246150fce66f466ad609183f5690808181110a848c14526446ed408166424605d59623564848c00113ae0428fe2a6446ac40917f62fd888bf2122fc05331380310f6848bed8a94445f374bc210f20428b21069204d5721355ac5ec8bd2062c83d5c09179bcbb8856ec122f25a1556e2322f0841492bc322f0141a2830307b304282c504c44002d521aa9c26289088690046802b0002428551b98072e023c845d6d5422354f5a0611aa702796c09171d5a289a44b784354c848b7faa4c9d3096a0bce3558c2b2f565a23547894311aa342137b382823545041d34110a08406ec052806380012116a4245a88b4f169a2d245a3dd00622d0c5a0b3ce3099b018b11a9f82459c8b325d186459755fc2353b459455f63098904370002322c8458e10abcc20d2709a9c8259d311ee21573666b11161826a6810b80e3402a00230002622c112dd10ab6956b8855aa122c02ad21083542457d8af915ee2bc908af1a97446a5b0915ca2b7c56e8ada4a442f1018a0002822b58d9b1115a22b3c5658ac9158c93a981b021352784554c122abc554111549cd308d492128148409be1ba041222349a20d25848a8fa902cd08c8a86122a1790311542422a7c54ea6875195108a741229c993200023153504d4701351a84b32413519048a5d14b55288c8a5314a03208cd45612292096011148c17a0833ba12290c51f11147a28dd00719146900509811809c422a310c0002340158001291454205f909144cfff19bd18e570211720817782116f09143d512888a1a7f98bca0c729c95f842a1b2268208988a9911142a28388728c1228284d4281227faa0509dd1258844fb89f513dc644f589e6214fd8489e313bc429f553e6222771fa0104320244ea0913a627444e653cefcc45bd83610002835018453ca42a034d8c53c21226f44dd89b9a7f54ee10918f007226b29d6107da4269f809133c8360b2712c0414e68453986774444c98990202c61f58080d2c000888986a6f4469ec082604244be72022225d04897312dc444b3944022258c4b0535030c56843152122558453422ac034c0c533a114cd161900d60004844a8894f64a831010894d64984449e14e72578669db1f6e00ac0009009da1224b045307759840e6009124e249185c18a5e0269d50912407cd8f9a094436aca29720812602317f080e182448cd39912206448752ce4320638ba09a71c269c509a7042295b08a5602447e88f6a5387a2c87f28091821eb909a6d8f558852841014f843d4c1223817f8105fd8226f909a6b4229330911b6236292b185f882446a88d0201ed84d34a101a604d34412231a91902360d840009488c3117b4ce8c0682102e90402e81222c9e7311115ec7592cb19a65421e602f34234c88488a3a63c4444f068a22227444c0a4010f400114889511262244447888d11147369e3a11c413d54697f08c414087028b00024222158da100a6422d0e08a37c3fc828000024221d443911783045d04886fa5cc458d00910be216c42b885510a62144427884ca331244228843107e20f441d88346186b848831105d45c8cd2d812208440f881c37a480de706624b2c6719109102424408259620ee9061d5dc2334b128a01b6e304c08487ff0fee1fc1db8203650243f53b62221f9c3f14b78321f7a88910e00c243ec87d70faa1f41d9a29a540237fa0876502694d08762c3b2806b0002421f0843b00046c1b08001210f7ceb988b1289cec42861090f661ec588e190f52c454eee0dd041427843aa810ea90487a2a130ea68c87a1a4f8443ca5076c7906069b085894243c7878da4dc643c56f6c2349984d2621141503760294031c000943a38326c8dd13e621a4b4243b8876e57cc643b1503a4b2c647d1090ebe1d743ad18c0427638487570eaa1d38da12045bc243a32b78c4b4643a118721a60619b109e03026913090e621cba7f432640004a036c090e593f93dd118305c227eb089fa0243922b1a201b104d20c13482044fb655f015480f500025048284d200113ea048713a3f441cae0a3023dc64386b07620e4f0487049f00468f4090dfd3dca7b7190df61bd884f622e4d1380001210dd85c7cf3e181b2c243732a4220e3b8416f81274004d1d2121b4e8e503ba06280009486ce9e784436486c5a384643604f1c22c0a82c50002300478486b69e184435786ad0d561aa43534ef6606d0843864121a80698110d3a1a69c2c190d321a5c34a3840421a3c345d19630e0704d18c9d704077b090cf07f1080eeaa3dc0008c86730ce0a3b0c0ed21219ac33486602a18542833b307e707e684d17812196af87109d182432b090caa194c328864a1c70a1bdb03162139a9445110c8847b8809601218f044e5e6f2d2e88001209cb051f14382e1441394043784113928486330c5a18a431237644b2cc141311000b5460a0707d40d8400090861c9c60dd1869311ee5138ba713373432185270e109c241b108860a1344e8486044b2c4430085fe9be00a28001290bf0226f336fa2344b84d1282648db88c85ef0bcc4af895e08ac53446842736121760485d67098442e985d093c06315709c2a01f84496189b2c242e24d8c05040009085c06cf1d048c85bf0b7a16ec2dc365967bc0c0817e01ea0005426b56d382216d57aa110b6624b0885af5e9846879089a4820484090b5216986d8180554242d0859f0b3461af507fc083c07a8001290b28d7808859099e84686d086b80242c48587a1a17692ad7290afa15ec2bc1cf24215d42b9358030d5e840c761215b42b585690acc9659485610ab84264f1020187577090355e1342c84855225804128a08f34021a95090a8f4281933181ec81f844961835e82262c0f5635d1ee890d0921214ac2941ac033421040eeaa3e046840090a22143c286850b3650a42828503a0e213dc27a84f06213be8332e1432139844bee1213804701109b82426c84d611786426923e422133f04a11098835c15a419a0a024260d047359c668210909652e9080cff6e94425d04b9867e46425506ba55f015480f5000260cf984236a10cf7b12d11a0642052808971063f0361000242127119a110930cee88d0281030eaee111a0442424833925734600f50002212d304095212121a5a21109074048808ea13403048474108af84ae5445581a580012108de11b423584655c94a422d124e22116257e10b868267fd090898ad2084ae8e51844223031622110c220843e959c8571309086e10d421932b64210bc216842b08512a99408e01037284842308412a60ccfd20fcc44207080f9c267e23256233eff6f71107f60fdc1f83206420fb0483e733b807c00f50002533ed0483e0946de1504e400460004c18ef099f58241ea20842076f84207c179c6ab0ccf9e120f141e10a1a312798483bf077a0eec1dc83b707692762dac41075e0ea8849c4a1f0424e05b40220e841cd0eeaa3e082756099f10241c5cf80233ddc1bc5b08320dd24bc1106e525c886a96120da840dfe01ac0008c836292ad8990c30901125284836106b8467b0834f069924a908349068d2f90ccf52604c7a0a5d100025123f84ad5a133d184832b9e7a0c8679b210630bef88831506260c2c18483069130c244b12c0220c02442991031a8084487a120be417bcf0ed3dc841790815502417382e505b8634eb2ee4e1986677f0931d8256930905a20b3080532120af04ceef05692018c2e8812b438482a613d13042e6e120a8c150829f053a0a6414b697f1b950414925e6220a44147acecc35c823cb0c60220a30df906c431672848287050441ac8090502b352cdc199d84202fc0904f209de75a188e9026757099d50234900904c60982389185a8e4b888700612097169e0f480314a4c94ce9c12b2984690212095a37510356821d8e088dc9a3a880a8011bc0010c824904883ac0c46d2120908a7b1059e469c3208188d802411c0e70206968468ce1010780f5000231a320459303456ed80c822e1339c80b200023260b848223043d1a1170a210439a2b088217042822c845505160004c4109465e22083e32a119ca82232209040608040ff058c43392042c54d6a401580012103f339008ce3c1207c0481ef03d82a20c58c41064a8481dd024044bf10832202342a08d0a0240e6099c50240e245e6220700481bc1206eb41c108ba077b08abf61062b8db7110364ae688ce0e125ed84710c1206787cc11033a066a2c6190318ad183ee05aa42062c0c445743055884456e125e504456856381b08001203008240bd06c42205d04cdf21205b156e1102d4b0d0867be125e08446ba12057a2901102b6056154a096623dca40ab67ac225dd84976e1377f04cdd41337404cdcc119e2846784545034c0c0f2c119df84813d027604e409a210260ad20801fa1204b409581282700806570918842408e447b2e54666d80888dc24b9109022096588810d021604240834452520400480fd01f4a590ccd9c1203cc078ec0e3110703f0892c3203902ac1101c055703c005000004a22012910521543e10ab421203566c3100d14221ef0a66270064063150203d40009080c3017c4337509017a02d21d7bb60407d4840e2a1202ac0540930310e68480a402cc4143e090142027a1c3043c0bc000098337a1202504809301220220cebde1202021af43580b1400094807f00f90d00c807acd0c4403b06c4209f304667c1201b3d39104f5537c01450002409e9048066110c30466641041004805accb44402b56762334c0442d825b18990ccd25008600ec01b21006a00cc01842962494a668b0900450a0880a921109f048014f450432ff028a000460520087a0008632fc0884d02213209000e00132f418fffdfff32ed180a3020b04000221ffde67710ffe333a8802aa1098a0444e211ff93ff17fe0ffbd96a14ccde100ba047fd2ffa1ff380e6204bb423fe355c42107725d210ff85fefb2c118ff7556a887fb413331047fa8ff45fe78802000251fe6bfcc4175b9788665a09e488232a208ff0c3e4232a18ff05fdfbfbe7f7afeedfdd3fb941281a6123fb608fed1fd7bfaecc9043322bfa97f4e31fd2bfa40996000883fa1016621fcd847f30fe5dfcb3f95409a1b54a4c9c7f24fe45fc70c141811fc6663810fe2731a0823b413318047f04a96c475900998ac220292364062c666270998942119a09988820620099877c77087ed6a37443f6acc3221fb28412ec11fb10da111985023f5e7ebb53986038808c88c2660e08fd642660b09981aa6c887ea95350888161900d60004c3f507e9efd39fa60bd00808023ce10fe08fd28fde8821f211fa49fb610134825db00997d821faf53f620874042a8e11fa0c4ef10fcfdf9f4a531997b823f3b7e701b108ab034b0002632f4842167081c43f307e5821f95bf283ef830849047e48fc8c2a20ccbbcfc7df8f3f1dcbb4532ec047e34fc65f8c081720418816a88cba411f883f0f7e1c7d3c81f4d08c6f8231bb207c179c6ab106372132e404205a11f801f3f10fbedc7888635c11278043e6611f7c3ef63e5431f7a3ef3cb7a31f7865b91196d2a4008cb6411f7065ae10fb78f781eef1f363e682510dab38fb6824c087db0fb5cf74e19a20fb50f721ee2307e41f68bed07d9e2860865a208fb29f6383de45d841f633ec57d88fb0df60947d807af054f0c7d7cfaf5f5d3eb8219658f539ea4185fe0265916296232c7847d62fab989e0efa1316200cc658c08fa941c1887d4611f50847d4079e034d8c7d3cfa6c41e7036ae20f36847d2e11f49658010fa28bbc887d0805140008c7d06fa01f3e8c3c7611f3e65783c618dac83e78caea2187a04cae211f37656b10107420e05b3000241f353e697cd03854b8f800130f99823e637cc4f985f303e5f7cbcf9772b3207cb411f2cbe550a2c31f293e517c9c31f2692cb10c2f823e4a7c90f91f2ad107c86f909f2016c0203684254003b62207b7047c72f8e1f1b80e120f8d5f1a74e719953c23e2f08f8b5f160e8418f8a42654909951c23e197c30127060395084b902049809950183510c81805542653c081b2c23e11ca6ea11863e0d199a220016a9003ba06280008cda5e10163047c121a8c4652e927e21f03be067c0832a88304e08f8042054908f7f6499887bf8c1084652308f7e5efc60f818f7d2e61087be41328e492b1073e8e7a814a018e0004a3ded7bd6f7a060c3508f77c23ddc0b6821eed3dd97bb0734c61212cb30f757288887ba0705043dce7b96301c54f10601211bb90417fa2fe947c0c920a11c71847b8994204650608f6fdedebdb817ba41edbbdb14f84131c0c5942a9a11ed7954710f6b4e4bc8f21993f423da42a4a217eb04c9ea1247084c9e411ecc3d977b2831ec8950116a630a7f8438ca1510464ec09235023d8b7b14f624e2710c9cc10e1fafba445231ec2537710f5f0e168ad815ae40843e4042f00460005264e008f5e4e100801c21326d047ae6f5c9eb8bd6e380c0e2cc2f94087004dff880a8011bc0010c7adaf5adeb5018b20f5a023d65b8aa21eb1bd627ac2f58069214c98e20444145308f57deaf14470ff20a00000987ab6bdb44431e08f560de60825c81024c04c97812447a32f10f548dde841c0b660004a3d4f7a9a2325b84281e12442847a923d3043d48e8c419e00118001286e48264ae7a8021e9fc878371431e9e6c9110f4ec9eb085e7e10dc1025910f4dde9b2f376d864b2ca3d347a62bcc0664a3086d98264a009927422f2608f49de933d257a48f48d78e1862ae1324a045e2e132470a9e11922420e9009a20420e8609921421b271cf620d90dc5510f43e6f3887a1af43323e0c977611e82aef24d16119864c147a07d0f8410c808055422eec0838a821af85dce209818479fe6bc041aee08bb842646c0991a8231e408f3d423cf479e6f3c1e77bcee79d8f3ad76720c8c611e738404b611e73645e10f37023cdba5ce209550479b1a16441aa418a021e6b3cd512ec3094787e608fac55c83cd3c8a020d4c041b2e11757777010f338252d508f32640708798ef31892e0cc88cf2fb2218c7974f2e43a88145000251e5bbcb51190f0247f9091fdc23cb10c402321b044c0211e55bca9e80a3173e040de066f443ca534711fa463ca108f27de4e3c9b3266401b604c85611e4b9a080af030d032e6010f250063800118f241e47bc8d791819840cf806b000280cf919ef0680061000094791211e430423341017a04c83a123e8847907906c45ff608f209e40bc7f18f1fb20919c45c6840621b13210f1ea94a0171000240cd88478f07fd043c7608f1d1e3908c80e11e377aa31005d023c6c78d4f1a79ec9078ccf195e323c620ec251e2f845c1c12696845c1010cb79fc0118fec22e0008b7f822dfc08551c23c50092e1240091902e1411e2686e8118fbc263ec218410dc00090788a10c9e04083011e21bc42788264cc83c3e5bc6216f0843242131f084c7bc11e1bbc3678686412daf946b2a131eb18f2104174263d3098f4423c2431c020c6c84a49e11e10bc1fc7900508800e108f05c23c145b64216d6047ba2131df84781cf035e058ca46eb66926b0544218ee02187d1f8a22e2a8477fec82042d8908efe422d8408efe31d3ad7d18d520204980892c34e98877dc3e3c241800220ef9e3a08877ccef97d280c77c6ef844183308ef7ddef3bdd77b78e71debd20d1e901590eb0a85ab811dea3bd011482c2034508ef2c2265e08ef21a8b885a8e116a284011e10bef8477860ab043bc1080d302350d08eefe391085a74101e90477716c3443bb508b4bc22438098dfce0a082f24d3dc4637b098de4263770890a023ba4773e21dce074010d3a423b9a7733478872f800128903c23b97772d8dac63b93082c1423b9104f603d4000905a105d3843b8f69aa21dc6bb8b7714ee2567d947710ee19dc2e36159e051dc051c711471421710883421dbde35910ede9dbc08c6aa131a916f84776311dc84476e10b79864110edb966b0876d4eda5a4e8c76ca5b5042ccd08ed8ddb13b5ea35036746cd069838ed6c216b22d5e70986238f094690b52036b01ea0004a3b56597421da8bb4f10ed39da6d19c185a3022cb008b2b82347508ed18b40167f92cc403ac047688ed09da0bb40978251d9f3b3d09ea3319b518a1059782345f08b24023b2c093021d959651467c120c001147650b2204164a2c8e21d92847648ec8dd91632820ec7c23b1d08ec71d8cb44218ec56d51882c481a4c47b8c19701034684762545d443b0e761a32b063b0b08ec1c2a208c62a10afe8c8d0ca831d7c0475ecebd5d7a3af220ebbe8b115e52bc418757709875dcebb540a8c75d011d728445c0131820475bc131808475b58be8451482b4821d6a22bc10b0b115d08759ceb2c462f108eb24ac008758eeb19d62bac475868a80c3ac2582a22e2a84c5cceae4aa49547218b8c5d50ba709060004a3ab508cf4023ab1307e21d58227110eaa8a95437418eaa688f315718eaa15f8082a1415901d28273000251d51a2581054241cc087542ea81d4fba9d20ea6ca7a4090198b3823a96752aea4dd480b2712c0604100457a013163847516ea2443a87081f9ccde88297811d42abbf0d30313ba8457781315f0429401315c83f0892c31d3cba78d59631d3a84c55ae9ad0fa157d20e9a0221f1080d1423a670a66270063a6328d020a33f0da118a94214620829d439f800118ae4023a5c1a48209658474b4e9644088c43b011d2b50d110e9540c5000118e94dd293a5174a0e93ca1fa5d238e9335570874923e1843a4608e914a0f88748610604141c1eda000463a3f1ecc20a0b141311000b548081108e8e9d1c94096b544314484746f42a8dcc0397011e51d19de6a104fafa2f887462ad5043a2f745a23942a6f910ad2823a2b1360210c4047452e8987868c744ae8910bd8c744211d0fd09d10e87959a087434e8649d12b2b20e859d09881118e8441f3885644109bd9c141024a834d880af415e043a0b74122313284740c11d00ba008b4a331308473f60bf04040508cbd02507703162312d84423c9748439f173e0abf8639ef73dd41b4662530822611950873d6abcc439e873cce795968036100026312604a0ba1047b84c49211cee39d8104b8c96f867702464096d821e05e00004812da658221ce9e24310e72c204f508ab24239c3f2562040584a0941311d04c4701311a84736a366834c0cf23c103e604c46213116127a101ef92de08735a49c555522eb0002522ad84554c11cd6125010e6a104088552c11cd1aa8f246e3310f399fc436e665ccc038330816423992731ee638202008f28e631cc5398754d2d108a2a66080f4822a6308e6022988872fee5f952d25d10002508e611ca10e5f1cbd08549e12ef00472ea31fc4397372e4467031a007a06c20000e397172e0e5bdcb590c3fe11cb3b966546c31cb202711187ec205f70987dc8b9080bba06e81b080012045bc261f308a8765390872ace54489a0c72962fe947b80012044ad2ba91c0000241ca404728c11ca2047280e4f8461e708e4f00f5834c198784239380e32202670463f210146047262a7e0461db098760206e808e4bdc96392bc3a441c9499360808023c839277248230e6843efe11c8f29df113f3823918e41042046391720f094843209063a8118e904722441ac17a0c33ba11c884fc610419483102d51863bc2080b08e430145800118e415c8239037200046c1b0800138e3f44b68871f2127dd0471ec10f9f84f84e11c79b8f29f5ea6a0838ef087cb0238ea533a2225484c360e394438e30986b424fa808e384238e014e725786449b08c63c20d27098688f7a0871a211c67b8c952e831c63317f10e3138ef0a360dd445c8a619a0811a426195219021c5ca32f10e2dc479883db411c5984716211c5838ad9f1631c548f500d2623dc838a7714ca52c602460986201c588714b8618461831e5111c46389f713a21c4d8f190c82327b68960103c3c4d225bc18e25dc4b3893c2f84149184c2f411c483139105f3c24f5e08e235c46063018a44c2388b625a21c450ed2939431c4304710aa42440ec93cd80ff810780f50002606930023000230965843cce11c3d9e602f3431c3ca8fd937a31c3b04c2cc130b08402b0023c4386e083a00290043d0004426968470d4e1984615970b821c2d38590e2a3168704097a130a9b851c2a03036f047086e10679f0c7080e0fdc1e8c1a4e11c1db83910e0d1c19b8311877e42382f705cc33c63828619821c130343625a31c12b82435903309f847042e0800708c7039c61c1ea806b000252c598470301fec43815130220ee2847028e04d44c8c1b561144a8da308e60f9800014701e76ec4380d1b2820ed985bc2c3430ed8841edc106c4041b0e0bd04380508e00c238027002dffc61d9a081e3026123087650237f61ab23554000906fe6dfc9bf5c3db2029a424efe0984602611608df90237e00e0a2012c846fac1142c846fa47544b238c6f9edf3b29e0c6f9611be437c719a231be2b7c450783141cb5aa10c790237be6f78a0d02b21d6128dee8b0d08016611bdc0caa1183fdbd99d2018dec9bd837af6f5cc108a37aa18f545a0637a6c1ec2307a0418c011bd028151073ec2303208de6c237986f2c212f904c1d611bc7846f1ce2184378b087364227fd5c5421bc4b7876f08de053f8947ba2102c58589018a0504000944fd4705040c132b2a3038139800128dde4ac4886ee2ddb5bb660db202fa42376a6ed020e551fc610dd84aae88179207ac1a60cc1a211bac60cc1072455ff086ea497c846ceb081b782374d088820e4104172210d84798c171f3cf84374b86dc21ba28b7c1182f8260bb0854045a9886e780dac07a800120dcedb9d1c5c1682413cb041676af64437350c3abb846008f08dcbb059086e59604040aee386a21b929c321182b420adcd1a42056c0ad720421f2119514efb611b8f371b3840321a3046e348820437181554d3dc61c0c0870242275c08dc41b878fe218dc393ab08573c10a3b04151c9d40545c333200d1014c00f5000240262846e143f34460946e0821b7f00e110dbf1b7db6fa28a64038e046df2dbd824c0c028c11b7a00b310dbc5b77272818dbac236e6ef802139104 + +def cs_13 : Nat := + 0x10e3c258454fb22fbd7ff90b07c008c0008c870e113e943851160f13e527c81960dc87288b06a12c1925f21160bd3d8a7b02a5842c16c3741160aec154e8019a3a4227a52a1c2da447b9016cc2d95ff20cb049dfd0477f109607ac0e08b034113c704d1ba113c49c4129a0200c827871606260462782089dfc2580fb01d6036c06580a0d30613ba84444012c0377db110d242276a4ece213b184441011b8a9c14115ff5b8908381212bfdd7faaff09d613ab1428f012bf984afe5df20457f102aa23be2845f0e113a304afd04b2c40bca094360243254e6e9cd939aa734093062bf2a7c0115f92bf157df377e43be0044e4412bed84afb55f66bec430d21dee4257ceaf989c01896904dff0240400e1089bec4dc8333028a0004a033125962137c844dea113799b7d1145a021b78278e21b6192cb104f10226ee4dda9bac657bf85e381b0626d9095ee09cb873f000240dab84af6bdea0457b307ee201b984af63de88426c60282000461b43086cf1d0488b81c16cc0008c048c11b5104121215002378002209add35aa6b44d604135726aa11de50204ea086c50257a6089a5c257a34d2422bd0e04c106c0c2579eaf3b5e7098590af350b2c45796095e5533c869d05160004a5791095e39336b1571837e022ed3095e31334032a0a3023dca578a04b621bec04af0e6b0041abd095e0c25782357222bc004aefc205c42ebf095df2bbd5779eeee42bbc128a10f3402263e0b8c2131d84eee010d47844c681131787b207e11258857704c5222405044c48d9644576d4c3d368c6576b0869bc2428c095da7baf88c04212bb2844c1c442047757089820d280884fc1130084349212bb0d75f115d782480123195d76bae575baeb35d57ba6184bdc68a0457500d705690625e24bbe2212f0484b812ba742581097482574bee7246e89f310ae935d1c4574408d838225be05e822ba0808f115ce92d52406186724ae688ae6e96984573308968820c43626422b97844b3812b968422be12b95840710102d5900c06c2000484233334a0fc224b1007dc0b54419a0095c852c112cb195c8170d084af244b4245818a0002512bc2576100db022574728c212b93114115c72ff088ae350878457164acc65ac2720023000260cb304ee1c12b89195b10b7f02570e4ab295586570dee1023b82844a9a95204254609082c24d10095c0c2254006bc21ad684edf612100044a70d690456fd4a6c644833b81232907e49f308adf694a042524357a216e604060a120f7044a3263b09dc8c6b1a12b7784add8108210412da12b7424fd115b94256e449e622b711009100fdc23157085264212cb095b6c256d9edb622b68a4d60a883126a046ac6120e3846ac012b660754115b220e024c749883efc39b896038d55820d2708930027508ad881125c84497092de0da8c0e0011257044956c4c841848095b02b5fb53d041a00ac0009883581124d983310106023536095ae52492d68195add24786a319067c256b209be8c256b048fe22b56846a42470444196080d8826ba9090648276b9095a9c78a88ad4b5a92b51f6b2215a8407308ad3e120c1044898133c9044892911c42442990e0870145800128d4042243e259621a7e22ec119e1da7b88ad335a5eb4ac16e20d3acbb9386618907120dcc76195a4c20bc30905982568f82b820ba884b311ee32b45d68a69aa32b445686f44c307192271105cd4223ec095a042567f08d30c2768a085c80212f3080518214990959e5673b1571959c91e223c219050421ac8088eec2566c088ecd1d92cd619599e09c88acccd25c4565f473622b2f565cacb65a8e4b894acb035d4423861ae016101e884cb000460bca04aca612b2784ac9959284564746de1d986167f92cc22b218446d01d3421980012029ec2563f978222b1f563d46b43027a84ac7758e260f0cac6c8d1407b0cac641119d04591012b171647108cccb2086d5293242b1584381033782043008d12c22325095899a2308ac47588ab10d61d2c4a52b0d84ac3019d033880012058318ab88193c569040544095842b07d60c190e0004a22fc18fc0d8400090ac0ed088440e0095800255ffabfa22afd8445c62604415cd08eb84240d509d90023886081704222cf0f9222afbd5f62b4833b1d04abe88ae84057b0957caaf688455302e8425f2088a8d15008abd213b16042c3412af1d5de2aac554c2658002308a24255dc4f8022aed55d7814c89dc86414679489c44226e095753b1095140d3042ae733bc102180203980957202761b449823b0c848126104e004ab82890512064632156fb36c0829cd45a0455bcab72536c16c81eb069862adb04446488bca628c502156cc222290956c85761038028a0000a407c0956c2ad7221d1901d910a88ec0e12ad4d5a7ab4d01b4855a3ab42213ae0443f687e55cf0c43e855f447600030205f807a800129566aaccd597ab2d5650a145409aa0aa407a800128875d0eb0fa9181c542018b0887490e808ab22adf445590ab1a50f007a8001290134219bd09012825588ab0f561baf79056d212ac184669012abd403a1155e1d168843204f5537c8caae755c774d0cebc20f5403580012085d89d888aad2cc88440260900882556407d40d8400090aac00ad040589018a526464b2809556c9bb0880241074d04aab2850109fc009203a182213b0e9c2197e0426a412aaa04eba411097ee7d004600048212c560a2109384aa9f553099704b311ee51974040dea1108c84eb9010227842190100aa84262811086843700023196c888d0d7e0bc4015800130841469388aa8412aa0f5c01083d42553beb7822a9d3fe0112bbc220e455ae22a9a04419a8331fe920c8418ecabbc941c254a12a9784417613ad9897501ea000485528095488232980882702551d0b080f442658002281e78e0a0841281a6043fb608fec904308650c106a3053313803103e00f5000232a8a840e8013e4384aa2411fd1121d05420a7800094aa1e8185fcca05921542422050565a22a8386d8115414369843818fe4025502a9fe22a7e91e211d65952d25d21953e901508649e10cf984eb1246c432cc09020fde423f74f8c8208cd0404380a2c0008c7ede464816a8c03ba06280008ca9e21100a78ee10804458288401ac8dc4049808801dfb2880bf211fb0841b42108b7846452108b284a9d15398454e394e422a7154df3fd07f8860734f731b83c23219095364232100953559040817ae12a691fc311534021fc00953318ff08a997d5ac4154708438821fab21b65c28654c8eac222a6254c37e7231f9b043f2242ce1038c7e5cc79043f2c08fca4fbf8863bc10fbe043ef4a76841f7108151021f6e082d0c254b13ece22a57d4ad10c74021f5f33ba214e484a95352998e48c025e12a51d4a17e1a308240c50115274fa4b1b7181748254983e845c8065495cb8422a49d4913e5832a48548fa9187c6dc71943e301031004a90afba041f090952002547d08fb842547ca8f27bc847b90a8eea5c840498083e4c2547308fb54206e508fb48210c80951c6a38546f1ec642a3504a8ce107a88462c212a321d28107af054f08529012a308462ae12a2f8f29032c008c00094053e12a2f545c103c5018200b20002418a2a92d00d6000485456a8a82189e1e8b0afa30f453137107a082544fa89a79f876c07dd06960004e3ea109512aa239e76938e41f4d84a88679b01ff020f01ea0004c3e970950fc23e8c3ca0fa246543ea87420f2187401150dc46e883c6ec418431030950d2a19be7618c3e42542e0906000860e420dd02023780021078742542808783e79f08a84a12a12542361c830f020461c010b8b043bf812a0e042e1c102aa040cee048c474f9095055f2b9ac818f95025411a81ec3146540e01c222a06042da4106dd840ff612a03d406caae31f1f843b7c3684454023b5e101c0cb00230002602d484a7f4129fc1daa1125c4253f5614221f18843b2ec264453f36128224b304a7dcf88a77f0c1a4e13a7184f74210eb21d63074c3183c840938129f2b07119f0c4c88306e087550253e0a7be7538365903a8a103628460c811423044644129ecd3d6058a0004853d5e9b4229ea1d2b3a5474a0853d2a7a0f804674d2094f3020c7aa2d0229e49d08b98431ef904606e129e21cf318a030e789172114efa9de301e18735980d8860301127804e98011ee884602010e0a04156213a5e3dc9114eb0253aa08560021cba08150023780021814f0253a639677270674b2094e78aa688a736129cd5399a72c355883da8087228e438b97000040e4264f910549423d9f0871e05be08a721d27c4150e16d223dc6538b38e3ed54653880871997e608a7082d2845383a6ffd248e2390e91e11ec1277b114ddc222200870b456c0ad720421f21195184ed81d004748809d21821c20094dd29b9083828129b704a6da15002378002214d94a3808068a129b1bd68114d847df080e6e06580118001206fa0a2c88a6b810df0071c106f7023d5c094d5c25355094d4e9a888a6a0bd9443d50086edc2534ba68d4d1644190374274a043d45094d0d7a5054419d17c23d40094cfe99f745b194cf699c8836f80318e338c5e741299aa2ec114cc44c58803194cbc21b647a5420bdf84a65a1299453271d88c88c81b52094c8f24984e900460004a531d153c20d9c047a3410484854008de0008853177a28209ad8426b212989e482114c48d8faf02194c41e8488e8832ee8011800120bbd82530ca6174c2836c10a6134c229830c293211e7e8435da04381458001214bfe97e8835d0c790452fa35c66b8063cf2086b3bbc2885da610d6692ce06860d000c200013020fe04808a5e412978d2ef114bb422ec6086af421abc25782095c04a5d54ba697412aa214b88d520c50181fcc6d8083544104bb0425201296e84a5b4365c452d8799c2296a84a5a610d3db4f7114b4174e88a59c1174c041ab011e5d9a69247e0560047949b3810d31074e10f2d007c00f5000240d2d6c3e114b20252c534a0229621a4b114b08d2488a5814aff9ff048300045295e84793c10d0c84342600ac0008c326610d09088005aa32959843410681cd031a0303ba06280009c792467f92e90ca55e4728419fb0cdcc55c619f908b950252aaa54ef2208d4a6f9294a9a952f3ed194a8a950f3ea339e4294fbc7f114a7430088400a1294c8c43626430cde84a52c66c441165087fd02529022b221e390422a2c55c42e23ae4a212c400c52932302c3858407a2132c0009433386668ccca581293250ccaa57e11cf6c2528a2b48202a204a50d4a1694211152065eccbd197832e20bb4a25610949f82527832a620ca8042e14116fa84329465256f890d008b2115414580014005d022dee0864fc8610437000242937d26c3270329355269a4d0b78c852667872239dd99120cee048c85263321821e1a84a4c1497e67700f801ea0004c18ff5b98216e484a4b01292bd252a49e31e1004207e11282845b7811e0d0c35114920252477826216d9045b5812920189f99aa3291e84a47948ee91cd23521ce9023c0330fc148021e80022948c42025308c82023bfc0948b56c20809d2008c0008c77ec116bf986411489c20498094885df70f8f09060008a3be78e8221d2304307e1290e8477c21290d521811485d6b408a42ab58c40aac09484e9092d5419482c218007796229048e7911481e90217df194800062949918ef04251ffa3fceef8624512f88b4e8651fa776a228fbad2c1016002737d09cdd947c08a3d8128f4f373105dac251e5a3c620baf175d09a432ed804a3bc1120304a3b34760ba20ca3aeb4060a98cf44c1167f04a3a2101fca4f01147311ef882e4c21dd2f90c6b54128e5d1c8e6ac0e5c04794a386c35c451c2a383470167290a3785be019981450002539a6bb6d1146e027a8859a4128d9bb6611cd0e36408a362111cd84a35fccf03d200c52932528d09c1410ed3c2519fa33d46706168c09ccbc6a7085954128cd51992cfa8d98290043d0004716518446c4111b00497821039c04593c128c90476701164a8d11031400048518a0946228c3f31c194619645233a1833b80ce019900024398b04a30610e04632a094601d8f882c6458c1d8d8c5dc2128bf0cb8101a3425177a2ed45d0e9410195811d8584760a3278ad20c2c10ec03e930ca2dc322042c5768502018284a2ce8bd445164011e21d7604502a128af515d75c23116f04a2acb10c4515522de228a904a2a010adb95b62b6a40908466008eb6023ad5bdbc2061404a2954518422bc09cbb0965882b24563c063800120b09025142088ab0ac11580182fcc2036208cfa82513d08b068272df11f42289b5c551055a190408a266128992c0510b00c2512f0944b1d5a8867a0125d784a250eabc4512775562289284a23eea9c4511de5a4215f4842a120e60451152b4820a7f224b06ba55f015480f5000272889d10e752eaf64864630853ac2510b0888e42510910402288284e40046000485103a201cb08573b12d28aefc34c084eea139600422ae1287a037310526426ed408166424b7d0943bf5658874ea103c984e56e11d35a1f42af80aa407a80013143ab959086228100c58428dce98c54080f5000250a33f0da11438e870273b19436821be209435a86a08a1a41c54450ce09433022b7d088724200b309ca8ca170466193040a1604a183430285f98332142eca0d14181942e022b6591c2201ef22ec1142ce8570856ac13948c09011429d5a608136a046c1b08c4316109e7a18810e8a0250a51e1a210bf09a025963078484a1443bf04509c27622159b84a1344e984b505e71aac5284c5097b3f831d0904a12d42549c1ab22204df475608a11c11d0484a115898c41b2b4be421cff84a1064d484507f26922283e934865e83283c12181141d4206f40696000461326264884586046f00022283645921141ae83380e118e7902506110f65f6c6506025ee0ee41dc00f500026393384a0b8e7684308397011e5282dd05911415dce80841a24af04725a73962027a84a0a14136826504ba08e3140c50437372228208425024a0020d0ca0781281d927824ea3281c455b1140d025031410c22816aa9311c93954688551212814399c2438486c0c50001301c48212172424758465025a0474086810501f0808023ce501ee48221cc404a0394068345493d20475152d11cd23984728a2a5608e5e82501518fe208d08409fe06640008ca01a108cc99dd10e5b48c904e400460004a396a0046000465009f1dc2280384a00dc8c044ffe3ffc66f46395c0811d424ffa0845b1896889ff33fd9ca80c9fe33fc39118c9fdf140044fea540c2087e90fc3c70302774496113fa27f38efc1976c024fe5093f9390b61da21b65c28a4fe39fc01b6064fdf3f3410d8479909fba127ed4fd9c39e30854069b113f54fbf88f1a4114ef0cac113f3d4ed08e412c75844fcc093f2b90088163c127e2905d104155c85028f180a302104c093f00ae6887202127df104171f2314da049f72e3d044fb6944021c78849f64107fd049f5bc7c94cb8a9801ea0004c0fe208e39420770087c6024fa99f4ee37c60a7392bc227d2cfa41a4e31c6c8471a8127ce69d5113e58b8508e3c211a4438bf0860fc24f91e3b6207bb78a610a58824f909f1f3e3464f8b083d4424f88087afc24f863016227bfb15510a50820f2888e220f52049ef0127b9cf70525c31c4a0f07113daa7b4cf6218c4e4217cf093d74f41087d4c1076f849eb53d5c76d1e7908b806280009c625a102e9041da5272840ecc2f66207658eca7104327aa71af2f4431480840b00127a9054c10e1c4f268e8bc2c2427a6386e103a00290043d00044073f38681cf2327a4386411c6982385c080f6c21e30c6d62072c17551caa2c14828dd08e150208bc093d141ca88709c127a1232a1010a8228d0093cedc1e889e72781844f370877f8228bf093cc6798382c8828427971def113ca81a2881bda37ac412cb0837a8ef088515c1220484703c373840dcc3ba4187577090e31610ee48404f409dc0008c9e453c867904f1fe2fe538be841b421278ccf161b1032785b80511c5dc21da3093c1c6b2002b0000427828d622b20327819d921abca1d484f003b161d98637f092c221bf59d721a561cc884efe08349c24efb093be9bf2089df33bda779820d00560004c4eeb0994f0243cf081b1421d400d7e0bc40158001293b9d423086f84bb8444ee416e22066016240d2623dc81d3008a0d42493d0832bce94081958138a48487801276c0c9a193032769b7ad107438237a887682063d030401640000860f808a07820c6d18d6227650616018a5264815db093b10e7d88606411bcd8439de17880c50000213af8ade312d19c4b034c089d793aea75c0c9d6f3adbc040c6f0ac55c4378206d603d4000900b32127594eb0109fa860a0c132b2a3039a7b986eee300843772093ab021cbc093aac48288e22012751cea0113a7674d438318dd7020bb22a8e201d30411781274a1c9157fc313db849d2410b23849d1e108f9049d170dc45c484090808023cc4e83170254741b580f5000262741151a1139ff87c0b4c06d20150011800138dce05a38c981939ca738ce70e1e84030eaee1102c50e2094d01006421ac84e1d22bb8e1a8c6e4810e188ae1c1582b7856ee0aa302b6056b90210f908ca8a4e65384c22731049cb810e07049cac1387004153003d40008c1fc412728a7561139382018b0939127210837e410df784e1aa349801180012029880a080011938f0250d808204424e399c6e20a228409301271a0a43c11632718ce309c5adb8c50a5e7631c2fc34988f718db7c24e1b093868dcab34318db67a2f8806c41270a849c22270044e0f06624b2c626f90938327054e099c0e4206f04c0de126fe1b6a96723137364a01137ea6fc895f12bc1158a70ad0937c024deee15423853046d4411b50041d0c11b4e044d5e23cc4709c0937a66f388e12f125844de509378934e084d2e1384984e11e227cd7f089586e8526ef0e2a11377024dd94cf2c7906483809374e6e8881bf0117692ad7104b4424dcb08d9cc41488e0f2126e1049b81c1dc44db99b6d5dd864db49b5a1ec81f84496290a6c203e7081eac6ba3dd11898a03cb87950f2809d0a365909dda020d6009368c23653093688d34089b3c48f444d9b221021305849b26981c44d8f5d04226c5049b10102480123101bc9b194271181ba024d820dca226bf844be4104b0049afa689c369843821c128270480935d434c089ad668108ecbfe42135a52eb089acb358f81f13e620198ccf988e07267bd8968cd03210294044b86126ac703311354c202ce093540236020812f424d489a8b5cd4604a90817f82fd86ff00d60004a35f309a024270256bd816fc3e4232a293509af4086bc508d044d410d36202bd057811c06c24d36091eb824d34fb8c2029a8534330432697cd2d1134a52b3884aca1380604df0dd032fed844ab8131c0c58c9a3a112aa848b03140004835bf08de00086046a08ce2268c017411345886188788a12689efff62ae305bf849a1c101f3840dd011ad684325612684849a04644833b81232094cc2190c0933edacd8883ec112940499edbf981478c99dad62481f05e71aac50c688499d611abd0499ce10c5c043168137ec4cdcdfa9336084cd799aa203c6046ad812669ccd299a21dd547c144eac1126b054410935026fc99995bf1c62d90093318b0d08498e93107df873712c051aab049987125844cc0997c21aa584bf2a1265e84981092c07ce83a504e60004a4cba997292b063542308f8668624a308d4fd24f88996532c5a9c8c306612657353611beb12f9086b54112460449160efc13d027700025124484df4612654cca8994f3294835212382220cb049944c4504247109dae420e790932737cb88992e0f54035800121325a64a8eec1dd2313c000189927be412f90c991a117844c8b9914d40c66f8c08038426f89093205a7b8898ff31f9a7a89de21be1423ba60eca01ac000901d18137c107401131e1a7288defa39804240f08134826f79090578228dd0809f021751096623dc65f520931a66345f4a1c6489c4a4c6509bdc026f6d11ee20a4c84be8e1262d30d711315826f6698a08eec64c4e088ed566e08dec411a51046940111d6849895bd7c4566308d25424c441b52226214c401130f0b4f07a4018a5264a4c370b002261b348469023261acc3446e827740009498677ca444c32986255f015480f50000603b304de981261596760a10008c000940e74126144c2668c8337a3849837306a60ccc1600460000c41100803d824c1498268ce864c1298221b4865f1408d12866b0404011e426064c08100b140008868841118d042c54d6a844c059809586c64c039804d0e4e9410980258581b10c4617a4c4434362c18c55c64bf80846d427d2608ebf024bf397e52fc37979097d92faef7ac0de208bb02341c092fa02be8897cfbc965f24be1a2b2525f04bdf588405140009497bb2f6c44bda2048203e604de3c125eb5ede112f525e895a0192f3cace05870b080f442658002392f365e615970ae215bca4c9867e81205f0497932f211538cde2411151a29f0046000485ecf088a6420513135e00046161a088a58ab30bd692bc4039d04977e2f4444bbe977a8a246154a096623dc627c008cf58208ba092edc26efe092ed024bb297632ebc622772190225d76ef4112ea59e115140d304377784ab96125d0cba0813203d400014ddd6102a2044498125cdc09310270024b9929e2225cb84675810a758429d2125c984972210a700dce112e3e5c67cf7192e2ca590844401376ccb8311f3c821157092e06f4b08441a101f844961052593b103610002411040496f62ad82c203d109960004c338b092de65bbcb766706410fa157d11bb1c24b70bd0e225b6cb6cbd02325b5eebd14854fa4825d208871024b5f0706225ae0496b52d6040f6a08506026eae08204424b5396a52d419a290969d2d36f350c56b0101b1049693799446e9f09ba7423337430c225a1082010ccbc2332c277a26440629499292cf822175084ec4213ae092ce10b6096c62644199004565a12599cb32bca2302cb84965c125964b2b9654cc3084b26964a4dd86401209ba202a488427c137428465f81258e4b19dcfc3258bcb16424e3258a0b0511b9e6587cb0d307e42585cb0944e2325830496052bfc44afe0d362034c0495f52be59660c95ef2bd80e90c55c41257a4af295e2cb1084aee95daab5461ac8092baa57420ce1818c0259c6092b96571cae118cabc24adf95bd2b7505d90dcc21372f0495b7b96844ad795a8170021b8001281f3024ad195a12b3e565caca9592825034c200af01104792cb112b182125708ca2422a9a092b09942a07d192afd94088957d2af655e4abb95732ae255bcab664e69255a1d2811b91424ab164d681415969023ee12556caacdc812aa371e9432661331c047f1012551caa2406a3254f6630112a6c24a99952e47108e0000128a94c1ae957c055203d400098649c80a48d9018b2046c432cc090192a4e54903201831fc24a90f8c822547919205aa33712ca88112a1e5434a8551ba4191b8409301254120051129ff70d8894f729e08b28c3fe81253b322310c88424a717eb223305843fd07f8860734f721b83c24a6e94db29ac64a6a94d07f28888161a29299a532910819257821fc30929877014a5ddbff76c0a04ce092960fd7a9fb192954231f43f54236fb84dbea12528b1e411293a526ca4bdbde425236ded11290424a403ed22251fb1d41128f251dca3a639c2c80a31cc1b9c2251aca34946728c458694638a1014784dbc2136ef847e12118df04945728a8fa38c945205d044a28535e20b9004944bf09c41f3908c6c32e10805ca0528063800121286c24a1a94303fd42bd90db9e118d004633a118cd8471ca11c7184c35a125094a119421b724854830928325058d2718c63024a09940f2818c2e109407280446dbc93f211cc1f3000129b6e8249f662ee208640471701b54a4c8c62e5e29840a1808c5b826db162ce203550493dcc59034a8cdb5674a0449ea0716224f38462b2c55c4315509b698249dd6299d478631475256204cd04e40046000483142a8a60aa407a80012927676cd8893a327424e749cc625450bdb84624e136cb049388349c41e6970fc224e149c1db1c336c6042f04124dd49b9937126de4da14ba52124d70412c010f1d84621278d846d8109b5f826d7c08c3d02048409268c237800219b5d1f36883c1f3cf84499e61d7e17c011800129266f6b888dadc19dc0918c932526458688c619e12e84849318136b2c9881bc2b370830c708c31986188930fb588449856174772460db709260185b96c77fc8436addcfc1125eb6ac08daab25ccb508c92de124b7309e101e182496908c25cec687644be440ec28492c8a1b44496109257826d47093bf82495b6112224acc957b9c6324aa9d6110c1e02510dab19254c06380011803d82307209b4ea4a6c37419b4d8253db09252119108da6210e9d045dc21141e0460ba1369584927e102b21d611124f421d2a0164000460cac0924ea49bb04b181524249353a2c20e89849263948c443b409b4682492eda2a22496c92c925524a58181418a012492c9249244c0a08491e092475c430820481248cc9180b68336841cd318484b2c849122b4821809846024733460b17942124342490c180e2a786490917fa2fe947c102b061368084920855f4449010698217ff845ff8107420491fb23f367c8c91f45574448f991ef7254648f691e81294e94105fca12478dc8f11b3ac274aa0923b2475c8ea91d1b38c35698 + +def cs_14 : Nat := + 0x380c0e2c42f94087004a3b08c9a26ff40ce0199000250a3804c99cf5a043d65b8aa217c1047ac4f584df41459209cec264c928a620def0437b813262bd5b5eda3218f04016610de604c97e126043d540992ef25c887a9e6edaf3b0c7a961325b64b5374a5264864b3c9646e48664ae7a802079604c958f4f4413da08f4e4264aa37040964609b2136021e9b2f376d864b2c83d33088bac000887a5e11e971b6a96723325113aa11927422f2609926c264970816b823d247a46bc706315708f47826491c91c2a786648ac911921c74310c90c6c9c73d8c3643715440e75084d308838361000241e869b175dfc9a800c594c8f81323de47a263a065801180013191dc86408c8eb91d17750c35f0bb9c46472c8e02323782c610f3e423cf86b5200ac00090c8d2f3d441ae335c021e79aed510f3bcd6692ce0686c4b4a0deb09919841a08c8c439e4437d80991782645bc8b22322c645779b1a1648645579ac6a886097609914e96e885d6610d4c04c89f913b2269a8e32640004c3cc9901c2240604798a13224e4460eeaa3e083cbc0848fc0ac008f18f2e5309080a4010f40010cc87f90f4d2b0cc87434780ee818a00025031004c86e1c5c14c00f5000251e559a4601ea000482e7e24101bd01a5800128b9f0206f0337a202420434711fa44642f793e6864652b8080fcc215a408f260d089a0e54cc4321484341015e041a065cc02321304b74a11e4799f803ba062800094c84667c8cf7b12d20f2208d4a6f9199080639884b781320f47d11031ac2641b097fd414c00f5000241e411181119058ce619cb09304320919c45c6833208e410c81d9037205915931902720405870b080f44265800239ea8c201740866652c0949918f1a9e34f3d919900823c630814f4890a5f21851c026400c7fd34b463c5a0865c0263fa78a806bc07a800128658c26784cb0004423ce827b01ea0004863f7c7ed8fd4b8510c7e4f12c0ba0cc7da11e2284085642ecf058c0829257841525098f9c2193308f0f0c9782c50002439e0045bc210c90847875cee8c8a8cc7bf8f70463db6b2a231eb18f210417423c2708f0942028c086380263cfc79cf0806103e0bce3558663c9098f18c6208a48a131e22dac10f744263be313f33546523d098ef291bad9a49ac1510a63b80861f47e288c7638ec31d763ad30e013b003580014013a8263a75afa231d363a54962331d263a377ccef9524f94c7421b20452180860a17708877baef684639d08b57c22d5c08ef4c2639ac732c45063bcb0899782011b06c2000463517098e5523208c7265f7c417db098e431c7e38dc7198e2f1c4a5f238eee2d8688776a1121d04c7058dfce0a0c2f24d3dc4637b098de426378774e231ba04773e11dce0740118dc4bb5885a32131b7240f10ee5eed8082eb211dc984097a1146e84480c131b32403118d94ba1a3fb1154119864c187716ee29dc4d1ce0d7e6774c172a1a4e21dc323e2118d85678082e3e00044635ec6bb8d7186b90c6b2103180476f011dbb08460338066400094c6a88ee4423b7085bcc3208876d85ba06eb25bc20b35823b6a76d28ea86634c474821db1d1b11036a422cc6098d24216b22d5e709866346a3485a90ad21076a85a783d200c5293250b4e1794118d131a088c6805a304237508ed2023475098cf074180f5000241da23b4246c4311b004c672ecf9d9e82ed218ce319a345f18ecc423b2c093023198e32f2c94591c8632d59082021c0419bc1319304170046000486324763a21d8e2ee110331423b15b54620b12069311ee3318f631d2c3e31d8783a504e6000483b0e01662318d6319760e151083b0275f820afe8c8d0ca831d7c0475ecb16043af475e42117a84c618023c4630ac6118c1dd7090c60aeb78463028cc02317dd1482b48328a30475a01161622ba10566161492cb198bd317888b4e410e5e04758e0d8843ac5a27a23176047584b05445c55098b9c215492a8c01ac00090c5cb8b8b17062dfc5bb8b6e8929ca23cc55c43aa857db2e90662d7c5ad445c63aa12b48215f084753a111230457b811d4c883410ea58a75063d01f003d400098c594208042bd0098b1c22bc808530c57c823b0de80d2c00098750e103f399bd102bb023eb15718889022bbf0d3023160ba82118af55d988c5798aee5be8c575613158e2b0c55ee9a0862abc554062c6075d098aa3153a1e8198a90a300843c8131500401c2105e504c53cae2440efc09434423a55031621d29d0cc118a6021d280850fd2e9087499aab841434285c119864c101f0c1314a2b704372287679f14c52460cc4041492bc21d2004747e3d98414162826220016a90c51ce8e81ef22ec205028221a7088691ff208a1546e601cb808f20e8cef3508c508ad5842b5408ad442970171000243140e280c4fe4f443209413601313eba2709fe02780479456881313ca17e13404b2c83a2442f621d1084743f42709d88c743a1313a62721189becfe08271eac9c1f702d52189b49c2080b2413135937b382830756040af415e041378964621d0484a11224446aa800120e81823a0174011694639fd5615d7486134909897c202008f1884ac25077031621cfb39f410847c2049a01ea0004639f055fc2108b0408e012836459210abdc20898465421cf5aaf3118940200e108e79507f0873c5417c4505d0805182624908e7684308397011e4312439d611891c96d32c119891426242f26221ce58409ea11ce304c47f88f5ce00c558411cdf39bc1188d9cdb08f23c13119b9b11188b893b88c45788a62ac0cc44e82184124b24901500237800228e6982207d08aa3c91b88c43e1310e0473300e0c46218c42c2153b04e48a13109a04111c9042398754d2d108611e209884153188c41ce5ff4108c54b49748411ccb74a208e3f58e10e5e822a4e0056000465de008190426205c4062310125bc1067742396e08e5a8011800118a8f023967a00e2151b044016100a500c7000231cb139601017dc261f91b42230fae1f4543b29c8839543fcc5e5064ff40844d027225082fec261ee0987b70f661eb7280e4f8a393d54082087c84c3c7878440efc09877c26708c3bd8775c998cc3b8a7cc406e808e4b4fcf90ca307e430ea04725442fe79f0c3f2a5494461d1e428230e839209fa84280a4c9410d613c6904c394e47043918e41042046391720f0948432090c38ec7484106c164e065801180012841ac17a0805e4114e484c384419483102d52063bc27928098701c8286051986f9c7e8edf18a6d824fba093ee0261bac37386dc64faf5350230db1f2c10a68820ff3633e00ac00090c36786cb0d79f182186af0d561a9c34f869869398c3447bd0438d108e33dc64a97418e3198bf887189c77851b06ea22e450c22840dca130cbb8ba103ddc2043409864dc5988c322e2bc461901ea2207a8069311ee314a7bfe4107afc20f4590fe2054f04c3100e2c449e709861f0c2b89f713a430c084c30185f840f0f134896f063897712ca4a064f642fb6214918471240d2c0008c523e1189c84c2ef3d74f410c7d4c130baa9131185cf0b88955185ecc20ecb0e8021c4104c2da03844387e08e1ecf30179a181600228fd937a230b4616370e4330b16160c2bf857828e1470d4e1984615c2fb620f18840e2a1168704097a130aa0470a13d0c4164708e1082614d08e100b9708c298349c4383b707223c2c847066a2fc4614a8834230a438286198330a1841bd611c121ac810e089457087042e0800708c7038371b6b10cb1661309c04c26f84d4b63bfe42036c0228990984c7098380f3b7640edc041b2810ed985bc2c3430ed8841edc106c404700e13094b80310e009c00b7ff19849b092e12318765026121c23c21bf6040e6410eb7846fd29cec46116098455bf0070518df60237d608a164237d23aa2591c60ce7307e206730277000233087b7cb10549421d400d7e6774603fe041e03d400090c21410e9b045072d6a40158001218425bde886f78a0d44493d08586821d2808dee065508c20410e90041940747064d91ba27cc51bd80c951183f707de0f818de963e888c1e813079b7a02bb03307960f1c1e0c0b083796080f48260ecc1d430d46095509839f07360e56f12de1dbc237816efe8015b04c1c69fac460e2c1c02275604c1ba11bb58bef5ffe305f4846ed4dda041caa3f8c2306a046ebe105e481eb06983306904a53a5033066046eaa11ba925f21183230639c881847c825c8a082e4421b08f31871fc2374b86dc23060b7449cf2ff90837420854045a9886e7856904279a08dce8e2e0b3f03080004a60b7c16cdcd0660b5058420e2104c164113c104b02011b94846e4adc84460ac4eea230558ad815ae40843e4232a309db82371e6e3670806276708dc6910408c146703041c09089d70237100716207f1041ab01304dab9e1051d820a8e4ea02a2e19990068a100c58437ec107e684c12e29880a08001204b2c236fc6df620446608f081c702608d08dbd824c08028c11b7a1d2811822c2272a086f182608a6dcddf006272208db8c50a5e76186ec8965882826220016a8cc1095f5446083c105386c61b9a08db71b6cf45f1981f4236d60981f303de0791981df03b6075c0e8db14a6073c0e3380464dfc36d4260c13b027300026137364a010bcac2606c08daf4dae08c0ca1303177a811818785403f009d2008c000986d5e0d840000c6d5a13f1e84c0b38153029e052269a51b4b046d286c50426a00316230277e31e12630459048300043134784fc5843204604a5dd423f148435dc13022c8381099d0226720899c02367e4cdac55c6367d5da4ab5c6367b4cd223f1084fc3dc1e441ab84b782301efe1b1037382603b1020187577090355c200c4366d35483140626465d6a2017e04251411b340d971030d42263b09f8342429e080fcc26032c05ed97460d6808d3dc236580f1ca1f0677680980a8236530869bc260286c9c2301360256c8bdd7c80d3708d9083a008c040981c44d8d34962300c4d864ba431b1b8492100e1827df808e02037284c02d8057efa8c345a1b5cb900c23e41300884e09011b13044bbe1300581721015e021a0423b2ff9066008c00e0e5c04790c00b5d284202c089730cfc01dd03140004a11ba27cc2300104bffa970c436106c1c23ef004bff2d81c30eaee120d81425ff6097fd1b00a8dd1809f027dd7097fc825fef0bc1dca06423c08d7bb80f886bd2d78a11a0c07dc0b5447dce097fa9af02582259642ff3cd36117f9669888068a1026284330412fefcd2d1065e421975220603d400010bfbad73044d2308d729ae4086b8811ae135c01011a427dbc08d6f52a5844511ee42fe884dffec55c435b207e622fe586e810d6b425fca6b542210004bf906468476f7080e8484ba5d2197f1529788bf87f6a843595086af425fbc0907b82105d0863b42358d097ee0146086b1694144357c6af75b946050d09f68420373097ec6fd824ec5b584127498a7018a526485fadbf562266a84bf557ea47f38c06c412fd35fa5bf49f65884ccb08055420754097e86fcf88bf3a931d2620fbf0e6e2580c5f9c6aaab6106449608d54825f99bf2a22fca04981092c425f92bf23f600c23e19a28d501a9fa49f197e38c1b00f801ea0004a5f8a08d4d826fac4be42035184df5012fc2846a52920445f845aae22fbf4ca110c450217ff625a22fbd351710862025f76ed6422fb9834c117dcafb8b50b48a65f0c4b505e71aac812260407a41017e04565a11a83047d3612fb4b50069fed3f117614486a12fb28469ee12fb1856f293232fb0df5dbeb631a76850d10906825f5a11a422fabad13103bf0234e169bf057865f5469b8d36865f52091bd024c67097d39a62f68e18d30a62f08697a23dc41499097d22fa35f441837e41b10869608f111e10cbe8011a536761117cf9a4e8869341030804474812f9cdf3769268e6084c40097cd4b4f07a4018a5264a5f342f2822f9884be605a3045f2c0ef001e81b08001297ca86a7080ed212f93347268e23a1082369088da03a688f3197c86f90346b68d434b0202008f397c7ef8e882cc6132c0010c68c6597845f1c01662260b84fa74d160423402c9c11bc00110467410eaa04be2e8cbc45f1408d12c24c0b08d114087028b000242f86fd2f116a8c216240d2623dc6561b0832d825f06097c16f8108686c58318ab8cbe01f49843afc09024024bf10857dc2342b685022f7ddef91005ac25ef7bde6576065ef008a37420c571b6e22f764be21119b025eea188020ae1047307cc000484bdb08e21825ee5081f2119508bdc77b80415ac092f4c215a307dc0b54633fb75a022f6d5ed767eb02f880c0209f45425ed2de24219f304bda12f14433e22c3422f66decb10cf75147955709be1ba0a5ec8451220aa584bd8b7b125da0cbd7c12f5ecbaf1089dc86408679612f5c84a24a13e8304fa08125d204677a218045eb3bd5e89246224816882d0465eaabd4e219d694eb117a8c27cf9ab6c219cf84f9ee12f505e9e102b6c61a88443a12f4dfcf210455c25e98097a5826ed408ce425be8844101015604bd297a48421ff097a3c25e8b43e7cac867ce1097a1c250d808204425e81081c6424b6843a4874064b643a5022f3e83951179ec2336096b6cd6f75910bcf379d8414180979c8221ac058a000464b5108867cdcc0397011e42f3709e013ba000485e6cbcd422f3393e610ccf825e6227aa9be465e60084f1c25e5cbcb5f32465e59bcb0acb462b2b09008825e520b2e225968592108541ee888bc9c24bc45e4a0aee01ac00090124a13e5d0466059a1447cb7092c6bae908dd001197bb2f410cbc025e380978dc99788aa9412f1a04eb8e114ccd8006b000253e5401551178caf18ee7418cb62aa108bc5d2bf445e29bc4ccb35ff210bc47788107725d2204b90212e2097874212d309786c232bb08834495e08bc33f26840d27097859958553218183020ef609784d05c88bc2578399510c653e12f0687c84654303e387c60e8032f05846528102c203d10996000885e09652415e065e0508ca3425e046510ca1863285650881e03a6843300006194000f801ea00048050d09f21c207320977feefe08243c1026580021177e593888bbeec9b8479030977d425df1081b54a4c880da610e043f900977b823264e48222ef599331177a4211e209779be3b08f8d5b8d84325364a2c94192720292364062ce324a080384220250977788d088bbb777604324303ba062800010059c12eea5dd3402633e2e0451ba12ee8049810180424a8009b87425dcc94f0c8a08b105c0086e0004e4a750816ac8060361000243e2a047eb21190f9fe83fc43039a7b946438c86445dc2bb8022edeb20b084032ede11081176e424a5f0843f0f1c0821f2118ff047e8a1077e040e3210689843f6213e258421aa1b9447c480929402069d0516000060174097670210a32140526465d99212422ecbca4110640414f0001184204231d720f0948432090bb2576458e80c4b7812ec7906310417424a32080d30231c7638a22ec56de1117620231bb207c179c6ab102074118db84bb06c6d5f808c535e118d99f3f1175f6510086361970845d7909286421f2a0975d825d74bae421c72846332c6601670c311c12eb7dd6d1175aeeb55d683df2136813b800139759025d62940222eaf8f93117577e03296918c5dc206d80975698b5081ec612eaa5d5262ca33dff1ec41e9d220c831600166224f484ba9f279c45d4e62aa224f10462a4271445d4a09276c25d46ba8975086313c1df4262c40190ba80124ea84f7da1189ab132112734203410974e0231287d36218929e6d1174d4f34b87e1974ce4e0081aca10f2b84db181188b6d89100d1423e870974b24da089362124d704ba4ec42a4d58c2ec2118826d7e10c3fc25d1e61e820241800111746823780021950ac21e1b097454f07cf3e190dd0230eb61d4c3a064999097440230d708155020677024620b85040c6012e865d0bba1232e841de21bcc0ca828c08f730145825d0409ef10230c03ba8203a06f10ba07740bddd03bc20181425d00616af8f86d507e608fac55ce3e3c0973f025cfa08c2b47b7086156c2a4449740973cd853496f1815e02309f0f0c224b484612e76343b225f220c24c3ac0850da124b0110706c2000480509081ce821d740e6422e7404611212e737ba111738c20259080e982307a92a422e70d3e210b2202306a219022e6e30683a8a32e6ba32210333444002d519734c21d3609ee6425cceb99822e648460a0c13847b9408c12c2304ada402182330453a1c32e62ed1a1173082303a3a0018580629499293b1c230350972fce7b08b97d72f6e5d9ce74be452e5cc91e10c09461a88710c10812040f981181005b90e7e000487b810893c025cafb95a2180a3012399a3058bca14b95612e55300b921032e535ca260041d94035800131727ee4f2ffd1d0603d4000985ff2117fb8417ba117fa843f80117f9aff1109f08263818a000242e4b5c94074c32e49dc92b91e32e460444117228248e909721c2088309238c27b5a08526420b657fc823daa845fa2bf3ca808b53212364200fd0971fd7e388972e12e3ddc7ab8f2bf00848cb08bef076f88b8e42bb4576047d62ae513bd841b421246304918812e379c29105298205ae09d21822fa92596217d3045f48be80bca0c3828117cdb7121070242275c0815601c6805400460004a5c630922b825c5db8b8be2413b8001297160df788b8ae1d1447b33081cdc4b008914412e28fb2f11713c200b309712825c46911e8cbc65c455ec8bd84603880971097af085ebabd6c42f59097102e1edc3cf64042e1b84f63a12e1893d610bd009e9085e7abcf0dbe00c638ce5179d04b85970a842f30083be025c28f62c22e11dc222f7e32e102f24112188762322319ec4421389097062e0bdc1519704ee09078319701e42c8890ae12e02d3141023da696880868117831b21b8aa31782934d106c7425bfeb7f82177e2ef910bbe177b085de812dfd5bf611203db4000141b1011773845dcc050845bf3c8d822df786a3116fba41c08b7d61176bc831359a4b381a1b12d3020fe04808259610d640425901032407cb0696000482ecb5d92096462ec60820ac2082908995c212b8096f702481e355c200c62ebc903420d5104b7b0badb2280cb7ac1131b00c7000232dea03e710ba9021a7c0835a0234f708497025bcc096f2825bc9b78e69a067acc0a4010f4001105d1c12de27ac710694021a4d096ef23f888348e12ddd2e7a0906000881a3708b9d423ca1096ecd73786c20d7e6774a5bb008b99e3f0080af012dd65baa116e9c8e508238a19d03388001216e863eb88236e12dd06c1f1046a825b9d233422dcd048fa212dcb040c4010ceb808f116e56dc988b725eac042e37095222dc685de1066d420172096e248b2888f7611714915210b88eb92885c4424b447aa30805d020927089604a4c88b7076e063d70c4aea47000008c06d812dbe045c28b84c3b08cb6f61314447a40934b425b774ac2217019963099e132c001145bfeb7f045b755bec0d7865b71b6e11e5465b6d2a4a22db6478b10b79b9e008b6d56da042ddd6b4822db2db644a66316eb2dd4116d8824779096d7adaeadcc19496c218f209e9ec15480f5000042dacdb58051e32daa18d87fc83212204b6a76d4ada88142216d36da482b6196d216d208b68c12da29253116d0c25b425b2e200c584310a13d3084b67cb64040a7a6fb022d9d84ea11e96827a564961a74c63bee1f1e120c00110494a116bc3a4610113c27a50096cac25b2777b8207ad04b6481239c0477aa12d90db20b63cc45082d4d8e5a91a465b1908918d493800119e90c9dc888e4aeef6b4f8cb624b4e8403d2096c4023e9b0891002471b08b4c56978848701169604b60d6c0c434f7096c0238808b5feb4942a7821e05e00004c054c08ee9c25afdb5f8143465af908b46968b88d2191c0022d1209a206700cc8001285d642071508b438204bd091bdd201049a01ea0004a5af208b411680c15319e89822cffa39c1afccee9019a21167c03f949e032d750410ee97c8406a3096b9425ae48dc25c69ff210b5c56b8636d2ce5216b791e108828212d6ddad9100c8022cdc099d8425ad42dd037592de10b5a56b3d1d50cb59d6b2d1d00db501ea0004c46c60836ac246c308b30c216b30f908ca865ac7f3f622d635ac550fe3165bc6b710ed2025ac0088d9c2167b0e940ca00ee818a0000611b10446c011650a35c01ea000482c9e096ae75a70859303456ed80cb56d6ad042c92766221d968419f612400918c2ca28cf82418002216abed571647196ab6d538594180f9c2469608ec51ad50858e412d515a9c1002cc2468c096a5825a95f3b62162ec684111a002467aa2c45794af1061d5dc261628ac4f10576c279d6096a32d4599bc00d60004a0c4008eb782116f09454825150096a0dc4308204812d4084083412d3fda7ea28c31d6804585e15ec42c2a08b09c25a78b4e822d39045840150c02a00230002501b104583b1920422a00814943aa08758012d34848c8611606848c7eb00a5dd8c58001231e04b4c61231984b4c1abdc212041f00460004c5125096976d2e5a5b16f84113083de45d8315f8950a0ac80e94139800130896825a57072e023c65a55b4a8af8912490b4a4af795ee0c8c42125cb8429dc13cce040c7a03e007a800120539c23a90164e2580613c708af44a6d82d903d60d30a02d508af2c589f92819691825a4315d811f58ab904448115e0044eea11d4104b47de63c42ba95750ae9a30010153a49480008c574287e045a35f31117e465a34b46717d462b9328c422d18da2f103490212cb0968ac22b890968a038a88b448115c02b7d11688ad0e08b43086c845a1156d0ad964709007bc8bb045a0e56c4ad868551b98072e023ce5a0c0979a822b5809682422b51812022d0304431612d02f96c1013fc04f008f19e5a422b4008e88422b3d56762159cab3710e86c22b300967fd59588742a12cfd45b407ce31d0704b3f1e57442b1b7412210a3041d3412cfa45a9104d7c23d1408ac40d9201dd03140000a135208ac2bae9082692104b004080a11583ab0511e524279470884792e908093403d40008c092c1157fa1161011c02211309677444c042f00460004a458e08abd0693888b1611cf20441fc1043d97db10abb40ba08b3aaab9b3358cb3a221841cb808f20ab7d0758825c012ce5aad710838020de80ea6000062ad208ab4106892bb01ea0004a793108832c2792e09670906088101612ce07925103140212960bf61bfc03580002825d82792209a958259bb4156222b3040b6812cda45621049d420d8108aaac2455b0966c2cd688552f1534459a9349622cd2871102fc03d40009440c412cd12a8007063102c848a7c11881a580012166795362a69688441533044be412ccaaa6111664c345493d196642cc6aa5118a93c25de0080c80278f609fe02780479012c0106398405e812cc45987b30ca8f951d8b0b053c00050060e09660425980f1d222cbc84b2f165dd513450c20a871ca7257e1965a48990854302fe947c0c542c44a8035800120e51824505087f34208f309e3882596003d60d30644f909e374244f30965794fc083f54114faa9f489da314f706d810a7b0fcd043611e640fcc0453d264d8202008f21656acacea0319655aca990a32140050400098b2a3e3484594e0965362698853a67d9c45948899c214e7906a11e324244c709650882a03d500d60004a034c082c34229be051e2014604b27409c44390108411011d86f406960004a096d0912dc25934203c403c1458001299708259335b5822c98592e10a66020fe20964a83100889487c4819d820d00560004c5927b24aa62e24d0404011e614c50d26004600048318c082f28204ea09647821ef6087bd02591db238a5df4e990b236a5c18bf8c070c12c8c1ee7146c1ba88b914c33412c8a86db11644c7bb88b21e7b68478a40964394ac0888fa114a7bfe411e25d4a4081532114a39eb011641c209c508a4f949e08b20b641137c8c1e34046c1b08001205fc4209af000222c7f97e810a4b8258fc5254a4a06446808a4954918807aa01ac0008cb1eaa47c458f308a468258f1522b3d5823eb15728a44948805d2181a6c244580879cc20ecb0e8022c76b87e10a40cf30179a191148258e808a3e0258e63c9c201a28451e805600478cb1c8a3c26968cb1c6096c428eb0e80224d704b1bc2374428e72ec22147204888012c6c041ca6d520458d5117822c69e9731110d0228d52c8e22c67d8ce51a033c3004b197632ac64f85b20a31027859093ccc2441c09631986b8813bc12c61a8ba88243186604b17a1041fc0901000ac000885162379c19892cb2162eac5cd8b619c61c1ea806b000242c5984702e11450289f513da578843fa08c2c42784509e0fc6c408615212c55d8aab152e00c858a6510822c5258a350fca1f08589e1aba1de003d0361000262c4d84b1336262c4bd89650c252c48d890b11f738c8588cd2822164404f06012c4243cd10a121423085085b4bc4283e507823c1504b0f474c0428350961dc2282f036c22c3884b0dde084443b908744c243b609e06940e92cb19619ac318850301030b00c5293233c0b84b0bc1348e041b421140583d21056f189688b0b7616bc060c12aa121cd84f01012c2a84b0a9614845851b09e301c54f1006c41048c04 + +def cs_15 : Nat := + 0x1c6c075c1e611d603abe7a80e9b1d30e1c4f268e8b1d14fa1da052609c6a873f38681cf240bb78e7470c678e081e351ccce170617db0878c072d0e591cb05d5472a8b05383951c299e261c9c1294e9418977610725f19e1038bc214831f00460004a0e2e1c5be1806383d08349c20e2662ae238cb0e0d1c18a2f8b890e063bf27070200f5000231c160dfd1bf837ed867943bde127950dee1bda37b0965941bd4379c19892cb21c640b770ddc514e083c07a800138e0786e7081b98774830eaee121c62ac58881b7236dc40981087714216c77fc8206d804e2fe138be841b421278c049e283db840d88093c314440d78e2ec35cced1986ffc5a506b37173203588ac8086ff410ec90d5e1aba356e7801d8b1a97c5b439924e2ce106928d231a3c07740c50001301880237e4093bdc68337d619c575be5882a4a138ab0cd110a1182715309c53676f0850681590eb08c196032bc6570cad9db4521e0049dae1064d0c9810325424ed1087434643800118dea21da08e28031b86368c6b21c4e6763889d8a1389ab79b11c4cc2712e0830d427129089ff8271236f0ac55c637822b48201f8449610ddfc2711e6eee30086711617ec2fd61c6100ecc12754046ecc2f7b886155c09d801ac0009c9d350e0c427c8082ec8aa388e20c9ed85d04e9221c3fc20b949d170dc45c48b889d07a3b4e0b7c093a0024e7d2a022d4c670f8c17021b9c8438b82d0442796089e44270f409c3c61ac88e1d6dc8c5741c3115c382b056f0add15b870ac56c8ad815ae40843e4232a813994e13089cc23ff455e4e5b38222ab8556f0e341394854d8a99183f8820d58082a5854ace4d15102a1cdfb189c841271f8414fe29fb86b8ce1a2297c52f0a5c28a406bc07a80014138d8a238a4c1496292824c189c646f4037f806b000250521b6ef147e28f8a1c170a3138b8de08f850d340004a70ca08db8c50a5e7619c31c21b95668621b6cf45f100d8824e15089c0189688138011b68d7c511c2e0236c8a2d020dbc13c711c2ce6fe1b6a96724137364a01025cc4b9606c18257c4af04561937d824def12844b2c6094162ae23854c2e511c29454f084d7a11b4f9b2cb3dc23fde8a146d381135788f311c26c4770e75184d304757097892c426f226a01190da448269b117c758462696116fc248459f08f113e6bf844ac374489a142708709376533c887535ca4bd4437a67439c20c426f07d108e2118422cdca0c8281b39882911371041188229b82207440e4dbe1026204b83b1aae1006c1b3704e0e8126d687b20f6235e43d6f06e8524703bf924f0ef2d9483ba87749b40ba503b39a670eb848fc0ac008f701d583a980011936682073d9b282091484e0bb36404705a0ddc1bb437606e82811bc001080dca126bf844be4104b0049af6110c07a800120689c36986d1e094412f4849ae61a7034c85782068108ec868c1966426b306886c3a1a0a6b0a02c31c1003308660e0744340c840ca5c0d840c7f09355431a007a06c20004a70300c40238160b0510a37424d45ae6a22122040bfc17f5af98cd0121381304e03e11af385ac6bc508cccd2859a0b31f7390069b0815e82bc089a7044d82b38563e03066302a5b5d70a8bf71429b85360a6a14d0cc0852c6ba2b83a4051de02823807a55c098e062c84d1c6b86654824d04994aaa5c28e700608d04340b239008a8953042548089514218842b2176107420e041be001344126ffc07ce237fbcd0832380ed01d983b19a04644833c00230002b37f7190c104f982359a32047da4641f60933dc324032cdfd2437f3028f100a3023589207c179c6ab1031a2126758449f810bc011800021339c218b80862d026fd82596237eb6fd3dfa3bf42669ccd26ad4737e7a756109358035800118935026fca09bf216c808df8810b0d04df84d55846fc008d54824cbe09bef77de354819beef7dd07001892b8224ab626421aa11847c3343265a04df6c1124e843070287679f0c6a7210c1984df61bebb7d56fa821be9b7d2b5281932a523f885aae137d035212382337cf4ca26228337cdf6b911be6523488df2e137cb034b00023122b8eee04f409dc000942f9a11ff204df24258042b2d09322df4d88991012643243d104b2c26f8abeca2013a041aca1263f4c7c11be19dd388120897c846f84df00237bfef7cdef731b48415e09bddc13e08deed7d45a6a8c8de8126345f4a2e6e337b9ef7011bdbf7b66f6b697240b8704ded3bd9a62823bb21bd951daacdb01640004a4c4b12c0211d92cd6108ebc6e892cb188eb0b6e8620188ea826f60acc6237ae0dab1036a42239809310024c3a1ae8f74466f572d3620bca04be6211a42348110d1fc2168c088dd04ee80011930cda3d34781930c82a0046f000440abe840ecc137a6b46d2cf234e190414de941ce844c2868d0083c07a800128d19026f46983c20b2f04983474a04345c090440200f6088d08245818a0002437a14c1298203036904de81bcfe6063445021c0a2c0009c5dc210662842c583d68423180858a034d000119bcec65b08be0c11a1c9d281032b02230e09bcdf79b6f35de67bcc9d7e188120125f90c8811bcc2f7c88de5c8bb046f2b2bb0202be84de50137930497c3456444be0337a23792340e11bc89c43080b82137906f1fbdc032f6f04de381115f84979e56702c3858407a2132c0011c4574102bd84de2ccfd0440be092f265e433ea19bc4f788ef10de1f7154a161a09bc325e08846ba105e884977c5558aa984cb00045114484de0e9f00433d6092eec24bb709bbf826efabd7c205d08462069600048227b09bbdd9e5227119bbcc7b708dde2125d34ba410cef024ba1072e023c6409901ea0004633b72b482007e844498125cda24816882d04809c00902402462109bb9d1206463182cd424b9508cea4a73516819bb88a7088971b56d846ee0971420a590444401376c94ac317c01ac00094ddb0455c45e9809bb5b76a080b3213769eed20558337686ece10ce282ba971f0002437650443f2ae78421f5092dc81a288dd8c6f8846ec3bb602375fa5d210871026eb908c4c826eb609bac824b5809bac07b40896aa1375521ac5dc2325a9219f37300e5c04794668a1375384dd4aad604036209ba8424b47092d195a508666e86184218412c0209e384665e1374bcb3e1085d424b3b09ba5259c332219ba4f748ab2b192cc998c88dd212cb42c90c42a0f744402b4092ca9986080af415e044b2526ec210a421450aa6122c0c5000131ba202a488801a000446e840a4010f400110dd072c6bae90cdd001197b04962f2c590938c96261058284dcf412586983f112c2dff988dcedb9d65814aff212bf80ba080d301257d12f311b9bc200e60999ac201d208ab842d98001192bd09720895e2cb10432c1092bb556a88dcd2caec420d125782095c93c710087c259c6092b9469388418c119577928112b7e56f4add41764105c84654e10d510495b21256bb29f11b95c3e4880f8e1f183a00c959f2b2e565126320ca442057808824026e5424ae237292a9a112b09942a07d1881e03a684330002437274abe957a1cc88206d1a3c07740c5000128015001180011977f024ab70996000866e49dc90c9b86790308c9ad0282b2d1868acc1f88955b77c446e4109b8f8c9988cc7011fc4049546c96c34c0c406a1254f663010c95826e3609b8d02758e08a95026e31dc604b2c65de0080c8026e2c2342237155dd810464816a88dc4f03784323e092a1546e88dc45b88770f8c94fc11917041b421253c1165107fd026e1794e42370a660b11b84590d88dc1812535846423836441fcc9a5a20fe511102c34325331fc611b81c28488220603d40008c17a010100478cdc0413ba24b0cdc00136feca583f5ea7e80a500c70002736fd31f43f54318f910d81aac336fa8494a0105b88402e812ece043f02118f054bc107dec07a800119b7b426dec948042000c0817e01ea0004e6dea63a4236f304639c2c8046de4946b28d2519ca31161a614de8402fc03d40000cdbc528b843f0909b7718dd903e0bce3558a6ddb0ba4200ba04dbb05c8046dd59440236e983f711b74a50c889430628846dcf08c67c015800118c6742319b09b735c71883e30125094a11f82e30f85843e12118ca04631e1069384db84c62845d660975902185c087bc847b8830ae136de49fa10c5ec3728852d2136dc6db73dbe318b978a610286026db5db67b6c24f731640d2a636d6c9ea1532336d56da9db51b6924ef14db44136d0eda02fc4336cfb13d11b66a4e98893a32742e9d0c9398c4a8417b709271c249c662482189104db2679a5c3e84e400460004c1e643cc05e686311c3cb6d3dc649bf3cae236c6042f022438ad20c3c9c124dcc9b86224336c45d2911b61b6c29e3a11c413d4a49ab0926a188188dafc136be04daf7b5e87218cdaf3b5dc46d730d9621875f86010c3a02499a3bf8236b8170a1018c02170709b5ab6b4ed68dacc40eee04618e118633e4c10c300eea080e81bc40ee78493081185d1dc91036dc26d5fdabb73e866d5809b554ed483f009d2008c000982d42136aa05781125b026d5192d2236a79d8511b5336a5050800460004a6d489dfc224adb08911256026d44da84c1e02510dab28c1dd2e8800119b4fc24c08da7bb4e9834e53c210dd02494a2a4a229ed84508c13699ed311074e826d2eda5ac17466d2c927e2034484da5074a8e940c19581249d7b94107488650880a9213690043a2c11822049263948c443b409b46825cc209b45a76388da241368883b010c0b027b8509248426d0eda1b2475c43102048103e6049230106846d0a326620ad2046026136835cab10c03020c07153c224849cc010560c26d0108c00c2a0046f00044029e040ecc101a6045ffe10e5a033b307e3367eecfb11b3e8fe0082aba117f884d9ea1367804d9debf9440d5609b3b4a9b08e954124765c8a11b39826ce30d5a217e9842a1c2da447b8cd9c5b37c46cde91b02d2866cd991ab2e5c66cd709b35021c4d179420e2384d9a0bf00448cb08bef076f88d99a2bb4576047d62ae536666ccad993b323663c8bf3016b826cc4382e882066cc0916ebe6db8910d97abe5c40a9909934822b9e09718026cb84be42245584098a12454ce3f11c36826cb2914cbe04539c95e29b2bf65608913c1244e045ee34d5c42f6d092258e940837981244a1bc84e5031b758491226ef82198001206ef420e05b300004365104d942bd7841bad09b2782488308bd4821d2809b2657a78837241243e745f10f500209cc19302243d7b1d10bd1026c90d91f21c8637d809b237645dc2a19b22b6441b65011a00ac00098d90a1179484d908bc9846c8390c94c9063d2109217ee0c88d8febc5c46c7e036c2363e6c7bd8f23242c84d8f04d6c46c7790a439d466c74268a22dfe045df611e8384117410d8670920916062800094d8e01177810c810bbb9776089086101c0cb0023000052420888a62ae3241faee435da0438145800130bb842483d10ee97c8635aa082dc426c6825e62176e2ed825ba3107304906720c00708c359012416e4631120a8237d808bb18248280c762362f04d8bb208342c8c9037206575c129021205c23cd008bac57577770186a3c26c555d566a206bd1007ce13628849014136269a78eed0306b00424a61174c045d2e985c035800120ba54248012480226ce044c241362084d881b0f841a56091fdc20d1f09b0e4d2588d8661bc0cde8cd863b0b846c293432223f204d84ab99842e650d30223ef9a0423b2ff9086c238fbb6e9466c210cdcc55c647d833e620cf919ef625a336106c1e5c9c3360e02f4100bc8247d30c5000ac0009018d61360b6c15d82632ffa829801ea000486c118f92223e3c7c410b8d020c43626420cde84a5243684419b509b01f602c7b94b100314a4c988f6f1eda3da857a0af0523d999954afc30cc883610002323d8198d1095d826bfa081da421987091e9d88a08098a123d204d7f0f168419700813d4247a278a806bc07a800128b80022dfe08655c26bf2085c2822df5081ba026bef5be24340b2390d7d8135f59525111e442478e091e2c22de509cf0026be43242235f1b5a610d69026be1322621299844a5e123bedb62116d7c247781056235ee7a7c11af682be888edd1db04476b095223d3b04d7aab6fcc688c8ecc10c65a4f6028a000481499084b2c2476209af3426bcb08627e66a88b68c100db0424a612da1845b38935046bc80316235e3987e0a4010f400114d78b1d3a3a60c0840135e0048e8e92f0447465afe619066bbc091d1026bbad7731d0466bb78e78235d903d21060877d408d75cb5869068f480ac87584c6bac0819dc091885aaab54046ba909ae9c26ba509ae84213b9091c9e391085a74135cf6b9c8e3b1c6c8471a8e311c5c2c010d7376c0c434f709ae675cb88d72c3a6846b94d724235c86b8e105d8d882810e05160004a0bc3091c04269088dfd1bf438a8cd70e10ba204d70a8fec45504661930535c151d310b3ec26b818dda8f849659047bc0f791758001205f6c26b7fd6fd1b9466b7cd6f71b8d1e890479e135bb23c211050426b73476e22e820406401166e04d6de0bf046b6c0813d4216e347585b7431010d6d011667a3a4111b2026b641b562166451a81b3a366834c14d6c25acc3e4232a21ad7d6602cbd191b0165d9c14191af02287f0815bca4c88d6acb2b0b41157d21ad5635746adf3e4435a884f5108d50b348846a41164c84592c1164a3b3310d17c23b3109ad2b5a388d68bad0c42c85590633786469b09ad075a06b3d0d2000ac0009858de32d4092812321ace63481d28191a342a20858c41359a7d26111a1d62e08d65d19fa33c0cd65319b845159085720219bc00d6000460c4009ac828a9082b7466c0035800121199026b1d09ac7061788d63210ad604d62f451843ad008b0bc1e4028b0002435899590108ac820c0209ac3ad3908d616119f5048c928a8046b078c862160684d603ac0357fc63644f65231ac6331089cc2463009449420f6e09abcf5790b7c19abc3577c62919abb3575088c4a101a60416882d0442bdc09ab9b572c61e57ae2cd4a6ae4d5c6af4066addd5b8af3062bc77fc82356cabc5750e303f399bd11ab5d3ba888c1c88644040c0888542460908526426ed4080fc224b08575b8ad40008c44081230104d591ab1ca3f8a9921ab1022b9e0917ec26ac2098a2029989c011aafa2fa8843d01355eab9010516426abb8be317bc66ab55710ae18645e9031621eae04d562add8445e4b42aadc10dc8a1d9e7c63556c5e02834506080a0fe48220a0b141311000b5486aa8c5105c7c00090434a135525a0c11aa8426aa0d5382354dc5c78b8a3354c0efc10acec26a95d525aa40645b65644235466a8a103a682136908152426a86b3e0222d3c5a68b48ac2c86e80091684202008f19aa0499b018b19a9f82459c423c97486174609165d57f08d4ede50442afb09894c208984654222c70455e61069384d4e7a9b753659d021a9a042e038d00a8008c0009825be19dc0918cd4cda9975319ac820ab48220d50915f62be20cb19a98027a888aee4ab040981dd03140004c6a5b0915ca2b7d9bd19a9662b508d4a915a22b3c5654148522b104d4a5a9475278c8ab01155184d49b1544439a609153954688a0521026f86e811a91b522921c2436062ca6a4209150c2454240b22351f2a7c54ea68751951454e810100478c8a6e4b2c4193309a8eb51c08d46d14c446a3154b497440009025c8135170454a212294c52806403229284d455a89c46a26548823512451e8a37401c8451a40142604615cd08a8c654008d43e25d8445133ffe20cdd04d43a36844116f0845b426a1b8a1820ff384729c95f846a1922642150c0bfa51f03228384d42fa85b509c5002113fd50284ee892c4227d9fb91113dc244f589e6214fd8453f013506a9f553e632276843f4013504ea08217f3cf8844e80d7e677466a05d406214f290a80d36335008aac11137443588d3faa770848c78020a760269fb3ed2234fce9f611a7d54e619dd19132626388d3e07d60469ee161a218e284d3d67d484060509a7ab4f40edf1912dc244b40912c625829a819a798c5488d3caa6845580698203fcd8d008d3c4a660444a7b2562225344a211a77c20a7392bc234ee84ed1013a822983bacc234ec44938924a5e88297808a5d821855083e6c7cd04a21b56434e8849811a7434e7863019a73a243a9672190434e4e9c8d38c7b44869bfd37d11f46447b529c3d1643f90048c10f5c84d36c7aac4294209a6ce23888d362134d869afd35a334d58f0f134896f0869aa2fc4207828488d010bed84d34a101a604d344134d0c45f1dbe3148acf5620700514000945222101a084d337a66a22c0cd330a4244699788ac5e8866993d3222074d0488a05e084698b09a6242074e0934b4228ed09a610269820839b4f1d08e209ea4222271a6105d842697c080a6421755051600046697a3c5220f1308be3ac2334bbcbbb10974826974d2e4a354b239051a68ca844f3e0910aa214c428884e7818a442409108946208883f107a20ec41a21a5c02aa0851761220a04d2d81042004881e4b2c40de909a5a74b4440918e0786e7082596134b2e962514036dc8098109a578243fb87f076e060d94090fd4ed88887e6c2a446958d2ac234aab803107694243eb510215dc0358001290fa0ecd0887ce3588ac80c6ff41143b84d29c762c3b30cd297a52b4a40cd28fa5194308c87b30f621ea8cd289a50b4a01d52210f45426653c190f3c2693c5086221e5283b16e23034d842c481a4c47b8c878ea0d02b21d6121a4e21e2b7b6190f0a1e008d26212c36843a38326c8dd13e621a4b4243b8876c221da04d24e26704119109618c243ad18c02276384d23c1348e04d23645bc4691a08ac20adc84d22da457488b788216154231570961482036c080fc224b084fe4f7444058b0b120314a4c904fd6106099595181cd3dc827e609a4241b10887236118427df2b00221c604120a121c560d9109f5020158011e2347f1cae0a3023dc8438509a3e4e4e88d109b409dc00018d1ef0e001d30c86fe9ee53db8cd1e69ec6e450c2a58134784374110dc45c484090808023ca15210871dc20b7c09a3af47527a52a1c2da447b9886d021a0477f4089e78243644f36dce05a38c9829a38ac0d08d1bfa3780478c86b69e1840b031302213c0811b06c20004868da0870d42277b081778268d60d362346a434e4440334690415b02b5c81087c8085e008c0009c8697df644276909a334268cb082aa9a7b88d1901dec40a9909a30c6ac084eac1219c147611a3053a88886690cc05430a85067660fcc68be865e6fc8668bbafd22345c68b6110ca2192871c186f6c0c5884e6a5114468b2d1610c786272f4e5a213960a3e28705c28868ac6dd623455431714401f2c1a5800131a2a020a14bcec234539414106eb42430e4e306e8c34988f7289c5d3899b994ba442185270e109c241b108860a1344e018102fc03d4000948120109658486010bfd37c014500025217e044de66df00631c6721a26344a099236e242bdf04d1206d704688bd1146d5c6688985d225089659049e0101b984d1109b2c46886d1090b7e16f42dd1d206344084d1009abc4798c4d5c9aa84687d9bc776c06687bd0f49a4866877c09820d81183f11a1d743a1aff19a1ca165884d0210d78044cfabb844686f4cec21b843694992899c821ad8018e000461ad225ba234342ed255ae30968844cd00ca828c08f720997820e79090ae832088358010d5e840c761095e0479bc10d5c84aefe3498011800021a17f42f685cd0b7a164a6858aeec20d4c041b2e1061a84d0a064cc4684d85362214c84d09009d0468460835802684208356026840090a22143874301f003d400098850a982c4428285002341c84348e1213c049b0c97484683584e6212fb840dd01023780011109b82426c12c02022f04d05ba0ad2f48c4bc6112f0844bbe13411cd6710474c242580897482682084ac2212a86621067cc211b509a06ccf6889ab2112e20c7e06c200048424e18e62017a0405e200ac0000c4b74188046813d0202c1464248339423407e80e8488334060c436264312cf0422e41211f423c11a017402572b19a008242350b2e23400c22d124e312c184d0019ffe114998d219ff33fd4223098a433fb84cfed9fd210d90f4210860267efcfda20ca9049a01ea0004842144aa41ba060470081b942421184209530667e907e622103840b24133f1192b119f8529b19120cee048ca41fb4a5820c818483ec1267c046b2a120f8906e1145a0241ee0863bc267d7add8233e9096d1040f82f38d56199f3c267cd099f3127988316e6774441de83bac55c601410002220ed24ec5b5831ab884cf8f074c441d10907420e6877551f0413ab04cf8a9338467bf5b20233de045b0810275046aa204381458001201c88267b86a96220da24b0d3a63038004cf6f9ed73da24a3219ecf3d8041492bc433d7b532103d68225f2099eaf3d356ad199e8c20362099e802679b08023c217df09062a0c38eec1dd23140a41856a142122997c312d4179c6ab144898133c904cf239e3d21e8ccf14133c4d698102778267830905c42242511f603d400090cf0305b04677ead26220b44166100a642677acef0233bb6775cee88fd887a26099dc9a658847d812b4084acfe120a617db119db73b64148828f59d986b98ced505186fc836220b394267663590220a0566a59b8333b08412c01209e23af1ba24b2c8413a2da8233acc1368268333aa04cea79d444238bd2ac20b5396a42b4830b51c97110e00c2412e470a233a7e74d46fa8de840894ce9435684674746e4d1d46054008de0008641242cff259860758088da4267420859e469c320819e7c82411c46ba233a0673f09ea31a3204ce7b9cf339d0cce7104404410f46845c286410d08d15826731099cc33978438199cb339508ce519c98440ff058c2118e162c1eb433391daa31103ec65c08ac2c58581b10c81f01207b9609119c7338d8c951903bc24bf10832202342a08d0a0222fa18ee13fc04f008f290390222f5088bcc267120c342206eb41c119c3b3868c571b6e433856707112f6c2388609033c3e6080f921206604458c1206322c111031515e959c0b0e16101e884cb00048115d04ce00565c2b8856f2932519fa04cdfc3008433ef080d88266fccdf2219f2042ada23cc466f6452c55985eb495e292f042235d082f40202008f199bc6056954f17700a2c000982a9612055b3d6119bba5db88cdd99baf374c0a020cf14266e50f2c23371c09e813b027204d14cdc210ad20400d6000444096812a89205a20b41299b7a048088c4212047223d972a3336c04cdae88d89e38c29c03738400e108536c16c81eb06960004a4085446488bca628c502956cc22229090200214bc0901f4a5908cd9e52b89658c80ec8854466cccd97d814602ac0901bc2406d099b1f363275c199b020328862281335f21ed1087a822b9408cde4266bccd742202c04cd700a6007a800120062c266b5cd66872461d2808290a9f4884ba4133578486119ab19ad08cd5413354e6a8808086bd0d6946698110d30f480ac875848219f37300e5c04790668a109fa04807606d840664099a81d168827ac1334f09b502360d8400014cd3900c4433320820802402d66584ef44c880c529326259f0442ea1334c04cd2d9a5041384099a402401a0b120314a4c908030852c4928ccd16102a7821e05e00004813690815242213e099a2109d08cd099a0f3416681800684bf73f1c42561333f04424c1c440bf00f500025014604160a1099704b3028a00008667708abf826676cce64c506089a0809a023ff1420a349c63fef7fda2107fcafd1005d023fe941ea21ff3047fc810976847fc6ab88466677fc2ff7d071907fbaab54466647faa21fe90d2710831d957792818ff3c306080afa11fe620badcba36bc0358001319968279220882c423fc408ff002552208ca5e2af88413813329040f3e13328664ecc96306a30533138031fd6a0780e9a23cc8664608fe9c2062008fe90266087f4202cc43f9940b222a8484cc821036c04cc80fe4902506cd86e85331ef2411198e82203c08fe2023f877f0a208ecbfe41080c824a9b0998b9fbf91c50ce819c400098cc5467cc420292364062c66628cc4d9893311100c401330fe61c646e31fb406011198604bb087ec436844661408fd79faed4e6183db826610cc1efd6461fea099825faa54d422205868a042008fd3cfe2c95e18fd305e888cbfefd28fde8c21f211fa49fb6101348265f83f66c7e461faf53f62087404cbe8fd04fd50ccbe41252984cbdf97b0465ebcbd2232f3bf2f119799f95bf283ef841f930421231e00465e2cbbe20fb38453a2132edbf1c4b7830178802b0002332ea8409e005040008c20c40b54465d1161a232e784a93e132e69f4d1197332e5b1b919971c34d087e0211f801f3f10fbedc7888635c11278043e6611f7b843e58132e00ff507900a2c00014db9e11f78846336132dd65b4a900332d904cb6012a3c297a10fb78f781eef1f363e6868002450002814b9040930118bf843dd601e81b080002196a5f6a1ee43dc460fca65a508c5cc20a1809968df653ec707bc8bb0a7c0209519c2659f09967b2cebebe7d78401b984cb339658f539ea420facc265916296232c83eaf5250318a004627a132c5bea6119620265877d46232c2b12d10c4a823e9e7d3620f381b5711960f2c1543f18fa3c23e8a2ef2232bfbe8210790c3a0083c82258041e3a11c413d461e380995e838a88caea132ba65703c3631f3684cad6132b5786010c3a023e683c0821870047cc6f989f30be607cbef978efa063041959f2b23e57359041f2a040a2c132b0047c9c11f260425961185f043ba162cc43e481b76232ad9dc511955c23e3f08f8f020da1095000ed888071011f1cbe38a7f4332a8be357c68c29086550a7e421f16be2c1d0603d4000147c52132a484ca8af86843e197c314fa4625d2084b90200f609950b29f1d4d1994ecea2041492bc4329ba8461194db29a6d2f18bb8423e0808d6a8265300d1223296046f6c13295e52a0a9231efec93310f7f1821082bea121da043a12132908c7045ea33290651fca3924ac83dee099468265180b8c2328b3ddc0b6831eed3dd97bb0734c61212cb3064cc23dd4056c232883dce7b9833287158911943648288ca16560040bf406c20004665060872d8e5a033b041a00ac000987b7af6e05ee8cca0255344539b08551c21d61094e55baa00001993f08f908c9f210362847b3e1327b06ad1193cca4c887b2ef65041c670854045a988c9de71942a20c7b1a2d249f30c5f8e132748438afb35041c4d17942327304387ebee857c823b0de80d2c0009cc9ca888041c2d15b02b5c81087c846546326f9c2611937b26e3d7519936023d71153a494800090 + +def cs_16 : Nat := + 0xe3cdc794fb032640004a38ee7ba221c75b8ea1fe6c680844a90986c07f08a9606ec052806380013815208e000011986b424fa808e384238e014e725786449b08c63c20d270986894bf0b04000041c6884c33e11c6438c47186e30437294c32a4320438b9465e21c5b88f311e298238b308e2c9c5838ad9f1641c54b8a8714ee2987a2c87f302a782618908e295c5231571986102389f713ce26c78c8641293db44b0087130e25dc4b38939ec85f6cc0eff277221c4938917120e23cbe7949ebc11c46b88c0c60327ab047d62ae330b90471143b4a4e50c710c11c428ecb0e7e00048388208349c212cb08e1f82387b70f4e1e5c3c1e540aa6122c0c5000149858dc398e8a7d0e400ac008f10e1b820e800a4010f4001109a5a11c353866118565c2e0870b4e165c2c3857160a530a9b851c2a030b23847086e10679f0c7080e0fdc1f0d2720e0edc1c887068e0cdc188c1c0a97484382f705cc33c63828704f850c638257048e08dc1128ae28e085c1012cb18e071c0db819c27041c0a8981107714238147026a26460dab08e04309708701b0fd84380c7016e029c04b80728361544403e6000041c0238027002dff8b4a03b801ea000500d642596203c604c24611bfbb7f66fe8dfcdbf937eb87b670399049dfc11bf4b7e8c22c31bf2046fc0c1f408d8361000251bec046fac1277706e810df51be7b7ceca7841be5846f90df1c6688c6f8adf11be037bf16e251bdf37bc6f76dee9bdc9d28318410260ff6f667480637b26f60debdbd7304228dea863d516818de99bd2c7d118de91bd18c6018de81bcfb79d18c0c82379b08de61bcb086f28de4f896069820de41bc7378d6f1640e6c844ffc11bc4b7876f08de05bbf946efa162c2c480c5293251bbd8c132b2a3039a7b94c1c011bb8b76d6ed8ddac5f7afff3183642376a6ed021bb137612ab813b00358001305568260d03ac221bac37576eaa31ba937506e9e591c8374d23e422e45046e9871fc4374b6e8cdd145be106e8939e5ff20c6e86dcfdb9f373b6e74dcdd3ca044901ea00054279108dcd5b98372f6e5cdcb4581827604e600052372c6e56dca4637256e422305627751182a8237206e3edc79b8ea76728dc69b8cb7181554d3dca37120870242275c08dc41b878fe218dc393ab086e186ffc40a8e4ea02a2fbe410622810262846e14dc2704a370420dbf8965886df8dbedb7d608f206f78236f96decdbd447b906de802cc436f16ddcdbb5b75906dcddf004272208db8c50a5e7618db84a0a08c1095f544271908db7c27e4d08db5c4e2884e00c4b4460786da09be00a2800128db34236c8a2d020dbc13c710db1b0390881bc12700849bfa11b5fb6bec0d831b5eb6bc6d77818bbd4146d6425058ab8ce1500fc02748023000251b57836210dab4236aa09815db4e084d6011b4d26aa10da61b4b08fc6e13f1a04fc63c24c408b2090600086604c09f8b42368c4d0a21b44b6886d0c6bb88604409f88cd70086d02da01b3eb67c6cf699a4c367909f87c23671356c226dd12cb10373827e1808204030eaee118d9c1b37a64a1825802366b6cd22061a844c7611b33044c6810c9984fc1210935046cbcd971b2db65a6caf80a8c36546ca2ba546364d005600046123f02b0023c6364b6c8bdd7c6602108d91300f886c7c126c69a4b118064236376c6c5c2867dfb0897c82362c08b8062800090345a1b5cb900c23e413ef825e910d89f007080d361034c046c46d888092812321f7a4203980897482067fb74619e0011800128d869b0cfde2197ff5b08b6106c1f7fe8a360908d81c30eaee118d819b02360219f765affb5f9ae6a41afb85fe0bf61bfc0358001317fbdaf8423c19f749af0fdcdf5440f201458001381a6c25fe80895f827dc909f7182311408d755aea35d15c1c42696846ba0959c435ce6b9b348c635ca6b9021ae2fdbe0dca33ede04fb6f7f4447db4326622fe5b5af6b5c64ac835aa0894f0235a608d690276f708d685ad0478018d6789f308bf80d65daca8c6b297ef04358f20ba20c7613b910d638147886b18d62dabeb57c6af6d5e43a01cbf68118ab842932109658449d8b6b0424e9314e0314a4c9099b011ab8356f50f8307f5961900d6000482da0080d882356a0835602275609f655ab1889996100aa840ea810c3f84fb20586847d8e08d5556c2086aa8d54efcba4b8bb6051aa535496a8ed5183801430a74fa447d8508d4e423538082925786353609beb1a97b52e6a5ad4b1a95352930263d052e92848fe11a935f7f6a3df5e1a8cb51843107264c846a26d443eb88cbee011a85a4532f8625a82f38d56309130225f208d421596886a0ff5ac4350069fed3f8bcd1069f6d3dc40d650815bc0a08001197d7d47b800018d3c1a77b4ee69da1d00a34e908d39ab49881786107300469c63bf0434e169bed37946e9069b8d36efa8b4d520d34e63388fac011a62b4c4fabad2f9a5eb4bc69777d1d034b909f561a58b4b0695f7cfda54b4a6cec282f9e349f69380aa407a800130d26da4ca3a418d260b630dae12ea03d4000986929f54a61d0d747ba253ea7042f2811a435f2e68fe30b460446ea11a3db47a68ee07740c5000130d1d4234742afa21a3934711d08311b48468ded1b4b3c8d38641053cf90468d6d1a9a34fd4220d19564c0d15bb6040b3184cb000431a31b46168c0d179a2efd3b46805938237800250d15da2acc0f4666590436a949939f4da6053447981043e9884688058a9ad50cb54610b12069311ee33e95846870d0dda1b3435bdfcd0c1a17fd2381d691a16342b68503207304684cd096f7a861901aa00ac0009c683cd06c1a5800120d069a0cb418682ed0583029897c2d04da0919bd20d041a0708681ad01da0307cb06960004c07c8465422f7104fa392f48ad20c67f8cfedd680cbdb015ec422b709f45c6010867e0cfb19f50c67d2cfa19f3b3e52ada23ccc4bc508cf88b0d08452c55985eb050800460004c5ecb08cf75147955709be1ba0a15562aa6132c0011067b4cf602578437000252f616efe11f43427d09bd7220a9406c422ac0d2c00094678ecf14433c46782cf019deb3ba072e023ce5eaf676489205a20b4128cec429701710002419d7b3ae675aceaef512236278e73e7d33a0f9ee325c5046730ce5ca578c295c4b2c44b8309f3c827cf0097a48221ff092dd19c2de8b43e7cac8a7ce066f9f3786337266e2cdc19b7cb6866d72d90e942014854fa4425d209f3659abb35666a6cd4af38b34f669ccd350d30f480ac87585a3347668a219a184f9a412f3504bccecd0199f0cbcc613e67046660ccb09de8991018a5264c332bf990cc9d992906646cc7c0cb0023000253e62216110cc6427cc1081624062949918cc35985de4819791823302cd0a22f1e84f968cbe197bb2f420cbc6f1c08160a1197532e9f958cb93e54bff33089c4232dc65b6cb6196b4aff2978ac27ca4084bcc232cd65944bb465e2041dc9748632c7658df27d56b90f93a1195cb2b7656ccad595a0d2730cac595832ad10064077b04253a772007a800121f24d9535e0e654443e4804653a1f1c3e3074021782c232950b080f44265800228498c232920af021948328f651a319453288650eca1594232836502703a00464fac9efe420c64f0c9dbe400c64e2100598464dec9b2efa8c64d0c99d933204a0d9b0dd0c7c7c64c203846193309f1e02325e64b61a606325a64b3f1cc65de008c92592411a119f19027c6164832a206061901aa00ac00090647c1191e323b0ff20a0000094647012604323408c8ce53e849e048a0004a322f645929e19143227644cc8959127c5448fd642321f643cc87190d112f2976f99069fcc9a5a419058420102f5c23207bb70c811901b2026402c8018ff2063fa3bf045db008c7ed8fc88bb5a1086a86e5117689f9a82f100560004a7c4563c82034d84f882428c85014992176658edca43192904254b208c7618eb90784a421904a31d408c748231d1639f76358e60dce28418816a8820ba118e4846390c71c8280ef5000250147843ea8636c13b800121761d8dfb1bd6372418dc045610c6d5f80886368c6cd8d97c2721f090f9483ce03140004a31a46346c6806319e3e3e2a5c3bc007a06c20004e7c1a0c4020c46a5f211f05c25d6c632ac63c6318e631ac62865d6608c6218c3dd6119f03c2317f0927e827c0b0860b821ed308c5a03550862cdeff8f620f4e910653dfdb15d62b62a648315a62b2c55c6315508a5004e60c970002418a909c51175218a7314c6290c51d8a20f0739efc589db13a626e42e9e84939e11898b12f625a31895b1296250c499892b1231a4c008c000a462407990f30179900025188e1e5b69ee3188db11a6232c45b6c494622811f4384622413df30462160bf047be2620c23defb0ff10c3e987a0861e43908087028b000251878542b10c3bcf0d1e162e6a43debdd1211ef4586b8813bc13de70461a21186784619cc32c14f000121263021de21bcc0ca828c014500026132f04ba0813de1b0c311eefd85eb0bc2da23bd8a7bbb13022185b96c77fc83185abe3e1b541f9823eb15730c2d2e7e086160c2b47b70c6156c2a4449740876a827bb208c26984c7bac1d0843dd4308f611cc231845b08a92b0718445ce310c1f183db07a60eec1dae6fb07119f0c4c92306f5910218363069ca7832e6d04f738111910460c5734982fa83c20c17982e30592c481a4c47b98f72e12e6384f7281182584f7207434643800120c1058207b8c18c0d4230320873d823031605cc0b5815b02a39ce97c8e1ce508ac21813b0256048c08c2e00437000271810b020603c32e5904602ef75847b7c601b729d8045ca3da026248184f6e4101a6045ffe117feaffb5ff4bfe028b8e7930bfd97fa2ff35fe2413e104c70316317f6afebd9e030eb084094a74a045c9109723c25c8c5fc0bf7e47490b90e105be0438eabb8447b5a08526420b65011a00ac000905fa4bf457e7afce5f9abf2d7e55c7e40bf1c27b4f09b35025c7808befc0bf00f5000243da5845f6ebed97dafb435f6070b456c0ad720421f211952c5f5abeb17d5afaa5f524b2cc2fa608be917d12f9e5f3a7020122800038be657cb88f67812e2d018b10be2e71f88e1b4117c3845f09714c42f7c5ef69cec62f7809ecba44e08f65674a045c4a09711c21bbe11e6217b22f61103db825e7608bd7d7aeaf5b18bd6425c3e5ea4200598490fe12e1caf4cb86d21e0dc514f63a13d8d2f405e7cbcf579e1b7c018c719d02f3b5e6cbccd7992f3028bcb8db588b84c11795844dbe11f58ab8c5e50bc9842f2590c4bc7ee0daf1b5e343aec1f8449648bc6178b2f155e2642e0784b81813d85045e1023da6968c5e0ebc18d90dc5520bc157822f035e03ebfca5bf9096fd9775085dd2bba17732ee5b7e2bb84c1ae9035e03d40009010f0117702edf5dbd6fa576d2ed790626b349670343625ab176892cb106b20212c809eb997639abd18bb1495e085d896f704481f09eb6975d2eb9b7b0bad975a5bd55d6098dd22ead9022217532ea411eb4d75007910ade5264a2e9e5d36ba68d3a077800f40d84000a090061174b2e93f598148021e800231eb2425bc05d0c694061a4d084874150829e0002417419a4910691c22e805cfab9e8241800228b9e022e7508f2800cb0023000241739faba5cca1a6082e62340a21730ae5f5cb8b96972cfab530b95d72aae5333e467bd89698b73c117282e4f5c976e648ca92cb30b921723ae465c8ab91030da2eb000283d5947c910b8e971c7aacb71c41718817210b8c1717c7bb19ea95712ae22125a41710ae205c3eb87970e999106c2000502e19f5382170bae165c2ab851709ae126228700c5845c22b83847a965c08b80d700adff5bf863d4a045bec1ba04046f000423d49048f28b7a820c0c2a4a13d4784d7cc13d46192732481a6082de05bbdea246191309ea1825b62096d7c22dd15b9cb73062dca5b90b71d6e318ea28b7156e25b5519091027a76083b7c25b5009e9c822dac08b6ad6d4885b4ab68c55002450002516cf925311e99c22d9708b65a0e3885b2a61fc42d9008b63ad9cc7485b0a13a8a2d835b05e95ddf70f8f09060008e7a535aea60fc62d74f4976ca062d66b648216b0ad605abab55c82d565aaab54066ba908b5396a6c72d48d2416a42d4511e90c9dc888e4aeef6b4f8c8e441169dad385a6eb4cd6995b0b30b4c5697882f401169604b60a13d1c845a50b49c4ef0c5a4ab49147c0c5a458dd047a3308b477d17885a2ab44c42d12bb6021688871510b43d686c6f818b419682ad045a06b403d10acf7f43a80979848dc410b8c30dd11e858246da59ca206f804478413d0884f41cb37042cd912c020b740dd64b783166b04b59eb3451d38cf40c13cfd848d7c1235e045970b2de35b2cb1595f6afd6532ca559488d8942ca25942b28164f10593a8d50b348c5936b26964a8d11031653cf5bb2c0930316471651467c120c00114591ab220423350314000061647096ab025aa808b1e634ab44145d60004a3b146b5200ac0009058e76a81636ac6c58d674a0c5a9a08b191631ac6158beb17ad482c56f3b14588af295e20c3abb85a2c5158a0b137ceb108cdc11623ac46588ab10c879ce09454822c3d8cc821c4304f392b0d961af9c521451822c30585e15ec62c2925962161384f38213cdf2c1f583d69b560dac19582eb055079b808b030aa78bb805160004a79b40918cc2152e11ee2357c042a501b108ab034b0002515fba26662ae315fa0457e6afc95f8abec57d718a4c2be72a0e89448e00001285690279a409e6823108857b6af644799c0818f407c00f5000240a7384752213ccc04579aaf255e35a435784888c573b12d41e6495de08b478aec98ab8cf31caeb15d4aba8574cae955d12ba15740ae794798b08ae610f688f30c11d2f04f3004b2c45a2a5716ae2462b88570c2038a84f2f2ae015be8cf2ee115bbab75b42e310d904b422ada15b3ab642812d6a8c2b6256c2ad815af2b5a56b2ad5d5aaab53b40ca15a489af000233cb604568de5a15a113c420ad0023a2108acf559d888b7a11d0d84f2c4110b184b3f8122db848b68ac915910c26f81158eab1cf2b2ac602a7821e05e0000502b16619e23caa845626ac444135208ac3158482fc19e530259e508ac0a2cd174e19e51037a88b3c410237800211e5042793e09162c2210108cb4422af055dc22ce988f710aba15722ae10b660004a2ae055beab7556e59cb55ae6156a8455a8ab4842ad041a24af062acfb38c22ce1aaca2558204c0ee818a000273c9584f25011562aac455843062804557aaaed55d6a562036680b8800118aac9558e2311816d0220a409e45d55588f22613c8759ab11e42c22a832438486c0c5000128486021217242475846790608aa0153faa7e54fb6674a790054cc201e90454c611530171f0002322988454bde3f046a2e0846e04e3819600460004a2a5054981904678f708a9208cd084b7810cee8454881228f84547ca8f042a395470a8dfc7590545aa8b2cbc8c22e412cba916c625a32cb9845438e5392bf0cb2d2a86550c2a17542ca855ca31c54287f326968c086813c702a07b2c007ac1a6143f7213c6e0d131113cc229fb08a7e62778853eaa7d14f929f153dca7b54f629eb53d4a7a54f406c0611390278d653c42ab0610a3214052646086b09e3482594e09e33c229d608a74cfb38820f094843208c53a0c74845946096510278c708a7114e129c018a6f814788537964e94dcb9012112e8229b8896e22c9a38f1119708278bf08b6b0229a5534964b54ce299828a656c952991894a414c8298fd3be32c9184f17613c5b186410a5fc2297a08a5e022977d3a6214baa973f15a30f738a360dd445c88296c52d6a5a94b4591228a59421a0852c9e2894b078a020a5602789b52a3e26054c90528e7ac04590652823ca40cb00230002604e284527ca4f549d97f620a4dd49b0f190c824149aa9323d2c258082930525c21495845254a4a04446808a495492788b18a47c278875232046c1b0800029117c76f88f1061a6c4290d5218a42d48558ec28a413c3da8ffb1d04147c042f022438ad20c51eca3d547a28f3f0ea53c398451d8a3ac3a00c51d4a3a4f1c0cf0d213c33041ca6d52041e2708a37146da5d218a360258d008a35546a442c193cf8228d1519e38a01ff020f01ea0004e0d270838998ab88f0b611462045184a3054600e054ba20004c441a08c35c209dd00022145d84b180a2dd45af851204b2c2784ce32222c5c04f092371b6b10cb16612c58845140a27d44f695e210fe46d088512762b5448784051160bd0c695608a224238030876942288551042143f84b14213c1d0450d8a1a0207005400460004c43db09625139d8850c41880437e4090f5422860b1153bb837410509e1164404b10a0834015800121620c228493a801afccee905090a11842844507ca0f06587c08589034988f718a0dd41b58765060a0bd4177823877a82c3584f03c744c42825ca4623c0da81c18d63140d281918c032c3004f028a029404845620a01d403780c18a0121cd27fff010413fc0373109fdac2808f00a106038a9e109f94601084fc69f8ac21a7dd4fb29f62c1ea7d3870e913e927d14fa160e85e481eb0698713e527c81012bc21b8001189efec19a7bc4f729edca27b486f6213d8a7b04f5e71fc827ae86e422c140b7c109ead3d403610002413d3a7a24f41dfd085821090d84227994f28112407a800129dfb42278b4f149e24e2094d0100663bf3278102360d84000944f0018c041c35082ba823983e60002413bd3721101a6c227774eea213b9a77215b02b5c81087c84654713b7f7d9109da93b3884ec6113b0b715382832bfeb7121070201228001189d702275b153003d4000901fc4113ac275610ae78277ca4ea00d2c00090ef9012bf78a8402b0023c8274b4e949d253a427474e7e29880a08001489ce85e508a1b012192a7374e6c9cd539a273311ee713e0044e629cbd3968cafc09ca5b758c4e4a13be0044e4411b7106c422ac0d2c00094142979d841bb225962138ea71b115f54257d14e209c34035800129ded422700625a2137fc090109bf937e833125964137d77af4de29bc1b6192cb309bbd37726ed4dd642bdf0485e29b9136d26d8c0ca53bd5844da84e34426d14da1c2a01f84496289b31364a6c602820004a26c3089b0536026bf4d7a43bcca6ae4d543135426a7ef229a5c87093089a48204830004213482688218e008c0009402aa10d7f8426161216684859611341579411de1c21ad225ba21337a66c5da63042388464be433bc1044cba99701900c4cb6996932ca65825705132b26554ca64b2c82650855c2132788100c3abb8481aae10062342c84eeee1017e044c81ddd0477700898dc2263409ddaebb8262918989531236580f1ca1f0a776809dd9530c08851813bb0844c238084477594c1a98309140a6202820004e2608349e136813b80012909f490e82a1053c0004a260108692421a470897fd2ff25fd4bf85c28a25faaeb423ba70405f8112f825ef4bdc97b7ba21484b697612ebe82121dcf12e908ae9413b9c91ba27cc312e504ee6c678847731095d002008f095ce92d525a93392052806380013812602772d4b4423b95044b3bdc947b70cee40112c7d72511dc782771b0895e12ba91c0000240ad204ee2e95c988a0c4ad895accbf0cae2e5864035800120959c2771108659426f86e81895812afa55c098e062ca571008956d2ad25594aaf5c30a25514aa0953d2a7254d4a90612a3a544dffec55c82543edfe04381458001280f8c85583de45d84129fa53e4a783129c35a411dbdc225364a6b07e49f310adf307d8425294a486af4676f14a309458656ee6afc10dc00090edd29422b7424fc085e008c0009cadca102868449e862e0418b40893c0224ef293221276f6df115b5926f56d149b09350a35630893412678155181d50256c88380931d26376d409bc008c000a049721125c24b7836892c83801430a74fa001180012092b52539847c3344265a04835c13b6584493660cc476c6492c92496b4100d4c0d2c0008c491e923ab5a03bf04f409dc0009c4914922124298131e829748c247e071a0150011800129daf9a9091c119daed23b24732ffec4b4a247048d9dadc6246848ce919522f97df28d44522e41871dd83ba4628187fc812b4f84ed5a9137b552449488e512212441487ed4048243e259621a7e2437cf0e90c60baa42eed4e720b884ed4a11209769c115a3021751096623dc6174e08900c223ff47fcd344623f747e88fbcb9a04330002611f604ed208f951f223e347c1da28c23d747ac23dc623d5ed0821673b157108f1d1e323c44784411e023bd477632b360447668ec91d834a02104e11d388ecf412b3184acbe8e6c4565d08d2351c70407032c008c00098471a8e291c438032035d1ee888470c8e13b388c46ea12b2504ac8e8dbc3b30c46da8dad1b523680e9a23ccc766646be8d7460d2d088d6822357ac742208b84469e8d3ab1a8c468a8d0fb2f0c46708cdd19a23332c821b54a4c9c465e11196a32c086031a250cd60808008c00094464c8c8842321463e8c7837410eca412d51842c481a4c47b8cac3612b0bc0f8108c2864f15a418151022c62088c1eb0622ff45f831f81b0800139581517a8845e400ac0008c45e28bbd17722ed45d48ba517422e7abf693b230445c4eb84422df45bbd8fe5ed9045a28b41167a2ce819851163042b481116122bf11030c222ba09d8dc255ed09d8c52f90845468a80455e909579c2762a088a3caab84df0dd0411462289108a21143d5d8977642aeb04814c89dc8640c679489c44226f2a550dd06762309572c22255080e602225444a7d86d126a24aec2c8912ae0a2414481918d655be447688e911c55bb284b2c22bce0956d8276100888a11130aec08fac55ca407c0888882e4827700024056d8c3510887a03b221519d81c2220e07e112586760508881d1036ece1901b422201291052143c580230002610ff21fc43f687e55cf1443edd804421ed0956602337843c601ac0009043be9cec4559409d7e10e9a1d243a04024c04439c872aac6a1c5438687050e0335c4378cd6944046436b0110675ef085058a09888005aa42ac021a8ebd155f08557708864d0c8218f431accd50c4d5703886050c075e342e7d77ca216c42d500950b2216129d77022154aac2210a7214d4299556d0a4c01231d76422140427e84f509e3d1429d75509aa1334263d73d0962b0538849c2667c09553109132e74239d728a32e2422860fc610c808055423ff308843508632d9111a1afccee98420a8412aa10c420684001f300012154fc220f508ff98275bb927a22a9c8441da83ac44aef08839156b8841c2ff65067a0cd4198ff4906420c7655c830105fa0be417a4a74ee400f5000113ada5528108295051b297413c8270a551d412c1e78e0a10eb60fec904291c0000253ad60440fa13ad2874011d68823fa2349622a870440c2fe6502d205740a468acc1f9c409cfe4c4204beb3a22a7f84a9f81153304eb2ca9692e90ceb2011015aa5306ba55f015480f5000270cf984eb1411fbc20227eea807500e02f430fdbc8c902d5188062a7888402880490088b0520803591b88eafec8b4ffe1ffb3ff47fe4ffc1ce04045882e00437000240ff9d4e394e43096584a9be7fa0ff10c0e69ee50ff01fdda9b830fed32143fa2c840854d53f907f1863f4d087f12a68083f8012a6631fe1153282756b08551c210e14ba420fd590db2e143086c0d56115314fd204661930418f69f9d63d47e5cfca1f92eaba72a5e043ef812a5c043ee213aa9843ed642000c0817e01ea0004c1f670841e129086411952b421f623ec07d7ccee9005de083c07a8001213f18254a66392201a604ea901014784a93e10fa8549c107d258db8808ac12a4c1f423e8352588754408fbdc21f2d634a207fa857b115230f8db8e3187c64f8b188d4be441f739f0c3e14c6508547d087c018c48fb303ba0628000983df6397c0008ca8f27bc80a28001207bc0f778f9b1f3412886d598ea7013a9b040dca10f721ee2307e3036c0471701b54a4c8c62e5e2984752d087b4c275291ea223a921ec13d7c586403580013074a021ebc3d767ae465461087ab5f5c083d547aa0f539ea42151702751e09d47023eaf525022a2a0462787a2c77b0c7d527a1cf419e813d0079fc1c19c7d4610f3d834111511cf3b49c71879c6a219e6e7d2c797aa1f987d187940f279e4bea2652a1d04ea2010f1bb1061078d0bed883c618dac4071508c3f0f1530f83c4550b82418002383908374083c3e787ba839e0f9e7c52a12842e5c118740461c810f0204e9fec37441dfb06c2000461dfa3bf0c35c609de0877d7a7c887cb411f2b9ac811d3d423e5008f93823e4c09d3bcb688ef618772cee4887c8810ee2843b88770df1f1dc03b7c76f6a001db1414ff421dae3b5a76b0070903b520fc02748023000250ed474e710c28421d9d92d820ecb9d963b2831f17843b1a761cec353ee7c4475c0eb73e1e09be1ba147ba1087590eb183a618c1e02510dab18757e9f3083ab67560eaab06a2190500aa84e9bc5494453db0874fce9f0ccd11000b54a53d63a70f820674d960ac07740c50001281590eb0883a5674a8e940c3a4e74998270c7c0213a689d1311d33821d083a0c7414e821d03606e63a650439e6313c0008ce98e13a620439ae7358e6af80820c06021cd4a76a20e671ccd182c5e5081cca156223a5e3dc911d2e4e5d854008de0008a1cb9a74a20e59dc9c114e8423db2087273a571c993ac2429cb0d5610f69f6758839147227a540ce94671d8e3aaee1214e382749d0871c7daa88a71013a4c04a708718fa4b0c29dc13a491c48e91c70e5ec1277b314ddc21c2e385a2b6056b90210f908ca8e276c0e8020e141c2610708ce100801c2129b8afa02f2833a4084a6d66ffc4054008de000861bfd4be420dfd1bf9098a317c482770002329b00437d829b84747709d1c4deb1bd5a6a86f480590001386f34de5534f186ef847988e8d66ee29a4af5b20bd6422f55086e88dd09d2819d18cdc9af4a0a8840dc7bd40103cb02487909d16c27457094cdcdc01b7e5e7441e9940de106dce9989b6d36d86d9cdb21b634dbe11f58aba82f7e13a2984384c10daa1b53a64207e40a280013192502744d366e153c10f02f0000260d9b1b32365967bc0c0817e01ea000503d14084d6c253140823da69688c90410d91a6aa106c7d781087a161298704e8866c2977a0c908c13a1f042190100aa8436009a144743835e46bc4d77aee129d0d821ae80d3a0a2c00090a5f46b8cd700c79e26b3cd67778520bb4956b88e8621096404358e6b18d629ac435866b08d609abd406af095e083576f37046459094b9c274270fe636c061aa20825d82742208babc23cce09d0783c8856f293240d3c776811d05c21a71797669a4d321a63e8274b14d2820349a10d25844c0210d2484348c03d40008ce80a13a013c9d5cde1b0835f99dd306868d0a9933194ad4273f803ba062800090792467f92e90c33fa67f0cfd866e62ae50cfc8433ec67d4cfa52a7791067a5e431c233410cef82f1005600048119525962295004e7d4673c4118109cf9823234092a00273df337a2294a84336001ac0008c335fcf74419ac5c4e66a48a8b15728b88ccd0999e333a6670ccd199933306654cca73db59cf64215a4086629e31880a7a44852f90ce7ac139e984f51065b79e6195532a6439e4194d106528ca4adf1328dcf15e2298a4d864e63c70c326611e1e192f058a0004873c0094990c91191f323dceecc8a253338643021908320e641a92f106b2a10c7f98fe31fa63f0c7998f0a4aa0a31018e131b0ff90673b331a2223b304783430d4473ab318b491462db1315c62aa920189f99aa639d3ada0106264c4c52375b3493582a218a46a10c439886e7425868818795b1061d1dfc90e73748a842d7f30c60f54035800129ce5c21841307e2290e249c3072b5c0c1b18353066739c618285dc2316b3982377b430c109820303e60787a894a42211de804a41610c003bca2fea5fd0bf9d205b63272901842fc05f6c4738408915c777027a04ee0004a3bbd2f965f2922897c45a74628fd97a6a3ec30bce17990002301e7018a0000339bd178be6f031dcf84e6e610bb5845a32128f1175f2ebc5d74bae736f309008ba397452e868fec4550466193081680c15311e898251d309cd84b9423e2188f781ef22eb000241dc1040d46139ae042e3b1b84b8d3fe421cd64273540818c022ce82e085c08b8051bc2df08eece73502dca083c07a8001285b8d1d616dfa3682c2c14f000139cd182239b09cd002733da3427050673382d2eed306733609ccc4b40aca8183a102167d46cc148021e80022859ecb3d73272ce459c564f18a324128c804592a34440c58ca31410b2fb45f11cc6c67d8490024641d948459148ce842c8809cc5822c8409cc4b1940858fc58d4b19163076341ba0c2ee10945f0b13730a196a0494091982c3c5874b0e161b2c30585dd84160f760a5828b043b002c0345b0afd0c8880b15caf895f075e057a4af451622bca578830eaee1585781d7595dc2bb2eb9caea3ae42b9c5730ae5515959cbfc215c0a2a42397d848cc010ad915b175aa56b4ad5d1482b4873978159f2b3bcbb88158e2b194508622ac2b0456006090a080d88233ea09cb8e89c9575e5be55c689b15692ad0c821251330855282598145000240aa4954710b00c215432a82aff8672d8975e20c1f84755c54b847b8c113411d55152a2a53449485123094470272d2088960215092a10541d12891c0000260ad20429fc892c1ae957c055203d40009ca224128873a9729de53b4a7594a21610a738475202c9c4b00c29c74414a6cd101578eff90c50fe298001e81b0800129cb0d5df86981852cf95f94a522ae42879149f018e00048315708050400088dda810a4b94962928aea8a482203291a5230a451489e56c51f9d35a1f42afaf1d3404e5641188a0428de51b9d31946820519f86d08a1c229dd9040ca1bc5164472aea1b02040884a1a651368688c2897caa55be8c288274a0472a508e91822b704372287679f10283e10a0f50bb283450608729c281a5032858a1a47fc86394b84e5244f709ec827700025394704e506109e204e4fc1077e04a1384ec89d793ad7436509d3096a0bce35588727b084e8959588b3f64e409c7ab27270e4e189c29383563e4df89be937aa11a4ddf93b136326c04d768419352a141fc9a502fc19c9c283c121819c9b037a88264c4c909919322264341b157d1315a0d316394726a084c089809300a0c221ecbed9873be4be282e8c25e4ab9897712ece4c85282c84e4c2128290441a24af04725d09413895612ab418243c938141000231ce004a08e4a5e821b9b92141009411281250049f893e927c24f48281c8424e2aaac41268a067154c92a12502882182502e09c93c918d02918137c374087338487090d921a24305392504a0441310b0454ec1392284e4861392084730ea9a5a210ca0361391f840d1524f4411d454b447348e611cb238fd638e3979237046da80a102348468007a8ce46e1391a396d23240b548396b0940248c2a00f05160004a500509400824ffe3ffc66f46395c0845c824ffa0845ba7fbaa1e229ce554a4ff40844d0272250844b30f7089fdae50c4798c8a0011c9f04220043f8410fd21f843ec87d02d729878420efc0843c48781fb021da0a30a7216c3b4436cb85109fc24359c969f9f219460fcc06d8082e6021f9a21813f7085c9f9328e49827210214f3f54fbf90213ea7786560c7232424c848c78021c82483f907be408439008420cc4194832105d204155c85028f180a2c000882098104c0842b9a138fc842082410081da9b3205c40b0814b8f441f09c21020203e4078808cfb171dc3ff07fda9a249c7cc20fe209c7b021f171fb83f6e2521f12067660fce38e108e37c20fc18936218c7841a4e127d0841f5c619044f9c1f403e7c7cf4f961f25c78a7c920307e1086380230002338ed84e3aee2cc438b108e2bc238aa52ae3d6f8e90f5129c73cf590f391e703cd81b99862a63cc54a10ce38e7a84790cf78203c64320889ee0a4b8438941e0e21494049ece3bf477da91e1dee3bcc77917cf41c6f5f53081dbe10318049eae3b68f3c8ed41da61158c71b53ce6207658eca71043069384 + +def cs_17 : Nat := + 0x144fe89e88a2761397084a27144d689a51322a92551cc2c0297762160004a258ead440ba108c40d2c00090a25344a1d57152e11ee52893baab1144942512309447688d22570b660000a5117094454ad208a229444e8886463214434a75063d01f003d40009829ce1288493c711441e881d100e5842b9d89698a1f543e687c50f5a1e8c55cc50f1a1e0166464b7d0943bf5658874ea119c404a1d6e9ad0fa157d2143aa874b114181314250e6a1c9438e87050dca1b46286b84e400460004850d6a1ab434a86850ce294330250cb439220e9404e54650b82330c982050b0250c1a18142fe85f50bda17342d41ef22ec4942ce85708a150139482b5211429d5a6085694110c584279e862043a2809429478688a1484f10450a2a13f427462b3709426a84cd098a12ee854a3a1209425a84a9383564442848069a000232847047412128453a05000230d95a5f211421825085a0fe4d246507da0f941ea83a90a0e04c9899221162011bc00108a0dd41ae83392cb20840425063a0c14174612f255cd99ac6505c73b62282dd05911415e82908a0a3c969ce58c09ea12828504da099412e824d046a0827094092800b683105204a07649e093a8ca071156c450340940c6818502e19c940250290940a1cce8824301090b92123ac232812d023a043408280f840531407a80eb98754d2d105175800139407280d501623a8a9688e691ccb74a808e3f58e10e5e48dc09c7032c008c00098a02b404280786362140342119933ba21cb6919209c8008c0009472d612805d00711401a80108a00066e42f1018a0002508b9049ff645b18968c9ff33fda7fa0c9fe33fc089661ee213fbe7f5cfea220043f8a4fe909dd125864fe89fce3bf060719093f9424fe4e42d876886d970a293f8e7f006d8193f7cfcd889fba127ed4fd9c39e327ec4fd507680ecc627800131e34824fd09f9e42463c010e414127e6049f95c80440b1e093f167e24fc30518427e0cfc09f7ee40484fbe9f7aa6cc0b999b000d60004e4fb971e8227db4fb59f693ec5c773dd1302ae40d780f50002427d6f1f3113eb07f08a9606ec0528063800038e38c261ad093ea67d3f1e8183f0024fa59f493e8e7d0901f5c619044f9e9f2c5c28671e10dca227c904089e127c8f1db103ddbc53087166127c84f8f9f1d3e2c80f5109c72dff2083d7e127c31eb0113dfe7bf2942183ca2238889ef53de044f739ee53dae7b54f699ec73d84be7a09ebc11f53049eb73d6a7ac834003080004c045608e22020ecc3ce6207658eca7104327aa71b1107980bcd080b00127a928f810e1c4f268e8b1d14fa1ca4f4c70dc207400520087a000884f4a9e90e18cf1c109e8ee170417db0878c420e582eaa39545829051ba11c299e26117c7584808bc093d152e9089e893d082180c9e7c1279e049e76e0f444f391c4cc55c64f36f0b22279984706212798cf309e5f3cba796cf2b3037b46f5880056000440dea3bc2238c884881211c0f0dce113c9b8c558b118772424f239e453c867904f1f9e3d3c6e78d4f199e2d3c42787f177693c227839d9a193c167824f033b24357943a989e04dfc24b08c6fd675c86958732213bf820d27093bf277d37e4193be677b4ef219d042775843a9810a418f8023000251be5842a4a10ea006bf33ba32773cee66f84bb8484ee463c82066016240d2623dc84ede08a0d42493d0832bce940819581276d049db33b6276a4ed39da251821049d9e7424460f808a0749658818da31ac44eca0c2c0314a4c909d8e1276284606411bcd849d833b01bc88c9d793aeb89387cb06960004c4eb79d6de0206378562ae2275a4eb39d6430642c58589018a5265027ea18289fa064eaf9d5d3ab061580093aac3b3089d4e3a0c07a8001213a8e750ce9d9d389f20a4e98074c202529d28113a54227b7093a4422e018a00024036f049d1e127474e8b86e22e242048404011e72742ce829d003273ff0f8c17032739ce729ce339c2737ce6e16287104a6808035139af8751038028a0004a4e690870c4570e0ac15bc2b77055189cd13994e130c9cc41272e8aaa69ee3272b049ca82a6440fe20939453ab089c9c12722ce449c8209dc000949c7e1386d046e081139d849c7b38ee71d4e399c6c511c3fc82800002910e80401ea000044e341487822c64e319c6138b671470bf0d2623dce36df0827a643f05b300024270d4e199c31385e70a949c233842707833125965137c849c19382a704ce0721037824e010937fa6fdcdfa9bf337e26fb189be337bb854c2e521c29454f084d7a126f6041d0c11b4e049bd5c27044de99bce2384c049bc89a800c58c9bc537866f04ddfe11e227cd7f089586e8926ef2eea1137766eca67963c84241c049ba7c2058ab8c1bee0da402a00230002517692ad710211c42325f21937326e3cdc69b84426e07076355c200c84db99b6d5dd864db49b5a1ec81f844962936a26d387ab1ae8f744a26280f2e1e543ca027428d96427768090a4824da308d9483baa8f8193689b27089b3d367044d9b9b2d365064d936c7c226c8049b17362424801232136101af089b041b9444d7f0897c8209600935f66bc704a1897a001580011935d434c089ad668108ecbfe42135a66b3889acb358f81e91bb21357381d089ab7356447035063e008c000109ab135584702f03ba06280001000a8008c0008c9aa011b0104160a126a44d478488326a235f311350f812b5ec0b7e1f21195189a84d79c7b70c6bc508d044d410d362269dcd3a9a6c3269acd349a6414d429a19823134be696889a5934984700c09be1ba064d2203380664000904ab8131c0c58c9a3d346a68c846a08cc3260c4d180d362268b2548113452689efff62ae401fa802b000232687049a1a0d78403e321560f7917610325612684849a091e004190c0933edacd19023ed24267d4cf70c901f2c1a580013133db7f3028f1933b5ac4903e0bce3558a18d10933b127e8899ce10c5b99dd1133837ec4cdcdfa93360a6fd2081e302356c09334e6694cd11ab0413ab04999e935046fc999953324c3f0520087a0008e4cc7998d3315aac106aac12661c49611330265fb54b197e5424cbd01ea0000624b0d3a62265d4cb9997132dd25194df6c126594cb16a7232657ccae6a6c337d6840d46137d40499595ac844caa995332a2653cca699490658e4ca2622820bffb12d11327873c889939be5c44c971df82264b4c959929324f7c84c8e991aacb504c8b9915322064c8699084b2c64c832f3422640cc8098ff31fa63eef853131ec48225f219be083a00898f0d39446f7d1cc0216898407aa01ac0000c98da1263628dd10901821751096623dc65f5169aa22634cc68be945cdc84c6509bdc026f6e08050825f4709316a62c34b559cec55ca6f6698a5313864c4c98962580623b259ac21a500447585b743100c9895bd791d20c988cd25444c444736226214c401130f0b4f07a4018a5264a4c370b002261b6f531130d661a23751930cda3d34781930ca618cc30985fbd30a4c2b46c020283040e00a8008c000949851309a6118cde8d307844c1b9835306660b9082201024c049829bd0444c129823303af8a1068943358202008f21303260408980ed1084162c0d4c0d2c00090980d301779d0c98073009a1c9d282130066004bff686c58318ab9897ee067c03580012046d424bf575f8225f9cbf297e12fbd17d0c7709fe0278047a497d9bcb444bea6838225f40ef50002325f3ef2597c92f8e5f04bdf5886725eeb40b0b8a05140009497b52f643e60cde3c125eb4bd597a92f4515f94979e56702c3858407a2132c0011c979b2f3115b8c97941205f0497932f219f50cde24119f304bd9e125e28497885868422962acc2f5a4af109782125df8bd00808023c84bbe977a8a246154b089f0026f04092eec24bb7092eda5dacbb297632ebca33cd092ebb7798f6d0002425d4b3c22a281a6084ba69748225d14ba197412e7d9db95a4312e7a5ce0897372e680c0817e01ea0004c4b998c42225cb844481918c414eb082cc44d78001192e5111b063203140004a4b90971f2e33e7b9097169dd444b87ddb252b0c5f006b000263e790422ae125c0de9611bb5024b7f96fc882064b7b1fee225bd4b7996ef2dd90fcab9e312dce5b94b7196e17a1ca4b6d96d97a0464b6bdd7a290a9f49096c32d825afb13221bad824b5a96b022f3b042830125ab4b5496a72d4a5a83345312d3a5a6cb4c27d7d17ca4b4a9693799464b48968cad2864b43092d089e388dd341199613bd13220314a4c94967c1159d8496761259c84967085b04b6313220cc802045c0314000464b339664cc64603ee05aa225970496592cae5954b270d340000c4b26964b2c880a0800129004826e8909003826e840a4010f40011065f81258e4b1996312c5e58b2127312c5058288dcf32c3e586cb0c96172c251389cdce8125814aff112bfa57e4afb95f52be77379895ef2bda49e8c95eb2bd25794af195de525774aed95d86b2084aea95d04ae49e3900c60125734ae595c72b84832aef2502256fcade95ba82ec86e61092b7256dcad919b960207cc092b465684acf95972b2a564a0940d30802bc04411e4b2c44ac7651a2194484410c125614ac1957eca0484abe957b2af255dcab995712ade55b3273492ad0e9408dc8a12558cab0955d2ab65566e4095512a9c965a43266125521a0c688432551caa295403254f4a9d95363254cca97952ca9508324e405246c80c590649412549ca920c823063f84952080780cb0023000252547ca8cdc4b2a2084a87950d2a1546e90646e1024c04dc3e1253fca7c94f729e484a7794ed29d08a98141000262538bf591129c190e8894df29ba536ca6b2129aa5344a6794cd2996532050938441024a61dc0529776ffddb028344c24a5894aec7d8aa3006b0002618fa44ef10c7c886c0d5619b7d1f9a82f100560004a4a5116e2225274a4d9496c782a5e14948db7b4431d93eda0d381a58001292900fb488947ec75044a3c947728ea51c106398373844a35946928ce518a9c028c7142028f09f0c426ddf0928b65164a2bdbb442514869b1128a081505c904ee0004a4a26944bf09c64a2008c6c32e108943b286c44a1a94303fd42bd90db9e1250b9f225b40318cd8471ca1250a4a13942528465084a0e941b28325058d26004600058318c092826503ca0652f442501ca0111b6f24fd0862f61b94449f662ee208640471701b54a4c8c93e927cd8b70cdb62c59c406aa0927b98b203bf04f409dc00098db58124f50a991127a24f349e4db49277e4eeb14cea3c818a3a92b103c1c25d420927676cd49d31927464e849ce939879e034d989394124e384938d27164e20d272079a5c3f08938527076c70c93765e0448715a42126ea4dcc9b8936f26d0a49b10926b8209600878e847104f51926ac249a8934fb5f8649a6934ac3d0604830004224d1846f0004336bb843c1f3cf84499e933b266e4cd1dfc29b5bc249929322c34464990931f263066d659310378566e1051484f1c430c66186224c3ed621126164c1c981dabc436adc97c92f525e64bbed5592e725c5030a53b3e224b7496c1056402496909b538249660925914368892c2124af0492ba75d03990c92b9256d8448c92b3255e4ab6d412125524a9c95109304183904da7525364a5c94a2a4a524a4c9484644324a34945da5e31770849286330d2f90cda561249f840d121249e84927832b04493a926ec12c630cf0924d649988926524c649843b421b4682492eda2a22496c92c925524a581814924d2496492492239ca115414580014124782491d9237246a48cc918922db424e49129222733dbbf906024733460b17942172ac2490c92152426483c90529b40424904920524041a6105ffe10e5a033b307e3247f48fd91f9b3e4848fa6ebe2247cecf51123db6770891e412478c8f091dd23b647648eb91d523a3672244f4815e0448e091be2d95ff21091bd237646e48d92123605a50816924f98448d5972e22469ecd4112346467880c3c1246748cb10bef076f880c601246548c99191231e462145f6070b456c0ad720421f211951c4ed81d00448be018e0004648bdd984be98648b95f405e50648b7916db2f6459c8b29162ae78e48af4ea2201e904915922aa454ce3f2122a17c388914cbe04539c95e21229439b896019228e450c89f91384244d4897912c74a08272d09b2942489291232239ea810d94412f3b043768504c44002d521222364e9ba5293242441849105220643f8c5e9c19dc0918c90fb21f3a2f8c90f63cb04487a90ef21d49ed107a72124390490e321c179bb6c3259652436dc2a11b22421b6b086d982486990d1219e4332f26292196432486190c1217c9c4981d781242f485d06c43242e485bd8f23242d2f0a7a283242b6c7511e63242926aa11b1cc21344179422427484c90972eec84849d8e022422aeee36009a14848439085210444531572920fd7721aee1920fa41ec83c907720ea41c18906f20d90730c906720c2417c82e905b20b24151c6fb01176304d8c01241348259049208240e481b9032bae094787e608fac55d84818902cbac57577770292056409889022124086c51101e542ba971f000243626ae9c651816cc00094900e494c42e9808ba5d30b806b000242401480190013670847ffd88222de1845d16123fc845d101068f84d86e1c800d780f50002523f9ec338fd91fad73c14d8551f9d7380c3432123f286b5111f897328698191f7e3ef5baa191f76dd1867800460004a202c091f663ec19f3191f5adcf082354123ea919a1096f0247d4d83020635848f9e01500118001211f3430da2eb000242ffb04339e123e4027b01ea0004847c78f88223e18c436264323e152921b42323e0048f7c66c446c04091ee52c400c52932423dbc7b68f6b1ed23d9c7b28f63aff5047ad8f591eae3d4c7a88f4ec450e018a0002223d2c7a378b430cb79fc01013d4247a28f431e823cf108f396dc824b84900246523cdc79a0dd0302378002111e5f5f608d7d4123c9c791111e382478c325ebb8464789324e649034c108f0e3d44435a6091e116ed088f051e004190b06c200046477d8ef91deb5ef90d7b91dccc750c1dec123b7476d8ed709108476a1dbe216df98d1111d98247658ec80384647638ec11d763ae475b8eb31d601b12024a6123ab4755311e622014c00f50002723a94751f4c2323a8474f8e9d1d363a5c74a8e8e92f1047465afe619066bbc091d15df788494a123a084d7696cac42d6e3050bb846473b1eb4201e9048e742ab0447398e6f1cda39ac7348e63ae9ce6ba45a885f78000905a820ab0447288e4f1c8862d392f823b603ee834b000262390471f7d363238ec71c8e351c6238bc71638287238a47131aca32388c70f2b0e32386c70cd72430bb9386611ae2e382c703191c0a380c6ff8dfd1bf637e6b87385d10246f58de7ae0a37846ef19a262376c6eb8dd51ba443ba5f230d6a8246e5085c80212f3091b8e3701714072e023ca6b75091b6636bace276e64236a46d38da51b44b751412c012367c6ce09ea323666b6810b33d1d208474036d407a8001211b1820dab091b11661888d845ac8b579c2621ad74246c08d7f1af0646ba0ade526466b568d691ac91b30520087a0008e46ae8d5a8d8066b518d531aa11a884de00460004e46a78d4d6ad06345f091a963520cfb0920048ca46a28d428cd86469e8d3ab2156418cde291a7234cc698d67b586ca46921022223481d28111a342a2088d151a2634446878d0d1a16340c67e8cf09233a46738cdf45648466c0919aa334eb208ccd4540a46658cc7198a330c65e8cbb197232dc65949195a32ac6548ca4b09ca1590088ac82464eb4e822d39048c9b192e32546498c8fac18c4644581a2231fac02977632897848c781231c048c6b18cc446328c63449460f6d000221133842a3a0dac07a8001202df0222620918b7969088c52101cc048c51189e3128c0698105a20b3f03080004846238c42225cb848c3caf5ca758c8c3bab849e38cd5bc115e70405aa1230c461784883230ac613d5aaaefc34c148c1f183a306915721182e30546088c0e0fc224b188c0bab2c42ba80aea5c7c000908c00113ae048bfdab10445fd8bf6222fc848bf117dd0f68c8bed17d355e0c8be4516440d240917c62f86ab58bd917a62f43d5c39179bcbb88d55c122f25a1556e2322f0841492bc322f045df141fc904845ddd54c5025ad5108bb1175d5af8c8badaa8446a9e8b9d172e2e545c98b8ead144d225bc49aa6077e088b7faa4c9d3096a0bce3558c2b2f565a23548048b6cac884137c09aa262d68e9a1916b186788562a6cad2f90c8b51169e2d345a48b47168a2d0c5a0560eac154459f8b3d16762ce45998b31a9e4e6a768b291648645918b2116386130807fc083c07a800128349c26a7055dc22cea0455ce122c3048b0b16122c112dd20ab6956b8841be00ac0008c8b00ab484457e0915f62be457b8af515e352e98d4b515ce2b9456f8add15b62b6456b1b341a61445688acf15962b24563413e606c084d49e122ac048aaf1550445528a9f153a2a5c54a8a924888d26a08a91151f5210c8a89150a2a0d5092114f629dc539326641534b44145d6000486a3808a9842453109a8c552d25d21914ba296c52a8a5314a2293c52539a8a426a2708677424521b3080150011800129147a28dd007191469005027604e60004a15cd09145e28a8812ec12289c5128a2314406d09422de12287c50e8a1a7f9c8394e4afc2150d91341044c454c00f5000242285450710e5182450509a84e2800889ff13f627dc4fa89ed76c0c44f589e913ca27890dd0de80d2c000a0d416122771f9f219460fc806d808a7b0fcd043611e642274c4e889cd139627144e153c27226f44dd89b9a7f626c44d689a9134a26890784a421905844cf20d82c9c4b0108999132e264c4c8f25050fac04069812261b1c511a7ae25f89811912fa25ec4ba1912e625b88896b12c625844ae2062b422dac0912ac229a1156005c4000901fe6c680444aa8951129ec95062029129a25108893d12774edb18c202f282449609125473008892712494bd0c52f012248c490891ea5c88049808c5fc203860912334e6448819121e24338b9465c0004a448311e622240f8a4107b442448052b02223f447b88f42a7881eb909a6dc24474138a20f5304d36210bfb044df2134d684526612236c46c5256307838488d511a0417db09a6942034c09a6882446388c5118622f445c625a6022b040d361222c9e7311115ec760888ad1154f30179a21a64424451d31e234c584889d1130290043d00045222544498891111e22344451cda78e847104f55111138d308620a0438145800121a5f02071508b4382443c887510e445e1097761221ba8d60922008c00094886b10be216c42b885510a62144427884ca331444228843107e20f441d88346186b848831105e20a0cd2d812208440f881c6b2080de706624b2c6719109102a20444073ba4187577098d2c5100a20043ff87f70fe0edb96b7186a903e8002b0002321fac3f487e70fc410e028b0002721f7c3ee7006321f643eb87d50fa06b2002b0002721f38d622b2031bfd0487cba534443e387c2221f043df3ae632c4a8450c2121ecc3d887aa334a184509e11644043aa2591c443d150987534643d0d27c221e5283b63c83034d842c481a4c47b8c878f0f1b49b8c878b0f0e1e143c021a4c4243bd090ef21ddc3ba87710ede1da188762a0749658c87610ebe1d76923210eb21d5c3aa874f0e908b798874656f18968c874230e434c0c3362121cfe913110e621cbd852180dac07a8001190e5a1ca8c17189fa8e0a0887270e486038a9e200d8826906089f7cac0088718103b3048715836440be71d08221c4c3871072b828c08f7190e1ac1d888706121c127c011a3d02437f4f729edc6437d86f6221bc437638fe321ba0486e70db8468ed082df024e80089ea01b08001190da74730886cf0d944436486c560706436086bda3746435c86b70d646435786ad0d561aa43534ef6621a89c32110d421a7c34e869a70b0a434c86970d2a1a44347868ba32ce0aaa69ee23463275c10be5c2433c86761dd547c1086730ce0dff8c0a8011bc0010c866b0cd21990fcd210cbe197432d5f0e42bf4848656121954329d16830dee0486461219108f7109f002431f863a9cb051f143809160628000a04e5011b75844e4a1218cc31686290c48dd912cb310c4138d88861c9c60dd18693028a0004c27174e266e652e91086149c3844308860da2704e01086044b2c4430085fe9be00a28001289bd012c006b0002413799b7c018c719c8689709a254242f785e6257c4af0456290bbf032882730121759c26110ba617442e706e6413670485ca1217142e185c06cf1d049485bf0b7a16ec2dcd1025135ab69c110b6abd508d0f81216bd7a6110b5b849884d24102420485a90b4c8640c02aa1216842cf859a32165848594f3f4442c84cf2c7906686d090b1616242c3d0d10afe15f42bd85790aee15d42b93580c0d5e8410500004442b6856b0ad215992cb290ac215708aef610d570803110aab42b88aeec11e680485490a8f428429d24dc5214d844c581eac6ba3dd121a12214b429585290a48a429185210a3f41f428a85110a1e143428585070a0a140e83884f709ea13c4084efa0d0442730909c42427008de00086426e0909b2135ab2d1909a48f90884cfc128442620d7056906426184c1a08e12d68212909652e908ae941212be81e11094c8da8833dec4b4442519ab22212784849d0936126424b4b741880c061d5dc2234080b0511092212304981896982424409090d2d108848309008b90c847d08f04423a08457c24239846f08da11ac232846308bce422c4afc221154229844f089a1122574728c72111818b110886110421f4ace43b88848437086a10cd71021085e10b4215842895483741808de000844212842308412a5844511ee633f4993200023210384840d9f88c958ccfc0120fec1fb83f06408fb49483ec120f9c1f2cfb4320f841ee104174267d4adde220f510421107a20f3c1e683c507842869849e6120efc1de83bb07720edc1da83b3075d2735fab50938943e0883a507420e7a756219f0e0e388838b9efd6c80ccf7706f20ddc1ba6aa4520dca4b91106de0da24b0d3a64038004cf6c10c2404494a120d841ae119ec20d3c1a6492a420d241a383459ea88419c8332122c0c50001299e8c24195cf3d06420c7418d83185f7ce418a831306160c241838302912c4b0208300910a6440c2f5834980118001219e342417c82f79e20641790827782417382e505b8634eb2ee4e1986416c0931d82416a82d10598607150905782677782b50565a6a9047fcd3444415309e89820e3244e2220a8c150829f053a0a6414b82950524979a48291051eb3b30d7208f2c31808828d05160a24143477c00ac0009c3590120a0413fcec2304b004827904ee09d16d4208e9024136826822099a3971b40258082395b59222098c1302d4e5a90ad2142d4725c4438030904ba096e74e19594c2237d46f420446412b46ea206ad043b1c12093c125824904887421446d2133a104823d047608e235d2034b0202008f188d682020f01ea000464c2308b26068addb018598c2658002199ce824c17090446087a3422e1442087233a11042e08506de190426084410719bc4339504464412080c10081febb848231c2c583d686162a6b542207e40fb81f55858b0b03623103e0240f781ed03d563110192a1207840eb1103aab040881d1039e0720c81c48bcc440e0090378240dd81b957f4655fb09036a06c95cd199c1c240d181a1033c3e610819d0336063c0c6458252062c0c44574302bd842b2e15c42b7949921030205f0818041205ec0bc81743205c40b7816c55b447994816a5868422962acc2f5a4af1081628d74440af451e555c26f86e82902b6056154a096623dca40abde08225dd84976e1377e80011102a19e5227119028ca9543741902859e2886784545034c0c0af0119df84813d027604e409b8131025c035800141025a04ac09413804204804811f023a046408a29cd45a0c2236278e2204412cb11021a042c0848107020a0401880fd01f53ba8ccd9c1203cc07880e956a084072018a526464070155c0f001400001288804a44148550f842ad08480d59b020333114210192031c06280c3017ca337509017a02d21d7bb604052984cb00043038a8480ab015024c0c56fa120291d2810290a9f48880a1013d0e1b1322066f0035800119012e024c048808b010e02021af4358bb852403f807c867cdcc0397011e6201ec03c807700e201bde653100da01aa18e18ad28240330900c42218412c022017402d66584ef44c880c5293272015c02acd30310b6096c6264333494021803b007200d4019cd1a7200a401380228504830cf0900382400a7a28220038520087a0008832fc084d482555409000e00140007ffefffb33e18051810582847ff6ffe9ffcbff8cce8431c011800140ffd5ff98844e211ff93ff17fe0ffbdff6947fd81a6c43fe97fd0ff9c07310ccd611ff1bfe295e631ff0bfdf7fbcff75fee3fd925724f1d03fd67fa8ff45fe7bfce7f9aff31fe5bfc97f8eff19fe187c84654e1fe0bfbf7f7cfef5fddbfba7f72825034c24cc9a11fda3faf7f5cfeb503c074d11e673322bfa97f50fe95fd204cb000471fd080b310fe6502c887f30fe5dfcb3f95409a1b54a4c9c7f24fe45fc7f24120fe31fc53f897f0efe188ecbfe438fe0dfc12a5a4ba443ac804cc5467cc4202923640628000907ef6fde03208c7ee9f1904119a09988820620099877c77087ed6a37443f6a7ed0fd9dfb3097628fd886d088cc2811faf3f5d7eb83db88322309983823f5908fd6330354d918fd51fa9bf507e9efd39fa60bd138fd2f2fe8809dd1258465fa083bf025db0087ecd8fc887e86439d3e00c2a8c01ac0008c7e82fd01f9fbf3ecbe051f9e8466193031f9dbf380d8845581a5800130fcddf9a3f337e60fcb0a3f2b7e507df063f2608fc91f918544199779f8fbf1e7e3b52b4a3f1c4b7821f8d3f197e30373883f16cba2fc45f883f0f7e1c4120628207e12118df04637640f82f38d5620fc1b2e3869b18fc04265c408fbf72e1087df4fbe5f7c3ef63e5451f7a3ef37de4fbc32dc188d4be4732da3ee5cb6431f70547852f431f6f3edc7db4fb65f6c3ed77dacfb51f69bed17da0fb3df6765a270fb29f64bec67d8afb11f61bec138fb01f5fbebe7d7afae8f56294013983261265963d4e7a9063eb309964c23eb2ea3821f58beae7d5b962df53147d4a0e0c41e7e1db01f741a580002879e422e018a000241f503e9f7d3cfa6c83e9a3cda22a20847d24fa3c43e8a7d0e21f42847d06fa01f3f1e3a11c413d4c3e7ccaf221f3c657510f9d32b83e6f7cdcf9b21ba187cd6f9a9f34be683c0851f33047cc6f989f30be607cbef979f2ee5653bde91f2d047cb2f95532f0c7ca4f945f270c7c9a4b2c41dd4101d037863e4a7c90f91df231dc7130261f21be427c80f8f080da1095000ed8887c74f8e5f1c3e37259651f1abe34e9ce332a71d963b2831f17847c5af8b07420c7c52132a484ca8af86843e197c314fa4625d2084b9023e17ca82200aa847c270dd043e11ca6ef83b29a907c18f82c162800120f825ad508ca5d24fc43e077c0cf811bdb10a79e11f0084619e11effbdfc7bf6f7e9efcbdf87beef7d2e61247be41328e847bdef7b5ef5bde820f785ef03ddc7bb6f769eecbdd87baef757288a87ba0f73dee73dcd7b9251ee40bfd17f4a3e083dc60a904700000907b8994204650608f6ff281087b6ef6c53e104c7031650aa6847b5e551c43dad7b5993f08f9107b48f685ecf02e50294031c0009cc9ea11ecd3d992a1c2da447b947b30f65deca0c7b22f640a7f8c7b1ef6345a493e620bf1c23d8b7b14f624e268bca28f61dec31c3f5f7488a4a3d847b00f5f1ebde4df384802c8000a07af2f5e09658c7aea11eb9bd727ae2f5bb26a14c9a410e009bff101da423d6d7ad7933463d697acef58deb13d617ac09cece64c7102223047847abef579eae0cc98610de806ff00d6000483d584e5a2097204093011eaac89010f549ea8bd4f376d79d8a3d4b08503c2488508f5247a6087a91d18833b8123206e48264ae7a8021e9fc87910f4f9e9d89b906660514000985e7e10dc137d810f4dde9b3d357a68f4c5e9864a33921a823d2cc93a20db0845c0314000483d277a4cf495e923d2336a20b940a500c70002a18ab847a3ef4772470a9e20f471e8d0812121500237800121a20423d140992142648208f441e87bd0e7a1af431e853d073822e823d055de49a2c2330c9828f40fa1f082190100aa845dd8117750435f0bb9c4088a62ae232380435dc11e7dbcfac8d4318f20479ea11e7a3cf379e0f3bde773cec79d6bb390646308f39c20e7908f39b22f0879baf36e9738c255411e6d1aa418a031e6b3cd512ec309480479a7914043cd0086a5422eaf08f33de663cca18f31de6307910ade5264a6446797cf2f5e5d3cb97970f2dde5aa0c87811e592e8810f2c5e586435243a0a8414f0001381c5c14c00f5000241e55bca97950f29de533ca5794671e50096010f27de4e3c9b79345690a3c983422683953310792ef258d031a03102251e4a3c917920f23de46bc8c33e671e45bc8a790c31e42a5bc119074247d108f20f20d88bfec11e413c8178fe31e3f64141031102640f08f1e5e3c1ff418f1d823c7478e4232032588018a05040009478dcf1b434d8c78d8f1a9e34f3d920f199e32bc6478c451c0a3c5f08f17019707cb06960004a3c5a08f1671fd3c5518658c26784cb0004423cf045bf810aa38478a0125c248012320f139e2686e8198fbc23c48788ef1146042b2176782c6041492bc21e21bc427882f0fde1f73c030b78421921098f84263de08f0dde1b3c34786333dc32407cb0696000524cee01f003d400090c7ae1082e84c7a611e128478489440418d8011a00ac00090a49e11e10bc1fc790f06407094782e11e0a3c115b5831e07e3be313f335483c0e781af02c652375b3493582a210c766f015e008cb8aa11dffb20810eff023bf908b61023bf8c75221aa40401ea0004424b0d3a621df83be78e8231df33be577c8ef8ddf09477c0ef7ddef3bdd77b78e71debd20d1e901590eb0ac77aa11dea3bd010ef3d88a08779611de4bbc848d2316a384778c023c417df08ef0c156087782101a6046a1a11ddfc72210eef12f9087774eed443bb02f40231bf9c14118df42637b08eeaddd5637718ee9c23ba4773e21dcf3b9b7734ee668f1945a2611dcbbb96772aee51dc93b917720b420ba724771ed35443b8d7716ee29dc4acfb28ee21dc33b85c6c441dc0171d8dc25c69ff214a38a10b88441a10edef1ac8876f4ede043b76108c97c8663522df08eec63b7308edc423b7076dcb35863b6a76d2eda1db3a3a428ed8ddb13b5e76bb8d24a3b59471e21dabbb56597431da8bb50769ced368ce1476968dd443b4808d1d42633b083a1023b447684ed05da03b3f767cecf5d9de336766aeccd6345f08b24023b2e7656594519f0483000461d943b272c94591c83b267648ec8dd913b21763e61d8f3b1c7632ec61d8b96240d2623dd00cb80832d823b12762021d873b0d195831d8584760eec0dd813afc20ebe9d7c0875ecebd5d7a3af220ebbe8b18875dcebb540a8c75d011d728475c211d705156588631d6f04c600409043adac5f4228a415a410eb5115e0858588ae843ace759623178847592eb21d63bac6758aeb11d61a2a040eb09d60dc55198b99d5c95492a8e4317204756a119e804c5bc11d58227110eaa8a95437418eaa716c087550afb65d20c2a141590eb08c7546ea88a84839820ea85d503a9f753a41d4d94f481203316704752cea55d49ba90164e2580c13c709ab7823a8e57962c4fc94107516ea2443a8708ea18576047d62ae41d42ba844eea31d41e2bd74fe5280862b907e1125863a7974f1ab2c63a75098ab5d36ba6819cac82311408e99dd333a6574c4e98453bb20838e978221e4098a8023a5b74b4e96440890571211d2b2b8610e955d2a3a5374a4e945d283a4f287e974923a4e749250b063a47748a507c63a437484e905d1f8a0fe48261d1d881110e8e9d1c94096b5441d1c3a37746ce8d49f5f45f30e8c49f28f29032c008c00098745ee8b4472854df2215a504745626c04218808e8a5d130f0d18e895d122b3f00560004a3a2108e87e84e88743cacd043a1a74324e8959590742ce84c4088c7422e8415910c26f670504092a0d3621d063a0b741232844a14110e81823a017400ac44639fd5615d748639fb05f821cfd32f410e7e5cfb39f418847c239f1c4ae21cf7b9eea0d91648839ed11308ca8639eb73d221cf439e673cae78f1261425ee0ee41dc00f500025047b8473bce775cee39d820e75dceab9d473a7890bc98987398083c07a800120e718239c3f256204058473801156104737ce6f0439b841602b8c0cc800128e6d46cd069818e6d03e608736588b093d0c24ee13115048ab6122ac047358493c4ee800120e6a092592480a8011bc00118734c11cd1aa91118879ccfe21b73338864a205908e649cc7b98e0808023ca398c7314e625cc325f228a98c239808a6221cbfb97e72fa4732dd29472f8e5e48dc09c7032c008c0009c72ee11cbb397518fe31cb9b972a01a31cb8b97072dee5ac82a3c08e59dcb32a3618e590ae68872c4e5846d58cc3ee45c84395a22de21cacb95872aee559ca8913430e52c5fd88c3dc11ca4912606c200048394311e621ca0393e11879c2393c05ae21c9db9380e323068984726c0a304393153f0230ed8472601ba04392f7258e4af0e910725264d8202008f20e49f0e78872413f50850149920e47dc8f29de195841c8e047231c820fb48c722ee4598ea0c7228e448835a5bc20e445c880b1e18e43c82e88721ae4301460c720ae411c81b90271fa3b7cc38f908e3e1c7b0871e813e1384 + +def cs_18 : Nat := + 0xee2ddc53b89a39c1afccee982e54349c43b8647c4231b104c6bf8d7b1aee35c61ae531ac8400f40d840008cc6aeedd842325f2218d51db98876e210b79864110edb0b740dd604380a2c0009859ac11db53b6969380aa407a8001318d331a5bb63a362411cd84a35036746cd069820ed6c216b22d5e709866346c68aed546169c2f28231a23b4e2d2c15bc0a08001318d00b4608c67f8cfb19ee33c1d0851da23b4246c433cf904c672ecf9d9e820f01ea0004c6338c668d17c62c90098ccb198e32f2c94591ca632d59082021b8001118ca826328098c91d8e88c644d10846320c63f8c7b18e961f28ec4023b0e01662318d6319c6318c5b18a6313c62273187a2f5118c3004788c6158c23183e306c60aeb78c63028cc02317dd1482b48328a304c5eeb0b115d0c2b30b0a49658cc5e98bc4422ac0a904700000902b0013177bac5a27a33176e2ebc5d38b98aa504b311ee70aa49547118b9717162e0c5bf8b7716d95280d8845581a58001598b65d542bed97484316be2d6a22e3316a72cc10ea7420b4416822316862ce118b3316513c719ab7823a8e57962c4fc9410578e0234015800120ea24262c5c5898b0d1118ae7625a615df8698118b055de08c57a884c806036100005315e62bb96fa3315b04c5638ac3157ba68218aaf155018b1814cc4e008c5518a9f1528cc54829d439f8001218a8b150082596105e504c53d8a7077e0ca1a21314dba53a1983314c043a50115bc04c52c50d0a170466193050a1604c528adc10dc8a1d9e7c5314918331010524af08436411d1f8a0fe48233147e28e74740f791758001318a2f144884348ff9046286c50b8a128541056a8115a904c5038a0313f93d10c82504d804c4fae89c27f809e011e515a204c4f285f84d012cb2189dc23a2108e87e84e88743a1313a62721189becfe087424131369384100f9c2626bc4d424a834d90c4d389a1d04161900d60004c6266c4c8e805d002b1128e7f558575d219ba002625f0808023c632f409897712e211e4ba440ba304c4ae109918e420dd03023804c4ab894c4625273d6e7a4662500803842624e0989302505d0823dc239de021e031c0009073b61312412e325be19e0011800131891c96d32c11989142624473962027a84c48188ff11eb9c02188ef11ce236736c4311a6233c4623311707be4b7833115e229c451889d04314249649202a0046f000453111e2225520046c1b0800131887826f86e819886c90b92123ac24310c84c431885842a75343a10bc011800129c91426213408223109621154cc331082a6311883b106620a23996e94a11c7eb1c23104e208c40e19048620572e613fc04f008f2988092de0833ba11cb6919205aa31cb584c400e59e8038c546c1100584c3fb87e84ba80f50000506d584c3f387db0fae1f4543b29c8c39543fcc5e50661f12268239128417f4a3e0461ee0987b70f661ebc3d5879846e002b000280277449611878f0f088c3c1877c150829e0000530ef61dd7262a7dd2e880003187730ec08c3ace4b8461d408e4a885fcf3e187e54a9288c3a2e498461d0c39c7dfc6109e098729c8e087231c820fb48c722e41e1290864121871f0e3106c164e2580a106b4b7820cee84c3878708832906205aa5082e000111e4a0261c0720a1814661be71fa25b4638f9093ee8238f60986eb0dce1b7193ebe25708c36d86d54d10cc36986cf0d961afc35a530d5e1aac353869f0d361a5c34671c6884c33e130cf619dc3343037284c32ee2e51978c1eee1047984c326e2cc46191715e230c8618e1ea01a4c47b9452a010f5f84c319862f0c48c93ce130c3e185713ee27149c94c302130c04f6d12c03078789a44b7831c4bb8961e0a330be8eff2772330bde179c2f185de7af147d4c130bacf5608fac55c86173c2e2255461e7308a42420ec93cd80ff810780f50002630b6e16cc2d6e1ecf3017990002702c004c2d385a30b30cc2c585830afe15e9a5a51c3538661185730ac1e3119855d68708160a130a9cbbb118540206de087858b9a88c29ce100b970cc298349c4383b707220f00847066e0c44614a8834230a46146c28837ac86142c27e21c10b820005600048613cc27584e066137c26a5b1dff2101b601144c84c26384c30970c3b70121fb04c25984ac7b70c1b10106c382f41184a7093b8027002dffca6126c24b84930916121c23c6308e073100023277f046fd29cec46116098455bf0307d02360d84000986fb0130894eee0dd0330888ce8113bac2610fc21c1b108ab034b000260ea084c218df15be12ee120a0f0228396b5423084b7bd10def141a05643ac24008780c70002330839d28118410261033a4021bd8846f603254460fdc1f783e0660f7c1e823079b7a0502a3307960f1c1e0c0b0837960897c8260ecc1d430d4605c400560004660e7c1cd8395bc4b7876f08de05bbfa07ba213071a7ea38283307160e0113ab0260dd09837306c88c1b072a8fe30cc1a811baf84c1a783482529d28209ee824d00f5000241baa84c1958323063ce8f2047c8260c5172210d847990171f3cf8460c3c18382fdba0a79d071a015001180014854045a988c17582e04373a38b82d04660b7c16dc3d0660b5011e20e2104c1669e08460b06e5221b92b7211182bb055e0a9efb64305460a6c14b828db8914c1409d704609d083f8820d5809826f04d1bff182a393a80a8bef904188a04098a10dfb04150805600478cc12e9cec460916df8dbec40890c11e10def04c11a11b7b04981023dc236f43a5023045844e541139404c114db9bbe00c4e4411b718a14bcec30dd912cb11821f0436083c105386ca1b994ba20004660806db04f98636d60981f303de07806624b2ca6077c0ed81d703a7e442981cf038e0709bf86daa59c98c0dcbcac4606c0981a42139b098193030e05fc0bd8171b5518c0b38153029e0522698441c1b08001418141b4a1b14189a800c588c09df8c78498cfc5e1302604fc5843204604a5dd4230239aee118114d7292f52e3e0004a2674086b802267008d9fc2367d5da4ab5c6367b4cd00ca828c08f728d9e427e1e9b88208c0cb0023000260d5c25bc1180f7f0d88c07980ec9540c355e11b37044c94104b0042514126d8171f00023061a844c7611b33044c6810c9984c06580bd3148c901411a7b846cb213016602a10d9483baa8f818986026028c04f809b012e024c04261b2184c040d8f84601cc034d8dc24910070c13efc047011805f00b60156c58acb4a601423e42300925e911f7b82600e09802c0b880011815e021a0423b2ff9066008c00e0e5c04790c00b5d284202c0980108dd88c00780004361033c206580118001297fe825ff96c0e1875770906c0a12ffb04bfe8d80546e8c480c11afcd735117fceff8dfee6bddc07ca35e96bc508d0603ee05aa22ff6dfea6bc0960896594bfcf34d845fe5fb8c2188a04031610cc104bfbf34b444d282c34212b384bfbad73045fdcbfb57f5dae135bf08de0008e06e5097f59adea54b088a23dca5fd108d6e0235b2326622fe586e810d6b425fcabf9294f065fc86b4823b7b840742425d2e90cbf8a643045fc3fb5421aca84bf7d7ef60f70cbf7463b09dc8c4a2c12fdc028c10d62cc68886af8d5eeb728c0a1a12fda0462ae12fd8dfb0bf5f7ebafd6989e303fb825faabf52b68065fa7bf4d7e96fd27d956ac6626658402aa12fd15fa1bf3e32fceb558117e72fcddf9a6aa442fccdf95117e5024c08496212fc95f91bf20d5037db14bf1d7e31a9c041492bc51a9b04df5897c8435aa097e1da9656b218d4a4c098f414ba442fc25f83bf0232fbe17ff625a32fbd2469117ddefbb5f74bee60d30a5f72bee2d42d22997c312d4179c6ab204898100ce01990002304b004565a112231395317c01ac000947d3612fb4b50069fed3f1176142f3412fb35f64bec77d8afb0df5dbeb671a76874010d3a425f5a178622fabad13103bf0234e169bf057865f5469b8d36865f5169aa2237a0469a212fa75f49fabc31a5e814610050825f48be8df55d673b157297d0efa15f3f989a0960035800138d29b3b088be7d7ce91d38c2da8111d204be737cdda49a398217cdaf9a969e0f480314a4c98be697ccef988cbe605a3045f2cbe577ca9a3a900a8011bc0010cbe4d7c951b48c46d01d342198001217c86f90346b984e42f8fb46559303456ed8142cc6132c0010c68c6597845f1c3a5022f8d7d3a68b0311a0164e08de00088345608b22025f17465e22f89842f004600048344a19ac101004790be2012f87df0dfa5e32f85df0aac363065b04be0c12f82df0210d0d8b0601f9028a0004a5f00fa4c22f7e86571103ac215f7097bf2f7ddefa01fe01ac00098bdef7bccaec0cbde01146e84bddb7bb25f0d159217baef750c40197ba65ed88710c12f7284bdc97b8d165ac331eda0004c5ede092f48ad2082b460fb816a8c67f6eb4045edabdaf7b5af6a5ed3bda5bc48e22a3454022f685ece67c4586885ecdbd9622f655ec8bd8e552825988f7317b16f624bb4197af825ebdbd7889dc864106796125d604a24a119e3b3c5117add9df88bd6812f59deb1117aaef555ea7197a9af527cf96742008c00098446488bca628c4f000253e7b84bd417a7845e9dbd397a6ef4d1157297a6025e96097a559c84b7d188820202ac097a52f49082910521543e0cbd1e12f46de8abd0e32f418811117a0aed808bcff79faf3ea5d22179f19b04b5b66b7bac8a5e79bcec22f3a5e721086b177088669a86987a40564074a09cc0009c434012f375e6dbcd979a885e69bccd7992f2fa18412c062f2ede5cbcb5f32485e59bcb0acb462b2b08858425e520b2e225970442a0f74445e4ebc9b792c60c0d2e3e000465e460978fef1e889635d74846e800978f158288bc7012f1b932e096623dc85e36bc6822f19fca802aa32f195e31dce832f17de2ebc5632f14de26659aff9085e23bc444b90620eb09787956b88bc3612f0d20d1257832f0cfc9a10349c25e16bc2a200c60ef609784f73088bc25784256a8cbc1a1f24407c70f8c1d0065e0b09994825e0abc137822f0290651a12f023288410449183b225f230ca15942207918ca042074009f21c207320977feefe0834961026604bbf2c9c445df7dc8a2102c84bbed77c440a220977c1fc808bbdc12ef65deb326632ef48454cc12ef35de5f8d5b8d88325364a2c94254a10236219660480c259612ef004bbbd7772eedddd821775831008bba9774d91f0cbba41fe4140000121774024c08338a10dc0008c950012ee6ddcc94f0c8a0ffa14bb92119118464444b2c43f5908c87cff41fe2181c09cc00098bb8612ee15dc1bb7ac82c21014bb78442045db817a0101004790bb6c12eda90f91176d2ed9ddb2bb60406898463f212ed684bb4b76925279f8d6b5452ecf869b117670210a32140526465d9a09765e52088bb2a7da445d93bb257644fb1106900f40d84000a0bb21763c83102d52063bc231c909762d8e3b1c519762be1888bb10118dd903e0bce3558831b908c6dc25d83bb04a6bc65d7e0975f6ebe31b0cb8442ebd31a93e5830f9504baec12eba5d7210e394231996330015001180012862352f908badf75b2a400cbad775aaeb45d6621759025d62bac1757c7c990babbf0194b48c62ee1086404bab57554f698cbaa9754be010cf7fe118b000b311754025d4f93ce22ea75d4d93c432ea65d4a10c533a8f08ba8d7512ea10c627a1189d97d10ff20a0000094626e12e9e84ba7974e84312d08c4ae4e485c5028a0004a31287d3622e9bdd35ba6974cd88e1e5b69ee706b284937a12e98dd30622832e96dd2c936832e9549ae11749ee93310619748ae8fdd1e61e84024180001174682378001197462e8b08ba2a783e79f0c0d9611875b0ea61d032e8904ba2012e8789de1019e42170a097436e865d0b619cc32c14f0001397420ef10de60654146047b984cbc12e8204f786c30c4498609740ee817bba1b6e42e80dd00616af8f86d507e620700514000a4b9fd73f045cfa0973dee7b7bb41973cd853496f1815e025cf00973bf6a70861263a1041d8002360d8400090b9d9257844bc10875d039880001973a584488b9cd7396e718c04b001ac0008c074c1183d4952117386e6f5cdd60d642e6e30683a8a32e6b96333264000481631097348162800118a0f025cd0b99d733065cc9097322e63304b18c12b69008608cc1158210cb98bb46845cc3da2a22e60dcc0b97e73d885cbeb97b72eee5d5cb9923c62e5bb886104090207cc0972d2e588c2700560004a5cb0b95f72b463014921e22e5584b95572a045ca6b9457286e4fdc9ef6dc62e4e045fee1028b8e7910bfd421fc00972653e104c7031642e4b5c943ac232e49dc92b91e32e4684172689c00008cb913721c40b7c0871d4162800119ed64a870b6911ee40a4c8416caff9045c84b906bf341b580f50002602a204b8ff71f6e3e5c7bb8f571e57e01cb8eb71d2e391c352171c46d088918c1246204b8de70a4448bf0816b825c6d5f524b2c65c6b5f48be80bca10382812e341c09109d7025c65b8c42a501b580f5000262e3004b8bb7171eb40cb8b1c36845c57b8aa22e29840e6e258042f7b4e7622e28fb2f11713c200b2000222e2480f5000232e245c45b8883db885c423768504c44004e400460004e7b2508bd6425c40b87b70f2e1ddc38b86970c8e48720970bd79bb6c3259642e165c2a1170a477c08b851709845c23b8445efc65c20c93622e0f5c1db83232e0c5c17b82a32e09dc12b81e32e06045e14f45045c05b80823da69690086812e015c00106c7425bfeb7fabbf177c905df0bbd845bfbb7f56fe06c410b7e9ebc445bf3b7e16fbc35190b7dd20e045beb096fa041fc0901800ac0008835901176704c8c611765aec96fb032df11abd116f8095e0879bc12dee04903c6ab84018cf5b812deddbd85d6d914085bd55d5dddc062637096f52de85bcf9018424050404e81092e04b79812de504b7936f1db270cf598148021e8002211ff025bc4b7856ef4d2690b778ba0cd248cb7776eeaddc2e78216ed5e500960196ecd73786c20d7e6774a5baf11000b5462e675cca1a6065badb7596eaedd3dba528471433a0671000242dd0ae57a55630cf984b74067b822480f50002508d504b73a466845b9b8fa222dcb040c4010ceb808f116e5572019cf196e4adc847c4196e38247c0081a6025b8939c0223dd845c52454845b865c44161c2c203d109960008e5b850d36202bd0578109604a4c88b7076e063d70cb6fe569045b7c08b8517099470196dec0c5888f481019707cb0696000485b795c06b80062dff5bf822dbaadf60dd032db8db708f2810ac85d9e0b316db4362115606960000a5b6cd7cc216f32de3116daadb408b6cf6d96db2478020b7596ea08b6c412daf84b6bd6d76dae5b5b785653d3e04b6b36d62dabdb56848852da9db52b6a2050885b4db692f74465b485b4822da304b68a494c45b43096d096cb88b681071c47a61096cfad9edb3cb6771258a5b37f4ac92c34e990b664611f0cd0cb66060fc45b2db6596c9d6b381af01ea0004e06a60696000465b24091ce025b22b6436c82d8f5b1db638b51ce5b14f4864ee465b13b624b4e8625f2096c4023e9b096c3425b0b096c2521c08b60f6c1ad818c69ee12d802d282f185e2474f0a99316bfd6928e9a18a3e025afeb5fb6bf03a010b5f21168d2d1717863168aad13116be31b588053003d40008c5a1c10582848df012d7904b5e36bbd67fd1ce0d7e6774c0cd1096bb2d7481af01ea0004a08774be421ad504b5ca12d725ae3b5c56b86d6fdadeb5ba8ef80158001516b6ed6c88063e008c0008c59b8133b084b5a85ba06eb25bc216b4ad6808b59d6b363630c1b561236184598610b5987c8465432d63f9fa76a85a783d200c5293272d635ac550fe3165bc6b646ea32d615ac0108d98290043d000442d5e16791a70c820879f2096aeed5d5ab9b56eb26068addb0396ad964a3b3318b249d98887658126040cfb0920048c61651467c120c00110b55f6ab822c845505160004c5aadb550201f384b54a11d8a35aa116a8c25aa2b53a02cc65a9a08b19163108b52b6a52d488c8d001233d51631119e024ec7096a36d465a8b337a4162184587e17740dd0361000052d435a852b7466c00358001316a0dc430820481161d301e1016d025a7fb4fd4518622bc08b0bc2bd8858524b2c42c270969e2d3a08b4e412d3883621169b822c180969b160a88582255a19040cd60612d34463f58052eec8512f0918f025a62307e2231984b4c1697e8928cb4bb6972d2dda5a44c20f791761c57e254282b21d6121cb4825a57073022d2ada548c4a32d292bde57b83231084972e115ec002b000232d27da4cb49769289e39457a2af38402d508af2c589f92819691825a4544462b9d896905780113ba84577812d1f5a3a5752aea15d346003168d95d0eac41968d7cc445f91968d2d19c5f518ae4c53bb2081968c6d18273b1968b6d1501dd03140004a2b890968a2d135a25b447688bcba98b4316852d0983de45d852d072b6256c342a8dcc0397011e72d0604b4164fafa2f8cb414ad442970171000252d030427a2190445a05b40818d86796856844f1065a03744222d012b39566c313c000945668109d3096a0bce3558859ff565622cfe04b3f567e5d070cb3f167dd58dba092167d874d08b3e8ac54d95a5f22167c0259edb3d967ad5859026921017e040808023c459e8b3ca21581459a2e9c3108f842e8c1037a84b3c410237800211e504259dd11308ca8659dc55e8349c6458b088404232d109675d57708b3aaab9b3358cb3a221841cb808f21673897008b39aab54459cab392ab4106892bc296722ce308b38b670ace0880b2167015622ac21966fecdf59bcf2444352b04b377e47842ab1c46222cdad9b48ac43104f848abe11555848ab40d2c0008cb361e43492592480a8011bc0011cb35612cd49a4b11669490c08242e4848eb08cb345667c479030954242599e54d8a9a5a2110b32f665accaaa6121664ecc8d990b31b6631cbb98b3140c80478f609fe027804790032c008c0008c2334112de04b311661ecc35983f1dc5151c11800ff20a0000094b30165f2cbc8cb2f165decb98cb2df65ac42a1817f4a3e062a16225401ac00090728c12282002b000230fe64d2d116596cb259623f7243c6e0d1310a7f8145800119657acaec4ef18a7d54fa44ed18a7b836c0889d41085fcf3e10a7a4c9b0404011e42cad5959b2af655aca9d952b2a36542ca7d94d53acb2ca5594853a041c0836840e00a8008c000a4b28c12ca204898e12ca159410698314e004b27f64f6c9d8c720212c9c0edf1112dc25936635c22c99adac1164c2c97085330107f104b25964a2c93d925531712682020023000292c90846318105e504892c12c8f0430c8114bf84b23b64714bbe9d321646d4b80f93180e1825918b22f645ac8aba4629644ec88590ff14c43c5204b21ca5604447d08a53dff208f12e7ae44590ab21364204e290527c7a9045905b2089be465902096406c8058ff1e1e26912de18b1fb63f2c7dc4682163e0258f6b1eb1190658f308a468258f188ba2148929100ba43034d000111116021e73083b2c3a008b1db63a9481a90120a40147ec9bd1963a0258e7b1cdb6246311408a3d00ac008f196391478051c19638c73c8851d61d0041e3f2ed2066400090b1bc78e0428e7620c2147204b1b76360458d6b1aa1294e9410b1a6a36044433a85406700cc80012910b8258cfb19d3cf0658ccb197632ac64a8cd61c86146183b9077003d400094f0b212c63a8c01c0a9748858c661ae22c6258c3b18232c5fa8b40686c4b48083f812020015800110a2c4ef088b17562e54511dd20c3abb84c58b5b16621c0b0dba16080004828a0513ea27b4af1087f23684458b0b15fe0fc6c410615212c55d8aab152e00c858a63b4622c5258a3b1456282c4d28701d0603d4000a4b1336262c4bd896b1256246c48588fb11b6231427ac591012c4304b108a124ea006bf33ba52c40587fb0fd61ec34d00013161ea76f08506a12c3c58731161cac37586a192e0004a2828926622c34a825ca4633c0d281d259632c331d010046000480c6345d6000460616018a5264658600961782691c0836842280b03380664000102b7a12c2dd85af01831c430487349ff42d91c2401640004c378809615425854b0a422c28d84f180e2a7885849180422c23d845b08560fc84387089f4a1c288b07960e6c1b95472160dac195830b05e9ec53d8152c3960b6c16582bb0545468a27a9089e94a870b6911ee42c12d824b04760848581eb03822c0d04b0316058477e9089e1c5818981189e082277e0bda062800090b01f603ac06d80cb0141a60c5808444022c035804efb232c01a76206c2000485800868422bffd7fcaff75feabfc57f7573c713aa054008de0008857f2ef9022bf8d7eeafdb5faebf494afd15f985e50ca1b012192a7374e6c9cd539a0498315f953e008afc95f8abefa72521df0022722095f6c257daafb35f62bea90afa75f3abe62700625a5137fc090104b2c257c5095f1137c014500024217e044de66df0207005400460004c5168086de09e3886d864b2c457c04ddc9bb537590af7f0bc70360c12be257822b0caf704e6041b57095ed6bda57b349e0418ab84af635ec13638c4d8610d9e3a09115eb41228001189af4209090a8011bc001104d6e9ad535a26af11e652bd5d7a9892c30d8a04af4a9a6c45f1d61215e92bd1d7a2af438130a1b02307e22bcf579daf395e6ebcd42cb315e58257954cf2c79065792af1c99b58ab90ef0a1383e0c97000232bc626680654146047b94af1439e445788af0f5e1abc2d783295e08d5c88af0012bbf0dce110ab82577caef55de7bbb90aef15dd8457754c7c1718657746cc81cfc000904c6e12bb9a62f24dc32bb9576e4c48d9648576d4c3d368c6261b0eeaa3dc000904c3012bb55769aed15d9ebb294aec9dd5c4260834a02213e9a4b115d8cd2488aec297fe6c325d1000252baf0490024632baed75caeb75d66baad754ee9072ba925e24bbe32ba7c25b1964008c00094ae9d0960425d2095d2fb9d08ae935d18cf7b12d215d10219e209dcc425741ae7b5cf0ce495cd295cdd2d308ae68968840c43626422b9784ee5012b97115f115cac20f6e08c88c24233334a0fc224b1007dc0b5445725095c852c112cb195c8170d08ae3c95e12bb0c2b48112ba3946115c76b8e5fe1195c6ab8b961900d60004a5716ae28659426f86e829dc3825712ae2022b87d70e4ab29554b8514ae1b5c2eb84d708788a512a26fff62ae32b82d703115c04203e321560f7917610ae0094f0456feadfb07f0656fcadf733e0656f7adea0c14656f4ade69458656ee6afc10dc00090add810821041dbe12b7556e5115b92b71d6e2316840172814a018e0004801f9028a000461499084b2c276dd314e0314a4c90adb35b62b69d6cfad9d071cc24ce095b32b65d6c88380931d2620fbf0e6e258123556083498011800118930027508ad881125c84497092de0da24b0d3a65038004ad8692ad8990c1f1e120c0010cad815afeb5f76cb215af020a495e18d4d8256b9ad715add247b5aa295ad422489095ac6b58247f190664245818a000242b564196100d88256aa48e65ffd89690ad515a9d0c40cad4b5a92b51d6a2ad420398c569f0906082244c099e482569d82fa21a8084ad36d3f446788095a66b4bd69582dc41a75977270cc3120e241b69ca320b484ad255a46b47d68c205d4425988f7195a2eb4534d5195a22b4356852e6e42b425683ad0232b3f84ed1c12b3ed67b25e63047b84293212b3cace762ae32b395670828232b37d66eacdb59a6b33c138474e72b335663115986b2f565cacb75966b2c5657470c35c02c203d109960009a058009594c25650ac995928656492cff259865643088da03a684330002403a5032803ba062800094ac8358fab1ed63c09ea52b1dd638ac6f58dbb3014ecb8593823780022158c2b17d62e2c8e42b16562b08703319504ac52d12866b0404011e5208184ac4d589045623ac455886b0e96240d2623dce561b095868b063157183278ad208ac235842b07d60e45f831f81b0800141581d1798881c012b00d5ff45d03bd8855fb09d918255fa75c223b2104ec8012afc9024108b3c3e488abef57daafaa2c2457e52afa33f71015ec255f2abda21154c0ba100f48255eb453a03d400090abce10b0d04abc75778aab155309960008c2289095772aedd5daabaf57559e5227139d894255d4ec4254500b8800129573aae58844aa12ae555c811d870255c644902d105a090138012ae1d5c029cd45a0855bcab7356e2adba232445e531462820ab661111484ab642bb023eb1572156c6ad855ae443a42ad6f6071156a6ad3d5a680da42ad1d5a11156810fda1f9573c42acfd59eab355666acbd596ab2aae25021d743ac3ea465593031622ac9559156fa32ac8558f4386c4c88558a809422ac45587ab0d5614a0b141311000b55055830886987a405643ac242abdc5d200a8008c00094aaf0e8b442190431c22ab9d571aadb55b10bb4b3b3155a599108aacc110b084aac9558eab08c0b1203140a0800121557aaae08aab43a6845559428084fd09ed9f028f4502213b0e9c2109b1b2403ba06280009426a412aaa04aaa684bf73f0caaa2849c4554faa984cb825988f728cb9c24d00f500024037a84423066f0035800121551cc1f88aa8c05544131408843421c08aa8884146938caa8412aa0d53f1083d42553beb7724f46553a41da83ac65538aa6e8385fec92b9278e61066a0cc7fa48321063b2aef25072a9904417c3bd84552eaa5b54a0620a524f2101c0cb002300026194bc55f1082702551d0b080f44265800229547104a06981999342551a410449183b225f2295462a8bd51519545193e08aa2412a88550faa1632a8484aa11541c8640caa0b541102506cd86e852a8154ff1153f553308eb2ca9692e90ca9f5d63842a540867cc2758923621966048107ef0190443f74f8c8208cd044b7812a7a54f3402e805a06f144029e3b8454f0a9de1260620077eca204bb044003b86c454eba9d47fe4ffb19b1287380254e8a9cc22a72d4e2a9c3537aa6e14a9b211907818b115355904083f8c12a691104107f08110818a000242a67d4cea997d5ac815470843852e908eac812a6454c7a989530df9c94a9827e44859c20720fcb98f208a97cfca4fbf8ca976093007c00f5000250fbd80f5000232a5c043ee212a5a9f6e1152c8254b1a96152bea56903ec441a403d0361000250faf99dd1152aaa54d4a8069842a51d4a1a93e30fa784a93a7d258db8c08ac12a4d5497a927524455c81af01ea000505490a91f523b0d690a90d5215f73edc921520c254800951f9f7088a8f951eea3ba9722151d47c988a8e87ba70cd0ca8e47b90f71183f201b6025471a8e151bcf6990a8d3f00845467095198f620f4e910642a3254633d782a7881eb8071a0150011800129518425460a8be7aa4609c509517aa2e08a8b1515ea2b545420c4f0f458ef619514a4e988a89f5136a263ea121512aa24d446a88afa5ca543f08fa30f281e4f622842a1f543a10f9fc254380950d4f1a17db1950d2a19b0ff18c3e4254301c841ba06046f000422a15019c03320004875063c2c5cd461e0f9e7c22a1284a849508ea1154217ccc5186e84a83d5070430d70827782067909506aa0ad4133bc43798195051811ee82a08d40f7c9c32a0712cb11502c585829e000240b688ef61036ec21dc909501ea03655718f8f86d507e608fac55ca5404a8054ff880603610000629fd04a7f14fde9fb53f5a7e876764b61c3b2e7658eca0ca7e676343b225f2214fc69f80d2718f87826f86e8194faceb21d63074c4183c04a21b56329f484a7cf4f8842c88094f829ef9d4e0d9640ea2041492bc30362115606960004853db08a11822322094f669ec53d5e9b4429ea53d3a7a54f41f0094e9a2744c453cc0831ea8b408a7934f21ef90c3a0018580629499214f129df9cf122e4429df53bca772735980d94a7714ede9da8c7ba210e668c162f2830e0a04156213a5e3dc91073085fe8bfa51f0429d5042b001328404a75055f4453a6a7474e846539e2a9a229cd84a7354e669cc3da7d9d6529ca1c84c9f230a9284a7254e469c8538e214e329c5d38aa71043a4c04a70d4e0e9bff493214dfa9bcd37718888022fae0870a421c28384c229ba9c20114dd29b9d370a6dc429b6d366a6ca51c083114094d8e9b153615efa4039b8960106fa0a2c88a6ba6f80def0c37b811eae04a6ae129ab5353a6a2329a81bbe11e631ea8045ec2129a5d346a68b220c81ba13a5021ea284a6874d0a9a0bd40214cfe99f745b194cf699c88a66cbcddb6192cb214cd51758001194cc44c58803186db24350836c86d8d36f847d62ae50bdf84a65a129945327a64d4c9085323a6414c7cd9c107a341074804a62f4c5847e8158011e509ac0145000232989e482114c48d8faf02194c4298708e88222e841b0ce12622986530ba614432085309a6114c144453157294c09e7e88a6014bffa1b0c35d0c790452fca5f02297baed255ae30d6692ce0686c4b48083f81202297904a5e34bbc452ed086b08d5f80f801ea0004a52eca5d6f378652eaa5d34ba040981dd03140004e52e235483140652e1354422970128f0fcc11f58ab94a5ba1296d84a5b0f338452d5094b51e6288a5a069e3bb40ca59f4b343baa8f7000251e5d9a69247e056004794a59669883a70c796a1321e0434af1fdc452c7a588692c652c2a5834b0295ff3fe09086295e3ca012c031e4eae6f0d841afccee9434321295c04326610d09088005aa32959843410681cd031a03102251e4919fe4ba43295791ca114ab8cfc88a5561295552a9a54d4a9695194a5454a879f519cf214a7de3f88a53ac8d044a80094a64621b132194a5e94b19b118738021ff4094a408ac8878e412947d28e4b100314a4c940b0e16101e884cb000450cce199a78d632945f3db114a2a9440544194a1a942d2845c1c40cbd997a32f065c427a94a50149f84527832a620ca804a4ec6534452740d36216f704a4e149be9368ca4d549a69345267a4cdcef8c73bc09498e9312dd419498292fccee01f003d400098a4bb496c4525809495e929524f18f0802103e0bce3558618d1091d9823c1b08631c96588a48f491442db209490e921523d1948f291dd239a46a4291a5233a46230b0d04084011dfe04a45b48b02750ca45412914d2271012602522377cf1d0465220a43f487124e0a200f960d2c000a077c21290d521811485e90b52153043bea0a0aac09484e9093bd019482c218007796229048e7911481e9025201a4000ab0a3bc10947fe8ff3bbdad3e4122897c45a74328fed1f7a3e80f380c500013147cf9bae3771947b68f4d1e82ed6428f2d1e3105d78bae8efc1976c0251de09476a8ecd1d82e88428ebd1d6a3ab474c851d10947368e623de07bc8bb0a172610ee97c8635aa09472e8e47356072e023ca51c361ae228e151c1a38146fe8df734d76da728dc51b72dc68eb0b6e86203146d4273438d90228d8844736128d7f33c0f480314a4c94a346ed3c4519fa33d46768cdf32f68ea60b41157d11466a8cc967d46cc148021e800139cca8216791a70107c01180012859d828400230002425e08446ba128ca166d46a859a48519008b254688818a0002428c48b040002328c45187e63633ec2480123314619645233a18b2202731609460c21c08a3034601d8f8c2c6458c1d8d8c5dc2128bf561b1032d825177a2ed45d005990195811d85007a06c2000485171a2e145b86441058ae18f0207005400460004c516809459d17a88a2c8023c43aeb2bb40d2c000902bb0128af515d45c0328ac84a2b145568aa5152214544adb95b62b6a4090a46600856c82d9800119453180c08a294eb4915f0023000251d6804e5d4eb34451444564228a10445585608ac00c1214101b104 + +def cs_19 : Nat := + 0x18a000223a3d536010bdf427479e8ec135415480f5000263a3904a6aa10e9404379a6f2a9a78c377c23cc4746c094d257ad885eb210dd2949911d19fa319b90043c0bc000098e8c3d17c43d4008273064c0890f213a2d13d904ee000487457094cdcdc01b7c018c719ca2f3a08f4ca06f0836e74cc841b6c36ce6d91e95102f7e13a2984384c107623223114c90253220992502744f7a3420d996881103a182744be89423da69690c9041298884e88e11e8584e88dd11042ef24d16119864c10263c1177784e878055441b004d0a23a1c8435e26bbc1630ca5fa10d7431e4114be8d719ae0194be021aceef0a217692ad711d0c4212c8086b1cd631ac535886b0d76318e85dd0b5e6f0c79b81322c84a5cd0ab847429354423a12742210babc23cce09d0783c8856f293243a0cf41834e2f2ecd349a649b3873a0a9a4d10692c27409e811d01fa0290e80868600a500c7000250d0a993311cfef9fc88792467f92e8800120031c0008833f8f238473f2a55620cf984a54ef2208d4a6f920f2182119a09cfb88cb08a540139f6118111cf98273e29500239f0d2951066c421ce009cf78cd62e27335245458ab985c475c944199e333a6670ccd1999333066552bf20e7b9cf64473d83314f18c6198709cf58273d54ac2239e684e797cf28ca519495be2434022c845505160005473c7a4da223c704326611e1e84e78012932192110647cc8e03b40766313c00098e776644833b8123211e00273b83210641c1a7034b00026292f04e76e63fd6e60ca4b610c7998f0a4aa0a30818e131b0ff90673b5e75fcebb9d610a48a116d90431554900c4fccd521cea5e0588e74d48d4473a409ce8cc3cbbfc18efe42739de733ce5c63a4609ce3e90e249c3072b5c0c1b18353066839c618285dc2316b40477b410c10efa81060787a888a420ef4833b812320ef402520b086001de517f54cbc40bf9d205b63232901842fbe10bed84e70811a8684777b5a7c424512f88b4e8651fb2f4d47d867380e6ffcdf46737808ee7c27373085dac22d1848291258651e22ebe5d78bae8efc29cdbc22402093403d4000902e8a5d0d1fd88aa08cc3260c7367e6cdcd979b19047c4139b0735fe6bdcd708171d8dc25c69ff210e6b2139aa863010ede022ce50946f0b7c23bb19cd44273482dc68eb0b6e86202946d42734609cd0b9a008e67b4684e0a0ce67211da604e66fccc842ca8083a102732ce654239940446ba13991966d46a859a487322e643cc81d9990e63dcc75d948c59148ce842c8809cc5822c8409cc5163f16352c6458c1d8d06e839cc4798701450002439850cb5024a048c83b1008b1a8216182c2eec20b07bb05193c5690e16087601f498673080857dc22c576850228b40475e410af451631057828af882bb257591720b04000051d728475c213980f2fe587e17740dd03610002708b784e5fbcbec472f6a29a21d6adede11cbd397888e5dc1115904a2841115615822b0033974036211cb9b97208e5c21289b15692ad0c820872de2a962396eac029776328978417542e9c241800221cb68c1f88755c54b847b8c44e211d55152a2a534494851230944702225a0889602511709cb3cad208e5981288904a21cea5d5ec8ce597cb279643a91204f1c2510529b34408672c7e58a9dd4672c009cafb95ef2bbe575cae4a4b949629298ad922203291a5230a45338829cadc272b574d02395904622810a37946e74c62a0407a800130519f86d08a1c41286f145911cac040888a1a651368688c0e2a1395594413a503395284748c115b821b9143b3cf88141f09ca8394e88281942c50d23fe421ca5c2729309ca3713d08e50613940727e11c9f684e13b2275e4eb5d0d9856601393d84742e12cfd9390271eac9c9c38811304e1021383563e4df89be937aa11c6393b1b2b4be43284304e4e741fc9a502fc21c9cb937132626484c8c9911321a0d8abe898ad0698b1cc393504260484044726973c02282e8425e4ab9b33503a504e60004c493d09c98c97300c700024282c84e4c213930725fe4bd413956394f25613c94047380128238c5011410dcdc88a0804a0894092800b68510520424f41392b50371049a2819c55324a40004a12500882182502e09c9402724d09c021cce84e499c92c902790321885822a75343a8ca8611eebbda101c0cb002300026392184e48211cc3aa6968828bac00094a03613920723d23a8a9688e691cc2396471fac72472f412809864111c8eb91b88e46ce5ac45009f1dc2280384a00880284c08ce463c8bdcae0ce45dc8b48b68ce45611caa1fe62f28327fa0422681391372249fdae50c47994e440e4f84721e21fa43f087d90fa05ae6390ef21ce4343014604e42d876886d970a213f8437408725c1086404173010fcd043611e6327ee10b93f2631c9304e42213907109f53bc32b08391c09c83390508e4073f208360b2712c05390002ef041e03d40009420cc419483102d521c7fb8fe828c19c7f030288e3f7c7e441041208040ed4d9902e71ec638fbfc271128802101e20233ec5c770ffc3e58614d08ab00d30338f984e3ddc7ac2a411c0000250f8b8fdc9f50307e702770002338f4041f83126c4318f09c79f8f371e59f39a754a4f9709c790c1f882190138ed0a200f960d2c00094e3b2e2c4438aed382227c684e3a9c74041eb0080dcc2315403ba062800090e395c72044f78085fc4271c5e388a49c000109ece0f540358001203bed48f0ef7627240be784e37e3b7c471ba9eafa67460ed308ac238db8ecb1d94e20880d2709c6c421e611d603abe7a80e9a28a3e0238713c9a3a2c7453e87281498271ac2ede03e007a800129c6a38d30870b810bed843c60396872c8e582eaa39545829c1ca8e14cf1308be3ac25045e041174112e904e33a38e8f0b17352010c02719c9e7823c3004707a1069384e333c65c428be2e243818efc90883411c16441411c6538c9cf2b1837b46f612cb1837a8ef088e322138c7f18e1b98774830eaee131c6338c30981187714216c77fc8238c0f17f11c5f42717c9e2e76dcb5b8c3529c5eb8bccf0b700a438bb84e2eadff8b4a03b801ea0004c717250f8238b8b7fa1076486af2875193c00ec5876619c5bf8b471650c4041bf204e2c2138b0715f2a4a338ac7155e2a4d6a4015800131c53d41a05643ac2406580caf195c32b08714ae2913b586501d1c193646e89f320e28dc5178a2304221c50f89fa81e19c4f389dcec519c4df8984ebf19c4b8205c5028a00046712a4ffab8a867125e2440fc224b10e243c48388b8c4fb655f015480f500025388971116ece046c1b0800131c43b885f10ae213c41ca7102173c721c5cb8001282e52745c37117121024202008f39c3f387dce801939f4a808b5319c3e9b9c0b4719304387ba796102ced5ec88e1e813879f0ec1070c4570e0ac15bc2b7456e1c2b15b22b6056b90210f908ca9a4e65384c227308ffd15793970870e309c38020a99083f882077551f02054b0a959c9a2a200c59437ec1386ef0dce1b43386b84e1a413867849c6c511c52621d0201260270ce1486dbbc51fa72a29c33786508e193c318dcca5d221c2f5b6cf45f19c2f270a884e021385d36d1af8a3385cb6c8a2d030dbc84e16a9b9b2500c5e5613857a6d911c2ba6f8081282c55c470abe14fc2826f6107a2811b4e04e13dc27040e7509379c270999bc89a804643691289a6c45f1d61189a5c2709309c24534288e111376533c887535ca4bd4437a67441c2102707d108e21192f9109b9419044707be0f2226e0881d103936f3f0c14e0f0d9b8470740936b82429b09c1c03bf924f0ef2d9483ba87749b40ba5521a670eb8490064d9c0936682110809c18491488e0c1c16c4705208de0008670509afe212f904e09dc134d1386d308705382504e09335cc34d000021c114d0211d90d1832cca4d6708d87824d6140582382084e077c0e26ac8ce06c1063f84e069c0cb81728dd213518270290bfc17f5af90c436264638147027e040d79c7b7146bc508cccd2859a0b31f738c701ee03bc06c6701908d76027dc50a6e14d829a8534330214b1ae9209a5a1380a04e02334744700ae010208681647101a6c2254c09c00de2288085642ecf058ce005bffb7fc0cdfe3bfc09f30cdfd907d844cf809bfa426fe8051600046358a09bf7f7ef6fdddfb862dccee98dfb7bf609658cdfadbf4f7e8efd099a73349ab51cdf9e9d5846fcd49a8237e5efc8df8c932828989af000270b0d04df84d55846fc16aa421aa798671cbe000486fbddf78d52066fbbdf741c00624ae0892ad899086a84611f0cc80012132d026fb609bece658086a72137d8efb0df5dbeab7d414df4dbe977d18c995291fc42d5709be837cfef9edf3bbe6f7cd6f9948d2837cb84df2c0d304350d083bb07748c50180234015800119be484b008df1d322df4d8c990e0870145800121be3026f8bdf157d94634f708359424c7e69ea277866f86774e2074604df0931e1a728cdeffbdf37bdef7adef1bddd2031cdeedbdd77ba4c68be9438c91389cdee7bdc77b7ef6cded6d2e007a800140c35c26f69ded1bd977b26f63dec28ebc6e892cb488eb0b6e862018d27015480f50000437b06f5ddeb9bd6d1cd94472e36804b00c98801261d0d747ba2337ab969b11bd5b7aaef5319bd406b092520002411ba849866d1e9a3c0c98641da44157d09bd3b7a6cc2a19bd2a5e0889851f50844c2309bd20b2f08983474a04345c09bd0c24c0868b0137a14c1298203119784de81bcfe6064c0821bcf9a2108de7a58a9ad50c2c501a680008cde761a3446f39687420656042c2c0d8846f37de6dbcd7799ef32de62195ce4bf22bee237985ef911bcbb7966f2b2bb04077b04de53bc944c08c97c3456444be0337a23792340e11bc884aa882048137906f1fbdc032f6f0497a8568c1f702d521bc6f78d22ba1815ec26f1697942205f0497932f219f50cde27bc477886f0fde1c5864035800141bc33785a35d182f40202008f192ef914588451213783ef06de0833780ef00ddfc3377d6ef967a0325d784ddeecf291388cddebbbcb77855cb212e841cc08dddbbbb02a20c9738125cda24816882d04809c009024026ee8ddcfbb98a7590ddc8cea4a73516821bb88a700dce19bb877704b89444aaefc34c184eea1111004ddb7bb6376bde9821bb5b76a0807e1125846ed3dda40314a4c90dda0ce2c46eccdd9423764a1f42afa3376384dd8d436046ec3bb602375fa5d211baef75c88043c0bc00008c96b8137590496b013758141811bab4272002300024375521ad112d490d008668a1375384dd4b174802a0023000253751eea111ba7c26e9e968621999040c6406280008cdd341374bcb3e10acec26e95dd292ce199110dd27ba455958c9664cc6446e90965a0f980009042a0f744422ec092caa59408dd192c965918cdd17ba201bb014a018e0004c6e87dd0dba0e58d75d229ba0026e7e092c5e58b2127192c4c20b0400022373d04dcf12c2c98a0cdcedb9d7739cafe0d3653738cafa25e6319660401cc1333584021e031c0008cdcdb2bd09720c95e32bbc46e6cdcd7b9a773420d1257863733863011b9965728d27192b8426e6395bf2b7a56ea0bb29b98426e5e086a8826e5bdcb02372b87c9101f1c3e30740192b3e565caca24c64372b057811b95772a328d19b94904308dca081e446e4e957d2af439910dc9a015001180012177f024ab70996000866e49dc90c9b410f02f0000263c8184dc8668acc1f8c955b77c446e4109b8f8c9988dc766831a210c9546c97044aa009b8e654d88dc6fb8d046e3354a823718ee30dc5fb8b832094dc59b8af7156e29dc51b89c30d1cdc472a1546e8cdc45b88770f8cdc3a1370d841b421253c843fe81370bee15dc29b84b708ee0f31b836535886423836441fcd09b82a5331fc619b81c28488dc0c2f40202002300025370104ee892c33700edfddbf9b7e98fa44ef31b7e36fa88949e7e35ad50c16e21034d84bb381085190a02932336f81f7b01ea000486ded09b7b25201f6919b7a98e908dbcf28e046de4946b28d2519ca315380618e284051e136f14a2e11b7776ee31bc19b76c2e9080d36136ec6dd6dbab288086dd349e0236e931a93e583250c0ff50af630f938aae07800a0000094634010f912da010c66c26dcddb9986b464a129423f05c66dc909520c2548008c63c26dc3db85b7076e06dbf52f461f6e849402136df6dbbdb73b6e36db9edf30c5cc26db6db6bb6cf6d86dae29b6b64f50a9919b6ab6d4eda8db4c436d104db43b6807838cdb3ec4f077d098b1006536ce49d193a174e8849cc3cf01a6c649ca09b6636cb083cda136c9ed923cc87980bcd14db21b63846d8c09b62f6c488937326e18890cdb1126c446d86db0bb6124d590db02136bf04daf8136bded7a1c86336bced7711b5cc3658893381187404dae5b5c0245818a0002536b5b0d111b5ab6b4ed68dace7770a28a4278e2186330c311261826d6209261026d611b6e236afed5ddab5b5676aa9da907e013a401180015125c426d540af0236a96d5192d0277400094da9f259846d4cda95b5276a46d4692b6c224e1d6a09be0438145800129b5136a16d4092a44369fed3eda7bb4e9834e53c301b2c26d37da6aa11866d33da65b4bc66d2eda5a330d2f910da5924fc405643ac2236946d27195833692b04b10c33c26d200874540c5000018744c26d1d87682368d04b9841368b4ec711b44826d1118a02181604f70a10e73a5f211b43b686c91d710c4368607cc1124602da08da1464cc4036b01ea000061ccf6efe236835cab10c03026d0392122ff45fd28f829241426d0109240c2157c055203d400090d9fe0d3046cfe5ff82367ec8fd396272b828c08f731b3eb67c375f19b3df67a88d9e013677c8f2100dec26cedd9d6236756ce9d9cc33672044f4815e04150f09b38b6706cded9b7b36646acb9739b35c26cd409b34a46788d9a0bf00448cb09b33b6669c3519b3336656cc9d991b31e45f98384c136626cc1d98122dd7cdb71231b2ff65e6cbbd975b2e765c25f238be3988a08098a1365aecb3d965b2c7657ecac30bdd304788d957226007a800120f564248963a502139684d94db292448af6520f54026ca209b284dda141311000b54a271b09b274dd2949919b2717a9083a501364caf4e0cee048c81b9209b259ea0081398326046c94d922236486c8f90e4336476c8dd91770a886c8ad911b21f6432f2929b21179308d907b20b640485f27125363faf1711b1f81b108d8f9b1ef63d2f0b12121500237800241b1e09ad88d8ef214873a8cd8e84d105e50cb7f81134c974e10bbe4208ba08bbd826c719088217771b004d0a3363704d8db20fd7721aee21b1ae41e887818d6a8231e409b1a01dc83b801ea0004a2edc5db04b7466c66906720c096590359012416883411b191bec08d8c5b1804482679bc2362eec5c9037206575c128f0fcc11f58aba45d6d914046c59d8b098dc66c559022201f384d8a21240504d89f0a484125309b12a401885d2a1362384d889b10f6208cd880ba2c447f909b0ef61d6c3934964361aec31d85a5c7c00014d852686446c2609b094d089a0e54cc4361247df340a33611c7ddb74a3361091c3111f60cf98833e467bd8968cd841b079726819600460004c6c1c4b7820cee84d8301360bec16d82bb04c86c12d823b043607ec0b29b02b604d2921b42423e004d80fb0163dca588018a5264c47b78f6d1ed42bd057829b00570d08d7fa112bb04d7f6150023780022014f4890a5f2191e9d88a08031611708ae0e11afe35fb996f3f80435fb6bf55c00323ce827b01ea000482dfc096dc824b84900246435f8994d101ba026befd7ddafb066beb2a4a235f4478e11af982192f5dc2239e004d7c8648446be3d7c4d69066be13226223c0043218123bedb62116d7c24778062e441c1b0800129af7b5ed0ef619af5c2476b0950046c1b0800129e9d826bd5d7a9af49e0d0c35285264200e1091d8826bcd091d716d403c005000004a2da409af281b10824a612da1845b38935046bc80316235e3987f11af175e1161900d60004a320809af00247476aa4235dfebbc111d0d25869d319aeeb5dcc74119aedd6b718285dc2435d925f211aebf5d7473819aeb0206770246216aaad501091d014f000019ae9c26ba508b50415608277212393c72211ae7f5cf6b9c8e3b6c2ca471a8e311c5cbca10d7376c0c4027409ae6638889dd0002435cb0e9a11ae535c8a41f1cfa6c900ee818a0002835c86b8b5a323238184d7131c0477e0c8dfd1bf414c00f50002535c3842e88135c2a3fc11ae1167d88d7031bb51f092cb21ae00bed88d6ffadfb5beeb7cd6f71b8d1e89c2e280e5c0478cd6ec8f084414109adcddb888ba08103208459b8135b781960046000486b6d09ea235b56b6811ad9e36408d6c81278122800120b3228d40d9d1b341a60a6b612d661f2119510d6bfad74446c08d7c2235e0450fe135aceb58d6ab1aba356f9f231ad4d1aa166919ad3822c9908b25826b4d46921bfc035800128ecc426b4ad68e235a2eb4310b21564186d008660000a6b42d683ad0359fac6f196a32c8011800149ace759c6b3658c44359a6b33d662335976b2cd652b125d7094d64d19b046b2458862359151501056dc61a88d63a1358e301e11ac6425ede09ac5e8a30845781358a6b132b20335880c0211ac3b586eb0b19ac2a324a2a019ac1f58188d605ac075806aff8c705357e227311abe025125083db826af3d5e42df066af0d5dfabb75766aea2918942034c09ab9d5ee08d5cdab9630f2bd729d6535726ae3d5bc3356eeadc57962c4fc9414578eff9046ad9578a530003d036100026356c6ad74eea335690422ae135682bb262ae335676acd0b323230204d596135656ac8d58fab1b56214573c122fd84d584062c46abfd57d17d4662a509aaf50f20828b21355deab911aadf55a3d5c19aac7557088bc968555b821b9143b3cf8c6aadd559aaab554eaa8d54a8691ff220d549683046aa109aa8354e08d537171d5a289a44b785354d6a96d52baa4b54814d51daa335450c1d34110a08406ec0528063800021aa1acf8088b4f169a2d22b0b21aa122d08404011e43540ea80d4ff167108f25d231a9ef53c88d4f1164846a75261e222c70473d21069384d4e7a9b7536458621a9a4212df0cee048c66a66d4cba98cd641055a41096109af0002322bec57cb38c3353004f511a97b52d888ae515becde8cd4b3a95846a548ad1159e2b2a0a428aac03df25bc19a94b528ea4f19a93955188d49b154092592480a8011bc0011cd497a92446a4709c0235236a452438486c0c594d484122a1848a84816446a3e54f8a9d4d0ea32a28a9d0202008f1914dc9658832661351d6a3811a8db51a6a33018e0004a6a2e08a944245298a50190466a2cd455a89c66a26d44ba89228f451ba00e63511ea21d441a87f50f45133ffc66f50395c09a87750e116f1845b426a1b8a17982c66a1a729c95f866a1922622a646450909141c26a17d42da8575096a1089ed76c0e44f589e6214fd8453f013506ea0b10a7c94f78466193040fcf90ca307e33504ea083f303227406bf33ba33502ea0311a80b5008aac19137443588d3fea760469fbd3f5a7e6267906c164e2580e69f5d3e9132626390d3e1a7bf4f729c020c714269ec081814269ead3d1a79e25b9089672880444b1896112b8669e65b58234f2e9e4d3c7a7894cc14894f64a83100c894d12884298d0829ce4af08d3ba2f284449609a7674ec44938924a5e8a2978083e807cfb07d02360d8400098d3a6134e969d10930334e869cf0c60334e769cbd393a7234e369c131a6ff4df447d19a6f054f08d373a6dc4294209a6ccf5308d362134d869afd35a334d597e811a6a87838852501223404d34fa6944034c09a68f4d0c45f1dbe4222e84d33a1189684d337a669486b88621a66148488d32fa65446993d3222074d04d31e134c584d31005140008c0a4010f40010c9a5a1073e9b2403ba062800094d308134c104d303a6018830cd2f81038a84d2f7a5e8729b54820789845f1d6119a5dc45d084ba4134ba6972885c322160408541221544298851109cf031488481221128c411107e20f441d8834434b809de11a5bf4b7696c1821002440f259620d6404d2d3a5a34b3b81f21a59b4b2e964d2c1a578a43fb87f076dcb5b8c35290fd82695cd2b5a5634ab10d2aae00c41da509a54e1f41d9a19a545bfd083b28134a7694cd297a5294362868081c0150011800151a51f4a30d231a3c07740c50001390f661ec43d519a5134a169403aa2591ca43d1509994f0643cf09a4f8243ca5076c7906069b08589034988f7190f1d41a05643ac24349c6936d269a4ca1de943a3a1349684d2541349469278fa23063584b0c61349184d241a4784691c09a46c8b788d234115846917d22da45748990d2200dcc4690f2b48201f8449611a43060b884fd4705040c132b2a3039a7b90d215a4241b10cd20c13482c38c101d982690117ce3a10668ffd1fc72bc6438509a3e747c68f787000e98a437f4f729edc668f3d1e254b0668f086e8221b90486dc134768416f813475e8ea4f4a54385b4814500027347304d1c89e741c6805400460004c436486c223471581a11a37f46f68dc86b70d64a14c8089e08268da082bb4576047d62ae4346c0da111a35834d88d1a90d391100c38581056c0ad720421f2021780230002734681c2011a334268cc1554d3dc668c85f2e2054c84d1861dd547c0c152c0dd80a500c700025219c1bff11a3053a88886690cc05430a85067660fcc68bed1782345dd7e911a2e219504ec00d60004a68b4086f6c0c58886461345968b0863c31397a72d11a2bb45668abd155df00a68a8089c7c268a72826220016a904e361345227174e266e652e8800131a28b450689fd13da26f44d430085fe9be00a2800159a2653799b7c018c719ca6898d12a21374cdfc36d52ce486890d11a23445e88a36ae33444c2e9271a312780462ae1344442e511a21b44242df85bd0b7474818d10213440687e4d5c9aa88687d36282343de87a4d243343ba68f106c08c1f88d0eba1d0d7f089586e85343942cb115e5823cfd090b1c2686f4cec21b84368141000260d7004d0d66b4896e8cd0d4211c42325f22099a42265e0839e4242ba0c8223431686110500004812bc08f37821ab9095e002685fd0bda17342de85929a162bbb0879a010d4a84186a13429684dd099a12f42494d08c1214904d086356046840090a22143d765190a166ca08d0781341c07140e2205f807a800130691c242780936192e908d06ba0ca1388c0dd01023780021109b82426c12c02159684d05ba0ad2f4002b00025035c15a411a0a02600e09a0974108884b0101ca84d04097412e619f921a0782681d236a2340de81911a06212788849c18d003d03610002512de04d02da057409e81284906724ae69cd01fa03b406e80c18885340484d011a01f402e804ae5653401c2350b2e33400c22f10960c26800cfff08a4cc60d550002633fe67fa84461314867f8cfed9fd33f881af01ea0004e255f4ab8131c0c590cfdf9fb4419530908512a906e81811c0267ec842308412a5844511ee633f504840e101f384cfc99f8529b19120cee048cc41fb6b320d2c0009032047da4441f60894a024cee01f003d400090cfb410182844a36f0a8272002300025082e84cfaf9f4f3e90edf219f473e788cf9d9f312798c3170120ef41dd06e6333e567c96ae2333e3c1d31093816d00883a107343baa8f8209d58267c5499c233e0e7bb1a4c008c00094cf7413a4011800120d54821868099ee125c5db01906d12580f9d074a09cc000980e00133dbe7b5cf68928c867b3cf6010524af10cf5e92496b40c1eb4133d667abcf4d0664245818a0002733d18406c4133d004cf36133cc97df11062a0c38eec1dd23140a4185ad3e2122997c312d4179c6ab14cf299e4f3c8e78fcf1a520be34fc45d8333c4c179119e15215854f043c0bc00009882e21121288fb01ea000486781cf019dfab4990cefa1c544677acef0233bb6775cee9054c86773cee45cd466770ad02233b7414c2fb6333b6e76c8291051eb3b30d7319dab3b4ace5199d98d6408cec99d844675e82788ebc6e892cb299d6f3ace758ceab9d4f3a8984717a558416a72d485690616a392e2233a8412e2d3c1e900629499319d3f3a6e74bce959d233a3e7460ed282092236c103a1022369099d082674146c02208e235d119d0339f84f519308c2673dce799cef39c6737ce6c8d00b27046f0004a119c8c9700023339884ce619cbc21c0cce599ca846728ce4c2207faee1119c97391e722ce404338fc0f81103dc64f036b01ea0004a671cce379c6a07740902903ac215f70958202671745f431dc27f809e011e6338aa2f5108bcc2671281bc23388670ece1b9c2f385670730d0302095509033c3e6080f908ca8440cc088b18240c6458222062a2bd2b38161c2c203d10996000906701ce00565c2b8856f2932625e504cdfc3008433ee12142337ee6fccdf08a7c01180013157a4266f7cdec8a58ab30bd692bc63379a35d102f40202008f199bc7377882a9412cc0a280012102af78208cddd9bb737666ebcdd39b98c33c5099b942bc08cdc7027a04ec09c81345337084cdc19b7e04b409581265336f66ddcdb99b6d11d8b2d10500005066d7cdac53806e710259610a6d82d903d60d3084085446488bca628c502956cc22229099b40576047d62ae4203ea775119b3d10e88cd9b9b33365e6cacd9301bcc406d099b1f363275c199b0c266bfcd7c87b46146808ae502405f099af335d0843af76c0466b8cd6e062800090cd6b9acd0e48ccd639ac12e90ccd5e66f4466ac66b42335504cd539aa202021af4358bb84c66a60886987a405643ac243352334510cd0c2403b06c4201b0010e05160004866a0745a21e9c84cd3d9a7734e669b43082580c08200900b599613bd13220314a4c98967c1159d84cd301334b669303ba06280009427081200d84803424bc4668d099a2c20e9a088504230cf09003826688cd0a233426683cd059a06001a12fdcfc7197a047ffe232814c00f5000251093071102fc03d400094ccf799e899704b3028a0004c6677088460cde006b00024333b66737fe63113884087011ff8a1051a4e31ff7bfed1199bc2069b08ffa507a8841e9b9bc43fe40999ac26669ccceff85fefb2c129999b332666218ff4869388418ecabbc940cccbe1077b04ccbb996846659654421fe187c846543105305b4115488232978abe2104e04cca4102c203d10996000886650cc9cfed104112460ec897c8e664a7f5a81e03a688f3299917e43887f4e13321bfa40996000883fa13a5021fcca05911542423f97345660fc606d8099901fc9204a0d9b0dd0a663dcc7998e866638086831a20a2eb00024331a04cc6447540ee818a000253317e62ecc5b98b3314e628cc4d9893311862051987f30e323719986426618cc2cfd886d090cc2811faf3f5da9cc33308e610cc1efd648660b099827302041f00460004a3f4f3f8b257863f4c17a2232ffe5fd1043e4265fa080f5403580001997e32fbe5f521ce9f00a65f47e8313bc63f3f21b03558665f00997bf2f608cbd6fcdcfc80ccbcefcbc465e67e56fca0fbe10cbc9978f2f165df207d9c210784a421904665db7e3896f0665d77e322c7860dce0997532e908cb9e132e765cd7e12332e665cbcb9597272e365c430fbedc7888cb84132e09f3310fbdc21f2c0997007fa857b19b73c265bd0996ef2dd65b6cb6440f7d8e5f0002332d7bede3de07bbc7cd8f9a094436ad029720996b051e849100460004a54730996a72d43ed171701b54a4c9862e6132d265a37d94fb1c1ef22ec30c5942546708fb10f620f4e9106432cf659dcb34301b984cb3396632cae593219641f5808a8a81189e0efa1316200c8658dcb10232c3bea3119615896883cf01a6c43e9e7d36232c26583cb0550fc865817d14fa1c6657fa87421f3f843c82065801180012195f32bde57a0e2a432ba84cae995c441e1a3c2c5cd463e6c86e8232b5172e10c39e212087cd0781043e6608f98df313e617cc0f97df2f1df40c60832b3e5647cae6b2081de21bcc0ca828c08f728997823e523bbaa2909e3907c9c11f2604cabc775040740de207742c5988cabb956cee28ccaae11f1f0daa0fcc11f58ab94caab95532a98f6e20f8e5f1c53fa199545f1abe34e9ce432a83e2f10f8b5f160e8418f8a426549099521f0cbe18a7d2432a212e410126026542ca7d94f06653b3a8810524af10ca7394db29a65335dc251f0404ca6394c03448cca5aded84652bca54c33c66527ca4d948c615f218fc0d84000903a12132908c7045ea33290651fca3a31ef704ca341328c05c5028a000486516ca28f769eecbdd839a63090965a032661328884ca20f739ee58c07153c532873772119437286650b2b004328404ca0c10e5b1cb4067660fc86502099404aa688a73610aa3843ac21327fe4fe3906bf74806c422ac0d2c000907b3e1327b48e11193cc0a1087b2ef650464f1c9e193bf27764edc9d6f62d5eca038afb350464e8c9ce70fd7dd222929939511008c9c5937ce130cc9bd937326de4d9c9af9350c64d2087004dff88c9a26ff52f90c28e0132673d681193317c08a7392bc41eb13d6137d05164864cac993823c61bde086f6c0c588c98b930c464c23a502139684c97e1260464bc0992ef25c887a9ef534464b8c96d92d4dd294992992cf2591b921992c04e60c981992b1e9e6c91184f68264abc9546e09bec10136426c0464a87a650378622ec08bcc023d2e36d52ce4664a2c9402324e845e4c1324d84c930709843d247a46f4846037309925026491c921922b24464877a28632431b27364807740c5000031920473a88c900f434d8baefe4d40062cc647dc8f791ea42310c8ef91db23ae474c8e66be17739cc8e591c04646fc8dd91b063cf86b5423234e468c8cef3ccd67778530f3bde76881bd613233646311918b230e460c8baf378a645bc8b22322c6457c8ad9155e6b1aa23025d826453a5ba217598479a013227e44ec89b4b5483cca09203023cc5099127223077551f043221842480132210520087a00088643fc87b1fe46643ac87390e321be434c867d014e6431c860121063ca30990bde4f9a1918684c01580011864cc2642dc85990ab2141a0634062044e642608472826425c8479085e4490c84018d003d036100025320fe41e8fa2308c884c8397fd843c8223022320b19cc3396126086414099047208640ec81b902d71518c81390204968cc80a1a680008c78d611e353c69e7b233201bc6310661c26401c8018ffa69690c7fa65bcfe00cc7f98fe71fc63f7c7ed8fd71f9e3f2c7de931f684c7d78fa820a495e205494263e8326621e1e192f5dc2331f2192732481a6081921098f84263df786eb750663dbc7b38f5c663d5784e231e9028c109440263cfc79cf0806103e0bce3558663c80284231e33c17114914263c45b58231e0e3c0c77b8ef31dd63b7000271e0084c7638ec31d763ad30e013b00358001411258263a9098e9b1d2a4b1198e931d1bbe677cbe940a63a130662290c04492211deebbda118e7422d5f08b56d23f038d00a8008c0009877a419dc0918cc7358e671cc3bcb2099782639648d2231caa463524e000486393c72406bc07a8000298e431c7e38dc7198e2f1c4e387c70d8e15697a8c7058e071bf178e0ade5264c637ac6f18ddb1ba10773e131b96371c6e0b46120a4496318db968988772e1c644636b098da4582880ff20a000008c480c131b32403118d94ba1a3fb1154119864c18 + +def cs_20 : Nat := + 0x19f233dec4b463c8823529be463c860818d003d036100024017a04790846549658c8fa211e41e41b117fd823c827902f1fc63c7ec824671171a1018881320784336211e3c1ff410f1d823c7478e4232032588018a526483c6ef5440f2014580012805d023c6c78d4f1a79ec9078ccf195e323c620ec251e2f845c1a000444d2d08b8202196f3f80231fd8432c6133c265800220b7f822dfc08551c263f4085c2823c4d0dd0231f784c7da11e228432781020c047886f109e20993320f0f96f1885bc210c90847875cee8c8a8c78711e0043c37786d8f6863595098f58c790820ba131e984c7a211e1218e0106361ff208a49e11e10bc1fc79230015800110f05c23c145b64216d6047ba2131df189f99aa31e073c0d78163291bad9a49ac1510863b7000220c3e8fc5117154263af08b62423bf908b61023bf8c74eb5f463548081260224b0d3a621df70f8f0906000883be78e8221df33be5f4a031df1bbe11060cc23bdf77bcef75dede39c77aeb57ce2d5c08ef51de808a416101a28477961132f047790d45c45b1908b5142008f085f7c23bc3018a526463bc1080d302350d08eefe391085a725f0476c07dd06960004c03d208eee2d8688776a11697842f40131c0042f24d3dc4637b098de42178551ee00046242808ee91dcf8877381d00434e908ee69dccd1e318903c23b97772d8dac63b93082c1423b91480c21684174e10ee3cba208771aee2ddc53b8959f651dc43b86770b8d856781477005c76370971a7fc8539ab0397011e30b88441a10edef1ac8876f4ede046355098d48b7c23bb188ee4223b708edbc23b6e59ac21db53b69693a31db28b0b053c000482ccd08ed8ddb13b5e598c41dad844722111c784a3485a90ad20c76ac5a70bca0c76a2ed3c43b4e769b46706168c08b2c022cae08d1d42633b081d6023b447684ed05da04bc128ecf9d9e84f5198cda8c5082cbc11a2f84592011d960498118cc023b28591020b25164710ec9423b247646ec8b19410763e11d8e847638ec65a210c762b6a8c416240d2623dc6561b0832d823b12a2ea21d873b0d195831d8584760e1510463150857f4646865418ebe023af675eaebd1d791075df458c43aeec61221d740475ca1117004c60811d6f04c60211d6d62f96030328a4036b01ea000483ad475a02161622ba10eb39d6588c5e211d64958010eb1dd633ac575898bb0a3ac2582a22e2a84c5cceae4aa4954600d60004c62e408ead4233d0098b78262dc08eaac23aa9a23cc55c63aa857db2e8c046802b00026112e047546896041509073021d50baa0753eea7483a9b29e90240662ce08ea59d4ae2c9184f1c22bd008ea395e58b13f25041d45ba8910ea1c207e7337a20a5e04750aaf004277508aee8c5f006b00024315f0429401315d0474f2e9e11020c74ea13156ba6b43e855f483a680887c42034508e99c29989c018e98ca340828cfc368462a50829dd9040828c0115c80474b83490412cb08e969d2c881118876023a56a1a221d2a818b10e94dd293a5174a0e93ca1fa5d238e930a1b19bc00d60000a3a491f0c2022999b000d6000483a45283e21d21841492bc310d904747e3d98414162826220016a90102211d1d3a3928143314484746f42a8dcc0397011e51d19de6a104fafa2f887462ad5043a2f745a215a604569411d1589b010862023a29744c26912de10744ae8910bd8c744211d0fd09d10e879d0d887434e865d0b8c742ce84c4088c74220f9c43a0e084dece0a0812541a6c4057a0af021d05ba0911899423a0608e805d0045a5198984239fb12c020202008f10cbd02507703162312d84423c9748439f173e0abf8639ef73dd41b4662530822611950873d6abcc439e873cd89386624c09417420146098924239dc73b021ceb0425ba1096d32c110e74f12188739401ac0008c09ea1156484c47c13c9404a0941311d04c4701311a84736a366834c0cf23c103e604c46213116127a101ef92de08c454122ad84554c11cd6125010e6a104088552c11cd1aa8f246e3310f399fc436e665ccc038331e40c23992731ee638202907318e629cc3aa69688451533044be41153184730114c44397f72fca9692e910239847284397c72f42152784bbc011cba8c7f10e5cdcb9500d18e5c5cb8396f72d6430ff8472cee59951b0c72c809c4461fb0817dc261f722e4206d0840fba0d2c0008cc3e61150eca7210e559ca8913418e52c5fd28f81987b82112a00d600046394608e50c479887280e4f8461e708e4f016b88c3c211c9c5db0101338231f9080a302393153f0230ed10db2e14330ec040dd011c97b92c72578748839293f2621c93e1cf11873421f7f08e4794ef889f9c11c8c72082102330e40463a8118e904722441ac10e028b000250cee8472202c784106520c40b546105c000223c940472180a30439057208e40dc809071fa3b7c438f9093ee8238f6087cfc27c2708e3cdc794faf535041c7700d50056000481f2c08e3a94ce888952130d838e510e38c261ad083f6e2521f12067660fca38e10986a02449a0808008c00090631e1069384c3447bd0438d108e33dc64a97418e31851e849100460004a38c4e3bc28d8375117229866820469098658238b9465c0004638b711e623c5304716611c58847160e2b67c58c71523d4034988f720e29dc53294b18091826188071621c52b8a462ae330c204713ee27149c8c71365fc44617e083c3c4d225bc18e25dc4b3893c2f84149184c2f411c483139105f3c24f5e08e235c46063018a44c261720985c02095508e2154848871041069384259610f338470f67980bcd0c70f2a3f64de8c70ec130b304c2c2102930470dc11c36049a5a11c353866118565c2e0870b4e16438a8c5a1c1025e84c2a6e1470a80c0dbc11c21b8419e7c31c20383f707a30693847076e0e4438347066e0c460e054ba421c17b82e619e31c1430cc10e0981a1b12d18e095c121ac818e089457087042e0800708c7038371b6b10c1b822c2c14f000120e0603fd88702a260441dc508e051c09a8991836ac2717d08e03cedd88701a365041db30b78586861db1083db4000881b10106c382f410e0142380308e009c00b7ff1835909658850f813091843b2813090046fe6dfc9bf5c3db2029a424efe08dfa539d88c22c11bf2046fc01c144025908a170680024500024142c846fa47544b238c6f9edf38ea68c6f9611be437c719a231be2b7c450783141cb5aa102dc4237be6f78a0d02b21d6128dee8b0d08016611bdc0caa1183fdbd99d2018dec9bd837af6f5cc108a60fa08de9b07b08c1e81030b00c5293231bd028151073ec2303208de6c237986f2c200ce0199000231bc9f12c0d303061b9cdf2e3e00048378e710c21bc58439b2113ff046f12de1dbc237814fe251ee884182e113f51c14109fa0237792b1221bb8b76d6ed9836c80be908dda9bb408395611bb0955d102f240f5834c198340eb0886eb1833041c9157fc21ba925f211b3ac2164708dd34222083904105c8843611e6305c7cf3e10dd2e1b7086e8a2df0460be0982ec2150116a621b9e15a410dcedb9d1c5c167e0610000984f2c113c8846e6a18757708c011e11b97372d160609d8139800130dcb2c080815dc70d44372538642305684c1541056c0ad720421f21195144edb22f8063800120dc79b8d9c20190d182371a44102305104381810e0402450002313ae046e20dc3c7f10c6e1c9d5842b9e0851d820a8e4ea02a2e199906228100c5000110dc285420158011e4304a370410dbf8070886df8dbedb7d1453201c70236f96dec1260608f708dbd0e94086de2dbb93940c6dd611b7377c0109c8827e5337644b2c67e51fca09c60dd18693028a0004e36df09f934236d608271422700625a2303c36d04df231b66846d9210dbc84fc8813f21861a11380427e426d7edafb03610c0d2109cd84fc838180426ce09f903f1ffe3ec0aeda70a26b009c26c28989af00004135504fc74da50d8a0cfc6bf8cff18604c21f8bb0248811203db40000c6d113754c99000121f89c43ea67963c843f12b6816d00d9f5b3e367b4cd00ca828c08f751f88bf101ab84b7843f0ecdba259633f0d7e1811f85cd57080319f85817e08fc27f84131d8cfc1df833f05fe09201eac6ba3dd11898a42480a08d96db2d77681980a827e0408ba542364e0848fc0ac008f19367027e00fbfed91300f906c7c13efee0189b0c9748836376c6c5c2867dfb0897c827df6fbe847c867df2fbdc212ef840d3613ef6057810d88865988fbd213ef425d2115d2827de509f78effeb6116c206788a7de16c1223eeeb60510d811b0108fbb209ec07a800121f762ff908bfde1783b940cfbabf7481f702d521f73827dccfb9695f867dc909f71827dc4031621aea35d211f70e694161a18959c24d2608d73669188fb82d71047dc0fb7823edd7db6bf96d6bdad70b7431f6cfed935a619f6c3ed783a1212e9748a35a08f0021acf13e6117f0427da9357a21ac904fb4ff69528b0c051e11ac6358b6afad5f1abdb5790e8073ed1315711f67c07088fb3c93a4c5380c529325266c04313c11ab7878c11f677ece7d9bfb341dd547c184eac13ecbb5626ac033eca7d9330fe33ec97d8ffb1b125883553bf2e92e2ed8106a941c280a500c7000251aa3b5460e0030c29d3e911f611a9d9838143b3cf8a353908d4e020a495e18d4d826fac6a5ed4b9a96b52c6a54d4a5240a048fe13ebd84faf21123484faedf5d7b590c1df813eb884bee013eb87d6f4be431a842b2d10911c27d6b08d401a7fb4fc45d840bcd0469f6d3dc40d65081e3c25f5f51f021dd38469ded3b9a76874021f599a73569319f594730085a2613eb134e169bed37946e9469b8d36efa8b4d520d34da6888fac011a62f68e11f578234bd6978d2eefa390697213ead0469608f111e10cbe7ed2a5a536761217cf11d616dd0c4041a4e84474e10b6a04474811a4c34951036ac27d52987435d1ee890690e35c02c203d109960008c7d4d690d7cb9a3f90fa99f52fea57d48fa8ff517ea2346f68da59e469c3208608d802346b984e23ea10468cab26068addb021f501a31b46168be43e9f04fa7ad15d6440c981e8cccb2086d5293253e9b84981013e9884fa61f4bbe96fd2b20d0e1a1bb436686b7bfca7d2609f497e9122fa18ee13fc04f008f38d09a2bc88bdeb03784341e683821a0d34196830d05c62b8db730181424be1682719b0619bd08d041a0708681ad01ef728c0f908ca845ee209f4799fe33fb75a042f6c057b10565c2b8856f293243e8cfd1510cfa8233e967d0cf9ef6790978a119f1161a108a58ab30bd692bc42f658467ba8a3caab84df0dd050aab155309960000833da67b09f0067d0ffa1a23e85d12511f41fe82089748119de839c06c2000480398097ac427d0167630240633af675cceb59d5dea2446c4f1ce7cfa673e23e7b84971288955df869820ce619cb8adb186a40a5712cb11f3d3e7908f9de2ad82c203d109960008c7ce7f9cb7a3c67ce3f9c223e6ed0d709c8008c0009466e4cdc59b8336f96d087490e81cf9b850f8425d209f36825e7608cd4af38b34f669ccd350d30f480ac8758523347668a23e6a7cd211f346f3393e619f342f3113d54df243e67b33066584ef44c880c529327259f04f99213e63b323664033e637cc3f9808bb080589018a050400090bc9415dc035800121f2f3e5dfcb9f971f2d4a7cb3560a23e588b0400023099704b311ee32aa504f95a13e549313028a00048089a08cb7196db2d82608050400098f94ff29be520c25e611966b2ca25da32f1020ee4ba431963a0eb11f287e4e886572cadc3180cf93410693002300003257084656154c847c98f92e82ec67c9409f24be4808f91f782c466520816101e884cb00044093184f916ca41947b28d20ca2423288650c21942b2846506ca0487c8964f820398800111f21027c8209f20027c7f016621937b26cbbe8432083268144420369843810fe4027c7d084b2c27c7af8f2a9986325c09f1d827c7309778027c6708468427c6409f18824a880818682323e09f17027c5a646e2024c04f8b1f1584322f1b422253c3228644f77248322309f155fac88643ec87aee18c225e12edf320d3f9a31905b208102f5c211080976e19025db61843f0f1c08f8a2fd1447c4ff89c344c67c4df899f12be2410f88e1a6c47c43bb34218ed037206d603d400094948213e1efc3c63a8318e904a956118e7dd8d6398373887c3620ba23e1a834c10c71d8e288f867f0c445d8715ee25c000090f85ec6e022b0cf857f0a447c2709f0998d231a3634042eb904f838623847c170975b18cab18f18c6387db802b0002418c504f8277590431853de423dc67c0f08c5fc27c0df818c5a867c0562ce2035504f80413e007bfc11efebdfcb15518a5004e60c9819efd6ea4314e6298c5218a3a92b39efd3df908f7dfefb989ab1322174e827beb6256c4a58943126624ac48c693a06240c4744311c3cb6d3dc6311b6234c46588b6d8929efabdf4b11219ef964d88862160bf047be4f7c2c3e467bdd61e4390c67bdcba2c23ded7bd9f7a7ef43de71461a21186784f795ef27de47bc7f78def17de01c61785b4477b0cf776260445cff09eee5f1e08f77173e847bb7f76deed061daa09eec82496813ba000467baef75223dd284611210eb504df0dd033dd084f740df604307b60f4c1dd83b5ce0294f8827b9e60d621834e53c11736827b9c088c882163109734982fa83c19ee642305a09ee5c23050609c23dca04609613dc93041876833dc604f70ec0c841cf608c0c02302e60582181585dd03740d840009439ce97c84302808c09d8128c3518c08c81208f709ee092780c39a630909658cf6f87324e63158f018e0004c5ca809edd5801854008de0004a7b72080d2c00088f6e0bff474180f5000252e4e04f6d8bfd97fa2ff35fe253db57b6811ed97db204a501640004a2fe61aac23db0dc8d11722822fdd09ed7bdaefb5cf6b7ed63dabfb5538bf457e7950116a64246c840a88117e48b4927cc33da8fb4f11b35025c7809ed37da588f68e106d084f686bec0e168ad815ae40843e4232a40beb57d62fabe90c43da12fa610be917d11c1419ed013ae085f2e13d9e04b8b4062c42f8b9c7e2386d04f66d715447b34f664bde067b30f65becaae23488f465e617b284f653eca2f3b0c3768504c44002d521ec9bd925c3e5ea440e940490fe13d9004b86e13d8e84f63613d8caf3b5e6a32e1504f630bcb8db58cf62ebcac426df08fac55c62f285e4c2324d8490c43b119118cf62212e0c841d781178b84b82a101b1045e2612e0784b81813d8488fd02b0023c8531409ec1fd835c0019ec0827aff08bbc577810c819ebd57749af71a4c008c000985dcc05040000cf5e1ebbc43ba5f220bb805b8885dbd6fa576d5be72037ac212cb09ebabd74fae719eb8fd717ae0903c6ab840198f5b81175cdbd85d6cbad2deaaeaeeee073d6cfad8f5afeb4c13a140f2215bca4c8cb79813d68fad05d2a31b2704f59cba3d746874021eb1c27ac6349a20d2584f587eb0a3f6807a06c20004c2e7a0906000862e7809eaf9e5009601868c0d1686d72e4043d5e057810681422e615cbeb9700638001296e9422e580cdcc55c62e57a55621729ae51116e7822e50790c21725db9a10b921723ae460c4041722061b45d6000487ab4f56023d57ae310d3030cd88439c012dc384f54e1171105870b080f44265800231ea881e4028b00024034d845c3e9604a4c8cf53e95e847a9c08569022e165c2ab851709947029ea6fd4d7a99f52e41701ae015bfeb7f087a9408b7d8087028b00004023804f524123ca042b2176782c8041492bc20a9284f51e135f304f518649cc92069820b7801df827a04ee0004a7a8a322623d43fa84f50733b807c00f5000270d5e84f501496c43c2b09e9f024770083bd82028f096d50c6c3fe419091027a76083b7c25b4f783430d467a73f4def74462da909e9ac2036100022092984f4ce116cb84f4c9e9844187e0a4010f4001105b1e0ca00ee818a00025053d37d8116ce63a4187009d801ac00098f4b9e96847a59f4a823d297a5011e9396b35b2418b5856b02d5b48fc0e3402a0023000283d252d565aaab54086ba908c45027a475a8e23d237a45f481e8fd69da5f2316c4022d33b61a22d8584f47c5e8047a3c5a56705067a3908b4a0bc617891d3c2a64a7a375a4ab49147c10774e13d1afa33101d0027a2f09e8aed7b88c6d613d14ad0e102c1427a285a0cb4156822d0182a663d1304f44613d0e8425e612370971a7fc830b8c30dd11e85fd0a0df0188f0822ce359c45bdc32407cb06960004e7a10f419e82966b10b5a0111d384f4068e44479fc59767050646bc08b2e165bc6b646ea41da404b58013cfa84f3e9e7c8479f009e7bd64ea3542cd24164dac9a592c33cf6f9e8591ab220879e62c8e22d55e32a116aa0279e47628d6a40158001296a8c279e0096a70279def3bab191631ac6029e76c25a9109e769628ac509d8e43ceb045892eb84479d209e747ce7f9cd587b1990a388609e72822c331eda0004679c509451822c30585e15ec62c29259623ce1f9c111e6fc279bb08b064292875419e6ebcdc08f36de6cad318c8c6610a9708f711abe0279ac1edc211338457e8105be0457e518b0479aaf3505690679a409e68bccff99c19e66fccd3a90164e2580a7999579aaf255e35a4315d811f58aba044462b9d8968cf32968f15d9315721e63c22ba95750ae995d2aba25743ab10e2b9e09e6280c588573087b44798774bc23cc15a2a03ba06280009428a8135415480f5000053cbef97cf2f7e5e2d0e14b42e13cba5a1156d0ad964709407bc8bb0414096b54215b12b6156c0ad7af3514f2e2115a8c0901168182218b0826c02796c0813fc04f008f19e5abcb3f966567aaceca7965f2c9e58fcb03a152916dc245b407ce215910426f813cae84f2b41074d04f2afe55443d1409e54bca8ab0cdd0043ca7794c11e52bca47946b3c443ca1f94111e4f8259da09e4ebc9c887b2fb64157704b3a623dc4793725ce2156faadd55b9672d56b94f26be4d156820d1257853c9884256a0bc4015800121e4b82792df2562040584aa6413c937924557a25d88792209e4846cd069819e4782791cf23740f067919f229e447c85903496115408424301090b92123ac233c8304b33e13c818454fb6674479024be42153184f1fd14c44068a927a23c7e04d45c13c7d39771177802064109e3e3c7aa5bc19e3c9522088a3e13c78f8ee116604278eb09e3a4259790845c8259760965cc278e6b2d2a86550c2a17542ca855ca320f1ca23cc478e20965800f5834c187ee4278de89e623c6d29f989de314faa9f453e4a7c54f729ed53d8a7ad4f544e7501b00244e409e35c203c005000004678d410d62084f04f1a3e33c429d609e33883c25210c8243c66594611e32bc63792818a7101a608538013c62828c1164ec239010912e82096d0912dc2593471e2232e104f180b6b0429a5157206bc07a80012964b82299808a656c95299189487c4819d983f3912882298d09e2f7c5d88f171e2d14bd0c52f013c5978af11e2bbc55619a19122023a4609644820f770810d0278a609e290278a008a5602789b52a023c4d7895f129e24d49f1ea301ea000503eb3085fd822937526c5fc4609b008a4cc2789152562149529281111a0258f809e22c2788af113117c76f90f10aa435486290b521563b0c387e09e1f4258e809e1e3c3b9e4d0a6e0a780009851eb11344787509e1cc20e7908a3ac39f800119e1bc2786bf0d5e19860e536a9020f1308be3ac23146e58d210a360258d008a35546a442c1810a418f802300024279e04f0c013c2f785d3c0c33c2d84518810f00849e66114600e054ba43220d04f0ac27740008c517612c601dee2af80aa407a800130c33027852259623c2671911162e02784bb16623c2428a0513ea27b4af14f08ec2c44784509e104202f409a5582288908e00c20d7645d820ed18451041143f8450fca1f04783a09a52021d7309625422861081880237e409e0d2e7188b1161142784f065e0c6c418c5092750035f99dd21e0bbc16f82bf0533b78a78270961cc27825f045e081412e52329e06d40e0c6b18a068631a2eb000243c0cf818f02a3140485d211e0382780c08e2182439a4ffab8a86780809615420373089fdac2808f00a13c02036211e00d3f1a7e2b0870e30a27d917debffc6583f09e0093e927d14fa160eca78014f8020aa384b06a113dca7b71097c8277fd4f629ec13d79c7f289eba1b908eff9dfe8477f809ed54277f409dfc93cdb738168e3260a27994f28112407a800129dfb42581609dfabbf388b020103180415da2bb023eb15721df8d3bd372119df8434c08efbe9dcd3b90ad815ae40843e4042f00460005477db09df64277d84ec62110404efabdf50e048c4eb813be8041fc413be777cdef9633be404afde2a100ac008f2005542274ae1b210cc000904e909d1e1958c259613be250d8110c9539ba7364e6a9cd1399814639df0fbe157e118dbac2272509df002272209def938f88376400ac0008cef79deefbdc8cef6fded4477b4ef669bf937e864b289be00a2800019debe8b4084de0db0c9658c27881137726ed4dd631374cdfc36d52ce4842f14dc89b6abdb90ef547098477a808250896588ef4a1385403f0892c33bd104ef43de83bcf0c153c13bce779bef2833bc99b0911de382418002189a4134406d818055421aff089a14242cd090b2c25796095e5027787086b4896e884cdac55c40df706d20150011800128bb4c20847108c97c86778209de0020320086b002777d08f378226564caa994c070901b9c13bbdd77b106ab840188eef3dddc402fc081f6c1a00184000243bbaa63911ddbfbb7776d901441312365911dda7bb3c28b247e056004798eec213baf84eeb9dd684260c24509cec67756eeabdd53ba99a4601ea0004e25ff4bfc68fc60490024620b850484e6112fc06e811dd38202fc09dd302774809dd1612d8125024643b9ff73eae9433b9da5ca11dce3b9888ae8013b98573a4b549018819c92b9a2024c04ee5fdca84772809dc9fb90a58fae4a43b8ff71b1095e12bb082b4813b8c818b1066082197e09dc4d2b3884acc65ac2720023000253b884d1f035e03d4000944abe9570263818b215c4022dfc08551c225594aaa5c286255408de00086770809dc1427704788a212a26fff62ae3268804edfd5c04403e321560f7917610edf613b7d76f910c83129b253583f24f98856f983ec23b7b76f311dbbbb76f6ea19dba2b72880e801127984316e0bc40158cedc7db892778141000250015800111db792735fab19db6c256d149ac1510676daedb3071c624cf02aa23b6bd6c911db5925c88497092de0da24b0d3a653b679853a7d231256a4a7494a3265a04835c120d604ed93db1c424925ad0207ad04491e1a8c476c4ad64237d18430263d052e90c48fe13b6076bc1091ccbffb12d19dae4276b7088620276b408023c217df09dac8241871dd83ba4628107fc813b5876ad2f823b603ee834b000073b562442488290fda8094ed52d3f121be787486305e4c76a70905c4276a5082f0c2769ded33da60ba7104806111ffa3fe69a2320a98447e88fbcb9a8c47d813b48567e05ca0528063800131da382768a085c8027687028423b4204ed048f1d6728ced03d9fc4767eecfa8ecd1d92cd628d2802767cecf423b3cf678acba31a46a38e080e06580118000308e34b5396a42b4840b51c97111d9cc6ba88470c35c02c203d109960008c767246ea23b37766cecd433b34f66711d9946960404011e411ad0446af58e8416630996000464c1e0958d42766009d97519d0859101119b0446688cccb2086d502820004c7658465a8cb11951068943358202008f21040c22322095890203e7081ba025620096a8c2764fec9dd934b06315729d93003580011903cc20c9509583064408ac1012b02a2f511d925178a2ef45dc8bac0009868381117422e7abf633b23a2e275c233b2104ec82e21841024088b3d16740cc188b182763cec768af4ace05870b080f442658002488ae827638ec6bd8cfb17f62eec5a8a5eaf08bd00808023d6228f2aae137c374102aac554c265800221d8a0aa504b311ee41143d5d9115758240a644ee432067627ec4a2113604ec44897a5d20cec41d87c1cb808f2157202761c09d8642761709d856adf223b447488e2add98ec29d84fb0976102102002760b444aaefc34c104444172413b80012052bc2221e80ec8854676070888381f8449619d81422207440dbb386406d088804a44148550f8410ff21fc43f687e55cf1443e855f4476010887b42559809d7f50efa73b19d7efafc88ebe8126042b7d0887242558e08870d0e0a1c066b886f19ad18cd541202204ebde13af6d58311d7aeabab33e18864d0c8218f431b00cca75e6dd3423af193b004f603d400094ebc085b10b5556621d77baeea154aac2410a74b28115570275dbebb2210a0213f427b67c083d1409d7582555409d748275d1424e23ae6554c42455528875ca09d720275c521902013b800110ffcc2210d08702196c888d0d7e67748210542095508675c2eb8283d4620f4dcde23aded53911d6ebadcf5b841c2ff65067a0cd4198ff4906420c7655c8302a9938417c82f505d8ceb6e8295051b297413c8270c551d412c1e78e0a10eb65d6b0475a8eb4fd688675a0eb3f542c6205740a0acb4611f7088139fc9880da610e04759d0953fc2203d3418d10867599eb31d6406758e09d634cf988eb16fde10113f75403a807017a1ceb11d61842014f1dc23ac1f582eb0030ffd916f107fe4ffb19b119d5ebabcf578259642a6f9fe83fc43039a7b94dc1e13aba9fda642a55f015480f5000271907818b115354fe40bd7187f164af08220813ab8f56feadd5324268819c033200050756b08551c27566eaca43606ab10eac2102330c970002332f60463d47e5df9b0ceab8fca4fbf8ceaafd55aa5c0c3ee213aaa54b2107da421f670841e129086411952b4254ab09d53baa60b1e19d52faa57548180a3c2549f087d42a4e083e927d1c405d2095260fa117201952572e108ea8810f981f2e7ba230f96b1a510628827542c35a2002a0023000230c46a5f210fb9f6e488a90613a9f753d7dc2332d804a8f413a9d7539ea6c33a991ee43dc460fc8753071701b54a4c9062e612a3704ea59d4afa931d28207af054f08ea45d4841b98c7d7010f55029e11d482a2e08ea3c118a2a92d00d6000483eaf525022a2982a901ea00048313c3d1615f461e8a626e224e9843d027a0003d0361000251899047d4610f3d834111d454f38d4433cdcfa58f2f543f38fa30f281e4f622843a8984ea25d43ea1b88dc00560004c750eea1a78c46071508c3fc230f83c4550bc6750b08de00086542b09d427a82972e18c39e21208519213a817501e9fd5070874fde9f819dc09190e9f211f2d04e9efd3d9f280ce9e4f930474ef2da23bd860dbb09d3b4ee3898118771421dc43b86f8f8ee01dbe3b7b5000ed8a0e9d4c2a441dad3b58038461da907e112586497109d39c21d9f09d398ecb9d963b2841f17846128124b304a7dcf88a77f0c1a4e11f0f04df0dd033a711d643ac67584874e13abf4f958388cf86264629f1045910118358402aa13a7074dc3a7e74f8b1894a7ac74e1f040ce9b41034484e9b0749c3420245000251827047c0213a69f4ce107422e61083a08740ce800616018a5264c74ca09d327a6474c418c07821cd639abe020674c349e023a609cce399a3058bca14382813a5ff4bee974302a0046f000430abe84a74a13a5a74b37b6430aa684e95e10eb084a72c3558474ace95423a5404e94810e3aaee111d280e39149919d273a4df498194e105a508e92c115ec84e92613a470af904761bd01a5800131d2369bb88e919d22ba44f48621d21496588a6e2be80bca0ce905d203a3f9bfd4be453a3e04 + +def cs_21 : Nat := + 0x4df60937bc4a112cb1937bb85508e14c11b51046d4011e89820d005600048369c089ac02709c0937a66f388e12f125844de44d40062c64de24d3622f8eb0904d2e1384984e120126ef0e2a11377024dda0920e024dd3e102c55c60df808bb4c20847108c06700cc8001293728320886ce620a44707909370824dc0e0ee226dccdb71136d26d687b207e11258a429b080f9c2126a0898a03cb87950f28d3dca36580f1ca1f06776808358024da308d94c24da234d0226cf123d11366c8838361000241305849b26981c44d8f5d042382986ff00d6000084d8724101bd01a58001281248206f26c6509c4606e80936080dd03610002426bf844be41017e049afa689c369843700025382504e090126ba86981135acd02889ad2975844d659ac7c0f48dd900cc667cc4703933dec4b4668190814a0225c3093563819889aa610167049aa0112d6828b00023025e849a913516b9a8c095211afa846be61340484e04c126a135e810d78a11999a507e11258a4d410d36202bd057811c06c24d36091eb824d34fb8c2029a8534bfc232697cd2d1134a52b3884aca11ae604bfb6112ae849a3a112aa970a10d6fc23780021811a8233889a3005d044d16218621e22849a26d6e040b7f093438203e7080d78203e321560f791761016e812684849a04644833b8123211dfc0fc8145000240c860499f6d66c441f4089203d4000904a501267b6fe6051e32676b58a10634424ceb08d5e824ce70862e0218b409bf6266e6fd499b0437e90450f811ab60499a7334a6688d58209d58224d600d60004624d409bf266654cc930fc148021e800138b64024cc62c3421aac046aac12661c49611330265f08497013440ce0199000252fca84997a1260424b10932ea65ca4ab626441aa11847c33431251846a7e927c44cb29962d4e4618330932b9a9b08df5a10351844918112458f51115ac826fa30932a66544ca7994a41a9091c00002320cb049944c450417ff625a23b5c841cf21264e6f9711325c77e08992d3254be68c9927be412f90c991a117844c8b9914d40c66f8c08038426f89093205a7b8898ff31f9a7a89de20d3cd47c08774e1074604df041d0044c7869ca237be8e6010903c204d209bde42415e08a3742027c08d36825f520931a66345f4a1c6489c4a4c650931880d780f50002437b70402841262e0498b4c35c434b559cec55c66f6698a08eec64c4e088ed566e08dec411a51046940111d6849895bd7c4566308d25424c441b52226214c401130f11c288986e0f380c500012130d9a4234811930d661a23751930cef9488986530c4abe8c0ecc137a5a3680e9a23cc84c2b46c02039d0498513099a320cde8e1260dcc1a9833305c841100803d824c14de82226094c11465e32f89a32a10d12c24c0c9810217708468841118d042c54d6a844c05de7422601cc02687274a084c012c2c0d886230bd262225fd0497f0108da84fa4c11d7e0497e72fca5f84bef45f431dc27f809e011e925f66f2d108bb02341c092fa077b0897cfbc965f24be1a2b2525f04bdf1880325eecbdb112f68812080f98125eba2cd603c325eb5ede112f525e895a0192f3cace05870b080f442658002392f365e622b718cfd0240be092f265e422a718cfa52f90867cc119f2956d11e63114c84b8aa10b0d0467be1039d04977e2f40202008f212efa5dea28918552c227c008cf58208ba092edc26efe092ed024bb297632ebc633cd092ebb77a089752cf08a8a069821bbbc255cb092e865d0409a19bbac2054408893024b9b44902d105a0901380125cc94f1112e5c233ac0853ac214e908cea4a7351681888d89e38829c2125c7cb8cf9ee325c594b210888026ed9970623e790422ae125c0de96108834203f0892c225be844410125bd8ff711bb3824b7996ef2dd99c19043e855f446ec7092dc2f438896db2db2f408c96d7baf8425d208871024b5f0706225ae0496b52d6040f6a0828481ff020f01ea0004a6eae08204424b5396a52d419a290969d2d36f350c56b0101b104969379944333b13720ccc0a2800129ba7423337430c225a113c710ccbc2332d092cf822175084ec4213ae092ce10b6096c62644199004565a12599cb32bca2301f702d5112cb824b2c96572ca998610964d2c949bb0c80241374405491084f826e840a4010f40009065f81258e4b19dcfc3258bcb16424e3258a0b0511b9e6587cb0d307e42585cb0911343373a0496052bfc44afe0d34000460698092bea57cb2cc192bde57b01d218ab8824af495e52bc59621095dd2bb556a8c3590125754ae825724f1c8063009671824ae595c72b84632af092b7e56f4add41764373084dcbc1256dee5a11b960207cc092b465684acf95972b2a564a0940d30802bc044120125630424ae1194484553412561328540fa3255fb281112afa55ecabc95772ae655c4ab7956cc9cd26e4709b91424ab164d6814159690345660fc44aad9559b9025544aa7259660c9984cc7011fc40495472a8901a8c953d98c044a9b092a6654bf58e18a95024a9408c92824a939524190460c7e06c2000464a90f8c822547919205aa33712918e0046000484a87950d2a1546e90646e1024c049504801444a7fdc362253dca7822ca30ffa0494ecc88c432210929c5fac88cc161190e84dc1e125374a6d94d6325354a683f944440b0d1494cd29948840c92bc10fe18494c3b80a52eedffbb60502670494b07ebd4fd8c94aa118fa1faa10c7c886c0d5619b7d424a5116e2225274a4d9497b7bc84a46dbda225208494807da444a3f063c18f407c00f500026251e4a3b9474c73859014946c1251aca34946728c458694638a1014784dbc2136ef847e12118df049457b76844a2902e82251429af105c8024a25f84e20f9c84943c112780494361250d4a183144336e7846340118ce84633611c728471c6130d684942528465086dc921520c24a0c9416349c6318c092826503ca0630b842501ca0111b6f24fd08db74124fb1ee2307e3036c043dbe118b98401f003d40008c62dc136d8b167100f791760893dcc59034a8cdb58124f5038b11279c2315962ae218aa84db4a3c7c3a980012127764ed88628e3c304ce84ec00d60004c0f07097508249d9db36224e8c9d0939d2731895142f6e1189384db2c124e20d271079a5c3f08938527076c70cdb1810bc104937526e64dc49b7936852e9484935c1017e043c76118849e3611b60426d7e09269987c049a01ea0004a30f408120c00108934611c046d747cda2187684933d26704499bdae2236b784932526458688c06ec052806380012174242498c09b5964c40de159b602c80009851484f1c430c66186224c3ed6211261585d1dc91836dc26d5e09b56ee7e0892f5b56046d5592e65a84630a53b3c05c40009092dcc278407860925a426d4e0876142496450da224b08492bc136a3849dfc124adb0891125664abdce319b50423078094436ac6495325c82007b0460e233e18990cda7525343658cda6c129ed8492908c8846d310874e8202c608a0f02305d09250582c96240d2623dca493f081590eb088927a10e951d281032b02493a926ec12c605490924d4e8b083a2612498e523110ed026d1a0924b981d1d000c2c0314a4c98925b24b2495492960605062804924b24924911ce508ac50e7199b000d600048491d710c202e0043700023248cc9180b683368484922456904301309243c25cab09243060382450002424848bfd17f4a3e08158309b404249042afa22480834c10bffc22ffc083a10248fd91f923ece561ca521fc6247d155d1123e647bdc951923db677085fca12478dc8f11b3ac274aa0923b2475c8ea91d1b38c356985fa61247048df16caff9086cdf09237246c88d9b410a7d8491ab2e5c448d338a0103802a0023000260e268bca10711c2061d5dc22246714ca10bef076f880c601246548c91b4232463049188117d81c2d15b02b5c81087c8465470e1484294c1245eecc310705d104085f400f380c500012122dd7cdb71219b2f64598a9919934822b9e0922bd3a88807a4117c731141122aa454ce3f1922a17c388d9601365704914722857ba608f21b2a822f71a6ae21eac84d95010de60491286f213940c6dd612448c88e7aa033651041ed410dda141311000b548271b09b274dd2949919220c24882910321fc62f4f0921f764a8890f63cb04487a90efb244613da08f4e42487208df60248705e6edb0c965905e6a12e150490d8262c4018c36d52ce44486a0921a643448672f7e4179304c93612432532410f4842485fb8322075e045e2e12e0a8406c41178984b81e1363c8490b4bc29e8a0c90adb1d8448524d54236398426882f284484e4d325d386484b977622424c848908c32422aeee5dd832421c842908222298ab94907ebb9133e0c907d20f641e483b907520e0c03b9077003d400090906c4b644483390604b2c6482e905b20b3631906fb01176304d8c0124134825b7b832410685911206e40caeb825204240c3cd011b15c24815902622408849021b14440d6809b1382480724a62174c04b790124016c471048f422612091ff9747085d1a1d0042e8b08695821a552cd0008c000101a3e1361b9a4d111fcf61986f0337a4361804d85c1173786c20d7e0bc4015800130686426c26081ad421a11341ca998647e0091f7e3ef5baa191f748e5084058123ecc7d80cc2067c0358001311f5b60f88235411e430423341017a0433ba1360c0418d6123e704059c136098433a410ce7848f92123e3c7c411b02c20c440866f4252921b42223e0048f7c66c446c04091ee48a1888f6f1eda3da857a0af0523d999954afc323d8ebfd1095d48e00001191eb23d5854008de0008a1987091e9c1a288098a123d2cd2d10b82021970080bb4247a278aa223d02dfe111e735f9088f366534406e80811c022df121a0591c66bec09afa8247933270223c7048f18b794447895bc2223c38695106474235a408b768247828f0021297848efb1df23bc8cd7be135ee47738ee03077b04d7ae123b584a9111da84b688d7a6116de048ecb1d900708c8ec4123b0475d8eb91d6e3acc75806c470929848ead1d556cb8c0316135e3048ea0b63c19401dd03140004c6bc308c8202474a8e8ed54866bbe09aef02474577dc3e3c24180022892942474109aed2d95885adc60a17708c8e761a981a580012097c821821df5020556048e731cde39b0679211cd2398eba719ae9422d4105582239447278e443169d048e416c4043e9b091c7638e471a8e311c5cbca180f381238a47131aca335cb842b0e12386a8f811ae4822d1e01f003d400090d71c12381848e051c0477e0c8dfd1bf637e6b87203924248802300024237a0447f622a82330c970002535c151d3111bbc668888dda8f840158001208f781ef22ec191ba443c086b541167804077410979848dc71b811e78cd6e821192f90c8db31b5d6713b7320edc4246d38da51b44b751012c012367c6ce09ea30b71a3ac2dba1880846cb6934235b3048d9012363041b56123622cc3111b08b5916af384c416602cbd111b0235fc6bc191ae82b7949919ad5965616822afa4235923660a4010f4001148d5d1ab51b00cd6a213d4446a8d69c22353c6a6b56831a2f848d4bad24446a28d428cd86469e8d3ab2156418cde291a709c20807ce1359ed61b111a442081109acdc26b35091a2963008fa4c13598848d0b1a004467e8cf02233a79d61119bd16f088cd8123354669d641454885150091996331c6628cc04232f465d8cb97b788465909195a32aac2f0af643589042b2011612048c9d69d045a72091936325b3ea191926323eb05582255a1904188c88b034446400944bc2463c0918d913d88d5f6123196af70848107c01180013089a8203880889998ab8857e8105be0444c413577048c52101cb8023000232314462757c489248034c082d105a0888c47188444b970918795eb8b35182cc44d7800119ab849e38857a0115e70405aa1230c2bc8110910246150fce66f466ad5577e1a606460fd5a42020604442a12305149911bb502059909181510208d59212300044eb810a3f8a9911ab10245fd8bf6222fc848bf014cc0c0817e01ea0004c21ed0917db15288d578110f20414ce34980118001209cec26ab909aad62f645e9031641eae048bcde5dc42b76091792d0aab71191788245e02834506060f66085058a09888005aa4355314096b543314484434a115af848badaa8446a9e8b9826d408d836100026354e04f2d8122e3ab45134896f086a990916ff54a08565eacb446a8f1286235468426f813545041d34110a084619e1158a9b2b4be4322d445a78b4d16922d1ee803116862d059e7184cd80c588d4fc122ce45992e8c322cbaafe11a9da2ca2afb184c4821b80011916422c70855e610693002300023353904b3a811573848b0c13534848b044b7442ada55ae2106f802b0002322c02ad21083542457d8af915ee2bc908af1a97446a5b0915ca2b7c56e8adbe488a456b1b341a60645688acf15962b24563413e622af84d49e11553048aaf155044552734c235248455100150011800120137c374082444693441a4b09151f52059a119150c24542f20622a84848a781153a0404011e3229c993310a9a5a2108d4701351a84b32413519048a5d14b48dc09c7032c008c0009c8a5314a03208cd4561351484d44e10cee848a43147c4451e8a37401c66a220809c422a3195002228a840bf2122899ffe337801ac0009472b8108b9040bbc108b7848a1ea8944450d3fcc5e506394e4afc2150d91341044c454c888a15141c4394609141426a140913fd50284ee892c4227dc4fa89ee3227ac4f310a7ec244f189de214faa9f31113b8fd0080db0114f61f9a086c23cc844e989d1139a27210d406114f290a80d36314f08489bd137626e69fd53b87ddc0a280014113594eb083ed21226890784a421904844cf20d82c9c4b010539a114e619dd111326264792702820004a1f58080d30244c3638a234f6040c0a1225f39011112e8244b9896e22259ca201112c625829a81862b4218a908a69455c81af01ea0000a29a208a674244a90912a2253d92a0c404225359261112787e008d3b6c630404ed09125822983bacc207300489271248c2e0c52f0134ea8489203e6c7cd04a21b56514b90409301051e8491004600048170a0912334e6448819121d4b390c818e2e519788890623cc469c509a7042295b08a5602447e88f6a5387a2c87e0b660004e0246087ae4269b63d56214a08f29032c008c00094053e10f530488e05fe042939089be00a2800119a6b4229323d2c25806446d88d8a4ac617e20911aa2340807b6134d2840698134d10488c6a4684446188bda6746312d08115820174091164f398888af63b04699508a404269910911474c788889e0d144444e88981d386444a88931122223c446888a39b4f1d08e209eaa34bf84620c1222158da100a6422d0e08a37c3fc828000004221d4439094a74a0808ba0910df4b988b1a012217c42d885710aa214c428884f1099466248845108620fc41e883a381007a800140c35c24418882ea2e46696c091042207c40e1bd240ef084515c122048488104b2c41dd309a5894500db7182604243ff87f70fe0edb96b7186a606ca0487ea76c4443f387e20bd0643ef511221c018487d90fae1f543e81ac84b2cc695008dfe821d9409a53421d8b0ecc221f08450da121efc3db11625422861090f661ec588e19a50c2284f08755021d52090f454261d4d190f4349e810e05160004a43ca50762dc46069b085894243c7878da4dc643c56f6c2349984d262121de843a38326c8dd13e621a4b4243b8876e57cc643b2091f44243af875d0eb4630109d8e121d5c3aa874e36848116f09a464243a118721a60619b108a0142e281450002434898487310e5ec290c06d8121cb27f27ba23060b844fd6106099595181cd3dc843922b1a201b104d20c134820487181048284d200113ea048713a3f441cae0a3023dc64386b0742f240f5834c287278243824f80221c003a6110dfd3dca7b7190df61bd884f6372284437638fe203658486e6548441c77082df02151a09a3a424369d1cc221b3a79e110d921b168e1190d813c708d1ba100478486b69e184435786ad0d561aa43534ef6606d084386211541458001210d4034c08869d0d34e160c86990d2e1a51c20210d1e1a2e8cb187038268c64eb8203bd8486783f884077551f02219cc33828ec302a0046f00043219ae8bf102a100ac008f19a2f02432d5f0e213a304865612195432986510c9438e1437b81139a944511a2c4204b0090c782272f4e5a23456844e5010de1044e4a1218cc31686290c48dd9942826220016a8c4e3612187271837461a4c0a28001309c5d3899b9a190c29387084e120d884430509a2742430225962218042ff4df23217e044de66df4442fb36f04f1c6689413246dc4642f7d11e2344684c0ca109cc0485d616b8442e985d093c060373089b38226cb090b893638885c06cf1d048c85bf0b7a16ec2dcd1025135ab69c110b6abd508d0f81216bd7a54d3622f8eb09485adc24c4269208120c0008885a90b4c8640c02aa1216842cf859a321658485946bc0442c84cf2c7906686d086b80242c48587a1a17692ad7290afa15ec2bc1cf24215d42b9358030d5e840c761215b42b585690acc0709485610ab84577b086ab8401000119a16426857084a2823cd0086a54242a3d0a064cc6126e0835e82262c0f5635d1ee890d0921214ac2941ac033421040eeaa3e046840090a22143c286850b3650a42828503a0e213dc27a84f06213be8341109cc225f70909c02380884dc12136426b08bc3213491f211099f8250884c41ae0ad20cd0501213068239ace334108484b297484574a0897412e619f919a078219f30846d4219f009a0642052809093c2424e23342212619dd11a0502061e09a044242483392573460498095cd4204a909090d2d1088483a0244047509a0182423a0816fc3e4232a195cac24237846d08d611957252908b449388845895f842e1a0908a4cc60d5500024211315a41095d1ca3088446062c442218441087d2b390ae261210dc21a8432656c84217842d085610a25520dd060238040dca12108c2104a98333f483f311081c203e7099f88c9588cfc0120fec1fb83f0640c841f60907ce67700f801ea0004a67da0907c20f70831de133eb0483d44108405ed031400046103e0bce3558667cf09078a0f087401893cc241df83bd07760ee41db83b493b16d62083ae939afd58c49c4a1f0424e05b40220e841cd0eeaa3dc000944eac133e204838b9f00467bb8378b610641ba4978220dca4b91092e2ed808836a1038004cf6c107c78483000430c23e19a1106c20d708cf61069e0d324952106920d1a5f2199ea82247f095ab4267a30906573cf4190cf36420c617df11062a0c4c1858309060d22618489625804679008d4042243d0905f20bde7881905e4205540905ce0b9416e18d3acbb93866199dfc234e5095a4c2416882ca0004602990905782677782b4900c634d5088ff9a688882a613d13041c6489c44415182a1053e0a7414c8296d2fe372a082924bcc44148828f59d986b90479618c0441461bf20d8862ce509050e0a0883590120a0566a59b8333b08405f81209e413bceb4311d204ceae12099a3971b40258082395b59222098c130471230b51c97110e00c2412e2d3c1e9006294992904b0bca08aca611a408482568dd440d5a0876382237268ea202a0046f00043209241220eb0311b484824229ec416791a70c820679f209047039c081a5810100478c68ce1027a8468c81164c842cc6132c0010c822d04504345c09044739a88821cd1584410b82141b7864109465e220838cde119ca82232209040608040ff058c433920446301207e6720119c78240f80903de07b05441903cc20c950903bc24bf10832202342a08d0a0222fa18ee13fc04f008f299c50240e245e400ac0009081c01030d0481bad070455fd0957ec20c571b6e2206c95cd119c1c24bdb081710015800119033c3e608819d0335162993200025206315a307dc0b54840c581888ae86057b088adc24bca0902f820c020902f41b10881741205c33e61102d8ab688f31902d4b0d0867be125e08446ba12057a28f2aae137c087028b000272056c0ac2a9412cc47b948156cf5844bbb092edc240a9099ba8240a32a550dd0666e608cf14233c3081e5824ba409027a04ec09c813203d40009881305690400fd09025a04ac09413804032b848c4212047223d972a3336c0429cd45a044b91090220015800119021a042c084810688a4a40800901fa03e94b21901e856d8c351901e603c55aa02820004a55a80901c806294991901c20368880d612ad08480d59b0829b829e0002501a28443de14cc4e00c80c651a04406180be210efa73b11017a02d21d7bb604052984cb00043038a8480ab015024c0c439a1202900b310290a9f48880a19ab8419bd0901282404980910110675ef0901010d7a1ad1900fe01f219f37300e5c04798807acd0c4403b06c4209f304bcca1201b3d39108638213d20900cc2218608ccc8213c70900b5996888056acec4669808cc882669280430077348108035006600c214b124a533458480228504405490884f82400a7a282197f81450002303a70465f81109a04426412001c00265e831fffbffe65da3014604160a11ffde67710ffe333a8804ee00044131408226823ff27fe2ffc1ff7b2d42999bc2017408ffa5ff43fe701cc40976847fc6ab8844af308ff85fefb2c118ff7556a887fb24ae49e38cccc411fea3fd1ccbe31fe6bfcc4175b9788665a084a442f1018a000241951047f861f202178023000251fe0bfbf7f7cfef5fddbfbacc9e73326847f68febdfd76648219915fd4bfa718fe95fd204cc18fe84059887f32816443f987f2efe59fcabf9328fe49fc8bf8e18283023f8ccc7021fc4e633953e5c7c0009423b413318047f04a96c475900998ac220292364062c63f7b7ef0190463f74f8c8208cd04cc441031004cc3be3b843f6b51ba21fb5661910fd942097608fd886d088cc2811faf3f5da9cc301c404644611fad92cb10fd642660b09981aa6c887ea95350888161a20fd41fa7bf4e7e982f40202008f3843f823f4a3f7a20277449610fd24fdb0809a41038c84cbec10fd7a9fb1043a02154708fd06277887e7efcfa5298c7e7a119864c0c7e76fce4465e90842ce103887e60fcb043f2b7e507df06109208fc91f918544199779f8fbf1e7e3b9768a65d808fc69f8cbf18102e4083102d511974823f107e1efc388240c50287d34231be08c6f0231b90997202102d08fc00f9f887df6e3c4431ae0893c021f3308fbe1f7b31a518fbd1f79e5bc15400914000987de196e0c46a5f22196d2a4008cb6411f7065ae10fb78f781eef1f363e682510dab38fb6824c087db0fb5cf74e19a20fb50f721ee2307e41f68bed07d9e286083ecc08fb29f6383de45d841f633ec57d88fb0df60947d807af054f0c7d7cfaf5f5d1eac5280273064c1ccb2c7a9cf520c2ff0132c8b14b11963c23eb17d5cc4f46658c08fa95899087d4611f50847d4079e034d8c7d3cfa6c41e7036ae20f3684a88211f49658010fa28bbc887d0a11f41be803c82065801180013078ec23e7ccaf221f3c657510c3d02657108f9b9f36437418782c23e6a7cd2f9a0f02107ccc11f31be627cc2f981f2fbe5e7cbb959903e5a08f965f2a851618f949f28be4e18f93496588617c11f253e487c8ef918ee3898130f90df213e402d80402ee81ba06c20004854003b62207b7047c72f8e1f1b92cb20f8d5f1a74e719953c23e2f08f8b5f160e8418f8a42654909951c23e197c301270625d2084b9020498099504201550994f02437408f84729ba8461994d42081109b4bc202c608f82435188ca5d24fc43e077c0cf81065510a79e11f00840a9211efec93310f7f182108ca4611efcbdf8c1f031efa5cc210f7c40118001199472495887bdc11ef6bdeb7bd03061a847bbe11eee05b410f769eecbdd87bac41eeae51110f740e0a087b9cf72c6038a9e20c024237720873002490508e38c23dc4ca1023283047b7ef6f5edc0bdd2194002154d08f6bcaa3006b000241ed69c9791e43327e847b48549442fd608f670e3aaee1192384264f208f661ecbbd9418f644a808b531853fc21c650a8821ec68b4927cc3246a047b16f629ec49c4e21939821c3f5f7488a463d84a6ee21ebe1c2d15b02b5c81087c8465473270047af27080412cb09936823d737ae4f5c5eb71c060716617ca0438026ffc4076908f5b5eb5e4cd18be2413b800118f596e2a887ac6f589eb0bd601a4853263881110514c23d5f7abcf57063d5b5eda2218f047ab06f30412e4081260264bc092240264b908f53dea688c96e117ad845eb211ea4c8831192c421b920992b9ea0087a7f21e443d3cd92221e9d93d610bcfc21b8204b221e9bbd365e6edb0c965947a68f4c57980cc9461243504c9401324e845e4c11e93bd267a4af491e91af1c30c55c2649408bc5c2648e153c232448412121500237800221a20420e8609921047b4d2d186c9c73d883643715443d0f9bce21e86bd0c7a14f41c808ba0991e423d035dde208640402aa10d8026851038a821af85dce20445315710f3fcd780835dc1177084c8d8132350463c811e7a8479e8f3cde783cef79dcf3b32329c106811e738404b611e73645e106ae8d5a806b000241e6dd2e6855c309550479b1a16441aa508f359e6a8976184a4023cd3c8a020d4c041b2e1175784799c1296a847993203843cc7798c1e442b79499299119e5f644318f2e9e5c8751028a0004a3cb7796a20d2d6c3e111fe422e8808f2c431008c86c11300847956f2a7a028c5cf81037819bd10f294d1c47e918f2804b008793ef271e4d9933200db02642b08f25cd04057818681973008c84c11e483c8f791af230cf994 + +def cs_22 : Nat := + 0x5c13b8241e0c65c0790b2217853d141170149ac014500024047b4d2d1023cc22f063643715462f05269a2178104b7fd6ff042efc7a0e2177c1b0ce12631779268b08cc326085bfab7ecbba860d8808bb9c22ee6028422df9e46c116fbdad508b7dd20e045beb096f9c2083f8120209658435901176704106811765aec904b23176304105610414844cae11e6f04b7b81240f1aae10063175e481a106a8825bd9096f5575777701898dc25bd407ce217520434f8106b40469ee1092e04b79812de504b7936f1cd340cf59a1174704b789eb1c41a5008693425bbc8fe220d2384b774b9e824180022068dc22e7508f28425bb35ce022dd7888005aa31733c7e01015e025bacb75422dd391ca1080b025ba18fae208db84b741b07c411a94df222dce919a116e648ca92cb1818a00158001196e582062008675c04788b72ab900ce78cb725eac042e37095222dc685de1066d420172096e248b2888f7611714915162ae31711d72510b88849688f546100ba04124e10ccb84b7076e063d70c4aea47000008c06d812dbe045c28b84c3b08cb6f61314447a40934b425b774ac221701ae0010b7fd6fd84af086e0004a5b755bec0d7865b71b6e11e5465b6d2a4a22db6478b10b7996f188b6d4b7801df827a04ee0004c2ddd6b4822db2db644a66316eb3c35116d8824779096d7adae906d081c0150011800139496c218f209e9f025b59b6b00a3c65b550812a008d8361000042da9db52b6a2050400094b69b6d2415b0cb690627e66a8cb68c12da29253116d0c25b425b2e200c584310a13d3084b67cb64040a7a6fb022d9dc49610b60c26f0023000242d9a0477de10c23e19a10b5e1d2308089e13d2804b65410702d98001216c9ddee081eb412d92045ac348347a405643ac251dea84b6436c82d8f311420b536396a469196c6422d4509e90c9dc888e4aeef6b4f8cb624b4e8403d2096c4023e9b0891002471b08b4c56978848701169604b60d6c0c40274096c0238808b5feb49474d0c0a9811dd384b5fb6bf02868cb5f21168d2d1711a43238004b5ee10bac840e2a1168704097a1237c04b5e4116822d0147ea1a6800094f44c12d768419a21167c03f949e032d750410f011ad504b5ca12d7246e2116b8ad70c6da59ca42d6f23c211050425adbb5b2203208459b810b7504b5a85ba06eb25bc216b4ad67a3aa196b3ad65a3a01b6a03d4000988d8c106d584599146a06ce8d9a0d3052d64842d6812d63f9fa76a85a783d200c5293272d635ac550fe3165bc6b710ed2025ac0088d98290043d000043995042cf234e19040c46c013cf804593c12d5ceb4e10b26068addb0196ad964a3b33196ac823b2d08594821651467c120c00110b55f6ab8b238cb55b6a9c2ca0c07ce1234b047628d6a842c72096a8ad4e08016400044468c08b19163108b52be76c42c5d8d0822340048cf54588af295e20c3abb84c2c51589e20aed84f3aa09e813b8001216a32d4599bd18310023ade0845bc251520856e8cd8006b000242d41b88610409022c3a0b721cfc00090083412d3fda7ea28c3115e04585e15ec42c2a08b09c25a78b4e822d3904584024284036208b07632408583010292875410eb0022c112ad0c8206464308b034246400944bc2463c09698c2463309698231808a24a12d2eda5cb4b62df0822620918b0272d209695c1cc08b4ab69515f122492169495ef14f481204231084972e10a7704f338115ea0429ce11d48841040115e8abce100b5422bcc09691825a4315d811f58ab904448115df8698109dd423a820968fad1c885752aea15d34600209d7022ba143f022d1af9888bf232d1a5a33572c519f86d14572629dd9040cb46368bc4273b084b2c25a2b08ae2425a280e2a22d12045700adf445a22b43822d0c21b21168455b42b6591c2401ef22eb000232d072b6256c342a8dcc0397011e72d0604bcd4115ac04b412115a8c090116818213d10c8222d02f96c1013fc04f008f19e5a422b4008e88422b3d5676222de845668109d3096a0bce3558859ff42c621d0a84b3f516d01f38c741c12cfc795d10ac6dd0488428c1074d04b3e8ac54d95819c03320004c135f08f45022b11084d4822b0b0823a0bb481990002404b0040808023c42b07267c0a8414f000129e5242794708847c2174608125822aff422c20237800210844c259de09163822af41a4e222c58473c81107f0410f65f6c42aed02e822ceaaae71167444308397011e4156fa0eb104b7c33b812319672c4248c97000241070043590115690455a0834495d80f5000253c9884419613c9704b385e4ac4080b096703c9288189e0004459bd0825d8212910bc4062800090d4ac12cdda0ab111598205b3000222cda2ab00f7c96f08209f09157c22aab09156c259b0f21a492c924054008de0008e2a978a9a22cd49a4b11669490c0840c412cd12a8007063102c84aa1212ccf599810a998203d209665553088b3261a2a49e8cb32166355288c549e12ef004064013c7b8405f8106398405e812cc45987b30ca8f951d8b0b053c00050060e09660425980f1d222cbc84b2f165dd513450c20a871ca7257e1965a4899088a121228384728c12282843f9934b4408f309e3882596003d60d30644f909e374244f30965794fc083f54114faa9f453e4a7bc2330c9830a7b88640889d41085fcf3e11139c2595ab2b3a80c65956b2a6428c850149929654484f08b29c12ca6c4d310a74cfb388b2911338429cf20d423c6484898c4174459423eb0201a604161a114df028f100a302593a04e221c8084208808ec37a034b0002504b684896e12c9a38f110c6b8259335b5822c98592e10a66020fe20964a802a002300024225284b24f64954c5c49a0808023cc298a1a4c008c000906318105e50409d412c8f043dec10f7a04b23b64714bbe9d321646d4b80f93185c28259183dce28d8375117229866400088b22a1b6c459131eee22c879eda11e2902590e52b02223e0f500d26051400094529e0234015800121e25d4a408153003d40008c528e7ac0459070827142293e527822c82d9044df232c81041e320c7c01180012026c0258ff1e1e26912de10525c12c7e292a52503223404524aa48c40efc0963d548f88b1e61148d04b1e3117442912522011586069b08a435c43083ce61148484b1dae1f84290352022222904b1d01147c04b1cc793840345091134258e451e01470658e304b622c7004935c12c6f08dd10a39cbb08851c81222004b1b010729b5481163542529d2819634f4b98888681221704b19f63394680cf0c012c65d8cab192a33587214518810f0003b40766313c000149e661220e04b18cc35c409de09630d45d441218c330228b40686c4b46083f8120209658451627784458bab172a288ee9061d5dc2606e36d621162cc2381708a28144fa89ed2bc421fd04616213c2284f07e3620430a90962aec5558a90f52008c00018b14ca210458a4b14762846589f09626c25899b131625ec4b2861296246c48588fb9c642c46694110b220258860962121e6885090a11842842da5e2141f283c11e0a82587a3a602141a05643ac232c3b84505e06d84587000f40d8400090b0dde084443b908744c243b609619c25866b0c62140c040c2c0314a4c8cf02e12c2f04d238106d08450160f48415bd09616ec2d780c1825542439a4ffab8a86780809615425854b0a422c28d84f180e2a78803620824602438f0961153ec8bef5ffe42c1f84870e113e968fb1160f13e527c7028a0004a583721ca22c1a84b06497c84582f4f629ec05c8843611e662c16c3741160aec15151a19a3a4227a6082d985b2bfe4196093bfa08efe212c0f581c1160682278e09a374227893882534040190b026113c1044efe12c07d80eb01b6032c050698309dd42222009601bbed888692113b52767109d8c2220808dc54e0a08affadc4841c09095feebfd57f84eb09d58a1478089d502a0046f000442bf977c8115fc40aa88ef8a117c3006b0000313a304afd04b2c40bca094360243254e6e9cd939aa734093062bf2a7c0115f92bf157df377e43be0044e4412bed84afb55f66bec430d21dee4257ceaf989c01896904dff0240400e1095f142064b089be4226f5089bccdbe88a2d010dbc8485f2109e2044ddc9bb53758caf7f0bc70360c12be257822b0caf704e6041b57095ed7bd408af660fdc40373095ec7bd1084d8c05040008c368610d9e3a0911703c2024608da8820e90089add35aa6b44d604135726aa11de502449609378eed808af4a9a6c45f1d61209a5c257a34d2422bd0a68f106c08c1f88af3d5e76bce2685215e6a16588af2c12bcaa67a115e442578e4cdac55c60df808bb4c2578c4cd222bc5025b10df602578735802018b910706c2000485783095e08d5c25bc195e002577e102e2175f84aef95deabbcf777215de09450879a01131f0c351098ec27770086a3c226340898bc93708aee098a4407950aea5c7c000904c48d9644576d4c3d368c6261b0eeaa3e061a6f090a2c91f8158011e42bb4f75f1180842576508983888408eeae113041a501109f822601086924257614bff36192e910aebc12484575daeb95d6ebacd755ee98612f71a28115d4035c15a418978b007084bb81a604425b1964008c00090ae9c97541cb808f2097482574bee7246e89f310ae935d18cf7b12d215d102360e0896f817a08ae82023c4573a4b549018619c92b9a22b9bd735115ccc225a20831102572f0896702572d0816fc3e4232a195cac2038808c88c2423408165c219a0095c88257205c34212bd044af095d84036c0895d1ca3084ae4c4504571cbfc222b8d421e115c5bb888832ca137c3740cee1c12b89195b10b7f02570e4ab295586570dee1023b82844a9a95204254609082c24d10095c0c2254006bc21ad684edf612100044a70d690456fd83f8220fc93e6115bee67c084a486af442dcc0945a0241ee089464c7613b918d634256ef095bb0210420825b4256e849fa22b7284adc893cc456e22012201fb8406e610a4c84259613b6e98a7018a5264856d9edb622b68a4d60a883126a0449a60628441c7089338256cc0ea822b6441c0498e93107df873712c071aab041a4e112604496115b10224b90892e125bc1b5181c0021853a7d221256041f1e120c0010cad815afe0d70c83581124d98331010524af086a6c12b5ca4925ad032b5ba48f6b54320cf84ad64137d184ad6091fc456ad08d4848e088832c101b104d752120c904ed7212b538f15115a96b5256a3ed6442b5080e6115a7c224532f8625a82f38d562891302244b12c021224a4471105f4235010890f89658869fa133c404ad335a5eb4ac16e20d3acbb9386618907120db4e5195a4c20bc30905982568f82b821a6d04ad175a28ba20cad115a1bd130c2e6e10b9a8447d812b4084acfe11a6184ed1410b900425e61047b84293212b3cace762ae32b3923c447820a6007a800131050421ac8088eec2566bcec2211d9a3b259ac32b33c139115999a4b88acbe8e6c4565eacb9596cb51c9712959606ba3dd1188e186b8058407a2132c001180b0012b2984ac9e12b26564a11591d1b78766188db02564308d1b820a7b0958fe5e088ac7d58f51ac806b00025027a84ac7758e260f0cac6c8d1407b0cecb859382378001208ce464b800118b2202562e0dbc21a2884ac5610e0406d0086600046232a08d12c22325095899a2308ac47588ab10d61d2c4a52b0d84ac2f03e042309083278ad20800d6000445610ac1f583064410ac1012b03b422110380256000957fd1740ef61957ec222e3130220ae68475c21206a84ec8011c43040b821116787c8465432afbd5f62b4833b1d04abe88ae840ab10957caaf6054300a8008c00018455302e8425f2088a8d15008abd213b16042c3412af1d5de45163114484abb89f00455daabaf029c633ca44e220a96842f00460004855d4aba422ae733bc1021802039700460004655c809d86d12608ec32111240b441682304e004ab82890512064632156fb36c08446e12ade55b929b60b640f5834c3156d82339f0956cc222290956c8576047d62ae41112abbf0d3032ad855ae295c00ac0009480ec884c8060361000253b0384ab53569ead3406d21568ead0884eb8110fda1f9573c310fa157d11d8042559aab33565eacb559428ae24221d743ac294c2658002281c542018b0887490e808ab22adf445590ab1c210e1b1321066f42404a095622ac3d5868082e8f00a0800138ada4255830886987a405643ac242abd403a1155e1d16884320863845573aae3ba686556b0885d89d888aad285b04b63132210098240220955909c208aac00ad04092f092ca02555b26ec22009041d3412aaca140427f002480e860884ec290043d00044197e0426a412aaa04eba412000844258ac144212709553eaa68865d01037a84423213ae404089e108640402aa1098a04421a10e0432da08841469388aa8412aa0f5c01083d42553beb7822a9d3fe0112bbc220e455ae21070bfd925724f1c820cd4198ff4906420c7655de4a0e12a50882f877b08417612a95e65a1154a02552208ca5e2af88413812a8f040f3c70504329109993423fb2410c2104112460ec897c880d460a6627006207d0954542074008c9f02551208fe88d2588aa1e8185fcca05921542422050565a22a8390c81154143698438188128366c37419540aa7f88a9fa47884759654b49748654fa4054219278433e613ac5047ef0190446625084668225bc08fdbc8c902d5182044254f1088053c770840222c144200d646e2024c04400efd94405f908fd8420da10845bc23229084594254e8a9cc22a71ca7211538aa7008dc1e1190c84a9b21190804a9ac105eb84a9a47f0c454d0087efc03580011953318ff08a997d5ac415470843852e88001187eac86d970a195323ab088a989530df9c8c7e6c10fc890b3840e31f97847e5811f949f7f10c77821f7c087de94ed083ee2102a2043edc105a184a9627d9c454afa95a218e8043ebe6774429c90952a6a5331c91804bc254a3a942fc3461f4f095274fa4b1b7181748254983e845c8065495cb8422a49d4913e5832a48548fa9187c6dc71943e301031004a90afba041f090951fc0118001187c086930023000241f7084a8f951e4f7908f72151dd4b90801ea00044317f0951cc23ed5081b9423ed208432025471a8e151bc7b190a8d3f00845467083d4421ec41e9d220c65464016620f5e0a9e10a5202546108c55c2545f3d522014f84a8bd5170417ed09d47025456a8a82189e1e8b0afa30f453137107a082544fa89afa8c63ea109512aa239e76938e41f4d84a88679b01ff020f01ea0004c54410950fc23e8c3ca0fa246543ea87421f3f84a86e237441e37620c2188184a86950cdf3b0c61f0126807a80012150b824180021839083740808e010f0e84ea0c7858b9a0433000250f07cf3e11509425424a846a3200b88001287810230e0085c5821dfc0950702170e08155020677024623a7c84a82af95cd640c3bc43798195051811ee52a08d40f618a32a0700e1115030216d20836ec207fb09501ea03655718f8f86d507e608fac55ca1dbe1b4222a0153fd1016a4253f91a4c008c00090a7f076a41f844962125c4253f53b3e21f18843b2ec264453f33b1a1d912f91092cc129f73e229dfc3069384e9c613dd0843ac8758c1d30c60f21024e04a7cac1c467c021e05e00004c306e087550253e0a7be753a1ba103a8810524af0c0d8a1183204508c1119104a7b34f597708ca7abd368453d43a5674a8e9410a7a54f41f008ce9a4129e6043a12129e49d08b98431ef904606e129e21cf318a030e789172114efa9de301e187358e6af80818c060224f009d30023dd108c04021c14082ac4274bc7b9220e610bfd17f4a3dc00094a75410ac0043974102a0046f00043029e04a74c72cee4e0ce964129cf154d114e6c2539aa7334e586ab107b5013a55043908720d7ee0023000050a92847b3e10e3c0b7b06c2000485390e93e20a870b6911ee329c59c71f6aa329c40438ccbf30453841694229c1d37fe924711c8748e15f208ec37a034b000261ec1277b114ddc2222008beb82276c0e8023a4404e90c10e1004a6e94dc57d017942070502536e094db42a0046f0004429b29470100d14253637ad0229b08fbe101cdc4b00837d051644535c086f8038e0837b6062c43d5c094d5c25355094d4e9a888a6a0bd9443d50086edc2534ba68d4d147a6107a8e13a3106770246329a1af4a0a8833a2f847a801299fd33ee8b63299ed339106df00631c6718bce82533545d822998898b100630db6486a106d91e95082f7e1299684a6514c9c7623223206d48253237a3c2298e8a9e106ce023d1a083a40253177a282047e8158011e309ac84a627920845312363ebc08653107a1223a2088ba106c33849048b03140004a530ca6174c2836c10a6134c22982888a62ae50a4c8479fa10d7704a5ff4bf441ae863c82297d1ae335c031e7904359c37dc1b4805400460004c2ed255ae21e76841bd61297904a5e34bbc452ed086b08d5f80f801ea0004a1abd086af095e0825701297552e9a5d04aa8852e3081fcc6d7806b000240d510412ec1094787e608fac55c852dd094b686cb88a5b0f338452d5094b483cc057700d60004a3cc5094b4174e8834ec49480008c5d30103baa8f810f2ecd34923f02b0023ca4d9c086988290043d000441e5a84c87810d2bc7f7114b14d2808a588692c452c234922296052bfe7fc1210852bc7940258063c9d5cde1b0835f99dd286864252b80864cc21a1211000b54652b3086820d039a0634062044a3c93094abedd28833f619b98ab8c33f21172a04a5554a9de4411a94df25295352a5e7da3295152a1e7d63294fbc7f114a743008895001294d04337a1294b19b1104594211620b8010dc00090a520b8a843c720845458ab885c475c94411430824b42199c3334f1ac619954afc239ed84a514569040544094a1a942d284222a40cbd997a32f065c4176944ac21293eadfb095e10dc00094a4f0654c404970920048c6170a08b7d42194a3292b7c486816472805d022dee0864fd2a408a4df49b0c9c0ca4d549a693473c0214999e1c88e776644833c0023000252931990c10b75025260a4bed654618ff5b98216e484a4b01292bd252a49e3292684207c179c6ab0c4a0a116de04783430d4418c700560004652477826216d9045b5812920189f99aa3291e84a47948ee91cd23521ce9023c0330fc148021e80022948c42025308108023bfc0948b56c20809d411dfb045afe6190452260e14052806380012812602522177dc3e3c241800228ef9e3a088748c10c1f84a43a11df084a4354860452175ad02290aad63102ab025213a424b5506520b086001de588a41239e445207a4085f7c65200055821de084a3ff47f9ddf0c48a25f1169d0ca3f4eed4451f72f385e64000900b00139be84e6eb8ddc451ec0947a68f334e7081c01500118001385dac251e5a3c620baf175d09a43038c84a3bc1120304a3b34760724849100460004c51d75a03054c67a2608b3f8251d1080fe527808a3988f7c43b82081a8c251cba3914714651c361ae228e151c1a380b394851bc2df00ccc0a2800129cd3c6eb25bc1946e010780f500004166904a366ed98473438d90228d8844736128d7d1a61146842bf8ef5000241da784a33f467965a347e0b660004c0d6124a400046732f1a9c2165504a3354664b3ea3660a4010f40011c594610b3c8d38641033cf90497821039c04593c128c90476701164a8d110316328c504a311461f98d8cfb0920048cc518659182164404e62c128c18438118ca82518058fc58ccc9900012858c8b183b1a0dd04177084a2fd586c40cb60945de8bb517401664065604761611d828c9e2b4830b043b000cb80d1014c00f50002728b70c8700023162bb428100c142516745ea228b20023000231d76042bb0128af515d45c03116f04a2acb10c451550fba0d2c00090a2a4128a8042b6e56d8ada902421198023ad808eb56f6f086030128a55146108af0272ea759a21d65845848128a104455856085fb006b0002505f98406c4119f504a27a1160d04e5be23e845136b8aa2160784a266128992c0510b00c2512f0944b1d5a88174211881a58001212ebc25128755e22893baaa2a550dd08512509447dd5388a23a896842be90854241cc08a22a5690472cc09444e8873a9757b24032407cb06960000814eb09442c2223909442441008a20c12881d100a1f8315df8698109dd4272c008455c250f403f205140009029321376a0407e1125844b7d0943bd1020874ea103c984e56e11d35a1f42af80aa407a80013143ab959086228102628428dce98ca340c28cfc364219800021438e8700d2419436821be209435a86a08a1a41c54450ce09433022b7d088724200b309431c2142c09430686050bf30664285d941a28303285b81dd0314000482b6591c22035504a16742b842b5609ca415a908a14fca1537c8c5694109e88641104f3d0c408744e13fc04f008f2142944d2021c05160000a217e13404b2c60f0909428877e08a1384ec443a1d0942689d3096a0bce355400098a131425dd0a8c271eac9c1f704e400460004c5096a12b424c6137d1d5822847047412128456263104d88239ff09420c9a908a1021283e934865e83283c071102fc03d400094a0ea1037a84264c4c909918e420dd05023804a0d916484506ba0ce4b2c639e409418443d97db19418282e8825e4ab9b3358ca0b8e76c4505ba0b22282bb9d010834495e08e4b4e72803580012013d425050a09b4132825d04718a062821b9b911410421281250010686503c0940ec93c12751940e22ad034b00024281a04a06282184502d5526239272a8d10aa24250287338487090d818b281c4822062094096811d021a041407c20298a03dc9044398809407280d068a927a408ea2a5a239a47308e51454ac11cbd04a02a31fc411a10818d82119c0c6801e81b08001284664cee8872da46482720023000251cb584a013e3b84500709401b918089ffc7ff8cde8c337217880c500012011d424ffa0845b424ff99fece54064ff19fe1c88c64fef8a00227f52a061043f487e1e381813ba24b089fd13f9c77e0c0e32127f2849fc9c85c44fe39fc01b6064fdf3f3410d8479909fb81b108ab034b0002527ed4fd9724830854069b113f582109e08a778656089f9ea7684720963ac227e5831e0c7a03e007a8001313f2b900889f8c127e2905d104155c85028f180a302104c093f00ae6887202127df104171f2314da049f727cf82e004370002527db4a2010e3c424fb171dcf74460ffa093eb78f9881fc411c72840ee010f8c049f533e9dc6f8c1f80127d2cfa41a4e31c6c8471a8127ce69d5113e58b8508e3c211a4438bf08113c24f91e3b6207bb78a610a58824f909f1f3e3464f8b083d44271cb7fc820f5f849f0c602c44f7f62aa214a1049ef610f52049ef0127b9cf70525c31c4a0f07113daa7b4cf6218c4e4217cf093d74f41087d4c104b6849eb53d5f4ce8c0682102e90471101076617b3103b2c7653882193d538d797a218a40421794093d482a60870e27934745e161213d31c370870d81073f38681cf2327a4386411c6982385c080f6c21e31083960baa8e55160a4146e8470a6789845f1d612022f024f454ba421c26845c0314000484f424654202150451a01279db83d113ce47133157193cdbc2c883bfc1145f849e633cc1c160dfd1bf819c40009c9e5c77bc44f2a068a206f6883f0a5c05c4000942596106f51de110a2b82440908e0786e7081b98774830eaee121c62c21dc90836dc24f229e433c8278ff17f29c5f420da1093c6678b0d88193c2dc0288e2ec8bac0008c3b46127839d9a113c146b11590193c0cec90d5e50ea427801d8b0ecc31bf8496110dfaceb90d2b0e644277f041a4e1277d849df4df9044ef99ded3bc8674109dd610ea684879e10362843a8212773a84610df0c24ee463c821bde843a601141a84927a106579d281032b027149090f0024ed81934326064ed36f5a20e87046f510ed041d090983e02281d2596206368c6b113b2c215db093b10e7d88606411bcd8460581275f846f221275e4eba9d703275bceb6f01031bc3046f045690403f0892c227590c190b1616240629499309fa860a27e818dddc601086ee41275604397812755890511c44024ea39d3e7efc0358001293a7674d438318dd7020bb22a8e20eb084094a74a044e943922aff8627b7093a48206de093a3c211f2093a2e1b88b8908121010047989d07a3b444e822a342273ff0f8c17031b9c849ce539c673870f4201875770889cd8121ac84e1d22bb8e1a8c6e4810e188ae1c1582b7856e8adcd1a47056c0ad720421f21195149ccc12731049cb81055534f7113954e04024500024387004153003d40008c1fc412728a7561139382018b0939127210837e410df7846e081139d8414c213b0035800121435c2720023000240408849c7338d8a2387f905000004c144508126024e341487822c64e319c6138b5b718a14bcec62713046dbe1270d849c346e544f009dd000251b6cf45f100d8824e150938444e0089c1e192c426f90938327054e099c0c008ca061a0981bc24dfc36d52ce4626e6c940226fd4df912be257822b14 + +def cs_23 : Nat := + 0x10bf0226f336f8103802a002300026344c689413246dc4826e99bf86daa59c90d1206d704688bd1146d5c6688985d24e34624f0080dcc268884d9623443688485bf0b7a16e89090a8011bc00124d1021344026af11e63135726aa11a1f4d8a08d0f7a1e93490cd0ee9a3c41b0309a1d743a1afe112b0dd0a68728596213408435e01216384d0de99d8437086d293251339044ce010d6912dd11a1a17692ad718211c42325f21899a42265e0839e426863086b0021abd0818ec212bc084ae021ab84b7822bc004d0bfa17b42e685bd0b25342c5776106a6020d9708171826850326623426c29b1098b03d58d7401aa00ac00098d09009d0468460835802684208356026840090a22143d765190a153058885050a004683908691c242780869042683584e6212fb8406bc102380484dc134170408bc13416e82b4bd2312f1844bc21300704d047359c411d30897541cb808f1897482682084ac2212a86621019840cf806b0002408da84d03667b444d5909093c2424e18e62017a0433ba112dd062011a04f4080b05190920ce508d01fa03a1220cd01831104259e0845c82423e847823402e804ae563211b85ab20180d8400094846a0fb816a8cd00308b44938c4b044b2c46800cfff08a4cc690cff99fea111818b210884cbe87530002433fb67f4843643d08255f4ab8131c0c590cfdf9fb4419530908512a906e81811c0206e5090846108254b088a23dca67e907e622103840b24133f184cfc294d8c8906770246520fda52c10640c241f60894a0235950907c483708060a120f70431de133ebd6ec119f484b688207e133e784cf9a133e624f31062e0241de83ba0dcc614990907692762dac1893a4c5380c52932433e3c1d3110744241d0839c213ab04cf8ad580467bf5b20233de045b081224b0449781039104cf7092e2ed80c836892c34e98c0e00133dbe7b5cf6932d0867b3cf62233d7b532101a981a580011897c8267abcf4d0664245818a0002633d18406c4133d004cf3610047842fbe133cb04830ad428441820891302244b12c0233c8e78f487a320be34fc45d8333c4d6981027782242b0a9e087817800012905c048225f21905b82678182d8233bf56931105a20b3080532133bd6778119ddb3bae77447ec43d12844301ea0004867726996211f604ad0212b3f8482985f6c4676dced905220a3d67661ae633b541461bf20d8882ce5099d98d6408828159a966e0ccec2104b004ceb81209d16d4119d6609b41341904cd1cb8da012c0433a9e751108e2f4ab082d4e5a90ad20c2d4725c4438030904b91c288ce9f9d351bea37a1022533a50d5a119d1d1b9347518150023780011904911b6080eb0111b484ce8410b3c8d38641030b3b0508004600048411c46b803d400090ce819cfc27a8c68c81339ee73c822d0450867382cac031c00090ce6a111a0164e08de000883456099cc426730ce5e10e06672cce542339467261103fc16308463858b0353034b000253391daa31103ec65c08ac2c58581b10c81f01207b9609119c7338d819f00d60004a40ee8120225f8842bee11a15040c78103802a002300025117d0c7709fe02780479481c601ac0000c45ea11179002b000233389061a110375a0e08ce1d9c3462b8db7219c2b383886818104aa84819e1f30407c84654220658c2700560004822c609031916088ce041115d04ce008adc433f4099bf86010867de101b104cdf99be4433e40855b447988cdec8a58ab30bd692bc525e08446ba105e884cde302b4aa78bb805160004c154b0902ad9eb08cddd2edc466eccdd79ba605010678a133728796119b8e04f409d81390268a66e10856902054409025a04ac093199b7a048088c4212047223d972a3336c04cdae88d8319018a000050a708401c210a6d82d903d60d30866d20956cc22229090200214bc0901f4a5908cd9e887444076442a2336666cb441739640d780f5000270062949910881b76708155c0f001400001219b1f363275c199b020328862281335f21ed1087a821467e1b4219bc84cd799ae844058099ae038a8803161335ae6b3439230e9404287c112e904cd5e1218466ac28561b54a4c90cd5413354e6a8808086bd0d6946698119a4044340119a28427e81201d81b6101990266a027b84f6413b8001284f582669e56942334e40311086100cb002300024041004805accb444b3e0885d426698099a5b34a0827081334804803424bc44018429624946668b083a68213690815242213e099a2109d08cd099a0f3416681800684bf73f1c42561333f04ccf81014604160a1099784ccee1157f04cced99cc98a0c113410134047fe284146938c7fdeffb4420ff95fa200ba047fd283d4420f4dcde200730425da11ff1aae211999dff0bfdf658241feea0df00560000866647faa21fe90d2710ff4023fcf0c182077b047f9882eb72f0cccb413c9104416211fe2047f8012a910465301104e04cca4102c203d10996000886650cc9cfed104112460ec897c8e0d460a66270063fad40f01d3447990cc8bf218110818a000251fd38400a8008c0008c7f48133043fa13a5021fcca05911542423f97345660fc610c809990331f08cc7bc9044663a0880f021a0c688421fc3bf85104765ff20840641254d84cc5dd6404662a0cc2067c035800128c93026628cc4d989331081dd03140004e062009987f30e323718fda030088cc3025d843f621b422330a047ebcfd76a730c1edc13308660f7eb230ff504cc12fd52a6a11102c345190404cc0011fa60bd11197fdfa51fbd1843e423f493f6c2026904cbf07ecd8fc8c3f5ea7ec410e80997d1fa09faa18fcfc86c0d5619294c265efcbd8232f5e5e911979df9731e4199799f95bf283ef841f930421231e00465e2cbbe2083fa526028a0004810784a420c7c011800129976df8e25bc18677423f19163c2040b8420c40b54465d1161a232e784a93e132e69f4d1197332e5b1b919971c34d887e0211f801f3f10fbf0231ae0893c021f33087cc0f973dd1187cb0265c03144236e7847de2118cd84cb7596d2a400ccb6410f7d8e5f000232a3c297a10fb78f781eef1f363e682510dab38a5c820498083e4c254730996a5f6a1ee43dc460fca3ed171701b54a4c9062e5e29840a1809968df653ec818c5942546708fb10f620f4e13e20ecc627800139967b2cebebe7d78400fc81450002332cce5963d4e7a9083eb30996458a588cb20fac04314008c4f077d098b1006432c5bea6119620265877d46232c2b12d10c4a823e9e7d3620f381b5711960f2c1543f18fa381b580f5000241f4517791195fdf41087cfe10f2089601078e847104f51878e02657a0e2a232ba84cae995c0f0d8c3c347858b9a8ccad6132b5172e10c39e212087cd03854b8f800020c38023e637cc4f985f303e5f7cbc77d031820cacf9591f2b9ac82077886f3032a0a300514000980a2c11f291ddd51484f1c83e4e08c30c212cb08775040740de187742c59887c9036ec4655b3b8a232ab847c7c36a83f3047d62ae51f1e041b4212a001db1100e2023e397c714fe8665517c6af8d185210caa14fc843e2d7c583a1063e29099524265457c3421f0cbe18a7d2312e88001104b90200f609950b29f1d4d1994ecea288ca6ea11846536ca69b4bc602c5000220e9b8cc34be431ad504ca601590eb08c7c0c093007c00f5000251bdb04ca5794a82a48c7bfa74540c5000120f7f1821082bea121da0418f545a04652118e08bd466520ca3f9472495907bdc1328d04ca301718465167bb816d063dda7bb2f761eeb10326611eea02b6119441ee73dcc199438ac488ca1b24144650b2b00205fa0361000233283047b7c11edebdb817ba33280954d114e6c2154708758421c9791e42327e11f210720d7ee880d8a11ecf84c9ec1ab4464f3028421ecbbd9410719c2150116a6232779c650a8831ec68b4927cc317e3847b16af6441c57d9a820e268bca10f61ce22afbf02fc03d400098387ebee91148cc9ca888041c2d15b02b5c81087c846546327004c9bd9371eba8c7ae615fc77a800121935821c060716217ca04380251d8464d17ad820a3804c99cf5a043d65b8aa217c08a7392bc31eb13d6137d051648273b099324a298837bc10ded818b119315eadaf6d186f4037f806b0002400590001106f30264bf093021eaa04c97792e443d4f376d79d863d4b0992db25aaf551992cf2591b921992b9ea00813983260464ac7a7a209ed047a72132551b8204b2304d909b010f4d979bb6c3259641e9940de108bb023d2f08f4b8db54b391992889d508c93a1179304c9361324b84384c11e923d235e38318ab847a3c13248e48e153c332456488c90e3a1886486364e39ec61b21b8aa21355049bce1323f047a14f41c4647bc8f44c78664770db02323ae4745dd430d7c2ee71191cb23808c8debb8443cf908f3e1ad508c8d2f3d441ae335c021e79aed510f3bde7688107f0240464661068232310e7910df602645d79bc2322de45911916322bbcd8d0b24322abcd63544304ba80f5000233229d2dd10bacc21a9809913f227644da5aa41e64c80e11203021a7b69ee23224e44710f2f02124008f2e5309080e9c1321fe43d34ac3321d0d1f101880264374c022321904e80a1173e040de066f440483000420d1c47e91190bde4f9a19194ae0203f308569023c983422683953310c85210d04057810681973008c84c108e504791e67e44642333e467bd896907912132100c731096f02641e8fa2208c884c83612ffb0479044604464163398672c24c10c824671171a0cc8239043207640dc816b8a8c6409c81024b467aa207900a2c0009002e811e358478d4f1a79ec8cc80410cc4854008de0004819870851c026400c7fd34b463c5a0865c0263fa78aa20cb184cf099600088479d04f603d400090c7ef8fdb1fa970a218fc9e258174198fb423c450810ac85d9e0b18106021525098f9c2193308f0f4273c008649cc920171000240c90847875cee8c8a8cc7bef0dd6e98c970002531edb595118f58c790820ba11e1384784a101460431c0131e7e3cea49a3081f84c792131e318c4114914263c45b5821ee884c77e1291e84c77948dd6cd24d600d60004c63b80861f47e288c7638ec31d763ad5b085224b04c74eb5f4463a6c74a92c4663a4c746ef99df2a49f298e8436408a430112488477ba60892f90cc73a116af845ab811de906770246331cd6399622831de5844cbc1073c846a2e131caa464118e4cbef0001185f6c26390c71f8e371c6638bc71297c8e3bb8b61a21dda844874131c1637f3828331be84c6f6131bc84c6f0ee9c4637408ee7c23b9c0e7e0004663712ed62168c2414892c331b7240f10ee5c38c882eb210bac175505160004804bd08a3742027b01ea0004663664806231b2bb8c10ee2ddc53b8959f640b950d2710ee191f092cb198d85678082e40131af635dc6b8c35c863590818c023b7808edd842325f2198d51db988476e10b79864110edb422cd608eda9db4a3aa198d311d20876c746c440da90946a06ce8d9a0d30431a4844722131a351a42d48569083b55085a70bca08c688ed38b4b056f2932531a0168c108dd423b4808d1d42633c1d0821da23b422cf234e190414f3e41319cbb3e767a0bb486338c668d17c63b3108ecb007a8001198cc7197964a2c8e431969643465c00048043808337826328098c91d8e8876380b140008c198a11d8adaa310589034988f7198c7b18e8cb5024a048ca3b10098c6c2631ac632ec1c2a2107604ebf0415fd191a195063af808ebd962c0875e8ebc8422f5098c3004788c6158c23183bae1218c1561f85dd03740d8400098c6051980462fba29056906514608eb3c015800118b0b823acd098bd317888b4e410e5e04758e0d8843ac5a27a21d61a2a010eb0960a88b8aa13173154a096623dc815492a8e23172e2e2c5c18b7f16ee2dba24a7288f315710eaa15f6cba4198b5f16b511718ea84ad20857c211d4e8416882d04414f4812021d4c8834118b2c262ca1040215e804c58e115e3bfe410ea2423a87081f9ccde8815d811f58ab8c44462b9d8968c577e1a60462c175042315eabb3118af315dcb7d18aeac262b1c5618abdd3410c5578aa82628c0eba1315462a743d033152146010879023a5c14c405040001001c2105e504c53cae2440efc09434423a55031621d29d0cc118a6021d2808ade023a4cd55c210df041f0c1314a2b71118a48c19880829257843a4008e8fc7b308282c504c44002d5218a3b146082812d6a8421a7088694250aa37300e5c011800028e8cef3508c508ad5842b5408ad4826281c50189fd0c59013601313eba281189e82627942fc268096590744885ec43a2108e87e84e13b118acdc26274c4e423137ba1510e8482626d2708202c904c4d64dece0a0c1d58102bd0578104de259188741212844a14110e81823a0174011694639fd5615d74866e8009897c202002300024109584a0ee062c439f673e82108f842e8c11cf82afe104c8c72106e81811bc00108a0da1157b84261e11cf5aaf3118940212cb08e79507f0873c5417c4505d0805182624908e76c2624825c64b7c33b812329891d56c88c48a13121793110e72c204f508e7182623fc47ae70062ac208e6f9cde08c46ce6d84791d0b8010dc00090c466e6c44622e24ee23115e2298ab033113a08610492c924054008de0008a39a60881f422a8f246e2310f04df0dd03310d9217242475848399807062310c621610a9d4d0ea32a19c9142621340822392084730ea9a5a210c23c4131082a63118839cbfe82118a9692e90823996e94411c7eb1c21cbd0472ee12eef825800d6000480320098815cb984ff013c023ca62024b7820cee8472dc11cb584547811cb3d00710a8d82200a130220ae68472c4e580405f70987e46d088c3eb87d150eca7220e55424ff40844d027225082fec261ee0987b70f661eb7280e4f8a393d540820277449611878f0f0881df8130ef84ce11877b0eeb9331987714f9880dd011c9704c3a811c9510bf9e7c30fca9525118745c9308c3a0e4827ea10a029325043584213c130e5391c10e463904108118e45c83c25210c82430e3b1d2107d842106b05e820179045392130e1106520c40b54818ef09e4a0261c0720a2604661be71fa3b7c629b6093ee824fb80986eb0dce1b7193ebd4d408c36c7cb0429a115601a6060ff36340230d9e1b2c35e7c60861abc35586a70d3e1a61a4e630d11ef410e3407d100f5000241c67b8c952e831c63317f10e3138ef0a360dd445c8a1845081b94261977174207bb840868130c9b8b3118645c5769c11986407a8881ea01a4c47b8c52a010f5f841e8b21fc40a9e0986201c58893ce130c3e185713ee27149c94c302130c0617e105fa023897712c3c1464f642fb62149184c2f41148f846272130bbcf5d3d0431f5304c2eb3d5823eb1572185cf0b88955185ecc20ecb0e8021c4104c2da4b2c4387e08e1ecf30179a185e50228fd937824780ee818a0000630b4616370e4330b16160c2bf857828e1470d4e1984615c2fb620f18636b101c5422d0e0812f426153977621c284f4310591c21e162e6810cc0001070833cf843840f0c0230a60d26004600048383b707220f00847066a2fc4614a8834230a43828619831c130343625a3041fc09010e090d64087044a2b843821704003846381c1b8db588658b30984e026137c26a5b2060db008a26426131c260e03cedd903b6e5adc61a8c1b2810ed985bc2c3430ed8841edc106c404700e13094b80310e009c00b7ff19849b092b7fc6ff216cc000983b2813090b7f3e2d2441c1b0800130dfae1ed880e6410eb7846fd29cec46116098455bf0070518df60237d6093bb8374086fa47544b238c19d01277584c21f0f3c4152508750420cd108df15be102c5000240e9b045072d6a8461091980589034988f728def141a88927a10b0d043a5011bdc0caa11840403d036100024033a0671000231bd8846f603254460fdc1f783e0637a50c5000ac00090c1e813079b7a02bb03307960f1c1e0c0b083796080f48260ecc1d430d46095509839f07360e56f12de1dbc237816efe8015b04c1c69fac460e2c1c02275604c1ba11bb58bef5ffe305f4846ed4dda041caa3f8c2306a046ebe105e481eb06983306908bc1183302375508dd492f908c191831ce440c23e412e45042a5810e3f846e970db8460c16e8939e5ff2106e8410a808b5310dcf0ad2084f3411b9d1c5c16823305be0b66e683305a82c2107104a68080318dcb45818981189e082581008dca42372538642305627751182ac56c0ad720421f21195184edc11b8f4e5e028200048276708dc6910408c146703041c09089d70237100716207f1040eeaa3e04609b573c20a3b04151c9d40545c333200d14204c5082a18542833b307e40542015800460004860974e7620965846df8dbec4088cc11e1038e04c11a11b7b0498100518236f43a502304584147c50e0b850c4e501304536e6ef8031391046dc62852f3b0c37644b2c41414098212bea88c107820a70d8c37329748436dc6db3d17c636d827cc21b6b04c0f981ef03c033100560004c6077c0ed81d703a36c52981cf038ce011937f0db54b39189b9b250085e5613036046d7a6d704606509818bbd408c0c29b38436af06c421b5684fc7a1302ce054c0a781489a6946d2c11b4a1b14109a842604efc63c24c608b2090600086268f09f8b42604a5dd423f14844cf813022c8381021b843694991899c82267008d9fc2604008d9ed33488fc4213f0f7079106ae12de08c07bf86c40dce0980ec408061d5dc240d57846cdc113232eb5100bf0207db06800610000106cd0365c40c350898ec27e0d090a78203f30980cb017b65d1835a0234f708d964277680980a8236530869bc260286c9a00ac00090c04d8095b22f75f2034dc23643098081303889b1a692c460189b0c9748636370920048c6038609f7e02378002181b9426016c02bf7d461a2d0dae5c806044301ea00006601109c1202362608977c2600b02e4202bc04340a130046007073033002d74a1080b0225cc33f2208dd84c00412ffea5c310d841b0708fbc012ffcfddc10d81425ff6097fd1b00a8dd1809f027dd7097fc825fefe0441a6800090847811af7701f10d7a5af14233334a0fc027480230002802cb84fb9c12ff535e04b044b2c85fe79a6c22ff2cd31100d14204c5097f8425fdf9a5a20cbc844ace12feef00c09be1ba084d2308d729ae4086b8811ae135c01011a427dbc097f4c25fd108d6e0235b207e622fe60407c642ac1ef22ec217f29ad508840012fe4191a11dbdc21915097f1529788bf877f0443595086af42359208946de1504e400460004a105d0863b42358d097ee0146086b1694144357c6af75b946050d09f68420373097ec6fd824ec5b5841ab884bf5b7eac40fee097eaafd48fe7180d8825fa6bf4b7e93ecb109996100aa840ea812fd0df9f117e75aac08bf38d5556c20c892c11aa904bf337e5445f9409302125869d3117e4afc8fd80308f8668a35406a7e927c65f8e306c03e007a8001297e282353609beb12f9086b54137d3857700d600048352cad6421a94a481117e116ab88befd3284431140891c425f7a6a2e210c404beeddac845f73069822fb95f716a16914cbe1896a0bce35590244c080f482096008acb42350608fa6c25f696a00d3fda7e90486a12fb28404e812fb1856f293232fb0df5dbeb631a76850d10906825f5a11a422fabad13103bf0234e169bf057865f5469b85d4425988f7297d48246f409319c25f4e698bda38634c298bc21a5e814610050825f48be8df55d673b1572837e41b10869608f111e10cbe8011a536761117cf9a4e8869341030804474812f9cdf3769268e5c6d0096031310025f352d3c1e900629499297cd0bca08be6212f98168c117cb06ad08be5435384054008de000865f2668e4d1c47421046d211a3704be437c81a35b46a1a5810100118001417c7ef8e88822e11a318d0d028a000085f1c3a502260b84fa748d08245818a0002511a0164e08de00088345608755025f170da422f89a32a10d12866b0404011e4260584981012f86b4402c54d6a885aa308589034988f71832e02068d097c1825f05be04225fd04be01f49843afc08195c24bf10832202342b685022f7ddef91005ac25ef7bde6a05465ef008a37420c571b6e22f764be21119b025eea588621a0704681617140a2800120255425ee5081f2425ee3bdc020ad60497a61116084bdb612f6d5ed767eb02f880c0209f45425ed267d297c8622a3454022f684bc510cf88b0d08bd9b7b2c433dd451e555c26f86e8297b20aa78bb805160004a154a096623dc65ec5bd892ed065ebe097af65d788679a119e52270000232f5c84a24a13e8304fa08119df84677a218045eb3bd5e89246224816882d0465eaabd4e219d694eb117a8911b13c719f3e6adb08446488bca628c5021f3dc25ea0bd3c2056d8c351052b80158001197a6fe790822ae12f4c04bd2c1376a04672052593b1036100025110404018a526445e94bd2215d4b8f8001285220a42a87c197a3c25e8b43e7cac867ce1097a1c250d80820442337107aa01ac00090bb60125b421d243a0325b21d281179f52e908bcf401e81b0800120cd825adb35bdd6442f3cde7610506025e720886b424b5108868025e6e668622f365e6a11799c9f308667c12f3184bcbe86104b00c278e12f2e5e5af99232f2cde58565a310b184804412f2903ee09c8008c00094965a1648421510979382c480c5293242f2584124a13e5d0466059a1447cb7092c6bae908dd001197bb2f410cbc025e380978dc99704b311ee42aa504bc6813ae404f950055445e32bc632c18632d8aa8422f174afd1178a6f135e2419788ef1020ee4ba4409720425c412f0e8425a612f0d8465761106892bc117867e4d081a4e12f0b32b0aa6430306040afa12f09a0b911784af0732a218ca7c25e0d0f92203e387c60e8032f05846528102c203d10996000885e09652415e065e0508ca3425e046510820892307644be461942b28440f231940840a1a13e43840e6412effddfc104878204cc0977e593888bbeec9b8420590977d086408bbe21036a9499101b4c21c087f2012ef68407032c008c0009464c9c90445deb326622ef48423c412ef37c7611f1ab71b0864a6c9459284a942046c432c852e02e20004a00e108809425dde234222eedddd8117754202ce097752ee9a01319f170228dd09774024c080c021254004dc3a12ee64a7864507fd084a7508c88c23222259621fac84bb8a1190e321911770aee008bb7ac82c2100cbb78442045db817a010100479094be1087e1e381013ba24b0863fc11fa2841df81038c841a2610fd884f8961086a86e511f12024a4f3f1ad6a8631e40805d025d9c08428c850149919766484908bb2f2904454b2084204231d720f0948432090bb2576458e80c04380a2c0008cbb1e418c418ef0928c82034c08c71d4de88bb15b78445d8808c6f02103a087d1c25d83636afc04629af08c6ccf9f88bafb288044a1e0975e424a19087ca825d760975d2eb9081fc22a581bb014a018e0004c319963300b386188e0975beeb654801975aeeb55d68bacc42eb1a97e1608000485d621f3ec1f408d8361000262eaf8f93117577e032969187b88c1f88219012ead182e103d8c25d54baa5f00867bfe3d883d3a4419062c074a0449e909753cf59048b03140004a5d4e62aa224f10462a4271445d4a08c533a8f08ba8d7512ea10c627a12ea00493aa13df684939e124e684068212e9c046250fa6c431253cda22e9a9e6970fc32e99c9c010359421e5709b63023116db12201a2847d0e12e9649b41126c4249ae09749d88549ab185d8423104dafc2187f84ba3cc3d04048409746823808a85610f0d84ba2ac3b4406cb08c3ad87530e78848424cc84ba201186b840aa81033c842e141031804ba19742ee848cba10f9504051609741027bc409261825d03ba05eee81de1004ec09cc0008cba0125f843e3c0973f025cfa08c2b47b6800118c2ad8548892e812e79fbaf3b3c05c4000940af01184f87861125a426d4e08c24c3ac0850da124b0840a121039d043ae81cc845ce808c22425ce6f74222e718404b210eb08460f4c1dd2e90cb9c2756c678a339192e0004c2c8808c1a886408b9b8c1a0ea28cb9ae8c8840ccd11000b5465cd25dc220e9b04f73212e675ccc11732425cc709ee502304b08c12b69008608cc114e870cb98bb46845cc209b45424ec708c0d425cbf39ec22e5f5cbdb976739c0ce0199000072e5cc91e10c09461a88710c102e004370002303e6046040c07847b810893c025cafb95a2180a490f1172ac25caa6017242065ca6b945edc865c9fb93dedb862ff90872c4e57051811ee405ee843958729487f0c3f80117f9aff1109f08263818b19725ae4a03a619724ee495c8f19723022208b914117ee84b90e104418438eabb8447b5a08526420b657fc823daa845fa2bf3ca808b53212364200fd0971fd7e388972e12e3ddc7ab8f2bf00848cb08bef076f88b8e470d44277b0817740dd0361000240e19869a00023246204b8de9db03a00c294c10e1304e90c117d492cb10be9825c69081e7022f9b6e2420e04844eb8117cb84b8c61245704b8bb7171eb40cb8b06fbc45c570e8a23d998414dc1245104b8a3ecba44e0cb89e1005984b89412e23488f465e32e22af645ec2301c404b884bd7842f5d5eb6217ac84b88170f6e1e7b202170da43c1b8a19ec7425c3127ac217a013d210bcf579e1b7c018c719ca2f376d864b2c65c2cb854217978b0b053c00048098b100622e147b1611708ee1117bf1970817920890c43b119118cf622109c484b831705ee0a8c + +def cs_24 : Nat := + 0x35d9175800118a2154410850fe1143f078b004600048783950dca1b1435a867b128a18d431062048df90243d508a182c45285a509e4164404509ca136c4137cb20a124ea006bf33ba4142428475088a0f941e14b0f810b12069311ee3141ba836b0eca0c1417a82ef046a0a81bb014a018e00058586b09e078e8988504b948c4781b5038a06d40d28190c2c0314a4ca0b0c013c0a280a5012a021403a806f01871402439a4fffe020827f862ae213fb27f307e112588584d4fce301c54f104fca3008427e34fc5610d3eea7d94fb160f53e9c387489f493e8a7d0b0749f2d3e527c8389f053dfd8334f789ee53db984f690dec427b14f609ebc5c7cf3e289eba1b88b890812101004798b0502df0427ab4f549e9d3d127a0efe862c10844f36dce05a38c98209e653cbf7ed189e2d3c527894f11df993c1a7804efa2bb4576047d62aec13be277a4ef29de13bba77401ea0005027734ee49dc53b7f7d9289da93b3884ec89d85b8a9c14215ff5b89084ebc2a749290001209d6d3ad0fe2189d613ab08573c13be52752ef9032bf7a74c4e969d293a4a7484e8e9cfd39e273a09d801ac000b4a1b012192a7374e6c9cd539a27334e649f01027314e5e9cb4657e04e52dbac6272509df0022723afb621390271e4e3a9c72bea94afa29c41387d7ca4e069c0937fc090409bf937e833125964137d77af4de29bc1b6192cb309bbd37726ed4dd40f540358001389ba66fe1b6a130609d81398001390bc537226da4db09b5fbd51c2401640005226d412844b2c626d14da09b3d36626c94d909b0ce26c14d809afd35e054300a8008c000a0ef329ab93550c4d509a9fbc8a697209a51349084d229a41344268702aa50d7f089586e83134284859a12165844d0499f933eaee12099eebc8267135a44b74a266f4cd8bb4956b904cd7de084265d4cb819046265b4cb4996532c3cde28995932aa6534ca29942157184c9e9939326e85921dddc20960089903bb9a63c4c7498e131a18eed75dc13148c4c4a9891b2c078e50f851311f7654c2e01ac00094851648fc0ac008f21dd8422611c04223baca60d4c1848a139d944c10980e13e9a4b201c5c14c00f50002413001a4601ea0004825ff4bfc97f52fe25fb4bf497e037420aeae97cc4b00c4be097bd2f725edee86977034c1c84b697612eb91d2049803e007a800041dcf12e9080cff6e944773923744f986035d2af80aa407a800129dcd8cf0819600460004a7731095cfc30eaee118023c2573a4b5496a4ce495cd2896a3b96a5a219dca82259dee4a3db862590846666941f8449628963eb9288ee3c13b8d844af095dcad20cee2e95c988a0c4ad895accbf0cae30112b4256632d61390011800130659426f86e81895812afa55eae20412ada55a4ab2955d2aa046f0004712a8a5504a9e95392a6a54830951d2a26fff62ae412a1f6feae02301f190ab07bc8bb08253f4a7c94f0625386b482129ba5364a6b07e529756f983ec71294a524062e441c1b0800131dbc528c2516195bb9288f6e94a115ba127e98adca103a00449e862dccee8c3168112780449de93b9276f6de49cd7eacc56d649bd5b4526c24d428d58c224d0499e055460753000222b6441c0498e931bb6a24bb497492e125bc1b449641c01824af495a929d25324a4835c63b658449369267b6324964924b5a0c2490491e923ab5a9049149221242a4824901daf9a9091c141daed23b247348e491c1236246b48d491a1233a46548be5f78000b86a2291720c3a45548a95a7cc76ad489bdaa9224a4484884910521fb5014890f921e34fc486f9e1d218c175485dda9d24170120806700cc800129da9422412ed3822b46042ea212cc47b8c2e9a046c1b0800120900824d00f50002411ffc15547f28fdd1fa23ef47dc8fb7b4823e547c88f8d1f0768a708f5d1eb08f7188f57b41a3c859cec55ca23c7478c8f111e11047808ef51dd8cacd79d84423b347648ec11d78dd125966209c23a7108e991d2d66319597d1ce767618d2351c8238d47148e21c01981ae8f744423864709d9c2b27237746ed5928e564746de1d986236d46d68da91b4074d11e663b33235f46ba306960404011e311ad0446af58e564c0d15bb6050b3184cb0004311a7a34eac6930580118001308d151a1f65d46744119c233746688cccb2086d529327119784465a8cb02178023000251a250cd60808023c82326464421190a31f463c1ba08561f46336a8c616240d2623dc6561b09585e07c08461432781b580f50002502a20481e611183d60c45fe8bfab02a2f645e671178a2ef45dc8bb517522e945d08b9eafda445c62604422e245c28b7d16ef63f97b661168a2d0459e8b3a065b018308b18215a4088b0915f88457a56702c3858407a2132c0011c457413b1b22b42b1c0d8400094abd88aabb18a2a445468a80c55e909579c22297abc22f40202008f288a45146228a45108a1eaec22834505bbf9240a644ee89d99e522712889bd136f62244bd2e90a55cb0889581cb808f188951129f61b449a892bb0b2244ab82890512064635956f911da23a447156e8a700dce3888d0a6d82d903d60d2c000986742008c0008cec2011114222615d811f58ab94444aaefc0b88001208889110a21f443d01d9109900c06c20005276070888381f8449618882d104a207440c8815101406d38880510021fe43f887ed0fc8a9406d603d4000a843edd804421ec04ee0004621eb28cfc3686337843ca877d0eed59429d7e10e9a1d243a04024c04439c872aac6a1c5438687050e0335c437850ac36a94996101190daa1b44367d7bca14162826220016a90ab0086a3af4557c2155d599f08432686410c7a18d666a8626ab7a18243028603af1a17342e485c50b8216c42d500950b22161a1d77022154aac0853d0a7214d4299556d0a4a148428a154c245818a0002e3aec84428084fd09ea13c7a2853aeaa135426684c7ae7a12c560a70465029801ea00048667c09553109132e74238846d08d32e24228844086428421e8439086a10c65b28419082a104aa8491081a102aa7e3107b20f4dcde33addc93d1083c107725d21883b5075886586839d0722ad7208385feca0cf419a8331fe920c8418ecab906020bf417c82f505db8eb6954a0420a54146ca5d04f209daa3a825904af5b07f648219675ac0881f4275a540e9d68863fa2349621033bf9f0dfe01ac0009440c2fe6502d205740a4813d027204d0daa0504000ac4097d674454fe407c80f4d06344145d60004e2a6609d65952d25d218fdfd016a02b54a840cf984eb1246c432cc09020fde10113f75403a80712de187ede464816a8ceb0c1100a201240222c148200d646e23abfb22d3ff87fecffd1ff93ff0738101ff53fe7538e539103fdb537cff41fe43fc07f76a6e1c3fb4c850fe8b20f031652a6a9fc83f8c30fe2c95e107f12a68083f8012a6631fe115326ed808ead610fd610e14ba430fd59fa93f4f5314fd21fa263da7e758f51f973f287e4baae3f293efef2a5e043efb52e041f723ee07dbcfb59f6a3ece6083c25210c8232a56843ec47d80faf99dd20a72421f5ea94afc4c82a03d500d60004e034c09d52021f55a93e20fa8549b637640f82f38d56307d24fa2818400024022b04a9307d08fa0d495cb8453aa2043e607cb9ee88c3e5a7ca841f28a9187c6dc71903e327c58f8abee73e187c2aa401c3e047c04f8031893dfa7becf7c54793de423dd41ef03dde3e6c7cd04a21b5663a9c04ea6c10f729ee43dc47b84864143dc0c5c8f6dd46d3daa7b4cc75291ea223a921ec13d807af4f5e1ebb3d7271f5d9eb13d5a7ab14a009cc193070f551ea83d4e7a908545c087a67a8e087d5e7a4aa2a0c62787a2c77b0c7d527a1cf419e813d0079fd8991c7d4610f3db12d11511cf3b1e753ce879c6a219e6e7d2c797aa1fa87d187940f279e4bea2652a1d04ea2010f1bb1061078d0bed883c6478b987e1e2a61f0788aa17048300049072106e810787cf0f75073c1e7838f06841d083816cc000a8f0c011873c42410a32421e0409d3fd86e883bfa77e8efc30d72077d8efaf4f918f96823e57359023a7a0de304b001ac000943bbaa2909e38c7c9c1186184e9de5b4477b0c3b96772441dc7130220ee31dc43b86f8f8ee01dbe3b7b5000ed953fd5076b8ed69dac259640ed59da8e9ce30ecf843b3b25b041d973b2c765063e2e3b1e7634ec39d86a7dcf888eb81d6e7c3c137c37430f74210eb21d633ac23183c04a21b5630eafd3e560e233e1899143ab67560eaab06a3a9e0554c74de0d8845581a58001294f6c21d3f3a7c74f69eb1d383a6e330d2f920e9b274c4e979d2c3a5674a8e941c3a4e7498e929d24ca507487a689d120ca603d4000ace99c10e841d063a0a7410e819d000c2c0314a4ca4a78473dce799cf2e98cf79ce70d3ba39b4735ce6b1cd5f010d180c0439a94ed441cce399a7330e65057b29d2f1ee488e97272ec2a0046f000450e5cd3a4396c72d019d820d0056000501cb3b938229d0847b629f08263818b207273a571c9939314e58e483da7d9d680e451c89e94e71f3a519c7638ea71d29c72438e4526441c71f6aa229c39c68e930329c21c63e92c315ec84e9247123a471c397b049decc53770870b8e168ad815ae40843e4232a3870a8e141c2618708ce10082596129b8afa02f2830e0abd6f38154dace001bfe37fa6fecdfd1bf90316b17c49bf4a6bebe04539c95e306fb039b896019d1dc2747137ac6f569aa1bd2379c6f34de5534e911e8cbd61bbe11e623a359bb8a6926eb0dd59ba9374a526501ba237426e77a319b935e941510e1b8f7a80204e60c981121e04e2018a000243a2d13d904ee000487457094cdcdc01b7e5e6edb0c965987a646dd0db9d33136da6db0db39b6436c69b7c23eb157606d8ba298836aa6d50da9d321369f9250c744d36726cd8d991b31365423f40ac008f494c5021b29c90420d919b20e88e30d8baefe4d40062c8530e09d10cd852ef24d16119864c18360c6c14d8210c8206c04d80268519d0e0d791af135de6bb3a1b1835d0c790452fa35c66b8063cf1359e6b3bbc2905da4ab5c4743035946b2576710358e6b18d629ac435866b08d609abd406af095e0835766ae8d5be459214b9a15708e84e1fcc6d80c354625d847421a5b46a59757777028f3382741e34f269e3bb410e82c69d03bc007a06c20004c1a71797669a4d321a63e8274b14d2820349c692c4260108692421a48e80a23a013c9d5cde6870d0d1a15326670d09088005aa339fc84792467f92e90c33fa67f0cfd866e03f205140009c33f467d8cfa99f4a54ef220cf4ae4c33c64669419df33bc6770ced8c6b29cfa8ce7882302139f299c8338a10dc000949500139ef99bd114a5034c08336466bf9ee8c3358b89ccd499a85c466684ccf199d33386668ccc9998332a66539edbce7b210ad204331466242a0046f000450cc4198678bc65ff9e984f53065b79e6195532a6439e4194e329465256f89946e78af1150526c32731e3861934787864bcc9773c0294990c91191f323dceecc8a4780386434c841907320c6412daf9899dc03e007a80012063fcc7f18fd31f863ccc78525531c46384c6d73b331a2c23b304783430d4473ab318b491462db1315c62aa920189f313bce9c55002450002a0c4c9898a46eb66926b05443148d421887310dce84b0d1030f2b620c3a18731a4c008c0009ce736efd426f00230002516bf9865e72aefa0c211841307e7290e249c3072b5c0c1b1835083816cc000a4e71860a0c132d67304660892f91c30426080c0f981e1ea2529083bd20cee048c83bd0094828c00980077945fd4bfa17f3a40b6c54bf65203585f800d780f50002439c197d748ae5f41dde97cb2f949144be22d392f825f028fd97a6a3ea5e7c0158001905e70bcc8001185e579bd178be6ef47acbbabb9f39cdcc2176c5a30905027480230002628f1175f2ebc5d74bae736e2e9e9008ba397452e868fecb9f2d0182a6f3d13042e705cd0219800121cd84b9423e12596411ef03de45d830b9308774be431ad504a3925c84b8ec6e12e345c679ac9c2e1e8f24b85970959d05c10b811700a3785be11ddace6a05b9427a8c2dc68eb0b6fd1b42dabcd18c239b0946b51c70407032c008c00098e67b4684e0a0ce6705a5cb4b056f29325399b04e6625a04b40167f92cc50742042cfa8d98290043d000450b3d967ae64e59c8b38ac9e3059b51aa166800460004a519008b254b30d18a18597d1a486ff00d60004a731b2ca6594519f0483000461645233a10b2202731608590d19788e6258ca042c7e2c6a58c8b183b1a0dd06177084a2f8589b98516202c3c5874b0e161b2c30585dd84160f760a5828b043b002c0345b0afd15f7a0b15caf895f075e057a4af451622bca5790af03aeb2bb85765d7395d475c85738ae615caa2b34397f842b808b5022a828b00025397d84587062f803580012056c8ad8bad52b5a56ae8a4036b01ea0005272f02b3e567797695922b225638ac651412b108ab0ac115806824282036208cfa8272e3a27255d796f9571a26c55a4ab415677578553caa7154c2a92551de2c02977620aa1954117542e9c241800231cb625d7882a64eab8a9708f72089c423aaa2a5454a4a941526a242545e88d950a0ac87585672d2088960215092a10af90a80036b01ea0004e72cc0944445a20b41194439d4b94ef29da53b0a75063d01f003d4000a829ce11d4814e429c74414a6cd101578e531287f14c0297fcb0d5df86987052cf95f94a522ae4287914a162ae30a4c84dda810a4b94962928aea8a482203291a5230a451489e56c51f9d35a1f42afaf1d3404e5641188a0428de51b9d31946820519f86d08a1c2518e86f145ae55d4360c1455a1a651355c3102897caa55be8c288274a0472a508e91822b7043725084a0f90283d42eca0d141821ca70a06940ca16286909ff729739ca489ee13dbe51a4f24319018a00028394184278b4281d1013ba277142709d913af275aacd1413a612d4179c6ab10e4f611d0b84b3f64e409c7ab27270e4e189c29383563e4df89be937aa11a4ddf93b136326c04d768419352a141fc9a5019600460004a7270a0f048606726c0dea20993132426464c88990d06c55f44c56834c58e51c9a82130226024c02830887b2fb661cef92f825ee4bd09792ae625dc4bb393192e625cb416096f505525a8837c966505290834495d80f500024392e84a09c4ab0955f92b204a9dce008a08e4a5e821b9b92141009411281250049f893e927c24f649e093aa824e2aaa89349268a067154c92a12504082182502e09c93c918d02918488dcce121c2436486890c18e492e65902e12052409e40cc621523ea47cd53a9a1d46546392284e4861392084730ea9a5a210c23c697c84723f081a2a49e8823a8a9688e691cc2396471fac71c72f246e08db50130c82508d211a111c8dc2723472da46482720023000261cb584a01246148c21182a00880284c09ca004127ff1ffe337a30cdc85e203140004811720845c48b8116e9feea8788a739543fcc5e5124ff40844d791288225987b844fed7286444d5059109727c6088010ff21fa43f087d90fa03d60d2c000a4c3c21087910f121e07ec087690ece42d876886d970a513f8486b392d3f3e433086418173010fcd10c09fb842e4c9b0404011e7390a04e420429e7ea9f7f20427d4ef0cac18e46484990918f0043904907f20f7c80e7e4106c164e25810720005de083c07a8001284198832906420bc4155c85028f3841388260820925734471f9084104820103b536640b881610293e7c4097e13a82040407c80f10119f62e3b87fe0ffb53422ac034c2ce3e6107f104e3d810f8b8fdc1fb71290f890fcf71c2738f4041f831268202008f20c63c20fb89f42207d71864113e707d00f9f1f3d3e587c971e29f2480c1f842190138ed84e3aee2cc40f711ee03db400090715da704438aa52ae3d6f8e903bf04f409dc000a0e39e7ac879c8f381e6cc55cc31531e62a504794819600460004e71c73d423c867bc101e323c627b8292e20e2504cd04e400460004a0f069ece3bf477da91e1dee3bcc7790eee1ddbc6f5f53301dbe10318049eae3b68f3c8ed41da61158c71b53ce6207658eca71043069384e3603ae0f308eb01d5f3d4074d8e9870e279347458e8a7d0ed00ac00230002338d50e7e70d039e48176f1ce8e18cf1c103c6a3999c2d8e621cc25f6cc1e301cb4396472c17551caa2c10000a01ca8e14cf130e4e094a74a0c0e4c1c97c67471d1e162e6a60717cf3e1038b8716f8601838a07138d271838998ab88e32c383470628be2e243818702a5d2403810701b82c1bfa37f06fdb0cf3877bc24f2a1bdc37b46f612cb2837a86f383312596438c816ee1bb8a29c6e9381e1b9c706e61dd20c3a0b1400094e314e0586dd0b040002506dc827a04ee000480db63b8a20b638db21b63c5fc8717d08368424f173b6e5adc61a909e283db840d899e18a2206bc71761ae6768ce37fe2d28359b8b9287c283588ac8086ff410ec90d5e1aba356e7801d8b1a97c5b439924e2cc34a06928d231a403475bf18d149dee3419beb2ce2badf2c4152509c55866888508c138a984e29b3b78428340ac8758460cb0195e32b8656ceda290f0024ed61940747064d91ba06c00438145800148326864c819f00d60004a4ed1087434643800118dea21da08e28031b86368c6b21c4e6763889d8831700bf00f500025389ab79a18a3c4cc8712e0830d427129089ff571508e246de158ab8c6f04569040c216efc306b88f377718046388b0bf617eb0e3080766093aa02376617bdc430aae0bcb9d34727446884da04ee0005627c8082ec8aa388e20c9ed85d04e9221c3fc20b949d170dc45c48b889d07a3b4e0b7d16f42de673e950116a9c3e05a60b4b6e702d1c64c3038b82d093cb0c1676af64470f409c3c61ac88e1d6dc8c5741c3115c382b056f0add15b870ac56c8ad815ae40843e4232a813994e1200b20002427308ffd1579396ce088aae155bc38a72a9c08153f394854d8a99703f882077551f02054b0a959c9a2a205438a86150a0cecc1fa49c822a0a71f8c14fe29fb86b8ce1a2297c52f70cf2138d8a238a4c1496292824c189c646f405220a436dde28fc51f1438147738b8de08f851455c329c36e3142979d8670c63732974861b95668621b6c89d0139e273a70a09c64e0027084e0246da35f14470b76d9826c5b6409a936f02697859cdfc36d52ce5626e6c940204b98972c0d8304af895e08ac326fa9397129b37bc4a112cb3025044a070a985ca438528a9e109af02a1805400460004a369f365967b847fbd1428da70226af11e62384d88ee4d54309a608eae12e23666f226a01190da450269b117c758462696116fc248459f08f113e6bf844a889411262247843b09bb299e443a9ae525ea21bc437086d293293841884de0fa211c42308459b9420bdb39882951371041188229b82207440e4dbe1026204b83b1aae1006c1b369aa4189e0004870740936b43d907b11af21eb78374292381dfc92787796ca41dd43ba4da05d281d9cd33875c247e1d5c3ab07559b32d9083a0480e7b3650412284e762382ecd9011c16837706ed0dd81ba0a06e70dca2037206e34be430370f04c10689c36986d1e094412f4849ae61a7034c85782068108ec868c1964008c000989acc1a21b0e86829ac2471433a0673e0801984330703933dec4b5c19ec0ca603d4000900ca5c0d43210c7f21355431a0631e0601880a702c160a2146e840c10d7ec2ffc2442017f82feb5f21886c4c8a05ea33721793812b5ec0b7e1f2119520e03e11af385ac6bc508cccd2859a0b31f737d51057c0d36b02bd05794b063089b05670ac7c060cc6054b6bae1517ee285370a6c14d429a19810a58d745706051e0a3bc0528700f4ab8131c2634d1c6b86654824d04994aaa5c296700608d04340b239008a8952c22288f720430821b8001189514218842b2176107420e041be001344126ffc07d1bfde684191c07680ecc1d8cd02322419dc091b0dfdc64304036006bed668c811f692907d824cf70c900cb37f490dfcc0a3c4028d6b1240f82f38d562863400c64ceb1893f424ce649e4101c0cb0090316e6774e18b409bf6426fd6dfa7bf477e84cd399a4d5a8e6fcf4eac2126b054410935026fc904ee000466fc85b20237e2042c34137e1355611330c2748023000241aa904997c137deefbc6a90337ddefba0dfe01ac0009430a74fa4424ab626421aa11847c3343265a04df6c1124e0a200f960d2c00094996011a9c843066137d86faedf55bea086fa6df4ad4a064ca948fe216ab84df40d4848e08cdf3d328988a0cdf37dae446f9948d2237cb84df2c0d304350d083bb07748c5018039826f9205f821596849916fa6c4350309321921e882596137c55f651009d020d650931fa63e08df0cee9c409044be4237c26f8011bdff7be6f7b98da412050b040002337bb827c11bddafa8b4d5191bd024c68be945cdc66f7398c406bc07a800129bdbf7b66f6b697240b8704ded3bd9a62823bb21bd951daacdc19312c4b0084764b358434a0088eb0b6e8620188ea826f60acc6237ae0dab1036a4223971b40258064c400930ec26f571ae016101e884cb000460bca04be6211a42348110d1f82d98001185a30223750930cda3d34781930c83b4882afa103b304de9b30a846f4a0e74226147d4210d19026f46983c21d9984de8811a2e0482201007b0468b0137a14c12981e8cccb2086d529327036904de81bcfe6065f0e20bb8420cc50858b07ad08463012d5184de761a3445f0608d0e820cac088c3826f37de6dbcd7799ef3275f606040bf00f50002a032b8497e457dc46f30bdf22379722ec11bcad40a880afa1379404de4a260444be1a2b2225f019bd11bc91a0708de442554405c109bc8378fdee0197b7824bd42b460fb816a90457e125e7959c0b0e16101e884cb00047115d0415621378b33f41102f824bc99790cfa866f13de23bc43787dc5528586826f0c9782211ae00f50002305e884977c8a2c4228909bc1d3e00867ac125dd84976e1377f04ddf57af8433d00889ec26ef76796237798f6e112ea59e1151402e20004a4ba69748219de0497420e604409a08cedcad20801fa1112604973689205a20b412027002052e02e200046462109bb9d12006480f960d2c00098166a125ca846752539a8b40cddc453806e70c971b56d846ee0971288955df8171000260a590444401376ccb8311bb608ab88bd301376b6ed410166426ed3dda403140a0800129bb43767086714ce2046eca0887e55cf0843ea125b9034511bb18df108dd861c6446ebf4ba420a1e00f500023375c8462641375b04dd64125ac04dd603da044b5509baa90d68896a486804334509ba9c26ea556b0201b104dd42125a384968cad2843337430c219990410401199784dd2f2cf842175092cec26e949670cc8866e93dd22acac64b326632237484b2d0b24310a88445d812595330c1015e82bc08964a4dd84401209ba202a488801a000446e840a4010f400110dd072c6c46e8008cbd824b17962c849c632ee0516000460b0509b9e59732118337801ac00098961a60fc44b0b26282373b6e759604cb55968036100027257f0174101a6024afa25e623737847fc8133358403a4115710495e84b9044af16588219608495daab5446e6965762106892bc1083382021f084ad4178802b0002425728d27108318232aef2502256fcade95ba82ec820b908ca9c21aa2092b6424ad7653e2372b87c84654303e387c60e8032567cacb95941e782bf8ef500027104a06981015e02208f25962372a125711b94954d089584ca1503e8c40f2137274abe957a1cc884aba08188025dfc09b92826e49dc90c9b86205908c9ad0282b2d1847dc24aadbbe22372084dc7c64c80008ccc7011fc4049546c97042035092a7b3180864ac1371b04dc6813ac70454a813718ee30259632ef00406401371611a111b8aaeec0823240b5446e270c342191f04950aa37446e22dc43b87c64a7e08c8b820da10929e08b2883fe81370bca7211b85330588dc22c86c46e0c08c854abe02a901ea0000a3211c1b220fe6843f944440b0d0cdc1013703850910441020bd109b80c26dffbb60236feca583f5ea7ec86dfa63e87ea8631f221b0355866df509293cfc6b5aa182dc42017409767021f8108c782a5e083ef8136f684dbd92900fb48cdbd4c74846de608c73859008dbc928d651a4a3394622c34c29bd080a3c26de2945c21f8484dbb8c6f046ddb08ac200ba04dbb05c8046dd59440236e983f711b74a50c889430628846dcf08c6802319d08c66c26dcd71c620f8c0494252847e0b8c3e1610f8484a900118c7841a4e136e131891f6607740c5000131759825d6408617023edd08615c26dbc93f4218bd86e5103e207c2869a0002436dc6db73dbe318b978a61003e007a800119b6d76d9edb093dcc59034a98db5b27a854c8cdb55b6a76d46da493bc536d104db43b680bf10cdb3ec4f077d098b1006536cd49d31127464e85d3a192731895082f6e124e384938cc4904312209b64cf34b87e18c4742311c3cb6d3dc649bf3cae236c6042f022438ad20c3c9c124dcc9b86224336c45d2911b61b6c29e3a11c413d4a49ab0926a188188dafc136be04daf7b5e872106e821b5e76bb88dae70dd0430ebf0c021873c424112668efe08dae05c2840630085c1c26d6adad3b5a36b28de304b001ac000a01bc2b370430c708c319f2608930c10ee78461785b4477b0c6174772440db709b57f6aedcf8317c01ac00098dab0136ab042d42136aa05781125b026d5192d2236a79d8511b5336a5495e19b52277f0892b6c22441d6a09be1ba066d44da84c1e02510dab29254826d3f09302369eed3b110dd02494a2a4a229ed84508c13699ed311074e826d2eda5a330d2f910da5924fc4068909b4a0e951d281832b02493af72820e910ca110152426d20087458230440924c72918887681368d04b9841368b4ec711b44826d1107602181604f70a1249084da1db43648eb886204090207cc09246020d08da1464cc415a408c04c26d06b9562180604180e2a784490917fa2fe947b800128560c26d0109240c2053c081d982034c08bffc21cb4067660fc66cfd91fa72c4e57051811ee6367d1fbf00d600048155d08bfc046884da04ee0000a6cf508bfa8aa3006b000243677afe5100dec26ced2a6c23a550491d9722846ce609b38c356885fa610a8784d9c5b37c46cde91b02d2866cd991ab2e5c66cd709b35021c4d09d801ac00090388e136682fc011232c22fbc1dbe236669c3511b3336656cc9d991b31e45f98384c136621c1744103366048b75f36dc44ac780c700027365eaf97102a64264d208ae7825c6009b2e12f9089156100c58491526fc40a2800021c36826cb2d96023657ecac1122782489c08bdc69ab885eda136540437981244a1bc84e5031b75849122bd9443d500922307b6800119b284dda1413110013900118001386eb426c9e083d3022f520802cc26c995e9e20dc90490f9d17c43d40083cb02487af63a217a204d921b23e4390c6fb013646ec8bb854336456c8836cc33642844dbe11f58ab8cd908bc9846c8390c94c9061b5105ca0528063800129217c9c488d8febc5c46c7e036c2363e6c7bd8f23242c84d8f023f40ac008f21b1de4290e7519b1d09a288b7f81177d845df21045d045dec12424131d032c008c000949088117772eec11b1b8248411114c55c6483f5dc899f062ee10920f443c080d46118f204d8d04bcc42edc5db04b74620e60920ce41800e1186b202482d106822415046fb01176304905018ec4482679bc2362ec820d0b23240dc8195d704a4082eb6c8a021e68045d62babbbb80c351e1362aaeab351035e8803e709b1442480a09b134d3c7768183580212530869d03bc007a06c20004a480308ba54248012480226ce044c241362084d881b0f4011800120695822e8808347c26c3934962361986f0337a33618ec2e11b0a4d0c888fc813612ae6610b99434c088fbe681446c238fbb6e9466c212386223ec19f31067c8cf7b12d19b08360f2e4e19b07017a0805e41360c0418d61360b6c15d82632ffb04d8231f2013d80f50002523e3c7c410b8d020c43626420cde84a5243684419b509b01f602c7b92286423dbc7b68f6a15e82bc148f6666552bf0c5c34123d8198d1095d826bfa08150023780021814f4890a5f2191e9d88a08098a11708ae0e11afe1e2d0832e01010780f50002323d13c5510658c26784cb0004416ff0432ae135f9042e14116fa840dd0135f7adf121a0591c86bec09afaca92888f22123c7048f16116f2845bc6135f2192111af8dad3086b46031c46be1322419dc091904a6611297848efb6d84840018102fc03d40009cb6be123bc082b11af73d3e08d7b415f44476e8ed8223b584a911e9d826bd55b7e63400c50001291d9823c1b080508212cb091d8826bcd09af2c22da4096d18201b608494c21897152e1de003d03610002616ce24d411af200c588d78e61fc46bc58e9d1d306041f0046000066bc0091d1d25e088e8cb5fcc320cd778123a1a4b0d3a6335dd6bb98e82335dbc73c11aec81e9083043bea046bae8e70235d6040cee048c42d555aa02123a029e0002335d384d74a135d084277212393c72210b4e826b9ed7391c7638d908e351c6238b858021ae6ed818804e8135cceb9711ae5874d08d729ae4846b90d71c2168b0417861238084d2111bfa37e871519ae1c2174409ae151fd88aa08cc3260a6b822e705cd0219800129473835f99dd19ae06376a3e2188f781ef22ec185f6c26b7fd6fd1b901df827a04ee0004e6b7cd6f7ade4623cf09add91e1088282135b9a3b71174102064108b37026b6f05f8235b60409ea10b71a3ac2dba188086b6808b33d1d208474036d407a800121ad9024f024500024236184d6c25ad046b5f5980b2f4646c08d7c2235e0450fe103c784d6acb2b0b41157d21ad5635746adf3e4435a884f5108d542235208b26068addb018b254688818b18b251d998846921bfc035800120b24026b4ad68e235a2eb4310b2156418cde191a68b1901dd03140004a6b41d681acf862c6f196a049409190d6731a40e940c8d1a1510440f309acd3e93088d0eb17046b2e8cfd19e066b295892eb8465159085720219bd08b10c26b20a2a4228a8042b6e30d446b1d09ac7180f08d63210ad604d62f4518422bc08b0bc2bd88d6265640422b208300826b0eb4e4235858467d41358404d60f190c42c0d09ac075806aff8c6c89eca6afa172e00046152e11ee2231804a24a107b704d5e7abc85be0cd5e1abbe3148cd5d9aba844625080d30222460853d204808d5cdab9630f2bd7166a535726ae357a03356eeadc57962c4fc9414578eff9046ad9578aea1c607e7337a2356ba77511183910c8808181110a845764c55c4149909bb50203f0892c223020444081230104d591ab1ca3f8a9921ab1022b9e0917ec26ac203162029989c011aaf95cb1467e1b4410f404d57aae404145909aaee2f8c5ef19aad55c42b861917a40c5887ab813558ab76111792d0aab7119aab62f0141a283040507f241105058a09888005aa435546289108691ff208d549683046aa109aa8354e08d537171e2e28cd5300f54035800120acec26a95d525aa40645b65644235466a8a103a682136908152426a86b3e0222d3c5a68b48ac2bae914dd001354104d5024cd80c58cd4fc1353e042e8c122cbaafe11a9dbca08855f61312984261e122c70455e61069384d4e7a9b753659d021a9a4212e009a99b532ea633590415690441aa122bec57c41963353004f511a97426a5b0915ca2b7d9bd19a9662b508d4a915a22b3c56524fa7090059000040aac03df25bc19a94b528ea4f19156022aa309a9362a8124b24901500237800238e6982454e551a228148409be1ba046a46d48aaa0466a4209150c24542f2062351f2a7c54ea68751951454e810100478c8a7010c9984d475a8e046a368a6223518aa5a4ba43097204d45c11528848a5314a01900c8a4a135156a2711a899521802b000243512451e8a37401c86a2208573422a3195002350f897611144cfff8833741350e8da11045bc2116c0680061000090d437143041fe62f2821ca7257e11a864899088a121228384d42fa85b509c5002113fd50284ee892c4227d9fb91113daed80889eb13cc429fb08a7e026a0d53eaa7cc629f253de119864c103f3e4328c1f8cd413a820fcc0cd40c13502ea0310a794854069b19a8045560889ba7dfc469fd53b842463c01053b0134fd9f6911a7e74fb08d3eaa730cee8cd3e4134f81f5811a7b858688638a134f59f52101814269ead3d03b7c644b70912d0244b18960a6a0669e63152234f2a9a2103fcd8d008d3c4a660444a7b2562225344a210a63420fc009a7742768809d4114c1dd6611a762249c4921f4809ec07a800138a5e02297608615420f9b1f3412886d590d3a21260469d0d39e18c0669ce890ea59c86410d393a7234e31ed121a6ff4df447c1ea01a4c47b9888f6a5387a2c87f20091821eb909a6d8f55885284134d9c47111a6c4269b0d35fa6b04d7800129a6acbf408d3545f8840f050911a0217db09a6942034c09a688269a188c02222e845222101a084d337a669486b88621a660765874019a65e22b17a219a64f4c8881d3412228178211a62c26989081d382051c08a3b42698409a60820e6d3c74238827a908889c6984176109a5f02029908b4382697a3c5220f1384d2ef2eec4039509a5d34b9442e1910b02042a0910aa214c428884e38980fc8145000282212048844a3104441f883d107620d10d2e01550428bb0910502696c080d0d89688881e4b2c40de909a5a74b4440918e07c212cb09a5974b128a01b6e404c084d2bc121fdc3f83b70306ca0487ea76c4443f36152234ac695611a555c01881aec8bb046952090fa0ecd0887ce3588ac80c6ff216cc0008c50ee134a71d8b0ecc334a5e94ad290334a3e94650c2321ecc3d887aa334a26942d2807548843d150987534637cb09a4f1421888794a0ec5b88c0d3610b12069311ee3349c84d2710f15bdb0c87850efc54c00f500025349884b0da10e8e0c9b23744f988692d090ee21db08876813493899c1031ac25863090eb4630089d8e1348f04d2381348d916f11a4682e90818721a6046916d22ba445bc410b0aa101b984b0a4101b6040b32113f93dd110162c2c480c502820004a27eb08304caca8c0e69ee413f304d2120d8844391b08c213ef9580110e3020905090e2b06c884fa8100ac008f11a3f8e5788d1f61347cc38311a3de1c003a6190dfd3dca7b719a3cd3d8dc8a182e4421b08f319a3c21ba0886e410a908438ee105be04d1d7a3a93d30c86d021a0477f4089e782436486c223471581a11a37f46f008f190d6d3c3082990113c104d1b4105768aec08fac55c8277b081778268d60d362346a434e444033469044ee0121a5f7d9109da4268cd09a32c20aaa69ee23464077b102a64268c31ab0213ab04867051d8468c14ea22219a4330150c2a1419d983f31a2fa1979bf219a2eebf488d1710ca8276006b00025219443250e3830ded818b109cd4a2288d165a2c218f0c4e5e9cb4468ad09a2b1b7588d155df00443166dc41b108ab034b00026138f84d14e505041bad090c3938c1ba30d2623dca27174e266e686430a4e1c213848362110c142689c1380220480425961218042ff4df0051400094 + +def cs_25 : Nat := + 0x9f533e9e7d30a7392bc527d2cfa49f473e8026d02770002707d71864113e7a7cc71e10dca427c9983f113e478ed881eede298438b3093e427c7cf8e9f180efc13d02770002827c49ebf113e18f58089eff3dfa7becf7c9ef53de67b9cf729ed73daa7b4cf639ec25f3dc4f5e08fa9824f5b9eb53d667aa8456283b4a4e5081d9879cc40ecb1d94e20864f54e36220f30179a105e5024f5251f021c389e4d1d163a29f43949e98e1b844f4b9e953d21c319e38293d1dc2e08035e03d40008c3c618dac40e582eaa3954582909e8ce14cf1308be3ac2502529d28113d152e9089e893d091950c9e7c1279ecf3b9e753ce47133157313ce279a28be3bf60d84000989e633cc2797cf2e9e5b3ca81a2029801ea000540ded107f024064f291bd4379c19892cb29c64424409093c9e793718ab16240ee4849e473c8a790cf209e3f3c7a78dcf1a9e333c5a7884f0f9e153c227838d64259712782cf049e0676486af2875313c09bf8496118dfaceb90d2b0e644277f049dfb3bf277d37e4213be677b4ef4193bb277537cb18549424ee89dcf3b9a772cee49dc33b8276fa8340ac80e9413980016924f420caf3a502276e4eda113b6676c4ed49da73b44a3042093b3c63d51681983e02281d2596227674ecc9d8e327631cf80ff20a00000946f3612760cec0e2581a6084ebc9d753ae675bceb6f01061bc2b157113ad2759ceb29d629fa860a0c132b2a3039a7ba89d5f3aba7569580213aac3b2806b000242754049d473a8674ece9c4f905274c1d61113a5e74b27b7193a4cb23889d1e127474e8d9d0b3a0a740149cffc3e305c0c9ce739ca738ce709cdf39ba736ce6be1d2dca544e690870c4570e0ac15bc2b7456e68d23939a2733ce639cbb396272bce5415328054b877800f40d84000949ca33942727ce459c89390e71f9ce1b41386a8d26004600048273b0938f671dce3a9c7338e10e81801ea000444e341487822c64e319c6138b67144e274e2abd44b0c806b0002a270e4e1a9c33386270bce169c233842707ce0e4df2b27064e0a9c133822701ce0016160a78000a49bfd37ee6fd4df99bf137d8c4df19bddc2a617290e14a2a78426bd0937b023d1408da7024deae138226f4cde711c25e24b089bcd378a6f0cde09bbfc23c44f9afe112a109020f80230002d26ef2eea1137766edc83819374e6e9778519373442388464be4426e64dc79b8d370e6e07076355c200d04db99b7136d26d7cda89b4f369931407970f2a1e51a7bb06cb01e3943e0ceed012149049b48d9483baa8f821368a6cfcd9e0eac1d4c000989b37365a6ca0c9b26d8f844d9009362e6c4cd859b081ba0a4d820dca226c025f210258024d7d9af1c12864d769aeb35b26b5cd6a9ad3359ce4d659ac7c0f89f3109ab9c0e4cf7b12d21356e6ac88e06c126ac4d56113550310089aa2d80840b040935226a3c244193511af90c436264426a1f0256bd816fc3e4232a313509af38f6e18d78a11999a507e11258a4d410d362269dcd3a9a6f34d669a4d320a6a14d2ff0a49a5f34b444d2c9a4f3496691904ab8131c0c58c9a3d346a68c846a08cc3260c4d189a2f34592a4109a29344e6894d119a1f34343741c9a19342e684191c07680ecc627800141341267e190c1933edacd19023ed24267d4cf70c901f2c1a580013133db7f3028f1933b5ac4903e0bce3558a18d10933b127e8899d133866706fd899b9bf5266c1c99af33544287c08d5b024cd399a533443baa8f8289d5824ccf49a8237e4ccca99933322663ccc6998a931d2620fbf0e6e25818355609330c27480230002426604cbf497176c085f950932f665e4cbb997532e665c4cb79968837db04996532c5a9c8c995f32ba656efac4be451ad504df50126564cab995532a66544ca7994d3292651cca26228b264fcc9e993b32737cb94992e3bf044c96992b3252649ef90991d32366464c8b9915321c10e028b0002e26434c84259632641cc829903320263fcc7e98fad3cd47c2498f731eb7c1074021be0026f7d1cc0216898498df31b444c6c98d6901864c6abea2d35464c6998d17d28719227129319a6314c60deda23dca149909317024c5a98b1315f7b34c52989c626264c4b12c0311d92cd6108ebc6e892cb188eb0b6e805400460004a4c4adebd311e6234c459889310e6214c404930f261c4c372f284261b6f531130d661a23751930cda3d34781930ca618cc30985fbd2d1b4074d11e682615f9f2112f0424c28984d308826f00230002637a34c1e11306e60d4c19982e420880409301260a4c134674326094c11981d7c4d19514981b30326040c980ed1084162c1eb4226034c059809586c84c039804d0e4e9410980330025ffcbfb97f2271c0cb00230002925fabafb030205f807a8001312fce5f94bf097df2fb65f64bebbdeb037924bea68360d2c0009097d03bd844be7de4b2f925f1cbe097bf2f7a5eecbdc97b52f665ec4bd7459ac079e4bd697ab2f525e8a2bf292f3e5e74bcd9798565c2b8856f2932825e504817c125e4cbc867d4319f4a5f2108a8d1500867ca55b42198001212f1a5e2161a192f0e5e088977e2f40202008f212efa5dea28918552825988f7189f0026f04092ee80118000192edc24bb6976b2eca5d8cbb044ee4320e4baedde72eaa5d4cba7974d2e90e4ba297432e825cfb3b72b48625cf224b06ba55f015480f50002725cdcb9a1380325ccc621112e6112064631853ac24b9697292e4a5c84b8f9719f3dce4b8b4eea225c3eed99709f3c881157092e06f4b08dda8125bfcb7e96f92dec55b058407a2132c0012496f52de65bbcb7643f2ae78c4b7396e52dc65b85e87292db65b65e81192daf75ecb6296c32d825afcb5e96bb2d6a5ac28bcec10a0c0496ad2d525a9cb5296a0cd14c4b4e969b2d309f5f45f292d2b7508896912d195a50c9686125a14b41dd34325a04b3f56763259d8496721259c4b36663e06580118001312cd2599cb326632425984b2f96592cae5954b29964d2c96591a49643ba244400e09ba10290043d00044197e0496392c6658c4b17962d2c5658a0b0541b9e6587cb0d96192c2e584cb08960c8258132d565a00d840009495fd2bf257dcafa95f32be257bcaf6927a9257acaf495e52bc65779495dd2bb65764aeb95d52ba095c93c74018c024ae695cb2b8e57090655de4a044adf95bd2b7505d90dcc21256e4adb95b23256bcad60f9832568cad0959f2b2e5654ac9959015e10208f259622563cac565123104291c00002325614ac1957eca0007c00f500027255f4abd95792aee55ccab8956f2ada55acab49565b91584ab195612aba556caacdc812aa2553caa53266a25521a0c688432551caa295403254f4a9d95392a6654bca9654a87254a91b10cb3024084a939524190464a919521f19064a8f9519b89654410950f2a1a542a8dd212a0c24c0895041800046802b00025253fca7c94f729ea53bca7694e929c904a717eb2225381fe83fc43039a7b9494df29ba536ca6c94d529a2533ca6694cb299028400230002d088180f5000232530ee0294bbb7feed81405420a7844a5894af29598fa44ef28c7c886c0d5619b7d424a5163c8225274a4d9496c782a5e14948db7b444a4294807da464a3f947b28f251dca3a94706251bca35946928ce518a9c030c71424a30f86222517ca2d945928ae5151f473128a434d889451289e5134a259449288650fca1d9439286a50c0ff50af6d36e784942e7c896d00c63361250aca149427284a508ca10941d28365064a0b9414c63184a09940f28194bd109407280b6de49f908e60f980009c62f61b94449f63dc460fc649f571701b54a4c9093e927ce4f96db193de0f791761cdb5c136d59d281127a854c8893d1279a4f26da493bf27764ee314752569078384ba84124eced9a93a6324e8c9d0939d2730f3c069b312728249c709271a4e2c9c4938679a5c3f18938527064dfc9be93765e0448715a44126ea4dcc9b8936f26d64d898935f26b4f1d08e209ea524d649a8934fb5f8849a6934ac3cc45819bc00d60004e49a49347268b6bb90933f267a4cec99b933477f0c6d6e0cf0008c00090932526458688c9321263e4c58de80ea60004c6d659310378566e1051484f1c430c66186224c3ed621126164c1c9819300c2dcb63bfe439b56e4be497a92f325df6aac97392e525c24b7496d92d725a5a30973b1a1d912f91092cc124b2496392c414200118001312574eba07321925724adb0891925664abc95692aa7584a495492a7254424c1060e233e18990cda7525364a5c94a2a4a524a4c948928f251a4a2ed2f3125124a1c9429282c164b12069311ee824a005643ac23249f493c049803e007a80013124ea49bb04b18c33c24935926622499493192610ed086d1a0924b981d1d000c2c0314a4c982bb612496492a9253249e49349259249248a490491f923b246e48d49199231245b6841cd318484b2e849129222733dbbf909221243a486490a9213241e4829cda02124824902920324017ff9491ff23fa47ec8fc91f672b0e5290fe4123e9baf8891f3b3d4448f691e81294e941091e412478c8f091dd23b647648eb91d523a3672244f4815e0448e091be2d95ff21091bd237646e48da91b02d28c48d691ab2e5c648d3d9a822468c8cf10187416280011923385838b040002417de0edf1018c0248ca91932322463c8c59187230646048bdd984be941f503610002e245cc8b8916f22db65ec8b3916522c55cf24915f22b52f90c915922aa454ce3f2122a17c388914cbe04539c95e21229645248a39143227e44ec89a912f2258e94284e5a1244a1bc84e50324494891911d223765114911522264446c9d374a5264c488309220a440c8805e9c19dc0919890fb21f3a2f8c90f6273064c0c90f521de43ac8747a72524390490e321c2437486db85452436098b100630db54b391121a82486990d1219e4331b6108b806280002090cb2192430c86090bf7064c0ebb07e112586485e90ba0d886485c90b7b1e46485a90b1215b63ac85390a49aa8e4850363a209a20bca11213a426484b90952126424131d032c008c000a8908abbb8d80268521210e42148411114c55ca483f5dc86bb86483e907b20f241dc83a907320de41b4834906720c2417c82e905b20b2415c8295d8d2363004904d209641248209039206e40caeb8251e1f9823eb15761206240b2eb15d5dddc0a48159029204464810901f2036405ec4d34f1dda0e4807900d20164024802900320026ce208fffb10442e8d0e802361f048ff46954b3400230002523fb6c37349a323f9ec338fd91fad73c14d8551f9d73786c20d7e6774c47e68fca220016a908fc51f863efc7deb754523eec7db8fb51f663ec19f3311f5adcf0823529be4447d52334212de048fa91f4e3e947d08f9e1880c47cd8f997fd8647cb8f92223e3c7c4111f0c621b132191f0a9490da1191f063df19b119b00c8a8b157191ee63dc47b78f6d1ed63da47b38f651ec75fea88f5b1eb23d5c7a98f511e9d88a1c8f4d1e963d1bc5a2065bcfe00809ea123d147a18f411e788479cb6e4125c2480123291e6e3cd47998f311e5f5f6188f2c10524af0c8f271e444478e091e30c97aee1191e263c447871ea241ad3048f091e0e3c147818efd1df63be477ad7be935ee47738ee03077b048edd1db63b584a802360d840001c8ed51da16df98d1211d9e3b2c7642596423b1c7608ebb1d723adc7598eb00d8901253091d5a3aaad97191d4a3a8fa61191d423a7c74e8e9b1d2e3a547476aa204381458001591d196bf986419aef02474577dc3e3c241800228611f0cd088e85aed2d958c8e7b1cec7ad0c4be41239d03c005000004847398e6f1cda39ac7348e63ae9ce6ba48e55ae84647288e4f1c88647218e411c7e38f471d8e391c6a38c47178e2d1c5638a47138e251c46387c70e8e1b1c335c9502ee4e19846b8b8e0b1c0c647028e031bfe37f46fd8df9ae1a37cb4d5491bd6379eb828de11bbc668988ddb1bae37546e98dd11b9e37203bf04f409dc000ac2e4010979848dc71b80b8a0397011e535ba08464be43236cc6d78dad1b52369c6d28da39d8500960091b3e36746cd8d99ada0a2ccf474822364c6c6111b163625ac9191b0a360eb5d191b0235fc6bd8d751ae75ab46b48d651abe35746ad2cec1420011800179ad46354c6a8d69c42353c6a65928eccc8345f091a9635246a38d451a8519b188d3d1a75642ac83c6545234e46998d31acf4348002b0000723490811111a40e94088d1a15104468a8d131a22343c6868d0b1a0633f467702820005646748ce719be8ac908cd8123354669d6411998add19b000d60001046658cc7198a330c65e8cbb197232dc65a8cad195632a46528ca31941159408c9d69d045a72091936325c64a8c93191f582ac112ad0c821246448c85190631f463c2918e631ac6331918ca318d1251918bd13331571918b85be0844c20f7917580002118b6315abea07380d8400018072e023c446288c4f18981a61016882d04446238c42225cb848c3caf5ca758c8c3bab8630ceade20536c16c81eb06984016a848c31185e30b46158c27ab56308460f8c1d18348ab034b0002d2305c60a8c11181e3034605d596723010474dc702012280002117fe2ff6ac41917f62fd888bf517e22fba1ed2117da2fa45f374bc422f91459109cec245f18be1aad62f645e98bd1179e2f3797749aab8245e4b42aadc10dc8a1d9e7c622f1c5e08bbe283f920948bbbaa9a2ecc5d88baf42a8dcc0397011e922eb45d58ba9aa7a2e745cb8b9517262e3c5c6d5303bf1845bfd52716ed597ab2d29aa40245b65644209bd9c1411aa262d68e9a1916b1867888b5516a22d3c5a68b49168e2d145a18b40ac1d582ac8b3f167a2cec59c8b33166353c9cd4ed16522c90c8b2316422c70c73d21069384d4e0abb8459d311ee21573666b111618245858b09160896e9055b4ab5c445818b00ab486457e0915f5567088af715ea2bc45778aeda96a2b9c5728adf15ba2b6c56c8ad715a62b445678acb15922b19275a1157c26a4f0915662abc5558aa5153e2a7454b8a9515249111a4d5915222a3ea421915122a145418a8114f629dc53932668229b6a381114ce29888d462a9692e90c8a5d14b629545298a51149e2929c8a48258046a2709148a290c5208a3d146d007828b00028228d200a130230ae6848a2ea8b82fd86ff00d60004c097501ea0000645138a2514462880da12845bc2450f8a1d1434ff3179428e5392bf08543644d0411311532222854508728c32282002b000233509c5001113fe27ec4fb89f513e227ac4f489e513c62786a0b5913ba27610c81913ae274c4e889cd139627144e153c28226f44dd89b9a7f626c44d689a9134a268c4d0899f133626644cb899313222629f58900d30244c38985a7ae25f89812912fa25ec4bb897312dca44b5896312c225710315a116d6048958a6845580698203fcd8d008895512a2253d92a00a8008c0009c894d12884449e893ba76d8c61017941224b04892a39804449389243e9013d80f50002614bc0489231242247a97221123451e849100460004a170a0912334e6448819121e24344848907120a240f8a439a7042448052b02223f447b88f42a7881eb909a6dc24474138a2223884d3621149c844df2134d68452647a584b00c88db11b0786099d09d801ac0001c1e0e1223544692fb63223383d500d6000484466d34422231c46288c3117a22e312d31116e22d44593ce64222bd8eb25963222b445588a9a64484451d31e234c584889d1130290043d00045222544498891111e22344451cda78e847104f55111138d3088887a5f040715085d5414580011910f221d4439094a02c800018887110de21b4435885f10b6215c42a885310a2213c42688468bac000bc8845108620fc41e883b1068c30d709106220bc41419a5ac1a2029801ea0004a4410881f1038d64108819102e2054408880f101b4b1440288010ffe1fdc3f83b6e5adc61abc87ef0fd61fa43f387e30fc21f7c3ee0f52008c000ac87d90fae1f543e81ac84b2cc43e71ac45640637fa090f961f20d591aaa0004a43e387c50f821efc3db29625139d8850c2121ecc3d86fbe12bc21b8001310f52c454eee0dd0421e9ac88110f4a1e8a84cca78421e8693d021c0a2c000948794a0ec34e828b00025034d842c481a4c47b8c878f0f19419961900d60004c43c587870f0a1e010d262121de8487790eee1dd43b8876f0ed0c43b387610ebe1d76923290eb21d5c3aa874f0e903ee834b0002821d1c3a287430e80cd894873fa44c44398872f6148615a4090e5a1ca858b0b120314a4c984fd47050443938724301c54f1006c4121c8c38e06ec05280638000309f7cac008871a1d984438ac1b2205f38e84110e261c41cae0a3023dca4386b0742f240f5834c290e0c243828703a3d06437f4f729edc6437d86f6221bc4376171f3cf884374090dce1b708d1da105be0486d70daa1b4e8e6210d9e1b28886c90d8ac0e0c86c10d7ac0b0c86b90d6e1ac8c86af0d5a1aac35486a70d4a1a89c3108aa0a2c000ac86a10d3e1a7434dd1a4521a6434b86950d221a3c345d1967219fe8c64eb8317cb8486790cee19d433986706ffcc4336866b0cd21990a8402b0023ce432f865d0cb57c390afd212196432a8653a2d081bdb031622192432286430c8218fc31d4e5828f8a1c170a510c6db75884e4a1218cc31686290c4a188c3104e3672187430b4e2e9c4cdcca5d2310c2a184c308860da2704e01886044b2c4430085fe9be00a28001290bf0226f336f80318e339085f66de09e38cd12a1217bc2f385e10bbe17713970e7e0005042eb85d50ba617442e762ae6385403f009d2008c0009485c8136813b8001210b8a170c2e03678e824a42df85bd0b7616e42db4d6ada70e42da4d5c9aa8642d9892c2216bd7a54d3622f8eb09485ad0b553490c09060008442d485a70b4813b8001290b42167c2cd190b2c242ca79fa2216442c64cec21b84369499310b1616242c3d0d10afe15f42bd85790aee15d42b985706af5a42b7856d0ad615a42b385630ac2156834b0002a132788100c3abb84842ab85550aa44b010854d0a9615242a3d0a10a743d903f0892c9214d848535a12214b429585281e041b08000410a46148428fd07d0a2a1444287850d0a16141c2828503a0e213dc27a84f309df419970a9909d03772e7708e60f980009884e011bc0010c84df09b2135ab2d2109a6134426784cd098835c15a4390986130682384b5a084a42594ba42033fdba511095f40f0884a6271c0cb002300025212942519ab232128424e849b0932125a5ba0c40721256810160a321244246093032b9a84848812121c242848309008b914847d08f611d0c0b7e1f211950c847308de11b4235846508c61179c845908ae1154229844f089a1122574728c92111818b110886110421f8439dc44a421b84350866b8810842f085a10ac214842611bc0011c84250846108254b088a23dcc67ea080fc45bd836100024210367e284079f7fb7b9483fb07ee0fc19023ed2520fbc1f383e59f68841f04a36f0a8272002300026082e84cfa95bbc441ea83d307a20f3c1e683c5078439f80014893cc241df83bd07760ee41db83b507660ebc1d683a9074a0e841cf4eace33e1c1c8838b9efd6c814cf7706f20ddc1ba6aa4520dcc1b8836f06da0d941b14956c4c900f8f0906000861847c334220d841afcf61069e0d341a58349068e0d167a930263d052e9348339066f3d18c832b9e7a0c8418e831b06320c5c18a831306160c241838302912c4b03c830105f8bd60d2600460004c678d0905f20bde78769ee420bc8413bc120b9c172484a23ec07a800130d3acbb938661905b02416b82d505a20b3100e2a120afe77782b505660ac415782a673d130482a505460a8414f829d05320a5c14a82924bcd44148828f59d986b90479618c044146828b05120a1c1423590620a0413fcec2304b004827904ee09d16d4208e8cee400f500024209b41341104cd1cb8da0032c008c00098826504c609816a72d485690c16a392e221c0184825d04b6096179421594c2237d46f420446412b46e82774000908250763844127824b04920910e84288da42674209047a08ec11c46ba4208dc11a09ea32611848233046208b411421044a088c10f46845c28a410e467422085c10a08b2115414580013104260844107c65443395048205040608040ff5dc25118e162c1eb43207ec0fc81f703eab0b161606c47207c0481ef03da07ac0f32103c607840eb1903aa074c0e881cf038c03580013903891798881c30378440dd81b88ba077b10abf61206d40d981b19c1a06a40d181a1033c3e624819d0336063c0c62b460fb816a9c818b031115d0c8185030606040bf18045205ec0bc817702e205bc0b62ada23cd040b52c342205940b1816102be05740ad8158552825981450002b2055ef04112eec20bae093403d400010815502a19e5227121028e05140a144d054741b580f500028204f8578112e902409e813b027204dc098812e1510e4096812b02504e010812012047c08e8119022a044a236278e7204412cb11021a042c0848107020a0401880fd01f53ba8c80f42b6c2e2814500025203cc07880e888381f844963101c806294991901c2037406cab424203566c080ccc4508406480c7018a030c05f28877d39d8880bd016a02cc057053003d40009c80ab015024c0c80a7014a0288a42a7d252028404f809d0132025c04980910116021c040435e86b1770b4807f00f90cf9b98072e023cc403d807900ee01c4037667c6201b403527aa9be482b4a0900d201888805f00ba016c02c805700ab34c1c80519a4a010c01d8039006a00ce68d410052009c011428242008400e110029e8a08800f001a002c004aaa852001c0028000fffdfff667c300a2c00088160a11ffdbffa7ff2ffe333a10c830ffd5ff98844e211ff93ff17fe0ffbdff73fec0d3671ff4bfe87fce023401580013199ac23fe37fc483b92e9107fc2ff7dfef3fdd7fb8ff6dfeb3fd47fa091fe7bfce7f9aff31fe5bfc97f8eff19fe2bfc17f7efef9fdebfbb7f74fee5fdc3fb50056000683fb47f5efeb9fd6a0780e9a23cce66457f52fea1fd2bfa409960008e3fa13a5021fcd0d55000231fcc3f977f2cfe55fca3f927f22fe3f920a47f18fe29fc4bf877f0c4765ff21c7f06fe0952d25d220fe0731519f318fdf1fbdbf7a7eee4668a66217edc18806661df1dc21fb587f90500000483f6a7ed0fd9dfb3097628fd886d088cc2811faf3f5d7eb83db88322308fd6c965887eb4fd6330354d920fd51fa9bf507e9efd39fa60bd00808023d23f4bcbfa2027744961197e820efc08fd10fd9b1f918fd0c873a7c018fd09fa0bf407e7efcfb2f8187e7afcf1f9dbf3a7e6efcd1f99bf307e5891f95bf283ef831f93bf247e461510865de7e3efc79f8ed4ad28fc712de087e34fc65f8c3f177e2d9745f88bf107e1efc39f85bf0a637cd1f83bf06cb8e1a6c83f02cb8821f7ee5c210fbe9f7cbef87decfbd5f7a3ef37de4fbc32dc3eeacb68fb95f723ee27dc151e14bd487dbcfb71f6d3ed97db0fb5df6b3ed47da6fb45f683ecf7d9cfb31c3eca7d92fb19f62bec47d86fb04e3ec07d7efaf9f5ebeba7d739658f539ea448facc2659308facba8e087d62fab9f56e58b1dc208ec37a034b000091f52b13210fa91f513ea07d3efa782db80f801ea000123e9a7d32fa61f493e8f28fa29f43887d0cfa0df403e7e3c74238827a9c7cf995e0f18636b20f9e1f3bbe757ce995c1f37be6e7cd90dd123e6b7cd4f9a5f341e0428f99823e637cc4f985f303e5f7cbcf9772b29def48f96df2cbe554cbc41f293e517c9c31f2692cb10f92df253e487c8ef919f22be437c84f901f1e281b4212a001db110f8e9f1cbe387c6ef8d9f1abe34e9ce832a71d963b2831f170d591aaa000483e2d7c583a1063e2908f89069300230002432a2be1b7c32f8629f4944ba410972047c2f950183510c820055423e137c24f84729bbe0e7c1a333444002d548f831f0582c5000241f04b5aa1194ba49f887c0ef819f023e03609c51f00847c00f7fdefe3dfb7bf4f7e5efc3df77be9730943df3ca3a21ef7bded7bd6f7a5ef0bde07bb8f76deed3dd97bb0f75deeae51170f741ee7bdce7b9a730c60080540046000123dc87b8ef719ee2bdc4ca1063282bdc17b7f940883db77b66f6c1ed7954728f6b5ed664fc088603d4000987b48f685ed03d9c38eabb84c3d9a7b3254385b488f728f661ecbbd9418f645ec814ff18f63dec68b4927cc417e3847b16f629ec49c4d179451ec3bd86387ebee9114947b08f601ebe3d7bc9be7098c3d797af0f5ddeba907ae6f5c9eb8bd6ec9a8532690438026ffc4054008de000863d6d7ad6f5a80c5907ad2f59deb1bd627ac2f58139d9cc98e20444608f08f57deaf3d5d7ab6f56a18f187ab09cb443d577aacf556447a32f28f549ea8bd4f7a9cf52ca2f5b08bd5c34e828b000241ea4c88310f521ea33d44c95cf500a3d3f90f06e2863d3e7a76f4e462f3f086e09bec087a6ef4d9e9abd347a62f4c1e971b6a967291e96bd2c7a56f4a5e943d277a4cf495e923d237a4407e40a2800070f47de8ee48e153c41e8e3d1a10f45cd9659ef030205f807a800138f44c106802b00024324208f69a5a33241047a20f43de873d0d7a18f429e839c977611e82bd047a06f4088641402aa10d80268510bba821af85dce21e80647010f3f1e7dbcfa79f0d6a8a31e408f3d423cf479e6f3c1e77bcee79d8f3ade74e46348f3a073c8879cd9175e6f0c79baf36e97342ae204aa823cda79aef359e6a8976284a3c3f3047d62ae41e69bcd279a26a5482eaeeee021e67bccc799431e63bcc679899119e5f3cbd7974f2e5e5c3cb7796ab0d2d6c3e10f2ca3fb887962f2c321a9a4b20980423cab7952f2a1e53bca6794af28ce3ca2793ef271e4dbc9a2b4861e4c1a11341ca99883c97792c6818d01881128f251e48bc90791ef235e4619f338f22de453c87790a96f0a3c84232a4b2c647d108f20f20d88bfec11e413c8178fe31e3f641410310d8990878f54a5034c0c78f2f1e0ffa0c78eef1d1e39e40678def1b9e36869b40f1b1e353c69e7b241e333c6578c8f18829b829e000271e303c5c065c1f2c1a5800130f16823c59c7f4f15461963099e132c001108f3c11e29154710f141e27bc4e789a1ba0a63ef08f121e23bc451810ac85d9e0b18f111e21bc427882f0fde1f73c038649cc92069818f0ef1f08878711dfc0fc8145000251e1bbc367868f0cde1863d730417423c28784a21e12251010f08a927887842f07f1e43c19259651e0b847828f0456d60c781f8ef8c4fccd520f039e06bc0b1948dd6cd24d60a88431d9bc0578000960035800131715423bff77fceff063bf908b61023bf8c75220385014a018e000483bf277e2efc1df3c74128ef99df2bbe477c6ef89df03bdf77bcef75dede39c77af48347a405643ac301dea8477a8ef4043bcf622821de63bc9779091a485b1908ef18047887788ef0c0628141000251de1034b000231a8684777e914403d0361000251dde25f210eee9dda887760eebf1bf9c14205e49a7b882f1c15bca4c8c7756eea8bc2a8f820eea1dd23ba0773cee6ddcd3b99a3c68168984772eee59dcabb947724ee45dc82d082e9c91dc7bb8e771aee2ddc53b89a39c1afcceea47710ee19dc2e36220ee01dbff356072e008c000982e20381007a800120eded1e4848b03140004a3b7a76f2edd9dbae3522df08eece3b7308edc9db83b6e59ac41db53b6976d0ed9d1d21476c6ed89daf3b5d76b8ed651c79c76aeed58b4e179420ed45da83b4e769b4670a3b4b46ea21da4b47510ed18b40167f92cc41da2bb447684ed05da03b3f767cecf5d9de336766aeccd8345f08ecc423b2e7656eca9d943b272c94591ce3b267648ec8dd913b21763e61d8f3b1c7632ec61d8b96240d2623dd0561b08ec4dd893b1018ec39d868cac18ec31d83bb037604ebf0a3afa75f021d7b3af575e8ebcdd77d1622bca578830eaee150ebb9d76baea75d2eb99d709875c145596218c75bc13180102410eb6b17cb018194520ad20875a8eb4042c2c457421d673acb10eb2a8a0855309160628000987592eb21d63bac6758aeb11d61a2a040eb09d60dc55198b99d5c95492a8e431718baa174e120c00114756ccf4043ab1307e21d583aad7558eaa688f315730eaa1d52baa47546ea8a88b987542ea81d4fba9d20ea6dd4d62ce18ea59d4aba937524ea3f56f18751caf2c589f92820ea2dd44887510ea18576047d62ae51d42ba844eea31d41e2bd74fe5280862b974f4e9e5d3c3a7774ed8ab5d36ba6849cac82311408e99dd333a6574c4e985d303a5e388790262a008e96dd2d3a5903ba062800098571211d2b2b8610e955d2a3a5374a4e945d283a4f287e974923a4e749250b063a47748ae911d21ba427482e8fdd1e01410000a1d1d881110e8e9d1c94096b5441d1c3a37746ce8d49f5f45f30e8c5d183a2f745ce8b15a5187456e8a90c40c7452e8984d225bc20e895d123a237444e87e84e98743ce871d0d3a197430e859d09881140e845d083a0f741a24a834d987418e82dd055089428251d03047402e8015888c73fae7f1cfd896020e7e997a0873f2e7d9cfaa11e4ba451cf8e25710e7bdcf7506c8b2441cf6b9ec73d6e7a4839e873cce795cf1e24c294174208f708e779ceeb9dc25cc031c0009873aee755cea39d3c485e4c4c39cc7390e714276006b000261ce1b9c2f250309530802000231cdfb9be737831cdd39b77368e6cdcd9622c735c1ef92de24735a49c55558c8ab6122ac047358e6a5cd4124b24901500237800240e698239a355222310f399fc436e66710c94f20611cc9398f731ce635cc6398a7312e619cc2aa6350e6022988872fee5f9cbe91ccb74619e0011800140e5f1cbdb97872ece5d463f9872e6e5ca8068c72e2e5c1cb7b96c54762c2c14f000140e59dcb32a3618e5900a500c7000241cb139611b56330fb917210e5688b78872b2e561cabb95672a244d0c394b17f4a3e0661ee08e525ca3b9457280e4f8a61e708e4f00f5834c18e4edc9c5db018344c23936726ae4d30ed10db2e1461c9806e810e4bdc96392b725442fe79f187252e4a1c93b92420e4827ea10a0293241c8fb91e53bc32b08391d7231c820fb490722ee4598ea0c7228e448835a5bc20e445c884fc618e43dc87390d72180a30a39057208e40dc8138fd1dbe61c7d38f871ec31c7afc2710e3cdc794faf895c41c7838eb71d43fcd8d0148952130d838e671c986b480fdb89487c4819d983f28e389c7038dc893410100479871b6349c461a308e34b0cf887190e311c61b8c10dca530cab8bc7176e2ddc5b38b5716671c5938b0715b3e2c838a97150e29dc530f4590fe6054f04c31211c52b8a47147860c794447130e27dc4f389b71333db44b0187130e25dc4b38939ec85f6cc0eff277221c4938917120e23c777027a04ee000504f5e08e235c460630193d5823eb15718e22d896887114e2242e2002b000251c42b8841d9279b01ff020f01ea000500d26004600046388070fa1390011800128e1edc3d387970f0e1df0b1b8731d14fa1d2387070dee1b5c35b86a70cf8565c2eb85a70b2e161c2b8b0569854dc28b850709e591ca384370833cf863840707ee0f9c1e383b7074e0d1c19b83148e0c1c17b82e619e41c143827704c0d0d89694704ae091c11e13f20e085c10381d7038e06dc0ce13838e05413b0273000240ee2847028e04dc093811702184b8c380d87ec21c06380b7014e025c0394700a11c0238027002e001bfea87c30dff1bfdb7f76fecdfd1bf9b7f26fda1cc924efe08dfa5bf437e76fccdf95bf0986fb2df5844eee0dd021bea37cf6f9cdf35be5946f90df1c6688c6f8adf11be037bf63c851bdf37bc6f76dee9bdc9d28318410260ff6f6619d0338800128dec9bd837af6f5cc108a37aa6f4ede99bd2c7d128de91bd18616018a5264a37a06f3ede7461cf80ff20a00000906f38de61bcbb7946f26de49bc8378e6f1ade2d41cd9089ff5715086f12de1dbc237816f00ddf5bbe377b6ef4dde5bb9b7716edaddb1bb58bef5fff1306c846ed4dd9c08d8361000251bb137616ec02f240f5834c318341bacb7586eaedd54a37526ea0dd3dba7374d23e462e45046e982e3e79f0c6e96dd19ba28b7c20dd1273cbfe418dd0db9fb73e6e76dce9b9bb7361676af65237356e60dcbdb97372d16062604e372c6e56dc9c81c0145000061b92b7211182b13ba8815b9a348437206e3edc79b8ea76728dc69b8cb7186e28dc48a1c09089d70237106e1e3f886370e6e1adc30a3a836100026054727501517df208311408062c2370a6e138251b82b6fe6dfadbf1b7db6fac11ea0def046df2dbd9b7a88f720dbd0e94086de2dbb9b76b6ec6dcddf00c272208db95b70941311000b54a6084afaa2138c1ba30d2623dc836e0fc9a21b6b89c510db5703c36d06d9edb39b6536c76d8c4f04011800158db02700889bf86daa59c8c6d7edafb0360c6d7adaf1b5de062ef5051b5936b1e1500fc224b146d5e0d88436ae6d542302bb69d4d5e23cc8369a6d32da61b4bfe3728da4db497e31e126404590483000431b46fe2c219031b46368a6d12da21b431aee3021f533cb1e419f88cd70086d02da01b3eb67c6cf699a0195051811ee91b3c84fc3dc1e443671356c226dd12cb10373827e1808204030eaee118d9c1b37a64a1825802366b9b605c7c00090186a10d4887cb06960004836660898d0219330980c1b2f87ab1ae8f744a365e6cb8d96db2d3657c05461b2a36515d2a31b27046c98d92db22f75f21808423644c03c48a139d906c7f3634d258cc03136192e90c6c6ed8d9b1afdfb20d8b5b16362b345a1b5cb90186c55f7c12f48c6c4f8038436240d3021b11b6226c42d881b0f8397011e712e9040cff6e944361a6c33f78865ffd6c22d841b07dffa28d829b03861d5dc241b0336044b5a0a2c00094fbb2d7fdafe002b000251afbb5f6bfded7c211e14fba4d787ee70c0d3611af025822596312bf04fb90d767ee30c622811aeab5d46ba734b4835d06b9ed739ae6cd2328d72a68d84af086e0004a35c5fb7c1b9467dbc09f6defe888fb6864cc45fcb6b5ed6b9ad635aa2894f0235a76b4821ad135a16b40d67dacf359dbf80d65dacb35946b24b1ac7905d1063b09dc886b1c0a3c4358c6b16d5f5abe357b6af2d5e2fda2062ae10a4c846ae693b16d60c6ae53360435706aded5b9ab6ada0280d8823569152e1de003d03610002603baa8f8109d5827d956ac621ab1356010d5743aa0830fc148021e800221f640b0d08fb1c11aaaad8410d551aa9df976a98d529aa4b5476a8c1bfc035800158d513ec2353b30702874214831f004600052353a6a7010524af106a6fbeb1a97b52e6a5ad4b1a95352930263d052e92c48fe11a935f7f6a3df5e1a8cb51843107264c846a26d443eb88c6a18ff904350b48a65f0c4b505e71aac61226044be411a842b2d10d41feb5886a00d3fda7f1799000251a7d8273000231a7b056f293232fafb4f169e0d3bda7734ed0e8071a748469cd5a4c40bc3083980234e369c4d385a6fb4de51ba61a6e34dbbea2d354834d369a222fa634c6698ad313eaeb4be697ad2f1a5dcc5c50d2ebeac34b16960d2bef9fb4a9694d9d8525f3c693ed2746349b69328e8cee400f5000261a4c34966929f54a61d3488690e35c02c203d1099600098179408d21af9734802d18411ba8468f6d1e9a3cb47668e855f4c347268e23a106236908d1bda3696791a70c820a346c68d6d1a9a34fd4228d19564c0d15bb6040b3184cb000431a31b46168c0d179a2efd3b46805938237800250d15da2acc0f68a5f4da6053447981081a223443688058a9ad514b54610b12069311ee33e95024c01f003d4000946870d0dda1b3435bdfcd0c1a17fd2381d691a16342b68503117d0c7709fe027804794684cd096f7ab41f683cd075a0d34196830d05da0b0981612f85a09b4126822d041a0718681ad01da03340568088b3580f1cfa392f48ad20c67f8cfedd680cbdb0cfd8acb85710ade5264c7d171804219f833ec67d4319f4b3e867cecf959f1cbc530cf88b0d0867c17b2c433dd67b8cf6d9ed33d84f8062f616efe11f4319e8fd096792cf2289298678ecf14433c46782cf019deb3ba67737abd9d9224816882d05633b16760cebd9d733ad67577a8911b13c749f3e99d0339e67392e25112abbf0d30819cc339715b630d4814ae2596225c184f9e413e778ab60b080f442658002317a4821488290aa1f064b74670b7a2d0f9f2b229f3819be7cde18cdc99b8b37066df2da19b5cb643a50819b2a5d211f3659abb35666a6cd4af38b34f669ccd359a4b347668ac19a184f9a4109f7036b01ea000485e676680ccf865e6227aa9be467cce08ccc1997332bf990cc9d0b8a16e12e00005233236643f3110b01c2401640004e331909f301175800118cc39986b30bbc9042f230466059a1445e3d09f2d197c32f765e841978b2ef65dccbb1975b2ea65d3f2b19727ca965bccb7596e32db65b0cb5996ab2d2bc5733e520425e611966b2caccd632f1020ee4ba431963b2c6f93eab5c87c9c6578cae595bb2b6656acad195932b16560cab4401b01dec119557c93654d783995114f9201194e87c70f8c1d0084acd652cca55949879e382861949057810ca41947b28d18ca299443287650aca11941b28138c9f993eb27bf9084193c327664eac9d19391d2830c9bd9365df4219041934326764cc81283668424083e008c000a4f8f8c9849658c64c177a44325e64bac96992cfc7329778023249649046846201e032c008c00090f8c2c9065440c6480c8f84323c6476c8e591c049828c8d027c5608c8bd9164a786450c89d91332256448c888965a87eb21190fb21e6438c86990c5dbe641ac831905b208507f1823207bb70c811901b2026402c800fdd9fb800a8008c000b063fa3bf045db008c7ed8fc88bb5a1086a86e511f12027c4563c82034d84f882428c85014992176658edca43192904254b208c7618eb90784a421904a31d563a6c7458e7dd8d6398c72c83102d5484174231c908c7218e3b1c6051e43e1884bb0ec6fd8deb1ba6370c6d98dabf0140c6d18d9b1b2f84e43e1231a66348c68d8d014633cc673e0d06202062352f908f82e12eb631956320c6398c6b18a307be426d02770002418c43187630a7bc847b94630927f407a800120c5fc249fa09f0298b68f6d000240c16802b000230505036b01ea00048316807bc8bb063166f7fcc58bdfdb15d62b62a64e315a62b2c55c6315508a5004e60c9818c5484e288ba90c5398a63148628ec5107839cf7e2c4ed89d31372174f423135626421898b12f625a31895b1296250c499892b1236242c48188f311c3cb6d3dd8311b6234c46588b6d8928c45023e8708c44fdf2c9b118c42c4b008f7c4c41847bdf6200c3e987ab0f261e2c3c2a15a061de7868f0b173521ef5e4cc30def7a2c35ca09de09ef35869b0d206ec0528063800138c339866c98c1877886f3032a0a3023dca265e09741027bc3618413c00a0800129eefd85eb0bc6177eeec4c098616ec2d985abe3e1b541f9823eb15740c2d1859b0b26160c2b47b7186156c2a447bb40876a41f8449619eec584fb09b6134c263dd60e8439eea1847b08e6118c22d8451d6a09be1ba12308860fec1f183db07a60eec1dae6fb07360deb2216306c60d394f06306860cfee706232208c18ae69305f50784182f305c60b7ee59829b05160a0c13907b9408c12c27b906086c1058207b8c28c0d42303339ec21818b02e605ac0ad8151ce74be471814b027604ac09181185c0086e0005030216040c07865cb16032c05ce698c24259663dbe300db94ec022e51ed0130c00c2a0046f00044180130010698318002ffd5ff6bfe97fc05171cf2717fb2ff45fe6bfc046884da04ee000502fef5fdabfad7f52fe93ac2617f3afe61aac32e4784b918bf817efafdd21721c20b7c0871d577088f6b254385b488f720526420b657fc8217e92fd15f9ebf397e6afcb5f94bf245a493e650bf1c27b4f09b35025c770c3abb8462fc1f694bee17dbafb65f6bed0d7d82faf5f5abeb17d5afaa5f52bea17d3405f48be897cf2f9d5f34be657cb9cf67812e2d2f8c5f1738fc870da08be217c22f8314e28d7007a800138bdf17bda73b18bddc2720023000243d97489c11ecace9408b89412e23488f465e317b32f64142c1b108ab034b0002707b7045ec0bd7d7aeaf5b20bd6425c3e5ea674a06487f0970e57a65c3690f06e28a7b1d09ec697a02f3e5e7abcf0dbe00c638ce8179daf365e66bcc9798145e5c6daa59c8cb84c117962f2a5e50bc9882f2590c4bc7ee0daf1b5e34bc6578c2f165e2abc52e07b0b816000447b0911fa0560047905e1023da6968c5e0ebc18d90dc5520bc157822f035e03ebed77aaef15de0432125bf65dd421774aee85dccbb96df8aee13191b0208774be4217702edf5dbd6fa576d2ed790626b349670343625ab176892cb106b2022ecd0056000067ae65d8e6af462ec52578217625bdc112078d57080319eb6975d2eb9b7b0bad975a5bd55d6098dd25bd15d52ba9975210f5a6ba8174fae9e5d36ba6974cc80340ba59749facc0a4010f4001185d1eba343a00cb780ba18d280c5d0aba117419a4920691c22e805cfab9e8241800228b9e573a887940258042e73f574b99434c105cc468108ecbfe420b98572fae5c5cb4b96572c066e03f20514000a85caeb955729ae52b73c517282e4f5c976e648ca802b0002717242e475c8cb9157222e4131eaca3e4885c74b8e3d565b8e20b8c434c085c60b8bedc38cf54ab89571105870b080f44265800240b8857102e1f5c3cb87570dae19f5388170bae165c2ab851709ae126228700c5845c22b83847a965c08b80d700adff5bfb6dcd6fbadf60dd0a16fa5b6e5bdf1e516f5041492bc716f4fa8f11af9827a8c5bc4b7816ef7a8928644833b812319ea156ea08b6c412daf845ba2b7396e60c5b94b7216e3adc68ee0516e2adc4b6a86361ff214848813d3b045b816d3de0d0c3521e9c822dad5b56b6abd35905b3eb67bd33189100a8008c0009c5b2e116cb41c710b654c3f0520087a0008a2d9008b63ad9cc7485b0b1258a2d835b05e95ddf70f8f09060008e7a535aea60fc62d74f4976ca062d66b648216b0ad605abab5616ab2d555aa291d014f000150b5396a6c72d48d2416a42d4511e90c9dc888e4aeef6b4f8c48a201e81b0800120b4ed69c2d375a66b4cad85985a62b4bc417a008b4b022d2b382823d1c03b801ea000482d285a4eb499692ad245a46b48b1ba20f4661168efa2f10b455689885a2576c042d115a20b43d686c6f75a0eb419682ad045a06b403d10acf7f43ae0979848dc25c69ff20c59dfe858446da59c8067c03580012821192f908478411671ace276e633d072cdc10b3644b0082dd037592de0c59ac12d67acd159a1e80d660f9fa76a85a783d200c52932b165d9c14111af022cb8596f1ad9658acafb57eb299652aca42cf234e1904305944b2856502c9f593ab27164dac9a592fe7add96049860b238b28a33e09060008a2c8d5912b21cb2390b5578ca845aa808b1e6d528858ecb1ced502c6d58d8b1ac0590001416a6822c6458c6b18562fac5eb520b15bcec51622bca578830eaee168b1456282c4df3ac41624bae110b11d6232c45588641620ac3ea2a43161e95b7186a3161e79c9586cb0d7ce29475a48af8011800120b0c1617857b18b0ad6145a765847e6f960fac1eb4dab06d60cac17582de6e1a2c0ef368223198457f3abe04512508afdd5fb2bf557e6afc95f8abec57d6afa95f42be757ccaf8fcd1abdff341188622bdb57b000ac00090f338115ea04165a20a00008c75202c9c4b00cf330115e6abc9578d690d5e1222315cec4b507992577b68f15d92bb1f31caeb15d4aba8574cae955d12ba15740ae7fcc5018a0003215cc21ed11e61453bb20818ae4bcc012cb1968a95c5ab8918ae215c308053003d40008cf2f2ae015bf797720addd5bada168bc2105c01180013886c825a1156d0ad9d5b22b6356c4ad855b02b5e56b4ad655abab5556a76819e2b495691e5b062b46f2d0ad089e210567e00ac0008c74421159eab3b10ace559b88566813cb0ab2e565632cfe048b6e122da2b245644309bd9c1410ac7558e79595630ac5d58b30cf39e55422b13562221586ab0c561225808794c09679422b028b345d38679440dea2157faafd08de00088794109e4f8259da088404232d108abc1577d9d355d2aba15722ae355c0ab7d56eaadcb396ab5da2ad655a8ab4862ad041a24af062acfb38c22ce1aaca5590ab1bc9414558aab115618c5020aaf555daaba5572aae1559aab2556388c5205b40940f027917555623c8984f21d66a9549790b20aa0d541121818485c9091d6119e41822a8054fea9f953ed99c8a6e4b2ce790054cc200ce01990002315322a628a6007740c5000130a97acc72a598a56a9555292a5054981905278f609fe0278047905490a91d2de0c548ca90c015800120a9095202a3e54784151caa38546fe3ac82a2d545965e462a2ab2eaa89ecb9905438e53889b158f018e0004c59695432a86150baa16542ae518e2a143f980cb83e5834b00026047984f1c0a81ecb001eb069850fdc84f1b8344c429fe53faa7f14fcc4ef28a7d54fa29f253e2a7b94f6a9ec53d6a7a94f4a9e80d7e6775a44e409e3594f10aac18428c8501499187dfc278d208a7814eef8cf18a758229d33ece214e929d063a4314e7a9ceb28833c63792810a7114e129c018a6f814788537964e94dcb9012112e8229b8896ca6c2c9a29aacb84614d4a9a65b58314d2a9a4b25aa6714cca995b254a6462521f12067660fd82990531ea6394c5c49a0808023ce78bb09e2d8c32085300a5ed4bca977d3a6514baa973f15801e81b08001307b9c51b06ea22e4414b6296b52d4a5a2c88b8b9465e714b288f310a593c51296052baa5714ac18f136a547c4c0a9920a51cf5808b20ca50c4e28c527ca4f549da93920a4dd49b0f190c824149aa9345260a4b40358001303c304ce84ec00d60004a292a525311a0629255248a489490a91f29e21d48dc45f522de20d487290d5218a42d48558eb2596c1482787b51ff63a0828f8085e0448715a418a3d947aa8f451e6a3c9478f87251dca3b1475874058a3a94749e3819e1a1472f865b1aea37d46f0e536a9080f1308be074a09cc0009451b8a36d46d28d8216340228d551a8a34d1951051a4a345467b83d20349c228cef0b621462a8c25182a300702a5d2311068230d708a2f545d88b180a2dd45af850107f0240c28b2f098a2bd454b81e1b9c63c248dc6dac432c5984b16211450289f513d0ff544d43f91b4271449d8ad5121e101445821c051600050695608a229c0188 + +def cs_26 : Nat := + 0x115f62be59c619a98352fea5ed4b554c414c00f50002822b9456fb37a3352cea5611a9522b445678aca49f4e1200b2000283529ea52d4a3a9435272aa331a9375266a4bd490441c1b0800139a91c26f86e819a91b522ea44d484422a1848a85e40c46a3ed47ba8f351d993329a8eb51cea36d469a8cf5186a2fd45b14a6294064159a8b35156a2719a89b512ea248a3d146e80398d447a8875106a1fd43d144cfff19bd40e57026a1dd43845bc6116c625a2350dc50bcc163350d394e4afc3350c913115323150c0bfa51f03150b112a00d6000486a17d42da8575096a1089ed76c0e44f589e6214fd84d41da8375058cd4147e7c865183f21a82750410bf9e7c43503ea053f1664a40cc800131a80b500ea0089ba7dfca69ffd3f9a7ef4fd69f9d3efa7d74fa69f249a7c34f7e9ee5380418e284d3d8104c084d3d5a7a34f3c4b72112ce51008896312c22570cd3ccb6b0469e5d3c9a78f4f1299829129ec95062019129a25108d3bc29d439f80012029ce4af08d3ba13b00358001211258269d9d3b1124e249297a283e8807a800119a75b4e988d3a5a74424c0cd3a1a73c3180cd39da72f4e4e9c8d38da704c69bfd37d11f07a8069311ee634de0a9e11a6e74db88d369a6ce2388cd362134d869afd35826bc00094d3563c3c4d225bc21a6a87838852501078197de0002334d3e9a60698334d1e9a1d33ea4567ab047d62ae734cf699cd337a66b4cce9981d961d0106997d32a234c9e9921d34334c8698b11a628290043d0004434c3e986d30ba60f4c0e980620c734be040e2a134bde97a1ca6d52086978d2ef2eec66975d2e9a5c946a964728a34d195089e7c1221544298851109c713315731a5c621128c419107e20f441d8834434b809dd0002334b7e96ed2d8301a1b12d11103c96588d2d5a5a74b46967703c3738c6966d2cba5934b0695e290fee1fc1db72d6e30d4a43f609a5734ad6958d2ac434aab8031035d917608d2a70fa06b212cb21a545bfd083b28134a7694cd297a52b4a4e947d28da5161ecc3d887aab34a26942d2807544b239487a2a13329e0c6f961349f048794a0ed8f20c0d340004416240d26051400090d275a4e349b6934d265a4bce8e0c9b23740d80087028b0000d349684d257a4a3493c7d121a49b492e92202820004a6920d23fa47748d87dd06960004e691ad231a45f48b6915d2266348801f9028a00048690f2b4823486e90c0b1616240629499309fa8e0a08d217a42b484e908d20fa417481876641a4045f38e8419a3ff47f1cae0a3023dca68fa0a1e1cfc00090d1f3a3e347be8f4210dfd3dca7b719a3cf4788b91086c23cca68f086e8221b88b890812101004794d1dfa3b440b7c09a3af47568e8d1cc434724365110d913cdb738168e3260a68e2b0342346fe8ded1b90d6e1ac94160609d81398001209e08268dbd1b3a36346be8d6d1aba3521a722204870ac0a0800119a3474681c2019a33b46668c9d190be5ca68c4d1861dd547c104eac1219c1bff11a3053a888d181a2fb45e0cd1769d14538a35c01ea0004c68b8d16fa2d061bdb03162219184d165a2c0de806ff00d60004c272f4e5a2345768acd157a2abbe014d1501050a5e7611a29f45368a5d1489c5d3899b994ba48345168a0d13fa27b44de89a86010bfd37c01450002b344ca6f336f80318e3394d131a25446891d121a2346688bd1146d5c6688985d225089659049e0118ab84d1110b9026d0277000253443688485bf0b7a16e89090a8011bc00124d10213440687e4d5c9aa88687d9bc776c06687bd0f5a1e343be04c29a1db43ae874d0e7a1ca16598af2c11e7e844cfabb844686fd0dc6b806686b35a44b746686ad0ce99a0195051811ee6132f041cf2134326862d0c220a4812bc09a180d5c25bc195e002685fd0bda17342de85ad0b15dd8e1a97336001ac00090352a13429e852d09ba133425e84931a11e14908d0861dd547c0cd080121444287aeca32142cd9411a0f02683a348e2341be836d06ba0ca13894d06211bc0010c84da11881a5800121a0bd59688d05ba0ad2f48c0d7056904682809a09b412e8224baa0e5c047984ba41341025d04b9867e48681fd03a271c0cb002300026340de81911a06340bc24e2334412de04d02da057409e81284906724ae69cd01fa03b406e80c1886087817800014017a8cdc85e203140004a6808d00fa017402572b29a00e11a83ee09c8008c00098d00308bc4258225962340067ffcffa333fe67fa8446062c867f8cfed9fd33f910cfe19fbf3f71952093403d40001c842895483740c08de0008467ec842308412a5844511ee633f504cfcc0f980008ccfc99f8529b19120cee048cc41fb4a5820c811f69119f7667c08cfb99f6e8b40ccfb39f633ebe7d3cfa43b7cc67d1cf9e233e767cc49e630c5b99dd11077a0eeb157199f2b3e4a4e9314e0314a4c98cf8e938943e0c49c0b680441d0839a1dd547c104eac133e2b560119f073dee7bacf72d548a1868099ee125c5db01906d125869d3181c00267b7cf6b9ed265a10cf679ecb3d7a4925ad0533d6e7accf579e9b3d2e7a406c20005067a1cf399e673cc6797830a5f2c12c006b0002a33cae794cf279e473c7e78d319e2f3c4c178153003d400098cf0b9e120b809044be4533c16781cf019dfab4994cefa1c544677aceee5d3408d83610002633bb6775cee9054c86773cee59dc73b85681299dba0a617db199db73b64148828f59d87010a9801ea00052676aced39d9f3b31ac8299d933b088cebd9d773ade759ceb19d573a9e751408e2f4ab082d4e5a90ad20c2d4725c446750825c5a783d200c52932633a7e74dce979d2b3a46747ce8c15002378002510490b3fc966183a0c07a8001188da426742099d07cf90882388d7446740ce7e13d464c23099cf739e673bce719cdf39b6734ce679cc526730ce5e10e06672cce528c9142282e50294031c000a0ce519c98440ff5dc223392e723ce459c8738fe71d81ee3278ad224ce399c6f38d40ee81205338c8c8811582026717ce2d9c57389a2f3299c4b388e710ce1d9c37385e70ace10d02c2e281450000c1c4304819e1f30467048196c060622c6090318ad183ee05aa43381e701ce00565c2b8856f2932725e504cdfc3008433ee12142337ee6fccdf232af484cdef9bdb37a66f346ba5337966f1cde0552825988f73102af78208cddd9bb737666ebcdd39b9d9e29ccdcb9b93371c09e813b027204d1ccdc59b8336fc096812a89205a20b41419b7b36ee6dccdb79b60a66d7cdad9b549659029b60b640f5834c219b4f368a229199b40576047d62ae4203ea775119b3ca5712cb199b3736666cbcd959b251036ece3901b4266c7cd8c9d70666c3099aff35f21ed1851a021467e1b42335ee6bccd743335ce6b8cd6e062c866b5cd679acb358e6b04ba46335799bd119ab0a1586d5293243355e6a9cd5101010d7a1ac5dc273353e6a5cd499a8d9a19480760d88413e6099a81d168813720ccc0a28001219a7b34ee69ccd3686104b018278e12016b32c277a26440629499312cf822b3b099a6734b669527084334804803416240629499219a3b345880a9e087817800012024446aa800118c33c2400e099a2334288cd099a0f3416681800684bf73f1c65e81333fe67c1199ef33d6679ccee4108c84cced99cdff98c44e213338bff1420a3498011800130ffbdff68841ff78a834e828b00025034d847fd283d44666d7fc82333584ccd3999dff0bfdf6582533336664ccc6ff4869394ccc3997c4665eccbb99686665965442332ba0a60b683332b6655cca9994f328e650cc9d99333256649cc8efe9868f01dd03140006066437f48132c001107f4274a043f9b09542426642219023320663fcc7b98f331de639cc6d98d106632cc6398bf317662dcc5998a73146626cc49988c31030cc3f987191b8ccc321330c66167ec436848661408fd79faed4e6199847308660fcc1b9833304e604cc059805fa60bd00808023da65ffcbfa2027744961197e8265f9cbf197df2fa90e74f80632fa3f4189de332f9e5f01197bf2f6e5ebcbd2432f3bf2e63c8332f33f2b7e507df0865e4cbc7978b2f01f672997732ede5d9cbaf9754a0dce0997532e8a9bf053003d400098cb9e132e765cd7e12332e665cbcb9597272e365c430fbedc7888cb84132e09f33107cc0f973dd1182ae40d780f50002432e065bf3e4e2ab81e002800002732de84cb7796eb2db65b22196c72d7bede3de07bbc7cd8f9a094436ad229720996b32d5e5aacb5396a32d33172f14c832d265a37d94fb1c1ef22eb000273e01041eac0f0014000012196832cf659dcb36c55ca6599cb3196572c990cb20fabd4940ccb1cc4f077d098b1006532c6e589cb0efa8c86585625a20f3c069b10fa79f4d88cb09960f2c1543f219605f453e871995fea1d083c861d004657dcaf995ef2bd6577caed95d32b8a0cadb95b32b578602195a5f341e0418f99823e637cc4f985f303e5f7cbc77d003d03610000a32b3e5647cae6b2086563065007740c50001299585f27086186132af1dd4101d037881dd0b166232aee55b3b8a332ac6556caab95532a98f6e30f8e5f1c53fa199545f1abe34e9ce432a8654c7c5af8b0742147c52132a565487c32f8629f494ca884b904049809950b29f1d4c08520c7c01180013994ef29d6539ca6d94d3299e5323a6e330d2f928ca6394c02b21d612194b5bdb08ca5794a98678cca4f949b2918cca4431ea8b40cca4231c117a8cca41947f28e8c7bdc1328d04ca3017140a2800121945b28a3dda7bb2f760e698c24259680c99000111944b2883dce7b96301c54f18ca1cddc84650dca19942c5fb006b00026328404ca0a72e01a58001219413281e50117700a2c00098a73610aa3843ac21327fe4fec9f593e1ecf02e50294031c000a4c9ec1ab01b080002193cca4c887b2ef64c07a80012193c727864efc9dd93b7275e4ea38afb351264e8c9ce70fd7dd2229299397271e4e2c9c3937b26e64dbc9b3935f26a285f262a581bb014a018e0004c1c0137fe23268e4d0c99f9339eb414c999932deb13d6137d05164c64cac993823c61bde09931b262e4c319930b260a72d1992ff25f64bdc97792e4a3d4f376d79d8664b8c96d92d725a64b3c9646e48e64b0c95b92b1e9e6c91284f68264abc9546e09bec10136426c0464a8c94c8bb062f3009929325164a019927979308c939926324b3d247a46f484c315709925026491c921922b24464877a2863243648211920535508c90191ff23ee47bc8f591e323be476c8eb91d32399af85dced323964701191bf237646c1991af234e468c8cef3ccd67778538f3bcd6692ce0686c4b4a083f812023233646311918b230e460c8bf916f22d6458c8af915b22abcd60bf61bfc03580017825d826453c8a5914063cd009913f227644da5aa41e6504c89469ec139800121912722464431848fc0ac00230002432216440c87f90f63fc94c87590e721c6437c86990cfa029cc86390c0241800220f28c2642f793e6864652b80864c800088c85b90b32156428340c680c4089cc84c12dd284c84b908f210bc8823529be4c642023342320fe41e8fa23063584c8397fd843c8223022320b19cc3396126086414099047208640ec81b902f2056409c810161c2c203d109960009a6405c80866652c0949928f1a9e34f3d919900ccc4854008de0008a053d224297c866401c8018ff819707cb06960004e63fd32de7f00663fcc7f38fe31fbe3f6c7eb8fcf1f93c4b0d340005663ed098faf1f5041492bc40a9284c7d064c80008cc7cb8f90c9399240d3050c9084c7c2131efe3ddc7b78f671eb94c7ab8f4c463d205182128804c79f8f38c6a85ed03140004c63cbc792231e33c17114910565802b0002431e22dac118f071e063bdc7798eeb1db800138f00012c006b0002431d8e3b0c75d8eb71d663abc74f48947d2027b01ea0005863a6c74a92c34e990c7498e8ddf33be5f4a0531d09833118e7cc142ee118ef74c1125f2198e7a9068f480ac87584a3bd5098e6f1cd6399c730ef2ca032803ba062800090c72c91a44639548c6a49c00090c7278e48bed8cc7218e3f1c6e38cc7178e271c3e386c70ab4bd46382c7038dfb1be637ac6f18ddb1ba20773e131b96371c6e18dbf1b72d1330ee5eed808c6d4000446369160a231b3a406118d9920188c6cb8d91dc5bb8a7713473835f99dd405ca869388770c8f849658cc6c31b901df827a04ee0004c635fc6bd8d771ae635bc6b58d631abe356c6a8edcd63b71098d3b1a6acd500d60000a3b6a76d2d2746634cc696ed8ddb0049e048a0004e239a337801ac00090a35036746cd0698218d24216b22d5e709866346c68aed50b4f07a4018a5264e169c2f28231a26342c6805a308633fc67d8cf719e0e8428ed11da116791a70107c0118001398ceb19cbb3e767a13d4a6338c6698ccdd9890c6658cc7197964a2c8e531969643465e33196632a118c9820b80230002431926323c644d10886320c63f8c7b18e8cb5024a048ce3b10098c6c2631ac6338c6318b6314c6278c44e630fc61b8c33185e30ac6118c1f1836305587e17740dd03610002e31812c38317c01ac00094c5f74520ad20c75a48af80118001218bdf17b62f5c5e98bcb1781580398bbdd62d13d198bb7175e2e9c5d05524aa398c5cb8b8b17062dfc5bb8b6f16d62d97550afb65d22cc5af8b5a88b8cc5a9cb3043a9d098b4716862ce198b3316513c719ab78262c8c58cea24662c5c5898b0f1612bbf0d3063160abbc118aff15e62bb96fa4315b04c5638ac31578a8c06960004c62abc5558aa429989c0298aa3153e2a5198a93151e2a2c5404096584c53f8a7b14e0efc20ae182629b74a74330662980874a02143f4ba2000466296c52a50b066294c5278a4b148e290436461d1f8a0fe48233147e28ec51b8a2f1456287c50d8a1714250a8504f94794819600460004a2b51812023140e280c4ff89f84d814c4fb89f313d0cc4f285f84d012cb2189dc23a2108e87e84e88566e1313a6273c4df89b89c7ab2707dc0b550626dc4d80f9c6626bc4d424a834d90c4d389a3133e266c4c8e805d002b1141898b130625fc4bccbd0a625dc4b884792e910c4b3895c4625608de000866255c4a98949cf5b9e929894496588c49c13126e24b11ee3312539da10c20e5c04794c4904b8c96f867702465312392da6582331236244739633120e240c47f88f5ce014c47788e711b39b51b341a60c6234c46788c46622e0f7c96f06622bc45388a3113a086298893111e222c443888310eb998043c0bc0000a8c431885846214e48a23109a04111884b108aa6619884153188c41d883310511ccb74a508e3f58e1188271046207c40d881710262024b7880cee8472da464816a8c72d4008c0008cc400e59e8038cc3fc80284c08cc3fb87ec40dab0987e70fb61f5c3e8a87653918c3e587c489a0ce44a105fd28f81187bf0f6e1ecc3d787ab0f461e4c3c78785261e0c3be344c661dec3bae4c54fc10c3b9875c23983e60000530eb392d3f3e4328c1f9472582e5c0008cc3a67e54362115606960004c61d1e428230e861cec397e348861ca723821c8c72083ed2330e4e1c7c38d8714835a5bc3187130e1e1c220ca418816a9820ba130e0e1c0720a2604861be71fa3b7c638f9093ee8238f60986eb0dce1b89f5f12b8a61b6c36aa68455806982986d30d9e1b2c35f86b4a61abc35586a70d3e1a6c34b86894bf0b040000a1c6884c33e130cf619dc3320004801ba06c200046619771728cbc6619411e6230c9b8b3118645c5769c11986430c7618d529eff90a1ebf0986330c5e188153003d40009893ce130c3e185713ee27149c94c30586030bf8f0f134896f0c3897712ca49c00090c2fa3bfc9dc8cc2f785e70bc61779ebc530bb61759eac11f58ab94c2e785c5c430c3ce61076587401185bb0b6e16cc2d6e1ecf30179a385e5026169c2d1859866162c2c1857f0af4d2d28e1a9c3308c2b98560f18636b21855d68708c2ad85570a80c2c8e130a7e14e7081e1808614c1a4e21c1db83911e164238337062230a56149c291851b0a2083f8120730a1613e59b602c8000947042e0809658cc27984eb09c0cc26f84d709a6133c26584c7098612f3b6e5adc61aacc25b84b30958f6e2184a9c0388c253849dc0138016ffe530936125c249848b090e11e31847308dcefe19846708be115c228df60a61129ddc1ba06611119ce60fc66110c21f843b0869d400d7e6774e610cc216a0f0628396b54230848cc02c481a4c0a2800130def141a05643ac2430846107016400048610409840ce90081940747064d91ba06c00438145800140dec064a88c1fb83ef07c0cc1ef83d7079b7a0502a5307960f1c1e073bc2f1018a000271bcb044be41307660ea186a31c4304c1cf839b072b7896f0ede11bc0b77f418393071a7ea382843071377917fe2774000949d581306f60dcc1b5836306b60d56ebe73069e0d2c19d8337065e0cac191831f06311f25183145c8843611e64306260c3c18382fdba0a79d071a015001180015054045a988c17582e04373a38b82d04660b7c16dc3d0660b5011e20e2094d0100633059a7821182c3057b7256e424305760abc153df6c860a8c14d8297051e0a1c141827db880a9801ea000560fe2081dd547c08c1378268a3a836100025054727501517df208311408062c20a86150a0cecc1f90150805600478cc12e9cec460916df8dbec40890c11e10def04c11a11b7b04981023dc236f43a502304584147c50e0b850c4e501304536e6ef8033044b6e3142979d886088c10f821b041e0829c3663040e080c0fcdb588607cc0f781eb03be076c0eb81d3f2220c0e781c70384dfc36d52ce4c606e5e562303604c0d003d40008cc0ca130326061c0bf817b02e605ac0b38153029e052c0a38143f1bb4c09f813bf18f0932022c8241800219813027e2c2190230252eea11811cd7708c08b810c437086d293250d700435b0031c0000c6cfc99b58ab8cc082d9ed334032a0a3023dcc603ffc3dc1e46603ec07b36e896590c07980ec408061d5dc250d57080310d9b4d520c50189928260380fb60d000c2000128d9a4260374c762301aa6341064cc26032c05e98a46480a08d3dc236580f1ca1f06602cc05421b29077551f03130c04c051809f0136025c0498089b21074041808300ee01cc034d8dc2488023000280b8504fbf011bc0010cc02f805b00ab62c565a5300a6013c02497a487dee0980382600b0d30230056009c011801c1cb808f31801433fdba51880b02600423744f9866003c002d840cf110bff412ffcb6070c3abb8485ff8bfec22ffa360151ba31203046bf35cd445ff3bfe37fb9af7701f28d7a5af14233334a0fc224b1807dc0b5445fedbfd57fa6ff3cd36297f97ee3086228100c584bfc008340158001217f7e696889a50586841975220603d400090bfbbc03026f86e8217f72fed5fd76b84d6fc2378002381b9425fd6bfa97f4466fff62ae21ad91933117f341f190ab07bc8bb0a5fcabf9294f065fc8bf8f7f181d090974ba462fe2990b06c2000485fc3bf8221aca84bf7d7ef6fdddfba31d84ee4c25151dea000465fb8bf6ed62cc68018a000261abe357badca303a004bf6ac55c45fb1bf617ebefd75fadbf566266a84bf557ea45500245000252fd3dfa6bf4b7e93ecab56330d589ab008bf477e8afd0df9f217e75263a4c41f7e1cdc4b018bf397e6efcd3552217e64c308fa404f603d400098bf281260424b0d3a622fc95f91bf20d5037db14bf1d7e32fc5b53621beb12f908bf117e1efc3352930263d052e91cbf097e0efc08cbef97deefbd17f2135e0004c5f77beed7dd2fb9834b000262fb95f71bede913085f6dbed8acb465f6a7d3622fb4b50069fed3f1176142f3412fb35f64bec77d8afb0df5dbeb8d3b43a02469d212fad0bc3117d5d68988beaad385a6fc15e217d51a6e1751096623dca5f538de822fa7df4ebe93f578834bd11ee20a4c84be917d1afa2df43be857d05a536761417cfaf9d23a7185b50223a4097ce6f9bb493472e36804b018be6d7cd4b4f07a4018a5264c5f34be677cc465f30be5b7cb2f95df2a68ea62f93df26be4b7c8ef915f21be40d1ada350d2c0808023d85f1fbe3c598c265800128d18dd9988be397c6ef8d7d3a46845c28c5f1946742164404be2f7c5af8adf12be2052f87df0d688058a9ad514be177c2af84df08be0f7c16f81df01be01f49945efd81202207584191012f7e5efbbdf57be2f7bdef3502a72f78deeebddb7bb25f0d159317baef752c43197ba65ed88bdcf7b9445ee4bdc77b84615821c05160004e4bd22b4822f6ededcbdb57b5ef6b5ed4bda77b499f4a5f2517b46f685ece67c458640358001397b36f665ecabd917b1ef635ec5bd892ed125ebfbd7b7af2f5db3ca44e262f5c84a24a119e3b3c5117ade5d208bd6812f59deb0033e01ac00094bd577aaaf545ea6bd49f3e6adb1c446488bca628c5021f3dc25ea0bd3c22f4ede9cbd377a688ab94bd3288400a08001217a559c84b7d1939640d780f50002400629499117a52f49082910521543e0cbd1e12f46de8abd117a0c0ee818a000272f415e80bcff79faf3ea5d23179f19b04b5b66b7bac8a5e79bcec22f3a5e73bce179bd0cf9b98072e023d05e6ebcdb79b2f3510bcd3799af325e61bcbb7972f2d7cc9417966f2c045c03140004a5e5442c222f2903ee05aa32f285e4fbc9d7936f2594bc93791845e3fbc7a2258d75d211ba0025e3c560a22f1cde37265c12cc47b94bc6d78d6f19fca802aa52f195e31960a0bc401580013178bef175e2b1978a6f135e25bc47788af0fa0eb39787956b88bc39786906892bc217867e4d081a4e12f0b5e1510063077b04bc27b98445e12bc212b5465e0d0f908ca8607c70f8c1d0065e0ccca422f055e09bc11781994694bc08ca2104112460ec897c8c3285650881e03a68433000262f01074011780039880011977feefd8720035e03d40009834961026580021177e593888bbefb914479030977daef906d5293242ef8204a0d9b0dd085defbbd977acc9990bbd0d105175800120a99825de6bbcbf1ab71b1064a6c945928324e405246c80c59cbbc7778aef0dddebbb9776eeecddd60c4092eea5dd3647a2c2c14f000131774aee8ddd0bb9ec8d0a4a80097736ee64a7864507fd0a5dcabb90c888965907eb212ee35dc311770aee0ddbd6416c820a5dbc221022edd5db61176d427744961976d2ed9ddb2bb60406898463f212ed684bb4b7692ed05d9fbb3d7670c10a32140526465d9bbb2f290465d953ed222ec9dd92bb2352ac85d90bb1e418816a9020ba118e484bb16c71d8e28cbb15f0c445d880976158dc883e8e12ec1dd82535e32ebf04bafb75f2ebddd7a63527cb0c5d78baec22eba5d73bae2c6658cc06203175c2eb7dd6ebad775aaeb45d6639759025d62bac1757d8bf90babbf0194b48c3dc460fc45d5bbab57554f6990baa9754be010cf7fc7b107a7488320c580e9408baa012ea7c9e711753aea6a94013983260a5d4cba97751eea35d446285514c15480f50002a189e0efa1316200c85d41ba7f74f465d3cba742189684ba72c4a1f4d8cba6f74d6e9a5d336238796da7b9c1aca124de091e03ba062800094ba6374c188a0cba5b74b2e95dd2aba51749ee93310641748ae8fdd1eba39746ee8d5d19ba31745ee8add1486e8c1875b0ea61cf109085d1209744025d0f13bc2033b812311743ae86dd0cba177424a5d083bc43798195051811ee6019401dd0314000485d05f786c30c630c03ba8203a06f10ba07740bddd0db7217406e8030b57c7c36a83f3047d62ae82e7f30b33b7411700c500013173eee7bdcf6b9e973cfdd79d9f3973cae78dcef612e76343b225f238c24c74208b9db73b2e75cbc12075d039908b9d3739ee735ce5b9c652e7103a504e600048307a60ee974865ce1b9bd737583510c8297372e6d08b9ae8c8840ccd11000b5465cd4b9a37342e675ccdb9957322e631d220ce819c4000b06095b48043046608ac10865cc5da3422e61b03a3a0018580629499317306e605cbf39ec42e5f5cbdb97772eae5cdcb8b96ee219010240972d6e5a5cb21972c2e57dcae6028c048e668c162f2882e5584b95572a045ca6b9457286e4fdc9ef6dc62e4e04396272b828c08f720145c73c883958729487f0cb9357266e4bdc96b9287584c5c93b924723c0ce0199000262e4684b9177226e438c16f810e3aaee111ed64a870b6911ee42e428b657fc832e425c83b9037202e3fdc7db8f971eee3d5c79b8ed71d6e3a5c7215da2bb081c0145000332e388da11171c246208b8de9db03a00cb8dc709845c6db8d971aee351c142971a0e0488153a49480008cb8cb718c45c60097176e2e3d6819716386d08b8af715ae298cb8a4bded39d8cb8a3ecba44e0cb8a074a045c4bb8917116e220f6e297108dda141311000b54a2f5d5eb622e20dc40b87b70f2e1ddc38b86970c905c30b85f70b6e165c2a2970a44c588031970a2e1308b847708ae10dc20c93652e0f5c1db8357062e0bdc1531704ee095c10b81842e035c05b809700c47994b8057006dffdbfeb7fabbf1e839c5df06c338498cb7f76feadfc5bf5b7e9ebc4c5bf3b7e16fbdad510b7dd6fb6df65be8b7cd6f96df22ece416f8d765aec96fb042df15be1b7c04af085bdeb7b82240f1aae100633d6e04b7b76f6adeba637216f52de85bcf901842de734f7101e442b79499196f36de508b7936f1ede37acc0a4010f40011cb78b6f12de15bbd349a52dde2e83349232ddddbbab7716edaddadbb4b7676ecadd8ae675cca1a6185badb7596eaedd3dba5296e8add0ae57a55640cf984b7416e7c8d4a6f9216e748cd08b7371f4445b970c4020ceb808f116e56dca5b92b7211f10a5b8f8f8022dc55b8939c0323dd05b2384802c8000945c5245458ab8cb70cb8882c3858407a2132c0011cb70b6e102bd057700d60004c2581293222dc1db818f5c32dbf95a4116df022e145c2651c065b7b031621708ae0e116deadbcae0332c6133c265800238b7fd6fe08b6eab7d83740cb6e36dc23ca042b2176782cc5b6d2a4a22db66be610b798c96992903320004a5b6ab6d022db3db65b6c91e0082dd65ba822db09080030205f807a8000316d7c25b5eb6bb6d72dadbc2b29e9f025b59b6b16d5edab4244296d4eda95b51293242da6db497ba232da4189f99aa32da304b68a494c41897152e1de003d0361000262da15b41b6816cffd3094b67d6cf6d9e5b3b892c52d9bdb35b6656cc6d985b2eb65b6cb2d9424b64d6c956b0d20d1e901590eb09cb6456c86d905b1eb63b6c72d8c9cb629e90c9dc8cb6276c4969c97c11db01f741a580014097c822d35272a62f8035800128fa6c25b0eb6196c24bd010b60f6c1ad825b01b600b4a0bc617891d3c2a6545aff5a4a3a68628f8096bfad7edafc0e8042d7c845a34b45c46884da04ee0004c2d155a2622d7c636b116bd8baa828b000242d7adaf4b5e76bc6d77daee19a272d765aebb5d16b9ed7294b5c96b8ed715ae1b5bf6b7ad6edadcb5b76b6012c006b0002d2d6bacdc116b56d6a5ad3b5a56b40a5aceb59b1b186049e048a000462cc8a35036746cd0698296b2425ac8b58fe7e9daa169e0f480314a4ca0b58d6b16d61acb78d6c8dd4c5ac2b5836af6d5e16791a70c820e79f2096aeed5d5ab9b56eb26068addb0396adad5adab376581260a5ab1b5616abed571647296ab6d5483e7196a9423b146b5420b14069a000232d515a9d3a5032d4d0458c903c864b8001216a56d4a5a928d004233d51622bca578830eaee1316a3caed034b000242d46da8cb5176a26d445a87b50d6a16d425a83710cb081204b50416cc0008cb4ff69fa8a30c75a011617857b1169ead3cda78b4e842d3904b4e20d840008cb4db44e80158001208a8025a6c582a22d356b031169a2d33da66b4cb699231998b4c1697ed2f5a5db4b9696ed2d5a5957e254282b21d61616962d2b8397011e42d2ada54b4a769495ef14f481207231084b4a0af6445a4fb499692ed255a4957a2536c16c81eb0698a016a84b491691845a45b482aefc34c10b480aef045a3eb474aea55d42ba68c0062d1b2ba1d58832d1af9888bf232d1a5a33572c519f86d14572629dd9040cb46368c2d175a2db458ae24c5a28b44d6896d11da22b43862d0c5a14b427683ed072b6256c342a8dcc0397011eb2d06da0b8ba40150011800131682ad045a06184f4432088b40b681027f809e011e53cb42b42278832d01ba2111680959cab3718acd025a00b3feacac659fc0967eacfcab221967e2cfbab1b7410586403580013967d874d08b3e967cacf8d9edb3d967ad58575d241ba00209600967a6cf42b040e2205f807a800138ac0a2cd174e1884792e9082e8c1037a034b000232cf0810e051600048046f000423ca084b3bf677157a0d2600460004c59da09676596888b3af675acead9d2b3a3673ece712df0cee048d459cd55aa22ce559c955a0834495e14b391671ece2d9c2b383e49c0a080014167015622ac21966fecdf59bcf2444155caab503080000859bbf23c21558e2311166d6cda2ab00f7c96f0a12750966cecd959b1b36166bacd598b352692c459a5243022cd1d9a2b33e33c8184aa1212ccf5999b32f665accad994b3276646cc8598db319662ecc5064171e3d827f809e011e42cc4919a1096f025988b30f661acc1f8ee29660425980b2f965e465978b2ef65d2cb7d96b2965a228388b2cf6598fe64d2d216596cb259623f7243c6e0d1310a7f8145800119657acaec4ef18a7d54fa29f253de119864c1853dc4320429ec3f3410d847990b2b6a7a4c9b0404011e52cad5959b2af655aca9d952b2a36542ca7d94d53acb2ca5594853a0c74885946096510244c620ba22ca159410698314e004b27f64f6c9d8c720212c9c05ed0314000485937b26d9708659335b5822c98592f53303054b877800f40d8400094b25964a2c93d925b24964898c61cb24112584591f30c8214bf84b23b64714bbe9d321646d4b8317f185c2825918b22f645ac8aba4629644ec88590ff14c43c5204b21d643223e0f500d2623dcc590bf12e7ae46590ab21364204e290527c7a9045905b2089be460f1a02360d8400090b2036402c7fd8feb1fb63f2c7d8f032fbc0005458f80963dac7aa91f1963cc2291a0963c548acf5608fac55ca291252201158658f0521ae218658efb1dd63b6c7529033cc05e68e290051fb26f4658e9b1cf639b6c49062281147a0158011e32c7228f09a5a32c71811b06c20004858e1b1bf6378f1c1051cec418458dcb1b76366c6b58d5b1a9634d46c20b1a2a354b238cb19f633a79e0cb199632ec6558c9f0b65146183b9077003d400094b191631d4600e054ba452c6330d7116312c61d8c11962fec5f58bcb176a2c46f38331259682c5d58b9b16f62d6c5994b164a28144fa89ed2bc521fc8da11162c2c57f83f1b10408060361000232c55d8aab1521ea40118001316298ed188b149628ec5158a0b1396266c4c5897b12d624ac48d890b11f6236c465889591112c4304b1096206c40587fb0fd61f6c3d0cb90766313c000ac50681590eb08cb0f161cc45872b0dd61ac628283a2a062800090b0d2a0972918cb0d1619ac3258620c2c0314a4c9cb0c3617f48e0c1b4211405a5f21056f189688b0b7616bc060cb0b10e693feae2a21e02025856b0a9614865851b09e301c54f10b092300402a0023000252c23d845b08560fc84387089f4b47d88b07960e6c1b95472160dac195830b05e9ec53d80b91086c23cd2582db05960aec154e8029609ec135825b049608ec1098b03d6076c0dd818b02c513c49c4129a0200c85814b0256046c07d80eb01b6032c050698496022c03d806b009df64a5803b0036001b8a9c14295ffebfe57fbaff55fe2bfbab9e395fd2bf977c8195fc6bf757edafd75fa4a57e8afcc2f28650d8090c9539ba7364e6a9cd007a8001395f953e008afc95f8abefa724088603d40009cef801139104afb612bed57d9afb15f54857d3af9d5f32be3a6ff8120600158001115f1abe226f8028a0004a42fc089bccdbe00c638ce42be1d7c2af835f0137726ed4dd672bdfd7bdaf735ee217614af6d5ed6bda57b3af64c55cc57b1af609b1c626c3086cf1d0488af5a2a78426bd095eb135ba6b54d689abc47998af575ea6bd44de3bb6052bd3d7a4af475e8abd0d7a0af3f5e7abced79caf375e6a165b44d0005040008caf2b5e4ebc9578eaf1bde14c2ed255ae22bc6578baf155e26bc45787af0d5e16bc1a4af046ae12de0caf0012bbf0dce115df6bbe577aaef3dddca5778aeec22bbaa63e186a32bba77701098dc257734c5e1ec81f84496295dcabb726246cb01e3943e18aeda987a6d18caed898604576aaed35da2bb3d766aec89830914273b489820d280884fa692c45763349222bb0d760aebc124009194aebb5d72badd759aeab5d53ba41caea4978b0070cae9f096c0928123215d392ea8397011e412e904ae97dce48dd13e6215d26ba4574418678827731095d06b9ed73c33925734a5737ae6a22b9a25a2115cc52cf847307cc0004a7728095cb82df87c8465442b9511560696000480f6d000222b944233334a0fc224b14ae4f5c9ab91d720ae3f5c792bc2576400dac07a80011895d1ca308ae3b5c72b8dd71aae335c5ab8a196509be1ba14770e095c4ab88d70fae1c95652aa970a395c36b85d709ae10951421780230002812a26fff62ae32b82d704ae02301f190ab07bc8bb0857004a7822b7f56fd4a6c644833b8123315bf2b7dd6f8adef5bd68b418ade95bcd28b0cade15bb041042083b7c256eaadcd5b92b71d6e2159600ac000a049e012b6fd6deadbb5b72b6cd6d8ada75b3eb6741c750d57c0118001195b32b65d6ca49863ef010780f5000282b6324c0892c32b620449721125c24b7836892c34e9940e0012b61d6c2ad835b02b5fd6bead7b5af2b5d8f701eda0005856b9ad715add247b5aa295ad42181c02820004656b1ad615abeb5756ac832c601b104ad555aa6b5456a7ad4d5a96b5256a3ad455a85ff22cad3e1122997c312d4179c6ab14ad3c912c4b00cad3a910a6440cad395a6da7e22ec219e1da7b88ad335a5eb4ac16e20d3acbb9386618907120dcc76189058bb1b105021c0a2c00098ad255a46b47a40804f603d40009c2ea212cc47b8cad175a2ab44d688ad0d5a147192271415a12b41d682acfc0b940a500c7000283b4704acfb59ec9798c11ee12b3d5679ace759cab3841413159beb37566dacd3599e09c23a739599ab3188acc3597ab2e565bacb35962b2bd6562f2892b2a5650ac99592885649ac8b59111b4074d11e662b215641ac7d58f6b1e04f53158eeb1c5637ac6dd980a5633ac6158beb17562dac5958ac21c20ac5558a6b14410321589ab1208ac47588ab10d61d2c481a4c47b9cac3612b0d160c62ae3064f15a4115846b08560fac1d5820a560745e62207004ac0357feaff55fc45c62604c55fa75c223b2104ec7f2f6c455f920482116787c8465432afbd5f6abea8b0915f94abe88ae8455f3abe557b4622a98174212f904abd757aaaf38c2c3412af1d5de2aac554c2658002308a24255dcabb7576aaebd5d5679489c4e7625095752ae9d5ceab988954a55caab9023b0e04ab8d57144e00cab875702aded5bcab7356e2adbd5b5445812a008d83610002d111484ab642bb023eb1572156c6ad855ae295c4b2ca55adab54050400010ab53569ead355a4ab47568aad021fb43f2ae794559fab3d566aaccd597ab2d56555c4a043ae875852984cb000452ac9818b11564aac8ab7d195642ac7d58bab150128a5588ab0f561aac294162826220016aa0ab045c7c0008caafd55f04557827b84f6413b80012886409eaa6f91955ceab8d56daad885da59d98aad285b04b6313221559825565aac9558eab022eb000262aafd55eaab832aad0e9a1155650a0213f427b67c0a3d13041a00ac000904276148021e800221555c9a908aaa812aa9d552aaa2849c8554faa9d552865549aa91551cc1f90aa8d5515ff98c421a10e045544420a349c65542095506a9f017100024097a971f000232a9df5bb927a32a9d20ed41d632a9c5537aa6a83350663fd24190831d95779285154c825530aa5d54b6a9410aa475486a90551faa39546dfdb1caa355466a8c5517aa2a52a8a7c8711544825510aa1f542c65509095422a83d506aa0b5412a81d502aa0153f435486a606960005a759654b4974400090a9f5d63842a540867cc275892362196604810a9ef53daa7aa5bc2153d2a79d4f24029e3b8a54f0a9df53b5003bf652825d822001dc3622a75d4ea3ff27fd8cd89439c012a7454e7a9cb538aa70d4dea9b870fed32152af80aa407a8001315362a6bd4d3a9a44410a54d1a99f533aa65f56b28551c210e14ba420fd590db2e1432a6454c7a989530df9c94a9827e44859c2072152fea5f3f293efe42a5d824c01f003d400094a97552e0454b6a96b52d0c80829e000262a58d4b0a95f52b4854ac3ebe6774654aaa95352a01a610a9475286a4f8c209031404549d3e927d1c6045609526aa4bd493a9227cb0a5490a91f523b0d690a90d5215f73edc921520c254800951f9f7088a8f951eea3ba9722151d58bf88a8e87ba70cd0ca8e47b90f71183f20432025471a8e151bcf6990a8d751a2a335465a8c9518cf5e0a9e407ae425461095182a2f9ea91827142545ea8b822a2c5457a8ad51508313c3d163bd400090a8a5274c4544fa89b5131f5090a8955126a2354457d2c0f380c50001415101f461e503c9ec450a543ea87420f2187401150dc46e002b000242a1a9e342fb632a1a543361fe32a18d430a85a11bc00114a85612a14d427a84d5092a11d422a8435082a0fd41ea838b186b8413bc1033b812311506aa0ad413a8255046a07be4e39503896588a81a5b4477b0ca810772445407a80d955c65405a809500a9ff53fca7f74fe29fbd3f6a7eb4fd0ecec96c68765cecb1d94194fccec687644be4429f8d3f0a7d8f87826f86e8314faceb21d633ac24183c04a21b56329f484a7cf4f8d6440ca7c14f7cea74374214f78a92883a840ff810780f500025142304a7b54f669ec53d5e9b4529ea53d3a7a54f41f0094e9a2744c453cda7954f269e43df2294f169e253bf39e245c8a53bea7794ee4e6b1cd5f010629dc53b7a76d4ec29d79c143015ec274bc7b92229d6d3aba7539420853a82afa229d353a3a7454e7a9ced39ca7354e669cc3da7d9d6b29ca1c843906bf7481525094e4a9c8d390a71f4e329c5d38aa71083a4c04a70d4e0e9bff493214dfa9bcd37718172413b80011870b456c0ad720421f21195184ed81d0041c28384c229ba9c20114dd29b9d370a6df4db69b35365a6c8c45125363a6c54d857be90a6bc6fa0a2c8ca6ba6f80def0c37b6062c45359a6ae229ab5353379a031c00094a6a06ef82198001214d317b088a6974d1a9a2d344374274a0c74620cee048c65343a6854d069a0533fa67dd16ce533da6754cd979bb6c325966299ad334a6674cc0db21b634dbe11f58aba42f7e129975328a64f4c9a99214a6474c8298f9b3820f468209090a8011bc00110a62f4c5847e8158011e5298a04a627920845312e88e22988530e11d1065dd883619c24c4530ca6174c2886410a6134c22983d30279fa5298052ffa5fc6ba18f214a5f94be0452f7a5ed4bd697a52f3a5e34bc2976a05d8c1297652eb79bc3297552e9a5d14b9697252e10bf61bfc0358001514b8296fd2dea5b94b61e6718a5ad4b50d3db4f7214b40d3c7768194b3e966d2cc797669a491f8158011e829659a620a4010f400114a594696b61f0ca5934b1e96252c3a5854b0696052bfe7fc120c0012ca57cf27573786c20d7e6774c52ba342600ac0001032661295b52b43410681cd031a0310227295852afb74a3295719f9114aac252aaa5534a9a95299df05e200ac00020a5454a879f519cf214a7e94f529d64684294e529ba52f4a58cd89439c010ffa04a520b8a843c72094a3e947528da5186670ccd19994b0252652528be7b6229455288a50f4a1a942d2845c1c70cbd997a32f065c427a94a50149f845278a4ee125c24801232949d8ca688a4e949ca938d270a4df49ba9355269a4d1499e93373be61ceecc890677024642931d262a4c3498292fb59531497692d88a4b3495e9295250a49a5292618d1111d9823c1a186a22924d247a48a316d904a487490a91f523ca47748e691b5234a46748c54161a08c82023bfc0948b691644961948a825229a4514892911bbe81f0a1a68000a0a441487e90e249c14401f2c1a5800141486e90d5219a42f485a90a9821df508055604a4274849de80ca41610c003bcb1148269045207a409480690000c5293281de084a3ff47f9dded69f209144be22d3a1947f68fbd1f42f28428f9f37651f0328f6d1e9a3d05da40cc80013147968f2175e2eba3bf0a51e0a3bf476a8ecd1d81c921244011800149475e8eb51d5a3a6428e884a39b47311ef03de45d850b9308774be431ad504a39747228e351c361ae528e151c1a38146fe8df734f1bac96f1051b8a36e5b8d1d616dd0c40628da84e6871b20451b24736228d7d1a7a346ed3c8519fa33d46768cdf32f68ea60b41157d11466a8ccd198e654428cbd1969782311ae84a329464e8c80ca319462e8c45187e63633ec248012341461a8c2d184e62c428c184381146068c0517f2c6458c1d8d06e838bb842517ea2f345e28bbd176a2e874a0e0cac0945ca8b8d170a2dc3220a2c576850228b404a2ce18b069300230002528b25161a2be3140a84a2bd4574ae60c4f000250e75025800d6000085158a2ab45528a9d1512b6e56d8ada90244919802514ea299452e8a5514775a06397612cb11451115908a2868ab0ac11580202428203620944fcabd834b00024289d84e5c21289c5135a26944c8aa495473144c689788a25944ae8955129a250eab8a9708f741449dd55152a0848107c011800139449a89188a23b446a88cd11600460004c51152b482288a5113a221918c8510da218539c65109278e22883d103a20143f687d50f9a1f143d687a31575143c687803f0892c425be84a1df43b9d3a03c005000004c33880943add35a1f42afa4287550e96228300c584a1cd4392871d0e0a1b9436e86b84e400460005450d6a1ab434a86850cf288c03d400020a1968724400b2000222864142c11430686050bfa17d42f685cd0b5a16942ce85728a15013948c09011429f942a6f91826d408d83610002409e88641104f3d0c408744e13fc04f008f2142944d225bc1942909e208a145427e84e8ca137426a84cd098a12f67f0c138f564e0fb816a90a12d425684a5092a11c51d0484a1186cad2f90ca10c12842d0811141f683e507aa0ed41c099313242646390837428a0df41ba835d067a0c88404c5063a0c141789792ae6ccd40e941398001494171ced0861072e023ca505ba0b5415e82910a0a3c969ce5006b00025027a84a0a14136826504ba093411a8211281250016d14503c0940ee81d5038a06d40ce2a99252000282818d030a05fc940850290940a1cce121c2436062ca121809409a812d023a043408280f8404011e8280f501d730ea9a5a2114a039406a80b11d454b447348e65ba540471fac70872f246e04e3819600460000c5015a021403c27f809e011e6280684233267744396d23240b546396b09402e8045006a0044280019b90bc406280009408e60f980008c9ff645b18968c9ff33fda7facff19fe044b30f71c9fdf3fae7f5110021fc527f484ee892c327f44fe71df832ed8049fca127f27216c3b4436cb85149fc73f808640c9fbe7e6821b08f3213f7424fda9fb2e49064fd89faf3f467e84fcf21231e00e720a093f367e57201193f1824fc59f893f0c146109f833f027dfb901213efa7decfbb9f733ede7db4fb59f693ece7d74fade3e6c27d64fab71c6330d684 + +def cs_27 : Nat := + 0x18760206e808e4bdc96392bc3a441c9499360808023c839277248230e68407680ecc627800120e4794ef889f9c11c8c7208210231c8b90784a4219048031e0c7a03e007a800128c7482391220d60bd0619dd08e4427e30820ca418816a8c31de104058472180a30439057208e40dc809071fa25b4438f9093ee82102c2e3e000461f3f09f09c238f371e53ebd4d41071de10f960471d4a674444a90986c1c728871c6130d6849f5011c708471c029ce4af0c8936118c7841a4e130d11ef410e344238cf7192a5d0638c6147a1244011800128e3138ef0a360dd445c8a619a0811a426195219021c5ca32f10e2dc479883db411c5984716211c5838ad9f1631c548f500d2623dc838a7714ca52c602460986201c588714b8618461831e5111c46389f713a21c4d8f190c82327b68960103c3c4d225bc18e25dc4b3893c2f84149184c2f411c483139105f3c24f5e08e235c46063018a44c2388b625a21c450ed2939431c4304710aa4244388208349c2002b000220f338470f67980bcd0c70f2a3f64de8c70ec130b304c2c2100ac008f10e1b820e800a4010f4001109a5a11c353866118565c2e0870b4e16438a8c5a1c1025e84c2a6e1470a80c0dbc11c21b8419e7c31c20383f707a306930023000231c1db83910e0d1c19b8311877e42382f705cc33c63828619821c130343625a31c12b82435903309f847042e0800708c7038371b6b10cb16611c0c07fb10e0544c0883b8a11c0a38135132306d584e2fa11c079dbb10e0346ca083b6616f0b0d0c3b6045581a58001203db820407032c008c000901b0e0bd04380508e00c238027002dffc61d9a081e3026123087650237f61ab23554000906fe6dfc9bf5c3db2029a424efe0984602611608df90237e00e0a2012c846fac1142c846fa47544b238c6f9edf3b29e0c6f9611be437c719a231be2b7c4198c06bc07a800130a0e5ad50863c811bdf37bc506815901d28273000271bdd161a1002cc237b819542307fb7b33a4031bd937b06f5edeb9821146f5431ea8b40c6f4d83d8437a49d928bac0009018c011bd028151073ec2303208de6c237986f2c200ce0199000233075846f1e11bc7388610de2c21cd9089ff5715086f12de1dbc237814fe251ee8840b1616240629499209fa82bf8ef50002406099595181cd3dc837792b1221bb8b76d6ed9836c80be908dda9bb40839547f18437612aba205e481eb069833068846eb09ee824d00f5000250e48abfe10dd492f908d9d61036f046e9a111041c82082e4421b04330002405c7cf3e10dd2e1b7086e8a2df0460be0982ec2150116a621b9e15a410dcedb9d1c5c1682413cb041676af64437350c3abb846008f08dcbb059086e589df82f6818a0002505771c3510dc94e1908c15a1056e68d2102b6056b90210f9010bc011800139df6c2371e6e3670806434608dc69104086e302aa9a7b8c381810e04844eb811b88370f1fc431b87275610ae7821476082a393a80a8b8666401a2029801ea0004804c508dc287e688c128dc10436fe01c221b7e36fb6df4514c8071c08dbe5b7b0498180518236f4016621b78b6ee4e4e0438145800130dbac236e6ef802139104fca7f94bf28fe50fc9edb7cc7e4d08db5827e48fc8f81e1b6826f928db34236c8a2d020dbc13c711f917f21c0de19380427e426d7edafb03610c0d21303284fc82dac84a081f9028a0004c70a807e1125867e40fc7ff8fb02bb69c289abc47988fc79f8eff1d7e3721f8d7f19fe30c09843f17368c4d0a33f15b6889baa64c800094fc4ff89bf12b6816d00d9f5b3e367b4cd00ca828c08f761f88bf101ab84b7843f0efe1cfc35f867f0b9aae100673f0b096011f84ff087e0ffc1df833f05fe0939f821314880f2a15d4b8f800120d96db2d77681980a827e055d2a21b2704fc021d583a9800021f803effb644c03c48a139d986c7c13efee0189b0c9744000946c6ed8d8b850cfbf9f7dfefb7df4fbe7f7cbef71cc01c13ef6fdec0aee01ac000946c4404940918cfbd5f7a12e880012019fedd288fbcdf78effeb6116c206788c7de16c1223eeeb60510d8112d6828b000243eed04fbb1f75aff785e0ee5053eeafdd4fb9c33ee67dcb4afc33ee484fb8c13ee2018b10d751ae8ae0e19f70e694161a1865d488180f5000242693046b9b348c47dc16b8823ee07dbc11f6ebedb5fcb6b5ed6b8c9598fb67f6cbed8fdb0fb5e0e8484ba5d241f6bbed6fdabfb526af4a359209f69fed2a5151dea0004a028f08d631ac5b57d6af8d5edabc874039f68bed07d9f259643ecf24e9314e0314a4c9499b012fd5846adea1f047d9dfb39f66fecd7d99fb31f65dab1356049f653ec9987e0a4010f400118fb25f63fec6c49621f62fec4b5476a8c1bfc035800139f61fec3353919f5fc7b80f6d0002437d6352f6a5cd4b5a96352a6a52604c7a0a5d251f5f7ebd88faf0046c1b080012091a427d76faebdac8603d500d6000467d726a18ff9067d70fade97c863508565a2122384fad611a8034ff69f88bb08179a08d3eda7b88fad215bca4c8cfad1f59da77b4ee69da1d00c7d6669cd5a4c67d65fac9f58feb134e169bed37946ea069b8d36efa8b4d520d34da6888fac2d317b470cfabed2f5a5e34bb98b851a5c84fab6d2c11e223c2217cfda54b4a6cec242f9e23ac2dba18808349d088e9c216d4088e8cee400f5000241a4c16c61b5c25d407a80013036ac27d54fa9ff535a435f2e68fe63ea67d4bfa95f523ea3fd45fa88d1bda3696791a70c821879f208d1ada350d2c0808023ca7d43fa83f501a31b46168be61a2f4c160046000487d3d68aeb22067d39fa6e2260404fa6213e987d2efa5bf4b1a1c3437686cd0d6f7f09c7032c008c000b4fa4ff497e917d20684d15e4c7d1f683cd0706341a6832d061a0b8c571b6e604c08497c2d04e3360c337a11a08340e10d035a03dee5181f2119508459a16e439f800121f4799fe33fb759e00ac00098fa37f46be8cb3f006c20004c33ea08cfa59f433e767ca55b4219800139f44d9f1161a19f44af658867ba8a3caab84df0dd053e8833da67b09f0087d0ffa1df42ca9406c422ac0d2c000a0fa0ecf102bb806b0002525d204fa060e5c0118001217ac427d01fa00cebd9d733ad67577a8911b13c749f3f827cf8f9ecce619cb8adb186a63e7afcf4f9e433e78fce7f9cb7a3c87ce3f9c02a0407a800029f37d9b9337166e0cdbe5b421d243a083e6e0a42a7d2312e904f9b412f3b0466a579c59a7b34e669a86987a405643ac2919a3b34511f353e69fcd1bcce4f98a7cd0bcc44f5537c90f99ff33259f0cf99213e63b323664033e637cc3f9841624062949931f2f7e5e7cbbf973f2e3e5a98f966ac1447cb1f9604cb825988f729552827cad09f2ad1388865b8cb6d96c554221f29fe537ca5f946cb35965666b39f289963a0eb19f287e4e886572cadc3180cf937f2665708c656154c847c98f92ff25be4afc92f923f23ef05a0cca4102c203d1099600088079e382823e45b290651eca3487c8a6510820892307644be461942b2846506ca0487c89f90e2039904f90813e4104f903f1fce940c64dec9b2efa10c820c9a036a9499181b4c21c0840941b361ba0cf8fa13e3dfc7af8f2a9988325b0d3023e3b04f8e612ef004f8d0468447c6409f18824a880903782323e09f17027c5af8b2126067c58f8ac219178da11129e19143227bb92402d5900c06c2000487c55f8a6c87d90f5dc32844bc25dbe641a7f32696906416c82041fc609f14aedc3204bb6c4087e1e3811f145fa288f89ff1386898cf89bf133e257c4821f11fe227c43bb3443e1fca4111f0f7e1e31d419f0ebe1cfc38f86c4174a7c350698218e3b1c511f0cfe1888f861f0bfe16fc2bf85253e1384f84cc6918d1b1a021f077e0e188d4be443e0c5d6c632ac63c87c16f829f04fe097c11f81e63e077c0df818c5a887c05f8080f7917610f80413e007bfc11efebdfcfbf7f7edefd6ea4314e6298c5218a3a92b59efd3df9fbeff7dcc4d410f02f0000282e9d04f7d6c4ad894b128624cc4958918d2740c480f321e602f344188e1e5b69ee3188db11a6232c45b6c494f7d5efa7df47be762162580c7be4f7c2c3e024d00f5000263deeb0f21c841ba087bdcba2c23ded7bd9f7a7ef43de7fbccf797ef2bde4fbc8f78fef1bde2fbc1f77deef585b96c77fc933ddcbe3c11eee2e7d08f76feed9854002b000250ed483f0892c33dd90492d213dd77ba911ee9427ba4f747ee8467ba06fb02183db07a60eec1dae6fb07119f0c4c9053e209ee7983510c818c1a729e08b9b413dcefb9b199a220016a94b9a4c17d41e0cf734c164b12069311ee53dcc3050609c33dca04f727ee49820c3b421ee3027b87606420e7b04606011817302c11ee18e73a5f218739422b08604ec09461a8c6046409047b84f70493c067b7ff6fd72a067b75f6e9edc867b71f6e1edbee4e10f6d8bfd97fa2ff35fe253db57b69f6cbed93db1fb62f6c3723505c8a08bf7427b5ef6bbed73dadfb58f6ae0eb00ee818a0002a17e8afcf2a022d4c848d908151027b52f6a3ed3c67b4eb8ee187577090f69bed33da38cf68ded157d6afac5f57d218c7b42f682be917d11c1429ed0054e92520002417cb84f67813d9c2f8b9c7e33d9bfb36b8aa33d9a7b325ef033d987b2df655711a447a32f306ef847988f653eca3d939bb42826220016a9cf64dec92e1f2f5221ec8fd917b201970da43c1b8a19ec7427b1a5e8026d408d8361000263d8caf3b5e6a32e1504f630bcb8db54b3921ec5d79588f628bca17930cc93403d40008c90c43b119118cf62212e0c841d760fc224b0cf621ec3c1b10cf61d703c47b0cf6174c5067b07f60d700067b03f5fc325c00090f5edebd7d7a7af121ebc3d77faee5dc01a74145800138bb7adf4aeda5daf20c4d6692ce0686c4b52083f812023d75faeaf5d3eb98d611abf01f003d4000a4f5c7eb8bd707adef5babae6dec2eb65d696f55757777061eb67d6c7ad7f5a8403c8856f293233d697ad1f5a1eb3db2714f59deb2bd638cf58c693447ac4f587eb0bd60fac05cf063d5f7abd346068b436b972031eaf3d5b9a0423b2ff90a2e615cbeb97097210b74a13d5b2e57a5563172999f233dec4b485b9e08b941726819600460004a2e4bb7324654965905c90b91d723062020b91172088f569eac047aaf5c621a6067aab39c022dc384f54e1171105870b080f44265800231ea881e4028b00024034d84f543ea7d2bd0c5c3095d48e0000020569022e165c2ab851709947029ea6fd4d7a99f52e41701ae015bfeb7f087a955bec1ba06046f000423d49c794085642ecf0594f522549447a8f09af9827a8ef517ea28c890677024663d43fa84f507ea0bd40fa80f4fef0ad07a7df4f43bd86028f096d50c6c3fe419091027a7609e9d7d3a7a73f4def744a7a6df4d9e9abd34fa68f4cbe993d317a60f4be29e9bec30f4bde973d2d0cf4b3e95047a52f4a3e9396b35b2428b5856b03bd519e9296ab2d555aa043d24b11411e91ed8c88f48de917d207a3f5a7697c8c5b1008b4ced8688b61613d1f7a3df479e8efd1c03b801ea000502d282f185e2474f0a9929e8dd692ad2451f043d1b7a35f4681d0087a2f09e8ad6895db0198da800088f452b43840b0509e8a16832d055a08b4060a998f44a110c07a800121e88c27a1c59e25c7c00090f4331b84b8d3fe421e863d0bfa14108c97c8a23c1053003d400090f425e843d067a0a59ac52d68042dae0d2c0008cf40c13cfe79f98d7615dc035800130b2e165bc6b646ea41da404f3eeb294b3d874a065007740c5000141e7d0b3b050800460004a79f009e7bfcf72c9b5934b254688818b39e7b7cf42c8d591043cf3164711e796d5408f3c9e78ad518cb54007740c5000121e77fcef79dd58c8b18d63018f3b612d4884f3b4b1456284ec721e758279d4f3a423ce8f9cff39ab0f4adb8c3531e733ce5f9c7f38a43ce22c30585e15ec82c29259623ce1f9c2f37e33cde2c190a4a1d50879baf37023cdb79b41118cc279aed5ee109020f8023000263cd679ab44ccc55c82bf4082dec1b0800118afc95f8950a0ac87584a79aaf351e69bcd210f345e67fcce0cf337e669d480b2712c053cccabcd5792af1ad218aec08fac55d07995f329e647cc762b50002615d4aba8574cae955d12ba143ee2a581bb014a018e00058798df318ae610f690f30fe60fcc15a2b21e5fbcbef97cf2f7e5e3cbb5a168bc210524af28f2e968455b42b6591c2501ef22ec11e5cd5b12b6156c0ad7af3518f2e213cb85a06104f44320881360115a3c03001ea00048796bf2d5e59fcb32b3d567663cb2f964f2c7e582cfe140b4a0ff810780f50002522da03e710ac882137b382823cae84f2b7e563cabf9567a260834015800141e54bca8f950f29de530a794af291e51acf110f287e50bc9fd9da21e4ebc9c887b2fb64157704f271e4dc4308397011e5156faadd55b9672d56b94f26be4d156820d1257603d40009cf265e4c3c97f92df254186406a802b000293c9404aa6413c937924557a25d887923f243e483c8f10f239e46fc8d7919f229e447c850720035e03d4000acf212487090d818b20486027908f20c22ccf84f2061153ed99c8a6e4b2c879024be423c7ff8fe8a6230345493d11e3f7c7df8fa72ee42ef0040c8213c7c78f54b7833c792a4411147c278f1f1dc23c76f8ecf1d232cbc8422e412cba916c625a33c73f8e6b2d2a86550c2a17542ca855ca324f1ca23cc478e209e37cfdc88f1bde36fc6d29f989de514faa9f453e4a7c54f729ed53d8a7ad4f529e9326c1010047b40d7e6774478d9f1ae23c6af8d43efe33c6904f1a3e3414eb0cf19de337c66594621e32bc6429c40698414e004f18be312c9d8c72021225d041dbe13c60d93471e2332e104f18040013b103610002514d28ab9035e03d400014b25aa668b0c806b000253c5f2995b254a6462521f12067660fd044a209a77c278bdf17413b0035800129e2e3c5a297a19e2cfc59297552e2031c00098f15de2ab0cd0c89101022999b000d600048591171728cb800090f15023cc478a609e2954aea95a06c20004a789ff13a23c4d7895f129e24d49f1ea430facc2293908a4dd49b0f190c82404d80452647a580cb0023000253c48a92b10a4a9494081e065f780008cb1f011491034b000233c457889f10de215486a90c5216a42ac7592cb50e1f82787d08a3ec2a7821e05e00004a7878f0efb624628f551e8056004790f0ede1cc4787151d61d006786f09e1afc35786618394daa408f0c8a37146da5d220a3582488023000242c680451aaa351469a32a21e18a79e08f0c013c2f785d1c4cc55c8785b08a31027859093cc80ee818a000243c2bc41a11e1584ef08f0a96304430cc09e14bc27f84e5152e0786e718f09762cc478485140a27d44f695e29e11d85888f08de1092de0cd2ac1144484700613c1e9da310a2082783c50fca1f06783a09a520243db09625139d8850c213c1b37e411e0d2e7188b1153bb83740c509e13c197831b104df28011800131e0bfc17782df057e0a676f18f051e09bc12f822f040a0972919cf03aa068631a2eb000253c0cf818f02a31404845611e03fc0608710c13c057809b0aa300fc81450002313fb27f307e013a40118001316134e63158f018e0004a780406c423c01a7e34fc5610e1c6144fb22fbd7ff8cb07e13c0127d24fa29f42c1d0bc903d60d31078014f8020aa384effe9ee53db8c033806640008ceffa9ec53d827af171f3cf8c27ae86e22e242048404011e63bfe77fa11dfe027b5509dfd7bf977f0efdfdfbbbf5f7eaefce82c08040c6013bf277e3efc5df8434c14efbfdf7bbee77daefb1df5d1041cefabdf53be9a75c21df40277cfef9ddf37be677c829df1c13b800119df14227484e8e9cfc531014100026096584ef894360443254e6e9cd939aa7344e660514000a0ef87df0abf08c6dd61139284ef83deffbdf0a14bcec53bdef7bcef77deebbdbf7b531ded3bd9a6fe4dfa0cc4965984df005140008cef629bc1b6192cb204f10226ee4dda9bac677ad85e29b9136d26d8c0ca63bd677a811de9fbd288ef49de8fbd0f7a0ef3e09140009cef39de6d354369509d801ac0009cef27c24c4778eef1a9a4134410c829de30d7f089586e84134284859a13bc557961099f933eaee119de20d6912dd1899b58ab881bee0da402a00230002517692ad711de13bc1f7801819042777feefa23bbe26564caa994c965941b9c13bbda64f1020187577094eef5dde7bbb8c12c012bbb04eeebddc04776feeddddb6405104c48d9603c7287c21dda7bb3c28b247e056004798eec213baf84eeb9dd6847758eeaddd57baa7753348e612ffa5fe347e33ba9775184e633ba8774f12c033ba604ee8e10dc0008cee8bdd03b9ff73e0cff6e94c773b06ba55f015480f5000263b9c7732ae7e187577094ee615ce92d52406206724ae688093013b97f72a11dca027727ee42963eb9290ee3fdc712bc2576205690277190314000465fe10865f8277134ace212b3196b09c8008c00094ee21dc3fb86d71020b7ec2578437000240aa3006b0002312aca5552e1433b857709ee0a33b823c4511dc0fb817701edfbdbeca76faedf3dbdc625364a6b07e49f310adf307d8476f6ede623b7776ededd433b7476e7edcddb97b7276e3edc493bca4ca4edc3db83b6e56d149ac1510c76daedb3db61267815529db5eb6441c0498e93107df873712c083b6b24b91092e125bc1b44961a74ca76cf30a74fa4624ad494e611f0cc800129db3a0d708ed9613b64f6c84924b5a0876c5491ed6a8676c4ed87be8c676c148fe23b6076bc1091ccbffb12d19dae4276b8431023b5a808f105f7c276b209dac5ff208ed61dabfb562442488290fda809ced52d3f121be787486305e4c76a70905c048225f219da9420bc309da77b4cf698ed2fda5bb4ac153388fd11f79735188fac18f8023000243b49768e11da2827688ed0e526467685ed048f1d67290ed03d9fc4767eecfa8ecd1d92cd6288ebc6e892cb19d9f3b3df679ecf1d9d8a7674471a5a9cb5215a4285a8c6bd83e6000243b398d747ba2311c30d700b080f44265800231d9c91ba88ecddd9b11b6a36b1a8209dc0009cecd3d99c47665ecc88d640358001288d5eb1cac981a2b76c0a7662983c22b1a4c1711d9802765f591023b2df65aecb08cb5196232a31d95fb2b2322195890203e7081ba02765209d943b27f64eec9a58318ab98ec99d92fb25019f00d60004c560c191022b0404ac0a8bd44764945e28bbd17722eb000261a0e0445d08b9eafd8cec8fd917b210cec83d8f88120c459e8b3a065b018208b182763cec77d8e4acd057f1dea0000e7638ec6bd8cfb17f62eec5bd8afb1495562aa6132c00130ec50552825988f7208a1eaec4bbb188a0b77f08814c89dc8640cec4fd8944152a86e823b127620ec3e0e5c04794ec3dd86d125835d2af80aa407a800141d8642761709d856adf223b447488e2add14e01b9c83b0a7613ec25d847b06760b444aaefc34c24ec142b6c61a8c443d01d910a8cab5405040008c441c0fc224b0cec0a13b02406d11d80d0ff21fc43f687e55cf1843e855f44760109d7f90f59467e1b443afef5fcebf7d7e4875f401ea000462b7d09d7caac6943c01ea0004a21c3438287019ae21bc28561b54a4ca0cd5413af8f5ef11d7b6ac1171f000243af5f5e7432686410c7a18d806673af36e9a11d790275e042d885aaab310ebbdd7750aa556120853a59408aab813aeda1431222355400094428084fd09ed9f020f450275d60955502134e0a10008c00090eba3d737ae6554c42455528c75cbeb93d71486410eb89d70d086843820cb6444686bf33ba41082a104aa8433ae175c1eb7fd6fbadea0f041dc9744000a4eb75d6e7adc20e17fb2833d066a0cc7fa48321063b2ae418154c9c20be417a82ec675b7414a828d94ba09e413862a8ea0960f3c15fc77a800131d6cbad608eb51d69fad1f5a0eb3f542cc205740a0acb461a2b307e21027204d0daa5264806d3087023acf759beb35d667acc75903047108e0000019d634cf988eb16fde10113f75403a80712de1ceb11d61842014f1dc23ac1f582eb027fec8b7943ff27fd8cd88ceaf5d5e7abc7576a9be7fa0ff10c0e04e6000546e0f09d5d7aba320f031642a6a9fc83f8c33ab9910411d5c7ab7f56eeadbd5aca154709d59bab2f563eac5d57f2f61863d47e5df9b0ceabdd55faab1f7a3eee05140009ceaabd552a590c3ed21083fa526028a0004810784a421904654ad0952ac2754eea993f186754bea947d588280ef500026014784ea8e7d42a4db1bb207c179c6ab1c3e927d1c40456095260fa1172019d51baa2f5433e5a7ca8a0ff50af623aa175410c4033aa03ee7db9232a4184ea7dd4f5f708cea7751e4f7908f721d4eba9cf53619d4cba98f530ea5ec5cbc5318ea5a13a96752bea4c74a081ebc048a000467522ea42c55c61eac5280273064c103d54271447520a8b823a8f04ea3bd46fa8d313c3d163bd8c1e8a626e224e984ea33d45fa8b1e7b625a53a8a9e71a88679b9f4b1e5ea87e71f461e503c9ec45087514ea25d447a87750d3c618dace750c61fe2187c1e22a85c120c00094ea1611bc0010ca85613a84f505f0c033a81a8c911d40ba80f4fea83843a7ef4fce9f7d3e481dea06880a6007a800129d3dfa7b1ddd51484f1ca74f2618623a788dbb11d3b7a760db501ea0004a1dc43b86f8f8ee01dbe3b7b5000ed8a0e9d4c2a441dad3b584b2c61da907e112586497109d39c21d9f09d398ecb9d963b2841f17843b1a1d912f90c92cc129f73e229dfc33a72f4e4e9c47590eb19d6131d384eafd3e560e233e189918a7c4116440460d443204015509d383a6e1d3f3a7c333444002d5394f58e9c1d37198697c8a74db0ac87584674d8e9ac23a6af4d4e9a7d33ce845cc2307410e819d000c2c0314a4c98e997d327a6474c420c07821cd639abe020674c3e985d304e671ccd182c5e50e1c1409d2ffa5f74b917e80d8400098e96a55f4453a4396c72d019d983f29d2d3a59bdb14f84131c0c598e963d2bc474ada72c3558674ace95423a5404e94bd287a50749ee939d26fa4c1ca7082d2847497e92bd24c6748f09d2369bb88e919d22ba44f487e90bd213a41f482e901d1ffa3f747c61d1efa3d535f5f0229ce4af185efa13a3cf478e8e7d1c3a379bcd37954d3a447a32f51d1bba358a160d8845581a5800139d1aba34f468e8cfd190a7461e8be23a2f745d90f06e288745ce8ae2299b9b8036f80318e33945e6edb0c9658ce8ac6dce998898b100650db61b6736c86d8d36f847d62ae73a2af454e8a23b1191194a64812990b1571192502744fe8986ccb440907a2813a25f44ae893920881b234d5423a2384362ebbf9350018b21d11ba2208e88121184743e09d0f3a1d9b004d0a43a1c8435e26bbd7708ce86c13a1a52fa35c66b80852f8086b3bbc2885da4ab5c474325d9c20d639ac6358a6b10d61aec631d0bba16bcde18f3702742be855d0a4d5110e849d08842eaeeee021e6704e841d067a0c1a71797669a4d324d9c41d054d2688349613a04f408e80fd01ba0273fc342a64cd073fbe7f221e4919fe4ba4339f999fc33f619b98ab94e7e54aac40661033e01ac00090a54ef2208d4a6f921cfc39f7f3ee232a4b2ca19db18d6239f673e8e7cfcf8a54014e7c34a5034c0c336001ac0008c39c0139ef19ac5c4e66a48a8b15730b88eb9288333c6674cce199a33326660ccaa57e41cf739ed73d8331466242a0046f00048029e91214be4339ebf3d54ac2339e773cbe7946528ca4adf121a0591d073c7a4da223c704326611e1e192f5dc2339e004a4c864801e002800002539dff3bde773cee0c841907069c0d2c000a432096d7c473b731feb7306525b0863ccc7852550518439db73b5e75fcebb9d614a48a139d518aaa480627e66a94e752f02c473a6a46a239d2f3a330f2eff08739ee73bce679cb90e721ce3e90e249c3072b5c0c1b18353066939c72d681060892f9083043bea04181e1ea2239c5bbd011482c2180077945fd532f10e713480c473862fb6239c2f381777b5a7c824512f88b4e8651fb2f4d47d4bd010e701cdff9be8ce6f2ee7c451e669ce103802a0023000260bb584e6e34788baf975e2eba3bf0c7370e6d5cda79b3f366e6cbcd8ce23e12596239b0735fe6bdcd708735be6b2239aa863010ede022ce50946f0b7c23bb19cd44273482dc68eb0b6e86202946d42734609cd0b9a0f33fe6745a582b7949939ccdf998957c055203d4000982d0059fe4b30c1d0813996732a11cc9c283040e00a8008c0009846ba13991966d46a859a487322e643cc81d9990e63dcc74b28a33e09060008c2c8a46742398c731610590d19788e628b1f8b1a96322c60ec683741ce623cc439863b10205870b0c806b000240b0c16177610583dd828c9e2b4870b043b00fa4c339848c8700003162bb4281145a0273062bd14588af295e20c3abb84e15e0a2be23982f3032b98313c00094e603cc003ee834b00025397ef2fce5ed453483ad5bdbc2397a72f2e5dfcba68a11445585608ac00ce5d00d88472e6e5c82397151362ad255a190414e5bc552825988f721cb756014bbb19cb7396df2dae5adcb5796a3aaa2a5454a6892a8a2461288d950a0ac87584872d20889602511709cb3f96772cc1944445a20b41194439d4babd919cb2f964f2c875202c9c4b018278e1288294d9a202af1dff214e58fcb153ba8ce5801395f72bde577caeb95c9497292c525315b2444065234a46148a67105395b84e56a2a301a5800121cacf958946f28dce98ca341828cfc368450e114eec820650de28b223958081111434ca26ab86181c54272ab288274a0672a509ca8b950941f19ca8394f729ae531ca53947f28339ca0393f08e4fb42709d913af275aacd0c13a612d4179c6ab10e4f84e895958cb3f64e409c7ab27270e2044c1384084e0d58f937e26fa4dea84718e4f1421847273a0fe4d284b010e4e5c9b8993132426464c88990d06c55f44c56834c58e61c9ac981210119c9a5cf008a0ba139347266e4cb41648505525a8837c015800129c98392ff25ea09cab1ca7259e4b0e7006504718a022821b9b91141009411281250016d0a127d384802c80009024f41392b127155563392af253410c32816a07c01ea000487251e49a137c374107338487090d818b21c933925f248c42c43923f246e489c9048398754d2d105175800128478d2f908e481c8f48ea2a5a239a47308e591c7eb1c9391e723be475c8dc8723672d622804f8ee11401c27232e463c8bccdc85e2031463917722d22d8c4b48722b09c8a67fa082268139137224e443c88390ff21e21fa43f087d90fa03d60d318721de439c86c14610e4313f843740c725a7e7c865183f20432020b98087e6821b08f3193f7085c99360808023ca721409c8442720e213ea77865610e41bc8339050ce40bc808833106520c40b54c71fee3fa0a30671fc1302238fdf1fa2082410081da9b3205ce3d9071f7f84e2251004203c40467d8b8ee1ff87cb0c71f5e3e9c7bb8f6103e2e3f707edc4a43e240cecc1f9ce3d5c7a040fc18934101004790631e138f3f1e6e3cb3e734ea949f2c5c28471e4041a00ac000902190138ee71d97162338eacf8d11c7538e89eb018c55c2315509c72b8e39ea301ea0000a4f78083c6432088e38bc7138e1f1c21df6a47877bb139405f3c271bfe377c6ea7abe99d29c6e78db8ecb1d94e208a0d2709c6c8f308eb01d5f3d402a7821e05e00005228f7000221c389e4d1d163a29f439402b0023c471ac2ede03e007a800129c6a38d308e3485f6c41e301cb4396472c17551caa2c14e71a2094a74a064bbb0897482719f4654238ce4f3c11e18020e2807fc083c07a800128349c27199e32e2145f17121c0c38152e914883411c16441411c6538c9cf2b1837b46f612cb1837a86f383312596438c9718fe31dc6378c67186e309c60f8c17181e2feb38bf717ce2f7c5eb8bccf0b700a738bb84e2eadff8b4a03b801ea0004c7174e2e2dfe861d921abca1d464f003b161d986716fe2d1c5978b237e429c58b8b0715f2a4a438ac7155e2a9c53d41a05643ac2706580caf195c32b08714ae291c51f8a37145e288c108e7143e28000ac00090e279c4ee7628ce26fc4cc4712e09c4af8957126e24bc4881f8449639c4878907118e227c44b888f10fe21dc42f8857109e211c40b87fb8e1fdc3f387dce802139f4a808b5319c3e9b9c0b4719304387ba79611c3db87a08e1e7c3b041c3115c382b056f0add15b870ac56c8ad815ae40843e4232a693994e13089cc23ff455e4e5c21c38c270e0082a64270dfe1bc2a5854ace4d1510062ce0a86150a0cecc1f90e1bbc37386c843300025386b84e1a413867849c6c511c52621d02003d400088e19c290db778a3f147c50e0b851ce19bc32f864f0c8e17adb67a2f9ce179c2ed380312d21c2e9b68d7c519c2e785b1b78278e4385aa6e6c9403179584e15e257c4af045621c2ba6f7894225964385670abe14fc2826f6147a2811b4d814500023384f709d4d54309a6110706c20004870999bc89a80464369129c25934b88e12613848f089e111376533c887535ca4bd4437886e10da52658708409c1fe6e5031f00460004a707b9b88208c0cb00230000626e0881d103936f3f0c14e0f0d9b4d520c5021c1d024dad0f640fc224b10853613838077f249e1de5b2907750ee9368174aa434ce1d7091f8158011e526ce049b32d9083a00c22101383092284e7633830705b11c14b828f0509afe43827f04ee09a689c3698438306882ef68407032c008c00098e093c11f8229a0423b21a30092812341c10db0f089ac280b04704109c0ef81c4d5919c0dc63f88e069c0cb81728dd213516b9a88e05217f82feb5f21886c4c8c7028e04fc081af38f6e28d78a11999a50b341663ee718e03dc07780d8ce03211aec04fb8a14dc29b05350a68660429635d15c1c9019707cb069600048701409c04668e88e015c020410d02c8e2034d844a96111447b8ce006f1144042b2176107420e05b30002638016ffedff3bfc77f86feddfd9bfae67c24dfd5bfa37f03589207c179c6ab1cdfbfbf7b7eeefdc316e6774c6fdbdfb5bf5b7e9efd1dfa1334e669356a49bf3f7e76fcd49a8437e5efc8df8dbf14b0c806b0002737e1355611bf077dfefbedf7bbef1aa418df77bee83800c30a74fa0011800121bee5aa11847c334437dc6fb52e3e000486fb33070287679f106a72137d8efb0df5dbeab7d4efa6df4bbe8d04ca948fe237d0efa0df3fbe7b7ceef9bdf35be65234a4df31be5b7ca350d203bb07748c5019be4f7c96f8fdf1d322df4d989910137c604df17be2b7c434f721be1e63f34f513bc437c33ba71024112f908df09be0046f7fdef9bdef7bd6f78deee9018e6f76deebbdd26345f4a1c6489c4e6f73dee3bdbf7b66f6bded4c35ce6f69ded1bd977b26f63dec28ebc6e892cb488eb0b6e862018d27426f60debbbd737ada39b29bd6661f8d2600460004a6f58deae35c02c203d109960008e6f56deabbd537a8168c288dd424c3368f4d1e064c320a8011bc001102afa137a76f4d68da59e469c320831bd2a5e0889851f50844c2309bd21d9988de8b305c46f430930211a1170a11bd0a6094c0f4666590436a9499388cbc26f40de7f303260410de7cd10846f3d2c54d6a865aa309bcec65b08de72d0e4e940c195810b0b036211bcdf79b6f35de67bccb798c090392fc864408de617be446f2ede59bcad40a901dec13794ef2797c3456484be0337a237926f23de44e21886f21de41bc7ef7010bdbc1378eef1bde348ae886f17de2c8ad848f01dd03140004e40be092f265e433ea19bc4f788ef10de1fbc3b786ef0cde17bc2b784cbbe2aac554c265800279bc23783ef06de0843780ef00ddffbbeb77c8ba108c40d2c000a4975e1377beef6ddebbbcb7786eee97420e5c047a4dddbbbb00358000212e7024b9b44902d105a09013801204804ddd1bb9f7736ee5ddc9bb8f77114e009e00504000acddc3bb8376ea77520888026edbddb1bb5ef4c10ddac88301b580f50002501f8449611bb4f7696ed1dda1bb38a6eccdd97bb250fa157d29bb1c26ec6a1b023761eec0dd7e974886ebbdd75bae375b10dd672d6046eb014240ff810780f500026375704dd5486b17708c96a4867cdcc0397011e53754eea711ba962e9005400460004a6ea3dd422374f84dd3d2d0c4218412c02374e6e9a11ba5e59f0856761374aee94967085b04b6313231ba4f748ab2b192cc998c88dd21ba3f7476e8d96552ca0c6e8c964b2c8c66e8bdd15ba1f7436e83dd05ba00e6e7e092c5e58b2127192c4c26e7cdcf7b9e25859313028a0004e6e76dcebb9ce57f069b29b9c657d12f319b9bc23fe40999ac2493d09b9b657a12e4192bc657788dcd9b9af734ee6841a24af0c6e67dccdb9965728d2729b993731cadf95bd2b7505d98dcc0671421b800121b97cd5108dcb7b96772b87c84654503e387c60e8032567cacb95941e78e0a14dcac15dc035800121b95772a328d19b94904308dca081e03a688f321b93a55f4abd0e6443726ee4cbbf833725ee49dc91b91b7226e43345660fd04aadbbe22372084dc7db8f371d9a0c688452551b25b0d303254f971f00023371cca9b11b8df71aee3354a843718ee30dc5fb8bb716ee2cdc57b8ab714ee28dc4e186406a802b0002f3711ca8551ba337116e21dc3e3370e84dc39b86a53c8cdc31b85f70aee14dc25b8477079cdc1bb82d908e0d9207f3269688dc15b827703c95e21b81b702ee04dc03b7f76fe6dfa63e913bd26df8dbedb7c834e828b0002636f8dd9c10428c850149919b7c0fbe08dbddb7b25201f6921b7ab6f46de79470436f24a35946928ce518a9c030c7142028f09b78b6ef88dbbbb7718dd903e0bce3558c6ddb08ac236ecedd8dbadb75651014dba693c046dd263527cb064a181fea15ec66dd0634020f912da011b73b6e6edccc35a425094a11f82e336e484a906136e2edc4db87b70b6e0edc0db7ea5e901ef211ee2250084db7db6ef6dcedb8db6ee2e036a949940c5cbc5308db6db6d76d9edb0db5c536d6c9ea1532336d56da9db51b69881e9f4df0051400090db43b6807838cdb3fb6776ce49d193a174e8c49cc3cf01a6c66d99db31b65866d94db27b64b6c8ed90db1fb630e6d8bdb12224dcc9b86224336c449b111b61b6c2ed849356436c001af01ea000486d7e09b5f76bded7a1c841ba0a6d79daee236b9c37410c3afc300861cf109046d72dae1b5b36b5b0d129b5ab6b4ed68dace378566e18dac8c3198618c6180775040740de21b58d85e16d11dec436b08db711b57f6aeed5adab3b55e4b898daa815e046d52daa3b5436a7ed4dda99b52b6a4ed48da8d256d844b0da8bb5136a16d4060ee9748c6d3fda7db4f769e437429b4df69aa84505ca0528063800139b4cf6996d2f19b4bb6968cc34be4436966d2ada53b4a3693ed26da4bb48f6913047033e01ac000b4da3e744c46d1d87682368ddcc211b45a76388da27b4446280c605813dc28439ce97c846d0eda1b2475c4310da181f30449180b6823685193311b41ce67b77f19b41ae5588da09b40e4848bfd17f4a3e0c490509b409801854008de0008a157d09b3fc1a608d9fc72d019d983f21b3f767e6cfad9f0dd7ca6cf7d9ea23678ecef91e4306aa800111b3b76766cead9d3b398a6ce54f4815e06150e16d223dc66ce2d9c1b37b66decd991ab2e5ce6cd8d9abb34a46790d9a0bf0046ccfd99db3345768aec08fac55ce6cccd995b3276646cc7d98db3176626cc1d98122dd7cdb71269b2ff65e6cbbd975b2e765c6cb75f1cc4512018a00022365aecb3d965b2c7657ecac30bdd304788d956bdc69ab8c7ab213654a72d11b29b6524891377c10cc000987aa0124460f6d000233650eca04e363364fec9c5ea43364d6c99d931b25f64b3d4030273064c08d929b24446c90d91f21c866c8ed91bb22ee1510d915b223643ec864dbe11f58ab9cd908bc9846c83d905b20242fdc1929b1fd78b88d8fdb1f763e6c7bd8f4bc2c484854008de000946c7811fa056004790d8ef21493550cd8e84d105e50cd8e49a64ba70c7a0e125dd843619c24c46c715de0432062eee36009a1464843080e0658011800129b1b641faee435dc43635c83d10ee97c886c6ad8d3b1a3633aedc5db04b74e6c66906720c096590d8cb20b72318cd8c8df6046c62d8c3b17f62eec5c9037206575c128f0fcc11f58abb0d8b5b16762c6c56d8abb153629ec52d8a1b13f6266c4bd895200dc2e9509b11c26c44d8871ffa3fd961900d60004e6c40d87c223fc84d877b0eb61cec36d86bb0c7617ec29d851b09946c253422683953310d8491f7cd0211d97fc853611c7ddb74a33610866e03f20514000948fb067cc419f233de0d000c2000129b08360f6c1dd83896f0a19dd09b06760bec16d82bb04ca6c12d823b043607ec0b29b02b604d2921b42436046c07d80b1ee52c400c52932723dbc7b68f6a15e82bc14d802b86846bfd0895d826bfb0a8011bc001100a7a44852f90c8f4ec4504018b09afe75fc6bf732de7f00a6bf6d7ea658c26784cb0002623cf045bf8135f9ebf1329a3037404d7dfafbb5f6ebebd7d3afa23c71cd7ce64bd7708cd7cbaf90c908cd7c7af89ad20cd7c2644833b8123211e002190c091df6db108b6be135f06bded7b43bd886bd7091dae12208f4ec135eaebd4d7a5af475e812cb31af3f5e76bcc313f3354a6bca06c42092984b686116ce24d411af200c588d78e61f8290043d0004535e2ebc46410335e0c7476aa4335dfebbc11aeef5dd6bb9d771aedd6b718285dc2835d96bb0d75faeb96b0d20d1e901590eb0a4d75baead6aaad5021aeab5d46ba6d742409dc848e4f1c8846b9fd73dae7238edb0b291c6a38c47172f28435cd9790181a5c7c0009469ee135cceb98d72dae575ca6b93d721ae3906b8ad7131c0477e108dfd1bf438a8cd710d35446b8547f622a82330c9829ae128e706bf33ba435c0c6ed47c24b2c86b80035e03d400090d6ffadfb5beeb7cd6f7ade186e00b20002935bbeb764784320a084d6e6edc446b71d6e0b37066b6fd6ddadb75b5eb6ad6d0635b3eb65d6c9ad8f5b16b61d6c1ad7f5aea48d80b2ece0a0c8d7810b4a03b801ea000486b59d6b1ad5635746adf3e4635a9eb50d69eb26068addb030b254688818b19ad375a66b4bd695ad1ca6b45d688b215641e32a29ad0b5a0eb40d67faceb59ceb38d66d03cd26b34d667acc466b2ed659aca7593eb26d64bac93591eb22a2a0a358feb1d11ac7358deb19197b7826b17d62aeb4066b14d627ac475880c0100a8008c000a0d61dac375858cd615ac27583eb0321ac0b580eb00d5ff18e0a6afc2a5c23dc66af809449420f6e09abcf5790b7c19abc3577eaedd5d918a01b580f5000283574eae8d5ce53d204814d5cdab9630f2bd729d6535726ae3d5bc3356eeadcd5b7ab6b56cabc5750e7356c6ad74eea33569915711ab43567eaced59a0fc027480230002815d6e2b610880c1e4028b0002435656ac8d58fab1b56214573c13561eac2d581aaff55f2b9628cfc369062a509aaf50f20828b21355deab8a1ae1390011800131aadf55a6ab2d563aabe2f25a1556e086e450ecf3e59aab75566aaad553aaa3552a1a47fc8835523a3237200878178000131aa8426aa0d53baa6e2e3ab45134896f0e6a9ad52daa575496a9029aa3b5466a89428a154c245818a000083544214111aa1f5436a858b4f169a2d22b0aeba4835426a83d503aa0353fea7dd4f7a9eb53c459251a9d444c232a191638239e908349c26a73d4dba9b15722ae10b660004e6a6909a99f5336a65d4c7a989568806b0000822bf04 + +def cs_28 : Nat := + 0x1efa5cc210f7c82651c925621ef7047bdaf7adef40c186a11eef847bb816d043dda7bb2f760e698c24259661eeae51110f740e0a087b9cf72c6038a9e20c02423772082ff45fd28f8192414238e308f71328408ca0c11edfbdbd7b702f7483db77b629f08263818b28553423daf2a8e21ed69c9791e43327e847b48549442fd60993d4248e10993c823d987b2ef65063d912a022d4c614ff0871942a208c9d81246a047b16f629ec49c4e21939821c3f5f7488a463d84a6ee21ebe1c2d15b02b5c81087c8465473270047af27080400e109936823d737ae4f5c5eb71c060716617ca0438026ffc4054008de000863d6d7ad6f5a80c5907ad011eb2dc5510f58deb13d617ac03490a64c7102220a29847abef579eae0c7ab6bdb44431e08f560de60825c81024c04c97812447a32f1192e423d4f7a9a2325b84281e12442847a923d3043d48e8c419dc091903724132573d4010f4fe43c09c403140004a3d3cd92221e9d93d610bcfc21b8204b221e9bbd365e6edb0c965947a68f4c57980cc94610db304c9401324e845e4c11e93bd267a4af491e91af1c30c55c2649309d2008c000905e2e132470a9e11922420e9009a20420e8609921421b271cf620d90dc5510f43e6f3887a1af43323e0c977611e82aef24d16119864c147a07d0f8410c808055422eec0838a821af85dce209818479fe6bc041aee08bb842646c0991a8231e408f3d423cf479e6f3c1e77bcee79d8f3ad76720c8c611e738404b611e73645e10f37023cdba5ce209550479b1a16441aa418a021e6b3cd512ec3094787e608fac55c83cd3c8a020d4c041b2e11757777010f338252d508f32640708798ef31892e0cc88cf2fb2218c7974f2e53090c796ef2d44643c081cd03988001191fdc23cb10c402321b044c0211e55bca9e80a3173e040de066f443ca534711fa463ca108f27de4e3c9b3266401b604c85611e4b9a080af030d032e6011909823c90791ef235e4619f32867c8cf7b12d18f22423c86084668202f4099074247d108f20f20d88bfec11e413c8178fe31e3f64123388b8d080c43626421e3d52940d3030cd88478f07fd043c7608f1d1e3908c80e11e377aa31005d023c6c78d4f1a79ec9078ccf195e323c620ec251e2f845c1c12696845c1010cb79fc0118fec22e0008b7f822dfc08551c23c50092e1240091902e1411e2686e8118fbc263ed08f1142193c08106023c437884f104c9990787cb78c42de1086484263e1098f7823c37786cf0d0c825b5f28d654263d631e42082e84c7a6131e88478486380418d909493c23c21783f8f200a11001c211e0b847828b6c842dac08f744263bf08f039e06bc0b1948dd6cd24d60a88431dc0430fa3f1445c5508effd904085b1211dfc845b0811dfc63a75afa31aa40409301125869d310efb87c78483000441df3c74110ef99df2fa5018ef8ddf088306611defbbde77baef6f1ce3bd7a41a3d202b203a504e6000582d5c08ef51de808a416101a28477961132f047790d45c42d4708b5142008f085f7c23bc3055821de084069811a8684777f1c8842d3a080f4823bb8b61a21dda845a5e1121c04c6fe70504179269ee231bd84c6f2131bb84485011dd23b9f10ee703a00869d211dcd3b99a3c63120784772eee5b1b5000120ee4c20b04000221dc8827b01ea000482d082e9c21dc7b4d510ee35dc5bb8a7712b3eca3b88770cee171b0acf028ee028e388a38a10b88441a10edef1ac8876f4ede046355098d48b7c23bb188ee4223b7085bcc3208876dcb354035800120eda9db4b49d18ed94b6a08599a11db1bb6276bd46a06ce8d9a0d3071dad842d645abce1200b20002511c784a3485a90ad20c76acb2e843b51769e21da73b4da33830b4604596011657040ed80d840008c768c5a00b3fc966201d6023b447684ed05da04bc128ecf9d9e84f5198cda8c5082cbc11a2f84592011d9600f5000231d959651467c120c001147650b2204164a2c8e21d92847648ec8dd91632820ec7c23b1d08ec71d8cb44218ec56d51882c481a4c47b8c19701034684762545d443b0e761a093007c00f5000261d8584760e01ac0008cc62a10afe8c8d0ca831d7c0475ecebd5d7a3af220ebbe8b115e52bc418757709875dcebb540a8c75d011d728445c0131820475bc131808475b58be8451482b4821d6a22bc10b0b115d08759ceb2c462f108eb24ac008758eeb19d62bac475868a80c3ac2582a22e2a84c5cceae4aa49547218b8c5d50ba709060008a3ab508cf4023ab1307e21d58227110eaa8a95437418eaa688f315718eaa15f8082a141590eb08c7546896041509073021d50baa0753eea7483a9b29e90240662ce08ea59d4aba9375202c9c4b0181040115e804c58e11d45ba8910ea1c207e7337a20a5e04750aaefc34c0c4eea115de04c57c10a5004c5720fc224b0c74f2e9e35658c74ea13156ba6b43e855f483a680887c42034508e99c29989c018e98ca340828cfc368462a508518823a5e08ae4023a5c1a48209658474b4e9640ee818a0002510ec0474ad434443a55031621d29ba5274a2e941d27943f4ba2000503a4cd55c21d248f8610e91823a45283e21d2184181086c823a3f1ecc20a0b141311000b548081108e8e9d1c94096b544314484746f42a8dcc0397011e51d19de6a104fafa2f887462ad5043a2f745a23942a6f910ad2823a2b1360210c4047452e8987868c744ae8910bd8c744211d0fd09d10e87959a087434e8649d12b2b20e859d09881118e8441f3885644109bd9c141024a834d880af415e043a0b74122313284740c11d00ba008b4a331308473f60bf04040508cbd02507703162312d84423c9748439f173e0abf8639ef73dd41b4662530822611950873d6abcc439e873cd89386624c094174208f7098924239dc73b02097192df0cee048c812dd084b699608873a7890c439cb0813d422ac908e70fc958810161282504c4741311c04c46a11cda8d9a0d3033c8f040f981311884c45849e8407be4b7821cd692715556322ad034b0002315530473584940439a841022154b047346aa3c91b8cc43ce67f10db99973300e0cc205908e649cc7b98e0808023ca398c7314e61d534b44228a998203d208a98c239808a6221cbfb97e54b49748811cc239421cbe397a10a93c25de008e5d463f8872e6e5ca8068c72e2e5c1cb7b96b2187fc2396772cca8d86396404e2230fd840bee130fb9172103684207dd0696000063959544845581a5800128a8765390872ace54489a0c72962fe947c0c225695d48e0000120e5202394608e51023940727c230f384727807ac1a60cc3c211c9c0719101338231f9080a302393153f0230ed84 + +set_option maxRecDepth 200000 + +theorem chunk_0 : chunk5F 2000 20 118770620 0 3013 cs_0 = true := by + decide +kernel + +theorem chunk_1 : chunk5F 2000 118770620 352622588 3013 5804 cs_1 = true := by + decide +kernel + +theorem chunk_2 : chunk5F 2000 352622588 738011132 5804 8967 cs_2 = true := by + decide +kernel + +theorem chunk_3 : chunk5F 2000 738011132 1255747580 8967 11932 cs_3 = true := by + decide +kernel + +theorem chunk_4 : chunk5F 2000 1255747580 1840819004 11932 14687 cs_4 = true := by + decide +kernel + +theorem chunk_5 : chunk5F 2000 1840819004 2521008956 14687 17239 cs_5 = true := by + decide +kernel + +theorem chunk_6 : chunk5F 2000 2521008956 3200225276 17239 19603 cs_6 = true := by + decide +kernel + +theorem chunk_7 : chunk5F 2000 3200225276 4099485692 19603 22445 cs_7 = true := by + decide +kernel + +theorem chunk_8 : chunk5F 2000 4099485692 4983613436 22445 24876 cs_8 = true := by + decide +kernel + +theorem chunk_9 : chunk5F 2000 4983613436 5896667132 24876 27235 cs_9 = true := by + decide +kernel + +theorem chunk_10 : chunk5F 2000 5896667132 6946068476 27235 29830 cs_10 = true := by + decide +kernel + +theorem chunk_11 : chunk5F 2000 6946068476 8141878076 29830 32340 cs_11 = true := by + decide +kernel + +theorem chunk_12 : chunk5F 2000 8141878076 9373243388 32340 32340 cs_12 = true := by + decide +kernel + +theorem chunk_13 : chunk5F 2000 9373243388 10592086844 32340 32340 cs_13 = true := by + decide +kernel + +theorem chunk_14 : chunk5F 2000 10592086844 11774914556 32340 32340 cs_14 = true := by + decide +kernel + +theorem chunk_15 : chunk5F 2000 11774914556 13060918076 32340 32340 cs_15 = true := by + decide +kernel + +theorem chunk_16 : chunk5F 2000 13060918076 14697575228 32340 32340 cs_16 = true := by + decide +kernel + +theorem chunk_17 : chunk5F 2000 14697575228 16429504508 32340 32340 cs_17 = true := by + decide +kernel + +theorem chunk_18 : chunk5F 2000 16429504508 18083561468 32340 32340 cs_18 = true := by + decide +kernel + +theorem chunk_19 : chunk5F 2000 18083561468 19826144060 32340 32340 cs_19 = true := by + decide +kernel + +theorem chunk_20 : chunk5F 2000 19826144060 21373986812 32340 32340 cs_20 = true := by + decide +kernel + +theorem chunk_21 : chunk5F 2000 21373986812 22625668028 32340 32340 cs_21 = true := by + decide +kernel + +theorem chunk_22 : chunk5F 2000 22625668028 23831030588 32340 32340 cs_22 = true := by + decide +kernel + +theorem chunk_23 : chunk5F 2000 23831030588 25047323324 32340 32340 cs_23 = true := by + decide +kernel + +theorem chunk_24 : chunk5F 2000 25047323324 26725321532 32340 32340 cs_24 = true := by + decide +kernel + +theorem chunk_25 : chunk5F 2000 26725321532 29188607996 32340 32340 cs_25 = true := by + decide +kernel + +theorem chunk_26 : chunk5F 2000 29188607996 31665745916 32340 32340 cs_26 = true := by + decide +kernel + +theorem chunk_27 : chunk5F 2000 31665745916 34040107004 32340 32340 cs_27 = true := by + decide +kernel + +theorem chunk_28 : chunk5F 521 34040107004 34357641212 32340 32340 cs_28 = true := by + decide +kernel + +theorem chunks_reach : ReachesStar target_tm (Cn 20) (Cn 34357641212) := by + have c0 := chunk5F_spec 2000 20 118770620 0 3013 cs_0 TabV_zero chunk_0 + have c1 := chunk5F_spec 2000 118770620 352622588 3013 5804 cs_1 c0.1 chunk_1 + have c2 := chunk5F_spec 2000 352622588 738011132 5804 8967 cs_2 c1.1 chunk_2 + have c3 := chunk5F_spec 2000 738011132 1255747580 8967 11932 cs_3 c2.1 chunk_3 + have c4 := chunk5F_spec 2000 1255747580 1840819004 11932 14687 cs_4 c3.1 chunk_4 + have c5 := chunk5F_spec 2000 1840819004 2521008956 14687 17239 cs_5 c4.1 chunk_5 + have c6 := chunk5F_spec 2000 2521008956 3200225276 17239 19603 cs_6 c5.1 chunk_6 + have c7 := chunk5F_spec 2000 3200225276 4099485692 19603 22445 cs_7 c6.1 chunk_7 + have c8 := chunk5F_spec 2000 4099485692 4983613436 22445 24876 cs_8 c7.1 chunk_8 + have c9 := chunk5F_spec 2000 4983613436 5896667132 24876 27235 cs_9 c8.1 chunk_9 + have c10 := chunk5F_spec 2000 5896667132 6946068476 27235 29830 cs_10 c9.1 chunk_10 + have c11 := chunk5F_spec 2000 6946068476 8141878076 29830 32340 cs_11 c10.1 chunk_11 + have c12 := chunk5F_spec 2000 8141878076 9373243388 32340 32340 cs_12 c11.1 chunk_12 + have c13 := chunk5F_spec 2000 9373243388 10592086844 32340 32340 cs_13 c12.1 chunk_13 + have c14 := chunk5F_spec 2000 10592086844 11774914556 32340 32340 cs_14 c13.1 chunk_14 + have c15 := chunk5F_spec 2000 11774914556 13060918076 32340 32340 cs_15 c14.1 chunk_15 + have c16 := chunk5F_spec 2000 13060918076 14697575228 32340 32340 cs_16 c15.1 chunk_16 + have c17 := chunk5F_spec 2000 14697575228 16429504508 32340 32340 cs_17 c16.1 chunk_17 + have c18 := chunk5F_spec 2000 16429504508 18083561468 32340 32340 cs_18 c17.1 chunk_18 + have c19 := chunk5F_spec 2000 18083561468 19826144060 32340 32340 cs_19 c18.1 chunk_19 + have c20 := chunk5F_spec 2000 19826144060 21373986812 32340 32340 cs_20 c19.1 chunk_20 + have c21 := chunk5F_spec 2000 21373986812 22625668028 32340 32340 cs_21 c20.1 chunk_21 + have c22 := chunk5F_spec 2000 22625668028 23831030588 32340 32340 cs_22 c21.1 chunk_22 + have c23 := chunk5F_spec 2000 23831030588 25047323324 32340 32340 cs_23 c22.1 chunk_23 + have c24 := chunk5F_spec 2000 25047323324 26725321532 32340 32340 cs_24 c23.1 chunk_24 + have c25 := chunk5F_spec 2000 26725321532 29188607996 32340 32340 cs_25 c24.1 chunk_25 + have c26 := chunk5F_spec 2000 29188607996 31665745916 32340 32340 cs_26 c25.1 chunk_26 + have c27 := chunk5F_spec 2000 31665745916 34040107004 32340 32340 cs_27 c26.1 chunk_27 + have c28 := chunk5F_spec 521 34040107004 34357641212 32340 32340 cs_28 c27.1 chunk_28 + exact c0.2.trans (c1.2.trans (c2.2.trans (c3.2.trans (c4.2.trans (c5.2.trans (c6.2.trans (c7.2.trans (c8.2.trans (c9.2.trans (c10.2.trans (c11.2.trans (c12.2.trans (c13.2.trans (c14.2.trans (c15.2.trans (c16.2.trans (c17.2.trans (c18.2.trans (c19.2.trans (c20.2.trans (c21.2.trans (c22.2.trans (c23.2.trans (c24.2.trans (c25.2.trans (c26.2.trans (c27.2.trans (c28.2)))))))))))))))))))))))))))) + +theorem full_halt : HaltsFrom target_tm (init []) := by + have h1 : ReachesStar target_tm (init []) (Cn 20) := + init_step.trans (run_to_20_spec 50 initial phase_a_eq) + have h3 : HaltsFrom target_tm (Cn 34357641212) := + run_to_halt_spec 200 (normal 34357641212) phase_c_eq + exact HaltsFrom.of_reachesStar (h1.trans chunks_reach) h3 + +end +end Solution + +public section + +theorem is_halt : IsHalt target := (isHalt_iff_haltsFrom_init target_tm).mpr Solution.full_halt + +end + +end BusyBeaver.M_1RB0LE_0RC0RB_1LD0LD_1RA1LC_HHH1LF_1LA0LC diff --git a/BusyBeaver/BB6/Halt/M_1RB0LF_1RCHHH_1LD0RF_1RA0LE_0LD1LD_0RD0RB.lean b/BusyBeaver/BB6/Halt/M_1RB0LF_1RCHHH_1LD0RF_1RA0LE_0LD1LD_0RD0RB.lean new file mode 100644 index 00000000..6fd55a08 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB0LF_1RCHHH_1LD0RF_1RA0LE_0LD1LD_0RD0RB.lean @@ -0,0 +1,544 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0LF_1RCHHH_1LD0RF_1RA0LE_0LD1LD_0RD0RB + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LF_1RCHHH_1LD0RF_1RA0LE_0LD1LD_0RD0RB" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +set_option autoImplicit true +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + + +-- ============================================================================ +-- Section 6: Proof of Halting (IsHalt target_tm) +-- ============================================================================ +open Counter + +namespace Solution + +set_option maxRecDepth 200000 +set_option maxHeartbeats 2000000 + +@[simp] theorem init_nil : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = + ⟨some A, ⟨0, default, default⟩⟩ := rfl + +-- ============================================================================ +-- Section 6.2: Word Encoding (`LD`, `Lmp`, `RC`, `cfgL`, `cfgR`, `cfgC`) +-- ============================================================================ + +def encWord : LD → List (Fin 2) + | .W0 => [1, 0, 0] + | .W1 => [1, 1, 1] + +/-- Left tape encoding with the invariant MSB sentinel `[.W1, .W1]` (`[1, 1, 1, 1, 1, 1]`) built in. -/ +def Lmp (x : List LD) : ListBlank (Fin 2) := + encTape encWord ([1, 1, 1, 1, 1, 1] +> default) x + +@[simp] theorem Lmp_nil : Lmp [] = [1, 1, 1, 1, 1, 1] +> default := rfl + +theorem Lmp_cons (d : LD) (xs : List LD) : Lmp (d :: xs) = encWord d +> Lmp xs := + encTape_cons encWord ([1, 1, 1, 1, 1, 1] +> default) d xs + +@[simp] theorem Lmp_W0 (xs : List LD) : + Lmp (.W0 :: xs) = (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> Lmp xs := by + rw [Lmp_cons]; rfl + +@[simp] theorem Lmp_W1 (xs : List LD) : + Lmp (.W1 :: xs) = (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> Lmp xs := by + rw [Lmp_cons]; rfl + +@[simp] theorem Lmp_head (x : List LD) : (Lmp x).head = 1 := by + cases x with + | nil => rfl + | cons d xs => cases d <;> simp [Lmp_W0, Lmp_W1] + +@[simp] theorem Lmp_cons_tail (x : List LD) : + (1 : Fin 2) >> (Lmp x).tail = Lmp x := by + rw [← Lmp_head x, Turing.ListBlank.cons_head_tail] + +def RC (m : ℕ) : ListBlank (Fin 2) := + [1] +> ((([0, 1, 1] : List (Fin 2)) ^ m) +> ([0, 1] +> default)) + +def cfgL (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + l {{E}}> ([1, 0, 1, 0] +> r) + +def cfgR (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + l {{C}}> ([1, 1] +> r) + +def cfgC (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + l {{C}}> ([1] +> r) + +-- ============================================================================ +-- Section 6.3: Micro-Step Rules +-- ============================================================================ + +macro "step1" : tactic => `(tactic| ( + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, cfgL, cfgR, cfgC, RC, Lmp_W0, Lmp_W1, Lmp_nil, + Lmp_head, Lmp_cons_tail, + pow_succ_list, pow_zero_list, + List.singleton_append, List.nil_append, List.cons_append, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail] + refine multiStep_step (by rfl) ?_ + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Tape.write, + Lmp_head, Lmp_cons_tail, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail])) + +macro "run_steps" n:num : tactic => `(tactic| ( + iterate $n step1 + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, cfgL, cfgR, cfgC, RC, Lmp_W0, Lmp_W1, Lmp_nil, + Lmp_head, Lmp_cons_tail, + pow_succ_list, pow_zero_list, + List.singleton_append, List.nil_append, List.cons_append, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail, multiStep_zero] + rfl)) + +theorem LInc_w0_1 (xs : List LD) (r : ListBlank (Fin 2)) : + (cfgL (Lmp (.W0 :: xs)) ([1] +> r)) [target_tm]⊢^{19} + (cfgL (Lmp xs) ([1, 0, 1, 1] +> r)) := by + run_steps 19 + +theorem LInc_w10 (xs : List LD) (r : ListBlank (Fin 2)) : + (cfgL (Lmp (.W1 :: .W0 :: xs)) ([1] +> r)) [target_tm]⊢^{40} + (cfgR (Lmp (.W1 :: .W1 :: xs)) ([0, 1, 1] +> r)) := by + run_steps 40 + +theorem LInc_w11_1 (xs : List LD) (r : ListBlank (Fin 2)) : + (cfgL (Lmp (.W1 :: .W1 :: xs)) ([1] +> r)) [target_tm]⊢^{6} + (cfgL (Lmp xs) ([1, 0, 1, 0, 1, 0, 1] +> r)) := by + run_steps 6 + +theorem RInc_w0 (xs : List LD) (r : ListBlank (Fin 2)) : + (cfgR (Lmp xs) ([0, 1, 1] +> r)) [target_tm]⊢^{3} + (cfgR (Lmp (.W0 :: xs)) r) := by + run_steps 3 + +theorem RInc_w11 (xs' : List LD) (r : ListBlank (Fin 2)) : + (cfgR (Lmp xs') ([0, 1, 1, 0, 1, 0, 1, 0, 1] +> r)) [target_tm]⊢^{28} + (cfgR (Lmp (.W1 :: .W0 :: xs')) ([0, 1, 1] +> r)) := by + run_steps 28 + +theorem RC_turn_48 (x : List LD) : + (cfgR (Lmp x) ([0, 1] +> default)) [target_tm]⊢^{48} + (cfgL (Lmp x) (RC 1)) := by + run_steps 48 + +theorem lov_nil_48 (r : ListBlank (Fin 2)) : + (cfgL (Lmp []) ([1] +> r)) [target_tm]⊢^{48} + (cfgC (Lmp [.W0, .W0]) r) := by + run_steps 48 + +theorem lov_w0_7 (u : List LD) (r : ListBlank (Fin 2)) : + (cfgC (Lmp u) ([0, 1, 1] +> r)) [target_tm]⊢^{7} + (cfgC (Lmp (.W1 :: u)) r) := by + run_steps 7 + +theorem lov_w11_0_28 (x : List LD) (r : ListBlank (Fin 2)) : + (cfgC (Lmp (.W0 :: x)) ([0, 1, 0, 1, 0, 1] +> r)) [target_tm]⊢^{28} + (cfgC (Lmp (.W0 :: .W0 :: .W1 :: x)) r) := by + run_steps 28 + +theorem lov_w11_1_start (z : List LD) (r : ListBlank (Fin 2)) : + (cfgC (Lmp (.W1 :: z)) ([0, 1, 0, 1, 0, 1] +> r)) [target_tm]⊢^{13} + (cfgL (Lmp z) ([1, 0, 1, 1, 0, 1] +> r)) := by + run_steps 13 + +theorem lov_w11_1_end (z' : List LD) (r : ListBlank (Fin 2)) : + (cfgR (Lmp z') ([0, 1, 1, 0, 1, 1, 0, 1] +> r)) [target_tm]⊢^{9} + (cfgC (Lmp (.W0 :: .W0 :: .W0 :: z')) r) := by + run_steps 9 + +theorem lov_finish_13 (y : List LD) : + (cfgC (Lmp (.W1 :: y)) ([0, 1] +> default)) [target_tm]⊢^{13} + (cfgL (Lmp y) (RC 0)) := by + run_steps 13 + +-- ============================================================================ +-- Section 6.4: Carry Invariant (`LInc_RC`, `round_step`) +-- ============================================================================ + +theorem LInc_step {x x' : List LD} (h : LInc x x') : + ∀ (r : ListBlank (Fin 2)), + (cfgL (Lmp x) ([1] +> r)) [target_tm]⊢* (cfgR (Lmp x') ([0, 1, 1] +> r)) := by + induction h with + | @w0 xs xs' _ ih => + intro r + exact stepStar_trans ⟨19, LInc_w0_1 xs r⟩ + (stepStar_trans (ih ([0, 1, 1] +> r)) ⟨3, RInc_w0 xs' ([0, 1, 1] +> r)⟩) + | w10 xs => + intro r; exact ⟨40, LInc_w10 xs r⟩ + | @w11 xs xs' _ ih => + intro r + exact stepStar_trans ⟨6, LInc_w11_1 xs r⟩ + (stepStar_trans (ih ([0, 1, 0, 1, 0, 1] +> r)) ⟨28, RInc_w11 xs' r⟩) + +theorem RC_return : ∀ (m : ℕ) (x : List LD), + (cfgR (Lmp x) ((([0, 1, 1] : List (Fin 2)) ^ m) +> ([0, 1] +> default))) + [target_tm]⊢* (cfgL (Lmp x) (RC (m + 1))) + | 0, x => ⟨48, RC_turn_48 x⟩ + | m + 1, x => by + rw [pow_succ_list, listblank_append_assoc] + exact stepStar_trans ⟨3, RInc_w0 x ((([0, 1, 1] : List (Fin 2)) ^ m) +> ([0, 1] +> default))⟩ + (stepStar_trans (RC_return m (.W0 :: x)) + ⟨19, LInc_w0_1 x ((([0, 1, 1] : List (Fin 2)) ^ (m + 1)) +> ([0, 1] +> default))⟩) + +theorem LInc_RC {x x' : List LD} (h : LInc x x') (m : ℕ) : + (cfgL (Lmp x) (RC m)) [target_tm]⊢* (cfgL (Lmp x') (RC (m + 2))) := by + refine stepStar_trans (LInc_step h ((([0, 1, 1] : List (Fin 2)) ^ m) +> ([0, 1] +> default))) ?_ + exact RC_return (m + 1) x' + +theorem LIncs_RC {n : ℕ} {x x' : List LD} (h : LIncs n x x') : + ∀ (m : ℕ), (cfgL (Lmp x) (RC m)) [target_tm]⊢* (cfgL (Lmp x') (RC (m + 2 * n))) := by + induction h with + | zero x => + intro m; rw [Nat.mul_zero, Nat.add_zero]; try exact stepStar_refl _ _ + | @succ n x y z h1 _ ih => + intro m + have heq : m + 2 * (n + 1) = (m + 2) + 2 * n := by omega + rw [heq] + exact stepStar_trans (LInc_RC h1 m) (ih (m + 2)) + +theorem LIncsP_pow9_bound {n : ℕ} {xs xs' : List LD} (h : LIncsP n xs xs') : + LIncsP (512 * n + 511) + ((([.W1, .W0] : List LD) ^ 9) ++ xs) + ((([.W1, .W1] : List LD) ^ 9) ++ xs') := by + have h1 := LIncsP.w10 h + have h2 := LIncsP.w10 h1 + have h3 := LIncsP.w10 h2 + have h4 := LIncsP.w10 h3 + have h5 := LIncsP.w10 h4 + have h6 := LIncsP.w10 h5 + have h7 := LIncsP.w10 h6 + have h8 := LIncsP.w10 h7 + have h9 := LIncsP.w10 h8 + have heq : 2 * (2 * (2 * (2 * (2 * (2 * (2 * (2 * (2 * n + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1 = + 512 * n + 511 := by omega + rwa [heq] at h9 + +theorem LOv2_correct_aux {w u y : List LD} (h : LOv2 w u y) (hu : u = [.W0, .W0]) : + ∀ (r : ListBlank (Fin 2)), + (cfgL (Lmp w) ([1] +> r)) [target_tm]⊢* (cfgC (Lmp y) r) := by + induction h with + | nil => + subst hu; intro r; exact ⟨48, lov_nil_48 r⟩ + | @w0 xs _ u' _ ih => + intro r + exact stepStar_trans ⟨19, LInc_w0_1 xs r⟩ + (stepStar_trans (ih hu ([0, 1, 1] +> r)) ⟨7, lov_w0_7 u' r⟩) + | @w11_0 xs _ x _ ih => + intro r + exact stepStar_trans ⟨6, LInc_w11_1 xs r⟩ + (stepStar_trans (ih hu ([0, 1, 0, 1, 0, 1] +> r)) ⟨28, lov_w11_0_28 x r⟩) + | @w11_1 xs _ z z' _ hz ih => + intro r + exact stepStar_trans ⟨6, LInc_w11_1 xs r⟩ + (stepStar_trans (ih hu ([0, 1, 0, 1, 0, 1] +> r)) + (stepStar_trans ⟨13, lov_w11_1_start z r⟩ + (stepStar_trans (LInc_step hz ([0, 1, 1, 0, 1] +> r)) + ⟨9, lov_w11_1_end z' r⟩))) + +theorem LOv2_correct {w y : List LD} (h : LOv2 w [.W0, .W0] y) : + ∀ (r : ListBlank (Fin 2)), + (cfgL (Lmp w) ([1] +> r)) [target_tm]⊢* (cfgC (Lmp y) r) := + LOv2_correct_aux h rfl + +theorem lov_w0_iter : ∀ (m : ℕ) (y : List LD) (r : ListBlank (Fin 2)), + (cfgC (Lmp y) ((([0, 1, 1] : List (Fin 2)) ^ m) +> r)) + [target_tm]⊢* + (cfgC (Lmp ((([.W1] : List LD) ^ m) ++ y)) r) + | 0, y, r => stepStar_refl _ _ + | m + 1, y, r => by + rw [pow_succ_right, listblank_append_assoc] + refine stepStar_trans (lov_w0_iter m y ([0, 1, 1] +> r)) ?_ + have h7 := lov_w0_7 ((([.W1] : List LD) ^ m) ++ y) r + rw [pow_succ_list, List.singleton_append, List.cons_append] + exact ⟨7, h7⟩ + +theorem full_overflow_step {w y : List LD} (m : ℕ) (h : LOv2 w [.W0, .W0] y) : + (cfgL (Lmp w) (RC (m + 1))) [target_tm]⊢* + (cfgL (Lmp ((([.W1] : List LD) ^ m) ++ y)) (RC 0)) := by + refine stepStar_trans (LOv2_correct h ((([0, 1, 1] : List (Fin 2)) ^ (m + 1)) +> ([0, 1] +> default))) ?_ + refine stepStar_trans (lov_w0_iter (m + 1) y ([0, 1] +> default)) ?_ + rw [pow_succ_list, List.singleton_append, List.cons_append] + exact ⟨13, lov_finish_13 ((([.W1] : List LD) ^ m) ++ y)⟩ + +theorem round_step {X X' Y Z : List LD} (m : ℕ) + (h1 : LIncsP m X X') + (h2 : LOv2 X' [.W0, .W0] Y) + (h3 : LInc ((([.W1] : List LD) ^ (2 * m + 1)) ++ Y) Z) : + (cfgL (Lmp X) (RC 2)) [target_tm]⊢* (cfgL (Lmp Z) (RC 2)) := by + have h_incs := LIncs_RC (LIncsP_to_LIncs h1) 2 + have heq : 2 + 2 * m = (2 * m + 1) + 1 := by omega + rw [heq] at h_incs + exact stepStar_trans h_incs + (stepStar_trans (full_overflow_step (2 * m + 1) h2) (LInc_RC h3 0)) + +-- ============================================================================ +-- Section 6.5: Initial Bootstrap (`init` -> `x2` -> `x3`) +-- ============================================================================ + +def ux2 : List LD := + [.W1, .W1, .W0, .W1, .W0, .W0, .W1, .W1, .W0, .W0, .W0, .W0, .W1, .W1] + +def x2 : List LD := (([.W1, .W0] : List LD) ^ 9) ++ ux2 + +def u0_tail : List LD := + [.W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, + .W0, .W0, .W0, .W0, .W0, .W0, .W0, .W0, .W1, .W0, .W1, .W0, .W0, .W1, .W1] + +def u0 : List LD := .W1 :: .W1 :: u0_tail + +def c_init_104 : CCfg (Fin 2) (Fin 6) := ⟨A, 0, [], ([0] : List (Fin 2)) ^ 104⟩ + +def c_x2 : CCfg (Fin 2) (Fin 6) := + ⟨E, 1, + [1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, + 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, + 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1]⟩ + +def cmultiStepChunk : ℕ → ℕ → CCfg (Fin 2) (Fin 6) → Option (CCfg (Fin 2) (Fin 6)) + | 0, _, c => some c + | k + 1, m, c => (cmultiStep target_tm m c).bind (cmultiStepChunk k m) + +theorem cmultiStepChunk_sound : ∀ (k m : ℕ) (c c' : CCfg (Fin 2) (Fin 6)) (r_tail : ListBlank (Fin 2)), + cmultiStepChunk k m c = some c' → (evalCCfg r_tail c) [target_tm]⊢^{m * k} (evalCCfg r_tail c') + | 0, m, c, c', _, h => by + injection h with h'; subst h'; simp + | k + 1, m, c, c', r_tail, h => by + simp only [cmultiStepChunk, Option.bind_eq_some_iff] at h + rcases h with ⟨c₁, h₁, h₂⟩ + rw [Nat.mul_succ, Nat.add_comm] + exact multiStep_trans + (cmultiStep_sound m c c₁ r_tail h₁) + (cmultiStepChunk_sound k m c₁ c' r_tail h₂) + +theorem init_to_x2 : (init []) [target_tm]⊢* (cfgL (Lmp x2) (RC 2)) := by + have h_eq1 : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = evalCCfg default c_init_104 := by + rw [init_nil] + simp [evalCCfg, evalWindow, c_init_104, zeros_append_default] + have h_eq2 : evalCCfg default c_x2 = cfgL (Lmp x2) (RC 2) := rfl + have h_steps : cmultiStepChunk 6 901 c_init_104 = some c_x2 := by decide + rw [h_eq1, ← h_eq2] + exact ⟨901 * 6, cmultiStepChunk_sound 6 901 c_init_104 c_x2 default h_steps⟩ + +theorem x2_to_x3 : + ∃ m3 ≥ 511, + (cfgL (Lmp x2) (RC 2)) [target_tm]⊢* + (cfgL (Lmp ((([.W1, .W0] : List LD) ^ m3) ++ u0)) (RC 2)) := by + let ux2' := (lincspFinite ux2).getD [] + have h_ux2 : LIncsP (lincspCount ux2) ux2 ux2' := + lincspFinite_sound (by decide : lincspFinite ux2 = some ux2') + have h_9 : LIncsP (512 * lincspCount ux2 + 511) x2 ((([.W1, .W1] : List LD) ^ 9) ++ ux2') := + LIncsP_pow9_bound h_ux2 + let x2' := ((([.W1, .W1] : List LD) ^ 9) ++ ux2') + have h_ov : LOv2 x2' [.W0, .W0] (.W0 :: u0_tail) := + lov2Finite_sound (by decide : lov2Finite x2' [.W0, .W0] = some (.W0 :: u0_tail)) + let m3 := 512 * lincspCount ux2 + 511 + refine ⟨m3, by omega, ?_⟩ + have h_inc : LInc ((([.W1] : List LD) ^ (2 * m3 + 1)) ++ (.W0 :: u0_tail)) + ((([.W1, .W0] : List LD) ^ m3) ++ u0) := by + rw [pow_W1_odd m3 (.W0 :: u0_tail)] + exact LInc_pow_11_10 m3 u0_tail + exact round_step m3 h_9 h_ov h_inc + +-- ============================================================================ +-- Section 6.6: Buffer Shielding (`isBuffer_8_B1`, `chain_round_step`, `runU_steps`) +-- ============================================================================ + +theorem isBuffer_8_B1 : IsBuffer 8 [.W1, .W1, .W0] := by decide + +theorem LInc_round_tail (m : ℕ) (s : List LD) : + LInc ((([.W1] : List LD) ^ (2 * m + 1)) ++ + ([.W0, .W0, .W1, .W0] ++ ((([.W1, .W0] : List LD) ^ 10) ++ s))) + ((([.W1, .W0] : List LD) ^ m) ++ + ([.W1, .W1, .W0] ++ ((([.W1, .W0] : List LD) ^ 11) ++ s))) := by + rw [pow_W1_odd] + exact LInc_pow_11_10 m ([.W0, .W1, .W0] ++ ((([.W1, .W0] : List LD) ^ 10) ++ s)) + +theorem chain_round_step_aux {r m : ℕ} (hr : r ≤ 8) (hm : m ≥ 26) + {T T₀' u u' W' : List LD} + (h_10 : LIncsP m ((([.W1, .W0] : List LD) ^ 10) ++ (T ++ u)) ((([.W1, .W1] : List LD) ^ 10) ++ W')) + (h_ov : LOv2 W' [.W0, .W0] ([.W0, .W0, .W1, .W0] ++ (T₀' ++ u'))) + (h_ct0 : ChainTail r T₀') : + ∃ T', ChainTail r T' ∧ + ((cfgL (Lmp ((([.W1, .W0] : List LD) ^ 10) ++ (T ++ u))) (RC 2)) + [target_tm]⊢* + (cfgL (Lmp ((([.W1, .W0] : List LD) ^ 10) ++ (T' ++ u'))) (RC 2))) := by + have h_ov10 : LOv2 ((([.W1, .W1] : List LD) ^ 10) ++ W') [.W0, .W0] + ([.W0, .W0, .W1, .W0] ++ ((([.W1, .W0] : List LD) ^ 10) ++ (T₀' ++ u'))) := + LOv2_append (LOv2_pow_11 10 (T₀' ++ u')) h_ov + let B1 : List LD := [.W1, .W1, .W0] + let tail_rest := ((([.W1, .W0] : List LD) ^ 11) ++ (T₀' ++ u')) + have h_inc : LInc ((([.W1] : List LD) ^ (2 * m + 1)) ++ + ([.W0, .W0, .W1, .W0] ++ ((([.W1, .W0] : List LD) ^ 10) ++ (T₀' ++ u')))) + ((([.W1, .W0] : List LD) ^ m) ++ (B1 ++ tail_rest)) := + LInc_round_tail m (T₀' ++ u') + have h_step := round_step m h_10 h_ov10 h_inc + have hm_split : m = 10 + ((m - 10 - 2 * r) + 2 * r) := by omega + let T' := ((([.W1, .W0] : List LD) ^ (m - 10 - 2 * r)) ++ + ((([.W1, .W0] : List LD) ^ (2 * r)) ++ (B1 ++ ((([.W1, .W0] : List LD) ^ 11) ++ T₀')))) + have hB1 : IsBuffer r B1 := isBuffer_le hr isBuffer_8_B1 + have h_ct_T' : ChainTail r T' := + ChainTail_pow_pair (m - 10 - 2 * r) (.buf hB1 (ChainTail_pow_pair 11 h_ct0)) + have h_eq : ((([.W1, .W0] : List LD) ^ m) ++ (B1 ++ tail_rest)) = + ((([.W1, .W0] : List LD) ^ 10) ++ (T' ++ u')) := by + conv_lhs => rw [hm_split, list_pow_add, list_pow_add] + simp only [T', tail_rest, List.append_assoc] + rw [h_eq] at h_step + exact ⟨T', h_ct_T', h_step⟩ + +theorem chain_round_step {r : ℕ} (hr : r ≤ 8) {T : List LD} (hT : ChainTail (r + 1) T) + {u u' : List LD} (hu : macroStepFinite u = some u') : + ∃ T', ChainTail r T' ∧ + ((cfgL (Lmp ((([.W1, .W0] : List LD) ^ 10) ++ (T ++ u))) (RC 2)) + [target_tm]⊢* + (cfgL (Lmp ((([.W1, .W0] : List LD) ^ 10) ++ (T' ++ u'))) (RC 2))) := by + rcases ChainTail_step hT hu with ⟨n, W', T₀', h_lp, h_ov, h_ct0⟩ + exact chain_round_step_aux hr (by omega) (LIncsP_pow10_bound h_lp) h_ov h_ct0 + +theorem runU_steps : ∀ (k : ℕ) (r : ℕ), r + k ≤ 8 → + ∀ {T u u' : List LD}, + ChainTail (r + k) T → + runU k u = some u' → + ∃ T', ChainTail r T' ∧ + ((cfgL (Lmp ((([.W1, .W0] : List LD) ^ 10) ++ (T ++ u))) (RC 2)) + [target_tm]⊢* + (cfgL (Lmp ((([.W1, .W0] : List LD) ^ 10) ++ (T' ++ u'))) (RC 2))) + | 0, r, _, T, u, _, hT, hu => by + injection hu with hu'; subst hu' + exact ⟨T, hT, stepStar_refl _ _⟩ + | k + 1, r, hrk, T, u, u', hT, hu => by + simp only [runU, Option.bind_eq_some_iff] at hu + rcases hu with ⟨u₁, hu₁, hu₂⟩ + have h_eq : r + (k + 1) = (r + k) + 1 := by omega + rw [h_eq] at hT + rcases chain_round_step (by omega : r + k ≤ 8) hT hu₁ with ⟨T₁, hT₁, h_step1⟩ + rcases runU_steps k r (by omega) hT₁ hu₂ with ⟨T', hT', h_step2⟩ + exact ⟨T', hT', stepStar_trans h_step1 h_step2⟩ + +-- ============================================================================ +-- Section 6.7: `Only011` Prefix Sweep & 896-Step Halt from `msb_13` +-- ============================================================================ + +theorem Only011_skip {P : List LD} (hP : Only011 P) (s : List LD) : + ∀ (r : ListBlank (Fin 2)), + ∃ r', (cfgL (Lmp (P ++ s)) ([1] +> r)) [target_tm]⊢* (cfgL (Lmp s) ([1] +> r')) := by + induction hP with + | nil => + intro r; exact ⟨r, stepStar_refl _ _⟩ + | @w0 xs _ ih => + intro r + rcases ih ([0, 1, 1] +> r) with ⟨r', hr'⟩ + exact ⟨r', stepStar_trans ⟨19, LInc_w0_1 (xs ++ s) r⟩ hr'⟩ + | @w11 xs _ ih => + intro r + rcases ih ([0, 1, 0, 1, 0, 1] +> r) with ⟨r', hr'⟩ + exact ⟨r', stepStar_trans ⟨6, LInc_w11_1 (xs ++ s) r⟩ hr'⟩ + +def msb_13 : List LD := + [.W0, .W1, .W1, .W1, .W1, .W0, .W0, .W0, .W1, .W1, .W0, .W1, .W1] + +def u8 : List LD := (runU 8 u0).getD [] + +def u8_pre' : List LD := ((lincspFinite u8).getD []).take 38 + +theorem runU_8_eq : runU 8 u0 = some u8 := by decide + +theorem u8_lincsp_eq : lincspFinite u8 = some (u8_pre' ++ msb_13) := by decide + +theorem u8_pre'_only011 : checkOnly011 u8_pre' = true := by decide + +def c_msb_start : CCfg (Fin 2) (Fin 6) := + ⟨E, 1, encWords encWord msb_13 ++ [1, 1, 1, 1, 1, 1], [0, 1, 0, 1]⟩ + +def c_msb_halt : CCfg (Fin 2) (Fin 6) := (cmultiStep target_tm 896 c_msb_start).getD c_msb_start + +theorem msb_13_halt (r : ListBlank (Fin 2)) : + ∃ cfg, ((cfgL (Lmp msb_13) ([1] +> r)) [target_tm]⊢* cfg) ∧ + (step target_tm cfg).isNone := by + have h_start : cfgL (Lmp msb_13) ([1] +> r) = evalCCfg r c_msb_start := by + simp [cfgL, Lmp, encTape, c_msb_start, evalCCfg, evalWindow, listblank_append_assoc] + have h_896 : cmultiStep target_tm 896 c_msb_start = some c_msb_halt := by decide + have h_q : c_msb_halt.q = B := by decide + have h_cur : c_msb_halt.cur = 1 := by decide + refine ⟨evalCCfg r c_msb_halt, ?_, ?_⟩ + · rw [h_start] + exact ⟨896, cmultiStep_sound 896 c_msb_start c_msb_halt r h_896⟩ + · simp [step, evalCCfg, evalWindow, h_q, h_cur, B, target_tm]; rfl + +-- ============================================================================ +-- Section 6.9: Top-Level Halting Theorem (`proved_is_halt`) +-- ============================================================================ + +theorem sol_is_halt (_ : True) : IsHalt target_tm := by + rcases x2_to_x3 with ⟨m3, hm3, h23⟩ + have h_init_x3 := stepStar_trans init_to_x2 h23 + have hm3_split : m3 = 10 + ((m3 - 26) + 2 * 8) := by omega + let T0 := ((([.W1, .W0] : List LD) ^ (m3 - 26)) ++ (([.W1, .W0] : List LD) ^ (2 * 8))) + have h_T0 : ChainTail (0 + 8) T0 := + ChainTail_pow_pair (m3 - 26) .nil + have h_x3_eq : ((([.W1, .W0] : List LD) ^ m3) ++ u0) = + ((([.W1, .W0] : List LD) ^ 10) ++ (T0 ++ u0)) := by + conv_lhs => rw [hm3_split, list_pow_add, list_pow_add] + simp only [T0, List.append_assoc] + rw [h_x3_eq] at h_init_x3 + rcases runU_steps 8 0 (by omega) h_T0 runU_8_eq with ⟨T8, h_T8, h_rounds⟩ + have h_to_8 := stepStar_trans h_init_x3 h_rounds + rcases ChainTail_zero_lincsp h_T8 with ⟨nT, T8', h_lpT⟩ + have h_lpU := lincspFinite_sound u8_lincsp_eq + rcases LIncsP_append h_lpT h_lpU with ⟨nTU, h_lpTU⟩ + rcases LIncsP_pow_10 10 h_lpTU with ⟨nAll, h_lpAll⟩ + have h_incs_final := LIncs_RC (LIncsP_to_LIncs h_lpAll) 2 + have h_to_inc := stepStar_trans h_to_8 h_incs_final + have h_10T_only : Only011 ((([.W1, .W1] : List LD) ^ 10) ++ T8') := by + rcases LIncsP_pow_10 10 h_lpT with ⟨_, h10T⟩ + exact LIncsP_only011 h10T + let P_all := ((([.W1, .W1] : List LD) ^ 10) ++ T8') ++ u8_pre' + have h_P_only : Only011 P_all := + Only011_append h_10T_only (checkOnly011_sound u8_pre'_only011) + have h_assoc : ((([.W1, .W1] : List LD) ^ 10) ++ (T8' ++ (u8_pre' ++ msb_13))) = + P_all ++ msb_13 := by + simp only [P_all, List.append_assoc] + rw [h_assoc] at h_to_inc + rcases Only011_skip h_P_only msb_13 + ((([0, 1, 1] : List (Fin 2)) ^ (2 + 2 * nAll)) +> ([0, 1] +> default)) with ⟨r', h_skip⟩ + have h_to_msb := stepStar_trans h_to_inc h_skip + rcases msb_13_halt r' with ⟨cfg_halt, h_halt_steps, h_is_none⟩ + exact ⟨cfg_halt, stepStar_trans h_to_msb h_halt_steps, h_is_none⟩ + +end Solution + +/-- +Halting theorem for Suspect 158 (Holdout #707): +The machine halts when started on the blank tape. +-/ +theorem is_halt : IsHalt target := (Solution.sol_is_halt True.intro) + +end BusyBeaver.M_1RB0LF_1RCHHH_1LD0RF_1RA0LE_0LD1LD_0RD0RB diff --git a/BusyBeaver/BB6/Halt/M_1RB0RA_1LC0RE_1LD0LC_1RA1LE_1LC0LF_0RAHHH.lean b/BusyBeaver/BB6/Halt/M_1RB0RA_1LC0RE_1LD0LC_1RA1LE_1LC0LF_0RAHHH.lean new file mode 100644 index 00000000..1e417361 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB0RA_1LC0RE_1LD0LC_1RA1LE_1LC0LF_0RAHHH.lean @@ -0,0 +1,3798 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RA_1LC0RE_1LD0LC_1RA1LE_1LC0LF_0RAHHH + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0RE_1LD0LC_1RA1LE_1LC0LF_0RAHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 800000 +variable {α β γ : Type*} [Inhabited α] [Inhabited β] [Inhabited γ] + +namespace Solution +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 800000 + +set_option autoImplicit true +set_option maxRecDepth 2000000 +set_option maxHeartbeats 800000 + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +local notation "zB" => ListBlank (Fin 2) +local notation "zF" => List (Fin 2) +set_option maxHeartbeats 800000 + +def tm15 : Machine (Fin 2) (Fin 6) + | 0, 0 => some (some 1, Stmt.write 1 Dir.left) + | 0, 1 => some (some 4, Stmt.write 1 Dir.right) + | 1, 0 => some (some 2, Stmt.write 1 Dir.left) + | 1, 1 => some (some 1, Stmt.write 0 Dir.left) + | 2, 0 => some (some 3, Stmt.write 1 Dir.right) + | 2, 1 => some (some 4, Stmt.write 0 Dir.left) + | 3, 0 => some (some 0, Stmt.write 1 Dir.right) + | 3, 1 => some (some 3, Stmt.write 0 Dir.right) + | 4, 0 => some (some 3, Stmt.write 1 Dir.right) + | 4, 1 => some (some 5, Stmt.write 0 Dir.right) + | 5, 0 => some (some 1, Stmt.write 0 Dir.left) + | 5, 1 => none + +def perm_0365 : Fin 6 → Fin 6 + | 0 => 3 + | 1 => 0 + | 2 => 1 + | 3 => 2 + | 4 => 4 + | 5 => 5 + +def map_cfg_0365 (c : Cfg (Fin 2) (Fin 6)) : Cfg (Fin 2) (Fin 6) := + ⟨c.q.map perm_0365, ⟨c.tape.1, c.tape.right, c.tape.left⟩⟩ + +theorem step_map_0365 (c : Cfg (Fin 2) (Fin 6)) : + step target_tm (map_cfg_0365 c) = (step tm15 c).map map_cfg_0365 := by + rcases c with ⟨_ | ⟨_ | _ | _ | _ | _ | _ | q, hq⟩, ⟨⟨_ | _ | h, hh⟩, l, r⟩⟩ <;> try rfl + all_goals omega + +@[simp] theorem zMz (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +theorem multiStep_map_0365 (c : Cfg (Fin 2) (Fin 6)) (n : Nat) : + multiStep target_tm (map_cfg_0365 c) n = (multiStep tm15 c n).map map_cfg_0365 := by + induction n with + | zero => rfl + | succ n ih => + rw [zMs, zMs, ih] + cases multiStep tm15 c n with + | none => rfl + | some c' => exact step_map_0365 c' + +@[simp] theorem z0i : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : zB).head = 0 := rfl +@[simp] theorem zDt : (default : zB).tail = default := rfl +@[simp] theorem append_nil (s : zB) : ([] : zF) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : zF) (s : zB) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l₁ l₂ : zF) (s : zB) : + (l₁ ++ l₂) +> s = l₁ +> (l₂ +> s) := by + induction l₁ with + | nil => rfl + | cons a l₁ ih => simp [ih] +set_option linter.unusedSectionVars false +@[simp] theorem zPz (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem z0j (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +theorem z0k (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp [Nat.zero_add] + | succ m ih => simp [z0j, Nat.succ_add, ih, List.append_assoc] +theorem z0l (l : List α) (n : Nat) : l ^ n ++ l = l ^ (n + 1) := by + induction n with + | zero => simp [z0j] + | succ n ih => simp [z0j, List.append_assoc, ih] +def z0o (d0 d1 : zF) : Nat → Nat → zB → zB + | 0, _, r => r + | len + 1, n, r => (if n % 2 = 0 then d1 else d0) +> z0o d0 d1 len (n / 2) r + +def MC : Nat → Nat → zB → zB + | 0, n, r => (if n % 2 = 0 then [1] else [0]) +> r + | h + 1, n, r => (if n % 2 = 0 then [1, 0, 0] else [0, 0, 0]) +> MC h (n / 2) r + +theorem z0s (d0 d1 : zF) (len n : Nat) (r : zB) : + z0o d0 d1 (len + 1) (n * 2) r = d1 +> z0o d0 d1 len n r := by + simp only [z0o] + have h1 : (n * 2) % 2 = 0 := by omega + have h2 : (n * 2) / 2 = n := by omega + simp [h1, h2] +theorem z0t (d0 d1 : zF) (len n : Nat) (r : zB) : + z0o d0 d1 (len + 1) (n * 2 + 1) r = d0 +> z0o d0 d1 len n r := by + simp only [z0o] + have h1 : (n * 2 + 1) % 2 = 1 := by omega + have h2 : (n * 2 + 1) / 2 = n := by omega + simp [h1, h2] +theorem z0u (d0 d1 : zF) (len : Nat) (r : zB) : + z0o d0 d1 len 0 r = (d1 ^ len) +> r := by + induction len with + | zero => rfl + | succ len ih => + have h := z0s d0 d1 len 0 r + simp only [Nat.zero_mul] at h + rw [h, ih, z0j, append_assoc] +theorem z0v (n : Nat) : 0 < 2 ^ n := Nat.two_pow_pos n +theorem z0w (d0 d1 : zF) (len : Nat) (r : zB) : + z0o d0 d1 len (2 ^ len - 1) r = (d0 ^ len) +> r := by + induction len with + | zero => rfl + | succ len ih => + have hp := z0v len + have h1 : 2 ^ (len + 1) - 1 = (2 ^ len - 1) * 2 + 1 := by + rw [Nat.pow_succ]; omega + rw [h1, z0t, ih, z0j, append_assoc] +theorem z0x (d0 d1 : zF) (len n i : Nat) (r : zB) : + z0o d0 d1 (len + i) (n * 2 ^ i) r = (d1 ^ i) +> z0o d0 d1 len n r := by + induction i with + | zero => simp + | succ i ih => + have h1 : len + (i + 1) = (len + i) + 1 := by omega + have h2 : n * 2 ^ (i + 1) = (n * 2 ^ i) * 2 := by rw [Nat.pow_succ, ← Nat.mul_assoc] + rw [h1, h2, z0s, ih, z0j, append_assoc] +theorem z0y' (d0 d1 : zF) (len n i : Nat) (r : zB) : + z0o d0 d1 (len + i) ((n + 1) * 2 ^ i - 1) r = + (d0 ^ i) +> z0o d0 d1 len n r := by + induction i with + | zero => + have h1 : (n + 1) * 2 ^ 0 - 1 = n := by omega + simp [h1] + | succ i ih => + have hp := z0v i + have hpos : 1 ≤ (n + 1) * 2 ^ i := Nat.mul_pos (by omega) hp + have h1 : len + (i + 1) = (len + i) + 1 := by omega + have h2 : (n + 1) * 2 ^ (i + 1) - 1 = ((n + 1) * 2 ^ i - 1) * 2 + 1 := by + rw [Nat.pow_succ, ← Nat.mul_assoc]; omega + rw [h1, h2, z0t, ih, z0j, append_assoc] + +abbrev ld0 : zF := [0, 1, 1, 1] +abbrev ld1 : zF := [1, 1, 1, 1] +abbrev rd0 : zF := [0, 0, 0] +abbrev rd1 : zF := [1, 0, 0] + +theorem MC_s (h n : Nat) (r : zB) : + MC (h + 1) (n * 2) r = rd1 +> MC h n r := by + simp only [MC, rd1] + have h1 : (n * 2) % 2 = 0 := by omega + have h2 : (n * 2) / 2 = n := by omega + simp [h1, h2] +theorem MC_t (h n : Nat) (r : zB) : + MC (h + 1) (n * 2 + 1) r = rd0 +> MC h n r := by + simp only [MC, rd0] + have h1 : (n * 2 + 1) % 2 = 1 := by omega + have h2 : (n * 2 + 1) / 2 = n := by omega + simp [h1, h2] +theorem MC_lsb_0 (h n i : Nat) (r : zB) : + MC (h + i) (n * 2 ^ i) r = (rd1 ^ i) +> MC h n r := by + induction i with + | zero => simp + | succ i ih => + have h1 : h + (i + 1) = (h + i) + 1 := by omega + have h2 : n * 2 ^ (i + 1) = (n * 2 ^ i) * 2 := by rw [Nat.pow_succ, ← Nat.mul_assoc] + rw [h1, h2, MC_s, ih, z0j, append_assoc] +theorem MC_lsb_1 (h n i : Nat) (r : zB) : + MC (h + i) ((n + 1) * 2 ^ i - 1) r = (rd0 ^ i) +> MC h n r := by + induction i with + | zero => + have h1 : (n + 1) * 2 ^ 0 - 1 = n := by omega + simp [h1] + | succ i ih => + have hp := z0v i + have hpos : 1 ≤ (n + 1) * 2 ^ i := Nat.mul_pos (by omega) hp + have h1 : h + (i + 1) = (h + i) + 1 := by omega + have h2 : (n + 1) * 2 ^ (i + 1) - 1 = ((n + 1) * 2 ^ i - 1) * 2 + 1 := by + rw [Nat.pow_succ, ← Nat.mul_assoc]; omega + rw [h1, h2, MC_t, ih, z0j, append_assoc] +theorem MC_base_0 (h : Nat) (r : zB) : + MC h 0 r = (rd1 ^ h) +> [1] +> r := by + have := MC_lsb_0 0 0 h r + simp only [Nat.zero_add, Nat.zero_mul] at this + rw [this]; rfl +theorem MC_base_1 (h : Nat) (r : zB) : + MC h (2 ^ (h + 1) - 1) r = (rd0 ^ h) +> [0] +> r := by + have hp := z0v h + have h1 : 2 ^ (h + 1) - 1 = (1 + 1) * 2 ^ h - 1 := by rw [Nat.pow_succ]; omega + rw [h1] + have := MC_lsb_1 0 1 h r + simp only [Nat.zero_add] at this + rw [this]; rfl + +theorem z0M (d0 d1 : zF) (len n : Nat) (r : zB) + (h : 1 + n < 2 ^ len) : + ∃ (i : Nat) (s : zB), + z0o d0 d1 len (1 + n) r = (d1 ^ i) +> d0 +> s ∧ + z0o d0 d1 len n r = (d0 ^ i) +> d1 +> s := by + induction len generalizing n with + | zero => simp at h + | succ len ih => + have hp : 2 ^ (len + 1) = 2 ^ len * 2 := Nat.pow_succ 2 len + let k := n / 2 + rcases Nat.mod_two_eq_zero_or_one n with hn0 | hn1 + · have h_even : n = k * 2 := by omega + have h_odd : 1 + n = k * 2 + 1 := by omega + refine ⟨0, z0o d0 d1 len k r, ?_, ?_⟩ + · rw [h_odd, z0t]; rfl + · rw [h_even, z0s]; rfl + · have h_odd : n = k * 2 + 1 := by omega + have h_even : 1 + n = (1 + k) * 2 := by omega + have h_lt : 1 + k < 2 ^ len := by omega + rcases ih k h_lt with ⟨i, s, hi1, hi0⟩ + refine ⟨i + 1, s, ?_, ?_⟩ + · rw [h_even, z0s, hi1, z0j, append_assoc] + · rw [h_odd, z0t, hi0, z0j, append_assoc] + +theorem MC_dec (h n : Nat) (r : zB) (hn : 1 + n < 2 ^ (h + 1)) : + ∃ (i : Nat) (s : zB), + MC h (1 + n) r = (rd1 ^ i) +> [0] +> s ∧ + MC h n r = (rd0 ^ i) +> [1] +> s := by + induction h generalizing n with + | zero => + have hn0 : n = 0 := by simp at hn; omega + subst hn0 + exact ⟨0, r, rfl, rfl⟩ + | succ h ih => + have hp : 2 ^ (h + 1 + 1) = 2 ^ (h + 1) * 2 := Nat.pow_succ 2 (h + 1) + let k := n / 2 + rcases Nat.mod_two_eq_zero_or_one n with hn0 | hn1 + · have h_even : n = k * 2 := by omega + have h_odd : 1 + n = k * 2 + 1 := by omega + refine ⟨0, [0, 0] +> MC h k r, ?_, ?_⟩ + · rw [h_odd, MC_t]; rfl + · rw [h_even, MC_s]; rfl + · have h_odd : n = k * 2 + 1 := by omega + have h_even : 1 + n = (1 + k) * 2 := by omega + have h_lt : 1 + k < 2 ^ (h + 1) := by omega + rcases ih k h_lt with ⟨i, s, hi1, hi0⟩ + refine ⟨i + 1, s, ?_, ?_⟩ + · rw [h_even, MC_s, hi1, z0j, append_assoc] + · rw [h_odd, MC_t, hi0, z0j, append_assoc] + +theorem zSm (tm : Machine Γ Λ) (c_1 c_2 : Cfg Γ Λ) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z0P (tm : Machine Γ Λ) (c_1 c_2 : Cfg Γ Λ) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢* c_2 := ⟨1, zSm tm c_1 c_2 h⟩ +theorem z0Q (tm : Machine Γ Λ) (c_1 c_2 : Cfg Γ Λ) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1, by decide, zSm tm c_1 c_2 h⟩ +theorem zMa (tm : Machine Γ Λ) (c_1 : Cfg Γ Λ) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, zMs, ih, Option.bind_assoc] + simp_rw [zMs] +theorem zMt (tm : Machine Γ Λ) (c_1 c_2 c_3 : Cfg Γ Λ) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa, h₁]; simp [h₂] +theorem zSt {tm : Machine Γ Λ} {c_1 c_2 c_3 : Cfg Γ Λ} + (h₁ : c_1 [tm]⊢* c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢* c_3 := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem zPs {tm : Machine Γ Λ} {c_1 c_2 : Cfg Γ Λ} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ +theorem z0R {tm : Machine Γ Λ} {c_1 c_2 c_3 : Cfg Γ Λ} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z0S {tm : Machine Γ Λ} {c_1 c_2 c_3 : Cfg Γ Λ} + (h₁ : c_1 [tm]⊢* c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z0T {tm : Machine Γ Λ} {c_1 c_2 c_3 : Cfg Γ Λ} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z0R (z0Q tm c_1 c_2 h₁) h₂ + +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step_tm" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z0T (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, z0i, zDh, zDt]) +macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm))) +macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +theorem sh_0_sound (n : Nat) (l r : zB) : + (l {{A}}> ((rd1 ^ n) +> r)) [tm15]⊢* ((([1, 1, 1] ^ n) +> l) {{A}}> r) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (l {{A}}> (rd1 +> (rd1 ^ n) +> r)) [tm15]⊢* + (([1, 1, 1] +> l) {{A}}> ((rd1 ^ n) +> r)) := by + dsimp [rd1, ListBlank.append]; execute + have h2 := ih ([1, 1, 1] +> l) r + rw [<- append_assoc ([1, 1, 1] ^ n) [1, 1, 1] l, z0l] at h2 + exact zSt h1 h2 + +theorem sh_1_sound (n : Nat) (l r : zB) : + ((([1] ^ n) +> l) <{{B}} r) [tm15]⊢* (l <{{B}} (([0] ^ n) +> r)) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (([1] +> ([1] ^ n) +> l) <{{B}} r) [tm15]⊢* + ((([1] ^ n) +> l) <{{B}} ([0] +> r)) := by + dsimp [ListBlank.append]; execute + have h2 := ih l ([0] +> r) + rw [<- append_assoc ([0] ^ n) [0] r, z0l] at h2 + exact zSt h1 h2 + +theorem sh_2_sound (n : Nat) (l r : zB) : + ((([1, 1] ^ n) +> l) <{{C}} r) [tm15]⊢* (l <{{C}} (([1, 0] ^ n) +> r)) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (([1, 1] +> ([1, 1] ^ n) +> l) <{{C}} r) [tm15]⊢* + ((([1, 1] ^ n) +> l) <{{C}} ([1, 0] +> r)) := by + dsimp [ListBlank.append]; execute + have h2 := ih l ([1, 0] +> r) + rw [<- append_assoc ([1, 0] ^ n) [1, 0] r, z0l] at h2 + exact zSt h1 h2 + +theorem sh_3_sound (n : Nat) (l r : zB) : + (l {{D}}> (([1] ^ n) +> r)) [tm15]⊢* ((([0] ^ n) +> l) {{D}}> r) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (l {{D}}> ([1] +> ([1] ^ n) +> r)) [tm15]⊢* + (([0] +> l) {{D}}> (([1] ^ n) +> r)) := by + dsimp [ListBlank.append]; execute + have h2 := ih ([0] +> l) r + rw [<- append_assoc ([0] ^ n) [0] l, z0l] at h2 + exact zSt h1 h2 + +theorem sh_4_sound (n : Nat) (l r : zB) : + (l {{D}}> (([0, 1, 0] ^ n) +> r)) [tm15]⊢* ((([1, 1, 1] ^ n) +> l) {{D}}> r) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (l {{D}}> ([0, 1, 0] +> ([0, 1, 0] ^ n) +> r)) [tm15]⊢* + (([1, 1, 1] +> l) {{D}}> (([0, 1, 0] ^ n) +> r)) := by + dsimp [ListBlank.append]; execute + have h2 := ih ([1, 1, 1] +> l) r + rw [<- append_assoc ([1, 1, 1] ^ n) [1, 1, 1] l, z0l] at h2 + exact zSt h1 h2 + +theorem sh_5_sound (n : Nat) (l r : zB) : + (l {{D}}> (([0, 1, 0, 1] ^ n) +> r)) [tm15]⊢* (((ld0 ^ n) +> l) {{D}}> r) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (l {{D}}> ([0, 1, 0, 1] +> ([0, 1, 0, 1] ^ n) +> r)) [tm15]⊢* + ((ld0 +> l) {{D}}> (([0, 1, 0, 1] ^ n) +> r)) := by + dsimp [ld0, ListBlank.append]; execute + have h2 := ih (ld0 +> l) r + rw [<- append_assoc (ld0 ^ n) ld0 l, z0l] at h2 + exact zSt h1 h2 + +theorem sh_6_sound (n : Nat) (l r : zB) : + (l {{D}}> (([1, 0, 1, 0] ^ n) +> r)) [tm15]⊢* ((([1, 1, 1, 0] ^ n) +> l) {{D}}> r) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (l {{D}}> ([1, 0, 1, 0] +> ([1, 0, 1, 0] ^ n) +> r)) [tm15]⊢* + (([1, 1, 1, 0] +> l) {{D}}> (([1, 0, 1, 0] ^ n) +> r)) := by + dsimp [ListBlank.append]; execute + have h2 := ih ([1, 1, 1, 0] +> l) r + rw [<- append_assoc ([1, 1, 1, 0] ^ n) [1, 1, 1, 0] l, z0l] at h2 + exact zSt h1 h2 + +def z0U (l r : zB) : Cfg (Fin 2) (Fin 6) := + ([1] +> l) <{{C}} ([1, 0, 1, 0] +> r) +def z0V (l r : zB) : Cfg (Fin 2) (Fin 6) := + ([1, 0, 1, 1, 1] +> l) {{A}}> r + +theorem z10 (n : Nat) (l r : zB) : + ((([1, 1, 1] ^ n) +> l) <{{B}} r) [tm15]⊢* (l <{{B}} ((rd0 ^ n) +> r)) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (([1, 1, 1] +> ([1, 1, 1] ^ n) +> l) <{{B}} r) [tm15]⊢* + ((([1, 1, 1] ^ n) +> l) <{{B}} (rd0 +> r)) := by + dsimp [rd0, ListBlank.append]; execute + have h2 := ih l (rd0 +> r) + rw [<- append_assoc (rd0 ^ n) rd0 r, z0l] at h2 + exact zSt h1 h2 + +theorem z11 (n : Nat) (l r : zB) : + (([1] +> (ld1 ^ n) +> l) <{{C}} r) [tm15]⊢* + (([1] +> l) <{{C}} (([1, 0, 1, 0] ^ n) +> r)) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (([1] +> ld1 +> (ld1 ^ n) +> l) <{{C}} r) [tm15]⊢* + (([1] +> (ld1 ^ n) +> l) <{{C}} ([1, 0, 1, 0] +> r)) := by + dsimp [ld1, ListBlank.append]; execute + have h2 := ih l ([1, 0, 1, 0] +> r) + rw [<- append_assoc ([1, 0, 1, 0] ^ n) [1, 0, 1, 0] r, z0l] at h2 + exact zSt h1 h2 + +theorem z13 (n : Nat) (l r : zB) : + (([1, 0, 1, 1, 1] +> l) {{A}}> (([1, 0, 1, 0] ^ n) +> r)) [tm15]⊢* + (([1, 0, 1, 1, 1] +> (ld0 ^ n) +> l) {{A}}> r) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (([1, 0, 1, 1, 1] +> l) {{A}}> ([1, 0, 1, 0] +> ([1, 0, 1, 0] ^ n) +> r)) [tm15]⊢* + (([1, 0, 1, 1, 1] +> ld0 +> l) {{A}}> (([1, 0, 1, 0] ^ n) +> r)) := by + dsimp [ld0, ListBlank.append]; execute + have h2 := ih (ld0 +> l) r + rw [<- append_assoc (ld0 ^ n) ld0 l, z0l] at h2 + exact zSt h1 h2 + +theorem z15 (l r : zB) (n : Nat) : + (z0U ((ld1 ^ n) +> ld0 +> l) r) [tm15]⊢⁺ + (z0V ((ld0 ^ n) +> ld1 +> l) r) := by + unfold z0U z0V + have h1 := z11 n (ld0 +> l) ([1, 0, 1, 0] +> r) + have h_eq : (([1, 0, 1, 0] ^ n) +> [1, 0, 1, 0] +> r) = ([1, 0, 1, 0] +> ([1, 0, 1, 0] ^ n) +> r) := by + rw [<- append_assoc ([1, 0, 1, 0] ^ n) [1, 0, 1, 0] r, z0l, z0j, append_assoc] + rw [h_eq] at h1 + have h2 : (([1] +> ld0 +> l) <{{C}} ([1, 0, 1, 0] +> ([1, 0, 1, 0] ^ n) +> r)) [tm15]⊢⁺ + (([1, 0, 1, 1, 1] +> ld1 +> l) {{A}}> (([1, 0, 1, 0] ^ n) +> r)) := by + dsimp [ld0, ld1, ListBlank.append]; execute + have h3 := z13 n (ld1 +> l) r + exact z0R (z0S h1 h2) h3 + +theorem z15_absorb (l r : zB) (n : Nat) : + (z0U ((ld1 ^ n) +> [1, 0, 1, 1] +> l) r) [tm15]⊢⁺ + (z0V ((ld0 ^ (n + 1)) +> l) r) := by + unfold z0U z0V + have h1 := z11 n ([1, 0, 1, 1] +> l) ([1, 0, 1, 0] +> r) + have h_eq : (([1, 0, 1, 0] ^ n) +> [1, 0, 1, 0] +> r) = ([1, 0, 1, 0] +> ([1, 0, 1, 0] ^ n) +> r) := by + rw [<- append_assoc ([1, 0, 1, 0] ^ n) [1, 0, 1, 0] r, z0l, z0j, append_assoc] + rw [h_eq] at h1 + have h2 : (([1] +> [1, 0, 1, 1] +> l) <{{C}} ([1, 0, 1, 0] +> ([1, 0, 1, 0] ^ n) +> r)) [tm15]⊢⁺ + (([1, 0, 1, 1, 1] +> ld0 +> l) {{A}}> (([1, 0, 1, 0] ^ n) +> r)) := by + dsimp [ld0, ListBlank.append]; execute + have h3 := z13 n (ld0 +> l) r + rw [<- append_assoc (ld0 ^ n) ld0 l, z0l] at h3 + exact z0R (z0S h1 h2) h3 + +theorem z16 (l r : zB) (n : Nat) : + (z0V l ((rd1 ^ n) +> [0] +> r)) [tm15]⊢⁺ + (z0U l ((rd0 ^ n) +> [1] +> r)) := by + unfold z0V z0U + have h1 := sh_0_sound n ([1, 0, 1, 1, 1] +> l) ([0] +> r) + have h2 : ((([1, 1, 1] ^ n) +> [1, 0, 1, 1, 1] +> l) {{A}}> ([0] +> r)) [tm15]⊢⁺ + ((([1, 1, 1] ^ n) +> [1, 0, 1, 1, 1] +> l) <{{B}} ([1] +> r)) := by + dsimp [ListBlank.append]; execute + have h3 := z10 n ([1, 0, 1, 1, 1] +> l) ([1] +> r) + have h4 : (([1, 0, 1, 1, 1] +> l) <{{B}} ((rd0 ^ n) +> [1] +> r)) [tm15]⊢* + (([1] +> l) <{{C}} ([1, 0, 1, 0] +> (rd0 ^ n) +> [1] +> r)) := by + dsimp [ListBlank.append]; execute + exact z0R (z0R (z0S h1 h2) h3) h4 + +theorem z1H (len k : Nat) (l r : zB) (h : 1 + k < 2 ^ len) : + (z0U (z0o ld0 ld1 len (1 + k) l) r) [tm15]⊢⁺ (z0V (z0o ld0 ld1 len k l) r) := by + rcases z0M ld0 ld1 len k l h with ⟨i, s, hi1, hi0⟩ + rw [hi1, hi0] + exact z15 s r i + +theorem z1J (h n : Nat) (l r : zB) (hn : 1 + n < 2 ^ (h + 1)) : + (z0V l (MC h (1 + n) r)) [tm15]⊢⁺ (z0U l (MC h n r)) := by + rcases MC_dec h n r hn with ⟨i, s, hi1, hi0⟩ + rw [hi1, hi0] + exact z16 l s i + +theorem pair_general (len val_l h val_r c : Nat) (l r : zB) + (hl : val_l + c < 2 ^ len) (hr : val_r + c < 2 ^ (h + 1)) : + (z0V (z0o ld0 ld1 len (val_l + c) l) (MC h (val_r + c) r)) [tm15]⊢* + (z0V (z0o ld0 ld1 len val_l l) (MC h val_r r)) := by + induction c with + | zero => exact ⟨0, rfl⟩ + | succ c ih => + have h1 : val_r + (c + 1) = 1 + (val_r + c) := by omega + have h2 : val_l + (c + 1) = 1 + (val_l + c) := by omega + rw [h1, h2] + have s1 := zPs (z1J h (val_r + c) (z0o ld0 ld1 len (1 + (val_l + c)) l) r (by omega)) + have s2 := zPs (z1H len (val_l + c) l (MC h (val_r + c) r) (by omega)) + have s3 := ih (by omega) (by omega) + exact zSt (zSt s1 s2) s3 + +theorem absorb_step (L h val_r : Nat) (l r : zB) (hr : val_r + 2 ^ L < 2 ^ (h + 1)) : + (z0V ((ld0 ^ L) +> [1, 0, 1, 1] +> l) (MC h (val_r + 2 ^ L) r)) [tm15]⊢* + (z0V ((ld0 ^ (L + 1)) +> l) (MC h val_r r)) := by + have hp := z0v L + have h1 : (ld0 ^ L) +> [1, 0, 1, 1] +> l = z0o ld0 ld1 L (0 + (2 ^ L - 1)) ([1, 0, 1, 1] +> l) := by + rw [Nat.zero_add, z0w] + have h2 : val_r + 2 ^ L = (1 + val_r) + (2 ^ L - 1) := by omega + rw [h1, h2] + have s1 := pair_general L 0 h (1 + val_r) (2 ^ L - 1) ([1, 0, 1, 1] +> l) r (by omega) (by omega) + rw [z0u] at s1 + have s2 := zPs (z1J h val_r ((ld1 ^ L) +> [1, 0, 1, 1] +> l) r (by omega)) + have s3 := zPs (z15_absorb l (MC h val_r r) L) + exact zSt (zSt s1 s2) s3 + +theorem absorb_loop (L m' h val_r : Nat) (l r : zB) + (hr : val_r + (2 ^ m' - 1) * 2 ^ L < 2 ^ (h + 1)) : + (z0V ((ld0 ^ L) +> ([1, 0, 1, 1] ^ m') +> l) (MC h (val_r + (2 ^ m' - 1) * 2 ^ L) r)) [tm15]⊢* + (z0V ((ld0 ^ (L + m')) +> l) (MC h val_r r)) := by + induction m' generalizing L val_r with + | zero => + have h0 : (2 ^ 0 - 1) * 2 ^ L = 0 := by simp + simp only [h0, Nat.add_zero, zPz, append_nil] + exact ⟨0, rfl⟩ + | succ m' ih => + have hm := z0v m' + have hLpos := z0v L + have halg : (2 ^ (m' + 1) - 1) * 2 ^ L = (2 ^ m' - 1) * 2 ^ (L + 1) + 2 ^ L := by + have h1 : 2 ^ (m' + 1) - 1 = (2 ^ m' - 1) * 2 + 1 := by rw [Nat.pow_succ]; omega + rw [h1, Nat.add_mul, Nat.one_mul, Nat.mul_assoc, Nat.mul_comm 2 (2 ^ L), ← Nat.pow_succ] + have hsum : val_r + (2 ^ (m' + 1) - 1) * 2 ^ L = (val_r + (2 ^ m' - 1) * 2 ^ (L + 1)) + 2 ^ L := by + omega + rw [z0j, append_assoc, hsum] + have s1 := absorb_step L h (val_r + (2 ^ m' - 1) * 2 ^ (L + 1)) (([1, 0, 1, 1] ^ m') +> l) r (by omega) + have s2 := ih (L + 1) val_r (by omega) + have hL : L + 1 + m' = L + (m' + 1) := by omega + rw [hL] at s2 + exact zSt s1 s2 + +theorem absorb_general (n m' h val_r : Nat) (l r : zB) + (hr : val_r + (1 + (2 ^ m' - 1) * 2 ^ (n + 1)) < 2 ^ (h + 1)) : + (z0V ((ld1 ^ n) +> ([1, 0, 1, 1] ^ (m' + 1)) +> l) + (MC h (val_r + (1 + (2 ^ m' - 1) * 2 ^ (n + 1))) r)) [tm15]⊢* + (z0V ((ld0 ^ (n + (m' + 1))) +> l) (MC h val_r r)) := by + rw [z0j, append_assoc] + have hsum : val_r + (1 + (2 ^ m' - 1) * 2 ^ (n + 1)) = 1 + (val_r + (2 ^ m' - 1) * 2 ^ (n + 1)) := by omega + rw [hsum] + have s1 := zPs (z1J h (val_r + (2 ^ m' - 1) * 2 ^ (n + 1)) ((ld1 ^ n) +> [1, 0, 1, 1] +> ([1, 0, 1, 1] ^ m') +> l) r (by omega)) + have s2 := zPs (z15_absorb (([1, 0, 1, 1] ^ m') +> l) (MC h (val_r + (2 ^ m' - 1) * 2 ^ (n + 1)) r) n) + have s3 := absorb_loop (n + 1) m' h val_r l r (by omega) + have hL : n + 1 + m' = n + (m' + 1) := by omega + rw [hL] at s3 + exact zSt (zSt s1 s2) s3 + +-- ============================================================================ +-- Section 2: Block / Stack / PartList Engine & Soundness +-- ============================================================================ + +structure Block where + pat : Nat + width : Nat + len : Nat + deriving DecidableEq + +abbrev Stack := List Block + +def rot1 (w p : Nat) : Nat := + p / 2 + (p % 2) * (2 ^ (w - 1)) + +def rot_k (w : Nat) : Nat → Nat → Nat + | 0, p => p + | k + 1, p => rot_k w k (rot1 w p) + +def rot_mod (w n p : Nat) : Nat := + if (p == 0 || (w == 1 && p == 1)) = true then p + else if rot_k w w p = p then rot_k w (n % w) p else rot_k w n p + +theorem rot_k_add (w a b p : Nat) : rot_k w (a + b) p = rot_k w b (rot_k w a p) := by + induction a generalizing p with + | zero => simp [rot_k] + | succ a ih => simp [rot_k, Nat.succ_add, ih] + +theorem rot_k_period (w p : Nat) (h : rot_k w w p = p) (q r : Nat) : + rot_k w (w * q + r) p = rot_k w r p := by + induction q with + | zero => simp + | succ q ih => + have h1 : w * (q + 1) + r = w + (w * q + r) := by + rw [Nat.mul_succ]; omega + rw [h1, rot_k_add, h, ih] + +theorem rot_k_zero (w n : Nat) : rot_k w n 0 = 0 := by + induction n with + | zero => rfl + | succ n ih => simpa [rot_k, rot1] using! ih + +theorem rot_k_one_one (n : Nat) : rot_k 1 n 1 = 1 := by + induction n with + | zero => rfl + | succ n ih => simpa [rot_k, rot1] using! ih + +theorem rot_mod_eq (w n p : Nat) : rot_mod w n p = rot_k w n p := by + unfold rot_mod + split_ifs with h0 h + · simp only [Bool.or_eq_true, Bool.and_eq_true, beq_iff_eq] at h0 + rcases h0 with rfl | ⟨rfl, rfl⟩ + · exact (rot_k_zero w n).symm + · exact (rot_k_one_one n).symm + · have hdiv := Nat.div_add_mod n w + conv_rhs => rw [← hdiv] + exact (rot_k_period w p h (n / w) (n % w)).symm + · rfl + +def bit_of (x : Nat) : Fin 2 := if x % 2 = 1 then 1 else 0 + +def expand_pat (w p : Nat) : Nat → zB → zB + | 0, r => r + | n + 1, r => bit_of p >> expand_pat w (rot1 w p) n r + +def stack_to_tape : Stack → zB + | [] => default + | b :: rest => expand_pat b.width b.pat b.len (stack_to_tape rest) + +theorem expand_pat_add (w p a b : Nat) (r : zB) : + expand_pat w p (a + b) r = expand_pat w p a (expand_pat w (rot_k w a p) b r) := by + induction a generalizing p with + | zero => simp [expand_pat, rot_k] + | succ a ih => simp only [Nat.succ_add, expand_pat, rot_k, ih] + +theorem expand_pat_zero_pat (w n : Nat) : expand_pat w 0 n default = default := by + induction n with + | zero => rfl + | succ n ih => + have h1 : rot1 w 0 = 0 := by simp [rot1] + have h2 : bit_of 0 = 0 := rfl + simp only [expand_pat, h1, h2, ih, z0i] + +def with_nat {α : Type} (e : Nat) (f : Nat → α) : α := + Nat.casesOn e (f 0) (fun n => f (Nat.succ n)) + +@[simp] theorem with_nat_eq {α : Type} (e : Nat) (f : Nat → α) : with_nat e f = f e := by + cases e <;> rfl + +def with_list {α β : Type} (xs : List β) (f : List β → α) : α := + List.casesOn xs (f []) (fun h t => f (h :: t)) + +@[simp] theorem with_list_eq {α β : Type} (xs : List β) (f : List β → α) : with_list xs f = f xs := by + cases xs <;> rfl + +def with_prod {α β γ : Type} (p : α × β) (f : α × β → γ) : γ := + Prod.casesOn p (fun a b => f (a, b)) + +@[simp] theorem with_prod_eq {α β γ : Type} (p : α × β) (f : α × β → γ) : with_prod p f = f p := by + cases p; rfl + +def with_block {α : Type} (b : Block) (f : Block → α) : α := + Block.casesOn b (fun pat width len => + with_nat pat (fun p => + with_nat width (fun w => + with_nat len (fun l => + f ⟨p, w, l⟩)))) + +@[simp] theorem with_block_eq {α : Type} (b : Block) (f : Block → α) : with_block b f = f b := by + cases b; simp [with_block] + +def with_stack {α : Type} (s : Stack) (f : Stack → α) : α := + List.casesOn s (f []) (fun top rest => + with_block top (fun top' => f (top' :: rest))) + +@[simp] theorem with_stack_eq {α : Type} (s : Stack) (f : Stack → α) : with_stack s f = f s := by + cases s <;> simp [with_stack] + +def push_stack_aux (b : Block) : Stack → Stack + | [] => if b.pat = 0 then [] else [b] + | top :: rest => + if (b.width == top.width && rot_mod b.width b.len b.pat == top.pat) = true then + with_nat (b.len + top.len) (fun new_len => + push_stack_aux ⟨b.pat, b.width, new_len⟩ rest) + else + b :: top :: rest + +def push_stack (pat width len : Nat) (s : Stack) : Stack := + with_stack s (fun s' => + if len = 0 then s' + else + with_nat pat (fun p => + with_nat width (fun w => + with_nat len (fun l => + push_stack_aux ⟨p, w, l⟩ s')))) + +theorem push_stack_aux_sound (b : Block) (s : Stack) : + stack_to_tape (push_stack_aux b s) = expand_pat b.width b.pat b.len (stack_to_tape s) := by + induction s generalizing b with + | nil => + unfold push_stack_aux + split_ifs with h + · simp only [stack_to_tape, h, expand_pat_zero_pat] + · rfl + | cons top rest ih => + unfold push_stack_aux + simp only [with_nat_eq] + split_ifs with h + · simp only [Bool.and_eq_true, beq_iff_eq] at h + rw [ih, stack_to_tape, expand_pat_add, ← rot_mod_eq, h.2, ← h.1] + · rfl + +theorem push_stack_sound (pat width len : Nat) (s : Stack) : + stack_to_tape (push_stack pat width len s) = expand_pat width pat len (stack_to_tape s) := by + unfold push_stack + simp only [with_stack_eq, with_nat_eq] + split_ifs with h + · subst h; rfl + · exact push_stack_aux_sound ⟨pat, width, len⟩ s + +def drop_stack (n : Nat) : Stack → Stack + | [] => [] + | top :: rest => + if n = 0 then top :: rest + else if top.len ≤ n then + with_nat (n - top.len) (fun rem => drop_stack rem rest) + else + with_nat (rot_mod top.width n top.pat) (fun p' => + with_nat (top.len - n) (fun l' => + ⟨p', top.width, l'⟩ :: rest)) + +theorem drop_stack_zero (s : Stack) : drop_stack 0 s = s := by + cases s <;> rfl + +theorem drop_stack_top_le (top : Block) (rest : Stack) (k : Nat) (hk : k ≤ top.len) : + stack_to_tape (top :: rest) = + expand_pat top.width top.pat k (stack_to_tape (drop_stack k (top :: rest))) := by + unfold drop_stack + simp only [with_nat_eq] + split_ifs with h0 hle + · subst h0; rfl + · have heq : k = top.len := by omega + subst heq + simp only [Nat.sub_self, drop_stack_zero, stack_to_tape] + · simp only [stack_to_tape, rot_mod_eq] + rw [← expand_pat_add] + have hlen : k + (top.len - k) = top.len := by omega + rw [hlen] + +def pop1 : Stack → Fin 2 × Stack + | [] => (0, []) + | top :: rest => + if top.len = 0 then + pop1 rest + else + let bit := bit_of top.pat + if top.len = 1 then + (bit, rest) + else + with_nat (rot1 top.width top.pat) (fun p' => + with_nat (top.len - 1) (fun l' => + (bit, ⟨p', top.width, l'⟩ :: rest))) + +theorem pop1_sound (s : Stack) : + stack_to_tape s = (pop1 s).1 >> stack_to_tape (pop1 s).2 := by + induction s with + | nil => exact z0i.symm + | cons top rest ih => + unfold pop1 + simp only [with_nat_eq] + split_ifs with h0 h1 + · simp only [stack_to_tape, h0, expand_pat, ih] + · simp only [stack_to_tape, h1, expand_pat] + · simp only [stack_to_tape] + have hlen : top.len = (top.len - 1) + 1 := by omega + conv_lhs => rw [hlen, expand_pat] + +def word_of : Nat → Nat → zF + | _, 0 => [] + | pat, w + 1 => bit_of pat :: word_of (pat / 2) w + +def pop_word : Nat → Nat → Stack → Option Stack + | _, 0, s => some s + | pat, w + 1, s => + with_prod (pop1 s) (fun res => + if res.1 = bit_of pat then + pop_word (pat / 2) w res.2 + else + none) + +theorem pop_word_sound (pat w : Nat) (s s' : Stack) (h : pop_word pat w s = some s') : + stack_to_tape s = word_of pat w +> stack_to_tape s' := by + induction w generalizing pat s with + | zero => + simp [pop_word] at h + subst h; rfl + | succ w ih => + simp only [pop_word, with_prod_eq] at h + split_ifs at h with hb + rw [pop1_sound s, hb, ih (pat / 2) (pop1 s).2 h, word_of, append_cons] + +def pat_word (bw : Nat) : Nat → Nat → zF + | _, 0 => [] + | bp, w + 1 => bit_of bp :: pat_word bw (rot1 bw bp) w + +theorem expand_pat_word (bw bp w : Nat) (r : zB) : + expand_pat bw bp w r = pat_word bw bp w +> r := by + induction w generalizing bp with + | zero => rfl + | succ w ih => simp [expand_pat, pat_word, ih] + +theorem expand_pat_bulk (bw bp pat w bulk : Nat) (r : zB) + (hrot : rot_k bw w bp = bp) (hw : pat_word bw bp w = word_of pat w) : + expand_pat bw bp (bulk * w) r = ((word_of pat w) ^ bulk) +> r := by + induction bulk with + | zero => simp [expand_pat] + | succ bulk ih => + have h1 : (bulk + 1) * w = w + bulk * w := by rw [Nat.succ_mul, Nat.add_comm] + rw [h1, expand_pat_add, hrot, ih, expand_pat_word, hw, z0j, append_assoc] + +def count_stack_mut (pat w : Nat) : Nat → Nat → Stack → Nat × Stack + | 0, _, s => (0, s) + | fuel + 1, limit, s => + if limit = 0 then (0, s) + else + match s with + | [] => (0, []) + | top :: rest => + if (0 < w && w ≤ top.len && rot_k top.width w top.pat == top.pat && + pat_word top.width top.pat w == word_of pat w) = true then + let div := top.len / w + with_nat (min limit div) (fun bulk => + with_stack (drop_stack (bulk * w) (top :: rest)) (fun s1 => + with_prod (count_stack_mut pat w fuel (limit - bulk) s1) (fun res => + with_nat res.1 (fun c1 => + with_stack res.2 (fun s2 => (bulk + c1, s2)))))) + else + match pop_word pat w (top :: rest) with + | some s1 => + with_prod (count_stack_mut pat w fuel (limit - 1) s1) (fun res => + with_nat res.1 (fun c1 => + with_stack res.2 (fun s2 => (1 + c1, s2)))) + | none => (0, top :: rest) + +theorem count_stack_mut_sound (pat w fuel limit : Nat) (s : Stack) : + (count_stack_mut pat w fuel limit s).1 ≤ limit ∧ + stack_to_tape s = ((word_of pat w) ^ (count_stack_mut pat w fuel limit s).1) +> + stack_to_tape (count_stack_mut pat w fuel limit s).2 := by + induction fuel generalizing limit s with + | zero => simp [count_stack_mut] + | succ fuel ih => + by_cases hlim : limit = 0 + · simp [count_stack_mut, hlim] + · cases s with + | nil => simp [count_stack_mut, hlim] + | cons top rest => + simp only [count_stack_mut, hlim, ↓reduceIte, with_nat_eq, with_stack_eq, with_prod_eq] + split_ifs with h + · dsimp only + simp only [Bool.and_eq_true, decide_eq_true_eq, beq_iff_eq] at h + rcases h with ⟨⟨⟨hw0, hwlen⟩, hrot⟩, hpat⟩ + have hbulk_le_div : min limit (top.len / w) ≤ top.len / w := + Nat.min_le_right limit (top.len / w) + have hbulk_le_lim : min limit (top.len / w) ≤ limit := + Nat.min_le_left limit (top.len / w) + have hmul_le : min limit (top.len / w) * w ≤ top.len := + Nat.le_trans (Nat.mul_le_mul_right w hbulk_le_div) (Nat.div_mul_le_self top.len w) + have hdrop := drop_stack_top_le top rest (min limit (top.len / w) * w) hmul_le + rw [expand_pat_bulk top.width top.pat pat w (min limit (top.len / w)) _ hrot hpat] at hdrop + rcases ih (limit - min limit (top.len / w)) + (drop_stack (min limit (top.len / w) * w) (top :: rest)) with ⟨hrem_le, hrem_eq⟩ + refine ⟨by omega, ?_⟩ + rw [hdrop, hrem_eq, z0k, append_assoc] + · cases hpop : pop_word pat w (top :: rest) with + | none => simp + | some s1 => + dsimp only + have hpw := pop_word_sound pat w (top :: rest) s1 hpop + rcases ih (limit - 1) s1 with ⟨hrem_le, hrem_eq⟩ + refine ⟨by omega, ?_⟩ + rw [hpw, hrem_eq, Nat.add_comm 1, z0j, append_assoc] + +-- PartList & Parser / Subtractor +abbrev PartList := List (Bool × Nat) + +def bsize_parts : PartList → Nat + | [] => 0 + | (_, k) :: xs => k + bsize_parts xs + +def eval_lsb : PartList → Nat + | [] => 0 + | (b, k) :: xs => (if b then 2 ^ k - 1 else 0) + eval_lsb xs * 2 ^ k + +def cons_lsb (b : Bool) (k : Nat) (xs : PartList) : PartList := + with_list xs (fun xs' => + if k = 0 then xs' + else if !b && xs'.isEmpty then [] + else (b, k) :: xs') + +theorem eval_cons_lsb (b : Bool) (k : Nat) (xs : PartList) : + eval_lsb (cons_lsb b k xs) = (if b then 2 ^ k - 1 else 0) + eval_lsb xs * 2 ^ k := by + cases k with + | zero => simp [cons_lsb] + | succ k => cases b <;> cases xs <;> simp [cons_lsb, eval_lsb] + +theorem bsize_cons_lsb_le (b : Bool) (k : Nat) (xs : PartList) : + bsize_parts (cons_lsb b k xs) ≤ k + bsize_parts xs := by + cases k with + | zero => simp [cons_lsb] + | succ k => cases b <;> cases xs <;> simp [cons_lsb, bsize_parts] + +theorem eval_lsb_lt (xs : PartList) : eval_lsb xs < 2 ^ (bsize_parts xs) := by + induction xs with + | nil => simp [eval_lsb, bsize_parts] + | cons p xs ih => + rcases p with ⟨b, k⟩ + simp only [eval_lsb, bsize_parts] + have hk := z0v k + have hd : (if b then 2 ^ k - 1 else 0) < 2 ^ k := by split_ifs <;> omega + have hmul : (eval_lsb xs + 1) * 2 ^ k ≤ 2 ^ (bsize_parts xs) * 2 ^ k := + Nat.mul_le_mul_right (2 ^ k) ih + have hpow : 2 ^ (k + bsize_parts xs) = 2 ^ (bsize_parts xs) * 2 ^ k := by + rw [Nat.add_comm, Nat.pow_add] + have hadd : (eval_lsb xs + 1) * 2 ^ k = 2 ^ k + eval_lsb xs * 2 ^ k := by + rw [Nat.add_mul, Nat.one_mul, Nat.add_comm] + omega + +theorem z0o_part (b : Bool) (k len n : Nat) (r : zB) : + z0o ld0 ld1 (k + len) ((if b then 2 ^ k - 1 else 0) + n * 2 ^ k) r = + ((if b then ld0 else ld1) ^ k) +> z0o ld0 ld1 len n r := by + rw [Nat.add_comm k len] + cases b + · simp only [Bool.false_eq_true, ↓reduceIte, Nat.zero_add] + exact z0x ld0 ld1 len n k r + · simp only [↓reduceIte] + have hp := z0v k + have h1 : 2 ^ k - 1 + n * 2 ^ k = (n + 1) * 2 ^ k - 1 := by + rw [Nat.add_mul, Nat.one_mul]; omega + rw [h1] + exact z0y' ld0 ld1 len n k r + +theorem MC_part (b : Bool) (k h n : Nat) (r : zB) : + MC (h + k) ((if b then 2 ^ k - 1 else 0) + n * 2 ^ k) r = + ((if b then rd0 else rd1) ^ k) +> MC h n r := by + cases b + · simp only [Bool.false_eq_true, ↓reduceIte, Nat.zero_add] + exact MC_lsb_0 h n k r + · simp only [↓reduceIte] + have hp := z0v k + have h1 : 2 ^ k - 1 + n * 2 ^ k = (n + 1) * 2 ^ k - 1 := by + rw [Nat.add_mul, Nat.one_mul]; omega + rw [h1] + exact MC_lsb_1 h n k r + +theorem push_ld (b : Bool) (k : Nat) (s : Stack) : + stack_to_tape (push_stack (if b then 14 else 1) (if b then 4 else 1) (k * 4) s) = + ((if b then ld0 else ld1) ^ k) +> stack_to_tape s := by + rw [push_stack_sound] + cases b + · exact expand_pat_bulk 1 1 15 4 k (stack_to_tape s) rfl rfl + · exact expand_pat_bulk 4 14 14 4 k (stack_to_tape s) rfl rfl + +theorem push_rd (b : Bool) (k : Nat) (s : Stack) : + stack_to_tape (push_stack (if b then 0 else 1) (if b then 1 else 3) (k * 3) s) = + ((if b then rd0 else rd1) ^ k) +> stack_to_tape s := by + rw [push_stack_sound] + cases b + · exact expand_pat_bulk 3 1 1 3 k (stack_to_tape s) rfl rfl + · exact expand_pat_bulk 1 0 0 3 k (stack_to_tape s) rfl rfl + +def put_l_parts : PartList → Stack → Stack + | [], s => s + | (b, k) :: xs, s => + push_stack (if b then 14 else 1) (if b then 4 else 1) (k * 4) (put_l_parts xs s) + +theorem put_l_parts_sound (xs : PartList) (s : Stack) : + stack_to_tape (put_l_parts xs s) = + z0o ld0 ld1 (bsize_parts xs) (eval_lsb xs) (stack_to_tape s) := by + induction xs with + | nil => rfl + | cons p xs ih => + rcases p with ⟨b, k⟩ + simp only [put_l_parts, bsize_parts, eval_lsb, push_ld, ih, z0o_part] + +theorem z0o_pad_zero (xs : PartList) (extra : Nat) (r : zB) : + z0o ld0 ld1 (bsize_parts xs + extra) (eval_lsb xs) r = + z0o ld0 ld1 (bsize_parts xs) (eval_lsb xs) ((ld1 ^ extra) +> r) := by + induction xs with + | nil => simp [bsize_parts, eval_lsb, z0o, z0u] + | cons p xs ih => + rcases p with ⟨b, k⟩ + simp only [bsize_parts, eval_lsb] + rw [Nat.add_assoc k (bsize_parts xs) extra, z0o_part, ih, ← z0o_part] + +def put_l_stack (xs : PartList) (n : Nat) (s : Stack) : Stack := + let bs := bsize_parts xs + let s1 := if bs < n then push_stack 1 1 ((n - bs) * 4) s else s + put_l_parts xs s1 + +theorem put_l_stack_sound (xs : PartList) (n : Nat) (s : Stack) (hn : bsize_parts xs ≤ n) : + stack_to_tape (put_l_stack xs n s) = + z0o ld0 ld1 n (eval_lsb xs) (stack_to_tape s) := by + unfold put_l_stack + dsimp only + rw [put_l_parts_sound] + have hlen : n = bsize_parts xs + (n - bsize_parts xs) := by omega + conv_rhs => rw [hlen, z0o_pad_zero] + split_ifs with hlt + · have := push_ld false (n - bsize_parts xs) s + simp only [Bool.false_eq_true, ↓reduceIte] at this + rw [this] + · have hz : n - bsize_parts xs = 0 := by omega + simp [hz] + +theorem push_rd_base (b : Bool) (h : Nat) (s : Stack) : + stack_to_tape (push_stack (if b then 0 else 1) (if b then 1 else 3) ((h + 1) * 3 - 2) s) = + MC h (if b then 2 ^ (h + 1) - 1 else 0) (stack_to_tape s) := by + have hlen : (h + 1) * 3 - 2 = h * 3 + 1 := by omega + rw [hlen, push_stack_sound, expand_pat_add] + cases b + · simp only [Bool.false_eq_true, ↓reduceIte] + have hrot : rot_k 3 (h * 3) 1 = 1 := by + have := rot_k_period 3 1 rfl h 0 + simpa [Nat.mul_comm] using! this + rw [hrot, expand_pat_bulk 3 1 1 3 h _ rfl rfl, MC_base_0]; rfl + · simp only [↓reduceIte] + have hrot : rot_k 1 (h * 3) 0 = 0 := by + have := rot_k_period 1 0 rfl (h * 3) 0 + simpa using! this + rw [hrot, expand_pat_bulk 1 0 0 3 h _ rfl rfl, MC_base_1]; rfl + +def put_r_rec : PartList → Nat → Stack → Stack + | [], k, s => push_stack 1 3 (k * 3 - 2) s + | (bit, m) :: rest, k, s => + if m = 0 then + put_r_rec rest k s + else if k ≤ m then + push_stack (if bit then 0 else 1) (if bit then 1 else 3) (m * 3 - 2) s + else + push_stack (if bit then 0 else 1) (if bit then 1 else 3) (m * 3) (put_r_rec rest (k - m) s) + +def put_r_stack (xs : PartList) (k : Nat) (s : Stack) : Stack := + put_r_rec xs k s + +theorem put_r_rec_sound (xs : PartList) (k : Nat) (s : Stack) + (hk : 1 ≤ k) (hbs : bsize_parts xs ≤ k) : + stack_to_tape (put_r_rec xs k s) = + MC (k - 1) (eval_lsb xs) (stack_to_tape s) := by + induction xs generalizing k with + | nil => + simp only [put_r_rec, eval_lsb] + have hk1 : k = (k - 1) + 1 := by omega + conv_lhs => rw [hk1] + exact push_rd_base false (k - 1) s + | cons p rest ih => + rcases p with ⟨bit, m⟩ + simp only [bsize_parts, eval_lsb] at hbs ⊢ + by_cases hm0 : m = 0 + · subst hm0 + have h0 : (if bit then 2 ^ 0 - 1 else 0) + eval_lsb rest * 2 ^ 0 = eval_lsb rest := by + cases bit <;> simp + simp only [put_r_rec, ↓reduceIte, h0] + exact ih k hk (by omega) + · by_cases hkm : k ≤ m + · simp only [put_r_rec, hm0, hkm, ↓reduceIte] + have heq : m = k := by omega + have hrest0 : bsize_parts rest = 0 := by omega + have hlt := eval_lsb_lt rest + rw [hrest0] at hlt + have heval0 : eval_lsb rest = 0 := by omega + subst heq + rw [heval0, Nat.zero_mul, Nat.add_zero] + have hk1 : m = (m - 1) + 1 := by omega + have hbase := push_rd_base bit (m - 1) s + rw [← hk1] at hbase + exact hbase + · simp only [put_r_rec, hm0, hkm, ↓reduceIte] + rw [push_rd, ih (k - m) (by omega) (by omega), ← MC_part] + have hlen : k - m - 1 + m = k - 1 := by omega + rw [hlen] + +def parse_step_l (limit : Nat) (s : Stack) : Option (Bool × Nat × Stack) := + match s with + | [] => none + | top :: rest => + if (top.width == 1 && top.pat == 1 && 4 ≤ top.len) = true then + let k := min limit (top.len / 4) + some (false, k, drop_stack (k * 4) (top :: rest)) + else if (top.width == 4 && top.pat == 14 && 4 ≤ top.len) = true then + let k := min limit (top.len / 4) + some (true, k, drop_stack (k * 4) (top :: rest)) + else + match pop_word 15 4 (top :: rest) with + | some s1 => some (false, 1, s1) + | none => + match pop_word 14 4 (top :: rest) with + | some s1 => some (true, 1, s1) + | none => none + +theorem parse_step_l_sound (limit : Nat) (s s1 : Stack) (bit : Bool) (k : Nat) + (h : parse_step_l limit s = some (bit, k, s1)) : + stack_to_tape s = ((if bit then ld0 else ld1) ^ k) +> stack_to_tape s1 := by + cases s with + | nil => simp [parse_step_l] at h + | cons top rest => + simp only [parse_step_l] at h + split_ifs at h with h0 h1 + · simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + simp only [Bool.and_eq_true, beq_iff_eq, decide_eq_true_eq] at h0 + have hdiv : min limit (top.len / 4) ≤ top.len / 4 := Nat.min_le_right _ _ + have hmul : min limit (top.len / 4) * 4 ≤ top.len := + Nat.le_trans (Nat.mul_le_mul_right 4 hdiv) (Nat.div_mul_le_self top.len 4) + rw [drop_stack_top_le top rest _ hmul, h0.1.1, h0.1.2] + exact expand_pat_bulk 1 1 15 4 (min limit (top.len / 4)) _ rfl rfl + · simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + simp only [Bool.and_eq_true, beq_iff_eq, decide_eq_true_eq] at h1 + have hdiv : min limit (top.len / 4) ≤ top.len / 4 := Nat.min_le_right _ _ + have hmul : min limit (top.len / 4) * 4 ≤ top.len := + Nat.le_trans (Nat.mul_le_mul_right 4 hdiv) (Nat.div_mul_le_self top.len 4) + rw [drop_stack_top_le top rest _ hmul, h1.1.1, h1.1.2] + exact expand_pat_bulk 4 14 14 4 (min limit (top.len / 4)) _ rfl rfl + · cases h15 : pop_word 15 4 (top :: rest) with + | some s' => + rw [h15] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + simpa using! pop_word_sound 15 4 (top :: rest) s' h15 + | none => + rw [h15] at h + cases h14 : pop_word 14 4 (top :: rest) with + | some s' => + rw [h14] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + simpa using! pop_word_sound 14 4 (top :: rest) s' h14 + | none => + rw [h14] at h + contradiction + +def parse_l : Nat → Nat → Stack → PartList × Stack + | 0, _, s => ([], s) + | fuel + 1, limit, s => + if limit = 0 then ([], s) + else + match parse_step_l limit s with + | none => ([], s) + | some (bit, k, s1) => + with_prod (parse_l fuel (limit - k) s1) (fun res => + with_list res.1 (fun r1 => + with_stack res.2 (fun r2 => + if !bit && r1.isEmpty then + ([], s) + else + ((bit, k) :: r1, r2)))) + +theorem parse_l_sound (fuel limit : Nat) (s : Stack) : + stack_to_tape s = + z0o ld0 ld1 (bsize_parts (parse_l fuel limit s).1) (eval_lsb (parse_l fuel limit s).1) + (stack_to_tape (parse_l fuel limit s).2) := by + induction fuel generalizing limit s with + | zero => rfl + | succ fuel ih => + by_cases hlim : limit = 0 + · simp [parse_l, hlim]; rfl + · simp only [parse_l, hlim, ↓reduceIte, with_prod_eq, with_list_eq, with_stack_eq] + cases hstep : parse_step_l limit s with + | none => rfl + | some val => + rcases val with ⟨bit, k, s1⟩ + dsimp only + split_ifs with he + · rfl + · simp only [bsize_parts, eval_lsb, z0o_part, ← ih (limit - k) s1] + exact parse_step_l_sound limit s s1 bit k hstep + +def parse_step_r (limit : Nat) (s : Stack) : Option (Bool × Nat × Stack) := + match s with + | [] => none + | top :: rest => + if (top.width == 3 && top.pat == 1 && 3 ≤ top.len) = true then + let k := min limit (top.len / 3) + some (false, k, drop_stack (k * 3) (top :: rest)) + else if (top.width == 1 && top.pat == 0 && 3 ≤ top.len) = true then + let k := min limit (top.len / 3) + some (true, k, drop_stack (k * 3) (top :: rest)) + else + match pop_word 1 3 (top :: rest) with + | some s1 => some (false, 1, s1) + | none => + match pop_word 0 3 (top :: rest) with + | some s1 => some (true, 1, s1) + | none => none + +theorem parse_step_r_sound (limit : Nat) (s s1 : Stack) (bit : Bool) (k : Nat) + (hlim : 1 ≤ limit) (h : parse_step_r limit s = some (bit, k, s1)) : + 1 ≤ k ∧ stack_to_tape s = ((if bit then rd0 else rd1) ^ k) +> stack_to_tape s1 := by + cases s with + | nil => simp [parse_step_r] at h + | cons top rest => + simp only [parse_step_r] at h + split_ifs at h with h0 h1 + · simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + simp only [Bool.and_eq_true, beq_iff_eq, decide_eq_true_eq] at h0 + have hdiv : min limit (top.len / 3) ≤ top.len / 3 := Nat.min_le_right _ _ + have hmul : min limit (top.len / 3) * 3 ≤ top.len := + Nat.le_trans (Nat.mul_le_mul_right 3 hdiv) (Nat.div_mul_le_self top.len 3) + refine ⟨by omega, ?_⟩ + rw [drop_stack_top_le top rest _ hmul, h0.1.1, h0.1.2] + exact expand_pat_bulk 3 1 1 3 (min limit (top.len / 3)) _ rfl rfl + · simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + simp only [Bool.and_eq_true, beq_iff_eq, decide_eq_true_eq] at h1 + have hdiv : min limit (top.len / 3) ≤ top.len / 3 := Nat.min_le_right _ _ + have hmul : min limit (top.len / 3) * 3 ≤ top.len := + Nat.le_trans (Nat.mul_le_mul_right 3 hdiv) (Nat.div_mul_le_self top.len 3) + refine ⟨by omega, ?_⟩ + rw [drop_stack_top_le top rest _ hmul, h1.1.1, h1.1.2] + exact expand_pat_bulk 1 0 0 3 (min limit (top.len / 3)) _ rfl rfl + · cases h01 : pop_word 1 3 (top :: rest) with + | some s' => + rw [h01] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + exact ⟨by omega, by simpa using! pop_word_sound 1 3 (top :: rest) s' h01⟩ + | none => + rw [h01] at h + cases h00 : pop_word 0 3 (top :: rest) with + | some s' => + rw [h00] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + exact ⟨by omega, by simpa using! pop_word_sound 0 3 (top :: rest) s' h00⟩ + | none => + rw [h00] at h + contradiction + +def parse_r : Nat → Nat → Stack → PartList × Stack + | 0, _, s => ([], s) + | fuel + 1, limit, s => + if limit = 0 then ([], s) + else + match s with + | [] => ([(true, limit)], []) + | top :: rest => + match parse_step_r limit (top :: rest) with + | none => + with_prod (pop1 (top :: rest)) (fun p => + if p.1 = 0 then + with_stack p.2 (fun p2 => ([(true, 1)], p2)) + else + ([], top :: rest)) + | some (bit, k, s1) => + with_prod (parse_r fuel (limit - k) s1) (fun res => + with_list res.1 (fun r1 => + with_stack res.2 (fun r2 => + if r1.isEmpty then + if bit then + with_stack (push_stack 0 1 2 s1) (fun r2' => ([(true, k)], r2')) + else + ([], top :: rest) + else + ((bit, k) :: r1, r2)))) + +theorem rd0_default (n : Nat) : (rd0 ^ n) +> (default : zB) = default := by + induction n with + | zero => rfl + | succ n ih => simp [z0j, rd0, ih] + +theorem parse_r_sound (fuel limit : Nat) (s : Stack) + (hne : (parse_r fuel limit s).1 ≠ []) : + 1 ≤ bsize_parts (parse_r fuel limit s).1 ∧ + stack_to_tape s = + MC (bsize_parts (parse_r fuel limit s).1 - 1) (eval_lsb (parse_r fuel limit s).1) + (stack_to_tape (parse_r fuel limit s).2) := by + induction fuel generalizing limit s with + | zero => simp [parse_r] at hne + | succ fuel ih => + by_cases hlim : limit = 0 + · simp [parse_r, hlim] at hne + · cases s with + | nil => + simp only [parse_r, hlim, ↓reduceIte, bsize_parts, eval_lsb, Nat.add_zero, Nat.zero_mul, + stack_to_tape] + refine ⟨by omega, ?_⟩ + have hlim_eq : limit = (limit - 1) + 1 := by omega + conv_rhs => rw [hlim_eq] + simp only [Nat.add_sub_cancel, MC_base_1 (limit - 1)] + simp [rd0_default] + | cons top rest => + simp only [parse_r, hlim, ↓reduceIte, with_prod_eq, with_list_eq, with_stack_eq] at hne ⊢ + cases hstep : parse_step_r limit (top :: rest) with + | none => + rw [hstep] at hne + dsimp only at hne ⊢ + by_cases hp0 : (pop1 (top :: rest)).1 = 0 + · simp only [hp0, ↓reduceIte, bsize_parts, eval_lsb, MC] + refine ⟨by omega, ?_⟩ + rw [pop1_sound (top :: rest), hp0]; rfl + · simp [hp0] at hne + | some val => + rcases val with ⟨bit, k, s1⟩ + rw [hstep] at hne + dsimp only at hne ⊢ + rcases parse_step_r_sound limit (top :: rest) s1 bit k (by omega) hstep with ⟨hk1, hseq⟩ + by_cases he : (parse_r fuel (limit - k) s1).1.isEmpty + · by_cases hbit : bit + · subst hbit + simp only [he, ↓reduceIte, bsize_parts, eval_lsb, Nat.add_zero, Nat.zero_mul] + refine ⟨hk1, ?_⟩ + have hk_eq : k = (k - 1) + 1 := by omega + conv_rhs => rw [hk_eq] + simp only [Nat.add_sub_cancel, MC_base_1 (k - 1)] + rw [push_stack_sound, expand_pat_word] + change stack_to_tape (top :: rest) = (rd0 ^ (k - 1)) +> [0] +> [0, 0] +> stack_to_tape s1 + have hrd : [0] +> [0, 0] +> stack_to_tape s1 = rd0 +> stack_to_tape s1 := rfl + rw [hrd, ← append_assoc, z0l, ← hk_eq, hseq]; rfl + · simp [he, hbit] at hne + · simp only [he, Bool.false_eq_true, ↓reduceIte, bsize_parts, eval_lsb] + have hne_res : (parse_r fuel (limit - k) s1).1 ≠ [] := by + intro hc; simp [hc] at he + rcases ih (limit - k) s1 hne_res with ⟨hbs1, hmc⟩ + refine ⟨by omega, ?_⟩ + have hsub : k + bsize_parts (parse_r fuel (limit - k) s1).1 - 1 = + (bsize_parts (parse_r fuel (limit - k) s1).1 - 1) + k := by omega + rw [hsub, MC_part, ← hmc, hseq] + +-- Subtractor & soundness +def subbit (a b borrow : Bool) : Bool × Bool := + (xor (xor a b) borrow, (!a && (b || borrow)) || (b && borrow)) + +def next_x (px : Bool) (kx n : Nat) (xs : PartList) : PartList := + if n < kx then (px, kx - n) :: xs else xs + +def next_y (n : Nat) : PartList → PartList + | [] => [] + | (q, l) :: yrest => if n < l then (q, l - n) :: yrest else yrest + +def head_q : PartList → Bool + | [] => false + | (q, _) :: _ => q + +def head_l (kx : Nat) : PartList → Nat + | [] => kx + | (_, l) :: _ => l + +def sub_chunk_c (px qy c : Bool) (n : Nat) : Bool := + if 1 < n then (subbit px qy (subbit px qy c).2).2 else (subbit px qy c).2 + +def sub_chunk_out (px qy c : Bool) (n : Nat) (out : PartList) : PartList := + cons_lsb (subbit px qy c).1 1 + (if 1 < n then cons_lsb (subbit px qy (subbit px qy c).2).1 (n - 1) out else out) + +def sub_lsb : Nat → Bool → PartList → PartList → Option PartList + | 0, _, _, _ => none + | _ + 1, c, [], ys => + if ys.isEmpty && !c then some [] else none + | fuel + 1, c, (px, kx) :: xs, ys => + let qy := head_q ys + let ly := head_l kx ys + with_nat (min kx ly) (fun n => + with_list (next_x px kx n xs) (fun nx => + with_list (next_y n ys) (fun ny => + if n = 0 then + sub_lsb fuel c nx ny + else + match sub_lsb fuel (sub_chunk_c px qy c n) nx ny with + | none => none + | some out => some (sub_chunk_out px qy c n out)))) + +theorem eval_split_part (p : Bool) (k n : Nat) (rest : PartList) (hn : n ≤ k) : + eval_lsb ((p, k) :: rest) = + (if p then 2 ^ n - 1 else 0) + eval_lsb (next_x p k n rest) * 2 ^ n := by + unfold next_x + by_cases hlt : n < k + · simp only [hlt, ↓reduceIte, eval_lsb, Nat.add_mul, Nat.mul_assoc, ← Nat.pow_add] + have hk : k - n + n = k := by omega + rw [hk] + cases p + · simp + · simp only [↓reduceIte] + have hp1 := z0v n + have hp2 := z0v (k - n) + have hpow : 2 ^ (k - n) * 2 ^ n = 2 ^ k := by rw [← Nat.pow_add, hk] + have hle : 2 ^ n ≤ 2 ^ k := by rw [← hpow]; exact Nat.le_mul_of_pos_left _ hp2 + have hd : (2 ^ (k - n) - 1) * 2 ^ n = 2 ^ k - 2 ^ n := by + rw [Nat.sub_mul, Nat.one_mul, hpow] + rw [hd]; omega + · have heq : k = n := by omega + subst heq + simp [hlt, eval_lsb] + +theorem bsize_sub_chunk_out (px qy c : Bool) (n : Nat) (out : PartList) (hn : 1 ≤ n) : + bsize_parts (sub_chunk_out px qy c n out) ≤ n + bsize_parts out := by + unfold sub_chunk_out + have h1 := bsize_cons_lsb_le (subbit px qy c).1 1 + (if 1 < n then cons_lsb (subbit px qy (subbit px qy c).2).1 (n - 1) out else out) + have h2 : bsize_parts (if 1 < n then cons_lsb (subbit px qy (subbit px qy c).2).1 (n - 1) out else out) ≤ + (n - 1) + bsize_parts out := by + by_cases h1n : 1 < n + · simp only [h1n, ↓reduceIte] + exact bsize_cons_lsb_le _ (n - 1) out + · simp only [h1n, ↓reduceIte] + omega + omega + +theorem eval_sub_chunk_out (px qy c : Bool) (n : Nat) (out : PartList) (hn : 1 ≤ n) : + eval_lsb (sub_chunk_out px qy c n out) + (if qy then 2 ^ n - 1 else 0) + (if c then 1 else 0) = + (if px then 2 ^ n - 1 else 0) + + (eval_lsb out + (if sub_chunk_c px qy c n then 1 else 0)) * 2 ^ n := by + unfold sub_chunk_out sub_chunk_c + rw [eval_cons_lsb] + have hpos := z0v (n - 1) + have hpow : 2 ^ n = 2 ^ (n - 1) * 2 := by + have hn1 : n = (n - 1) + 1 := by omega + conv_lhs => rw [hn1, Nat.pow_succ] + by_cases h1n : 1 < n + · simp only [h1n, ↓reduceIte, eval_cons_lsb] + have hmul : ((if (subbit px qy (subbit px qy c).2).1 then 2 ^ (n - 1) - 1 else 0) + + eval_lsb out * 2 ^ (n - 1)) * 2 ^ 1 = + (if (subbit px qy (subbit px qy c).2).1 then 2 ^ (n - 1) - 1 else 0) * 2 + + eval_lsb out * 2 ^ n := by + simp only [Nat.pow_one, Nat.add_mul, Nat.mul_assoc, ← hpow] + have hmul2 : (eval_lsb out + (if (subbit px qy (subbit px qy c).2).2 then 1 else 0)) * 2 ^ n = + eval_lsb out * 2 ^ n + (if (subbit px qy (subbit px qy c).2).2 then 1 else 0) * 2 ^ n := by + rw [Nat.add_mul] + rw [hmul, hmul2] + cases px <;> cases qy <;> cases c <;> dsimp [subbit] <;> omega + · have hn_eq : n = 1 := by omega + subst hn_eq + simp only [Nat.lt_irrefl, ↓reduceIte, Nat.pow_one] + have hmul2 : (eval_lsb out + (if (subbit px qy c).2 then 1 else 0)) * 2 = + eval_lsb out * 2 + (if (subbit px qy c).2 then 1 else 0) * 2 := by + rw [Nat.add_mul] + rw [hmul2] + cases px <;> cases qy <;> cases c <;> dsimp [subbit] <;> omega + +theorem sub_lsb_sound (fuel : Nat) (c : Bool) (xs ys out : PartList) + (h : sub_lsb fuel c xs ys = some out) : + bsize_parts out ≤ bsize_parts xs ∧ + eval_lsb out + eval_lsb ys + (if c then 1 else 0) = eval_lsb xs := by + induction fuel generalizing c xs ys out with + | zero => simp [sub_lsb] at h + | succ fuel ih => + cases xs with + | nil => + simp only [sub_lsb] at h + split_ifs at h with hyc + simp only [Option.some.injEq] at h + subst h + cases ys <;> cases c <;> simp [eval_lsb, bsize_parts] at hyc ⊢ + | cons xhead xrest => + rcases xhead with ⟨px, kx⟩ + simp only [sub_lsb, with_nat_eq, with_list_eq] at h + have hn_kx : min kx (head_l kx ys) ≤ kx := Nat.min_le_left kx (head_l kx ys) + have hsplit_x : eval_lsb ((px, kx) :: xrest) = + (if px then 2 ^ (min kx (head_l kx ys)) - 1 else 0) + + eval_lsb (next_x px kx (min kx (head_l kx ys)) xrest) * 2 ^ (min kx (head_l kx ys)) := + eval_split_part px kx (min kx (head_l kx ys)) xrest hn_kx + have hsplit_y : eval_lsb ys = + (if head_q ys then 2 ^ (min kx (head_l kx ys)) - 1 else 0) + + eval_lsb (next_y (min kx (head_l kx ys)) ys) * 2 ^ (min kx (head_l kx ys)) := by + cases ys with + | nil => simp [head_q, next_y, eval_lsb] + | cons yh yr => + rcases yh with ⟨q, l⟩ + exact eval_split_part q l (min kx l) yr (Nat.min_le_right kx l) + have hbs_nx : min kx (head_l kx ys) + bsize_parts (next_x px kx (min kx (head_l kx ys)) xrest) = + bsize_parts ((px, kx) :: xrest) := by + dsimp [next_x, bsize_parts] + split_ifs with hlt <;> simp [bsize_parts] <;> omega + by_cases hn0 : min kx (head_l kx ys) = 0 + · rw [if_pos hn0] at h + rcases ih c (next_x px kx (min kx (head_l kx ys)) xrest) (next_y (min kx (head_l kx ys)) ys) out h with ⟨hbs_out, heval_out⟩ + rw [hn0] at hsplit_x hsplit_y hbs_nx hbs_out heval_out + simp only [Nat.pow_zero, Nat.sub_self, ite_self, Nat.zero_add, Nat.mul_one] at hsplit_x hsplit_y hbs_nx + exact ⟨by omega, by omega⟩ + · rw [if_neg hn0] at h + cases hrec : sub_lsb fuel (sub_chunk_c px (head_q ys) c (min kx (head_l kx ys))) + (next_x px kx (min kx (head_l kx ys)) xrest) (next_y (min kx (head_l kx ys)) ys) with + | none => rw [hrec] at h; contradiction + | some out_rec => + rw [hrec] at h + simp only [Option.some.injEq] at h + subst h + rcases ih (sub_chunk_c px (head_q ys) c (min kx (head_l kx ys))) + (next_x px kx (min kx (head_l kx ys)) xrest) (next_y (min kx (head_l kx ys)) ys) out_rec hrec with ⟨hbs_rec, heval_rec⟩ + have hn1 : 1 ≤ min kx (head_l kx ys) := by omega + have hbs1 := bsize_sub_chunk_out px (head_q ys) c (min kx (head_l kx ys)) out_rec hn1 + have hev1 := eval_sub_chunk_out px (head_q ys) c (min kx (head_l kx ys)) out_rec hn1 + have h_assoc : eval_lsb out_rec + (if sub_chunk_c px (head_q ys) c (min kx (head_l kx ys)) then 1 else 0) + + eval_lsb (next_y (min kx (head_l kx ys)) ys) = + eval_lsb out_rec + eval_lsb (next_y (min kx (head_l kx ys)) ys) + + (if sub_chunk_c px (head_q ys) c (min kx (head_l kx ys)) then 1 else 0) := by omega + have hmul_rec : (eval_lsb out_rec + (if sub_chunk_c px (head_q ys) c (min kx (head_l kx ys)) then 1 else 0)) * + 2 ^ (min kx (head_l kx ys)) + + eval_lsb (next_y (min kx (head_l kx ys)) ys) * 2 ^ (min kx (head_l kx ys)) = + eval_lsb (next_x px kx (min kx (head_l kx ys)) xrest) * 2 ^ (min kx (head_l kx ys)) := by + rw [← Nat.add_mul, h_assoc, heval_rec] + exact ⟨by omega, by omega⟩ + +-- ============================================================================ +-- Section 3: Macro Step Engine (step_m / run_m) & Soundness +-- ============================================================================ + +structure MState where + q : Fin 6 + l : Stack + r : Stack + deriving DecidableEq + +def mstate_to_cfg (s : MState) : Cfg (Fin 2) (Fin 6) := + (stack_to_tape s.l) {{s.q}}> (stack_to_tape s.r) + +theorem cfg_right_eq_left (q : Fin 6) (b : Fin 2) (l r : zB) : + (l {{q}}> (b >> r)) = ((b >> l) <{{q}} r) := by + simp [Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] + +def choose_limit_r_loop (n : Nat) : Nat → Nat → Stack → Nat + | 0, _, _ => n + 1 + | _ + 1, done, [] => if done ≤ n then n + 1 else done + 1 + | fuel + 1, done, top :: rest => + if (top.width == 3 && top.pat == 1 && 3 ≤ top.len) = true then + let div := top.len / 3 + choose_limit_r_loop n fuel (done + div) (drop_stack (div * 3) (top :: rest)) + else if (top.width == 1 && top.pat == 0 && 3 ≤ top.len) = true then + let div := top.len / 3 + let next_done := done + div + if n < next_done then + min (max (n + 2) (done + 2)) next_done + else + choose_limit_r_loop n fuel next_done (drop_stack (div * 3) (top :: rest)) + else + match pop_word 1 3 (top :: rest) with + | some r1 => choose_limit_r_loop n fuel (done + 1) r1 + | none => + match pop_word 0 3 (top :: rest) with + | some r1 => + if n < done + 1 then done + 1 + else choose_limit_r_loop n fuel (done + 1) r1 + | none => + if (pop1 (top :: rest)).1 = 0 then done + 1 else done + +def choose_limit_r (kfuel : Nat) (n : Nat) (r : Stack) : Nat := + choose_limit_r_loop n kfuel 0 r + +def push_prefix_l (l : Stack) : Stack := + push_stack 1 1 1 (push_stack 0 1 1 (push_stack 1 1 3 l)) + +theorem push_prefix_l_sound (l : Stack) : + stack_to_tape (push_prefix_l l) = [1, 0, 1, 1, 1] +> stack_to_tape l := by + unfold push_prefix_l + rw [push_stack_sound, push_stack_sound, push_stack_sound] + rfl + +def build_vprime (n m_use : Nat) : PartList := + let v0 : PartList := if 1 < m_use then cons_lsb true (m_use - 1) [] else [] + let v1 : PartList := if 1 < m_use then cons_lsb false n v0 else v0 + cons_lsb true 1 v1 + +theorem eval_build_vprime (n m' : Nat) : + eval_lsb (build_vprime n (m' + 1)) = 1 + (2 ^ m' - 1) * 2 ^ (n + 1) := by + unfold build_vprime + dsimp only + by_cases h1 : 1 < m' + 1 + · simp only [h1, ↓reduceIte, eval_cons_lsb, eval_lsb, Nat.add_sub_cancel, + Nat.mul_zero, Nat.zero_mul, Nat.add_zero, Bool.false_eq_true, Nat.zero_add, Nat.pow_one] + rw [Nat.mul_assoc, ← Nat.pow_succ] + · have hm0 : m' = 0 := by omega + subst hm0 + simp [eval_cons_lsb, eval_lsb] + +def some_mstate (q : Fin 6) (l r : Stack) : Option MState := + with_nat q.val (fun _ => + with_stack l (fun l' => + with_stack r (fun r' => + some ⟨q, l', r'⟩))) + +@[simp] theorem some_mstate_eq (q : Fin 6) (l r : Stack) : + some_mstate q l r = some ⟨q, l, r⟩ := by + simp [some_mstate] + +def do_shift_right (sq : Fin 6) (sw sin sout sout_w : Nat) (s : MState) : Option MState := + if s.q = sq then + let target2 := sin + sin * (2 ^ sw) + if (pop_word target2 (2 * sw) s.r).isSome then + with_prod (count_stack_mut sin sw 8 100000000 s.r) (fun res => + let l' := push_stack sout sout_w (res.1 * sw) s.l + some_mstate sq l' res.2) + else none + else none + +theorem do_shift_right_sound (sq : Fin 6) (sw sin sout sout_w pat_out : Nat) (s s' : MState) + (hrot : rot_k sout_w sw sout = sout) + (hw : pat_word sout_w sout sw = word_of pat_out sw) + (hsh : ∀ (n : Nat) (l r : zB), + (l {{sq}}> (((word_of sin sw) ^ n) +> r)) [tm15]⊢* + ((((word_of pat_out sw) ^ n) +> l) {{sq}}> r)) + (h : do_shift_right sq sw sin sout sout_w s = some s') : + (mstate_to_cfg s) [tm15]⊢* (mstate_to_cfg s') := by + unfold do_shift_right at h + simp only [with_prod_eq] at h + split_ifs at h with hq hpw + simp only [some_mstate_eq, Option.some.injEq] at h + subst h + rcases count_stack_mut_sound sin sw 8 100000000 s.r with ⟨_, hcnt⟩ + unfold mstate_to_cfg + dsimp only + rw [hq, hcnt, push_stack_sound, expand_pat_bulk sout_w sout pat_out sw _ _ hrot hw] + exact hsh _ _ _ + +def bit_pat (b : Fin 2) : Nat := if b = 1 then 1 else 0 + +theorem push_bit_sound (b : Fin 2) (s : Stack) : + stack_to_tape (push_stack (bit_pat b) 1 1 s) = b >> stack_to_tape s := by + rw [push_stack_sound] + rcases b with ⟨_ | _ | b, hb⟩ <;> try rfl + omega + +def do_shift_left (sq : Fin 6) (sw sin sout sout_w : Nat) (s : MState) : Option MState := + if s.q = sq then + let target2 := sin + sin * (2 ^ sw) + with_prod (pop1 s.r) (fun p_r => + if (p_r.1 == bit_of target2 && (pop_word (target2 / 2) (2 * sw - 1) s.l).isSome) = true then + let l1 := push_stack (bit_pat p_r.1) 1 1 s.l + with_prod (count_stack_mut sin sw 8 100000000 l1) (fun res => + with_prod (pop1 res.2) (fun p_l => + let r1 := push_stack sout sout_w (res.1 * sw) p_r.2 + let r2 := push_stack (bit_pat p_l.1) 1 1 r1 + some_mstate sq p_l.2 r2)) + else none) + else none + +theorem do_shift_left_sound (sq : Fin 6) (sw sin sout sout_w pat_out : Nat) (s s' : MState) + (hrot : rot_k sout_w sw sout = sout) + (hw : pat_word sout_w sout sw = word_of pat_out sw) + (hsh : ∀ (n : Nat) (l r : zB), + ((((word_of sin sw) ^ n) +> l) <{{sq}} r) [tm15]⊢* + (l <{{sq}} (((word_of pat_out sw) ^ n) +> r))) + (h : do_shift_left sq sw sin sout sout_w s = some s') : + (mstate_to_cfg s) [tm15]⊢* (mstate_to_cfg s') := by + unfold do_shift_left at h + simp only [with_prod_eq] at h + split_ifs at h with hq hguard + simp only [some_mstate_eq, Option.some.injEq] at h + subst h + let l1 := push_stack (bit_pat (pop1 s.r).1) 1 1 s.l + let res := count_stack_mut sin sw 8 100000000 l1 + rcases count_stack_mut_sound sin sw 8 100000000 l1 with ⟨_, hcnt⟩ + unfold mstate_to_cfg + dsimp only + rw [hq, pop1_sound s.r, cfg_right_eq_left, ← push_bit_sound (pop1 s.r).1 s.l] + change (stack_to_tape l1 <{{sq}} stack_to_tape (pop1 s.r).2) [tm15]⊢* _ + rw [hcnt, push_bit_sound (pop1 res.2).1, cfg_right_eq_left, ← pop1_sound res.2, + push_stack_sound, expand_pat_bulk sout_w sout pat_out sw _ _ hrot hw] + exact hsh _ _ _ + +def try_pair_stack (kfuel : Nat) (s : MState) : Option MState := + if s.q = 0 then + match pop_word 29 5 s.l with + | none => none + | some lc => + with_prod (parse_l kfuel 100000000 lc) (fun res_l => + with_list res_l.1 (fun a => + if a.isEmpty then none + else + with_nat (bsize_parts a) (fun n => + with_nat (choose_limit_r kfuel n s.r) (fun lim_r => + if lim_r = 0 then none + else + with_prod (parse_r kfuel lim_r s.r) (fun res_r => + with_list res_r.1 (fun b => + if b.isEmpty then none + else + with_nat (bsize_parts b) (fun k => + match sub_lsb kfuel false a b with + | some out => + let l1 := push_prefix_l (put_l_stack out n res_l.2) + let r1 := put_r_stack [] k res_r.2 + some_mstate 0 l1 r1 + | none => + match sub_lsb kfuel false b a with + | some out => + let l1 := push_prefix_l (put_l_stack [] n res_l.2) + let r1 := put_r_stack out k res_r.2 + some_mstate 0 l1 r1 + | none => none))))))) + else none + +theorem try_pair_stack_sound (kfuel : Nat) (s s' : MState) (h : try_pair_stack kfuel s = some s') : + (mstate_to_cfg s) [tm15]⊢* (mstate_to_cfg s') := by + unfold try_pair_stack at h + split_ifs at h with hq + cases hpw : pop_word 29 5 s.l with + | none => rw [hpw] at h; contradiction + | some lc => + rw [hpw] at h + simp only [with_prod_eq, with_list_eq, with_nat_eq] at h + split_ifs at h with ha_empty hlim0 hb_empty + have hpw_eq := pop_word_sound 29 5 s.l lc hpw + have hw29 : word_of 29 5 = [1, 0, 1, 1, 1] := rfl + rw [hw29] at hpw_eq + have hpl := parse_l_sound kfuel 100000000 lc + let a := (parse_l kfuel 100000000 lc).1 + let lc1 := (parse_l kfuel 100000000 lc).2 + let n := bsize_parts a + let b := (parse_r kfuel (choose_limit_r kfuel n s.r) s.r).1 + let rc1 := (parse_r kfuel (choose_limit_r kfuel n s.r) s.r).2 + let k := bsize_parts b + have hne_b : b ≠ [] := by + dsimp [b, n, a] + intro hc; simp [hc] at hb_empty + rcases parse_r_sound kfuel (choose_limit_r kfuel n s.r) s.r hne_b with ⟨hk1, hpr⟩ + have hal := eval_lsb_lt a + have hbl := eval_lsb_lt b + have hk_eq : k - 1 + 1 = k := by dsimp [k, b] at hk1 ⊢; omega + cases hsub1 : sub_lsb kfuel false a b with + | some out => + rw [hsub1] at h; simp only [some_mstate_eq, Option.some.injEq] at h; subst h + rcases sub_lsb_sound kfuel false a b out hsub1 with ⟨hbs_out, heval_out⟩ + simp only [Bool.false_eq_true, ↓reduceIte, Nat.add_zero] at heval_out + unfold mstate_to_cfg; dsimp only + rw [hq, hpw_eq, hpl, hpr, push_prefix_l_sound, put_l_stack_sound out n lc1 hbs_out, + put_r_stack, put_r_rec_sound [] k rc1 hk1 (by simp [bsize_parts])] + change (z0V (z0o ld0 ld1 n (eval_lsb a) (stack_to_tape lc1)) + (MC (k - 1) (eval_lsb b) (stack_to_tape rc1))) [tm15]⊢* + (z0V (z0o ld0 ld1 n (eval_lsb out) (stack_to_tape lc1)) + (MC (k - 1) 0 (stack_to_tape rc1))) + have hpg := pair_general n (eval_lsb out) (k - 1) 0 (eval_lsb b) (stack_to_tape lc1) (stack_to_tape rc1) + (by dsimp [n] at hal ⊢; omega) (by rw [hk_eq]; dsimp [k] at hbl ⊢; omega) + rw [heval_out, Nat.zero_add] at hpg + exact hpg + | none => + rw [hsub1] at h; dsimp only at h + cases hsub2 : sub_lsb kfuel false b a with + | none => rw [hsub2] at h; contradiction + | some out => + rw [hsub2] at h; simp only [some_mstate_eq, Option.some.injEq] at h; subst h + rcases sub_lsb_sound kfuel false b a out hsub2 with ⟨hbs_out, heval_out⟩ + simp only [Bool.false_eq_true, ↓reduceIte, Nat.add_zero] at heval_out + unfold mstate_to_cfg; dsimp only + rw [hq, hpw_eq, hpl, hpr, push_prefix_l_sound, + put_l_stack_sound [] n lc1 (by simp [bsize_parts]), + put_r_stack, put_r_rec_sound out k rc1 hk1 hbs_out] + change (z0V (z0o ld0 ld1 n (eval_lsb a) (stack_to_tape lc1)) + (MC (k - 1) (eval_lsb b) (stack_to_tape rc1))) [tm15]⊢* + (z0V (z0o ld0 ld1 n 0 (stack_to_tape lc1)) + (MC (k - 1) (eval_lsb out) (stack_to_tape rc1))) + have hpg := pair_general n 0 (k - 1) (eval_lsb out) (eval_lsb a) (stack_to_tape lc1) (stack_to_tape rc1) + (by dsimp [n] at hal ⊢; omega) (by rw [hk_eq]; dsimp [k] at hbl ⊢; omega) + rw [Nat.zero_add, heval_out] at hpg + exact hpg + +def try_absorb_sub (kfuel : Nat) (n m_use : Nat) (b : PartList) : Option (Nat × PartList) := + match sub_lsb kfuel false b (build_vprime n m_use) with + | some out => some (m_use, out) + | none => + if m_use ≤ 1 then none + else + match sub_lsb kfuel false b (build_vprime n (m_use - 1)) with + | some out => some (m_use - 1, out) + | none => none + +theorem try_absorb_sub_sound (kfuel : Nat) (n m_init m_use : Nat) (b out : PartList) + (hm : 1 ≤ m_init) (h : try_absorb_sub kfuel n m_init b = some (m_use, out)) : + 1 ≤ m_use ∧ sub_lsb kfuel false b (build_vprime n m_use) = some out := by + unfold try_absorb_sub at h + cases h1 : sub_lsb kfuel false b (build_vprime n m_init) with + | some out1 => + rw [h1] at h; simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + exact ⟨hm, h1⟩ + | none => + rw [h1] at h; dsimp only at h + split_ifs at h with hle1 + cases h2 : sub_lsb kfuel false b (build_vprime n (m_init - 1)) with + | none => rw [h2] at h; contradiction + | some out2 => + rw [h2] at h; simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + exact ⟨by omega, h2⟩ + +def calc_m_init (m n k : Nat) : Nat := + min m (if n < k then k - n else 1) + +def try_absorb_stack (kfuel : Nat) (s : MState) : Option MState := + if s.q = 0 then + match pop_word 29 5 s.l with + | none => none + | some lc0 => + with_prod (count_stack_mut 15 4 kfuel 100000000 lc0) (fun res1 => + with_prod (count_stack_mut 13 4 kfuel 100000000 res1.2) (fun res_m => + if res_m.1 = 0 then none + else + with_nat (choose_limit_r kfuel (res1.1 + res_m.1) s.r) (fun lim_r => + if lim_r = 0 then none + else + with_prod (parse_r kfuel lim_r s.r) (fun res_r => + with_list res_r.1 (fun b => + if b.isEmpty then none + else + with_nat (bsize_parts b) (fun k => + with_nat (calc_m_init res_m.1 res1.1 k) (fun m_init => + if m_init = 0 then none + else + match try_absorb_sub kfuel res1.1 m_init b with + | none => none + | some (m_use, out) => + with_prod (count_stack_mut 13 4 kfuel m_use res1.2) (fun res2 => + if res2.1 = m_use then + let l_new := push_prefix_l (push_stack 14 4 ((res1.1 + res2.1) * 4) res2.2) + let r_new := put_r_stack out k res_r.2 + some_mstate 0 l_new r_new + else none)))))))) + else none + +theorem try_absorb_stack_sound (kfuel : Nat) (s s' : MState) (h : try_absorb_stack kfuel s = some s') : + (mstate_to_cfg s) [tm15]⊢* (mstate_to_cfg s') := by + unfold try_absorb_stack at h + split_ifs at h with hq + cases hpw : pop_word 29 5 s.l with + | none => rw [hpw] at h; contradiction + | some lc0 => + rw [hpw] at h + simp only [with_prod_eq, with_list_eq, with_nat_eq] at h + split_ifs at h with hm0 hlim0 hb_empty hmin0 + let res1 := count_stack_mut 15 4 kfuel 100000000 lc0 + let res_m := count_stack_mut 13 4 kfuel 100000000 res1.2 + let lim_r := choose_limit_r kfuel (res1.1 + res_m.1) s.r + let res_r := parse_r kfuel lim_r s.r + let k := bsize_parts res_r.1 + let m_init := calc_m_init res_m.1 res1.1 k + cases habs : try_absorb_sub kfuel res1.1 m_init res_r.1 with + | none => rw [habs] at h; contradiction + | some pair_out => + rcases pair_out with ⟨m_use, out⟩ + rw [habs] at h + simp only [with_prod_eq, with_list_eq, with_nat_eq] at h + split_ifs at h with hm_act + simp only [some_mstate_eq, Option.some.injEq] at h; subst h + have hmin_pos : 1 ≤ m_init := by dsimp [m_init, k, res_r, lim_r, res_m, res1] at hmin0 ⊢; omega + rcases try_absorb_sub_sound kfuel res1.1 m_init m_use res_r.1 out hmin_pos habs with ⟨hm_use1, hsub⟩ + rcases sub_lsb_sound kfuel false res_r.1 (build_vprime res1.1 m_use) out hsub with ⟨hbs_out, heval_out⟩ + simp only [Bool.false_eq_true, ↓reduceIte, Nat.add_zero] at heval_out + have hpw_eq := pop_word_sound 29 5 s.l lc0 hpw + have hw29 : word_of 29 5 = [1, 0, 1, 1, 1] := rfl + rw [hw29] at hpw_eq + rcases count_stack_mut_sound 15 4 kfuel 100000000 lc0 with ⟨_, hcnt15⟩ + have hw15 : word_of 15 4 = ld1 := rfl + rw [hw15] at hcnt15 + let res2 := count_stack_mut 13 4 kfuel m_use res1.2 + rcases count_stack_mut_sound 13 4 kfuel m_use res1.2 with ⟨_, hcnt13⟩ + have hw13 : word_of 13 4 = [1, 0, 1, 1] := rfl + rw [hw13] at hcnt13 + have hne_b : res_r.1 ≠ [] := by + dsimp [res_r, lim_r, res_m, res1] + intro hc; simp [hc] at hb_empty + rcases parse_r_sound kfuel lim_r s.r hne_b with ⟨hk1, hpr⟩ + have hbl := eval_lsb_lt res_r.1 + have hk_eq : k - 1 + 1 = k := by dsimp [k, res_r] at hk1 ⊢; omega + have hm_eq : res2.1 = (m_use - 1) + 1 := by rw [show res2.1 = m_use from hm_act]; omega + have hv_eq : eval_lsb (build_vprime res1.1 m_use) = 1 + (2 ^ (m_use - 1) - 1) * 2 ^ (res1.1 + 1) := by + have hmu : m_use = (m_use - 1) + 1 := by omega + conv_lhs => rw [hmu] + exact eval_build_vprime res1.1 (m_use - 1) + rw [hv_eq] at heval_out + unfold mstate_to_cfg; dsimp only + rw [hq, hpw_eq, hcnt15, hcnt13, hpr, push_prefix_l_sound] + have hpush14 := push_ld true (res1.1 + res2.1) res2.2 + simp only [↓reduceIte] at hpush14 + rw [hpush14, put_r_stack, put_r_rec_sound out k res_r.2 hk1 hbs_out] + change (z0V ((ld1 ^ res1.1) +> ([1, 0, 1, 1] ^ res2.1) +> stack_to_tape res2.2) + (MC (k - 1) (eval_lsb res_r.1) (stack_to_tape res_r.2))) [tm15]⊢* + (z0V ((ld0 ^ (res1.1 + res2.1)) +> stack_to_tape res2.2) + (MC (k - 1) (eval_lsb out) (stack_to_tape res_r.2))) + rw [hm_eq, ← heval_out] + exact absorb_general res1.1 (m_use - 1) (k - 1) (eval_lsb out) + (stack_to_tape res2.2) (stack_to_tape res_r.2) (by rw [hk_eq]; dsimp [k] at hbl ⊢; omega) + +def step_prim (s : MState) : Option MState := + with_prod (pop1 s.r) (fun pr => + match tm15 s.q pr.1 with + | none => none + | some (none, _) => none + | some (some q', Stmt.write w d) => + let b_bit := bit_pat w + match d with + | Dir.right => + some_mstate q' (push_stack b_bit 1 1 s.l) pr.2 + | Dir.left => + with_prod (pop1 s.l) (fun pl => + let r1 := push_stack b_bit 1 1 pr.2 + let r2 := push_stack (bit_pat pl.1) 1 1 r1 + some_mstate q' pl.2 r2)) + +theorem step_prim_sound (s s' : MState) (h : step_prim s = some s') : + (mstate_to_cfg s) [tm15]⊢* (mstate_to_cfg s') := by + unfold step_prim at h + simp only [with_prod_eq] at h + cases htm : tm15 s.q (pop1 s.r).1 with + | none => rw [htm] at h; contradiction + | some val => + rcases val with ⟨oq, stmt⟩ + cases oq with + | none => rw [htm] at h; contradiction + | some q' => + rcases stmt with ⟨w, d⟩ + rw [htm] at h + cases d with + | left => + simp only [with_prod_eq, some_mstate_eq, Option.some.injEq] at h + subst h + refine z0P tm15 _ _ ?_ + unfold mstate_to_cfg step + dsimp only + rw [pop1_sound s.r, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, htm] + dsimp [Tape.move, Tape.write] + rw [push_bit_sound (pop1 s.l).1, push_bit_sound w, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons, pop1_sound s.l, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + | right => + simp only [some_mstate_eq, Option.some.injEq] at h + subst h + refine z0P tm15 _ _ ?_ + unfold mstate_to_cfg step + dsimp only + rw [pop1_sound s.r, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, htm] + dsimp [Tape.move, Tape.write] + rw [push_bit_sound w] + +def step_m_q0 (s : MState) : Option MState := + let kbig := Nat.add (Nat.add s.l.length s.r.length) 4 + match try_pair_stack kbig s with + | some s' => some s' + | none => + match try_absorb_stack kbig s with + | some s' => some s' + | none => + match do_shift_right 0 3 1 1 1 s with + | some s' => some s' + | none => step_prim s + +def step_m_q1 (s : MState) : Option MState := + match do_shift_left 1 1 1 0 1 s with + | some s' => some s' + | none => step_prim s + +def step_m_q2 (s : MState) : Option MState := + match do_shift_left 2 2 3 1 2 s with + | some s' => some s' + | none => step_prim s + +def step_m_q3 (s : MState) : Option MState := + match do_shift_right 3 1 1 0 1 s with + | some s' => some s' + | none => + match do_shift_right 3 3 2 1 1 s with + | some s' => some s' + | none => + match do_shift_right 3 4 10 14 4 s with + | some s' => some s' + | none => + match do_shift_right 3 4 5 7 4 s with + | some s' => some s' + | none => step_prim s + +def step_m (s : MState) : Option MState := + match s.q.val with + | 0 => step_m_q0 s + | 1 => step_m_q1 s + | 2 => step_m_q2 s + | 3 => step_m_q3 s + | _ => step_prim s + +theorem step_m_sound (s s' : MState) (h : step_m s = some s') : + (mstate_to_cfg s) [tm15]⊢* (mstate_to_cfg s') := by + unfold step_m at h + rcases hq : s.q.val with _ | _ | _ | _ | n <;> rw [hq] at h + · unfold step_m_q0 at h; dsimp only at h + cases hp : try_pair_stack (Nat.add (Nat.add s.l.length s.r.length) 4) s with + | some s1 => rw [hp] at h; simp only [Option.some.injEq] at h; subst h; exact try_pair_stack_sound _ s s1 hp + | none => + rw [hp] at h; dsimp only at h + cases ha : try_absorb_stack (Nat.add (Nat.add s.l.length s.r.length) 4) s with + | some s1 => rw [ha] at h; simp only [Option.some.injEq] at h; subst h; exact try_absorb_stack_sound _ s s1 ha + | none => + rw [ha] at h; dsimp only at h + cases hs : do_shift_right 0 3 1 1 1 s with + | some s1 => rw [hs] at h; simp only [Option.some.injEq] at h; subst h; exact do_shift_right_sound 0 3 1 1 1 7 s s1 rfl rfl sh_0_sound hs + | none => rw [hs] at h; dsimp only at h; exact step_prim_sound s s' h + · unfold step_m_q1 at h + cases hs : do_shift_left 1 1 1 0 1 s with + | some s1 => rw [hs] at h; simp only [Option.some.injEq] at h; subst h; exact do_shift_left_sound 1 1 1 0 1 0 s s1 rfl rfl sh_1_sound hs + | none => rw [hs] at h; dsimp only at h; exact step_prim_sound s s' h + · unfold step_m_q2 at h + cases hs : do_shift_left 2 2 3 1 2 s with + | some s1 => rw [hs] at h; simp only [Option.some.injEq] at h; subst h; exact do_shift_left_sound 2 2 3 1 2 1 s s1 rfl rfl sh_2_sound hs + | none => rw [hs] at h; dsimp only at h; exact step_prim_sound s s' h + · unfold step_m_q3 at h + cases h3 : do_shift_right 3 1 1 0 1 s with + | some s1 => rw [h3] at h; simp only [Option.some.injEq] at h; subst h; exact do_shift_right_sound 3 1 1 0 1 0 s s1 rfl rfl sh_3_sound h3 + | none => + rw [h3] at h; dsimp only at h + cases h4 : do_shift_right 3 3 2 1 1 s with + | some s1 => rw [h4] at h; simp only [Option.some.injEq] at h; subst h; exact do_shift_right_sound 3 3 2 1 1 7 s s1 rfl rfl sh_4_sound h4 + | none => + rw [h4] at h; dsimp only at h + cases h5 : do_shift_right 3 4 10 14 4 s with + | some s1 => rw [h5] at h; simp only [Option.some.injEq] at h; subst h; exact do_shift_right_sound 3 4 10 14 4 14 s s1 rfl rfl sh_5_sound h5 + | none => + rw [h5] at h; dsimp only at h + cases h6 : do_shift_right 3 4 5 7 4 s with + | some s1 => rw [h6] at h; simp only [Option.some.injEq] at h; subst h; exact do_shift_right_sound 3 4 5 7 4 7 s s1 rfl rfl sh_6_sound h6 + | none => rw [h6] at h; dsimp only at h; exact step_prim_sound s s' h + · exact step_prim_sound s s' h + +def forceStackCPS {α : Type} : Stack → (Stack → α) → α + | [], k => k [] + | b :: rest, k => + with_block b (fun b' => + forceStackCPS rest (fun rest' => + k (b' :: rest'))) + +@[simp] theorem forceStackCPS_eq {α : Type} (s : Stack) (k : Stack → α) : forceStackCPS s k = k s := by + induction s generalizing k with + | nil => rfl + | cons b rest ih => simp only [forceStackCPS, with_block_eq, ih] + +def norm_mstate (s : MState) : MState := + with_nat s.q.val (fun _ => + forceStackCPS s.l (fun l' => + forceStackCPS s.r (fun r' => + ⟨s.q, l', r'⟩))) + +@[simp] theorem norm_mstate_eq (s : MState) : norm_mstate s = s := by + rcases s with ⟨q, l, r⟩ + simp only [norm_mstate, with_nat_eq, forceStackCPS_eq] + +def maybe_norm (fuel : Nat) (s : MState) : MState := + if fuel % 16 = 0 then norm_mstate s else s + +@[simp] theorem maybe_norm_eq (fuel : Nat) (s : MState) : maybe_norm fuel s = s := by + unfold maybe_norm; split_ifs <;> simp + +def run_m : Nat → MState → Option MState + | 0, s => some s + | fuel + 1, s => + match step_m s with + | none => none + | some s' => run_m fuel (maybe_norm fuel s') + +theorem run_m_sound (fuel : Nat) (s s' : MState) (h : run_m fuel s = some s') : + (mstate_to_cfg s) [tm15]⊢* (mstate_to_cfg s') := by + induction fuel generalizing s with + | zero => + simp [run_m] at h; subst h; exact ⟨0, rfl⟩ + | succ fuel ih => + simp only [run_m, maybe_norm_eq] at h + cases hs : step_m s with + | none => rw [hs] at h; contradiction + | some s1 => + rw [hs] at h + exact zSt (step_m_sound s s1 hs) (ih s1 h) + +def is_halt_m (s : MState) : Bool := + s.q = 5 && (pop1 s.r).1 = 1 + +theorem is_halt_m_sound (s : MState) (h : is_halt_m s = true) : + step tm15 (mstate_to_cfg s) = none := by + unfold is_halt_m at h + simp only [Bool.and_eq_true, decide_eq_true_eq] at h + rcases h with ⟨hq, hr⟩ + unfold mstate_to_cfg step + dsimp only + rw [hq, pop1_sound s.r, hr, Turing.ListBlank.head_cons] + rfl + +def cfg_0 : MState := ⟨1, [], []⟩ +theorem run_m_trans {m n : Nat} {s1 s2 s3 : MState} + (h1 : run_m m s1 = some s2) (h2 : run_m n s2 = some s3) : + run_m (m + n) s1 = some s3 := by + induction m generalizing s1 with + | zero => + simp [run_m] at h1; subst h1; simpa using! h2 + | succ m ih => + simp only [run_m, Nat.succ_add] at h1 ⊢ + cases hs : step_m s1 with + | none => simp [hs] at h1 + | some s' => simp [hs, maybe_norm_eq] at h1 ⊢; exact ih h1 + +def MReach (s1 s2 : MState) : Prop := + ∃ fuel, run_m fuel s1 = some s2 + +noncomputable def mkBlock_f_p : Nat → Nat → Nat → Block := +fun p w l => + @Nat.rec (fun _ => Block) ⟨0, 0, 0⟩ (fun p' _ => + @Nat.rec (fun _ => Block) ⟨0, 0, 0⟩ (fun w' _ => + @Nat.rec (fun _ => Block) ⟨0, 0, 0⟩ (fun l' _ => + ⟨p', w', l'⟩) (Nat.add 1 l)) (Nat.add 1 w)) (Nat.add 1 p) +noncomputable def rot1_f_p : Nat → Nat → Nat := +fun w p => Nat.add (Nat.shiftRight p 1) (Nat.mul (Nat.land p 1) (Nat.shiftLeft 1 (Nat.sub w 1))) +noncomputable def rot_mod_f_p : Nat → Nat → Nat → Nat := +fun w n p => + @Bool.rec (fun _ => Nat) + (@Bool.rec (fun _ => Nat) + (rot_k w n p) + (let r := Nat.mod n w + @Bool.rec (fun _ => Nat) + (Nat.add (Nat.shiftRight p r) (Nat.shiftLeft (Nat.land p (Nat.sub (Nat.shiftLeft 1 r) 1)) (Nat.sub w r))) + p + (Nat.beq r 0)) + (Bool.and (Nat.ble 2 w) (Bool.and (Nat.ble w 4) (Bool.and (Nat.ble p 15) (Nat.ble p (Nat.sub (Nat.shiftLeft 1 w) 1)))))) + p + (Bool.or (Nat.beq p 0) (Bool.and (Nat.beq w 1) (Nat.beq p 1))) +noncomputable def bit_of_bool_f_p : Nat → Bool := +fun x => Nat.beq (Nat.land x 1) 1 +noncomputable def push_stack_aux_f_p (mkBlock_f : Nat → Nat → Nat → Block) (rot_mod_f : Nat → Nat → Nat → Nat) : Block → Stack → Stack := +fun b s => + @List.rec Block (fun _ => Block → Stack) + (fun b => @Bool.rec (fun _ => Stack) [b] [] (Nat.beq b.pat 0)) + (fun top rest ih b => + @Bool.rec (fun _ => Stack) + (b :: top :: rest) + (ih (mkBlock_f b.pat b.width (Nat.add b.len top.len))) + (Bool.and (Nat.beq b.width top.width) (Nat.beq (rot_mod_f b.width b.len b.pat) top.pat))) + s b +noncomputable def push_stack_f_p (mkBlock_f : Nat → Nat → Nat → Block) (push_stack_aux_f : Block → Stack → Stack) : Nat → Nat → Nat → Stack → Stack := +fun pat width len s => + @Bool.rec (fun _ => Stack) (push_stack_aux_f (mkBlock_f pat width len) s) s (Nat.beq len 0) +noncomputable def drop_stack_f_p (mkBlock_f : Nat → Nat → Nat → Block) (rot_mod_f : Nat → Nat → Nat → Nat) : Nat → Stack → Stack := +fun n s => + @List.rec Block (fun _ => Nat → Stack) + (fun _ => []) + (fun top rest ih n => + @Bool.rec (fun _ => Stack) + (@Bool.rec (fun _ => Stack) + (mkBlock_f (rot_mod_f top.width n top.pat) top.width (Nat.sub top.len n) :: rest) + (ih (Nat.sub n top.len)) + (Nat.ble top.len n)) + (top :: rest) + (Nat.beq n 0)) + s n +noncomputable def pop1_b_f_p (mkBlock_f : Nat → Nat → Nat → Block) (rot1_f : Nat → Nat → Nat) (bit_of_bool_f : Nat → Bool) : Stack → Bool × Stack := +fun s => + @List.rec Block (fun _ => Bool × Stack) + (false, []) + (fun top rest ih => + @Bool.rec (fun _ => Bool × Stack) + (let bit := bit_of_bool_f top.pat + @Bool.rec (fun _ => Bool × Stack) + (bit, mkBlock_f (rot1_f top.width top.pat) top.width (Nat.sub top.len 1) :: rest) + (bit, rest) + (Nat.beq top.len 1)) + ih + (Nat.beq top.len 0)) + s +noncomputable def pop_word_f_p (bit_of_bool_f : Nat → Bool) (pop1_b_f : Stack → Bool × Stack) : Nat → Nat → Stack → Option Stack := +fun pat w s => + @Nat.rec (fun _ => Nat → Stack → Option Stack) + (fun _ s => some s) + (fun _ ih pat s => + let res := pop1_b_f s + @Bool.rec (fun _ => Option Stack) none (ih (Nat.shiftRight pat 1) res.2) + (Bool.not (Bool.xor res.1 (bit_of_bool_f pat)))) + w pat s +noncomputable def fast_match_f_p : Nat → Nat → Block → Bool := +fun pat w top => + @Bool.rec (fun _ => Bool) + (0 < w && w ≤ top.len && rot_k top.width w top.pat == top.pat && + pat_word top.width top.pat w == word_of pat w) + (Bool.and (Nat.ble w top.len) + (let mul := match top.width with | 1 => 4095 | 2 => 1365 | 3 => 585 | _ => 273 + Bool.and (Nat.beq (Nat.land (Nat.shiftRight (Nat.mul top.pat mul) w) (Nat.sub (Nat.shiftLeft 1 top.width) 1)) top.pat) + (Nat.beq (Nat.land (Nat.mul top.pat mul) (Nat.sub (Nat.shiftLeft 1 w) 1)) pat))) + (Bool.and (Nat.ble 1 w) + (Bool.and (Nat.ble w 4) + (Bool.and (Nat.ble 1 top.width) + (Bool.and (Nat.ble top.width 4) + (Bool.and (Nat.ble top.pat (Nat.sub (Nat.shiftLeft 1 top.width) 1)) + (Nat.ble pat (Nat.sub (Nat.shiftLeft 1 w) 1))))))) +noncomputable def count_stack_mut_f_p (drop_stack_f : Nat → Stack → Stack) (pop_word_f : Nat → Nat → Stack → Option Stack) (fast_match_f : Nat → Nat → Block → Bool) : Nat → Nat → Nat → Nat → Stack → Nat × Stack := +fun pat w fuel limit s => + @Nat.rec (fun _ => Nat → Stack → Nat × Stack) + (fun _ s => (0, s)) + (fun _ ih limit s => + @Bool.rec (fun _ => Nat × Stack) + (match s with + | [] => (0, []) + | top :: rest => + @Bool.rec (fun _ => Nat × Stack) + (match pop_word_f pat w (top :: rest) with + | some s1 => + let res := ih (Nat.sub limit 1) s1 + (Nat.add 1 res.1, res.2) + | none => (0, top :: rest)) + (let bulk := Nat.min limit (Nat.div top.len w) + let res := ih (Nat.sub limit bulk) (drop_stack_f (Nat.mul bulk w) (top :: rest)) + (Nat.add bulk res.1, res.2)) + (fast_match_f pat w top)) + (0, s) + (Nat.beq limit 0)) + fuel limit s +noncomputable def mkPart_f_p : Bool → Nat → PartList → PartList := +fun b k xs => + @Nat.rec (fun _ => PartList) xs (fun k' _ => + @Bool.rec (fun _ => PartList) ((b, Nat.add 1 k') :: xs) [] + (Bool.and (Bool.not b) (match xs with | [] => true | _ => false))) k +noncomputable def bsize_parts_f_p : PartList → Nat := +@List.rec (Bool × Nat) (fun _ => Nat) 0 (fun hd _ ih => Nat.add hd.2 ih) +noncomputable def put_l_parts_f_p (push_stack_f : Nat → Nat → Nat → Stack → Stack) : PartList → Stack → Stack := +@List.rec (Bool × Nat) (fun _ => Stack → Stack) + (fun s => s) + (fun hd _ ih s => + push_stack_f (@Bool.rec (fun _ => Nat) 1 14 hd.1) (@Bool.rec (fun _ => Nat) 1 4 hd.1) (Nat.mul hd.2 4) (ih s)) +noncomputable def put_l_stack_f_p (push_stack_f : Nat → Nat → Nat → Stack → Stack) (bsize_parts_f : PartList → Nat) (put_l_parts_f : PartList → Stack → Stack) : PartList → Nat → Stack → Stack := +fun xs n s => + let bs := bsize_parts_f xs + let s1 := @Bool.rec (fun _ => Stack) s (push_stack_f 1 1 (Nat.mul (Nat.sub n bs) 4) s) (Nat.ble (Nat.add bs 1) n) + put_l_parts_f xs s1 +noncomputable def put_r_rec_f_p (push_stack_f : Nat → Nat → Nat → Stack → Stack) : PartList → Nat → Stack → Stack := +@List.rec (Bool × Nat) (fun _ => Nat → Stack → Stack) + (fun k s => push_stack_f 1 3 (Nat.sub (Nat.mul k 3) 2) s) + (fun hd _ ih k s => + @Bool.rec (fun _ => Stack) + (@Bool.rec (fun _ => Stack) + (push_stack_f (@Bool.rec (fun _ => Nat) 1 0 hd.1) (@Bool.rec (fun _ => Nat) 3 1 hd.1) (Nat.mul hd.2 3) (ih (Nat.sub k hd.2) s)) + (push_stack_f (@Bool.rec (fun _ => Nat) 1 0 hd.1) (@Bool.rec (fun _ => Nat) 3 1 hd.1) (Nat.sub (Nat.mul hd.2 3) 2) s) + (Nat.ble k hd.2)) + (ih k s) + (Nat.beq hd.2 0)) +noncomputable def parse_step_l_f_p (drop_stack_f : Nat → Stack → Stack) (pop_word_f : Nat → Nat → Stack → Option Stack) : Nat → Stack → Option (Bool × Nat × Stack) := +fun limit s => + match s with + | [] => none + | top :: rest => + @Bool.rec (fun _ => Option (Bool × Nat × Stack)) + (@Bool.rec (fun _ => Option (Bool × Nat × Stack)) + (match pop_word_f 15 4 (top :: rest) with + | some s1 => some (false, 1, s1) + | none => + match pop_word_f 14 4 (top :: rest) with + | some s1 => some (true, 1, s1) + | none => none) + (let k := Nat.min limit (Nat.div top.len 4) + some (true, k, drop_stack_f (Nat.mul k 4) (top :: rest))) + (Bool.and (Nat.beq top.width 4) (Bool.and (Nat.beq top.pat 14) (Nat.ble 4 top.len)))) + (let k := Nat.min limit (Nat.div top.len 4) + some (false, k, drop_stack_f (Nat.mul k 4) (top :: rest))) + (Bool.and (Nat.beq top.width 1) (Bool.and (Nat.beq top.pat 1) (Nat.ble 4 top.len))) +noncomputable def parse_l_f_p (parse_step_l_f : Nat → Stack → Option (Bool × Nat × Stack)) : Nat → Nat → Stack → PartList × Stack := +@Nat.rec (fun _ => Nat → Stack → PartList × Stack) + (fun _ s => ([], s)) + (fun _ ih limit s => + @Bool.rec (fun _ => PartList × Stack) + (match parse_step_l_f limit s with + | none => ([], s) + | some (bit, k, s1) => + let res := ih (Nat.sub limit k) s1 + @Bool.rec (fun _ => PartList × Stack) + ((bit, k) :: res.1, res.2) + ([], s) + (Bool.and (Bool.not bit) (match res.1 with | [] => true | _ => false))) + ([], s) + (Nat.beq limit 0)) +noncomputable def parse_step_r_f_p (drop_stack_f : Nat → Stack → Stack) (pop_word_f : Nat → Nat → Stack → Option Stack) : Nat → Stack → Option (Bool × Nat × Stack) := +fun limit s => + match s with + | [] => none + | top :: rest => + @Bool.rec (fun _ => Option (Bool × Nat × Stack)) + (@Bool.rec (fun _ => Option (Bool × Nat × Stack)) + (match pop_word_f 1 3 (top :: rest) with + | some s1 => some (false, 1, s1) + | none => + match pop_word_f 0 3 (top :: rest) with + | some s1 => some (true, 1, s1) + | none => none) + (let k := Nat.min limit (Nat.div top.len 3) + some (true, k, drop_stack_f (Nat.mul k 3) (top :: rest))) + (Bool.and (Nat.beq top.width 1) (Bool.and (Nat.beq top.pat 0) (Nat.ble 3 top.len)))) + (let k := Nat.min limit (Nat.div top.len 3) + some (false, k, drop_stack_f (Nat.mul k 3) (top :: rest))) + (Bool.and (Nat.beq top.width 3) (Bool.and (Nat.beq top.pat 1) (Nat.ble 3 top.len))) +noncomputable def parse_r_f_p (push_stack_f : Nat → Nat → Nat → Stack → Stack) (pop1_b_f : Stack → Bool × Stack) (parse_step_r_f : Nat → Stack → Option (Bool × Nat × Stack)) : Nat → Nat → Stack → PartList × Stack := +@Nat.rec (fun _ => Nat → Stack → PartList × Stack) + (fun _ s => ([], s)) + (fun _ ih limit s => + @Bool.rec (fun _ => PartList × Stack) + (match s with + | [] => ([(true, limit)], []) + | top :: rest => + match parse_step_r_f limit (top :: rest) with + | none => + let p := pop1_b_f (top :: rest) + @Bool.rec (fun _ => PartList × Stack) ([], top :: rest) ([(true, 1)], p.2) (Bool.not p.1) + | some (bit, k, s1) => + let res := ih (Nat.sub limit k) s1 + match res.1 with + | [] => @Bool.rec (fun _ => PartList × Stack) ([], top :: rest) ([(true, k)], push_stack_f 0 1 2 s1) bit + | _ => ((bit, k) :: res.1, res.2)) + ([], s) + (Nat.beq limit 0)) +noncomputable def sub_lsb_f_p (mkPart_f : Bool → Nat → PartList → PartList) : Nat → Bool → PartList → PartList → Option PartList := +@Nat.rec (fun _ => Bool → PartList → PartList → Option PartList) + (fun _ _ _ => none) + (fun _ ih c xs ys => + match xs with + | [] => + @Bool.rec (fun _ => Option PartList) none (some []) + (Bool.and (match ys with | [] => true | _ => false) (Bool.not c)) + | (px, kx) :: xrest => + let qy := match ys with | [] => false | (q, _) :: _ => q + let ly := match ys with | [] => kx | (_, l) :: _ => l + let n := Nat.min kx ly + let nx := @Bool.rec (fun _ => PartList) xrest ((px, Nat.sub kx n) :: xrest) (Nat.ble (Nat.add n 1) kx) + let ny := match ys with | [] => [] | (q, l) :: yrest => @Bool.rec (fun _ => PartList) yrest ((q, Nat.sub l n) :: yrest) (Nat.ble (Nat.add n 1) l) + @Bool.rec (fun _ => Option PartList) + (let s1_1 := Bool.xor (Bool.xor px qy) c + let s1_2 := Bool.or (Bool.and (Bool.not px) (Bool.or qy c)) (Bool.and qy c) + let s2_1 := Bool.xor (Bool.xor px qy) s1_2 + let s2_2 := Bool.or (Bool.and (Bool.not px) (Bool.or qy s1_2)) (Bool.and qy s1_2) + let next_c := @Bool.rec (fun _ => Bool) s1_2 s2_2 (Nat.ble 2 n) + match ih next_c nx ny with + | none => none + | some out => some (mkPart_f s1_1 1 (@Bool.rec (fun _ => PartList) out (mkPart_f s2_1 (Nat.sub n 1) out) (Nat.ble 2 n)))) + (ih c nx ny) + (Nat.beq n 0)) +noncomputable def choose_limit_r_f_p (drop_stack_f : Nat → Stack → Stack) (pop1_b_f : Stack → Bool × Stack) (pop_word_f : Nat → Nat → Stack → Option Stack) : Nat → Nat → Nat → Stack → Nat := +fun n fuel done r => + @Nat.rec (fun _ => Nat → Stack → Nat) + (fun _ _ => Nat.add n 1) + (fun _ ih done s => + match s with + | [] => @Bool.rec (fun _ => Nat) (Nat.add done 1) (Nat.add n 1) (Nat.ble done n) + | top :: rest => + @Bool.rec (fun _ => Nat) + (@Bool.rec (fun _ => Nat) + (match pop_word_f 1 3 (top :: rest) with + | some r1 => ih (Nat.add done 1) r1 + | none => + match pop_word_f 0 3 (top :: rest) with + | some r1 => + @Bool.rec (fun _ => Nat) + (ih (Nat.add done 1) r1) + (Nat.add done 1) + (Nat.ble n done) + | none => + @Bool.rec (fun _ => Nat) done (Nat.add done 1) (Bool.not (pop1_b_f (top :: rest)).1)) + (let div := Nat.div top.len 3 + let next_done := Nat.add done div + @Bool.rec (fun _ => Nat) + (ih next_done (drop_stack_f (Nat.mul div 3) (top :: rest))) + (Nat.min (Nat.max (Nat.add n 2) (Nat.add done 2)) next_done) + (Nat.ble (Nat.add n 1) next_done)) + (Bool.and (Nat.beq top.width 1) (Bool.and (Nat.beq top.pat 0) (Nat.ble 3 top.len)))) + (let div := Nat.div top.len 3 + ih (Nat.add done div) (drop_stack_f (Nat.mul div 3) (top :: rest))) + (Bool.and (Nat.beq top.width 3) (Bool.and (Nat.beq top.pat 1) (Nat.ble 3 top.len)))) + fuel done r +noncomputable def push_prefix_l_f_p (push_stack_f : Nat → Nat → Nat → Stack → Stack) : Stack → Stack := +fun l => push_stack_f 1 1 1 (push_stack_f 0 1 1 (push_stack_f 1 1 3 l)) +noncomputable def build_vprime_f_p (mkPart_f : Bool → Nat → PartList → PartList) : Nat → Nat → PartList := +fun n m_use => + @Bool.rec (fun _ => PartList) + (mkPart_f true 1 []) + (mkPart_f true 1 (mkPart_f false n (mkPart_f true (Nat.sub m_use 1) []))) + (Nat.ble 2 m_use) +noncomputable def do_shift_right_f_p (push_stack_f : Nat → Nat → Nat → Stack → Stack) (pop_word_f : Nat → Nat → Stack → Option Stack) (count_stack_mut_f : Nat → Nat → Nat → Nat → Stack → Nat × Stack) : Nat → Fin 6 → Nat → Nat → Nat → Nat → MState → Option MState := +fun k128 => +fun sq sw sin sout sout_w s => + @Bool.rec (fun _ => Option MState) none + (let target2 := Nat.add sin (Nat.mul sin (Nat.shiftLeft 1 sw)) + match pop_word_f target2 (Nat.mul 2 sw) s.r with + | none => none + | some _ => + let res := count_stack_mut_f sin sw k128 100000000 s.r + some ⟨sq, push_stack_f sout sout_w (Nat.mul res.1 sw) s.l, res.2⟩) + (Nat.beq s.q.val sq.val) +noncomputable def do_shift_left_f_p (bit_of_bool_f : Nat → Bool) (push_stack_f : Nat → Nat → Nat → Stack → Stack) (pop1_b_f : Stack → Bool × Stack) (pop_word_f : Nat → Nat → Stack → Option Stack) (count_stack_mut_f : Nat → Nat → Nat → Nat → Stack → Nat × Stack) : Nat → Fin 6 → Nat → Nat → Nat → Nat → MState → Option MState := +fun k128 => +fun sq sw sin sout sout_w s => + @Bool.rec (fun _ => Option MState) none + (let target2 := Nat.add sin (Nat.mul sin (Nat.shiftLeft 1 sw)) + let p_r := pop1_b_f s.r + @Bool.rec (fun _ => Option MState) none + (@Bool.rec (fun _ => Option MState) none + (let l1 := push_stack_f (@Bool.rec (fun _ => Nat) 0 1 p_r.1) 1 1 s.l + let res := count_stack_mut_f sin sw k128 100000000 l1 + let p_l := pop1_b_f res.2 + some ⟨sq, p_l.2, push_stack_f (@Bool.rec (fun _ => Nat) 0 1 p_l.1) 1 1 (push_stack_f sout sout_w (Nat.mul res.1 sw) p_r.2)⟩) + (match pop_word_f (Nat.shiftRight target2 1) (Nat.sub (Nat.mul 2 sw) 1) s.l with | some _ => true | none => false)) + (Bool.not (Bool.xor p_r.1 (bit_of_bool_f target2)))) + (Nat.beq s.q.val sq.val) +noncomputable def try_pair_stack_f_p (pop_word_f : Nat → Nat → Stack → Option Stack) (bsize_parts_f : PartList → Nat) (put_l_stack_f : PartList → Nat → Stack → Stack) (put_r_rec_f : PartList → Nat → Stack → Stack) (parse_l_f : Nat → Nat → Stack → PartList × Stack) (parse_r_f : Nat → Nat → Stack → PartList × Stack) (sub_lsb_f : Nat → Bool → PartList → PartList → Option PartList) (choose_limit_r_f : Nat → Nat → Nat → Stack → Nat) (push_prefix_l_f : Stack → Stack) : Nat → MState → Option MState := +fun k128 => +fun s => + @Bool.rec (fun _ => Option MState) none + (match pop_word_f 29 5 s.l with + | none => none + | some lc => + let res_l := parse_l_f k128 100000000 lc + match res_l.1 with + | [] => none + | a_hd :: a_tl => + let a := a_hd :: a_tl + let n := bsize_parts_f a + let lim_r := choose_limit_r_f n k128 0 s.r + @Bool.rec (fun _ => Option MState) + (let res_r := parse_r_f k128 lim_r s.r + match res_r.1 with + | [] => none + | b_hd :: b_tl => + let b := b_hd :: b_tl + let k := bsize_parts_f b + match sub_lsb_f k128 false a b with + | some out => some ⟨0, push_prefix_l_f (put_l_stack_f out n res_l.2), put_r_rec_f [] k res_r.2⟩ + | none => + match sub_lsb_f k128 false b a with + | some out => some ⟨0, push_prefix_l_f (put_l_stack_f [] n res_l.2), put_r_rec_f out k res_r.2⟩ + | none => none) + none + (Nat.beq lim_r 0)) + (Nat.beq s.q.val 0) +noncomputable def try_absorb_stack_f_p (push_stack_f : Nat → Nat → Nat → Stack → Stack) (pop_word_f : Nat → Nat → Stack → Option Stack) (count_stack_mut_f : Nat → Nat → Nat → Nat → Stack → Nat × Stack) (bsize_parts_f : PartList → Nat) (put_r_rec_f : PartList → Nat → Stack → Stack) (parse_r_f : Nat → Nat → Stack → PartList × Stack) (sub_lsb_f : Nat → Bool → PartList → PartList → Option PartList) (choose_limit_r_f : Nat → Nat → Nat → Stack → Nat) (push_prefix_l_f : Stack → Stack) (build_vprime_f : Nat → Nat → PartList) : Nat → MState → Option MState := +fun k128 => +fun s => + @Bool.rec (fun _ => Option MState) none + (match pop_word_f 29 5 s.l with + | none => none + | some lc0 => + let res1 := count_stack_mut_f 15 4 k128 100000000 lc0 + let res_m := count_stack_mut_f 13 4 k128 100000000 res1.2 + @Bool.rec (fun _ => Option MState) + (let lim_r := choose_limit_r_f (Nat.add res1.1 res_m.1) k128 0 s.r + @Bool.rec (fun _ => Option MState) + (let res_r := parse_r_f k128 lim_r s.r + match res_r.1 with + | [] => none + | b_hd :: b_tl => + let b := b_hd :: b_tl + let k := bsize_parts_f b + let m_init := Nat.min res_m.1 (@Bool.rec (fun _ => Nat) 1 (Nat.sub k res1.1) (Nat.ble (Nat.add res1.1 1) k)) + @Bool.rec (fun _ => Option MState) + (let try1 := sub_lsb_f k128 false b (build_vprime_f res1.1 m_init) + let res_sub : Option (Nat × PartList) := + match try1 with + | some out => some (m_init, out) + | none => + @Bool.rec (fun _ => Option (Nat × PartList)) + (match sub_lsb_f k128 false b (build_vprime_f res1.1 (Nat.sub m_init 1)) with + | some out => some (Nat.sub m_init 1, out) + | none => none) + none + (Nat.ble m_init 1) + match res_sub with + | none => none + | some (m_use, out) => + let res2 := count_stack_mut_f 13 4 k128 m_use res1.2 + @Bool.rec (fun _ => Option MState) none + (some ⟨0, push_prefix_l_f (push_stack_f 14 4 (Nat.mul (Nat.add res1.1 res2.1) 4) res2.2), put_r_rec_f out k res_r.2⟩) + (Nat.beq res2.1 m_use)) + none + (Nat.beq m_init 0)) + none + (Nat.beq lim_r 0)) + none + (Nat.beq res_m.1 0)) + (Nat.beq s.q.val 0) +noncomputable def step_prim_f_p (push_stack_f : Nat → Nat → Nat → Stack → Stack) (pop1_b_f : Stack → Bool × Stack) : MState → Option MState := +fun s => + let pr := pop1_b_f s.r + let (has_next, next_q, use_l, b_r) : Bool × Fin 6 × Bool × Nat := + match s.q.val, pr.1 with + | 0, false => (true, 1, true, 1) + | 0, true => (true, 4, false, 1) + | 1, false => (true, 2, true, 1) + | 1, true => (true, 1, true, 0) + | 2, false => (true, 3, false, 1) + | 2, true => (true, 4, true, 0) + | 3, false => (true, 0, false, 1) + | 3, true => (true, 3, false, 0) + | 4, false => (true, 3, false, 1) + | 4, true => (true, 5, false, 0) + | 5, false => (true, 1, true, 0) + | _, _ => (false, 0, false, 0) + @Bool.rec (fun _ => Option MState) + none + (@Bool.rec (fun _ => Option MState) + (some ⟨next_q, push_stack_f b_r 1 1 s.l, pr.2⟩) + (let pl := pop1_b_f s.l + some ⟨next_q, pl.2, push_stack_f (@Bool.rec (fun _ => Nat) 0 1 pl.1) 1 1 (push_stack_f b_r 1 1 pr.2)⟩) + use_l) + has_next +noncomputable def step_m_f_p (do_shift_right_f : Nat → Fin 6 → Nat → Nat → Nat → Nat → MState → Option MState) (do_shift_left_f : Nat → Fin 6 → Nat → Nat → Nat → Nat → MState → Option MState) (try_pair_stack_f : Nat → MState → Option MState) (try_absorb_stack_f : Nat → MState → Option MState) (step_prim_f : MState → Option MState) : Nat → MState → Option MState := +fun _ => +fun s => + let macro_res : Option MState := + match s.q.val with + | 0 => + let kbig := Nat.add (Nat.add s.l.length s.r.length) 4 + match (try_pair_stack_f kbig) s with + | some s' => some s' + | none => + match (try_absorb_stack_f kbig) s with + | some s' => some s' + | none => (do_shift_right_f 8) 0 3 1 1 1 s + | 1 => (do_shift_left_f 8) 1 1 1 0 1 s + | 2 => (do_shift_left_f 8) 2 2 3 1 2 s + | 3 => + match (do_shift_right_f 8) 3 1 1 0 1 s with + | some s' => some s' + | none => + match (do_shift_right_f 8) 3 3 2 1 1 s with + | some s' => some s' + | none => + match (do_shift_right_f 8) 3 4 10 14 4 s with + | some s' => some s' + | none => (do_shift_right_f 8) 3 4 5 7 4 s + | _ => none + match macro_res with + | some s' => some s' + | none => step_prim_f s + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false + +@[simp] theorem if_true_eq_true {α : Type} (t e : α) : (if true = true then t else e) = t := rfl +@[simp] theorem if_false_eq_true {α : Type} (t e : α) : (if false = true then t else e) = e := rfl +@[simp] theorem bool_true_and_b (b : Bool) : (true && b) = b := rfl +@[simp] theorem nat_add_1_succ {α : Type} (z : α) (f : Nat → α) (x : Nat) : + @Nat.rec (fun _ => α) z (fun p _ => f p) (Nat.add 1 x) = f x := by + have h : Nat.add 1 x = Nat.succ x := Nat.add_comm 1 x + rw [h] + +@[simp] theorem bool_rec_eq {α : Type} (f t : α) (b : Bool) : + @Bool.rec (fun _ => α) f t b = if b then t else f := by + cases b <;> rfl + +@[simp] theorem nat_beq_def (x y : Nat) : x.beq y = (x == y) := by + cases h1 : x.beq y <;> cases h2 : (x == y) <;> simp_all [Nat.beq_eq] +@[simp] theorem nat_ble_def (x y : Nat) : x.ble y = decide (x ≤ y) := by + by_cases h : x ≤ y + · rw [Nat.ble_eq.mpr h, decide_eq_true h] + · cases hb : x.ble y + · exact (decide_eq_false h).symm + · exact False.elim (h (Nat.ble_eq.mp hb)) +@[simp] theorem nat_add_def (x y : Nat) : x.add y = x + y := rfl +@[simp] theorem nat_sub_def (x y : Nat) : x.sub y = x - y := rfl +@[simp] theorem nat_mul_def (x y : Nat) : x.mul y = x * y := rfl +@[simp] theorem nat_div_def (x y : Nat) : x.div y = x / y := rfl +@[simp] theorem nat_mod_def (x y : Nat) : x.mod y = x % y := rfl +@[simp] theorem nat_min_def (x y : Nat) : x.min y = min x y := rfl +@[simp] theorem nat_max_def (x y : Nat) : x.max y = max x y := rfl +@[simp] theorem nat_land_def (x y : Nat) : x.land y = x &&& y := rfl +@[simp] theorem nat_shiftRight_def (x y : Nat) : x.shiftRight y = x >>> y := rfl +@[simp] theorem nat_shiftLeft_def (x y : Nat) : x.shiftLeft y = x <<< y := rfl + +theorem mkBlock_p_eq : mkBlock_f_p = Block.mk := by + funext p w l; unfold mkBlock_f_p; simp only [nat_add_1_succ] + +theorem rot1_p_eq : rot1_f_p = rot1 := by + funext w p; unfold rot1_f_p rot1 + simp only [nat_shiftRight_def, nat_land_def, nat_shiftLeft_def, nat_sub_def, nat_mul_def, nat_add_def, + Nat.shiftRight_eq_div_pow, Nat.pow_one, Nat.and_one_is_mod, Nat.shiftLeft_eq, Nat.one_mul] + +theorem rot_mod_fin_eq : + ∀ (w : Fin 5) (p : Fin 16) (r : Fin 5), + 1 ≤ w.val → p.val ≤ (Nat.shiftLeft 1 w.val) - 1 → 1 ≤ r.val → r.val < w.val → + Nat.add (Nat.shiftRight p.val r.val) + (Nat.shiftLeft (Nat.land p.val (Nat.sub (Nat.shiftLeft 1 r.val) 1)) (Nat.sub w.val r.val)) == + rot_k w.val r.val p.val := by decide +kernel + +theorem rot_k_period_fin : + ∀ (w : Fin 5) (p : Fin 16), + 1 ≤ w.val → p.val ≤ (Nat.shiftLeft 1 w.val) - 1 → rot_k w.val w.val p.val = p.val := by decide +kernel + +theorem rot_mod_p_eq : rot_mod_f_p = rot_mod := by + funext w n p + rw [rot_mod_eq] + unfold rot_mod_f_p + simp only [bool_rec_eq, nat_beq_def, nat_ble_def] + split_ifs with h0 hw hr + · simp only [Bool.or_eq_true, Bool.and_eq_true, beq_iff_eq] at h0 + rcases h0 with rfl | ⟨rfl, rfl⟩ + · exact (rot_k_zero w n).symm + · exact (rot_k_one_one n).symm + · simp only [Bool.and_eq_true, decide_eq_true_eq, nat_sub_def] at hw + rcases hw with ⟨hw2, hw4, hp15, hp⟩ + have hw1 : 1 ≤ w := Nat.le_trans (by decide : 1 ≤ 2) hw2 + have hper := rot_k_period_fin ⟨w, Nat.lt_succ_of_le hw4⟩ ⟨p, Nat.lt_succ_of_le hp15⟩ hw1 hp + simp only [nat_mod_def, beq_iff_eq] at hr + have hdiv := Nat.div_add_mod n w + conv_rhs => rw [← hdiv] + rw [rot_k_period w p hper (n / w) (n % w), hr]; rfl + · simp only [Bool.and_eq_true, decide_eq_true_eq, nat_sub_def] at hw + rcases hw with ⟨hw2, hw4, hp15, hp⟩ + have hw1 : 1 ≤ w := Nat.le_trans (by decide : 1 ≤ 2) hw2 + have hw0 : 0 < w := Nat.lt_of_lt_of_le (by decide : 0 < 1) hw1 + have hper := rot_k_period_fin ⟨w, Nat.lt_succ_of_le hw4⟩ ⟨p, Nat.lt_succ_of_le hp15⟩ hw1 hp + have hdiv := Nat.div_add_mod n w + conv_rhs => rw [← hdiv] + rw [rot_k_period w p hper (n / w) (n % w)] + have hrmod : n % w < w := Nat.mod_lt n hw0 + have hr1 : 1 ≤ n % w := by + simp only [nat_mod_def] at hr + cases hc : (n % w == 0) + · rw [beq_eq_false_iff_ne] at hc; exact Nat.pos_of_ne_zero hc + · exact False.elim (hr hc) + have hfin := rot_mod_fin_eq ⟨w, Nat.lt_succ_of_le hw4⟩ ⟨p, Nat.lt_succ_of_le hp15⟩ + ⟨n % w, Nat.lt_trans hrmod (Nat.lt_succ_of_le hw4)⟩ hw1 hp hr1 hrmod + exact of_decide_eq_true hfin + · rfl + +theorem bit_of_bool_p_eq : bit_of_bool_f_p = (fun x => bit_of x == 1) := by + funext x; unfold bit_of_bool_f_p bit_of + simp only [nat_land_def, nat_beq_def, Nat.and_one_is_mod] + rcases Nat.mod_two_eq_zero_or_one x with h2 | h2 <;> rw [h2] <;> rfl + +theorem push_stack_aux_p_eq + {mkBlock_f} (h1 : mkBlock_f = Block.mk) + {rot_mod_f} (h2 : rot_mod_f = rot_mod) : + push_stack_aux_f_p mkBlock_f rot_mod_f = push_stack_aux := by + subst h1; subst h2; funext b s + unfold push_stack_aux_f_p + induction s generalizing b with + | nil => + unfold push_stack_aux + simp only [bool_rec_eq, nat_beq_def] + by_cases hp : b.pat = 0 <;> simp [hp] + | cons top rest ih => + unfold push_stack_aux + simp only [ih] + simp only [bool_rec_eq, nat_beq_def, nat_add_def, with_nat_eq] + +theorem push_stack_p_eq + {mkBlock_f} (h1 : mkBlock_f = Block.mk) + {push_stack_aux_f} (h2 : push_stack_aux_f = push_stack_aux) : + push_stack_f_p mkBlock_f push_stack_aux_f = push_stack := by + subst h1; subst h2; funext pat width len s + unfold push_stack_f_p push_stack + simp only [bool_rec_eq, nat_beq_def, with_stack_eq, with_nat_eq] + by_cases hlen : len = 0 <;> simp [hlen] + +theorem drop_stack_p_eq + {mkBlock_f} (h1 : mkBlock_f = Block.mk) + {rot_mod_f} (h2 : rot_mod_f = rot_mod) : + drop_stack_f_p mkBlock_f rot_mod_f = drop_stack := by + subst h1; subst h2; funext n s + unfold drop_stack_f_p + induction s generalizing n with + | nil => rfl + | cons top rest ih => + unfold drop_stack + simp only [ih] + simp only [bool_rec_eq, nat_beq_def, nat_ble_def, nat_sub_def, with_nat_eq] + by_cases hn : n = 0 + · simp only [hn, beq_self_eq_true, if_true_eq_true, ↓reduceIte] + · have hne : (n == 0) = false := beq_eq_false_iff_ne.mpr hn + rw [hne]; simp only [if_false_eq_true, hn, ↓reduceIte] + by_cases hle : top.len ≤ n + · simp only [hle, decide_true, if_true_eq_true, ↓reduceIte] + · simp only [hle, decide_false, if_false_eq_true, ↓reduceIte] + +theorem pop1_b_p_eq + {mkBlock_f} (h1 : mkBlock_f = Block.mk) + {rot1_f} (h2 : rot1_f = rot1) + {bit_of_bool_f} (h3 : bit_of_bool_f = fun x => bit_of x == 1) : + pop1_b_f_p mkBlock_f rot1_f bit_of_bool_f = fun s => ((pop1 s).1 == 1, (pop1 s).2) := by + subst h1; subst h2; subst h3; funext s + unfold pop1_b_f_p + induction s with + | nil => rfl + | cons top rest ih => + unfold pop1 + simp only [ih] + simp only [bool_rec_eq, nat_beq_def, nat_sub_def, with_nat_eq] + by_cases h0 : top.len = 0 + · simp only [h0, beq_self_eq_true, if_true_eq_true, ↓reduceIte] + · have hne0 : (top.len == 0) = false := beq_eq_false_iff_ne.mpr h0 + rw [hne0]; simp only [if_false_eq_true, h0, ↓reduceIte] + by_cases h1 : top.len = 1 + · simp only [h1, beq_self_eq_true, if_true_eq_true, ↓reduceIte] + · have hne1 : (top.len == 1) = false := beq_eq_false_iff_ne.mpr h1 + rw [hne1]; simp only [if_false_eq_true, h1, ↓reduceIte] + +theorem sym_xnor_eq : ∀ (a b : Fin 2), ((!(a == 1 ^^ b == 1)) = true) = (a = b) := by decide + +theorem pop_word_p_eq + {bit_of_bool_f} (h1 : bit_of_bool_f = fun x => bit_of x == 1) + {pop1_b_f} (h2 : pop1_b_f = fun s => ((pop1 s).1 == 1, (pop1 s).2)) : + pop_word_f_p bit_of_bool_f pop1_b_f = pop_word := by + subst h1; subst h2; funext pat w s + unfold pop_word_f_p + induction w generalizing pat s with + | zero => rfl + | succ w ih => + unfold pop_word + simp only [ih] + simp only [bool_rec_eq, with_prod_eq, sym_xnor_eq, nat_shiftRight_def] + have hsh : ∀ x : Nat, x >>> 1 = x / 2 := fun _ => rfl + simp only [hsh] + +theorem fast_match_core_fin : + ∀ (w : Fin 5) (tw : Fin 5) (tp : Fin 16) (pat : Fin 16), + 1 ≤ w.val → 1 ≤ tw.val → tp.val ≤ (Nat.shiftLeft 1 tw.val) - 1 → pat.val ≤ (Nat.shiftLeft 1 w.val) - 1 → + (let mul := match tw.val with | 1 => 4095 | 2 => 1365 | 3 => 585 | _ => 273 + Bool.and (Nat.beq (Nat.land (Nat.shiftRight (Nat.mul tp.val mul) w.val) (Nat.sub (Nat.shiftLeft 1 tw.val) 1)) tp.val) + (Nat.beq (Nat.land (Nat.mul tp.val mul) (Nat.sub (Nat.shiftLeft 1 w.val) 1)) pat.val)) = + (rot_k tw.val w.val tp.val == tp.val && pat_word tw.val tp.val w.val == word_of pat.val w.val) := by + decide +kernel + +theorem fast_match_p_eq : + fast_match_f_p = fun pat w top => + (0 < w && w ≤ top.len && rot_k top.width w top.pat == top.pat && + pat_word top.width top.pat w == word_of pat w) := by + funext pat w top + unfold fast_match_f_p + simp only [bool_rec_eq, nat_ble_def] + split_ifs with hg + · simp only [Bool.and_eq_true, decide_eq_true_eq, nat_sub_def] at hg + rcases hg with ⟨hw1, hw4, htw1, htw4, htp, hpat⟩ + have h15 : ∀ (k : Fin 5), (Nat.shiftLeft 1 k.val).sub 1 ≤ 15 := by decide + have htp16 : (Nat.shiftLeft 1 top.width).sub 1 ≤ 15 := h15 ⟨top.width, by omega⟩ + have hpat16 : (Nat.shiftLeft 1 w).sub 1 ≤ 15 := h15 ⟨w, by omega⟩ + simp only [nat_sub_def] at htp16 hpat16 + have hcore := fast_match_core_fin ⟨w, by omega⟩ ⟨top.width, by omega⟩ ⟨top.pat, by omega⟩ ⟨pat, by omega⟩ + hw1 htw1 htp hpat + dsimp only at hcore + rw [hcore] + have hw_pos : decide (0 < w) = true := decide_eq_true (by omega) + rw [hw_pos, Bool.true_and] + cases decide (w ≤ top.len) <;> cases (rot_k top.width w top.pat == top.pat) <;> + cases (pat_word top.width top.pat w == word_of pat w) <;> rfl + · rfl + + +theorem count_stack_mut_p_eq + {drop_stack_f} (h1 : drop_stack_f = drop_stack) + {pop_word_f} (h2 : pop_word_f = pop_word) + {fast_match_f} (h3 : fast_match_f = fun pat w top => + (0 < w && w ≤ top.len && rot_k top.width w top.pat == top.pat && + pat_word top.width top.pat w == word_of pat w)) : + count_stack_mut_f_p drop_stack_f pop_word_f fast_match_f = count_stack_mut := by + subst h1; subst h2; subst h3 + funext pat w fuel limit s + unfold count_stack_mut_f_p + induction fuel generalizing limit s with + | zero => rfl + | succ fuel ih => + unfold count_stack_mut + simp only [ih] + simp only [bool_rec_eq, nat_beq_def, nat_div_def, nat_mul_def, nat_sub_def, nat_add_def, + nat_min_def, with_nat_eq, with_stack_eq, with_prod_eq] + by_cases hlim : limit = 0 + · simp [hlim] + · have hne : (limit == 0) = false := beq_eq_false_iff_ne.mpr hlim + rw [hne]; simp only [if_false_eq_true, hlim, ↓reduceIte] + +theorem mkPart_p_eq : mkPart_f_p = cons_lsb := by + funext b k xs + unfold mkPart_f_p cons_lsb + cases k <;> cases xs <;> simp only [bool_rec_eq, nat_add_def, with_list_eq, Nat.add_comm 1 _] <;> cases b <;> rfl + +theorem bsize_parts_p_eq : bsize_parts_f_p = bsize_parts := by + funext xs; unfold bsize_parts_f_p + induction xs with + | nil => rfl + | cons hd tl ih => + rcases hd with ⟨b, k⟩ + simp only [ih] + simp only [bsize_parts, nat_add_def] + +theorem put_l_parts_p_eq + {push_stack_f} (h1 : push_stack_f = push_stack) : + put_l_parts_f_p push_stack_f = put_l_parts := by + subst h1; funext xs s; unfold put_l_parts_f_p + induction xs with + | nil => rfl + | cons hd tl ih => + rcases hd with ⟨b, k⟩ + simp only [ih] + simp only [put_l_parts, bool_rec_eq, nat_mul_def] + +theorem put_l_stack_p_eq + {push_stack_f} (h1 : push_stack_f = push_stack) + {bsize_parts_f} (h2 : bsize_parts_f = bsize_parts) + {put_l_parts_f} (h3 : put_l_parts_f = put_l_parts) : + put_l_stack_f_p push_stack_f bsize_parts_f put_l_parts_f = put_l_stack := by + subst h1; subst h2; subst h3; funext xs n s + unfold put_l_stack_f_p put_l_stack + simp only [bool_rec_eq, nat_ble_def, nat_add_def, nat_sub_def, nat_mul_def] + congr 1 + by_cases hlt : bsize_parts xs < n + · rw [if_pos hlt, decide_eq_true (by omega), if_true_eq_true] + · rw [if_neg hlt, decide_eq_false (by omega), if_false_eq_true] + +theorem put_r_rec_p_eq + {push_stack_f} (h1 : push_stack_f = push_stack) : + put_r_rec_f_p push_stack_f = put_r_rec := by + subst h1; funext xs k s; unfold put_r_rec_f_p + induction xs generalizing k s with + | nil => simp only [put_r_rec, nat_sub_def, nat_mul_def] + | cons hd tl ih => + rcases hd with ⟨b, m⟩ + unfold put_r_rec + simp only [ih] + simp only [bool_rec_eq, nat_beq_def, nat_ble_def, nat_sub_def, nat_mul_def] + by_cases hm : m = 0 + · simp [hm] + · have hne : (m == 0) = false := beq_eq_false_iff_ne.mpr hm + rw [hne]; simp only [if_false_eq_true, hm, ↓reduceIte] + by_cases hle : k ≤ m <;> simp [hle] + +theorem parse_step_l_p_eq + {drop_stack_f} (h1 : drop_stack_f = drop_stack) + {pop_word_f} (h2 : pop_word_f = pop_word) : + parse_step_l_f_p drop_stack_f pop_word_f = parse_step_l := by + subst h1; subst h2; funext limit s + unfold parse_step_l_f_p parse_step_l + cases s with + | nil => rfl + | cons top rest => + simp only [bool_rec_eq, nat_beq_def, nat_ble_def, nat_div_def, nat_mul_def, nat_min_def, Bool.and_assoc] + +theorem parse_l_p_eq + {parse_step_l_f} (h1 : parse_step_l_f = parse_step_l) : + parse_l_f_p parse_step_l_f = parse_l := by + subst h1; funext fuel limit s; unfold parse_l_f_p + induction fuel generalizing limit s with + | zero => rfl + | succ fuel ih => + unfold parse_l + simp only [ih] + simp only [bool_rec_eq, nat_beq_def, nat_sub_def, with_prod_eq, with_list_eq, with_stack_eq] + by_cases hlim : limit = 0 + · simp [hlim] + · have hne : (limit == 0) = false := beq_eq_false_iff_ne.mpr hlim + rw [hne]; simp only [if_false_eq_true, hlim, ↓reduceIte] + cases parse_step_l limit s with + | none => rfl + | some val => + rcases val with ⟨b, k, s1⟩; dsimp only + cases b <;> cases (parse_l fuel (limit - k) s1).1 <;> rfl + +theorem parse_step_r_p_eq + {drop_stack_f} (h1 : drop_stack_f = drop_stack) + {pop_word_f} (h2 : pop_word_f = pop_word) : + parse_step_r_f_p drop_stack_f pop_word_f = parse_step_r := by + subst h1; subst h2; funext limit s + unfold parse_step_r_f_p parse_step_r + cases s with + | nil => rfl + | cons top rest => + simp only [bool_rec_eq, nat_beq_def, nat_ble_def, nat_div_def, nat_mul_def, nat_min_def, Bool.and_assoc] + +theorem sym_not_eq_one : ∀ (x : Fin 2), ((!(x == 1)) = true) = (x = 0) := by decide + +theorem parse_r_p_eq + {push_stack_f} (h1 : push_stack_f = push_stack) + {pop1_b_f} (h2 : pop1_b_f = fun s => ((pop1 s).1 == 1, (pop1 s).2)) + {parse_step_r_f} (h3 : parse_step_r_f = parse_step_r) : + parse_r_f_p push_stack_f pop1_b_f parse_step_r_f = parse_r := by + subst h1; subst h2; subst h3; funext fuel limit s; unfold parse_r_f_p + induction fuel generalizing limit s with + | zero => rfl + | succ fuel ih => + unfold parse_r + simp only [ih] + simp only [bool_rec_eq, nat_beq_def, nat_sub_def, with_prod_eq, with_list_eq, with_stack_eq] + by_cases hlim : limit = 0 + · simp [hlim] + · have hne : (limit == 0) = false := beq_eq_false_iff_ne.mpr hlim + rw [hne]; simp only [if_false_eq_true, hlim, ↓reduceIte] + cases s with + | nil => rfl + | cons top rest => + dsimp only + rcases parse_step_r limit (top :: rest) with _ | ⟨b, k, s1⟩ + · simp only [sym_not_eq_one] + · dsimp only + cases (parse_r fuel (limit - k) s1).1 <;> cases b <;> rfl + +theorem sub_lsb_p_eq + {mkPart_f} (h1 : mkPart_f = cons_lsb) : + sub_lsb_f_p mkPart_f = sub_lsb := by + subst h1; funext fuel c xs ys; unfold sub_lsb_f_p + induction fuel generalizing c xs ys with + | zero => rfl + | succ fuel ih => + unfold sub_lsb + simp only [ih] + cases xs with + | nil => + simp only [bool_rec_eq] + cases ys <;> cases c <;> rfl + | cons xhd xrest => + rcases xhd with ⟨px, kx⟩ + cases ys with + | nil => + simp only [bool_rec_eq, nat_beq_def, nat_ble_def, nat_add_def, nat_sub_def, + nat_min_def, with_nat_eq, with_list_eq, head_q, head_l, next_x, next_y] + have hmink : min kx kx = kx := Nat.min_self kx + simp only [hmink, Nat.sub_self] + by_cases hlt : kx < kx + · exact False.elim (Nat.lt_irrefl kx hlt) + · simp only [hlt, ↓reduceIte] + have hfalse : decide (kx + 1 ≤ kx) = false := decide_eq_false (by omega) + rw [hfalse, if_false_eq_true] + by_cases hk0 : kx = 0 + · simp [hk0] + · have hne0 : (kx == 0) = false := beq_eq_false_iff_ne.mpr hk0 + rw [hne0]; simp only [if_false_eq_true, hk0, ↓reduceIte] + have hc_eq : (if decide (2 ≤ kx) then + (!px && (false || ((!px && (false || c)) || (false && c)))) || + (false && ((!px && (false || c)) || (false && c))) + else (!px && (false || c)) || (false && c)) = + sub_chunk_c px false c kx := by + unfold sub_chunk_c subbit + by_cases h1 : 1 < kx + · rw [if_pos h1, decide_eq_true (by omega), if_true_eq_true] + · rw [if_neg h1, decide_eq_false (by omega), if_false_eq_true] + rw [hc_eq] + cases sub_lsb fuel (sub_chunk_c px false c kx) xrest [] with + | none => rfl + | some out => + dsimp only; unfold sub_chunk_out subbit + by_cases h1 : 1 < kx + · rw [if_pos h1, decide_eq_true (by omega), if_true_eq_true] + · rw [if_neg h1, decide_eq_false (by omega), if_false_eq_true] + | cons yhd yrest => + rcases yhd with ⟨qy, ly⟩ + simp only [bool_rec_eq, nat_beq_def, nat_ble_def, nat_add_def, nat_sub_def, + nat_min_def, with_nat_eq, with_list_eq, head_q, head_l] + have hnx : (if decide (min kx ly + 1 ≤ kx) then (px, kx - min kx ly) :: xrest else xrest) = + next_x px kx (min kx ly) xrest := by + unfold next_x + by_cases hlt : min kx ly < kx + · rw [if_pos hlt, decide_eq_true (by omega), if_true_eq_true] + · rw [if_neg hlt, decide_eq_false (by omega), if_false_eq_true] + have hny : (if decide (min kx ly + 1 ≤ ly) then (qy, ly - min kx ly) :: yrest else yrest) = + next_y (min kx ly) ((qy, ly) :: yrest) := by + dsimp only [next_y] + by_cases hlt : min kx ly < ly + · rw [if_pos hlt, decide_eq_true (by omega), if_true_eq_true] + · rw [if_neg hlt, decide_eq_false (by omega), if_false_eq_true] + rw [hnx, hny] + by_cases hn0 : min kx ly = 0 + · simp [hn0] + · have hne0 : (min kx ly == 0) = false := beq_eq_false_iff_ne.mpr hn0 + rw [hne0]; simp only [if_false_eq_true, hn0, ↓reduceIte] + have hc_eq : (if decide (2 ≤ min kx ly) then + (!px && (qy || ((!px && (qy || c)) || (qy && c)))) || + (qy && ((!px && (qy || c)) || (qy && c))) + else (!px && (qy || c)) || (qy && c)) = + sub_chunk_c px qy c (min kx ly) := by + unfold sub_chunk_c subbit + by_cases h1 : 1 < min kx ly + · rw [if_pos h1, decide_eq_true (by omega), if_true_eq_true] + · rw [if_neg h1, decide_eq_false (by omega), if_false_eq_true] + rw [hc_eq] + cases sub_lsb fuel (sub_chunk_c px qy c (min kx ly)) + (next_x px kx (min kx ly) xrest) (next_y (min kx ly) ((qy, ly) :: yrest)) with + | none => rfl + | some out => + dsimp only; unfold sub_chunk_out subbit + by_cases h1 : 1 < min kx ly + · rw [if_pos h1, decide_eq_true (by omega), if_true_eq_true] + · rw [if_neg h1, decide_eq_false (by omega), if_false_eq_true] + +theorem choose_limit_r_p_eq + {drop_stack_f} (h1 : drop_stack_f = drop_stack) + {pop1_b_f} (h2 : pop1_b_f = fun s => ((pop1 s).1 == 1, (pop1 s).2)) + {pop_word_f} (h3 : pop_word_f = pop_word) : + choose_limit_r_f_p drop_stack_f pop1_b_f pop_word_f = choose_limit_r_loop := by + subst h1; subst h2; subst h3; funext n fuel done r + unfold choose_limit_r_f_p + induction fuel generalizing done r with + | zero => rfl + | succ fuel ih => + unfold choose_limit_r_loop + simp only [ih] + cases r with + | nil => + simp only [bool_rec_eq, nat_ble_def, nat_add_def] + by_cases hle : done ≤ n <;> simp [hle] + | cons top rest => + simp only [bool_rec_eq, nat_beq_def, nat_ble_def, nat_add_def, nat_div_def, nat_mul_def, + nat_min_def, nat_max_def, Bool.and_assoc] + by_cases c1 : (top.width == 3 && (top.pat == 1 && decide (3 ≤ top.len))) = true + · simp only [c1, ↓reduceIte] + · have hc1f : (top.width == 3 && (top.pat == 1 && decide (3 ≤ top.len))) = false := + Bool.eq_false_iff.mpr c1 + simp only [hc1f, Bool.false_eq_true, ↓reduceIte] + by_cases c2 : (top.width == 1 && (top.pat == 0 && decide (3 ≤ top.len))) = true + · simp only [c2, ↓reduceIte] + by_cases hlt : n < done + top.len / 3 + · rw [if_pos hlt, decide_eq_true (by omega), if_true_eq_true] + · rw [if_neg hlt, decide_eq_false (by omega), if_false_eq_true] + · have hc2f : (top.width == 1 && (top.pat == 0 && decide (3 ≤ top.len))) = false := + Bool.eq_false_iff.mpr c2 + simp only [hc2f, Bool.false_eq_true, ↓reduceIte] + cases pop_word 1 3 (top :: rest) with + | some r1 => rfl + | none => + cases pop_word 0 3 (top :: rest) with + | some r1 => + dsimp only + by_cases hlt : n < done + 1 + · have hd : decide (n ≤ done) = true := decide_eq_true (by omega) + simp only [hd, hlt, ↓reduceIte] + · have hd : decide (n ≤ done) = false := decide_eq_false (by omega) + simp only [hd, hlt, Bool.false_eq_true, ↓reduceIte] + | none => + dsimp only + simp only [sym_not_eq_one] + +theorem push_prefix_l_p_eq + {push_stack_f} (h1 : push_stack_f = push_stack) : + push_prefix_l_f_p push_stack_f = push_prefix_l := by + subst h1; rfl + +theorem build_vprime_p_eq + {mkPart_f} (h1 : mkPart_f = cons_lsb) : + build_vprime_f_p mkPart_f = build_vprime := by + subst h1; funext n m_use + unfold build_vprime_f_p build_vprime + simp only [bool_rec_eq, nat_ble_def, nat_sub_def] + by_cases hlt : 1 < m_use + · rw [if_pos hlt, if_pos hlt, decide_eq_true (by omega), if_true_eq_true] + · rw [if_neg hlt, if_neg hlt, decide_eq_false (by omega), if_false_eq_true] + +theorem do_shift_right_p_eq + {push_stack_f} (h1 : push_stack_f = push_stack) + {pop_word_f} (h2 : pop_word_f = pop_word) + {count_stack_mut_f} (h3 : count_stack_mut_f = count_stack_mut) : + do_shift_right_f_p push_stack_f pop_word_f count_stack_mut_f 8 = do_shift_right := by + subst h1; subst h2; subst h3; funext sq sw sin sout sout_w s + unfold do_shift_right_f_p do_shift_right + simp only [bool_rec_eq, nat_beq_def, nat_add_def, nat_mul_def, nat_shiftLeft_def, + Nat.shiftLeft_eq, Nat.one_mul, with_prod_eq, some_mstate_eq] + have hq : ((s.q.val == sq.val) = true) = (s.q = sq) := by + cases h : (s.q.val == sq.val) + · simp only [beq_eq_false_iff_ne] at h; simp [Fin.ext_iff, h] + · simp only [beq_iff_eq] at h; simp [Fin.ext_iff, h] + simp only [hq] + by_cases hsq : s.q = sq + · simp only [hsq, ↓reduceIte] + cases pop_word (sin + sin * 2 ^ sw) (2 * sw) s.r <;> rfl + · simp only [hsq, ↓reduceIte] + +theorem bit_pat_eq : ∀ (x : Fin 2), (if x == 1 then 1 else 0) = bit_pat x := by decide + +theorem do_shift_left_p_eq + {bit_of_bool_f} (h1 : bit_of_bool_f = fun x => bit_of x == 1) + {push_stack_f} (h2 : push_stack_f = push_stack) + {pop1_b_f} (h3 : pop1_b_f = fun s => ((pop1 s).1 == 1, (pop1 s).2)) + {pop_word_f} (h4 : pop_word_f = pop_word) + {count_stack_mut_f} (h5 : count_stack_mut_f = count_stack_mut) : + do_shift_left_f_p bit_of_bool_f push_stack_f pop1_b_f pop_word_f count_stack_mut_f 8 = do_shift_left := by + subst h1; subst h2; subst h3; subst h4; subst h5 + funext sq sw sin sout sout_w s + unfold do_shift_left_f_p do_shift_left + simp only [bool_rec_eq, nat_beq_def, nat_add_def, nat_mul_def, nat_sub_def, + nat_shiftLeft_def, nat_shiftRight_def, Nat.shiftLeft_eq, Nat.one_mul, + Nat.shiftRight_eq_div_pow, Nat.pow_one, with_prod_eq, some_mstate_eq, bit_pat_eq, + sym_xnor_eq] + have hq : ((s.q.val == sq.val) = true) = (s.q = sq) := by + cases h : (s.q.val == sq.val) + · simp only [beq_eq_false_iff_ne] at h; simp [Fin.ext_iff, h] + · simp only [beq_iff_eq] at h; simp [Fin.ext_iff, h] + simp only [hq] + by_cases hsq : s.q = sq + · simp only [hsq, ↓reduceIte] + by_cases heq : (pop1 s.r).1 = bit_of (sin + sin * 2 ^ sw) + · simp only [heq, beq_self_eq_true, Bool.true_and, ↓reduceIte] + cases pop_word ((sin + sin * 2 ^ sw) / 2) (2 * sw - 1) s.l <;> rfl + · have hne : ((pop1 s.r).1 == bit_of (sin + sin * 2 ^ sw)) = false := beq_eq_false_iff_ne.mpr heq + rw [hne]; simp only [Bool.false_and, Bool.false_eq_true, heq, ↓reduceIte] + · simp only [hsq, ↓reduceIte] + +theorem try_pair_stack_p_eq + {pop_word_f} (h1 : pop_word_f = pop_word) + {bsize_parts_f} (h2 : bsize_parts_f = bsize_parts) + {put_l_stack_f} (h3 : put_l_stack_f = put_l_stack) + {put_r_rec_f} (h4 : put_r_rec_f = put_r_rec) + {parse_l_f} (h5 : parse_l_f = parse_l) + {parse_r_f} (h6 : parse_r_f = parse_r) + {sub_lsb_f} (h7 : sub_lsb_f = sub_lsb) + {choose_limit_r_f} (h8 : choose_limit_r_f = choose_limit_r_loop) + {push_prefix_l_f} (h9 : push_prefix_l_f = push_prefix_l) : + try_pair_stack_f_p pop_word_f bsize_parts_f put_l_stack_f put_r_rec_f + parse_l_f parse_r_f sub_lsb_f choose_limit_r_f push_prefix_l_f = try_pair_stack := by + funext kfuel; + subst h1; subst h2; subst h3; subst h4; subst h5; subst h6; subst h7; subst h8; subst h9 + funext s + unfold try_pair_stack_f_p try_pair_stack put_r_stack choose_limit_r + have hq : ((s.q.val == 0) = true) = (s.q = 0) := by + cases h : (s.q.val == 0) + · simp only [beq_eq_false_iff_ne] at h; simp [Fin.ext_iff, h] + · simp only [beq_iff_eq] at h; simp [Fin.ext_iff, h] + simp only [bool_rec_eq, nat_beq_def, hq] + split_ifs with hq0 + · cases pop_word 29 5 s.l with + | none => rfl + | some lc => + dsimp only + generalize parse_l kfuel 100000000 lc = res_l + rcases res_l with ⟨a_list, l_tail⟩ + rw [with_prod_eq]; dsimp only + rw [with_list_eq] + cases a_list with + | nil => rfl + | cons a_hd a_tl => + dsimp only [List.isEmpty, Bool.false_eq_true, ↓reduceIte] + generalize bsize_parts (a_hd :: a_tl) = n + rw [with_nat_eq] + generalize choose_limit_r_loop n kfuel 0 s.r = lim_r + rw [with_nat_eq] + by_cases hlim : lim_r = 0 + · simp [hlim] + · have hne : (lim_r == 0) = false := beq_eq_false_iff_ne.mpr hlim + rw [hne]; simp only [if_false_eq_true, hlim, ↓reduceIte] + generalize parse_r kfuel lim_r s.r = res_r + rcases res_r with ⟨b_list, r_tail⟩ + rw [with_prod_eq]; dsimp only + rw [with_list_eq] + cases b_list with + | nil => rfl + | cons b_hd b_tl => + dsimp only [List.isEmpty, Bool.false_eq_true, ↓reduceIte] + rw [with_nat_eq] + simp only [some_mstate_eq] + cases sub_lsb kfuel false (a_hd :: a_tl) (b_hd :: b_tl) with + | some out => rfl + | none => + cases sub_lsb kfuel false (b_hd :: b_tl) (a_hd :: a_tl) <;> rfl + · rfl + +theorem try_absorb_stack_p_eq + {push_stack_f} (h1 : push_stack_f = push_stack) + {pop_word_f} (h2 : pop_word_f = pop_word) + {count_stack_mut_f} (h3 : count_stack_mut_f = count_stack_mut) + {bsize_parts_f} (h4 : bsize_parts_f = bsize_parts) + {put_r_rec_f} (h5 : put_r_rec_f = put_r_rec) + {parse_r_f} (h6 : parse_r_f = parse_r) + {sub_lsb_f} (h7 : sub_lsb_f = sub_lsb) + {choose_limit_r_f} (h8 : choose_limit_r_f = choose_limit_r_loop) + {push_prefix_l_f} (h9 : push_prefix_l_f = push_prefix_l) + {build_vprime_f} (h10 : build_vprime_f = build_vprime) : + try_absorb_stack_f_p push_stack_f pop_word_f count_stack_mut_f bsize_parts_f + put_r_rec_f parse_r_f sub_lsb_f choose_limit_r_f push_prefix_l_f build_vprime_f = + try_absorb_stack := by + funext kfuel; + subst h1; subst h2; subst h3; subst h4; subst h5; subst h6; subst h7; subst h8; subst h9; subst h10 + funext s + unfold try_absorb_stack_f_p try_absorb_stack put_r_stack choose_limit_r + have hq : ((s.q.val == 0) = true) = (s.q = 0) := by + cases h : (s.q.val == 0) + · simp only [beq_eq_false_iff_ne] at h; simp [Fin.ext_iff, h] + · simp only [beq_iff_eq] at h; simp [Fin.ext_iff, h] + simp only [bool_rec_eq, nat_beq_def, nat_ble_def, nat_add_def, nat_sub_def, nat_mul_def, + nat_min_def, hq] + split_ifs with hq0 + · cases pop_word 29 5 s.l with + | none => rfl + | some lc0 => + dsimp only + generalize count_stack_mut 15 4 kfuel 100000000 lc0 = res1 + rcases res1 with ⟨n1, r1⟩ + rw [with_prod_eq]; dsimp only + generalize count_stack_mut 13 4 kfuel 100000000 r1 = res_m + rcases res_m with ⟨nm, rm⟩ + rw [with_prod_eq]; dsimp only + by_cases hm0 : nm = 0 + · simp [hm0] + · have hne_m : (nm == 0) = false := beq_eq_false_iff_ne.mpr hm0 + rw [hne_m]; simp only [if_false_eq_true, hm0, ↓reduceIte] + generalize choose_limit_r_loop (n1 + nm) kfuel 0 s.r = lim_r + rw [with_nat_eq] + by_cases hlim0 : lim_r = 0 + · simp [hlim0] + · have hne_l : (lim_r == 0) = false := beq_eq_false_iff_ne.mpr hlim0 + rw [hne_l]; simp only [if_false_eq_true, hlim0, ↓reduceIte] + generalize parse_r kfuel lim_r s.r = res_r + rcases res_r with ⟨b_list, r_tail⟩ + rw [with_prod_eq]; dsimp only + rw [with_list_eq] + cases b_list with + | nil => rfl + | cons b_hd b_tl => + dsimp only [List.isEmpty, Bool.false_eq_true, ↓reduceIte] + generalize bsize_parts (b_hd :: b_tl) = k + rw [with_nat_eq] + have hmin_eq : min nm (if decide (n1 + 1 ≤ k) then k - n1 else 1) = + calc_m_init nm n1 k := by + unfold calc_m_init + by_cases hlt : n1 < k + · rw [if_pos hlt, decide_eq_true (by omega), if_true_eq_true] + · rw [if_neg hlt, decide_eq_false (by omega), if_false_eq_true] + rw [hmin_eq] + generalize calc_m_init nm n1 k = m_init + rw [with_nat_eq] + by_cases hmi0 : m_init = 0 + · simp [hmi0] + · have hne_i : (m_init == 0) = false := beq_eq_false_iff_ne.mpr hmi0 + rw [hne_i]; simp only [if_false_eq_true, hmi0, ↓reduceIte] + have hsub_eq : (match sub_lsb kfuel false (b_hd :: b_tl) (build_vprime n1 m_init) with + | some out => some (m_init, out) + | none => + if decide (m_init ≤ 1) then none + else match sub_lsb kfuel false (b_hd :: b_tl) (build_vprime n1 (m_init - 1)) with + | some out => some (m_init - 1, out) + | none => none) = + try_absorb_sub kfuel n1 m_init (b_hd :: b_tl) := by + unfold try_absorb_sub + cases sub_lsb kfuel false (b_hd :: b_tl) (build_vprime n1 m_init) with + | some out => rfl + | none => + dsimp only + by_cases hle1 : m_init ≤ 1 + · rw [if_pos hle1, decide_eq_true hle1, if_true_eq_true] + · rw [if_neg hle1, decide_eq_false hle1, if_false_eq_true] + rw [hsub_eq] + cases try_absorb_sub kfuel n1 m_init (b_hd :: b_tl) with + | none => rfl + | some pair_out => + rcases pair_out with ⟨m_use, out⟩ + dsimp only + generalize count_stack_mut 13 4 kfuel m_use r1 = res2 + rcases res2 with ⟨n2, r2⟩ + rw [with_prod_eq]; dsimp only + simp only [some_mstate_eq] + by_cases hres2 : n2 = m_use + · simp [hres2] + · have hne2 : (n2 == m_use) = false := beq_eq_false_iff_ne.mpr hres2 + rw [hne2]; simp [hres2] + · rfl + +theorem step_prim_p_eq + {push_stack_f} (h1 : push_stack_f = push_stack) + {pop1_b_f} (h2 : pop1_b_f = fun s => ((pop1 s).1 == 1, (pop1 s).2)) : + step_prim_f_p push_stack_f pop1_b_f = step_prim := by + subst h1; subst h2; funext s + unfold step_prim_f_p step_prim + rcases s with ⟨q, l, r⟩ + simp only [bool_rec_eq, with_prod_eq, some_mstate_eq, bit_pat_eq] + rcases hpr : pop1 r with ⟨b_r, r_rest⟩ + dsimp only + rcases q with ⟨_ | _ | _ | _ | _ | _ | q, hq⟩ <;> + rcases b_r with ⟨_ | _ | b_r, hb⟩ <;> (try rfl) <;> (try omega) + +theorem step_m_p_eq + {do_shift_right_f : Nat → Fin 6 → Nat → Nat → Nat → Nat → MState → Option MState} (h1 : do_shift_right_f 8 = do_shift_right) + {do_shift_left_f : Nat → Fin 6 → Nat → Nat → Nat → Nat → MState → Option MState} (h2 : do_shift_left_f 8 = do_shift_left) + {try_pair_stack_f : Nat → MState → Option MState} (h3 : try_pair_stack_f = try_pair_stack) + {try_absorb_stack_f : Nat → MState → Option MState} (h4 : try_absorb_stack_f = try_absorb_stack) + {step_prim_f} (h5 : step_prim_f = step_prim) : + step_m_f_p do_shift_right_f do_shift_left_f try_pair_stack_f try_absorb_stack_f step_prim_f 8 = step_m := by + subst h5; funext s; unfold step_m_f_p; rw [h1, h2, h3, h4]; unfold step_m + rcases hq : s.q.val with _ | _ | _ | _ | n + · unfold step_m_q0; dsimp only + cases try_pair_stack (Nat.add (Nat.add s.l.length s.r.length) 4) s <;> + cases try_absorb_stack (Nat.add (Nat.add s.l.length s.r.length) 4) s <;> + cases do_shift_right 0 3 1 1 1 s <;> rfl + · unfold step_m_q1 + cases do_shift_left 1 1 1 0 1 s <;> rfl + · unfold step_m_q2 + cases do_shift_left 2 2 3 1 2 s <;> rfl + · unfold step_m_q3 + cases do_shift_right 3 1 1 0 1 s <;> + cases do_shift_right 3 3 2 1 1 s <;> + cases do_shift_right 3 4 10 14 4 s <;> + cases do_shift_right 3 4 5 7 4 s <;> rfl + · rfl + + +noncomputable def step_m_f_inst (k128 : Nat) : MState → Option MState := +(fun (mkBlock_f : Nat → Nat → Nat → Block) => +(fun (rot1_f : Nat → Nat → Nat) => +(fun (rot_mod_f : Nat → Nat → Nat → Nat) => +(fun (bit_of_bool_f : Nat → Bool) => +(fun (push_stack_aux_f : Block → Stack → Stack) => +(fun (push_stack_f : Nat → Nat → Nat → Stack → Stack) => +(fun (drop_stack_f : Nat → Stack → Stack) => +(fun (pop1_b_f : Stack → Bool × Stack) => +(fun (pop_word_f : Nat → Nat → Stack → Option Stack) => +(fun (fast_match_f : Nat → Nat → Block → Bool) => +(fun (count_stack_mut_f : Nat → Nat → Nat → Nat → Stack → Nat × Stack) => +(fun (mkPart_f : Bool → Nat → PartList → PartList) => +(fun (bsize_parts_f : PartList → Nat) => +(fun (put_l_parts_f : PartList → Stack → Stack) => +(fun (put_l_stack_f : PartList → Nat → Stack → Stack) => +(fun (put_r_rec_f : PartList → Nat → Stack → Stack) => +(fun (parse_step_l_f : Nat → Stack → Option (Bool × Nat × Stack)) => +(fun (parse_l_f : Nat → Nat → Stack → PartList × Stack) => +(fun (parse_step_r_f : Nat → Stack → Option (Bool × Nat × Stack)) => +(fun (parse_r_f : Nat → Nat → Stack → PartList × Stack) => +(fun (sub_lsb_f : Nat → Bool → PartList → PartList → Option PartList) => +(fun (choose_limit_r_f : Nat → Nat → Nat → Stack → Nat) => +(fun (push_prefix_l_f : Stack → Stack) => +(fun (build_vprime_f : Nat → Nat → PartList) => +(fun (do_shift_right_f : Nat → Fin 6 → Nat → Nat → Nat → Nat → MState → Option MState) => +(fun (do_shift_left_f : Nat → Fin 6 → Nat → Nat → Nat → Nat → MState → Option MState) => +(fun (try_pair_stack_f : Nat → MState → Option MState) => +(fun (try_absorb_stack_f : Nat → MState → Option MState) => +(fun (step_prim_f : MState → Option MState) => +(fun (step_m_f : Nat → MState → Option MState) => +step_m_f k128 +) (step_m_f_p do_shift_right_f do_shift_left_f try_pair_stack_f try_absorb_stack_f step_prim_f) +) (step_prim_f_p push_stack_f pop1_b_f) +) (try_absorb_stack_f_p push_stack_f pop_word_f count_stack_mut_f bsize_parts_f put_r_rec_f parse_r_f sub_lsb_f choose_limit_r_f push_prefix_l_f build_vprime_f) +) (try_pair_stack_f_p pop_word_f bsize_parts_f put_l_stack_f put_r_rec_f parse_l_f parse_r_f sub_lsb_f choose_limit_r_f push_prefix_l_f) +) (do_shift_left_f_p bit_of_bool_f push_stack_f pop1_b_f pop_word_f count_stack_mut_f) +) (do_shift_right_f_p push_stack_f pop_word_f count_stack_mut_f) +) (build_vprime_f_p mkPart_f) +) (push_prefix_l_f_p push_stack_f) +) (choose_limit_r_f_p drop_stack_f pop1_b_f pop_word_f) +) (sub_lsb_f_p mkPart_f) +) (parse_r_f_p push_stack_f pop1_b_f parse_step_r_f) +) (parse_step_r_f_p drop_stack_f pop_word_f) +) (parse_l_f_p parse_step_l_f) +) (parse_step_l_f_p drop_stack_f pop_word_f) +) (put_r_rec_f_p push_stack_f) +) (put_l_stack_f_p push_stack_f bsize_parts_f put_l_parts_f) +) (put_l_parts_f_p push_stack_f) +) bsize_parts_f_p +) mkPart_f_p +) (count_stack_mut_f_p drop_stack_f pop_word_f fast_match_f) +) fast_match_f_p +) (pop_word_f_p bit_of_bool_f pop1_b_f) +) (pop1_b_f_p mkBlock_f rot1_f bit_of_bool_f) +) (drop_stack_f_p mkBlock_f rot_mod_f) +) (push_stack_f_p mkBlock_f push_stack_aux_f) +) (push_stack_aux_f_p mkBlock_f rot_mod_f) +) bit_of_bool_f_p +) rot_mod_f_p +) rot1_f_p +) mkBlock_f_p + + + + +noncomputable def consBlock1 (p w l : Nat) (rest : Stack) : Stack := + let p0 : Nat := match p with + | 0 => 0 | 1 => 1 | 2 => 2 | 3 => 3 | 4 => 4 | 5 => 5 | 6 => 6 | 7 => 7 + | 8 => 8 | 9 => 9 | 10 => 10 | 11 => 11 | 12 => 12 | 13 => 13 | 14 => 14 | 15 => 15 | n => n + let w0 : Nat := match w with + | 1 => 1 | 2 => 2 | 3 => 3 | 4 => 4 | n => n + @Nat.rec (fun _ => Stack) [] (fun l1 _ => ⟨p0, w0, l1⟩ :: rest) (Nat.add 1 l) + +theorem consBlock1_eq (p w l : Nat) (rest : Stack) : + consBlock1 p w l rest = ⟨p, w, l⟩ :: rest := by + unfold consBlock1 + have hp : (match p with + | 0 => 0 | 1 => 1 | 2 => 2 | 3 => 3 | 4 => 4 | 5 => 5 | 6 => 6 | 7 => 7 + | 8 => 8 | 9 => 9 | 10 => 10 | 11 => 11 | 12 => 12 | 13 => 13 | 14 => 14 | 15 => 15 | n => n) = p := by + match p with + | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | n + 16 => rfl + have hw : (match w with + | 1 => 1 | 2 => 2 | 3 => 3 | 4 => 4 | n => n) = w := by + match w with + | 0 | 1 | 2 | 3 | 4 | n + 5 => rfl + have hl : Nat.add 1 l = Nat.succ l := Nat.add_comm 1 l + rw [hp, hw, hl] + +theorem mkBlock_f_p_eq (p w l : Nat) : + mkBlock_f_p p w l = ⟨p, w, l⟩ := by + unfold mkBlock_f_p + have hp : Nat.add 1 p = Nat.succ p := Nat.add_comm 1 p + have hw : Nat.add 1 w = Nat.succ w := Nat.add_comm 1 w + have hl : Nat.add 1 l = Nat.succ l := Nat.add_comm 1 l + rw [hp, hw, hl] + +noncomputable def push_stack_aux_fast_fuel (fuel : Nat) : Nat → Nat → Nat → Stack → Stack := + @Nat.rec (fun _ => Nat → Nat → Nat → Stack → Stack) + (fun p w l rest => consBlock1 p w l rest) + (fun _ ih p w l s => + match s with + | [] => @Bool.rec (fun _ => Stack) (consBlock1 p w l []) [] (Nat.beq p 0) + | top :: rest => + @Bool.rec (fun _ => Stack) + (consBlock1 p w l (top :: rest)) + (ih p w (Nat.add l top.len) rest) + (Bool.and (Nat.beq w top.width) (Nat.beq (rot_mod_f_p w l p) top.pat))) + fuel + +theorem push_stack_aux_fast_fuel_eq (fuel : Nat) (s : Stack) (hs : s.length < fuel) (p w l : Nat) : + push_stack_aux_fast_fuel fuel p w l s = + push_stack_aux_f_p mkBlock_f_p rot_mod_f_p ⟨p, w, l⟩ s := by + induction fuel generalizing s p w l with + | zero => cases hs + | succ k ih => + cases s with + | nil => + change @Bool.rec (fun _ => Stack) (consBlock1 p w l []) [] (Nat.beq p 0) = + @Bool.rec (fun _ => Stack) [⟨p, w, l⟩] [] (Nat.beq p 0) + cases Nat.beq p 0 <;> simp [consBlock1_eq] + | cons top rest => + have hlen : rest.length < k := by simp at hs; omega + change @Bool.rec (fun _ => Stack) + (consBlock1 p w l (top :: rest)) + (push_stack_aux_fast_fuel k p w (Nat.add l top.len) rest) + (Bool.and (Nat.beq w top.width) (Nat.beq (rot_mod_f_p w l p) top.pat)) = + @Bool.rec (fun _ => Stack) + (⟨p, w, l⟩ :: top :: rest) + (push_stack_aux_f_p mkBlock_f_p rot_mod_f_p (mkBlock_f_p p w (Nat.add l top.len)) rest) + (Bool.and (Nat.beq w top.width) (Nat.beq (rot_mod_f_p w l p) top.pat)) + cases Bool.and (Nat.beq w top.width) (Nat.beq (rot_mod_f_p w l p) top.pat) <;> + simp [consBlock1_eq, mkBlock_f_p_eq, ih rest hlen] + +noncomputable def push_stack_fast (p w l : Nat) (s : Stack) : Stack := + @Bool.rec (fun _ => Stack) (push_stack_aux_fast_fuel (Nat.add (List.length s) 1) p w l s) s (Nat.beq l 0) + +theorem push_stack_fast_eq : + push_stack_fast = push_stack_f_p mkBlock_f_p (push_stack_aux_f_p mkBlock_f_p rot_mod_f_p) := by + funext p w l s + unfold push_stack_fast push_stack_f_p + cases Nat.beq l 0 <;> simp [mkBlock_f_p_eq, push_stack_aux_fast_fuel_eq (s.length + 1) s (Nat.lt_succ_self s.length)] + +noncomputable def drop_stack_fast_fuel (fuel : Nat) : Nat → Stack → Stack := + @Nat.rec (fun _ => Nat → Stack → Stack) + (fun _ s => s) + (fun _ ih n s => + @Bool.rec (fun _ => Stack) + (match s with + | [] => [] + | top :: rest => + @Bool.rec (fun _ => Stack) + (consBlock1 (rot_mod_f_p top.width n top.pat) top.width (Nat.sub top.len n) rest) + (ih (Nat.sub n top.len) rest) + (Nat.ble top.len n)) + s + (Nat.beq n 0)) + fuel + +theorem drop_stack_fast_fuel_eq (fuel : Nat) (s : Stack) (hs : s.length < fuel) (n : Nat) : + drop_stack_fast_fuel fuel n s = drop_stack_f_p mkBlock_f_p rot_mod_f_p n s := by + induction fuel generalizing s n with + | zero => cases hs + | succ k ih => + cases s with + | nil => + change @Bool.rec (fun _ => Stack) [] [] (Nat.beq n 0) = [] + cases Nat.beq n 0 <;> rfl + | cons top rest => + have hlen : rest.length < k := by simp at hs; omega + change @Bool.rec (fun _ => Stack) + (@Bool.rec (fun _ => Stack) + (consBlock1 (rot_mod_f_p top.width n top.pat) top.width (Nat.sub top.len n) rest) + (drop_stack_fast_fuel k (Nat.sub n top.len) rest) + (Nat.ble top.len n)) + (top :: rest) + (Nat.beq n 0) = + @Bool.rec (fun _ => Stack) + (@Bool.rec (fun _ => Stack) + (mkBlock_f_p (rot_mod_f_p top.width n top.pat) top.width (Nat.sub top.len n) :: rest) + (drop_stack_f_p mkBlock_f_p rot_mod_f_p (Nat.sub n top.len) rest) + (Nat.ble top.len n)) + (top :: rest) + (Nat.beq n 0) + cases Nat.beq n 0 <;> cases Nat.ble top.len n <;> simp [consBlock1_eq, mkBlock_f_p_eq, ih rest hlen] + +noncomputable def drop_stack_fast (n : Nat) (s : Stack) : Stack := + drop_stack_fast_fuel (Nat.add (List.length s) 1) n s + +theorem drop_stack_fast_eq : + drop_stack_fast = drop_stack_f_p mkBlock_f_p rot_mod_f_p := by + funext n s + exact drop_stack_fast_fuel_eq (s.length + 1) s (Nat.lt_succ_self s.length) n + +noncomputable def pop1_b_fast_fuel (fuel : Nat) : Stack → Bool × Stack := + @Nat.rec (fun _ => Stack → Bool × Stack) + (fun _ => (false, [])) + (fun _ ih s => + match s with + | [] => (false, []) + | top :: rest => + @Bool.rec (fun _ => Bool × Stack) + (let bit := bit_of_bool_f_p top.pat + @Bool.rec (fun _ => Bool × Stack) + (bit, consBlock1 (rot1_f_p top.width top.pat) top.width (Nat.sub top.len 1) rest) + (bit, rest) + (Nat.beq top.len 1)) + (ih rest) + (Nat.beq top.len 0)) + fuel + +theorem pop1_b_fast_fuel_eq (fuel : Nat) (s : Stack) (hs : s.length < fuel) : + pop1_b_fast_fuel fuel s = pop1_b_f_p mkBlock_f_p rot1_f_p bit_of_bool_f_p s := by + induction fuel generalizing s with + | zero => cases hs + | succ k ih => + cases s with + | nil => rfl + | cons top rest => + have hlen : rest.length < k := by simp at hs; omega + change @Bool.rec (fun _ => Bool × Stack) + (@Bool.rec (fun _ => Bool × Stack) + (bit_of_bool_f_p top.pat, consBlock1 (rot1_f_p top.width top.pat) top.width (Nat.sub top.len 1) rest) + (bit_of_bool_f_p top.pat, rest) + (Nat.beq top.len 1)) + (pop1_b_fast_fuel k rest) + (Nat.beq top.len 0) = + @Bool.rec (fun _ => Bool × Stack) + (@Bool.rec (fun _ => Bool × Stack) + (bit_of_bool_f_p top.pat, mkBlock_f_p (rot1_f_p top.width top.pat) top.width (Nat.sub top.len 1) :: rest) + (bit_of_bool_f_p top.pat, rest) + (Nat.beq top.len 1)) + (pop1_b_f_p mkBlock_f_p rot1_f_p bit_of_bool_f_p rest) + (Nat.beq top.len 0) + cases Nat.beq top.len 0 <;> cases Nat.beq top.len 1 <;> simp [consBlock1_eq, mkBlock_f_p_eq, ih rest hlen] + +noncomputable def pop1_b_fast (s : Stack) : Bool × Stack := + pop1_b_fast_fuel (Nat.add (List.length s) 1) s + +theorem pop1_b_fast_eq : + pop1_b_fast = pop1_b_f_p mkBlock_f_p rot1_f_p bit_of_bool_f_p := by + funext s + exact pop1_b_fast_fuel_eq (s.length + 1) s (Nat.lt_succ_self s.length) + + +noncomputable def bit_of_bool_f0 : Nat → Bool := bit_of_bool_f_p +noncomputable def push_stack_f0 : Nat → Nat → Nat → Stack → Stack := push_stack_fast +noncomputable def drop_stack_f0 : Nat → Stack → Stack := drop_stack_fast +noncomputable def pop1_b_f0 : Stack → Bool × Stack := pop1_b_fast +noncomputable def pop_word_f0 : Nat → Nat → Stack → Option Stack := pop_word_f_p bit_of_bool_f0 pop1_b_f0 +noncomputable def fast_match_f0 : Nat → Nat → Block → Bool := fast_match_f_p +noncomputable def count_stack_mut_f0 : Nat → Nat → Nat → Nat → Stack → Nat × Stack := count_stack_mut_f_p drop_stack_f0 pop_word_f0 fast_match_f0 +noncomputable def mkPart_f0 : Bool → Nat → PartList → PartList := mkPart_f_p +noncomputable def bsize_parts_f0 : PartList → Nat := bsize_parts_f_p +noncomputable def put_l_parts_f0 : PartList → Stack → Stack := put_l_parts_f_p push_stack_f0 +noncomputable def put_l_stack_f0 : PartList → Nat → Stack → Stack := put_l_stack_f_p push_stack_f0 bsize_parts_f0 put_l_parts_f0 +noncomputable def put_r_rec_f0 : PartList → Nat → Stack → Stack := put_r_rec_f_p push_stack_f0 +noncomputable def parse_step_l_f0 : Nat → Stack → Option (Bool × Nat × Stack) := parse_step_l_f_p drop_stack_f0 pop_word_f0 +noncomputable def parse_l_f0 : Nat → Nat → Stack → PartList × Stack := parse_l_f_p parse_step_l_f0 +noncomputable def parse_step_r_f0 : Nat → Stack → Option (Bool × Nat × Stack) := parse_step_r_f_p drop_stack_f0 pop_word_f0 +noncomputable def parse_r_f0 : Nat → Nat → Stack → PartList × Stack := parse_r_f_p push_stack_f0 pop1_b_f0 parse_step_r_f0 +noncomputable def sub_lsb_f0 : Nat → Bool → PartList → PartList → Option PartList := sub_lsb_f_p mkPart_f0 +noncomputable def choose_limit_r_f0 : Nat → Nat → Nat → Stack → Nat := choose_limit_r_f_p drop_stack_f0 pop1_b_f0 pop_word_f0 +noncomputable def push_prefix_l_f0 : Stack → Stack := push_prefix_l_f_p push_stack_f0 +noncomputable def build_vprime_f0 : Nat → Nat → PartList := build_vprime_f_p mkPart_f0 +noncomputable def do_shift_right_f0 : Nat → Fin 6 → Nat → Nat → Nat → Nat → MState → Option MState := do_shift_right_f_p push_stack_f0 pop_word_f0 count_stack_mut_f0 +noncomputable def do_shift_left_f0 : Nat → Fin 6 → Nat → Nat → Nat → Nat → MState → Option MState := do_shift_left_f_p bit_of_bool_f0 push_stack_f0 pop1_b_f0 pop_word_f0 count_stack_mut_f0 +noncomputable def try_pair_stack_f0 : Nat → MState → Option MState := try_pair_stack_f_p pop_word_f0 bsize_parts_f0 put_l_stack_f0 put_r_rec_f0 parse_l_f0 parse_r_f0 sub_lsb_f0 choose_limit_r_f0 push_prefix_l_f0 +noncomputable def try_absorb_stack_f0 : Nat → MState → Option MState := try_absorb_stack_f_p push_stack_f0 pop_word_f0 count_stack_mut_f0 bsize_parts_f0 put_r_rec_f0 parse_r_f0 sub_lsb_f0 choose_limit_r_f0 push_prefix_l_f0 build_vprime_f0 +noncomputable def step_prim_f0 : MState → Option MState := step_prim_f_p push_stack_f0 pop1_b_f0 +noncomputable def step_m_c0 : MState → Option MState := step_m_f_p do_shift_right_f0 do_shift_left_f0 try_pair_stack_f0 try_absorb_stack_f0 step_prim_f0 8 + +theorem step_m_c0_eq : step_m_c0 = step_m := + let h01 := mkBlock_p_eq + let h02 := rot1_p_eq + let h03 := rot_mod_p_eq + let h04 := bit_of_bool_p_eq + let h05 := push_stack_aux_p_eq h01 h03 + let h06 := push_stack_fast_eq.trans (push_stack_p_eq h01 h05) + let h07 := drop_stack_fast_eq.trans (drop_stack_p_eq h01 h03) + let h08 := pop1_b_fast_eq.trans (pop1_b_p_eq h01 h02 h04) + let h09 := pop_word_p_eq h04 h08 + let h10 := fast_match_p_eq + let h11 := count_stack_mut_p_eq h07 h09 h10 + let h12 := mkPart_p_eq + let h13 := bsize_parts_p_eq + let h14 := put_l_parts_p_eq h06 + let h15 := put_l_stack_p_eq h06 h13 h14 + let h16 := put_r_rec_p_eq h06 + let h17 := parse_step_l_p_eq h07 h09 + let h18 := parse_l_p_eq h17 + let h19 := parse_step_r_p_eq h07 h09 + let h20 := parse_r_p_eq h06 h08 h19 + let h21 := sub_lsb_p_eq h12 + let h22 := choose_limit_r_p_eq h07 h08 h09 + let h23 := push_prefix_l_p_eq h06 + let h24 := build_vprime_p_eq h12 + let h25 := do_shift_right_p_eq h06 h09 h11 + let h26 := do_shift_left_p_eq h04 h06 h08 h09 h11 + let h27 := try_pair_stack_p_eq h09 h13 h15 h16 h18 h20 h21 h22 h23 + let h28 := try_absorb_stack_p_eq h06 h09 h11 h13 h16 h20 h21 h22 h23 h24 + let h29 := step_prim_p_eq h06 h08 + step_m_p_eq h25 h26 h27 h28 h29 + +noncomputable def run_m_fast (fuel : Nat) (s0 : MState) : Option MState := + @Nat.rec (fun _ => MState → Option MState) + (fun s => some s) + (fun _ ih s => + match step_m_c0 s with + | none => none + | some s1 => ih s1) + fuel s0 + +theorem run_m_loop_eq {step_f : MState → Option MState} + (hstep : step_f = step_m) (fuel : Nat) (s0 : MState) : + @Nat.rec (fun _ => MState → Option MState) + (fun s => some s) + (fun _ ih s => + match step_f s with + | none => none + | some s1 => ih s1) + fuel s0 = run_m fuel s0 := by + subst hstep + induction fuel generalizing s0 with + | zero => rfl + | succ i ih => + unfold run_m + simp only [maybe_norm_eq] + cases hs : step_m s0 with + | none => rfl + | some s1 => exact ih s1 + +theorem run_m_fast_eq (fuel : Nat) (s0 : MState) : + run_m_fast fuel s0 = run_m fuel s0 := + run_m_loop_eq step_m_c0_eq fuel s0 + +noncomputable def block_beq (a b : Block) : Bool := + Bool.and (Nat.beq a.pat b.pat) (Bool.and (Nat.beq a.width b.width) (Nat.beq a.len b.len)) + +theorem block_beq_eq {a b : Block} (h : block_beq a b = true) : a = b := by + rcases a with ⟨p1, w1, l1⟩; rcases b with ⟨p2, w2, l2⟩ + simp only [block_beq, Bool.and_eq_true, Nat.beq_eq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + rfl + +noncomputable def stack_beq : Stack → Stack → Bool := + @List.rec Block (fun _ => Stack → Bool) + (fun ys => @List.rec Block (fun _ => Bool) true (fun _ _ _ => false) ys) + (fun x _ ih ys => + @List.rec Block (fun _ => Bool) false (fun y ys2 _ => Bool.and (block_beq x y) (ih ys2)) ys) + +theorem stack_beq_eq : ∀ {xs ys : Stack}, stack_beq xs ys = true → xs = ys + | [], [], _ => rfl + | x :: xs, y :: ys, h => by + simp only [stack_beq, Bool.and_eq_true] at h + rw [block_beq_eq h.1, stack_beq_eq h.2] + +noncomputable def opt_mstate_beq (o : Option MState) (target : MState) : Bool := + match o with + | none => false + | some s => + Bool.and (Nat.beq s.q.val target.q.val) + (Bool.and (stack_beq s.l target.l) (stack_beq s.r target.r)) + +theorem opt_mstate_beq_eq {o : Option MState} {t : MState} (h : opt_mstate_beq o t = true) : + o = some t := by + cases o with + | none => cases h + | some s => + rcases s with ⟨q1, l1, r1⟩; rcases t with ⟨q2, l2, r2⟩ + simp only [opt_mstate_beq, Bool.and_eq_true, Nat.beq_eq] at h + rcases h with ⟨hq, hl, hr⟩ + rw [Fin.ext hq, stack_beq_eq hl, stack_beq_eq hr] + +theorem mreach_base_fast {k : Nat} {s1 s2 : MState} (h : opt_mstate_beq (run_m_fast k s1) s2 = true) : MReach s1 s2 := + ⟨k, (run_m_fast_eq k s1).symm.trans (opt_mstate_beq_eq h)⟩ + +theorem mreach_step_fast {k : Nat} {s1 s2 s3 : MState} + (h1 : opt_mstate_beq (run_m_fast k s1) s2 = true) (h2 : MReach s2 s3) : MReach s1 s3 := + let ⟨n, hn⟩ := h2 + ⟨k + n, run_m_trans ((run_m_fast_eq k s1).symm.trans (opt_mstate_beq_eq h1)) hn⟩ + + +def cfg_p0 : MState := cfg_0 +def cfg_p20 : MState := ⟨0, [⟨1, 1, 4⟩, ⟨0, 1, 1⟩, ⟨1, 1, 3⟩, ⟨14, 4, 4⟩, ⟨1, 1, 12⟩, ⟨14, 4, 12⟩, ⟨1, 1, 4⟩, ⟨14, 4, 20⟩, ⟨1, 1, 12⟩, ⟨14, 4, 16⟩, ⟨1, 1, 4⟩, ⟨14, 4, 8⟩, ⟨13, 4, 229⟩, ⟨1, 1, 1⟩], [⟨1, 3, 1⟩, ⟨0, 1, 1⟩, ⟨1, 1, 1⟩, ⟨0, 1, 5⟩, ⟨1, 3, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 84⟩, ⟨0, 1, 6⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p40 : MState := ⟨0, [⟨1, 1, 7⟩, ⟨0, 1, 1⟩, ⟨1, 1, 11⟩, ⟨13, 4, 1⟩, ⟨1, 1, 9⟩, ⟨13, 4, 1⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 692⟩, ⟨1, 1, 1⟩], [⟨0, 1, 18⟩, ⟨1, 1, 1⟩, ⟨0, 1, 14⟩, ⟨1, 3, 9⟩, ⟨0, 1, 9⟩, ⟨1, 3, 57⟩, ⟨0, 1, 48⟩, ⟨1, 3, 3⟩, ⟨0, 1, 192⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p60 : MState := ⟨2, [⟨1, 1, 1⟩, ⟨7, 4, 8⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 24⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 12⟩, ⟨13, 4, 1377⟩, ⟨1, 1, 1⟩], [⟨1, 1, 2⟩, ⟨0, 1, 13⟩, ⟨1, 1, 1⟩, ⟨0, 1, 26⟩, ⟨1, 1, 1⟩, ⟨0, 1, 8⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 72⟩, ⟨1, 3, 6⟩, ⟨0, 1, 99⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 12⟩, ⟨1, 3, 9⟩, ⟨0, 1, 3⟩, ⟨1, 3, 12⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 15⟩, ⟨1, 3, 54⟩, ⟨0, 1, 6⟩, ⟨1, 3, 589⟩]⟩ +def cfg_p80 : MState := ⟨3, [⟨1, 1, 6⟩, ⟨0, 1, 1⟩, ⟨1, 1, 3⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 28⟩, ⟨1, 1, 4⟩, ⟨14, 4, 92⟩, ⟨1, 1, 4⟩, ⟨14, 4, 464⟩, ⟨1, 1, 4⟩, ⟨14, 4, 1372⟩, ⟨1, 1, 1⟩], [⟨1, 1, 1⟩, ⟨0, 1, 5⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 9⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 126⟩, ⟨1, 3, 27⟩, ⟨0, 1, 3⟩, ⟨1, 3, 9⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 9⟩, ⟨0, 1, 234⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p100 : MState := ⟨4, [⟨1, 1, 3⟩, ⟨7, 4, 4⟩, ⟨1, 1, 12⟩, ⟨14, 4, 12⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 4⟩, ⟨1, 1, 16⟩, ⟨14, 4, 4⟩, ⟨13, 4, 9⟩, ⟨1, 1, 8⟩, ⟨14, 4, 2292⟩, ⟨1, 1, 1⟩], [⟨2, 2, 3⟩, ⟨1, 1, 1⟩, ⟨0, 1, 16⟩, ⟨1, 1, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 51⟩, ⟨0, 1, 12⟩, ⟨1, 3, 3⟩, ⟨0, 1, 15⟩, ⟨1, 3, 15⟩, ⟨0, 1, 3⟩, ⟨1, 3, 348⟩, ⟨0, 1, 3⟩, ⟨1, 3, 1029⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 90⟩, ⟨1, 3, 6⟩, ⟨0, 1, 48⟩, ⟨1, 3, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p120 : MState := ⟨4, [⟨1, 1, 5⟩, ⟨0, 1, 1⟩, ⟨1, 1, 3⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 876⟩, ⟨1, 1, 132⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 8⟩, ⟨1, 1, 8⟩, ⟨14, 4, 156⟩, ⟨1, 1, 4⟩, ⟨14, 4, 24⟩, ⟨1, 1, 40⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 40⟩, ⟨1, 1, 4⟩, ⟨14, 4, 20⟩, ⟨1, 1, 4⟩, ⟨14, 4, 16⟩, ⟨1, 1, 12⟩, ⟨14, 4, 4⟩, ⟨1, 1, 16⟩, ⟨14, 4, 76⟩, ⟨1, 1, 4⟩, ⟨14, 4, 588⟩, ⟨13, 4, 1817⟩, ⟨1, 1, 1⟩], [⟨0, 1, 1⟩, ⟨1, 1, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 87⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 159⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p140 : MState := ⟨0, [⟨1, 1, 1⟩, ⟨0, 1, 1⟩, ⟨7, 4, 8⟩, ⟨1, 1, 25⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 48⟩, ⟨13, 4, 2⟩, ⟨1, 1, 12⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 8⟩, ⟨13, 4, 1⟩, ⟨13, 4, 1⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 4368⟩, ⟨1, 1, 1⟩], [⟨0, 1, 5⟩, ⟨1, 3, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 12⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 42⟩, ⟨1, 3, 75⟩, ⟨0, 1, 54⟩, ⟨1, 3, 99⟩, ⟨0, 1, 3⟩, ⟨1, 3, 579⟩, ⟨0, 1, 99⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 117⟩, ⟨0, 1, 3⟩, ⟨1, 3, 18⟩, ⟨0, 1, 30⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 30⟩, ⟨0, 1, 3⟩, ⟨1, 3, 15⟩, ⟨0, 1, 3⟩, ⟨1, 3, 12⟩, ⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 12⟩, ⟨1, 3, 57⟩, ⟨0, 1, 3⟩, ⟨1, 3, 441⟩, ⟨0, 1, 6⟩, ⟨1, 3, 1360⟩]⟩ +def cfg_p160 : MState := ⟨3, [⟨7, 4, 8⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4824⟩, ⟨1, 1, 1⟩], [⟨1, 1, 1⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 18⟩, ⟨0, 1, 9⟩, ⟨1, 3, 93⟩, ⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 141⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 261⟩, ⟨0, 1, 99⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 117⟩, ⟨0, 1, 3⟩, ⟨1, 3, 18⟩, ⟨0, 1, 30⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 30⟩, ⟨0, 1, 3⟩, ⟨1, 3, 15⟩, ⟨0, 1, 3⟩, ⟨1, 3, 12⟩, ⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 12⟩, ⟨1, 3, 57⟩, ⟨0, 1, 3⟩, ⟨1, 3, 441⟩, ⟨0, 1, 6⟩, ⟨1, 3, 1362⟩, ⟨0, 1, 762⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p180 : MState := ⟨0, [⟨1, 1, 1⟩, ⟨0, 1, 1⟩, ⟨1, 1, 23⟩, ⟨13, 4, 1⟩, ⟨1, 1, 8⟩, ⟨14, 4, 80⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 12⟩, ⟨1, 1, 4⟩, ⟨14, 4, 36⟩, ⟨13, 4, 177⟩, ⟨1, 1, 4⟩, ⟨14, 4, 20⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 80⟩, ⟨14, 4, 100⟩, ⟨1, 1, 4⟩, ⟨14, 4, 44⟩, ⟨1, 1, 12⟩, ⟨14, 4, 12⟩, ⟨1, 1, 16⟩, ⟨14, 4, 24⟩, ⟨1, 1, 4⟩, ⟨14, 4, 36⟩, ⟨1, 1, 12⟩, ⟨14, 4, 8⟩, ⟨1, 1, 8⟩, ⟨14, 4, 4⟩, ⟨1, 1, 12⟩, ⟨14, 4, 8⟩, ⟨1, 1, 8⟩, ⟨14, 4, 8⟩, ⟨1, 1, 12⟩, ⟨14, 4, 4⟩, ⟨13, 4, 4841⟩, ⟨1, 1, 1⟩], [⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 12⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 12⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 30⟩, ⟨0, 1, 3⟩, ⟨1, 3, 15⟩, ⟨0, 1, 3⟩, ⟨1, 3, 12⟩, ⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 12⟩, ⟨1, 3, 57⟩, ⟨0, 1, 3⟩, ⟨1, 3, 441⟩, ⟨0, 1, 6⟩, ⟨1, 3, 1362⟩, ⟨0, 1, 762⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p200 : MState := ⟨4, [⟨1, 1, 3⟩, ⟨7, 4, 7⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 120⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 9⟩, ⟨14, 4, 8⟩, ⟨1, 1, 12⟩, ⟨14, 4, 72⟩, ⟨1, 1, 4⟩, ⟨14, 4, 12⟩, ⟨1, 1, 4⟩, ⟨14, 4, 20⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 40⟩, ⟨14, 4, 5688⟩, ⟨1, 1, 1⟩], [⟨2, 2, 3⟩, ⟨1, 1, 1⟩, ⟨0, 1, 22⟩, ⟨1, 1, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 9⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 9⟩, ⟨0, 1, 12⟩, ⟨1, 3, 18⟩, ⟨0, 1, 3⟩, ⟨1, 3, 27⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 39⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 1356⟩, ⟨0, 1, 762⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1431⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p220 : MState := ⟨4, [⟨7, 4, 3⟩, ⟨13, 4, 1⟩, ⟨1, 1, 12⟩, ⟨14, 4, 4⟩, ⟨1, 1, 16⟩, ⟨14, 4, 48⟩, ⟨1, 1, 12⟩, ⟨14, 4, 4⟩, ⟨1, 1, 12⟩, ⟨14, 4, 4⟩, ⟨1, 1, 32⟩, ⟨14, 4, 8⟩, ⟨1, 1, 12⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 12⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 12⟩, ⟨14, 4, 8⟩, ⟨13, 4, 9⟩, ⟨1, 1, 4⟩, ⟨14, 4, 6200⟩, ⟨1, 1, 1⟩], [⟨0, 1, 2⟩, ⟨1, 2, 20⟩, ⟨1, 1, 1⟩, ⟨0, 1, 4⟩, ⟨1, 1, 1⟩, ⟨0, 1, 11⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1209⟩, ⟨1, 3, 3⟩, ⟨0, 1, 759⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1431⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 675⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 90⟩, ⟨1, 3, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p240 : MState := ⟨1, [⟨1, 1, 2⟩, ⟨0, 1, 1⟩, ⟨1, 1, 1⟩, ⟨7, 4, 8⟩, ⟨1, 1, 16⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 2044⟩, ⟨1, 1, 4⟩, ⟨14, 4, 7916⟩, ⟨1, 1, 1⟩], [⟨0, 1, 2⟩, ⟨2, 3, 13⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 15⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 72⟩, ⟨0, 1, 3⟩, ⟨1, 3, 228⟩, ⟨0, 1, 270⟩, ⟨1, 3, 6⟩, ⟨0, 1, 15⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 45⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 84⟩, ⟨1, 3, 96⟩, ⟨0, 1, 12⟩, ⟨1, 3, 12⟩, ⟨0, 1, 12⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 411⟩, ⟨0, 1, 3255⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p260 : MState := ⟨3, [⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 10292⟩, ⟨1, 1, 1⟩], [⟨0, 1, 1⟩, ⟨1, 2, 8⟩, ⟨1, 1, 1⟩, ⟨0, 1, 1⟩, ⟨1, 1, 1⟩, ⟨0, 1, 6⟩, ⟨1, 3, 12⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 30⟩, ⟨0, 1, 3⟩, ⟨1, 3, 39⟩, ⟨0, 1, 3⟩, ⟨1, 3, 9⟩, ⟨0, 1, 270⟩, ⟨1, 3, 6⟩, ⟨0, 1, 15⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 45⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 84⟩, ⟨1, 3, 96⟩, ⟨0, 1, 12⟩, ⟨1, 3, 12⟩, ⟨0, 1, 12⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 411⟩, ⟨0, 1, 174⟩, ⟨1, 3, 3081⟩, ⟨0, 1, 48⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 2775⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p280 : MState := ⟨3, [⟨7, 4, 8⟩, ⟨1, 1, 13⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 10748⟩, ⟨1, 1, 1⟩], [⟨1, 1, 1⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 15⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 9⟩, ⟨1, 3, 9⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 54⟩, ⟨0, 1, 3⟩, ⟨1, 3, 93⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 9⟩, ⟨0, 1, 12⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 411⟩, ⟨0, 1, 174⟩, ⟨1, 3, 3081⟩, ⟨0, 1, 48⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 2775⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 759⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p300 : MState := ⟨1, [⟨0, 1, 1⟩, ⟨1, 1, 1⟩, ⟨7, 4, 8⟩, ⟨1, 1, 13⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 28⟩, ⟨1, 1, 1⟩, ⟨7, 4, 3⟩, ⟨1, 1, 20⟩, ⟨13, 4, 1⟩, ⟨1, 1, 4⟩, ⟨14, 4, 16⟩, ⟨13, 4, 1⟩, ⟨1, 1, 4⟩, ⟨14, 4, 88⟩, ⟨1, 1, 4⟩, ⟨14, 4, 10912⟩, ⟨1, 1, 1⟩], [⟨0, 1, 2⟩, ⟨1, 1, 1⟩, ⟨0, 1, 1⟩, ⟨2, 3, 406⟩, ⟨0, 1, 174⟩, ⟨1, 3, 3081⟩, ⟨0, 1, 48⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 2775⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 759⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p320 : MState := ⟨2, [⟨1, 1, 3⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 36⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 12⟩, ⟨14, 4, 8⟩, ⟨1, 1, 4⟩, ⟨13, 4, 11917⟩, ⟨1, 1, 1⟩], [⟨0, 1, 1⟩, ⟨1, 2, 6⟩, ⟨1, 1, 1⟩, ⟨0, 1, 1⟩, ⟨1, 1, 1⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 132⟩, ⟨0, 1, 303⟩, ⟨1, 3, 2316⟩, ⟨0, 1, 48⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 2775⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 759⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1350⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 213⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p340 : MState := ⟨1, [⟨1, 1, 2⟩, ⟨0, 1, 1⟩, ⟨1, 1, 13⟩, ⟨0, 1, 1⟩, ⟨1, 1, 3⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 8⟩, ⟨1, 1, 4⟩, ⟨14, 4, 8⟩, ⟨1, 1, 1⟩, ⟨14, 4, 4⟩, ⟨1, 1, 20⟩, ⟨14, 4, 60⟩, ⟨1, 1, 4⟩, ⟨14, 4, 32⟩, ⟨1, 1, 4⟩, ⟨14, 4, 8⟩, ⟨1, 1, 4⟩, ⟨14, 4, 56⟩, ⟨1, 1, 96⟩, ⟨14, 4, 120⟩, ⟨1, 1, 12⟩, ⟨14, 4, 8⟩, ⟨1, 1, 8⟩, ⟨14, 4, 260⟩, ⟨1, 1, 4⟩, ⟨14, 4, 12200⟩, ⟨1, 1, 1⟩], [⟨0, 1, 2⟩, ⟨2, 3, 1⟩, ⟨0, 1, 47⟩, ⟨1, 1, 1⟩, ⟨0, 1, 5⟩, ⟨1, 3, 1779⟩, ⟨0, 1, 48⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 2775⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 759⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1350⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 213⟩, ⟨1, 3, 3⟩, ⟨0, 1, 948⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p360 : MState := ⟨3, [⟨7, 4, 8⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 80⟩, ⟨1, 1, 4⟩, ⟨14, 4, 13228⟩, ⟨1, 1, 1⟩], [⟨1, 1, 1⟩, ⟨1, 3, 15⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 30⟩, ⟨1, 1, 1⟩, ⟨0, 1, 8⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 195⟩, ⟨0, 1, 3⟩, ⟨1, 3, 1170⟩, ⟨0, 1, 48⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 2775⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 759⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1350⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 213⟩, ⟨1, 3, 3⟩, ⟨0, 1, 948⟩, ⟨1, 3, 3⟩, ⟨0, 1, 930⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p380 : MState := ⟨3, [⟨14, 4, 12⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 44⟩, ⟨1, 1, 1⟩, ⟨7, 4, 3⟩, ⟨1, 1, 8⟩, ⟨13, 4, 5⟩, ⟨1, 1, 12⟩, ⟨14, 4, 112⟩, ⟨13, 4, 1⟩, ⟨1, 1, 20⟩, ⟨14, 4, 4⟩, ⟨13, 4, 1⟩, ⟨1, 1, 4⟩, ⟨14, 4, 13548⟩, ⟨1, 1, 1⟩], [⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 996⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 2775⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 759⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1350⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 213⟩, ⟨1, 3, 3⟩, ⟨0, 1, 948⟩, ⟨1, 3, 3⟩, ⟨0, 1, 930⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p400 : MState := ⟨3, [⟨1, 1, 1⟩], [⟨0, 1, 1⟩, ⟨1, 2, 14108⟩, ⟨1, 1, 1⟩, ⟨0, 1, 10⟩, ⟨1, 1, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 15⟩, ⟨1, 3, 96⟩, ⟨0, 1, 9⟩, ⟨1, 3, 558⟩, ⟨0, 1, 48⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 2775⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 759⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1350⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 213⟩, ⟨1, 3, 3⟩, ⟨0, 1, 948⟩, ⟨1, 3, 3⟩, ⟨0, 1, 930⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 675⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p420 : MState := ⟨0, [⟨1, 1, 28⟩, ⟨0, 1, 1⟩, ⟨1, 1, 11⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 8⟩, ⟨13, 4, 14873⟩, ⟨1, 1, 1⟩], [⟨1, 3, 1⟩, ⟨0, 1, 1⟩, ⟨1, 3, 3⟩, ⟨0, 1, 51⟩, ⟨1, 3, 264⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 15⟩, ⟨1, 3, 3⟩, ⟨0, 1, 12⟩, ⟨1, 3, 12⟩, ⟨0, 1, 57⟩, ⟨1, 3, 63⟩, ⟨0, 1, 3⟩, ⟨1, 3, 243⟩, ⟨0, 1, 3⟩, ⟨1, 3, 1989⟩, ⟨0, 1, 153⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 759⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1350⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 213⟩, ⟨1, 3, 3⟩, ⟨0, 1, 948⟩, ⟨1, 3, 3⟩, ⟨0, 1, 930⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 675⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 1242⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p440 : MState := ⟨0, [⟨1, 1, 1⟩, ⟨0, 1, 1⟩, ⟨1, 1, 11⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 4⟩, ⟨1, 1, 24⟩, ⟨14, 4, 44⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨13, 4, 1⟩, ⟨1, 1, 4⟩, ⟨14, 4, 280⟩, ⟨1, 1, 4⟩, ⟨14, 4, 76⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 24⟩, ⟨13, 4, 85⟩, ⟨1, 1, 1⟩, ⟨7, 4, 3⟩, ⟨13, 4, 14873⟩, ⟨1, 1, 1⟩], [⟨1, 1, 1⟩, ⟨0, 1, 1⟩, ⟨2, 3, 1⟩, ⟨0, 1, 12⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 36⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 93⟩, ⟨1, 3, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 1989⟩, ⟨0, 1, 153⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 759⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1350⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 213⟩, ⟨1, 3, 3⟩, ⟨0, 1, 948⟩, ⟨1, 3, 3⟩, ⟨0, 1, 930⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 675⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 1242⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p460 : MState := ⟨3, [⟨7, 4, 8⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 15920⟩, ⟨1, 1, 1⟩], [⟨1, 1, 1⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 9⟩, ⟨0, 1, 3⟩, ⟨1, 3, 12⟩, ⟨0, 1, 27⟩, ⟨1, 3, 18⟩, ⟨0, 1, 6⟩, ⟨1, 3, 18⟩, ⟨0, 1, 9⟩, ⟨1, 3, 12⟩, ⟨0, 1, 18⟩, ⟨1, 3, 21⟩, ⟨0, 1, 3⟩, ⟨1, 3, 1581⟩, ⟨0, 1, 153⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 759⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1350⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 213⟩, ⟨1, 3, 3⟩, ⟨0, 1, 948⟩, ⟨1, 3, 3⟩, ⟨0, 1, 930⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 675⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 1242⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1095⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 423⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p480 : MState := ⟨5, [⟨0, 1, 1⟩, ⟨1, 1, 2⟩, ⟨0, 1, 1⟩, ⟨1, 1, 7⟩, ⟨14, 4, 16⟩, ⟨1, 1, 12⟩, ⟨14, 4, 4⟩, ⟨1, 1, 12⟩, ⟨14, 4, 8⟩, ⟨13, 4, 18873⟩, ⟨1, 1, 1⟩], [⟨4, 3, 245⟩, ⟨0, 1, 105⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 105⟩, ⟨0, 1, 24⟩, ⟨1, 3, 6⟩, ⟨0, 1, 90⟩, ⟨1, 3, 33⟩, ⟨0, 1, 54⟩, ⟨1, 3, 258⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 609⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 180⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 42⟩, ⟨1, 3, 39⟩, ⟨0, 1, 18⟩, ⟨1, 3, 864⟩, ⟨0, 1, 528⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 375⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 675⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 1242⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1095⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 423⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 4962⟩, ⟨1, 3, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 1⟩]⟩ +def cfg_p498 : MState := ⟨5, [⟨0, 1, 1⟩, ⟨1, 1, 8⟩, ⟨0, 1, 1⟩, ⟨1, 1, 3⟩, ⟨14, 4, 4⟩, ⟨1, 1, 9⟩, ⟨14, 4, 4⟩, ⟨1, 1, 12⟩, ⟨14, 4, 12⟩, ⟨1, 1, 12⟩, ⟨14, 4, 19220⟩, ⟨1, 1, 1⟩], [⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 105⟩, ⟨0, 1, 24⟩, ⟨1, 3, 6⟩, ⟨0, 1, 90⟩, ⟨1, 3, 33⟩, ⟨0, 1, 54⟩, ⟨1, 3, 258⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 609⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 180⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 42⟩, ⟨1, 3, 39⟩, ⟨0, 1, 18⟩, ⟨1, 3, 864⟩, ⟨0, 1, 528⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 375⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 675⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 1242⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1095⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 423⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 4962⟩, ⟨1, 3, 6⟩, ⟨0, 1, 255⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 1⟩]⟩ +def cfg_end : MState := cfg_p498 + +theorem step_ckpt_p20 : opt_mstate_beq (run_m_fast 1000 cfg_p0) cfg_p20 = true := by decide +kernel +theorem step_ckpt_p40 : opt_mstate_beq (run_m_fast 1000 cfg_p20) cfg_p40 = true := by decide +kernel +theorem step_ckpt_p60 : opt_mstate_beq (run_m_fast 1000 cfg_p40) cfg_p60 = true := by decide +kernel +theorem step_ckpt_p80 : opt_mstate_beq (run_m_fast 1000 cfg_p60) cfg_p80 = true := by decide +kernel +theorem step_ckpt_p100 : opt_mstate_beq (run_m_fast 1000 cfg_p80) cfg_p100 = true := by decide +kernel +theorem step_ckpt_p120 : opt_mstate_beq (run_m_fast 1000 cfg_p100) cfg_p120 = true := by decide +kernel +theorem step_ckpt_p140 : opt_mstate_beq (run_m_fast 1000 cfg_p120) cfg_p140 = true := by decide +kernel +theorem step_ckpt_p160 : opt_mstate_beq (run_m_fast 1000 cfg_p140) cfg_p160 = true := by decide +kernel +theorem step_ckpt_p180 : opt_mstate_beq (run_m_fast 1000 cfg_p160) cfg_p180 = true := by decide +kernel +theorem step_ckpt_p200 : opt_mstate_beq (run_m_fast 1000 cfg_p180) cfg_p200 = true := by decide +kernel +theorem step_ckpt_p220 : opt_mstate_beq (run_m_fast 1000 cfg_p200) cfg_p220 = true := by decide +kernel +theorem step_ckpt_p240 : opt_mstate_beq (run_m_fast 1000 cfg_p220) cfg_p240 = true := by decide +kernel +theorem step_ckpt_p260 : opt_mstate_beq (run_m_fast 1000 cfg_p240) cfg_p260 = true := by decide +kernel +theorem step_ckpt_p280 : opt_mstate_beq (run_m_fast 1000 cfg_p260) cfg_p280 = true := by decide +kernel +theorem step_ckpt_p300 : opt_mstate_beq (run_m_fast 1000 cfg_p280) cfg_p300 = true := by decide +kernel +theorem step_ckpt_p320 : opt_mstate_beq (run_m_fast 1000 cfg_p300) cfg_p320 = true := by decide +kernel +theorem step_ckpt_p340 : opt_mstate_beq (run_m_fast 1000 cfg_p320) cfg_p340 = true := by decide +kernel +theorem step_ckpt_p360 : opt_mstate_beq (run_m_fast 1000 cfg_p340) cfg_p360 = true := by decide +kernel +theorem step_ckpt_p380 : opt_mstate_beq (run_m_fast 1000 cfg_p360) cfg_p380 = true := by decide +kernel +theorem step_ckpt_p400 : opt_mstate_beq (run_m_fast 1000 cfg_p380) cfg_p400 = true := by decide +kernel +theorem step_ckpt_p420 : opt_mstate_beq (run_m_fast 1000 cfg_p400) cfg_p420 = true := by decide +kernel +theorem step_ckpt_p440 : opt_mstate_beq (run_m_fast 1000 cfg_p420) cfg_p440 = true := by decide +kernel +theorem step_ckpt_p460 : opt_mstate_beq (run_m_fast 1000 cfg_p440) cfg_p460 = true := by decide +kernel +theorem step_ckpt_p480 : opt_mstate_beq (run_m_fast 1000 cfg_p460) cfg_p480 = true := by decide +kernel +theorem step_ckpt_p498 : opt_mstate_beq (run_m_fast 900 cfg_p480) cfg_p498 = true := by decide +kernel +theorem halt_cfg_end : is_halt_m cfg_end = true := by decide +kernel + +theorem reach_p480 : MReach cfg_p480 cfg_end := mreach_base_fast step_ckpt_p498 +theorem reach_p460 : MReach cfg_p460 cfg_end := mreach_step_fast step_ckpt_p480 reach_p480 +theorem reach_p440 : MReach cfg_p440 cfg_end := mreach_step_fast step_ckpt_p460 reach_p460 +theorem reach_p420 : MReach cfg_p420 cfg_end := mreach_step_fast step_ckpt_p440 reach_p440 +theorem reach_p400 : MReach cfg_p400 cfg_end := mreach_step_fast step_ckpt_p420 reach_p420 +theorem reach_p380 : MReach cfg_p380 cfg_end := mreach_step_fast step_ckpt_p400 reach_p400 +theorem reach_p360 : MReach cfg_p360 cfg_end := mreach_step_fast step_ckpt_p380 reach_p380 +theorem reach_p340 : MReach cfg_p340 cfg_end := mreach_step_fast step_ckpt_p360 reach_p360 +theorem reach_p320 : MReach cfg_p320 cfg_end := mreach_step_fast step_ckpt_p340 reach_p340 +theorem reach_p300 : MReach cfg_p300 cfg_end := mreach_step_fast step_ckpt_p320 reach_p320 +theorem reach_p280 : MReach cfg_p280 cfg_end := mreach_step_fast step_ckpt_p300 reach_p300 +theorem reach_p260 : MReach cfg_p260 cfg_end := mreach_step_fast step_ckpt_p280 reach_p280 +theorem reach_p240 : MReach cfg_p240 cfg_end := mreach_step_fast step_ckpt_p260 reach_p260 +theorem reach_p220 : MReach cfg_p220 cfg_end := mreach_step_fast step_ckpt_p240 reach_p240 +theorem reach_p200 : MReach cfg_p200 cfg_end := mreach_step_fast step_ckpt_p220 reach_p220 +theorem reach_p180 : MReach cfg_p180 cfg_end := mreach_step_fast step_ckpt_p200 reach_p200 +theorem reach_p160 : MReach cfg_p160 cfg_end := mreach_step_fast step_ckpt_p180 reach_p180 +theorem reach_p140 : MReach cfg_p140 cfg_end := mreach_step_fast step_ckpt_p160 reach_p160 +theorem reach_p120 : MReach cfg_p120 cfg_end := mreach_step_fast step_ckpt_p140 reach_p140 +theorem reach_p100 : MReach cfg_p100 cfg_end := mreach_step_fast step_ckpt_p120 reach_p120 +theorem reach_p80 : MReach cfg_p80 cfg_end := mreach_step_fast step_ckpt_p100 reach_p100 +theorem reach_p60 : MReach cfg_p60 cfg_end := mreach_step_fast step_ckpt_p80 reach_p80 +theorem reach_p40 : MReach cfg_p40 cfg_end := mreach_step_fast step_ckpt_p60 reach_p60 +theorem reach_p20 : MReach cfg_p20 cfg_end := mreach_step_fast step_ckpt_p40 reach_p40 +theorem reach_0 : MReach cfg_0 cfg_end := mreach_step_fast step_ckpt_p20 reach_p20 +end Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 800000 + +public section + +open Solution in +theorem is_halt : IsHalt target := by + rcases reach_0 with ⟨fuel, hfuel⟩ + rcases run_m_sound fuel cfg_0 cfg_end hfuel with ⟨n, hn⟩ + refine ⟨map_cfg_0365 (mstate_to_cfg cfg_end), ⟨n, ?_⟩, ?_⟩ + · have hinit : (init [] : Cfg (Fin 2) (Fin 6)) = map_cfg_0365 (mstate_to_cfg cfg_0) := rfl + rw [hinit, multiStep_map_0365, hn] + rfl + · rw [step_map_0365, is_halt_m_sound cfg_end halt_cfg_end] + rfl + +end + +end BusyBeaver.M_1RB0RA_1LC0RE_1LD0LC_1RA1LE_1LC0LF_0RAHHH diff --git a/BusyBeaver/BB6/Halt/M_1RB0RB_1RC0RD_1LD1RC_1RF0LE_1LC1LE_HHH0RA.lean b/BusyBeaver/BB6/Halt/M_1RB0RB_1RC0RD_1LD1RC_1RF0LE_1LC1LE_HHH0RA.lean new file mode 100644 index 00000000..c67a7f46 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB0RB_1RC0RD_1LD1RC_1RF0LE_1LC1LE_HHH0RA.lean @@ -0,0 +1,2335 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RB_1RC0RD_1LD1RC_1RF0LE_1LC1LE_HHH0RA + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RB_1RC0RD_1LD1RC_1RF0LE_1LC1LE_HHH0RA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +set_option linter.unusedSectionVars false +set_option linter.deprecated false +set_option linter.dupNamespace false +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + + +-- ============================================================================ +-- Section 5: Base Lemmas & Shift Rules for Holdout #476 (TM39) +-- ============================================================================ + + +local notation "zB" => ListBlank (Fin 2) +local notation "zF" => List (Fin 2) + +@[simp] theorem zMz (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] +@[simp] theorem z0i : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : zB).head = 0 := rfl +@[simp] theorem zDt : (default : zB).tail = default := rfl +@[simp] theorem append_nil (s : zB) : ([] : zF) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : zF) (s : zB) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l₁ l₂ : zF) (s : zB) : + (l₁ ++ l₂) +> s = l₁ +> (l₂ +> s) := by + induction l₁ with + | nil => rfl + | cons a l₁ ih => simp [ih] +@[simp] theorem zPz {α : Type} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem z0j {α : Type} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +theorem z0k {α : Type} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => simp [z0j, Nat.succ_add, ih, List.append_assoc] +theorem z0l {α : Type} (l : List α) (n : Nat) : l ^ n ++ l = l ^ (n + 1) := by + induction n with + | zero => simp [z0j] + | succ n ih => simp [z0j, List.append_assoc, ih] + +theorem zSm (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢^{1} c₂ := by simp [h] +theorem z0P (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢* c₂ := ⟨1, zSm tm c₁ c₂ h⟩ +theorem z0Q (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢⁺ c₂ := ⟨1, by decide, zSm tm c₁ c₂ h⟩ +theorem zMa (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, zMs, ih, Option.bind_assoc] + simp_rw [zMs] +theorem zMt (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [zMa, h₁]; simp [h₂] +theorem zSt {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, zMt tm c₁ c₂ c₃ n m hn hm⟩ +theorem zPs {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ +theorem z0R {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), zMt tm c₁ c₂ c₃ n m hn hm⟩ +theorem z0T {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + z0R (z0Q tm c₁ c₂ h₁) h₂ + +macro "finish" : tactic => + `(tactic| (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, append_cons, append_nil, List.cons_append, List.nil_append, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, z0i, zDh, zDt]) <;> exists 0 <;> fail) +macro "step_tm" : tactic => + `(tactic| (try dsimp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, append_cons, append_nil]) <;> (try refine zPs ?_) <;> + refine z0T (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, append_cons, append_nil, Turing.ListBlank.head_cons, zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, append_cons, append_nil, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, z0i, zDh, zDt]) +macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm))) +macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +def IsHaltFrom (c : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ cfg, (c [target_tm]⊢* cfg) ∧ (step target_tm cfg).isNone + +theorem halt_from_trans {c₁ c₂ : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [target_tm]⊢* c₂) (h₂ : IsHaltFrom c₂) : IsHaltFrom c₁ := by + rcases h₂ with ⟨cfg, h₂, h₃⟩ + exact ⟨cfg, zSt h₁ h₂, h₃⟩ + +abbrev W0 : zF := [0] +abbrev W1 : zF := [1] + +theorem shift_C (n : Nat) (l r : zB) : + (l {{C}}> ((W1 ^ n) +> r)) [target_tm]⊢* (((W1 ^ n) +> l) {{C}}> r) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (l {{C}}> (W1 +> ((W1 ^ n) +> r))) [target_tm]⊢* + ((W1 +> l) {{C}}> ((W1 ^ n) +> r)) := by + dsimp [W1]; execute + have h2 := ih (W1 +> l) r + have heq : (W1 ^ n) +> (W1 +> l) = (W1 ^ (n + 1)) +> l := by + rw [← append_assoc, z0l] + rw [heq] at h2 + exact zSt h1 h2 + +theorem shift_E (n : Nat) (l r : zB) : + (((W1 ^ n) +> l) <{{E}} r) [target_tm]⊢* (l <{{E}} ((W1 ^ n) +> r)) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : ((W1 +> ((W1 ^ n) +> l)) <{{E}} r) [target_tm]⊢* + (((W1 ^ n) +> l) <{{E}} (W1 +> r)) := by + dsimp [W1]; execute + have h2 := ih l (W1 +> r) + have heq : (W1 ^ n) +> (W1 +> r) = (W1 ^ (n + 1)) +> r := by + rw [← append_assoc, z0l] + rw [heq] at h2 + exact zSt h1 h2 + +theorem bounce_C (n : Nat) (l r : zB) : + ((W1 +> l) {{C}}> ((W1 ^ n) +> (([0] : zF) +> r))) [target_tm]⊢* + (l <{{E}} ((W1 ^ n) +> (([0, 1] : zF) +> r))) := by + have h1 := shift_C n (W1 +> l) (([0] : zF) +> r) + have heq1 : (W1 ^ n) +> (W1 +> l) = W1 +> ((W1 ^ n) +> l) := by + rw [← append_assoc, z0l, z0j, append_assoc] + rw [heq1] at h1 + have h2 : ((W1 +> ((W1 ^ n) +> l)) {{C}}> (([0] : zF) +> r)) [target_tm]⊢* + (((W1 ^ n) +> l) <{{E}} (([0, 1] : zF) +> r)) := by + dsimp [W1]; execute + exact zSt h1 (zSt h2 (shift_E n l (([0, 1] : zF) +> r))) + +@[simp] +def LC : List Nat → zB + | [] => default + | n :: l => ([0] : zF) +> ((W1 ^ n) +> LC l) + +@[simp] +def RC : List Nat → zB + | [] => default + | n :: r => ([0, 0, 0] : zF) +> ((W1 ^ n) +> RC r) + +def S (l : List Nat) (a b : Nat) (r : List Nat) : Cfg (Fin 2) (Fin 6) := + (([0, 0] : zF) +> ((W1 ^ b) +> RC r)) {{B}}> ((W1 ^ a) +> LC l) + +theorem Spos (a b : Nat) (l r : List Nat) : + (S l (a + 2) b r) [target_tm]⊢* (S (a :: l) 0 (b + 1) r) := by + dsimp only [S, LC, W1, zPz, z0j, List.cons_append, List.nil_append] + execute + +theorem S12 (a b : Nat) (l r : List Nat) : + (S ((a + 2) :: l) 1 b r) [target_tm]⊢* (S l a 1 (b :: r)) := by + dsimp only [S, LC, RC, W1, zPz, z0j, List.cons_append, List.nil_append] + execute + +theorem HS10 (b : Nat) (l r : List Nat) : + IsHaltFrom (S (0 :: l) 1 b r) := by + cases l with + | nil => + dsimp only [S, LC, W1, zPz, z0j, List.cons_append, List.nil_append] + refine ⟨(([1, 0, 0, 0] : zF) +> ((W1 ^ b) +> RC r)) {{F}}> default, ?_, by (simp [step, target_tm, F]; rfl)⟩ + execute + | cons x0 l1 => + dsimp only [S, LC, W1, zPz, z0j, List.cons_append, List.nil_append] + refine ⟨(([1, 0, 0, 0] : zF) +> ((W1 ^ b) +> RC r)) {{F}}> (([0] : zF) +> ((W1 ^ x0) +> LC l1)), ?_, by (simp [step, target_tm, F]; rfl)⟩ + execute + +theorem S112 (a b : Nat) (l r : List Nat) : + (S (1 :: (a + 2) :: l) 1 b r) [target_tm]⊢* (S ((a + 2) :: l) 2 (b + 1) r) := by + dsimp only [S, LC, W1, zPz, z0j, List.cons_append, List.nil_append] + execute + +theorem S110 (a b c : Nat) (l r : List Nat) : + (S (1 :: 0 :: a :: b :: l) 1 c r) [target_tm]⊢* (S ((b + 2) :: l) (a + 2) (c + 1) r) := by + dsimp only [S, LC] + have h1 : ((([0, 0] : zF) +> ((W1 ^ c) +> RC r)) {{B}}> + ((W1 ^ 1) +> (([0] : zF) +> ((W1 ^ 1) +> (([0] : zF) +> ((W1 ^ 0) +> + (([0] : zF) +> ((W1 ^ a) +> (([0] : zF) +> ((W1 ^ b) +> LC l)))))))))) [target_tm]⊢* + ((W1 +> (([1, 0, 1, 0, 0, 0] : zF) +> ((W1 ^ c) +> RC r))) {{C}}> + ((W1 ^ a) +> (([0] : zF) +> ((W1 ^ b) +> LC l)))) := by + dsimp [W1]; execute + have h2 := bounce_C a (([1, 0, 1, 0, 0, 0] : zF) +> ((W1 ^ c) +> RC r)) ((W1 ^ b) +> LC l) + have h3 : ((([1, 0, 1, 0, 0, 0] : zF) +> ((W1 ^ c) +> RC r)) <{{E}} + ((W1 ^ a) +> (([0, 1] : zF) +> ((W1 ^ b) +> LC l)))) [target_tm]⊢* + ((W1 +> (([1, 1, 0, 0, 0] : zF) +> ((W1 ^ c) +> RC r))) {{C}}> + ((W1 ^ a) +> (([0] : zF) +> (([1] : zF) +> ((W1 ^ b) +> LC l))))) := by + dsimp [W1]; execute + have h4 := bounce_C a (([1, 1, 0, 0, 0] : zF) +> ((W1 ^ c) +> RC r)) (([1] : zF) +> ((W1 ^ b) +> LC l)) + have h5 : ((([1, 1, 0, 0, 0] : zF) +> ((W1 ^ c) +> RC r)) <{{E}} + ((W1 ^ a) +> (([0, 1] : zF) +> (([1] : zF) +> ((W1 ^ b) +> LC l))))) [target_tm]⊢* + ((([0, 0] : zF) +> ((W1 ^ (c + 1)) +> RC r)) {{B}}> + ((W1 ^ (a + 2)) +> (([0] : zF) +> ((W1 ^ (b + 2)) +> LC l)))) := by + dsimp [W1]; execute + exact zSt h1 (zSt h2 (zSt h3 (zSt h4 h5))) + +theorem start_S0 (a b m : Nat) (l : List Nat) (r : zB) : + ((([0, 0] : zF) +> ((W1 ^ m) +> r)) {{B}}> (([0] : zF) +> ((W1 ^ a) +> (([0] : zF) +> ((W1 ^ b) +> LC l))))) [target_tm]⊢* + (((W1 ^ m) +> r) <{{D}} ((W1 ^ (a + 2)) +> (([0] : zF) +> ((W1 ^ (b + 1)) +> LC l)))) := by + have h1 : ((([0, 0] : zF) +> ((W1 ^ m) +> r)) {{B}}> (([0] : zF) +> ((W1 ^ a) +> (([0] : zF) +> ((W1 ^ b) +> LC l))))) [target_tm]⊢* + ((W1 +> (([0, 0] : zF) +> ((W1 ^ m) +> r))) {{C}}> ((W1 ^ a) +> (([0] : zF) +> ((W1 ^ b) +> LC l)))) := by + dsimp [W1]; execute + have h2 := bounce_C a (([0, 0] : zF) +> ((W1 ^ m) +> r)) ((W1 ^ b) +> LC l) + have h3 : ((([0, 0] : zF) +> ((W1 ^ m) +> r)) <{{E}} ((W1 ^ a) +> (([0, 1] : zF) +> ((W1 ^ b) +> LC l)))) [target_tm]⊢* + (((W1 ^ m) +> r) <{{D}} ((W1 ^ (a + 2)) +> (([0] : zF) +> ((W1 ^ (b + 1)) +> LC l)))) := by + dsimp [W1]; execute + exact zSt h1 (zSt h2 h3) + +theorem S01 (a b c : Nat) (l r : List Nat) : + (S (a :: b :: l) 0 1 (c :: r)) [target_tm]⊢* (S ((a + 2) :: (b + 1) :: l) 0 (c + 1) r) := by + dsimp only [S, LC, RC] + refine zSt (start_S0 a b 1 l (([0, 0, 0] : zF) +> ((W1 ^ c) +> RC r))) ?_ + dsimp only [W1, zPz, z0j, List.cons_append, List.nil_append] + execute + +theorem S02 (a b c : Nat) (l r : List Nat) : + (S (a :: b :: l) 0 2 (c :: r)) [target_tm]⊢* (S ((b + 1) :: l) a 1 ((c + 1) :: r)) := by + dsimp only [S, LC, RC] + refine zSt (start_S0 a b 2 l (([0, 0, 0] : zF) +> ((W1 ^ c) +> RC r))) ?_ + dsimp only [W1, zPz, z0j, List.cons_append, List.nil_append] + execute + +theorem S03 (a b c d : Nat) (l r : List Nat) : + (S (a :: b :: l) 0 (c + 3) (d :: r)) [target_tm]⊢* (S (c :: (a + 2) :: (b + 1) :: l) 0 (d + 2) r) := by + have h_mid : (S (a :: b :: l) 0 (c + 3) (d :: r)) [target_tm]⊢* + (S ((a + 2) :: (b + 1) :: l) (c + 2) (d + 1) r) := by + dsimp only [S, LC, RC] + refine zSt (start_S0 a b (c + 3) l (([0, 0, 0] : zF) +> ((W1 ^ d) +> RC r))) ?_ + have h1 : (((W1 ^ (c + 3)) +> (([0, 0, 0] : zF) +> ((W1 ^ d) +> RC r))) <{{D}} + ((W1 ^ (a + 2)) +> (([0] : zF) +> ((W1 ^ (b + 1)) +> LC l)))) [target_tm]⊢* + (((W1 ^ (c + 2)) +> (([0, 0, 0] : zF) +> ((W1 ^ d) +> RC r))) <{{E}} + (([0] : zF) +> ((W1 ^ (a + 2)) +> (([0] : zF) +> ((W1 ^ (b + 1)) +> LC l))))) := by + rw [show c + 3 = (c + 2) + 1 from rfl, z0j, append_assoc] + dsimp only [W1, zPz, z0j, List.cons_append, List.nil_append] + execute + refine zSt h1 (zSt (shift_E (c + 2) _ _) ?_) + dsimp only [W1, zPz, z0j, List.cons_append, List.nil_append] + execute + exact zSt h_mid (Spos c (d + 1) ((a + 2) :: (b + 1) :: l) r) + +theorem Inc (a b c : Nat) (l r : List Nat) : + (S ((a + 2) :: b :: l) 0 2 (c :: r)) [target_tm]⊢* (S (a :: (b + 1) :: l) 0 2 ((c + 1) :: r)) := + zSt (S02 (a + 2) b c l r) (Spos a 1 ((b + 1) :: l) ((c + 1) :: r)) + +theorem Incs (n a b c : Nat) (l r : List Nat) : + (S ((a + n * 2) :: b :: l) 0 2 (c :: r)) [target_tm]⊢* (S (a :: (b + n) :: l) 0 2 ((c + n) :: r)) := by + induction n generalizing a b c with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + have h1 := Inc (a + n * 2) b c l r + have h2 := ih a (b + 1) (c + 1) + have heq1 : (a + n * 2) + 2 = a + (n + 1) * 2 := by omega + have heq2 : (b + 1) + n = b + (n + 1) := by omega + have heq3 : (c + 1) + n = c + (n + 1) := by omega + rw [heq1] at h1 + rw [heq2, heq3] at h2 + exact zSt h1 h2 + +theorem Incs_S02 (x0 x1 c : Nat) (l r : List Nat) : + (S (x0 :: x1 :: l) 0 2 (c :: r)) [target_tm]⊢* + (S (((x1 + x0 / 2) + 1) :: l) (x0 % 2) 1 (((c + x0 / 2) + 1) :: r)) := by + have h1 := Incs (x0 / 2) (x0 % 2) x1 c l r + have hx0 : x0 % 2 + (x0 / 2) * 2 = x0 := by omega + rw [hx0] at h1 + exact zSt h1 (S02 (x0 % 2) (x1 + x0 / 2) (c + x0 / 2) l r) + +theorem Even_S02_S01 (x0 x1 x2 c : Nat) (l r : List Nat) + (h_even : Nat.beq (x0 % 2) 0 = true) : + (S (x0 :: x1 :: x2 :: l) 0 2 (c :: r)) [target_tm]⊢* + (S (((x1 + x0 / 2) + 3) :: (x2 + 1) :: l) 0 ((c + x0 / 2) + 2) r) := by + have hrem : x0 % 2 = 0 := Nat.eq_of_beq_eq_true h_even + have h1 := Incs_S02 x0 x1 c (x2 :: l) r + rw [hrem] at h1 + exact zSt h1 (S01 ((x1 + x0 / 2) + 1) x2 ((c + x0 / 2) + 1) l r) + +theorem Odd_Incs_S02 (x0 x1 c : Nat) (l r : List Nat) + (h_odd : Nat.beq (x0 % 2) 0 = false) : + (S (x0 :: x1 :: l) 0 2 (c :: r)) [target_tm]⊢* + (S (((x1 + x0 / 2) + 1) :: l) 1 1 (((c + x0 / 2) + 1) :: r)) := by + have hne : x0 % 2 ≠ 0 := Nat.ne_of_beq_eq_false h_odd + have hrem : x0 % 2 = 1 := by omega + have h1 := Incs_S02 x0 x1 c l r + rw [hrem] at h1 + exact h1 + +theorem Odd_S02_S12_Spos (x0 x1 c : Nat) (l r : List Nat) + (h_odd : Nat.beq (x0 % 2) 0 = false) + (h_ge3 : Nat.ble 3 (x1 + x0 / 2) = true) : + (S (x0 :: x1 :: l) 0 2 (c :: r)) [target_tm]⊢* + (S ((x1 + x0 / 2 - 3) :: l) 0 2 (1 :: ((c + x0 / 2) + 1) :: r)) := by + have hle : 3 ≤ x1 + x0 / 2 := Nat.le_of_ble_eq_true h_ge3 + have h1 := Odd_Incs_S02 x0 x1 c l r h_odd + have h_split : (x1 + x0 / 2) + 1 = ((x1 + x0 / 2 - 3) + 2) + 2 := by omega + rw [h_split] at h1 + have h2 := S12 ((x1 + x0 / 2 - 3) + 2) 1 l (((c + x0 / 2) + 1) :: r) + have h3 := Spos (x1 + x0 / 2 - 3) 1 l (1 :: ((c + x0 / 2) + 1) :: r) + exact zSt h1 (zSt h2 h3) + +theorem init_to_S : + (init []) [target_tm]⊢* (S [1] 1 1 []) := by + dsimp only [init, Tape.mk₁, S, LC, RC, W1, zPz, z0j, List.cons_append, List.nil_append] + execute + +-- ============================================================================ +-- Section 6: Fast Kernel Evaluator +-- ============================================================================ + +noncomputable section + +inductive NList where + | nil : NList + | cons (head : Nat) (tail : NList) : NList +deriving DecidableEq, Repr + +inductive StepRes where + | halted : StepRes + | running (l : NList) (a : Nat) (b : Nat) (r : NList) : StepRes +deriving DecidableEq, Repr + +def bindNat {α : Type} (n : Nat) (k : Nat → α) : α := + (Nat.rec (fun _ => k 0) (fun m _ k => k m) (Nat.add 1 n) : (Nat → α) → α) k + +def forceNList (rest : NList) (k : NList → NList) : NList := + k rest + +def mkCons (n : Nat) (rest : NList) : NList := + bindNat n (fun n' => forceNList rest (NList.cons n')) + +def forceNListS (xs : NList) (k : NList → StepRes) : StepRes := + k xs + +def mkRunning (l : NList) (a b : Nat) (r : NList) : StepRes := + forceNListS l (fun l' => forceNListS r (fun r' => bindNat a (fun a' => bindNat b (fun b' => StepRes.running l' a' b' r')))) + +def popNList {α : Type} (xs : NList) (k : Nat → NList → α) : α := + (NList.rec (fun k => k 0 NList.nil) (fun h t _ k => k h t) xs : (Nat → NList → α) → α) k + +def sweep_r_nil (l : NList) (c : Nat) : StepRes := + popNList l (fun x0 l1 => + popNList l1 (fun x1 l2 => + mkRunning (mkCons c (mkCons (Nat.add x0 2) (mkCons (Nat.add x1 1) l2))) 0 2 NList.nil)) + +def sweep_r_cons_branch (is0 : Bool) : (NList → Nat → StepRes) → NList → Nat → NList → StepRes := + Bool.rec + (fun ih l_next d _ => bindNat (Nat.sub d 1) (fun d' => ih l_next d')) + (fun _ l_next _ r1 => mkRunning l_next 0 2 r1) + is0 + +def sweep_r_cons (d : Nat) (r1 : NList) (ih : NList → Nat → StepRes) (l : NList) (c : Nat) : StepRes := + popNList l (fun x0 l1 => + popNList l1 (fun x1 l2 => + forceNListS (mkCons c (mkCons (Nat.add x0 2) (mkCons (Nat.add x1 1) l2))) (fun l_next => + sweep_r_cons_branch (Nat.beq d 0) ih l_next d r1))) + +def sweep_r (r : NList) (l : NList) (c : Nat) : StepRes := + (NList.rec sweep_r_nil sweep_r_cons r : NList → Nat → StepRes) l c + +def finish_even_branch (is0 : Bool) : NList → Nat → NList → StepRes := + Bool.rec + (fun l_new cn r1 => bindNat (Nat.sub cn 1) (fun cn' => sweep_r r1 l_new cn')) + (fun l_new _ r1 => mkRunning l_new 0 2 r1) + is0 + +def finish_even (l_new : NList) (cn : Nat) (r1 : NList) : StepRes := + forceNListS l_new (fun l_new' => finish_even_branch (Nat.beq cn 0) l_new' cn r1) + +def sweep_l_odd_nil_branch (ge3 : Bool) : Nat → Nat → NList → StepRes := + Bool.rec + (fun n cn r1 => mkRunning (mkCons (Nat.add n 1) NList.nil) 1 1 (mkCons (Nat.add cn 1) r1)) + (fun n cn r1 => mkRunning (mkCons (Nat.sub n 3) NList.nil) 0 2 (mkCons 1 (mkCons (Nat.add cn 1) r1))) + ge3 + +def sweep_l_nil_branch (is_even : Bool) : Nat → Nat → NList → StepRes := + Bool.rec + (fun n cn r1 => sweep_l_odd_nil_branch (Nat.ble 3 n) n cn r1) + (fun n cn r1 => finish_even (mkCons (Nat.add n 3) (mkCons 1 NList.nil)) cn r1) + is_even + +def sweep_l_nil (x0 : Nat) (r : NList) : StepRes := + popNList r (fun c r1 => + bindNat (Nat.div x0 2) (fun n => + bindNat (Nat.mod x0 2) (fun rem => + bindNat (Nat.add c n) (fun cn => + sweep_l_nil_branch (Nat.beq rem 0) n cn r1)))) + +def sweep_l_odd_cons_branch (ge3 : Bool) : (Nat → NList → StepRes) → NList → Nat → Nat → NList → StepRes := + Bool.rec + (fun _ l2 x1n cn r1 => mkRunning (mkCons (Nat.add x1n 1) l2) 1 1 (mkCons (Nat.add cn 1) r1)) + (fun ih _ x1n cn r1 => + bindNat (Nat.sub x1n 3) (fun x0_next => + forceNListS (mkCons 1 (mkCons (Nat.add cn 1) r1)) (fun r_next => + ih x0_next r_next))) + ge3 + +def sweep_l_cons_branch (is_even : Bool) : (Nat → NList → StepRes) → NList → Nat → Nat → NList → StepRes := + Bool.rec + (fun ih l2 x1n cn r1 => sweep_l_odd_cons_branch (Nat.ble 3 x1n) ih l2 x1n cn r1) + (fun _ l2 x1n cn r1 => + popNList l2 (fun x2 l3 => + finish_even (mkCons (Nat.add x1n 3) (mkCons (Nat.add x2 1) l3)) cn r1)) + is_even + +def sweep_l_cons (x1 : Nat) (l2 : NList) (ih : Nat → NList → StepRes) (x0 : Nat) (r : NList) : StepRes := + popNList r (fun c r1 => + bindNat (Nat.div x0 2) (fun n => + bindNat (Nat.mod x0 2) (fun rem => + bindNat (Nat.add c n) (fun cn => + bindNat (Nat.add x1 n) (fun x1n => + sweep_l_cons_branch (Nat.beq rem 0) ih l2 x1n cn r1))))) + +def sweep_l (l1 : NList) (x0 : Nat) (r : NList) : StepRes := + (NList.rec sweep_l_nil sweep_l_cons l1 : Nat → NList → StepRes) x0 r + +def step_a1_x1_ge2_branch (ge2 : Bool) : Nat → NList → Nat → NList → StepRes := + Bool.rec + (fun x1 l2 b r => mkRunning (mkCons 1 (mkCons x1 l2)) 1 b r) + (fun x1 l2 b r => mkRunning (mkCons x1 l2) 2 (Nat.add b 1) r) + ge2 + +def step_a1_x1_0_branch (is0 : Bool) : Nat → NList → Nat → NList → StepRes := + Bool.rec + (fun x1 l2 b r => step_a1_x1_ge2_branch (Nat.ble 2 x1) x1 l2 b r) + (fun _ l2 b r => + popNList l2 (fun x2 l3 => + popNList l3 (fun x3 l4 => + mkRunning (mkCons (Nat.add x3 2) l4) (Nat.add x2 2) (Nat.add b 1) r))) + is0 + +def step_a1_x0_ge2_branch (ge2 : Bool) : Nat → NList → Nat → NList → StepRes := + Bool.rec + (fun _ l1 b r => + popNList l1 (fun x1 l2 => + step_a1_x1_0_branch (Nat.beq x1 0) x1 l2 b r)) + (fun x0 l1 b r => mkRunning l1 (Nat.sub x0 2) 1 (mkCons b r)) + ge2 + +def step_a1_x0_0_branch (is0 : Bool) : Nat → NList → Nat → NList → StepRes := + Bool.rec + (fun x0 l1 b r => step_a1_x0_ge2_branch (Nat.ble 2 x0) x0 l1 b r) + (fun _ _ _ _ => StepRes.halted) + is0 + +def step_a0_b_ge3_branch (ge3 : Bool) : NList → Nat → NList → StepRes := + Bool.rec + (fun l b r => mkRunning l 0 b r) + (fun l b r => bindNat (Nat.sub b 3) (fun b' => sweep_r r l b')) + ge3 + +def step_a0_b1_branch (is1 : Bool) : NList → Nat → NList → StepRes := + Bool.rec + (fun l b r => step_a0_b_ge3_branch (Nat.ble 3 b) l b r) + (fun l _ r => + popNList l (fun x0 l1 => + popNList l1 (fun x1 l2 => + popNList r (fun c r1 => + mkRunning (mkCons (Nat.add x0 2) (mkCons (Nat.add x1 1) l2)) 0 (Nat.add c 1) r1)))) + is1 + +def step_a0_b2_branch (is2 : Bool) : NList → Nat → NList → StepRes := + Bool.rec + (fun l b r => step_a0_b1_branch (Nat.beq b 1) l b r) + (fun l _ r => popNList l (fun x0 l1 => sweep_l l1 x0 r)) + is2 + +def step_a1_branch (is1 : Bool) : NList → Nat → Nat → NList → StepRes := + Bool.rec + (fun l _ b r => step_a0_b2_branch (Nat.beq b 2) l b r) + (fun l _ b r => popNList l (fun x0 l1 => step_a1_x0_0_branch (Nat.beq x0 0) x0 l1 b r)) + is1 + +def step_a_ge2_branch (ge2 : Bool) : NList → Nat → Nat → NList → StepRes := + Bool.rec + (fun l a b r => step_a1_branch (Nat.beq a 1) l a b r) + (fun l a b r => mkRunning (mkCons (Nat.sub a 2) l) 0 (Nat.add b 1) r) + ge2 + +def step_cfg (l : NList) (a b : Nat) (r : NList) : StepRes := + step_a_ge2_branch (Nat.ble 2 a) l a b r + +def forceListCPS {α : Type} : NList → (NList → α) → α + | NList.nil, k => k NList.nil + | NList.cons h t, k => + bindNat h (fun h' => + forceListCPS t (fun t' => + k (NList.cons h' t'))) + +def forceRes (s : StepRes) : StepRes := + StepRes.rec StepRes.halted + (fun l a b r => + forceListCPS l (fun l' => + forceListCPS r (fun r' => + bindNat a (fun a' => + bindNat b (fun b' => + StepRes.running l' a' b' r'))))) + s + +def rp_step (k : Nat) (ih : NList → Nat → Nat → NList → StepRes) (l : NList) (a b : Nat) (r : NList) : StepRes := + StepRes.rec StepRes.halted ih (Bool.rec (ih l a b r) (forceRes (ih l a b r)) (Nat.beq k 5)) + +def run_pow (k : Nat) (l : NList) (a b : Nat) (r : NList) : StepRes := + (Nat.rec step_cfg rp_step k : NList → Nat → Nat → NList → StepRes) l a b r + +-- ============================================================================ +-- Section 7: Soundness Proof of Fast Kernel Evaluator +-- ============================================================================ + +@[simp] +theorem bindNat_eq {α : Type} (n : Nat) (k : Nat → α) : + bindNat n k = k n := by + unfold bindNat + rw [show Nat.add 1 n = n + 1 from Nat.add_comm 1 n] + +@[simp] +theorem forceNList_eq (rest : NList) (k : NList → NList) : + forceNList rest k = k rest := by + cases rest <;> rfl + +@[simp] +theorem mkCons_eq (n : Nat) (rest : NList) : + mkCons n rest = NList.cons n rest := by + rw [mkCons, bindNat_eq, forceNList_eq] + +@[simp] +theorem forceNListS_eq (xs : NList) (k : NList → StepRes) : + forceNListS xs k = k xs := by + cases xs <;> rfl + +@[simp] +theorem mkRunning_eq (l : NList) (a b : Nat) (r : NList) : + mkRunning l a b r = StepRes.running l a b r := by + rw [mkRunning, forceNListS_eq, forceNListS_eq, bindNat_eq, bindNat_eq] + +theorem nat_not_le_of_ble_eq_false {a b : Nat} (h : Nat.ble a b = false) : ¬ (a ≤ b) := by + intro hle + have h1 : Nat.ble a b = true := Nat.ble_eq_true_of_le hle + rw [h] at h1 + contradiction + +@[simp] +def denote_list : NList → List Nat + | .nil => [] + | .cons h t => h :: denote_list t + +def StepSpec (c : Cfg (Fin 2) (Fin 6)) : StepRes → Prop + | .halted => IsHaltFrom c + | .running l a b r => c [target_tm]⊢* S (denote_list l) a b (denote_list r) + +theorem step_spec_trans {c₁ c₂ : Cfg (Fin 2) (Fin 6)} {res : StepRes} + (h₁₂ : c₁ [target_tm]⊢* c₂) (h₂ : StepSpec c₂ res) : + StepSpec c₁ res := by + cases res with + | halted => exact halt_from_trans h₁₂ h₂ + | running l a b r => exact zSt h₁₂ h₂ + +theorem S_nil_l (a b : Nat) (r : List Nat) : + S [] a b r = S [0] a b r := by + simp [S, LC, W1, z0i] + +theorem S_nil_l1 (x0 a b : Nat) (r : List Nat) : + S [x0] a b r = S [x0, 0] a b r := by + simp [S, LC, W1, z0i] + +theorem S_nil_l2 (x0 x1 a b : Nat) (r : List Nat) : + S [x0, x1] a b r = S [x0, x1, 0] a b r := by + simp [S, LC, W1, z0i] + +theorem S_nil_l3 (x0 x1 x2 a b : Nat) (r : List Nat) : + S [x0, x1, x2] a b r = S [x0, x1, x2, 0] a b r := by + simp [S, LC, W1, z0i] + +theorem S_nil_r (l : List Nat) (a b : Nat) : + S l a b [] = S l a b [0] := by + simp [S, RC, W1, z0i] + +theorem pop_l_spec {a b : Nat} {r : List Nat} {k : Nat → NList → StepRes} (l : NList) + (hk : ∀ x0 l1, StepSpec (S (x0 :: denote_list l1) a b r) (k x0 l1)) : + StepSpec (S (denote_list l) a b r) (popNList l k) := by + cases l with + | nil => + change StepSpec (S [] a b r) (k 0 NList.nil) + rw [S_nil_l] + exact hk 0 NList.nil + | cons x0 l1 => + exact hk x0 l1 + +theorem pop_l1_spec {a b : Nat} {r : List Nat} {k : Nat → NList → StepRes} (x0 : Nat) (l1 : NList) + (hk : ∀ x1 l2, StepSpec (S (x0 :: x1 :: denote_list l2) a b r) (k x1 l2)) : + StepSpec (S (x0 :: denote_list l1) a b r) (popNList l1 k) := by + cases l1 with + | nil => + change StepSpec (S [x0] a b r) (k 0 NList.nil) + rw [S_nil_l1] + exact hk 0 NList.nil + | cons x1 l2 => + exact hk x1 l2 + +theorem pop_l2_spec {a b : Nat} {r : List Nat} {k : Nat → NList → StepRes} (x0 x1 : Nat) (l2 : NList) + (hk : ∀ x2 l3, StepSpec (S (x0 :: x1 :: x2 :: denote_list l3) a b r) (k x2 l3)) : + StepSpec (S (x0 :: x1 :: denote_list l2) a b r) (popNList l2 k) := by + cases l2 with + | nil => + change StepSpec (S [x0, x1] a b r) (k 0 NList.nil) + rw [S_nil_l2] + exact hk 0 NList.nil + | cons x2 l3 => + exact hk x2 l3 + +theorem pop_l3_spec {a b : Nat} {r : List Nat} {k : Nat → NList → StepRes} (x0 x1 x2 : Nat) (l3 : NList) + (hk : ∀ x3 l4, StepSpec (S (x0 :: x1 :: x2 :: x3 :: denote_list l4) a b r) (k x3 l4)) : + StepSpec (S (x0 :: x1 :: x2 :: denote_list l3) a b r) (popNList l3 k) := by + cases l3 with + | nil => + change StepSpec (S [x0, x1, x2] a b r) (k 0 NList.nil) + rw [S_nil_l3] + exact hk 0 NList.nil + | cons x3 l4 => + exact hk x3 l4 + +theorem pop_r_spec {l : List Nat} {a b : Nat} {k : Nat → NList → StepRes} (r : NList) + (hk : ∀ c r1, StepSpec (S l a b (c :: denote_list r1)) (k c r1)) : + StepSpec (S l a b (denote_list r)) (popNList r k) := by + cases r with + | nil => + change StepSpec (S l a b []) (k 0 NList.nil) + rw [S_nil_r] + exact hk 0 NList.nil + | cons c r1 => + exact hk c r1 + +theorem sweep_r_spec (r l : NList) (c : Nat) : + StepSpec (S (denote_list l) 0 (c + 3) (denote_list r)) (sweep_r r l c) := by + induction r generalizing l c with + | nil => + change StepSpec (S (denote_list l) 0 (c + 3) []) (sweep_r_nil l c) + rw [S_nil_r] + unfold sweep_r_nil + refine pop_l_spec l (fun x0 l1 => ?_) + refine pop_l1_spec x0 l1 (fun x1 l2 => ?_) + simp only [mkRunning_eq, mkCons_eq, StepSpec, denote_list] + exact S03 x0 x1 c 0 (denote_list l2) [] + | cons d r1 ih => + change StepSpec (S (denote_list l) 0 (c + 3) (d :: denote_list r1)) (sweep_r_cons d r1 (sweep_r r1) l c) + unfold sweep_r_cons + refine pop_l_spec l (fun x0 l1 => ?_) + refine pop_l1_spec x0 l1 (fun x1 l2 => ?_) + simp only [forceNListS_eq] + have hstep := S03 x0 x1 c d (denote_list l2) (denote_list r1) + let l_next := mkCons c (mkCons (x0 + 2) (mkCons (x1 + 1) l2)) + have h_lnext : denote_list l_next = c :: (x0 + 2) :: (x1 + 1) :: denote_list l2 := by + simp [l_next, denote_list] + cases hd : Nat.beq d 0 with + | true => + have hd0 : d = 0 := Nat.eq_of_beq_eq_true hd + subst hd0 + change StepSpec _ (mkRunning l_next 0 2 r1) + rw [mkRunning_eq] + dsimp [StepSpec] + rw [h_lnext] + exact hstep + | false => + have hd_ne : d ≠ 0 := Nat.ne_of_beq_eq_false hd + change StepSpec _ (bindNat (d - 1) (fun d' => sweep_r r1 l_next d')) + rw [bindNat_eq] + have h_b : d + 2 = (d - 1) + 3 := by omega + rw [h_b, ← h_lnext] at hstep + exact step_spec_trans hstep (ih l_next (d - 1)) + +theorem finish_even_spec (l_new : NList) (cn : Nat) (r1 : NList) : + StepSpec (S (denote_list l_new) 0 (cn + 2) (denote_list r1)) (finish_even l_new cn r1) := by + unfold finish_even + rw [forceNListS_eq] + cases hcn : Nat.beq cn 0 with + | true => + have h0 : cn = 0 := Nat.eq_of_beq_eq_true hcn + subst h0 + change StepSpec _ (mkRunning l_new 0 2 r1) + rw [mkRunning_eq] + exact ⟨0, rfl⟩ + | false => + have hne : cn ≠ 0 := Nat.ne_of_beq_eq_false hcn + change StepSpec _ (bindNat (cn - 1) (fun cn' => sweep_r r1 l_new cn')) + rw [bindNat_eq] + have hb : cn + 2 = (cn - 1) + 3 := by omega + rw [hb] + exact sweep_r_spec r1 l_new (cn - 1) + +theorem sweep_l_spec (l1 : NList) (x0 : Nat) (r : NList) : + StepSpec (S (x0 :: denote_list l1) 0 2 (denote_list r)) (sweep_l l1 x0 r) := by + induction l1 generalizing x0 r with + | nil => + change StepSpec (S [x0] 0 2 (denote_list r)) (sweep_l_nil x0 r) + rw [S_nil_l1] + unfold sweep_l_nil + refine pop_r_spec r (fun c r1 => ?_) + simp only [bindNat_eq] + cases heven : Nat.beq (x0 % 2) 0 with + | true => + change StepSpec _ (finish_even (mkCons (x0 / 2 + 3) (mkCons 1 NList.nil)) (c + x0 / 2) r1) + rw [S_nil_l2] + have h1 := Even_S02_S01 x0 0 0 c [] (denote_list r1) heven + have h2 := finish_even_spec (mkCons (x0 / 2 + 3) (mkCons 1 NList.nil)) (c + x0 / 2) r1 + simp only [mkCons_eq, denote_list, Nat.zero_add] at h1 h2 ⊢ + exact step_spec_trans h1 h2 + | false => + dsimp only [sweep_l_nil_branch] + cases hge3 : Nat.ble 3 (x0 / 2) with + | true => + change StepSpec _ (mkRunning (mkCons (x0 / 2 - 3) NList.nil) 0 2 (mkCons 1 (mkCons ((c + x0 / 2) + 1) r1))) + have hge3' : Nat.ble 3 (0 + x0 / 2) = true := by + simpa [Nat.zero_add] using! hge3 + have h1 := Odd_S02_S12_Spos x0 0 c [] (denote_list r1) heven hge3' + simp only [mkRunning_eq, mkCons_eq, StepSpec, denote_list, Nat.zero_add] at h1 ⊢ + exact h1 + | false => + change StepSpec _ (mkRunning (mkCons (x0 / 2 + 1) NList.nil) 1 1 (mkCons ((c + x0 / 2) + 1) r1)) + have h1 := Odd_Incs_S02 x0 0 c [] (denote_list r1) heven + simp only [mkRunning_eq, mkCons_eq, StepSpec, denote_list, Nat.zero_add] at h1 ⊢ + exact h1 + | cons x1 l2 ih => + change StepSpec (S (x0 :: x1 :: denote_list l2) 0 2 (denote_list r)) (sweep_l_cons x1 l2 (sweep_l l2) x0 r) + unfold sweep_l_cons + refine pop_r_spec r (fun c r1 => ?_) + simp only [bindNat_eq] + cases heven : Nat.beq (x0 % 2) 0 with + | true => + change StepSpec _ (popNList l2 (fun x2 l3 => finish_even (mkCons ((x1 + x0 / 2) + 3) (mkCons (x2 + 1) l3)) (c + x0 / 2) r1)) + refine pop_l2_spec x0 x1 l2 (fun x2 l3 => ?_) + have h1 := Even_S02_S01 x0 x1 x2 c (denote_list l3) (denote_list r1) heven + have h2 := finish_even_spec (mkCons ((x1 + x0 / 2) + 3) (mkCons (x2 + 1) l3)) (c + x0 / 2) r1 + simp only [mkCons_eq, denote_list] at h2 ⊢ + exact step_spec_trans h1 h2 + | false => + dsimp only [sweep_l_cons_branch] + cases hge3 : Nat.ble 3 (x1 + x0 / 2) with + | true => + change StepSpec _ (bindNat ((x1 + x0 / 2) - 3) (fun x0_next => forceNListS (mkCons 1 (mkCons ((c + x0 / 2) + 1) r1)) (fun r_next => sweep_l l2 x0_next r_next))) + simp only [bindNat_eq, forceNListS_eq] + have h1 := Odd_S02_S12_Spos x0 x1 c (denote_list l2) (denote_list r1) heven hge3 + have h2 := ih ((x1 + x0 / 2) - 3) (mkCons 1 (mkCons ((c + x0 / 2) + 1) r1)) + simp only [mkCons_eq, denote_list] at h2 ⊢ + exact step_spec_trans h1 h2 + | false => + change StepSpec _ (mkRunning (mkCons ((x1 + x0 / 2) + 1) l2) 1 1 (mkCons ((c + x0 / 2) + 1) r1)) + have h1 := Odd_Incs_S02 x0 x1 c (denote_list l2) (denote_list r1) heven + simp only [mkRunning_eq, mkCons_eq, StepSpec, denote_list] + exact h1 + +theorem step_cfg_spec (l : NList) (a b : Nat) (r : NList) : + StepSpec (S (denote_list l) a b (denote_list r)) (step_cfg l a b r) := by + unfold step_cfg + cases ha2 : Nat.ble 2 a with + | true => + have hle : 2 ≤ a := Nat.le_of_ble_eq_true ha2 + change StepSpec _ (mkRunning (mkCons (a - 2) l) 0 (b + 1) r) + simp only [mkRunning_eq, mkCons_eq, StepSpec, denote_list] + have ha : a = (a - 2) + 2 := by omega + rw [ha] + exact Spos (a - 2) b (denote_list l) (denote_list r) + | false => + have hlt2 : ¬ (2 ≤ a) := nat_not_le_of_ble_eq_false ha2 + dsimp only [step_a_ge2_branch] + cases ha1 : Nat.beq a 1 with + | true => + have ha_eq : a = 1 := Nat.eq_of_beq_eq_true ha1 + subst ha_eq + change StepSpec _ (popNList l (fun x0 l1 => step_a1_x0_0_branch (Nat.beq x0 0) x0 l1 b r)) + refine pop_l_spec l (fun x0 l1 => ?_) + cases hx0_0 : Nat.beq x0 0 with + | true => + have hx0 : x0 = 0 := Nat.eq_of_beq_eq_true hx0_0 + subst hx0 + exact HS10 b (denote_list l1) (denote_list r) + | false => + have hx0_ne : x0 ≠ 0 := Nat.ne_of_beq_eq_false hx0_0 + dsimp only [step_a1_x0_0_branch] + cases hx0_2 : Nat.ble 2 x0 with + | true => + have hx0_le : 2 ≤ x0 := Nat.le_of_ble_eq_true hx0_2 + change StepSpec _ (mkRunning l1 (x0 - 2) 1 (mkCons b r)) + simp only [mkRunning_eq, mkCons_eq, StepSpec, denote_list] + have hx0_eq : x0 = (x0 - 2) + 2 := by omega + rw [hx0_eq] + exact S12 (x0 - 2) b (denote_list l1) (denote_list r) + | false => + have hx0_lt2 : ¬ (2 ≤ x0) := nat_not_le_of_ble_eq_false hx0_2 + have hx0_1 : x0 = 1 := by omega + subst hx0_1 + change StepSpec _ (popNList l1 (fun x1 l2 => step_a1_x1_0_branch (Nat.beq x1 0) x1 l2 b r)) + refine pop_l1_spec 1 l1 (fun x1 l2 => ?_) + cases hx1_0 : Nat.beq x1 0 with + | true => + have hx1 : x1 = 0 := Nat.eq_of_beq_eq_true hx1_0 + subst hx1 + change StepSpec _ (popNList l2 (fun x2 l3 => popNList l3 (fun x3 l4 => mkRunning (mkCons (x3 + 2) l4) (x2 + 2) (b + 1) r))) + refine pop_l2_spec 1 0 l2 (fun x2 l3 => ?_) + refine pop_l3_spec 1 0 x2 l3 (fun x3 l4 => ?_) + simp only [mkRunning_eq, mkCons_eq, StepSpec, denote_list] + exact S110 x2 x3 b (denote_list l4) (denote_list r) + | false => + dsimp only [step_a1_x1_0_branch] + cases hx1_2 : Nat.ble 2 x1 with + | true => + have hx1_le : 2 ≤ x1 := Nat.le_of_ble_eq_true hx1_2 + change StepSpec _ (mkRunning (mkCons x1 l2) 2 (b + 1) r) + simp only [mkRunning_eq, mkCons_eq, StepSpec, denote_list] + have hx1_eq : x1 = (x1 - 2) + 2 := by omega + have hstep := S112 (x1 - 2) b (denote_list l2) (denote_list r) + rw [← hx1_eq] at hstep + exact hstep + | false => + change StepSpec _ (mkRunning (mkCons 1 (mkCons x1 l2)) 1 b r) + simp only [mkRunning_eq, mkCons_eq, StepSpec, denote_list] + exact ⟨0, rfl⟩ + | false => + have ha_ne1 : a ≠ 1 := Nat.ne_of_beq_eq_false ha1 + have ha0 : a = 0 := by omega + subst ha0 + change StepSpec _ (step_a0_b2_branch (Nat.beq b 2) l b r) + cases hb2 : Nat.beq b 2 with + | true => + have hb_eq : b = 2 := Nat.eq_of_beq_eq_true hb2 + subst hb_eq + change StepSpec _ (popNList l (fun x0 l1 => sweep_l l1 x0 r)) + exact pop_l_spec l (fun x0 l1 => sweep_l_spec l1 x0 r) + | false => + change StepSpec _ (step_a0_b1_branch (Nat.beq b 1) l b r) + cases hb1 : Nat.beq b 1 with + | true => + have hb_eq : b = 1 := Nat.eq_of_beq_eq_true hb1 + subst hb_eq + change StepSpec _ (popNList l (fun x0 l1 => popNList l1 (fun x1 l2 => popNList r (fun c r1 => mkRunning (mkCons (x0 + 2) (mkCons (x1 + 1) l2)) 0 (c + 1) r1)))) + refine pop_l_spec l (fun x0 l1 => ?_) + refine pop_l1_spec x0 l1 (fun x1 l2 => ?_) + refine pop_r_spec r (fun c r1 => ?_) + simp only [mkRunning_eq, mkCons_eq, StepSpec, denote_list] + exact S01 x0 x1 c (denote_list l2) (denote_list r1) + | false => + change StepSpec _ (step_a0_b_ge3_branch (Nat.ble 3 b) l b r) + cases hb3 : Nat.ble 3 b with + | true => + have hb_le : 3 ≤ b := Nat.le_of_ble_eq_true hb3 + change StepSpec _ (bindNat (b - 3) (fun b' => sweep_r r l b')) + rw [bindNat_eq] + have hb_eq : b = (b - 3) + 3 := by omega + rw [hb_eq] + exact sweep_r_spec r l (b - 3) + | false => + change StepSpec _ (mkRunning l 0 b r) + rw [mkRunning_eq] + exact ⟨0, rfl⟩ + +@[simp] +theorem forceListCPS_eq {α : Type} (xs : NList) (k : NList → α) : forceListCPS xs k = k xs := by + induction xs generalizing k with + | nil => rfl + | cons h t ih => simp only [forceListCPS, bindNat_eq, ih] + +@[simp] +theorem forceRes_eq (s : StepRes) : forceRes s = s := by + cases s with + | halted => rfl + | running l a b r => simp only [forceRes, forceListCPS_eq, bindNat_eq] + +theorem run_pow_spec (k : Nat) (l : NList) (a b : Nat) (r : NList) : + StepSpec (S (denote_list l) a b (denote_list r)) (run_pow k l a b r) := by + induction k generalizing l a b r with + | zero => exact step_cfg_spec l a b r + | succ k ih => + have hnorm : Bool.rec (run_pow k l a b r) (forceRes (run_pow k l a b r)) (Nat.beq k 5) = run_pow k l a b r := by + cases Nat.beq k 5 <;> simp [forceRes_eq] + change StepSpec _ (StepRes.rec StepRes.halted (run_pow k) (Bool.rec (run_pow k l a b r) (forceRes (run_pow k l a b r)) (Nat.beq k 5))) + rw [hnorm] + have h1 := ih l a b r + cases hc : run_pow k l a b r with + | halted => rw [hc] at h1; exact h1 + | running l' a' b' r' => + rw [hc] at h1 + exact step_spec_trans h1 (ih l' a' b' r') + +theorem chain_pow (k : Nat) {l l' : NList} {a a' b b' : Nat} {r r' : NList} + (h_step : run_pow k l a b r = StepRes.running l' a' b' r') + (h_next : IsHaltFrom (S (denote_list l') a' b' (denote_list r'))) : + IsHaltFrom (S (denote_list l) a b (denote_list r)) := by + have h1 := run_pow_spec k l a b r + rw [h_step] at h1 + exact halt_from_trans h1 h_next + +theorem finish_pow (k : Nat) {l : NList} {a b : Nat} {r : NList} + (h_halt : run_pow k l a b r = StepRes.halted) : + IsHaltFrom (S (denote_list l) a b (denote_list r)) := by + have h1 := run_pow_spec k l a b r + rw [h_halt] at h1 + exact h1 + + + +-- ============================================================================ +-- Section 8: Ultra-Fast Closed-Form Kernel Evaluator (`step_combo`) & Soundness +-- ============================================================================ + +inductive StateL where + | bad : StateL + | ok (h0 h1 : Nat) (tail : NList) : StateL +deriving DecidableEq + +def strictNat {α : Type} (n : Nat) (k : Nat → α) : α := + (Nat.rec (fun _ => k 0) (fun m _ k => k m) (n + 1) : (Nat → α) → α) k + +@[simp] +theorem strictNat_eq {α : Type} (n : Nat) (k : Nat → α) : + strictNat n k = k n := rfl + +def rec_zero (_ _ : Nat) (_ : NList) : StateL := StateL.bad + +def rec_even (n x1n : Nat) (rest : NList) : StateL := + popNList rest (fun x2 rest1 => + strictNat (x1n + 5) (fun b1 => + strictNat (x2 + 2) (fun b2 => + StateL.ok n b1 (.cons b2 rest1)))) + +def rec_step (_ : Nat) (ih : Nat → Nat → NList → StateL) (x0 x1 : Nat) (rest : NList) : StateL := + let n := Nat.shiftRight x0 1 + let x1n := x1 + n + @Bool.rec (fun _ => StateL) + (@Bool.rec (fun _ => StateL) + StateL.bad + (popNList rest (fun x2 rest1 => + StateL.rec StateL.bad + (fun y0 y1 rest' => + strictNat (n + 1) (fun b0 => + strictNat (y0 + 2) (fun b1 => + strictNat (y1 + 1) (fun b2 => + StateL.ok b0 b1 (.cons b2 rest'))))) + (ih (x1n - 3) x2 rest1))) + (Nat.ble 3 x1n)) + (rec_even n x1n rest) + (Nat.beq (Nat.land x0 1) 0) + +def step_rec_fuel (fuel : Nat) : Nat → Nat → NList → StateL := + (Nat.rec rec_zero rec_step fuel : Nat → Nat → NList → StateL) + +def step_rec : Nat → Nat → NList → StateL := + step_rec_fuel 21 + +def do_odd_step (x0 x1 x2 : Nat) (rest1 : NList) : StateL := + let n := Nat.shiftRight x0 1 + let x1n := x1 + n + @Bool.rec (fun _ => StateL) + StateL.bad + (let u := x1n - 3 + @Bool.rec (fun _ => StateL) + (StateL.rec StateL.bad + (fun y0 y1 rest' => + strictNat (y0 + 2) (fun b1 => + strictNat (y1 + 1) (fun b2 => + StateL.ok n b1 (.cons b2 rest')))) + (step_rec u x2 rest1)) + (popNList rest1 (fun x3 rest2 => + let m := Nat.shiftRight u 1 + strictNat (m + 2) (fun b1 => + strictNat (x2 + m + 6) (fun b2 => + strictNat (x3 + 2) (fun b3 => + StateL.ok n b1 (.cons b2 (.cons b3 rest2))))))) + (Nat.beq (Nat.land u 1) 0)) + (Nat.ble 3 x1n) + +theorem shr1_eq_div2 (x : Nat) : Nat.shiftRight x 1 = x / 2 := rfl + +theorem land1_eq_mod2 (x : Nat) : Nat.land x 1 = x % 2 := + Nat.and_one_is_mod x + +theorem S_pad_rest (x0 x1 a b : Nat) (rest : NList) (r : List Nat) : + S (x0 :: x1 :: denote_list rest) a b r = + S (x0 :: x1 :: (popNList rest (fun x2 _ => x2)) :: denote_list (popNList rest (fun _ rest1 => rest1))) a b r := by + cases rest with + | nil => + change S [x0, x1] a b r = S [x0, x1, 0] a b r + exact S_nil_l2 x0 x1 a b r + | cons x2 rest1 => rfl + +theorem rec_step_fuel_sound (fuel : Nat) : + ∀ (x0 x1 : Nat) (rest : NList) (y0 y1 : Nat) (rest' : NList) (d : Nat) (r_tail : List Nat), + step_rec_fuel fuel x0 x1 rest = StateL.ok y0 y1 rest' → + (S (x0 :: x1 :: denote_list rest) 0 2 (1 :: d :: r_tail)) [target_tm]⊢* + (S (y0 :: y1 :: denote_list rest') 0 (d + 2) r_tail) := by + induction fuel with + | zero => + intro _ _ _ _ _ _ _ _ h + contradiction + | succ fuel ih => + intro x0 x1 rest y0 y1 rest' d r_tail h + change rec_step fuel (step_rec_fuel fuel) x0 x1 rest = StateL.ok y0 y1 rest' at h + unfold rec_step at h + dsimp only at h + rw [shr1_eq_div2, land1_eq_mod2] at h + rw [S_pad_rest x0 x1 0 2 rest] + cases rest with + | nil => + cases hev : Nat.beq (x0 % 2) 0 with + | true => + rw [hev] at h + change rec_even (x0 / 2) (x1 + x0 / 2) NList.nil = StateL.ok y0 y1 rest' at h + unfold rec_even popNList at h + simp only [strictNat_eq, StateL.ok.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + have h1 := Even_S02_S01 x0 x1 0 1 [] (d :: r_tail) hev + have h2 := S03 (x1 + x0 / 2 + 3) 1 (x0 / 2) d [] r_tail + simp only [denote_list] + exact zSt h1 (by simpa [Nat.add_comm 1 (x0 / 2), Nat.add_assoc] using! h2) + | false => + rw [hev] at h + cases hge : Nat.ble 3 (x1 + x0 / 2) with + | false => rw [hge] at h; contradiction + | true => + rw [hge] at h + dsimp only [popNList] at h + cases hrec : step_rec_fuel fuel (x1 + x0 / 2 - 3) 0 NList.nil with + | bad => rw [hrec] at h; contradiction + | ok z0 z1 zrest => + rw [hrec] at h + simp only [strictNat_eq, StateL.ok.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + have h1 := Odd_S02_S12_Spos x0 x1 1 [0] (d :: r_tail) hev hge + have h2 := ih (x1 + x0 / 2 - 3) 0 NList.nil z0 z1 zrest (x0 / 2 + 2) (d :: r_tail) hrec + have h3 := S03 z0 z1 (x0 / 2 + 1) d (denote_list zrest) r_tail + exact zSt (by simpa [Nat.add_comm 1 (x0 / 2), Nat.add_assoc] using! h1) (zSt h2 h3) + | cons x2 rest1 => + cases hev : Nat.beq (x0 % 2) 0 with + | true => + rw [hev] at h + change rec_even (x0 / 2) (x1 + x0 / 2) (NList.cons x2 rest1) = StateL.ok y0 y1 rest' at h + unfold rec_even popNList at h + simp only [strictNat_eq, StateL.ok.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + have h1 := Even_S02_S01 x0 x1 x2 1 (denote_list rest1) (d :: r_tail) hev + have h2 := S03 (x1 + x0 / 2 + 3) (x2 + 1) (x0 / 2) d (denote_list rest1) r_tail + simp only [denote_list] + exact zSt h1 (by simpa [Nat.add_comm 1 (x0 / 2), Nat.add_assoc] using! h2) + | false => + rw [hev] at h + cases hge : Nat.ble 3 (x1 + x0 / 2) with + | false => rw [hge] at h; contradiction + | true => + rw [hge] at h + dsimp only [popNList] at h + cases hrec : step_rec_fuel fuel (x1 + x0 / 2 - 3) x2 rest1 with + | bad => rw [hrec] at h; contradiction + | ok z0 z1 zrest => + rw [hrec] at h + simp only [strictNat_eq, StateL.ok.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + have h1 := Odd_S02_S12_Spos x0 x1 1 (x2 :: denote_list rest1) (d :: r_tail) hev hge + have h2 := ih (x1 + x0 / 2 - 3) x2 rest1 z0 z1 zrest (x0 / 2 + 2) (d :: r_tail) hrec + have h3 := S03 z0 z1 (x0 / 2 + 1) d (denote_list zrest) r_tail + exact zSt (by simpa [Nat.add_comm 1 (x0 / 2), Nat.add_assoc] using! h1) (zSt h2 h3) + +theorem even_step_pos (k x1 x2 : Nat) (rest1 : List Nat) : + (S ((2 * k + 2) :: x1 :: x2 :: rest1) 0 2 []) [target_tm]⊢* + (S (k :: (x1 + k + 6) :: (x2 + 2) :: rest1) 0 2 []) := by + have hev : Nat.beq ((2 * k + 2) % 2) 0 = true := by + have : (2 * k + 2) % 2 = 0 := by omega + simp [this] + have hdiv : (2 * k + 2) / 2 = k + 1 := by omega + rw [S_nil_r] + have h1 := Even_S02_S01 (2 * k + 2) x1 x2 0 rest1 [] hev + rw [hdiv, Nat.zero_add] at h1 + have h2 : S ((x1 + (k + 1) + 3) :: (x2 + 1) :: rest1) 0 ((k + 1) + 2) [] = + S ((x1 + k + 4) :: (x2 + 1) :: rest1) 0 (k + 3) [0] := by + rw [S_nil_r] + have : x1 + (k + 1) + 3 = x1 + k + 4 := by omega + rw [this] + exact zSt h1 (by rw [h2]; exact S03 (x1 + k + 4) (x2 + 1) k 0 rest1 []) + +theorem even_pow_steps (t q x1 x2 : Nat) (rest1 : List Nat) (hq : 1 ≤ q) : + (S ((q * 2 ^ (t + 1) - 2) :: x1 :: x2 :: rest1) 0 2 []) [target_tm]⊢* + (if q = 1 then + S ((x1 + 2 ^ (t + 1) + 4 * (t + 1) - 3) :: (x2 + 2 * (t + 1) - 1) :: rest1) 0 2 [] + else + S ((q - 2) :: (x1 + q * 2 ^ (t + 1) - q + 4 * (t + 1)) :: (x2 + 2 * (t + 1)) :: rest1) 0 2 []) := by + induction t generalizing x1 x2 with + | zero => + simp only [Nat.zero_add, Nat.pow_one] + split_ifs with hq1 + · subst hq1 + rw [S_nil_r] + simpa using! Even_S02_S01 0 x1 x2 0 rest1 [] rfl + · have hq2 : 2 ≤ q := by omega + have e0 : q * 2 - 2 = 2 * (q - 2) + 2 := by omega + have e1 : x1 + (q - 2) + 6 = x1 + q * 2 - q + 4 * 1 := by omega + rw [e0, ← e1] + exact even_step_pos (q - 2) x1 x2 rest1 + | succ t ih => + have hpow : 2 ≤ 2 ^ (t + 1) := by + have h0 : 1 ≤ 2 ^ t := Nat.one_le_pow t 2 (by decide) + have : 2 ^ (t + 1) = 2 * 2 ^ t := by rw [Nat.pow_succ]; ring + omega + have hq2 : 2 ≤ q * 2 ^ (t + 1) := by nlinarith + have hexp : q * 2 ^ (t + 2) - 2 = 2 * (q * 2 ^ (t + 1) - 2) + 2 := by + have : q * 2 ^ (t + 2) = 2 * (q * 2 ^ (t + 1)) := by + rw [show t + 2 = (t + 1) + 1 from rfl, Nat.pow_succ]; ring + omega + rw [hexp] + have h1 := even_step_pos (q * 2 ^ (t + 1) - 2) x1 x2 rest1 + have h2 := ih (x1 + (q * 2 ^ (t + 1) - 2) + 6) (x2 + 2) + refine zSt h1 ?_ + split_ifs at h2 ⊢ with hq1 + · subst hq1 + simp only [Nat.one_mul] at h2 ⊢ + have e1 : x1 + (2 ^ (t + 1) - 2) + 6 + 2 ^ (t + 1) + 4 * (t + 1) - 3 = x1 + 2 ^ (t + 2) + 4 * (t + 2) - 3 := by + have : 2 ^ (t + 2) = 2 * 2 ^ (t + 1) := by rw [show t + 2 = (t + 1) + 1 from rfl, Nat.pow_succ]; ring + omega + have e2 : x2 + 2 + 2 * (t + 1) - 1 = x2 + 2 * (t + 2) - 1 := by omega + rw [e1, e2] at h2; exact h2 + · have e1 : x1 + (q * 2 ^ (t + 1) - 2) + 6 + q * 2 ^ (t + 1) - q + 4 * (t + 1) = + x1 + q * 2 ^ (t + 2) - q + 4 * (t + 2) := by + have : q * 2 ^ (t + 2) = 2 * (q * 2 ^ (t + 1)) := by + rw [show t + 2 = (t + 1) + 1 from rfl, Nat.pow_succ]; ring + have hq_le : q ≤ q * 2 ^ (t + 1) := by nlinarith + omega + have e2 : x2 + 2 + 2 * (t + 1) = x2 + 2 * (t + 2) := by omega + rw [e1, e2] at h2; exact h2 + +theorem do_odd_step_sound (x0 x1 x2 : Nat) (rest1 : NList) (y0 y1 : Nat) (rest' : NList) + (hodd : Nat.beq (x0 % 2) 0 = false) + (h : do_odd_step x0 x1 x2 rest1 = StateL.ok y0 y1 rest') : + (S (x0 :: x1 :: x2 :: denote_list rest1) 0 2 []) [target_tm]⊢* + (S (y0 :: y1 :: denote_list rest') 0 2 []) := by + unfold do_odd_step at h + dsimp only at h + rw [shr1_eq_div2, land1_eq_mod2] at h + cases hge : Nat.ble 3 (x1 + x0 / 2) with + | false => rw [hge] at h; contradiction + | true => + rw [hge] at h + dsimp only at h + cases hu : Nat.beq ((x1 + x0 / 2 - 3) % 2) 0 with + | true => + rw [hu] at h + cases rest1 with + | nil => + dsimp only [popNList] at h + rw [shr1_eq_div2] at h + simp only [strictNat_eq, StateL.ok.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + rw [S_nil_r] + have h1 := Odd_S02_S12_Spos x0 x1 0 [x2, 0] [] hodd hge + have h1' : S (x0 :: x1 :: [x2]) 0 2 [0] = S (x0 :: x1 :: x2 :: [0]) 0 2 [0] := by + simp [S, LC, W1, z0i] + have h2 := Even_S02_S01 (x1 + x0 / 2 - 3) x2 0 1 [] [x0 / 2 + 1] hu + have h3 := S03 (x2 + (x1 + x0 / 2 - 3) / 2 + 3) 1 ((x1 + x0 / 2 - 3) / 2) (x0 / 2 + 1) [] [] + have h4 := S03 ((x1 + x0 / 2 - 3) / 2) (x2 + (x1 + x0 / 2 - 3) / 2 + 5) (x0 / 2) 0 [2] [] + simp only [denote_list, Nat.zero_add] at * + rw [h1'] + exact zSt h1 (zSt (by simpa [Nat.add_comm 1, Nat.add_assoc] using! h2) (zSt h3 (by simpa [← S_nil_r, Nat.add_assoc] using! h4))) + | cons x3 rest2 => + dsimp only [popNList] at h + rw [shr1_eq_div2] at h + simp only [strictNat_eq, StateL.ok.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + rw [S_nil_r] + have h1 := Odd_S02_S12_Spos x0 x1 0 (x2 :: x3 :: denote_list rest2) [] hodd hge + have h2 := Even_S02_S01 (x1 + x0 / 2 - 3) x2 x3 1 (denote_list rest2) [x0 / 2 + 1] hu + have h3 := S03 (x2 + (x1 + x0 / 2 - 3) / 2 + 3) (x3 + 1) ((x1 + x0 / 2 - 3) / 2) (x0 / 2 + 1) (denote_list rest2) [] + have h4 := S03 ((x1 + x0 / 2 - 3) / 2) (x2 + (x1 + x0 / 2 - 3) / 2 + 5) (x0 / 2) 0 ((x3 + 2) :: denote_list rest2) [] + simp only [denote_list, Nat.zero_add] at * + exact zSt h1 (zSt (by simpa [Nat.add_comm 1, Nat.add_assoc] using! h2) (zSt h3 (by simpa [← S_nil_r, Nat.add_assoc] using! h4))) + | false => + rw [hu] at h + cases hrec : step_rec (x1 + x0 / 2 - 3) x2 rest1 with + | bad => rw [hrec] at h; contradiction + | ok z0 z1 zrest => + rw [hrec] at h + simp only [strictNat_eq, StateL.ok.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + rw [S_nil_r] + have h1 := Odd_S02_S12_Spos x0 x1 0 (x2 :: denote_list rest1) [] hodd hge + have h2 := rec_step_fuel_sound 21 (x1 + x0 / 2 - 3) x2 rest1 z0 z1 zrest (x0 / 2 + 1) [] hrec + have h3 := S03 z0 z1 (x0 / 2) 0 (denote_list zrest) [] + simp only [denote_list, Nat.zero_add] at * + exact zSt h1 (zSt h2 (by simpa [← S_nil_r, Nat.add_assoc] using! h3)) + +noncomputable section +def normNListCPS : NList → (NList → StateL) → StateL := + NList.rec + (fun k => k NList.nil) + (fun h _ ih k => + @Nat.rec (fun _ => StateL) StateL.bad (fun vh _ => ih (fun t' => k (NList.cons vh t'))) (Nat.add 1 h)) + +theorem normNListCPS_eq (xs : NList) (k : NList → StateL) : normNListCPS xs k = k xs := by + induction xs generalizing k with + | nil => rfl + | cons h t ih => + change @Nat.rec (fun _ => StateL) StateL.bad (fun vh _ => normNListCPS t (fun t' => k (NList.cons vh t'))) (Nat.add 1 h) = k (NList.cons h t) + have h1 : Nat.add 1 h = Nat.succ h := Nat.add_comm 1 h + rw [h1] + dsimp only + exact ih (fun t' => k (NList.cons h t')) + +def normStateL (s : StateL) : StateL := + StateL.rec StateL.bad (fun h0 h1 tail => + @Nat.rec (fun _ => StateL) StateL.bad (fun v0 _ => + @Nat.rec (fun _ => StateL) StateL.bad (fun v1 _ => + normNListCPS tail (fun tail' => StateL.ok v0 v1 tail')) + (Nat.add 1 h1)) + (Nat.add 1 h0)) s + +theorem normStateL_eq (s : StateL) : normStateL s = s := by + cases s with + | bad => rfl + | ok h0 h1 tail => + unfold normStateL + dsimp only + have e0 : Nat.add 1 h0 = Nat.succ h0 := Nat.add_comm 1 h0 + have e1 : Nat.add 1 h1 = Nat.succ h1 := Nat.add_comm 1 h1 + rw [e0, e1] + dsimp only + exact normNListCPS_eq tail (fun tail' => StateL.ok h0 h1 tail') + + +@[simp] theorem nat_add_eq (x y : Nat) : x.add y = x + y := rfl +@[simp] theorem nat_sub_eq (x y : Nat) : x.sub y = x - y := rfl + +noncomputable def popNList_fast : NList → (Nat → NList → StateL) → StateL := + fun xs f => (NList.rec (fun f => f 0 NList.nil) (fun h t _ f => f h t) xs : (Nat → NList → StateL) → StateL) f + +theorem popNList_fast_eq : popNList_fast = popNList := by + funext xs f + cases xs <;> rfl + +noncomputable def rec_step_f (_ : Nat) (ih : Nat → Nat → NList → StateL) (x0 x1 : Nat) (rest : NList) : StateL := + let n := Nat.shiftRight x0 1 + let x1n := Nat.add x1 n + @Bool.rec (fun _ => StateL) + (@Bool.rec (fun _ => StateL) + StateL.bad + (popNList_fast rest (fun x2 rest1 => + StateL.rec StateL.bad + (fun y0 y1 rest' => + StateL.ok (Nat.add n 1) (Nat.add y0 2) (NList.cons (Nat.add y1 1) rest')) + (ih (Nat.sub x1n 3) x2 rest1))) + (Nat.ble 3 x1n)) + (popNList_fast rest (fun x2 rest1 => + StateL.ok n (Nat.add x1n 5) (NList.cons (Nat.add x2 2) rest1))) + (Nat.beq (Nat.land x0 1) 0) + +noncomputable def step_rec_f_fuel (fuel : Nat) : Nat → Nat → NList → StateL := + @Nat.rec (fun _ => Nat → Nat → NList → StateL) (fun _ _ _ => StateL.bad) rec_step_f fuel + +theorem rec_step_f_eq (f : Nat) (ih : Nat → Nat → NList → StateL) (x0 x1 : Nat) (rest : NList) : + rec_step_f f ih x0 x1 rest = rec_step f ih x0 x1 rest := by + unfold rec_step_f rec_step rec_even + simp only [popNList_fast_eq, nat_add_eq, nat_sub_eq, strictNat_eq] + +theorem step_rec_f_fuel_eq (fuel : Nat) : step_rec_f_fuel fuel = step_rec_fuel fuel := by + induction fuel with + | zero => rfl + | succ fuel ih => + funext x0 x1 rest + change rec_step_f fuel (step_rec_f_fuel fuel) x0 x1 rest = rec_step fuel (step_rec_fuel fuel) x0 x1 rest + rw [ih] + exact rec_step_f_eq fuel (step_rec_fuel fuel) x0 x1 rest + +noncomputable def ctz_run (fuel : Nat) (k : Nat → Nat → StateL) : Nat → Nat → StateL := + @Nat.rec (fun _ => Nat → Nat → StateL) k + (fun _ ih_c t q => @Bool.rec (fun _ => StateL) (ih_c (Nat.add t 1) (Nat.shiftRight q 1)) (k t q) (Nat.beq (Nat.land q 1) 1)) + fuel + +theorem nat_rec_ctz_exists (fuel : Nat) (k : Nat → Nat → StateL) (t0 q0 : Nat) : + ∃ t q, ctz_run fuel k t0 q0 = k t q := by + unfold ctz_run + induction fuel generalizing t0 q0 with + | zero => exact ⟨t0, q0, rfl⟩ + | succ fuel ih => + dsimp only + cases Nat.beq (Nat.land q0 1) 1 + · exact ih (Nat.add t0 1) (Nat.shiftRight q0 1) + · exact ⟨t0, q0, rfl⟩ + +theorem shiftLeft_eq_mul_pow : ∀ (q t : Nat), Nat.shiftLeft q t = q * 2 ^ t + | q, 0 => by simp [Nat.shiftLeft] + | q, t + 1 => by + change Nat.shiftLeft (2 * q) t = q * 2 ^ (t + 1) + rw [shiftLeft_eq_mul_pow (2 * q) t, Nat.pow_succ] + ring + +abbrev ContL := Nat → Nat → Nat → NList → StateL + +def CPS_Sound (F : ContL → ContL) : Prop := + ∀ (cont : ContL) (y0 y1 : Nat) (rest' : NList), + (∀ v0 v1 v2 tail, cont v0 v1 v2 tail = StateL.ok y0 y1 rest' → + (S (v0 :: v1 :: v2 :: denote_list tail) 0 2 []) [target_tm]⊢* + (S (y0 :: y1 :: denote_list rest') 0 2 [])) → + ∀ x0 x1 x2 rest1, + F cont x0 x1 x2 rest1 = StateL.ok y0 y1 rest' → + (S (x0 :: x1 :: x2 :: denote_list rest1) 0 2 []) [target_tm]⊢* + (S (y0 :: y1 :: denote_list rest') 0 2 []) + +noncomputable def compCPS (F G : ContL → ContL) : ContL → ContL := fun k => F (G k) +noncomputable def apply2 (F : ContL → ContL) : ContL → ContL := fun k => F (F k) + +theorem cps_comp {F G : ContL → ContL} (hF : CPS_Sound F) (hG : CPS_Sound G) : + CPS_Sound (compCPS F G) := + fun cont y0 y1 rest' hcont => hF (G cont) y0 y1 rest' (hG cont y0 y1 rest' hcont) + +theorem cps_apply2 {F : ContL → ContL} (hF : CPS_Sound F) : CPS_Sound (apply2 F) := + cps_comp hF hF + +noncomputable def do_odd_k_def + (popNList_f : NList → (Nat → NList → StateL) → StateL) + (step_rec_f : Nat → Nat → NList → StateL) + (cont : ContL) + (x0 x1 x2 : Nat) (rest1 : NList) : StateL := + let n := Nat.shiftRight x0 1 + let x1n := Nat.add x1 n + @Bool.rec (fun _ => StateL) + StateL.bad + (let u := Nat.sub x1n 3 + @Bool.rec (fun _ => StateL) + (StateL.rec StateL.bad + (fun y0 y1 rest' => + cont n (Nat.add y0 2) (Nat.add y1 1) rest') + (step_rec_f u x2 rest1)) + (popNList_f rest1 (fun x3 rest2 => + let m := Nat.shiftRight u 1 + cont n (Nat.add m 2) (Nat.add (Nat.add x2 m) 6) (NList.cons (Nat.add x3 2) rest2))) + (Nat.beq (Nat.land u 1) 0)) + (Nat.ble 3 x1n) + +theorem do_odd_k_sound + {popNList_f : NList → (Nat → NList → StateL) → StateL} + (hpop : popNList_f = popNList) + {step_rec_f : Nat → Nat → NList → StateL} + (hsr : step_rec_f = step_rec_fuel 20) + (cont : ContL) {y0 y1 : Nat} {rest' : NList} + (hcont : ∀ v0 v1 v2 tail, cont v0 v1 v2 tail = StateL.ok y0 y1 rest' → + (S (v0 :: v1 :: v2 :: denote_list tail) 0 2 []) [target_tm]⊢* + (S (y0 :: y1 :: denote_list rest') 0 2 [])) + (x0 x1 x2 : Nat) (rest1 : NList) + (hodd : Nat.beq (x0 % 2) 0 = false) + (h : do_odd_k_def popNList_f step_rec_f cont x0 x1 x2 rest1 = StateL.ok y0 y1 rest') : + (S (x0 :: x1 :: x2 :: denote_list rest1) 0 2 []) [target_tm]⊢* + (S (y0 :: y1 :: denote_list rest') 0 2 []) := by + subst hpop; subst hsr + unfold do_odd_k_def at h + simp only [nat_add_eq, nat_sub_eq, shr1_eq_div2, land1_eq_mod2] at h + cases hge : Nat.ble 3 (x1 + x0 / 2) with + | false => rw [hge] at h; contradiction + | true => + rw [hge] at h + dsimp only at h + cases hu : Nat.beq ((x1 + x0 / 2 - 3) % 2) 0 with + | true => + rw [hu] at h + dsimp only at h + let x3 := popNList rest1 (fun x3 _ => x3) + let rest2 := popNList rest1 (fun _ rest2 => rest2) + have hpop1 : ∀ {f : Nat → NList → StateL}, popNList rest1 f = f x3 rest2 := by + intro f; cases rest1 <;> rfl + rw [hpop1] at h + have hdo : do_odd_step x0 x1 x2 rest1 = + StateL.ok (x0 / 2) ((x1 + x0 / 2 - 3) / 2 + 2) + (.cons (x2 + (x1 + x0 / 2 - 3) / 2 + 6) (.cons (x3 + 2) rest2)) := by + unfold do_odd_step + simp only [shr1_eq_div2, land1_eq_mod2, hge, hu, hpop1, strictNat_eq] + exact zSt (do_odd_step_sound x0 x1 x2 rest1 _ _ _ hodd hdo) (hcont _ _ _ _ h) + | false => + rw [hu] at h + dsimp only at h + cases hrec : step_rec_fuel 20 (x1 + x0 / 2 - 3) x2 rest1 with + | bad => rw [hrec] at h; contradiction + | ok z0 z1 zrest => + rw [hrec] at h + dsimp only at h + have hstep1 : (S (x0 :: x1 :: x2 :: denote_list rest1) 0 2 []) [target_tm]⊢* + (S ((x0 / 2) :: (z0 + 2) :: (z1 + 1) :: denote_list zrest) 0 2 []) := by + rw [S_nil_r] + have h1 := Odd_S02_S12_Spos x0 x1 0 (x2 :: denote_list rest1) [] hodd hge + have h2 := rec_step_fuel_sound 20 (x1 + x0 / 2 - 3) x2 rest1 z0 z1 zrest (x0 / 2 + 1) [] hrec + have h3 := S03 z0 z1 (x0 / 2) 0 (denote_list zrest) [] + simp only [denote_list, Nat.zero_add] at * + exact zSt h1 (zSt h2 (by simpa [← S_nil_r, Nat.add_assoc] using! h3)) + exact zSt hstep1 (hcont _ _ _ _ h) + +noncomputable def step1_k_fuel (fuel : Nat) + (popNList_f : NList → (Nat → NList → StateL) → StateL) + (do_odd_k : ContL → ContL) + (cont : ContL) + (x0 x1 x2 : Nat) (rest1 : NList) : StateL := + @Bool.rec (fun _ => StateL) + (do_odd_k cont x0 x1 x2 rest1) + (let h := Nat.add (Nat.shiftRight x0 1) 1 + @Bool.rec (fun _ => StateL) + (let z := Nat.add x0 2 +(ctz_run fuel + (fun t q => + @Bool.rec (fun _ => StateL) + StateL.bad + (@Bool.rec (fun _ => StateL) + (do_odd_k cont (Nat.sub q 2) + (Nat.add (Nat.sub (Nat.add x1 z) q) (Nat.mul 4 t)) + (Nat.add x2 (Nat.mul 2 t)) + rest1) + (popNList_f rest1 (fun x3 rest2 => + cont + (Nat.sub (Nat.add (Nat.add x1 z) (Nat.mul 4 t)) 3) + (Nat.sub (Nat.add x2 (Nat.mul 2 t)) 1) + x3 rest2)) + (Nat.beq q 1)) + (Bool.and (Nat.beq z (Nat.shiftLeft q t)) (Bool.and (Nat.beq (Nat.land q 1) 1) (Nat.ble 1 t))))) 2 (Nat.shiftRight h 1)) + (@Bool.rec (fun _ => StateL) + (do_odd_k cont (Nat.sub h 2) (Nat.add (Nat.add x1 h) 4) (Nat.add x2 2) rest1) + (popNList_f rest1 (fun x3 rest2 => cont (Nat.add x1 3) (Nat.add x2 1) x3 rest2)) + (Nat.beq h 1)) + (Nat.beq (Nat.land h 1) 1)) + (Nat.beq (Nat.land x0 1) 0) + +noncomputable def step1_k_def + (popNList_f : NList → (Nat → NList → StateL) → StateL) + (do_odd_k : ContL → ContL) : ContL → ContL := + step1_k_fuel 13 popNList_f do_odd_k + +theorem step1_k_sound + {popNList_f : NList → (Nat → NList → StateL) → StateL} + (hpop : popNList_f = popNList) + {do_odd_k : ContL → ContL} + (hdo : ∀ (cont : ContL) {y0 y1 rest'}, + (∀ v0 v1 v2 tail, cont v0 v1 v2 tail = StateL.ok y0 y1 rest' → + (S (v0 :: v1 :: v2 :: denote_list tail) 0 2 []) [target_tm]⊢* + (S (y0 :: y1 :: denote_list rest') 0 2 [])) → + ∀ x0 x1 x2 rest1, Nat.beq (x0 % 2) 0 = false → + do_odd_k cont x0 x1 x2 rest1 = StateL.ok y0 y1 rest' → + (S (x0 :: x1 :: x2 :: denote_list rest1) 0 2 []) [target_tm]⊢* + (S (y0 :: y1 :: denote_list rest') 0 2 [])) : + CPS_Sound (step1_k_def popNList_f do_odd_k) := by + subst hpop + intro cont y0 y1 rest' hcont x0 x1 x2 rest1 h + unfold step1_k_def step1_k_fuel at h + simp only [nat_add_eq, nat_sub_eq, shr1_eq_div2, land1_eq_mod2] at h + cases hev : Nat.beq (x0 % 2) 0 with + | false => + rw [hev] at h + exact hdo cont hcont x0 x1 x2 rest1 hev h + | true => + rw [hev] at h + dsimp only at h + let hv := x0 / 2 + 1 + cases hh : Nat.beq (hv % 2) 1 with + | true => + rw [hh] at h + dsimp only at h + have hhv_ge1 : 1 ≤ hv := by dsimp [hv]; omega + have h_run := even_pow_steps 0 hv x1 x2 (denote_list rest1) hhv_ge1 + have hx0_hv : hv * 2 ^ 1 - 2 = x0 := by + have hx0_mod : x0 % 2 = 0 := Nat.eq_of_beq_eq_true hev + dsimp [hv]; omega + rw [hx0_hv] at h_run + cases hh1 : Nat.beq hv 1 with + | true => + rw [hh1] at h + dsimp only at h + let x3 := popNList rest1 (fun x3 _ => x3) + let rest2 := popNList rest1 (fun _ rest2 => rest2) + have hpop1 : ∀ {f : Nat → NList → StateL}, popNList rest1 f = f x3 rest2 := by + intro f; cases rest1 <;> rfl + rw [hpop1] at h + have hhv1 : hv = 1 := Nat.eq_of_beq_eq_true hh1 + simp only [hhv1, ↓reduceIte] at h_run + have h_run' : (S (x0 :: x1 :: x2 :: denote_list rest1) 0 2 []) [target_tm]⊢* + (S ((x1 + 3) :: (x2 + 1) :: denote_list rest1) 0 2 []) := by + simpa using! h_run + rw [S_pad_rest (x1 + 3) (x2 + 1) 0 2 rest1 []] at h_run' + exact zSt h_run' (hcont _ _ _ _ h) + | false => + rw [hh1] at h + dsimp only at h + have hhv_mod1 : hv % 2 = 1 := Nat.eq_of_beq_eq_true hh + have hhv_ne1 : hv ≠ 1 := Nat.ne_of_beq_eq_false hh1 + simp only [hhv_ne1, ↓reduceIte] at h_run + have hh_sub2_odd : Nat.beq ((hv - 2) % 2) 0 = false := by + have : (hv - 2) % 2 = 1 := by omega + rw [this]; rfl + have h1_arith : x1 + hv * 2 ^ (0 + 1) - hv + 4 * (0 + 1) = x1 + hv + 4 := by dsimp [hv]; omega + have h2_arith : x2 + 2 * (0 + 1) = x2 + 2 := rfl + rw [h1_arith, h2_arith] at h_run + exact zSt h_run (hdo cont hcont (hv - 2) (x1 + hv + 4) (x2 + 2) rest1 hh_sub2_odd h) + | false => + rw [hh] at h + dsimp only at h + let z := x0 + 2 + rcases nat_rec_ctz_exists 13 _ 2 (hv / 2) with ⟨t, q, h_tq⟩ + rw [h_tq] at h + simp only [show ∀ a b, Nat.mul a b = a * b from fun _ _ => rfl] at h + cases hchk : Bool.and (Nat.beq z (Nat.shiftLeft q t)) (Bool.and (Nat.beq (q % 2) 1) (Nat.ble 1 t)) with + | false => rw [hchk] at h; dsimp only at h; contradiction + | true => + rw [hchk] at h + dsimp only at h + simp only [Bool.and_eq_true] at hchk + rcases hchk with ⟨hz_eq, hq_odd, ht_ge1⟩ + have hz : z = q * 2 ^ t := by rw [← shiftLeft_eq_mul_pow q t]; exact Nat.eq_of_beq_eq_true hz_eq + have hq_mod : q % 2 = 1 := Nat.eq_of_beq_eq_true hq_odd + have ht1 : 1 ≤ t := Nat.le_of_ble_eq_true ht_ge1 + have hq1 : 1 ≤ q := by omega + have h_even_run := even_pow_steps (t - 1) q x1 x2 (denote_list rest1) hq1 + have ht_eq : (t - 1) + 1 = t := by omega + rw [ht_eq] at h_even_run + have hx0_eq : q * 2 ^ t - 2 = x0 := by dsimp [z] at hz; omega + rw [hx0_eq, ← hz] at h_even_run + cases hq_one : Nat.beq q 1 with + | true => + rw [hq_one] at h + dsimp only at h + let x3 := popNList rest1 (fun x3 _ => x3) + let rest2 := popNList rest1 (fun _ rest2 => rest2) + have hpop1 : ∀ {f : Nat → NList → StateL}, popNList rest1 f = f x3 rest2 := by + intro f; cases rest1 <;> rfl + rw [hpop1] at h + have hq_is1 : q = 1 := Nat.eq_of_beq_eq_true hq_one + have hz_1 : 2 ^ t = z := by rw [hz, hq_is1, Nat.one_mul] + simp only [hq_is1, ↓reduceIte, hz_1] at h_even_run + rw [S_pad_rest (x1 + z + 4 * t - 3) (x2 + 2 * t - 1) 0 2 rest1 []] at h_even_run + exact zSt h_even_run (hcont _ _ _ _ h) + | false => + rw [hq_one] at h + dsimp only at h + have hq_ne1 : q ≠ 1 := Nat.ne_of_beq_eq_false hq_one + simp only [hq_ne1, ↓reduceIte] at h_even_run + have hq_sub2_odd : Nat.beq ((q - 2) % 2) 0 = false := by + have hmod1 : (q - 2) % 2 = 1 := by omega + rw [hmod1]; rfl + exact zSt h_even_run (hdo cont hcont (q - 2) (x1 + z - q + 4 * t) (x2 + 2 * t) rest1 hq_sub2_odd h) + +noncomputable def run_tree_16 + (normState_f : StateL → StateL) + (leaf : Nat → Nat → NList → StateL) : + Nat → Nat → Nat → NList → StateL := + @Nat.rec (fun _ => Nat → Nat → NList → StateL) leaf + (fun j ih x0 x1 rest => + (@Bool.rec (fun _ => StateL → StateL) (fun s => s) normState_f (Nat.beq j 0)) + (StateL.rec StateL.bad ih (ih x0 x1 rest))) + +theorem run_tree_16_sound + {normState_f : StateL → StateL} + (hnorm : normState_f = normStateL) + {leaf : Nat → Nat → NList → StateL} + (hleaf : ∀ x0 x1 rest y0 y1 rest', + leaf x0 x1 rest = StateL.ok y0 y1 rest' → + (S (x0 :: x1 :: denote_list rest) 0 2 []) [target_tm]⊢* + (S (y0 :: y1 :: denote_list rest') 0 2 [])) + (k : Nat) : + ∀ (x0 x1 : Nat) (rest : NList) (y0 y1 : Nat) (rest' : NList), + run_tree_16 normState_f leaf k x0 x1 rest = StateL.ok y0 y1 rest' → + (S (x0 :: x1 :: denote_list rest) 0 2 []) [target_tm]⊢* + (S (y0 :: y1 :: denote_list rest') 0 2 []) := by + subst hnorm + induction k with + | zero => exact hleaf + | succ j ih => + intro x0 x1 rest y0 y1 rest' h + let step_j := run_tree_16 normStateL leaf j + change (@Bool.rec (fun _ => StateL → StateL) (fun s => s) normStateL (Nat.beq j 0)) + (StateL.rec StateL.bad step_j (step_j x0 x1 rest)) = StateL.ok y0 y1 rest' at h + cases hb0 : Nat.beq j 0 with + | true => + rw [hb0] at h; dsimp only at h; rw [normStateL_eq] at h + cases hc : step_j x0 x1 rest with + | bad => rw [hc] at h; contradiction + | ok m0 m1 mrest => + rw [hc] at h + exact zSt (ih x0 x1 rest m0 m1 mrest hc) (ih m0 m1 mrest y0 y1 rest' h) + | false => + rw [hb0] at h; dsimp only at h + cases hc : step_j x0 x1 rest with + | bad => rw [hc] at h; contradiction + | ok m0 m1 mrest => + rw [hc] at h + exact zSt (ih x0 x1 rest m0 m1 mrest hc) (ih m0 m1 mrest y0 y1 rest' h) + +noncomputable def plain_finish_def (v0 v1 v2 : Nat) (tail : NList) : StateL := + StateL.ok v0 v1 (NList.cons v2 tail) + +noncomputable def run_C_fast_fuel (fuel_rec fuel k : Nat) : Nat → Nat → NList → StateL := + ((fun (popNList_f : NList → (Nat → NList → StateL) → StateL) => + ((fun (normState_f : StateL → StateL) => + ((fun (plain_finish : ContL) => + ((fun (step_rec_f : Nat → Nat → NList → StateL) => + ((fun (do_odd_k : ContL → ContL) => + ((fun (step1_k : ContL → ContL) => + ((fun (s2 : ContL → ContL) => + ((fun (s4 : ContL → ContL) => + ((fun (s8 : ContL → ContL) => + ((fun (leaf : Nat → Nat → NList → StateL) => + @Nat.rec (fun _ => Nat → Nat → NList → StateL) leaf + (fun j ih x0 x1 rest => + (@Bool.rec (fun _ => StateL → StateL) (fun s => s) normState_f (Nat.beq j 0)) + (StateL.rec StateL.bad ih (ih x0 x1 rest))) + k) + (fun x0 x1 rest => popNList_f rest (fun x2 rest1 => apply2 s8 plain_finish x0 x1 x2 rest1)))) + (apply2 s4))) + (apply2 s2))) + (apply2 step1_k))) + (step1_k_fuel fuel popNList_f do_odd_k))) + (do_odd_k_def popNList_f step_rec_f))) + (step_rec_f_fuel fuel_rec))) + plain_finish_def)) + normStateL)) + popNList_fast) + +noncomputable def run_C_fast (k : Nat) : Nat → Nat → NList → StateL := + run_C_fast_fuel 20 13 k + +noncomputable def run_tail13_fuel (fuel_rec fuel : Nat) : Nat → Nat → NList → StateL := + ((fun (popNList_f : NList → (Nat → NList → StateL) → StateL) => + ((fun (plain_finish : ContL) => + ((fun (step_rec_f : Nat → Nat → NList → StateL) => + ((fun (do_odd_k : ContL → ContL) => + ((fun (step1_k : ContL → ContL) => + ((fun (s2 : ContL → ContL) => + ((fun (s4 : ContL → ContL) => + ((fun (s8 : ContL → ContL) => + fun x0 x1 rest => popNList_f rest (fun x2 rest1 => compCPS s8 (compCPS s4 step1_k) plain_finish x0 x1 x2 rest1)) + (apply2 s4))) + (apply2 s2))) + (apply2 step1_k))) + (step1_k_fuel fuel popNList_f do_odd_k))) + (do_odd_k_def popNList_f step_rec_f))) + (step_rec_f_fuel fuel_rec))) + plain_finish_def)) + popNList_fast) + +noncomputable def run_tail13 : Nat → Nat → NList → StateL := + run_tail13_fuel 20 13 + +theorem plain_finish_sound (v0 v1 v2 : Nat) (tail : NList) (y0 y1 : Nat) (rest' : NList) + (h : plain_finish_def v0 v1 v2 tail = StateL.ok y0 y1 rest') : + (S (v0 :: v1 :: v2 :: denote_list tail) 0 2 []) [target_tm]⊢* + (S (y0 :: y1 :: denote_list rest') 0 2 []) := by + unfold plain_finish_def at h + simp only [StateL.ok.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + dsimp only [denote_list] + exact ⟨0, rfl⟩ + +theorem step_rec_f_17_plus_3 : step_rec_f_fuel 20 = step_rec_fuel 20 := step_rec_f_fuel_eq 20 + +theorem run_leaf_cps_sound + {popNList_f : NList → (Nat → NList → StateL) → StateL} + (hpop : popNList_f = popNList) + {F : ContL → ContL} + (hF : CPS_Sound F) + (x0 x1 : Nat) (rest : NList) (y0 y1 : Nat) (rest' : NList) + (h : popNList_f rest (fun x2 rest1 => F plain_finish_def x0 x1 x2 rest1) = StateL.ok y0 y1 rest') : + (S (x0 :: x1 :: denote_list rest) 0 2 []) [target_tm]⊢* + (S (y0 :: y1 :: denote_list rest') 0 2 []) := by + subst hpop + rw [S_pad_rest x0 x1 0 2 rest []] + let x2 := popNList rest (fun x2 _ => x2) + let rest1 := popNList rest (fun _ rest1 => rest1) + have hpop1 : ∀ {f : Nat → NList → StateL}, popNList rest f = f x2 rest1 := by + intro f; cases rest <;> rfl + rw [hpop1] at h + exact hF plain_finish_def y0 y1 rest' (fun v0 v1 v2 tail => plain_finish_sound v0 v1 v2 tail y0 y1 rest') x0 x1 x2 rest1 h + +theorem run_C_fast_sound (k : Nat) : + ∀ (x0 x1 : Nat) (rest : NList) (y0 y1 : Nat) (rest' : NList), + run_C_fast k x0 x1 rest = StateL.ok y0 y1 rest' → + (S (x0 :: x1 :: denote_list rest) 0 2 []) [target_tm]⊢* + (S (y0 :: y1 :: denote_list rest') 0 2 []) := + have hs1 := step1_k_sound popNList_fast_eq (fun cont {_ _ _} hcont => do_odd_k_sound popNList_fast_eq step_rec_f_17_plus_3 cont hcont) + have hs16 := cps_apply2 (cps_apply2 (cps_apply2 (cps_apply2 hs1))) + run_tree_16_sound rfl (run_leaf_cps_sound popNList_fast_eq hs16) k + +theorem run_tail13_sound : + ∀ (x0 x1 : Nat) (rest : NList) (y0 y1 : Nat) (rest' : NList), + run_tail13 x0 x1 rest = StateL.ok y0 y1 rest' → + (S (x0 :: x1 :: denote_list rest) 0 2 []) [target_tm]⊢* + (S (y0 :: y1 :: denote_list rest') 0 2 []) := + have hs1 := step1_k_sound popNList_fast_eq (fun cont {_ _ _} hcont => do_odd_k_sound popNList_fast_eq step_rec_f_17_plus_3 cont hcont) + have hs4 := cps_apply2 (cps_apply2 hs1) + have hs8 := cps_apply2 hs4 + run_leaf_cps_sound popNList_fast_eq (cps_comp hs8 (cps_comp hs4 hs1)) + +noncomputable def beqNList : NList → NList → Bool := + NList.rec + (fun b => NList.rec true (fun _ _ _ => false) b) + (fun h1 _ ih b => + NList.rec false (fun h2 t2 _ => @Bool.rec (fun _ => Bool) false (ih t2) (Nat.beq h1 h2)) b) + +theorem beqNList_sound : ∀ (a b : NList), beqNList a b = true → a = b + | .nil, .nil, _ => rfl + | .cons _ _, .nil, h => by simp [beqNList] at h + | .nil, .cons _ _, h => by simp [beqNList] at h + | .cons h1 t1, .cons h2 t2, h => by + simp only [beqNList] at h + cases heq : Nat.beq h1 h2 + · rw [heq] at h; simp at h + · rw [heq] at h; dsimp at h + rw [Nat.eq_of_beq_eq_true heq, beqNList_sound t1 t2 h] + +noncomputable def checkStateL (s : StateL) (e0 e1 : Nat) (erest : NList) : Bool := + StateL.rec false + (fun h0 h1 tail => + @Bool.rec (fun _ => Bool) false + (@Bool.rec (fun _ => Bool) false (beqNList tail erest) (Nat.beq h1 e1)) + (Nat.beq h0 e0)) + s + +theorem checkStateL_sound {s : StateL} {e0 e1 : Nat} {erest : NList} + (h : checkStateL s e0 e1 erest = true) : + s = StateL.ok e0 e1 erest := by + cases s with + | bad => simp [checkStateL] at h + | ok h0 h1 tail => + simp only [checkStateL] at h + cases h0_eq : Nat.beq h0 e0 + · rw [h0_eq] at h; simp at h + · rw [h0_eq] at h; dsimp at h + cases h1_eq : Nat.beq h1 e1 + · rw [h1_eq] at h; simp at h + · rw [h1_eq] at h; dsimp at h + rw [Nat.eq_of_beq_eq_true h0_eq, Nat.eq_of_beq_eq_true h1_eq, beqNList_sound tail erest h] + +theorem chain_C_fast {x0 x1 y0 y1 : Nat} {rest rest' : NList} + (h_step : checkStateL (run_C_fast 12 x0 x1 rest) y0 y1 rest' = true) + (h_next : IsHaltFrom (S (y0 :: y1 :: denote_list rest') 0 2 [])) : + IsHaltFrom (S (x0 :: x1 :: denote_list rest) 0 2 []) := + halt_from_trans (run_C_fast_sound 12 x0 x1 rest y0 y1 rest' (checkStateL_sound h_step)) h_next + +noncomputable def run_rem_fast (x0 x1 : Nat) (rest : NList) : StateL := + let s := run_C_fast 11 x0 x1 rest + let s := StateL.rec StateL.bad (run_C_fast 10) s + let s := StateL.rec StateL.bad (run_C_fast 8) s + let s := StateL.rec StateL.bad (run_C_fast 7) s + let s := StateL.rec StateL.bad (run_C_fast 6) s + let s := StateL.rec StateL.bad (run_C_fast 5) s + let s := StateL.rec StateL.bad (run_C_fast 4) s + let s := StateL.rec StateL.bad (run_C_fast 0) s + StateL.rec StateL.bad run_tail13 s + +theorem stepL_fast_step (k : Nat) {s : StateL} {y0 y1 : Nat} {rest' : NList} + (h : StateL.rec StateL.bad (run_C_fast k) s = StateL.ok y0 y1 rest') : + ∃ x0 x1 rest, s = StateL.ok x0 x1 rest ∧ + ((S (x0 :: x1 :: denote_list rest) 0 2 []) [target_tm]⊢* + (S (y0 :: y1 :: denote_list rest') 0 2 [])) := by + cases s with + | bad => contradiction + | ok x0 x1 rest => exact ⟨x0, x1, rest, rfl, run_C_fast_sound k x0 x1 rest y0 y1 rest' h⟩ + +theorem stepL_tail13_step {s : StateL} {y0 y1 : Nat} {rest' : NList} + (h : StateL.rec StateL.bad run_tail13 s = StateL.ok y0 y1 rest') : + ∃ x0 x1 rest, s = StateL.ok x0 x1 rest ∧ + ((S (x0 :: x1 :: denote_list rest) 0 2 []) [target_tm]⊢* + (S (y0 :: y1 :: denote_list rest') 0 2 [])) := by + cases s with + | bad => contradiction + | ok x0 x1 rest => exact ⟨x0, x1, rest, rfl, run_tail13_sound x0 x1 rest y0 y1 rest' h⟩ + +theorem run_rem_fast_sound {x0 x1 y0 y1 : Nat} {rest rest' : NList} + (h_step : checkStateL (run_rem_fast x0 x1 rest) y0 y1 rest' = true) : + (S (x0 :: x1 :: denote_list rest) 0 2 []) [target_tm]⊢* + (S (y0 :: y1 :: denote_list rest') 0 2 []) := by + have h := checkStateL_sound h_step + unfold run_rem_fast at h + rcases stepL_tail13_step h with ⟨a1, b1, r1, h1, s1⟩ + rcases stepL_fast_step 0 h1 with ⟨a2, b2, r2, h2, s2⟩ + rcases stepL_fast_step 4 h2 with ⟨a3, b3, r3, h3, s3⟩ + rcases stepL_fast_step 5 h3 with ⟨a4, b4, r4, h4, s4⟩ + rcases stepL_fast_step 6 h4 with ⟨a5, b5, r5, h5, s5⟩ + rcases stepL_fast_step 7 h5 with ⟨a6, b6, r6, h6, s6⟩ + rcases stepL_fast_step 8 h6 with ⟨a7, b7, r7, h7, s7⟩ + rcases stepL_fast_step 10 h7 with ⟨a8, b8, r8, h8, s8⟩ + have s9 := run_C_fast_sound 11 x0 x1 rest a8 b8 r8 h8 + exact zSt s9 (zSt s8 (zSt s7 (zSt s6 (zSt s5 (zSt s4 (zSt s3 (zSt s2 s1))))))) + +theorem chain_rem_fast {x0 x1 y0 y1 : Nat} {rest rest' : NList} + (h_step : checkStateL (run_rem_fast x0 x1 rest) y0 y1 rest' = true) + (h_next : IsHaltFrom (S (y0 :: y1 :: denote_list rest') 0 2 [])) : + IsHaltFrom (S (x0 :: x1 :: denote_list rest) 0 2 []) := + halt_from_trans (run_rem_fast_sound h_step) h_next + +noncomputable def rec_step_comb (ih : Nat → Nat → NList → StateL) (x0 x1 : Nat) (rest : NList) : StateL := + let n := Nat.shiftRight x0 1 + let x1n := Nat.add x1 n + @Bool.rec (fun _ => Nat → Nat → NList → StateL) + (fun n x1n rest => + @Bool.rec (fun _ => StateL) + StateL.bad + (popNList_fast rest (fun x2 rest1 => + StateL.rec StateL.bad + (fun y0 y1 rest' => + StateL.ok (Nat.add n 1) (Nat.add y0 2) (NList.cons (Nat.add y1 1) rest')) + (ih (Nat.sub x1n 3) x2 rest1))) + (Nat.ble 3 x1n)) + (fun n x1n rest => + popNList_fast rest (fun x2 rest1 => + StateL.ok n (Nat.add x1n 5) (NList.cons (Nat.add x2 2) rest1))) + (Nat.beq (Nat.land x0 1) 0) + n x1n rest + +theorem rec_step_comb_eq (ih : Nat → Nat → NList → StateL) : + rec_step_comb ih = rec_step_f 0 ih := by + funext x0 x1 rest + unfold rec_step_comb rec_step_f + cases Nat.beq (Nat.land x0 1) 0 <;> rfl + +noncomputable def step_rec_comb_fuel : Nat → Nat → Nat → NList → StateL := + @Nat.rec (fun _ => Nat → Nat → NList → StateL) + (fun _ _ _ => StateL.bad) + (fun _ ih => rec_step_comb ih) + +theorem step_rec_comb_eq (fuel : Nat) : + step_rec_comb_fuel fuel = step_rec_f_fuel fuel := by + induction fuel with + | zero => rfl + | succ f ih => + change rec_step_comb (step_rec_comb_fuel f) = rec_step_f f (step_rec_f_fuel f) + rw [ih] + exact rec_step_comb_eq (step_rec_f_fuel f) + +noncomputable def do_odd_comb (step_rec_f : Nat → Nat → NList → StateL) : ContL → ContL := + fun cont x0 x1 x2 rest1 => + let n := Nat.shiftRight x0 1 + let x1n := Nat.add x1 n + @Bool.rec (fun _ => StateL) + StateL.bad + (let u := Nat.sub x1n 3 + @Bool.rec (fun _ => ContL → Nat → Nat → Nat → NList → StateL) + (fun cont n u x2 rest1 => + StateL.rec StateL.bad + (fun y0 y1 rest' => cont n (Nat.add y0 2) (Nat.add y1 1) rest') + (step_rec_f u x2 rest1)) + (fun cont n u x2 rest1 => + popNList_fast rest1 (fun x3 rest2 => + let m := Nat.shiftRight u 1 + cont n (Nat.add m 2) (Nat.add (Nat.add x2 m) 6) (NList.cons (Nat.add x3 2) rest2))) + (Nat.beq (Nat.land u 1) 0) + cont n u x2 rest1) + (Nat.ble 3 x1n) + +theorem do_odd_comb_eq (step_rec_f : Nat → Nat → NList → StateL) : + do_odd_comb step_rec_f = do_odd_k_def popNList_fast step_rec_f := by + funext cont x0 x1 x2 rest1 + unfold do_odd_comb do_odd_k_def + dsimp only + cases Nat.ble 3 (Nat.add x1 (Nat.shiftRight x0 1)) <;> + cases Nat.beq (Nat.land (Nat.sub (Nat.add x1 (Nat.shiftRight x0 1)) 3) 1) 0 <;> rfl + +noncomputable def step1_comb_fuel (fuel : Nat) (do_odd_k : ContL → ContL) : ContL → ContL := + fun cont x0 => + @Bool.rec (fun _ => Nat → Nat → NList → StateL) + (do_odd_k cont x0) + (fun x1 x2 rest1 => + let h := Nat.add (Nat.shiftRight x0 1) 1 + @Bool.rec (fun _ => ContL → Nat → Nat → Nat → NList → StateL) + (fun c h x1 x2 rest1 => + let z := Nat.add x0 2 + ctz_run fuel + (fun t q => + @Bool.rec (fun _ => StateL) + StateL.bad + (@Bool.rec (fun _ => StateL) + (do_odd_k c (Nat.sub q 2) + (Nat.add (Nat.sub (Nat.add x1 z) q) (Nat.mul 4 t)) + (Nat.add x2 (Nat.mul 2 t)) + rest1) + (popNList_fast rest1 (fun x3 rest2 => + c + (Nat.sub (Nat.add (Nat.add x1 z) (Nat.mul 4 t)) 3) + (Nat.sub (Nat.add x2 (Nat.mul 2 t)) 1) + x3 rest2)) + (Nat.beq q 1)) + (Bool.and (Nat.beq z (Nat.shiftLeft q t)) (Bool.and (Nat.beq (Nat.land q 1) 1) (Nat.ble 1 t)))) 2 (Nat.shiftRight h 1)) + (@Bool.rec (fun _ => ContL → Nat → Nat → Nat → NList → StateL) + (fun c h x1 x2 rest1 => + do_odd_k c (Nat.sub h 2) (Nat.add (Nat.add x1 h) 4) (Nat.add x2 2) rest1) + (fun c _ x1 x2 rest1 => + popNList_fast rest1 (fun x3 rest2 => c (Nat.add x1 3) (Nat.add x2 1) x3 rest2)) + (Nat.beq h 1)) + (Nat.beq (Nat.land h 1) 1) + cont h x1 x2 rest1) + (Nat.beq (Nat.land x0 1) 0) + +theorem step1_comb_fuel_eq (fuel : Nat) (do_odd_k : ContL → ContL) : + step1_comb_fuel fuel do_odd_k = step1_k_fuel fuel popNList_fast do_odd_k := by + funext cont x0 x1 x2 rest1 + unfold step1_comb_fuel step1_k_fuel + dsimp only + cases Nat.beq (Nat.land x0 1) 0 with + | false => rfl + | true => + cases Nat.beq (Nat.land (Nat.add (Nat.shiftRight x0 1) 1) 1) 1 with + | false => rfl + | true => cases Nat.beq (Nat.add (Nat.shiftRight x0 1) 1) 1 <;> rfl + +theorem step1_comb_eq (do_odd_k : ContL → ContL) : + step1_comb_fuel 13 do_odd_k = step1_k_def popNList_fast do_odd_k := + step1_comb_fuel_eq 13 do_odd_k + +noncomputable def run_C_fast_comb_fuel (fuel_rec fuel k : Nat) : Nat → Nat → NList → StateL := + ((fun (popNList_f : NList → (Nat → NList → StateL) → StateL) => + ((fun (normState_f : StateL → StateL) => + ((fun (plain_finish : ContL) => + ((fun (rec_even_br : Nat → Nat → NList → StateL) => + ((fun (rec_odd_br : (Nat → Nat → NList → StateL) → Nat → Nat → NList → StateL) => + ((fun (step_rec_f : Nat → Nat → NList → StateL) => + ((fun (odd_even_br : ContL → Nat → Nat → Nat → NList → StateL) => + ((fun (odd_odd_br : ContL → Nat → Nat → Nat → NList → StateL) => + ((fun (do_odd_k : ContL → ContL) => + ((fun (ev_h1_one : ContL → Nat → Nat → NList → StateL) => + ((fun (ev_h1_gt1 : ContL → Nat → Nat → Nat → NList → StateL) => + ((fun (ev_ctz_q1 : ContL → Nat → Nat → Nat → Nat → NList → StateL) => + ((fun (ev_ctz_qgt1 : ContL → Nat → Nat → Nat → Nat → Nat → NList → StateL) => + ((fun (ev_h_even : ContL → Nat → Nat → Nat → Nat → NList → StateL) => + ((fun (ev_branch : ContL → ContL) => + ((fun (step1_k : ContL → ContL) => + ((fun (s2 : ContL → ContL) => + ((fun (s4 : ContL → ContL) => + ((fun (s8 : ContL → ContL) => + ((fun (leaf : Nat → Nat → NList → StateL) => + @Nat.rec (fun _ => Nat → Nat → NList → StateL) leaf + (fun j ih x0 x1 rest => + (@Bool.rec (fun _ => StateL → StateL) (fun s => s) normState_f (Nat.beq j 0)) + (StateL.rec StateL.bad ih (ih x0 x1 rest))) + k) + (fun x0 x1 rest => popNList_f rest (fun x2 rest1 => s8 (s8 plain_finish) x0 x1 x2 rest1)))) + (fun cont => s4 (s4 cont)))) + (fun cont => s2 (s2 cont)))) + (fun cont => step1_k (step1_k cont)))) + (fun cont x0 => + @Bool.rec (fun _ => Nat → Nat → NList → StateL) + (do_odd_k cont x0) + (ev_branch cont x0) + (Nat.beq (Nat.land x0 1) 0)))) + (fun cont x0 x1 x2 rest1 => + let h := Nat.add (Nat.shiftRight x0 1) 1 + @Bool.rec (fun _ => ContL → Nat → Nat → Nat → NList → StateL) + (fun c => ev_h_even c x0) + (@Bool.rec (fun _ => ContL → Nat → Nat → Nat → NList → StateL) + ev_h1_gt1 + (fun c _ => ev_h1_one c) + (Nat.beq h 1)) + (Nat.beq (Nat.land h 1) 1) + cont h x1 x2 rest1))) + (fun cont x0 h x1 x2 rest1 => + let z := Nat.add x0 2 + ctz_run fuel + (fun t q => + @Bool.rec (fun _ => StateL) + StateL.bad + (@Bool.rec (fun _ => StateL) + (ev_ctz_qgt1 cont x1 z q t x2 rest1) + (ev_ctz_q1 cont x1 z t x2 rest1) + (Nat.beq q 1)) + (Bool.and (Nat.beq z (Nat.shiftLeft q t)) (Bool.and (Nat.beq (Nat.land q 1) 1) (Nat.ble 1 t)))) 2 (Nat.shiftRight h 1)))) + (fun cont x1 z q t x2 rest1 => + do_odd_k cont (Nat.sub q 2) (Nat.add (Nat.sub (Nat.add x1 z) q) (Nat.mul 4 t)) (Nat.add x2 (Nat.mul 2 t)) rest1))) + (fun cont x1 z t x2 rest1 => + popNList_f rest1 (fun x3 rest2 => + cont (Nat.sub (Nat.add (Nat.add x1 z) (Nat.mul 4 t)) 3) (Nat.sub (Nat.add x2 (Nat.mul 2 t)) 1) x3 rest2)))) + (fun cont h x1 x2 rest1 => + do_odd_k cont (Nat.sub h 2) (Nat.add (Nat.add x1 h) 4) (Nat.add x2 2) rest1))) + (fun cont x1 x2 rest1 => + popNList_f rest1 (fun x3 rest2 => cont (Nat.add x1 3) (Nat.add x2 1) x3 rest2)))) + (fun cont x0 x1 x2 rest1 => + let n := Nat.shiftRight x0 1 + let x1n := Nat.add x1 n + @Bool.rec (fun _ => StateL) + StateL.bad + (let u := Nat.sub x1n 3 + @Bool.rec (fun _ => ContL → Nat → Nat → Nat → NList → StateL) + odd_odd_br + odd_even_br + (Nat.beq (Nat.land u 1) 0) + cont n u x2 rest1) + (Nat.ble 3 x1n)))) + (fun cont n u x2 rest1 => + StateL.rec StateL.bad + (fun y0 y1 rest' => cont n (Nat.add y0 2) (Nat.add y1 1) rest') + (step_rec_f u x2 rest1)))) + (fun cont n u x2 rest1 => + popNList_f rest1 (fun x3 rest2 => + let m := Nat.shiftRight u 1 + cont n (Nat.add m 2) (Nat.add (Nat.add x2 m) 6) (NList.cons (Nat.add x3 2) rest2))))) + (@Nat.rec (fun _ => Nat → Nat → NList → StateL) + (fun _ _ _ => StateL.bad) + (fun _ ih x0 x1 rest => + let n := Nat.shiftRight x0 1 + let x1n := Nat.add x1 n + @Bool.rec (fun _ => Nat → Nat → NList → StateL) + (rec_odd_br ih) + rec_even_br + (Nat.beq (Nat.land x0 1) 0) + n x1n rest) + fuel_rec))) + (fun ih n x1n rest => + @Bool.rec (fun _ => StateL) + StateL.bad + (popNList_f rest (fun x2 rest1 => + StateL.rec StateL.bad + (fun y0 y1 rest' => + StateL.ok (Nat.add n 1) (Nat.add y0 2) (NList.cons (Nat.add y1 1) rest')) + (ih (Nat.sub x1n 3) x2 rest1))) + (Nat.ble 3 x1n)))) + (fun n x1n rest => + popNList_f rest (fun x2 rest1 => + StateL.ok n (Nat.add x1n 5) (NList.cons (Nat.add x2 2) rest1))))) + (fun v0 v1 v2 tail => StateL.ok v0 v1 (NList.cons v2 tail)))) + normStateL)) + popNList_fast) + +noncomputable def run_C_fast_comb (k : Nat) : Nat → Nat → NList → StateL := + run_C_fast_comb_fuel 20 13 k + +noncomputable def run_tail13_comb_fuel (fuel_rec fuel : Nat) : Nat → Nat → NList → StateL := + ((fun (popNList_f : NList → (Nat → NList → StateL) → StateL) => + ((fun (plain_finish : ContL) => + ((fun (rec_even_br : Nat → Nat → NList → StateL) => + ((fun (rec_odd_br : (Nat → Nat → NList → StateL) → Nat → Nat → NList → StateL) => + ((fun (step_rec_f : Nat → Nat → NList → StateL) => + ((fun (odd_even_br : ContL → Nat → Nat → Nat → NList → StateL) => + ((fun (odd_odd_br : ContL → Nat → Nat → Nat → NList → StateL) => + ((fun (do_odd_k : ContL → ContL) => + ((fun (ev_h1_one : ContL → Nat → Nat → NList → StateL) => + ((fun (ev_h1_gt1 : ContL → Nat → Nat → Nat → NList → StateL) => + ((fun (ev_ctz_q1 : ContL → Nat → Nat → Nat → Nat → NList → StateL) => + ((fun (ev_ctz_qgt1 : ContL → Nat → Nat → Nat → Nat → Nat → NList → StateL) => + ((fun (ev_h_even : ContL → Nat → Nat → Nat → Nat → NList → StateL) => + ((fun (ev_branch : ContL → ContL) => + ((fun (step1_k : ContL → ContL) => + ((fun (s2 : ContL → ContL) => + ((fun (s4 : ContL → ContL) => + ((fun (s8 : ContL → ContL) => + fun x0 x1 rest => popNList_f rest (fun x2 rest1 => s8 (s4 (step1_k plain_finish)) x0 x1 x2 rest1)) + (fun cont => s4 (s4 cont)))) + (fun cont => s2 (s2 cont)))) + (fun cont => step1_k (step1_k cont)))) + (fun cont x0 => + @Bool.rec (fun _ => Nat → Nat → NList → StateL) + (do_odd_k cont x0) + (ev_branch cont x0) + (Nat.beq (Nat.land x0 1) 0)))) + (fun cont x0 x1 x2 rest1 => + let h := Nat.add (Nat.shiftRight x0 1) 1 + @Bool.rec (fun _ => ContL → Nat → Nat → Nat → NList → StateL) + (fun c => ev_h_even c x0) + (@Bool.rec (fun _ => ContL → Nat → Nat → Nat → NList → StateL) + ev_h1_gt1 + (fun c _ => ev_h1_one c) + (Nat.beq h 1)) + (Nat.beq (Nat.land h 1) 1) + cont h x1 x2 rest1))) + (fun cont x0 h x1 x2 rest1 => + let z := Nat.add x0 2 + ctz_run fuel + (fun t q => + @Bool.rec (fun _ => StateL) + StateL.bad + (@Bool.rec (fun _ => StateL) + (ev_ctz_qgt1 cont x1 z q t x2 rest1) + (ev_ctz_q1 cont x1 z t x2 rest1) + (Nat.beq q 1)) + (Bool.and (Nat.beq z (Nat.shiftLeft q t)) (Bool.and (Nat.beq (Nat.land q 1) 1) (Nat.ble 1 t)))) 2 (Nat.shiftRight h 1)))) + (fun cont x1 z q t x2 rest1 => + do_odd_k cont (Nat.sub q 2) (Nat.add (Nat.sub (Nat.add x1 z) q) (Nat.mul 4 t)) (Nat.add x2 (Nat.mul 2 t)) rest1))) + (fun cont x1 z t x2 rest1 => + popNList_f rest1 (fun x3 rest2 => + cont (Nat.sub (Nat.add (Nat.add x1 z) (Nat.mul 4 t)) 3) (Nat.sub (Nat.add x2 (Nat.mul 2 t)) 1) x3 rest2)))) + (fun cont h x1 x2 rest1 => + do_odd_k cont (Nat.sub h 2) (Nat.add (Nat.add x1 h) 4) (Nat.add x2 2) rest1))) + (fun cont x1 x2 rest1 => + popNList_f rest1 (fun x3 rest2 => cont (Nat.add x1 3) (Nat.add x2 1) x3 rest2)))) + (fun cont x0 x1 x2 rest1 => + let n := Nat.shiftRight x0 1 + let x1n := Nat.add x1 n + @Bool.rec (fun _ => StateL) + StateL.bad + (let u := Nat.sub x1n 3 + @Bool.rec (fun _ => ContL → Nat → Nat → Nat → NList → StateL) + odd_odd_br + odd_even_br + (Nat.beq (Nat.land u 1) 0) + cont n u x2 rest1) + (Nat.ble 3 x1n)))) + (fun cont n u x2 rest1 => + StateL.rec StateL.bad + (fun y0 y1 rest' => cont n (Nat.add y0 2) (Nat.add y1 1) rest') + (step_rec_f u x2 rest1)))) + (fun cont n u x2 rest1 => + popNList_f rest1 (fun x3 rest2 => + let m := Nat.shiftRight u 1 + cont n (Nat.add m 2) (Nat.add (Nat.add x2 m) 6) (NList.cons (Nat.add x3 2) rest2))))) + (@Nat.rec (fun _ => Nat → Nat → NList → StateL) + (fun _ _ _ => StateL.bad) + (fun _ ih x0 x1 rest => + let n := Nat.shiftRight x0 1 + let x1n := Nat.add x1 n + @Bool.rec (fun _ => Nat → Nat → NList → StateL) + (rec_odd_br ih) + rec_even_br + (Nat.beq (Nat.land x0 1) 0) + n x1n rest) + fuel_rec))) + (fun ih n x1n rest => + @Bool.rec (fun _ => StateL) + StateL.bad + (popNList_f rest (fun x2 rest1 => + StateL.rec StateL.bad + (fun y0 y1 rest' => + StateL.ok (Nat.add n 1) (Nat.add y0 2) (NList.cons (Nat.add y1 1) rest')) + (ih (Nat.sub x1n 3) x2 rest1))) + (Nat.ble 3 x1n)))) + (fun n x1n rest => + popNList_f rest (fun x2 rest1 => + StateL.ok n (Nat.add x1n 5) (NList.cons (Nat.add x2 2) rest1))))) + (fun v0 v1 v2 tail => StateL.ok v0 v1 (NList.cons v2 tail)))) + popNList_fast) + +noncomputable def run_tail13_comb : Nat → Nat → NList → StateL := + run_tail13_comb_fuel 20 13 + +noncomputable def run_comb_wrap (step_rec_f : Nat → Nat → NList → StateL) + (do_odd_f : (Nat → Nat → NList → StateL) → ContL → ContL) + (step1_f : (ContL → ContL) → ContL → ContL) + (s2_f : (ContL → ContL) → ContL → ContL) + (k : Nat) : Nat → Nat → NList → StateL := + let do_odd_k := do_odd_f step_rec_f + let step1_k := step1_f do_odd_k + let s2 : ContL → ContL := s2_f step1_k + let s4 : ContL → ContL := s2_f s2 + let s8 : ContL → ContL := s2_f s4 + let leaf : Nat → Nat → NList → StateL := + fun x0 x1 rest => popNList_fast rest (fun x2 rest1 => s2_f s8 plain_finish_def x0 x1 x2 rest1) + @Nat.rec (fun _ => Nat → Nat → NList → StateL) leaf + (fun j ih x0 x1 rest => + (@Bool.rec (fun _ => StateL → StateL) (fun s => s) normStateL (Nat.beq j 0)) + (StateL.rec StateL.bad ih (ih x0 x1 rest))) + k + +theorem run_C_fast_comb_fuel_eq (fuel_rec fuel k : Nat) : + run_C_fast_comb_fuel fuel_rec fuel k = run_C_fast_fuel fuel_rec fuel k := by + have h1 : run_C_fast_comb_fuel fuel_rec fuel k = run_comb_wrap (step_rec_comb_fuel fuel_rec) do_odd_comb (step1_comb_fuel fuel) (fun F cont => F (F cont)) k := rfl + have h2 : run_C_fast_fuel fuel_rec fuel k = run_comb_wrap (step_rec_f_fuel fuel_rec) (do_odd_k_def popNList_fast) (step1_k_fuel fuel popNList_fast) apply2 k := rfl + rw [h1, h2, step_rec_comb_eq fuel_rec] + have hd : do_odd_comb = do_odd_k_def popNList_fast := funext do_odd_comb_eq + have hs : step1_comb_fuel fuel = step1_k_fuel fuel popNList_fast := funext (step1_comb_fuel_eq fuel) + have ha : (fun (F : ContL → ContL) cont => F (F cont)) = apply2 := rfl + rw [hd, hs, ha] + +theorem run_C_fast_comb_eq (k : Nat) : run_C_fast_comb k = run_C_fast k := + run_C_fast_comb_fuel_eq 20 13 k + +noncomputable def run_tail13_wrap (step_rec_f : Nat → Nat → NList → StateL) + (do_odd_f : (Nat → Nat → NList → StateL) → ContL → ContL) + (step1_f : (ContL → ContL) → ContL → ContL) + (s2_f : (ContL → ContL) → ContL → ContL) + (comp_f : (ContL → ContL) → (ContL → ContL) → ContL → ContL) : Nat → Nat → NList → StateL := + let do_odd_k := do_odd_f step_rec_f + let step1_k := step1_f do_odd_k + let s2 : ContL → ContL := s2_f step1_k + let s4 : ContL → ContL := s2_f s2 + let s8 : ContL → ContL := s2_f s4 + fun x0 x1 rest => popNList_fast rest (fun x2 rest1 => comp_f s8 (comp_f s4 step1_k) plain_finish_def x0 x1 x2 rest1) + +theorem run_tail13_comb_fuel_eq (fuel_rec fuel : Nat) : + run_tail13_comb_fuel fuel_rec fuel = run_tail13_fuel fuel_rec fuel := by + have h1 : run_tail13_comb_fuel fuel_rec fuel = run_tail13_wrap (step_rec_comb_fuel fuel_rec) do_odd_comb (step1_comb_fuel fuel) (fun F cont => F (F cont)) (fun F G cont => F (G cont)) := rfl + have h2 : run_tail13_fuel fuel_rec fuel = run_tail13_wrap (step_rec_f_fuel fuel_rec) (do_odd_k_def popNList_fast) (step1_k_fuel fuel popNList_fast) apply2 compCPS := rfl + rw [h1, h2, step_rec_comb_eq fuel_rec] + have hd : do_odd_comb = do_odd_k_def popNList_fast := funext do_odd_comb_eq + have hs : step1_comb_fuel fuel = step1_k_fuel fuel popNList_fast := funext (step1_comb_fuel_eq fuel) + have ha : (fun (F : ContL → ContL) cont => F (F cont)) = apply2 := rfl + have hc : (fun (F G : ContL → ContL) cont => F (G cont)) = compCPS := rfl + rw [hd, hs, ha, hc] + +theorem run_tail13_comb_eq : run_tail13_comb = run_tail13 := + run_tail13_comb_fuel_eq 20 13 + +noncomputable def run_rem_fast_comb (x0 x1 : Nat) (rest : NList) : StateL := + let s := run_C_fast_comb 11 x0 x1 rest + let s := StateL.rec StateL.bad (run_C_fast_comb 10) s + let s := StateL.rec StateL.bad (run_C_fast_comb 8) s + let s := StateL.rec StateL.bad (run_C_fast_comb 7) s + let s := StateL.rec StateL.bad (run_C_fast_comb 6) s + let s := StateL.rec StateL.bad (run_C_fast_comb 5) s + let s := StateL.rec StateL.bad (run_C_fast_comb 4) s + let s := StateL.rec StateL.bad (run_C_fast_comb 0) s + StateL.rec StateL.bad run_tail13_comb s + +theorem run_rem_fast_comb_eq : run_rem_fast_comb = run_rem_fast := by + funext x0 x1 rest + unfold run_rem_fast_comb run_rem_fast + simp only [run_C_fast_comb_eq, run_tail13_comb_eq] + +theorem chain_C_comb {x0 x1 y0 y1 : Nat} {rest rest' : NList} + (h_step : checkStateL (run_C_fast_comb 12 x0 x1 rest) y0 y1 rest' = true) + (h_next : IsHaltFrom (S (y0 :: y1 :: denote_list rest') 0 2 [])) : + IsHaltFrom (S (x0 :: x1 :: denote_list rest) 0 2 []) := by + rw [run_C_fast_comb_eq 12] at h_step + exact chain_C_fast h_step h_next + +theorem chain_rem_comb {x0 x1 y0 y1 : Nat} {rest rest' : NList} + (h_step : checkStateL (run_rem_fast_comb x0 x1 rest) y0 y1 rest' = true) + (h_next : IsHaltFrom (S (y0 :: y1 :: denote_list rest') 0 2 [])) : + IsHaltFrom (S (x0 :: x1 :: denote_list rest) 0 2 []) := by + rw [run_rem_fast_comb_eq] at h_step + exact chain_rem_fast h_step h_next + +abbrev st0_l : NList := NList.cons 1 NList.nil + +abbrev c0_x0 : Nat := 2 +abbrev c0_x1 : Nat := 5 +abbrev c0_rest : NList := (NList.cons 8 (NList.cons 2 NList.nil)) +abbrev c0_l : NList := NList.cons c0_x0 (NList.cons c0_x1 c0_rest) + +abbrev c1_x0 : Nat := 92 +abbrev c1_x1 : Nat := 2404 +abbrev c1_rest : NList := (NList.cons 30819 (NList.cons 169721 (NList.cons 421294 (NList.cons 24741 (NList.cons 24740 (NList.cons 2 NList.nil)))))) + +abbrev c2_x0 : Nat := 37 +abbrev c2_x1 : Nat := 25995 +abbrev c2_rest : NList := (NList.cons 224964 (NList.cons 224151 (NList.cons 275785 (NList.cons 301606 (NList.cons 301611 (NList.cons 2 NList.nil)))))) + +abbrev c3_x0 : Nat := 3913 +abbrev c3_x1 : Nat := 127277 +abbrev c3_rest : NList := (NList.cons 691798 (NList.cons 609442 (NList.cons 609447 (NList.cons 2 NList.nil)))) + +abbrev c4_x0 : Nat := 21 +abbrev c4_x1 : Nat := 7551 +abbrev c4_rest : NList := (NList.cons 88180 (NList.cons 1008051 (NList.cons 811801 (NList.cons 405900 (NList.cons 405903 (NList.cons 2 NList.nil)))))) + +abbrev c5_x0 : Nat := 595 +abbrev c5_x1 : Nat := 15419 +abbrev c5_rest : NList := (NList.cons 103581 (NList.cons 1283779 (NList.cons 846047 (NList.cons 502393 (NList.cons 330569 (NList.cons 330574 (NList.cons 2 NList.nil))))))) + +abbrev c6_x0 : Nat := 423 +abbrev c6_x1 : Nat := 169488 +abbrev c6_rest : NList := (NList.cons 1036044 (NList.cons 1614596 (NList.cons 1011586 (NList.cons 134856 (NList.cons 67427 (NList.cons 33713 (NList.cons 33716 (NList.cons 2 NList.nil)))))))) + +abbrev c7_x0 : Nat := 58 +abbrev c7_x1 : Nat := 31646 +abbrev c7_rest : NList := (NList.cons 485369 (NList.cons 2378055 (NList.cons 946344 (NList.cons 946345 (NList.cons 2 NList.nil))))) + +abbrev c8_x0 : Nat := 375 +abbrev c8_x1 : Nat := 41379 +abbrev c8_rest : NList := (NList.cons 606043 (NList.cons 4829972 (NList.cons 8 NList.nil))) + +abbrev c9_x0 : Nat := 3234 +abbrev c9_x1 : Nat := 115455 +abbrev c9_rest : NList := (NList.cons 1542883 (NList.cons 2142766 (NList.cons 2255004 (NList.cons 56119 (NList.cons 56120 (NList.cons 2 NList.nil)))))) + +abbrev c10_x0 : Nat := 77 +abbrev c10_x1 : Nat := 2421 +abbrev c10_rest : NList := (NList.cons 74793 (NList.cons 1546693 (NList.cons 2620621 (NList.cons 2620628 (NList.cons 2 NList.nil))))) + +abbrev c11_x0 : Nat := 40556 +abbrev c11_x1 : Nat := 1525633 +abbrev c11_rest : NList := (NList.cons 2951211 (NList.cons 1475607 (NList.cons 1475610 (NList.cons 2 NList.nil)))) +abbrev c11_l : NList := NList.cons c11_x0 (NList.cons c11_x1 c11_rest) + +macro "fast_rfl" : tactic => `(tactic| decide +kernel) + +theorem step_init : run_pow 3 st0_l 1 1 NList.nil = StepRes.running c0_l 0 2 NList.nil := by fast_rfl +theorem step_c0 : checkStateL (run_C_fast_comb 12 c0_x0 c0_x1 c0_rest) c1_x0 c1_x1 c1_rest = true := by fast_rfl +theorem step_c1 : checkStateL (run_C_fast_comb 12 c1_x0 c1_x1 c1_rest) c2_x0 c2_x1 c2_rest = true := by fast_rfl +theorem step_c2 : checkStateL (run_C_fast_comb 12 c2_x0 c2_x1 c2_rest) c3_x0 c3_x1 c3_rest = true := by fast_rfl +theorem step_c3 : checkStateL (run_C_fast_comb 12 c3_x0 c3_x1 c3_rest) c4_x0 c4_x1 c4_rest = true := by fast_rfl +theorem step_c4 : checkStateL (run_C_fast_comb 12 c4_x0 c4_x1 c4_rest) c5_x0 c5_x1 c5_rest = true := by fast_rfl +theorem step_c5 : checkStateL (run_C_fast_comb 12 c5_x0 c5_x1 c5_rest) c6_x0 c6_x1 c6_rest = true := by fast_rfl +theorem step_c6 : checkStateL (run_C_fast_comb 12 c6_x0 c6_x1 c6_rest) c7_x0 c7_x1 c7_rest = true := by fast_rfl +theorem step_c7 : checkStateL (run_C_fast_comb 12 c7_x0 c7_x1 c7_rest) c8_x0 c8_x1 c8_rest = true := by fast_rfl +theorem step_c8 : checkStateL (run_C_fast_comb 12 c8_x0 c8_x1 c8_rest) c9_x0 c9_x1 c9_rest = true := by fast_rfl +theorem step_c9 : checkStateL (run_C_fast_comb 12 c9_x0 c9_x1 c9_rest) c10_x0 c10_x1 c10_rest = true := by fast_rfl +theorem step_c10 : checkStateL (run_rem_fast_comb c10_x0 c10_x1 c10_rest) c11_x0 c11_x1 c11_rest = true := by fast_rfl +theorem step_exit : run_pow 5 c11_l 0 2 NList.nil = StepRes.halted := by fast_rfl + +theorem halt_c11 : IsHaltFrom (S (c11_x0 :: c11_x1 :: denote_list c11_rest) 0 2 []) := by + simpa [c11_l, denote_list] using! finish_pow 5 step_exit +theorem halt_c10 : IsHaltFrom (S (c10_x0 :: c10_x1 :: denote_list c10_rest) 0 2 []) := chain_rem_comb step_c10 halt_c11 +theorem halt_c9 : IsHaltFrom (S (c9_x0 :: c9_x1 :: denote_list c9_rest) 0 2 []) := chain_C_comb step_c9 halt_c10 +theorem halt_c8 : IsHaltFrom (S (c8_x0 :: c8_x1 :: denote_list c8_rest) 0 2 []) := chain_C_comb step_c8 halt_c9 +theorem halt_c7 : IsHaltFrom (S (c7_x0 :: c7_x1 :: denote_list c7_rest) 0 2 []) := chain_C_comb step_c7 halt_c8 +theorem halt_c6 : IsHaltFrom (S (c6_x0 :: c6_x1 :: denote_list c6_rest) 0 2 []) := chain_C_comb step_c6 halt_c7 +theorem halt_c5 : IsHaltFrom (S (c5_x0 :: c5_x1 :: denote_list c5_rest) 0 2 []) := chain_C_comb step_c5 halt_c6 +theorem halt_c4 : IsHaltFrom (S (c4_x0 :: c4_x1 :: denote_list c4_rest) 0 2 []) := chain_C_comb step_c4 halt_c5 +theorem halt_c3 : IsHaltFrom (S (c3_x0 :: c3_x1 :: denote_list c3_rest) 0 2 []) := chain_C_comb step_c3 halt_c4 +theorem halt_c2 : IsHaltFrom (S (c2_x0 :: c2_x1 :: denote_list c2_rest) 0 2 []) := chain_C_comb step_c2 halt_c3 +theorem halt_c1 : IsHaltFrom (S (c1_x0 :: c1_x1 :: denote_list c1_rest) 0 2 []) := chain_C_comb step_c1 halt_c2 +theorem halt_c0 : IsHaltFrom (S (c0_x0 :: c0_x1 :: denote_list c0_rest) 0 2 []) := chain_C_comb step_c0 halt_c1 + +theorem halt_0 : IsHaltFrom (S (denote_list st0_l) 1 1 (denote_list NList.nil)) := by + refine chain_pow 3 step_init ?_ + simpa [c0_l, denote_list] using! halt_c0 + +end + +end + + + +theorem is_halt : IsHalt target := by + exact halt_from_trans init_to_S halt_0 + +end BusyBeaver.M_1RB0RB_1RC0RD_1LD1RC_1RF0LE_1LC1LE_HHH0RA diff --git a/BusyBeaver/BB6/Halt/M_1RB0RC_1LC1RF_1RA1LD_1RD0LE_1LD1LC_0REHHH.lean b/BusyBeaver/BB6/Halt/M_1RB0RC_1LC1RF_1RA1LD_1RD0LE_1LD1LC_0REHHH.lean new file mode 100644 index 00000000..37ffcfad --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB0RC_1LC1RF_1RA1LD_1RD0LE_1LD1LC_0REHHH.lean @@ -0,0 +1,2288 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RC_1LC1RF_1RA1LD_1RD0LE_1LD1LC_0REHHH + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RC_1LC1RF_1RA1LD_1RD0LE_1LD1LC_0REHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +variable {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +abbrev holdout_0451_tm : Machine (Fin 2) (Fin 6) := target_tm +-- ============================================================================ +-- Section 6: Direct-on-Cells (k, xs) Sk1 / TM91 Formalization +-- ============================================================================ + +set_option linter.unusedSectionVars false + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : + multiStep M config 0 = some config := rfl + +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : + multiStep M config 1 = step M config := rfl + +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem reaches_refl {M : Machine Γ Λ} (c : Cfg Γ Λ) : c [M]⊢* c := ⟨0, rfl⟩ + +theorem reaches_trans {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [M]⊢* c₂) (h₂ : c₂ [M]⊢* c₃) : c₁ [M]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans M c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +def IsHaltFrom (c : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ c', (c [holdout_0451_tm]⊢* c') ∧ (step holdout_0451_tm c').isNone + +theorem isHaltFrom_of_reaches {c₁ c₂ : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [holdout_0451_tm]⊢* c₂) (h₂ : IsHaltFrom c₂) : IsHaltFrom c₁ := by + rcases h₂ with ⟨c', hc', hnone⟩ + exact ⟨c', reaches_trans h₁ hc', hnone⟩ + +@[simp] theorem zero_cons_default : (0 : Fin 2) >> (default : ListBlank (Fin 2)) = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl + +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +@[simp] theorem append_nil_tape (s : ListBlank Γ) : ([] : List Γ) +> s = s := rfl + +@[simp] theorem append_cons_tape (a : Γ) (l : List Γ) (s : ListBlank Γ) : + (a :: l) +> s = a >> (l +> s) := rfl + +@[simp] theorem append_assoc_tape (l₁ l₂ : List Γ) (s : ListBlank Γ) : + (l₁ ++ l₂) +> s = l₁ +> (l₂ +> s) := by + induction l₁ with + | nil => rfl + | cons a l₁ ih => simp only [List.cons_append, append_cons_tape, ih] + +theorem pow_add_list (w : List Γ) (m n : ℕ) : w ^ (m + n) = w ^ m ++ w ^ n := by + induction m with + | zero => + rw [Nat.zero_add] + rfl + | succ m ih => + rw [Nat.succ_add] + change w ++ (w ^ (m + n)) = (w ++ (w ^ m)) ++ w ^ n + rw [ih, List.append_assoc] + +theorem pow_append_tape (w : List Γ) (m n : ℕ) (s : ListBlank Γ) : + (w ^ (m + n)) +> s = (w ^ m) +> ((w ^ n) +> s) := by + rw [pow_add_list, append_assoc_tape] + +local macro "finish" : tactic => + `(tactic| exists 0 <;> rfl) +local macro "step_tm" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail]) +local macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step_tm))) + +def W : List (Fin 2) := [0, 1] +def bval (p : Bool) : ℕ := if p then 1 else 0 +def bit (p : Bool) : List (Fin 2) := if p then [0] else [1] + +def first_cell : List (Bool × ℕ) → Bool + | [] => false + | (p, _) :: _ => p + +def words_tape : List (Bool × ℕ) → ListBlank (Fin 2) + | [] => default + | (p, n) :: xs => (bit p) +> ((W ^ n) +> words_tape xs) + +def start (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + (([0] : List (Fin 2)) +> default) {{C}}> r + +def denote_state (k : ℕ) (xs : List (Bool × ℕ)) : Cfg (Fin 2) (Fin 6) := + start ((W ^ k) +> words_tape xs) + +def retState (b : Bool) : Fin 6 := if b then D else C + +def Side (b : Bool) (r r' : ListBlank (Fin 2)) : Prop := + ∀ l : ListBlank (Fin 2), + ((([0] : List (Fin 2)) +> l) {{C}}> r) [holdout_0451_tm]⊢* + (l <{{retState b}} (([1] : List (Fin 2)) +> r')) + +def SideHalt (r : ListBlank (Fin 2)) : Prop := + ∀ l : ListBlank (Fin 2), + IsHaltFrom ((([0] : List (Fin 2)) +> l) {{C}}> r) + +-- Micro-step primitives proved via execute +theorem wall_R (l r : ListBlank (Fin 2)) : + ((([0] : List (Fin 2)) +> l) {{C}}> ([0, 1] +> r)) [holdout_0451_tm]⊢* + ((([0] : List (Fin 2)) +> (([1, 0] : List (Fin 2)) +> l)) {{C}}> r) := by + dsimp [ListBlank.append]; execute + +theorem wall_L_C (l r : ListBlank (Fin 2)) : + ((([1, 0] : List (Fin 2)) +> l) <{{C}} ([1] +> r)) [holdout_0451_tm]⊢* + (l <{{C}} (([1] : List (Fin 2)) +> (W +> r))) := by + dsimp [W, ListBlank.append]; execute + +theorem wall_L_D (l r : ListBlank (Fin 2)) : + ((([1, 0] : List (Fin 2)) +> l) <{{D}} ([1] +> r)) [holdout_0451_tm]⊢* + (l <{{D}} (([1] : List (Fin 2)) +> (W +> r))) := by + dsimp [W, ListBlank.append]; execute + +theorem inc_step (l r : ListBlank (Fin 2)) : + ((([0] : List (Fin 2)) +> l) {{C}}> ([1] +> r)) [holdout_0451_tm]⊢* + (l <{{C}} (([1] : List (Fin 2)) +> ([0] +> r))) := by + dsimp [ListBlank.append]; execute + +theorem carry_R (l r : ListBlank (Fin 2)) : + ((([0] : List (Fin 2)) +> l) {{C}}> ([0, 0, 1, 0, 1] +> r)) [holdout_0451_tm]⊢* + ((([0] : List (Fin 2)) +> (([1, 1, 1, 1, 0] : List (Fin 2)) +> l)) {{C}}> r) := by + dsimp [ListBlank.append]; execute + +theorem carry_L_C (l r : ListBlank (Fin 2)) : + ((([1, 1, 1, 1, 0] : List (Fin 2)) +> l) <{{C}} ([1] +> r)) [holdout_0451_tm]⊢* + (l <{{C}} (([1] : List (Fin 2)) +> ([0, 1, 0, 1, 1] +> r))) := by + dsimp [ListBlank.append]; execute + +theorem carry_L_D (l r : ListBlank (Fin 2)) : + ((([1, 1, 1, 1, 0] : List (Fin 2)) +> l) <{{D}} ([1] +> r)) [holdout_0451_tm]⊢* + (l <{{D}} (([1] : List (Fin 2)) +> ([0, 1, 1, 0, 1] +> r))) := by + dsimp [ListBlank.append]; execute + +theorem leaf0_step (l r : ListBlank (Fin 2)) : + ((([0] : List (Fin 2)) +> l) {{C}}> ([0, 0, 0] +> r)) [holdout_0451_tm]⊢* + (l <{{D}} (([1] : List (Fin 2)) +> ([0, 1, 1] +> r))) := by + dsimp [ListBlank.append]; execute + +theorem leaf1_step (l r : ListBlank (Fin 2)) : + ((([0] : List (Fin 2)) +> l) {{C}}> ([0, 0, 1, 0, 0] +> r)) [holdout_0451_tm]⊢* + (l <{{D}} (([1] : List (Fin 2)) +> ([1, 0, 1, 0, 0] +> r))) := by + dsimp [ListBlank.append]; execute + +theorem stop_step (l r : ListBlank (Fin 2)) : + ((([0] : List (Fin 2)) +> l) {{C}}> ([0, 0, 1, 1] +> r)) [holdout_0451_tm]⊢* + ((([1, 1, 1, 0] : List (Fin 2)) +> l) {{F}}> ([1] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem stop_isNone (l r : ListBlank (Fin 2)) : + (step holdout_0451_tm ((([1, 1, 1, 0] : List (Fin 2)) +> l) {{F}}> ([1] +> r))).isNone = true := by + simp [step, holdout_0451_tm, target_tm, F, ListBlank.append, Turing.ListBlank.head_cons]; rfl + +theorem emit_true_step (r : ListBlank (Fin 2)) : + ((default : ListBlank (Fin 2)) <{{D}} ([1] +> r)) [holdout_0451_tm]⊢* + (start ([0, 1, 0] +> r)) := by + unfold start + dsimp [ListBlank.append] + execute + +-- Segment & Side composition lemmas +theorem wall_one_side (b : Bool) {r r' : ListBlank (Fin 2)} (h : Side b r r') : + Side b (W +> r) (W +> r') := by + intro l + have h1 := wall_R l r + have h2 := h (([1, 0] : List (Fin 2)) +> l) + have h3 : ((([1, 0] : List (Fin 2)) +> l) <{{retState b}} ([1] +> r')) [holdout_0451_tm]⊢* + (l <{{retState b}} ([1] +> (W +> r'))) := by + cases b + · exact wall_L_C l r' + · exact wall_L_D l r' + exact reaches_trans h1 (reaches_trans h2 h3) + +theorem wall_side (b : Bool) (n : ℕ) {r r' : ListBlank (Fin 2)} (h : Side b r r') : + Side b ((W ^ n) +> r) ((W ^ n) +> r') := by + induction n with + | zero => exact h + | succ n ih => + change Side b ((W ++ (W ^ n)) +> r) ((W ++ (W ^ n)) +> r') + rw [append_assoc_tape, append_assoc_tape] + exact wall_one_side b ih + +theorem wall_one_halt {r : ListBlank (Fin 2)} (h : SideHalt r) : + SideHalt (W +> r) := by + intro l + exact isHaltFrom_of_reaches (wall_R l r) (h (([1, 0] : List (Fin 2)) +> l)) + +theorem wall_halt (n : ℕ) {r : ListBlank (Fin 2)} (h : SideHalt r) : + SideHalt ((W ^ n) +> r) := by + induction n with + | zero => exact h + | succ n ih => + change SideHalt ((W ++ (W ^ n)) +> r) + rw [append_assoc_tape] + exact wall_one_halt ih + +theorem carry_side (b : Bool) {r r' : ListBlank (Fin 2)} (h : Side b r r') : + Side b ([0, 0, 1, 0, 1] +> r) + ((if b then [0, 1, 1, 0, 1] else [0, 1, 0, 1, 1]) +> r') := by + intro l + have h1 := carry_R l r + have h2 := h (([1, 1, 1, 1, 0] : List (Fin 2)) +> l) + have h3 : ((([1, 1, 1, 1, 0] : List (Fin 2)) +> l) <{{retState b}} ([1] +> r')) [holdout_0451_tm]⊢* + (l <{{retState b}} ([1] +> ((if b then [0, 1, 1, 0, 1] else [0, 1, 0, 1, 1]) +> r'))) := by + cases b + · exact carry_L_C l r' + · exact carry_L_D l r' + exact reaches_trans h1 (reaches_trans h2 h3) + +theorem carry_halt {r : ListBlank (Fin 2)} (h : SideHalt r) : + SideHalt ([0, 0, 1, 0, 1] +> r) := by + intro l + exact isHaltFrom_of_reaches (carry_R l r) (h (([1, 1, 1, 1, 0] : List (Fin 2)) +> l)) + +theorem inc_side (r : ListBlank (Fin 2)) : Side false ([1] +> r) ([0] +> r) := by + intro l + exact inc_step l r + +theorem leaf0_side (r : ListBlank (Fin 2)) : Side true ([0, 0, 0] +> r) ([0, 1, 1] +> r) := by + intro l + exact leaf0_step l r + +theorem leaf1_side (r : ListBlank (Fin 2)) : + Side true ([0, 0, 1, 0, 0] +> r) ([1, 0, 1, 0, 0] +> r) := by + intro l + exact leaf1_step l r + +theorem stop_halt (r : ListBlank (Fin 2)) : SideHalt ([0, 0, 1, 1] +> r) := by + intro l + exact ⟨(([1, 1, 1, 0] : List (Fin 2)) +> l) {{F}}> ([1] +> r), + stop_step l r, stop_isNone l r⟩ + +theorem default_eq_zero_one : + (default : ListBlank (Fin 2)) = ([0] : List (Fin 2)) +> default := by + simp [zero_cons_default] + +theorem default_eq_zero_three : + (default : ListBlank (Fin 2)) = ([0, 0, 0] : List (Fin 2)) +> default := by + simp [zero_cons_default] + +theorem emit_side (b : Bool) {r r' : ListBlank (Fin 2)} (h : Side b r r') : + (start r) [holdout_0451_tm]⊢* (start ((if b then [0, 1, 0] else W) +> r')) := by + have h1 : (start r) [holdout_0451_tm]⊢* + ((default : ListBlank (Fin 2)) <{{retState b}} ([1] +> r')) := h default + cases b + · simp only [Bool.false_eq_true, ↓reduceIte, retState] at h1 ⊢ + have h2 : ((default : ListBlank (Fin 2)) <{{C}} ([1] +> r')) = start (W +> r') := by + unfold start W + simp only [append_cons_tape, append_nil_tape, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons, default_head, default_tail, zero_cons_default] + rw [← h2] + exact h1 + · simp only [↓reduceIte, retState] at h1 ⊢ + exact reaches_trans h1 (emit_true_step r') + +theorem init_reaches_start : + (init [] : Cfg (Fin 2) (Fin 6)) [holdout_0451_tm]⊢* (denote_state 2 []) := by + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = ((default : ListBlank (Fin 2)) {{A}}> default) := rfl + rw [h0] + unfold denote_state start words_tape W + dsimp [ListBlank.append] + execute + +-- ============================================================================ +-- Section 7: Inductive Batch Relation & Proofs (ported from TM91) +-- ============================================================================ + +inductive Batch : ℕ → List (Bool × ℕ) → ℕ → List (Bool × ℕ) → Prop + | BNil : Batch 0 [] 0 [] + | BCons (t : ℕ) (p : Bool) (n : ℕ) (xs : List (Bool × ℕ)) + (k : ℕ) (p' : Bool) (f : ℕ) (ys : List (Bool × ℕ)) (m : ℕ) : + t + bval p = k * 2 + bval p' → + Batch k xs f ys → + (k = 0 ∨ k + 2 ≤ n + bval (first_cell xs) + bval (first_cell ys)) → + m + k * 2 = n + f → + Batch t ((p, n) :: xs) (k * 2) ((p', m) :: ys) + +theorem batch_head {t : ℕ} {xs : List (Bool × ℕ)} {e : ℕ} {ys : List (Bool × ℕ)} + (h : Batch t xs e ys) : t + bval (first_cell xs) = e + bval (first_cell ys) := by + cases h with + | BNil => rfl + | BCons t p n xs k p' f ys m hcount _ _ _ => + simpa [first_cell] using! hcount + +theorem batch_even {t : ℕ} {xs : List (Bool × ℕ)} {e : ℕ} {ys : List (Bool × ℕ)} + (h : Batch t xs e ys) : ∃ k, e = k * 2 := by + cases h with + | BNil => exact ⟨0, rfl⟩ + | BCons _ _ _ _ k _ _ _ _ _ _ _ _ => exact ⟨k, rfl⟩ + +theorem batch_nil {t e : ℕ} {ys : List (Bool × ℕ)} (h : Batch t [] e ys) : + t = 0 ∧ e = 0 ∧ ys = [] := by + cases h + exact ⟨rfl, rfl, rfl⟩ + +theorem batch_refl (xs : List (Bool × ℕ)) : Batch 0 xs 0 xs := by + induction xs with + | nil => exact Batch.BNil + | cons hd tl ih => + rcases hd with ⟨p, n⟩ + exact Batch.BCons 0 p n tl 0 p 0 tl n (by omega) ih (Or.inl rfl) (by omega) + +theorem batch_zero {xs : List (Bool × ℕ)} {e : ℕ} {ys : List (Bool × ℕ)} + (h : Batch 0 xs e ys) : e = 0 ∧ ys = xs := by + induction xs generalizing e ys with + | nil => + rcases batch_nil h with ⟨_, rfl, rfl⟩ + exact ⟨rfl, rfl⟩ + | cons hd tl ih => + rcases hd with ⟨p, n⟩ + rcases h with _ | ⟨_, _, _, _, k, p', f, zs, m, hcount, hB, _, hgap⟩ + have hk : k = 0 ∧ p' = p := by + cases p <;> cases p' <;> simp [bval] at hcount ⊢ <;> omega + rcases hk with ⟨rfl, rfl⟩ + rcases ih hB with ⟨rfl, rfl⟩ + have hm : m = n := by omega + subst hm + exact ⟨rfl, rfl⟩ + +theorem first_one {xs : List (Bool × ℕ)} {f : ℕ} {ys : List (Bool × ℕ)} + (h : Batch 1 xs f ys) : + bval (first_cell xs) + bval (first_cell ys) = 1 ∧ f = bval (first_cell xs) * 2 := by + have hh := batch_head h + rcases batch_even h with ⟨k, rfl⟩ + cases hfx : first_cell xs <;> cases hfy : first_cell ys <;> + simp [hfx, hfy, bval] at hh ⊢ <;> omega + +theorem guard_positive {k : ℕ} {xs : List (Bool × ℕ)} {f : ℕ} {ys : List (Bool × ℕ)} {n : ℕ} + (hk : 0 < k) (hB : Batch k xs f ys) + (hG : k + 2 ≤ n + bval (first_cell xs) + bval (first_cell ys)) : 2 ≤ n := by + have hh := batch_head hB + rcases batch_even hB with ⟨j, rfl⟩ + cases hfx : first_cell xs <;> cases hfy : first_cell ys <;> + simp [hfx, hfy, bval] at hh hG ⊢ <;> omega + +theorem split_guard_step {k' n f1 b_tl b_zs b_tail : ℕ} + (hF1 : b_tl + b_zs = 1) (hF2 : f1 = b_tl * 2) (hn2 : 2 ≤ n) + (hG2 : (k' + 1) + 2 ≤ n + b_tl + b_tail) : + k' + 2 ≤ (n - 2 + f1) + b_zs + b_tail := by + omega + +theorem batch_split {t : ℕ} {xs : List (Bool × ℕ)} {e : ℕ} {ys : List (Bool × ℕ)} + (h : Batch (t + 1) xs e ys) : + ∃ f zs g, Batch 1 xs f zs ∧ Batch t zs g ys ∧ e = f + g := by + induction xs generalizing t e ys with + | nil => + have := (batch_nil h).1 + omega + | cons hd tl ih => + rcases hd with ⟨p, n⟩ + have hhead := batch_head h + rcases h with _ | ⟨_, _, _, _, k, p', f, tail, m, _, hB, hG, hgap⟩ + dsimp only [first_cell] at hhead + cases p + · -- p = false + refine ⟨0, (true, n) :: tl, k * 2, ?_, ?_, by omega⟩ + · exact Batch.BCons 1 false n tl 0 true 0 tl n (by rfl) (batch_refl tl) (Or.inl rfl) (by omega) + · exact Batch.BCons t true n tl k p' f tail m (by simp [bval] at hhead ⊢; omega) hB hG hgap + · -- p = true + have hkpos : 0 < k := by + cases p' <;> simp [bval] at hhead <;> omega + obtain ⟨k', rfl⟩ : ∃ k', k = k' + 1 := ⟨k - 1, by omega⟩ + rcases ih hB with ⟨f1, zs, f2, hB1, hB2, rfl⟩ + rcases first_one hB1 with ⟨hF1, hF2⟩ + have hn2 : 2 ≤ n := by + rcases hG with hG0 | hG2 + · omega + · exact guard_positive (by omega) hB hG2 + refine ⟨2, (false, n - 2 + f1) :: zs, k' * 2, ?_, ?_, by omega⟩ + · exact Batch.BCons 1 true n tl 1 false f1 zs (n - 2 + f1) + (by rfl) hB1 (by right; omega) (by omega) + · exact Batch.BCons t false (n - 2 + f1) zs k' p' f2 tail m + (by simp [bval] at hhead ⊢; omega) hB2 + (by + rcases hG with hG0 | hG2 + · omega + · by_cases hk' : k' = 0 + · left; exact hk' + · right + exact split_guard_step hF1 hF2 hn2 hG2) + (by omega) + +theorem batch_one {xs : List (Bool × ℕ)} {e : ℕ} {ys : List (Bool × ℕ)} + (h : Batch 1 xs e ys) : + Side false (words_tape xs) ((W ^ e) +> words_tape ys) := by + induction xs generalizing e ys with + | nil => + have := (batch_nil h).1 + omega + | cons hd tl ih => + rcases hd with ⟨p, n⟩ + rcases h with _ | ⟨_, _, _, _, k, p', f, tail, m, hcount, hB, hG, hgap⟩ + have hkp : k = bval p ∧ p' = !p := by + cases p <;> cases p' <;> simp [bval] at hcount ⊢ <;> omega + rcases hkp with ⟨rfl, rfl⟩ + cases p + · -- p = false: k = 0, p' = true + rcases batch_zero hB with ⟨rfl, htail⟩ + have hm : m = n := by simp [bval] at hgap; omega + rw [htail, hm] + simpa [words_tape, bit, bval] using! inc_side ((W ^ n) +> words_tape tl) + · -- p = true: k = 1, p' = false + have hn2 : 2 ≤ n := by + rcases hG with hG0 | hG2 + · simp [bval] at hG0 + · exact guard_positive (by decide) hB hG2 + have h_ih := ih hB + have h_wall := wall_side false (n - 2) h_ih + have h_carry := carry_side false h_wall + simp only [Bool.false_eq_true, ↓reduceIte] at h_carry + have hlhs : ([0, 0, 1, 0, 1] : List (Fin 2)) +> ((W ^ (n - 2)) +> words_tape tl) = + words_tape ((true, n) :: tl) := by + have hn_eq : n = 2 + (n - 2) := by omega + conv_rhs => rw [words_tape, hn_eq, pow_append_tape] + rfl + have hrhs : ([0, 1, 0, 1, 1] : List (Fin 2)) +> + ((W ^ (n - 2)) +> ((W ^ f) +> words_tape tail)) = + (W ^ (1 * 2)) +> words_tape ((false, m) :: tail) := by + have hm_eq : m = (n - 2) + f := by simp [bval] at hgap; omega + subst hm_eq + rw [words_tape, pow_append_tape] + rfl + rw [hlhs, hrhs] at h_carry + exact h_carry + +theorem batch_one_start {xs : List (Bool × ℕ)} {e : ℕ} {ys : List (Bool × ℕ)} + (h : Batch 1 xs e ys) (k : ℕ) : + (denote_state k xs) [holdout_0451_tm]⊢* (denote_state (k + 1 + e) ys) := by + have h1 := wall_side false k (batch_one h) + have h2 := emit_side false h1 + have hrhs : (W +> ((W ^ k) +> ((W ^ e) +> words_tape ys))) = + (W ^ (k + 1 + e)) +> words_tape ys := by + have hk1 : k + 1 + e = 1 + k + e := by omega + rw [hk1, pow_append_tape, pow_append_tape] + rfl + unfold denote_state + rw [← hrhs] + exact h2 + +theorem batch_steps {t : ℕ} {xs : List (Bool × ℕ)} {e : ℕ} {ys : List (Bool × ℕ)} + (h : Batch t xs e ys) (k : ℕ) : + (denote_state k xs) [holdout_0451_tm]⊢* (denote_state (k + t + e) ys) := by + induction t generalizing xs e ys k with + | zero => + rcases batch_zero h with ⟨rfl, hys⟩ + subst hys + simpa using! reaches_refl _ + | succ t ih => + rcases batch_split h with ⟨f, zs, g, hB1, hB2, rfl⟩ + have h1 := batch_one_start hB1 k + have h2 := ih hB2 (k + 1 + f) + have heq : k + 1 + f + t + g = k + (t + 1) + (f + g) := by omega + rw [heq] at h2 + exact reaches_trans h1 h2 + + +-- ============================================================================ +-- Section 8: FastCells Block-Accelerated Direct Evaluator & Soundness +-- ============================================================================ + +noncomputable section +set_option quotPrecheck false +@[simp] theorem nat_add_eq (a b : Nat) : Nat.add a b = a + b := rfl +@[simp] theorem nat_sub_eq (a b : Nat) : Nat.sub a b = a - b := rfl +@[simp] theorem nat_mul_eq (a b : Nat) : Nat.mul a b = a * b := rfl +@[simp] theorem nat_div_eq (a b : Nat) : Nat.div a b = a / b := rfl +@[simp] theorem nat_mod_eq (a b : Nat) : Nat.mod a b = a % b := rfl + +theorem wall_halt_start (k : ℕ) {r : ListBlank (Fin 2)} (h : SideHalt r) : + IsHaltFrom (start ((W ^ k) +> r)) := + wall_halt k h default +-- ============================================================================ +-- Section 8: FastCells definitions (identical to test_block_76331.lean) +-- ============================================================================ + +inductive FastCells where + | nil : FastCells + | cell (p : Bool) (n : Nat) (rest : FastCells) : FastCells + | block (B pow2B max_v v F_next : Nat) (ns : List Nat) (rest : FastCells) : FastCells + +inductive PushRes where + | mk (k : Nat) (xs : FastCells) : PushRes + +inductive PopRes where + | mk (b : Nat) (k : Nat) (xs : FastCells) : PopRes + +inductive OptCells where + | none : OptCells + | some (k : Nat) (xs : FastCells) : OptCells + +inductive CallOutcome where + | Failed : CallOutcome + | Returned (b : Bool) (k : Nat) (xs : FastCells) : CallOutcome + | Stopped : CallOutcome + +inductive FusedRes where + | mk (t : Nat) (e : Nat) (k_extra : Nat) (ys : FastCells) : FusedRes + +inductive StepRes where + | halted : StepRes + | running (sb : Bool) (k : Nat) (xs : FastCells) : StepRes + +inductive PackAcc where + | mk (tk : Nat) (req : Nat) (ys : FastCells) : PackAcc + +local notation "bval(" p ")" => (Bool.rec 0 1 p : Nat) +local notation "natMin(" a ", " b ")" => (Bool.rec b a (Nat.ble a b) : Nat) +@[simp] theorem bval_false_eq : (bval(false)) = 0 := rfl +@[simp] theorem bval_true_eq : (bval(true)) = 1 := rfl +local macro "omega_fast" : tactic => + `(tactic| ((try simp only [nat_add_eq, nat_sub_eq, nat_mul_eq, nat_div_eq, nat_mod_eq, + bval_false_eq, bval_true_eq] at *); omega)) + +def is_nil (xs : FastCells) : Bool := + FastCells.rec + true + (fun _ _ _ _ => false) + (fun _ _ _ _ _ _ _ _ => false) + xs + +def first_bit (xs : FastCells) : Bool := + FastCells.rec + false + (fun p _ _ _ => p) + (fun _ _ _ v _ _ _ _ => Nat.beq (Nat.mod v 2) 1) + xs + +def pop_top_of_block (B pow2B max_v v F_next : Nat) (ns : List Nat) (rest : FastCells) : FastCells := + List.rec + rest + (fun n0 tail_ns _ => + let p := Nat.beq (Nat.mod v 2) 1 + let v_next := Nat.div v 2 + let K2 := Nat.mul 2 v_next + List.rec + (FastCells.cell p (Nat.sub (Nat.add n0 F_next) K2) rest) + (fun _ _ _ => + let F_child := Nat.mul 2 (Nat.div v_next 2) + let m := Nat.sub (Nat.add n0 F_child) K2 + FastCells.cell p m (FastCells.block (Nat.sub B 1) (Nat.div pow2B 2) (Nat.div max_v 2) v_next F_next tail_ns rest)) + tail_ns) + ns + +def push_cell (p : Bool) (m k : Nat) (xs : FastCells) : PushRes := + let mk := Nat.add m k + Bool.rec + (PushRes.mk 0 (FastCells.cell false mk xs)) + (Bool.rec + (PushRes.mk 0 (FastCells.cell true mk xs)) + (FastCells.rec + (PushRes.mk 0 FastCells.nil) + (fun p2 n2 rest _ => + Bool.rec + (PushRes.mk (Nat.add 1 n2) rest) + (PushRes.mk 0 (FastCells.cell true 0 (FastCells.cell true n2 rest))) + p2) + (fun B pow2B max_v v F_next ns rest _ => + Bool.rec + (List.rec + (PushRes.mk 0 rest) + (fun n0 tail_ns _ => + let v_next := Nat.div v 2 + let K2 := Nat.mul 2 v_next + List.rec + (PushRes.mk (Nat.add 1 (Nat.sub (Nat.add n0 F_next) K2)) rest) + (fun _ _ _ => + let F_child := Nat.mul 2 (Nat.div v_next 2) + let m0 := Nat.sub (Nat.add n0 F_child) K2 + PushRes.mk (Nat.add 1 m0) (FastCells.block (Nat.sub B 1) (Nat.div pow2B 2) (Nat.div max_v 2) v_next F_next tail_ns rest)) + tail_ns) + ns) + (PushRes.mk 0 (FastCells.cell true 0 (FastCells.block B pow2B max_v v F_next ns rest))) + (Nat.beq (Nat.mod v 2) 1)) + xs) + (Nat.beq mk 0)) + p + +def pop_cell_bit (k : Nat) (xs : FastCells) : PopRes := + Bool.rec + (FastCells.rec + (PopRes.mk 0 0 FastCells.nil) + (fun p n rest _ => + Bool.rec (PopRes.mk 1 n rest) (PopRes.mk 0 n rest) p) + (fun B pow2B max_v v F_next ns rest _ => + List.rec + (PopRes.mk 0 0 rest) + (fun n0 tail_ns _ => + let p := Nat.beq (Nat.mod v 2) 1 + let b_out := Bool.rec 1 0 p + let v_next := Nat.div v 2 + let K2 := Nat.mul 2 v_next + List.rec + (PopRes.mk b_out (Nat.sub (Nat.add n0 F_next) K2) rest) + (fun _ _ _ => + let F_child := Nat.mul 2 (Nat.div v_next 2) + let m0 := Nat.sub (Nat.add n0 F_child) K2 + PopRes.mk b_out m0 (FastCells.block (Nat.sub B 1) (Nat.div pow2B 2) (Nat.div max_v 2) v_next F_next tail_ns rest)) + tail_ns) + ns) + xs) + (PopRes.mk 0 0 (FastCells.cell false (Nat.sub k 1) xs)) + (Nat.ble 1 k) + +-- Unpacking and Well-Formedness +def unpack_block (v F_next : Nat) (ns : List Nat) (rest : List (Bool × Nat)) : List (Bool × Nat) := + List.rec + (fun _ => rest) + (fun n0 tail_ns ih v => + let p := Nat.beq (Nat.mod v 2) 1 + let v_next := Nat.div v 2 + let K2 := Nat.mul 2 v_next + let F_child := List.rec F_next (fun _ _ _ => Nat.mul 2 (Nat.div v_next 2)) tail_ns + let m := Nat.sub (Nat.add n0 F_child) K2 + (p, m) :: ih v_next) + ns v + +def to_cells (xs : FastCells) : List (Bool × Nat) := + FastCells.rec + [] + (fun p n _ ih => (p, n) :: ih) + (fun _ _ _ v F_next ns _ ih => unpack_block v F_next ns ih) + xs + +def WF_ns (max_v F_next : Nat) : List Nat → Prop + | [] => False + | [n0] => ∀ v', v' ≤ max_v → 2 * (v' / 2) + 2 ≤ n0 + F_next + | n0 :: n1 :: tail => + (∀ v', v' ≤ max_v → 2 * (v' / 2) + 2 ≤ n0 + 2 * ((v' / 2) / 2)) ∧ + WF_ns (max_v / 2) F_next (n1 :: tail) + +def WF_block (pow2B max_v v F_next : Nat) (ns : List Nat) : Prop := + pow2B = 2 ^ ns.length ∧ v ≤ max_v ∧ WF_ns max_v F_next ns + +def WF : FastCells → Prop + | FastCells.nil => True + | FastCells.cell _ _ rest => WF rest + | FastCells.block _ pow2B max_v v F_next ns rest => + WF_block pow2B max_v v F_next ns ∧ WF rest + +theorem bval_rec_eq (p : Bool) : (bval(p)) = bval p := by + cases p <;> rfl + +theorem wf_ns_mono {m1 m2 f1 f2 : Nat} {ns : List Nat} + (hm : m1 ≤ m2) (hf : f1 ≤ f2) (h : WF_ns m2 f1 ns) : WF_ns m1 f2 ns := by + induction ns generalizing m1 m2 with + | nil => exact h + | cons n0 tail ih => + cases tail with + | nil => + intro v' hv' + have := h v' (by omega_fast) + omega_fast + | cons n1 tail2 => + refine ⟨fun v' hv' => h.1 v' (by omega_fast), ?_⟩ + exact ih (by omega_fast) h.2 + +theorem first_cell_unpack_block (v F_next : Nat) (n0 : Nat) (tail : List Nat) (rest : List (Bool × Nat)) : + first_cell (unpack_block v F_next (n0 :: tail) rest) = (Nat.beq (Nat.mod v 2) 1) := rfl + +theorem first_bit_eq (xs : FastCells) (hwf : WF xs) : + first_bit xs = first_cell (to_cells xs) := by + cases xs with + | nil => rfl + | cell p n rest => rfl + | block B pow2B max_v v F_next ns rest => + rcases hwf with ⟨⟨_, _, hns⟩, _⟩ + cases ns with + | nil => contradiction + | cons n0 tail => rfl + +theorem pop_top_of_block_to_cells (B pow2B max_v v F_next : Nat) (ns : List Nat) (rest : FastCells) : + to_cells (pop_top_of_block B pow2B max_v v F_next ns rest) = + unpack_block v F_next ns (to_cells rest) := by + cases ns with + | nil => rfl + | cons n0 tail_ns => + cases tail_ns <;> rfl + +theorem pow2_div2_cons (n1 : Nat) (tail : List Nat) : + (2 ^ (n1 :: tail).length * 2) / 2 = 2 ^ (n1 :: tail).length := by + omega_fast + +theorem pop_top_of_block_wf (B pow2B max_v v F_next : Nat) (ns : List Nat) (rest : FastCells) + (hb : WF_block pow2B max_v v F_next ns) (hr : WF rest) : + WF (pop_top_of_block B pow2B max_v v F_next ns rest) := by + rcases hb with ⟨hpow, hv, hns⟩ + cases ns with + | nil => contradiction + | cons n0 tail_ns => + cases tail_ns with + | nil => exact hr + | cons n1 tail2 => + refine ⟨⟨?_, by omega_fast, hns.2⟩, hr⟩ + rw [hpow, List.length_cons, Nat.pow_succ] + omega_fast + +def prepend_cell_to_packed (p : Bool) (raw_n : Nat) (ys : FastCells) : FastCells := + let bp := bval(p) + FastCells.rec + (FastCells.block 1 2 (Nat.sub raw_n 2) bp 0 [raw_n] FastCells.nil) + (fun q m rest _ => + FastCells.block 1 2 (Nat.sub raw_n 2) bp 0 [raw_n] (FastCells.cell q m rest)) + (fun B pow2B max_v v F_next ns rest _ => + let n_new := Nat.sub (Nat.add raw_n (Nat.mul 2 v)) (Nat.mul 2 (Nat.div v 2)) + let v_new := Nat.add (Nat.mul 2 v) bp + let lim0 := Nat.add v_new (Nat.mul 2 (Nat.sub raw_n 3)) + let lim_rest := Nat.add (Nat.mul 2 max_v) 1 + let B1 := Nat.add B 1 + let pow2B2 := Nat.mul 2 pow2B + let ns1 := n_new :: ns + Bool.rec + (FastCells.block B1 pow2B2 lim_rest v_new F_next ns1 rest) + (FastCells.block B1 pow2B2 lim0 v_new F_next ns1 rest) + (Nat.ble lim0 lim_rest)) + ys + +def repack_step (p : Bool) (raw_n : Nat) (acc : PackAcc) : PackAcc := + PackAcc.rec + (fun tk req ys => + let req2 := Nat.mul 2 req + Bool.rec + (Bool.rec + (PackAcc.mk 0 req2 (FastCells.cell p raw_n ys)) + (PackAcc.mk 0 req2 (prepend_cell_to_packed p raw_n ys)) + (and (Nat.ble 4 raw_n) (Nat.ble req raw_n))) + (PackAcc.mk (Nat.sub tk 1) req2 (FastCells.cell p raw_n ys)) + (Nat.ble 1 tk)) + acc + +def repack_block (v F_next : Nat) (ns : List Nat) (acc : PackAcc) : PackAcc := + List.rec + (fun _ => acc) + (fun n0 tail_ns ih v => + let p := Nat.beq (Nat.mod v 2) 1 + let v_next := Nat.div v 2 + let K2 := Nat.mul 2 v_next + let F_child := List.rec F_next (fun _ _ _ => Nat.mul 2 (Nat.div v_next 2)) tail_ns + let m := Nat.sub (Nat.add n0 F_child) K2 + repack_step p m (ih v_next)) + ns v + +def repack_block_smart (B pow2B max_v v F_next : Nat) (ns : List Nat) (acc : PackAcc) : PackAcc := + PackAcc.rec + (fun tk req ys => + Bool.rec + (repack_block v F_next ns (PackAcc.mk tk req ys)) + (PackAcc.mk 0 (Nat.mul req pow2B) (FastCells.block B pow2B max_v v F_next ns ys)) + (and (Nat.ble 6 B) (Nat.ble (Nat.add v (Nat.mul (Nat.div req 2) pow2B)) max_v))) + acc + +def unroll_top_1 (ys : FastCells) : FastCells := + FastCells.rec + FastCells.nil + (fun p n rest _ => FastCells.cell p n rest) + (fun B pow2B max_v v F_next ns rest _ => + pop_top_of_block B pow2B max_v v F_next ns rest) + ys + +def unroll_top_2 (ys : FastCells) : FastCells := + FastCells.rec + FastCells.nil + (fun p n rest _ => FastCells.cell p n (unroll_top_1 rest)) + (fun _ _ _ _ _ _ _ _ => ys) + (unroll_top_1 ys) + +def repack_cells (init_req : Nat) (xs : FastCells) : FastCells := + PackAcc.rec + (fun _ _ ys => unroll_top_2 ys) + (FastCells.rec + (PackAcc.mk 1 init_req FastCells.nil) + (fun p n _ ih => repack_step p n ih) + (fun B pow2B max_v v F_next ns _ ih => repack_block_smart B pow2B max_v v F_next ns ih) + xs) + +theorem prepend_cell_to_packed_spec (p : Bool) (raw_n : Nat) (ys : FastCells) + (hr : 4 ≤ raw_n) (hwf : WF ys) : + to_cells (prepend_cell_to_packed p raw_n ys) = (p, raw_n) :: to_cells ys ∧ + WF (prepend_cell_to_packed p raw_n ys) := by + cases ys with + | nil => + cases p <;> refine ⟨rfl, ⟨rfl, by omega_fast, fun v' hv' => by omega_fast⟩, trivial⟩ + | cell q m rest => + cases p <;> refine ⟨rfl, ⟨rfl, by omega_fast, fun v' hv' => by omega_fast⟩, hwf⟩ + | block B pow2B max_v v F_next ns rest => + rcases hwf with ⟨⟨hpow, hv, hns⟩, hrest⟩ + cases ns with + | nil => contradiction + | cons n1 tail => + unfold prepend_cell_to_packed + dsimp only + have hp_mod : Nat.beq (Nat.mod (Nat.add (Nat.mul 2 v) (bval(p))) 2) 1 = p := by + cases p <;> simp [Nat.beq] <;> omega + have hv_div : Nat.div (Nat.add (Nat.mul 2 v) (bval(p))) 2 = v := by + cases p <;> dsimp <;> omega + have hm_eq : Nat.sub (Nat.add (Nat.sub (Nat.add raw_n (Nat.mul 2 v)) (Nat.mul 2 (Nat.div v 2))) + (Nat.mul 2 (Nat.div v 2))) (Nat.mul 2 v) = raw_n := by + change (((raw_n + 2 * v) - 2 * (v / 2)) + 2 * (v / 2)) - 2 * v = raw_n + omega_fast + have hpow2 : Nat.mul 2 pow2B = 2 ^ (Nat.sub (Nat.add raw_n (Nat.mul 2 v)) (Nat.mul 2 (Nat.div v 2)) :: n1 :: tail).length := by + rw [hpow, List.length_cons, Nat.pow_succ] + change 2 * 2 ^ (n1 :: tail).length = 2 ^ (n1 :: tail).length * 2 + omega_fast + cases hble : Nat.ble (Nat.add (Nat.add (Nat.mul 2 v) (bval(p))) (Nat.mul 2 (Nat.sub raw_n 3))) + (Nat.add (Nat.mul 2 max_v) 1) + · -- lim0 > lim_rest, so max_v' = lim_rest + dsimp only + have hle_gt : (2 * max_v + 1) < (2 * v + (bval(p))) + 2 * (raw_n - 3) := by + have hnot : ¬ (Nat.add (Nat.add (Nat.mul 2 v) (bval(p))) (Nat.mul 2 (Nat.sub raw_n 3)) ≤ Nat.add (Nat.mul 2 max_v) 1) := + fun h => by rw [Nat.ble_eq.mpr h] at hble; contradiction + omega_fast + refine ⟨?_, ⟨hpow2, ?_, ?_, ?_⟩, hrest⟩ + · change (Nat.beq (Nat.mod (Nat.add (Nat.mul 2 v) (bval(p))) 2) 1, + Nat.sub (Nat.add (Nat.sub (Nat.add raw_n (Nat.mul 2 v)) (Nat.mul 2 (Nat.div v 2))) + (Nat.mul 2 (Nat.div (Nat.div (Nat.add (Nat.mul 2 v) (bval(p))) 2) 2))) + (Nat.mul 2 (Nat.div (Nat.add (Nat.mul 2 v) (bval(p))) 2))) :: + unpack_block (Nat.div (Nat.add (Nat.mul 2 v) (bval(p))) 2) F_next (n1 :: tail) (to_cells rest) = _ + rw [hp_mod, hv_div, hm_eq] + rfl + · cases p <;> dsimp [Nat.add, Nat.mul] <;> omega + · intro v' hv' + change v' ≤ 2 * max_v + 1 at hv' + change 2 * (v' / 2) + 2 ≤ ((raw_n + 2 * v) - 2 * (v / 2)) + 2 * ((v' / 2) / 2) + cases p <;> dsimp at hle_gt <;> omega + · exact wf_ns_mono (by change (2 * max_v + 1) / 2 ≤ max_v; omega_fast) (Nat.le_refl _) hns + · -- lim0 ≤ lim_rest, so max_v' = lim0 + dsimp only + have hle_le : (2 * v + (bval(p))) + 2 * (raw_n - 3) ≤ 2 * max_v + 1 := by + exact Nat.ble_eq.mp hble + refine ⟨?_, ⟨hpow2, ?_, ?_, ?_⟩, hrest⟩ + · change (Nat.beq (Nat.mod (Nat.add (Nat.mul 2 v) (bval(p))) 2) 1, + Nat.sub (Nat.add (Nat.sub (Nat.add raw_n (Nat.mul 2 v)) (Nat.mul 2 (Nat.div v 2))) + (Nat.mul 2 (Nat.div (Nat.div (Nat.add (Nat.mul 2 v) (bval(p))) 2) 2))) + (Nat.mul 2 (Nat.div (Nat.add (Nat.mul 2 v) (bval(p))) 2))) :: + unpack_block (Nat.div (Nat.add (Nat.mul 2 v) (bval(p))) 2) F_next (n1 :: tail) (to_cells rest) = _ + rw [hp_mod, hv_div, hm_eq] + rfl + · cases p <;> dsimp [Nat.add, Nat.mul, Nat.sub] <;> omega + · intro v' hv' + change v' ≤ (2 * v + (bval(p))) + 2 * (raw_n - 3) at hv' + change 2 * (v' / 2) + 2 ≤ ((raw_n + 2 * v) - 2 * (v / 2)) + 2 * ((v' / 2) / 2) + cases p <;> dsimp at hv' <;> omega + · exact wf_ns_mono (by + change ((2 * v + (bval(p))) + 2 * (raw_n - 3)) / 2 ≤ max_v + cases p <;> dsimp at hle_le ⊢ <;> omega) (Nat.le_refl _) hns + +def acc_cells : PackAcc → List (Bool × Nat) + | PackAcc.mk _ _ ys => to_cells ys + +def acc_wf : PackAcc → Prop + | PackAcc.mk _ _ ys => WF ys + +theorem repack_step_spec (p : Bool) (raw_n : Nat) (acc : PackAcc) (hwf : acc_wf acc) : + acc_cells (repack_step p raw_n acc) = (p, raw_n) :: acc_cells acc ∧ + acc_wf (repack_step p raw_n acc) := by + rcases acc with ⟨tk, req, ys⟩ + unfold repack_step + dsimp only + cases Nat.ble 1 tk + · dsimp only + cases hcond : (and (Nat.ble 4 raw_n) (Nat.ble req raw_n)) + · exact ⟨rfl, hwf⟩ + · dsimp only + have hr4 : 4 ≤ raw_n := by + have : Nat.ble 4 raw_n = true := by + cases h4 : Nat.ble 4 raw_n + · rw [h4] at hcond; contradiction + · rfl + exact Nat.ble_eq.mp this + exact prepend_cell_to_packed_spec p raw_n ys hr4 hwf + · exact ⟨rfl, hwf⟩ + +theorem repack_block_spec (v F_next : Nat) (ns : List Nat) (acc : PackAcc) (hwf : acc_wf acc) : + acc_cells (repack_block v F_next ns acc) = unpack_block v F_next ns (acc_cells acc) ∧ + acc_wf (repack_block v F_next ns acc) := by + induction ns generalizing v with + | nil => exact ⟨rfl, hwf⟩ + | cons n0 tail_ns ih => + rcases ih (Nat.div v 2) with ⟨ih_c, ih_w⟩ + rcases repack_step_spec (Nat.beq (Nat.mod v 2) 1) + (Nat.sub (Nat.add n0 (List.rec F_next (fun _ _ _ => Nat.mul 2 (Nat.div (Nat.div v 2) 2)) tail_ns)) + (Nat.mul 2 (Nat.div v 2))) + (repack_block (Nat.div v 2) F_next tail_ns acc) ih_w with ⟨hs_c, hs_w⟩ + refine ⟨?_, hs_w⟩ + change acc_cells (repack_step (Nat.beq (Nat.mod v 2) 1) + (Nat.sub (Nat.add n0 (List.rec F_next (fun _ _ _ => Nat.mul 2 (Nat.div (Nat.div v 2) 2)) tail_ns)) + (Nat.mul 2 (Nat.div v 2))) + (repack_block (Nat.div v 2) F_next tail_ns acc)) = _ + rw [hs_c, ih_c] + rfl + +theorem repack_block_smart_spec (B pow2B max_v v F_next : Nat) (ns : List Nat) (acc : PackAcc) + (hb : WF_block pow2B max_v v F_next ns) (hwf : acc_wf acc) : + acc_cells (repack_block_smart B pow2B max_v v F_next ns acc) = + unpack_block v F_next ns (acc_cells acc) ∧ + acc_wf (repack_block_smart B pow2B max_v v F_next ns acc) := by + rcases acc with ⟨tk, req, ys⟩ + unfold repack_block_smart + dsimp only + cases (and (Nat.ble 6 B) (Nat.ble (Nat.add v (Nat.mul (Nat.div req 2) pow2B)) max_v)) + · exact repack_block_spec v F_next ns (PackAcc.mk tk req ys) hwf + · exact ⟨rfl, hb, hwf⟩ + +theorem unroll_top_1_spec (ys : FastCells) (hwf : WF ys) : + to_cells (unroll_top_1 ys) = to_cells ys ∧ WF (unroll_top_1 ys) := by + cases ys with + | nil => exact ⟨rfl, trivial⟩ + | cell p n rest => exact ⟨rfl, hwf⟩ + | block B pow2B max_v v F_next ns rest => + exact ⟨pop_top_of_block_to_cells B pow2B max_v v F_next ns rest, + pop_top_of_block_wf B pow2B max_v v F_next ns rest hwf.1 hwf.2⟩ + +theorem unroll_top_2_spec (ys : FastCells) (hwf : WF ys) : + to_cells (unroll_top_2 ys) = to_cells ys ∧ WF (unroll_top_2 ys) := by + rcases unroll_top_1_spec ys hwf with ⟨h1_c, h1_w⟩ + unfold unroll_top_2 + generalize hu1 : unroll_top_1 ys = u1 at h1_c h1_w + cases u1 with + | nil => exact ⟨h1_c, trivial⟩ + | cell p n rest => + rcases unroll_top_1_spec rest h1_w with ⟨h2_c, h2_w⟩ + dsimp only + change (p, n) :: to_cells (unroll_top_1 rest) = to_cells ys ∧ WF (unroll_top_1 rest) + rw [h2_c] + exact ⟨h1_c, h2_w⟩ + | block B pow2B max_v v F_next ns rest => + exact ⟨rfl, hwf⟩ + +def repack_fold (init_req : Nat) (xs : FastCells) : PackAcc := + FastCells.rec (PackAcc.mk 1 init_req FastCells.nil) + (fun p n _ ih => repack_step p n ih) + (fun B pow2B max_v v F_next ns _ ih => repack_block_smart B pow2B max_v v F_next ns ih) xs + +theorem repack_cells_spec (init_req : Nat) (xs : FastCells) (hwf : WF xs) : + to_cells (repack_cells init_req xs) = to_cells xs ∧ WF (repack_cells init_req xs) := by + have hfold : ∀ xs, WF xs → + acc_cells (repack_fold init_req xs) = to_cells xs ∧ acc_wf (repack_fold init_req xs) := by + intro xs hwf + induction xs with + | nil => exact ⟨rfl, trivial⟩ + | cell p n rest ih => + rcases ih hwf with ⟨ih_c, ih_w⟩ + rcases repack_step_spec p n (repack_fold init_req rest) ih_w with ⟨hs_c, hs_w⟩ + change acc_cells (repack_step p n (repack_fold init_req rest)) = _ ∧ + acc_wf (repack_step p n (repack_fold init_req rest)) + rw [ih_c] at hs_c + exact ⟨hs_c, hs_w⟩ + | block B pow2B max_v v F_next ns rest ih => + rcases ih hwf.2 with ⟨ih_c, ih_w⟩ + rcases repack_block_smart_spec B pow2B max_v v F_next ns (repack_fold init_req rest) hwf.1 ih_w with ⟨hs_c, hs_w⟩ + change acc_cells (repack_block_smart B pow2B max_v v F_next ns (repack_fold init_req rest)) = _ ∧ + acc_wf (repack_block_smart B pow2B max_v v F_next ns (repack_fold init_req rest)) + rw [ih_c] at hs_c + exact ⟨hs_c, hs_w⟩ + rcases hfold xs hwf with ⟨hf_c, hf_w⟩ + change PackAcc.rec (fun _ _ ys => to_cells (unroll_top_2 ys) = to_cells xs ∧ WF (unroll_top_2 ys)) (repack_fold init_req xs) + generalize hacc : repack_fold init_req xs = acc at hf_c hf_w + rcases acc with ⟨tk, req, ys⟩ + rcases unroll_top_2_spec ys hf_w with ⟨hu_c, hu_w⟩ + dsimp only + rw [hu_c] + exact ⟨hf_c, hu_w⟩ + +def push_spec (p : Bool) (m k : Nat) (xs : FastCells) : PushRes → Prop + | PushRes.mk k' xs' => + (W ^ k') +> words_tape (to_cells xs') = + (bit p) +> ((W ^ (m + k)) +> words_tape (to_cells xs)) ∧ WF xs' + +theorem push_cell_fast_spec (p : Bool) (m k : Nat) (xs : FastCells) (hwf : WF xs) : + push_spec p m k xs (push_cell p m k xs) := by + unfold push_cell + dsimp only + cases p + · exact ⟨rfl, hwf⟩ + · dsimp only + cases hmk : Nat.beq (Nat.add m k) 0 + · exact ⟨rfl, hwf⟩ + · dsimp only + have hmk0 : m + k = 0 := Nat.beq_eq.mp hmk + cases xs with + | nil => + refine ⟨?_, trivial⟩ + rw [hmk0] + dsimp [W, words_tape, bit, to_cells] + exact zero_cons_default.symm + | cell p2 n2 rest => + cases p2 + · refine ⟨?_, hwf⟩ + rw [hmk0] + dsimp [to_cells, words_tape, bit] + rw [pow_append_tape W 1 n2] + rfl + · refine ⟨?_, hwf⟩ + rw [hmk0] + rfl + | block B pow2B max_v v F_next ns rest => + dsimp only + rcases hwf with ⟨⟨hpow, hv, hns⟩, hrest⟩ + cases hp2 : Nat.beq (Nat.mod v 2) 1 + · dsimp only + cases ns with + | nil => contradiction + | cons n0 tail_ns => + cases tail_ns with + | nil => + refine ⟨?_, hrest⟩ + rw [hmk0] + dsimp only [to_cells, unpack_block, words_tape, nat_add_eq] + rw [hp2, pow_append_tape W 1] + rfl + | cons n1 tail2 => + refine ⟨?_, ⟨?_, by omega_fast, hns.2⟩, hrest⟩ + · rw [hmk0] + dsimp only [to_cells, unpack_block, words_tape, nat_add_eq] + rw [hp2, pow_append_tape W 1] + rfl + · rw [hpow, List.length_cons, Nat.pow_succ] + omega_fast + · refine ⟨?_, ⟨hpow, hv, hns⟩, hrest⟩ + rw [hmk0] + rfl + +def nat_bit (b : Nat) : Fin 2 := if Nat.beq b 0 then 0 else 1 + +theorem bit_eq_nat_bit (p : Bool) : bit p = [nat_bit (Bool.rec 1 0 p)] := by + cases p <;> rfl + +theorem bit_beq_zero (b : Nat) : bit (Nat.beq b 0) = [nat_bit b] := by + unfold nat_bit + cases Nat.beq b 0 <;> rfl + +def pop_spec (k : Nat) (xs : FastCells) : PopRes → Prop + | PopRes.mk b' k' xs' => + (W ^ k) +> words_tape (to_cells xs) = + (nat_bit b') >> ((W ^ k') +> words_tape (to_cells xs')) ∧ WF xs' + +theorem pop_cell_bit_fast_spec (k : Nat) (xs : FastCells) (hwf : WF xs) : + pop_spec k xs (pop_cell_bit k xs) := by + unfold pop_cell_bit + cases hk : Nat.ble 1 k + · dsimp only + have hk0 : k = 0 := by + have hnot : ¬ (1 ≤ k) := fun h => by rw [Nat.ble_eq.mpr h] at hk; contradiction + omega_fast + cases xs with + | nil => + refine ⟨?_, trivial⟩ + rw [hk0] + dsimp [W, words_tape, to_cells, nat_bit] + exact zero_cons_default.symm + | cell p n rest => + cases p <;> (refine ⟨?_, hwf⟩; rw [hk0]; rfl) + | block B pow2B max_v v F_next ns rest => + dsimp only + rcases hwf with ⟨⟨hpow, hv, hns⟩, hrest⟩ + cases ns with + | nil => contradiction + | cons n0 tail_ns => + cases tail_ns with + | nil => + refine ⟨?_, hrest⟩ + rw [hk0] + dsimp only [to_cells, unpack_block, words_tape] + rw [bit_eq_nat_bit] + rfl + | cons n1 tail2 => + refine ⟨?_, ⟨?_, by omega_fast, hns.2⟩, hrest⟩ + · rw [hk0] + dsimp only [to_cells, unpack_block, words_tape] + rw [bit_eq_nat_bit] + rfl + · rw [hpow, List.length_cons, Nat.pow_succ] + omega_fast + · dsimp only + have hk1 : 1 ≤ k := Nat.ble_eq.mp hk + refine ⟨?_, hwf⟩ + have hk_eq : W ^ k = W ^ (1 + (k - 1)) := by congr 1; omega_fast + rw [hk_eq, pow_append_tape W 1 (k - 1)] + rfl + +def remove_word (w : List Nat) (k : Nat) (xs : FastCells) : OptCells := + List.rec + (fun k xs => OptCells.some k xs) + (fun b _ ih k xs => + PopRes.rec (fun b' k' xs' => + Bool.rec OptCells.none (ih k' xs') (Nat.beq b b')) + (pop_cell_bit k xs)) + w k xs + +def put_word (w : List Nat) (k : Nat) (xs : FastCells) : PushRes := + List.rec + (PushRes.mk k xs) + (fun b _ ih => + PushRes.rec (fun k' xs' => + push_cell (Nat.beq b 0) 0 k' xs') + ih) + w + +theorem remove_word_fast_spec (w : List Nat) (k : Nat) (xs : FastCells) (hwf : WF xs) + (k' : Nat) (ys : FastCells) (h : remove_word w k xs = OptCells.some k' ys) : + (W ^ k) +> words_tape (to_cells xs) = + (w.map nat_bit) +> ((W ^ k') +> words_tape (to_cells ys)) ∧ WF ys := by + induction w generalizing k xs with + | nil => + injection h with hk hys + subst hk hys + exact ⟨rfl, hwf⟩ + | cons b w ih => + unfold remove_word at h + dsimp only at h + have hp := pop_cell_bit_fast_spec k xs hwf + generalize hpop : pop_cell_bit k xs = pop_res at h hp + rcases pop_res with ⟨b', k1, xs1⟩ + rcases hp with ⟨hp_t, hp_w⟩ + dsimp only at h + cases hbeq : Nat.beq b b' + · rw [hbeq] at h; contradiction + · rw [hbeq] at h + dsimp only at h + have hbb' : b = b' := Nat.beq_eq.mp hbeq + subst hbb' + rcases ih k1 xs1 hp_w h with ⟨ih_t, ih_w⟩ + rw [hp_t, ih_t] + exact ⟨rfl, ih_w⟩ + +def put_word_spec_prop (w : List Nat) (k : Nat) (xs : FastCells) : PushRes → Prop + | PushRes.mk k' xs' => + (W ^ k') +> words_tape (to_cells xs') = + (w.map nat_bit) +> ((W ^ k) +> words_tape (to_cells xs)) ∧ WF xs' + +theorem put_word_fast_spec (w : List Nat) (k : Nat) (xs : FastCells) (hwf : WF xs) : + put_word_spec_prop w k xs (put_word w k xs) := by + induction w with + | nil => exact ⟨rfl, hwf⟩ + | cons b w ih => + change PushRes.rec (fun k1 xs1 => put_word_spec_prop (b :: w) k xs (push_cell (Nat.beq b 0) 0 k1 xs1)) (put_word w k xs) + generalize hpw : put_word w k xs = pw_res at ih + rcases pw_res with ⟨k1, xs1⟩ + rcases ih with ⟨ih_t, ih_w⟩ + dsimp only + have hpc := push_cell_fast_spec (Nat.beq b 0) 0 k1 xs1 ih_w + generalize hpush : push_cell (Nat.beq b 0) 0 k1 xs1 = push_res at hpc + rcases push_res with ⟨k', xs'⟩ + rcases hpc with ⟨hpc_t, hpc_w⟩ + rw [Nat.zero_add, bit_beq_zero, ih_t] at hpc_t + exact ⟨hpc_t, hpc_w⟩ + +theorem bval_beq_mod2 (x : Nat) : bval (Nat.beq (Nat.mod x 2) 1) = x % 2 := by + by_cases h : x % 2 = 1 + · have hb : Nat.beq (Nat.mod x 2) 1 = true := Nat.beq_eq.mpr h + rw [hb]; dsimp [bval]; omega_fast + · have h0 : x % 2 = 0 := by omega_fast + have hb : Nat.beq (Nat.mod x 2) 1 = false := by + cases hbeq : Nat.beq (Nat.mod x 2) 1 + · rfl + · exfalso; exact h (Nat.beq_eq.mp hbeq) + rw [hb]; dsimp [bval]; omega_fast + +theorem unpack_block_batch (ns : List Nat) (v v_new max_v F_next f : Nat) (rest ys_rest : List (Bool × Nat)) + (hle : v ≤ v_new) (hv : v_new ≤ max_v) (hwf : WF_ns max_v F_next ns) + (hB : Batch (v_new / (2 ^ ns.length) - v / (2 ^ ns.length)) rest f ys_rest) : + Batch (v_new - v) (unpack_block v F_next ns rest) + (2 * (v_new / 2 - v / 2)) (unpack_block v_new (F_next + f) ns ys_rest) := by + induction ns generalizing v v_new max_v with + | nil => contradiction + | cons n0 tail_ns ih => + cases tail_ns with + | nil => + change Batch (v_new / 2 - v / 2) rest f ys_rest at hB + have hns0 := hwf v_new hv + have he_eq : 2 * (v_new / 2 - v / 2) = (v_new / 2 - v / 2) * 2 := by omega_fast + rw [he_eq] + apply Batch.BCons (v_new - v) (Nat.beq (Nat.mod v 2) 1) + (Nat.sub (Nat.add n0 F_next) (Nat.mul 2 (Nat.div v 2))) rest + (v_new / 2 - v / 2) (Nat.beq (Nat.mod v_new 2) 1) f ys_rest + (Nat.sub (Nat.add n0 (F_next + f)) (Nat.mul 2 (Nat.div v_new 2))) + · rw [bval_beq_mod2, bval_beq_mod2]; omega_fast + · exact hB + · right + change (v_new / 2 - v / 2) + 2 ≤ ((n0 + F_next) - 2 * (v / 2)) + bval (first_cell rest) + bval (first_cell ys_rest) + omega_fast + · change ((n0 + (F_next + f)) - 2 * (v_new / 2)) + (v_new / 2 - v / 2) * 2 = ((n0 + F_next) - 2 * (v / 2)) + f + omega_fast + | cons n1 tail2 => + rcases hwf with ⟨hns0, hns_tail⟩ + have hdiv_eq : ∀ x : Nat, x / (2 ^ (n0 :: n1 :: tail2).length) = (x / 2) / (2 ^ (n1 :: tail2).length) := by + intro x + rw [List.length_cons, Nat.pow_succ, Nat.mul_comm, ← Nat.div_div_eq_div_mul] + rw [hdiv_eq v_new, hdiv_eq v] at hB + have h_ih := ih (v / 2) (v_new / 2) (max_v / 2) (by omega_fast) (by omega_fast) hns_tail hB + have he_eq : 2 * (v_new / 2 - v / 2) = (v_new / 2 - v / 2) * 2 := by omega_fast + rw [he_eq] + apply Batch.BCons (v_new - v) (Nat.beq (Nat.mod v 2) 1) + (Nat.sub (Nat.add n0 (Nat.mul 2 (Nat.div (Nat.div v 2) 2))) (Nat.mul 2 (Nat.div v 2))) + (unpack_block (v / 2) F_next (n1 :: tail2) rest) + (v_new / 2 - v / 2) (Nat.beq (Nat.mod v_new 2) 1) + (2 * ((v_new / 2) / 2 - (v / 2) / 2)) + (unpack_block (v_new / 2) (F_next + f) (n1 :: tail2) ys_rest) + (Nat.sub (Nat.add n0 (Nat.mul 2 (Nat.div (Nat.div v_new 2) 2))) (Nat.mul 2 (Nat.div v_new 2))) + · rw [bval_beq_mod2, bval_beq_mod2]; omega_fast + · exact h_ih + · right + rw [first_cell_unpack_block, first_cell_unpack_block, bval_beq_mod2, bval_beq_mod2] + have := hns0 v_new hv + change (v_new / 2 - v / 2) + 2 ≤ + ((n0 + 2 * ((v / 2) / 2)) - 2 * (v / 2)) + (v / 2) % 2 + (v_new / 2) % 2 + omega_fast + · have := hns0 v_new hv + change ((n0 + 2 * ((v_new / 2) / 2)) - 2 * (v_new / 2)) + (v_new / 2 - v / 2) * 2 = + ((n0 + 2 * ((v / 2) / 2)) - 2 * (v / 2)) + 2 * ((v_new / 2) / 2 - (v / 2) / 2) + omega_fast + +theorem unpack_block_absorb_extra (ns : List Nat) (v max_v F_next k_extra : Nat) + (ys_norm ys_rest : List (Bool × Nat)) + (hv : v ≤ max_v) (hwf : WF_ns max_v F_next ns) + (hW : (W ^ k_extra) +> words_tape ys_norm = words_tape ys_rest) : + words_tape (unpack_block v (F_next + k_extra) ns ys_norm) = + words_tape (unpack_block v F_next ns ys_rest) := by + induction ns generalizing v max_v with + | nil => contradiction + | cons n0 tail_ns ih => + cases tail_ns with + | nil => + have hns0 := hwf v hv + have hm_eq : Nat.sub (Nat.add n0 (F_next + k_extra)) (Nat.mul 2 (Nat.div v 2)) = + Nat.sub (Nat.add n0 F_next) (Nat.mul 2 (Nat.div v 2)) + k_extra := by + change (n0 + (F_next + k_extra)) - 2 * (v / 2) = ((n0 + F_next) - 2 * (v / 2)) + k_extra + omega_fast + change (bit _) +> ((W ^ Nat.sub (Nat.add n0 (F_next + k_extra)) (Nat.mul 2 (Nat.div v 2))) +> words_tape ys_norm) = + (bit _) +> ((W ^ Nat.sub (Nat.add n0 F_next) (Nat.mul 2 (Nat.div v 2))) +> words_tape ys_rest) + rw [hm_eq, pow_append_tape, hW] + | cons n1 tail2 => + rcases hwf with ⟨_, hns_tail⟩ + have h_ih := ih (v / 2) (max_v / 2) (by omega_fast) hns_tail + change (bit _) +> ((W ^ _) +> words_tape (unpack_block (v / 2) (F_next + k_extra) (n1 :: tail2) ys_norm)) = + (bit _) +> ((W ^ _) +> words_tape (unpack_block (v / 2) F_next (n1 :: tail2) ys_rest)) + rw [h_ih] + + +theorem pow2_pos (ns : List Nat) : 0 < 2 ^ ns.length := by + induction ns with + | nil => decide + | cons _ tail ih => rw [List.length_cons, Nat.pow_succ]; omega_fast + +theorem div_succ_of_mod_ne (v d : Nat) (hd : 0 < d) (hne : v % d + 1 ≠ d) : + (v + 1) / d = v / d := by + have hlt : v % d < d := Nat.mod_lt v hd + have hlt2 : v % d + 1 < d := by omega_fast + have h1 : v + 1 = d * (v / d) + (v % d + 1) := by + have := Nat.div_add_mod v d + omega_fast + rw [h1, Nat.mul_add_div hd, Nat.div_eq_of_lt hlt2, Nat.add_zero] + +theorem div_succ_of_mod_eq (v d : Nat) (hd : 0 < d) (heq : v % d + 1 = d) : + (v + 1) / d = v / d + 1 := by + have h1 : v + 1 = d * (v / d + 1) + 0 := by + have := Nat.div_add_mod v d + have : d * (v / d + 1) = d * (v / d) + d := Nat.mul_succ d (v / d) + omega_fast + rw [h1, Nat.mul_add_div hd, Nat.div_eq_of_lt hd, Nat.add_zero] + +def call_cells (xs : FastCells) : CallOutcome := + FastCells.rec + (CallOutcome.Returned true 1 (FastCells.cell false 0 FastCells.nil)) + (fun p n rest ih => + Bool.rec + (PushRes.rec (fun k' xs' => CallOutcome.Returned false k' xs') (push_cell true 0 n rest)) + (Bool.rec + (OptCells.rec + (OptCells.rec + (OptCells.rec + CallOutcome.Failed + (fun _ _ => CallOutcome.Stopped) + (remove_word [0, 0, 1, 1] 0 (FastCells.cell true n rest))) + (fun k2 xs2 => PushRes.rec (fun k' xs' => CallOutcome.Returned true k' xs') (put_word [1, 0, 1, 0, 0] k2 xs2)) + (remove_word [0, 0, 1, 0, 0] 0 (FastCells.cell true n rest))) + (fun k1 xs1 => PushRes.rec (fun k' xs' => CallOutcome.Returned true k' xs') (put_word [0, 1, 1] k1 xs1)) + (remove_word [0, 0, 0] 0 (FastCells.cell true n rest))) + (CallOutcome.rec + CallOutcome.Failed + (fun b k_ret ys_ret => + let m := Nat.add (Nat.sub n 2) k_ret + Bool.rec + (CallOutcome.Returned false 2 (FastCells.cell false m ys_ret)) + (CallOutcome.Returned true 1 (FastCells.cell false (Nat.add 1 m) ys_ret)) + b) + CallOutcome.Stopped + ih) + (Nat.ble 2 n)) + p) + (fun B pow2B max_v v F_next ns rest ih => + let v_new := Nat.add v 1 + Bool.rec + CallOutcome.Failed + (let P := Nat.mod v pow2B + Bool.rec + (let k_ret := Nat.mul 2 (Nat.mod v 2) + CallOutcome.Returned false k_ret (FastCells.block B pow2B max_v v_new F_next ns rest)) + (CallOutcome.rec + CallOutcome.Failed + (fun b k_ret ys_ret => + let ret_k := Bool.rec 2 1 b + let f_add := Bool.rec k_ret (Nat.add k_ret 1) b + CallOutcome.Returned b ret_k (FastCells.block B pow2B max_v v_new (Nat.add F_next f_add) ns ys_ret)) + CallOutcome.Stopped + ih) + (Nat.beq (Nat.add P 1) pow2B)) + (Nat.ble v_new max_v)) + xs + +def call_fast_spec (r : ListBlank (Fin 2)) : CallOutcome → Prop + | CallOutcome.Failed => True + | CallOutcome.Stopped => SideHalt r + | CallOutcome.Returned b k ys => Side b r ((W ^ k) +> words_tape (to_cells ys)) ∧ WF ys + +theorem unpack_block_call_overflow (ns : List Nat) (v max_v F_next : Nat) (rest : FastCells) + (hv : v + 1 ≤ max_v) (hwf : WF_ns max_v F_next ns) + (hov : (v + 1) / (2 ^ ns.length) = v / (2 ^ ns.length) + 1) + (out : CallOutcome) (hout : call_fast_spec (words_tape (to_cells rest)) out) + (B pow2B : Nat) (hpow : pow2B = 2 ^ ns.length) : + call_fast_spec (words_tape (unpack_block v F_next ns (to_cells rest))) + (CallOutcome.rec + CallOutcome.Failed + (fun b k_ret ys_ret => + let ret_k := Bool.rec 2 1 b + let f_add := Bool.rec k_ret (Nat.add k_ret 1) b + CallOutcome.Returned b ret_k (FastCells.block B pow2B max_v (Nat.add v 1) (Nat.add F_next f_add) ns ys_ret)) + CallOutcome.Stopped + out) := by + have haux : ∀ (ns : List Nat) (v max_v : Nat), + v + 1 ≤ max_v → WF_ns max_v F_next ns → + (v + 1) / (2 ^ ns.length) = v / (2 ^ ns.length) + 1 → + match out with + | CallOutcome.Failed => True + | CallOutcome.Stopped => SideHalt (words_tape (unpack_block v F_next ns (to_cells rest))) + | CallOutcome.Returned b k_ret ys_ret => + Side b (words_tape (unpack_block v F_next ns (to_cells rest))) + ((W ^ (Bool.rec 2 1 b : Nat)) +> + words_tape (unpack_block (v + 1) (F_next + (Bool.rec k_ret (k_ret + 1) b : Nat)) ns (to_cells ys_ret))) := by + intro ns + induction ns with + | nil => intros; contradiction + | cons n0 tail_ns ih => + intro v max_v hv hwf hov + cases tail_ns with + | nil => + change (v + 1) / 2 = v / 2 + 1 at hov + have hns0 := hwf (v + 1) hv + have hp1 : Nat.beq (Nat.mod v 2) 1 = true := Nat.beq_eq.mpr (by omega_fast) + have hp0 : Nat.beq (Nat.mod (v + 1) 2) 1 = false := by + cases hbeq : Nat.beq (Nat.mod (v + 1) 2) 1 + · rfl + · have := Nat.beq_eq.mp hbeq; omega_fast + let m0 := Nat.sub (Nat.add n0 F_next) (Nat.mul 2 (Nat.div v 2)) + have hm0_ge2 : 2 ≤ m0 := by change 2 ≤ (n0 + F_next) - 2 * (v / 2); omega_fast + have hlhs : ([0, 0, 1, 0, 1] : List (Fin 2)) +> ((W ^ (m0 - 2)) +> words_tape (to_cells rest)) = + words_tape (unpack_block v F_next [n0] (to_cells rest)) := by + have hm_eq : m0 = 2 + (m0 - 2) := by omega_fast + change ([0, 0, 1, 0, 1] : List (Fin 2)) +> ((W ^ (m0 - 2)) +> words_tape (to_cells rest)) = + (bit (Nat.beq (Nat.mod v 2) 1)) +> ((W ^ m0) +> words_tape (to_cells rest)) + rw [hp1] + change (bit true) +> ((W ^ 2) +> ((W ^ (m0 - 2)) +> words_tape (to_cells rest))) = + (bit true) +> ((W ^ m0) +> words_tape (to_cells rest)) + rw [← pow_append_tape W 2 (m0 - 2), ← hm_eq] + cases out with + | Failed => trivial + | Stopped => + have h1 := wall_halt (m0 - 2) hout + have h2 := carry_halt h1 + rw [hlhs] at h2 + exact h2 + | Returned b k_ret ys_ret => + rcases hout with ⟨hout_s, _⟩ + have h1 := wall_side b (m0 - 2) hout_s + have h2 := carry_side b h1 + rw [hlhs] at h2 + cases b + · dsimp only at h2 ⊢ + have hm'_eq : Nat.sub (Nat.add n0 (F_next + k_ret)) (Nat.mul 2 (Nat.div (v + 1) 2)) = (m0 - 2) + k_ret := by + change (n0 + (F_next + k_ret)) - 2 * ((v + 1) / 2) = (((n0 + F_next) - 2 * (v / 2)) - 2) + k_ret + omega_fast + have hrhs : ([0, 1, 0, 1, 1] : List (Fin 2)) +> + ((W ^ (m0 - 2)) +> ((W ^ k_ret) +> words_tape (to_cells ys_ret))) = + (W ^ 2) +> words_tape (unpack_block (v + 1) (F_next + k_ret) [n0] (to_cells ys_ret)) := by + change _ = (W ^ 2) +> ((bit (Nat.beq (Nat.mod (v + 1) 2) 1)) +> + ((W ^ Nat.sub (Nat.add n0 (F_next + k_ret)) (Nat.mul 2 (Nat.div (v + 1) 2))) +> words_tape (to_cells ys_ret))) + rw [hp0, hm'_eq, pow_append_tape W (m0 - 2) k_ret] + rfl + rw [← hrhs] + exact h2 + · dsimp only at h2 ⊢ + have hm'_eq : Nat.sub (Nat.add n0 (F_next + (k_ret + 1))) (Nat.mul 2 (Nat.div (v + 1) 2)) = 1 + ((m0 - 2) + k_ret) := by + change (n0 + (F_next + (k_ret + 1))) - 2 * ((v + 1) / 2) = 1 + ((((n0 + F_next) - 2 * (v / 2)) - 2) + k_ret) + omega_fast + have hrhs : ([0, 1, 1, 0, 1] : List (Fin 2)) +> + ((W ^ (m0 - 2)) +> ((W ^ k_ret) +> words_tape (to_cells ys_ret))) = + (W ^ 1) +> words_tape (unpack_block (v + 1) (F_next + (k_ret + 1)) [n0] (to_cells ys_ret)) := by + change _ = (W ^ 1) +> ((bit (Nat.beq (Nat.mod (v + 1) 2) 1)) +> + ((W ^ Nat.sub (Nat.add n0 (F_next + (k_ret + 1))) (Nat.mul 2 (Nat.div (v + 1) 2))) +> words_tape (to_cells ys_ret))) + rw [hp0, hm'_eq, pow_append_tape W 1 ((m0 - 2) + k_ret), pow_append_tape W (m0 - 2) k_ret] + rfl + rw [← hrhs] + exact h2 + | cons n1 tail2 => + rcases hwf with ⟨hns0, hns_tail⟩ + have hdiv_eq : ∀ x : Nat, x / (2 ^ (n0 :: n1 :: tail2).length) = (x / 2) / (2 ^ (n1 :: tail2).length) := by + intro x + rw [List.length_cons, Nat.pow_succ, Nat.mul_comm, ← Nat.div_div_eq_div_mul] + rw [hdiv_eq (v + 1), hdiv_eq v] at hov + have hv_div : (v + 1) / 2 = v / 2 + 1 := by + by_cases h : (v + 1) / 2 = v / 2 + · rw [h] at hov; omega_fast + · omega_fast + rw [hv_div] at hov + have h_ih := ih (v / 2) (max_v / 2) (by omega_fast) hns_tail hov + have hdiv_eq2 : ∀ x : Nat, x / (2 ^ (n1 :: tail2).length) = (x / 2) / (2 ^ tail2.length) := by + intro x + rw [List.length_cons, Nat.pow_succ, Nat.mul_comm, ← Nat.div_div_eq_div_mul] + have hov2 := hov + rw [hdiv_eq2 (v / 2 + 1), hdiv_eq2 (v / 2)] at hov2 + have hv_div2 : (v / 2 + 1) / 2 = (v / 2) / 2 + 1 := by + by_cases h : (v / 2 + 1) / 2 = (v / 2) / 2 + · rw [h] at hov2; omega_fast + · omega_fast + have hp1 : Nat.beq (Nat.mod v 2) 1 = true := Nat.beq_eq.mpr (by omega_fast) + have hp0 : Nat.beq (Nat.mod (v + 1) 2) 1 = false := by + cases hbeq : Nat.beq (Nat.mod (v + 1) 2) 1 + · rfl + · have := Nat.beq_eq.mp hbeq; omega_fast + let m0 := Nat.sub (Nat.add n0 (Nat.mul 2 (Nat.div (Nat.div v 2) 2))) (Nat.mul 2 (Nat.div v 2)) + have hm0_ge2 : 2 ≤ m0 := by + have := hns0 (v + 1) hv + change 2 ≤ (n0 + 2 * ((v / 2) / 2)) - 2 * (v / 2) + omega_fast + have hlhs : ([0, 0, 1, 0, 1] : List (Fin 2)) +> ((W ^ (m0 - 2)) +> words_tape (unpack_block (v / 2) F_next (n1 :: tail2) (to_cells rest))) = + words_tape (unpack_block v F_next (n0 :: n1 :: tail2) (to_cells rest)) := by + have hm_eq : m0 = 2 + (m0 - 2) := by omega_fast + change ([0, 0, 1, 0, 1] : List (Fin 2)) +> ((W ^ (m0 - 2)) +> words_tape (unpack_block (v / 2) F_next (n1 :: tail2) (to_cells rest))) = + (bit (Nat.beq (Nat.mod v 2) 1)) +> ((W ^ m0) +> words_tape (unpack_block (v / 2) F_next (n1 :: tail2) (to_cells rest))) + rw [hp1] + change (bit true) +> ((W ^ 2) +> ((W ^ (m0 - 2)) +> words_tape (unpack_block (v / 2) F_next (n1 :: tail2) (to_cells rest)))) = + (bit true) +> ((W ^ m0) +> words_tape (unpack_block (v / 2) F_next (n1 :: tail2) (to_cells rest))) + rw [← pow_append_tape W 2 (m0 - 2), ← hm_eq] + cases out with + | Failed => trivial + | Stopped => + have h1 := wall_halt (m0 - 2) h_ih + have h2 := carry_halt h1 + rw [hlhs] at h2 + exact h2 + | Returned b k_ret ys_ret => + have h1 := wall_side b (m0 - 2) h_ih + have h2 := carry_side b h1 + rw [hlhs] at h2 + have hm'_eq : Nat.sub (Nat.add n0 (Nat.mul 2 (Nat.div (Nat.div (v + 1) 2) 2))) (Nat.mul 2 (Nat.div (v + 1) 2)) = m0 := by + have := hns0 (v + 1) hv + change (n0 + 2 * (((v + 1) / 2) / 2)) - 2 * ((v + 1) / 2) = (n0 + 2 * ((v / 2) / 2)) - 2 * (v / 2) + omega_fast + cases b + · dsimp only at h_ih h2 ⊢ + have hm_add : (m0 - 2) + 2 = m0 := by omega_fast + have hrhs : ([0, 1, 0, 1, 1] : List (Fin 2)) +> + ((W ^ (m0 - 2)) +> ((W ^ 2) +> words_tape (unpack_block (v / 2 + 1) (F_next + k_ret) (n1 :: tail2) (to_cells ys_ret)))) = + (W ^ 2) +> words_tape (unpack_block (v + 1) (F_next + k_ret) (n0 :: n1 :: tail2) (to_cells ys_ret)) := by + change _ = (W ^ 2) +> ((bit (Nat.beq (Nat.mod (v + 1) 2) 1)) +> + ((W ^ Nat.sub (Nat.add n0 (Nat.mul 2 (Nat.div (Nat.div (v + 1) 2) 2))) (Nat.mul 2 (Nat.div (v + 1) 2))) +> + words_tape (unpack_block (Nat.div (v + 1) 2) (F_next + k_ret) (n1 :: tail2) (to_cells ys_ret)))) + rw [hp0, hm'_eq, nat_div_eq, hv_div, ← pow_append_tape W (m0 - 2) 2, hm_add] + rfl + rw [← hrhs] + exact h2 + · dsimp only at h_ih h2 ⊢ + have hm_add : 1 + ((m0 - 2) + 1) = m0 := by omega_fast + have hrhs : ([0, 1, 1, 0, 1] : List (Fin 2)) +> + ((W ^ (m0 - 2)) +> ((W ^ 1) +> words_tape (unpack_block (v / 2 + 1) (F_next + (k_ret + 1)) (n1 :: tail2) (to_cells ys_ret)))) = + (W ^ 1) +> words_tape (unpack_block (v + 1) (F_next + (k_ret + 1)) (n0 :: n1 :: tail2) (to_cells ys_ret)) := by + change _ = (W ^ 1) +> ((bit (Nat.beq (Nat.mod (v + 1) 2) 1)) +> + ((W ^ Nat.sub (Nat.add n0 (Nat.mul 2 (Nat.div (Nat.div (v + 1) 2) 2))) (Nat.mul 2 (Nat.div (v + 1) 2))) +> + words_tape (unpack_block (Nat.div (v + 1) 2) (F_next + (k_ret + 1)) (n1 :: tail2) (to_cells ys_ret)))) + rw [hp0, hm'_eq, nat_div_eq, hv_div] + change (W ^ 1) +> ((bit false) +> ((W ^ 1) +> ((W ^ (m0 - 2)) +> ((W ^ 1) +> + words_tape (unpack_block (v / 2 + 1) (F_next + (k_ret + 1)) (n1 :: tail2) (to_cells ys_ret)))))) = + (W ^ 1) +> ((bit false) +> ((W ^ m0) +> + words_tape (unpack_block (v / 2 + 1) (F_next + (k_ret + 1)) (n1 :: tail2) (to_cells ys_ret)))) + rw [← pow_append_tape W (m0 - 2) 1, ← pow_append_tape W 1 ((m0 - 2) + 1), hm_add] + rw [← hrhs] + exact h2 + have hmain := haux ns v max_v hv hwf hov + cases out with + | Failed => trivial + | Stopped => exact hmain + | Returned b k_ret ys_ret => + rcases hout with ⟨_, hy_wf⟩ + refine ⟨hmain, ⟨hpow, hv, wf_ns_mono (Nat.le_refl _) ?_ hwf⟩, hy_wf⟩ + cases b <;> dsimp <;> omega_fast + +theorem call_cells_fast_spec (xs : FastCells) (hwf : WF xs) : + call_fast_spec (words_tape (to_cells xs)) (call_cells xs) := by + induction xs with + | nil => + unfold call_cells call_fast_spec + have h0 := leaf0_side default + rw [← default_eq_zero_three] at h0 + exact ⟨h0, trivial⟩ + | cell p n rest ih => + change call_fast_spec (words_tape ((p, n) :: to_cells rest)) (call_cells (FastCells.cell p n rest)) + cases p + · -- p = false + dsimp only [call_cells] + have hpc := push_cell_fast_spec true 0 n rest hwf + generalize hpush : push_cell true 0 n rest = push_res at hpc ⊢ + rcases push_res with ⟨k', xs'⟩ + rcases hpc with ⟨hpc_t, hpc_w⟩ + dsimp only [call_fast_spec] + rw [Nat.zero_add] at hpc_t + rw [hpc_t] + exact ⟨inc_side ((W ^ n) +> words_tape (to_cells rest)), hpc_w⟩ + · -- p = true + have h_ih := ih hwf + dsimp only [call_cells] + cases hn2 : Nat.ble 2 n + · -- n < 2 + dsimp only + cases hrw1 : remove_word [0, 0, 0] 0 (FastCells.cell true n rest) with + | some k1 xs1 => + dsimp only + rcases remove_word_fast_spec [0, 0, 0] 0 (FastCells.cell true n rest) hwf k1 xs1 hrw1 with ⟨hrw_t, hrw_w⟩ + have hpw := put_word_fast_spec [0, 1, 1] k1 xs1 hrw_w + generalize hput : put_word [0, 1, 1] k1 xs1 = pw_res at hpw ⊢ + rcases pw_res with ⟨k', xs'⟩ + rcases hpw with ⟨hpw_t, hpw_w⟩ + dsimp only [call_fast_spec] + change words_tape ((true, n) :: to_cells rest) = ([0, 0, 0] : List (Fin 2)) +> ((W ^ k1) +> words_tape (to_cells xs1)) at hrw_t + change (W ^ k') +> words_tape (to_cells xs') = ([0, 1, 1] : List (Fin 2)) +> ((W ^ k1) +> words_tape (to_cells xs1)) at hpw_t + rw [hpw_t, hrw_t] + exact ⟨leaf0_side ((W ^ k1) +> words_tape (to_cells xs1)), hpw_w⟩ + | none => + dsimp only + cases hrw2 : remove_word [0, 0, 1, 0, 0] 0 (FastCells.cell true n rest) with + | some k2 xs2 => + dsimp only + rcases remove_word_fast_spec [0, 0, 1, 0, 0] 0 (FastCells.cell true n rest) hwf k2 xs2 hrw2 with ⟨hrw_t, hrw_w⟩ + have hpw := put_word_fast_spec [1, 0, 1, 0, 0] k2 xs2 hrw_w + generalize hput : put_word [1, 0, 1, 0, 0] k2 xs2 = pw_res at hpw ⊢ + rcases pw_res with ⟨k', xs'⟩ + rcases hpw with ⟨hpw_t, hpw_w⟩ + dsimp only [call_fast_spec] + change words_tape ((true, n) :: to_cells rest) = ([0, 0, 1, 0, 0] : List (Fin 2)) +> ((W ^ k2) +> words_tape (to_cells xs2)) at hrw_t + change (W ^ k') +> words_tape (to_cells xs') = ([1, 0, 1, 0, 0] : List (Fin 2)) +> ((W ^ k2) +> words_tape (to_cells xs2)) at hpw_t + rw [hpw_t, hrw_t] + exact ⟨leaf1_side ((W ^ k2) +> words_tape (to_cells xs2)), hpw_w⟩ + | none => + dsimp only + cases hrw3 : remove_word [0, 0, 1, 1] 0 (FastCells.cell true n rest) with + | some k3 xs3 => + rcases remove_word_fast_spec [0, 0, 1, 1] 0 (FastCells.cell true n rest) hwf k3 xs3 hrw3 with ⟨hrw_t, _⟩ + dsimp only [call_fast_spec] + change words_tape ((true, n) :: to_cells rest) = ([0, 0, 1, 1] : List (Fin 2)) +> ((W ^ k3) +> words_tape (to_cells xs3)) at hrw_t + rw [hrw_t] + exact stop_halt ((W ^ k3) +> words_tape (to_cells xs3)) + | none => trivial + · -- 2 ≤ n + dsimp only + have hn_ge2 : 2 ≤ n := Nat.ble_eq.mp hn2 + have hlhs : ([0, 0, 1, 0, 1] : List (Fin 2)) +> ((W ^ (n - 2)) +> words_tape (to_cells rest)) = + words_tape ((true, n) :: to_cells rest) := by + have hn_eq : n = 2 + (n - 2) := by omega_fast + change (bit true) +> ((W ^ 2) +> ((W ^ (n - 2)) +> words_tape (to_cells rest))) = + (bit true) +> ((W ^ n) +> words_tape (to_cells rest)) + rw [← pow_append_tape W 2 (n - 2), ← hn_eq] + change call_fast_spec (words_tape ((true, n) :: to_cells rest)) (CallOutcome.rec _ _ _ (call_cells rest)) + generalize hcc : call_cells rest = out at h_ih ⊢ + cases out with + | Failed => trivial + | Stopped => + have h1 := wall_halt (n - 2) h_ih + have h2 := carry_halt h1 + rw [hlhs] at h2 + exact h2 + | Returned b k_ret ys_ret => + rcases h_ih with ⟨h_ih_s, h_ih_w⟩ + have h1 := wall_side b (n - 2) h_ih_s + have h2 := carry_side b h1 + rw [hlhs] at h2 + cases b + · dsimp only [call_fast_spec] at h2 ⊢ + have hrhs : ([0, 1, 0, 1, 1] : List (Fin 2)) +> + ((W ^ (n - 2)) +> ((W ^ k_ret) +> words_tape (to_cells ys_ret))) = + (W ^ 2) +> words_tape (to_cells (FastCells.cell false (Nat.add (Nat.sub n 2) k_ret) ys_ret)) := by + change _ = (W ^ 2) +> ((bit false) +> ((W ^ ((n - 2) + k_ret)) +> words_tape (to_cells ys_ret))) + rw [pow_append_tape W (n - 2) k_ret] + rfl + rw [← hrhs] + exact ⟨h2, h_ih_w⟩ + · dsimp only [call_fast_spec] at h2 ⊢ + have hrhs : ([0, 1, 1, 0, 1] : List (Fin 2)) +> + ((W ^ (n - 2)) +> ((W ^ k_ret) +> words_tape (to_cells ys_ret))) = + (W ^ 1) +> words_tape (to_cells (FastCells.cell false (Nat.add 1 (Nat.add (Nat.sub n 2) k_ret)) ys_ret)) := by + change _ = (W ^ 1) +> ((bit false) +> ((W ^ (1 + ((n - 2) + k_ret))) +> words_tape (to_cells ys_ret))) + rw [pow_append_tape W 1 ((n - 2) + k_ret), pow_append_tape W (n - 2) k_ret] + rfl + rw [← hrhs] + exact ⟨h2, h_ih_w⟩ + | block B pow2B max_v v F_next ns rest ih => + rcases hwf with ⟨⟨hpow, hv, hns⟩, hrest⟩ + have h_ih := ih hrest + dsimp only [call_cells] + cases hv1 : Nat.ble (Nat.add v 1) max_v + · trivial + · dsimp only + have hv_le : v + 1 ≤ max_v := Nat.ble_eq.mp hv1 + cases hov_b : Nat.beq (Nat.add (Nat.mod v pow2B) 1) pow2B + · -- No overflow + dsimp only [call_fast_spec] + have hne : v % (2 ^ ns.length) + 1 ≠ 2 ^ ns.length := by + intro heq + rw [← hpow] at heq + have htrue : Nat.beq (Nat.add (Nat.mod v pow2B) 1) pow2B = true := Nat.beq_eq.mpr heq + rw [htrue] at hov_b; contradiction + have hdiv_eq := div_succ_of_mod_ne v (2 ^ ns.length) (pow2_pos ns) hne + have hsub0 : (v + 1) / (2 ^ ns.length) - v / (2 ^ ns.length) = 0 := by omega_fast + have hB0 : Batch ((v + 1) / (2 ^ ns.length) - v / (2 ^ ns.length)) (to_cells rest) 0 (to_cells rest) := by + rw [hsub0]; exact batch_refl (to_cells rest) + have hB1 := unpack_block_batch ns v (v + 1) max_v F_next 0 (to_cells rest) (to_cells rest) + (by omega_fast) hv_le hns hB0 + have hv_sub1 : (v + 1) - v = 1 := by omega_fast + have hv_div2 : 2 * ((v + 1) / 2 - v / 2) = Nat.mul 2 (Nat.mod v 2) := by omega_fast + rw [hv_sub1, hv_div2, Nat.add_zero] at hB1 + exact ⟨batch_one hB1, ⟨hpow, hv_le, hns⟩, hrest⟩ + · -- Overflow + dsimp only + have heq : v % (2 ^ ns.length) + 1 = 2 ^ ns.length := by + have := Nat.beq_eq.mp hov_b + rw [hpow] at this + exact this + have hdiv_eq := div_succ_of_mod_eq v (2 ^ ns.length) (pow2_pos ns) heq + exact unpack_block_call_overflow ns v max_v F_next rest hv_le hns hdiv_eq (call_cells rest) h_ih B pow2B hpow + +def batch_fused_ub (xs : FastCells) (ub : Nat) : FusedRes := + FastCells.rec + (fun _ => FusedRes.mk 0 0 0 FastCells.nil) + (fun p n rest ih ub => + Bool.rec + (Bool.rec + (let q := first_bit rest + let bound := Nat.sub (Nat.mul 2 (Nat.add (Nat.mul 2 (Nat.div n 2)) (bval(q)))) (Nat.add (bval(p)) 1) + let cur_ub := natMin(bound, ub) + Bool.rec + (let next_ub := Nat.div (Nat.add cur_ub (bval(p))) 2 + FusedRes.rec + (fun rl f k_extra ys_norm => + Bool.rec + (let cap := Bool.rec (Nat.add (Nat.mul 2 rl) 1) (Nat.mul 2 rl) p + let t := natMin(cur_ub, cap) + let k2 := Nat.mul rl 2 + PushRes.rec + (fun k_pc ys_pc => FusedRes.mk t k2 k_pc ys_pc) + (push_cell (Nat.beq (Nat.mod (Nat.add t (bval(p))) 2) 1) (Nat.sub (Nat.add n f) k2) k_extra ys_norm)) + (FusedRes.mk 0 0 0 (FastCells.cell p n rest)) + (and p (Nat.beq rl 0))) + (ih next_ub)) + (FusedRes.mk 0 0 0 (FastCells.cell p n rest)) + (Nat.beq cur_ub 0)) + (Bool.rec + (PushRes.rec (fun k_pc ys_pc => FusedRes.mk 1 0 k_pc ys_pc) (push_cell true n 0 rest)) + (FusedRes.mk 0 0 0 (FastCells.cell p n rest)) + p) + (or (is_nil rest) (Nat.ble n 1))) + (FusedRes.mk 0 0 0 (FastCells.cell p n rest)) + (Nat.beq ub 0)) + (fun B pow2B max_v v F_next ns rest ih ub => + Bool.rec + (let P := Nat.mod v pow2B + let next_ub := Nat.div (Nat.add ub P) pow2B + Bool.rec + (FusedRes.rec + (fun rl f k_extra ys_norm => + let cap := Nat.add (Nat.mul rl pow2B) (Nat.sub (Nat.sub pow2B 1) P) + let t := natMin(ub, cap) + let v_new := Nat.add v t + Bool.rec + (FusedRes.mk 0 0 0 (FastCells.block B pow2B max_v v F_next ns rest)) + (let e_out := Nat.mul 2 (Nat.sub (Nat.div v_new 2) (Nat.div v 2)) + FusedRes.mk t e_out 0 (FastCells.block B pow2B max_v v_new (Nat.add (Nat.add F_next f) k_extra) ns ys_norm)) + (Nat.ble v_new max_v)) + (ih next_ub)) + (let v_new := Nat.add v ub + Bool.rec + (FusedRes.mk 0 0 0 (FastCells.block B pow2B max_v v F_next ns rest)) + (let e_out := Nat.mul 2 (Nat.sub (Nat.div v_new 2) (Nat.div v 2)) + FusedRes.mk ub e_out 0 (FastCells.block B pow2B max_v v_new F_next ns rest)) + (Nat.ble v_new max_v)) + (Nat.beq next_ub 0)) + (FusedRes.mk 0 0 0 (FastCells.block B pow2B max_v v F_next ns rest)) + (Nat.beq ub 0)) + xs ub + +def batch_fused_top (xs : FastCells) : FusedRes := + FastCells.rec + (FusedRes.mk 0 0 0 FastCells.nil) + (fun p n rest _ => + Bool.rec + (let q := first_bit rest + let bound := Nat.sub (Nat.mul 2 (Nat.add (Nat.mul 2 (Nat.div n 2)) (bval(q)))) (Nat.add (bval(p)) 1) + Bool.rec + (let next_ub := Nat.div (Nat.add bound (bval(p))) 2 + FusedRes.rec + (fun rl f k_extra ys_norm => + Bool.rec + (let cap := Bool.rec (Nat.add (Nat.mul 2 rl) 1) (Nat.mul 2 rl) p + let t := natMin(bound, cap) + let k2 := Nat.mul rl 2 + PushRes.rec + (fun k_pc ys_pc => FusedRes.mk t k2 k_pc ys_pc) + (push_cell (Nat.beq (Nat.mod (Nat.add t (bval(p))) 2) 1) (Nat.sub (Nat.add n f) k2) k_extra ys_norm)) + (FusedRes.mk 0 0 0 (FastCells.cell p n rest)) + (and p (Nat.beq rl 0))) + (batch_fused_ub rest next_ub)) + (FusedRes.mk 0 0 0 (FastCells.cell p n rest)) + (Nat.beq bound 0)) + (Bool.rec + (PushRes.rec (fun k_pc ys_pc => FusedRes.mk 1 0 k_pc ys_pc) (push_cell true n 0 rest)) + (FusedRes.mk 0 0 0 (FastCells.cell p n rest)) + p) + (or (is_nil rest) (Nat.ble n 1))) + (fun B pow2B max_v v F_next ns rest _ => + FusedRes.mk 0 0 0 (FastCells.block B pow2B max_v v F_next ns rest)) + xs + +@[simp] theorem bval_false : bval false = 0 := rfl +@[simp] theorem bval_true : bval true = 1 := rfl + +theorem natMin_spec (a b : Nat) : + (natMin(a, b)) ≤ a ∧ (natMin(a, b)) ≤ b ∧ ((natMin(a, b)) = a ∨ (natMin(a, b)) = b) := by + cases h : Nat.ble a b + · refine ⟨?_, Nat.le_refl _, Or.inr rfl⟩ + have hnot : ¬ (a ≤ b) := fun hle => by rw [Nat.ble_eq.mpr hle] at h; contradiction + omega_fast + · exact ⟨Nat.le_refl _, Nat.ble_eq.mp h, Or.inl rfl⟩ + +theorem div_sub_of_next_ub_zero (v ub d : Nat) (hd : 0 < d) (h0 : (ub + v % d) / d = 0) : + (v + ub) / d - v / d = 0 := by + have hlt : ub + v % d < d := by + have hdiv := Nat.div_add_mod (ub + v % d) d + have hmod := Nat.mod_lt (ub + v % d) hd + rw [h0] at hdiv + omega_fast + have h1 : v + ub = d * (v / d) + (ub + v % d) := by + have := Nat.div_add_mod v d + omega_fast + rw [h1, Nat.mul_add_div hd, Nat.div_eq_of_lt hlt] + omega_fast + +theorem div_sub_of_cap (v ub rl d : Nat) (hd : 0 < d) + (hrl : rl ≤ (ub + v % d) / d) : + (v + natMin(ub, rl * d + (d - 1 - v % d))) / d - v / d = rl ∧ + natMin(ub, rl * d + (d - 1 - v % d)) ≤ ub := by + have hP : v % d < d := Nat.mod_lt v hd + have ht_ub := natMin_spec ub (rl * d + (d - 1 - v % d)) + generalize ht : (natMin(ub, rl * d + (d - 1 - v % d))) = t at ht_ub ⊢ + rcases ht_ub with ⟨ht_le_ub, ht_le_cap, ht_or⟩ + have h1 : v + t = d * (v / d + (v % d + t) / d) + (v % d + t) % d := by + have hv_eq := Nat.div_add_mod v d + have hpt_eq := Nat.div_add_mod (v % d + t) d + have hmul : d * (v / d + (v % d + t) / d) = d * (v / d) + d * ((v % d + t) / d) := Nat.left_distrib d _ _ + omega_fast + have hdiv_vt : (v + t) / d = v / d + (v % d + t) / d := by + rw [h1, Nat.mul_add_div hd, Nat.div_eq_of_lt (Nat.mod_lt _ hd), Nat.add_zero] + have hq_eq : (v % d + t) / d = rl := by + have hpt_eq := Nat.div_add_mod (v % d + t) d + have hpt_mod := Nat.mod_lt (v % d + t) hd + generalize hq : (v % d + t) / d = q at hpt_eq + generalize hr : (v % d + t) % d = r at hpt_eq hpt_mod + have hub_eq := Nat.div_add_mod (ub + v % d) d + have hub_mod := Nat.mod_lt (ub + v % d) hd + have hmul_rl : d * rl ≤ d * ((ub + v % d) / d) := Nat.mul_le_mul_left d hrl + have hmul_comm : rl * d = d * rl := Nat.mul_comm rl d + have h_low : d * rl ≤ v % d + t := by + rcases ht_or with htu | htc <;> omega_fast + have h_high : v % d + t < d * rl + d := by omega_fast + by_cases hlt1 : q < rl + · have hm1 : d * (q + 1) ≤ d * rl := Nat.mul_le_mul_left d (by omega_fast) + have hm2 : d * (q + 1) = d * q + d := Nat.mul_succ d q + omega_fast + · by_cases hlt2 : rl < q + · have hm1 : d * (rl + 1) ≤ d * q := Nat.mul_le_mul_left d (by omega_fast) + have hm2 : d * (rl + 1) = d * rl + d := Nat.mul_succ d rl + omega_fast + · omega_fast + rw [hdiv_vt, hq_eq] + exact ⟨by omega_fast, ht_le_ub⟩ + +def fused_spec_ub (xs : FastCells) (ub : Nat) : FusedRes → Prop + | FusedRes.mk t e k_extra ys_norm => + t ≤ ub ∧ WF ys_norm ∧ + ∃ ys, Batch t (to_cells xs) e ys ∧ + (W ^ k_extra) +> words_tape (to_cells ys_norm) = words_tape ys + +def fused_spec_top (xs : FastCells) : FusedRes → Prop + | FusedRes.mk t e k_extra ys_norm => + WF ys_norm ∧ + ∃ ys, Batch t (to_cells xs) e ys ∧ + (W ^ k_extra) +> words_tape (to_cells ys_norm) = words_tape ys + +theorem cell_fused_step (p : Bool) (n : Nat) (rest : FastCells) (hwf : WF rest) + (cur_ub : Nat) (hc_pos : 0 < cur_ub) + (hc_bound : cur_ub ≤ Nat.sub (Nat.mul 2 (Nat.add (Nat.mul 2 (Nat.div n 2)) (bval(first_bit rest)))) (Nat.add (bval(p)) 1)) + (res : FusedRes) (hres : fused_spec_ub rest (Nat.div (Nat.add cur_ub (bval(p))) 2) res) + (ub : Nat) (hub : cur_ub ≤ ub) : + fused_spec_ub (FastCells.cell p n rest) ub + (FusedRes.rec + (fun rl f k_extra ys_norm => + Bool.rec + (let cap := Bool.rec (Nat.add (Nat.mul 2 rl) 1) (Nat.mul 2 rl) p + let t := natMin(cur_ub, cap) + let k2 := Nat.mul rl 2 + PushRes.rec + (fun k_pc ys_pc => FusedRes.mk t k2 k_pc ys_pc) + (push_cell (Nat.beq (Nat.mod (Nat.add t (bval(p))) 2) 1) (Nat.sub (Nat.add n f) k2) k_extra ys_norm)) + (FusedRes.mk 0 0 0 (FastCells.cell p n rest)) + (and p (Nat.beq rl 0))) + res) := by + rcases res with ⟨rl, f, k_extra, ys_norm⟩ + rcases hres with ⟨hrl_ub, hys_wf, ys, hB, hW⟩ + dsimp only + cases hand : (and p (Nat.beq rl 0)) + · dsimp only + have hnot_p_rl0 : ¬ (p = true ∧ rl = 0) := by + rintro ⟨rfl, rfl⟩; contradiction + have ht_min := natMin_spec cur_ub (Bool.rec (Nat.add (Nat.mul 2 rl) 1) (Nat.mul 2 rl) p : Nat) + generalize ht : (natMin(cur_ub, (Bool.rec (Nat.add (Nat.mul 2 rl) 1) (Nat.mul 2 rl) p : Nat))) = t at ht_min ⊢ + rcases ht_min with ⟨ht_c, ht_cap, ht_or⟩ + have hpc := push_cell_fast_spec (Nat.beq (Nat.mod (Nat.add t (bval(p))) 2) 1) + (Nat.sub (Nat.add n f) (Nat.mul rl 2)) k_extra ys_norm hys_wf + generalize hpush : push_cell (Nat.beq (Nat.mod (Nat.add t (bval(p))) 2) 1) + (Nat.sub (Nat.add n f) (Nat.mul rl 2)) k_extra ys_norm = push_res at hpc ⊢ + rcases push_res with ⟨k_pc, ys_pc⟩ + rcases hpc with ⟨hpc_t, hpc_w⟩ + dsimp only [fused_spec_ub] + have hhead := batch_head hB + rcases batch_even hB with ⟨j, rfl⟩ + have hq_eq : first_bit rest = first_cell (to_cells rest) := first_bit_eq rest hwf + rw [hq_eq] at hc_bound + have harith : t + bval p = rl * 2 + bval (Nat.beq (Nat.mod (Nat.add t (bval(p))) 2) 1) ∧ + (rl = 0 ∨ rl + 2 ≤ n + bval (first_cell (to_cells rest)) + bval (first_cell ys)) ∧ + Nat.sub (Nat.add n (j * 2)) (Nat.mul rl 2) + rl * 2 = n + j * 2 := by + rw [bval_beq_mod2] + cases p <;> cases hfr : first_cell (to_cells rest) <;> cases hfy : first_cell ys <;> + simp only [hfr, hfy, bval_false, bval_true] at hc_bound hrl_ub hhead ht_cap ht_or hnot_p_rl0 ⊢ <;> omega_fast + refine ⟨Nat.le_trans ht_c hub, hpc_w, ((Nat.beq (Nat.mod (Nat.add t (bval(p))) 2) 1), Nat.sub (Nat.add n (j * 2)) (Nat.mul rl 2)) :: ys, ?_, ?_⟩ + · exact Batch.BCons t p n (to_cells rest) rl (Nat.beq (Nat.mod (Nat.add t (bval(p))) 2) 1) + (j * 2) ys (Nat.sub (Nat.add n (j * 2)) (Nat.mul rl 2)) + harith.1 hB harith.2.1 harith.2.2 + · rw [hpc_t, pow_append_tape, hW] + rfl + · dsimp only [fused_spec_ub] + exact ⟨Nat.zero_le ub, hwf, (p, n) :: to_cells rest, batch_refl _, rfl⟩ + +theorem batch_fused_ub_spec (xs : FastCells) (ub : Nat) (hwf : WF xs) : + fused_spec_ub xs ub (batch_fused_ub xs ub) := by + induction xs generalizing ub with + | nil => + exact ⟨Nat.zero_le ub, trivial, [], Batch.BNil, rfl⟩ + | cell p n rest ih => + change fused_spec_ub (FastCells.cell p n rest) ub + (Bool.rec + (Bool.rec + (let q := first_bit rest + let bound := Nat.sub (Nat.mul 2 (Nat.add (Nat.mul 2 (Nat.div n 2)) (bval(q)))) (Nat.add (bval(p)) 1) + let cur_ub := natMin(bound, ub) + Bool.rec + (let next_ub := Nat.div (Nat.add cur_ub (bval(p))) 2 + FusedRes.rec + (fun rl f k_extra ys_norm => + Bool.rec + (let cap := Bool.rec (Nat.add (Nat.mul 2 rl) 1) (Nat.mul 2 rl) p + let t := natMin(cur_ub, cap) + let k2 := Nat.mul rl 2 + PushRes.rec + (fun k_pc ys_pc => FusedRes.mk t k2 k_pc ys_pc) + (push_cell (Nat.beq (Nat.mod (Nat.add t (bval(p))) 2) 1) (Nat.sub (Nat.add n f) k2) k_extra ys_norm)) + (FusedRes.mk 0 0 0 (FastCells.cell p n rest)) + (and p (Nat.beq rl 0))) + (batch_fused_ub rest next_ub)) + (FusedRes.mk 0 0 0 (FastCells.cell p n rest)) + (Nat.beq cur_ub 0)) + (Bool.rec + (PushRes.rec (fun k_pc ys_pc => FusedRes.mk 1 0 k_pc ys_pc) (push_cell true n 0 rest)) + (FusedRes.mk 0 0 0 (FastCells.cell p n rest)) + p) + (or (is_nil rest) (Nat.ble n 1))) + (FusedRes.mk 0 0 0 (FastCells.cell p n rest)) + (Nat.beq ub 0)) + cases hub0 : Nat.beq ub 0 + · dsimp only + cases hor : (or (is_nil rest) (Nat.ble n 1)) + · dsimp only + let q := first_bit rest + let bound := Nat.sub (Nat.mul 2 (Nat.add (Nat.mul 2 (Nat.div n 2)) (bval(q)))) (Nat.add (bval(p)) 1) + let cur_ub : Nat := natMin(bound, ub) + cases hcur0 : Nat.beq cur_ub 0 + · dsimp only + have hc_pos : 0 < cur_ub := by + have h0 : cur_ub ≠ 0 := fun h => by rw [Nat.beq_eq.mpr h] at hcur0; contradiction + omega_fast + have hmin := natMin_spec bound ub + exact cell_fused_step p n rest hwf cur_ub hc_pos hmin.1 + (batch_fused_ub rest (Nat.div (Nat.add cur_ub (bval(p))) 2)) + (ih (Nat.div (Nat.add cur_ub (bval(p))) 2) hwf) + ub hmin.2.1 + · exact ⟨Nat.zero_le ub, hwf, (p, n) :: to_cells rest, batch_refl _, rfl⟩ + · dsimp only + cases p + · dsimp only + have hpc := push_cell_fast_spec true n 0 rest hwf + generalize hpush : push_cell true n 0 rest = push_res at hpc ⊢ + rcases push_res with ⟨k_pc, ys_pc⟩ + rcases hpc with ⟨hpc_t, hpc_w⟩ + have hub_pos : 1 ≤ ub := by + have h0 : ub ≠ 0 := fun h => by rw [Nat.beq_eq.mpr h] at hub0; contradiction + omega_fast + refine ⟨hub_pos, hpc_w, (true, n) :: to_cells rest, ?_, ?_⟩ + · exact Batch.BCons 1 false n (to_cells rest) 0 true 0 (to_cells rest) n + rfl (batch_refl _) (Or.inl rfl) rfl + · rw [hpc_t, Nat.add_zero] + rfl + · exact ⟨Nat.zero_le ub, hwf, (true, n) :: to_cells rest, batch_refl _, rfl⟩ + · exact ⟨Nat.zero_le ub, hwf, (p, n) :: to_cells rest, batch_refl _, rfl⟩ + | block B pow2B max_v v F_next ns rest ih => + rcases hwf with ⟨⟨hpow, hv, hns⟩, hrest⟩ + have hd_pos : 0 < pow2B := by rw [hpow]; exact pow2_pos ns + change fused_spec_ub (FastCells.block B pow2B max_v v F_next ns rest) ub + (Bool.rec + (let P := Nat.mod v pow2B + let next_ub := Nat.div (Nat.add ub P) pow2B + Bool.rec + (FusedRes.rec + (fun rl f k_extra ys_norm => + let cap := Nat.add (Nat.mul rl pow2B) (Nat.sub (Nat.sub pow2B 1) P) + let t := natMin(ub, cap) + let v_new := Nat.add v t + Bool.rec + (FusedRes.mk 0 0 0 (FastCells.block B pow2B max_v v F_next ns rest)) + (let e_out := Nat.mul 2 (Nat.sub (Nat.div v_new 2) (Nat.div v 2)) + FusedRes.mk t e_out 0 (FastCells.block B pow2B max_v v_new (Nat.add (Nat.add F_next f) k_extra) ns ys_norm)) + (Nat.ble v_new max_v)) + (batch_fused_ub rest next_ub)) + (let v_new := Nat.add v ub + Bool.rec + (FusedRes.mk 0 0 0 (FastCells.block B pow2B max_v v F_next ns rest)) + (let e_out := Nat.mul 2 (Nat.sub (Nat.div v_new 2) (Nat.div v 2)) + FusedRes.mk ub e_out 0 (FastCells.block B pow2B max_v v_new F_next ns rest)) + (Nat.ble v_new max_v)) + (Nat.beq next_ub 0)) + (FusedRes.mk 0 0 0 (FastCells.block B pow2B max_v v F_next ns rest)) + (Nat.beq ub 0)) + cases hub0 : Nat.beq ub 0 + · dsimp only + let P := Nat.mod v pow2B + let next_ub := Nat.div (Nat.add ub P) pow2B + cases hnext0 : Nat.beq next_ub 0 + · -- next_ub > 0 + have h_ih := ih next_ub hrest + generalize hsub : batch_fused_ub rest next_ub = sub_res at h_ih ⊢ + rcases sub_res with ⟨rl, f, k_extra, ys_norm⟩ + rcases h_ih with ⟨hrl_le, hys_wf, ys_rest, hB, hW⟩ + dsimp only + have hcap := div_sub_of_cap v ub rl pow2B hd_pos (by simpa [nat_div_eq, nat_add_eq, nat_mod_eq] using! hrl_le) + let cap : Nat := Nat.add (Nat.mul rl pow2B) (Nat.sub (Nat.sub pow2B 1) P) + let t : Nat := natMin(ub, cap) + let v_new := Nat.add v t + cases hv_ble : Nat.ble v_new max_v + · exact ⟨Nat.zero_le ub, ⟨⟨hpow, hv, hns⟩, hrest⟩, to_cells (FastCells.block B pow2B max_v v F_next ns rest), batch_refl _, rfl⟩ + · dsimp only [fused_spec_ub] + have hv_new_le : v + t ≤ max_v := Nat.ble_eq.mp hv_ble + have hdiv_rl : (v + t) / (2 ^ ns.length) - v / (2 ^ ns.length) = rl := by + rw [← hpow] + exact hcap.1 + have hB_rl : Batch ((v + t) / (2 ^ ns.length) - v / (2 ^ ns.length)) (to_cells rest) f ys_rest := by + rw [hdiv_rl]; exact hB + have hB_blk := unpack_block_batch ns v (v + t) max_v F_next f (to_cells rest) ys_rest + (by omega_fast) hv_new_le hns hB_rl + have hvt_sub : (v + t) - v = t := by omega_fast + rw [hvt_sub] at hB_blk + have hwf_f : WF_ns max_v (F_next + f) ns := wf_ns_mono (Nat.le_refl _) (by omega_fast) hns + have habs := unpack_block_absorb_extra ns (v + t) max_v (F_next + f) k_extra + (to_cells ys_norm) ys_rest hv_new_le hwf_f hW + refine ⟨hcap.2, ⟨⟨hpow, hv_new_le, wf_ns_mono (Nat.le_refl _) (by omega_fast) hns⟩, hys_wf⟩, + unpack_block (v + t) (F_next + f) ns ys_rest, hB_blk, ?_⟩ + dsimp only [to_cells, words_tape, append_nil_tape, nat_add_eq] + exact habs + · -- next_ub == 0 + dsimp only + let v_new := Nat.add v ub + cases hv_ble : Nat.ble v_new max_v + · exact ⟨Nat.zero_le ub, ⟨⟨hpow, hv, hns⟩, hrest⟩, to_cells (FastCells.block B pow2B max_v v F_next ns rest), batch_refl _, rfl⟩ + · dsimp only [fused_spec_ub] + have hv_new_le : v + ub ≤ max_v := Nat.ble_eq.mp hv_ble + have hnext_eq0 : (ub + v % (2 ^ ns.length)) / (2 ^ ns.length) = 0 := by + have h0 := Nat.beq_eq.mp hnext0 + change (ub + v % pow2B) / pow2B = 0 at h0 + rw [hpow] at h0 + exact h0 + have hdiv0 := div_sub_of_next_ub_zero v ub (2 ^ ns.length) (pow2_pos ns) hnext_eq0 + have hB0 : Batch ((v + ub) / (2 ^ ns.length) - v / (2 ^ ns.length)) (to_cells rest) 0 (to_cells rest) := by + rw [hdiv0]; exact batch_refl (to_cells rest) + have hB_blk := unpack_block_batch ns v (v + ub) max_v F_next 0 (to_cells rest) (to_cells rest) + (by omega_fast) hv_new_le hns hB0 + have hvt_sub : (v + ub) - v = ub := by omega_fast + rw [hvt_sub, Nat.add_zero] at hB_blk + exact ⟨Nat.le_refl ub, ⟨⟨hpow, hv_new_le, hns⟩, hrest⟩, + unpack_block (v + ub) F_next ns (to_cells rest), hB_blk, rfl⟩ + · exact ⟨Nat.zero_le ub, ⟨⟨hpow, hv, hns⟩, hrest⟩, to_cells (FastCells.block B pow2B max_v v F_next ns rest), batch_refl _, rfl⟩ + +theorem fused_spec_top_of_ub {xs : FastCells} {ub : Nat} {res : FusedRes} (h : fused_spec_ub xs ub res) : + fused_spec_top xs res := by + rcases res with ⟨t, e, k_extra, ys_norm⟩ + exact h.2 + +theorem batch_fused_top_spec (xs : FastCells) (hwf : WF xs) : + fused_spec_top xs (batch_fused_top xs) := by + cases xs with + | nil => + exact ⟨trivial, [], Batch.BNil, rfl⟩ + | cell p n rest => + dsimp only [batch_fused_top] + cases hor : (or (is_nil rest) (Nat.ble n 1)) + · dsimp only + let q := first_bit rest + let bound := Nat.sub (Nat.mul 2 (Nat.add (Nat.mul 2 (Nat.div n 2)) (bval(q)))) (Nat.add (bval(p)) 1) + cases hbound0 : Nat.beq bound 0 + · dsimp only + have hb_pos : 0 < bound := by + have h0 : bound ≠ 0 := fun h => by rw [Nat.beq_eq.mpr h] at hbound0; contradiction + omega_fast + have hstep := cell_fused_step p n rest hwf bound hb_pos (Nat.le_refl bound) + (batch_fused_ub rest (Nat.div (Nat.add bound (bval(p))) 2)) + (batch_fused_ub_spec rest (Nat.div (Nat.add bound (bval(p))) 2) hwf) + bound (Nat.le_refl bound) + exact fused_spec_top_of_ub hstep + · exact ⟨hwf, (p, n) :: to_cells rest, batch_refl _, rfl⟩ + · dsimp only + cases p + · dsimp only + have hpc := push_cell_fast_spec true n 0 rest hwf + generalize hpush : push_cell true n 0 rest = push_res at hpc ⊢ + rcases push_res with ⟨k_pc, ys_pc⟩ + rcases hpc with ⟨hpc_t, hpc_w⟩ + refine ⟨hpc_w, (true, n) :: to_cells rest, ?_, ?_⟩ + · exact Batch.BCons 1 false n (to_cells rest) 0 true 0 (to_cells rest) n + rfl (batch_refl _) (Or.inl rfl) rfl + · rw [hpc_t, Nat.add_zero] + rfl + · exact ⟨hwf, (true, n) :: to_cells rest, batch_refl _, rfl⟩ + | block B pow2B max_v v F_next ns rest => + exact ⟨hwf, to_cells (FastCells.block B pow2B max_v v F_next ns rest), batch_refl _, rfl⟩ + +def step_call_only (k : Nat) (xs : FastCells) : StepRes := + CallOutcome.rec + (StepRes.running false k xs) + (fun b k_ret ys_ret => + let kk := Nat.add k k_ret + Bool.rec + (StepRes.running false (Nat.add 1 kk) ys_ret) + (PushRes.rec (fun k_pc ys_pc => + StepRes.running false (Nat.add 1 k_pc) ys_pc) + (push_cell true 0 kk ys_ret)) + b) + StepRes.halted + (call_cells xs) + +def step_state (skip_bulk : Bool) (k : Nat) (xs : FastCells) : StepRes := + Bool.rec + (FusedRes.rec + (fun t e k_extra ys => + Bool.rec + (step_call_only k xs) + (let k' := Nat.add (Nat.add (Nat.add k t) e) k_extra + Bool.rec + (StepRes.running false k' ys) + (StepRes.running true k' ys) + (Nat.beq k_extra 0)) + (Nat.ble 1 t)) + (batch_fused_top xs)) + (step_call_only k xs) + skip_bulk + +def run_chunk (fuel : Nat) (sb : Bool) (k : Nat) (xs : FastCells) : StepRes := + Nat.rec + (fun sb k xs => StepRes.running sb k xs) + (fun _ ih sb k xs => + StepRes.rec + StepRes.halted + (fun sb' k' xs' => ih sb' k' xs') + (step_state sb k xs)) + fuel sb k xs + +def run_outer (outer inner init_req : Nat) (sb : Bool) (k : Nat) (xs : FastCells) : Bool := + Nat.rec + (fun _ _ _ => false) + (fun _ ih sb k xs => + StepRes.rec + true + (fun sb' k' xs' => ih sb' k' (repack_cells init_req xs')) + (run_chunk inner sb k xs)) + outer sb k xs + +def step_res_spec (k : Nat) (xs : FastCells) : StepRes → Prop + | StepRes.halted => IsHaltFrom (denote_state k (to_cells xs)) + | StepRes.running _ k' xs' => + ((denote_state k (to_cells xs)) [holdout_0451_tm]⊢* (denote_state k' (to_cells xs'))) ∧ WF xs' + +theorem step_call_only_fast_spec (k : Nat) (xs : FastCells) (hwf : WF xs) : + step_res_spec k xs (step_call_only k xs) := by + unfold step_call_only + have hcc := call_cells_fast_spec xs hwf + generalize hc : call_cells xs = out at hcc ⊢ + cases out with + | Failed => exact ⟨reaches_refl _, hwf⟩ + | Stopped => exact wall_halt_start k hcc + | Returned b k_ret ys_ret => + rcases hcc with ⟨hcc_s, hcc_w⟩ + have h_wall := wall_side b k hcc_s + rw [← pow_append_tape] at h_wall + have h_emit := emit_side b h_wall + cases b + · dsimp only [step_res_spec] at h_emit ⊢ + have hrhs : (W +> ((W ^ (k + k_ret)) +> words_tape (to_cells ys_ret))) = + (W ^ (Nat.add 1 (Nat.add k k_ret))) +> words_tape (to_cells ys_ret) := by + dsimp only [nat_add_eq] + rw [pow_append_tape W 1 (k + k_ret)] + rfl + unfold denote_state + rw [← hrhs] + exact ⟨h_emit, hcc_w⟩ + · dsimp only at h_emit ⊢ + have hpc := push_cell_fast_spec true 0 (Nat.add k k_ret) ys_ret hcc_w + generalize hpush : push_cell true 0 (Nat.add k k_ret) ys_ret = push_res at hpc ⊢ + rcases push_res with ⟨k_pc, ys_pc⟩ + rcases hpc with ⟨hpc_t, hpc_w⟩ + dsimp only [step_res_spec] + rw [Nat.zero_add] at hpc_t + have hrhs : (([0, 1, 0] : List (Fin 2)) +> ((W ^ (k + k_ret)) +> words_tape (to_cells ys_ret))) = + (W ^ (Nat.add 1 k_pc)) +> words_tape (to_cells ys_pc) := by + change (W ++ bit true) +> ((W ^ (Nat.add k k_ret)) +> words_tape (to_cells ys_ret)) = + (W ^ (1 + k_pc)) +> words_tape (to_cells ys_pc) + rw [append_assoc_tape, ← hpc_t, pow_append_tape W 1 k_pc] + rfl + unfold denote_state + rw [← hrhs] + exact ⟨h_emit, hpc_w⟩ + +theorem step_state_fast_spec (skip_bulk : Bool) (k : Nat) (xs : FastCells) (hwf : WF xs) : + step_res_spec k xs (step_state skip_bulk k xs) := by + unfold step_state + cases skip_bulk + · dsimp only + have hf := batch_fused_top_spec xs hwf + generalize htop : batch_fused_top xs = res at hf ⊢ + rcases res with ⟨t, e, k_extra, ys_norm⟩ + rcases hf with ⟨hys_wf, ys, hB, hW⟩ + dsimp only + cases Nat.ble 1 t + · exact step_call_only_fast_spec k xs hwf + · dsimp only + have hsteps := batch_steps hB k + unfold denote_state at hsteps + rw [← hW, ← pow_append_tape] at hsteps + cases Nat.beq k_extra 0 <;> exact ⟨hsteps, hys_wf⟩ + · exact step_call_only_fast_spec k xs hwf + +theorem run_chunk_fast_spec (fuel : Nat) (sb : Bool) (k : Nat) (xs : FastCells) (hwf : WF xs) : + step_res_spec k xs (run_chunk fuel sb k xs) := by + induction fuel generalizing sb k xs with + | zero => exact ⟨reaches_refl _, hwf⟩ + | succ fuel ih => + change step_res_spec k xs (StepRes.rec StepRes.halted (fun sb' k' xs' => run_chunk fuel sb' k' xs') (step_state sb k xs)) + have hstep := step_state_fast_spec sb k xs hwf + generalize hs : step_state sb k xs = sres at hstep ⊢ + cases sres with + | halted => exact hstep + | running sb' k' xs' => + dsimp only + rcases hstep with ⟨h_reach, h_wf'⟩ + have h_ih := ih sb' k' xs' h_wf' + generalize hrc : run_chunk fuel sb' k' xs' = rc_res at h_ih ⊢ + cases rc_res with + | halted => exact isHaltFrom_of_reaches h_reach h_ih + | running sb'' k'' xs'' => + rcases h_ih with ⟨h_reach2, h_wf2⟩ + exact ⟨reaches_trans h_reach h_reach2, h_wf2⟩ + +theorem run_outer_fast_spec (outer inner init_req : Nat) (sb : Bool) (k : Nat) (xs : FastCells) + (hwf : WF xs) (h : run_outer outer inner init_req sb k xs = true) : + IsHaltFrom (denote_state k (to_cells xs)) := by + induction outer generalizing sb k xs with + | zero => contradiction + | succ outer ih => + change (StepRes.rec true (fun sb' k' xs' => run_outer outer inner init_req sb' k' (repack_cells init_req xs')) + (run_chunk inner sb k xs)) = true at h + have hrc := run_chunk_fast_spec inner sb k xs hwf + generalize hc : run_chunk inner sb k xs = rc_res at hrc h + cases rc_res with + | halted => exact hrc + | running sb' k' xs' => + rcases hrc with ⟨h_reach, h_wf'⟩ + rcases repack_cells_spec init_req xs' h_wf' with ⟨hrep_c, hrep_w⟩ + have h_ih := ih sb' k' (repack_cells init_req xs') hrep_w h + rw [hrep_c] at h_ih + exact isHaltFrom_of_reaches h_reach h_ih + + +set_option maxRecDepth 200000 in +theorem trajectory_halts : (run_outer 1273 60 24 false 2 FastCells.nil) = true := by decide +kernel + +theorem holdout_0451_halt : IsHalt holdout_0451_tm := by + have h := run_outer_fast_spec 1273 60 24 false 2 FastCells.nil trivial trajectory_halts + exact isHaltFrom_of_reaches init_reaches_start h + +end + + + +theorem is_halt : IsHalt target := holdout_0451_halt + +end BusyBeaver.M_1RB0RC_1LC1RF_1RA1LD_1RD0LE_1LD1LC_0REHHH diff --git a/BusyBeaver/BB6/Halt/M_1RB0RC_1RC0LD_1LD1RA_1LF0LE_HHH0RD_1LB0LA.lean b/BusyBeaver/BB6/Halt/M_1RB0RC_1RC0LD_1LD1RA_1LF0LE_HHH0RD_1LB0LA.lean new file mode 100644 index 00000000..a0e5639a --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB0RC_1RC0LD_1LD1RA_1LF0LE_HHH0RD_1LB0LA.lean @@ -0,0 +1,2462 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RC_1RC0LD_1LD1RA_1LF0LE_HHH0RD_1LB0LA + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RC_1RC0LD_1LD1RA_1LF0LE_HHH0RD_1LB0LA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (c : Cfg Γ Λ) : multiStep M c 0 = some c := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (c : Cfg Γ Λ) : multiStep M c 1 = step M c := rfl + +theorem multiStep_succ (M : Machine Γ Λ) (c : Cfg Γ Λ) (n : ℕ) : + multiStep M c (n + 1) = (multiStep M c n).bind (step M) := by + simp only [multiStep, Function.iterate_succ_apply'] + +theorem multiStep_add (M : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : ℕ) : + multiStep M c₁ (n + m) = (multiStep M c₁ n).bind (fun c₂ => multiStep M c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans (M : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : ℕ) + (h₁ : c₁ [M]⊢^{n} c₂) (h₂ : c₂ [M]⊢^{m} c₃) : + c₁ [M]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +@[simp] theorem pow_zero_list (u : List (Fin 2)) : u ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (u : List (Fin 2)) (n : Nat) : u ^ (n + 1) = u ++ u ^ n := rfl +@[simp] theorem nil_append_list (l : List (Fin 2)) : ([] : List (Fin 2)) ++ l = l := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : + (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl +@[simp] theorem init_nil : (init ([] : List (Fin 2))) = ⟨some A, ⟨0, default, default⟩⟩ := rfl + +omit [Inhabited Γ] in +@[simp] +theorem listblank_append_pow_add (s : ListBlank (Fin 2)) (n m : ℕ) : + (s <+ (([1] : List (Fin 2)) ^ n)) <+ (([1] : List (Fin 2)) ^ m) = + s <+ (([1] : List (Fin 2)) ^ (n + m)) := by + rw [listblank_append_append, list_pow_add_comm, ← list_pow_add] + +theorem listblank_right_pow_add (s : ListBlank (Fin 2)) (n m : ℕ) : + (([1] : List (Fin 2)) ^ n) +> ((([1] : List (Fin 2)) ^ m) +> s) = + (([1] : List (Fin 2)) ^ (n + m)) +> s := by + rw [← listblank_append_right_assoc, ← list_pow_add] + +-- ============================================================================ +-- Section 1: 2nd-Order Digit-Stack Encodings & 16 Local Separator Rules +-- ============================================================================ + +def encLeft1 : List ℕ → ListBlank (Fin 2) + | [] => default + | a :: L => ((encLeft1 L).cons 0) <+ (([1] : List (Fin 2)) ^ (a + 1)) + +def encRight1 : List ℕ → ListBlank (Fin 2) + | [] => default + | d :: R => (([1] : List (Fin 2)) ^ (d + 1)) +> ((encRight1 R).cons 0) + +@[simp] theorem encLeft_nil : encLeft1 [] = default := rfl +@[simp] theorem encLeft_cons (a : ℕ) (L : List ℕ) : + encLeft1 (a :: L) = ((encLeft1 L).cons 0) <+ (([1] : List (Fin 2)) ^ (a + 1)) := rfl +@[simp] theorem encRight_nil : encRight1 [] = default := rfl +@[simp] theorem encRight_cons (d : ℕ) (R : List ℕ) : + encRight1 (d :: R) = (([1] : List (Fin 2)) ^ (d + 1)) +> ((encRight1 R).cons 0) := rfl + +def bumpHead : List ℕ → List ℕ + | [] => [0] + | b :: L => (b + 1) :: L + +@[simp] theorem encLeft_cons_one (L : List ℕ) : + (1 : Fin 2) >> encLeft1 L = encLeft1 (bumpHead L) := by + cases L with + | nil => simp [bumpHead, encLeft1] + | cons b L' => rfl + +@[simp] theorem encRight_cons_one (R : List ℕ) : + (1 : Fin 2) >> encRight1 R = encRight1 (bumpHead R) := by + cases R with + | nil => simp [bumpHead, encRight1] + | cons d R' => rfl + +macro "finish" : tactic => `(tactic| (refine ⟨0, ?_⟩; simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, zero_cons_default, encLeft_nil, encRight_nil, encLeft_cons_one, encRight_cons_one, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, default_head, default_tail, multiStep_zero]; try rfl)) +macro "step" : tactic => `(tactic| ( + try refine stepPlus_stepStar ?_ + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, listblank_append_cons, listblank_append_nil, Turing.ListBlank.head_cons, default_head] + apply step_stepStar_stepPlus (by rfl) + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, + zero_cons_default, default_head, default_tail])) +macro "execute" n:num : tactic => `(tactic| ( + iterate $n step + finish)) + +def cfg_F (L R : List ℕ) : Cfg (Fin 2) (Fin 6) := + ⟨some F, ⟨0, encLeft1 L, encRight1 R⟩⟩ + +def cfg_AR (L R : List ℕ) : Cfg (Fin 2) (Fin 6) := + (encLeft1 L) {{A}}> (encRight1 R) + +inductive StackMode + | F + | AR + deriving DecidableEq, Repr + +def evalStackCfg : StackMode → List ℕ → List ℕ → Cfg (Fin 2) (Fin 6) + | .F, L, R => cfg_F L R + | .AR, L, R => cfg_AR L R + +@[simp] theorem evalStackCfg_F (L R : List ℕ) : evalStackCfg .F L R = cfg_F L R := rfl +@[simp] theorem evalStackCfg_AR (L R : List ℕ) : evalStackCfg .AR L R = cfg_AR L R := rfl + +-- Mode F Rules (8 Rules) + +theorem rule_F_nil (R : List ℕ) : + (cfg_F [] R) [target_tm]⊢⁺ (cfg_AR [1] R) := by + unfold cfg_F cfg_AR + rw [encLeft_nil, encLeft_cons 1 [], encLeft_nil] + dsimp [HPow.hPow] + execute 3 + +theorem rule_F_zero_nil (R : List ℕ) : + (cfg_F [0] R) [target_tm]⊢⁺ (cfg_F [] (0 :: bumpHead R)) := by + unfold cfg_F + rw [encLeft_cons 0 [], encLeft_nil, encRight_cons 0 (bumpHead R)] + dsimp [HPow.hPow] + execute 3 + +theorem rule_F_zero_zero (L R : List ℕ) : + (cfg_F (0 :: 0 :: L) R) [target_tm]⊢⁺ (cfg_F (bumpHead (bumpHead L)) (0 :: R)) := by + unfold cfg_F + rw [encLeft_cons 0 (0 :: L), encLeft_cons 0 L, encRight_cons 0 R] + dsimp [HPow.hPow] + execute 12 + +theorem rule_F_zero_one (L R : List ℕ) : + (cfg_F (0 :: 1 :: L) R) [target_tm]⊢⁺ (cfg_F L (2 :: bumpHead R)) := by + unfold cfg_F + rw [encLeft_cons 0 (1 :: L), encLeft_cons 1 L, encRight_cons 2 (bumpHead R)] + dsimp [HPow.hPow] + execute 7 + +theorem rule_F_zero_add_two (L R : List ℕ) (b : ℕ) : + (cfg_F (0 :: (b + 2) :: L) R) [target_tm]⊢⁺ (cfg_AR (b :: L) (0 :: 0 :: bumpHead R)) := by + unfold cfg_F cfg_AR + rw [encLeft_cons 0 ((b + 2) :: L), encLeft_cons (b + 2) L, encLeft_cons b L, + encRight_cons 0 (0 :: bumpHead R), encRight_cons 0 (bumpHead R)] + have hb : b + 2 + 1 = (b + 1) + 2 := by omega + rw [hb, ← listblank_append_pow_add ((encLeft1 L).cons 0) (b + 1) 2] + dsimp [HPow.hPow] + execute 4 + +def cfg_Halt_F (L R : List ℕ) : Cfg (Fin 2) (Fin 6) := + ⟨some E, ⟨0, encLeft1 L, (0 : Fin 2) >> (0 : Fin 2) >> encRight1 (bumpHead R)⟩⟩ + +theorem rule_F_one (L R : List ℕ) : + ((cfg_F (1 :: L) R) [target_tm]⊢⁺ (cfg_Halt_F L R)) ∧ + (step target_tm (cfg_Halt_F L R)).isNone := by + refine ⟨?_, rfl⟩ + unfold cfg_F cfg_Halt_F + rw [encLeft_cons 1 L] + dsimp [HPow.hPow] + execute 3 + +theorem rule_F_one_halt (L R : List ℕ) : + ∃ cfg, ((cfg_F (1 :: L) R) [target_tm]⊢* cfg) ∧ (step target_tm cfg).isNone := + ⟨cfg_Halt_F L R, stepPlus_stepStar (rule_F_one L R).1, (rule_F_one L R).2⟩ + +theorem rule_F_two (L R : List ℕ) : + (cfg_F (2 :: L) R) [target_tm]⊢⁺ (cfg_AR (bumpHead (bumpHead L)) (0 :: bumpHead R)) := by + unfold cfg_F cfg_AR + rw [encLeft_cons 2 L, encRight_cons 0 (bumpHead R)] + dsimp [HPow.hPow] + execute 8 + +theorem rule_F_add_three (L R : List ℕ) (a : ℕ) : + (cfg_F ((a + 3) :: L) R) [target_tm]⊢⁺ (cfg_F (a :: L) (0 :: bumpHead R)) := by + unfold cfg_F + rw [encLeft_cons (a + 3) L, encLeft_cons a L, encRight_cons 0 (bumpHead R)] + have ha : a + 3 + 1 = (a + 1) + 3 := by omega + rw [ha, ← listblank_append_pow_add ((encLeft1 L).cons 0) (a + 1) 3] + dsimp [HPow.hPow] + execute 5 + +-- Mode AR Rules (8 Rules) + +theorem rule_AR_nil (L : List ℕ) : + (cfg_AR L []) [target_tm]⊢⁺ (cfg_F L [1]) := by + unfold cfg_AR cfg_F + rw [encRight_nil, encRight_cons 1 [], encRight_nil] + dsimp [HPow.hPow] + execute 6 + +theorem rule_AR_nil_zero (R : List ℕ) : + (cfg_AR [] (0 :: R)) [target_tm]⊢⁺ (cfg_F [] (bumpHead (bumpHead R))) := by + unfold cfg_AR cfg_F + rw [encLeft_nil, encRight_cons 0 R] + dsimp [HPow.hPow] + execute 3 + +theorem rule_AR_zero_zero (L R : List ℕ) : + (cfg_AR (0 :: L) (0 :: R)) [target_tm]⊢⁺ + (cfg_AR (bumpHead (bumpHead (bumpHead L))) (bumpHead R)) := by + unfold cfg_AR + rw [encLeft_cons 0 L, encRight_cons 0 R] + cases R with + | nil => + rw [show bumpHead ([] : List ℕ) = [0] from rfl, encRight_cons 0 [], encRight_nil] + dsimp [HPow.hPow] + execute 7 + | cons d R' => + rw [show bumpHead (d :: R') = (d + 1) :: R' from rfl, + encRight_cons (d + 1) R', encRight_cons d R'] + have hd : d + 1 + 1 = 1 + (d + 1) := by omega + rw [hd, ← listblank_right_pow_add ((encRight1 R').cons 0) 1 (d + 1)] + dsimp [HPow.hPow] + execute 7 + +theorem rule_AR_one_zero (L R : List ℕ) : + (cfg_AR (1 :: L) (0 :: R)) [target_tm]⊢⁺ + (cfg_F L (bumpHead (bumpHead (bumpHead (bumpHead R))))) := by + unfold cfg_AR cfg_F + rw [encLeft_cons 1 L, encRight_cons 0 R] + dsimp [HPow.hPow] + execute 7 + +theorem rule_AR_add_two_zero (L R : List ℕ) (a : ℕ) : + (cfg_AR ((a + 2) :: L) (0 :: R)) [target_tm]⊢⁺ + (cfg_AR (a :: L) (0 :: bumpHead (bumpHead R))) := by + unfold cfg_AR + rw [encLeft_cons (a + 2) L, encLeft_cons a L, + encRight_cons 0 R, encRight_cons 0 (bumpHead (bumpHead R))] + have ha : a + 2 + 1 = (a + 1) + 2 := by omega + rw [ha, ← listblank_append_pow_add ((encLeft1 L).cons 0) (a + 1) 2] + dsimp [HPow.hPow] + execute 4 + +theorem rule_AR_one_nil (L : List ℕ) : + (cfg_AR L [1]) [target_tm]⊢⁺ (cfg_AR (0 :: L) []) := by + unfold cfg_AR + rw [encLeft_cons 0 L, encRight_cons 1 [], encRight_nil] + dsimp [HPow.hPow] + execute 2 + +theorem rule_AR_one_cons (L R : List ℕ) (e : ℕ) : + (cfg_AR L (1 :: e :: R)) [target_tm]⊢⁺ (cfg_AR L (0 :: (e + 1) :: R)) := by + unfold cfg_AR + rw [encRight_cons 1 (e :: R), encRight_cons e R, + encRight_cons 0 ((e + 1) :: R), encRight_cons (e + 1) R] + have he1 : e + 1 = 1 + e := by omega + have he2 : e + 1 + 1 = 2 + e := by omega + rw [he2, ← listblank_right_pow_add ((encRight1 R).cons 0) 2 e] + rw [he1, ← listblank_right_pow_add ((encRight1 R).cons 0) 1 e] + dsimp [HPow.hPow] + execute 14 + +theorem rule_AR_add_two (L R : List ℕ) (d : ℕ) : + (cfg_AR L ((d + 2) :: R)) [target_tm]⊢⁺ (cfg_AR (0 :: L) (d :: R)) := by + unfold cfg_AR + rw [encLeft_cons 0 L, encRight_cons (d + 2) R, encRight_cons d R] + have hd : d + 2 + 1 = 3 + d := by omega + rw [hd, ← listblank_right_pow_add ((encRight1 R).cons 0) 3 d] + have hd2 : d + 1 = 1 + d := by omega + rw [hd2, ← listblank_right_pow_add ((encRight1 R).cons 0) 1 d] + dsimp [HPow.hPow] + execute 2 + +-- ============================================================================ +-- Section 2: Multi-Step Bulk Contractions on `List ℕ` +-- ============================================================================ + +theorem bumpHead_iterate_cons (k v : ℕ) (L : List ℕ) : + bumpHead^[k] (v :: L) = (v + k) :: L := by + induction k generalizing v with + | zero => simp + | succ k ih => + rw [Function.iterate_succ_apply, bumpHead, ih (v + 1)] + have h : v + 1 + k = v + (k + 1) := by omega + rw [h] + +theorem bumpHead_iterate_nil (k : ℕ) : + bumpHead^[k + 1] [] = [k] := by + rw [Function.iterate_succ_apply, bumpHead, bumpHead_iterate_cons, Nat.zero_add] + +theorem bumpHead2_iterate_eq (k : ℕ) (R : List ℕ) : + (fun R => bumpHead (bumpHead R))^[k] R = bumpHead^[2 * k] R := by + induction k generalizing R with + | zero => simp + | succ k ih => + have h2 : 2 * (k + 1) = 2 + 2 * k := by omega + rw [Function.iterate_succ_apply', ih, h2, Function.iterate_add_apply] + rfl + +def stepF3Right : ℕ → List ℕ → List ℕ + | 0, R => R + | k + 1, R => stepF3Right k (0 :: bumpHead R) + +theorem stepF3Right_succ (k : ℕ) (R : List ℕ) : + stepF3Right (k + 1) R = 0 :: (List.replicate k 1 ++ bumpHead R) := by + induction k generalizing R with + | zero => rfl + | succ k ih => + rw [stepF3Right, ih (0 :: bumpHead R)] + have h : List.replicate (k + 1) 1 ++ bumpHead R = List.replicate k 1 ++ (1 :: bumpHead R) := by + rw [List.replicate_succ', List.append_assoc, List.singleton_append] + rw [h] + rfl + +theorem rule_F_step3_all (L R : List ℕ) (a k : ℕ) : + (cfg_F ((3 * k + a) :: L) R) [target_tm]⊢* + (cfg_F (a :: L) (stepF3Right k R)) := by + induction k generalizing R with + | zero => + simp only [Nat.mul_zero, Nat.zero_add, stepF3Right] + try exact ⟨0, rfl⟩ + | succ k ih => + have h1 : 3 * (k + 1) + a = (3 * k + a) + 3 := by omega + rw [h1, stepF3Right] + exact stepStar_trans (stepPlus_stepStar (rule_F_add_three L R (3 * k + a))) (ih (0 :: bumpHead R)) + +theorem rule_AR_step2_all (L R : List ℕ) (d k : ℕ) : + (cfg_AR L ((2 * k + d) :: R)) [target_tm]⊢* + (cfg_AR (List.replicate k 0 ++ L) (d :: R)) := by + induction k generalizing L with + | zero => + simp only [Nat.mul_zero, Nat.zero_add, List.replicate, List.nil_append] + try exact ⟨0, rfl⟩ + | succ k ih => + have h1 : 2 * (k + 1) + d = (2 * k + d) + 2 := by omega + have h2 : List.replicate (k + 1) 0 ++ L = List.replicate k 0 ++ (0 :: L) := by + rw [List.replicate_succ', List.append_assoc, List.singleton_append] + rw [h1, h2] + exact stepStar_trans (stepPlus_stepStar (rule_AR_add_two L R (2 * k + d))) (ih (0 :: L)) + +theorem rule_AR_add_two_zero_all (L R : List ℕ) (a k : ℕ) : + (cfg_AR ((2 * k + a) :: L) (0 :: R)) [target_tm]⊢* + (cfg_AR (a :: L) (0 :: (fun R => bumpHead (bumpHead R))^[k] R)) := by + induction k generalizing R with + | zero => + simp only [Nat.mul_zero, Nat.zero_add, Function.iterate_zero, id_eq] + try exact ⟨0, rfl⟩ + | succ k ih => + have h_eq : 2 * (k + 1) + a = 2 * k + a + 2 := by omega + rw [h_eq, Function.iterate_succ_apply] + exact stepStar_trans (stepPlus_stepStar (rule_AR_add_two_zero L R (2 * k + a))) + (ih (bumpHead (bumpHead R))) + +theorem rule_F_zero4_one (L : List ℕ) (d : ℕ) (R : List ℕ) : + (cfg_F (0 :: 0 :: 0 :: 0 :: 0 :: L) (0 :: d :: R)) [target_tm]⊢* + (cfg_F (0 :: L) (0 :: (d + 8) :: R)) := by + refine stepStar_trans (stepPlus_stepStar (rule_F_zero_zero (0 :: 0 :: 0 :: L) (0 :: d :: R))) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_F_two (0 :: 0 :: L) (0 :: 0 :: d :: R))) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two_zero (0 :: L) (1 :: 0 :: d :: R) 0)) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero (0 :: L) (3 :: 0 :: d :: R))) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two (3 :: L) (0 :: d :: R) 2)) ?_ + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two (0 :: 3 :: L) (0 :: d :: R) 0)) ?_ + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero (0 :: 3 :: L) (0 :: d :: R))) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_one_cons (3 :: 3 :: L) R d)) ?_ + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two_zero (3 :: L) ((d + 1) :: R) 1)) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_one_zero (3 :: L) ((d + 1 + 1 + 1) :: R))) ?_ + dsimp [bumpHead] + have hd : d + 1 + 1 + 1 + 1 + 1 + 1 + 1 = d + 7 := by omega + rw [hd] + refine stepStar_trans (stepPlus_stepStar (rule_F_add_three L ((d + 7) :: R) 0)) ?_ + dsimp [bumpHead] + try exact ⟨0, rfl⟩ + +theorem rule_F_zero4_all (k r : ℕ) (L : List ℕ) (d : ℕ) (R : List ℕ) : + (cfg_F (List.replicate (4 * k + r + 1) 0 ++ L) (0 :: d :: R)) [target_tm]⊢* + (cfg_F (List.replicate (r + 1) 0 ++ L) (0 :: (d + 8 * k) :: R)) := by + induction k generalizing d with + | zero => + simp + try exact ⟨0, rfl⟩ + | succ k ih => + have h_rep : List.replicate (4 * (k + 1) + r + 1) 0 ++ L = + 0 :: 0 :: 0 :: 0 :: 0 :: (List.replicate (4 * k + r) 0 ++ L) := by + have h_eq : 4 * (k + 1) + r + 1 = 5 + (4 * k + r) := by omega + rw [h_eq, List.replicate_add] + rfl + rw [h_rep] + refine stepStar_trans (rule_F_zero4_one (List.replicate (4 * k + r) 0 ++ L) d R) ?_ + have h_rep2 : 0 :: (List.replicate (4 * k + r) 0 ++ L) = List.replicate (4 * k + r + 1) 0 ++ L := by + rw [← List.cons_append, ← List.replicate_succ] + rw [h_rep2] + have hd : d + 8 * (k + 1) = (d + 8) + 8 * k := by omega + rw [hd] + exact ih (d + 8) + +theorem rule_AR_zero_ones_all (m b : ℕ) (L R : List ℕ) : + (cfg_AR (0 :: b :: L) (0 :: (List.replicate m 1 ++ R))) [target_tm]⊢* + (cfg_AR (0 :: (b + 3 * m) :: L) (0 :: R)) := by + induction m generalizing b with + | zero => + simp + try exact ⟨0, rfl⟩ + | succ m ih => + rw [List.replicate_succ, List.cons_append] + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero (b :: L) (1 :: (List.replicate m 1 ++ R)))) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two ((b + 3) :: L) (List.replicate m 1 ++ R) 0)) ?_ + have hb : b + 3 * (m + 1) = (b + 3) + 3 * m := by omega + rw [hb] + exact ih (b + 3) + +theorem rule_AR_ones_all (m b : ℕ) (L R : List ℕ) : + (cfg_AR (0 :: b :: L) (List.replicate (m + 1) 1 ++ R)) [target_tm]⊢* + (cfg_AR (0 :: (b + 3 * m) :: L) (1 :: R)) := by + induction m generalizing b with + | zero => + simp + try exact ⟨0, rfl⟩ + | succ m ih => + have h_rep : List.replicate (m + 2) 1 ++ R = 1 :: 1 :: (List.replicate m 1 ++ R) := rfl + rw [h_rep] + refine stepStar_trans (stepPlus_stepStar (rule_AR_one_cons (0 :: b :: L) (List.replicate m 1 ++ R) 1)) ?_ + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero (b :: L) (2 :: (List.replicate m 1 ++ R)))) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two ((b + 3) :: L) (List.replicate m 1 ++ R) 1)) ?_ + have h_rep2 : 1 :: (List.replicate m 1 ++ R) = List.replicate (m + 1) 1 ++ R := rfl + rw [h_rep2] + have hb : b + 3 * (m + 1) = (b + 3) + 3 * m := by omega + rw [hb] + exact ih (b + 3) + +-- ============================================================================ +-- Section 3: 6-Rule Inductive Tower Algebra +-- ============================================================================ + +def A3 (k : ℕ) (tail : List ℕ) : List ℕ := + 6 :: 0 :: 0 :: 0 :: (3 * k + 3) :: 3 :: 0 :: tail + +def A0 (k : ℕ) (tail : List ℕ) : List ℕ := + 6 :: 0 :: 0 :: 0 :: (3 * k + 3) :: 0 :: 0 :: 0 :: tail + +def B3 (k : ℕ) (tail : List ℕ) : List ℕ := + 0 :: 3 :: 3 :: 0 :: 0 :: (3 * k + 3) :: 3 :: 0 :: tail + +def B0 (k : ℕ) (tail : List ℕ) : List ℕ := + 0 :: 3 :: 3 :: 0 :: 0 :: (3 * k + 3) :: 0 :: 0 :: 0 :: tail + +def SubStep (S S' : List ℕ) : Prop := + ∀ R_bot : List ℕ, + (cfg_F (0 :: S) (9 :: R_bot)) [target_tm]⊢* + (cfg_AR (0 :: 0 :: 0 :: 0 :: 0 :: S') (0 :: R_bot)) + +def TopStep (S S' : List ℕ) : Prop := + (cfg_F (0 :: S) [5]) [target_tm]⊢* (cfg_F (0 :: S') [5]) + +def SubHalt (S : List ℕ) : Prop := + ∀ R_bot : List ℕ, + ∃ cfg, ((cfg_F (0 :: S) (9 :: R_bot)) [target_tm]⊢* cfg) ∧ (step target_tm cfg).isNone + +theorem topStep_refl (S : List ℕ) : TopStep S S := ⟨0, rfl⟩ + +theorem topStep_trans {S₁ S₂ S₃ : List ℕ} (h₁ : TopStep S₁ S₂) (h₂ : TopStep S₂ S₃) : + TopStep S₁ S₃ := stepStar_trans h₁ h₂ + +theorem exit_sub (W : List ℕ) (R_bot : List ℕ) : + (cfg_AR W (10 :: R_bot)) [target_tm]⊢* (cfg_AR (0 :: 0 :: 0 :: 0 :: 0 :: W) (0 :: R_bot)) := by + simpa using rule_AR_step2_all W R_bot 0 5 + +theorem exit_top (W : List ℕ) : + (cfg_AR W [6]) [target_tm]⊢* (cfg_F (0 :: W) [5]) := by + refine stepStar_trans (rule_AR_step2_all W [] 0 3) ?_ + dsimp [List.replicate] + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero (0 :: 0 :: W) [])) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two_zero (0 :: W) [] 1)) ?_ + dsimp [bumpHead] + exact stepPlus_stepStar (rule_AR_one_zero (0 :: W) [1]) + +theorem subStep_A_any (U : List ℕ) : + SubStep (6 :: 0 :: 0 :: 0 :: U) (0 :: 3 :: 3 :: 0 :: 0 :: U) := by + intro R_bot + refine stepStar_trans (stepPlus_stepStar (rule_F_zero_add_two (0 :: 0 :: 0 :: U) (9 :: R_bot) 4)) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two_zero (0 :: 0 :: 0 :: U) (0 :: 10 :: R_bot) 2)) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two_zero (0 :: 0 :: 0 :: U) (2 :: 10 :: R_bot) 0)) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero (0 :: 0 :: 0 :: U) (4 :: 10 :: R_bot))) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two (3 :: 0 :: 0 :: U) (10 :: R_bot) 3)) ?_ + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two (0 :: 3 :: 0 :: 0 :: U) (10 :: R_bot) 1)) ?_ + refine stepStar_trans (stepPlus_stepStar (rule_AR_one_cons (0 :: 0 :: 3 :: 0 :: 0 :: U) R_bot 10)) ?_ + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero (0 :: 3 :: 0 :: 0 :: U) (11 :: R_bot))) ?_ + dsimp [bumpHead] + simpa using rule_AR_step2_all (3 :: 3 :: 0 :: 0 :: U) R_bot 0 6 + +theorem subStep_A3 (k : ℕ) (tail : List ℕ) : SubStep (A3 k tail) (B3 k tail) := + subStep_A_any ((3 * k + 3) :: 3 :: 0 :: tail) + +theorem subStep_A0 (k : ℕ) (tail : List ℕ) : SubStep (A0 k tail) (B0 k tail) := + subStep_A_any ((3 * k + 3) :: 0 :: 0 :: 0 :: tail) + +theorem top_A_to_B (U : List ℕ) : + (cfg_F (0 :: 6 :: 0 :: 0 :: 0 :: U) [5]) [target_tm]⊢* + (cfg_F (0 :: 0 :: 3 :: 3 :: 0 :: 0 :: U) [5]) := by + refine stepStar_trans (stepPlus_stepStar (rule_F_zero_add_two (0 :: 0 :: 0 :: U) [5] 4)) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two_zero (0 :: 0 :: 0 :: U) [0, 6] 2)) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two_zero (0 :: 0 :: 0 :: U) [2, 6] 0)) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero (0 :: 0 :: 0 :: U) [4, 6])) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two (3 :: 0 :: 0 :: U) [6] 3)) ?_ + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two (0 :: 3 :: 0 :: 0 :: U) [6] 1)) ?_ + refine stepStar_trans (stepPlus_stepStar (rule_AR_one_cons (0 :: 0 :: 3 :: 0 :: 0 :: U) [] 6)) ?_ + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero (0 :: 3 :: 0 :: 0 :: U) [7])) ?_ + dsimp [bumpHead] + refine stepStar_trans (rule_AR_step2_all (3 :: 3 :: 0 :: 0 :: U) [] 0 4) ?_ + dsimp [List.replicate] + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero (0 :: 0 :: 0 :: 3 :: 3 :: 0 :: 0 :: U) [])) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two_zero (0 :: 0 :: 3 :: 3 :: 0 :: 0 :: U) [] 1)) ?_ + dsimp [bumpHead] + exact stepPlus_stepStar (rule_AR_one_zero (0 :: 0 :: 3 :: 3 :: 0 :: 0 :: U) [1]) + +theorem step_B_prefix (V : List ℕ) (d₀ : ℕ) (R_rest : List ℕ) : + (cfg_F (0 :: 0 :: 3 :: 3 :: 0 :: 0 :: V) (d₀ :: R_rest)) [target_tm]⊢* + (cfg_F (0 :: 0 :: V) (9 :: 1 :: d₀ :: R_rest)) := by + refine stepStar_trans (stepPlus_stepStar (rule_F_zero_zero (3 :: 3 :: 0 :: 0 :: V) (d₀ :: R_rest))) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_F_add_three (3 :: 0 :: 0 :: V) (0 :: d₀ :: R_rest) 2)) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_F_two (3 :: 0 :: 0 :: V) (0 :: 1 :: d₀ :: R_rest))) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two_zero (0 :: 0 :: V) (1 :: 1 :: d₀ :: R_rest) 3)) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two_zero (0 :: 0 :: V) (3 :: 1 :: d₀ :: R_rest) 1)) ?_ + dsimp [bumpHead] + exact stepPlus_stepStar (rule_AR_one_zero (0 :: 0 :: V) (5 :: 1 :: d₀ :: R_rest)) + +theorem step_B0_core (k : ℕ) (tail : List ℕ) (d₀ : ℕ) (R_rest : List ℕ) : + (cfg_F (0 :: B0 k tail) (d₀ :: R_rest)) [target_tm]⊢* + (cfg_AR (A3 (k + 1) tail) ((d₀ + 1) :: R_rest)) := by + unfold B0 + refine stepStar_trans (step_B_prefix ((3 * k + 3) :: 0 :: 0 :: 0 :: tail) d₀ R_rest) ?_ + refine stepStar_trans (stepPlus_stepStar (rule_F_zero_zero ((3 * k + 3) :: 0 :: 0 :: 0 :: tail) (9 :: 1 :: d₀ :: R_rest))) ?_ + dsimp [bumpHead] + have hk1 : 3 * k + 3 + 1 + 1 = 3 * (k + 1) + 2 := by omega + rw [hk1] + refine stepStar_trans (rule_F_step3_all (0 :: 0 :: 0 :: tail) (0 :: 9 :: 1 :: d₀ :: R_rest) 2 (k + 1)) ?_ + rw [stepF3Right_succ k (0 :: 9 :: 1 :: d₀ :: R_rest)] + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_F_two (0 :: 0 :: 0 :: tail) + (0 :: (List.replicate k 1 ++ (1 :: 9 :: 1 :: d₀ :: R_rest))))) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two_zero (0 :: 0 :: tail) + (1 :: (List.replicate k 1 ++ (1 :: 9 :: 1 :: d₀ :: R_rest))) 0)) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero (0 :: 0 :: tail) + (3 :: (List.replicate k 1 ++ (1 :: 9 :: 1 :: d₀ :: R_rest))))) ?_ + dsimp [bumpHead] + have h_rep : List.replicate k 1 ++ (1 :: 9 :: 1 :: d₀ :: R_rest) = + List.replicate (k + 1) 1 ++ (9 :: 1 :: d₀ :: R_rest) := by + rw [List.replicate_succ', List.append_assoc, List.singleton_append] + rw [h_rep] + refine stepStar_trans (rule_AR_step2_all (3 :: 0 :: tail) + (List.replicate (k + 1) 1 ++ (9 :: 1 :: d₀ :: R_rest)) 0 2) ?_ + dsimp [List.replicate] + refine stepStar_trans (rule_AR_zero_ones_all (k + 1) 0 (3 :: 0 :: tail) (9 :: 1 :: d₀ :: R_rest)) ?_ + rw [Nat.zero_add] + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero ((3 * (k + 1)) :: 3 :: 0 :: tail) (9 :: 1 :: d₀ :: R_rest))) ?_ + dsimp [bumpHead] + refine stepStar_trans (rule_AR_step2_all ((3 * (k + 1) + 3) :: 3 :: 0 :: tail) (1 :: d₀ :: R_rest) 0 5) ?_ + dsimp [List.replicate] + refine stepStar_trans (rule_AR_zero_ones_all 1 0 (0 :: 0 :: 0 :: (3 * (k + 1) + 3) :: 3 :: 0 :: tail) (d₀ :: R_rest)) ?_ + dsimp + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero + (3 :: 0 :: 0 :: 0 :: (3 * (k + 1) + 3) :: 3 :: 0 :: tail) (d₀ :: R_rest))) ?_ + dsimp [bumpHead, A3] + try exact ⟨0, rfl⟩ + +theorem step_B3_pre (k : ℕ) (tail : List ℕ) (d₀ : ℕ) (R_rest : List ℕ) : + (cfg_F (0 :: B3 k tail) (d₀ :: R_rest)) [target_tm]⊢* + (cfg_F (0 :: tail) (9 :: (List.replicate (k + 1) 1 ++ (9 :: 1 :: d₀ :: R_rest)))) := by + unfold B3 + refine stepStar_trans (step_B_prefix ((3 * k + 3) :: 3 :: 0 :: tail) d₀ R_rest) ?_ + refine stepStar_trans (stepPlus_stepStar (rule_F_zero_zero ((3 * k + 3) :: 3 :: 0 :: tail) (9 :: 1 :: d₀ :: R_rest))) ?_ + dsimp [bumpHead] + have hk1 : 3 * k + 3 + 1 + 1 = 3 * (k + 1) + 2 := by omega + rw [hk1] + refine stepStar_trans (rule_F_step3_all (3 :: 0 :: tail) (0 :: 9 :: 1 :: d₀ :: R_rest) 2 (k + 1)) ?_ + rw [stepF3Right_succ k (0 :: 9 :: 1 :: d₀ :: R_rest)] + dsimp [bumpHead] + have h_rep : List.replicate k 1 ++ (1 :: 9 :: 1 :: d₀ :: R_rest) = + List.replicate (k + 1) 1 ++ (9 :: 1 :: d₀ :: R_rest) := by + rw [List.replicate_succ', List.append_assoc, List.singleton_append] + rw [h_rep] + refine stepStar_trans (stepPlus_stepStar (rule_F_two (3 :: 0 :: tail) + (0 :: (List.replicate (k + 1) 1 ++ (9 :: 1 :: d₀ :: R_rest))))) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two_zero (0 :: tail) + (1 :: (List.replicate (k + 1) 1 ++ (9 :: 1 :: d₀ :: R_rest))) 3)) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two_zero (0 :: tail) + (3 :: (List.replicate (k + 1) 1 ++ (9 :: 1 :: d₀ :: R_rest))) 1)) ?_ + dsimp [bumpHead] + exact stepPlus_stepStar (rule_AR_one_zero (0 :: tail) + (5 :: (List.replicate (k + 1) 1 ++ (9 :: 1 :: d₀ :: R_rest)))) + +theorem step_B3_post (k : ℕ) (tail' : List ℕ) (d₀ : ℕ) (R_rest : List ℕ) : + (cfg_AR (0 :: 0 :: 0 :: 0 :: 0 :: tail') (0 :: (List.replicate (k + 1) 1 ++ (9 :: 1 :: d₀ :: R_rest)))) + [target_tm]⊢* + (cfg_AR (A0 (k + 1) tail') ((d₀ + 1) :: R_rest)) := by + refine stepStar_trans (rule_AR_zero_ones_all (k + 1) 0 (0 :: 0 :: 0 :: tail') (9 :: 1 :: d₀ :: R_rest)) ?_ + rw [Nat.zero_add] + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero ((3 * (k + 1)) :: 0 :: 0 :: 0 :: tail') (9 :: 1 :: d₀ :: R_rest))) ?_ + dsimp [bumpHead] + refine stepStar_trans (rule_AR_step2_all ((3 * (k + 1) + 3) :: 0 :: 0 :: 0 :: tail') (1 :: d₀ :: R_rest) 0 5) ?_ + dsimp [List.replicate] + refine stepStar_trans (rule_AR_zero_ones_all 1 0 (0 :: 0 :: 0 :: (3 * (k + 1) + 3) :: 0 :: 0 :: 0 :: tail') (d₀ :: R_rest)) ?_ + dsimp + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero + (3 :: 0 :: 0 :: 0 :: (3 * (k + 1) + 3) :: 0 :: 0 :: 0 :: tail') (d₀ :: R_rest))) ?_ + dsimp [bumpHead, A0] + try exact ⟨0, rfl⟩ + +theorem subStep_B0 (k : ℕ) (tail : List ℕ) : SubStep (B0 k tail) (A3 (k + 1) tail) := by + intro R_bot + exact stepStar_trans (step_B0_core k tail 9 R_bot) (exit_sub (A3 (k + 1) tail) R_bot) + +theorem topStep_A0 (k : ℕ) (tail : List ℕ) : TopStep (A0 k tail) (A3 (k + 1) tail) := by + refine stepStar_trans (top_A_to_B ((3 * k + 3) :: 0 :: 0 :: 0 :: tail)) ?_ + exact stepStar_trans (step_B0_core k tail 5 []) (exit_top (A3 (k + 1) tail)) + +theorem subStep_B3 (k : ℕ) {tail tail' : List ℕ} (h : SubStep tail tail') : + SubStep (B3 k tail) (A0 (k + 1) tail') := by + intro R_bot + refine stepStar_trans (step_B3_pre k tail 9 R_bot) ?_ + refine stepStar_trans (h (List.replicate (k + 1) 1 ++ (9 :: 1 :: 9 :: R_bot))) ?_ + exact stepStar_trans (step_B3_post k tail' 9 R_bot) (exit_sub (A0 (k + 1) tail') R_bot) + +theorem topStep_A3 (k : ℕ) {tail tail' : List ℕ} (h : SubStep tail tail') : + TopStep (A3 k tail) (A0 (k + 1) tail') := by + refine stepStar_trans (top_A_to_B ((3 * k + 3) :: 3 :: 0 :: tail)) ?_ + refine stepStar_trans (step_B3_pre k tail 5 []) ?_ + refine stepStar_trans (h (List.replicate (k + 1) 1 ++ [9, 1, 5])) ?_ + exact stepStar_trans (step_B3_post k tail' 5 []) (exit_top (A0 (k + 1) tail')) + +theorem subHalt_B3 (k : ℕ) {tail : List ℕ} (h : SubHalt tail) : + SubHalt (B3 k tail) := by + intro R_bot + obtain ⟨cfg, h_steps, h_none⟩ := h (List.replicate (k + 1) 1 ++ (9 :: 1 :: 9 :: R_bot)) + exact ⟨cfg, stepStar_trans (step_B3_pre k tail 9 R_bot) h_steps, h_none⟩ + +theorem topHalt_A3 (k : ℕ) {tail : List ℕ} (h : SubHalt tail) : + ∃ cfg, ((cfg_F (0 :: A3 k tail) [5]) [target_tm]⊢* cfg) ∧ (step target_tm cfg).isNone := by + obtain ⟨cfg, h_steps, h_none⟩ := h (List.replicate (k + 1) 1 ++ [9, 1, 5]) + refine ⟨cfg, ?_, h_none⟩ + refine stepStar_trans (top_A_to_B ((3 * k + 3) :: 3 :: 0 :: tail)) ?_ + exact stepStar_trans (step_B3_pre k tail 5 []) h_steps + +def TowerA3 : List ℕ → List ℕ → List ℕ + | [], S => S + | k :: ks, S => TowerA3 ks (A3 k S) + +def TowerA0Out : List ℕ → List ℕ → List ℕ + | [], S => S + | k :: ks, S => A0 k (TowerA0Out ks S) + +def forceNat {α : Type} (e : ℕ) (f : ℕ → α) : α := + Nat.rec (f 0) (fun v _ => f v) (Nat.add e 1) + +@[simp] +theorem forceNat_eq {α : Type} (e : ℕ) (f : ℕ → α) : forceNat e f = f e := rfl + +def stepTowerAt (c : ℕ) : List ℕ → List ℕ + | [] => [] + | k :: ks => forceNat (k + c) (fun kc => forceNat (4 * c) (fun c4 => kc :: stepTowerAt c4 ks)) + +theorem stepTowerAt_ne_nil (c : ℕ) {ks : List ℕ} (hks : ks ≠ []) : + stepTowerAt c ks ≠ [] := by + cases ks with + | nil => contradiction + | cons _ _ => simp [stepTowerAt] + +theorem stepTowerAt_length (c : ℕ) (ks : List ℕ) : + (stepTowerAt c ks).length = ks.length := by + induction ks generalizing c with + | nil => rfl + | cons k ks ih => simp [stepTowerAt, ih (4 * c)] + +theorem stepTowerAt_four (ks : List ℕ) (c : ℕ) : + (stepTowerAt c)^[4] ks = stepTowerAt (4 * c) ks := by + induction ks generalizing c with + | nil => rfl + | cons k ks ih => + simp only [Function.iterate_succ_apply', Function.iterate_zero_apply, stepTowerAt, forceNat_eq] + have hk : k + c + c + c + c = k + 4 * c := by omega + rw [hk] + congr 1 + exact ih (4 * c) + +theorem towerA3_topStep_len : ∀ (n : ℕ) (ks : List ℕ), ks.length = n + 1 → + ∀ {S S' : List ℕ}, SubStep S S' → + TopStep (TowerA3 ks S) (TowerA3 (stepTowerAt 2 ks) S') + | 0, ks, hlen, S, S', h => by + rcases ks with _ | ⟨k, _ | _⟩ <;> try simp at hlen + simp only [TowerA3, stepTowerAt, forceNat_eq] + exact topStep_trans (topStep_A3 k h) (topStep_A0 (k + 1) S') + | n + 1, ks, hlen, S, S', h => by + rcases ks with _ | ⟨k, ks_rest⟩ + · simp at hlen + · simp only [TowerA3] + have hlen0 : ks_rest.length = n + 1 := by simpa using hlen + have hlen1 : (stepTowerAt 2 ks_rest).length = n + 1 := by + rw [stepTowerAt_length]; exact hlen0 + have hlen2 : (stepTowerAt 2 (stepTowerAt 2 ks_rest)).length = n + 1 := by + rw [stepTowerAt_length]; exact hlen1 + have hlen3 : (stepTowerAt 2 (stepTowerAt 2 (stepTowerAt 2 ks_rest))).length = n + 1 := by + rw [stepTowerAt_length]; exact hlen2 + have h1 := towerA3_topStep_len n ks_rest hlen0 (subStep_A3 k S) + have h2 := towerA3_topStep_len n _ hlen1 (subStep_B3 k h) + have h3 := towerA3_topStep_len n _ hlen2 (subStep_A0 (k + 1) S') + have h4 := towerA3_topStep_len n _ hlen3 (subStep_B0 (k + 1) S') + have h_all := topStep_trans h1 (topStep_trans h2 (topStep_trans h3 h4)) + have h_iter : stepTowerAt 2 (stepTowerAt 2 (stepTowerAt 2 (stepTowerAt 2 ks_rest))) = + (stepTowerAt 2)^[4] ks_rest := rfl + rw [h_iter, stepTowerAt_four ks_rest 2] at h_all + exact h_all + +theorem towerA3_topStep (ks : List ℕ) (hks : ks ≠ []) {S S' : List ℕ} (h : SubStep S S') : + TopStep (TowerA3 ks S) (TowerA3 (stepTowerAt 2 ks) S') := by + cases hlen : ks.length with + | zero => exact absurd (List.eq_nil_of_length_eq_zero hlen) hks + | succ n => exact towerA3_topStep_len n ks hlen h + +def absorbA0 (k : ℕ) (ks : List ℕ) : List ℕ := + match ks with + | [] => [k + 1] + | _ :: _ => (k + 1) :: stepTowerAt 2 (stepTowerAt 2 ks) + +theorem absorbA0_ne_nil (k : ℕ) (ks : List ℕ) : absorbA0 k ks ≠ [] := by + cases ks <;> simp [absorbA0] + +theorem towerA3_absorb_A0 (k : ℕ) (ks : List ℕ) (U : List ℕ) : + TopStep (TowerA3 ks (A0 k U)) (TowerA3 (absorbA0 k ks) U) := by + cases ks with + | nil => + simp only [TowerA3, absorbA0] + exact topStep_A0 k U + | cons k₀ ks₀ => + have hne : k₀ :: ks₀ ≠ [] := List.cons_ne_nil k₀ ks₀ + have h1 := towerA3_topStep (k₀ :: ks₀) hne (subStep_A0 k U) + have h2 := towerA3_topStep (stepTowerAt 2 (k₀ :: ks₀)) (stepTowerAt_ne_nil 2 hne) (subStep_B0 k U) + exact topStep_trans h1 h2 + +def absorbTowerA0Out : List ℕ → List ℕ → List ℕ + | [], ks_top => ks_top + | k :: ks_bot, ks_top => absorbTowerA0Out ks_bot (absorbA0 k ks_top) + +theorem absorbTowerA0Out_ne_nil : ∀ (ks_bot ks_top : List ℕ), + (ks_bot ≠ [] ∨ ks_top ≠ []) → absorbTowerA0Out ks_bot ks_top ≠ [] + | [], ks_top, h => by + rcases h with h | h + · contradiction + · exact h + | k :: ks_bot, ks_top, _ => + absorbTowerA0Out_ne_nil ks_bot (absorbA0 k ks_top) (Or.inr (absorbA0_ne_nil k ks_top)) + +theorem towerA3_absorb_towerA0Out : ∀ (ks_bot ks_top : List ℕ) (S : List ℕ), + TopStep (TowerA3 ks_top (TowerA0Out ks_bot S)) + (TowerA3 (absorbTowerA0Out ks_bot ks_top) S) + | [], ks_top, S => topStep_refl _ + | k :: ks_bot, ks_top, S => by + simp only [TowerA0Out, absorbTowerA0Out] + exact topStep_trans (towerA3_absorb_A0 k ks_top (TowerA0Out ks_bot S)) + (towerA3_absorb_towerA0Out ks_bot (absorbA0 k ks_top) S) + +theorem towerA3_halt_len : ∀ (n : ℕ) (ks : List ℕ), ks.length = n + 1 → + ∀ {S : List ℕ}, SubHalt S → + ∃ cfg, ((cfg_F (0 :: TowerA3 ks S) [5]) [target_tm]⊢* cfg) ∧ (step target_tm cfg).isNone + | 0, ks, hlen, S, h => by + cases ks with + | nil => contradiction + | cons k ks' => + cases ks' with + | nil => exact topHalt_A3 k h + | cons _ _ => simp at hlen + | n + 1, ks, hlen, S, h => by + cases ks with + | nil => contradiction + | cons k ks_rest => + have hlen_rest : ks_rest.length = n + 1 := by simpa using hlen + have hne_rest : ks_rest ≠ [] := by + intro hnil; rw [hnil] at hlen_rest; contradiction + have h_top := towerA3_topStep ks_rest hne_rest (subStep_A3 k S) + have hlen_step : (stepTowerAt 2 ks_rest).length = n + 1 := by + rw [stepTowerAt_length]; exact hlen_rest + obtain ⟨cfg, h_halt, h_none⟩ := towerA3_halt_len n (stepTowerAt 2 ks_rest) hlen_step (subHalt_B3 k h) + exact ⟨cfg, stepStar_trans h_top h_halt, h_none⟩ + +theorem towerA3_halt (ks : List ℕ) (hks : ks ≠ []) {S : List ℕ} (h : SubHalt S) : + ∃ cfg, ((cfg_F (0 :: TowerA3 ks S) [5]) [target_tm]⊢* cfg) ∧ (step target_tm cfg).isNone := by + cases hlen : ks.length with + | zero => exact absurd (List.eq_nil_of_length_eq_zero hlen) hks + | succ n => exact towerA3_halt_len n ks hlen h + +theorem TowerA3_append : ∀ (ks₁ ks₂ : List ℕ) (S : List ℕ), + TowerA3 (ks₁ ++ ks₂) S = TowerA3 ks₂ (TowerA3 ks₁ S) + | [], _, _ => rfl + | k :: ks₁, ks₂, S => by + simp only [List.cons_append, TowerA3] + exact TowerA3_append ks₁ ks₂ (A3 k S) + +-- ============================================================================ +-- Section 4: Computable RLE Stack Simulator (`stepGenRLE` & `runSubSim`) +-- ============================================================================ + +abbrev RLEStack := List (ℕ × ℕ) + +def evalRLE : RLEStack → List ℕ + | [] => [] + | (v, c) :: s => List.replicate c v ++ evalRLE s + +def tailFor (isOpen : Bool) (bot : List ℕ) : List ℕ := + if isOpen then bot else [] + +def evalRLEWith (isOpen : Bool) (s : RLEStack) (bot : List ℕ) : List ℕ := + evalRLE s ++ tailFor isOpen bot + +@[simp] +theorem evalRLEWith_false (s : RLEStack) (bot : List ℕ) : + evalRLEWith false s bot = evalRLE s := by + simp [evalRLEWith, tailFor] + +@[simp] +theorem evalRLEWith_true (s : RLEStack) (bot : List ℕ) : + evalRLEWith true s bot = evalRLE s ++ bot := by + simp [evalRLEWith, tailFor] + +def pushRun (v c : ℕ) (s : RLEStack) : RLEStack := + if c = 0 then s + else match s with + | [] => forceNat v (fun v0 => forceNat c (fun c0 => [(v0, c0)])) + | (v', c') :: rest => + if v = v' then forceNat (c + c') (fun cc => (v', cc) :: rest) + else forceNat v (fun v0 => forceNat c (fun c0 => (v0, c0) :: (v', c') :: rest)) + +theorem evalRLE_pushRun (v c : ℕ) (s : RLEStack) : + evalRLE (pushRun v c s) = List.replicate c v ++ evalRLE s := by + unfold pushRun + split_ifs with hc + · subst hc; rfl + · cases s with + | nil => simp [evalRLE] + | cons hd rest => + rcases hd with ⟨v', c'⟩ + dsimp + split_ifs with hv + · subst hv + rw [evalRLE, evalRLE, List.replicate_add, List.append_assoc] + · simp [evalRLE] + +theorem evalRLEWith_pushRun (isOpen : Bool) (v c : ℕ) (s : RLEStack) (bot : List ℕ) : + evalRLEWith isOpen (pushRun v c s) bot = List.replicate c v ++ evalRLEWith isOpen s bot := by + simp [evalRLEWith, evalRLE_pushRun, List.append_assoc] + +theorem evalRLEWith_pushOne (isOpen : Bool) (v : ℕ) (s : RLEStack) (bot : List ℕ) : + evalRLEWith isOpen (pushRun v 1 s) bot = v :: evalRLEWith isOpen s bot := by + simpa using evalRLEWith_pushRun isOpen v 1 s bot + +def popOne : RLEStack → Option (ℕ × RLEStack) + | [] => none + | (_, 0) :: s => popOne s + | (v, c + 1) :: s => some (v, if c = 0 then s else (v, c) :: s) + +theorem evalRLE_popOne_some : ∀ {s s' : RLEStack} {v : ℕ}, + popOne s = some (v, s') → evalRLE s = v :: evalRLE s' + | [], _, _, h => by simp [popOne] at h + | (_, 0) :: s, s', v, h => by + simp only [popOne, evalRLE, List.replicate_zero, List.nil_append] at h ⊢ + exact evalRLE_popOne_some h + | (w, c + 1) :: s, s', v, h => by + simp only [popOne, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + split_ifs with hc + · subst hc; simp [evalRLE] + · simp [evalRLE, List.replicate_succ] + +theorem evalRLE_popOne_none : ∀ {s : RLEStack}, + popOne s = none → evalRLE s = [] + | [], _ => rfl + | (_, 0) :: s, h => by + simp only [popOne, evalRLE, List.replicate_zero, List.nil_append] at h ⊢ + exact evalRLE_popOne_none h + | (_, _ + 1) :: _, h => by simp [popOne] at h + +theorem evalRLEWith_popOne_some {isOpen : Bool} {s s' : RLEStack} {v : ℕ} (bot : List ℕ) + (h : popOne s = some (v, s')) : + evalRLEWith isOpen s bot = v :: evalRLEWith isOpen s' bot := by + simp [evalRLEWith, evalRLE_popOne_some h] + +theorem evalRLEWith_popOne_none_closed {s : RLEStack} (bot : List ℕ) + (h : popOne s = none) : + evalRLEWith false s bot = [] := by + simp [evalRLEWith, tailFor, evalRLE_popOne_none h] + +def bumpTopOpt (isOpen : Bool) (k : ℕ) (s : RLEStack) : Option RLEStack := + match k with + | 0 => some s + | m + 1 => + match popOne s with + | some (v, s') => some (pushRun (v + (m + 1)) 1 s') + | none => if isOpen then none else some (pushRun m 1 []) + +theorem evalRLEWith_bumpTopOpt {isOpen : Bool} {k : ℕ} {s s' : RLEStack} (bot : List ℕ) + (h : bumpTopOpt isOpen k s = some s') : + evalRLEWith isOpen s' bot = bumpHead^[k] (evalRLEWith isOpen s bot) := by + cases k with + | zero => + simp only [bumpTopOpt, Option.some.injEq] at h + subst h + rfl + | succ m => + simp only [bumpTopOpt] at h + cases hpop : popOne s with + | some vp => + rcases vp with ⟨v, s₁⟩ + rw [hpop] at h + simp only [Option.some.injEq] at h + subst h + rw [evalRLEWith_pushOne, evalRLEWith_popOne_some bot hpop, bumpHead_iterate_cons] + | none => + rw [hpop] at h + cases isOpen with + | true => simp at h + | false => + simp only [Bool.false_eq_true, ↓reduceIte, Option.some.injEq] at h + subst h + rw [evalRLEWith_pushOne, evalRLEWith_popOne_none_closed bot hpop, + evalRLEWith, tailFor, evalRLE, bumpHead_iterate_nil] + rfl + +inductive GenStepResult where + | stepped (mode : StackMode) (L R : RLEStack) + | halted + | abort + deriving DecidableEq, Repr + +def tryFastF (L R : RLEStack) : Option (RLEStack × RLEStack) := + match L with + | [] => none + | (v, c) :: L_rest => + match v with + | 0 => + if 5 ≤ c then + match popOne R with + | none => none + | some (r0, R₁) => + match r0 with + | 0 => + match popOne R₁ with + | none => none + | some (d, R₂) => + let k := (c - 1) / 4 + let rem := (c - 1) % 4 + forceNat (rem + 1) (fun r1 => + some ((0, r1) :: L_rest, pushRun 0 1 (pushRun (d + 8 * k) 1 R₂))) + | _ + 1 => none + else none + | _ + 1 => none + +theorem tryFastF_sound {openL openR : Bool} {L R L' R' : RLEStack} (L_bot R_bot : List ℕ) + (h : tryFastF L R = some (L', R')) : + (cfg_F (evalRLEWith openL L L_bot) (evalRLEWith openR R R_bot)) [target_tm]⊢* + (cfg_F (evalRLEWith openL L' L_bot) (evalRLEWith openR R' R_bot)) := by + unfold tryFastF at h + rcases L with _ | ⟨⟨_ | v, c⟩, L_rest⟩ + · simp at h + · dsimp at h + split_ifs at h with hc + cases hR1 : popOne R with + | none => rw [hR1] at h; simp at h + | some vp1 => + rcases vp1 with ⟨r0, R₁⟩ + rw [hR1] at h + cases r0 with + | succ _ => simp at h + | zero => + dsimp at h + cases hR2 : popOne R₁ with + | none => rw [hR2] at h; simp at h + | some vp2 => + rcases vp2 with ⟨d, R₂⟩ + rw [hR2] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + have hL : evalRLEWith openL ((0, c) :: L_rest) L_bot = + List.replicate (4 * ((c - 1) / 4) + ((c - 1) % 4) + 1) 0 ++ + evalRLEWith openL L_rest L_bot := by + have h_eq : c = 4 * ((c - 1) / 4) + ((c - 1) % 4) + 1 := by omega + simp [evalRLEWith, evalRLE, List.append_assoc, ← h_eq] + have hL' : evalRLEWith openL ((0, (c - 1) % 4 + 1) :: L_rest) L_bot = + List.replicate ((c - 1) % 4 + 1) 0 ++ evalRLEWith openL L_rest L_bot := by + simp [evalRLEWith, evalRLE, List.append_assoc] + have hR : evalRLEWith openR R R_bot = 0 :: d :: evalRLEWith openR R₂ R_bot := by + rw [evalRLEWith_popOne_some R_bot hR1, evalRLEWith_popOne_some R_bot hR2] + have hR' : evalRLEWith openR (pushRun 0 1 (pushRun (d + 8 * ((c - 1) / 4)) 1 R₂)) R_bot = + 0 :: (d + 8 * ((c - 1) / 4)) :: evalRLEWith openR R₂ R_bot := by + rw [evalRLEWith_pushOne, evalRLEWith_pushOne] + rw [hL, hL', hR, hR'] + exact rule_F_zero4_all ((c - 1) / 4) ((c - 1) % 4) (evalRLEWith openL L_rest L_bot) + d (evalRLEWith openR R₂ R_bot) + · simp at h + +def tryFastAR_ones (fast1 : Bool) (L R : RLEStack) : Option (RLEStack × RLEStack) := + if !fast1 then none + else match R with + | [] => none + | (v, c) :: R_rest => + match v with + | 0 => none + | 1 => + if 2 ≤ c then + match popOne L with + | none => none + | some (l0, L₁) => + match l0 with + | 0 => + match popOne L₁ with + | none => none + | some (b, L₂) => + let m := c - 1 + some (pushRun 0 1 (pushRun (b + 3 * m) 1 L₂), (1, 1) :: R_rest) + | _ + 1 => none + else none + | _ + 2 => none + +theorem tryFastAR_ones_sound {openL openR fast1 : Bool} {L R L' R' : RLEStack} + (L_bot R_bot : List ℕ) (h : tryFastAR_ones fast1 L R = some (L', R')) : + (cfg_AR (evalRLEWith openL L L_bot) (evalRLEWith openR R R_bot)) [target_tm]⊢* + (cfg_AR (evalRLEWith openL L' L_bot) (evalRLEWith openR R' R_bot)) := by + unfold tryFastAR_ones at h + cases fast1 + · simp at h + · rcases R with _ | ⟨⟨_ | _ | v, c⟩, R_rest⟩ + · simp at h + · simp at h + · dsimp at h + split_ifs at h with hc + cases hL1 : popOne L with + | none => rw [hL1] at h; simp at h + | some vp1 => + rcases vp1 with ⟨l0, L₁⟩ + rw [hL1] at h + cases l0 with + | succ _ => simp at h + | zero => + dsimp at h + cases hL2 : popOne L₁ with + | none => rw [hL2] at h; simp at h + | some vp2 => + rcases vp2 with ⟨b, L₂⟩ + rw [hL2] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + have hL : evalRLEWith openL L L_bot = 0 :: b :: evalRLEWith openL L₂ L_bot := by + rw [evalRLEWith_popOne_some L_bot hL1, evalRLEWith_popOne_some L_bot hL2] + have hL' : evalRLEWith openL (pushRun 0 1 (pushRun (b + 3 * (c - 1)) 1 L₂)) L_bot = + 0 :: (b + 3 * (c - 1)) :: evalRLEWith openL L₂ L_bot := by + rw [evalRLEWith_pushOne, evalRLEWith_pushOne] + have hR : evalRLEWith openR ((1, c) :: R_rest) R_bot = + List.replicate ((c - 1) + 1) 1 ++ evalRLEWith openR R_rest R_bot := by + have hc_eq : c = (c - 1) + 1 := by omega + simp [evalRLEWith, evalRLE, List.append_assoc, ← hc_eq] + have hR' : evalRLEWith openR ((1, 1) :: R_rest) R_bot = + 1 :: evalRLEWith openR R_rest R_bot := by + simp [evalRLEWith, evalRLE] + rw [hL, hL', hR, hR'] + exact rule_AR_ones_all (c - 1) b (evalRLEWith openL L₂ L_bot) + (evalRLEWith openR R_rest R_bot) + · simp at h + +def tryFastAR_zeroOnes (L R : RLEStack) : Option (RLEStack × RLEStack) := + match R with + | [] => none + | (v1, c1) :: R_tail => + match R_tail with + | [] => none + | (v2, m) :: R_rest => + if v1 == 0 && c1 == 1 && v2 == 1 && 1 ≤ m then + match popOne L with + | none => none + | some (l0, L₁) => + match l0 with + | 0 => + match popOne L₁ with + | none => none + | some (b, L₂) => + some (pushRun 0 1 (pushRun (b + 3 * m) 1 L₂), pushRun 0 1 R_rest) + | _ + 1 => none + else none + +theorem tryFastAR_zeroOnes_sound {openL openR : Bool} {L R L' R' : RLEStack} + (L_bot R_bot : List ℕ) (h : tryFastAR_zeroOnes L R = some (L', R')) : + (cfg_AR (evalRLEWith openL L L_bot) (evalRLEWith openR R R_bot)) [target_tm]⊢* + (cfg_AR (evalRLEWith openL L' L_bot) (evalRLEWith openR R' R_bot)) := by + unfold tryFastAR_zeroOnes at h + rcases R with _ | ⟨⟨v1, c1⟩, _ | ⟨⟨v2, m⟩, R_rest⟩⟩ + · simp at h + · simp at h + · dsimp at h + split_ifs at h with hcond + simp only [Bool.and_eq_true, beq_iff_eq, decide_eq_true_eq] at hcond + rcases hcond with ⟨⟨⟨rfl, rfl⟩, rfl⟩, hm⟩ + cases hL1 : popOne L with + | none => rw [hL1] at h; simp at h + | some vp1 => + rcases vp1 with ⟨l0, L₁⟩ + rw [hL1] at h + cases l0 with + | succ _ => simp at h + | zero => + dsimp at h + cases hL2 : popOne L₁ with + | none => rw [hL2] at h; simp at h + | some vp2 => + rcases vp2 with ⟨b, L₂⟩ + rw [hL2] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + have hL : evalRLEWith openL L L_bot = 0 :: b :: evalRLEWith openL L₂ L_bot := by + rw [evalRLEWith_popOne_some L_bot hL1, evalRLEWith_popOne_some L_bot hL2] + have hL' : evalRLEWith openL (pushRun 0 1 (pushRun (b + 3 * m) 1 L₂)) L_bot = + 0 :: (b + 3 * m) :: evalRLEWith openL L₂ L_bot := by + rw [evalRLEWith_pushOne, evalRLEWith_pushOne] + have hR : evalRLEWith openR ((0, 1) :: (1, m) :: R_rest) R_bot = + 0 :: (List.replicate m 1 ++ evalRLEWith openR R_rest R_bot) := by + simp [evalRLEWith, evalRLE, List.append_assoc] + have hR' : evalRLEWith openR (pushRun 0 1 R_rest) R_bot = + 0 :: evalRLEWith openR R_rest R_bot := by + rw [evalRLEWith_pushOne] + rw [hL, hL', hR, hR'] + exact rule_AR_zero_ones_all m b (evalRLEWith openL L₂ L_bot) + (evalRLEWith openR R_rest R_bot) + +def stepGenF_slow (openL openR : Bool) (L R : RLEStack) : GenStepResult := + match popOne L with + | none => + if openL then .abort + else .stepped .AR (pushRun 1 1 []) R + | some (a, L₁) => + match a with + | 0 => + match popOne L₁ with + | none => + if openL then .abort + else match bumpTopOpt openR 1 R with + | none => .abort + | some R₁ => .stepped .F [] (pushRun 0 1 R₁) + | some (b, L₂) => + match b with + | 0 => + match bumpTopOpt openL 2 L₂ with + | none => .abort + | some L₃ => .stepped .F L₃ (pushRun 0 1 R) + | 1 => + match bumpTopOpt openR 1 R with + | none => .abort + | some R₁ => .stepped .F L₂ (pushRun 2 1 R₁) + | b' + 2 => + match bumpTopOpt openR 1 R with + | none => .abort + | some R₁ => .stepped .AR (pushRun b' 1 L₂) (pushRun 0 2 R₁) + | 1 => .halted + | 2 => + match bumpTopOpt openL 2 L₁ with + | none => .abort + | some L₂ => + match bumpTopOpt openR 1 R with + | none => .abort + | some R₁ => .stepped .AR L₂ (pushRun 0 1 R₁) + | a' + 3 => + match bumpTopOpt openR 1 R with + | none => .abort + | some R₁ => + .stepped .F (pushRun (a' % 3) 1 L₁) + (pushRun 0 1 (pushRun 1 (a' / 3) R₁)) + +theorem stepGenF_slow_sound_step {openL openR : Bool} {L R L' R' : RLEStack} {mode' : StackMode} + (L_bot R_bot : List ℕ) (h : stepGenF_slow openL openR L R = .stepped mode' L' R') : + (cfg_F (evalRLEWith openL L L_bot) (evalRLEWith openR R R_bot)) [target_tm]⊢* + (evalStackCfg mode' (evalRLEWith openL L' L_bot) (evalRLEWith openR R' R_bot)) := by + unfold stepGenF_slow at h + cases hpopL : popOne L with + | none => + rw [hpopL] at h + cases openL with + | true => simp at h + | false => + simp only [Bool.false_eq_true, ↓reduceIte, GenStepResult.stepped.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + rw [evalStackCfg_AR, evalRLEWith_popOne_none_closed L_bot hpopL] + have h1 : evalRLEWith false (pushRun 1 1 []) L_bot = [1] := by + simp [evalRLEWith, tailFor, pushRun, evalRLE] + rw [h1] + exact stepPlus_stepStar (rule_F_nil (evalRLEWith openR R R_bot)) + | some vp => + rcases vp with ⟨a, L₁⟩ + rw [hpopL] at h + have hL : evalRLEWith openL L L_bot = a :: evalRLEWith openL L₁ L_bot := + evalRLEWith_popOne_some L_bot hpopL + rcases a with _ | _ | _ | a' + · dsimp at h + cases hpopL1 : popOne L₁ with + | none => + rw [hpopL1] at h + cases openL with + | true => simp at h + | false => + dsimp at h + cases hR1 : bumpTopOpt openR 1 R with + | none => rw [hR1] at h; simp at h + | some R₁ => + rw [hR1] at h + simp only [GenStepResult.stepped.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + rw [evalStackCfg_F, hL, evalRLEWith_popOne_none_closed L_bot hpopL1, + evalRLEWith_pushOne, evalRLEWith_bumpTopOpt R_bot hR1] + simpa [evalRLEWith, tailFor, evalRLE] using + stepPlus_stepStar (rule_F_zero_nil (evalRLEWith openR R R_bot)) + | some vp2 => + rcases vp2 with ⟨b, L₂⟩ + rw [hpopL1] at h + have hL1 : evalRLEWith openL L₁ L_bot = b :: evalRLEWith openL L₂ L_bot := + evalRLEWith_popOne_some L_bot hpopL1 + rcases b with _ | _ | b' + · dsimp at h + cases hL2 : bumpTopOpt openL 2 L₂ with + | none => rw [hL2] at h; simp at h + | some L₃ => + rw [hL2] at h + simp only [GenStepResult.stepped.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + rw [evalStackCfg_F, hL, hL1, evalRLEWith_bumpTopOpt L_bot hL2, evalRLEWith_pushOne] + exact stepPlus_stepStar (rule_F_zero_zero (evalRLEWith openL L₂ L_bot) + (evalRLEWith openR R R_bot)) + · dsimp at h + cases hR1 : bumpTopOpt openR 1 R with + | none => rw [hR1] at h; simp at h + | some R₁ => + rw [hR1] at h + simp only [GenStepResult.stepped.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + rw [evalStackCfg_F, hL, hL1, evalRLEWith_pushOne, evalRLEWith_bumpTopOpt R_bot hR1] + exact stepPlus_stepStar (rule_F_zero_one (evalRLEWith openL L₂ L_bot) + (evalRLEWith openR R R_bot)) + · dsimp at h + cases hR1 : bumpTopOpt openR 1 R with + | none => rw [hR1] at h; simp at h + | some R₁ => + rw [hR1] at h + simp only [GenStepResult.stepped.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + rw [evalStackCfg_AR, hL, hL1, evalRLEWith_pushOne, evalRLEWith_pushRun, + evalRLEWith_bumpTopOpt R_bot hR1] + exact stepPlus_stepStar (rule_F_zero_add_two (evalRLEWith openL L₂ L_bot) + (evalRLEWith openR R R_bot) b') + · simp at h + · dsimp at h + cases hL2 : bumpTopOpt openL 2 L₁ with + | none => rw [hL2] at h; simp at h + | some L₂ => + rw [hL2] at h + dsimp at h + cases hR1 : bumpTopOpt openR 1 R with + | none => rw [hR1] at h; simp at h + | some R₁ => + rw [hR1] at h + simp only [GenStepResult.stepped.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + rw [evalStackCfg_AR, hL, evalRLEWith_bumpTopOpt L_bot hL2, evalRLEWith_pushOne, + evalRLEWith_bumpTopOpt R_bot hR1] + exact stepPlus_stepStar (rule_F_two (evalRLEWith openL L₁ L_bot) + (evalRLEWith openR R R_bot)) + · dsimp at h + cases hR1 : bumpTopOpt openR 1 R with + | none => rw [hR1] at h; simp at h + | some R₁ => + rw [hR1] at h + simp only [GenStepResult.stepped.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + have hL_eq : evalRLEWith openL L L_bot = + (3 * (a' / 3 + 1) + (a' % 3)) :: evalRLEWith openL L₁ L_bot := by + rw [hL]; congr 1; omega + rw [evalStackCfg_F, hL_eq, evalRLEWith_pushOne, evalRLEWith_pushOne, + evalRLEWith_pushRun, evalRLEWith_bumpTopOpt R_bot hR1] + have h_step := rule_F_step3_all (evalRLEWith openL L₁ L_bot) (evalRLEWith openR R R_bot) + (a' % 3) (a' / 3 + 1) + rw [stepF3Right_succ] at h_step + exact h_step + +theorem stepGenF_slow_sound_halt {openL openR : Bool} {L R : RLEStack} + (L_bot R_bot : List ℕ) (h : stepGenF_slow openL openR L R = .halted) : + ∃ cfg, ((cfg_F (evalRLEWith openL L L_bot) (evalRLEWith openR R R_bot)) [target_tm]⊢* cfg) ∧ + (step target_tm cfg).isNone := by + unfold stepGenF_slow at h + cases hpopL : popOne L with + | none => + rw [hpopL] at h + cases openL <;> simp at h + | some vp => + rcases vp with ⟨a, L₁⟩ + rw [hpopL] at h + rcases a with _ | _ | _ | a' + · dsimp at h + cases hpopL1 : popOne L₁ with + | none => + rw [hpopL1] at h + cases openL with + | true => simp at h + | false => + dsimp at h + cases hR1 : bumpTopOpt openR 1 R <;> simp [hR1] at h + | some vp2 => + rcases vp2 with ⟨b, L₂⟩ + rw [hpopL1] at h + rcases b with _ | _ | b' + · dsimp at h; cases hL2 : bumpTopOpt openL 2 L₂ <;> simp [hL2] at h + · dsimp at h; cases hR1 : bumpTopOpt openR 1 R <;> simp [hR1] at h + · dsimp at h; cases hR1 : bumpTopOpt openR 1 R <;> simp [hR1] at h + · rw [evalRLEWith_popOne_some L_bot hpopL] + exact rule_F_one_halt (evalRLEWith openL L₁ L_bot) (evalRLEWith openR R R_bot) + · dsimp at h + cases hL2 : bumpTopOpt openL 2 L₁ with + | none => rw [hL2] at h; simp at h + | some L₂ => + rw [hL2] at h + dsimp at h + cases hR1 : bumpTopOpt openR 1 R <;> simp [hR1] at h + · dsimp at h + cases hR1 : bumpTopOpt openR 1 R <;> simp [hR1] at h + +def stepGenAR_slow (openL openR : Bool) (L R : RLEStack) : GenStepResult := + match popOne R with + | none => + if openR then .abort + else .stepped .F L (pushRun 1 1 []) + | some (d, R₁) => + match d with + | 0 => + match popOne L with + | none => + if openL then .abort + else match bumpTopOpt openR 2 R₁ with + | none => .abort + | some R₂ => .stepped .F [] R₂ + | some (a, L₁) => + match a with + | 0 => + match bumpTopOpt openL 3 L₁ with + | none => .abort + | some L₂ => + match bumpTopOpt openR 1 R₁ with + | none => .abort + | some R₂ => .stepped .AR L₂ R₂ + | 1 => + match bumpTopOpt openR 4 R₁ with + | none => .abort + | some R₂ => .stepped .F L₁ R₂ + | a' + 2 => + let k := (a' + 2) / 2 + match bumpTopOpt openR (2 * k) R₁ with + | none => .abort + | some R₂ => .stepped .AR (pushRun ((a' + 2) % 2) 1 L₁) (pushRun 0 1 R₂) + | 1 => + match popOne R₁ with + | none => + if openR then .abort + else .stepped .AR (pushRun 0 1 L) [] + | some (e, R₂) => + .stepped .AR L (pushRun 0 1 (pushRun (e + 1) 1 R₂)) + | d' + 2 => + let k := (d' + 2) / 2 + .stepped .AR (pushRun 0 k L) (pushRun ((d' + 2) % 2) 1 R₁) + +theorem stepGenAR_slow_sound_step {openL openR : Bool} {L R L' R' : RLEStack} {mode' : StackMode} + (L_bot R_bot : List ℕ) (h : stepGenAR_slow openL openR L R = .stepped mode' L' R') : + (cfg_AR (evalRLEWith openL L L_bot) (evalRLEWith openR R R_bot)) [target_tm]⊢* + (evalStackCfg mode' (evalRLEWith openL L' L_bot) (evalRLEWith openR R' R_bot)) := by + unfold stepGenAR_slow at h + cases hpopR : popOne R with + | none => + rw [hpopR] at h + cases openR with + | true => simp at h + | false => + simp only [Bool.false_eq_true, ↓reduceIte, GenStepResult.stepped.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + rw [evalStackCfg_F, evalRLEWith_popOne_none_closed R_bot hpopR] + have h1 : evalRLEWith false (pushRun 1 1 []) R_bot = [1] := by + simp [evalRLEWith, tailFor, pushRun, evalRLE] + rw [h1] + exact stepPlus_stepStar (rule_AR_nil (evalRLEWith openL L L_bot)) + | some vp => + rcases vp with ⟨d, R₁⟩ + rw [hpopR] at h + have hR : evalRLEWith openR R R_bot = d :: evalRLEWith openR R₁ R_bot := + evalRLEWith_popOne_some R_bot hpopR + rcases d with _ | _ | d' + · dsimp at h + cases hpopL : popOne L with + | none => + rw [hpopL] at h + cases openL with + | true => simp at h + | false => + dsimp at h + cases hR2 : bumpTopOpt openR 2 R₁ with + | none => rw [hR2] at h; simp at h + | some R₂ => + rw [hR2] at h + simp only [GenStepResult.stepped.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + rw [evalStackCfg_F, hR, evalRLEWith_popOne_none_closed L_bot hpopL, + evalRLEWith_bumpTopOpt R_bot hR2] + simpa [evalRLEWith, tailFor, evalRLE] using + stepPlus_stepStar (rule_AR_nil_zero (evalRLEWith openR R₁ R_bot)) + | some vpL => + rcases vpL with ⟨a, L₁⟩ + rw [hpopL] at h + have hL : evalRLEWith openL L L_bot = a :: evalRLEWith openL L₁ L_bot := + evalRLEWith_popOne_some L_bot hpopL + rcases a with _ | _ | a' + · dsimp at h + cases hL2 : bumpTopOpt openL 3 L₁ with + | none => rw [hL2] at h; simp at h + | some L₂ => + rw [hL2] at h + dsimp at h + cases hR2 : bumpTopOpt openR 1 R₁ with + | none => rw [hR2] at h; simp at h + | some R₂ => + rw [hR2] at h + simp only [GenStepResult.stepped.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + rw [evalStackCfg_AR, hL, hR, evalRLEWith_bumpTopOpt L_bot hL2, + evalRLEWith_bumpTopOpt R_bot hR2] + exact stepPlus_stepStar (rule_AR_zero_zero (evalRLEWith openL L₁ L_bot) + (evalRLEWith openR R₁ R_bot)) + · dsimp at h + cases hR2 : bumpTopOpt openR 4 R₁ with + | none => rw [hR2] at h; simp at h + | some R₂ => + rw [hR2] at h + simp only [GenStepResult.stepped.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + rw [evalStackCfg_F, hL, hR, evalRLEWith_bumpTopOpt R_bot hR2] + exact stepPlus_stepStar (rule_AR_one_zero (evalRLEWith openL L₁ L_bot) + (evalRLEWith openR R₁ R_bot)) + · dsimp at h + cases hR2 : bumpTopOpt openR (2 * ((a' + 2) / 2)) R₁ with + | none => rw [hR2] at h; simp at h + | some R₂ => + rw [hR2] at h + simp only [GenStepResult.stepped.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + have hL_eq : evalRLEWith openL L L_bot = + (2 * ((a' + 2) / 2) + ((a' + 2) % 2)) :: evalRLEWith openL L₁ L_bot := by + rw [hL]; congr 1; omega + rw [evalStackCfg_AR, hL_eq, hR, evalRLEWith_pushOne, evalRLEWith_pushOne, + evalRLEWith_bumpTopOpt R_bot hR2, ← bumpHead2_iterate_eq] + exact rule_AR_add_two_zero_all (evalRLEWith openL L₁ L_bot) + (evalRLEWith openR R₁ R_bot) ((a' + 2) % 2) ((a' + 2) / 2) + · dsimp at h + cases hpopR1 : popOne R₁ with + | none => + rw [hpopR1] at h + cases openR with + | true => simp at h + | false => + simp only [Bool.false_eq_true, ↓reduceIte, GenStepResult.stepped.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + rw [evalStackCfg_AR, hR, evalRLEWith_popOne_none_closed R_bot hpopR1, + evalRLEWith_pushOne] + simpa [evalRLEWith, tailFor, evalRLE] using + stepPlus_stepStar (rule_AR_one_nil (evalRLEWith openL L L_bot)) + | some vpR2 => + rcases vpR2 with ⟨e, R₂⟩ + rw [hpopR1] at h + dsimp at h + simp only [GenStepResult.stepped.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + rw [evalStackCfg_AR, hR, evalRLEWith_popOne_some R_bot hpopR1, + evalRLEWith_pushOne, evalRLEWith_pushOne] + exact stepPlus_stepStar (rule_AR_one_cons (evalRLEWith openL L L_bot) + (evalRLEWith openR R₂ R_bot) e) + · dsimp at h + simp only [GenStepResult.stepped.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + have hR_eq : evalRLEWith openR R R_bot = + (2 * ((d' + 2) / 2) + ((d' + 2) % 2)) :: evalRLEWith openR R₁ R_bot := by + rw [hR]; congr 1; omega + rw [evalStackCfg_AR, hR_eq, evalRLEWith_pushRun, evalRLEWith_pushOne] + exact rule_AR_step2_all (evalRLEWith openL L L_bot) (evalRLEWith openR R₁ R_bot) + ((d' + 2) % 2) ((d' + 2) / 2) + +theorem stepGenAR_slow_not_halt (openL openR : Bool) (L R : RLEStack) : + stepGenAR_slow openL openR L R ≠ .halted := by + unfold stepGenAR_slow + cases popOne R with + | none => cases openR <;> simp + | some vp => + rcases vp with ⟨d, R₁⟩ + rcases d with _ | _ | d' + · dsimp + cases popOne L with + | none => + cases openL with + | true => simp + | false => dsimp; cases bumpTopOpt openR 2 R₁ <;> simp + | some vpL => + rcases vpL with ⟨a, L₁⟩ + rcases a with _ | _ | a' + · dsimp + cases bumpTopOpt openL 3 L₁ with + | none => simp + | some _ => dsimp; cases bumpTopOpt openR 1 R₁ <;> simp + · dsimp; cases bumpTopOpt openR 4 R₁ <;> simp + · dsimp; cases bumpTopOpt openR (2 * ((a' + 2) / 2)) R₁ <;> simp + · dsimp + cases popOne R₁ with + | none => cases openR <;> simp + | some vp2 => rcases vp2 with ⟨_, _⟩; simp + · simp + +def stepGenRLE (openL openR fast1 : Bool) (mode : StackMode) (L R : RLEStack) : GenStepResult := + match mode with + | .F => + match tryFastF L R with + | some (L', R') => .stepped .F L' R' + | none => stepGenF_slow openL openR L R + | .AR => + match tryFastAR_ones fast1 L R with + | some (L', R') => .stepped .AR L' R' + | none => + match tryFastAR_zeroOnes L R with + | some (L', R') => .stepped .AR L' R' + | none => stepGenAR_slow openL openR L R + +theorem stepGenRLE_sound_step {openL openR fast1 : Bool} {mode mode' : StackMode} + {L R L' R' : RLEStack} (L_bot R_bot : List ℕ) + (h : stepGenRLE openL openR fast1 mode L R = .stepped mode' L' R') : + (evalStackCfg mode (evalRLEWith openL L L_bot) (evalRLEWith openR R R_bot)) [target_tm]⊢* + (evalStackCfg mode' (evalRLEWith openL L' L_bot) (evalRLEWith openR R' R_bot)) := by + unfold stepGenRLE at h + cases mode with + | F => + cases hfast : tryFastF L R with + | some vp => + rcases vp with ⟨Lf, Rf⟩ + rw [hfast] at h + simp only [GenStepResult.stepped.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + exact tryFastF_sound L_bot R_bot hfast + | none => + rw [hfast] at h + exact stepGenF_slow_sound_step L_bot R_bot h + | AR => + cases hfast1 : tryFastAR_ones fast1 L R with + | some vp => + rcases vp with ⟨Lf, Rf⟩ + rw [hfast1] at h + simp only [GenStepResult.stepped.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + exact tryFastAR_ones_sound L_bot R_bot hfast1 + | none => + rw [hfast1] at h + cases hfast2 : tryFastAR_zeroOnes L R with + | some vp => + rcases vp with ⟨Lf, Rf⟩ + rw [hfast2] at h + simp only [GenStepResult.stepped.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + exact tryFastAR_zeroOnes_sound L_bot R_bot hfast2 + | none => + rw [hfast2] at h + exact stepGenAR_slow_sound_step L_bot R_bot h + +theorem stepGenRLE_sound_halt {openL openR fast1 : Bool} {mode : StackMode} {L R : RLEStack} + (L_bot R_bot : List ℕ) (h : stepGenRLE openL openR fast1 mode L R = .halted) : + ∃ cfg, ((evalStackCfg mode (evalRLEWith openL L L_bot) (evalRLEWith openR R R_bot)) [target_tm]⊢* cfg) ∧ + (step target_tm cfg).isNone := by + unfold stepGenRLE at h + cases mode with + | F => + cases hfast : tryFastF L R with + | some vp => + rcases vp with ⟨_, _⟩ + rw [hfast] at h + simp at h + | none => + rw [hfast] at h + exact stepGenF_slow_sound_halt L_bot R_bot h + | AR => + cases hfast1 : tryFastAR_ones fast1 L R with + | some vp => + rcases vp with ⟨_, _⟩ + rw [hfast1] at h + simp at h + | none => + rw [hfast1] at h + cases hfast2 : tryFastAR_zeroOnes L R with + | some vp => + rcases vp with ⟨_, _⟩ + rw [hfast2] at h + simp at h + | none => + rw [hfast2] at h + exact absurd h (stepGenAR_slow_not_halt openL openR L R) + +def runStepsRLE : ℕ → Bool → Bool → Bool → StackMode → RLEStack → RLEStack → GenStepResult + | 0, _, _, _, mode, L, R => .stepped mode L R + | n + 1, openL, openR, fast1, mode, L, R => + match stepGenRLE openL openR fast1 mode L R with + | .stepped mode₁ L₁ R₁ => runStepsRLE n openL openR fast1 mode₁ L₁ R₁ + | .halted => .halted + | .abort => .abort + +theorem runStepsRLE_sound_step : ∀ {n : ℕ} {openL openR fast1 : Bool} {mode mode' : StackMode} + {L R L' R' : RLEStack} (L_bot R_bot : List ℕ), + runStepsRLE n openL openR fast1 mode L R = .stepped mode' L' R' → + (evalStackCfg mode (evalRLEWith openL L L_bot) (evalRLEWith openR R R_bot)) [target_tm]⊢* + (evalStackCfg mode' (evalRLEWith openL L' L_bot) (evalRLEWith openR R' R_bot)) + | 0, _, _, _, _, _, _, _, _, _, _, _, h => by + simp only [runStepsRLE, GenStepResult.stepped.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + try exact ⟨0, rfl⟩ + | n + 1, openL, openR, fast1, mode, mode', L, R, L', R', L_bot, R_bot, h => by + unfold runStepsRLE at h + cases hstep : stepGenRLE openL openR fast1 mode L R with + | stepped mode₁ L₁ R₁ => + rw [hstep] at h + exact stepStar_trans (stepGenRLE_sound_step L_bot R_bot hstep) + (runStepsRLE_sound_step L_bot R_bot h) + | halted => rw [hstep] at h; simp at h + | abort => rw [hstep] at h; simp at h + +def peelZeros : ℕ → RLEStack → Option RLEStack + | 0, s => some s + | n + 1, s => + match popOne s with + | none => none + | some (v, s') => + match v with + | 0 => peelZeros n s' + | _ + 1 => none + +theorem evalRLE_peelZeros : ∀ {n : ℕ} {s s' : RLEStack}, + peelZeros n s = some s' → evalRLE s = List.replicate n 0 ++ evalRLE s' + | 0, _, _, h => by + simp only [peelZeros, Option.some.injEq] at h + subst h + rfl + | n + 1, s, s', h => by + unfold peelZeros at h + cases hpop : popOne s with + | none => rw [hpop] at h; simp at h + | some vp => + rcases vp with ⟨v, s₁⟩ + rw [hpop] at h + cases v with + | succ _ => simp at h + | zero => + dsimp at h + rw [evalRLE_popOne_some hpop, evalRLE_peelZeros h] + rfl + +theorem evalRLEWith_peelZeros {isOpen : Bool} {n : ℕ} {s s' : RLEStack} (bot : List ℕ) + (h : peelZeros n s = some s') : + evalRLEWith isOpen s bot = List.replicate n 0 ++ evalRLEWith isOpen s' bot := by + simp [evalRLEWith, evalRLE_peelZeros h, List.append_assoc] + +def isSingleVal (v : ℕ) (s : RLEStack) : Bool := + match popOne s with + | some (w, s') => (w == v) && (popOne s').isNone + | none => false + +theorem evalRLEWith_isSingleVal {v : ℕ} {s : RLEStack} (bot : List ℕ) + (h : isSingleVal v s = true) : + evalRLEWith true s bot = v :: bot := by + unfold isSingleVal at h + cases hpop1 : popOne s with + | none => rw [hpop1] at h; simp at h + | some vp => + rcases vp with ⟨w, s'⟩ + rw [hpop1] at h + simp only [Bool.and_eq_true, beq_iff_eq, Option.isNone_iff_eq_none] at h + rcases h with ⟨rfl, hpop2⟩ + simp [evalRLEWith, tailFor, evalRLE_popOne_some hpop1, evalRLE_popOne_none hpop2] + +theorem evalRLE_isSingleVal {v : ℕ} {s : RLEStack} (h : isSingleVal v s = true) : + evalRLE s = [v] := by + have h1 := evalRLEWith_isSingleVal [] h + simpa [evalRLEWith, tailFor] using h1 + +inductive SubSimResult where + | stepped (S' : RLEStack) + | halted + | abort + deriving DecidableEq, Repr + +def runSubLoop : ℕ → Bool → Bool → StackMode → RLEStack → RLEStack → SubSimResult + | 0, _, _, _, _, _ => .abort + | fuel + 1, openL, fast1, mode, L, R => + if mode == .AR && isSingleVal 0 R then + match peelZeros 5 L with + | some S' => .stepped S' + | none => .abort + else + match stepGenRLE openL true fast1 mode L R with + | .stepped mode' L' R' => runSubLoop fuel openL fast1 mode' L' R' + | .halted => .halted + | .abort => .abort + +def runSubSim (fuel : ℕ) (openL fast1 : Bool) (S : RLEStack) : SubSimResult := + runSubLoop fuel openL fast1 .F (pushRun 0 1 S) [(9, 1)] + +theorem runSubLoop_sound_step : ∀ {fuel : ℕ} {openL fast1 : Bool} {mode : StackMode} + {L R S' : RLEStack} (L_bot R_bot : List ℕ), + runSubLoop fuel openL fast1 mode L R = .stepped S' → + (evalStackCfg mode (evalRLEWith openL L L_bot) (evalRLEWith true R R_bot)) [target_tm]⊢* + (cfg_AR (0 :: 0 :: 0 :: 0 :: 0 :: evalRLEWith openL S' L_bot) (0 :: R_bot)) + | 0, _, _, _, _, _, _, _, _, h => by simp [runSubLoop] at h + | fuel + 1, openL, fast1, mode, L, R, S', L_bot, R_bot, h => by + unfold runSubLoop at h + split_ifs at h with hexit + · simp only [Bool.and_eq_true, beq_iff_eq] at hexit + rcases hexit with ⟨rfl, hR0⟩ + cases hpeel : peelZeros 5 L with + | none => rw [hpeel] at h; simp at h + | some S_out => + rw [hpeel] at h + simp only [SubSimResult.stepped.injEq] at h + subst h + rw [evalRLEWith_isSingleVal R_bot hR0, evalRLEWith_peelZeros L_bot hpeel] + try exact ⟨0, rfl⟩ + · cases hstep : stepGenRLE openL true fast1 mode L R with + | stepped mode' L' R' => + rw [hstep] at h + exact stepStar_trans (stepGenRLE_sound_step L_bot R_bot hstep) + (runSubLoop_sound_step L_bot R_bot h) + | halted => rw [hstep] at h; simp at h + | abort => rw [hstep] at h; simp at h + +theorem runSubLoop_sound_halt : ∀ {fuel : ℕ} {openL fast1 : Bool} {mode : StackMode} + {L R : RLEStack} (L_bot R_bot : List ℕ), + runSubLoop fuel openL fast1 mode L R = .halted → + ∃ cfg, ((evalStackCfg mode (evalRLEWith openL L L_bot) (evalRLEWith true R R_bot)) [target_tm]⊢* cfg) ∧ + (step target_tm cfg).isNone + | 0, _, _, _, _, _, _, _, h => by simp [runSubLoop] at h + | fuel + 1, openL, fast1, mode, L, R, L_bot, R_bot, h => by + unfold runSubLoop at h + split_ifs at h with hexit + · cases hpeel : peelZeros 5 L <;> simp [hpeel] at h + · cases hstep : stepGenRLE openL true fast1 mode L R with + | stepped mode' L' R' => + rw [hstep] at h + obtain ⟨cfg, h_rest, h_none⟩ := runSubLoop_sound_halt L_bot R_bot h + exact ⟨cfg, stepStar_trans (stepGenRLE_sound_step L_bot R_bot hstep) h_rest, h_none⟩ + | halted => + exact stepGenRLE_sound_halt L_bot R_bot hstep + | abort => rw [hstep] at h; simp at h + +theorem runSubSim_sound_closed {fuel : ℕ} {fast1 : Bool} {S S' : RLEStack} + (h : runSubSim fuel false fast1 S = .stepped S') : + SubStep (evalRLE S) (evalRLE S') := by + intro R_bot + have h1 := runSubLoop_sound_step [] R_bot h + simpa [evalRLEWith, tailFor, evalRLE_pushRun, evalRLE] using h1 + +theorem runSubSim_sound_open {fuel : ℕ} {fast1 : Bool} {S S' : RLEStack} (U : List ℕ) + (h : runSubSim fuel true fast1 S = .stepped S') : + SubStep (evalRLE S ++ U) (evalRLE S' ++ U) := by + intro R_bot + have h1 := runSubLoop_sound_step U R_bot h + simpa [evalRLEWith, tailFor, evalRLE_pushRun, evalRLE] using h1 + +theorem runSubSim_sound_halt {fuel : ℕ} {fast1 : Bool} {S : RLEStack} + (h : runSubSim fuel false fast1 S = .halted) : + SubHalt (evalRLE S) := by + intro R_bot + have h1 := runSubLoop_sound_halt [] R_bot h + simpa [evalRLEWith, tailFor, evalRLE_pushRun, evalRLE] using h1 + +def peelOneA3 (s : RLEStack) : Option (ℕ × RLEStack) := + match popOne s with + | none => none + | some (v6, s₁) => + if v6 == 6 then + match peelZeros 3 s₁ with + | none => none + | some s₂ => + match popOne s₂ with + | none => none + | some (x, s₃) => + if 3 ≤ x && x % 3 == 0 then + match popOne s₃ with + | none => none + | some (v3, s₄) => + if v3 == 3 then + match popOne s₄ with + | none => none + | some (v0, s₅) => + if v0 == 0 then forceNat (x / 3 - 1) (fun k' => some (k', s₅)) + else none + else none + else none + else none + +theorem evalRLE_peelOneA3 {s s' : RLEStack} {k : ℕ} (h : peelOneA3 s = some (k, s')) : + evalRLE s = A3 k (evalRLE s') := by + unfold peelOneA3 at h + cases hp1 : popOne s with + | none => rw [hp1] at h; simp at h + | some vp1 => + rcases vp1 with ⟨v6, s₁⟩ + rw [hp1] at h + dsimp at h + split_ifs at h with hv6 + rw [beq_iff_eq] at hv6 + subst hv6 + cases hpz : peelZeros 3 s₁ with + | none => rw [hpz] at h; simp at h + | some s₂ => + rw [hpz] at h + dsimp at h + cases hp2 : popOne s₂ with + | none => rw [hp2] at h; simp at h + | some vp2 => + rcases vp2 with ⟨x, s₃⟩ + rw [hp2] at h + dsimp at h + split_ifs at h with hx + simp only [Bool.and_eq_true, decide_eq_true_eq, beq_iff_eq] at hx + cases hp3 : popOne s₃ with + | none => rw [hp3] at h; simp at h + | some vp3 => + rcases vp3 with ⟨v3, s₄⟩ + rw [hp3] at h + dsimp at h + split_ifs at h with hv3 + rw [beq_iff_eq] at hv3 + subst hv3 + cases hp4 : popOne s₄ with + | none => rw [hp4] at h; simp at h + | some vp4 => + rcases vp4 with ⟨v0, s₅⟩ + rw [hp4] at h + dsimp at h + split_ifs at h with hv0 + rw [beq_iff_eq] at hv0 + subst hv0 + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + have hx_eq : x = 3 * (x / 3 - 1) + 3 := by omega + rw [evalRLE_popOne_some hp1, evalRLE_peelZeros hpz, evalRLE_popOne_some hp2, + evalRLE_popOne_some hp3, evalRLE_popOne_some hp4] + simp [A3, ← hx_eq] + +def peelA3Loop : ℕ → List ℕ → RLEStack → List ℕ × RLEStack + | 0, acc, s => (acc, s) + | fuel + 1, acc, s => + match peelOneA3 s with + | some (k, s') => peelA3Loop fuel (k :: acc) s' + | none => (acc, s) + +theorem evalRLE_peelA3Loop : ∀ (fuel : ℕ) (acc : List ℕ) (s : RLEStack), + TowerA3 (peelA3Loop fuel acc s).1 (evalRLE (peelA3Loop fuel acc s).2) = + TowerA3 acc (evalRLE s) + | 0, _, _ => rfl + | fuel + 1, acc, s => by + unfold peelA3Loop + cases h : peelOneA3 s with + | none => rfl + | some vp => + rcases vp with ⟨k, s'⟩ + rw [evalRLE_peelA3Loop fuel (k :: acc) s', TowerA3, evalRLE_peelOneA3 h] + +def wrapOneA3RLE (k : ℕ) (s : RLEStack) : RLEStack := + pushRun 6 1 (pushRun 0 3 (pushRun (3 * k + 3) 1 (pushRun 3 1 (pushRun 0 1 s)))) + +def wrapTowerA3RLE : List ℕ → RLEStack → RLEStack + | [], s => s + | k :: ks, s => wrapTowerA3RLE ks (wrapOneA3RLE k s) + +theorem evalRLE_wrapOneA3RLE (k : ℕ) (s : RLEStack) : + evalRLE (wrapOneA3RLE k s) = A3 k (evalRLE s) := by + simp [wrapOneA3RLE, evalRLE_pushRun, A3] + +theorem evalRLE_wrapTowerA3RLE : ∀ (ks : List ℕ) (s : RLEStack), + evalRLE (wrapTowerA3RLE ks s) = TowerA3 ks (evalRLE s) + | [], _ => rfl + | k :: ks, s => by + simp only [wrapTowerA3RLE, TowerA3, evalRLE_wrapTowerA3RLE ks, evalRLE_wrapOneA3RLE] + +def wrapOneA0RLE (k : ℕ) (s : RLEStack) : RLEStack := + pushRun 6 1 (pushRun 0 3 (pushRun (3 * k + 3) 1 (pushRun 0 3 s))) + +def wrapTowerA0OutRLE : List ℕ → RLEStack → RLEStack + | [], s => s + | k :: ks, s => wrapOneA0RLE k (wrapTowerA0OutRLE ks s) + +theorem evalRLE_wrapOneA0RLE (k : ℕ) (s : RLEStack) : + evalRLE (wrapOneA0RLE k s) = A0 k (evalRLE s) := by + simp [wrapOneA0RLE, evalRLE_pushRun, A0] + +theorem evalRLE_wrapTowerA0OutRLE : ∀ (ks : List ℕ) (s : RLEStack), + evalRLE (wrapTowerA0OutRLE ks s) = TowerA0Out ks (evalRLE s) + | [], _ => rfl + | k :: ks, s => by + simp only [wrapTowerA0OutRLE, TowerA0Out, evalRLE_wrapOneA0RLE, evalRLE_wrapTowerA0OutRLE ks] + +-- ============================================================================ +-- Section 5: Three-Phase Halting Trajectory (`init [] -> HALT`) +-- ============================================================================ + +theorem evalRLE_append : ∀ (s₁ s₂ : RLEStack), + evalRLE (s₁ ++ s₂) = evalRLE s₁ ++ evalRLE s₂ + | [], _ => rfl + | (v, c) :: s₁, s₂ => by simp [evalRLE, evalRLE_append s₁ s₂, List.append_assoc] + +def midPrefixRLE : RLEStack := + [ (0, 2819), (12, 1), (0, 2), (3, 1), (0, 4), (1398, 1), (0, 3), (6, 1), + (0, 3), (345, 1), (0, 3), (6, 1), (0, 3), (81, 1), (0, 3), (6, 1), + (0, 3), (15, 1), (0, 3), (3, 1), (0, 59107), (6, 1), (0, 883), (6, 1), + (0, 47), (12, 1), (0, 2), (3, 1), (0, 4), (12, 1), (0, 3), (3, 1), + (0, 203), (6, 1), (0, 54), (3, 1), (0, 3), (3, 2), (0, 7) ] + +def midPrefix : List ℕ := evalRLE midPrefixRLE + +def bodyStack (Z b1 : ℕ) : List ℕ := + 0 :: 3 :: (List.replicate Z 0 ++ (6 :: (midPrefix ++ [b1, 2]))) + +def bodyStackRLE (Z b1 : ℕ) : RLEStack := + pushRun 0 1 (pushRun 3 1 (pushRun 0 Z (pushRun 6 1 + (midPrefixRLE ++ [(b1, 1), (2, 1)])))) + +theorem evalRLE_bodyStackRLE (Z b1 : ℕ) : + evalRLE (bodyStackRLE Z b1) = bodyStack Z b1 := by + simp [bodyStackRLE, bodyStack, midPrefix, evalRLE_pushRun, evalRLE_append, evalRLE] + +def ksInitOut : List ℕ := + [30758225, 7689554, 1922386, 480594, 120146, 30034, 7506, 1874, 466, 114, 26, 4] + +def expectedPhase1L : RLEStack := + pushRun 0 1 (wrapTowerA0OutRLE ksInitOut (bodyStackRLE 56233 3)) + +theorem evalRLE_expectedPhase1L : + evalRLE expectedPhase1L = 0 :: TowerA0Out ksInitOut (bodyStack 56233 3) := by + simp [expectedPhase1L, evalRLE_pushRun, evalRLE_wrapTowerA0OutRLE, evalRLE_bodyStackRLE] + +-- Phase 1: 11,728 steps (with 1,062 TowerA3 jumps) from `cfg_F [] [1]` to `SNAP 1 + R=[5]` + +def tryJumpPhase1 (mode : StackMode) (L R : RLEStack) : Option RLEStack := + if mode == .F && isSingleVal 5 R then + match popOne L with + | none => none + | some (v0, S_rle) => + match v0 with + | 0 => + let p := peelA3Loop 35 [] S_rle + match p.1 with + | [] => none + | k₀ :: ks₀ => + match runSubSim 100 false false p.2 with + | .stepped S'_inner => + some (pushRun 0 1 (wrapTowerA3RLE (stepTowerAt 2 (k₀ :: ks₀)) S'_inner)) + | .halted => none + | .abort => none + | _ + 1 => none + else none + +theorem tryJumpPhase1_sound {mode : StackMode} {L R L' : RLEStack} + (h : tryJumpPhase1 mode L R = some L') : + (evalStackCfg mode (evalRLE L) (evalRLE R)) [target_tm]⊢* + (cfg_F (evalRLE L') [5]) := by + unfold tryJumpPhase1 at h + split_ifs at h with hmode + simp only [Bool.and_eq_true, beq_iff_eq] at hmode + rcases hmode with ⟨rfl, hR5⟩ + cases hpop : popOne L with + | none => rw [hpop] at h; simp at h + | some vp => + rcases vp with ⟨v0, S_rle⟩ + rw [hpop] at h + cases v0 with + | succ _ => simp at h + | zero => + dsimp at h + have hpeel : TowerA3 (peelA3Loop 35 [] S_rle).1 (evalRLE (peelA3Loop 35 [] S_rle).2) = + evalRLE S_rle := evalRLE_peelA3Loop 35 [] S_rle + cases hks : (peelA3Loop 35 [] S_rle).1 with + | nil => rw [hks] at h; simp at h + | cons k₀ ks₀ => + rw [hks] at h hpeel + dsimp at h + cases hsim : runSubSim 100 false false (peelA3Loop 35 [] S_rle).2 with + | stepped S'_inner => + rw [hsim] at h + simp only [Option.some.injEq] at h + subst h + rw [evalStackCfg_F, evalRLE_popOne_some hpop, evalRLE_isSingleVal hR5, ← hpeel] + simpa [TopStep, evalRLE_pushRun, evalRLE_wrapTowerA3RLE] using + towerA3_topStep (k₀ :: ks₀) (List.cons_ne_nil k₀ ks₀) + (runSubSim_sound_closed hsim) + | halted => rw [hsim] at h; simp at h + | abort => rw [hsim] at h; simp at h + +def stepPhase1 (mode : StackMode) (L R : RLEStack) : Option (StackMode × RLEStack × RLEStack) := + match tryJumpPhase1 mode L R with + | some L' => some (.F, L', [(5, 1)]) + | none => + match stepGenRLE false false true mode L R with + | .stepped mode' L' R' => some (mode', L', R') + | .halted => none + | .abort => none + +theorem stepPhase1_sound {mode mode' : StackMode} {L R L' R' : RLEStack} + (h : stepPhase1 mode L R = some (mode', L', R')) : + (evalStackCfg mode (evalRLE L) (evalRLE R)) [target_tm]⊢* + (evalStackCfg mode' (evalRLE L') (evalRLE R')) := by + unfold stepPhase1 at h + cases hj : tryJumpPhase1 mode L R with + | some Lj => + rw [hj] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + exact tryJumpPhase1_sound hj + | none => + rw [hj] at h + cases hstep : stepGenRLE false false true mode L R with + | stepped m₁ L₁ R₁ => + rw [hstep] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + have hs := stepGenRLE_sound_step [] [] hstep + simpa [evalRLEWith, tailFor] using hs + | halted => rw [hstep] at h; simp at h + | abort => rw [hstep] at h; simp at h + +def runPhase1Steps : ℕ → StackMode → RLEStack → RLEStack → Option (StackMode × RLEStack × RLEStack) + | 0, mode, L, R => some (mode, L, R) + | n + 1, mode, L, R => + match stepPhase1 mode L R with + | some (mode₁, L₁, R₁) => runPhase1Steps n mode₁ L₁ R₁ + | none => none + +theorem runPhase1Steps_sound : ∀ {n : ℕ} {mode mode' : StackMode} {L R L' R' : RLEStack}, + runPhase1Steps n mode L R = some (mode', L', R') → + (evalStackCfg mode (evalRLE L) (evalRLE R)) [target_tm]⊢* + (evalStackCfg mode' (evalRLE L') (evalRLE R')) + | 0, _, _, _, _, _, _, h => by + simp only [runPhase1Steps, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + try exact ⟨0, rfl⟩ + | n + 1, mode, mode', L, R, L', R', h => by + unfold runPhase1Steps at h + cases hstep : stepPhase1 mode L R with + | none => rw [hstep] at h; simp at h + | some vp => + rcases vp with ⟨m₁, L₁, R₁⟩ + rw [hstep] at h + exact stepStar_trans (stepPhase1_sound hstep) (runPhase1Steps_sound h) + +set_option maxRecDepth 200000 in +theorem runPhase1All_eq : + runPhase1Steps 11728 .F [] [(1, 1)] = some (.F, expectedPhase1L, [(5, 1)]) := by + decide +kernel + +theorem phase1_reach : + ∃ ks₀ : List ℕ, ks₀ ≠ [] ∧ + (init []) [target_tm]⊢* (cfg_F (0 :: TowerA3 ks₀ (bodyStack 56233 3)) [5]) := by + have h_entry : (init []) [target_tm]⊢* (cfg_F [] [1]) := by + have h0 : init ([] : List (Fin 2)) = cfg_AR [] [] := rfl + rw [h0] + exact stepPlus_stepStar (rule_AR_nil []) + have h_p1 : (cfg_F [] [1]) [target_tm]⊢* + (cfg_F (0 :: TowerA0Out ksInitOut (bodyStack 56233 3)) [5]) := by + have h_all := runPhase1Steps_sound runPhase1All_eq + simpa [evalStackCfg, evalRLE_expectedPhase1L, evalRLE] using h_all + have h_abs := towerA3_absorb_towerA0Out ksInitOut [] (bodyStack 56233 3) + have h_ne : absorbTowerA0Out ksInitOut [] ≠ [] := + absorbTowerA0Out_ne_nil ksInitOut [] (Or.inl (by decide)) + exact ⟨absorbTowerA0Out ksInitOut [], h_ne, stepStar_trans h_entry (stepStar_trans h_p1 h_abs)⟩ + +-- Phase 2: 7,029 parametric body cycles from `Z = 56,233` down to `Z = 1` + +def runOpenSubCalls : ℕ → ℕ → RLEStack → Option RLEStack + | 0, _, s => some s + | n + 1, fuel, s => + match runSubSim fuel true true s with + | .stepped s' => runOpenSubCalls n fuel s' + | .halted => none + | .abort => none + +theorem runOpenSubCalls_sound : ∀ {n fuel : ℕ} {s s' : RLEStack} {ks : List ℕ}, + ks ≠ [] → runOpenSubCalls n fuel s = some s' → + ∀ (U : List ℕ), + ∃ ks' : List ℕ, ks' ≠ [] ∧ + TopStep (TowerA3 ks (evalRLE s ++ U)) (TowerA3 ks' (evalRLE s' ++ U)) + | 0, _, _, _, ks, hks, h, U => by + simp only [runOpenSubCalls, Option.some.injEq] at h + subst h + exact ⟨ks, hks, topStep_refl _⟩ + | n + 1, fuel, s, s', ks, hks, h, U => by + unfold runOpenSubCalls at h + cases hsim : runSubSim fuel true true s with + | stepped s₁ => + rw [hsim] at h + have h_sub := runSubSim_sound_open U hsim + have h_top := towerA3_topStep ks hks h_sub + have hne1 := stepTowerAt_ne_nil 2 hks + obtain ⟨ks', hne', h_rest⟩ := runOpenSubCalls_sound hne1 h U + exact ⟨ks', hne', topStep_trans h_top h_rest⟩ + | halted => rw [hsim] at h; simp at h + | abort => rw [hsim] at h; simp at h + +def headForA (m : ℕ) (U : List ℕ) : List ℕ := + match m with + | 0 => 3 :: 9 :: U + | m' + 1 => 3 :: 3 :: (List.replicate (8 * m' + 7) 0 ++ (6 :: U)) + +theorem calls1to10_m0_rle : + runOpenSubCalls 10 50 [(0, 1), (3, 1), (0, 9), (6, 1)] = + some [(0, 1), (3, 2), (0, 2), (12, 1), (3, 1), (0, 1), (3, 1), (9, 1)] := by decide +kernel + +theorem calls1to10_mpos_rle : + runOpenSubCalls 10 50 [(0, 1), (3, 1), (0, 10)] = + some [(0, 1), (3, 2), (0, 2), (12, 1), (3, 1), (0, 1), (3, 2)] := by decide +kernel + +theorem calls1to10_topStep (m : ℕ) (U : List ℕ) {ks : List ℕ} (hks : ks ≠ []) : + ∃ ks₁ : List ℕ, ks₁ ≠ [] ∧ + TopStep (TowerA3 ks (0 :: 3 :: (List.replicate (8 * m + 9) 0 ++ (6 :: U)))) + (TowerA3 ks₁ (B3 3 (headForA m U))) := by + cases m with + | zero => + obtain ⟨ks₁, hne₁, htop⟩ := runOpenSubCalls_sound hks calls1to10_m0_rle U + refine ⟨ks₁, hne₁, ?_⟩ + simpa [evalRLE, B3, headForA] using htop + | succ m' => + set V := List.replicate (8 * m' + 7) 0 ++ (6 :: U) + obtain ⟨ks₁, hne₁, htop⟩ := runOpenSubCalls_sound hks calls1to10_mpos_rle V + refine ⟨ks₁, hne₁, ?_⟩ + have h_rep : List.replicate (8 * (m' + 1) + 9) 0 ++ (6 :: U) = + List.replicate 10 0 ++ V := by + have heq : 8 * (m' + 1) + 9 = 10 + (8 * m' + 7) := by omega + rw [heq, List.replicate_add, List.append_assoc] + rw [h_rep] + simpa [evalRLE, B3, headForA] using htop + +theorem partA_m0 (U R_bot : List ℕ) : + (cfg_F (0 :: 3 :: 9 :: U) (9 :: R_bot)) [target_tm]⊢* + (cfg_F (0 :: U) (0 :: 1 :: 1 :: 5 :: 10 :: R_bot)) := by + refine stepStar_trans (stepPlus_stepStar (rule_F_zero_add_two (9 :: U) (9 :: R_bot) 1)) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_one_zero (9 :: U) (0 :: 10 :: R_bot))) ?_ + dsimp [bumpHead] + have h3 := rule_F_step3_all U (4 :: 10 :: R_bot) 0 3 + simpa [stepF3Right, bumpHead] using h3 + +theorem partA_mpos (m' : ℕ) (U R_bot : List ℕ) : + (cfg_F (0 :: 3 :: 3 :: (List.replicate (8 * m' + 7) 0 ++ (6 :: U))) (9 :: R_bot)) [target_tm]⊢* + (cfg_F (0 :: U) (0 :: 1 :: 1 :: (16 * (m' + 1) + 5) :: 10 :: R_bot)) := by + set V := List.replicate (8 * m' + 7) 0 ++ (6 :: U) + refine stepStar_trans (stepPlus_stepStar (rule_F_zero_add_two (3 :: V) (9 :: R_bot) 1)) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_one_zero (3 :: V) (0 :: 10 :: R_bot))) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_F_add_three V (4 :: 10 :: R_bot) 0)) ?_ + dsimp [bumpHead] + have hV : 0 :: V = List.replicate (4 * (2 * m' + 1) + 3 + 1) 0 ++ (6 :: U) := by + have hlen : 4 * (2 * m' + 1) + 3 + 1 = 1 + (8 * m' + 7) := by omega + rw [hlen, List.replicate_add] + rfl + rw [hV] + refine stepStar_trans (rule_F_zero4_all (2 * m' + 1) 3 (6 :: U) 5 (10 :: R_bot)) ?_ + set d₁ := 5 + 8 * (2 * m' + 1) + change (cfg_F (0 :: 0 :: 0 :: 0 :: 6 :: U) (0 :: d₁ :: 10 :: R_bot)) [target_tm]⊢* _ + refine stepStar_trans (stepPlus_stepStar (rule_F_zero_zero (0 :: 0 :: 6 :: U) (0 :: d₁ :: 10 :: R_bot))) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_F_two (0 :: 6 :: U) (0 :: 0 :: d₁ :: 10 :: R_bot))) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two_zero (6 :: U) (1 :: 0 :: d₁ :: 10 :: R_bot) 0)) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero (6 :: U) (3 :: 0 :: d₁ :: 10 :: R_bot))) ?_ + dsimp [bumpHead] + refine stepStar_trans (rule_AR_step2_all (9 :: U) (0 :: d₁ :: 10 :: R_bot) 0 2) ?_ + dsimp [List.replicate] + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero (0 :: 9 :: U) (0 :: d₁ :: 10 :: R_bot))) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_one_cons (3 :: 9 :: U) (10 :: R_bot) d₁)) ?_ + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two_zero (9 :: U) ((d₁ + 1) :: 10 :: R_bot) 1)) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_one_zero (9 :: U) ((d₁ + 1 + 1 + 1) :: 10 :: R_bot))) ?_ + dsimp [bumpHead] + have hd : d₁ + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 16 * (m' + 1) + 4 := by + dsimp [d₁]; omega + rw [hd] + have h14 := rule_F_step3_all U ((16 * (m' + 1) + 4) :: 10 :: R_bot) 0 3 + have hd2 : 16 * (m' + 1) + 4 + 1 = 16 * (m' + 1) + 5 := by omega + simpa [stepF3Right, bumpHead, hd2] using h14 + +theorem partA_all (m : ℕ) (U R_bot : List ℕ) : + (cfg_F (0 :: headForA m U) (9 :: R_bot)) [target_tm]⊢* + (cfg_F (0 :: U) (0 :: 1 :: 1 :: (16 * m + 5) :: 10 :: R_bot)) := by + cases m with + | zero => exact partA_m0 U R_bot + | succ m' => exact partA_mpos m' U R_bot + +def midRightTailRLE : RLEStack := + [ (9, 1), (0, 1), (105, 1), (1, 1), (409, 1), (9, 1), (1, 3), (10, 1), + (8, 1), (1, 3), (97, 1), (1, 1), (1769, 1), (1, 1), (118217, 1), (9, 1), + (1, 4), (9, 1), (1, 1), (9, 1), (1, 26), (9, 1), (1, 1), (9, 1), + (1, 114), (9, 1), (1, 1), (9, 1), (1, 465), (10, 1), (8, 1), (1, 3), + (5641, 1), (1, 1) ] + +theorem partB_rle : + runStepsRLE 189 true true true .F (pushRun 0 1 midPrefixRLE) [(0, 1), (1, 2)] = + .stepped .AR [(0, 1)] ((0, 1) :: (3, 1) :: (0, 1) :: (18, 1) :: midRightTailRLE) := by decide +kernel + +theorem partB_step (L_bot R_bot' : List ℕ) : + (cfg_F (0 :: (midPrefix ++ L_bot)) (0 :: 1 :: 1 :: R_bot')) [target_tm]⊢* + (cfg_AR (0 :: L_bot) (0 :: 3 :: 0 :: 18 :: (evalRLE midRightTailRLE ++ R_bot'))) := by + have h := runStepsRLE_sound_step L_bot R_bot' partB_rle + simpa [evalStackCfg, evalRLEWith, tailFor, evalRLE_pushRun, midPrefix, evalRLE, + List.append_assoc] using h + +theorem partC_step (k : ℕ) (R_tail : List ℕ) : + (cfg_AR [0, 3 * (k + 1), 2] (0 :: 3 :: 0 :: 18 :: R_tail)) [target_tm]⊢* + (cfg_AR [3 * (k + 2), 2] (28 :: R_tail)) := by + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero [3 * (k + 1), 2] (3 :: 0 :: 18 :: R_tail))) ?_ + dsimp [bumpHead] + have hk1 : 3 * (k + 1) + 1 + 1 + 1 = 3 * (k + 2) := by omega + rw [hk1] + refine stepStar_trans (rule_AR_step2_all [3 * (k + 2), 2] (0 :: 18 :: R_tail) 0 2) ?_ + dsimp [List.replicate] + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero [0, 3 * (k + 2), 2] (0 :: 18 :: R_tail))) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_one_cons [3, 3 * (k + 2), 2] R_tail 18)) ?_ + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two_zero [3 * (k + 2), 2] (19 :: R_tail) 1)) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_one_zero [3 * (k + 2), 2] (21 :: R_tail))) ?_ + dsimp [bumpHead] + have hk2 : 3 * (k + 2) = 3 * (k + 2) + 0 := by omega + rw [hk2] + refine stepStar_trans (rule_F_step3_all [2] (25 :: R_tail) 0 (k + 2)) ?_ + rw [stepF3Right_succ (k + 1) (25 :: R_tail)] + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_F_zero_add_two [] + (0 :: (List.replicate (k + 1) 1 ++ (26 :: R_tail))) 0)) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero [] + (0 :: 1 :: (List.replicate (k + 1) 1 ++ (26 :: R_tail))))) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_one_cons [2] + (List.replicate (k + 1) 1 ++ (26 :: R_tail)) 1)) ?_ + refine stepStar_trans (stepPlus_stepStar (rule_AR_add_two_zero [] + (2 :: (List.replicate (k + 1) 1 ++ (26 :: R_tail))) 0)) ?_ + dsimp [bumpHead] + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero [] + (4 :: (List.replicate (k + 1) 1 ++ (26 :: R_tail))))) ?_ + dsimp [bumpHead] + refine stepStar_trans (rule_AR_step2_all [2] + (List.replicate (k + 1) 1 ++ (26 :: R_tail)) 1 2) ?_ + dsimp [List.replicate] + have h_rep : 1 :: 1 :: (List.replicate k 1 ++ (26 :: R_tail)) = + List.replicate ((k + 1) + 1) 1 ++ (26 :: R_tail) := rfl + rw [h_rep] + refine stepStar_trans (rule_AR_ones_all (k + 1) 0 [2] (26 :: R_tail)) ?_ + rw [Nat.zero_add] + refine stepStar_trans (stepPlus_stepStar (rule_AR_one_cons [0, 3 * (k + 1), 2] R_tail 26)) ?_ + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero [3 * (k + 1), 2] (27 :: R_tail))) ?_ + dsimp [bumpHead] + rw [hk1] + try exact ⟨0, rfl⟩ + +theorem partD_rle : + runStepsRLE 83 true true true .AR [] (pushRun 28 1 midRightTailRLE) = + .stepped .AR ((0, 1) :: (3, 1) :: midPrefixRLE) [(1, 1)] := by decide +kernel + +theorem partD_step (L_bot R_bot' : List ℕ) : + (cfg_AR L_bot (28 :: (evalRLE midRightTailRLE ++ R_bot'))) [target_tm]⊢* + (cfg_AR (0 :: 3 :: (midPrefix ++ L_bot)) (1 :: R_bot')) := by + have h := runStepsRLE_sound_step L_bot R_bot' partD_rle + simpa [evalStackCfg, evalRLEWith, tailFor, evalRLE_pushRun, midPrefix, evalRLE, + List.append_assoc] using h + +theorem partE_step (m : ℕ) (W R_bot : List ℕ) : + (cfg_AR (0 :: 3 :: W) (1 :: (16 * m + 5) :: 10 :: R_bot)) [target_tm]⊢* + (cfg_AR (0 :: 0 :: 0 :: 0 :: 0 :: 0 :: 3 :: (List.replicate (8 * m + 1) 0 ++ (6 :: W))) + (0 :: R_bot)) := by + refine stepStar_trans (stepPlus_stepStar (rule_AR_one_cons (0 :: 3 :: W) (10 :: R_bot) (16 * m + 5))) ?_ + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero (3 :: W) ((16 * m + 5 + 1) :: 10 :: R_bot))) ?_ + dsimp [bumpHead] + have hm1 : 16 * m + 5 + 1 + 1 = 2 * (8 * m + 3) + 1 := by omega + rw [hm1] + refine stepStar_trans (rule_AR_step2_all (6 :: W) (10 :: R_bot) 1 (8 * m + 3)) ?_ + have hrep1 : List.replicate (8 * m + 3) 0 ++ (6 :: W) = + 0 :: 0 :: (List.replicate (8 * m + 1) 0 ++ (6 :: W)) := by + have heq : 8 * m + 3 = 2 + (8 * m + 1) := by omega + rw [heq, List.replicate_add] + rfl + rw [hrep1] + set V := List.replicate (8 * m + 1) 0 ++ (6 :: W) + refine stepStar_trans (stepPlus_stepStar (rule_AR_one_cons (0 :: 0 :: V) R_bot 10)) ?_ + refine stepStar_trans (stepPlus_stepStar (rule_AR_zero_zero (0 :: V) (11 :: R_bot))) ?_ + dsimp [bumpHead] + have h6 := rule_AR_step2_all (3 :: V) R_bot 0 6 + simpa [List.replicate] using h6 + +theorem call11_core_subStep (m k : ℕ) : + SubStep (headForA m (midPrefix ++ [3 * (k + 1), 2])) + (bodyStack (8 * m + 1) (3 * (k + 2))) := by + intro R_bot + set U := midPrefix ++ [3 * (k + 1), 2] + set R_bot' := (16 * m + 5) :: 10 :: R_bot + refine stepStar_trans (partA_all m U R_bot) ?_ + refine stepStar_trans (partB_step [3 * (k + 1), 2] R_bot') ?_ + refine stepStar_trans (partC_step k (evalRLE midRightTailRLE ++ R_bot')) ?_ + refine stepStar_trans (partD_step [3 * (k + 2), 2] R_bot') ?_ + exact partE_step m (midPrefix ++ [3 * (k + 2), 2]) R_bot + +theorem call11_subStep (m k : ℕ) : + SubStep (B3 3 (headForA m (midPrefix ++ [3 * (k + 1), 2]))) + (A0 4 (bodyStack (8 * m + 1) (3 * (k + 2)))) := + subStep_B3 3 (call11_core_subStep m k) + +theorem body_cycle_step (m k : ℕ) {ks : List ℕ} (hks : ks ≠ []) : + ∃ ks' : List ℕ, ks' ≠ [] ∧ + TopStep (TowerA3 ks (bodyStack (8 * m + 9) (3 * (k + 1)))) + (TowerA3 ks' (bodyStack (8 * m + 1) (3 * (k + 2)))) := by + obtain ⟨ks₁, hne₁, h10⟩ := calls1to10_topStep m (midPrefix ++ [3 * (k + 1), 2]) hks + have h11 := towerA3_topStep ks₁ hne₁ (call11_subStep m k) + have h12 := towerA3_absorb_A0 4 (stepTowerAt 2 ks₁) (bodyStack (8 * m + 1) (3 * (k + 2))) + exact ⟨absorbA0 4 (stepTowerAt 2 ks₁), absorbA0_ne_nil 4 _, + topStep_trans h10 (topStep_trans h11 h12)⟩ + +theorem body_cycles_all : ∀ (n m₀ k₀ : ℕ) {ks : List ℕ}, ks ≠ [] → + ∃ ks' : List ℕ, ks' ≠ [] ∧ + TopStep (TowerA3 ks (bodyStack (8 * (m₀ + n) + 1) (3 * (k₀ + 1)))) + (TowerA3 ks' (bodyStack (8 * m₀ + 1) (3 * (k₀ + n + 1)))) + | 0, m₀, k₀, ks, hks => by + simp only [Nat.add_zero] + exact ⟨ks, hks, topStep_refl _⟩ + | n + 1, m₀, k₀, ks, hks => by + have h_eq1 : 8 * (m₀ + (n + 1)) + 1 = 8 * (m₀ + n) + 9 := by omega + rw [h_eq1] + obtain ⟨ks₁, hne₁, hstep⟩ := body_cycle_step (m₀ + n) k₀ hks + have h_eq2 : 3 * (k₀ + 2) = 3 * ((k₀ + 1) + 1) := by omega + rw [h_eq2] at hstep + obtain ⟨ks', hne', hrest⟩ := body_cycles_all n m₀ (k₀ + 1) hne₁ + have h_eq3 : (k₀ + 1) + n + 1 = k₀ + (n + 1) + 1 := by omega + rw [h_eq3] at hrest + exact ⟨ks', hne', topStep_trans hstep hrest⟩ + +-- Phase 3: 186 SubStep calls from `bodyStack 1 21090` to `SubHalt` + +def runPhase3 : ℕ → RLEStack → Bool + | 0, _ => false + | fuel + 1, s => + let p := peelA3Loop 35 [] s + match runSubSim 400 false true p.2 with + | .stepped s' => runPhase3 fuel s' + | .halted => true + | .abort => false + +set_option maxRecDepth 200000 in +theorem runPhase3_eq : runPhase3 186 (bodyStackRLE 1 21090) = true := by decide +kernel + +theorem runPhase3_sound : ∀ (fuel : ℕ) (s : RLEStack), + runPhase3 fuel s = true → + ∀ (ks : List ℕ), ks ≠ [] → + ∃ cfg, ((cfg_F (0 :: TowerA3 ks (evalRLE s)) [5]) [target_tm]⊢* cfg) ∧ + (step target_tm cfg).isNone + | 0, _, h, _, _ => by simp [runPhase3] at h + | fuel + 1, s, h, ks, hks => by + unfold runPhase3 at h + dsimp at h + have hpeel : TowerA3 (peelA3Loop 35 [] s).1 (evalRLE (peelA3Loop 35 [] s).2) = evalRLE s := + evalRLE_peelA3Loop 35 [] s + set ks_p := (peelA3Loop 35 [] s).1 + set s_in := (peelA3Loop 35 [] s).2 + have h_tower : TowerA3 ks (evalRLE s) = TowerA3 (ks_p ++ ks) (evalRLE s_in) := by + rw [← hpeel, ← TowerA3_append] + have hne_all : ks_p ++ ks ≠ [] := by + intro hnil + exact hks (List.append_eq_nil_iff.mp hnil).2 + rw [h_tower] + cases hsim : runSubSim 400 false true s_in with + | stepped s' => + rw [hsim] at h + have h_top := towerA3_topStep (ks_p ++ ks) hne_all (runSubSim_sound_closed hsim) + obtain ⟨cfg, h_rest, h_none⟩ := + runPhase3_sound fuel s' h (stepTowerAt 2 (ks_p ++ ks)) (stepTowerAt_ne_nil 2 hne_all) + exact ⟨cfg, stepStar_trans h_top h_rest, h_none⟩ + | halted => + exact towerA3_halt (ks_p ++ ks) hne_all (runSubSim_sound_halt hsim) + | abort => + rw [hsim] at h + simp at h + +public section + +theorem is_halt : IsHalt target := by + obtain ⟨ks₀, hks₀, h_p1⟩ := phase1_reach + obtain ⟨ks₁, hks₁, h_p2⟩ := body_cycles_all 7029 0 0 hks₀ + dsimp at h_p2 + rw [← evalRLE_bodyStackRLE 1 21090] at h_p2 + obtain ⟨cfg, h_p3, h_none⟩ := runPhase3_sound 186 (bodyStackRLE 1 21090) runPhase3_eq ks₁ hks₁ + exact ⟨cfg, stepStar_trans h_p1 (stepStar_trans h_p2 h_p3), h_none⟩ + +end + +end BusyBeaver.M_1RB0RC_1RC0LD_1LD1RA_1LF0LE_HHH0RD_1LB0LA diff --git a/BusyBeaver/BB6/Halt/M_1RB0RD_1LC0RA_HHH1RD_1RA1LE_1RC0LF_1LE0LB.lean b/BusyBeaver/BB6/Halt/M_1RB0RD_1LC0RA_HHH1RD_1RA1LE_1RC0LF_1LE0LB.lean new file mode 100644 index 00000000..ba055fa2 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB0RD_1LC0RA_HHH1RD_1RA1LE_1RC0LF_1LE0LB.lean @@ -0,0 +1,3205 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RD_1LC0RA_HHH1RD_1RA1LE_1RC0LF_1LE0LB + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RD_1LC0RA_HHH1RD_1RA1LE_1RC0LF_1LE0LB" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +/-- Mirrored machine `1LB0LD_1RC0LA_---1LD_1LA1RE_1LC0RF_1RE0RB` from `Sk1Class2_v4.v` (`TM12`). -/ +def tm_coq : Machine (Fin 2) (Fin 6) + | 0, 0 => some (some 1, Stmt.write 1 Dir.left) + | 0, 1 => some (some 3, Stmt.write 0 Dir.left) + | 1, 0 => some (some 2, Stmt.write 1 Dir.right) + | 1, 1 => some (some 0, Stmt.write 0 Dir.left) + | 2, 0 => none + | 2, 1 => some (some 3, Stmt.write 1 Dir.left) + | 3, 0 => some (some 0, Stmt.write 1 Dir.left) + | 3, 1 => some (some 4, Stmt.write 1 Dir.right) + | 4, 0 => some (some 2, Stmt.write 1 Dir.left) + | 4, 1 => some (some 5, Stmt.write 0 Dir.right) + | 5, 0 => some (some 4, Stmt.write 1 Dir.right) + | 5, 1 => some (some 1, Stmt.write 0 Dir.right) + +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 20000000 +set_option maxHeartbeats 0 + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : + multiStep M config 0 = some config := rfl + +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : + multiStep M config 1 = step M config := rfl + +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +theorem multiStep_add (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem multiStep_step {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} {n : Nat} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢^{n} c₃) : c₁ [tm]⊢^{n + 1} c₃ := by + have := multiStep_trans tm c₁ c₂ c₃ 1 n h₁ h₂ + rwa [Nat.add_comm 1 n] at this + +theorem stepStar_refl (tm : Machine Γ Λ) (c : Cfg Γ Λ) : c [tm]⊢* c := + ⟨0, rfl⟩ + +theorem stepStar_trans {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + rcases h₁ with ⟨n, hn⟩; rcases h₂ with ⟨m, hm⟩ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_of_multiStep {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} {n : Nat} + (h : c₁ [tm]⊢^{n} c₂) : c₁ [tm]⊢* c₂ := ⟨n, h⟩ + +omit [Inhabited Γ] in +@[simp] theorem pow_zero_list (l : List Γ) : l ^ (0 : Nat) = [] := rfl + +omit [Inhabited Γ] in +@[simp] theorem pow_succ_list (l : List Γ) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl + +omit [Inhabited Γ] in +theorem list_pow_add (l : List Γ) (n m : Nat) : l ^ (n + m) = l ^ n ++ l ^ m := by + induction n with + | zero => simp [pow_zero_list] + | succ n ih => + rw [Nat.succ_add, pow_succ_list, pow_succ_list, ih, List.append_assoc] + +omit [Inhabited Γ] in +theorem pow_succ_right (l : List Γ) (n : Nat) : l ^ (n + 1) = l ^ n ++ l := by + rw [list_pow_add]; simp [pow_succ_list, pow_zero_list] + +omit [Inhabited Γ] in +theorem pow_comm_one (l : List Γ) (n : Nat) : l ^ n ++ l = l ++ l ^ n := by + rw [← pow_succ_right, ← pow_succ_list] + +@[simp] theorem listblank_append_nil (s : ListBlank Γ) : ([] : List Γ) +> s = s := rfl + +@[simp] theorem listblank_append_cons (a : Γ) (l : List Γ) (s : ListBlank Γ) : + (a :: l) +> s = a >> (l +> s) := rfl + +@[simp] theorem listblank_append_assoc (l₁ l₂ : List Γ) (s : ListBlank Γ) : + (l₁ ++ l₂) +> s = l₁ +> (l₂ +> s) := + Turing.ListBlank.append_assoc l₁ l₂ s + +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +@[simp] theorem zero_cons_default : (0 : Fin 2) >> (default : ListBlank (Fin 2)) = default := by + change ListBlank.cons default default = default + exact ListBlank.cons_head_tail default + +-- ============================================================================ +-- Directed Window Steppers (`dstep`, `ldstep`, `rdstep`, `bstep`) +-- ============================================================================ + +structure DCfg where + q : Fin 6 + dir : Dir + l : List (Fin 2) + r : List (Fin 2) + deriving DecidableEq + +def evalDCfg (l_tail r_tail : ListBlank (Fin 2)) (c : DCfg) : Cfg (Fin 2) (Fin 6) := + match c.dir with + | Dir.right => (c.l +> l_tail) {{c.q}}> (c.r +> r_tail) + | Dir.left => (c.l +> l_tail) <{{c.q}} (c.r +> r_tail) + +def dstep (c : DCfg) : Option DCfg := + match c.dir with + | Dir.right => + match c.r with + | [] => none + | b :: rs => + match tm_coq c.q b with + | none => none + | some (none, _) => none + | some (some q', Stmt.write w Dir.right) => some ⟨q', Dir.right, w :: c.l, rs⟩ + | some (some q', Stmt.write w Dir.left) => some ⟨q', Dir.left, c.l, w :: rs⟩ + | Dir.left => + match c.l with + | [] => none + | b :: ls => + match tm_coq c.q b with + | none => none + | some (none, _) => none + | some (some q', Stmt.write w Dir.right) => some ⟨q', Dir.right, w :: ls, c.r⟩ + | some (some q', Stmt.write w Dir.left) => some ⟨q', Dir.left, ls, w :: c.r⟩ + +theorem dstep_sound (c c' : DCfg) (l_tail r_tail : ListBlank (Fin 2)) (h : dstep c = some c') : + (evalDCfg l_tail r_tail c) [tm_coq]⊢ (evalDCfg l_tail r_tail c') := by + rcases c with ⟨q, dir, l, r⟩ + cases dir with + | right => + cases r with + | nil => nomatch h + | cons b rs => + try dsimp [dstep] at h + cases h_tm : tm_coq q b with + | none => rw [h_tm] at h; nomatch h + | some val => + rcases val with ⟨_ | q', ⟨w, d'⟩⟩ + · rw [h_tm] at h; nomatch h + · cases d' <;> { + rw [h_tm] at h; injection h with h'; subst h' + simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + } + | left => + cases l with + | nil => nomatch h + | cons b ls => + try dsimp [dstep] at h + cases h_tm : tm_coq q b with + | none => rw [h_tm] at h; nomatch h + | some val => + rcases val with ⟨_ | q', ⟨w, d'⟩⟩ + · rw [h_tm] at h; nomatch h + · cases d' <;> { + rw [h_tm] at h; injection h with h'; subst h' + simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + } + +def dmultiStep : ℕ → DCfg → Option DCfg + | 0, c => some c + | n + 1, c => (dstep c).bind (dmultiStep n) + +theorem dmultiStep_sound : ∀ (n : ℕ) (c c' : DCfg) (l_tail r_tail : ListBlank (Fin 2)), + dmultiStep n c = some c' → + (evalDCfg l_tail r_tail c) [tm_coq]⊢^{n} (evalDCfg l_tail r_tail c') + | 0, c, c', _, _, h => by injection h with h'; subst h'; rfl + | n + 1, c, c', l_tail, r_tail, h => by + simp only [dmultiStep, Option.bind_eq_some_iff] at h + rcases h with ⟨c₁, h₁, h₂⟩ + exact multiStep_step (dstep_sound c c₁ l_tail r_tail h₁) (dmultiStep_sound n c₁ c' l_tail r_tail h₂) + +theorem dmultiStep_star (n : ℕ) (c c' : DCfg) (l_tail r_tail : ListBlank (Fin 2)) + (h : dmultiStep n c = some c') : + (evalDCfg l_tail r_tail c) [tm_coq]⊢* (evalDCfg l_tail r_tail c') := + ⟨n, dmultiStep_sound n c c' l_tail r_tail h⟩ + +def ldstep (c : DCfg) : Option DCfg := + match c.dir with + | Dir.right => + match c.r with + | [] => none + | b :: rs => + match tm_coq c.q b with + | none => none + | some (none, _) => none + | some (some q', Stmt.write w Dir.right) => + let l' := if c.l.isEmpty && w == 0 then [] else w :: c.l + some ⟨q', Dir.right, l', rs⟩ + | some (some q', Stmt.write w Dir.left) => some ⟨q', Dir.left, c.l, w :: rs⟩ + | Dir.left => + let (b, ls) := match c.l with | [] => ((0 : Fin 2), []) | b :: ls => (b, ls) + match tm_coq c.q b with + | none => none + | some (none, _) => none + | some (some q', Stmt.write w Dir.right) => + let l' := if ls.isEmpty && w == 0 then [] else w :: ls + some ⟨q', Dir.right, l', c.r⟩ + | some (some q', Stmt.write w Dir.left) => some ⟨q', Dir.left, ls, w :: c.r⟩ + +theorem ldstep_sound (c c' : DCfg) (r_tail : ListBlank (Fin 2)) (h : ldstep c = some c') : + (evalDCfg default r_tail c) [tm_coq]⊢ (evalDCfg default r_tail c') := by + rcases c with ⟨q, dir, l, r⟩ + cases dir with + | right => + cases r with + | nil => nomatch h + | cons b rs => + try dsimp [ldstep] at h + cases h_tm : tm_coq q b with + | none => rw [h_tm] at h; nomatch h + | some val => + rcases val with ⟨_ | q', ⟨w, d'⟩⟩ + · rw [h_tm] at h; nomatch h + · cases d' with + | left => + rw [h_tm] at h; injection h with h'; subst h' + simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + | right => + rw [h_tm] at h; injection h with h'; subst h' + cases l with + | nil => + by_cases hw : w = 0 + · subst hw; simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + · simp [step, evalDCfg, h_tm, hw, Turing.Tape.write, Turing.Tape.move] + | cons b' ls' => + simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + | left => + cases l with + | nil => + try dsimp [ldstep] at h + cases h_tm : tm_coq q 0 with + | none => rw [h_tm] at h; nomatch h + | some val => + rcases val with ⟨_ | q', ⟨w, d'⟩⟩ + · rw [h_tm] at h; nomatch h + · cases d' with + | left => + rw [h_tm] at h; injection h with h'; subst h' + simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + | right => + rw [h_tm] at h; injection h with h'; subst h' + by_cases hw : w = 0 + · subst hw; simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + · simp [step, evalDCfg, h_tm, hw, Turing.Tape.write, Turing.Tape.move] + | cons b ls => + try dsimp [ldstep] at h + cases h_tm : tm_coq q b with + | none => rw [h_tm] at h; nomatch h + | some val => + rcases val with ⟨_ | q', ⟨w, d'⟩⟩ + · rw [h_tm] at h; nomatch h + · cases d' with + | left => + rw [h_tm] at h; injection h with h'; subst h' + simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + | right => + rw [h_tm] at h; injection h with h'; subst h' + cases ls with + | nil => + by_cases hw : w = 0 + · subst hw; simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + · simp [step, evalDCfg, h_tm, hw, Turing.Tape.write, Turing.Tape.move] + | cons b' ls' => + simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + +def ldmultiStep : ℕ → DCfg → Option DCfg + | 0, c => some c + | n + 1, c => (ldstep c).bind (ldmultiStep n) + +theorem ldmultiStep_sound : ∀ (n : ℕ) (c c' : DCfg) (r_tail : ListBlank (Fin 2)), + ldmultiStep n c = some c' → + (evalDCfg default r_tail c) [tm_coq]⊢^{n} (evalDCfg default r_tail c') + | 0, c, c', _, h => by injection h with h'; subst h'; rfl + | n + 1, c, c', r_tail, h => by + simp only [ldmultiStep, Option.bind_eq_some_iff] at h + rcases h with ⟨c₁, h₁, h₂⟩ + exact multiStep_step (ldstep_sound c c₁ r_tail h₁) (ldmultiStep_sound n c₁ c' r_tail h₂) + +theorem ldmultiStep_star (n : ℕ) (c c' : DCfg) (r_tail : ListBlank (Fin 2)) + (h : ldmultiStep n c = some c') : + (evalDCfg default r_tail c) [tm_coq]⊢* (evalDCfg default r_tail c') := + ⟨n, ldmultiStep_sound n c c' r_tail h⟩ + +def rdstep (c : DCfg) : Option DCfg := + match c.dir with + | Dir.right => + let (b, rs) := match c.r with | [] => ((0 : Fin 2), []) | b :: rs => (b, rs) + match tm_coq c.q b with + | none => none + | some (none, _) => none + | some (some q', Stmt.write w Dir.right) => some ⟨q', Dir.right, w :: c.l, rs⟩ + | some (some q', Stmt.write w Dir.left) => + let r' := if rs.isEmpty && w == 0 then [] else w :: rs + some ⟨q', Dir.left, c.l, r'⟩ + | Dir.left => + match c.l with + | [] => none + | b :: ls => + match tm_coq c.q b with + | none => none + | some (none, _) => none + | some (some q', Stmt.write w Dir.right) => some ⟨q', Dir.right, w :: ls, c.r⟩ + | some (some q', Stmt.write w Dir.left) => + let r' := if c.r.isEmpty && w == 0 then [] else w :: c.r + some ⟨q', Dir.left, ls, r'⟩ + +theorem rdstep_sound (c c' : DCfg) (l_tail : ListBlank (Fin 2)) (h : rdstep c = some c') : + (evalDCfg l_tail default c) [tm_coq]⊢ (evalDCfg l_tail default c') := by + rcases c with ⟨q, dir, l, r⟩ + cases dir with + | right => + cases r with + | nil => + try dsimp [rdstep] at h + cases h_tm : tm_coq q 0 with + | none => rw [h_tm] at h; nomatch h + | some val => + rcases val with ⟨_ | q', ⟨w, d'⟩⟩ + · rw [h_tm] at h; nomatch h + · cases d' with + | right => + rw [h_tm] at h; injection h with h'; subst h' + simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + | left => + rw [h_tm] at h; injection h with h'; subst h' + by_cases hw : w = 0 + · subst hw; simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + · simp [step, evalDCfg, h_tm, hw, Turing.Tape.write, Turing.Tape.move] + | cons b rs => + try dsimp [rdstep] at h + cases h_tm : tm_coq q b with + | none => rw [h_tm] at h; nomatch h + | some val => + rcases val with ⟨_ | q', ⟨w, d'⟩⟩ + · rw [h_tm] at h; nomatch h + · cases d' with + | right => + rw [h_tm] at h; injection h with h'; subst h' + simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + | left => + rw [h_tm] at h; injection h with h'; subst h' + cases rs with + | nil => + by_cases hw : w = 0 + · subst hw; simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + · simp [step, evalDCfg, h_tm, hw, Turing.Tape.write, Turing.Tape.move] + | cons b' rs' => + simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + | left => + cases l with + | nil => nomatch h + | cons b ls => + try dsimp [rdstep] at h + cases h_tm : tm_coq q b with + | none => rw [h_tm] at h; nomatch h + | some val => + rcases val with ⟨_ | q', ⟨w, d'⟩⟩ + · rw [h_tm] at h; nomatch h + · cases d' with + | right => + rw [h_tm] at h; injection h with h'; subst h' + simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + | left => + rw [h_tm] at h; injection h with h'; subst h' + cases r with + | nil => + by_cases hw : w = 0 + · subst hw; simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + · simp [step, evalDCfg, h_tm, hw, Turing.Tape.write, Turing.Tape.move] + | cons b' rs' => + simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + +def rdmultiStep : ℕ → DCfg → Option DCfg + | 0, c => some c + | n + 1, c => (rdstep c).bind (rdmultiStep n) + +theorem rdmultiStep_sound : ∀ (n : ℕ) (c c' : DCfg) (l_tail : ListBlank (Fin 2)), + rdmultiStep n c = some c' → + (evalDCfg l_tail default c) [tm_coq]⊢^{n} (evalDCfg l_tail default c') + | 0, c, c', _, h => by injection h with h'; subst h'; rfl + | n + 1, c, c', l_tail, h => by + simp only [rdmultiStep, Option.bind_eq_some_iff] at h + rcases h with ⟨c₁, h₁, h₂⟩ + exact multiStep_step (rdstep_sound c c₁ l_tail h₁) (rdmultiStep_sound n c₁ c' l_tail h₂) + +theorem rdmultiStep_star (n : ℕ) (c c' : DCfg) (l_tail : ListBlank (Fin 2)) + (h : rdmultiStep n c = some c') : + (evalDCfg l_tail default c) [tm_coq]⊢* (evalDCfg l_tail default c') := + ⟨n, rdmultiStep_sound n c c' l_tail h⟩ + +def bstep (c : DCfg) : Option DCfg := + match c.dir with + | Dir.right => + let (b, rs) := match c.r with | [] => ((0 : Fin 2), []) | b :: rs => (b, rs) + match tm_coq c.q b with + | none => none + | some (none, _) => none + | some (some q', Stmt.write w Dir.right) => + let l' := if c.l.isEmpty && w == 0 then [] else w :: c.l + some ⟨q', Dir.right, l', rs⟩ + | some (some q', Stmt.write w Dir.left) => + let r' := if rs.isEmpty && w == 0 then [] else w :: rs + some ⟨q', Dir.left, c.l, r'⟩ + | Dir.left => + let (b, ls) := match c.l with | [] => ((0 : Fin 2), []) | b :: ls => (b, ls) + match tm_coq c.q b with + | none => none + | some (none, _) => none + | some (some q', Stmt.write w Dir.right) => + let l' := if ls.isEmpty && w == 0 then [] else w :: ls + some ⟨q', Dir.right, l', c.r⟩ + | some (some q', Stmt.write w Dir.left) => + let r' := if c.r.isEmpty && w == 0 then [] else w :: c.r + some ⟨q', Dir.left, ls, r'⟩ + +theorem bstep_sound (c c' : DCfg) (h : bstep c = some c') : + (evalDCfg default default c) [tm_coq]⊢ (evalDCfg default default c') := by + rcases c with ⟨q, dir, l, r⟩ + cases dir with + | right => + cases r with + | nil => + try dsimp [bstep] at h + cases h_tm : tm_coq q 0 with + | none => rw [h_tm] at h; nomatch h + | some val => + rcases val with ⟨_ | q', ⟨w, d'⟩⟩ + · rw [h_tm] at h; nomatch h + · cases d' with + | right => + rw [h_tm] at h; injection h with h'; subst h' + cases l with + | nil => + by_cases hw : w = 0 + · subst hw; simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + · simp [step, evalDCfg, h_tm, hw, Turing.Tape.write, Turing.Tape.move] + | cons b' ls' => + simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + | left => + rw [h_tm] at h; injection h with h'; subst h' + by_cases hw : w = 0 + · subst hw; simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + · simp [step, evalDCfg, h_tm, hw, Turing.Tape.write, Turing.Tape.move] + | cons b rs => + try dsimp [bstep] at h + cases h_tm : tm_coq q b with + | none => rw [h_tm] at h; nomatch h + | some val => + rcases val with ⟨_ | q', ⟨w, d'⟩⟩ + · rw [h_tm] at h; nomatch h + · cases d' with + | right => + rw [h_tm] at h; injection h with h'; subst h' + cases l with + | nil => + by_cases hw : w = 0 + · subst hw; simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + · simp [step, evalDCfg, h_tm, hw, Turing.Tape.write, Turing.Tape.move] + | cons b' ls' => + simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + | left => + rw [h_tm] at h; injection h with h'; subst h' + cases rs with + | nil => + by_cases hw : w = 0 + · subst hw; simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + · simp [step, evalDCfg, h_tm, hw, Turing.Tape.write, Turing.Tape.move] + | cons b' rs' => + simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + | left => + cases l with + | nil => + try dsimp [bstep] at h + cases h_tm : tm_coq q 0 with + | none => rw [h_tm] at h; nomatch h + | some val => + rcases val with ⟨_ | q', ⟨w, d'⟩⟩ + · rw [h_tm] at h; nomatch h + · cases d' with + | right => + rw [h_tm] at h; injection h with h'; subst h' + by_cases hw : w = 0 + · subst hw; simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + · simp [step, evalDCfg, h_tm, hw, Turing.Tape.write, Turing.Tape.move] + | left => + rw [h_tm] at h; injection h with h'; subst h' + cases r with + | nil => + by_cases hw : w = 0 + · subst hw; simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + · simp [step, evalDCfg, h_tm, hw, Turing.Tape.write, Turing.Tape.move] + | cons b' rs' => + simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + | cons b ls => + try dsimp [bstep] at h + cases h_tm : tm_coq q b with + | none => rw [h_tm] at h; nomatch h + | some val => + rcases val with ⟨_ | q', ⟨w, d'⟩⟩ + · rw [h_tm] at h; nomatch h + · cases d' with + | right => + rw [h_tm] at h; injection h with h'; subst h' + cases ls with + | nil => + by_cases hw : w = 0 + · subst hw; simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + · simp [step, evalDCfg, h_tm, hw, Turing.Tape.write, Turing.Tape.move] + | cons b' ls' => + simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + | left => + rw [h_tm] at h; injection h with h'; subst h' + cases r with + | nil => + by_cases hw : w = 0 + · subst hw; simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + · simp [step, evalDCfg, h_tm, hw, Turing.Tape.write, Turing.Tape.move] + | cons b' rs' => + simp [step, evalDCfg, h_tm, Turing.Tape.write, Turing.Tape.move] + +def bmultiStep : ℕ → DCfg → Option DCfg + | 0, c => some c + | n + 1, c => (bstep c).bind (bmultiStep n) + +theorem bmultiStep_sound : ∀ (n : ℕ) (c c' : DCfg), + bmultiStep n c = some c' → + (evalDCfg default default c) [tm_coq]⊢^{n} (evalDCfg default default c') + | 0, c, c', h => by injection h with h'; subst h'; rfl + | n + 1, c, c', h => by + simp only [bmultiStep, Option.bind_eq_some_iff] at h + rcases h with ⟨c₁, h₁, h₂⟩ + exact multiStep_step (bstep_sound c c₁ h₁) (bmultiStep_sound n c₁ c' h₂) + +-- ============================================================================ +-- Segment Relations (`segRR`, `segLL`, `segRL`, `sideRL`, `sideRLs`, `segRLs`) +-- ============================================================================ + +def segRR (q₁ q₂ : Fin 6) (w m : List (Fin 2)) : Prop := + ∀ l r, (l {{q₁}}> (w +> r)) [tm_coq]⊢* ((m +> l) {{q₂}}> r) + +def segLL (q₁ q₂ : Fin 6) (w o : List (Fin 2)) : Prop := + ∀ l r, ((w +> l) <{{q₁}} r) [tm_coq]⊢* (l <{{q₂}} (o +> r)) + +def segRL (q₁ q₂ : Fin 6) (w w' : List (Fin 2)) : Prop := + ∀ l r, (l {{q₁}}> (w +> r)) [tm_coq]⊢* (l <{{q₂}} (w' +> r)) + +def sideRL (q₁ q₂ : Fin 6) (R R' : ListBlank (Fin 2)) : Prop := + ∀ l, (l {{q₁}}> R) [tm_coq]⊢* (l <{{q₂}} R') + +def haltsFrom (c : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ cfg, (c [tm_coq]⊢* cfg) ∧ (step tm_coq cfg).isNone + +theorem haltsFrom_stepStar {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h₁ : c₁ [tm_coq]⊢* c₂) (h₂ : haltsFrom c₂) : + haltsFrom c₁ := by + rcases h₂ with ⟨cfg, h₂, hnone⟩ + exact ⟨cfg, stepStar_trans h₁ h₂, hnone⟩ + +def sideRL_halt (R : ListBlank (Fin 2)) : Prop := + ∀ l, haltsFrom (l {{B}}> R) + +theorem segRR_app {q₁ q₂ q₃ : Fin 6} {w₁ w₂ m₁ m₂ : List (Fin 2)} + (h₁ : segRR q₁ q₂ w₁ m₁) (h₂ : segRR q₂ q₃ w₂ m₂) : + segRR q₁ q₃ (w₁ ++ w₂) (m₂ ++ m₁) := by + intro l r + rw [listblank_append_assoc, listblank_append_assoc] + exact stepStar_trans (h₁ l (w₂ +> r)) (h₂ (m₁ +> l) r) + +theorem segLL_app {q₁ q₂ q₃ : Fin 6} {w₁ w₂ o₁ o₂ : List (Fin 2)} + (h₁ : segLL q₁ q₂ w₁ o₁) (h₂ : segLL q₂ q₃ w₂ o₂) : + segLL q₁ q₃ (w₁ ++ w₂) (o₂ ++ o₁) := by + intro l r + rw [listblank_append_assoc, listblank_append_assoc] + exact stepStar_trans (h₁ (w₂ +> l) r) (h₂ l (o₁ +> r)) + +theorem segRR_RL_LL {q₁ q₂ q₃ q₄ : Fin 6} {w₁ w₂ m w₁' w₂' : List (Fin 2)} + (h₁ : segRR q₁ q₂ w₁ m) (h₂ : segRL q₂ q₃ w₂ w₂') (h₃ : segLL q₃ q₄ m w₁') : + segRL q₁ q₄ (w₁ ++ w₂) (w₁' ++ w₂') := by + intro l r + rw [listblank_append_assoc, listblank_append_assoc] + exact stepStar_trans (h₁ l (w₂ +> r)) (stepStar_trans (h₂ (m +> l) r) (h₃ l (w₂' +> r))) + +theorem segRR_sideRL_LL {q₁ q₂ q₃ q₄ : Fin 6} {w m w' : List (Fin 2)} {r r' : ListBlank (Fin 2)} + (h₁ : segRR q₁ q₂ w m) (h₂ : sideRL q₂ q₃ r r') (h₃ : segLL q₃ q₄ m w') : + sideRL q₁ q₄ (w +> r) (w' +> r') := by + intro l + exact stepStar_trans (h₁ l r) (stepStar_trans (h₂ (m +> l)) (h₃ l r')) + +theorem segRL_frame {q₁ q₂ : Fin 6} {w w' : List (Fin 2)} (u : List (Fin 2)) + (h : segRL q₁ q₂ w w') : segRL q₁ q₂ (w ++ u) (w' ++ u) := by + intro l r + rw [listblank_append_assoc, listblank_append_assoc] + exact h l (u +> r) + +theorem segRL_side {q₁ q₂ : Fin 6} {w w' : List (Fin 2)} (R : ListBlank (Fin 2)) + (h : segRL q₁ q₂ w w') : sideRL q₁ q₂ (w +> R) (w' +> R) := by + intro l; exact h l R + +inductive sideRLs : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) → Prop + | zero (R : ListBlank (Fin 2)) : sideRLs 0 R R + | succ {n : Nat} {R R₁ R' : ListBlank (Fin 2)} : + sideRL B D R R₁ → sideRLs n R₁ R' → sideRLs (n + 1) R R' + +theorem sideRLs_append : ∀ {n₁ n₂ : Nat} {R₁ R₂ R₃ : ListBlank (Fin 2)}, + sideRLs n₁ R₁ R₂ → sideRLs n₂ R₂ R₃ → sideRLs (n₁ + n₂) R₁ R₃ + | 0, _, _, _, _, .zero _, h₂ => by simpa using h₂ + | n₁ + 1, n₂, _, _, _, .succ h step₁, h₂ => by + rw [Nat.succ_add] + exact .succ h (sideRLs_append step₁ h₂) + +theorem sideRLs_split : ∀ {n₁ n₂ : Nat} {R R' : ListBlank (Fin 2)}, + sideRLs (n₁ + n₂) R R' → ∃ R₁, sideRLs n₁ R R₁ ∧ sideRLs n₂ R₁ R' + | 0, n₂, R, R', h => by + rw [Nat.zero_add] at h + exact ⟨R, .zero R, h⟩ + | n₁ + 1, n₂, R, R', h => by + rw [Nat.succ_add] at h + cases h with + | succ h₁ hrest => + rcases sideRLs_split hrest with ⟨R₁, hs₁, hs₂⟩ + exact ⟨R₁, .succ h₁ hs₁, hs₂⟩ + +def segRLs (n p : Nat) (w w' : List (Fin 2)) : Prop := + ∀ R R', sideRLs p R R' → sideRLs n (w +> R) (w' +> R') + +theorem segRLs_O (w : List (Fin 2)) : segRLs 0 0 w w := by + intro R R' h; cases h; exact .zero (w +> R) + +theorem segRLs_trans {n₁ n₂ p₁ p₂ : Nat} {w₁ w₂ w₃ : List (Fin 2)} + (h₁ : segRLs n₁ p₁ w₁ w₂) (h₂ : segRLs n₂ p₂ w₂ w₃) : + segRLs (n₁ + n₂) (p₁ + p₂) w₁ w₃ := by + intro R R' h + rcases sideRLs_split h with ⟨R₁, hp₁, hp₂⟩ + exact sideRLs_append (h₁ R R₁ hp₁) (h₂ R₁ R' hp₂) + +theorem lrcons1 {w₁ w₂ m : List (Fin 2)} (hR : segRR B B w₁ m) (hL : segLL D D m w₂) : + segRLs 1 1 w₁ w₂ := by + intro R R' h + cases h with + | succ h₁ h₀ => + cases h₀ + exact .succ (segRR_sideRL_LL hR h₁ hL) (.zero (w₂ +> R')) + +theorem side1 {w w' : List (Fin 2)} {r r' : ListBlank (Fin 2)} + (h₁ : segRLs 1 1 w w') (h₂ : sideRL B D r r') : + sideRL B D (w +> r) (w' +> r') := by + have h := h₁ r r' (.succ h₂ (.zero r')) + cases h with + | succ hs h₀ => + cases h₀ + exact hs + +def passRL (w w' : List (Fin 2)) : Prop := + segRLs 1 1 w w' ∧ ∀ R, sideRL_halt R → sideRL_halt (w +> R) + +theorem lrcons1_pass {w₁ w₂ m : List (Fin 2)} (hR : segRR B B w₁ m) (hL : segLL D D m w₂) : + passRL w₁ w₂ := + ⟨lrcons1 hR hL, fun R hHalt l => haltsFrom_stepStar (hR l R) (hHalt (m +> l))⟩ + +theorem stop1s {w w' : List (Fin 2)} (h : segRL B D w w') : segRLs 1 0 w w' := by + intro R R' h0 + cases h0 + exact .succ (segRL_side R h) (.zero (w' +> R)) + +theorem segRR_pow {q : Fin 6} {u v : List (Fin 2)} (h : segRR q q u v) : + ∀ k : ℕ, segRR q q (u ^ k) (v ^ k) + | 0 => fun _ _ => ⟨0, rfl⟩ + | k + 1 => by + rw [pow_succ_list, pow_succ_right] + exact segRR_app h (segRR_pow h k) + +theorem segLL_pow {q : Fin 6} {u v : List (Fin 2)} (h : segLL q q u v) : + ∀ k : ℕ, segLL q q (u ^ k) (v ^ k) + | 0 => fun _ _ => ⟨0, rfl⟩ + | k + 1 => by + rw [pow_succ_list, pow_succ_right] + exact segLL_app h (segLL_pow h k) + +-- ============================================================================ +-- Word Algebra & Definitions +-- ============================================================================ + +theorem pow_01_zero (n : ℕ) : ([0, 1] : List (Fin 2)) ^ n ++ [0] = [0] ++ ([1, 0] : List (Fin 2)) ^ n := by + induction n with + | zero => rfl + | succ n ih => + calc ([0, 1] : List (Fin 2)) ^ (n + 1) ++ [0] + _ = [0, 1] ++ ([0, 1] ^ n ++ [0]) := by rw [pow_succ_list, List.append_assoc] + _ = [0, 1] ++ ([0] ++ [1, 0] ^ n) := by rw [ih] + _ = [0] ++ ([1, 0] ++ [1, 0] ^ n) := rfl + _ = [0] ++ [1, 0] ^ (n + 1) := by rw [← pow_succ_list] + +theorem one_pow_01 (n : ℕ) : ([1] : List (Fin 2)) ++ ([0, 1] : List (Fin 2)) ^ n = ([1, 0] : List (Fin 2)) ^ n ++ [1] := by + induction n with + | zero => rfl + | succ n ih => + calc ([1] : List (Fin 2)) ++ [0, 1] ^ (n + 1) + _ = [1, 0] ++ ([1] ++ [0, 1] ^ n) := by rw [pow_succ_list]; rfl + _ = [1, 0] ++ ([1, 0] ^ n ++ [1]) := by rw [ih] + _ = ([1, 0] ++ [1, 0] ^ n) ++ [1] := by rw [← List.append_assoc] + _ = [1, 0] ^ (n + 1) ++ [1] := by rw [← pow_succ_list] + +theorem zero_pow10_one (n : ℕ) : ([0] : List (Fin 2)) ++ ([1, 0] : List (Fin 2)) ^ n ++ [1] = ([0, 1] : List (Fin 2)) ^ (n + 1) := by + rw [← pow_01_zero, List.append_assoc] + exact (pow_succ_right [0, 1] n).symm + +theorem one_pow111 (n : ℕ) : ([1] : List (Fin 2)) ++ ([1, 1, 1] : List (Fin 2)) ^ n = ([1, 1, 1] : List (Fin 2)) ^ n ++ [1] := by + induction n with + | zero => rfl + | succ n ih => + calc ([1] : List (Fin 2)) ++ [1, 1, 1] ^ (n + 1) + _ = [1, 1, 1] ++ ([1] ++ [1, 1, 1] ^ n) := by rw [pow_succ_list]; rfl + _ = [1, 1, 1] ++ ([1, 1, 1] ^ n ++ [1]) := by rw [ih] + _ = ([1, 1, 1] ++ [1, 1, 1] ^ n) ++ [1] := by rw [← List.append_assoc] + _ = [1, 1, 1] ^ (n + 1) ++ [1] := by rw [← pow_succ_list] + +theorem two_ones_pow111 (n : ℕ) : ([1, 1] : List (Fin 2)) ++ ([1, 1, 1] : List (Fin 2)) ^ n = ([1, 1, 1] : List (Fin 2)) ^ n ++ [1, 1] := by + induction n with + | zero => rfl + | succ n ih => + calc ([1, 1] : List (Fin 2)) ++ [1, 1, 1] ^ (n + 1) + _ = [1, 1, 1] ++ ([1, 1] ++ [1, 1, 1] ^ n) := by rw [pow_succ_list]; rfl + _ = [1, 1, 1] ++ ([1, 1, 1] ^ n ++ [1, 1]) := by rw [ih] + _ = ([1, 1, 1] ++ [1, 1, 1] ^ n) ++ [1, 1] := by rw [← List.append_assoc] + _ = [1, 1, 1] ^ (n + 1) ++ [1, 1] := by rw [← pow_succ_list] + +def stack (j : ℕ) : List (Fin 2) := [1] ++ [1, 1, 1] ^ j +def blk (m j : ℕ) : List (Fin 2) := [0, 1] ^ (m + 1) ++ [1, 1, 1] ^ j +def bmid (m j : ℕ) : List (Fin 2) := [0, 1] ++ [0, 1, 1] ^ j ++ [0, 1] ^ m +def lbw (m j : ℕ) : List (Fin 2) := [0, 1, 1] ^ j ++ [0, 1] ^ (m + 1) +def xbmid (x : ℕ) : List (Fin 2) := [0, 0, 1] ++ [0, 1] ^ x + +theorem blk_eq_10 (m j : ℕ) : blk m j = [0] ++ [1, 0] ^ m ++ stack j := by + unfold blk stack + rw [← zero_pow10_one, List.append_assoc] + +def blkp (p : ℕ × ℕ) : List (Fin 2) := blk p.1 p.2 +def bmidp (p : ℕ × ℕ) : List (Fin 2) := bmid p.1 p.2 +def lbwp (p : ℕ × ℕ) : List (Fin 2) := lbw p.1 p.2 + +def cw : List (ℕ × ℕ) → List (Fin 2) + | [] => [] + | p :: ch => blkp p ++ cw ch + +def cmid : List (ℕ × ℕ) → List (Fin 2) + | [] => [] + | p :: ch => cmid ch ++ bmidp p + +def clbw : List (ℕ × ℕ) → List (Fin 2) + | [] => [] + | p :: ch => clbw ch ++ lbwp p + +theorem cw_app (l₁ l₂ : List (ℕ × ℕ)) : cw (l₁ ++ l₂) = cw l₁ ++ cw l₂ := by + induction l₁ with + | nil => rfl + | cons p l₁ ih => simp [cw, ih, List.append_assoc] + +def pw (c j : ℕ) (ch : List (ℕ × ℕ)) : List (Fin 2) := blk c j ++ cw ch +def lead1 (a x : ℕ) : List (Fin 2) := blk a 1 ++ [0] ++ [1, 0] ^ x +def lead0 (a x : ℕ) : List (Fin 2) := [0, 1] ^ a ++ [0, 0] ++ [1, 0] ^ x +def tailw (g : ℕ) : List (Fin 2) := [1, 1] ++ [1, 1, 1] ^ g +def edgew (x f : ℕ) : List (Fin 2) := [0] ++ [1, 0] ^ x ++ [1, 1, 1] ^ f +def edge1w (f : ℕ) : List (Fin 2) := [1] ++ [1, 1, 1] ^ f +def leadw (b : Bool) (a x : ℕ) : List (Fin 2) := if b then lead1 a x else lead0 a x +def uw (bs : List (ℕ × ℕ)) (b : Bool) (a x : ℕ) (far : List (Fin 2)) : List (Fin 2) := + cw bs ++ leadw b a x ++ far + +def consume (bs : List (ℕ × ℕ)) (a : ℕ) : Option (ℕ × List (ℕ × ℕ) × ℕ) := + match bs with + | (c + 1, j) :: r => some (0, (c, j) :: r, a) + | (0, j) :: r => some (j, r, a) + | [] => match a with | a' + 1 => some (0, [], a') | 0 => none + +-- ============================================================================ +-- Shift Rules & Block / Chain Lemmas +-- ============================================================================ + +theorem shift_F_01 : segRR F F [0, 1] [0, 1] := + fun l r => dmultiStep_star 2 ⟨F, .right, [], [0, 1]⟩ ⟨F, .right, [0, 1], []⟩ l r rfl + +theorem B_to_F_01 : segRR B F [0, 1] [0, 1] := + fun l r => dmultiStep_star 4 ⟨B, .right, [], [0, 1]⟩ ⟨F, .right, [0, 1], []⟩ l r rfl + +theorem shift_F_111 (l r : ListBlank (Fin 2)) : + (([0, 1] +> l) {{F}}> ([1, 1, 1] +> r)) [tm_coq]⊢* (([0, 1, 0, 1, 1] +> l) {{F}}> r) := + dmultiStep_star 9 ⟨F, .right, [0, 1], [1, 1, 1]⟩ ⟨F, .right, [0, 1, 0, 1, 1], []⟩ l r rfl + +theorem shift_F_111_pow : ∀ (j : ℕ) (l r : ListBlank (Fin 2)), + (([0, 1] +> l) {{F}}> ([1, 1, 1] ^ j +> r)) [tm_coq]⊢* ((([0, 1] ++ [0, 1, 1] ^ j) +> l) {{F}}> r) + | 0, l, r => ⟨0, rfl⟩ + | j + 1, l, r => by + rw [pow_succ_list ([1, 1, 1]), pow_succ_right ([0, 1, 1]), ← List.append_assoc, + listblank_append_assoc, listblank_append_assoc] + have h1 : (([0, 1] +> l) {{F}}> ([1, 1, 1] +> ([1, 1, 1] ^ j +> r))) [tm_coq]⊢* + (([0, 1] +> ([0, 1, 1] +> l)) {{F}}> ([1, 1, 1] ^ j +> r)) := + shift_F_111 l ([1, 1, 1] ^ j +> r) + exact stepStar_trans h1 (shift_F_111_pow j ([0, 1, 1] +> l) r) + +theorem shift_D_01 : segLL D D [0, 1] [0, 1] := + fun l r => dmultiStep_star 2 ⟨D, .left, [0, 1], []⟩ ⟨D, .left, [], [0, 1]⟩ l r rfl + +theorem shift_D_011 : segLL D D [0, 1, 1] [1, 1, 1] := + fun l r => dmultiStep_star 5 ⟨D, .left, [0, 1, 1], []⟩ ⟨D, .left, [], [1, 1, 1]⟩ l r rfl + +theorem shift_A_01 : segLL A A [0, 1] [0, 1] := + fun l r => dmultiStep_star 2 ⟨A, .left, [0, 1], []⟩ ⟨A, .left, [], [0, 1]⟩ l r rfl + +theorem A_default_to_F (R : ListBlank (Fin 2)) : + (default <{{A}} R) [tm_coq]⊢* (([0, 1] +> default) {{F}}> R) := + ldmultiStep_star 5 ⟨A, .left, [], []⟩ ⟨F, .right, [0, 1], []⟩ R rfl + +theorem blkRR_F (m j : ℕ) : segRR F F (blk m j) (bmid m j) := by + intro l r + unfold blk bmid + rw [listblank_append_assoc] + have h1 : (l {{F}}> ([0, 1] ^ (m + 1) +> ([1, 1, 1] ^ j +> r))) [tm_coq]⊢* + (([0, 1] +> ([0, 1] ^ m +> l)) {{F}}> ([1, 1, 1] ^ j +> r)) := by + simpa [pow_succ_list] using segRR_pow shift_F_01 (m + 1) l ([1, 1, 1] ^ j +> r) + have h2 := shift_F_111_pow j ([0, 1] ^ m +> l) r + simpa [List.append_assoc] using stepStar_trans h1 h2 + +theorem blkRR_B (m j : ℕ) : segRR B F (blk m j) (bmid m j) := by + intro l r + unfold blk bmid + rw [listblank_append_assoc] + have h1 : (l {{B}}> ([0, 1] ^ (m + 1) +> ([1, 1, 1] ^ j +> r))) [tm_coq]⊢* + (([0, 1] +> ([0, 1] ^ m +> l)) {{F}}> ([1, 1, 1] ^ j +> r)) := by + have hR := segRR_app B_to_F_01 (segRR_pow shift_F_01 m) l ([1, 1, 1] ^ j +> r) + rw [← pow_succ_right] at hR + simpa [pow_succ_list] using hR + have h2 := shift_F_111_pow j ([0, 1] ^ m +> l) r + simpa [List.append_assoc] using stepStar_trans h1 h2 + +theorem blkLL (m j : ℕ) : segLL D D (lbw m j) (blk m j) := + segLL_app (segLL_pow shift_D_011 j) (segLL_pow shift_D_01 (m + 1)) + +theorem sweepLL : segLL D D [0, 1] [0, 1] := shift_D_01 +theorem yLL_glue (j : ℕ) : segLL D D ([0, 1, 1] ^ j) ([1, 1, 1] ^ j) := segLL_pow shift_D_011 j + +theorem chainRR : ∀ ch : List (ℕ × ℕ), segRR F F (cw ch) (cmid ch) + | [] => fun _ _ => ⟨0, rfl⟩ + | p :: ch => segRR_app (blkRR_F p.1 p.2) (chainRR ch) + +theorem chainLL : ∀ ch : List (ℕ × ℕ), segLL D D (clbw ch) (cw ch) + | [] => fun _ _ => ⟨0, rfl⟩ + | p :: ch => segLL_app (chainLL ch) (blkLL p.1 p.2) + +theorem bmid_shift (m j : ℕ) : bmid m j ++ [0, 1] = [0, 1] ++ lbw m j := by + unfold bmid lbw + rw [List.append_assoc, List.append_assoc, ← pow_succ_right] + +theorem cmid_shift : ∀ ch : List (ℕ × ℕ), cmid ch ++ [0, 1] = [0, 1] ++ clbw ch + | [] => rfl + | p :: ch => by + simp only [cmid, clbw, bmidp, lbwp] + rw [List.append_assoc, bmid_shift, ← List.append_assoc, cmid_shift ch, List.append_assoc] + +theorem bmid_S (m j : ℕ) : bmid (m + 1) j = [0, 1] ++ lbw m j := by + rw [← bmid_shift] + unfold bmid + rw [pow_succ_right] + simp [List.append_assoc] + +theorem prefRR (c j : ℕ) (ch : List (ℕ × ℕ)) : segRR B F (pw c j ch) (cmid ch ++ bmid c j) := + segRR_app (blkRR_B c j) (chainRR ch) + +theorem prefLL (c j : ℕ) (ch : List (ℕ × ℕ)) : segLL D D (cmid ch ++ bmid (c + 1) j) (pw c j ch ++ [0, 1]) := by + rw [bmid_S, ← List.append_assoc, cmid_shift, List.append_assoc] + have h := segLL_app sweepLL (segLL_app (chainLL ch) (blkLL c j)) + simpa [pw, List.append_assoc] using h + +theorem prefLL_glue (j : ℕ) (ch : List (ℕ × ℕ)) : segLL D D (cmid ch ++ bmid 0 j) ([1, 1, 1] ^ j ++ cw ch ++ [0, 1]) := by + have hb0 : bmid 0 j = [0, 1] ++ [0, 1, 1] ^ j := by unfold bmid; simp + rw [hb0, ← List.append_assoc, cmid_shift, List.append_assoc] + have h := segLL_app sweepLL (segLL_app (chainLL ch) (yLL_glue j)) + simpa [List.append_assoc] using h + +-- ============================================================================ +-- Digits, Edge, Root, Resets & Uniform Touch Lemmas +-- ============================================================================ + +theorem leadLL_start : segLL A D [0, 1, 0, 1, 1] [0, 0, 1, 0, 1] := + fun l r => dmultiStep_star 5 ⟨A, .left, [0, 1, 0, 1, 1], []⟩ ⟨D, .left, [], [0, 0, 1, 0, 1]⟩ l r rfl + +theorem leadLL (a : ℕ) : segLL A D (bmid a 1) ([0, 1] ^ a ++ [0, 0] ++ [1, 0, 1]) := by + have h := segLL_app leadLL_start (segLL_pow shift_D_01 a) + simpa [bmid, List.append_assoc] using h + +theorem xbRR_end : segRR F B [1] [0] := + fun l r => dmultiStep_star 1 ⟨F, .right, [], [1]⟩ ⟨B, .right, [0], []⟩ l r rfl + +theorem xbRR (x : ℕ) : segRR F B ([0] ++ [1, 0] ^ x ++ [1, 1]) (xbmid x) := by + have h := segRR_app (segRR_pow shift_F_01 (x + 1)) xbRR_end + have heq1 : ([0] : List (Fin 2)) ++ [1, 0] ^ x ++ [1, 1] = [0, 1] ^ (x + 1) ++ [1] := by + rw [← zero_pow10_one]; simp [List.append_assoc] + have heq2 : ([0] : List (Fin 2)) ++ [0, 1] ^ (x + 1) = xbmid x := rfl + rw [heq1, ← heq2] + exact h + +theorem xbLL_start : segLL D A [0, 0, 1] [0, 1, 1] := + fun l r => dmultiStep_star 3 ⟨D, .left, [0, 0, 1], []⟩ ⟨A, .left, [], [0, 1, 1]⟩ l r rfl + +theorem xbLL (x : ℕ) : segLL D A (xbmid x) ([0] ++ [1, 0] ^ x ++ [1, 1]) := by + have h := segLL_app xbLL_start (segLL_pow shift_A_01 x) + have heq : ([0, 1] : List (Fin 2)) ^ x ++ [0, 1, 1] = [0] ++ [1, 0] ^ x ++ [1, 1] := by + calc ([0, 1] : List (Fin 2)) ^ x ++ [0, 1, 1] + _ = ([0, 1] ^ x ++ [0, 1]) ++ [1] := by simp [List.append_assoc] + _ = [0, 1] ^ (x + 1) ++ [1] := by rw [← pow_succ_right] + _ = ([0] ++ [1, 0] ^ x ++ [1]) ++ [1] := by rw [zero_pow10_one] + _ = [0] ++ [1, 0] ^ x ++ [1, 1] := by simp [List.append_assoc] + unfold xbmid + rw [← heq] + exact h + +theorem leadstop_turn : segRL F D [0, 0] [1, 1] := + fun l r => dmultiStep_star 3 ⟨F, .right, [], [0, 0]⟩ ⟨D, .left, [], [1, 1]⟩ l r rfl + +theorem leadstop0 (x : ℕ) : segRL F D ([0, 0] ++ [1, 0] ^ (x + 1)) ([1, 1, 1] ++ [0] ++ [1, 0] ^ x) := by + have h := segRL_frame ([1, 0] ^ (x + 1)) leadstop_turn + simpa [pow_succ_list, List.append_assoc] using h + +theorem leadstopS (a x : ℕ) : + segRL F D ([0, 1] ^ (a + 1) ++ [0, 0] ++ [1, 0] ^ (x + 1)) (lead1 a x) := by + have h := segRR_RL_LL (segRR_pow shift_F_01 (a + 1)) (leadstop0 x) (segLL_pow shift_D_01 (a + 1)) + simpa [lead1, blk, List.append_assoc] using h + +theorem stopK1 (c a : ℕ) : segRL B D (lead0 (c + 1) (a + 1)) (lead1 c a) := by + have hR : segRR B F ([0, 1] ^ (c + 1)) ([0, 1] ^ (c + 1)) := by + have h0 := segRR_app B_to_F_01 (segRR_pow shift_F_01 c) + rwa [← pow_succ_right, ← pow_succ_list] at h0 + have h := segRR_RL_LL hR (leadstop0 a) (segLL_pow shift_D_01 (c + 1)) + simpa [lead0, lead1, blk, List.append_assoc] using h + +theorem stop1 (c a : ℕ) : segRL B D (lead0 (c + 1) (a + 1)) (lead1 c a) := stopK1 c a + +theorem halt0 (x : ℕ) (l r : ListBlank (Fin 2)) : haltsFrom (l {{B}}> (lead0 0 x +> r)) := by + refine ⟨([1] +> l) {{C}}> ([0] +> ([1, 0] ^ x +> r)), ?_, ?_⟩ + · simpa [lead0, evalDCfg] using dmultiStep_star 1 ⟨B, .right, [], [0, 0]⟩ ⟨C, .right, [1], [0]⟩ l ([1, 0] ^ x +> r) rfl + · simp [step, C, tm_coq] + +theorem shift_E_111 (l r : ListBlank (Fin 2)) : + (([1] +> l) {{E}}> ([1, 1, 1] +> r)) [tm_coq]⊢* (([1, 0, 1, 1] +> l) {{E}}> r) := + dmultiStep_star 9 ⟨E, .right, [1], [1, 1, 1]⟩ ⟨E, .right, [1, 0, 1, 1], []⟩ l r rfl + +theorem shift_E_111_pow : ∀ (k : ℕ) (l r : ListBlank (Fin 2)), + (([1] +> l) {{E}}> ([1, 1, 1] ^ k +> r)) [tm_coq]⊢* ((([1] ++ [0, 1, 1] ^ k) +> l) {{E}}> r) + | 0, l, r => ⟨0, rfl⟩ + | k + 1, l, r => by + rw [pow_succ_list ([1, 1, 1]), pow_succ_right ([0, 1, 1]), ← List.append_assoc, + listblank_append_assoc, listblank_append_assoc] + have h1 : (([1] +> l) {{E}}> ([1, 1, 1] +> ([1, 1, 1] ^ k +> r))) [tm_coq]⊢* + (([1] +> ([0, 1, 1] +> l)) {{E}}> ([1, 1, 1] ^ k +> r)) := + shift_E_111 l ([1, 1, 1] ^ k +> r) + exact stepStar_trans h1 (shift_E_111_pow k ([0, 1, 1] +> l) r) + +theorem bounce_E_default (l : ListBlank (Fin 2)) : + (([1] +> l) {{E}}> default) [tm_coq]⊢* (l <{{D}} ([1, 1] +> default)) := + rdmultiStep_star 2 ⟨E, .right, [1], []⟩ ⟨D, .left, [], [1, 1]⟩ l rfl + +theorem edgeE_bounce (k : ℕ) (l : ListBlank (Fin 2)) : + (([1] +> l) {{E}}> ([1, 1, 1] ^ k +> default)) [tm_coq]⊢* (l <{{D}} (([1, 1] ++ [1, 1, 1] ^ k) +> default)) := by + have h1 := shift_E_111_pow k l default + rw [listblank_append_assoc] at h1 + have h2 := bounce_E_default ([0, 1, 1] ^ k +> l) + have h3 := segLL_pow shift_D_011 k l ([1, 1] +> default) + rw [← listblank_append_assoc, ← two_ones_pow111] at h3 + exact stepStar_trans h1 (stepStar_trans h2 h3) + +theorem edge0L0 (f : ℕ) : sideRL F D (([0] ++ [1, 1, 1] ^ f) +> default) (([1, 1] ++ [1, 1, 1] ^ f) +> default) := by + intro l + rw [listblank_append_assoc] + have h1 : (l {{F}}> ([0] +> ([1, 1, 1] ^ f +> default))) [tm_coq]⊢* (([1] +> l) {{E}}> ([1, 1, 1] ^ f +> default)) := + dmultiStep_star 1 ⟨F, .right, [], [0]⟩ ⟨E, .right, [1], []⟩ l ([1, 1, 1] ^ f +> default) rfl + exact stepStar_trans h1 (edgeE_bounce f l) + +theorem z_absorb (f : ℕ) : sideRL B D (edgew 0 (f + 1) +> default) (([1, 1] ++ [1, 1, 1] ^ (f + 1)) +> default) := by + intro l + have h1 := dmultiStep_star 3 ⟨B, .right, [], [0, 1]⟩ ⟨E, .right, [1], [1]⟩ l ([1, 1] +> ([1, 1, 1] ^ f +> default)) rfl + have h1' : (l {{B}}> (edgew 0 (f + 1) +> default)) [tm_coq]⊢* + (([1] +> l) {{E}}> ([1, 1, 1] ^ (f + 1) +> default)) := by + simpa [edgew, evalDCfg, pow_succ_list, List.append_assoc] using h1 + exact stepStar_trans h1' (edgeE_bounce (f + 1) l) + +theorem edge0L (x f : ℕ) : sideRL F D (([0] ++ [1, 0] ^ (x + 1) ++ [1, 1, 1] ^ f) +> default) (([0] ++ [1, 0] ^ x ++ [1, 1, 1] ^ (f + 1)) +> default) := by + have heq1 : ([0] : List (Fin 2)) ++ [1, 0] ^ (x + 1) ++ [1, 1, 1] ^ f = [0, 1] ^ (x + 1) ++ ([0] ++ [1, 1, 1] ^ f) := by + calc ([0] : List (Fin 2)) ++ [1, 0] ^ (x + 1) ++ [1, 1, 1] ^ f + _ = ([0] ++ [1, 0] ^ x ++ [1]) ++ ([0] ++ [1, 1, 1] ^ f) := by + rw [pow_succ_right ([1, 0])]; simp [List.append_assoc] + _ = [0, 1] ^ (x + 1) ++ ([0] ++ [1, 1, 1] ^ f) := by rw [zero_pow10_one] + have heq2 : ([0, 1] : List (Fin 2)) ^ (x + 1) ++ ([1, 1] ++ [1, 1, 1] ^ f) = [0] ++ [1, 0] ^ x ++ [1, 1, 1] ^ (f + 1) := by + rw [← zero_pow10_one] + simp [pow_succ_list, List.append_assoc] + have h := segRR_sideRL_LL (segRR_pow shift_F_01 (x + 1)) (edge0L0 f) (segLL_pow shift_D_01 (x + 1)) + rwa [← listblank_append_assoc, ← listblank_append_assoc, ← heq1, heq2] at h + +theorem edge0E (y f : ℕ) : sideRL B D (([0] ++ [1, 0] ^ (y + 1) ++ [1, 1, 1] ^ f) +> default) (([0] ++ [1, 0] ^ y ++ [1, 1, 1] ^ (f + 1)) +> default) := by + have hR : segRR B F ([0, 1] ^ (y + 1)) ([0, 1] ^ (y + 1)) := by + have h0 := segRR_app B_to_F_01 (segRR_pow shift_F_01 y) + rwa [← pow_succ_right, ← pow_succ_list] at h0 + have heq1 : ([0] : List (Fin 2)) ++ [1, 0] ^ (y + 1) ++ [1, 1, 1] ^ f = [0, 1] ^ (y + 1) ++ ([0] ++ [1, 1, 1] ^ f) := by + calc ([0] : List (Fin 2)) ++ [1, 0] ^ (y + 1) ++ [1, 1, 1] ^ f + _ = ([0] ++ [1, 0] ^ y ++ [1]) ++ ([0] ++ [1, 1, 1] ^ f) := by + rw [pow_succ_right ([1, 0])]; simp [List.append_assoc] + _ = [0, 1] ^ (y + 1) ++ ([0] ++ [1, 1, 1] ^ f) := by rw [zero_pow10_one] + have heq2 : ([0, 1] : List (Fin 2)) ^ (y + 1) ++ ([1, 1] ++ [1, 1, 1] ^ f) = [0] ++ [1, 0] ^ y ++ [1, 1, 1] ^ (f + 1) := by + rw [← zero_pow10_one] + simp [pow_succ_list, List.append_assoc] + have h := segRR_sideRL_LL hR (edge0L0 f) (segLL_pow shift_D_01 (y + 1)) + rwa [← listblank_append_assoc, ← listblank_append_assoc, ← heq1, heq2] at h + +theorem u0E (y f : ℕ) : sideRL B D (edgew (y + 1) f +> default) (edgew y (f + 1) +> default) := + edge0E y f + +def root (t : ℕ) (X : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + default <{{A}} (([0, 1] ^ t ++ [0, 1, 1]) +> X) + +def wmid (t : ℕ) : List (Fin 2) := [0, 0, 1] ++ [0, 1] ^ (t + 1) + +theorem pow_01_append_default (k : ℕ) : + ([0, 1] : List (Fin 2)) ^ k +> ([0, 1] +> (default : ListBlank (Fin 2))) = [0, 1] ^ (k + 1) +> default := by + rw [← listblank_append_assoc, ← pow_succ_right] + +theorem root_in (t : ℕ) (X : ListBlank (Fin 2)) : + (root t X) [tm_coq]⊢* ((wmid t +> default) {{B}}> X) := by + unfold root wmid + have heq : ([0, 1] : List (Fin 2)) ^ t ++ [0, 1, 1] = [0, 1] ^ (t + 1) ++ [1] := by + rw [pow_succ_right]; simp [List.append_assoc] + rw [heq, listblank_append_assoc] + have h1 := A_default_to_F ([0, 1] ^ (t + 1) +> ([1] +> X)) + have h2 := segRR_pow shift_F_01 (t + 1) ([0, 1] +> default) ([1] +> X) + rw [pow_01_append_default (t + 1)] at h2 + have h3 := xbRR_end ([0, 1] ^ (t + 2) +> default) X + have h := stepStar_trans h1 (stepStar_trans h2 h3) + simpa [pow_succ_list, List.append_assoc] using h + +theorem root_out (t : ℕ) (X : ListBlank (Fin 2)) : + ((wmid t +> default) <{{D}} X) [tm_coq]⊢* (root (t + 1) X) := by + unfold wmid root + have h := segLL_app xbLL_start (segLL_pow shift_A_01 (t + 1)) default X + simpa [List.append_assoc] using h + +theorem root_step (t : ℕ) (X X' : ListBlank (Fin 2)) (h : sideRL B D X X') : + (root t X) [tm_coq]⊢* (root (t + 1) X') := + stepStar_trans (root_in t X) (stepStar_trans (h (wmid t +> default)) (root_out t X')) + +theorem root_steps : ∀ (n t : ℕ) (X X' : ListBlank (Fin 2)), + sideRLs n X X' → (root t X) [tm_coq]⊢* (root (n + t) X') + | 0, t, X, _, .zero _ => by simp [stepStar_refl] + | n + 1, t, X, X', .succ h₁ hs => by + have hstep := root_step t X _ h₁ + have hrest := root_steps n (t + 1) _ X' hs + have hn : n + (t + 1) = n + 1 + t := by omega + rw [hn] at hrest + exact stepStar_trans hstep hrest + +theorem root_halt (t : ℕ) (X : ListBlank (Fin 2)) (h : sideRL_halt X) : + haltsFrom (root t X) := + haltsFrom_stepStar (root_in t X) (h (wmid t +> default)) + +theorem gen_RL {ci co : List (Fin 2)} (hF : segRL F D ci co) (c j : ℕ) (ch : List (ℕ × ℕ)) : + segRL B D (pw (c + 1) j ch ++ ci) (pw c j ch ++ [0, 1] ++ co) := by + have h := segRR_RL_LL (prefRR (c + 1) j ch) hF (prefLL c j ch) + simpa [List.append_assoc] using h + +theorem gen_RLg {ci co : List (Fin 2)} (hF : segRL F D ci co) (j : ℕ) (ch : List (ℕ × ℕ)) : + segRL B D (pw 0 j ch ++ ci) ([1, 1, 1] ^ j ++ cw ch ++ [0, 1] ++ co) := by + have h := segRR_RL_LL (prefRR 0 j ch) hF (prefLL_glue j ch) + simpa [List.append_assoc] using h + +theorem gen_fwd {ci m co : List (Fin 2)} (hR : segRR F B ci m) (hL : segLL D D m co) (c j : ℕ) (ch : List (ℕ × ℕ)) : + passRL (pw (c + 1) j ch ++ ci) (pw c j ch ++ [0, 1] ++ co) := by + have h := lrcons1_pass (segRR_app (prefRR (c + 1) j ch) hR) (segLL_app hL (prefLL c j ch)) + simpa [List.append_assoc] using h + +theorem gen_fwdg {ci m co : List (Fin 2)} (hR : segRR F B ci m) (hL : segLL D D m co) (j : ℕ) (ch : List (ℕ × ℕ)) : + passRL (pw 0 j ch ++ ci) ([1, 1, 1] ^ j ++ cw ch ++ [0, 1] ++ co) := by + have h := lrcons1_pass (segRR_app (prefRR 0 j ch) hR) (segLL_app hL (prefLL_glue j ch)) + simpa [List.append_assoc] using h + +theorem gen_side {ci co : List (Fin 2)} {R R' : ListBlank (Fin 2)} + (hF : sideRL F D (ci +> R) (co +> R')) (c j : ℕ) (ch : List (ℕ × ℕ)) : + sideRL B D ((pw (c + 1) j ch ++ ci) +> R) ((pw c j ch ++ [0, 1] ++ co) +> R') := by + have h := segRR_sideRL_LL (prefRR (c + 1) j ch) hF (prefLL c j ch) + simpa [List.append_assoc] using h + +theorem gen_sideg {ci co : List (Fin 2)} {R R' : ListBlank (Fin 2)} + (hF : sideRL F D (ci +> R) (co +> R')) (j : ℕ) (ch : List (ℕ × ℕ)) : + sideRL B D ((pw 0 j ch ++ ci) +> R) (([1, 1, 1] ^ j ++ cw ch ++ [0, 1] ++ co) +> R') := by + have h := segRR_sideRL_LL (prefRR 0 j ch) hF (prefLL_glue j ch) + simpa [List.append_assoc] using h + +theorem cstopF (a x : ℕ) (far : List (Fin 2)) : + ∃ co, segRL F D (lead0 a (x + 1) ++ far) co ∧ [0, 1] ++ co = lead1 a x ++ far := by + cases a with + | zero => + refine ⟨([1, 1, 1] ++ [0] ++ [1, 0] ^ x) ++ far, ?_, ?_⟩ + · simpa [lead0, List.append_assoc] using segRL_frame far (leadstop0 x) + · simp [lead1, blk, List.append_assoc] + | succ a => + refine ⟨lead1 a x ++ far, ?_, ?_⟩ + · simpa [lead0, List.append_assoc] using segRL_frame far (leadstopS a x) + · simp [lead1, blk, pow_succ_list, List.append_assoc] + +theorem t_stop (bs : List (ℕ × ℕ)) (a x : ℕ) (far : List (Fin 2)) (ov : ℕ) (bs' : List (ℕ × ℕ)) (a' : ℕ) + (h : consume bs a = some (ov, bs', a')) : + segRL B D (uw bs false a (x + 1) far) ([1, 1, 1] ^ ov ++ uw bs' true a' x far) := by + rcases cstopF a x far with ⟨co, hF, hE⟩ + cases bs with + | nil => + cases a with + | zero => nomatch h + | succ a => + simp only [consume, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + simpa [uw, leadw, cw, List.append_assoc] using segRL_frame far (stopK1 a x) + | cons p r => + rcases p with ⟨_ | c, j⟩ + · simp only [consume, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + have hg := gen_RLg hF j r + rw [List.append_assoc ([1, 1, 1] ^ j ++ cw r), hE] at hg + simpa [uw, leadw, pw, cw, blkp, List.append_assoc] using hg + · simp only [consume, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + have hg := gen_RL hF c j r + rw [List.append_assoc (pw c j r), hE] at hg + simpa [uw, leadw, pw, cw, blkp, List.append_assoc] using hg + +def cpass_mid (a x : ℕ) : List (Fin 2) := xbmid x ++ bmid a 1 +def cpass_co (a x : ℕ) : List (Fin 2) := ([0, 1] ^ a ++ [0, 0] ++ [1, 0, 1]) ++ ([0] ++ [1, 0] ^ x ++ [1, 1]) + +theorem cpassRR (a x : ℕ) : segRR F B (lead1 a x ++ [1, 1]) (cpass_mid a x) := by + have h := segRR_app (blkRR_F a 1) (xbRR x) + simpa [lead1, cpass_mid, List.append_assoc] using h + +theorem cpassLL (a x : ℕ) : segLL D D (cpass_mid a x) (cpass_co a x) := + segLL_app (xbLL x) (leadLL a) + +theorem cpass_co_eq (a x : ℕ) : cpass_co a x = lead0 a (x + 2) ++ tailw 0 := by + simp [cpass_co, lead0, tailw, pow_succ_list, List.append_assoc] + +theorem passK1 (a x : ℕ) : passRL (lead1 a x ++ [1, 1]) (lead0 a (x + 2) ++ [1, 1]) := by + have hR : segRR B B (lead1 a x ++ [1, 1]) (cpass_mid a x) := by + simpa [lead1, cpass_mid, List.append_assoc] using segRR_app (blkRR_B a 1) (xbRR x) + have hL : segLL D D (cpass_mid a x) (lead0 a (x + 2) ++ [1, 1]) := by + have h := cpassLL a x + rwa [cpass_co_eq] at h + exact lrcons1_pass hR hL + +theorem t_pass (bs : List (ℕ × ℕ)) (a x ov : ℕ) (bs' : List (ℕ × ℕ)) (a' : ℕ) + (h : consume bs (a + 1) = some (ov, bs', a')) : + passRL (uw bs true a x (tailw 0)) ([1, 1, 1] ^ ov ++ uw bs' false a' (x + 2) (tailw 0)) := by + cases bs with + | nil => + simp only [consume, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + simpa [uw, leadw, cw, tailw, List.append_assoc] using passK1 a x + | cons p r => + rcases p with ⟨_ | c, j⟩ + · simp only [consume, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + have hg := gen_fwdg (cpassRR a x) (cpassLL a x) j r + rw [cpass_co_eq] at hg + simpa [uw, leadw, lead0, pw, cw, blkp, tailw, pow_succ_list, List.append_assoc] using hg + · simp only [consume, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + have hg := gen_fwd (cpassRR a x) (cpassLL a x) c j r + rw [cpass_co_eq] at hg + simpa [uw, leadw, lead0, pw, cw, blkp, tailw, pow_succ_list, List.append_assoc] using hg + +theorem lead1_tailw_eq (a x g : ℕ) : + lead1 a x ++ tailw (g + 1) = blk a 1 ++ blk x (g + 1) ++ [1] := by + calc lead1 a x ++ tailw (g + 1) + _ = blk a 1 ++ ([0] ++ [1, 0] ^ x ++ [1]) ++ ([1] ++ [1, 1, 1] ^ (g + 1)) := by + simp [lead1, tailw, List.append_assoc] + _ = blk a 1 ++ [0, 1] ^ (x + 1) ++ ([1, 1, 1] ^ (g + 1) ++ [1]) := by + rw [zero_pow10_one, one_pow111] + _ = blk a 1 ++ blk x (g + 1) ++ [1] := by + simp [blk, List.append_assoc] + +theorem lead1_edge1w_eq (a x f : ℕ) : + lead1 a x ++ edge1w f = blk a 1 ++ blk x f := by + calc lead1 a x ++ edge1w f + _ = blk a 1 ++ ([0] ++ [1, 0] ^ x ++ [1]) ++ [1, 1, 1] ^ f := by + simp [lead1, edge1w, List.append_assoc] + _ = blk a 1 ++ [0, 1] ^ (x + 1) ++ [1, 1, 1] ^ f := by + rw [zero_pow10_one] + _ = blk a 1 ++ blk x f := by + simp [blk, List.append_assoc] + +def um (a x g : ℕ) : List (Fin 2) := ([0] ++ bmid x (g + 1)) ++ bmid a 1 +def uco (a x g : ℕ) : List (Fin 2) := [0, 1] ^ a ++ [1, 1, 1] ++ blk x g ++ [0, 0, 1, 0, 1, 1] + +theorem u_RF (a x g : ℕ) : segRR F B (lead1 a x ++ tailw (g + 1)) (um a x g) := by + rw [lead1_tailw_eq] + have h := segRR_app (segRR_app (blkRR_F a 1) (blkRR_F x (g + 1))) xbRR_end + simpa [um, List.append_assoc] using h + +theorem u_RB (a x g : ℕ) : segRR B B (lead1 a x ++ tailw (g + 1)) (um a x g) := by + rw [lead1_tailw_eq] + have h := segRR_app (segRR_app (blkRR_B a 1) (blkRR_F x (g + 1))) xbRR_end + simpa [um, List.append_assoc] using h + +theorem u_L_start : segLL D D [0, 0, 1, 0, 1, 1] [0, 0, 1, 0, 1, 1] := + fun l r => dmultiStep_star 6 ⟨D, .left, [0, 0, 1, 0, 1, 1], []⟩ ⟨D, .left, [], [0, 0, 1, 0, 1, 1]⟩ l r rfl + +theorem um_eq (a x g : ℕ) : um a x g = [0, 0, 1, 0, 1, 1] ++ (lbw x g ++ ([0, 1, 1] ++ [0, 1] ^ a)) := by + unfold um bmid lbw + rw [pow_succ_list ([0, 1, 1] : List (Fin 2)) g, pow_succ_right ([0, 1] : List (Fin 2)) x] + simp [List.append_assoc] + +theorem u_L (a x g : ℕ) : segLL D D (um a x g) (uco a x g) := by + rw [um_eq] + have h := segLL_app u_L_start (segLL_app (blkLL x g) (segLL_app shift_D_011 (segLL_pow shift_D_01 a))) + simpa [uco, List.append_assoc] using h + +theorem t_ungl1 (bs : List (ℕ × ℕ)) (a x ov : ℕ) (bs' : List (ℕ × ℕ)) (a' : ℕ) + (h : consume (bs ++ [(a, 1)]) (x + 1) = some (ov, bs', a')) : + passRL (uw bs true a x (tailw 1)) ([1, 1, 1] ^ ov ++ uw bs' false a' 1 (tailw 0)) := by + cases bs with + | nil => + cases a with + | zero => + simp only [List.nil_append, consume, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + simpa [uw, leadw, cw, uco, blk, lead0, tailw, List.append_assoc] using lrcons1_pass (u_RB 0 x 0) (u_L 0 x 0) + | succ a => + simp only [List.nil_append, consume, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + simpa [uw, leadw, cw, blkp, uco, blk, lead0, tailw, pow_succ_list, List.append_assoc] using lrcons1_pass (u_RB (a + 1) x 0) (u_L (a + 1) x 0) + | cons p r => + rcases p with ⟨_ | c, j⟩ + · simp only [List.cons_append, consume, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + have hg := gen_fwdg (u_RF a x 0) (u_L a x 0) j r + simpa [uw, leadw, pw, cw, cw_app, blkp, uco, blk, lead0, tailw, pow_succ_list, List.append_assoc] using hg + · simp only [List.cons_append, consume, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + have hg := gen_fwd (u_RF a x 0) (u_L a x 0) c j r + simpa [uw, leadw, pw, cw, cw_app, blkp, uco, blk, lead0, tailw, pow_succ_list, List.append_assoc] using hg + +theorem t_ungl2 (bs : List (ℕ × ℕ)) (a x g ov : ℕ) (bs' : List (ℕ × ℕ)) (a' : ℕ) + (h : consume (bs ++ [(a, 1), (x, g + 1)]) 0 = some (ov, bs', a')) : + passRL (uw bs true a x (tailw (g + 2))) ([1, 1, 1] ^ ov ++ uw bs' false a' 1 (tailw 0)) := by + cases bs with + | nil => + cases a with + | zero => + simp only [List.nil_append, consume, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + simpa [uw, leadw, cw, blkp, uco, blk, lead0, tailw, List.append_assoc] using lrcons1_pass (u_RB 0 x (g + 1)) (u_L 0 x (g + 1)) + | succ a => + simp only [List.nil_append, consume, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + simpa [uw, leadw, cw, blkp, uco, blk, lead0, tailw, pow_succ_list, List.append_assoc] using lrcons1_pass (u_RB (a + 1) x (g + 1)) (u_L (a + 1) x (g + 1)) + | cons p r => + rcases p with ⟨_ | c, j⟩ + · simp only [List.cons_append, consume, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + have hg := gen_fwdg (u_RF a x (g + 1)) (u_L a x (g + 1)) j r + simpa [uw, leadw, pw, cw, cw_app, blkp, uco, blk, lead0, tailw, pow_succ_list, List.append_assoc] using hg + · simp only [List.cons_append, consume, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + have hg := gen_fwd (u_RF a x (g + 1)) (u_L a x (g + 1)) c j r + simpa [uw, leadw, pw, cw, cw_app, blkp, uco, blk, lead0, tailw, pow_succ_list, List.append_assoc] using hg + +theorem t_halt (x : ℕ) (far : List (Fin 2)) (l r : ListBlank (Fin 2)) : + haltsFrom (l {{B}}> (uw [] false 0 x far +> r)) := by + simpa [uw, leadw, cw] using halt0 x l (far +> r) + +theorem z_lead (bs : List (ℕ × ℕ)) (x f ov : ℕ) (bs' : List (ℕ × ℕ)) (a' : ℕ) + (hne : bs ≠ []) (h : consume bs 0 = some (ov, bs', a')) : + sideRL B D ((cw bs ++ edgew x f) +> default) (([1, 1, 1] ^ ov ++ cw bs' ++ edgew x (f + 1)) +> default) := by + cases bs with + | nil => contradiction + | cons p r => + rcases p with ⟨_ | c, j⟩ + · simp only [consume, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + cases x with + | zero => + have hg := gen_sideg (edge0L0 f) j r + simpa [pw, cw, blkp, edgew, List.append_assoc] using hg + | succ x => + have hg := gen_sideg (edge0L x f) j r + simpa [pw, cw, blkp, edgew, List.append_assoc] using hg + · simp only [consume, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + cases x with + | zero => + have hg := gen_side (edge0L0 f) c j r + simpa [pw, cw, blkp, edgew, List.append_assoc] using hg + | succ x => + have hg := gen_side (edge0L x f) c j r + simpa [pw, cw, blkp, edgew, List.append_assoc] using hg + +theorem z_empty (y f : ℕ) : sideRL B D (edgew (y + 1) f +> default) (edgew y (f + 1) +> default) := + u0E y f + +theorem z_stop (bs : List (ℕ × ℕ)) (a x f ov : ℕ) (bs' : List (ℕ × ℕ)) (a' : ℕ) + (h : consume bs a = some (ov, bs', a')) : + sideRL B D (uw bs false a (x + 1) (edge1w f) +> default) (([1, 1, 1] ^ ov ++ uw bs' true a' x (edge1w f)) +> default) := + segRL_side default (t_stop bs a x (edge1w f) ov bs' a' h) + +def zco (a x f : ℕ) : List (Fin 2) := [0, 1] ^ a ++ [1, 1, 1] ++ blk x f ++ edgew 0 1 + +theorem bounce_F_default (l : ListBlank (Fin 2)) : + (([0, 1] +> l) {{F}}> default) [tm_coq]⊢* (l <{{D}} (edgew 0 1 +> default)) := + rdmultiStep_star 5 ⟨F, .right, [0, 1], []⟩ ⟨D, .left, [], [0, 1, 1, 1]⟩ l rfl + +theorem bmid_pair_eq (a x f : ℕ) : + bmid x f ++ bmid a 1 = [0, 1] ++ (lbw x f ++ ([0, 1, 1] ++ [0, 1] ^ a)) := by + unfold bmid lbw + rw [pow_succ_right ([0, 1] : List (Fin 2)) x] + simp [List.append_assoc] + +theorem z1_bounce_LL (a x f : ℕ) (l : ListBlank (Fin 2)) : + (((bmid x f ++ bmid a 1) +> l) {{F}}> default) [tm_coq]⊢* (l <{{D}} (zco a x f +> default)) := by + rw [bmid_pair_eq, listblank_append_assoc] + have h1 := bounce_F_default ((lbw x f ++ ([0, 1, 1] ++ [0, 1] ^ a)) +> l) + have h2 := segLL_app (blkLL x f) (segLL_app shift_D_011 (segLL_pow shift_D_01 a)) l (edgew 0 1 +> default) + have h := stepStar_trans h1 h2 + simpa [zco, List.append_assoc] using h + +theorem z1F (a x f : ℕ) : sideRL F D ((lead1 a x ++ edge1w f) +> default) (zco a x f +> default) := by + intro l + rw [lead1_edge1w_eq] + have hR := segRR_app (blkRR_F a 1) (blkRR_F x f) l default + exact stepStar_trans hR (z1_bounce_LL a x f l) + +theorem z1B (a x f : ℕ) : sideRL B D ((lead1 a x ++ edge1w f) +> default) (zco a x f +> default) := by + intro l + rw [lead1_edge1w_eq] + have hR := segRR_app (blkRR_B a 1) (blkRR_F x f) l default + exact stepStar_trans hR (z1_bounce_LL a x f l) + +theorem z_1111 (bs : List (ℕ × ℕ)) (a x f ov : ℕ) (bs' : List (ℕ × ℕ)) (a' : ℕ) + (h : consume (bs ++ [(a, 1), (x, f)]) 0 = some (ov, bs', a')) : + sideRL B D (uw bs true a x (edge1w f) +> default) (([1, 1, 1] ^ ov ++ cw bs' ++ edgew 0 1) +> default) := by + cases bs with + | nil => + cases a with + | zero => + simp only [List.nil_append, consume, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + simpa [uw, leadw, cw, blkp, zco, blk, List.append_assoc] using z1B 0 x f + | succ a => + simp only [List.nil_append, consume, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + simpa [uw, leadw, cw, blkp, zco, blk, pow_succ_list, List.append_assoc] using z1B (a + 1) x f + | cons p r => + rcases p with ⟨_ | c, j⟩ + · simp only [List.cons_append, consume, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + have hg := gen_sideg (z1F a x f) j r + simpa [uw, leadw, pw, cw, cw_app, blkp, zco, blk, pow_succ_list, List.append_assoc] using hg + · simp only [List.cons_append, consume, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + have hg := gen_side (z1F a x f) c j r + simpa [uw, leadw, pw, cw, cw_app, blkp, zco, blk, pow_succ_list, List.append_assoc] using hg + +def NT (s g : ℕ) (X : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + default <{{A}} (([1, 0] ^ s ++ [1] ++ [0, 0] ++ [1, 0] ++ tailw g) +> X) + +def rmid (t : ℕ) : List (Fin 2) := [0, 0, 1, 0, 1, 1] ++ [0, 1] ^ (t + 1) + +theorem reset1_in (t : ℕ) (X : ListBlank (Fin 2)) : + (root t ([1, 1, 1] +> X)) [tm_coq]⊢* ((rmid t +> default) {{B}}> X) := by + unfold root rmid + have heq : ([0, 1] : List (Fin 2)) ^ t ++ [0, 1, 1] ++ [1, 1, 1] = [0, 1] ^ (t + 1) ++ ([1, 1, 1] ++ [1]) := by + rw [pow_succ_right]; simp [List.append_assoc] + rw [← listblank_append_assoc, heq, listblank_append_assoc, listblank_append_assoc] + have h1 := A_default_to_F ([0, 1] ^ (t + 1) +> ([1, 1, 1] +> ([1] +> X))) + have h2 := segRR_pow shift_F_01 (t + 1) ([0, 1] +> default) ([1, 1, 1] +> ([1] +> X)) + rw [pow_01_append_default (t + 1)] at h2 + have h3 : (([0, 1] ^ (t + 2) +> default) {{F}}> ([1, 1, 1] +> ([1] +> X))) [tm_coq]⊢* + (([0, 1, 0, 1, 1] +> ([0, 1] ^ (t + 1) +> default)) {{F}}> ([1] +> X)) := by + simpa [pow_succ_list] using shift_F_111 ([0, 1] ^ (t + 1) +> default) ([1] +> X) + have h4 := xbRR_end ([0, 1, 0, 1, 1] +> ([0, 1] ^ (t + 1) +> default)) X + have h := stepStar_trans h1 (stepStar_trans h2 (stepStar_trans h3 h4)) + simpa [List.append_assoc] using h + +theorem D_default_to_A (R : ListBlank (Fin 2)) : + (default <{{D}} R) [tm_coq]⊢* (default <{{A}} ([1] +> R)) := + ldmultiStep_star 1 ⟨D, .left, [], []⟩ ⟨A, .left, [], [1]⟩ R rfl + +theorem reset1_out (t : ℕ) (X : ListBlank (Fin 2)) : + ((rmid t +> default) <{{D}} X) [tm_coq]⊢* (NT (t + 1) 0 X) := by + unfold rmid NT + have h1 := segLL_app u_L_start (segLL_pow shift_D_01 (t + 1)) default X + have h2 := D_default_to_A (([0, 1] ^ (t + 1) ++ [0, 0, 1, 0, 1, 1]) +> X) + have h := stepStar_trans h1 h2 + have heq : ([1] : List (Fin 2)) ++ ([0, 1] ^ (t + 1) ++ [0, 0, 1, 0, 1, 1]) = + [1, 0] ^ (t + 1) ++ [1] ++ [0, 0] ++ [1, 0] ++ tailw 0 := by + rw [← List.append_assoc ([1]), one_pow_01] + simp [tailw, List.append_assoc] + rwa [← listblank_append_assoc, heq] at h + +theorem reset1 (t : ℕ) (X X' : ListBlank (Fin 2)) (h : sideRL B D X X') : + (root t ([1, 1, 1] +> X)) [tm_coq]⊢* (NT (t + 1) 0 X') := + stepStar_trans (reset1_in t X) (stepStar_trans (h (rmid t +> default)) (reset1_out t X')) + +theorem reset1_halt (t : ℕ) (X : ListBlank (Fin 2)) (h : sideRL_halt X) : + haltsFrom (root t ([1, 1, 1] +> X)) := + haltsFrom_stepStar (reset1_in t X) (h (rmid t +> default)) + +theorem reset2 (s g : ℕ) (X : ListBlank (Fin 2)) : + (NT (s + 1) g X) [tm_coq]⊢* (root 0 ((lead1 s 0 ++ tailw g) +> X)) := by + unfold NT root + have heq : ([1, 0] : List (Fin 2)) ^ (s + 1) ++ [1] ++ [0, 0] ++ [1, 0] ++ tailw g = + [1] ++ (lead0 (s + 1) 1 ++ tailw g) := by + rw [← one_pow_01] + simp [lead0, List.append_assoc] + rw [heq, listblank_append_assoc, listblank_append_assoc] + have h1 := A_default_to_F ([1] +> (lead0 (s + 1) 1 +> (tailw g +> X))) + have h2 := xbRR_end ([0, 1] +> default) (lead0 (s + 1) 1 +> (tailw g +> X)) + have h3 := stop1 s 0 ([0, 0, 1] +> default) (tailw g +> X) + have h4 := xbLL_start default (lead1 s 0 +> (tailw g +> X)) + have h := stepStar_trans h1 (stepStar_trans h2 (stepStar_trans h3 h4)) + simpa [List.append_assoc] using h + +-- ============================================================================ +-- Closed-Form Batch Lemmas (`pairK`, `pair1`, `clK0`, `clK1`, `cl10`, `cl11`, `zLs`, `zEs`) +-- ============================================================================ + +theorem pairK : ∀ (q c j : ℕ) (r : List (ℕ × ℕ)) (a x : ℕ), + segRLs (q * 2) q + (uw ((q * 2 + c, j) :: r) false a (x + 1) (tailw 0)) + (uw ((c, j) :: r) false (q + a) (q + x + 1) (tailw 0)) + | 0, c, j, r, a, x => by simpa using segRLs_O _ + | q + 1, c, j, r, a, x => by + have h1 := stop1s (t_stop ((q * 2 + c + 2, j) :: r) a x (tailw 0) 0 ((q * 2 + c + 1, j) :: r) a rfl) + have h2 := (t_pass ((q * 2 + c + 1, j) :: r) a x 0 ((q * 2 + c, j) :: r) (a + 1) rfl).1 + have h3 := pairK q c j r (a + 1) (x + 1) + have h := segRLs_trans h1 (segRLs_trans h2 h3) + have ha : q + (a + 1) = q + 1 + a := by omega + have hx : q + (x + 1) + 1 = q + 1 + x + 1 := by omega + have hc : (q + 1) * 2 + c = q * 2 + c + 2 := by omega + have hq1 : 1 + (1 + q * 2) = (q + 1) * 2 := by omega + have hq2 : 0 + (1 + q) = q + 1 := by omega + rw [ha, hx, hq1, hq2] at h + rw [hc] + exact h + +theorem pair1 : ∀ (q a x : ℕ), + segRLs (q * 2) q + (uw [] false (q + a) (x + 1) (tailw 0)) + (uw [] false a (q + x + 1) (tailw 0)) + | 0, a, x => by simpa using segRLs_O _ + | q + 1, a, x => by + have h1 := stop1s (t_stop [] (q + a + 1) x (tailw 0) 0 [] (q + a) rfl) + have h2 := (t_pass [] (q + a) x 0 [] (q + a) rfl).1 + have h3 := pair1 q a (x + 1) + have h := segRLs_trans h1 (segRLs_trans h2 h3) + have ha : q + 1 + a = q + a + 1 := by omega + have hx : q + (x + 1) + 1 = q + 1 + x + 1 := by omega + have hq1 : 1 + (1 + q * 2) = (q + 1) * 2 := by omega + have hq2 : 0 + (1 + q) = q + 1 := by omega + rw [hx, hq1, hq2, ← ha] at h + exact h + +def b2n (b : Bool) : ℕ := if b then 1 else 0 + +theorem clK0 (q : ℕ) (rb : Bool) (c j : ℕ) (r : List (ℕ × ℕ)) (a x : ℕ) : + segRLs (q * 2 + b2n rb) q + (uw ((q * 2 + b2n rb + c, j) :: r) false a (x + 1) (tailw 0)) + (uw ((c, j) :: r) rb (q + a) (q + (x + 1) - b2n rb) (tailw 0)) := by + cases rb with + | false => + simpa [b2n, Nat.add_assoc] using pairK q c j r a x + | true => + have h1 := pairK q (c + 1) j r a x + have h2 := stop1s (t_stop ((c + 1, j) :: r) (q + a) (q + x) (tailw 0) 0 ((c, j) :: r) (q + a) rfl) + have h := segRLs_trans h1 h2 + have hc : q * 2 + 1 + c = q * 2 + (c + 1) := by omega + have hx : q + (x + 1) - 1 = q + x := by omega + simpa [b2n, hc, hx] using h + +theorem clK1 (q : ℕ) (rb : Bool) (c j : ℕ) (r : List (ℕ × ℕ)) (a x : ℕ) : + segRLs (q * 2 + b2n rb + 1) (q + 1) + (uw ((q * 2 + b2n rb + c + 1, j) :: r) true a x (tailw 0)) + (uw ((c, j) :: r) rb (q + (a + 1)) (q + (x + 2) - b2n rb) (tailw 0)) := by + have h1 := (t_pass ((q * 2 + b2n rb + c + 1, j) :: r) a x 0 ((q * 2 + b2n rb + c, j) :: r) (a + 1) rfl).1 + have h2 := clK0 q rb c j r (a + 1) (x + 1) + have h := segRLs_trans h1 h2 + have hn1 : 1 + (q * 2 + b2n rb) = q * 2 + b2n rb + 1 := by omega + have hn2 : 1 + q = q + 1 := by omega + rw [hn1, hn2] at h + exact h + +theorem cl10 (q : ℕ) (rb : Bool) (a x : ℕ) : + segRLs (q * 2 + b2n rb) q + (uw [] false (q + b2n rb + a) (x + 1) (tailw 0)) + (uw [] rb a (q + (x + 1) - b2n rb) (tailw 0)) := by + cases rb with + | false => + simpa [b2n, Nat.add_assoc] using pair1 q a x + | true => + have h1 := pair1 q (a + 1) x + have h2 := stop1s (t_stop [] (a + 1) (q + x) (tailw 0) 0 [] a rfl) + have h := segRLs_trans h1 h2 + have ha : q + 1 + a = q + (a + 1) := by omega + have hx : q + (x + 1) - 1 = q + x := by omega + simpa [b2n, ha, hx] using h + +theorem cl11 (q : ℕ) (rb : Bool) (a x : ℕ) : + segRLs (q * 2 + b2n rb + 1) (q + 1) + (uw [] true (q + b2n rb + a) x (tailw 0)) + (uw [] rb a (q + (x + 2) - b2n rb) (tailw 0)) := by + have h1 := (t_pass [] (q + b2n rb + a) x 0 [] (q + b2n rb + a) rfl).1 + have h2 := cl10 q rb a (x + 1) + have h := segRLs_trans h1 h2 + have hn1 : 1 + (q * 2 + b2n rb) = q * 2 + b2n rb + 1 := by omega + have hn2 : 1 + q = q + 1 := by omega + rw [hn1, hn2] at h + exact h + +theorem zLs : ∀ (m c j : ℕ) (r : List (ℕ × ℕ)) (x f : ℕ), + sideRLs m ((cw ((m + c, j) :: r) ++ edgew x f) +> default) + ((cw ((c, j) :: r) ++ edgew x (m + f)) +> default) + | 0, c, j, r, x, f => by simpa using .zero _ + | m + 1, c, j, r, x, f => by + have h1 := z_lead ((m + c + 1, j) :: r) x f 0 ((m + c, j) :: r) 0 (by simp) rfl + have h2 := zLs m c j r x (f + 1) + have hm1 : m + 1 + c = m + c + 1 := by omega + have hm2 : m + (f + 1) = m + 1 + f := by omega + rw [hm1] + rw [hm2] at h2 + exact .succ h1 h2 + +theorem zEs : ∀ (m y f : ℕ), + sideRLs m (edgew (m + y) f +> default) (edgew y (m + f) +> default) + | 0, y, f => by simpa using .zero _ + | m + 1, y, f => by + have h1 := z_empty (m + y) f + have h2 := zEs m y (f + 1) + have hm1 : m + 1 + y = m + y + 1 := by omega + have hm2 : m + (f + 1) = m + 1 + f := by omega + rw [hm1] + rw [hm2] at h2 + exact .succ h1 h2 + +-- ============================================================================ +-- Part 3: Symbolic Simulator & Soundness Proofs +-- ============================================================================ + +def strictNat {α : Type} (x : ℕ) (k : ℕ → α) : α := + Nat.casesOn (motive := fun _ => α) (Nat.add x 1) (k 0) k + +@[simp] theorem strictNat_eq {α : Type} (x : ℕ) (k : ℕ → α) : strictNat x k = k x := rfl + +def strictBool {α : Type} (b : Bool) (k : Bool → α) : α := + Bool.casesOn (motive := fun _ => α) b (k false) (k true) + +@[simp] theorem strictBool_eq {α : Type} (b : Bool) (k : Bool → α) : strictBool b k = k b := by + cases b <;> rfl + +inductive PairN where + | mk (c j : ℕ) + | dummy + +inductive BSQ where + | mk (front back : List PairN) + | dummy + +def revAux : List PairN → List PairN → List PairN + | [], acc => acc + | x :: xs, acc => revAux xs (x :: acc) + +def qNorm (front back : List PairN) : BSQ := + match front with + | [] => + match back with + | [] => .mk [] [] + | _ => .mk (revAux back []) [] + | _ => .mk front back + +def qPush1 (q : BSQ) (c j : ℕ) : BSQ := + match q with + | .mk [] _ => .mk [.mk c j] [] + | .mk front back => .mk front (.mk c j :: back) + | .dummy => .mk [.mk c j] [] + +def qPush2 (q : BSQ) (c1 j1 c2 j2 : ℕ) : BSQ := + qPush1 (qPush1 q c1 j1) c2 j2 + +def pairToProd : PairN → ℕ × ℕ + | .mk c j => (c, j) + | .dummy => (0, 0) + +def bsqToList : BSQ → List (ℕ × ℕ) + | .mk [] _ => [] + | .mk (p :: r) back => pairToProd p :: (r.map pairToProd ++ (revAux back []).map pairToProd) + | .dummy => [] + +theorem revAux_eq (xs acc : List PairN) : revAux xs acc = xs.reverse ++ acc := by + induction xs generalizing acc with + | nil => rfl + | cons x xs ih => + simp only [revAux, ih, List.reverse_cons, List.append_assoc, List.singleton_append] + +theorem bsqToList_qNorm (r back : List PairN) : + bsqToList (qNorm r back) = r.map pairToProd ++ (revAux back []).map pairToProd := by + cases r with + | cons p r' => rfl + | nil => + cases back with + | nil => rfl + | cons b bs => + try dsimp [qNorm] + have hne : revAux (b :: bs) [] ≠ [] := by + rw [revAux_eq] + simp + cases h : revAux (b :: bs) [] with + | nil => contradiction + | cons p' r' => simp [bsqToList, revAux] + +theorem bsqToList_qPush1 (q : BSQ) (c j : ℕ) : + bsqToList (qPush1 q c j) = bsqToList q ++ [(c, j)] := by + rcases q with ⟨_ | ⟨p, r⟩, back⟩ | _ + · rfl + · simp [qPush1, bsqToList, revAux_eq, pairToProd, List.append_assoc] + · rfl + +theorem bsqToList_qPush2 (q : BSQ) (c1 j1 c2 j2 : ℕ) : + bsqToList (qPush2 q c1 j1 c2 j2) = bsqToList q ++ [(c1, j1), (c2, j2)] := by + simp [qPush2, bsqToList_qPush1, List.append_assoc] + +inductive UnitN where + | mk (uq : BSQ) (ubit : Bool) (ua ux ug : ℕ) + | dummy + +def unitG : UnitN → ℕ + | .mk _ _ _ _ g => g + | .dummy => 1 + +def uwN : UnitN → List (Fin 2) + | .mk q b a x g => uw (bsqToList q) b a x (tailw g) + | .dummy => uw [] false 0 0 (tailw 0) + +inductive ZN where + | z0 (q : BSQ) (x f : ℕ) + | zd (q : BSQ) (b : Bool) (a x f : ℕ) + +def zside : ZN → ListBlank (Fin 2) + | .z0 q x f => (cw (bsqToList q) ++ edgew x f) +> default + | .zd q b a x f => uw (bsqToList q) b a x (edge1w f) +> default + +inductive TailN where + | tt (t g : ℕ) + | ntl (s g : ℕ) + +inductive SimCfg where + | mk (ctl : TailN) (cus : List UnitN) (cz : ZN) + | halt + +inductive ConRes where + | some (ov : ℕ) (q : BSQ) (a : ℕ) + | none + +def consumeN (q : BSQ) (a : ℕ) : ConRes := + match q with + | .mk (.mk c j :: r) back => + if Nat.beq c 0 then .some j (qNorm r back) a + else + strictNat (Nat.sub c 1) fun c1 => + .some 0 (.mk (.mk c1 j :: r) back) a + | .mk [] _ => + if Nat.beq a 0 then .none + else + strictNat (Nat.sub a 1) fun a1 => + .some 0 (.mk [] []) a1 + | _ => .none + +theorem consumeN_spec (q : BSQ) (a ov : ℕ) (q' : BSQ) (a' : ℕ) + (h : consumeN q a = .some ov q' a') : + consume (bsqToList q) a = some (ov, bsqToList q', a') := by + rcases q with ⟨_ | ⟨⟨_ | c, j⟩ | _, r⟩, back⟩ | _ + · try dsimp [consumeN] at h + cases a with + | zero => nomatch h + | succ a1 => + injection h with hov hq ha + subst hov hq ha + rfl + · try dsimp [consumeN] at h + injection h with hov hq ha + subst hov hq ha + rw [bsqToList_qNorm] + rfl + · try dsimp [consumeN] at h + injection h with hov hq ha + subst hov hq ha + rfl + · nomatch h + · nomatch h + +inductive TRes where + | tstop (ov : ℕ) (u : UnitN) + | tpass (ov : ℕ) (u : UnitN) + | thalt + | tfail + +def touchN (u : UnitN) : TRes := + match u with + | .mk q ubit ua ux ug => + if ubit then + if Nat.beq ug 0 then + strictNat (Nat.add ua 1) fun ua1 => + match consumeN q ua1 with + | .some ov q' a' => + strictNat (Nat.add ux 2) fun ux2 => + .tpass ov (.mk q' false a' ux2 0) + | .none => .tfail + else if Nat.beq ug 1 then + strictNat (Nat.add ux 1) fun ux1 => + match consumeN (qPush1 q ua 1) ux1 with + | .some ov q' a' => + .tpass ov (.mk q' false a' 1 0) + | .none => .tfail + else + strictNat (Nat.sub ug 1) fun ug1 => + match consumeN (qPush2 q ua 1 ux ug1) 0 with + | .some ov q' a' => + .tpass ov (.mk q' false a' 1 0) + | .none => .tfail + else + match q with + | .mk [] _ => + if Nat.beq ua 0 then .thalt + else if Nat.beq ux 0 then .tfail else + match consumeN q ua with + | .some ov q' a' => + strictNat (Nat.sub ux 1) fun ux1 => + .tstop ov (.mk q' true a' ux1 ug) + | .none => .tfail + | .mk (_ :: _) _ => + if Nat.beq ux 0 then .tfail else + match consumeN q ua with + | .some ov q' a' => + strictNat (Nat.sub ux 1) fun ux1 => + .tstop ov (.mk q' true a' ux1 ug) + | .none => .tfail + | .dummy => .tfail + | .dummy => .tfail + +theorem touchN_stop (u : UnitN) (ov : ℕ) (u' : UnitN) (h : touchN u = .tstop ov u') : + segRL B D (uwN u) ([1, 1, 1] ^ ov ++ uwN u') := by + rcases u with ⟨⟨front, back⟩ | _, _ | _, ua, _ | ux, ug⟩ | _ + · cases front with + | nil => cases ua <;> nomatch h + | cons p r => nomatch h + · cases front with + | nil => + cases ua with + | zero => nomatch h + | succ ua1 => + try dsimp [touchN] at h + cases hc : consumeN (.mk [] back) (ua1 + 1) with + | none => rw [hc] at h; nomatch h + | some o q' a' => + rw [hc] at h + injection h with hov hu' + subst hov hu' + exact t_stop (bsqToList (.mk [] back)) (ua1 + 1) ux (tailw ug) o (bsqToList q') a' (consumeN_spec _ _ _ _ _ hc) + | cons p r => + try dsimp [touchN] at h + cases hc : consumeN (.mk (p :: r) back) ua with + | none => rw [hc] at h; nomatch h + | some o q' a' => + rw [hc] at h + injection h with hov hu' + subst hov hu' + exact t_stop (bsqToList (.mk (p :: r) back)) ua ux (tailw ug) o (bsqToList q') a' (consumeN_spec _ _ _ _ _ hc) + · cases ug with + | zero => + try dsimp [touchN] at h + cases hc : consumeN (.mk front back) (ua + 1) <;> rw [hc] at h <;> nomatch h + | succ ug1 => + cases ug1 with + | zero => + try dsimp [touchN] at h + cases hc : consumeN (qPush1 (.mk front back) ua 1) 1 <;> rw [hc] at h <;> nomatch h + | succ ug2 => + try dsimp [touchN] at h + cases hc : consumeN (qPush2 (.mk front back) ua 1 0 (ug2 + 1)) 0 <;> rw [hc] at h <;> nomatch h + · cases ug with + | zero => + try dsimp [touchN] at h + cases hc : consumeN (.mk front back) (ua + 1) <;> rw [hc] at h <;> nomatch h + | succ ug1 => + cases ug1 with + | zero => + try dsimp [touchN] at h + cases hc : consumeN (qPush1 (.mk front back) ua 1) (ux + 2) <;> rw [hc] at h <;> nomatch h + | succ ug2 => + try dsimp [touchN] at h + cases hc : consumeN (qPush2 (.mk front back) ua 1 (ux + 1) (ug2 + 1)) 0 <;> rw [hc] at h <;> nomatch h + · nomatch h + · nomatch h + · cases ug with + | zero => + try dsimp [touchN] at h + cases hc : consumeN .dummy (ua + 1) <;> rw [hc] at h <;> nomatch h + | succ ug1 => + cases ug1 with + | zero => + try dsimp [touchN] at h + cases hc : consumeN (qPush1 .dummy ua 1) 1 <;> rw [hc] at h <;> nomatch h + | succ ug2 => + try dsimp [touchN] at h + cases hc : consumeN (qPush2 .dummy ua 1 0 (ug2 + 1)) 0 <;> rw [hc] at h <;> nomatch h + · cases ug with + | zero => + try dsimp [touchN] at h + cases hc : consumeN .dummy (ua + 1) <;> rw [hc] at h <;> nomatch h + | succ ug1 => + cases ug1 with + | zero => + try dsimp [touchN] at h + cases hc : consumeN (qPush1 .dummy ua 1) (ux + 2) <;> rw [hc] at h <;> nomatch h + | succ ug2 => + try dsimp [touchN] at h + cases hc : consumeN (qPush2 .dummy ua 1 (ux + 1) (ug2 + 1)) 0 <;> rw [hc] at h <;> nomatch h + · nomatch h + +theorem touchN_pass (u : UnitN) (ov : ℕ) (u' : UnitN) (h : touchN u = .tpass ov u') : + passRL (uwN u) ([1, 1, 1] ^ ov ++ uwN u') ∧ unitG u' = 0 := by + rcases u with ⟨q, _ | _, ua, ux, ug⟩ | _ + · rcases q with ⟨_ | ⟨p, r⟩, back⟩ | _ + · cases ua with + | zero => nomatch h + | succ ua1 => + cases ux with + | zero => nomatch h + | succ ux1 => + try dsimp [touchN] at h + cases hc : consumeN (.mk [] back) (ua1 + 1) <;> rw [hc] at h <;> nomatch h + · cases ux with + | zero => nomatch h + | succ ux1 => + try dsimp [touchN] at h + cases hc : consumeN (.mk (p :: r) back) ua <;> rw [hc] at h <;> nomatch h + · nomatch h + · rcases ug with _ | _ | ug + · try dsimp [touchN] at h + cases hc : consumeN q (ua + 1) with + | none => rw [hc] at h; nomatch h + | some o q' a' => + rw [hc] at h + injection h with hov hu' + subst hov hu' + exact ⟨t_pass (bsqToList q) ua ux o (bsqToList q') a' (consumeN_spec _ _ _ _ _ hc), rfl⟩ + · try dsimp [touchN] at h + cases hc : consumeN (qPush1 q ua 1) (ux + 1) with + | none => rw [hc] at h; nomatch h + | some o q' a' => + rw [hc] at h + injection h with hov hu' + subst hov hu' + have hspec := consumeN_spec _ _ _ _ _ hc + rw [bsqToList_qPush1] at hspec + exact ⟨t_ungl1 (bsqToList q) ua ux o (bsqToList q') a' hspec, rfl⟩ + · try dsimp [touchN] at h + cases hc : consumeN (qPush2 q ua 1 ux (ug + 1)) 0 with + | none => rw [hc] at h; nomatch h + | some o q' a' => + rw [hc] at h + injection h with hov hu' + subst hov hu' + have hspec := consumeN_spec _ _ _ _ _ hc + rw [bsqToList_qPush2] at hspec + exact ⟨t_ungl2 (bsqToList q) ua ux ug o (bsqToList q') a' hspec, rfl⟩ + · nomatch h + +theorem touchN_halt (u : UnitN) (h : touchN u = .thalt) (l r : ListBlank (Fin 2)) : + haltsFrom (l {{B}}> (uwN u +> r)) := by + rcases u with ⟨q, _ | _, ua, ux, ug⟩ | _ + · rcases q with ⟨_ | ⟨p, r'⟩, back⟩ | _ + · cases ua with + | zero => exact t_halt ux (tailw ug) l r + | succ ua1 => + cases ux with + | zero => nomatch h + | succ ux1 => + try dsimp [touchN] at h + cases hc : consumeN (.mk [] back) (ua1 + 1) <;> rw [hc] at h <;> nomatch h + · cases ux with + | zero => nomatch h + | succ ux1 => + try dsimp [touchN] at h + cases hc : consumeN (.mk (p :: r') back) ua <;> rw [hc] at h <;> nomatch h + · nomatch h + · cases ug with + | zero => + try dsimp [touchN] at h + cases hc : consumeN q (ua + 1) <;> rw [hc] at h <;> nomatch h + | succ ug1 => + cases ug1 with + | zero => + try dsimp [touchN] at h + cases hc : consumeN (qPush1 q ua 1) (ux + 1) <;> rw [hc] at h <;> nomatch h + | succ ug2 => + try dsimp [touchN] at h + cases hc : consumeN (qPush2 q ua 1 ux (ug2 + 1)) 0 <;> rw [hc] at h <;> nomatch h + · nomatch h + +inductive ZRes where + | zret (ov : ℕ) (z : ZN) + | zabs (f : ℕ) + | zfail + +def ztouch (z : ZN) : ZRes := + match z with + | .z0 (.mk [] _) y f => + if Nat.beq y 0 then (if Nat.beq f 0 then .zfail else .zabs f) + else + strictNat (Nat.sub y 1) fun y1 => + strictNat (Nat.add f 1) fun f1 => + .zret 0 (.z0 (.mk [] []) y1 f1) + | .z0 (.mk (p :: r) back) x f => + match consumeN (.mk (p :: r) back) 0 with + | .some ov q' _ => + strictNat (Nat.add f 1) fun f1 => + .zret ov (.z0 q' x f1) + | .none => .zfail + | .zd q false a x f => + if Nat.beq x 0 then .zfail else + match consumeN q a with + | .some ov q' a' => + strictNat (Nat.sub x 1) fun x1 => + .zret ov (.zd q' true a' x1 f) + | .none => .zfail + | .zd q true a x f => + match consumeN (qPush2 q a 1 x f) 0 with + | .some ov q' _ => .zret ov (.z0 q' 0 1) + | .none => .zfail + | _ => .zfail + +theorem ztouch_ret (z : ZN) (ov : ℕ) (z' : ZN) (h : ztouch z = .zret ov z') : + sideRL B D (zside z) ([1, 1, 1] ^ ov +> zside z') := by + rcases z with ⟨⟨_ | ⟨p, r⟩, back⟩ | _, x, f⟩ | ⟨q, _ | _, a, x, f⟩ + · cases x with + | zero => + cases f <;> nomatch h + | succ y1 => + try dsimp [ztouch] at h + injection h with hov hz' + subst hov hz' + simpa [zside, bsqToList, cw] using z_empty y1 f + · try dsimp [ztouch] at h + cases hc : consumeN (.mk (p :: r) back) 0 with + | none => rw [hc] at h; nomatch h + | some o q' a' => + rw [hc] at h + injection h with hov hz' + subst hov hz' + have hne : bsqToList (.mk (p :: r) back) ≠ [] := by simp [bsqToList] + have hz := z_lead (bsqToList (.mk (p :: r) back)) x f o (bsqToList q') a' hne (consumeN_spec _ _ _ _ _ hc) + simpa [zside] using hz + · nomatch h + · cases x with + | zero => nomatch h + | succ x1 => + try dsimp [ztouch] at h + cases hc : consumeN q a with + | none => rw [hc] at h; nomatch h + | some o q' a' => + rw [hc] at h + injection h with hov hz' + subst hov hz' + have hz := z_stop (bsqToList q) a x1 f o (bsqToList q') a' (consumeN_spec _ _ _ _ _ hc) + simpa [zside] using hz + · try dsimp [ztouch] at h + cases hc : consumeN (qPush2 q a 1 x f) 0 with + | none => rw [hc] at h; nomatch h + | some o q' a' => + rw [hc] at h + injection h with hov hz' + subst hov hz' + have hspec := consumeN_spec _ _ _ _ _ hc + rw [bsqToList_qPush2] at hspec + have hz := z_1111 (bsqToList q) a x f o (bsqToList q') a' hspec + simpa [zside] using hz + +theorem ztouch_abs (z : ZN) (f : ℕ) (h : ztouch z = .zabs f) : + sideRL B D (zside z) (([1, 1] ++ [1, 1, 1] ^ f) +> default) := by + rcases z with ⟨⟨_ | ⟨p, r⟩, back⟩ | _, x, f'⟩ | ⟨q, _ | _, a, x, f'⟩ + · cases x with + | zero => + cases f' with + | zero => nomatch h + | succ f1 => + try dsimp [ztouch] at h + injection h with hf + subst hf + simpa [zside, bsqToList, cw] using z_absorb f1 + | succ y1 => nomatch h + · try dsimp [ztouch] at h + cases hc : consumeN (.mk (p :: r) back) 0 <;> rw [hc] at h <;> nomatch h + · nomatch h + · cases x with + | zero => nomatch h + | succ x1 => + try dsimp [ztouch] at h + cases hc : consumeN q a <;> rw [hc] at h <;> nomatch h + · try dsimp [ztouch] at h + cases hc : consumeN (qPush2 q a 1 x f') 0 <;> rw [hc] at h <;> nomatch h + +inductive CRes where + | cret (ov : ℕ) (us : List UnitN) (z : ZN) + | chalt + | cfail + +def setg : UnitN → ℕ → UnitN + | .mk q bit a x _, g => .mk q bit a x g + | .dummy, _ => .dummy + +def callN (us : List UnitN) (z : ZN) : CRes := + match us with + | [] => + match ztouch z with + | .zret ov z' => .cret ov [] z' + | _ => .cfail + | u :: us1 => + match touchN u with + | .tstop ov u' => .cret ov (u' :: us1) z + | .thalt => .chalt + | .tfail => .cfail + | .tpass ov u' => + match us1 with + | [] => + match ztouch z with + | .zret ov2 z' => .cret ov [setg u' ov2] z' + | .zabs f => + match u' with + | .mk q bit a x g => + strictNat (Nat.add (Nat.add g f) 1) fun gf1 => + .cret ov [] (.zd q bit a x gf1) + | .dummy => .cfail + | .zfail => .cfail + | _ :: _ => + match callN us1 z with + | .cret ov2 us' z' => .cret ov (setg u' ov2 :: us') z' + | .chalt => .chalt + | .cfail => .cfail + +def dwords : List UnitN → List (Fin 2) + | [] => [] + | u :: us => uwN u ++ dwords us + +theorem setg_word (u : UnitN) (g : ℕ) (hg : unitG u = 0) : + uwN u ++ [1, 1, 1] ^ g = uwN (setg u g) := by + rcases u with ⟨q, bit, a, x, _ | g0⟩ | _ + · simp [uwN, setg, uw, tailw, List.append_assoc] + · nomatch hg + · nomatch hg + +theorem abs_word (q : BSQ) (bit : Bool) (a x g f : ℕ) (hg : g = 0) : + uwN (.mk q bit a x g) ++ ([1, 1] ++ [1, 1, 1] ^ f) = + uw (bsqToList q) bit a x (edge1w (g + f + 1)) := by + subst hg + simp [uwN, uw, tailw, edge1w, pow_succ_list, List.append_assoc] + +theorem callN_ret : ∀ (us : List UnitN) (z : ZN) (ov : ℕ) (us' : List UnitN) (z' : ZN), + callN us z = .cret ov us' z' → + sideRL B D (dwords us +> zside z) (([1, 1, 1] ^ ov ++ dwords us') +> zside z') + | [], z, ov, us', z', h => by + try dsimp [callN] at h + cases hz : ztouch z with + | zret o z1 => + rw [hz] at h + injection h with hov hus hz' + subst hov hus hz' + simpa [dwords] using ztouch_ret z o z1 hz + | zabs _ => rw [hz] at h; nomatch h + | zfail => rw [hz] at h; nomatch h + | u :: us1, z, ov, us', z', h => by + try dsimp [callN] at h + cases ht : touchN u with + | tstop o u1 => + rw [ht] at h + injection h with hov hus hz' + subst hov hus hz' + have hs := segRL_side (dwords us1 +> zside z) (touchN_stop u o u1 ht) + simpa [dwords, List.append_assoc] using hs + | thalt => rw [ht] at h; nomatch h + | tfail => rw [ht] at h; nomatch h + | tpass o u1 => + rw [ht] at h + rcases touchN_pass u o u1 ht with ⟨hp, hg⟩ + cases us1 with + | nil => + cases hz : ztouch z with + | zret o2 z1 => + rw [hz] at h + injection h with hov hus hz' + subst hov hus hz' + have hs := side1 hp.1 (ztouch_ret z o2 z1 hz) + rw [← listblank_append_assoc, List.append_assoc, setg_word u1 o2 hg] at hs + simpa [dwords, List.append_assoc] using hs + | zabs f => + rw [hz] at h + rcases u1 with ⟨q, bit, a, x, g⟩ | _ + · try dsimp at h + injection h with hov hus hz' + subst hov hus hz' + have hs := side1 hp.1 (ztouch_abs z f hz) + rw [← listblank_append_assoc, List.append_assoc, abs_word q bit a x g f hg] at hs + simpa [dwords, zside, List.append_assoc] using hs + · nomatch h + | zfail => rw [hz] at h; nomatch h + | cons v us2 => + cases hc : callN (v :: us2) z with + | cret o2 us3 z1 => + rw [hc] at h + injection h with hov hus hz' + subst hov hus hz' + have ih := callN_ret (v :: us2) z o2 us3 z1 hc + have hs := side1 hp.1 ih + simpa [dwords, ← setg_word u1 o2 hg] using hs + | chalt => rw [hc] at h; nomatch h + | cfail => rw [hc] at h; nomatch h + +theorem callN_halt : ∀ (us : List UnitN) (z : ZN), + callN us z = .chalt → sideRL_halt (dwords us +> zside z) + | [], z, h => by + try dsimp [callN] at h + cases hz : ztouch z <;> rw [hz] at h <;> nomatch h + | u :: us1, z, h => by + try dsimp [callN] at h + cases ht : touchN u with + | tstop _ _ => rw [ht] at h; nomatch h + | tfail => rw [ht] at h; nomatch h + | thalt => + intro l + simpa [dwords] using touchN_halt u ht l (dwords us1 +> zside z) + | tpass o u1 => + rw [ht] at h + rcases touchN_pass u o u1 ht with ⟨hp, _⟩ + cases us1 with + | nil => + cases hz : ztouch z <;> cases u1 <;> rw [hz] at h <;> nomatch h + | cons v us2 => + cases hc : callN (v :: us2) z with + | cret _ _ _ => rw [hc] at h; nomatch h + | cfail => rw [hc] at h; nomatch h + | chalt => + have ih := callN_halt (v :: us2) z hc + simpa [dwords] using hp.2 (dwords (v :: us2) +> zside z) ih + +def inc1 (c : SimCfg) : SimCfg := + match c with + | .mk (.tt t g) us z => + if Nat.beq g 0 then + match callN us z with + | .cret ov us' z' => + strictNat (Nat.add t 1) fun t' => + .mk (.tt t' ov) us' z' + | .chalt => .halt + | .cfail => c + else if Nat.beq g 1 then + match callN us z with + | .cret ov us' z' => + strictNat (Nat.add t 1) fun t' => + .mk (.ntl t' ov) us' z' + | .chalt => .halt + | .cfail => c + else c + | .mk (.ntl s g) us z => + if Nat.beq s 0 then c + else + strictNat (Nat.sub s 1) fun s1 => + .mk (.tt 0 0) (.mk (.mk [] []) true s1 0 g :: us) z + | .halt => .halt + +def denoteCfg : TailN → List UnitN → ZN → Cfg (Fin 2) (Fin 6) + | .tt t g, us, z => root t (([1, 1, 1] ^ g ++ dwords us) +> zside z) + | .ntl s g, us, z => NT s g (dwords us +> zside z) + +def simCfgHalt : SimCfg → Prop + | .halt => True + | .mk tl us z => haltsFrom (denoteCfg tl us z) + +theorem inc1_sound (c : SimCfg) (h : simCfgHalt (inc1 c)) : simCfgHalt c := by + rcases c with ⟨⟨t, _ | _ | g⟩ | ⟨_ | s1, g⟩, us, z⟩ | _ + · try dsimp [inc1] at h + cases hc : callN us z with + | cret ov us' z' => + rw [hc] at h + have hstep := root_step t (dwords us +> zside z) (([1, 1, 1] ^ ov ++ dwords us') +> zside z') (callN_ret us z ov us' z' hc) + exact haltsFrom_stepStar hstep h + | chalt => + exact root_halt t (dwords us +> zside z) (callN_halt us z hc) + | cfail => + rw [hc] at h + exact h + · try dsimp [inc1] at h + cases hc : callN us z with + | cret ov us' z' => + rw [hc] at h + have hstep := reset1 t (dwords us +> zside z) (([1, 1, 1] ^ ov ++ dwords us') +> zside z') (callN_ret us z ov us' z' hc) + have hstep' : (denoteCfg (.tt t 1) us z) [tm_coq]⊢* (denoteCfg (.ntl (t + 1) ov) us' z') := by + simpa [denoteCfg, NT, tailw, List.append_assoc] using hstep + exact haltsFrom_stepStar hstep' h + | chalt => + have hhalt := reset1_halt t (dwords us +> zside z) (callN_halt us z hc) + simpa [simCfgHalt, denoteCfg] using hhalt + | cfail => + rw [hc] at h + exact h + · exact h + · exact h + · try dsimp [inc1] at h + have hstep := reset2 s1 g (dwords us +> zside z) + have hstep' : (denoteCfg (.ntl (s1 + 1) g) us z) [tm_coq]⊢* + (denoteCfg (.tt 0 0) (.mk (.mk [] []) true s1 0 g :: us) z) := by + simpa [denoteCfg, dwords, uwN, uw, bsqToList, cw, leadw, List.append_assoc] using hstep + exact haltsFrom_stepStar hstep' h + · exact True.intro + +def nodd (n : ℕ) : Bool := Nat.beq (Nat.mod n 2) 1 +def ndiv2 (n : ℕ) : ℕ := Nat.div n 2 +def nlt (a b : ℕ) : Bool := Nat.ble (Nat.add a 1) b + +theorem ndiv2_nodd (n : ℕ) : ndiv2 n * 2 + b2n (nodd n) = n := by + change (n / 2) * 2 + b2n (Nat.beq (n % 2) 1) = n + rcases Nat.mod_two_eq_zero_or_one n with h | h <;> simp [h, b2n] <;> omega + +theorem nlt_false_iff (a b : ℕ) : nlt a b = false ↔ b ≤ a := by + change Nat.ble (a + 1) b = false ↔ b ≤ a + rw [← Bool.not_eq_true, Nat.ble_eq] + omega + +inductive CResU where + | some (u : UnitN) (p : ℕ) + | none + +def closedU (n : ℕ) (u : UnitN) : CResU := + if Nat.beq n 0 then .some u 0 else + match u with + | .mk (.mk (.mk c j :: r) back) ubit ua ux ug => + if !ubit then + if Nat.beq n 1 then + if Nat.beq ux 0 || Nat.beq c 0 then .none + else + strictNat (Nat.sub c 1) fun c1 => + strictNat (Nat.sub ux 1) fun ux1 => + .some (.mk (.mk (.mk c1 j :: r) back) true ua ux1 ug) 0 + else + if !(Nat.beq ug 0) || Nat.beq ux 0 || nlt c n then .none + else + strictBool (nodd n) fun rb => + strictNat (ndiv2 n) fun q => + strictNat (Nat.sub c n) fun cn => + strictNat (Nat.add q ua) fun a' => + strictNat (Nat.sub (Nat.add q ux) (b2n rb)) fun x' => + .some (.mk (.mk (.mk cn j :: r) back) rb a' x' 0) q + else + if !(Nat.beq ug 0) || nlt c n then .none + else + strictNat (Nat.sub n 1) fun n1 => + strictBool (nodd n1) fun rb => + strictNat (ndiv2 n1) fun q => + strictNat (Nat.add q 1) fun q1 => + strictNat (Nat.sub c n) fun cn => + strictNat (Nat.add q (Nat.add ua 1)) fun a' => + strictNat (Nat.sub (Nat.add q (Nat.add ux 2)) (b2n rb)) fun x' => + .some (.mk (.mk (.mk cn j :: r) back) rb a' x' 0) q1 + | .mk (.mk [] _) ubit ua ux ug => + if !ubit then + if Nat.beq n 1 then + if Nat.beq ux 0 || Nat.beq ua 0 then .none + else + strictNat (Nat.sub ua 1) fun ua1 => + strictNat (Nat.sub ux 1) fun ux1 => + .some (.mk (.mk [] []) true ua1 ux1 ug) 0 + else + strictBool (nodd n) fun rb => + strictNat (ndiv2 n) fun q => + if !(Nat.beq ug 0) || Nat.beq ux 0 || nlt ua (Nat.add q (b2n rb)) then .none + else + strictNat (Nat.sub (Nat.sub ua q) (b2n rb)) fun a' => + strictNat (Nat.sub (Nat.add q ux) (b2n rb)) fun x' => + .some (.mk (.mk [] []) rb a' x' 0) q + else + strictNat (Nat.sub n 1) fun n1 => + strictBool (nodd n1) fun rb => + strictNat (ndiv2 n1) fun q => + strictNat (Nat.add q 1) fun q1 => + if !(Nat.beq ug 0) || nlt ua (Nat.add q (b2n rb)) then .none + else + strictNat (Nat.sub (Nat.sub ua q) (b2n rb)) fun a' => + strictNat (Nat.sub (Nat.add q (Nat.add ux 2)) (b2n rb)) fun x' => + .some (.mk (.mk [] []) rb a' x' 0) q1 + | _ => .none + +theorem closedU_spec (n : ℕ) (u u' : UnitN) (p : ℕ) (h : closedU n u = .some u' p) : + segRLs n p (uwN u) (uwN u') := by + unfold closedU at h + cases hn0 : Nat.beq n 0 with + | true => + rw [hn0] at h + injection h with hu hp + subst hu hp + have hn : n = 0 := Nat.beq_eq.mp hn0 + subst hn + exact segRLs_O (uwN u) + | false => + rw [hn0] at h + dsimp at h + have hn : n ≠ 0 := by intro h0; subst h0; nomatch hn0 + rcases u with ⟨⟨_ | ⟨⟨c, j⟩ | _, r⟩, back⟩ | _, _ | _, ua, ux, ug⟩ | _ + · -- front = [], ubit = false + simp only [strictBool_eq, strictNat_eq] at h + try dsimp at h + cases hn1 : Nat.beq n 1 with + | true => + rw [hn1] at h + have hn_eq : n = 1 := Nat.beq_eq.mp hn1 + subst hn_eq + cases ux with + | zero => nomatch h + | succ ux1 => + cases ua with + | zero => nomatch h + | succ ua1 => + try dsimp at h + injection h with hu hp + subst hu hp + simpa [uwN, bsqToList] using stop1s (t_stop [] (ua1 + 1) ux1 (tailw ug) 0 [] ua1 rfl) + | false => + rw [hn1] at h + try dsimp at h + cases hug : Nat.beq ug 0 with + | false => rw [hug] at h; nomatch h + | true => + have hug_eq : ug = 0 := Nat.beq_eq.mp hug + subst hug_eq + cases ux with + | zero => nomatch h + | succ ux1 => + cases hlt : nlt ua (ndiv2 n + b2n (nodd n)) with + | true => simp only [hlt] at h; nomatch h + | false => + simp only [hlt] at h + try dsimp at h + injection h with hu hp + subst hu hp + have hle : ndiv2 n + b2n (nodd n) ≤ ua := (nlt_false_iff _ _).mp hlt + have hcl := cl10 (ndiv2 n) (nodd n) (ua - ndiv2 n - b2n (nodd n)) ux1 + have hn_eq := ndiv2_nodd n + have hua : ndiv2 n + b2n (nodd n) + (ua - ndiv2 n - b2n (nodd n)) = ua := by omega + rw [hn_eq, hua] at hcl + simpa [uwN, bsqToList] using hcl + · -- front = [], ubit = true + simp only [strictBool_eq, strictNat_eq] at h + try dsimp at h + cases hug : Nat.beq ug 0 with + | false => rw [hug] at h; nomatch h + | true => + have hug_eq : ug = 0 := Nat.beq_eq.mp hug + subst hug_eq + cases hlt : nlt ua (ndiv2 (n - 1) + b2n (nodd (n - 1))) with + | true => simp only [hlt] at h; nomatch h + | false => + simp only [hlt] at h + try dsimp at h + injection h with hu hp + subst hu hp + have hle : ndiv2 (n - 1) + b2n (nodd (n - 1)) ≤ ua := (nlt_false_iff _ _).mp hlt + have hcl := cl11 (ndiv2 (n - 1)) (nodd (n - 1)) (ua - ndiv2 (n - 1) - b2n (nodd (n - 1))) ux + have hn1_eq := ndiv2_nodd (n - 1) + have hn_eq : ndiv2 (n - 1) * 2 + b2n (nodd (n - 1)) + 1 = n := by omega + have hua : ndiv2 (n - 1) + b2n (nodd (n - 1)) + (ua - ndiv2 (n - 1) - b2n (nodd (n - 1))) = ua := by omega + rw [hn_eq, hua] at hcl + simpa [uwN, bsqToList] using hcl + · -- front = (c, j) :: r, ubit = false + simp only [strictBool_eq, strictNat_eq] at h + try dsimp at h + cases hn1 : Nat.beq n 1 with + | true => + rw [hn1] at h + have hn_eq : n = 1 := Nat.beq_eq.mp hn1 + subst hn_eq + cases ux with + | zero => nomatch h + | succ ux1 => + cases c with + | zero => nomatch h + | succ c1 => + try dsimp at h + injection h with hu hp + subst hu hp + let r' := r.map pairToProd ++ (revAux back []).map pairToProd + simpa [uwN, bsqToList, pairToProd] using stop1s (t_stop ((c1 + 1, j) :: r') ua ux1 (tailw ug) 0 ((c1, j) :: r') ua rfl) + | false => + rw [hn1] at h + try dsimp at h + cases hug : Nat.beq ug 0 with + | false => rw [hug] at h; nomatch h + | true => + have hug_eq : ug = 0 := Nat.beq_eq.mp hug + subst hug_eq + cases ux with + | zero => nomatch h + | succ ux1 => + cases hlt : nlt c n with + | true => rw [hlt] at h; nomatch h + | false => + rw [hlt] at h + try dsimp at h + injection h with hu hp + subst hu hp + have hle : n ≤ c := (nlt_false_iff _ _).mp hlt + let r' := r.map pairToProd ++ (revAux back []).map pairToProd + have hcl := clK0 (ndiv2 n) (nodd n) (c - n) j r' ua ux1 + have hn_eq := ndiv2_nodd n + have hc_eq : ndiv2 n * 2 + b2n (nodd n) + (c - n) = c := by omega + rw [hc_eq, hn_eq] at hcl + simpa [uwN, bsqToList, pairToProd] using hcl + · -- front = (c, j) :: r, ubit = true + simp only [strictBool_eq, strictNat_eq] at h + try dsimp at h + cases hug : Nat.beq ug 0 with + | false => rw [hug] at h; nomatch h + | true => + have hug_eq : ug = 0 := Nat.beq_eq.mp hug + subst hug_eq + cases hlt : nlt c n with + | true => rw [hlt] at h; nomatch h + | false => + rw [hlt] at h + try dsimp at h + injection h with hu hp + subst hu hp + have hle : n ≤ c := (nlt_false_iff _ _).mp hlt + let r' := r.map pairToProd ++ (revAux back []).map pairToProd + have hcl := clK1 (ndiv2 (n - 1)) (nodd (n - 1)) (c - n) j r' ua ux + have hn1_eq := ndiv2_nodd (n - 1) + have hn_eq : ndiv2 (n - 1) * 2 + b2n (nodd (n - 1)) + 1 = n := by omega + have hc_eq : ndiv2 (n - 1) * 2 + b2n (nodd (n - 1)) + (c - n) + 1 = c := by omega + rw [hc_eq, hn_eq] at hcl + simpa [uwN, bsqToList, pairToProd] using hcl + · nomatch h + · nomatch h + · nomatch h + · nomatch h + · nomatch h + +def closedZ (m : ℕ) (z : ZN) : Option ZN := + if Nat.beq m 0 then some z else + match z with + | .z0 (.mk [] _) y f => + if nlt y m then none + else + strictNat (Nat.sub y m) fun ym => + strictNat (Nat.add f m) fun fm => + some (.z0 (.mk [] []) ym fm) + | .z0 (.mk (.mk c j :: r) back) x f => + if nlt c m then none + else + strictNat (Nat.sub c m) fun cm => + strictNat (Nat.add f m) fun fm => + some (.z0 (.mk (.mk cm j :: r) back) x fm) + | _ => none + +theorem closedZ_spec (m : ℕ) (z z' : ZN) (h : closedZ m z = some z') : + sideRLs m (zside z) (zside z') := by + unfold closedZ at h + cases hm0 : Nat.beq m 0 with + | true => + rw [hm0] at h + injection h with hz + subst hz + have hm : m = 0 := Nat.beq_eq.mp hm0 + subst hm + exact .zero (zside z) + | false => + rw [hm0] at h + rcases z with ⟨⟨_ | ⟨⟨c, j⟩ | _, r⟩, back⟩ | _, x, f⟩ | ⟨_, _, _, _, _⟩ + · dsimp [strictNat] at h + cases hlt : nlt x m with + | true => rw [hlt] at h; nomatch h + | false => + rw [hlt] at h + dsimp [strictNat] at h + injection h with hz + subst hz + have hle : m ≤ x := (nlt_false_iff _ _).mp hlt + have hz := zEs m (x - m) f + have hx : m + (x - m) = x := by omega + have hf : m + f = f + m := by omega + rw [hx, hf] at hz + simpa [zside, bsqToList, cw] using hz + · dsimp [strictNat] at h + cases hlt : nlt c m with + | true => rw [hlt] at h; nomatch h + | false => + rw [hlt] at h + dsimp [strictNat] at h + injection h with hz + subst hz + have hle : m ≤ c := (nlt_false_iff _ _).mp hlt + let r' := r.map pairToProd ++ (revAux back []).map pairToProd + have hz := zLs m (c - m) j r' x f + have hc : m + (c - m) = c := by omega + have hf : m + f = f + m := by omega + rw [hc, hf] at hz + simpa [zside, bsqToList, pairToProd] using hz + · nomatch h + · nomatch h + · nomatch h + +inductive BRes where + | some (us : List UnitN) (z : ZN) + | none + +def batchL (n : ℕ) (us : List UnitN) (z : ZN) : BRes := + if Nat.beq n 0 then .some us z else + match us with + | [] => + match closedZ n z with + | some z' => .some [] z' + | none => .none + | u :: us => + match closedU n u with + | .some u' p => + if Nat.beq p 0 then .some (u' :: us) z + else + match batchL p us z with + | .some us' z' => .some (u' :: us') z' + | .none => .none + | .none => .none + +theorem batchL_spec : ∀ (us : List UnitN) (n : ℕ) (z : ZN) (us' : List UnitN) (z' : ZN), + batchL n us z = .some us' z' → + sideRLs n (dwords us +> zside z) (dwords us' +> zside z') + | [], n, z, us', z', h => by + unfold batchL at h + cases hn0 : Nat.beq n 0 with + | true => + rw [hn0] at h + injection h with hus hz + subst hus hz + have hn : n = 0 := Nat.beq_eq.mp hn0 + subst hn + exact .zero _ + | false => + rw [hn0] at h + try dsimp at h + cases hz : closedZ n z with + | none => rw [hz] at h; nomatch h + | some z1 => + rw [hz] at h + injection h with hus hz' + subst hus hz' + simpa [dwords] using closedZ_spec n z z1 hz + | u :: us, n, z, us', z', h => by + unfold batchL at h + cases hn0 : Nat.beq n 0 with + | true => + rw [hn0] at h + injection h with hus hz + subst hus hz + have hn : n = 0 := Nat.beq_eq.mp hn0 + subst hn + exact .zero _ + | false => + rw [hn0] at h + try dsimp at h + cases hu : closedU n u with + | none => rw [hu] at h; nomatch h + | some u1 p => + rw [hu] at h + try dsimp at h + have hseg := closedU_spec n u u1 p hu + cases hp0 : Nat.beq p 0 with + | true => + rw [hp0] at h + injection h with hus hz + subst hus hz + have hp : p = 0 := Nat.beq_eq.mp hp0 + subst hp + simpa [dwords] using hseg (dwords us +> zside z) (dwords us +> zside z) (.zero _) + | false => + rw [hp0] at h + cases hb : batchL p us z with + | none => rw [hb] at h; nomatch h + | some us1 z1 => + rw [hb] at h + injection h with hus hz + subst hus hz + have ih := batchL_spec us p z us1 z1 hb + simpa [dwords] using hseg (dwords us +> zside z) (dwords us1 +> zside z1) ih + +inductive Cmd where + | nil + | b (d : ℕ) (next : Cmd) + | c (next : Cmd) + | bc (d : ℕ) (next : Cmd) + | l (n : ℕ) (sub : Cmd) (next : Cmd) + +inductive HRes where + | some (n : ℕ) (us : List UnitN) (z : ZN) + | none + +def evalCmds : Cmd → List UnitN → ZN → ℕ → HRes + | .nil, us, z, acc => .some acc us z + | .b d next, us, z, acc => + match batchL d us z with + | .some us' z' => + strictNat (Nat.add acc d) fun acc' => + evalCmds next us' z' acc' + | .none => .none + | .c next, us, z, acc => + match callN us z with + | .cret ov us' z' => + if Nat.beq ov 0 then + strictNat (Nat.add acc 1) fun acc' => + evalCmds next us' z' acc' + else .none + | _ => .none + | .bc d next, us, z, acc => + match batchL d us z with + | .some us1 z1 => + match callN us1 z1 with + | .cret ov us' z' => + if Nat.beq ov 0 then + strictNat (Nat.add acc (Nat.add d 1)) fun acc' => + evalCmds next us' z' acc' + else .none + | _ => .none + | .none => .none + | .l n sub next, us, z, acc => + match us with + | [] => .none + | u :: us1 => + match closedU n u with + | .some u' p => + match evalCmds sub us1 z 0 with + | .some p' us1' z' => + if Nat.beq p p' then + strictNat (Nat.add acc n) fun acc' => + evalCmds next (u' :: us1') z' acc' + else .none + | .none => .none + | .none => .none + +theorem evalCmds_spec : ∀ (cmd : Cmd) (us : List UnitN) (z : ZN) (acc tot : ℕ) (us' : List UnitN) (z' : ZN) (R₀ : ListBlank (Fin 2)), + sideRLs acc R₀ (dwords us +> zside z) → + evalCmds cmd us z acc = .some tot us' z' → + sideRLs tot R₀ (dwords us' +> zside z') + | .nil, us, z, acc, tot, us', z', R₀, h₀, h => by + try dsimp [evalCmds] at h + injection h with htot hus hz + subst htot hus hz + exact h₀ + | .b d next, us, z, acc, tot, us', z', R₀, h₀, h => by + try dsimp [evalCmds] at h + cases hb : batchL d us z with + | none => rw [hb] at h; nomatch h + | some us1 z1 => + rw [hb] at h + have h1 := batchL_spec us d z us1 z1 hb + exact evalCmds_spec next us1 z1 (acc + d) tot us' z' R₀ (sideRLs_append h₀ h1) h + | .c next, us, z, acc, tot, us', z', R₀, h₀, h => by + try dsimp [evalCmds] at h + cases hc : callN us z with + | chalt => rw [hc] at h; nomatch h + | cfail => rw [hc] at h; nomatch h + | cret ov us1 z1 => + rw [hc] at h + try dsimp at h + cases hov : Nat.beq ov 0 with + | false => rw [hov] at h; nomatch h + | true => + rw [hov] at h + have hov_eq : ov = 0 := Nat.beq_eq.mp hov + subst hov_eq + have hstep : sideRL B D (dwords us +> zside z) (dwords us1 +> zside z1) := by + simpa using callN_ret us z 0 us1 z1 hc + have h1 : sideRLs 1 (dwords us +> zside z) (dwords us1 +> zside z1) := .succ hstep (.zero _) + exact evalCmds_spec next us1 z1 (acc + 1) tot us' z' R₀ (sideRLs_append h₀ h1) h + | .bc d next, us, z, acc, tot, us', z', R₀, h₀, h => by + try dsimp [evalCmds] at h + cases hb : batchL d us z with + | none => rw [hb] at h; nomatch h + | some us1 z1 => + rw [hb] at h + try dsimp at h + cases hc : callN us1 z1 with + | chalt => rw [hc] at h; nomatch h + | cfail => rw [hc] at h; nomatch h + | cret ov us2 z2 => + rw [hc] at h + try dsimp at h + cases hov : Nat.beq ov 0 with + | false => rw [hov] at h; nomatch h + | true => + rw [hov] at h + have hov_eq : ov = 0 := Nat.beq_eq.mp hov + subst hov_eq + have h1 := batchL_spec us d z us1 z1 hb + have hstep : sideRL B D (dwords us1 +> zside z1) (dwords us2 +> zside z2) := by + simpa using callN_ret us1 z1 0 us2 z2 hc + have h2 : sideRLs 1 (dwords us1 +> zside z1) (dwords us2 +> zside z2) := .succ hstep (.zero _) + exact evalCmds_spec next us2 z2 (acc + (d + 1)) tot us' z' R₀ (sideRLs_append h₀ (sideRLs_append h1 h2)) h + | .l n sub next, [], z, acc, tot, us', z', R₀, _, h => nomatch h + | .l n sub next, u :: us1, z, acc, tot, us', z', R₀, h₀, h => by + try dsimp [evalCmds] at h + cases hu : closedU n u with + | none => rw [hu] at h; nomatch h + | some u1 p => + rw [hu] at h + try dsimp at h + cases hsub : evalCmds sub us1 z 0 with + | none => rw [hsub] at h; nomatch h + | some p' us1' z1 => + rw [hsub] at h + try dsimp at h + cases hp : Nat.beq p p' with + | false => rw [hp] at h; nomatch h + | true => + rw [hp] at h + have hp_eq : p = p' := Nat.beq_eq.mp hp + subst hp_eq + have hs_sub := evalCmds_spec sub us1 z 0 p us1' z1 (dwords us1 +> zside z) (.zero _) hsub + have hseg := closedU_spec n u u1 p hu + have hl : sideRLs n (dwords (u :: us1) +> zside z) (dwords (u1 :: us1') +> zside z1) := by + simpa [dwords] using hseg (dwords us1 +> zside z) (dwords us1' +> zside z1) hs_sub + exact evalCmds_spec next (u1 :: us1') z1 (acc + n) tot us' z' R₀ (sideRLs_append h₀ hl) h + +def runHier (cmd : Cmd) (c : SimCfg) : SimCfg := + match c with + | .mk (.tt t g) us z => + if Nat.beq g 0 then + match evalCmds cmd us z 0 with + | .some n us' z' => + strictNat (Nat.add t n) fun tn => + .mk (.tt tn 0) us' z' + | .none => c + else c + | _ => c + +theorem runHier_sound (cmd : Cmd) (c : SimCfg) (h : simCfgHalt (runHier cmd c)) : simCfgHalt c := by + rcases c with ⟨⟨t, _ | g⟩ | ⟨s, g⟩, us, z⟩ | _ + · try dsimp [runHier] at h + cases he : evalCmds cmd us z 0 with + | none => rw [he] at h; exact h + | some n us' z' => + rw [he] at h + have hs := evalCmds_spec cmd us z 0 n us' z' (dwords us +> zside z) (.zero _) he + have hstep := root_steps n t (dwords us +> zside z) (dwords us' +> zside z') hs + have htn : n + t = t + n := by omega + rw [htn] at hstep + exact haltsFrom_stepStar hstep h + · exact h + · exact h + · exact True.intro + +inductive Prog where + | nil + | inc (next : Prog) + | hier (cmd : Cmd) (next : Prog) + +def evalProg : Prog → SimCfg → SimCfg + | .nil, c => c + | .inc next, c => + match inc1 c with + | .mk ctl cus cz => evalProg next (.mk ctl cus cz) + | .halt => .halt + | .hier cmd next, c => + match runHier cmd c with + | .mk ctl cus cz => evalProg next (.mk ctl cus cz) + | .halt => .halt + +theorem evalProg_sound : ∀ (p : Prog) (c : SimCfg), simCfgHalt (evalProg p c) → simCfgHalt c + | .nil, c, h => h + | .inc next, c, h => by + try dsimp [evalProg] at h + cases hi : inc1 c with + | halt => + apply inc1_sound c + rw [hi] + exact True.intro + | mk ctl cus cz => + rw [hi] at h + have ih := evalProg_sound next (.mk ctl cus cz) h + apply inc1_sound c + rw [hi] + exact ih + | .hier cmd next, c, h => by + try dsimp [evalProg] at h + cases hr : runHier cmd c with + | halt => + apply runHier_sound cmd c + rw [hr] + exact True.intro + | mk ctl cus cz => + rw [hr] at h + have ih := evalProg_sound next (.mk ctl cus cz) h + apply runHier_sound cmd c + rw [hr] + exact ih + +def isHaltCfg : SimCfg → Bool + | .halt => true + | .mk _ _ _ => false + +theorem simCfgHalt_of_isHaltCfg (c : SimCfg) (h : isHaltCfg c = true) : simCfgHalt c := by + cases c with + | halt => exact True.intro + | mk _ _ _ => nomatch h + +theorem evalProg_halt_sound (p : Prog) (c : SimCfg) (h : isHaltCfg (evalProg p c) = true) : + simCfgHalt c := + evalProg_sound p c (simCfgHalt_of_isHaltCfg (evalProg p c) h) + +def c342 : SimCfg := (.mk (.ntl 1 1) [] (.z0 (.mk [.mk 0 3] []) 0 1)) + +theorem bmultiStep_star (n : ℕ) (c c' : DCfg) (h : bmultiStep n c = some c') : + (evalDCfg default default c) [tm_coq]⊢* (evalDCfg default default c') := + ⟨n, bmultiStep_sound n c c' h⟩ + +theorem c342_denote_eq : + evalDCfg default default ⟨A, .left, [], [1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1]⟩ = + denoteCfg (.ntl 1 1) [] (.z0 (.mk [.mk 0 3] []) 0 1) := by + try dsimp [evalDCfg, denoteCfg, NT, dwords, zside] + rw [← listblank_append_assoc] + rfl + +theorem init_to_c342 : (init []) [tm_coq]⊢* denoteCfg (.ntl 1 1) [] (.z0 (.mk [.mk 0 3] []) 0 1) := by + rw [← c342_denote_eq] + have h0 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨E, .right, [1, 0, 1], []⟩) := + bmultiStep_star 6 ⟨A, .left, [], []⟩ ⟨E, .right, [1, 0, 1], []⟩ rfl + have h1 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨B, .left, [], [1, 1, 0, 1, 1, 1]⟩) := + stepStar_trans h0 (bmultiStep_star 6 ⟨E, .right, [1, 0, 1], []⟩ ⟨B, .left, [], [1, 1, 0, 1, 1, 1]⟩ rfl) + have h2 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨C, .right, [1, 0, 0, 1], [1, 1, 1]⟩) := + stepStar_trans h1 (bmultiStep_star 6 ⟨B, .left, [], [1, 1, 0, 1, 1, 1]⟩ ⟨C, .right, [1, 0, 0, 1], [1, 1, 1]⟩ rfl) + have h3 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨B, .left, [0, 1, 0, 0, 1], [1]⟩) := + stepStar_trans h2 (bmultiStep_star 6 ⟨C, .right, [1, 0, 0, 1], [1, 1, 1]⟩ ⟨B, .left, [0, 1, 0, 0, 1], [1]⟩ rfl) + have h4 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨C, .left, [1, 0, 1, 1, 0, 0, 1], [1]⟩) := + stepStar_trans h3 (bmultiStep_star 6 ⟨B, .left, [0, 1, 0, 0, 1], [1]⟩ ⟨C, .left, [1, 0, 1, 1, 0, 0, 1], [1]⟩ rfl) + have h5 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨D, .left, [0, 0, 1], [1, 1, 1, 1, 1]⟩) := + stepStar_trans h4 (bmultiStep_star 6 ⟨C, .left, [1, 0, 1, 1, 0, 0, 1], [1]⟩ ⟨D, .left, [0, 0, 1], [1, 1, 1, 1, 1]⟩ rfl) + have h6 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨D, .left, [1], [1, 0, 1, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h5 (bmultiStep_star 6 ⟨D, .left, [0, 0, 1], [1, 1, 1, 1, 1]⟩ ⟨D, .left, [1], [1, 0, 1, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h7 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨A, .left, [0, 0, 1, 0, 1], [0, 1, 1, 1, 1]⟩) := + stepStar_trans h6 (bmultiStep_star 6 ⟨D, .left, [1], [1, 0, 1, 1, 1, 1, 1, 1, 1]⟩ ⟨A, .left, [0, 0, 1, 0, 1], [0, 1, 1, 1, 1]⟩ rfl) + have h8 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨E, .right, [1, 0, 1, 1, 0, 1], [1, 1, 1, 1]⟩) := + stepStar_trans h7 (bmultiStep_star 6 ⟨A, .left, [0, 0, 1, 0, 1], [0, 1, 1, 1, 1]⟩ ⟨E, .right, [1, 0, 1, 1, 0, 1], [1, 1, 1, 1]⟩ rfl) + have h9 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨D, .left, [1, 1, 0, 1, 1, 0, 1], [1, 0, 1]⟩) := + stepStar_trans h8 (bmultiStep_star 6 ⟨E, .right, [1, 0, 1, 1, 0, 1], [1, 1, 1, 1]⟩ ⟨D, .left, [1, 1, 0, 1, 1, 0, 1], [1, 0, 1]⟩ rfl) + have h10 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨C, .left, [1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [1]⟩) := + stepStar_trans h9 (bmultiStep_star 6 ⟨D, .left, [1, 1, 0, 1, 1, 0, 1], [1, 0, 1]⟩ ⟨C, .left, [1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [1]⟩ rfl) + have h11 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨E, .right, [1, 0, 1, 1, 0, 1], [0, 1, 0, 1, 1, 1]⟩) := + stepStar_trans h10 (bmultiStep_star 6 ⟨C, .left, [1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [1]⟩ ⟨E, .right, [1, 0, 1, 1, 0, 1], [0, 1, 0, 1, 1, 1]⟩ rfl) + have h12 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨C, .left, [1, 0, 1], [1, 1, 1, 1, 1, 0, 1, 1, 1]⟩) := + stepStar_trans h11 (bmultiStep_star 6 ⟨E, .right, [1, 0, 1, 1, 0, 1], [0, 1, 0, 1, 1, 1]⟩ ⟨C, .left, [1, 0, 1], [1, 1, 1, 1, 1, 0, 1, 1, 1]⟩ rfl) + have h13 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨C, .right, [1], [1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1]⟩) := + stepStar_trans h12 (bmultiStep_star 6 ⟨C, .left, [1, 0, 1], [1, 1, 1, 1, 1, 0, 1, 1, 1]⟩ ⟨C, .right, [1], [1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1]⟩ rfl) + have h14 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨D, .left, [1, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1]⟩) := + stepStar_trans h13 (bmultiStep_star 6 ⟨C, .right, [1], [1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1]⟩ ⟨D, .left, [1, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1]⟩ rfl) + have h15 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨C, .right, [1, 1, 0, 0, 1], [1, 0, 1, 1, 1, 1, 0, 1, 1, 1]⟩) := + stepStar_trans h14 (bmultiStep_star 6 ⟨D, .left, [1, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1]⟩ ⟨C, .right, [1, 1, 0, 0, 1], [1, 0, 1, 1, 1, 1, 0, 1, 1, 1]⟩ rfl) + have h16 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨B, .right, [0, 0, 1, 0, 1, 1, 0, 0, 1], [1, 1, 0, 1, 1, 1]⟩) := + stepStar_trans h15 (bmultiStep_star 6 ⟨C, .right, [1, 1, 0, 0, 1], [1, 0, 1, 1, 1, 1, 0, 1, 1, 1]⟩ ⟨B, .right, [0, 0, 1, 0, 1, 1, 0, 0, 1], [1, 1, 0, 1, 1, 1]⟩ rfl) + have h17 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨F, .right, [0, 1, 1, 0, 1, 1, 0, 0, 1], [0, 1, 0, 1, 1, 1]⟩) := + stepStar_trans h16 (bmultiStep_star 6 ⟨B, .right, [0, 0, 1, 0, 1, 1, 0, 0, 1], [1, 1, 0, 1, 1, 1]⟩ ⟨F, .right, [0, 1, 1, 0, 1, 1, 0, 0, 1], [0, 1, 0, 1, 1, 1]⟩ rfl) + have h18 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨A, .left, [0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1], []⟩) := + stepStar_trans h17 (bmultiStep_star 6 ⟨F, .right, [0, 1, 1, 0, 1, 1, 0, 0, 1], [0, 1, 0, 1, 1, 1]⟩ ⟨A, .left, [0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1], []⟩ rfl) + have h19 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨E, .right, [1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1], []⟩) := + stepStar_trans h18 (bmultiStep_star 6 ⟨A, .left, [0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1], []⟩ ⟨E, .right, [1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1], []⟩ rfl) + have h20 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨C, .left, [1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1], [1, 1, 1, 1]⟩) := + stepStar_trans h19 (bmultiStep_star 6 ⟨E, .right, [1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1], []⟩ ⟨C, .left, [1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1], [1, 1, 1, 1]⟩ rfl) + have h21 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨E, .right, [1, 0, 1, 1, 0, 0, 1], [0, 1, 0, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h20 (bmultiStep_star 6 ⟨C, .left, [1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1], [1, 1, 1, 1]⟩ ⟨E, .right, [1, 0, 1, 1, 0, 0, 1], [0, 1, 0, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h22 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨C, .left, [1, 0, 0, 1], [1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h21 (bmultiStep_star 6 ⟨E, .right, [1, 0, 1, 1, 0, 0, 1], [0, 1, 0, 1, 1, 1, 1, 1, 1]⟩ ⟨C, .left, [1, 0, 0, 1], [1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h23 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨C, .right, [1], [1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h22 (bmultiStep_star 6 ⟨C, .left, [1, 0, 0, 1], [1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]⟩ ⟨C, .right, [1], [1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h24 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨B, .right, [0, 0, 1, 0, 1], [1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h23 (bmultiStep_star 6 ⟨C, .right, [1], [1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]⟩ ⟨B, .right, [0, 0, 1, 0, 1], [1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h25 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨F, .right, [0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h24 (bmultiStep_star 6 ⟨B, .right, [0, 0, 1, 0, 1], [1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]⟩ ⟨F, .right, [0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h26 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨C, .right, [1, 1, 0, 1, 1, 0, 1], [1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h25 (bmultiStep_star 6 ⟨F, .right, [0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]⟩ ⟨C, .right, [1, 1, 0, 1, 1, 0, 1], [1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h27 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨B, .right, [0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h26 (bmultiStep_star 6 ⟨C, .right, [1, 1, 0, 1, 1, 0, 1], [1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1]⟩ ⟨B, .right, [0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h28 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨A, .left, [0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1]⟩) := + stepStar_trans h27 (bmultiStep_star 6 ⟨B, .right, [0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1]⟩ ⟨A, .left, [0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1]⟩ rfl) + have h29 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨E, .right, [1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [1, 1, 1]⟩) := + stepStar_trans h28 (bmultiStep_star 6 ⟨A, .left, [0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1]⟩ ⟨E, .right, [1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [1, 1, 1]⟩ rfl) + have h30 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨D, .left, [1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [1]⟩) := + stepStar_trans h29 (bmultiStep_star 6 ⟨E, .right, [1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [1, 1, 1]⟩ ⟨D, .left, [1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [1]⟩ rfl) + have h31 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨A, .left, [1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [1, 1, 1]⟩) := + stepStar_trans h30 (bmultiStep_star 6 ⟨D, .left, [1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [1]⟩ ⟨A, .left, [1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [1, 1, 1]⟩ rfl) + have h32 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨D, .left, [1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h31 (bmultiStep_star 6 ⟨A, .left, [1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [1, 1, 1]⟩ ⟨D, .left, [1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h33 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨A, .left, [0, 1, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h32 (bmultiStep_star 6 ⟨D, .left, [1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1]⟩ ⟨A, .left, [0, 1, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h34 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨E, .right, [1, 0, 1], [0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h33 (bmultiStep_star 6 ⟨A, .left, [0, 1, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ ⟨E, .right, [1, 0, 1], [0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h35 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨B, .left, [], [1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h34 (bmultiStep_star 6 ⟨E, .right, [1, 0, 1], [0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ ⟨B, .left, [], [1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h36 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨C, .right, [1, 0, 0, 1], [1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h35 (bmultiStep_star 6 ⟨B, .left, [], [1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ ⟨C, .right, [1, 0, 0, 1], [1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h37 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨B, .left, [0, 1, 0, 0, 1], [1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h36 (bmultiStep_star 6 ⟨C, .right, [1, 0, 0, 1], [1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ ⟨B, .left, [0, 1, 0, 0, 1], [1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h38 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨F, .right, [0, 1, 0, 1, 1, 0, 0, 1], [0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h37 (bmultiStep_star 6 ⟨B, .left, [0, 1, 0, 0, 1], [1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ ⟨F, .right, [0, 1, 0, 1, 1, 0, 0, 1], [0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h39 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨A, .left, [1, 1, 0, 0, 1], [1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h38 (bmultiStep_star 6 ⟨F, .right, [0, 1, 0, 1, 1, 0, 0, 1], [0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ ⟨A, .left, [1, 1, 0, 0, 1], [1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h40 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨B, .left, [1], [1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h39 (bmultiStep_star 6 ⟨A, .left, [1, 1, 0, 0, 1], [1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ ⟨B, .left, [1], [1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h41 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨F, .right, [0, 1], [0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h40 (bmultiStep_star 6 ⟨B, .left, [1], [1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ ⟨F, .right, [0, 1], [0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h42 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨C, .right, [1, 1, 0, 1], [1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h41 (bmultiStep_star 6 ⟨F, .right, [0, 1], [0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ ⟨C, .right, [1, 1, 0, 1], [1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h43 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨B, .right, [0, 0, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h42 (bmultiStep_star 6 ⟨C, .right, [1, 1, 0, 1], [1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ ⟨B, .right, [0, 0, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h44 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨A, .left, [0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1], [0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h43 (bmultiStep_star 6 ⟨B, .right, [0, 0, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ ⟨A, .left, [0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1], [0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h45 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨E, .right, [1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h44 (bmultiStep_star 6 ⟨A, .left, [0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1], [0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ ⟨E, .right, [1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h46 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨B, .left, [0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1, 1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h45 (bmultiStep_star 6 ⟨E, .right, [1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]⟩ ⟨B, .left, [0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1, 1, 1, 1, 1, 1, 1]⟩ rfl) + have h47 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨F, .right, [0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [1, 1, 1, 1, 1, 1]⟩) := + stepStar_trans h46 (bmultiStep_star 6 ⟨B, .left, [0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1, 1, 1, 1, 1, 1, 1]⟩ ⟨F, .right, [0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [1, 1, 1, 1, 1, 1]⟩ rfl) + have h48 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨E, .right, [1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1, 1, 1, 1]⟩) := + stepStar_trans h47 (bmultiStep_star 6 ⟨F, .right, [0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [1, 1, 1, 1, 1, 1]⟩ ⟨E, .right, [1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1, 1, 1, 1]⟩ rfl) + have h49 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨B, .left, [0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1]⟩) := + stepStar_trans h48 (bmultiStep_star 6 ⟨E, .right, [1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1, 1, 1, 1]⟩ ⟨B, .left, [0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1]⟩ rfl) + have h50 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨F, .right, [0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], []⟩) := + stepStar_trans h49 (bmultiStep_star 6 ⟨B, .left, [0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1]⟩ ⟨F, .right, [0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], []⟩ rfl) + have h51 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨A, .left, [1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1, 1, 1]⟩) := + stepStar_trans h50 (bmultiStep_star 6 ⟨F, .right, [0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], []⟩ ⟨A, .left, [1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1, 1, 1]⟩ rfl) + have h52 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨D, .left, [1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 0, 1, 1, 1]⟩) := + stepStar_trans h51 (bmultiStep_star 6 ⟨A, .left, [1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1, 1, 1]⟩ ⟨D, .left, [1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 0, 1, 1, 1]⟩ rfl) + have h53 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨E, .right, [1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1]⟩) := + stepStar_trans h52 (bmultiStep_star 6 ⟨D, .left, [1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 0, 1, 1, 1]⟩ ⟨E, .right, [1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1]⟩ rfl) + have h54 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨D, .left, [1, 0, 0, 1, 0, 1, 1, 0, 1], [0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1]⟩) := + stepStar_trans h53 (bmultiStep_star 6 ⟨E, .right, [1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1]⟩ ⟨D, .left, [1, 0, 0, 1, 0, 1, 1, 0, 1], [0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1]⟩ rfl) + have h55 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨A, .left, [0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1]⟩) := + stepStar_trans h54 (bmultiStep_star 6 ⟨D, .left, [1, 0, 0, 1, 0, 1, 1, 0, 1], [0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1]⟩ ⟨A, .left, [0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1]⟩ rfl) + have h56 : (init []) [tm_coq]⊢* (evalDCfg default default ⟨A, .left, [], [1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1]⟩) := + stepStar_trans h55 (bmultiStep_star 6 ⟨A, .left, [0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1]⟩ ⟨A, .left, [], [1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1]⟩ rfl) + exact h56 + +def mirrorTape (T : Tape (Fin 2)) : Tape (Fin 2) := ⟨T.head, T.right, T.left⟩ + +def mirrorCfg (c : Cfg (Fin 2) (Fin 6)) : Cfg (Fin 2) (Fin 6) := ⟨c.q, mirrorTape c.tape⟩ + +theorem step_mirror (c : Cfg (Fin 2) (Fin 6)) : + step target_tm (mirrorCfg c) = (step tm_coq c).map mirrorCfg := by + rcases c with ⟨_ | q, ⟨head, l, r⟩⟩ + · rfl + · rcases q with ⟨_ | _ | _ | _ | _ | _ | n, hn⟩ <;> + rcases head with ⟨_ | _ | m, hm⟩ <;> (try rfl) <;> omega + +theorem multiStep_mirror : ∀ (n : ℕ) (c : Cfg (Fin 2) (Fin 6)), + multiStep target_tm (mirrorCfg c) n = (multiStep tm_coq c n).map mirrorCfg + | 0, c => rfl + | n + 1, c => by + rw [multiStep_succ, multiStep_succ, multiStep_mirror n c] + cases multiStep tm_coq c n with + | none => rfl + | some c' => simp [step_mirror] + +theorem haltsFrom_init_to_IsHalt (h : haltsFrom (init [])) : IsHalt target_tm := by + rcases h with ⟨c', ⟨n, hn⟩, hnone⟩ + refine ⟨mirrorCfg c', ⟨n, ?_⟩, ?_⟩ + · have hm := multiStep_mirror n (init []) + have hinit : mirrorCfg (init []) = init [] := rfl + rw [hinit, hn] at hm + exact hm + · rw [step_mirror, Option.isNone_iff_eq_none] + rw [Option.isNone_iff_eq_none] at hnone + simp [hnone] + + +def cmd_4 : Cmd := (.c (.b 1 .nil)) +def cmd_8 : Cmd := (.l 2 (.c .nil) (.c (.bc 1 .nil))) +def cmd_12 : Cmd := (.bc 2 (.bc 1 (.bc 1 (.bc 1 .nil)))) +def cmd_16 : Cmd := (.l 8 (.bc 3 .nil) (.c (.bc 1 (.l 4 (.l 2 (.c .nil) .nil) .nil)))) +def cmd_20 : Cmd := (.l 10 (.bc 1 (.bc 1 (.b 1 .nil))) (.c (.bc 7 (.bc 1 (.b 5 .nil))))) +def cmd_24 : Cmd := (.l 40 (.l 12 (.bc 1 (.l 4 (.c (.b 1 .nil)) .nil)) (.c (.bc 1 (.l 5 (.bc 1 .nil) .nil)))) (.c (.bc 1 (.l 5 (.l 2 (.c .nil) .nil) .nil)))) +def cmd_28 : Cmd := (.l 52 (.l 26 (.l 7 (.c (.l 2 (.c .nil) .nil)) (.c (.bc 1 (.b 3 .nil)))) .nil) (.c (.l 29 (.bc 5 (.bc 1 (.l 6 (.bc 1 (.b 1 .nil)) .nil))) (.c (.bc 1 (.b 6 .nil)))))) +def cmd_32 : Cmd := (.l 156 (.l 63 (.l 17 (.l 5 (.c (.b 1 .nil)) (.c (.bc 1 .nil))) (.c (.bc 1 (.l 11 (.l 5 (.bc 1 .nil) .nil) .nil)))) (.c (.bc 1 (.l 12 (.l 6 (.bc 1 (.b 1 .nil)) .nil) .nil)))) (.c (.bc 1 (.l 12 (.l 6 (.bc 1 (.b 1 .nil)) .nil) .nil)))) +def cmd_36 : Cmd := (.l 130 (.l 65 (.l 30 (.l 15 (.l 4 (.c (.b 1 .nil)) (.c (.bc 1 (.b 1 .nil)))) .nil) (.c (.b 1 .nil))) .nil) (.c (.l 153 (.l 45 (.l 22 (.bc 1 (.bc 1 (.l 7 (.l 3 (.c .nil) .nil) .nil))) .nil) (.c (.bc 1 (.l 28 (.l 14 (.l 7 (.bc 1 (.b 1 .nil)) .nil) .nil) .nil)))) (.c (.bc 1 (.l 28 (.l 14 (.bc 2 (.bc 1 (.b 2 .nil))) .nil) .nil)))))) +def cmd_40 : Cmd := (.l 510 (.l 193 (.l 50 (.l 25 (.c (.l 9 (.bc 1 (.bc 1 .nil)) (.c (.b 1 .nil)))) .nil) (.c (.bc 1 (.l 43 (.l 10 (.l 5 (.bc 1 .nil) .nil) (.c (.bc 1 (.l 8 (.c (.bc 1 (.b 1 .nil))) .nil)))) .nil)))) (.c (.bc 1 (.l 59 (.l 29 (.l 15 (.l 8 (.c (.bc 1 (.b 1 .nil))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.bc 9 (.l 49 (.l 24 (.bc 5 (.bc 1 (.l 4 (.bc 1 .nil) .nil))) .nil) .nil))))) +def cmd_44 : Cmd := (.l 920 (.l 346 (.l 90 (.l 45 (.l 19 (.l 4 (.c (.b 1 .nil)) (.c (.bc 1 (.bc 1 .nil)))) (.c (.bc 1 .nil))) .nil) (.c (.bc 1 (.l 80 (.l 20 (.l 10 (.bc 3 (.b 1 .nil)) .nil) (.c (.bc 1 (.l 17 (.bc 6 (.b 1 .nil)) .nil)))) .nil)))) (.c (.bc 1 (.l 111 (.l 55 (.l 27 (.l 13 (.c (.bc 1 (.bc 1 (.b 1 .nil)))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 111 (.l 55 (.l 19 (.bc 5 (.bc 1 (.b 1 .nil))) (.c (.bc 1 (.l 6 (.l 3 (.c (.b 1 .nil)) .nil) .nil)))) .nil) .nil)))) +def cmd_48 : Cmd := (.l 280 (.l 140 (.l 70 (.l 35 (.l 17 (.l 6 (.c (.bc 1 .nil)) (.c (.b 1 .nil))) .nil) .nil) .nil) .nil) (.c (.l 1393 (.l 497 (.l 101 (.l 50 (.l 17 (.bc 1 (.bc 1 (.b 4 .nil))) (.c (.bc 1 (.l 5 (.bc 1 .nil) .nil)))) .nil) (.c (.bc 1 (.l 144 (.bc 31 (.bc 1 (.l 38 (.l 16 (.c (.bc 1 (.b 5 .nil))) (.c (.bc 1 .nil))) .nil))) .nil)))) (.c (.bc 1 (.l 196 (.l 98 (.l 49 (.l 25 (.c (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.b 1 .nil)))))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 196 (.l 98 (.l 40 (.l 7 (.bc 2 .nil) (.c (.bc 1 (.l 10 (.l 5 (.bc 1 .nil) .nil) .nil)))) (.c (.bc 1 (.b 6 .nil)))) .nil) .nil)))))) +def cmd_52 : Cmd := (.l 778 (.l 389 (.l 194 (.l 97 (.l 48 (.l 4 (.c (.b 1 .nil)) (.c (.bc 1 (.l 9 (.c (.bc 1 (.b 1 .nil))) (.c (.bc 1 (.l 5 (.c (.b 1 .nil)) .nil))))))) .nil) .nil) .nil) .nil) (.c (.l 2281 (.l 795 (.l 137 (.l 68 (.l 19 (.l 9 (.c (.c (.b 2 .nil))) .nil) (.c (.bc 1 (.l 12 (.c (.bc 1 (.b 3 .nil))) .nil)))) .nil) (.c (.bc 1 (.l 257 (.bc 49 (.bc 1 (.l 76 (.l 30 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.b 1 .nil))))) (.c (.bc 1 (.l 5 (.c (.b 1 .nil)) .nil)))) .nil))) .nil)))) (.c (.bc 1 (.l 342 (.l 171 (.l 86 (.l 36 (.bc 4 (.bc 1 (.bc 9 (.b 1 .nil)))) (.c (.bc 1 (.b 4 .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 342 (.l 171 (.l 80 (.l 18 (.l 9 (.bc 2 (.b 1 .nil)) .nil) (.c (.bc 1 (.l 19 (.l 8 (.bc 1 (.bc 1 .nil)) (.c .nil)) .nil)))) (.c (.bc 1 (.l 2 (.c .nil) .nil)))) .nil) .nil)))))) +def cmd_56 : Cmd := (.l 1526 (.l 763 (.l 381 (.l 190 (.l 95 (.l 29 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 .nil)))))) (.c (.bc 1 (.l 15 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil)))) .nil)))) .nil) .nil) .nil) .nil) (.c (.l 4065 (.l 1421 (.l 245 (.l 122 (.l 37 (.l 18 (.c (.c (.b 7 .nil))) .nil) (.c (.bc 1 (.l 21 (.bc 1 (.bc 1 (.b 6 .nil))) .nil)))) .nil) (.c (.bc 1 (.l 462 (.l 89 (.l 44 (.bc 20 (.b 1 .nil)) .nil) (.c (.bc 1 (.l 139 (.l 45 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.b 6 .nil))))) (.c (.bc 1 (.l 21 (.bc 1 (.b 8 .nil)) .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 608 (.l 304 (.l 152 (.l 45 (.bc 8 (.bc 1 (.b 11 .nil))) (.c (.bc 1 (.l 28 (.bc 4 (.bc 1 (.b 7 .nil))) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 608 (.l 304 (.l 152 (.l 47 (.l 23 (.c (.bc 1 (.bc 1 (.bc 1 (.b 4 .nil))))) .nil) (.c (.bc 1 (.l 26 (.l 2 (.c .nil) (.c (.bc 1 (.b 8 .nil)))) .nil)))) .nil) .nil) .nil)))))) +def cmd_60 : Cmd := (.l 2930 (.l 1465 (.l 732 (.c (.bc 1 (.l 363 (.l 181 (.l 60 (.bc 5 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 .nil))))))))) (.c (.bc 1 (.l 27 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))) .nil)))) .nil) .nil))) .nil) .nil) (.c (.l 7263 (.l 2523 (.l 419 (.l 209 (.l 61 (.l 30 (.c (.c (.b 13 .nil))) .nil) (.c (.bc 1 (.l 40 (.bc 7 (.bc 1 (.b 10 .nil))) .nil)))) .nil) (.c (.bc 1 (.l 839 (.l 174 (.l 87 (.bc 29 (.bc 1 (.bc 11 .nil))) .nil) (.c (.bc 1 (.l 242 (.l 53 (.c (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.b 9 .nil)))))) (.c (.bc 1 (.l 65 (.bc 16 (.bc 1 (.b 13 .nil))) .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 1105 (.l 552 (.l 276 (.l 60 (.bc 24 (.bc 1 (.b 3 .nil))) (.c (.bc 1 (.l 75 (.bc 22 (.bc 1 (.bc 9 (.bc 1 .nil)))) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 1105 (.l 552 (.l 276 (.l 93 (.l 46 (.c (.bc 1 (.bc 7 (.bc 1 (.b 10 .nil))))) .nil) (.c (.bc 1 (.l 42 (.bc 3 (.bc 1 (.l 15 (.bc 3 (.bc 1 (.b 1 .nil))) .nil))) .nil)))) .nil) .nil) .nil)))))) +def cmd_64 : Cmd := (.l 5780 (.l 2890 (.l 1445 (.bc 2 (.bc 1 (.l 717 (.l 358 (.l 123 (.bc 15 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.b 1 .nil))))))))))))) (.c (.bc 1 (.l 53 (.c (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil)))))))))))) .nil)))) .nil) .nil))) .nil) .nil) (.c (.l 12761 (.l 4347 (.l 637 (.l 318 (.l 53 (.l 26 (.c (.c (.b 11 .nil))) .nil) (.c (.bc 1 (.l 103 (.bc 27 (.bc 1 (.b 21 .nil))) .nil)))) .nil) (.c (.bc 1 (.l 1533 (.l 327 (.l 163 (.bc 31 (.bc 1 (.bc 15 (.bc 1 (.bc 13 (.bc 1 (.b 13 .nil))))))) .nil) (.c (.bc 1 (.l 436 (.bc 42 (.bc 1 (.l 173 (.bc 2 (.bc 1 (.bc 67 (.bc 1 (.b 11 .nil))))) .nil))) .nil)))) .nil)))) (.c (.bc 1 (.l 2030 (.l 1015 (.l 508 (.bc 82 (.bc 1 (.l 169 (.bc 13 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.b 8 .nil))))))))) .nil))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 2030 (.l 1015 (.l 490 (.l 128 (.l 64 (.bc 1 (.bc 1 (.bc 27 .nil))) .nil) (.c (.bc 1 (.l 114 (.l 34 (.c (.b 16 .nil)) (.c (.bc 1 (.b 20 .nil)))) .nil)))) (.c (.bc 1 (.b 14 .nil)))) .nil) .nil)))))) +def cmd_68 : Cmd := (.l 11366 (.l 5683 (.l 2841 (.l 1420 (.l 648 (.l 227 (.bc 7 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.b 7 .nil))))))))))))))) (.c (.bc 1 (.l 94 (.c (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 .nil)))))))))))))) .nil)))) (.c (.bc 1 (.l 59 (.l 29 (.c (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil)))))))) .nil) .nil)))) .nil) .nil) .nil) (.c (.l 22313 (.l 7419 (.l 897 (.l 448 (.l 224 (.l 39 (.c (.c (.b 17 .nil))) (.c (.bc 1 (.b 70 .nil)))) .nil) .nil) (.c (.bc 1 (.l 2809 (.l 555 (.l 277 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 55 (.bc 1 (.b 43 .nil))))))) .nil) (.c (.bc 1 (.l 846 (.bc 5 (.bc 1 (.l 415 (.bc 61 (.bc 1 (.bc 137 (.bc 1 (.b 3 .nil))))) .nil))) .nil)))) .nil)))) (.c (.bc 1 (.l 3734 (.l 1867 (.l 934 (.bc 112 (.bc 1 (.l 352 (.bc 48 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.b 35 .nil))))))))))) .nil))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 3734 (.l 1867 (.l 806 (.l 66 (.l 33 (.bc 4 (.bc 1 (.b 9 .nil))) .nil) (.c (.bc 1 (.l 334 (.l 136 (.bc 57 (.bc 1 (.b 8 .nil))) (.c (.bc 1 (.b 28 .nil)))) .nil)))) (.c (.bc 1 (.b 124 .nil)))) .nil) .nil)))))) +def cmd_72 : Cmd := (.l 21750 (.l 10875 (.l 5437 (.l 2718 (.l 945 (.l 359 (.bc 27 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.b 7 .nil))))))))))))))) (.c (.bc 1 (.l 110 (.bc 18 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.b 8 .nil))))))))) .nil)))) (.c (.bc 1 (.l 411 (.l 127 (.bc 8 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 .nil))))))))))) (.c (.bc 1 (.l 75 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))) .nil)))) .nil)))) .nil) .nil) .nil) (.c (.l 39345 (.l 12801 (.l 1233 (.l 616 (.l 308 (.l 29 (.c (.c (.b 12 .nil))) (.c (.bc 1 (.bc 89 (.bc 1 (.b 30 .nil)))))) .nil) .nil) (.c (.bc 1 (.l 5164 (.l 829 (.l 378 (.bc 137 (.bc 1 (.b 49 .nil))) (.c (.bc 1 (.b 33 .nil)))) (.c (.bc 1 (.l 1750 (.l 875 (.bc 181 (.bc 1 (.bc 249 (.bc 1 (.b 2 .nil))))) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 6868 (.l 3434 (.l 1442 (.bc 143 (.bc 1 (.l 575 (.bc 90 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.b 28 .nil))))))))))))) .nil))) (.c (.bc 1 (.b 272 .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 6868 (.l 3434 (.l 1178 (.l 589 (.l 232 (.bc 12 (.bc 1 (.b 101 .nil))) (.c (.bc 1 (.b 59 .nil)))) .nil) (.c (.bc 1 (.l 536 (.l 268 (.l 134 (.bc 4 (.bc 1 (.b 60 .nil))) .nil) .nil) .nil)))) .nil) .nil)))))) +def cmd_76 : Cmd := (.l 40554 (.l 20277 (.l 10138 (.l 5069 (.l 1314 (.l 467 (.bc 49 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.b 49 .nil))))))))))))) (.c (.bc 1 (.l 187 (.bc 16 (.bc 1 (.bc 67 (.bc 1 (.b 4 .nil))))) .nil)))) (.c (.bc 1 (.l 1217 (.l 158 (.bc 34 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.b 12 .nil))))))))) (.c (.bc 1 (.l 197 (.bc 13 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 .nil)))))))) (.c (.bc 1 (.l 247 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil)))))))))))))))))))))))))))))) .nil))))))) .nil)))) .nil) .nil) .nil) (.c (.l 70017 (.l 22325 (.l 1613 (.l 806 (.l 403 (.l 11 (.c (.c (.b 3 .nil))) (.c (.bc 1 (.b 187 .nil)))) .nil) .nil) (.c (.bc 1 (.l 9546 (.l 1073 (.l 533 (.bc 231 (.bc 1 (.b 32 .nil))) (.c (.bc 1 .nil))) (.c (.bc 1 (.l 3697 (.l 1848 (.bc 466 (.bc 1 (.bc 417 (.bc 1 (.b 35 .nil))))) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 12680 (.l 6340 (.l 1943 (.bc 150 (.bc 1 (.l 818 (.bc 125 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.b 77 .nil))))))))))))) .nil))) (.c (.bc 1 (.l 1224 (.l 612 (.bc 87 (.bc 1 (.b 216 .nil))) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 12680 (.l 6340 (.l 1380 (.l 690 (.l 177 (.bc 33 (.bc 1 (.b 52 .nil))) (.c (.bc 1 (.b 165 .nil)))) .nil) (.c (.bc 1 (.l 1787 (.l 893 (.l 446 (.bc 112 (.bc 1 (.b 108 .nil))) .nil) .nil) .nil)))) .nil) .nil)))))) +def cmd_80 : Cmd := (.l 74978 (.l 37489 (.l 18744 (.l 9372 (.l 1794 (.l 399 (.bc 57 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.b 29 .nil))))))))))) (.c (.bc 1 (.l 495 (.bc 22 (.bc 1 (.bc 109 (.bc 1 (.b 110 .nil))))) .nil)))) (.c (.bc 1 (.l 2889 (.bc 50 (.bc 1 (.l 459 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.b 25 .nil)))))))))))) (.c (.bc 1 (.l 681 (.bc 12 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.b 1 .nil))))))))))))))))))))))) (.c (.bc 1 (.l 245 (.c (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil)))))))))))))))))))))))))))))) .nil))))))))) .nil)))) .nil) .nil) .nil) (.c (.l 124401 (.l 38633 (.l 1561 (.l 780 (.l 390 (.l 195 (.c (.c (.b 95 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 17752 (.bc 1189 (.bc 1 (.l 7684 (.bc 282 (.bc 1 (.l 3557 (.bc 41 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.b 150 .nil))))))) .nil))) .nil))) .nil)))) (.c (.bc 1 (.l 23564 (.l 11782 (.l 2562 (.bc 56 (.bc 1 (.l 1222 (.bc 147 (.bc 1 (.bc 107 (.bc 1 (.bc 21 (.bc 1 (.bc 19 (.bc 1 (.bc 87 (.bc 1 (.b 215 .nil))))))))))) .nil))) (.c (.bc 1 (.l 3326 (.l 1399 (.bc 21 (.bc 1 (.bc 417 (.bc 1 (.b 255 .nil))))) (.c (.bc 1 (.b 261 .nil)))) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 23564 (.l 11782 (.bc 866 (.bc 1 (.l 5022 (.l 2511 (.l 1083 (.bc 5 (.bc 1 (.bc 417 (.bc 1 (.b 113 .nil))))) (.c (.bc 1 (.b 170 .nil)))) .nil) .nil))) .nil) .nil)))))) +def cmd_84 : Cmd := (.l 140538 (.l 70269 (.l 34386 (.l 17193 (.l 2493 (.l 839 (.bc 37 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.b 7 .nil))))))))))))))) (.c (.bc 1 (.b 404 .nil)))) (.c (.bc 1 (.l 6100 (.l 737 (.bc 37 (.bc 1 (.bc 249 (.bc 1 (.b 76 .nil))))) (.c (.bc 1 (.l 1607 (.bc 87 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.b 51 .nil))))))))))))))))))))))))))))) (.c (.bc 1 (.l 700 (.bc 14 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.b 3 .nil))))))))))))))))))))))))))))))))))) .nil))))))) .nil)))) .nil) (.c (.bc 1 (.l 745 (.l 372 (.l 186 (.l 93 (.bc 6 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))) .nil) .nil) .nil) .nil)))) .nil) (.c (.l 217387 (.l 64707 (.l 32353 (.l 791 (.l 395 (.l 197 (.c (.c (.b 96 .nil))) .nil) .nil) (.c (.bc 1 (.l 15382 (.bc 1090 (.bc 1 (.l 6239 (.bc 308 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.b 234 .nil))))))) (.c (.bc 1 (.b 356 .nil)))))) .nil)))) .nil) (.c (.bc 1 (.l 43983 (.l 20686 (.l 3632 (.l 1816 (.bc 23 (.bc 1 (.bc 131 (.bc 1 (.bc 43 (.bc 1 (.bc 109 (.bc 1 (.bc 327 (.bc 1 (.b 260 .nil))))))))))) .nil) (.c (.bc 1 (.l 6708 (.l 2013 (.bc 396 (.bc 1 (.b 607 .nil))) (.c (.bc 1 (.l 1338 (.bc 312 (.bc 1 (.b 354 .nil))) .nil)))) .nil)))) (.c (.bc 1 (.b 1302 .nil)))) .nil)))) (.c (.bc 1 (.l 43983 (.l 21991 (.l 10996 (.l 5498 (.l 909 (.bc 404 (.bc 1 (.b 47 .nil))) (.c (.bc 1 (.l 1837 (.bc 608 (.bc 1 (.b 307 .nil))) .nil)))) .nil) .nil) .nil) .nil)))))) +def cmd_88 : Cmd := (.l 271872 (.l 135936 (.l 57548 (.l 28774 (.l 3684 (.l 318 (.bc 20 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 .nil)))))))) (.c (.bc 1 (.l 1521 (.bc 15 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.b 412 .nil))))))) .nil)))) (.c (.bc 1 (.l 10700 (.l 1230 (.bc 4 (.bc 1 (.bc 501 (.bc 1 (.b 104 .nil))))) (.c (.bc 1 (.l 3457 (.bc 311 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.b 20 .nil))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 657 (.bc 31 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.b 42 .nil))))))) .nil))))))) .nil)))) .nil) (.c (.bc 1 (.l 10417 (.l 1324 (.l 662 (.l 331 (.bc 67 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.b 6 .nil))))))))))) .nil) .nil) (.c (.bc 1 (.l 3881 (.l 1940 (.l 970 (.bc 33 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil)))) .nil)))) .nil) (.c (.l 368127 (.l 102149 (.l 51074 (.l 25537 (.l 711 (.l 355 (.c (.c (.b 175 .nil))) .nil) (.c (.bc 1 (.l 10429 (.bc 1114 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.b 93 .nil))))))) (.c (.bc 1 (.l 1622 (.bc 476 (.bc 1 (.bc 177 (.bc 1 (.b 152 .nil))))) .nil))))))) .nil) .nil) (.c (.bc 1 (.l 81911 (.l 34695 (.l 6141 (.l 3070 (.bc 3 (.bc 1 (.bc 439 (.bc 1 (.bc 987 (.bc 1 (.b 97 .nil))))))) .nil) (.c (.bc 1 (.l 11203 (.bc 2068 (.bc 1 (.l 3530 (.bc 447 (.bc 1 (.b 1315 .nil))) .nil))) .nil)))) (.c (.bc 1 (.l 6257 (.l 3128 (.l 1200 (.bc 530 (.bc 1 (.b 67 .nil))) (.c (.bc 1 (.b 361 .nil)))) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 81911 (.l 40955 (.l 20478 (.l 10239 (.l 4549 (.bc 1331 (.bc 1 (.b 940 .nil))) (.c (.bc 1 (.l 567 (.bc 45 (.bc 1 (.b 235 .nil))) .nil)))) .nil) .nil) .nil) .nil)))))) +def cmd_92 : Cmd := (.l 547208 (.l 273604 (.l 96848 (.l 48424 (.l 5990 (.l 2995 (.bc 202 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.b 11 .nil))))))))))))))))) .nil) (.c (.bc 1 (.l 18219 (.l 2649 (.bc 909 (.bc 1 (.b 412 .nil))) (.c (.bc 1 (.l 6457 (.bc 507 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.b 318 .nil))))))))))))))))))))))) .nil)))) .nil)))) .nil) (.c (.bc 1 (.l 39951 (.l 2801 (.l 1400 (.l 433 (.bc 98 (.bc 1 (.b 115 .nil))) (.c (.bc 1 (.l 264 (.bc 120 (.bc 1 (.b 9 .nil))) .nil)))) .nil) (.c (.bc 1 (.l 17171 (.l 4827 (.l 2413 (.bc 78 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.b 6 .nil))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 3755 (.l 1877 (.bc 102 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil)))) .nil)))) .nil)))) .nil) (.c (.l 594585 (.l 146273 (.l 73136 (.l 36568 (.l 13439 (.l 1447 (.c (.c (.b 721 .nil))) (.c (.bc 1 (.bc 4001 (.bc 1 (.b 1265 .nil)))))) (.c (.bc 1 (.l 4842 (.bc 734 (.bc 1 (.bc 751 (.bc 1 (.bc 335 (.bc 1 (.b 592 .nil))))))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 151016 (.l 61065 (.l 12386 (.l 6193 (.bc 5 (.bc 1 (.bc 1429 (.bc 1 (.b 1656 .nil))))) .nil) (.c (.bc 1 (.l 18143 (.bc 460 (.bc 1 (.l 8608 (.bc 682 (.bc 1 (.bc 3429 (.bc 1 (.b 187 .nil))))) .nil))) .nil)))) (.c (.bc 1 (.l 14440 (.l 7220 (.bc 1036 (.bc 1 (.b 2571 .nil))) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 151016 (.l 75508 (.l 37754 (.l 18877 (.l 8556 (.bc 1437 (.bc 1 (.bc 2571 (.bc 1 (.b 264 .nil))))) (.c (.bc 1 (.b 880 .nil)))) .nil) .nil) .nil) .nil)))))) +def cmd_96 : Cmd := (.l 1143026 (.l 571513 (.l 167348 (.l 83674 (.l 10773 (.l 5386 (.bc 721 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.b 615 .nil))))))))))))))))) .nil) (.c (.bc 1 (.l 31061 (.l 6839 (.bc 371 (.bc 1 (.bc 1581 (.bc 1 (.b 1461 .nil))))) (.c (.bc 1 (.l 8688 (.bc 382 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.b 323 .nil))))))))))))))))))))) .nil)))) .nil)))) .nil) (.c (.bc 1 (.l 118405 (.l 8222 (.l 4111 (.l 2055 (.bc 334 (.bc 1 (.b 691 .nil))) .nil) .nil) (.c (.bc 1 (.l 50977 (.l 6472 (.l 2154 (.bc 230 (.bc 1 (.b 844 .nil))) (.c (.bc 1 (.l 1079 (.bc 75 (.bc 1 (.b 461 .nil))) .nil)))) (.c (.bc 1 (.l 19013 (.l 8928 (.bc 195 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.b 20 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 575 (.bc 17 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil)))) .nil)))) .nil)))) .nil) (.c (.l 894439 (.l 173137 (.l 86568 (.l 43284 (.l 9681 (.l 4840 (.c (.c (.b 2418 .nil))) .nil) (.c (.bc 1 (.l 11958 (.bc 587 (.bc 1 (.bc 2755 (.bc 1 (.bc 1089 (.bc 1 (.bc 935 (.bc 1 (.b 601 .nil))))))))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 274079 (.l 113275 (.l 26882 (.l 9187 (.bc 1428 (.bc 1 (.b 3162 .nil))) (.c (.bc 1 (.l 4251 (.bc 839 (.bc 1 (.b 1283 .nil))) .nil)))) (.c (.bc 1 (.l 29752 (.l 14876 (.bc 4719 (.bc 1 (.b 2716 .nil))) .nil) .nil)))) (.c (.bc 1 (.l 23761 (.l 11880 (.bc 1645 (.bc 1 (.b 4292 .nil))) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 274079 (.l 137039 (.l 68520 (.l 34260 (.l 17130 (.bc 1174 (.bc 1 (.bc 6003 (.bc 1 (.b 1382 .nil))))) .nil) .nil) .nil) .nil) .nil)))))) +def cmd_100 : Cmd := (.l 2452968 (.l 1226484 (.l 301008 (.l 150504 (.l 20770 (.bc 2815 (.bc 1 (.l 7567 (.bc 1210 (.bc 1 (.bc 1999 (.bc 1 (.b 568 .nil))))) .nil))) (.c (.bc 1 (.l 54479 (.l 18440 (.bc 156 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.b 657 .nil))))))))))))))))))))) (.c (.bc 1 (.l 8796 (.bc 2770 (.bc 1 (.b 1625 .nil))) .nil)))) .nil)))) .nil) (.c (.bc 1 (.l 312231 (.l 22453 (.l 11226 (.l 5613 (.bc 946 (.bc 1 (.bc 1427 (.bc 1 (.b 428 .nil))))) .nil) .nil) (.c (.bc 1 (.l 133659 (.l 4637 (.l 2318 (.bc 141 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.b 233 .nil))))))))))))))) .nil) (.c (.bc 1 (.l 49843 (.l 6180 (.bc 753 (.bc 1 (.bc 1581 (.bc 1 (.b 750 .nil))))) (.c (.bc 1 (.l 16017 (.bc 1093 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.b 108 .nil))))))))))))))))))))))))))))) (.c (.bc 1 (.l 2718 (.bc 217 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.b 233 .nil))))))))))))))))) .nil))))))) (.c (.bc 1 (.l 12343 (.l 6043 (.bc 267 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.b 7 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 125 (.c (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil)))))))))))))))))))))) .nil)))) .nil))))))) .nil)))) .nil)))) .nil) (.c (.l 1192301 (.l 107235 (.l 53617 (.l 26808 (.l 13404 (.l 3721 (.c (.c (.b 1858 .nil))) (.c (.bc 1 (.bc 2027 (.bc 1 (.b 948 .nil)))))) .nil) .nil) .nil) (.c (.bc 1 (.l 488912 (.l 217644 (.l 57344 (.l 16175 (.bc 2019 (.bc 1 (.bc 6035 (.bc 1 (.b 27 .nil))))) (.c (.bc 1 (.b 12494 .nil)))) (.c (.bc 1 (.l 51475 (.l 25737 (.bc 3732 (.bc 1 (.b 9133 .nil))) .nil) .nil)))) (.c (.bc 1 (.b 26809 .nil)))) .nil)))) (.c (.bc 1 (.l 488912 (.l 244456 (.l 122228 (.l 61114 (.bc 78 (.bc 1 (.l 30476 (.bc 341 (.bc 1 (.bc 12867 (.bc 1 (.b 2024 .nil))))) .nil))) .nil) .nil) .nil) .nil)))))) +def cmd_104 : Cmd := (.l 5337978 (.l 2414517 (.l 562256 (.l 281128 (.l 41017 (.l 19773 (.bc 7983 (.bc 1 (.b 1900 .nil))) (.c (.bc 1 (.b 732 .nil)))) (.c (.bc 1 (.l 99544 (.l 48189 (.bc 3734 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 29 (.bc 1 (.bc 27 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.b 3523 .nil))))))))))))))))))))))) (.c (.bc 1 (.b 1580 .nil)))) .nil)))) .nil) (.c (.bc 1 (.l 644999 (.l 52889 (.l 20646 (.l 10323 (.bc 2546 (.bc 1 (.b 2612 .nil))) .nil) (.c (.bc 1 (.b 5795 .nil)))) (.c (.bc 1 (.l 269607 (.l 85972 (.l 24128 (.bc 1941 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.b 988 .nil))))))))))))))))))))))) (.c (.bc 1 (.l 18855 (.bc 1581 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.b 979 .nil))))))) .nil)))) (.c (.bc 1 (.l 48828 (.l 5926 (.bc 1591 (.bc 1 (.b 1369 .nil))) (.c (.bc 1 (.l 12613 (.bc 56 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.b 471 .nil))))))))))))))))))))))) (.c (.bc 1 (.l 5869 (.bc 1108 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.b 101 .nil))))))))))))))))) .nil))))))) .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 254469 (.l 127234 (.l 63617 (.l 31808 (.bc 8 (.bc 1 (.l 4997 (.bc 220 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.b 691 .nil))))))) (.c (.bc 1 (.l 9005 (.bc 228 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 1885 (.bc 106 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil))))))))) .nil) .nil) .nil) .nil)))) (.c (.l 1210725 (.l 605362 (.l 294319 (.l 51603 (.l 6303 (.l 3151 (.c (.c (.b 1573 .nil))) .nil) (.c (.bc 1 (.b 19495 .nil)))) (.c (.bc 1 (.l 95553 (.l 47776 (.bc 1260 (.bc 1 (.b 22625 .nil))) .nil) .nil)))) (.c (.bc 1 (.l 8359 (.l 4179 (.l 2090 (.bc 253 (.bc 1 (.b 789 .nil))) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 859832 (.l 429916 (.l 214958 (.l 107479 (.bc 25903 (.bc 1 (.l 27834 (.bc 11995 (.bc 1 (.b 1919 .nil))) .nil))) .nil) .nil) .nil) .nil)))))) +def cmd_108 : Cmd := (.l 11636154 (.l 4405785 (.l 1072434 (.l 536217 (.bc 79993 (.bc 1 (.l 188112 (.l 31343 (.bc 959 (.bc 1 (.b 14709 .nil))) (.c (.bc 1 (.l 62710 (.bc 1302 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 239 (.bc 1 (.bc 59 (.bc 1 (.bc 209 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.b 6392 .nil))))))))))))))))))))) .nil)))) .nil))) .nil) (.c (.bc 1 (.l 1130455 (.l 108352 (.l 23850 (.l 11925 (.bc 3615 (.bc 1 (.b 2344 .nil))) .nil) (.c (.bc 1 (.l 30323 (.bc 13220 (.bc 1 (.b 1938 .nil))) .nil)))) (.c (.bc 1 (.l 456872 (.l 148388 (.l 61778 (.bc 2941 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.b 5065 .nil))))))) (.c (.bc 1 (.l 12413 (.bc 936 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.b 445 .nil))))))))))))))))))) .nil)))) (.c (.bc 1 (.l 80045 (.l 24984 (.bc 1553 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.b 926 .nil))))))) (.c (.bc 1 (.l 15035 (.bc 5933 (.bc 1 (.b 1581 .nil))) .nil)))) .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 1412289 (.l 706144 (.l 215166 (.l 102166 (.bc 3458 (.bc 1 (.l 10877 (.bc 2691 (.bc 1 (.b 2744 .nil))) (.c (.bc 1 (.l 14005 (.bc 1255 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.b 616 .nil))))))))))))))))))))) (.c (.bc 1 (.l 22734 (.bc 1953 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.b 2547 .nil))))))) .nil))))))))) (.c (.bc 1 (.l 5414 (.l 2319 (.bc 23 (.bc 1 (.b 1133 .nil))) (.c (.bc 1 (.b 385 .nil)))) .nil)))) (.c (.bc 1 (.l 137903 (.l 68951 (.l 34475 (.bc 99 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil)))) .nil) .nil)))) (.c (.l 178171 (.l 89085 (.l 44542 (.l 22271 (.l 11135 (.l 4067 (.c (.c (.b 2031 .nil))) (.c (.bc 1 (.b 1497 .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1501375 (.l 750687 (.bc 53302 (.bc 1 (.b 322039 .nil))) .nil) .nil)))))) +def cmd_112 : Cmd := (.l 21376586 (.l 8060880 (.l 2044570 (.l 1022285 (.l 151326 (.l 15106 (.bc 204 (.bc 1 (.b 7346 .nil))) (.c (.bc 1 (.b 60554 .nil)))) (.c (.bc 1 (.l 359814 (.l 126479 (.bc 10991 (.bc 1 (.bc 38893 (.bc 1 (.b 13349 .nil))))) (.c (.bc 1 (.l 53425 (.bc 11398 (.bc 1 (.bc 12373 (.bc 1 (.b 2935 .nil))))) .nil)))) .nil)))) .nil) (.c (.bc 1 (.l 1985867 (.l 195605 (.l 30864 (.l 15432 (.bc 1822 (.bc 1 (.bc 1359 (.bc 1 (.bc 301 (.bc 1 (.bc 271 (.bc 1 (.bc 1119 (.bc 1 (.b 2829 .nil))))))))))) .nil) (.c (.bc 1 (.l 66935 (.l 33467 (.bc 807 (.bc 1 (.bc 8733 (.bc 1 (.b 7188 .nil))))) .nil) .nil)))) (.c (.bc 1 (.l 797325 (.l 293990 (.l 49250 (.bc 8825 (.bc 1 (.b 15797 .nil))) (.c (.bc 1 (.l 97742 (.bc 7078 (.bc 1 (.bc 25737 (.bc 1 (.b 16050 .nil))))) .nil)))) (.c (.bc 1 (.l 104669 (.bc 3375 (.bc 1 (.l 48956 (.bc 5137 (.bc 1 (.bc 16013 (.bc 1 (.b 3322 .nil))))) .nil))) .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 2627410 (.l 1313705 (.l 373889 (.l 186944 (.bc 6938 (.bc 1 (.l 29373 (.bc 1940 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.b 3827 .nil))))))))))))))))))))) (.c (.bc 1 (.l 24885 (.bc 2174 (.bc 1 (.bc 10007 (.bc 1 (.b 255 .nil))))) (.c (.bc 1 (.l 32267 (.bc 12610 (.bc 1 (.b 3520 .nil))) .nil))))))))) .nil) (.c (.bc 1 (.l 282961 (.l 85043 (.bc 6795 (.bc 1 (.l 35723 (.bc 5947 (.bc 1 (.bc 10007 (.bc 1 (.b 1901 .nil))))) .nil))) (.c (.bc 1 (.l 56434 (.l 28217 (.bc 4101 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.b 3181 .nil))))))))))))))))))))) .nil) .nil)))) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 2627410 (.l 1313705 (.l 174806 (.l 87403 (.l 43702 (.bc 45 (.bc 1 (.l 21803 (.bc 796 (.bc 1 (.bc 6003 (.bc 1 (.b 4096 .nil))))) .nil))) .nil) .nil) (.c (.bc 1 (.l 482043 (.l 241021 (.l 120510 (.l 60255 (.bc 2765 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.b 210 .nil))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil)))) .nil) .nil)))) +def cmd_116 : Cmd := (.l 2349502 (.l 1174751 (.l 587375 (.l 293687 (.l 146843 (.l 73421 (.l 5492 (.bc 1217 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.b 172 .nil))))))))))))))))) (.c (.bc 1 (.l 31215 (.bc 813 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.l 36360365 (.l 13531115 (.l 3242525 (.l 1621262 (.l 131623 (.l 65811 (.l 32905 (.c (.c (.b 16450 .nil))) .nil) .nil) (.c (.bc 1 (.l 679005 (.bc 21600 (.bc 1 (.l 317899 (.bc 22315 (.bc 1 (.bc 87513 (.bc 1 (.b 49115 .nil))))) .nil))) .nil)))) .nil) (.c (.bc 1 (.l 3523029 (.l 314153 (.l 72603 (.bc 20715 (.bc 1 (.l 15583 (.bc 4170 (.bc 1 (.b 3618 .nil))) .nil))) (.c (.bc 1 (.b 84470 .nil)))) (.c (.bc 1 (.l 1447358 (.l 653117 (.l 194878 (.bc 12388 (.bc 1 (.bc 17133 (.bc 1 (.bc 6119 (.bc 1 (.bc 1663 (.bc 1 (.bc 575 (.bc 1 (.bc 1393 (.bc 1 (.bc 4759 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.b 16260 .nil))))))))))))))))))) (.c (.bc 1 (.l 131677 (.bc 22631 (.bc 1 (.b 43204 .nil))) .nil)))) (.c (.bc 1 (.l 70559 (.l 25338 (.bc 5412 (.bc 1 (.b 7254 .nil))) (.c (.bc 1 (.b 9938 .nil)))) .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 4649064 (.l 2324532 (.l 613714 (.l 306857 (.l 75333 (.bc 36392 (.bc 1 (.b 1271 .nil))) (.c (.bc 1 (.bc 54261 (.bc 1 (.l 23829 (.bc 10488 (.bc 1 (.b 1423 .nil))) .nil)))))) .nil) (.c (.bc 1 (.l 548549 (.l 274274 (.bc 40121 (.bc 1 (.l 97013 (.bc 3263 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.b 12666 .nil))))))))))))))))))))))))) .nil))) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 4649064 (.l 2324532 (.l 337969 (.l 168984 (.l 84492 (.bc 6040 (.bc 1 (.l 36203 (.bc 325 (.bc 1 (.b 17773 .nil))) .nil))) .nil) .nil) (.c (.bc 1 (.l 824294 (.l 412147 (.l 21959 (.l 10979 (.bc 5103 (.bc 1 (.b 383 .nil))) .nil) (.c (.bc 1 (.l 184111 (.l 92055 (.bc 25353 (.bc 1 (.b 20672 .nil))) .nil) .nil)))) .nil) .nil)))) .nil) .nil)))))) +def cmd_120 : Cmd := (.l 20871882 (.l 10435941 (.l 5217970 (.l 2608985 (.l 511784 (.l 255892 (.l 12301 (.bc 2205 (.bc 1 (.b 3942 .nil))) (.c (.bc 1 (.l 115642 (.bc 12069 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.b 12081 .nil))))))))))))))))))))))))))) .nil)))) .nil) (.c (.bc 1 (.l 792705 (.l 280096 (.l 69150 (.bc 786 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.b 78 .nil))))))))))))))))))))))))) (.c (.bc 1 (.l 70895 (.bc 1919 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.b 1513 .nil))))))))))))))))))))))))))))))) .nil)))) (.c (.bc 1 (.l 116253 (.l 58126 (.bc 1057 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil)))) .nil)))) .nil) .nil) .nil) (.c (.l 49127825 (.l 16204829 (.l 1764985 (.l 882492 (.l 441246 (.l 220623 (.l 55731 (.c (.c (.b 27863 .nil))) (.c (.bc 1 (.b 54577 .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 6337426 (.bc 456451 (.bc 1 (.l 2712259 (.bc 27021 (.bc 1 (.l 1329105 (.l 126814 (.bc 32771 (.bc 1 (.b 30633 .nil))) (.c (.bc 1 (.l 409719 (.bc 70138 (.bc 1 (.bc 54261 (.bc 1 (.bc 23255 (.bc 1 (.bc 7785 (.bc 1 (.bc 2241 (.bc 1 (.bc 1971 (.bc 1 (.bc 6155 (.bc 1 (.bc 17135 (.bc 1 (.b 21894 .nil))))))))))))))))) (.c (.bc 1 (.l 128013 (.bc 15229 (.bc 1 (.b 48774 .nil))) .nil))))))) .nil))) .nil))) .nil)))) (.c (.bc 1 (.l 8359080 (.l 4179540 (.l 990283 (.l 166631 (.l 83315 (.bc 14870 (.bc 1 (.b 26784 .nil))) .nil) (.c (.bc 1 (.l 328507 (.bc 30960 (.bc 1 (.l 133290 (.bc 45246 (.bc 1 (.b 21396 .nil))) .nil))) .nil)))) (.c (.bc 1 (.l 1099484 (.l 549742 (.bc 6244 (.bc 1 (.bc 118215 (.bc 1 (.l 150406 (.bc 13608 (.bc 1 (.b 61592 .nil))) .nil))))) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 8359080 (.l 4179540 (.l 440792 (.l 220396 (.l 110198 (.bc 16601 (.bc 1 (.l 38495 (.bc 17619 (.bc 1 (.b 1625 .nil))) .nil))) .nil) .nil) (.c (.bc 1 (.l 1648975 (.l 824487 (.l 412243 (.l 206121 (.bc 62019 (.bc 1 (.bc 37125 (.bc 1 (.b 3910 .nil))))) .nil) .nil) .nil) .nil)))) .nil) .nil)))))) +def cmd_124 : Cmd := (.l 69837442 (.l 34918721 (.l 12375696 (.l 6187848 (.l 986302 (.l 77556 (.bc 9980 (.bc 1 (.l 28795 (.bc 8231 (.bc 1 (.bc 6117 (.bc 1 (.b 43 .nil))))) .nil))) (.c (.bc 1 (.l 415592 (.l 207796 (.bc 1585 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.b 19514 .nil))))))))))))))))))))))) .nil) .nil)))) (.c (.bc 1 (.l 2107619 (.l 895827 (.l 99743 (.bc 29102 (.bc 1 (.b 20766 .nil))) (.c (.bc 1 (.l 348167 (.bc 27849 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.b 11113 .nil))))))))))))))))))))))))))))))))) .nil)))) (.c (.bc 1 (.l 157979 (.bc 21382 (.bc 1 (.l 57604 (.bc 3930 (.bc 1 (.bc 22877 (.bc 1 (.b 1989 .nil))))) .nil))) .nil)))) .nil)))) .nil) (.c (.bc 1 (.l 5083661 (.l 637946 (.l 318973 (.l 159486 (.l 79743 (.bc 14024 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.b 2187 .nil))))))))))))))))))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 1903881 (.l 558346 (.l 279173 (.l 139587 (.bc 7820 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.b 3380 .nil))))))))))))))))))))))))))))))))) .nil) .nil) (.c (.bc 1 (.l 393591 (.l 196795 (.l 58983 (.bc 3480 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.b 1432 .nil))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 39411 (.bc 1137 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil)))) .nil)))) .nil)))) .nil) (.c (.l 56366427 (.l 12926355 (.l 6463177 (.l 3231588 (.l 1615794 (.l 207601 (.l 103800 (.c (.c (.b 51898 .nil))) .nil) (.c (.bc 1 (.l 600293 (.bc 108723 (.bc 1 (.bc 155037 (.bc 1 (.b 36380 .nil))))) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 15256855 (.l 7628427 (.l 1697746 (.l 848873 (.bc 51720 (.bc 1 (.l 372713 (.bc 15277 (.bc 1 (.bc 31043 (.bc 1 (.bc 10029 (.bc 1 (.bc 4215 (.bc 1 (.bc 8129 (.bc 1 (.bc 23293 (.bc 1 (.bc 54263 (.bc 1 (.b 40086 .nil))))))))))))))) .nil))) .nil) (.c (.bc 1 (.l 2116465 (.l 115728 (.bc 9115 (.bc 1 (.b 48746 .nil))) (.c (.bc 1 (.l 942501 (.l 209005 (.bc 31753 (.bc 1 (.b 72746 .nil))) (.c (.bc 1 (.l 262242 (.bc 78413 (.bc 1 (.b 52705 .nil))) .nil)))) .nil)))) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 15256855 (.l 7628427 (.l 257266 (.l 128633 (.l 64317 (.bc 22983 (.bc 1 (.b 9173 .nil))) .nil) .nil) (.c (.bc 1 (.l 3556945 (.l 1778472 (.l 889236 (.l 412434 (.bc 115969 (.bc 1 (.b 90245 .nil))) (.c (.bc 1 (.b 32181 .nil)))) .nil) .nil) .nil)))) .nil) .nil)))))) +def cmd_128 : Cmd := (.l 187714832 (.l 85294162 (.l 21461572 (.l 10730786 (.l 2092043 (.l 893618 (.l 446809 (.bc 78416 (.bc 1 (.b 144986 .nil))) .nil) (.c (.bc 1 (.l 152400 (.l 76200 (.bc 6174 (.bc 1 (.b 31923 .nil))) .nil) .nil)))) (.c (.bc 1 (.l 3273347 (.l 1636673 (.bc 35744 (.bc 1 (.l 705891 (.bc 50976 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.b 850 .nil))))))))))))))))))))))))))))))))) (.c (.bc 1 (.b 76695 .nil)))))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 21185506 (.l 1020258 (.l 510129 (.l 255064 (.l 127532 (.bc 58037 (.bc 1 (.b 5726 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 9572492 (.l 2175454 (.bc 268322 (.bc 1 (.l 819402 (.l 367082 (.bc 14706 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.b 24020 .nil))))))))))))))))))))))))))))) (.c (.bc 1 (.l 42616 (.bc 727 (.bc 1 (.b 20578 .nil))) .nil)))) .nil))) (.c (.bc 1 (.l 2610789 (.l 833651 (.l 416825 (.bc 18315 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.b 5369 .nil))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 471740 (.l 128415 (.bc 3363 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.b 21945 .nil))))))) (.c (.bc 1 (.l 107452 (.bc 3790 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.b 2301 .nil))))))))) .nil)))) .nil)))) .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 8563251 (.l 4281625 (.l 2140812 (.l 1070406 (.l 535203 (.l 267601 (.bc 1336 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.l 39040059 (.l 19520029 (.l 9273395 (.l 1235529 (.l 617764 (.l 26901 (.l 13450 (.c (.c (.b 6723 .nil))) .nil) (.c (.bc 1 (.l 281978 (.bc 18471 (.bc 1 (.b 122515 .nil))) .nil)))) .nil) (.c (.bc 1 (.l 3401165 (.l 1464703 (.l 357606 (.bc 110044 (.bc 1 (.b 68756 .nil))) (.c (.bc 1 (.l 374742 (.bc 39807 (.bc 1 (.bc 41075 (.bc 1 (.bc 14247 (.bc 1 (.bc 12347 (.bc 1 (.bc 31425 (.bc 1 (.b 48455 .nil))))))))))) .nil)))) (.c (.bc 1 (.l 235876 (.l 117938 (.bc 29103 (.bc 1 (.b 29863 .nil))) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 486616 (.l 243308 (.l 121654 (.bc 50299 (.bc 1 (.b 10525 .nil))) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 28083281 (.l 14041640 (.l 7020820 (.l 3510410 (.l 1755205 (.l 696310 (.bc 94763 (.bc 1 (.bc 251937 (.bc 1 (.b 1449 .nil))))) (.c (.bc 1 (.b 181290 .nil)))) .nil) .nil) .nil) .nil) .nil)))))) +def cmd_132 : Cmd := (.l 406393306 (.l 151555128 (.l 36962465 (.l 18481232 (.l 4919665 (.l 2459832 (.l 831257 (.bc 243821 (.bc 1 (.b 171804 .nil))) (.c (.bc 1 (.l 398656 (.bc 197703 (.bc 1 (.b 1622 .nil))) .nil)))) .nil) (.c (.bc 1 (.l 4320948 (.bc 529568 (.bc 1 (.l 1630903 (.l 633388 (.bc 201902 (.bc 1 (.b 114789 .nil))) (.c (.bc 1 (.b 182060 .nil)))) .nil))) .nil)))) .nil) (.c (.bc 1 (.l 38815096 (.l 2268157 (.l 1134078 (.l 567039 (.l 283520 (.bc 46116 (.bc 1 (.b 95641 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 17139388 (.l 6267572 (.l 1767578 (.l 883789 (.bc 59396 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.b 73207 .nil))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 1366205 (.bc 61996 (.bc 1 (.l 621103 (.bc 46953 (.bc 1 (.bc 184753 (.bc 1 (.b 78839 .nil))))) .nil))) .nil)))) (.c (.bc 1 (.l 2302119 (.l 1151059 (.l 575530 (.bc 105913 (.bc 1 (.bc 151161 (.bc 1 (.b 30685 .nil))))) .nil) .nil) .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 51641522 (.l 24182263 (.l 7884000 (.l 3942000 (.bc 169637 (.bc 1 (.l 1673433 (.bc 11881 (.bc 1 (.l 824832 (.bc 21736 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.b 89561 .nil))))))))))))))))))))))))))))))))) .nil))) (.c (.bc 1 (.l 127924 (.l 63962 (.bc 7675 (.bc 1 (.b 24303 .nil))) .nil) .nil)))))) .nil) (.c (.bc 1 (.l 4207128 (.l 2103564 (.l 1051782 (.bc 106043 (.bc 1 (.l 419845 (.bc 10187 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.b 30168 .nil))))))))))))))))))))))))))))))) .nil))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 1638495 (.l 819247 (.l 409623 (.bc 2861 (.bc 1 (.l 201947 (.l 100973 (.bc 8008 (.bc 1 (.b 42475 .nil))) .nil) .nil))) .nil) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 51117567 (.l 25558783 (.l 12779391 (.l 6389695 (.l 2108497 (.l 1047871 (.l 117287 (.bc 6141 (.bc 1 (.bc 48617 (.bc 1 (.b 3879 .nil))))) (.c (.bc 1 (.l 341127 (.bc 35012 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.b 13586 .nil))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 65515 (.bc 9289 (.bc 1 (.bc 16013 (.bc 1 (.b 7449 .nil))))) .nil))))))) (.c (.bc 1 (.l 6374 (.l 3187 (.bc 1283 (.bc 1 (.b 308 .nil))) .nil) .nil)))) (.c (.bc 1 (.l 1086347 (.l 543173 (.l 80938 (.bc 3329 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.b 2975 .nil))))))))))))))))))))))))) (.c (.bc 1 (.l 55325 (.bc 9890 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.b 1753 .nil))))))) (.c (.bc 1 (.l 26597 (.bc 972 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.b 4225 .nil))))))))))))))))))))) (.c (.bc 1 (.l 43775 (.bc 1776 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.b 108 .nil))))))))))))))))))))))) (.c (.bc 1 (.l 64939 (.bc 459 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil))))))))))))) .nil) .nil)))) .nil) .nil) .nil) (.c (.l 523954 (.l 261977 (.l 130988 (.l 65494 (.l 32747 (.l 16373 (.l 8186 (.c (.c (.b 4091 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))))) +def cmd_136 : Cmd := (.l 728116476 (.l 270081643 (.l 64622467 (.l 32311233 (.l 12315587 (.l 6157793 (.l 1153462 (.bc 35861 (.bc 1 (.bc 232601 (.bc 1 (.b 308263 .nil))))) (.c (.bc 1 (.l 1925432 (.bc 98714 (.bc 1 (.bc 587857 (.bc 1 (.b 276139 .nil))))) .nil)))) .nil) (.c (.bc 1 (.l 3840027 (.l 1790773 (.bc 383948 (.bc 1 (.l 511435 (.bc 237314 (.bc 1 (.b 18400 .nil))) .nil))) (.c (.bc 1 (.b 129237 .nil)))) .nil)))) .nil) (.c (.bc 1 (.l 70418351 (.bc 6420109 (.bc 1 (.l 28789063 (.l 14394531 (.l 4918161 (.l 1329631 (.bc 253461 (.bc 1 (.b 411351 .nil))) (.c (.bc 1 (.l 1129446 (.bc 176504 (.bc 1 (.b 388216 .nil))) .nil)))) (.c (.bc 1 (.l 2279101 (.l 1139550 (.bc 18760 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 41 (.bc 1 (.bc 39 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.b 33212 .nil))))))))))))))))))))))))))))) .nil) .nil)))) .nil) .nil))) .nil)))) (.c (.bc 1 (.l 93976592 (.l 45859232 (.l 20031483 (.l 1143795 (.l 571897 (.l 285948 (.bc 121825 (.bc 1 (.b 21146 .nil))) .nil) .nil) (.c (.bc 1 (.l 8871943 (.l 1509338 (.bc 149757 (.bc 1 (.l 604909 (.bc 155910 (.bc 1 (.b 146541 .nil))) .nil))) (.c (.bc 1 (.l 2856005 (.l 1428002 (.bc 189375 (.bc 1 (.bc 369509 (.bc 1 (.b 155111 .nil))))) .nil) (.c (.bc 1 (.b 70622 .nil))))))) .nil)))) (.c (.bc 1 (.l 2898130 (.l 1449065 (.l 724533 (.bc 219951 (.bc 1 (.l 142313 (.bc 53172 (.bc 1 (.b 17981 .nil))) .nil))) .nil) .nil) .nil)))) (.c (.bc 1 (.b 1129061 .nil)))) .nil)))) (.c (.bc 1 (.l 93976592 (.l 46988296 (.l 23494148 (.l 11747074 (.l 5873537 (.l 1496102 (.l 748051 (.bc 198673 (.bc 1 (.bc 155037 (.bc 1 (.b 20310 .nil))))) .nil) (.c (.bc 1 (.l 1440663 (.l 673449 (.bc 57206 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.b 47747 .nil))))))))))))))))))))))))))))) (.c (.bc 1 (.b 46879 .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil)))) +def cmd_140 : Cmd := (.l 470423306 (.l 235211653 (.l 117397450 (.l 58698725 (.l 29349362 (.l 3456660 (.l 1528544 (.l 764272 (.bc 79973 (.bc 1 (.bc 184753 (.bc 1 (.b 117404 .nil))))) .nil) (.c (.bc 1 (.b 199783 .nil)))) (.c (.bc 1 (.l 11218018 (.l 3828984 (.l 69624 (.bc 17402 (.bc 1 (.b 17407 .nil))) (.c (.bc 1 (.l 490773 (.bc 133752 (.bc 1 (.bc 100773 (.bc 1 (.b 10855 .nil))))) (.c (.bc 1 (.l 204971 (.bc 43404 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.b 518 .nil))))))))))))))))))))))))) (.c (.bc 1 (.l 81925 (.bc 36605 (.bc 1 (.b 4354 .nil))) (.c (.bc 1 (.bc 70375 (.bc 1 (.l 152765 (.bc 24100 (.bc 1 (.b 52279 .nil))) (.c (.bc 1 (.l 341591 (.bc 35232 (.bc 1 (.bc 97237 (.bc 1 (.b 38320 .nil))))) (.c (.bc 1 (.l 502447 (.bc 49191 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.b 32465 .nil))))))))))))))))))))))))))))))) .nil))))))))))))))))))))) (.c (.bc 1 (.l 1780022 (.l 137134 (.bc 6427 (.bc 1 (.bc 48617 (.bc 1 (.b 13517 .nil))))) (.c (.bc 1 (.l 752874 (.bc 35098 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.b 64 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil)))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 208373 (.l 104186 (.l 52093 (.l 26046 (.l 13023 (.l 6511 (.bc 437 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) (.c (.l 837778683 (.l 250897263 (.l 125448631 (.l 18674647 (.l 1774375 (.l 887187 (.l 443593 (.l 221796 (.c (.c (.b 110896 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 7562945 (.l 3588838 (.l 1794419 (.bc 13656 (.bc 1 (.b 883550 .nil))) .nil) (.c (.bc 1 (.b 192631 .nil)))) .nil)))) (.c (.bc 1 (.l 44049665 (.l 22024832 (.l 10820137 (.l 890208 (.bc 361580 (.bc 1 (.b 83521 .nil))) (.c (.bc 1 (.l 4519857 (.bc 1327338 (.bc 1 (.b 932587 .nil))) .nil)))) (.c (.bc 1 (.b 192276 .nil)))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 167992075 (.l 83996037 (.l 41998019 (.l 12934107 (.l 6467053 (.l 796912 (.bc 312632 (.bc 1 (.b 85821 .nil))) (.c (.bc 1 (.l 2436612 (.bc 909014 (.bc 1 (.b 309289 .nil))) .nil)))) .nil) (.c (.bc 1 (.l 8064899 (.bc 557015 (.bc 1 (.l 3475431 (.l 1737715 (.bc 190993 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 461 (.bc 1 (.bc 83 (.bc 1 (.bc 419 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.b 60869 .nil))))))))))))))))))))))))) .nil) .nil))) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 167992075 (.l 83996037 (.l 8725314 (.l 4362657 (.l 2181329 (.l 1090665 (.l 540048 (.bc 47656 (.bc 1 (.b 222365 .nil))) (.c (.bc 1 (.b 5282 .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 33272702 (.l 4795775 (.l 2397887 (.l 722303 (.l 361151 (.bc 7549 (.bc 1 (.b 173023 .nil))) .nil) (.c (.bc 1 (.b 476638 .nil)))) .nil) (.c (.bc 1 (.l 11840573 (.l 5920286 (.l 2960143 (.l 1480072 (.bc 114793 (.bc 1 (.bc 587857 (.bc 1 (.b 37380 .nil))))) .nil) .nil) .nil) .nil)))) .nil)))) .nil) .nil)))))) +def cmd_144 : Cmd := (.l 1781633000 (.l 888834140 (.l 224752588 (.l 112376294 (.l 56188147 (.l 17089165 (.bc 1964819 (.bc 1 (.l 6579760 (.l 855324 (.bc 176844 (.bc 1 (.b 250815 .nil))) (.c (.bc 1 (.l 2434553 (.bc 454612 (.bc 1 (.bc 587857 (.bc 1 (.b 174801 .nil))))) .nil)))) .nil))) (.c (.bc 1 (.l 11004906 (.l 418217 (.bc 180499 (.bc 1 (.b 28606 .nil))) (.c (.bc 1 (.l 5084233 (.l 1442837 (.bc 127620 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.b 75995 .nil))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 695747 (.bc 79040 (.bc 1 (.bc 251937 (.bc 1 (.b 16890 .nil))))) (.c (.bc 1 (.bc 286899 (.bc 1 (.b 116624 .nil))))))))) .nil)))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 219664479 (.l 51657895 (.l 20878738 (.l 10439369 (.l 3962124 (.bc 35679 (.bc 1 (.l 223143 (.bc 99421 (.bc 1 (.b 12147 .nil))) (.c (.bc 1 (.bc 494359 (.bc 1 (.l 981177 (.bc 110179 (.bc 1 (.bc 335917 (.bc 1 (.b 44486 .nil))))) (.c (.bc 1 (.b 246692 .nil))))))))))) (.c (.bc 1 (.l 1257557 (.l 628778 (.bc 84102 (.bc 1 (.bc 155037 (.bc 1 (.b 75244 .nil))))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 4950206 (.l 2475103 (.l 1237552 (.l 618776 (.bc 2273 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.b 75344 .nil))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 58174341 (.l 29087170 (.l 2813484 (.l 1406742 (.bc 140176 (.bc 1 (.l 563192 (.bc 5727 (.bc 1 (.bc 184753 (.bc 1 (.b 91110 .nil))))) .nil))) .nil) (.c (.bc 1 (.l 11730098 (.l 5865049 (.l 1724938 (.bc 93643 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.b 31011 .nil))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 1207583 (.bc 32632 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.b 294 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil)))) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 1982357 (.l 991178 (.l 495589 (.l 247794 (.l 123897 (.l 61948 (.l 30974 (.bc 693 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.l 583395209 (.l 291697604 (.l 145848802 (.l 72924401 (.l 36462200 (.l 6375123 (.l 601645 (.l 300822 (.c (.c (.b 150409 .nil))) .nil) (.c (.bc 1 (.l 2585913 (.bc 1164771 (.bc 1 (.b 128182 .nil))) .nil)))) (.c (.bc 1 (.l 11855974 (.l 5927987 (.bc 2575970 (.bc 1 (.b 388021 .nil))) .nil) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 121081332 (.l 60540666 (.l 30270333 (.l 15135167 (.l 7428085 (.bc 648775 (.bc 1 (.b 3065264 .nil))) (.c (.bc 1 (.l 139496 (.l 69748 (.bc 34873 .nil) .nil) .nil)))) .nil) .nil) .nil) .nil)))))) +def cmd_145 : Cmd := (.l 172598630 (.l 86299315 (.l 18910459 (.l 9455229 (.l 4727614 (.l 2363807 (.bc 1 (.b 1181901 .nil)) .nil) .nil) .nil) (.c (.bc 1 (.l 24239195 (.l 12119597 (.l 6059799 (.l 3029900 (.l 1514950 (.bc 363209 (.bc 1 (.b 394263 .nil))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) +def cmd_149 : Cmd := (.l 4314280394 (.l 1655572217 (.l 451906015 (.l 225953007 (.l 15809252 (.l 7904626 (.bc 2161282 (.bc 1 (.b 1791028 .nil))) .nil) (.c (.bc 1 (.l 97167248 (.l 43554899 (.l 10608554 (.l 4242441 (.bc 252035 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3541 (.bc 1 (.bc 547 (.bc 1 (.bc 505 (.bc 1 (.bc 3079 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.b 36356 .nil))))))))))))))))))))))))) (.c (.bc 1 (.l 1061833 (.bc 112865 (.bc 1 (.bc 341085 (.bc 1 (.b 76960 .nil))))) .nil)))) (.c (.bc 1 (.l 11168892 (.l 5475782 (.bc 562576 (.bc 1 (.bc 994837 (.bc 1 (.b 1180472 .nil))))) (.c (.bc 1 (.b 108661 .nil)))) .nil)))) (.c (.bc 1 (.l 5028722 (.l 2514361 (.l 1257180 (.bc 58484 (.bc 1 (.b 570103 .nil))) .nil) .nil) .nil)))) .nil)))) .nil) (.c (.bc 1 (.l 375880090 (.l 131228272 (.l 65614136 (.l 32807068 (.bc 2361084 (.bc 1 (.l 14042447 (.l 1540115 (.bc 250486 (.bc 1 (.b 519568 .nil))) (.c (.bc 1 (.l 2167195 (.bc 773719 (.bc 1 (.b 309875 .nil))) (.c (.bc 1 (.bc 982649 (.bc 1 (.l 439205 (.bc 193634 (.bc 1 (.b 25965 .nil))) (.c (.bc 1 (.bc 375449 (.bc 1 (.bc 717505 (.bc 1 (.l 799087 (.bc 67090 (.bc 1 (.b 332450 .nil))) .nil)))))))))))))))) .nil))) .nil) .nil) (.c (.bc 1 (.l 56711770 (.l 4301534 (.l 2150767 (.l 1075384 (.l 537692 (.bc 8635 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.b 25002 .nil))))))))))))))))))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 24054348 (.l 4975427 (.l 2487713 (.l 138759 (.bc 15692 (.bc 1 (.b 53684 .nil))) (.c (.bc 1 (.l 1105094 (.bc 54839 (.bc 1 (.bc 232557 (.bc 1 (.b 265145 .nil))))) .nil)))) .nil) (.c (.bc 1 (.l 7051744 (.l 1871310 (.l 935655 (.bc 141832 (.bc 1 (.b 325993 .nil))) .nil) (.c (.bc 1 (.l 1654559 (.l 574853 (.bc 261863 (.bc 1 (.b 25560 .nil))) (.c (.bc 1 (.b 252423 .nil)))) .nil)))) .nil)))) .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 501567977 (.l 250783988 (.l 125391994 (.l 62695997 (.l 23682127 (.l 11841063 (.l 3670136 (.bc 553656 (.bc 1 (.bc 705429 (.bc 1 (.b 575977 .nil))))) (.c (.bc 1 (.l 2250393 (.bc 11878 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.b 33495 .nil))))))))))))))))))))))))))))))))))) .nil)))) .nil) (.c (.bc 1 (.l 7665868 (.l 3832934 (.l 1916467 (.bc 218441 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.b 34357 .nil))))))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 501567977 (.l 250783988 (.l 125391994 (.l 62695997 (.l 31347999 (.l 15528887 (.l 3507739 (.l 825426 (.bc 301560 (.bc 1 (.b 111150 .nil))) (.c (.bc 1 (.l 928440 (.bc 140785 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.b 14144 .nil))))))))))))))))))))))))))))) .nil)))) (.c (.bc 1 (.l 4256701 (.l 2128350 (.bc 40116 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.b 712 .nil))))))))))))))))))))))))))))))))))))))))) .nil) .nil)))) (.c (.bc 1 (.b 145110 .nil)))) .nil) .nil) .nil) .nil) .nil)))) +def cmd_153 : Cmd := (.l 495288556 (.l 247644278 (.l 123822139 (.l 45049659 (.l 22524829 (.l 11262415 (.l 5631207 (.l 2815603 (.l 1407801 (.bc 44794 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.b 348 .nil))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 16861407 (.l 8430703 (.l 4215351 (.l 2107675 (.l 1053837 (.l 526918 (.bc 1009 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) (.c (.l 7457775723 (.l 2889571625 (.l 813357591 (.l 406678795 (.l 75441207 (.l 6985787 (.l 3492893 (.l 1746446 (.l 380517 (.c (.c (.b 190256 .nil))) (.c (.bc 1 (.b 492703 .nil)))) .nil) .nil) (.c (.bc 1 (.l 30734813 (.bc 11712700 (.bc 1 (.b 3654703 .nil))) .nil)))) (.c (.bc 1 (.l 127898187 (.l 63949093 (.l 24789221 (.l 1692398 (.bc 657730 (.bc 1 (.b 188466 .nil))) (.c (.bc 1 (.l 10702209 (.bc 3734041 (.bc 1 (.b 1617060 .nil))) .nil)))) (.c (.bc 1 (.l 7185323 (.l 3592661 (.bc 997944 (.bc 1 (.b 798384 .nil))) .nil) .nil)))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 631428218 (.l 309076780 (.l 154538390 (.l 12664518 (.l 6332259 (.bc 1158197 (.bc 1 (.l 2007930 (.bc 93455 (.bc 1 (.bc 692205 (.bc 1 (.b 218299 .nil))))) .nil))) .nil) (.c (.bc 1 (.l 64604674 (.l 22003615 (.l 8616190 (.bc 50890 (.bc 1 (.bc 85005 (.bc 1 (.bc 21251 (.bc 1 (.bc 4091 (.bc 1 (.bc 1055 (.bc 1 (.bc 3587 (.bc 1 (.bc 17709 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.b 749972 .nil))))))))))))))))))))))))) (.c (.bc 1 (.b 2385614 .nil)))) (.c (.bc 1 (.l 10298719 (.l 3868083 (.bc 345347 (.bc 1 (.b 1588691 .nil))) (.c (.bc 1 (.b 1281273 .nil)))) .nil)))) .nil)))) .nil) (.c (.bc 1 (.b 6637326 .nil)))) .nil)))) (.c (.bc 1 (.l 839316233 (.l 419658116 (.l 209829058 (.l 21889580 (.l 9431855 (.l 4715927 (.l 1453741 (.bc 267407 (.bc 1 (.b 459460 .nil))) (.c (.bc 1 (.b 904220 .nil)))) .nil) (.c (.bc 1 (.b 1512932 .nil)))) (.c (.bc 1 (.l 83024946 (.l 41512473 (.l 20756236 (.bc 139403 (.bc 1 (.bc 814657 (.bc 1 (.bc 1092957 (.bc 1 (.l 2193047 (.bc 579951 (.bc 1 (.b 516569 .nil))) (.c (.bc 1 (.l 4091147 (.bc 1771558 (.bc 1 (.b 274012 .nil))) (.c (.bc 1 (.b 2046892 .nil))))))))))))) .nil) .nil) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 839316233 (.l 419658116 (.l 209829058 (.l 104914529 (.l 52457265 (.l 10903222 (.l 2956140 (.l 1478070 (.bc 336917 (.bc 1 (.b 402115 .nil))) .nil) (.c (.bc 1 (.l 2495468 (.l 1247734 (.bc 578509 (.bc 1 (.b 45355 .nil))) .nil) .nil)))) (.c (.bc 1 (.l 15325407 (.l 7662703 (.l 1765468 (.bc 444956 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.b 75891 .nil))))))))))))))))))))))))))) (.c (.bc 1 (.l 2065880 (.bc 73330 (.bc 1 (.bc 341085 (.bc 1 (.b 618519 .nil))))) .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))))) +def cmd_157 : Cmd := (.l 7985902861 (.l 3992951431 (.l 1960280073 (.l 268807327 (.l 134403663 (.l 67201832 (.l 30958940 (.l 15479470 (.l 6848969 (.bc 21018 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.b 1115331 .nil))))))) (.c (.bc 1 (.l 890763 (.bc 295528 (.bc 1 (.b 149850 .nil))) .nil)))) .nil) (.c (.bc 1 (.b 2641973 .nil)))) .nil) .nil) (.c (.bc 1 (.l 711332706 (.l 203056751 (.l 45226285 (.l 22613142 (.l 11306571 (.l 5653285 (.bc 813191 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.b 37980 .nil))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 56302087 (.l 26278399 (.l 1892345 (.l 946172 (.bc 111242 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.b 126635 .nil))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 11246851 (.l 2249881 (.bc 105921 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.b 24176 .nil))))))) (.c (.bc 1 (.l 3373541 (.bc 681251 (.bc 1 (.bc 705429 (.bc 1 (.b 300084 .nil))))) .nil)))) .nil)))) (.c (.bc 1 (.b 1872641 .nil)))) .nil)))) (.c (.bc 1 (.l 152609599 (.l 76304799 (.l 38152400 (.l 19076200 (.l 6558894 (.bc 53692 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.b 136372 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 2979203 (.bc 14787 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.b 22891 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 36195640 (.l 18097820 (.l 9048910 (.l 4524455 (.l 2262228 (.l 1131114 (.l 565557 (.bc 1858 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) +def cmd_158 : Cmd := (.l 13311 (.l 6655 (.l 3327 (.l 1663 (.l 831 (.l 415 (.l 207 (.l 103 (.l 51 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 6825186421 (.l 2025763989 (.l 1012881994 (.l 506440997 (.l 253220498 (.l 45912531 (.l 21677649 (.l 2383729 (.l 1191864 (.c (.c (.b 595930 .nil))) .nil) (.c (.bc 1 (.l 8455092 (.bc 4178119 (.bc 1 (.b 49424 .nil))) .nil)))) (.c (.bc 1 (.b 1278613 .nil)))) (.c (.bc 1 (.l 80697715 (.l 40348857 (.l 16982792 (.bc 6168439 (.bc 1 (.b 2322954 .nil))) (.c (.bc 1 (.b 3191634 .nil)))) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 1386829218 (.l 693414609 (.l 155585129 (.l 77792564 (.l 38896282 (.l 19448141 (.l 9724070 (.bc 167174 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106259 (.bc 1 (.bc 25345 (.bc 1 (.bc 5149 (.bc 1 (.bc 4645 (.bc 1 (.bc 21299 (.bc 1 (.bc 85007 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.b 6986 .nil))))))))))))))))))))))))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 191122172 (.l 62882748 (.bc 10030495 (.bc 1 (.l 21410876 (.l 9743496 (.l 1454494 (.bc 210141 (.bc 1 (.b 517103 .nil))) (.c (.bc 1 (.b 3417251 .nil)))) (.c (.bc 1 (.b 961939 .nil)))) .nil))) (.c (.bc 1 (.l 32678335 (.l 16339167 (.l 8169583 (.l 4084791 (.bc 148789 (.bc 1 (.b 1893604 .nil))) .nil) .nil) .nil) .nil)))) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 1386829218 (.l 693414609 (.l 346707304 (.l 173353652 (.l 86676826 (.l 43338413 (.l 21669207 (.bc 1420535 (.bc 1 (.l 4571707 (.bc 1318636 (.bc 1 (.b 967214 .nil))) (.c (.bc 1 (.bc 2236517 (.bc 1 (.bc 1907617 (.bc 1 (.b 698216 .nil)))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))))) +def cmd_162 : Cmd := (.l 27809576384 (.l 11611644567 (.l 4060191643 (.l 831978166 (.l 415989083 (.l 207994542 (.l 19124521 (.l 9562260 (.bc 2587791 (.bc 1 (.l 2193336 (.bc 309994 (.bc 1 (.b 786671 .nil))) .nil))) .nil) (.c (.bc 1 (.l 84872747 (.l 40107717 (.bc 4090860 (.bc 1 (.l 10629317 (.bc 2576206 (.bc 1 (.b 2738449 .nil))) (.c (.bc 1 (.l 5333675 (.bc 2253834 (.bc 1 (.b 413000 .nil))) .nil)))))) (.c (.bc 1 (.b 2328653 .nil)))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 1198117652 (.l 433931579 (.l 103604919 (.bc 12945119 (.bc 1 (.l 38857337 (.l 19428668 (.l 5718735 (.bc 1309204 (.bc 1 (.b 1550160 .nil))) (.c (.bc 1 (.l 3995596 (.bc 1064843 (.bc 1 (.b 932952 .nil))) .nil)))) .nil) .nil))) (.c (.bc 1 (.l 113360867 (.l 56680433 (.l 28340217 (.l 14170108 (.bc 537987 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.b 2078434 .nil))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 165127244 (.l 82563622 (.l 19960874 (.l 9980437 (.l 1149746 (.bc 209695 (.bc 1 (.b 365175 .nil))) (.c (.bc 1 (.b 3840470 .nil)))) .nil) (.c (.bc 1 (.l 21320934 (.l 8381333 (.l 4190666 (.bc 418741 (.bc 1 (.b 1676589 .nil))) .nil) (.c (.bc 1 (.b 2279131 .nil)))) .nil)))) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 1745630637 (.l 872815318 (.l 436407659 (.l 116744296 (.l 58372148 (.l 29186074 (.l 11630495 (.bc 457780 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.b 454324 .nil))))))))) (.c (.bc 1 (.l 2962539 (.bc 35985 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.b 593083 .nil))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 101459531 (.l 50729765 (.l 25364882 (.l 12682441 (.bc 46453 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.b 307636 .nil))))))))))))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 2293143622 (.l 1146571811 (.l 534921838 (.l 267460919 (.l 128377944 (.l 9376640 (.l 4021429 (.l 2010714 (.bc 331901 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.b 56461 .nil))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 666888 (.l 333444 (.bc 52063 (.bc 1 (.b 114656 .nil))) .nil) .nil)))) (.c (.bc 1 (.l 54812329 (.l 27406164 (.l 1326255 (.bc 117900 (.bc 1 (.bc 406977 (.bc 1 (.b 138244 .nil))))) (.c (.bc 1 (.l 12376824 (.bc 449611 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.b 130018 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 5352512 (.l 2676256 (.l 1338128 (.l 669064 (.bc 21143 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.b 62658 .nil))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 38364065 (.l 19182032 (.l 9591016 (.l 4795508 (.l 2397754 (.l 1198877 (.bc 987 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.b 20476 .nil))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 161992196 (.l 80996098 (.l 40498049 (.l 20249025 (.l 10124513 (.l 5062257 (.l 2531129 (.l 1265565 (.l 632783 (.bc 18417 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) +def cmd_163 : Cmd := (.l 3954687 (.l 1977343 (.l 988671 (.l 494335 (.l 247167 (.l 123583 (.l 61791 (.l 30895 (.l 15447 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 2127196738 (.l 1063598369 (.l 531799184 (.l 265899592 (.l 87960243 (.l 43980121 (.l 21990060 (.l 9849621 (.l 559321 (.c (.c (.b 279658 .nil))) (.c (.bc 1 (.b 4365486 .nil)))) (.c (.bc 1 (.b 1145406 .nil)))) .nil) .nil) (.c (.bc 1 (.b 44989550 .nil)))) .nil) .nil) .nil) .nil))) +def cmd_167 : Cmd := (.l 52475521512 (.l 22372801501 (.l 8227755899 (.l 2061547502 (.l 1030773751 (.l 515386875 (.l 111426581 (.l 55713290 (.l 19512275 (.bc 2873429 (.bc 1 (.bc 6249097 (.bc 1 (.b 633605 .nil))))) (.c (.bc 1 (.l 8344367 (.bc 2490940 (.bc 1 (.bc 1315597 (.bc 1 (.b 365640 .nil))))) .nil)))) .nil) (.c (.bc 1 (.l 146266853 (.l 2477314 (.l 1238657 (.bc 94818 (.bc 1 (.bc 131607 (.bc 1 (.bc 30497 (.bc 1 (.bc 9797 (.bc 1 (.bc 25947 (.bc 1 (.bc 106309 (.bc 1 (.b 220335 .nil))))))))))))) .nil) (.c (.bc 1 (.l 70656109 (.l 4392232 (.bc 133863 (.bc 1 (.bc 961397 (.bc 1 (.b 1100850 .nil))))) (.c (.bc 1 (.l 6808227 (.bc 1062295 (.bc 1 (.b 2341815 .nil))) (.c (.bc 1 (.l 4144137 (.bc 1744130 (.bc 1 (.b 327935 .nil))) (.c (.bc 1 (.bc 5193627 (.bc 1 (.l 9570207 (.bc 3612765 (.bc 1 (.b 1172335 .nil))) (.c (.bc 1 (.b 5219609 .nil))))))))))))))) .nil)))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 2052330444 (.l 845125502 (.l 183246987 (.l 67049663 (.l 33524831 (.l 11693907 (.bc 5132655 (.bc 1 (.b 714295 .nil))) (.c (.bc 1 (.b 5068505 .nil)))) .nil) (.c (.bc 1 (.b 24573827 .nil)))) (.c (.bc 1 (.l 239315761 (.l 119657880 (.l 38934728 (.l 14870376 (.bc 4080319 (.bc 1 (.b 3354866 .nil))) (.c (.bc 1 (.b 4596985 .nil)))) (.c (.bc 1 (.l 20894209 (.l 10447104 (.bc 4747236 (.bc 1 (.b 476313 .nil))) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.b 181039717 .nil)))) .nil)))) (.c (.bc 1 (.l 2958644848 (.l 1479322424 (.l 739661212 (.l 212670643 (.l 65806499 (.l 32903249 (.l 8409399 (.bc 2780992 (.bc 1 (.b 1423704 .nil))) (.c (.bc 1 (.b 8042223 .nil)))) .nil) (.c (.bc 1 (.l 40528819 (.l 20264409 (.l 10132204 (.bc 1092699 (.bc 1 (.b 3973400 .nil))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 157159960 (.l 78579980 (.l 39091557 (.l 19545778 (.bc 112547 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.b 886517 .nil))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.b 198430 .nil)))) .nil) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 3864959252 (.l 1932479626 (.l 966239813 (.l 483119907 (.l 241559953 (.l 120779976 (.l 60389988 (.bc 2297229 (.bc 1 (.l 27897762 (.bc 1837767 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.b 1710511 .nil))))))) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 3864959252 (.l 1932479626 (.l 966239813 (.l 308868403 (.l 154434201 (.bc 29148414 (.bc 1 (.l 48068684 (.l 24034342 (.l 12017171 (.l 6008586 (.bc 1459998 (.bc 1 (.b 1544292 .nil))) .nil) .nil) .nil) .nil))) .nil) (.c (.bc 1 (.l 174251501 (.l 87125750 (.l 43562875 (.l 17607235 (.l 8803617 (.bc 2566699 (.bc 1 (.b 1835106 .nil))) .nil) (.c (.bc 1 (.l 4174200 (.l 2087100 (.l 1043550 (.bc 177313 (.bc 1 (.b 344459 .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil)))) +def cmd_171 : Cmd := (.l 39286970603 (.l 19643485302 (.l 9821742651 (.l 4476432659 (.l 2238216329 (.l 84752407 (.l 42376203 (.l 21188101 (.l 10594050 (.l 5297025 (.bc 2270546 (.bc 1 (.b 377964 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1034355755 (.l 277339604 (.l 138669802 (.bc 2429075 (.bc 1 (.l 66905823 (.l 25377495 (.bc 485705 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.b 37965 .nil))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 8075413 (.bc 2250162 (.bc 1 (.bc 1634377 (.bc 1 (.b 153161 .nil))))) .nil)))) .nil))) .nil) (.c (.bc 1 (.l 239838270 (.l 119919135 (.bc 2330573 (.bc 1 (.l 40256637 (.l 16835085 (.bc 244819 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.b 203540 .nil))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 3293230 (.bc 435995 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.b 252537 .nil))))))))))))))))))))))))))))))))) .nil)))) (.c (.bc 1 (.l 17372351 (.l 8686175 (.bc 154439 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.b 270301 .nil))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil)))))) .nil) .nil)))) .nil)))) .nil) (.c (.bc 1 (.l 434438664 (.l 217219332 (.l 108609666 (.l 54304833 (.l 27152417 (.l 3411138 (.l 1705569 (.bc 65616 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.b 81734 .nil))))))) .nil) (.c (.bc 1 (.l 10165068 (.l 3187589 (.bc 170202 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.b 36693 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 1894942 (.bc 26950 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) +def cmd_172 : Cmd := (.l 2095103 (.l 1047551 (.l 523775 (.l 261887 (.l 130943 (.l 65471 (.l 32735 (.l 16367 (.l 8183 (.l 4091 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 59853669223 (.l 23157721307 (.l 6381562979 (.l 3190781489 (.l 1301221365 (.l 143098787 (.l 71549393 (.l 587633 (.l 293816 (.l 146908 (.c (.c (.b 73452 .nil))) .nil) .nil) (.c (.bc 1 (.l 35187060 (.bc 485297 (.bc 1 (.bc 9337767 (.bc 1 (.l 7770460 (.bc 2416169 (.bc 1 (.b 1469058 .nil))) .nil))))) .nil)))) .nil) (.c (.bc 1 (.l 507511892 (.l 102889424 (.l 51444712 (.l 6993377 (.bc 2971089 (.bc 1 (.b 525596 .nil))) (.c (.bc 1 (.l 18728976 (.bc 1250461 (.bc 1 (.bc 592069 (.bc 1 (.bc 162107 (.bc 1 (.bc 40297 (.bc 1 (.bc 35747 (.bc 1 (.bc 132259 (.bc 1 (.bc 460511 (.bc 1 (.bc 1315599 (.bc 1 (.bc 3124547 (.bc 1 (.b 2250864 .nil))))))))))))))))))) .nil)))) .nil) (.c (.bc 1 (.l 150866519 (.l 75433259 (.bc 7754750 (.bc 1 (.l 29961877 (.bc 120856 (.bc 1 (.bc 10623467 (.bc 1 (.b 4236609 .nil))))) .nil))) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 294169376 (.l 147084688 (.l 73542344 (.l 36771172 (.bc 13033982 (.bc 1 (.b 5351601 .nil))) .nil) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 5197297671 (.l 2598648835 (.l 1299324418 (.l 315778013 (.l 157889006 (.l 78944503 (.l 39472252 (.bc 2022915 (.bc 1 (.b 17713208 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 333884193 (.l 166942096 (.l 13405270 (.l 6702635 (.bc 1602189 (.bc 1 (.b 1749126 .nil))) .nil) (.c (.bc 1 (.l 70065775 (.bc 9324325 (.bc 1 (.b 25708559 .nil))) .nil)))) .nil) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 6769113301 (.l 3384556650 (.l 1692278325 (.l 846139163 (.l 423069582 (.bc 2162737 (.bc 1 (.l 209372051 (.l 104686025 (.l 48635885 (.bc 1265284 (.bc 1 (.bc 19315397 (.bc 1 (.b 3737255 .nil))))) (.c (.bc 1 (.b 3707125 .nil)))) .nil) .nil))) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 6769113301 (.l 3384556650 (.l 1692278325 (.l 821391358 (.l 410695679 (.bc 82261924 (.bc 1 (.l 123085912 (.l 61542956 (.l 30771478 (.l 15385739 (.bc 4720127 (.bc 1 (.b 2972739 .nil))) .nil) .nil) .nil) .nil))) .nil) (.c (.bc 1 (.b 24747801 .nil)))) .nil) .nil) .nil)))))) +def cmd_176 : Cmd := (.l 156331800445 (.l 78165900223 (.l 30919195851 (.l 8797464865 (.l 4398732432 (.l 153560341 (.l 76780170 (.l 38390085 (.bc 10873067 (.bc 1 (.b 8321973 .nil))) .nil) .nil) (.c (.bc 1 (.l 2045805872 (.l 673908995 (.l 254282692 (.l 127141346 (.l 40486760 (.bc 2465283 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.b 2845458 .nil))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 23083910 (.bc 1240487 (.bc 1 (.bc 6537517 (.bc 1 (.b 3763945 .nil))))) .nil)))) .nil) (.c (.bc 1 (.l 82671802 (.l 37579618 (.l 18789809 (.bc 5150852 (.bc 1 (.b 4244050 .nil))) .nil) (.c (.bc 1 (.b 3756280 .nil)))) .nil)))) (.c (.bc 1 (.l 348993938 (.l 174496969 (.l 87248484 (.l 31132457 (.bc 5217476 (.bc 1 (.b 10348749 .nil))) (.c (.bc 1 (.l 12491782 (.bc 51846 (.bc 1 (.b 6194042 .nil))) .nil)))) .nil) .nil) .nil)))) .nil)))) .nil) (.c (.bc 1 (.l 6662133057 (.l 2523822121 (.l 210698406 (.l 105349203 (.l 52674601 (.l 18488272 (.l 9244136 (.bc 2720755 (.bc 1 (.b 1901310 .nil))) .nil) (.c (.bc 1 (.b 7849026 .nil)))) .nil) .nil) (.c (.bc 1 (.l 1051212651 (.l 525606325 (.l 262803163 (.l 53191103 (.l 26595551 (.bc 2673950 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.b 379059 .nil))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 31735859 (.l 8587521 (.bc 2235945 (.bc 1 (.b 2057812 .nil))) (.c (.bc 1 (.l 7280405 (.bc 1864695 (.bc 1 (.b 1775504 .nil))) .nil)))) (.c (.bc 1 (.l 20290137 (.l 10145068 (.bc 3216780 (.bc 1 (.b 1855751 .nil))) .nil) (.c (.bc 1 (.l 24101607 (.l 12050803 (.bc 3552557 (.bc 1 (.b 2472842 .nil))) .nil) (.c (.bc 1 (.b 2082864 .nil))))))))))))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 807244404 (.l 403622202 (.l 40067898 (.l 20033949 (.l 10016974 (.l 5008487 (.bc 1998726 (.bc 1 (.b 505514 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 161743200 (.bc 10213154 (.bc 1 (.l 70658443 (.l 24041149 (.l 4868866 (.bc 2140350 (.bc 1 (.b 294080 .nil))) (.c (.bc 1 (.l 7151705 (.bc 2320923 (.bc 1 (.b 1254926 .nil))) .nil)))) (.c (.bc 1 (.l 11288069 (.l 5644034 (.bc 216012 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.b 752380 .nil))))))))))))))))))))))))))))))))) .nil) .nil)))) .nil))) .nil)))) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 8163754258 (.l 4081877129 (.l 2040938565 (.l 354755442 (.l 177377721 (.l 88688860 (.l 44344430 (.l 13450476 (.bc 228245 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.b 2574478 .nil))))))) (.c (.bc 1 (.l 8721736 (.bc 129673 (.bc 1 (.bc 2704153 (.bc 1 (.b 1527036 .nil))))) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 665713838 (.l 332856919 (.l 166428460 (.l 13847089 (.l 5092060 (.bc 761093 (.bc 1 (.bc 1634377 (.bc 1 (.b 150554 .nil))))) (.c (.bc 1 (.l 1831481 (.bc 830069 (.bc 1 (.b 85668 .nil))) .nil)))) (.c (.bc 1 (.l 69367138 (.l 4384726 (.bc 404642 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.b 295980 .nil))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 2368131 (.bc 698855 (.bc 1 (.b 485207 .nil))) (.c (.bc 1 (.bc 754179 (.bc 1 (.bc 202407 (.bc 1 (.bc 76047 (.bc 1 (.bc 168009 (.bc 1 (.l 592773 (.bc 207753 (.bc 1 (.b 88630 .nil))) (.c (.bc 1 (.bc 1776113 (.bc 1 (.l 4440149 (.bc 434171 (.bc 1 (.bc 1293289 (.bc 1 (.b 492608 .nil))))) (.c (.bc 1 (.l 9373647 (.bc 502227 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.b 181269 .nil))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 10547358 (.bc 406586 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))))))))))))))))))))))))) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil)))) .nil) .nil) +def cmd_177 : Cmd := (.l 134215679 (.l 67107839 (.l 33553919 (.l 16776959 (.l 8388479 (.l 4194239 (.l 2097119 (.l 1048559 (.l 524279 (.l 262139 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 30416798031 (.l 2737957857 (.l 1368978928 (.l 684489464 (.l 342244732 (.l 171122366 (.l 85561183 (.l 42780591 (.l 21390295 (.l 6063069 (.c (.c (.b 3031532 .nil))) (.c (.bc 1 (.b 4632075 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 12470441155 (.l 6235220577 (.l 3117610288 (.l 1558805144 (.l 779402572 (.l 389701286 (.l 161171004 (.bc 12564964 (.bc 1 (.l 68020535 (.bc 15161228 (.bc 1 (.b 18849036 .nil))) .nil))) (.c (.bc 1 (.b 33679636 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 12470441155 (.l 6235220577 (.l 3117610289 (.l 1122216021 (.l 515145836 (.l 98744717 (.bc 9877502 (.bc 1 (.b 39494853 .nil))) (.c (.bc 1 (.l 158828198 (.l 79414099 (.l 39707050 (.l 19853525 (.bc 1327226 (.bc 1 (.b 8599534 .nil))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.b 45962171 .nil)))) (.c (.bc 1 (.b 436589120 .nil)))) .nil) .nil) .nil)))))) +def cmd_181 : Cmd := (.l 350452459634 (.l 151099204318 (.l 57123904514 (.l 15837582466 (.l 7918791233 (.l 3801837846 (.l 1609022835 (.l 804511417 (.l 281527919 (.bc 2162931 (.bc 1 (.l 138601025 (.bc 22177573 (.bc 1 (.bc 40116597 (.bc 1 (.b 7006336 .nil))))) .nil))) (.c (.bc 1 (.l 120727786 (.bc 16517360 (.bc 1 (.l 43846530 (.bc 19502698 (.bc 1 (.b 2420564 .nil))) .nil))) .nil)))) .nil) (.c (.bc 1 (.b 291896085 .nil)))) (.c (.bc 1 (.b 157557767 .nil)))) .nil) (.c (.bc 1 (.l 12724369788 (.l 3864689168 (.l 1932344584 (.l 966172292 (.l 35883829 (.l 17941914 (.l 8970957 (.bc 488037 (.bc 1 (.b 3997438 .nil))) .nil) .nil) (.c (.bc 1 (.l 447202314 (.bc 51197533 (.bc 1 (.l 170533169 (.l 30366949 (.bc 75744 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.b 1293927 .nil))))))) (.c (.bc 1 (.l 54899632 (.bc 482128 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.b 4231953 .nil))))))))))))))))))))))))))))))))))))) .nil)))) (.c (.bc 1 (.b 1870449 .nil)))))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 2497495723 (.l 1248747861 (.l 624373930 (.l 312186965 (.l 90905542 (.l 45452771 (.bc 10752751 (.bc 1 (.b 11973631 .nil))) .nil) (.c (.bc 1 (.l 52025999 (.l 26012999 (.bc 7341765 (.bc 1 (.b 5664732 .nil))) .nil) (.c (.bc 1 (.b 13161936 .nil))))))) .nil) .nil) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 18425697642 (.l 9212848821 (.l 4606424410 (.l 190117817 (.l 95058908 (.l 47529454 (.l 23764727 (.bc 1846229 (.bc 1 (.b 10036131 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 2113094385 (.l 122952198 (.l 61476099 (.bc 7465084 (.bc 1 (.l 23272963 (.l 11636481 (.bc 4038527 (.bc 1 (.b 1779711 .nil))) .nil) .nil))) .nil) (.c (.bc 1 (.l 933594991 (.l 265274729 (.bc 42076213 (.bc 1 (.l 90561148 (.l 45280574 (.bc 7016632 (.bc 1 (.bc 15452317 (.bc 1 (.b 171332 .nil))))) .nil) .nil))) (.c (.bc 1 (.l 201522763 (.bc 20166009 (.bc 1 (.l 80595369 (.bc 1985021 (.bc 1 (.l 38312660 (.bc 4418119 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.b 1968722 .nil))))))))))))))))))))))))))))))))))))) .nil))) .nil))) .nil)))) .nil)))) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 24127025496 (.l 12063512748 (.l 5967953837 (.l 2234941610 (.l 1117470805 (.l 558735403 (.l 279367702 (.l 92730900 (.l 30881917 (.bc 194425 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.b 4623060 .nil))))))) (.c (.bc 1 (.l 15483530 (.bc 4291735 (.bc 1 (.b 3450027 .nil))) .nil)))) (.c (.bc 1 (.l 46952948 (.l 23476474 (.bc 6950569 (.bc 1 (.b 4787665 .nil))) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 749035305 (.l 374517652 (.l 187258826 (.l 93629413 (.l 46814707 (.bc 1100011 (.bc 1 (.l 20030009 (.bc 5062925 (.bc 1 (.b 4952076 .nil))) (.c (.bc 1 (.b 2277327 .nil)))))) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 63802534 (.l 31901267 (.bc 14074292 (.bc 1 (.b 1876339 .nil))) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 24127025496 (.l 12063512748 (.l 6031756374 (.l 3015878187 (.l 1507939093 (.l 753969546 (.l 376984773 (.l 188492386 (.l 94246193 (.l 5310101 (.bc 2325598 (.bc 1 (.b 329449 .nil))) (.c (.bc 1 (.bc 3122313 (.bc 1 (.bc 956589 (.bc 1 (.bc 278457 (.bc 1 (.bc 244059 (.bc 1 (.bc 760785 (.bc 1 (.bc 2368889 (.bc 1 (.l 6216265 (.bc 2342511 (.bc 1 (.b 765618 .nil))) (.c (.bc 1 (.l 13813799 (.bc 3320327 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.b 1559 .nil))))))))))) (.c (.bc 1 (.l 14051812 (.bc 23736 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.b 1838655 .nil))))))))))))))))))))))))))))) .nil)))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) +def cmd_185 : Cmd := (.l 123105031171 (.l 61552515586 (.l 30776257793 (.l 15388128897 (.l 7694064449 (.l 3847032225 (.l 1923516113 (.l 305371496 (.l 152685748 (.l 49574950 (.l 12194405 (.bc 2083854 (.bc 1 (.b 4013345 .nil))) (.c (.bc 1 (.l 12593067 (.bc 978938 (.bc 1 (.b 5317592 .nil))) .nil)))) (.c (.bc 1 (.l 26767921 (.l 13383960 (.bc 90716 (.bc 1 (.bc 4992285 (.bc 1 (.b 1608973 .nil))))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 656386558 (.l 23723126 (.l 11861563 (.l 5930781 (.bc 2313535 (.bc 1 (.b 651852 .nil))) .nil) .nil) (.c (.bc 1 (.l 304470150 (.l 152235075 (.l 11040545 (.bc 1963152 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.b 232553 .nil))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 60843507 (.bc 748070 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.b 21740 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 4233480 (.bc 9263 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil))))))) .nil) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_186 : Cmd := (.l 4231167 (.l 2115583 (.l 1057791 (.l 528895 (.l 264447 (.l 132223 (.l 66111 (.l 33055 (.l 16527 (.l 8263 (.l 4131 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 529404281921 (.l 216379427955 (.l 71523585313 (.l 10752248333 (.l 5376124166 (.l 1458822499 (.l 729411249 (.l 364705624 (.l 182352812 (.l 91176406 (.l 45588203 (.c (.c (.b 22794099 .nil))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1229239581 (.l 614619790 (.l 307309895 (.l 153654948 (.bc 8805105 (.bc 1 (.l 68022366 (.bc 20655948 (.bc 1 (.b 13355232 .nil))) .nil))) .nil) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 25009544320 (.l 5408797485 (.l 2704398742 (.bc 55752555 (.bc 1 (.l 1296446813 (.l 648223406 (.bc 40736281 (.bc 1 (.l 283375419 (.l 141687709 (.bc 53209359 (.bc 1 (.b 17634492 .nil))) .nil) .nil))) .nil) .nil))) .nil) (.c (.bc 1 (.l 7095974672 (.l 3214286847 (.l 1607143423 (.l 339840618 (.l 169693732 (.bc 73188680 (.bc 1 (.b 11658183 .nil))) (.c (.bc 1 (.b 226574 .nil)))) (.c (.bc 1 (.l 463731090 (.l 231865545 (.l 115932772 (.bc 14769747 (.bc 1 (.b 43196636 .nil))) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 333700486 (.l 166850243 (.l 83425122 (.bc 31217042 (.bc 1 (.b 10495516 .nil))) .nil) .nil) .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 36666128661 (.l 18333064330 (.l 9166532165 (.l 4583266083 (.l 1478712631 (.l 739356315 (.l 134306477 (.l 67153238 (.bc 7218730 (.bc 1 (.b 26357886 .nil))) .nil) (.c (.bc 1 (.l 96417749 (.l 48208874 (.bc 16590470 (.bc 1 (.b 7513964 .nil))) .nil) (.c (.bc 1 (.l 109740927 (.bc 26922767 (.bc 1 (.l 27947693 (.bc 5270867 (.bc 1 (.b 8702976 .nil))) .nil))) (.c (.bc 1 (.l 29212996 (.l 14606498 (.bc 5110820 (.bc 1 (.b 2192426 .nil))) .nil) .nil)))))))))) .nil) (.c (.bc 1 (.l 812920407 (.l 406460203 (.l 146863342 (.l 73431671 (.bc 4023781 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.b 12940568 .nil))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 56366756 (.l 28183378 (.bc 3931998 (.bc 1 (.b 10159688 .nil))) .nil) .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 48322713002 (.l 24161356501 (.l 6121495070 (.bc 671217525 (.bc 1 (.l 2389530007 (.l 1194765003 (.l 597382502 (.l 298691251 (.l 149345625 (.l 74374907 (.bc 5428325 (.bc 1 (.b 31759125 .nil))) (.c (.bc 1 (.b 297902 .nil)))) .nil) .nil) .nil) .nil) .nil))) (.c (.bc 1 (.l 5959183178 (.l 2979591589 (.l 1251028510 (.l 625514255 (.bc 1512192 (.bc 1 (.l 311244933 (.l 35633856 (.l 17816928 (.bc 2670615 (.bc 1 (.b 6237846 .nil))) .nil) (.c (.bc 1 (.b 119988607 .nil)))) .nil))) .nil) (.c (.bc 1 (.l 238767282 (.l 119383641 (.l 59691820 (.l 29845910 (.l 14922955 (.bc 3881598 (.bc 1 (.b 3579877 .nil))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 48322713002 (.l 24161356501 (.l 12080678250 (.l 6040339125 (.l 3020169562 (.l 1510084781 (.l 755042390 (.l 377521195 (.l 188760597 (.l 79576307 (.bc 36536720 (.bc 1 (.b 3251430 .nil))) (.c (.bc 1 (.b 14803988 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))))) +def cmd_190 : Cmd := (.l 720081325087 (.l 360040662544 (.l 178133346261 (.l 39217813203 (.l 19608906601 (.l 6353496630 (.l 3176748315 (.l 1588374158 (.l 794187079 (.bc 74313784 (.bc 1 (.l 322779753 (.l 57293715 (.bc 5535844 (.bc 1 (.b 23111010 .nil))) (.c (.bc 1 (.l 60090029 (.bc 2964775 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.b 834016 .nil))))))) (.c (.bc 1 (.l 28614355 (.bc 3606129 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.b 3061823 .nil))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 11706659 (.bc 3187272 (.bc 1 (.b 2666054 .nil))) (.c (.bc 1 (.b 3685106 .nil))))))))))))) .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 3450956667 (.l 1725478333 (.l 47874511 (.l 23937255 (.l 11968628 (.bc 393799 (.bc 1 (.bc 1235049 (.bc 1 (.bc 522519 (.bc 1 (.bc 1004847 (.bc 1 (.b 2828088 .nil))))))))) .nil) .nil) (.c (.bc 1 (.l 814864652 (.l 71995375 (.l 35997687 (.bc 301588 (.bc 1 (.l 8585157 (.bc 2971905 (.bc 1 (.b 1320670 .nil))) (.c (.bc 1 (.b 9112092 .nil)))))) .nil) (.c (.bc 1 (.l 335436948 (.l 159690896 (.bc 10917974 (.bc 1 (.l 40060019 (.bc 4116610 (.bc 1 (.b 15913396 .nil))) (.c (.bc 1 (.l 28867449 (.bc 3401999 (.bc 1 (.b 11031722 .nil))) .nil)))))) (.c (.bc 1 (.b 8027575 .nil)))) .nil)))) .nil)))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 49848859924 (.l 6884226730 (.l 3442113365 (.l 1721056682 (.l 860528341 (.l 430264171 (.l 215132085 (.l 36313339 (.bc 7762580 (.bc 1 (.b 10394086 .nil))) (.c (.bc 1 (.l 71252701 (.bc 8921309 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.b 629248 .nil))))))) .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 18040203229 (.l 7953223988 (.l 256229426 (.l 128114713 (.l 64057356 (.l 32028678 (.l 16014339 (.bc 5619849 (.bc 1 (.b 2387318 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 3720382565 (.l 1860191282 (.l 318479537 (.l 159239768 (.l 16524827 (.bc 737229 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.b 1966195 .nil))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 63095054 (.bc 2119750 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.b 3574854 .nil))))))))) .nil)))) .nil) (.c (.bc 1 (.l 611616101 (.l 186662198 (.l 72632772 (.bc 6825743 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.b 1178548 .nil))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 20698324 (.bc 2743959 (.bc 1 (.bc 4992285 (.bc 1 (.b 2612912 .nil))))) .nil)))) (.c (.bc 1 (.l 119145849 (.l 59572924 (.bc 2795396 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.b 1825239 .nil))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil)))) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 1066877623 (.l 533438811 (.l 266719406 (.l 104762215 (.l 52381107 (.l 26190553 (.bc 462890 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.b 43596 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) (.c (.bc 1 (.l 28597485 (.l 14298742 (.l 7149371 (.bc 544261 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.b 106918 .nil))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil)))) .nil) .nil) .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 1886985008 (.l 943492504 (.l 471746252 (.l 235873126 (.l 117936563 (.l 58968282 (.l 29484141 (.l 14742071 (.l 7371036 (.bc 48119 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) +def cmd_191 : Cmd := (.l 575373311 (.l 287686655 (.l 143843327 (.l 71921663 (.l 35960831 (.l 17980415 (.l 8990207 (.l 4495103 (.l 2247551 (.l 1123775 (.l 561887 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 484535346257 (.l 144027438189 (.l 72013719094 (.l 36006859547 (.l 13128601843 (.l 6564300921 (.l 3282150460 (.l 427572025 (.l 213786012 (.l 106893006 (.l 33573417 (.c (.c (.b 16786706 .nil))) (.c (.bc 1 (.b 19873083 .nil)))) .nil) .nil) (.c (.bc 1 (.l 1213503202 (.bc 133995967 (.bc 1 (.bc 241219745 (.bc 1 (.l 206158679 (.l 103079339 (.bc 41440504 (.bc 1 (.b 10099162 .nil))) .nil) (.c (.bc 1 (.l 25377201 (.bc 1809624 (.bc 1 (.b 10878973 .nil))) .nil)))))))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 4874827927 (.l 2437413963 (.l 1218706982 (.l 609353491 (.bc 260440068 (.bc 1 (.b 44236674 .nil))) .nil) .nil) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 98240234936 (.l 49120117468 (.bc 1085625721 (.bc 1 (.l 23474433010 (.l 11737216505 (.l 5732881189 (.bc 246140556 (.bc 1 (.l 2620300035 (.l 1310150017 (.l 320432155 (.l 160216077 (.bc 19249941 (.bc 1 (.b 60858094 .nil))) .nil) (.c (.bc 1 (.l 334642851 (.l 159201214 (.bc 42933772 (.bc 1 (.b 36666832 .nil))) (.c (.bc 1 (.b 8120208 .nil)))) .nil)))) .nil) .nil))) (.c (.bc 1 (.b 135727060 .nil)))) .nil) .nil))) .nil) .nil)))) (.c (.bc 1 (.l 98240234936 (.l 49120117468 (.l 24560058734 (.l 12280029367 (.l 6140014683 (.l 3070007342 (.l 1535003671 (.l 357795667 (.l 178897833 (.l 89448916 (.bc 24226168 (.bc 1 (.b 20498287 .nil))) .nil) .nil) (.c (.bc 1 (.l 409706166 (.l 166455764 (.l 83227882 (.bc 19561730 (.bc 1 (.bc 20030007 (.bc 1 (.b 2022198 .nil))))) .nil) (.c (.bc 1 (.l 38397316 (.l 19198658 (.bc 6562088 (.bc 1 (.b 3037238 .nil))) .nil) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))))) +def cmd_195 : Cmd := (.l 2193399794659 (.l 905138417213 (.l 303339799348 (.l 52358012350 (.l 26179006175 (.l 6294209839 (.l 3147104919 (.l 1573552459 (.l 786776229 (.l 393388114 (.l 196694057 (.bc 84319 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.bc 26246217 (.bc 1 (.bc 42948357 (.bc 1 (.b 4428449 .nil))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 6795293246 (.l 3397646623 (.l 1698823312 (.l 849411656 (.l 424705828 (.bc 7333483 (.bc 1 (.l 205019428 (.bc 52748315 (.bc 1 (.b 49761396 .nil))) .nil))) .nil) .nil) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 99311887321 (.l 8235699243 (.l 4117849621 (.l 2058924811 (.l 1029462405 (.l 514731202 (.bc 86854610 (.bc 1 (.l 170510988 (.l 33794312 (.bc 3409268 (.bc 1 (.b 13487885 .nil))) (.c (.bc 1 (.b 51461179 .nil)))) .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 41420244414 (.l 20259884829 (.l 6082403433 (.l 610744645 (.bc 226190422 (.bc 1 (.b 79181897 .nil))) (.c (.bc 1 (.l 2430457068 (.l 1215228534 (.l 607614267 (.l 41540369 (.bc 2843180 (.bc 1 (.b 17927001 .nil))) (.c (.bc 1 (.bc 88704387 (.bc 1 (.l 40321017 (.bc 12605119 (.bc 1 (.b 7555386 .nil))) (.c (.bc 1 (.bc 15785567 (.bc 1 (.bc 5313957 (.bc 1 (.bc 1757571 (.bc 1 (.bc 1527369 (.bc 1 (.bc 4134527 (.bc 1 (.bc 11714837 (.bc 1 (.bc 28615227 (.bc 1 (.l 60090089 (.bc 18863581 (.bc 1 (.b 11181460 .nil))) (.c (.bc 1 (.b 4302183 .nil)))))))))))))))))))))))))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 4047538978 (.l 2023769489 (.l 570205899 (.l 200715859 (.l 100357929 (.bc 29615803 (.bc 1 (.b 20563158 .nil))) .nil) (.c (.bc 1 (.l 84387087 (.bc 4594484 (.bc 1 (.l 37599056 (.bc 3385814 (.bc 1 (.bc 13813797 (.bc 1 (.b 1599911 .nil))))) .nil))) .nil)))) (.c (.bc 1 (.l 441678842 (.l 220839421 (.l 110419711 (.bc 4616296 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.b 13969503 .nil))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.b 450237375 .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 149229409255 (.l 58814039840 (.l 19845349562 (.l 9922674781 (.l 4961337391 (.l 2480668696 (.l 626530965 (.l 313265482 (.l 10897761 (.bc 5071325 (.bc 1 (.b 377552 .nil))) (.c (.bc 1 (.l 145734977 (.bc 34390163 (.bc 1 (.b 38477322 .nil))) .nil)))) .nil) (.c (.bc 1 (.l 613803380 (.l 306901690 (.l 93784719 (.bc 1639274 (.bc 1 (.bc 40116597 (.bc 1 (.b 5136482 .nil))))) (.c (.bc 1 (.l 59666123 (.bc 29631233 (.bc 1 (.b 201825 .nil))) .nil)))) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 9561670355 (.l 4780835177 (.l 2390417588 (.l 1089655244 (.bc 35527527 (.bc 1 (.l 447378427 (.l 223689213 (.l 111844607 (.bc 21433021 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.b 603838 .nil))))))))))))))))))))))))))))))))))))) .nil) .nil) (.c (.bc 1 (.l 61921662 (.l 7185189 (.l 3592594 (.bc 711759 (.bc 1 (.b 1084535 .nil))) .nil) (.c (.bc 1 (.l 23775639 (.l 11887819 (.bc 2040011 (.bc 1 (.b 3903896 .nil))) .nil) .nil)))) .nil)))))) (.c (.bc 1 (.l 105553547 (.l 52776773 (.l 26388386 (.l 13194193 (.bc 2345201 (.bc 1 (.b 4251893 .nil))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 15800664784 (.l 7900332392 (.l 3950166196 (.l 1975083098 (.l 987541549 (.l 377277513 (.l 188638756 (.l 81778125 (.bc 6371574 (.bc 1 (.bc 15452317 (.bc 1 (.b 19065165 .nil))))) (.c (.bc 1 (.l 12541250 (.bc 250230 (.bc 1 (.b 6020392 .nil))) .nil)))) .nil) (.c (.bc 1 (.b 116493258 .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 191561480114 (.l 95780740057 (.l 47890370029 (.l 23945185015 (.l 11972592508 (.l 4799703683 (.l 2399851841 (.l 629453787 (.l 314726893 (.l 157363446 (.bc 219147 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.b 7515277 .nil))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) (.c (.bc 1 (.l 570472131 (.l 285236065 (.l 111207024 (.bc 1399520 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.b 1168185 .nil))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 31411006 (.bc 3824098 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.b 1480802 .nil))))))) .nil)))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 1186592568 (.l 593296284 (.l 296648142 (.l 148324071 (.l 74162036 (.bc 2441707 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) +def cmd_196 : Cmd := (.l 8342282239 (.l 4171141119 (.l 2085570559 (.l 1042785279 (.l 521392639 (.l 260696319 (.l 130348159 (.l 65174079 (.l 32587039 (.l 16293519 (.l 8146759 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 6828619911 (.l 3414309955 (.l 1707154977 (.l 853577488 (.l 426788744 (.l 213394372 (.l 106697186 (.l 53348593 (.l 26674296 (.l 13337148 (.l 6668574 (.c (.c (.b 3334285 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 199146931189 (.l 99573465594 (.l 49786732797 (.l 24893366398 (.l 12446683199 (.l 2667951135 (.l 1333975567 (.l 666987783 (.l 230710499 (.bc 56479379 (.bc 1 (.b 58875867 .nil))) (.c (.bc 1 (.b 102783390 .nil)))) .nil) .nil) (.c (.bc 1 (.l 3555390461 (.l 1777695230 (.l 888847615 (.l 444423808 (.l 222211904 (.bc 87083498 (.bc 1 (.b 24022451 .nil))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))))) +def cmd_200 : Cmd := (.l 4020858163876 (.l 1613140535872 (.l 510188418123 (.l 59619055501 (.l 29809527750 (.l 5960057171 (.l 2980028585 (.l 1490014292 (.bc 741870414 (.bc 1 (.b 3136729 .nil))) .nil) .nil) (.c (.bc 1 (.l 8944706701 (.l 4472353350 (.l 2236176675 (.l 1118088338 (.l 559044169 (.l 279522085 (.bc 122371353 (.bc 1 (.b 17389686 .nil))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 195475153557 (.l 11144470043 (.l 5572235021 (.l 2786117510 (.l 1393058755 (.l 696529378 (.bc 161553265 (.bc 1 (.l 186711421 (.bc 63841290 (.bc 1 (.b 29514417 .nil))) .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 86593106732 (.l 43296553366 (.l 21648276683 (.l 7618301469 (.l 2833677568 (.l 1416838784 (.l 665232782 (.bc 68530589 (.bc 1 (.bc 109254597 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.b 15833903 .nil))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.b 43186607 .nil)))) .nil) (.c (.bc 1 (.l 975473163 (.l 471322942 (.l 235661471 (.bc 2632808 (.bc 1 (.bc 69194577 (.bc 1 (.b 46003344 .nil))))) .nil) (.c (.bc 1 (.b 16413636 .nil)))) .nil)))) (.c (.bc 1 (.l 3205836870 (.l 1602918435 (.l 801459218 (.l 164530780 (.bc 53685113 (.bc 1 (.b 28580274 .nil))) (.c (.bc 1 (.l 236198826 (.bc 107147551 (.bc 1 (.b 10951859 .nil))) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 296381849810 (.l 94085535384 (.l 35434596766 (.l 7578080478 (.l 848847029 (.l 424423514 (.l 212211757 (.l 106105878 (.bc 21850193 (.bc 1 (.b 31202743 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 2940193207 (.l 1470096603 (.bc 198502457 (.bc 1 (.l 536545841 (.l 268272920 (.bc 48197048 (.bc 1 (.bc 56106587 (.bc 1 (.bc 21099527 (.bc 1 (.bc 7071531 (.bc 1 (.b 1661755 .nil))))))))) .nil) .nil))) .nil) .nil)))) (.c (.bc 1 (.l 10139217902 (.l 5069608951 (.l 2534804476 (.l 1237274547 (.l 618637273 (.bc 1623188 (.bc 1 (.bc 5661899 (.bc 1 (.bc 15849367 (.bc 1 (.l 40330067 (.bc 14190919 (.bc 1 (.b 5974111 .nil))) (.c (.bc 1 (.bc 88705319 (.bc 1 (.b 157148782 .nil)))))))))))) .nil) (.c (.bc 1 (.b 30127688 .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 11608170923 (.l 5804085461 (.l 2902042730 (.l 1451021365 (.l 725510682 (.l 362755341 (.bc 4663986 (.bc 1 (.l 176713681 (.bc 20118396 (.bc 1 (.b 68238441 .nil))) .nil))) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 54105389518 (.l 27052694759 (.l 13526347380 (.l 6763173690 (.l 3381586845 (.l 341070966 (.bc 45739624 (.bc 1 (.b 124795856 .nil))) (.c (.bc 1 (.l 939354381 (.l 469677190 (.bc 20259625 (.bc 1 (.l 214578967 (.bc 14725700 (.bc 1 (.b 92563780 .nil))) .nil))) .nil) (.c (.bc 1 (.l 410368069 (.l 205184034 (.l 102592017 (.bc 11228086 (.bc 1 (.b 40067919 .nil))) .nil) .nil) .nil))))))) .nil) .nil) .nil) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 397288546063 (.l 198644273031 (.l 99322136515 (.l 49661068258 (.l 24830534129 (.l 12415267064 (.l 2171811880 (.l 827554930 (.l 413777465 (.l 95335162 (.bc 29126658 (.bc 1 (.b 18540920 .nil))) (.c (.bc 1 (.l 111553567 (.bc 21519095 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.b 280237 .nil))))))))))))))))))))))))))))))))))) .nil)))) .nil) (.c (.bc 1 (.l 258351007 (.l 129175503 (.l 64587752 (.bc 2087839 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.b 10176024 .nil))))))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 4035821649 (.l 1644688148 (.l 822344074 (.l 354223727 (.bc 16070193 (.bc 1 (.bc 42948357 (.bc 1 (.bc 60843507 (.bc 1 (.b 57249797 .nil))))))) (.c (.bc 1 (.l 56948307 (.bc 17634518 (.bc 1 (.b 10839632 .nil))) .nil)))) .nil) (.c (.bc 1 (.l 373222673 (.bc 168664054 (.bc 1 (.b 17947279 .nil))) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 397288546063 (.l 198644273031 (.l 99322136516 (.l 49661068258 (.l 24830534129 (.l 12415267064 (.l 5581773693 (.l 2790886846 (.l 1395443423 (.l 697721712 (.l 348860856 (.bc 22740730 (.bc 1 (.bc 74884317 (.bc 1 (.bc 60843507 (.bc 1 (.b 15961865 .nil))))))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 625859836 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil)))) +def cmd_204 : Cmd := (.l 2430645586569 (.l 1215322793285 (.l 607661396643 (.l 53421092737 (.l 26710546368 (.l 13001217020 (.l 3794109554 (.l 1897054777 (.l 948527388 (.l 474263694 (.l 237131847 (.l 62849315 (.bc 7428372 (.bc 1 (.b 23996282 .nil))) (.c (.bc 1 (.l 55716606 (.bc 2249933 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.b 1416733 .nil))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 2706498953 (.l 1353249476 (.l 676624738 (.l 338312369 (.l 169156185 (.l 84578092 (.bc 359324 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.b 11243349 .nil))))))))) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.b 354056161 .nil)))) .nil) (.c (.bc 1 (.l 250409605582 (.l 23663324616 (.l 11831662308 (.l 5915831154 (.l 2957915577 (.l 1478957789 (.bc 37564687 (.bc 1 (.l 701914205 (.l 350957102 (.l 175478551 (.bc 7370788 (.bc 1 (.bc 34767717 (.bc 1 (.bc 40116597 (.bc 1 (.b 5484164 .nil))))))) .nil) .nil) .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 101541478172 (.l 50770739086 (.l 25385369543 (.l 12692684772 (.l 865898375 (.l 432949187 (.l 216474594 (.l 108237297 (.bc 34632433 (.bc 1 (.b 19486213 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 5480444008 (.l 2580317963 (.l 276849959 (.l 138424979 (.bc 15281504 (.bc 1 (.bc 26075787 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.b 1608973 .nil))))))))) .nil) (.c (.bc 1 (.l 1013309019 (.l 23721559 (.bc 2831173 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.b 1390381 .nil))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 482932947 (.bc 4858714 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.b 1951042 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil)))) (.c (.bc 1 (.l 159904038 (.l 79952019 (.l 39976010 (.bc 337086 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil)))) .nil)))) .nil) .nil) .nil) .nil)))) .nil)))) .nil) .nil) .nil) +def cmd_205 : Cmd := (.l 2140635135 (.l 1070317567 (.l 535158783 (.l 267579391 (.l 133789695 (.l 66894847 (.l 33447423 (.l 16723711 (.l 8361855 (.l 4180927 (.l 2090463 (.l 1045231 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 4857037576249 (.l 1655283977157 (.l 252548792485 (.l 126274396242 (.l 63137198121 (.l 31568599060 (.l 15784299530 (.l 7892149765 (.l 2151731967 (.l 1075865983 (.l 537932991 (.l 6410857 (.c (.c (.b 3205426 .nil))) (.c (.bc 1 (.b 262555635 .nil)))) .nil) .nil) (.c (.bc 1 (.l 1794342912 (.l 897171456 (.bc 4333969 (.bc 1 (.l 444251756 (.bc 147783525 (.bc 1 (.b 74342350 .nil))) .nil))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 575093196090 (.l 166071573007 (.l 83035786503 (.l 41309185598 (.l 20654592799 (.l 4388289508 (.l 2194144754 (.l 1097072377 (.l 548536189 (.bc 207898697 (.bc 1 (.b 66369394 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 5939006888 (.l 774438539 (.l 387219269 (.bc 153544936 (.bc 1 (.b 40064696 .nil))) .nil) (.c (.bc 1 (.l 2195064902 (.l 787158065 (.l 393579032 (.bc 6170415 (.bc 1 (.bc 88704327 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.bc 11705847 (.bc 1 (.b 21358846 .nil))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 310374383 (.l 155187191 (.bc 7255450 (.bc 1 (.bc 60090027 (.bc 1 (.b 10248113 .nil))))) .nil) .nil)))) .nil)))) .nil)))) .nil) (.c (.bc 1 (.b 208707650 .nil)))) .nil) (.c (.bc 1 (.l 121475025035 (.bc 333136098 (.bc 1 (.l 60404376416 (.l 30202188208 (.bc 1118367625 (.bc 1 (.l 13982726476 (.l 6991363238 (.l 348963457 (.l 174481728 (.bc 39178436 (.bc 1 (.b 48062425 .nil))) .nil) (.c (.bc 1 (.l 2036063721 (.l 1018031860 (.l 339012003 (.bc 14573380 (.bc 1 (.b 154932618 .nil))) (.c (.bc 1 (.l 170003924 (.bc 18053827 (.bc 1 (.b 66948132 .nil))) .nil)))) .nil) (.c (.bc 1 (.l 1110654435 (.l 555327217 (.bc 15128072 (.bc 1 (.bc 77206117 (.bc 1 (.bc 28171061 (.bc 1 (.bc 10356477 (.bc 1 (.bc 8946845 (.bc 1 (.bc 21511269 (.bc 1 (.bc 56179437 (.bc 1 (.b 60164309 .nil))))))))))))))) .nil) .nil))))))) .nil) .nil))) .nil) .nil))) .nil)))) .nil)))) (.c (.bc 1 (.l 773234810964 (.l 386617405482 (.l 193308702741 (.l 96654351370 (.l 48327175685 (.l 24163587842 (.l 12081793921 (.l 1066622948 (.l 533311474 (.l 68871080 (.bc 33739761 (.bc 1 (.b 695776 .nil))) (.c (.bc 1 (.b 197784654 .nil)))) .nil) (.c (.bc 1 (.l 3140962159 (.l 1570481079 (.bc 60265358 (.bc 1 (.l 451585743 (.bc 161124561 (.bc 1 (.b 64668307 .nil))) (.c (.bc 1 (.b 273389433 .nil)))))) .nil) (.c (.bc 1 (.l 1833311848 (.bc 342058723 (.bc 1 (.l 574597198 (.l 250328402 (.bc 23357330 (.bc 1 (.b 101806868 .nil))) (.c (.bc 1 (.b 36970194 .nil)))) .nil))) .nil))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 773234810964 (.l 386617405482 (.l 193308702741 (.l 96654351371 (.l 48327175686 (.l 24163587843 (.l 12081793922 (.bc 128318499 (.bc 1 (.l 5912578459 (.l 2802968378 (.l 1401484189 (.l 700742095 (.bc 162533474 (.bc 1 (.b 187837570 .nil))) .nil) .nil) (.c (.bc 1 (.b 153320848 .nil)))) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))))) +def cmd_209 : Cmd := (.l 10488525524699 (.l 5143201496449 (.l 1487618456888 (.l 35773202009 (.l 17886601004 (.l 8943300502 (.l 4471650251 (.l 2235825125 (.l 1117912562 (.l 558956281 (.l 279478140 (.l 139739070 (.bc 32517020 (.bc 1 (.b 37352512 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 708036026432 (.l 72319173721 (.l 36159586860 (.l 18079793430 (.l 9039896715 (.l 4519948357 (.l 2259974178 (.l 1129987089 (.bc 11049813 (.bc 1 (.l 553943729 (.bc 130109027 (.bc 1 (.bc 109254597 (.bc 1 (.b 37608234 .nil))))) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 281698839492 (.l 11566031321 (.l 5783015660 (.l 2891507830 (.l 1445753915 (.l 722876958 (.l 361438479 (.l 180719239 (.bc 22481793 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.b 9000568 .nil))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 129283388422 (.l 11069947678 (.l 3189162897 (.l 1594581448 (.l 797290724 (.l 398645362 (.l 199322681 (.bc 11029439 (.bc 1 (.bc 40060017 (.bc 1 (.b 48571878 .nil))))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 2345810939 (.l 1172905469 (.l 586452735 (.l 153565438 (.l 76782719 (.bc 20622699 (.bc 1 (.b 17768658 .nil))) .nil) (.c (.bc 1 (.b 139660927 .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 53571746530 (.l 26785873265 (.l 3030761346 (.l 1433709951 (.l 716854975 (.bc 50846604 (.bc 1 (.l 307580881 (.bc 25684673 (.bc 1 (.b 128105764 .nil))) .nil))) .nil) (.c (.bc 1 (.l 81670719 (.l 40835359 (.l 20417679 (.bc 7622062 (.bc 1 (.b 2586774 .nil))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 10362175284 (.l 5181087642 (.l 2590543821 (.l 874162215 (.bc 152530742 (.bc 1 (.bc 155117517 (.bc 1 (.b 129432842 .nil))))) (.c (.bc 1 (.l 421109692 (.bc 6294983 (.bc 1 (.bc 103791867 (.bc 1 (.bc 69194577 (.bc 1 (.b 31273410 .nil))))))) .nil)))) .nil) .nil) .nil)))) .nil) .nil)))) .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 1083982291333 (.l 336630981669 (.l 168315490834 (.l 84157745417 (.l 42078872708 (.l 21039436354 (.l 2041288757 (.l 1020644378 (.l 224041142 (.l 112020571 (.bc 8786607 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.b 4661937 .nil))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 286281044 (.l 143140522 (.bc 9151859 (.bc 1 (.bc 26246217 (.bc 1 (.b 36172179 .nil))))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 7633455939 (.l 1840350738 (.l 920175369 (.l 455174650 (.bc 6776178 (.bc 1 (.bc 60843507 (.bc 1 (.bc 74884317 (.bc 1 (.bc 80233197 (.bc 1 (.b 4850114 .nil))))))))) (.c (.bc 1 (.b 4913032 .nil)))) .nil) (.c (.bc 1 (.l 1976377228 (.l 988188614 (.l 494094307 (.bc 67577685 (.bc 1 (.bc 60843507 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.b 9649882 .nil))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 844973475 (.l 422486737 (.l 211243368 (.l 105621684 (.bc 7222685 (.bc 1 (.bc 26075787 (.bc 1 (.b 19512364 .nil))))) .nil) .nil) .nil) .nil))))))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 205360163994 (.l 60221880426 (.l 30110940213 (.l 15055470106 (.l 7527735053 (.l 3763867526 (.l 1881933763 (.l 378062950 (.l 189031475 (.bc 15255353 (.bc 1 (.bc 40116597 (.bc 1 (.b 39143781 .nil))))) .nil) (.c (.bc 1 (.l 562903929 (.l 149210696 (.bc 972815 (.bc 1 (.bc 34767717 (.bc 1 (.bc 26075787 (.bc 1 (.b 12789020 .nil))))))) (.c (.bc 1 (.l 132241265 (.bc 4083545 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.b 8259172 .nil))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 42458201568 (.l 21229100784 (.l 10614550392 (.bc 7071143 (.bc 1 (.l 5300204050 (.l 294216878 (.l 147108439 (.l 73554220 (.l 36777110 (.bc 10835251 (.bc 1 (.b 7553301 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 2355885144 (.l 1177942572 (.l 588971286 (.l 294485643 (.bc 13247896 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.b 1097022 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil)))) .nil))) .nil) .nil) .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 101061265898 (.l 50530632949 (.l 25265316475 (.l 12632658238 (.l 6316329119 (.l 3158164560 (.l 1579082280 (.l 789541140 (.l 394770570 (.l 197385285 (.l 98692643 (.bc 3895263 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) +def cmd_210 : Cmd := (.l 31067111423 (.l 15533555711 (.l 7766777855 (.l 3883388927 (.l 1941694463 (.l 970847231 (.l 485423615 (.l 242711807 (.l 121355903 (.l 60677951 (.l 30338975 (.l 15169487 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 2137390010368 (.l 1068695005184 (.l 534347502592 (.l 267173751296 (.l 133586875648 (.l 6305420339 (.l 3152710169 (.l 1576355084 (.l 788177542 (.l 394088771 (.l 197044385 (.l 98522192 (.c (.c (.b 49261094 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 60488017482 (.l 11430635692 (.l 5715317846 (.l 158381377 (.l 79190688 (.l 39595344 (.bc 18416909 (.bc 1 (.b 1380760 .nil))) .nil) .nil) (.c (.bc 1 (.l 2699277543 (.l 1349638771 (.bc 165290265 (.bc 1 (.b 509529118 .nil))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 18813373046 (.l 9406686523 (.l 2618962001 (.l 1189905996 (.l 587180015 (.bc 112795223 (.bc 1 (.b 180794781 .nil))) (.c (.bc 1 (.b 7772980 .nil)))) (.c (.bc 1 (.b 119575001 .nil)))) (.c (.bc 1 (.l 2084381258 (.l 1042190629 (.l 504645946 (.bc 43473933 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.b 2690357 .nil))))))))) (.c (.bc 1 (.l 16449366 (.bc 4041350 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 63 (.bc 1 (.bc 61 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 (.bc 1 (.bc 62927 (.bc 1 (.bc 339819 (.bc 1 (.bc 1472559 .nil))))))))))))))))))))))))) .nil)))) .nil) .nil)))) .nil) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil))) +def cmd_211 : Cmd := (.l 549277458881 (.l 274638729440 (.l 137319364720 (.l 68659682360 (.l 34329841180 (.l 17164920590 (.l 8582460295 (.l 4291230147 (.l 2145615073 (.l 1072807536 (.l 245888751 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.b 61587623 .nil)))))))) (.c (.bc 1 (.l 105377181 (.bc 27116702 (.bc 1 (.b 25571885 .nil))) (.c (.bc 1 (.bc 38527541 (.bc 1 (.bc 19303325 (.bc 1 (.bc 30458117 (.bc 1 (.bc 77690709 (.bc 1 (.b 19158126 .nil))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1459928556234 (.l 729964278117 (.l 364982139058 (.l 182491069529 (.l 91245534764 (.l 45622767382 (.l 22811383691 (.l 11405691846 (.l 3611405308 (.l 1805702654 (.l 166056703 (.bc 51203825 (.bc 1 (.b 31824523 .nil))) (.c (.bc 1 (.bc 387085405 (.bc 1 (.l 349709213 (.bc 56873818 (.bc 1 (.b 117980785 .nil))) .nil)))))) .nil) (.c (.bc 1 (.l 2091440612 (.l 1045720306 (.bc 359926545 (.bc 1 (.b 162933605 .nil))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) +def cmd_215 : Cmd := (.l 24005626600564 (.l 9339437938953 (.l 2693037353417 (.l 56530805919 (.l 28265402959 (.l 14132701479 (.l 7066350740 (.l 3533175370 (.l 1766587685 (.l 883293843 (.l 441646921 (.l 220823460 (.bc 33095285 (.bc 1 (.b 77316442 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1289987870786 (.l 230781289088 (.l 115390644544 (.l 57695322272 (.l 28847661136 (.bc 3304059579 (.bc 1 (.l 11119770986 (.l 5559885493 (.l 2721595160 (.bc 349568432 (.bc 1 (.l 1011229145 (.bc 71760663 (.bc 1 (.b 433853906 .nil))) .nil))) (.c (.bc 1 (.b 58347583 .nil)))) .nil) .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 414212646302 (.l 94710441802 (.l 47355220901 (.l 23677610451 (.l 11838805225 (.bc 1026371418 (.bc 1 (.l 4893031191 (.l 2446515595 (.l 340622605 (.bc 24343156 (.bc 1 (.b 145968143 .nil))) (.c (.bc 1 (.b 882635189 .nil)))) .nil) .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 112395881346 (.l 46627608871 (.l 19024763579 (.l 8239329393 (.l 4119664696 (.l 2059832348 (.l 1029916174 (.bc 13794647 (.bc 1 (.b 501163437 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 1273052393 (.l 636526196 (.l 318263098 (.l 159131549 (.bc 29201610 (.bc 1 (.b 50364161 .nil))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 4289040853 (.l 2144520426 (.l 1072260213 (.l 536130107 (.bc 2633724 (.bc 1 (.b 265431327 .nil))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.b 9570331799 .nil)))) .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 1976681616056 (.l 766559201951 (.l 383279600975 (.l 191639800488 (.l 95819900244 (.l 47909950122 (.l 14226764211 (.l 2718561385 (.l 1359280692 (.l 679640346 (.bc 78573024 (.bc 1 (.b 261247146 .nil))) .nil) .nil) (.c (.bc 1 (.l 4394820717 (.l 230171301 (.l 115085650 (.bc 20993901 (.bc 1 (.b 36548921 .nil))) .nil) (.c (.bc 1 (.l 1967239054 (.l 974376022 (.bc 132795705 (.bc 1 (.bc 88704327 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.bc 11705847 (.bc 1 (.bc 28614297 (.bc 1 (.bc 60090027 (.bc 1 (.b 96427721 .nil))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.b 9243502 .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 9728210847 (.l 4864105423 (.l 2432052712 (.l 1216026356 (.bc 8205123 (.bc 1 (.bc 172986447 (.bc 1 (.bc 239519697 (.bc 1 (.b 187301902 .nil))))))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 221781606074 (.l 110890803037 (.l 55445401518 (.l 27722700759 (.l 13861350380 (.l 2811838548 (.l 1405919274 (.l 702959637 (.l 351479819 (.bc 103543445 (.bc 1 (.b 72196461 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 4118836639 (.l 2059418319 (.l 1029709159 (.l 514854580 (.bc 238038576 (.bc 1 (.b 19388711 .nil))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 2663375361326 (.l 1331687680663 (.l 665843840331 (.l 142281754132 (.l 71140877066 (.l 35570438533 (.l 17785219266 (.l 5001097924 (.l 2500548962 (.bc 363927015 (.bc 1 (.l 886347463 (.bc 60038451 (.bc 1 (.l 383135277 (.bc 150455654 (.bc 1 (.b 41111981 .nil))) .nil))) .nil))) .nil) (.c (.bc 1 (.l 3891511706 (.l 1945755853 (.l 972877927 (.l 486438963 (.bc 198407715 (.bc 1 (.b 44811763 .nil))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 190640166031 (.l 95320083015 (.l 47660041508 (.l 13663127088 (.l 5640068949 (.bc 29074211 (.bc 1 (.l 2790960260 (.l 1395480130 (.l 697740065 (.bc 124540407 (.bc 1 (.bc 109254597 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.b 4692027 .nil))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil))) (.c (.bc 1 (.l 1191494592 (.l 595747296 (.l 297873648 (.l 148936824 (.bc 3892260 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.b 10486119 .nil))))))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 10166893663 (.l 5083446831 (.l 2541723415 (.l 1072802660 (.l 350796953 (.bc 58708458 (.bc 1 (.bc 103791867 (.bc 1 (.b 12898145 .nil))))) (.c (.bc 1 (.b 185604374 .nil)))) (.c (.bc 1 (.l 198059045 (.l 99029522 (.bc 30027492 (.bc 1 (.b 19487266 .nil))) .nil) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 2663375361326 (.l 1331687680663 (.l 665843840331 (.l 332921920165 (.l 166460960083 (.l 34451936337 (.l 17225968168 (.l 8612984084 (.l 4306492042 (.l 2153246021 (.l 1076623010 (.l 538311505 (.bc 135630251 (.bc 1 (.b 133525498 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 48778543702 (.l 24389271851 (.l 12194635925 (.l 2578207719 (.l 1289103859 (.l 644551929 (.l 322275964 (.bc 21592018 (.bc 1 (.bc 135727827 (.bc 1 (.b 3818131 .nil))))) .nil) .nil) .nil) (.c (.bc 1 (.l 3519110240 (.l 1759555120 (.l 879777560 (.l 439888780 (.bc 99973736 (.bc 1 (.bc 69194577 (.bc 1 (.bc 40060017 (.bc 1 (.b 10716051 .nil))))))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) +def cmd_219 : Cmd := (.l 8962835090031 (.l 4481417545016 (.l 2240708772508 (.l 317793450119 (.l 158896725059 (.l 79448362530 (.l 39724181265 (.l 6879348484 (.l 3439674242 (.l 1719837121 (.l 859918560 (.l 153665175 (.l 52508248 (.bc 9313956 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.b 624647 .nil))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 24324336 (.bc 5591558 (.bc 1 (.b 6570607 .nil))) .nil)))) (.c (.bc 1 (.l 276294102 (.l 138147051 (.bc 7243189 (.bc 1 (.bc 26246217 (.bc 1 (.b 35584113 .nil))))) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 12982742145 (.l 6491371072 (.l 3245685536 (.l 1622842768 (.l 811421384 (.l 405710692 (.bc 7364244 (.bc 1 (.bc 60843507 (.bc 1 (.bc 74884317 (.bc 1 (.b 59763269 .nil))))))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 802560936132 (.l 401280468066 (.l 200640234033 (.l 100320117017 (.l 50160058509 (.l 25080029255 (.l 10569789901 (.l 4538045085 (.l 581200078 (.l 290600039 (.bc 20469928 (.bc 1 (.bc 74884317 (.bc 1 (.b 49945769 .nil))))) .nil) (.c (.bc 1 (.l 834544549 (.l 287550755 (.bc 10897737 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.b 7028993 .nil))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 129721516 (.bc 19046792 (.bc 1 (.bc 34767717 (.bc 1 (.b 11046243 .nil))))) .nil)))) (.c (.bc 1 (.l 367715301 (.l 183857650 (.bc 29070353 (.bc 1 (.bc 40116597 (.bc 1 (.b 22741869 .nil))))) .nil) (.c (.bc 1 (.l 143904725 (.l 71952362 (.bc 12025847 (.bc 1 (.b 23950331 .nil))) .nil) (.c (.bc 1 (.l 57830869 (.l 28915434 (.bc 2125455 (.bc 1 (.b 12332259 .nil))) .nil) (.c (.bc 1 (.l 49761445 (.l 24880722 (.bc 4540307 (.bc 1 (.b 7900051 .nil))) .nil) (.c (.bc 1 (.l 108148829 (.l 54074414 (.bc 1473595 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.b 7235137 .nil))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 125916725 (.l 62958362 (.bc 3388329 (.bc 1 (.bc 15452317 (.bc 1 (.b 12638529 .nil))))) .nil) .nil)))))))))))))))))))))) (.c (.bc 1 (.l 746849862 (.l 136988814 (.l 68494407 (.bc 6676868 (.bc 1 (.bc 20801197 (.bc 1 (.b 6769133 .nil))))) .nil) (.c (.bc 1 (.l 236436114 (.l 84779755 (.bc 12546263 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.b 3767821 .nil))))))) (.c (.bc 1 (.l 33438299 (.bc 2481274 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.b 1468386 .nil))))))))))))))))))))))))))))))))))))))) .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 1970224724 (.l 985112362 (.l 335864122 (.l 167932061 (.bc 5069131 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.b 1553405 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 156692056 (.l 78346028 (.bc 2369103 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) +def cmd_220 : Cmd := (.l 15636725759 (.l 7818362879 (.l 3909181439 (.l 1954590719 (.l 977295359 (.l 488647679 (.l 244323839 (.l 122161919 (.l 61080959 (.l 30540479 (.l 15270239 (.l 7635119 (.l 3817559 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 35001458054915 (.l 12821692000915 (.l 2935255779007 (.l 1467627889503 (.l 280843014025 (.l 140421507012 (.l 70210753506 (.l 35105376753 (.l 9739163255 (.l 4869581627 (.l 2434790813 (.l 932393991 (.l 103539487 (.c (.c (.b 51769741 .nil))) (.c (.bc 1 (.bc 185122077 (.bc 1 (.bc 77134197 (.bc 1 (.bc 27768309 (.bc 1 (.bc 8544093 (.bc 1 (.bc 2215133 (.bc 1 (.bc 474669 (.bc 1 (.bc 81837 (.bc 1 (.bc 10909 (.bc 1 (.bc 1055 (.bc 1 (.bc 127 (.bc 1 (.bc 991 (.bc 1 (.bc 9917 (.bc 1 (.bc 71917 (.bc 1 (.bc 402749 (.bc 1 (.bc 1812381 (.bc 1 (.bc 6731709 (.bc 1 (.bc 21036597 (.bc 1 (.b 31238787 .nil)))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 285001412 (.bc 24858808 (.bc 1 (.b 117641895 .nil))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 7813525118 (.l 3906762559 (.l 1953381280 (.l 976690640 (.bc 11382582 (.bc 1 (.bc 258048957 (.bc 1 (.b 218913775 .nil))))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 452970930723 (.l 226485465361 (.l 113242732680 (.l 56621366340 (.l 28310683170 (.l 14155341585 (.l 7077670792 (.l 594276654 (.bc 232671902 (.bc 1 (.b 64466422 .nil))) (.c (.bc 1 (.l 2783951347 (.bc 630280773 (.bc 1 (.b 761694897 .nil))) (.c (.bc 1 (.b 160607389 .nil))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 3475590221447 (.l 1737795110723 (.l 868897555362 (.l 96237230733 (.l 48118615366 (.l 24059307683 (.l 12029653841 (.l 916905344 (.l 458452672 (.l 229226336 (.bc 100872604 (.bc 1 (.b 13740561 .nil))) .nil) .nil) (.c (.bc 1 (.b 5097921574 .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 338211546945 (.l 126218942213 (.l 48533267831 (.bc 3080963460 (.bc 1 (.l 21185670452 (.l 10592835226 (.bc 204395608 (.bc 1 (.l 5092022002 (.l 1560302681 (.bc 236805559 (.bc 1 (.b 543345778 .nil))) (.c (.bc 1 (.b 985708317 .nil)))) .nil))) .nil) .nil))) (.c (.bc 1 (.l 14576203272 (.l 7288101636 (.l 3644050818 (.l 1822025409 (.l 911012704 (.bc 165960839 (.bc 1 (.b 289545510 .nil))) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 42886831256 (.l 21443415628 (.bc 4103197290 (.bc 1 (.b 6618510521 .nil))) .nil) .nil)))) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 4679037026539 (.l 2339518513269 (.l 109153414746 (.l 54576707373 (.l 27288353686 (.l 13644176843 (.l 6822088421 (.l 3411044210 (.l 1705522105 (.l 852761052 (.l 426380526 (.bc 171793188 (.bc 1 (.b 41397072 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1060605841886 (.l 530302920943 (.l 265151460472 (.l 132575730236 (.l 66287865118 (.l 11630429229 (.l 3894312565 (.l 1947156282 (.bc 744607832 (.bc 1 (.b 228970306 .nil))) .nil) (.c (.bc 1 (.b 1920902046 .nil)))) (.c (.bc 1 (.l 18651515221 (.l 9325757610 (.l 1260917033 (.l 630458516 (.bc 174572298 (.bc 1 (.b 140656957 .nil))) .nil) (.c (.bc 1 (.l 3401961769 (.l 1700980884 (.bc 554090239 (.bc 1 (.b 296400200 .nil))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 2861988103 (.l 1430994051 (.l 715497025 (.l 357748512 (.bc 155185476 (.bc 1 (.b 23688777 .nil))) .nil) .nil) .nil) .nil))))))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 1841391986938 (.l 920695993469 (.l 460347996735 (.l 230173998368 (.l 115086999184 (.l 57543499592 (.l 28771749796 (.l 14385874898 (.l 7192937449 (.l 3596468725 (.l 1798234363 (.l 899117182 (.bc 234360180 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.bc 6731709 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 61 (.bc 1 (.bc 1 (.bc 1 (.bc 59 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 .nil))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))))) +def cmd_221 : Cmd := (.l 2837645039601 (.l 1418822519800 (.l 709411259900 (.l 354705629950 (.l 129652264331 (.l 64826132165 (.l 32413066082 (.l 16206533041 (.l 8103266520 (.l 4051633260 (.l 2025816630 (.l 369711521 (.bc 1 (.bc 62927 (.bc 1 (.bc 339819 (.bc 1 (.bc 1472559 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.bc 88704327 (.bc 1 (.b 32919364 .nil)))))))))))))))) (.c (.bc 1 (.l 643196791 (.bc 136425261 (.bc 1 (.b 185173131 .nil))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 47700550641 (.l 23850275320 (.l 11925137660 (.l 5962568830 (.l 2981284415 (.l 1490642207 (.l 745321103 (.l 372660551 (.bc 97067916 (.bc 1 (.b 89262357 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) +def cmd_225 : Cmd := (.l 64344104734745 (.l 32172052367373 (.l 10567479764142 (.l 1426230537649 (.l 713115268824 (.l 356557634412 (.l 178278817206 (.l 89139408603 (.l 32395136862 (.bc 1551745358 (.bc 1 (.l 14645823070 (.l 7322911535 (.l 2061039287 (.l 1030519643 (.bc 226259705 (.bc 1 (.b 289000114 .nil))) .nil) (.c (.bc 1 (.l 1600416477 (.l 800208238 (.bc 241364932 (.bc 1 (.b 158739184 .nil))) .nil) .nil)))) .nil) .nil))) (.c (.bc 1 (.b 12174567437 .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 3857509344419 (.l 1855431507977 (.l 927715753988 (.l 152102103979 (.l 76051051989 (.l 38025525995 (.l 11480957199 (.l 2391961180 (.l 1195980590 (.l 597990295 (.bc 61885971 (.bc 1 (.b 237109174 .nil))) .nil) .nil) (.c (.bc 1 (.l 3348517416 (.l 1674258708 (.bc 8468700 (.bc 1 (.l 828660651 (.bc 359736861 (.bc 1 (.b 54593461 .nil))) .nil))) .nil) .nil)))) (.c (.bc 1 (.l 7531805796 (.l 3765902898 (.bc 1600118953 (.bc 1 (.b 282832493 .nil))) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 311755773012 (.l 65015130065 (.l 32507565032 (.l 16253782516 (.l 8126891258 (.l 4063445629 (.l 1941798661 (.bc 5033723 (.bc 1 (.bc 412506147 (.bc 1 (.bc 282241047 (.bc 1 (.bc 169344627 (.bc 1 (.bc 88704327 (.bc 1 (.b 13069444 .nil))))))))))) (.c (.bc 1 (.l 89924151 (.bc 27250701 (.bc 1 (.bc 15777447 (.bc 1 (.b 1933921 .nil))))) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 90862756438 (.l 44312999586 (.l 21118190810 (.l 10559095405 (.l 275314167 (.l 137657083 (.bc 3325226 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.bc 11705847 (.bc 1 (.bc 28614297 (.bc 1 (.b 17689841 .nil))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 2503460117 (.l 1251730058 (.bc 42400185 (.bc 1 (.bc 109254597 (.bc 1 (.bc 172986447 (.bc 1 (.bc 239519697 (.bc 1 (.b 61704091 .nil))))))))) .nil) (.c (.bc 1 (.l 1202259853 (.l 601129926 (.bc 229141255 (.bc 1 (.b 71423705 .nil))) .nil) (.c (.bc 1 (.bc 511620029 (.bc 1 (.bc 201735597 (.bc 1 (.bc 107592317 (.bc 1 (.l 157910277 (.l 78955138 (.bc 33574343 (.bc 1 (.b 5903223 .nil))) .nil) (.c (.bc 1 (.b 319655324 .nil))))))))))))))))))) .nil) (.c (.bc 1 (.l 1038308980 (.l 519154490 (.bc 51399048 (.bc 1 (.l 208178194 (.bc 28553749 (.bc 1 (.b 75535345 .nil))) .nil))) .nil) .nil)))) (.c (.bc 1 (.b 1118378630 .nil)))) .nil)))) .nil)))) .nil) (.c (.bc 1 (.l 73323164229 (.l 36661582114 (.l 18330791057 (.l 9165395529 (.l 4582697764 (.l 2291348882 (.l 1145674441 (.l 487230258 (.l 243615129 (.bc 105184649 (.bc 1 (.b 16622913 .nil))) .nil) (.c (.bc 1 (.b 85606960 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 5518546419542 (.l 2759273209771 (.l 1379636604886 (.l 689818302443 (.l 344909151222 (.l 172454575611 (.l 78110718581 (.l 39055359290 (.l 7601437111 (.l 1583414447 (.l 791707223 (.bc 201495043 (.bc 1 (.bc 172986447 (.bc 1 (.b 21372115 .nil))))) .nil) (.c (.bc 1 (.l 2217304105 (.l 632407672 (.bc 87882481 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.b 49264036 .nil))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 476244377 (.bc 19930539 (.bc 1 (.bc 103791867 (.bc 1 (.b 114399776 .nil))))) .nil)))) .nil)))) (.c (.bc 1 (.l 11926242531 (.l 735385770 (.l 367692885 (.bc 21328050 (.bc 1 (.bc 155117517 (.bc 1 (.b 7400869 .nil))))) .nil) (.c (.bc 1 (.l 4639920057 (.bc 252770812 (.bc 1 (.l 572195517 (.bc 21331239 (.bc 1 (.bc 135727827 (.bc 1 (.bc 103791867 (.bc 1 (.b 25246816 .nil))))))) (.c (.bc 1 (.l 262256277 (.bc 43947759 (.bc 1 (.bc 40060017 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.b 4558618 .nil))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 104902509 (.bc 9255177 (.bc 1 (.bc 26246217 (.bc 1 (.b 16949854 .nil))))) (.c (.bc 1 (.bc 36312405 (.bc 1 (.bc 10759229 (.bc 1 (.bc 2689805 (.bc 1 (.bc 556509 (.bc 1 (.bc 92749 (.bc 1 (.bc 11967 (.bc 1 (.bc 1185 (.bc 1 (.bc 1121 (.bc 1 (.bc 10911 (.bc 1 (.bc 81837 (.bc 1 (.bc 474669 (.bc 1 (.l 2215133 (.bc 502291 (.bc 1 (.b 605272 .nil))) (.c (.bc 1 (.bc 8544093 (.bc 1 (.bc 27768309 (.bc 1 (.bc 77134197 (.bc 1 (.l 185122077 (.bc 3514929 (.bc 1 (.bc 74884317 (.bc 1 (.b 14161786 .nil))))) (.c (.bc 1 (.l 387073437 (.bc 66071409 (.bc 1 (.bc 74884317 (.bc 1 (.b 52580986 .nil))))) (.c (.bc 1 (.l 388985217 (.bc 8262519 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.bc 26075787 (.bc 1 (.b 34305652 .nil))))))))))))))))))))))))))))))))))))))))))))))))) .nil))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 587815432 (.l 293907716 (.bc 462064 (.bc 1 (.bc 40116597 (.bc 1 (.bc 40116597 (.bc 1 (.bc 34767717 (.bc 1 (.bc 26075787 (.bc 1 (.b 5415081 .nil))))))))))) .nil) .nil))))))) .nil)))) .nil) (.c (.bc 1 (.l 8116569222 (.l 4058284611 (.l 2029142306 (.l 1014571153 (.l 26741702 (.bc 11457486 (.bc 1 (.b 1913362 .nil))) (.c (.bc 1 (.l 480543872 (.bc 7460283 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) +def cmd_226 : Cmd := (.l 349259186176 (.l 174629593088 (.l 87314796544 (.l 43657398272 (.l 21828699136 (.l 10914349568 (.l 5457174784 (.l 2728587392 (.l 1364293696 (.l 682146848 (.l 341073424 (.l 170536712 (.l 85268356 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_227 : Cmd := (.l 8372223 (.l 4186111 (.l 2093055 (.l 1046527 (.l 523263 (.l 261631 (.l 130815 (.l 65407 (.l 32703 (.l 16351 (.l 8175 (.l 4087 (.l 2043 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 16846896151659 (.l 534615400981 (.l 267307700490 (.l 133653850245 (.l 66826925122 (.l 33413462561 (.l 16706731280 (.l 8353365640 (.l 4176682820 (.l 2088341410 (.l 1044170705 (.l 522085352 (.l 261042676 (.c (.c (.b 130521336 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 7888832674845 (.l 3944416337422 (.l 1539029339599 (.l 769514669799 (.l 105292865476 (.l 52646432738 (.l 26323216369 (.l 13161608184 (.l 6580804092 (.l 3290402046 (.l 1645201023 (.bc 319475929 (.bc 1 (.b 503124579 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 279464469421 (.l 139732234710 (.l 69866117355 (.l 27417766718 (.bc 1331534469 (.bc 1 (.l 12377348887 (.l 6188674443 (.l 2222789010 (.bc 968052009 (.bc 1 (.b 143342493 .nil))) (.c (.bc 1 (.b 871548209 .nil)))) .nil) .nil))) (.c (.bc 1 (.b 7515291956 .nil)))) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 433178829109 (.l 216589414554 (.l 108294707277 (.l 54147353638 (.bc 25909887516 (.bc 1 (.b 1163789300 .nil))) .nil) .nil) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 7888832674845 (.l 3944416337422 (.l 1972208168711 (.l 986104084356 (.l 493052042178 (.l 246526021089 (.l 95594718870 (.l 47797359435 (.l 19259368819 (.l 9629684409 (.l 1062371588 (.l 531185794 (.bc 179441890 (.bc 1 (.b 86151004 .nil))) .nil) (.c (.bc 1 (.b 3752470613 .nil)))) .nil) (.c (.bc 1 (.b 4639310895 .nil)))) .nil) (.c (.bc 1 (.b 27668291672 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil)))))) +def cmd_231 : Cmd := (.l 153430865040704 (.l 64001763921050 (.l 22497009009529 (.l 4954427202074 (.l 2477213601037 (.l 1238606800519 (.l 619303400259 (.l 309651700129 (.l 154825850064 (.l 29786353255 (.l 14893176627 (.l 7446588313 (.bc 764824314 (.bc 1 (.l 2958469839 (.bc 204651411 (.bc 1 (.b 1274583505 .nil))) .nil))) .nil) .nil) (.c (.bc 1 (.l 47626571774 (.l 13982296072 (.l 6991148036 (.l 3495574018 (.bc 1059022711 (.bc 1 (.b 688764295 .nil))) .nil) .nil) (.c (.bc 1 (.l 9830989812 (.bc 4672263361 (.bc 1 (.b 243231542 .nil))) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 6294077302687 (.l 3147038651343 (.l 100183297069 (.l 50091648534 (.l 25045824267 (.l 12522912133 (.l 6261456066 (.l 3130728033 (.l 1565364016 (.bc 163343985 (.bc 1 (.l 619338020 (.bc 75006621 (.bc 1 (.b 234662386 .nil))) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1473336028599 (.l 736668014299 (.l 368334007149 (.l 74956287357 (.bc 1017257995 (.bc 1 (.l 36460885680 (.l 18230442840 (.l 9115221420 (.l 4557610710 (.bc 1339377386 (.bc 1 (.b 939427966 .nil))) .nil) .nil) .nil) .nil))) (.c (.bc 1 (.l 109210716214 (.l 40656957433 (.l 20328478716 (.l 7550270704 (.l 3771029317 (.bc 206904911 (.bc 1 (.bc 709634637 (.bc 1 (.bc 387073437 (.bc 1 (.bc 185122077 (.bc 1 (.bc 77134197 (.bc 1 (.bc 27768309 (.bc 1 (.bc 8544093 (.bc 1 (.bc 2215133 (.bc 1 (.bc 474669 (.bc 1 (.bc 81837 (.bc 1 (.bc 10909 (.bc 1 (.bc 1053 (.bc 1 (.bc 63 (.bc 1 (.bc 1 (.bc 1 (.bc 61 (.bc 1 (.bc 989 (.bc 1 (.bc 9917 (.bc 1 (.bc 71917 (.bc 1 (.bc 402749 (.bc 1 (.bc 1812381 (.bc 1 (.bc 6731709 (.bc 1 (.bc 21036597 (.bc 1 (.bc 56097597 (.bc 1 (.bc 129024477 (.bc 1 (.b 65360866 .nil))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.b 4106032 .nil)))) (.c (.bc 1 (.l 2613968651 (.l 1306984325 (.bc 190635072 (.bc 1 (.bc 451585677 (.bc 1 (.b 11271407 .nil))))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 13948400671 (.l 6974200335 (.l 3487100167 (.l 1743550083 (.bc 683475789 (.bc 1 (.b 188299249 .nil))) .nil) .nil) .nil) .nil)))) .nil)))) .nil) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 9503872950993 (.l 4751936475496 (.l 1530059221923 (.l 765029610961 (.l 106184420619 (.l 53092210309 (.l 26546105154 (.l 13273052577 (.l 6636526289 (.l 3318263145 (.l 1659131573 (.bc 754571948 (.bc 1 (.b 74993836 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 276330384858 (.l 114294216266 (.l 57147108133 (.l 28573554066 (.bc 5057057815 (.bc 1 (.l 9229719215 (.bc 266327080 (.bc 1 (.l 4348532524 (.l 2008657885 (.bc 357737603 (.bc 1 (.b 646591336 .nil))) (.c (.bc 1 (.b 165608374 .nil)))) .nil))) .nil))) .nil) .nil) (.c (.bc 1 (.b 23870976160 .nil)))) .nil)))) .nil) (.c (.bc 1 (.l 845909015822 (.l 422954507911 (.l 211477253956 (.l 105738626978 (.l 5993035446 (.l 2996517723 (.l 1498258861 (.l 749129430 (.l 374564715 (.bc 99781250 (.bc 1 (.b 87501105 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 46876278040 (.l 23438139020 (.l 11719069510 (.bc 535454443 (.bc 1 (.l 3705719973 (.l 1852859986 (.bc 910080720 (.bc 1 (.b 16349270 .nil))) .nil) (.c (.bc 1 (.b 1618360333 .nil)))))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 12713668599299 (.l 6356834299649 (.l 3178417149825 (.l 1589208574912 (.l 794604287456 (.l 397302143728 (.l 198651071864 (.l 91172470283 (.l 14391705278 (.l 7195852639 (.bc 95519552 (.bc 1 (.bc 713355629 (.bc 1 (.bc 309327917 (.bc 1 (.bc 265502597 (.bc 1 (.bc 528964653 (.bc 1 (.l 1206260157 (.l 603130078 (.bc 43764252 (.bc 1 (.b 257800784 .nil))) .nil) (.c (.bc 1 (.b 478995796 .nil)))))))))))))) .nil) (.c (.bc 1 (.l 31194529860 (.l 15597264930 (.l 2025231394 (.bc 481014685 (.bc 1 (.l 531601009 (.bc 76690119 (.bc 1 (.b 189110382 .nil))) .nil))) (.c (.bc 1 (.l 4621711287 (.l 2310855643 (.bc 262475294 (.bc 1 (.bc 258048957 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.bc 6731709 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 61 (.bc 1 (.bc 1 (.bc 1 (.bc 59 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 (.bc 1 (.bc 62927 (.bc 1 (.bc 339819 (.bc 1 (.bc 1472559 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.bc 88704327 (.bc 1 (.bc 169344627 (.bc 1 (.b 98424131 .nil))))))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 1151689778 (.l 575844889 (.bc 183816915 (.bc 1 (.b 104105526 .nil))) .nil) .nil))))))) .nil) .nil)))) (.c (.bc 1 (.b 8153065646 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 12713668599299 (.l 6356834299649 (.l 3178417149825 (.l 1589208574913 (.l 794604287457 (.l 397302143729 (.l 198651071864 (.l 99325535932 (.l 49662767966 (.l 24831383983 (.l 12415691992 (.l 5421786953 (.l 712050649 (.bc 53617319 (.bc 1 (.b 302408002 .nil))) (.c (.bc 1 (.l 1998842824 (.bc 227957043 (.bc 1 (.bc 601080387 (.bc 1 (.b 170383976 .nil))))) .nil)))) (.c (.bc 1 (.b 786059040 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) +def cmd_235 : Cmd := (.l 99211324143417 (.l 49605662071709 (.l 24802831035855 (.l 12401415517928 (.l 1093079073687 (.l 546539536843 (.l 273269768421 (.l 136634884211 (.l 68317442106 (.l 34158721053 (.l 17079360526 (.l 4479157150 (.l 2239578575 (.l 560803251 (.bc 234181650 (.bc 1 (.b 46219972 .nil))) (.c (.bc 1 (.b 558986033 .nil)))) .nil) (.c (.bc 1 (.l 4060523110 (.l 2030261555 (.l 1015130778 (.bc 204652056 (.bc 1 (.b 302913330 .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 5107628685274 (.l 2553814342637 (.l 228111097264 (.l 114055548632 (.l 57027774316 (.l 2573897868 (.l 1286948934 (.l 643474467 (.l 321737233 (.bc 94786785 (.bc 1 (.b 66081828 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 25939989287 (.l 12969994643 (.l 6484997321 (.l 3242498660 (.l 768369968 (.bc 29158509 (.bc 1 (.bc 282241047 (.bc 1 (.b 72785422 .nil))))) (.c (.bc 1 (.l 367158789 (.bc 96559203 (.bc 1 (.b 87020188 .nil))) (.c (.bc 1 (.l 141214917 (.bc 1684137 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.b 73246 .nil))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 47071637 (.bc 11632599 (.bc 1 (.b 11903216 .nil))) (.c (.bc 1 (.bc 13449037 (.bc 1 (.bc 3246317 (.bc 1 (.bc 649261 (.bc 1 (.bc 104719 (.bc 1 (.bc 13155 (.bc 1 (.bc 2309 (.bc 1 (.bc 12035 (.bc 1 (.bc 92751 (.bc 1 (.bc 556509 (.bc 1 (.bc 2689805 (.bc 1 (.bc 10759229 (.bc 1 (.l 36312405 (.bc 923499 (.bc 1 (.b 17232700 .nil))) (.c (.bc 1 (.l 104902509 (.bc 42857325 (.bc 1 (.b 9593926 .nil))) (.c (.bc 1 (.b 124643927 .nil))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 1048796074052 (.l 524398037026 (.l 157832884034 (.l 55714246970 (.l 27857123485 (.l 13928561743 (.l 2515671383 (.l 137612350 (.bc 37338706 (.bc 1 (.b 31467466 .nil))) (.c (.bc 1 (.l 572195517 (.bc 141518979 (.bc 1 (.b 144578776 .nil))) (.c (.bc 1 (.l 548027818 (.bc 94940919 (.bc 1 (.b 179072987 .nil))) .nil))))))) (.c (.bc 1 (.l 4448609486 (.l 548680257 (.bc 111772359 (.bc 1 (.b 162567766 .nil))) (.c (.bc 1 (.l 1675624483 (.bc 147667269 (.bc 1 (.bc 290845347 (.bc 1 (.bc 239519697 (.bc 1 (.b 159779919 .nil))))))) .nil)))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 23202195044 (.l 5576223087 (.l 2788111543 (.l 1394055772 (.l 180343034 (.bc 13206528 (.bc 1 (.b 76964986 .nil))) (.c (.bc 1 (.l 516684849 (.bc 32289609 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.b 46995496 .nil))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 6024874432 (.l 3012437216 (.l 1506218608 (.l 753109304 (.bc 22199081 (.bc 1 (.bc 103791867 (.bc 1 (.bc 135727827 (.bc 1 (.b 114835868 .nil))))))) .nil) .nil) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 104366134476 (.l 52183067238 (.l 26091533619 (.l 13045766810 (.l 6522883405 (.l 1514157124 (.bc 40281649 (.bc 1 (.bc 155117517 (.bc 1 (.bc 135727827 (.bc 1 (.bc 103791867 (.bc 1 (.bc 69194577 (.bc 1 (.bc 40060017 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.bc 26246217 (.bc 1 (.bc 42948357 (.bc 1 (.bc 60843507 (.bc 1 (.b 26491462 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 1747284576 (.bc 48392853 (.bc 1 (.bc 80233197 (.bc 1 (.bc 74884317 (.bc 1 (.bc 60843507 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.bc 26075787 (.bc 1 (.bc 34767717 (.bc 1 (.bc 40116597 (.bc 1 (.bc 40116597 (.bc 1 (.bc 34767717 (.bc 1 (.bc 26075787 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil) +def cmd_236 : Cmd := (.l 330521640960 (.l 165260820480 (.l 82630410240 (.l 41315205120 (.l 20657602560 (.l 10328801280 (.l 5164400640 (.l 2582200320 (.l 1291100160 (.l 645550080 (.l 322775040 (.l 161387520 (.l 80693760 (.l 40346880 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_237 : Cmd := (.l 1507327 (.l 753663 (.l 376831 (.l 188415 (.l 94207 (.l 47103 (.l 23551 (.l 11775 (.l 5887 (.l 2943 (.l 1471 (.l 735 (.l 367 (.l 183 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 193760813661161 (.l 77387203667005 (.l 24025234594381 (.l 2169085982523 (.l 1084542991261 (.l 542271495630 (.l 271135747815 (.l 75935205557 (.l 37967602778 (.l 18983801389 (.l 9491900694 (.l 4745950347 (.l 663282891 (.l 331641445 (.c (.c (.b 165820720 .nil))) .nil) (.c (.bc 1 (.b 1709692279 .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 59632668347 (.l 29816334173 (.bc 1233406211 (.bc 1 (.l 13674760872 (.l 6837380436 (.l 3418690218 (.l 1709345109 (.bc 660727922 (.bc 1 (.b 193944629 .nil))) .nil) .nil) .nil) .nil))) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 9843531314664 (.l 4921765657332 (.l 1831493483420 (.l 915746741710 (.l 457873370855 (.l 228936685428 (.l 114468342714 (.l 57234171357 (.bc 4964198744 (.bc 1 (.l 23652886931 (.l 11139680660 (.bc 2972928541 (.bc 1 (.b 2596911786 .nil))) (.c (.bc 1 (.b 686762802 .nil)))) .nil))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 629389345243 (.l 314694672621 (.l 157347336311 (.l 78673668156 (.bc 3880025369 (.bc 1 (.l 35456808706 (.l 17728404353 (.l 8864202177 (.l 4432101088 (.bc 1484417662 (.bc 1 (.b 731632879 .nil))) .nil) .nil) .nil) .nil))) .nil) .nil) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 14668367239118 (.l 7334183619559 (.l 3667091809779 (.l 1833545904889 (.l 916772952444 (.l 458386476222 (.bc 34881266102 (.bc 1 (.l 194311972006 (.l 97155986003 (.bc 2875742213 (.bc 1 (.l 45702250786 (.bc 5194843645 (.bc 1 (.l 17656281745 (.l 7049967025 (.bc 928071723 (.bc 1 (.b 2596911786 .nil))) (.c (.bc 1 (.b 1778173844 .nil)))) .nil))) .nil))) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 19493203163572 (.l 9746601581786 (.l 4873300790893 (.l 2436650395446 (.l 1218325197723 (.l 609162598861 (.l 304581299430 (.l 152290649715 (.l 29653528735 (.l 14826764367 (.l 7413382183 (.l 3706691092 (.bc 225936327 (.bc 1 (.b 1627409216 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 46491796119 (.l 23245898059 (.l 5872926210 (.l 2936463105 (.bc 1156542061 (.bc 1 (.b 311689488 .nil))) .nil) (.c (.bc 1 (.b 5750022817 .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 19493203163572 (.l 9746601581786 (.l 4873300790893 (.l 2436650395447 (.l 49426737019 (.l 24713368509 (.bc 2426211738 (.bc 1 (.l 9930472514 (.l 4965236257 (.bc 1672026700 (.bc 1 (.b 810591425 .nil))) .nil) .nil))) .nil) (.c (.bc 1 (.l 1168898460702 (.l 584449230351 (.l 292224615175 (.l 146112307588 (.l 73056153794 (.l 36528076897 (.l 18264038449 (.l 9132019224 (.l 4566009612 (.bc 10235728 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 572195517 (.bc 1 (.bc 262256277 (.bc 1 (.bc 104902509 (.bc 1 (.bc 36312405 (.bc 1 (.bc 10759229 (.bc 1 (.bc 2689805 (.bc 1 (.bc 556509 (.bc 1 (.bc 92749 (.bc 1 (.bc 11965 (.bc 1 (.bc 1119 (.bc 1 (.bc 65 (.bc 1 (.bc 1 (.bc 1 (.bc 63 (.bc 1 (.bc 1053 (.bc 1 (.bc 10909 (.bc 1 (.bc 81837 (.bc 1 (.bc 474669 (.bc 1 (.bc 2215133 (.bc 1 (.bc 8544093 (.bc 1 (.bc 27768309 (.bc 1 (.bc 77134197 (.bc 1 (.b 70052519 .nil))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil)))))) +def cmd_241 : Cmd := (.l 553958096442555 (.l 256205215908807 (.l 106586818414858 (.l 38557154232157 (.l 9706816428931 (.l 4853408214465 (.l 2426704107232 (.l 1213352053616 (.l 18738760308 (.l 9369380154 (.l 4684690077 (.l 2342345038 (.l 1171172519 (.l 585586259 (.bc 115069558 (.bc 1 (.b 177723569 .nil))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 587937266497 (.l 149361075484 (.l 74680537742 (.l 32700616111 (.l 2899879421 (.l 553984682 (.bc 209349868 (.bc 1 (.b 67642470 .nil))) (.c (.bc 1 (.b 895955025 .nil)))) (.c (.bc 1 (.l 10830772385 (.l 5415386192 (.bc 194014652 (.bc 1 (.bc 1146332877 (.bc 1 (.b 1367345561 .nil))))) .nil) (.c (.bc 1 (.l 2619656243 (.l 1309828121 (.bc 270272835 (.bc 1 (.b 384641223 .nil))) .nil) .nil))))))) (.c (.bc 1 (.b 4639652757 .nil)))) .nil) (.c (.bc 1 (.l 144607557761 (.l 63531524359 (.l 31765762179 (.bc 480117237 (.bc 1 (.bc 2427235517 (.bc 1 (.bc 1022683549 (.bc 1 (.l 574830517 (.l 287415258 (.bc 127209741 (.bc 1 (.b 16497885 .nil))) .nil) (.c (.bc 1 (.bc 794467253 (.bc 1 (.bc 1735224813 (.bc 1 (.bc 3710487351 (.bc 1 (.l 5137834831 (.bc 462138555 (.bc 1 (.l 2106778857 (.bc 525994195 (.bc 1 (.b 527395230 .nil))) .nil))) .nil)))))))))))))))) .nil) (.c (.bc 1 (.l 8772254518 (.l 4386127259 (.bc 1988103649 (.bc 1 (.b 204959978 .nil))) .nil) .nil)))) .nil)))) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 9571760687144 (.l 4785880343572 (.l 1721379713833 (.l 860689856916 (.l 430344928458 (.bc 31595131032 (.bc 1 (.l 177902259169 (.l 88951129584 (.l 44475564792 (.l 8059969870 (.l 4029984935 (.bc 270597234 (.bc 1 (.b 1744395230 .nil))) .nil) (.c (.bc 1 (.l 14177812523 (.l 1927813818 (.bc 329921406 (.bc 1 (.b 633985500 .nil))) (.c (.bc 1 (.l 5161092440 (.bc 1003632895 (.bc 1 (.bc 1146332877 (.bc 1 (.b 430580442 .nil))))) .nil)))) .nil)))) .nil) .nil) (.c (.bc 1 (.b 5675074022 .nil)))))) .nil) .nil) (.c (.bc 1 (.l 671560457950 (.l 335780228975 (.l 167890114488 (.l 83945057244 (.l 41972528622 (.l 20986264311 (.l 3841219613 (.l 1920609806 (.bc 101708132 (.bc 1 (.bc 387073437 (.bc 1 (.bc 185122077 (.bc 1 (.bc 77134197 (.bc 1 (.bc 27768309 (.bc 1 (.bc 8544093 (.bc 1 (.bc 2215133 (.bc 1 (.bc 474669 (.bc 1 (.bc 81837 (.bc 1 (.bc 10909 (.bc 1 (.bc 1053 (.bc 1 (.bc 63 (.bc 1 (.bc 1 (.bc 1 (.bc 61 (.bc 1 (.bc 989 (.bc 1 (.bc 9917 (.bc 1 (.bc 71917 (.bc 1 (.bc 402749 (.bc 1 (.bc 1812381 (.bc 1 (.bc 6731709 (.bc 1 (.bc 21036597 (.bc 1 (.bc 56097597 (.bc 1 (.b 84007010 .nil))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 6651912540 (.l 156200022 (.bc 45017466 (.bc 1 (.b 33082542 .nil))) (.c (.bc 1 (.l 3169756245 (.bc 224966413 (.bc 1 (.bc 451585677 (.bc 1 (.bc 694747197 (.bc 1 (.b 213578826 .nil))))))) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 14736254975269 (.l 7368127487634 (.l 3684063743817 (.l 1842031871908 (.l 834240075925 (.bc 40524799113 (.bc 1 (.l 376595238846 (.l 118388621042 (.l 59194310521 (.l 4083081613 (.l 2041540806 (.bc 185422980 (.bc 1 (.l 835347420 (.bc 3380893 (.bc 1 (.b 414292814 .nil))) .nil))) .nil) (.c (.bc 1 (.l 25514073644 (.l 12757036822 (.l 1668007976 (.bc 717152623 (.bc 1 (.b 116851362 .nil))) (.c (.bc 1 (.bc 1201610589 (.bc 1 (.bc 508373709 (.bc 1 (.bc 188286557 (.bc 1 (.bc 60520677 (.bc 1 (.bc 16695357 (.bc 1 (.bc 3895581 (.bc 1 (.bc 753983 (.bc 1 (.bc 117877 (.bc 1 (.bc 15467 (.bc 1 (.bc 14347 (.bc 1 (.bc 104789 (.bc 1 (.bc 649263 (.bc 1 (.bc 3246317 (.bc 1 (.bc 13449037 (.bc 1 (.bc 47071637 (.bc 1 (.l 141214917 (.bc 62906797 (.bc 1 (.b 7700658 .nil))) (.c (.bc 1 (.bc 367158789 (.bc 1 (.bc 834451797 (.bc 1 (.l 1322879688 (.bc 522939481 (.bc 1 (.b 138500360 .nil))) .nil))))))))))))))))))))))))))))))))))))))))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 69908998378 (.l 34954499189 (.l 17477249595 (.l 1768260628 (.bc 346023909 (.bc 1 (.b 538106402 .nil))) (.c (.bc 1 (.l 6970364167 (.l 2414569193 (.bc 362305679 (.bc 1 (.bc 694747197 (.bc 1 (.b 150231714 .nil))))) (.c (.bc 1 (.l 1070612887 (.bc 301353961 (.bc 1 (.b 233952479 .nil))) .nil)))) .nil)))) .nil) .nil) .nil)))) .nil))) (.c (.bc 1 (.l 86775860026 (.l 43387930013 (.l 21693965006 (.bc 144888541 (.bc 1 (.l 10702093959 (.l 5351046979 (.l 2675523489 (.l 1337761745 (.bc 15040944 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.bc 6731709 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 61 (.bc 1 (.bc 1 (.bc 1 (.bc 59 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 (.bc 1 (.bc 62927 (.bc 1 (.bc 339819 (.bc 1 (.bc 1472559 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.bc 88704327 (.bc 1 (.bc 169344627 (.bc 1 (.b 117360492 .nil))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 21515789539542 (.l 10757894769771 (.l 5378947384886 (.l 2660425690338 (.l 1330212845169 (.l 665106422585 (.l 332553211292 (.l 166276605646 (.l 83138302823 (.l 41569151412 (.l 20784575706 (.l 2213433097 (.bc 164880555 (.bc 1 (.bc 412506147 (.bc 1 (.b 529329840 .nil))))) (.c (.bc 1 (.l 6495886317 (.bc 1035205 (.bc 1 (.bc 601080387 (.bc 1 (.bc 601080387 (.bc 1 (.bc 530365047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 282241047 (.bc 1 (.bc 169344627 (.bc 1 (.bc 88704327 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.bc 11705847 (.bc 1 (.bc 28614297 (.bc 1 (.bc 60090027 (.bc 1 (.bc 109254597 (.bc 1 (.bc 172986447 (.bc 1 (.b 110084658 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 1682968433 (.bc 129435037 (.bc 1 (.bc 290845347 (.bc 1 (.bc 310235037 (.bc 1 (.b 110968786 .nil))))))) .nil))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 29048002102 .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 20773832312468 (.l 10386916156234 (.l 5193458078117 (.l 2596729039059 (.l 1298364519530 (.l 649182259765 (.l 324591129883 (.l 108646618107 (.l 52035016292 (.l 26017508146 (.l 11604578867 (.l 1117114478 (.l 558557239 (.bc 123142182 (.bc 1 (.b 156136435 .nil))) .nil) (.c (.bc 1 (.l 4685174952 (.l 2342587476 (.bc 83383261 (.bc 1 (.bc 172986447 (.bc 1 (.bc 109254597 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.bc 69194577 (.bc 1 (.bc 103791867 (.bc 1 (.bc 135727827 (.bc 1 (.bc 155117517 (.bc 1 (.bc 155117517 (.bc 1 (.b 7662788 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil)))) (.c (.bc 1 (.l 1404175203 (.l 702087601 (.l 351043800 (.bc 128065039 (.bc 1 (.b 47456858 .nil))) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 2288292758 (.l 1144146379 (.l 572073189 (.l 286036594 (.l 143018297 (.bc 56335008 (.bc 1 (.b 15174137 .nil))) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 53648946832 (.l 26824473416 (.l 13412236708 (.l 6706118354 (.l 3353059177 (.l 1676529589 (.bc 54020440 (.bc 1 (.bc 40060017 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.bc 26246217 (.bc 1 (.bc 42948357 (.bc 1 (.bc 60843507 (.bc 1 (.bc 74884317 (.bc 1 (.bc 80233197 (.bc 1 (.bc 74884317 (.bc 1 (.bc 60843507 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.bc 26075787 (.bc 1 (.bc 34767717 (.bc 1 (.bc 40116597 (.bc 1 (.bc 40116597 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) +def cmd_242 : Cmd := (.l 5937977917440 (.l 2968988958720 (.l 1484494479360 (.l 742247239680 (.l 371123619840 (.l 185561809920 (.l 92780904960 (.l 46390452480 (.l 23195226240 (.l 11597613120 (.l 5798806560 (.l 2899403280 (.l 1449701640 (.l 724850820 (.bc 34767717 (.bc 1 (.bc 26075787 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_243 : Cmd := (.l 1821409279 (.l 910704639 (.l 455352319 (.l 227676159 (.l 113838079 (.l 56919039 (.l 28459519 (.l 14229759 (.l 7114879 (.l 3557439 (.l 1778719 (.l 889359 (.l 444679 (.l 222339 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 9103184255975 (.l 4551592127987 (.l 2275796063993 (.l 1137898031996 (.l 568949015998 (.l 284474507999 (.l 142237253999 (.l 71118626999 (.l 35559313499 (.l 17779656749 (.l 8889828374 (.l 4444914187 (.l 2222457093 (.l 526611141 (.c (.c (.b 263305568 .nil))) (.c (.bc 1 (.b 584617402 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 28295324103815 .nil)))))) +def cmd_247 : Cmd := (.l 1117006469077102 (.l 519710064948032 (.l 229863983823740 (.l 93743064201837 (.l 32530026691309 (.l 6816231596650 (.l 3408115798325 (.l 1704057899163 (.l 852028949582 (.l 358539190987 (.l 179269595493 (.l 89634797746 (.l 44817398873 (.l 15738263946 (.bc 5036498839 (.bc 1 (.b 2832633131 .nil))) (.c (.bc 1 (.b 6670435487 .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 67475283801 (.l 33737641900 (.l 8458619588 (.bc 761509938 (.bc 1 (.b 3467799853 .nil))) (.c (.bc 1 (.b 8410201359 .nil)))) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 9448781749001 (.l 4724390874500 (.l 741386333954 (.l 370693166977 (.l 185346583488 (.l 80403031458 (.l 40201515729 (.l 20100757865 (.l 10050378932 (.bc 798681802 (.bc 1 (.b 4226507661 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.b 12270260283 .nil)))) .nil) .nil) (.c (.bc 1 (.l 1620809103293 (.bc 190509611370 (.bc 1 (.l 619894940273 (.l 60723216678 (.l 30361608339 (.l 15180804170 (.l 7533756326 (.l 3766878163 (.bc 149746290 (.bc 1 (.b 1733692788 .nil))) .nil) (.c (.bc 1 (.b 56645756 .nil)))) .nil) .nil) (.c (.bc 1 (.l 249224253455 (.l 124612126727 (.l 62306063363 (.l 30113366996 (.bc 3124835206 (.bc 1 (.l 11931848289 (.bc 3185614484 (.bc 1 (.b 2780309657 .nil))) .nil))) (.c (.bc 1 (.b 1039664682 .nil)))) .nil) .nil) .nil)))) .nil))) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 14341505409606 (.l 7170752704803 (.l 3585376352402 (.l 1792688176201 (.l 896344088101 (.l 104880694510 (.l 52440347255 (.l 26220173628 (.l 13110086814 (.l 6555043407 (.bc 1599692968 (.bc 1 (.b 1677828732 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 343291349538 (.l 171645674769 (.l 80306219835 (.bc 2100620752 (.bc 1 (.l 7846835381 (.l 3923417690 (.bc 749691676 (.bc 1 (.b 1212017166 .nil))) .nil) (.c (.bc 1 (.l 3449919069 (.l 1724959534 (.bc 456886430 (.bc 1 (.b 405593334 .nil))) .nil) (.c (.bc 1 (.bc 1597514069 (.bc 1 (.l 1369297773 (.l 684648886 (.bc 29479944 (.bc 1 (.b 312844496 .nil))) .nil) (.c (.bc 1 (.l 2529692069 (.l 1264846034 (.bc 54314292 (.bc 1 (.bc 141214917 (.bc 1 (.bc 47071637 (.bc 1 (.bc 13449037 (.bc 1 (.bc 3246317 (.bc 1 (.bc 649261 (.bc 1 (.bc 104717 (.bc 1 (.bc 13087 (.bc 1 (.bc 1187 (.bc 1 (.bc 67 (.bc 1 (.bc 1 (.bc 1 (.bc 65 (.bc 1 (.bc 1119 (.bc 1 (.bc 11965 (.bc 1 (.bc 92749 (.bc 1 (.bc 556509 (.bc 1 (.bc 2689805 (.bc 1 (.bc 10759229 (.bc 1 (.bc 36312405 (.bc 1 (.bc 104902509 (.bc 1 (.b 217032082 .nil))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 5445712167 (.l 2722856083 (.bc 45224194 (.bc 1 (.bc 572195517 (.bc 1 (.b 744008325 .nil))))) .nil) (.c (.bc 1 (.l 10836425835 (.bc 634217727 (.bc 1 (.l 4783995187 (.bc 35590886 (.bc 1 (.bc 1855967517 (.bc 1 (.b 500439184 .nil))))) .nil))) (.c (.bc 1 (.b 4977092778 .nil))))))))))))))))))))))) (.c (.bc 1 (.b 5516617546 .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 21188927710030 (.l 10594463855015 (.l 5297231927507 (.l 1669005932288 (.l 834502966144 (.l 417251483072 (.l 62882061501 (.l 31441030750 (.l 15720515375 (.l 7860257687 (.l 3930128844 (.bc 349661704 (.bc 1 (.b 1615402715 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 145743680032 (.l 19818673046 (.l 9909336523 (.bc 3744600470 (.bc 1 (.b 1210067788 .nil))) .nil) (.c (.bc 1 (.l 53053166967 (.l 26526583483 (.l 13263291742 (.l 6631645871 (.bc 857865256 (.bc 1 (.b 2457957676 .nil))) .nil) .nil) .nil) .nil)))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 979610031463 (.l 489805015731 (.l 158020595636 (.l 79010297818 (.l 39505148909 (.l 19752574455 (.l 9876287227 (.l 4060744526 (.bc 1949965181 (.bc 1 (.b 80407079 .nil))) (.c (.bc 1 (.b 877399085 .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 86881912226 .nil)))) .nil) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 29991048650273 (.l 14995524325136 (.l 7497762162568 (.l 3748881081284 (.l 1874440540642 (.l 937220270321 (.l 468610135161 (.l 234305067580 (.l 117152533790 (.l 58576266895 (.bc 1162971347 (.bc 1 (.l 28125162098 (.l 14062581049 (.bc 2499833098 (.bc 1 (.bc 4407922857 (.bc 1 (.b 123534564 .nil))))) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 38793169590516 (.l 19396584795258 (.l 9698292397629 (.l 4849146198815 (.l 2424573099407 (.l 1212286549704 (.l 606143274852 (.l 303071637426 (.l 37501235780 (.l 18750617890 (.l 9375308945 (.l 4687654472 (.bc 491873951 (.bc 1 (.b 1851953282 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 114034582930 (.l 57017291465 (.l 28508645733 (.l 11667150564 (.l 5833575282 (.bc 2416486855 (.bc 1 (.b 500300783 .nil))) .nil) (.c (.bc 1 (.b 2587172299 .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 38793169590516 (.l 19396584795258 (.l 9698292397629 (.l 4849146198814 (.l 2424573099407 (.l 1212286549704 (.l 606143274852 (.bc 100596166335 (.bc 1 (.l 202475471088 (.l 101237735544 (.l 50618867772 (.l 25309433886 (.l 12654716943 (.l 6327358472 (.bc 1663243783 (.bc 1 (.l 1500435450 (.bc 19327976 (.bc 1 (.b 730889746 .nil))) .nil))) .nil) .nil) .nil) .nil) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) +def cmd_251 : Cmd := (.l 1220396107094883 (.l 610198053547442 (.l 305099026773721 (.l 152549513386861 (.l 76274756693431 (.l 27954289747625 (.l 3918792935543 (.l 1959396467771 (.l 979698233886 (.l 436192897219 (.l 218096448609 (.l 109048224305 (.l 23073958549 (.l 11536979274 (.l 5624499147 (.bc 1125077771 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 572195517 (.bc 1 (.b 18268199 .nil))))))) (.c (.bc 1 (.b 143990487 .nil)))) .nil) (.c (.bc 1 (.l 31450153600 (.l 15725076800 (.l 3560975501 (.bc 171992832 (.bc 1 (.bc 104902509 (.bc 1 (.bc 36312405 (.bc 1 (.bc 10759229 (.bc 1 (.bc 2689805 (.bc 1 (.bc 556509 (.bc 1 (.bc 92749 (.bc 1 (.bc 11965 (.bc 1 (.bc 1119 (.bc 1 (.bc 65 (.bc 1 (.bc 1 (.bc 1 (.bc 63 (.bc 1 (.bc 1053 (.bc 1 (.bc 10909 (.bc 1 (.bc 81837 (.bc 1 (.bc 474669 (.bc 1 (.bc 2215133 (.bc 1 (.bc 8544093 (.bc 1 (.bc 27768309 (.bc 1 (.bc 77134197 (.bc 1 (.bc 185122077 (.bc 1 (.bc 387073437 (.bc 1 (.bc 709634637 (.bc 1 (.b 55108079 .nil))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.bc 1709984301 (.bc 1 (.l 696660269 (.bc 236232644 (.bc 1 (.b 112097487 .nil))) (.c (.bc 1 (.bc 248807237 (.bc 1 (.bc 77216037 (.bc 1 (.bc 20590941 (.bc 1 (.bc 4649567 (.bc 1 (.bc 871863 (.bc 1 (.bc 133347 (.bc 1 (.bc 29817 (.bc 1 (.bc 119139 (.bc 1 (.bc 754055 (.bc 1 (.bc 3895583 (.bc 1 (.bc 16695357 (.bc 1 (.bc 60520677 (.bc 1 (.bc 188286557 (.bc 1 (.bc 508373709 (.bc 1 (.b 763974392 .nil))))))))))))))))))))))))))))))))))))) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 53656219721 (.l 26828109860 (.l 13414054930 (.l 6707027465 (.l 3353513733 (.bc 437636197 (.bc 1 (.l 1239120667 (.bc 359243648 (.bc 1 (.b 260316682 .nil))) .nil))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 10058351938266 (.l 5029175969133 (.l 2514587984566 (.l 936622072156 (.l 284171201929 (.l 70948463815 (.l 35474231907 (.l 14888557461 (.bc 1264234730 (.bc 1 (.l 4621579197 (.bc 1181882588 (.bc 1 (.b 1128907007 .nil))) (.c (.bc 1 (.b 1558464797 .nil)))))) (.c (.bc 1 (.l 2848558489 (.l 1424279244 (.bc 425466809 (.bc 1 (.b 286672810 .nil))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 71137137146 (.l 35568568573 (.l 17784284287 (.l 4609850353 (.bc 2046933406 (.bc 1 (.b 257991767 .nil))) (.c (.bc 1 (.l 4282291787 (.bc 1816324868 (.bc 1 (.b 324821022 .nil))) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 184139834146 (.l 92069917073 (.l 46034958536 (.l 23017479268 (.l 6853513330 (.bc 1312797375 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 709634637 (.bc 1 (.b 257991767 .nil))))))) (.c (.bc 1 (.l 4655226301 (.bc 129081668 (.bc 1 (.bc 185122077 (.bc 1 (.bc 77134197 (.bc 1 (.bc 27768309 (.bc 1 (.bc 8544093 (.bc 1 (.bc 2215133 (.bc 1 (.bc 474669 (.bc 1 (.bc 81837 (.bc 1 (.bc 10909 (.bc 1 (.bc 1053 (.bc 1 (.bc 63 (.bc 1 (.bc 1 (.bc 1 (.bc 61 (.bc 1 (.bc 989 (.bc 1 (.bc 9917 (.bc 1 (.bc 71917 (.bc 1 (.bc 402749 (.bc 1 (.bc 1812381 (.bc 1 (.bc 6731709 (.bc 1 (.bc 21036597 (.bc 1 (.bc 56097597 (.bc 1 (.bc 129024477 (.bc 1 (.bc 258048957 (.bc 1 (.bc 451585677 (.bc 1 (.bc 694747197 (.bc 1 (.b 277608841 .nil))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 320671920124 (.l 160335960062 (.l 80167980031 (.l 22230038329 (.l 11115019164 (.l 5557509582 (.bc 665262355 (.bc 1 (.bc 1131445437 (.bc 1 (.b 982046993 .nil))))) .nil) .nil) (.c (.bc 1 (.l 17853951683 (.l 8926975841 (.l 4403008332 (.bc 220113784 (.bc 1 (.bc 1131445437 (.bc 1 (.b 849944939 .nil))))) (.c (.bc 1 (.b 60479585 .nil)))) .nil) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 10183088599088 (.l 5091544299544 (.l 2350828865879 (.l 1175414432939 (.l 442232917498 (.l 221116458749 (.l 110558229374 (.l 55279114687 (.l 3463684242 (.l 1731842121 (.bc 62686464 (.bc 1 (.bc 694747197 (.bc 1 (.b 108487394 .nil))))) .nil) (.c (.bc 1 (.l 24175873099 (.l 12087936549 (.bc 343098282 (.bc 1 (.bc 258048957 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.bc 6731709 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 61 (.bc 1 (.bc 1 (.bc 1 (.bc 59 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 (.bc 1 (.bc 62927 (.bc 1 (.bc 339819 (.bc 1 (.bc 1472559 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.bc 88704327 (.bc 1 (.bc 169344627 (.bc 1 (.bc 282241047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 530365047 (.bc 1 (.bc 601080387 (.bc 1 (.bc 601080387 (.bc 1 (.bc 530365047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 282241047 (.bc 1 (.bc 169344627 (.bc 1 (.bc 88704327 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.bc 11705847 (.bc 1 (.bc 28614297 (.bc 1 (.bc 60090027 (.bc 1 (.bc 109254597 (.bc 1 (.bc 172986447 (.bc 1 (.bc 239519697 (.bc 1 (.bc 290845347 (.bc 1 (.b 14041003 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 145474298968 (.l 72737149484 (.l 36368574742 (.l 18184287371 (.l 9092143686 (.l 3314734940 (.bc 296194034 (.bc 1 (.bc 290845347 (.bc 1 (.bc 239519697 (.bc 1 (.bc 172986447 (.bc 1 (.bc 109254597 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.bc 69194577 (.bc 1 (.bc 103791867 (.bc 1 (.bc 135727827 (.bc 1 (.b 60795737 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 1231336900 (.bc 94321778 (.bc 1 (.bc 155117517 (.bc 1 (.bc 135727827 (.bc 1 (.bc 103791867 (.bc 1 (.bc 69194577 (.bc 1 (.bc 40060017 (.bc 1 (.b 17454849 .nil))))))))))))) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 194943283890 (.l 54882654354 (.l 27441327177 (.l 13720663589 (.l 6860331795 (.l 3430165897 (.l 1715082948 (.l 857541474 (.bc 2575158 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.bc 26246217 (.bc 1 (.bc 42948357 (.bc 1 (.bc 60843507 (.bc 1 (.bc 74884317 (.bc 1 (.bc 80233197 (.bc 1 (.bc 74884317 (.bc 1 (.b 29810118 .nil))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 42588987588 (.l 21294493794 (.l 10647246897 (.l 5323623449 (.l 2661811725 (.l 1330905863 (.l 665452932 (.bc 31033389 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.bc 26075787 (.bc 1 (.bc 34767717 (.bc 1 (.bc 40116597 (.bc 1 (.bc 40116597 (.bc 1 (.bc 34767717 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) +def cmd_252 : Cmd := (.l 10737108910080 (.l 5368554455040 (.l 2684277227520 (.l 1342138613760 (.l 671069306880 (.l 335534653440 (.l 167767326720 (.l 83883663360 (.l 41941831680 (.l 20970915840 (.l 10485457920 (.l 5242728960 (.l 2621364480 (.l 1310682240 (.l 655341120 (.bc 26075787 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_253 : Cmd := (.l 3221094399 (.l 1610547199 (.l 805273599 (.l 402636799 (.l 201318399 (.l 100659199 (.l 50329599 (.l 25164799 (.l 12582399 (.l 6291199 (.l 3145599 (.l 1572799 (.l 786399 (.l 393199 (.l 196599 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 978959401276633 (.l 438727981158691 (.l 179110116586421 (.l 59799029786987 (.l 8618745498001 (.l 4309372749000 (.l 2154686374500 (.l 1077343187250 (.l 538671593625 (.l 269335796812 (.l 134667898406 (.l 67333949203 (.l 25672906875 (.l 12836453437 (.l 6418226718 (.c (.c (.b 3209113357 .nil))) .nil) .nil) (.c (.bc 1 (.b 7994067723 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 21280769395489 (.l 10640384697744 (.l 5320192348872 (.l 2660096174436 (.l 1330048087218 (.l 275755235213 (.bc 89531476393 (.bc 1 (.l 48346141210 (.l 18482048398 (.l 9241024199 (.l 4620512099 (.bc 727940646 (.bc 1 (.b 1582315400 .nil))) .nil) .nil) (.c (.bc 1 (.l 5691022204 (.l 2845511102 (.bc 420012613 (.bc 1 (.b 1002742935 .nil))) .nil) .nil)))) .nil))) (.c (.bc 1 (.l 389268808393 (.l 194634404196 (.l 97317202098 (.bc 37988371138 (.bc 1 (.b 10670229908 .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 29756028506220 (.l 14878014253110 (.l 7439007126555 (.l 3719503563278 (.l 1859751781639 (.l 929875890819 (.l 464937945410 (.l 232468972705 (.l 116234486352 (.l 35750155097 (.l 17875077548 (.bc 2736649758 (.bc 1 (.b 6200889013 .nil))) .nil) (.c (.bc 1 (.b 22367088076 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 40253873992921 (.l 20126936996460 (.l 10063468498230 (.l 5031734249115 (.l 2515867124558 (.l 1257933562279 (.l 628966781140 (.l 91967894564 (.l 45983947282 (.l 22991973641 (.bc 1730119557 (.bc 1 (.l 9765867261 (.l 4882933630 (.bc 2390553294 (.bc 1 (.b 50913518 .nil))) .nil) .nil))) .nil) .nil) (.c (.bc 1 (.l 222515496003 (.l 111257748001 (.l 55628874001 (.bc 1530887192 (.bc 1 (.bc 5047433141 (.bc 1 (.bc 2966811845 (.bc 1 (.bc 3898989845 (.bc 1 (.l 7975404239 (.bc 295281741 (.bc 1 (.b 3692420375 .nil))) (.c (.bc 1 (.b 6394910724 .nil)))))))))))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 50751719479622 (.l 25375859739811 (.l 12687929869906 (.l 6343964934953 (.l 3171982467476 (.l 1052541988462 (.l 526270994231 (.bc 25697753361 (.bc 1 (.l 237437743751 (.l 118718871875 (.l 59359435938 (.l 29679717969 (.bc 8281117696 (.bc 1 (.b 6558741285 .nil))) .nil) .nil) .nil) .nil))) .nil) (.c (.bc 1 (.l 533449245273 (.l 266724622636 (.l 133362311318 (.l 66681155659 (.l 33340577830 (.l 16670288915 (.l 8335144458 (.l 4167572229 (.bc 19790207 (.bc 1 (.b 2063995905 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.b 50751719479622 .nil)))))) +def cmd_257 : Cmd := (.l 4388306407451938 (.l 2127458849596315 (.l 1008993620557609 (.l 461719555927362 (.l 198345348954887 (.l 75225346264839 (.l 20604608905698 (.l 10302304452849 (.l 2985353506761 (.l 1492676753380 (.l 739010637686 (.l 247333167270 (.l 117128936150 (.bc 2892243293 (.bc 1 (.l 50282997333 (.l 25141498666 (.bc 1707898540 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 508373709 (.bc 1 (.bc 188286557 (.bc 1 (.bc 60520677 (.bc 1 (.bc 16695357 (.bc 1 (.bc 3895581 (.bc 1 (.bc 753981 (.bc 1 (.bc 117807 (.bc 1 (.bc 14277 (.bc 1 (.bc 1257 (.bc 1 (.bc 69 (.bc 1 (.bc 1 (.bc 1 (.bc 67 (.bc 1 (.bc 1187 (.bc 1 (.bc 13087 (.bc 1 (.bc 104717 (.bc 1 (.bc 649261 (.bc 1 (.bc 3246317 (.bc 1 (.bc 13449037 (.bc 1 (.bc 47071637 (.bc 1 (.bc 141214917 (.bc 1 (.bc 367158789 (.bc 1 (.bc 834451797 (.bc 1 (.b 350285446 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 5389227443 (.l 2694613721 (.bc 1318618150 (.bc 1 (.b 28688708 .nil))) .nil) .nil)))))) (.c (.bc 1 (.b 6537647482 .nil)))) (.c (.bc 1 (.l 122172151570 (.l 61086075785 (.l 30543037892 (.bc 1169930339 (.bc 1 (.l 14101588604 (.bc 1521815782 (.bc 1 (.bc 4639918797 (.bc 1 (.b 889059717 .nil))))) .nil))) .nil) .nil) .nil)))) (.c (.bc 1 (.b 7327739001 .nil)))) .nil) (.c (.bc 1 (.l 2165798719660 (.l 374844979955 (.l 187422489977 (.l 93711244988 (.l 46855622494 (.l 23427811247 (.l 11713905624 (.bc 5377834756 (.bc 1 (.b 479118053 .nil))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 708054379872 (.l 354027189936 (.l 177013594968 (.l 88506797484 (.bc 11877837055 (.bc 1 (.l 32375561684 (.l 12267552412 (.bc 4671280580 (.bc 1 (.b 1462495623 .nil))) (.c (.bc 1 (.b 3920228427 .nil)))) .nil))) .nil) .nil) .nil) .nil)))) .nil)))) .nil) (.c (.bc 1 (.l 17008064226718 (.l 8504032113359 (.l 4252016056680 (.l 1045128749631 (.l 522564374815 (.l 261282187408 (.l 130641093704 (.l 65320546852 (.l 27022344690 (.bc 5652525459 (.bc 1 (.b 7858646883 .nil))) (.c (.bc 1 (.l 5637928733 (.bc 1216488412 (.bc 1 (.b 1602475951 .nil))) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1080879278706 (.l 540439639353 (.l 270219819676 (.l 68767830590 (.bc 4346146841 (.bc 1 (.l 30037768451 (.l 11528106042 (.bc 5430845235 (.bc 1 (.b 333207783 .nil))) (.c (.bc 1 (.b 3490778180 .nil)))) .nil))) (.c (.bc 1 (.l 66342079245 (.l 33171039622 (.bc 7339122408 (.bc 1 (.l 5414950293 (.bc 747728236 (.bc 1 (.b 1959746907 .nil))) (.c (.bc 1 (.bc 2406644573 (.bc 1 (.bc 945467509 (.bc 1 (.bc 326023277 (.bc 1 (.bc 97806981 (.bc 1 (.bc 25240511 (.bc 1 (.bc 5521433 (.bc 1 (.bc 1005213 (.bc 1 (.bc 163167 (.bc 1 (.bc 148959 (.bc 1 (.bc 873197 (.bc 1 (.bc 4649641 (.bc 1 (.b 17902610 .nil)))))))))))))))))))))))))))) .nil) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 23947328212601 (.l 11973664106300 (.l 5187924020816 (.l 2047047508330 (.l 442303917927 (.l 4502110854 (.l 2251055427 (.l 1125527714 (.l 562763857 (.bc 2688333 (.bc 1 (.bc 77216037 (.bc 1 (.b 201477553 .nil))))) .nil) .nil) .nil) (.c (.bc 1 (.l 216649848106 (.l 108324924053 (.l 54162462026 (.l 27081231013 (.bc 47329684 (.bc 1 (.bc 696660269 (.bc 1 (.l 1709984301 (.bc 251762392 (.bc 1 (.b 603229755 .nil))) (.c (.bc 1 (.bc 3704965989 (.bc 1 (.l 7124934597 (.bc 496962844 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 834451797 (.bc 1 (.bc 367158789 (.bc 1 (.bc 141214917 (.bc 1 (.bc 47071637 (.bc 1 (.b 6703699 .nil))))))))))))) (.c (.bc 1 (.l 256740652 (.bc 6745336 (.bc 1 (.bc 3246317 (.bc 1 (.bc 649261 (.bc 1 (.bc 104717 (.bc 1 (.bc 13087 (.bc 1 (.bc 1187 (.bc 1 (.bc 67 (.bc 1 (.bc 1 (.bc 1 (.bc 65 (.bc 1 (.bc 1119 (.bc 1 (.bc 11965 (.bc 1 (.bc 92749 (.bc 1 (.bc 556509 (.bc 1 (.bc 2689805 (.bc 1 (.bc 10759229 (.bc 1 (.bc 36312405 (.bc 1 (.b 67186459 .nil))))))))))))))))))))))))))))))))) .nil))))))))))))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 581219836235 (.l 290609918117 (.l 38166918387 (.l 19083459193 (.l 9541729597 (.l 4770864798 (.bc 37716050 (.bc 1 (.bc 262256277 (.bc 1 (.bc 572195517 (.bc 1 (.bc 1096708077 (.bc 1 (.b 416556466 .nil))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 107138040668 (.l 53569020334 (.l 24323756993 (.l 7186568146 (.bc 1439411051 (.bc 1 (.b 2153873019 .nil))) (.c (.bc 1 (.l 4975310347 (.bc 630078256 (.bc 1 (.b 1857576914 .nil))) .nil)))) (.c (.bc 1 (.b 2460753171 .nil)))) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 546914502075 (.l 273457251037 (.l 136728625519 (.l 68364312759 (.l 34182156380 (.l 17091078190 (.l 8545539095 (.bc 1239169829 (.bc 1 (.b 3033599715 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 798908032331 (.l 399454016165 (.l 199727008083 (.l 99863504042 (.l 49931752021 (.l 24965876010 (.l 12482938005 (.l 3977173488 (.bc 1374323142 (.bc 1 (.b 614263599 .nil))) (.c (.bc 1 (.b 2264295512 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 32514429008791 (.l 16257214504395 (.l 8128607252198 (.l 4064303626099 (.l 2032151813050 (.l 652048912019 (.l 326024456009 (.l 163012228005 (.l 49738786631 (.l 24869393315 (.l 12434696657 (.bc 2920801080 (.bc 1 (.b 3296547245 .nil))) .nil) .nil) (.c (.bc 1 (.l 31767327369 (.l 15883663684 (.l 7941831842 (.bc 1111375611 (.bc 1 (.b 2859540307 .nil))) .nil) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 364026994503 (.l 182013497251 (.l 91006748625 (.l 45503374313 (.l 22751687157 (.l 3110725325 (.bc 852394730 (.bc 1 (.b 702967929 .nil))) (.c (.bc 1 (.l 8265118251 (.bc 2080983346 (.bc 1 (.bc 1855967517 (.bc 1 (.b 195608256 .nil))))) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 42777254351439 (.l 21388627175719 (.l 10694313587860 (.l 5347156793930 (.l 2673578396965 (.l 1336789198482 (.l 668394599241 (.l 334197299621 (.l 167098649811 (.l 83549324905 (.l 41774662452 (.l 20887331226 (.bc 901099821 (.bc 1 (.bc 572195517 (.bc 1 (.bc 262256277 (.bc 1 (.bc 104902509 (.bc 1 (.bc 36312405 (.bc 1 (.bc 10759229 (.bc 1 (.bc 2689805 (.bc 1 (.bc 556509 (.bc 1 (.bc 92749 (.bc 1 (.bc 11965 (.bc 1 (.bc 1119 (.bc 1 (.bc 65 (.bc 1 (.bc 1 (.bc 1 (.bc 63 (.bc 1 (.bc 1053 (.bc 1 (.bc 10909 (.bc 1 (.bc 81837 (.bc 1 (.bc 474669 (.bc 1 (.bc 2215133 (.bc 1 (.bc 8544093 (.bc 1 (.bc 27768309 (.bc 1 (.bc 77134197 (.bc 1 (.bc 185122077 (.bc 1 (.bc 387073437 (.bc 1 (.bc 709634637 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 2074316637 (.bc 1 (.b 2296459233 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 54735804240545 (.l 27367902120272 (.l 13683951060136 (.l 6841975530068 (.l 3420987765034 (.l 1710493882517 (.l 855246941259 (.l 427623470629 (.l 213811735314 (.l 106905867657 (.l 45336205798 (.l 532352921 (.l 266176460 (.bc 37146984 (.bc 1 (.b 95941243 .nil))) .nil) (.c (.bc 1 (.l 22135749975 (.bc 2392111478 (.bc 1 (.l 8675763506 (.bc 1041609232 (.bc 1 (.bc 2074316637 (.bc 1 (.b 1221955878 .nil))))) .nil))) .nil)))) (.c (.bc 1 (.l 8116728028 (.l 4058364014 (.l 2029182007 (.bc 415662519 (.bc 1 (.b 598928482 .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 66694354129651 (.l 33347177064825 (.l 16673588532413 (.l 8336794266206 (.l 4168397133103 (.l 2084198566551 (.l 1042099283275 (.l 521049641638 (.l 260524820819 (.l 126197466101 (.l 63098733050 (.l 31549366525 (.l 15774683262 (.l 7887341631 (.bc 547404395 (.bc 1 (.bc 709634637 (.bc 1 (.bc 387073437 (.bc 1 (.bc 185122077 (.bc 1 (.bc 77134197 (.bc 1 (.bc 27768309 (.bc 1 (.bc 8544093 (.bc 1 (.bc 2215133 (.bc 1 (.bc 474669 (.bc 1 (.bc 81837 (.bc 1 (.bc 10909 (.bc 1 (.bc 1053 (.bc 1 (.bc 63 (.bc 1 (.bc 1 (.bc 1 (.bc 61 (.bc 1 (.bc 989 (.bc 1 (.bc 9917 (.bc 1 (.bc 71917 (.bc 1 (.bc 402749 (.bc 1 (.bc 1812381 (.bc 1 (.bc 6731709 (.bc 1 (.bc 21036597 (.bc 1 (.bc 56097597 (.bc 1 (.bc 129024477 (.bc 1 (.bc 258048957 (.bc 1 (.bc 451585677 (.bc 1 (.bc 694747197 (.bc 1 (.b 378635699 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 4064944306 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 66694354129651 (.l 33347177064825 (.l 16673588532413 (.l 8336794266207 (.l 4168397133104 (.l 2084198566552 (.l 1042099283276 (.l 521049641638 (.l 260524820819 (.l 130262410410 (.l 65131205205 (.l 32565602602 (.l 16282801301 (.l 8141400650 (.l 4070700325 (.bc 437205988 (.bc 1 (.bc 1131445437 (.bc 1 (.b 466698732 .nil))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) +def cmd_261 : Cmd := (.l 851083947263801 (.l 425541973631901 (.l 212770986815951 (.l 106385493407976 (.l 53192746703988 (.l 26596373351994 (.l 13298186675997 (.l 6396432748964 (.l 3198216374482 (.bc 22243266969 (.bc 1 (.l 1576864920269 (.l 343120209297 (.l 171560104648 (.l 85780052324 (.l 42890026162 (.l 21445013081 (.l 10722506541 (.bc 561686522 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 942871197 (.bc 1 (.bc 694747197 (.bc 1 (.bc 451585677 (.bc 1 (.bc 258048957 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.bc 6731709 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 61 (.bc 1 (.bc 1 (.bc 1 (.bc 59 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 (.bc 1 (.bc 62927 (.bc 1 (.bc 339819 (.bc 1 (.bc 1472559 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.bc 88704327 (.bc 1 (.bc 169344627 (.bc 1 (.bc 282241047 (.bc 1 (.bc 412506147 (.bc 1 (.b 89641631 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 445312250834 (.l 222656125417 (.l 87932796653 (.l 25626865991 (.l 12813432995 (.l 1358159720 (.bc 440723416 (.bc 1 (.b 238356441 .nil))) (.c (.bc 1 (.l 5048556775 (.bc 362723944 (.bc 1 (.bc 601080387 (.bc 1 (.bc 530365047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 282241047 (.bc 1 (.bc 169344627 (.bc 1 (.bc 88704327 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.b 8462768 .nil))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) (.c (.bc 1 (.l 18339532332 (.l 9169766166 (.l 4584883083 (.bc 3243078 (.bc 1 (.bc 28614297 (.bc 1 (.bc 60090027 (.bc 1 (.bc 109254597 (.bc 1 (.bc 172986447 (.bc 1 (.bc 239519697 (.bc 1 (.bc 290845347 (.bc 1 (.bc 310235037 (.bc 1 (.bc 290845347 (.bc 1 (.bc 239519697 (.bc 1 (.bc 172986447 (.bc 1 (.bc 109254597 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.bc 69194577 (.bc 1 (.b 16794994 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 23395266052 (.l 11697633026 (.l 5848816513 (.l 2924408257 (.bc 86996873 (.bc 1 (.bc 135727827 (.bc 1 (.bc 155117517 (.bc 1 (.bc 155117517 (.bc 1 (.bc 135727827 (.bc 1 (.bc 103791867 (.bc 1 (.bc 69194577 (.bc 1 (.bc 40060017 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.bc 26246217 (.bc 1 (.bc 42948357 (.bc 1 (.bc 60843507 (.bc 1 (.bc 74884317 (.bc 1 (.bc 80233197 (.bc 1 (.bc 74884317 (.bc 1 (.bc 60843507 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.b 3608681 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil)))) .nil) .nil)))) .nil))) .nil) (.c (.bc 1 (.l 252660589032 (.l 126330294516 (.l 63165147258 (.l 31582573629 (.l 15791286815 (.l 7895643408 (.l 3947821704 (.l 1973910852 (.l 986955426 (.bc 5764966 (.bc 1 (.bc 16872567 (.bc 1 (.bc 26075787 (.bc 1 (.bc 34767717 (.bc 1 (.bc 40116597 (.bc 1 (.bc 40116597 (.bc 1 (.bc 34767717 (.bc 1 (.bc 26075787 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_262 : Cmd := (.l 2147805298688 (.l 1073902649344 (.l 536951324672 (.l 268475662336 (.l 134237831168 (.l 67118915584 (.l 33559457792 (.l 16779728896 (.l 8389864448 (.l 4194932224 (.l 2097466112 (.l 1048733056 (.l 524366528 (.l 262183264 (.l 131091632 (.l 65545816 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_263 : Cmd := (.l 13631487 (.l 6815743 (.l 3407871 (.l 1703935 (.l 851967 (.l 425983 (.l 212991 (.l 106495 (.l 53247 (.l 26623 (.l 13311 (.l 6655 (.l 3327 (.l 1663 (.l 831 (.l 415 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 7855370400801533 (.l 3826985522316927 (.l 1828735717724653 (.l 845553450078545 (.l 368444246503115 (.l 142910870560619 (.l 41377842202673 (.l 20688921101336 (.l 5630316584871 (.l 2545528795755 (.l 1272764397877 (.l 636382198938 (.l 318191099469 (.l 36270420649 (.l 18135210324 (.l 9067605162 (.c (.c (.b 4533802579 .nil))) .nil) .nil) (.c (.bc 1 (.l 35393962089 (.bc 17015868383 (.bc 1 (.b 681112658 .nil))) (.c (.bc 1 (.l 16344187597 (.l 8172093798 (.bc 3818818337 (.bc 1 (.b 267228559 .nil))) .nil) (.c (.bc 1 (.bc 8014244989 (.bc 1 (.bc 6865801693 (.bc 1 (.bc 11874394087 (.bc 1 (.bc 24257542247 (.bc 1 (.b 20074996362 .nil)))))))))))))))))) .nil) .nil) .nil) (.c (.bc 1 (.b 269629496677 .nil)))) (.c (.bc 1 (.l 4714143965794 (.l 2357071982897 (.l 988611583853 (.l 494305791926 (.l 247152895963 (.bc 9531983652 (.bc 1 (.l 80459682885 (.l 40229841442 (.bc 7175807210 (.bc 1 (.b 12939113508 .nil))) .nil) (.c (.bc 1 (.b 33584781438 .nil)))))) .nil) .nil) (.c (.bc 1 (.l 189924407593 (.l 94962203796 (.l 47481101898 (.l 23740550949 (.l 10107446060 (.bc 4416240469 (.bc 1 (.b 637482558 .nil))) (.c (.bc 1 (.b 1762829412 .nil)))) .nil) .nil) .nil) .nil)))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 30077593077633 (.l 15038796538816 (.l 7519398269408 (.bc 649664846563 (.bc 1 (.l 3110034288138 (.l 1555017144069 (.l 164229821496 (.l 82114910748 (.bc 27776316795 (.bc 1 (.l 13281138576 (.l 6640569288 (.bc 114409824 (.bc 1 (.b 3205874817 .nil))) .nil) .nil))) .nil) (.c (.bc 1 (.l 613278750535 (.bc 51895755522 (.bc 1 (.l 254743619742 (.l 127371809871 (.l 46474713181 (.bc 2521329339 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 696660269 (.bc 1 (.bc 248807237 (.bc 1 (.bc 77216037 (.bc 1 (.bc 20590941 (.bc 1 (.bc 4649565 (.bc 1 (.bc 871791 (.bc 1 (.bc 132087 (.bc 1 (.bc 15537 (.bc 1 (.bc 1329 (.bc 1 (.bc 71 (.bc 1 (.bc 1 (.bc 1 (.bc 69 (.bc 1 (.bc 1257 (.bc 1 (.bc 14277 (.bc 1 (.bc 117807 (.bc 1 (.bc 753981 (.bc 1 (.bc 3895581 (.bc 1 (.bc 16695357 (.bc 1 (.bc 60520677 (.bc 1 (.bc 188286557 (.bc 1 (.bc 508373709 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 2503355397 (.bc 1 (.b 2643572160 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 17211191751 (.bc 1978007035 (.bc 1 (.b 6627588837 .nil))) .nil)))) .nil) .nil))) .nil)))) .nil) .nil))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 41311252690935 (.l 20655626345467 (.l 9097233418986 (.l 2205694249930 (.l 119601915875 (.l 59800957937 (.l 29900478969 (.l 14950239485 (.l 7475119742 (.l 3737559871 (.bc 965005560 (.bc 1 (.b 903774373 .nil))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 983245209087 (.l 491622604543 (.l 245811302271 (.l 122905651136 (.bc 3389014184 (.bc 1 (.l 58063811381 (.l 29031905690 (.bc 9384777197 (.bc 1 (.b 5131175645 .nil))) .nil) .nil))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 2342922459560 (.l 1171461229780 (.l 585730614890 (.l 292865307445 (.l 146432653723 (.l 73216326862 (.l 23747357571 (.bc 9484568572 (.bc 1 (.b 2389110210 .nil))) (.c (.bc 1 (.b 12860805857 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.b 1230579753745 .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 54332478536154 (.l 27166239268077 (.l 13583119634039 (.l 6791559817020 (.l 3395779908510 (.l 1449175768459 (.l 181629272492 (.l 90814636246 (.l 45407318123 (.l 22703659061 (.l 11351829531 (.bc 3568527894 (.bc 1 (.b 2107386869 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 542958611734 (.l 271479305867 (.l 84501270319 (.l 42250635159 (.bc 16455141603 (.bc 1 (.b 4670175974 .nil))) .nil) (.c (.bc 1 (.l 51238382612 (.bc 11298303799 (.bc 1 (.l 14320887504 (.l 7160443752 (.bc 2655648987 (.bc 1 (.b 924572886 .nil))) .nil) .nil))) .nil)))) .nil) .nil)))) (.c (.bc 1 (.b 248714185793 .nil)))) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 68814408783778 (.l 34407204391889 (.l 17203602195944 (.l 8601801097972 (.l 4300900548986 (.l 2150450274493 (.l 1075225137246 (.l 537612568623 (.l 268806284311 (.l 134403142156 (.l 67201571078 (.bc 4916918855 (.bc 1 (.bc 16244850885 (.bc 1 (.l 7821594869 (.bc 1803376285 (.bc 1 (.b 2107421146 .nil))) (.c (.bc 1 (.bc 3352112085 (.bc 1 (.b 1265308833 .nil)))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 84757043433807 (.l 42378521716903 (.l 21189260858451 (.l 10594630429225 (.l 5297315214612 (.l 2648657607306 (.l 1324328803653 (.l 662164401827 (.l 331082200914 (.l 152407583987 (.l 76203791993 (.l 38101895996 (.bc 6181956 (.bc 1 (.bc 423830261 (.bc 1 (.bc 123047495 (.bc 1 (.bc 30761947 (.bc 1 (.bc 6526649 (.bc 1 (.bc 1168383 (.bc 1 (.bc 312129 (.bc 1 (.bc 1022159 (.bc 1 (.bc 5522841 (.bc 1 (.bc 25240587 (.bc 1 (.bc 97806983 (.bc 1 (.bc 326023277 (.bc 1 (.bc 945467509 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 5414950293 (.bc 1 (.b 9236440911 .nil))))))))))))))))))))))))))))))) .nil) .nil) (.c (.bc 1 (.l 13133516467 (.l 6566758233 (.l 3283379117 (.l 1593459678 (.bc 674138610 (.bc 1 (.b 122591226 .nil))) (.c (.bc 1 (.b 48229878 .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 100699678083836 (.l 50349839041918 (.l 25174919520959 (.l 12587459760479 (.l 6293729880239 (.l 3146864940119 (.l 1573432470059 (.bc 335356699502 (.bc 1 (.b 451359535524 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.b 100699678083836 .nil)))))) +def cmd_267 : Cmd := (.l 10086073662546947 (.l 5043036831273474 (.l 2521518415636737 (.l 1260759207818369 (.l 630379603909185 (.l 315189801954593 (.l 113482298906038 (.l 17559849446636 (.l 8779924723318 (.l 4389962361659 (.l 2194981180830 (.l 1097490590415 (.l 548745295208 (.l 136069604671 (.l 68034802335 (.bc 852216561 (.bc 1 (.l 30942573117 (.bc 1343659789 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 4621579197 (.bc 1 (.b 1913453166 .nil))))))) (.c (.bc 1 (.l 2222611484 (.bc 589902229 (.bc 1 (.b 521403510 .nil))) .nil)))))) .nil) (.c (.bc 1 (.l 138303042930 (.l 19200322275 (.l 9600161137 (.bc 680207079 (.bc 1 (.bc 508373709 (.bc 1 (.bc 188286557 (.bc 1 (.bc 60520677 (.bc 1 (.bc 16695357 (.bc 1 (.bc 3895581 (.bc 1 (.bc 753981 (.bc 1 (.bc 117807 (.bc 1 (.bc 14277 (.bc 1 (.bc 1257 (.bc 1 (.bc 69 (.bc 1 (.bc 1 (.bc 1 (.bc 67 (.bc 1 (.bc 1187 (.bc 1 (.bc 13087 (.bc 1 (.bc 104717 (.bc 1 (.bc 649261 (.bc 1 (.bc 3246317 (.bc 1 (.bc 13449037 (.bc 1 (.bc 47071637 (.bc 1 (.bc 141214917 (.bc 1 (.bc 367158789 (.bc 1 (.bc 834451797 (.bc 1 (.bc 1668903597 (.bc 1 (.b 264949735 .nil))))))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 49951199187 (.l 24975599593 (.bc 2687725861 (.bc 1 (.bc 4639918797 (.bc 1 (.b 5160155132 .nil))))) .nil) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 39181300006380 (.l 8101151364062 (.l 2231440133574 (.l 309135090379 (.l 154567545189 (.l 77283772594 (.l 38641886297 (.l 19320943148 (.l 7681576640 (.bc 1335731185 (.bc 1 (.b 2505057132 .nil))) (.c (.bc 1 (.b 1978894931 .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 806584976405 (.l 403292488202 (.l 201646244101 (.l 100823122050 (.l 50411561025 (.l 25205780512 (.bc 4625353297 (.bc 1 (.b 7977536956 .nil))) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 1819135548454 (.l 909567774227 (.l 454783887114 (.l 227391943557 (.l 55260409380 (.l 27630204690 (.l 13815102345 (.bc 1097598341 (.bc 1 (.b 5809952828 .nil))) .nil) .nil) (.c (.bc 1 (.l 58435562395 (.l 29217781197 (.l 14608890599 (.bc 3265182468 (.bc 1 (.b 4039262828 .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 11489498639125 (.l 4686866981699 (.l 2343433490849 (.l 90449601679 (.l 45224800839 (.l 22612400420 (.l 11306200210 (.bc 1953618368 (.bc 1 (.b 3699481734 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 1081267143743 (.l 540633571871 (.l 116341858099 (.l 58170929049 (.l 29085464525 (.bc 1254045016 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 4639918797 (.bc 1 (.b 2152882123 .nil))))))) .nil) .nil) (.c (.bc 1 (.l 105911554733 (.l 29684239207 (.l 14842119603 (.bc 799793473 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 834451797 (.bc 1 (.bc 367158789 (.bc 1 (.bc 141214917 (.bc 1 (.bc 47071637 (.bc 1 (.bc 13449037 (.bc 1 (.bc 3246317 (.bc 1 (.bc 649261 (.bc 1 (.bc 104717 (.bc 1 (.bc 13087 (.bc 1 (.bc 1187 (.bc 1 (.bc 67 (.bc 1 (.bc 1 (.bc 1 (.bc 65 (.bc 1 (.bc 1119 (.bc 1 (.bc 11965 (.bc 1 (.bc 92749 (.bc 1 (.bc 556509 (.bc 1 (.bc 2689805 (.bc 1 (.bc 10759229 (.bc 1 (.bc 36312405 (.bc 1 (.bc 104902509 (.bc 1 (.bc 262256277 (.bc 1 (.bc 572195517 (.bc 1 (.bc 1096708077 (.bc 1 (.b 1458515613 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 23271538156 (.l 11635769078 (.bc 397451903 (.bc 1 (.bc 2783951277 (.bc 1 (.b 2636481353 .nil))))) .nil) .nil)))) (.c (.bc 1 (.l 48063373097 (.l 24031686548 (.l 7893166273 (.bc 1075453683 (.bc 1 (.b 2871129450 .nil))) (.c (.bc 1 (.l 4122676998 (.bc 1536793405 (.bc 1 (.b 524545091 .nil))) .nil)))) .nil) .nil))))))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 1057882337860 (.l 528941168930 (.l 264470584465 (.l 119642061823 (.bc 3674776591 (.bc 1 (.bc 24358432589 (.bc 1 (.l 14880046685 (.l 7440023342 (.l 3720011671 (.bc 638516198 (.bc 1 (.b 1221489635 .nil))) .nil) .nil) (.c (.bc 1 (.b 16907775037 .nil)))))))) (.c (.bc 1 (.l 12593230406 (.bc 1832420744 (.bc 1 (.b 4464194456 .nil))) .nil)))) .nil) .nil) .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 44112602071256 (.l 22056301035628 (.l 11028150517814 (.l 5514075258907 (.l 1829035517575 (.l 914517758787 (.l 457258879394 (.l 31667741881 (.l 15833870940 (.l 7916935470 (.bc 285884442 (.bc 1 (.b 3672583290 .nil))) .nil) .nil) (.c (.bc 1 (.l 70716365807 (.l 35358182903 (.l 17679091452 (.bc 39351746 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 572195517 (.bc 1 (.bc 262256277 (.bc 1 (.bc 104902509 (.bc 1 (.bc 36312405 (.bc 1 (.bc 10759229 (.bc 1 (.bc 2689805 (.bc 1 (.bc 556509 (.bc 1 (.bc 92749 (.bc 1 (.bc 11965 (.bc 1 (.bc 1119 (.bc 1 (.bc 65 (.bc 1 (.bc 1 (.bc 1 (.bc 63 (.bc 1 (.bc 1053 (.bc 1 (.bc 10909 (.bc 1 (.bc 81837 (.bc 1 (.bc 474669 (.bc 1 (.bc 2215133 (.bc 1 (.bc 8544093 (.bc 1 (.bc 27768309 (.bc 1 (.bc 77134197 (.bc 1 (.bc 185122077 (.bc 1 (.bc 387073437 (.bc 1 (.bc 709634637 (.bc 1 (.b 675728461 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) (.c (.bc 1 (.l 126245332003 (.l 63122666001 (.l 24442412146 (.bc 470604416 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2074316637 (.bc 1 (.b 1297137534 .nil))))))))))))) (.c (.bc 1 (.l 7118920851 (.bc 340480861 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 709634637 (.bc 1 (.bc 387073437 (.bc 1 (.bc 185122077 (.bc 1 (.bc 77134197 (.bc 1 (.bc 27768309 (.bc 1 (.bc 8544093 (.bc 1 (.bc 2215133 (.bc 1 (.bc 474669 (.bc 1 (.bc 81837 (.bc 1 (.bc 10909 (.bc 1 (.bc 1053 (.bc 1 (.bc 63 (.bc 1 (.bc 1 (.bc 1 (.bc 61 (.bc 1 (.bc 989 (.bc 1 (.bc 9917 (.bc 1 (.bc 71917 (.bc 1 (.bc 402749 (.bc 1 (.bc 1812381 (.bc 1 (.bc 6731709 (.bc 1 (.bc 21036597 (.bc 1 (.bc 56097597 (.bc 1 (.bc 129024477 (.bc 1 (.bc 258048957 (.bc 1 (.b 201348843 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil))))))) .nil) .nil) (.c (.bc 1 (.l 928002111876 (.l 464001055938 (.l 232000527969 (.bc 673174442 (.bc 1 (.l 115327089540 (.l 57663544770 (.l 28831772385 (.bc 166090028 (.bc 1 (.bc 694747197 (.bc 1 (.bc 942871197 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 1202160777 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 942871197 (.bc 1 (.bc 694747197 (.bc 1 (.bc 451585677 (.bc 1 (.bc 258048957 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.bc 6731709 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 61 (.bc 1 (.bc 1 (.bc 1 (.bc 59 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 (.bc 1 (.bc 62927 (.bc 1 (.bc 339819 (.bc 1 (.bc 1472559 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.bc 88704327 (.bc 1 (.bc 169344627 (.bc 1 (.bc 282241047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 530365047 (.bc 1 (.bc 601080387 (.bc 1 (.bc 601080387 (.bc 1 (.bc 530365047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 282241047 (.bc 1 (.bc 169344627 (.bc 1 (.bc 88704327 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.bc 11705847 (.bc 1 (.bc 28614297 (.bc 1 (.bc 60090027 (.bc 1 (.bc 109254597 (.bc 1 (.bc 172986447 (.bc 1 (.bc 239519697 (.bc 1 (.bc 290845347 (.bc 1 (.bc 310235037 (.bc 1 (.bc 290845347 (.bc 1 (.bc 239519697 (.bc 1 (.bc 172986447 (.bc 1 (.bc 109254597 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.bc 69194577 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_268 : Cmd := (.l 131347316604928 (.l 65673658302464 (.l 32836829151232 (.l 16418414575616 (.l 8209207287808 (.l 4104603643904 (.l 2052301821952 (.l 1026150910976 (.l 513075455488 (.l 256537727744 (.l 128268863872 (.l 64134431936 (.l 32067215968 (.l 16033607984 (.l 8016803992 (.l 4008401996 (.bc 103791867 (.bc 1 (.bc 135727827 (.bc 1 (.bc 155117517 (.bc 1 (.bc 155117517 (.bc 1 (.bc 135727827 (.bc 1 (.bc 103791867 (.bc 1 (.bc 69194577 (.bc 1 (.bc 40060017 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.bc 26246217 (.bc 1 (.bc 42948357 (.bc 1 (.bc 60843507 (.bc 1 (.bc 74884317 (.bc 1 (.bc 80233197 (.bc 1 (.bc 74884317 (.bc 1 (.bc 60843507 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.bc 26075787 (.bc 1 (.bc 34767717 (.bc 1 (.bc 40116597 (.bc 1 (.bc 40116597 (.bc 1 (.bc 34767717 (.bc 1 (.bc 26075787 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_269 : Cmd := (.l 68744249343 (.l 34372124671 (.l 17186062335 (.l 8593031167 (.l 4296515583 (.l 2148257791 (.l 1074128895 (.l 537064447 (.l 268532223 (.l 134266111 (.l 67133055 (.l 33566527 (.l 16783263 (.l 8391631 (.l 4195815 (.l 2097907 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 6996249335665381 (.l 3295692352286639 (.l 1479419184551453 (.l 605287924638045 (.l 198243533874603 (.l 20758492925221 (.l 10379246462610 (.l 5189623231305 (.l 1572371363077 (.l 312533759157 (.l 156266879578 (.l 78133439789 (.l 39066719894 (.l 19533359947 (.l 1866917385 (.l 933458692 (.c (.c (.b 466729344 .nil))) .nil) (.c (.bc 1 (.b 7899762585 .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 473651922378 .nil)))) (.c (.bc 1 (.l 1022440252572 (.l 511220126286 (.l 255610063143 (.l 127805031571 (.l 63902515786 (.bc 25659690729 (.bc 1 (.b 6291567161 .nil))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 78363274012077 (.l 39181637006038 (.l 11853401754357 (.l 5926700877178 (.l 2963350438589 (.l 1481675219294 (.l 740837609647 (.l 370418804823 (.l 185209402411 (.l 92604701206 (.bc 6754548718 (.bc 1 (.b 39547801882 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 7737416748659 (.l 3868708374329 (.l 1934354187165 (.l 967177093582 (.l 356356652511 (.l 178178326255 (.l 89089163127 (.l 44544581564 (.bc 18014484875 (.bc 1 (.b 4257805904 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 127231894277 (.l 63615947138 (.bc 22580529532 (.bc 1 (.b 9227444034 .nil))) .nil) .nil)))) .nil) .nil) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 104400428444416 (.l 52200214222208 (.l 26100107111104 (.l 13050053555552 (.l 6525026777776 (.l 3109207643694 (.l 1554603821847 (.l 777301910923 (.bc 92633764462 (.bc 1 (.l 296017190997 (.l 148008595498 (.bc 11871798820 (.bc 1 (.l 62132498926 (.bc 14755029591 (.bc 1 (.b 16311219869 .nil))) .nil))) .nil) .nil))) .nil) .nil) (.c (.bc 1 (.b 153305745191 .nil)))) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 134421667637678 (.l 67210833818839 (.l 33605416909419 (.l 16802708454709 (.l 8401354227354 (.bc 287371889010 (.bc 1 (.l 3913305224664 (.l 1956652612332 (.l 978326306166 (.l 489163153083 (.l 244581576541 (.l 122290788270 (.l 61145394135 (.bc 9990858096 (.bc 1 (.bc 19339108197 (.bc 1 (.b 1242730768 .nil))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil))) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 168426991591863 (.l 84213495795931 (.l 42106747897965 (.l 21053373948982 (.l 10526686974491 (.l 5263343487245 (.l 2631671743623 (.l 1315835871811 (.l 657917935905 (.l 328958967952 (.l 164479483976 (.l 59819814415 (.l 29909907207 (.bc 9587169821 (.bc 1 (.b 5367783780 .nil))) .nil) (.c (.bc 1 (.l 22419927570 (.l 11209963785 (.bc 47166512 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 945467509 (.bc 1 (.bc 326023277 (.bc 1 (.bc 97806981 (.bc 1 (.bc 25240509 (.bc 1 (.bc 5521359 (.bc 1 (.bc 1003881 (.bc 1 (.bc 147627 (.bc 1 (.bc 16869 (.bc 1 (.bc 1403 (.bc 1 (.bc 73 (.bc 1 (.bc 1 (.bc 1 (.bc 71 (.bc 1 (.bc 1329 (.bc 1 (.bc 15537 (.bc 1 (.bc 132087 (.bc 1 (.bc 871791 (.bc 1 (.bc 4649565 (.bc 1 (.bc 20590941 (.bc 1 (.bc 77216037 (.bc 1 (.bc 248807237 (.bc 1 (.bc 696660269 (.bc 1 (.b 700996385 .nil))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 202432315546048 (.l 101216157773024 (.l 50608078886512 (.l 25304039443256 (.l 12652019721628 (.l 6326009860814 (.l 3163004930407 (.l 1581502465203 (.l 790751232602 (.l 80755834576 (.l 40377917288 (.l 20188958644 (.l 10094479322 (.l 3786003238 (.bc 1008987916 (.bc 1 (.b 884013700 .nil))) (.c (.bc 1 (.b 1261236420 .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 314619781722 (.l 157309890861 (.l 78654945431 (.l 39327472715 (.l 19663736358 (.bc 2190334077 (.bc 1 (.bc 7124934597 (.bc 1 (.b 516599499 .nil))))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.b 202432315546048 .nil)))))) +def cmd_273 : Cmd := (.l 33800131691843364 (.l 16383960317230711 (.l 7777607267386596 (.l 3576163379926751 (.l 1559111384354884 (.l 616192645422851 (.l 194801225865096 (.l 21157537407361 (.l 10578768703680 (.l 5054892012339 (.l 2527446006169 (.l 1263723003084 (.l 631861501542 (.l 315930750771 (.l 157965375385 (.l 78982687693 (.bc 5519830094 (.bc 1 (.bc 18728399517 (.bc 1 (.b 15243114230 .nil))))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 234492339498 (.l 117246169749 (.l 58623084875 (.l 29311542437 (.bc 10323150149 (.bc 1 (.b 4332621066 .nil))) .nil) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 76243075525184 (.l 9040842909156 (.l 4520421454578 (.l 2260210727289 (.l 1130105363644 (.l 565052681822 (.l 282526340911 (.l 141263170455 (.bc 9777112012 (.bc 1 (.l 60854473212 (.bc 3787907697 (.bc 1 (.b 26639328906 .nil))) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 29080694853433 (.l 8892252085860 (.l 1837310174387 (.l 918655087193 (.l 459327543596 (.l 229663771798 (.l 86216076279 (.l 19596216896 (.bc 5171408511 (.bc 1 (.b 4626699934 .nil))) (.c (.bc 1 (.b 23511821240 .nil)))) (.c (.bc 1 (.b 28615809617 .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 2608815868540 (.l 1304407934270 (.l 246675100942 (.l 123337550471 (.l 61668775235 (.bc 8594133627 (.bc 1 (.l 22240253988 (.bc 7511634021 (.bc 1 (.b 3608492970 .nil))) .nil))) .nil) .nil) (.c (.bc 1 (.l 405528866190 (.l 202493776338 (.l 101246888169 (.bc 1826191769 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 546877759 (.bc 1 (.bc 153809445 (.bc 1 (.bc 37288599 (.bc 1 (.bc 7695035 (.bc 1 (.bc 1480515 (.bc 1 (.bc 1334291 (.bc 1 (.bc 6545003 (.bc 1 (.bc 30763431 (.bc 1 (.bc 123047573 (.bc 1 (.bc 423830263 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 16244850885 (.bc 1 (.b 1281900833 .nil))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.b 270656754 .nil)))) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 5648095340853 (.l 2824047670426 (.l 1412023835213 (.l 706011917606 (.l 353005958803 (.l 176502979401 (.l 28819443767 (.bc 6391216690 (.bc 1 (.b 8018505190 .nil))) (.c (.bc 1 (.l 50281681317 (.bc 23792232225 (.bc 1 (.b 1348608430 .nil))) (.c (.bc 1 (.b 9150364611 .nil))))))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 113295096846326 (.l 56647548423163 (.l 13152917825167 (.l 6576458912583 (.l 3288229456291 (.l 1641737532268 (.l 820868766134 (.l 177141666020 (.l 88570833010 (.l 44285416505 (.bc 19827758600 (.bc 1 (.b 2314949650 .nil))) .nil) .nil) (.c (.bc 1 (.l 233292717044 (.l 81517262345 (.bc 21986740860 (.bc 1 (.l 18771890309 (.bc 5420079435 (.bc 1 (.b 3965865716 .nil))) .nil))) (.c (.bc 1 (.l 35129096174 (.l 17564548087 (.bc 8248307880 (.bc 1 (.b 533966161 .nil))) .nil) .nil)))) .nil)))) .nil) (.c (.bc 1 (.b 2377195875 .nil)))) .nil) .nil) (.c (.bc 1 (.l 15170856386411 (.l 3908393414460 (.l 1954196707230 (.l 977098353615 (.l 488549176808 (.l 69414359637 (.l 34707179818 (.l 17353589909 (.bc 6516681065 (.bc 1 (.b 2160113886 .nil))) .nil) .nil) (.c (.bc 1 (.l 157649704425 (.l 78824852212 (.l 39412426106 (.bc 1544852102 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 696660269 (.bc 1 (.bc 248807237 (.bc 1 (.bc 77216037 (.bc 1 (.bc 20590941 (.bc 1 (.bc 4649565 (.bc 1 (.bc 871791 (.bc 1 (.bc 132087 (.bc 1 (.bc 15537 (.bc 1 (.bc 1329 (.bc 1 (.bc 71 (.bc 1 (.bc 1 (.bc 1 (.bc 69 (.bc 1 (.bc 1257 (.bc 1 (.bc 14277 (.bc 1 (.bc 117807 (.bc 1 (.bc 753981 (.bc 1 (.bc 3895581 (.bc 1 (.bc 16695357 (.bc 1 (.bc 60520677 (.bc 1 (.bc 188286557 (.bc 1 (.bc 508373709 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 4621579197 (.bc 1 (.b 6297227252 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) (.c (.bc 1 (.l 17210524336 (.l 8605262168 (.l 4302631084 (.bc 1295367145 (.bc 1 (.b 855948394 .nil))) .nil) .nil) .nil))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 3677034778742 (.l 1838517389371 (.l 919258694686 (.l 459629347343 (.l 58886057945 (.l 29443028972 (.bc 4488575376 (.bc 1 (.b 10232939107 .nil))) .nil) (.c (.bc 1 (.l 39238479277 (.l 19619239638 (.l 9809619819 (.bc 2919099479 (.bc 1 (.b 1985710427 .nil))) .nil) .nil) (.c (.bc 1 (.bc 33620242471 (.bc 1 (.bc 54872132123 (.bc 1 (.l 43197761843 (.l 21598880921 (.l 10799440461 (.bc 1568486964 (.bc 1 (.b 3831233263 .nil))) .nil) .nil) .nil))))))))))) .nil) .nil) .nil) .nil)))) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 163363046754588 (.l 81681523377294 (.l 5232977082011 (.l 2616488541005 (.l 1308244270502 (.l 654122135251 (.l 327061067625 (.l 163530533813 (.bc 63650540304 (.bc 1 (.b 18114726600 .nil))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 35607784606633 (.l 13815025921884 (.l 6907512960942 (.l 823626769817 (.l 411813384908 (.l 205906692454 (.l 102953346227 (.l 51476673113 (.l 25738336556 (.bc 3143101570 (.bc 1 (.b 9726066705 .nil))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 2630129710651 (.l 1315064855325 (.l 270955807908 (.l 76566799428 (.l 38283399714 (.l 19141699857 (.bc 8424203892 (.bc 1 (.b 1146646033 .nil))) .nil) .nil) (.c (.bc 1 (.l 58911104523 (.l 29455552261 (.bc 6431841797 (.bc 1 (.b 8295934331 .nil))) .nil) .nil)))) (.c (.bc 1 (.l 386576619752 (.l 193288309876 (.l 96644154938 (.l 48322077469 (.bc 8684459098 (.bc 1 (.bc 14615744217 (.bc 1 (.b 860835414 .nil))))) .nil) .nil) .nil) .nil)))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 3988866381429 (.l 1994433190714 (.l 997216595357 (.l 498608297678 (.l 249304148839 (.l 80884477028 (.bc 9044584342 (.bc 1 (.b 31397654169 .nil))) (.c (.bc 1 (.l 43767597388 (.l 21883798694 (.l 10941899347 (.bc 164410074 (.bc 1 (.b 5306539596 .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 228970305608488 (.l 114485152804244 (.l 57242576402122 (.l 28621288201061 (.l 14310644100531 (.l 6602379217555 (.l 3301189608777 (.l 1650594804389 (.l 825297402195 (.l 412648701098 (.l 206324350549 (.l 50065498412 (.bc 2286054801 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 508373709 (.bc 1 (.bc 188286557 (.bc 1 (.bc 60520677 (.bc 1 (.bc 16695357 (.bc 1 (.bc 3895581 (.bc 1 (.bc 753981 (.bc 1 (.bc 117807 (.bc 1 (.bc 14277 (.bc 1 (.bc 1257 (.bc 1 (.bc 69 (.bc 1 (.bc 1 (.bc 1 (.bc 67 (.bc 1 (.bc 1187 (.bc 1 (.bc 13087 (.bc 1 (.bc 104717 (.bc 1 (.bc 649261 (.bc 1 (.bc 3246317 (.bc 1 (.bc 13449037 (.bc 1 (.bc 47071637 (.bc 1 (.bc 141214917 (.bc 1 (.bc 367158789 (.bc 1 (.bc 834451797 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 4639918797 (.bc 1 (.b 2972631058 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 53096676860 (.bc 3523255257 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 9075135297 (.bc 1 (.b 5830089970 .nil))))))) .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 552942832708 (.l 276471416354 (.l 138235708177 (.l 69117854089 (.l 34558927044 (.l 17279463522 (.l 8639731761 (.bc 3245045327 (.bc 1 (.b 1074820550 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 312640253766544 (.l 156320126883272 (.l 78160063441636 (.l 39080031720818 (.l 19540015860409 (.l 9319778076413 (.l 4659889038206 (.l 2329944519103 (.l 1164972259551 (.l 582486129775 (.bc 18360821687 (.bc 1 (.l 272882243198 (.l 136441121599 (.l 68220560800 (.bc 4749934636 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 834451797 (.bc 1 (.bc 367158789 (.bc 1 (.bc 141214917 (.bc 1 (.bc 47071637 (.bc 1 (.bc 13449037 (.bc 1 (.bc 3246317 (.bc 1 (.bc 649261 (.bc 1 (.bc 104717 (.bc 1 (.bc 13087 (.bc 1 (.bc 1187 (.bc 1 (.bc 67 (.bc 1 (.bc 1 (.bc 1 (.bc 65 (.bc 1 (.bc 1119 (.bc 1 (.bc 11965 (.bc 1 (.bc 92749 (.bc 1 (.bc 556509 (.bc 1 (.bc 2689805 (.bc 1 (.bc 10759229 (.bc 1 (.bc 36312405 (.bc 1 (.bc 104902509 (.bc 1 (.bc 262256277 (.bc 1 (.bc 572195517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 3711935037 (.bc 1 (.b 1757260489 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 450229853788 (.l 225114926894 (.l 112557463447 (.l 56278731723 (.l 28139365861 (.l 14069682931 (.l 7034841465 (.bc 3299353974 (.bc 1 (.b 218066755 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 414372891228756 (.l 207186445614378 (.l 103593222807189 (.l 51796611403595 (.l 25898305701798 (.l 12949152850899 (.l 6474576425450 (.l 3237288212725 (.l 1618644106362 (.l 774270833188 (.l 387135416594 (.l 193567708297 (.l 59783699554 (.l 29891849777 (.bc 891952002 (.bc 1 (.bc 4667212437 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 3711935037 (.bc 1 (.b 1266902544 .nil))))))))) .nil) (.c (.bc 1 (.l 37000154592 (.l 18500077296 (.bc 1517048732 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 572195517 (.bc 1 (.bc 262256277 (.bc 1 (.bc 104902509 (.bc 1 (.bc 36312405 (.bc 1 (.bc 10759229 (.bc 1 (.bc 2689805 (.bc 1 (.bc 556509 (.bc 1 (.bc 92749 (.bc 1 (.bc 11965 (.bc 1 (.bc 1119 (.bc 1 (.bc 65 (.bc 1 (.bc 1 (.bc 1 (.bc 63 (.bc 1 (.bc 1053 (.bc 1 (.bc 10909 (.bc 1 (.bc 81837 (.bc 1 (.bc 474669 (.bc 1 (.bc 2215133 (.bc 1 (.bc 8544093 (.bc 1 (.bc 27768309 (.bc 1 (.bc 77134197 (.bc 1 (.bc 185122077 (.bc 1 (.bc 387073437 (.bc 1 (.bc 709634637 (.bc 1 (.bc 1146332877 (.bc 1 (.b 1246142797 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 35051219990 (.l 17525609995 (.l 8762804997 (.l 4381402499 (.l 2190701249 (.bc 391475600 (.bc 1 (.b 703875021 .nil))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 516105528690968 (.l 258052764345484 (.l 129026382172742 (.l 64513191086371 (.l 32256595543185 (.bc 728983211646 (.bc 1 (.l 15399314559943 (.l 3967166581038 (.l 1983583290519 (.l 991791645259 (.l 495895822630 (.l 247947911315 (.l 123973955657 (.l 61986977829 (.l 30993488915 (.l 15496744458 (.bc 658543948 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2074316637 (.bc 1 (.b 348299198 .nil))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 3732490698930 (.l 1866245349465 (.l 933122674733 (.l 466561337367 (.l 233280668684 (.l 116640334342 (.l 58320167171 (.l 29160083585 (.l 14580041792 (.bc 1289319199 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 709634637 (.bc 1 (.bc 387073437 (.bc 1 (.bc 185122077 (.bc 1 (.bc 77134197 (.bc 1 (.bc 27768309 (.bc 1 (.bc 8544093 (.bc 1 (.bc 2215133 (.bc 1 (.bc 474669 (.bc 1 (.bc 81837 (.bc 1 (.bc 10909 (.bc 1 (.bc 1053 (.bc 1 (.bc 63 (.bc 1 (.bc 1 (.bc 1 (.bc 61 (.bc 1 (.bc 989 (.bc 1 (.bc 9917 (.bc 1 (.bc 71917 (.bc 1 (.bc 402749 (.bc 1 (.bc 1812381 (.bc 1 (.bc 6731709 (.bc 1 (.bc 21036597 (.bc 1 (.bc 56097597 (.bc 1 (.bc 129024477 (.bc 1 (.bc 258048957 (.bc 1 (.bc 451585677 (.bc 1 (.bc 694747197 (.bc 1 (.bc 942871197 (.bc 1 (.b 893866896 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil))) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 168505164666756 (.l 84252582333378 (.l 42126291166689 (.l 21063145583345 (.l 10531572791673 (.l 5265786395837 (.l 2632893197919 (.l 1316446598960 (.l 658223299480 (.l 329111649740 (.l 164555824870 (.l 82277912435 (.l 20093975641 (.l 10046987820 (.l 5023493910 (.l 2511746955 (.bc 237578541 (.bc 1 (.b 1018294933 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 21044980574 (.l 10522490287 (.l 5261245144 (.l 2630622572 (.bc 183865843 (.bc 1 (.bc 1131445437 (.bc 1 .nil)))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) +def cmd_274 : Cmd := (.l 347600364024212 (.l 173800182012106 (.l 86900091006053 (.l 43450045503026 (.l 21725022751513 (.l 10862511375756 (.l 5431255687878 (.l 2715627843939 (.l 1357813921969 (.l 678906960984 (.l 339453480492 (.l 169726740246 (.l 84863370123 (.l 42431685061 (.l 21215842530 (.l 10607921265 (.bc 942871197 (.bc 1 (.bc 694747197 (.bc 1 (.bc 451585677 (.bc 1 (.bc 258048957 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.bc 6731709 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 61 (.bc 1 (.bc 1 (.bc 1 (.bc 59 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 (.bc 1 (.bc 62927 (.bc 1 (.bc 339819 (.bc 1 (.bc 1472559 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.bc 88704327 (.bc 1 (.bc 169344627 (.bc 1 (.bc 282241047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 530365047 (.bc 1 (.bc 601080387 (.bc 1 (.b 594035518 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_278 : Cmd := (.l 765463994735827 (.l 382731997367914 (.l 191365998683957 (.l 95682999341979 (.l 47841499670990 (.l 23920749835495 (.l 11960374917748 (.l 5980187458874 (.l 2990093729437 (.l 1495046864719 (.l 747523432360 (.l 373761716180 (.l 186880858090 (.l 93440429045 (.l 29110238358 (.l 14555119179 (.l 7277559589 (.bc 7044869 (.bc 1 (.bc 530365047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 282241047 (.bc 1 (.bc 169344627 (.bc 1 (.bc 88704327 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.bc 11705847 (.bc 1 (.bc 28614297 (.bc 1 (.bc 60090027 (.bc 1 (.bc 109254597 (.bc 1 (.bc 172986447 (.bc 1 (.bc 239519697 (.bc 1 (.bc 290845347 (.bc 1 (.bc 310235037 (.bc 1 (.bc 290845347 (.bc 1 (.bc 239519697 (.bc 1 (.bc 172986447 (.bc 1 (.bc 109254597 (.bc 1 (.b 43866221 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) (.c (.bc 1 (.l 17609976162 (.l 8804988081 (.l 4402494041 (.bc 16223806 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.bc 69194577 (.bc 1 (.bc 103791867 (.bc 1 (.bc 135727827 (.bc 1 (.bc 155117517 (.bc 1 (.bc 155117517 (.bc 1 (.bc 135727827 (.bc 1 (.bc 103791867 (.bc 1 (.bc 69194577 (.bc 1 (.bc 40060017 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.bc 26246217 (.bc 1 (.bc 42948357 (.bc 1 (.bc 60843507 (.bc 1 (.bc 74884317 (.bc 1 (.bc 80233197 (.bc 1 (.bc 74884317 (.bc 1 (.bc 60843507 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.bc 26075787 (.bc 1 (.bc 34767717 (.bc 1 (.bc 40116597 (.bc 1 (.bc 40116597 (.bc 1 (.bc 34767717 (.bc 1 (.bc 26075787 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_279 : Cmd := (.l 1099511365631 (.l 549755682815 (.l 274877841407 (.l 137438920703 (.l 68719460351 (.l 34359730175 (.l 17179865087 (.l 8589932543 (.l 4294966271 (.l 2147483135 (.l 1073741567 (.l 536870783 (.l 268435391 (.l 134217695 (.l 67108847 (.l 33554423 (.l 16777211 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 19764044498862080 (.l 9882022249431040 (.l 4941011124715520 (.l 2470505562357760 (.l 1235252781178880 (.l 617626390589440 (.l 248760729298559 (.l 124380364649279 (.l 62190182324639 (.l 15310001256401 (.l 7655000628200 (.l 2663096576261 (.l 1331548288130 (.l 665774144065 (.l 332887072032 (.l 166443536016 (.l 14969889677 (.c (.c (.b 7484944836 .nil))) (.c (.bc 1 (.b 68251878328 .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1164403737836 (.l 582201868918 (.l 291100934459 (.l 145550467229 (.l 72775233615 (.bc 33790357289 (.bc 1 (.b 2597259515 .nil))) .nil) .nil) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 15785089905915 (.l 5386487452439 (.l 2693243726219 (.l 1346621863110 (.l 673310931555 (.l 336655465778 (.bc 5729548034 (.bc 1 (.l 162598184852 (.bc 69960488443 (.bc 1 (.b 11338603980 .nil))) .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 2506057500515 (.l 1253028750257 (.l 626514375128 (.l 229407022833 (.bc 60780778367 (.bc 1 (.b 53922733046 .nil))) (.c (.bc 1 (.l 83850164728 (.l 41925082364 (.l 20962541182 (.bc 10267199483 (.bc 1 (.b 214071105 .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil)))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 60052465996158 (.l 30026232998079 (.bc 886847365729 (.bc 1 (.l 14126269133308 (.l 7063134566654 (.l 3531567283327 (.l 1765783641664 (.l 882891820832 (.l 441445910416 (.l 220722955208 (.l 55327984109 (.bc 26490690161 (.bc 1 (.b 1173301890 .nil))) (.c (.bc 1 (.l 55033493492 (.bc 15071548993 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 1271490789 .nil))))))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil))) +def cmd_280 : Cmd := (.l 45272040101207891 (.l 21221106883155323 (.l 9509313487273959 (.l 3967090002478197 (.l 1441924159717209 (.l 357559824465581 (.l 178779912232790 (.l 55314662251711 (.l 27657331125855 (.l 13330903930925 (.l 6665451965462 (.l 3332725982731 (.l 1666362991365 (.l 819762286843 (.l 409881143421 (.l 151121399917 (.bc 1 (.bc 423830261 (.bc 1 (.bc 123047493 (.bc 1 (.bc 30761871 (.bc 1 (.bc 6525243 (.bc 1 (.bc 1151511 (.bc 1 (.bc 164499 (.bc 1 (.bc 18275 (.bc 1 (.bc 1479 (.bc 1 (.bc 75 (.bc 1 (.bc 1 (.bc 1 (.bc 73 (.bc 1 (.bc 1403 (.bc 1 (.bc 16869 (.bc 1 (.bc 147627 (.bc 1 (.bc 1003881 (.bc 1 (.bc 5521359 (.bc 1 (.bc 25240509 (.bc 1 (.bc 97806981 (.bc 1 (.bc 326023277 (.bc 1 (.bc 945467509 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 30942573117 (.bc 1 (.b 4640792916 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.b 53819171790 .nil)))) .nil) (.c (.bc 1 (.b 13419208836 .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.b 497761631999 .nil)))) .nil) (.c (.bc 1 (.l 34075293864681 (.l 17037646932340 (.l 8518823466170 (.l 4259411733085 (.l 2129705866542 (.bc 15829794067 (.bc 1 (.l 1049023139201 (.l 524511569600 (.l 261052231450 (.l 59934326030 (.bc 6374044060 (.bc 1 (.b 23593118952 .nil))) (.c (.bc 1 (.l 70480305437 (.bc 33969167803 (.bc 1 (.b 1270984912 .nil))) (.c (.bc 1 (.b 111484252 .nil))))))) (.c (.bc 1 (.b 1203553347 .nil)))) .nil) .nil))) .nil) .nil) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 363402255393020 (.l 181701127696510 (.l 90850563848255 (.bc 400412216173 (.bc 1 (.l 45024869707951 (.l 22512434853975 (.l 11256217426988 (.l 3852978056183 (.l 1926489028091 (.l 244250998003 (.l 122125499001 (.bc 31398671351 (.bc 1 (.bc 15797309837 (.bc 1 (.bc 6318923933 (.bc 1 (.bc 2242198815 (.bc 1 (.bc 700687207 (.bc 1 (.bc 191098047 (.bc 1 (.bc 44983637 (.bc 1 (.bc 9175553 (.bc 1 (.bc 2814809 (.bc 1 (.bc 7879297 (.bc 1 (.bc 37308437 (.bc 1 (.bc 153811007 (.bc 1 (.bc 546877839 (.bc 1 (.bc 1695321055 (.bc 1 (.b 1915688635 .nil))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 460951080079 (.l 230475540039 (.bc 2707914241 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 24066445757 (.bc 1 (.l 46413859677 (.bc 14458867387 (.bc 1 (.b 8748062448 .nil))) (.c (.bc 1 (.b 30875843375 .nil)))))))))) .nil) (.c (.bc 1 (.l 233746286709 (.l 116873143354 (.bc 49574846733 (.bc 1 (.b 8861724941 .nil))) .nil) (.c (.bc 1 (.b 24296149245 .nil)))))))))) .nil) (.c (.bc 1 (.l 1775130657308 (.l 887565328654 (.bc 91038912315 (.bc 1 (.l 72858721751 (.l 36429360875 (.l 18214680438 (.bc 2869374925 (.bc 1 (.b 6237965291 .nil))) .nil) .nil) (.c (.bc 1 (.bc 88492374597 (.bc 1 (.bc 161720434273 (.bc 1 (.l 29672221379 (.l 14836110689 (.bc 7240830306 (.bc 1 (.b 177225035 .nil))) .nil) .nil)))))))))) .nil) .nil)))) .nil) .nil) .nil))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 541620841521886 (.l 270810420760943 (.l 135405210380471 (.l 49960025520838 (.l 12374532398266 (.l 6187266199133 (.bc 1017730875446 (.bc 1 (.l 2075902224117 (.l 1037951112058 (.l 518975556029 (.l 147594593595 (.l 73797296797 (.l 36898648399 (.bc 10030362215 (.bc 1 (.b 8418961982 .nil))) .nil) .nil) (.c (.bc 1 (.b 111893184417 .nil)))) .nil) .nil) .nil))) .nil) (.c (.bc 1 (.l 12605480362150 (.l 6302740181075 (.l 3151370090538 (.l 1575685045269 (.l 787842522634 (.l 393921261317 (.l 172190098549 (.l 80611498200 (.bc 35156676723 (.bc 1 (.b 5149072374 .nil))) (.c (.bc 1 (.b 5483551071 .nil)))) (.c (.bc 1 (.b 24770532107 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 17742579669395 (.l 8871289834697 (.l 1759748075294 (.l 879874037647 (.l 439937018823 (.l 219968509412 (.bc 24904317953 (.bc 1 (.b 85079936750 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 2675896842051 (.l 1337948421025 (.l 668974210513 (.l 334487105257 (.l 167243552629 (.l 83621776314 (.l 41810888157 (.bc 16648436080 (.bc 1 (.b 4257007996 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 787566741158779 (.l 393783370579389 (.l 196891685289694 (.bc 1161301690306 (.bc 1 (.l 97284540954538 (.l 48642270477269 (.l 24321135238634 (.l 12160567619317 (.l 6080283809658 (.l 3040141904829 (.bc 317895871060 (.bc 1 (.l 1202175081351 (.l 422075844283 (.l 211037922141 (.l 97579603390 (.bc 5682989498 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 945467509 (.bc 1 (.bc 326023277 (.bc 1 (.bc 97806981 (.bc 1 (.bc 25240509 (.bc 1 (.bc 5521359 (.bc 1 (.bc 1003881 (.bc 1 (.bc 147627 (.bc 1 (.bc 16869 (.bc 1 (.bc 1403 (.bc 1 (.bc 73 (.bc 1 (.bc 1 (.bc 1 (.bc 71 (.bc 1 (.bc 1329 (.bc 1 (.bc 15537 (.bc 1 (.bc 132087 (.bc 1 (.bc 871791 (.bc 1 (.bc 4649565 (.bc 1 (.bc 20590941 (.bc 1 (.bc 77216037 (.bc 1 (.bc 248807237 (.bc 1 (.bc 696660269 (.bc 1 (.bc 1709984301 (.bc 1 (.b 956049810 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 7939357677 (.bc 2748916177 (.bc 1 (.b 1220762658 .nil))) .nil)))) .nil) (.c (.bc 1 (.l 179011696389 (.l 89505848194 (.l 44752924097 (.bc 5904171938 (.bc 1 (.bc 12214173597 (.bc 1 (.b 4258116507 .nil))))) .nil) .nil) .nil)))) .nil))) .nil) .nil) .nil) .nil) .nil) .nil))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 1101239954303699 (.l 550619977151849 (.l 275309988575925 (.l 137654994287962 (.l 68827497143981 (.l 34413748571990 (.l 17206874285995 (.l 8603437142998 (.l 4301718571499 (.l 2150859285750 (.l 1075429642875 (.l 537714821438 (.l 268857410719 (.l 134428705360 (.bc 14470283010 (.bc 1 (.bc 25751549337 (.bc 1 (.b 26992520327 .nil))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 1414913167448619 (.l 707456583724309 (.l 353728291862155 (.l 176864145931078 (.l 88432072965539 (.l 44216036482770 (.l 22108018241385 (.l 3107560490149 (.l 1553780245074 (.l 776890122537 (.l 388445061268 (.l 194222530634 (.l 97111265317 (.l 48555632659 (.l 24277816329 (.bc 4818217090 (.bc 1 (.b 7320691072 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 7946448630541 (.l 3973224315270 (.l 1986612157635 (.l 993306078817 (.l 496653039408 (.l 248326519704 (.l 124163259852 (.bc 51166013333 (.bc 1 (.l 10915616590 (.bc 2441566057 (.bc 1 (.b 3016242235 .nil))) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 1414913167448619 (.l 707456583724309 (.l 353728291862155 (.l 176864145931078 (.l 88432072965539 (.l 44216036482770 (.l 22108018241385 (.l 9570375130395 (.l 4785187565197 (.l 2392593782599 (.l 1196296891300 (.l 598148445650 (.l 299074222825 (.l 149537111413 (.bc 38068403088 (.bc 1 (.b 36700152615 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1483633990295 (.l 741816995147 (.l 370908497573 (.l 185454248787 (.l 92727124394 (.l 46363562197 (.bc 5030800252 (.bc 1 (.b 18150980843 .nil))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) +def cmd_284 : Cmd := (.l 50416143389789433 (.l 25208071694894717 (.l 12604035847447359 (.l 6302017923723680 (.l 3151008961861840 (.l 1382812416771865 (.l 172620604616549 (.l 86310302308274 (.l 43155151154137 (.l 21577575577069 (.l 10788787788535 (.l 5394393894267 (.l 2477005763950 (.l 1238502881975 (.l 619251440988 (.l 309625720494 (.l 154812860247 (.bc 10739159998 (.bc 1 (.bc 31810737417 (.bc 1 (.bc 25751549337 (.bc 1 (.b 9104983362 .nil))))))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 220191183180 .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 518785603769380 (.l 95312988839057 (.l 47656494419528 (.l 23828247209764 (.l 11914123604882 (.l 4853468291886 (.l 2426734145943 (.l 214240652921 (.l 107120326460 (.l 53560163230 (.l 26780081615 (.bc 2742441680 (.bc 1 (.b 10647599124 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 999126420047 (.l 499563210023 (.l 249781605012 (.l 26242827108 (.bc 1566574473 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 3704965989 (.bc 1 (.b 724938486 .nil))))))) (.c (.bc 1 (.l 98647975395 (.bc 985045813 (.bc 1 (.bc 696660269 (.bc 1 (.bc 248807237 (.bc 1 (.bc 77216037 (.bc 1 (.bc 20590941 (.bc 1 (.bc 4649565 (.bc 1 (.bc 871791 (.bc 1 (.bc 132087 (.bc 1 (.bc 15537 (.bc 1 (.bc 1329 (.bc 1 (.bc 71 (.bc 1 (.bc 1 (.bc 1 (.bc 69 (.bc 1 (.bc 1257 (.bc 1 (.bc 14277 (.bc 1 (.bc 117807 (.bc 1 (.bc 753981 (.bc 1 (.bc 3895581 (.bc 1 (.bc 16695357 (.bc 1 (.bc 60520677 (.bc 1 (.bc 188286557 (.bc 1 (.bc 508373709 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 14615744217 (.bc 1 (.b 4840648749 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 1103593510552 (.l 551796755276 (.l 275898377638 (.l 137949188819 (.l 68974594410 (.l 34487297205 (.bc 12354344448 (.bc 1 (.b 4889304152 .nil))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 164079813045630 (.l 24325781949936 (.l 12162890974968 (.bc 718026043992 (.bc 1 (.l 5363419443489 (.l 2681709721744 (.l 1340854860872 (.l 670427430436 (.l 118987465031 (.l 59493732515 (.l 29746866257 (.bc 7651387976 (.bc 1 (.b 7222045149 .nil))) .nil) .nil) (.c (.bc 1 (.l 216226250184 (.l 53861550998 (.l 26930775499 (.bc 9972948047 (.bc 1 (.b 3492439699 .nil))) .nil) (.c (.bc 1 (.l 54251574091 (.l 27125787045 (.bc 11123304517 (.bc 1 (.b 2439589003 .nil))) .nil) .nil)))) .nil)))) .nil) .nil) .nil) .nil))) .nil) (.c (.bc 1 (.l 57714124572876 (.l 11559365649412 (.l 5779682824706 (.l 2889841412353 (.l 1444920706177 (.l 722460353088 (.l 361230176544 (.l 180615088272 (.l 34406958455 (.bc 8696216114 (.bc 1 (.bc 7592594397 (.bc 1 (.b 914668710 .nil))))) (.c (.bc 1 (.l 55900585678 (.bc 3706910485 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 508373709 (.bc 1 (.bc 188286557 (.bc 1 (.bc 60520677 (.bc 1 (.bc 16695357 (.bc 1 (.bc 3895581 (.bc 1 (.bc 753981 (.bc 1 (.bc 117807 (.bc 1 (.bc 14277 (.bc 1 (.bc 1257 (.bc 1 (.bc 69 (.bc 1 (.bc 1 (.bc 1 (.bc 67 (.bc 1 (.bc 1187 (.bc 1 (.bc 13087 (.bc 1 (.bc 104717 (.bc 1 (.bc 649261 (.bc 1 (.bc 3246317 (.bc 1 (.bc 13449037 (.bc 1 (.bc 47071637 (.bc 1 (.bc 141214917 (.bc 1 (.bc 367158789 (.bc 1 (.bc 834451797 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 6495886317 (.bc 1 (.b 2595011887 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 17297696637023 (.l 8648848318511 (.l 4324424159255 (.l 2162212079628 (.l 674182535811 (.l 337091267905 (.l 168545633952 (.l 84272816976 (.bc 5524846010 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 6495886317 (.bc 1 (.b 3845547655 .nil))))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 406923504000 (.l 203461752000 (.l 101730876000 (.l 50865438000 (.bc 794371142 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 834451797 (.bc 1 (.bc 367158789 (.bc 1 (.bc 141214917 (.bc 1 (.bc 47071637 (.bc 1 (.bc 13449037 (.bc 1 (.bc 3246317 (.bc 1 (.bc 649261 (.bc 1 (.bc 104717 (.bc 1 (.bc 13087 (.bc 1 (.bc 1187 (.bc 1 (.bc 67 (.bc 1 (.bc 1 (.bc 1 (.bc 65 (.bc 1 (.bc 1119 (.bc 1 (.bc 11965 (.bc 1 (.bc 92749 (.bc 1 (.bc 556509 (.bc 1 (.bc 2689805 (.bc 1 (.bc 10759229 (.bc 1 (.bc 36312405 (.bc 1 (.bc 104902509 (.bc 1 (.bc 262256277 (.bc 1 (.bc 572195517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 4407922857 (.bc 1 (.b 3763144843 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil)))) .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 192692064159052 (.l 96346032079526 (.l 48173016039763 (.l 24086508019882 (.l 12043254009941 (.l 6021627004971 (.l 3010813502486 (.l 1505406751243 (.l 752703375622 (.l 376351687811 (.l 188175843906 (.l 35721682942 (.bc 904067594 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 572195517 (.bc 1 (.bc 262256277 (.bc 1 (.bc 104902509 (.bc 1 (.bc 36312405 (.bc 1 (.bc 10759229 (.bc 1 (.bc 2689805 (.bc 1 (.bc 556509 (.bc 1 (.bc 92749 (.bc 1 (.bc 11965 (.bc 1 (.bc 1119 (.bc 1 (.bc 65 (.bc 1 (.bc 1 (.bc 1 (.bc 63 (.bc 1 (.bc 1053 (.bc 1 (.bc 10909 (.bc 1 (.bc 81837 (.bc 1 (.bc 474669 (.bc 1 (.bc 2215133 (.bc 1 (.bc 8544093 (.bc 1 (.bc 27768309 (.bc 1 (.bc 77134197 (.bc 1 (.bc 185122077 (.bc 1 (.bc 387073437 (.bc 1 (.bc 709634637 (.bc 1 (.b 712450458 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 58366239008 (.bc 433882417 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 709634637 (.bc 1 (.bc 387073437 (.bc 1 (.bc 185122077 (.bc 1 (.bc 77134197 (.bc 1 (.bc 27768309 (.bc 1 (.bc 8544093 (.bc 1 (.bc 2215133 (.bc 1 (.bc 474669 (.bc 1 (.bc 81837 (.bc 1 (.bc 10909 (.bc 1 (.bc 1053 (.bc 1 (.bc 63 (.bc 1 (.bc 1 (.bc 1 (.bc 61 (.bc 1 (.bc 989 (.bc 1 (.bc 9917 (.bc 1 (.bc 71917 (.bc 1 (.bc 402749 (.bc 1 (.bc 1812381 (.bc 1 (.bc 6731709 (.bc 1 (.bc 21036597 (.bc 1 (.bc 56097597 (.bc 1 (.bc 129024477 (.bc 1 (.bc 258048957 (.bc 1 (.bc 451585677 (.bc 1 (.bc 694747197 (.bc 1 (.bc 942871197 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 1202160777 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 942871197 (.bc 1 (.bc 694747197 (.bc 1 (.bc 451585677 (.bc 1 (.bc 258048957 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.bc 6731709 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 61 (.bc 1 (.bc 1 (.bc 1 (.bc 59 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 (.bc 1 (.bc 62927 (.bc 1 (.bc 339819 (.bc 1 (.bc 1472559 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.bc 88704327 (.bc 1 (.bc 169344627 (.bc 1 (.bc 282241047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 530365047 (.bc 1 (.bc 601080387 (.bc 1 (.bc 601080387 (.bc 1 (.bc 530365047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 282241047 (.bc 1 (.bc 169344627 (.bc 1 (.bc 88704327 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.bc 11705847 (.bc 1 (.bc 28614297 (.bc 1 (.bc 60090027 (.bc 1 (.bc 109254597 (.bc 1 (.bc 172986447 (.bc 1 (.bc 239519697 (.bc 1 (.bc 290845347 (.bc 1 (.bc 310235037 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) +def cmd_285 : Cmd := (.l 401492800962560 (.l 200746400481280 (.l 100373200240640 (.l 50186600120320 (.l 25093300060160 (.l 12546650030080 (.l 6273325015040 (.l 3136662507520 (.l 1568331253760 (.l 784165626880 (.l 392082813440 (.l 196041406720 (.l 98020703360 (.l 49010351680 (.l 24505175840 (.l 12252587920 (.l 6126293960 (.bc 290845347 (.bc 1 (.bc 239519697 (.bc 1 (.bc 172986447 (.bc 1 (.bc 109254597 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.bc 69194577 (.bc 1 (.bc 103791867 (.bc 1 (.bc 135727827 (.bc 1 (.bc 155117517 (.bc 1 (.bc 155117517 (.bc 1 (.bc 135727827 (.bc 1 (.bc 103791867 (.bc 1 (.bc 69194577 (.bc 1 (.bc 40060017 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.bc 26246217 (.bc 1 (.bc 42948357 (.bc 1 (.bc 60843507 (.bc 1 (.bc 74884317 (.bc 1 (.bc 80233197 (.bc 1 (.bc 74884317 (.bc 1 (.bc 60843507 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.bc 26075787 (.bc 1 (.bc 34767717 (.bc 1 (.bc 40116597 (.bc 1 (.bc 40116597 (.bc 1 (.bc 34767717 (.bc 1 (.bc 26075787 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_286 : Cmd := (.l 388099997695 (.l 194049998847 (.l 97024999423 (.l 48512499711 (.l 24256249855 (.l 12128124927 (.l 6064062463 (.l 3032031231 (.l 1516015615 (.l 758007807 (.l 379003903 (.l 189501951 (.l 94750975 (.l 47375487 (.l 23687743 (.l 11843871 (.l 5921935 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 34127837489790976 (.l 17063918744895488 (.l 8531959372447744 (.l 4265979686223872 (.l 1252370594737437 (.l 626185297368718 (.l 313092648684359 (.l 92551002545221 (.l 40431587878291 (.l 20215793939145 (.l 10107896969572 (.l 5053948484786 (.l 2526974242393 (.l 997807392611 (.l 402244109909 (.l 1810794083 (.l 905397041 (.c (.c (.b 452698518 .nil))) .nil) (.c (.bc 1 (.b 199311260868 .nil)))) (.c (.bc 1 (.l 96659586393 (.l 48329793196 (.bc 12405275215 (.bc 1 (.b 11759621380 .nil))) .nil) .nil)))) (.c (.bc 1 (.b 265679728582 .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 5843913394316 .nil)))) (.c (.bc 1 (.l 63995321796955 (.l 31997660898477 (.l 15998830449238 (.l 7999415224619 (.l 3999707612310 (.l 1065727241863 (.l 532863620931 (.l 266431810466 (.l 133215905233 (.bc 57906829147 (.bc 1 (.b 8701123466 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 934126564289 (.l 313505094225 (.l 156752547112 (.bc 16391389470 (.bc 1 (.b 61984884083 .nil))) .nil) (.c (.bc 1 (.b 153558187916 .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 880619248374496 (.l 440309624187248 (.l 36655728355477 (.l 18327864177738 (.l 9163932088869 (.l 4581966044434 (.l 2290983022217 (.l 1145491511108 (.l 572745755554 (.l 286372877777 (.l 143186438888 (.l 71593219444 (.bc 13366656375 (.bc 1 (.b 22429953344 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 183499083738144 (.l 91749541869072 (.l 45874770934536 (.l 22937385467268 (.l 11468692733634 (.l 5734346366817 (.l 2867173183409 (.l 254766301098 (.l 127383150549 (.l 63691575275 (.bc 23983906333 (.bc 1 (.b 7861881302 .nil))) .nil) .nil) (.c (.bc 1 (.l 349081348273 (.l 174540674136 (.l 87270337068 (.bc 16204564455 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 546877757 (.bc 1 (.bc 153809367 (.bc 1 (.bc 37287117 (.bc 1 (.bc 7676757 (.bc 1 (.bc 1316013 (.bc 1 (.bc 182777 (.bc 1 (.bc 19757 (.bc 1 (.bc 1557 (.bc 1 (.bc 77 (.bc 1 (.bc 1 (.bc 1 (.bc 75 (.bc 1 (.bc 1479 (.bc 1 (.bc 18275 (.bc 1 (.bc 164499 (.bc 1 (.bc 1151511 (.bc 1 (.bc 6525243 (.bc 1 (.bc 30761871 (.bc 1 (.bc 123047493 (.bc 1 (.bc 423830261 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 3352112085 (.bc 1 (.b 3981698356 .nil))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) (.c (.bc 1 (.l 188193783315 (.l 94096891657 (.l 10089880349 (.bc 3839896512 (.bc 1 (.b 1205043659 .nil))) (.c (.bc 1 (.l 36958565476 (.bc 15039807224 (.bc 1 (.b 3439475511 .nil))) .nil)))) .nil) (.c (.bc 1 (.bc 161351096351 (.bc 1 (.l 250212808873 (.l 125106404436 (.l 62553202218 (.bc 6560646233 (.bc 1 (.b 24715954873 .nil))) .nil) .nil) (.c (.bc 1 (.l 229981253780 (.l 114990626890 (.l 57495313444 (.bc 25565726444 (.bc 1 (.b 3181930275 .nil))) (.c .nil)) .nil) .nil))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil))) +def cmd_287 : Cmd := (.l 41907570831368921 (.l 17162940448019199 (.l 5689432895101989 (.l 851486757401035 (.l 425743378700517 (.l 212871689350258 (.l 106435844675129 (.l 53217922337564 (.l 26608961168782 (.l 4493682230425 (.l 2246841115212 (.l 1031076054983 (.l 515538027491 (.l 236222354901 (.l 118111177450 (.bc 1 (.b 59055588723 .nil)) .nil) (.c (.bc 1 (.b 21546658841 .nil)))) .nil) (.c (.bc 1 (.b 92344502620 .nil)))) .nil) (.c (.bc 1 (.l 8810798353963 (.bc 319079789989 (.bc 1 (.l 4086319386989 (.l 2043159693494 (.l 1021579846747 (.l 510789923374 (.l 255394961687 (.bc 25535429872 (.bc 1 (.l 51037462557 (.bc 19380362620 (.bc 1 (.b 6138368655 .nil))) (.c (.bc 1 (.bc 22116233773 (.bc 1 (.bc 8561122751 (.bc 1 (.bc 2942886025 (.bc 1 (.bc 891785257 (.bc 1 (.bc 236081687 (.bc 1 (.bc 54159193 (.bc 1 (.bc 11990365 (.bc 1 (.bc 10694109 (.bc 1 (.bc 45187737 (.bc 1 (.bc 191119447 (.bc 1 (.bc 700688849 (.bc 1 (.bc 2242198897 (.bc 1 (.bc 6318923935 (.bc 1 (.b 6801516345 .nil)))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil))) .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1993229690149956 (.l 996614845074978 (.l 498307422537489 (.l 249153711268745 (.l 22388054268159 (.l 11194027134079 (.l 5597013567039 (.l 2798506783520 (.l 1399253391760 (.l 699626695880 (.l 239894256475 (.bc 7580188191 (.bc 1 (.l 112366940043 (.bc 5205699395 (.bc 1 (.bc 35240152717 (.bc 1 (.b 15737617903 .nil))))) .nil))) (.c (.bc 1 (.b 109919091462 .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 102188801366211 (.l 18320932617246 (.l 9160466308623 (.l 4580233154312 (.l 2290116577156 (.l 1145058288578 (.l 572529144289 (.l 286264572144 (.bc 27262914667 (.bc 1 (.l 115869371402 (.bc 12983446928 (.bc 1 (.b 44951238770 .nil))) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 32773468065856 (.l 16386734032928 (.l 8193367016464 (.l 4096683508232 (.l 2048341754116 (.l 690690466588 (.l 345345233294 (.bc 10995178387 (.bc 1 (.l 161677438257 (.bc 74269460012 (.bc 1 (.b 6569259113 .nil))) .nil))) .nil) (.c (.bc 1 (.l 333480410467 (.l 166740205233 (.bc 44477455151 (.bc 1 (.b 38892647462 .nil))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil)))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 2892037328907607 (.l 1446018664453803 (.l 723009332226901 (.l 262262596004956 (.l 131131298002478 (.l 65565649001239 (.l 32782824500620 (.l 16391412250310 (.l 8195706125155 (.l 4097853062577 (.bc 1286475772532 (.bc 1 (.l 762450758753 (.l 381225379376 (.l 190612689688 (.l 95306344844 (.bc 9187482612 (.bc 1 (.b 38465689807 .nil))) .nil) .nil) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 99242070108491 (.l 49621035054245 (.l 24810517527122 (.l 12405258763561 (.l 6202629381780 (.l 3101314690890 (.l 1550657345445 (.l 775328672723 (.l 387664336362 (.l 193832168181 (.bc 8160497024 (.bc 1 (.b 88755587064 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 3790844967665258 (.l 1895422483832629 (.l 947711241916315 (.l 473855620958157 (.l 236927810479078 (.bc 2161937400633 (.bc 1 (.l 116301967838903 (.l 46777192659435 (.l 23388596329717 (.l 11694298164859 (.l 5847149082429 (.l 2923574541215 (.l 1461787270607 (.bc 296654004750 (.bc 1 (.l 434239630551 (.l 217119815275 (.l 108559907637 (.bc 11729779377 (.bc 1 (.b 42550174438 .nil))) .nil) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 11373791260013 (.l 5686895630006 (.l 2843447815003 (.l 1421723907501 (.l 710861953751 (.l 355430976876 (.l 177715488438 (.bc 58466782534 (.bc 1 (.b 30390961682 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil))) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 3790844967665258 (.l 1895422483832629 (.l 947711241916314 (.l 473855620958157 (.l 236927810479079 (.l 118463905239540 (.l 59231952619770 (.l 29615976309885 (.l 14807988154943 (.l 7403994077471 (.l 3701997038736 (.l 1850998519368 (.l 925499259684 (.l 462749629842 (.l 231374814921 (.bc 84094879212 (.bc 1 (.b 31592528245 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) +def cmd_291 : Cmd := (.l 177570344157068655 (.l 88785172078534328 (.l 44392586039267164 (.l 19298259832323815 (.l 6540471359643346 (.l 1367240072294289 (.l 683620036147144 (.l 341810018073572 (.l 170905009036786 (.l 61491505916566 (.l 30745752958283 (.l 15372876479141 (.l 7686438239570 (.l 3843219119785 (.l 1742974501398 (.l 871487250699 (.l 435743625350 (.bc 2109973754 (.bc 1 (.bc 102042235617 (.bc 1 (.bc 75422521977 (.bc 1 (.b 38297081318 .nil))))))) .nil) .nil) (.c (.bc 1 (.l 178635058491 (.l 89317529245 (.bc 21989186801 (.bc 1 (.l 22669577818 (.bc 990006596 (.bc 1 (.b 10344782310 .nil))) .nil))) .nil) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 23960998601824 (.l 1889646121092 (.l 944823060546 (.l 472411530273 (.bc 151109247990 (.bc 1 (.b 85096517144 .nil))) .nil) .nil) (.c (.bc 1 (.l 10090853179817 (.l 5045426589908 (.l 229699039008 (.l 114849519504 (.l 57424759752 (.l 28712379876 (.l 14356189938 (.bc 5061366158 (.bc 1 (.b 2116728808 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 2293014255943 (.l 1146507127971 (.l 573253563985 (.l 286626781993 (.l 143313390996 (.bc 14128122077 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 423830261 (.bc 1 (.bc 123047493 (.bc 1 (.bc 30761871 (.bc 1 (.bc 6525243 (.bc 1 (.bc 1151511 (.bc 1 (.bc 164499 (.bc 1 (.bc 18275 (.bc 1 (.bc 1479 (.bc 1 (.bc 75 (.bc 1 (.bc 1 (.bc 1 (.bc 73 (.bc 1 (.bc 1403 (.bc 1 (.bc 16869 (.bc 1 (.bc 147627 (.bc 1 (.bc 1003881 (.bc 1 (.bc 5521359 (.bc 1 (.bc 25240509 (.bc 1 (.bc 97806981 (.bc 1 (.bc 326023277 (.bc 1 (.bc 945467509 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 19339108197 (.bc 1 (.b 5106041746 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 1902995607527381 (.l 554908490131373 (.l 40278292086615 (.l 20139146043307 (.l 10069573021654 (.l 5034786510827 (.bc 1128915154769 (.bc 1 (.l 1388478100642 (.l 694239050321 (.l 347119525161 (.l 173559762580 (.l 86779881290 (.l 43389940645 (.bc 8197232077 (.bc 1 (.b 13497738242 .nil))) .nil) .nil) .nil) .nil) .nil) .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 237175952979068 (.l 40772343326745 (.l 20386171663372 (.l 10193085831686 (.l 5096542915843 (.l 2548271457921 (.l 1274135728960 (.l 637067864480 (.l 166835598359 (.l 83417799179 (.bc 30982210615 (.bc 1 (.b 10726688972 .nil))) .nil) (.c (.bc 1 (.b 151698333878 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 77815633162786 (.l 38907816581393 (.l 19453908290697 (.l 9726954145349 (.l 4863477072675 (.l 2388403164490 (.l 1194201582245 (.l 597100791123 (.l 90457489690 (.bc 8911014315 (.bc 1 (.b 36317730527 .nil))) (.c (.bc 1 (.l 208092905868 (.bc 30838270688 (.bc 1 (.bc 70690527597 (.bc 1 (.b 2517654643 .nil))))) .nil)))) .nil) .nil) (.c (.bc 1 (.b 43335371845 .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 396589313632314 (.l 198294656816157 (.l 99147328408078 (.l 49573664204039 (.l 24786832102019 (.l 12393416051009 (.l 6196708025504 (.l 3098354012752 (.bc 427053589281 (.bc 1 (.l 1122123417092 (.l 561061708546 (.l 217984649767 (.bc 8548187173 (.bc 1 (.bc 57562286757 (.bc 1 (.b 42881850947 .nil))))) (.c (.bc 1 (.l 62546204503 (.bc 1598097908 (.bc 1 (.b 29675004340 .nil))) .nil)))) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 3108658556518558 (.l 1554329278259279 (.l 777164639129640 (.l 54631223908594 (.l 27315611954297 (.l 13657805977149 (.l 6828902988575 (.l 3414451494288 (.l 1707225747144 (.l 359473352120 (.l 179736676060 (.l 66723392548 (.l 33361696274 (.bc 1267568777 (.bc 1 (.b 15413279357 .nil))) .nil) (.c (.bc 1 (.l 23144945479 (.l 11572472739 (.bc 3925828839 (.bc 1 (.b 1860407528 .nil))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 494139521449 (.l 247069760724 (.l 123534880362 (.l 61767440181 (.bc 8969493061 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 945467509 (.bc 1 (.bc 326023277 (.bc 1 (.bc 97806981 (.bc 1 (.bc 25240509 (.bc 1 (.bc 5521359 (.bc 1 (.bc 1003881 (.bc 1 (.bc 147627 (.bc 1 (.bc 16869 (.bc 1 (.bc 1403 (.bc 1 (.bc 73 (.bc 1 (.bc 1 (.bc 1 (.bc 71 (.bc 1 (.bc 1329 (.bc 1 (.bc 15537 (.bc 1 (.bc 132087 (.bc 1 (.bc 871791 (.bc 1 (.bc 4649565 (.bc 1 (.bc 20590941 (.bc 1 (.bc 77216037 (.bc 1 (.bc 248807237 (.bc 1 (.bc 696660269 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 3704965989 (.bc 1 (.b 6227507443 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 333951095656223 (.l 128602646422581 (.l 62115894266330 (.l 31057947133165 (.l 15528973566582 (.l 6236899419573 (.l 1495228582658 (.l 747614291329 (.l 373807145664 (.l 186903572832 (.bc 897427154 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 25751549337 (.bc 1 (.bc 31810737417 (.bc 1 (.b 4049499379 .nil))))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 1043778715067 (.l 521889357533 (.l 260944678767 (.l 130472339384 (.bc 31295764418 (.bc 1 (.b 33940405271 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 537275131591 (.l 268637565795 (.l 134318782897 (.bc 2701614481 (.bc 1 (.l 64457776965 (.bc 54051284 (.bc 1 (.bc 31810737417 (.bc 1 (.b 364099775 .nil))))) .nil))) .nil) .nil) (.c (.bc 1 (.b 42167280461 .nil)))))))))) (.c (.bc 1 (.l 1527587363715 (.bc 307377599206 (.bc 1 (.l 411563905227 (.l 205781952613 (.l 102890976307 (.l 51445488154 (.bc 3540894582 (.bc 1 (.bc 18728399517 (.bc 1 (.b 3453449972 .nil))))) .nil) .nil) .nil) (.c (.bc 1 (.b 44852177418 .nil)))))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 2185428944957 (.l 1092714472478 (.l 546357236239 (.l 273178618119 (.l 136589309059 (.l 68294654530 (.l 34147327265 (.l 17073663633 (.bc 5957462537 (.bc 1 (.b 2579369277 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 38372901405527 (.l 19186450702763 (.l 9593225351382 (.l 4796612675691 (.l 2398306337845 (.l 534974931078 (.l 267487465539 (.l 65330095391 (.l 32665047695 (.bc 4545565320 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 696660269 (.bc 1 (.bc 248807237 (.bc 1 (.bc 77216037 (.bc 1 (.bc 20590941 (.bc 1 (.bc 4649565 (.bc 1 (.bc 871791 (.bc 1 (.bc 132087 (.bc 1 (.bc 15537 (.bc 1 (.bc 1329 (.bc 1 (.bc 71 (.bc 1 (.bc 1 (.bc 1 (.bc 69 (.bc 1 (.bc 1257 (.bc 1 (.bc 14277 (.bc 1 (.bc 117807 (.bc 1 (.bc 753981 (.bc 1 (.bc 3895581 (.bc 1 (.bc 16695357 (.bc 1 (.bc 60520677 (.bc 1 (.bc 188286557 (.bc 1 (.bc 508373709 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 2503355397 (.bc 1 (.b 839438036 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 68413637376 (.l 34206818688 (.bc 3782141160 (.bc 1 (.bc 7592594397 (.bc 1 (.b 5728673781 .nil))))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 664178237841 (.l 199399428375 (.l 99699714187 (.l 49849857094 (.bc 5407131336 (.bc 1 (.bc 14615744217 (.bc 1 (.b 4902052988 .nil))))) .nil) .nil) (.c (.bc 1 (.l 132689690542 (.l 66344845271 (.l 33172422635 (.bc 12292940208 (.bc 1 (.b 4293271106 .nil))) .nil) .nil) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 2898033187309764 (.l 1449016593654882 (.l 481024898081702 (.l 105871187996286 (.l 52935593998143 (.l 26467796999072 (.l 13233898499536 (.l 6616949249768 (.l 3308474624884 (.l 1654237312442 (.l 637227308938 (.l 318613654469 (.l 159306827234 (.l 72054574194 (.bc 13856999491 (.bc 1 (.bc 17194993197 (.bc 1 (.b 4975294403 .nil))))) (.c (.bc 1 (.b 7598839420 .nil)))) .nil) .nil) (.c (.bc 1 (.l 189891347280 (.l 94945673640 (.l 47472836820 (.l 23736418410 (.bc 5841030102 (.bc 1 (.b 6027179100 .nil))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 134641261044562 (.l 67320630522281 (.l 33660315261140 (.l 16830157630570 (.l 1904201060341 (.l 952100530170 (.l 476050265085 (.l 238025132543 (.l 119012566271 (.l 59506283136 (.l 29753141568 (.bc 5108626017 (.bc 1 (.bc 7592594397 (.bc 1 (.b 2175350364 .nil))))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 6510877754941 (.l 3255438877470 (.l 1627719438735 (.l 813859719368 (.l 406929859684 (.l 203464929842 (.l 101732464921 (.bc 2446228833 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 508373709 (.bc 1 (.bc 188286557 (.bc 1 (.bc 60520677 (.bc 1 (.bc 16695357 (.bc 1 (.bc 3895581 (.bc 1 (.bc 753981 (.bc 1 (.bc 117807 (.bc 1 (.bc 14277 (.bc 1 (.bc 1257 (.bc 1 (.bc 69 (.bc 1 (.bc 1 (.bc 1 (.bc 67 (.bc 1 (.bc 1187 (.bc 1 (.bc 13087 (.bc 1 (.bc 104717 (.bc 1 (.bc 649261 (.bc 1 (.bc 3246317 (.bc 1 (.bc 13449037 (.bc 1 (.bc 47071637 (.bc 1 (.bc 141214917 (.bc 1 (.bc 367158789 (.bc 1 (.bc 834451797 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 9075135297 (.bc 1 (.b 501504661 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 243483398745736 (.l 121741699372868 (.l 59022075054419 (.l 29511037527209 (.l 14755518763605 (.l 7377759381803 (.l 1524037566428 (.l 762018783214 (.l 381009391607 (.l 190504695804 (.l 95252347902 (.l 47626173951 (.bc 7618353236 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 1668903597 (.bc 1 (.b 437349416 .nil))))))))))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 2164842124471 (.l 1082421062235 (.l 541210531117 (.l 270605265559 (.l 42881875741 (.l 21440937870 (.bc 397102381 (.bc 1 (.bc 367158789 (.bc 1 (.bc 141214917 (.bc 1 (.bc 47071637 (.bc 1 (.bc 13449037 (.bc 1 (.bc 3246317 (.bc 1 (.bc 649261 (.bc 1 (.bc 104717 (.bc 1 (.bc 13087 (.bc 1 (.bc 1187 (.bc 1 (.bc 67 (.bc 1 (.bc 1 (.bc 1 (.bc 65 (.bc 1 (.bc 1119 (.bc 1 (.bc 11965 (.bc 1 (.bc 92749 (.bc 1 (.bc 556509 (.bc 1 (.bc 2689805 (.bc 1 (.bc 10759229 (.bc 1 (.bc 36312405 (.bc 1 (.bc 104902509 (.bc 1 (.bc 262256277 (.bc 1 (.bc 572195517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 2783951277 (.bc 1 (.b 3024052439 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 92420757035 (.l 46210378517 (.bc 687882597 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 4667212437 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 1855967517 (.bc 1 (.b 582394659 .nil))))))))))))))) .nil) .nil)))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 1848774632012 (.l 924387316006 (.l 462193658003 (.l 231096829002 (.l 115548414501 (.l 57774207251 (.l 28887103626 (.l 14443551813 (.l 7221775907 (.l 3610887954 (.bc 514313418 (.bc 1 (.bc 572195517 (.bc 1 (.bc 262256277 (.bc 1 (.bc 104902509 (.bc 1 (.bc 36312405 (.bc 1 (.bc 10759229 (.bc 1 (.bc 2689805 (.bc 1 (.bc 556509 (.bc 1 (.bc 92749 (.bc 1 (.bc 11965 (.bc 1 (.bc 1119 (.bc 1 (.bc 65 (.bc 1 (.bc 1 (.bc 1 (.bc 63 (.bc 1 (.bc 1053 (.bc 1 (.bc 10909 (.bc 1 (.bc 81837 (.bc 1 (.bc 474669 (.bc 1 (.bc 2215133 (.bc 1 (.bc 8544093 (.bc 1 (.bc 27768309 (.bc 1 (.bc 77134197 (.bc 1 (.bc 185122077 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) .nil) .nil)))) .nil) .nil) .nil) +def cmd_292 : Cmd := (.l 4455304590786560 (.l 2227652295393280 (.l 1113826147696640 (.l 556913073848320 (.l 278456536924160 (.l 139228268462080 (.l 69614134231040 (.l 34807067115520 (.l 17403533557760 (.l 8701766778880 (.l 4350883389440 (.l 2175441694720 (.l 1087720847360 (.l 15457414895 (.l 7728707447 (.l 3864353723 (.l 1932176861 (.bc 387073437 (.bc 1 (.b 579014990 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 528403008782 (.l 264201504391 (.l 132100752196 (.l 19527541421 (.bc 130619646 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2333606217 (.bc 1 (.b 107670701 .nil))))))))))))) (.c (.bc 1 (.l 46522834674 (.bc 1966645934 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 709634637 (.bc 1 (.bc 387073437 (.bc 1 (.bc 185122077 (.bc 1 (.bc 77134197 (.bc 1 (.bc 27768309 (.bc 1 (.bc 8544093 (.bc 1 (.bc 2215133 (.bc 1 (.bc 474669 (.bc 1 (.bc 81837 (.bc 1 (.bc 10909 (.bc 1 (.bc 1053 (.bc 1 (.bc 63 (.bc 1 (.bc 1 (.bc 1 (.bc 61 (.bc 1 (.bc 989 (.bc 1 (.bc 9917 (.bc 1 (.bc 71917 (.bc 1 (.bc 402749 (.bc 1 (.bc 1812381 (.bc 1 (.bc 6731709 (.bc 1 (.bc 21036597 (.bc 1 (.bc 56097597 (.bc 1 (.bc 129024477 (.bc 1 (.bc 258048957 (.bc 1 (.bc 451585677 (.bc 1 (.bc 694747197 (.bc 1 (.bc 942871197 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 1202160777 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 942871197 (.bc 1 (.bc 694747197 (.bc 1 (.bc 451585677 (.bc 1 (.bc 258048957 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.bc 6731709 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 61 (.bc 1 (.bc 1 (.bc 1 (.bc 59 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 (.bc 1 (.bc 62927 (.bc 1 (.bc 339819 (.bc 1 (.bc 1472559 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.bc 88704327 (.bc 1 (.bc 169344627 (.bc 1 (.bc 282241047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 530365047 (.bc 1 (.bc 601080387 (.bc 1 (.bc 601080387 (.bc 1 (.bc 530365047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 282241047 (.bc 1 (.bc 169344627 (.bc 1 (.bc 88704327 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.bc 11705847 (.bc 1 (.bc 28614297 (.bc 1 (.bc 60090027 (.bc 1 (.bc 109254597 (.bc 1 (.bc 172986447 (.bc 1 (.bc 239519697 (.bc 1 (.bc 290845347 (.bc 1 (.bc 310235037 (.bc 1 (.bc 290845347 (.bc 1 (.bc 239519697 (.bc 1 (.bc 172986447 (.bc 1 (.bc 109254597 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.bc 69194577 (.bc 1 (.bc 103791867 (.bc 1 (.bc 135727827 (.bc 1 (.bc 155117517 (.bc 1 (.bc 155117517 (.bc 1 (.bc 135727827 (.bc 1 (.bc 103791867 (.bc 1 (.bc 69194577 (.bc 1 (.bc 40060017 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.bc 26246217 (.bc 1 (.bc 42948357 (.bc 1 (.bc 60843507 (.bc 1 (.bc 74884317 (.bc 1 (.bc 80233197 (.bc 1 (.bc 74884317 (.bc 1 (.bc 60843507 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.bc 26075787 (.bc 1 (.bc 34767717 (.bc 1 (.bc 40116597 (.bc 1 (.bc 40116597 (.bc 1 (.bc 34767717 (.bc 1 (.bc 26075787 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_293 : Cmd := (.l 8795656290304 (.l 4397828145152 (.l 2198914072576 (.l 1099457036288 (.l 549728518144 (.l 274864259072 (.l 137432129536 (.l 68716064768 (.l 34358032384 (.l 17179016192 (.l 8589508096 (.l 4294754048 (.l 2147377024 (.l 1073688512 (.l 536844256 (.l 268422128 (.l 134211064 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_294 : Cmd := (.l 521666559 (.l 260833279 (.l 130416639 (.l 65208319 (.l 32604159 (.l 16302079 (.l 8151039 (.l 4075519 (.l 2037759 (.l 1018879 (.l 509439 (.l 254719 (.l 127359 (.l 63679 (.l 31839 (.l 15919 (.l 7959 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 59951471170226125 (.l 20324416053557315 (.l 2886820295439549 (.l 1443410147719774 (.l 721705073859887 (.l 360852536929943 (.l 180426268464971 (.l 90213134232485 (.l 45106567116242 (.l 22553283558121 (.l 11276641779060 (.l 5638320889530 (.l 2819160444765 (.l 1409580222382 (.l 704790111191 (.l 294488221523 (.l 147244110761 (.c (.c (.b 73622055378 .nil))) .nil) (.c (.bc 1 (.l 57906834069 (.bc 12253728948 (.bc 1 (.b 16699688083 .nil))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 7275387731339105 (.l 3637693865669552 (.l 1818846932834776 (.l 909423466417388 (.l 454711733208694 (.l 227355866604347 (.l 113677933302173 (.l 56838966651087 (.l 28419483325544 (.l 14209741662772 (.l 5756891480558 (.l 1493233872151 (.l 746616936075 (.l 245158479320 (.bc 110164861706 (.bc 1 (.b 12414377951 .nil))) (.c (.bc 1 (.l 128149988715 (.bc 58065927484 (.bc 1 (.b 6009066870 .nil))) .nil)))) .nil) (.c (.bc 1 (.l 1385211868125 (.l 692605934062 (.bc 28607932001 (.bc 1 (.l 73153696333 (.bc 14927119844 (.bc 1 (.bc 15797309837 (.bc 1 (.b 5852418479 .nil))))) (.c (.bc 1 (.l 30677356527 (.bc 466505452 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 700687127 (.bc 1 (.bc 191096487 (.bc 1 (.bc 44963877 (.bc 1 (.bc 8992773 (.bc 1 (.bc 1498793 (.bc 1 (.bc 202537 (.bc 1 (.bc 21317 (.bc 1 (.bc 1637 (.bc 1 (.bc 79 (.bc 1 (.bc 1 (.bc 1 (.bc 77 (.bc 1 (.bc 1557 (.bc 1 (.bc 19757 (.bc 1 (.bc 182777 (.bc 1 (.bc 1316013 (.bc 1 (.bc 7676757 (.bc 1 (.bc 37287117 (.bc 1 (.bc 153809367 (.bc 1 (.bc 546877757 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 4623602877 (.bc 1 (.b 4616414192 .nil))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.bc 11504008779 (.bc 1 (.l 3834671285 (.bc 805288372 (.bc 1 (.b 1112047267 .nil))) (.c (.bc 1 (.bc 1127866947 (.bc 1 (.bc 290240883 (.bc 1 (.bc 66149561 (.bc 1 (.bc 22684477 (.bc 1 (.bc 55881849 (.bc 1 (.bc 236307187 (.bc 1 (.bc 891808299 (.bc 1 (.bc 2942887749 (.bc 1 (.bc 8561122835 (.bc 1 (.bc 22116233775 (.bc 1 (.l 51037462557 (.bc 4798806692 (.bc 1 (.b 20719924583 .nil))) (.c (.bc 1 (.l 105720458157 (.bc 25693935092 (.bc 1 (.b 27166293983 .nil))) (.c (.bc 1 (.b 5456197779 .nil)))))))))))))))))))))))))))))))))))))))) .nil) .nil)))) (.c (.bc 1 (.l 1347979350825 (.l 673989675412 (.l 243972928766 (.l 121986464383 (.bc 50556297235 (.bc 1 (.b 10436934954 .nil))) .nil) (.c (.bc 1 (.b 93021908937 .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 9651319531555744 (.l 4825659765777872 (.l 2412829882888936 (.l 1206414941444468 (.l 603207470722234 (.l 86451527719971 (.l 43225763859985 (.l 21612881929993 (.l 10806440964996 (.l 5403220482498 (.l 2701610241249 (.l 1350805120624 (.l 675402560312 (.l 337701280156 (.bc 23391238597 (.bc 1 (.b 145459401478 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 215152207641143 (.l 107576103820571 (.l 53788051910285 (.l 26894025955142 (.l 13447012977571 (.l 6723506488785 (.l 3361753244393 (.l 1680876622197 (.l 840438311099 (.l 187560041723 (.bc 7586471069 (.bc 1 (.b 86193549789 .nil))) (.c (.bc 1 (.l 232659113824 (.bc 91271207806 (.bc 1 (.b 25058349103 .nil))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 9651319531555744 (.l 4825659765777872 (.l 2412829882888936 (.l 1206414941444468 (.l 458711695617750 (.l 229355847808875 (.l 114677923904437 (.l 57338961952219 (.l 21989179631642 (.l 10994589815821 (.l 5497294907911 (.l 2748647453956 (.l 1374323726978 (.bc 461350677349 (.bc 1 (.b 225811186137 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 6680301344465 .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 144495775104481 (.l 72247887552240 (.l 36123943776120 (.l 18061971888060 (.l 9030985944030 (.l 4515492972015 (.l 2257746486007 (.l 1128873243004 (.l 564436621502 (.l 282218310751 (.l 141109155376 (.bc 52684420360 (.bc 1 (.b 17870157325 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil)))))) +def cmd_298 : Cmd := (.l 456677176114636032 (.l 205039940487042079 (.l 85081797237135588 (.l 30963200176072829 (.l 8287252047972947 (.l 4143626023986473 (.l 414713695664222 (.l 207356847832111 (.bc 25191121678997 (.bc 1 (.l 78487302237056 (.l 39243651118528 (.l 19621825559264 (.l 9810912779632 (.l 4905456389816 (.l 2452728194908 (.l 1226364097454 (.l 613182048727 (.l 306591024363 (.bc 5233316058 (.bc 1 (.b 148062196120 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil))) .nil) (.c (.bc 1 (.l 1657099316329012 (.l 430020305781079 (.l 215010152890539 (.l 107505076445270 (.bc 6814689795378 (.bc 1 (.l 46937848427254 (.l 23468924213627 (.l 8146006116296 (.l 1438342080081 (.l 719171040040 (.l 359585520020 (.l 178050713297 (.bc 61262856650 (.bc 1 (.b 27762499995 .nil))) (.c (.bc 1 (.b 1742046710 .nil)))) .nil) .nil) (.c (.bc 1 (.b 2634660978064 .nil)))) (.c (.bc 1 (.l 3588455990514 (.l 1794227995257 (.l 897113997628 (.bc 123803998831 (.bc 1 (.l 324752999980 (.l 162376499990 (.bc 51442223447 (.bc 1 (.b 29746026545 .nil))) .nil) .nil))) .nil) .nil) .nil)))) .nil) .nil))) .nil) .nil) (.c (.bc 1 (.l 398529352383424 (.l 199264676191712 (.l 99632338095856 (.l 49816169047928 (.bc 198562574252 (.bc 1 (.l 24709521949709 (.l 12354760974854 (.l 4660973491758 (.bc 618642145600 (.bc 1 (.l 1711844600276 (.l 855922300138 (.bc 177331836375 (.bc 1 (.l 250629313691 (.bc 63720063640 (.bc 1 (.b 61594593202 .nil))) .nil))) .nil) .nil))) (.c (.bc 1 (.b 1516406995666 .nil)))) .nil) .nil))) .nil) .nil) .nil) .nil)))) .nil)))) .nil) (.c (.bc 1 (.l 7194348040063464 (.l 2623015437641285 (.l 670249888751916 (.l 335124944375958 (.l 167562472187979 (.l 83781236093989 (.l 41890618046994 (.l 20945309023497 (.l 10472654511749 (.l 3974123845161 (.l 1987061922580 (.l 993530961290 (.l 496765480645 (.bc 70390493165 (.bc 1 (.bc 177464757597 (.bc 1 (.b 527489554 .nil))))) .nil) .nil) .nil) (.c (.bc 1 (.l 1262203410710 (.l 631101705355 (.l 315550852678 (.bc 90637546042 (.bc 1 (.b 67137880294 .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 641257830068723 (.l 320628915034361 (.l 75105562467657 (.l 37552781233828 (.l 18776390616914 (.l 9388195308457 (.l 4694097654229 (.l 1770943408467 (.l 885471704233 (.l 331488603530 (.l 165744301765 (.bc 46289000573 (.bc 1 (.b 36583150306 .nil))) .nil) (.c (.bc 1 (.b 111247248583 .nil)))) .nil) (.c (.bc 1 (.l 576105418645 (.l 288052709322 (.l 144026354661 (.l 72013177330 (.bc 16055727656 (.bc 1 (.b 19950861006 .nil))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 85208895049520 (.l 42604447524760 (.l 21302223762380 (.l 10651111881190 (.l 5325555940595 (.l 1004948428016 (.l 502474214008 (.l 251237107004 (.l 125618553502 (.bc 26462998671 (.bc 1 (.bc 24066445757 (.bc 1 (.bc 11173706957 (.bc 1 (.b 1106125357 .nil))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 886820011263 (.l 443410005631 (.l 221705002816 (.l 110852501408 (.bc 3517477519 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 546877757 (.bc 1 (.bc 153809367 (.bc 1 (.bc 37287117 (.bc 1 (.bc 7676757 (.bc 1 (.bc 1316013 (.bc 1 (.bc 182777 (.bc 1 (.bc 19757 (.bc 1 (.bc 1557 (.bc 1 (.bc 77 (.bc 1 (.bc 1 (.bc 1 (.bc 75 (.bc 1 (.bc 1479 (.bc 1 (.bc 18275 (.bc 1 (.bc 164499 (.bc 1 (.bc 1151511 (.bc 1 (.bc 6525243 (.bc 1 (.bc 30761871 (.bc 1 (.bc 123047493 (.bc 1 (.bc 423830261 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 16244850885 (.bc 1 (.b 20190731542 .nil))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 761108784899 (.l 339693882557 (.l 169846941278 (.l 84923470639 (.bc 9978277247 (.bc 1 (.b 32483458069 .nil))) .nil) .nil) (.c (.bc 1 (.b 40860509889 .nil)))) (.c (.bc 1 (.b 9900746110 .nil)))))))))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 974158582390444 (.l 487079291195222 (.l 64633669361813 (.l 32316834680906 (.l 16158417340453 (.l 8079208670226 (.l 4039604335113 (.l 2019802167556 (.l 1009901083778 (.l 504950541889 (.l 252475270944 (.l 126237635472 (.bc 12071862879 (.bc 1 (.b 51046954854 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 178905976235795 (.l 89452988117897 (.l 7936969712283 (.l 3968484856141 (.l 1984242428070 (.l 992121214035 (.bc 108178492898 (.bc 1 (.l 387882114116 (.l 193941057058 (.l 96970528529 (.l 48485264264 (.bc 17614411316 (.bc 1 (.b 6628220813 .nil))) .nil) .nil) .nil) .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 36789524346663 (.l 18394762173331 (.l 9197381086666 (.l 4598690543333 (.l 1629939850223 (.l 814969925111 (.l 407484962555 (.l 194904307557 (.bc 95414014804 (.bc 1 (.b 2038138971 .nil))) (.c (.bc 1 (.b 8838173718 .nil)))) .nil) .nil) (.c (.bc 1 (.b 669405421441 .nil)))) .nil) .nil) .nil) .nil)))) .nil) .nil)))) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 11577698442494962 (.l 5788849221247481 (.l 2894424610623740 (.l 922718171993634 (.l 461359085996817 (.l 230679542998409 (.l 115339771499204 (.l 43973017912095 (.l 21986508956047 (.bc 484085988189 (.bc 1 (.l 10509168489832 (.l 2598297771682 (.l 1299148885841 (.l 649574442921 (.l 324787221461 (.bc 61295536174 (.bc 1 (.b 101098074553 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 2656286473231 (.l 1328143236615 (.l 235282932230 (.l 117641466115 (.bc 36748454264 (.bc 1 (.b 22072278791 .nil))) .nil) (.c (.bc 1 (.b 428788686074 .nil)))) .nil) .nil)))) .nil))) .nil) (.c (.bc 1 (.l 13696867837504 (.l 6848433918752 (.l 3424216959376 (.l 1712108479688 (.l 856054239844 (.l 428027119922 (.l 214013559961 (.bc 8577078507 (.bc 1 (.b 98429701471 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 524494133318233 (.l 262247066659116 (.l 131123533329558 (.l 65561766664779 (.l 32780883332389 (.l 6956973846805 (.l 3478486923402 (.l 1272236543028 (.l 636118271514 (.l 318059135757 (.bc 33977398601 (.bc 1 (.l 125052169274 (.bc 9299887204 (.bc 1 (.b 53226197430 .nil))) .nil))) .nil) .nil) (.c (.bc 1 (.b 467006918670 .nil)))) .nil) (.c (.bc 1 (.l 9433467819387 (.l 4716733909693 (.l 2358366954847 (.l 1179183477424 (.l 589591738712 (.l 294795869356 (.bc 19628105770 (.bc 1 (.bc 75422521977 (.bc 1 (.bc 50281681317 (.bc 1 (.b 2065625605 .nil))))))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 17438173006385448 (.l 8719086503192724 (.l 2970300067398085 (.l 1431553464930619 (.l 715776732465309 (.l 357888366232654 (.l 178944183116327 (.l 89472091558163 (.l 44736045779082 (.l 22368022889541 (.l 11184011444771 (.l 5483748385389 (.l 631793622165 (.l 177842983791 (.l 88921491895 (.bc 28103383184 (.bc 1 (.bc 16244850885 (.bc 1 (.b 112511873 .nil))))) .nil) (.c (.bc 1 (.l 138053827288 (.l 69026913644 (.bc 7709082995 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 423830261 (.bc 1 (.bc 123047493 (.bc 1 (.bc 30761871 (.bc 1 (.bc 6525243 (.bc 1 (.bc 1151511 (.bc 1 (.bc 164499 (.bc 1 (.bc 18275 (.bc 1 (.bc 1479 (.bc 1 (.bc 75 (.bc 1 (.bc 1 (.bc 1 (.bc 73 (.bc 1 (.bc 1403 (.bc 1 (.bc 16869 (.bc 1 (.bc 147627 (.bc 1 (.bc 1003881 (.bc 1 (.bc 5521359 (.bc 1 (.bc 25240509 (.bc 1 (.bc 97806981 (.bc 1 (.bc 326023277 (.bc 1 (.bc 945467509 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 10829900589 (.bc 1 (.b 1542545224 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil)))) (.c (.bc 1 (.l 2110080570526 (.l 1055040285263 (.l 257378312590 (.bc 17796562973 (.bc 1 (.bc 30942573117 (.bc 1 (.bc 44479948857 (.bc 1 (.b 35470071339 .nil))))))) (.c (.bc 1 (.l 270141830038 (.bc 22092215416 (.bc 1 (.bc 67156001217 (.bc 1 (.b 45822698380 .nil))))) .nil)))) .nil) .nil)))) (.c (.bc 1 (.b 108257336993 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 53596568768420 (.l 26798284384210 (.l 13399142192105 (.l 6699571096052 (.l 3349785548026 (.l 1674892774013 (.l 837446387006 (.bc 159541888870 (.bc 1 (.b 259181304630 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 1389243184198274 (.l 694621592099137 (.l 347310796049568 (.l 67318014582945 (.l 33659007291472 (.l 16829503645736 (.l 8414751822868 (.l 4207375911434 (.l 2103687955717 (.l 1051843977858 (.l 525921988929 (.l 100208749959 (.l 50104374979 (.bc 5016645858 (.bc 1 (.b 20035541629 .nil))) .nil) (.c (.bc 1 (.b 162752244502 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 106337383441836 (.l 53168691720918 (.l 26584345860459 (.l 13292172930229 (.l 6646086465114 (.l 3323043232557 (.l 1661521616279 (.l 830760808140 (.l 415380404070 (.l 207690202035 (.bc 6432398462 (.bc 1 (.bc 57562286757 (.bc 1 (.b 39850415793 .nil))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 23298647570275934 (.l 11649323785137967 (.l 5824661892568983 (.l 2912330946284492 (.l 1456165473142246 (.l 507868163873131 (.l 253934081936565 (.l 24017464319102 (.l 12008732159551 (.l 6004366079776 (.l 3002183039888 (.l 1501091519944 (.l 750545759972 (.l 375272879986 (.l 187636439993 (.l 58379346073 (.bc 4629533064 (.bc 1 (.b 24560139969 .nil))) (.c (.bc 1 (.l 35438873920 (.bc 6382433146 (.bc 1 (.b 11337003811 .nil))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 102949576649177 (.l 51474788324588 (.l 25737394162294 (.l 12868697081147 (.l 6434348540573 (.l 3217174270287 (.l 1608587135143 (.l 67660523260 (.l 33830261630 (.bc 8002104386 (.bc 1 (.b 8913026426 .nil))) .nil) (.c (.bc 1 (.l 459823234109 (.l 229911617054 (.bc 1916874162 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 945467509 (.bc 1 (.bc 326023277 (.bc 1 (.bc 97806981 (.bc 1 (.bc 25240509 (.bc 1 (.bc 5521359 (.bc 1 (.bc 1003881 (.bc 1 (.bc 147627 (.bc 1 (.bc 16869 (.bc 1 (.bc 1403 (.bc 1 (.bc 73 (.bc 1 (.bc 1 (.bc 1 (.bc 71 (.bc 1 (.bc 1329 (.bc 1 (.bc 15537 (.bc 1 (.bc 132087 (.bc 1 (.bc 871791 (.bc 1 (.bc 4649565 (.bc 1 (.bc 20590941 (.bc 1 (.bc 77216037 (.bc 1 (.bc 248807237 (.bc 1 (.bc 696660269 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 25751549337 (.bc 1 (.bc 31810737417 (.bc 1 (.b 1722420298 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 229911617053 (.l 114955808526 (.bc 33622843498 (.bc 1 (.b 23855060762 .nil))) .nil) (.c (.bc 1 (.l 46898193141 (.l 23449096570 (.bc 11490203034 (.bc 1 (.b 234345248 .nil))) .nil) .nil)))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 220214572697989 (.l 110107286348994 (.l 55053643174497 (.l 27526821587248 (.l 13763410793624 (.l 6881705396812 (.l 3440852698406 (.l 1720426349203 (.l 860213174602 (.bc 56932859722 (.bc 1 (.bc 42181365309 (.bc 1 (.bc 15338680067 (.bc 1 (.bc 4962538235 (.bc 1 (.bc 1418107833 (.bc 1 (.bc 356390447 (.bc 1 (.bc 88834041 (.bc 1 (.bc 78566329 (.bc 1 (.bc 292189039 (.bc 1 (.bc 1128115489 (.bc 1 (.l 3834696051 (.l 1917348025 (.bc 881980534 (.bc 1 (.b 76693476 .nil))) .nil) (.c (.bc 1 (.bc 11504010587 (.bc 1 (.l 30677356613 (.bc 2680020010 (.bc 1 (.b 12658658293 .nil))) (.c (.bc 1 (.l 73153696335 (.l 36576848167 (.bc 15129514059 (.bc 1 (.b 3158910022 .nil))) .nil) (.c (.bc 1 (.l 156757920717 (.l 78378960358 (.bc 15569489494 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 3704965989 (.bc 1 (.b 575916490 .nil))))))))) .nil) (.c (.bc 1 (.l 31401260442 (.l 15700630221 (.bc 1134067810 (.bc 1 (.bc 696660269 (.bc 1 (.bc 248807237 (.bc 1 (.bc 77216037 (.bc 1 (.bc 20590941 (.bc 1 (.bc 4649565 (.bc 1 (.bc 871791 (.bc 1 (.bc 132087 (.bc 1 (.bc 15537 (.bc 1 (.bc 1329 (.bc 1 (.bc 71 (.bc 1 (.bc 1 (.bc 1 (.bc 69 (.bc 1 (.bc 1257 (.bc 1 (.bc 14277 (.bc 1 (.bc 117807 (.bc 1 (.bc 753981 (.bc 1 (.bc 3895581 (.bc 1 (.bc 16695357 (.bc 1 (.bc 60520677 (.bc 1 (.bc 188286557 (.bc 1 (.bc 508373709 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 2503355397 (.bc 1 (.b 1183677105 .nil))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 17271575730254872 (.l 8635787865127436 (.l 4317893932563718 (.l 2158946966281859 (.l 1079473483140930 (.l 539736741570465 (.l 269868370785233 (.l 134934185392617 (.l 67467092696309 (.l 33733546348155 (.l 16866773174078 (.l 8433386587039 (.l 4216693293520 (.l 2108346646760 (.l 1054173323380 (.l 271664052947 (.l 135832026473 (.bc 3437902092 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 17194993197 (.bc 1 (.b 13938974202 .nil))))))))))) .nil) (.c (.bc 1 (.l 255422608740 (.l 53872319681 (.bc 4211296394 (.bc 1 (.bc 17194993197 (.bc 1 (.b 5529870243 .nil))))) (.c (.bc 1 (.l 73838984686 (.bc 9085873972 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 508373709 (.bc 1 (.bc 188286557 (.bc 1 (.bc 60520677 (.bc 1 (.bc 16695357 (.bc 1 (.bc 3895581 (.bc 1 (.bc 753981 (.bc 1 (.bc 117807 (.bc 1 (.bc 14277 (.bc 1 (.bc 1257 (.bc 1 (.bc 69 (.bc 1 (.bc 1 (.bc 1 (.bc 67 (.bc 1 (.bc 1187 (.bc 1 (.bc 13087 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) +def cmd_299 : Cmd := (.l 6027071840021062 (.l 3013535920010531 (.l 1506767960005265 (.l 753383980002632 (.l 376691990001316 (.l 188345995000658 (.l 94172997500329 (.l 47086498750164 (.l 23543249375082 (.l 11771624687541 (.l 5885812343770 (.l 2942906171885 (.l 1471453085942 (.l 389114243183 (.l 194557121591 (.l 97278560795 (.l 48639280397 (.bc 104717 (.bc 1 (.bc 649261 (.bc 1 (.bc 3246317 (.bc 1 (.bc 13449037 (.bc 1 (.bc 47071637 (.bc 1 (.bc 141214917 (.bc 1 (.bc 367158789 (.bc 1 (.bc 834451797 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 6495886317 (.bc 1 (.b 7154909382 .nil))))))))))))))))))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 346612299785 (.l 173306149892 (.l 86653074946 (.l 43326537473 (.bc 964948514 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 9075135297 (.bc 1 (.b 2548049619 .nil))))))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_303 : Cmd := (.l 23842630373288815 (.l 11921315186644408 (.l 5960657593322204 (.l 2980328796661102 (.l 1490164398330551 (.l 745082199165276 (.l 372541099582638 (.l 186270549791319 (.l 93135274895660 (.l 46567637447830 (.l 6746262660352 (.l 3373131330176 (.l 1686565665088 (.l 336097427589 (.l 168048713794 (.l 84024356897 (.l 42012178449 (.l 21006089224 (.bc 5571808278 (.bc 1 (.b 4931236331 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 507185404952 (.l 253592702476 (.l 126796351238 (.l 48997875502 (.l 10533963448 (.bc 1564649986 (.bc 1 (.b 3702331735 .nil))) (.c (.bc 1 (.l 13964974300 (.bc 937587060 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 834451797 (.bc 1 (.bc 367158789 (.bc 1 (.bc 141214917 (.bc 1 (.bc 47071637 (.bc 1 (.bc 13449037 (.bc 1 (.bc 3246317 (.bc 1 (.bc 649261 (.bc 1 (.bc 104717 (.bc 1 (.bc 13087 (.bc 1 (.bc 1187 (.bc 1 (.bc 67 (.bc 1 (.bc 1 (.bc 1 (.bc 65 (.bc 1 (.bc 1119 (.bc 1 (.bc 11965 (.bc 1 (.bc 92749 (.bc 1 (.bc 556509 (.bc 1 (.bc 2689805 (.bc 1 (.bc 10759229 (.bc 1 (.b 1848575 .nil))))))))))))))))))))))))))))))))))))))))))))) .nil)))) (.c (.bc 1 (.l 14400300114 (.l 7200150057 (.bc 34463829 (.bc 1 (.bc 104902509 (.bc 1 (.bc 262256277 (.bc 1 (.bc 572195517 (.bc 1 (.bc 1096708077 (.bc 1 (.b 1529548804 .nil))))))))))) .nil) .nil)))) .nil) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 16537556063560 (.l 8268778031780 (.l 4134389015890 (.l 2067194507945 (.l 1033597253973 (.l 130927430756 (.l 65463715378 (.l 32731857689 (.bc 326418713 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 4667212437 (.bc 1 (.b 468488509 .nil))))))))))) .nil) .nil) (.c (.bc 1 (.l 385871196228 (.l 192935598114 (.l 51823476108 (.bc 3939434348 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 572195517 (.bc 1 (.bc 262256277 (.bc 1 (.bc 104902509 (.bc 1 (.bc 36312405 (.bc 1 (.bc 10759229 (.bc 1 (.bc 2689805 (.bc 1 (.bc 556509 (.bc 1 (.bc 92749 (.bc 1 (.bc 11965 (.bc 1 (.bc 1119 (.bc 1 (.bc 65 (.bc 1 (.bc 1 (.bc 1 (.bc 63 (.bc 1 (.bc 1053 (.bc 1 (.bc 10909 (.bc 1 (.bc 81837 (.bc 1 (.bc 474669 (.bc 1 (.bc 2215133 (.bc 1 (.bc 8544093 (.bc 1 (.bc 27768309 (.bc 1 (.bc 77134197 (.bc 1 (.bc 185122077 (.bc 1 (.bc 387073437 (.bc 1 (.bc 709634637 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2333606217 (.bc 1 (.b 610422787 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 44644322946 (.bc 1463893848 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 709634637 (.bc 1 (.bc 387073437 (.bc 1 (.bc 185122077 (.bc 1 (.bc 77134197 (.bc 1 (.bc 27768309 (.bc 1 (.bc 8544093 (.bc 1 (.bc 2215133 (.bc 1 (.bc 474669 (.bc 1 (.bc 81837 (.bc 1 (.bc 10909 (.bc 1 (.bc 1053 (.bc 1 (.bc 63 (.bc 1 (.bc 1 (.bc 1 (.bc 61 (.bc 1 (.bc 989 (.bc 1 (.bc 9917 (.bc 1 (.bc 71917 (.bc 1 (.bc 402749 (.bc 1 (.bc 1812381 (.bc 1 (.bc 6731709 (.bc 1 (.bc 21036597 (.bc 1 (.bc 56097597 (.bc 1 (.bc 129024477 (.bc 1 (.bc 258048957 (.bc 1 (.bc 451585677 (.bc 1 (.bc 694747197 (.bc 1 (.bc 942871197 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 1202160777 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 942871197 (.bc 1 (.bc 694747197 (.bc 1 (.bc 451585677 (.bc 1 (.bc 258048957 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.bc 6731709 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 61 (.bc 1 (.bc 1 (.bc 1 (.bc 59 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 (.bc 1 (.bc 62927 (.bc 1 (.bc 339819 (.bc 1 (.bc 1472559 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.bc 88704327 (.bc 1 (.bc 169344627 (.bc 1 (.bc 282241047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 530365047 (.bc 1 (.bc 601080387 (.bc 1 (.bc 601080387 (.bc 1 (.bc 530365047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 282241047 (.bc 1 (.bc 169344627 (.bc 1 (.bc 88704327 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.bc 11705847 (.bc 1 (.bc 28614297 (.bc 1 (.bc 60090027 (.bc 1 (.bc 109254597 (.bc 1 (.bc 172986447 (.bc 1 (.bc 239519697 (.bc 1 (.bc 290845347 (.bc 1 (.bc 310235037 (.bc 1 (.bc 290845347 (.bc 1 (.bc 239519697 (.bc 1 (.bc 172986447 (.bc 1 (.bc 109254597 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.bc 69194577 (.bc 1 (.bc 103791867 (.bc 1 (.bc 135727827 (.bc 1 (.bc 155117517 (.bc 1 (.bc 155117517 (.bc 1 (.bc 135727827 (.bc 1 (.bc 103791867 (.bc 1 (.bc 69194577 (.bc 1 (.bc 40060017 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.bc 26246217 (.bc 1 (.bc 42948357 (.bc 1 (.bc 60843507 (.bc 1 (.bc 74884317 (.bc 1 (.bc 80233197 (.bc 1 (.bc 74884317 (.bc 1 (.bc 60843507 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_304 : Cmd := (.l 131984907042816 (.l 65992453521408 (.l 32996226760704 (.l 16498113380352 (.l 8249056690176 (.l 4124528345088 (.l 2062264172544 (.l 1031132086272 (.l 515566043136 (.l 257783021568 (.l 128891510784 (.l 64445755392 (.l 32222877696 (.l 16111438848 (.l 8055719424 (.l 4027859712 (.l 2013929856 (.l 1006964928 (.bc 26075787 (.bc 1 (.bc 34767717 (.bc 1 (.bc 40116597 (.bc 1 (.bc 40116597 (.bc 1 (.bc 34767717 (.bc 1 (.bc 26075787 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_305 : Cmd := (.l 34295250943 (.l 17147625471 (.l 8573812735 (.l 4286906367 (.l 2143453183 (.l 1071726591 (.l 535863295 (.l 267931647 (.l 133965823 (.l 66982911 (.l 33491455 (.l 16745727 (.l 8372863 (.l 4186431 (.l 2093215 (.l 1046607 (.l 523303 (.l 261651 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 828826784646006655 (.l 360838285748885971 (.l 140491364339045819 (.l 43965231672845933 (.l 5864950614792333 (.l 2932475307396166 (.l 1071334228139107 (.l 535667114069553 (.l 267833557034776 (.l 133916778517388 (.l 66958389258694 (.l 33479194629347 (.l 15930487541101 (.l 7965243770550 (.l 3982621885275 (.l 1991310942637 (.l 567529230745 (.l 5385913031 (.c (.c (.b 2692956513 .nil))) (.c (.bc 1 (.bc 22116233773 (.bc 1 (.bc 8561122749 (.bc 1 (.bc 2942885943 (.bc 1 (.bc 891783617 (.bc 1 (.bc 236060367 (.bc 1 (.bc 53956653 (.bc 1 (.bc 10491569 (.bc 1 (.bc 1701333 (.bc 1 (.bc 223857 (.bc 1 (.bc 22957 (.bc 1 (.bc 1719 (.bc 1 (.bc 81 (.bc 1 (.bc 1 (.bc 1 (.bc 79 (.bc 1 (.bc 1637 (.bc 1 (.bc 21317 (.bc 1 (.bc 202537 (.bc 1 (.bc 1498793 (.bc 1 (.bc 8992773 (.bc 1 (.bc 44963877 (.bc 1 (.bc 191096487 (.bc 1 (.bc 700687127 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 6318923933 (.bc 1 (.bc 15797309837 (.bc 1 (.bc 35240152717 (.bc 1 (.bc 70480305437 (.bc 1 (.b 112537862274 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 428126240570 (.bc 14326687513 (.bc 1 (.b 199736432769 .nil))) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 809109773569 (.l 404554886784 (.l 202277443392 (.l 101138721696 (.l 50569360848 (.bc 6418460640 (.bc 1 (.b 18866219781 .nil))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 394903425558973 .nil)))) .nil) (.c (.bc 1 (.l 16117665221630630 (.l 2771851184418913 (.l 1385925592209456 (.l 692962796104728 (.l 346481398052364 (.l 173240699026182 (.l 86620349513091 (.l 2812930506048 (.l 1406465253024 (.bc 584556741781 (.bc 1 (.b 118675884728 .nil))) .nil) (.c (.bc 1 (.l 40497244250494 (.l 20248622125247 (.l 8405001775278 (.l 4202500887639 (.l 2101250443819 (.l 264470540154 (.bc 47526763698 (.bc 1 (.b 84708506376 .nil))) (.c (.bc 1 (.l 786154681753 (.bc 319516774819 (.bc 1 (.b 73560566054 .nil))) .nil)))) .nil) .nil) (.c (.bc 1 (.b 1719309287342 .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 5286981426396399 (.l 2392474385579607 (.l 262395019308438 (.l 131197509654219 (.l 65598754827110 (.l 32799377413555 (.l 16399688706778 (.l 8199844353389 (.l 2894891378499 (.bc 935903173699 (.bc 1 (.b 511542515547 .nil))) (.c (.bc 1 (.b 1205030798193 .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 933842173481362 (.bc 10412145789215 (.bc 1 (.l 456508940951463 (.l 228254470475731 (.l 114127235237865 (.l 57063617618933 (.l 28531808809466 (.l 937463503821 (.l 468731751910 (.l 234365875955 (.bc 46713804450 (.bc 1 (.l 70469133525 (.bc 8369683369 (.bc 1 (.b 26864883390 .nil))) .nil))) .nil) .nil) (.c (.bc 1 (.l 1647928796165 (.l 823964398082 (.bc 246088751048 (.bc 1 (.b 165893447990 .nil))) .nil) (.c (.bc 1 (.bc 1889089107689 (.bc 1 (.bc 3145802287129 (.bc 1 (.l 5527568151561 (.l 2763784075780 (.l 1381892037890 (.l 690946018945 (.bc 93716729110 (.bc 1 (.b 251756280360 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.b 1118052558353 .nil)))))))))))))) .nil) .nil) .nil) .nil) .nil))) .nil)))) (.c (.bc 1 (.l 251016327618589 (.l 125508163809294 (.l 62754081904647 (.bc 8491577300171 (.bc 1 (.l 22885463652149 (.l 11442731826074 (.l 5721365913037 (.l 2860682956519 (.l 1430341478259 (.l 715170739129 (.l 357585369565 (.bc 118269142641 (.bc 1 (.b 60523542139 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil))) .nil) .nil) .nil)))) .nil)))) .nil)))) (.c (.bc 1 (.l 26280450496676973 (.l 12047106001755453 (.l 4391559729886921 (.l 2195779864943460 (.l 1097889932471730 (.l 548944966235865 (.l 274472483117933 (.l 136186470080185 (.l 68093235040092 (.l 8162560318210 (.l 4081280159105 (.l 2040640079553 (.l 1020320039776 (.l 510160019888 (.bc 94056742960 (.bc 1 (.b 161023266981 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 25884057201833 (.bc 1989979906189 (.bc 1 (.l 10952048694724 (.l 3354882838397 (.l 1245638904960 (.l 622819452480 (.bc 203928329279 (.bc 1 (.b 107481396958 .nil))) .nil) (.c (.bc 1 (.b 431802514235 .nil)))) (.c (.bc 1 (.l 2121141508962 (.l 1060570754481 (.l 445947203816 (.bc 188793255679 (.bc 1 (.b 34180346226 .nil))) (.c (.bc 1 (.b 84338173422 .nil)))) .nil) .nil)))) .nil))) .nil)))) .nil) (.c (.bc 1 (.b 1049771478779 .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1631993270990802 (.l 815996635495401 (.l 407998317747700 (.l 203999158873850 (.l 101999579436925 (.l 50999789718462 (.l 24387784138788 (.l 12193892069394 (.bc 2866483625285 (.bc 1 (.l 3230462409409 (.l 1615231204704 (.l 807615602352 (.l 403807801176 (.bc 39462961700 (.bc 1 (.b 162440938885 .nil))) .nil) .nil) .nil) .nil))) .nil) (.c (.bc 1 (.b 1112110720440 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 1093119246583030 (.l 546559623291515 (.l 273279811645757 (.l 136639905822878 (.l 68319952911439 (.l 34159976455720 (.l 17079988227860 (.l 8539994113930 (.l 4269997056965 (.l 2134998528482 (.l 1067499264241 (.l 533749632120 (.l 266874816060 (.bc 26337224517 (.bc 1 (.b 107100183510 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 39927778535397163 (.l 19963889267698581 (.l 9981944633849291 (.l 4990972316924646 (.l 1046210003442246 (.l 239940036261590 (.l 119970018130795 (.l 59985009065397 (.l 29992504532699 (.l 14996252266350 (.l 7498126133175 (.l 3749063066588 (.l 1874531533294 (.l 937265766647 (.l 468632883323 (.bc 19764366279 (.bc 1 (.bc 70480305437 (.bc 1 (.bc 35240152717 (.bc 1 (.bc 15797309837 (.bc 1 (.bc 6318923933 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 700687127 (.bc 1 (.bc 191096487 (.bc 1 (.bc 44963877 (.bc 1 (.bc 8992773 (.bc 1 (.bc 1498793 (.bc 1 (.bc 202537 (.bc 1 (.bc 21317 (.bc 1 (.bc 1637 (.bc 1 (.bc 79 (.bc 1 (.bc 1 (.bc 1 (.bc 77 (.bc 1 (.bc 1557 (.bc 1 (.bc 19757 (.bc 1 (.bc 182777 (.bc 1 (.bc 1316013 (.bc 1 (.bc 7676757 (.bc 1 (.bc 37287117 (.bc 1 (.bc 153809367 (.bc 1 (.bc 546877757 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 24066445757 (.bc 1 (.b 41219472108 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 283164965459530 (.l 141582482729765 (.l 70791241364883 (.l 35395620682442 (.l 17697810341221 (.l 5894037983545 (.l 2947018991772 (.l 1473509495886 (.l 286786899140 (.l 143393449570 (.bc 5194387569 (.bc 1 (.b 66502337213 .nil))) .nil) (.c (.bc 1 (.l 449967848800 (.l 224983924400 (.bc 13948352895 (.bc 1 (.b 98543609302 .nil))) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 2954867187062 (.l 1477433593531 (.l 738716796765 (.l 369358398382 (.l 102601323233 (.bc 27160593995 (.bc 1 (.b 24140067618 .nil))) (.c (.bc 1 (.b 82077875955 .nil)))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 1449276155020074 (.l 724638077510037 (.l 223101440565784 (.l 111550720282892 (.l 55775360141446 (.l 27887680070723 (.l 13943840035362 (.l 5708709786302 (.l 2854354893151 (.l 1427177446576 (.l 713588723288 (.bc 112285752000 (.bc 1 (.bc 226760523597 (.bc 1 (.b 17748086041 .nil))))) .nil) .nil) .nil) (.c (.bc 1 (.b 1263210231376 .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 139217598189231 (.l 69608799094615 (.l 34804399547307 (.l 17402199773654 (.l 8701099886827 (.l 4350549943413 (.l 2175274971706 (.l 869462738273 (.l 434731369136 (.bc 165866091294 (.bc 1 (.b 51499593271 .nil))) .nil) (.c (.bc 1 (.b 218174747577 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 53575106574117353 (.l 26787553287058676 (.l 13393776643529338 (.l 6696888321764669 (.l 1382182690479590 (.l 691091345239795 (.l 345545672619897 (.l 172772836309949 (.l 86386418154975 (.l 43193209077488 (.l 21596604538744 (.l 10798302269372 (.l 5399151134686 (.bc 277130657403 (.bc 1 (.l 2422444909937 (.l 1211222454968 (.l 354464550993 (.bc 135008445295 (.bc 1 (.b 42223830198 .nil))) (.c (.bc 1 (.b 251146676488 .nil)))) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1966261470402741 (.l 983130735201370 (.l 491565367600685 (.l 245782683800343 (.l 122891341900171 (.l 61445670950085 (.l 30722835475042 (.bc 1318373629734 (.bc 1 (.l 14043044107784 (.l 7021522053892 (.l 3510761026946 (.l 473377972811 (.l 236688986405 (.bc 53568472424 (.bc 1 (.b 64776020776 .nil))) .nil) (.c (.bc 1 (.l 1282002540659 (.l 641001270329 (.bc 161984502820 (.bc 1 (.b 158516132341 .nil))) .nil) .nil)))) .nil) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 22969881606453374 (.l 11484940803226687 (.l 5742470401613344 (.l 2871235200806672 (.l 1435617600403336 (.l 717808800201668 (.l 358904400100834 (.l 179452200050417 (.l 89726100025209 (.l 38788855954904 (.l 19394427977452 (.l 9697213988726 (.l 4848606994363 (.l 2424303497181 (.l 1212151748590 (.bc 11250305278 (.bc 1 (.l 594825569014 (.l 297412784507 (.bc 16136048935 (.bc 1 (.bc 125704203297 (.bc 1 (.b 6866140015 .nil))))) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 6074194057698 (.l 3037097028849 (.l 1518548514425 (.l 759274257213 (.l 379637128607 (.l 189818564304 (.bc 94909282151 .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))))) +def cmd_306 : Cmd := (.l 30605224967663979 (.l 15302612483831989 (.l 7651306241915994 (.l 2052563612481929 (.l 1026281806240964 (.l 513140903120482 (.l 256570451560241 (.l 128285225780120 (.l 64142612890060 (.l 32071306445030 (.l 16035653222515 (.l 8017826611257 (.l 3502786250125 (.l 1751393125062 (.l 875696562531 (.bc 1 (.l 333742669919 (.bc 39217000389 (.bc 1 (.l 127654334567 (.bc 30248729359 (.bc 1 (.b 33578437921 .nil))) .nil))) (.c (.bc 1 (.l 104105611341 (.l 52052805670 (.bc 12835421755 (.bc 1 (.b 13190981077 .nil))) .nil) .nil))))) .nil) .nil) (.c (.bc 1 (.l 506127055500 (.l 253063527750 (.l 126531763875 (.bc 41906806833 (.bc 1 (.l 21359075101 (.l 10679537550 (.bc 398762970 (.bc 1 (.b 4941005802 .nil))) .nil) .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1773089508476065 (.l 886544754238032 (.l 443272377119016 (.l 221636188559508 (.l 110818094279754 (.l 55409047139877 (.l 27704523569938 (.l 13852261784969 (.l 6926130892485 (.l 3463065446243 (.l 1601648976147 (.l 800824488073 (.l 36160970278 (.l 18080485139 (.bc 6232701155 (.bc 1 (.b 2807541411 .nil))) .nil) (.c (.bc 1 (.l 20301218305 (.l 10150609152 (.bc 1816061465 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 546877757 (.bc 1 (.bc 153809367 (.bc 1 (.bc 37287117 (.bc 1 (.bc 7676757 (.bc 1 (.bc 1316013 (.bc 1 (.bc 182777 (.bc 1 (.bc 19757 (.bc 1 (.bc 1557 (.bc 1 (.bc 77 (.bc 1 (.bc 1 (.bc 1 (.bc 75 (.bc 1 (.bc 1479 (.bc 1 (.bc 18275 (.bc 1 (.bc 164499 (.bc 1 (.bc 1151511 (.bc 1 (.bc 6525243 (.bc 1 (.bc 30761871 (.bc 1 (.bc 123047493 (.bc 1 (.bc 423830261 (.bc 1 (.b 231250108 .nil))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 6380646071 (.l 3190323035 (.bc 1040240680 (.bc 1 (.b 554920835 .nil))) .nil) (.c (.bc 1 (.bc 1774498283 (.bc 1 (.bc 445224491 (.bc 1 (.bc 167400373 (.bc 1 (.bc 370755371 (.bc 1 (.bc 1420304531 (.bc 1 (.bc 4962811543 (.bc 1 (.l 15338706641 (.l 7669353320 (.bc 511942597 (.bc 1 (.b 3322734060 .nil))) .nil) (.c (.bc 1 (.l 42181367203 (.l 21090683601 (.bc 4498860808 (.bc 1 (.b 6046480990 .nil))) .nil) (.c (.bc 1 (.l 103831052951 (.l 51915526475 (.bc 10198369894 (.bc 1 (.b 15759393340 .nil))) .nil) (.c (.bc 1 (.l 167077287960 (.l 83538643980 (.bc 14409615448 (.bc 1 (.b 27359706539 .nil))) .nil) .nil))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.b 129883746971 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) +def cmd_310 : Cmd := (.l 542023360715562277 (.l 271011680357781139 (.l 135505840178890570 (.l 66327028309094476 (.l 33163514154547238 (.l 769418687881047 (.l 384709343940523 (.l 192354671970262 (.l 96177335985131 (.l 48088667992565 (.l 24044333996283 (.l 12022166998141 (.l 6011083499070 (.l 3005541749535 (.l 1502770874768 (.l 751385437384 (.bc 30363392352 (.bc 1 (.l 345329326337 (.l 172664663168 (.bc 7213392503 (.bc 1 (.bc 75422521977 (.bc 1 (.b 3696417098 .nil))))) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 15812338389392569 (.l 4730393151709065 (.l 1248889114997473 (.l 624444557498736 (.l 312222278749368 (.l 156111139374684 (.l 65226912664536 (.l 5380326303963 (.l 2690163151981 (.l 1345081575990 (.l 672540787995 (.bc 114493907772 (.bc 1 (.b 221776486223 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 27233130028302 (.l 3472980922590 (.l 1736490461295 (.l 868245230647 (.l 434122615324 (.l 217061307662 (.bc 14278220020 (.bc 1 (.b 94252433808 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 7082074523771 (.l 3541037261885 (.l 1770518630943 (.l 177530510278 (.l 88765255139 (.bc 30465854169 (.bc 1 (.b 13916773398 .nil))) .nil) (.c (.bc 1 (.l 707728805191 (.bc 127128305663 (.bc 1 (.l 226736096929 (.bc 60365602585 (.bc 1 (.b 53002445876 .nil))) .nil))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 3061509567784 (.l 1530754783892 (.l 765377391946 (.l 382688695973 (.l 191344347987 (.bc 84844082941 (.bc 1 (.b 10828091050 .nil))) .nil) .nil) .nil) .nil) .nil))))))) .nil)))) (.c (.bc 1 (.l 12828657022803 (.l 6414328511401 (.bc 1054293086310 (.bc 1 (.l 2152871169387 (.l 1076435584693 (.l 538217792347 (.bc 150503458996 (.bc 1 (.b 118605437175 .nil))) .nil) .nil) .nil))) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 1116307460857056 (.l 441790423214421 (.l 220895211607210 (.l 110447605803605 (.l 55223802901802 (.l 27611901450901 (.l 1384146734469 (.l 692073367234 (.l 346036683617 (.l 173018341808 (.l 86509170904 (.bc 13666313937 (.bc 1 (.b 29588271512 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 5034891394821 (.l 2517445697410 (.bc 272082688687 (.bc 1 (.l 986640160015 (.l 493320080007 (.bc 69285243539 (.bc 1 (.l 177374796462 (.bc 3801006247 (.bc 1 (.bc 75422521977 (.bc 1 (.b 9463870001 .nil))))) .nil))) .nil) .nil))) .nil) (.c (.bc 1 (.l 7386912596154 (.l 3693456298077 (.l 1846728149039 (.l 923364074519 (.l 352989501971 (.bc 40817811316 (.bc 1 (.bc 30169008789 (.bc 1 (.bc 16244850885 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 423830261 (.bc 1 (.bc 123047493 (.bc 1 (.bc 30761871 (.bc 1 (.bc 6525243 (.bc 1 (.bc 1151511 (.bc 1 (.bc 164499 (.bc 1 (.bc 18275 (.bc 1 (.bc 1479 (.bc 1 (.bc 75 (.bc 1 (.bc 1 (.bc 1 (.bc 73 (.bc 1 (.bc 1403 (.bc 1 (.bc 16869 (.bc 1 (.bc 147627 (.bc 1 (.bc 1003881 (.bc 1 (.bc 5521359 (.bc 1 (.bc 25240509 (.bc 1 (.bc 97806981 (.bc 1 (.bc 326023277 (.bc 1 (.bc 945467509 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 30942573117 (.bc 1 (.b 5897975194 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 108692535286 (.bc 38581973661 (.bc 1 (.b 15764293979 .nil))) .nil)))) .nil) .nil) .nil) .nil))))))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 116363307214104 (.l 58181653607052 (.l 29090826803526 (.l 14545413401763 (.l 7272706700882 (.bc 1286457842539 (.bc 1 (.l 2349895507899 (.l 1174947753949 (.l 587473876975 (.l 53904885751 (.l 26952442875 (.bc 1596185199 (.bc 1 (.b 11880036236 .nil))) .nil) (.c (.bc 1 (.l 239832052733 (.bc 87016720067 (.bc 1 (.l 32899306296 (.bc 11767604945 (.bc 1 (.b 4682048200 .nil))) .nil))) .nil)))) .nil) .nil) .nil))) .nil) .nil) .nil) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 3175776042987216 (.l 1587888021493608 (.l 793944010746804 (.l 396972005373402 (.l 198486002686701 (.l 99243001343350 (.l 49621500671675 (.l 12328050326834 (.l 6164025163417 (.l 3082012581708 (.l 1541006290854 (.bc 123858614421 (.bc 1 (.l 73153696333 (.bc 4079172185 (.bc 1 (.b 32497675978 .nil))) (.c (.bc 1 (.bc 30677356525 (.bc 1 (.bc 11504008695 (.bc 1 (.bc 3834669563 (.bc 1 (.bc 1127843987 (.bc 1 (.bc 290017023 (.bc 1 (.bc 64448225 (.bc 1 (.bc 12192905 (.bc 1 (.bc 1925193 (.bc 1 (.bc 246817 (.bc 1 (.bc 24679 (.bc 1 (.bc 1803 (.bc 1 (.bc 83 (.bc 1 (.bc 1 (.bc 1 (.bc 81 (.bc 1 (.bc 1719 (.bc 1 (.bc 22957 (.bc 1 (.bc 223857 (.bc 1 (.bc 1701333 (.bc 1 (.bc 10491569 (.bc 1 (.bc 53956653 (.bc 1 (.bc 236060367 (.bc 1 (.bc 891783617 (.bc 1 (.bc 2942885943 (.bc 1 (.bc 8561122749 (.bc 1 (.l 22116233773 (.bc 4552832029 (.bc 1 (.b 6505284854 .nil))) (.c (.bc 1 (.bc 51037462557 (.bc 1 (.l 105720458157 (.bc 25538270621 (.bc 1 (.b 27321958454 .nil))) (.c (.bc 1 (.l 197344855229 (.bc 17157990401 (.bc 1 (.bc 30942573117 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 945467509 (.bc 1 (.bc 326023277 (.bc 1 (.bc 97806981 (.bc 1 (.bc 25240509 (.bc 1 (.bc 5521359 (.bc 1 (.bc 1003881 (.bc 1 (.bc 147627 (.bc 1 (.bc 16869 (.bc 1 (.bc 1403 (.bc 1 (.bc 73 (.bc 1 (.bc 1 (.bc 1 (.bc 71 (.bc 1 (.bc 1329 (.bc 1 (.bc 15537 (.bc 1 (.bc 132087 (.bc 1 (.bc 871791 (.bc 1 (.bc 4649565 (.bc 1 (.bc 20590941 (.bc 1 (.bc 77216037 (.bc 1 (.bc 248807237 (.bc 1 (.bc 696660269 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 3704965989 (.bc 1 (.b 4716135714 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 137060838523 (.bc 2408798881 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 25751549337 (.bc 1 (.b 9427497917 .nil))))))))) .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 12482700009001 (.l 3393041897452 (.l 1696520948726 (.l 848260474363 (.l 195958604677 (.bc 22383239499 (.bc 1 (.bc 35345263797 (.bc 1 (.bc 35345263797 (.bc 1 (.b 4905535236 .nil))))))) (.c (.bc 1 (.l 228171632501 (.bc 26905202179 (.bc 1 (.bc 25751549337 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 696660269 (.bc 1 (.bc 248807237 (.bc 1 (.bc 77216037 (.bc 1 (.bc 20590941 (.bc 1 (.bc 4649565 (.bc 1 (.bc 871791 (.bc 1 (.bc 132087 (.bc 1 (.bc 15537 (.bc 1 (.bc 1329 (.bc 1 (.bc 71 (.bc 1 (.bc 1 (.bc 1 (.bc 69 (.bc 1 (.bc 1257 (.bc 1 (.bc 14277 (.bc 1 (.bc 117807 (.bc 1 (.bc 753981 (.bc 1 (.bc 3895581 (.bc 1 (.bc 16695357 (.bc 1 (.bc 60520677 (.bc 1 (.bc 188286557 (.bc 1 (.bc 508373709 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 7592594397 (.bc 1 (.b 199862920 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 2848308107045 (.l 1424154053522 (.l 188564142157 (.l 94282071078 (.bc 10935942196 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 17194993197 (.bc 1 (.b 4394355920 .nil))))))) .nil) (.c (.bc 1 (.l 523512884601 (.l 186870150727 (.bc 13755914676 (.bc 1 (.bc 17194993197 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 508373709 (.bc 1 (.bc 188286557 (.bc 1 (.bc 60520677 (.bc 1 (.bc 16695357 (.bc 1 (.bc 3895581 (.bc 1 (.bc 753981 (.bc 1 (.bc 117807 (.bc 1 (.bc 14277 (.bc 1 (.bc 1257 (.bc 1 (.bc 69 (.bc 1 (.bc 1 (.bc 1 (.bc 67 (.bc 1 (.bc 1187 (.bc 1 (.bc 13087 (.bc 1 (.bc 104717 (.bc 1 (.bc 649261 (.bc 1 (.bc 3246317 (.bc 1 (.bc 13449037 (.bc 1 (.bc 47071637 (.bc 1 (.bc 141214917 (.bc 1 (.bc 367158789 (.bc 1 (.bc 834451797 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 6495886317 (.bc 1 (.b 2870074080 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 74886291570 (.bc 5249783815 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 8119857897 (.bc 1 (.b 5923233467 .nil))))))))) .nil)))) .nil)))) .nil) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil)))) .nil) (.c (.bc 1 (.l 1425891780350806 (.l 712945890175403 (.l 356472945087702 (.l 178236472543851 (.l 89118236271926 (.l 44559118135963 (.l 22279559067982 (.l 11139779533991 (.l 5569889766996 (.l 2784944883498 (.l 1392472441749 (.l 696236220875 (.l 348118110438 (.l 174059055219 (.l 87029527610 (.bc 572652850 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 834451797 (.bc 1 (.bc 367158789 (.bc 1 (.bc 141214917 (.bc 1 (.bc 47071637 (.bc 1 (.bc 13449037 (.bc 1 (.bc 3246317 (.bc 1 (.bc 649261 (.bc 1 (.bc 104717 (.bc 1 (.bc 13087 (.bc 1 (.bc 1187 (.bc 1 (.bc 67 (.bc 1 (.bc 1 (.bc 1 (.bc 65 (.bc 1 (.bc 1119 (.bc 1 (.bc 11965 (.bc 1 (.bc 92749 (.bc 1 (.bc 556509 (.bc 1 (.bc 2689805 (.bc 1 (.bc 10759229 (.bc 1 (.bc 36312405 (.bc 1 (.bc 104902509 (.bc 1 (.bc 262256277 (.bc 1 (.bc 572195517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 4667212437 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 1855967517 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) +def cmd_311 : Cmd := (.l 9518974751473664 (.l 4759487375736832 (.l 2379743687868416 (.l 1189871843934208 (.l 594935921967104 (.l 297467960983552 (.l 148733980491776 (.l 74366990245888 (.l 37183495122944 (.l 18591747561472 (.l 9295873780736 (.l 4647936890368 (.l 2323968445184 (.l 1161984222592 (.l 580992111296 (.l 290496055648 (.l 145248027824 (.l 72624013912 (.bc 1096708077 (.bc 1 (.bc 572195517 (.bc 1 (.bc 262256277 (.bc 1 (.bc 104902509 (.bc 1 (.bc 36312405 (.bc 1 (.bc 10759229 (.bc 1 (.bc 2689805 (.bc 1 (.bc 556509 (.bc 1 (.bc 92749 (.bc 1 (.bc 11965 (.bc 1 (.bc 1119 (.bc 1 (.bc 65 (.bc 1 (.bc 1 (.bc 1 (.bc 63 (.bc 1 (.bc 1053 (.bc 1 (.bc 10909 (.bc 1 (.bc 81837 (.bc 1 (.bc 474669 (.bc 1 (.bc 2215133 (.bc 1 (.bc 8544093 (.bc 1 (.bc 27768309 (.bc 1 (.bc 77134197 (.bc 1 (.bc 185122077 (.bc 1 (.bc 387073437 (.bc 1 (.bc 709634637 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 709634637 (.bc 1 (.bc 387073437 (.bc 1 (.bc 185122077 (.bc 1 (.bc 77134197 (.bc 1 (.bc 27768309 (.bc 1 (.bc 8544093 (.bc 1 (.bc 2215133 (.bc 1 (.bc 474669 (.bc 1 (.bc 81837 (.bc 1 (.bc 10909 (.bc 1 (.bc 1053 (.bc 1 (.bc 63 (.bc 1 (.bc 1 (.bc 1 (.bc 61 (.bc 1 (.bc 989 (.bc 1 (.bc 9917 (.bc 1 (.bc 71917 (.bc 1 (.bc 402749 (.bc 1 (.bc 1812381 (.bc 1 (.bc 6731709 (.bc 1 (.bc 21036597 (.bc 1 (.bc 56097597 (.bc 1 (.bc 129024477 (.bc 1 (.bc 258048957 (.bc 1 (.bc 451585677 (.bc 1 (.bc 694747197 (.bc 1 (.bc 942871197 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 1202160777 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 942871197 (.bc 1 (.bc 694747197 (.bc 1 (.bc 451585677 (.bc 1 (.bc 258048957 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.bc 6731709 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 61 (.bc 1 (.bc 1 (.bc 1 (.bc 59 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 (.bc 1 (.bc 62927 (.bc 1 (.bc 339819 (.bc 1 (.bc 1472559 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.bc 88704327 (.bc 1 (.bc 169344627 (.bc 1 (.bc 282241047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 530365047 (.bc 1 (.bc 601080387 (.bc 1 (.bc 601080387 (.bc 1 (.bc 530365047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 282241047 (.bc 1 (.bc 169344627 (.bc 1 (.bc 88704327 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.bc 11705847 (.bc 1 (.bc 28614297 (.bc 1 (.bc 60090027 (.bc 1 (.bc 109254597 (.bc 1 (.bc 172986447 (.bc 1 (.bc 239519697 (.bc 1 (.bc 290845347 (.bc 1 (.bc 310235037 (.bc 1 (.bc 290845347 (.bc 1 (.bc 239519697 (.bc 1 (.bc 172986447 (.bc 1 (.bc 109254597 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.bc 69194577 (.bc 1 (.bc 103791867 (.bc 1 (.bc 135727827 (.bc 1 (.bc 155117517 (.bc 1 (.bc 155117517 (.bc 1 (.bc 135727827 (.bc 1 (.bc 103791867 (.bc 1 (.bc 69194577 (.bc 1 (.bc 40060017 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.bc 26246217 (.bc 1 (.bc 42948357 (.bc 1 (.bc 60843507 (.bc 1 (.bc 74884317 (.bc 1 (.bc 80233197 (.bc 1 (.bc 74884317 (.bc 1 (.bc 60843507 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.bc 26075787 (.bc 1 (.bc 34767717 (.bc 1 (.bc 40116597 (.bc 1 (.bc 40116597 (.bc 1 (.bc 34767717 (.bc 1 (.bc 26075787 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_312 : Cmd := (.l 35180479774720 (.l 17590239887360 (.l 8795119943680 (.l 4397559971840 (.l 2198779985920 (.l 1099389992960 (.l 549694996480 (.l 274847498240 (.l 137423749120 (.l 68711874560 (.l 34355937280 (.l 17177968640 (.l 8588984320 (.l 4294492160 (.l 2147246080 (.l 1073623040 (.l 536811520 (.l 268405760 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_313 : Cmd := (.l 3877634047 (.l 1938817023 (.l 969408511 (.l 484704255 (.l 242352127 (.l 121176063 (.l 60588031 (.l 30294015 (.l 15147007 (.l 7573503 (.l 3786751 (.l 1893375 (.l 946687 (.l 473343 (.l 236671 (.l 118335 (.l 59167 (.l 29583 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 1025217307367532749 (.l 394629526484048515 (.l 109612095046147817 (.l 54806047523073908 (.l 13807901776842601 (.l 1762870251337031 (.l 881435125668515 (.l 440717562834257 (.l 220358781417128 (.l 109079497302223 (.l 54539748651111 (.l 27269874325555 (.l 11389203940111 (.l 5694601970055 (.l 2847300985027 (.l 1423650492513 (.l 711825246256 (.l 355912623128 (.c (.c (.b 177956311562 .nil))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 2245733222663 .nil)))) .nil) .nil) (.c (.bc 1 (.b 1099893406338 .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 5141080637084266 (.l 2570540318542133 (.l 1285270159271067 (.l 642635079635533 (.l 321317539817767 (.l 160658769908883 (.l 80329384954441 (.l 40164692477221 (.l 1172467879898 (.l 586233939949 (.l 293116969974 (.l 146558484987 (.bc 42197728706 (.bc 1 (.b 31081513784 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 18909878358709 (.l 9454939179354 (.bc 1287551074829 (.bc 1 (.l 3439918514845 (.bc 1027611349491 (.bc 1 (.l 692347907928 (.bc 26775664357 (.bc 1 (.b 319398289604 .nil))) .nil))) .nil))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 13595121984694350 (.l 6797560992347175 (.l 3028864009977014 (.l 1514432004988507 (.l 757216002494254 (.l 378608001247127 (.l 135387746583738 (.l 67693873291869 (.l 33846936645934 (.l 14565589452348 (.l 7282794726174 (.l 3641397363087 (.l 1820698681544 (.bc 708184925233 (.bc 1 (.b 202164415536 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.b 2357878870616 .nil)))) .nil) .nil) (.c (.bc 1 (.l 53916254039823 (.bc 25974863953690 (.bc 1 (.b 983263066218 .nil))) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 369916486196570 (.l 184958243098285 (.l 92479121549142 (.l 46239560774571 (.l 23119780387285 (.l 11559890193643 (.bc 4401179151621 (.bc 1 (.b 1378765945197 .nil))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 87702668195876437 (.l 43851334097938218 (.l 21925667048969109 (.l 5368652318748614 (.l 2684326159374307 (.l 74366892740442 (.l 37183446370221 (.l 18591723185111 (.l 9295861592556 (.l 4647930796278 (.l 2323965398139 (.l 1161982699070 (.l 580991349535 (.l 290495674768 (.bc 13763313934 (.bc 1 (.b 131484523447 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1267796186946708 (.l 633898093473354 (.l 316949046736677 (.l 158474523368339 (.l 79237261684169 (.l 39618630842085 (.l 19809315421042 (.l 778166444077 (.l 389083222038 (.l 194541611019 (.bc 52515966274 (.bc 1 (.b 44754839233 .nil))) .nil) .nil) (.c (.bc 1 (.l 9126491266441 (.bc 458725446141 (.bc 1 (.l 4104520187076 (.l 2052260093538 (.bc 868147014068 (.bc 1 (.b 157983032698 .nil))) .nil) .nil))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 5594181205735938 (.l 2797090602867969 (.l 1398545301433985 (.l 402653366312047 (.l 201326683156023 (.l 100663341578011 (.l 50331670789006 (.bc 17548832432424 (.bc 1 (.l 7617002962076 (.bc 2896282978854 (.bc 1 (.l 912218502181 (.l 456109251090 (.l 228054625545 (.l 114027312772 (.bc 6148889207 (.bc 1 (.b 50864767176 .nil))) .nil) .nil) .nil) .nil))) .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 296619284404943 (.l 148309642202471 (.l 74154821101236 (.l 37077410550618 (.l 18538705275309 (.l 9269352637654 (.l 4634676318827 (.l 1058243732530 (.bc 27684264204 (.bc 1 (.b 501437602058 .nil))) (.c (.bc 1 (.b 1259094426881 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 117979127199717856 (.l 58989563599858928 (.l 13338958205566722 (.l 4599275075266795 (.l 2299637537633397 (.l 1149818768816698 (.l 574909384408349 (.l 287454692204174 (.l 143727346102087 (.l 71863673051043 (.l 35931836525522 (.l 10135881697954 (.l 5067940848977 (.l 2533970424489 (.l 1266985212244 (.l 633492606122 (.bc 77194935067 (.bc 1 (.b 239551367991 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 7830036564804 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 2070204027516563 (.l 1035102013758281 (.l 517551006879141 (.l 258775503439571 (.l 129387751719786 (.l 64693875859893 (.l 32346937929947 (.l 16173468964973 (.l 8086734482486 (.l 4043367241243 (.l 2021683620621 (.l 1010841810311 (.l 505420905155 (.bc 25083843668 (.bc 1 (.b 227626608907 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 16155823594362739 (.l 8077911797181369 (.l 4038955898590685 (.l 2019477949295343 (.l 1009738974647671 (.l 504869487323835 (.l 252434743661918 (.l 126217371830959 (.l 63108685915480 (.l 4303181802335 (.l 2151590901167 (.l 1075795450584 (.l 537897725292 (.l 268948862646 (.bc 105392834294 (.bc 1 (.b 29081597026 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 11197877177869 (.l 5598938588934 (.l 2799469294467 (.bc 584332452328 (.bc 1 (.l 815402194903 (.l 407701097451 (.bc 22180145120 (.bc 1 (.bc 105720458157 (.bc 1 (.bc 51037462557 (.bc 1 (.bc 22116233773 (.bc 1 (.b 2796249106 .nil))))))))) .nil) .nil))) .nil) .nil) (.c (.bc 1 (.l 7652820557955 (.l 3826410278977 (.l 1806549706998 (.l 903274853499 (.l 297141001816 (.bc 5764873643 (.bc 1 (.bc 2942885943 (.bc 1 (.bc 891783617 (.bc 1 (.bc 236060367 (.bc 1 (.bc 53956653 (.bc 1 (.bc 10491569 (.bc 1 (.bc 1701333 (.bc 1 (.bc 223857 (.bc 1 (.bc 22957 (.bc 1 (.bc 1719 (.bc 1 (.bc 81 (.bc 1 (.bc 1 (.bc 1 (.bc 79 (.bc 1 (.bc 1637 (.bc 1 (.bc 21317 (.bc 1 (.bc 202537 (.bc 1 (.bc 1498793 (.bc 1 (.bc 8992773 (.bc 1 (.bc 44963877 (.bc 1 (.bc 191096487 (.bc 1 (.bc 700687127 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 6318923933 (.bc 1 (.bc 15797309837 (.bc 1 (.bc 35240152717 (.bc 1 (.bc 70480305437 (.bc 1 (.b 7642143726 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.b 154496424931 .nil)))) .nil) (.c (.bc 1 (.b 106655432487 .nil)))) .nil) (.c (.bc 1 (.l 8400463419572 (.l 4200231709786 (.l 2100115854893 (.l 1050057927446 (.l 525028963723 (.bc 28642264534 (.bc 1 (.bc 206154893409 (.bc 1 (.b 27717323912 .nil))))) .nil) .nil) .nil) .nil) .nil)))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 117979127199717856 (.l 58989563599858928 (.l 29494781799929464 (.l 14747390899964732 (.l 7373695449982366 (.l 3686847724991183 (.l 1843423862495591 (.l 921711931247796 (.l 460855965623898 (.l 55857989953713 (.l 27928994976856 (.l 13115473187092 (.bc 171445879109 (.bc 1 (.l 6386290714434 (.l 3193145357217 (.l 1596572678609 (.bc 655896626734 (.bc 1 (.b 142389712568 .nil))) .nil) .nil) .nil))) (.c (.bc 1 (.b 849024301333 .nil)))) .nil) (.c (.bc 1 (.l 174569992858233 (.l 87284996429116 (.l 43642498214558 (.l 6897458968414 (.l 3448729484207 (.l 1724364742103 (.l 862182371052 (.l 431091185526 (.bc 57256363728 (.bc 1 (.b 158289229032 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 14923790138862 (.l 7461895069431 (.l 3730947534716 (.bc 925351594652 (.bc 1 (.l 940122172703 (.l 470061086351 (.bc 14598153501 (.bc 1 (.b 220432389671 .nil))) .nil) .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))))) +def cmd_317 : Cmd := (.l 1865352178588220059 (.l 932676089294110030 (.l 411953082334477864 (.l 84865624674954789 (.l 42432812337477394 (.l 18015731731469638 (.l 2084997371579036 (.l 387948676317239 (.l 193974338158619 (.l 96987169079310 (.l 48493584539655 (.l 24246792269828 (.l 12123396134914 (.l 6061698067457 (.l 1384668447385 (.l 692334223692 (.bc 83355348384 (.bc 1 (.b 262811763459 .nil))) .nil) (.c (.bc 1 (.l 1646180586340 (.l 823090293170 (.bc 216943324637 (.bc 1 (.b 194601821945 .nil))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 654550009472276 (.l 327275004736138 (.l 163637502368069 (.l 81818751184035 (.l 40909375592017 (.l 20454687796008 (.l 2365828067110 (.l 1182914033555 (.l 591457016777 (.bc 8930641612 (.bc 1 (.bc 77821263687 (.bc 1 (.bc 26681864379 (.bc 1 (.bc 8155144357 (.bc 1 (.bc 2219722777 (.bc 1 (.bc 612624867 (.bc 1 (.bc 538155747 (.bc 1 (.bc 1791059905 (.bc 1 (.bc 6383116077 (.bc 1 (.bc 20301518187 (.bc 1 (.bc 57520073847 (.bc 1 (.b 84773322914 .nil))))))))))))))))))))))) .nil) .nil) (.c (.bc 1 (.l 7861515830891 (.l 3930757915445 (.l 1965378957723 (.l 61239097243 (.l 30619548621 (.bc 5532759020 (.bc 1 (.b 9777015287 .nil))) .nil) (.c (.bc 1 (.bc 333742670009 (.bc 1 (.l 587707711604 (.bc 291459570602 (.bc 1 (.b 2394285197 .nil))) .nil)))))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 6922868494155780 (.l 3461434247077890 (.l 1251766556347524 (.l 625883278173762 (.l 312941639086881 (.l 22500960952260 (.l 11250480476130 (.l 5625240238065 (.l 2812620119033 (.l 1406310059516 (.bc 102027139563 (.bc 1 (.b 601127890192 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 133969858591178 (.l 66984929295589 (.l 24291321203808 (.l 12145660601904 (.l 6072830300952 (.l 692124955745 (.l 346062477872 (.bc 122329506305 (.bc 1 (.b 50701732628 .nil))) .nil) (.c (.bc 1 (.l 2206137207777 (.l 1103068603888 (.bc 487556141808 (.bc 1 (.b 63978160133 .nil))) .nil) (.c (.bc 1 (.b 138152986948 .nil))))))) .nil) .nil) (.c (.bc 1 (.b 9201143443983 .nil)))) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 478950567191418 (.l 239475283595709 (.l 119737641797854 (.l 59868820898927 (.l 29934410449463 (.l 14967205224732 (.l 7483602612366 (.l 3741801306183 (.l 1870900653092 (.l 370412119546 (.bc 103273200902 (.bc 1 (.b 81932858868 .nil))) (.c (.bc 1 (.b 565038206997 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 3200674437269056 (.l 1600337218634528 (.l 800168609317264 (.l 400084304658632 (.l 200042152329316 (.l 100021076164658 (.l 50010538082329 (.l 25005269041165 (.l 12502634520582 (.l 6251317260291 (.l 2666661653773 (.l 272572419339 (.l 136286209669 (.bc 39773318829 (.bc 1 (.b 28369786003 .nil))) .nil) (.c (.bc 1 (.b 1060758407544 .nil)))) (.c (.bc 1 (.l 458996976369 (.l 229498488184 (.l 114749244092 (.bc 9609573007 (.bc 1 (.b 47765049036 .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 121110916492284140 (.l 16838623551471851 (.l 8419311775735925 (.l 4209655887867963 (.l 2104827943933981 (.l 1052413971966991 (.l 526206985983495 (.l 263103492991748 (.l 131551746495874 (.l 18690670536994 (.l 9345335268497 (.l 4672667634249 (.l 2336333817125 (.l 1168166908563 (.l 584083454281 (.bc 158389844373 (.bc 1 (.bc 126864549789 (.bc 1 (.b 6787332973 .nil))))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 47085202710940 (.l 10559280791293 (.l 5279640395646 (.l 2639820197823 (.l 1319910098911 (.l 128525075111 (.bc 63692972464 (.bc 1 (.b 569565088 .nil))) (.c (.bc 1 (.l 531429974342 (.bc 34670587627 (.bc 1 (.bc 15797309837 (.bc 1 (.bc 6318923933 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 700687127 (.bc 1 (.bc 191096487 (.bc 1 (.bc 44963877 (.bc 1 (.bc 8992773 (.bc 1 (.bc 1498793 (.bc 1 (.bc 202537 (.bc 1 (.bc 21317 (.bc 1 (.bc 1637 (.bc 1 (.bc 79 (.bc 1 (.bc 1 (.bc 1 (.bc 77 (.bc 1 (.bc 1557 (.bc 1 (.bc 19757 (.bc 1 (.bc 182777 (.bc 1 (.bc 1316013 (.bc 1 (.bc 7676757 (.bc 1 (.bc 37287117 (.bc 1 (.bc 153809367 (.bc 1 (.bc 546877757 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 24066445757 (.bc 1 (.bc 46413859677 (.bc 1 (.bc 80450690109 (.bc 1 (.b 36567704637 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 12983320564174 (.l 6491660282087 (.l 3245830141044 (.l 1098390450832 (.l 549195225416 (.bc 89136498660 (.bc 1 (.bc 177464757597 (.bc 1 (.b 7996356445 .nil))))) .nil) (.c (.bc 1 (.b 524524619687 .nil)))) .nil) .nil) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 43716834694670216 (.l 21858417347335108 (.l 9020827617379611 (.l 4510413808689805 (.l 2255206904344903 (.l 371166712361413 (.l 185583356180706 (.l 92791678090353 (.l 46395839045176 (.l 23197919522588 (.l 5417833876267 (.l 2708916938133 (.l 1354458469066 (.bc 29820086346 (.bc 1 (.l 647409148184 (.bc 72722969055 (.bc 1 (.b 250981605034 .nil))) .nil))) .nil) .nil) (.c (.bc 1 (.l 6181125885024 (.l 3090562942512 (.l 1545281471256 (.l 186020463640 (.bc 11583211763 (.bc 1 (.b 81427020054 .nil))) (.c (.bc 1 (.l 459823234109 (.bc 194266037581 (.bc 1 (.b 35645579470 .nil))) (.c (.bc 1 (.b 126797037873 .nil))))))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 756436739811036 (.l 378218369905518 (.l 189109184952759 (.l 61664244544920 (.l 30832122272460 (.l 15416061136230 (.l 7708030568115 (.l 2915477100239 (.bc 103114579180 (.bc 1 (.bc 103831052861 (.bc 1 (.bc 42181365223 (.bc 1 (.bc 15338678261 (.bc 1 (.bc 4962513553 (.bc 1 (.bc 1417861013 (.bc 1 (.bc 354465251 (.bc 1 (.bc 76641133 (.bc 1 (.bc 14118101 (.bc 1 (.bc 2172013 (.bc 1 (.bc 271499 (.bc 1 (.bc 26485 (.bc 1 (.bc 1889 (.bc 1 (.bc 85 (.bc 1 (.bc 1 (.bc 1 (.bc 83 (.bc 1 (.bc 1803 (.bc 1 (.bc 24679 (.bc 1 (.bc 246817 (.bc 1 (.bc 1925193 (.bc 1 (.bc 12192905 (.bc 1 (.bc 64448225 (.bc 1 (.bc 290017023 (.bc 1 (.bc 1127843987 (.bc 1 (.bc 3834669563 (.bc 1 (.bc 11504008695 (.bc 1 (.bc 30677356525 (.bc 1 (.l 73153696333 (.bc 4117477325 (.bc 1 (.b 32459370838 .nil))) (.c (.bc 1 (.bc 156757920717 (.bc 1 (.l 303065313389 (.bc 115922192397 (.bc 1 (.b 35610464294 .nil))) (.c (.bc 1 (.l 530364298433 (.bc 141854293301 (.bc 1 (.b 123327855912 .nil))) (.c (.bc 1 (.l 75590839108 (.bc 2376347383 (.bc 1 (.b 35419072168 .nil))) .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 938538183816 (.l 469269091908 (.bc 45031617940 (.bc 1 (.bc 46413859677 (.bc 1 (.bc 24066445757 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 546877757 (.bc 1 (.bc 153809367 (.bc 1 (.bc 37287117 (.bc 1 (.bc 7676757 (.bc 1 (.bc 1316013 (.bc 1 (.bc 182777 (.bc 1 (.bc 19757 (.bc 1 (.bc 1557 (.bc 1 (.bc 77 (.bc 1 (.bc 1 (.bc 1 (.bc 75 (.bc 1 (.bc 1479 (.bc 1 (.bc 18275 (.bc 1 (.bc 164499 (.bc 1 (.bc 1151511 (.bc 1 (.bc 6525243 (.bc 1 (.bc 30761871 (.bc 1 (.bc 123047493 (.bc 1 (.bc 423830261 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 16244850885 (.bc 1 (.bc 30169008789 (.bc 1 (.b 41438262299 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 32890347931456 (.l 11091485941021 (.l 5545742970510 (.l 2772871485255 (.l 1386435742627 (.l 297483366495 (.bc 8843419018 (.bc 1 (.bc 75422521977 (.bc 1 (.b 64475742246 .nil))))) (.c (.bc 1 (.l 395734504815 (.bc 37566493369 (.bc 1 (.bc 124718287977 (.bc 1 (.b 35582471055 .nil))))) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 5353688024704 (.l 2676844012352 (.bc 142156110717 (.bc 1 (.l 1196265895456 (.l 598132947728 (.l 299066473864 (.bc 84494543921 (.bc 1 (.b 65038693008 .nil))) .nil) .nil) .nil))) .nil) .nil)))) .nil)))) .nil) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 1908381056287940 (.l 954190528143970 (.l 477095264071985 (.l 238547632035993 (.l 119273816017996 (.l 48483915627824 (.l 24241957813912 (.l 12120978906956 (.l 6060489453478 (.l 3030244726739 (.l 1515122363369 (.l 486378090049 (.bc 72807835809 (.bc 1 (.bc 124718287977 (.bc 1 (.b 45662921232 .nil))))) (.c (.bc 1 (.l 271183091632 (.bc 56379314383 (.bc 1 (.bc 75422521977 (.bc 1 (.b 3789709450 .nil))))) .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 11152992381171 (.l 5576496190585 (.l 2788248095292 (.l 1394124047646 (.l 697062023823 (.l 348531011912 (.l 174265505956 (.bc 46491971867 (.bc 1 (.bc 30169008789 (.bc 1 (.b 10471772316 .nil))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 54384962312577148 (.l 27192481156288574 (.l 13596240578144287 (.l 2568612140128491 (.l 1284306070064245 (.l 642153035032122 (.l 321076517516061 (.l 160538258758030 (.l 24798121995124 (.l 12399060997562 (.l 6199530498781 (.l 3099765249391 (.l 1549882624696 (.l 774941312348 (.l 387470656174 (.l 193735328087 (.bc 5773078569 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 423830261 (.bc 1 (.bc 123047493 (.bc 1 (.bc 30761871 (.bc 1 (.bc 6525243 (.bc 1 (.bc 1151511 (.bc 1 (.bc 164499 (.bc 1 (.bc 18275 (.bc 1 (.bc 1479 (.bc 1 (.bc 75 (.bc 1 (.bc 1 (.bc 1 (.bc 73 (.bc 1 (.bc 1403 (.bc 1 (.bc 16869 (.bc 1 (.bc 147627 (.bc 1 (.bc 1003881 (.bc 1 (.bc 5521359 (.bc 1 (.bc 25240509 (.bc 1 (.bc 97806981 (.bc 1 (.bc 326023277 (.bc 1 (.bc 945467509 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 30942573117 (.bc 1 (.b 7729480679 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 55471007383888 (.l 27735503691944 (.l 13867751845972 (.l 6933875922986 (.l 3466937961493 (.l 1733468980747 (.l 866734490373 (.l 433367245187 (.bc 36750468178 (.bc 1 (.bc 57562286757 (.bc 1 (.bc 67156001217 (.bc 1 (.b 55214866433 .nil))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 4229508148943650 (.l 2114754074471825 (.l 444455449292350 (.l 222227724646175 (.l 111113862323088 (.l 55556931161544 (.l 27778465580772 (.l 13889232790386 (.l 6944616395193 (.l 3472308197596 (.l 1736154098798 (.l 868077049399 (.l 434038524699 (.bc 15475661164 (.bc 1 (.bc 67156001217 (.bc 1 (.bc 57562286757 (.bc 1 (.bc 44479948857 (.bc 1 (.bc 30942573117 (.bc 1 (.b 1402791222 .nil))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 612921587943560 (.l 306460793971780 (.l 153230396985890 (.l 76615198492945 (.l 38307599246473 (.bc 496467482092 (.bc 1 (.l 18657332141142 (.l 9328666070571 (.l 4664333035286 (.l 2332166517643 (.l 536161781907 (.l 78840559320 (.bc 10179012567 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 945467509 (.bc 1 (.bc 326023277 (.bc 1 (.bc 97806981 (.bc 1 (.bc 25240509 (.bc 1 (.bc 5521359 (.bc 1 (.bc 1003881 (.bc 1 (.bc 147627 (.bc 1 (.bc 16869 (.bc 1 (.bc 1403 (.bc 1 (.bc 73 (.bc 1 (.bc 1 (.bc 1 (.bc 71 (.bc 1 (.bc 1329 (.bc 1 (.bc 15537 (.bc 1 (.bc 132087 (.bc 1 (.bc 871791 (.bc 1 (.bc 4649565 (.bc 1 (.bc 20590941 (.bc 1 (.bc 77216037 (.bc 1 (.bc 248807237 (.bc 1 (.bc 696660269 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 3704965989 (.bc 1 (.b 2724646914 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 189240331630 (.bc 4400287681 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 25751549337 (.bc 1 (.bc 31810737417 (.bc 1 (.b 1715018251 .nil))))))))))) .nil)))) (.c (.bc 1 (.l 629921476912 (.l 314960738456 (.bc 33630245545 (.bc 1 (.bc 35345263797 (.bc 1 (.bc 31810737417 (.bc 1 (.bc 25751549337 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 12214173597 (.bc 1 .nil)))))))))))) .nil) .nil)))) .nil) .nil) .nil) .nil))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) .nil) .nil) .nil)))) .nil) .nil) +def cmd_318 : Cmd := (.l 75056951140024320 (.l 37528475570012160 (.l 18764237785006080 (.l 9382118892503040 (.l 4691059446251520 (.l 2345529723125760 (.l 1172764861562880 (.l 586382430781440 (.l 293191215390720 (.l 146595607695360 (.l 73297803847680 (.l 36648901923840 (.l 18324450961920 (.l 9162225480960 (.l 4581112740480 (.l 2290556370240 (.l 1145278185120 (.l 572639092560 (.bc 7124934597 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 696660269 (.bc 1 (.bc 248807237 (.bc 1 (.bc 77216037 (.bc 1 (.bc 20590941 (.bc 1 (.bc 4649565 (.bc 1 (.bc 871791 (.bc 1 (.bc 132087 (.bc 1 (.bc 15537 (.bc 1 (.bc 1329 (.bc 1 (.bc 71 (.bc 1 (.bc 1 (.bc 1 (.bc 69 (.bc 1 (.bc 1257 (.bc 1 (.bc 14277 (.bc 1 (.bc 117807 (.bc 1 (.bc 753981 (.bc 1 (.bc 3895581 (.bc 1 (.bc 16695357 (.bc 1 (.bc 60520677 (.bc 1 (.bc 188286557 (.bc 1 (.bc 508373709 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 17194993197 (.bc 1 (.bc 18150270597 (.bc 1 (.bc 17194993197 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 508373709 (.bc 1 (.bc 188286557 (.bc 1 (.bc 60520677 (.bc 1 (.bc 16695357 (.bc 1 (.bc 3895581 (.bc 1 (.bc 753981 (.bc 1 (.bc 117807 (.bc 1 (.bc 14277 (.bc 1 (.bc 1257 (.bc 1 (.bc 69 (.bc 1 (.bc 1 (.bc 1 (.bc 67 (.bc 1 (.bc 1187 (.bc 1 (.bc 13087 (.bc 1 (.bc 104717 (.bc 1 (.bc 649261 (.bc 1 (.bc 3246317 (.bc 1 (.bc 13449037 (.bc 1 (.bc 47071637 (.bc 1 (.bc 141214917 (.bc 1 (.bc 367158789 (.bc 1 (.bc 834451797 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 834451797 (.bc 1 (.bc 367158789 (.bc 1 (.bc 141214917 (.bc 1 (.bc 47071637 (.bc 1 (.bc 13449037 (.bc 1 (.bc 3246317 (.bc 1 (.bc 649261 (.bc 1 (.bc 104717 (.bc 1 (.bc 13087 (.bc 1 (.bc 1187 (.bc 1 (.bc 67 (.bc 1 (.bc 1 (.bc 1 (.bc 65 (.bc 1 (.bc 1119 (.bc 1 (.bc 11965 (.bc 1 (.bc 92749 (.bc 1 (.bc 556509 (.bc 1 (.bc 2689805 (.bc 1 (.bc 10759229 (.bc 1 (.bc 36312405 (.bc 1 (.bc 104902509 (.bc 1 (.bc 262256277 (.bc 1 (.bc 572195517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 4667212437 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 572195517 (.bc 1 (.bc 262256277 (.bc 1 (.bc 104902509 (.bc 1 (.bc 36312405 (.bc 1 (.bc 10759229 (.bc 1 (.bc 2689805 (.bc 1 (.bc 556509 (.bc 1 (.bc 92749 (.bc 1 (.bc 11965 (.bc 1 (.bc 1119 (.bc 1 (.bc 65 (.bc 1 (.bc 1 (.bc 1 (.bc 63 (.bc 1 (.bc 1053 (.bc 1 (.bc 10909 (.bc 1 (.bc 81837 (.bc 1 (.bc 474669 (.bc 1 (.bc 2215133 (.bc 1 (.bc 8544093 (.bc 1 (.bc 27768309 (.bc 1 (.bc 77134197 (.bc 1 (.bc 185122077 (.bc 1 (.bc 387073437 (.bc 1 (.bc 709634637 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 709634637 (.bc 1 (.bc 387073437 (.bc 1 (.bc 185122077 (.bc 1 (.bc 77134197 (.bc 1 (.bc 27768309 (.bc 1 (.bc 8544093 (.bc 1 (.bc 2215133 (.bc 1 (.bc 474669 (.bc 1 (.bc 81837 (.bc 1 (.bc 10909 (.bc 1 (.bc 1053 (.bc 1 (.bc 63 (.bc 1 (.bc 1 (.bc 1 (.bc 61 (.bc 1 (.bc 989 (.bc 1 (.bc 9917 (.bc 1 (.bc 71917 (.bc 1 (.bc 402749 (.bc 1 (.bc 1812381 (.bc 1 (.bc 6731709 (.bc 1 (.bc 21036597 (.bc 1 (.bc 56097597 (.bc 1 (.bc 129024477 (.bc 1 (.bc 258048957 (.bc 1 (.bc 451585677 (.bc 1 (.bc 694747197 (.bc 1 (.bc 942871197 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 1202160777 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 942871197 (.bc 1 (.bc 694747197 (.bc 1 (.bc 451585677 (.bc 1 (.bc 258048957 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.bc 6731709 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 61 (.bc 1 (.bc 1 (.bc 1 (.bc 59 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 (.bc 1 (.bc 62927 (.bc 1 (.bc 339819 (.bc 1 (.bc 1472559 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.bc 88704327 (.bc 1 (.bc 169344627 (.bc 1 (.bc 282241047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 530365047 (.bc 1 (.bc 601080387 (.bc 1 (.bc 601080387 (.bc 1 (.bc 530365047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 282241047 (.bc 1 (.bc 169344627 (.bc 1 (.bc 88704327 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.bc 11705847 (.bc 1 (.bc 28614297 (.bc 1 (.bc 60090027 (.bc 1 (.bc 109254597 (.bc 1 (.bc 172986447 (.bc 1 (.bc 239519697 (.bc 1 (.bc 290845347 (.bc 1 (.bc 310235037 (.bc 1 (.bc 290845347 (.bc 1 (.bc 239519697 (.bc 1 (.bc 172986447 (.bc 1 (.bc 109254597 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_319 : Cmd := (.l 562509210714112 (.l 281254605357056 (.l 140627302678528 (.l 70313651339264 (.l 35156825669632 (.l 17578412834816 (.l 8789206417408 (.l 4394603208704 (.l 2197301604352 (.l 1098650802176 (.l 549325401088 (.l 274662700544 (.l 137331350272 (.l 68665675136 (.l 34332837568 (.l 17166418784 (.l 8583209392 (.l 4291604696 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.bc 69194577 (.bc 1 (.bc 103791867 (.bc 1 (.bc 135727827 (.bc 1 (.bc 155117517 (.bc 1 (.bc 155117517 (.bc 1 (.bc 135727827 (.bc 1 (.bc 103791867 (.bc 1 (.bc 69194577 (.bc 1 (.bc 40060017 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.bc 26246217 (.bc 1 (.bc 42948357 (.bc 1 (.bc 60843507 (.bc 1 (.bc 74884317 (.bc 1 (.bc 80233197 (.bc 1 (.bc 74884317 (.bc 1 (.bc 60843507 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.bc 26075787 (.bc 1 (.bc 34767717 (.bc 1 (.bc 40116597 (.bc 1 (.bc 40116597 (.bc 1 (.bc 34767717 (.bc 1 (.bc 26075787 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_320 : Cmd := (.l 363883134975 (.l 181941567487 (.l 90970783743 (.l 45485391871 (.l 22742695935 (.l 11371347967 (.l 5685673983 (.l 2842836991 (.l 1421418495 (.l 710709247 (.l 355354623 (.l 177677311 (.l 88838655 (.l 44419327 (.l 22209663 (.l 11104831 (.l 5552415 (.l 2776207 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 948737990474326873 (.l 224450037493678287 (.l 112225018746839143 (.l 47035276201009791 (.l 13618292827648605 (.l 6809146413824302 (.l 3404573206912151 (.l 1702286603456075 (.l 851143301728037 (.l 425571650864018 (.l 212785825432009 (.l 106392912716004 (.l 19392339492977 (.l 9696169746488 (.l 4848084873244 (.l 2424042436622 (.l 1212021218311 (.l 606010609155 (.c (.c (.b 303005304575 .nil))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 31417830027497 (.l 15708915013748 (.l 4479692324170 (.l 2239846162085 (.l 1119923081042 (.bc 233988683730 (.bc 1 (.b 325972856788 .nil))) .nil) .nil) (.c (.bc 1 (.l 3374765182701 (.bc 990974874924 (.bc 1 (.b 696407716423 .nil))) .nil)))) .nil) (.c (.bc 1 (.b 2386286837522 .nil))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 9899345272856287 (.l 4949672636428143 (.l 2474836318214071 (.l 1237418159107035 (.l 618709079553517 (.l 309354539776758 (.l 154677269888379 (.l 77338634944190 (.bc 16464410898305 (.bc 1 (.bc 16224729856639 (.bc 1 (.l 5980176717145 (.bc 409060315607 (.bc 1 (.b 2581028042962 .nil))) .nil))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 9077233172409777 (.l 4538616586204888 (.l 2269308293102444 (.l 1134654146551222 (.l 567327073275611 (.l 283663536637805 (.l 141831768318902 (.l 70915884159451 (.l 35457942079726 (.l 16299994415056 (.l 8149997207528 (.l 4074998603764 (.l 2037499301882 (.l 708031439376 (.bc 73292824415 (.bc 1 (.b 280722895270 .nil))) (.c (.bc 1 (.b 310718211562 .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.b 1428976624804 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 249918957743485146 (.l 124959478871742573 (.l 62479739435871287 (.l 31239869717935643 (.l 15619934858967821 (.l 7809967429483911 (.l 3904983714741955 (.bc 118775621834466 (.bc 1 (.l 1833716235536509 (.l 916858117768254 (.l 458429058884127 (.l 152768451250311 (.bc 28207125117491 (.bc 1 (.l 48177100507661 (.l 24088550253830 (.l 12044275126915 (.bc 1448094721202 (.bc 1 (.l 4574042842253 (.l 2287021421126 (.bc 147881466521 (.bc 1 (.b 995629244039 .nil))) .nil) .nil))) .nil) .nil) .nil))) (.c (.bc 1 (.l 76446078191750 (.bc 12952293038534 (.bc 1 (.l 25270746057338 (.l 12635373028669 (.l 6317686514334 (.l 2944216779307 (.l 1472108389653 (.bc 520745434943 (.bc 1 (.b 215308759880 .nil))) .nil) (.c (.bc 1 (.b 214626477857 .nil)))) .nil) .nil) .nil))) .nil)))) .nil) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 249918957743485146 (.l 124959478871742573 (.l 62479739435871286 (.l 31239869717935643 (.l 15619934858967822 (.l 4252721111751503 (.l 2126360555875751 (.l 1063180277937876 (.l 531590138968938 (.l 265795069484469 (.l 132897534742235 (.l 66448767371117 (.l 33224383685558 (.l 16612191842779 (.l 8306095921390 (.l 4153047960695 (.bc 206480159130 (.bc 1 (.b 1870043821215 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 3557246317732405 (.l 1778623158866202 (.l 889311579433101 (.l 444655789716551 (.l 71355072575653 (.l 35677536287826 (.l 17838768143913 (.l 8919384071957 (.l 4459692035978 (.l 2229846017989 (.bc 1114703312273 (.bc 1 (.b 219696719 .nil))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 150972822282620 (.l 75486411141310 (.l 37743205570655 (.l 18871602785328 (.l 9435801392664 (.l 2800863264429 (.l 1400431632214 (.l 700215816107 (.bc 14986741929 (.bc 1 (.b 335121166121 .nil))) .nil) .nil) (.c (.bc 1 (.b 1917037431900 .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))))) +def cmd_324 : Cmd := (.l 4715534133023004559 (.l 2117761771644448695 (.l 679887126668263239 (.l 92889634723937801 (.l 46444817361968900 (.l 10286792270653882 (.l 5143396135326941 (.bc 123731372820933 (.bc 1 (.l 2447966694842535 (.l 1223983347421267 (.l 611991673710633 (.l 305995836855316 (.l 118922169401492 (.l 59461084700746 (.l 6134257221349 (.l 3067128610674 (.l 1533564305337 (.bc 405632335769 (.bc 1 (.b 361149816896 .nil))) .nil) .nil) (.c (.bc 1 (.l 23596285129021 (.l 9684564065647 (.l 4842282032823 (.bc 1142082792290 (.bc 1 (.l 683287551657 (.l 341643775828 (.bc 104335305674 (.bc 1 (.b 66486582237 .nil))) .nil) (.c (.bc 1 (.bc 281353727247 (.bc 1 (.bc 104503128069 (.bc 1 (.bc 34837008739 (.bc 1 (.bc 10374867137 (.bc 1 (.bc 2832347647 (.bc 1 (.bc 1150780617 (.bc 1 (.bc 2329215655 (.bc 1 (.bc 8174175985 (.bc 1 (.bc 26684634267 (.bc 1 (.bc 77821592037 (.bc 1 (.b 45709195028 .nil)))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 2113578498860 (.l 1056789249430 (.bc 157823298978 (.bc 1 (.b 370571325734 .nil))) .nil) .nil)))) .nil)))) .nil) (.c (.bc 1 (.l 34075749026163 (.l 17037874513081 (.l 8518937256540 (.l 4259468628270 (.l 2129734314135 (.bc 109183764435 (.bc 1 (.b 955683392630 .nil))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil))) .nil) (.c (.bc 1 (.l 12935616410330565 (.l 6467808205165282 (.l 3233904102582641 (.l 1616952051291320 (.l 808476025645660 (.l 404238012822830 (.l 202119006411415 (.l 101059503205707 (.l 50529751602853 (.l 25264875801427 (.l 12632437900714 (.bc 67794128549 (.bc 1 (.l 1982987697107 (.l 991493848553 (.bc 211650069576 (.bc 1 (.b 284096854697 .nil))) .nil) (.c (.bc 1 (.l 3499390053717 (.bc 403516193468 (.bc 1 (.l 1346178833387 (.bc 44509346999 (.bc 1 (.bc 303065313389 (.bc 1 (.bc 156757920717 (.bc 1 (.bc 73153696333 (.bc 1 (.bc 30677356525 (.bc 1 (.bc 11504008695 (.bc 1 (.bc 3834669563 (.bc 1 (.bc 1127843987 (.bc 1 (.bc 290017023 (.bc 1 (.bc 64448225 (.bc 1 (.bc 12192905 (.bc 1 (.bc 1925193 (.bc 1 (.bc 246817 (.bc 1 (.bc 24679 (.bc 1 (.bc 1803 (.bc 1 (.bc 83 (.bc 1 (.bc 1 (.bc 1 (.bc 81 (.bc 1 (.bc 1719 (.bc 1 (.bc 22957 (.bc 1 (.bc 223857 (.bc 1 (.bc 1701333 (.bc 1 (.bc 10491569 (.bc 1 (.bc 53956653 (.bc 1 (.bc 236060367 (.bc 1 (.bc 891783617 (.bc 1 (.bc 2942885943 (.bc 1 (.bc 8561122749 (.bc 1 (.bc 22116233773 (.bc 1 (.b 13275919051 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil))) (.c (.bc 1 (.l 766047070975 (.l 383023535487 (.bc 37761543505 (.bc 1 (.bc 105720458157 (.bc 1 (.b 48029766076 .nil))))) .nil) .nil))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 247053928610193815 (.l 16590597810171308 (.l 8295298905085654 (.l 4147649452542827 (.l 2073824726271414 (.l 1036912363135707 (.l 518456181567853 (.l 259228090783926 (.l 129614045391963 (.bc 4178765449570 (.bc 1 (.l 60628257246409 (.l 30314128623204 (.l 15157064311602 (.l 7578532155801 (.l 3789266077900 (.l 1894633038950 (.bc 84021879004 (.bc 1 (.bc 333019443201 (.bc 1 (.bc 509323854309 (.bc 1 (.b 20951342952 .nil))))))) .nil) .nil) .nil) .nil) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 106936366494925596 (.l 53468183247462798 (.l 26734091623731399 (.l 13367045811865700 (.l 377768386920596 (.l 188884193460298 (.l 94442096730149 (.l 47221048365074 (.l 23610524182537 (.l 11805262091269 (.l 5902631045635 (.l 2951315522818 (.bc 821420208184 (.bc 1 (.b 654237553222 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 6305754519012251 (.l 2691599072182150 (.l 1345799536091075 (.l 672899768045537 (.l 168068289425281 (.bc 7826700121661 (.bc 1 (.l 76207444590976 (.l 38103722295488 (.l 17167275300486 (.l 6675918275487 (.l 1358322193815 (.bc 72944079990 (.bc 1 (.b 606217016914 .nil))) (.c (.bc 1 (.l 1979636943925 (.bc 287333604681 (.bc 1 (.b 702484867278 .nil))) .nil)))) (.c (.bc 1 (.l 1907719374753 (.l 953859687376 (.bc 325098347558 (.bc 1 (.b 151831496127 .nil))) .nil) .nil)))) (.c (.bc 1 (.b 1884585847255 .nil)))) .nil) .nil))) (.c (.bc 1 (.l 153673327338157 (.l 76836663669078 (.l 30651256214640 (.l 15325628107320 (.l 7662814053660 (.l 1472081260919 (.bc 689111021842 (.bc 1 (.b 46929608614 .nil))) (.c (.bc 1 (.l 2359325765908 (.bc 980653606221 (.bc 1 (.b 199009276730 .nil))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 7767075619896 (.l 3883537809948 (.bc 703639662246 (.bc 1 (.b 1238129242725 .nil))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 14708267259325 (.l 7354133629662 (.l 3677066814831 (.l 1838533407416 (.l 919266703708 (.bc 101558771482 (.bc 1 (.l 358074580369 (.bc 158319732881 (.bc 1 (.b 20717557300 .nil))) .nil))) .nil) .nil) .nil) .nil) .nil))))))) .nil) .nil) (.c (.bc 1 (.l 461278187323972 (.l 230639093661986 (.l 115319546830993 (.l 57659773415497 (.bc 17107473264177 (.bc 1 (.l 11722413443569 (.l 5861206721784 (.l 2930603360892 (.l 1465301680446 (.l 732650840223 (.bc 152068145291 (.bc 1 (.b 214257274818 .nil))) .nil) .nil) .nil) .nil) .nil))) .nil) .nil) .nil) .nil)))) .nil)))) .nil) .nil) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 378993759153961105 (.l 123569480766979788 (.l 40305799326773128 (.l 1841328107915977 (.l 920664053957988 (.l 460332026978994 (.l 230166013489497 (.l 115083006744749 (.l 57541503372374 (.l 28770751686187 (.l 14385375843093 (.l 7192687921546 (.l 3596343960773 (.l 1798171980386 (.l 899085990193 (.bc 46194708173 (.bc 1 (.b 403348286920 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 18311571555470584 (.l 124580572783569 (.l 62290286391784 (.l 31145143195892 (.l 15572571597946 (.l 7786285798973 (.l 3893142899487 (.bc 1175956294552 (.bc 1 (.b 770615155189 .nil))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 9031205204951720 (.l 4515602602475860 (.l 2257801301237930 (.l 1128900650618965 (.l 495159570559070 (.l 12974942001585 (.l 6487471000792 (.l 3243735500396 (.l 1621867750198 (.l 810933875099 (.l 405466937549 (.l 202733468774 (.bc 39879903041 (.bc 1 (.b 61486831343 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 234604843277947 (.l 43010441607344 (.l 21505220803672 (.l 10752610401836 (.l 5376305200918 (.l 2688152600459 (.l 626340732437 (.bc 271532611857 (.bc 1 (.b 41637754358 .nil))) (.c (.bc 1 (.l 689734851165 (.bc 155707100869 (.bc 1 (.bc 105720458157 (.bc 1 (.bc 51037462557 (.bc 1 (.bc 22116233773 (.bc 1 (.bc 8561122749 (.bc 1 (.b 1725047462 .nil))))))))))) (.c (.bc 1 (.l 28000716621 (.bc 1217838479 (.bc 1 (.bc 891783617 (.bc 1 (.bc 236060367 (.bc 1 (.bc 53956653 (.bc 1 (.bc 10491569 (.bc 1 (.bc 1701333 (.bc 1 (.bc 223857 (.bc 1 (.bc 22957 (.bc 1 (.bc 1719 (.bc 1 (.bc 81 (.bc 1 (.bc 1 (.bc 1 (.bc 79 (.bc 1 (.bc 1637 (.bc 1 (.bc 21317 (.bc 1 (.bc 202537 (.bc 1 (.bc 1498793 (.bc 1 (.bc 8992773 (.bc 1 (.bc 44963877 (.bc 1 (.bc 191096487 (.bc 1 (.bc 700687127 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 6318923933 (.bc 1 (.b 2079690238 .nil))))))))))))))))))))))))))))))))))))))))))))) .nil))))))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 35075427592469 (.l 17537713796234 (.l 8768856898117 (.l 4384428449059 (.l 2192214224529 (.l 305741953296 (.bc 13717619599 (.bc 1 (.bc 35240152717 (.bc 1 (.bc 70480305437 (.bc 1 (.b 33432898886 .nil))))))) (.c (.bc 1 (.bc 146012418087 (.bc 1 (.l 57520043487 (.bc 20425441856 (.bc 1 (.b 8334579884 .nil))) (.c (.bc 1 (.bc 20301191817 (.bc 1 (.bc 6380374569 (.bc 1 (.bc 1772326267 (.bc 1 (.bc 431106387 (.bc 1 (.bc 90759237 (.bc 1 (.bc 16290117 (.bc 1 (.bc 2443515 (.bc 1 (.bc 297987 (.bc 1 (.bc 28377 (.bc 1 (.bc 1977 (.bc 1 (.bc 87 (.bc 1 (.bc 1 (.bc 1 (.bc 85 (.bc 1 (.bc 1889 (.bc 1 (.bc 26485 (.bc 1 (.bc 271499 (.bc 1 (.bc 2172013 (.bc 1 (.bc 14118101 (.bc 1 (.bc 76641133 (.bc 1 (.bc 354465251 (.bc 1 (.bc 1417861013 (.bc 1 (.bc 4962513553 (.bc 1 (.bc 15338678261 (.bc 1 (.bc 42181365223 (.bc 1 (.bc 103831052861 (.bc 1 (.l 229911617053 (.bc 99233319633 (.bc 1 (.b 15722488890 .nil))) (.c (.bc 1 (.b 159747092550 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 38504900988843 (.l 19252450494421 (.l 9626225247210 (.l 1875560749846 (.l 937780374923 (.bc 300076141559 (.bc 1 (.l 168814045899 (.bc 57534854949 (.bc 1 (.b 26872167997 .nil))) .nil))) .nil) (.c (.bc 1 (.l 2937551873756 (.bc 881560532382 (.bc 1 (.l 587215404493 (.bc 223835299732 (.bc 1 (.b 69772402511 .nil))) .nil))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 711651450308 (.l 355825725154 (.l 177912862577 (.l 88956431288 (.l 44478215644 (.l 22239107822 (.bc 10159128980 (.bc 1 (.b 960424928 .nil))) .nil) .nil) .nil) .nil) .nil) .nil)))))))))) .nil)))) (.c (.bc 1 (.b 69290754750409 .nil)))) .nil) .nil) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 21478941056716763 (.l 10739470528358381 (.l 5369735264179190 (.l 2296918087452447 (.l 1148459043726223 (.l 574229521863111 (.l 287114760931556 (.l 143557380465778 (.l 41305409101242 (.l 20652704550621 (.l 10326352275310 (.l 5163176137655 (.l 2581588068827 (.l 739362064128 (.bc 217697904725 (.bc 1 (.b 151983127336 .nil))) (.c (.bc 1 (.b 551431970283 .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 30473281131644 (.l 15236640565822 (.l 7618320282911 (.l 3809160141456 (.l 1904580070728 (.l 952290035364 (.bc 110558761958 (.bc 1 (.b 365586255721 .nil))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 387949544637145 (.l 193974772318572 (.l 96987386159286 (.l 48493693079643 (.l 24246846539822 (.l 12123423269911 (.l 6061711634955 (.l 3030855817478 (.l 1515427908739 (.l 757713954370 (.l 378856977185 (.bc 172671618716 (.bc 1 (.b 16756869874 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 65927398810000761 (.l 32963699405000380 (.l 16481849702500190 (.l 8240924851250095 (.l 4120462425625047 (.l 2060231212812523 (.l 1030115606406261 (.l 515057803203130 (.l 257528901601565 (.l 55592267251594 (.l 27796133625797 (.l 13898066812898 (.l 6949033406449 (.l 3474516703224 (.bc 176482411093 (.bc 1 (.l 1560775940516 (.bc 384327264975 (.bc 1 (.b 396060705280 .nil))) .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 73172183549186 (.l 36586091774593 (.l 18293045887297 (.l 9146522943649 (.l 4573261471825 (.l 1256887019593 (.bc 8164575917 (.bc 1 (.bc 303168960897 (.bc 1 (.bc 206154893409 (.bc 1 (.b 110955079564 .nil))))))) (.c (.bc 1 (.l 1029743716316 (.bc 15909470223 (.bc 1 (.bc 70480305437 (.bc 1 (.bc 35240152717 (.bc 1 (.bc 15797309837 (.bc 1 (.bc 6318923933 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 700687127 (.bc 1 (.bc 191096487 (.bc 1 (.bc 44963877 (.bc 1 (.bc 8992773 (.bc 1 (.bc 1498793 (.bc 1 (.bc 202537 (.bc 1 (.bc 21317 (.bc 1 (.bc 1637 (.bc 1 (.bc 79 (.bc 1 (.bc 1 (.bc 1 (.bc 77 (.bc 1 (.bc 1557 (.bc 1 (.bc 19757 (.bc 1 (.bc 182777 (.bc 1 (.bc 1316013 (.bc 1 (.bc 7676757 (.bc 1 (.bc 37287117 (.bc 1 (.bc 153809367 (.bc 1 (.bc 546877757 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 24066445757 (.bc 1 (.bc 46413859677 (.bc 1 (.bc 80450690109 (.bc 1 (.bc 125704203297 (.bc 1 (.b 73061031568 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 240005294867053582 (.l 120002647433526791 (.l 60001323716763396 (.l 30000661858381698 (.l 15000330929190849 (.l 7500165464595425 (.l 3750082732297713 (.l 1875041366148857 (.l 937520683074429 (.l 468760341537215 (.l 230599561206041 (.l 82310886518871 (.l 19309820351833 (.l 8023751655719 (.l 1696193970943 (.l 774720295810 (.l 387360147905 (.bc 104403726029 (.bc 1 (.b 89276347920 .nil))) .nil) (.c (.bc 1 (.b 73376689658 .nil)))) (.c (.bc 1 (.l 2315681856913 (.l 1157840928456 (.l 578920464228 (.bc 119140003261 (.bc 1 (.b 170320228850 .nil))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 1631158520194 (.l 815579260097 (.l 407789630049 (.l 203894815025 (.bc 92244587947 (.bc 1 (.b 9702819563 .nil))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 21845622907599 (.l 10922811453799 (.l 5461405726899 (.l 2730702863450 (.l 1285471211831 (.bc 265990238074 (.bc 1 (.bc 262564816797 (.bc 1 (.b 114180551038 .nil))))) (.c (.bc 1 (.b 79880219891 .nil)))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 32988894084146 (.l 16494447042073 (.l 8247223521037 (.l 4123611760518 (.l 2061805880259 (.l 1030902940129 (.bc 72639862612 (.bc 1 (.bc 177464757597 (.bc 1 (.bc 125704203297 (.bc 1 (.bc 80450690109 (.bc 1 (.bc 46413859677 (.bc 1 (.b 12778096758 .nil))))))))))) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 3780609562564 (.l 1890304781282 (.l 945152390641 (.l 472576195321 (.l 236288097661 (.l 118144048831 (.l 59072024416 (.bc 11288348999 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 546877757 (.bc 1 (.bc 153809367 (.bc 1 (.bc 37287117 (.bc 1 (.bc 7676757 (.bc 1 (.bc 1316013 (.bc 1 (.bc 182777 (.bc 1 (.bc 19757 (.bc 1 (.bc 1557 (.bc 1 (.bc 77 (.bc 1 (.bc 1 (.bc 1 (.bc 75 (.bc 1 (.bc 1479 (.bc 1 (.bc 18275 (.bc 1 (.bc 164499 (.bc 1 (.bc 1151511 (.bc 1 (.bc 6525243 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) +def cmd_325 : Cmd := (.l 541856589661349627 (.l 270928294830674813 (.l 135464147415337406 (.l 67732073707668703 (.l 33866036853834351 (.l 16933018426917175 (.l 8466509213458587 (.l 4233254606729293 (.l 1238926308587425 (.l 619463154293712 (.l 309731577146856 (.l 154865788573428 (.l 77432894286714 (.l 38716447143357 (.l 19358223571678 (.l 9679111785839 (.l 4839555892919 (.l 2419777946459 (.bc 30761871 (.bc 1 (.bc 123047493 (.bc 1 (.bc 423830261 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 16244850885 (.bc 1 (.bc 30169008789 (.bc 1 (.bc 50281681317 (.bc 1 (.bc 75422521977 (.bc 1 (.bc 102042235617 (.bc 1 (.bc 124718287977 (.bc 1 (.bc 137846528817 (.bc 1 (.bc 137846528817 (.bc 1 (.bc 124718287977 (.bc 1 (.bc 102042235617 (.bc 1 (.bc 75422521977 (.bc 1 (.bc 50281681317 (.bc 1 (.bc 30169008789 (.bc 1 (.bc 16244850885 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 423830261 (.bc 1 (.bc 123047493 (.bc 1 (.bc 30761871 (.bc 1 (.bc 6525243 (.bc 1 (.bc 1151511 (.bc 1 (.bc 164499 (.bc 1 (.bc 18275 (.bc 1 (.bc 1479 (.bc 1 (.bc 75 (.bc 1 (.bc 1 (.bc 1 (.bc 73 (.bc 1 (.bc 1403 (.bc 1 (.bc 16869 (.bc 1 (.bc 147627 (.bc 1 (.bc 1003881 (.bc 1 (.bc 5521359 (.bc 1 (.bc 25240509 (.bc 1 (.bc 97806981 (.bc 1 (.bc 326023277 (.bc 1 (.bc 945467509 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 30942573117 (.bc 1 (.b 40050800251 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 877700994777218 (.l 438850497388609 (.l 219425248694304 (.l 109712624347152 (.l 54856312173576 (.l 27428156086788 (.l 13714078043394 (.l 452017305028 (.l 226008652514 (.l 113004326257 (.bc 4429148606 (.bc 1 (.b 52073014520 .nil))) .nil) .nil) (.c (.bc 1 (.l 6405021716666 (.l 3202510858333 (.l 322595343004 (.bc 5489272237 (.bc 1 (.bc 67156001217 (.bc 1 (.bc 70690527597 (.bc 1 (.b 17961870442 .nil))))))) (.c (.bc 1 (.l 1278660086160 (.bc 49194130773 (.bc 1 (.bc 57562286757 (.bc 1 (.bc 44479948857 (.bc 1 (.bc 30942573117 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 945467509 (.bc 1 (.bc 326023277 (.bc 1 (.bc 97806981 (.bc 1 (.bc 25240509 (.bc 1 (.bc 5521359 (.bc 1 (.bc 1003881 (.bc 1 (.bc 147627 (.bc 1 (.bc 16869 (.bc 1 (.bc 1403 (.bc 1 (.bc 73 (.bc 1 (.bc 1 (.bc 1 (.bc 71 (.bc 1 (.bc 1329 (.bc 1 (.bc 15537 (.bc 1 (.bc 132087 (.bc 1 (.bc 871791 (.bc 1 (.bc 4649565 (.bc 1 (.bc 20590941 (.bc 1 (.bc 77216037 (.bc 1 (.bc 248807237 (.bc 1 (.bc 696660269 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 25751549337 (.bc 1 (.bc 31810737417 (.bc 1 (.bc 35345263797 (.bc 1 (.bc 35345263797 (.bc 1 (.bc 31810737417 (.bc 1 (.bc 25751549337 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 696660269 (.bc 1 (.bc 248807237 (.bc 1 (.bc 77216037 (.bc 1 (.bc 20590941 (.bc 1 (.bc 4649565 (.bc 1 (.bc 871791 (.bc 1 (.bc 132087 (.bc 1 (.bc 15537 (.bc 1 (.bc 1329 (.bc 1 (.bc 71 (.bc 1 (.bc 1 (.bc 1 (.bc 69 (.bc 1 (.bc 1257 (.bc 1 (.bc 14277 (.bc 1 (.bc 117807 (.bc 1 (.bc 753981 (.bc 1 (.bc 3895581 (.bc 1 (.bc 16695357 (.bc 1 (.bc 60520677 (.bc 1 (.bc 188286557 (.bc 1 (.bc 508373709 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 17194993197 (.bc 1 (.bc 18150270597 (.bc 1 (.bc 17194993197 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 508373709 (.bc 1 (.bc 188286557 (.bc 1 (.bc 60520677 (.bc 1 (.bc 16695357 (.bc 1 (.bc 3895581 (.bc 1 (.bc 753981 (.bc 1 (.bc 117807 (.bc 1 (.bc 14277 (.bc 1 (.bc 1257 (.bc 1 (.bc 69 (.bc 1 (.bc 1 (.bc 1 (.bc 67 (.bc 1 (.bc 1187 (.bc 1 (.bc 13087 (.bc 1 (.bc 104717 (.bc 1 (.bc 649261 (.bc 1 (.bc 3246317 (.bc 1 (.bc 13449037 (.bc 1 (.bc 47071637 (.bc 1 (.bc 141214917 (.bc 1 (.bc 367158789 (.bc 1 (.bc 834451797 (.bc 1 (.bc 1668903597 (.bc 1 (.b 2366145516 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 30098502274504962 (.l 15049251137252481 (.l 7524625568626241 (.l 3762312784313121 (.l 1881156392156561 (.l 940578196078281 (.l 470289098039141 (.l 235144549019571 (.l 117572274509786 (.l 58786137254893 (.l 29393068627447 (.l 14696534313724 (.l 7348267156862 (.l 3674133578431 (.l 1837066789216 (.l 918533394608 (.l 459266697304 (.l 229633348652 (.bc 586530081 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 834451797 (.bc 1 (.bc 367158789 (.bc 1 (.bc 141214917 (.bc 1 (.bc 47071637 (.bc 1 (.bc 13449037 (.bc 1 (.bc 3246317 (.bc 1 (.bc 649261 (.bc 1 (.bc 104717 (.bc 1 (.bc 13087 (.bc 1 (.bc 1187 (.bc 1 (.bc 67 (.bc 1 (.bc 1 (.bc 1 (.bc 65 (.bc 1 (.bc 1119 (.bc 1 (.bc 11965 (.bc 1 (.bc 92749 (.bc 1 (.bc 556509 (.bc 1 (.bc 2689805 (.bc 1 (.bc 10759229 (.bc 1 (.bc 36312405 (.bc 1 (.bc 104902509 (.bc 1 (.bc 262256277 (.bc 1 (.bc 572195517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 4667212437 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 572195517 (.bc 1 (.bc 262256277 (.bc 1 (.bc 104902509 (.bc 1 (.bc 36312405 (.bc 1 (.bc 10759229 (.bc 1 (.bc 2689805 (.bc 1 (.bc 556509 (.bc 1 (.bc 92749 (.bc 1 (.bc 11965 (.bc 1 (.bc 1119 (.bc 1 (.bc 65 (.bc 1 (.bc 1 (.bc 1 (.bc 63 (.bc 1 (.bc 1053 (.bc 1 (.bc 10909 (.bc 1 (.bc 81837 (.bc 1 (.bc 474669 (.bc 1 (.bc 2215133 (.bc 1 (.bc 8544093 (.bc 1 (.bc 27768309 (.bc 1 (.bc 77134197 (.bc 1 (.bc 185122077 (.bc 1 (.bc 387073437 (.bc 1 (.bc 709634637 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 709634637 (.bc 1 (.bc 387073437 (.bc 1 (.bc 185122077 (.bc 1 (.bc 77134197 (.bc 1 (.bc 27768309 (.bc 1 (.bc 8544093 (.bc 1 (.bc 2215133 (.bc 1 (.bc 474669 (.bc 1 (.bc 81837 (.bc 1 (.bc 10909 (.bc 1 (.bc 1053 (.bc 1 (.bc 63 (.bc 1 (.bc 1 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) +def cmd_326 : Cmd := (.l 4494803520716800 (.l 2247401760358400 (.l 1123700880179200 (.l 561850440089600 (.l 280925220044800 (.l 140462610022400 (.l 70231305011200 (.l 35115652505600 (.l 17557826252800 (.l 8778913126400 (.l 4389456563200 (.l 2194728281600 (.l 1097364140800 (.l 548682070400 (.l 274341035200 (.l 137170517600 (.l 68585258800 (.l 34292629400 (.bc 61 (.bc 1 (.bc 989 (.bc 1 (.bc 9917 (.bc 1 (.bc 71917 (.bc 1 (.bc 402749 (.bc 1 (.bc 1812381 (.bc 1 (.bc 6731709 (.bc 1 (.bc 21036597 (.bc 1 (.bc 56097597 (.bc 1 (.bc 129024477 (.bc 1 (.bc 258048957 (.bc 1 (.bc 451585677 (.bc 1 (.bc 694747197 (.bc 1 (.bc 942871197 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 1202160777 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 942871197 (.bc 1 (.bc 694747197 (.bc 1 (.bc 451585677 (.bc 1 (.bc 258048957 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.bc 6731709 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 61 (.bc 1 (.bc 1 (.bc 1 (.bc 59 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 (.bc 1 (.bc 62927 (.bc 1 (.bc 339819 (.bc 1 (.bc 1472559 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.bc 88704327 (.bc 1 (.bc 169344627 (.bc 1 (.bc 282241047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 530365047 (.bc 1 (.bc 601080387 (.bc 1 (.bc 601080387 (.bc 1 (.bc 530365047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 282241047 (.bc 1 (.bc 169344627 (.bc 1 (.bc 88704327 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.bc 11705847 (.bc 1 (.bc 28614297 (.bc 1 (.bc 60090027 (.bc 1 (.bc 109254597 (.bc 1 (.bc 172986447 (.bc 1 (.bc 239519697 (.bc 1 (.bc 290845347 (.bc 1 (.bc 310235037 (.bc 1 (.bc 290845347 (.bc 1 (.bc 239519697 (.bc 1 (.bc 172986447 (.bc 1 (.bc 109254597 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.bc 69194577 (.bc 1 (.bc 103791867 (.bc 1 (.bc 135727827 (.bc 1 (.bc 155117517 (.bc 1 (.bc 155117517 (.bc 1 (.bc 135727827 (.bc 1 (.bc 103791867 (.bc 1 (.bc 69194577 (.bc 1 (.bc 40060017 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.bc 26246217 (.bc 1 (.bc 42948357 (.bc 1 (.bc 60843507 (.bc 1 (.bc 74884317 (.bc 1 (.bc 80233197 (.bc 1 (.bc 74884317 (.bc 1 (.bc 60843507 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.bc 26075787 (.bc 1 (.bc 34767717 (.bc 1 (.bc 40116597 (.bc 1 (.bc 40116597 (.bc 1 (.bc 34767717 (.bc 1 (.bc 26075787 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_327 : Cmd := (.l 8795972435968 (.l 4397986217984 (.l 2198993108992 (.l 1099496554496 (.l 549748277248 (.l 274874138624 (.l 137437069312 (.l 68718534656 (.l 34359267328 (.l 17179633664 (.l 8589816832 (.l 4294908416 (.l 2147454208 (.l 1073727104 (.l 536863552 (.l 268431776 (.l 134215888 (.l 67107944 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_328 : Cmd := (.l 132644863 (.l 66322431 (.l 33161215 (.l 16580607 (.l 8290303 (.l 4145151 (.l 2072575 (.l 1036287 (.l 518143 (.l 259071 (.l 129535 (.l 64767 (.l 32383 (.l 16191 (.l 8095 (.l 4047 (.l 2023 (.l 1011 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 476331487797425801 (.l 238165743898712900 (.l 119082871949356450 (.l 59541435974678225 (.l 27653014834711417 (.l 9041290504745191 (.l 4520645252372595 (.l 2260322626186297 (.l 1130161313093148 (.l 565080656546574 (.l 282540328273287 (.l 141270164136643 (.l 53417939961223 (.l 26708969980611 (.l 13354484990305 (.l 6677242495152 (.l 1121139836707 (.l 560569918353 (.c (.c (.b 280284959174 .nil))) .nil) (.c (.bc 1 (.b 2217481410866 .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 17217142107095 (.l 8608571053547 (.l 4304285526774 (.bc 481437442354 (.bc 1 (.b 1670705321030 .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 4785216912610514 (.l 2392608456305257 (.l 1196304228152629 (.l 598152114076314 (.l 299076057038157 (.l 149538028519078 (.l 74769014259539 (.l 37384507129770 (.l 18692253564885 (.l 9346126782442 (.l 4673063391221 (.l 2336531695610 (.bc 458198439634 (.bc 1 (.b 710067408168 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.b 2117703152627692 .nil)))) .nil) .nil) .nil) .nil))) +def cmd_332 : Cmd := (.l 9516304214882388914 (.l 3747979902500306328 (.l 1124832378263508284 (.l 74273248099352511 (.l 37136624049676255 (.l 18568312024838128 (.l 9284156012419064 (.l 4642078006209532 (.l 2321039003104766 (.l 1160519501552383 (.l 580259750776191 (.l 290129875388096 (.l 118549409073689 (.l 59274704536844 (.l 29637352268422 (.l 14818676134211 (.bc 1111039514278 (.bc 1 (.bc 4509697827385 (.bc 1 (.b 1788600725436 .nil))))) .nil) .nil) .nil) (.c (.bc 1 (.l 26515528620356 (.l 13257764310178 (.l 6628882155089 (.l 3314441077544 (.bc 397919435410 (.bc 1 (.bc 964641278907 (.bc 1 (.b 294659824449 .nil))))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 488142941032401628 (.l 18410304323730479 (.l 9205152161865239 (.l 4602576080932620 (.l 2301288040466310 (.l 1150644020233155 (.l 575322010116578 (.l 128806975761445 (.l 64403487880722 (.l 32201743940361 (.l 16100871970180 (.l 8050435985090 (.l 4025217992545 (.bc 91197030870 (.bc 1 (.bc 139340136811 (.bc 1 (.bc 45211875879 (.bc 1 (.bc 13207214787 (.bc 1 (.bc 3983128267 (.bc 1 (.bc 3479996275 (.bc 1 (.bc 10503391643 (.bc 1 (.bc 34858810255 (.bc 1 (.bc 104506226307 (.bc 1 (.bc 281354086047 (.bc 1 (.bc 683287584179 (.bc 1 (.b 601679514919 .nil))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 158854029296841 (.l 34231302195814 (.l 17115651097907 (.l 8557825548953 (.l 4278912774476 (.l 2139456387238 (.bc 901553096431 (.bc 1 (.b 168175097185 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 45195712452603 (.l 22597856226301 (.l 11298928113151 (.l 5649464056575 (.l 2824732028288 (.l 1412366014144 (.l 706183007072 (.bc 19432757423 (.bc 1 (.b 333658746110 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 225661166192470332 (.l 112830583096235166 (.l 56415291548117583 (.bc 264388097926043 (.bc 1 (.l 27943257676132746 (.l 10139895337327242 (.l 5069947668663621 (.l 2534973834331810 (.l 1267486917165905 (.l 299287490247270 (.l 136691077017016 (.l 18987323836486 (.l 3000441682094 (.bc 909541103199 (.bc 1 (.b 590679737845 .nil))) (.c (.bc 1 (.b 6493220236146 .nil)))) (.c (.bc 1 (.l 49358214672019 (.l 24679107336009 (.l 1645087894906 (.bc 221402482081 (.bc 1 (.b 601141465369 .nil))) (.c (.bc 1 (.l 9137296251377 (.l 4568648125688 (.bc 1461344489579 (.bc 1 (.b 822979573262 .nil))) .nil) (.c (.bc 1 (.b 1557169521715 .nil))))))) .nil) .nil)))) (.c (.bc 1 (.b 12952668106616 .nil)))) (.c (.bc 1 (.l 241602700150627 (.l 120801350075313 (.l 60400675037656 (.l 30200337518828 (.l 10770146506534 (.l 5385073253267 (.bc 1200620128085 (.bc 1 (.b 1491916498545 .nil))) .nil) (.c (.bc 1 (.l 4330022252877 (.l 1744063798698 (.bc 567144895379 (.bc 1 (.b 304887003967 .nil))) (.c (.bc 1 (.b 420947327737 .nil)))) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 92853268185050 (.l 46426634092525 (.l 23213317046263 (.l 11606658523132 (.l 5803329261566 (.l 2901664630783 (.bc 857346928112 (.bc 1 (.b 593485387277 .nil))) .nil) .nil) .nil) .nil) .nil) .nil))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 3831733500739128 (.l 1915866750369564 (.l 957933375184782 (.l 478966687592391 (.l 45344632390747 (.l 22672316195373 (.l 11336158097686 (.l 5668079048843 (.l 2834039524422 (.l 1417019762211 (.bc 239944224548 (.bc 1 (.bc 459823234109 (.bc 1 (.b 8742422442 .nil))))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 85343955355799 (.l 42671977677899 (.l 21335988838950 (.l 10667994419475 (.l 5333997209737 (.l 2666998604869 (.bc 221169194611 (.bc 1 (.bc 103831052861 (.bc 1 (.bc 42181365223 (.bc 1 (.bc 15338678261 (.bc 1 (.bc 4962513553 (.bc 1 (.bc 1417861013 (.bc 1 (.bc 354465251 (.bc 1 (.bc 76641133 (.bc 1 (.bc 14118101 (.bc 1 (.bc 2172013 (.bc 1 (.bc 271499 (.bc 1 (.bc 26485 (.bc 1 (.bc 1889 (.bc 1 (.bc 85 (.bc 1 (.bc 1 (.bc 1 (.bc 83 (.bc 1 (.bc 1803 (.bc 1 (.bc 24679 (.bc 1 (.bc 246817 (.bc 1 (.bc 1925193 (.bc 1 (.bc 12192905 (.bc 1 (.bc 64448225 (.bc 1 (.bc 290017023 (.bc 1 (.bc 1127843987 (.bc 1 (.bc 3834669563 (.bc 1 (.bc 11504008695 (.bc 1 (.bc 30677356525 (.bc 1 (.bc 73153696333 (.bc 1 (.bc 156757920717 (.bc 1 (.bc 303065313389 (.bc 1 (.b 363661274429 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 73580328581315 (.l 36790164290657 (.l 18395082145328 (.l 6846229026457 (.l 1223571109606 (.l 611785554803 (.bc 166703024004 (.bc 1 (.b 139189753394 .nil))) .nil) (.c (.bc 1 (.b 2199543403619 .nil)))) (.c (.bc 1 (.l 2351312046204 (.l 1175656023102 (.l 587828011551 (.bc 153267693213 (.bc 1 (.b 140646312560 .nil))) .nil) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.b 35214427468326 .nil)))))))))) .nil) .nil) .nil) .nil)))) .nil))) .nil) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 749157572986644877 (.l 195554891664827625 (.l 69705985006641920 (.l 21407523566795603 (.l 10703761783397801 (.l 5351880891698900 (.l 2675940445849450 (.l 1337970222924725 (.l 668985111462363 (.l 334492555731181 (.l 62630222759673 (.l 31315111379836 (.l 15657555689918 (.l 7828777844959 (.l 3914388922480 (.bc 409999562138 (.bc 1 (.l 1547194899099 (.bc 320846573586 (.bc 1 (.b 452750875960 .nil))) .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 104616055105914 (.l 52308027552957 (.l 26154013776478 (.l 13077006888239 (.l 6538503444120 (.l 3269251722060 (.bc 1148193987737 (.bc 1 (.b 486431873290 .nil))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 13445468936525354 (.l 6722734468262677 (.l 3361367234131339 (.l 1680683617065670 (.l 840341808532835 (.l 420170904266417 (.bc 29404782062310 (.bc 1 (.l 180680670070896 (.l 38210274755234 (.bc 2696836790268 (.bc 1 (.l 16408300587346 (.bc 6666286516800 (.bc 1 (.b 1537863776870 .nil))) .nil))) (.c (.bc 1 (.l 52130060280211 (.l 26065030140105 (.l 13032515070052 (.l 6516257535026 (.l 3258128767513 (.l 1629064383756 (.bc 607941560234 (.bc 1 (.b 206590631641 .nil))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil))) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 28071460825771889 (.l 14035730412885944 (.l 7017865206442972 (.l 3508932603221486 (.l 1754466301610743 (.l 877233150805371 (.l 438616575402686 (.l 219308287701343 (.l 109654143850671 (.l 54827071925336 (.l 27413535962668 (.l 13706767981334 (.l 2509355285586 (.bc 209461533177 (.bc 1 (.b 1045216109613 .nil))) (.c (.bc 1 (.b 4344028705078 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 179023894828494810 (.l 89511947414247405 (.l 44755973707123703 (.bc 304614254807248 (.bc 1 (.l 22073372598754601 (.l 11036686299377300 (.l 5518343149688650 (.bc 30377064549422 (.bc 1 (.l 2728794510294900 (.l 926057433672059 (.l 463028716836029 (.l 83331106790285 (.l 41665553395142 (.l 20832776697571 (.l 10416388348785 (.l 5208194174393 (.l 2153277898002 (.bc 50463415659 (.bc 1 (.b 1026175533339 .nil))) (.c (.bc 1 (.b 450819189192 .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 148183251627726 (.l 74091625813863 (.l 37045812906931 (.l 12117848783900 (.l 6058924391950 (.l 3029462195975 (.bc 852513835780 (.bc 1 (.b 662217262204 .nil))) .nil) .nil) (.c (.bc 1 (.l 6405057669562 (.l 3202528834781 (.bc 19108668549 (.bc 1 (.b 1582155748838 .nil))) .nil) .nil)))) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 438339821475388 (.l 219169910737694 (.l 109584955368847 (.l 54792477684424 (.l 27396238842212 (.l 13698119421106 (.l 6849059710553 (.bc 400831948267 (.bc 1 (.l 1023477521085 (.bc 257868391402 (.bc 1 (.b 253870369137 .nil))) (.c (.bc 1 (.bc 479755088007 (.bc 1 (.bc 203532461577 (.bc 1 (.bc 77821235307 (.bc 1 (.bc 26681566389 (.bc 1 (.bc 8152700839 (.bc 1 (.bc 2203432657 (.bc 1 (.bc 521865627 (.bc 1 (.bc 107049357 (.bc 1 (.bc 18733635 (.bc 1 (.bc 2741505 (.bc 1 (.bc 326367 (.bc 1 (.bc 30357 (.bc 1 (.bc 2067 (.bc 1 (.bc 89 (.bc 1 (.bc 1 (.bc 1 (.bc 87 (.bc 1 (.bc 1977 (.bc 1 (.bc 28377 (.bc 1 (.bc 297987 (.bc 1 (.bc 2443515 (.bc 1 (.bc 16290117 (.bc 1 (.bc 90759237 (.bc 1 (.bc 431106387 (.bc 1 (.bc 1772326267 (.bc 1 (.bc 6380374569 (.bc 1 (.bc 20301191817 (.bc 1 (.bc 57520043487 (.bc 1 (.bc 146012418087 (.bc 1 (.bc 333742669917 (.bc 1 (.b 635153200223 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil))) .nil) .nil) .nil))) .nil) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 1010172204940888126 (.l 505086102470444063 (.l 252543051235222032 (.l 126271525617611016 (.l 63135762808805508 (.l 31567881404402754 (.l 7330642895326873 (.l 3665321447663436 (.l 1832660723831718 (.l 916330361915859 (.l 458165180957929 (.l 126748987142683 (.l 63374493571341 (.l 31687246785671 (.l 15843623392836 (.l 3470263896689 (.bc 54581650942 (.bc 1 (.l 1293252845937 (.bc 319673476126 (.bc 1 (.b 326952946839 .nil))) (.c (.bc 1 (.b 387297451459 .nil)))))) (.c (.bc 1 (.l 4451547799726 (.l 1818839756316 (.bc 696116423838 (.bc 1 (.b 213303454317 .nil))) (.c (.bc 1 (.b 406934143544 .nil)))) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 102333603336279 (.l 51166801668139 (.l 25583400834069 (.l 12791700417035 (.l 6395850208517 (.l 3024834846333 (.bc 425572771422 (.bc 1 (.bc 530364298433 (.bc 1 (.bc 303065313389 (.bc 1 (.bc 156757920717 (.bc 1 (.bc 73153696333 (.bc 1 (.b 23503422857 .nil))))))))))) (.c (.bc 1 (.l 173090257922 (.bc 7173933666 (.bc 1 (.bc 11504008695 (.bc 1 (.bc 3834669563 (.bc 1 (.bc 1127843987 (.bc 1 (.bc 290017023 (.bc 1 (.bc 64448225 (.bc 1 (.bc 12192905 (.bc 1 (.bc 1925193 (.bc 1 (.bc 246817 (.bc 1 (.bc 24679 (.bc 1 (.bc 1803 (.bc 1 (.bc 83 (.bc 1 (.bc 1 (.bc 1 (.bc 81 (.bc 1 (.bc 1719 (.bc 1 (.bc 22957 (.bc 1 (.bc 223857 (.bc 1 (.bc 1701333 (.bc 1 (.bc 10491569 (.bc 1 (.bc 53956653 (.bc 1 (.bc 236060367 (.bc 1 (.bc 891783617 (.bc 1 (.bc 2942885943 (.bc 1 (.bc 8561122749 (.bc 1 (.bc 22116233773 (.bc 1 (.b 27721331628 .nil))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 8453297806874501 (.l 4226648903437250 (.l 2113324451718625 (.l 1056662225859313 (.l 4104405963813 (.l 2052202981906 (.l 1026101490953 (.l 513050745477 (.l 256525372738 (.l 128262686369 (.l 64131343185 (.bc 23316130929 (.bc 1 (.b 8749540660 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 524226706965841 (.l 262113353482920 (.l 71489510203420 (.l 35744755101710 (.l 7560028419572 (.l 3780014209786 (.l 1890007104893 (.bc 96970917497 (.bc 1 (.bc 197344855229 (.bc 1 (.bc 333019443201 (.bc 1 (.b 317668336511 .nil))))))) .nil) .nil) (.c (.bc 1 (.l 10312349131280 (.l 5156174565640 (.l 2578087282820 (.bc 191655517798 (.bc 1 (.bc 707394242097 (.bc 1 (.b 389993881509 .nil))))) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 59567166538037 (.l 20170945347470 (.l 10085472673735 (.l 5042736336868 (.bc 171408365216 (.bc 1 (.l 2349959803215 (.bc 417852557478 (.bc 1 (.b 757127344126 .nil))) .nil))) .nil) .nil) (.c (.bc 1 (.l 9612637921545 (.l 4806318960772 (.l 2403159480386 (.l 1201579740193 (.bc 270455870711 (.bc 1 (.b 330333999383 .nil))) .nil) .nil) .nil) .nil)))) .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 1010172204940888126 (.l 505086102470444063 (.l 252543051235222031 (.l 126271525617611016 (.l 63135762808805508 (.l 31567881404402754 (.l 15783940702201377 (.l 7891970351100689 (.l 3945985175550345 (.l 1972992587775172 (.l 986496293887586 (.l 493248146943793 (.l 174721126973330 (.l 87360563486665 (.l 43680281743333 (.l 12499229029377 (.l 4889858395802 (.l 2444929197901 (.bc 746181749494 (.bc 1 (.b 476282849453 .nil))) .nil) (.c (.bc 1 (.l 1359756118883 (.bc 343272918938 (.bc 1 (.b 336605140500 .nil))) .nil)))) (.c (.bc 1 (.l 9340911842287 (.l 4670455921143 (.l 2335227960572 (.bc 211361335662 (.bc 1 (.bc 893550621597 (.bc 1 (.b 62702023021 .nil))))) .nil) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 71902946498564 (.l 35951473249282 (.l 17975736624641 (.l 8987868312321 (.l 4493934156161 (.l 2246967078080 (.bc 644692219076 (.bc 1 (.b 478791319961 .nil))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) +def cmd_336 : Cmd := (.l 4862081492241743335 (.l 2431040746120871668 (.l 1215520373060435834 (.l 13378305531528198 (.l 6689152765764099 (.l 3344576382882050 (.l 1672288191441025 (.l 836144095720512 (.l 418072047860256 (.l 209036023930128 (.l 104518011965064 (.l 52259005982532 (.l 24893267684183 (.l 12446633842091 (.l 6223316921045 (.l 3111658460522 (.l 1555829230261 (.l 777914615130 (.l 388957307565 (.bc 30532534348 (.bc 1 (.b 163946119432 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 1236235307080 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 594381880998689716 (.l 43913950072075943 (.bc 1918986330457488 (.bc 1 (.l 20037988705580480 (.l 10018994352790240 (.l 5009497176395120 (.l 2504748588197560 (.l 1252374294098780 (.l 626187147049390 (.l 313093573524695 (.l 156546786762347 (.l 78273393381174 (.l 39136696690587 (.l 19568348345294 (.l 2209637835501 (.l 1104818917750 (.l 552409458875 (.bc 42289604911 (.bc 1 (.bc 197344855229 (.bc 1 (.b 36570269291 .nil))))) .nil) .nil) (.c (.bc 1 (.l 7574536337143 (.l 3787268168571 (.l 1433577116987 (.bc 69150188865 (.bc 1 (.bc 51037462557 (.bc 1 (.bc 22116233773 (.bc 1 (.bc 8561122749 (.bc 1 (.bc 2942885943 (.bc 1 (.bc 891783617 (.bc 1 (.bc 236060367 (.bc 1 (.bc 53956653 (.bc 1 (.bc 10491569 (.bc 1 (.bc 1701333 (.bc 1 (.bc 223857 (.bc 1 (.bc 22957 (.bc 1 (.bc 1719 (.bc 1 (.bc 81 (.bc 1 (.bc 1 (.bc 1 (.bc 79 (.bc 1 (.bc 1637 (.bc 1 (.bc 21317 (.bc 1 (.bc 202537 (.bc 1 (.bc 1498793 (.bc 1 (.bc 8992773 (.bc 1 (.bc 44963877 (.bc 1 (.bc 191096487 (.bc 1 (.bc 700687127 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 6318923933 (.bc 1 (.bc 15797309837 (.bc 1 (.bc 35240152717 (.bc 1 (.bc 70480305437 (.bc 1 (.bc 126864549789 (.bc 1 (.bc 206154893409 (.bc 1 (.b 97740623797 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 460056967295 (.bc 205428337098 (.bc 1 (.b 24600146546 .nil))) .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil))) (.c (.bc 1 (.l 253276990427268912 (.l 126638495213634456 (.l 8892322195667887 (.l 4446161097833943 (.l 2223080548916971 (.l 1111540274458486 (.l 555770137229243 (.l 277885068614622 (.l 138942534307311 (.l 69471267153655 (.l 34735633576827 (.l 17367816788413 (.l 5424004459268 (.l 2712002229634 (.l 1356001114817 (.bc 379625134651 (.bc 1 (.b 298375422755 .nil))) .nil) .nil) (.c (.bc 1 (.l 3259903934936 (.l 1629951967468 (.l 814975983734 (.bc 190949917642 (.bc 1 (.b 216538074222 .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 54426925411149338 (.l 27213462705574669 (.l 13606731352787335 (.bc 58623650462593 (.bc 1 (.l 6744742025931072 (.l 3274324140522733 (.l 891961914332667 (.l 328537504951755 (.l 164268752475877 (.l 82134376237938 (.l 41067188118969 (.l 2978316784060 (.l 1489158392030 (.l 744579196015 (.bc 264470141560 (.bc 1 (.b 107819456445 .nil))) .nil) .nil) (.c (.bc 1 (.bc 3151161439757 (.bc 1 (.l 1350498134229 (.l 675249067114 (.l 337624533557 (.bc 36543238022 (.bc 1 (.b 132269028754 .nil))) .nil) .nil) (.c (.bc 1 (.bc 525196992133 (.bc 1 (.bc 184552012693 (.bc 1 (.bc 58419090669 (.bc 1 (.bc 17190343057 (.bc 1 (.bc 7463124545 (.bc 1 (.bc 13983387921 (.bc 1 (.bc 45362201901 (.bc 1 (.bc 139365036565 (.bc 1 (.bc 385860312357 (.bc 1 (.bc 964641670229 (.bc 1 (.l 2186520195533 (.l 1093260097766 (.l 546630048883 (.bc 64302040130 (.bc 1 (.b 209012984308 .nil))) .nil) .nil) (.c (.bc 1 (.l 4509697829643 (.l 2254848914821 (.l 1127424457410 (.bc 195212296888 (.bc 1 (.bc 303168960897 (.bc 1 (.b 65330970914 .nil))))) .nil) .nil) (.c (.bc 1 (.l 4015365504148 (.l 2007682752074 (.l 1003841376037 (.bc 140823922495 (.bc 1 (.bc 126864549789 (.bc 1 (.bc 70480305437 (.bc 1 (.bc 35240152717 (.bc 1 (.bc 15797309837 (.bc 1 (.bc 6318923933 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 700687127 (.bc 1 (.bc 191096487 (.bc 1 (.bc 44963877 (.bc 1 (.bc 8992773 (.bc 1 (.bc 1498793 (.bc 1 (.bc 202537 (.bc 1 (.bc 21317 (.bc 1 (.bc 1637 (.bc 1 (.bc 79 (.bc 1 (.bc 1 (.bc 1 (.bc 77 (.bc 1 (.bc 1557 (.bc 1 (.bc 19757 (.bc 1 (.bc 182777 (.bc 1 (.bc 1316013 (.bc 1 (.bc 7676757 (.bc 1 (.bc 37287117 (.bc 1 (.bc 153809367 (.bc 1 (.bc 546877757 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 24066445757 (.bc 1 (.bc 46413859677 (.bc 1 (.b 14485752777 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 117443452214575 (.l 58721726107287 (.l 29360863053644 (.l 14680431526822 (.l 4473477464971 (.l 708571048558 (.l 354285524279 (.bc 65964937332 (.bc 1 (.b 111177824804 .nil))) .nil) (.c (.bc 1 (.l 1528167683924 (.bc 213305288 (.bc 1 (.l 763870536671 (.bc 14419725846 (.bc 1 (.bc 177464757597 (.bc 1 (.b 190050784886 .nil))))) .nil))) .nil)))) (.c (.bc 1 (.l 2866738298437 (.l 1433369149218 (.l 716684574609 (.bc 36709738710 (.bc 1 (.bc 262564816797 (.bc 1 (.b 59067731791 .nil))))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 745200155928696 (.l 262357148511850 (.l 131178574255925 (.l 65589287127963 (.l 32794643563982 (.l 11752935703770 (.l 5876467851885 (.l 2938233925942 (.bc 216625325846 (.bc 1 (.bc 262564816797 (.bc 1 (.bc 226760523597 (.bc 1 (.bc 177464757597 (.bc 1 (.bc 125704203297 (.bc 1 (.bc 80450690109 (.bc 1 (.bc 46413859677 (.bc 1 (.bc 24066445757 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 546877757 (.bc 1 (.bc 153809367 (.bc 1 (.bc 37287117 (.bc 1 (.bc 7676757 (.bc 1 (.bc 1316013 (.bc 1 (.bc 182777 (.bc 1 (.bc 19757 (.bc 1 (.bc 1557 (.bc 1 (.bc 77 (.bc 1 (.bc 1 (.bc 1 (.bc 75 (.bc 1 (.bc 1479 (.bc 1 (.bc 18275 (.bc 1 (.bc 164499 (.bc 1 (.bc 1151511 (.bc 1 (.bc 6525243 (.bc 1 (.bc 30761871 (.bc 1 (.bc 123047493 (.bc 1 (.bc 423830261 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 16244850885 (.bc 1 (.bc 30169008789 (.bc 1 (.bc 50281681317 (.bc 1 (.bc 75422521977 (.bc 1 (.bc 102042235617 (.bc 1 (.b 3635541078 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) (.c (.bc 1 (.l 4644386078218 (.l 2322193039109 (.l 1161096519555 (.bc 121082746898 (.bc 1 (.bc 137846528817 (.bc 1 (.bc 137846528817 (.bc 1 (.bc 124718287977 (.bc 1 (.b 59054167256 .nil))))))))) .nil) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 110242929452495 (.l 55121464726247 (.l 27560732363123 (.l 13283230097273 (.l 6641615048636 (.l 3320807524318 (.l 1660403762159 (.bc 42988068361 (.bc 1 (.bc 75422521977 (.bc 1 (.bc 50281681317 (.bc 1 (.bc 30169008789 (.bc 1 (.bc 16244850885 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 423830261 (.bc 1 (.bc 123047493 (.bc 1 (.bc 30761871 (.bc 1 (.bc 6525243 (.bc 1 (.bc 1151511 (.bc 1 (.bc 164499 (.bc 1 (.bc 18275 (.bc 1 (.bc 1479 (.bc 1 (.bc 75 (.bc 1 (.bc 1 (.bc 1 (.bc 73 (.bc 1 (.bc 1403 (.bc 1 (.bc 16869 (.bc 1 (.bc 147627 (.bc 1 (.bc 1003881 (.bc 1 (.bc 5521359 (.bc 1 (.bc 25240509 (.bc 1 (.bc 97806981 (.bc 1 (.bc 326023277 (.bc 1 (.bc 945467509 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 30942573117 (.bc 1 (.bc 44479948857 (.bc 1 (.bc 57562286757 (.bc 1 (.bc 67156001217 (.bc 1 (.bc 70690527597 (.bc 1 (.bc 67156001217 (.bc 1 (.bc 57562286757 (.bc 1 (.bc 44479948857 (.bc 1 (.bc 30942573117 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 945467509 (.bc 1 (.bc 326023277 (.bc 1 (.bc 97806981 (.bc 1 (.bc 25240509 (.bc 1 (.bc 5521359 (.bc 1 (.bc 1003881 (.bc 1 (.bc 147627 (.bc 1 (.bc 16869 (.bc 1 (.bc 1403 (.bc 1 (.bc 73 (.bc 1 (.bc 1 (.bc 1 (.bc 71 (.bc 1 (.bc 1329 (.bc 1 (.bc 15537 (.bc 1 (.bc 132087 (.bc 1 (.bc 871791 (.bc 1 (.bc 4649565 (.bc 1 (.bc 20590941 (.bc 1 (.bc 77216037 (.bc 1 (.bc 248807237 (.bc 1 (.bc 696660269 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 18728399517 (.bc 1 (.b 7777834448 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 497136084286 (.l 248568042143 (.l 124284021071 (.l 62142010536 (.bc 17973714889 (.bc 1 (.b 13097290376 .nil))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 98046872442800 (.l 49023436221400 (.l 24511718110700 (.l 12255859055350 (.l 6127929527675 (.l 3063964763838 (.l 1531982381919 (.l 765991190960 (.l 382995595480 (.bc 18713447041 (.bc 1 (.bc 35345263797 (.bc 1 (.bc 35345263797 (.bc 1 (.bc 31810737417 (.bc 1 (.bc 25751549337 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 696660269 (.bc 1 (.bc 248807237 (.bc 1 (.bc 77216037 (.bc 1 (.bc 20590941 (.bc 1 (.bc 4649565 (.bc 1 (.bc 871791 (.bc 1 (.bc 132087 (.bc 1 (.bc 15537 (.bc 1 (.bc 1329 (.bc 1 (.bc 71 (.bc 1 (.bc 1 (.bc 1 (.bc 69 (.bc 1 (.bc 1257 (.bc 1 (.bc 14277 (.bc 1 (.bc 117807 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil))) .nil) .nil) .nil)))) .nil) .nil)))) .nil)))) .nil) .nil) .nil) +def cmd_337 : Cmd := (.l 143552014452785152 (.l 71776007226392576 (.l 35888003613196288 (.l 17944001806598144 (.l 8972000903299072 (.l 4486000451649536 (.l 2243000225824768 (.l 1121500112912384 (.l 560750056456192 (.l 280375028228096 (.l 140187514114048 (.l 70093757057024 (.l 35046878528512 (.l 17523439264256 (.l 8761719632128 (.l 4380859816064 (.l 2190429908032 (.l 1095214954016 (.l 547607477008 (.bc 753981 (.bc 1 (.bc 3895581 (.bc 1 (.bc 16695357 (.bc 1 (.bc 60520677 (.bc 1 (.bc 188286557 (.bc 1 (.bc 508373709 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 17194993197 (.bc 1 (.bc 18150270597 (.bc 1 (.bc 17194993197 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 508373709 (.bc 1 (.bc 188286557 (.bc 1 (.bc 60520677 (.bc 1 (.bc 16695357 (.bc 1 (.bc 3895581 (.bc 1 (.bc 753981 (.bc 1 (.bc 117807 (.bc 1 (.bc 14277 (.bc 1 (.bc 1257 (.bc 1 (.bc 69 (.bc 1 (.bc 1 (.bc 1 (.bc 67 (.bc 1 (.bc 1187 (.bc 1 (.bc 13087 (.bc 1 (.bc 104717 (.bc 1 (.bc 649261 (.bc 1 (.bc 3246317 (.bc 1 (.bc 13449037 (.bc 1 (.bc 47071637 (.bc 1 (.bc 141214917 (.bc 1 (.bc 367158789 (.bc 1 (.bc 834451797 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 834451797 (.bc 1 (.bc 367158789 (.bc 1 (.bc 141214917 (.bc 1 (.bc 47071637 (.bc 1 (.bc 13449037 (.bc 1 (.bc 3246317 (.bc 1 (.bc 649261 (.bc 1 (.bc 104717 (.bc 1 (.bc 13087 (.bc 1 (.bc 1187 (.bc 1 (.bc 67 (.bc 1 (.bc 1 (.bc 1 (.bc 65 (.bc 1 (.bc 1119 (.bc 1 (.bc 11965 (.bc 1 (.bc 92749 (.bc 1 (.bc 556509 (.bc 1 (.bc 2689805 (.bc 1 (.bc 10759229 (.bc 1 (.bc 36312405 (.bc 1 (.bc 104902509 (.bc 1 (.bc 262256277 (.bc 1 (.bc 572195517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 4667212437 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 572195517 (.bc 1 (.bc 262256277 (.bc 1 (.bc 104902509 (.bc 1 (.bc 36312405 (.bc 1 (.bc 10759229 (.bc 1 (.bc 2689805 (.bc 1 (.bc 556509 (.bc 1 (.bc 92749 (.bc 1 (.bc 11965 (.bc 1 (.bc 1119 (.bc 1 (.bc 65 (.bc 1 (.bc 1 (.bc 1 (.bc 63 (.bc 1 (.bc 1053 (.bc 1 (.bc 10909 (.bc 1 (.bc 81837 (.bc 1 (.bc 474669 (.bc 1 (.bc 2215133 (.bc 1 (.bc 8544093 (.bc 1 (.bc 27768309 (.bc 1 (.bc 77134197 (.bc 1 (.bc 185122077 (.bc 1 (.bc 387073437 (.bc 1 (.bc 709634637 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 709634637 (.bc 1 (.bc 387073437 (.bc 1 (.bc 185122077 (.bc 1 (.bc 77134197 (.bc 1 (.bc 27768309 (.bc 1 (.bc 8544093 (.bc 1 (.bc 2215133 (.bc 1 (.bc 474669 (.bc 1 (.bc 81837 (.bc 1 (.bc 10909 (.bc 1 (.bc 1053 (.bc 1 (.bc 63 (.bc 1 (.bc 1 (.bc 1 (.bc 61 (.bc 1 (.bc 989 (.bc 1 (.bc 9917 (.bc 1 (.bc 71917 (.bc 1 (.bc 402749 (.bc 1 (.bc 1812381 (.bc 1 (.bc 6731709 (.bc 1 (.bc 21036597 (.bc 1 (.bc 56097597 (.bc 1 (.bc 129024477 (.bc 1 (.bc 258048957 (.bc 1 (.bc 451585677 (.bc 1 (.bc 694747197 (.bc 1 (.bc 942871197 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 1202160777 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 942871197 (.bc 1 (.bc 694747197 (.bc 1 (.bc 451585677 (.bc 1 (.bc 258048957 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.bc 6731709 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 61 (.bc 1 (.bc 1 (.bc 1 (.bc 59 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 (.bc 1 (.bc 62927 (.bc 1 (.bc 339819 (.bc 1 (.bc 1472559 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.bc 88704327 (.bc 1 (.bc 169344627 (.bc 1 (.bc 282241047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 530365047 (.bc 1 (.bc 601080387 (.bc 1 (.bc 601080387 (.bc 1 (.bc 530365047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 282241047 (.bc 1 (.bc 169344627 (.bc 1 (.bc 88704327 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.bc 11705847 (.bc 1 (.bc 28614297 (.bc 1 (.bc 60090027 (.bc 1 (.bc 109254597 (.bc 1 (.bc 172986447 (.bc 1 (.bc 239519697 (.bc 1 (.bc 290845347 (.bc 1 (.bc 310235037 (.bc 1 (.bc 290845347 (.bc 1 (.bc 239519697 (.bc 1 (.bc 172986447 (.bc 1 (.bc 109254597 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.bc 69194577 (.bc 1 (.bc 103791867 (.bc 1 (.bc 135727827 (.bc 1 (.bc 155117517 (.bc 1 (.bc 155117517 (.bc 1 (.bc 135727827 (.bc 1 (.bc 103791867 (.bc 1 (.bc 69194577 (.bc 1 (.bc 40060017 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_338 : Cmd := (.l 562665862725632 (.l 281332931362816 (.l 140666465681408 (.l 70333232840704 (.l 35166616420352 (.l 17583308210176 (.l 8791654105088 (.l 4395827052544 (.l 2197913526272 (.l 1098956763136 (.l 549478381568 (.l 274739190784 (.l 137369595392 (.l 68684797696 (.l 34342398848 (.l 17171199424 (.l 8585599712 (.l 4292799856 (.l 396325635 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.bc 26246217 (.bc 1 (.bc 42948357 (.bc 1 (.bc 60843507 (.bc 1 (.b 44435089 .nil))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 1750074290 (.bc 30449226 (.bc 1 (.bc 80233197 (.bc 1 (.bc 74884317 (.bc 1 (.bc 60843507 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.bc 26075787 (.bc 1 (.bc 34767717 (.bc 1 (.bc 40116597 (.bc 1 (.bc 40116597 (.bc 1 (.bc 34767717 (.bc 1 (.bc 26075787 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_339 : Cmd := (.l 437805645823 (.l 218902822911 (.l 109451411455 (.l 54725705727 (.l 27362852863 (.l 13681426431 (.l 6840713215 (.l 3420356607 (.l 1710178303 (.l 855089151 (.l 427544575 (.l 213772287 (.l 106886143 (.l 53443071 (.l 26721535 (.l 13360767 (.l 6680383 (.l 3340191 (.l 1670095 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 12061106818283208704 (.l 4157040777109636683 (.l 644590335031882877 (.l 322295167515941438 (.l 161147583757970719 (.l 80573791878985359 (.l 40286895939492679 (.l 3948600485537297 (.l 1974300242768648 (.l 987150121384324 (.l 493575060692162 (.l 246787530346081 (.l 53602853358355 (.l 22768726952433 (.l 7485604911515 (.l 3742802455757 (.l 1871401227878 (.l 935700613939 (.l 467850306969 (.c (.c (.b 233925153482 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 3898758564698 .nil)))) (.c (.bc 1 (.b 4032699726741 .nil)))) (.c (.bc 1 (.b 69790911814682 .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 16194847484209039 (.l 8097423742104519 (.l 4048711871052259 (.l 2024355935526130 (.l 1012177967763065 (.l 89133372122435 (.l 44566686061217 (.l 22283343030608 (.l 11141671515304 (.bc 106011730596 (.bc 1 (.b 5464824027053 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.bc 171424978809317 (.bc 1 (.l 245530632949775 (.l 122765316474887 (.l 61382658237444 (.l 30691329118722 (.l 15345664559361 (.bc 1198500205621 (.bc 1 (.l 6474332074057 (.bc 947057838962 (.bc 1 (.b 2290108198063 .nil))) .nil))) .nil) .nil) .nil) .nil) .nil)))))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1433930053522935461 (.l 357447968936621429 (.l 178723984468310714 (.l 89361992234155357 (.l 44680996117077678 (.l 22340498058538839 (.l 11170249029269419 (.l 5585124514634709 (.l 2792562257317355 (.l 1396281128658677 (.bc 9842738170532 (.bc 1 (.l 411200762613517 (.l 205600381306758 (.l 102800190653379 (.l 51400095326690 (.bc 1331638002134 (.bc 1 (.l 24368409661208 (.l 12184204830604 (.bc 3562931177737 (.bc 1 (.b 2529171237562 .nil))) .nil) .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 277097063545283 (.l 138548531772641 (.l 69274265886320 (.l 34637132943160 (.l 17318566471580 (.l 5471577701282 (.bc 2347553116475 (.bc 1 (.b 388235734163 .nil))) (.c (.bc 1 (.b 3187705534505 .nil)))) .nil) .nil) .nil) .nil) .nil)))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 359517057824846298 (.bc 5465657042764979 (.bc 1 (.l 174292871869658167 (.l 28764495182208708 (.l 14382247591104354 (.l 7191123795552177 (.l 2869677135820290 (.l 1434838567910145 (.l 717419283955072 (.l 171102170407942 (.l 85551085203971 (.l 42775542601985 (.l 21387771300992 (.bc 918793320566 (.bc 1 (.l 9775092329927 (.bc 1147716813524 (.bc 1 (.l 3739829351436 (.l 1869914675718 (.bc 714304888393 (.bc 1 (.b 220652449463 .nil))) .nil) .nil))) .nil))) .nil) .nil) .nil) (.c (.bc 1 (.b 187607471569591 .nil)))) .nil) .nil) (.c (.bc 1 (.l 725884761955795 (.l 362942380977897 (.l 181471190488949 (.l 90735595244475 (.l 45367797622238 (.l 22683898811119 (.l 11341949405559 (.l 5670974702780 (.l 2835487351390 (.l 1417743675695 (.bc 519801386676 (.bc 1 (.b 189070451168 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 58381940752620372 (.l 29190970376310186 (.l 14595485188155093 (.l 7297742594077546 (.l 3648871297038773 (.l 1824435648519387 (.l 912217824259693 (.l 115019330880879 (.l 57509665440439 (.l 28754832720220 (.l 14377416360110 (.l 7188708180055 (.l 3594354090027 (.bc 1104182394769 (.bc 1 (.bc 689734851165 (.bc 1 (.b 3259799074 .nil))))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 341089581248964 (.l 31189811394183 (.l 15594905697091 (.l 7797452848546 (.l 3898726424273 (.l 1949363212137 (.bc 330482870843 (.bc 1 (.bc 146012418087 (.bc 1 (.bc 57520043487 (.bc 1 (.bc 20301191817 (.bc 1 (.bc 6380374569 (.bc 1 (.bc 1772326267 (.bc 1 (.bc 431106387 (.bc 1 (.bc 90759237 (.bc 1 (.bc 16290117 (.bc 1 (.bc 2443515 (.bc 1 (.bc 297987 (.bc 1 (.bc 28377 (.bc 1 (.bc 1977 (.bc 1 (.bc 87 (.bc 1 (.bc 1 (.bc 1 (.bc 85 (.bc 1 (.bc 1889 (.bc 1 (.bc 26485 (.bc 1 (.bc 271499 (.bc 1 (.bc 2172013 (.bc 1 (.bc 14118101 (.bc 1 (.bc 76641133 (.bc 1 (.bc 354465251 (.bc 1 (.bc 1417861013 (.bc 1 (.bc 4962513553 (.bc 1 (.bc 15338678261 (.bc 1 (.bc 42181365223 (.bc 1 (.bc 103831052861 (.bc 1 (.bc 229911617053 (.bc 1 (.b 13580668806 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 139354979230296 (.l 65630401454791 (.l 32815200727395 (.l 16407600363697 (.l 3103760226718 (.bc 446242565303 (.bc 1 (.bc 833429611825 (.bc 1 (.b 272207936225 .nil))))) (.c (.bc 1 (.l 5100039955128 (.bc 1100499659722 (.bc 1 (.b 1449520317839 .nil))) .nil)))) .nil) .nil) (.c (.bc 1 (.b 4047088160354 .nil)))) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil))) .nil)))) .nil)))) (.c (.bc 1 (.l 1873512632031967666 (.l 936756316015983833 (.l 468378158007991917 (.l 234189079003995959 (.l 117094539501997980 (.l 26793525636191963 (.l 13396762818095981 (.l 6698381409047991 (.l 3349190704523995 (.l 1674595352261997 (.l 837297676130999 (.l 418648838065500 (.l 209324419032750 (.l 104662209516375 (.l 50469744106109 (.l 13826457365801 (.l 6913228682900 (.bc 356598066064 (.bc 1 (.bc 2817662960109 (.bc 1 (.b 282353315271 .nil))))) .nil) (.c (.bc 1 (.l 11408414687250 (.bc 1427244883502 (.bc 1 (.b 4276962460120 .nil))) .nil)))) (.c (.bc 1 (.b 1861360652075 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 31753744114807024 (.l 15876872057403512 (.l 7938436028701756 (.l 1469291065705863 (.l 734645532852931 (.l 367322766426466 (.l 165999061599233 (.l 82999530799616 (.l 41499765399808 (.l 20749882699904 (.l 10374941349952 (.l 4394993628238 (.bc 154951631543 (.bc 1 (.b 2042545182573 .nil))) (.c (.bc 1 (.b 792477046735 .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 17662321613997 .nil)))) .nil) .nil) (.c (.bc 1 (.l 2499926948645012 (.l 383289593289411 (.l 191644796644705 (.l 95822398322353 (.l 47911199161177 (.l 23955599580588 (.l 11977799790294 (.l 5988899895147 (.l 2994449947573 (.bc 1310475318996 (.bc 1 (.b 186749654788 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 866673881033092 (.bc 17112625185677 (.bc 1 (.l 416224315330866 (.l 208112157665433 (.l 104056078832717 (.l 52028039416359 (.l 26014019708180 (.l 13007009854090 (.bc 876118437552 (.bc 1 (.bc 3006465218193 (.bc 1 (.bc 1503232609095 (.bc 1 (.bc 683287549587 (.bc 1 (.bc 281353696887 (.bc 1 (.bc 104502801699 (.bc 1 (.bc 34834267231 (.bc 1 (.bc 10356133499 (.bc 1 (.bc 2725298287 (.bc 1 (.bc 628914987 .nil))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil))) .nil)))) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil))) +def cmd_340 : Cmd := (.l 119312073468255053 (.l 59656036734127526 (.l 29828018367063763 (.l 14914009183531881 (.l 7457004591765940 (.l 3728502295882970 (.l 1864251147941485 (.l 932125573970742 (.l 466062786985371 (.l 233031393492685 (.l 116515696746342 (.l 58257848373171 (.l 29128924186585 (.l 14564462093292 (.l 7282231046646 (.l 3641115523323 (.l 1820557761661 (.bc 1 (.bc 125782995 (.bc 1 (.bc 21475143 (.bc 1 (.bc 3067875 (.bc 1 (.bc 356727 (.bc 1 (.bc 32427 (.bc 1 (.bc 2159 (.bc 1 (.bc 91 (.bc 1 (.bc 1 (.bc 1 (.bc 89 (.bc 1 (.bc 2067 (.bc 1 (.bc 30357 (.bc 1 (.bc 326367 (.bc 1 (.bc 2741505 (.bc 1 (.bc 18733635 (.bc 1 (.bc 107049357 (.bc 1 (.bc 521865627 (.bc 1 (.bc 2203432657 (.bc 1 (.bc 8152700839 (.bc 1 (.bc 26681566389 (.bc 1 (.bc 77821235307 (.bc 1 (.bc 203532461577 (.bc 1 (.bc 479755088007 (.bc 1 (.b 111330929564 .nil)))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1933168668766095192 (.l 966584334383047596 (.l 411790051534253277 (.l 205895025767126638 (.l 102947512883563319 (.l 51473756441781660 (.l 25736878220890830 (.l 12868439110445415 (.l 6434219555222707 (.l 3217109777611354 (.l 1608554888805677 (.l 804277444402838 (.l 402138722201419 (.l 201069361100710 (.l 100534680550355 (.l 26736916838388 (.l 13368458419194 (.l 912146591521 (.bc 180863984448 (.bc 1 (.b 275209311309 .nil))) (.c (.bc 1 (.bc 1982987697105 (.bc 1 (.bc 3499390053717 (.bc 1 (.b 289704867245 .nil)))))))) .nil) (.c (.bc 1 (.l 23530423436786 (.bc 3377772140286 (.bc 1 (.l 8387439578104 (.l 3659315260266 (.bc 19539144737 (.bc 1 (.b 1810118485393 .nil))) (.c (.bc 1 (.b 534404528783 .nil)))) .nil))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 71502115657270518 .nil)))) .nil) .nil)))) +def cmd_344 : Cmd := (.l 21642835218623969963 (.l 10821417609311984982 (.l 3323949231325033604 (.l 1661974615662516802 (.l 131607676485923524 (.l 65803838242961762 (.l 32901919121480881 (.l 16450959560740441 (.l 8225479780370220 (.l 4112739890185110 (.l 2056369945092555 (.l 1028184972546278 (.l 271539042186855 (.l 135769521093427 (.l 67884760546713 (.l 33942380273357 (.l 16971190136679 (.l 8485595068339 (.l 4242797534170 (.bc 353722250014 (.bc 1 (.b 1767676517068 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 242553444086281 (.l 121276722043140 (.l 39916882085852 (.l 19958441042926 (.l 9979220521463 (.l 4989610260732 (.bc 1349219880291 (.bc 1 (.l 1145585250072 (.bc 375376502894 (.bc 1 (.b 197416122139 .nil))) .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 20721478935715 (.l 10360739467857 (.bc 1602767068778 (.bc 1 (.b 3577602665147 .nil))) .nil) .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 699379631345334874 (.l 62301613050745581 (.l 31150806525372790 (.l 15575403262686395 (.l 4499769998256884 (.l 2249884999128442 (.l 1124942499564221 (.l 562471249782110 (.l 281235624891055 (.l 140617812445528 (.l 70308906222764 (.l 35154453111382 (.l 17577226555691 (.l 8788613277846 (.l 4394306638923 (.bc 1214099055045 (.bc 1 (.b 983054264413 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 3287931633086311 (.l 1643965816543155 (.l 821982908271577 (.l 410991454135788 (.l 205495727067894 (.l 18088767902598 (.l 9044383951299 (.bc 1746974678610 (.bc 1 (.b 2775217297037 .nil))) .nil) (.c (.bc 1 (.l 84659095631346 (.l 42329547815673 (.l 21164773907836 (.l 10582386953918 (.l 5291193476959 (.l 2645596738480 (.bc 107016333058 (.bc 1 (.bc 833429611825 (.bc 1 (.b 382352424351 .nil))))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 287388202621921853 (.l 98194460131236216 (.l 49097230065618108 (.l 24548615032809054 (.l 12274307516404527 (.l 6137153758202264 (.l 3068576879101132 (.l 298098903024217 (.l 149049451512108 (.l 74524725756054 (.l 37262362878027 (.l 2108745605063 (.l 1054372802531 (.l 527186401265 (.bc 77470809758 (.bc 1 (.b 186122390872 .nil))) .nil) .nil) (.c (.bc 1 (.l 16522435833947 (.l 8261217916973 (.l 643424555110 (.bc 43789226181 (.bc 1 (.bc 103831052861 (.bc 1 (.bc 42181365223 (.bc 1 (.bc 15338678261 (.bc 1 (.bc 4962513553 (.bc 1 (.bc 1417861013 (.bc 1 (.bc 354465251 (.bc 1 (.bc 76641133 (.bc 1 (.bc 14118101 (.bc 1 (.bc 2172013 (.bc 1 (.bc 271499 (.bc 1 (.bc 26485 (.bc 1 (.bc 1889 (.bc 1 (.bc 85 (.bc 1 (.bc 1 (.bc 1 (.bc 83 (.bc 1 (.bc 1803 (.bc 1 (.bc 24679 (.bc 1 (.bc 246817 (.bc 1 (.bc 1925193 (.bc 1 (.bc 12192905 (.bc 1 (.bc 64448225 (.bc 1 (.bc 290017023 (.bc 1 (.bc 1127843987 (.bc 1 (.bc 3834669563 (.bc 1 (.bc 11504008695 (.bc 1 (.bc 30677356525 (.bc 1 (.b 62231148427 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 3487184403374 (.bc 10922547904 (.bc 1 (.bc 156757920717 (.bc 1 (.bc 303065313389 (.bc 1 (.bc 530364298433 (.bc 1 (.b 742482121232 .nil))))))))) .nil)))) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 603342456658029 (.l 301671228329014 (.l 150835614164507 (.l 75417807082253 (.l 3172322950701 (.l 1586161475350 (.l 793080737675 (.bc 99861176281 (.bc 1 (.b 296679192553 .nil))) .nil) .nil) (.c (.bc 1 (.l 9847379427995 (.l 4923689713997 (.l 2461844856999 (.bc 920038903855 (.bc 1 (.b 310883524641 .nil))) .nil) .nil) (.c (.bc 1 (.bc 4501659573989 (.bc 1 (.bc 1875695126365 (.bc 1 (.bc 709749004829 (.bc 1 (.bc 242971103365 (.bc 1 (.bc 75609433729 (.bc 1 (.bc 24653467605 (.bc 1 (.bc 21446512469 (.bc 1 (.bc 59345589825 (.bc 1 (.bc 184727238469 (.bc 1 (.bc 525225348925 (.bc 1 (.l 1350501982589 (.bc 531896933335 (.bc 1 (.b 143354057956 .nil))) (.c (.bc 1 (.l 3151161865765 (.l 1575580932882 (.l 787790466441 (.bc 93613291281 (.bc 1 (.b 300281941936 .nil))) .nil) .nil) (.c (.bc 1 (.bc 6696218025179 (.bc 1 (.b 5270236889282 .nil))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 382466139868719 (.l 191233069934359 (.l 95616534967179 (.l 47808267483589 (.l 7728303909482 (.l 3864151954741 (.l 972642871893 (.bc 125045030192 (.bc 1 (.b 361276405751 .nil))) (.c (.bc 1 (.b 959433105474 .nil)))) .nil) (.c (.bc 1 (.l 16175829832309 (.l 8087914916154 (.l 4043957458077 (.bc 1263106005227 (.bc 1 (.b 758872723809 .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 250380939999592 (.l 125190469999796 (.l 62595234999898 (.l 31297617499949 (.bc 6932687139019 (.bc 1 (.l 8716121610952 (.l 4358060805476 (.l 2179030402738 (.bc 478640347530 (.bc 1 (.b 610874853836 .nil))) .nil) .nil) .nil))) .nil) .nil) .nil) .nil)))))))))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 45499641179724707 (.l 22749820589862353 (.l 11374910294931177 (.l 5687455147465588 (.l 2843727573732794 (.l 770035723177640 (.bc 79968322746845 (.bc 1 (.l 305049538841972 (.l 152524769420986 (.l 76262384710493 (.l 38131192355246 (.l 19065596177623 (.l 9532798088811 (.l 4766399044405 (.bc 685506461141 (.bc 1 (.bc 1600944863697 (.bc 1 (.b 96748197358 .nil))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil))) (.c (.bc 1 (.l 651828063688754 (.l 121748811087653 (.l 60874405543826 (.l 30437202771913 (.l 15218601385956 (.l 4923631834913 (.l 2461815917456 (.bc 849245389525 (.bc 1 (.b 381662569200 .nil))) .nil) (.c (.bc 1 (.b 2685668858062 .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 204165220756721 (.l 102082610378360 (.l 51041305189180 (.l 25520652594590 (.l 12760326297295 (.l 6380163148647 (.l 3190081574324 (.bc 168807312428 (.bc 1 (.bc 842343297513 (.bc 1 (.bc 530364298433 (.bc 1 (.b 53525878779 .nil))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil)))) .nil)))) .nil) (.c (.bc 1 (.l 2086759573330958884 (.l 774725660994665363 (.l 387362830497332681 (.l 193681415248666341 (.l 96840707624333171 (.l 48420353812166586 (.l 24210176906083293 (.l 1563625102873058 (.l 781812551436529 (.l 390906275718265 (.l 195453137859132 (.l 97726568929566 (.l 48863284464783 (.l 24431642232391 (.l 12215821116196 (.l 6107910558098 (.l 3053955279049 (.bc 249539434610 (.bc 1 (.bc 156757920717 (.bc 1 (.bc 73153696333 (.bc 1 (.bc 30677356525 (.bc 1 (.bc 11504008695 (.bc 1 (.bc 3834669563 (.bc 1 (.bc 1127843987 (.bc 1 (.bc 290017023 (.bc 1 (.bc 64448225 (.bc 1 (.bc 12192905 (.bc 1 (.bc 1925193 (.bc 1 (.bc 246817 (.bc 1 (.bc 24679 (.bc 1 (.bc 1803 (.bc 1 (.bc 83 (.bc 1 (.bc 1 (.bc 1 (.bc 81 (.bc 1 (.bc 1719 (.bc 1 (.bc 22957 (.bc 1 (.bc 223857 (.bc 1 (.bc 1701333 (.bc 1 (.bc 10491569 (.bc 1 (.bc 53956653 (.bc 1 (.bc 236060367 (.bc 1 (.bc 891783617 (.bc 1 (.bc 2942885943 (.bc 1 (.bc 8561122749 (.bc 1 (.bc 22116233773 (.bc 1 (.bc 51037462557 (.bc 1 (.bc 105720458157 (.bc 1 (.bc 197344855229 (.bc 1 (.bc 333019443201 (.bc 1 (.b 278077148507 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 10541463350168586 (.l 4173719262503117 (.l 2086859631251558 (.l 266955775117973 (.l 133477887558986 (.l 66738943779493 (.l 33369471889747 (.l 16684735944873 (.l 6112233149705 (.l 3056116574852 (.bc 231246705802 (.bc 1 (.bc 707394242097 (.bc 1 (.b 589417339521 .nil))))) .nil) (.c (.bc 1 (.l 2230134822729 (.l 1115067411364 (.bc 304133282075 (.bc 1 (.b 253400423604 .nil))) .nil) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 776474040507803 (.l 120084766793954 (.l 60042383396977 (.l 30021191698489 (.l 12208502476323 (.l 6104251238161 (.l 3052125619081 (.bc 774182791233 (.bc 1 (.b 751880018305 .nil))) .nil) .nil) (.c (.bc 1 (.l 2802093372919 (.l 1401046686459 (.l 700523343229 (.bc 324635730572 (.bc 1 (.b 25625941040 .nil))) .nil) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 268152253459944 (.l 112483362369715 (.bc 1171299153374 (.bc 1 (.l 55070382031480 (.l 27535191015740 (.l 13767595507870 (.bc 1099499475406 (.bc 1 (.l 5784298278526 (.bc 379001339006 (.bc 1 (.bc 893550621597 (.bc 1 (.bc 707394242097 (.bc 1 (.bc 509323854309 (.bc 1 (.bc 333019443201 (.bc 1 (.b 69859639038 .nil))))))))))) .nil))) .nil) .nil) .nil))) (.c (.bc 1 (.l 21592764360254 (.l 10796382180127 (.l 5398191090063 (.l 2699095545032 (.l 1349547772516 (.bc 127485216191 (.bc 1 (.bc 105720458157 (.bc 1 (.bc 51037462557 (.bc 1 (.bc 22116233773 (.bc 1 (.bc 8561122749 (.bc 1 (.bc 2942885943 (.bc 1 (.bc 891783617 (.bc 1 (.bc 236060367 (.bc 1 (.bc 53956653 (.bc 1 (.bc 10491569 (.bc 1 (.bc 1701333 (.bc 1 (.bc 223857 (.bc 1 (.bc 22957 (.bc 1 (.bc 1719 (.bc 1 (.bc 81 (.bc 1 (.bc 1 (.bc 1 (.bc 79 (.bc 1 (.bc 1637 (.bc 1 (.bc 21317 (.bc 1 (.bc 202537 (.bc 1 (.bc 1498793 (.bc 1 (.bc 8992773 (.bc 1 (.bc 44963877 (.bc 1 (.bc 191096487 (.bc 1 (.bc 700687127 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 6318923933 (.bc 1 (.bc 15797309837 (.bc 1 (.bc 35240152717 (.bc 1 (.bc 70480305437 (.bc 1 (.bc 126864549789 (.bc 1 (.b 97825359488 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil)))) .nil)))) .nil)))) .nil) (.c (.bc 1 (.l 1097012412581173 (.l 548506206290586 (.l 272915957966185 (.l 136457978983092 (.l 68228989491546 (.l 34114494745773 (.l 17057247372887 (.l 8528623686443 (.l 4264311843221 (.bc 108329533921 (.bc 1 (.bc 303168960897 (.bc 1 (.bc 404225281197 (.bc 1 (.bc 489325340397 (.bc 1 (.bc 538257874437 (.bc 1 (.b 288848930746 .nil))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 1337145179105 .nil)))) .nil) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 268654125670814076 (.l 134327062835407038 (.l 67163531417703519 (.l 33581765708851760 (.l 15406235315696789 (.l 7703117657848394 (.l 3851558828924197 (.l 1925779414462098 (.l 962889707231049 (.l 481444853615524 (.l 240722426807762 (.l 120361213403881 (.l 60180606701941 (.l 24637893430852 (.l 12318946715426 (.l 4361691440210 (.bc 238962496979 (.bc 1 (.bc 489325340397 (.bc 1 (.bc 404225281197 (.bc 1 (.bc 303168960897 (.bc 1 (.bc 206154893409 (.bc 1 (.bc 126864549789 (.bc 1 (.bc 70480305437 (.bc 1 (.bc 35240152717 (.bc 1 (.bc 15797309837 (.bc 1 (.bc 6318923933 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 700687127 (.bc 1 (.bc 191096487 (.bc 1 (.bc 44963877 (.bc 1 (.bc 8992773 (.bc 1 (.bc 1498793 (.bc 1 (.bc 202537 (.bc 1 (.bc 21317 (.bc 1 (.bc 1637 (.bc 1 (.bc 79 (.bc 1 (.bc 1 (.bc 1 (.bc 77 (.bc 1 (.bc 1557 (.bc 1 (.bc 19757 (.bc 1 (.bc 182777 (.bc 1 (.bc 1316013 (.bc 1 (.bc 7676757 (.bc 1 (.bc 37287117 (.bc 1 (.bc 153809367 (.bc 1 (.bc 546877757 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 24066445757 (.bc 1 (.bc 46413859677 (.bc 1 (.bc 80450690109 (.bc 1 (.b 111947044355 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 1797781917500 (.bc 13757158940 (.bc 1 (.bc 177464757597 (.bc 1 (.bc 226760523597 (.bc 1 (.bc 262564816797 (.bc 1 (.b 218343701807 .nil))))))))) .nil)))) .nil) (.c (.bc 1 (.l 5452409920115 (.l 2726204960057 (.l 1363102480028 (.bc 57349355830 (.bc 1 (.bc 262564816797 (.bc 1 (.bc 226760523597 (.bc 1 (.b 134876543781 .nil))))))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1384647538729088 (.l 692323769364544 (.l 346161884682272 (.l 173080942341136 (.l 86540471170568 (.l 43270235585284 (.l 21635117792642 (.l 10817558896321 (.l 5408779448161 (.l 2704389724081 (.l 1352194862041 (.l 676097431021 (.bc 42588213816 (.bc 1 (.bc 125704203297 (.bc 1 (.bc 80450690109 (.bc 1 (.bc 46413859677 (.bc 1 (.bc 24066445757 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 546877757 (.bc 1 (.bc 153809367 (.bc 1 (.bc 37287117 (.bc 1 (.bc 7676757 (.bc 1 (.bc 1316013 (.bc 1 (.bc 182777 (.bc 1 (.bc 19757 (.bc 1 (.bc 1557 (.bc 1 (.bc 77 (.bc 1 (.bc 1 (.bc 1 (.bc 75 (.bc 1 (.bc 1479 (.bc 1 (.bc 18275 (.bc 1 (.bc 164499 (.bc 1 (.bc 1151511 (.bc 1 (.bc 6525243 (.bc 1 (.bc 30761871 (.bc 1 (.bc 123047493 (.bc 1 (.bc 423830261 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil)))) .nil)))) .nil) .nil) +def cmd_345 : Cmd := (.l 1143607588962697216 (.l 571803794481348608 (.l 285901897240674304 (.l 142950948620337152 (.l 51419334457821383 (.l 25709667228910691 (.l 12854833614455345 (.l 6427416807227672 (.l 3213708403613836 (.l 1606854201806918 (.l 803427100903459 (.l 401713550451729 (.l 200856775225864 (.l 100428387612932 (.l 50214193806466 (.l 25107096903233 (.l 12553548451616 (.l 3308609963879 (.l 1654304981939 (.bc 1271490789 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 16244850885 (.bc 1 (.bc 30169008789 (.bc 1 (.bc 50281681317 (.bc 1 (.bc 75422521977 (.bc 1 (.bc 102042235617 (.bc 1 (.bc 124718287977 (.bc 1 (.bc 137846528817 (.bc 1 (.bc 137846528817 (.bc 1 (.bc 124718287977 (.bc 1 (.b 15417361017 .nil))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 2968164261926 (.l 1484082130963 (.bc 86624874599 (.bc 1 (.bc 75422521977 (.bc 1 (.bc 50281681317 (.bc 1 (.bc 30169008789 (.bc 1 (.bc 16244850885 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 423830261 (.bc 1 (.bc 123047493 (.bc 1 (.bc 30761871 (.bc 1 (.bc 6525243 (.bc 1 (.bc 1151511 (.bc 1 (.bc 164499 (.bc 1 (.bc 18275 (.bc 1 (.bc 1479 (.bc 1 (.bc 75 (.bc 1 (.bc 1 (.bc 1 (.bc 73 (.bc 1 (.bc 1403 (.bc 1 (.bc 16869 (.bc 1 (.bc 147627 (.bc 1 (.bc 1003881 (.bc 1 (.bc 5521359 (.bc 1 (.bc 25240509 (.bc 1 (.bc 97806981 (.bc 1 (.bc 326023277 (.bc 1 (.bc 945467509 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 30942573117 (.bc 1 (.bc 44479948857 (.bc 1 (.bc 57562286757 (.bc 1 (.bc 67156001217 (.bc 1 (.bc 70690527597 (.bc 1 (.bc 67156001217 (.bc 1 (.bc 57562286757 (.bc 1 (.b 35325970688 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 20056139852347190 (.l 10028069926173595 (.l 5014034963086798 (.l 2507017481543399 (.l 1253508740771700 (.l 626754370385850 (.l 313377185192925 (.l 156688592596463 (.l 78344296298232 (.l 39172148149116 (.l 19586074074558 (.l 9793037037279 (.l 4896518518640 (.l 2448259259320 (.l 1224129629660 (.bc 9153978169 (.bc 1 (.bc 30942573117 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 945467509 (.bc 1 (.bc 326023277 (.bc 1 (.bc 97806981 (.bc 1 (.bc 25240509 (.bc 1 (.bc 5521359 (.bc 1 (.bc 1003881 (.bc 1 (.bc 147627 (.bc 1 (.bc 16869 (.bc 1 (.bc 1403 (.bc 1 (.bc 73 (.bc 1 (.bc 1 (.bc 1 (.bc 71 (.bc 1 (.bc 1329 (.bc 1 (.bc 15537 (.bc 1 (.bc 132087 (.bc 1 (.bc 871791 (.bc 1 (.bc 4649565 (.bc 1 (.bc 20590941 (.bc 1 (.bc 77216037 (.bc 1 (.bc 248807237 (.bc 1 (.bc 696660269 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 25751549337 (.bc 1 (.bc 31810737417 (.bc 1 (.bc 35345263797 (.bc 1 (.bc 35345263797 (.bc 1 (.bc 31810737417 (.bc 1 (.bc 25751549337 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 696660269 (.bc 1 (.bc 248807237 (.bc 1 (.bc 77216037 (.bc 1 (.bc 20590941 (.bc 1 (.bc 4649565 (.bc 1 (.bc 871791 (.bc 1 (.bc 132087 (.bc 1 (.bc 15537 (.bc 1 (.bc 1329 (.bc 1 (.bc 71 (.bc 1 (.bc 1 (.bc 1 (.bc 69 (.bc 1 (.bc 1257 (.bc 1 (.bc 14277 (.bc 1 (.bc 117807 (.bc 1 (.bc 753981 (.bc 1 (.bc 3895581 (.bc 1 (.bc 16695357 (.bc 1 (.bc 60520677 (.bc 1 (.bc 188286557 (.bc 1 (.bc 508373709 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 17194993197 (.bc 1 (.bc 18150270597 (.bc 1 (.bc 17194993197 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 508373709 (.bc 1 (.bc 188286557 (.bc 1 (.bc 60520677 (.bc 1 (.bc 16695357 (.bc 1 (.bc 3895581 (.bc 1 (.bc 753981 (.bc 1 (.bc 117807 (.bc 1 (.bc 14277 (.bc 1 (.bc 1257 (.bc 1 (.bc 69 (.bc 1 (.bc 1 (.bc 1 (.bc 67 (.bc 1 (.bc 1187 (.bc 1 (.bc 13087 (.bc 1 (.bc 104717 (.bc 1 (.bc 649261 (.bc 1 (.bc 3246317 (.bc 1 (.bc 13449037 (.bc 1 (.bc 47071637 (.bc 1 (.bc 141214917 (.bc 1 (.bc 367158789 (.bc 1 (.bc 834451797 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 834451797 (.bc 1 (.bc 367158789 (.bc 1 (.bc 141214917 (.bc 1 (.bc 47071637 (.bc 1 (.bc 13449037 (.bc 1 (.bc 3246317 (.bc 1 (.bc 649261 (.bc 1 (.bc 104717 (.bc 1 (.bc 13087 (.bc 1 (.bc 1187 (.bc 1 (.bc 67 (.bc 1 (.bc 1 (.bc 1 (.bc 65 (.bc 1 (.bc 1119 (.bc 1 (.bc 11965 (.bc 1 (.bc 92749 (.bc 1 (.bc 556509 (.bc 1 (.bc 2689805 (.bc 1 (.bc 10759229 (.bc 1 (.bc 36312405 (.bc 1 (.bc 104902509 (.bc 1 (.bc 262256277 (.bc 1 (.bc 572195517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 4667212437 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 572195517 (.bc 1 (.bc 262256277 (.bc 1 (.bc 104902509 (.bc 1 (.bc 36312405 (.bc 1 (.bc 10759229 (.bc 1 (.bc 2689805 (.bc 1 (.bc 556509 (.bc 1 (.bc 92749 (.bc 1 (.bc 11965 (.bc 1 (.bc 1119 (.bc 1 (.bc 65 (.bc 1 (.bc 1 (.bc 1 (.bc 63 (.bc 1 (.bc 1053 (.bc 1 (.bc 10909 (.bc 1 (.bc 81837 (.bc 1 (.bc 474669 (.bc 1 (.bc 2215133 (.bc 1 (.bc 8544093 (.bc 1 (.bc 27768309 (.bc 1 (.bc 77134197 (.bc 1 (.bc 185122077 (.bc 1 (.bc 387073437 (.bc 1 (.bc 709634637 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 709634637 (.bc 1 (.bc 387073437 (.bc 1 (.bc 185122077 (.bc 1 (.bc 77134197 (.bc 1 (.bc 27768309 (.bc 1 (.bc 8544093 (.bc 1 (.bc 2215133 (.bc 1 (.bc 474669 (.bc 1 (.bc 81837 (.bc 1 (.bc 10909 (.bc 1 (.bc 1053 (.bc 1 (.bc 63 (.bc 1 (.bc 1 (.bc 1 (.bc 61 (.bc 1 (.bc 989 (.bc 1 (.bc 9917 (.bc 1 (.bc 71917 (.bc 1 (.bc 402749 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) +def cmd_346 : Cmd := (.l 8989354595713024 (.l 4494677297856512 (.l 2247338648928256 (.l 1123669324464128 (.l 561834662232064 (.l 280917331116032 (.l 140458665558016 (.l 70229332779008 (.l 35114666389504 (.l 17557333194752 (.l 8778666597376 (.l 4389333298688 (.l 2194666649344 (.l 1097333324672 (.l 548666662336 (.l 274333331168 (.l 137166665584 (.l 68583332792 (.l 34291666396 (.bc 1812381 (.bc 1 (.bc 6731709 (.bc 1 (.bc 21036597 (.bc 1 (.bc 56097597 (.bc 1 (.bc 129024477 (.bc 1 (.bc 258048957 (.bc 1 (.bc 451585677 (.bc 1 (.bc 694747197 (.bc 1 (.bc 942871197 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 1202160777 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 942871197 (.bc 1 (.bc 694747197 (.bc 1 (.bc 451585677 (.bc 1 (.bc 258048957 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.bc 6731709 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 61 (.bc 1 (.bc 1 (.bc 1 (.bc 59 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 (.bc 1 (.bc 62927 (.bc 1 (.bc 339819 (.bc 1 (.bc 1472559 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.bc 88704327 (.bc 1 (.bc 169344627 (.bc 1 (.bc 282241047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 530365047 (.bc 1 (.bc 601080387 (.bc 1 (.bc 601080387 (.bc 1 (.bc 530365047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 282241047 (.bc 1 (.bc 169344627 (.bc 1 (.bc 88704327 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.bc 11705847 (.bc 1 (.bc 28614297 (.bc 1 (.bc 60090027 (.bc 1 (.bc 109254597 (.bc 1 (.bc 172986447 (.bc 1 (.bc 239519697 (.bc 1 (.bc 290845347 (.bc 1 (.bc 310235037 (.bc 1 (.bc 290845347 (.bc 1 (.bc 239519697 (.bc 1 (.bc 172986447 (.bc 1 (.bc 109254597 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.bc 69194577 (.bc 1 (.bc 103791867 (.bc 1 (.bc 135727827 (.bc 1 (.bc 155117517 (.bc 1 (.bc 155117517 (.bc 1 (.bc 135727827 (.bc 1 (.bc 103791867 (.bc 1 (.bc 69194577 (.bc 1 (.bc 40060017 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.bc 26246217 (.bc 1 (.bc 42948357 (.bc 1 (.bc 60843507 (.bc 1 (.bc 74884317 (.bc 1 (.bc 80233197 (.bc 1 (.bc 74884317 (.bc 1 (.bc 60843507 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.bc 26075787 (.bc 1 (.bc 34767717 (.bc 1 (.bc 40116597 (.bc 1 (.bc 40116597 (.bc 1 (.bc 34767717 (.bc 1 (.bc 26075787 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_347 : Cmd := (.l 17589895954432 (.l 8794947977216 (.l 4397473988608 (.l 2198736994304 (.l 1099368497152 (.l 549684248576 (.l 274842124288 (.l 137421062144 (.l 68710531072 (.l 34355265536 (.l 17177632768 (.l 8588816384 (.l 4294408192 (.l 2147204096 (.l 1073602048 (.l 536801024 (.l 268400512 (.l 134200256 (.l 67100128 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_348 : Cmd := (.l 140509183 (.l 70254591 (.l 35127295 (.l 17563647 (.l 8781823 (.l 4390911 (.l 2195455 (.l 1097727 (.l 548863 (.l 274431 (.l 137215 (.l 68607 (.l 34303 (.l 17151 (.l 8575 (.l 4287 (.l 2143 (.l 1071 (.l 535 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 8285179271601671065 (.l 563119976830634077 (.l 281559988415317038 (.l 140779994207658519 (.l 70389997103829259 (.l 35194998551914629 (.l 17597499275957314 (.l 8798749637978657 (.l 4399374818989328 (.l 2199687409494664 (.l 1099843704747332 (.l 549921852373666 (.l 274960926186833 (.l 137480463093416 (.l 68740231546708 (.l 34370115773354 (.l 17185057886677 (.l 8592528943338 (.l 4296264471669 (.c (.c (.b 2148132235832 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 3579469658970201452 (.l 1789734829485100726 (.l 894867414742550363 (.l 447433707371275181 (.l 135029526389718537 (.l 67514763194859268 (.l 33757381597429634 (.l 16878690798714817 (.l 8439345399357408 (.l 4219672699678704 (.l 497328027497851 (.l 248664013748925 (.l 124332006874463 (.l 62166003437231 (.l 31083001718615 (.l 15541500859307 (.l 7770750429654 (.bc 1356931350706 (.bc 1 (.b 2528443864118 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1612508322341498 (.bc 232849509842559 (.bc 1 (.l 573404651328187 (.l 286702325664093 (.l 143351162832047 (.bc 16682424144843 (.bc 1 (.l 54993157271177 (.l 18034626230089 (.l 9017313115044 (.bc 2964445540775 (.bc 1 (.b 1544211016744 .nil))) .nil) (.c (.bc 1 (.l 9461952405496 (.bc 2315591770857 (.bc 1 (.b 2415384431888 .nil))) .nil)))) .nil))) .nil) .nil) .nil))) .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 88687327295919050 (.l 44343663647959525 (.l 22171831823979763 (.l 11085915911989881 (.l 5542957955994940 (.l 2771478977997470 (.l 1385739488998735 (.l 692869744499367 (.l 334607043194403 (.l 167303521597201 (.l 83651760798601 (.l 41825880399301 (.l 20912940199650 (.bc 4398794225798 (.bc 1 (.bc 5637906197657 (.bc 1 (.b 419769676364 .nil))))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 11827829055278 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 3579469658970201452 (.l 1789734829485100726 (.l 874298807124593910 (.l 437149403562296955 (.l 218574701781148478 (.l 109287350890574239 (.l 54643675445287119 (.l 27321837722643559 (.l 9880446202405086 (.l 4940223101202543 (.l 2470111550601272 (.l 1235055775300636 (.l 617527887650318 (.l 308763943825159 (.l 154381971912579 (.l 77190985956290 (.l 38595492978145 (.l 9403794952296 (.bc 2710000719376 (.bc 1 (.bc 1982987697105 (.bc 1 (.b 8909059661 .nil))))) (.c (.bc 1 (.l 9893951536774 (.bc 1014568461422 (.bc 1 (.bc 479755088007 (.bc 1 (.bc 203532461577 (.bc 1 (.bc 77821235307 (.bc 1 (.bc 26681566389 (.bc 1 (.bc 8152700839 (.bc 1 (.bc 2203432657 (.bc 1 (.bc 521865627 (.bc 1 (.bc 107049357 (.bc 1 (.bc 18733635 (.bc 1 (.bc 2741505 (.bc 1 (.bc 326367 (.bc 1 (.bc 30357 (.bc 1 (.bc 2067 (.bc 1 (.bc 89 (.bc 1 (.bc 1 (.bc 1 (.bc 87 (.bc 1 (.bc 1977 (.bc 1 (.bc 28377 (.bc 1 (.bc 297987 (.bc 1 (.bc 2443515 (.bc 1 (.bc 16290117 (.bc 1 (.bc 90759237 (.bc 1 (.bc 431106387 (.bc 1 (.bc 1772326267 (.bc 1 (.bc 6380374569 (.bc 1 (.bc 20301191817 (.bc 1 (.bc 57520043487 (.bc 1 (.bc 146012418087 (.bc 1 (.bc 333742669917 (.bc 1 (.bc 689734851165 (.bc 1 (.bc 1293252845937 (.bc 1 (.b 584352424158 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 3780472658916691 (.l 1890236329458345 (.l 945118164729172 (.l 60586388757580 (.l 30293194378790 (.l 15146597189395 (.bc 3348401752049 (.bc 1 (.b 4224896842646 .nil))) .nil) .nil) (.c (.bc 1 (.l 411972693607003 (.l 205986346803501 (.l 102993173401750 (.l 51496586700875 (.bc 6333806028932 (.bc 1 (.l 19414487321502 (.l 9707243660751 (.l 4853621830375 (.bc 356727867834 (.bc 1 (.b 2070083047351 .nil))) .nil) .nil) .nil))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 20568607617956450 .nil)))) .nil) .nil)))))) +def cmd_352 : Cmd := (.l 56518851611755531494 (.l 21858752928964815153 (.l 6175004577773563242 (.l 3087502288886781621 (.l 592739785542294130 (.l 296369892771147065 (.l 148184946385573532 (.l 65586676231134893 (.l 32793338115567446 (.l 16396669057783723 (.l 8198334528891862 (.l 3953800802184123 (.l 1976900401092061 (.bc 32569070265501 (.bc 1 (.l 955881130280527 (.l 477940565140263 (.l 238970282570132 (.l 119485141285066 (.l 7266462824699 (.l 3633231412349 (.bc 538942174676 (.bc 1 (.b 1277673531496 .nil))) .nil) (.c (.bc 1 (.l 52476107817831 (.bc 527289646185 (.bc 1 (.l 14619674002205 (.bc 3335405999446 (.bc 1 (.b 3974431001653 .nil))) (.c (.bc 1 (.l 8488842969021 (.bc 2365310658594 (.bc 1 (.b 1879110825913 .nil))) (.c (.bc 1 (.b 2602247291495 .nil))))))))) .nil)))) .nil) .nil) .nil) .nil))) .nil) (.c (.bc 1 (.b 145366462261805 .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 8505796961651870 (.l 4252898480825935 (.l 2126449240412967 (.l 1063224620206484 (.l 531612310103242 (.l 215605531422497 (.l 107802765711248 (.l 53901382855624 (.l 26950691427812 (.l 5046030559371 (.l 2523015279685 (.bc 771775049375 (.bc 1 (.b 489732590464 .nil))) .nil) (.c (.bc 1 (.l 8429315154532 (.l 4214657577266 (.bc 1696787568220 (.bc 1 (.b 410541220410 .nil))) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 50200623629121 (.l 25100311814560 (.l 12550155907280 (.l 6275077953640 (.l 3137538976820 (.l 1568769488410 (.bc 554100026067 (.bc 1 (.b 230284718135 .nil))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 951011358901096677 (.l 360814802138025724 (.l 180407401069012862 (.l 90203700534506431 (.l 45101850267253215 (.l 22550925133626608 (.l 3106440152626295 (.l 1553220076313147 (.l 776610038156574 (.l 388305019078287 (.l 194152509539144 (.l 97076254769572 (.l 48538127384786 (.l 24269063692393 (.bc 155571780454 (.bc 1 (.bc 139337068933 (.bc 1 (.bc 45190400733 (.bc 1 (.bc 13081431789 (.bc 1 (.bc 3354213277 (.bc 1 (.bc 754697985 (.bc 1 (.bc 147258141 (.bc 1 (.bc 24543021 (.bc 1 (.bc 3424605 (.bc 1 (.bc 389157 (.bc 1 (.bc 34589 (.bc 1 (.bc 2253 (.bc 1 (.bc 93 (.bc 1 (.bc 1 (.bc 1 (.bc 91 (.bc 1 (.bc 2159 (.bc 1 (.bc 32427 (.bc 1 (.bc 356727 (.bc 1 (.bc 3067875 (.bc 1 (.bc 21475143 (.bc 1 (.bc 125782995 (.bc 1 (.bc 628914987 (.bc 1 (.bc 2725298287 (.bc 1 (.bc 10356133499 (.bc 1 (.bc 34834267231 (.bc 1 (.bc 104502801699 (.bc 1 (.bc 281353696887 (.bc 1 (.bc 683287549587 (.bc 1 (.bc 1503232609095 (.bc 1 (.l 3006465218193 (.bc 233360082180 (.bc 1 (.b 1269872526913 .nil))) (.c (.bc 1 (.bc 5482377750825 (.bc 1 (.b 667151643366 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 8169022414187006 (.l 4084511207093503 (.l 803915493941783 (.l 401957746970891 (.l 200978873485446 (.l 100489436742723 (.l 36813963017911 (.l 18406981508955 (.l 8470144608011 (.bc 3888793503585 (.bc 1 (.b 346278800417 .nil))) (.c (.bc 1 (.b 733346146463 .nil)))) .nil) (.c (.bc 1 (.b 13430755353447 .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 985808596526751 (.l 492904298263375 (.l 246452149131687 (.l 123226074565843 (.l 42371061198849 (.bc 13965282423640 (.bc 1 (.l 7220248175781 (.bc 2872723344929 (.bc 1 (.b 737400742958 .nil))) .nil))) (.c (.bc 1 (.l 19241976084069 (.l 9620988042034 (.l 4810494021017 (.bc 545251784909 (.bc 1 (.b 1859995225597 .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 252531513078211 (.l 126265756539105 (.l 63132878269553 (.l 31566439134776 (.bc 10300162128577 (.bc 1 (.b 5483057438808 .nil))) .nil) .nil) .nil) .nil))))))) .nil) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 114690877312522611 (.l 57345438656261305 (.l 28672719328130653 (.l 14336359664065326 (.l 7168179832032663 (.l 3584089916016331 (.l 1792044958008165 (.l 460283889536948 (.l 230141944768474 (.l 115070972384237 (.l 57535486192119 (.bc 8865981563179 (.bc 1 (.bc 6377354700357 (.bc 1 (.bc 2585444131197 (.bc 1 (.bc 952720108197 (.bc 1 (.bc 318580537097 (.bc 1 (.bc 100262901337 (.bc 1 (.bc 46099980077 (.bc 1 (.bc 80792102297 (.bc 1 (.bc 244072828297 (.bc 1 (.bc 709952587397 (.bc 1 (.bc 1875727331517 (.bc 1 (.bc 4501663848357 (.bc 1 (.b 2109090476717 .nil))))))))))))))))))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 435738589467132 (.l 40857841302689 (.l 20428920651344 (.l 10214460325672 (.l 5107230162836 (.l 2553615081418 (.l 1276807540709 (.bc 118445941769 (.bc 1 (.b 519957828582 .nil))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 177011453430874 (.l 79102947389588 (.l 39551473694794 (.bc 2631059251393 (.bc 1 (.l 17144677596001 (.l 8572338798000 (.bc 904751574812 (.bc 1 (.b 3381417824185 .nil))) .nil) .nil))) .nil) (.c (.bc 1 (.b 9402779325846 .nil)))) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil)))) .nil) (.c (.bc 1 (.l 4754371886708844331 (.l 1888683340043666118 (.l 944341670021833059 (.l 472170835010916529 (.l 236085417505458264 (.l 118042708752729132 (.l 38036490777466382 (.l 19018245388733191 (.l 9509122694366596 (.l 4754561347183298 (.l 321409023208935 (.l 160704511604467 (.l 80352255802233 (.l 38242115043068 (.bc 199386396484 (.bc 1 (.b 18921671125047 .nil))) (.c (.bc 1 (.b 1934012858045 .nil)))) .nil) .nil) (.c (.bc 1 (.l 1093372483663457 (.l 546686241831728 (.l 273343120915864 (.l 136671560457932 (.l 16218380216025 (.l 8109190108012 (.l 4054595054006 (.bc 542971877989 (.bc 1 (.b 1484325649011 .nil))) .nil) .nil) (.c (.bc 1 (.l 52117400012938 (.l 26058700006469 (.l 12057816601144 (.bc 3392398705026 (.bc 1 (.b 2636509595543 .nil))) (.c (.bc 1 (.b 971533402088 .nil)))) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 962499166719251 (.l 481249583359625 (.l 240624791679813 (.l 120312395839907 (.l 8694486753561 (.l 4347243376780 (.l 2173621688390 (.bc 309492693288 (.bc 1 (.b 777318150904 .nil))) .nil) .nil) (.c (.bc 1 (.l 51461711166389 (.l 25117892500815 (.l 12558946250407 (.bc 1428819056873 (.bc 1 (.bc 1293252845937 (.bc 1 (.bc 689734851165 (.bc 1 (.bc 333742669917 (.bc 1 (.bc 146012418087 (.bc 1 (.bc 57520043487 (.bc 1 (.bc 20301191817 (.bc 1 (.bc 6380374569 (.bc 1 (.bc 1772326267 (.bc 1 (.bc 431106387 (.bc 1 (.bc 90759237 (.bc 1 (.bc 16290117 (.bc 1 (.bc 2443515 (.bc 1 (.bc 297987 (.bc 1 (.bc 28377 (.bc 1 (.bc 1977 (.bc 1 (.bc 87 (.bc 1 (.bc 1 (.bc 1 (.bc 85 (.bc 1 (.bc 1889 (.bc 1 (.bc 26485 (.bc 1 (.bc 271499 (.bc 1 (.bc 2172013 (.bc 1 (.bc 14118101 (.bc 1 (.bc 76641133 (.bc 1 (.bc 354465251 (.bc 1 (.bc 1417861013 (.bc 1 (.bc 4962513553 (.bc 1 (.bc 15338678261 (.bc 1 (.bc 42181365223 (.bc 1 (.bc 103831052861 (.bc 1 (.bc 229911617053 (.bc 1 (.bc 459823234109 (.bc 1 (.bc 833429611825 (.bc 1 (.b 610052788944 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.b 612963082376 .nil)))) .nil)))) .nil) .nil) .nil) .nil))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 20984863598898181 (.l 10492431799449090 (.l 5246215899724545 (.l 2187573824105286 (.l 753464965488568 (.l 376732482744284 (.l 188366241372142 (.l 94183120686071 (.l 42796713321530 (.l 21398356660765 (.l 10699178330382 (.bc 609414036410 (.bc 1 (.bc 2059061393925 (.bc 1 (.b 2681113734850 .nil))))) .nil) .nil) (.c (.bc 1 (.l 4294847021503 (.l 2147423510751 (.l 1073711755376 (.bc 136549225259 (.bc 1 (.b 400306652426 .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 340321946564072 (.l 170160973282036 (.l 85080486641018 (.l 42540243320509 (.l 21270121660254 (.l 10635060830127 (.bc 1884322420614 (.bc 1 (.b 3433207994446 .nil))) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 435534125756983 (.l 217767062878491 (.l 108883531439245 (.l 54441765719623 (.l 27220882859812 (.l 13610441429906 (.l 6805220714953 (.l 3402610357477 (.bc 463006840179 (.bc 1 (.b 1238298338556 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 488502603310756044 (.l 244251301655378022 (.l 122125650827689011 (.l 24198263844137819 (.l 12099131922068909 (.l 6049565961034454 (.l 3024782980517227 (.l 1512391490258614 (.l 756195745129307 (.l 378097872564654 (.l 189048936282327 (.l 94524468141163 (.l 47262234070581 (.l 23631117035291 (.l 11815558517646 (.l 5907779258823 (.bc 2786934461601 (.bc 1 (.b 166955167808 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 36864561569706683 (.l 18432280784853341 (.l 9216140392426671 (.l 4608070196213336 (.l 2304035098106668 (.l 1152017549053334 (.l 576008774526667 (.l 288004387263334 (.l 144002193631667 (.l 72001096815834 (.l 36000548407917 (.l 18000274203958 (.l 9000137101979 (.bc 4041242759629 (.bc 1 (.b 458825791357 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))) .nil)))) (.c (.bc 1 (.l 6400672876912950591 (.l 3200336438456475295 (.l 1600168219228237648 (.l 552228855519361274 (.l 276114427759680637 (.l 138057213879840319 (.l 69028606939920160 (.l 34514303469960080 (.l 17257151734980040 (.l 8628575867490020 (.l 4314287933745010 (.l 1101121058714275 (.l 550560529357137 (.l 275280264678569 (.l 137640132339284 (.l 35847816570726 (.l 17923908285363 (.l 8961954142681 (.bc 3566407008800 (.bc 1 (.b 914570062538 .nil))) .nil) .nil) (.c (.bc 1 (.l 32972249598913 (.l 16486124799456 (.bc 1541914827690 (.bc 1 (.l 6701147572035 (.bc 1836551223752 (.bc 1 (.b 1514022562262 .nil))) .nil))) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 1056022908158227 (.l 317398814499295 (.l 158699407249647 (.l 25974981252870 (.l 12987490626435 (.l 6493745313218 (.l 3246872656609 (.bc 1303640397847 (.bc 1 (.b 319795930455 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 53374722371950 (.l 26687361185975 (.bc 4368077716227 (.bc 1 (.l 8975602876757 (.l 4487801438378 (.bc 647246034412 (.bc 1 (.bc 1372707595949 (.bc 1 (.b 223947088822 .nil))))) .nil) .nil))) .nil) .nil)))) .nil) (.c (.bc 1 (.l 210612639579815 (.l 105306319789907 (.l 52653159894954 (.l 26326579947477 (.l 13163289973739 (.l 6581644986870 (.bc 609482523003 (.bc 1 (.bc 459823234109 (.bc 1 (.bc 229911617053 (.bc 1 (.bc 103831052861 (.bc 1 (.bc 42181365223 (.bc 1 (.bc 15338678261 (.bc 1 (.bc 4962513553 (.bc 1 (.bc 1417861013 (.bc 1 (.bc 354465251 (.bc 1 (.bc 76641133 (.bc 1 (.bc 14118101 (.bc 1 (.bc 2172013 (.bc 1 (.bc 271499 (.bc 1 (.bc 26485 (.bc 1 (.bc 1889 (.bc 1 (.bc 85 (.bc 1 (.bc 1 (.bc 1 (.bc 83 (.bc 1 (.bc 1803 (.bc 1 (.bc 24679 (.bc 1 (.bc 246817 (.bc 1 (.bc 1925193 (.bc 1 (.bc 12192905 (.bc 1 (.bc 64448225 (.bc 1 (.bc 290017023 (.bc 1 (.bc 1127843987 (.bc 1 (.bc 3834669563 (.bc 1 (.bc 11504008695 (.bc 1 (.bc 30677356525 (.bc 1 (.bc 73153696333 (.bc 1 (.bc 156757920717 (.bc 1 (.bc 303065313389 (.bc 1 (.bc 530364298433 (.bc 1 (.b 712571987433 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 247855254094757547 (.l 123927627047378773 (.l 61963813523689386 (.l 30981906761844693 (.l 15490953380922346 (.l 3996689717990169 (.l 1998344858995084 (.l 999172429497542 (.l 499586214748771 (.l 249793107374386 (.l 124896553687193 (.l 62448276843596 (.l 31224138421798 (.l 15612069210899 (.l 7806034605449 (.bc 129771310080 (.bc 1 (.bc 1216718096409 (.bc 1 (.bc 1600944863697 (.bc 1 (.b 955583032529 .nil))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 3748786972471001 (.l 1874393486235500 (.l 937196743117750 (.l 468598371558875 (.l 234299185779437 (.l 112619131214538 (.l 56309565607269 (.l 28154782803635 (.l 14077391401817 (.bc 1240063565640 (.bc 1 (.l 5798632135266 (.bc 345519021086 (.bc 1 (.bc 2104098963717 (.bc 1 (.b 449698082824 .nil))))) .nil))) .nil) .nil) .nil) (.c (.bc 1 (.b 4530461675178 .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 6400672876912950591 (.l 3200336438456475295 (.l 1600168219228237648 (.l 800084109614118824 (.l 400042054807059412 (.l 200021027403529706 (.l 100010513701764853 (.l 50005256850882427 (.l 25002628425441214 (.l 12501314212720607 (.l 1484040095038042 (.l 742020047519021 (.l 371010023759511 (.l 185505011879756 (.l 92752505939878 (.l 46376252969939 (.l 18014412526167 (.l 9007206263083 (.l 4503603131541 (.bc 1512823953544 (.bc 1 (.b 738977612224 .nil))) .nil) .nil) (.c (.bc 1 (.b 5173713958800 .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 4766617011322259 (.l 1295045702033675 (.l 647522851016837 (.l 323761425508419 (.l 161880712754209 (.l 80940356377104 (.l 40470178188552 (.l 20235089094276 (.l 10117544547138 (.bc 535441979363 (.bc 1 (.bc 1600944863697 (.bc 1 (.bc 1216718096409 (.bc 1 (.bc 842343297513 (.bc 1 (.bc 530364298433 (.bc 1 (.bc 303065313389 (.bc 1 (.b 29894424747 .nil))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1088262803627451 (.l 544131401813725 (.l 272065700906862 (.l 136032850453431 (.l 68016425226715 (.l 34008212613358 (.l 15175979586978 (.l 7587989793489 (.bc 126863495970 (.bc 1 (.bc 73153696333 (.bc 1 (.bc 30677356525 (.bc 1 (.bc 11504008695 (.bc 1 (.bc 3834669563 (.bc 1 (.bc 1127843987 (.bc 1 (.bc 290017023 (.bc 1 (.bc 64448225 (.bc 1 (.bc 12192905 (.bc 1 (.bc 1925193 (.bc 1 (.bc 246817 (.bc 1 (.bc 24679 (.bc 1 (.bc 1803 (.bc 1 (.bc 83 (.bc 1 (.bc 1 (.bc 1 (.bc 81 (.bc 1 (.bc 1719 (.bc 1 (.bc 22957 (.bc 1 (.bc 223857 (.bc 1 (.bc 1701333 (.bc 1 (.bc 10491569 (.bc 1 (.bc 53956653 (.bc 1 (.bc 236060367 (.bc 1 (.bc 891783617 (.bc 1 (.bc 2942885943 (.bc 1 (.bc 8561122749 (.bc 1 (.bc 22116233773 (.bc 1 (.bc 51037462557 (.bc 1 (.bc 105720458157 (.bc 1 (.bc 197344855229 (.bc 1 (.bc 333019443201 (.bc 1 (.bc 509323854309 (.bc 1 (.bc 707394242097 (.bc 1 (.bc 893550621597 (.bc 1 (.b 714259547076 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 1828126719698 (.bc 83443436613 (.bc 1 (.l 830619923233 (.bc 271601949452 (.bc 1 (.b 143708012161 .nil))) .nil))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) +def cmd_356 : Cmd := (.l 14104635861910374273 (.l 7052317930955187137 (.l 3526158965477593569 (.l 762384523909535942 (.l 381192261954767971 (.l 190596130977383986 (.l 95298065488691993 (.l 47649032744345997 (.l 23824516372172998 (.l 11912258186086499 (.l 5956129093043249 (.l 2978064546521624 (.l 1489032273260812 (.l 149792371520800 (.l 74896185760400 (.l 37448092880200 (.l 18724046440100 (.l 9362023220050 (.l 4681011610025 (.l 2340505805012 (.bc 932807736716 (.bc 1 (.b 237445165787 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 594723765109603 (.l 297361882554801 (.l 148680941277400 (.l 74340470638700 (.l 37170235319350 (.l 18585117659675 (.l 9292558829838 (.bc 790138049050 (.bc 1 (.bc 893550621597 (.bc 1 (.bc 707394242097 (.bc 1 (.bc 509323854309 (.bc 1 (.bc 333019443201 (.bc 1 (.bc 197344855229 (.bc 1 (.bc 105720458157 (.bc 1 (.bc 51037462557 (.bc 1 (.bc 22116233773 (.bc 1 (.bc 8561122749 (.bc 1 (.bc 2942885943 (.bc 1 (.bc 891783617 (.bc 1 (.bc 236060367 (.bc 1 (.bc 53956653 (.bc 1 (.bc 10491569 (.bc 1 (.bc 1701333 (.bc 1 (.bc 223857 (.bc 1 (.bc 22957 (.bc 1 (.bc 1719 (.bc 1 (.bc 81 (.bc 1 (.bc 1 (.bc 1 (.bc 79 (.bc 1 (.bc 1637 (.bc 1 (.bc 21317 (.bc 1 (.bc 202537 (.bc 1 (.bc 1498793 (.bc 1 (.bc 8992773 (.bc 1 (.bc 44963877 (.bc 1 (.bc 191096487 (.bc 1 (.bc 700687127 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 6318923933 (.bc 1 (.bc 15797309837 (.bc 1 (.bc 35240152717 (.bc 1 (.bc 70480305437 (.bc 1 (.bc 126864549789 (.bc 1 (.bc 206154893409 (.bc 1 (.bc 303168960897 (.bc 1 (.b 256721184530 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1000694958829260840 (.l 500347479414630420 (.l 250173739707315210 (.l 125086869853657605 (.l 62543434926828803 (.l 19330088767938907 (.l 9665044383969453 (.l 4832522191984727 (.l 2416261095992364 (.l 1208130547996182 (.l 604065273998091 (.l 302032636999046 (.l 151016318499523 (.l 25619332107248 (.l 12809666053624 (.l 6404833026812 (.l 3202416513406 (.bc 147504096667 (.bc 1 (.bc 489325340397 (.bc 1 (.bc 538257874437 (.bc 1 (.b 426120945193 .nil))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 49888827142510 (.l 24944413571255 (.l 12472206785627 (.l 6236103392814 (.bc 112136929244 (.bc 1 (.bc 489325340397 (.bc 1 (.bc 404225281197 (.bc 1 (.bc 303168960897 (.bc 1 (.bc 206154893409 (.bc 1 (.bc 126864549789 (.bc 1 (.bc 70480305437 (.bc 1 (.bc 35240152717 (.bc 1 (.bc 15797309837 (.bc 1 (.bc 6318923933 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 700687127 (.bc 1 (.bc 191096487 (.bc 1 (.bc 44963877 (.bc 1 (.bc 8992773 (.bc 1 (.bc 1498793 (.bc 1 (.bc 202537 (.bc 1 (.bc 21317 (.bc 1 (.bc 1637 (.bc 1 (.bc 79 (.bc 1 (.bc 1 (.bc 1 (.bc 77 (.bc 1 (.bc 1557 (.bc 1 (.bc 19757 (.bc 1 (.bc 182777 (.bc 1 (.bc 1316013 (.bc 1 (.bc 7676757 (.bc 1 (.bc 37287117 (.bc 1 (.bc 153809367 (.bc 1 (.bc 546877757 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 24066445757 (.bc 1 (.bc 46413859677 (.bc 1 (.bc 80450690109 (.bc 1 (.bc 125704203297 (.bc 1 (.bc 177464757597 (.bc 1 (.bc 226760523597 (.bc 1 (.bc 262564816797 (.bc 1 (.bc 275693057637 (.bc 1 (.b 107791229452 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 11941628695475492 (.l 5970814347737746 (.l 2985407173868873 (.l 1492703586934437 (.l 746351793467219 (.l 373175896733610 (.l 186587948366805 (.l 93293974183403 (.l 46646987091702 (.l 23323493545851 (.l 11661746772926 (.l 3201314710538 (.bc 154773587345 (.bc 1 (.bc 226760523597 (.bc 1 (.bc 177464757597 (.bc 1 (.bc 125704203297 (.bc 1 (.bc 80450690109 (.bc 1 (.bc 46413859677 (.bc 1 (.bc 24066445757 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 546877757 (.bc 1 (.bc 153809367 (.bc 1 (.bc 37287117 (.bc 1 (.bc 7676757 (.bc 1 (.bc 1316013 (.bc 1 (.bc 182777 (.bc 1 (.bc 19757 (.bc 1 (.bc 1557 (.bc 1 (.bc 77 (.bc 1 (.bc 1 (.bc 1 (.bc 75 (.bc 1 (.bc 1479 (.bc 1 (.bc 18275 (.bc 1 (.bc 164499 (.bc 1 (.bc 1151511 (.bc 1 (.bc 6525243 (.bc 1 (.bc 30761871 (.bc 1 (.bc 123047493 (.bc 1 (.bc 423830261 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 16244850885 (.bc 1 (.bc 30169008789 (.bc 1 (.bc 50281681317 (.bc 1 (.bc 75422521977 (.bc 1 (.bc 102042235617 (.bc 1 (.bc 124718287977 (.bc 1 (.bc 137846528817 (.bc 1 (.bc 137846528817 (.bc 1 (.b 59181143057 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 2629558675922 (.bc 65537144918 (.bc 1 (.bc 102042235617 (.bc 1 (.bc 75422521977 (.bc 1 (.bc 50281681317 (.bc 1 (.bc 30169008789 (.bc 1 (.bc 16244850885 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 423830261 (.bc 1 (.bc 123047493 (.bc 1 (.bc 30761871 (.bc 1 (.bc 6525243 (.bc 1 (.bc 1151511 (.bc 1 (.bc 164499 (.bc 1 (.bc 18275 (.bc 1 (.bc 1479 (.bc 1 (.bc 75 (.bc 1 (.bc 1 (.bc 1 (.bc 73 (.bc 1 (.bc 1403 (.bc 1 (.bc 16869 (.bc 1 (.bc 147627 (.bc 1 (.bc 1003881 (.bc 1 (.bc 5521359 (.bc 1 (.bc 25240509 (.bc 1 (.bc 97806981 (.bc 1 (.bc 326023277 (.bc 1 (.bc 945467509 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 30942573117 (.bc 1 (.bc 44479948857 (.bc 1 (.bc 57562286757 (.bc 1 (.bc 67156001217 (.bc 1 (.bc 70690527597 (.bc 1 (.bc 67156001217 (.bc 1 (.bc 57562286757 (.bc 1 (.bc 44479948857 (.bc 1 (.bc 30942573117 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 945467509 (.bc 1 (.bc 326023277 (.bc 1 (.bc 97806981 (.bc 1 (.bc 25240509 (.bc 1 (.bc 5521359 (.bc 1 (.bc 1003881 (.bc 1 (.bc 147627 (.bc 1 (.bc 16869 (.bc 1 (.bc 1403 (.bc 1 (.bc 73 (.bc 1 (.bc 1 (.bc 1 (.bc 71 (.bc 1 (.bc 1329 (.bc 1 (.bc 15537 (.bc 1 (.bc 132087 (.bc 1 (.bc 871791 (.bc 1 (.bc 4649565 (.bc 1 (.bc 20590941 (.bc 1 (.bc 77216037 (.bc 1 (.bc 248807237 (.bc 1 (.bc 696660269 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 25751549337 (.bc 1 (.bc 31810737417 (.bc 1 (.bc 35345263797 (.bc 1 (.bc 35345263797 (.bc 1 (.bc 31810737417 (.bc 1 (.bc 25751549337 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 696660269 (.bc 1 (.bc 248807237 (.bc 1 (.bc 77216037 (.bc 1 (.bc 20590941 (.bc 1 (.bc 4649565 (.bc 1 (.bc 871791 (.bc 1 (.bc 132087 (.bc 1 (.bc 15537 (.bc 1 (.bc 1329 (.bc 1 (.bc 71 (.bc 1 (.bc 1 (.bc 1 (.bc 69 (.bc 1 (.bc 1257 (.bc 1 (.bc 14277 (.bc 1 (.bc 117807 (.bc 1 (.bc 753981 (.bc 1 (.bc 3895581 (.bc 1 (.bc 16695357 (.bc 1 (.bc 60520677 (.bc 1 (.bc 188286557 (.bc 1 (.bc 508373709 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 17194993197 (.bc 1 (.bc 18150270597 (.bc 1 (.bc 17194993197 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 508373709 (.bc 1 (.bc 188286557 (.bc 1 (.bc 60520677 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) +def cmd_357 : Cmd := (.l 143550226855100416 (.l 71775113427550208 (.l 35887556713775104 (.l 17943778356887552 (.l 8971889178443776 (.l 4485944589221888 (.l 2242972294610944 (.l 1121486147305472 (.l 560743073652736 (.l 280371536826368 (.l 140185768413184 (.l 70092884206592 (.l 35046442103296 (.l 17523221051648 (.l 8761610525824 (.l 4380805262912 (.l 2190402631456 (.l 1095201315728 (.l 547600657864 (.l 273800328932 (.bc 16695357 (.bc 1 (.bc 3895581 (.bc 1 (.bc 753981 (.bc 1 (.bc 117807 (.bc 1 (.bc 14277 (.bc 1 (.bc 1257 (.bc 1 (.bc 69 (.bc 1 (.bc 1 (.bc 1 (.bc 67 (.bc 1 (.bc 1187 (.bc 1 (.bc 13087 (.bc 1 (.bc 104717 (.bc 1 (.bc 649261 (.bc 1 (.bc 3246317 (.bc 1 (.bc 13449037 (.bc 1 (.bc 47071637 (.bc 1 (.bc 141214917 (.bc 1 (.bc 367158789 (.bc 1 (.bc 834451797 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 834451797 (.bc 1 (.bc 367158789 (.bc 1 (.bc 141214917 (.bc 1 (.bc 47071637 (.bc 1 (.bc 13449037 (.bc 1 (.bc 3246317 (.bc 1 (.bc 649261 (.bc 1 (.bc 104717 (.bc 1 (.bc 13087 (.bc 1 (.bc 1187 (.bc 1 (.bc 67 (.bc 1 (.bc 1 (.bc 1 (.bc 65 (.bc 1 (.bc 1119 (.bc 1 (.bc 11965 (.bc 1 (.bc 92749 (.bc 1 (.bc 556509 (.bc 1 (.bc 2689805 (.bc 1 (.bc 10759229 (.bc 1 (.bc 36312405 (.bc 1 (.bc 104902509 (.bc 1 (.bc 262256277 (.bc 1 (.bc 572195517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 4667212437 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 572195517 (.bc 1 (.bc 262256277 (.bc 1 (.bc 104902509 (.bc 1 (.bc 36312405 (.bc 1 (.bc 10759229 (.bc 1 (.bc 2689805 (.bc 1 (.bc 556509 (.bc 1 (.bc 92749 (.bc 1 (.bc 11965 (.bc 1 (.bc 1119 (.bc 1 (.bc 65 (.bc 1 (.bc 1 (.bc 1 (.bc 63 (.bc 1 (.bc 1053 (.bc 1 (.bc 10909 (.bc 1 (.bc 81837 (.bc 1 (.bc 474669 (.bc 1 (.bc 2215133 (.bc 1 (.bc 8544093 (.bc 1 (.bc 27768309 (.bc 1 (.bc 77134197 (.bc 1 (.bc 185122077 (.bc 1 (.bc 387073437 (.bc 1 (.bc 709634637 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 709634637 (.bc 1 (.bc 387073437 (.bc 1 (.bc 185122077 (.bc 1 (.bc 77134197 (.bc 1 (.bc 27768309 (.bc 1 (.bc 8544093 (.bc 1 (.bc 2215133 (.bc 1 (.bc 474669 (.bc 1 (.bc 81837 (.bc 1 (.bc 10909 (.bc 1 (.bc 1053 (.bc 1 (.bc 63 (.bc 1 (.bc 1 (.bc 1 (.bc 61 (.bc 1 (.bc 989 (.bc 1 (.bc 9917 (.bc 1 (.bc 71917 (.bc 1 (.bc 402749 (.bc 1 (.bc 1812381 (.bc 1 (.bc 6731709 (.bc 1 (.bc 21036597 (.bc 1 (.bc 56097597 (.bc 1 (.bc 129024477 (.bc 1 (.bc 258048957 (.bc 1 (.bc 451585677 (.bc 1 (.bc 694747197 (.bc 1 (.bc 942871197 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 1202160777 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 942871197 (.bc 1 (.bc 694747197 (.bc 1 (.bc 451585677 (.bc 1 (.bc 258048957 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.bc 6731709 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 61 (.bc 1 (.bc 1 (.bc 1 (.bc 59 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 (.bc 1 (.bc 62927 (.bc 1 (.bc 339819 (.bc 1 (.bc 1472559 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.bc 88704327 (.bc 1 (.bc 169344627 (.bc 1 (.bc 282241047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 530365047 (.bc 1 (.bc 601080387 (.bc 1 (.bc 601080387 (.bc 1 (.bc 530365047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 282241047 (.bc 1 (.bc 169344627 (.bc 1 (.bc 88704327 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.bc 11705847 (.bc 1 (.bc 28614297 (.bc 1 (.bc 60090027 (.bc 1 (.bc 109254597 (.bc 1 (.bc 172986447 (.bc 1 (.bc 239519697 (.bc 1 (.bc 290845347 (.bc 1 (.bc 310235037 (.bc 1 (.bc 290845347 (.bc 1 (.bc 239519697 (.bc 1 (.bc 172986447 (.bc 1 (.bc 109254597 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.bc 69194577 (.bc 1 (.bc 103791867 (.bc 1 (.bc 135727827 (.bc 1 (.bc 155117517 (.bc 1 (.bc 155117517 (.bc 1 (.bc 135727827 (.bc 1 (.bc 103791867 (.bc 1 (.bc 69194577 (.bc 1 (.bc 40060017 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.bc 26246217 (.bc 1 (.bc 42948357 (.bc 1 (.bc 60843507 (.bc 1 (.bc 74884317 (.bc 1 (.bc 80233197 (.bc 1 (.bc 74884317 (.bc 1 (.bc 60843507 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_358 : Cmd := (.l 587207989526528 (.l 293603994763264 (.l 146801997381632 (.l 73400998690816 (.l 36700499345408 (.l 18350249672704 (.l 9175124836352 (.l 4587562418176 (.l 2293781209088 (.l 1146890604544 (.l 573445302272 (.l 286722651136 (.l 143361325568 (.l 71680662784 (.l 35840331392 (.l 17920165696 (.l 8960082848 (.l 4480041424 (.l 2240020712 (.l 1120010356 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.bc 26075787 (.bc 1 (.bc 34767717 (.bc 1 (.bc 40116597 (.bc 1 (.bc 40116597 (.bc 1 (.bc 34767717 (.bc 1 (.bc 26075787 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_359 : Cmd := (.l 274911461375 (.l 137455730687 (.l 68727865343 (.l 34363932671 (.l 17181966335 (.l 8590983167 (.l 4295491583 (.l 2147745791 (.l 1073872895 (.l 536936447 (.l 268468223 (.l 134234111 (.l 67117055 (.l 33558527 (.l 16779263 (.l 8389631 (.l 4194815 (.l 2097407 (.l 1048703 (.l 524351 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 56246201330417926144 (.l 28123100665208963072 (.l 8698267426245917107 (.l 4349133713122958553 (.l 1401081749949354111 (.l 700540874974677055 (.l 69556567584940575 (.l 34778283792470287 (.l 17389141896235143 (.l 8694570948117571 (.l 4347285474058785 (.l 2173642737029392 (.l 1086821368514696 (.l 543410684257348 (.l 271705342128674 (.l 135852671064337 (.l 67926335532168 (.l 27724886805795 (.l 13862443402897 (.l 6931221701448 (.c (.c (.b 3465610850722 .nil))) .nil) .nil) (.c (.bc 1 (.b 6238280960286 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 280713869902397949 (.l 140356934951198974 (.l 70178467475599487 (.l 35089233737799743 (.l 17544616868899871 (.l 8772308434449935 (.l 1357436236992459 (.l 678718118496229 (.l 339359059248114 (.l 169679529624057 (.l 84839764812029 (.l 42419882406014 (.bc 4935369247759 (.bc 1 (.l 16274571955245 (.bc 5662003253245 (.bc 1 (.b 2475282724374 .nil))) .nil))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 3028717980232506 (.l 1514358990116253 (.l 757179495058127 (.l 378589747529064 (.l 132482346383066 (.l 66241173191533 (.l 33120586595766 (.bc 11471116817203 (.bc 1 (.b 5089176480677 .nil))) .nil) .nil) (.c (.bc 1 (.l 56812527381463 (.l 28406263690731 (.bc 7159896141737 (.bc 1 (.l 7043235703626 (.bc 468171699829 (.bc 1 (.b 3053446151981 .nil))) .nil))) .nil) .nil)))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 773485106612125162 (.l 386742553306062581 (.l 193371276653031291 (.l 96685638326515645 (.l 48342819163257822 (.l 24171409581628911 (.l 12085704790814455 (.l 6042852395407227 (.l 1319343094501263 (.l 652248192113101 (.bc 40867377487187 (.bc 1 (.l 285256718569360 (.l 142628359284680 (.l 71314179642340 (.l 35657089821170 (.l 17828544910585 (.bc 1151826052370 (.bc 1 (.bc 3006465218193 (.bc 1 (.bc 1503232609095 (.bc 1 (.bc 683287549587 (.bc 1 (.bc 281353696887 (.bc 1 (.bc 104502801699 (.bc 1 (.bc 34834267231 (.bc 1 (.bc 10356133499 (.bc 1 (.bc 2725298287 (.bc 1 (.bc 628914987 (.bc 1 (.bc 125782995 (.bc 1 (.bc 21475143 (.bc 1 (.bc 3067875 (.bc 1 (.bc 356727 (.bc 1 (.bc 32427 (.bc 1 (.bc 2159 (.bc 1 (.bc 91 (.bc 1 (.bc 1 (.bc 1 (.bc 89 (.bc 1 (.bc 2067 (.bc 1 (.bc 30357 (.bc 1 (.bc 326367 (.bc 1 (.bc 2741505 (.bc 1 (.bc 18733635 (.bc 1 (.bc 107049357 (.bc 1 (.bc 521865627 (.bc 1 (.bc 2203432657 (.bc 1 (.bc 8152700839 (.bc 1 (.bc 26681566389 (.bc 1 (.bc 77821235307 (.bc 1 (.bc 203532461577 (.bc 1 (.bc 479755088007 (.bc 1 (.bc 1023477521085 (.bc 1 (.b 312634441076 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil))) (.c (.bc 1 (.b 7423355137527 .nil)))) (.c (.bc 1 (.l 1702083103202348 (.l 851041551601174 (.l 425520775800587 (.l 128797948958851 (.l 64398974479425 (.l 32199487239712 (.l 10045398239957 (.bc 1554363332005 (.bc 1 (.b 3468335787970 .nil))) (.c (.bc 1 (.l 6054345379896 (.bc 31054265745 (.bc 1 (.b 2996118424200 .nil))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 83962438941439 (.l 41981219470719 (.l 20990609735360 (.l 10495304867680 (.bc 2641787773457 (.bc 1 (.b 2605864660380 .nil))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 5363282906358564426 (.l 2681641453179282213 (.l 1340820726589641107 (.l 670410363294820554 (.l 335205181647410277 (.l 167602590823705139 (.l 83801295411852570 (.l 22262050404372912 (.l 11131025202186456 (.l 5565512601093228 (.l 914451649051885 (.l 457225824525942 (.l 228612912262971 (.l 114306456131486 (.bc 6337591050537 (.bc 1 (.l 50815637015203 (.bc 2203355620523 (.bc 1 (.l 23204462887075 (.bc 3872791150754 (.bc 1 (.l 7729440292780 (.bc 2423195321709 (.bc 1 (.b 1441524824678 .nil))) .nil))) .nil))) .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 1698623999141913 (.l 849311999570956 (.l 424655999785478 (.l 212327999892739 (.l 101905124071146 (.l 50952562035573 (.bc 5269100503535 (.bc 1 (.bc 6696217985979 (.bc 1 (.bc 3151161405165 (.bc 1 (.bc 1350497745069 (.bc 1 (.bc 525193567525 (.bc 1 (.bc 184527469669 (.bc 1 (.bc 58271832525 (.bc 1 (.bc 16435645069 (.bc 1 (.bc 4108911265 (.bc 1 (.bc 901956129 (.bc 1 (.bc 171801165 (.bc 1 (.bc 27967629 (.bc 1 (.bc 3813765 (.bc 1 (.bc 423749 (.bc 1 (.bc 36845 (.bc 1 (.bc 2349 (.bc 1 (.bc 95 (.bc 1 (.bc 1 (.bc 1 (.bc 93 (.bc 1 (.bc 2253 (.bc 1 (.bc 34589 (.bc 1 (.bc 389157 (.bc 1 (.bc 3424605 (.bc 1 (.bc 24543021 (.bc 1 (.bc 147258141 (.bc 1 (.bc 754697985 (.bc 1 (.bc 3354213277 (.bc 1 (.bc 13081431789 (.bc 1 (.bc 45190400733 (.bc 1 (.bc 139337068933 (.bc 1 (.bc 385856498589 (.bc 1 (.bc 964641246477 (.bc 1 (.l 2186520158685 (.bc 370435050978 (.bc 1 (.b 722825028361 .nil))) (.c (.bc 1 (.b 4480748581833 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 4258875875221 (.l 2129437937610 (.bc 28949245457 (.bc 1 (.b 1035769723345 .nil))) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.b 169680652352810 .nil))))))) .nil) .nil) (.c (.bc 1 (.l 19638597301553370 (.l 9819298650776685 (.l 632392958520012 (.l 316196479260006 (.l 158098239630003 (.l 79049119815001 (.l 39524559907501 (.l 19762279953750 (.l 9881139976875 (.bc 4801813052663 (.bc 1 (.b 138756935771 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 4277256366868328 (.l 984085883678411 (.l 492042941839205 (.l 246021470919602 (.l 123010735459801 (.bc 50717758163925 (.bc 1 (.l 10787609565973 (.l 5393804782986 (.l 1801477525452 (.bc 255859495651 (.bc 1 (.b 644879267072 .nil))) (.c (.bc 1 (.b 895424866038 .nil)))) .nil) .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 1154542299755750 (.l 577271149877875 (.l 288635574938938 (.l 144317787469469 (.bc 33103567648664 (.bc 1 (.bc 20726393702347 (.bc 1 (.bc 8962798831557 (.bc 1 (.bc 3538164239397 (.bc 1 (.bc 1271300645297 (.bc 1 (.bc 418843438437 (.bc 1 (.bc 146362881417 (.bc 1 (.bc 126892082377 (.bc 1 (.bc 324864930597 (.bc 1 (.bc 954025415697 (.bc 1 (.bc 2585679918917 .nil))))))))))))))))))))) .nil) .nil) .nil) .nil)))) .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil))) +def cmd_360 : Cmd := (.l 33323569432138118015 (.l 5651532394511830293 (.l 2825766197255915146 (.l 1412883098627957573 (.l 706441549313978786 (.l 169723152373765273 (.l 84861576186882636 (.l 26392152250813941 (.l 13196076125406970 (.l 6598038062703485 (.l 3299019031351742 (.l 1649509515675871 (.l 695977796583777 (.l 347988898291888 (.l 173994449145944 (.l 86997224572972 (.bc 1 (.bc 6377391179877 (.bc 1 (.l 14349043739307 (.l 7174521869653 (.bc 2554199698264 (.bc 1 (.b 1033061236559 .nil))) .nil) (.c (.bc 1 (.b 22772177367294 .nil))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 128776961254155 (.l 64388480627077 (.l 32194240313538 (.l 16097120156769 (.l 6769961347603 (.l 3384980673801 (.l 1692490336900 (.bc 230962275151 (.bc 1 (.b 615282893296 .nil))) .nil) .nil) (.c (.bc 1 (.b 1278598730778 .nil)))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 16038635842627374 .nil)))) .nil) (.c (.bc 1 (.l 183497622283224117 (.l 91748811141612058 (.l 45874405570806029 (.l 22937202785403015 (.l 11468601392701508 (.l 5734300696350754 (.l 2867150348175377 (.l 1433575174087688 (.l 716787587043844 (.l 358393793521922 (.l 179196896760961 (.bc 23197757233137 (.bc 1 (.l 66400691147341 (.l 33200345573670 (.bc 11102308835991 (.bc 1 (.b 5497863950841 .nil))) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 11010252321557228711 (.l 5505126160778614355 (.l 714768829401054513 (.l 357384414700527256 (.l 178692207350263628 (.l 89346103675131814 (.l 44673051837565907 (.l 22336525918782953 (.l 11168262959391476 (.l 710758568329473 (.l 355379284164736 (.l 177689642082368 (.l 88844821041184 (.l 44422410520592 (.l 22211205260296 (.l 11105602630148 (.l 5552801315074 (.l 2776400657537 (.bc 576265094227 (.bc 1 (.b 811935234539 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 4873372911366262 (.l 2436686455683131 (.l 568087468364961 (.l 284043734182480 (.l 142021867091240 (.l 71010933545620 (.l 19412650759110 (.bc 2730616917207 (.bc 1 (.b 6975708462345 .nil))) (.c (.bc 1 (.b 16092816013697 .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.b 650255759476602 .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 2037794250988252661 (.l 1018897125494126330 (.l 509448562747063165 (.l 254724281373531582 (.l 127362140686765791 (.l 63681070343382896 (.l 31840535171691448 (.l 15920267585845724 (.l 7960133792922862 (.l 3679025087979381 (.l 616959401064053 (.l 308479700532026 (.l 154239850266013 (.l 77119925133006 (.l 38559962566503 (.l 17317600989651 (.bc 5450500525846 (.bc 1 (.b 3208299968976 .nil))) (.c (.bc 1 (.b 1962380293598 .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1222553142925634 (.l 522624630165067 (.l 146164449200407 (.bc 21216585140429 (.bc 1 (.b 51865639459771 .nil))) (.c (.bc 1 (.l 115147865882123 (.l 57573932941061 (.l 28786966470531 (.l 14393483235266 (.bc 562284969747 (.bc 1 (.b 6634456647883 .nil))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.b 88651941297747 .nil)))) .nil)))) (.c (.bc 1 (.l 301041808482047 (.l 150520904241023 (.l 75260452120511 (.l 37630226060255 (.l 18815113030128 (.l 9407556515064 (.l 4703778257532 (.bc 1811636200851 (.bc 1 (.b 540252927912 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 11010252321557228711 (.l 5505126160778614355 (.l 2752563080389307178 (.l 1376281540194653589 (.l 688140770097326794 (.l 344070385048663397 (.l 172035192524331698 (.l 86017596262165849 (.l 43008798131082925 (.l 21504399065541463 (.l 10752199532770732 (.l 5131829957266559 (.l 2565914978633279 (.l 1282957489316640 (.l 641478744658320 (.l 320739372329160 (.l 78495645858119 (.l 39247822929059 (.bc 9900370295737 (.bc 1 (.l 9723541168790 (.bc 2818055268135 (.bc 1 (.b 2043715316257 .nil))) .nil))) .nil) (.c (.bc 1 (.l 81874040306458 (.l 40937020153229 (.l 20468510076614 (.bc 3594190881400 (.bc 1 (.bc 3499390053717 (.bc 1 (.bc 1982987697105 (.bc 1 (.bc 1023477521085 (.bc 1 (.b 134208884988 .nil))))))))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 244269809118804 (.l 122134904559402 (.l 61067452279701 (.l 30533726139850 (.l 15266863069925 (.l 7633431534963 (.l 3192777523048 (.l 1596388761524 (.bc 345546203019 (.bc 1 (.bc 203532461577 (.bc 1 (.bc 77821235307 (.bc 1 (.bc 26681566389 (.bc 1 (.bc 8152700839 (.bc 1 (.bc 2203432657 (.bc 1 (.bc 521865627 (.bc 1 (.bc 107049357 (.bc 1 (.bc 18733635 (.bc 1 (.bc 2741505 (.bc 1 (.bc 326367 (.bc 1 (.bc 30357 (.bc 1 (.bc 2067 (.bc 1 (.bc 89 (.bc 1 (.bc 1 (.bc 1 (.bc 87 (.bc 1 (.bc 1977 (.bc 1 (.bc 28377 (.bc 1 (.bc 297987 (.bc 1 (.bc 2443515 (.bc 1 (.bc 16290117 (.bc 1 (.bc 90759237 (.bc 1 (.bc 431106387 (.bc 1 (.bc 1772326267 (.bc 1 (.bc 6380374569 (.bc 1 (.bc 20301191817 (.bc 1 (.bc 57520043487 (.bc 1 (.b 47091168064 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 623938244430 (.l 311969122215 (.bc 98921250022 (.bc 1 (.b 57063311083 .nil))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) +def cmd_364 : Cmd := (.l 143956072891977416617 (.l 71978036445988708309 (.l 25840491987379233536 (.l 4047661990400716849 (.l 2023830995200358424 (.l 827251920255662979 (.l 413625960127831489 (.l 206812980063915745 (.l 103406490031957872 (.l 51703245015978936 (.l 25851622507989468 (.l 12925811253994734 (.l 6462905626997367 (.l 3231452813498683 (.l 1615726406749341 (.l 807863203374671 (.l 403931601687335 (.l 201965800843667 (.l 100982900421834 (.l 29814989942403 (.bc 276679358834 (.bc 1 (.bc 689734851165 (.bc 1 (.bc 1293252845937 (.bc 1 (.bc 2206137207777 (.bc 1 (.bc 3431768989877 (.bc 1 (.bc 4876724354037 (.bc 1 (.b 2133197363556 .nil))))))))))))) (.c (.bc 1 (.l 20676460268511 (.bc 4206544296691 (.bc 1 (.b 6131685837561 .nil))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 184663577344516230 (.l 92331788672258115 (.l 46165894336129057 (.l 23082947168064528 (.l 9809684627966631 (.l 4904842313983315 (.l 2452421156991657 (.l 1226210578495828 (.bc 129436352651500 (.bc 1 (.l 483668936596411 (.l 241834468298205 (.l 120917234149102 (.l 60458617074551 (.l 12591477928990 (.l 6295738964495 (.l 3147869482248 (.bc 404404157646 (.bc 1 (.b 1169530583475 .nil))) .nil) .nil) (.c (.bc 1 (.b 17637830608283 .nil)))) .nil) .nil) .nil) .nil))) .nil) .nil) .nil) (.c (.bc 1 (.b 1731788956065630 .nil)))) .nil) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 8872584003288899916 (.l 4436292001644449958 (.l 2218146000822224979 (.l 1109073000411112490 (.bc 5812300443156994 (.bc 1 (.l 548724199762399248 (.l 274362099881199624 (.l 137181049940599812 (.l 68590524970299906 (.l 31500678471097903 (.l 9311201147288507 (.l 4655600573644253 (.l 2327800286822126 (.l 1163900143411063 (.l 208246688460051 (.l 104123344230025 (.l 52061672115013 (.l 26030836057507 (.bc 3304061910443 (.bc 1 (.bc 8233430727597 (.bc 1 (.b 1477925390708 .nil))))) .nil) .nil) .nil) (.c (.bc 1 (.l 373703383245478 (.l 186851691622739 (.l 37038018030346 (.bc 5097922080393 (.bc 1 (.l 13421086934777 (.bc 3520425069391 (.bc 1 (.b 3190118397994 .nil))) .nil))) (.c (.bc 1 (.l 56387827781020 (.l 28193913890510 (.bc 3149623262254 (.bc 1 (.bc 4876724354037 (.bc 1 (.bc 3431768989877 (.bc 1 (.bc 2206137207777 (.bc 1 (.b 432703131298 .nil))))))))) .nil) .nil)))) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 6439138088260441 (.l 3219569044130220 (.bc 54560582315035 (.bc 1 (.l 1555223939750072 (.l 716803829803393 (.l 358401914901696 (.l 65712322748816 (.l 32856161374408 (.l 16428080687204 (.bc 8040615966 (.bc 1 (.bc 689734851165 (.bc 1 (.bc 333742669917 (.bc 1 (.bc 146012418087 (.bc 1 (.bc 57520043487 (.bc 1 (.bc 20301191817 (.bc 1 (.bc 6380374569 (.bc 1 (.bc 1772326267 (.bc 1 (.bc 431106387 (.bc 1 (.bc 90759237 (.bc 1 (.bc 16290117 (.bc 1 (.bc 2443515 (.bc 1 (.bc 297987 (.bc 1 (.bc 28377 (.bc 1 (.bc 1977 (.bc 1 (.bc 87 (.bc 1 (.bc 1 (.bc 1 (.bc 85 (.bc 1 (.bc 1889 (.bc 1 (.bc 26485 (.bc 1 (.bc 271499 (.bc 1 (.bc 2172013 (.bc 1 (.bc 14118101 (.bc 1 (.bc 76641133 (.bc 1 (.bc 354465251 (.bc 1 (.bc 1417861013 (.bc 1 (.bc 4962513553 (.bc 1 (.bc 15338678261 (.bc 1 (.bc 42181365223 (.bc 1 (.bc 103831052861 (.bc 1 (.bc 229911617053 (.bc 1 (.bc 459823234109 (.bc 1 (.bc 833429611825 (.bc 1 (.bc 1372707595949 (.bc 1 (.bc 2059061393925 (.bc 1 (.b 1826882304309 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) (.c (.bc 1 (.l 113488634702029 (.l 56744317351014 (.l 2167299361710 (.bc 990780655800 (.bc 1 (.b 92869025052 .nil))) (.c (.bc 1 (.l 26204859313794 (.bc 3429209675083 (.bc 1 (.bc 4025232800157 (.bc 1 (.bc 4208197927437 (.bc 1 (.b 1439789254211 .nil))))))) .nil)))) .nil) .nil)))) .nil) (.c (.bc 1 (.b 60808140071640 .nil)))) .nil))) .nil) .nil)))) (.c (.bc 1 (.l 2794584014052047 (.l 1397292007026023 (.l 157067440124631 (.l 78533720062315 (.l 39266860031158 (.l 19633430015579 (.l 9816715007789 (.l 4908357503894 (.l 2454178751947 (.bc 685189168707 (.bc 1 (.b 541900207263 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 541578563388378 (.l 270789281694189 (.l 135394640847094 (.l 67697320423547 (.l 33848660211774 (.l 15591912615213 (.l 7795956307606 (.bc 2980178492874 (.bc 1 (.b 917799660926 .nil))) .nil) (.c (.bc 1 (.b 1332417490671 .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 10148526235615120616 (.l 5074263117807560308 (.l 1018607855367294327 (.l 509303927683647163 (.l 254651963841823582 (.l 127325981920911791 (.l 63662990960455895 (.l 31831495480227947 (.bc 415695384115342 (.bc 1 (.l 15500052355998628 (.l 7750026177999314 (.l 3418932027823208 (.l 1709466013911604 (.l 854733006955802 (.l 427366503477901 (.l 55075962608082 (.l 27537981304041 (.l 13768990652020 (.l 6884495326010 (.bc 1160806402964 (.bc 1 (.bc 2059061393925 (.bc 1 (.b 222379866110 .nil))))) .nil) .nil) .nil) (.c (.bc 1 (.l 158607289130865 (.l 79303644565432 (.l 39651822282716 (.l 6153202317020 (.bc 1150327729839 (.bc 1 (.bc 833429611825 (.bc 1 (.bc 459823234109 (.bc 1 (.bc 229911617053 (.bc 1 (.bc 103831052861 (.bc 1 (.bc 42181365223 (.bc 1 (.bc 15338678261 (.bc 1 (.bc 4962513553 (.bc 1 (.bc 1417861013 (.bc 1 (.bc 354465251 (.bc 1 (.bc 76641133 (.bc 1 (.bc 14118101 (.bc 1 (.bc 2172013 (.bc 1 (.bc 271499 (.bc 1 (.bc 26485 (.bc 1 (.bc 1889 (.bc 1 (.bc 85 (.bc 1 (.bc 1 (.bc 1 (.bc 83 (.bc 1 (.bc 1803 (.bc 1 (.bc 24679 (.bc 1 (.bc 246817 (.bc 1 (.bc 1925193 (.bc 1 (.bc 12192905 (.bc 1 (.bc 64448225 (.bc 1 (.bc 290017023 (.bc 1 (.bc 1127843987 (.bc 1 (.bc 3834669563 (.bc 1 (.bc 11504008695 (.bc 1 (.bc 30677356525 (.bc 1 (.bc 73153696333 (.bc 1 (.b 114263366392 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 13672708824335 (.bc 42494554323 (.bc 1 (.bc 303065313389 (.bc 1 (.bc 530364298433 (.bc 1 (.bc 842343297513 (.bc 1 (.bc 1216718096409 (.bc 1 (.bc 1600944863697 (.bc 1 (.bc 1921133836437 (.bc 1 (.b 379290151945 .nil))))))))))))))) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 456081061176446 (.l 228040530588223 (.l 114020265294111 (.l 57010132647056 (.l 28505066323528 (.l 14252533161764 (.l 7126266580882 (.l 3563133290441 (.bc 1724808811772 (.bc 1 (.b 56757833446 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1518523703536485824 (.l 759261851768242912 (.l 276650077469237447 (.l 138325038734618723 (.l 69162519367309361 (.l 34581259683654680 (.l 17290629841827340 (.l 8645314920913670 (.l 4322657460456835 (.l 2161328730228417 (.l 1080664365114209 (.l 540332182557104 (.l 270166091278552 (.l 135083045639276 (.l 67541522819638 (.l 27392636418277 (.bc 2047341130271 (.bc 1 (.bc 1921133836437 (.bc 1 (.bc 1600944863697 (.bc 1 (.bc 1216718096409 (.bc 1 (.bc 842343297513 (.bc 1 (.bc 530364298433 (.bc 1 (.bc 303065313389 (.bc 1 (.bc 156757920717 (.bc 1 (.bc 73153696333 (.bc 1 (.bc 30677356525 (.bc 1 (.bc 11504008695 (.bc 1 (.bc 3834669563 (.bc 1 (.bc 1127843987 (.bc 1 (.bc 290017023 (.bc 1 (.bc 64448225 (.bc 1 (.bc 12192905 (.bc 1 (.bc 1925193 (.bc 1 (.bc 246817 (.bc 1 (.bc 24679 (.bc 1 (.bc 1803 (.bc 1 (.bc 83 (.bc 1 (.bc 1 (.bc 1 (.bc 81 (.bc 1 (.bc 1719 (.bc 1 (.bc 22957 (.bc 1 (.bc 223857 (.bc 1 (.bc 1701333 (.bc 1 (.bc 10491569 (.bc 1 (.bc 53956653 (.bc 1 (.bc 236060367 (.bc 1 (.bc 891783617 (.bc 1 (.bc 2942885943 (.bc 1 (.bc 8561122749 (.bc 1 (.bc 22116233773 (.bc 1 (.bc 51037462557 (.bc 1 (.bc 105720458157 (.bc 1 (.bc 197344855229 (.bc 1 (.bc 333019443201 (.bc 1 (.bc 509323854309 (.bc 1 (.bc 707394242097 (.bc 1 (.bc 893550621597 (.bc 1 (.bc 1027583214837 (.bc 1 (.bc 1076515748877 (.bc 1 (.b 20678634832 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 6378124991539 (.bc 1006904580003 (.bc 1 (.bc 893550621597 (.bc 1 (.bc 707394242097 (.bc 1 (.bc 509323854309 (.bc 1 (.b 71889197751 .nil))))))))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 102980848414884006 (.l 51490424207442003 (.l 25745212103721002 (.l 12872606051860501 (.l 6436303025930251 (.l 3218151512965126 (.l 1609075756482563 (.l 804537878241282 (.l 402268939120641 (.l 201134469560321 (.l 100567234780161 (.l 27402957005378 (.l 3610062205468 (.l 1805031102734 (.bc 261130245450 (.bc 1 (.bc 197344855229 (.bc 1 (.bc 105720458157 (.bc 1 (.bc 51037462557 (.bc 1 (.bc 22116233773 (.bc 1 (.bc 8561122749 (.bc 1 (.bc 2942885943 (.bc 1 (.bc 891783617 (.bc 1 (.bc 236060367 (.bc 1 (.bc 53956653 (.bc 1 (.bc 10491569 (.bc 1 (.bc 1701333 (.bc 1 (.bc 223857 (.bc 1 (.bc 22957 (.bc 1 (.bc 1719 (.bc 1 (.bc 81 (.bc 1 (.bc 1 (.bc 1 (.bc 79 (.bc 1 (.bc 1637 (.bc 1 (.bc 21317 (.bc 1 (.bc 202537 (.bc 1 (.bc 1498793 (.bc 1 (.bc 8992773 (.bc 1 (.bc 44963877 (.bc 1 (.bc 191096487 (.bc 1 (.bc 700687127 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 6318923933 (.bc 1 (.bc 15797309837 (.bc 1 (.bc 35240152717 (.bc 1 (.bc 70480305437 (.bc 1 (.b 121441689898 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 10091416297218 (.l 5045708148609 (.bc 5422859890 (.bc 1 (.bc 206154893409 (.bc 1 (.bc 303168960897 (.bc 1 (.bc 404225281197 (.bc 1 (.bc 489325340397 (.bc 1 (.bc 538257874437 (.bc 1 (.bc 538257874437 (.bc 1 (.b 38040989620 .nil))))))))))))))) .nil) .nil)))) (.c (.bc 1 (.l 22880660384700 (.l 11440330192350 (.l 5720165096175 (.bc 451284350777 (.bc 1 (.bc 404225281197 (.bc 1 (.bc 303168960897 (.bc 1 (.bc 206154893409 (.bc 1 (.bc 126864549789 (.bc 1 (.bc 70480305437 (.bc 1 (.bc 35240152717 (.bc 1 (.bc 15797309837 (.bc 1 (.bc 6318923933 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 700687127 (.bc 1 (.bc 191096487 (.bc 1 (.bc 44963877 (.bc 1 (.bc 8992773 (.bc 1 (.bc 1498793 (.bc 1 (.bc 202537 (.bc 1 (.bc 21317 (.bc 1 (.bc 1637 (.bc 1 (.bc 79 (.bc 1 (.bc 1 (.bc 1 (.bc 77 (.bc 1 (.bc 1557 (.bc 1 (.bc 19757 (.bc 1 (.bc 182777 (.bc 1 (.bc 1316013 (.bc 1 (.bc 7676757 (.bc 1 (.bc 37287117 (.bc 1 (.bc 153809367 (.bc 1 (.bc 546877757 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 24066445757 (.bc 1 (.bc 46413859677 (.bc 1 (.bc 80450690109 (.bc 1 (.bc 125704203297 (.bc 1 (.bc 177464757597 (.bc 1 (.bc 226760523597 (.bc 1 (.bc 262564816797 (.bc 1 (.bc 275693057637 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) .nil) .nil)))) .nil) .nil) +def cmd_365 : Cmd := (.l 3278509145862438912 (.l 1639254572931219456 (.l 819627286465609728 (.l 409813643232804864 (.l 204906821616402432 (.l 102453410808201216 (.l 51226705404100608 (.l 25613352702050304 (.l 12806676351025152 (.l 6403338175512576 (.l 3201669087756288 (.l 1600834543878144 (.l 576781548872161 (.l 288390774436080 (.l 144195387218040 (.l 72097693609020 (.l 36048846804510 (.l 18024423402255 (.l 9012211701127 (.l 4506105850563 (.bc 262564816797 (.bc 1 (.bc 226760523597 (.bc 1 (.bc 177464757597 (.bc 1 (.bc 125704203297 (.bc 1 (.bc 80450690109 (.bc 1 (.bc 46413859677 (.bc 1 (.bc 24066445757 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 546877757 (.bc 1 (.bc 153809367 (.bc 1 (.bc 37287117 (.bc 1 (.bc 7676757 (.bc 1 (.bc 1316013 (.bc 1 (.bc 182777 (.bc 1 (.bc 19757 (.bc 1 (.bc 1557 (.bc 1 (.bc 77 (.bc 1 (.bc 1 (.bc 1 (.bc 75 (.bc 1 (.bc 1479 (.bc 1 (.bc 18275 (.bc 1 (.bc 164499 (.bc 1 (.bc 1151511 (.bc 1 (.bc 6525243 (.bc 1 (.bc 30761871 (.bc 1 (.bc 123047493 (.bc 1 (.bc 423830261 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 16244850885 (.bc 1 (.bc 30169008789 (.bc 1 (.bc 50281681317 (.bc 1 (.bc 75422521977 (.bc 1 (.bc 102042235617 (.bc 1 (.bc 124718287977 (.bc 1 (.bc 137846528817 (.bc 1 (.bc 137846528817 (.bc 1 (.bc 124718287977 (.bc 1 (.bc 102042235617 (.bc 1 (.bc 75422521977 (.bc 1 (.bc 50281681317 (.bc 1 (.bc 30169008789 (.bc 1 (.bc 16244850885 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 423830261 (.bc 1 (.bc 123047493 (.bc 1 (.bc 30761871 (.bc 1 (.bc 6525243 (.bc 1 (.bc 1151511 (.bc 1 (.bc 164499 (.bc 1 (.bc 18275 (.bc 1 (.bc 1479 (.bc 1 (.bc 75 (.bc 1 (.bc 1 (.bc 1 (.bc 73 (.bc 1 (.bc 1403 (.bc 1 (.bc 16869 (.bc 1 (.bc 147627 (.bc 1 (.bc 1003881 (.bc 1 (.bc 5521359 (.bc 1 (.bc 25240509 (.bc 1 (.bc 97806981 (.bc 1 (.bc 326023277 (.bc 1 (.bc 945467509 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 30942573117 (.bc 1 (.bc 44479948857 (.bc 1 (.bc 57562286757 (.bc 1 (.b 19499556625 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 223635723066908 (.l 111817861533454 (.l 55908930766727 (.l 27954465383364 (.l 13977232691682 (.l 6988616345841 (.l 3494308172921 (.l 1747154086461 (.bc 47656444592 (.bc 1 (.bc 70690527597 (.bc 1 (.bc 67156001217 (.bc 1 (.bc 57562286757 (.bc 1 (.bc 44479948857 (.bc 1 (.bc 30942573117 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 945467509 (.bc 1 (.bc 326023277 (.bc 1 (.bc 97806981 (.bc 1 (.bc 25240509 (.bc 1 (.bc 5521359 (.bc 1 (.bc 1003881 (.bc 1 (.bc 147627 (.bc 1 (.bc 16869 (.bc 1 (.bc 1403 (.bc 1 (.bc 73 (.bc 1 (.bc 1 (.bc 1 (.bc 71 (.bc 1 (.bc 1329 (.bc 1 (.bc 15537 (.bc 1 (.bc 132087 (.bc 1 (.bc 871791 (.bc 1 (.bc 4649565 (.bc 1 (.bc 20590941 (.bc 1 (.bc 77216037 (.bc 1 (.bc 248807237 (.bc 1 (.bc 696660269 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 25751549337 (.bc 1 (.bc 31810737417 (.bc 1 (.bc 35345263797 (.bc 1 (.bc 35345263797 (.bc 1 (.bc 31810737417 (.bc 1 (.bc 25751549337 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 696660269 (.bc 1 (.bc 248807237 (.bc 1 (.bc 77216037 (.bc 1 (.bc 20590941 (.bc 1 (.bc 4649565 (.bc 1 (.bc 871791 (.bc 1 (.bc 132087 (.bc 1 (.bc 15537 (.bc 1 (.bc 1329 (.bc 1 (.bc 71 (.bc 1 (.bc 1 (.bc 1 (.bc 69 (.bc 1 (.bc 1257 (.bc 1 (.bc 14277 (.bc 1 (.bc 117807 (.bc 1 (.bc 753981 (.bc 1 (.bc 3895581 (.bc 1 (.bc 16695357 (.bc 1 (.bc 60520677 (.bc 1 (.bc 188286557 (.bc 1 (.bc 508373709 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 17194993197 (.bc 1 (.bc 18150270597 (.bc 1 (.bc 17194993197 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 508373709 (.bc 1 (.bc 188286557 (.bc 1 (.bc 60520677 (.bc 1 (.bc 16695357 (.bc 1 (.bc 3895581 (.bc 1 (.bc 753981 (.bc 1 (.bc 117807 (.bc 1 (.bc 14277 (.bc 1 (.bc 1257 (.bc 1 (.bc 69 (.bc 1 (.bc 1 (.bc 1 (.bc 67 (.bc 1 (.bc 1187 (.bc 1 (.bc 13087 (.bc 1 (.bc 104717 (.bc 1 (.bc 649261 (.bc 1 (.bc 3246317 (.bc 1 (.bc 13449037 (.bc 1 (.bc 47071637 (.bc 1 (.bc 141214917 (.bc 1 (.bc 367158789 (.bc 1 (.bc 834451797 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 834451797 (.bc 1 (.bc 367158789 (.bc 1 (.bc 141214917 (.bc 1 (.bc 47071637 (.bc 1 (.bc 13449037 (.bc 1 (.bc 3246317 (.bc 1 (.bc 649261 (.bc 1 (.bc 104717 (.bc 1 (.bc 13087 (.bc 1 (.bc 1187 (.bc 1 (.bc 67 (.bc 1 (.bc 1 (.bc 1 (.bc 65 (.bc 1 (.bc 1119 (.bc 1 (.bc 11965 (.bc 1 (.bc 92749 (.bc 1 (.bc 556509 (.bc 1 (.bc 2689805 (.bc 1 (.bc 10759229 (.bc 1 (.bc 36312405 (.bc 1 (.bc 104902509 (.bc 1 (.bc 262256277 (.bc 1 (.bc 572195517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 4667212437 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 572195517 (.bc 1 (.bc 262256277 (.bc 1 (.bc 104902509 (.bc 1 (.bc 36312405 (.bc 1 (.bc 10759229 (.bc 1 (.bc 2689805 (.bc 1 (.bc 556509 (.bc 1 (.bc 92749 (.bc 1 (.bc 11965 (.bc 1 (.bc 1119 (.bc 1 (.bc 65 (.bc 1 (.bc 1 (.bc 1 (.bc 63 (.bc 1 (.bc 1053 (.bc 1 (.bc 10909 (.bc 1 (.bc 81837 (.bc 1 (.bc 474669 (.bc 1 (.bc 2215133 (.bc 1 (.bc 8544093 (.bc 1 (.bc 27768309 (.bc 1 (.bc 77134197 (.bc 1 (.bc 185122077 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_366 : Cmd := (.l 35642437407866880 (.l 17821218703933440 (.l 8910609351966720 (.l 4455304675983360 (.l 2227652337991680 (.l 1113826168995840 (.l 556913084497920 (.l 278456542248960 (.l 139228271124480 (.l 69614135562240 (.l 34807067781120 (.l 17403533890560 (.l 8701766945280 (.l 4350883472640 (.l 2175441736320 (.l 1087720868160 (.l 543860434080 (.l 271930217040 (.l 135965108520 (.l 67982554260 (.bc 387073437 (.bc 1 (.bc 709634637 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 709634637 (.bc 1 (.bc 387073437 (.bc 1 (.bc 185122077 (.bc 1 (.bc 77134197 (.bc 1 (.bc 27768309 (.bc 1 (.bc 8544093 (.bc 1 (.bc 2215133 (.bc 1 (.bc 474669 (.bc 1 (.bc 81837 (.bc 1 (.bc 10909 (.bc 1 (.bc 1053 (.bc 1 (.bc 63 (.bc 1 (.bc 1 (.bc 1 (.bc 61 (.bc 1 (.bc 989 (.bc 1 (.bc 9917 (.bc 1 (.bc 71917 (.bc 1 (.bc 402749 (.bc 1 (.bc 1812381 (.bc 1 (.bc 6731709 (.bc 1 (.bc 21036597 (.bc 1 (.bc 56097597 (.bc 1 (.bc 129024477 (.bc 1 (.bc 258048957 (.bc 1 (.bc 451585677 (.bc 1 (.bc 694747197 (.bc 1 (.bc 942871197 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 1202160777 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 942871197 (.bc 1 (.bc 694747197 (.bc 1 (.bc 451585677 (.bc 1 (.bc 258048957 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.bc 6731709 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 61 (.bc 1 (.bc 1 (.bc 1 (.bc 59 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 (.bc 1 (.bc 62927 (.bc 1 (.bc 339819 (.bc 1 (.bc 1472559 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.bc 88704327 (.bc 1 (.bc 169344627 (.bc 1 (.bc 282241047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 530365047 (.bc 1 (.bc 601080387 (.bc 1 (.bc 601080387 (.bc 1 (.bc 530365047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 282241047 (.bc 1 (.bc 169344627 (.bc 1 (.bc 88704327 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.bc 11705847 (.bc 1 (.bc 28614297 (.bc 1 (.bc 60090027 (.bc 1 (.bc 109254597 (.bc 1 (.bc 172986447 (.bc 1 (.bc 239519697 (.bc 1 (.bc 290845347 (.bc 1 (.bc 310235037 (.bc 1 (.bc 290845347 (.bc 1 (.bc 239519697 (.bc 1 (.bc 172986447 (.bc 1 (.bc 109254597 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.bc 69194577 (.bc 1 (.bc 103791867 (.bc 1 (.bc 135727827 (.bc 1 (.bc 155117517 (.bc 1 (.bc 155117517 (.bc 1 (.bc 135727827 (.bc 1 (.bc 103791867 (.bc 1 (.bc 69194577 (.bc 1 (.bc 40060017 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.bc 26246217 (.bc 1 (.bc 42948357 (.bc 1 (.bc 60843507 (.bc 1 (.bc 74884317 (.bc 1 (.bc 80233197 (.bc 1 (.bc 74884317 (.bc 1 (.bc 60843507 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.bc 26075787 (.bc 1 (.bc 34767717 (.bc 1 (.bc 40116597 (.bc 1 (.bc 40116597 (.bc 1 (.bc 34767717 (.bc 1 (.bc 26075787 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_367 : Cmd := (.l 70365260808192 (.l 35182630404096 (.l 17591315202048 (.l 8795657601024 (.l 4397828800512 (.l 2198914400256 (.l 1099457200128 (.l 549728600064 (.l 274864300032 (.l 137432150016 (.l 68716075008 (.l 34358037504 (.l 17179018752 (.l 8589509376 (.l 4294754688 (.l 2147377344 (.l 1073688672 (.l 536844336 (.l 268422168 (.l 134211084 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_368 : Cmd := (.l 3481272319 (.l 1740636159 (.l 870318079 (.l 435159039 (.l 217579519 (.l 108789759 (.l 54394879 (.l 27197439 (.l 13598719 (.l 6799359 (.l 3399679 (.l 1699839 (.l 849919 (.l 424959 (.l 212479 (.l 106239 (.l 53119 (.l 26559 (.l 13279 (.l 6639 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 46203812682414755697 (.l 5010163448629921689 (.l 2505081724314960844 (.l 1252540862157480422 (.l 626270431078740211 (.l 313135215539370105 (.l 156567607769685052 (.l 78283803884842526 (.l 39141901942421263 (.l 19570950971210631 (.l 9785475485605315 (.l 4892737742802657 (.l 2446368871401328 (.l 1223184435700664 (.l 611592217850332 (.l 305796108925166 (.l 27556188473903 (.l 13778094236951 (.l 6889047118475 (.l 3444523559237 (.c (.c (.b 1722261779616 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 125341865988677 (.l 62670932994338 (.l 31335466497169 (.bc 4756429292483 (.bc 1 (.b 10911303956098 .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 18091742892577456156 (.l 9045871446288728078 (.l 4522935723144364039 (.l 2261467861572182020 (.l 1130733930786091010 (.l 565366965393045505 (.l 282683482696522752 (.bc 1652704040485396 (.bc 1 (.l 139689037307775977 (.l 69844518653887988 (.l 34922259326943994 (.l 17461129663471997 (.l 1533141207583623 (.l 766570603791811 (.l 383285301895906 (.l 191642650947953 (.l 95821325473976 (.l 47910662736988 (.bc 20245442175149 (.bc 1 (.l 3709889193342 (.bc 1242686354514 (.bc 1 (.b 612258242154 .nil))) .nil))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 3168587014433145 (.l 1584293507216572 (.l 792146753608286 (.l 396073376804143 (.l 177090950254028 (.l 88545475127014 (.l 44272737563507 (.bc 14007415760051 (.bc 1 (.b 8128953021699 .nil))) .nil) .nil) (.c (.bc 1 (.l 20945738148041 (.l 10472869074020 (.l 5236434537010 (.bc 359889947321 (.bc 1 (.b 2258327321181 .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 3320483111630759 (.l 1623118434763125 (.l 811559217381562 (.l 405779608690781 (.l 202889804345391 (.l 101444902172696 (.l 7592825472537 (.bc 2251370506110 (.bc 1 (.b 1545042230155 .nil))) (.c (.bc 1 (.l 36107057767547 (.bc 641477928528 (.bc 1 (.bc 964641246477 (.bc 1 (.bc 385856498589 (.bc 1 (.bc 139337068933 (.bc 1 (.bc 45190400733 (.bc 1 (.bc 13081431789 (.bc 1 (.bc 3354213277 (.bc 1 (.bc 754697985 (.bc 1 (.bc 147258141 (.bc 1 (.bc 24543021 (.bc 1 (.bc 3424605 (.bc 1 (.bc 389157 (.bc 1 (.bc 34589 (.bc 1 (.bc 2253 (.bc 1 (.bc 93 (.bc 1 (.bc 1 (.bc 1 (.bc 91 (.bc 1 (.bc 2159 (.bc 1 (.bc 32427 (.bc 1 (.bc 356727 (.bc 1 (.bc 3067875 (.bc 1 (.bc 21475143 (.bc 1 (.bc 125782995 (.bc 1 (.bc 628914987 (.bc 1 (.bc 2725298287 (.bc 1 (.bc 10356133499 (.bc 1 (.bc 34834267231 (.bc 1 (.bc 104502801699 (.bc 1 (.bc 281353696887 (.bc 1 (.bc 683287549587 (.bc 1 (.bc 1503232609095 (.bc 1 (.bc 3006465218193 (.bc 1 (.bc 5482377750825 (.bc 1 (.b 4749744787796 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.b 7022567846258 .nil))))))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 37123121052251 .nil)))) (.c (.bc 1 (.l 708353498088462 (.l 354176749044231 (.l 177088374522116 (.l 88544187261058 (.l 9588783226335 (.l 4794391613167 (.l 2397195806583 (.bc 296218774009 (.bc 1 (.b 902379129280 .nil))) .nil) .nil) (.c (.bc 1 (.b 34683310404191 .nil)))) .nil) .nil) .nil) .nil)))))))))) .nil) .nil) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 18091742892577456156 (.l 9045871446288728078 (.l 4522935723144364039 (.l 933344459875180725 (.l 466672229937590362 (.l 233336114968795181 (.l 116668057484397591 (.l 58334028742198796 (.l 29167014371099398 (.l 14583507185549699 (.l 7291753592774850 (.l 3645876796387425 (.l 1822938398193713 (.l 911469199096856 (.l 244150292093513 (.l 122075146046756 (.l 61037573023378 (.l 30518786511689 (.bc 444069995524 (.bc 1 (.bc 9847379391147 (.bc 1 (.bc 4501659150237 (.bc 1 (.b 466284718927 .nil))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 211584307454912 (.l 105792153727456 (.l 33514248552017 (.l 16757124276008 (.bc 1409406593669 (.bc 1 (.bc 709721037197 (.bc 1 (.l 242799302197 (.bc 19346168414 (.bc 1 (.b 102053482681 .nil))) (.c (.bc 1 (.bc 74707477597 (.bc 1 (.bc 20544556337 (.bc 1 (.bc 5010867397 (.bc 1 (.bc 1073757297 (.bc 1 (.bc 199768797 (.bc 1 (.bc 31781397 (.bc 1 (.bc 4237517 (.bc 1 (.bc 460597 (.bc 1 (.bc 39197 (.bc 1 (.bc 2447 (.bc 1 (.bc 97 (.bc 1 (.bc 1 (.bc 1 (.bc 95 (.bc 1 (.bc 2349 (.bc 1 (.bc 36845 (.bc 1 (.bc 423749 (.bc 1 (.bc 3813765 (.bc 1 (.bc 27967629 (.bc 1 (.bc 171801165 (.bc 1 (.bc 901956129 (.bc 1 (.bc 4108911265 (.bc 1 (.bc 16435645069 (.bc 1 (.bc 58271832525 (.bc 1 (.bc 184527469669 (.bc 1 (.bc 525193567525 (.bc 1 (.bc 1350497745069 (.bc 1 (.bc 3151161405165 (.bc 1 (.b 623759678160 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.b 19381828311708 .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1328123401697001292 (.l 664061700848500646 (.l 332030850424250323 (.l 166015425212125162 (.l 83007712606062581 (.l 41503856303031290 (.l 20751928151515645 (.l 10375964075757822 (.l 5187982037878911 (.l 2128564815928634 (.l 1064282407964317 (.l 532141203982158 (.l 153041805502171 (.l 45235742605279 (.l 22617871302639 (.bc 1227001229891 (.bc 1 (.b 10081934421425 .nil))) .nil) (.c (.bc 1 (.l 29689192533907 (.l 14844596266953 (.bc 2916606374889 (.bc 1 (.b 4505691758585 .nil))) .nil) (.c (.bc 1 (.b 1595967611893 .nil))))))) (.c (.bc 1 (.l 113028796488905 (.l 10904995459062 (.bc 17973606158 (.bc 1 (.b 5434524123370 .nil))) (.c (.bc 1 (.bc 4809464884697 (.bc 1 (.bc 1690144083737 (.bc 1 (.bc 565206319857 (.bc 1 (.bc 273254963797 (.bc 1 (.bc 451757012977 (.bc 1 (.bc 1278890346297 (.bc 1 (.bc 3539705334617 (.bc 1 (.bc 8963071098797 (.bc 1 (.l 20726434919187 (.l 10363217459593 (.l 5181608729796 (.bc 367185702227 (.bc 1 (.b 2223618662668 .nil))) .nil) .nil) (.c (.bc 1 (.b 3311473821397 .nil))))))))))))))))))))))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 465426203010818 (.l 232713101505409 (.l 116356550752705 (.l 58178275376353 (.l 29089137688177 (.l 14544568844089 (.bc 4075233748557 (.bc 1 (.b 3197050673485 .nil))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))))) +def cmd_372 : Cmd := (.l 367049887433759838756 (.l 155484037014777823977 (.l 56782602376307044032 (.l 14513375628091881505 (.l 7256687814045940752 (.l 3628343907022970376 (.l 598449089579671839 (.l 299224544789835919 (.l 149612272394917959 (.l 74806136197458980 (.l 37403068098729490 (.l 18701534049364745 (.l 4962584568187858 (.l 2481292284093929 (.l 1240646142046964 (.l 620323071023482 (.l 310161535511741 (.bc 11490570944633 (.bc 1 (.bc 85343955308947 (.bc 1 (.l 58246241502284 (.l 29123120751142 (.bc 10297687558284 (.bc 1 (.l 4263872817284 (.bc 1576664512634 (.bc 1 (.b 555271896005 .nil))) .nil))) .nil) .nil))))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 4388182456494512 (.l 2194091228247256 (.l 1097045614123628 (.l 548522807061814 (.l 274261403530907 (.bc 94474519628365 (.bc 1 (.b 42656182137086 .nil))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1215722863931813346 (.l 607861431965906673 (.l 303930715982953337 (.l 151965357991476669 (.l 47783875852460050 (.l 23891937926230025 (.l 11945968963115012 (.l 1997807747975260 (.l 998903873987630 (.l 499451936993815 (.l 249725968496907 (.l 124862984248453 (.l 62431492124226 (.bc 18008506434101 (.bc 1 (.l 13207239628009 (.bc 2966932554710 (.bc 1 (.b 3636687259291 .nil))) .nil))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 3975176733582243 (.l 1987588366791121 (.l 993794183395561 (.l 496897091697780 (.bc 84470089405483 (.bc 1 (.l 163978456443404 (.l 81989228221702 (.l 40994614110851 (.bc 18052155248120 (.bc 1 (.b 2445151807303 .nil))) .nil) .nil) .nil))) .nil) .nil) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 28198803143278282 (.l 14099401571639141 (.l 7049700785819571 (.l 3524850392909786 (.l 1762425196454893 (.l 881212598227446 (.l 440606299113723 (.l 220005171424539 (.l 110002585712269 (.bc 2780461342613 (.bc 1 (.b 52220831513518 .nil))) .nil) (.c (.bc 1 (.b 297978132319 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 13877925560061640508 (.l 6938962780030820254 (.l 2722572901983341655 (.l 1361286450991670827 (.l 680643225495835414 (.bc 2455251832555765 (.bc 1 (.l 337866360915361939 (.l 168933180457680969 (.l 84466590228840484 (.l 13810786201874490 (.l 6905393100937245 (.l 3102507959021503 (.l 1551253979510751 (.l 775626989755376 (.l 387813494877688 (.l 193906747438844 (.l 7823957132452 (.l 3911978566226 (.bc 1665131464254 (.bc 1 (.b 290857818856 .nil))) .nil) (.c (.bc 1 (.l 89129416586967 (.bc 41993635049657 (.bc 1 (.b 2571073243823 .nil))) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 350188591447117 .nil)))) .nil) (.c (.bc 1 (.l 28422508912545749 (.l 12880357085277369 (.l 6440178542638684 (.l 1842180429566358 (.l 921090214783179 (.l 421281863624623 (.l 210640931812311 (.l 105320465906156 (.l 52660232953078 (.bc 4358735052170 (.bc 1 (.b 21971381424366 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.b 39263243766964 .nil)))) .nil) (.c (.bc 1 (.l 1377908841752981 (.l 688954420876490 (.l 344477210438245 (.l 89908359300455 (.l 44954179650227 (.l 22477089825114 (.bc 678185015040 (.bc 1 (.b 10560359897514 .nil))) .nil) .nil) (.c (.bc 1 (.l 82330245918665 (.l 41165122959332 (.l 20582561479666 (.bc 8964599460694 (.bc 1 (.b 1326681279136 .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 1330897370995502 (.l 665448685497751 (.l 332724342748875 (.l 166362171374437 (.l 83181085687219 (.l 41590542843609 (.l 20795271421805 (.bc 8016153920931 (.bc 1 (.b 2381481789968 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil)))) .nil) .nil) .nil))) .nil) .nil) (.c (.bc 1 (.l 746908488032068469 (.l 373454244016034234 (.l 186727122008017117 (.l 93363561004008559 (.l 46681780502004280 (.l 23340890251002140 (.l 11670445125501070 (.l 5835222562750535 (.l 2917611281375267 (.l 1458805640687634 (.l 586544183263585 (.l 293272091631792 (.l 146636045815896 (.l 73318022907948 (.l 36659011453974 (.bc 7420900406990 (.bc 1 (.bc 9137296251377 (.bc 1 (.b 1771309068614 .nil))))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 142858637080229 (.l 71429318540114 (.l 35714659270057 (.l 17857329635029 (.l 8928664817515 (.bc 3711068682211 (.bc 1 (.b 753263726543 .nil))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 20959416131081867953 (.l 10479708065540933976 (.l 5239854032770466988 (.l 2619927016385233494 (.l 1309963508192616747 (.l 654981754096308373 (.l 327490877048154186 (.l 163745438524077093 (.l 81872719262038547 (.l 40936359631019273 (.l 20468179815509637 (.l 4691513755540043 (.l 2345756877770021 (.l 1172878438885011 (.l 586439219442506 (.l 293219609721253 (.l 45884813311867 (.l 22942406655933 (.bc 2253201491650 (.bc 1 (.bc 1503232609095 (.bc 1 (.bc 683287549587 (.bc 1 (.bc 281353696887 (.bc 1 (.bc 104502801699 (.bc 1 (.bc 34834267231 (.bc 1 (.bc 10356133499 (.bc 1 (.bc 2725298287 (.bc 1 (.bc 628914987 (.bc 1 (.bc 125782995 (.bc 1 (.bc 21475143 (.bc 1 (.bc 3067875 (.bc 1 (.bc 356727 (.bc 1 (.bc 32427 (.bc 1 (.bc 2159 (.bc 1 (.bc 91 (.bc 1 (.bc 1 (.bc 1 (.bc 89 (.bc 1 (.bc 2067 (.bc 1 (.bc 30357 (.bc 1 (.bc 326367 (.bc 1 (.bc 2741505 (.bc 1 (.bc 18733635 (.bc 1 (.bc 107049357 (.bc 1 (.bc 521865627 (.bc 1 (.bc 2203432657 (.bc 1 (.bc 8152700839 (.bc 1 (.bc 26681566389 (.bc 1 (.bc 77821235307 (.bc 1 (.bc 203532461577 (.bc 1 (.bc 479755088007 (.bc 1 (.bc 1023477521085 (.bc 1 (.bc 1982987697105 (.bc 1 (.b 2791667395558 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 100724991548756 (.l 50362495774378 (.bc 707722658158 (.bc 1 (.bc 5637906197657 (.bc 1 (.bc 8308493343917 (.bc 1 (.b 10527125687448 .nil))))))) .nil) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 5542576152214773 (.l 2771288076107386 (.l 1385644038053693 (.l 692822019026847 (.l 106249556345716 (.l 53124778172858 (.l 5136545945979 (.bc 689340326841 (.bc 1 (.b 1878932646145 .nil))) (.c (.bc 1 (.b 21425843140447 .nil)))) .nil) (.c (.bc 1 (.l 240161453167705 (.l 120080726583852 (.l 60040363291926 (.bc 1295198944178 (.bc 1 (.bc 15780742227897 (.bc 1 (.b 12944240473882 .nil))))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 28040906702102095398 (.l 14020453351051047699 (.l 7010226675525523850 (.l 2224230222831364918 (.l 1112115111415682459 (.l 556057555707841230 (.bc 22041039082819012 (.bc 1 (.l 255987738771101600 (.l 127993869385550800 (.l 63996934692775400 (.l 31998467346387700 (.l 15999233673193850 (.l 678898918802113 (.l 339449459401056 (.l 169724729700528 (.l 84862364850264 (.l 17926874009468 (.l 8963437004734 (.l 4481718502367 (.l 2240859251183 (.bc 832064452651 (.bc 1 (.b 288365172938 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.b 24504308415661 .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 7320717917794809 (.l 3660358958897404 (.l 1830179479448702 (.l 915089739724351 (.l 457544869862175 (.l 228772434931088 (.l 98285619233988 (.l 34259389144905 (.bc 13960857778980 (.bc 1 (.b 3168836793469 .nil))) (.c (.bc 1 (.b 14883420472086 .nil)))) (.c (.bc 1 (.l 16100598231553 (.l 8050299115776 (.bc 3276506131034 (.bc 1 (.b 748643426851 .nil))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil))) .nil) .nil) (.c (.bc 1 (.l 1280883114931397004 (.l 640441557465698502 (.l 320220778732849251 (.l 160110389366424625 (.l 80055194683212313 (.bc 16570255312928777 (.bc 1 (.l 23457342028677376 (.l 11728671014338688 (.l 5864335507169344 (.l 2932167753584672 (.l 1466083876792336 (.l 733041938396168 (.l 366520969198084 (.l 183260484599042 (.l 91630242299521 (.l 45815121149760 (.l 22907560574880 (.bc 2376877610422 (.bc 1 (.bc 8308493343917 (.bc 1 (.b 768409333095 .nil))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 28040906702102095398 (.l 14020453351051047699 (.l 7010226675525523849 (.l 3505113337762761925 (.l 1752556668881380963 (.l 876278334440690481 (.l 438139167220345240 (.l 219069583610172620 (.l 109534791805086310 (.l 54767395902543155 (.l 27383697951271577 (.l 13691848975635788 (.l 5999714210630940 (.l 2999857105315470 (.l 1499928552657735 (.l 749964276328868 (.l 374982138164434 (.l 184738230407874 (.l 92369115203937 (.l 46184557601969 (.bc 4869496864562 (.bc 1 (.bc 3499390053717 (.bc 1 (.bc 1982987697105 (.bc 1 (.bc 1023477521085 (.bc 1 (.bc 479755088007 (.bc 1 (.bc 203532461577 (.bc 1 (.bc 77821235307 (.bc 1 (.bc 26681566389 (.bc 1 (.bc 8152700839 (.bc 1 (.bc 2203432657 (.bc 1 (.bc 521865627 (.bc 1 (.bc 107049357 (.bc 1 (.bc 18733635 (.bc 1 (.bc 2741505 (.bc 1 (.bc 326367 (.bc 1 (.bc 30357 (.bc 1 (.bc 2067 (.bc 1 (.bc 89 (.bc 1 (.bc 1 (.bc 1 (.bc 87 (.bc 1 (.bc 1977 (.bc 1 (.bc 28377 (.bc 1 (.bc 297987 (.bc 1 (.bc 2443515 (.bc 1 (.bc 16290117 (.bc 1 (.bc 90759237 (.bc 1 (.bc 431106387 (.bc 1 (.bc 1772326267 (.bc 1 (.bc 6380374569 (.bc 1 (.bc 20301191817 (.bc 1 (.bc 57520043487 (.bc 1 (.bc 146012418087 (.bc 1 (.bc 333742669917 (.bc 1 (.bc 689734851165 (.bc 1 (.bc 1293252845937 (.bc 1 (.bc 2206137207777 (.bc 1 (.bc 3431768989877 (.bc 1 (.b 2730965584039 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) (.c (.bc 1 (.b 2752838674340 .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 846210277186951 (.l 423105138593475 (.l 211552569296738 (.l 105776284648369 (.l 52888142324185 (.l 26444071162092 (.l 13222035581046 (.l 6611017790523 (.bc 1801653935705 (.bc 1 (.b 1503854959554 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) +def cmd_376 : Cmd := (.l 259985444268867932439 (.l 129992722134433966220 (.l 64996361067216983110 (.l 32498180533608491555 (.l 9184830522759767649 (.l 4592415261379883824 (.l 2296207630689941912 (.l 1148103815344970956 (.l 574051907672485478 (.l 287025953836242739 (.l 143512976918121370 (.l 71756488459060685 (.l 17707201902090679 (.l 8853600951045339 (.l 4053792846218519 (.l 1349044519129596 (.l 674522259564798 (.l 337261129782399 (.l 168630564891200 (.l 84315282445600 (.bc 1179758456991 (.bc 1 (.l 40977882765806 (.bc 4246007472198 (.bc 1 (.bc 7547311500297 (.bc 1 (.bc 8233430727597 (.bc 1 (.b 462191682802 .nil))))))) .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 677851903979660 (.l 338925951989830 (.bc 1128158064690 (.bc 1 (.l 168334817930222 (.l 84167408965111 (.bc 26310131281492 (.bc 1 (.l 15773573201061 (.l 7886786600530 (.bc 1123196345378 (.bc 1 (.b 2820196954884 .nil))) .nil) .nil))) .nil) .nil))) .nil) .nil)))) (.c (.bc 1 (.b 373007629304148 .nil)))) .nil) (.c (.bc 1 (.l 18171042327439661 (.l 1579943350151865 (.l 789971675075932 (.l 394985837537966 (.l 197492918768983 (.l 98746459384491 (.l 49373229692246 (.l 24686614846123 (.l 12343307423062 (.bc 1812992441475 (.bc 1 (.b 4358661270053 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 7483745765829297 (.l 3741872882914648 (.l 1870936441457324 (.l 548399326494222 (.l 274199663247111 (.l 137099831623555 (.l 68549915811778 (.l 19067486700240 (.bc 1981080390196 (.bc 1 (.bc 4876724354037 (.bc 1 (.b 2675938605881 .nil))))) (.c (.bc 1 (.l 15207471205646 (.bc 755830383994 (.bc 1 (.bc 2206137207777 (.bc 1 (.bc 1293252845937 (.bc 1 (.bc 689734851165 (.bc 1 (.bc 333742669917 (.bc 1 (.bc 146012418087 (.bc 1 (.bc 57520043487 (.bc 1 (.bc 20301191817 (.bc 1 (.bc 6380374569 (.bc 1 (.bc 1772326267 (.bc 1 (.bc 431106387 (.bc 1 (.bc 90759237 (.bc 1 (.bc 16290117 (.bc 1 (.bc 2443515 (.bc 1 (.bc 297987 (.bc 1 (.bc 28377 (.bc 1 (.bc 1977 (.bc 1 (.bc 87 (.bc 1 (.bc 1 (.bc 1 (.bc 85 (.bc 1 (.bc 1889 (.bc 1 (.bc 26485 (.bc 1 (.bc 271499 (.bc 1 (.bc 2172013 (.bc 1 (.bc 14118101 (.bc 1 (.bc 76641133 (.bc 1 (.bc 354465251 (.bc 1 (.bc 1417861013 (.bc 1 (.bc 4962513553 (.bc 1 (.bc 15338678261 (.bc 1 (.bc 42181365223 (.bc 1 (.bc 103831052861 (.bc 1 (.bc 229911617053 (.bc 1 (.bc 459823234109 (.bc 1 (.bc 833429611825 (.bc 1 (.b 401166731662 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 387068894234437 (.l 193534447117218 (.l 96767223558609 (.l 48383611779305 (.l 24191805889652 (.bc 971540864287 (.bc 1 (.bc 2059061393925 (.bc 1 (.bc 2817662960109 (.bc 1 (.bc 3522078700137 (.bc 1 (.b 2725559026356 .nil))))))))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.b 21832047738662 .nil))))))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 7064259744044478126 (.l 3532129872022239063 (.l 1766064936011119532 (.l 249955923526388965 (.l 124977961763194482 (.l 62488980881597241 (.l 31244490440798620 (.l 11245536786030779 (.l 5622768393015389 (.l 2811384196507695 (.l 1405692098253847 (.l 702846049126923 (.l 351423024563461 (.l 175711512281731 (.l 87855756140865 (.l 43927878070432 (.l 21963939035216 (.bc 1214392337322 (.bc 1 (.bc 4208197927437 (.bc 1 (.bc 4025232800157 (.bc 1 (.b 1534146452683 .nil))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 4376708434368528 (.l 2188354217184264 (.l 1094177108592132 (.l 547088554296066 (.l 273544277148033 (.l 136772138574016 (.l 68386069287008 (.l 34193034643504 (.l 15594108743147 (.l 7797054371573 (.bc 1987932247454 (.bc 1 (.b 1910594938330 .nil))) .nil) (.c (.bc 1 (.b 1502408578602 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 633076544479170798 (.l 316538272239585399 (.l 158269136119792700 (.l 79134568059896350 (.l 39567284029948175 (.l 19783642014974088 (.l 2561676773225417 (.l 1280838386612708 (.l 640419193306354 (.l 320209596653177 (.l 13779474639434 (.l 6889737319717 (.l 3444868659859 (.l 1722434329929 (.bc 531465877128 (.bc 1 (.b 329751287834 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 146325323687152 (.l 73162661843576 (.l 36581330921788 (.l 6295365438566 (.bc 1729310106091 (.bc 1 (.bc 1372707595949 (.bc 1 (.b 45665017237 .nil))))) (.c (.bc 1 (.l 11995300022325 (.bc 787764594586 (.bc 1 (.bc 459823234109 (.bc 1 (.bc 229911617053 (.bc 1 (.bc 103831052861 (.bc 1 (.bc 42181365223 (.bc 1 (.bc 15338678261 (.bc 1 (.bc 4962513553 (.bc 1 (.bc 1417861013 (.bc 1 (.bc 354465251 (.bc 1 (.bc 76641133 (.bc 1 (.bc 14118101 (.bc 1 (.bc 2172013 (.bc 1 (.bc 271499 (.bc 1 (.bc 26485 (.bc 1 (.bc 1889 (.bc 1 (.bc 85 (.bc 1 (.bc 1 (.bc 1 (.bc 83 (.bc 1 (.bc 1803 (.bc 1 (.bc 24679 (.bc 1 (.bc 246817 (.bc 1 (.bc 1925193 (.bc 1 (.bc 12192905 (.bc 1 (.bc 64448225 (.bc 1 (.bc 290017023 (.bc 1 (.bc 1127843987 (.bc 1 (.bc 3834669563 (.bc 1 (.bc 11504008695 (.bc 1 (.bc 30677356525 (.bc 1 (.bc 73153696333 (.bc 1 (.bc 156757920717 (.bc 1 (.bc 303065313389 (.bc 1 (.bc 530364298433 (.bc 1 (.bc 842343297513 (.bc 1 (.bc 1216718096409 (.bc 1 (.b 1182056039649 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 7330144234261624 (.l 3665072117130812 (.l 1832536058565406 (.l 916268029282703 (.l 458134014641352 (.l 163206693881393 (.l 81603346940696 (.l 40801673470348 (.bc 418888824048 (.bc 1 (.bc 1921133836437 (.bc 1 (.bc 2104098963717 (.bc 1 (.bc 2104098963717 (.bc 1 (.bc 1921133836437 (.bc 1 (.bc 1600944863697 (.bc 1 (.bc 1216718096409 (.bc 1 (.bc 842343297513 (.bc 1 (.bc 530364298433 (.bc 1 (.bc 303065313389 (.bc 1 (.bc 156757920717 (.bc 1 (.bc 73153696333 (.bc 1 (.bc 30677356525 (.bc 1 (.bc 11504008695 (.bc 1 (.bc 3834669563 (.bc 1 (.bc 1127843987 (.bc 1 (.bc 290017023 (.bc 1 (.bc 64448225 (.bc 1 (.bc 12192905 (.bc 1 (.bc 1925193 (.bc 1 (.bc 246817 (.bc 1 (.bc 24679 (.bc 1 (.bc 1803 (.bc 1 (.bc 83 (.bc 1 (.bc 1 (.bc 1 (.bc 81 (.bc 1 (.bc 1719 (.bc 1 (.bc 22957 (.bc 1 (.bc 223857 (.bc 1 (.bc 1701333 (.bc 1 (.bc 10491569 (.bc 1 (.bc 53956653 (.bc 1 (.bc 236060367 (.bc 1 (.bc 891783617 (.bc 1 (.bc 2942885943 (.bc 1 (.bc 8561122749 (.bc 1 (.bc 22116233773 (.bc 1 (.bc 51037462557 (.bc 1 (.bc 105720458157 (.bc 1 (.bc 197344855229 (.bc 1 (.bc 333019443201 (.bc 1 (.bc 509323854309 (.bc 1 (.bc 707394242097 (.bc 1 (.bc 893550621597 (.bc 1 (.bc 1027583214837 (.bc 1 (.bc 1076515748877 (.bc 1 (.bc 1027583214837 (.bc 1 (.bc 893550621597 (.bc 1 (.b 303183866771 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) (.c (.bc 1 (.l 65860313439280 (.l 31938356153369 (.l 3758081200075 (.bc 404210375325 (.bc 1 (.bc 509323854309 (.bc 1 (.bc 333019443201 (.bc 1 (.bc 197344855229 (.bc 1 (.bc 105720458157 (.bc 1 (.bc 51037462557 (.bc 1 (.bc 22116233773 (.bc 1 (.bc 8561122749 (.bc 1 (.bc 2942885943 (.bc 1 (.bc 891783617 (.bc 1 (.bc 236060367 (.bc 1 (.bc 53956653 (.bc 1 (.bc 10491569 (.bc 1 (.bc 1701333 (.bc 1 (.bc 223857 (.bc 1 (.bc 22957 (.bc 1 (.bc 1719 (.bc 1 (.bc 81 (.bc 1 (.bc 1 (.bc 1 (.bc 79 (.bc 1 (.bc 1637 (.bc 1 (.bc 21317 (.bc 1 (.bc 202537 (.bc 1 (.bc 1498793 (.bc 1 (.bc 8992773 (.bc 1 (.bc 44963877 (.bc 1 (.bc 191096487 (.bc 1 (.bc 700687127 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 6318923933 (.bc 1 (.bc 15797309837 (.bc 1 (.bc 35240152717 (.bc 1 (.bc 70480305437 (.bc 1 (.b 112543311177 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 12211096876606 (.bc 14321238610 (.bc 1 (.bc 206154893409 (.bc 1 (.bc 303168960897 (.bc 1 (.bc 404225281197 (.bc 1 (.bc 489325340397 (.bc 1 (.bc 538257874437 (.bc 1 (.bc 538257874437 (.bc 1 (.bc 489325340397 (.bc 1 (.bc 404225281197 (.bc 1 (.bc 303168960897 (.bc 1 (.bc 206154893409 (.bc 1 (.bc 126864549789 (.bc 1 (.bc 70480305437 (.bc 1 (.bc 35240152717 (.bc 1 (.bc 15797309837 (.bc 1 (.bc 6318923933 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 700687127 (.bc 1 (.bc 191096487 (.bc 1 (.bc 44963877 (.bc 1 (.bc 8992773 (.bc 1 (.bc 1498793 (.bc 1 (.bc 202537 (.bc 1 (.bc 21317 (.bc 1 (.bc 1637 (.bc 1 (.bc 79 (.bc 1 (.bc 1 (.bc 1 (.bc 77 (.bc 1 (.bc 1557 (.bc 1 (.bc 19757 (.bc 1 (.bc 182777 (.bc 1 (.bc 1316013 (.bc 1 (.bc 7676757 (.bc 1 (.bc 37287117 (.bc 1 (.bc 153809367 (.bc 1 (.bc 546877757 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 24066445757 (.bc 1 (.bc 46413859677 (.bc 1 (.bc 80450690109 (.bc 1 (.bc 125704203297 (.bc 1 (.bc 177464757597 (.bc 1 (.bc 226760523597 (.bc 1 (.bc 262564816797 (.bc 1 (.bc 275693057637 (.bc 1 (.bc 262564816797 (.bc 1 (.bc 226760523597 (.bc 1 (.bc 177464757597 (.bc 1 (.b 46923339190 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) (.c (.bc 1 (.l 991800566268 (.l 495900283134 (.bc 78780864106 (.bc 1 (.bc 80450690109 (.bc 1 (.bc 46413859677 (.bc 1 (.bc 24066445757 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 546877757 (.bc 1 (.bc 153809367 (.bc 1 (.bc 37287117 (.bc 1 (.bc 7676757 (.bc 1 .nil)))))))))))))))))))))) .nil) .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) +def cmd_377 : Cmd := (.l 4575636653418217472 (.l 2287818326709108736 (.l 1143909163354554368 (.l 571954581677277184 (.l 285977290838638592 (.l 142988645419319296 (.l 71494322709659648 (.l 35747161354829824 (.l 17873580677414912 (.l 8936790338707456 (.l 4468395169353728 (.l 2234197584676864 (.l 1117098792338432 (.l 558549396169216 (.l 279274698084608 (.l 139637349042304 (.l 69818674521152 (.l 34909337260576 (.l 17454668630288 (.l 8727334315144 (.l 4363667157572 (.bc 1316013 (.bc 1 (.bc 182777 (.bc 1 (.bc 19757 (.bc 1 (.bc 1557 (.bc 1 (.bc 77 (.bc 1 (.bc 1 (.bc 1 (.bc 75 (.bc 1 (.bc 1479 (.bc 1 (.bc 18275 (.bc 1 (.bc 164499 (.bc 1 (.bc 1151511 (.bc 1 (.bc 6525243 (.bc 1 (.bc 30761871 (.bc 1 (.bc 123047493 (.bc 1 (.bc 423830261 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 16244850885 (.bc 1 (.bc 30169008789 (.bc 1 (.bc 50281681317 (.bc 1 (.bc 75422521977 (.bc 1 (.bc 102042235617 (.bc 1 (.bc 124718287977 (.bc 1 (.bc 137846528817 (.bc 1 (.bc 137846528817 (.bc 1 (.bc 124718287977 (.bc 1 (.bc 102042235617 (.bc 1 (.bc 75422521977 (.bc 1 (.bc 50281681317 (.bc 1 (.bc 30169008789 (.bc 1 (.bc 16244850885 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 423830261 (.bc 1 (.bc 123047493 (.bc 1 (.bc 30761871 (.bc 1 (.bc 6525243 (.bc 1 (.bc 1151511 (.bc 1 (.bc 164499 (.bc 1 (.bc 18275 (.bc 1 (.bc 1479 (.bc 1 (.bc 75 (.bc 1 (.bc 1 (.bc 1 (.bc 73 (.bc 1 (.bc 1403 (.bc 1 (.bc 16869 (.bc 1 (.bc 147627 (.bc 1 (.bc 1003881 (.bc 1 (.bc 5521359 (.bc 1 (.bc 25240509 (.bc 1 (.bc 97806981 (.bc 1 (.bc 326023277 (.bc 1 (.bc 945467509 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 30942573117 (.bc 1 (.bc 44479948857 (.bc 1 (.bc 57562286757 (.bc 1 (.bc 67156001217 (.bc 1 (.bc 70690527597 (.bc 1 (.bc 67156001217 (.bc 1 (.bc 57562286757 (.bc 1 (.bc 44479948857 (.bc 1 (.bc 30942573117 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 945467509 (.bc 1 (.bc 326023277 (.bc 1 (.bc 97806981 (.bc 1 (.bc 25240509 (.bc 1 (.bc 5521359 (.bc 1 (.bc 1003881 (.bc 1 (.bc 147627 (.bc 1 (.bc 16869 (.bc 1 (.bc 1403 (.bc 1 (.bc 73 (.bc 1 (.bc 1 (.bc 1 (.bc 71 (.bc 1 (.bc 1329 (.bc 1 (.bc 15537 (.bc 1 (.bc 132087 (.bc 1 (.bc 871791 (.bc 1 (.bc 4649565 (.bc 1 (.bc 20590941 (.bc 1 (.bc 77216037 (.bc 1 (.bc 248807237 (.bc 1 (.bc 696660269 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 25751549337 (.bc 1 (.bc 31810737417 (.bc 1 (.bc 35345263797 (.bc 1 (.bc 35345263797 (.bc 1 (.bc 31810737417 (.bc 1 (.bc 25751549337 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 696660269 (.bc 1 (.bc 248807237 (.bc 1 (.bc 77216037 (.bc 1 (.bc 20590941 (.bc 1 (.bc 4649565 (.bc 1 (.bc 871791 (.bc 1 (.bc 132087 (.bc 1 (.bc 15537 (.bc 1 (.bc 1329 (.bc 1 (.bc 71 (.bc 1 (.bc 1 (.bc 1 (.bc 69 (.bc 1 (.bc 1257 (.bc 1 (.bc 14277 (.bc 1 (.bc 117807 (.bc 1 (.bc 753981 (.bc 1 (.bc 3895581 (.bc 1 (.bc 16695357 (.bc 1 (.bc 60520677 (.bc 1 (.bc 188286557 (.bc 1 (.bc 508373709 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 17194993197 (.bc 1 (.bc 18150270597 (.bc 1 (.bc 17194993197 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 508373709 (.bc 1 (.bc 188286557 (.bc 1 (.bc 60520677 (.bc 1 (.bc 16695357 (.bc 1 (.bc 3895581 (.bc 1 (.bc 753981 (.bc 1 (.bc 117807 (.bc 1 (.bc 14277 (.bc 1 (.bc 1257 (.bc 1 (.bc 69 (.bc 1 (.bc 1 (.bc 1 (.bc 67 (.bc 1 (.bc 1187 (.bc 1 (.bc 13087 (.bc 1 (.bc 104717 (.bc 1 (.bc 649261 (.bc 1 (.bc 3246317 (.bc 1 (.bc 13449037 (.bc 1 (.bc 47071637 (.bc 1 (.bc 141214917 (.bc 1 (.bc 367158789 (.bc 1 (.bc 834451797 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 834451797 (.bc 1 (.bc 367158789 (.bc 1 (.bc 141214917 (.bc 1 (.bc 47071637 (.bc 1 (.bc 13449037 (.bc 1 (.bc 3246317 (.bc 1 (.bc 649261 (.bc 1 (.bc 104717 (.bc 1 (.bc 13087 (.bc 1 (.bc 1187 (.bc 1 (.bc 67 (.bc 1 (.bc 1 (.bc 1 (.bc 65 (.bc 1 (.bc 1119 (.bc 1 (.bc 11965 (.bc 1 (.bc 92749 (.bc 1 (.bc 556509 (.bc 1 (.bc 2689805 (.bc 1 (.bc 10759229 (.bc 1 (.bc 36312405 (.bc 1 (.bc 104902509 (.bc 1 (.bc 262256277 (.bc 1 (.bc 572195517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 4667212437 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 572195517 (.bc 1 (.bc 262256277 (.bc 1 (.bc 104902509 (.bc 1 (.bc 36312405 (.bc 1 (.bc 10759229 (.bc 1 (.bc 2689805 (.bc 1 (.bc 556509 (.bc 1 (.bc 92749 (.bc 1 (.bc 11965 (.bc 1 (.bc 1119 (.bc 1 (.bc 65 (.bc 1 (.bc 1 (.bc 1 (.bc 63 (.bc 1 (.bc 1053 (.bc 1 (.bc 10909 (.bc 1 (.bc 81837 (.bc 1 (.bc 474669 (.bc 1 (.bc 2215133 (.bc 1 (.bc 8544093 (.bc 1 (.bc 27768309 (.bc 1 (.bc 77134197 (.bc 1 (.bc 185122077 (.bc 1 (.bc 387073437 (.bc 1 (.bc 709634637 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 709634637 (.bc 1 (.bc 387073437 (.bc 1 (.bc 185122077 (.bc 1 (.bc 77134197 (.bc 1 (.bc 27768309 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_378 : Cmd := (.l 35971366695993344 (.l 17985683347996672 (.l 8992841673998336 (.l 4496420836999168 (.l 2248210418499584 (.l 1124105209249792 (.l 562052604624896 (.l 281026302312448 (.l 140513151156224 (.l 70256575578112 (.l 35128287789056 (.l 17564143894528 (.l 8782071947264 (.l 4391035973632 (.l 2195517986816 (.l 1097758993408 (.l 548879496704 (.l 274439748352 (.l 137219874176 (.l 68609937088 (.l 34304968544 (.bc 8544093 (.bc 1 (.bc 2215133 (.bc 1 (.bc 474669 (.bc 1 (.bc 81837 (.bc 1 (.bc 10909 (.bc 1 (.bc 1053 (.bc 1 (.bc 63 (.bc 1 (.bc 1 (.bc 1 (.bc 61 (.bc 1 (.bc 989 (.bc 1 (.bc 9917 (.bc 1 (.bc 71917 (.bc 1 (.bc 402749 (.bc 1 (.bc 1812381 (.bc 1 (.bc 6731709 (.bc 1 (.bc 21036597 (.bc 1 (.bc 56097597 (.bc 1 (.bc 129024477 (.bc 1 (.bc 258048957 (.bc 1 (.bc 451585677 (.bc 1 (.bc 694747197 (.bc 1 (.bc 942871197 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 1202160777 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 942871197 (.bc 1 (.bc 694747197 (.bc 1 (.bc 451585677 (.bc 1 (.bc 258048957 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.bc 6731709 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 61 (.bc 1 (.bc 1 (.bc 1 (.bc 59 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 (.bc 1 (.bc 62927 (.bc 1 (.bc 339819 (.bc 1 (.bc 1472559 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.bc 88704327 (.bc 1 (.bc 169344627 (.bc 1 (.bc 282241047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 530365047 (.bc 1 (.bc 601080387 (.bc 1 (.bc 601080387 (.bc 1 (.bc 530365047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 282241047 (.bc 1 (.bc 169344627 (.bc 1 (.bc 88704327 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.bc 11705847 (.bc 1 (.bc 28614297 (.bc 1 (.bc 60090027 (.bc 1 (.bc 109254597 (.bc 1 (.bc 172986447 (.bc 1 (.bc 239519697 (.bc 1 (.bc 290845347 (.bc 1 (.bc 310235037 (.bc 1 (.bc 290845347 (.bc 1 (.bc 239519697 (.bc 1 (.bc 172986447 (.bc 1 (.bc 109254597 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.bc 69194577 (.bc 1 (.bc 103791867 (.bc 1 (.bc 135727827 (.bc 1 (.bc 155117517 (.bc 1 (.bc 155117517 (.bc 1 (.bc 135727827 (.bc 1 (.bc 103791867 (.bc 1 (.bc 69194577 (.bc 1 (.bc 40060017 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.bc 26246217 (.bc 1 (.bc 42948357 (.bc 1 (.bc 60843507 (.bc 1 (.bc 74884317 (.bc 1 (.bc 80233197 (.bc 1 (.bc 74884317 (.bc 1 (.bc 60843507 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.bc 26075787 (.bc 1 (.bc 34767717 (.bc 1 (.bc 40116597 (.bc 1 (.bc 40116597 (.bc 1 (.bc 34767717 (.bc 1 (.bc 26075787 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_379 : Cmd := (.l 81184256163840 (.l 40592128081920 (.l 20296064040960 (.l 10148032020480 (.l 5074016010240 (.l 2537008005120 (.l 1268504002560 (.l 634252001280 (.l 317126000640 (.l 158563000320 (.l 79281500160 (.l 39640750080 (.l 19820375040 (.l 9910187520 (.l 4955093760 (.l 2477546880 (.l 1238773440 (.l 619386720 (.l 309693360 (.l 154846680 (.l 77423340 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_380 : Cmd := (.l 2134900735 (.l 1067450367 (.l 533725183 (.l 266862591 (.l 133431295 (.l 66715647 (.l 33357823 (.l 16678911 (.l 8339455 (.l 4169727 (.l 2084863 (.l 1042431 (.l 521215 (.l 260607 (.l 130303 (.l 65151 (.l 32575 (.l 16287 (.l 8143 (.l 4071 (.l 2035 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 445570900988023918913 (.l 182778673589848588669 (.l 61331723700285562789 (.l 10557412565028689091 (.l 5278706282514344545 (.l 2639353141257172272 (.l 1319676570628586136 (.l 659838285314293068 (.l 329919142657146534 (.l 164959571328573267 (.l 82479785664286633 (.l 41239892832143316 (.l 20619946416071658 (.l 87245246988971 (.l 43622623494485 (.l 21811311747242 (.l 10905655873621 (.l 3130997985689 (.l 1565498992844 (.l 782749496422 (.l 391374748211 (.c (.c (.b 195687374103 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.b 2321829951118 .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 10222727961046855 (.l 5111363980523427 (.l 2555681990261714 (.l 1277840995130857 (.l 364978017879771 (.l 182489008939885 (.l 85767837880493 (.bc 19916719591830 (.bc 1 (.b 22967199348413 .nil))) (.c (.bc 1 (.l 5476666589447 (.bc 141317622814 (.bc 1 (.b 2597015671906 .nil))) .nil)))) .nil) (.c (.bc 1 (.l 193852702896577 (.l 96926351448288 (.l 48463175724144 (.bc 10401525124408 (.bc 1 (.bc 6696217985979 (.bc 1 (.bc 3151161405165 (.bc 1 (.bc 1350497745069 (.bc 1 (.bc 525193567525 (.bc 1 (.bc 184527469669 (.bc 1 (.bc 58271832525 (.bc 1 (.bc 16435645069 (.bc 1 (.bc 4108911265 (.bc 1 (.bc 901956129 (.bc 1 (.bc 171801165 (.bc 1 (.bc 27967629 (.bc 1 (.bc 3813765 (.bc 1 (.bc 423749 (.bc 1 (.bc 36845 (.bc 1 (.bc 2349 (.bc 1 (.bc 95 (.bc 1 (.bc 1 (.bc 1 (.bc 93 (.bc 1 (.bc 2253 (.bc 1 (.bc 34589 (.bc 1 (.bc 389157 (.bc 1 (.bc 3424605 (.bc 1 (.bc 24543021 (.bc 1 (.bc 147258141 (.bc 1 (.bc 754697985 (.bc 1 (.bc 3354213277 (.bc 1 (.bc 13081431789 (.bc 1 (.bc 45190400733 (.bc 1 (.bc 139337068933 (.bc 1 (.bc 385856498589 (.bc 1 (.bc 964641246477 (.bc 1 (.b 290150963933 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) (.c (.bc 1 (.l 80089776789075 (.l 40044888394537 (.bc 1861974236254 (.bc 1 (.l 18160469961011 (.bc 965382076623 (.bc 1 (.bc 4509697827291 (.bc 1 (.b 3605155076585 .nil))))) .nil))) .nil) .nil))))))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 20108449285114092300 (.l 10054224642557046150 (.l 5027112321278523075 (.l 1905857013661061707 (.l 952928506830530853 (.l 476464253415265426 (.l 70755880734019074 (.l 35377940367009537 (.l 17688970183504769 (.l 8844485091752384 (.l 1575746214491222 (.l 787873107245611 (.l 393936553622805 (.l 196968276811403 (.bc 14216986661822 (.bc 1 (.l 42190155604867 (.l 21095077802433 (.l 7827421546979 (.bc 3106564559707 (.bc 1 (.b 807146213779 .nil))) (.c (.bc 1 (.b 2720117354234 .nil)))) .nil) (.c (.bc 1 (.bc 17310427955657 (.bc 1 (.bc 6499608968437 (.bc 1 (.bc 2255350403597 (.bc 1 (.bc 838461283657 (.bc 1 (.bc 725011976777 (.bc 1 (.bc 1730647359277 (.bc 1 (.bc 4818595680917 (.bc 1 (.b 7898892510666 .nil)))))))))))))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 2846496331384967 (.l 1423248165692483 (.l 711624082846242 (.l 355812041423121 (.l 4603883922751 (.l 2301941961375 (.bc 1109672152400 (.bc 1 (.b 41298828284 .nil))) .nil) (.c (.bc 1 (.l 29689506017987 (.l 14844753008993 (.bc 6336051634552 (.bc 1 (.b 1086324869942 .nil))) .nil) (.c (.bc 1 (.l 64617617373397 (.l 32308808686698 (.bc 1499087479854 (.bc 1 (.bc 952520339397 (.bc 1 (.bc 317506779797 (.bc 1 (.bc 95252033937 (.bc 1 (.bc 25555423737 (.bc 1 (.bc 6084624697 (.bc 1 (.bc 1273526097 (.bc 1 (.bc 231550197 (.bc 1 (.bc 36018917 (.bc 1 (.bc 4698117 (.bc 1 (.bc 499797 (.bc 1 (.bc 41647 (.bc 1 (.bc 2547 (.bc 1 (.bc 99 (.bc 1 (.bc 1 (.bc 1 (.bc 97 (.bc 1 (.bc 2447 (.bc 1 (.bc 39197 (.bc 1 (.bc 460597 (.bc 1 (.bc 4237517 (.bc 1 (.bc 31781397 (.bc 1 (.bc 199768797 (.bc 1 (.bc 1073757297 (.bc 1 (.bc 5010867397 (.bc 1 (.bc 20544556337 (.bc 1 (.bc 74707477597 (.bc 1 (.bc 242799302197 (.bc 1 (.bc 709721037197 (.bc 1 (.l 1875691312597 (.bc 930347697841 (.bc 1 (.b 7497958454 .nil))) (.c (.bc 1 (.bc 4501659150237 (.bc 1 (.b 5825407573516 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 78995013397417 (.l 39497506698708 (.bc 4021971817630 (.bc 1 (.b 15726781531721 .nil))) .nil) .nil)))))))))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 167476245973613636 (.l 83738122986806818 (.l 41869061493403409 (.l 20934530746701704 (.l 10467265373350852 (.l 4981519102528847 (.l 2490759551264423 (.l 1245379775632212 (.l 50240124365740 (.l 25120062182870 (.bc 3967977250576 (.bc 1 (.b 8592053840856 .nil))) .nil) (.c (.bc 1 (.l 238064716439599 (.l 119032358219799 (.l 27515003926690 (.bc 1758272252228 (.bc 1 (.b 11999229711114 .nil))) (.c (.bc 1 (.b 32001175183206 .nil)))) .nil) (.c (.bc 1 (.l 334385047010761 (.l 167192523505380 (.l 28810711583190 (.bc 5471541597070 (.bc 1 (.b 8933814194522 .nil))) (.c (.bc 1 (.b 54785550169497 .nil)))) .nil) .nil))))))) .nil) .nil) (.c (.bc 1 (.b 252113584146576 .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 607699146978199828 (.l 303849573489099914 (.l 151924786744549957 (.l 75962393372274979 (.l 37981196686137489 (.l 18990598343068744 (.l 6623481308140748 (.l 3311740654070374 (.l 1655870327035187 (.l 827935163517593 (.l 413967581758796 (.l 38810771892592 (.l 19405385946296 (.l 9702692973148 (.bc 4362614501490 (.bc 1 (.b 488731985081 .nil))) .nil) .nil) (.c (.bc 1 (.l 168173018986803 (.l 84086509493401 (.bc 21891631840690 (.bc 1 (.b 20151622906007 .nil))) .nil) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 2871817863393621 (.l 1192376809801972 (.l 596188404900986 (.l 298094202450493 (.l 149047101225246 (.l 74523550612623 (.bc 17408873584293 (.bc 1 (.b 19852901722015 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 243532121894835 .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 30057613094638731542 (.l 15028806547319365771 (.l 7514403273659682885 (.l 3757201636829841442 (.l 1878600818414920721 (.l 939300409207460360 (.l 469650204603730180 (.l 234825102301865090 (.l 117412551150932545 (.l 58706275575466273 (.l 29353137787733137 (.l 14676568893866569 (.l 7338284446933285 (.l 1084797342832157 (.bc 243471314667534 (.bc 1 (.l 298927356748541 (.l 149463678374270 (.l 74731839187135 (.l 37365919593568 (.bc 6825959509259 (.bc 1 (.b 11857000287522 .nil))) .nil) .nil) .nil) .nil))) (.c (.bc 1 (.l 2584344880634483 (.l 1292172440317241 (.l 106856220733075 (.l 53428110366537 (.bc 24267358234817 (.bc 1 (.b 2446696948449 .nil))) .nil) (.c (.bc 1 (.l 539229999425543 (.l 269614999712771 (.l 134807499856385 (.bc 36701371192392 (.bc 1 (.b 30702378735797 .nil))) .nil) .nil) .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 40006776904163370784 (.l 20003388452081685392 (.l 10001694226040842696 (.l 5000847113020421348 (.l 2500423556510210674 (.l 1250211778255105337 (.l 625105889127552668 (.l 312552944563776334 (.l 156276472281888167 (.l 78138236140944084 (.l 39069118070472042 (.l 19534559035236021 (.l 9767279517618010 (.l 4883639758809005 (.l 2441819879404502 (.l 1220909939702251 (.l 385821467710722 (.l 192910733855361 (.bc 40245433724362 (.bc 1 (.l 56209933203316 (.bc 13670111768217 (.bc 1 (.b 14434854833438 .nil))) .nil))) .nil) (.c (.bc 1 (.b 224633502140400 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 40006776904163370784 (.l 20003388452081685392 (.l 10001694226040842696 (.l 5000847113020421348 (.l 2500423556510210674 (.bc 224395049768374689 (.bc 1 (.l 1025816728486730645 (.l 512908364243365322 (.l 256454182121682661 (.l 128227091060841331 (.l 64113545530420666 (.l 32056772765210333 (.l 16028386382605167 (.l 8014193191302583 (.bc 180278865242639 (.bc 1 (.l 3826817730408649 (.l 1913408865204324 (.l 956704432602162 (.l 478352216301081 (.l 239176108150540 (.l 119588054075270 (.l 59794027037635 (.bc 11144934373683 (.bc 1 (.b 18752079145131 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil))) .nil) .nil) .nil) .nil) .nil)))))) +def cmd_384 : Cmd := (.l 1400946947346013737154 (.l 650772135978453239621 (.l 287650600496734266240 (.l 118055702957936054936 (.l 42356451152093812873 (.l 10737348974225143633 (.l 5368674487112571816 (.l 2684337243556285908 (.l 1342168621778142954 (.l 124359105877754469 (.l 62179552938877234 (.l 9717173691668981 (.l 4858586845834490 (.l 2429293422917245 (.l 1214646711458623 (.l 607323355729312 (.l 303661677864656 (.l 151830838932328 (.l 75915419466164 (.bc 11155073898998 (.bc 1 (.b 26802635834081 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 21372602777769633 (.l 10686301388884816 (.l 5343150694442408 (.l 2671575347221204 (.l 1335787673610602 (.l 667893836805301 (.l 333946918402650 (.l 166973459201325 (.l 83486729600663 (.bc 8432471894849 (.bc 1 (.b 33310892905480 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 546725205011317005 (.l 273362602505658502 (.l 136681301252829251 (.l 17035629713519169 (.l 3025798449233887 (.l 1512899224616943 (.l 756449612308472 (.l 378224806154236 (.l 189112403077118 (.l 94556201538559 (.l 47278100769279 (.l 23639050384639 (.bc 5658125584725 (.bc 1 (.b 6161399607591 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 5492016407525694 .nil)))) (.c (.bc 1 (.l 51305020912895453 (.l 25652510456447726 (.l 12826255228223863 (.l 6413127614111931 (.l 3206563807055965 (.l 536573204620617 (.l 207876919176329 (.l 103938459588164 (.l 51969229794082 (.bc 17013889833564 (.bc 1 (.b 8970725063474 .nil))) .nil) .nil) (.c (.bc 1 (.b 60409683133976 .nil)))) (.c (.bc 1 (.l 1066708698907362 (.l 533354349453681 (.l 266677174726840 (.l 76169348021105 (.bc 16949423444567 (.bc 1 (.b 21135250565982 .nil))) (.c (.bc 1 (.l 57169239342312 (.bc 1948445226973 (.bc 1 (.bc 14619674002205 (.bc 1 (.bc 8488842969021 (.bc 1 (.b 3527657472948 .nil))))))) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 10440876601821762800 (.l 5220438300910881400 (.l 2610219150455440700 (.l 1305109575227720350 (.l 652554787613860175 (.l 326277393806930088 (.l 163138696903465044 (.l 81569348451732522 (.l 16181336071548981 (.l 8090668035774490 (.l 287862630992878 (.l 143931315496439 (.l 71965657748220 (.l 35982828874110 (.l 17991414437055 (.l 8995707218527 (.bc 982040354343 (.bc 1 (.bc 2186520158685 (.bc 1 (.bc 964641246477 (.bc 1 (.b 364651849749 .nil))))))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 3757471386894364 (.l 1878735693447182 (.l 939367846723591 (.l 469683923361796 (.l 190577851173534 (.l 95288925586767 (.bc 21204648840 (.bc 1 (.bc 139337068933 (.bc 1 (.bc 45190400733 (.bc 1 (.bc 13081431789 (.bc 1 (.bc 3354213277 (.bc 1 (.bc 754697985 (.bc 1 (.bc 147258141 (.bc 1 (.bc 24543021 (.bc 1 (.bc 3424605 (.bc 1 (.bc 389157 (.bc 1 (.bc 34589 (.bc 1 (.bc 2253 (.bc 1 (.bc 93 (.bc 1 (.bc 1 (.bc 1 (.bc 91 (.bc 1 (.bc 2159 (.bc 1 (.bc 32427 (.bc 1 (.bc 356727 (.bc 1 (.bc 3067875 (.bc 1 (.bc 21475143 (.bc 1 (.bc 125782995 (.bc 1 (.bc 628914987 (.bc 1 (.bc 2725298287 (.bc 1 (.bc 10356133499 (.bc 1 (.bc 34834267231 (.bc 1 (.bc 104502801699 (.bc 1 (.bc 281353696887 (.bc 1 (.bc 683287549587 (.bc 1 (.bc 1503232609095 (.bc 1 (.bc 3006465218193 (.bc 1 (.bc 5482377750825 (.bc 1 (.bc 9137296251377 (.bc 1 (.bc 13946399541577 (.bc 1 (.b 13227753929207 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 44264110507361 (.l 22132055253680 (.bc 6297205429001 (.bc 1 (.b 4768822197836 .nil))) .nil) .nil)))) .nil) .nil) .nil) .nil)))) .nil) (.c (.bc 1 (.l 24603338154317277 (.bc 2041326105192376 (.bc 1 (.l 10260342971966259 (.l 5130171485983129 (.l 746969189039282 (.l 373484594519641 (.l 186742297259821 (.l 93371148629910 (.l 37339565080582 (.bc 4386836780190 (.bc 1 (.b 14282945760098 .nil))) (.c (.bc 1 (.b 9346009234370 .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 1818116553952280 (.l 909058276976140 (.l 144754660321487 (.l 72377330160743 (.l 36188665080371 (.bc 10711845011164 (.bc 1 (.b 7382487529019 .nil))) .nil) .nil) (.c (.bc 1 (.l 309774478166580 (.l 154887239083290 (.l 77443619541645 (.bc 24865116154078 (.bc 1 (.b 13856693616742 .nil))) .nil) .nil) .nil)))) .nil) .nil)))) .nil) .nil))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 16671400326874214592 (.l 8335700163437107296 (.l 4167850081718553648 (.l 2083925040859276824 (.l 190800742299470108 (.l 95400371149735054 (.l 47700185574867527 (.l 23850092787433763 (.l 11925046393716882 (.l 5000298220193402 (.l 2500149110096701 (.l 1250074555048351 (.l 625037277524175 (.bc 117133479822631 (.bc 1 (.l 195385158939453 (.l 97692579469726 (.l 48846289734863 (.l 24423144867432 (.bc 11070067577441 (.bc 1 (.b 1141504856272 .nil))) .nil) .nil) .nil) .nil))) .nil) .nil) .nil) (.c (.bc 1 (.b 962224976665036 .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 851161778130168301 (.l 425580889065084150 (.l 212790444532542075 (.l 106395222266271037 (.l 53197611133135519 (.l 17801275367548421 (.l 8900637683774210 (.l 4450318841887105 (.l 2225159420943553 (.l 1112579710471777 (.l 556289855235888 (.l 183884965795715 (.l 73536813740752 (.bc 24767599217079 (.bc 1 (.b 12000807653294 .nil))) (.c (.bc 1 (.b 18405669157102 .nil)))) (.c (.bc 1 (.l 94259961822226 (.l 47129980911113 (.bc 3899876942993 (.bc 1 (.bc 19524959358209 (.bc 1 (.b 140154154348 .nil))))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 8797530199019336 (.l 4398765099509668 (.l 2199382549754834 (.l 1099691274877417 (.l 549845637438708 (.l 274922818719354 (.l 137461409359677 (.l 68730704679838 (.bc 13806245387229 (.bc 1 (.bc 9137296251377 (.bc 1 (.bc 5482377750825 (.bc 1 (.bc 3006465218193 (.bc 1 (.bc 1503232609095 (.bc 1 (.bc 683287549587 (.bc 1 (.bc 281353696887 (.bc 1 (.bc 104502801699 (.bc 1 (.bc 34834267231 (.bc 1 (.bc 10356133499 (.bc 1 (.bc 2725298287 (.bc 1 (.bc 628914987 (.bc 1 (.bc 125782995 (.bc 1 (.bc 21475143 (.bc 1 (.bc 3067875 (.bc 1 (.bc 356727 (.bc 1 (.bc 32427 (.bc 1 (.bc 2159 (.bc 1 (.bc 91 (.bc 1 (.bc 1 (.bc 1 (.bc 89 (.bc 1 (.bc 2067 (.bc 1 (.bc 30357 (.bc 1 (.bc 326367 (.bc 1 (.bc 2741505 (.bc 1 (.bc 18733635 (.bc 1 (.bc 107049357 (.bc 1 (.bc 521865627 (.bc 1 (.bc 2203432657 (.bc 1 (.bc 8152700839 (.bc 1 (.bc 26681566389 (.bc 1 (.bc 77821235307 (.bc 1 (.b 196386059313 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 25769597290431078181 (.l 12884798645215539090 (.l 6442399322607769545 (.l 3221199661303884773 (.l 1610599830651942386 (.l 805299915325971193 (.l 402649957662985597 (.l 89342748766852900 (.l 44671374383426450 (.l 22335687191713225 (.l 5175285692873871 (.l 2587642846436935 (.l 1293821423218467 (.l 646910711609234 (.l 323455355804617 (.l 161727677902309 (.l 80863838951154 (.l 40431919475577 (.bc 7146402264 (.bc 1 (.bc 479755088007 (.bc 1 (.bc 1023477521085 (.bc 1 (.bc 1982987697105 (.bc 1 (.bc 3499390053717 (.bc 1 (.bc 5637906197657 (.bc 1 (.b 7585296777936 .nil))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 5992557902982738 (.l 2996278951491369 (.l 1498139475745685 (.l 749069737872843 (.l 360302327682629 (.l 180151163841314 (.l 90075581920657 (.l 41388232507565 (.bc 723196565981 (.bc 1 (.bc 11216466014289 (.bc 1 (.b 8754453673506 .nil))))) (.c (.bc 1 (.b 3649558452761 .nil)))) .nil) .nil) (.c (.bc 1 (.b 14232541253790 .nil)))) .nil) .nil) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 111982230064639895 (.l 55991115032319947 (.l 23393499615332389 (.l 8476852046922742 (.l 4238426023461371 (.l 2119213011730685 (.l 1059606505865342 (.l 529803252932671 (.l 131561209421933 (.l 65780604710966 (.l 32890302355483 (.bc 2418286432299 (.bc 1 (.b 14026864745440 .nil))) .nil) .nil) (.c (.bc 1 (.l 133340417044399 (.l 66670208522199 (.l 33335104261100 (.bc 1753877482457 (.bc 1 (.b 14913674648090 .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 3219897760743449 (.l 1609948880371724 (.l 804974440185862 (.l 402487220092931 (.l 201243610046466 (.l 100621805023233 (.bc 2398098667987 (.bc 1 (.l 47912803843627 (.l 23956401921813 (.bc 953662140109 (.bc 1 (.b 11024538820794 .nil))) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 4602057900827581 (.l 2301028950413790 (.l 1150514475206895 (.l 575257237603447 (.l 287628618801724 (.l 143814309400862 (.l 71907154700431 (.l 35953577350215 (.l 17976788675108 (.bc 4756203407103 (.bc 1 (.b 4232190930448 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 37735467492492353567 (.l 18867733746246176783 (.l 9433866873123088392 (.l 4716933436561544196 (.l 2358466718280772098 (.l 922965323608846304 (.l 461482661804423152 (.l 230741330902211576 (.l 115370665451105788 (.l 57685332725552894 (.l 28842666362776447 (.l 14257887288222410 (.l 5184998717750322 (.l 2592499358875161 (.l 1296249679437580 (.l 648124839718790 (.l 324062419859395 (.l 162031209929698 (.l 62713357872212 (.bc 9654862230101 (.bc 1 (.bc 11216466014289 (.bc 1 (.bc 8308493343917 (.bc 1 (.b 2176857347790 .nil))))))) (.c (.bc 1 (.l 18302247092634 (.bc 3461048849865 (.bc 1 (.bc 3499390053717 (.bc 1 (.bc 1982987697105 (.bc 1 (.b 207696945621 .nil))))))) .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 1943944926360880 (.l 971972463180440 (.l 485986231590220 (.l 146239079907456 (.l 73119539953728 (.l 36559769976864 (.l 18279884988432 (.bc 815780575464 (.bc 1 (.bc 479755088007 (.bc 1 (.bc 203532461577 (.bc 1 (.bc 77821235307 (.bc 1 (.bc 26681566389 (.bc 1 (.bc 8152700839 (.bc 1 (.bc 2203432657 (.bc 1 (.bc 521865627 (.bc 1 (.bc 107049357 (.bc 1 (.bc 18733635 (.bc 1 (.bc 2741505 (.bc 1 (.bc 326367 (.bc 1 (.bc 30357 (.bc 1 (.bc 2067 (.bc 1 (.bc 89 (.bc 1 (.bc 1 (.bc 1 (.bc 87 (.bc 1 (.bc 1977 (.bc 1 (.bc 28377 (.bc 1 (.bc 297987 (.bc 1 (.bc 2443515 (.bc 1 (.bc 16290117 (.bc 1 (.bc 90759237 (.bc 1 (.bc 431106387 (.bc 1 (.bc 1772326267 (.bc 1 (.bc 6380374569 (.bc 1 (.bc 20301191817 (.bc 1 (.bc 57520043487 (.bc 1 (.bc 146012418087 (.bc 1 (.bc 333742669917 (.bc 1 (.bc 689734851165 (.bc 1 (.bc 1293252845937 (.bc 1 (.bc 2206137207777 (.bc 1 (.b 2769969828165 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 96754035887651 (.l 48377017943825 (.l 24188508971912 (.l 12094254485956 (.bc 661799161712 (.bc 1 (.bc 4876724354037 (.bc 1 (.b 508603727223 .nil))))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.b 163445893165811 .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 256268035531539742 (.l 128134017765769871 (.l 64067008882884935 (.l 32033504441442467 (.l 16016752220721233 (.l 8008376110360616 (.l 4004188055180308 (.l 2002094027590154 (.l 1001047013795077 (.l 500523506897538 (.l 250261753448769 (.l 125130876724385 (.l 62565438362193 (.l 31282719181097 (.bc 5192677412847 (.bc 1 (.bc 7547311500297 (.bc 1 (.b 2901370677398 .nil))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 49701337694553628953 (.l 24850668847276814476 (.l 12425334423638407238 (.l 6212667211819203619 (.l 3106333605909601810 (.l 1553166802954800905 (.l 776583401477400453 (.l 388291700738700226 (.l 194145850369350113 (.l 97072925184675057 (.l 48536462592337529 (.l 24268231296168765 (.l 12134115648084383 (.l 6067057824042192 (.l 1120946844549230 (.l 560473422274615 (.l 280236711137307 (.l 140118355568653 (.bc 12218477352611 (.bc 1 (.l 57840700431712 (.l 28920350215856 (.bc 2277440712045 (.bc 1 (.bc 8233430727597 (.bc 1 (.b 3949303668280 .nil))))) .nil) .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 1912582067471863 (.l 956291033735931 (.l 372606711760429 (.l 186303355880214 (.l 93151677940107 (.l 18389276444957 (.bc 3598007832017 (.bc 1 (.b 5596630390458 .nil))) (.c (.bc 1 (.l 28186562525094 (.bc 743111269789 (.bc 1 (.bc 4876724354037 (.bc 1 (.bc 3431768989877 (.bc 1 (.bc 2206137207777 (.bc 1 (.bc 1293252845937 (.bc 1 (.bc 689734851165 (.bc 1 (.bc 333742669917 (.bc 1 (.bc 146012418087 (.bc 1 (.bc 57520043487 (.bc 1 (.bc 20301191817 (.bc 1 (.bc 6380374569 (.bc 1 (.bc 1772326267 (.bc 1 (.bc 431106387 (.bc 1 (.bc 90759237 (.bc 1 (.bc 16290117 (.bc 1 (.bc 2443515 (.bc 1 (.bc 297987 (.bc 1 (.bc 28377 (.bc 1 (.bc 1977 (.bc 1 (.bc 87 (.bc 1 (.bc 1 (.bc 1 (.bc 85 (.bc 1 (.bc 1889 (.bc 1 (.bc 26485 (.bc 1 (.bc 271499 (.bc 1 (.bc 2172013 (.bc 1 (.bc 14118101 (.bc 1 (.bc 76641133 (.bc 1 (.bc 354465251 (.bc 1 (.bc 1417861013 (.bc 1 (.bc 4962513553 (.bc 1 (.bc 15338678261 (.bc 1 (.bc 42181365223 (.bc 1 (.bc 103831052861 (.bc 1 (.b 118102624667 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 105538805107534 (.l 52769402553767 (.l 26384701276883 (.l 13192350638442 (.bc 111808992386 (.bc 1 (.bc 459823234109 (.bc 1 (.bc 833429611825 (.bc 1 (.bc 1372707595949 (.bc 1 (.bc 2059061393925 (.bc 1 (.b 1759344491012 .nil))))))))))) .nil) .nil) .nil) .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 49701337694553628953 (.l 24850668847276814476 (.l 12425334423638407238 (.l 6212667211819203619 (.l 3106333605909601809 (.l 1553166802954800905 (.l 776583401477400452 (.l 388291700738700226 (.l 194145850369350113 (.l 97072925184675057 (.l 48536462592337528 (.l 24268231296168764 (.l 12134115648084382 (.l 6067057824042191 (.l 3033528912021095 (.l 1516764456010548 (.l 438957242785569 (.l 219478621392784 (.l 109739310696392 (.l 54869655348196 (.l 27434827674098 (.bc 1058318469097 (.bc 1 (.bc 3522078700137 (.bc 1 (.bc 4025232800157 (.bc 1 (.bc 4208197927437 (.bc 1 (.b 903585940209 .nil))))))))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 319424985219702 (.l 159712492609851 (.l 79856246304925 (.l 19742520791366 (.l 9871260395683 (.bc 3121646859948 (.bc 1 (.b 1813983337890 .nil))) .nil) (.c (.bc 1 (.l 20185602361093 (.l 10092801180546 (.bc 1708095362246 (.bc 1 (.bc 2817662960109 (.bc 1 (.b 520642267912 .nil))))) .nil) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) +def cmd_388 : Cmd := (.l 162282397761632647845 (.l 81141198880816323923 (.l 40570599440408161962 (.l 20285299720204080981 (.l 10142649860102040491 (.l 5071324930051020246 (.l 2535662465025510123 (.l 1267831232512755062 (.l 633915616256377531 (.l 316957808128188766 (.l 158478904064094383 (.l 79239452032047192 (.bc 913538020122705 (.bc 1 (.l 38706187995900888 (.l 19353093997950444 (.l 7019161418642877 (.l 3509580709321438 (.l 1754790354660719 (.l 877395177330359 (.l 62148600052881 (.l 31074300026440 (.l 15537150013220 (.l 3696368128499 (.bc 646292153236 (.bc 1 (.b 1201891911010 .nil))) (.c (.bc 1 (.l 4072206878108 (.bc 170815684937 (.bc 1 (.bc 833429611825 (.bc 1 (.bc 459823234109 (.bc 1 (.bc 229911617053 (.bc 1 (.bc 103831052861 (.bc 1 (.bc 42181365223 (.bc 1 (.bc 15338678261 (.bc 1 (.bc 4962513553 (.bc 1 (.bc 1417861013 (.bc 1 (.bc 354465251 (.bc 1 (.bc 76641133 (.bc 1 (.bc 14118101 (.bc 1 (.bc 2172013 (.bc 1 (.bc 271499 (.bc 1 (.bc 26485 (.bc 1 (.bc 1889 (.bc 1 (.bc 85 (.bc 1 (.bc 1 (.bc 1 (.bc 83 (.bc 1 (.bc 1803 (.bc 1 (.bc 24679 (.bc 1 (.bc 246817 (.bc 1 (.bc 1925193 (.bc 1 (.bc 12192905 (.bc 1 (.bc 64448225 (.bc 1 (.bc 290017023 (.bc 1 (.bc 1127843987 (.bc 1 (.bc 3834669563 (.bc 1 (.bc 11504008695 (.bc 1 (.bc 30677356525 (.bc 1 (.bc 73153696333 (.bc 1 (.b 53277691838 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 288159466347477 (.l 144079733173738 (.l 72039866586869 (.l 36019933293435 (.bc 103480228879 (.bc 1 (.bc 303065313389 (.bc 1 (.bc 530364298433 (.bc 1 (.bc 842343297513 (.bc 1 (.bc 1216718096409 (.bc 1 (.bc 1600944863697 (.bc 1 (.bc 1921133836437 (.bc 1 (.bc 2104098963717 (.bc 1 (.bc 2104098963717 (.bc 1 (.bc 1921133836437 (.bc 1 (.bc 1600944863697 (.bc 1 (.bc 1216718096409 (.bc 1 (.bc 842343297513 (.bc 1 (.bc 530364298433 (.bc 1 (.bc 303065313389 (.bc 1 (.bc 156757920717 (.bc 1 (.bc 73153696333 (.bc 1 (.bc 30677356525 (.bc 1 (.bc 11504008695 (.bc 1 (.bc 3834669563 (.bc 1 (.bc 1127843987 (.bc 1 (.bc 290017023 (.bc 1 (.bc 64448225 (.bc 1 (.bc 12192905 (.bc 1 (.bc 1925193 (.bc 1 (.bc 246817 (.bc 1 (.bc 24679 (.bc 1 (.bc 1803 (.bc 1 (.bc 83 (.bc 1 (.bc 1 (.bc 1 (.bc 81 (.bc 1 (.bc 1719 (.bc 1 (.bc 22957 (.bc 1 (.bc 223857 (.bc 1 (.bc 1701333 (.bc 1 (.bc 10491569 (.bc 1 (.bc 53956653 (.bc 1 (.bc 236060367 (.bc 1 (.bc 891783617 (.bc 1 (.bc 2942885943 (.bc 1 (.bc 8561122749 (.bc 1 (.bc 22116233773 (.bc 1 (.bc 51037462557 (.bc 1 (.bc 105720458157 (.bc 1 (.bc 197344855229 (.bc 1 (.b 202807465403 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 88389522264816 (.l 44194761132408 (.l 22097380566204 (.l 11048690283102 (.bc 130211977798 (.bc 1 (.bc 509323854309 (.bc 1 (.bc 707394242097 (.bc 1 (.bc 893550621597 (.bc 1 (.bc 1027583214837 (.bc 1 (.bc 1076515748877 (.bc 1 (.bc 1027583214837 (.bc 1 (.b 152182267178 .nil))))))))))))))) .nil) .nil) .nil) .nil))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 2657385580332342 (.l 1328692790166171 (.l 664346395083086 (.l 332173197541543 (.l 48107396790951 (.l 24053698395475 (.l 12026849197737 (.l 6013424598869 (.bc 741368354419 (.bc 1 (.bc 707394242097 (.bc 1 (.bc 509323854309 (.bc 1 (.bc 333019443201 (.bc 1 (.bc 197344855229 (.bc 1 (.bc 105720458157 (.bc 1 (.bc 51037462557 (.bc 1 (.bc 22116233773 (.bc 1 (.bc 8561122749 (.bc 1 (.bc 2942885943 (.bc 1 (.bc 891783617 (.bc 1 (.bc 236060367 (.bc 1 (.bc 53956653 (.bc 1 (.bc 10491569 (.bc 1 (.bc 1701333 (.bc 1 (.bc 223857 (.bc 1 (.bc 22957 (.bc 1 (.bc 1719 (.bc 1 (.bc 81 (.bc 1 (.bc 1 (.bc 1 (.bc 79 (.bc 1 (.bc 1637 (.bc 1 (.bc 21317 (.bc 1 (.bc 202537 (.bc 1 (.bc 1498793 (.bc 1 (.bc 8992773 (.bc 1 (.bc 44963877 (.bc 1 (.bc 191096487 (.bc 1 (.bc 700687127 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 6318923933 (.bc 1 (.bc 15797309837 (.bc 1 (.bc 35240152717 (.bc 1 (.bc 70480305437 (.bc 1 (.bc 126864549789 (.bc 1 (.b 68798239589 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 59500583560527 (.l 29750291780263 (.l 7265404467566 (.l 3632702233783 (.bc 137356653820 (.bc 1 (.bc 303168960897 (.bc 1 (.bc 404225281197 (.bc 1 (.bc 489325340397 (.bc 1 (.b 482274880568 .nil))))))))) .nil) (.c (.bc 1 (.l 7609741422563 (.bc 24929479098 (.bc 1 (.l 3779941232180 (.bc 43518254317 (.bc 1 (.bc 538257874437 (.bc 1 (.bc 489325340397 (.bc 1 (.bc 404225281197 (.bc 1 (.bc 303168960897 (.bc 1 (.b 111474904830 .nil))))))))))) .nil))) .nil)))) .nil) (.c (.bc 1 (.l 23810036924097 (.l 11905018462048 (.l 5952509231024 (.l 2976254615512 (.bc 94679988579 (.bc 1 (.bc 126864549789 (.bc 1 (.bc 70480305437 (.bc 1 (.bc 35240152717 (.bc 1 (.bc 15797309837 (.bc 1 (.bc 6318923933 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 700687127 (.bc 1 (.bc 191096487 (.bc 1 (.bc 44963877 (.bc 1 (.bc 8992773 (.bc 1 (.bc 1498793 (.bc 1 (.bc 202537 (.bc 1 (.bc 21317 (.bc 1 (.bc 1637 (.bc 1 (.bc 79 (.bc 1 (.bc 1 (.bc 1 (.bc 77 (.bc 1 (.bc 1557 (.bc 1 (.bc 19757 (.bc 1 (.bc 182777 (.bc 1 (.bc 1316013 (.bc 1 (.bc 7676757 (.bc 1 (.bc 37287117 (.bc 1 (.bc 153809367 (.bc 1 (.bc 546877757 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 24066445757 (.bc 1 (.bc 46413859677 (.bc 1 (.bc 80450690109 (.bc 1 (.bc 125704203297 (.bc 1 (.bc 177464757597 (.bc 1 (.bc 226760523597 (.bc 1 (.bc 262564816797 (.bc 1 (.b 173891315018 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 8754959372037 (.l 4377479686018 (.l 2188739843009 (.l 1094369921505 (.bc 101801742619 (.bc 1 (.bc 262564816797 (.bc 1 (.b 182818401331 .nil))))) .nil) .nil) .nil) (.c (.bc 1 (.l 3093811687257 (.l 1546905843628 (.l 773452921814 (.l 386726460907 (.bc 43942122266 (.bc 1 (.b 149421108184 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 1563473260437 (.l 781736630218 (.l 390868315109 (.l 195434157554 (.bc 28043649412 (.bc 1 (.b 69673429362 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 2455659336057 (.l 1227829668028 (.l 613914834014 (.l 306957417007 (.bc 56030773935 (.bc 1 (.bc 80450690109 (.bc 1 (.b 16997244454 .nil))))) .nil) .nil) .nil) (.c (.bc 1 (.l 6549243040197 (.l 3274621520098 (.l 1637310760049 (.l 818655380025 (.bc 29416615223 (.bc 1 (.bc 24066445757 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 546877757 (.bc 1 (.bc 153809367 (.bc 1 (.bc 37287117 (.bc 1 (.bc 7676757 (.bc 1 (.bc 1316013 (.bc 1 (.bc 182777 (.bc 1 (.bc 19757 (.bc 1 (.bc 1557 (.bc 1 (.bc 77 (.bc 1 (.bc 1 (.bc 1 (.bc 75 (.bc 1 (.bc 1479 (.bc 1 (.bc 18275 (.bc 1 (.bc 164499 (.bc 1 (.bc 1151511 (.bc 1 (.bc 6525243 (.bc 1 (.bc 30761871 (.bc 1 (.bc 123047493 (.bc 1 (.bc 423830261 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 16244850885 (.bc 1 (.bc 30169008789 (.bc 1 (.bc 50281681317 (.bc 1 (.bc 75422521977 (.bc 1 (.bc 102042235617 (.bc 1 (.b 50413829834 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 12251434799188 (.l 6125717399594 (.l 3062858699797 (.l 1531429349899 (.bc 74304458143 (.bc 1 (.bc 137846528817 (.bc 1 (.bc 137846528817 (.bc 1 (.bc 124718287977 (.bc 1 (.bc 102042235617 (.bc 1 (.bc 75422521977 (.bc 1 (.bc 50281681317 (.bc 1 (.bc 30169008789 (.bc 1 (.bc 16244850885 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 423830261 (.bc 1 (.bc 123047493 (.bc 1 (.bc 30761871 (.bc 1 (.bc 6525243 (.bc 1 (.bc 1151511 (.bc 1 (.bc 164499 (.bc 1 (.bc 18275 (.bc 1 (.bc 1479 (.bc 1 (.bc 75 (.bc 1 (.bc 1 (.bc 1 (.bc 73 (.bc 1 (.bc 1403 (.bc 1 (.bc 16869 (.bc 1 (.bc 147627 (.bc 1 (.bc 1003881 (.bc 1 (.bc 5521359 (.bc 1 (.bc 25240509 (.bc 1 (.bc 97806981 (.bc 1 (.bc 326023277 (.bc 1 (.bc 945467509 (.bc 1 (.bc 2406644573 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil))))))))))))))))))))))))) .nil) .nil) .nil) .nil)))) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_389 : Cmd := (.l 4568693039110815744 (.l 2284346519555407872 (.l 1142173259777703936 (.l 571086629888851968 (.l 285543314944425984 (.l 142771657472212992 (.l 71385828736106496 (.l 35692914368053248 (.l 17846457184026624 (.l 8923228592013312 (.l 4461614296006656 (.l 2230807148003328 (.l 1115403574001664 (.l 557701787000832 (.l 278850893500416 (.l 139425446750208 (.l 69712723375104 (.l 34856361687552 (.l 5069937315149 (.l 2534968657574 (.l 1267484328787 (.l 633742164393 (.bc 5414950293 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 30942573117 (.bc 1 (.bc 44479948857 (.bc 1 (.bc 57562286757 (.bc 1 (.bc 67156001217 (.bc 1 (.bc 70690527597 (.bc 1 (.b 10455785548 .nil))))))))))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 12358243528624 (.l 6179121764312 (.l 3089560882156 (.l 1544780441078 (.bc 56700215668 (.bc 1 (.bc 57562286757 (.bc 1 (.bc 44479948857 (.bc 1 (.bc 30942573117 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 945467509 (.bc 1 (.bc 326023277 (.bc 1 (.bc 97806981 (.bc 1 (.bc 25240509 (.bc 1 (.bc 5521359 (.bc 1 (.bc 1003881 (.bc 1 (.bc 147627 (.bc 1 (.bc 16869 (.bc 1 (.bc 1403 (.bc 1 (.bc 73 (.bc 1 (.bc 1 (.bc 1 (.bc 71 (.bc 1 (.bc 1329 (.bc 1 (.bc 15537 (.bc 1 (.bc 132087 (.bc 1 (.bc 871791 (.bc 1 (.bc 4649565 (.bc 1 (.bc 20590941 (.bc 1 (.bc 77216037 (.bc 1 (.bc 248807237 (.bc 1 (.bc 696660269 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 25751549337 (.bc 1 (.bc 31810737417 (.bc 1 (.bc 35345263797 (.bc 1 (.bc 35345263797 (.bc 1 (.bc 31810737417 (.bc 1 (.bc 25751549337 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 696660269 (.bc 1 (.bc 248807237 (.bc 1 (.bc 77216037 (.bc 1 (.bc 20590941 (.bc 1 (.bc 4649565 (.bc 1 (.bc 871791 (.bc 1 (.bc 132087 (.bc 1 (.bc 15537 (.bc 1 (.bc 1329 (.bc 1 (.bc 71 (.bc 1 (.bc 1 (.bc 1 (.bc 69 (.bc 1 (.bc 1257 (.bc 1 (.bc 14277 (.bc 1 (.bc 117807 (.bc 1 (.bc 753981 (.bc 1 (.bc 3895581 (.bc 1 (.bc 16695357 (.bc 1 (.bc 60520677 (.bc 1 (.bc 188286557 (.bc 1 (.bc 508373709 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 17194993197 (.bc 1 (.bc 18150270597 (.bc 1 (.bc 17194993197 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 508373709 (.bc 1 (.bc 188286557 (.bc 1 (.bc 60520677 (.bc 1 (.bc 16695357 (.bc 1 (.bc 3895581 (.bc 1 (.bc 753981 (.bc 1 (.bc 117807 (.bc 1 (.bc 14277 (.bc 1 (.bc 1257 (.bc 1 (.bc 69 (.bc 1 (.bc 1 (.bc 1 (.bc 67 (.bc 1 (.bc 1187 (.bc 1 (.bc 13087 (.bc 1 (.bc 104717 (.bc 1 (.bc 649261 (.bc 1 (.bc 3246317 (.bc 1 (.bc 13449037 (.bc 1 (.bc 47071637 (.bc 1 (.bc 141214917 (.bc 1 (.bc 367158789 (.bc 1 (.bc 834451797 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 834451797 (.bc 1 (.bc 367158789 (.bc 1 (.bc 141214917 (.bc 1 (.bc 47071637 (.bc 1 (.bc 13449037 (.bc 1 (.bc 3246317 (.bc 1 (.bc 649261 (.bc 1 (.bc 104717 (.bc 1 (.bc 13087 (.bc 1 (.bc 1187 (.bc 1 (.bc 67 (.bc 1 (.bc 1 (.bc 1 (.bc 65 (.bc 1 (.bc 1119 (.bc 1 (.bc 11965 (.bc 1 (.bc 92749 (.bc 1 (.bc 556509 (.bc 1 (.bc 2689805 (.bc 1 (.bc 10759229 (.bc 1 (.bc 36312405 (.bc 1 (.bc 104902509 (.bc 1 (.bc 262256277 (.bc 1 (.bc 572195517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 4667212437 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 572195517 (.bc 1 (.bc 262256277 (.bc 1 (.bc 104902509 (.bc 1 (.bc 36312405 (.bc 1 (.bc 10759229 (.bc 1 (.bc 2689805 (.bc 1 (.bc 556509 (.bc 1 (.bc 92749 (.bc 1 (.bc 11965 (.bc 1 (.bc 1119 (.bc 1 (.bc 65 (.bc 1 (.bc 1 (.bc 1 (.bc 63 (.bc 1 (.bc 1053 (.bc 1 (.bc 10909 (.bc 1 (.bc 81837 (.bc 1 (.bc 474669 (.bc 1 (.bc 2215133 (.bc 1 (.bc 8544093 (.bc 1 (.bc 27768309 (.bc 1 (.bc 77134197 (.bc 1 (.bc 185122077 (.bc 1 (.bc 387073437 (.bc 1 (.bc 709634637 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 709634637 (.bc 1 (.bc 387073437 (.bc 1 (.bc 185122077 (.bc 1 (.bc 77134197 (.bc 1 (.bc 27768309 (.bc 1 (.bc 8544093 (.bc 1 (.bc 2215133 (.bc 1 (.bc 474669 (.bc 1 (.bc 81837 (.bc 1 (.bc 10909 (.bc 1 (.bc 1053 (.bc 1 (.bc 63 (.bc 1 (.bc 1 (.bc 1 (.bc 61 (.bc 1 (.bc 989 (.bc 1 (.bc 9917 (.bc 1 (.bc 71917 (.bc 1 (.bc 402749 (.bc 1 (.bc 1812381 (.bc 1 (.bc 6731709 (.bc 1 (.bc 21036597 (.bc 1 (.bc 56097597 (.bc 1 (.bc 129024477 (.bc 1 (.bc 258048957 (.bc 1 (.bc 451585677 (.bc 1 (.bc 694747197 (.bc 1 (.bc 942871197 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 1202160777 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 942871197 (.bc 1 (.bc 694747197 (.bc 1 (.bc 451585677 (.bc 1 (.bc 258048957 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.bc 6731709 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 61 (.bc 1 (.bc 1 (.bc 1 (.bc 59 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 (.bc 1 (.bc 62927 (.bc 1 (.bc 339819 (.bc 1 (.bc 1472559 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.bc 88704327 (.bc 1 (.bc 169344627 (.bc 1 (.bc 282241047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 530365047 (.bc 1 (.bc 601080387 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_390 : Cmd := (.l 26986413400522752 (.l 13493206700261376 (.l 6746603350130688 (.l 3373301675065344 (.l 1686650837532672 (.l 843325418766336 (.l 421662709383168 (.l 210831354691584 (.l 105415677345792 (.l 52707838672896 (.l 26353919336448 (.l 13176959668224 (.l 6588479834112 (.l 3294239917056 (.l 1647119958528 (.l 823559979264 (.l 411779989632 (.l 205889994816 (.l 102944997408 (.l 51472498704 (.l 25736249352 (.l 12868124676 (.bc 601080387 (.bc 1 (.bc 530365047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 282241047 (.bc 1 (.bc 169344627 (.bc 1 (.bc 88704327 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.bc 11705847 (.bc 1 (.bc 28614297 (.bc 1 (.bc 60090027 (.bc 1 (.bc 109254597 (.bc 1 (.bc 172986447 (.bc 1 (.bc 239519697 (.bc 1 (.bc 290845347 (.bc 1 (.bc 310235037 (.bc 1 (.bc 290845347 (.bc 1 (.bc 239519697 (.bc 1 (.bc 172986447 (.bc 1 (.bc 109254597 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.bc 69194577 (.bc 1 (.bc 103791867 (.bc 1 (.bc 135727827 (.bc 1 (.bc 155117517 (.bc 1 (.bc 155117517 (.bc 1 (.bc 135727827 (.bc 1 (.bc 103791867 (.bc 1 (.bc 69194577 (.bc 1 (.bc 40060017 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.bc 26246217 (.bc 1 (.bc 42948357 (.bc 1 (.bc 60843507 (.bc 1 (.bc 74884317 (.bc 1 (.bc 80233197 (.bc 1 (.bc 74884317 (.bc 1 (.bc 60843507 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.bc 26075787 (.bc 1 (.bc 34767717 (.bc 1 (.bc 40116597 (.bc 1 (.bc 40116597 (.bc 1 (.bc 34767717 (.bc 1 (.bc 26075787 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_391 : Cmd := (.l 35184346923007 (.l 17592173461503 (.l 8796086730751 (.l 4398043365375 (.l 2199021682687 (.l 1099510841343 (.l 549755420671 (.l 274877710335 (.l 137438855167 (.l 68719427583 (.l 34359713791 (.l 17179856895 (.l 8589928447 (.l 4294964223 (.l 2147482111 (.l 1073741055 (.l 536870527 (.l 268435263 (.l 134217631 (.l 67108815 (.l 33554407 (.l 16777203 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 125408554852305338368 (.l 62704277426152669184 (.l 31352138713076334592 (.l 15676069356538167296 (.l 7838034678269083648 (.l 3919017339134541824 (.l 1959508669567270912 (.l 979754334783635456 (.l 489877167391817728 (.l 244938583695908864 (.l 122469291847954432 (.l 61234645923977216 (.l 30617322961988608 (.l 15308661480994304 (.l 7654330740497152 (.l 3827165370248576 (.l 1913582685124288 (.l 956791342562144 (.l 29730959707743 (.l 14865479853871 (.l 7432739926935 (.l 3716369963467 (.c (.c (.b 1858184981731 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.bc 94307123391387 (.bc 1 (.l 193852755136557 (.l 96926377568278 (.l 27722222906423 (.bc 7321121338211 (.bc 1 (.b 6539990114997 .nil))) (.c (.bc 1 (.b 20740965877713 .nil)))) .nil) (.c (.bc 1 (.l 160504833045376 (.l 19245680585883 (.l 9622840292941 (.bc 2784285728441 (.bc 1 (.b 2027134418026 .nil))) .nil) (.c (.bc 1 (.l 61006735936802 (.bc 13527370544180 (.bc 1 (.l 16975997424218 (.bc 1056559701028 (.bc 1 (.bc 4501659150237 (.bc 1 (.bc 1875691312597 (.bc 1 (.bc 709721037197 (.bc 1 (.bc 242799302197 (.bc 1 (.bc 74707477597 (.bc 1 (.bc 20544556337 (.bc 1 (.bc 5010867397 (.bc 1 (.bc 1073757297 (.bc 1 (.bc 199768797 (.bc 1 (.bc 31781397 .nil))))))))))))))))))))) .nil))) .nil)))) .nil))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil))) +def cmd_392 : Cmd := (.l 2519232834482088790093 (.l 1214727883066919547839 (.l 572169968149725184881 (.l 260585571481518261571 (.l 112471227545268421941 (.l 44075203582460488007 (.l 13917395325965333249 (.l 1653512754346856879 (.l 826756377173428439 (.l 413378188586714219 (.l 206689094293357109 (.l 103344547146678554 (.l 51672273573339277 (.l 25836136786669638 (.l 12918068393334819 (.l 6459034196667409 (.l 3229517098333704 (.l 1614758549166852 (.l 206795021157383 (.l 103397510578691 (.l 3750391580009 (.bc 1 (.bc 4237517 (.bc 1 (.bc 460597 (.bc 1 (.bc 39197 (.bc 1 (.bc 2447 (.bc 1 (.bc 97 (.bc 1 (.bc 1 (.bc 1 (.bc 95 (.bc 1 (.bc 2349 (.bc 1 (.bc 36845 (.bc 1 (.bc 423749 (.bc 1 (.bc 3813765 (.bc 1 (.bc 27967629 (.bc 1 (.bc 171801165 (.bc 1 (.bc 901956129 (.bc 1 (.bc 4108911265 (.bc 1 (.bc 16435645069 (.bc 1 (.bc 58271832525 (.bc 1 (.bc 184527469669 (.bc 1 (.bc 525193567525 (.bc 1 (.b 1085547622310 .nil)))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 8962762812637 (.bc 264950122757 (.bc 1 (.bc 3151161405165 (.bc 1 (.b 1065269878390 .nil))))) (.c (.bc 1 (.bc 3537932689197 (.bc 1 (.bc 1270027119197 (.bc 1 (.bc 412758813737 (.bc 1 (.bc 120807457677 (.bc 1 (.bc 31640048437 (.bc 1 (.bc 7358150797 (.bc 1 (.bc 1505076297 (.bc 1 (.bc 267569117 (.bc 1 (.bc 40717037 (.bc 1 (.bc 5197917 (.bc 1 (.bc 541447 (.bc 1 (.bc 44197 (.bc 1 (.bc 2649 (.bc 1 (.bc 101 (.bc 1 (.bc 1 (.bc 1 (.bc 99 (.bc 1 (.bc 2547 (.bc 1 (.bc 41647 (.bc 1 (.bc 499797 (.bc 1 (.bc 4698117 (.bc 1 (.bc 36018917 (.bc 1 (.bc 231550197 (.bc 1 (.bc 1273526097 (.bc 1 (.bc 6084624697 (.bc 1 (.bc 25555423737 (.bc 1 (.bc 95252033937 (.bc 1 (.bc 317506779797 (.bc 1 (.bc 952520339397 (.bc 1 (.bc 2585412349797 (.bc 1 (.l 6377350462837 (.bc 947837449251 (.bc 1 (.b 2240837782164 .nil))) (.c (.bc 1 (.bc 14349038541387 (.bc 1 (.l 8892990575791 (.bc 3583183743454 (.bc 1 (.b 863311544438 .nil))) .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 600584253426040 (.l 300292126713020 (.bc 20649147597655 (.bc 1 (.l 55801816549847 (.bc 11920631627961 (.bc 1 (.b 15980276646959 .nil))) (.c (.bc 1 (.l 73695099209002 (.bc 21723093148204 (.bc 1 (.b 15124456456294 .nil))) .nil)))))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 5305184908635809742 (.l 2652592454317904871 (.l 1326296227158952436 (.l 363099662338212055 (.l 181549831169106027 (.l 90774915584553014 (.l 36868079055260541 (.l 18434039527630270 (.l 9217019763815135 (.l 4608509881907568 (.l 2304254940953784 (.bc 42190479935237 (.bc 1 (.l 1040682900580647 (.l 520341450290323 (.bc 12676225341135 (.bc 1 (.l 155070311254317 (.bc 29818675573981 (.bc 1 (.b 47716480053174 .nil))) (.c (.bc 1 (.l 92424188549704 (.bc 30383357379669 (.bc 1 (.b 15828736895180 .nil))) .nil)))))) .nil) (.c (.bc 1 (.b 69254089961002 .nil)))))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 8519378737015963 (.bc 1617757327652296 (.bc 1 (.b 2641932040855682 .nil))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 300048451241264160 (.l 150024225620632080 (.l 75012112810316040 (.l 37506056405158020 (.l 18753028202579010 (.l 9376514101289505 (.l 4688257050644752 (.l 2344128525322376 (.l 1172064262661188 (.l 586032131330594 (.bc 52617959190625 (.bc 1 (.l 240398106474669 (.bc 15326492169261 (.bc 1 (.b 104872561068070 .nil))) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 8120206465264910751 (.l 4060103232632455375 (.l 2030051616316227687 (.l 1015025808158113844 (.l 507512904079056922 (.l 253756452039528461 (.l 126878226019764230 (.l 63439113009882115 (.l 31719556504941057 (.l 3276156383704106 (.l 1638078191852053 (.l 819039095926026 (.bc 53475412641298 (.bc 1 (.l 356044135321712 (.l 160294186764029 (.l 58387563019802 (.bc 5129725986612 (.bc 1 (.b 24064055523286 .nil))) (.c (.bc 1 (.b 21759530362209 .nil)))) (.c (.bc 1 (.b 17727880896824 .nil)))) .nil))) .nil) .nil) (.c (.bc 1 (.l 12583621868766420 (.l 6291810934383210 (.bc 984843664684774 (.bc 1 (.l 2161061802506828 (.l 1080530901253414 (.l 540265450626707 (.l 239857208364177 (.bc 25482086466351 (.bc 1 (.b 94446517715734 .nil))) (.c (.bc 1 (.b 30275516949173 .nil)))) .nil) .nil) .nil))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 12160410190173722960 (.l 6080205095086861480 (.l 3040102547543430740 (.l 1520051273771715370 (.l 760025636885857685 (.l 380012818442928842 (.l 190006409221464421 (.l 95003204610732211 (.l 10186351554040638 (.l 5093175777020319 (.l 2546587888510159 (.l 656905173197214 (.l 328452586598607 (.l 164226293299303 (.l 82113146649652 (.l 41056573324826 (.bc 16826330247427 (.bc 1 (.b 3701956414983 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 616388771057862 (.l 308194385528931 (.bc 78636804102968 (.bc 1 (.b 75460388661495 .nil))) .nil) .nil)))) .nil) .nil) (.c (.bc 1 (.l 37315250751325464 (.bc 2466706623042700 (.bc 1 (.l 16190918752620029 (.l 8095459376310014 (.l 4047729688155007 (.l 2023864844077504 (.l 1011932422038752 (.l 505966211019376 (.l 252983105509688 (.bc 74451462631782 (.bc 1 (.b 52040090123059 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 17821558195490708841 (.l 8910779097745354420 (.l 4455389548872677210 (.l 2227694774436338605 (.l 1113847387218169303 (.l 339946273592532588 (.l 169973136796266294 (.l 84986568398133147 (.l 42493284199066573 (.l 21246642099533287 (.l 10623321049766643 (.l 5311660524883322 (.l 2655830262441661 (.l 1327915131220830 (.l 663957565610415 (.l 261455540100030 (.bc 57802041843951 (.bc 1 (.l 72925728206061 (.bc 18458682051313 (.bc 1 (.b 18004182051714 .nil))) .nil))) (.c (.bc 1 (.b 70523242705174 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 216977420016552061 (.l 108488710008276030 (.bc 8673302534144783 (.bc 1 (.l 45571052469993229 (.bc 2984821348242195 (.bc 1 (.l 19800704886754416 (.l 9900352443377208 (.l 4950176221688604 (.l 2475088110844302 (.l 1237544055422151 (.l 618772027711076 (.l 309386013855538 (.l 154693006927769 (.l 77346503463885 (.bc 28165093503050 (.bc 1 (.b 10508158228889 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil))) .nil))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 25499412593344330866 (.l 12749706296672165433 (.l 6374853148336082717 (.l 3187426574168041359 (.l 1593713287084020679 (.l 796856643542010339 (.l 398428321771005169 (.l 199214160885502585 (.l 99607080442751292 (.l 49803540221375646 (.bc 4806517708139830 (.bc 1 (.l 20095252402547990 (.l 10047626201273995 (.l 5023813100636998 (.l 2511906550318499 (.l 1104260933457433 (.l 325811881062890 (.l 162905940531445 (.l 81452970265723 (.bc 27271436666439 (.bc 1 (.b 13455048466420 .nil))) .nil) .nil) (.c (.bc 1 (.l 226318585665823 (.l 113159292832911 (.l 56579646416455 (.bc 24248321328745 (.bc 1 (.b 4041501879480 .nil))) .nil) .nil) .nil)))) (.c (.bc 1 (.b 151692341701814 .nil)))) .nil) .nil) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 35193973383734589035 (.l 17596986691867294517 (.l 8798493345933647258 (.l 4399246672966823629 (.l 2199623336483411814 (.l 1099811668241705907 (.l 549905834120852954 (.l 274952917060426477 (.l 137476458530213238 (.l 68738229265106619 (.l 34369114632553310 (.l 17184557316276655 (.l 8592278658138327 (.l 4296139329069163 (.l 2148069664534581 (.l 1074034832267290 (.l 537017416133645 (.l 268508708066822 (.l 87240098532245 (.bc 9586243735385 (.bc 1 (.bc 12998540796315 (.bc 1 (.bc 6696217985979 (.bc 1 (.bc 3151161405165 (.bc 1 (.bc 1350497745069 (.bc 1 (.bc 525193567525 (.bc 1 (.bc 184527469669 (.bc 1 (.bc 58271832525 (.bc 1 (.bc 16435645069 (.bc 1 (.bc 4108911265 (.bc 1 (.bc 901956129 (.bc 1 (.bc 171801165 (.bc 1 (.bc 27967629 (.bc 1 (.bc 3813765 (.bc 1 (.bc 423749 (.bc 1 (.bc 36845 (.bc 1 (.bc 2349 (.bc 1 (.bc 95 (.bc 1 (.bc 1 (.bc 1 (.bc 93 (.bc 1 (.bc 2253 (.bc 1 (.bc 34589 (.bc 1 (.bc 389157 (.bc 1 (.bc 3424605 (.bc 1 (.bc 24543021 (.bc 1 (.bc 147258141 (.bc 1 (.bc 754697985 (.bc 1 (.bc 3354213277 (.bc 1 (.bc 13081431789 (.bc 1 (.bc 45190400733 (.bc 1 (.bc 139337068933 (.bc 1 (.bc 385856498589 (.bc 1 (.bc 964641246477 (.bc 1 (.bc 2186520158685 (.bc 1 (.bc 4509697827291 (.bc 1 (.b 799134974706 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 47014255501163 (.bc 7689707994313 (.bc 1 (.bc 14619674002205 (.bc 1 (.b 1197745754057 .nil))))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 44888534174124847204 (.l 22444267087062423602 (.l 11222133543531211801 (.l 5611066771765605900 (.l 2805533385882802950 (.l 1402766692941401475 (.l 701383346470700737 (.l 350691673235350369 (.l 175345836617675185 (.l 87672918308837593 (.l 43836459154418797 (.l 21918229577209398 (.l 10959114788604699 (.l 5479557394302350 (.l 2739778697151175 (.l 1369889348575588 (.l 684944674287794 (.l 342472337143897 (.l 171236168571949 (.l 85618084285974 (.bc 21885950038900 (.bc 1 (.b 20923092104084 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 44888534174124847204 (.l 22444267087062423602 (.l 11222133543531211801 (.l 5611066771765605900 (.l 2805533385882802950 (.l 1402766692941401475 (.l 701383346470700737 (.l 350691673235350369 (.l 175345836617675184 (.l 87672918308837592 (.l 43836459154418796 (.l 21918229577209398 (.l 10959114788604699 (.bc 128212211294795 (.bc 1 (.l 5351345183007551 (.l 2675672591503775 (.l 1337836295751887 (.l 668918147875943 (.l 334459073937972 (.l 167229536968986 (.l 83614768484493 (.l 41807384242246 (.bc 12047437845334 (.bc 1 (.b 8856254275786 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) +def cmd_396 : Cmd := (.l 4168914417942513979027 (.l 2084457208971256989514 (.l 1042228604485628494757 (.l 521114302242814247379 (.l 260557151121407123690 (.l 130278575560703561845 (.l 65139287780351780923 (.l 30310682056842669091 (.l 10449799153361563454 (.l 1975833341724407147 (.l 987916670862203573 (.l 493958335431101786 (.l 246979167715550893 (.l 123489583857775447 (.l 27384971053099116 (.l 13692485526549558 (.l 6846242763274779 (.l 3423121381637390 (.l 1711560690818695 (.l 855780345409348 (.l 361642250635066 (.l 180821125317533 (.bc 35772224257267 (.bc 1 (.b 54638338401496 .nil))) .nil) (.c (.bc 1 (.l 66247922069605 (.l 33123961034802 (.bc 132976161796 (.bc 1 (.b 16429004355602 .nil))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 28442225841798691 (.bc 2689244325667738 (.bc 1 (.l 11531868595231604 (.l 2147538322990905 (.l 1073769161495452 (.l 536884580747726 (.l 268442290373863 (.l 134221145186931 (.l 64512622077081 (.bc 24476673421667 (.bc 1 (.b 7779637616870 .nil))) (.c (.bc 1 (.b 2597950516381 .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 3618395974624894 (.l 1809197987312447 (.l 904598993656223 (.l 452299496828112 (.l 226149748414056 (.l 113074874207028 (.bc 55416594491135 (.bc 1 (.b 1120842612376 .nil))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil))) (.c (.bc 1 (.b 5917595033989911 .nil))))))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 3249066234956374577 (.l 1624533117478187288 (.l 812266558739093644 (.l 406133279369546822 (.l 159625113705289263 (.l 28330628915295224 (.l 14165314457647612 (.l 7082657228823806 (.l 3397300486193497 (.l 222397888269109 (.bc 83967521651537 (.bc 1 (.b 27231422483014 .nil))) (.c (.bc 1 (.l 1476252354827636 (.l 738126177413818 (.l 369063088706909 (.l 184531544353454 (.bc 23779082840830 (.bc 1 (.bc 54771314563293 (.bc 1 (.b 13715374772598 .nil))))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.b 144028128218403 .nil)))) .nil) .nil) (.c (.bc 1 (.l 49395167343525901 (.l 24697583671762950 (.l 12348791835881475 (.l 6174395917940738 (.l 2736898465701948 (.l 1368449232850974 (.l 201022299128228 (.l 75946752476598 (.bc 26412224753630 (.bc 1 (.b 11561151484666 .nil))) (.c (.bc 1 (.b 24564397087513 .nil)))) (.c (.bc 1 (.l 483202317297256 (.l 241601158648628 (.bc 9628008871364 (.bc 1 (.bc 23083695792957 (.bc 1 (.bc 14619674002205 (.bc 1 (.bc 8488842969021 (.bc 1 (.bc 4509697827291 (.bc 1 (.bc 2186520158685 (.bc 1 (.bc 964641246477 (.bc 1 (.bc 385856498589 (.bc 1 (.bc 139337068933 (.bc 1 (.bc 45190400733 (.bc 1 (.bc 13081431789 (.bc 1 (.bc 3354213277 (.bc 1 (.bc 754697985 (.bc 1 (.bc 147258141 (.bc 1 (.bc 24543021 (.bc 1 (.bc 3424605 (.bc 1 (.bc 389157 (.bc 1 (.bc 34589 (.bc 1 (.bc 2253 (.bc 1 (.bc 93 (.bc 1 (.bc 1 (.bc 1 (.bc 91 (.bc 1 (.bc 2159 (.bc 1 (.bc 32427 (.bc 1 (.bc 356727 (.bc 1 (.bc 3067875 (.bc 1 (.bc 21475143 (.bc 1 (.bc 125782995 (.bc 1 (.bc 628914987 (.bc 1 (.bc 2725298287 (.bc 1 (.bc 10356133499 (.bc 1 (.bc 34834267231 (.bc 1 (.bc 104502801699 (.bc 1 (.bc 281353696887 (.bc 1 (.bc 683287549587 (.bc 1 (.bc 1503232609095 (.bc 1 (.bc 3006465218193 (.bc 1 (.bc 5482377750825 (.bc 1 (.bc 9137296251377 (.bc 1 (.bc 13946399541577 (.bc 1 (.bc 19524959358209 (.bc 1 (.b 3013178384155 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil)))) .nil) (.c (.bc 1 (.b 350299493268418 .nil)))) .nil) .nil) .nil) (.c (.bc 1 (.l 2086760593823500 (.l 1043380296911750 (.l 521690148455875 (.l 260845074227938 (.l 130422537113969 (.l 65211268556984 (.l 32605634278492 (.l 16302817139246 (.bc 196622461409 (.bc 1 (.b 7954786108211 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil))))))) (.c (.bc 1 (.l 43441525979484145 (.l 21720762989742072 (.l 10860381494871036 (.l 5430190747435518 (.l 2715095373717759 (.l 1357547686858880 (.l 678773843429440 (.l 321668642243303 (.l 67330327726455 (.bc 21713009280238 (.bc 1 (.b 11952154582986 .nil))) (.c (.bc 1 (.l 93503993395193 (.bc 20295449100109 (.bc 1 (.b 26456547597484 .nil))) .nil)))) (.c (.bc 1 (.b 17718279471414 .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 4705541875059771088 (.l 2352770937529885544 (.l 1176385468764942772 (.l 3925689686795463 (.l 1962844843397731 (.l 981422421698866 (.l 490711210849433 (.l 245355605424716 (.l 122677802712358 (.l 61338901356179 (.l 30669450678089 (.l 15334725339045 (.l 7667362669522 (.l 3833681334761 (.bc 1361486217758 (.bc 1 (.b 555354449619 .nil))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 584267044695675920 (.l 292133522347837960 (.l 146066761173918980 (.l 48880200280119179 (.l 24440100140059589 (.l 12220050070029795 (.l 6110025035014898 (.l 824593045897703 (.l 412296522948851 (.l 206148261474426 (.l 103074130737213 (.bc 29112440938830 (.bc 1 (.b 22424624429774 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 1571227131284493 (.l 238231777753271 (.l 119115888876635 (.l 59557944438318 (.bc 2678894745067 (.bc 1 (.bc 19524959358209 (.bc 1 (.b 7575118115877 .nil))))) .nil) .nil) (.c (.bc 1 (.l 547381787888972 (.l 273690893944486 (.l 43325633013602 (.bc 6371281425700 (.bc 1 (.bc 9137296251377 (.bc 1 (.bc 5482377750825 (.bc 1 (.b 671861078890 .nil))))))) (.c (.bc 1 (.l 93519813958638 (.bc 2334604139301 (.bc 1 (.bc 1503232609095 (.bc 1 (.bc 683287549587 (.bc 1 (.bc 281353696887 (.bc 1 (.bc 104502801699 (.bc 1 (.bc 34834267231 (.bc 1 (.bc 10356133499 (.bc 1 (.bc 2725298287 (.bc 1 (.bc 628914987 (.bc 1 (.bc 125782995 (.bc 1 (.bc 21475143 (.bc 1 (.bc 3067875 (.bc 1 (.bc 356727 (.bc 1 (.bc 32427 (.bc 1 (.bc 2159 (.bc 1 (.bc 91 (.bc 1 (.bc 1 (.bc 1 (.bc 89 (.bc 1 (.bc 2067 (.bc 1 (.bc 30357 (.bc 1 (.bc 326367 (.bc 1 (.bc 2741505 (.bc 1 (.bc 18733635 (.bc 1 (.bc 107049357 (.bc 1 (.bc 521865627 (.bc 1 (.bc 2203432657 (.bc 1 (.bc 8152700839 (.bc 1 (.bc 26681566389 (.bc 1 (.bc 77821235307 (.bc 1 (.bc 203532461577 (.bc 1 (.bc 479755088007 (.bc 1 (.bc 1023477521085 (.bc 1 (.bc 1982987697105 (.bc 1 (.bc 3499390053717 (.bc 1 (.bc 5637906197657 (.bc 1 (.bc 8308493343917 (.bc 1 (.bc 11216466014289 (.bc 1 (.b 9336712789667 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil) .nil)))) (.c (.bc 1 (.l 659192340325247 (.l 329596170162623 (.bc 11632197219620 (.bc 1 (.l 153165887861688 (.l 76582943930844 (.bc 1642291065976 (.bc 1 (.bc 15780742227897 (.bc 1 (.bc 16466861455197 (.bc 1 (.b 4401577216343 .nil))))))) .nil) .nil))) .nil) .nil))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 24153180306840308 (.l 6872834438543191 (.l 3436417219271595 (.l 1718208609635798 (.l 190119676749702 (.l 95059838374851 (.l 47529919187426 (.l 23764959593713 (.bc 11379165011554 (.bc 1 (.b 503314785299 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 424656385403247 (.l 212328192701623 (.l 106164096350811 (.l 29229500520510 (.bc 13383738375250 (.bc 1 (.b 1231011885002 .nil))) (.c (.bc 1 (.l 23852547654893 (.bc 9985454129285 (.bc 1 (.b 1940819698158 .nil))) .nil)))) .nil) .nil) (.c (.bc 1 (.l 195997502616297 (.l 97998751308148 (.l 48999375654074 (.l 24499687827037 (.bc 6367673645759 (.bc 1 (.bc 5637906197657 (.bc 1 (.b 244264070097 .nil))))) .nil) .nil) .nil) (.c (.bc 1 (.b 48330740048644 .nil)))))))))) .nil) .nil) (.c (.bc 1 (.l 5203755714876960 (.l 2601877857438480 (.l 1300938928719240 (.l 34979880435982 (.l 17489940217991 (.l 8744970108996 (.l 4372485054498 (.bc 234454730580 (.bc 1 (.b 1951787796666 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 32564996296137 (.l 16282498148068 (.l 8141249074034 (.l 4070624537017 (.bc 31199900438 (.bc 1 (.bc 1023477521085 (.bc 1 (.bc 479755088007 (.bc 1 (.bc 203532461577 (.bc 1 (.bc 77821235307 (.bc 1 (.bc 26681566389 (.bc 1 (.bc 8152700839 (.bc 1 (.bc 2203432657 (.bc 1 (.bc 521865627 (.bc 1 (.bc 107049357 (.bc 1 (.bc 18733635 (.bc 1 (.bc 2741505 (.bc 1 (.bc 326367 (.bc 1 (.bc 30357 (.bc 1 (.bc 2067 (.bc 1 (.bc 89 (.bc 1 (.bc 1 (.bc 1 (.bc 87 (.bc 1 (.bc 1977 (.bc 1 (.bc 28377 (.bc 1 (.bc 297987 (.bc 1 (.bc 2443515 (.bc 1 (.bc 16290117 (.bc 1 (.bc 90759237 (.bc 1 (.bc 431106387 (.bc 1 (.bc 1772326267 (.bc 1 (.bc 6380374569 (.bc 1 (.bc 20301191817 (.bc 1 (.bc 57520043487 (.bc 1 (.b 95322749293 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 11848771059297 (.l 5924385529648 (.l 2962192764824 (.l 1481096382412 (.bc 50689668794 (.bc 1 (.bc 333742669917 (.bc 1 (.b 356115852489 .nil))))) .nil) .nil) .nil) (.c (.bc 1 (.bc 4657284947697 (.bc 1 (.l 4019132596497 (.l 2009566298248 (.l 1004783149124 (.l 502391574562 (.bc 42538689444 (.bc 1 (.b 208657097834 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.bc 9004902376257 (.bc 1 (.l 23870615154537 (.l 11935307577268 (.l 5967653788634 (.l 2983826894317 (.bc 521789349587 (.bc 1 (.b 970124097569 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.l 59513654565747 (.l 29756827282873 (.l 6531657089297 (.l 3265828544648 (.bc 1236013110208 (.bc 1 (.b 396901162113 .nil))) .nil) (.c (.bc 1 (.b 8346756552136 .nil)))) .nil) (.c (.bc 1 (.l 136499405842797 (.l 68249702921398 (.l 34124851460699 (.l 17062425730350 (.bc 948178689729 (.bc 1 (.bc 4876724354037 (.bc 1 (.b 2706309821403 .nil))))) .nil) .nil) .nil) (.c (.bc 1 (.l 288159878527947 (.l 144079939263973 (.l 72039969631987 (.l 36019984815994 (.bc 3633431838846 (.bc 1 (.bc 7547311500297 (.bc 1 (.b 6829249068848 .nil))))) .nil) .nil) .nil) (.c (.bc 1 (.l 45350942556695 (.l 22675471278347 (.l 11337735639173 (.l 5668867819587 (.bc 1404181658749 (.bc 1 (.b 1430252251042 .nil))) .nil) .nil) .nil) .nil))))))))))))))))))))))))))))) .nil) .nil) .nil)))) .nil)))) .nil) .nil) .nil)))) .nil) .nil) .nil)))) (.c (.bc 1 (.l 2258961833333221368 (.l 1129480916666610684 (.l 564740458333305342 (.l 282370229166652671 (.l 141185114583326336 (.l 32241858087345169 (.l 16120929043672584 (.l 8060464521836292 (.l 4030232260918146 (.l 2015116130459073 (.l 1007558065229536 (.l 503779032614768 (.l 251889516307384 (.l 112215402523099 (.l 19368050221353 (.bc 6803178476555 (.bc 1 (.b 2880846634118 .nil))) (.c (.bc 1 (.l 36739651040193 (.bc 4666464866177 (.bc 1 (.bc 6339741660249 (.bc 1 (.bc 4876724354037 (.bc 1 (.b 2486894639624 .nil))))))) .nil)))) (.c (.bc 1 (.l 13729355630590 (.l 6864677815295 (.bc 944874350252 (.bc 1 (.bc 2206137207777 (.bc 1 (.b 281327349613 .nil))))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 38350699204317996 (.l 19175349602158998 (.l 9587674801079499 (.l 4793837400539750 (.l 2396918700269875 (.l 1198459350134938 (.bc 12022634167856 (.bc 1 (.l 587207040899610 (.l 293603520449805 (.l 112500117265582 (.l 51811786407475 (.bc 260510860833 (.bc 1 (.bc 689734851165 (.bc 1 (.bc 333742669917 (.bc 1 (.bc 146012418087 (.bc 1 (.bc 57520043487 (.bc 1 (.bc 20301191817 (.bc 1 (.bc 6380374569 (.bc 1 (.bc 1772326267 (.bc 1 (.bc 431106387 (.bc 1 (.bc 90759237 (.bc 1 (.bc 16290117 (.bc 1 (.bc 2443515 (.bc 1 (.bc 297987 (.bc 1 (.bc 28377 (.bc 1 (.bc 1977 (.bc 1 (.bc 87 (.bc 1 (.bc 1 (.bc 1 (.bc 85 (.bc 1 (.bc 1889 (.bc 1 (.bc 26485 (.bc 1 (.bc 271499 (.bc 1 (.bc 2172013 (.bc 1 (.bc 14118101 (.bc 1 (.bc 76641133 (.bc 1 (.bc 354465251 (.bc 1 (.bc 1417861013 (.bc 1 (.bc 4962513553 (.bc 1 (.bc 15338678261 (.bc 1 (.bc 42181365223 (.bc 1 (.bc 103831052861 (.bc 1 (.bc 229911617053 (.bc 1 (.bc 459823234109 (.bc 1 (.bc 833429611825 (.bc 1 (.bc 1372707595949 (.bc 1 (.bc 2059061393925 (.bc 1 (.bc 2817662960109 (.bc 1 (.bc 3522078700137 (.bc 1 (.bc 4025232800157 (.bc 1 (.bc 4208197927437 (.bc 1 (.bc 4025232800157 (.bc 1 (.b 667859731565 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.b 4438272225313 .nil)))) (.c (.bc 1 (.l 34301642959318 (.l 17150821479659 (.bc 635082855913 (.bc 1 (.bc 2817662960109 (.bc 1 (.bc 2059061393925 (.bc 1 (.bc 1372707595949 (.bc 1 (.bc 833429611825 (.bc 1 (.bc 459823234109 (.bc 1 (.bc 229911617053 (.bc 1 (.bc 103831052861 (.bc 1 (.bc 42181365223 (.bc 1 (.bc 15338678261 (.bc 1 (.bc 4962513553 (.bc 1 (.bc 1417861013 (.bc 1 .nil)))))))))))))))))))))))) .nil) .nil)))) .nil) .nil))) .nil) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_397 : Cmd := (.l 142964144346385874944 (.l 71482072173192937472 (.l 35741036086596468736 (.l 17870518043298234368 (.l 8935259021649117184 (.l 4467629510824558592 (.l 2233814755412279296 (.l 1116907377706139648 (.l 558453688853069824 (.l 279226844426534912 (.l 139613422213267456 (.l 69806711106633728 (.l 34903355553316864 (.l 17451677776658432 (.l 8725838888329216 (.l 4362919444164608 (.l 2181459722082304 (.l 1090729861041152 (.l 422867546664429 (.l 211433773332214 (.l 30315922759749 (.l 15157961379874 (.bc 354465251 (.bc 1 (.bc 76641133 (.bc 1 (.bc 14118101 (.bc 1 (.bc 2172013 (.bc 1 (.bc 271499 (.bc 1 (.bc 26485 (.bc 1 (.bc 1889 (.bc 1 (.bc 85 (.bc 1 (.bc 1 (.bc 1 (.bc 83 (.bc 1 (.bc 1803 (.bc 1 (.bc 24679 (.bc 1 (.bc 246817 (.bc 1 (.bc 1925193 (.bc 1 (.bc 12192905 (.bc 1 (.bc 64448225 (.bc 1 (.bc 290017023 (.bc 1 (.bc 1127843987 (.bc 1 (.bc 3834669563 (.bc 1 (.bc 11504008695 (.bc 1 (.bc 30677356525 (.bc 1 (.bc 73153696333 (.bc 1 (.bc 156757920717 (.bc 1 (.bc 303065313389 (.bc 1 (.bc 530364298433 (.bc 1 (.bc 842343297513 (.bc 1 (.bc 1216718096409 (.bc 1 (.bc 1600944863697 (.bc 1 (.bc 1921133836437 (.bc 1 (.b 886538934967 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 29689151816867 (.l 14844575908433 (.bc 1217560028749 (.bc 1 (.bc 2104098963717 (.bc 1 (.bc 1921133836437 (.bc 1 (.bc 1600944863697 (.bc 1 (.b 578550261604 .nil))))))))) .nil) (.c (.bc 1 (.l 12500695501837 (.l 4210185556562 (.bc 638167834804 (.bc 1 (.bc 842343297513 (.bc 1 (.bc 530364298433 (.bc 1 (.b 94217347522 .nil))))))) (.c (.bc 1 (.l 2040162194353 (.bc 208847965865 (.bc 1 (.bc 156757920717 (.bc 1 (.bc 73153696333 (.bc 1 (.bc 30677356525 (.bc 1 (.bc 11504008695 (.bc 1 (.bc 3834669563 (.bc 1 (.bc 1127843987 (.bc 1 (.bc 290017023 (.bc 1 (.bc 64448225 (.bc 1 (.bc 12192905 (.bc 1 (.bc 1925193 (.bc 1 (.bc 246817 (.bc 1 (.bc 24679 (.bc 1 (.bc 1803 (.bc 1 (.bc 83 (.bc 1 (.bc 1 (.bc 1 (.bc 81 (.bc 1 (.bc 1719 (.bc 1 (.bc 22957 (.bc 1 (.bc 223857 (.bc 1 (.bc 1701333 (.bc 1 (.bc 10491569 (.bc 1 (.bc 53956653 (.bc 1 (.bc 236060367 (.bc 1 (.bc 891783617 (.bc 1 (.bc 2942885943 (.bc 1 (.bc 8561122749 (.bc 1 (.bc 22116233773 (.bc 1 (.bc 51037462557 (.bc 1 (.bc 105720458157 (.bc 1 (.bc 197344855229 (.bc 1 (.b 144891518108 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) (.c (.bc 1 (.l 4807959808397 (.l 2403979904198 (.bc 188127925092 (.bc 1 (.bc 509323854309 (.bc 1 (.b 504538172692 .nil))))) .nil) (.c (.bc 1 (.l 1682785932937 (.l 841392966468 (.bc 202856069404 (.bc 1 (.b 217840413827 .nil))) .nil) (.c (.bc 1 (.bc 533566271417 (.bc 1 (.bc 152447506117 (.bc 1 (.bc 38998199237 (.bc 1 (.bc 8863227097 (.bc 1 (.bc 1772645417 (.bc 1 (.bc 308286157 (.bc 1 (.bc 45914957 (.bc 1 (.bc 5739367 (.bc 1 (.bc 585647 (.bc 1 (.bc 46849 (.bc 1 (.bc 2753 (.bc 1 (.bc 103 (.bc 1 (.bc 1 (.bc 1 (.bc 101 (.bc 1 (.bc 2649 (.bc 1 (.bc 44197 (.bc 1 (.bc 541447 (.bc 1 (.bc 5197917 (.bc 1 (.bc 40717037 (.bc 1 (.bc 267569117 (.bc 1 (.bc 1505076297 (.bc 1 (.bc 7358150797 (.bc 1 (.bc 31640048437 (.bc 1 (.bc 120807457677 (.bc 1 (.bc 412758813737 (.bc 1 (.bc 1270027119197 (.bc 1 (.l 3537932689197 (.l 1768966344598 (.bc 30605416818 (.bc 1 (.b 853877755478 .nil))) .nil) (.c (.bc 1 (.l 8962762812637 (.l 4481381406318 (.bc 173705459358 (.bc 1 (.bc 1076515748877 (.bc 1 (.b 990469494918 .nil))))) .nil) (.c (.bc 1 (.l 11639256180661 (.l 5819628090330 (.bc 37113719918 (.bc 1 (.bc 893550621597 (.bc 1 (.bc 707394242097 (.bc 1 (.bc 509323854309 (.bc 1 (.bc 333019443201 (.bc 1 (.bc 197344855229 (.bc 1 (.bc 105720458157 (.bc 1 (.bc 51037462557 (.bc 1 (.bc 22116233773 (.bc 1 (.bc 8561122749 (.bc 1 (.bc 2942885943 (.bc 1 (.bc 891783617 (.bc 1 (.bc 236060367 (.bc 1 (.bc 53956653 (.bc 1 (.bc 10491569 (.bc 1 (.bc 1701333 (.bc 1 (.bc 223857 (.bc 1 (.bc 22957 (.bc 1 (.bc 1719 (.bc 1 (.bc 81 (.bc 1 (.bc 1 (.bc 1 (.bc 79 (.bc 1 (.bc 1637 (.bc 1 (.bc 21317 (.bc 1 (.bc 202537 (.bc 1 (.bc 1498793 (.bc 1 (.bc 8992773 (.bc 1 (.bc 44963877 (.bc 1 (.bc 191096487 (.bc 1 (.bc 700687127 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 6318923933 (.bc 1 (.bc 15797309837 (.bc 1 (.b 15189006172 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) (.c (.bc 1 (.l 122497383856144 (.l 61248691928072 (.l 9087132823565 (.l 4543566411782 (.bc 20051146544 (.bc 1 (.bc 70480305437 (.bc 1 (.bc 126864549789 (.bc 1 (.bc 206154893409 (.bc 1 (.bc 303168960897 (.bc 1 (.bc 404225281197 (.bc 1 (.bc 489325340397 (.bc 1 (.bc 538257874437 (.bc 1 (.b 113254853760 .nil))))))))))))))))) .nil) (.c (.bc 1 (.l 21537213140468 (.l 6352851273485 (.bc 425003020676 (.bc 1 (.bc 489325340397 (.bc 1 (.bc 404225281197 (.bc 1 (.bc 303168960897 (.bc 1 (.bc 206154893409 (.bc 1 (.bc 126864549789 (.bc 1 (.bc 70480305437 (.bc 1 (.bc 35240152717 (.bc 1 (.bc 15797309837 (.bc 1 (.bc 6318923933 (.bc 1 (.bc 2242198813 (.bc 1 (.bc 700687127 (.bc 1 (.bc 191096487 (.bc 1 (.bc 44963877 (.bc 1 (.bc 8992773 (.bc 1 (.bc 1498793 (.bc 1 (.bc 202537 (.bc 1 (.bc 21317 (.bc 1 (.bc 1637 (.bc 1 (.bc 79 (.bc 1 (.bc 1 (.bc 1 (.bc 77 (.bc 1 (.bc 1557 (.bc 1 (.bc 19757 (.bc 1 (.bc 182777 (.bc 1 (.bc 1316013 (.bc 1 (.bc 7676757 (.bc 1 (.bc 37287117 (.bc 1 (.bc 153809367 (.bc 1 (.bc 546877757 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 24066445757 (.bc 1 (.bc 46413859677 (.bc 1 (.bc 80450690109 (.bc 1 (.bc 125704203297 (.bc 1 (.bc 177464757597 (.bc 1 (.bc 226760523597 (.bc 1 (.bc 262564816797 (.bc 1 (.b 128992135995 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 4415755296746 (.bc 146700921640 (.bc 1 (.bc 262564816797 (.bc 1 (.bc 226760523597 (.bc 1 (.bc 177464757597 (.bc 1 (.bc 125704203297 (.bc 1 (.bc 80450690109 (.bc 1 (.bc 46413859677 (.bc 1 (.bc 24066445757 (.bc 1 (.bc 11173706957 (.bc 1 (.bc 4623602877 (.bc 1 (.bc 1695321053 (.bc 1 (.bc 546877757 (.bc 1 (.bc 153809367 (.bc 1 (.bc 37287117 (.bc 1 (.bc 7676757 (.bc 1 (.bc 1316013 (.bc 1 (.bc 182777 (.bc 1 (.bc 19757 (.bc 1 (.bc 1557 (.bc 1 (.bc 77 (.bc 1 (.bc 1 (.bc 1 (.bc 75 (.bc 1 (.bc 1479 (.bc 1 (.bc 18275 (.bc 1 (.bc 164499 (.bc 1 (.bc 1151511 (.bc 1 (.bc 6525243 (.bc 1 (.bc 30761871 (.bc 1 (.bc 123047493 (.bc 1 (.bc 423830261 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 16244850885 (.bc 1 (.bc 30169008789 (.bc 1 (.bc 50281681317 (.bc 1 (.bc 75422521977 (.bc 1 (.bc 102042235617 (.bc 1 (.bc 124718287977 (.bc 1 (.bc 137846528817 (.bc 1 (.bc 137846528817 (.bc 1 (.bc 124718287977 (.bc 1 (.bc 102042235617 (.bc 1 (.bc 75422521977 (.bc 1 (.bc 50281681317 (.bc 1 (.bc 30169008789 (.bc 1 (.bc 16244850885 (.bc 1 (.bc 7821594869 (.bc 1 (.bc 3352112085 (.bc 1 (.bc 1271490789 (.bc 1 (.bc 423830261 (.bc 1 (.bc 123047493 (.bc 1 (.bc 30761871 (.bc 1 (.bc 6525243 (.bc 1 (.bc 1151511 (.bc 1 (.bc 164499 (.bc 1 (.bc 18275 (.bc 1 (.bc 1479 (.bc 1 (.bc 75 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil)))) .nil)))) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_398 : Cmd := (.l 4575657527240294400 (.l 2287828763620147200 (.l 1143914381810073600 (.l 571957190905036800 (.l 285978595452518400 (.l 142989297726259200 (.l 71494648863129600 (.l 35747324431564800 (.l 17873662215782400 (.l 8936831107891200 (.l 4468415553945600 (.l 2234207776972800 (.l 1117103888486400 (.l 558551944243200 (.l 279275972121600 (.l 139637986060800 (.l 69818993030400 (.l 34909496515200 (.l 17454748257600 (.l 8727374128800 (.l 4363687064400 (.l 2181843532200 (.bc 1 (.bc 1 (.bc 73 (.bc 1 (.bc 1403 (.bc 1 (.bc 16869 (.bc 1 (.bc 147627 (.bc 1 (.bc 1003881 (.bc 1 (.bc 5521359 (.bc 1 (.bc 25240509 (.bc 1 (.bc 97806981 (.bc 1 (.bc 326023277 (.bc 1 (.bc 945467509 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 30942573117 (.bc 1 (.bc 44479948857 (.bc 1 (.bc 57562286757 (.bc 1 (.bc 67156001217 (.bc 1 (.bc 70690527597 (.bc 1 (.bc 67156001217 (.bc 1 (.bc 57562286757 (.bc 1 (.bc 44479948857 (.bc 1 (.bc 30942573117 (.bc 1 (.bc 19339108197 (.bc 1 (.bc 10829900589 (.bc 1 (.bc 5414950293 (.bc 1 (.bc 2406644573 (.bc 1 (.bc 945467509 (.bc 1 (.bc 326023277 (.bc 1 (.bc 97806981 (.bc 1 (.bc 25240509 (.bc 1 (.bc 5521359 (.bc 1 (.bc 1003881 (.bc 1 (.bc 147627 (.bc 1 (.bc 16869 (.bc 1 (.bc 1403 (.bc 1 (.bc 73 (.bc 1 (.bc 1 (.bc 1 (.bc 71 (.bc 1 (.bc 1329 (.bc 1 (.bc 15537 (.bc 1 (.bc 132087 (.bc 1 (.bc 871791 (.bc 1 (.bc 4649565 (.bc 1 (.bc 20590941 (.bc 1 (.bc 77216037 (.bc 1 (.bc 248807237 (.bc 1 (.bc 696660269 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 25751549337 (.bc 1 (.bc 31810737417 (.bc 1 (.bc 35345263797 (.bc 1 (.bc 35345263797 (.bc 1 (.bc 31810737417 (.bc 1 (.bc 25751549337 (.bc 1 (.bc 18728399517 (.bc 1 (.bc 12214173597 (.bc 1 (.bc 7124934597 (.bc 1 (.bc 3704965989 (.bc 1 (.bc 1709984301 (.bc 1 (.bc 696660269 (.bc 1 (.bc 248807237 (.bc 1 (.bc 77216037 (.bc 1 (.bc 20590941 (.bc 1 (.bc 4649565 (.bc 1 (.bc 871791 (.bc 1 (.bc 132087 (.bc 1 (.bc 15537 (.bc 1 (.bc 1329 (.bc 1 (.bc 71 (.bc 1 (.bc 1 (.bc 1 (.bc 69 (.bc 1 (.bc 1257 (.bc 1 (.bc 14277 (.bc 1 (.bc 117807 (.bc 1 (.bc 753981 (.bc 1 (.bc 3895581 (.bc 1 (.bc 16695357 (.bc 1 (.bc 60520677 (.bc 1 (.bc 188286557 (.bc 1 (.bc 508373709 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 17194993197 (.bc 1 (.bc 18150270597 (.bc 1 (.bc 17194993197 (.bc 1 (.bc 14615744217 (.bc 1 (.bc 11135805117 (.bc 1 (.bc 7592594397 (.bc 1 (.bc 4621579197 (.bc 1 (.bc 2503355397 (.bc 1 (.bc 1201610589 (.bc 1 (.bc 508373709 (.bc 1 (.bc 188286557 (.bc 1 (.bc 60520677 (.bc 1 (.bc 16695357 (.bc 1 (.bc 3895581 (.bc 1 (.bc 753981 (.bc 1 (.bc 117807 (.bc 1 (.bc 14277 (.bc 1 (.bc 1257 (.bc 1 (.bc 69 (.bc 1 (.bc 1 (.bc 1 (.bc 67 (.bc 1 (.bc 1187 (.bc 1 (.bc 13087 (.bc 1 (.bc 104717 (.bc 1 (.bc 649261 (.bc 1 (.bc 3246317 (.bc 1 (.bc 13449037 (.bc 1 (.bc 47071637 (.bc 1 (.bc 141214917 (.bc 1 (.bc 367158789 (.bc 1 (.bc 834451797 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 9075135297 (.bc 1 (.bc 8119857897 (.bc 1 (.bc 6495886317 (.bc 1 (.bc 4639918797 (.bc 1 (.bc 2952675597 (.bc 1 (.bc 1668903597 (.bc 1 (.bc 834451797 (.bc 1 (.bc 367158789 (.bc 1 (.bc 141214917 (.bc 1 (.bc 47071637 (.bc 1 (.bc 13449037 (.bc 1 (.bc 3246317 (.bc 1 (.bc 649261 (.bc 1 (.bc 104717 (.bc 1 (.bc 13087 (.bc 1 (.bc 1187 (.bc 1 (.bc 67 (.bc 1 (.bc 1 (.bc 1 (.bc 65 (.bc 1 (.bc 1119 (.bc 1 (.bc 11965 (.bc 1 (.bc 92749 (.bc 1 (.bc 556509 (.bc 1 (.bc 2689805 (.bc 1 (.bc 10759229 (.bc 1 (.bc 36312405 (.bc 1 (.bc 104902509 (.bc 1 (.bc 262256277 (.bc 1 (.bc 572195517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 4667212437 (.bc 1 (.bc 4407922857 (.bc 1 (.bc 3711935037 (.bc 1 (.bc 2783951277 (.bc 1 (.bc 1855967517 (.bc 1 (.bc 1096708077 (.bc 1 (.bc 572195517 (.bc 1 (.bc 262256277 (.bc 1 (.bc 104902509 (.bc 1 (.bc 36312405 (.bc 1 (.bc 10759229 (.bc 1 (.bc 2689805 (.bc 1 (.bc 556509 (.bc 1 (.bc 92749 (.bc 1 (.bc 11965 (.bc 1 (.bc 1119 (.bc 1 (.bc 65 (.bc 1 (.bc 1 (.bc 1 (.bc 63 (.bc 1 (.bc 1053 (.bc 1 (.bc 10909 (.bc 1 (.bc 81837 (.bc 1 (.bc 474669 (.bc 1 (.bc 2215133 (.bc 1 (.bc 8544093 (.bc 1 (.bc 27768309 (.bc 1 (.bc 77134197 (.bc 1 (.bc 185122077 (.bc 1 (.bc 387073437 (.bc 1 (.bc 709634637 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2333606217 (.bc 1 (.bc 2074316637 (.bc 1 (.bc 1637618397 (.bc 1 (.bc 1146332877 (.bc 1 (.bc 709634637 (.bc 1 (.bc 387073437 (.bc 1 (.bc 185122077 (.bc 1 (.bc 77134197 (.bc 1 (.bc 27768309 (.bc 1 (.bc 8544093 (.bc 1 (.bc 2215133 (.bc 1 (.bc 474669 (.bc 1 (.bc 81837 (.bc 1 (.bc 10909 (.bc 1 (.bc 1053 (.bc 1 (.bc 63 (.bc 1 (.bc 1 (.bc 1 (.bc 61 (.bc 1 (.bc 989 (.bc 1 (.bc 9917 (.bc 1 (.bc 71917 (.bc 1 (.bc 402749 (.bc 1 (.bc 1812381 (.bc 1 (.bc 6731709 (.bc 1 (.bc 21036597 (.bc 1 (.bc 56097597 (.bc 1 (.bc 129024477 (.bc 1 (.bc 258048957 (.bc 1 (.bc 451585677 (.bc 1 (.bc 694747197 (.bc 1 (.bc 942871197 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 1202160777 (.bc 1 (.bc 1131445437 (.bc 1 (.bc 942871197 (.bc 1 (.bc 694747197 (.bc 1 (.bc 451585677 (.bc 1 (.bc 258048957 (.bc 1 (.bc 129024477 (.bc 1 (.bc 56097597 (.bc 1 (.bc 21036597 (.bc 1 (.bc 6731709 (.bc 1 (.bc 1812381 (.bc 1 (.bc 402749 (.bc 1 (.bc 71917 (.bc 1 (.bc 9917 (.bc 1 (.bc 989 (.bc 1 (.bc 61 (.bc 1 (.bc 1 (.bc 1 (.bc 59 (.bc 1 (.bc 927 (.bc 1 (.bc 8987 (.bc 1 (.bc 62927 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_399 : Cmd := (.l 35978673433608192 (.l 17989336716804096 (.l 8994668358402048 (.l 4497334179201024 (.l 2248667089600512 (.l 1124333544800256 (.l 562166772400128 (.l 281083386200064 (.l 140541693100032 (.l 70270846550016 (.l 35135423275008 (.l 17567711637504 (.l 8783855818752 (.l 4391927909376 (.l 2195963954688 (.l 1097981977344 (.l 548990988672 (.l 274495494336 (.l 137247747168 (.l 68623873584 (.l 34311936792 (.l 17155968396 (.bc 339819 (.bc 1 (.bc 1472559 (.bc 1 (.bc 5259147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 40320147 (.bc 1 (.bc 88704327 (.bc 1 (.bc 169344627 (.bc 1 (.bc 282241047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 530365047 (.bc 1 (.bc 601080387 (.bc 1 (.bc 601080387 (.bc 1 (.bc 530365047 (.bc 1 (.bc 412506147 (.bc 1 (.bc 282241047 (.bc 1 (.bc 169344627 (.bc 1 (.bc 88704327 (.bc 1 (.bc 40320147 (.bc 1 (.bc 15777447 (.bc 1 (.bc 5259147 (.bc 1 (.bc 1472559 (.bc 1 (.bc 339819 (.bc 1 (.bc 62927 (.bc 1 (.bc 8987 (.bc 1 (.bc 927 (.bc 1 (.bc 59 (.bc 1 (.bc 1 (.bc 1 (.bc 57 (.bc 1 (.bc 867 (.bc 1 (.bc 8117 (.bc 1 (.bc 54807 (.bc 1 (.bc 285009 (.bc 1 (.bc 1187547 (.bc 1 (.bc 4071597 (.bc 1 (.bc 11705847 (.bc 1 (.bc 28614297 (.bc 1 (.bc 60090027 (.bc 1 (.bc 109254597 (.bc 1 (.bc 172986447 (.bc 1 (.bc 239519697 (.bc 1 (.bc 290845347 (.bc 1 (.bc 310235037 (.bc 1 (.bc 290845347 (.bc 1 (.bc 239519697 (.bc 1 (.bc 172986447 (.bc 1 (.bc 109254597 (.bc 1 (.bc 60090027 (.bc 1 (.bc 28614297 (.bc 1 (.bc 11705847 (.bc 1 (.bc 4071597 (.bc 1 (.bc 1187547 (.bc 1 (.bc 285009 (.bc 1 (.bc 54807 (.bc 1 (.bc 8117 (.bc 1 (.bc 867 (.bc 1 (.bc 57 (.bc 1 (.bc 1 (.bc 1 (.bc 55 (.bc 1 (.bc 809 (.bc 1 (.bc 7305 (.bc 1 (.bc 47499 (.bc 1 (.bc 237507 (.bc 1 (.bc 950037 (.bc 1 (.bc 3121557 (.bc 1 (.bc 8584287 (.bc 1 (.bc 20030007 (.bc 1 (.bc 40060017 (.bc 1 (.bc 69194577 (.bc 1 (.bc 103791867 (.bc 1 (.bc 135727827 (.bc 1 (.bc 155117517 (.bc 1 (.bc 155117517 (.bc 1 (.bc 135727827 (.bc 1 (.bc 103791867 (.bc 1 (.bc 69194577 (.bc 1 (.bc 40060017 (.bc 1 (.bc 20030007 (.bc 1 (.bc 8584287 (.bc 1 (.bc 3121557 (.bc 1 (.bc 950037 (.bc 1 (.bc 237507 (.bc 1 (.bc 47499 (.bc 1 (.bc 7305 (.bc 1 (.bc 809 (.bc 1 (.bc 55 (.bc 1 (.bc 1 (.bc 1 (.bc 53 (.bc 1 (.bc 753 (.bc 1 (.bc 6549 (.bc 1 (.bc 40947 (.bc 1 (.bc 196557 (.bc 1 (.bc 753477 (.bc 1 (.bc 2368077 (.bc 1 (.bc 6216207 (.bc 1 (.bc 13813797 (.bc 1 (.bc 26246217 (.bc 1 (.bc 42948357 (.bc 1 (.bc 60843507 (.bc 1 (.bc 74884317 (.bc 1 (.bc 80233197 (.bc 1 (.bc 74884317 (.bc 1 (.bc 60843507 (.bc 1 (.bc 42948357 (.bc 1 (.bc 26246217 (.bc 1 (.bc 13813797 (.bc 1 (.bc 6216207 (.bc 1 (.bc 2368077 (.bc 1 (.bc 753477 (.bc 1 (.bc 196557 (.bc 1 (.bc 40947 (.bc 1 (.bc 6549 (.bc 1 (.bc 753 (.bc 1 (.bc 53 (.bc 1 (.bc 1 (.bc 1 (.bc 51 (.bc 1 (.bc 699 (.bc 1 (.bc 5847 (.bc 1 (.bc 35097 (.bc 1 (.bc 161457 (.bc 1 (.bc 592017 (.bc 1 (.bc 1776057 (.bc 1 (.bc 4440147 (.bc 1 (.bc 9373647 (.bc 1 (.bc 16872567 (.bc 1 (.bc 26075787 (.bc 1 (.bc 34767717 (.bc 1 (.bc 40116597 (.bc 1 (.bc 40116597 (.bc 1 (.bc 34767717 (.bc 1 (.bc 26075787 (.bc 1 (.bc 16872567 (.bc 1 (.bc 9373647 (.bc 1 (.bc 4440147 (.bc 1 (.bc 1776057 (.bc 1 (.bc 592017 (.bc 1 (.bc 161457 (.bc 1 (.bc 35097 (.bc 1 (.bc 5847 (.bc 1 (.bc 699 (.bc 1 (.bc 51 (.bc 1 (.bc 1 (.bc 1 (.bc 49 (.bc 1 (.bc 647 (.bc 1 (.bc 5197 (.bc 1 (.bc 29897 (.bc 1 (.bc 131557 (.bc 1 (.bc 460457 (.bc 1 (.bc 1315597 (.bc 1 (.bc 3124547 (.bc 1 (.bc 6249097 (.bc 1 (.bc 10623467 (.bc 1 (.bc 15452317 (.bc 1 (.bc 19315397 (.bc 1 (.bc 20801197 (.bc 1 (.bc 19315397 (.bc 1 (.bc 15452317 (.bc 1 (.bc 10623467 (.bc 1 (.bc 6249097 (.bc 1 (.bc 3124547 (.bc 1 (.bc 1315597 (.bc 1 (.bc 460457 (.bc 1 (.bc 131557 (.bc 1 (.bc 29897 (.bc 1 (.bc 5197 (.bc 1 (.bc 647 (.bc 1 (.bc 49 (.bc 1 (.bc 1 (.bc 1 (.bc 47 (.bc 1 (.bc 597 (.bc 1 (.bc 4597 (.bc 1 (.bc 25297 (.bc 1 (.bc 106257 (.bc 1 (.bc 354197 (.bc 1 (.bc 961397 (.bc 1 (.bc 2163147 (.bc 1 (.bc 4085947 (.bc 1 (.bc 6537517 (.bc 1 (.bc 8914797 (.bc 1 (.bc 10400597 (.bc 1 (.bc 10400597 (.bc 1 (.bc 8914797 (.bc 1 (.bc 6537517 (.bc 1 (.bc 4085947 (.bc 1 (.bc 2163147 (.bc 1 (.bc 961397 (.bc 1 (.bc 354197 (.bc 1 (.bc 106257 (.bc 1 (.bc 25297 (.bc 1 (.bc 4597 (.bc 1 (.bc 597 (.bc 1 (.bc 47 (.bc 1 (.bc 1 (.bc 1 (.bc 45 (.bc 1 (.bc 549 (.bc 1 (.bc 4045 (.bc 1 (.bc 21249 (.bc 1 (.bc 85005 (.bc 1 (.bc 269189 (.bc 1 (.bc 692205 (.bc 1 (.bc 1470939 (.bc 1 (.bc 2615005 (.bc 1 (.bc 3922509 (.bc 1 (.bc 4992285 (.bc 1 (.bc 5408309 (.bc 1 (.bc 4992285 (.bc 1 (.bc 3922509 (.bc 1 (.bc 2615005 (.bc 1 (.bc 1470939 (.bc 1 (.bc 692205 (.bc 1 (.bc 269189 (.bc 1 (.bc 85005 (.bc 1 (.bc 21249 (.bc 1 (.bc 4045 (.bc 1 (.bc 549 (.bc 1 (.bc 45 (.bc 1 (.bc 1 (.bc 1 (.bc 43 (.bc 1 (.bc 503 (.bc 1 (.bc 3539 (.bc 1 (.bc 17707 (.bc 1 (.bc 67295 (.bc 1 (.bc 201891 (.bc 1 (.bc 490311 (.bc 1 (.bc 980625 (.bc 1 (.bc 1634377 (.bc 1 (.bc 2288129 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2704153 (.bc 1 (.bc 2288129 (.bc 1 (.bc 1634377 (.bc 1 (.bc 980625 (.bc 1 (.bc 490311 (.bc 1 (.bc 201891 (.bc 1 (.bc 67295 (.bc 1 (.bc 17707 (.bc 1 (.bc 3539 (.bc 1 (.bc 503 (.bc 1 (.bc 43 (.bc 1 (.bc 1 (.bc 1 (.bc 41 (.bc 1 (.bc 459 (.bc 1 (.bc 3077 (.bc 1 (.bc 14627 (.bc 1 (.bc 52665 (.bc 1 (.bc 149223 (.bc 1 (.bc 341085 (.bc 1 (.bc 639537 (.bc 1 (.bc 994837 (.bc 1 (.bc 1293289 (.bc 1 (.bc 1410861 (.bc 1 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) +def cmd_400 : Cmd := (.l 49817745096703 (.l 24908872548351 (.l 12454436274175 (.l 6227218137087 (.l 3113609068543 (.l 1556804534271 (.l 778402267135 (.l 389201133567 (.l 194600566783 (.l 97300283391 (.l 48650141695 (.l 24325070847 (.l 12162535423 (.l 6081267711 (.l 3040633855 (.l 1520316927 (.l 760158463 (.l 380079231 (.l 190039615 (.l 95019807 (.l 47509903 (.l 23754951 (.bc 1293289 (.bc 1 (.bc 994837 (.bc 1 (.bc 639537 (.bc 1 (.bc 341085 (.bc 1 (.bc 149223 (.bc 1 (.bc 52665 (.bc 1 (.bc 14627 (.bc 1 (.bc 3077 (.bc 1 (.bc 459 (.bc 1 (.bc 41 (.bc 1 (.bc 1 (.bc 1 (.bc 39 (.bc 1 (.bc 417 (.bc 1 (.bc 2657 (.bc 1 (.bc 11967 (.bc 1 (.bc 40695 (.bc 1 (.bc 108525 (.bc 1 (.bc 232557 (.bc 1 (.bc 406977 (.bc 1 (.bc 587857 (.bc 1 (.bc 705429 (.bc 1 (.bc 705429 (.bc 1 (.bc 587857 (.bc 1 (.bc 406977 (.bc 1 (.bc 232557 (.bc 1 (.bc 108525 (.bc 1 (.bc 40695 (.bc 1 (.bc 11967 (.bc 1 (.bc 2657 (.bc 1 (.bc 417 (.bc 1 (.bc 39 (.bc 1 (.bc 1 (.bc 1 (.bc 37 (.bc 1 (.bc 377 (.bc 1 (.bc 2277 (.bc 1 (.bc 9687 (.bc 1 (.bc 31005 (.bc 1 (.bc 77517 (.bc 1 (.bc 155037 (.bc 1 (.bc 251937 (.bc 1 (.bc 335917 (.bc 1 (.bc 369509 (.bc 1 (.bc 335917 (.bc 1 (.bc 251937 (.bc 1 (.bc 155037 (.bc 1 (.bc 77517 (.bc 1 (.bc 31005 (.bc 1 (.bc 9687 (.bc 1 (.bc 2277 (.bc 1 (.bc 377 (.bc 1 (.bc 37 (.bc 1 (.bc 1 (.bc 1 (.bc 35 (.bc 1 (.bc 339 (.bc 1 (.bc 1935 (.bc 1 (.bc 7749 (.bc 1 (.bc 23253 (.bc 1 (.bc 54261 (.bc 1 (.bc 100773 (.bc 1 (.bc 151161 (.bc 1 (.bc 184753 (.bc 1 (.bc 184753 (.bc 1 (.bc 151161 (.bc 1 (.bc 100773 (.bc 1 (.bc 54261 (.bc 1 (.bc 23253 (.bc 1 (.bc 7749 (.bc 1 (.bc 1935 (.bc 1 (.bc 339 (.bc 1 (.bc 35 (.bc 1 (.bc 1 (.bc 1 (.bc 33 (.bc 1 (.bc 303 (.bc 1 (.bc 1629 (.bc 1 (.bc 6117 (.bc 1 (.bc 17133 (.bc 1 (.bc 37125 (.bc 1 (.bc 63645 (.bc 1 (.bc 87513 (.bc 1 (.bc 97237 (.bc 1 (.bc 87513 (.bc 1 (.bc 63645 (.bc 1 (.bc 37125 (.bc 1 (.bc 17133 (.bc 1 (.bc 6117 (.bc 1 (.bc 1629 (.bc 1 (.bc 303 (.bc 1 (.bc 33 (.bc 1 (.bc 1 (.bc 1 (.bc 31 (.bc 1 (.bc 269 (.bc 1 (.bc 1357 (.bc 1 (.bc 4757 (.bc 1 (.bc 12373 (.bc 1 (.bc 24749 (.bc 1 (.bc 38893 (.bc 1 (.bc 48617 (.bc 1 (.bc 48617 (.bc 1 (.bc 38893 (.bc 1 (.bc 24749 (.bc 1 (.bc 12373 (.bc 1 (.bc 4757 (.bc 1 (.bc 1357 (.bc 1 (.bc 269 (.bc 1 (.bc 31 (.bc 1 (.bc 1 (.bc 1 (.bc 29 (.bc 1 (.bc 237 (.bc 1 (.bc 1117 (.bc 1 (.bc 3637 (.bc 1 (.bc 8733 (.bc 1 (.bc 16013 (.bc 1 (.bc 22877 (.bc 1 (.bc 25737 (.bc 1 (.bc 22877 (.bc 1 (.bc 16013 (.bc 1 (.bc 8733 (.bc 1 (.bc 3637 (.bc 1 (.bc 1117 (.bc 1 (.bc 237 (.bc 1 (.bc 29 (.bc 1 (.bc 1 (.bc 1 (.bc 27 (.bc 1 (.bc 207 (.bc 1 (.bc 907 (.bc 1 (.bc 2727 (.bc 1 (.bc 6003 (.bc 1 (.bc 10007 (.bc 1 (.bc 12867 (.bc 1 (.bc 12867 (.bc 1 (.bc 10007 (.bc 1 (.bc 6003 (.bc 1 (.bc 2727 (.bc 1 (.bc 907 (.bc 1 (.bc 207 (.bc 1 (.bc 27 (.bc 1 (.bc 1 (.bc 1 (.bc 25 (.bc 1 (.bc 179 (.bc 1 (.bc 725 (.bc 1 (.bc 1999 (.bc 1 (.bc 4001 (.bc 1 (.bc 6003 (.bc 1 (.bc 6861 (.bc 1 (.bc 6003 (.bc 1 (.bc 4001 (.bc 1 (.bc 1999 (.bc 1 (.bc 725 (.bc 1 (.bc 179 (.bc 1 (.bc 25 (.bc 1 (.bc 1 (.bc 1 (.bc 23 (.bc 1 (.bc 153 (.bc 1 (.bc 569 (.bc 1 (.bc 1427 (.bc 1 (.bc 2571 (.bc 1 (.bc 3429 (.bc 1 (.bc 3429 (.bc 1 (.bc 2571 (.bc 1 (.bc 1427 (.bc 1 (.bc 569 (.bc 1 (.bc 153 (.bc 1 (.bc 23 (.bc 1 (.bc 1 (.bc 1 (.bc 21 (.bc 1 (.bc 129 (.bc 1 (.bc 437 (.bc 1 (.bc 987 (.bc 1 (.bc 1581 (.bc 1 (.bc 1845 (.bc 1 (.bc 1581 (.bc 1 (.bc 987 (.bc 1 (.bc 437 (.bc 1 (.bc 129 (.bc 1 (.bc 21 (.bc 1 (.bc 1 (.bc 1 (.bc 19 (.bc 1 (.bc 107 (.bc 1 (.bc 327 (.bc 1 (.bc 657 (.bc 1 (.bc 921 (.bc 1 (.bc 921 (.bc 1 (.bc 657 (.bc 1 (.bc 327 (.bc 1 (.bc 107 (.bc 1 (.bc 19 (.bc 1 (.bc 1 (.bc 1 (.bc 17 (.bc 1 (.bc 87 (.bc 1 (.bc 237 (.bc 1 (.bc 417 (.bc 1 (.bc 501 (.bc 1 (.bc 417 (.bc 1 (.bc 237 (.bc 1 (.bc 87 (.bc 1 (.bc 17 (.bc 1 (.bc 1 (.bc 1 (.bc 15 (.bc 1 (.bc 69 (.bc 1 (.bc 165 (.bc 1 (.bc 249 (.bc 1 (.bc 249 (.bc 1 (.bc 165 (.bc 1 (.bc 69 (.bc 1 (.bc 15 (.bc 1 (.bc 1 (.bc 1 (.bc 13 (.bc 1 (.bc 53 (.bc 1 (.bc 109 (.bc 1 (.bc 137 (.bc 1 (.bc 109 (.bc 1 (.bc 53 (.bc 1 (.bc 13 (.bc 1 (.bc 1 (.bc 1 (.bc 11 (.bc 1 (.bc 39 (.bc 1 (.bc 67 (.bc 1 (.bc 67 (.bc 1 (.bc 39 (.bc 1 (.bc 11 (.bc 1 (.bc 1 (.bc 1 (.bc 9 (.bc 1 (.bc 27 (.bc 1 (.bc 37 (.bc 1 (.bc 27 (.bc 1 (.bc 9 (.bc 1 (.bc 1 (.bc 1 (.bc 7 (.bc 1 (.bc 17 (.bc 1 (.bc 17 (.bc 1 (.bc 7 (.bc 1 (.bc 1 (.bc 1 (.bc 5 (.bc 1 (.bc 9 (.bc 1 (.bc 5 (.bc 1 (.bc 1 (.bc 1 (.bc 3 (.bc 1 (.bc 3 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.bc 1 (.b 1 .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.l 37932986277275107328 (.l 18966493138637553664 (.l 9483246569318776832 (.l 4741623284659388416 (.l 2370811642329694208 (.l 1185405821164847104 (.l 592702910582423552 (.l 296351455291211776 (.l 148175727645605888 (.l 74087863822802944 (.l 37043931911401472 (.l 18521965955700736 (.l 9260982977850368 (.l 4630491488925184 (.l 2315245744462592 (.l 1157622872231296 (.l 578811436115648 (.l 289405718057824 (.l 144702859028912 (.l 72351429514456 (.l 17955917063273 (.l 7734259989093 (.c (.c (.b 3867129994544 .nil))) (.c (.bc 1 (.b 1243698542540 .nil)))) (.c (.bc 1 (.l 18219797693952 (.bc 5133651920295 (.bc 1 (.bc 2585412349797 (.bc 1 (.bc 952520339397 (.bc 1 (.bc 317506779797 (.bc 1 (.bc 95252033937 (.bc 1 (.bc 25555423737 .nil))))))))))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil))) +def cmd_401 : Cmd := (.l 1358392837229425809441 (.l 679196418614712904720 (.l 339598209307356452360 (.l 164039770382622754917 (.l 72989121306704290983 (.l 27193612071658311701 (.l 5446015322751816309 (.l 2723007661375908154 (.l 1361503830687954077 (.l 680751915343977038 (.l 340375957671988519 (.l 170187978835994259 (.l 85093989417997129 (.l 42546994708998564 (.l 21273497354499282 (.l 10636748677249641 (.l 4029836279518971 (.l 2014918139759485 (.l 1007459069879742 (.l 503729534939871 (.l 67124157029345 (.bc 1 (.bc 6084624697 (.bc 1 (.bc 1273526097 (.bc 1 (.bc 231550197 (.bc 1 (.bc 36018917 (.bc 1 (.bc 4698117 (.bc 1 (.bc 499797 (.bc 1 (.bc 41647 (.bc 1 (.bc 2547 (.bc 1 (.bc 99 (.bc 1 (.bc 1 (.bc 1 (.bc 97 (.bc 1 (.bc 2447 (.bc 1 (.bc 39197 (.bc 1 (.bc 460597 (.bc 1 (.bc 4237517 (.bc 1 (.bc 31781397 (.bc 1 (.bc 199768797 (.bc 1 (.bc 1073757297 (.bc 1 (.bc 5010867397 (.bc 1 (.bc 20544556337 (.bc 1 (.bc 74707477597 (.bc 1 (.bc 242799302197 (.bc 1 (.bc 709721037197 (.bc 1 (.bc 1875691312597 (.bc 1 (.bc 4501659150237 (.bc 1 (.bc 9847379391147 (.bc 1 (.b 16275624410424 .nil)))))))))))))))))))))))))))))))))))))))))))))))))))))) (.c (.bc 1 (.l 152720761083797 (.bc 3419134371871 (.bc 1 (.bc 36107057767547 (.bc 1 (.b 36834188402474 .nil))))) (.c (.bc 1 (.b 32019849356787 .nil))))))) .nil) .nil) .nil) (.c (.bc 1 (.l 1288538059105846 (.l 320647054864684 (.l 160323527432342 (.l 80161763716171 (.l 40080881858086 (.bc 7967773685528 (.bc 1 (.b 12072667243512 .nil))) .nil) .nil) .nil) (.c (.bc 1 (.b 323621974688236 .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 8150790713077339538 (.l 4075395356538669769 (.l 2037697678269334884 (.l 1018848839134667442 (.l 509424419567333721 (.l 254712209783666861 (.l 127356104891833431 (.l 4911985528196881 (.l 2455992764098440 (.l 1227996382049220 (.l 613998191024610 (.l 306999095512305 (.bc 69071620356282 (.bc 1 (.b 84427927399867 .nil))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.l 58766066917719832 (.l 27383111520970935 (.l 13691555760485467 (.l 6845777880242733 (.l 3422888940121367 (.l 1711444470060684 (.l 615233100811631 (.l 101060890798326 (.bc 42771940356871 (.bc 1 (.b 7758505042289 .nil))) (.c (.bc 1 (.b 206555659607486 .nil)))) (.c (.bc 1 (.l 240489134218708 (.l 120244567109354 (.bc 23618557279562 (.bc 1 (.b 36503726275112 .nil))) .nil) .nil)))) .nil) .nil) .nil) .nil) (.c (.bc 1 (.b 1999921937888978 .nil)))) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.l 9300948581693833787 (.l 4650474290846916893 (.l 2325237145423458446 (.l 1162618572711729223 (.l 581309286355864612 (.l 290654643177932306 (.l 145327321588966153 (.l 72663660794483076 (.l 36331830397241538 (.l 18165915198620769 (.l 9082957599310384 (.l 4541478799655192 (.l 2270739399827596 (.l 680839732797275 (.l 340419866398637 (.bc 25934620871480 (.bc 1 (.b 144275312327836 .nil))) .nil) (.c (.bc 1 (.l 454529967116520 (.l 227264983558260 (.l 113632491779130 (.bc 40266547514668 (.bc 1 (.b 16549698374894 .nil))) .nil) .nil) .nil)))) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil) .nil)))) (.c (.bc 1 (.b 9030763884607086472 .nil)))) (.c (.bc 1 (.l 5759334271055471260 (.l 2879667135527735630 (.l 1439833567763867815 (.b 719916783881933907 .nil) .nil) .nil) .nil)))) .nil) .nil) .nil) +def fullProg : Prog := (.inc (.inc (.inc (.inc (.hier cmd_4 (.inc (.inc (.inc (.hier cmd_8 (.inc (.inc (.inc (.hier cmd_12 (.inc (.inc (.inc (.hier cmd_16 (.inc (.inc (.inc (.hier cmd_20 (.inc (.inc (.inc (.hier cmd_24 (.inc (.inc (.inc (.hier cmd_28 (.inc (.inc (.inc (.hier cmd_32 (.inc (.inc (.inc (.hier cmd_36 (.inc (.inc (.inc (.hier cmd_40 (.inc (.inc (.inc (.hier cmd_44 (.inc (.inc (.inc (.hier cmd_48 (.inc (.inc (.inc (.hier cmd_52 (.inc (.inc (.inc (.hier cmd_56 (.inc (.inc (.inc (.hier cmd_60 (.inc (.inc (.inc (.hier cmd_64 (.inc (.inc (.inc (.hier cmd_68 (.inc (.inc (.inc (.hier cmd_72 (.inc (.inc (.inc (.hier cmd_76 (.inc (.inc (.inc (.hier cmd_80 (.inc (.inc (.inc (.hier cmd_84 (.inc (.inc (.inc (.hier cmd_88 (.inc (.inc (.inc (.hier cmd_92 (.inc (.inc (.inc (.hier cmd_96 (.inc (.inc (.inc (.hier cmd_100 (.inc (.inc (.inc (.hier cmd_104 (.inc (.inc (.inc (.hier cmd_108 (.inc (.inc (.inc (.hier cmd_112 (.inc (.inc (.inc (.hier cmd_116 (.inc (.inc (.inc (.hier cmd_120 (.inc (.inc (.inc (.hier cmd_124 (.inc (.inc (.inc (.hier cmd_128 (.inc (.inc (.inc (.hier cmd_132 (.inc (.inc (.inc (.hier cmd_136 (.inc (.inc (.inc (.hier cmd_140 (.inc (.inc (.inc (.hier cmd_144 (.hier cmd_145 (.inc (.inc (.inc (.hier cmd_149 (.inc (.inc (.inc (.hier cmd_153 (.inc (.inc (.inc (.hier cmd_157 (.hier cmd_158 (.inc (.inc (.inc (.hier cmd_162 (.hier cmd_163 (.inc (.inc (.inc (.hier cmd_167 (.inc (.inc (.inc (.hier cmd_171 (.hier cmd_172 (.inc (.inc (.inc (.hier cmd_176 (.hier cmd_177 (.inc (.inc (.inc (.hier cmd_181 (.inc (.inc (.inc (.hier cmd_185 (.hier cmd_186 (.inc (.inc (.inc (.hier cmd_190 (.hier cmd_191 (.inc (.inc (.inc (.hier cmd_195 (.hier cmd_196 (.inc (.inc (.inc (.hier cmd_200 (.inc (.inc (.inc (.hier cmd_204 (.hier cmd_205 (.inc (.inc (.inc (.hier cmd_209 (.hier cmd_210 (.hier cmd_211 (.inc (.inc (.inc (.hier cmd_215 (.inc (.inc (.inc (.hier cmd_219 (.hier cmd_220 (.hier cmd_221 (.inc (.inc (.inc (.hier cmd_225 (.hier cmd_226 (.hier cmd_227 (.inc (.inc (.inc (.hier cmd_231 (.inc (.inc (.inc (.hier cmd_235 (.hier cmd_236 (.hier cmd_237 (.inc (.inc (.inc (.hier cmd_241 (.hier cmd_242 (.hier cmd_243 (.inc (.inc (.inc (.hier cmd_247 (.inc (.inc (.inc (.hier cmd_251 (.hier cmd_252 (.hier cmd_253 (.inc (.inc (.inc (.hier cmd_257 (.inc (.inc (.inc (.hier cmd_261 (.hier cmd_262 (.hier cmd_263 (.inc (.inc (.inc (.hier cmd_267 (.hier cmd_268 (.hier cmd_269 (.inc (.inc (.inc (.hier cmd_273 (.hier cmd_274 (.inc (.inc (.inc (.hier cmd_278 (.hier cmd_279 (.hier cmd_280 (.inc (.inc (.inc (.hier cmd_284 (.hier cmd_285 (.hier cmd_286 (.hier cmd_287 (.inc (.inc (.inc (.hier cmd_291 (.hier cmd_292 (.hier cmd_293 (.hier cmd_294 (.inc (.inc (.inc (.hier cmd_298 (.hier cmd_299 (.inc (.inc (.inc (.hier cmd_303 (.hier cmd_304 (.hier cmd_305 (.hier cmd_306 (.inc (.inc (.inc (.hier cmd_310 (.hier cmd_311 (.hier cmd_312 (.hier cmd_313 (.inc (.inc (.inc (.hier cmd_317 (.hier cmd_318 (.hier cmd_319 (.hier cmd_320 (.inc (.inc (.inc (.hier cmd_324 (.hier cmd_325 (.hier cmd_326 (.hier cmd_327 (.hier cmd_328 (.inc (.inc (.inc (.hier cmd_332 (.inc (.inc (.inc (.hier cmd_336 (.hier cmd_337 (.hier cmd_338 (.hier cmd_339 (.hier cmd_340 (.inc (.inc (.inc (.hier cmd_344 (.hier cmd_345 (.hier cmd_346 (.hier cmd_347 (.hier cmd_348 (.inc (.inc (.inc (.hier cmd_352 (.inc (.inc (.inc (.hier cmd_356 (.hier cmd_357 (.hier cmd_358 (.hier cmd_359 (.hier cmd_360 (.inc (.inc (.inc (.hier cmd_364 (.hier cmd_365 (.hier cmd_366 (.hier cmd_367 (.hier cmd_368 (.inc (.inc (.inc (.hier cmd_372 (.inc (.inc (.inc (.hier cmd_376 (.hier cmd_377 (.hier cmd_378 (.hier cmd_379 (.hier cmd_380 (.inc (.inc (.inc (.hier cmd_384 (.inc (.inc (.inc (.hier cmd_388 (.hier cmd_389 (.hier cmd_390 (.hier cmd_391 (.hier cmd_392 (.inc (.inc (.inc (.hier cmd_396 (.hier cmd_397 (.hier cmd_398 (.hier cmd_399 (.hier cmd_400 (.hier cmd_401 (.inc .nil))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + +set_option maxRecDepth 20000000 +set_option maxHeartbeats 0 +set_option smartUnfolding false + +theorem full_halt : isHaltCfg (evalProg fullProg c342) = true := by decide +kernel + +theorem c342_halts : haltsFrom (denoteCfg (.ntl 1 1) [] (.z0 (.mk [.mk 0 3] []) 0 1)) := + evalProg_halt_sound fullProg c342 full_halt + +end Solution + +public section + +theorem is_halt : IsHalt target := + Solution.haltsFrom_init_to_IsHalt (Solution.haltsFrom_stepStar Solution.init_to_c342 Solution.c342_halts) + +end + +end BusyBeaver.M_1RB0RD_1LC0RA_HHH1RD_1RA1LE_1RC0LF_1LE0LB diff --git a/BusyBeaver/BB6/Halt/M_1RB0RD_1LC1RE_1LA0LD_0RE0RF_1LC1RA_0LEHHH.lean b/BusyBeaver/BB6/Halt/M_1RB0RD_1LC1RE_1LA0LD_0RE0RF_1LC1RA_0LEHHH.lean new file mode 100644 index 00000000..7cce46e8 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB0RD_1LC1RE_1LA0LD_0RE0RF_1LC1RA_0LEHHH.lean @@ -0,0 +1,80 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.HaltShared + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RD_1LC1RE_1LA0LD_0RE0RF_1LC1RA_0LEHHH + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RD_1LC1RE_1LA0LD_0RE0RF_1LC1RA_0LEHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +namespace Solution + +open Counter BusyBeaver.BufferChainEngine + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +set_option maxHeartbeats 1000000 in +-- 25- to 41-step symbolic reductions require slightly more heartbeats. +theorem spec : Spec target_tm D A where + w0_1 xs r := ⟨19, by buf_run_steps 19⟩ + w10 xs r := ⟨31, by buf_run_steps 31⟩ + w11_1 xs r := ⟨12, by buf_run_steps 12⟩ + rw0 xs r := ⟨3, by buf_run_steps 3⟩ + rw11 xs' r := ⟨20, by buf_run_steps 20⟩ + turn x := ⟨25, by buf_run_steps 25⟩ + lov_nil r := ⟨41, by buf_run_steps 41⟩ + lov_w0 u r := ⟨3, by buf_run_steps 3⟩ + lov_w11_0 x r := ⟨20, by buf_run_steps 20⟩ + lov_w11_1_start z r := ⟨12, by buf_run_steps 12⟩ + lov_w11_1_end z' r := ⟨9, by buf_run_steps 9⟩ + lov_finish y := ⟨12, by buf_run_steps 12⟩ + +set_option maxRecDepth 200000 in +-- Kernel reflection of the 847-step initial transition trace requires deeper recursion. +theorem init_to_x0 : (init []) [target_tm]⊢* (cfgL D (Lmp x0) (RC 1)) := + init_to_x0_of_cmultiStep (k := 847) (by decide) + +def c_msb_start : CCfg (Fin 2) (Fin 6) := + ⟨D, 1, (encWords encWord msb_17 ++ [1, 1, 1, 1, 1, 1]).tail, [0, 1, 0, 1, 0]⟩ + +def c_msb_halt : CCfg (Fin 2) (Fin 6) := + (cmultiStep target_tm 1356 c_msb_start).getD c_msb_start + +set_option maxRecDepth 200000 in +-- Kernel reflection of the 1356-step MSB-17 terminal trace requires deeper recursion. +theorem msb_17_halt (r : ListBlank (Fin 2)) : + ∃ cfg, ((cfgL D (Lmp msb_17) ([1, 0] +> r)) [target_tm]⊢* cfg) ∧ + (step target_tm cfg).isNone := by + have h_start : cfgL D (Lmp msb_17) ([1, 0] +> r) = evalCCfg r c_msb_start := rfl + have h_msb : cmultiStep target_tm 1356 c_msb_start = some c_msb_halt := by decide + have h_q : c_msb_halt.q = F := by decide + have h_cur : c_msb_halt.cur = 1 := by decide + refine ⟨evalCCfg r c_msb_halt, ?_, ?_⟩ + · rw [h_start] + exact ⟨1356, cmultiStep_sound 1356 c_msb_start c_msb_halt r h_msb⟩ + · simp [step, h_q, h_cur, F, target_tm]; rfl + +end Solution + +public section + +open Solution BusyBeaver.BufferChainEngine in +theorem is_halt : IsHalt target := + is_halt_of_msb17_10 spec init_to_x0 msb_17_halt + +end + +end BusyBeaver.M_1RB0RD_1LC1RE_1LA0LD_0RE0RF_1LC1RA_0LEHHH diff --git a/BusyBeaver/BB6/Halt/M_1RB0RD_1RC0LC_1RE1RA_0LD1LA_0LF0LD_0REHHH.lean b/BusyBeaver/BB6/Halt/M_1RB0RD_1RC0LC_1RE1RA_0LD1LA_0LF0LD_0REHHH.lean new file mode 100644 index 00000000..8fdb1869 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB0RD_1RC0LC_1RE1RA_0LD1LA_0LF0LD_0REHHH.lean @@ -0,0 +1,37 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.HaltShared + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RD_1RC0LC_1RE1RA_0LD1LA_0LF0LD_0REHHH + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RD_1RC0LC_1RE1RA_0LD1LA_0LF0LD_0REHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +theorem trans_A0_0RD : target A 0 = some (some B, Stmt.write 1 Dir.right) := rfl +theorem trans_B0_0RD : target B 0 = some (some C, Stmt.write 1 Dir.right) := rfl +theorem trans_C0_0RD : target C 0 = some (some E, Stmt.write 1 Dir.right) := rfl +theorem trans_E0_0RD : target E 0 = some (some F, Stmt.write 0 Dir.left) := rfl +theorem trans_F0_0RD : target F 0 = some (some E, Stmt.write 0 Dir.right) := rfl +theorem trans_F1_0RD : target F 1 = none := rfl + +public section + +theorem is_halt : IsHalt target := + is_halt_of_haltsAt target 4 (by decide +kernel) + +end + +end BusyBeaver.M_1RB0RD_1RC0LC_1RE1RA_0LD1LA_0LF0LD_0REHHH diff --git a/BusyBeaver/BB6/Halt/M_1RB0RE_1RC0RA_0LD0LB_0LA1LE_1LC1LF_0LAHHH.lean b/BusyBeaver/BB6/Halt/M_1RB0RE_1RC0RA_0LD0LB_0LA1LE_1LC1LF_0LAHHH.lean new file mode 100644 index 00000000..b53770c1 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB0RE_1RC0RA_0LD0LB_0LA1LE_1LC1LF_0LAHHH.lean @@ -0,0 +1,283 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.HaltShared + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.M_1RB0RE_1RC0RA_0LD0LB_0LA1LE_1LC1LF_0LAHHH + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1RC0RA_0LD0LB_0LA1LE_1LC1LF_0LAHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +@[simp] theorem isFlipped_tm : BusyBeaver.RleStackEngine.isFlipped target_tm = false := rfl + +namespace Solution + +open BusyBeaver.RleStackEngine + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def F : Fin 6 := 5 + +@[simp] theorem init_nil : (init ([] : List (Fin 2))) = ⟨some A, ⟨0, default, default⟩⟩ := rfl + +def cfg_Halt (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some F, ⟨1, l, r⟩⟩ + +macro "finish" : tactic => `(tactic| ( + refine ⟨0, ?_⟩ + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, listblank_append_cons, + listblank_append_nil, zero_cons_default, encLeft_nil, encRight_nil, encLeft_cons_one, + encRight_cons_one, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, multiStep_zero] + try rfl)) +macro "step" : tactic => `(tactic| ( + try refine stepPlus_stepStar ?_ + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, listblank_append_cons, + listblank_append_nil, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, default_head] + apply step_stepStar_stepPlus (by rfl) + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, + listblank_append_cons, listblank_append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail])) +macro "execute" n:num : tactic => `(tactic| ( + iterate $n step + finish)) + +theorem init_reaches_stack : (init []) [target_tm]⊢⁺ (cfg_B target_tm [0] []) := by + rw [init_nil]; unfold cfg_B; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encLeft_zero, encLeft_nil, encRight_nil]; execute 1 + +theorem rule_B_nil (L : List ℕ) : + (cfg_B target_tm L []) [target_tm]⊢⁺ (cfg_C target_tm (bumpHead L) []) := by + unfold cfg_B cfg_C; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encRight_nil]; execute 1 + +theorem rule_B_zero (L R : List ℕ) : + (cfg_B target_tm L (0 :: R)) [target_tm]⊢⁺ (cfg_B target_tm (0 :: L) R) := by + unfold cfg_B; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encRight_zero R, encLeft_zero L]; + execute 4 + +theorem rule_B_succ (d : ℕ) (L R : List ℕ) : + (cfg_B target_tm L ((d + 1) :: R)) [target_tm]⊢⁺ (cfg_BR target_tm L (0 :: d :: R)) := by + unfold cfg_B cfg_BR; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encRight_succ d R, encRight_zero (d :: R), encRight_expose d R]; execute 2 + +theorem rule_BR_nil (L : List ℕ) : + (cfg_BR target_tm L []) [target_tm]⊢⁺ (cfg_C target_tm (bumpHead L) []) := + rule_B_nil L + +theorem rule_BR_zero (L R : List ℕ) : + (cfg_BR target_tm L (0 :: R)) [target_tm]⊢⁺ (cfg_BR target_tm (0 :: L) R) := by + unfold cfg_BR; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encRight_zero R, encLeft_zero L]; + execute 2 + +theorem rule_BR_one (L R : List ℕ) : + (cfg_BR target_tm L (1 :: R)) [target_tm]⊢⁺ (cfg_DR0 target_tm L (bumpHead R)) := by + unfold cfg_BR cfg_DR0; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encRight_succ 0 R, + encRight_zero R]; execute 4 + +theorem rule_BR_add_two (d : ℕ) (L R : List ℕ) : + (cfg_BR target_tm L ((d + 2) :: R)) [target_tm]⊢⁺ (cfg_B target_tm (bumpHead L) (d :: R)) := + by + unfold cfg_BR cfg_B; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encRight_succ (d + 1) R, encRight_succ d R, encRight_expose d R]; execute 5 + +theorem rule_DR0_nil (R : List ℕ) : + (cfg_DR0 target_tm [] R) [target_tm]⊢⁺ (cfg_C target_tm [1] R) := by + unfold cfg_DR0 cfg_C; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encLeft_nil, encLeft_succ 0 [], encLeft_zero [], encLeft_nil]; execute 3 + +theorem rule_DR0_zero (L R : List ℕ) : + (cfg_DR0 target_tm (0 :: L) R) [target_tm]⊢⁺ (cfg_DR0 target_tm L (0 :: R)) := by + unfold cfg_DR0; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encLeft_zero L, encRight_zero R]; + execute 4 + +theorem rule_DR0_succ (a : ℕ) (L R : List ℕ) : + (cfg_DR0 target_tm ((a + 1) :: L) R) [target_tm]⊢⁺ (cfg_C target_tm (a :: L) (0 :: R)) := by + unfold cfg_DR0 cfg_C; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encLeft_succ a L, + encRight_zero R]; execute 3 + +theorem rule_C_nil (R : List ℕ) : + (cfg_C target_tm [] R) [target_tm]⊢⁺ (cfg_DR0 target_tm [] R) := by + unfold cfg_C cfg_DR0; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encLeft_nil]; execute 1 + +theorem rule_C_zero_nil (R : List ℕ) : + (cfg_C target_tm [0] R) [target_tm]⊢⁺ (cfg_C target_tm [] (1 :: R)) := by + unfold cfg_C; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encLeft_zero [], encLeft_nil, encRight_succ 0 R, encRight_zero R]; execute 3 + +theorem rule_C_zero_zero (L R : List ℕ) : + (cfg_C target_tm (0 :: 0 :: L) R) [target_tm]⊢⁺ (cfg_C target_tm (bumpHead L) (1 :: R)) := by + unfold cfg_C; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encLeft_zero (0 :: L), encLeft_zero L, encRight_succ 0 R, encRight_zero R]; execute 5 + +theorem rule_C_zero_one (L R : List ℕ) : + (cfg_C target_tm (0 :: 1 :: L) R) [target_tm]⊢⁺ + (cfg_C target_tm (bumpHead (bumpHead L)) (0 :: bumpHead R)) := by + unfold cfg_C; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encLeft_zero (1 :: L), encLeft_succ 0 L, encLeft_zero L, encRight_zero (bumpHead R)] + execute 17 + +theorem rule_C_zero_add_two (a : ℕ) (L R : List ℕ) : + (cfg_C target_tm (0 :: (a + 2) :: L) R) [target_tm]⊢⁺ (cfg_BR target_tm (a :: L) (0 :: 1 :: + R)) := by + unfold cfg_C cfg_BR; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encLeft_zero ((a + 2) :: L), encLeft_succ (a + 1) L, encLeft_succ a L, + encRight_zero (1 :: R), encRight_succ 0 R, encRight_zero R]; execute 4 + +theorem rule_C_one_nil (R : List ℕ) : + (cfg_C target_tm [1] R) [target_tm]⊢⁺ (cfg_B target_tm [0] (1 :: R)) := by + unfold cfg_C cfg_B; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encLeft_succ 0 [], encLeft_zero [], encLeft_nil, encRight_succ 0 R, encRight_zero R] + execute 5 + +theorem rule_C_one_zero (L R : List ℕ) : + (cfg_C target_tm (1 :: 0 :: L) R) [target_tm]⊢⁺ (cfg_DR0 target_tm L (2 :: R)) := by + unfold cfg_C cfg_DR0; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encLeft_succ 0 (0 :: L), encLeft_zero (0 :: L), encLeft_zero L, + encRight_succ 1 R, encRight_succ 0 R, encRight_zero R]; execute 7 + +theorem rule_C_one_succ (a : ℕ) (L R : List ℕ) : + (cfg_C target_tm (1 :: (a + 1) :: L) R) [target_tm]⊢⁺ (cfg_C target_tm (a :: L) (2 :: R)) := + by + unfold cfg_C; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encLeft_succ 0 ((a + 1) :: L), encLeft_zero ((a + 1) :: L), encLeft_succ a L, + encRight_succ 1 R, encRight_succ 0 R, encRight_zero R]; execute 6 + +theorem rule_C_add_two_step (a : ℕ) (L R : List ℕ) : + (cfg_C target_tm ((a + 2) :: L) R) [target_tm]⊢⁺ + (cfg_Halt ((([1] : List (Fin 2)) ^ a) +> ((encLeft1 L).cons 0)) + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> encRight1 R)) := by + unfold cfg_C cfg_Halt; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encLeft_succ (a + 1) L, encLeft_succ a L, encLeft_expose a L]; execute 3 + +theorem rule_C_add_two_halt (a : ℕ) (L R : List ℕ) : + ∃ cfg', ((cfg_C target_tm ((a + 2) :: L) R) [target_tm]⊢⁺ cfg') ∧ + (step target_tm cfg').isNone := + ⟨cfg_Halt ((([1] : List (Fin 2)) ^ a) +> ((encLeft1 L).cons 0)) + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> encRight1 R), + rule_C_add_two_step a L R, rfl⟩ + + +instance : HasRleStackRules target_tm where + rule_B_nil := rule_B_nil + rule_B_zero := rule_B_zero + rule_B_succ := rule_B_succ + rule_BR_nil := rule_BR_nil + rule_BR_zero := rule_BR_zero + rule_BR_one := rule_BR_one + rule_BR_add_two := rule_BR_add_two + rule_DR0_nil := rule_DR0_nil + rule_DR0_zero := rule_DR0_zero + rule_DR0_succ := rule_DR0_succ + rule_C_nil := rule_C_nil + rule_C_zero_nil := rule_C_zero_nil + rule_C_zero_zero := rule_C_zero_zero + rule_C_zero_one := rule_C_zero_one + rule_C_zero_add_two := rule_C_zero_add_two + rule_C_one_nil := rule_C_one_nil + rule_C_one_zero := rule_C_one_zero + rule_C_one_succ := rule_C_one_succ + rule_C_add_two_halt := rule_C_add_two_halt + +def ckpt0 : RleFullState := ⟨.B, .raw [.z 1], [], false⟩ + +def ckpt5 : RleFullState := ⟨.B, .clean 0 [(10160322, 1), (2037954, 13), (2824386, 1619), (3086530 + , 1), (3610818, 3653), (2037954, 1), (25368770, 1), (42145986, 2872), (58923202, 1), (92477634 + , 812), (12785858, 1), (1275271362, 28), (3666548930, 1), (5101263042, 71), (15178199234, 1), + (20405054658, 116), (25977842882, 1), (81620331714, 22), (248318268209, 1), (300302521103, 1)] + 3842700283260, [.z 1, .k 8126655 6, .k 2031599 1, .k 2031615 34318, .k 1507327 1, .k 1245183 + 24417, .k 2031615 1, .k 458751 473610, .k 196607 1, .k 65535 2829536, .k 3071 1, .k 7167 + 3190216, .k 3071 1, .k 1023 323903800, .k 511 1, .k 255 4583538500, .k 127 1, .k 63 + 26276947360, .k 31 1, .k 15 56657308304, .z 3, .d 1, .z 2, .d 2, .d 1, .k 3 133852318911, .z 3 + , .d 3, .d 1, .k 0 56344583818, .d 2], false⟩ + +def ckpt10 : RleFullState := ⟨.C, .raw [.z 1, .k 20401242237 24417, .k 24696209533 1, .k + 33286144125 34307, .k 41607680637 1, .k 8321537661 9, .k 8321472125 1, .k 33286821501 6, .k + 41616709245 1, .k 8347489917 13, .k 11568715389 1619, .k 12642457213 1, .k 14789940861 3653, + .k 8347489917 1, .k 103910512253 1, .k 172629988989 2872, .k 241349465725 1, .k 378788419197 + 812, .k 52370904701 1, .k 5223511529085 28, .k 15018184447613 1, .k 20894773450365 71, .k + 62169904092797 1, .k 83579103909501 27, .k 233893724569877 1, .k 334316415637929 88, .k + 425620977899945 1, .k 1337267514923433 4, .k 110188252487541 1, .k 19633268198974271 1, .z 2] + , [.k 33286144125 1, .k 7516340349 473610, .k 3221373053 1, .k 1073889405 2829536, .k 50479229 + 1, .k 117588093 3190216, .k 50479229 1, .k 16924797 323903800, .k 8536189 1, .k 4341885 + 1304636057, .k 1720010 1, .k 1085472 3278902442, .k 561184 1, .k 299040 16080887479, .k 283151 + 1, .k 74763 10196059880, .k 41995 1, .k 25611 49220528784, .k 22411 1, .k 223 1, .k 1623 + 7436779519, .k 791 1, .k 663 190196902731, .k 535 1, .k 471 91416876092, .k 279 3607090573272 + , .k 151 1, .k 87 1247148618371, .k 55 1, .k 39 8777991210832, .k 31 1, .k 27 41052276700161, + .k 87 1, .k 69 68860916608490, .k 117 1, .k 21 65433277186752, .k 8 1, .k 6 78474749496209, .k + 4 1, .k 3 9575881408811365, .k 6 1, .k 0 1295188808094044, .d 2], false⟩ + +def ckpt15 : RleFullState := ⟨.B, .clean 0 [(26230647, 49220528784), (43007863, 1), (76562295, + 10196059880), (289951607, 1), (306221943, 16080887479), (574657399, 1), (1111528311, + 3278902442), (1761295223, 1), (4446095223, 285528470), (10774804343, 1), (17784372087, + 1019107586), (34964241271, 1), (69323979639, 323903800), (206762933111, 1), (481640840055, + 3190216), (206762933111, 1), (4398651014007, 2829536), (13194744036215, 1), (30786930080631, + 473610), (136340046347127, 1), (83563488213879, 24417), (101155674258295, 1), (136340046347127 + , 34307), (170425059900279, 1), (34085018270583, 9), (34084749835127, 1), (136342820879223, 6) + , (170462041078647, 1), (34191318711159, 13), (47385458244471, 1619), (51783504755575, 1), + (60579597777783, 3653), (34191318711159, 1), (425617458199415, 1), (707092434910071, 2872), + (988567411620727, 1), (1551517365042039, 812), (214511225666423, 1), (21395503223143287, 28), + (61514483497433975, 1), (85584992052706167, 71), (254647927164107639, 1), (342340009613327223 + , 27), (958028695838227319, 1), (1369360038452968311, 31), (82168436419292535, 1), + (20595065632538812535, 1), (21909760615247478903, 43), (7991561740213130739, 1), + (222691182000549570631, 1), (63, 1), (5608898717503354593279, 1)] 2468328002243313095983, [.d + 1, .d 1, .k 5738461 1, .k 58333 1, .k 416733 7436779519, .k 203741 1, .k 170973 190196902731, + .k 138205 1, .k 121821 91416876092, .k 72669 3607090573272, .k 39901 1, .k 23517 1247148618371 + , .k 15325 1, .k 11229 8777991210832, .k 9181 1, .k 8157 41052276700161, .k 23517 1, .k 18909 + 31671798164438, .k 14813 1, .k 4701 37189118444051, .k 7773 1, .k 1629 65433277186752, .k 797 + 1, .k 669 78474749496209, .k 541 1, .k 477 9575881408811365, .k 669 1, .k 285 + 17162295816727413, .k 477 1, .k 93 246018113982395612, .k 61 1, .k 45 631165860194629366, .k + 32 1, .k 12 4791268012535596513, .k 10 1, .k 9 22342849281290009221, .k 12 1, .k 6 + 7588671874192736443, .k 9 1, .k 3 108596472271926337351, .k 6 1, .k 0 206332718429699986606, + .d 2], false⟩ + +-- Each chunk reduces 100 (or 80) RLE batches in the kernel via `rfl`. +set_option maxRecDepth 2000000 in +theorem chunk_0 : runBatches 100 ckpt0 = ckpt5 := rfl +set_option maxRecDepth 2000000 in +theorem chunk_1 : runBatches 100 ckpt5 = ckpt10 := rfl +set_option maxRecDepth 2000000 in +theorem chunk_2 : runBatches 100 ckpt10 = ckpt15 := rfl +set_option maxRecDepth 2000000 in +theorem chunk_3 : (runBatches 80 ckpt15).halted = true := rfl + +theorem reach_15 : StateHalts target_tm ckpt15 := + runBatches_halts 80 ckpt15 (Or.inl chunk_3) +theorem reach_10 : StateHalts target_tm ckpt10 := chunk_back_batches chunk_2 reach_15 +theorem reach_5 : StateHalts target_tm ckpt5 := chunk_back_batches chunk_1 reach_10 +theorem reach_0 : StateHalts target_tm ckpt0 := chunk_back_batches chunk_0 reach_5 + +end Solution + +public section + +open Solution BusyBeaver.RleStackEngine in +theorem is_halt : IsHalt target := by + rcases reach_0 with hfalse | hcan + · simp [ckpt0] at hfalse + · exact canHalt_of_stepPlus init_reaches_stack hcan + +end + +end BusyBeaver.M_1RB0RE_1RC0RA_0LD0LB_0LA1LE_1LC1LF_0LAHHH diff --git a/BusyBeaver/BB6/Halt/M_1RB0RF_0RC1RD_0LDHHH_1LE1RA_1LA0LF_0RD0RC.lean b/BusyBeaver/BB6/Halt/M_1RB0RF_0RC1RD_0LDHHH_1LE1RA_1LA0LF_0RD0RC.lean new file mode 100644 index 00000000..a652ae43 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB0RF_0RC1RD_0LDHHH_1LE1RA_1LA0LF_0RD0RC.lean @@ -0,0 +1,80 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.HaltShared + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RF_0RC1RD_0LDHHH_1LE1RA_1LA0LF_0RD0RC + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_0RC1RD_0LDHHH_1LE1RA_1LA0LF_0RD0RC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +namespace Solution + +open Counter BusyBeaver.BufferChainEngine + +abbrev tm_0RF : Machine (Fin 2) (Fin 6) := target + +set_option maxHeartbeats 1000000 in +-- 25- to 41-step symbolic reductions require slightly more heartbeats. +theorem spec_0RF : Spec tm_0RF F A where + w0_1 xs_rf r_rf := ⟨19, by buf_run_steps 19⟩ + w10 xs_rf r_rf := ⟨31, by buf_run_steps 31⟩ + w11_1 xs_rf r_rf := ⟨12, by buf_run_steps 12⟩ + rw0 xs_rf r_rf := ⟨3, by buf_run_steps 3⟩ + rw11 xs_rf' r_rf := ⟨20, by buf_run_steps 20⟩ + turn x := ⟨27, by buf_run_steps 27⟩ + lov_nil r := ⟨41, by buf_run_steps 41⟩ + lov_w0 u_rf r_rf := ⟨3, by buf_run_steps 3⟩ + lov_w11_0 x_rf r_rf := ⟨20, by buf_run_steps 20⟩ + lov_w11_1_start z_rf r_rf := ⟨12, by buf_run_steps 12⟩ + lov_w11_1_end z_rf' r_rf := ⟨9, by buf_run_steps 9⟩ + lov_finish y := ⟨12, by buf_run_steps 12⟩ + +set_option maxRecDepth 200000 in +-- Kernel reflection of the 865-step initial transition trace requires deeper recursion. +theorem init_to_x0_0RF : (init []) [tm_0RF]⊢* (cfgL F (Lmp x0) (RC 1)) := + init_to_x0_of_cmultiStep (k := 865) (by decide) + +def c_msb_start_0RF : CCfg (Fin 2) (Fin 6) := + ⟨F, 1, (encWords encWord msb_17 ++ [1, 1, 1, 1, 1, 1]).tail, [0, 1, 0, 1, 0]⟩ + +def c_msb_halt_0RF : CCfg (Fin 2) (Fin 6) := + (cmultiStep tm_0RF 1356 c_msb_start_0RF).getD c_msb_start_0RF + +set_option maxRecDepth 200000 in +-- Kernel reflection of the 1356-step MSB-17 terminal trace requires deeper recursion. +theorem msb_17_halt_0RF (r : ListBlank (Fin 2)) : + ∃ cfg, ((cfgL F (Lmp msb_17) ([1, 0] +> r)) [tm_0RF]⊢* cfg) ∧ + (step tm_0RF cfg).isNone := by + have h_start : cfgL F (Lmp msb_17) ([1, 0] +> r) = evalCCfg r c_msb_start_0RF := rfl + have h_msb : cmultiStep tm_0RF 1356 c_msb_start_0RF = some c_msb_halt_0RF := by decide + have h_q : c_msb_halt_0RF.q = C := by decide + have h_cur : c_msb_halt_0RF.cur = 1 := by decide + refine ⟨evalCCfg r c_msb_halt_0RF, ?_, ?_⟩ + · rw [h_start] + exact ⟨1356, cmultiStep_sound 1356 c_msb_start_0RF c_msb_halt_0RF r h_msb⟩ + · simp [step, h_q, h_cur, C, tm_0RF]; rfl + +end Solution + +public section + +open Solution BusyBeaver.BufferChainEngine in +theorem is_halt : IsHalt target := + is_halt_of_msb17_10 spec_0RF init_to_x0_0RF msb_17_halt_0RF + +end + +end BusyBeaver.M_1RB0RF_0RC1RD_0LDHHH_1LE1RA_1LA0LF_0RD0RC diff --git a/BusyBeaver/BB6/Halt/M_1RB0RF_1LC1RE_1LD0LC_0LE0RE_1RA1LD_1RBHHH.lean b/BusyBeaver/BB6/Halt/M_1RB0RF_1LC1RE_1LD0LC_0LE0RE_1RA1LD_1RBHHH.lean new file mode 100644 index 00000000..1cab016c --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB0RF_1LC1RE_1LD0LC_0LE0RE_1RA1LD_1RBHHH.lean @@ -0,0 +1,2235 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RF_1LC1RE_1LD0LC_0LE0RE_1RA1LD_1RBHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1LC1RE_1LD0LC_0LE0RE_1RA1LD_1RBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {zG_ zL_ α β γ : Type*} [Inhabited zG_] [Inhabited zL_] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +variable {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] +local notation "zB" => ListBlank (Fin 2) +local notation "zF" => List (Fin 2) +set_option maxHeartbeats 8000000 +namespace Sparse +abbrev num := List (Nat × Int) +def pow2 (n : Nat) : Int := (2 : Int) ^ n +def value : num -> Int + | [] => 0 + | (e,c) :: xs => c * pow2 e + value xs +theorem zPp (n : Nat) : 0 < pow2 n := by + unfold pow2; positivity +theorem pow2_add (a b : Nat) : pow2 (a + b) = pow2 a * pow2 b := by + unfold pow2; exact pow_add 2 a b +theorem z00 {a b : Nat} (h : a <= b) : pow2 b = pow2 a * pow2 (b - a) := by + rw [<- pow2_add,Nat.add_sub_of_le h] +def z01 (n : Nat) (c : Int) : Option (Int × Bool) := + if n <= 16 then some (c / pow2 n,decide (c % pow2 n = 0)) + else if c.natAbs < 65536 then + some (if c < 0 then -1 else 0,decide (c = 0)) + else none +theorem z02 {n : Nat} (h : 16 < n) : (65536 : Int) <= pow2 n := by + unfold pow2 + have h1 : (65536 : Int) = (2 : Int) ^ 16 := by norm_num + rw [h1] + exact pow_le_pow_right₀ (by norm_num) (by omega) +theorem z03 {n : Nat} {c q : Int} {bz : Bool} (h : z01 n c = some (q,bz)) : + ∃ r,c = pow2 n * q + r /\ 0 <= r /\ r < pow2 n /\ (bz = true <-> r = 0) := by + unfold z01 at h + have hp := zPp n + split_ifs at h with hn hc hneg + · injection h with hpair + injection hpair with hq hz + subst hq hz + refine ⟨c % pow2 n,(Int.mul_ediv_add_emod c (pow2 n)).symm,Int.emod_nonneg c (by linarith), + Int.emod_lt_of_pos c hp,decide_eq_true_iff⟩ + · injection h with hpair + injection hpair with hq hz + subst hq hz + have hp16 : (65536 : Int) <= pow2 n := z02 (by omega) + have h_abs : -65536 < c := by omega + refine ⟨c + pow2 n,by ring,by linarith,by linarith,?_⟩ + rw [decide_eq_true_iff] + (try omega) + · injection h with hpair + injection hpair with hq hz + subst hq hz + have hp16 : (65536 : Int) <= pow2 n := z02 (by omega) + have h_abs : c < 65536 := by omega + refine ⟨c,by ring,by omega,by linarith,decide_eq_true_iff⟩ +def cmp0 (x : Int) : Int := + if x < 0 then -1 else if x = 0 then 0 else 1 +def z04 (bz : Bool) (s : Int) : Int := + if s = 0 then (if bz then 0 else 1) else s +theorem z05 {p q r : Int} {bz : Bool} + (hp : 0 < p) (hr0 : 0 <= r) (hr1 : r < p) (hz : bz = true <-> r = 0) : + cmp0 (p * q + r) = z04 bz (cmp0 q) := by + unfold cmp0 z04 + rcases lt_trichotomy q 0 with hq | rfl | hq + · have hq1 : q <= -1 := by omega + have hpq : p * q <= -p := by nlinarith + have hsum : p * q + r < 0 := by linarith + simp [hq,hsum] + · simp only [mul_zero,zero_add,lt_irrefl,↓reduceIte] + cases bz + · have hr_ne : r ≠ 0 := by intro h; exact Bool.false_ne_true (hz.mpr h) + have hr_pos : 0 < r := lt_of_le_of_ne hr0 (Ne.symm hr_ne) + have h_not_lt : ¬(r < 0) := by omega + simp [h_not_lt,hr_ne] + · have hr_eq : r = 0 := hz.mp rfl + simp [hr_eq] + · have hq1 : 1 <= q := by omega + have hpq : p <= p * q := by nlinarith + have hsum : 0 < p * q + r := by linarith + have h_not_lt : ¬(p * q + r < 0) := by omega + have h_ne : p * q + r ≠ 0 := by omega + have hq_not_lt : ¬(q < 0) := by omega + have hq_ne : q ≠ 0 := by omega + simp [hq_not_lt,hq_ne,h_not_lt,h_ne] +def z06 : num -> Nat -> Int -> Option Int + | [],_,carry => some (cmp0 carry) + | (e,c) :: xs,base,carry => + if base <= e then + match z01 (e - base) carry with + | some (q,bz) => + match z06 xs e (c + q) with + | some s => some (z04 bz s) + | none => none + | none => none + else none +theorem z07 {xs : num} {base : Nat} {carry s : Int} + (h : z06 xs base carry = some s) : + ∃ v,value xs = pow2 base * v /\ cmp0 (carry + v) = s := by + induction xs generalizing base carry s with + | nil => + simp only [z06] at h + injection h with hs + exact ⟨0,by simp [value],by simp [hs]⟩ + | cons ec xs ih => + rcases ec with ⟨e,c⟩ + simp only [z06] at h + split_ifs at h with hbe + cases hd : z01 (e - base) carry with + | none => rw [hd] at h; contradiction + | some qz => + rcases qz with ⟨q,bz⟩ + rw [hd] at h + dsimp only at h + cases hs : z06 xs e (c + q) with + | none => rw [hs] at h; contradiction + | some t => + rw [hs] at h + injection h with ht + subst ht + rcases z03 hd with ⟨r,hcarry,hr0,hr1,hzero⟩ + rcases ih hs with ⟨v,hv,hcmp⟩ + refine ⟨pow2 (e - base) * (c + v),?_,?_⟩ + · simp only [value,hv,z00 hbe] + ring + · have heq : carry + pow2 (e - base) * (c + v) = pow2 (e - base) * (c + q + v) + r := by + linarith + rw [heq,z05 (zPp (e - base)) hr0 hr1 hzero,<- hcmp] +def z08 (xs : num) : Option Int := z06 xs 0 0 +theorem z09 {xs : num} {s : Int} (h : z08 xs = some s) : + cmp0 (value xs) = s := by + rcases z07 h with ⟨v,hv,hs⟩ + have hv1 : value xs = v := by simp [pow2] at hv; exact hv + simpa [hv1] using hs +def z0a (e : Nat) (c : Int) : num -> num + | [] => [(e,c)] + | (f,d) :: xs => + if e < f then (e,c) :: (f,d) :: xs + else if e = f then (e,c + d) :: xs + else (f,d) :: z0a e c xs +theorem z0b (xs : num) (e : Nat) (c : Int) : + value (z0a e c xs) = c * pow2 e + value xs := by + induction xs with + | nil => simp [z0a,value] + | cons fd xs ih => + rcases fd with ⟨f,d⟩ + simp only [z0a] + split_ifs with hlt heq + · simp [value] + · subst heq; simp [value]; ring + · simp [value,ih]; ring +def add (xs ys : num) : num := + xs.foldr (fun ec zs => z0a ec.1 ec.2 zs) ys +def neg (xs : num) : num := + xs.map (fun ec => (ec.1,-ec.2)) +def sub (xs ys : num) : num := add xs (neg ys) +def shift (n : Nat) (xs : num) : num := + xs.map (fun ec => (n + ec.1,ec.2)) +def power (n : Nat) : num := [(n,1)] +def small (c : Int) : num := [(0,c)] +theorem add_spec (xs ys : num) : value (add xs ys) = value xs + value ys := by + induction xs with + | nil => simp [add,value] + | cons ec xs ih => + rcases ec with ⟨e,c⟩ + change value (z0a e c (add xs ys)) = (c * pow2 e + value xs) + value ys + rw [z0b,ih]; ring +theorem z0c (xs : num) : value (neg xs) = -value xs := by + induction xs with + | nil => simp [neg,value] + | cons ec xs ih => + rcases ec with ⟨e,c⟩ + change -c * pow2 e + value (neg xs) = -(c * pow2 e + value xs) + rw [ih]; ring +theorem sub_spec (xs ys : num) : value (sub xs ys) = value xs - value ys := by + unfold sub; rw [add_spec,z0c]; ring +theorem shift_spec (n : Nat) (xs : num) : value (shift n xs) = pow2 n * value xs := by + induction xs with + | nil => simp [shift,value] + | cons ec xs ih => + rcases ec with ⟨e,c⟩ + change c * pow2 (n + e) + value (shift n xs) = pow2 n * (c * pow2 e + value xs) + rw [pow2_add,ih]; ring +theorem power_spec (n : Nat) : value (power n) = pow2 n := by + simp [power,value] +theorem small_spec (c : Int) : value (small c) = c := by + simp [small,value,pow2] +def z0d (xs ys : num) : Option Int := z08 (sub xs ys) +theorem compare_spec {xs ys : num} {s : Int} (h : z0d xs ys = some s) : + cmp0 (value xs - value ys) = s := by + have hs := z09 h + rwa [sub_spec] at hs +def z0e : Nat -> num -> num + | 0,xs => xs + | _ + 1,[] => [] + | fuel + 1,(e,c) :: xs => + if c = 0 then z0e fuel xs + else if c = 1 then (e,c) :: z0e fuel xs + else if c = -1 then (e,c) :: z0e fuel xs + else + let q := c / 2 + let r := c - q * 2 + let ys := z0e fuel (z0a (e + 1) q xs) + if r = 0 then ys else (e,r) :: ys +theorem z0f (fuel : Nat) (xs : num) : value (z0e fuel xs) = value xs := by + induction fuel generalizing xs with + | zero => rfl + | succ fuel ih => + cases xs with + | nil => rfl + | cons ec xs => + rcases ec with ⟨e,c⟩ + simp only [z0e] + split_ifs with hc0 hc1 hcm1 hr0 + · simp [value,hc0,ih] + · simp [value,ih] + · simp [value,ih] + · rw [ih,z0b] + have hp : pow2 (e + 1) = pow2 e * 2 := by rw [pow2_add]; rfl + simp only [value,hp] + have hq : (c / 2) * 2 = c := by omega + calc (c / 2) * (pow2 e * 2) + value xs + _ = ((c / 2) * 2) * pow2 e + value xs := by ring + _ = c * pow2 e + value xs := by rw [hq] + · simp only [value,ih,z0b] + have hp : pow2 (e + 1) = pow2 e * 2 := by rw [pow2_add]; rfl + rw [hp]; ring +def pack (xs : num) : num := z0e 128 xs +theorem pack_spec (xs : num) : value (pack xs) = value xs := z0f 128 xs +def eqb (xs ys : num) : Bool := z0d xs ys == some 0 +def leb (xs ys : num) : Bool := (z0d xs ys == some (-1)) || (z0d xs ys == some 0) +theorem eqb_spec {xs ys : num} (h : eqb xs ys = true) : value xs = value ys := by + unfold eqb at h + rw [beq_iff_eq] at h + have hcmp := compare_spec h + unfold cmp0 at hcmp + split_ifs at hcmp <;> omega +theorem leb_spec {xs ys : num} (h : leb xs ys = true) : value xs <= value ys := by + unfold leb at h + rw [Bool.or_eq_true,beq_iff_eq,beq_iff_eq] at h + rcases h with h | h + · have hcmp := compare_spec h + unfold cmp0 at hcmp + split_ifs at hcmp <;> omega + · have hcmp := compare_spec h + unfold cmp0 at hcmp + split_ifs at hcmp <;> omega +def z0g (n : Nat) : num -> Bool -> num + | [],negative => if negative then small (-1) else [] + | (e,c) :: xs,negative => + if e < n then z0g n xs (decide (c < 0)) + else add (if negative then small (-1) else []) + (((e,c) :: xs).map (fun ec => (ec.1 - n,ec.2))) +def z0h (n : Nat) (xs : num) : num := pack (z0g n (pack xs) false) +def nonnegative (xs : num) : Bool := leb [] xs +def split (xs : num) : Option (Nat × num) := + let ys := pack xs + match ys with + | [] => none + | (e,_) :: _ => + let u := z0h (e + 1) ys + if nonnegative u then + if eqb xs (shift e (add (shift 1 u) (small 1))) then some (e,u) else none + else none +theorem split_spec {xs : num} {e : Nat} {u : num} (h : split xs = some (e,u)) : + 0 <= value u /\ value xs = pow2 e * (value u * 2 + 1) := by + unfold split nonnegative at h + cases hp : pack xs with + | nil => rw [hp] at h; contradiction + | cons ec ys => + rcases ec with ⟨i,c⟩ + rw [hp] at h + dsimp only at h + split_ifs at h with hn heq + injection h with hpair + injection hpair with hi hu + subst hi hu + have hnu := leb_spec hn + have hval := eqb_spec heq + rw [shift_spec,add_spec,shift_spec,small_spec] at hval + have hp1 : pow2 1 = 2 := rfl + rw [hp1] at hval + simp only [value] at hnu + exact ⟨hnu,by linarith⟩ +def half (xs : num) : Option (Bool × num) := + let u := z0h 1 xs + if nonnegative u then + if eqb xs (shift 1 u) then some (false,u) + else if eqb xs (add (shift 1 u) (small 1)) then some (true,u) + else none + else none +theorem half_spec {xs : num} {odd : Bool} {u : num} (h : half xs = some (odd,u)) : + 0 <= value u /\ value xs = value u * 2 + (if odd then 1 else 0) := by + unfold half nonnegative at h + dsimp only at h + split_ifs at h with hn he0 he1 + · injection h with hpair + injection hpair with hodd hu + cases hodd + cases hu + have hnu := leb_spec hn + have hval := eqb_spec he0 + rw [shift_spec] at hval + have hp1 : pow2 1 = 2 := rfl + rw [hp1] at hval + simp only [value] at hnu + refine ⟨hnu,?_⟩ + simp only [Bool.false_eq_true,↓reduceIte] + linarith + · injection h with hpair + injection hpair with hodd hu + cases hodd + cases hu + have hnu := leb_spec hn + have hval := eqb_spec he1 + rw [add_spec,shift_spec,small_spec] at hval + have hp1 : pow2 1 = 2 := rfl + rw [hp1] at hval + simp only [value] at hnu + refine ⟨hnu,?_⟩ + simp only [↓reduceIte] + linarith +end Sparse +namespace Forward13 +open Sparse +inductive Phase where + | L | R | T1 | T2 | A +deriving DecidableEq +structure State where + tag : Phase + width : Nat + budget : num + mark : Nat + low : num + high : num +def ordinary (p : Phase) (w : Nat) (k m : num) : State := + ⟨p,w,k,0,[],m⟩ +def plus (x y : num) : num := pack (add x y) +def minus (x y : num) : num := pack (sub x y) +def one : num := small 1 +def twice (x : num) : num := shift 1 x +def full (w : Nat) : num := minus (power w) one +def iszero (x : num) : Bool := eqb x [] +def lt (x y : num) : Bool := z0d x y == some (-1) +def good (x : State) : Bool := + if 0 < x.width then + if nonnegative x.budget then + if lt x.budget (power x.width) then + if nonnegative x.high then + match x.tag with + | .L => lt (plus x.budget x.high) (power (x.width + 1)) + | .R => lt (plus (plus x.budget x.high) one) (power (x.width + 1)) + | .A => leb x.high x.budget + | .T1 | .T2 => + if nonnegative x.low then + if lt x.low (power (x.mark + 1)) then + leb (plus x.low x.high) x.budget + else false else false + else false else false else false else false +inductive Result where + | next (x : State) + | halted + | stuck +def prefix_step (p : Phase) (w : Nat) (k m : num) (whole : Nat) (bit : Int) : Result := + if iszero m then .next (ordinary .R w k (small bit)) + else match split m with + | some (i,u) => + let h := i + whole + .next ⟨p,w,k,h,minus (full (h + 1)) (small bit),u⟩ + | none => .stuck +def step_state (x : State) : Result := + let w := x.width + let k := x.budget + let m := x.high + match x.tag with + | .R => .next (ordinary .L w [] (plus (plus k m) one)) + | .L => + let m := plus k m + if eqb m (power w) then + let a := (w - 1) / 4 + let e := (w - 1) % 4 + if e = 0 then + let j := w + 3 * a + 2 + .next (ordinary .L j [] (plus (power j) one)) + else if e = 1 then + .next (ordinary .L (w + 3 * a + 3) [] (shift (3 * a + 1) (plus (power (w + 1)) one))) + else if e = 2 then + let j := w + 3 * a + 4 + .next (ordinary .L j [] (power j)) + else + .next (ordinary .L (w + 3 * a + 4) [] (plus (shift (3 * a + 2) (plus (power (w + 1)) one)) one)) + else match half m with + | some (true,u) => prefix_step .T1 (w + 1) (full (w + 1)) u 0 0 + | some (false,u) => prefix_step .T2 w (full w) u 1 1 + | none => .stuck + | .A => + match half m with + | some (true,_) => .halted + | some (false,u) => prefix_step .T2 w k u 0 0 + | none => .stuck + | .T1 => + let a := x.mark / 4 + let e := x.mark % 4 + let b := minus k x.low + if x.mark = 0 then + match half m with + | some (true,_) => + match split (plus m one) with + | some (t,u) => + if 0 < t then .next ⟨.T1,w + t,full (w + t),0,one,twice u⟩ + else .stuck + | none => .stuck + | some (false,_) => prefix_step .T1 (w + 1) (full (w + 1)) m 0 0 + | none => .stuck + else + if e = 0 then prefix_step .T1 (w + 3 * a + 1) (full (w + 3 * a + 1)) m 0 0 + else if e = 1 then + .next (ordinary .R (w + 3 * a + 1) (minus (shift (3 * a) (plus (twice b) one)) one) (plus (twice m) one)) + else if e = 2 then + .next (ordinary .R (w + 3 * a + 2) (full (w + 3 * a + 2)) (plus (twice m) one)) + else + prefix_step .T1 (w + 3 * a + 3) (minus (shift (3 * a + 2) (plus (twice b) one)) one) m 0 0 + | .T2 => + let a := x.mark / 4 + let e := x.mark % 4 + let b := minus k x.low + if e = 0 then prefix_step .T1 (w + 3 * a + 1) (shift (3 * a) (plus (twice b) one)) m 0 0 + else if e = 1 then prefix_step .T1 (w + 3 * a + 2) (full (w + 3 * a + 2)) m 0 1 + else if e = 2 then .next (ordinary .A (w + 3 * a + 3) (minus (shift (3 * a + 2) (plus (twice b) one)) one) m) + else .next (ordinary .A (w + 3 * a + 4) (full (w + 3 * a + 4)) m) +def check : Nat -> State -> Bool + | 0,_ => false + | fuel + 1,x => + if good x then + match step_state x with + | .next y => check fuel y + | .halted => true + | .stuck => false + else false +def seed : State := ordinary .L 3 [] (pack (small 9)) +theorem numerical_halt : check 175 seed = true := by decide +end Forward13 +@[simp] theorem zMz (M : Machine zG_ zL_) (config : Cfg zG_ zL_) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine zG_ zL_) (config : Cfg zG_ zL_) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine zG_ zL_) (config : Cfg zG_ zL_) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z0i : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : zB).head = 0 := rfl +@[simp] theorem zDt : (default : zB).tail = default := rfl +@[simp] theorem append_nil (s : zB) : ([] : zF) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : zF) (s : zB) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l₁ l₂ : zF) (s : zB) : + (l₁ ++ l₂) +> s = l₁ +> (l₂ +> s) := by + induction l₁ with + | nil => rfl + | cons a l₁ ih => simp [ih] +@[simp] theorem zPz (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem z0j (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +theorem z0k (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp [Nat.zero_add] + | succ m ih => simp [z0j,Nat.succ_add,ih,List.append_assoc] +theorem z0l (l : List α) (n : Nat) : l ^ n ++ l = l ^ (n + 1) := by + induction n with + | zero => simp [z0j] + | succ n ih => simp [z0j,List.append_assoc,ih] +theorem z0m (a b : List α) (n : Nat) : (a ++ b) ^ n ++ a = a ++ (b ++ a) ^ n := by + induction n with + | zero => simp + | succ n ih => + rw [z0j,List.append_assoc,ih,z0j] + simp only [List.append_assoc] +theorem z0n (a b : zF) (i : Nat) (s : zB) : + a +> ((b ++ a) ^ i) +> (b +> s) = ((a ++ b) ^ (i + 1)) +> s := by + rw [<- append_assoc,<- append_assoc,<- z0m,List.append_assoc,z0l] +def z0o (d0 d1 : zF) : Nat -> Nat -> zB -> zB + | 0,_,r => r + | len + 1,n,r => (if n % 2 = 0 then d1 else d0) +> z0o d0 d1 len (n / 2) r +def z0p (d0 d1 dw : zF) (len n : Nat) (r : zB) : zB := + (if n % 2 = 0 then d1 else d0) +> z0o (dw ++ d0) (dw ++ d1) len (n / 2) r +def z0q (d0 d1 : zF) : Nat -> zB + | 0 => default + | n + 1 => + let m := n + 1 + (if m % 2 = 0 then d0 else d1) +> z0q d0 d1 (m / 2) +theorem z0r (d0 d1 : zF) (n : Nat) (r : zB) : + z0o d0 d1 0 n r = r := rfl +theorem z0s (d0 d1 : zF) (len n : Nat) (r : zB) : + z0o d0 d1 (len + 1) (n * 2) r = d1 +> z0o d0 d1 len n r := by + simp only [z0o] + have h1 : (n * 2) % 2 = 0 := by omega + have h2 : (n * 2) / 2 = n := by omega + simp [h1,h2] +theorem z0t (d0 d1 : zF) (len n : Nat) (r : zB) : + z0o d0 d1 (len + 1) (n * 2 + 1) r = d0 +> z0o d0 d1 len n r := by + simp only [z0o] + have h1 : (n * 2 + 1) % 2 = 1 := by omega + have h2 : (n * 2 + 1) / 2 = n := by omega + simp [h1,h2] +theorem z0u (d0 d1 : zF) (len : Nat) (r : zB) : + z0o d0 d1 len 0 r = (d1 ^ len) +> r := by + induction len with + | zero => rfl + | succ len ih => + have h := z0s d0 d1 len 0 r + simp only [Nat.zero_mul] at h + rw [h,ih,z0j,append_assoc] +theorem z0v (n : Nat) : 0 < 2 ^ n := Nat.two_pow_pos n +theorem z0w (d0 d1 : zF) (len : Nat) (r : zB) : + z0o d0 d1 len (2 ^ len - 1) r = (d0 ^ len) +> r := by + induction len with + | zero => rfl + | succ len ih => + have hp := z0v len + have h1 : 2 ^ (len + 1) - 1 = (2 ^ len - 1) * 2 + 1 := by + rw [Nat.pow_succ]; omega + rw [h1,z0t,ih,z0j,append_assoc] +theorem z0x (d0 d1 : zF) (len n i : Nat) (r : zB) : + z0o d0 d1 (len + i) (n * 2 ^ i) r = (d1 ^ i) +> z0o d0 d1 len n r := by + induction i with + | zero => simp + | succ i ih => + have h1 : len + (i + 1) = (len + i) + 1 := by omega + have h2 : n * 2 ^ (i + 1) = (n * 2 ^ i) * 2 := by rw [Nat.pow_succ]; ring + rw [h1,h2,z0s,ih,z0j,append_assoc] +theorem z0y (d0 d1 : zF) (len n i : Nat) (r : zB) : + z0o d0 d1 (len + 1 + i) ((n * 2 + 1) * 2 ^ i - 1) r = + (d0 ^ i) +> d1 +> z0o d0 d1 len n r := by + induction i with + | zero => + have h1 : (n * 2 + 1) * 2 ^ 0 - 1 = n * 2 := by simp + simp [h1,z0s] + | succ i ih => + have hp := z0v i + have hpos : 1 <= (n * 2 + 1) * 2 ^ i := Nat.mul_pos (by omega) hp + have h1 : len + 1 + (i + 1) = (len + 1 + i) + 1 := by omega + have h2 : (n * 2 + 1) * 2 ^ (i + 1) - 1 = ((n * 2 + 1) * 2 ^ i - 1) * 2 + 1 := by + rw [Nat.pow_succ] + have : (n * 2 + 1) * (2 ^ i * 2) = ((n * 2 + 1) * 2 ^ i) * 2 := by ring + (try omega) + rw [h1,h2,z0t,ih,z0j,append_assoc] +theorem z0y' (d0 d1 : zF) (len n i : Nat) (r : zB) : + z0o d0 d1 (len + i) ((n + 1) * 2 ^ i - 1) r = + (d0 ^ i) +> z0o d0 d1 len n r := by + induction i with + | zero => + have h1 : (n + 1) * 2 ^ 0 - 1 = n := by omega + simp [h1] + | succ i ih => + have hp := z0v i + have hpos : 1 <= (n + 1) * 2 ^ i := Nat.mul_pos (by omega) hp + have h1 : len + (i + 1) = (len + i) + 1 := by omega + have h2 : (n + 1) * 2 ^ (i + 1) - 1 = ((n + 1) * 2 ^ i - 1) * 2 + 1 := by + rw [Nat.pow_succ] + have : (n + 1) * (2 ^ i * 2) = ((n + 1) * 2 ^ i) * 2 := by ring + (try omega) + rw [h1,h2,z0t,ih,z0j,append_assoc] +theorem z0z (d0 d1 dw : zF) (len n : Nat) (r : zB) : + z0p d0 d1 dw len (n * 2) r = d1 +> z0o (dw ++ d0) (dw ++ d1) len n r := by + unfold z0p + have h1 : (n * 2) % 2 = 0 := by omega + have h2 : (n * 2) / 2 = n := by omega + simp [h1,h2] +theorem z0A (d0 d1 dw : zF) (len n : Nat) (r : zB) : + z0p d0 d1 dw len (n * 2 + 1) r = d0 +> z0o (dw ++ d0) (dw ++ d1) len n r := by + unfold z0p + have h1 : (n * 2 + 1) % 2 = 1 := by omega + have h2 : (n * 2 + 1) / 2 = n := by omega + simp [h1,h2] +theorem z0B (d0 d1 dw : zF) (len : Nat) (r : zB) : + z0p d0 d1 dw len 0 r = ((d1 ++ dw) ^ len) +> d1 +> r := by + have h := z0z d0 d1 dw len 0 r + simp only [Nat.zero_mul] at h + rw [h,z0u,<- append_assoc,<- z0m,append_assoc] +theorem z0C (d0 d1 dw : zF) (len : Nat) (r : zB) : + z0p d0 d1 dw len (2 ^ (len + 1) - 1) r = ((d0 ++ dw) ^ len) +> d0 +> r := by + have hp := z0v len + have h1 : 2 ^ (len + 1) - 1 = (2 ^ len - 1) * 2 + 1 := by rw [Nat.pow_succ]; omega + rw [h1,z0A,z0w,<- append_assoc,<- z0m,append_assoc] +theorem z0D (d0 d1 dw : zF) (len n i : Nat) (r : zB) : + z0p d0 d1 dw (len + i) ((n * 2 + 1) * 2 ^ i - 1) r = + ((d0 ++ dw) ^ i) +> d1 +> z0o (dw ++ d0) (dw ++ d1) len n r := by + cases i with + | zero => + have h1 : (n * 2 + 1) * 2 ^ 0 - 1 = n * 2 := by simp + simp [h1,z0z] + | succ i => + have hp := z0v i + have hpos : 1 <= (n * 2 + 1) * 2 ^ i := Nat.mul_pos (by omega) hp + have h1 : len + (i + 1) = len + 1 + i := by omega + have h2 : (n * 2 + 1) * 2 ^ (i + 1) - 1 = ((n * 2 + 1) * 2 ^ i - 1) * 2 + 1 := by + rw [Nat.pow_succ] + have : (n * 2 + 1) * (2 ^ i * 2) = ((n * 2 + 1) * 2 ^ i) * 2 := by ring + (try omega) + rw [h2,z0A,h1,z0y] + rw [append_assoc dw d1,z0n] +theorem z0E (d0 d1 dw : zF) (len n i : Nat) (r : zB) : + z0p d0 d1 dw (len + i) ((n * 2 + 1) * 2 ^ i) r = + ((d1 ++ dw) ^ i) +> d0 +> z0o (dw ++ d0) (dw ++ d1) len n r := by + cases i with + | zero => + simp [z0A] + | succ i => + have h1 : len + (i + 1) = (len + 1) + i := by omega + have h2 : (n * 2 + 1) * 2 ^ (i + 1) = ((n * 2 + 1) * 2 ^ i) * 2 := by rw [Nat.pow_succ]; ring + rw [h2,z0z,h1,z0x,z0t] + rw [append_assoc dw d0,z0n] +theorem z0F (d0 d1 : zF) : z0q d0 d1 0 = default := by simp [z0q] +theorem z0G (d0 d1 : zF) : z0q d0 d1 1 = d1 +> default := by simp [z0q] +theorem z0H {d0 d1 : zF} (hd0 : d0 +> default = default) (n : Nat) : + z0q d0 d1 (n * 2) = d0 +> z0q d0 d1 n := by + cases n with + | zero => simp [z0q,hd0] + | succ k => + conv_lhs => + rw [show (k + 1) * 2 = (k * 2 + 1) + 1 by omega] + unfold z0q + simp only [show (k * 2 + 1 + 1) % 2 = 0 by omega,show (k * 2 + 1 + 1) / 2 = k + 1 by omega,↓reduceIte] +theorem z0I (d0 d1 : zF) (n : Nat) : + z0q d0 d1 (n * 2 + 1) = d1 +> z0q d0 d1 n := by + simp only [z0q] + have h1 : (n * 2 + 1) % 2 = 1 := by omega + have h2 : (n * 2 + 1) / 2 = n := by omega + simp [h1,h2] +theorem z0J {d0 d1 : zF} (hd0 : d0 +> default = default) (n i : Nat) : + z0q d0 d1 (n * 2 ^ i) = (d0 ^ i) +> z0q d0 d1 n := by + induction i with + | zero => simp + | succ i ih => + have h1 : n * 2 ^ (i + 1) = (n * 2 ^ i) * 2 := by rw [Nat.pow_succ]; ring + rw [h1,z0H hd0,ih,z0j,append_assoc] +theorem z0K {d0 d1 : zF} (hd0 : d0 +> default = default) (i : Nat) : + z0q d0 d1 (2 ^ i) = (d0 ^ i) +> d1 +> default := by + have h1 : 2 ^ i = 1 * 2 ^ i := by omega + rw [h1,z0J hd0,z0G] +theorem z0L {d0 d1 : zF} (hd0 : d0 +> default = default) (n i : Nat) : + z0q d0 d1 ((n * 2 + 1) * 2 ^ i - 1) = (d1 ^ i) +> d0 +> z0q d0 d1 n := by + induction i with + | zero => + have h1 : (n * 2 + 1) * 2 ^ 0 - 1 = n * 2 := by simp + simp [h1,z0H hd0] + | succ i ih => + have hp := z0v i + have hpos : 1 <= (n * 2 + 1) * 2 ^ i := Nat.mul_pos (by omega) hp + have h1 : (n * 2 + 1) * 2 ^ (i + 1) - 1 = ((n * 2 + 1) * 2 ^ i - 1) * 2 + 1 := by + rw [Nat.pow_succ] + have : (n * 2 + 1) * (2 ^ i * 2) = ((n * 2 + 1) * 2 ^ i) * 2 := by ring + (try omega) + rw [h1,z0I,ih,z0j,append_assoc] +theorem z0M (d0 d1 : zF) (len n : Nat) (r : zB) + (h : 1 + n < 2 ^ len) : + ∃ (i : Nat) (s : zB), + z0o d0 d1 len (1 + n) r = (d1 ^ i) +> d0 +> s /\ + z0o d0 d1 len n r = (d0 ^ i) +> d1 +> s := by + induction len generalizing n with + | zero => simp at h + | succ len ih => + have hp : 2 ^ (len + 1) = 2 ^ len * 2 := Nat.pow_succ 2 len + let k := n / 2 + rcases Nat.mod_two_eq_zero_or_one n with hn0 | hn1 + · have h_even : n = k * 2 := by omega + have h_odd : 1 + n = k * 2 + 1 := by omega + refine ⟨0,z0o d0 d1 len k r,?_,?_⟩ + · rw [h_odd,z0t]; rfl + · rw [h_even,z0s]; rfl + · have h_odd : n = k * 2 + 1 := by omega + have h_even : 1 + n = (1 + k) * 2 := by omega + have h_lt : 1 + k < 2 ^ len := by omega + rcases ih k h_lt with ⟨i,s,hi1,hi0⟩ + refine ⟨i + 1,s,?_,?_⟩ + · rw [h_even,z0s,hi1,z0j,append_assoc] + · rw [h_odd,z0t,hi0,z0j,append_assoc] +theorem z0N (d0 d1 dw : zF) (len n : Nat) (r : zB) + (h : 1 + n < 2 ^ (len + 1)) : + ∃ (i : Nat) (s : zB), + z0p d0 d1 dw len (1 + n) r = ((d1 ++ dw) ^ i) +> d0 +> s /\ + z0p d0 d1 dw len n r = ((d0 ++ dw) ^ i) +> d1 +> s := by + have hp : 2 ^ (len + 1) = 2 ^ len * 2 := Nat.pow_succ 2 len + let k := n / 2 + rcases Nat.mod_two_eq_zero_or_one n with hn0 | hn1 + · have h_even : n = k * 2 := by omega + have h_odd : 1 + n = k * 2 + 1 := by omega + refine ⟨0,z0o (dw ++ d0) (dw ++ d1) len k r,?_,?_⟩ + · rw [h_odd,z0A]; rfl + · rw [h_even,z0z]; rfl + · have h_odd : n = k * 2 + 1 := by omega + have h_even : 1 + n = (1 + k) * 2 := by omega + have h_lt : 1 + k < 2 ^ len := by omega + rcases z0M (dw ++ d0) (dw ++ d1) len k r h_lt with ⟨i,s,hi1,hi0⟩ + refine ⟨i + 1,s,?_,?_⟩ + · rw [h_even,z0z,hi1,append_assoc dw d0,z0n] + · rw [h_odd,z0A,hi0,append_assoc dw d1,z0n] +theorem z0O {d0 d1 : zF} (hd0 : d0 +> default = default) (n : Nat) : + ∃ (i : Nat) (s : zB), + z0q d0 d1 n = (d1 ^ i) +> d0 +> s /\ + z0q d0 d1 (1 + n) = (d0 ^ i) +> d1 +> s := by + induction n using Nat.strong_induction_on with + | h n ih => + let k := n / 2 + rcases Nat.mod_two_eq_zero_or_one n with hn0 | hn1 + · have h_even : n = k * 2 := by omega + have h_odd : 1 + n = k * 2 + 1 := by omega + refine ⟨0,z0q d0 d1 k,?_,?_⟩ + · rw [h_even,z0H hd0]; rfl + · rw [h_odd,z0I]; rfl + · have h_odd : n = k * 2 + 1 := by omega + have h_even : 1 + n = (1 + k) * 2 := by omega + have h_lt : k < n := by omega + rcases ih k h_lt with ⟨i,s,hi0,hi1⟩ + refine ⟨i + 1,s,?_,?_⟩ + · rw [h_odd,z0I,hi0,z0j,append_assoc] + · rw [h_even,z0H hd0,hi1,z0j,append_assoc] +theorem zSm {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + (tm : Machine zG_ zL_) (c_1 c_2 : Cfg zG_ zL_) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z0P {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + (tm : Machine zG_ zL_) (c_1 c_2 : Cfg zG_ zL_) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢* c_2 := ⟨1,zSm tm c_1 c_2 h⟩ +theorem z0Q {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + (tm : Machine zG_ zL_) (c_1 c_2 : Cfg zG_ zL_) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + (tm : Machine zG_ zL_) (c_1 : Cfg zG_ zL_) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + (tm : Machine zG_ zL_) (c_1 c_2 c_3 : Cfg zG_ zL_) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem zSt {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 c_3 : Cfg zG_ zL_} + (h₁ : c_1 [tm]⊢* c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢* c_3 := by + obtain ⟨n,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem zPt {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 c_3 : Cfg zG_ zL_} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,_,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem zPs {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 : Cfg zG_ zL_} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem z0R {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 c_3 : Cfg zG_ zL_} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z0S {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 c_3 : Cfg zG_ zL_} + (h₁ : c_1 [tm]⊢* c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le m_pos (Nat.le_add_left m n),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z0T {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 c_3 : Cfg zG_ zL_} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z0R (z0Q tm c_1 c_2 h₁) h₂ +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step_tm" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z0T (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z0i,zDh,zDt]) +macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm))) +macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) +abbrev ld0 : zF := [0,1,1,1] +abbrev ld1 : zF := [1,1,1,1] +abbrev ldh : zB := [1] +> default +abbrev rd0 : zF := [0,0,0] +abbrev rd1 : zF := [1,0,0] +def z0U (l r : zB) : Cfg (Fin 2) (Fin 6) := + l <{{E}} ([0,1,0,1,0] +> r) +def z0V (l r : zB) : Cfg (Fin 2) (Fin 6) := + ([1,0,1,1,1] +> l) {{B}}> r +def z0W (l r : zB) : Cfg (Fin 2) (Fin 6) := + (ld0 +> l) {{F}}> r +theorem z0X (n : Nat) (r : zB) : + [1,0] +> (([1,0,1,0] ^ n) +> r) = ([1,0,1,0] ^ n) +> ([1,0] +> r) := by + induction n with + | zero => rfl + | succ n ih => + rw [z0j,append_assoc,append_assoc,<- ih] + rfl +theorem z0Y (n : Nat) (r : zB) : + (rd0 ^ n) +> ([0] +> r) = [0] +> ((rd0 ^ n) +> r) := by + induction n with + | zero => rfl + | succ n ih => + rw [z0j,append_assoc,append_assoc,ih] + rfl +theorem z0Z (n : Nat) (l r : zB) : + (l {{B}}> ((rd1 ^ n) +> r)) [target_tm]⊢* ((([1,1,1] ^ n) +> l) {{B}}> r) := by + induction n generalizing l r with + | zero => exact ⟨0,rfl⟩ + | succ n ih => + rw [z0j,append_assoc] + have h1 : (l {{B}}> (rd1 +> (rd1 ^ n) +> r)) [target_tm]⊢* + (([1,1,1] +> l) {{B}}> ((rd1 ^ n) +> r)) := by + dsimp [rd1,ListBlank.append]; execute + have h2 := ih ([1,1,1] +> l) r + rw [<- append_assoc ([1,1,1] ^ n) [1,1,1] l,z0l] at h2 + exact zSt h1 h2 +theorem z10 (n : Nat) (l r : zB) : + ((([1,1,1] ^ n) +> l) <{{C}} r) [target_tm]⊢* (l <{{C}} ((rd0 ^ n) +> r)) := by + induction n generalizing l r with + | zero => exact ⟨0,rfl⟩ + | succ n ih => + rw [z0j,append_assoc] + have h1 : (([1,1,1] +> ([1,1,1] ^ n) +> l) <{{C}} r) [target_tm]⊢* + ((([1,1,1] ^ n) +> l) <{{C}} (rd0 +> r)) := by + dsimp [rd0,ListBlank.append]; execute + have h2 := ih l (rd0 +> r) + rw [<- append_assoc (rd0 ^ n) rd0 r,z0l] at h2 + exact zSt h1 h2 +theorem z11 (n : Nat) (l r : zB) : + (((ld1 ^ n) +> l) <{{E}} ([0,1,0,1,0] +> r)) [target_tm]⊢* + (l <{{E}} ([0,1,0,1,0] +> ([1,0,1,0] ^ n) +> r)) := by + induction n generalizing l r with + | zero => exact ⟨0,rfl⟩ + | succ n ih => + rw [z0j,append_assoc] + have h1 : ((ld1 +> (ld1 ^ n) +> l) <{{E}} ([0,1,0,1,0] +> r)) [target_tm]⊢* + (((ld1 ^ n) +> l) <{{E}} ([0,1,0,1,0] +> [1,0,1,0] +> r)) := by + dsimp [ld1,ListBlank.append]; execute + have h2 := ih l ([1,0,1,0] +> r) + rw [<- append_assoc ([1,0,1,0] ^ n) [1,0,1,0] r,z0l] at h2 + exact zSt h1 h2 +theorem z12 (n : Nat) (l r : zB) : + (((ld1 ^ n) +> l) <{{D}} ([1,0] +> r)) [target_tm]⊢* + (l <{{D}} ([1,0] +> ([1,0,1,0] ^ n) +> r)) := by + induction n generalizing l r with + | zero => exact ⟨0,rfl⟩ + | succ n ih => + rw [z0j,append_assoc] + have h1 : ((ld1 +> (ld1 ^ n) +> l) <{{D}} ([1,0] +> r)) [target_tm]⊢* + (((ld1 ^ n) +> l) <{{D}} ([1,0] +> [1,0,1,0] +> r)) := by + dsimp [ld1,ListBlank.append]; execute + have h2 := ih l ([1,0,1,0] +> r) + rw [<- append_assoc ([1,0,1,0] ^ n) [1,0,1,0] r,z0l] at h2 + exact zSt h1 h2 +theorem z13 (n : Nat) (l r : zB) : + (([1,0,1,1,1] +> l) {{B}}> (([1,0,1,0] ^ n) +> r)) [target_tm]⊢* + (([1,0,1,1,1] +> (ld0 ^ n) +> l) {{B}}> r) := by + induction n generalizing l r with + | zero => exact ⟨0,rfl⟩ + | succ n ih => + rw [z0j,append_assoc] + have h1 : (([1,0,1,1,1] +> l) {{B}}> ([1,0,1,0] +> ([1,0,1,0] ^ n) +> r)) [target_tm]⊢* + (([1,0,1,1,1] +> ld0 +> l) {{B}}> (([1,0,1,0] ^ n) +> r)) := by + dsimp [ld0,ListBlank.append]; execute + have h2 := ih (ld0 +> l) r + rw [<- append_assoc (ld0 ^ n) ld0 l,z0l] at h2 + exact zSt h1 h2 +theorem z14 (n : Nat) (l r : zB) : + (([1] +> l) {{B}}> ((rd1 ^ (n * 4)) +> r)) [target_tm]⊢* + (([1] +> (ld1 ^ (n * 3)) +> l) {{B}}> r) := by + induction n generalizing l r with + | zero => exact ⟨0,rfl⟩ + | succ n ih => + have h_mul4 : (n + 1) * 4 = 4 + n * 4 := by omega + have h_mul3 : n * 3 + 3 = (n + 1) * 3 := by omega + rw [h_mul4,z0k,append_assoc] + have h1 : (([1] +> l) {{B}}> ((rd1 ^ 4) +> (rd1 ^ (n * 4)) +> r)) [target_tm]⊢* + (([1] +> (ld1 ^ 3) +> l) {{B}}> ((rd1 ^ (n * 4)) +> r)) := by + dsimp [rd1,ld1,HPow.hPow, ListBlank.append]; execute + have h2 := ih ((ld1 ^ 3) +> l) r + rw [<- append_assoc (ld1 ^ (n * 3)) (ld1 ^ 3) l,<- z0k,h_mul3] at h2 + exact zSt h1 h2 +theorem z15 (l r : zB) (n : Nat) : + (z0U ((ld1 ^ n) +> ld0 +> l) r) [target_tm]⊢⁺ + (z0V ((ld0 ^ n) +> ld1 +> l) r) := by + unfold z0U z0V + have h1 := z11 n (ld0 +> l) r + have h2 : ((ld0 +> l) <{{E}} ([0,1,0,1,0] +> ([1,0,1,0] ^ n) +> r)) [target_tm]⊢⁺ + (([1,0,1,1,1] +> ld1 +> l) {{B}}> (([1,0,1,0] ^ n) +> r)) := by + dsimp [ld0,ld1,ListBlank.append]; execute + have h3 := z13 n (ld1 +> l) r + exact z0R (z0S h1 h2) h3 +theorem z16 (l r : zB) (n : Nat) : + (z0V l ((rd1 ^ n) +> [0] +> r)) [target_tm]⊢⁺ + (z0U l ((rd0 ^ n) +> [1] +> r)) := by + unfold z0V z0U + have h1 := z0Z n ([1,0,1,1,1] +> l) ([0] +> r) + have h2 : ((([1,1,1] ^ n) +> [1,0,1,1,1] +> l) {{B}}> ([0] +> r)) [target_tm]⊢⁺ + ((([1,1,1] ^ n) +> [1,0,1,1,1] +> l) <{{C}} ([1] +> r)) := by + dsimp [ListBlank.append]; execute + have h3 := z10 n ([1,0,1,1,1] +> l) ([1] +> r) + have h4 : (([1,0,1,1,1] +> l) <{{C}} ((rd0 ^ n) +> [1] +> r)) [target_tm]⊢* + (l <{{E}} ([0,1,0,1,0] +> (rd0 ^ n) +> [1] +> r)) := by + dsimp [ListBlank.append]; execute + exact z0R (z0R (z0S h1 h2) h3) h4 +theorem z17 (r : zB) (n : Nat) : + (z0U ((ld1 ^ n) +> ldh) (rd0 +> r)) [target_tm]⊢⁺ + (z0V ((ld0 ^ n) +> ldh) (rd1 +> [0,0] +> r)) := by + unfold z0U z0V + have h1 := z11 n ldh (rd0 +> r) + have h2 : (ldh <{{E}} ([0,1,0,1,0] +> ([1,0,1,0] ^ n) +> rd0 +> r)) [target_tm]⊢⁺ + (([1,0,1,1,1] +> ldh) {{B}}> ([1,0] +> ([1,0,1,0] ^ n) +> rd0 +> r)) := by + dsimp [ldh,ListBlank.append]; execute + rw [z0X] at h2 + have h3 := z13 n ldh ([1,0] +> rd0 +> r) + exact z0R (z0S h1 h2) h3 +theorem z18 (r : zB) (n : Nat) : + (z0U ((ld1 ^ n) +> ldh) (rd1 +> r)) [target_tm]⊢⁺ + (z0V ((ld0 ^ (1 + n)) +> ldh) ([0] +> r)) := by + unfold z0U z0V + have h1 := z11 n ldh (rd1 +> r) + have h2 : (ldh <{{E}} ([0,1,0,1,0] +> ([1,0,1,0] ^ n) +> rd1 +> r)) [target_tm]⊢⁺ + (([1,0,1,1,1] +> ldh) {{B}}> ([1,0] +> ([1,0,1,0] ^ n) +> rd1 +> r)) := by + dsimp [ldh,ListBlank.append]; execute + rw [z0X] at h2 + have h3 := z13 n ldh ([1,0] +> rd1 +> r) + have h4 : (([1,0,1,1,1] +> (ld0 ^ n) +> ldh) {{B}}> ([1,0] +> rd1 +> r)) [target_tm]⊢* + (([1,0,1,1,1] +> ld0 +> (ld0 ^ n) +> ldh) {{B}}> ([0] +> r)) := by + dsimp [rd1,ld0,ListBlank.append]; execute + rw [<- append_assoc ld0 (ld0 ^ n) ldh,<- z0j,Nat.add_comm] at h4 + exact z0R (z0R (z0S h1 h2) h3) h4 +def z19 (l l' : zB) : Prop := + ∀ r,(l <{{D}} ([1,0,1,0,1,0] +> r)) [target_tm]⊢* (z0V l' ([1,0] +> r)) +theorem z1a : z19 ldh ldh := by + intro r + unfold z0V + dsimp [ldh,ListBlank.append] + execute +theorem z1b {l l' : zB} (h : z19 l l') : z19 (ld0 +> l) (ld0 +> l') := by + intro r + have h1 : ((ld0 +> l) <{{D}} ([1,0,1,0,1,0] +> r)) [target_tm]⊢* + (l <{{D}} ([1,0,1,0,1,0] +> [1,0,1,0] +> r)) := by + dsimp [ld0,ListBlank.append]; execute + have h2 := h ([1,0,1,0] +> r) + unfold z0V at h2 ⊢ + have h3 : (([1,0,1,1,1] +> l') {{B}}> ([1,0] +> [1,0,1,0] +> r)) [target_tm]⊢* + (([1,0,1,1,1] +> ld0 +> l') {{B}}> ([1,0] +> r)) := by + dsimp [ld0,ListBlank.append]; execute + exact zSt (zSt h1 h2) h3 +theorem z1c {l l' : zB} (h : z19 l l') : z19 (ld1 +> l) (ld0 +> l') := by + intro r + have h1 : ((ld1 +> l) <{{D}} ([1,0,1,0,1,0] +> r)) [target_tm]⊢* + (l <{{D}} ([1,0,1,0,1,0] +> [1,0,1,0] +> r)) := by + dsimp [ld1,ListBlank.append]; execute + have h2 := h ([1,0,1,0] +> r) + unfold z0V at h2 ⊢ + have h3 : (([1,0,1,1,1] +> l') {{B}}> ([1,0] +> [1,0,1,0] +> r)) [target_tm]⊢* + (([1,0,1,1,1] +> ld0 +> l') {{B}}> ([1,0] +> r)) := by + dsimp [ld0,ListBlank.append]; execute + exact zSt (zSt h1 h2) h3 +theorem z1d {l l' : zB} (h : z19 l l') (k : Nat) (s : zB) : + (((ld1 ^ k) +> ld0 +> l) <{{D}} ([1,0] +> s)) [target_tm]⊢* + (z0V ((ld0 ^ k) +> l') ([1,0] +> s)) := by + have h1 := z12 k (ld0 +> l) s + have h2 : ((ld0 +> l) <{{D}} ([1,0] +> ([1,0,1,0] ^ k) +> s)) [target_tm]⊢* + (l <{{D}} ([1,0,1,0,1,0] +> ([1,0,1,0] ^ k) +> s)) := by + dsimp [ld0,ListBlank.append]; execute + have h3 := h (([1,0,1,0] ^ k) +> s) + unfold z0V at h3 ⊢ + rw [z0X] at h3 + have h4 := z13 k l' ([1,0] +> s) + exact zSt (zSt (zSt h1 h2) h3) h4 +theorem z1e (l r : zB) (n : Nat) {l' : zB} (h : z19 l l') : + (z0V l ((rd1 ^ (n * 4)) +> [1,1,0,0] +> r)) [target_tm]⊢⁺ + (z0V ((ld0 ^ (n * 3 + 1)) +> l') ([0] +> r)) := by + have h1 := z14 n (ld0 +> l) ([1,1,0,0] +> r) + have h2 : (([1] +> (ld1 ^ (n * 3)) +> ld0 +> l) {{B}}> ([1,1,0,0] +> r)) [target_tm]⊢⁺ + (((ld1 ^ (n * 3)) +> ld0 +> l) <{{D}} ([1,0] +> [1,0,0] +> r)) := by + dsimp [ListBlank.append]; execute + have h3 := z1d h (n * 3) ([1,0,0] +> r) + unfold z0V at h3 ⊢ + have h4 : (([1,0,1,1,1] +> (ld0 ^ (n * 3)) +> l') {{B}}> ([1,0] +> [1,0,0] +> r)) [target_tm]⊢* + (([1,0,1,1,1] +> ld0 +> (ld0 ^ (n * 3)) +> l') {{B}}> ([0] +> r)) := by + dsimp [ld0,ListBlank.append]; execute + rw [<- append_assoc ld0 (ld0 ^ (n * 3)) l',<- z0j] at h4 + exact z0R (z0R (z0S h1 h2) h3) h4 +theorem z1f (l r : zB) (n : Nat) : + (z0V l ((rd1 ^ (n * 4 + 1)) +> [1,1,0,0] +> r)) [target_tm]⊢⁺ + (z0V ((ld0 ^ (n * 3)) +> ld1 +> l) (rd1 +> r)) := by + rw [z0k,append_assoc] + have h1 := z14 n (ld0 +> l) ((rd1 ^ 1) +> [1,1,0,0] +> r) + have h2 : (([1] +> (ld1 ^ (n * 3)) +> ld0 +> l) {{B}}> ((rd1 ^ 1) +> [1,1,0,0] +> r)) [target_tm]⊢⁺ + (z0U ((ld1 ^ (n * 3)) +> ld0 +> l) (rd1 +> r)) := by + unfold z0U; dsimp [rd1,HPow.hPow, ListBlank.append]; execute + have h3 := z15 l (rd1 +> r) (n * 3) + exact zPt (z0S h1 h2) h3 +theorem z1g (l r : zB) (n : Nat) {l' : zB} (h : z19 l l') : + (z0V l ((rd1 ^ (n * 4 + 2)) +> [1,1,0,0] +> r)) [target_tm]⊢⁺ + (z0V ((ld0 ^ (n * 3 + 2)) +> l') (rd1 +> r)) := by + rw [z0k,append_assoc] + have h1 := z14 n (ld0 +> l) ((rd1 ^ 2) +> [1,1,0,0] +> r) + have h2 : (([1] +> (ld1 ^ (n * 3)) +> ld0 +> l) {{B}}> ((rd1 ^ 2) +> [1,1,0,0] +> r)) [target_tm]⊢⁺ + (((ld1 ^ (n * 3)) +> ld0 +> l) <{{D}} ([1,0] +> [1,0,1,0,1,0,1,0,0] +> r)) := by + dsimp [rd1,HPow.hPow, ListBlank.append]; execute + have h3 := z1d h (n * 3) ([1,0,1,0,1,0,1,0,0] +> r) + unfold z0V at h3 ⊢ + have h4 : (([1,0,1,1,1] +> (ld0 ^ (n * 3)) +> l') {{B}}> ([1,0] +> [1,0,1,0,1,0,1,0,0] +> r)) [target_tm]⊢* + (([1,0,1,1,1] +> (ld0 ^ 2) +> (ld0 ^ (n * 3)) +> l') {{B}}> (rd1 +> r)) := by + dsimp [ld0,rd1,HPow.hPow, ListBlank.append]; execute + rw [<- append_assoc (ld0 ^ 2) (ld0 ^ (n * 3)) l',<- z0k,show 2 + n * 3 = n * 3 + 2 by omega] at h4 + exact z0R (z0R (z0S h1 h2) h3) h4 +theorem z1h (l r : zB) (n : Nat) : + (z0V l ((rd1 ^ (n * 4 + 3)) +> [1,1,0,0] +> r)) [target_tm]⊢⁺ + (z0V ((ld0 ^ (n * 3 + 2)) +> ld1 +> l) ([0] +> r)) := by + rw [z0k,append_assoc] + have h1 := z14 n (ld0 +> l) ((rd1 ^ 3) +> [1,1,0,0] +> r) + have h2 : (([1] +> (ld1 ^ (n * 3)) +> ld0 +> l) {{B}}> ((rd1 ^ 3) +> [1,1,0,0] +> r)) [target_tm]⊢⁺ + (z0U ((ld1 ^ (n * 3)) +> ld0 +> l) ([1,0,1,0,1,0,1,0,0] +> r)) := by + unfold z0U; dsimp [rd1,HPow.hPow, ListBlank.append]; execute + have h3 := z15 l ([1,0,1,0,1,0,1,0,0] +> r) (n * 3) + unfold z0V at h3 ⊢ + have h4 : (([1,0,1,1,1] +> (ld0 ^ (n * 3)) +> ld1 +> l) {{B}}> ([1,0,1,0,1,0,1,0,0] +> r)) [target_tm]⊢* + (([1,0,1,1,1] +> (ld0 ^ 2) +> (ld0 ^ (n * 3)) +> ld1 +> l) {{B}}> ([0] +> r)) := by + dsimp [ld0,HPow.hPow, ListBlank.append]; execute + rw [<- append_assoc (ld0 ^ 2) (ld0 ^ (n * 3)) (ld1 +> l),<- z0k,show 2 + n * 3 = n * 3 + 2 by omega] at h4 + exact z0R (zPt (z0S h1 h2) h3) h4 +theorem z1i (l r : zB) (n : Nat) : + (z0V l ((rd1 ^ (n * 4)) +> [1,0,1,0,0] +> r)) [target_tm]⊢⁺ + (z0V ((ld1 ^ (n * 3)) +> ld0 +> l) ([0] +> r)) := by + have h1 := z14 n (ld0 +> l) ([1,0,1,0,0] +> r) + have h2 : (([1] +> (ld1 ^ (n * 3)) +> ld0 +> l) {{B}}> ([1,0,1,0,0] +> r)) [target_tm]⊢⁺ + (z0V ((ld1 ^ (n * 3)) +> ld0 +> l) ([0] +> r)) := by + unfold z0V; dsimp [ListBlank.append]; execute + exact z0S h1 h2 +theorem z1j (l r : zB) (n : Nat) {l' : zB} (h : z19 l l') : + (z0V l ((rd1 ^ (n * 4 + 1)) +> [1,0,1,0,0] +> r)) [target_tm]⊢⁺ + (z0V ((ld0 ^ (n * 3 + 2)) +> l') ([1] +> r)) := by + rw [z0k,append_assoc] + have h1 := z14 n (ld0 +> l) ((rd1 ^ 1) +> [1,0,1,0,0] +> r) + have h2 : (([1] +> (ld1 ^ (n * 3)) +> ld0 +> l) {{B}}> ((rd1 ^ 1) +> [1,0,1,0,0] +> r)) [target_tm]⊢⁺ + (((ld1 ^ (n * 3)) +> ld0 +> l) <{{D}} ([1,0] +> [1,0,1,0,1,0,1] +> r)) := by + dsimp [rd1,HPow.hPow, ListBlank.append]; execute + have h3 := z1d h (n * 3) ([1,0,1,0,1,0,1] +> r) + unfold z0V at h3 ⊢ + have h4 : (([1,0,1,1,1] +> (ld0 ^ (n * 3)) +> l') {{B}}> ([1,0] +> [1,0,1,0,1,0,1] +> r)) [target_tm]⊢* + (([1,0,1,1,1] +> (ld0 ^ 2) +> (ld0 ^ (n * 3)) +> l') {{B}}> ([1] +> r)) := by + dsimp [ld0,HPow.hPow, ListBlank.append]; execute + rw [<- append_assoc (ld0 ^ 2) (ld0 ^ (n * 3)) l',<- z0k,show 2 + n * 3 = n * 3 + 2 by omega] at h4 + exact z0R (z0R (z0S h1 h2) h3) h4 +theorem z1k (l r : zB) (n : Nat) : + (z0V l ((rd1 ^ (n * 4 + 2)) +> [1,0,1,0,0] +> r)) [target_tm]⊢⁺ + (z0W ((ld0 ^ (n * 3 + 2)) +> ld1 +> l) r) := by + rw [z0k,append_assoc] + have h1 := z14 n (ld0 +> l) ((rd1 ^ 2) +> [1,0,1,0,0] +> r) + have h2 : (([1] +> (ld1 ^ (n * 3)) +> ld0 +> l) {{B}}> ((rd1 ^ 2) +> [1,0,1,0,0] +> r)) [target_tm]⊢⁺ + (z0U ((ld1 ^ (n * 3)) +> ld0 +> l) ([1,0,1,0,1,0,1] +> r)) := by + unfold z0U; dsimp [rd1,HPow.hPow, ListBlank.append]; execute + have h3 := z15 l ([1,0,1,0,1,0,1] +> r) (n * 3) + unfold z0V at h3 + unfold z0W + have h4 : (([1,0,1,1,1] +> (ld0 ^ (n * 3)) +> ld1 +> l) {{B}}> ([1,0,1,0,1,0,1] +> r)) [target_tm]⊢* + ((ld0 +> (ld0 ^ 2) +> (ld0 ^ (n * 3)) +> ld1 +> l) {{F}}> r) := by + dsimp [ld0,HPow.hPow, ListBlank.append]; execute + rw [<- append_assoc (ld0 ^ 2) (ld0 ^ (n * 3)) (ld1 +> l),<- z0k,show 2 + n * 3 = n * 3 + 2 by omega] at h4 + exact z0R (zPt (z0S h1 h2) h3) h4 +theorem z1l (l r : zB) (n : Nat) {l' : zB} (h : z19 l l') : + (z0V l ((rd1 ^ (n * 4 + 3)) +> [1,0,1,0,0] +> r)) [target_tm]⊢⁺ + (z0W ((ld0 ^ (n * 3 + 4)) +> l') r) := by + rw [z0k,append_assoc] + have h1 := z14 n (ld0 +> l) ((rd1 ^ 3) +> [1,0,1,0,0] +> r) + have h2 : (([1] +> (ld1 ^ (n * 3)) +> ld0 +> l) {{B}}> ((rd1 ^ 3) +> [1,0,1,0,0] +> r)) [target_tm]⊢⁺ + (((ld1 ^ (n * 3)) +> ld0 +> l) <{{D}} ([1,0] +> [1,0,1,0,1,0,1,0,1,0,1,0,1] +> r)) := by + dsimp [rd1,HPow.hPow, ListBlank.append]; execute + have h3 := z1d h (n * 3) ([1,0,1,0,1,0,1,0,1,0,1,0,1] +> r) + unfold z0V at h3 + unfold z0W + have h4 : (([1,0,1,1,1] +> (ld0 ^ (n * 3)) +> l') {{B}}> ([1,0] +> [1,0,1,0,1,0,1,0,1,0,1,0,1] +> r)) [target_tm]⊢* + ((ld0 +> (ld0 ^ 4) +> (ld0 ^ (n * 3)) +> l') {{F}}> r) := by + dsimp [ld0,HPow.hPow, ListBlank.append]; execute + rw [<- append_assoc (ld0 ^ 4) (ld0 ^ (n * 3)) l',<- z0k,show 4 + n * 3 = n * 3 + 4 by omega] at h4 + exact z0R (z0R (z0S h1 h2) h3) h4 +theorem z1m (l r : zB) : + (z0W l (rd0 +> r)) [target_tm]⊢⁺ (z0V l ([0,0] +> r)) := by + unfold z0W z0V + dsimp [ld0,rd0,ListBlank.append] + execute +theorem z1n (l : zB) (n : Nat) {l' : zB} (h : z19 l l') : + (z0V l ((rd1 ^ (n * 4)) +> [1,1,0,1] +> default)) [target_tm]⊢* + (z0V ((ld0 ^ (n * 3 + 1)) +> l') (rd1 +> default)) := by + have h1 := z14 n (ld0 +> l) ([1,1,0,1] +> default) + have h2 : (([1] +> (ld1 ^ (n * 3)) +> ld0 +> l) {{B}}> ([1,1,0,1] +> default)) [target_tm]⊢* + (((ld1 ^ (n * 3)) +> ld0 +> l) <{{D}} ([1,0] +> [1,0,1,0] +> default)) := by + dsimp [ListBlank.append]; execute + have h3 := z1d h (n * 3) ([1,0,1,0] +> default) + unfold z0V at h3 ⊢ + have h4 : (([1,0,1,1,1] +> (ld0 ^ (n * 3)) +> l') {{B}}> ([1,0] +> [1,0,1,0] +> default)) [target_tm]⊢* + (([1,0,1,1,1] +> ld0 +> (ld0 ^ (n * 3)) +> l') {{B}}> (rd1 +> default)) := by + dsimp [ld0,rd1,ListBlank.append]; execute + rw [<- append_assoc ld0 (ld0 ^ (n * 3)) l',<- z0j] at h4 + exact zSt (zSt (zSt h1 h2) h3) h4 +theorem z1o (l : zB) (n : Nat) : + (z0V l ((rd1 ^ (n * 4 + 1)) +> [1,1,0,1] +> default)) [target_tm]⊢* + (z0U ((ld1 ^ (n * 3 + 1)) +> ld0 +> l) default) := by + rw [z0k,append_assoc] + have h1 := z14 n (ld0 +> l) ((rd1 ^ 1) +> [1,1,0,1] +> default) + have h2 : (([1] +> (ld1 ^ (n * 3)) +> ld0 +> l) {{B}}> ((rd1 ^ 1) +> [1,1,0,1] +> default)) [target_tm]⊢* + (z0U (ld1 +> (ld1 ^ (n * 3)) +> ld0 +> l) default) := by + unfold z0U; dsimp [rd1,ld1,HPow.hPow, ListBlank.append]; execute + rw [<- append_assoc ld1 (ld1 ^ (n * 3)) (ld0 +> l),<- z0j] at h2 + exact zSt h1 h2 +theorem z1p (l : zB) (n : Nat) {l' : zB} (h : z19 l l') : + (z0V l ((rd1 ^ (n * 4 + 2)) +> [1,1,0,1] +> default)) [target_tm]⊢* + (z0V ((ld0 ^ (n * 3 + 3)) +> l') default) := by + rw [z0k,append_assoc] + have h1 := z14 n (ld0 +> l) ((rd1 ^ 2) +> [1,1,0,1] +> default) + have h2 : (([1] +> (ld1 ^ (n * 3)) +> ld0 +> l) {{B}}> ((rd1 ^ 2) +> [1,1,0,1] +> default)) [target_tm]⊢* + (((ld1 ^ (n * 3)) +> ld0 +> l) <{{D}} ([1,0] +> [1,0,1,0,1,0,1,0,1,0] +> default)) := by + dsimp [rd1,HPow.hPow, ListBlank.append]; execute + have h3 := z1d h (n * 3) ([1,0,1,0,1,0,1,0,1,0] +> default) + unfold z0V at h3 ⊢ + have h4 : (([1,0,1,1,1] +> (ld0 ^ (n * 3)) +> l') {{B}}> ([1,0] +> [1,0,1,0,1,0,1,0,1,0] +> default)) [target_tm]⊢* + (([1,0,1,1,1] +> (ld0 ^ 3) +> (ld0 ^ (n * 3)) +> l') {{B}}> default) := by + dsimp [ld0,HPow.hPow, ListBlank.append]; execute + rw [<- append_assoc (ld0 ^ 3) (ld0 ^ (n * 3)) l',<- z0k,show 3 + n * 3 = n * 3 + 3 by omega] at h4 + exact zSt (zSt (zSt h1 h2) h3) h4 +theorem z1q (l : zB) (n : Nat) : + (z0V l ((rd1 ^ (n * 4 + 3)) +> [1,1,0,1] +> default)) [target_tm]⊢* + (z0U ((ld1 ^ (n * 3 + 2)) +> ld0 +> l) (rd1 +> default)) := by + rw [z0k,append_assoc] + have h1 := z14 n (ld0 +> l) ((rd1 ^ 3) +> [1,1,0,1] +> default) + have h2 : (([1] +> (ld1 ^ (n * 3)) +> ld0 +> l) {{B}}> ((rd1 ^ 3) +> [1,1,0,1] +> default)) [target_tm]⊢* + (z0U ((ld1 ^ 2) +> (ld1 ^ (n * 3)) +> ld0 +> l) (rd1 +> default)) := by + unfold z0U; dsimp [rd1,ld1,HPow.hPow, ListBlank.append]; execute + rw [<- append_assoc (ld1 ^ 2) (ld1 ^ (n * 3)) (ld0 +> l),<- z0k,show 2 + n * 3 = n * 3 + 2 by omega] at h2 + exact zSt h1 h2 +theorem z1r : ((default) {{A}}> (default)) [target_tm]⊢* (([0,0,1,1,1,1] +> default) <{{D}} ([1,0,1,0,1] +> default)) := by execute +theorem z1s : (([0,0,1,1,1,1] +> default) <{{D}} ([1,0,1,0,1] +> default)) [target_tm]⊢* (([0,1,1,1,0,1,1,1,1] +> default) {{F}}> ([0,1,0,0,0,0,1] +> default)) := by execute +theorem z1t : (([0,1,1,1,0,1,1,1,1] +> default) {{F}}> ([0,1,0,0,0,0,1] +> default)) [target_tm]⊢* ((default) <{{D}} ([1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1] +> default)) := by execute +theorem z1u : ((default) <{{D}} ([1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1] +> default)) [target_tm]⊢* (([1,1,1,1,1,0,1,1,1,1] +> default) <{{E}} ([0,1,0,1,0,1,0,1] +> default)) := by execute +theorem z1v : (([1,1,1,1,1,0,1,1,1,1] +> default) <{{E}} ([0,1,0,1,0,1,0,1] +> default)) [target_tm]⊢* (([1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1] +> default) <{{C}} ([0,0,1] +> default)) := by execute +theorem z1w : (([1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1] +> default) <{{C}} ([0,0,1] +> default)) [target_tm]⊢* (([1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1] +> default) {{A}}> ([1,0,1,0,0,1] +> default)) := by execute +theorem z1x : (([1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1] +> default) {{A}}> ([1,0,1,0,0,1] +> default)) [target_tm]⊢* (([0,1,1,1,1,1,1,0,1,1,1,1] +> default) {{E}}> ([1,0,1,0,1,0,1,0,0,0,0,0,1] +> default)) := by execute +theorem z1y : (([0,1,1,1,1,1,1,0,1,1,1,1] +> default) {{E}}> ([1,0,1,0,1,0,1,0,0,0,0,0,1] +> default)) [target_tm]⊢* (([0,0,1,1,1,0,1,1,1,1,1,1,1,1] +> default) {{E}}> ([1,0,1,0,0,0,0,1,0,0,1] +> default)) := by execute +theorem z1z : (([0,0,1,1,1,0,1,1,1,1,1,1,1,1] +> default) {{E}}> ([1,0,1,0,0,0,0,1,0,0,1] +> default)) [target_tm]⊢* (([1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1] +> default) {{B}}> ([1] +> default)) := by execute +theorem z1A : (([1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1] +> default) {{B}}> ([1] +> default)) [target_tm]⊢* (([1,1,1,1,1,1,1,1,1,1,1,1,1] +> default) <{{E}} ([0,1,0,1,0,1,0,0,0,0,0,0,0,0,1] +> default)) := by execute +theorem init_tm : (init []) [target_tm]⊢* + (z0U ((ld1 ^ 3) +> ldh) ([1,0,0,0,0,0,0,0,0,1,0,0] +> default)) := by + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = ((default) {{A}}> (default)) := rfl + rw [h0] + have h := zSt z1r (zSt z1s (zSt z1t + (zSt z1u (zSt z1v (zSt z1w + (zSt z1x (zSt z1y (zSt z1z z1A)))))))) + have hr : (([1,1,1,1,1,1,1,1,1,1,1,1,1] +> default) <{{E}} ([0,1,0,1,0,1,0,0,0,0,0,0,0,0,1] +> default)) = + (z0U ((ld1 ^ 3) +> ldh) ([1,0,0,0,0,0,0,0,0,1,0,0] +> default)) := by + unfold z0U ldh + simp [ld1,HPow.hPow] + rwa [hr] at h +def LC (len k : Nat) : zB := z0o ld0 ld1 len k ldh +def RC (m : Nat) : zB := z0q rd0 rd1 m +def MC (h n : Nat) (r : zB) : zB := z0p [0] [1] [0,0] h n r +def RC1 (h n m : Nat) : zB := MC h n (rd1 +> RC m) +def RC2 (h n m : Nat) : zB := MC h n ([0] +> rd1 +> RC m) +def RC' (h n : Nat) : zB := MC h n ([1,0,1] +> default) +theorem z1B : rd0 +> default = default := by simp [rd0] +theorem z1C : [1] +> RC 0 = RC 1 := by + simp [RC,z0F,z0G,rd1] +theorem z1D : [0,0] +> RC 0 = RC 0 := by + simp [RC,z0F] +theorem z1E : [0] +> RC 0 = RC 0 := by + simp [RC,z0F] +theorem z1F : [1,0,0,0,0] +> RC 0 = RC 1 := by + simp [RC,z0F,z0G,rd1] +theorem z1G (len k : Nat) (h : k < 2 ^ len) : z19 (LC len k) (LC len (2 ^ len - 1)) := by + unfold LC + rw [z0w] + induction len generalizing k with + | zero => + have hk : k = 0 := by simp at h; omega + subst hk + rw [z0u] + exact z1a + | succ len ih => + have hp : 2 ^ (len + 1) = 2 ^ len * 2 := Nat.pow_succ 2 len + rw [z0j,append_assoc] + let q := k / 2 + rcases Nat.mod_two_eq_zero_or_one k with hk0 | hk1 + · have hk : k = q * 2 := by omega + have hq : q < 2 ^ len := by omega + rw [hk,z0s] + exact z1c (ih q hq) + · have hk : k = q * 2 + 1 := by omega + have hq : q < 2 ^ len := by omega + rw [hk,z0t] + exact z1b (ih q hq) +theorem z1H (len k : Nat) (r : zB) (h : 1 + k < 2 ^ len) : + (z0U (LC len (1 + k)) r) [target_tm]⊢⁺ (z0V (LC len k) r) := by + unfold LC + rcases z0M ld0 ld1 len k ldh h with ⟨i,s,hi1,hi0⟩ + rw [hi1,hi0] + exact z15 s r i +theorem z1I (m : Nat) (l : zB) : + (z0V l (RC m)) [target_tm]⊢⁺ (z0U l (RC (1 + m))) := by + unfold RC + rcases z0O z1B m with ⟨i,s,hi0,hi1⟩ + rw [hi0,hi1] + have h1 : (rd1 ^ i) +> rd0 +> s = (rd1 ^ i) +> [0] +> ([0,0] +> s) := rfl + have h2 : (rd0 ^ i) +> rd1 +> s = (rd0 ^ i) +> [1] +> ([0,0] +> s) := rfl + rw [h1,h2] + exact z16 l ([0,0] +> s) i +theorem z1J (h n : Nat) (l r : zB) (hn : 1 + n < 2 ^ (h + 1)) : + (z0V l (MC h (1 + n) r)) [target_tm]⊢⁺ (z0U l (MC h n r)) := by + unfold MC + rcases z0N [0] [1] [0,0] h n r hn with ⟨i,s,hi1,hi0⟩ + rw [hi1,hi0] + exact z16 l s i +theorem z1K (len m : Nat) : + (z0U (LC len 0) (RC (m * 2 + 1))) [target_tm]⊢⁺ + (z0V (LC (len + 1) (2 ^ (len + 1) - 1)) ([0] +> RC m)) := by + unfold LC RC + rw [z0u,z0I,z0w,Nat.add_comm len 1] + exact z18 (z0q rd0 rd1 m) len +theorem z1L (len m i : Nat) : + (z0U (LC len 0) (RC ((m * 2 + 1) * 2 ^ (i + 1)))) [target_tm]⊢⁺ + (z0V (LC len (2 ^ len - 1)) (RC2 (i + 1) ((2 ^ (i + 1) - 1) * 2) m)) := by + unfold LC RC2 MC RC + rw [z0u,z0J z1B,z0I,z0w,z0z,z0w] + rw [z0j rd0 i,append_assoc] + have hr : [1] +> (rd0 ^ (i + 1)) +> [0] +> rd1 +> z0q rd0 rd1 m = + rd1 +> [0,0] +> (rd0 ^ i) +> rd1 +> z0q rd0 rd1 m := by + rw [z0Y (i + 1),z0j rd0 i,append_assoc] + rfl + change (z0U ((ld1 ^ len) +> ldh) (rd0 +> (rd0 ^ i) +> rd1 +> z0q rd0 rd1 m)) [target_tm]⊢⁺ + (z0V ((ld0 ^ len) +> ldh) ([1] +> (rd0 ^ (i + 1)) +> [0] +> rd1 +> z0q rd0 rd1 m)) + rw [hr] + exact z17 ((rd0 ^ i) +> rd1 +> z0q rd0 rd1 m) len +theorem z1M (h m : Nat) : RC1 h 0 m = (rd1 ^ h) +> [1,1,0,0] +> RC m := by + unfold RC1 MC; rw [z0B]; rfl +theorem z1N (h m : Nat) : RC2 h 0 m = (rd1 ^ h) +> [1,0,1,0,0] +> RC m := by + unfold RC2 MC; rw [z0B]; rfl +theorem z1O (h : Nat) : RC' h 0 = (rd1 ^ h) +> [1,1,0,1] +> default := by + unfold RC' MC; rw [z0B]; rfl +theorem z1P (len d : Nat) : + LC (len + d) (2 ^ (len + d) - 1) = (ld0 ^ d) +> LC len (2 ^ len - 1) := by + unfold LC + rw [z0w,z0w,Nat.add_comm len d,z0k,append_assoc] +theorem z1Q (len k d : Nat) : + LC (len + 1 + d) ((k * 2 + 1) * 2 ^ d - 1) = (ld0 ^ d) +> ld1 +> LC len k := by + unfold LC; rw [z0y] +theorem z1R (len k d : Nat) : + LC (len + 1 + d) ((k * 2 + 1) * 2 ^ d) = (ld1 ^ d) +> ld0 +> LC len k := by + unfold LC; rw [z0x,z0t] +theorem z1S (len k a m : Nat) (hk : k < 2 ^ len) : + (z0V (LC len k) (RC1 (a * 4) 0 m)) [target_tm]⊢⁺ + (z0V (LC (len + (a * 3 + 1)) (2 ^ (len + (a * 3 + 1)) - 1)) ([0] +> RC m)) := by + rw [z1M,z1P] + exact z1e (LC len k) (RC m) a (z1G len k hk) +theorem z1T (len k a m : Nat) : + (z0V (LC len k) (RC1 (a * 4 + 1) 0 m)) [target_tm]⊢⁺ + (z0V (LC (len + 1 + a * 3) ((k * 2 + 1) * 2 ^ (a * 3) - 1)) (RC (m * 2 + 1))) := by + have hr : RC (m * 2 + 1) = rd1 +> RC m := by unfold RC; rw [z0I] + rw [z1M,z1Q,hr] + exact z1f (LC len k) (RC m) a +theorem z1U (len k a m : Nat) (hk : k < 2 ^ len) : + (z0V (LC len k) (RC1 (a * 4 + 2) 0 m)) [target_tm]⊢⁺ + (z0V (LC (len + (a * 3 + 2)) (2 ^ (len + (a * 3 + 2)) - 1)) (RC (m * 2 + 1))) := by + have hr : RC (m * 2 + 1) = rd1 +> RC m := by unfold RC; rw [z0I] + rw [z1M,z1P,hr] + exact z1g (LC len k) (RC m) a (z1G len k hk) +theorem z1V (len k a m : Nat) : + (z0V (LC len k) (RC1 (a * 4 + 3) 0 m)) [target_tm]⊢⁺ + (z0V (LC (len + 1 + (a * 3 + 2)) ((k * 2 + 1) * 2 ^ (a * 3 + 2) - 1)) ([0] +> RC m)) := by + rw [z1M,z1Q] + exact z1h (LC len k) (RC m) a +theorem z1W (len k a m : Nat) : + (z0V (LC len k) (RC2 (a * 4) 0 m)) [target_tm]⊢⁺ + (z0V (LC (len + 1 + a * 3) ((k * 2 + 1) * 2 ^ (a * 3))) ([0] +> RC m)) := by + rw [z1N,z1R] + exact z1i (LC len k) (RC m) a +theorem z1X (len k a m : Nat) (hk : k < 2 ^ len) : + (z0V (LC len k) (RC2 (a * 4 + 1) 0 m)) [target_tm]⊢⁺ + (z0V (LC (len + (a * 3 + 2)) (2 ^ (len + (a * 3 + 2)) - 1)) ([1] +> RC m)) := by + rw [z1N,z1P] + exact z1j (LC len k) (RC m) a (z1G len k hk) +theorem z1Y (len k a m : Nat) : + (z0V (LC len k) (RC2 (a * 4 + 2) 0 m)) [target_tm]⊢⁺ + (z0W (LC (len + 1 + (a * 3 + 2)) ((k * 2 + 1) * 2 ^ (a * 3 + 2) - 1)) (RC m)) := by + rw [z1N,z1Q] + exact z1k (LC len k) (RC m) a +theorem z1Z (len k a m : Nat) (hk : k < 2 ^ len) : + (z0V (LC len k) (RC2 (a * 4 + 3) 0 m)) [target_tm]⊢⁺ + (z0W (LC (len + (a * 3 + 4)) (2 ^ (len + (a * 3 + 4)) - 1)) (RC m)) := by + rw [z1N,z1P] + exact z1l (LC len k) (RC m) a (z1G len k hk) +theorem z20 (len k m : Nat) : + (z0W (LC len k) (RC (m * 2))) [target_tm]⊢⁺ + (z0V (LC len k) ([0,0] +> RC m)) := by + rw [RC,z0H z1B,<- RC] + exact z1m (LC len k) (RC m) +theorem z21 (len k h n : Nat) (r : zB) + (hk : k < 2 ^ len) (hn : n + k + 1 < 2 ^ (h + 1)) : + (z0V (LC len k) (MC h (n + k + 1) r)) [target_tm]⊢* + (z0U (LC len 0) (MC h n r)) := by + induction k with + | zero => + have h1 : n + 0 + 1 = 1 + n := by omega + rw [h1] + exact zPs (z1J h n (LC len 0) r (by omega)) + | succ k ih => + have h1 : n + (k + 1) + 1 = 1 + (n + k + 1) := by omega + have h2 : k + 1 = 1 + k := by omega + rw [h1,h2] + have s1 := zPs (z1J h (n + k + 1) (LC len (1 + k)) r (by omega)) + have s2 := zPs (z1H len k (MC h (n + k + 1) r) (by omega)) + have s3 := ih (by omega) (by omega) + exact zSt (zSt s1 s2) s3 +theorem z22 (len k h n : Nat) (r : zB) + (hk : k + n < 2 ^ len) (hn : n < 2 ^ (h + 1)) : + (z0V (LC len (k + n)) (MC h n r)) [target_tm]⊢* + (z0V (LC len k) (MC h 0 r)) := by + induction n with + | zero => exact ⟨0,rfl⟩ + | succ n ih => + have h1 : n + 1 = 1 + n := by omega + have h2 : k + (n + 1) = 1 + (k + n) := by omega + rw [h2,h1] + have s1 := zPs (z1J h n (LC len (1 + (k + n))) r (by omega)) + have s2 := zPs (z1H len (k + n) (MC h n r) (by omega)) + have s3 := ih (by omega) (by omega) + exact zSt (zSt s1 s2) s3 +theorem z23' (len h : Nat) : + (z0U (LC len 0) (RC2 (h + 1) ((2 ^ h - 1) * 2) 0)) [target_tm]⊢⁺ + (z0V (LC (len + 1) (2 ^ (len + 1) - 1)) (RC' h (2 ^ (h + 1) - 1))) := by + unfold LC RC2 RC' MC RC + rw [z0u,z0w,z0z,z0C,z0F] + dsimp only [List.append_assoc,List.cons_append,List.nil_append] + have h1 : h + 1 = 1 + h := by omega + have h2 : 2 ^ h - 1 = (0 + 1) * 2 ^ h - 1 := by omega + rw [h1,h2,z0y' [0,0,0] [0,0,1] 1 0 h] + have h3 : z0o [0,0,0] [0,0,1] 1 0 ([0] +> rd1 +> default) = + [0] +> [0] +> [1,0,1] +> default := by + simp [z0u,rd1] + rw [h3,Nat.add_comm len 1] + change (z0U ((ld1 ^ len) +> ldh) ([1] +> (rd0 ^ h) +> ([0] +> ([0] +> [1,0,1] +> default)))) [target_tm]⊢⁺ + (z0V ((ld0 ^ (1 + len)) +> ldh) ((rd0 ^ h) +> ([0] +> [1,0,1] +> default))) + rw [z0Y h ([0] +> [1,0,1] +> default),z0Y h ([1,0,1] +> default)] + exact z18 ((rd0 ^ h) +> [1,0,1] +> default) len +theorem z24 (h : Nat) : + (z0U (LC (h + 1) 0) (RC (2 ^ (h + 1)))) [target_tm]⊢⁺ + (z0V (LC (h + 1 + 1) (2 ^ (h + 1))) (RC' h 0)) := by + have hp := z0v h + have hp1 : 2 ^ (h + 1) = 2 ^ h * 2 := Nat.pow_succ 2 h + have hp2 : 2 ^ (h + 1 + 1) = 2 ^ (h + 1) * 2 := Nat.pow_succ 2 (h + 1) + have h1 : 2 ^ (h + 1) = (0 * 2 + 1) * 2 ^ (h + 1) := by omega + have s1 := z1L (h + 1) 0 h + rw [<- h1] at s1 + have h2 : (2 ^ (h + 1) - 1) * 2 = (2 ^ h - 1) * 2 + (2 ^ (h + 1) - 1) + 1 := by omega + rw [h2] at s1 + have s2 := z21 (h + 1) (2 ^ (h + 1) - 1) (h + 1) ((2 ^ h - 1) * 2) ([0] +> rd1 +> RC 0) + (by omega) (by omega) + have s3 := z23' (h + 1) h + have h3 : 2 ^ (h + 1 + 1) - 1 = 2 ^ (h + 1) + (2 ^ (h + 1) - 1) := by omega + rw [h3] at s3 + have s4 := z22 (h + 1 + 1) (2 ^ (h + 1)) h (2 ^ (h + 1) - 1) ([1,0,1] +> default) + (by omega) (by omega) + exact z0R (zPt (z0R s1 s2) s3) s4 +theorem z25 (len k a : Nat) (hk : k < 2 ^ len) : + (z0V (LC len k) (RC' (a * 4) 0)) [target_tm]⊢* + (z0V (LC (len + (a * 3 + 1)) (2 ^ (len + (a * 3 + 1)) - 1)) (RC 1)) := by + rw [z1O,z1P,RC,z0G] + exact z1n (LC len k) a (z1G len k hk) +theorem z26 (len k a : Nat) : + (z0V (LC len k) (RC' (a * 4 + 1) 0)) [target_tm]⊢* + (z0U (LC (len + 1 + (a * 3 + 1)) ((k * 2 + 1) * 2 ^ (a * 3 + 1))) (RC 0)) := by + rw [z1O,z1R,RC,z0F] + exact z1o (LC len k) a +theorem z27 (len k a : Nat) (hk : k < 2 ^ len) : + (z0V (LC len k) (RC' (a * 4 + 2) 0)) [target_tm]⊢* + (z0V (LC (len + (a * 3 + 3)) (2 ^ (len + (a * 3 + 3)) - 1)) (RC 0)) := by + rw [z1O,z1P,RC,z0F] + exact z1p (LC len k) a (z1G len k hk) +theorem z28 (len k a : Nat) : + (z0V (LC len k) (RC' (a * 4 + 3) 0)) [target_tm]⊢* + (z0U (LC (len + 1 + (a * 3 + 2)) ((k * 2 + 1) * 2 ^ (a * 3 + 2))) (RC 1)) := by + rw [z1O,z1R,RC,z0G] + exact z1q (LC len k) a +theorem z29 (m : Nat) : RC1 0 1 m = [0] +> RC (m * 2 + 1) := by + unfold RC1 MC RC + rw [z0A [0] [1] [0,0] 0 0 (rd1 +> z0q rd0 rd1 m),z0r,z0I] +theorem z2a (len k n m : Nat) (hk : k < 2 ^ len) (hn : n <= k) (hsmall : n < 2) : + (z0V (LC len k) (RC1 0 n (m * 2 + 1))) [target_tm]⊢* + (z0V (LC (len + 1) (2 ^ (len + 1) - 1)) (RC1 0 1 m)) := by + rw [z29] + have hk_eq : k = (k - n) + n := by omega + rw [hk_eq] + have s1 := z22 len (k - n) 0 n (rd1 +> RC (m * 2 + 1)) (by omega) (by omega) + have s2 := zPs (z1S len (k - n) 0 (m * 2 + 1) (by omega)) + exact zSt s1 s2 +theorem z2b (t len k n m : Nat) (hk : k < 2 ^ len) (hn : n <= k) (hsmall : n < 2) : + (z0V (LC len k) (RC1 0 n ((m + 1) * 2 ^ (1 + t) - 1))) [target_tm]⊢* + (z0V (LC (len + (1 + t)) (2 ^ (len + (1 + t)) - 1)) (RC1 0 1 m)) := by + induction t generalizing len k n with + | zero => + have h1 : (m + 1) * 2 ^ (1 + 0) - 1 = m * 2 + 1 := by simp; omega + rw [h1] + exact z2a len k n m hk hn hsmall + | succ t ih => + have hp := z0v (1 + t) + have hpos : 1 <= (m + 1) * 2 ^ (1 + t) := Nat.mul_pos (by omega) hp + have h1 : (m + 1) * 2 ^ (1 + (t + 1)) - 1 = ((m + 1) * 2 ^ (1 + t) - 1) * 2 + 1 := by + have : 1 + (t + 1) = (1 + t) + 1 := by omega + rw [this,Nat.pow_succ] + have : (m + 1) * (2 ^ (1 + t) * 2) = ((m + 1) * 2 ^ (1 + t)) * 2 := by ring + (try omega) + rw [h1] + have s1 := z2a len k n ((m + 1) * 2 ^ (1 + t) - 1) hk hn hsmall + have hp_len : 2 <= 2 ^ (len + 1) := by + rw [Nat.pow_succ]; have := z0v len; omega + have s2 := ih (len + 1) (2 ^ (len + 1) - 1) 1 (by omega) (by omega) (by omega) + have h2 : len + 1 + (1 + t) = len + (1 + (t + 1)) := by omega + rw [h2] at s2 + exact zSt s1 s2 +theorem z2c (t len k m : Nat) (ht : 0 < t) (hk : k < 2 ^ len) : + (z0V (LC len k) (RC1 0 0 ((m + 1) * 2 ^ t - 1))) [target_tm]⊢* + (z0V (LC (len + t) (2 ^ (len + t) - 1)) (RC1 0 1 m)) := by + cases t with + | zero => omega + | succ t => + have h1 : t + 1 = 1 + t := by omega + rw [h1] + exact z2b t len k 0 m hk (by omega) (by omega) +theorem z2d (len k m : Nat) (hk : k < 2 ^ len) : + (z0U (LC len k) (RC m)) [target_tm]⊢* (z0U (LC len 0) (RC (k + m))) := by + induction k generalizing m with + | zero => + simp only [Nat.zero_add] + exact ⟨0,rfl⟩ + | succ k ih => + have h1 : k + 1 = 1 + k := by omega + rw [h1] + have s1 := zPs (z1H len k (RC m) (by omega)) + have s2 := zPs (z1I m (LC len k)) + have s3 := ih (1 + m) (by omega) + have h2 : k + (1 + m) = 1 + k + m := by omega + rw [h2] at s3 + exact zSt (zSt s1 s2) s3 +theorem z2e (len k m : Nat) (hk : k < 2 ^ len) : + (z0V (LC len k) (RC m)) [target_tm]⊢* (z0U (LC len 0) (RC (k + m + 1))) := by + have s1 := zPs (z1I m (LC len k)) + have s2 := z2d len k (1 + m) hk + have h1 : k + (1 + m) = k + m + 1 := by omega + rw [h1] at s2 + exact zSt s1 s2 +theorem z2f (i m : Nat) : [0] +> RC ((m * 2 + 1) * 2 ^ i) = RC1 i (2 ^ (i + 1) - 1) m := by + unfold RC RC1 MC + rw [z0J z1B,z0I,z0C] + exact (z0Y i (rd1 +> z0q rd0 rd1 m)).symm +theorem z2g (i m : Nat) : [1] +> RC ((m * 2 + 1) * 2 ^ i) = RC1 i (2 ^ (i + 1) - 1 - 1) m := by + unfold RC RC1 MC + have hp := z0v i + have h1 : 2 ^ (i + 1) - 1 - 1 = (2 ^ i - 1) * 2 := by rw [Nat.pow_succ]; omega + rw [h1,z0J z1B,z0I,z0z,z0w] + rfl +theorem z2h (i m : Nat) : [0,0] +> RC ((m * 2 + 1) * 2 ^ i) = RC2 i (2 ^ (i + 1) - 1) m := by + unfold RC RC2 MC + rw [z0J z1B,z0I,z0C] + change [0] +> ([0] +> ((rd0 ^ i) +> (rd1 +> z0q rd0 rd1 m))) = + (rd0 ^ i) +> ([0] +> ([0] +> rd1 +> z0q rd0 rd1 m)) + rw [z0Y i ([0] +> rd1 +> z0q rd0 rd1 m),z0Y i (rd1 +> z0q rd0 rd1 m)] +theorem z2i (i m : Nat) : + [1,0,0,0,0] +> RC ((m * 2 + 1) * 2 ^ i) = RC2 (i + 1) (2 ^ (i + 1 + 1) - 1 - 1) m := by + unfold RC RC2 MC + have hp := z0v (i + 1) + have h1 : 2 ^ (i + 1 + 1) - 1 - 1 = (2 ^ (i + 1) - 1) * 2 := by rw [Nat.pow_succ]; omega + rw [h1,z0J z1B,z0I,z0z,z0w] + change [1] +> (rd0 +> ([0] +> ((rd0 ^ i) +> (rd1 +> z0q rd0 rd1 m)))) = + [1] +> ((([0,0,0] : zF) ^ (i + 1)) +> ([0] +> rd1 +> z0q rd0 rd1 m)) + rw [z0j rd0 i,append_assoc,z0Y i (rd1 +> z0q rd0 rd1 m)] +theorem z2j (len m : Nat) : + (z0U (LC len 0) (RC (m * 2))) [target_tm]⊢⁺ + (z0V (LC len (2 ^ len - 1)) ([1,0,0,0,0] +> RC m)) := by + unfold LC RC + rw [z0u,z0H z1B,z0w] + exact z17 (z0q rd0 rd1 m) len +theorem z2k (len a : Nat) (hlen : len = a * 4 + 1) : + (z0U (LC len 0) (RC (2 ^ len))) [target_tm]⊢* + (z0U (LC (len + a * 3 + 2) 0) (RC (2 ^ (len + a * 3 + 2) + 1))) := by + subst hlen + have hp := z0v (a * 4 + 1 + 1) + have hp2 := z0v (a * 4 + 1 + a * 3 + 2) + have s1 := zPs (z24 (a * 4)) + have s2 := z25 (a * 4 + 1 + 1) (2 ^ (a * 4 + 1)) a (by rw [Nat.pow_succ]; omega) + have h1 : a * 4 + 1 + 1 + (a * 3 + 1) = a * 4 + 1 + a * 3 + 2 := by omega + rw [h1] at s2 + have s3 := z2e (a * 4 + 1 + a * 3 + 2) (2 ^ (a * 4 + 1 + a * 3 + 2) - 1) 1 (by omega) + have h2 : 2 ^ (a * 4 + 1 + a * 3 + 2) - 1 + 1 + 1 = 2 ^ (a * 4 + 1 + a * 3 + 2) + 1 := by omega + rw [h2] at s3 + exact zSt (zSt s1 s2) s3 +theorem z2l (len a : Nat) (hlen : len = a * 4 + 2) : + (z0U (LC len 0) (RC (2 ^ len))) [target_tm]⊢* + (z0U (LC (len + a * 3 + 3) 0) (RC ((2 ^ len * 2 + 1) * 2 ^ (a * 3 + 1)))) := by + have hlen' : len = (a * 4 + 1) + 1 := by omega + rw [hlen'] + have s1 := zPs (z24 (a * 4 + 1)) + have s2 := z26 (a * 4 + 1 + 1 + 1) (2 ^ (a * 4 + 1 + 1)) a + have h1 : a * 4 + 1 + 1 + 1 + 1 + (a * 3 + 1) = (a * 4 + 1 + 1) + a * 3 + 3 := by omega + rw [h1] at s2 + have hk_lt : (2 ^ (a * 4 + 1 + 1) * 2 + 1) * 2 ^ (a * 3 + 1) < 2 ^ ((a * 4 + 1 + 1) + a * 3 + 3) := by + have h_rhs : 2 ^ ((a * 4 + 1 + 1) + a * 3 + 3) = 2 ^ (a * 4 + 1 + 1) * 4 * 2 ^ (a * 3 + 1) := by + have : (a * 4 + 1 + 1) + a * 3 + 3 = (a * 4 + 1 + 1) + 2 + (a * 3 + 1) := by omega + rw [this,Nat.pow_add 2 (a * 4 + 1 + 1 + 2),Nat.pow_add 2 (a * 4 + 1 + 1) 2] + rw [h_rhs] + have hp := z0v (a * 3 + 1) + have hp0 := z0v (a * 4 + 1 + 1) + nlinarith + have s3 := z2d ((a * 4 + 1 + 1) + a * 3 + 3) ((2 ^ (a * 4 + 1 + 1) * 2 + 1) * 2 ^ (a * 3 + 1)) 0 hk_lt + rw [Nat.add_zero] at s3 + exact zSt (zSt s1 s2) s3 +theorem z2m (len a : Nat) (hlen : len = a * 4 + 3) : + (z0U (LC len 0) (RC (2 ^ len))) [target_tm]⊢* + (z0U (LC (len + a * 3 + 4) 0) (RC (2 ^ (len + a * 3 + 4)))) := by + have hlen' : len = (a * 4 + 2) + 1 := by omega + rw [hlen'] + have hp2 := z0v ((a * 4 + 2 + 1) + a * 3 + 4) + have s1 := zPs (z24 (a * 4 + 2)) + have s2 := z27 (a * 4 + 2 + 1 + 1) (2 ^ (a * 4 + 2 + 1)) a (by rw [Nat.pow_succ]; have := z0v (a * 4 + 2 + 1); omega) + have h1 : a * 4 + 2 + 1 + 1 + (a * 3 + 3) = (a * 4 + 2 + 1) + a * 3 + 4 := by omega + rw [h1] at s2 + have s3 := z2e ((a * 4 + 2 + 1) + a * 3 + 4) (2 ^ ((a * 4 + 2 + 1) + a * 3 + 4) - 1) 0 (by omega) + have h2 : 2 ^ ((a * 4 + 2 + 1) + a * 3 + 4) - 1 + 0 + 1 = 2 ^ ((a * 4 + 2 + 1) + a * 3 + 4) := by omega + rw [h2] at s3 + exact zSt (zSt s1 s2) s3 +theorem z2n (len a : Nat) (hlen : len = a * 4 + 4) : + (z0U (LC len 0) (RC (2 ^ len))) [target_tm]⊢* + (z0U (LC (len + a * 3 + 4) 0) (RC ((2 ^ len * 2 + 1) * 2 ^ (a * 3 + 2) + 1))) := by + have hlen' : len = (a * 4 + 3) + 1 := by omega + rw [hlen'] + have s1 := zPs (z24 (a * 4 + 3)) + have s2 := z28 (a * 4 + 3 + 1 + 1) (2 ^ (a * 4 + 3 + 1)) a + have h1 : a * 4 + 3 + 1 + 1 + 1 + (a * 3 + 2) = (a * 4 + 3 + 1) + a * 3 + 4 := by omega + rw [h1] at s2 + have hk_lt : (2 ^ (a * 4 + 3 + 1) * 2 + 1) * 2 ^ (a * 3 + 2) < 2 ^ ((a * 4 + 3 + 1) + a * 3 + 4) := by + have h_rhs : 2 ^ ((a * 4 + 3 + 1) + a * 3 + 4) = 2 ^ (a * 4 + 3 + 1) * 4 * 2 ^ (a * 3 + 2) := by + have : (a * 4 + 3 + 1) + a * 3 + 4 = (a * 4 + 3 + 1) + 2 + (a * 3 + 2) := by omega + rw [this,Nat.pow_add 2 (a * 4 + 3 + 1 + 2),Nat.pow_add 2 (a * 4 + 3 + 1) 2] + rw [h_rhs] + have hp := z0v (a * 3 + 2) + have hp0 := z0v (a * 4 + 3 + 1) + nlinarith + have s3 := z2d ((a * 4 + 3 + 1) + a * 3 + 4) ((2 ^ (a * 4 + 3 + 1) * 2 + 1) * 2 ^ (a * 3 + 2)) 1 hk_lt + exact zSt (zSt s1 s2) s3 +def z2o (c : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ (cfg : Cfg (Fin 2) (Fin 6)),(c [target_tm]⊢* cfg) /\ (step target_tm cfg).isNone +theorem z2p {c_1 c_2 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [target_tm]⊢* c_2) (h₂ : z2o c_2) : z2o c_1 := by + rcases h₂ with ⟨cfg,h₂,hnone⟩ + exact ⟨cfg,zSt h₁ h₂,hnone⟩ +theorem z2q (l r : zB) : z2o (z0W l (rd1 +> r)) := by + refine ⟨z0W l (rd1 +> r),⟨0,rfl⟩,?_⟩ + unfold z0W step target_tm F + simp only [rd1,append_cons,Turing.ListBlank.head_cons] + rfl +theorem auxiliary_halt (len k m : Nat) : z2o (z0W (LC len k) (RC (m * 2 + 1))) := by + unfold RC + rw [z0I] + exact z2q (LC len k) (z0q rd0 rd1 m) +def z2r (x : Sparse.num) : Nat := (Sparse.value x).toNat +theorem z2s (x : Sparse.num) (h : 0 <= Sparse.value x) : + (z2r x : Int) = Sparse.value x := Int.toNat_of_nonneg h +theorem z2t (w : Nat) : Sparse.pow2 w = ((2 ^ w : Nat) : Int) := by + unfold Sparse.pow2; norm_cast +theorem z2u (x y : Sparse.num) : + Sparse.value (Forward13.plus x y) = Sparse.value x + Sparse.value y := by + unfold Forward13.plus; rw [Sparse.pack_spec,Sparse.add_spec] +theorem z2v (x y : Sparse.num) : + Sparse.value (Forward13.minus x y) = Sparse.value x - Sparse.value y := by + unfold Forward13.minus; rw [Sparse.pack_spec,Sparse.sub_spec] +theorem z2w (x : Sparse.num) : + Sparse.value (Forward13.twice x) = 2 * Sparse.value x := by + unfold Forward13.twice; rw [Sparse.shift_spec]; rfl +theorem z2x (w : Nat) : + Sparse.value (Forward13.full w) = Sparse.pow2 w - 1 := by + unfold Forward13.full Forward13.one + rw [z2v,Sparse.power_spec,Sparse.small_spec] +theorem z2y (x y : Sparse.num) (hx : 0 <= Sparse.value x) (hy : 0 <= Sparse.value y) : + z2r (Forward13.plus x y) = z2r x + z2r y := by + unfold z2r; rw [z2u]; omega +theorem z2z (x y : Sparse.num) (hy : 0 <= Sparse.value y) (hxy : Sparse.value y <= Sparse.value x) : + z2r (Forward13.minus x y) = z2r x - z2r y := by + unfold z2r; rw [z2v]; omega +theorem z2A (w : Nat) (x : Sparse.num) (hx : 0 <= Sparse.value x) : + z2r (Sparse.shift w x) = 2 ^ w * z2r x := by + unfold z2r + have hp : 0 <= Sparse.pow2 w := le_of_lt (Sparse.zPp w) + rw [Sparse.shift_spec,Int.toNat_mul hp hx,z2t,Int.toNat_natCast] +theorem z2B (x : Sparse.num) (hx : 0 <= Sparse.value x) : + z2r (Forward13.twice x) = 2 * z2r x := by + unfold Forward13.twice; rw [z2A 1 x hx]; rfl +theorem z2C (w : Nat) : z2r (Forward13.full w) = 2 ^ w - 1 := by + unfold z2r + have hp := Sparse.zPp w + have h1 : (Sparse.pow2 w - 1).toNat = (Sparse.pow2 w).toNat - 1 := by omega + rw [z2x,h1,z2t,Int.toNat_natCast] +theorem z2D (w : Nat) : z2r (Sparse.power w) = 2 ^ w := by + unfold z2r; rw [Sparse.power_spec,z2t,Int.toNat_natCast] +theorem z2E {x y : Sparse.num} (h : Forward13.lt x y = true) : + Sparse.value x < Sparse.value y := by + unfold Forward13.lt at h + rw [beq_iff_eq] at h + have hcmp := Sparse.compare_spec h + unfold Sparse.cmp0 at hcmp + split_ifs at hcmp <;> omega +theorem z2F {x : Sparse.num} (h : Sparse.nonnegative x = true) : + 0 <= Sparse.value x := by + have h1 := Sparse.leb_spec h + simpa [Sparse.value] using h1 +theorem z2G (w : Nat) : 0 <= Sparse.value (Forward13.full w) := by + rw [z2x]; have := Sparse.zPp w; omega +theorem z2H {m : Sparse.num} {i : Nat} {u : Sparse.num} (h : Sparse.split m = some (i,u)) : + 0 <= Sparse.value u /\ z2r m = (z2r u * 2 + 1) * 2 ^ i := by + rcases Sparse.split_spec h with ⟨hu,hm⟩ + refine ⟨hu,?_⟩ + have hp := Sparse.zPp i + have hm_nonneg : 0 <= Sparse.value m := by rw [hm]; nlinarith + have h_eq : (z2r m : Int) = (((z2r u * 2 + 1) * 2 ^ i : Nat) : Int) := by + push_cast + rw [z2s m hm_nonneg,z2s u hu] + unfold Sparse.pow2 at hm + linarith + exact Int.ofNat.inj h_eq +theorem z2I {m : Sparse.num} {b : Bool} {u : Sparse.num} (h : Sparse.half m = some (b,u)) : + 0 <= Sparse.value u /\ z2r m = z2r u * 2 + (if b then 1 else 0) := by + rcases Sparse.half_spec h with ⟨hu,hm⟩ + refine ⟨hu,?_⟩ + cases b + · simp only [Bool.false_eq_true,↓reduceIte,add_zero] at hm ⊢ + have hm_nonneg : 0 <= Sparse.value m := by omega + have h_eq : (z2r m : Int) = ((z2r u * 2 : Nat) : Int) := by + push_cast; rw [z2s m hm_nonneg,z2s u hu]; omega + exact Int.ofNat.inj h_eq + · simp only [↓reduceIte] at hm ⊢ + have hm_nonneg : 0 <= Sparse.value m := by omega + have h_eq : (z2r m : Int) = ((z2r u * 2 + 1 : Nat) : Int) := by + push_cast; rw [z2s m hm_nonneg,z2s u hu]; omega + exact Int.ofNat.inj h_eq +theorem z2J {x y : Sparse.num} (h : Sparse.eqb x y = true) : z2r x = z2r y := by + unfold z2r; rw [Sparse.eqb_spec h] +theorem z2K (s p : Nat) : + z2r (Sparse.shift s (Forward13.plus (Sparse.power p) Forward13.one)) = (2 ^ p + 1) * 2 ^ s := by + have hp : 0 <= Sparse.value (Sparse.power p) := by rw [Sparse.power_spec]; exact le_of_lt (Sparse.zPp p) + have h1 : 0 <= Sparse.value Forward13.one := by decide + have hplus : 0 <= Sparse.value (Forward13.plus (Sparse.power p) Forward13.one) := by rw [z2u]; omega + rw [z2A s _ hplus,z2y _ _ hp h1,z2D] + change 2 ^ s * (2 ^ p + 1) = (2 ^ p + 1) * 2 ^ s + ring +theorem z2L (s p : Nat) : + z2r (Forward13.plus (Sparse.shift s (Forward13.plus (Sparse.power p) Forward13.one)) Forward13.one) = + (2 ^ p + 1) * 2 ^ s + 1 := by + have hp : 0 <= Sparse.value (Sparse.power p) := by rw [Sparse.power_spec]; exact le_of_lt (Sparse.zPp p) + have h1 : 0 <= Sparse.value Forward13.one := by decide + have hplus : 0 <= Sparse.value (Forward13.plus (Sparse.power p) Forward13.one) := by rw [z2u]; omega + have hshift : 0 <= Sparse.value (Sparse.shift s (Forward13.plus (Sparse.power p) Forward13.one)) := by + rw [Sparse.shift_spec]; exact mul_nonneg (le_of_lt (Sparse.zPp s)) hplus + rw [z2y _ _ hshift h1,z2K] + rfl +theorem z2M (s : Nat) (b : Sparse.num) (hb : 0 <= Sparse.value b) : + z2r (Sparse.shift s (Forward13.plus (Forward13.twice b) Forward13.one)) = + (z2r b * 2 + 1) * 2 ^ s := by + have h1 : 0 <= Sparse.value Forward13.one := by decide + have h2 : 0 <= Sparse.value (Forward13.twice b) := by rw [z2w]; omega + have hplus : 0 <= Sparse.value (Forward13.plus (Forward13.twice b) Forward13.one) := by rw [z2u]; omega + rw [z2A s _ hplus,z2y _ _ h2 h1,z2B b hb] + change 2 ^ s * (2 * z2r b + 1) = (z2r b * 2 + 1) * 2 ^ s + ring +theorem z2N (s : Nat) (b : Sparse.num) (hb : 0 <= Sparse.value b) : + z2r (Forward13.minus (Sparse.shift s (Forward13.plus (Forward13.twice b) Forward13.one)) Forward13.one) = + (z2r b * 2 + 1) * 2 ^ s - 1 := by + have h1 : 0 <= Sparse.value Forward13.one := by decide + have h2 : 0 <= Sparse.value (Forward13.twice b) := by rw [z2w]; omega + have hplus : 1 <= Sparse.value (Forward13.plus (Forward13.twice b) Forward13.one) := by + rw [z2u,Forward13.one,Sparse.small_spec]; omega + have hshift : 1 <= Sparse.value (Sparse.shift s (Forward13.plus (Forward13.twice b) Forward13.one)) := by + rw [Sparse.shift_spec]; have := Sparse.zPp s; nlinarith + have hle : Sparse.value Forward13.one <= Sparse.value (Sparse.shift s (Forward13.plus (Forward13.twice b) Forward13.one)) := by + have : Sparse.value Forward13.one = 1 := rfl + linarith + rw [z2z _ _ h1 hle,z2M s b hb] + rfl +theorem z2O (m : Sparse.num) (hm : 0 <= Sparse.value m) : + z2r (Forward13.plus (Forward13.twice m) Forward13.one) = z2r m * 2 + 1 := by + have h1 : 0 <= Sparse.value Forward13.one := by decide + have h2 : 0 <= Sparse.value (Forward13.twice m) := by rw [z2w]; omega + rw [z2y _ _ h2 h1,z2B m hm] + change 2 * z2r m + 1 = z2r m * 2 + 1 + ring +def z2P (x : Forward13.State) : Cfg (Fin 2) (Fin 6) := + let w := x.width + let k := z2r x.budget + let m := z2r x.high + match x.tag with + | .L => z0U (LC w k) (RC m) + | .R => z0V (LC w k) (RC m) + | .A => z0W (LC w k) (RC m) + | .T1 => z0V (LC w k) (RC1 x.mark (z2r x.low) m) + | .T2 => z0V (LC w k) (RC2 x.mark (z2r x.low) m) +def z2Q (x : Forward13.State) : Prop := + let w := x.width + let k := z2r x.budget + let m := z2r x.high + let h := x.mark + let n := z2r x.low + match x.tag with + | .L => 1 <= w /\ k < 2 ^ w /\ k + m < 2 ^ w * 2 + | .R => 1 <= w /\ k < 2 ^ w /\ k + m + 1 < 2 ^ w * 2 + | .A => 1 <= w /\ m <= k /\ k < 2 ^ w + | .T1 | .T2 => 1 <= w /\ n + m <= k /\ k < 2 ^ w /\ n < 2 ^ (h + 1) +theorem z2R {x : Forward13.State} (h : Forward13.good x = true) : + 0 < x.width /\ 0 <= Sparse.value x.budget /\ Sparse.value x.budget < Sparse.pow2 x.width /\ + 0 <= Sparse.value x.high := by + unfold Forward13.good at h + split_ifs at h with hw hk hcap hm <;> + exact ⟨hw,z2F hk,by have := z2E hcap; rwa [Sparse.power_spec] at this,z2F hm⟩ +theorem z2S {p : Forward13.Phase} {w : Nat} {k : Sparse.num} {h : Nat} {n m : Sparse.num} + (hp : p = .T1 \/ p = .T2) (hg : Forward13.good ⟨p,w,k,h,n,m⟩ = true) : + 0 <= Sparse.value n := by + unfold Forward13.good at hg + rcases hp with rfl | rfl <;> ( + dsimp only at hg + split_ifs at hg with hw hk hcap hm hn hlow + exact z2F hn + ) +theorem z2T {x : Forward13.State} (hg : Forward13.good x = true) : z2Q x := by + rcases z2R hg with ⟨hw,hk,hcap,hm⟩ + rcases x with ⟨p,w,k,h,n,m⟩ + dsimp only at hw hk hcap hm + have h_k_nat : (z2r k : Int) = Sparse.value k := z2s k hk + have h_m_nat : (z2r m : Int) = Sparse.value m := z2s m hm + have h_pow_w : Sparse.pow2 w = ((2 ^ w : Nat) : Int) := z2t w + cases p <;> ( + unfold Forward13.good at hg + dsimp only [z2Q] at hg ⊢ + split_ifs at hg + ) + · have hlt := z2E hg + rw [z2u,Sparse.power_spec,Sparse.pow2_add,show Sparse.pow2 1 = 2 from rfl,h_pow_w] at hlt + (try omega) + · have hlt := z2E hg + rw [z2u,z2u,Forward13.one,Sparse.small_spec,Sparse.power_spec, + Sparse.pow2_add,show Sparse.pow2 1 = 2 from rfl,h_pow_w] at hlt + (try omega) + · rename_i hn hlow + have hn' := z2F hn + have h_n_nat : (z2r n : Int) = Sparse.value n := z2s n hn' + have hlt := z2E hlow + rw [Sparse.power_spec,z2t] at hlt + have hle := Sparse.leb_spec hg + rw [z2u] at hle + (try omega) + · rename_i hn hlow + have hn' := z2F hn + have h_n_nat : (z2r n : Int) = Sparse.value n := z2s n hn' + have hlt := z2E hlow + rw [Sparse.power_spec,z2t] at hlt + have hle := Sparse.leb_spec hg + rw [z2u] at hle + (try omega) + · have hle := Sparse.leb_spec hg + (try omega) +theorem z2U {w : Nat} {k m : Sparse.num} {y : Forward13.State} + (h : Forward13.prefix_step .T1 w k m 0 0 = .next y) : + z2P y = z0V (LC w (z2r k)) ([0] +> RC (z2r m)) := by + unfold Forward13.prefix_step Forward13.iszero at h + split_ifs at h with hz + · injection h with hy; subst hy + have hm0 : z2r m = 0 := by unfold z2r; rw [Sparse.eqb_spec hz]; rfl + have hs0 : z2r (Sparse.small 0) = 0 := rfl + simp only [z2P,Forward13.ordinary,hm0,hs0,z1E] + · cases hs : Sparse.split m with + | none => rw [hs] at h; contradiction + | some iu => + rcases iu with ⟨i,u⟩ + rw [hs] at h + injection h with hy; subst hy + rcases z2H hs with ⟨hu,hm⟩ + simp only [z2P,Nat.add_zero] + have h_sub : z2r (Forward13.minus (Forward13.full (i + 1)) (Sparse.small 0)) = 2 ^ (i + 1) - 1 := by + rw [z2z _ _ (by simp [Sparse.small_spec]) (by rw [Sparse.small_spec]; exact z2G (i + 1)),z2C] + rfl + rw [h_sub,hm,z2f] +theorem z2V {w : Nat} {k m : Sparse.num} {y : Forward13.State} + (h : Forward13.prefix_step .T1 w k m 0 1 = .next y) : + z2P y = z0V (LC w (z2r k)) ([1] +> RC (z2r m)) := by + unfold Forward13.prefix_step Forward13.iszero at h + split_ifs at h with hz + · injection h with hy; subst hy + have hm0 : z2r m = 0 := by unfold z2r; rw [Sparse.eqb_spec hz]; rfl + have hs1 : z2r (Sparse.small 1) = 1 := rfl + simp only [z2P,Forward13.ordinary,hm0,hs1,z1C] + · cases hs : Sparse.split m with + | none => rw [hs] at h; contradiction + | some iu => + rcases iu with ⟨i,u⟩ + rw [hs] at h + injection h with hy; subst hy + rcases z2H hs with ⟨hu,hm⟩ + simp only [z2P,Nat.add_zero] + have hp : 2 <= Sparse.pow2 (i + 1) := by + rw [Sparse.pow2_add,show Sparse.pow2 1 = 2 from rfl]; have := Sparse.zPp i; omega + have h_sub : z2r (Forward13.minus (Forward13.full (i + 1)) (Sparse.small 1)) = 2 ^ (i + 1) - 1 - 1 := by + rw [z2z _ _ (by simp [Sparse.small_spec]) (by rw [Sparse.small_spec,z2x]; omega),z2C] + rfl + rw [h_sub,hm,z2g] +theorem z2W {w : Nat} {k m : Sparse.num} {y : Forward13.State} + (h : Forward13.prefix_step .T2 w k m 0 0 = .next y) : + z2P y = z0V (LC w (z2r k)) ([0,0] +> RC (z2r m)) := by + unfold Forward13.prefix_step Forward13.iszero at h + split_ifs at h with hz + · injection h with hy; subst hy + have hm0 : z2r m = 0 := by unfold z2r; rw [Sparse.eqb_spec hz]; rfl + have hs0 : z2r (Sparse.small 0) = 0 := rfl + simp only [z2P,Forward13.ordinary,hm0,hs0,z1D] + · cases hs : Sparse.split m with + | none => rw [hs] at h; contradiction + | some iu => + rcases iu with ⟨i,u⟩ + rw [hs] at h + injection h with hy; subst hy + rcases z2H hs with ⟨hu,hm⟩ + simp only [z2P,Nat.add_zero] + have h_sub : z2r (Forward13.minus (Forward13.full (i + 1)) (Sparse.small 0)) = 2 ^ (i + 1) - 1 := by + rw [z2z _ _ (by simp [Sparse.small_spec]) (by rw [Sparse.small_spec]; exact z2G (i + 1)),z2C] + rfl + rw [h_sub,hm,z2h] +theorem z2X {w : Nat} {k m : Sparse.num} {y : Forward13.State} + (h : Forward13.prefix_step .T2 w k m 1 1 = .next y) : + z2P y = z0V (LC w (z2r k)) ([1,0,0,0,0] +> RC (z2r m)) := by + unfold Forward13.prefix_step Forward13.iszero at h + split_ifs at h with hz + · injection h with hy; subst hy + have hm0 : z2r m = 0 := by unfold z2r; rw [Sparse.eqb_spec hz]; rfl + have hs1 : z2r (Sparse.small 1) = 1 := rfl + simp only [z2P,Forward13.ordinary,hm0,hs1,z1F] + · cases hs : Sparse.split m with + | none => rw [hs] at h; contradiction + | some iu => + rcases iu with ⟨i,u⟩ + rw [hs] at h + injection h with hy; subst hy + rcases z2H hs with ⟨hu,hm⟩ + simp only [z2P] + have hp : 2 <= Sparse.pow2 (i + 1 + 1) := by + rw [Sparse.pow2_add,show Sparse.pow2 1 = 2 from rfl]; have := Sparse.zPp (i + 1); omega + have h_sub : z2r (Forward13.minus (Forward13.full (i + 1 + 1)) (Sparse.small 1)) = 2 ^ (i + 1 + 1) - 1 - 1 := by + rw [z2z _ _ (by simp [Sparse.small_spec]) (by rw [Sparse.small_spec,z2x]; omega),z2C] + rfl + rw [h_sub,hm,z2i] +theorem z2Y {w : Nat} {k : Sparse.num} {h : Nat} {n m : Sparse.num} {y : Forward13.State} + (hg : Forward13.good ⟨.R,w,k,h,n,m⟩ = true) + (hs : Forward13.step_state ⟨.R,w,k,h,n,m⟩ = .next y) : + (z2P ⟨.R,w,k,h,n,m⟩) [target_tm]⊢* (z2P y) := by + rcases z2R hg with ⟨hw,hk,hcap,hm⟩ + dsimp only at hw hk hcap hm + have hP := z2T hg + dsimp only [z2Q] at hP + rcases hP with ⟨_,hk_lt,_⟩ + dsimp only [Forward13.step_state] at hs + injection hs with hy; subst hy + dsimp only [z2P,Forward13.ordinary] + have h0 : z2r [] = 0 := rfl + have h1 : z2r (Forward13.plus (Forward13.plus k m) Forward13.one) = z2r k + z2r m + 1 := by + rw [z2y _ _ (by rw [z2u]; omega) (by decide),z2y _ _ hk hm] + rfl + rw [h0,h1] + exact z2e w (z2r k) (z2r m) hk_lt +theorem z2Z {w : Nat} {k : Sparse.num} {h : Nat} {n m : Sparse.num} {y : Forward13.State} + (_hg : Forward13.good ⟨.A,w,k,h,n,m⟩ = true) + (hs : Forward13.step_state ⟨.A,w,k,h,n,m⟩ = .next y) : + (z2P ⟨.A,w,k,h,n,m⟩) [target_tm]⊢* (z2P y) := by + dsimp only [Forward13.step_state] at hs + cases hhalf : Sparse.half m with + | none => rw [hhalf] at hs; contradiction + | some bu => + rcases bu with ⟨b,u⟩ + rw [hhalf] at hs + cases b + · rw [z2W hs] + rcases z2I hhalf with ⟨_,hm⟩ + simp only [z2P,hm,Bool.false_eq_true,↓reduceIte,Nat.add_zero] + exact zPs (z20 w (z2r k) (z2r u)) + · contradiction +theorem z30 {w : Nat} {k : Sparse.num} {h : Nat} {n m : Sparse.num} {y : Forward13.State} + (hg : Forward13.good ⟨.L,w,k,h,n,m⟩ = true) + (hs : Forward13.step_state ⟨.L,w,k,h,n,m⟩ = .next y) : + (z2P ⟨.L,w,k,h,n,m⟩) [target_tm]⊢* (z2P y) := by + rcases z2R hg with ⟨hw,hk,hcap,hm⟩ + dsimp only at hw hk hcap hm + have hP := z2T hg + dsimp only [z2Q] at hP + rcases hP with ⟨hw1,hk_lt,_⟩ + let v := Forward13.plus k m + have hv : z2r v = z2r k + z2r m := z2y k m hk hm + have s1 : (z2P ⟨.L,w,k,h,n,m⟩) [target_tm]⊢* (z0U (LC w 0) (RC (z2r v))) := by + dsimp only [z2P] + rw [hv] + exact z2d w (z2r k) (z2r m) hk_lt + refine zSt s1 ?_ + unfold Forward13.step_state at hs + dsimp only at hs + change (if Sparse.eqb v (Sparse.power w) then _ else _) = Forward13.Result.next y at hs + by_cases heq : Sparse.eqb v (Sparse.power w) = true + · rw [if_pos heq] at hs + have hv_pow : z2r v = 2 ^ w := by rw [z2J heq,z2D] + rw [hv_pow] + let a := (w - 1) / 4 + let e := (w - 1) % 4 + have h_div : w - 1 = a * 4 + e := by omega + have h_mod : e < 4 := Nat.mod_lt (w - 1) (by decide) + have h3a : 3 * a = a * 3 := by ring + have h0 : z2r [] = 0 := rfl + split_ifs at hs with he0 he1 he2 + · injection hs with hy; subst hy + dsimp only [z2P,Forward13.ordinary] + have h_num : z2r (Forward13.plus (Sparse.power (w + 3 * a + 2)) Forward13.one) = + 2 ^ (w + a * 3 + 2) + 1 := by + rw [z2y _ _ (by rw [Sparse.power_spec]; exact le_of_lt (Sparse.zPp _)) (by decide), + z2D,h3a] + rfl + rw [h0,h_num,h3a] + exact z2k w a (by omega) + · injection hs with hy; subst hy + dsimp only [z2P,Forward13.ordinary] + rw [h0,z2K,h3a,Nat.pow_succ] + exact z2l w a (by omega) + · injection hs with hy; subst hy + dsimp only [z2P,Forward13.ordinary] + rw [h0,z2D,h3a] + exact z2m w a (by omega) + · injection hs with hy; subst hy + dsimp only [z2P,Forward13.ordinary] + rw [h0,z2L,h3a,Nat.pow_succ] + exact z2n w a (by omega) + · rw [if_neg heq] at hs + cases hhalf : Sparse.half v with + | none => rw [hhalf] at hs; contradiction + | some bu => + rcases bu with ⟨b,u⟩ + rw [hhalf] at hs + rcases z2I hhalf with ⟨_,hv_half⟩ + cases b + · rw [z2X hs,z2C,hv_half] + simp only [Bool.false_eq_true,↓reduceIte,Nat.add_zero] + exact zPs (z2j w (z2r u)) + · rw [z2U hs,z2C,hv_half] + simp only [↓reduceIte] + exact zPs (z1K w (z2r u)) +theorem z31 {w : Nat} {k : Sparse.num} {h : Nat} {n m : Sparse.num} {y : Forward13.State} + (hg : Forward13.good ⟨.T2,w,k,h,n,m⟩ = true) + (hs : Forward13.step_state ⟨.T2,w,k,h,n,m⟩ = .next y) : + (z2P ⟨.T2,w,k,h,n,m⟩) [target_tm]⊢* (z2P y) := by + rcases z2R hg with ⟨hw,hk,hcap,hm⟩ + dsimp only at hw hk hcap hm + have hP := z2T hg + dsimp only [z2Q] at hP + rcases hP with ⟨hw1,hnm_le,hk_lt,hn_lt⟩ + have hn := z2S (Or.inr rfl) hg + have h_k_nat : (z2r k : Int) = Sparse.value k := z2s k hk + have h_n_nat : (z2r n : Int) = Sparse.value n := z2s n hn + let b := Forward13.minus k n + have hb_nonneg : 0 <= Sparse.value b := by rw [z2v]; omega + have hb_num : z2r b = z2r k - z2r n := z2z k n hn (by omega) + have s1 : (z2P ⟨.T2,w,k,h,n,m⟩) [target_tm]⊢* + (z0V (LC w (z2r b)) (RC2 h 0 (z2r m))) := by + dsimp only [z2P] + have hk_eq : z2r k = z2r b + z2r n := by omega + rw [hk_eq] + exact z22 w (z2r b) h (z2r n) ([0] +> rd1 +> RC (z2r m)) (by omega) hn_lt + refine zSt s1 ?_ + unfold Forward13.step_state at hs + dsimp only at hs + let a := h / 4 + let e := h % 4 + have h_div : h = a * 4 + e := by omega + have h_mod : e < 4 := Nat.mod_lt h (by decide) + have h3a : 3 * a = a * 3 := by ring + split_ifs at hs with he0 he1 he2 + · rw [z2U hs,z2M (3 * a) b hb_nonneg,h3a] + have hh : h = a * 4 := by omega + have hw_eq : w + a * 3 + 1 = w + 1 + a * 3 := by omega + rw [hh,hw_eq] + exact zPs (z1W w (z2r b) a (z2r m)) + · rw [z2V hs,z2C,h3a] + have hh : h = a * 4 + 1 := by omega + have hw_eq : w + a * 3 + 2 = w + (a * 3 + 2) := by omega + rw [hh,hw_eq] + exact zPs (z1X w (z2r b) a (z2r m) (by omega)) + · injection hs with hy; subst hy + dsimp only [z2P,Forward13.ordinary] + rw [z2N (3 * a + 2) b hb_nonneg,h3a] + have hh : h = a * 4 + 2 := by omega + have hw_eq : w + a * 3 + 3 = w + 1 + (a * 3 + 2) := by omega + rw [hh,hw_eq] + exact zPs (z1Y w (z2r b) a (z2r m)) + · injection hs with hy; subst hy + dsimp only [z2P,Forward13.ordinary] + rw [z2C,h3a] + have hh : h = a * 4 + 3 := by omega + have hw_eq : w + a * 3 + 4 = w + (a * 3 + 4) := by omega + rw [hh,hw_eq] + exact zPs (z1Z w (z2r b) a (z2r m) (by omega)) +theorem z32 {w : Nat} {k : Sparse.num} {h : Nat} {n m : Sparse.num} {y : Forward13.State} + (hg : Forward13.good ⟨.T1,w,k,h,n,m⟩ = true) + (hs : Forward13.step_state ⟨.T1,w,k,h,n,m⟩ = .next y) : + (z2P ⟨.T1,w,k,h,n,m⟩) [target_tm]⊢* (z2P y) := by + rcases z2R hg with ⟨hw,hk,hcap,hm⟩ + dsimp only at hw hk hcap hm + have hP := z2T hg + dsimp only [z2Q] at hP + rcases hP with ⟨hw1,hnm_le,hk_lt,hn_lt⟩ + have hn := z2S (Or.inl rfl) hg + have h_k_nat : (z2r k : Int) = Sparse.value k := z2s k hk + have h_n_nat : (z2r n : Int) = Sparse.value n := z2s n hn + let b := Forward13.minus k n + have hb_nonneg : 0 <= Sparse.value b := by rw [z2v]; omega + have hb_num : z2r b = z2r k - z2r n := z2z k n hn (by omega) + have s1 : (z2P ⟨.T1,w,k,h,n,m⟩) [target_tm]⊢* + (z0V (LC w (z2r b)) (RC1 h 0 (z2r m))) := by + dsimp only [z2P] + have hk_eq : z2r k = z2r b + z2r n := by omega + rw [hk_eq] + exact z22 w (z2r b) h (z2r n) (rd1 +> RC (z2r m)) (by omega) hn_lt + refine zSt s1 ?_ + unfold Forward13.step_state at hs + dsimp only at hs + by_cases hh0 : h = 0 + · subst hh0 + rw [if_pos rfl] at hs + cases hhalf : Sparse.half m with + | none => rw [hhalf] at hs; contradiction + | some bv => + rcases bv with ⟨bit,v⟩ + rw [hhalf] at hs + cases bit + · rw [z2U hs,z2C] + have h0 : 0 = 0 * 4 := rfl + have hw_eq : w + 1 = w + (0 * 3 + 1) := by omega + rw [h0,hw_eq] + exact zPs (z1S w (z2r b) 0 (z2r m) (by omega)) + · cases hsplit : Sparse.split (Forward13.plus m Forward13.one) with + | none => rw [hsplit] at hs; contradiction + | some tu => + rcases tu with ⟨t,u⟩ + rw [hsplit] at hs + dsimp only at hs + split_ifs at hs with ht + injection hs with hy; subst hy + rcases z2H hsplit with ⟨hu,hm1⟩ + rw [z2y m Forward13.one hm (by decide)] at hm1 + have hone : z2r Forward13.one = 1 := rfl + rw [hone] at hm1 + dsimp only [z2P] + rw [z2C,hone,z2B u hu] + have hm_eq : z2r m = (2 * z2r u + 1) * 2 ^ t - 1 := by + have h_comm : z2r u * 2 + 1 = 2 * z2r u + 1 := by ring + rw [h_comm] at hm1 + (try omega) + rw [hm_eq] + exact z2c t w (z2r b) (2 * z2r u) ht (by omega) + · rw [if_neg hh0] at hs + let a := h / 4 + let e := h % 4 + have h_div : h = a * 4 + e := by omega + have h_mod : e < 4 := Nat.mod_lt h (by decide) + have h3a : 3 * a = a * 3 := by ring + split_ifs at hs with he0 he1 he2 + · rw [z2U hs,z2C,h3a] + have hh : h = a * 4 := by omega + have hw_eq : w + a * 3 + 1 = w + (a * 3 + 1) := by omega + rw [hh,hw_eq] + exact zPs (z1S w (z2r b) a (z2r m) (by omega)) + · injection hs with hy; subst hy + dsimp only [z2P,Forward13.ordinary] + rw [z2N (3 * a) b hb_nonneg,z2O m hm,h3a] + have hh : h = a * 4 + 1 := by omega + have hw_eq : w + a * 3 + 1 = w + 1 + a * 3 := by omega + rw [hh,hw_eq] + exact zPs (z1T w (z2r b) a (z2r m)) + · injection hs with hy; subst hy + dsimp only [z2P,Forward13.ordinary] + rw [z2C,z2O m hm,h3a] + have hh : h = a * 4 + 2 := by omega + have hw_eq : w + a * 3 + 2 = w + (a * 3 + 2) := by omega + rw [hh,hw_eq] + exact zPs (z1U w (z2r b) a (z2r m) (by omega)) + · rw [z2U hs,z2N (3 * a + 2) b hb_nonneg,h3a] + have hh : h = a * 4 + 3 := by omega + have hw_eq : w + a * 3 + 3 = w + 1 + (a * 3 + 2) := by omega + rw [hh,hw_eq] + exact zPs (z1V w (z2r b) a (z2r m)) +theorem z33 {x y : Forward13.State} (hg : Forward13.good x = true) + (hs : Forward13.step_state x = .next y) : + (z2P x) [target_tm]⊢* (z2P y) := by + rcases x with ⟨p,w,k,h,n,m⟩ + cases p + · exact z30 hg hs + · exact z2Y hg hs + · exact z32 hg hs + · exact z31 hg hs + · exact z2Z hg hs +theorem z34 (p : Forward13.Phase) (w : Nat) (k m : Sparse.num) (a : Nat) (b : Int) : + Forward13.prefix_step p w k m a b ≠ .halted := by + unfold Forward13.prefix_step + split_ifs + · intro h; contradiction + · cases Sparse.split m <;> (intro h; contradiction) +theorem z35 {x : Forward13.State} (_hg : Forward13.good x = true) + (hs : Forward13.step_state x = .halted) : + z2o (z2P x) := by + rcases x with ⟨p,w,k,h,n,m⟩ + unfold Forward13.step_state at hs + cases p <;> dsimp only at hs + · by_cases heq : Sparse.eqb (Forward13.plus k m) (Sparse.power w) = true + · rw [if_pos heq] at hs + split_ifs at hs + · rw [if_neg heq] at hs + cases hhalf : Sparse.half (Forward13.plus k m) with + | none => rw [hhalf] at hs; contradiction + | some bu => + rcases bu with ⟨b,u⟩ + rw [hhalf] at hs + cases b <;> exact False.elim (z34 _ _ _ _ _ _ hs) + · contradiction + · by_cases hh0 : h = 0 + · rw [if_pos hh0] at hs + cases hhalf : Sparse.half m with + | none => rw [hhalf] at hs; contradiction + | some bv => + rcases bv with ⟨bit,v⟩ + rw [hhalf] at hs + cases bit + · exact False.elim (z34 _ _ _ _ _ _ hs) + · cases hsplit : Sparse.split (Forward13.plus m Forward13.one) with + | none => rw [hsplit] at hs; contradiction + | some tu => + rcases tu with ⟨t,u⟩ + rw [hsplit] at hs + dsimp only at hs + split_ifs at hs + · rw [if_neg hh0] at hs + split_ifs at hs <;> exact False.elim (z34 _ _ _ _ _ _ hs) + · split_ifs at hs <;> exact False.elim (z34 _ _ _ _ _ _ hs) + · cases hhalf : Sparse.half m with + | none => rw [hhalf] at hs; contradiction + | some bu => + rcases bu with ⟨b,u⟩ + rw [hhalf] at hs + cases b + · exact False.elim (z34 _ _ _ _ _ _ hs) + · rcases z2I hhalf with ⟨_,hm⟩ + simp only [z2P,hm,↓reduceIte] + exact auxiliary_halt w (z2r k) (z2r u) +theorem z36 (fuel : Nat) (x : Forward13.State) (h : Forward13.check fuel x = true) : + z2o (z2P x) := by + induction fuel generalizing x with + | zero => contradiction + | succ fuel ih => + unfold Forward13.check at h + split_ifs at h with hg + cases hs : Forward13.step_state x with + | next y => + rw [hs] at h + exact z2p (z33 hg hs) (ih y h) + | halted => + exact z35 hg hs + | stuck => + rw [hs] at h + contradiction +theorem z37 : (init []) [target_tm]⊢* (z2P Forward13.seed) := by + have h_meaning : z2P Forward13.seed = + z0U ((ld1 ^ 3) +> ldh) ([1,0,0,0,0,0,0,0,0,1,0,0] +> default) := by + dsimp only [Forward13.seed,Forward13.ordinary,z2P,LC,RC] + have h0 : z2r [] = 0 := rfl + have h9 : z2r (Sparse.pack (Sparse.small 9)) = 9 := by + unfold z2r; rw [Sparse.pack_spec,Sparse.small_spec]; rfl + have h_rc9 : z0q rd0 rd1 9 = [1,0,0,0,0,0,0,0,0,1,0,0] +> default := by + have : (9 : Nat) = (((0 * 2 + 1) * 2) * 2) * 2 + 1 := rfl + rw [this,z0I,z0H z1B,z0H z1B,z0I,z0F] + rfl + rw [h0,h9,z0u,h_rc9] + rw [h_meaning] + exact init_tm + +end Solution + +public section + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 +open Solution in +theorem is_halt : IsHalt target := by + exact z2p z37 (z36 175 Forward13.seed Forward13.numerical_halt) + +end + +end BusyBeaver.M_1RB0RF_1LC1RE_1LD0LC_0LE0RE_1RA1LD_1RBHHH diff --git a/BusyBeaver/BB6/Halt/M_1RB0RF_1RC0RB_1LD1RA_1LE0LD_1RB0LA_0LDHHH.lean b/BusyBeaver/BB6/Halt/M_1RB0RF_1RC0RB_1LD1RA_1LE0LD_1RB0LA_0LDHHH.lean new file mode 100644 index 00000000..3007bfb6 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB0RF_1RC0RB_1LD1RA_1LE0LD_1RB0LA_0LDHHH.lean @@ -0,0 +1,4501 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RF_1RC0RB_1LD1RA_1LE0LD_1RB0LA_0LDHHH + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1RC0RB_1LD1RA_1LE0LD_1RB0LA_0LDHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +set_option autoImplicit true + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + + +local notation "zB" => ListBlank (Fin 2) +local notation "zF" => List (Fin 2) +set_option maxHeartbeats 2000000 + +def tm15 : Machine (Fin 2) (Fin 6) + | 0, 0 => some (some 1, Stmt.write 1 Dir.left) + | 0, 1 => some (some 4, Stmt.write 1 Dir.right) + | 1, 0 => some (some 2, Stmt.write 1 Dir.left) + | 1, 1 => some (some 1, Stmt.write 0 Dir.left) + | 2, 0 => some (some 3, Stmt.write 1 Dir.right) + | 2, 1 => some (some 4, Stmt.write 0 Dir.left) + | 3, 0 => some (some 0, Stmt.write 1 Dir.right) + | 3, 1 => some (some 3, Stmt.write 0 Dir.right) + | 4, 0 => some (some 3, Stmt.write 1 Dir.right) + | 4, 1 => some (some 5, Stmt.write 0 Dir.right) + | 5, 0 => some (some 1, Stmt.write 0 Dir.left) + | 5, 1 => none + +def perm_0155 : Fin 6 → Fin 6 + | 0 => 2 + | 1 => 3 + | 2 => 4 + | 3 => 1 + | 4 => 0 + | 5 => 5 + +def map_cfg_0155 (c : Cfg (Fin 2) (Fin 6)) : Cfg (Fin 2) (Fin 6) := + ⟨c.q.map perm_0155, c.tape⟩ + +theorem step_map_0155 (c : Cfg (Fin 2) (Fin 6)) : + step target_tm (map_cfg_0155 c) = (step tm15 c).map map_cfg_0155 := by + rcases c with ⟨_ | ⟨_ | _ | _ | _ | _ | _ | q, hq⟩, ⟨⟨_ | _ | h, hh⟩, l, r⟩⟩ <;> try rfl + all_goals omega + +@[simp] theorem zMz (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +theorem multiStep_map_0155 (c : Cfg (Fin 2) (Fin 6)) (n : Nat) : + multiStep target_tm (map_cfg_0155 c) n = (multiStep tm15 c n).map map_cfg_0155 := by + induction n with + | zero => rfl + | succ n ih => + rw [zMs, zMs, ih] + cases multiStep tm15 c n with + | none => rfl + | some c' => exact step_map_0155 c' + +@[simp] theorem z0i : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : zB).head = 0 := rfl +@[simp] theorem zDt : (default : zB).tail = default := rfl +@[simp] theorem append_nil (s : zB) : ([] : zF) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : zF) (s : zB) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l₁ l₂ : zF) (s : zB) : + (l₁ ++ l₂) +> s = l₁ +> (l₂ +> s) := by + induction l₁ with + | nil => rfl + | cons a l₁ ih => simp [ih] +@[simp] theorem zPz (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem z0j (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +theorem z0k (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp [Nat.zero_add] + | succ m ih => simp [z0j, Nat.succ_add, ih, List.append_assoc] +theorem z0l (l : List α) (n : Nat) : l ^ n ++ l = l ^ (n + 1) := by + induction n with + | zero => simp [z0j] + | succ n ih => simp [z0j, List.append_assoc, ih] +theorem z0m (a b : List α) (n : Nat) : (a ++ b) ^ n ++ a = a ++ (b ++ a) ^ n := by + induction n with + | zero => simp + | succ n ih => + rw [z0j, List.append_assoc, ih, z0j] + simp only [List.append_assoc] +theorem z0n (a b : zF) (i : Nat) (s : zB) : + a +> ((b ++ a) ^ i) +> (b +> s) = ((a ++ b) ^ (i + 1)) +> s := by + rw [<- append_assoc, <- append_assoc, <- z0m, List.append_assoc, z0l] + +def z0o (d0 d1 : zF) : Nat → Nat → zB → zB + | 0, _, r => r + | len + 1, n, r => (if n % 2 = 0 then d1 else d0) +> z0o d0 d1 len (n / 2) r + +def MC : Nat → Nat → zB → zB + | 0, n, r => (if n % 2 = 0 then [1] else [0]) +> r + | h + 1, n, r => (if n % 2 = 0 then [1, 0, 0] else [0, 0, 0]) +> MC h (n / 2) r + +theorem z0s (d0 d1 : zF) (len n : Nat) (r : zB) : + z0o d0 d1 (len + 1) (n * 2) r = d1 +> z0o d0 d1 len n r := by + simp only [z0o] + have h1 : (n * 2) % 2 = 0 := by omega + have h2 : (n * 2) / 2 = n := by omega + simp [h1, h2] +theorem z0t (d0 d1 : zF) (len n : Nat) (r : zB) : + z0o d0 d1 (len + 1) (n * 2 + 1) r = d0 +> z0o d0 d1 len n r := by + simp only [z0o] + have h1 : (n * 2 + 1) % 2 = 1 := by omega + have h2 : (n * 2 + 1) / 2 = n := by omega + simp [h1, h2] +theorem z0u (d0 d1 : zF) (len : Nat) (r : zB) : + z0o d0 d1 len 0 r = (d1 ^ len) +> r := by + induction len with + | zero => rfl + | succ len ih => + have h := z0s d0 d1 len 0 r + simp only [Nat.zero_mul] at h + rw [h, ih, z0j, append_assoc] +theorem z0v (n : Nat) : 0 < 2 ^ n := Nat.two_pow_pos n +theorem z0w (d0 d1 : zF) (len : Nat) (r : zB) : + z0o d0 d1 len (2 ^ len - 1) r = (d0 ^ len) +> r := by + induction len with + | zero => rfl + | succ len ih => + have hp := z0v len + have h1 : 2 ^ (len + 1) - 1 = (2 ^ len - 1) * 2 + 1 := by + rw [Nat.pow_succ]; omega + rw [h1, z0t, ih, z0j, append_assoc] +theorem z0x (d0 d1 : zF) (len n i : Nat) (r : zB) : + z0o d0 d1 (len + i) (n * 2 ^ i) r = (d1 ^ i) +> z0o d0 d1 len n r := by + induction i with + | zero => simp + | succ i ih => + have h1 : len + (i + 1) = (len + i) + 1 := by omega + have h2 : n * 2 ^ (i + 1) = (n * 2 ^ i) * 2 := by rw [Nat.pow_succ, ← Nat.mul_assoc] + rw [h1, h2, z0s, ih, z0j, append_assoc] +theorem z0y' (d0 d1 : zF) (len n i : Nat) (r : zB) : + z0o d0 d1 (len + i) ((n + 1) * 2 ^ i - 1) r = + (d0 ^ i) +> z0o d0 d1 len n r := by + induction i with + | zero => + have h1 : (n + 1) * 2 ^ 0 - 1 = n := by omega + simp [h1] + | succ i ih => + have hp := z0v i + have hpos : 1 ≤ (n + 1) * 2 ^ i := Nat.mul_pos (by omega) hp + have h1 : len + (i + 1) = (len + i) + 1 := by omega + have h2 : (n + 1) * 2 ^ (i + 1) - 1 = ((n + 1) * 2 ^ i - 1) * 2 + 1 := by + rw [Nat.pow_succ, ← Nat.mul_assoc]; omega + rw [h1, h2, z0t, ih, z0j, append_assoc] + +abbrev ld0 : zF := [0, 1, 1, 1] +abbrev ld1 : zF := [1, 1, 1, 1] +abbrev rd0 : zF := [0, 0, 0] +abbrev rd1 : zF := [1, 0, 0] + +theorem MC_s (h n : Nat) (r : zB) : + MC (h + 1) (n * 2) r = rd1 +> MC h n r := by + simp only [MC, rd1] + have h1 : (n * 2) % 2 = 0 := by omega + have h2 : (n * 2) / 2 = n := by omega + simp [h1, h2] +theorem MC_t (h n : Nat) (r : zB) : + MC (h + 1) (n * 2 + 1) r = rd0 +> MC h n r := by + simp only [MC, rd0] + have h1 : (n * 2 + 1) % 2 = 1 := by omega + have h2 : (n * 2 + 1) / 2 = n := by omega + simp [h1, h2] +theorem MC_lsb_0 (h n i : Nat) (r : zB) : + MC (h + i) (n * 2 ^ i) r = (rd1 ^ i) +> MC h n r := by + induction i with + | zero => simp + | succ i ih => + have h1 : h + (i + 1) = (h + i) + 1 := by omega + have h2 : n * 2 ^ (i + 1) = (n * 2 ^ i) * 2 := by rw [Nat.pow_succ, ← Nat.mul_assoc] + rw [h1, h2, MC_s, ih, z0j, append_assoc] +theorem MC_lsb_1 (h n i : Nat) (r : zB) : + MC (h + i) ((n + 1) * 2 ^ i - 1) r = (rd0 ^ i) +> MC h n r := by + induction i with + | zero => + have h1 : (n + 1) * 2 ^ 0 - 1 = n := by omega + simp [h1] + | succ i ih => + have hp := z0v i + have hpos : 1 ≤ (n + 1) * 2 ^ i := Nat.mul_pos (by omega) hp + have h1 : h + (i + 1) = (h + i) + 1 := by omega + have h2 : (n + 1) * 2 ^ (i + 1) - 1 = ((n + 1) * 2 ^ i - 1) * 2 + 1 := by + rw [Nat.pow_succ, ← Nat.mul_assoc]; omega + rw [h1, h2, MC_t, ih, z0j, append_assoc] +theorem MC_base_0 (h : Nat) (r : zB) : + MC h 0 r = (rd1 ^ h) +> [1] +> r := by + have := MC_lsb_0 0 0 h r + simp only [Nat.zero_add, Nat.zero_mul] at this + rw [this]; rfl +theorem MC_base_1 (h : Nat) (r : zB) : + MC h (2 ^ (h + 1) - 1) r = (rd0 ^ h) +> [0] +> r := by + have hp := z0v h + have h1 : 2 ^ (h + 1) - 1 = (1 + 1) * 2 ^ h - 1 := by rw [Nat.pow_succ]; omega + rw [h1] + have := MC_lsb_1 0 1 h r + simp only [Nat.zero_add] at this + rw [this]; rfl + +theorem z0M (d0 d1 : zF) (len n : Nat) (r : zB) + (h : 1 + n < 2 ^ len) : + ∃ (i : Nat) (s : zB), + z0o d0 d1 len (1 + n) r = (d1 ^ i) +> d0 +> s ∧ + z0o d0 d1 len n r = (d0 ^ i) +> d1 +> s := by + induction len generalizing n with + | zero => simp at h + | succ len ih => + have hp : 2 ^ (len + 1) = 2 ^ len * 2 := Nat.pow_succ 2 len + let k := n / 2 + rcases Nat.mod_two_eq_zero_or_one n with hn0 | hn1 + · have h_even : n = k * 2 := by omega + have h_odd : 1 + n = k * 2 + 1 := by omega + refine ⟨0, z0o d0 d1 len k r, ?_, ?_⟩ + · rw [h_odd, z0t]; rfl + · rw [h_even, z0s]; rfl + · have h_odd : n = k * 2 + 1 := by omega + have h_even : 1 + n = (1 + k) * 2 := by omega + have h_lt : 1 + k < 2 ^ len := by omega + rcases ih k h_lt with ⟨i, s, hi1, hi0⟩ + refine ⟨i + 1, s, ?_, ?_⟩ + · rw [h_even, z0s, hi1, z0j, append_assoc] + · rw [h_odd, z0t, hi0, z0j, append_assoc] + +theorem MC_dec (h n : Nat) (r : zB) (hn : 1 + n < 2 ^ (h + 1)) : + ∃ (i : Nat) (s : zB), + MC h (1 + n) r = (rd1 ^ i) +> [0] +> s ∧ + MC h n r = (rd0 ^ i) +> [1] +> s := by + induction h generalizing n with + | zero => + have hn0 : n = 0 := by simp at hn; omega + subst hn0 + exact ⟨0, r, rfl, rfl⟩ + | succ h ih => + have hp : 2 ^ (h + 1 + 1) = 2 ^ (h + 1) * 2 := Nat.pow_succ 2 (h + 1) + let k := n / 2 + rcases Nat.mod_two_eq_zero_or_one n with hn0 | hn1 + · have h_even : n = k * 2 := by omega + have h_odd : 1 + n = k * 2 + 1 := by omega + refine ⟨0, [0, 0] +> MC h k r, ?_, ?_⟩ + · rw [h_odd, MC_t]; rfl + · rw [h_even, MC_s]; rfl + · have h_odd : n = k * 2 + 1 := by omega + have h_even : 1 + n = (1 + k) * 2 := by omega + have h_lt : 1 + k < 2 ^ (h + 1) := by omega + rcases ih k h_lt with ⟨i, s, hi1, hi0⟩ + refine ⟨i + 1, s, ?_, ?_⟩ + · rw [h_even, MC_s, hi1, z0j, append_assoc] + · rw [h_odd, MC_t, hi0, z0j, append_assoc] + +theorem zSm (tm : Machine Γ Λ) (c_1 c_2 : Cfg Γ Λ) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z0P (tm : Machine Γ Λ) (c_1 c_2 : Cfg Γ Λ) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢* c_2 := ⟨1, zSm tm c_1 c_2 h⟩ +theorem z0Q (tm : Machine Γ Λ) (c_1 c_2 : Cfg Γ Λ) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1, by decide, zSm tm c_1 c_2 h⟩ +theorem zMa (tm : Machine Γ Λ) (c_1 : Cfg Γ Λ) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, zMs, ih, Option.bind_assoc] + simp_rw [zMs] +theorem zMt (tm : Machine Γ Λ) (c_1 c_2 c_3 : Cfg Γ Λ) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa, h₁]; simp [h₂] +theorem zSt {tm : Machine Γ Λ} {c_1 c_2 c_3 : Cfg Γ Λ} + (h₁ : c_1 [tm]⊢* c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢* c_3 := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem zPt {tm : Machine Γ Λ} {c_1 c_2 c_3 : Cfg Γ Λ} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, _, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem zPs {tm : Machine Γ Λ} {c_1 c_2 : Cfg Γ Λ} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ +theorem z0R {tm : Machine Γ Λ} {c_1 c_2 c_3 : Cfg Γ Λ} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z0S {tm : Machine Γ Λ} {c_1 c_2 c_3 : Cfg Γ Λ} + (h₁ : c_1 [tm]⊢* c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z0T {tm : Machine Γ Λ} {c_1 c_2 c_3 : Cfg Γ Λ} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z0R (z0Q tm c_1 c_2 h₁) h₂ + +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step_tm" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z0T (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, z0i, zDh, zDt]) +macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm))) +macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +theorem sh_0_sound (n : Nat) (l r : zB) : + (l {{A}}> ((rd1 ^ n) +> r)) [tm15]⊢* ((([1, 1, 1] ^ n) +> l) {{A}}> r) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (l {{A}}> (rd1 +> (rd1 ^ n) +> r)) [tm15]⊢* + (([1, 1, 1] +> l) {{A}}> ((rd1 ^ n) +> r)) := by + dsimp [rd1, ListBlank.append]; execute + have h2 := ih ([1, 1, 1] +> l) r + rw [<- append_assoc ([1, 1, 1] ^ n) [1, 1, 1] l, z0l] at h2 + exact zSt h1 h2 + +theorem sh_1_sound (n : Nat) (l r : zB) : + ((([1] ^ n) +> l) <{{B}} r) [tm15]⊢* (l <{{B}} (([0] ^ n) +> r)) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (([1] +> ([1] ^ n) +> l) <{{B}} r) [tm15]⊢* + ((([1] ^ n) +> l) <{{B}} ([0] +> r)) := by + dsimp [ListBlank.append]; execute + have h2 := ih l ([0] +> r) + rw [<- append_assoc ([0] ^ n) [0] r, z0l] at h2 + exact zSt h1 h2 + +theorem sh_2_sound (n : Nat) (l r : zB) : + ((([1, 1] ^ n) +> l) <{{C}} r) [tm15]⊢* (l <{{C}} (([1, 0] ^ n) +> r)) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (([1, 1] +> ([1, 1] ^ n) +> l) <{{C}} r) [tm15]⊢* + ((([1, 1] ^ n) +> l) <{{C}} ([1, 0] +> r)) := by + dsimp [ListBlank.append]; execute + have h2 := ih l ([1, 0] +> r) + rw [<- append_assoc ([1, 0] ^ n) [1, 0] r, z0l] at h2 + exact zSt h1 h2 + +theorem sh_3_sound (n : Nat) (l r : zB) : + (l {{D}}> (([1] ^ n) +> r)) [tm15]⊢* ((([0] ^ n) +> l) {{D}}> r) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (l {{D}}> ([1] +> ([1] ^ n) +> r)) [tm15]⊢* + (([0] +> l) {{D}}> (([1] ^ n) +> r)) := by + dsimp [ListBlank.append]; execute + have h2 := ih ([0] +> l) r + rw [<- append_assoc ([0] ^ n) [0] l, z0l] at h2 + exact zSt h1 h2 + +theorem sh_4_sound (n : Nat) (l r : zB) : + (l {{D}}> (([0, 1, 0] ^ n) +> r)) [tm15]⊢* ((([1, 1, 1] ^ n) +> l) {{D}}> r) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (l {{D}}> ([0, 1, 0] +> ([0, 1, 0] ^ n) +> r)) [tm15]⊢* + (([1, 1, 1] +> l) {{D}}> (([0, 1, 0] ^ n) +> r)) := by + dsimp [ListBlank.append]; execute + have h2 := ih ([1, 1, 1] +> l) r + rw [<- append_assoc ([1, 1, 1] ^ n) [1, 1, 1] l, z0l] at h2 + exact zSt h1 h2 + +theorem sh_5_sound (n : Nat) (l r : zB) : + (l {{D}}> (([0, 1, 0, 1] ^ n) +> r)) [tm15]⊢* (((ld0 ^ n) +> l) {{D}}> r) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (l {{D}}> ([0, 1, 0, 1] +> ([0, 1, 0, 1] ^ n) +> r)) [tm15]⊢* + ((ld0 +> l) {{D}}> (([0, 1, 0, 1] ^ n) +> r)) := by + dsimp [ld0, ListBlank.append]; execute + have h2 := ih (ld0 +> l) r + rw [<- append_assoc (ld0 ^ n) ld0 l, z0l] at h2 + exact zSt h1 h2 + +theorem sh_6_sound (n : Nat) (l r : zB) : + (l {{D}}> (([1, 0, 1, 0] ^ n) +> r)) [tm15]⊢* ((([1, 1, 1, 0] ^ n) +> l) {{D}}> r) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (l {{D}}> ([1, 0, 1, 0] +> ([1, 0, 1, 0] ^ n) +> r)) [tm15]⊢* + (([1, 1, 1, 0] +> l) {{D}}> (([1, 0, 1, 0] ^ n) +> r)) := by + dsimp [ListBlank.append]; execute + have h2 := ih ([1, 1, 1, 0] +> l) r + rw [<- append_assoc ([1, 1, 1, 0] ^ n) [1, 1, 1, 0] l, z0l] at h2 + exact zSt h1 h2 + +def z0U (l r : zB) : Cfg (Fin 2) (Fin 6) := + ([1] +> l) <{{C}} ([1, 0, 1, 0] +> r) +def z0V (l r : zB) : Cfg (Fin 2) (Fin 6) := + ([1, 0, 1, 1, 1] +> l) {{A}}> r + +theorem z10 (n : Nat) (l r : zB) : + ((([1, 1, 1] ^ n) +> l) <{{B}} r) [tm15]⊢* (l <{{B}} ((rd0 ^ n) +> r)) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (([1, 1, 1] +> ([1, 1, 1] ^ n) +> l) <{{B}} r) [tm15]⊢* + ((([1, 1, 1] ^ n) +> l) <{{B}} (rd0 +> r)) := by + dsimp [rd0, ListBlank.append]; execute + have h2 := ih l (rd0 +> r) + rw [<- append_assoc (rd0 ^ n) rd0 r, z0l] at h2 + exact zSt h1 h2 + +theorem z11 (n : Nat) (l r : zB) : + (([1] +> (ld1 ^ n) +> l) <{{C}} r) [tm15]⊢* + (([1] +> l) <{{C}} (([1, 0, 1, 0] ^ n) +> r)) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (([1] +> ld1 +> (ld1 ^ n) +> l) <{{C}} r) [tm15]⊢* + (([1] +> (ld1 ^ n) +> l) <{{C}} ([1, 0, 1, 0] +> r)) := by + dsimp [ld1, ListBlank.append]; execute + have h2 := ih l ([1, 0, 1, 0] +> r) + rw [<- append_assoc ([1, 0, 1, 0] ^ n) [1, 0, 1, 0] r, z0l] at h2 + exact zSt h1 h2 + +theorem z13 (n : Nat) (l r : zB) : + (([1, 0, 1, 1, 1] +> l) {{A}}> (([1, 0, 1, 0] ^ n) +> r)) [tm15]⊢* + (([1, 0, 1, 1, 1] +> (ld0 ^ n) +> l) {{A}}> r) := by + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (([1, 0, 1, 1, 1] +> l) {{A}}> ([1, 0, 1, 0] +> ([1, 0, 1, 0] ^ n) +> r)) [tm15]⊢* + (([1, 0, 1, 1, 1] +> ld0 +> l) {{A}}> (([1, 0, 1, 0] ^ n) +> r)) := by + dsimp [ld0, ListBlank.append]; execute + have h2 := ih (ld0 +> l) r + rw [<- append_assoc (ld0 ^ n) ld0 l, z0l] at h2 + exact zSt h1 h2 + +theorem z15 (l r : zB) (n : Nat) : + (z0U ((ld1 ^ n) +> ld0 +> l) r) [tm15]⊢⁺ + (z0V ((ld0 ^ n) +> ld1 +> l) r) := by + unfold z0U z0V + have h1 := z11 n (ld0 +> l) ([1, 0, 1, 0] +> r) + have h_eq : (([1, 0, 1, 0] ^ n) +> [1, 0, 1, 0] +> r) = ([1, 0, 1, 0] +> ([1, 0, 1, 0] ^ n) +> r) := by + rw [<- append_assoc ([1, 0, 1, 0] ^ n) [1, 0, 1, 0] r, z0l, z0j, append_assoc] + rw [h_eq] at h1 + have h2 : (([1] +> ld0 +> l) <{{C}} ([1, 0, 1, 0] +> ([1, 0, 1, 0] ^ n) +> r)) [tm15]⊢⁺ + (([1, 0, 1, 1, 1] +> ld1 +> l) {{A}}> (([1, 0, 1, 0] ^ n) +> r)) := by + dsimp [ld0, ld1, ListBlank.append]; execute + have h3 := z13 n (ld1 +> l) r + exact z0R (z0S h1 h2) h3 + +theorem z15_absorb (l r : zB) (n : Nat) : + (z0U ((ld1 ^ n) +> [1, 0, 1, 1] +> l) r) [tm15]⊢⁺ + (z0V ((ld0 ^ (n + 1)) +> l) r) := by + unfold z0U z0V + have h1 := z11 n ([1, 0, 1, 1] +> l) ([1, 0, 1, 0] +> r) + have h_eq : (([1, 0, 1, 0] ^ n) +> [1, 0, 1, 0] +> r) = ([1, 0, 1, 0] +> ([1, 0, 1, 0] ^ n) +> r) := by + rw [<- append_assoc ([1, 0, 1, 0] ^ n) [1, 0, 1, 0] r, z0l, z0j, append_assoc] + rw [h_eq] at h1 + have h2 : (([1] +> [1, 0, 1, 1] +> l) <{{C}} ([1, 0, 1, 0] +> ([1, 0, 1, 0] ^ n) +> r)) [tm15]⊢⁺ + (([1, 0, 1, 1, 1] +> ld0 +> l) {{A}}> (([1, 0, 1, 0] ^ n) +> r)) := by + dsimp [ld0, ListBlank.append]; execute + have h3 := z13 n (ld0 +> l) r + rw [<- append_assoc (ld0 ^ n) ld0 l, z0l] at h3 + exact z0R (z0S h1 h2) h3 + +theorem z16 (l r : zB) (n : Nat) : + (z0V l ((rd1 ^ n) +> [0] +> r)) [tm15]⊢⁺ + (z0U l ((rd0 ^ n) +> [1] +> r)) := by + unfold z0V z0U + have h1 := sh_0_sound n ([1, 0, 1, 1, 1] +> l) ([0] +> r) + have h2 : ((([1, 1, 1] ^ n) +> [1, 0, 1, 1, 1] +> l) {{A}}> ([0] +> r)) [tm15]⊢⁺ + ((([1, 1, 1] ^ n) +> [1, 0, 1, 1, 1] +> l) <{{B}} ([1] +> r)) := by + dsimp [ListBlank.append]; execute + have h3 := z10 n ([1, 0, 1, 1, 1] +> l) ([1] +> r) + have h4 : (([1, 0, 1, 1, 1] +> l) <{{B}} ((rd0 ^ n) +> [1] +> r)) [tm15]⊢* + (([1] +> l) <{{C}} ([1, 0, 1, 0] +> (rd0 ^ n) +> [1] +> r)) := by + dsimp [ListBlank.append]; execute + exact z0R (z0R (z0S h1 h2) h3) h4 + +theorem z1H (len k : Nat) (l r : zB) (h : 1 + k < 2 ^ len) : + (z0U (z0o ld0 ld1 len (1 + k) l) r) [tm15]⊢⁺ (z0V (z0o ld0 ld1 len k l) r) := by + rcases z0M ld0 ld1 len k l h with ⟨i, s, hi1, hi0⟩ + rw [hi1, hi0] + exact z15 s r i + +theorem z1J (h n : Nat) (l r : zB) (hn : 1 + n < 2 ^ (h + 1)) : + (z0V l (MC h (1 + n) r)) [tm15]⊢⁺ (z0U l (MC h n r)) := by + rcases MC_dec h n r hn with ⟨i, s, hi1, hi0⟩ + rw [hi1, hi0] + exact z16 l s i + +theorem pair_general (len val_l h val_r c : Nat) (l r : zB) + (hl : val_l + c < 2 ^ len) (hr : val_r + c < 2 ^ (h + 1)) : + (z0V (z0o ld0 ld1 len (val_l + c) l) (MC h (val_r + c) r)) [tm15]⊢* + (z0V (z0o ld0 ld1 len val_l l) (MC h val_r r)) := by + induction c with + | zero => exact ⟨0, rfl⟩ + | succ c ih => + have h1 : val_r + (c + 1) = 1 + (val_r + c) := by omega + have h2 : val_l + (c + 1) = 1 + (val_l + c) := by omega + rw [h1, h2] + have s1 := zPs (z1J h (val_r + c) (z0o ld0 ld1 len (1 + (val_l + c)) l) r (by omega)) + have s2 := zPs (z1H len (val_l + c) l (MC h (val_r + c) r) (by omega)) + have s3 := ih (by omega) (by omega) + exact zSt (zSt s1 s2) s3 + +theorem absorb_step (L h val_r : Nat) (l r : zB) (hr : val_r + 2 ^ L < 2 ^ (h + 1)) : + (z0V ((ld0 ^ L) +> [1, 0, 1, 1] +> l) (MC h (val_r + 2 ^ L) r)) [tm15]⊢* + (z0V ((ld0 ^ (L + 1)) +> l) (MC h val_r r)) := by + have hp := z0v L + have h1 : (ld0 ^ L) +> [1, 0, 1, 1] +> l = z0o ld0 ld1 L (0 + (2 ^ L - 1)) ([1, 0, 1, 1] +> l) := by + rw [Nat.zero_add, z0w] + have h2 : val_r + 2 ^ L = (1 + val_r) + (2 ^ L - 1) := by omega + rw [h1, h2] + have s1 := pair_general L 0 h (1 + val_r) (2 ^ L - 1) ([1, 0, 1, 1] +> l) r (by omega) (by omega) + rw [z0u] at s1 + have s2 := zPs (z1J h val_r ((ld1 ^ L) +> [1, 0, 1, 1] +> l) r (by omega)) + have s3 := zPs (z15_absorb l (MC h val_r r) L) + exact zSt (zSt s1 s2) s3 + +theorem absorb_loop (L m' h val_r : Nat) (l r : zB) + (hr : val_r + (2 ^ m' - 1) * 2 ^ L < 2 ^ (h + 1)) : + (z0V ((ld0 ^ L) +> ([1, 0, 1, 1] ^ m') +> l) (MC h (val_r + (2 ^ m' - 1) * 2 ^ L) r)) [tm15]⊢* + (z0V ((ld0 ^ (L + m')) +> l) (MC h val_r r)) := by + induction m' generalizing L val_r with + | zero => + have h0 : (2 ^ 0 - 1) * 2 ^ L = 0 := by simp + simp only [h0, Nat.add_zero, zPz, append_nil] + exact ⟨0, rfl⟩ + | succ m' ih => + have hm := z0v m' + have hLpos := z0v L + have halg : (2 ^ (m' + 1) - 1) * 2 ^ L = (2 ^ m' - 1) * 2 ^ (L + 1) + 2 ^ L := by + have h1 : 2 ^ (m' + 1) - 1 = (2 ^ m' - 1) * 2 + 1 := by rw [Nat.pow_succ]; omega + rw [h1, Nat.add_mul, Nat.one_mul, Nat.mul_assoc, Nat.mul_comm 2 (2 ^ L), ← Nat.pow_succ] + have hsum : val_r + (2 ^ (m' + 1) - 1) * 2 ^ L = (val_r + (2 ^ m' - 1) * 2 ^ (L + 1)) + 2 ^ L := by + omega + rw [z0j, append_assoc, hsum] + have s1 := absorb_step L h (val_r + (2 ^ m' - 1) * 2 ^ (L + 1)) (([1, 0, 1, 1] ^ m') +> l) r (by omega) + have s2 := ih (L + 1) val_r (by omega) + have hL : L + 1 + m' = L + (m' + 1) := by omega + rw [hL] at s2 + exact zSt s1 s2 + +theorem absorb_general (n m' h val_r : Nat) (l r : zB) + (hr : val_r + (1 + (2 ^ m' - 1) * 2 ^ (n + 1)) < 2 ^ (h + 1)) : + (z0V ((ld1 ^ n) +> ([1, 0, 1, 1] ^ (m' + 1)) +> l) + (MC h (val_r + (1 + (2 ^ m' - 1) * 2 ^ (n + 1))) r)) [tm15]⊢* + (z0V ((ld0 ^ (n + (m' + 1))) +> l) (MC h val_r r)) := by + rw [z0j, append_assoc] + have hsum : val_r + (1 + (2 ^ m' - 1) * 2 ^ (n + 1)) = 1 + (val_r + (2 ^ m' - 1) * 2 ^ (n + 1)) := by omega + rw [hsum] + have s1 := zPs (z1J h (val_r + (2 ^ m' - 1) * 2 ^ (n + 1)) ((ld1 ^ n) +> [1, 0, 1, 1] +> ([1, 0, 1, 1] ^ m') +> l) r (by omega)) + have s2 := zPs (z15_absorb (([1, 0, 1, 1] ^ m') +> l) (MC h (val_r + (2 ^ m' - 1) * 2 ^ (n + 1)) r) n) + have s3 := absorb_loop (n + 1) m' h val_r l r (by omega) + have hL : n + 1 + m' = n + (m' + 1) := by omega + rw [hL] at s3 + exact zSt (zSt s1 s2) s3 + +-- ============================================================================ +-- Section 2: Block / Stack / PartList Engine & Soundness +-- ============================================================================ + +structure Block where + pat : Nat + width : Nat + len : Nat + deriving DecidableEq + +abbrev Stack := List Block + +def rot1 (w p : Nat) : Nat := + if w ≤ 1 then p else p / 2 + (p % 2) * (2 ^ (w - 1)) + +def rot_k (w : Nat) : Nat → Nat → Nat + | 0, p => p + | k + 1, p => rot_k w k (rot1 w p) + +def rot_mod (w n p : Nat) : Nat := + if w ≤ 1 then p + else if rot_k w w p = p then rot_k w (n % w) p else rot_k w n p + +theorem rot_k_add (w a b p : Nat) : rot_k w (a + b) p = rot_k w b (rot_k w a p) := by + induction a generalizing p with + | zero => simp [rot_k] + | succ a ih => simp [rot_k, Nat.succ_add, ih] + +theorem rot_k_period (w p : Nat) (h : rot_k w w p = p) (q r : Nat) : + rot_k w (w * q + r) p = rot_k w r p := by + induction q with + | zero => simp + | succ q ih => + have h1 : w * (q + 1) + r = w + (w * q + r) := by + rw [Nat.mul_succ]; omega + rw [h1, rot_k_add, h, ih] + +theorem rot_mod_eq (w n p : Nat) : rot_mod w n p = rot_k w n p := by + unfold rot_mod + split_ifs with hw h + · induction n generalizing p with + | zero => rfl + | succ n ih => rw [rot_k, rot1, if_pos hw, ← ih p] + · have hdiv := Nat.div_add_mod n w + conv_rhs => rw [← hdiv] + exact (rot_k_period w p h (n / w) (n % w)).symm + · rfl + +def bit_of (x : Nat) : Fin 2 := if x % 2 = 1 then 1 else 0 + +def expand_pat (w p : Nat) : Nat → zB → zB + | 0, r => r + | n + 1, r => bit_of p >> expand_pat w (rot1 w p) n r + +def stack_to_tape : Stack → zB + | [] => default + | b :: rest => expand_pat b.width b.pat b.len (stack_to_tape rest) + +theorem expand_pat_add (w p a b : Nat) (r : zB) : + expand_pat w p (a + b) r = expand_pat w p a (expand_pat w (rot_k w a p) b r) := by + induction a generalizing p with + | zero => simp [expand_pat, rot_k] + | succ a ih => simp only [Nat.succ_add, expand_pat, rot_k, ih] + +theorem expand_pat_zero_pat (w n : Nat) : expand_pat w 0 n default = default := by + induction n with + | zero => rfl + | succ n ih => + have h1 : rot1 w 0 = 0 := by simp [rot1] + have h2 : bit_of 0 = 0 := rfl + simp only [expand_pat, h1, h2, ih, z0i] + +def with_nat (e : Nat) (f : Nat → α) : α := + Nat.casesOn e (f 0) (fun n => f (Nat.succ n)) + +@[simp] theorem with_nat_eq (e : Nat) (f : Nat → α) : with_nat e f = f e := by + cases e <;> rfl + +def with_list (xs : List β) (f : List β → α) : α := + List.casesOn xs (f []) (fun h t => f (h :: t)) + +@[simp] theorem with_list_eq (xs : List β) (f : List β → α) : with_list xs f = f xs := by + cases xs <;> rfl + +def with_prod (p : α × β) (f : α × β → γ) : γ := + Prod.casesOn p (fun a b => f (a, b)) + +@[simp] theorem with_prod_eq (p : α × β) (f : α × β → γ) : with_prod p f = f p := by + cases p; rfl + +def with_block (b : Block) (f : Block → α) : α := + Block.casesOn b (fun pat width len => + with_nat pat (fun p => + with_nat width (fun w => + with_nat len (fun l => + f ⟨p, w, l⟩)))) + +@[simp] theorem with_block_eq (b : Block) (f : Block → α) : with_block b f = f b := by + cases b; simp [with_block] + +def with_stack (s : Stack) (f : Stack → α) : α := + List.casesOn s (f []) (fun top rest => + with_block top (fun top' => f (top' :: rest))) + +@[simp] theorem with_stack_eq (s : Stack) (f : Stack → α) : with_stack s f = f s := by + cases s <;> simp [with_stack] + +def push_stack_aux (b : Block) : Stack → Stack + | [] => if b.pat = 0 then [] else [b] + | top :: rest => + if (b.width == top.width && rot_mod b.width b.len b.pat == top.pat) = true then + with_nat (b.len + top.len) (fun new_len => + push_stack_aux ⟨b.pat, b.width, new_len⟩ rest) + else + b :: top :: rest + +def push_stack (pat width len : Nat) (s : Stack) : Stack := + with_stack s (fun s' => + if len = 0 then s' + else + with_nat pat (fun p => + with_nat width (fun w => + with_nat len (fun l => + push_stack_aux ⟨p, w, l⟩ s')))) + +theorem push_stack_aux_sound (b : Block) (s : Stack) : + stack_to_tape (push_stack_aux b s) = expand_pat b.width b.pat b.len (stack_to_tape s) := by + induction s generalizing b with + | nil => + unfold push_stack_aux + split_ifs with h + · simp only [stack_to_tape, h, expand_pat_zero_pat] + · rfl + | cons top rest ih => + unfold push_stack_aux + simp only [with_nat_eq] + split_ifs with h + · simp only [Bool.and_eq_true, beq_iff_eq] at h + rw [ih, stack_to_tape, expand_pat_add, ← rot_mod_eq, h.2, ← h.1] + · rfl + +theorem push_stack_sound (pat width len : Nat) (s : Stack) : + stack_to_tape (push_stack pat width len s) = expand_pat width pat len (stack_to_tape s) := by + unfold push_stack + simp only [with_stack_eq, with_nat_eq] + split_ifs with h + · subst h; rfl + · exact push_stack_aux_sound ⟨pat, width, len⟩ s + +def drop_stack (n : Nat) : Stack → Stack + | [] => [] + | top :: rest => + if n = 0 then top :: rest + else if top.len ≤ n then + with_nat (n - top.len) (fun rem => drop_stack rem rest) + else + with_nat (rot_mod top.width n top.pat) (fun p' => + with_nat (top.len - n) (fun l' => + ⟨p', top.width, l'⟩ :: rest)) + +theorem drop_stack_zero (s : Stack) : drop_stack 0 s = s := by + cases s <;> rfl + +theorem drop_stack_top_le (top : Block) (rest : Stack) (k : Nat) (hk : k ≤ top.len) : + stack_to_tape (top :: rest) = + expand_pat top.width top.pat k (stack_to_tape (drop_stack k (top :: rest))) := by + unfold drop_stack + simp only [with_nat_eq] + split_ifs with h0 hle + · subst h0; rfl + · have heq : k = top.len := by omega + subst heq + simp only [Nat.sub_self, drop_stack_zero, stack_to_tape] + · simp only [stack_to_tape, rot_mod_eq] + rw [← expand_pat_add] + have hlen : k + (top.len - k) = top.len := by omega + rw [hlen] + +def pop1 : Stack → Fin 2 × Stack + | [] => (0, []) + | top :: rest => + if top.len = 0 then + pop1 rest + else + let bit := bit_of top.pat + if top.len = 1 then + (bit, rest) + else + with_nat (rot1 top.width top.pat) (fun p' => + with_nat (top.len - 1) (fun l' => + (bit, ⟨p', top.width, l'⟩ :: rest))) + +theorem pop1_sound (s : Stack) : + stack_to_tape s = (pop1 s).1 >> stack_to_tape (pop1 s).2 := by + induction s with + | nil => exact z0i.symm + | cons top rest ih => + unfold pop1 + simp only [with_nat_eq] + split_ifs with h0 h1 + · simp only [stack_to_tape, h0, expand_pat, ih] + · simp only [stack_to_tape, h1, expand_pat] + · simp only [stack_to_tape] + have hlen : top.len = (top.len - 1) + 1 := by omega + conv_lhs => rw [hlen, expand_pat] + +def word_of : Nat → Nat → zF + | _, 0 => [] + | pat, w + 1 => bit_of pat :: word_of (pat / 2) w + +def pop_word : Nat → Nat → Stack → Option Stack + | _, 0, s => some s + | pat, w + 1, s => + with_prod (pop1 s) (fun res => + if res.1 = bit_of pat then + pop_word (pat / 2) w res.2 + else + none) + +theorem pop_word_sound (pat w : Nat) (s s' : Stack) (h : pop_word pat w s = some s') : + stack_to_tape s = word_of pat w +> stack_to_tape s' := by + induction w generalizing pat s with + | zero => + simp [pop_word] at h + subst h; rfl + | succ w ih => + simp only [pop_word, with_prod_eq] at h + split_ifs at h with hb + rw [pop1_sound s, hb, ih (pat / 2) (pop1 s).2 h, word_of, append_cons] + +def pat_word (bw : Nat) : Nat → Nat → zF + | _, 0 => [] + | bp, w + 1 => bit_of bp :: pat_word bw (rot1 bw bp) w + +theorem expand_pat_word (bw bp w : Nat) (r : zB) : + expand_pat bw bp w r = pat_word bw bp w +> r := by + induction w generalizing bp with + | zero => rfl + | succ w ih => simp [expand_pat, pat_word, ih] + +theorem expand_pat_bulk (bw bp pat w bulk : Nat) (r : zB) + (hrot : rot_k bw w bp = bp) (hw : pat_word bw bp w = word_of pat w) : + expand_pat bw bp (bulk * w) r = ((word_of pat w) ^ bulk) +> r := by + induction bulk with + | zero => simp [expand_pat] + | succ bulk ih => + have h1 : (bulk + 1) * w = w + bulk * w := by rw [Nat.succ_mul, Nat.add_comm] + rw [h1, expand_pat_add, hrot, ih, expand_pat_word, hw, z0j, append_assoc] + +def count_stack_mut (pat w : Nat) : Nat → Nat → Stack → Nat × Stack + | 0, _, s => (0, s) + | fuel + 1, limit, s => + if limit = 0 then (0, s) + else + match s with + | [] => (0, []) + | top :: rest => + if (0 < w && w ≤ top.len && rot_k top.width w top.pat == top.pat && + pat_word top.width top.pat w == word_of pat w) = true then + let div := top.len / w + with_nat (min limit div) (fun bulk => + with_stack (drop_stack (bulk * w) (top :: rest)) (fun s1 => + with_prod (count_stack_mut pat w fuel (limit - bulk) s1) (fun res => + with_nat res.1 (fun c1 => + with_stack res.2 (fun s2 => (bulk + c1, s2)))))) + else + match pop_word pat w (top :: rest) with + | some s1 => + with_prod (count_stack_mut pat w fuel (limit - 1) s1) (fun res => + with_nat res.1 (fun c1 => + with_stack res.2 (fun s2 => (1 + c1, s2)))) + | none => (0, top :: rest) + +theorem count_stack_mut_sound (pat w fuel limit : Nat) (s : Stack) : + (count_stack_mut pat w fuel limit s).1 ≤ limit ∧ + stack_to_tape s = ((word_of pat w) ^ (count_stack_mut pat w fuel limit s).1) +> + stack_to_tape (count_stack_mut pat w fuel limit s).2 := by + induction fuel generalizing limit s with + | zero => simp [count_stack_mut] + | succ fuel ih => + by_cases hlim : limit = 0 + · simp [count_stack_mut, hlim] + · cases s with + | nil => simp [count_stack_mut, hlim] + | cons top rest => + simp only [count_stack_mut, hlim, ↓reduceIte, with_nat_eq, with_stack_eq, with_prod_eq] + split_ifs with h + · dsimp only + simp only [Bool.and_eq_true, decide_eq_true_eq, beq_iff_eq] at h + rcases h with ⟨⟨⟨hw0, hwlen⟩, hrot⟩, hpat⟩ + have hbulk_le_div : min limit (top.len / w) ≤ top.len / w := + Nat.min_le_right limit (top.len / w) + have hbulk_le_lim : min limit (top.len / w) ≤ limit := + Nat.min_le_left limit (top.len / w) + have hmul_le : min limit (top.len / w) * w ≤ top.len := + Nat.le_trans (Nat.mul_le_mul_right w hbulk_le_div) (Nat.div_mul_le_self top.len w) + have hdrop := drop_stack_top_le top rest (min limit (top.len / w) * w) hmul_le + rw [expand_pat_bulk top.width top.pat pat w (min limit (top.len / w)) _ hrot hpat] at hdrop + rcases ih (limit - min limit (top.len / w)) + (drop_stack (min limit (top.len / w) * w) (top :: rest)) with ⟨hrem_le, hrem_eq⟩ + refine ⟨by omega, ?_⟩ + rw [hdrop, hrem_eq, z0k, append_assoc] + · cases hpop : pop_word pat w (top :: rest) with + | none => simp + | some s1 => + dsimp only + have hpw := pop_word_sound pat w (top :: rest) s1 hpop + rcases ih (limit - 1) s1 with ⟨hrem_le, hrem_eq⟩ + refine ⟨by omega, ?_⟩ + rw [hpw, hrem_eq, Nat.add_comm 1, z0j, append_assoc] + +-- PartList & Parser / Subtractor +abbrev PartList := List (Bool × Nat) + +def bsize_parts : PartList → Nat + | [] => 0 + | (_, k) :: xs => k + bsize_parts xs + +def eval_lsb : PartList → Nat + | [] => 0 + | (b, k) :: xs => (if b then 2 ^ k - 1 else 0) + eval_lsb xs * 2 ^ k + +def with_bool (b : Bool) (f : Bool → α) : α := + Bool.casesOn b (f false) (f true) + +@[simp] theorem with_bool_eq (b : Bool) (f : Bool → α) : with_bool b f = f b := by + cases b <;> rfl + +def cons_lsb (b : Bool) (k : Nat) (xs : PartList) : PartList := + with_bool b (fun b' => + with_nat k (fun k' => + with_list xs (fun xs' => + if k' = 0 then xs' + else match xs' with + | [] => if b' then [(true, k')] else [] + | (b2, k2) :: rest => + if b' == b2 then + with_nat (k' + k2) (fun kk => (b', kk) :: rest) + else (b', k') :: (b2, k2) :: rest))) + +theorem eval_cons_lsb (b : Bool) (k : Nat) (xs : PartList) : + eval_lsb (cons_lsb b k xs) = (if b then 2 ^ k - 1 else 0) + eval_lsb xs * 2 ^ k := by + unfold cons_lsb + simp only [with_bool_eq, with_nat_eq, with_list_eq] + by_cases hk : k = 0 + · subst hk; simp [eval_lsb] + · simp only [hk, ↓reduceIte] + cases xs with + | nil => cases b <;> simp [eval_lsb] + | cons head rest => + rcases head with ⟨b2, k2⟩ + dsimp only + by_cases hbb : (b == b2) = true + · simp only [hbb, ↓reduceIte, eval_lsb] + simp only [beq_iff_eq] at hbb + subst hbb + rw [Nat.add_mul, Nat.mul_assoc, ← Nat.pow_add, Nat.add_comm k2 k] + cases b + · simp + · simp only [↓reduceIte] + have hp1 := z0v k + have hp2 := z0v k2 + have hpow : 2 ^ k2 * 2 ^ k = 2 ^ (k + k2) := by rw [← Nat.pow_add, Nat.add_comm] + have hle : 2 ^ k ≤ 2 ^ (k + k2) := by rw [← hpow]; exact Nat.le_mul_of_pos_left _ hp2 + have hd : (2 ^ k2 - 1) * 2 ^ k = 2 ^ (k + k2) - 2 ^ k := by + rw [Nat.sub_mul, Nat.one_mul, hpow] + rw [hd]; omega + · simp [hbb, eval_lsb] + +theorem bsize_cons_lsb_le (b : Bool) (k : Nat) (xs : PartList) : + bsize_parts (cons_lsb b k xs) ≤ k + bsize_parts xs := by + unfold cons_lsb + simp only [with_bool_eq, with_nat_eq, with_list_eq] + by_cases hk : k = 0 + · subst hk; simp [bsize_parts] + · simp only [hk, ↓reduceIte] + cases xs with + | nil => cases b <;> simp [bsize_parts] + | cons head rest => + rcases head with ⟨b2, k2⟩ + dsimp only + by_cases hbb : (b == b2) = true <;> simp [hbb, bsize_parts, Nat.add_assoc] + +theorem eval_lsb_lt (xs : PartList) : eval_lsb xs < 2 ^ (bsize_parts xs) := by + induction xs with + | nil => simp [eval_lsb, bsize_parts] + | cons p xs ih => + rcases p with ⟨b, k⟩ + simp only [eval_lsb, bsize_parts] + have hk := z0v k + have hd : (if b then 2 ^ k - 1 else 0) < 2 ^ k := by split_ifs <;> omega + have hmul : (eval_lsb xs + 1) * 2 ^ k ≤ 2 ^ (bsize_parts xs) * 2 ^ k := + Nat.mul_le_mul_right (2 ^ k) ih + have hpow : 2 ^ (k + bsize_parts xs) = 2 ^ (bsize_parts xs) * 2 ^ k := by + rw [Nat.add_comm, Nat.pow_add] + have hadd : (eval_lsb xs + 1) * 2 ^ k = 2 ^ k + eval_lsb xs * 2 ^ k := by + rw [Nat.add_mul, Nat.one_mul, Nat.add_comm] + omega + +theorem z0o_part (b : Bool) (k len n : Nat) (r : zB) : + z0o ld0 ld1 (k + len) ((if b then 2 ^ k - 1 else 0) + n * 2 ^ k) r = + ((if b then ld0 else ld1) ^ k) +> z0o ld0 ld1 len n r := by + rw [Nat.add_comm k len] + cases b + · simp only [Bool.false_eq_true, ↓reduceIte, Nat.zero_add] + exact z0x ld0 ld1 len n k r + · simp only [↓reduceIte] + have hp := z0v k + have h1 : 2 ^ k - 1 + n * 2 ^ k = (n + 1) * 2 ^ k - 1 := by + rw [Nat.add_mul, Nat.one_mul]; omega + rw [h1] + exact z0y' ld0 ld1 len n k r + +theorem MC_part (b : Bool) (k h n : Nat) (r : zB) : + MC (h + k) ((if b then 2 ^ k - 1 else 0) + n * 2 ^ k) r = + ((if b then rd0 else rd1) ^ k) +> MC h n r := by + cases b + · simp only [Bool.false_eq_true, ↓reduceIte, Nat.zero_add] + exact MC_lsb_0 h n k r + · simp only [↓reduceIte] + have hp := z0v k + have h1 : 2 ^ k - 1 + n * 2 ^ k = (n + 1) * 2 ^ k - 1 := by + rw [Nat.add_mul, Nat.one_mul]; omega + rw [h1] + exact MC_lsb_1 h n k r + +theorem push_ld (b : Bool) (k : Nat) (s : Stack) : + stack_to_tape (push_stack (if b then 14 else 1) (if b then 4 else 1) (k * 4) s) = + ((if b then ld0 else ld1) ^ k) +> stack_to_tape s := by + rw [push_stack_sound] + cases b + · exact expand_pat_bulk 1 1 15 4 k (stack_to_tape s) rfl rfl + · exact expand_pat_bulk 4 14 14 4 k (stack_to_tape s) rfl rfl + +theorem push_rd (b : Bool) (k : Nat) (s : Stack) : + stack_to_tape (push_stack (if b then 0 else 1) (if b then 1 else 3) (k * 3) s) = + ((if b then rd0 else rd1) ^ k) +> stack_to_tape s := by + rw [push_stack_sound] + cases b + · exact expand_pat_bulk 3 1 1 3 k (stack_to_tape s) rfl rfl + · exact expand_pat_bulk 1 0 0 3 k (stack_to_tape s) rfl rfl + +def put_l_parts : PartList → Stack → Stack + | [], s => s + | (b, k) :: xs, s => + push_stack (if b then 14 else 1) (if b then 4 else 1) (k * 4) (put_l_parts xs s) + +theorem put_l_parts_sound (xs : PartList) (s : Stack) : + stack_to_tape (put_l_parts xs s) = + z0o ld0 ld1 (bsize_parts xs) (eval_lsb xs) (stack_to_tape s) := by + induction xs with + | nil => rfl + | cons p xs ih => + rcases p with ⟨b, k⟩ + simp only [put_l_parts, bsize_parts, eval_lsb, push_ld, ih, z0o_part] + +theorem z0o_pad_zero (xs : PartList) (extra : Nat) (r : zB) : + z0o ld0 ld1 (bsize_parts xs + extra) (eval_lsb xs) r = + z0o ld0 ld1 (bsize_parts xs) (eval_lsb xs) ((ld1 ^ extra) +> r) := by + induction xs with + | nil => simp [bsize_parts, eval_lsb, z0o, z0u] + | cons p xs ih => + rcases p with ⟨b, k⟩ + simp only [bsize_parts, eval_lsb] + rw [Nat.add_assoc k (bsize_parts xs) extra, z0o_part, ih, ← z0o_part] + +def put_l_stack (xs : PartList) (n : Nat) (s : Stack) : Stack := + let bs := bsize_parts xs + let s1 := if bs < n then push_stack 1 1 ((n - bs) * 4) s else s + put_l_parts xs s1 + +theorem put_l_stack_sound (xs : PartList) (n : Nat) (s : Stack) (hn : bsize_parts xs ≤ n) : + stack_to_tape (put_l_stack xs n s) = + z0o ld0 ld1 n (eval_lsb xs) (stack_to_tape s) := by + unfold put_l_stack + dsimp only + rw [put_l_parts_sound] + have hlen : n = bsize_parts xs + (n - bsize_parts xs) := by omega + conv_rhs => rw [hlen, z0o_pad_zero] + split_ifs with hlt + · have := push_ld false (n - bsize_parts xs) s + simp only [Bool.false_eq_true, ↓reduceIte] at this + rw [this] + · have hz : n - bsize_parts xs = 0 := by omega + simp [hz] + +theorem push_rd_base (b : Bool) (h : Nat) (s : Stack) : + stack_to_tape (push_stack (if b then 0 else 1) (if b then 1 else 3) ((h + 1) * 3 - 2) s) = + MC h (if b then 2 ^ (h + 1) - 1 else 0) (stack_to_tape s) := by + have hlen : (h + 1) * 3 - 2 = h * 3 + 1 := by omega + rw [hlen, push_stack_sound, expand_pat_add] + cases b + · simp only [Bool.false_eq_true, ↓reduceIte] + have hrot : rot_k 3 (h * 3) 1 = 1 := by + have := rot_k_period 3 1 rfl h 0 + simpa [Nat.mul_comm] using! this + rw [hrot, expand_pat_bulk 3 1 1 3 h _ rfl rfl, MC_base_0]; rfl + · simp only [↓reduceIte] + have hrot : rot_k 1 (h * 3) 0 = 0 := by + have := rot_k_period 1 0 rfl (h * 3) 0 + simpa using! this + rw [hrot, expand_pat_bulk 1 0 0 3 h _ rfl rfl, MC_base_1]; rfl + +def put_r_rec : PartList → Nat → Stack → Stack + | [], k, s => push_stack 1 3 (k * 3 - 2) s + | (bit, m) :: rest, k, s => + if m = 0 then + put_r_rec rest k s + else if k ≤ m then + push_stack (if bit then 0 else 1) (if bit then 1 else 3) (m * 3 - 2) s + else + push_stack (if bit then 0 else 1) (if bit then 1 else 3) (m * 3) (put_r_rec rest (k - m) s) + +def put_r_stack (xs : PartList) (k : Nat) (s : Stack) : Stack := + put_r_rec xs k s + +theorem put_r_rec_sound (xs : PartList) (k : Nat) (s : Stack) + (hk : 1 ≤ k) (hbs : bsize_parts xs ≤ k) : + stack_to_tape (put_r_rec xs k s) = + MC (k - 1) (eval_lsb xs) (stack_to_tape s) := by + induction xs generalizing k with + | nil => + simp only [put_r_rec, eval_lsb] + have hk1 : k = (k - 1) + 1 := by omega + conv_lhs => rw [hk1] + exact push_rd_base false (k - 1) s + | cons p rest ih => + rcases p with ⟨bit, m⟩ + simp only [bsize_parts, eval_lsb] at hbs ⊢ + by_cases hm0 : m = 0 + · subst hm0 + have h0 : (if bit then 2 ^ 0 - 1 else 0) + eval_lsb rest * 2 ^ 0 = eval_lsb rest := by + cases bit <;> simp + simp only [put_r_rec, ↓reduceIte, h0] + exact ih k hk (by omega) + · by_cases hkm : k ≤ m + · simp only [put_r_rec, hm0, hkm, ↓reduceIte] + have heq : m = k := by omega + have hrest0 : bsize_parts rest = 0 := by omega + have hlt := eval_lsb_lt rest + rw [hrest0] at hlt + have heval0 : eval_lsb rest = 0 := by omega + subst heq + rw [heval0, Nat.zero_mul, Nat.add_zero] + have hk1 : m = (m - 1) + 1 := by omega + have hbase := push_rd_base bit (m - 1) s + rw [← hk1] at hbase + exact hbase + · simp only [put_r_rec, hm0, hkm, ↓reduceIte] + rw [push_rd, ih (k - m) (by omega) (by omega), ← MC_part] + have hlen : k - m - 1 + m = k - 1 := by omega + rw [hlen] + +def parse_step_l (limit : Nat) (s : Stack) : Option (Bool × Nat × Stack) := + match s with + | [] => none + | top :: rest => + if (top.width == 1 && top.pat == 1 && 4 ≤ top.len) = true then + let k := min limit (top.len / 4) + some (false, k, drop_stack (k * 4) (top :: rest)) + else if (top.width == 4 && top.pat == 14 && 4 ≤ top.len) = true then + let k := min limit (top.len / 4) + some (true, k, drop_stack (k * 4) (top :: rest)) + else + match pop_word 15 4 (top :: rest) with + | some s1 => some (false, 1, s1) + | none => + match pop_word 14 4 (top :: rest) with + | some s1 => some (true, 1, s1) + | none => none + +theorem parse_step_l_sound (limit : Nat) (s s1 : Stack) (bit : Bool) (k : Nat) + (h : parse_step_l limit s = some (bit, k, s1)) : + stack_to_tape s = ((if bit then ld0 else ld1) ^ k) +> stack_to_tape s1 := by + cases s with + | nil => simp [parse_step_l] at h + | cons top rest => + simp only [parse_step_l] at h + split_ifs at h with h0 h1 + · simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + simp only [Bool.and_eq_true, beq_iff_eq, decide_eq_true_eq] at h0 + have hdiv : min limit (top.len / 4) ≤ top.len / 4 := Nat.min_le_right _ _ + have hmul : min limit (top.len / 4) * 4 ≤ top.len := + Nat.le_trans (Nat.mul_le_mul_right 4 hdiv) (Nat.div_mul_le_self top.len 4) + rw [drop_stack_top_le top rest _ hmul, h0.1.1, h0.1.2] + exact expand_pat_bulk 1 1 15 4 (min limit (top.len / 4)) _ rfl rfl + · simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + simp only [Bool.and_eq_true, beq_iff_eq, decide_eq_true_eq] at h1 + have hdiv : min limit (top.len / 4) ≤ top.len / 4 := Nat.min_le_right _ _ + have hmul : min limit (top.len / 4) * 4 ≤ top.len := + Nat.le_trans (Nat.mul_le_mul_right 4 hdiv) (Nat.div_mul_le_self top.len 4) + rw [drop_stack_top_le top rest _ hmul, h1.1.1, h1.1.2] + exact expand_pat_bulk 4 14 14 4 (min limit (top.len / 4)) _ rfl rfl + · cases h15 : pop_word 15 4 (top :: rest) with + | some s' => + rw [h15] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + simpa using! pop_word_sound 15 4 (top :: rest) s' h15 + | none => + rw [h15] at h + cases h14 : pop_word 14 4 (top :: rest) with + | some s' => + rw [h14] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + simpa using! pop_word_sound 14 4 (top :: rest) s' h14 + | none => + rw [h14] at h + contradiction + +def parse_l : Nat → Nat → Stack → PartList × Stack + | 0, _, s => ([], s) + | fuel + 1, limit, s => + if limit = 0 then ([], s) + else + match parse_step_l limit s with + | none => ([], s) + | some (bit, k, s1) => + with_prod (parse_l fuel (limit - k) s1) (fun res => + with_list res.1 (fun r1 => + with_stack res.2 (fun r2 => + if !bit && r1.isEmpty then + ([], s) + else + ((bit, k) :: r1, r2)))) + +theorem parse_l_sound (fuel limit : Nat) (s : Stack) : + stack_to_tape s = + z0o ld0 ld1 (bsize_parts (parse_l fuel limit s).1) (eval_lsb (parse_l fuel limit s).1) + (stack_to_tape (parse_l fuel limit s).2) := by + induction fuel generalizing limit s with + | zero => rfl + | succ fuel ih => + by_cases hlim : limit = 0 + · simp [parse_l, hlim]; rfl + · simp only [parse_l, hlim, ↓reduceIte, with_prod_eq, with_list_eq, with_stack_eq] + cases hstep : parse_step_l limit s with + | none => rfl + | some val => + rcases val with ⟨bit, k, s1⟩ + dsimp only + split_ifs with he + · rfl + · simp only [bsize_parts, eval_lsb, z0o_part, ← ih (limit - k) s1] + exact parse_step_l_sound limit s s1 bit k hstep + +def parse_step_r (limit : Nat) (s : Stack) : Option (Bool × Nat × Stack) := + match s with + | [] => none + | top :: rest => + if (top.width == 3 && top.pat == 1 && 3 ≤ top.len) = true then + let k := min limit (top.len / 3) + some (false, k, drop_stack (k * 3) (top :: rest)) + else if (top.width == 1 && top.pat == 0 && 3 ≤ top.len) = true then + let k := min limit (top.len / 3) + some (true, k, drop_stack (k * 3) (top :: rest)) + else + match pop_word 1 3 (top :: rest) with + | some s1 => some (false, 1, s1) + | none => + match pop_word 0 3 (top :: rest) with + | some s1 => some (true, 1, s1) + | none => none + +theorem parse_step_r_sound (limit : Nat) (s s1 : Stack) (bit : Bool) (k : Nat) + (hlim : 1 ≤ limit) (h : parse_step_r limit s = some (bit, k, s1)) : + 1 ≤ k ∧ stack_to_tape s = ((if bit then rd0 else rd1) ^ k) +> stack_to_tape s1 := by + cases s with + | nil => simp [parse_step_r] at h + | cons top rest => + simp only [parse_step_r] at h + split_ifs at h with h0 h1 + · simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + simp only [Bool.and_eq_true, beq_iff_eq, decide_eq_true_eq] at h0 + have hdiv : min limit (top.len / 3) ≤ top.len / 3 := Nat.min_le_right _ _ + have hmul : min limit (top.len / 3) * 3 ≤ top.len := + Nat.le_trans (Nat.mul_le_mul_right 3 hdiv) (Nat.div_mul_le_self top.len 3) + refine ⟨by omega, ?_⟩ + rw [drop_stack_top_le top rest _ hmul, h0.1.1, h0.1.2] + exact expand_pat_bulk 3 1 1 3 (min limit (top.len / 3)) _ rfl rfl + · simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + simp only [Bool.and_eq_true, beq_iff_eq, decide_eq_true_eq] at h1 + have hdiv : min limit (top.len / 3) ≤ top.len / 3 := Nat.min_le_right _ _ + have hmul : min limit (top.len / 3) * 3 ≤ top.len := + Nat.le_trans (Nat.mul_le_mul_right 3 hdiv) (Nat.div_mul_le_self top.len 3) + refine ⟨by omega, ?_⟩ + rw [drop_stack_top_le top rest _ hmul, h1.1.1, h1.1.2] + exact expand_pat_bulk 1 0 0 3 (min limit (top.len / 3)) _ rfl rfl + · cases h01 : pop_word 1 3 (top :: rest) with + | some s' => + rw [h01] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + exact ⟨by omega, by simpa using! pop_word_sound 1 3 (top :: rest) s' h01⟩ + | none => + rw [h01] at h + cases h00 : pop_word 0 3 (top :: rest) with + | some s' => + rw [h00] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + exact ⟨by omega, by simpa using! pop_word_sound 0 3 (top :: rest) s' h00⟩ + | none => + rw [h00] at h + contradiction + +def parse_r : Nat → Nat → Stack → PartList × Stack + | 0, _, s => ([], s) + | fuel + 1, limit, s => + if limit = 0 then ([], s) + else + match s with + | [] => ([(true, limit)], []) + | top :: rest => + match parse_step_r limit (top :: rest) with + | none => + with_prod (pop1 (top :: rest)) (fun p => + if p.1 = 0 then + with_stack p.2 (fun p2 => ([(true, 1)], p2)) + else + ([], top :: rest)) + | some (bit, k, s1) => + with_prod (parse_r fuel (limit - k) s1) (fun res => + with_list res.1 (fun r1 => + with_stack res.2 (fun r2 => + if r1.isEmpty then + if bit then + with_stack (push_stack 0 1 2 s1) (fun r2' => ([(true, k)], r2')) + else + ([], top :: rest) + else + ((bit, k) :: r1, r2)))) + +theorem rd0_default (n : Nat) : (rd0 ^ n) +> (default : zB) = default := by + induction n with + | zero => rfl + | succ n ih => simp [z0j, rd0, ih] + +theorem parse_r_sound (fuel limit : Nat) (s : Stack) + (hne : (parse_r fuel limit s).1 ≠ []) : + 1 ≤ bsize_parts (parse_r fuel limit s).1 ∧ + stack_to_tape s = + MC (bsize_parts (parse_r fuel limit s).1 - 1) (eval_lsb (parse_r fuel limit s).1) + (stack_to_tape (parse_r fuel limit s).2) := by + induction fuel generalizing limit s with + | zero => simp [parse_r] at hne + | succ fuel ih => + by_cases hlim : limit = 0 + · simp [parse_r, hlim] at hne + · cases s with + | nil => + simp only [parse_r, hlim, ↓reduceIte, bsize_parts, eval_lsb, Nat.add_zero, Nat.zero_mul, + stack_to_tape] + refine ⟨by omega, ?_⟩ + have hlim_eq : limit = (limit - 1) + 1 := by omega + conv_rhs => rw [hlim_eq] + simp only [Nat.add_sub_cancel, MC_base_1 (limit - 1)] + simp [rd0_default] + | cons top rest => + simp only [parse_r, hlim, ↓reduceIte, with_prod_eq, with_list_eq, with_stack_eq] at hne ⊢ + cases hstep : parse_step_r limit (top :: rest) with + | none => + rw [hstep] at hne + dsimp only at hne ⊢ + by_cases hp0 : (pop1 (top :: rest)).1 = 0 + · simp only [hp0, ↓reduceIte, bsize_parts, eval_lsb, MC] + refine ⟨by omega, ?_⟩ + rw [pop1_sound (top :: rest), hp0]; rfl + · simp [hp0] at hne + | some val => + rcases val with ⟨bit, k, s1⟩ + rw [hstep] at hne + dsimp only at hne ⊢ + rcases parse_step_r_sound limit (top :: rest) s1 bit k (by omega) hstep with ⟨hk1, hseq⟩ + by_cases he : (parse_r fuel (limit - k) s1).1.isEmpty + · by_cases hbit : bit + · subst hbit + simp only [he, ↓reduceIte, bsize_parts, eval_lsb, Nat.add_zero, Nat.zero_mul] + refine ⟨hk1, ?_⟩ + have hk_eq : k = (k - 1) + 1 := by omega + conv_rhs => rw [hk_eq] + simp only [Nat.add_sub_cancel, MC_base_1 (k - 1)] + rw [push_stack_sound, expand_pat_word] + change stack_to_tape (top :: rest) = (rd0 ^ (k - 1)) +> [0] +> [0, 0] +> stack_to_tape s1 + have hrd : [0] +> [0, 0] +> stack_to_tape s1 = rd0 +> stack_to_tape s1 := rfl + rw [hrd, ← append_assoc, z0l, ← hk_eq, hseq]; rfl + · simp [he, hbit] at hne + · simp only [he, Bool.false_eq_true, ↓reduceIte, bsize_parts, eval_lsb] + have hne_res : (parse_r fuel (limit - k) s1).1 ≠ [] := by + intro hc; simp [hc] at he + rcases ih (limit - k) s1 hne_res with ⟨hbs1, hmc⟩ + refine ⟨by omega, ?_⟩ + have hsub : k + bsize_parts (parse_r fuel (limit - k) s1).1 - 1 = + (bsize_parts (parse_r fuel (limit - k) s1).1 - 1) + k := by omega + rw [hsub, MC_part, ← hmc, hseq] + +-- Subtractor & soundness +def subbit (a b borrow : Bool) : Bool × Bool := + (xor (xor a b) borrow, (!a && (b || borrow)) || (b && borrow)) + +def next_x (px : Bool) (kx n : Nat) (xs : PartList) : PartList := + if n < kx then (px, kx - n) :: xs else xs + +def next_y (n : Nat) : PartList → PartList + | [] => [] + | (q, l) :: yrest => if n < l then (q, l - n) :: yrest else yrest + +def head_q : PartList → Bool + | [] => false + | (q, _) :: _ => q + +def head_l (kx : Nat) : PartList → Nat + | [] => kx + | (_, l) :: _ => l + +def sub_chunk_c (px qy c : Bool) (n : Nat) : Bool := + if 1 < n then (subbit px qy (subbit px qy c).2).2 else (subbit px qy c).2 + +def sub_chunk_out (px qy c : Bool) (n : Nat) (out : PartList) : PartList := + cons_lsb (subbit px qy c).1 1 + (if 1 < n then cons_lsb (subbit px qy (subbit px qy c).2).1 (n - 1) out else out) + +def sub_lsb : Nat → Bool → PartList → PartList → Option PartList + | 0, _, _, _ => none + | _ + 1, c, [], ys => + if ys.isEmpty && !c then some [] else none + | fuel + 1, c, (px, kx) :: xs, ys => + if ys.isEmpty && !c then some ((px, kx) :: xs) + else + let qy := head_q ys + let ly := head_l kx ys + with_nat (min kx ly) (fun n => + with_list (next_x px kx n xs) (fun nx => + with_list (next_y n ys) (fun ny => + if n = 0 then + sub_lsb fuel c nx ny + else + match sub_lsb fuel (sub_chunk_c px qy c n) nx ny with + | none => none + | some out => some (sub_chunk_out px qy c n out)))) + +theorem eval_split_part (p : Bool) (k n : Nat) (rest : PartList) (hn : n ≤ k) : + eval_lsb ((p, k) :: rest) = + (if p then 2 ^ n - 1 else 0) + eval_lsb (next_x p k n rest) * 2 ^ n := by + unfold next_x + by_cases hlt : n < k + · simp only [hlt, ↓reduceIte, eval_lsb, Nat.add_mul, Nat.mul_assoc, ← Nat.pow_add] + have hk : k - n + n = k := by omega + rw [hk] + cases p + · simp + · simp only [↓reduceIte] + have hp1 := z0v n + have hp2 := z0v (k - n) + have hpow : 2 ^ (k - n) * 2 ^ n = 2 ^ k := by rw [← Nat.pow_add, hk] + have hle : 2 ^ n ≤ 2 ^ k := by rw [← hpow]; exact Nat.le_mul_of_pos_left _ hp2 + have hd : (2 ^ (k - n) - 1) * 2 ^ n = 2 ^ k - 2 ^ n := by + rw [Nat.sub_mul, Nat.one_mul, hpow] + rw [hd]; omega + · have heq : k = n := by omega + subst heq + simp [hlt, eval_lsb] + +theorem bsize_sub_chunk_out (px qy c : Bool) (n : Nat) (out : PartList) (hn : 1 ≤ n) : + bsize_parts (sub_chunk_out px qy c n out) ≤ n + bsize_parts out := by + unfold sub_chunk_out + have h1 := bsize_cons_lsb_le (subbit px qy c).1 1 + (if 1 < n then cons_lsb (subbit px qy (subbit px qy c).2).1 (n - 1) out else out) + have h2 : bsize_parts (if 1 < n then cons_lsb (subbit px qy (subbit px qy c).2).1 (n - 1) out else out) ≤ + (n - 1) + bsize_parts out := by + by_cases h1n : 1 < n + · simp only [h1n, ↓reduceIte] + exact bsize_cons_lsb_le _ (n - 1) out + · simp only [h1n, ↓reduceIte] + omega + omega + +theorem eval_sub_chunk_out (px qy c : Bool) (n : Nat) (out : PartList) (hn : 1 ≤ n) : + eval_lsb (sub_chunk_out px qy c n out) + (if qy then 2 ^ n - 1 else 0) + (if c then 1 else 0) = + (if px then 2 ^ n - 1 else 0) + + (eval_lsb out + (if sub_chunk_c px qy c n then 1 else 0)) * 2 ^ n := by + unfold sub_chunk_out sub_chunk_c + rw [eval_cons_lsb] + have hpos := z0v (n - 1) + have hpow : 2 ^ n = 2 ^ (n - 1) * 2 := by + have hn1 : n = (n - 1) + 1 := by omega + conv_lhs => rw [hn1, Nat.pow_succ] + by_cases h1n : 1 < n + · simp only [h1n, ↓reduceIte, eval_cons_lsb] + have hmul : ((if (subbit px qy (subbit px qy c).2).1 then 2 ^ (n - 1) - 1 else 0) + + eval_lsb out * 2 ^ (n - 1)) * 2 ^ 1 = + (if (subbit px qy (subbit px qy c).2).1 then 2 ^ (n - 1) - 1 else 0) * 2 + + eval_lsb out * 2 ^ n := by + simp only [Nat.pow_one, Nat.add_mul, Nat.mul_assoc, ← hpow] + have hmul2 : (eval_lsb out + (if (subbit px qy (subbit px qy c).2).2 then 1 else 0)) * 2 ^ n = + eval_lsb out * 2 ^ n + (if (subbit px qy (subbit px qy c).2).2 then 1 else 0) * 2 ^ n := by + rw [Nat.add_mul] + rw [hmul, hmul2] + cases px <;> cases qy <;> cases c <;> dsimp [subbit] <;> omega + · have hn_eq : n = 1 := by omega + subst hn_eq + simp only [Nat.lt_irrefl, ↓reduceIte, Nat.pow_one] + have hmul2 : (eval_lsb out + (if (subbit px qy c).2 then 1 else 0)) * 2 = + eval_lsb out * 2 + (if (subbit px qy c).2 then 1 else 0) * 2 := by + rw [Nat.add_mul] + rw [hmul2] + cases px <;> cases qy <;> cases c <;> dsimp [subbit] <;> omega + +theorem sub_lsb_sound (fuel : Nat) (c : Bool) (xs ys out : PartList) + (h : sub_lsb fuel c xs ys = some out) : + bsize_parts out ≤ bsize_parts xs ∧ + eval_lsb out + eval_lsb ys + (if c then 1 else 0) = eval_lsb xs := by + induction fuel generalizing c xs ys out with + | zero => simp [sub_lsb] at h + | succ fuel ih => + cases xs with + | nil => + simp only [sub_lsb] at h + split_ifs at h with hyc + simp only [Option.some.injEq] at h + subst h + cases ys <;> cases c <;> simp [eval_lsb, bsize_parts] at hyc ⊢ + | cons xhead xrest => + rcases xhead with ⟨px, kx⟩ + simp only [sub_lsb, with_nat_eq, with_list_eq] at h + if hyc : (ys.isEmpty && !c) = true then + rw [if_pos hyc] at h + simp only [Option.some.injEq] at h + subst h + cases ys <;> cases c <;> simp [eval_lsb] at hyc ⊢ + else + rw [if_neg hyc] at h + have hn_kx : min kx (head_l kx ys) ≤ kx := Nat.min_le_left kx (head_l kx ys) + have hsplit_x : eval_lsb ((px, kx) :: xrest) = + (if px then 2 ^ (min kx (head_l kx ys)) - 1 else 0) + + eval_lsb (next_x px kx (min kx (head_l kx ys)) xrest) * 2 ^ (min kx (head_l kx ys)) := + eval_split_part px kx (min kx (head_l kx ys)) xrest hn_kx + have hsplit_y : eval_lsb ys = + (if head_q ys then 2 ^ (min kx (head_l kx ys)) - 1 else 0) + + eval_lsb (next_y (min kx (head_l kx ys)) ys) * 2 ^ (min kx (head_l kx ys)) := by + cases ys with + | nil => simp [head_q, next_y, eval_lsb] + | cons yh yr => + rcases yh with ⟨q, l⟩ + exact eval_split_part q l (min kx l) yr (Nat.min_le_right kx l) + have hbs_nx : min kx (head_l kx ys) + bsize_parts (next_x px kx (min kx (head_l kx ys)) xrest) = + bsize_parts ((px, kx) :: xrest) := by + dsimp [next_x, bsize_parts] + split_ifs with hlt <;> simp [bsize_parts] <;> omega + by_cases hn0 : min kx (head_l kx ys) = 0 + · rw [if_pos hn0] at h + rcases ih c (next_x px kx (min kx (head_l kx ys)) xrest) (next_y (min kx (head_l kx ys)) ys) out h with ⟨hbs_out, heval_out⟩ + rw [hn0] at hsplit_x hsplit_y hbs_nx hbs_out heval_out + simp only [Nat.pow_zero, Nat.sub_self, ite_self, Nat.zero_add, Nat.mul_one] at hsplit_x hsplit_y hbs_nx + exact ⟨by omega, by omega⟩ + · rw [if_neg hn0] at h + cases hrec : sub_lsb fuel (sub_chunk_c px (head_q ys) c (min kx (head_l kx ys))) + (next_x px kx (min kx (head_l kx ys)) xrest) (next_y (min kx (head_l kx ys)) ys) with + | none => rw [hrec] at h; contradiction + | some out_rec => + rw [hrec] at h + simp only [Option.some.injEq] at h + subst h + rcases ih (sub_chunk_c px (head_q ys) c (min kx (head_l kx ys))) + (next_x px kx (min kx (head_l kx ys)) xrest) (next_y (min kx (head_l kx ys)) ys) out_rec hrec with ⟨hbs_rec, heval_rec⟩ + have hn1 : 1 ≤ min kx (head_l kx ys) := by omega + have hbs1 := bsize_sub_chunk_out px (head_q ys) c (min kx (head_l kx ys)) out_rec hn1 + have hev1 := eval_sub_chunk_out px (head_q ys) c (min kx (head_l kx ys)) out_rec hn1 + have h_assoc : eval_lsb out_rec + (if sub_chunk_c px (head_q ys) c (min kx (head_l kx ys)) then 1 else 0) + + eval_lsb (next_y (min kx (head_l kx ys)) ys) = + eval_lsb out_rec + eval_lsb (next_y (min kx (head_l kx ys)) ys) + + (if sub_chunk_c px (head_q ys) c (min kx (head_l kx ys)) then 1 else 0) := by omega + have hmul_rec : (eval_lsb out_rec + (if sub_chunk_c px (head_q ys) c (min kx (head_l kx ys)) then 1 else 0)) * + 2 ^ (min kx (head_l kx ys)) + + eval_lsb (next_y (min kx (head_l kx ys)) ys) * 2 ^ (min kx (head_l kx ys)) = + eval_lsb (next_x px kx (min kx (head_l kx ys)) xrest) * 2 ^ (min kx (head_l kx ys)) := by + rw [← Nat.add_mul, h_assoc, heval_rec] + exact ⟨by omega, by omega⟩ + +-- ============================================================================ +-- Section 3: Macro Step Engine (step_m / run_m) & Soundness +-- ============================================================================ + +structure MState where + q : Fin 6 + l : Stack + r : Stack + deriving DecidableEq + +def mstate_to_cfg (s : MState) : Cfg (Fin 2) (Fin 6) := + (stack_to_tape s.l) {{s.q}}> (stack_to_tape s.r) + +theorem cfg_right_eq_left (q : Fin 6) (b : Fin 2) (l r : zB) : + (l {{q}}> (b >> r)) = ((b >> l) <{{q}} r) := by + simp [Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] + +def drop_mult3 (top : Block) (rest : Stack) : Stack := + let rem := top.len % 3 + if rem = 0 then rest else ⟨top.pat, top.width, rem⟩ :: rest + +def choose_limit_r_loop (n : Nat) : Nat → Nat → Stack → Nat + | 0, _, _ => n + 1 + | _ + 1, done, [] => if done ≤ n then n + 1 else done + 1 + | fuel + 1, done, top :: rest => + if (top.width == 3 && top.pat == 1 && 3 ≤ top.len) = true then + with_nat (done + top.len / 3) (fun next_done => + choose_limit_r_loop n fuel next_done (drop_mult3 top rest)) + else if (top.width == 1 && top.pat == 0 && 3 ≤ top.len) = true then + with_nat (done + top.len / 3) (fun next_done => + if n < next_done then + min (max (n + 2) (done + 2)) next_done + else + choose_limit_r_loop n fuel next_done (drop_mult3 top rest)) + else + match pop_word 1 3 (top :: rest) with + | some r1 => choose_limit_r_loop n fuel (done + 1) r1 + | none => + match pop_word 0 3 (top :: rest) with + | some r1 => + if n < done + 1 then done + 1 + else choose_limit_r_loop n fuel (done + 1) r1 + | none => + if (pop1 (top :: rest)).1 = 0 then done + 1 else done + +def choose_limit_r (kfuel : Nat) (n : Nat) (r : Stack) : Nat := + choose_limit_r_loop n kfuel 0 r + +def push_prefix_l (l : Stack) : Stack := + push_stack 1 1 1 (push_stack 0 1 1 (push_stack 1 1 3 l)) + +theorem push_prefix_l_sound (l : Stack) : + stack_to_tape (push_prefix_l l) = [1, 0, 1, 1, 1] +> stack_to_tape l := by + unfold push_prefix_l + rw [push_stack_sound, push_stack_sound, push_stack_sound] + rfl + +def build_vprime (n m_use : Nat) : PartList := + let v0 : PartList := if 1 < m_use then cons_lsb true (m_use - 1) [] else [] + let v1 : PartList := if 1 < m_use then cons_lsb false n v0 else v0 + cons_lsb true 1 v1 + +theorem eval_build_vprime (n m' : Nat) : + eval_lsb (build_vprime n (m' + 1)) = 1 + (2 ^ m' - 1) * 2 ^ (n + 1) := by + unfold build_vprime + dsimp only + by_cases h1 : 1 < m' + 1 + · simp only [h1, ↓reduceIte, eval_cons_lsb, eval_lsb, Nat.add_sub_cancel, + Nat.mul_zero, Nat.zero_mul, Nat.add_zero, Bool.false_eq_true, Nat.zero_add, Nat.pow_one] + rw [Nat.mul_assoc, ← Nat.pow_succ] + · have hm0 : m' = 0 := by omega + subst hm0 + simp [eval_cons_lsb, eval_lsb] + +def some_mstate (q : Fin 6) (l r : Stack) : Option MState := + with_nat q.val (fun _ => + with_stack l (fun l' => + with_stack r (fun r' => + some ⟨q, l', r'⟩))) + +@[simp] theorem some_mstate_eq (q : Fin 6) (l r : Stack) : + some_mstate q l r = some ⟨q, l, r⟩ := by + simp [some_mstate] + +def do_shift_right (sq : Fin 6) (sw sin sout sout_w : Nat) (s : MState) : Option MState := + if s.q = sq then + let target2 := sin + sin * (2 ^ sw) + if (pop_word target2 (2 * sw) s.r).isSome then + with_prod (count_stack_mut sin sw 8 100000000 s.r) (fun res => + let l' := push_stack sout sout_w (res.1 * sw) s.l + some_mstate sq l' res.2) + else none + else none + +theorem do_shift_right_sound (sq : Fin 6) (sw sin sout sout_w pat_out : Nat) (s s' : MState) + (hrot : rot_k sout_w sw sout = sout) + (hw : pat_word sout_w sout sw = word_of pat_out sw) + (hsh : ∀ (n : Nat) (l r : zB), + (l {{sq}}> (((word_of sin sw) ^ n) +> r)) [tm15]⊢* + ((((word_of pat_out sw) ^ n) +> l) {{sq}}> r)) + (h : do_shift_right sq sw sin sout sout_w s = some s') : + (mstate_to_cfg s) [tm15]⊢* (mstate_to_cfg s') := by + unfold do_shift_right at h + simp only [with_prod_eq] at h + split_ifs at h with hq hpw + simp only [some_mstate_eq, Option.some.injEq] at h + subst h + rcases count_stack_mut_sound sin sw 8 100000000 s.r with ⟨_, hcnt⟩ + unfold mstate_to_cfg + dsimp only + rw [hq, hcnt, push_stack_sound, expand_pat_bulk sout_w sout pat_out sw _ _ hrot hw] + exact hsh _ _ _ + +def bit_pat (b : Fin 2) : Nat := if b = 1 then 1 else 0 + +theorem push_bit_sound (b : Fin 2) (s : Stack) : + stack_to_tape (push_stack (bit_pat b) 1 1 s) = b >> stack_to_tape s := by + rw [push_stack_sound] + rcases b with ⟨_ | _ | b, hb⟩ <;> try rfl + omega + +def do_shift_left (sq : Fin 6) (sw sin sout sout_w : Nat) (s : MState) : Option MState := + if s.q = sq then + let target2 := sin + sin * (2 ^ sw) + with_prod (pop1 s.r) (fun p_r => + if (p_r.1 == bit_of target2 && (pop_word (target2 / 2) (2 * sw - 1) s.l).isSome) = true then + let l1 := push_stack (bit_pat p_r.1) 1 1 s.l + with_prod (count_stack_mut sin sw 8 100000000 l1) (fun res => + with_prod (pop1 res.2) (fun p_l => + let r1 := push_stack sout sout_w (res.1 * sw) p_r.2 + let r2 := push_stack (bit_pat p_l.1) 1 1 r1 + some_mstate sq p_l.2 r2)) + else none) + else none + +theorem do_shift_left_sound (sq : Fin 6) (sw sin sout sout_w pat_out : Nat) (s s' : MState) + (hrot : rot_k sout_w sw sout = sout) + (hw : pat_word sout_w sout sw = word_of pat_out sw) + (hsh : ∀ (n : Nat) (l r : zB), + ((((word_of sin sw) ^ n) +> l) <{{sq}} r) [tm15]⊢* + (l <{{sq}} (((word_of pat_out sw) ^ n) +> r))) + (h : do_shift_left sq sw sin sout sout_w s = some s') : + (mstate_to_cfg s) [tm15]⊢* (mstate_to_cfg s') := by + unfold do_shift_left at h + simp only [with_prod_eq] at h + split_ifs at h with hq hguard + simp only [some_mstate_eq, Option.some.injEq] at h + subst h + let l1 := push_stack (bit_pat (pop1 s.r).1) 1 1 s.l + let res := count_stack_mut sin sw 8 100000000 l1 + rcases count_stack_mut_sound sin sw 8 100000000 l1 with ⟨_, hcnt⟩ + unfold mstate_to_cfg + dsimp only + rw [hq, pop1_sound s.r, cfg_right_eq_left, ← push_bit_sound (pop1 s.r).1 s.l] + change (stack_to_tape l1 <{{sq}} stack_to_tape (pop1 s.r).2) [tm15]⊢* _ + rw [hcnt, push_bit_sound (pop1 res.2).1, cfg_right_eq_left, ← pop1_sound res.2, + push_stack_sound, expand_pat_bulk sout_w sout pat_out sw _ _ hrot hw] + exact hsh _ _ _ + + +def can_pair : Stack → Bool + | [] => false + | top :: rest => + if (top.width == 1 && top.pat == 1) = true then + if rest.isEmpty then false + else if top.len % 4 = 0 then can_pair rest + else true + else if (top.width == 4 && top.pat == 14 && 4 ≤ top.len) = true then true + else if (top.width == 4 && top.pat == 13 && 4 ≤ top.len) = true then false + else true + +def can_absorb : Stack → Bool + | [] => false + | top :: rest => + if (top.width == 1 && top.pat == 1) = true then + if rest.isEmpty then false + else if top.len % 4 = 0 then can_absorb rest + else true + else if (top.width == 4 && top.pat == 13 && 4 ≤ top.len) = true then true + else if (top.width == 4 && top.pat == 14 && 4 ≤ top.len) = true then false + else true + +def pre_pair_l : Stack → Bool + | b1 :: b2 :: b3 :: rest => + if b1.pat == 1 && b1.width == 1 && b1.len == 1 then + if b2.pat == 0 && b2.width == 1 && b2.len == 1 then + if b3.pat == 1 && b3.width == 1 && 3 ≤ b3.len then + let rem := b3.len - 3 + can_pair (if rem == 0 then rest else ⟨1, 1, rem⟩ :: rest) + else true + else true + else false + | b1 :: _ :: [] => b1.pat == 1 && b1.width == 1 && b1.len == 1 + | _ => false + +def pre_absorb_l : Stack → Bool + | b1 :: b2 :: b3 :: rest => + if b1.pat == 1 && b1.width == 1 && b1.len == 1 then + if b2.pat == 0 && b2.width == 1 && b2.len == 1 then + if b3.pat == 1 && b3.width == 1 && 3 ≤ b3.len then + let rem := b3.len - 3 + can_absorb (if rem == 0 then rest else ⟨1, 1, rem⟩ :: rest) + else true + else true + else false + | b1 :: _ :: [] => b1.pat == 1 && b1.width == 1 && b1.len == 1 + | _ => false + +def can_parse_r : Stack → Bool + | top :: _ => !(top.width == 3 && top.pat == 1 && top.len % 3 == 1) + | [] => true + +def sub_lsb_checked (fuel n k : Nat) (a b : PartList) : Option PartList := + if n < k then none else sub_lsb fuel false a b + +theorem sub_lsb_checked_sound (fuel n k : Nat) (a b out : PartList) + (h : sub_lsb_checked fuel n k a b = some out) : + bsize_parts out ≤ bsize_parts a ∧ + eval_lsb out + eval_lsb b + (if false then 1 else 0) = eval_lsb a := by + unfold sub_lsb_checked at h + split_ifs at h + exact sub_lsb_sound fuel false a b out h + +def try_pair_stack (kfuel : Nat) (s : MState) : Option MState := + if s.q = 0 then + if (pre_pair_l s.l && can_parse_r s.r) = true then + match pop_word 29 5 s.l with + | none => none + | some lc => + if can_pair lc then + with_prod (parse_l kfuel 100000000 lc) (fun res_l => + with_list res_l.1 (fun a => + if a.isEmpty then none + else + with_nat (bsize_parts a) (fun n => + with_nat (choose_limit_r kfuel n s.r) (fun lim_r => + if lim_r = 0 then none + else + with_prod (parse_r kfuel lim_r s.r) (fun res_r => + with_list res_r.1 (fun b => + if b.isEmpty then none + else + with_nat (bsize_parts b) (fun k => + match sub_lsb_checked kfuel n k a b with + | some out => + let l1 := push_prefix_l (put_l_stack out n res_l.2) + let r1 := put_r_stack [] k res_r.2 + some_mstate 0 l1 r1 + | none => + match sub_lsb_checked kfuel k n b a with + | some out => + let l1 := push_prefix_l (put_l_stack [] n res_l.2) + let r1 := put_r_stack out k res_r.2 + some_mstate 0 l1 r1 + | none => none))))))) + else none + else none + else none + +theorem try_pair_stack_sound (kfuel : Nat) (s s' : MState) (h : try_pair_stack kfuel s = some s') : + (mstate_to_cfg s) [tm15]⊢* (mstate_to_cfg s') := by + unfold try_pair_stack at h + split_ifs at h with hq hpre + cases hpw : pop_word 29 5 s.l with + | none => rw [hpw] at h; contradiction + | some lc => + rw [hpw] at h + simp only [with_prod_eq, with_list_eq, with_nat_eq] at h + split_ifs at h with hcp ha_empty hlim0 hb_empty + have hpw_eq := pop_word_sound 29 5 s.l lc hpw + have hw29 : word_of 29 5 = [1, 0, 1, 1, 1] := rfl + rw [hw29] at hpw_eq + have hpl := parse_l_sound kfuel 100000000 lc + let a := (parse_l kfuel 100000000 lc).1 + let lc1 := (parse_l kfuel 100000000 lc).2 + let n := bsize_parts a + let b := (parse_r kfuel (choose_limit_r kfuel n s.r) s.r).1 + let rc1 := (parse_r kfuel (choose_limit_r kfuel n s.r) s.r).2 + let k := bsize_parts b + change ¬b.isEmpty = true at hb_empty + have hne_b : b ≠ [] := by intro hc; simp [hc] at hb_empty + rcases parse_r_sound kfuel (choose_limit_r kfuel n s.r) s.r hne_b with ⟨hk1, hpr⟩ + have hal := eval_lsb_lt a + have hbl := eval_lsb_lt b + have hk_eq : k - 1 + 1 = k := Nat.sub_add_cancel hk1 + cases hsub1 : sub_lsb_checked kfuel n k a b with + | some out => + rw [hsub1] at h; simp only [some_mstate_eq, Option.some.injEq] at h; subst h + rcases sub_lsb_checked_sound kfuel n k a b out hsub1 with ⟨hbs_out, heval_out⟩ + simp only [Bool.false_eq_true, ↓reduceIte, Nat.add_zero] at heval_out + unfold mstate_to_cfg; dsimp only + rw [hq, hpw_eq, hpl, hpr, push_prefix_l_sound, put_l_stack_sound out n lc1 hbs_out, + put_r_stack, put_r_rec_sound [] k rc1 hk1 (by simp [bsize_parts])] + change (z0V (z0o ld0 ld1 n (eval_lsb a) (stack_to_tape lc1)) + (MC (k - 1) (eval_lsb b) (stack_to_tape rc1))) [tm15]⊢* + (z0V (z0o ld0 ld1 n (eval_lsb out) (stack_to_tape lc1)) + (MC (k - 1) 0 (stack_to_tape rc1))) + have hpg := pair_general n (eval_lsb out) (k - 1) 0 (eval_lsb b) (stack_to_tape lc1) (stack_to_tape rc1) + (by rw [heval_out]; exact hal) (by rw [Nat.zero_add, hk_eq]; exact hbl) + rw [heval_out, Nat.zero_add] at hpg + exact hpg + | none => + rw [hsub1] at h; dsimp only at h + cases hsub2 : sub_lsb_checked kfuel k n b a with + | none => rw [hsub2] at h; contradiction + | some out => + rw [hsub2] at h; simp only [some_mstate_eq, Option.some.injEq] at h; subst h + rcases sub_lsb_checked_sound kfuel k n b a out hsub2 with ⟨hbs_out, heval_out⟩ + simp only [Bool.false_eq_true, ↓reduceIte, Nat.add_zero] at heval_out + unfold mstate_to_cfg; dsimp only + rw [hq, hpw_eq, hpl, hpr, push_prefix_l_sound, + put_l_stack_sound [] n lc1 (by simp [bsize_parts]), + put_r_stack, put_r_rec_sound out k rc1 hk1 hbs_out] + change (z0V (z0o ld0 ld1 n (eval_lsb a) (stack_to_tape lc1)) + (MC (k - 1) (eval_lsb b) (stack_to_tape rc1))) [tm15]⊢* + (z0V (z0o ld0 ld1 n 0 (stack_to_tape lc1)) + (MC (k - 1) (eval_lsb out) (stack_to_tape rc1))) + have hpg := pair_general n 0 (k - 1) (eval_lsb out) (eval_lsb a) (stack_to_tape lc1) (stack_to_tape rc1) + (by rw [Nat.zero_add]; exact hal) (by rw [heval_out, hk_eq]; exact hbl) + rw [Nat.zero_add, heval_out] at hpg + exact hpg + +def try_absorb_sub (kfuel : Nat) (n m_use : Nat) (b : PartList) : Option (Nat × PartList) := + match sub_lsb kfuel false b (build_vprime n m_use) with + | some out => some (m_use, out) + | none => + if m_use ≤ 1 then none + else + match sub_lsb kfuel false b (build_vprime n (m_use - 1)) with + | some out => some (m_use - 1, out) + | none => none + +theorem try_absorb_sub_sound (kfuel : Nat) (n m_init m_use : Nat) (b out : PartList) + (hm : 1 ≤ m_init) (h : try_absorb_sub kfuel n m_init b = some (m_use, out)) : + 1 ≤ m_use ∧ sub_lsb kfuel false b (build_vprime n m_use) = some out := by + unfold try_absorb_sub at h + cases h1 : sub_lsb kfuel false b (build_vprime n m_init) with + | some out1 => + rw [h1] at h; simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + exact ⟨hm, h1⟩ + | none => + rw [h1] at h; dsimp only at h + split_ifs at h with hle1 + cases h2 : sub_lsb kfuel false b (build_vprime n (m_init - 1)) with + | none => rw [h2] at h; contradiction + | some out2 => + rw [h2] at h; simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + exact ⟨by omega, h2⟩ + +def calc_m_init (m n k : Nat) : Nat := + min m (if n < k then k - n else 1) + +def try_absorb_stack (kfuel : Nat) (s : MState) : Option MState := + if s.q = 0 then + if (pre_absorb_l s.l && can_parse_r s.r) = true then + match pop_word 29 5 s.l with + | none => none + | some lc0 => + if can_absorb lc0 then + with_prod (count_stack_mut 15 4 kfuel 100000000 lc0) (fun res1 => + with_prod (count_stack_mut 13 4 kfuel 100000000 res1.2) (fun res_m => + if res_m.1 = 0 then none + else + with_nat (choose_limit_r kfuel (res1.1 + res_m.1) s.r) (fun lim_r => + if lim_r = 0 then none + else + with_prod (parse_r kfuel lim_r s.r) (fun res_r => + with_list res_r.1 (fun b => + if b.isEmpty then none + else + with_nat (bsize_parts b) (fun k => + with_nat (calc_m_init res_m.1 res1.1 k) (fun m_init => + if m_init = 0 then none + else + match try_absorb_sub kfuel res1.1 m_init b with + | none => none + | some (m_use, out) => + with_prod (count_stack_mut 13 4 kfuel m_use res1.2) (fun res2 => + if res2.1 = m_use then + let l_new := push_prefix_l (push_stack 14 4 ((res1.1 + res2.1) * 4) res2.2) + let r_new := put_r_stack out k res_r.2 + some_mstate 0 l_new r_new + else none)))))))) + else none + else none + else none + +theorem try_absorb_stack_sound (kfuel : Nat) (s s' : MState) (h : try_absorb_stack kfuel s = some s') : + (mstate_to_cfg s) [tm15]⊢* (mstate_to_cfg s') := by + unfold try_absorb_stack at h + split_ifs at h with hq hpre + cases hpw : pop_word 29 5 s.l with + | none => rw [hpw] at h; contradiction + | some lc0 => + rw [hpw] at h + simp only [with_prod_eq, with_list_eq, with_nat_eq] at h + split_ifs at h with hca hm0 hlim0 hb_empty hmin0 + let res1 := count_stack_mut 15 4 kfuel 100000000 lc0 + let res_m := count_stack_mut 13 4 kfuel 100000000 res1.2 + let lim_r := choose_limit_r kfuel (res1.1 + res_m.1) s.r + let res_r := parse_r kfuel lim_r s.r + let k := bsize_parts res_r.1 + let m_init := calc_m_init res_m.1 res1.1 k + cases habs : try_absorb_sub kfuel res1.1 m_init res_r.1 with + | none => rw [habs] at h; contradiction + | some pair_out => + rcases pair_out with ⟨m_use, out⟩ + rw [habs] at h + dsimp only [with_prod_eq, with_list_eq, with_nat_eq] at h + split_ifs at h with hm_act + simp only [some_mstate_eq, Option.some.injEq] at h; subst h + change ¬m_init = 0 at hmin0 + have hmin_pos : 1 ≤ m_init := Nat.pos_of_ne_zero hmin0 + rcases try_absorb_sub_sound kfuel res1.1 m_init m_use res_r.1 out hmin_pos habs with ⟨hm_use1, hsub⟩ + rcases sub_lsb_sound kfuel false res_r.1 (build_vprime res1.1 m_use) out hsub with ⟨hbs_out, heval_out⟩ + simp only [Bool.false_eq_true, ↓reduceIte, Nat.add_zero] at heval_out + have hpw_eq := pop_word_sound 29 5 s.l lc0 hpw + have hw29 : word_of 29 5 = [1, 0, 1, 1, 1] := rfl + rw [hw29] at hpw_eq + rcases count_stack_mut_sound 15 4 kfuel 100000000 lc0 with ⟨_, hcnt15⟩ + have hw15 : word_of 15 4 = ld1 := rfl + rw [hw15] at hcnt15 + let res2 := count_stack_mut 13 4 kfuel m_use res1.2 + rcases count_stack_mut_sound 13 4 kfuel m_use res1.2 with ⟨_, hcnt13⟩ + have hw13 : word_of 13 4 = [1, 0, 1, 1] := rfl + rw [hw13] at hcnt13 + change ¬res_r.1.isEmpty = true at hb_empty + have hne_b : res_r.1 ≠ [] := by intro hc; simp [hc] at hb_empty + rcases parse_r_sound kfuel lim_r s.r hne_b with ⟨hk1, hpr⟩ + have hbl := eval_lsb_lt res_r.1 + have hk_eq : k - 1 + 1 = k := Nat.sub_add_cancel hk1 + have hm_eq : res2.1 = (m_use - 1) + 1 := by rw [show res2.1 = m_use from hm_act]; omega + have hv_eq : eval_lsb (build_vprime res1.1 m_use) = 1 + (2 ^ (m_use - 1) - 1) * 2 ^ (res1.1 + 1) := by + have hmu : m_use = (m_use - 1) + 1 := by omega + conv_lhs => rw [hmu] + exact eval_build_vprime res1.1 (m_use - 1) + rw [hv_eq] at heval_out + unfold mstate_to_cfg; dsimp only + rw [hq, hpw_eq, hcnt15, hcnt13, hpr, push_prefix_l_sound] + have hpush14 := push_ld true (res1.1 + res2.1) res2.2 + simp only [↓reduceIte] at hpush14 + rw [hpush14, put_r_stack, put_r_rec_sound out k res_r.2 hk1 hbs_out] + change (z0V ((ld1 ^ res1.1) +> ([1, 0, 1, 1] ^ res2.1) +> stack_to_tape res2.2) + (MC (k - 1) (eval_lsb res_r.1) (stack_to_tape res_r.2))) [tm15]⊢* + (z0V ((ld0 ^ (res1.1 + res2.1)) +> stack_to_tape res2.2) + (MC (k - 1) (eval_lsb out) (stack_to_tape res_r.2))) + rw [hm_eq, ← heval_out] + exact absorb_general res1.1 (m_use - 1) (k - 1) (eval_lsb out) + (stack_to_tape res2.2) (stack_to_tape res_r.2) (by rw [heval_out, hk_eq]; exact hbl) + +def step_prim (s : MState) : Option MState := + with_prod (pop1 s.r) (fun pr => + match tm15 s.q pr.1 with + | none => none + | some (none, _) => none + | some (some q', Stmt.write w d) => + let b_bit := bit_pat w + match d with + | Dir.right => + some_mstate q' (push_stack b_bit 1 1 s.l) pr.2 + | Dir.left => + with_prod (pop1 s.l) (fun pl => + let r1 := push_stack b_bit 1 1 pr.2 + let r2 := push_stack (bit_pat pl.1) 1 1 r1 + some_mstate q' pl.2 r2)) + +theorem step_prim_sound (s s' : MState) (h : step_prim s = some s') : + (mstate_to_cfg s) [tm15]⊢* (mstate_to_cfg s') := by + unfold step_prim at h + simp only [with_prod_eq] at h + cases htm : tm15 s.q (pop1 s.r).1 with + | none => rw [htm] at h; contradiction + | some val => + rcases val with ⟨oq, stmt⟩ + cases oq with + | none => rw [htm] at h; contradiction + | some q' => + rcases stmt with ⟨w, d⟩ + rw [htm] at h + cases d with + | left => + simp only [with_prod_eq, some_mstate_eq, Option.some.injEq] at h + subst h + refine z0P tm15 _ _ ?_ + unfold mstate_to_cfg step + dsimp only + rw [pop1_sound s.r, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, htm] + dsimp [Tape.move, Tape.write] + rw [push_bit_sound (pop1 s.l).1, push_bit_sound w, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons, pop1_sound s.l, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + | right => + simp only [some_mstate_eq, Option.some.injEq] at h + subst h + refine z0P tm15 _ _ ?_ + unfold mstate_to_cfg step + dsimp only + rw [pop1_sound s.r, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, htm] + dsimp [Tape.move, Tape.write] + rw [push_bit_sound w] + +def has_head_bit1 : Stack → Bool + | [] => false + | top :: _ => top.pat % 2 == 1 + +def can_any_macro (s : MState) : Bool := + if s.q == 0 then + (match s.r with + | top :: _ => top.pat % 2 == 1 && !(top.width == 1 && 2 ≤ top.len) + | [] => false) || + ((pre_pair_l s.l || pre_absorb_l s.l) && can_parse_r s.r) + else if s.q == 1 || s.q == 2 then + has_head_bit1 s.l && has_head_bit1 s.r + else if s.q == 3 then + match s.r with + | [] => false + | top :: rest => + if top.width == 1 && top.pat == 0 then + if 1 < top.len then false else has_head_bit1 rest + else if top.width == 1 && top.pat == 1 && top.len == 1 then + match rest with + | [] => false + | b2 :: _ => !(b2.width == 1 && b2.pat == 0 && 2 ≤ b2.len) + else true + else false + +def run_prim : Nat → MState → Option MState + | 0, s => some s + | fuel + 1, s => + if (s.q = 5 && (pop1 s.r).1 = 1) || can_any_macro s then some s + else + match step_prim s with + | none => some s + | some s' => run_prim fuel s' + +theorem run_prim_sound (fuel : Nat) (s s' : MState) (h : run_prim fuel s = some s') : + (mstate_to_cfg s) [tm15]⊢* (mstate_to_cfg s') := by + induction fuel generalizing s with + | zero => simp [run_prim] at h; subst h; exact ⟨0, rfl⟩ + | succ fuel ih => + unfold run_prim at h + split_ifs at h with hstop + · simp only [Option.some.injEq] at h; subst h; exact ⟨0, rfl⟩ + · cases hp : step_prim s with + | none => rw [hp] at h; simp only [Option.some.injEq] at h; subst h; exact ⟨0, rfl⟩ + | some s1 => + rw [hp] at h + exact zSt (step_prim_sound s s1 hp) (ih s1 h) + +def step_prim_plus (s : MState) : Option MState := + match step_prim s with + | none => none + | some s1 => run_prim 24 s1 + +theorem step_prim_plus_sound (s s' : MState) (h : step_prim_plus s = some s') : + (mstate_to_cfg s) [tm15]⊢* (mstate_to_cfg s') := by + unfold step_prim_plus at h + cases hpr : step_prim s with + | none => rw [hpr] at h; contradiction + | some s1 => + rw [hpr] at h + exact zSt (step_prim_sound s s1 hpr) (run_prim_sound 24 s1 s' h) + +def step_m_q0 (s : MState) : Option MState := + let kbig := Nat.add (Nat.add s.l.length s.r.length) 4 + match try_pair_stack kbig s with + | some s' => some s' + | none => + match try_absorb_stack kbig s with + | some s' => some s' + | none => + match do_shift_right 0 3 1 1 1 s with + | some s' => some s' + | none => step_prim_plus s + +def step_m_q1 (s : MState) : Option MState := + match do_shift_left 1 1 1 0 1 s with + | some s' => some s' + | none => step_prim_plus s + +def step_m_q2 (s : MState) : Option MState := + match do_shift_left 2 2 3 1 2 s with + | some s' => some s' + | none => step_prim_plus s + +def step_m_q3 (s : MState) : Option MState := + match do_shift_right 3 1 1 0 1 s with + | some s' => some s' + | none => + match do_shift_right 3 3 2 1 1 s with + | some s' => some s' + | none => + match do_shift_right 3 4 10 14 4 s with + | some s' => some s' + | none => + match do_shift_right 3 4 5 7 4 s with + | some s' => some s' + | none => step_prim_plus s + +def step_m (s : MState) : Option MState := + match s.q.val with + | 0 => step_m_q0 s + | 1 => step_m_q1 s + | 2 => step_m_q2 s + | 3 => step_m_q3 s + | _ => step_prim_plus s + +theorem step_m_sound (s s' : MState) (h : step_m s = some s') : + (mstate_to_cfg s) [tm15]⊢* (mstate_to_cfg s') := by + unfold step_m at h + rcases hq : s.q.val with _ | _ | _ | _ | n <;> rw [hq] at h + · unfold step_m_q0 at h; dsimp only at h + cases hp : try_pair_stack (Nat.add (Nat.add s.l.length s.r.length) 4) s with + | some s1 => rw [hp] at h; simp only [Option.some.injEq] at h; subst h; exact try_pair_stack_sound _ s s1 hp + | none => + rw [hp] at h; dsimp only at h + cases ha : try_absorb_stack (Nat.add (Nat.add s.l.length s.r.length) 4) s with + | some s1 => rw [ha] at h; simp only [Option.some.injEq] at h; subst h; exact try_absorb_stack_sound _ s s1 ha + | none => + rw [ha] at h; dsimp only at h + cases hs : do_shift_right 0 3 1 1 1 s with + | some s1 => rw [hs] at h; simp only [Option.some.injEq] at h; subst h; exact do_shift_right_sound 0 3 1 1 1 7 s s1 rfl rfl sh_0_sound hs + | none => rw [hs] at h; dsimp only at h; exact step_prim_plus_sound s s' h + · unfold step_m_q1 at h + cases hs : do_shift_left 1 1 1 0 1 s with + | some s1 => rw [hs] at h; simp only [Option.some.injEq] at h; subst h; exact do_shift_left_sound 1 1 1 0 1 0 s s1 rfl rfl sh_1_sound hs + | none => rw [hs] at h; dsimp only at h; exact step_prim_plus_sound s s' h + · unfold step_m_q2 at h + cases hs : do_shift_left 2 2 3 1 2 s with + | some s1 => rw [hs] at h; simp only [Option.some.injEq] at h; subst h; exact do_shift_left_sound 2 2 3 1 2 1 s s1 rfl rfl sh_2_sound hs + | none => rw [hs] at h; dsimp only at h; exact step_prim_plus_sound s s' h + · unfold step_m_q3 at h + cases h3 : do_shift_right 3 1 1 0 1 s with + | some s1 => rw [h3] at h; simp only [Option.some.injEq] at h; subst h; exact do_shift_right_sound 3 1 1 0 1 0 s s1 rfl rfl sh_3_sound h3 + | none => + rw [h3] at h; dsimp only at h + cases h4 : do_shift_right 3 3 2 1 1 s with + | some s1 => rw [h4] at h; simp only [Option.some.injEq] at h; subst h; exact do_shift_right_sound 3 3 2 1 1 7 s s1 rfl rfl sh_4_sound h4 + | none => + rw [h4] at h; dsimp only at h + cases h5 : do_shift_right 3 4 10 14 4 s with + | some s1 => rw [h5] at h; simp only [Option.some.injEq] at h; subst h; exact do_shift_right_sound 3 4 10 14 4 14 s s1 rfl rfl sh_5_sound h5 + | none => + rw [h5] at h; dsimp only at h + cases h6 : do_shift_right 3 4 5 7 4 s with + | some s1 => rw [h6] at h; simp only [Option.some.injEq] at h; subst h; exact do_shift_right_sound 3 4 5 7 4 7 s s1 rfl rfl sh_6_sound h6 + | none => rw [h6] at h; dsimp only at h; exact step_prim_plus_sound s s' h + · exact step_prim_plus_sound s s' h + +def run_m : Nat → MState → Option MState + | 0, s => some s + | fuel + 1, s => + match step_m s with + | none => none + | some s' => run_m fuel s' + +theorem run_m_sound (fuel : Nat) (s s' : MState) (h : run_m fuel s = some s') : + (mstate_to_cfg s) [tm15]⊢* (mstate_to_cfg s') := by + induction fuel generalizing s with + | zero => + simp [run_m] at h; subst h; exact ⟨0, rfl⟩ + | succ fuel ih => + simp only [run_m] at h + cases hs : step_m s with + | none => rw [hs] at h; contradiction + | some s1 => + rw [hs] at h + exact zSt (step_m_sound s s1 hs) (ih s1 h) + +def is_halt_m (s : MState) : Bool := + s.q = 5 && (pop1 s.r).1 = 1 + +theorem is_halt_m_sound (s : MState) (h : is_halt_m s = true) : + step tm15 (mstate_to_cfg s) = none := by + unfold is_halt_m at h + simp only [Bool.and_eq_true, decide_eq_true_eq] at h + rcases h with ⟨hq, hr⟩ + unfold mstate_to_cfg step + dsimp only + rw [hq, pop1_sound s.r, hr, Turing.ListBlank.head_cons] + rfl + + + + + + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxHeartbeats 2000000 + +noncomputable def bnot_fast (x : Bool) : Bool := + @Bool.rec (fun _ => Bool) true false x + +noncomputable def band_fast (x y : Bool) : Bool := + @Bool.rec (fun _ => Bool) false y x + +noncomputable def bor_fast (x y : Bool) : Bool := + @Bool.rec (fun _ => Bool) y true x + +noncomputable def bxor_fast (x y : Bool) : Bool := + @Bool.rec (fun _ => Bool) y (@Bool.rec (fun _ => Bool) true false y) x + +noncomputable def nat_min_fast (x y : Nat) : Nat := + @Bool.rec (fun _ => Nat) y x (Nat.ble x y) + +noncomputable def nat_max_fast (x y : Nat) : Nat := + @Bool.rec (fun _ => Nat) x y (Nat.ble x y) + +noncomputable def withOptionFast {α β : Type} (o : Option α) (onNone : β) (onSome : α → β) : β := + @Option.rec α (fun _ => β) onNone onSome o + +noncomputable def matchStackFast {α : Type} (s : Stack) (onNil : α) (onCons : Block → Stack → α) : α := + @List.rec Block (fun _ => α) onNil (fun hd tl _ => onCons hd tl) s + +noncomputable def matchPartListFast {α : Type} (xs : PartList) (onNil : α) (onCons : Bool → Nat → PartList → α) : α := + @List.rec (Bool × Nat) (fun _ => α) onNil (fun hd tl _ => @Prod.rec Bool Nat (fun _ => α) (fun b k => onCons b k tl) hd) xs + +noncomputable def isEmptyPartListFast (xs : PartList) : Bool := + @List.rec (Bool × Nat) (fun _ => Bool) true (fun _ _ _ => false) xs + +def fin6_0 : Fin 6 := ⟨0, by decide⟩ +def fin6_1 : Fin 6 := ⟨1, by decide⟩ +def fin6_2 : Fin 6 := ⟨2, by decide⟩ +def fin6_3 : Fin 6 := ⟨3, by decide⟩ +def fin6_4 : Fin 6 := ⟨4, by decide⟩ +def fin6_5 : Fin 6 := ⟨5, by decide⟩ + +noncomputable def consBlock1 (p w l : Nat) (rest : Stack) : Stack := + @Nat.rec (fun _ => Stack) [] (fun p0 _ => + @Nat.rec (fun _ => Stack) [] (fun w0 _ => + @Nat.rec (fun _ => Stack) [] (fun l0 _ => + ⟨p0, w0, l0⟩ :: rest) (Nat.add 1 l)) (Nat.add 1 w)) (Nat.add 1 p) + +noncomputable def withProdFast {α β γ : Type} (p : α × β) (f : α → β → γ) : γ := + @Prod.rec α β (fun _ => γ) f p + +noncomputable def withProd3Fast {α β γ δ : Type} (p : α × β × γ) (f : α → β → γ → δ) : δ := + @Prod.rec α (β × γ) (fun _ => δ) (fun a bc => @Prod.rec β γ (fun _ => δ) (fun b c => f a b c) bc) p + +noncomputable def withNatFast {α : Type} (x : Nat) (f : Nat → α) : α := + @Nat.rec (fun _ => α) (f 0) (fun x0 _ => f x0) (Nat.add 1 x) + +noncomputable def withBoolFast {α : Type} (b : Bool) (f : Bool → α) : α := + @Bool.rec (fun _ => α) (f false) (f true) b + +noncomputable def withStackFast {α : Type} (s : Stack) (f : Stack → α) : α := + @List.rec Block (fun _ => α) (f []) (fun top rest _ => f (top :: rest)) s + +noncomputable def withPartFast {α : Type} (p : Bool × Nat) (f : Bool → Nat → α) : α := + @Prod.rec Bool Nat (fun _ => α) (fun b n => withBoolFast b (fun b0 => withNatFast n (fun n0 => f b0 n0))) p + +noncomputable def withPartListFast {α : Type} (xs : PartList) (f : PartList → α) : α := + @List.rec (Bool × Nat) (fun _ => α) (f []) (fun hd tl _ => withPartFast hd (fun b0 n0 => f ((b0, n0) :: tl))) xs + +noncomputable def someMStateFast (q : Fin 6) (l r : Stack) : Option MState := + withStackFast l (fun l' => withStackFast r (fun r' => some ⟨q, l', r'⟩)) + +noncomputable def stack_len_fast : Stack → Nat := + @List.rec Block (fun _ => Nat) 0 (fun _ _ ih => Nat.add ih 1) + +noncomputable def mkBlock_f_p : Nat → Nat → Nat → Block := +fun p w l => + @Nat.rec (fun _ => Block) ⟨0, 0, 0⟩ (fun p' _ => + @Nat.rec (fun _ => Block) ⟨0, 0, 0⟩ (fun w' _ => + @Nat.rec (fun _ => Block) ⟨0, 0, 0⟩ (fun l' _ => + ⟨p', w', l'⟩) (Nat.add 1 l)) (Nat.add 1 w)) (Nat.add 1 p) + +noncomputable def rot1_f_p : Nat → Nat → Nat := +fun w p => + @Bool.rec (fun _ => Nat) + (Nat.add (Nat.shiftRight p 1) (Nat.mul (Nat.land p 1) (Nat.shiftLeft 1 (Nat.sub w 1)))) + p + (Nat.ble w 1) + +noncomputable def rot_mod_f_p : Nat → Nat → Nat → Nat := +fun w n p => + @Bool.rec (fun _ => Nat) + (@Bool.rec (fun _ => Nat) + (rot_k w n p) + (withNatFast (Nat.mod n w) (fun r => + @Bool.rec (fun _ => Nat) + (Nat.add (Nat.shiftRight p r) (Nat.shiftLeft (Nat.land p (Nat.sub (Nat.shiftLeft 1 r) 1)) (Nat.sub w r))) + p + (Nat.beq r 0))) + (band_fast (Nat.ble 2 w) (band_fast (Nat.ble w 4) (band_fast (Nat.ble p 15) (Nat.ble p (Nat.sub (Nat.shiftLeft 1 w) 1)))))) + p + (bor_fast (Nat.beq p 0) (band_fast (Nat.beq w 1) (Nat.beq p 1))) + +noncomputable def bit_of_bool_f_p : Nat → Bool := +fun x => Nat.beq (Nat.land x 1) 1 + +noncomputable def push_stack_aux_fast : Stack → Nat → Nat → Nat → Stack := + @List.rec Block (fun _ => Nat → Nat → Nat → Stack) + (fun p w l => @Bool.rec (fun _ => Stack) (⟨p, w, l⟩ :: []) [] (Nat.beq p 0)) + (fun top rest ih p w l => + @Bool.rec (fun _ => Stack) + (⟨p, w, l⟩ :: top :: rest) + (withNatFast (Nat.add l top.len) (fun nl => ih p w nl)) + (band_fast (Nat.beq w top.width) (Nat.beq (rot_mod_f_p w l p) top.pat))) + +noncomputable def push_stack_fast (p w l : Nat) (s : Stack) : Stack := + withNatFast l (fun l0 => + @Bool.rec (fun _ => Stack) + (withNatFast p (fun p0 => withNatFast w (fun w0 => push_stack_aux_fast s p0 w0 l0))) + s + (Nat.beq l0 0)) + +noncomputable def drop_stack_aux_fast : Stack → Nat → Stack := + @List.rec Block (fun _ => Nat → Stack) + (fun _ => []) + (fun top rest ih n => + @Bool.rec (fun _ => Stack) + (consBlock1 (rot_mod_f_p top.width n top.pat) top.width (Nat.sub top.len n) rest) + (withNatFast (Nat.sub n top.len) (fun rem => + @Bool.rec (fun _ => Stack) (ih rem) rest (Nat.beq rem 0))) + (Nat.ble top.len n)) + +noncomputable def drop_stack_fast : Nat → Stack → Stack := +fun n s => + withNatFast n (fun n0 => + @Bool.rec (fun _ => Stack) (drop_stack_aux_fast s n0) s (Nat.beq n0 0)) + +noncomputable def pop1_b_fast : Stack → Bool × Stack := +fun s => + @List.rec Block (fun _ => Bool × Stack) + (false, []) + (fun top rest ih => + @Bool.rec (fun _ => Bool × Stack) + (bit_of_bool_f_p top.pat, + @Bool.rec (fun _ => Stack) + (consBlock1 (rot1_f_p top.width top.pat) top.width (Nat.sub top.len 1) rest) + rest + (Nat.beq top.len 1)) + ih + (Nat.beq top.len 0)) + s + +noncomputable def pop_word_f_p (bit_of_bool_f : Nat → Bool) (pop1_b_f : Stack → Bool × Stack) : Nat → Nat → Stack → Option Stack := +fun pat w s => + @Nat.rec (fun _ => Nat → Stack → Option Stack) + (fun _ s => withStackFast s some) + (fun _ ih pat s => + withProdFast (pop1_b_f s) (fun r1 r2 => + @Bool.rec (fun _ => Option Stack) none (withNatFast (Nat.shiftRight pat 1) (fun np => ih np r2)) + (bnot_fast (bxor_fast r1 (bit_of_bool_f pat))))) + w pat s + +noncomputable def fast_match_f_p : Nat → Nat → Block → Bool := +fun pat w top => + @Bool.rec (fun _ => Bool) + (0 < w && w ≤ top.len && rot_k top.width w top.pat == top.pat && + pat_word top.width top.pat w == word_of pat w) + (band_fast (Nat.ble w top.len) + (let mul := @Bool.rec (fun _ => Nat) + (@Bool.rec (fun _ => Nat) + (@Bool.rec (fun _ => Nat) 273 585 (Nat.beq top.width 3)) + 1365 (Nat.beq top.width 2)) + 4095 (Nat.beq top.width 1) + withNatFast (Nat.mul top.pat mul) (fun pm => + band_fast (Nat.beq (Nat.land (Nat.shiftRight pm w) (Nat.sub (Nat.shiftLeft 1 top.width) 1)) top.pat) + (Nat.beq (Nat.land pm (Nat.sub (Nat.shiftLeft 1 w) 1)) pat)))) + (band_fast (Nat.ble 1 w) + (band_fast (Nat.ble w 4) + (band_fast (Nat.ble 1 top.width) + (band_fast (Nat.ble top.width 4) + (band_fast (Nat.ble top.pat (Nat.sub (Nat.shiftLeft 1 top.width) 1)) + (Nat.ble pat (Nat.sub (Nat.shiftLeft 1 w) 1))))))) + +noncomputable def count_stack_mut_f_p (drop_stack_f : Nat → Stack → Stack) (pop_word_f : Nat → Nat → Stack → Option Stack) (fast_match_f : Nat → Nat → Block → Bool) : Nat → Nat → Nat → Nat → Stack → Nat × Stack := +fun pat w fuel limit s => + @Nat.rec (fun _ => Nat → Stack → Nat × Stack) + (fun _ s => (0, s)) + (fun _ ih limit s => + @Bool.rec (fun _ => Nat × Stack) + (matchStackFast s + (0, []) + (fun top rest => + @Bool.rec (fun _ => Nat × Stack) + (withOptionFast (pop_word_f pat w (top :: rest)) + (0, top :: rest) + (fun s1 => + withNatFast (Nat.sub limit 1) (fun nlim => + withProdFast (ih nlim s1) (fun r1 r2 => + withNatFast (Nat.add 1 r1) (fun c => (c, r2)))))) + (withNatFast (nat_min_fast limit (Nat.div top.len w)) (fun bulk => + withNatFast (Nat.sub limit bulk) (fun nlim => + withStackFast (drop_stack_f (Nat.mul bulk w) (top :: rest)) (fun s_drop => + withProdFast (ih nlim s_drop) (fun r1 r2 => + withNatFast (Nat.add bulk r1) (fun c => (c, r2))))))) + (fast_match_f pat w top))) + (0, s) + (Nat.beq limit 0)) + fuel limit s + +noncomputable def mkPart_f_p : Bool → Nat → PartList → PartList := +fun b k xs => + withNatFast k (fun k0 => + @Bool.rec (fun _ => PartList) + (withBoolFast b (fun b0 => + matchPartListFast xs + (@Bool.rec (fun _ => PartList) [] [(true, k0)] b0) + (fun b2 k2 rest => + @Bool.rec (fun _ => PartList) + ((b0, k0) :: (b2, k2) :: rest) + (withNatFast (Nat.add k0 k2) (fun nk => (b0, nk) :: rest)) + (bnot_fast (bxor_fast b0 b2))))) + xs + (Nat.beq k0 0)) + +noncomputable def bsize_parts_f_p : PartList → Nat := +@List.rec (Bool × Nat) (fun _ => Nat) 0 (fun hd _ ih => @Prod.rec Bool Nat (fun _ => Nat) (fun _ d => Nat.add d ih) hd) + +noncomputable def put_l_parts_f_p (push_stack_f : Nat → Nat → Nat → Stack → Stack) : PartList → Stack → Stack := +@List.rec (Bool × Nat) (fun _ => Stack → Stack) + (fun s => s) + (fun hd _ ih s => + @Prod.rec Bool Nat (fun _ => Stack) (fun b d => + push_stack_f (@Bool.rec (fun _ => Nat) 1 14 b) (@Bool.rec (fun _ => Nat) 1 4 b) (Nat.mul d 4) (ih s)) hd) + +noncomputable def put_l_stack_f_p (push_stack_f : Nat → Nat → Nat → Stack → Stack) (bsize_parts_f : PartList → Nat) (put_l_parts_f : PartList → Stack → Stack) : PartList → Nat → Stack → Stack := +fun xs n s => + withNatFast (bsize_parts_f xs) (fun bs => + withStackFast (@Bool.rec (fun _ => Stack) s (push_stack_f 1 1 (Nat.mul (Nat.sub n bs) 4) s) (Nat.ble (Nat.add bs 1) n)) (fun s1 => + put_l_parts_f xs s1)) + +noncomputable def put_r_rec_f_p (push_stack_f : Nat → Nat → Nat → Stack → Stack) : PartList → Nat → Stack → Stack := +@List.rec (Bool × Nat) (fun _ => Nat → Stack → Stack) + (fun k s => push_stack_f 1 3 (Nat.sub (Nat.mul k 3) 2) s) + (fun hd _ ih k s => + @Prod.rec Bool Nat (fun _ => Stack) (fun b d => + @Bool.rec (fun _ => Stack) + (@Bool.rec (fun _ => Stack) + (withNatFast (Nat.sub k d) (fun nk => + push_stack_f (@Bool.rec (fun _ => Nat) 1 0 b) (@Bool.rec (fun _ => Nat) 3 1 b) (Nat.mul d 3) (ih nk s))) + (push_stack_f (@Bool.rec (fun _ => Nat) 1 0 b) (@Bool.rec (fun _ => Nat) 3 1 b) (Nat.sub (Nat.mul d 3) 2) s) + (Nat.ble k d)) + (ih k s) + (Nat.beq d 0)) hd) + +noncomputable def parse_step_l_f_p (drop_stack_f : Nat → Stack → Stack) (pop_word_f : Nat → Nat → Stack → Option Stack) : Nat → Stack → Option (Bool × Nat × Stack) := +fun limit s => + matchStackFast s + none + (fun top rest => + @Bool.rec (fun _ => Option (Bool × Nat × Stack)) + (@Bool.rec (fun _ => Option (Bool × Nat × Stack)) + (withOptionFast (pop_word_f 15 4 (top :: rest)) + (withOptionFast (pop_word_f 14 4 (top :: rest)) + none + (fun s1 => some (true, 1, s1))) + (fun s1 => some (false, 1, s1))) + (withNatFast (nat_min_fast limit (Nat.div top.len 4)) (fun k => + withStackFast (drop_stack_f (Nat.mul k 4) (top :: rest)) (fun s_drop => + some (true, k, s_drop)))) + (band_fast (Nat.beq top.width 4) (band_fast (Nat.beq top.pat 14) (Nat.ble 4 top.len)))) + (withNatFast (nat_min_fast limit (Nat.div top.len 4)) (fun k => + withStackFast (drop_stack_f (Nat.mul k 4) (top :: rest)) (fun s_drop => + some (false, k, s_drop)))) + (band_fast (Nat.beq top.width 1) (band_fast (Nat.beq top.pat 1) (Nat.ble 4 top.len)))) + +noncomputable def parse_l_f_p (parse_step_l_f : Nat → Stack → Option (Bool × Nat × Stack)) : Nat → Nat → Stack → PartList × Stack := +@Nat.rec (fun _ => Nat → Stack → PartList × Stack) + (fun _ s => ([], s)) + (fun _ ih limit s => + @Bool.rec (fun _ => PartList × Stack) + (withOptionFast (parse_step_l_f limit s) + ([], s) + (fun p => + withProd3Fast p (fun bit k s1 => + withNatFast (Nat.sub limit k) (fun nlim => + withProdFast (ih nlim s1) (fun r1 r2 => + @Bool.rec (fun _ => PartList × Stack) + ((bit, k) :: r1, r2) + ([], s) + (band_fast (bnot_fast bit) (isEmptyPartListFast r1))))))) + ([], s) + (Nat.beq limit 0)) + +noncomputable def parse_step_r_f_p (drop_stack_f : Nat → Stack → Stack) (pop_word_f : Nat → Nat → Stack → Option Stack) : Nat → Stack → Option (Bool × Nat × Stack) := +fun limit s => + matchStackFast s + none + (fun top rest => + @Bool.rec (fun _ => Option (Bool × Nat × Stack)) + (@Bool.rec (fun _ => Option (Bool × Nat × Stack)) + (withOptionFast (pop_word_f 1 3 (top :: rest)) + (withOptionFast (pop_word_f 0 3 (top :: rest)) + none + (fun s1 => some (true, 1, s1))) + (fun s1 => some (false, 1, s1))) + (withNatFast (nat_min_fast limit (Nat.div top.len 3)) (fun k => + withStackFast (drop_stack_f (Nat.mul k 3) (top :: rest)) (fun s_drop => + some (true, k, s_drop)))) + (band_fast (Nat.beq top.width 1) (band_fast (Nat.beq top.pat 0) (Nat.ble 3 top.len)))) + (withNatFast (nat_min_fast limit (Nat.div top.len 3)) (fun k => + withStackFast (drop_stack_f (Nat.mul k 3) (top :: rest)) (fun s_drop => + some (false, k, s_drop)))) + (band_fast (Nat.beq top.width 3) (band_fast (Nat.beq top.pat 1) (Nat.ble 3 top.len)))) + +noncomputable def parse_r_f_p (push_stack_f : Nat → Nat → Nat → Stack → Stack) (pop1_b_f : Stack → Bool × Stack) (parse_step_r_f : Nat → Stack → Option (Bool × Nat × Stack)) : Nat → Nat → Stack → PartList × Stack := +@Nat.rec (fun _ => Nat → Stack → PartList × Stack) + (fun _ s => ([], s)) + (fun _ ih limit s => + @Bool.rec (fun _ => PartList × Stack) + (matchStackFast s + ([(true, limit)], []) + (fun top rest => + withOptionFast (parse_step_r_f limit (top :: rest)) + (withProdFast (pop1_b_f (top :: rest)) (fun p1 p2 => + @Bool.rec (fun _ => PartList × Stack) ([], top :: rest) (withStackFast p2 (fun p2' => ([(true, 1)], p2'))) (bnot_fast p1))) + (fun p => + withProd3Fast p (fun bit k s1 => + withNatFast (Nat.sub limit k) (fun nlim => + withProdFast (ih nlim s1) (fun r1 r2 => + @Bool.rec (fun _ => PartList × Stack) + ((bit, k) :: r1, r2) + (@Bool.rec (fun _ => PartList × Stack) ([], top :: rest) (withStackFast (push_stack_f 0 1 2 s1) (fun sp => ([(true, k)], sp))) bit) + (isEmptyPartListFast r1))))))) + ([], s) + (Nat.beq limit 0)) + +noncomputable def sub_lsb_f_p(mkPart_f : Bool → Nat → PartList → PartList) : Nat → Bool → PartList → PartList → Option PartList := +@Nat.rec (fun _ => Bool → PartList → PartList → Option PartList) + (fun _ _ _ => none) + (fun _ ih c xs ys => + matchPartListFast xs + (@Bool.rec (fun _ => Option PartList) none (some []) + (band_fast (isEmptyPartListFast ys) (bnot_fast c))) + (fun px kx xrest => + matchPartListFast ys + (@Bool.rec (fun _ => Option PartList) + (@Bool.rec (fun _ => Option PartList) + (withBoolFast (bxor_fast px c) (fun s1_1 => + withBoolFast (band_fast (bnot_fast px) c) (fun s1_2 => + @Bool.rec (fun _ => Option PartList) + (withOptionFast (ih s1_2 xrest []) + none + (fun out => some (mkPart_f s1_1 1 out))) + (withBoolFast (bxor_fast px s1_2) (fun s2_1 => + withBoolFast (band_fast (bnot_fast px) s1_2) (fun s2_2 => + withOptionFast (ih s2_2 xrest []) + none + (fun out => some (mkPart_f s1_1 1 (mkPart_f s2_1 (Nat.sub kx 1) out)))))) + (Nat.ble 2 kx)))) + (ih c xrest []) + (Nat.beq kx 0)) + (some ((px, kx) :: xrest)) + (bnot_fast c)) + (fun qy ly yrest => + withNatFast (nat_min_fast kx ly) (fun n => + withPartListFast (@Bool.rec (fun _ => PartList) xrest ((px, Nat.sub kx n) :: xrest) (Nat.ble (Nat.add n 1) kx)) (fun nx => + withPartListFast (@Bool.rec (fun _ => PartList) yrest ((qy, Nat.sub ly n) :: yrest) (Nat.ble (Nat.add n 1) ly)) (fun ny => + @Bool.rec (fun _ => Option PartList) + (withBoolFast (bxor_fast px qy) (fun pxq => + withBoolFast (bxor_fast pxq c) (fun s1_1 => + withBoolFast (bor_fast (band_fast (bnot_fast px) (bor_fast qy c)) (band_fast qy c)) (fun s1_2 => + @Bool.rec (fun _ => Option PartList) + (withOptionFast (ih s1_2 nx ny) + none + (fun out => some (mkPart_f s1_1 1 out))) + (withBoolFast (bxor_fast pxq s1_2) (fun s2_1 => + withBoolFast (bor_fast (band_fast (bnot_fast px) (bor_fast qy s1_2)) (band_fast qy s1_2)) (fun s2_2 => + withOptionFast (ih s2_2 nx ny) + none + (fun out => some (mkPart_f s1_1 1 (mkPart_f s2_1 (Nat.sub n 1) out)))))) + (Nat.ble 2 n))))) + (ih c nx ny) + (Nat.beq n 0))))))) + +noncomputable def sub_lsb_checked_f_p (sub_lsb_f : Nat → Bool → PartList → PartList → Option PartList) : + Nat → Nat → Nat → PartList → PartList → Option PartList := +fun fuel n k a b => + @Bool.rec (fun _ => Option PartList) (sub_lsb_f fuel false a b) none (Nat.ble (Nat.add n 1) k) + +noncomputable def drop_mult3_fast (top : Block) (rest : Stack) : Stack := + withNatFast (Nat.mod top.len 3) (fun rem => + @Bool.rec (fun _ => Stack) (consBlock1 top.pat top.width rem rest) rest (Nat.beq rem 0)) + +noncomputable def choose_limit_r_f_p (drop_mult3_f : Block → Stack → Stack) (pop1_b_f : Stack → Bool × Stack) (pop_word_f : Nat → Nat → Stack → Option Stack) : Nat → Nat → Nat → Stack → Nat := +fun n fuel done r => + @Nat.rec (fun _ => Nat → Stack → Nat) + (fun _ _ => Nat.add n 1) + (fun _ ih done s => + matchStackFast s + (@Bool.rec (fun _ => Nat) (Nat.add done 1) (Nat.add n 1) (Nat.ble done n)) + (fun top rest => + @Bool.rec (fun _ => Nat) + (@Bool.rec (fun _ => Nat) + (withOptionFast (pop_word_f 1 3 (top :: rest)) + (withOptionFast (pop_word_f 0 3 (top :: rest)) + (@Bool.rec (fun _ => Nat) done (Nat.add done 1) (bnot_fast (pop1_b_f (top :: rest)).1)) + (fun r1 => + @Bool.rec (fun _ => Nat) + (withNatFast (Nat.add done 1) (fun nd => ih nd r1)) + (Nat.add done 1) + (Nat.ble n done))) + (fun r1 => withNatFast (Nat.add done 1) (fun nd => ih nd r1))) + (withNatFast (Nat.add done (Nat.div top.len 3)) (fun next_done => + @Bool.rec (fun _ => Nat) + (ih next_done (drop_mult3_f top rest)) + (nat_min_fast (nat_max_fast (Nat.add n 2) (Nat.add done 2)) next_done) + (Nat.ble (Nat.add n 1) next_done))) + (band_fast (Nat.beq top.width 1) (band_fast (Nat.beq top.pat 0) (Nat.ble 3 top.len)))) + (withNatFast (Nat.add done (Nat.div top.len 3)) (fun next_done => + ih next_done (drop_mult3_f top rest))) + (band_fast (Nat.beq top.width 3) (band_fast (Nat.beq top.pat 1) (Nat.ble 3 top.len))))) + fuel done r + +noncomputable def push_prefix_l_f_p (push_stack_f : Nat → Nat → Nat → Stack → Stack) : Stack → Stack := +fun l => push_stack_f 1 1 1 (push_stack_f 0 1 1 (push_stack_f 1 1 3 l)) + +noncomputable def build_vprime_f_p (mkPart_f : Bool → Nat → PartList → PartList) : Nat → Nat → PartList := +fun n m_use => + @Bool.rec (fun _ => PartList) + (mkPart_f true 1 []) + (mkPart_f true 1 (mkPart_f false n (mkPart_f true (Nat.sub m_use 1) []))) + (Nat.ble 2 m_use) + +noncomputable def can_pair_f : Stack → Bool := + @List.rec Block (fun _ => Bool) + false + (fun top rest ih => + @Bool.rec (fun _ => Bool) + (@Bool.rec (fun _ => Bool) + (@Bool.rec (fun _ => Bool) + true + false + (band_fast (Nat.beq top.width 4) (band_fast (Nat.beq top.pat 13) (Nat.ble 4 top.len)))) + true + (band_fast (Nat.beq top.width 4) (band_fast (Nat.beq top.pat 14) (Nat.ble 4 top.len)))) + (matchStackFast rest + false + (fun _ _ => @Bool.rec (fun _ => Bool) true ih (Nat.beq (Nat.mod top.len 4) 0))) + (band_fast (Nat.beq top.width 1) (Nat.beq top.pat 1))) + +noncomputable def can_absorb_f : Stack → Bool := + @List.rec Block (fun _ => Bool) + false + (fun top rest ih => + @Bool.rec (fun _ => Bool) + (@Bool.rec (fun _ => Bool) + (@Bool.rec (fun _ => Bool) + true + false + (band_fast (Nat.beq top.width 4) (band_fast (Nat.beq top.pat 14) (Nat.ble 4 top.len)))) + true + (band_fast (Nat.beq top.width 4) (band_fast (Nat.beq top.pat 13) (Nat.ble 4 top.len)))) + (matchStackFast rest + false + (fun _ _ => @Bool.rec (fun _ => Bool) true ih (Nat.beq (Nat.mod top.len 4) 0))) + (band_fast (Nat.beq top.width 1) (Nat.beq top.pat 1))) + +noncomputable def pre_pair_l_f (can_pair_fn : Stack → Bool) (s : Stack) : Bool := + matchStackFast s false (fun b1 r1 => + matchStackFast r1 false (fun b2 r2 => + matchStackFast r2 + (band_fast (Nat.beq b1.pat 1) (band_fast (Nat.beq b1.width 1) (Nat.beq b1.len 1))) + (fun b3 rest => + @Bool.rec (fun _ => Bool) false + (@Bool.rec (fun _ => Bool) true + (@Bool.rec (fun _ => Bool) true + (withNatFast (Nat.sub b3.len 3) (fun rem => + can_pair_fn (@Bool.rec (fun _ => Stack) (consBlock1 1 1 rem rest) rest (Nat.beq rem 0)))) + (band_fast (Nat.beq b3.pat 1) (band_fast (Nat.beq b3.width 1) (Nat.ble 3 b3.len)))) + (band_fast (Nat.beq b2.pat 0) (band_fast (Nat.beq b2.width 1) (Nat.beq b2.len 1)))) + (band_fast (Nat.beq b1.pat 1) (band_fast (Nat.beq b1.width 1) (Nat.beq b1.len 1)))))) + +noncomputable def pre_absorb_l_f (can_absorb_fn : Stack → Bool) (s : Stack) : Bool := + matchStackFast s false (fun b1 r1 => + matchStackFast r1 false (fun b2 r2 => + matchStackFast r2 + (band_fast (Nat.beq b1.pat 1) (band_fast (Nat.beq b1.width 1) (Nat.beq b1.len 1))) + (fun b3 rest => + @Bool.rec (fun _ => Bool) false + (@Bool.rec (fun _ => Bool) true + (@Bool.rec (fun _ => Bool) true + (withNatFast (Nat.sub b3.len 3) (fun rem => + can_absorb_fn (@Bool.rec (fun _ => Stack) (consBlock1 1 1 rem rest) rest (Nat.beq rem 0)))) + (band_fast (Nat.beq b3.pat 1) (band_fast (Nat.beq b3.width 1) (Nat.ble 3 b3.len)))) + (band_fast (Nat.beq b2.pat 0) (band_fast (Nat.beq b2.width 1) (Nat.beq b2.len 1)))) + (band_fast (Nat.beq b1.pat 1) (band_fast (Nat.beq b1.width 1) (Nat.beq b1.len 1)))))) + +noncomputable def can_parse_r_f (s : Stack) : Bool := + matchStackFast s true (fun top _ => + bnot_fast (band_fast (Nat.beq top.width 3) (band_fast (Nat.beq top.pat 1) (Nat.beq (Nat.mod top.len 3) 1)))) + +noncomputable def do_shift_right_f_p (push_stack_f : Nat → Nat → Nat → Stack → Stack) (pop_word_f : Nat → Nat → Stack → Option Stack) (count_stack_mut_f : Nat → Nat → Nat → Nat → Stack → Nat × Stack) : Nat → Fin 6 → Nat → Nat → Nat → Nat → MState → Option MState := +fun k128 => +fun sq sw sin sout sout_w s => + @Bool.rec (fun _ => Option MState) none + (let target2 := Nat.add sin (Nat.mul sin (Nat.shiftLeft 1 sw)) + withOptionFast (pop_word_f target2 (Nat.mul 2 sw) s.r) + none + (fun _ => + withProdFast (count_stack_mut_f sin sw k128 100000000 s.r) (fun r1 r2 => + someMStateFast sq (push_stack_f sout sout_w (Nat.mul r1 sw) s.l) r2))) + (Nat.beq s.q.val sq.val) + +noncomputable def do_shift_left_f_p (bit_of_bool_f : Nat → Bool) (push_stack_f : Nat → Nat → Nat → Stack → Stack) (pop1_b_f : Stack → Bool × Stack) (pop_word_f : Nat → Nat → Stack → Option Stack) (count_stack_mut_f : Nat → Nat → Nat → Nat → Stack → Nat × Stack) : Nat → Fin 6 → Nat → Nat → Nat → Nat → MState → Option MState := +fun k128 => +fun sq sw sin sout sout_w s => + @Bool.rec (fun _ => Option MState) none + (let target2 := Nat.add sin (Nat.mul sin (Nat.shiftLeft 1 sw)) + withProdFast (pop1_b_f s.r) (fun pr1 pr2 => + @Bool.rec (fun _ => Option MState) none + (@Bool.rec (fun _ => Option MState) none + (let l1 := push_stack_f (@Bool.rec (fun _ => Nat) 0 1 pr1) 1 1 s.l + withProdFast (count_stack_mut_f sin sw k128 100000000 l1) (fun r1 r2 => + withProdFast (pop1_b_f r2) (fun pl1 pl2 => + someMStateFast sq pl2 (push_stack_f (@Bool.rec (fun _ => Nat) 0 1 pl1) 1 1 (push_stack_f sout sout_w (Nat.mul r1 sw) pr2))))) + (withOptionFast (pop_word_f (Nat.shiftRight target2 1) (Nat.sub (Nat.mul 2 sw) 1) s.l) false (fun _ => true))) + (bnot_fast (bxor_fast pr1 (bit_of_bool_f target2))))) + (Nat.beq s.q.val sq.val) + +noncomputable def try_pair_stack_f_p + (pre_pair_l_fn : Stack → Bool) + (can_parse_r_fn : Stack → Bool) + (can_pair_fn : Stack → Bool) + (pop_word_f : Nat → Nat → Stack → Option Stack) + (bsize_parts_f : PartList → Nat) + (put_l_stack_f : PartList → Nat → Stack → Stack) + (put_r_rec_f : PartList → Nat → Stack → Stack) + (parse_l_f : Nat → Nat → Stack → PartList × Stack) + (parse_r_f : Nat → Nat → Stack → PartList × Stack) + (sub_lsb_checked_f : Nat → Nat → Nat → PartList → PartList → Option PartList) + (choose_limit_r_f : Nat → Nat → Nat → Stack → Nat) + (push_prefix_l_f : Stack → Stack) : Nat → MState → Option MState := +fun k128 => +fun s => + @Bool.rec (fun _ => Option MState) none + (@Bool.rec (fun _ => Option MState) none + (withOptionFast (pop_word_f 29 5 s.l) + none + (fun lc => + @Bool.rec (fun _ => Option MState) none + (withNatFast k128 (fun k128 => + withProdFast (parse_l_f k128 100000000 lc) (fun rl1 rl2 => + @Bool.rec (fun _ => Option MState) + (withNatFast (bsize_parts_f rl1) (fun n => + withNatFast (choose_limit_r_f n k128 0 s.r) (fun lim_r => + @Bool.rec (fun _ => Option MState) + (withProdFast (parse_r_f k128 lim_r s.r) (fun rr1 rr2 => + @Bool.rec (fun _ => Option MState) + (withNatFast (bsize_parts_f rr1) (fun k => + withOptionFast (sub_lsb_checked_f k128 n k rl1 rr1) + (withOptionFast (sub_lsb_checked_f k128 k n rr1 rl1) + none + (fun out => someMStateFast fin6_0 (push_prefix_l_f (put_l_stack_f [] n rl2)) (put_r_rec_f out k rr2))) + (fun out => someMStateFast fin6_0 (push_prefix_l_f (put_l_stack_f out n rl2)) (put_r_rec_f [] k rr2)))) + none + (isEmptyPartListFast rr1))) + none + (Nat.beq lim_r 0)))) + none + (isEmptyPartListFast rl1)))) + (can_pair_fn lc))) + (band_fast (pre_pair_l_fn s.l) (can_parse_r_fn s.r))) + (Nat.beq s.q.val 0) + +noncomputable def try_absorb_stack_f_p + (pre_absorb_l_fn : Stack → Bool) + (can_parse_r_fn : Stack → Bool) + (can_absorb_fn : Stack → Bool) + (push_stack_f : Nat → Nat → Nat → Stack → Stack) + (pop_word_f : Nat → Nat → Stack → Option Stack) + (count_stack_mut_f : Nat → Nat → Nat → Nat → Stack → Nat × Stack) + (bsize_parts_f : PartList → Nat) + (put_r_rec_f : PartList → Nat → Stack → Stack) + (parse_r_f : Nat → Nat → Stack → PartList × Stack) + (sub_lsb_f : Nat → Bool → PartList → PartList → Option PartList) + (choose_limit_r_f : Nat → Nat → Nat → Stack → Nat) + (push_prefix_l_f : Stack → Stack) + (build_vprime_f : Nat → Nat → PartList) : Nat → MState → Option MState := +fun k128 => +fun s => + @Bool.rec (fun _ => Option MState) none + (@Bool.rec (fun _ => Option MState) none + (withOptionFast (pop_word_f 29 5 s.l) + none + (fun lc0 => + @Bool.rec (fun _ => Option MState) none + (withNatFast k128 (fun k128 => + withProdFast (count_stack_mut_f 15 4 k128 100000000 lc0) (fun r1_1 r1_2 => + withProdFast (count_stack_mut_f 13 4 k128 100000000 r1_2) (fun rm_1 _ => + @Bool.rec (fun _ => Option MState) + (withNatFast (choose_limit_r_f (Nat.add r1_1 rm_1) k128 0 s.r) (fun lim_r => + @Bool.rec (fun _ => Option MState) + (withProdFast (parse_r_f k128 lim_r s.r) (fun rr_1 rr_2 => + @Bool.rec (fun _ => Option MState) + (withNatFast (bsize_parts_f rr_1) (fun k => + withNatFast (nat_min_fast rm_1 (@Bool.rec (fun _ => Nat) 1 (Nat.sub k r1_1) (Nat.ble (Nat.add r1_1 1) k))) (fun m_init => + @Bool.rec (fun _ => Option MState) + (let res_sub : Option (Nat × PartList) := + withOptionFast (sub_lsb_f k128 false rr_1 (build_vprime_f r1_1 m_init)) + (@Bool.rec (fun _ => Option (Nat × PartList)) + (withNatFast (Nat.sub m_init 1) (fun m_m1 => + withOptionFast (sub_lsb_f k128 false rr_1 (build_vprime_f r1_1 m_m1)) + none + (fun out => some (m_m1, out)))) + none + (Nat.ble m_init 1)) + (fun out => some (m_init, out)) + withOptionFast res_sub + none + (fun pair_out => + withProdFast pair_out (fun m_use out => + withProdFast (count_stack_mut_f 13 4 k128 m_use r1_2) (fun r2_1 r2_2 => + @Bool.rec (fun _ => Option MState) none + (someMStateFast fin6_0 (push_prefix_l_f (push_stack_f 14 4 (Nat.mul (Nat.add r1_1 r2_1) 4) r2_2)) (put_r_rec_f out k rr_2)) + (Nat.beq r2_1 m_use))))) + none + (Nat.beq m_init 0)))) + none + (isEmptyPartListFast rr_1))) + none + (Nat.beq lim_r 0))) + none + (Nat.beq rm_1 0))))) + (can_absorb_fn lc0))) + (band_fast (pre_absorb_l_fn s.l) (can_parse_r_fn s.r))) + (Nat.beq s.q.val 0) + +noncomputable def step_prim_f_p(push_stack_f : Nat → Nat → Nat → Stack → Stack) (pop1_b_f : Stack → Bool × Stack) : MState → Option MState := +fun s => + withProdFast (pop1_b_f s.r) (fun pr1 pr2 => + let step_r := fun (nq : Fin 6) (br : Nat) => + someMStateFast nq (push_stack_f br 1 1 s.l) pr2 + let step_l := fun (nq : Fin 6) (br : Nat) => + withProdFast (pop1_b_f s.l) (fun pl1 pl2 => + someMStateFast nq pl2 (push_stack_f (@Bool.rec (fun _ => Nat) 0 1 pl1) 1 1 (push_stack_f br 1 1 pr2))) + let qv := s.q.val + @Bool.rec (fun _ => Option MState) + (@Bool.rec (fun _ => Option MState) + (@Bool.rec (fun _ => Option MState) + (@Bool.rec (fun _ => Option MState) + (@Bool.rec (fun _ => Option MState) + (@Bool.rec (fun _ => Option MState) + none + (@Bool.rec (fun _ => Option MState) (step_l fin6_1 0) none pr1) + (Nat.beq qv 5)) + (@Bool.rec (fun _ => Option MState) (step_r fin6_3 1) (step_r fin6_5 0) pr1) + (Nat.beq qv 4)) + (@Bool.rec (fun _ => Option MState) (step_r fin6_0 1) (step_r fin6_3 0) pr1) + (Nat.beq qv 3)) + (@Bool.rec (fun _ => Option MState) (step_r fin6_3 1) (step_l fin6_4 0) pr1) + (Nat.beq qv 2)) + (@Bool.rec (fun _ => Option MState) (step_l fin6_2 1) (step_l fin6_1 0) pr1) + (Nat.beq qv 1)) + (@Bool.rec (fun _ => Option MState) (step_l fin6_1 1) (step_r fin6_4 1) pr1) + (Nat.beq qv 0)) + +noncomputable def has_head_bit1_f (s : Stack) : Bool := + matchStackFast s false (fun top _ => Nat.beq (Nat.land top.pat 1) 1) + +noncomputable def can_any_macro_f + (pre_pair_l_fn : Stack → Bool) + (pre_absorb_l_fn : Stack → Bool) + (can_parse_r_fn : Stack → Bool) + (s : MState) : Bool := + let qv := s.q.val + @Bool.rec (fun _ => Bool) + (@Bool.rec (fun _ => Bool) + (@Bool.rec (fun _ => Bool) + (@Bool.rec (fun _ => Bool) + false + (matchStackFast s.r false (fun top rest => + @Bool.rec (fun _ => Bool) + (@Bool.rec (fun _ => Bool) + true + (matchStackFast rest false (fun b2 _ => + bnot_fast (band_fast (Nat.beq b2.width 1) (band_fast (Nat.beq b2.pat 0) (Nat.ble 2 b2.len))))) + (band_fast (Nat.beq top.width 1) (band_fast (Nat.beq top.pat 1) (Nat.beq top.len 1)))) + (@Bool.rec (fun _ => Bool) (has_head_bit1_f rest) false (Nat.ble 2 top.len)) + (band_fast (Nat.beq top.width 1) (Nat.beq top.pat 0)))) + (Nat.beq qv 3)) + (band_fast (has_head_bit1_f s.l) (has_head_bit1_f s.r)) + (Nat.beq qv 2)) + (band_fast (has_head_bit1_f s.l) (has_head_bit1_f s.r)) + (Nat.beq qv 1)) + (bor_fast + (matchStackFast s.r false (fun top _ => + band_fast (Nat.beq (Nat.land top.pat 1) 1) (bnot_fast (band_fast (Nat.beq top.width 1) (Nat.ble 2 top.len))))) + (band_fast (bor_fast (pre_pair_l_fn s.l) (pre_absorb_l_fn s.l)) (can_parse_r_fn s.r))) + (Nat.beq qv 0) + +noncomputable def run_prim_f_p + (pop1_b_f : Stack → Bool × Stack) + (can_any_macro_fn : MState → Bool) + (step_prim_f : MState → Option MState) : Nat → MState → Option MState := +@Nat.rec (fun _ => MState → Option MState) + (fun s => some s) + (fun _ ih s => + @Bool.rec (fun _ => Option MState) + (withOptionFast (step_prim_f s) (some s) ih) + (some s) + (bor_fast (band_fast (Nat.beq s.q.val 5) (pop1_b_f s.r).1) (can_any_macro_fn s))) + +noncomputable def step_prim_plus_f_p + (step_prim_f : MState → Option MState) + (run_prim_f : Nat → MState → Option MState) : MState → Option MState := +fun s => + withOptionFast (step_prim_f s) none (run_prim_f 24) + +noncomputable def step_m_f_p + (do_shift_right_f : Nat → Fin 6 → Nat → Nat → Nat → Nat → MState → Option MState) + (do_shift_left_f : Nat → Fin 6 → Nat → Nat → Nat → Nat → MState → Option MState) + (try_pair_stack_f : Nat → MState → Option MState) + (try_absorb_stack_f : Nat → MState → Option MState) + (step_prim_plus_f : MState → Option MState) : Nat → MState → Option MState := +fun _ => +fun s => + let qv := s.q.val + let macro_res : Option MState := + @Bool.rec (fun _ => Option MState) + (@Bool.rec (fun _ => Option MState) + (@Bool.rec (fun _ => Option MState) + (@Bool.rec (fun _ => Option MState) + none + (withOptionFast ((do_shift_right_f 8) fin6_3 1 1 0 1 s) + (withOptionFast ((do_shift_right_f 8) fin6_3 3 2 1 1 s) + (withOptionFast ((do_shift_right_f 8) fin6_3 4 10 14 4 s) + ((do_shift_right_f 8) fin6_3 4 5 7 4 s) + some) + some) + some) + (Nat.beq qv 3)) + ((do_shift_left_f 8) fin6_2 2 3 1 2 s) + (Nat.beq qv 2)) + ((do_shift_left_f 8) fin6_1 1 1 0 1 s) + (Nat.beq qv 1)) + (let kbig := Nat.add (Nat.add (stack_len_fast s.l) (stack_len_fast s.r)) 4 + withOptionFast ((try_pair_stack_f kbig) s) + (withOptionFast ((try_absorb_stack_f kbig) s) + ((do_shift_right_f 8) fin6_0 3 1 1 1 s) + some) + some) + (Nat.beq qv 0) + withOptionFast macro_res (step_prim_plus_f s) some + + +@[simp] theorem if_true_eq_true {α : Type} (t e : α) : (if true = true then t else e) = t := rfl +@[simp] theorem if_false_eq_true {α : Type} (t e : α) : (if false = true then t else e) = e := rfl +@[simp] theorem bool_true_and_b (b : Bool) : (true && b) = b := rfl +@[simp] theorem nat_add_1_succ {α : Type} (z : α) (f : Nat → α) (x : Nat) : + @Nat.rec (fun _ => α) z (fun p _ => f p) (Nat.add 1 x) = f x := by + have h : Nat.add 1 x = Nat.succ x := Nat.add_comm 1 x + rw [h] + +@[simp] theorem bool_rec_eq {α : Type} (f t : α) (b : Bool) : + @Bool.rec (fun _ => α) f t b = if b then t else f := by + cases b <;> rfl + +@[simp] theorem nat_beq_def (x y : Nat) : x.beq y = (x == y) := by + cases h1 : x.beq y <;> cases h2 : (x == y) <;> simp_all [Nat.beq_eq] +@[simp] theorem nat_ble_def (x y : Nat) : x.ble y = decide (x ≤ y) := by + by_cases h : x ≤ y + · rw [Nat.ble_eq.mpr h, decide_eq_true h] + · cases hb : x.ble y + · exact (decide_eq_false h).symm + · exact False.elim (h (Nat.ble_eq.mp hb)) +@[simp] theorem nat_add_def (x y : Nat) : x.add y = x + y := rfl +@[simp] theorem nat_sub_def (x y : Nat) : x.sub y = x - y := rfl +@[simp] theorem nat_mul_def (x y : Nat) : x.mul y = x * y := rfl +@[simp] theorem nat_div_def (x y : Nat) : x.div y = x / y := rfl +@[simp] theorem nat_mod_def (x y : Nat) : x.mod y = x % y := rfl +@[simp] theorem nat_min_def (x y : Nat) : x.min y = min x y := rfl +@[simp] theorem nat_max_def (x y : Nat) : x.max y = max x y := rfl +@[simp] theorem nat_land_def (x y : Nat) : x.land y = x &&& y := rfl +@[simp] theorem nat_shiftRight_def (x y : Nat) : x.shiftRight y = x >>> y := rfl +@[simp] theorem nat_shiftLeft_def (x y : Nat) : x.shiftLeft y = x <<< y := rfl + +@[simp] theorem bnot_fast_eq (x : Bool) : bnot_fast x = !x := by cases x <;> rfl +@[simp] theorem band_fast_eq (x y : Bool) : band_fast x y = (x && y) := by cases x <;> rfl +@[simp] theorem bor_fast_eq (x y : Bool) : bor_fast x y = (x || y) := by cases x <;> rfl +@[simp] theorem bxor_fast_eq (x y : Bool) : bxor_fast x y = (x ^^ y) := by cases x <;> cases y <;> rfl + +@[simp] theorem nat_min_fast_eq (x y : Nat) : nat_min_fast x y = min x y := by + unfold nat_min_fast + simp only [bool_rec_eq, nat_ble_def] + by_cases h : x ≤ y + · simp [h, Nat.min_eq_left h] + · have h2 : y ≤ x := by omega + simp [h, Nat.min_eq_right h2] + +@[simp] theorem nat_max_fast_eq (x y : Nat) : nat_max_fast x y = max x y := by + unfold nat_max_fast + simp only [bool_rec_eq, nat_ble_def] + by_cases h : x ≤ y + · simp [h, Nat.max_eq_right h] + · have h2 : y ≤ x := by omega + simp [h, Nat.max_eq_left h2] + +@[simp] theorem withOptionFast_eq {α β : Type} (o : Option α) (onNone : β) (onSome : α → β) : + withOptionFast o onNone onSome = match o with | none => onNone | some a => onSome a := by + cases o <;> rfl + +@[simp] theorem matchStackFast_eq {α : Type} (s : Stack) (onNil : α) (onCons : Block → Stack → α) : + matchStackFast s onNil onCons = match s with | [] => onNil | hd :: tl => onCons hd tl := by + cases s <;> rfl + +@[simp] theorem matchPartListFast_eq {α : Type} (xs : PartList) (onNil : α) (onCons : Bool → Nat → PartList → α) : + matchPartListFast xs onNil onCons = match xs with | [] => onNil | (b, k) :: tl => onCons b k tl := by + cases xs with + | nil => rfl + | cons hd tl => cases hd; rfl + +@[simp] theorem isEmptyPartListFast_eq (xs : PartList) : + isEmptyPartListFast xs = xs.isEmpty := by + cases xs <;> rfl + +@[simp] theorem fin6_0_eq : fin6_0 = 0 := rfl +@[simp] theorem fin6_1_eq : fin6_1 = 1 := rfl +@[simp] theorem fin6_2_eq : fin6_2 = 2 := rfl +@[simp] theorem fin6_3_eq : fin6_3 = 3 := rfl +@[simp] theorem fin6_4_eq : fin6_4 = 4 := rfl +@[simp] theorem fin6_5_eq : fin6_5 = 5 := rfl + +theorem consBlock1_eq (p w l : Nat) (rest : Stack) : + consBlock1 p w l rest = ⟨p, w, l⟩ :: rest := by + unfold consBlock1 + have hp : Nat.add 1 p = Nat.succ p := Nat.add_comm 1 p + have hw : Nat.add 1 w = Nat.succ w := Nat.add_comm 1 w + have hl : Nat.add 1 l = Nat.succ l := Nat.add_comm 1 l + rw [hp, hw, hl] + +@[simp] theorem withProdFast_eq {α β γ : Type} (p : α × β) (f : α → β → γ) : + withProdFast p f = f p.1 p.2 := by + cases p; rfl + +@[simp] theorem withProd3Fast_eq {α β γ δ : Type} (p : α × β × γ) (f : α → β → γ → δ) : + withProd3Fast p f = f p.1 p.2.1 p.2.2 := by + rcases p with ⟨a, b, c⟩; rfl + +@[simp] theorem withNatFast_eq {α : Type} (x : Nat) (f : Nat → α) : + withNatFast x f = f x := by + unfold withNatFast + have hx : Nat.add 1 x = Nat.succ x := Nat.add_comm 1 x + rw [hx] + +@[simp] theorem withBoolFast_eq {α : Type} (b : Bool) (f : Bool → α) : + withBoolFast b f = f b := by + cases b <;> rfl + +@[simp] theorem withStackFast_eq {α : Type} (s : Stack) (f : Stack → α) : + withStackFast s f = f s := by + cases s <;> rfl + +@[simp] theorem withPartFast_eq {α : Type} (p : Bool × Nat) (f : Bool → Nat → α) : + withPartFast p f = f p.1 p.2 := by + rcases p with ⟨b, n⟩ + simp [withPartFast] + +@[simp] theorem withPartListFast_eq {α : Type} (xs : PartList) (f : PartList → α) : + withPartListFast xs f = f xs := by + cases xs with + | nil => rfl + | cons hd tl => + rcases hd with ⟨b, n⟩ + simp [withPartListFast] + +@[simp] theorem someMStateFast_eq (q : Fin 6) (l r : Stack) : + someMStateFast q l r = some ⟨q, l, r⟩ := by + simp [someMStateFast] + +@[simp] theorem stack_len_fast_eq (s : Stack) : + stack_len_fast s = s.length := by + induction s with + | nil => rfl + | cons hd tl ih => + change Nat.add (stack_len_fast tl) 1 = (hd :: tl).length + simp [ih] + +theorem mkBlock_p_eq : mkBlock_f_p = Block.mk := by + funext p w l; unfold mkBlock_f_p; simp only [nat_add_1_succ] + +theorem rot1_p_eq : rot1_f_p = rot1 := by + funext w p; unfold rot1_f_p rot1 + simp only [bool_rec_eq, nat_ble_def, nat_shiftRight_def, nat_land_def, nat_shiftLeft_def, + nat_sub_def, nat_mul_def, nat_add_def, + Nat.shiftRight_eq_div_pow, Nat.pow_one, Nat.and_one_is_mod, Nat.shiftLeft_eq, Nat.one_mul] + by_cases hw : w ≤ 1 <;> simp [hw] + +theorem rot_k_zero (w n : Nat) : rot_k w n 0 = 0 := by + induction n with + | zero => rfl + | succ n ih => + have h1 : rot1 w 0 = 0 := by simp [rot1] + simp [rot_k, h1, ih] + +theorem rot_k_one_one (n : Nat) : rot_k 1 n 1 = 1 := by + induction n with + | zero => rfl + | succ n ih => + have h1 : rot1 1 1 = 1 := by simp [rot1] + simp [rot_k, h1, ih] + +theorem rot_mod_fin_eq : + ∀ (w : Fin 5) (p : Fin 16) (r : Fin 5), + 1 ≤ w.val → p.val ≤ (Nat.shiftLeft 1 w.val) - 1 → 1 ≤ r.val → r.val < w.val → + Nat.add (Nat.shiftRight p.val r.val) + (Nat.shiftLeft (Nat.land p.val (Nat.sub (Nat.shiftLeft 1 r.val) 1)) (Nat.sub w.val r.val)) == + rot_k w.val r.val p.val := by decide +kernel + +theorem rot_k_period_fin : + ∀ (w : Fin 5) (p : Fin 16), + 1 ≤ w.val → p.val ≤ (Nat.shiftLeft 1 w.val) - 1 → rot_k w.val w.val p.val = p.val := by decide +kernel + +theorem rot_mod_p_eq : rot_mod_f_p = rot_mod := by + funext w n p + rw [rot_mod_eq] + unfold rot_mod_f_p + simp only [bool_rec_eq, band_fast_eq, bor_fast_eq, withNatFast_eq, nat_beq_def, nat_ble_def] + split_ifs with h0 hw hr + · simp only [Bool.or_eq_true, Bool.and_eq_true, beq_iff_eq] at h0 + rcases h0 with rfl | ⟨rfl, rfl⟩ + · exact (rot_k_zero w n).symm + · exact (rot_k_one_one n).symm + · simp only [Bool.and_eq_true, decide_eq_true_eq, nat_sub_def] at hw + rcases hw with ⟨hw2, hw4, hp15, hp⟩ + have hw1 : 1 ≤ w := Nat.le_trans (by decide : 1 ≤ 2) hw2 + have hper := rot_k_period_fin ⟨w, Nat.lt_succ_of_le hw4⟩ ⟨p, Nat.lt_succ_of_le hp15⟩ hw1 hp + simp only [nat_mod_def, beq_iff_eq] at hr + have hdiv := Nat.div_add_mod n w + conv_rhs => rw [← hdiv] + rw [rot_k_period w p hper (n / w) (n % w), hr]; rfl + · simp only [Bool.and_eq_true, decide_eq_true_eq, nat_sub_def] at hw + rcases hw with ⟨hw2, hw4, hp15, hp⟩ + have hw1 : 1 ≤ w := Nat.le_trans (by decide : 1 ≤ 2) hw2 + have hw0 : 0 < w := Nat.lt_of_lt_of_le (by decide : 0 < 1) hw1 + have hper := rot_k_period_fin ⟨w, Nat.lt_succ_of_le hw4⟩ ⟨p, Nat.lt_succ_of_le hp15⟩ hw1 hp + have hdiv := Nat.div_add_mod n w + conv_rhs => rw [← hdiv] + rw [rot_k_period w p hper (n / w) (n % w)] + have hrmod : n % w < w := Nat.mod_lt n hw0 + have hr1 : 1 ≤ n % w := by + simp only [nat_mod_def] at hr + cases hc : (n % w == 0) + · rw [beq_eq_false_iff_ne] at hc; exact Nat.pos_of_ne_zero hc + · exact False.elim (hr hc) + have hfin := rot_mod_fin_eq ⟨w, Nat.lt_succ_of_le hw4⟩ ⟨p, Nat.lt_succ_of_le hp15⟩ + ⟨n % w, Nat.lt_trans hrmod (Nat.lt_succ_of_le hw4)⟩ hw1 hp hr1 hrmod + exact of_decide_eq_true hfin + · rfl + +theorem bit_of_bool_p_eq : bit_of_bool_f_p = (fun x => bit_of x == 1) := by + funext x; unfold bit_of_bool_f_p bit_of + simp only [nat_land_def, nat_beq_def, Nat.and_one_is_mod] + rcases Nat.mod_two_eq_zero_or_one x with h2 | h2 <;> rw [h2] <;> rfl + +theorem push_stack_aux_fast_eq (s : Stack) (p w l : Nat) : + push_stack_aux_fast s p w l = push_stack_aux ⟨p, w, l⟩ s := by + induction s generalizing p w l with + | nil => + change @Bool.rec (fun _ => Stack) (⟨p, w, l⟩ :: []) [] (Nat.beq p 0) = + push_stack_aux ⟨p, w, l⟩ [] + unfold push_stack_aux + simp only [bool_rec_eq, nat_beq_def] + by_cases hp : p = 0 <;> simp [hp] + | cons top rest ih => + change @Bool.rec (fun _ => Stack) + (⟨p, w, l⟩ :: top :: rest) + (withNatFast (Nat.add l top.len) (fun nl => push_stack_aux_fast rest p w nl)) + (band_fast (Nat.beq w top.width) (Nat.beq (rot_mod_f_p w l p) top.pat)) = + push_stack_aux ⟨p, w, l⟩ (top :: rest) + unfold push_stack_aux + simp only [ih, bool_rec_eq, band_fast_eq, nat_beq_def, nat_add_def, withNatFast_eq, with_nat_eq, rot_mod_p_eq] + +theorem push_stack_fast_eq : push_stack_fast = push_stack := by + funext p w l s + unfold push_stack_fast push_stack + simp only [withNatFast_eq, bool_rec_eq, nat_beq_def, push_stack_aux_fast_eq, with_stack_eq, with_nat_eq] + by_cases hl : l = 0 <;> simp [hl] + +theorem drop_stack_aux_fast_eq (s : Stack) (n : Nat) (hn : n ≠ 0) : + drop_stack_aux_fast s n = drop_stack n s := by + induction s generalizing n with + | nil => rfl + | cons top rest ih => + change @Bool.rec (fun _ => Stack) + (consBlock1 (rot_mod_f_p top.width n top.pat) top.width (Nat.sub top.len n) rest) + (withNatFast (Nat.sub n top.len) (fun rem => + @Bool.rec (fun _ => Stack) (drop_stack_aux_fast rest rem) rest (Nat.beq rem 0))) + (Nat.ble top.len n) = drop_stack n (top :: rest) + unfold drop_stack + simp only [bool_rec_eq, nat_ble_def, nat_beq_def, nat_sub_def, withNatFast_eq, with_nat_eq, + consBlock1_eq, rot_mod_p_eq, hn, ↓reduceIte] + by_cases hle : top.len ≤ n + · simp only [hle, decide_true, if_true_eq_true, ↓reduceIte] + by_cases hrem : n - top.len = 0 + · simp [hrem, drop_stack_zero] + · have hne : (n - top.len == 0) = false := beq_eq_false_iff_ne.mpr hrem + rw [hne, if_false_eq_true] + exact ih (n - top.len) hrem + · simp only [hle, decide_false, if_false_eq_true, ↓reduceIte] + +theorem drop_stack_fast_eq : drop_stack_fast = drop_stack := by + funext n s + unfold drop_stack_fast + simp only [withNatFast_eq, bool_rec_eq, nat_beq_def] + by_cases hn : n = 0 + · simp [hn, drop_stack_zero] + · have hne : (n == 0) = false := beq_eq_false_iff_ne.mpr hn + rw [hne, if_false_eq_true] + exact drop_stack_aux_fast_eq s n hn + +theorem pop1_b_fast_eq : pop1_b_fast = fun s => ((pop1 s).1 == 1, (pop1 s).2) := by + funext s + induction s with + | nil => rfl + | cons top rest ih => + change @Bool.rec (fun _ => Bool × Stack) + (bit_of_bool_f_p top.pat, + @Bool.rec (fun _ => Stack) + (consBlock1 (rot1_f_p top.width top.pat) top.width (Nat.sub top.len 1) rest) + rest + (Nat.beq top.len 1)) + (pop1_b_fast rest) + (Nat.beq top.len 0) = ((pop1 (top :: rest)).1 == 1, (pop1 (top :: rest)).2) + unfold pop1 + simp only [ih, bool_rec_eq, nat_beq_def, nat_sub_def, consBlock1_eq, rot1_p_eq, bit_of_bool_p_eq, with_nat_eq] + by_cases h0 : top.len = 0 + · simp [h0] + · have hne0 : (top.len == 0) = false := beq_eq_false_iff_ne.mpr h0 + rw [hne0]; simp only [if_false_eq_true, h0, ↓reduceIte] + by_cases h1 : top.len = 1 + · simp [h1] + · have hne1 : (top.len == 1) = false := beq_eq_false_iff_ne.mpr h1 + rw [hne1]; simp [h1] + +theorem sym_xnor_eq : ∀ (a b : Fin 2), ((!(a == 1 ^^ b == 1)) = true) = (a = b) := by decide + +theorem pop_word_p_eq + {bit_of_bool_f} (h1 : bit_of_bool_f = fun x => bit_of x == 1) + {pop1_b_f} (h2 : pop1_b_f = fun s => ((pop1 s).1 == 1, (pop1 s).2)) : + pop_word_f_p bit_of_bool_f pop1_b_f = pop_word := by + subst h1; subst h2; funext pat w s + unfold pop_word_f_p + induction w generalizing pat s with + | zero => simp [pop_word] + | succ w ih => + unfold pop_word + simp only [ih] + simp only [bool_rec_eq, bnot_fast_eq, bxor_fast_eq, with_prod_eq, withProdFast_eq, + withNatFast_eq, sym_xnor_eq, nat_shiftRight_def] + have hsh : ∀ x : Nat, x >>> 1 = x / 2 := fun _ => rfl + simp only [hsh] + +theorem fast_match_core_fin : + ∀ (w : Fin 5) (tw : Fin 5) (tp : Fin 16) (pat : Fin 16), + 1 ≤ w.val → 1 ≤ tw.val → tp.val ≤ (Nat.shiftLeft 1 tw.val) - 1 → pat.val ≤ (Nat.shiftLeft 1 w.val) - 1 → + (let mul := @Bool.rec (fun _ => Nat) + (@Bool.rec (fun _ => Nat) + (@Bool.rec (fun _ => Nat) 273 585 (Nat.beq tw.val 3)) + 1365 (Nat.beq tw.val 2)) + 4095 (Nat.beq tw.val 1) + withNatFast (Nat.mul tp.val mul) (fun pm => + band_fast (Nat.beq (Nat.land (Nat.shiftRight pm w.val) (Nat.sub (Nat.shiftLeft 1 tw.val) 1)) tp.val) + (Nat.beq (Nat.land pm (Nat.sub (Nat.shiftLeft 1 w.val) 1)) pat.val))) = + (rot_k tw.val w.val tp.val == tp.val && pat_word tw.val tp.val w.val == word_of pat.val w.val) := by + decide +kernel + +theorem fast_match_p_eq : + fast_match_f_p = fun pat w top => + (0 < w && w ≤ top.len && rot_k top.width w top.pat == top.pat && + pat_word top.width top.pat w == word_of pat w) := by + funext pat w top + unfold fast_match_f_p + have hguard : + band_fast (Nat.ble 1 w) + (band_fast (Nat.ble w 4) + (band_fast (Nat.ble 1 top.width) + (band_fast (Nat.ble top.width 4) + (band_fast (Nat.ble top.pat (Nat.sub (Nat.shiftLeft 1 top.width) 1)) + (Nat.ble pat (Nat.sub (Nat.shiftLeft 1 w) 1)))))) = + (decide (1 ≤ w) && (decide (w ≤ 4) && (decide (1 ≤ top.width) && (decide (top.width ≤ 4) && + (decide (top.pat ≤ (Nat.shiftLeft 1 top.width) - 1) && decide (pat ≤ (Nat.shiftLeft 1 w) - 1)))))) := by + simp only [band_fast_eq, nat_ble_def, nat_sub_def] + rw [hguard, bool_rec_eq] + split_ifs with hg + · simp only [Bool.and_eq_true, decide_eq_true_eq] at hg + rcases hg with ⟨hw1, hw4, htw1, htw4, htp, hpat⟩ + have h15 : ∀ (k : Fin 5), (Nat.shiftLeft 1 k.val) - 1 ≤ 15 := by decide + have htp16 : (Nat.shiftLeft 1 top.width) - 1 ≤ 15 := h15 ⟨top.width, by omega⟩ + have hpat16 : (Nat.shiftLeft 1 w) - 1 ≤ 15 := h15 ⟨w, by omega⟩ + have hcore := fast_match_core_fin ⟨w, by omega⟩ ⟨top.width, by omega⟩ ⟨top.pat, by omega⟩ ⟨pat, by omega⟩ + hw1 htw1 htp hpat + dsimp only at hcore + rw [band_fast_eq, hcore, nat_ble_def] + have hw_pos : decide (0 < w) = true := decide_eq_true (by omega) + rw [hw_pos, Bool.true_and] + cases decide (w ≤ top.len) <;> cases (rot_k top.width w top.pat == top.pat) <;> + cases (pat_word top.width top.pat w == word_of pat w) <;> rfl + · rfl + +theorem count_stack_mut_p_eq + {drop_stack_f} (h1 : drop_stack_f = drop_stack) + {pop_word_f} (h2 : pop_word_f = pop_word) + {fast_match_f} (h3 : fast_match_f = fun pat w top => + (0 < w && w ≤ top.len && rot_k top.width w top.pat == top.pat && + pat_word top.width top.pat w == word_of pat w)) : + count_stack_mut_f_p drop_stack_f pop_word_f fast_match_f = count_stack_mut := by + subst h1; subst h2; subst h3 + funext pat w fuel limit s + unfold count_stack_mut_f_p + induction fuel generalizing limit s with + | zero => rfl + | succ fuel ih => + unfold count_stack_mut + simp only [ih] + simp only [bool_rec_eq, nat_beq_def, nat_div_def, nat_mul_def, nat_sub_def, nat_add_def, + nat_min_fast_eq, matchStackFast_eq, withOptionFast_eq, withStackFast_eq, + with_nat_eq, with_stack_eq, with_prod_eq, withProdFast_eq, withNatFast_eq] + by_cases hlim : limit = 0 + · simp [hlim] + · have hne : (limit == 0) = false := beq_eq_false_iff_ne.mpr hlim + rw [hne]; simp only [if_false_eq_true, hlim, ↓reduceIte] + cases s with + | nil => rfl + | cons top rest => + dsimp only + split_ifs with hfm + · rfl + · cases pop_word pat w (top :: rest) <;> rfl + +theorem mkPart_p_eq : mkPart_f_p = cons_lsb := by + funext b k xs + unfold mkPart_f_p cons_lsb + simp only [withNatFast_eq, withBoolFast_eq, matchPartListFast_eq, bool_rec_eq, + nat_beq_def, nat_add_def, bnot_fast_eq, bxor_fast_eq, + with_bool_eq, with_nat_eq, with_list_eq] + cases k with + | zero => rfl + | succ k' => + have hne : (Nat.succ k' == 0) = false := rfl + rw [hne, if_false_eq_true] + cases xs with + | nil => cases b <;> rfl + | cons hd rest => + rcases hd with ⟨b2, k2⟩ + cases b <;> cases b2 <;> rfl + +theorem bsize_parts_p_eq : bsize_parts_f_p = bsize_parts := by + funext xs; unfold bsize_parts_f_p + induction xs with + | nil => rfl + | cons hd tl ih => + rcases hd with ⟨b, k⟩ + simp only [ih] + rfl + +theorem put_l_parts_p_eq + {push_stack_f} (h1 : push_stack_f = push_stack) : + put_l_parts_f_p push_stack_f = put_l_parts := by + subst h1; funext xs s; unfold put_l_parts_f_p + induction xs with + | nil => rfl + | cons hd tl ih => + rcases hd with ⟨b, k⟩ + simp only [ih] + simp only [put_l_parts, bool_rec_eq, nat_mul_def] + +theorem put_l_stack_p_eq + {push_stack_f} (h1 : push_stack_f = push_stack) + {bsize_parts_f} (h2 : bsize_parts_f = bsize_parts) + {put_l_parts_f} (h3 : put_l_parts_f = put_l_parts) : + put_l_stack_f_p push_stack_f bsize_parts_f put_l_parts_f = put_l_stack := by + subst h1; subst h2; subst h3; funext xs n s + unfold put_l_stack_f_p put_l_stack + simp only [withNatFast_eq, withStackFast_eq, bool_rec_eq, nat_ble_def, nat_add_def, nat_sub_def, nat_mul_def] + congr 1 + by_cases hlt : bsize_parts xs < n + · rw [if_pos hlt, decide_eq_true (by omega), if_true_eq_true] + · rw [if_neg hlt, decide_eq_false (by omega), if_false_eq_true] + +theorem put_r_rec_p_eq + {push_stack_f} (h1 : push_stack_f = push_stack) : + put_r_rec_f_p push_stack_f = put_r_rec := by + subst h1; funext xs k s; unfold put_r_rec_f_p + induction xs generalizing k s with + | nil => simp only [put_r_rec, nat_sub_def, nat_mul_def] + | cons hd tl ih => + rcases hd with ⟨b, m⟩ + unfold put_r_rec + simp only [ih] + simp only [bool_rec_eq, withNatFast_eq, nat_beq_def, nat_ble_def, nat_sub_def, nat_mul_def] + by_cases hm : m = 0 + · simp [hm] + · have hne : (m == 0) = false := beq_eq_false_iff_ne.mpr hm + rw [hne]; simp only [if_false_eq_true, hm, ↓reduceIte] + by_cases hle : k ≤ m <;> simp [hle] + +theorem parse_step_l_p_eq + {drop_stack_f} (h1 : drop_stack_f = drop_stack) + {pop_word_f} (h2 : pop_word_f = pop_word) : + parse_step_l_f_p drop_stack_f pop_word_f = parse_step_l := by + subst h1; subst h2; funext limit s + unfold parse_step_l_f_p parse_step_l + cases s with + | nil => rfl + | cons top rest => + simp only [matchStackFast_eq, withOptionFast_eq, withNatFast_eq, withStackFast_eq, + band_fast_eq, nat_min_fast_eq, bool_rec_eq, nat_beq_def, nat_ble_def, nat_div_def, nat_mul_def, Bool.and_assoc] + split_ifs with c1 c2 + · rfl + · rfl + · cases pop_word 15 4 (top :: rest) with + | some s1 => rfl + | none => cases pop_word 14 4 (top :: rest) <;> rfl + +theorem parse_l_p_eq + {parse_step_l_f} (h1 : parse_step_l_f = parse_step_l) : + parse_l_f_p parse_step_l_f = parse_l := by + subst h1; funext fuel limit s; unfold parse_l_f_p + induction fuel generalizing limit s with + | zero => rfl + | succ fuel ih => + unfold parse_l + simp only [ih] + simp only [bool_rec_eq, nat_beq_def, nat_sub_def, withOptionFast_eq, withProd3Fast_eq, + withNatFast_eq, withProdFast_eq, band_fast_eq, bnot_fast_eq, isEmptyPartListFast_eq, + with_prod_eq, with_list_eq, with_stack_eq] + by_cases hlim : limit = 0 + · simp [hlim] + · have hne : (limit == 0) = false := beq_eq_false_iff_ne.mpr hlim + rw [hne]; simp only [if_false_eq_true, hlim, ↓reduceIte] + cases parse_step_l limit s with + | none => rfl + | some val => + rcases val with ⟨b, k, s1⟩; dsimp only + +theorem parse_step_r_p_eq + {drop_stack_f} (h1 : drop_stack_f = drop_stack) + {pop_word_f} (h2 : pop_word_f = pop_word) : + parse_step_r_f_p drop_stack_f pop_word_f = parse_step_r := by + subst h1; subst h2; funext limit s + unfold parse_step_r_f_p parse_step_r + cases s with + | nil => rfl + | cons top rest => + simp only [matchStackFast_eq, withOptionFast_eq, withNatFast_eq, withStackFast_eq, + band_fast_eq, nat_min_fast_eq, bool_rec_eq, nat_beq_def, nat_ble_def, nat_div_def, nat_mul_def, Bool.and_assoc] + split_ifs with c1 c2 + · rfl + · rfl + · cases pop_word 1 3 (top :: rest) with + | some s1 => rfl + | none => cases pop_word 0 3 (top :: rest) <;> rfl + +theorem sym_not_eq_one : ∀ (x : Fin 2), ((!(x == 1)) = true) = (x = 0) := by decide + +theorem parse_r_p_eq + {push_stack_f} (h1 : push_stack_f = push_stack) + {pop1_b_f} (h2 : pop1_b_f = fun s => ((pop1 s).1 == 1, (pop1 s).2)) + {parse_step_r_f} (h3 : parse_step_r_f = parse_step_r) : + parse_r_f_p push_stack_f pop1_b_f parse_step_r_f = parse_r := by + subst h1; subst h2; subst h3; funext fuel limit s; unfold parse_r_f_p + induction fuel generalizing limit s with + | zero => rfl + | succ fuel ih => + unfold parse_r + simp only [ih] + simp only [bool_rec_eq, nat_beq_def, nat_sub_def, matchStackFast_eq, withOptionFast_eq, + withProd3Fast_eq, withNatFast_eq, withProdFast_eq, withStackFast_eq, + bnot_fast_eq, isEmptyPartListFast_eq, with_prod_eq, with_list_eq, with_stack_eq] + by_cases hlim : limit = 0 + · simp [hlim] + · have hne : (limit == 0) = false := beq_eq_false_iff_ne.mpr hlim + rw [hne]; simp only [if_false_eq_true, hlim, ↓reduceIte] + cases s with + | nil => rfl + | cons top rest => + dsimp only + rcases parse_step_r limit (top :: rest) with _ | ⟨b, k, s1⟩ + · simp only [sym_not_eq_one] + · dsimp only + +theorem sub_lsb_p_eq + {mkPart_f} (h1 : mkPart_f = cons_lsb) : + sub_lsb_f_p mkPart_f = sub_lsb := by + subst h1; funext fuel c xs ys; unfold sub_lsb_f_p + induction fuel generalizing c xs ys with + | zero => rfl + | succ fuel ih => + unfold sub_lsb + simp only [ih] + cases xs with + | nil => + simp only [matchPartListFast_eq, bool_rec_eq, band_fast_eq, isEmptyPartListFast_eq, bnot_fast_eq] + | cons xhd xrest => + rcases xhd with ⟨px, kx⟩ + cases ys with + | nil => + cases c with + | false => rfl + | true => + simp only [matchPartListFast_eq, bool_rec_eq, withBoolFast_eq, withOptionFast_eq, + bnot_fast_eq, bxor_fast_eq, band_fast_eq, + nat_beq_def, nat_ble_def, nat_add_def, nat_sub_def, + with_nat_eq, with_list_eq, head_q, head_l, next_x, next_y, + List.isEmpty, Bool.not_true, Bool.and_false, Bool.false_eq_true, ↓reduceIte] + have hmink : min kx kx = kx := Nat.min_self kx + simp only [hmink, Nat.sub_self] + by_cases hlt : kx < kx + · exact False.elim (Nat.lt_irrefl kx hlt) + · simp only [hlt, ↓reduceIte] + by_cases hk0 : kx = 0 + · simp [hk0] + · have hne0 : (kx == 0) = false := beq_eq_false_iff_ne.mpr hk0 + rw [hne0]; simp only [if_false_eq_true, hk0, ↓reduceIte] + by_cases h1 : 1 < kx + · have hd2 : decide (2 ≤ kx) = true := decide_eq_true (by omega) + rw [hd2, if_true_eq_true] + have hc2 : (!px && (!px && true)) = sub_chunk_c px false true kx := by + unfold sub_chunk_c subbit; rw [if_pos h1]; cases px <;> rfl + rw [hc2] + cases sub_lsb fuel (sub_chunk_c px false true kx) xrest [] with + | none => rfl + | some out => + dsimp only; unfold sub_chunk_out subbit; rw [if_pos h1] + cases px <;> rfl + · have hd2 : decide (2 ≤ kx) = false := decide_eq_false (by omega) + rw [hd2, if_false_eq_true] + have hc1 : (!px && true) = sub_chunk_c px false true kx := by + unfold sub_chunk_c subbit; rw [if_neg h1]; cases px <;> rfl + rw [hc1] + cases sub_lsb fuel (sub_chunk_c px false true kx) xrest [] with + | none => rfl + | some out => + dsimp only; unfold sub_chunk_out subbit; rw [if_neg h1] + cases px <;> rfl + | cons yhd yrest => + rcases yhd with ⟨qy, ly⟩ + simp only [matchPartListFast_eq, withNatFast_eq, withPartListFast_eq, withBoolFast_eq, + withOptionFast_eq, nat_min_fast_eq, bool_rec_eq, + bnot_fast_eq, bxor_fast_eq, band_fast_eq, bor_fast_eq, + nat_beq_def, nat_ble_def, nat_add_def, nat_sub_def, + with_nat_eq, with_list_eq, head_q, head_l, + List.isEmpty, Bool.false_and, Bool.false_eq_true, ↓reduceIte] + have hnx : (if decide (min kx ly + 1 ≤ kx) then (px, kx - min kx ly) :: xrest else xrest) = + next_x px kx (min kx ly) xrest := by + unfold next_x + by_cases hlt : min kx ly < kx + · rw [if_pos hlt, decide_eq_true (by omega), if_true_eq_true] + · rw [if_neg hlt, decide_eq_false (by omega), if_false_eq_true] + have hny : (if decide (min kx ly + 1 ≤ ly) then (qy, ly - min kx ly) :: yrest else yrest) = + next_y (min kx ly) ((qy, ly) :: yrest) := by + dsimp only [next_y] + by_cases hlt : min kx ly < ly + · rw [if_pos hlt, decide_eq_true (by omega), if_true_eq_true] + · rw [if_neg hlt, decide_eq_false (by omega), if_false_eq_true] + rw [hnx, hny] + by_cases hn0 : min kx ly = 0 + · simp [hn0] + · have hne0 : (min kx ly == 0) = false := beq_eq_false_iff_ne.mpr hn0 + rw [hne0]; simp only [if_false_eq_true, hn0, ↓reduceIte] + by_cases h1 : 1 < min kx ly + · have hd2 : decide (2 ≤ min kx ly) = true := decide_eq_true (by omega) + rw [hd2, if_true_eq_true] + have hc2 : ((!px && (qy || ((!px && (qy || c)) || (qy && c)))) || + (qy && ((!px && (qy || c)) || (qy && c)))) = + sub_chunk_c px qy c (min kx ly) := by + unfold sub_chunk_c subbit; rw [if_pos h1] + rw [hc2] + cases sub_lsb fuel (sub_chunk_c px qy c (min kx ly)) + (next_x px kx (min kx ly) xrest) (next_y (min kx ly) ((qy, ly) :: yrest)) with + | none => rfl + | some out => + dsimp only; unfold sub_chunk_out subbit; rw [if_pos h1] + · have hd2 : decide (2 ≤ min kx ly) = false := decide_eq_false (by omega) + rw [hd2, if_false_eq_true] + have hc1 : ((!px && (qy || c)) || (qy && c)) = + sub_chunk_c px qy c (min kx ly) := by + unfold sub_chunk_c subbit; rw [if_neg h1] + rw [hc1] + cases sub_lsb fuel (sub_chunk_c px qy c (min kx ly)) + (next_x px kx (min kx ly) xrest) (next_y (min kx ly) ((qy, ly) :: yrest)) with + | none => rfl + | some out => + dsimp only; unfold sub_chunk_out subbit; rw [if_neg h1] + +theorem sub_lsb_checked_p_eq + {sub_lsb_f} (h1 : sub_lsb_f = sub_lsb) : + sub_lsb_checked_f_p sub_lsb_f = sub_lsb_checked := by + subst h1; funext fuel n k a b + unfold sub_lsb_checked_f_p sub_lsb_checked + simp only [bool_rec_eq, nat_ble_def, nat_add_def] + by_cases hlt : n < k + · rw [if_pos hlt, decide_eq_true (by omega), if_true_eq_true] + · rw [if_neg hlt, decide_eq_false (by omega), if_false_eq_true] + +theorem drop_mult3_fast_eq : drop_mult3_fast = drop_mult3 := by + funext top rest + unfold drop_mult3_fast drop_mult3 + simp only [withNatFast_eq, bool_rec_eq, nat_beq_def, nat_mod_def, consBlock1_eq] + by_cases h : top.len % 3 = 0 <;> simp [h] + +theorem choose_limit_r_p_eq + {drop_mult3_f} (h1 : drop_mult3_f = drop_mult3) + {pop1_b_f} (h2 : pop1_b_f = fun s => ((pop1 s).1 == 1, (pop1 s).2)) + {pop_word_f} (h3 : pop_word_f = pop_word) : + choose_limit_r_f_p drop_mult3_f pop1_b_f pop_word_f = choose_limit_r_loop := by + subst h1; subst h2; subst h3; funext n fuel done r + unfold choose_limit_r_f_p + induction fuel generalizing done r with + | zero => rfl + | succ fuel ih => + unfold choose_limit_r_loop + simp only [ih] + cases r with + | nil => + simp only [matchStackFast_eq, bool_rec_eq, nat_ble_def, nat_add_def] + by_cases hle : done ≤ n <;> simp [hle] + | cons top rest => + simp only [matchStackFast_eq, withOptionFast_eq, withNatFast_eq, band_fast_eq, bnot_fast_eq, + nat_min_fast_eq, nat_max_fast_eq, + bool_rec_eq, nat_beq_def, nat_ble_def, nat_add_def, nat_div_def, + with_nat_eq, Bool.and_assoc] + by_cases c1 : (top.width == 3 && (top.pat == 1 && decide (3 ≤ top.len))) = true + · simp only [c1, ↓reduceIte] + · have hc1f : (top.width == 3 && (top.pat == 1 && decide (3 ≤ top.len))) = false := + Bool.eq_false_iff.mpr c1 + simp only [hc1f, Bool.false_eq_true, ↓reduceIte] + by_cases c2 : (top.width == 1 && (top.pat == 0 && decide (3 ≤ top.len))) = true + · simp only [c2, ↓reduceIte] + by_cases hlt : n < done + top.len / 3 + · rw [if_pos hlt, decide_eq_true (by omega), if_true_eq_true] + · rw [if_neg hlt, decide_eq_false (by omega), if_false_eq_true] + · have hc2f : (top.width == 1 && (top.pat == 0 && decide (3 ≤ top.len))) = false := + Bool.eq_false_iff.mpr c2 + simp only [hc2f, Bool.false_eq_true, ↓reduceIte] + cases pop_word 1 3 (top :: rest) with + | some r1 => rfl + | none => + cases pop_word 0 3 (top :: rest) with + | some r1 => + dsimp only + by_cases hlt : n < done + 1 + · have hd : decide (n ≤ done) = true := decide_eq_true (by omega) + simp only [hd, hlt, ↓reduceIte] + · have hd : decide (n ≤ done) = false := decide_eq_false (by omega) + simp only [hd, hlt, Bool.false_eq_true, ↓reduceIte] + | none => + dsimp only + simp only [sym_not_eq_one] + +theorem push_prefix_l_p_eq + {push_stack_f} (h1 : push_stack_f = push_stack) : + push_prefix_l_f_p push_stack_f = push_prefix_l := by + subst h1; rfl + +theorem build_vprime_p_eq + {mkPart_f} (h1 : mkPart_f = cons_lsb) : + build_vprime_f_p mkPart_f = build_vprime := by + subst h1; funext n m_use + unfold build_vprime_f_p build_vprime + simp only [bool_rec_eq, nat_ble_def, nat_sub_def] + by_cases hlt : 1 < m_use + · rw [if_pos hlt, if_pos hlt, decide_eq_true (by omega), if_true_eq_true] + · rw [if_neg hlt, if_neg hlt, decide_eq_false (by omega), if_false_eq_true] + +theorem can_pair_f_eq : can_pair_f = can_pair := by + funext s; unfold can_pair_f + induction s with + | nil => rfl + | cons top rest ih => + unfold can_pair + simp only [ih] + simp only [matchStackFast_eq, band_fast_eq, bool_rec_eq, nat_beq_def, nat_ble_def, nat_mod_def, Bool.and_assoc] + by_cases c1 : (top.width == 1 && top.pat == 1) = true + · simp only [c1, ↓reduceIte] + cases rest with + | nil => rfl + | cons rhd rtl => + dsimp only [List.isEmpty, Bool.false_eq_true, ↓reduceIte] + by_cases hm : top.len % 4 = 0 + · simp [hm] + · have hne : (top.len % 4 == 0) = false := beq_eq_false_iff_ne.mpr hm + rw [hne]; simp [hm] + · have hc1f : (top.width == 1 && top.pat == 1) = false := Bool.eq_false_iff.mpr c1 + simp only [hc1f, Bool.false_eq_true, ↓reduceIte] + +theorem can_absorb_f_eq : can_absorb_f = can_absorb := by + funext s; unfold can_absorb_f + induction s with + | nil => rfl + | cons top rest ih => + unfold can_absorb + simp only [ih] + simp only [matchStackFast_eq, band_fast_eq, bool_rec_eq, nat_beq_def, nat_ble_def, nat_mod_def, Bool.and_assoc] + by_cases c1 : (top.width == 1 && top.pat == 1) = true + · simp only [c1, ↓reduceIte] + cases rest with + | nil => rfl + | cons rhd rtl => + dsimp only [List.isEmpty, Bool.false_eq_true, ↓reduceIte] + by_cases hm : top.len % 4 = 0 + · simp [hm] + · have hne : (top.len % 4 == 0) = false := beq_eq_false_iff_ne.mpr hm + rw [hne]; simp [hm] + · have hc1f : (top.width == 1 && top.pat == 1) = false := Bool.eq_false_iff.mpr c1 + simp only [hc1f, Bool.false_eq_true, ↓reduceIte] + +theorem pre_pair_l_f_eq {can_pair_fn} (h1 : can_pair_fn = can_pair) : + pre_pair_l_f can_pair_fn = pre_pair_l := by + subst h1; funext s; unfold pre_pair_l_f + match s with + | b1 :: b2 :: b3 :: rest => + dsimp only [pre_pair_l] + simp only [matchStackFast_eq, withNatFast_eq, band_fast_eq, bool_rec_eq, nat_beq_def, nat_ble_def, nat_sub_def, consBlock1_eq, Bool.and_assoc] + | b1 :: _ :: [] => + dsimp only [pre_pair_l] + simp only [matchStackFast_eq, band_fast_eq, nat_beq_def, Bool.and_assoc] + | [] => rfl + | [_] => rfl + +theorem pre_absorb_l_f_eq {can_absorb_fn} (h1 : can_absorb_fn = can_absorb) : + pre_absorb_l_f can_absorb_fn = pre_absorb_l := by + subst h1; funext s; unfold pre_absorb_l_f + match s with + | b1 :: b2 :: b3 :: rest => + dsimp only [pre_absorb_l] + simp only [matchStackFast_eq, withNatFast_eq, band_fast_eq, bool_rec_eq, nat_beq_def, nat_ble_def, nat_sub_def, consBlock1_eq, Bool.and_assoc] + | b1 :: _ :: [] => + dsimp only [pre_absorb_l] + simp only [matchStackFast_eq, band_fast_eq, nat_beq_def, Bool.and_assoc] + | [] => rfl + | [_] => rfl + +theorem can_parse_r_f_eq : can_parse_r_f = can_parse_r := by + funext s; cases s with + | nil => rfl + | cons top rest => + unfold can_parse_r_f can_parse_r + simp only [matchStackFast_eq, bnot_fast_eq, band_fast_eq, nat_beq_def, nat_mod_def, Bool.and_assoc] + +theorem do_shift_right_p_eq + {push_stack_f} (h1 : push_stack_f = push_stack) + {pop_word_f} (h2 : pop_word_f = pop_word) + {count_stack_mut_f} (h3 : count_stack_mut_f = count_stack_mut) : + do_shift_right_f_p push_stack_f pop_word_f count_stack_mut_f 8 = do_shift_right := by + subst h1; subst h2; subst h3; funext sq sw sin sout sout_w s + unfold do_shift_right_f_p do_shift_right + simp only [bool_rec_eq, withOptionFast_eq, someMStateFast_eq, nat_beq_def, nat_add_def, nat_mul_def, nat_shiftLeft_def, + Nat.shiftLeft_eq, Nat.one_mul, with_prod_eq, withProdFast_eq, some_mstate_eq] + have hq : ((s.q.val == sq.val) = true) = (s.q = sq) := by + cases h : (s.q.val == sq.val) + · simp only [beq_eq_false_iff_ne] at h; simp [Fin.ext_iff, h] + · simp only [beq_iff_eq] at h; simp [Fin.ext_iff, h] + simp only [hq] + by_cases hsq : s.q = sq + · simp only [hsq, ↓reduceIte] + cases pop_word (sin + sin * 2 ^ sw) (2 * sw) s.r <;> rfl + · simp only [hsq, ↓reduceIte] + +theorem bit_pat_eq : ∀ (x : Fin 2), (if x == 1 then 1 else 0) = bit_pat x := by decide + +theorem do_shift_left_p_eq + {bit_of_bool_f} (h1 : bit_of_bool_f = fun x => bit_of x == 1) + {push_stack_f} (h2 : push_stack_f = push_stack) + {pop1_b_f} (h3 : pop1_b_f = fun s => ((pop1 s).1 == 1, (pop1 s).2)) + {pop_word_f} (h4 : pop_word_f = pop_word) + {count_stack_mut_f} (h5 : count_stack_mut_f = count_stack_mut) : + do_shift_left_f_p bit_of_bool_f push_stack_f pop1_b_f pop_word_f count_stack_mut_f 8 = do_shift_left := by + subst h1; subst h2; subst h3; subst h4; subst h5 + funext sq sw sin sout sout_w s + unfold do_shift_left_f_p do_shift_left + simp only [bool_rec_eq, withOptionFast_eq, someMStateFast_eq, bnot_fast_eq, bxor_fast_eq, + nat_beq_def, nat_add_def, nat_mul_def, nat_sub_def, + nat_shiftLeft_def, nat_shiftRight_def, Nat.shiftLeft_eq, Nat.one_mul, + Nat.shiftRight_eq_div_pow, Nat.pow_one, with_prod_eq, withProdFast_eq, some_mstate_eq, bit_pat_eq, + sym_xnor_eq] + have hq : ((s.q.val == sq.val) = true) = (s.q = sq) := by + cases h : (s.q.val == sq.val) + · simp only [beq_eq_false_iff_ne] at h; simp [Fin.ext_iff, h] + · simp only [beq_iff_eq] at h; simp [Fin.ext_iff, h] + simp only [hq] + by_cases hsq : s.q = sq + · simp only [hsq, ↓reduceIte] + by_cases heq : (pop1 s.r).1 = bit_of (sin + sin * 2 ^ sw) + · simp only [heq, beq_self_eq_true, Bool.true_and, ↓reduceIte] + cases pop_word ((sin + sin * 2 ^ sw) / 2) (2 * sw - 1) s.l <;> rfl + · have hne : ((pop1 s.r).1 == bit_of (sin + sin * 2 ^ sw)) = false := beq_eq_false_iff_ne.mpr heq + rw [hne]; simp only [Bool.false_and, Bool.false_eq_true, heq, ↓reduceIte] + · simp only [hsq, ↓reduceIte] + +theorem try_pair_stack_p_eq + {pre_pair_l_fn} (h0a : pre_pair_l_fn = pre_pair_l) + {can_parse_r_fn} (h0b : can_parse_r_fn = can_parse_r) + {can_pair_fn} (h0c : can_pair_fn = can_pair) + {pop_word_f} (h1 : pop_word_f = pop_word) + {bsize_parts_f} (h2 : bsize_parts_f = bsize_parts) + {put_l_stack_f} (h3 : put_l_stack_f = put_l_stack) + {put_r_rec_f} (h4 : put_r_rec_f = put_r_rec) + {parse_l_f} (h5 : parse_l_f = parse_l) + {parse_r_f} (h6 : parse_r_f = parse_r) + {sub_lsb_checked_f} (h7 : sub_lsb_checked_f = sub_lsb_checked) + {choose_limit_r_f} (h8 : choose_limit_r_f = choose_limit_r_loop) + {push_prefix_l_f} (h9 : push_prefix_l_f = push_prefix_l) : + try_pair_stack_f_p pre_pair_l_fn can_parse_r_fn can_pair_fn + pop_word_f bsize_parts_f put_l_stack_f put_r_rec_f + parse_l_f parse_r_f sub_lsb_checked_f choose_limit_r_f push_prefix_l_f = try_pair_stack := by + funext kfuel + subst h0a; subst h0b; subst h0c; subst h1; subst h2; subst h3; subst h4; subst h5; subst h6; subst h7; subst h8; subst h9 + funext s + unfold try_pair_stack_f_p try_pair_stack put_r_stack choose_limit_r + by_cases hq0 : s.q = 0 + · have hqb : Nat.beq s.q.val 0 = true := by rw [nat_beq_def, beq_iff_eq]; exact congrArg Fin.val hq0 + rw [hqb, if_pos hq0]; dsimp only + by_cases hpre : (pre_pair_l s.l && can_parse_r s.r) = true + · have hpreb : band_fast (pre_pair_l s.l) (can_parse_r s.r) = true := by rw [band_fast_eq]; exact hpre + rw [hpreb, if_pos hpre]; dsimp only + cases pop_word 29 5 s.l with + | none => rfl + | some lc => + dsimp only [withOptionFast] + by_cases hcp : can_pair lc = true + · rw [hcp, if_true_eq_true]; dsimp only + rw [withNatFast_eq] + generalize parse_l kfuel 100000000 lc = res_l + rcases res_l with ⟨a_list, l_tail⟩ + rw [withProdFast_eq, with_prod_eq]; dsimp only + rw [with_list_eq] + cases a_list with + | nil => rfl + | cons a_hd a_tl => + dsimp only [isEmptyPartListFast, List.isEmpty, Bool.false_eq_true, ↓reduceIte] + rw [withNatFast_eq, with_nat_eq] + generalize bsize_parts (a_hd :: a_tl) = n + rw [withNatFast_eq, with_nat_eq] + generalize choose_limit_r_loop n kfuel 0 s.r = lim_r + by_cases hlim : lim_r = 0 + · subst hlim; rfl + · have hne : Nat.beq lim_r 0 = false := by rw [nat_beq_def, beq_eq_false_iff_ne]; exact hlim + rw [hne, if_neg hlim]; dsimp only + generalize parse_r kfuel lim_r s.r = res_r + rcases res_r with ⟨b_list, r_tail⟩ + rw [withProdFast_eq, with_prod_eq]; dsimp only + rw [with_list_eq] + cases b_list with + | nil => rfl + | cons b_hd b_tl => + dsimp only [isEmptyPartListFast, List.isEmpty, Bool.false_eq_true, ↓reduceIte] + rw [withNatFast_eq, with_nat_eq] + simp only [withOptionFast_eq, someMStateFast_eq, fin6_0_eq, some_mstate_eq] + cases sub_lsb_checked kfuel n (bsize_parts (b_hd :: b_tl)) (a_hd :: a_tl) (b_hd :: b_tl) with + | some out => rfl + | none => + cases sub_lsb_checked kfuel (bsize_parts (b_hd :: b_tl)) n (b_hd :: b_tl) (a_hd :: a_tl) <;> rfl + · have hcpf : can_pair lc = false := Bool.eq_false_iff.mpr hcp + rw [hcpf, if_false_eq_true] + · have hpreb : band_fast (pre_pair_l s.l) (can_parse_r s.r) = false := by rw [band_fast_eq]; exact Bool.eq_false_iff.mpr hpre + rw [hpreb, if_neg hpre] + · have hqb : Nat.beq s.q.val 0 = false := by rw [nat_beq_def, beq_eq_false_iff_ne]; intro h; exact hq0 (Fin.ext h) + rw [hqb, if_neg hq0] + +theorem try_absorb_stack_p_eq + {pre_absorb_l_fn} (h0a : pre_absorb_l_fn = pre_absorb_l) + {can_parse_r_fn} (h0b : can_parse_r_fn = can_parse_r) + {can_absorb_fn} (h0c : can_absorb_fn = can_absorb) + {push_stack_f} (h1 : push_stack_f = push_stack) + {pop_word_f} (h2 : pop_word_f = pop_word) + {count_stack_mut_f} (h3 : count_stack_mut_f = count_stack_mut) + {bsize_parts_f} (h4 : bsize_parts_f = bsize_parts) + {put_r_rec_f} (h5 : put_r_rec_f = put_r_rec) + {parse_r_f} (h6 : parse_r_f = parse_r) + {sub_lsb_f} (h7 : sub_lsb_f = sub_lsb) + {choose_limit_r_f} (h8 : choose_limit_r_f = choose_limit_r_loop) + {push_prefix_l_f} (h9 : push_prefix_l_f = push_prefix_l) + {build_vprime_f} (h10 : build_vprime_f = build_vprime) : + try_absorb_stack_f_p pre_absorb_l_fn can_parse_r_fn can_absorb_fn + push_stack_f pop_word_f count_stack_mut_f bsize_parts_f + put_r_rec_f parse_r_f sub_lsb_f choose_limit_r_f push_prefix_l_f build_vprime_f = + try_absorb_stack := by + funext kfuel + subst h0a; subst h0b; subst h0c; subst h1; subst h2; subst h3; subst h4; subst h5; subst h6; subst h7; subst h8; subst h9; subst h10 + funext s + unfold try_absorb_stack_f_p try_absorb_stack put_r_stack choose_limit_r + by_cases hq0 : s.q = 0 + · have hqb : Nat.beq s.q.val 0 = true := by rw [nat_beq_def, beq_iff_eq]; exact congrArg Fin.val hq0 + rw [hqb, if_pos hq0]; dsimp only + by_cases hpre : (pre_absorb_l s.l && can_parse_r s.r) = true + · have hpreb : band_fast (pre_absorb_l s.l) (can_parse_r s.r) = true := by rw [band_fast_eq]; exact hpre + rw [hpreb, if_pos hpre]; dsimp only + cases pop_word 29 5 s.l with + | none => rfl + | some lc0 => + rw [withOptionFast_eq]; dsimp only + by_cases hca : can_absorb lc0 = true + · rw [hca, if_true_eq_true]; dsimp only + rw [withNatFast_eq] + generalize count_stack_mut 15 4 kfuel 100000000 lc0 = res1 + rcases res1 with ⟨n1, r1⟩ + rw [withProdFast_eq, with_prod_eq]; dsimp only + generalize count_stack_mut 13 4 kfuel 100000000 r1 = res_m + rcases res_m with ⟨nm, rm⟩ + rw [withProdFast_eq, with_prod_eq]; dsimp only + by_cases hm0 : nm = 0 + · subst hm0; rfl + · have hne_m : Nat.beq nm 0 = false := by rw [nat_beq_def, beq_eq_false_iff_ne]; exact hm0 + rw [hne_m, if_neg hm0]; dsimp only + rw [nat_add_def, withNatFast_eq, with_nat_eq] + generalize choose_limit_r_loop (n1 + nm) kfuel 0 s.r = lim_r + by_cases hlim0 : lim_r = 0 + · subst hlim0; rfl + · have hne_l : Nat.beq lim_r 0 = false := by rw [nat_beq_def, beq_eq_false_iff_ne]; exact hlim0 + rw [hne_l, if_neg hlim0]; dsimp only + generalize parse_r kfuel lim_r s.r = res_r + rcases res_r with ⟨b_list, r_tail⟩ + rw [withProdFast_eq, with_prod_eq]; dsimp only + rw [with_list_eq] + cases b_list with + | nil => rfl + | cons b_hd b_tl => + rw [isEmptyPartListFast_eq]; dsimp only [List.isEmpty]; rw [if_false_eq_true] + rw [withNatFast_eq, with_nat_eq] + generalize bsize_parts (b_hd :: b_tl) = k + have hmin_eq : nat_min_fast nm (@Bool.rec (fun _ => Nat) 1 (Nat.sub k n1) (Nat.ble (Nat.add n1 1) k)) = + calc_m_init nm n1 k := by + unfold calc_m_init + simp only [nat_min_fast_eq, bool_rec_eq, nat_ble_def, nat_add_def, nat_sub_def] + by_cases hlt : n1 < k + · rw [if_pos hlt, decide_eq_true (by omega), if_true_eq_true] + · rw [if_neg hlt, decide_eq_false (by omega), if_false_eq_true] + rw [hmin_eq, withNatFast_eq, with_nat_eq] + generalize calc_m_init nm n1 k = m_init + by_cases hmi0 : m_init = 0 + · subst hmi0; rfl + · have hne_i : Nat.beq m_init 0 = false := by rw [nat_beq_def, beq_eq_false_iff_ne]; exact hmi0 + rw [hne_i, if_neg hmi0]; dsimp only + have hsub_eq : + withOptionFast (sub_lsb kfuel false (b_hd :: b_tl) (build_vprime n1 m_init)) + (@Bool.rec (fun _ => Option (Nat × PartList)) + (withNatFast (Nat.sub m_init 1) (fun m_m1 => + withOptionFast (sub_lsb kfuel false (b_hd :: b_tl) (build_vprime n1 m_m1)) + none + (fun out => some (m_m1, out)))) + none + (Nat.ble m_init 1)) + (fun out => some (m_init, out)) = + try_absorb_sub kfuel n1 m_init (b_hd :: b_tl) := by + unfold try_absorb_sub + simp only [withOptionFast_eq, withNatFast_eq, bool_rec_eq, nat_ble_def, nat_sub_def] + cases sub_lsb kfuel false (b_hd :: b_tl) (build_vprime n1 m_init) with + | some out => rfl + | none => + dsimp only + by_cases hle1 : m_init ≤ 1 + · rw [if_pos hle1, decide_eq_true hle1, if_true_eq_true] + · rw [if_neg hle1, decide_eq_false hle1, if_false_eq_true] + cases sub_lsb kfuel false (b_hd :: b_tl) (build_vprime n1 (m_init - 1)) <;> rfl + rw [hsub_eq] + cases try_absorb_sub kfuel n1 m_init (b_hd :: b_tl) with + | none => rfl + | some pair_out => + rcases pair_out with ⟨m_use, out⟩ + dsimp only [withOptionFast, withProdFast] + generalize count_stack_mut 13 4 kfuel m_use r1 = res2 + rcases res2 with ⟨n2, r2⟩ + rw [with_prod_eq]; dsimp only + simp only [bool_rec_eq, nat_beq_def, nat_mul_def, nat_add_def, someMStateFast_eq, fin6_0_eq, some_mstate_eq] + by_cases hres2 : n2 = m_use + · simp [hres2] + · have hne2 : (n2 == m_use) = false := beq_eq_false_iff_ne.mpr hres2 + rw [hne2]; simp [hres2] + · have hcaf : can_absorb lc0 = false := Bool.eq_false_iff.mpr hca + rw [hcaf, if_false_eq_true] + · have hpreb : band_fast (pre_absorb_l s.l) (can_parse_r s.r) = false := by rw [band_fast_eq]; exact Bool.eq_false_iff.mpr hpre + rw [hpreb, if_neg hpre] + · have hqb : Nat.beq s.q.val 0 = false := by rw [nat_beq_def, beq_eq_false_iff_ne]; intro h; exact hq0 (Fin.ext h) + rw [hqb, if_neg hq0] + +theorem step_prim_p_eq + {push_stack_f} (h1 : push_stack_f = push_stack) + {pop1_b_f} (h2 : pop1_b_f = fun s => ((pop1 s).1 == 1, (pop1 s).2)) : + step_prim_f_p push_stack_f pop1_b_f = step_prim := by + subst h1; subst h2; funext s + unfold step_prim_f_p step_prim + rcases s with ⟨q, l, r⟩ + simp only [bool_rec_eq, someMStateFast_eq, fin6_0_eq, fin6_1_eq, fin6_2_eq, fin6_3_eq, fin6_4_eq, fin6_5_eq, + with_prod_eq, withProdFast_eq, some_mstate_eq, bit_pat_eq] + rcases hpr : pop1 r with ⟨b_r, r_rest⟩ + dsimp only + rcases q with ⟨_ | _ | _ | _ | _ | _ | q, hq⟩ <;> + rcases b_r with ⟨_ | _ | b_r, hb⟩ <;> (try rfl) <;> (try omega) + +theorem has_head_bit1_f_eq : has_head_bit1_f = has_head_bit1 := by + funext s; cases s with + | nil => rfl + | cons top rest => + unfold has_head_bit1_f has_head_bit1 + simp only [matchStackFast_eq, nat_land_def, nat_beq_def, Nat.and_one_is_mod] + +theorem can_any_macro_f_eq + {pre_pair_l_fn} (h1 : pre_pair_l_fn = pre_pair_l) + {pre_absorb_l_fn} (h2 : pre_absorb_l_fn = pre_absorb_l) + {can_parse_r_fn} (h3 : can_parse_r_fn = can_parse_r) : + can_any_macro_f pre_pair_l_fn pre_absorb_l_fn can_parse_r_fn = can_any_macro := by + subst h1; subst h2; subst h3 + funext s + unfold can_any_macro_f can_any_macro + simp only [bool_rec_eq, nat_beq_def] + rcases s with ⟨⟨_ | _ | _ | _ | _ | _ | q, hq⟩, l, r⟩ + · -- q = 0 + dsimp only [beq_self_eq_true, ↓reduceIte] + cases r with + | nil => simp [bor_fast_eq, band_fast_eq, matchStackFast_eq] + | cons top rest => + simp only [matchStackFast_eq, bor_fast_eq, band_fast_eq, bnot_fast_eq, nat_land_def, nat_beq_def, nat_ble_def, Nat.and_one_is_mod] + rfl + · -- q = 1 + simp only [band_fast_eq, has_head_bit1_f_eq] + rfl + · -- q = 2 + simp only [band_fast_eq, has_head_bit1_f_eq] + rfl + · -- q = 3 + cases r with + | nil => rfl + | cons top rest => + simp only [matchStackFast_eq, band_fast_eq, bnot_fast_eq, bool_rec_eq, nat_beq_def, nat_ble_def, has_head_bit1_f_eq, Bool.and_assoc] + have h30 : ((0 + 1 + 1 + 1 == 0) = true) = False := by decide + have h31 : ((0 + 1 + 1 + 1 == 1) = true) = False := by decide + have h32 : ((0 + 1 + 1 + 1 == 2) = true) = False := by decide + have h33 : ((0 + 1 + 1 + 1 == 3) = true) = True := by decide + simp only [h30, h31, h32, h33, ↓reduceIte] + by_cases c1 : (top.width == 1 && top.pat == 0) = true + · simp only [c1, ↓reduceIte] + by_cases hlt : 1 < top.len + · rw [if_pos hlt, decide_eq_true (by omega), if_true_eq_true]; rfl + · rw [if_neg hlt, decide_eq_false (by omega), if_false_eq_true]; rfl + · have hc1f : (top.width == 1 && top.pat == 0) = false := Bool.eq_false_iff.mpr c1 + simp only [hc1f, Bool.false_eq_true, ↓reduceIte] + cases rest <;> rfl + · -- q = 4 + rfl + · -- q = 5 + rfl + · omega + +theorem fin6_beq_5 : ∀ (q : Fin 6), (q.val == 5) = decide (q = 5) := by decide +theorem fin2_beq_1 : ∀ (x : Fin 2), (x == 1) = decide (x = 1) := by decide + +theorem run_prim_p_eq + {pop1_b_f} (h1 : pop1_b_f = fun s => ((pop1 s).1 == 1, (pop1 s).2)) + {can_any_macro_fn} (h2 : can_any_macro_fn = can_any_macro) + {step_prim_f} (h3 : step_prim_f = step_prim) : + run_prim_f_p pop1_b_f can_any_macro_fn step_prim_f = run_prim := by + subst h1; subst h2; subst h3 + funext fuel s + unfold run_prim_f_p + induction fuel generalizing s with + | zero => rfl + | succ fuel ih => + unfold run_prim + dsimp only + rw [bool_rec_eq, bor_fast_eq, band_fast_eq, nat_beq_def, fin6_beq_5 s.q, fin2_beq_1 (pop1 s.r).1] + split_ifs with hc + · rfl + · rw [withOptionFast_eq] + cases step_prim s with + | none => rfl + | some s1 => exact ih s1 + +theorem step_prim_plus_p_eq + {step_prim_f} (h1 : step_prim_f = step_prim) + {run_prim_f} (h2 : run_prim_f = run_prim) : + step_prim_plus_f_p step_prim_f run_prim_f = step_prim_plus := by + subst h1; subst h2 + funext s + unfold step_prim_plus_f_p step_prim_plus + simp only [withOptionFast_eq] + cases step_prim s <;> rfl + +theorem step_m_p_eq + {do_shift_right_f : Nat → Fin 6 → Nat → Nat → Nat → Nat → MState → Option MState} (h1 : do_shift_right_f 8 = do_shift_right) + {do_shift_left_f : Nat → Fin 6 → Nat → Nat → Nat → Nat → MState → Option MState} (h2 : do_shift_left_f 8 = do_shift_left) + {try_pair_stack_f : Nat → MState → Option MState} (h3 : try_pair_stack_f = try_pair_stack) + {try_absorb_stack_f : Nat → MState → Option MState} (h4 : try_absorb_stack_f = try_absorb_stack) + {step_prim_plus_f} (h5 : step_prim_plus_f = step_prim_plus) : + step_m_f_p do_shift_right_f do_shift_left_f try_pair_stack_f try_absorb_stack_f step_prim_plus_f 8 = step_m := by + subst h5; funext s; unfold step_m_f_p; rw [h1, h2, h3, h4]; unfold step_m + simp only [bool_rec_eq, nat_beq_def, withOptionFast_eq, stack_len_fast_eq, fin6_0_eq, fin6_1_eq, fin6_2_eq, fin6_3_eq] + rcases s with ⟨⟨_ | _ | _ | _ | _ | _ | q, hq⟩, l, r⟩ + · unfold step_m_q0 + have hq_eq : (⟨0, hq⟩ : Fin 6) = 0 := rfl + have h00 : ((0 == 0) = true) = True := by decide + rw [hq_eq] + simp only [h00, ↓reduceIte] + cases try_pair_stack (Nat.add (Nat.add l.length r.length) 4) ⟨0, l, r⟩ <;> + cases try_absorb_stack (Nat.add (Nat.add l.length r.length) 4) ⟨0, l, r⟩ <;> + cases do_shift_right 0 3 1 1 1 ⟨0, l, r⟩ <;> rfl + · unfold step_m_q1 + have hq_eq : (⟨0 + 1, hq⟩ : Fin 6) = 1 := rfl + have h10 : ((0 + 1 == 0) = true) = False := by decide + have h11 : ((0 + 1 == 1) = true) = True := by decide + rw [hq_eq] + simp only [h10, h11, ↓reduceIte] + cases do_shift_left 1 1 1 0 1 ⟨1, l, r⟩ <;> rfl + · unfold step_m_q2 + have hq_eq : (⟨0 + 1 + 1, hq⟩ : Fin 6) = 2 := rfl + have h20 : ((0 + 1 + 1 == 0) = true) = False := by decide + have h21 : ((0 + 1 + 1 == 1) = true) = False := by decide + have h22 : ((0 + 1 + 1 == 2) = true) = True := by decide + rw [hq_eq] + simp only [h20, h21, h22, ↓reduceIte] + cases do_shift_left 2 2 3 1 2 ⟨2, l, r⟩ <;> rfl + · unfold step_m_q3 + have hq_eq : (⟨0 + 1 + 1 + 1, hq⟩ : Fin 6) = 3 := rfl + have h30 : ((0 + 1 + 1 + 1 == 0) = true) = False := by decide + have h31 : ((0 + 1 + 1 + 1 == 1) = true) = False := by decide + have h32 : ((0 + 1 + 1 + 1 == 2) = true) = False := by decide + have h33 : ((0 + 1 + 1 + 1 == 3) = true) = True := by decide + rw [hq_eq] + simp only [h30, h31, h32, h33, ↓reduceIte] + cases do_shift_right 3 1 1 0 1 ⟨3, l, r⟩ <;> + cases do_shift_right 3 3 2 1 1 ⟨3, l, r⟩ <;> + cases do_shift_right 3 4 10 14 4 ⟨3, l, r⟩ <;> + cases do_shift_right 3 4 5 7 4 ⟨3, l, r⟩ <;> rfl + · rfl + · rfl + · omega + +noncomputable def mkBlock_f0 : Nat → Nat → Nat → Block := mkBlock_f_p +noncomputable def rot1_f0 : Nat → Nat → Nat := rot1_f_p +noncomputable def rot_mod_f0 : Nat → Nat → Nat → Nat := rot_mod_f_p +noncomputable def bit_of_bool_f0 : Nat → Bool := bit_of_bool_f_p +noncomputable def push_stack_f0 : Nat → Nat → Nat → Stack → Stack := push_stack_fast +noncomputable def drop_stack_f0 : Nat → Stack → Stack := drop_stack_fast +noncomputable def pop1_b_f0 : Stack → Bool × Stack := pop1_b_fast +noncomputable def pop_word_f0 : Nat → Nat → Stack → Option Stack := pop_word_f_p bit_of_bool_f0 pop1_b_f0 +noncomputable def fast_match_f0 : Nat → Nat → Block → Bool := fast_match_f_p +noncomputable def count_stack_mut_f0 : Nat → Nat → Nat → Nat → Stack → Nat × Stack := count_stack_mut_f_p drop_stack_f0 pop_word_f0 fast_match_f0 +noncomputable def mkPart_f0 : Bool → Nat → PartList → PartList := mkPart_f_p +noncomputable def bsize_parts_f0 : PartList → Nat := bsize_parts_f_p +noncomputable def put_l_parts_f0 : PartList → Stack → Stack := put_l_parts_f_p push_stack_f0 +noncomputable def put_l_stack_f0 : PartList → Nat → Stack → Stack := put_l_stack_f_p push_stack_f0 bsize_parts_f0 put_l_parts_f0 +noncomputable def put_r_rec_f0 : PartList → Nat → Stack → Stack := put_r_rec_f_p push_stack_f0 +noncomputable def parse_step_l_f0 : Nat → Stack → Option (Bool × Nat × Stack) := parse_step_l_f_p drop_stack_f0 pop_word_f0 +noncomputable def parse_l_f0 : Nat → Nat → Stack → PartList × Stack := parse_l_f_p parse_step_l_f0 +noncomputable def parse_step_r_f0 : Nat → Stack → Option (Bool × Nat × Stack) := parse_step_r_f_p drop_stack_f0 pop_word_f0 +noncomputable def parse_r_f0 : Nat → Nat → Stack → PartList × Stack := parse_r_f_p push_stack_f0 pop1_b_f0 parse_step_r_f0 +noncomputable def sub_lsb_f0 : Nat → Bool → PartList → PartList → Option PartList := sub_lsb_f_p mkPart_f0 +noncomputable def sub_lsb_checked_f0 : Nat → Nat → Nat → PartList → PartList → Option PartList := sub_lsb_checked_f_p sub_lsb_f0 +noncomputable def drop_mult3_f0 : Block → Stack → Stack := drop_mult3_fast +noncomputable def choose_limit_r_f0 : Nat → Nat → Nat → Stack → Nat := choose_limit_r_f_p drop_mult3_f0 pop1_b_f0 pop_word_f0 +noncomputable def push_prefix_l_f0 : Stack → Stack := push_prefix_l_f_p push_stack_f0 +noncomputable def build_vprime_f0 : Nat → Nat → PartList := build_vprime_f_p mkPart_f0 +noncomputable def can_pair_f0 : Stack → Bool := can_pair_f +noncomputable def can_absorb_f0 : Stack → Bool := can_absorb_f +noncomputable def pre_pair_l_f0 : Stack → Bool := pre_pair_l_f can_pair_f0 +noncomputable def pre_absorb_l_f0 : Stack → Bool := pre_absorb_l_f can_absorb_f0 +noncomputable def can_parse_r_f0 : Stack → Bool := can_parse_r_f +noncomputable def do_shift_right_f0 : Nat → Fin 6 → Nat → Nat → Nat → Nat → MState → Option MState := do_shift_right_f_p push_stack_f0 pop_word_f0 count_stack_mut_f0 +noncomputable def do_shift_left_f0 : Nat → Fin 6 → Nat → Nat → Nat → Nat → MState → Option MState := do_shift_left_f_p bit_of_bool_f0 push_stack_f0 pop1_b_f0 pop_word_f0 count_stack_mut_f0 +noncomputable def try_pair_stack_f0 : Nat → MState → Option MState := try_pair_stack_f_p pre_pair_l_f0 can_parse_r_f0 can_pair_f0 pop_word_f0 bsize_parts_f0 put_l_stack_f0 put_r_rec_f0 parse_l_f0 parse_r_f0 sub_lsb_checked_f0 choose_limit_r_f0 push_prefix_l_f0 +noncomputable def try_absorb_stack_f0 : Nat → MState → Option MState := try_absorb_stack_f_p pre_absorb_l_f0 can_parse_r_f0 can_absorb_f0 push_stack_f0 pop_word_f0 count_stack_mut_f0 bsize_parts_f0 put_r_rec_f0 parse_r_f0 sub_lsb_f0 choose_limit_r_f0 push_prefix_l_f0 build_vprime_f0 +noncomputable def step_prim_f0 : MState → Option MState := step_prim_f_p push_stack_f0 pop1_b_f0 +noncomputable def can_any_macro_f0 : MState → Bool := can_any_macro_f pre_pair_l_f0 pre_absorb_l_f0 can_parse_r_f0 +noncomputable def run_prim_f0 : Nat → MState → Option MState := run_prim_f_p pop1_b_f0 can_any_macro_f0 step_prim_f0 +noncomputable def step_prim_plus_f0 : MState → Option MState := step_prim_plus_f_p step_prim_f0 run_prim_f0 +noncomputable def step_m_c0 : MState → Option MState := step_m_f_p do_shift_right_f0 do_shift_left_f0 try_pair_stack_f0 try_absorb_stack_f0 step_prim_plus_f0 8 + +noncomputable def run_m_fast (fuel : Nat) (s0 : MState) : Option MState := + @Nat.rec (fun _ => MState → Option MState) + (fun s => some s) + (fun _ ih s => + withOptionFast (step_m_c0 s) none ih) + fuel s0 + +noncomputable def block_beq (a b : Block) : Bool := + band_fast (Nat.beq a.pat b.pat) (band_fast (Nat.beq a.width b.width) (Nat.beq a.len b.len)) + +noncomputable def stack_beq : Stack → Stack → Bool := + @List.rec Block (fun _ => Stack → Bool) + (fun ys => @List.rec Block (fun _ => Bool) true (fun _ _ _ => false) ys) + (fun x _ ih ys => + @List.rec Block (fun _ => Bool) false (fun y ys2 _ => band_fast (block_beq x y) (ih ys2)) ys) + +noncomputable def opt_mstate_beq (o : Option MState) (target : MState) : Bool := + withOptionFast o false (fun s => + band_fast (Nat.beq s.q.val target.q.val) + (band_fast (stack_beq s.l target.l) (stack_beq s.r target.r))) + +noncomputable def is_some_m (o : Option MState) : Bool := withOptionFast o false (fun _ => true) + + +theorem step_m_c0_eq : step_m_c0 = step_m := + let h04 := bit_of_bool_p_eq + let h06 := push_stack_fast_eq + let h07 := drop_stack_fast_eq + let h08 := pop1_b_fast_eq + let h09 := pop_word_p_eq h04 h08 + let h10 := fast_match_p_eq + let h11 := count_stack_mut_p_eq h07 h09 h10 + let h12 := mkPart_p_eq + let h13 := bsize_parts_p_eq + let h14 := put_l_parts_p_eq h06 + let h15 := put_l_stack_p_eq h06 h13 h14 + let h16 := put_r_rec_p_eq h06 + let h17 := parse_step_l_p_eq h07 h09 + let h18 := parse_l_p_eq h17 + let h19 := parse_step_r_p_eq h07 h09 + let h20 := parse_r_p_eq h06 h08 h19 + let h21 := sub_lsb_p_eq h12 + let h21b := sub_lsb_checked_p_eq h21 + let h22a := drop_mult3_fast_eq + let h22 := choose_limit_r_p_eq h22a h08 h09 + let h23 := push_prefix_l_p_eq h06 + let h24 := build_vprime_p_eq h12 + let h24a := can_pair_f_eq + let h24b := can_absorb_f_eq + let h24c := pre_pair_l_f_eq h24a + let h24d := pre_absorb_l_f_eq h24b + let h24e := can_parse_r_f_eq + let h25 := do_shift_right_p_eq h06 h09 h11 + let h26 := do_shift_left_p_eq h04 h06 h08 h09 h11 + let h27 := try_pair_stack_p_eq h24c h24e h24a h09 h13 h15 h16 h18 h20 h21b h22 h23 + let h28 := try_absorb_stack_p_eq h24d h24e h24b h06 h09 h11 h13 h16 h20 h21 h22 h23 h24 + let h29 := step_prim_p_eq h06 h08 + let h29a := can_any_macro_f_eq h24c h24d h24e + let h29b := run_prim_p_eq h08 h29a h29 + let h29c := step_prim_plus_p_eq h29 h29b + step_m_p_eq h25 h26 h27 h28 h29c + +theorem run_m_loop_eq {step_f : MState → Option MState} + (hstep : step_f = step_m) (fuel : Nat) (s0 : MState) : + @Nat.rec (fun _ => MState → Option MState) + (fun s => some s) + (fun _ ih s => + withOptionFast (step_f s) none ih) + fuel s0 = run_m fuel s0 := by + subst hstep + induction fuel generalizing s0 with + | zero => rfl + | succ i ih => + unfold run_m + dsimp only + cases hs : step_m s0 with + | none => rfl + | some s1 => exact ih s1 + +theorem run_m_fast_eq (fuel : Nat) (s0 : MState) : + run_m_fast fuel s0 = run_m fuel s0 := + run_m_loop_eq step_m_c0_eq fuel s0 + +theorem block_beq_eq {a b : Block} (h : block_beq a b = true) : a = b := by + rcases a with ⟨p1, w1, l1⟩; rcases b with ⟨p2, w2, l2⟩ + simp only [block_beq, band_fast_eq, Bool.and_eq_true, Nat.beq_eq] at h + rcases h with ⟨rfl, rfl, rfl⟩ + rfl + +theorem stack_beq_eq : ∀ {xs ys : Stack}, stack_beq xs ys = true → xs = ys + | [], [], _ => rfl + | x :: xs, y :: ys, h => by + change band_fast (block_beq x y) (stack_beq xs ys) = true at h + simp only [band_fast_eq, Bool.and_eq_true] at h + rw [block_beq_eq h.1, stack_beq_eq h.2] + +theorem opt_mstate_beq_eq {o : Option MState} {t : MState} (h : opt_mstate_beq o t = true) : + o = some t := by + cases o with + | none => cases h + | some s => + rcases s with ⟨q1, l1, r1⟩; rcases t with ⟨q2, l2, r2⟩ + simp only [opt_mstate_beq, withOptionFast_eq, band_fast_eq, Bool.and_eq_true, Nat.beq_eq] at h + rcases h with ⟨hq, hl, hr⟩ + rw [Fin.ext hq, stack_beq_eq hl, stack_beq_eq hr] + +theorem run_m_trans {m n : Nat} {s1 s2 s3 : MState} + (h1 : run_m m s1 = some s2) (h2 : run_m n s2 = some s3) : + run_m (m + n) s1 = some s3 := by + induction m generalizing s1 with + | zero => + simp [run_m] at h1; subst h1; simpa using! h2 + | succ m ih => + simp only [run_m, Nat.succ_add] at h1 ⊢ + cases hs : step_m s1 with + | none => simp [hs] at h1 + | some s' => simp [hs] at h1 ⊢; exact ih h1 + +def MReach (s1 s2 : MState) : Prop := + ∃ fuel, run_m fuel s1 = some s2 + +theorem mreach_base_fast {k : Nat} {s1 s2 : MState} + (h : opt_mstate_beq (run_m_fast k s1) s2 = true) : MReach s1 s2 := + ⟨k, (run_m_fast_eq k s1).symm.trans (opt_mstate_beq_eq h)⟩ + +theorem mreach_step_fast {k : Nat} {s1 s2 s3 : MState} + (h1 : opt_mstate_beq (run_m_fast k s1) s2 = true) (h2 : MReach s2 s3) : MReach s1 s3 := + let ⟨n, hn⟩ := h2 + ⟨k + n, run_m_trans ((run_m_fast_eq k s1).symm.trans (opt_mstate_beq_eq h1)) hn⟩ + + +private def cfg_0 : MState := ⟨4, [], []⟩ +private def cfg_1 : MState := ⟨3, [⟨0, 1, 2⟩, ⟨7, 4, 32⟩, ⟨1, 1, 12⟩, ⟨14, 4, 8⟩, ⟨1, 1, 16⟩, ⟨14, 4, 8⟩, ⟨1, 1, 4⟩, ⟨14, 4, 12⟩, ⟨1, 1, 4⟩, ⟨14, 4, 12⟩, ⟨1, 1, 4⟩, ⟨14, 4, 700⟩, ⟨1, 1, 1⟩], [⟨4, 3, 215⟩, ⟨0, 1, 51⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 1⟩]⟩ -- +1100 (step 1100, blks=20) +private def cfg_2 : MState := ⟨3, [⟨1, 1, 21⟩, ⟨14, 4, 40⟩, ⟨1, 1, 16⟩, ⟨14, 4, 8⟩, ⟨1, 1, 8⟩, ⟨14, 4, 12⟩, ⟨1, 1, 8⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨13, 4, 1685⟩, ⟨1, 1, 1⟩], [⟨2, 3, 1⟩, ⟨0, 1, 3⟩, ⟨1, 3, 27⟩, ⟨0, 1, 3⟩, ⟨1, 3, 363⟩, ⟨0, 1, 3⟩, ⟨1, 3, 387⟩, ⟨0, 1, 324⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 1⟩]⟩ -- +1102 (step 2202, blks=25) +private def cfg_3 : MState := ⟨3, [⟨14, 4, 48⟩, ⟨1, 1, 24⟩, ⟨14, 4, 16⟩, ⟨1, 1, 8⟩, ⟨14, 4, 12⟩, ⟨1, 1, 4⟩, ⟨13, 4, 45⟩, ⟨1, 1, 4⟩, ⟨14, 4, 64⟩, ⟨1, 1, 4⟩, ⟨14, 4, 172⟩, ⟨1, 1, 4⟩, ⟨14, 4, 3000⟩, ⟨1, 1, 1⟩], [⟨1, 3, 945⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 867⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 1⟩]⟩ -- +1305 (step 3507, blks=25) +private def cfg_4 : MState := ⟨1, [⟨1, 1, 26⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 6968⟩, ⟨1, 1, 1⟩], [⟨0, 1, 5⟩, ⟨1, 1, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 15⟩, ⟨0, 1, 6⟩, ⟨1, 3, 48⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 102⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 12⟩, ⟨1, 3, 282⟩, ⟨0, 1, 3⟩, ⟨1, 3, 24⟩, ⟨0, 1, 3⟩, ⟨1, 3, 1605⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1137⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1329⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 402⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 1⟩]⟩ -- +1360 (step 4867, blks=43) +private def cfg_5 : MState := ⟨3, [⟨14, 4, 12⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 16⟩, ⟨14, 4, 136⟩, ⟨1, 1, 8⟩, ⟨14, 4, 12⟩, ⟨13, 4, 105⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨13, 4, 1⟩, ⟨1, 1, 4⟩, ⟨14, 4, 12⟩, ⟨13, 4, 1⟩, ⟨1, 1, 4⟩, ⟨14, 4, 52⟩, ⟨1, 1, 4⟩, ⟨14, 4, 7636⟩, ⟨1, 1, 1⟩], [⟨1, 3, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 24⟩, ⟨0, 1, 3⟩, ⟨1, 3, 60⟩, ⟨0, 1, 1050⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1137⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1329⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 402⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 990⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 129⟩, ⟨1, 3, 1⟩]⟩ -- +1335 (step 6202, blks=48) +private def cfg_6 : MState := ⟨3, [⟨14, 4, 12⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 12⟩, ⟨1, 1, 12⟩, ⟨14, 4, 12488⟩, ⟨1, 1, 1⟩], [⟨0, 1, 30⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 9⟩, ⟨1, 3, 18⟩, ⟨0, 1, 15⟩, ⟨1, 3, 9⟩, ⟨0, 1, 15⟩, ⟨1, 3, 36⟩, ⟨0, 1, 3⟩, ⟨1, 3, 189⟩, ⟨0, 1, 153⟩, ⟨1, 3, 180⟩, ⟨0, 1, 51⟩, ⟨1, 3, 6⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 90⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 474⟩, ⟨0, 1, 3⟩, ⟨1, 3, 150⟩, ⟨0, 1, 12⟩, ⟨1, 3, 9⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 12⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 33⟩, ⟨1, 3, 48⟩, ⟨0, 1, 3⟩, ⟨1, 3, 150⟩, ⟨0, 1, 3⟩, ⟨1, 3, 75⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 51⟩, ⟨1, 3, 9⟩, ⟨0, 1, 9⟩, ⟨1, 3, 33⟩, ⟨0, 1, 1014⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 318⟩, ⟨0, 1, 69⟩, ⟨1, 3, 5406⟩, ⟨0, 1, 384⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 1⟩]⟩ -- +1165 (step 7367, blks=72) +private def cfg_7 : MState := ⟨3, [⟨7, 4, 8⟩, ⟨1, 1, 13⟩, ⟨14, 4, 4⟩, ⟨1, 1, 20⟩, ⟨14, 4, 4⟩, ⟨1, 1, 16⟩, ⟨14, 4, 13812⟩, ⟨1, 1, 1⟩], [⟨1, 1, 1⟩, ⟨1, 3, 12⟩, ⟨0, 1, 6⟩, ⟨1, 3, 87⟩, ⟨0, 1, 3⟩, ⟨1, 3, 30⟩, ⟨0, 1, 3⟩, ⟨1, 3, 81⟩, ⟨0, 1, 9⟩, ⟨1, 3, 9⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 18⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 9⟩, ⟨1, 3, 18⟩, ⟨0, 1, 3⟩, ⟨1, 3, 18⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 18⟩, ⟨0, 1, 12⟩, ⟨1, 3, 48⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 141⟩, ⟨0, 1, 3⟩, ⟨1, 3, 75⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 51⟩, ⟨1, 3, 9⟩, ⟨0, 1, 9⟩, ⟨1, 3, 33⟩, ⟨0, 1, 1014⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 318⟩, ⟨0, 1, 69⟩, ⟨1, 3, 5406⟩, ⟨0, 1, 384⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1767⟩, ⟨1, 3, 3⟩, ⟨0, 1, 426⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 1⟩]⟩ -- +1198 (step 8565, blks=70) +private def cfg_8 : MState := ⟨0, [⟨1, 1, 1⟩, ⟨0, 1, 1⟩, ⟨1, 1, 3⟩, ⟨14, 4, 452⟩, ⟨13, 4, 1⟩, ⟨1, 1, 4⟩, ⟨14, 4, 16⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨13, 4, 14129⟩, ⟨1, 1, 1⟩], [⟨0, 1, 6⟩, ⟨1, 3, 42⟩, ⟨0, 1, 3⟩, ⟨1, 3, 21⟩, ⟨0, 1, 3⟩, ⟨1, 3, 18⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 48⟩, ⟨0, 1, 3⟩, ⟨1, 3, 27⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 6⟩, ⟨0, 1, 111⟩, ⟨1, 3, 3⟩, ⟨0, 1, 723⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 318⟩, ⟨0, 1, 69⟩, ⟨1, 3, 5406⟩, ⟨0, 1, 384⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1767⟩, ⟨1, 3, 3⟩, ⟨0, 1, 426⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 192⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 1⟩]⟩ -- +1439 (step 10004, blks=65) +private def cfg_9 : MState := ⟨0, [⟨1, 1, 7⟩, ⟨0, 1, 1⟩, ⟨1, 1, 41⟩, ⟨14, 4, 4⟩, ⟨13, 4, 5⟩, ⟨1, 1, 12⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 15144⟩, ⟨1, 1, 1⟩], [⟨0, 1, 452⟩, ⟨1, 1, 1⟩, ⟨0, 1, 5⟩, ⟨1, 3, 318⟩, ⟨0, 1, 69⟩, ⟨1, 3, 5406⟩, ⟨0, 1, 384⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1767⟩, ⟨1, 3, 3⟩, ⟨0, 1, 426⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 192⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 906⟩, ⟨1, 3, 3⟩, ⟨0, 1, 507⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 1⟩]⟩ -- +1105 (step 11109, blks=60) +private def cfg_10 : MState := ⟨0, [⟨1, 1, 19⟩, ⟨0, 1, 1⟩, ⟨1, 1, 51⟩, ⟨13, 4, 1⟩, ⟨13, 4, 16581⟩, ⟨1, 1, 1⟩], [⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 66⟩, ⟨1, 3, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 30⟩, ⟨0, 1, 3⟩, ⟨1, 3, 18⟩, ⟨0, 1, 3⟩, ⟨1, 3, 4689⟩, ⟨0, 1, 384⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1767⟩, ⟨1, 3, 3⟩, ⟨0, 1, 426⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 192⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 906⟩, ⟨1, 3, 3⟩, ⟨0, 1, 507⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 906⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 552⟩, ⟨1, 3, 6⟩, ⟨0, 1, 381⟩, ⟨1, 3, 3⟩, ⟨0, 1, 549⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 1⟩]⟩ -- +1323 (step 12432, blks=76) +private def cfg_11 : MState := ⟨3, [⟨14, 4, 1524⟩, ⟨1, 1, 1⟩, ⟨7, 4, 155⟩, ⟨1, 1, 4⟩, ⟨14, 4, 312⟩, ⟨1, 1, 572⟩, ⟨14, 4, 1192⟩, ⟨1, 1, 48⟩, ⟨14, 4, 4⟩, ⟨1, 1, 60⟩, ⟨14, 4, 320⟩, ⟨1, 1, 512⟩, ⟨14, 4, 1416⟩, ⟨1, 1, 4⟩, ⟨14, 4, 2724⟩, ⟨1, 1, 9⟩, ⟨14, 4, 24⟩, ⟨1, 1, 12⟩, ⟨14, 4, 32⟩, ⟨1, 1, 16⟩, ⟨14, 4, 8⟩, ⟨1, 1, 8⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 120⟩, ⟨1, 1, 4⟩, ⟨14, 4, 12⟩, ⟨1, 1, 4⟩, ⟨14, 4, 5944⟩, ⟨1, 1, 4⟩, ⟨14, 4, 10628⟩, ⟨1, 1, 1⟩], [⟨0, 1, 485⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 12⟩, ⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 15⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 132⟩, ⟨0, 1, 3⟩, ⟨1, 3, 12⟩, ⟨0, 1, 27⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 84⟩, ⟨0, 1, 51⟩, ⟨1, 3, 105⟩, ⟨0, 1, 3⟩, ⟨1, 3, 126⟩, ⟨0, 1, 624⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 552⟩, ⟨1, 3, 6⟩, ⟨0, 1, 381⟩, ⟨1, 3, 3⟩, ⟨0, 1, 549⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 1⟩]⟩ -- +1227 (step 13659, blks=72) +private def cfg_12 : MState := ⟨1, [⟨1, 1, 4⟩, ⟨14, 4, 96⟩, ⟨1, 1, 9⟩, ⟨14, 4, 12⟩, ⟨1, 1, 12⟩, ⟨14, 4, 16⟩, ⟨1, 1, 12⟩, ⟨14, 4, 32⟩, ⟨1, 1, 4⟩, ⟨14, 4, 32⟩, ⟨13, 4, 45⟩, ⟨1, 1, 16⟩, ⟨14, 4, 4⟩, ⟨13, 4, 1⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 492⟩, ⟨1, 1, 1⟩, ⟨7, 4, 3⟩, ⟨1, 1, 1⟩, ⟨7, 4, 3⟩, ⟨13, 4, 1⟩, ⟨1, 1, 17⟩, ⟨14, 4, 12⟩, ⟨13, 4, 61⟩, ⟨1, 1, 4⟩, ⟨14, 4, 24⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 8⟩, ⟨1, 1, 8⟩, ⟨14, 4, 12⟩, ⟨1, 1, 12⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨13, 4, 5⟩, ⟨13, 4, 309⟩, ⟨1, 1, 4⟩, ⟨14, 4, 26096⟩, ⟨1, 1, 1⟩], [⟨0, 1, 35⟩, ⟨1, 1, 1⟩, ⟨0, 1, 8⟩, ⟨1, 3, 6⟩, ⟨0, 1, 33⟩, ⟨1, 3, 6⟩, ⟨0, 1, 171⟩, ⟨1, 3, 117⟩, ⟨0, 1, 3⟩, ⟨1, 3, 222⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 372⟩, ⟨1, 3, 3⟩, ⟨0, 1, 51⟩, ⟨1, 3, 498⟩, ⟨0, 1, 48⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 33⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 240⟩, ⟨0, 1, 384⟩, ⟨1, 3, 1062⟩, ⟨0, 1, 3⟩, ⟨1, 3, 2043⟩, ⟨0, 1, 9⟩, ⟨1, 3, 18⟩, ⟨0, 1, 9⟩, ⟨1, 3, 24⟩, ⟨0, 1, 12⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 90⟩, ⟨0, 1, 3⟩, ⟨1, 3, 9⟩, ⟨0, 1, 3⟩, ⟨1, 3, 4458⟩, ⟨0, 1, 3⟩, ⟨1, 3, 7971⟩, ⟨0, 1, 9⟩, ⟨1, 3, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 1⟩]⟩ -- +1472 (step 15131, blks=95) +private def cfg_13 : MState := ⟨1, [⟨1, 1, 19⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 16⟩, ⟨1, 1, 12⟩, ⟨14, 4, 32⟩, ⟨1, 1, 4⟩, ⟨14, 4, 188⟩, ⟨1, 1, 20⟩, ⟨14, 4, 48⟩, ⟨1, 1, 4⟩, ⟨14, 4, 28688⟩, ⟨1, 1, 1⟩], [⟨0, 1, 8⟩, ⟨1, 1, 1⟩, ⟨0, 1, 59⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 9⟩, ⟨1, 3, 12⟩, ⟨0, 1, 9⟩, ⟨1, 3, 24⟩, ⟨0, 1, 3⟩, ⟨1, 3, 24⟩, ⟨0, 1, 3⟩, ⟨1, 3, 30⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 12⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 48⟩, ⟨0, 1, 3⟩, ⟨1, 3, 237⟩, ⟨0, 1, 84⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 9⟩, ⟨0, 1, 90⟩, ⟨1, 3, 45⟩, ⟨0, 1, 3⟩, ⟨1, 3, 18⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 9⟩, ⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 15⟩, ⟨1, 3, 372⟩, ⟨0, 1, 6⟩, ⟨1, 3, 231⟩, ⟨0, 1, 3⟩, ⟨1, 3, 450⟩, ⟨0, 1, 3⟩, ⟨1, 3, 2043⟩, ⟨0, 1, 9⟩, ⟨1, 3, 18⟩, ⟨0, 1, 9⟩, ⟨1, 3, 24⟩, ⟨0, 1, 12⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 90⟩, ⟨0, 1, 3⟩, ⟨1, 3, 9⟩, ⟨0, 1, 3⟩, ⟨1, 3, 4458⟩, ⟨0, 1, 3⟩, ⟨1, 3, 7971⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 4434⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 1⟩]⟩ -- +1449 (step 16580, blks=87) +private def cfg_14 : MState := ⟨0, [⟨1, 1, 7⟩, ⟨0, 1, 1⟩, ⟨1, 1, 63⟩, ⟨13, 4, 1⟩, ⟨13, 4, 29833⟩, ⟨1, 1, 1⟩], [⟨0, 1, 3⟩, ⟨1, 3, 15⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 33⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 15⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 9⟩, ⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 15⟩, ⟨1, 3, 372⟩, ⟨0, 1, 6⟩, ⟨1, 3, 231⟩, ⟨0, 1, 3⟩, ⟨1, 3, 450⟩, ⟨0, 1, 3⟩, ⟨1, 3, 2043⟩, ⟨0, 1, 9⟩, ⟨1, 3, 18⟩, ⟨0, 1, 9⟩, ⟨1, 3, 24⟩, ⟨0, 1, 12⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 90⟩, ⟨0, 1, 3⟩, ⟨1, 3, 9⟩, ⟨0, 1, 3⟩, ⟨1, 3, 4458⟩, ⟨0, 1, 3⟩, ⟨1, 3, 7971⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 4434⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 573⟩, ⟨1, 3, 6⟩, ⟨0, 1, 384⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 528⟩, ⟨1, 3, 3⟩, ⟨0, 1, 276⟩, ⟨1, 3, 1⟩]⟩ -- +1472 (step 18052, blks=68) +private def cfg_15 : MState := ⟨1, [⟨1, 1, 30919⟩, ⟨13, 4, 1⟩, ⟨1, 1, 1⟩], [⟨0, 1, 5⟩, ⟨1, 1, 1⟩, ⟨0, 1, 11⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 30⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 21⟩, ⟨0, 1, 18⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 72⟩, ⟨0, 1, 3⟩, ⟨1, 3, 30⟩, ⟨0, 1, 3⟩, ⟨1, 3, 2043⟩, ⟨0, 1, 9⟩, ⟨1, 3, 18⟩, ⟨0, 1, 9⟩, ⟨1, 3, 24⟩, ⟨0, 1, 12⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 90⟩, ⟨0, 1, 3⟩, ⟨1, 3, 9⟩, ⟨0, 1, 3⟩, ⟨1, 3, 4458⟩, ⟨0, 1, 3⟩, ⟨1, 3, 7971⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 4434⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 573⟩, ⟨1, 3, 6⟩, ⟨0, 1, 384⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 528⟩, ⟨1, 3, 3⟩, ⟨0, 1, 276⟩, ⟨1, 3, 3⟩, ⟨0, 1, 132⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 654⟩, ⟨1, 3, 3⟩, ⟨0, 1, 402⟩, ⟨1, 3, 3⟩, ⟨0, 1, 402⟩, ⟨1, 3, 1⟩]⟩ -- +1134 (step 19186, blks=75) +private def cfg_16 : MState := ⟨1, [⟨1, 1, 63⟩, ⟨13, 4, 1⟩, ⟨13, 4, 13⟩, ⟨1, 1, 4⟩, ⟨14, 4, 68⟩, ⟨1, 1, 32⟩, ⟨14, 4, 40⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 1412⟩, ⟨1, 1, 9⟩, ⟨14, 4, 4⟩, ⟨1, 1, 12⟩, ⟨14, 4, 8⟩, ⟨1, 1, 8⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 4⟩, ⟨1, 1, 24⟩, ⟨14, 4, 1784⟩, ⟨13, 4, 31485⟩, ⟨1, 1, 1⟩], [⟨0, 1, 5⟩, ⟨1, 1, 1⟩, ⟨0, 1, 17⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 15⟩, ⟨0, 1, 1716⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 999⟩, ⟨0, 1, 3⟩, ⟨1, 3, 7971⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 4434⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 573⟩, ⟨1, 3, 6⟩, ⟨0, 1, 384⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 528⟩, ⟨1, 3, 3⟩, ⟨0, 1, 276⟩, ⟨1, 3, 3⟩, ⟨0, 1, 132⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 654⟩, ⟨1, 3, 3⟩, ⟨0, 1, 402⟩, ⟨1, 3, 3⟩, ⟨0, 1, 402⟩, ⟨1, 3, 3⟩, ⟨0, 1, 4143⟩, ⟨1, 3, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 1⟩]⟩ -- +1196 (step 20382, blks=85) +private def cfg_17 : MState := ⟨3, [⟨14, 4, 408⟩, ⟨1, 1, 36⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 8⟩, ⟨1, 1, 4⟩, ⟨14, 4, 24⟩, ⟨1, 1, 4⟩, ⟨14, 4, 76⟩, ⟨1, 1, 4⟩, ⟨14, 4, 12⟩, ⟨1, 1, 8⟩, ⟨14, 4, 8⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 8⟩, ⟨1, 1, 8⟩, ⟨14, 4, 8⟩, ⟨1, 1, 4⟩, ⟨14, 4, 16⟩, ⟨1, 1, 24⟩, ⟨14, 4, 12⟩, ⟨1, 1, 4⟩, ⟨14, 4, 8⟩, ⟨1, 1, 4⟩, ⟨14, 4, 140⟩, ⟨1, 1, 4⟩, ⟨14, 4, 96⟩, ⟨13, 4, 36349⟩, ⟨1, 1, 1⟩], [⟨0, 1, 6⟩, ⟨1, 3, 18⟩, ⟨0, 1, 9⟩, ⟨1, 3, 27⟩, ⟨0, 1, 3⟩, ⟨1, 3, 15⟩, ⟨0, 1, 3⟩, ⟨1, 3, 465⟩, ⟨0, 1, 3⟩, ⟨1, 3, 18⟩, ⟨0, 1, 174⟩, ⟨1, 3, 258⟩, ⟨0, 1, 3⟩, ⟨1, 3, 7518⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 4434⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 573⟩, ⟨1, 3, 6⟩, ⟨0, 1, 384⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 528⟩, ⟨1, 3, 3⟩, ⟨0, 1, 276⟩, ⟨1, 3, 3⟩, ⟨0, 1, 132⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 654⟩, ⟨1, 3, 3⟩, ⟨0, 1, 402⟩, ⟨1, 3, 3⟩, ⟨0, 1, 402⟩, ⟨1, 3, 3⟩, ⟨0, 1, 4143⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3384⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 2103⟩, ⟨1, 3, 1⟩]⟩ -- +1112 (step 21494, blks=91) +private def cfg_18 : MState := ⟨3, [⟨14, 4, 12⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 16⟩, ⟨14, 4, 38724⟩, ⟨1, 1, 1⟩], [⟨1, 3, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 9⟩, ⟨0, 1, 3⟩, ⟨1, 3, 93⟩, ⟨0, 1, 3⟩, ⟨1, 3, 72⟩, ⟨0, 1, 6⟩, ⟨1, 3, 285⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6558⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 4434⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 573⟩, ⟨1, 3, 6⟩, ⟨0, 1, 384⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 528⟩, ⟨1, 3, 3⟩, ⟨0, 1, 276⟩, ⟨1, 3, 3⟩, ⟨0, 1, 132⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 654⟩, ⟨1, 3, 3⟩, ⟨0, 1, 402⟩, ⟨1, 3, 3⟩, ⟨0, 1, 402⟩, ⟨1, 3, 3⟩, ⟨0, 1, 4143⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3384⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 2103⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2418⟩, ⟨1, 3, 3⟩, ⟨0, 1, 339⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1095⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 1⟩]⟩ -- +1499 (step 22993, blks=77) +private def cfg_19 : MState := ⟨3, [⟨14, 4, 12⟩, ⟨1, 1, 12⟩, ⟨14, 4, 24⟩, ⟨13, 4, 1⟩, ⟨1, 1, 12⟩, ⟨14, 4, 44⟩, ⟨1, 1, 12⟩, ⟨14, 4, 32⟩, ⟨1, 1, 16⟩, ⟨14, 4, 4⟩, ⟨1, 1, 12⟩, ⟨14, 4, 39584⟩, ⟨1, 1, 1⟩], [⟨0, 1, 21⟩, ⟨1, 3, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 6045⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 4434⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 573⟩, ⟨1, 3, 6⟩, ⟨0, 1, 384⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 528⟩, ⟨1, 3, 3⟩, ⟨0, 1, 276⟩, ⟨1, 3, 3⟩, ⟨0, 1, 132⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 654⟩, ⟨1, 3, 3⟩, ⟨0, 1, 402⟩, ⟨1, 3, 3⟩, ⟨0, 1, 402⟩, ⟨1, 3, 3⟩, ⟨0, 1, 4143⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3384⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 2103⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2418⟩, ⟨1, 3, 3⟩, ⟨0, 1, 339⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1095⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 804⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 339⟩, ⟨1, 3, 1⟩]⟩ -- +1350 (step 24343, blks=83) +private def cfg_20 : MState := ⟨3, [⟨14, 4, 12⟩, ⟨1, 1, 12⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 16⟩, ⟨1, 1, 4⟩, ⟨14, 4, 12⟩, ⟨1, 1, 12⟩, ⟨14, 4, 72⟩, ⟨1, 1, 20⟩, ⟨14, 4, 51996⟩, ⟨1, 1, 1⟩], [⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 32⟩, ⟨1, 1, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 69⟩, ⟨0, 1, 135⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 654⟩, ⟨1, 3, 3⟩, ⟨0, 1, 402⟩, ⟨1, 3, 3⟩, ⟨0, 1, 402⟩, ⟨1, 3, 3⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 12⟩, ⟨1, 3, 3624⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 768⟩, ⟨1, 3, 3⟩, ⟨0, 1, 759⟩, ⟨1, 3, 123⟩, ⟨0, 1, 18⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 9⟩, ⟨0, 1, 12⟩, ⟨1, 3, 33⟩, ⟨0, 1, 9⟩, ⟨1, 3, 24⟩, ⟨0, 1, 12⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 1575⟩, ⟨0, 1, 51⟩, ⟨1, 3, 6⟩, ⟨0, 1, 2103⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2154⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 216⟩, ⟨0, 1, 342⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1095⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 804⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 339⟩, ⟨1, 3, 3⟩, ⟨0, 1, 20520⟩, ⟨1, 3, 3⟩, ⟨0, 1, 801⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 1⟩]⟩ -- +1106 (step 25449, blks=109) +private def cfg_21 : MState := ⟨0, [⟨1, 1, 10⟩, ⟨0, 1, 1⟩, ⟨1, 1, 15⟩, ⟨13, 4, 1⟩, ⟨1, 1, 9⟩, ⟨14, 4, 12⟩, ⟨13, 4, 1⟩, ⟨1, 1, 16⟩, ⟨14, 4, 52840⟩, ⟨1, 1, 1⟩], [⟨0, 1, 3⟩, ⟨1, 3, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 426⟩, ⟨0, 1, 405⟩, ⟨1, 3, 3⟩, ⟨0, 1, 402⟩, ⟨1, 3, 3⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 12⟩, ⟨1, 3, 3624⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 768⟩, ⟨1, 3, 3⟩, ⟨0, 1, 759⟩, ⟨1, 3, 123⟩, ⟨0, 1, 18⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 9⟩, ⟨0, 1, 12⟩, ⟨1, 3, 33⟩, ⟨0, 1, 9⟩, ⟨1, 3, 24⟩, ⟨0, 1, 12⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 1575⟩, ⟨0, 1, 51⟩, ⟨1, 3, 6⟩, ⟨0, 1, 2103⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2154⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 216⟩, ⟨0, 1, 342⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1095⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 804⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 339⟩, ⟨1, 3, 3⟩, ⟨0, 1, 20520⟩, ⟨1, 3, 3⟩, ⟨0, 1, 801⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 738⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 1⟩]⟩ -- +1108 (step 26557, blks=102) +private def cfg_22 : MState := ⟨0, [⟨1, 1, 16⟩, ⟨0, 1, 1⟩, ⟨1, 1, 56240⟩], [⟨0, 1, 9⟩, ⟨1, 3, 87⟩, ⟨0, 1, 3⟩, ⟨1, 3, 351⟩, ⟨0, 1, 3⟩, ⟨1, 3, 1038⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 12⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 15⟩, ⟨1, 3, 30⟩, ⟨0, 1, 3⟩, ⟨1, 3, 303⟩, ⟨0, 1, 93⟩, ⟨1, 3, 69⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 768⟩, ⟨1, 3, 3⟩, ⟨0, 1, 759⟩, ⟨1, 3, 123⟩, ⟨0, 1, 18⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 9⟩, ⟨0, 1, 12⟩, ⟨1, 3, 33⟩, ⟨0, 1, 9⟩, ⟨1, 3, 24⟩, ⟨0, 1, 12⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 1575⟩, ⟨0, 1, 51⟩, ⟨1, 3, 6⟩, ⟨0, 1, 2103⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2154⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 216⟩, ⟨0, 1, 342⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1095⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 804⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 339⟩, ⟨1, 3, 3⟩, ⟨0, 1, 20520⟩, ⟨1, 3, 3⟩, ⟨0, 1, 801⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 738⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 5004⟩, ⟨1, 3, 6⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 360⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 1⟩]⟩ -- +1186 (step 27743, blks=129) +private def cfg_23 : MState := ⟨1, [⟨1, 1, 49⟩, ⟨14, 4, 8⟩, ⟨1, 1, 12⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 12⟩, ⟨13, 4, 437⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 8⟩, ⟨14, 4, 152⟩, ⟨1, 1, 4⟩, ⟨14, 4, 56544⟩, ⟨1, 1, 1⟩], [⟨0, 1, 11⟩, ⟨1, 1, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 15⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 21⟩, ⟨1, 3, 75⟩, ⟨0, 1, 3⟩, ⟨1, 3, 45⟩, ⟨0, 1, 3⟩, ⟨1, 3, 87⟩, ⟨0, 1, 246⟩, ⟨1, 1, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 12⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 15⟩, ⟨1, 3, 30⟩, ⟨0, 1, 3⟩, ⟨1, 3, 303⟩, ⟨0, 1, 93⟩, ⟨1, 3, 69⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 768⟩, ⟨1, 3, 3⟩, ⟨0, 1, 759⟩, ⟨1, 3, 123⟩, ⟨0, 1, 18⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 9⟩, ⟨0, 1, 12⟩, ⟨1, 3, 33⟩, ⟨0, 1, 9⟩, ⟨1, 3, 24⟩, ⟨0, 1, 12⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 1575⟩, ⟨0, 1, 51⟩, ⟨1, 3, 6⟩, ⟨0, 1, 2103⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2154⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 216⟩, ⟨0, 1, 342⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1095⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 804⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 339⟩, ⟨1, 3, 3⟩, ⟨0, 1, 20520⟩, ⟨1, 3, 3⟩, ⟨0, 1, 801⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 738⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 5004⟩, ⟨1, 3, 6⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 360⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 111⟩, ⟨1, 3, 6⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 1⟩]⟩ -- +1101 (step 28844, blks=158) +private def cfg_24 : MState := ⟨3, [⟨7, 4, 164⟩, ⟨1, 1, 16⟩, ⟨14, 4, 4⟩, ⟨1, 1, 16⟩, ⟨14, 4, 8⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 20⟩, ⟨14, 4, 36⟩, ⟨1, 1, 4⟩, ⟨14, 4, 32⟩, ⟨1, 1, 4⟩, ⟨14, 4, 72⟩, ⟨13, 4, 41⟩, ⟨13, 4, 33⟩, ⟨1, 1, 12⟩, ⟨14, 4, 8⟩, ⟨1, 1, 4⟩, ⟨14, 4, 48⟩, ⟨13, 4, 117⟩, ⟨1, 1, 4⟩, ⟨14, 4, 57468⟩, ⟨1, 1, 1⟩], [⟨1, 1, 1⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 30⟩, ⟨0, 1, 84⟩, ⟨1, 3, 9⟩, ⟨0, 1, 3⟩, ⟨1, 3, 66⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 768⟩, ⟨1, 3, 3⟩, ⟨0, 1, 759⟩, ⟨1, 3, 123⟩, ⟨0, 1, 18⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 9⟩, ⟨0, 1, 12⟩, ⟨1, 3, 33⟩, ⟨0, 1, 9⟩, ⟨1, 3, 24⟩, ⟨0, 1, 12⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 1575⟩, ⟨0, 1, 51⟩, ⟨1, 3, 6⟩, ⟨0, 1, 2103⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2154⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 216⟩, ⟨0, 1, 342⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1095⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 804⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 339⟩, ⟨1, 3, 3⟩, ⟨0, 1, 20520⟩, ⟨1, 3, 3⟩, ⟨0, 1, 801⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 738⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 5004⟩, ⟨1, 3, 6⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 360⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 111⟩, ⟨1, 3, 6⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1392⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 1⟩]⟩ -- +1125 (step 29969, blks=149) +private def cfg_25 : MState := ⟨0, [⟨1, 1, 22⟩, ⟨0, 1, 1⟩, ⟨1, 1, 58911⟩, ⟨13, 4, 1⟩, ⟨1, 1, 1⟩], [⟨0, 1, 9⟩, ⟨1, 3, 72⟩, ⟨0, 1, 39⟩, ⟨1, 3, 3⟩, ⟨0, 1, 12⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 15⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 27⟩, ⟨0, 1, 3⟩, ⟨1, 3, 54⟩, ⟨0, 1, 3⟩, ⟨1, 3, 30⟩, ⟨0, 1, 321⟩, ⟨1, 3, 24⟩, ⟨0, 1, 9⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 36⟩, ⟨0, 1, 48⟩, ⟨1, 3, 87⟩, ⟨0, 1, 3⟩, ⟨1, 3, 84⟩, ⟨0, 1, 3⟩, ⟨1, 3, 120⟩, ⟨0, 1, 18⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 9⟩, ⟨0, 1, 12⟩, ⟨1, 3, 33⟩, ⟨0, 1, 9⟩, ⟨1, 3, 24⟩, ⟨0, 1, 12⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 1575⟩, ⟨0, 1, 51⟩, ⟨1, 3, 6⟩, ⟨0, 1, 2103⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2154⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 216⟩, ⟨0, 1, 342⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1095⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 804⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 339⟩, ⟨1, 3, 3⟩, ⟨0, 1, 20520⟩, ⟨1, 3, 3⟩, ⟨0, 1, 801⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 738⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 5004⟩, ⟨1, 3, 6⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 360⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 111⟩, ⟨1, 3, 6⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1392⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2187⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 45⟩, ⟨1, 3, 1⟩]⟩ -- +1329 (step 31298, blks=155) +private def cfg_26 : MState := ⟨0, [⟨1, 1, 16⟩, ⟨0, 1, 1⟩, ⟨1, 1, 59824⟩], [⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 15⟩, ⟨0, 1, 3⟩, ⟨1, 3, 45⟩, ⟨0, 1, 3⟩, ⟨1, 3, 72⟩, ⟨0, 1, 18⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 9⟩, ⟨0, 1, 12⟩, ⟨1, 3, 33⟩, ⟨0, 1, 9⟩, ⟨1, 3, 24⟩, ⟨0, 1, 12⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 1575⟩, ⟨0, 1, 51⟩, ⟨1, 3, 6⟩, ⟨0, 1, 2103⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2154⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 216⟩, ⟨0, 1, 342⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1095⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 804⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 339⟩, ⟨1, 3, 3⟩, ⟨0, 1, 20520⟩, ⟨1, 3, 3⟩, ⟨0, 1, 801⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 738⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 5004⟩, ⟨1, 3, 6⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 360⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 111⟩, ⟨1, 3, 6⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1392⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2187⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 276⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 486⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 1⟩]⟩ -- +1292 (step 32590, blks=155) +private def cfg_27 : MState := ⟨1, [⟨1, 1, 37⟩, ⟨14, 4, 8⟩, ⟨1, 1, 12⟩, ⟨14, 4, 68240⟩, ⟨1, 1, 1⟩], [⟨0, 1, 5⟩, ⟨1, 1, 1⟩, ⟨0, 1, 5⟩, ⟨1, 3, 12⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 45⟩, ⟨0, 1, 12⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 51⟩, ⟨0, 1, 3⟩, ⟨1, 3, 102⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 93⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 36⟩, ⟨1, 3, 3⟩, ⟨0, 1, 159⟩, ⟨1, 3, 3⟩, ⟨0, 1, 36⟩, ⟨1, 3, 3⟩, ⟨0, 1, 42⟩, ⟨1, 3, 96⟩, ⟨0, 1, 3⟩, ⟨1, 3, 33⟩, ⟨0, 1, 3⟩, ⟨1, 3, 159⟩, ⟨0, 1, 306⟩, ⟨1, 3, 972⟩, ⟨0, 1, 1458⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 27⟩, ⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 15⟩, ⟨0, 1, 3⟩, ⟨1, 3, 27⟩, ⟨0, 1, 6⟩, ⟨1, 3, 30⟩, ⟨0, 1, 3⟩, ⟨1, 3, 561⟩, ⟨0, 1, 3⟩, ⟨1, 3, 435⟩, ⟨0, 1, 216⟩, ⟨1, 3, 9⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 15⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 54⟩, ⟨0, 1, 3⟩, ⟨1, 3, 435⟩, ⟨0, 1, 195⟩, ⟨1, 3, 984⟩, ⟨0, 1, 342⟩, ⟨1, 3, 14322⟩, ⟨0, 1, 804⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 738⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 5004⟩, ⟨1, 3, 6⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 360⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 111⟩, ⟨1, 3, 6⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1392⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2187⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 276⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 486⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 237⟩, ⟨1, 3, 6⟩, ⟨0, 1, 14157⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 339⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 1⟩]⟩ -- +1151 (step 33741, blks=195) +private def cfg_28 : MState := ⟨0, [⟨1, 1, 16⟩, ⟨0, 1, 1⟩, ⟨1, 1, 69284⟩], [⟨0, 1, 9⟩, ⟨1, 3, 12⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 18⟩, ⟨0, 1, 270⟩, ⟨1, 3, 6⟩, ⟨0, 1, 15⟩, ⟨1, 3, 18⟩, ⟨0, 1, 12⟩, ⟨1, 3, 957⟩, ⟨0, 1, 1458⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 27⟩, ⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 15⟩, ⟨0, 1, 3⟩, ⟨1, 3, 27⟩, ⟨0, 1, 6⟩, ⟨1, 3, 30⟩, ⟨0, 1, 3⟩, ⟨1, 3, 561⟩, ⟨0, 1, 3⟩, ⟨1, 3, 435⟩, ⟨0, 1, 216⟩, ⟨1, 3, 9⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 15⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 54⟩, ⟨0, 1, 3⟩, ⟨1, 3, 435⟩, ⟨0, 1, 195⟩, ⟨1, 3, 984⟩, ⟨0, 1, 342⟩, ⟨1, 3, 14322⟩, ⟨0, 1, 804⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 738⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 5004⟩, ⟨1, 3, 6⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 360⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 111⟩, ⟨1, 3, 6⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1392⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2187⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 276⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 486⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 237⟩, ⟨1, 3, 6⟩, ⟨0, 1, 14157⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 339⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1410⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 1⟩]⟩ -- +1211 (step 34952, blks=177) +private def cfg_29 : MState := ⟨3, [⟨7, 4, 8⟩, ⟨1, 1, 31⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 69908⟩, ⟨1, 1, 1⟩], [⟨1, 1, 1⟩, ⟨1, 3, 708⟩, ⟨0, 1, 1458⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 27⟩, ⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 15⟩, ⟨0, 1, 3⟩, ⟨1, 3, 27⟩, ⟨0, 1, 6⟩, ⟨1, 3, 30⟩, ⟨0, 1, 3⟩, ⟨1, 3, 561⟩, ⟨0, 1, 3⟩, ⟨1, 3, 435⟩, ⟨0, 1, 216⟩, ⟨1, 3, 9⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 9⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 15⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 54⟩, ⟨0, 1, 3⟩, ⟨1, 3, 435⟩, ⟨0, 1, 195⟩, ⟨1, 3, 984⟩, ⟨0, 1, 342⟩, ⟨1, 3, 14322⟩, ⟨0, 1, 804⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 738⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 5004⟩, ⟨1, 3, 6⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 360⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 111⟩, ⟨1, 3, 6⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1392⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2187⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 276⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 486⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 237⟩, ⟨1, 3, 6⟩, ⟨0, 1, 14157⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 339⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1410⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 633⟩, ⟨1, 3, 3⟩, ⟨0, 1, 192⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 1⟩]⟩ -- +1279 (step 36231, blks=186) +private def cfg_30 : MState := ⟨3, [⟨14, 4, 140⟩, ⟨1, 1, 1⟩, ⟨7, 4, 73835⟩, ⟨1, 1, 1⟩], [⟨0, 1, 11⟩, ⟨1, 3, 15⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 18⟩, ⟨0, 1, 3⟩, ⟨1, 3, 12⟩, ⟨0, 1, 12⟩, ⟨1, 3, 6⟩, ⟨0, 1, 12⟩, ⟨1, 3, 3⟩, ⟨0, 1, 192⟩, ⟨1, 3, 195⟩, ⟨0, 1, 3⟩, ⟨1, 3, 33⟩, ⟨0, 1, 180⟩, ⟨1, 3, 312⟩, ⟨0, 1, 3⟩, ⟨1, 3, 258⟩, ⟨0, 1, 342⟩, ⟨1, 3, 14322⟩, ⟨0, 1, 804⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 738⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 5004⟩, ⟨1, 3, 6⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 360⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 111⟩, ⟨1, 3, 6⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1392⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2187⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 276⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 486⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 237⟩, ⟨1, 3, 6⟩, ⟨0, 1, 14157⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 339⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1410⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 633⟩, ⟨1, 3, 3⟩, ⟨0, 1, 192⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3846⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2274⟩, ⟨1, 3, 6⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 423⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 1⟩]⟩ -- +1244 (step 37475, blks=184) +private def cfg_31 : MState := ⟨1, [⟨1, 1, 74579⟩, ⟨13, 4, 1⟩, ⟨1, 1, 1⟩], [⟨0, 1, 5⟩, ⟨1, 1, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 18⟩, ⟨0, 1, 3⟩, ⟨1, 3, 78⟩, ⟨0, 1, 3⟩, ⟨1, 3, 27⟩, ⟨0, 1, 6⟩, ⟨1, 3, 285⟩, ⟨0, 1, 3⟩, ⟨1, 3, 258⟩, ⟨0, 1, 342⟩, ⟨1, 3, 14322⟩, ⟨0, 1, 804⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 738⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 5004⟩, ⟨1, 3, 6⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 360⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 111⟩, ⟨1, 3, 6⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1392⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2187⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 276⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 486⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 237⟩, ⟨1, 3, 6⟩, ⟨0, 1, 14157⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 339⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1410⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 633⟩, ⟨1, 3, 3⟩, ⟨0, 1, 192⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3846⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2274⟩, ⟨1, 3, 6⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 423⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 318⟩, ⟨1, 3, 3⟩, ⟨0, 1, 507⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 1⟩]⟩ -- +1143 (step 38618, blks=191) +private def cfg_32 : MState := ⟨3, [⟨14, 4, 13824⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 16⟩, ⟨14, 4, 8⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 12⟩, ⟨1, 1, 4⟩, ⟨14, 4, 40⟩, ⟨1, 1, 4⟩, ⟨14, 4, 44⟩, ⟨1, 1, 172⟩, ⟨14, 4, 180⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 344⟩, ⟨14, 4, 452⟩, ⟨1, 1, 4⟩, ⟨14, 4, 17124⟩, ⟨1, 1, 4⟩, ⟨14, 4, 57680⟩, ⟨1, 1, 1⟩], [⟨0, 1, 801⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 738⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 5004⟩, ⟨1, 3, 6⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 360⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 111⟩, ⟨1, 3, 6⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1392⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2187⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 276⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 486⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 237⟩, ⟨1, 3, 6⟩, ⟨0, 1, 14157⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 339⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1410⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 633⟩, ⟨1, 3, 3⟩, ⟨0, 1, 192⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3846⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2274⟩, ⟨1, 3, 6⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 423⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 318⟩, ⟨1, 3, 3⟩, ⟨0, 1, 507⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 174⟩, ⟨1, 3, 6⟩, ⟨0, 1, 570⟩, ⟨1, 3, 1⟩]⟩ -- +1490 (step 40108, blks=202) +private def cfg_33 : MState := ⟨3, [⟨14, 4, 36⟩, ⟨1, 1, 24⟩, ⟨14, 4, 8⟩, ⟨1, 1, 8⟩, ⟨14, 4, 12⟩, ⟨13, 4, 5⟩, ⟨13, 4, 1⟩, ⟨1, 1, 12⟩, ⟨14, 4, 91952⟩, ⟨1, 1, 1⟩], [⟨1, 3, 60⟩, ⟨0, 1, 3⟩, ⟨1, 3, 126⟩, ⟨0, 1, 153⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 102⟩, ⟨0, 1, 69⟩, ⟨1, 3, 3⟩, ⟨0, 1, 5004⟩, ⟨1, 3, 6⟩, ⟨0, 1, 171⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 360⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 111⟩, ⟨1, 3, 6⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1392⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1242⟩, ⟨1, 3, 6⟩, ⟨0, 1, 12⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 9⟩, ⟨0, 1, 3⟩, ⟨1, 3, 30⟩, ⟨0, 1, 3⟩, ⟨1, 3, 33⟩, ⟨0, 1, 129⟩, ⟨1, 3, 135⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 258⟩, ⟨1, 3, 306⟩, ⟨0, 1, 33⟩, ⟨1, 3, 15⟩, ⟨0, 1, 69⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 276⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 486⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 237⟩, ⟨1, 3, 6⟩, ⟨0, 1, 10830⟩, ⟨1, 3, 3327⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 339⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1410⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 633⟩, ⟨1, 3, 3⟩, ⟨0, 1, 192⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3846⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2274⟩, ⟨1, 3, 6⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 423⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 318⟩, ⟨1, 3, 3⟩, ⟨0, 1, 507⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 174⟩, ⟨1, 3, 6⟩, ⟨0, 1, 570⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27807⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 342⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 111⟩, ⟨1, 3, 6⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 570⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 1⟩]⟩ -- +1306 (step 41414, blks=211) +private def cfg_34 : MState := ⟨1, [⟨1, 1, 97919⟩, ⟨13, 4, 1⟩, ⟨1, 1, 1⟩], [⟨0, 1, 5⟩, ⟨1, 1, 1⟩, ⟨0, 1, 2⟩, ⟨1, 3, 3⟩, ⟨0, 1, 12⟩, ⟨1, 3, 9⟩, ⟨0, 1, 3⟩, ⟨1, 3, 27⟩, ⟨0, 1, 51⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 153⟩, ⟨0, 1, 48⟩, ⟨1, 3, 93⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 111⟩, ⟨1, 3, 6⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1392⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 423⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 15⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 24⟩, ⟨0, 1, 3⟩, ⟨1, 3, 27⟩, ⟨0, 1, 18⟩, ⟨1, 3, 705⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 12⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 9⟩, ⟨0, 1, 3⟩, ⟨1, 3, 30⟩, ⟨0, 1, 3⟩, ⟨1, 3, 33⟩, ⟨0, 1, 129⟩, ⟨1, 3, 135⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 258⟩, ⟨1, 3, 306⟩, ⟨0, 1, 33⟩, ⟨1, 3, 15⟩, ⟨0, 1, 69⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 276⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 486⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 237⟩, ⟨1, 3, 6⟩, ⟨0, 1, 942⟩, ⟨1, 3, 3⟩, ⟨0, 1, 444⟩, ⟨1, 3, 9441⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3324⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 339⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1410⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 633⟩, ⟨1, 3, 3⟩, ⟨0, 1, 192⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3846⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2274⟩, ⟨1, 3, 6⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 423⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 318⟩, ⟨1, 3, 3⟩, ⟨0, 1, 507⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 174⟩, ⟨1, 3, 6⟩, ⟨0, 1, 570⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27807⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 342⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 111⟩, ⟨1, 3, 6⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 570⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 843⟩, ⟨1, 3, 3⟩, ⟨0, 1, 111⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 213⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 8970⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 1⟩]⟩ -- +1143 (step 42557, blks=227) +private def cfg_end : MState := ⟨5, [⟨0, 1, 1⟩, ⟨1, 1, 5⟩, ⟨0, 1, 1⟩, ⟨1, 1, 20⟩, ⟨14, 4, 16⟩, ⟨13, 4, 29⟩, ⟨1, 1, 4⟩, ⟨14, 4, 36⟩, ⟨1, 1, 8⟩, ⟨14, 4, 84⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨13, 4, 13⟩, ⟨13, 4, 181⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 24⟩, ⟨1, 1, 4⟩, ⟨14, 4, 40⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨1, 1, 4⟩, ⟨14, 4, 4⟩, ⟨13, 4, 5⟩, ⟨1, 1, 4⟩, ⟨14, 4, 98016⟩, ⟨1, 1, 1⟩], [⟨1, 3, 6⟩, ⟨0, 1, 111⟩, ⟨1, 3, 6⟩, ⟨0, 1, 150⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 489⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1392⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 423⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 15⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 24⟩, ⟨0, 1, 3⟩, ⟨1, 3, 27⟩, ⟨0, 1, 18⟩, ⟨1, 3, 705⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 12⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 9⟩, ⟨0, 1, 3⟩, ⟨1, 3, 30⟩, ⟨0, 1, 3⟩, ⟨1, 3, 33⟩, ⟨0, 1, 129⟩, ⟨1, 3, 135⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 258⟩, ⟨1, 3, 306⟩, ⟨0, 1, 33⟩, ⟨1, 3, 15⟩, ⟨0, 1, 69⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 276⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 486⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 129⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 237⟩, ⟨1, 3, 6⟩, ⟨0, 1, 942⟩, ⟨1, 3, 3⟩, ⟨0, 1, 444⟩, ⟨1, 3, 9441⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3324⟩, ⟨0, 1, 6⟩, ⟨1, 3, 3⟩, ⟨0, 1, 339⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 1410⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 633⟩, ⟨1, 3, 3⟩, ⟨0, 1, 192⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 3846⟩, ⟨1, 3, 3⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 2274⟩, ⟨1, 3, 6⟩, ⟨0, 1, 69⟩, ⟨1, 3, 6⟩, ⟨0, 1, 3⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 423⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 234⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 318⟩, ⟨1, 3, 3⟩, ⟨0, 1, 507⟩, ⟨1, 3, 3⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 48⟩, ⟨1, 3, 6⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 24⟩, ⟨1, 3, 3⟩, ⟨0, 1, 174⟩, ⟨1, 3, 6⟩, ⟨0, 1, 570⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27807⟩, ⟨1, 3, 3⟩, ⟨0, 1, 27⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 342⟩, ⟨1, 3, 6⟩, ⟨0, 1, 6⟩, ⟨1, 3, 6⟩, ⟨0, 1, 111⟩, ⟨1, 3, 6⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 570⟩, ⟨1, 3, 3⟩, ⟨0, 1, 297⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 108⟩, ⟨1, 3, 3⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 843⟩, ⟨1, 3, 3⟩, ⟨0, 1, 111⟩, ⟨1, 3, 6⟩, ⟨0, 1, 87⟩, ⟨1, 3, 3⟩, ⟨0, 1, 213⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 66⟩, ⟨1, 3, 3⟩, ⟨0, 1, 8970⟩, ⟨1, 3, 3⟩, ⟨0, 1, 45⟩, ⟨1, 3, 3⟩, ⟨0, 1, 192⟩, ⟨1, 3, 1⟩]⟩ -- +821 (step 43378, blks=231) + +private theorem step_ckpt_0 : opt_mstate_beq (run_m_fast 1100 cfg_0) cfg_1 = true := by decide +kernel +private theorem step_ckpt_1 : opt_mstate_beq (run_m_fast 1102 cfg_1) cfg_2 = true := by decide +kernel +private theorem step_ckpt_2 : opt_mstate_beq (run_m_fast 1305 cfg_2) cfg_3 = true := by decide +kernel +private theorem step_ckpt_3 : opt_mstate_beq (run_m_fast 1360 cfg_3) cfg_4 = true := by decide +kernel +private theorem step_ckpt_4 : opt_mstate_beq (run_m_fast 1335 cfg_4) cfg_5 = true := by decide +kernel +private theorem step_ckpt_5 : opt_mstate_beq (run_m_fast 1165 cfg_5) cfg_6 = true := by decide +kernel +private theorem step_ckpt_6 : opt_mstate_beq (run_m_fast 1198 cfg_6) cfg_7 = true := by decide +kernel +private theorem step_ckpt_7 : opt_mstate_beq (run_m_fast 1439 cfg_7) cfg_8 = true := by decide +kernel +private theorem step_ckpt_8 : opt_mstate_beq (run_m_fast 1105 cfg_8) cfg_9 = true := by decide +kernel +private theorem step_ckpt_9 : opt_mstate_beq (run_m_fast 1323 cfg_9) cfg_10 = true := by decide +kernel +private theorem step_ckpt_10 : opt_mstate_beq (run_m_fast 1227 cfg_10) cfg_11 = true := by decide +kernel +private theorem step_ckpt_11 : opt_mstate_beq (run_m_fast 1472 cfg_11) cfg_12 = true := by decide +kernel +private theorem step_ckpt_12 : opt_mstate_beq (run_m_fast 1449 cfg_12) cfg_13 = true := by decide +kernel +private theorem step_ckpt_13 : opt_mstate_beq (run_m_fast 1472 cfg_13) cfg_14 = true := by decide +kernel +private theorem step_ckpt_14 : opt_mstate_beq (run_m_fast 1134 cfg_14) cfg_15 = true := by decide +kernel +private theorem step_ckpt_15 : opt_mstate_beq (run_m_fast 1196 cfg_15) cfg_16 = true := by decide +kernel +private theorem step_ckpt_16 : opt_mstate_beq (run_m_fast 1112 cfg_16) cfg_17 = true := by decide +kernel +private theorem step_ckpt_17 : opt_mstate_beq (run_m_fast 1499 cfg_17) cfg_18 = true := by decide +kernel +private theorem step_ckpt_18 : opt_mstate_beq (run_m_fast 1350 cfg_18) cfg_19 = true := by decide +kernel +private theorem step_ckpt_19 : opt_mstate_beq (run_m_fast 1106 cfg_19) cfg_20 = true := by decide +kernel +private theorem step_ckpt_20 : opt_mstate_beq (run_m_fast 1108 cfg_20) cfg_21 = true := by decide +kernel +private theorem step_ckpt_21 : opt_mstate_beq (run_m_fast 1186 cfg_21) cfg_22 = true := by decide +kernel +private theorem step_ckpt_22 : opt_mstate_beq (run_m_fast 1101 cfg_22) cfg_23 = true := by decide +kernel +private theorem step_ckpt_23 : opt_mstate_beq (run_m_fast 1125 cfg_23) cfg_24 = true := by decide +kernel +private theorem step_ckpt_24 : opt_mstate_beq (run_m_fast 1329 cfg_24) cfg_25 = true := by decide +kernel +private theorem step_ckpt_25 : opt_mstate_beq (run_m_fast 1292 cfg_25) cfg_26 = true := by decide +kernel +private theorem step_ckpt_26 : opt_mstate_beq (run_m_fast 1151 cfg_26) cfg_27 = true := by decide +kernel +private theorem step_ckpt_27 : opt_mstate_beq (run_m_fast 1211 cfg_27) cfg_28 = true := by decide +kernel +private theorem step_ckpt_28 : opt_mstate_beq (run_m_fast 1279 cfg_28) cfg_29 = true := by decide +kernel +private theorem step_ckpt_29 : opt_mstate_beq (run_m_fast 1244 cfg_29) cfg_30 = true := by decide +kernel +private theorem step_ckpt_30 : opt_mstate_beq (run_m_fast 1143 cfg_30) cfg_31 = true := by decide +kernel +private theorem step_ckpt_31 : opt_mstate_beq (run_m_fast 1490 cfg_31) cfg_32 = true := by decide +kernel +private theorem step_ckpt_32 : opt_mstate_beq (run_m_fast 1306 cfg_32) cfg_33 = true := by decide +kernel +private theorem step_ckpt_33 : opt_mstate_beq (run_m_fast 1143 cfg_33) cfg_34 = true := by decide +kernel +private theorem step_ckpt_end : opt_mstate_beq (run_m_fast 821 cfg_34) cfg_end = true := by decide +kernel + +private theorem reach_34 : MReach cfg_34 cfg_end := mreach_base_fast step_ckpt_end +private theorem reach_33 : MReach cfg_33 cfg_end := mreach_step_fast step_ckpt_33 reach_34 +private theorem reach_32 : MReach cfg_32 cfg_end := mreach_step_fast step_ckpt_32 reach_33 +private theorem reach_31 : MReach cfg_31 cfg_end := mreach_step_fast step_ckpt_31 reach_32 +private theorem reach_30 : MReach cfg_30 cfg_end := mreach_step_fast step_ckpt_30 reach_31 +private theorem reach_29 : MReach cfg_29 cfg_end := mreach_step_fast step_ckpt_29 reach_30 +private theorem reach_28 : MReach cfg_28 cfg_end := mreach_step_fast step_ckpt_28 reach_29 +private theorem reach_27 : MReach cfg_27 cfg_end := mreach_step_fast step_ckpt_27 reach_28 +private theorem reach_26 : MReach cfg_26 cfg_end := mreach_step_fast step_ckpt_26 reach_27 +private theorem reach_25 : MReach cfg_25 cfg_end := mreach_step_fast step_ckpt_25 reach_26 +private theorem reach_24 : MReach cfg_24 cfg_end := mreach_step_fast step_ckpt_24 reach_25 +private theorem reach_23 : MReach cfg_23 cfg_end := mreach_step_fast step_ckpt_23 reach_24 +private theorem reach_22 : MReach cfg_22 cfg_end := mreach_step_fast step_ckpt_22 reach_23 +private theorem reach_21 : MReach cfg_21 cfg_end := mreach_step_fast step_ckpt_21 reach_22 +private theorem reach_20 : MReach cfg_20 cfg_end := mreach_step_fast step_ckpt_20 reach_21 +private theorem reach_19 : MReach cfg_19 cfg_end := mreach_step_fast step_ckpt_19 reach_20 +private theorem reach_18 : MReach cfg_18 cfg_end := mreach_step_fast step_ckpt_18 reach_19 +private theorem reach_17 : MReach cfg_17 cfg_end := mreach_step_fast step_ckpt_17 reach_18 +private theorem reach_16 : MReach cfg_16 cfg_end := mreach_step_fast step_ckpt_16 reach_17 +private theorem reach_15 : MReach cfg_15 cfg_end := mreach_step_fast step_ckpt_15 reach_16 +private theorem reach_14 : MReach cfg_14 cfg_end := mreach_step_fast step_ckpt_14 reach_15 +private theorem reach_13 : MReach cfg_13 cfg_end := mreach_step_fast step_ckpt_13 reach_14 +private theorem reach_12 : MReach cfg_12 cfg_end := mreach_step_fast step_ckpt_12 reach_13 +private theorem reach_11 : MReach cfg_11 cfg_end := mreach_step_fast step_ckpt_11 reach_12 +private theorem reach_10 : MReach cfg_10 cfg_end := mreach_step_fast step_ckpt_10 reach_11 +private theorem reach_9 : MReach cfg_9 cfg_end := mreach_step_fast step_ckpt_9 reach_10 +private theorem reach_8 : MReach cfg_8 cfg_end := mreach_step_fast step_ckpt_8 reach_9 +private theorem reach_7 : MReach cfg_7 cfg_end := mreach_step_fast step_ckpt_7 reach_8 +private theorem reach_6 : MReach cfg_6 cfg_end := mreach_step_fast step_ckpt_6 reach_7 +private theorem reach_5 : MReach cfg_5 cfg_end := mreach_step_fast step_ckpt_5 reach_6 +private theorem reach_4 : MReach cfg_4 cfg_end := mreach_step_fast step_ckpt_4 reach_5 +private theorem reach_3 : MReach cfg_3 cfg_end := mreach_step_fast step_ckpt_3 reach_4 +private theorem reach_2 : MReach cfg_2 cfg_end := mreach_step_fast step_ckpt_2 reach_3 +private theorem reach_1 : MReach cfg_1 cfg_end := mreach_step_fast step_ckpt_1 reach_2 +private theorem reach_0 : MReach cfg_0 cfg_end := mreach_step_fast step_ckpt_0 reach_1 + + +private theorem halt_cfg_end : is_halt_m cfg_end = true := by decide +kernel + +public section + +theorem is_halt : IsHalt target := by + rcases reach_0 with ⟨fuel, hfuel⟩ + rcases run_m_sound fuel cfg_0 cfg_end hfuel with ⟨n, hn⟩ + refine ⟨map_cfg_0155 (mstate_to_cfg cfg_end), ⟨n, ?_⟩, ?_⟩ + · have hinit : (init [] : Cfg (Fin 2) (Fin 6)) = map_cfg_0155 (mstate_to_cfg cfg_0) := rfl + rw [hinit, multiStep_map_0155, hn] + rfl + · rw [step_map_0155, is_halt_m_sound cfg_end halt_cfg_end] + rfl + +end + +end BusyBeaver.M_1RB0RF_1RC0RB_1LD1RA_1LE0LD_1RB0LA_0LDHHH diff --git a/BusyBeaver/BB6/Halt/M_1RB1LA_0LB1LC_1RD0LD_0LA0RE_1RC1RF_0LDHHH.lean b/BusyBeaver/BB6/Halt/M_1RB1LA_0LB1LC_1RD0LD_0LA0RE_1RC1RF_0LDHHH.lean new file mode 100644 index 00000000..6d8b0273 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB1LA_0LB1LC_1RD0LD_0LA0RE_1RC1RF_0LDHHH.lean @@ -0,0 +1,375 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.RleCarryData + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.M_1RB1LA_0LB1LC_1RD0LD_0LA0RE_1RC1RF_0LDHHH + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LA_0LB1LC_1RD0LD_0LA0RE_1RC1RF_0LDHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +namespace Solution + +open Counter BusyBeaver.RleCarryEngine + +set_option maxRecDepth 4000000 in +instance : HasRleCarryRules target_tm where + carry_Z := fun l r => + ⟨62, + Counter.wmultiStep_sound (tm := target_tm) 62 ⟨D, 1, [0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, + 1, 1, 0, 1]⟩ + ⟨D, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + carry_P := fun l r => + ⟨22, + Counter.wmultiStep_sound (tm := target_tm) 22 ⟨D, 1, [0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, + 1, 1, 0, 1]⟩ + ⟨D, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + carry_PMUTM := fun l r => + ⟨90, + Counter.wmultiStep_sound (tm := target_tm) 90 ⟨D, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, + 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨D, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, + 1]⟩ l r rfl⟩ + carry_PTTW := fun l r => + ⟨134, + Counter.wmultiStep_sound (tm := target_tm) 134 ⟨D, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨D, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, + 1]⟩ l r rfl⟩ + carry_PTTT := fun l r => + ⟨94, + Counter.wmultiStep_sound (tm := target_tm) 94 ⟨D, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨D, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, + 1]⟩ l r rfl⟩ + carry_PTTTM := fun l r => + ⟨111, + Counter.wmultiStep_sound (tm := target_tm) 111 ⟨D, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, + 1, 1, 0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨D, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, + 1, 1, 0, 1]⟩ l r rfl⟩ + turn_UM := fun r => + ⟨67, + Counter.cmultiStep_sound (tm := target_tm) 67 ⟨D, 1, [0, 1, 1, 0, 1], [0, 1, 0, 0, 1, 0, 0, 1, + 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1], []⟩ r rfl⟩ + turn_UMT := fun r => + ⟨105, + Counter.cmultiStep_sound (tm := target_tm) 105 ⟨D, 1, [0, 1, 1, 1, 0, 1, 1, 0, 1], [0, 1, 0, + 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1], []⟩ r rfl⟩ + turn_ZT := fun l r => + ⟨67, + Counter.wmultiStep_sound (tm := target_tm) 67 ⟨D, 1, [0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, + 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_WM := fun l r => + ⟨59, + Counter.wmultiStep_sound (tm := target_tm) 59 ⟨D, 1, [0, 1, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, + 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_PT := fun l r => + ⟨125, + Counter.wmultiStep_sound (tm := target_tm) 125 ⟨D, 1, [0, 1, 1, 1, 0, 1, 0, 0, 1, 1], [0, 1, + 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_ZM := fun l r => + ⟨59, + Counter.wmultiStep_sound (tm := target_tm) 59 ⟨D, 1, [0, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, + 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + turn_PTW := fun l r => + ⟨151, + Counter.wmultiStep_sound (tm := target_tm) 151 ⟨D, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, + 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨D, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1], []⟩ l r rfl⟩ + turn_PTM := fun l r => + ⟨105, + Counter.wmultiStep_sound (tm := target_tm) 105 ⟨D, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1], + [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_PTT := fun l r => + ⟨109, + Counter.wmultiStep_sound (tm := target_tm) 109 ⟨D, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, + 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1], []⟩ l r rfl⟩ + turn_ZMU := fun l r => + ⟨121, + Counter.wmultiStep_sound (tm := target_tm) 121 ⟨D, 1, [0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], [0, + 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨D, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_ZTM := fun l r => + ⟨133, + Counter.wmultiStep_sound (tm := target_tm) 133 ⟨D, 1, [0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1], + [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_ZTT := fun l r => + ⟨137, + Counter.wmultiStep_sound (tm := target_tm) 137 ⟨D, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, + 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_ZTW := fun l r => + ⟨137, + Counter.wmultiStep_sound (tm := target_tm) 137 ⟨D, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, + 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_MUTW := fun l r => + ⟨151, + Counter.wmultiStep_sound (tm := target_tm) 151 ⟨D, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1], + [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨D, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_PTTM := fun l r => + ⟨175, + Counter.wmultiStep_sound (tm := target_tm) 175 ⟨D, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, + 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1], + []⟩ l r rfl⟩ + turn_ZTTW := fun l r => + ⟨175, + Counter.wmultiStep_sound (tm := target_tm) 175 ⟨D, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], + []⟩ l r rfl⟩ + turn_ZTTM := fun l r => + ⟨117, + Counter.wmultiStep_sound (tm := target_tm) 117 ⟨D, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, + 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], + []⟩ l r rfl⟩ + turn_ZPMU := fun l r => + ⟨177, + Counter.wmultiStep_sound (tm := target_tm) 177 ⟨D, 1, [0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, + 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], + []⟩ l r rfl⟩ + turn_ZMUTM := fun l r => + ⟨171, + Counter.wmultiStep_sound (tm := target_tm) 171 ⟨D, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, + 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], + []⟩ l r rfl⟩ + turn_PTTTW := fun l r => + ⟨221, + Counter.wmultiStep_sound (tm := target_tm) 221 ⟨D, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, + 0, 1, 1, 1], []⟩ l r rfl⟩ + carry_MU_to_pmuCfg := fun l r => + ⟨19, + Counter.wmultiStep_sound (tm := target_tm) 19 ⟨D, 1, [0, 1, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, + 1, 0, 1]⟩ + ⟨A, 1, [], [1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + pmu_step := fun l r => + ⟨66, + Counter.wmultiStep_sound (tm := target_tm) 66 ⟨A, 1, [0, 1, 0, 0, 1, 1], [1, 0, 0, 1, 0, 0, 1, + 1, 0, 1]⟩ + ⟨A, 1, [], [1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + pmuCfg_Z_turn := fun l r => + ⟨40, + Counter.wmultiStep_sound (tm := target_tm) 40 ⟨A, 1, [0, 0, 0, 0, 1, 1], [1, 0, 0, 1, 0, 0, 1, + 1, 0, 1, 1, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + pmuCfg_M_to_carry := fun l r => + ⟨7, + Counter.wmultiStep_sound (tm := target_tm) 7 ⟨A, 1, [0, 1, 1], [1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨D, 1, [0, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + pmuCfg_T_to_carry := fun l r => + ⟨7, + Counter.wmultiStep_sound (tm := target_tm) 7 ⟨A, 1, [0, 1, 1, 1], [1, 0, 0, 1, 0, 0, 1, 1, 0, + 1]⟩ + ⟨D, 1, [0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + carry_PTU := fun l r => + ⟨30, + Counter.wmultiStep_sound (tm := target_tm) 30 ⟨D, 1, [0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1], [0, + 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨D, 1, [0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + turn_PTMT := fun l r => + ⟨175, + Counter.wmultiStep_sound (tm := target_tm) 175 ⟨D, 1, [0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, + 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1], + []⟩ l r rfl⟩ + turn_ZTTT := fun l r => + ⟨175, + Counter.wmultiStep_sound (tm := target_tm) 175 ⟨D, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], + []⟩ l r rfl⟩ + turn_ZTTTM := fun l r => + ⟨155, + Counter.wmultiStep_sound (tm := target_tm) 155 ⟨D, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, + 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, + 0, 1, 1], []⟩ l r rfl⟩ + turn_ZTU_halt := fun l r => + ⟨_, ⟨34, + Counter.wmultiStep_sound (tm := target_tm) 34 ⟨D, 1, [0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [0, + 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨F, 1, [1, 0, 1, 1, 0, 1, 1, 1], [0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl⟩, rfl⟩ + r0_Z := fun l r => + ⟨12, + Counter.wmultiStep_sound (tm := target_tm) 12 ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [1, 0, + 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + r0_P := fun l r => + ⟨52, + Counter.wmultiStep_sound (tm := target_tm) 52 ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [0, 0, + 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + r0_PTTTM_TAIL := fun l r => + ⟨15, + Counter.wmultiStep_sound (tm := target_tm) 15 ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [1, 0, + 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + r1_Z := fun l r => + ⟨12, + Counter.wmultiStep_sound (tm := target_tm) 12 ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, + 1], [1, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + r1_P := fun l r => + ⟨74, + Counter.wmultiStep_sound (tm := target_tm) 74 ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, + 1], [0, 0, 1, 1, 0, 1]⟩ + ⟨D, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + r1OddShort_Z := fun l r => + ⟨12, + Counter.wmultiStep_sound (tm := target_tm) 12 ⟨D, 1, [1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 1, 1, 0, + 1]⟩ + ⟨D, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + r1Odd_P := fun l r => + ⟨10, + Counter.wmultiStep_sound (tm := target_tm) 10 ⟨D, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, + 1], [0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + wSweep_start := fun l => + ⟨2, + Counter.rcmultiStep_sound (tm := target_tm) 2 ⟨D, 0, [1, 1], []⟩ + ⟨A, 1, [], [1]⟩ l rfl⟩ + wSweep_step := fun l r => + ⟨6, + Counter.wmultiStep_sound (tm := target_tm) 6 ⟨A, 1, [0, 0, 1, 1], [1]⟩ + ⟨A, 1, [], [1, 0, 0, 1, 1]⟩ l r rfl⟩ + dSweep_step := fun l r => + ⟨6, + Counter.wmultiStep_sound (tm := target_tm) 6 ⟨E, 1, [0, 1, 1], [0, 0, 1, 1]⟩ + ⟨E, 1, [0, 1, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + dSweep_end := fun l => + ⟨5, + Counter.rcmultiStep_sound (tm := target_tm) 5 ⟨E, 1, [0, 1, 1], []⟩ + ⟨D, 0, [1, 1, 0, 0, 1, 1], []⟩ l rfl⟩ + tSweep_step := fun l r => + ⟨26, + Counter.wmultiStep_sound (tm := target_tm) 26 ⟨E, 0, [0, 0, 0, 0, 1, 1], [0, 0, 1, 1]⟩ + ⟨E, 0, [0, 0, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + tSweep_end := fun l => + ⟨2, + Counter.rcmultiStep_sound (tm := target_tm) 2 ⟨E, 0, [0, 0, 0, 0, 1, 1], []⟩ + ⟨D, 0, [1, 1, 0, 0, 0, 0, 1, 1], []⟩ l rfl⟩ + r0_to_dSweep := fun l r => + ⟨6, + Counter.wmultiStep_sound (tm := target_tm) 6 ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [1, 0, + 1, 1]⟩ + ⟨E, 1, [0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + r1_to_dSweep := fun l r => + ⟨6, + Counter.wmultiStep_sound (tm := target_tm) 6 ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, + 1], [1, 0, 1, 1]⟩ + ⟨E, 1, [0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + r1Odd_to_tSweep := fun l r => + ⟨10, + Counter.wmultiStep_sound (tm := target_tm) 10 ⟨D, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, + 1], [1, 0, 1, 1]⟩ + ⟨E, 0, [0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + wSweep_Z_to_dSweep := fun l r => + ⟨13, + Counter.wmultiStep_sound (tm := target_tm) 13 ⟨A, 1, [0, 0, 0, 0, 1, 1], [1]⟩ + ⟨E, 1, [0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + wSweep_ZT_to_dSweep := fun l r => + ⟨57, + Counter.wmultiStep_sound (tm := target_tm) 57 ⟨A, 1, [0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 0, + 1, 1]⟩ + ⟨E, 1, [0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + wSweep_PT_to_carry := fun l r => + ⟨46, + Counter.wmultiStep_sound (tm := target_tm) 46 ⟨A, 1, [0, 1, 1, 1, 0, 1, 0, 0, 1, 1], [1, 0, 0, + 1, 1]⟩ + ⟨D, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1]⟩ l r rfl⟩ + wSweep_ZMT_to_tSweep := fun l r => + ⟨83, + Counter.wmultiStep_sound (tm := target_tm) 83 ⟨A, 1, [0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], + [1, 0, 0, 1, 1]⟩ + ⟨E, 0, [0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + cfgR_Z_to_TW := fun l => + ⟨20, + Counter.rcmultiStep_sound (tm := target_tm) 20 ⟨D, 0, [1, 1, 0, 0, 0, 0, 1, 1], []⟩ + ⟨D, 0, [1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l rfl⟩ + cfgR_TW_to_t3Cfg := fun l => + ⟨32, + Counter.rcmultiStep_sound (tm := target_tm) 32 ⟨D, 0, [1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ + ⟨D, 1, [], [0, 1, 0, 0, 1, 1, 0, 1, 1]⟩ l rfl⟩ + t3_step := fun l r => + ⟨72, + Counter.wmultiStep_sound (tm := target_tm) 72 ⟨D, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1], [0, + 1, 0, 0, 1]⟩ + ⟨D, 1, [], [0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + t3Cfg_Z_zero_to_carry := fun l => + ⟨130, + Counter.rcmultiStep_sound (tm := target_tm) 130 ⟨D, 1, [0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 1, + 0, 1, 1]⟩ + ⟨D, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1]⟩ l rfl⟩ + t3Cfg_Z_succ_to_r0 := fun l r => + ⟨39, + Counter.wmultiStep_sound (tm := target_tm) 39 ⟨D, 1, [0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 1, 0, + 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + t3Cfg_TZ_to_r1OddShort := fun l r => + ⟨57, + Counter.wmultiStep_sound (tm := target_tm) 57 ⟨D, 1, [0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, + 0, 1]⟩ + ⟨D, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + r1OddShortCfg_evalWK0_to_carry := fun l => + ⟨194, + Counter.rcmultiStep_sound (tm := target_tm) 194 ⟨D, 1, [1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 1, 1]⟩ + ⟨D, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1]⟩ l rfl⟩ + t3Cfg_TTZ_to_r0 := fun l r => + ⟨85, + Counter.wmultiStep_sound (tm := target_tm) 85 ⟨D, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, + 1], [0, 1, 0, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + +-- `bmultiStep_sound` reduces 2,049 TM steps via `rfl`. +set_option maxRecDepth 2000000 in +theorem init_to_initRle : + (init []) [target_tm]⊢* (carryCfg target_tm (evalRleAux default initRle) (evalWK 1)) := + ⟨2049, Counter.bmultiStep_sound (tm := target_tm) 2049 ⟨A, 0, [], []⟩ + ⟨D, 1, [0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1], + [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1]⟩ rfl⟩ + +end Solution + +public section + +open Solution BusyBeaver.RleCarryEngine in +theorem is_halt : IsHalt target := by + rcases runCarryChunks_sound (target_tm := target_tm) 28 500 initRle 1 + runCarryChunks_28_500 with ⟨cfg', hstep, hnone⟩ + exact ⟨cfg', stepStar_trans init_to_initRle hstep, hnone⟩ + +end + +end BusyBeaver.M_1RB1LA_0LB1LC_1RD0LD_0LA0RE_1RC1RF_0LDHHH diff --git a/BusyBeaver/BB6/Halt/M_1RB1LC_1RC1RE_0LF1RD_0RA0LD_HHH1RC_1LA0LA.lean b/BusyBeaver/BB6/Halt/M_1RB1LC_1RC1RE_0LF1RD_0RA0LD_HHH1RC_1LA0LA.lean new file mode 100644 index 00000000..6f2621c8 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB1LC_1RC1RE_0LF1RD_0RA0LD_HHH1RC_1LA0LA.lean @@ -0,0 +1,37 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.HaltShared + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1LC_1RC1RE_0LF1RD_0RA0LD_HHH1RC_1LA0LA + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LC_1RC1RE_0LF1RD_0RA0LD_HHH1RC_1LA0LA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +theorem trans_A0_1LC : target A 0 = some (some B, Stmt.write 1 Dir.right) := rfl +theorem trans_B0_1LC : target B 0 = some (some C, Stmt.write 1 Dir.right) := rfl +theorem trans_C0_1LC : target C 0 = some (some F, Stmt.write 0 Dir.left) := rfl +theorem trans_F1_1LC : target F 1 = some (some A, Stmt.write 0 Dir.left) := rfl +theorem trans_E0_1LC : target E 0 = none := rfl +theorem trans_E1_1LC : target E 1 = some (some C, Stmt.write 1 Dir.right) := rfl + +public section + +theorem is_halt : IsHalt target := + is_halt_of_haltsAt target 9 (by decide +kernel) + +end + +end BusyBeaver.M_1RB1LC_1RC1RE_0LF1RD_0RA0LD_HHH1RC_1LA0LA diff --git a/BusyBeaver/BB6/Halt/M_1RB1RA_1LC0RD_1LD1LB_1RA0LE_0LB1LF_1RCHHH.lean b/BusyBeaver/BB6/Halt/M_1RB1RA_1LC0RD_1LD1LB_1RA0LE_0LB1LF_1RCHHH.lean new file mode 100644 index 00000000..5f6727cf --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB1RA_1LC0RD_1LD1LB_1RA0LE_0LB1LF_1RCHHH.lean @@ -0,0 +1,97 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Basic +import BusyBeaver.Calculi.Counter +import BusyBeaver.Calculi.CertTree +import BusyBeaver.Calculi.CertTreeDataA +import BusyBeaver.Calculi.CertTreeDataB + +open Mathlib Relation Nat Turing BusyBeaver SixState +open BusyBeaver.CertTreeEngine + +namespace BusyBeaver.M_1RB1RA_1LC0RD_1LD1LB_1RA0LE_0LB1LF_1RCHHH + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RA_1LC0RD_1LD1LB_1RA0LE_0LB1LF_1RCHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := cert_tm false + +theorem target_eq : target = target_tm := by + funext q s + fin_cases q <;> fin_cases s <;> rfl + + +namespace Solution + + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Certificate tree evaluation requires elevated recursion depth and heartbeats. +theorem step_0 : run_tree target_tm 0 0 st_0 fc_0 = .inl fc_1 := rfl + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Certificate tree evaluation requires elevated recursion depth and heartbeats. +theorem step_1 : run_tree target_tm 0 0 st_1 fc_1 = .inl fc_2 := rfl + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Certificate tree evaluation requires elevated recursion depth and heartbeats. +theorem step_2 : run_tree target_tm 0 0 st_2 fc_2 = .inl fc_3 := rfl + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Certificate tree evaluation requires elevated recursion depth and heartbeats. +theorem step_3 : run_tree target_tm 0 0 st_3 fc_3 = .inl fc_4 := rfl + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Certificate tree evaluation requires elevated recursion depth and heartbeats. +theorem step_4 : run_tree target_tm 0 0 st_4 fc_4 = .inl fc_5 := rfl + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Certificate tree evaluation requires elevated recursion depth and heartbeats. +theorem step_5 : run_tree target_tm 0 0 st_5 fc_5 = .inl fc_6 := rfl + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Certificate tree evaluation requires elevated recursion depth and heartbeats. +theorem step_6 : run_tree target_tm 0 0 st_6 fc_6 = .inl fc_7 := rfl + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Certificate tree evaluation requires elevated recursion depth and heartbeats. +theorem step_7 : run_tree target_tm 0 0 st_7 fc_7 = .inl fc_8 := rfl + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Certificate tree evaluation requires elevated recursion depth and heartbeats. +theorem step_8 : run_tree target_tm 0 0 st_8 fc_8 = .inr true := rfl + +theorem full_halt : HaltsFrom target_tm (init []) := + full_halt_of_steps target_tm 0 0 + step_0 step_1 step_2 step_3 step_4 step_5 step_6 step_7 step_8 + +end Solution + +public section + +theorem is_halt : IsHalt target := by + rw [target_eq] + exact (isHalt_iff_haltsFrom_init target_tm).mpr Solution.full_halt + +end + +end BusyBeaver.M_1RB1RA_1LC0RD_1LD1LB_1RA0LE_0LB1LF_1RCHHH diff --git a/BusyBeaver/BB6/Halt/M_1RB1RA_1LC0RE_1LD1LB_1RA0LE_1RA0LF_0LBHHH.lean b/BusyBeaver/BB6/Halt/M_1RB1RA_1LC0RE_1LD1LB_1RA0LE_1RA0LF_0LBHHH.lean new file mode 100644 index 00000000..fcd8a555 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB1RA_1LC0RE_1LD1LB_1RA0LE_1RA0LF_0LBHHH.lean @@ -0,0 +1,97 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Basic +import BusyBeaver.Calculi.Counter +import BusyBeaver.Calculi.CertTree +import BusyBeaver.Calculi.CertTreeDataA +import BusyBeaver.Calculi.CertTreeDataB + +open Mathlib Relation Nat Turing BusyBeaver SixState +open BusyBeaver.CertTreeEngine + +namespace BusyBeaver.M_1RB1RA_1LC0RE_1LD1LB_1RA0LE_1RA0LF_0LBHHH + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RA_1LC0RE_1LD1LB_1RA0LE_1RA0LF_0LBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := cert_tm true + +theorem target_eq : target = target_tm := by + funext q s + fin_cases q <;> fin_cases s <;> rfl + + +namespace Solution + + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Certificate tree evaluation requires elevated recursion depth and heartbeats. +theorem step_0 : run_tree target_tm 0x103c3 0x102c3 st_0 fc_0 = .inl fc_1 := rfl + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Certificate tree evaluation requires elevated recursion depth and heartbeats. +theorem step_1 : run_tree target_tm 0x103c3 0x102c3 st_1 fc_1 = .inl fc_2 := rfl + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Certificate tree evaluation requires elevated recursion depth and heartbeats. +theorem step_2 : run_tree target_tm 0x103c3 0x102c3 st_2 fc_2 = .inl fc_3 := rfl + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Certificate tree evaluation requires elevated recursion depth and heartbeats. +theorem step_3 : run_tree target_tm 0x103c3 0x102c3 st_3 fc_3 = .inl fc_4 := rfl + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Certificate tree evaluation requires elevated recursion depth and heartbeats. +theorem step_4 : run_tree target_tm 0x103c3 0x102c3 st_4 fc_4 = .inl fc_5 := rfl + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Certificate tree evaluation requires elevated recursion depth and heartbeats. +theorem step_5 : run_tree target_tm 0x103c3 0x102c3 st_5 fc_5 = .inl fc_6 := rfl + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Certificate tree evaluation requires elevated recursion depth and heartbeats. +theorem step_6 : run_tree target_tm 0x103c3 0x102c3 st_6 fc_6 = .inl fc_7 := rfl + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Certificate tree evaluation requires elevated recursion depth and heartbeats. +theorem step_7 : run_tree target_tm 0x103c3 0x102c3 st_7 fc_7 = .inl fc_8 := rfl + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Certificate tree evaluation requires elevated recursion depth and heartbeats. +theorem step_8 : run_tree target_tm 0x103c3 0x102c3 st_8 fc_8 = .inr true := rfl + +theorem full_halt : HaltsFrom target_tm (init []) := + full_halt_of_steps target_tm 0x103c3 0x102c3 + step_0 step_1 step_2 step_3 step_4 step_5 step_6 step_7 step_8 + +end Solution + +public section + +theorem is_halt : IsHalt target := by + rw [target_eq] + exact (isHalt_iff_haltsFrom_init target_tm).mpr Solution.full_halt + +end + +end BusyBeaver.M_1RB1RA_1LC0RE_1LD1LB_1RA0LE_1RA0LF_0LBHHH diff --git a/BusyBeaver/BB6/Halt/M_1RB1RC_1LC0LF_1RF0LD_0RE1LB_1RCHHH_1LD0RA.lean b/BusyBeaver/BB6/Halt/M_1RB1RC_1LC0LF_1RF0LD_0RE1LB_1RCHHH_1LD0RA.lean new file mode 100644 index 00000000..233cb54a --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB1RC_1LC0LF_1RF0LD_0RE1LB_1RCHHH_1LD0RA.lean @@ -0,0 +1,425 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.HaltShared + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.M_1RB1RC_1LC0LF_1RF0LD_0RE1LB_1RCHHH_1LD0RA + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RC_1LC0LF_1RF0LD_0RE1LB_1RCHHH_1LD0RA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +@[simp] theorem isVarA_tm : BusyBeaver.SymRunEngine.isVarA target_tm = false := rfl + +namespace Solution + +open BusyBeaver.RleStackEngine BusyBeaver.SymRunEngine + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + +@[simp] theorem init_nil : + (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = ⟨some A, ⟨0, default, default⟩⟩ := rfl + +macro "finish" : tactic => `(tactic| ( + refine ⟨0, ?_⟩ + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, pow_succ_list, pow_zero_list, + cons_append_list, nil_append_list, listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, zero_cons_default, default_head, + default_tail, enc1_nil, encM_nil, encM_cons_zero, encM_cons_run, + encLeft_cons_head, cons_one_encLeft_tail, encRight_cons_head, cons_one_encRight_tail, + encM_cons_run_head, cons_one_encM_cons_run_tail, multiStep_zero] + try rfl)) + +macro "step" : tactic => `(tactic| ( + try refine stepPlus_stepStar ?_ + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, pow_succ_list, pow_zero_list, + cons_append_list, nil_append_list, listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, default_head, default_tail, + encM_nil, encM_cons_zero, encM_cons_run, encLeft_cons_head, cons_one_encLeft_tail, + encRight_cons_head, cons_one_encRight_tail, encM_cons_run_head, cons_one_encM_cons_run_tail] + apply step_stepStar_stepPlus (by rfl) + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, pow_succ_list, + pow_zero_list, cons_append_list, nil_append_list, listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, + default_head, default_tail, encM_nil, encM_cons_zero, encM_cons_run, encLeft_cons_head, + cons_one_encLeft_tail, encRight_cons_head, cons_one_encRight_tail, encM_cons_run_head, + cons_one_encM_cons_run_tail])) + +macro "execute" n:num : tactic => `(tactic| ( + iterate $n step + finish)) + +theorem step_BB_nil (R : List MItem) : + (cfgBB target_tm [] R) [target_tm]⊢⁺ cfgCB target_tm [] (bumpM R) := by + unfold cfgBB cfgCB; dsimp only [isVarA_tm, ite_true, ite_false] + rw [← encM_bumpM] + execute 1 + +theorem step_BB_zero (L1 R : List MItem) : + (cfgBB target_tm (.zero :: L1) R) [target_tm]⊢⁺ cfgCB target_tm L1 (bumpM R) := by + unfold cfgBB cfgCB; dsimp only [isVarA_tm, ite_true, ite_false] + rw [← encM_bumpM] + execute 1 + +theorem step_BB_run0 (L1 R : List MItem) : + (cfgBB target_tm (.run 0 :: L1) R) [target_tm]⊢⁺ cfgBB target_tm L1 (.run 0 :: R) := by + unfold cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + execute 6 + +theorem step_BB_run1 (L1 R : List MItem) : + (cfgBB target_tm (.run 1 :: L1) R) [target_tm]⊢⁺ cfgBB target_tm L1 (.run 0 :: bumpM R) := by + unfold cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + simp only [encM_cons_run] + rw [← encM_bumpM] + execute 3 + +theorem step_BB_run2 (L1 R : List MItem) : + (cfgBB target_tm (.run 2 :: L1) R) [target_tm]⊢⁺ cfgDL target_tm L1 (.run 0 :: .run 0 :: bumpM + R) := by + unfold cfgBB cfgDL; dsimp only [isVarA_tm, ite_true, ite_false] + simp only [encM_cons_run] + rw [← encM_bumpM] + execute 5 + +theorem step_BB_run3 (L1 R : List MItem) : + (cfgBB target_tm (.run 3 :: L1) R) [target_tm]⊢⁺ cfgBB target_tm (.run 0 :: .zero :: .zero :: + L1) (bumpM R) := by + unfold cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + simp only [encM_cons_run, encM_cons_zero] + rw [← encM_bumpM] + execute 9 + +theorem step_BB_run_ge4 (d : ℕ) (L1 R : List MItem) : + (cfgBB target_tm (.run (d + 4) :: L1) R) [target_tm]⊢⁺ cfgBB target_tm (.run 0 :: .zero :: + .run d :: L1) (bumpM R) := by + unfold cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + simp only [encM_cons_run, encM_cons_zero] + rw [← encM_bumpM] + execute 9 + +theorem cyc_R_A (k : ℕ) (V s : ListBlank (Fin 2)) : + (⟨some A, ⟨0, (0 : Fin 2) >> V, (([1] : List (Fin 2)) ^ k) +> s⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢* + ⟨some A, ⟨0, (0 : Fin 2) >> ((([0] : List (Fin 2)) ^ k) +> V), s⟩⟩ := by + induction k generalizing V with + | zero => finish + | succ k ih => + have h1 : + (⟨some A, ⟨0, (0 : Fin 2) >> V, (([1] : List (Fin 2)) ^ (k + 1)) +> s⟩⟩ : Cfg (Fin 2) (Fin + 6)) + [target_tm]⊢⁺ + ⟨some A, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> V, (([1] : List (Fin 2)) ^ k) +> s⟩⟩ := by + execute 3 + have h2 := ih ((0 : Fin 2) >> V) + have h12 := stepPlus_stepStar (stepPlus_stepStar_stepPlus h1 h2) + have h_eq : + (([0] : List (Fin 2)) ^ k) +> ((0 : Fin 2) >> V) = + (([0] : List (Fin 2)) ^ (k + 1)) +> V := by + rw [zeros_append_cons_zero k V] + simp only [pow_succ_list, cons_append_list, nil_append_list, listblank_append_cons] + rwa [h_eq] at h12 + +theorem exit_R_A (W R1 : List MItem) : + (⟨some A, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> encM W, (0 : Fin 2) >> encM R1⟩⟩ : + Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + cfgCB target_tm (.run 0 :: .run 0 :: W) R1 := by + unfold cfgCB; dsimp only [isVarA_tm, ite_true, ite_false] + execute 11 + + +theorem step_DL_run0 (L1 R : List MItem) : + (cfgDL target_tm (.run 0 :: L1) R) [target_tm]⊢⁺ cfgBB target_tm L1 (bumpM R) := by + unfold cfgDL cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + rw [← encM_bumpM] + execute 1 + +theorem step_DL_run1 (L1 R : List MItem) : + (cfgDL target_tm (.run 1 :: L1) R) [target_tm]⊢⁺ cfgDL target_tm L1 (.run 0 :: bumpM R) := by + unfold cfgDL; dsimp only [isVarA_tm, ite_true, ite_false] + simp only [encM_cons_run] + rw [← encM_bumpM] + execute 3 + +theorem step_DL_run2 (d0 : ℕ) (L1 R1 : List MItem) : + (cfgDL target_tm (.run 2 :: L1) (.run d0 :: R1)) [target_tm]⊢⁺ + cfgCB target_tm (.run 0 :: .run 0 :: List.replicate (d0 + 1) .zero ++ L1) R1 := by + unfold cfgDL; dsimp only [isVarA_tm, ite_true, ite_false] + have h1 : + ((encM (.run 2 :: L1)) <{{D}} (encM (.run d0 :: R1))) + [target_tm]⊢⁺ + ⟨some A, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> encM L1, + (([1] : List (Fin 2)) ^ (d0 + 1)) +> ((0 : Fin 2) >> encM R1)⟩⟩ := by + execute 6 + have h2 := cyc_R_A (d0 + 1) ((0 : Fin 2) >> (0 : Fin 2) >> encM L1) ((0 : Fin 2) >> encM R1) + have h12 := stepPlus_stepStar_stepPlus h1 h2 + have h_z1 := zeros_append_cons_zero (d0 + 1) ((0 : Fin 2) >> encM L1) + have h_z2 := zeros_append_cons_zero (d0 + 1) (encM L1) + rw [h_z1, h_z2, encM_replicate_zero] at h12 + exact stepPlus_trans h12 (exit_R_A (List.replicate (d0 + 1) .zero ++ L1) R1) + +theorem step_CB_nil (L : List MItem) : + (cfgCB target_tm L []) [target_tm]⊢⁺ cfgDL target_tm (bumpM L) [.run 0] := by + unfold cfgCB cfgDL; dsimp only [isVarA_tm, ite_true, ite_false] + rw [← encM_bumpM] + execute 2 + +theorem step_CB_zero (L R1 : List MItem) : + (cfgCB target_tm L (.zero :: R1)) [target_tm]⊢⁺ cfgDL target_tm (bumpM L) (bumpM R1) := by + unfold cfgCB cfgDL; dsimp only [isVarA_tm, ite_true, ite_false] + rw [← encM_bumpM L, ← encM_bumpM R1] + execute 2 + +theorem step_CB_run0_nil (L : List MItem) : + (cfgCB target_tm L [.run 0]) [target_tm]⊢⁺ cfgBB target_tm (.run 0 :: bumpM L) [] := by + unfold cfgCB cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + simp only [encM_cons_run] + rw [← encM_bumpM] + execute 3 + +theorem step_CB_run0_zero (L R2 : List MItem) : + (cfgCB target_tm L (.run 0 :: .zero :: R2)) [target_tm]⊢⁺ cfgBB target_tm (.run 0 :: bumpM L) + R2 := by + unfold cfgCB cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + simp only [encM_cons_run] + rw [← encM_bumpM] + execute 3 + +theorem step_CB_run0_run0 (L R2 : List MItem) : + (cfgCB target_tm L (.run 0 :: .run 0 :: R2)) [target_tm]⊢⁺ cfgBB target_tm (.run 0 :: .zero :: + bumpM L) R2 := by + unfold cfgCB cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + simp only [encM_cons_run, encM_cons_zero] + rw [← encM_bumpM] + execute 6 + +theorem step_CB_run0_run_pos (d2 : ℕ) (L R2 : List MItem) : + (cfgCB target_tm L (.run 0 :: .run (d2 + 1) :: R2)) [target_tm]⊢⁺ + cfgCB target_tm (.run 0 :: .run 0 :: List.replicate d2 .zero ++ bumpM L) R2 := by + unfold cfgCB; dsimp only [isVarA_tm, ite_true, ite_false] + have h1 : + (⟨some C, ⟨0, encM L, encM (.run 0 :: .run (d2 + 1) :: R2)⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ⟨some A, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> encM (bumpM L), + (([1] : List (Fin 2)) ^ (d2 + 1)) +> ((0 : Fin 2) >> encM R2)⟩⟩ := by + rw [← encM_bumpM L] + execute 5 + have h2 := cyc_R_A (d2 + 1) ((0 : Fin 2) >> encM (bumpM L)) ((0 : Fin 2) >> encM R2) + have h12 := stepPlus_stepStar_stepPlus h1 h2 + have h_z1 := zeros_append_cons_zero (d2 + 1) (encM (bumpM L)) + have h_z2 : + ((([0] : List (Fin 2)) ^ (d2 + 1)) +> encM (bumpM L)) = + (0 : Fin 2) >> ((([0] : List (Fin 2)) ^ d2) +> encM (bumpM L)) := by + simp only [pow_succ_list, cons_append_list, nil_append_list, listblank_append_cons] + rw [h_z1, h_z2, encM_replicate_zero] at h12 + exact stepPlus_trans h12 (exit_R_A (List.replicate d2 .zero ++ bumpM L) R2) + +theorem step_CB_run1 (L R1 : List MItem) : + (cfgCB target_tm L (.run 1 :: R1)) [target_tm]⊢⁺ cfgCB target_tm (.run 0 :: bumpM L) R1 := by + unfold cfgCB; dsimp only [isVarA_tm, ite_true, ite_false] + simp only [encM_cons_run] + rw [← encM_bumpM] + execute 3 + +theorem step_CB_run2 (L R1 : List MItem) : + (cfgCB target_tm L (.run 2 :: R1)) [target_tm]⊢⁺ cfgBB target_tm (bumpM L) (.run 0 :: .zero :: + R1) := by + unfold cfgCB cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + rw [← encM_bumpM] + execute 5 + +theorem step_CB_run_ge3 (d : ℕ) (L R1 : List MItem) : + (cfgCB target_tm L (.run (d + 3) :: R1)) [target_tm]⊢⁺ cfgBB target_tm (bumpM L) (.run 0 :: + .run d :: R1) := by + unfold cfgCB cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + rw [← encM_bumpM] + execute 5 + + +theorem init_to_BB : (init []) [target_tm]⊢⁺ cfgBB target_tm [.run 0] [] := by + unfold cfgBB; dsimp only [isVarA_tm, ite_true, ite_false] + execute 1 + +theorem step_DL_zero_halt (L1 R1 : List MItem) : + (cfgDL target_tm (.zero :: L1) (.run 0 :: R1)) [target_tm]⊢⁺ + ⟨some E, ⟨1, (0 : Fin 2) >> encM L1, (0 : Fin 2) >> encM R1⟩⟩ := by + unfold cfgDL; dsimp only [isVarA_tm, ite_true, ite_false] + execute 1 + +instance : HasSymRunRules target_tm where + step_BB_nil := step_BB_nil + step_BB_zero := step_BB_zero + step_BB_run0 := step_BB_run0 + step_BB_run1 := step_BB_run1 + step_BB_run2 := step_BB_run2 + step_BB_run3 := step_BB_run3 + step_BB_run_ge4 := step_BB_run_ge4 + step_DL_run0 := step_DL_run0 + step_DL_run1 := step_DL_run1 + step_DL_run2 := step_DL_run2 + step_CB_nil := step_CB_nil + step_CB_zero := step_CB_zero + step_CB_run0_nil := step_CB_run0_nil + step_CB_run0_zero := step_CB_run0_zero + step_CB_run0_run0 := step_CB_run0_run0 + step_CB_run0_run_pos := step_CB_run0_run_pos + step_CB_run1 := step_CB_run1 + step_CB_run2 := step_CB_run2 + step_CB_run_ge3 := step_CB_run_ge3 + +def initSymCyc3 : SymMode × List SymTok × List SymTok := + (.CB, + [.item (.run 0), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 0), .item .zero, + .item (.run 1), .repB1 46, .item (.run 0)], + [.item (.run 79), .item (.run 0), .item (.run 1), .item .zero, + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run + 1)]) + +def symChk4096 : SymMode × List SymTok × List SymTok := + (.CB, [.item (.run 1), .repB1 349285, .item (.run 0)], [.item (.run 1), .item (.run 0), .item + (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .rep12 69932, .item (.run 0), + .item (.run 2), .item (.run 3), .item (.run 5), .item (.run 1), .item (.run 5), .item (.run + 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1)]) + +def symChk8192 : SymMode × List SymTok × List SymTok := + (.CB, [.item (.run 0), .item (.run 0), .item (.run 1), .rep2 2, .item (.run 0), .item (.run 1), + .item (.run 1), .item (.run 1), .repB1 1762386413, .item (.run 0)], [.item .zero, .item + (.run 1762387139), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), .item + (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 2), .item (.run + 3), .item (.run 0), .item (.run 1), .item .zero, .item (.run 1), .item (.run 1), .item (.run + 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 1), .item (.run 1), .item (.run 1)]) + +def symChk12288 : SymMode × List SymTok × List SymTok := + (.CB, [.item (.run 1), .rep12 925198033012, .item (.run 1), .item (.run 0), .item (.run 1), + .item (.run 0), .item .zero, .item (.run 1), .repB1 4625990163979, .item (.run 0)], [.item + (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), + .item (.run 1), .item (.run 0), .item (.run 2), .item (.run 0), .item (.run 1), .item (.run + 2), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run + 1), .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 1), .item .zero, .item (.run + 0), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item + (.run 1), .item (.run 1), .item (.run 1), .item (.run 2), .item (.run 3), .item (.run 1), + .item (.run 1)]) + +def symChk16384 : SymMode × List SymTok × List SymTok := + (.DL, [.repB1 14570999059234231, .item (.run 0)], [.item (.run 0), .item (.run 0), .item (.run + 1), .item (.run 1), .rep12 2914199811847131, .item (.run 0), .item (.run 1), .item (.run 1) + , .item .zero, .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 2), .item (.run + 3), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 1), .item + (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item .zero, .item + (.run 5)]) + +def symChk20480 : SymMode × List SymTok × List SymTok := + (.DL, [.item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item + (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), + .item .zero, .item .zero, .item .zero, .item .zero, .item (.run 1), .item (.run 0), .item + (.run 1), .item (.run 2), .rep12 12238908486313258620, .item (.run 1), .item (.run 0), .item + (.run 1), .item (.run 0), .item .zero, .item (.run 1), .repB1 61194542431566291295, .item + (.run 0)], [.item (.run 0), .item (.run 4), .item (.run 1), .item .zero, .item (.run 1), + .item (.run 1), .item (.run 1), .item (.run 1)]) + +def symChk21383 : SymMode × List SymTok × List SymTok := + (.HALT, [.item .zero, .item .zero, .item (.run 1), .item (.run 1), .item (.run 0), .item (.run + 1), .item (.run 0), .item .zero, .item .zero, .item (.run 1), .item (.run 0), .item (.run 1) + , .item (.run 2), .rep12 68766212839422643803, .item (.run 2), .repB1 343831064197113217107 + , .item (.run 0)], [.item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1), .item + (.run 1), .item (.run 0), .item (.run 1), .item .zero, .item (.run 3), .item (.run 1), .item + (.run 1)]) + + +set_option maxRecDepth 200000 in +theorem test_elem_rfl : + runElemFast 7 3 11 4 (.BB, [.run 0], []) = (initSymCyc3.1, encSymL initSymCyc3.2.1, encSymR + initSymCyc3.2.2) := by decide +kernel + +set_option maxRecDepth 200000 in +theorem sym_chk1 : stepSym4096 initSymCyc3 = symChk4096 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk2 : stepSym4096 symChk4096 = symChk8192 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk3 : stepSym4096 symChk8192 = symChk12288 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk4 : stepSym4096 symChk12288 = symChk16384 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk5 : stepSym4096 symChk16384 = symChk20480 := by decide +kernel +set_option maxRecDepth 200000 in +theorem sym_chk6 : iterStep stepSym 7 (iterStep stepSym16 8 (iterStep stepSym256 3 symChk20480)) = + symChk21383 := by decide +kernel + + + +end Solution + +public section + +open Solution BusyBeaver.RleStackEngine BusyBeaver.SymRunEngine in +theorem is_halt : IsHalt target := by + have h0 : (init []) [target_tm]⊢* ((evalM target_tm) (.BB, [.run 0], [])) := + stepPlus_stepStar init_to_BB + have h1 : ((evalM target_tm) (.BB, [.run 0], [])) [target_tm]⊢* ((evalSym target_tm) + initSymCyc3) := by + have h := runElemFast_sound (target_tm := target_tm) 7 3 11 4 (.BB, [.run 0], []) + rw [test_elem_rfl] at h + exact h + have hc1 : ((evalSym target_tm) initSymCyc3) [target_tm]⊢* ((evalSym target_tm) symChk4096) := + by + rw [← sym_chk1]; exact stepSym4096_sound initSymCyc3 + have hc2 : ((evalSym target_tm) symChk4096) [target_tm]⊢* ((evalSym target_tm) symChk8192) := by + rw [← sym_chk2]; exact stepSym4096_sound symChk4096 + have hc3 : ((evalSym target_tm) symChk8192) [target_tm]⊢* ((evalSym target_tm) symChk12288) := + by + rw [← sym_chk3]; exact stepSym4096_sound symChk8192 + have hc4 : ((evalSym target_tm) symChk12288) [target_tm]⊢* ((evalSym target_tm) symChk16384) := + by + rw [← sym_chk4]; exact stepSym4096_sound symChk12288 + have hc5 : ((evalSym target_tm) symChk16384) [target_tm]⊢* ((evalSym target_tm) symChk20480) := + by + rw [← sym_chk5]; exact stepSym4096_sound symChk16384 + have hc6 : ((evalSym target_tm) symChk20480) [target_tm]⊢* ((evalSym target_tm) symChk21383) := + by + rw [← sym_chk6] + exact stepStar_trans (iterStep_sound stepSym256 (evalSym target_tm) + (stepSym256_sound (target_tm := target_tm)) 3 + symChk20480) + (stepStar_trans (iterStep_sound stepSym16 (evalSym target_tm) + (stepSym16_sound (target_tm := target_tm)) 8 _) + (iterStep_sound stepSym (evalSym target_tm) + (stepSym_sound (target_tm := target_tm)) 7 _)) + have h_to_halt_sym : (init []) [target_tm]⊢* ((evalSym target_tm) symChk21383) := + stepStar_trans h0 (stepStar_trans h1 (stepStar_trans hc1 (stepStar_trans hc2 + (stepStar_trans hc3 (stepStar_trans hc4 (stepStar_trans hc5 hc6)))))) + have h_final := step_DL_zero_halt + (encSymL [.item .zero, .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), .item + (.run 0), .item .zero, .item .zero, .item (.run 1), .item (.run 0), .item (.run 1), .item + (.run 2), .rep12 68766212839422643803, .item (.run 2), .repB1 343831064197113217107, .item + (.run 0)]) + (encSymR [.item (.run 1), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), + .item (.run 1), .item .zero, .item (.run 3), .item (.run 1), .item (.run 1)]) + exact ⟨_, stepStar_trans h_to_halt_sym (stepPlus_stepStar h_final), rfl⟩ + +end + +end BusyBeaver.M_1RB1RC_1LC0LF_1RF0LD_0RE1LB_1RCHHH_1LD0RA diff --git a/BusyBeaver/BB6/Halt/M_1RB1RC_1LC1RD_1LD0LE_1LA0LD_0LB1RF_HHH0LF.lean b/BusyBeaver/BB6/Halt/M_1RB1RC_1LC1RD_1LD0LE_1LA0LD_0LB1RF_HHH0LF.lean new file mode 100644 index 00000000..74e680d0 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB1RC_1LC1RD_1LD0LE_1LA0LD_0LB1RF_HHH0LF.lean @@ -0,0 +1,37 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.HaltShared + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1RC_1LC1RD_1LD0LE_1LA0LD_0LB1RF_HHH0LF + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RC_1LC1RD_1LD0LE_1LA0LD_0LB1RF_HHH0LF" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +theorem trans_A0_1RC : target A 0 = some (some B, Stmt.write 1 Dir.right) := rfl +theorem trans_B0_1RC : target B 0 = some (some C, Stmt.write 1 Dir.left) := rfl +theorem trans_C1_1RC : target C 1 = some (some E, Stmt.write 0 Dir.left) := rfl +theorem trans_D1_1RC : target D 1 = some (some D, Stmt.write 0 Dir.left) := rfl +theorem trans_F0_1RC : target F 0 = none := rfl +theorem trans_F1_1RC : target F 1 = some (some F, Stmt.write 0 Dir.left) := rfl + +public section + +theorem is_halt : IsHalt target := + is_halt_of_haltsAt target 19 (by decide +kernel) + +end + +end BusyBeaver.M_1RB1RC_1LC1RD_1LD0LE_1LA0LD_0LB1RF_HHH0LF diff --git a/BusyBeaver/BB6/Halt/M_1RB1RE_1LC0LB_1LD1LC_0RA1RF_1RD1RE_HHH1LB.lean b/BusyBeaver/BB6/Halt/M_1RB1RE_1LC0LB_1LD1LC_0RA1RF_1RD1RE_HHH1LB.lean new file mode 100644 index 00000000..5938698a --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB1RE_1LC0LB_1LD1LC_0RA1RF_1RD1RE_HHH1LB.lean @@ -0,0 +1,1390 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1RE_1LC0LB_1LD1LC_0RA1RF_1RD1RE_HHH1LB + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RE_1LC0LB_1LD1LC_0RA1RF_1RD1RE_HHH1LB" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + + + +local notation "zB" => ListBlank (Fin 2) +local notation "zF" => List (Fin 2) + +@[simp] theorem zMz (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] +@[simp] theorem z0i : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : zB).head = 0 := rfl +@[simp] theorem zDt : (default : zB).tail = default := rfl +@[simp] theorem append_nil (s : zB) : ([] : zF) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : zF) (s : zB) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l₁ l₂ : zF) (s : zB) : + (l₁ ++ l₂) +> s = l₁ +> (l₂ +> s) := by + induction l₁ with + | nil => rfl + | cons a l₁ ih => simp [ih] +@[simp] theorem zPz {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem z0j {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +theorem z0k {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp [Nat.zero_add] + | succ m ih => simp [z0j, Nat.succ_add, ih, List.append_assoc] +theorem z0l {α : Type*} (l : List α) (n : Nat) : l ^ n ++ l = l ^ (n + 1) := by + induction n with + | zero => simp [z0j] + | succ n ih => simp [z0j, List.append_assoc, ih] + +theorem zSm (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢^{1} c₂ := by simp [h] +theorem z0P (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢* c₂ := ⟨1, zSm tm c₁ c₂ h⟩ +theorem z0Q (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢⁺ c₂ := ⟨1, by decide, zSm tm c₁ c₂ h⟩ +theorem zMa (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, zMs, ih, Option.bind_assoc] + simp_rw [zMs] +theorem zMt (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [zMa, h₁]; simp [h₂] +theorem zSt {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, zMt tm c₁ c₂ c₃ n m hn hm⟩ +theorem zPs {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ +theorem z0R {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), zMt tm c₁ c₂ c₃ n m hn hm⟩ +theorem z0T {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + z0R (z0Q tm c₁ c₂ h₁) h₂ + +macro "finish" : tactic => + `(tactic| (try dsimp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, append_cons, append_nil]) <;> exists 0 <;> fail) +macro "step_tm" : tactic => + `(tactic| (try dsimp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, append_cons, append_nil]) <;> (try refine zPs ?_) <;> + refine z0T (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, append_cons, append_nil, Turing.ListBlank.head_cons, zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, append_cons, append_nil, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, z0i, zDh, zDt]) +macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm))) +macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +def IsHaltFrom (c : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ cfg, (c [target_tm]⊢* cfg) ∧ (step target_tm cfg).isNone + +theorem halt_from_trans {c₁ c₂ : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [target_tm]⊢* c₂) (h₂ : IsHaltFrom c₂) : IsHaltFrom c₁ := by + rcases h₂ with ⟨cfg, h₂, h₃⟩ + exact ⟨cfg, zSt h₁ h₂, h₃⟩ + +abbrev W0 : zF := [0] +abbrev W1 : zF := [1] + +@[simp] theorem zero_pow_default (n : Nat) : (W0 ^ n) +> (default : zB) = default := by + induction n with + | zero => rfl + | succ n ih => rw [z0j, append_assoc, append_cons, append_nil, ih, z0i] + +theorem start_sweep (r : zB) : + (default <{{C}} r) [target_tm]⊢* ((default << 1) {{E}}> r) := by + execute + +theorem sweep_ones (n : Nat) (l r : zB) : + (l {{E}}> ((W1 ^ n) +> r)) [target_tm]⊢* ((l <+ (W1 ^ n)) {{E}}> r) := by + induction n generalizing l r with + | zero => try exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (l {{E}}> (W1 +> (W1 ^ n) +> r)) [target_tm]⊢* + ((l << 1) {{E}}> ((W1 ^ n) +> r)) := by + dsimp [W1]; execute + have h2 := ih (l << 1) r + have heq : (l << 1) <+ (W1 ^ n) = l <+ (W1 ^ (n + 1)) := by + rw [← z0l, append_assoc]; rfl + rw [heq] at h2 + exact zSt h1 h2 + +theorem sweep_011 (l r : zB) : + (l {{E}}> (([0, 1, 1] : zF) +> r)) [target_tm]⊢* (l <{{B}} (([0, 0, 1] : zF) +> r)) := by + execute + +theorem sweep_010_halt (l r : zB) : + IsHaltFrom (l {{E}}> (([0, 1, 0] : zF) +> r)) := by + refine ⟨((l << 1 << 1) {{F}}> (([0] : zF) +> r)), ?_, by (simp [step, target_tm, F]; rfl)⟩ + execute + +theorem sweep_001 (l r : zB) : + (l {{E}}> (([0, 0, 1] : zF) +> r)) [target_tm]⊢* ((l << 1 << 0 << 1) {{E}}> r) := by + execute + +theorem sweep_0001 (l r : zB) : + (l {{E}}> (([0, 0, 0, 1] : zF) +> r)) [target_tm]⊢* (l <{{C}} (([1, 1, 0, 0] : zF) +> r)) := by + execute + +theorem sweep_0000 (l r : zB) : + (l {{E}}> (([0, 0, 0, 0] : zF) +> r)) [target_tm]⊢* (l <{{B}} (([0, 1, 1, 1] : zF) +> r)) := by + execute + +theorem back_some_C (n : Nat) (l r : zB) : + ((l <+ (W1 ^ n)) <{{C}} r) [target_tm]⊢* (l <{{C}} ((W1 ^ n) +> r)) := by + induction n generalizing l r with + | zero => try exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (((l <+ (W1 ^ n)) << 1) <{{C}} r) [target_tm]⊢* + ((l <+ (W1 ^ n)) <{{C}} (W1 +> r)) := by + dsimp [W1]; execute + have h2 := ih l (W1 +> r) + have heq : (W1 ^ n) +> (W1 +> r) = (W1 ^ (n + 1)) +> r := by + rw [← z0l, append_assoc] + rw [heq] at h2 + exact zSt h1 h2 + +theorem back_some_B (n : Nat) (l r : zB) : + ((l <+ (W1 ^ n)) <{{B}} r) [target_tm]⊢* (l <{{B}} ((W0 ^ n) +> r)) := by + induction n generalizing l r with + | zero => try exact ⟨0, rfl⟩ + | succ n ih => + rw [z0j, append_assoc] + have h1 : (((l <+ (W1 ^ n)) << 1) <{{B}} r) [target_tm]⊢* + ((l <+ (W1 ^ n)) <{{B}} (W0 +> r)) := by + dsimp [W0]; execute + have h2 := ih l (W0 +> r) + have heq : (W0 ^ n) +> (W0 +> r) = (W0 ^ (n + 1)) +> r := by + rw [← z0l, append_assoc] + rw [heq] at h2 + exact zSt h1 h2 + +theorem back_none_C (l r : zB) : + ((l << 1 << 0 << 1) <{{C}} r) [target_tm]⊢* (l <{{B}} (([0, 1, 1] : zF) +> r)) := by + execute + +theorem back_none_B (l r : zB) : + ((l << 1 << 0 << 1) <{{B}} r) [target_tm]⊢* (l <{{C}} (([1, 1, 0] : zF) +> r)) := by + execute + +theorem back_nil_C (r : zB) : + ((default << 1) <{{C}} r) [target_tm]⊢* (default <{{C}} (W1 +> r)) := by + dsimp [W1]; execute + +theorem back_nil_B (r : zB) : + ((default << 1) <{{B}} r) [target_tm]⊢* (default <{{C}} (([1, 0] : zF) +> r)) := by + execute + +theorem ff_entry (s : zB) : + (default <{{C}} (([1, 0, 0, 0, 0] : zF) +> s)) [target_tm]⊢* + (default <{{C}} ((W1 ^ 4) +> (([0, 0, 1, 1] : zF) +> s))) := by + dsimp [W1]; execute + +theorem sweep_a_3 (a : Nat) (s : zB) : + (default <{{C}} ((W1 ^ a) +> (([0, 0, 0, 1] : zF) +> s))) [target_tm]⊢* + (default <{{C}} ((W1 ^ (a + 3)) +> (([0, 0] : zF) +> s))) := by + refine zSt (start_sweep _) ?_ + refine zSt (sweep_ones a _ _) ?_ + refine zSt (sweep_0001 _ _) ?_ + refine zSt (back_some_C a _ _) ?_ + have h1 := back_nil_C ((W1 ^ a) +> (([1, 1, 0, 0] : zF) +> s)) + have heq : W1 +> ((W1 ^ a) +> (([1, 1, 0, 0] : zF) +> s)) = (W1 ^ (a + 3)) +> (([0, 0] : zF) +> s) := by + rw [show a + 3 = 1 + (a + 2) by omega, z0k, z0k W1 a 2, append_assoc, append_assoc] + rfl + rw [heq] at h1 + exact h1 + +theorem sweep_a_ge4 (a : Nat) (s : zB) : + (default <{{C}} ((W1 ^ a) +> (([0, 0, 0, 0] : zF) +> s))) [target_tm]⊢* + (default <{{C}} (W1 +> ((W0 ^ (a + 2)) +> (([1, 1, 1] : zF) +> s)))) := by + refine zSt (start_sweep _) ?_ + refine zSt (sweep_ones a _ _) ?_ + refine zSt (sweep_0000 _ _) ?_ + refine zSt (back_some_B a _ _) ?_ + have h1 := back_nil_B ((W0 ^ a) +> (([0, 1, 1, 1] : zF) +> s)) + have heq : ([1, 0] : zF) +> ((W0 ^ a) +> (([0, 1, 1, 1] : zF) +> s)) = + W1 +> ((W0 ^ (a + 2)) +> (([1, 1, 1] : zF) +> s)) := by + rw [show a + 2 = 1 + (a + 1) by omega, z0k, z0k W0 a 1, append_assoc, append_assoc] + rfl + rw [heq] at h1 + exact h1 + +theorem ff_one (a : Nat) (s : zB) : + (default <{{C}} ((W1 ^ a) +> (([0, 0, 1, 1, 0, 0, 0, 0] : zF) +> s))) [target_tm]⊢* + (default <{{C}} ((W1 ^ (a + 6)) +> (([0, 0, 1, 1] : zF) +> s))) := by + refine zSt (start_sweep _) ?_ + refine zSt (sweep_ones a _ _) ?_ + have h_split : (([0, 0, 1, 1, 0, 0, 0, 0] : zF) +> s) = ([0, 0, 1] : zF) +> (([1, 0, 0, 0, 0] : zF) +> s) := rfl + rw [h_split] + refine zSt (sweep_001 _ _) ?_ + have h_mid : (((default << 1 <+ (W1 ^ a)) << 1 << 0 << 1) {{E}}> (([1, 0, 0, 0, 0] : zF) +> s)) [target_tm]⊢* + ((default << 1 <+ (W1 ^ a)) <{{C}} (([1, 1, 0, 0, 0, 1, 1, 1] : zF) +> s)) := by + execute + refine zSt h_mid ?_ + refine zSt (back_some_C a _ _) ?_ + have h_back := back_nil_C ((W1 ^ a) +> (([1, 1, 0, 0, 0, 1, 1, 1] : zF) +> s)) + have heq1 : W1 +> ((W1 ^ a) +> (([1, 1, 0, 0, 0, 1, 1, 1] : zF) +> s)) = + (W1 ^ (a + 3)) +> (([0, 0, 0, 1] : zF) +> (([1, 1] : zF) +> s)) := by + rw [show a + 3 = 1 + (a + 2) by omega, z0k, z0k W1 a 2, append_assoc, append_assoc] + rfl + rw [heq1] at h_back + refine zSt h_back ?_ + have h2 := sweep_a_3 (a + 3) (([1, 1] : zF) +> s) + have heq2 : (a + 3) + 3 = a + 6 := by omega + rw [heq2] at h2 + exact h2 + +theorem ff_loop (q a : Nat) (s : zB) : + (default <{{C}} ((W1 ^ a) +> (([0, 0, 1, 1] : zF) +> ((W0 ^ (4 * q)) +> s)))) [target_tm]⊢* + (default <{{C}} ((W1 ^ (a + 6 * q)) +> (([0, 0, 1, 1] : zF) +> s))) := by + induction q generalizing a with + | zero => simp; try exact ⟨0, rfl⟩ + | succ q ih => + have hq : 4 * (q + 1) = 4 + 4 * q := by omega + rw [hq, z0k W0 4 (4 * q), append_assoc] + have h1 : (([0, 0, 1, 1] : zF) +> ((W0 ^ 4) +> ((W0 ^ (4 * q)) +> s))) = + (([0, 0, 1, 1, 0, 0, 0, 0] : zF) +> ((W0 ^ (4 * q)) +> s)) := rfl + rw [h1] + refine zSt (ff_one a ((W0 ^ (4 * q)) +> s)) ?_ + have h2 := ih (a + 6) + have ha : a + 6 + 6 * q = a + 6 * (q + 1) := by omega + rw [ha] at h2 + exact h2 + +theorem init_to_seed : + (init []) [target_tm]⊢* + (default <{{C}} ((W1 ^ 4) +> ((W0 ^ 2) +> ((W1 ^ 5) +> default)))) := by + dsimp [init, Tape.mk₁, W0, W1] + execute + +-- ============================================================================ +-- Section 6: Fast Kernel RLE Evaluator +-- ============================================================================ + +noncomputable section + +inductive RTape where + | nil : RTape + | cons (b : Bool) (n : Nat) (rest : RTape) : RTape + +inductive AccList where + | nil : AccList + | some (n : Nat) (rest : AccList) : AccList + | none (rest : AccList) : AccList + +inductive SweepRes where + | halted : SweepRes + | done (phase : Bool) (t : RTape) : SweepRes + | failed : SweepRes + +inductive StepRes where + | halted : StepRes + | running (t : RTape) : StepRes + | failed : StepRes + +def bindNat {α : Type} (n : Nat) (k : Nat → α) : α := + Nat.rec (k 0) (fun m _ => k m) (Nat.add n 1) + +def forceRTape {α : Type} (t : RTape) (k : RTape → α) : α := + (RTape.rec (fun k => k RTape.nil) (fun b n rest _ k => k (RTape.cons b n rest)) t : (RTape → α) → α) k + +def bool_eq (b b0 : Bool) : Bool := + Bool.rec (Bool.rec true false b0) b0 b + +def push1_nil (b : Bool) (n : Nat) : RTape := + bindNat n (fun n' => RTape.cons b n' RTape.nil) + +def push1_cons_diff (b : Bool) (n : Nat) (b0 : Bool) (n0 : Nat) (rest : RTape) : RTape := + bindNat n (fun n' => RTape.cons b n' (RTape.cons b0 n0 rest)) + +def push1_cons_same (b : Bool) (n : Nat) (b0 : Bool) (n0 : Nat) (rest : RTape) : RTape := + bindNat (Nat.add n n0) (fun s => RTape.cons b0 s rest) + +def push1_branch (eq : Bool) : Bool → Nat → Bool → Nat → RTape → RTape := + Bool.rec push1_cons_diff push1_cons_same eq + +def push1_cons (b0 : Bool) (n0 : Nat) (rest : RTape) (_ : Nat → Bool → RTape) (n : Nat) (b : Bool) : RTape := + push1_branch (bool_eq b b0) b n b0 n0 rest + +def push1 (b : Bool) (n : Nat) (t : RTape) : RTape := + (RTape.rec (fun n b => push1_nil b n) push1_cons t : Nat → Bool → RTape) n b + +def push_branch (is0 : Bool) : Bool → Nat → RTape → RTape := + Bool.rec push1 (fun _ _ t => t) is0 + +def push (b : Bool) (n : Nat) (t : RTape) : RTape := + push_branch (Nat.beq n 0) b n t + +def back_rel_some (n : Nat) (_ : AccList) (ih : Bool → RTape → SweepRes) (phase : Bool) (t : RTape) : SweepRes := + forceRTape (push1 phase n t) (ih phase) + +def back_rel_none_false (ih : Bool → RTape → SweepRes) (t : RTape) : SweepRes := + forceRTape (push1 false 1 t) (fun t' => ih true (RTape.cons true 2 t')) + +def back_rel_none_true (ih : Bool → RTape → SweepRes) (t : RTape) : SweepRes := + forceRTape (push1 true 2 t) (fun t' => ih false (RTape.cons false 1 t')) + +def back_rel_none_branch (phase : Bool) : (Bool → RTape → SweepRes) → RTape → SweepRes := + Bool.rec back_rel_none_false back_rel_none_true phase + +def back_rel_none (_ : AccList) (ih : Bool → RTape → SweepRes) (phase : Bool) (t : RTape) : SweepRes := + back_rel_none_branch phase ih t + +def back_rel (acc : AccList) (phase : Bool) (t : RTape) : SweepRes := + (AccList.rec SweepRes.done back_rel_some back_rel_none acc : Bool → RTape → SweepRes) phase t + +def sf_nil (_ : AccList) : SweepRes := + SweepRes.failed + +def sf_n0_1_true_ge2 (acc : AccList) (r2 : RTape) (n1 : Nat) : SweepRes := + bindNat (Nat.sub n1 1) (fun n1' => back_rel acc false (RTape.cons false 2 (RTape.cons true n1' r2))) + +def sf_n0_1_true_branch (ge2 : Bool) : AccList → RTape → Nat → SweepRes := + Bool.rec (fun _ _ _ => SweepRes.halted) sf_n0_1_true_ge2 ge2 + +def sf_n0_1_true (n1 : Nat) (r2 : RTape) (acc : AccList) : SweepRes := + sf_n0_1_true_branch (Nat.ble 2 n1) acc r2 n1 + +def sf_n0_1_branch (b1 : Bool) : Nat → RTape → AccList → SweepRes := + Bool.rec (fun _ _ _ => SweepRes.failed) sf_n0_1_true b1 + +def sf_n0_1_cons (b1 : Bool) (n1 : Nat) (r2 : RTape) (_ : AccList → SweepRes) (acc : AccList) : SweepRes := + sf_n0_1_branch b1 n1 r2 acc + +def sf_n0_1 (rest : RTape) (acc : AccList) : SweepRes := + (RTape.rec (fun _ => SweepRes.failed) sf_n0_1_cons rest : AccList → SweepRes) acc + +def sf_n0_2_true (ih : AccList → RTape → SweepRes) (acc : AccList) (n1 : Nat) (r2 : RTape) : SweepRes := + bindNat (Nat.sub n1 1) (fun n1' => forceRTape (push true n1' r2) (ih (AccList.none acc))) + +def sf_n0_2_branch (b1 : Bool) : (AccList → RTape → SweepRes) → AccList → Nat → RTape → SweepRes := + Bool.rec (fun _ _ _ _ => SweepRes.failed) sf_n0_2_true b1 + +def sf_n0_2_cons (b1 : Bool) (n1 : Nat) (r2 : RTape) (_ : (AccList → RTape → SweepRes) → AccList → SweepRes) + (ih : AccList → RTape → SweepRes) (acc : AccList) : SweepRes := + sf_n0_2_branch b1 ih acc n1 r2 + +def sf_n0_2 (rest : RTape) (ih : AccList → RTape → SweepRes) (acc : AccList) : SweepRes := + (RTape.rec (fun _ acc => sf_nil acc) sf_n0_2_cons rest : (AccList → RTape → SweepRes) → AccList → SweepRes) ih acc + +def sf_n0_3_true (acc : AccList) (n1 : Nat) (r2 : RTape) : SweepRes := + bindNat (Nat.sub n1 1) (fun n1' => + forceRTape (push true n1' r2) (fun r3 => + forceRTape (push1 false 2 r3) (fun r4 => + back_rel acc true (RTape.cons true 2 r4)))) + +def sf_n0_3_branch (b1 : Bool) : AccList → Nat → RTape → SweepRes := + Bool.rec (fun _ _ _ => SweepRes.failed) sf_n0_3_true b1 + +def sf_n0_3_cons (b1 : Bool) (n1 : Nat) (r2 : RTape) (_ : AccList → SweepRes) (acc : AccList) : SweepRes := + sf_n0_3_branch b1 acc n1 r2 + +def sf_n0_3 (rest : RTape) (acc : AccList) : SweepRes := + (RTape.rec sf_nil sf_n0_3_cons rest : AccList → SweepRes) acc + +def sf_n0_ge4 (n0 : Nat) (rest : RTape) (acc : AccList) : SweepRes := + bindNat (Nat.sub n0 4) (fun n0' => + forceRTape (push false n0' rest) (fun r3 => + forceRTape (push1 true 3 r3) (fun r4 => + back_rel acc false (RTape.cons false 1 r4)))) + +def sf_b3 (c : Bool) : Nat → RTape → AccList → SweepRes := + Bool.rec sf_n0_ge4 (fun _ rest acc => sf_n0_3 rest acc) c + +def sf_b2 (c : Bool) : Nat → RTape → (AccList → RTape → SweepRes) → AccList → SweepRes := + Bool.rec (fun n0 rest _ acc => sf_b3 (Nat.beq n0 3) n0 rest acc) (fun _ rest ih acc => sf_n0_2 rest ih acc) c + +def sf_b1 (c : Bool) : Nat → RTape → (AccList → RTape → SweepRes) → AccList → SweepRes := + Bool.rec (fun n0 rest ih acc => sf_b2 (Nat.beq n0 2) n0 rest ih acc) (fun _ rest _ acc => sf_n0_1 rest acc) c + +def sf_false_branch (n0 : Nat) (rest : RTape) (ih : AccList → RTape → SweepRes) (acc : AccList) : SweepRes := + sf_b1 (Nat.beq n0 1) n0 rest ih acc + +def sf_cons_branch (b0 : Bool) : Nat → RTape → (AccList → RTape → SweepRes) → AccList → SweepRes := + Bool.rec sf_false_branch (fun _ _ _ _ => SweepRes.failed) b0 + +def sf_cons (b0 : Bool) (n0 : Nat) (rest : RTape) (_ : (AccList → RTape → SweepRes) → AccList → SweepRes) + (ih : AccList → RTape → SweepRes) (acc : AccList) : SweepRes := + sf_cons_branch b0 n0 rest ih acc + +def sweep_false_rel (ih : AccList → RTape → SweepRes) (acc : AccList) (t : RTape) : SweepRes := + (RTape.rec (fun _ acc => sf_nil acc) sf_cons t : (AccList → RTape → SweepRes) → AccList → SweepRes) ih acc + +def sl_cons_branch (b0 : Bool) : (AccList → RTape → SweepRes) → AccList → Nat → RTape → SweepRes := + Bool.rec + (fun ih acc n0 r1 => sweep_false_rel ih acc (RTape.cons false n0 r1)) + (fun ih acc n0 r1 => sweep_false_rel ih (AccList.some n0 acc) r1) + b0 + +def sl_cons (b0 : Bool) (n0 : Nat) (r1 : RTape) (_ : (AccList → RTape → SweepRes) → AccList → SweepRes) + (ih : AccList → RTape → SweepRes) (acc : AccList) : SweepRes := + sl_cons_branch b0 ih acc n0 r1 + +def sl_step (_ : Nat) (ih : AccList → RTape → SweepRes) (acc : AccList) (t : RTape) : SweepRes := + (RTape.rec (fun ih acc => sweep_false_rel ih acc RTape.nil) sl_cons t : (AccList → RTape → SweepRes) → AccList → SweepRes) ih acc + +def run_sweep_rel (fuel : Nat) (acc : AccList) (t : RTape) : SweepRes := + (Nat.rec (fun _ _ => SweepRes.failed) sl_step fuel : AccList → RTape → SweepRes) acc t + +def fsn_false_b3_true (val : Nat) (c' : Nat) (r'' : RTape) : StepRes := + bindNat (Nat.add val 4) (fun v4 => + bindNat (Nat.sub c' 1) (fun c1 => + forceRTape (push true c1 r'') (fun r3 => + StepRes.running (RTape.cons true v4 (RTape.cons false 2 r3))))) + +def fsn_false_b3_branch (ok : Bool) : Nat → Nat → RTape → StepRes := + Bool.rec (fun _ _ _ => StepRes.failed) fsn_false_b3_true ok + +def fsn_false_b3_cons (b2 : Bool) (c' : Nat) (r'' : RTape) (_ : Nat → StepRes) (val : Nat) : StepRes := + fsn_false_b3_branch (Bool.rec false (Nat.ble 2 c') b2) val c' r'' + +def fsn_false_b3 (r' : RTape) (val : Nat) : StepRes := + (RTape.rec (fun _ => StepRes.failed) fsn_false_b3_cons r' : Nat → StepRes) val + +def fsn_false_b_ge4 (val : Nat) (b' : Nat) (r' : RTape) : StepRes := + bindNat (Nat.add val 3) (fun v3 => + bindNat (Nat.sub b' 4) (fun b4 => + forceRTape (push false b4 r') (fun r2 => + forceRTape (push1 true 3 r2) (fun r3 => + StepRes.running (RTape.cons true 1 (RTape.cons false v3 r3)))))) + +def fsn_false_branch2 (is3 : Bool) : Nat → RTape → StepRes := + Bool.rec (fun _ _ => StepRes.failed) (fun val r' => fsn_false_b3 r' val) is3 + +def fsn_false_branch1 (ge4 : Bool) : Nat → Nat → RTape → StepRes := + Bool.rec (fun val b' r' => fsn_false_branch2 (Nat.beq b' 3) val r') fsn_false_b_ge4 ge4 + +def fsn_false_cons (b1 : Bool) (b' : Nat) (r' : RTape) (_ : Nat → StepRes) (val : Nat) : StepRes := + (Bool.rec (fun val b' r' => fsn_false_branch1 (Nat.ble 4 b') val b' r') (fun _ _ _ => StepRes.failed) b1 : Nat → Nat → RTape → StepRes) val b' r' + +def fsn_false (t : RTape) (val : Nat) : StepRes := + (RTape.rec (fun _ => StepRes.failed) fsn_false_cons (push1 false 1 t) : Nat → StepRes) val + +def fsn_true (t : RTape) (val : Nat) : StepRes := + bindNat val (fun v => + forceRTape (push1 true 2 t) (fun r2 => + StepRes.running (RTape.cons true 1 (RTape.cons false v r2)))) + +def fsn_done (phase : Bool) : RTape → Nat → StepRes := + Bool.rec fsn_false fsn_true phase + +def finish_some_none_fused (sr : SweepRes) (val : Nat) : StepRes := + (SweepRes.rec (fun _ => StepRes.halted) (fun phase t val => fsn_done phase t val) (fun _ => StepRes.failed) sr : Nat → StepRes) val + +def step_case1 (b : Nat) (r2 : RTape) : StepRes := + bindNat (Nat.div b 4) (fun q1 => + bindNat (Nat.mod b 4) (fun rem => + bindNat (Nat.mul 6 q1) (fun p6 => + forceRTape (push false rem r2) (fun r3 => + forceRTape (push1 true 1 r3) (fun r4 => + finish_some_none_fused (run_sweep_rel 16 AccList.nil r4) p6))))) + +def step_case2_cons (b2 : Bool) (c : Nat) (r3 : RTape) (_ : Nat → StepRes) (a : Nat) : StepRes := + (Bool.rec + (fun _ _ _ => StepRes.failed) + (fun a c r3 => + bindNat (Nat.sub c 1) (fun c1 => + bindNat (Nat.add a 2) (fun a2 => + forceRTape (push true c1 r3) (fun r4 => + finish_some_none_fused (run_sweep_rel 16 AccList.nil r4) a2)))) + b2 : Nat → Nat → RTape → StepRes) a c r3 + +def step_case2 (a : Nat) (r2 : RTape) : StepRes := + (RTape.rec (fun _ => StepRes.failed) step_case2_cons r2 : Nat → StepRes) a + +def step_dispatch_b2 (is_b2 : Bool) : Nat → RTape → StepRes := + Bool.rec (fun _ _ => StepRes.failed) step_case2 is_b2 + +def step_dispatch_ff (is_ff : Bool) : Nat → Nat → RTape → StepRes := + Bool.rec (fun a b r2 => step_dispatch_b2 (Nat.beq b 2) a r2) (fun _ b r2 => step_case1 b r2) is_ff + +def step_r1_false (a : Nat) (b : Nat) (r2 : RTape) : StepRes := + step_dispatch_ff (Bool.rec false (Nat.ble 4 b) (Nat.beq a 1)) a b r2 + +def step_r1_cons (b1 : Bool) (b : Nat) (r2 : RTape) (_ : Nat → StepRes) (a : Nat) : StepRes := + (Bool.rec step_r1_false (fun _ _ _ => StepRes.failed) b1 : Nat → Nat → RTape → StepRes) a b r2 + +def step_r0_true (a : Nat) (r1 : RTape) : StepRes := + (RTape.rec (fun _ => StepRes.failed) step_r1_cons r1 : Nat → StepRes) a + +def step_r0_cons (b0 : Bool) (a : Nat) (r1 : RTape) (_ : StepRes) : StepRes := + (Bool.rec (fun _ _ => StepRes.failed) step_r0_true b0 : Nat → RTape → StepRes) a r1 + +def rle_step (t : RTape) : StepRes := + RTape.rec StepRes.failed step_r0_cons t + +def rp_step (_ : Nat) (ih : RTape → StepRes) (t : RTape) : StepRes := + StepRes.rec StepRes.halted ih StepRes.failed (ih t) + +def run_pow (k : Nat) (t : RTape) : StepRes := + (Nat.rec rle_step rp_step k : RTape → StepRes) t + +def is_halted (sr : StepRes) : Bool := + StepRes.rec true (fun _ => false) false sr + +def seed : RTape := RTape.cons true 4 (RTape.cons false 2 (RTape.cons true 5 RTape.nil)) + +-- ============================================================================ + +def trunc_zero_cons (b : Bool) (n : Nat) (rest : RTape) (_ : RTape) : RTape := + Bool.rec RTape.nil (RTape.cons true n rest) b + +def trunc_zero (t : RTape) : RTape := + RTape.rec RTape.nil trunc_zero_cons t + +def trunc_step (_ : Nat) (ih : RTape → RTape) (t : RTape) : RTape := + RTape.rec RTape.nil (fun b n rest _ => forceRTape (ih rest) (RTape.cons b n)) t + +def trunc (k : Nat) (t : RTape) : RTape := + (Nat.rec trunc_zero trunc_step k : RTape → RTape) t + +def trunc_res (k : Nat) (sr : StepRes) : StepRes := + StepRes.rec StepRes.halted (fun t => StepRes.running (trunc k t)) StepRes.failed sr + +def run_64 (t : RTape) : StepRes := + trunc_res 25 (run_pow 6 t) + +def run_chunk (k : Nat) (t : RTape) : StepRes := + (Nat.rec run_64 rp_step k : RTape → StepRes) t + +def bool_beq (b1 b2 : Bool) : Bool := + Bool.rec (Bool.rec true false b2) (Bool.rec false true b2) b1 + +def rtape_beq (t1 t2 : RTape) : Bool := + (RTape.rec + (fun t2 => RTape.rec true (fun _ _ _ _ => false) t2) + (fun b1 n1 _ ih t2 => + RTape.rec false (fun b2 n2 r2 _ => + Bool.rec false (Bool.rec false (ih r2) (Nat.beq n1 n2)) (bool_beq b1 b2)) t2) + t1 : RTape → Bool) t2 + +def is_running_eq (sr : StepRes) (target : RTape) : Bool := + StepRes.rec false (fun t => rtape_beq t target) false sr + +-- Section 7: Soundness Proof of RLE Evaluator +-- ============================================================================ + +@[simp] +theorem bindNat_eq {α : Type} (n : Nat) (k : Nat → α) : + bindNat n k = k n := rfl + +@[simp] +theorem forceRTape_eq {α : Type} (t : RTape) (k : RTape → α) : + forceRTape t k = k t := by + cases t <;> rfl + + +@[simp] +def denote_tape_tail (tail : zB) : RTape → zB + | .nil => tail + | .cons b n rest => ((if b then W1 else W0) ^ n) +> denote_tape_tail tail rest + +section Tail +variable {tail : zB} +local notation "denote_tape" => denote_tape_tail tail + +@[simp] +def denote_acc_rel (l0 : zB) : AccList → zB + | .nil => l0 + | .some n rest => denote_acc_rel l0 rest <+ (W1 ^ n) + | .none rest => denote_acc_rel l0 rest << 1 << 0 << 1 + +@[simp] +theorem denote_push1 (b : Bool) (n : Nat) (t : RTape) : + denote_tape (push1 b n t) = ((if b then W1 else W0) ^ n) +> denote_tape t := by + cases t with + | nil => + cases b <;> simp [push1, push1_nil] + | cons b0 n0 rest => + cases b <;> cases b0 <;> + simp [push1, push1_cons, bool_eq, push1_branch, push1_cons_same, push1_cons_diff, z0k, append_assoc] + +@[simp] +theorem denote_push (b : Bool) (n : Nat) (t : RTape) : + denote_tape (push b n t) = ((if b then W1 else W0) ^ n) +> denote_tape t := by + unfold push + cases h : Nat.beq n 0 with + | true => + have hn : n = 0 := Nat.eq_of_beq_eq_true h + subst hn + simp [push_branch] + | false => + simp [push_branch, denote_push1] + +theorem split_W0_1 {n : Nat} (hn : 1 ≤ n) (s : zB) : + (W0 ^ n) +> s = ([0] : zF) +> ((W0 ^ (n - 1)) +> s) := by + obtain ⟨m, rfl⟩ : ∃ m, n = 1 + m := ⟨n - 1, by omega⟩ + rw [show 1 + m - 1 = m by omega, z0k W0 1 m, append_assoc] + rfl + +theorem split_W0_4 {n : Nat} (hn : 4 ≤ n) (s : zB) : + (W0 ^ n) +> s = ([0, 0, 0, 0] : zF) +> ((W0 ^ (n - 4)) +> s) := by + obtain ⟨m, rfl⟩ : ∃ m, n = 4 + m := ⟨n - 4, by omega⟩ + rw [show 4 + m - 4 = m by omega, z0k W0 4 m, append_assoc] + rfl + +theorem split_W1_1 {n : Nat} (hn : 1 ≤ n) (s : zB) : + (W1 ^ n) +> s = ([1] : zF) +> ((W1 ^ (n - 1)) +> s) := by + obtain ⟨m, rfl⟩ : ∃ m, n = 1 + m := ⟨n - 1, by omega⟩ + rw [show 1 + m - 1 = m by omega, z0k W1 1 m, append_assoc] + rfl + +theorem split_W1_2 {n : Nat} (hn : 2 ≤ n) (s : zB) : + (W1 ^ n) +> s = ([1, 1] : zF) +> ((W1 ^ (n - 2)) +> s) := by + obtain ⟨m, rfl⟩ : ∃ m, n = 2 + m := ⟨n - 2, by omega⟩ + rw [show 2 + m - 2 = m by omega, z0k W1 2 m, append_assoc] + rfl + +def head_zero_tail (tail : zB) (t : RTape) : Prop := + ∃ r, denote_tape_tail tail t = ([0] : zF) +> r +local notation "head_zero" => head_zero_tail tail + +theorem head_zero_of_W0 (n : Nat) (hn : 1 ≤ n) (s : zB) : + ∃ r, (W0 ^ n) +> s = ([0] : zF) +> r := + ⟨(W0 ^ (n - 1)) +> s, split_W0_1 hn s⟩ + +theorem head_zero_nil : head_zero_tail default RTape.nil := + ⟨default, z0i.symm⟩ + +theorem head_zero_cons_false {n : Nat} (hn : 1 ≤ n) (rest : RTape) : + head_zero (RTape.cons false n rest) := + head_zero_of_W0 n hn (denote_tape rest) + +theorem head_zero_push1_false {n : Nat} (hn : 1 ≤ n) (rest : RTape) : + head_zero (push1 false n rest) := by + unfold head_zero_tail + rw [denote_push1] + exact head_zero_of_W0 n hn (denote_tape rest) + +def Valid_tail (tail : zB) : RTape → Prop + | .nil => ∃ r, tail = ([0] : zF) +> r + | .cons b n rest => 1 ≤ n ∧ (b = true → head_zero_tail tail rest) ∧ Valid_tail tail rest +local notation "Valid" => Valid_tail tail + +def ValidAcc : AccList → Prop + | .nil => True + | .some n rest => 1 ≤ n ∧ ValidAcc rest + | .none rest => ValidAcc rest + +theorem valid_cons_false {n : Nat} {t : RTape} (hn : 1 ≤ n) (ht : Valid t) : + Valid (RTape.cons false n t) := + ⟨hn, fun h => Bool.noConfusion h, ht⟩ + +theorem valid_cons_true {n : Nat} {t : RTape} (hn : 1 ≤ n) (hz : head_zero t) (ht : Valid t) : + Valid (RTape.cons true n t) := + ⟨hn, fun _ => hz, ht⟩ + +theorem valid_push1 {b : Bool} {n : Nat} {t : RTape} (hn : 1 ≤ n) (ht : Valid t) : + Valid (push1 b n t) := by + cases t with + | nil => + cases b with + | false => exact ⟨hn, fun h => Bool.noConfusion h, ht⟩ + | true => exact ⟨hn, fun _ => ht, ht⟩ + | cons b0 n0 rest => + rcases ht with ⟨hn0, hz0, hrest⟩ + cases b <;> cases b0 + · exact ⟨by change 1 ≤ n + n0; omega, fun h => Bool.noConfusion h, hrest⟩ + · exact ⟨hn, fun h => Bool.noConfusion h, hn0, hz0, hrest⟩ + · exact ⟨hn, fun _ => head_zero_cons_false hn0 rest, hn0, hz0, hrest⟩ + · exact ⟨by change 1 ≤ n + n0; omega, hz0, hrest⟩ + +theorem valid_push {b : Bool} {n : Nat} {t : RTape} (ht : Valid t) : + Valid (push b n t) := by + unfold push + cases h : Nat.beq n 0 with + | true => exact ht + | false => + have hn : 1 ≤ n := by + cases n with + | zero => cases h + | succ m => omega + exact valid_push1 hn ht + +def SweepSpec_tail (tail : zB) (l0 : zB) (c : Cfg (Fin 2) (Fin 6)) : SweepRes → Prop + | .halted => IsHaltFrom c + | .done ph' t' => Valid_tail tail t' ∧ (c [target_tm]⊢* (l0 <{{if ph' then C else B}} denote_tape_tail tail t')) + | .failed => True +local notation "SweepSpec" => SweepSpec_tail tail + +theorem sweep_spec_trans {l0 : zB} {c₁ c₂ : Cfg (Fin 2) (Fin 6)} {sr : SweepRes} + (h₁₂ : c₁ [target_tm]⊢* c₂) (h₂ : SweepSpec l0 c₂ sr) : + SweepSpec l0 c₁ sr := by + cases sr with + | halted => exact halt_from_trans h₁₂ h₂ + | done ph' t' => exact ⟨h₂.1, zSt h₁₂ h₂.2⟩ + | failed => trivial + +theorem back_rel_spec (l0 : zB) (acc : AccList) (phase : Bool) (t : RTape) + (hacc : ValidAcc acc) (ht : Valid t) : + SweepSpec l0 (denote_acc_rel l0 acc <{{if phase then C else B}} denote_tape t) (back_rel acc phase t) := by + induction acc generalizing phase t with + | nil => + exact ⟨ht, ⟨0, rfl⟩⟩ + | some n rest ih => + rcases hacc with ⟨hn, hrest⟩ + change SweepSpec l0 _ (forceRTape (push1 phase n t) (back_rel rest phase)) + rw [forceRTape_eq] + refine sweep_spec_trans ?_ (ih phase (push1 phase n t) hrest (valid_push1 hn ht)) + cases phase + · rw [denote_push1]; exact back_some_B n (denote_acc_rel l0 rest) (denote_tape t) + · rw [denote_push1]; exact back_some_C n (denote_acc_rel l0 rest) (denote_tape t) + | none rest ih => + cases phase + · change SweepSpec l0 _ (forceRTape (push1 false 1 t) (fun t' => back_rel rest true (RTape.cons true 2 t'))) + rw [forceRTape_eq] + have hu : Valid (RTape.cons true 2 (push1 false 1 t)) := + valid_cons_true (by decide) (head_zero_push1_false (by decide) t) (valid_push1 (by decide) ht) + refine sweep_spec_trans ?_ (ih true (RTape.cons true 2 (push1 false 1 t)) hacc hu) + have h1 := back_none_B (denote_acc_rel l0 rest) (denote_tape t) + have heq : denote_tape (RTape.cons true 2 (push1 false 1 t)) = ([1, 1, 0] : zF) +> denote_tape t := by + simp [denote_push1, W1, W0] + rw [heq] + exact h1 + · change SweepSpec l0 _ (forceRTape (push1 true 2 t) (fun t' => back_rel rest false (RTape.cons false 1 t'))) + rw [forceRTape_eq] + have hu : Valid (RTape.cons false 1 (push1 true 2 t)) := + valid_cons_false (by decide) (valid_push1 (by decide) ht) + refine sweep_spec_trans ?_ (ih false (RTape.cons false 1 (push1 true 2 t)) hacc hu) + have h1 := back_none_C (denote_acc_rel l0 rest) (denote_tape t) + have heq : denote_tape (RTape.cons false 1 (push1 true 2 t)) = ([0, 1, 1] : zF) +> denote_tape t := by + simp [denote_push1, W1, W0] + rw [heq] + exact h1 + + + +theorem sweep_false_rel_spec (l0 : zB) (ih : AccList → RTape → SweepRes) + (h_ih : ∀ acc' t', ValidAcc acc' → Valid t' → + SweepSpec l0 (denote_acc_rel l0 acc' {{E}}> denote_tape t') (ih acc' t')) + (acc : AccList) (t : RTape) (hacc : ValidAcc acc) (ht : Valid t) : + SweepSpec l0 (denote_acc_rel l0 acc {{E}}> denote_tape t) (sweep_false_rel ih acc t) := by + cases t with + | nil => trivial + | cons b0 n0 rest => + cases b0 with + | true => trivial + | false => + rcases ht with ⟨hn0, _, hrest⟩ + change SweepSpec l0 _ (sf_b1 (Nat.beq n0 1) n0 rest ih acc) + cases h1 : Nat.beq n0 1 with + | true => + have hn0_eq : n0 = 1 := Nat.eq_of_beq_eq_true h1 + subst hn0_eq + change SweepSpec l0 _ (sf_n0_1 rest acc) + cases rest with + | nil => trivial + | cons b1 n1 r2 => + cases b1 with + | false => trivial + | true => + rcases hrest with ⟨hn1, hz2, hr2⟩ + change SweepSpec l0 _ (sf_n0_1_true_branch (Nat.ble 2 n1) acc r2 n1) + cases hge2 : Nat.ble 2 n1 with + | false => + have hn1_eq : n1 = 1 := by + have hnot : ¬ (2 ≤ n1) := by rw [← Nat.ble_eq, hge2]; decide + omega + subst hn1_eq + rcases hz2 rfl with ⟨r', hr'⟩ + change IsHaltFrom (denote_acc_rel l0 acc {{E}}> ((W0 ^ 1) +> ((W1 ^ 1) +> denote_tape r2))) + rw [hr'] + exact sweep_010_halt (denote_acc_rel l0 acc) r' + | true => + have hn1_ge : 2 ≤ n1 := Nat.ble_eq.mp hge2 + change SweepSpec l0 _ (back_rel acc false (RTape.cons false 2 (RTape.cons true (n1 - 1) r2))) + have hu : Valid (RTape.cons false 2 (RTape.cons true (n1 - 1) r2)) := + valid_cons_false (by decide) (valid_cons_true (by omega) (hz2 rfl) hr2) + refine sweep_spec_trans ?_ (back_rel_spec l0 acc false _ hacc hu) + have hstep := sweep_011 (denote_acc_rel l0 acc) ((W1 ^ (n1 - 2)) +> denote_tape r2) + have heq_in : denote_tape (RTape.cons false 1 (RTape.cons true n1 r2)) = + ([0, 1, 1] : zF) +> ((W1 ^ (n1 - 2)) +> denote_tape r2) := by + change (W0 ^ 1) +> ((W1 ^ n1) +> denote_tape r2) = _ + rw [split_W1_2 hn1_ge]; rfl + have heq_out : denote_tape (RTape.cons false 2 (RTape.cons true (n1 - 1) r2)) = + ([0, 0, 1] : zF) +> ((W1 ^ (n1 - 2)) +> denote_tape r2) := by + change (W0 ^ 2) +> ((W1 ^ (n1 - 1)) +> denote_tape r2) = _ + rw [split_W1_1 (by omega), show n1 - 1 - 1 = n1 - 2 by omega]; rfl + rw [heq_in, heq_out] + exact hstep + | false => + change SweepSpec l0 _ (sf_b2 (Nat.beq n0 2) n0 rest ih acc) + cases h2 : Nat.beq n0 2 with + | true => + have hn0_eq : n0 = 2 := Nat.eq_of_beq_eq_true h2 + subst hn0_eq + change SweepSpec l0 _ (sf_n0_2 rest ih acc) + cases rest with + | nil => trivial + | cons b1 n1 r2 => + cases b1 with + | false => trivial + | true => + rcases hrest with ⟨hn1, _, hr2⟩ + change SweepSpec l0 _ (forceRTape (push true (n1 - 1) r2) (ih (AccList.none acc))) + rw [forceRTape_eq] + refine sweep_spec_trans ?_ (h_ih (AccList.none acc) (push true (n1 - 1) r2) hacc (valid_push hr2)) + have hstep := sweep_001 (denote_acc_rel l0 acc) ((W1 ^ (n1 - 1)) +> denote_tape r2) + have heq_in : denote_tape (RTape.cons false 2 (RTape.cons true n1 r2)) = + ([0, 0, 1] : zF) +> ((W1 ^ (n1 - 1)) +> denote_tape r2) := by + change (W0 ^ 2) +> ((W1 ^ n1) +> denote_tape r2) = _ + rw [split_W1_1 hn1]; rfl + rw [heq_in, denote_push] + exact hstep + | false => + change SweepSpec l0 _ (sf_b3 (Nat.beq n0 3) n0 rest acc) + cases h3 : Nat.beq n0 3 with + | true => + have hn0_eq : n0 = 3 := Nat.eq_of_beq_eq_true h3 + subst hn0_eq + change SweepSpec l0 _ (sf_n0_3 rest acc) + cases rest with + | nil => trivial + | cons b1 n1 r2 => + cases b1 with + | false => trivial + | true => + rcases hrest with ⟨hn1, _, hr2⟩ + change SweepSpec l0 _ (forceRTape (push true (n1 - 1) r2) (fun r3 => forceRTape (push1 false 2 r3) (fun r4 => back_rel acc true (RTape.cons true 2 r4)))) + rw [forceRTape_eq, forceRTape_eq] + have hu : Valid (RTape.cons true 2 (push1 false 2 (push true (n1 - 1) r2))) := + valid_cons_true (by decide) (head_zero_push1_false (by decide) _) (valid_push1 (by decide) (valid_push hr2)) + refine sweep_spec_trans ?_ (back_rel_spec l0 acc true _ hacc hu) + have hstep := sweep_0001 (denote_acc_rel l0 acc) ((W1 ^ (n1 - 1)) +> denote_tape r2) + have heq_in : denote_tape (RTape.cons false 3 (RTape.cons true n1 r2)) = + ([0, 0, 0, 1] : zF) +> ((W1 ^ (n1 - 1)) +> denote_tape r2) := by + change (W0 ^ 3) +> ((W1 ^ n1) +> denote_tape r2) = _ + rw [split_W1_1 hn1]; rfl + have heq_out : denote_tape (RTape.cons true 2 (push1 false 2 (push true (n1 - 1) r2))) = + ([1, 1, 0, 0] : zF) +> ((W1 ^ (n1 - 1)) +> denote_tape r2) := by + simp [denote_push1, denote_push, W1, W0] + rw [heq_in, heq_out] + exact hstep + | false => + have hn0_ge4 : 4 ≤ n0 := by + have hne1 : n0 ≠ 1 := Nat.ne_of_beq_eq_false h1 + have hne2 : n0 ≠ 2 := Nat.ne_of_beq_eq_false h2 + have hne3 : n0 ≠ 3 := Nat.ne_of_beq_eq_false h3 + omega + change SweepSpec l0 _ (forceRTape (push false (n0 - 4) rest) (fun r3 => forceRTape (push1 true 3 r3) (fun r4 => back_rel acc false (RTape.cons false 1 r4)))) + rw [forceRTape_eq, forceRTape_eq] + have hu : Valid (RTape.cons false 1 (push1 true 3 (push false (n0 - 4) rest))) := + valid_cons_false (by decide) (valid_push1 (by decide) (valid_push hrest)) + refine sweep_spec_trans ?_ (back_rel_spec l0 acc false _ hacc hu) + have hstep := sweep_0000 (denote_acc_rel l0 acc) ((W0 ^ (n0 - 4)) +> denote_tape rest) + have heq_in : denote_tape (RTape.cons false n0 rest) = + ([0, 0, 0, 0] : zF) +> ((W0 ^ (n0 - 4)) +> denote_tape rest) := by + change (W0 ^ n0) +> denote_tape rest = _ + exact split_W0_4 hn0_ge4 (denote_tape rest) + have heq_out : denote_tape (RTape.cons false 1 (push1 true 3 (push false (n0 - 4) rest))) = + ([0, 1, 1, 1] : zF) +> ((W0 ^ (n0 - 4)) +> denote_tape rest) := by + simp [denote_push1, denote_push, W1, W0] + rw [heq_in, heq_out] + exact hstep + +theorem run_sweep_rel_spec (l0 : zB) (fuel : Nat) (acc : AccList) (t : RTape) + (hacc : ValidAcc acc) (ht : Valid t) : + SweepSpec l0 (denote_acc_rel l0 acc {{E}}> denote_tape t) (run_sweep_rel fuel acc t) := by + induction fuel generalizing acc t with + | zero => trivial + | succ fuel ih => + cases t with + | nil => exact sweep_false_rel_spec l0 (run_sweep_rel fuel) ih acc RTape.nil hacc ht + | cons b0 n0 r1 => + cases b0 with + | false => exact sweep_false_rel_spec l0 (run_sweep_rel fuel) ih acc (RTape.cons false n0 r1) hacc ht + | true => + rcases ht with ⟨hn0, _, hr1⟩ + change SweepSpec l0 _ (sweep_false_rel (run_sweep_rel fuel) (AccList.some n0 acc) r1) + refine sweep_spec_trans (sweep_ones n0 (denote_acc_rel l0 acc) (denote_tape r1)) ?_ + exact sweep_false_rel_spec l0 (run_sweep_rel fuel) ih (AccList.some n0 acc) r1 ⟨hn0, hacc⟩ hr1 + +def StepSpec_tail (tail : zB) (c : Cfg (Fin 2) (Fin 6)) : StepRes → Prop + | .halted => IsHaltFrom c + | .running t' => Valid_tail tail t' ∧ (c [target_tm]⊢* (default <{{C}} denote_tape_tail tail t')) + | .failed => True +local notation "StepSpec" => StepSpec_tail tail + +theorem step_spec_trans {c₁ c₂ : Cfg (Fin 2) (Fin 6)} {res : StepRes} + (h₁₂ : c₁ [target_tm]⊢* c₂) (h₂ : StepSpec c₂ res) : + StepSpec c₁ res := by + cases res with + | halted => exact halt_from_trans h₁₂ h₂ + | running t' => exact ⟨h₂.1, zSt h₁₂ h₂.2⟩ + | failed => trivial + +theorem finish_some_none_fused_spec (a : Nat) (c : Cfg (Fin 2) (Fin 6)) (sr : SweepRes) + (hsr : SweepSpec ((default << 1 <+ (W1 ^ a)) << 1 << 0 << 1) c sr) : + StepSpec c (finish_some_none_fused sr (a + 2)) := by + cases sr with + | halted => exact hsr + | failed => trivial + | done phase t => + rcases hsr with ⟨ht, hstep_c⟩ + refine step_spec_trans hstep_c ?_ + cases phase with + | true => + change StepSpec _ (forceRTape (push1 true 2 t) (fun r2 => StepRes.running (RTape.cons true 1 (RTape.cons false (a + 2) r2)))) + rw [forceRTape_eq] + refine ⟨valid_cons_true (by decide) (head_zero_cons_false (by omega) _) (valid_cons_false (by omega) (valid_push1 (by decide) ht)), ?_⟩ + refine zSt (back_none_C _ _) ?_ + refine zSt (back_some_B a _ _) ?_ + have h1 := back_nil_B ((W0 ^ a) +> (([0, 1, 1] : zF) +> denote_tape t)) + have heq : (([1, 0] : zF) +> ((W0 ^ a) +> (([0, 1, 1] : zF) +> denote_tape t))) = + denote_tape (RTape.cons true 1 (RTape.cons false (a + 2) (push1 true 2 t))) := by + change W1 +> (W0 +> ((W0 ^ a) +> (W0 +> ((W1 ^ 2) +> denote_tape t)))) = + (W1 ^ 1) +> ((W0 ^ (a + 2)) +> denote_tape (push1 true 2 t)) + rw [denote_push1, show a + 2 = 1 + (a + 1) by omega, z0k W0 1 (a + 1), z0k W0 a 1, append_assoc, append_assoc] + rfl + rw [heq] at h1 + exact h1 + | false => + change StepSpec _ (fsn_false t (a + 2)) + have h_unwind : (((default << 1 <+ (W1 ^ a)) << 1 << 0 << 1) <{{B}} denote_tape t) [target_tm]⊢* + (default <{{C}} ((W1 ^ (a + 3)) +> denote_tape (push1 false 1 t))) := by + refine zSt (back_none_B _ _) ?_ + refine zSt (back_some_C a _ _) ?_ + have h1 := back_nil_C ((W1 ^ a) +> (([1, 1, 0] : zF) +> denote_tape t)) + have heq : W1 +> ((W1 ^ a) +> (([1, 1, 0] : zF) +> denote_tape t)) = + (W1 ^ (a + 3)) +> denote_tape (push1 false 1 t) := by + rw [denote_push1, show a + 3 = 1 + (a + 2) by omega, z0k W1 1 (a + 2), z0k W1 a 2, append_assoc, append_assoc] + rfl + rw [heq] at h1 + exact h1 + refine step_spec_trans h_unwind ?_ + have hvp : Valid (push1 false 1 t) := valid_push1 (by decide) ht + unfold fsn_false + cases hp : push1 false 1 t with + | nil => trivial + | cons b1 b' r' => + rw [hp] at hvp + rcases hvp with ⟨hb', _, hr'⟩ + cases b1 with + | true => trivial + | false => + change StepSpec _ (fsn_false_branch1 (Nat.ble 4 b') (a + 2) b' r') + cases hge4 : Nat.ble 4 b' with + | true => + have hb_ge4 : 4 ≤ b' := Nat.ble_eq.mp hge4 + change StepSpec _ (forceRTape (push false (b' - 4) r') (fun r2 => forceRTape (push1 true 3 r2) (fun r3 => StepRes.running (RTape.cons true 1 (RTape.cons false ((a + 2) + 3) r3))))) + rw [forceRTape_eq, forceRTape_eq] + refine ⟨valid_cons_true (by decide) (head_zero_cons_false (by omega) _) (valid_cons_false (by omega) (valid_push1 (by decide) (valid_push hr'))), ?_⟩ + have hstep := sweep_a_ge4 (a + 3) ((W0 ^ (b' - 4)) +> denote_tape r') + have heq_in : denote_tape (RTape.cons false b' r') = + ([0, 0, 0, 0] : zF) +> ((W0 ^ (b' - 4)) +> denote_tape r') := + split_W0_4 hb_ge4 (denote_tape r') + have heq_out : W1 +> ((W0 ^ ((a + 3) + 2)) +> (([1, 1, 1] : zF) +> ((W0 ^ (b' - 4)) +> denote_tape r'))) = + denote_tape (RTape.cons true 1 (RTape.cons false ((a + 2) + 3) (push1 true 3 (push false (b' - 4) r')))) := by + simp [denote_tape_tail, denote_push1, denote_push, W1, W0] + rw [heq_in] + rw [heq_out] at hstep + exact hstep + | false => + change StepSpec _ (fsn_false_branch2 (Nat.beq b' 3) (a + 2) r') + cases his3 : Nat.beq b' 3 with + | false => trivial + | true => + have hb_eq3 : b' = 3 := Nat.eq_of_beq_eq_true his3 + subst hb_eq3 + change StepSpec _ (fsn_false_b3 r' (a + 2)) + cases r' with + | nil => trivial + | cons b2 c' r'' => + rcases hr' with ⟨hc', _, hr''⟩ + cases b2 with + | false => trivial + | true => + change StepSpec _ (fsn_false_b3_branch (Nat.ble 2 c') (a + 2) c' r'') + cases hge2 : Nat.ble 2 c' with + | false => trivial + | true => + have hc_ge2 : 2 ≤ c' := Nat.ble_eq.mp hge2 + change StepSpec _ (forceRTape (push true (c' - 1) r'') (fun r3 => StepRes.running (RTape.cons true ((a + 2) + 4) (RTape.cons false 2 r3)))) + rw [forceRTape_eq] + refine ⟨valid_cons_true (by omega) (head_zero_cons_false (by decide) _) (valid_cons_false (by decide) (valid_push hr'')), ?_⟩ + have hstep := sweep_a_3 (a + 3) ((W1 ^ (c' - 1)) +> denote_tape r'') + have heq_in : denote_tape (RTape.cons false 3 (RTape.cons true c' r'')) = + ([0, 0, 0, 1] : zF) +> ((W1 ^ (c' - 1)) +> denote_tape r'') := by + change (W0 ^ 3) +> ((W1 ^ c') +> denote_tape r'') = _ + rw [split_W1_1 hc']; rfl + have heq_out : (W1 ^ ((a + 3) + 3)) +> (([0, 0] : zF) +> ((W1 ^ (c' - 1)) +> denote_tape r'')) = + denote_tape (RTape.cons true ((a + 2) + 4) (RTape.cons false 2 (push true (c' - 1) r''))) := by + simp [denote_tape_tail, denote_push, W1, W0] + rw [heq_in] + rw [heq_out] at hstep + exact hstep + +theorem rle_step_spec (t : RTape) (ht : Valid t) : + StepSpec (default <{{C}} denote_tape t) (rle_step t) := by + cases t with + | nil => trivial + | cons b0 a r1 => + rcases ht with ⟨ha, _, hr1⟩ + cases b0 with + | false => trivial + | true => + cases r1 with + | nil => trivial + | cons b1 b r2 => + rcases hr1 with ⟨hb, _, hr2⟩ + cases b1 with + | true => trivial + | false => + change StepSpec _ (step_dispatch_ff (Bool.rec false (Nat.ble 4 b) (Nat.beq a 1)) a b r2) + cases ha1 : Nat.beq a 1 with + | false => + change StepSpec _ (step_dispatch_b2 (Nat.beq b 2) a r2) + cases hb2 : Nat.beq b 2 with + | false => trivial + | true => + have hb_eq2 : b = 2 := Nat.eq_of_beq_eq_true hb2 + subst hb_eq2 + change StepSpec _ (step_case2 a r2) + cases r2 with + | nil => trivial + | cons b2 c r3 => + rcases hr2 with ⟨hc, _, hr3⟩ + cases b2 with + | false => trivial + | true => + change StepSpec _ (forceRTape (push true (c - 1) r3) (fun r4 => finish_some_none_fused (run_sweep_rel 16 AccList.nil r4) (a + 2))) + rw [forceRTape_eq] + refine finish_some_none_fused_spec a _ _ ?_ + have h_init : (default <{{C}} denote_tape (RTape.cons true a (RTape.cons false 2 (RTape.cons true c r3)))) [target_tm]⊢* + (((default << 1 <+ (W1 ^ a)) << 1 << 0 << 1) {{E}}> denote_tape (push true (c - 1) r3)) := by + refine zSt (start_sweep _) ?_ + refine zSt (sweep_ones a _ _) ?_ + have heq : denote_tape (RTape.cons false 2 (RTape.cons true c r3)) = + ([0, 0, 1] : zF) +> denote_tape (push true (c - 1) r3) := by + change (W0 ^ 2) +> ((W1 ^ c) +> denote_tape r3) = _ + rw [denote_push, split_W1_1 hc]; rfl + rw [heq] + exact sweep_001 _ _ + exact sweep_spec_trans h_init (run_sweep_rel_spec ((default << 1 <+ (W1 ^ a)) << 1 << 0 << 1) 16 AccList.nil (push true (c - 1) r3) trivial (valid_push hr3)) + | true => + have ha_eq1 : a = 1 := Nat.eq_of_beq_eq_true ha1 + subst ha_eq1 + cases hb4 : Nat.ble 4 b with + | false => + change StepSpec _ (step_dispatch_b2 (Nat.beq b 2) 1 r2) + cases hb2 : Nat.beq b 2 with + | false => trivial + | true => + have hb_eq2 : b = 2 := Nat.eq_of_beq_eq_true hb2 + subst hb_eq2 + change StepSpec _ (step_case2 1 r2) + cases r2 with + | nil => trivial + | cons b2 c r3 => + rcases hr2 with ⟨hc, _, hr3⟩ + cases b2 with + | false => trivial + | true => + change StepSpec _ (forceRTape (push true (c - 1) r3) (fun r4 => finish_some_none_fused (run_sweep_rel 16 AccList.nil r4) (1 + 2))) + rw [forceRTape_eq] + refine finish_some_none_fused_spec 1 _ _ ?_ + have h_init : (default <{{C}} denote_tape (RTape.cons true 1 (RTape.cons false 2 (RTape.cons true c r3)))) [target_tm]⊢* + (((default << 1 <+ (W1 ^ 1)) << 1 << 0 << 1) {{E}}> denote_tape (push true (c - 1) r3)) := by + refine zSt (start_sweep _) ?_ + refine zSt (sweep_ones 1 _ _) ?_ + have heq : denote_tape (RTape.cons false 2 (RTape.cons true c r3)) = + ([0, 0, 1] : zF) +> denote_tape (push true (c - 1) r3) := by + change (W0 ^ 2) +> ((W1 ^ c) +> denote_tape r3) = _ + rw [denote_push, split_W1_1 hc]; rfl + rw [heq] + exact sweep_001 _ _ + exact sweep_spec_trans h_init (run_sweep_rel_spec ((default << 1 <+ (W1 ^ 1)) << 1 << 0 << 1) 16 AccList.nil (push true (c - 1) r3) trivial (valid_push hr3)) + | true => + have hb_ge4 : 4 ≤ b := Nat.ble_eq.mp hb4 + change StepSpec _ (forceRTape (push false (b % 4) r2) (fun r3 => forceRTape (push1 true 1 r3) (fun r4 => finish_some_none_fused (run_sweep_rel 16 AccList.nil r4) (6 * (b / 4))))) + rw [forceRTape_eq, forceRTape_eq] + let q := (b - 4) / 4 + have hp6 : 6 * (b / 4) = (4 + 6 * q) + 2 := by omega + rw [hp6] + refine finish_some_none_fused_spec (4 + 6 * q) _ _ ?_ + have h_init : (default <{{C}} denote_tape (RTape.cons true 1 (RTape.cons false b r2))) [target_tm]⊢* + (((default << 1 <+ (W1 ^ (4 + 6 * q))) << 1 << 0 << 1) {{E}}> denote_tape (push1 true 1 (push false (b % 4) r2))) := by + have heq_b : denote_tape (RTape.cons true 1 (RTape.cons false b r2)) = + ([1, 0, 0, 0, 0] : zF) +> ((W0 ^ (4 * q)) +> ((W0 ^ (b % 4)) +> denote_tape r2)) := by + change (W1 ^ 1) +> ((W0 ^ b) +> denote_tape r2) = _ + have hb_split : W0 ^ b = W0 ^ (4 + (4 * q + b % 4)) := congrArg (W0 ^ ·) (by omega) + rw [hb_split, z0k W0 4 (4 * q + b % 4), z0k W0 (4 * q) (b % 4), append_assoc, append_assoc] + rfl + rw [heq_b] + refine zSt (ff_entry _) ?_ + refine zSt (ff_loop q 4 ((W0 ^ (b % 4)) +> denote_tape r2)) ?_ + refine zSt (start_sweep _) ?_ + refine zSt (sweep_ones (4 + 6 * q) _ _) ?_ + have h_s001 := sweep_001 (default << 1 <+ (W1 ^ (4 + 6 * q))) (denote_tape (push1 true 1 (push false (b % 4) r2))) + have heq_tail : (([0, 0, 1] : zF) +> denote_tape (push1 true 1 (push false (b % 4) r2))) = + (([0, 0, 1, 1] : zF) +> ((W0 ^ (b % 4)) +> denote_tape r2)) := by + simp [denote_push1, denote_push, W1, W0] + rw [heq_tail] at h_s001 + exact h_s001 + exact sweep_spec_trans h_init (run_sweep_rel_spec ((default << 1 <+ (W1 ^ (4 + 6 * q))) << 1 << 0 << 1) 16 AccList.nil (push1 true 1 (push false (b % 4) r2)) trivial (valid_push1 (by decide) (valid_push hr2))) + +theorem run_pow_spec (k : Nat) (t : RTape) (ht : Valid t) : + StepSpec (default <{{C}} denote_tape t) (run_pow k t) := by + induction k generalizing t with + | zero => exact rle_step_spec t ht + | succ k ih => + change StepSpec _ (StepRes.rec StepRes.halted (run_pow k) StepRes.failed (run_pow k t)) + have h1 := ih t ht + cases hc : run_pow k t with + | halted => rw [hc] at h1; exact h1 + | running t' => + rw [hc] at h1 + exact step_spec_trans h1.2 (ih t' h1.1) + | failed => trivial + +end Tail + +abbrev head_zero {tail : zB} := head_zero_tail tail +abbrev Valid {tail : zB} := Valid_tail tail + +def trunc_tail (tail : zB) : Nat → RTape → zB + | 0, .nil => tail + | 0, .cons b n rest => Bool.rec (denote_tape_tail tail (.cons false n rest)) tail b + | _ + 1, .nil => tail + | k + 1, .cons _ _ rest => trunc_tail tail k rest + +theorem denote_trunc (tail : zB) (k : Nat) (t : RTape) : + denote_tape_tail (trunc_tail tail k t) (trunc k t) = denote_tape_tail tail t := by + induction k generalizing t with + | zero => + cases t with + | nil => rfl + | cons b n rest => cases b <;> rfl + | succ k ih => + cases t with + | nil => rfl + | cons b n rest => + change denote_tape_tail (trunc_tail tail k rest) (forceRTape (trunc k rest) (RTape.cons b n)) = _ + rw [forceRTape_eq] + change ((if b then W1 else W0) ^ n) +> denote_tape_tail (trunc_tail tail k rest) (trunc k rest) = _ + rw [ih rest] + rfl + +theorem head_zero_trunc {tail : zB} (k : Nat) {t : RTape} (hz : @head_zero tail t) : + @head_zero (trunc_tail tail k t) (trunc k t) := by + unfold head_zero head_zero_tail at hz ⊢ + rwa [denote_trunc] + +theorem valid_trunc {tail : zB} (k : Nat) {t : RTape} (ht : @Valid tail t) : + @Valid (trunc_tail tail k t) (trunc k t) := by + induction k generalizing t with + | zero => + cases t with + | nil => exact ht + | cons b n rest => + cases b with + | false => + rcases ht with ⟨hn, _, _⟩ + exact head_zero_of_W0 n hn (denote_tape_tail tail rest) + | true => exact ht + | succ k ih => + cases t with + | nil => exact ht + | cons b n rest => + rcases ht with ⟨hn, hz, hrest⟩ + change @Valid (trunc_tail tail k rest) (forceRTape (trunc k rest) (RTape.cons b n)) + rw [forceRTape_eq] + exact ⟨hn, fun hb => head_zero_trunc k (hz hb), ih hrest⟩ + +def StepSpecEx (c : Cfg (Fin 2) (Fin 6)) : StepRes → Prop + | .halted => IsHaltFrom c + | .running t' => ∃ tail', @Valid tail' t' ∧ (c [target_tm]⊢* (default <{{C}} denote_tape_tail tail' t')) + | .failed => True + +theorem step_spec_ex_trans {c₁ c₂ : Cfg (Fin 2) (Fin 6)} {res : StepRes} + (h₁₂ : c₁ [target_tm]⊢* c₂) (h₂ : StepSpecEx c₂ res) : + StepSpecEx c₁ res := by + cases res with + | halted => exact halt_from_trans h₁₂ h₂ + | running t' => + rcases h₂ with ⟨tail', ht', hstep⟩ + exact ⟨tail', ht', zSt h₁₂ hstep⟩ + | failed => trivial + +theorem run_64_spec {tail : zB} (t : RTape) (ht : @Valid tail t) : + StepSpecEx (default <{{C}} denote_tape_tail tail t) (run_64 t) := by + unfold run_64 + have h1 := @run_pow_spec tail 6 t ht + cases hc : run_pow 6 t with + | halted => rw [hc] at h1; exact h1 + | running t' => + rw [hc] at h1 + rcases h1 with ⟨ht', hstep⟩ + refine ⟨trunc_tail tail 25 t', valid_trunc 25 ht', ?_⟩ + rw [denote_trunc] + exact hstep + | failed => trivial + +theorem run_chunk_spec (k : Nat) {tail : zB} (t : RTape) (ht : @Valid tail t) : + StepSpecEx (default <{{C}} denote_tape_tail tail t) (run_chunk k t) := by + induction k generalizing tail t with + | zero => exact run_64_spec t ht + | succ k ih => + change StepSpecEx _ (StepRes.rec StepRes.halted (run_chunk k) StepRes.failed (run_chunk k t)) + have h1 := ih t ht + cases hc : run_chunk k t with + | halted => rw [hc] at h1; exact h1 + | running t' => + rw [hc] at h1 + rcases h1 with ⟨tail', ht', hstep⟩ + exact step_spec_ex_trans hstep (ih t' ht') + | failed => trivial + +theorem bool_beq_eq {b1 b2 : Bool} (h : bool_beq b1 b2 = true) : b1 = b2 := by + cases b1 <;> cases b2 <;> first | rfl | cases h + +theorem rtape_beq_eq {t1 t2 : RTape} (h : rtape_beq t1 t2 = true) : t1 = t2 := by + induction t1 generalizing t2 with + | nil => + cases t2 with + | nil => rfl + | cons _ _ _ => cases h + | cons b1 n1 r1 ih => + cases t2 with + | nil => cases h + | cons b2 n2 r2 => + change Bool.rec false (Bool.rec false (rtape_beq r1 r2) (Nat.beq n1 n2)) (bool_beq b1 b2) = true at h + cases hb : bool_beq b1 b2 + · rw [hb] at h; cases h + · rw [hb] at h + dsimp at h + cases hn : Nat.beq n1 n2 + · rw [hn] at h; cases h + · rw [hn] at h + dsimp at h + rw [bool_beq_eq hb, Nat.eq_of_beq_eq_true hn, ih h] + +theorem chain_chunk {t t' : RTape} + (h_eq : is_running_eq (run_chunk 8 t) t' = true) + (h_next : ∀ {tail' : zB}, @Valid tail' t' → IsHaltFrom (default <{{C}} denote_tape_tail tail' t')) + {tail : zB} (ht : @Valid tail t) : + IsHaltFrom (default <{{C}} denote_tape_tail tail t) := by + have h1 := run_chunk_spec 8 t ht + revert h1 h_eq + generalize run_chunk 8 t = res + intro h_eq h1 + cases res with + | halted => cases h_eq + | failed => cases h_eq + | running t_out => + have h_t : t_out = t' := rtape_beq_eq h_eq + subst h_t + rcases h1 with ⟨tail', ht', hstep⟩ + exact halt_from_trans hstep (h_next ht') + +theorem finish_chunk {t : RTape} + (h_halt : is_halted (run_chunk 8 t) = true) + {tail : zB} (ht : @Valid tail t) : + IsHaltFrom (default <{{C}} denote_tape_tail tail t) := by + have h1 := run_chunk_spec 8 t ht + revert h1 h_halt + generalize run_chunk 8 t = res + intro h_halt h1 + cases res with + | halted => exact h1 + | running _ => cases h_halt + | failed => cases h_halt + +def st_0 : RTape := (RTape.cons true 4 (RTape.cons false 2 (RTape.cons true 5 (RTape.cons false 100 RTape.nil)))) +def st_1 : RTape := (RTape.cons true 1 (RTape.cons false 61355888903510261716329430401428410789094962784795687908770234312467309066395736343665893284816352404093840432451576395537331409230326811531718870620242311802074364327874318624733879635552067585115945897587558453669234766484464185136407372925931825853402780799067252490426967888626247650263793602105465442096177200110758385019408240224363040284308942146524983474898997588762250280542045240517803465486407619271046431943756245124635673464869324359559586392939128449102683916063082456703678436472468173383380728718752933557860034041732801011279566098001559958126060572360102565731352155194839334755792702959501191122428633720483279607777911232863825583656403799308998834913781769811938831664575378802386817665730253513215136764633895174461257456355206511971662000792406617620410703869086947214327732507597350888794432767955481642932015418221615422871314473172110795098686688369395526010499851335014314568618892485423799967619844092653206915405078219569431449246366122672505271946114358848646262951467491829957959133522928116749850768736740758986247053224820694690307035110011710085314538571725922224832195216215096326180058145218503118724804287242602284783399121165133885483982216437664550644338844208194971465614071714734103124104239774814135947184204155839020147326743476648931162310793970334764559802057325130939523357357755641060544169245482840784782785855917017116114102926743488571660870512242581772687069311985164671517642120582644677346842597621862568835519472856340044115446768406290064183662804973235395905364845027200481914255950807388434515329718058233084697298771764054634684126250788437286979067906753361851251530858263302280125733896041109800827317186984802062134511845372280987600805389187922921874977560235619419023953203173412902975141839704243899402023463259101730866819760787395705769672159296010267513985844154263233213044316427149280536864835266160576766045824669104856874424340028542434138952040606392804205649724927186620379326359657829969142135175687734223083023051792028865635718996839906575307892086875404488982164478013318115353242999078517811690154564569860059865558838157605330175066261233789554884650132053339347190907691001543126941021654247103834625707109940586054212900129285983947724604168684161586909523990078647035155254020289763983300156946636378028743766598587585906596400078986873520862138836249321961692567608141224671973073 (RTape.cons true 5 (RTape.cons false 9 (RTape.cons true 3 (RTape.cons false 1 (RTape.cons true 6 (RTape.cons false 1 (RTape.cons true 6 (RTape.cons false 7 (RTape.cons true 6 (RTape.cons false 2 (RTape.cons true 3 (RTape.cons false 22 (RTape.cons true 5 (RTape.cons false 5 (RTape.cons true 6 (RTape.cons false 7 (RTape.cons true 3 (RTape.cons false 5 (RTape.cons true 3 (RTape.cons false 5 (RTape.cons true 3 (RTape.cons false 1 (RTape.cons true 6 RTape.nil))))))))))))))))))))))))) +def st_2 : RTape := (RTape.cons true 1 (RTape.cons false 1617491306905454944625181198296747611084420324065908406892681465814248338562833576543354127244862933355139949387736720371697295375036380588298471727786488966295434594471373768888592054733114544752754188445092550310005217854077965956156478414287669584632288782078964146027800251403706059203206774088121311042951153404412868409922014126845254378712945978096504138966535119630655831279736320774381828482271153762113076009242221926174448236161390335827288341658146572401346646197192720825948390799729059768801371787318545209360154056033998988560413863956335976761521953171549639162901134029536528569408116938483176393180866148635920526690789327724325710752693962258159167240321947455078161822867482775436260999594093471122986419609503726008404164952820290247263696827450963132150380809798035195247329946193244912716318232154880747683737232611103522382589002556045348135452854850471942519728931821389022607057522251582155868597280961672918226775824719192145629176689590015146644644501729020680095902295290195743100623216177957043009495894007824337719566430482866494779080666042280671522435711388012089786223147811086710030025162009200513512217558339518386577115140133698679594603495642339309344259341182569122609251235237609891869687994016364026315966401161407409257369278403794403062957633812605955633035307692848543256490001089013484903281763940867758288974200313250433275621518870695849819891102438870406210480573353565793532591536333488734825811308445145390711314858338780578469946541151355003710172724824508464997111391146881098582307879530264752905373600903822556528574691313497671719845006563899103267221239889386152472574313032172455507221680634770990363854737912138853701230529076666135595222540381021002752334702705890216584743843441721295676772597840808252299778107791842508851251225612284868687187079240766509721967105572986034482063181562805991887324385273529870802465490138176245570289626366548425667145603911058171712421320791876176996871059868951072185142942456640545132006597746334122025418510541229230564830196849036028054115267279877543343181656900067198958760758834956048305462953279600493012202429200660789840657352420443771291670406940593732919175109444582670830229439418045517688030992395425209911906924270227824773285099563794690231272421475650469027067530435428832342223474220720693054278386122587616236084764200464068566997163773307434815457674909392143464379319055734701676903811452506508953620485791862431865914951145835328822792363580002493821948963432545226151374455469045061326039616473449359260397419161759700167533003734674432728700387109101595833004403744235329350497019037259453788686334528936145043351670275542471105228337042354827755216646495410065440046005141306861034910783041090841212858780377266004791085186602065691088087052016509747160432556953438936780745430155340763141690112628365723993817691817765556707813023407142913106107584067794277005697169949039451930144480529607741847590033080281582356281164734797116698155358036812609635273904862319826666267302816815868221503832645110844271934969532744769403922111699648740371663395230402511959246297087966044765773125602187971967082859286252887221585924323281778096553664455954504869606870203890574442674526381233750195840218924441364430464807488214045170918642926288783553417772037008491085242494438518262248937287319564593729652071377614337176993733527487192565776064141325223364264598936017316335968162097360929235068408968317197301297613456376229418029558745283928392413635281888240929921549591187800349034508086159176746744567499591800790499147320348364445436816853649691642040952329161670569531459504958778138470163559466786859569078332345754521986858445893775648505384030881689161643668573730936345720772304030161695030161393644482710091073160625391948197726566999479768047636943141381249923206172597204385831510266811497001597426441901166312211824571250118541916637037770308151056421463094266190480192280273258586723022099306729097555188160645258578013469392622424130123051996666034665263186327216366424894093433696672086157779466893838996505912789871142251153751784709881422985094453425207553835712910385916457581129878665372662826104385336495828108456749697633627684562163452162094014231365101505386599564975391020903894860106887481178808824141504003015456220631869112084235451522302046709233497982339118963724609143066085792464118007763138395260968773576277539364560632158276651231241046768356954001664459185904154656994697874628416244329262390804009213769897919672745294166746807362722086430512035125599381302474364484742634765112262633811867193756129787013186378187206111544499879787752948533166571318172851940063340526796263217178971869149523912487340137473234292149719931045777803013255854321339351343743482406799432656873088015779076 (RTape.cons true 25 (RTape.cons false 2 (RTape.cons true 2 (RTape.cons false 27 (RTape.cons true 3 (RTape.cons false 2 (RTape.cons true 3 (RTape.cons false 3 (RTape.cons true 6 (RTape.cons false 3 (RTape.cons true 3 (RTape.cons false 1 (RTape.cons true 6 (RTape.cons false 1 (RTape.cons true 6 (RTape.cons false 7 (RTape.cons true 3 (RTape.cons false 1 (RTape.cons true 6 (RTape.cons false 1 (RTape.cons true 3 (RTape.cons false 5 (RTape.cons true 3 RTape.nil))))))))))))))))))))))))) +def st_3 : RTape := (RTape.cons true 1 (RTape.cons false 6514143529604139024321326760061967124710310351313426088778294077754167198158265573428423004390006674261080243567414399411602165067568262980561123307272839850140500910524921811087806112140082430363177826009374848553212544564456728891005630875353508153758010095168784633092890276403034695450079142055819703457241803492116809158580765447752019166739203201587897595122463982665646736749287539327506355904359613591617926022384916514252677761288700426756057463908643507101672035780885496883380684674049650645327713403624964241473166176207515592898783912011946697134440530794205265145587899218243912397822177578302834594782858891661843170747715874103901127354562707056236307020325756795186642574559997690383931760925513227991995053354536994434832547675110614883814605435712907963684546653644468247595741873259592728998665897232380550187377253642761808718761941683496162456916463997166947229988122328627782562235179493521589418204716682946588645123993144555868827828023151166566228515928968946470958308073580037243837948522362547604821870240681760496447317336171419076930005491875767706575571137958421880128378703796909606329387496221970662398793363608147661492708688290509182417794060877714353802865008820163488621593454377614590759225654913464227986588288947691285157897001385008979519737925755829801063143240933380781687090730262782907121624785112425320196985726090228059150135475522939335692670079444506451846269673136976687012457691701903199221930966630017644510432448185452221712469914242510998222499786102111246872663534684534107558273810670521773720236746095626402329796718055683653097752571462766735806264144477710120297236831311443832138267831496080351363497689785660866602923188520350312456047358324541288275696187572584034424094386144761827357187509134392689787678306114732128532398875868858388117953427469087315921135892329896679683360749508148309930709269075756347727243176175560970025946143291433001884012488419467679348630607432500720259148362507359397581844784204648350047652822676451825021503069792402817193333325436759092882558959896101785054791866253880407808341112049297926386796053964677131170616073133202842921855464952086181459637948807249455154217760368564455440896507283016804023189707223426614253944558261183554435848367986917077589452405830052789341736352067637478828252113880691323588299852934364453687699740257759288405115344100966747002521070198447830812808286405216461397941865132848010742603004255094270385186780566976564091574453517300420479023897534452575793171244562519922901943921917397656334351578692798826167510074530816553837840387277194086069793377482623520250218398914598193397556857325893976092143313038425678286153761026362559046518022309384902773347003512360666378408678871922031777083603453178162551882940691372134344912509271410399675865894107668668918172830437948056856387541732806462852038169279341487082598962686756532228537086788159314146975818983163018849293542772727621271258658493690168156157119495294047013682792605784893032496282389238736350542312796983850195269101849500601830395665426095971237577156246889280079810746460353035953510070742009995156282519822166036487745211162677218015331853911621531496258578860563465605705920419404542407209805384686440053199171547501951667430606542472517461799333964175506162247851006212416617545676457052897952034370729230800273093351872300293389221927670311971636617590566830328034898169088117597036584075771980789979527196128639427237375501135067973483767511671904021001132234266725318358116706024602037597176762896390539552530388025011451170528729078156504436637049822146947180795433575187809382089416396556249459165497164609895519683922008258403731460604552203792213484120691841224799465075717757156330698762155109797533987285557141603460490721435281421680699233020590970040263329707346837273125940820661049633628762376497027943958082769760926820197631667977568000872136893791941310638175083390930952036531822172879188895069538134768080520724364507121459934136657452011313997382347374547161134672342356399141250600596874759654831566672564920326027897666384032539322261567233969247035075325321253189821267422012322620340143567820531628995964528874483598423055262016328955020699319423234388133124369015417761430714411809172448843238816367550816241296534843386998762491974573826423563045573616642976259540036004604026731823714357291031728094486533748604629057646583151199307514652875784024603731524014304357670950082127907649277813695974044602006170538910007329983102482932260661613716666657262473633659582782810235479735601805419341429867266613705015185825076207136041450382507966304804834004223631373035716000982228294967977789939893272631223129938225590224688433333331913294012838608534234967997428030550244021225090486371119684060955516426436094307051214711995992414172148991609585551564143681920248945562616613029964364429680607409134914519952053981578829552085569172731737867964884993943087234646773833569305090935385949732990091732507587765184142657288130628895493106606201385205649620860745302307827044498666889991006949432142931307644422041882374278191599361371497401791578240311084984407559287154207595463603138687064205589819730315407224202475912923838589413495754344424871892513171842311549067221229560597351327726688915733344798277541660421662019970703229445824414966406766392540112259180782480512597925427108051977906516976922238883535978932771468262841186543111661474233280339558498625478773693180222176730920485996629061827721980175716848133713125370473804484662253403786086044493272696537875008767752215729207298371297348814420676594265417296693343738405225038419950153354006211104043777199541086555427991751380642740943372221077218939929438769658795353554477293438960834507165827724877277027685669250409536624593675330245995183987193145339318987819994908810685947671861107308462437857131469059381777521109701009112034911553020737004866618570565938138480224955268772849107591418954892249951590746676442528932576788343627076328636613125665006002356123502082205341547441352576478640577345637221705436807622380936938604289494229063327680109155315178220289145421350833358273203210463203040060609672885358604190272687372970371482845083721087852370364274576815779981327317378164723839278894448691159811441522246377304791173940963526254720441841942449490275016071715539611732617225372345779376540438594915711677744642316918925509431847230352320301938236056422784757051144722167538408132899601949572277098269548955740066793937109746815334327277822430493661463862342409892642424014886427910492772860698204413582383476997470909924173056104371724991578400179070880491261601601795767316335170592734955775838348871419032072543306673031497000054086426774203605868895617192719340167059505293271474225691945304184338040975289546856324299620706726495697833599649568697134120869025293412983146761215085474786647517130179631634000183239717904557028512313913220500247840890924352318913585839993644820119791299889092070728841019492676704342188249697932036428581911871284272774292879022639807510474419087141000508320583335255678498007568541206405214616336427522966805559814342349201783808083150 (RTape.cons true 5 (RTape.cons false 6 (RTape.cons true 3 (RTape.cons false 17 (RTape.cons true 5 (RTape.cons false 9 (RTape.cons true 6 (RTape.cons false 1 (RTape.cons true 6 (RTape.cons false 1 (RTape.cons true 6 (RTape.cons false 7 (RTape.cons true 3 (RTape.cons false 1 (RTape.cons true 3 (RTape.cons false 15 (RTape.cons true 5 (RTape.cons false 2 (RTape.cons true 3 (RTape.cons false 8 (RTape.cons true 3 (RTape.cons false 3 (RTape.cons true 5 RTape.nil))))))))))))))))))))))))) +def st_4 : RTape := (RTape.cons true 4670544162206590055427276984015956032405324322743701909742583236614744500795877407428344192345850702236692612575130533203302293443207491592222409261742961441273398986040024130911541192427016154995310027634713798823280474848969835446025328038678942014728359345985090695558624609573511888469120910574679116960229534441645709374982392486568470950453935532816726414519813338504267505414101650444205606864885562237261087516485628138559695307262913645648794223860587582199113238718204481110057542745902426441324038926539510504894483514365945154466755585741076247079164638897551579635644876515057407114266984879556950533079746931583983707325675073428224868007890769635484976477735786688664104907976754624906429678550334345340538278450844687007424535658618026566865972642599714044578860513624276113633413028926734885556475458435852127785298149848643843268087625775529512210550949702279302380319252686715543912812547358277525707308944663551575200818343143820925731923228852713112693191626694338206476970073733442704005271196454283532152256638063598834458288549859636151323952245383142293720704212653646929765790793824113179066895633687119317713828118820239431526395833958343344864754056071012366542241626193993562724358639175502907441954343708629824934907015387239187799419280217875750883571367660364201711340428380789198346536795710441717390085708528910246196524419087806672819275292696512294153830503873292389266102683091107232521071115870887695167982806404235636241903196794128393660371940502958401787801309102880375252310685331097362099442650063070237526250176183377393017779214762473039864767491430837683028282148029438343978024981330041480946610371227037027711244634052508058884966079045972359298349348412221046173822221080509651087150502553758880764739708896909313581137602601876813733007642564325238983871668514509139512073954063524722760228725110307161067236350963354460641729473086699032804075605958573091231357986888264391102118411734394552279701607492793180847401158384085497664764617079437788298676889901549497401452890128009307593527874272612805218092852224155230302812665985121517878511747139837163317104495960242608233065334772172901564530649409781399759788179395216752326536819960325078632939743770024482314468738726458603314949530016226728797398621691028264029489024079224365537772089218000122670038690777339699805531987100642589424956956981329831419736447040953123184720053370458589551992608953416504342916065893578002313911669738005246030920435865487448901455176864933227721681282675376068960022889500059544798621136270369511614229887870881885639845000402948688130604172760889613482486959174043862190182732034409576579951691741688334648874180809064397068981323200739813326554685281198485472734689728655692647396468114901940277029507600925442392398025856782572777406461372844614186675982476758576471406961258885020047756192501916989406889963559287275241646078425822831980155834748471749156817930041820791929221721938951618363213328920380005305243170001879054971783182877065518365224173528143472844584203486147868073863427324285540538824304410979677630945711622432036786593810433932993303702033925205352106154258976998494486283042011418250748599877294813967035446508634999629333911697674573705273131157206230122804733852667828279526259631556892155032654416777662933191046990457693318204797676063119197491256703485791178836258721252411288420733054673815788915276275586534697303263455161092949881994568129494837400282342137003033468167596467127477805599419969985998108945706840364786671020678430221886264034817857866159806890333346464548528814182540314167326865287127304878346921635813118258599348818163832500372475373101675744926395069338250573817704617978953822222926383445795900341337490544822530561402851191171845766366017892774836169620004968916672540737744171537376650229282182104821352617208112359874009328843921302285956979171829237633426777966537956788829520821101266039619005377783171939277394735910777427688782373556042767910348851524983246005020051884785262679812546956465166427502754037580483961256774299240073159325622385910307482746468508134943468560276247972926562739093017342575234778335586287514343873129837182011094107669146412587167297036277673341859206712912449487721329835187551487537508933419132764049799562105051631334403498427608994946936831231698126532379078854289836490875575074656774746431801825402722723526819686931866989146925463248422905274784870378487210594707107572707332147717970457425856606539926017489417114289469514860038508073440769182305508216499152580612776679122950829142880554134439467740924739291558683977927992174716597289366696015794174333618125636971607342829217630503475155401882351596073113473098646411022002285302700174413783153049441548217214514676084011116811188941625368780335304843711781427855926746474523871920751136626667683073183234937918146333913629050784044467181500002160617993000558359406227260599719061542033556736417691174497374978869328035358722469552597013428923286165673921762756415297568796419797623103987402031529542282505438812571600719972144994009606312407570184071631538311760694119610865493879339367763402969590261502457245360896760262741568989214483455343661699612299315633337819076406404967854714639554970050140852714805930697580200440528761137000785379397481627163308333457453980534983601695395840022452276468611420044174511736544725102974101411478246906365063078318636834304730001369018865876796930408821111481324127984452752561762655814321719632141130584509983845843716572398023179824656323798154753826906030690379743564416354528273937661511685880991848084475389013421887673644077436876744812621599872277077882464341026164833179724297113778827240194450801561671146015744729321199492927924530049931931519599922787470253746763589016927920507383928168862722937895557203010484692318037164990610341897759401525033438563230267095074121878954405666553230446704298938291112422656618279062356455859387392555815981540640978703077911617940937132759346120030635983272005013517204110868625668794438903706507301903846130628850062265525206686505783418495625950245171006155136748778043812651486696581459664634434447719747698989126530731918443337531884100754649521450096530248013162276514173759559167127026120605670918906364070852653481789383046132966463597854080310044227777281897293620144990805706893287028007998432771517742861360500769224740655174017671686976861055526966673945094447426130463131926537549938131242743241557051280931345711424955237757496929526289240137239560882766391013650583965206736315006927956321826876753753834664561045869594516496371214410122920770909779195658308477789312857838257998928420445760255849823142962097384230938933954781847538542538710116210141578872232020956662334092589249763413554122854806517256571497795837436003783381920631345168192104868401522110626088589915914066387991367464785719532907386349317616146343128862915915789592558881108032618870146757430947079885384984771612864684366685649705931496777635708934724456729674023127442512982190059197991412139590495280468693140307047711713626591054961318339216327337212409159152496732788151960931202965912000731048955110054241557397473055590249215844360260860042572440483669764065420294981570025691569339874389161711100423295960768583504647195971049741694655806964314220689300611865653723733913776303636257041229866309751614830922804286385657143404641793680070716343468924176972964509221057695502401911963030965921060818799373546958764980159612363759578669635148054431467253119628024696551879696460837197618918746133294380984650346461647065125477511867435286827043539711019787625760697568489340153005791134780334146185101736912911120593513253272353150292701077250547378408954686308328046357158994607284832398669965992079589001301461180339049983812100517034275171272383109538797609565084801646724314144955512719884971870626804100875699426783234718602024198722567993027099547249318993551081362179086361167140452663465711076381840982619328994190290094054801913055713364077886406254371859212325962546700437932815322697896816312822589885626323964546331894652392234152111960183223558791812796503403866671363854454091696700156781293369832600933714744875179360769890074998086701189211714986938077570834941499713411328715027462428471066206640524910592670076298129009511135509629125980975634277453059708956437809394086739257311134180639390934757662529695238132993091054331777137976589266366411934140823042582407298582169674363678388113981856219994122966661277748036340620704287012608427459022757070107519764654161091637938481822575999233207395826339081498564713588339348844249891447340472677299954128124341463331976940082960318565673932641739248994500381626319291367122898005662466798590729991950698178932678962709448644833335966138759967126955051170577667649671439681274098504821712530368420501959736135952689465748664472958783737122817562961894039783006230139657046457884895121086741917073127745948850676574798921810075321559331697306731135021032058618678870748621013812017792043188624420452987355221884381744562232168054716452123907063150784134034601501908510576086156910590957519399552711184648843793800074459770900191658692539198269381628279494807815447751270455614421694602781812609863236965297822423435416580365290442399638520454230318092640123614081068233401013037454647651762527690936646332815330364573168720900276339232820469284300532272257879703651404593888099838109363675921551462545986004167588209829720451034025167619745444799080509474415400997774911252029666794760911643490728922 (RTape.cons false 2 (RTape.cons true 12 (RTape.cons false 2 (RTape.cons true 5 (RTape.cons false 9 (RTape.cons true 6 (RTape.cons false 12 (RTape.cons true 3 (RTape.cons false 2 (RTape.cons true 3 (RTape.cons false 3 (RTape.cons true 3 (RTape.cons false 1 (RTape.cons true 3 (RTape.cons false 15 (RTape.cons true 5 (RTape.cons false 1 (RTape.cons true 6 (RTape.cons false 2 (RTape.cons true 3 (RTape.cons false 2 (RTape.cons true 3 (RTape.cons false 2 (RTape.cons true 3 RTape.nil))))))))))))))))))))))))) +def st_5 : RTape := (RTape.cons true 1 (RTape.cons false 1022118049092391463710601509831703761350422023222199949173597924385778723008448312297693776963204178564418972991901142737923346316310746403122489318261650058183021397470426527000098257649705505008677372188624384040548321438746372783799837352839093029117740966287061937888538581106060735291029889474593862959601787902105318399875968924246773045715117536595887727499978556096876086060504838981779235082992737090653886947933075596239754673917312230313203531848269795492340607583001710549410643479047494179323650098096972264858059964064099404389904058217944999489737612622627742879681472541428117602849073737849858100872040488337926310118590950341612491600241019345753968836722798368380744195606660089175082536534152249117268229073845873933476630892176314591593642440268233743396714634206401526069130486966734334234008259606889811708285567440103330602529019869268078233173921470822561700816869175271541981553283738564887641581643626362589404614752658894299584892491652084516382044806728462699006478810474114506691884634692539872649264238678973387083052731514503349844511798943712789128675399225831795493254377793073709777893621707512211205947020114142639031989986488657209483954918645118689696436209341135607685053885721437363900927833704056528037096107089324783115690001453497278658552537342159752195105059239544986334611017253803121805651659919965026903434776057645756489443273615030393254205411682783182529650693202877910546152885426256777146321318990549652110401743191647339979378601387692831038297725246800174180730223521811287953807064401854721379897799001057754353628100001872934887635038314855452997017196590083411072354709085050110983932235381877578319645201428540225403015674695789370869467597911017105918194814285767097582059901807156342569654167734036635730035484142205934143719365421009809300137451793973593193997321304215125326817692805627301417554907162852342140340893656800942509785574269998476469182474959739817178291154206151785150202427654812114267370965303764243293616090176940761796945730794362953234218839999460383154020190884526096527068017368678923002084448726534153205338527044589114977262183652433862067941315249641490184698280874288792694880228688676887621317870120766226296624120082699851140700879608072849999603349859070359339024927394706023573158206002770107382631098087142629691072516935685859303445023776986513378390340849509064690922562193999479831625927983182616819818631715760049476213438790308626481048875854051545282695835879527631203006174185322150989579235252903962716495060883016600732284980936913316214090131487633442844742137712650541978924269115011007336964903648734865363140896141886983462892561684234977495747433219007710795312743076511706174650218619201758864815872300937446190368806614643604891374456687025969244924973065232795375760521744950925976341964301455081238299973561228199213543668395109941861298170839529478107853924895852325583558354412227687213614786987249403203072153539827358318858105550954795582302276493294309192622534948277681139417633553545990367087991476280825335355517704727838800355213682652494289576450750548768826359230152413263154353924835080782880485080897008903137906238795563994387999198976999199707424225089429888669200350980202034276533745131310141222843185090813809479829504046553320032722732625712578380723934103918447121759542775814448330380128408922858872366794332135391733036006488789656103486124288422670679802750290702496433073187128065922579149344318639547476053844076285329059016698520689339783996151919095833805850193786618446397727200502768871023662675508565771025779411337291363710337204451512587083838605027428870287623743446474999721893799007960552291926760309780126526292653208690750706666907055287980819982492178535377988767519395597344826233865631442890561208647918758527757237377024927730911692557183789112453301151770974238324828574276112773754954938278223088404892737141195621869738621293445712545920467860240205110217334705703894050179406856452976430591884958953110819064689035378484786071398223482206740382057681702852176990527456905293836522722811220352069195844624499404352205313443341252941156737624690241903686027520025324263180327572210766897696503405885222518138898397097516179575480836589146568971586823798412027877679607100580267507097437010096707242989819911505724981761071147750563332229493670706532443062119841245520745442435018570666743122793136273931460264337632434338077076943511103405874259081989722578096893561511263932921489599934225083930207485178944663359927379156090388135817781217240460971152178499852821797569598083746929992001321785559181207051881702538716646781007215377348873891901619341917924068293545514415733825443458276180820575353655781546585754878709739044548165343313710213012656576341305481320009126017453580107248556114618633081948153465469332389901033086278481670943249673056888721580648985556055418044390654780097201874766999845810079836778751305072321232054997177524808912825201872733054135786861311878784123787622043595855166919939008466640920370167433417551946761222795519267142120995725562201464739716337382996434383951663086681777454922568897405233916804592931698342278064166501819207058620671372918558880673553180358797486840063123361186548148976807469875318978894056474313699551297165810615069763643499610719812197863600445202754943296915160371248500736120114137260443754581492038438537696768952845776434518704938826613577927836844256132853013316182216712843172597386422042460186699638024146767228140399705209438832362334196964092379979116660356874769907666080293675554825880748059829258655293230958079709184553175163456023274079631079099532105503009983568229337636047524066103309767923378039992541035722642042224817802493079774236178478768991266659528522341662641103607020353469057591503946545347755825731671272038093926561446415663634245939294345828621187316416429888952397026796572432866197179492135432250474076441130206930644084363718849185868688348379316285386857835691125054792859922442844727013253943431937051876192301284777979451355307177402803837517306331781264817898255406048514115745888200471495597981288871144456198301316832992915819675515457163320515947367822400268386497517457751269265484891863599940167667442083733331929937659705653468117253829603859547100808416167925030155637562692799955269367437740078347998834062316660467757420817222634432555061386424130406831134738060464400585101563471194825647629511483586091710348430951532808491385931885679704979151356840924622077680270030187343678624906073527776205387831548855367751545215017454118602188927443813136538061957901303530002972671144535690005297657359848276828456251904114891828299804724068410297826874850486603449592639701036029977252308393043332147410441054728648840248427060187170507714373743127715908627009234891924302904189012271414547655930313552422814428271647113644957360304624670370568444151759483911977326453010371231071284166673778832240137737720452379002219498842292343850733313811324964500670127184203727803218641557634192841565425738880962989034443389053344846951287479886417695969701534267339151052796850043411815667639918493806967763340839312436844095880828539069298133969263332215475862180342710863695593003653531784100972477597183388389492663781867929417293163302909274444937759735293777089986064227381389939574656211943685012768428237039732763675759883452316727465404524710717030304496370486968281911500765672053710971553843569216337955543175197404466726160768685940843444895850497474962736765589447902455352609529708344586139952149345625122341694912762819103545474124328671539314333054758193346979705770456320225167975181406056322740343564259712084315325913275218218110371479272456373452318029534850955465121364705056692597645288744984777641103037303205411333142832480523523440358566130722547126346711999001156235411660493930195613244299113670496101260741521563511228111762793325967198664420463904421366751585146614158691103770309814082066539910803392814026512062333760642465286463947624029045468193266308229350339275999090875688065484560539132329220988818067292166040123967258744027680563701944662575403778585209377429165448747768033679611939395125335926456543951302955249281376334581327011403893771547688492530993127572765087142711925504232103459945270470905303753739517476367509908164541617850164045324581798792275921349054566955262129607198456181131809358668950495366898260690771891852641488297065264542924652084450687176382787784609339999112970295171913284183293133254407444721212316437689781333827036172213491828436580237637721137784861163780877001771644249940261810189410067231569538109707425017220230757143182499525651874237657296140561847174847267452088216046799677872743241606399000984792076877682851534238456936126770946970905784465708928788682858589023120739978141206404613924836375493896701044416020396417992806197121230321831973465605944399785331247530338608062316694534611414246318473964997460876560621736906613214818587010514694238674422003533647635993393559858327476634050359680328390874311588803596017594644572478991989087411500433419266480705577448413999783191401762126783694520865616944282975276249280637130065746483200650544435599603530257422690441761729864049295380930851587864341921033417742515614081317499694609311134674797789322017758665069939820494658152043418851475974774885558757462064513997817921540258311974603625187517218884810208541440310534960783624296362097344950708236917542815926590655047089107904915034061161795166646733168938142096584791119854843182346100928135956362448166974084146078068528425626683289532002486176817306070673820767498342351339878636806083945366343702322929241738787794023286120330769980126596902491079098865631387388541812742573890045971050683150340829013358600782133033885339388899941398734500353079727666898720809066855508196544063920484786121350154226822688946044551039302011400112720327930657149617645361428385706976774291152656432586967251625269989718777378492378636105571216676218670429686438384092501581323817901870724553733671736182312411360665285717461076190516704689483229142603044677813671129441509305138509022042909979225658031780676295003256929907885722429838909345245317737734268134708041318442160090242724083252595171148458943562657112716762317303893691181886220402086994898925700183719412982806103923864837501849818407873476530830728984156536141315838212964931330409242617408672120322299791817591443011709593644915762876570742376991485381115399571864931549989462241773846016414139294840435376872973797088473815832409731618605083478848858437169725992369677056152285057605914373224345938720991453528605204903879084797077550467861720285726962756774862404715828588472507785846925417098761950063498005305839200791411482074251282709339026655760920895014495152435631952835653523180413606679289152498754566239447693820800151577260732471383421508588513036770294984399714748626009924033880899251009968398129311828918668930975866972686645267231778068251915305129782426537983111945893283801446807887556076844919155266304828415485155180411082850925335952689742245329499242433334821609254362656732171846803393696430498687102069268416212879698224699131424765333459872016794425090596040535360786621643100907801194271536440726192499646499839901406334325477794757181540008096674486226325437913534636945640096049051318634645202682564101222984546096977282302252381396359307274082111594569814820805330103334582101894888723025785862248840037964789006780186942457266965034587736950673703459848368440029152653902216711724092572950204072283587822824225229568543523038359291919655974817697205621842474891171128037403225882830565016861490135990283888997626798051722142827573129016170782532032782206187829842855952509380208396819553243903294300909278939401822001922345213771349295314330357094568067008599489241029375889458019723328082622660456204322448547580378798917933509307873044260397656877953783598079810488737086 (RTape.cons true 15 (RTape.cons false 7 (RTape.cons true 5 (RTape.cons false 27 (RTape.cons true 5 (RTape.cons false 2 (RTape.cons true 4 (RTape.cons false 15 (RTape.cons true 6 (RTape.cons false 3 (RTape.cons true 6 (RTape.cons false 7 (RTape.cons true 3 (RTape.cons false 1 (RTape.cons true 3 (RTape.cons false 15 (RTape.cons true 10 (RTape.cons false 2 (RTape.cons true 5 (RTape.cons false 1 (RTape.cons true 6 (RTape.cons false 2 (RTape.cons true 3 RTape.nil))))))))))))))))))))))))) +def st_6 : RTape := (RTape.cons true 1 (RTape.cons false 19637539765207783451446490488320436861016437924279911546808424086738153059960181660166994567612476255590288438388125952157177573901064126758479719306484326070875352665003855000796217126864213487916272418485174981514678201049113457962430444420951222431974927473620315631920344054543279102697858803040600222755351185322485334406546009325903138302944324783577301296403187660073055643206648814731940462960114996337352610704302299866677416985188072626612574455569816075726769710303111075821583926581717077724989790860910185227346636552362823519396704681355640283872486202605821423470013437471864141469273298404531460924316448434159048445145374848904545562981510083508894725245203064989034480932933913772673404576229828509657491352466164603259891795644148730031260611876856848500320019313829762731717688249857230230143743060952579989232712351227389135139515831055721658035068437248261956137083142396859892258575242783020291764202151986553332621195192817676458543038536014338085058568483493543067671388095841500894698173541638388706417293416674156264009307256733072245364555495371215838296309178634820123869168130897805007844475085024954109677284741806956846170958401125920299936186479407759001266588275412885308352282516865203929266213183321681153955124265083961530845792504949984082851296307815859730247297950572017626406804170746600217712970276425111372065839267534049319257962519714838676890012457900413908514572613601041154408127294247302056476243141497295173222564659333731539082368679355708910847503403189495385374972050606138505743896743594004228328152709234047502434342581384968020267252134975071565054318826880324483200759951902875837279688362377605288997120915573219281398214626909859971669412359459176230060701181670908153161880059782529934066975024666501795224225470383189384672796863354784163293547215324824813573623292093067338090645953801174956173027976712012724194327048691239264861086354339874461784647427595820044288993451435715641349163311733463251567182678936150803096601385987558735805641137186192695063428135791516119437634679195401971211108164712726581955505390662693596733032037707326256188096271685304968848540491749737763884496111554549751818269064166009734531043648708068231981268911183355698396985769443799316970009248430151933808335428572548403205568016403967829665402046535769184698495509710526246941940694001327886982351616935767131974295156060363878104302444878361107515618442562405311060991718850393775553069769216488743117105684271979944733894283248446837267169050773474453563903230621934373615158788291592124269251524590840148827350125760299944307211735864544644371499759536802349963389280193209877567318026883391812300057536356339003012597517441905178949285337533836252912969785381264632798128622321726863417360573946870901108598730433572295289657133974570895911657891008945927615999962293505852589016115682895228058113144549324583308746363361127517918604407123359618259425274113266678856757083999757300368796658297987043866908086678352699400836088765486138729789535219283401543548336619998609519808149416117735025058898844872070997005102235541866369566081936231402424075301573231253313115325453293751855613347699893539267383272757536895697558158966330969599449659788210156733640405724245572921777009578821074144458310726150528913156271174336773905914218393134348351118322637267991422192813233045200241928066732841550709433472816842766839102253772838330376350619940168858200044833272210003707539209625448687834796584495001012234872213302754204506157356829801825451183640202333997576807864059304834749564516034108336917539767730962973371348488853806574820196124319713849023902781819291434279231223761092492641761321137549613056792756047936635868493566162828450341892287629954366873025655346087398945060334850343457496002963826344423446859379289169024311259085939146124019887525113151357154106540071156604924234773153572481526898695334679191320608868461253833916182435904838645519862324867238352570895505151909369114902706143977433553255544016955641047899885111126245151810990024815157820125723916034737680513713782187723993858524984598056472097865161654623403863514434925942172963944122389229292734692638378797501146594118799470029148763467381318383442862732652817804888181040237378093873776071097051367876052244336965885655801850286418057659787605993740802851486250933794822116058144397690532622794332798350745099724126165474135284051748502948270264781193400776200534139962198946332116613058673500005359295253632760129986787349287803429402177673761582483008879570785787318970919070033408163672642470350408036398055370528780289085817368666082227655519557026318678260839669508560815178031130515753310801476417055844293322607693683626116885054717729515805254961384625867659586199460975938388164373016542180876607680301367158841735816467528934070815972551741769664716359761211634749451177857794459072515730024727965330188271738906169556555645863013579312965257261386014730292959139790135131635614129212010833729804821821051383854428394863777126409817917945122248505880573914498859592995194093185350999149342763359988189705497643480532213022906980856290810516165763078172325636486552454788404855862304235645259071026582015280987514901601250535084970015691468445630674510940586915228462052689195531902422685131211463279912176616292184215958473667761804275292365532852266398640724969249094826198611598195512289106369734127709349444276495579511235267660388039282135348542504558018441775678164618230634992549780947544720256312709039049413239675110920253427814179870899006872135304196924112645341467180874929433005930556030397884153191618443126513515786217713073673902904004343740123949843714131571236698675075570025887170231511573437943154681728910189364229610983859834327177488055821965450600211902975845795675439192202320399655511835619679845055738454711133839568700249457609047380011115584328401973359015741546363980031724423458740949024826250934880835807143855718477940484760154200851798952627107514470070018168463573126999723616438651607678957645442979623963246640856227160666154508797801771062623311845722336634709453961660357816811328200594626449312239015199117580442322162138213276405845283921111723418276382300245835446143264849640197797623639656479062991052883695101184416238851036263608481873068626831551396977555786392543407673628287331641673591319176234230333417008431107653552672263397595098137588032928505226818268781600595141322440568247028247168139451765729469069369723977506183221747732562768500212128077066459770452238830863323796911639252248183070993280839262746275928421056239983120338826688665028687114536318588394833483078102394192077456338778033405974666495438610692752137039264390414621139599826507180042016390757047962626022217704753566836990614191450356730999017424069147630996373011578840798939539842557760468970495175846951383669137160030541772462215497646992385331502803030529106362266826874599110988017852446810606959489732521186163645865450600600549927407026388349214778585235585280297115880160936585800168813885567120935363418164946050248094885888582274159335261938117783677242727337936097605939566114235176523210517807482896576470030309678369609059873019907738599633919574822444565055386912629770827807479719627704156898711944506324808869492128772891027326645134204881883537613599693455328603287392807691056856308425797674834637238351716421412299060254599923518668945823296794400532367650902072364100813787904490177020832297819904231236649507317822880579812514651391155728409771742258518702827784657724100770635744871713982487178140260382831810418972592309813223821743818241501891805450248784025917361290951760005554260213441376126282830204141400620958546655165994701459274992630898643039892321639548741419391360180692215984938012404549044702340206809435934281131482406271084759424461764428809389345647935107803522088094901630459723077276824829579583757192371139966212686613103436547999581575930057597815891681540193074833489254224588550454228795137787428729633403370839997999466218943740816019404448762239252070307217579306144957297926958727229362022874027356514530693800295397568722386523519093240948871705749471431206263554975292382016951762575712264637929428712982375565168288307107779315806379949102750865918096559675962162024340483889705238599010345515377432997851481660848716878419565371737074158252903065228694731896877497629494169416110182452021486187077767457020216065358216920327663610627891090732777103118353775818465376963469928587865551825794806169655352523432882387851730112928427539570766649741577253061497143762537848972926302978987242008851300160826634676080858442497866512275475323810554228847937028265629657526058351950498950172633444352221830176920133311515792271676425873351794271721085662904749523748389083880939246263733467963455467949144002289298260393532104016133438176950526934129512563583537760517693973911136807003283373575334069858989822986830959296477502289156142354033061275443547342754728596906568276561585618896431704793589943256842203608341974467168155479840660766152579338015716460367792967553654186124269370662929560986481615673630207052113152355854033129502122847687536050418685622527562293904608673596317734840235049737065179975583782113982887421012820375035607334935683672600629064889508869020800712635918833641832128411273111550171703310397036070124828613192297495288057875372088828189558362608788118074461560591726425679049963649735997286879012787349275524653649926483782841595408280075035980289297147769770391965987118468681827943007182092860778477941342876155224631418327233379803973838575356222772762804353769001889489889753528242602091473826856869123276226164007254953218107035183959274334788856272796240754129575699191839377609121277517500986825161203490068899414895893534088873701382797678889337358417245410189821798581969897778135802959499820415713101616743166260705163390111495647876970967656593531867965438731348634409723796523033436821814566313527648294864724732775885234999062854072868426657774230358154503712432034742983816698212080262987373023199961374236500460900260536159135367037174668401213557428283698567831085607553173629291601259666101518761308594374202034944766379595696250409773154690135857408895896567500918373986332399012076761567812881407862641220677653375924599409144340823635920753356629497864461367092695407413679231529096787444616975503486301476590746307235931730596977469067102179965817574712116660365369482887030545080955068175549537382282769149770878937130718700546288792245672021594829086554718478303191660334403152330797366590641933806403605206150353491236427447461030641289923339279367118384109977835707992237199874247878292314079347811130705819667771766838001185866879790904911085217567725720651244019927488313371261095575403218204067086110996580367125536005374226621453409897721124674604225648490829945981229077794478579875265316651999089693249615350291580599274491749397521794621560252065118875343550366714520583269318726744439921146178843582700517877199929492330752995416964097987454628018326143388288308802090818043848694958953260093881194627572302796124237800240484906661969287913233732837657862573648789427359319266346422148411571611637689609968052638365901563441613931626085810611263500347379711414400966973854188869748625567949102675264296974232405064682561243839895249631434288473730106010533328057370610832971992075692327654347246740661890619571775394313737390576024890996225284466269026516113687562276170575611035798373329932288571521625902375225232246626915703872346436326357495562302004700102832984975027429089919749620761207801026608435784332902130424793681951863840209904490419231216077272309085365418358566980523774834568419131299487701780915513692222259421274292524348519141376922990230457337078262439152979564681469905243856656104511955826777736281349206695814777888774873199724240142821825055161685890455307200837333760517578214522629481435933822417771321506818171412584548404630612473902078753734914016318485278145292673457437367816594146220051306290385366657292686298502543417217288577534714055357226589326462919345979746278113112498767568593572899108277257506952033347012092306444842876082543150966562402988173220869551376047959580737300409174077953647453533157364423685900004037045322591904064582411562931719232851616446145247204961538501562021931537927330317279032887765348114416443274208888017352360597694290878071006907933964719251016886511881300351653509204011696901240926964828790061860663856318347023518265689590831801581619158419625703160545130040634301881620262441646809223497104316508856577814692055444485766331374447260037376335099216001052673802011334224819368250874761881857907141615493774706754173362701698395761765388205849528806439608012673921210836149798896266626695075443773089487288523356568984401827053676501501982971523536152280472593823431617208154599166742674495250860475378846463152168842916520945943993750119819925273203069837767286865820240125299180785479210496130513243201781324484146261139606349758272315950438742855981605149913574073580715271969772686122063024420386377067530444719209592090516054751807065699448926975093755344696305082343123677762137159474151535705508691358615340731676357531341486025289758179980815227985274682512878452490814990979932641058762831519353291545532967130148719049605956979868266533851819711765058689948961581329585343367937192070429695792903030004476589834455509689272060066519992942540145468702938421229100219008539564518313933381464242207425893081868736606571367153345410904929667343984839841305613809540750409545665928228680370600864054075455543274362748761225440987802955896477315538835182346545793758717394891274816947240388083461671636109245146002282541022740666020997099939882188566499321570647133405463694368873058375225795522833874122279677444488098187217946759062783789350770545403822518610459133100546225072227551973501196457203338118379759794447403219874824603990238580411089247945968591041874404197453259880847853443638875353586383465586165741202335348168837803336674728775785921543440732387954398774707643230872052027435248048587194455571455805641559147905997155152912885072997773626182703019108955975745719785925667716991553565809729407768159478106990678589142737946810599445410348198237523377668411019547362086860 (RTape.cons true 35 (RTape.cons false 2 (RTape.cons true 2 (RTape.cons false 43 (RTape.cons true 18 (RTape.cons false 2 (RTape.cons true 2 (RTape.cons false 22 (RTape.cons true 3 (RTape.cons false 2 (RTape.cons true 6 (RTape.cons false 4 (RTape.cons true 3 (RTape.cons false 2 (RTape.cons true 6 (RTape.cons false 4 (RTape.cons true 6 (RTape.cons false 4 (RTape.cons true 6 (RTape.cons false 4 (RTape.cons true 3 (RTape.cons false 3 (RTape.cons true 3 RTape.nil))))))))))))))))))))))))) +def st_7 : RTape := (RTape.cons true 18477836993901974680627662260541480290816276984268865645453776283606601666829254862494123422065037614635581511407902023231452028015451399538904700593705473656806485035245336656165785571743892537176986185600651014798782666690031325135863969334570494260409870666824300063168618024043553329430991028567711094428637296490325078040827570895384263324759198780301979171009751460720413404524145173437886678243805483221655320459282897224394005467980961227751021527317628922017466090821958234907397323328411264294915306872874767417848035987887091222566715682237349828900469817368514581008568436318695672743054022861602505729288278845167817257242096753300157300235194720339051533262639016998699396583530878581340159552602968731651334738533871273774024360281416631564204965069873619212555475173531458732764367026616317416216339331366324362687283618633239474329849937119917770777533133721942413568925906602760378670567193395337467807871167113176478157808486275914360774083075415785472721532408722995043226597106032467240328713510830242834203023238606670833265775868190985388329154702259534839002906499496628516937457728245741513905692411169782321447349717872141267054604014479033356184625117205300086697913788309925341922692753756046081191825711603442311818196967192932747715642493684831674133322787558570689868250256754286571616253787544674121251608881317930795841913542411802320413099957606512967693253391476419559735603213578695675507002417413195152453235395189887976767198181183036683131484348819386876967363325830822413577629934613665756625387681980692359845876886526723380316667813435705692693773798956855717006436995317782932003093114955232264918450575064420614239209112218391393930562109379762307946464426655228972066758545076014997680104360767655032383242588522936178369794619327107520072463329775318395083558018139312223107625539889648296199814259603887808833837176672101722224492446629853906639838453069286388942452022687359202246367909988863401300787904912635174488656753226000951546521648083877851146288317198142752516441778815205638343015452257261070447208199730320929480579554835994447904205305087819480794090682936178559262797026649521178108853468330005823290076938423284880780593349402900844027165114429596004767580186821303072263697117100841023562030523687018767046954577675218843632279066135629201001567045069520516825175463644634582493435384160313701461742011952841829744968558461174646074585631494594754582131087945489028935319095650006595228214036393332333300018312673620854774557030974468228310456828063478565648458587842876864441037407258407680881032811092893475816423201586745516705624995691370771509821071229678783262312824750669062462378911425897459406835352661238052481367228718368364088905631401017424817692306424971475390183328692331194016703746318031617540076249330962647107349352453348038184159926994428285275043154517827284265852116844679208495690428817717408171248749802986514513475932078193233963157486654469374465481911052252057610469689363311442282572582642065554382796396026852524748486439138817494123336031853230998589013278180114079074020339704618975478783632036365144802042501655555722131656397894069229694337703916950090634548053232250512497179137829673583630363049392578154668930532647693956564393927104410494006338229790294783979216860467235214182564278265669294364384508404831079274392467869134727315746588369542092482188856504055746750175105920153687600837278003664323266355252124965899874399746236545897392963360257985000739151082755048686807877426218969189596435176741069953678357678297442492218874324082047185093733236867525036255153057869449560088966127577919517899280200970885971428726390460060484316665113996954543301266263252345925600061880081261574096635863493197116115228065994553978194777381089800110295706131071562696355630520859126593595291857137094655973930753465043585628783685490293418196824316630546730400993541706103102387656831514576272587194736604218348698839559108674044391799439902044003424495764541824038140578705279575087262402799019251211295648924436278294110737004192567322600540244333507828182407383659852470935467032545815240802790057625510213537937500409759049106948174232546283139231773116222281251659003788928882323554063041571758537997812541137254454826761908528778139796770492783064831434247690058517489495202116035465157623419378046290926153610110017024855756807155701788921171560176045359819182858004762938448386924764038172184361047281601792396517091360999963083214638321873894258178163566871859084268715029259257496230404762745205157777109376652792885392407194289397913069509100875646853773361183505043063102610128813303344606268522967390938128383150274735677522557237621082654565068912703598268342029950827124982238760649977569399461474119247544357812152719165115055855337406271224564999415496713924396006061746828895213434053377153776904070778434965614312295269336741409046741594342905274462091312526982441253236048742115979112079992498926292233984400701265640945483424041090205054125158474488713137558911377523251948068816006488237429265153520201866701783698376397870593070644768353012784761978228054379372092153364161852441839094744413687992909451327214715369512858639537887065997308047935039254820199692857944421852386710829470925128143753924847750707660581609713020106476077389843952836636923713032713689629805607368420416183304903194971234230569872925311979985319687577229391677940833816074468250212613666504901900498049038966039025961420855128963744169715401352806474891317428293006088102421661477206561358908560069651119630666573667691544080496794900563120968678763573176469901782882094294601860481394634921881777697098455780852421353588179500287697690421173789083767559048843826857105861017218511852505263045003605505643336817849290668269027839224609114887683371446564228695011447496396000772284828862336231808823529196330449227877939379409994571968723733759215879526969641057101127484569408942365223226104228820995450711956628889690871933546043632646705028430634490019633724477733269331825431520588091121112415198139085473694889007909649288030719446508534753990264563129939926251612920156415113667397906257439971254404042771297215863180091549127141669737656876085293946306144922728280371173024966818830798924524611215383014003349851513592210432934124762715898771835854810990337389115730307985416934561544628289248911614723401571749169006821603742140445219336361307593234700784204581674795444322052918477940954604964679005553059457800306183343646013556595173644605497630807659034890109684451048200465652661032385754544628832212871848750276010694209777108800284830403420779534555414284858381589461925653971586674846303025393783205204328169246751473068257400308410433098069069155102386588578059161333696894163539505246063090364441240395936246872304163414260536524940336050398900447311808299216969908754359363182681397060017809920060123531765437567861800113755619300531741297476504669751383958885049710682422200831179748736614760784420528499739835138323831132095358265831905996235860987368627485696479537583724868911913382389695005937273629997579132676699329158510429244670235264596348016666323511148708130722349009061751610148203612418787105709712268281474400099031775798901683142585292873233603451133280744093271775692792807421349775167795325746046973270470538110696384581233898666145689498205437629260713963139117716879912557544657223278629560913550793185509194410527697600547334716594463663773927252023987897652109474381543216821503789121388344847753595914974431660834164500400140013108262307052390662311285886559916202684243678592692387883238011834913409082256209361782774403806612798036623012439328047176037001711243429107932930992109345199542442945144275677796603174655012540256737884992042011356874271818063302396286174514028109128632687573082531827542729173557610656966944232676265888911837074652178200499655281993890263000079808608476136280093537876164926802121916906174030472670860839112408245820406060448517142810733706514234435561885255936881471807010710670198355086193326454287144011247062875228398373995982227453448246390442628006685306084721254205225598887319726647306224582018410591276719152153275437082104471114694807885098999244230334845403378226586000546748748901558519126705196982431593307435570411585611469330414182975883164651386683746457684227949323625888785848908946968090047822301997927160904088651434258974189120640849838426973495594942406809160847603707495104742130634573302377386752961352886241314666501135217135180972207388587802548938634269129482341942157680088801312654694005388572349188798040005714311512539659652419214468600375624978431681933257346571594690785965336097708652223812171017097455587806156003159233530236064989105226541562366912868438208229368551375103432730993508485879187104994287965100172755168528985706838295520159248447951956684300228792908895807214582713150575721253739624691177530203362092464819449252473245143851491279946030854883388395253056919377868661469626437727281909167924725883321012514654369320918598252394037691349131789945437803621728755018540567875730403873982288230130342162630988953218107333501355213380414564599162211686022650595463986161188778102523033123884316374486896047001366019413473104305754912116205073318277870458330344498531089106532756334028182180037461821750887576940607233227977100903552595850925529767155273023679222904040407587748985956298929067452386724761200916582209322000625118074542878626980865748874569312073157082840907335759858238425847266296493108110905410781334283224224378171621962257172704810967201058506500250326596552999398109139870497523980969702739863333795491451863070549307585673976538454820050688251809153353777279701032426342647080562873662514871270935157903937469894513998018547055247918625267758112033062883637495189681405968002273459844107366922404262256768914250890365094058939182014472654350793563544156842255488284836809433255351036109593168860530358696213888519695761321599026380024833261633960365604922215190892777673698273130626675041360773216890865978580886396542309660425087939991828975463694210362543598074835944845069270772693029060369995112940724497337415809276686207863838061769052425129381945337978833244633783922695938641928964769673241708685547465847902705027188053739099794123094129250745211164701732788024032357744446760390485374851270332174969165582979769447271361676652659058569132165234295168245463567205892405188931685170303299414722288257126211474338265203740674648763027582180362005296136855100496065365214490557233178139691835636304387549787468963604326274033159429167730997136896067026281856868637753587946241380507794800894511168926368862064261180976941944692415009371166752248178755983079064717533492622642861582280409701193551818006235756645123640065020348767636017186170230264076119555809987152965022271414301582870440419160563477908331239517411039692218698816207590339613179880206068042269794766605430705260393769898866810540356371748434508702154900244674352592969287823952231894796740682352529106583440183247081514968253408620599721347781047937524832042477264913683168369539485605909906394341537495182223879285194479981007648706627294238249185252590910833065342680334572423580892298327844396304927841010179877925597227893672775892630585454829880002021309878199068077479932422207113969746266413473008106254240369283235384597136714241451325649705607153831149796526331416262629266513933754670703344639726431096653485103302349577409377758790049182253661530925657741003062200528836653339107975379390102208528893376239352457240324172704510528326352447557196661155293347188012076635224397760746493978319346517868565001392677922538231269716076996100168038935278296605798879637400521138073273681710238948674700788114697152359857645464009219802139343713024212148538170045428597931426674697595833043645856420025695121888890237489412355133782517012889363993486313357870743213859887326866464663453525816593007885829047760566518620731985057266211184308404127835167742596339816640206323221087856241003686740095706500060763307202804316679098024311988481172264970479681557066717739948079350532737035458017719740101931215640136380765007014566776566678936063082012397717754912696631567838722551647037178846603637747684087925992052436605467339589048976767814786598348674263009082364096238748767570178663316036275823350332750793837660360086779692869702595977959700094612587510580709680841918759046015651745039005422653688014958977663503866215417967268531545119293307388271837088633243123039171314592809860233617714580625627929794831115019679564733797156881689521069007943846511723203715637401475341942694164702053189622637543285112878184896223124495230505968384000909214434869411185567662686548302039196030500135704662261091697871194146659376520252632625291742737595569273396288633405428144770716118776717909276641738806006243132958530521719148904253987696834605081564912324313973783838855410334455846031874267193710614825441800892343386535214384979458740338169620843095690863915181979250831069251164266747181594338377356911229907335079553554419248730412871510322772419240959877599788029229250661063187531557568120764447389620516678748468302168343810346002199416492476963245158977078403796498331462467276116532277820341363345597405889341457753846110344000592827119929551963437926067996481442029312844334258563421170480693511882236672269160483760447876265737997940131830566083163045084829382728631998448022357458512522347050058656914771719873640770024609312963576122361228656292129878251710008163553077540119140430560259345069826831540625140429603464630613783567787961457645736491161493756952377914525332143605301610531573181255596656749456121863985026686989556888253332109030811889712468066817253989406856709038055444608593905277324561058660060707364024733433461570097082283402360400101843996815920451047384006064654809905946759674217980974283675240755535881536580121853656139028439629355593107697863211626464059515534183357971187402293396466437663891086467925749907751263821095243219924018024581678624191566378725425459217084766227389982249657449827233218612937316280048158247740977980411346627943690140104869128099334810936221642515535733125187554998532891414688667995657648134882749007997201040980628728159108801296279790432212783833283817557307953426925762490442528124007535271046653225946327090834684115091576616465292040303380449969952602486087469978447476635506469008318276993807353861181356779283286554318068895492779435832965500752716365165659080074705482414588524985919843509547170333133176304856604853359640937701444918953715366443175041858513642170383563277351718035516162793794503214310783230002009003796667203416801753140486820686530868514939137069125168622042798672729710581978569923916963651313282715527773573197308928619524154083215071252111547263719915105466880530659436999132874103517694522646867401716881804672277369171705743824065035494664714046964664305587066998556244386561279079240771038400112270558153545466721139878994220402181481621104899078867248580578123754091499868169178218821897530290413410310172043743779130841282644999072500974608709691250710295416695389329629697372042653352864203514873524450200180515534794087518870570248256686285059629498948048446208055041139868183852199990789338306498439518173713443774661406972936400342981417219447798822535026618964101528569364201567495206156940665024458187873313569228080835894348425969471748711127673553515042979754879502028683936963657211330016974466496055152927035019917959372989478528889470876057787575759028697075742063307719374603135438548583650513860668849316812836050131720172525336711916934862065505866581812860029917244789414290063489817520946006141293326279634227904462333993465203756756888025415960517096298431401066821023656901291763339432536040434023654933173880014096545052881480926750658791063192664842060093691096236429088174709065730421617614025013634435878499126595978719364840203022595525428031114739472266397429354234245323534552984760282762598922220804725192605253443541880010032680058170116020216998383811579046912112183877281870079182400205932455919403373353607336769740033635799923458464362658229348053835208066342205359972212733221279079642581581522114427814499779575608530658418649356631906824244368606441176721433162413256093852842094290255860203580837039432828298903794931620002366478154366038775903654644535406552270244451338100883534364539985914421049987398092649864686115629488751867513942086739452194594756016196434884181577530180930883610560617515984256397102839032820397806793419431053850668749880550474374434532041391538555844342072728799691842999335616056875630963790892820521577946349288277644064534952093456878724833531700594 (RTape.cons false 2 (RTape.cons true 7 (RTape.cons false 7 (RTape.cons true 3 (RTape.cons false 5 (RTape.cons true 3 (RTape.cons false 1 (RTape.cons true 3 (RTape.cons false 25 (RTape.cons true 3 (RTape.cons false 2 (RTape.cons true 6 (RTape.cons false 14 (RTape.cons true 10 (RTape.cons false 2 (RTape.cons true 5 (RTape.cons false 17 (RTape.cons true 3 (RTape.cons false 3 (RTape.cons true 2 (RTape.cons false 5 (RTape.cons true 3 (RTape.cons false 2 (RTape.cons true 6 RTape.nil))))))))))))))))))))))))) +def st_8 : RTape := (RTape.cons true 1 (RTape.cons false 334535928885317273852364375031626099303433316083566645109793572731065219395407023823441761514930348591107885700005791310292533435004198086581945091672172052256331279485786955574979450328432929661752155164506433163246910910790693585117074472555912403155211500780916053013106589361715591407320871736788502713612385605683236559117267305058990266255324519028033855544216417873163399402624128331335483072061237365378511586474732261030781412027833236328740197158903194110157232433195688927017221414247719101925553602193206443548599095652659501255841563220236742122526270471364091694340600393855903537994780604857802740100114973305567728636076772483259795290408237990950579558087991146551959345254902225134497678333813225630660974449058415287911614332800632944059292835345816427985686777691134935509034176251903015228399009527454164399333750721136822152927696162974426653789279836163674869684610932175889289864469070923910268814253343268370663363669799447742364897281271498429770873654498539964720707969593822360157358744675846799102967260088991629674059105580240049625080490720972475062483359640853520896343997767823097555263844975527206466308601430981922117225805049870941714762875371417597818922488082333412875971303509209581250024356338383828739533019759319606810635666833334546535894898306946194306875155371862278202682315123990095049443693915552551843329326741423280121623092690044777192071676008502247826198603284876947194473473837140031560157607193654976970124035469241091590503167995354883332438992259512766072632676270273092364086074065571215353124216377841678798112848626671032550951229329003029359132070011211713047577332056181778794261533003610429579044947926199518235685053600179758485060199300378488310183017281451588396486330351187990421259909378725144985315689874696176196146002666000021050097733822031029771522447013052160018232892947555273207678566348066476508879742511138645834127400428512069907761711113150573378972665468561164996733094026686259822335446756872307314615910242579610431013862079930793934867419111446581391739545840523647594596331023602321229554659066338444946579695767873048016309021304342981098618900849325220343337243067054032126981881102981333830561176583438336324396714582192078783191161407861846928359140455452992587661881488998924614875681327358936369295568976230997199825347580844113419249492487750024492778373779136712476389256953239168344255611800265019181246772223690016942840783099211651996331533204878680327209635514605860346592668486408973098429329688702672663466837339363251599463332649706789896919426207264526518018678474348760635695128750292904670379589650009401098265218188014699860397935749160920552019753365449165776613885431630699717832257225447840720352643656813720595942375988133105120843906936298743126552808624838664281479083022352472096517129087099101392492689495985245933744695822705663243819689829534586335798187984804465778191592916865429540592736609283526005359937212306778599661001237975924256962082407179244738435953159396716838932951405173764218692126556013448916645968395208963015619660240805602085617109867918740821445889689620690383570733220416490873746299217607734931898684936456226168019311100305135844091354580873204775226638277962055019886956287727934888906399186054835011590562983905992642721632870200442664745835738686016202116440450403499724324264119546937357147123338912215285373538252078743645352667335700544233939387723398571413073412355263046226074637054392034997512903706627349120089859423224727515712089278184745571170609252170892956994680660539412169290222924644389973164495781528191209337926456652628214858585617487519432324418228680762850681360967906986267859606963899707639299639809146046912723912742731596648387071365779698926531361113798707650184714221107325001117523733510086507586392910078565288176383220089981476206774733863178646231702091153102416381704439942747494675135163607140033860844414202611939979951158620494018564357246948542384112905425048854105255711024556307309952505550057325192769455122606976319721049464121370135580823874014134579122805852688538911494588479087981334940091406472670156555552164720998594954898723773855542855457479013279554165897772800364439392654993991917019412851001217681660724763230766818400822083162974791036683350183440080289257270900830639591121430459183340660411434054031555545828854447370545026339026946579512999703828807294910050855948367652645970894424767611102868130596814414696687640016614479412093047825313513647569757385100502456516133644987062098798914525328604046649845619624873458419730658318396026198565352624003294803216450355276432500564000155120564841008669563516630077560729130552165175807445493510188669847077273927239182389897337513990340352632583579164650798662018816685939772780520989230238214696932437712175217440061829583180449851313709129783128042315684533205273545544056151259674273756624147591159874539988798863806608196698031867684765590966862786875962975687302810590038631284400989128789019929361058799435743654309403806484976878491774761116251286065567679555412272355914821500434597773519909607579403243469462125511803497340994995563736240425634163959839626806791586504669231360629979697071461529114836770289293792064947482086336644807081104799661357625053525778922652984142748953365861018756168498202781935999776448802636869238680499133766785300630580503087910034118822762412295170769420223736057656576053557490278005562097021356375360018341237532730856555838437266855123583491552416356465423186366480120209038669717071613285120200144144936356157124446861164246814474575616266691061167111016386526474327038383312429013554972854809599933024332182108748811700026249837632784932809949068848322379206059510275431087886762748308953977083909447793549726469482781117944494577927675675427348111668086407469550453968286796783960683457670974888684594737227637423424588748019627127799949001826405373800561967341724254890054477876653432694233792188389886070468427686357630651782735224422155886484316719871388389826468775431420920093327623794171326509338903921026687644160473866164764031337516199654575525747041410869117530362649716541042201430686475507300186295883528537411807355951244418050820441838095849301626515866220731171708190378052353068055002392461052445153868849102633236265052616368492771386321138594190156311137611382693846338864792617788896794087104695437030805210777314644999674367767184528180576888479703286127649673746951663303305539233245889754299262623948160058735309101429917569960293331874437230117036907244083819189863383922266576986775990947990434344160258906618938020890362685800609852970576461266477463039967486144004969740505139971474053638228261308706714027317806782396004113246423910334023160443158936083152437776798422086541563753597596913638429483313957365580052022851450759016609853829879416547792484838392586767018089115821319958873245403194948200312131576643654814979333773994712071232113561759381795025863895040799442876859190024185503339425661445848055716416961422441626323001040493490582159966761686810822044615851744907102068731751075895967260001620664733335830405038796794747548487717906420930041838132185638071862427429047485051787152806269394291795450458647306749980313664549475443504497534079291124231439235121205916860600471727744556137705104569785327830433699351660437972783842210712092478072073715113567661657955354380581953187589318036156304557427851903313168341168052608127013156440066143051657690401670431252935990365853355072861156393349074339098656568431297695662676152396938186692915775346935611847561476337318719929661561541515544655874469385396128238684431823346615715475888714990834199742344707740933101272855614539054538789219819783755807664588826471642527148174551524616285452141544884158517588134284482454594510356274824231134249016346263068510283068140092914447696765319307110571114840566241384289626035935252747200285933663946237970176692421404256073445821320269937236429498762846595879413741201233740477239107063299837772773330711794381072693819560282468741645751157793156058198759042705191167111443382616452582081732142650754362718301361703664031161310713429576324800945641309897728388881827030324195900754827018170452628873123884875148367180976034288712046364636292941935764377722904033231949965756657460846180566872161246878585829699309980188399798308463349612397173045695777264079050580433703717076157960436260145943608986030344365781395383014984316726467126598703412002763572344861344744141560734423154592514562356210382789302296236844675670852130843205341400502586229108435727161485293914553766124707167965991646811527527140853094057536239749928921172884192907423978945473069497379108076940264476571555695298026820342433559324598639235766269365487759970553650250128137915564792166881970519736037326794154862753772410349657284658663537816031209345520275311983647791463760379563305275886630600295309192117712828852904677040557970259839531339907987923936968545732417291653511461048701201090475178971619532423365009326478454213459826794841770663733777582209533227528649144249847940743947105317657451831190509158030585453762152854455539494912185868349133259607636139256781651237430171528078945247971807395019763362879563130049052256341633557493617149644683193661156203883009151028545742567190021293131497152743845610289546332161937555430871140228005969723858194842533606728370284055139271343707726061825557344189856462788185701276271690980761785523917307141930636501415044665278040764442930105133861040792653509870134625049044019122221888027826440048646142178541531314438044079248498878938932274308248641243013293804745083550247297135391402095652580391688229532130927136893165929490120659947332974869822268764002920265589364416350908340695468486340361280148977915129365034860004533352870919798636785602870286685188708618607711569429034674060225922114822708174524388194519694623520787995658534212930078180281856966294905857432623216106617294968183061819021124871077993428943163603070586946688060625071715338902859463322466170923569783125611538781011934515612076955102041077007001116360338437851614132867295461463120061693228820869817597046937883567449392379102944723360059988171635629697409257405480959691779197295669656677648761830734586417189468633432894912232947765791265173854358662243839128496324246563346399646033505617331068163911246069702035316966933422682406064501095288599080849982762250481625954987720067245843402197743827962246906554979786503837452119902130404763844846959913525081722215127722897800460272016797874074998155947305755910437707334668204655444775908880236435476091328248488900720724929046757821085792177732225423451972236067216843134871202647515324752067780075606292705325005400529467460093329893207137361215155908720915748696358709922695829404596931823254445976503582926583542482734225354109517588126251578817229742020298922352983226927803783008519398090666612310477129803126945981466900628438505473702039976196671011987612646536786272771984223190160692418476325256465716304031890765985587958659239686452944637567769576718616638808664590329548122532372870608804664126510731420844049264949140762396603485703673340604021483902574287720249999036760576706478796429141694105677880063424486644036649724983917110232088272663088749927837222699906768326188235018226766381703288127189659216070046311693011852493705367857565720511843086308575464685863792100949991955468765531422848090707925708484430191181413634103348135306535810023560965114969719920374284790471663138127613739813197603440818237131452548241959362521763452597391696120796137860223620002712090057765651086336466600407531290030166867140075757295006206396380893820926706250796977767844991087968870113975533960796435096786881640727165912977292385749363359849126876207360699496431820589039743121829783935383092015856726097346843762493866236862476526614013822955573597419701657606871341759277499177203255562213944774898205026612037142135561340941023086853658610205434319156302687486984374299778556250756297267275824876333180745312893848044988825996540345802866669070941299990355533228234952125183996026966956017611395534473551110846948079919298162817007630712352965497648159232138184115764888428409504889058266424757077912746544884507123636414566307759870706569047935328129981178814148723166305598395986874544134975437309680168535996330407337347260257832944399481423329256726847788240350453008550836970855983042770096116532462159228815117060057396448795836970549181113934553240496696999181995580372540765855199082928532805327822853593325340756043118819209450464182929514138720806900828605770040430905152645380353937226129106374404964526172445972350638944830577969817060543580031653193477158061643874846596244405320199677203326985095118071493810217473845063272488568901829197732017956926038371841641775960234919705180467885309654090533770603465263184654454139833720788249871501133878546110380500259480187902927825529857677426029342574789553215423114170839470605598757180606091950453363455484384672163031283997517334477810427775529768195309238147842311429907099979708269949485584510013368658921916897269927335278635254988886808628073932007888309346710981418817018715761160536712955079675103687837860628212873317135139615352340060157766586178520534278032763872925446026115597893800158765452340961086124158794216636124049153885844104420803625433740286847651319456851788785122625074773746245999673107423543711236009977001274086917428613830924543710251578340644360516747615537330389489167197431531336063902694894425317717436360494681042145779393425118969173508272992397799540990525098395732360663558478544623601030058088861795226277370509513463518440528597851092555703156621889851424273972272845094239740332817315381600613148639386101524443990147697075572491299423922403000403705071699212044684548598098653831563456964258545937231140505017315385678873203831809241760424749164272659929002589532351330869331515694165223806070908152842433590753859363937031500851787465330618719990386910597235535302829492529889613990836364513824385527720584866930617964179492102368806221510334013479907118023220554872377736675953806477230131623376989487937110698028480000724817934360000220250102833187961881640003346935285755253753092045935890601047780918296940194246566931663977046527130382957129490019802576865808066896123682896900923825565054837785235787499921557017124156961513698085114967571063965027448949893646527386342314292078566838760478053628491548972276464222321641601249778900013358917548766952683453157128328359463486819191383184303556003770574989861594431795012456082677214717252478696835501355532968657949616135275331645098194661072403516827779245253055326287607922734399382318341976640456043251615831216693267554282529956141000454979782434213654609068612360764882951603928532399603804915063480487481156224808902122065435225311690885116902911541869857498815972369241278828250688557229132995350745371175503963422606740564808386820418134401972342326645792717462113736572835134584557869946147789674554623245088820247657607192769510617409863409155960394905118853067750396490530302433457100669785052115278822813104718552222824755631033650833316013711580782199739614135553329897304365649149399642075127388825971152541256241462028266787625862601361197624272384106908118921139749655993036287837157006181201236160316982295215785329539394127949059071419589991114138518710796547659445570440098987250379946410524300713601824079743591869878562114934889391219325880706409498571296851322505638312724135164963425400596733924365115193000552843085660965737417924333596214040415560297781804249100171753076168461885728717701855201684163622926817298468578840611053027730142019890203545189642530091504696000243336056820669268235244447634752217662816000165665579560633904060280073646894347794973992035624382203872884100556062812999930673863150747049103360078387375041959030548360904637862765395109858316388395494497988708283658937752358539253730374976051333780949726377899312032146980275165952493944009501040350627442527291054957529538813092686269662664187310204829480698290432891246671239288917472803543813379947546705922805207099580541440772834985571942962237349480620580427584649352082449502805011402909493148465868185899084817502565103493871050891901683199780818015422347987833763033333321139850442985480907770506173395020252837314255352502425621766980405259267750612194138168690067427429861141937513601839533894779556765863251083308473103475991940871757607492213621476530591900162868874312618303307868677374096904807918248150722713312184832462588069125877800227015982893122085282600965923640945556337329593693625461926242307666471339717560322989651741539766458311374363902783620203105374982826452657540146552931873145793573076502099516402968696780051309368953077757940900727676708958526208797569127030490786716168953520976417486648900030956427853742888362196695426837735852449863022879021879869407144168261493538897099447736820586748524728255794096806848204176304504495361201153937457829364075341421507666910398313044308902717864528649637516502904602917648115158671232560697800209960285587847230568443270911951201513008855420375759957988854135909608819340045939628715727796702735102743846495380092379111479315302359891811019929650771384482758956486447553705778738509268316301541351096310905937356592175487328387084441886467584199791779015292273067948844415301368786197641894138424752393196073124811671770220079034393765293901241544259228363221045182566144956949295858065948767923773026664109957062395330477385064623420556622952954362640902056307883494028330388067488138811699857816714684149929186049791781311123965798526728693301277552055919100141572922503044062715593178052620752431145895770507666336384784869492322309203226083305985506145998674980081262758549226412295708556545837542034283147454974016269331875317161632999765030732817691960068887009544587502353241751609256011250414279929912857887058593190037366555576573723241616167948789853458073469301530520177819382604683664537495566032695403649825056169015997278068370396754043235193708859188876482738266554458057859545141515459832547882655307781558203869959256613172367334958996666559568121494722317494308255406475723427687491237749203827343299741309856542952594256224301850018690119470833037039535990032606561452873906750597485495363696676118584757772021415766175779567517036996024757001560235561049669894978791550496577963461131217319043902349062135328821677134280173439081162817571284199462690547615961864776066618965240536539843196559388570590688026714246893039567292386177986301963271847375032295382663519062661567589836313183836900715022609542407963568605905840748289419999164034501051458550710817266870298277059965615407920869142789950550252388364117826441244200076312191599596474632733370874927774688857569287333404082750835510368293975365472066446082031761135973574796784560827874039484612852987138422625087982757850869028580364976790887420242943580572778082778604057437343952995029434536468200903674833161531457070616965397653264729182078216768046583565660757239839898050348044530147 (RTape.cons true 3 (RTape.cons false 19 (RTape.cons true 10 (RTape.cons false 4 (RTape.cons true 3 (RTape.cons false 3 (RTape.cons true 3 (RTape.cons false 1 (RTape.cons true 6 (RTape.cons false 2 (RTape.cons true 3 (RTape.cons false 2 (RTape.cons true 3 (RTape.cons false 2 (RTape.cons true 3 (RTape.cons false 22 (RTape.cons true 5 (RTape.cons false 1 (RTape.cons true 6 (RTape.cons false 1 (RTape.cons true 6 (RTape.cons false 1 (RTape.cons true 3 RTape.nil))))))))))))))))))))))))) +def st_9 : RTape := (RTape.cons true 16776341816159063278694288489714205205405748535569817000891132867860650018823025061079248693726076573757424025918401450443689475789883485231934575564528205908430273279180661510633513879566761690272270010150848172470887375367998228799475605395453391133884796988584404404046142012707818995250501837836228304218395632457613353581406499398890652442406515949835977243370273157262195688558963998648022778975682216054354547972507087246024520177593455176930083461233861378095152553771616214115677697513348933359624253452854312776493946201235835038141247646297529148640684767712243973642920975833133045390739599932296864116970959682789573014807919253925493226179943117630735778802883559968609877487530313687386703091979222326785494985561943172943584657482914544876645356426009515476339655209398587488358537646798825207631915259440320027505243801602170655485586606176229221478301843620722379625984456694411466070478132807589725059164798260333268027279447339774975645691789604132669987845302545446072048362598519218941317651847746537306584449145014777537692941196452201787292986509753361170939114023089595558997558726738454567745893722619075778626587968652273850078110048204689353383407470368817102697511484106219955516712447916524762352694529979105976947864902551496131376744183305859328229668726837055681741220641230074444615757496142880579866552174148007655947089487711022723935416341517263148520233016119813316512230361104519402502667682096024098883684110869199520074191466798030218329186946965233430206500463608219569094519628470059586612861789024533615651909224059121342494454626914325501076507877501261856191146084823686130129660536493779664253567508336322810804416298929024072314708270261612873491433127755106671816858019439836335662077717308560193197756782650282602448649873672495455908957330974072651875691293057925731461711242290018384761259261406821087390657150418727746566304937244668768020836742218457585506205568019129642777999068790853566504667232882178441400769888640658436796712764195568633917370416464540908343937522781634685337336101774287042484955792801954629538998185699309758048288495582201727186623318239284542891973765413577377643559851111572267418404029461993232187962084228771378709416801129201188752409744255240486652064669968424117659464793023065219004950058701986559991417741080398130531706701611175138028625959541086754010092669322749720390005993158718799071699227968521735729032570536995724215982527405655154199876502410212255481451299551388523707582826669878625719545099182957900741934797621888693187286312879409477087958260746452657454041732861346358515085282743332249046440224610403423629282790775661195099051353706457475534921796615059925639115025431912980054210815063817807756837992999399097459945283899921757201151863017683312267892577996523100969226330404966329233757369713545312152571809608890491835535774515924742199641917301125614289980431690319396833115272083715304902639421732249348316984455759619768706640133227556635807214416668072356560458494854636064239931872312462469467700609144080291820814781939371847000571315224307060246780705071421645294073436664659696142476475492623196854345236533972260228928779080686999336265468966025764532071394619769247463663010963546535919329211996696776231946371041254366334397114214571023888434766809753742916717396329073670468575677553688140545817058788036611540039568710891785617532814405505904295722064357725093093957758987474861443006518258736056051057033072687143450459860376442726701130024546473962468469421006880206513546545067254336966078800994949121046036000143286061029053877288128462841550485142947734507905809630249339769326604657735633890138261082150665561404003336876719384188925385224920881011754090268867240496238178260942204022127405957150158802183402684897272074604009018871143002595575796951493351373842155530932281568497985535723027879645075108717782051230545241988511643616251097491254884742697405207484855439044879032194822005627868559964869476691667512168554325054119806296677149868340343492259166312894636149076675993326362159312657462083338831170059666472135908945985860512501626965179413406751132692053515455277265857729996887778361513970790392033653204305243096698996814879025482597059975669229281745313977224603874740903584645189647710157966460561778839563702666688296462159753750250894842994012542917457831501213796364453556132497869574187297941814534650112483817254098213121324253109763514874224821004478087488745077879133051173247700100404301841914865478387979263933140655612615371824664986396577361033443151499531689732654115763209382426560935764225363042126493607713564427044531972761655975060119168233301663122992231343552742633334456748557866767208777267234718570346680479663267716201672731667959426439639347160369998048248844671965199640859816107873284253325068970633706434062280580645605974167233525708902453874187814982378786094642633201690271888355707445713237488601288484966526749722422556279575723519301752411710109033165535909508049688210551969659526885795214274107105622645518700707339569148779605657670544624992941386215812971217797978264087398248580183808048318657897760217850173897389354206290889250891809701646346463800586253911823988651490924874149298129789805989790411541257549141859344457784890455524562331166995130313991514525977239013588610889708674451347875376099040769988586467785471963064107161066031699506720575056371841685171786168096318020703984554766779757344186515292621529530603722854802824067971534617850083329245129297725590919022929292291440062894557812609573106559717548078041759589737257519406736595666447548065642930354455203250476266080261987409828140852830121934010720905698624704864990580237714034206677155851832213459759085317424550247768108520882076225707140408356812815475995411831119378439213040395519678406127045018616091160608720719343488194708942989409100539116277552809801896152705515954470349362504852925958827745618370846788887624831527008147505517466651317349907022760901344784667064096999980662755547558460988634334851060631485968244434529263137421313891247738288422872360973411807191624515832312221054794399600642531208578855739236892117110324402116275137362871174846221028278294721160986869424779258773364866985217821365950207270048898815112411328236274102065430783579045146876621903671007946097681044475975019960013705254867853307354671514788860919164052628741566074360950611158248947515555450277987314641515789249015125439531260940189949927955865246255998903303658607911403911226941465670120445953792468844683789339492679558026708051037632144283144580376134354004437509644513141927332956595750475321549214449116950489450652936963243757247593965171308059711461241488044319676832605137125141467023799398633426294397575237765630613059319956053487807523826807349627036035553710489732978207550502499567929823879190808335123948106383242646394012920098138994732481645859896614492836028627480232961434201589825028078391089890080928614601896912292431138994200154802983162293784930649873278678507951718868049633829407147666070601807580241187652300109921798325719002102078562499746642187006621246495785493815971319409269834584520295669144511048767169188477110712102341367859716832085220217185662262406998857634714964765657058673384477048274504883903777387316451656432988760103645443645587617039244271736112056945765443775777134458005291237866719728519803735064849075145158502524208144204840442804398312401886330677011387316088170854653411258220008227458930926585162487619989744453167858915784845422122506354126364659262239304772541767881530749847531515113044958587450900470000957769256453928302005667364634216198614443112831591813667329677625312683563085960874277007975813214981509700936001355357378258286299813854752644564060416127986464914203191551215906279139506644371294637763656252788494693915771041143713641217879572817499750140158975238254655321909850669357078317351736643381386931742782472920426515559792092407401046494263141710155041200575335861646940364239736363558541873297332854472631826123240847837010212777856933146667434899123285051955452518015357225482399153373656556737161746582745714214343155414382080537250382714511785385962045205768712432414607373653697952691026832184923916478766513056132662967348339035727458735218895480917253928194894141475681183021222455360287467733121964269240497290154469279759740698161818701131173771906903231969541197998623806936531808448448703570274111553048763061894806769507223061384156717169548209509821456098046734678954560598169279987808597215357049638802009385371834812775168133984589811436739019537481941901423731409637787305228188473861690327513365707746663833771033343627403082368121643488613371572896252543169542238397370062578975901399461813165199480174307759102536652654043966141695972019803420575613683021489220065796778512830531671670578934263218967623105130921548105060714058280005293781422083214385092908460221174220566610345077489794678719687192940445981311667707287438321812410388915727245005580158761247291765408735865376489537694221193445401267102794790327264889881697424351566135630698469355673177897911400974234348710744496722450329949407720660904177990673644407060722306902571512431076923528364559986469752207623954582795288650511415782007385766684105902378902318831395364811959571136186315435913900673642330572869369391491087422553506946387638882543406433034082565419690521891700121646551430049225579010659362803967707430136246608299486284359963142366586054442768376736464986957785605245663922003069007373519837089759109275562542248892400771900053535901557938156169431949298093239029490466511506328810478695360616681594480368261073876352700426796621423262907755848800997654728913814951835678005060654096893439416938554178446269730229368470835762550367880965237188078289648867167945997509092492477010324229677163937802601012389396683503784733832267563477763673755780371395079992509324187530025408785247098410514724386614824398444261547006439489621501110619351785490935617183598833041459880451418770193159920455344396131548508171094176311644401816541627298564085921530617425783574819593008496108358646697075889585087807619824308838220094143133390573889959666626164089258344902943692040522680241330361618350492359764546216062303334198175330264176156470243553830267150795907222213778145265701473809818011997615513043024292250246219312155594191433393381548381140444919941624575752862103977125418082986148672377657670016900477779804129064687264309280396225462020632389503866738646278881160302802795351528501224729715737485723314430304032747481239091519290617540447891871331058883534752158431758600638272186752541116565923911421303183309681644947748981823911199144080772918388493437182005276479340832517133032402668631686927257026524996794479248270075866509994252157465135460297547166239046239096217440788776204943282813426893473582526569708896392595829940132268661729813593499821569740257114305013873750273731983185435850709893680688508224014233347221539749996991612112283660393440277286141649828403652472583380412860015162894091421055371078370746419411591137062477234843309004420311771899873809630125660634295018833615340860670093976349578134247606626205846045225753071800305938102747695377752491766843260430000638600438427663946364998002841819914604109065799584588974899198653485556488642138431485409392358772746761110770287836400549522363153599963543597581546375759209643875812557491642635804629668440917498752686365026069595742316102959218041072866302278183360124671563227359620249553935290310389090428944829325273348408948492963607473950931291378573823858638128215331629286078223144359051143073707508200084311289061755942593728807653599711056616719563787814501597294560043229361834514558079793097110104446193212500293655451560364189275763073811527233913459946536485636379563768389393927827852195539594034475217742963644777269031500817276562408781166154563483650797583583726782581287482970713451201133481526960337387109946157775030852050248333906394774874765911486651596959097246631456850192561582923069668610450709724544041622961309819852513284998871791238367012359070015780871888955192731097919961817672137901333670863226744307348867333071756640915446343451450846498637560966422239915252425073832222273855937331204929590951121391898074583101866315322683181168116712868159104534550176524890346469991232861156323327243306631455117100270453680291116610219187762887791351436578542797031841786664534755983176317741120905834764506229018615577992667434544006240930012852199012804486739950404225547894829998906955614993642546469351863134425236928218909738165883546079915304325905234801272503005212830635546007676137236583419190401232646636984538637345916607350131200161964967285757341420852526843919610611690634307077059255663321684039604112249572964443007242101076714075027693251443040382779247003881154024748358516988657752464787804239168199247394370637877308172057996021785657927471635927340879201130710107850612594024040941068092901115142084403967108130198240807435616036304161334470857587762644856276433152971742537297862142784069249788494997970662762321376629319724671415269678078360900724076424773533582017827488165812600054134074566338345717066682623707442988850247551955136233902987268304368951457121174458735729745197650615293718271383795329246964888599742670134307916673395255293175883087707120625989914335632377221810285758909003924968643970093306842476247866524430525228824049137853753814640989279378744757259952130123056499763162172172980500696154184068830484138656919262973875685764036597161944818192025498108822300995323260166581557803848409516873837891026041198145488355915569075776157981545394867658360502206104920328006551423906187972742302225963363307402864194292928070995103463778131431681271767750996498865625716028446615575606851706420454559201291088863484122156350502348848355576821755552073012013046844974852448188710501672642551175305521487808161597345136778590435600685853946169508049165520902125518698044696134994433236853275942892011337823659763936073230336736005982779907044348640507059495796732744672563939994774817272792206568811873596558109889395645020206109119558865261823070365634809283514072424047975587587586693375748490127432853073894366386362107882341507850936563354612806009058897097046049944253888282713446224363817709893608227147461852853156136741907959199424501014434108683364102173286391247285077323705637575437345093057892703539827050696370476627372591326685422040774441953294605178701586810996388581564911877689872956299794978057084989994269183848909892597141470255076974943167746484310310745645089807301432616938642256022053870789015771797675769347732020731494854418524763149403760772998215624968200245721253665395260681108508930947330713467992042365318083293494473157028666447295491872588283146600870186929284554988492050116016052150146157738757871429055535672168878777970839947040872417840219370167097013425242142157585908884104881750417631441477719693119451842367886415503346108957018477244585737491835078741875132521449685738676166302187234789145074783894277622023443101542434227034321983471137794400688729669492082949986250943546731430451434306730203730772096758224884557411715736610236937154276271679088840431527654757888164969572228801420702135600637843497445408519713229059729289267168126067134715368020630559216555683758748177646417750192349803816748643245562547919889094050781356950380758733091927048160628041963069016145816386471125635131275194677702492300092365786912528715899836473829524734921585469166305194927992654516889862815532219342740104572989647907023647419563265813065517352517361175503378560197063503507871905547884225286018529067857465684892642472100737658839505793078761066498107783566947242280395809341444777134381947294617254885564888684898038497457169235933263290037831087722468483978978701975685027490347869603306416490651251435389986726741777464007848533799646115881897521495445158149427104302966271120760832272322510153004889414033582614642767239237999058784343072339846133602262508904534923221152941567412615965217404703871829023480690383475229214543908772998655469130332393084062829185463806411528066722403953901227722625226639418423292660632819394860361082731160499110778186659095265605452186351192879615026341223612448867830599757758532808113689167491516369382132630970112623924732712581431213515420911772012703766919636701990925937307466437329517060760692559079219582079143264480517000202956338980861802074215214316515858799195133870389191729874497659367766408384512766185012581902667022364623979497179881591775287633557752215169668178796596496745074981928233025992979565378961984163148793209640875223034098400280234190628010412325059084614887318345124811868624046188240411746823290331907114512737891736425071861016360155021579200690012290084630373006244151189436437281857956962428680709814666491268975642704778875383773762353687093053926107604592886863665870303114129865310156432071132877758905331165273891192815831943692679153194867299607433607002533098322825447093432364156663945334912565468870479089018215323447566707720093922855295262192996906165468501551548041691410590723988602071072537624284827075601645008911536100782178405204749645369423312609335840305261914998746668842115285584563516554031384641405784953848199898481200155188247544687297616991943341406658943669192306061829188078574854249910841356176119593527025417754761460175046570576264220897916015560724786823845102243855979630169073297788315404497825691482851315286206589527631573558130781019208757200876363116707922446433651776092369621326142989794122226113003490741187404849997459969084020087033050531210576668266184699998148348840711175708153610265866056770197075279600573940335350900041612707081831467681137281008835065355835765517837332659348251977537942774328095168806866899287661289640497751983056725407240805256204945169228187637124953624200341895422678005717007757625150799397379319373444954787739626762564051603939573632665435903025725571027968243131965822835114562637455509069672711710255863606169727774641844899943665699890628121490687481978216719482661846582295767623149884999835422210765730447522147247070529595642848260968306314598111658727384235254929025440317627409251140223199913963783328279181270564147835234007290120160001169139888232179035375615411314475272971728410558300220482659925454392822269770971355732276528404455285353898344609111092517995612108233849239514330758081480518969385565992456835495989984741150348939856534843803803400970109582644982293566402228642861644576262624003357559466752728451154963013307671898939042284234039531962070140764481464468571118925571640121449393183894444934497970753123364838794555572274482629155691108217201592825630240150090516311362383508133834143197082791188038937404245164576047335768232675317998608943555265485738607637409927489451435549601803127754374811674728933779018126358910640614225893408881088642833330924573359519918209791353995407664231095832507880985408818092483923343178226797037717114477212100080417219518779788900604398685590585593340209135674243339625569458628960337674017066345267965110534762993290367898881166997454739257827931022547633182974050014084641552202264955789838098528505957716189957691258198332806062190445934149113538771830663813491559205592335623677567054216700600739843859515260603445266746758562602435712748620836126076774634719639349837786349797596427541685985853846497849344126012175118841692970768238840776058471757836704874453680749845501251892257795977185092391048737507445487094088754079177381069434716892045530006097959883538684939406706279109547380968223429065913468990038343640847941704203608497159132564777363398545482697415656962078609311347967307385223636090565453125885839072736485112248327513606421275229969584147345940534248260577703683508817549513953962151585265408766644289733336733082239830041217460984149191865957670033579366603492361737915067494862782362653918917920795238739644321223725285353798428341545227142311020804253806097370843870120342030066252835921944705519813162801439710628325698552035821013211139950292132346390530682667664192095540120805262979783426658871665781444023655685564622399813337966122116182349531304393600874568762115672918160633614583133658879537077598061125296598176409426695879838894481951940891533084658236651513628024235022525979929588952134930522916258680185137634731719843032724928867099539567592675972111574771520304368968169852219810704199727224815075367681075111888968774777396902399857214974282054055450827387013817048779925341879278694220163318385617671596145325587257265310328653969975799646816899914109491209602840727245418375511678211943031046153308172367245903988534132809912339759737628022180472173102434572400058682213184035661242541119833180027208146112377465512977234925240095792511334503688376815147734208711167673882315855295464007823731405752122342366060652504372878434944650273012687259247434168704084624929144333950087916494265781949834588378309462266351132240873442771131754418935998602890629814358439390638848949106448855898889354490601546120333018174634792194126917139447078677288953939984893606715347241442818610254504068387585345740600553967225182495812206533860194041982317599808345725355744487455008307465086553916746330483568480230821883455731561819191478450451504593665222751827190916914867323979123198061765547045674645776652993319303184853219778835213193928453592641529184823302143986264 (RTape.cons false 2 (RTape.cons true 212 (RTape.cons false 2 (RTape.cons true 2 (RTape.cons false 57 (RTape.cons true 10 (RTape.cons false 2 (RTape.cons true 5 (RTape.cons false 2 (RTape.cons true 5 (RTape.cons false 3 (RTape.cons true 5 (RTape.cons false 2 (RTape.cons true 3 (RTape.cons false 7 (RTape.cons true 3 (RTape.cons false 1 (RTape.cons true 3 (RTape.cons false 10 (RTape.cons true 3 (RTape.cons false 3 (RTape.cons true 2 (RTape.cons false 15 (RTape.cons true 10 RTape.nil))))))))))))))))))))))))) +def st_10 : RTape := (RTape.cons true 1 (RTape.cons false 4177236263720042510692459195910769287152494841244238719031716522500259202099147094525540774865801612492881855040068102622182819354272099323434465656525684482582165385751043023173315953194773557618250252424670113520937247097784454073569709612321502036869441567498428152093058406593992085007822867329301751054315088048726439745919153992287234673721229487526031179006548070635583838054600425423722450710357156258682836102499914625870333604778051196479924327817921566296991148715080262825351290863041315453766763968574019037349313799176448843394809434954343477410592555793533038600385781425956697944659487515457115503631864612057949857451115308610461462568779974158514524450926633470237211484173203545874789035997378344543630500555275586236932837672325083264490566968137440691293743943973398994798183258372383780226905280706041445444405521656075141624480773629838434283419024563342362600558758770995817696324107581151361135649592412380213151431670024435506983094103679794848450931203906372377581463893288295464677288703429682943625580986184577279033588789430145481246140703640315203454443055434824964933427266875804646239935373424727239068269893942211914727325282950399875669369620463273563391570169482764544726931593653955065105374786696422013440033935616072702181626454062599765003530888241932477853356841500189029295604722473348266281141669000475713043805452853391599633700069777508154412673447562233913887067755674409641781058599772674122063378635837143785194105546658057386743887885042151559849750664967023944871755761303026368560356979395266062687718823749212981304105864474361969308809392325542555887882026133047621564663018657372627912760870025660917534137015035135004081415462332056141302925553261439730039571174188011414399624250019945812366518885236921582668739030467944285964733870413545857940831910850754790144488026317263486356024766858866228971251630006344621720232554297802904844101874664475406310839903217414869064809761456250777984144469712174065592528357166008836663239668959892197837229743086221655219662391954084329645814539521086799519307430373721072900055450390879004339746080974068122955818424240043183932553325836708011149802322024710783304919363433899837482561901466622578058100181657965774013580689069979497052154916675394662929803717967718829549842445624669309914771455486644905533722070467749270789537940589077300018947836373433620284912187020680311933005263643050354948921109511512389799524567633633512529167989243233577821918174397296237399075334918840372304017854092406176057980278044963325146349298246048545926661619478129699330181525145157402890936284889117737024817487369970195242720154969560834643556425253722820953340135520663891243188040320990560164304924227347735828811314456562856011592274015401721157914709705929421443404722779822771632610469419155257882186322501327507740063389674042366238702191187905001776553742240972624200645967658879961703471369268290622121072814457407505396535800212576644089619925878107775569984529285211796006411827058039828656472076860083696358664782070034801204816795391363646396976004351792079540555515074815205714419912415682464502471027627332361472016375600712118363856778916988282018346068963880203950667393725725400697117418862975414994392339740922028741305421957839674041306161735064987762803446423484647785477620495607190156903227049421103346519600047045872718101585266624863516531337410897692480742688256238868118865068056452710473466946093721760132082534766838697104358506951485692190111017172085675764933992158506777566572135061689147272583862923236625824037949193800057320927641806125868328218073954549080421817528295519710582850446058190299808453523691483067825657379420370317943876136653659657484853138685336666084485850645816190097710261139408704492747501238879386871806045446071494067146906156346831069023337640305190489602653631826980655272548011739351348469848927174548167528763133824848566942794743708700522171964199673444905923890792351165719111266511844352406886612893702733843635889421717424789040887381388399216847671580814307136489988161843074111439107140765565928333117036365096140858532722534294043297007814059826363954357906358998597275548017381322633305502933658789829616429841786409883922627049581676335727838850827901438183559627078863573614332937720755043243231827451218312796933419980223991540806130421309298186638067489691287095415141542250776070234208756492510059875061236225787731837271843610543696712676632318667460528127270384921915541089875446077006698733924708980833492553444222729326299947514931394455942425029408186449661465132844229015043004795467149002424097835247240524534243987401265566792407930184861499413259763286439804878866464220394762463788645594834032086569296934212100930248300031483347062834049116403668076894347829761414898339208466824525523753073922524504208808856639886062806350569538663519293199988399462140555653546750000820451334671573467371505037249716236058635121349549198768931120395009595365255282551889787699292680519225949834215450681678833427241281860417535952413831097561601037811482950196880613173055966866157509472841936255736026748587059800506799850169274333319595595029045977614854933504377893276293162023442479254320103022691078014527062641920557334659957368019518108603600117006765830035735094891973820586331787729713408972995003231954306017684937379815605244297572304907910012378228415478161956587271617490614478223865093027162497514240169661466506919909744319061973925083406653745449562590856631209375987186004671493228078329050012808381539216561854106986760103446001405549267426757667557890929424094816081356702253306267421561222516362725849130139920015621857697632889777294460163343402607881767531097987980712579022375772128603997172847251791372070183708351259924091687548998887782077491843623631307355492519124022626102405513897813764137328082571068762083797209812289774230998371140372967268513526323742714707712486324222623671478726081298379833000588472132760961567122395057095917769376796035482625545591295690942717472955385758074259427379116628089050778999029203741849164170891673740340060292552226457049162779370418904269174979208740734471021418024956739392170445114665300174631329796407057007436062609653165031112219935494921154332935862288414375277984744608323524940287158537240172677710516991212881546763972332318035360569836015478906280494753077691228858502268941171149225713330105585964330662481423138200756854729300548016724255236246391065306797354290407087310534332589630532046966373859194954561773567638404753050754411094924598809601196551518789114446110071401356173115928788570646896492222615236449856160859832536367980965844390536532009547155098348542902214249445801743688309759690778729582984677053484465773925230624922118087227307528208486542992946546657339550837984174790865160191374466291929599772323597111289344219350057708173881685631880165220779271454735650699671480942822474668657002140405666814892673284924803039693143571254521642351576987404258983060703761851451459531256178857673944818598586519497928584409213783604327841390215056139766280096095382135244346004198867082020099792923498535494006533838275262196415410170035943186081392573935198558022850107346198046161505303922302550659929788719570372976343921816135680309241567457882791093443562291609638671588911461029019782797468981419564453758480317588042662279512681253976461680516531776071426578217392200995456905490125016743869427311761687803696661089599864400800910407712685923190555838539818797725386010662806724956092958199504248073256922933803509360609311448295628311094984897313735389382709655170539396724773367387413128435640431992766808983421809421062748008921955864992807521553248372025794228394127058291876102108027226063155238143952432982725623163842126445900209024044059568470834316260366880272646003733932087364032402841349910137513934018556759719089472164754258898307996707879368849333455603445841651104993232189875489056099470368447846322899740154653232454036996099303435864494672158439589784829359598138195427416772554673836901395045848243179575089759995913411734689591786932377269914350152052389543917404349425352302712085377922140403464859951565613497321845059800367381664418615758648172687268638214651888691916835146760963230586604011096233817201266052078268947339636940212757893764371246257306302914420349291273064967742040225804592729523589048480744566359302330644420271582272324996547594779118702091531375803237346937129526600568456001698655886837564108285492871899778536269956437899915905637851098404495912406874038545504225267483132627707908573163585364336900964812700180129983103490659758979322612338957390808313288670127371326113024531444280869959846710731514749810575193885164849300660855439381153198219450601746462904383312735936520296919598668552156562117013041582054643026695313041038434315546421160447368724304524101858335596002668043545189665775850639352346702688532540505160191973597954397281675028634723982878895888466388057576762984728243968103842627420626108425380626802844474179314698998166419524871481817692489130538059511928460644753034336426768693748110015985141916181536939027271506815319647358590451900550637624491797245442270551483825153827482678625191973853893969735196654620411442491850208393204702832675943357376643476214934889480255750621650349701628437720855587753509947005019231427544408945312959654837694799035212486802773472997425034625510036594077553957852828606230573179322383410329504996597449702744425406426313965204518184761409912402498509497799536530660629035549653811301753947074589381637325494425965240934238658833116819216054975350567341410508371768575306929697079927187902813031440400276735970113857346349427890269832265409068970124282908057956274693530976058484563530478266279975858815402912176780131980821439899937023978525720573617856604350156388903425178954377988841135670448998506513854623324016372075795095285906610618407369194947589816872399960130672896175644578503539700968618128936905414067235306746958334378494796014763499402009474958097466412795162696617950550420910534411445347963784653962041186360243491060336758990502713602324765283313461132038698349542055000718476258633849176517405735674391426758633039624293467347390105522745407376185318437009727057903744037922760976252083783275209105459874181534609348555328785083959394776834268357568052364829304914221270154508105146239884759180665405566021546714550494370363612981964639662138149972855608757258185521960074292391295226697248873229576984999477062661934991954313192876199687940071814564430170580492138241385535453631531836071214245693889774153935143870815466215465261009381068370070314825144850531798793159256579151216017076019452185458471514723140979072548028516731281438597540160135583132638783372357097734380508845145945341351527463964010204781701932092787470185024684965030623978688335974267443185424940097199070806927647149270690553180163391318718757535457841197925472356388924756853773919565322832816668583964720926699921211846229887272592302932882932492317071122480141737357598358428447570968861593610480841029506814767325898975917400660574681542718238549082576168528245564908634757239330475715028072485475886545752632609738730029583043686759249746841087813821539637979804208359921457181371728461168565492978256035335217104780071128688294088212721871476824187406065812216556664842551362480083693321476597670743327413494801919895255649990161759398652351241563943406794124607999591524433356614139930696028992684400177997921239104359989551034824738139759054617081745170097818345526503906310222245639612025420164184435482130343862335006254805172262588476251070645179856425285299091501823765545853076666175577631505416506852086777298167449810112994869511949827007133202363641043161271091940116512845778720345146337909138482178882013209391216972670593077691460777716423971965525772302765072884959638196154353644445760489713158236858689431280003572286655240644496915460389279499790527301982211750172311653282218832619712864978998244043123981827781768456546401301257883645643255805304805886142751997760270434252860968148904771501767188229748332589382122956163348229055118513723922702858859626812659274796727302880486772289743584956843564669729326734999164002030214383817083890743697116860537057399610385902327584073073177630812590233438195582374932376794489676968826897693835782258475400459674746280859751513086579872164269406511799713741791127635877323690713616283102302020967867539484522089249095812098794153300684318734968173268113198292257051599395220109390943989360188564406874692295741673424751124917277274068383586246409857167395956807597379686817413427395107140888757953708587388891519122622419874534078366708397461369978332959461158693592565633208602035885371491116413017654824378794888214568431996452313613658249557137113113381546853053924560795139536852801167718411415413015303488495265439973692841301135603347496570686419383935575967559269314397140976916816681742475551329809746282203548626925794108993704263580142962658996031999817632817556276854238267715475426030708402988138050478284086352431928795387256979299101962912768252117931988652053874397703768179776290194002196259155588540260681600916306765836291703802025392847264968458980226944276242236874756548877256097496023386161718797895814323231045239469018725022024107489503728754509892242244825332635854473735575556174560145328939988913555236305483580103884702261862515810648655677501112209711977566417767495053961513727538906046313895826112103086011717728175371894550767935647080111264901971946764399460952450533861930457229525338563319195289028759557032444086402507438000567158455795936046406339684479483458271707934994743516256371974856984321047340321178516546094664369708813955419448688154852032022320876567205540677303441591848551805999605196543455425266510302034469096272612653019662984215508825230358021357938103681882131773890377629454778925962881763079582047165235253369381119502944430442567248929054894960650250913436277498358111655474699626186589396978757913014406184643263222968527249553116209812249069813629900826955218749921403317618402058256089998412468718174171357416407395149928941552601020101945925534330874458116916225354480109819957184444219961194295346691752279985859541631255442559929340581217530363599318243218466361890428824970958240927768522288699774299803338388097893480768573681093558724225741706141096596026678385879048167853200366139758823066775260624543763842608933324530255036398180546061648848088518136263094925217359509923880231942342686740886385892207380618892037212937087609566390691427676231471578362738964943884495807022862163632394301429660505813168909945482485929505073158442232020714738901902817303199964196768941354846370063270178577283165847823426641359139188433379725821585359233841714191002956656183016780028313859334440669532916516567548125617824234491178145428137393903245594885798382986272693875043732024741056923763855038412130354780737772399639993349440577044907987612120303596204872559748530472136839076979588912796133197309553792832374462118393977230985942396157658059870177170774004554702040897530966184194236960527531179446734968430945885647036904465294656091530005551986950352484515967717905315187766302067346029125344363850882451625880801969750758982518172042722895016331804875458846361596315799484724123277641443090529746098337837916952314155857522311125153944024168354436385785752359526285065255279169546107155004666896187138831673621705475692647561259078177947447742326686227537301567497739909356912942342988413293548284664802957649184158411955956338183522563175841801322258247040395856644455451962061282311106203333441374129768726559514090281038740405366207729574730513160633074298908457540986930304652871131837132150713247549162921458874939025808477669781619305193954236100768371173956977855108971907586648558853249104169009954425041195402101827032126853701303338692536695130876278385803827330292171032055412621724128854593910451933364787258298164892225950002777531691987729563986831557254315134795093305510339361200339366055729656415295772825334171491240578058481236141326471783612890111168226635052847023581097739951878323515368830068979922794628023764930333013843730529458664151210299489929233689404710973109973170196468834447508655165491778887854482508305278037774868358524216930002297965882251353089093367457177817738134843352558469044889463115052670273120969043654070984054875143997087218310206195765312479939420552114870374866550025521191149711404001150330434310830683602367514461981296135530281138975870414541795184890485281890063741369285084159299069622357840310707041571505776433074126911967961083982526158984550479477885504600424717674847495341481712780206791592378762489657970494550903087729964054074612584157727896572019341395205278740670625824654688965370903088480533519192316524270519100619974041838195401969229648765141014234512057116225650653292155254836845394081780409450902990731784087758722829238195393516328236012205719569453867145690592908531958975089987443903910329147810504168091116573879397984439150046975644986151295991304451511587711478909579889032178643373952469593400295709247060615101865647431448106177884016313849294113218723112705142427728955026124347000209493453868190759668829757815486223409157373565000378263630308173024892290924227255475309681161923370711667620313102462569436754408035030266420325664734889839392405731770911065710929901096580893844376175075039994429385209898069808647098890794465146036526986699794919669952713603001669924467044891965697515702207041018447570575702913807779036828361139459079212218333008454618897552960390056541597878987389403011158307955953521998239958376911300428169963184615145789063185996239433398321376016910385583993181275415429283740069262766316649409065260369275185240753882585541699151053863598405075833790776802088269040181428513160433072269540808113742282899638887977686782274039967271681902750092527741471639150631278526556254063855053019394061837068379875093624529014277237406705882472710045338600720277068415126710856787787150194608975028707268221461156040476649014109337532044519620757262015810788004160566588386393527123594461910786155561611661428448553542929810466369617477167737281553018205352211520739057001026421188975537215798888787236900978390148264884764995802744377845635355412619758997853967673206670572369529734099631709613347565895173281277237946386977930679629068754607601548760702035717864687769862829153664440337462804041344714513662197006604981730038479275982006220101809586047050248975965279999075452987525727323023254633193630809691479646507215998744010996207219283014219554621137951183855048222323816765651816479973851625305701687869505056792972420337624956276294031041206130187752083723305762465705925052179792228153934370858717911944920736212256997261839528525939992210988157404133068170717420186289274350572625601770320931696491928086457328257030155287781323367834505336753272218895271455194084027469644719897750972392396210890094580010900205997644826711720953614399826293900312046200379026263519208730439889600939948347424467238187261251716145145982007636514504205092190049804927763129320357067478941634683029347475498356955442533216808598728166857196160415209977187980075474400339317450960104718562972435831789077960669900868103437086502204000798472734695592550613122564204902674907470305194390005414565739264115231005394598627312715995144703970221081697137249086983277129573937328792156818531172855578823093959734417909794068748524945730290241554592187104471443133491262866825399140917595546908514264432577088901349669577735496897007175372352891296689386885502045913932718799550485143071533835638368114139710133194231997047636042767079811935737403075374848926948607440028152973112964218721395783602322817188311121812120656550340207985973118091932344509822811970942902877580763965972105180758174968199343712174686609694267145977153870664678350205265183778199347121354641639860935980119689532877548639969538849556709872491846972490435238952520551402205963403589057033052120619654011493896150351992608880758550676227735744440086879886833422029722633606977122081090529508187420787456773419465022422374028226487695814975661677417020578623109181553458949278741376496005064073982645894044223660685751013509034722172856186858958511369641877654964963164456676467220167530021562290152287423569524438490061156472652164028776878761252688683975883403591875975243982805432693194397989318329479325926641977546617267614102945018002845329859501339060346884798178824086996810706540394438974660850402694271666900069920311928074730034189737963997950152432098456204430145359004857724590688028186447899483399403695861726694285099835120401628687558310148301677496413023005465167584018687987313414587299193088008074941749746628210483611890075608723952366954062502289274105196924971126630313364428893250527805883500897971898728464301396532195209974926860656947855817656326610659220113919722823911446255215159024069658820923903917274773574191131171638828997423978306013552715947222963498471578957733120030637955468813765636636966008745731028987960928910174620530711330555184663726634233506019916199373890397966318076319248858755814885191078166320090490815950330120006149226428121702174567954231198264405770744676061159863385973822535001489517413751376244080918674818643952699619707105561712347614678759369103501900865569934415332507688810813050433362553798862324139902010781529798249086513019940875356248093608714847356421616122738557779607879732111409161458167084063911277917232777147987773913631422722607498656003154973509003352072707625863287947231069705454646313077938809898219883502932874639284825425030712894665120346332813854404634372066544010410789172303466039403157655049809261791048793171089721268499605672340175107110280112416148329943059194631816643028662889405499024895081862010533294869678287465780731706153630260566605142363024839063184597727600096046421818708832812862845798579735738318426207207830567745527699187895569583810364858398592760605326201678564977640456621608014638106367301804445557043850385700319902491020710897783444627236497506461245363904925581488770718522792418511742965912543835753203609925753307543718374807351737482215004775365039037166648798140678341352525967009325817140846990151064391336189593102469137304504366705228845876648723250877327833045712301006187721747999254976173291195029265155641063813948774115335697689564997821741499479578601286002850421807252981561682558783688126948634026350470401621252005184101118775434738187843540487913744896046025926918109180431035150765042417029249367865637471260036221230182251006499383465314785117789198801167218069319250148820238529281704900074087053181885000737730978831966536649918748490041307067369020322129313147049572909031757683652575186679027843968042842216928609698754934979784685753100207467194625468603475949270919331207253147404110277254304780790083444260525419565222101968063621488110842413518120600859323518772269809906736260888383237705765507787418693326418234086720034364467133770240244813183371930337512244801368828359916387724921267640965827309495292095741903639854715333041439183543764134826707985228808427874596476358716799144534234159211716344449034750513366616792783474485504587304513420847756145951292064877903806754017209493223027877192798530995481129263186921072543043316724572959652948994200786983558335397376752139385924863680388984592104567284453180337584946483655931324375469579347105584243374357771478603952418103156017257131326778310892216880670859670983066430685640439350008269428311540098884117014028418240041181989041412727693610870081615569719115371186014034925810375670281316835484245106318944 (RTape.cons true 5 (RTape.cons false 2 (RTape.cons true 4 (RTape.cons false 4 (RTape.cons true 3 (RTape.cons false 7 (RTape.cons true 3 (RTape.cons false 1 (RTape.cons true 3 (RTape.cons false 5 (RTape.cons true 8 (RTape.cons false 4 (RTape.cons true 3 (RTape.cons false 8 (RTape.cons true 3 (RTape.cons false 2 (RTape.cons true 6 (RTape.cons false 4 (RTape.cons true 6 (RTape.cons false 4 (RTape.cons true 6 (RTape.cons false 4 (RTape.cons true 6 RTape.nil))))))))))))))))))))))))) + +set_option Elab.async false + +macro "fast_rfl" : tactic => `(tactic| decide +kernel) + +theorem step_0 : is_running_eq (run_chunk 8 st_0) st_1 = true := by fast_rfl +theorem step_1 : is_running_eq (run_chunk 8 st_1) st_2 = true := by fast_rfl +theorem step_2 : is_running_eq (run_chunk 8 st_2) st_3 = true := by fast_rfl +theorem step_3 : is_running_eq (run_chunk 8 st_3) st_4 = true := by fast_rfl +theorem step_4 : is_running_eq (run_chunk 8 st_4) st_5 = true := by fast_rfl +theorem step_5 : is_running_eq (run_chunk 8 st_5) st_6 = true := by fast_rfl +theorem step_6 : is_running_eq (run_chunk 8 st_6) st_7 = true := by fast_rfl +theorem step_7 : is_running_eq (run_chunk 8 st_7) st_8 = true := by fast_rfl +theorem step_8 : is_running_eq (run_chunk 8 st_8) st_9 = true := by fast_rfl +theorem step_9 : is_running_eq (run_chunk 8 st_9) st_10 = true := by fast_rfl +theorem step_10 : is_halted (run_chunk 8 st_10) = true := by fast_rfl + +theorem halt_10 {tail : zB} (ht : @Valid tail st_10) : + IsHaltFrom (default <{{C}} denote_tape_tail tail st_10) := finish_chunk step_10 ht +theorem halt_9 {tail : zB} (ht : @Valid tail st_9) : + IsHaltFrom (default <{{C}} denote_tape_tail tail st_9) := chain_chunk step_9 halt_10 ht +theorem halt_8 {tail : zB} (ht : @Valid tail st_8) : + IsHaltFrom (default <{{C}} denote_tape_tail tail st_8) := chain_chunk step_8 halt_9 ht +theorem halt_7 {tail : zB} (ht : @Valid tail st_7) : + IsHaltFrom (default <{{C}} denote_tape_tail tail st_7) := chain_chunk step_7 halt_8 ht +theorem halt_6 {tail : zB} (ht : @Valid tail st_6) : + IsHaltFrom (default <{{C}} denote_tape_tail tail st_6) := chain_chunk step_6 halt_7 ht +theorem halt_5 {tail : zB} (ht : @Valid tail st_5) : + IsHaltFrom (default <{{C}} denote_tape_tail tail st_5) := chain_chunk step_5 halt_6 ht +theorem halt_4 {tail : zB} (ht : @Valid tail st_4) : + IsHaltFrom (default <{{C}} denote_tape_tail tail st_4) := chain_chunk step_4 halt_5 ht +theorem halt_3 {tail : zB} (ht : @Valid tail st_3) : + IsHaltFrom (default <{{C}} denote_tape_tail tail st_3) := chain_chunk step_3 halt_4 ht +theorem halt_2 {tail : zB} (ht : @Valid tail st_2) : + IsHaltFrom (default <{{C}} denote_tape_tail tail st_2) := chain_chunk step_2 halt_3 ht +theorem halt_1 {tail : zB} (ht : @Valid tail st_1) : + IsHaltFrom (default <{{C}} denote_tape_tail tail st_1) := chain_chunk step_1 halt_2 ht +theorem halt_0 {tail : zB} (ht : @Valid tail st_0) : + IsHaltFrom (default <{{C}} denote_tape_tail tail st_0) := chain_chunk step_0 halt_1 ht + +end + + + +theorem is_halt : IsHalt target := by + have h_seed_pad_eq : denote_tape_tail default st_0 = denote_tape_tail default seed := by + simp [st_0, seed, denote_tape_tail] + have h_valid_0 : @Valid default st_0 := by + refine valid_cons_true (by decide) (head_zero_cons_false (by decide) _) ?_ + refine valid_cons_false (by decide) ?_ + refine valid_cons_true (by decide) (head_zero_cons_false (by decide) _) ?_ + exact valid_cons_false (by decide) head_zero_nil + have h_halt_0 : IsHaltFrom (default <{{C}} denote_tape_tail default st_0) := halt_0 h_valid_0 + rw [h_seed_pad_eq] at h_halt_0 + exact halt_from_trans init_to_seed h_halt_0 + +end BusyBeaver.M_1RB1RE_1LC0LB_1LD1LC_0RA1RF_1RD1RE_HHH1LB diff --git a/BusyBeaver/BB6/Halt/M_1RB1RE_1LC0RC_0RA0LD_1LB1LE_0RC1LF_HHH1RA.lean b/BusyBeaver/BB6/Halt/M_1RB1RE_1LC0RC_0RA0LD_1LB1LE_0RC1LF_HHH1RA.lean new file mode 100644 index 00000000..f0135218 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB1RE_1LC0RC_0RA0LD_1LB1LE_0RC1LF_HHH1RA.lean @@ -0,0 +1,101 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.RleCarryData + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.M_1RB1RE_1LC0RC_0RA0LD_1LB1LE_0RC1LF_HHH1RA + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RE_1LC0RC_0RA0LD_1LB1LE_0RC1LF_HHH1RA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +namespace Solution + +open Counter BusyBeaver.RleCarryEngine + +def σ_BCADFE : Fin 6 → Fin 6 + | 0 => 1 + | 1 => 2 + | 2 => 0 + | 3 => 4 + | 4 => 3 + | 5 => 5 + +theorem tableIso_144_521 : ∀ (q : Fin 6) (a : Fin 2), + target_tm (σ_BCADFE q) a = (tm521 q a).map (conjOut σ_BCADFE true) + | 0, 0 => rfl + | 0, 1 => rfl + | 1, 0 => rfl + | 1, 1 => rfl + | 2, 0 => rfl + | 2, 1 => rfl + | 3, 0 => rfl + | 3, 1 => rfl + | 4, 0 => rfl + | 4, 1 => rfl + | 5, 0 => rfl + | 5, 1 => rfl + +theorem step_conj_144 (c : Cfg (Fin 2) (Fin 6)) : + step target_tm (conjCfg σ_BCADFE true c) = (step tm521 c).map (conjCfg σ_BCADFE true) := + step_conj_of_tableIso tableIso_144_521 c + +theorem multiStep_conj_144 (c : Cfg (Fin 2) (Fin 6)) (k : ℕ) : + multiStep target_tm (conjCfg σ_BCADFE true c) k = + (multiStep tm521 c k).map (conjCfg σ_BCADFE true) := + multiStep_conj_of_tableIso tableIso_144_521 c k + +-- `bmultiStep_sound` reduces 1,901 TM steps via `rfl`. +set_option maxRecDepth 2000000 in +theorem init_to_initRle144 : + (init []) [target_tm]⊢* + (conjCfg σ_BCADFE true (carryCfg tm521 (evalRleAux default initRle) (evalWK 1))) := by + have hstep : (evalBCfg ⟨A, 0, [], []⟩) [target_tm]⊢^{1901} + (evalBCfg ⟨C, 1, + [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1], + [0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1]⟩) := + Counter.bmultiStep_sound (tm := target_tm) 1901 ⟨A, 0, [], []⟩ + ⟨C, 1, + [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1], + [0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1]⟩ rfl + exact ⟨1901, hstep⟩ + +end Solution + +public section + +open Solution Counter BusyBeaver.RleCarryEngine in +theorem is_halt : IsHalt target := by + rcases runCarryChunks_sound (target_tm := tm521) 28 500 initRle 1 + runCarryChunks_28_500 with ⟨cfg', ⟨k, hk⟩, hnone⟩ + have hk144 : + (conjCfg σ_BCADFE true (carryCfg tm521 (evalRleAux default initRle) (evalWK 1))) + [target_tm]⊢* (conjCfg σ_BCADFE true cfg') := by + refine ⟨k, ?_⟩ + rw [multiStep_conj_144, hk] + rfl + have hnone144 : (step target_tm (conjCfg σ_BCADFE true cfg')).isNone := by + rw [step_conj_144] + cases hstep : step tm521 cfg' with + | none => rfl + | some val => rw [hstep] at hnone; contradiction + exact ⟨conjCfg σ_BCADFE true cfg', stepStar_trans init_to_initRle144 hk144, hnone144⟩ + +end + +end BusyBeaver.M_1RB1RE_1LC0RC_0RA0LD_1LB1LE_0RC1LF_HHH1RA diff --git a/BusyBeaver/BB6/Halt/M_1RB1RE_1RC1LE_1LD0RA_1LF0LA_1LB0LC_HHH1RA.lean b/BusyBeaver/BB6/Halt/M_1RB1RE_1RC1LE_1LD0RA_1LF0LA_1LB0LC_HHH1RA.lean new file mode 100644 index 00000000..296d1500 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB1RE_1RC1LE_1LD0RA_1LF0LA_1LB0LC_HHH1RA.lean @@ -0,0 +1,2670 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Excursion +public import BusyBeaver.Calculi.Longitudinal + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1RE_1RC1LE_1LD0RA_1LF0LA_1LB0LC_HHH1RA + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RE_1RC1LE_1LD0RA_1LF0LA_1LB0LC_HHH1RA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {zG_ zL_ α β γ : Type*} [Inhabited zG_] [Inhabited zL_] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +set_option maxHeartbeats 8000000 +set_option maxRecDepth 4000000 +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0=some config:=rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1=step M config:=rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1)=Option.bind (multiStep M config n) (step M):= by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default=default:= by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head=0:=rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail=default:=rfl +@[simp] theorem append_nil (s : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> s=s:=rfl +@[simp] theorem append_cons (a : Fin 2) (l : List (Fin 2)) (s : ListBlank (Fin 2)) : + (a :: l) +> s=a >> (l +> s):=rfl +@[simp] theorem append_assoc (l1 l2 : List (Fin 2)) (s : ListBlank (Fin 2)) : + (l1 ++ l2) +> s=l1 +> (l2 +> s):= by + induction l1 with + | nil => rfl + | cons a l1 ih => simp [ih] +@[simp] theorem pow_zero_list (l : List α) : l ^ (0 : ℕ)=[]:=rfl +@[simp] theorem pow_succ_list (l : List α) (n : ℕ) : l ^ (n + 1)=l ++ l ^ n:=rfl +theorem qb (l : List α) (m n : ℕ) : l ^ (m + n)=l ^ m ++ l ^ n:= by + induction m with + | zero => simp [Nat.zero_add] + | succ m ih => simp [pow_succ_list,Nat.succ_add,ih,List.append_assoc] +theorem pow_shift (l : List α) (n : ℕ) : l ^ n ++ l=l ^ (n + 1):= by + induction n with + | zero => simp [pow_succ_list] + | succ n ih => simp [pow_succ_list,List.append_assoc,ih] +@[simp] theorem nil_pow_list (n : ℕ) : ([] : List α) ^ n=[]:= by + induction n with + | zero => rfl + | succ n ih => exact ih +theorem commute_power {x v w : List (Fin 2)} {a b : ℕ} + (h : x ++ v ^ a=w ^ b ++ x) (k : ℕ) : + x ++ v ^ (k * a)=w ^ (k * b) ++ x:= + BusyBeaver.Excursion.commute_pow_left h k +theorem qD {w : List (Fin 2)} (h : BusyBeaver.Longitudinal.BoundedConfig.all0 w=true) : + w +> default=default:= + BusyBeaver.Longitudinal.BoundedConfig.all0_spec h +theorem qJ {w : List (Fin 2)} (h : BusyBeaver.Longitudinal.BoundedConfig.all0 w=true) (n : ℕ) : + (w ^ n) +> default=default:= by + induction n with + | zero => rfl + | succ n ih => + rw [pow_succ_list,append_assoc,ih,qD h] +theorem qA {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢^{1} c₂:= by simp [h] +theorem ql {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢* c₂:=⟨1,qA tm c₁ c₂ h⟩ +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m)=(multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m):= by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,multiStep_succ,ih,Option.bind_assoc] + simp_rw [multiStep_succ] +theorem qu {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c3 : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c3) : + c₁ [tm]⊢^{n+m} c3:= by + rw [multiStep_add,h₁]; simp [h₂] +theorem q0 {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c3) : c₁ [tm]⊢* c3:= by + obtain ⟨n,hn⟩:=h₁; obtain ⟨m,hm⟩:=h₂ + exact ⟨n + m,qu tm c₁ c₂ c3 n m hn hm⟩ +theorem qE {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂:= by obtain ⟨n,_,hn⟩:=h; exact ⟨n,hn⟩ +theorem qm {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c3) : c₁ [tm]⊢⁺ c3:= by + obtain ⟨n,n_pos,hn⟩:=h₁; obtain ⟨m,hm⟩:=h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),qu tm c₁ c₂ c3 n m hn hm⟩ +theorem qt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c3) : c₁ [tm]⊢⁺ c3 := + qm (step_stepPlus tm c₁ c₂ h₁) h₂ +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step_tm" : tactic => + `(tactic| (try refine qE ?_) <;> + refine qt (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,zero_cons_default,default_head,default_tail]) +macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm))) +macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) +macro "execute90" : tactic => + `(tactic| execute <;> execute) +def q4 (n : ℕ) (f : ℕ → α) : α := + Nat.casesOn n (f Nat.zero) (fun m => f (Nat.succ m)) +@[simp] theorem strictNat_eq (n : ℕ) (f : ℕ → α) : q4 n f=f n:= by + cases n <;> rfl +def W : List (Fin 2):=[1,1,1,1,0,1,1,1,1,1] +inductive Digit where + | D0 | D1 | D2 | D3 | D4 | D5 +deriving DecidableEq +def qP (d : Digit) (f : Digit → α) : α := + match d with + | .D0 => f .D0 + | .D1 => f .D1 + | .D2 => f .D2 + | .D3 => f .D3 + | .D4 => f .D4 + | .D5 => f .D5 +@[simp] theorem strictDigit_eq (d : Digit) (f : Digit → α) : qP d f=f d:= by + cases d <;> rfl +def Digit.index : Digit → ℕ + | .D0 => 0 | .D1 => 1 | .D2 => 2 | .D3 => 3 | .D4 => 4 | .D5 => 5 +def qn : Digit → List (Fin 2) + | .D0 => [0,1] + | .D1 => [1,1,1,1] + | .D2 => [0,1,1,1,1,1] + | .D3 => [1,1,1,1,1,1,1,1] + | .D4 => [0,1,1,1,1,1,1,1,1,1] + | .D5 => [1,1,1,1,1,1,1,1,1,1,1,1] +def next : Digit → Digit + | .D0 => .D1 | .D1 => .D2 | .D2 => .D3 | .D3 => .D4 | .D4 => .D5 | .D5 => .D0 +def take : Digit → ℕ + | .D1 | .D3 => 1 + | _ => 0 +def give : Digit → ℕ + | .D1 | .D3 | .D5 => 1 + | _ => 0 +def qL : Digit → ℕ + | .D5 => 1 + | _ => 0 +def qd (tm : Machine (Fin 2) (Fin 6)) (q : Fin 6) : ℕ → ListBlank (Fin 2) → ListBlank (Fin 2) → Prop + | 0,r,r' => r=r' + | t + 1,r,r' => + ∃ r1,(∀ l,(([1,0,1] +> l) {{q}}> r) [tm]⊢* (l <{{q}} ([1] +> r1))) ∧ + qd tm q t r1 r' +theorem sideCalls_add {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} {t u : ℕ} {r1 r2 r3 : ListBlank (Fin 2)} + (h₁ : qd tm q t r1 r2) (h₂ : qd tm q u r2 r3) : + qd tm q (t + u) r1 r3:= by + induction t generalizing r1 with + | zero => + rw [Nat.zero_add] + change r1=r2 at h₁ + subst h₁ + exact h₂ + | succ t ih => + rcases h₁ with ⟨rm,hstep,hrest⟩ + rw [Nat.succ_add] + exact ⟨rm,hstep,ih hrest⟩ +theorem qQ {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} {t u : ℕ} {r1 r3 : ListBlank (Fin 2)} + (h : qd tm q (t + u) r1 r3) : + ∃ r2,qd tm q t r1 r2 ∧ qd tm q u r2 r3:= by + induction t generalizing r1 with + | zero => + rw [Nat.zero_add] at h + exact ⟨r1,rfl,h⟩ + | succ t ih => + rw [Nat.succ_add] at h + rcases h with ⟨rm,hstep,hrest⟩ + rcases ih hrest with ⟨r2,h₁,h₂⟩ + exact ⟨r2,⟨rm,hstep,h₁⟩,h₂⟩ +def q2 (tm : Machine (Fin 2) (Fin 6)) (q : Fin 6) (t u : ℕ) (w1 w2 : List (Fin 2)) : Prop := + ∀ r1 r2,qd tm q u r1 r2 → qd tm q t (w1 +> r1) (w2 +> r2) +theorem qg (tm : Machine (Fin 2) (Fin 6)) (q : Fin 6) (w : List (Fin 2)) : + q2 tm q 0 0 w w:= by + intro r1 r2 h + change r1=r2 at h + subst h + rfl +theorem segCalls_nil (tm : Machine (Fin 2) (Fin 6)) (q : Fin 6) (t : ℕ) : + q2 tm q t t [] []:= by + intro r1 r2 h + exact h +theorem q6 {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} {t u v : ℕ} + {w1 w2 v1 v2 : List (Fin 2)} + (h₁ : q2 tm q t u w1 w2) (h₂ : q2 tm q u v v1 v2) : + q2 tm q t v (w1 ++ v1) (w2 ++ v2):= by + intro r1 r2 hr + rw [append_assoc,append_assoc] + exact h₁ (v1 +> r1) (v2 +> r2) (h₂ r1 r2 hr) +theorem qB {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} {t1 u1 t2 u2 : ℕ} + {w1 w2 w3 : List (Fin 2)} + (h₁ : q2 tm q t1 u1 w1 w2) (h₂ : q2 tm q t2 u2 w2 w3) : + q2 tm q (t1 + t2) (u1 + u2) w1 w3:= by + intro r1 r3 hr + rcases qQ hr with ⟨r2,hr₁,hr₂⟩ + exact sideCalls_add (h₁ r1 r2 hr₁) (h₂ r2 r3 hr₂) +theorem qj {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} {w1 w2 : List (Fin 2)} + (h : ∀ l r,(([1,0,1] +> l) {{q}}> (w1 +> r)) [tm]⊢* (l <{{q}} ([1] +> w2 +> r))) : + q2 tm q 1 0 w1 w2:= by + intro r1 r2 hr + change r1=r2 at hr + subst hr + exact ⟨w2 +> r1,fun l => h l r1,rfl⟩ +theorem qG {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} {w1 w_mid w2 : List (Fin 2)} + (hR : ∀ l r,(([1,0,1] +> l) {{q}}> (w1 +> r)) [tm]⊢* (([1,0,1] +> w_mid +> l) {{q}}> r)) + (hL : ∀ l r,((w_mid +> l) <{{q}} ([1] +> r)) [tm]⊢* (l <{{q}} ([1] +> w2 +> r))) : + q2 tm q 1 1 w1 w2:= by + intro r1 r2 hr + rcases hr with ⟨r',hcall,rfl⟩ + refine ⟨w2 +> r',fun l => ?_,rfl⟩ + exact q0 (hR l r1) (q0 (hcall (w_mid +> l)) (hL l r')) +theorem wall_n {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (hwall1 : q2 tm q 1 1 W W) (n : ℕ) : + q2 tm q 1 1 (W ^ n) (W ^ n):= by + induction n with + | zero => exact segCalls_nil tm q 1 + | succ n ih => + rw [pow_succ_list] + exact q6 hwall1 ih +theorem walls {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (hwall1 : q2 tm q 1 1 W W) (t n : ℕ) : + q2 tm q t t (W ^ n) (W ^ n):= by + induction t with + | zero => exact qg tm q (W ^ n) + | succ t ih => + have h1:=qB (wall_n hwall1 n) ih + rwa [Nat.add_comm 1 t] at h1 +theorem prefix_rule {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (hwall1 : q2 tm q 1 1 W W) + {t u a b c : ℕ} {p p' : Digit} + (h : q2 tm q t u (qn p ++ W ^ b) (W ^ a ++ qn p' ++ W ^ c)) (k : ℕ) : + q2 tm q t u (W ^ k ++ (qn p ++ W ^ b)) (W ^ (k + a) ++ qn p' ++ W ^ c):= by + have hw:=walls hwall1 t k + have hc:=q6 hw h + simpa only [qb,List.append_assoc] using hc +structure Effect where + phase : Digit + used : ℕ + given : ℕ + sent : ℕ +deriving DecidableEq +def qx : Digit → ℕ → Effect + | p,0 => ⟨p,0,0,0⟩ + | p,t + 1 => + let a:=qx (next p) t + ⟨a.phase,take p + a.used,give p + a.given,qL p + a.sent⟩ +theorem total_spec {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (hwall1 : q2 tm q 1 1 W W) + (hone : ∀ p n,q2 tm q 1 (qL p) (qn p ++ W ^ (take p + n)) (W ^ (give p) ++ qn (next p) ++ W ^ n)) + (t : ℕ) (p : Digit) (n : ℕ) : + let a:=qx p t + q2 tm q t a.sent (qn p ++ W ^ (a.used + n)) (W ^ a.given ++ qn a.phase ++ W ^ n):= by + induction t generalizing p n with + | zero => + dsimp [qx] + simpa only [Nat.zero_add,pow_zero_list,List.nil_append] using qg tm q (qn p ++ W ^ n) + | succ t ih => + dsimp [qx] + have h1:=hone p ((qx (next p) t).used + n) + have h2:=prefix_rule hwall1 (ih (next p) n) (give p) + rw [← List.append_assoc] at h2 + have h3:=qB h1 h2 + rw [Nat.add_comm 1 t,← Nat.add_assoc] at h3 + exact h3 +theorem total_add (p : Digit) (t u : ℕ) : + qx p (t + u) = + let a:=qx p t + let b:=qx a.phase u + ⟨b.phase,a.used + b.used,a.given + b.given,a.sent + b.sent⟩:= by + induction t generalizing p with + | zero => + rw [Nat.zero_add] + dsimp only [qx] + rcases qx p u with ⟨ph,us,gv,sn⟩ + simp only [Nat.zero_add] + | succ t ih => + rw [Nat.succ_add] + dsimp only [qx] + rw [ih (next p)] + dsimp only + congr 1 <;> omega +theorem total_six (p : Digit) : qx p 6=⟨p,2,3,1⟩:= by + cases p <;> rfl +theorem total_period (p : Digit) (k r : ℕ) : + qx p (k * 6 + r) = + let a:=qx p r + ⟨a.phase,k * 2 + a.used,k * 3 + a.given,k + a.sent⟩:= by + induction k with + | zero => + simp only [Nat.zero_mul,Nat.zero_add] + | succ k ih => + have h_eq : (k + 1) * 6 + r=6 + (k * 6 + r):= by omega + rw [h_eq,total_add,total_six] + dsimp only + rw [ih] + dsimp only + congr 1 <;> omega +def qx_fast : Digit → ℕ → Effect + | .D0,0 => ⟨.D0,0,0,0⟩ | .D0,1 => ⟨.D1,0,0,0⟩ | .D0,2 => ⟨.D2,1,1,0⟩ | .D0,3 => ⟨.D3,1,1,0⟩ | .D0,4 => ⟨.D4,2,2,0⟩ | .D0,5 => ⟨.D5,2,2,0⟩ + | .D1,0 => ⟨.D1,0,0,0⟩ | .D1,1 => ⟨.D2,1,1,0⟩ | .D1,2 => ⟨.D3,1,1,0⟩ | .D1,3 => ⟨.D4,2,2,0⟩ | .D1,4 => ⟨.D5,2,2,0⟩ | .D1,5 => ⟨.D0,2,3,1⟩ + | .D2,0 => ⟨.D2,0,0,0⟩ | .D2,1 => ⟨.D3,0,0,0⟩ | .D2,2 => ⟨.D4,1,1,0⟩ | .D2,3 => ⟨.D5,1,1,0⟩ | .D2,4 => ⟨.D0,1,2,1⟩ | .D2,5 => ⟨.D1,1,2,1⟩ + | .D3,0 => ⟨.D3,0,0,0⟩ | .D3,1 => ⟨.D4,1,1,0⟩ | .D3,2 => ⟨.D5,1,1,0⟩ | .D3,3 => ⟨.D0,1,2,1⟩ | .D3,4 => ⟨.D1,1,2,1⟩ | .D3,5 => ⟨.D2,2,3,1⟩ + | .D4,0 => ⟨.D4,0,0,0⟩ | .D4,1 => ⟨.D5,0,0,0⟩ | .D4,2 => ⟨.D0,0,1,1⟩ | .D4,3 => ⟨.D1,0,1,1⟩ | .D4,4 => ⟨.D2,1,2,1⟩ | .D4,5 => ⟨.D3,1,2,1⟩ + | .D5,0 => ⟨.D5,0,0,0⟩ | .D5,1 => ⟨.D0,0,1,1⟩ | .D5,2 => ⟨.D1,0,1,1⟩ | .D5,3 => ⟨.D2,1,2,1⟩ | .D5,4 => ⟨.D3,1,2,1⟩ | .D5,5 => ⟨.D4,2,3,1⟩ + | p,n + 6 => qx p (n + 6) +theorem qx_fast_eq (p : Digit) (r : ℕ) : qx_fast p r=qx p r:= by + cases p <;> rcases r with _ | _ | _ | _ | _ | _ | r <;> rfl +def qy (p : Digit) (t : ℕ) : Effect := + q4 (t / 6) (fun k => + q4 (t % 6) (fun r => + match qx_fast p r with + | ⟨ph,u,g,s⟩ => + q4 (k * 2 + u) (fun u' => + q4 (k * 3 + g) (fun g' => + q4 (k + s) (fun s' => + ⟨ph,u',g',s'⟩))))) +theorem totalN_spec (p : Digit) (t : ℕ) : qy p t=qx p t:= by + unfold qy + simp only [strictNat_eq,qx_fast_eq] + have h_div : t=(t / 6) * 6 + t % 6:=(Nat.div_add_mod' t 6).symm + conv_rhs => rw [h_div,total_period] +theorem totalN_rule {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (hwall1 : q2 tm q 1 1 W W) + (hone : ∀ p n,q2 tm q 1 (qL p) (qn p ++ W ^ (take p + n)) (W ^ (give p) ++ qn (next p) ++ W ^ n)) + (p : Digit) (t n : ℕ) (h : (qy p t).used ≤ n) : + let a:=qy p t + q2 tm q t a.sent (qn p ++ W ^ n) (W ^ a.given ++ qn a.phase ++ W ^ (n - a.used)):= by + dsimp only + have h_spec:=total_spec hwall1 hone t p (n - (qy p t).used) + rw [← totalN_spec p t] at h_spec + dsimp only at h_spec + have h_add : (qy p t).used + (n - (qy p t).used)=n:=Nat.add_sub_of_le h + rwa [h_add] at h_spec +abbrev qv:=List (Digit × ℕ) +def q9 : qv → List (Fin 2) + | [] => [] + | (p,n) :: xs => qn p ++ W ^ n ++ q9 xs +def qU : ℕ → qv → Option (ℕ × qv) + | t,[] => if Nat.beq t 0 then some (0,[]) else none + | t,(p,n) :: xs => + if Nat.beq t 0 then some (0,(p,n) :: xs) + else + match qy p t with + | ⟨ph,u,g,s⟩ => + if Nat.ble u n then + match qU s xs with + | some (e,ys) => + q4 (n - u + e) (fun m => + some (g,(ph,m) :: ys)) + | none => none + else none +theorem batch_spec {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (hwall1 : q2 tm q 1 1 W W) + (hone : ∀ p n,q2 tm q 1 (qL p) (qn p ++ W ^ (take p + n)) (W ^ (give p) ++ qn (next p) ++ W ^ n)) + (t : ℕ) (xs : qv) (e : ℕ) (ys : qv) (h : qU t xs=some (e,ys)) : + q2 tm q t 0 (q9 xs) (W ^ e ++ q9 ys):= by + induction xs generalizing t e ys with + | nil => + unfold qU at h + split_ifs at h with ht + injection h with hpair + injection hpair with he hys + subst he hys + have ht0 : t=0:=Nat.beq_eq.mp ht + subst ht0 + exact qg tm q [] + | cons pn xs ih => + rcases pn with ⟨p,n⟩ + unfold qU at h + split_ifs at h with ht0 + · injection h with hpair + injection hpair with he hys + subst he hys + have ht_eq : t=0:=Nat.beq_eq.mp ht0 + subst ht_eq + simpa only [pow_zero_list,List.nil_append] using qg tm q (q9 ((p,n) :: xs)) + · dsimp only at h + split_ifs at h with hle + cases hb : qU (qy p t).sent xs with + | none => rw [hb] at h; contradiction + | some eys => + rcases eys with ⟨e',ys'⟩ + rw [hb] at h + simp only [strictNat_eq] at h + injection h with hpair + injection hpair with he hys + subst he hys + have h1:=totalN_rule hwall1 hone p t n (Nat.ble_eq.mp hle) + have h2:=ih (qy p t).sent e' ys' hb + have h3:=q6 h1 h2 + simpa only [q9,qb,List.append_assoc] using h3 +theorem calls_spec {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (hemit : ∀ r,(default <{{q}} ([1] +> r)) [tm]⊢* (([1,0,1] +> default) {{q}}> r)) + (t : ℕ) (r r' : ListBlank (Fin 2)) (h : qd tm q t r r') : + (([1,0,1] +> default) {{q}}> r) [tm]⊢* (([1,0,1] +> default) {{q}}> r'):= by + induction t generalizing r with + | zero => + change r=r' at h + subst h + exact ⟨0,rfl⟩ + | succ t ih => + rcases h with ⟨r1,hstep,hrest⟩ + exact q0 (hstep default) (q0 (hemit r1) (ih r1 hrest)) +theorem batch_root {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (hemit : ∀ r,(default <{{q}} ([1] +> r)) [tm]⊢* (([1,0,1] +> default) {{q}}> r)) + (hwall1 : q2 tm q 1 1 W W) + (hone : ∀ p n,q2 tm q 1 (qL p) (qn p ++ W ^ (take p + n)) (W ^ (give p) ++ qn (next p) ++ W ^ n)) + (t : ℕ) (xs : qv) (e : ℕ) (ys : qv) (k : ℕ) (r : ListBlank (Fin 2)) + (h : qU t xs=some (e,ys)) : + (([1,0,1] +> default) {{q}}> ((W ^ k) +> (q9 xs) +> r)) [tm]⊢* + (([1,0,1] +> default) {{q}}> ((W ^ (k + e)) +> (q9 ys) +> r)):= by + apply calls_spec hemit t + have hw:=walls hwall1 t k + have hb:=batch_spec hwall1 hone t xs e ys h + have hc:=q6 hw hb r r rfl + simpa only [qb,List.append_assoc,append_assoc] using hc +abbrev Runs:=List (List (Fin 2) × ℕ) +def q3 (r : Runs) (f : Runs → α) : α := + match r with + | [] => f [] + | head :: tail => f (head :: tail) +@[simp] theorem strictRuns_eq (r : Runs) (f : Runs → α) : q3 r f=f r:= by + cases r <;> rfl +def Runs.denote : Runs → ListBlank (Fin 2) + | [] => default + | (w,n) :: xs => (w ^ n) +> Runs.denote xs +def Runs.push (w : List (Fin 2)) (n : ℕ) (xs : Runs) : Runs := + match w with + | [] => xs + | b :: w' => + if n == 0 then xs + else match xs with + | [] => q4 n (fun n' => [(b :: w',n')]) + | (v,m) :: ys => + if (b :: w') == v then + q4 (n + m) (fun nm => (b :: w',nm) :: ys) + else + q4 n (fun n' => (b :: w',n') :: (v,m) :: ys) +theorem Runs.push_spec (w : List (Fin 2)) (n : ℕ) (xs : Runs) : + Runs.denote (Runs.push w n xs)=(w ^ n) +> Runs.denote xs:= by + cases w with + | nil => simp [Runs.push,nil_pow_list] + | cons b w' => + unfold Runs.push + simp only [strictNat_eq] + by_cases hn : (n == 0)=true + · have hn0 : n=0:=beq_iff_eq.mp hn + subst hn0 + simp + · rw [if_neg hn] + cases xs with + | nil => rfl + | cons vm ys => + rcases vm with ⟨v,m⟩ + dsimp only + by_cases hv : ((b :: w') == v)=true + · have hv_eq : b :: w'=v:=beq_iff_eq.mp hv + subst hv_eq + rw [if_pos hv,Runs.denote,Runs.denote,qb,append_assoc] + · rw [if_neg hv]; rfl +def Runs.pop : Runs → Fin 2 × Runs + | [] => (0,[]) + | ([],_) :: xs => Runs.pop xs + | (b :: w,n) :: xs => + if n == 0 then Runs.pop xs + else if n == 1 then + q3 (Runs.push w 1 xs) (fun xs2 => (b,xs2)) + else match w with + | [] => q4 (n - 1) (fun n' => (b,([b],n') :: xs)) + | u :: v => + q4 (n - 1) (fun n' => + q3 (Runs.push (b :: u :: v) n' xs) (fun xs1 => + q3 (Runs.push (u :: v) 1 xs1) (fun xs2 => + (b,xs2)))) +theorem Runs.pop_spec (xs : Runs) : + Runs.denote xs=(Runs.pop xs).1 >> Runs.denote (Runs.pop xs).2:= by + induction xs with + | nil => + simp only [Runs.pop,Runs.denote,zero_cons_default] + | cons wn xs ih => + rcases wn with ⟨w,n⟩ + cases w with + | nil => + simpa [Runs.pop,Runs.denote,nil_pow_list] using ih + | cons b w => + unfold Runs.pop + by_cases hn0 : (n == 0)=true + · have hn_eq : n=0:=beq_iff_eq.mp hn0 + subst hn_eq + simpa [Runs.denote] using ih + · rw [if_neg hn0] + by_cases hn1 : (n == 1)=true + · rw [if_pos hn1] + have hn_eq : n=1:=beq_iff_eq.mp hn1 + subst hn_eq + simp only [strictRuns_eq,Runs.push_spec,Runs.denote,pow_succ_list,pow_zero_list,List.append_nil,append_cons,append_assoc] + · rw [if_neg hn1] + have hn_pos : 0 < n:=Nat.pos_of_ne_zero (by intro h0; subst h0; exact hn0 rfl) + have hn_eq : n=(n - 1) + 1:=(Nat.sub_add_cancel hn_pos).symm + cases w with + | nil => + simp only [strictNat_eq,Runs.denote] + conv_lhs => rw [hn_eq,pow_succ_list] + simp [append_assoc] + | cons u v => + simp only [strictNat_eq,strictRuns_eq] + rw [Runs.push_spec,Runs.push_spec,Runs.denote] + conv_lhs => rw [hn_eq,pow_succ_list] + simp [pow_succ_list,append_assoc] +inductive StripResult + | done (v_rem : List (Fin 2)) + | more (w_rem : List (Fin 2)) +def strip_step : List (Fin 2) → List (Fin 2) → Option StripResult + | [],v => some (.done v) + | b :: w,[] => some (.more (b :: w)) + | b :: w,c :: v => if b == c then strip_step w v else none +theorem strip_step_done {w v v' : List (Fin 2)} (h : strip_step w v=some (.done v')) : + v=w ++ v':= by + induction w generalizing v with + | nil => + unfold strip_step at h + injection h with hv; injection hv + | cons b w ih => + cases v with + | nil => + unfold strip_step at h + nomatch h + | cons c v => + unfold strip_step at h + split_ifs at h with hbc + have hbc_eq : b=c:=beq_iff_eq.mp hbc + subst hbc_eq + simp [ih h] +theorem strip_step_more {w v w' : List (Fin 2)} (h : strip_step w v=some (.more w')) : + w=v ++ w':= by + induction w generalizing v with + | nil => + unfold strip_step at h + nomatch h + | cons b w ih => + cases v with + | nil => + unfold strip_step at h + injection h with hm; injection hm + | cons c v => + unfold strip_step at h + split_ifs at h with hbc + have hbc_eq : b=c:=beq_iff_eq.mp hbc + subst hbc_eq + simp [ih h] +def Runs.remove_slow : List (Fin 2) → Runs → Option Runs + | [],xs => q3 xs (fun xs' => some xs') + | b :: w,xs => + match Runs.pop xs with + | (b',xs') => if b == b' then Runs.remove_slow w xs' else none +theorem Runs.remove_slow_spec {w : List (Fin 2)} {xs ys : Runs} + (h : Runs.remove_slow w xs=some ys) : + Runs.denote xs=w +> Runs.denote ys:= by + induction w generalizing xs with + | nil => + unfold Runs.remove_slow at h + simp only [strictRuns_eq] at h + injection h with hys; subst hys; rfl + | cons b w ih => + unfold Runs.remove_slow at h + dsimp only at h + split_ifs at h with hb + have hb_eq : b=(Runs.pop xs).1:=beq_iff_eq.mp hb + rw [Runs.pop_spec xs,← hb_eq,ih h] + rfl +def Runs.remove_aux : ℕ → List (Fin 2) → Runs → Option Runs + | 0,w,xs => Runs.remove_slow w xs + | _ + 1,[],xs => q3 xs (fun xs' => some xs') + | _ + 1,w,[] => Runs.remove_slow w [] + | fuel + 1,w,([],_) :: ys => Runs.remove_aux fuel w ys + | fuel + 1,w,(c :: v,m) :: ys => + if m == 0 then Runs.remove_aux fuel w ys + else match strip_step w (c :: v) with + | none => none + | some (.done v') => + if m == 1 then + q3 (Runs.push v' 1 ys) (fun zs => some zs) + else + q4 (m - 1) (fun m' => + q3 (Runs.push v' 1 ((c :: v,m') :: ys)) (fun zs => some zs)) + | some (.more w') => + if m == 1 then Runs.remove_aux fuel w' ys + else + q4 (m - 1) (fun m' => Runs.remove_aux fuel w' ((c :: v,m') :: ys)) +theorem Runs.remove_aux_spec {fuel : ℕ} {w : List (Fin 2)} {xs ys : Runs} + (h : Runs.remove_aux fuel w xs=some ys) : + Runs.denote xs=w +> Runs.denote ys:= by + induction fuel generalizing w xs ys with + | zero => exact Runs.remove_slow_spec h + | succ fuel ih => + cases w with + | nil => + unfold Runs.remove_aux at h + simp only [strictRuns_eq] at h + injection h with hys; subst hys; rfl + | cons b w0 => + rcases xs with _ | ⟨⟨_ | ⟨c,v⟩,m⟩,ys'⟩ + · exact Runs.remove_slow_spec h + · unfold Runs.remove_aux at h + simpa [Runs.denote,nil_pow_list] using ih h + · unfold Runs.remove_aux at h + by_cases hm0 : (m == 0)=true + · rw [if_pos hm0] at h + have hm_eq : m=0:=beq_iff_eq.mp hm0 + subst hm_eq + simpa [Runs.denote] using ih h + · rw [if_neg hm0] at h + have hm_pos : 0 < m:=Nat.pos_of_ne_zero (by intro h0; subst h0; exact hm0 rfl) + have hm_eq : m=(m - 1) + 1:=(Nat.sub_add_cancel hm_pos).symm + cases hs : strip_step (b :: w0) (c :: v) with + | none => rw [hs] at h; contradiction + | some res => + rw [hs] at h + cases res with + | done v' => + dsimp only at h + have hv_eq:=strip_step_done hs + by_cases hm1 : (m == 1)=true + · rw [if_pos hm1] at h + have hm1_eq : m=1:=beq_iff_eq.mp hm1 + subst hm1_eq + simp only [strictRuns_eq] at h + injection h with hys; subst hys + simp [Runs.denote,Runs.push_spec,pow_succ_list,hv_eq,append_assoc] + · rw [if_neg hm1] at h + simp only [strictNat_eq,strictRuns_eq] at h + injection h with hys; subst hys + rw [Runs.push_spec,Runs.denote,Runs.denote] + conv_lhs => rw [hm_eq,pow_succ_list] + simp [pow_succ_list,hv_eq,append_assoc] + | more w' => + dsimp only at h + have hw_eq:=strip_step_more hs + by_cases hm1 : (m == 1)=true + · rw [if_pos hm1] at h + have hm1_eq : m=1:=beq_iff_eq.mp hm1 + subst hm1_eq + rw [Runs.denote,pow_succ_list,pow_zero_list,List.append_nil,ih h,hw_eq,append_assoc] + · rw [if_neg hm1] at h + simp only [strictNat_eq] at h + have h_ih:=ih h + rw [Runs.denote] at h_ih ⊢ + conv_lhs => rw [hm_eq,pow_succ_list] + rw [append_assoc,h_ih,hw_eq,append_assoc] +def Runs.remove_fast1 (w : List (Fin 2)) (xs : Runs) : Option Runs := + match xs with + | (v,1) :: rest => + if v == w then some rest + else if w == [0] && v == [0,1,0] then + some (([1,0],1) :: rest) + else + match rest with + | (v2,1) :: rest2 => + if v == [1] && w == [1,0,1] && v2 == [0,1,1,0,1,1,0,1,1,0] then + some (([1,0,1,1,0,1,1,0],1) :: rest2) + else none + | (v2,m2 + 2) :: rest2 => + if v == [1] && w == [1,0,1] && v2 == [0,1,1,0,1,1,0,1,1,0] then + some (([1,0,1,1,0,1,1,0],1) :: ([0,1,1,0,1,1,0,1,1,0],m2 + 1) :: rest2) + else if m2 == 0 && v == [0] && w == [0,1,0] && v2 == [1,0,1,1,1,1] then + some (([1,1,1,1],1) :: ([1,0,1,1,1,1],1) :: rest2) + else none + | _ => none + | (v,m + 2) :: rest => + if w == [1] && v == [1,0,1] then + some (([0,1],1) :: ([1,0,1],m + 1) :: rest) + else none + | _ => none +theorem Runs.remove_fast1_spec {w : List (Fin 2)} {xs ys : Runs} + (h : Runs.remove_fast1 w xs=some ys) : + Runs.denote xs=w +> Runs.denote ys:= by + rcases xs with _ | ⟨⟨v,_ | _ | m⟩,rest⟩ + · contradiction + · contradiction + · unfold Runs.remove_fast1 at h + dsimp only at h + by_cases hvw : (v == w)=true + · rw [if_pos hvw] at h + injection h with hys; subst hys + have hvw_eq : v=w:=beq_iff_eq.mp hvw + subst hvw_eq + simp [Runs.denote,pow_succ_list] + · rw [if_neg hvw] at h + by_cases h1 : (w == [0] && v == [0,1,0])=true + · rw [if_pos h1] at h + injection h with hys; subst hys + simp only [Bool.and_eq_true,beq_iff_eq] at h1 + rcases h1 with ⟨hw,hv⟩; subst hw hv; rfl + · rw [if_neg h1] at h + rcases rest with _ | ⟨⟨v2,_ | _ | m2⟩,rest2⟩ + · contradiction + · contradiction + · dsimp only at h + split_ifs at h with h2 + injection h with hys; subst hys + simp only [Bool.and_eq_true,beq_iff_eq] at h2 + rcases h2 with ⟨⟨hv,hw⟩,hv2⟩; subst hv hw hv2; rfl + · dsimp only at h + by_cases h3 : (v == [1] && w == [1,0,1] && v2 == [0,1,1,0,1,1,0,1,1,0])=true + · rw [if_pos h3] at h + injection h with hys; subst hys + simp only [Bool.and_eq_true,beq_iff_eq] at h3 + rcases h3 with ⟨⟨hv,hw⟩,hv2⟩; subst hv hw hv2; rfl + · rw [if_neg h3] at h + split_ifs at h with h4 + injection h with hys; subst hys + simp only [Bool.and_eq_true,beq_iff_eq] at h4 + rcases h4 with ⟨⟨⟨hm2,hv⟩,hw⟩,hv2⟩; subst hm2 hv hw hv2; rfl + · unfold Runs.remove_fast1 at h + dsimp only at h + split_ifs at h with h5 + injection h with hys; subst hys + simp only [Bool.and_eq_true,beq_iff_eq] at h5 + rcases h5 with ⟨hw,hv⟩; subst hw hv; rfl +def Runs.remove (w : List (Fin 2)) (xs : Runs) : Option Runs := + match Runs.remove_fast1 w xs with + | some ys => some ys + | none => Runs.remove_aux 16 w xs +theorem Runs.remove_spec {w : List (Fin 2)} {xs ys : Runs} + (h : Runs.remove w xs=some ys) : + Runs.denote xs=w +> Runs.denote ys:= by + unfold Runs.remove at h + cases hf : Runs.remove_fast1 w xs with + | some zs => + rw [hf] at h + injection h with hys; subst hys + exact Runs.remove_fast1_spec hf + | none => + rw [hf] at h + exact Runs.remove_aux_spec h +def Runs.skip_block (w : List (Fin 2)) (limit : ℕ) (x v : List (Fin 2)) (m : ℕ) (ys : Runs) : Option (ℕ × Runs) := + if w.length % v.length == 0 || v.length % w.length == 0 then + q4 (min w.length v.length) (fun g => + q4 (w.length / g) (fun a => + q4 (v.length / g) (fun b => + q4 (min (limit / b) (m / a)) (fun k => + if 0 < k then + if k * b ≤ limit then + if k * a ≤ m then + if (x ++ v ^ a) == (w ^ b ++ x) then + q4 (k * b) (fun kb => + q4 (m - k * a) (fun m' => + q3 (Runs.push v m' ys) (fun ys1 => + q3 (Runs.push x 1 ys1) (fun zs => + some (kb,zs))))) + else none + else none + else none + else none)))) + else none +theorem Runs.skip_block_spec {w : List (Fin 2)} {limit : ℕ} {x v : List (Fin 2)} {m : ℕ} {ys : Runs} {n : ℕ} {zs : Runs} + (h : Runs.skip_block w limit x v m ys=some (n,zs)) : + n ≤ limit ∧ x +> (v ^ m) +> Runs.denote ys=(w ^ n) +> Runs.denote zs:= by + unfold Runs.skip_block at h + simp only [strictNat_eq,strictRuns_eq] at h + split_ifs at h with hdiv hk hkb hka heq + injection h with hpair + injection hpair with hn hzs + subst hn hzs + refine ⟨hkb,?_⟩ + rw [Runs.push_spec,Runs.push_spec] + have hx1 : x ^ (1 : ℕ)=x:= by simp [pow_succ_list] + rw [hx1] + have hm_eq:=(Nat.add_sub_of_le hka).symm + have hk_comm:=commute_power (beq_iff_eq.mp heq) (min (limit / (v.length / min w.length v.length)) (m / (w.length / min w.length v.length))) + have h_lhs : x +> (v ^ m) +> Runs.denote ys = + (x ++ v ^ (min (limit / (v.length / min w.length v.length)) (m / (w.length / min w.length v.length)) * (w.length / min w.length v.length))) +> + (v ^ (m - min (limit / (v.length / min w.length v.length)) (m / (w.length / min w.length v.length)) * (w.length / min w.length v.length))) +> Runs.denote ys:= by + conv_lhs => rw [hm_eq,qb] + rw [append_assoc (v ^ _),← append_assoc x] + rw [h_lhs,hk_comm,append_assoc] +def Runs.skip_periodic (w : List (Fin 2)) (n : ℕ) (xs : Runs) : Option (ℕ × Runs) := + match xs with + | (x,nx) :: (v,m) :: ys => + if nx == 1 then + if w.length ≤ x.length && x.length % w.length == 0 then + Runs.skip_block w n [] x 1 ((v,m) :: ys) + else Runs.skip_block w n x v m ys + else Runs.skip_block w n [] x nx ((v,m) :: ys) + | [(v,m)] => Runs.skip_block w n [] v m [] + | [] => none +theorem Runs.skip_periodic_spec {w : List (Fin 2)} {n : ℕ} {xs : Runs} {k : ℕ} {ys : Runs} + (h : Runs.skip_periodic w n xs=some (k,ys)) : + k ≤ n ∧ Runs.denote xs=(w ^ k) +> Runs.denote ys:= by + unfold Runs.skip_periodic at h + rcases xs with _ | ⟨⟨x,nx⟩,_ | ⟨⟨v,m⟩,ys'⟩⟩ + · contradiction + · simpa [Runs.denote] using Runs.skip_block_spec h + · dsimp only at h + split_ifs at h with hnx hxl + · have hnx1 : nx=1:=beq_iff_eq.mp hnx + subst hnx1 + simpa [Runs.denote] using Runs.skip_block_spec h + · have hnx1 : nx=1:=beq_iff_eq.mp hnx + subst hnx1 + have hx1 : x ^ (1 : ℕ)=x:= by simp [pow_succ_list] + simpa [Runs.denote,hx1] using Runs.skip_block_spec h + · simpa [Runs.denote] using Runs.skip_block_spec h +def Runs.skip (w : List (Fin 2)) (n : ℕ) (xs : Runs) : Option (ℕ × Runs) := + match xs with + | [] => none + | (v,m) :: ys => + if w == v then + if m ≤ n then some (m,ys) + else q4 (m - n) (fun m' => some (n,(v,m') :: ys)) + else Runs.skip_periodic w n ((v,m) :: ys) +theorem Runs.skip_spec {w : List (Fin 2)} {n : ℕ} {xs : Runs} {k : ℕ} {ys : Runs} + (h : Runs.skip w n xs=some (k,ys)) : + k ≤ n ∧ Runs.denote xs=(w ^ k) +> Runs.denote ys:= by + rcases xs with _ | ⟨⟨v,m⟩,ys'⟩ + · contradiction + · unfold Runs.skip at h + simp only [strictNat_eq] at h + split_ifs at h with hwv hmn + · injection h with hpair + injection hpair with hk hys + subst hk hys + have hwv_eq : w=v:=beq_iff_eq.mp hwv + subst hwv_eq + exact ⟨hmn,rfl⟩ + · injection h with hpair + injection hpair with hk hys + subst hk hys + have hwv_eq : w=v:=beq_iff_eq.mp hwv + subst hwv_eq + have hle : n ≤ m:=Nat.le_of_not_le hmn + refine ⟨le_rfl,?_⟩ + rw [Runs.denote,Runs.denote,← append_assoc,← qb,Nat.add_sub_of_le hle] + · exact Runs.skip_periodic_spec h +def Runs.remove_fast : ℕ → List (Fin 2) → ℕ → Runs → Option Runs + | 0,_,n,xs => if n == 0 then q3 xs (fun xs' => some xs') else none + | fuel + 1,w,n,xs => + if n == 0 then q3 xs (fun xs' => some xs') + else match Runs.skip w n xs with + | some (k,ys) => + q4 (n - k) (fun n' => Runs.remove_fast fuel w n' ys) + | none => + match Runs.remove w xs with + | some ys => + q4 (n - 1) (fun n' => Runs.remove_fast fuel w n' ys) + | none => none +theorem Runs.remove_fast_spec {fuel : ℕ} {w : List (Fin 2)} {n : ℕ} {xs ys : Runs} + (h : Runs.remove_fast fuel w n xs=some ys) : + Runs.denote xs=(w ^ n) +> Runs.denote ys:= by + induction fuel generalizing n xs ys with + | zero => + unfold Runs.remove_fast at h + simp only [strictRuns_eq] at h + split_ifs at h with hn + injection h with hys; subst hys + have hn0 : n=0:=beq_iff_eq.mp hn; subst hn0 + simp + | succ fuel ih => + unfold Runs.remove_fast at h + simp only [strictRuns_eq] at h + split_ifs at h with hn + · injection h with hys; subst hys + have hn0 : n=0:=beq_iff_eq.mp hn; subst hn0 + simp + · have hn_pos : 0 < n:=Nat.pos_of_ne_zero (by intro h0; subst h0; exact hn rfl) + cases hskip : Runs.skip w n xs with + | some kys => + rcases kys with ⟨k,zs⟩ + rw [hskip] at h + simp only [strictNat_eq] at h + rcases Runs.skip_spec hskip with ⟨hkn,hden⟩ + rw [hden,ih h,← append_assoc,← qb,Nat.add_sub_of_le hkn] + | none => + rw [hskip] at h + cases hrem : Runs.remove w xs with + | none => rw [hrem] at h; contradiction + | some zs => + rw [hrem] at h + simp only [strictNat_eq] at h + rw [Runs.remove_spec hrem,ih h] + have hn_eq : n=(n - 1) + 1:=(Nat.sub_add_cancel hn_pos).symm + conv_rhs => rw [hn_eq,pow_succ_list,append_assoc] +def Runs.size : Runs → ℕ + | [] => 0 + | (w,n) :: xs => w.length * n + Runs.size xs +def Runs.zeros : Runs → Bool + | [] => true + | (w,_) :: xs => if BusyBeaver.Longitudinal.BoundedConfig.all0 w then Runs.zeros xs else false +theorem Runs.zeros_spec {xs : Runs} (h : Runs.zeros xs=true) : Runs.denote xs=default:= by + induction xs with + | nil => rfl + | cons wn xs ih => + rcases wn with ⟨w,n⟩ + unfold Runs.zeros at h + split_ifs at h with hw + rw [Runs.denote,ih h,qJ hw n] +structure RMConfig where + left : Runs + right : Runs + state : Fin 6 + dir : Dir +deriving DecidableEq +def RMConfig.denote (c : RMConfig) : Cfg (Fin 2) (Fin 6) := + match c.dir with + | .left => Runs.denote c.left <{{c.state}} Runs.denote c.right + | .right => Runs.denote c.left {{c.state}}> Runs.denote c.right +def RM.raw (tm : Machine (Fin 2) (Fin 6)) (c : RMConfig) : Option RMConfig := + match c.dir with + | .left => + match Runs.pop c.left with + | (b,l) => + match tm c.state b with + | none => none + | some (none,_) => none + | some (some q',Stmt.write b' .left) => + q3 (Runs.push [b'] 1 c.right) (fun r' => + some ⟨l,r',q',.left⟩) + | some (some q',Stmt.write b' .right) => + q3 (Runs.push [b'] 1 l) (fun l' => + some ⟨l',c.right,q',.right⟩) + | .right => + match Runs.pop c.right with + | (b,r) => + match tm c.state b with + | none => none + | some (none,_) => none + | some (some q',Stmt.write b' .left) => + q3 (Runs.push [b'] 1 r) (fun r' => + some ⟨c.left,r',q',.left⟩) + | some (some q',Stmt.write b' .right) => + q3 (Runs.push [b'] 1 c.left) (fun l' => + some ⟨l',r,q',.right⟩) +theorem RM.raw_spec {tm : Machine (Fin 2) (Fin 6)} {c c' : RMConfig} + (h : RM.raw tm c=some c') : + (c.denote) [tm]⊢* (c'.denote):= by + rcases c with ⟨l,r,q,d⟩ + unfold RM.raw at h + cases d + · dsimp only at h + have hpop:=Runs.pop_spec l + cases htm : tm q (Runs.pop l).1 with + | none => rw [htm] at h; contradiction + | some qa => + rcases qa with ⟨ _ | q',⟨b',_ | _⟩⟩ + · rw [htm] at h; contradiction + · rw [htm] at h; contradiction + · rw [htm] at h + simp only [strictRuns_eq] at h + injection h with hc'; subst hc' + apply ql + unfold RMConfig.denote step + dsimp only + rw [hpop,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,htm,Runs.push_spec] + simp only [pow_succ_list,pow_zero_list,List.append_nil,append_cons,append_nil] + rfl + · rw [htm] at h + simp only [strictRuns_eq] at h + injection h with hc'; subst hc' + apply ql + unfold RMConfig.denote step + dsimp only + rw [hpop,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,htm,Runs.push_spec] + simp only [pow_succ_list,pow_zero_list,List.append_nil,append_cons,append_nil] + rfl + · dsimp only at h + have hpop:=Runs.pop_spec r + cases htm : tm q (Runs.pop r).1 with + | none => rw [htm] at h; contradiction + | some qa => + rcases qa with ⟨ _ | q',⟨b',_ | _⟩⟩ + · rw [htm] at h; contradiction + · rw [htm] at h; contradiction + · rw [htm] at h + simp only [strictRuns_eq] at h + injection h with hc'; subst hc' + apply ql + unfold RMConfig.denote step + dsimp only + rw [hpop,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,htm,Runs.push_spec] + simp only [pow_succ_list,pow_zero_list,List.append_nil,append_cons,append_nil] + rfl + · rw [htm] at h + simp only [strictRuns_eq] at h + injection h with hc'; subst hc' + apply ql + unfold RMConfig.denote step + dsimp only + rw [hpop,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,htm,Runs.push_spec] + simp only [pow_succ_list,pow_zero_list,List.append_nil,append_cons,append_nil] + rfl +def qk (d : Dir) (c : RMConfig) : RMConfig := + match d,c.dir with + | .left,.right => + match Runs.pop c.right with + | (b,r') => + q3 (Runs.push [b] 1 c.left) (fun l' => + ⟨l',r',c.state,.left⟩) + | .right,.left => + match Runs.pop c.left with + | (b,l') => + q3 (Runs.push [b] 1 c.right) (fun r' => + ⟨l',r',c.state,.right⟩) + | _,_ => c +theorem qS (d : Dir) (c : RMConfig) : (qk d c).denote=c.denote:= by + rcases c with ⟨l,r,q,cd⟩ + cases d <;> cases cd <;> try rfl + · unfold qk RMConfig.denote + simp only [strictRuns_eq] + rw [Runs.push_spec,Runs.pop_spec r] + simp only [pow_succ_list,pow_zero_list,List.append_nil,append_cons,append_nil, + Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons] + · unfold qk RMConfig.denote + simp only [strictRuns_eq] + rw [Runs.push_spec,Runs.pop_spec l] + simp only [pow_succ_list,pow_zero_list,List.append_nil,append_cons,append_nil, + Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons] +theorem qW (d : Dir) (c : RMConfig) : (qk d c).dir=d:= by + rcases c with ⟨l,r,q,cd⟩ + cases d <;> cases cd <;> simp [qk] +theorem qI (d : Dir) (c : RMConfig) : (qk d c).state=c.state:= by + rcases c with ⟨l,r,q,cd⟩ + cases d <;> cases cd <;> simp [qk] +structure Scan where + q : Fin 6 + dir : Dir + scan_in : List (Fin 2) + scan_out : List (Fin 2) + context : List (Fin 2) +def q5 (tm : Machine (Fin 2) (Fin 6)) (s : Scan) : Prop := + ∀ (n : ℕ) (l r : ListBlank (Fin 2)), + match s.dir with + | .right => + ((s.context.reverse +> l) {{s.q}}> ((s.scan_in ^ n) +> r)) [tm]⊢* + ((s.context.reverse +> (s.scan_out.reverse ^ n) +> l) {{s.q}}> r) + | .left => + (((s.scan_in.reverse ^ n) +> l) <{{s.q}} (s.context +> r)) [tm]⊢* + (l <{{s.q}} (s.context +> (s.scan_out ^ n) +> r)) +theorem qo {tm : Machine (Fin 2) (Fin 6)} {s : Scan} (hd : s.dir=.right) + (hbase : ∀ l r,((s.context.reverse +> l) {{s.q}}> (s.scan_in +> r)) [tm]⊢* + ((s.context.reverse +> s.scan_out.reverse +> l) {{s.q}}> r)) : + q5 tm s:= by + unfold q5 + intro n l r + rw [hd] + dsimp only + induction n generalizing l r with + | zero => exact ⟨0,rfl⟩ + | succ n ih => + rw [pow_succ_list,append_assoc] + have h1:=hbase l ((s.scan_in ^ n) +> r) + have h2:=ih (s.scan_out.reverse +> l) r + rw [← append_assoc (s.scan_out.reverse ^ n) s.scan_out.reverse l,pow_shift] at h2 + exact q0 h1 h2 +theorem qf {tm : Machine (Fin 2) (Fin 6)} {s : Scan} (hd : s.dir=.left) + (hbase : ∀ l r,((s.scan_in.reverse +> l) <{{s.q}} (s.context +> r)) [tm]⊢* + (l <{{s.q}} (s.context +> s.scan_out +> r))) : + q5 tm s:= by + unfold q5 + intro n l r + rw [hd] + dsimp only + induction n generalizing l r with + | zero => exact ⟨0,rfl⟩ + | succ n ih => + rw [pow_succ_list,append_assoc] + have h1:=hbase ((s.scan_in.reverse ^ n) +> l) r + have h2:=ih l (s.scan_out +> r) + rw [← append_assoc (s.scan_out ^ n) s.scan_out r,pow_shift] at h2 + exact q0 h1 h2 +def qi:=Runs.remove_fast 32 +def qr (s : Scan) (n : ℕ) (l r : Runs) : Option (Runs × Runs) := + match s.dir with + | .left => + match Runs.remove s.context r,qi s.scan_in.reverse n l with + | some r',some l' => + q3 (Runs.push s.scan_out n r') (fun r1 => + q3 (Runs.push s.context 1 r1) (fun r2 => + some (l',r2))) + | _,_ => none + | .right => + match Runs.remove s.context.reverse l,qi s.scan_in n r with + | some l',some r' => + q3 (Runs.push s.scan_out.reverse n l') (fun l1 => + q3 (Runs.push s.context.reverse 1 l1) (fun l2 => + some (l2,r'))) + | _,_ => none +theorem qK {tm : Machine (Fin 2) (Fin 6)} {s : Scan} {n : ℕ} {l r l' r' : Runs} + (hv : q5 tm s) (h : qr s n l r=some (l',r')) : + (RMConfig.denote ⟨l,r,s.q,s.dir⟩) [tm]⊢* (RMConfig.denote ⟨l',r',s.q,s.dir⟩):= by + unfold q5 at hv + rcases s with ⟨q,d,sin,sout,ctx⟩ + have hv_n:=hv n + unfold qr qi at h + cases d + · dsimp only at h hv_n + cases hr : Runs.remove ctx r with + | none => rw [hr] at h; contradiction + | some r0 => + rw [hr] at h + cases hl : Runs.remove_fast 32 sin.reverse n l with + | none => rw [hl] at h; contradiction + | some l0 => + rw [hl] at h + simp only [strictRuns_eq] at h + injection h with hpair + injection hpair with hl' hr' + subst hl' hr' + unfold RMConfig.denote + dsimp only + rw [Runs.push_spec,Runs.push_spec,Runs.remove_spec hr,Runs.remove_fast_spec hl] + have hc1 : ctx ^ (1 : ℕ)=ctx:= by simp [pow_succ_list] + rw [hc1] + exact hv_n (Runs.denote l0) (Runs.denote r0) + · dsimp only at h hv_n + cases hl : Runs.remove ctx.reverse l with + | none => rw [hl] at h; contradiction + | some l0 => + rw [hl] at h + cases hr : Runs.remove_fast 32 sin n r with + | none => rw [hr] at h; contradiction + | some r0 => + rw [hr] at h + simp only [strictRuns_eq] at h + injection h with hpair + injection hpair with hl' hr' + subst hl' hr' + unfold RMConfig.denote + dsimp only + rw [Runs.push_spec,Runs.push_spec,Runs.remove_spec hl,Runs.remove_fast_spec hr] + have hc1 : ctx.reverse ^ (1 : ℕ)=ctx.reverse:= by simp [pow_succ_list] + rw [hc1] + exact hv_n (Runs.denote l0) (Runs.denote r0) +def use_scan (s : Scan) (n : ℕ) (c : RMConfig) : Option RMConfig := + if c.state == s.q then + let z:=qk s.dir c + match qr s n z.left z.right with + | some (l,r) => some ⟨l,r,s.q,s.dir⟩ + | none => none + else none +theorem use_scan_spec {tm : Machine (Fin 2) (Fin 6)} {s : Scan} {n : ℕ} {c c' : RMConfig} + (hv : q5 tm s) (h : use_scan s n c=some c') : + (c.denote) [tm]⊢* (c'.denote):= by + unfold use_scan at h + split_ifs at h with hq + have hq_eq : c.state=s.q:=beq_iff_eq.mp hq + rw [← qS s.dir c] + have hd_z : (qk s.dir c).dir=s.dir:=qW s.dir c + have hq_z : (qk s.dir c).state=s.q:= by rw [qI,hq_eq] + rcases hz : qk s.dir c with ⟨l,r,qz,dz⟩ + rw [hz] at hd_z hq_z h + dsimp only at hd_z hq_z h + subst hd_z hq_z + cases hs : qr s n l r with + | none => rw [hs] at h; contradiction + | some lr => + rcases lr with ⟨l',r'⟩ + rw [hs] at h + injection h with hc'; subst hc' + exact qK hv hs +def qh_slow (p : Digit) (n : ℕ) (r : Runs) : Option Runs := + match Runs.remove (qn p) r with + | none => none + | some r1 => qi W n r1 +theorem qh_slow_spec {p : Digit} {n : ℕ} {r r2 : Runs} (h : qh_slow p n r=some r2) : + Runs.denote r=(qn p) +> (W ^ n) +> Runs.denote r2:= by + unfold qh_slow at h + cases hr1 : Runs.remove (qn p) r with + | none => rw [hr1] at h; contradiction + | some r1 => + rw [hr1] at h + rw [Runs.remove_spec hr1,Runs.remove_fast_spec h] +def W_rot : List (Fin 2):=[1,1,1,1,1,0,1,1,1,1] +theorem w_rot_step : W_rot ++ [1]=[1] ++ W:=rfl +theorem w_rot_comm (m : ℕ) : W_rot ^ m ++ [1]=[1] ++ W ^ m:= by + induction m with + | zero => rfl + | succ m ih => + rw [pow_succ_list,List.append_assoc,ih,← List.append_assoc,w_rot_step,List.append_assoc,← pow_succ_list] +theorem w_rot_append (m : ℕ) (s : ListBlank (Fin 2)) : + (W_rot ^ m) +> ([1] +> s)=[1] +> (W ^ m) +> s:= by + rw [← append_assoc,w_rot_comm,append_assoc] +theorem w_rot_tail_eq (s : ListBlank (Fin 2)) : + ([1,1,1,1] ^ (1 : ℕ)) +> ([1,0,1,1,1,1] ^ (1 : ℕ)) +> ([1,0] ^ (1 : ℕ)) +> s = + [1] +> W +> ([0] ^ (1 : ℕ)) +> s:=rfl +theorem w_rot_mid_eq (m : ℕ) (s : ListBlank (Fin 2)) : + (W_rot ^ m) +> ([1,1,1,1] ^ (1 : ℕ)) +> ([1,0,1,1,1,1] ^ (1 : ℕ)) +> ([1,0] ^ (1 : ℕ)) +> s = + [1] +> (W ^ (m + 1)) +> ([0] ^ (1 : ℕ)) +> s:= by + rw [w_rot_tail_eq,w_rot_append,← append_assoc (W ^ m) W,pow_shift] +theorem w_rot_d0_eq (m : ℕ) (rest : Runs) : + Runs.denote (([0],1) :: (W_rot,m) :: ([1,1,1,1],1) :: ([1,0,1,1,1,1],1) :: ([1,0],1) :: rest) = + (qn .D0) +> (W ^ (m + 1)) +> Runs.denote (([0],1) :: rest):= by + simp only [Runs.denote,w_rot_mid_eq] + rfl +theorem w_rot_d2_eq (m : ℕ) (rest : Runs) : + Runs.denote (([0,1,1,1,1],1) :: (W_rot,m) :: ([1,1,1,1],1) :: ([1,0,1,1,1,1],1) :: ([1,0],1) :: rest) = + (qn .D2) +> (W ^ (m + 1)) +> Runs.denote (([0],1) :: rest):= by + simp only [Runs.denote,w_rot_mid_eq] + rfl +theorem w_rot_end_tail (s : ListBlank (Fin 2)) : + ([1] ^ (4 : ℕ)) +> s=[1] +> ([1] ^ (3 : ℕ)) +> s:=rfl +theorem w_rot_end_eq (m : ℕ) (rest : Runs) : + Runs.denote (([0],1) :: (W_rot,m) :: ([1],4) :: rest) = + (qn .D0) +> (W ^ m) +> Runs.denote (([1],3) :: rest):= by + simp only [Runs.denote,w_rot_end_tail,w_rot_append] + rfl +def qh_one (p : Digit) (n : ℕ) (r : Runs) : Option Runs := + match r with + | (v,mv) :: (w,m) :: rest => + if mv == 1 && w == W && qn p == v && n == m then + some rest + else if mv == 1 && w == W_rot then + match rest with + | (u1,m1) :: tail1 => + if p == .D0 && v == [0] && u1 == [1] && m1 == 4 && n == m then + some (([1],3) :: tail1) + else + match tail1 with + | (u2,m2) :: (u3,m3) :: tail3 => + if u1 == [1,1,1,1] && m1 == 1 && u2 == [1,0,1,1,1,1] && m2 == 1 && u3 == [1,0] && m3 == 1 && n == m + 1 then + if p == .D0 && v == [0] then + some (([0],1) :: tail3) + else if p == .D2 && v == [0,1,1,1,1] then + some (([0],1) :: tail3) + else qh_slow p n r + else qh_slow p n r + | _ => qh_slow p n r + | _ => qh_slow p n r + else qh_slow p n r + | _ => qh_slow p n r +theorem qh_one_spec {p : Digit} {n : ℕ} {r r2 : Runs} (h : qh_one p n r=some r2) : + Runs.denote r=(qn p) +> (W ^ n) +> Runs.denote r2:= by + rcases r with _ | ⟨⟨v,mv⟩,_ | ⟨⟨w,m⟩,rest⟩⟩ + · exact qh_slow_spec h + · exact qh_slow_spec h + · unfold qh_one at h + dsimp only at h + by_cases h1 : (mv == 1 && w == W && qn p == v && n == m)=true + · rw [if_pos h1] at h + injection h with hr2; subst hr2 + simp only [Bool.and_eq_true,beq_iff_eq] at h1 + rcases h1 with ⟨⟨⟨hmv,hw⟩,hp⟩,hn⟩ + subst hmv hw hp hn + simp [Runs.denote,pow_succ_list] + · rw [if_neg h1] at h + by_cases h2 : (mv == 1 && w == W_rot)=true + · rw [if_pos h2] at h + simp only [Bool.and_eq_true,beq_iff_eq] at h2 + rcases h2 with ⟨hmv,hw⟩ + subst hmv hw + rcases rest with _ | ⟨⟨u1,m1⟩,tail1⟩ + · exact qh_slow_spec h + · dsimp only at h + by_cases h3 : (p == .D0 && v == [0] && u1 == [1] && m1 == 4 && n == m)=true + · rw [if_pos h3] at h + injection h with hr2; subst hr2 + simp only [Bool.and_eq_true,beq_iff_eq] at h3 + rcases h3 with ⟨⟨⟨⟨hp,hv⟩,hu1⟩,hm1⟩,hn⟩ + subst hp hv hu1 hm1 + rw [hn] + exact w_rot_end_eq m tail1 + · rw [if_neg h3] at h + rcases tail1 with _ | ⟨⟨u2,m2⟩,_ | ⟨⟨u3,m3⟩,tail3⟩⟩ + · exact qh_slow_spec h + · exact qh_slow_spec h + · dsimp only at h + by_cases h4 : (u1 == [1,1,1,1] && m1 == 1 && u2 == [1,0,1,1,1,1] && m2 == 1 && u3 == [1,0] && m3 == 1 && n == m + 1)=true + · rw [if_pos h4] at h + simp only [Bool.and_eq_true,beq_iff_eq] at h4 + rcases h4 with ⟨⟨⟨⟨⟨⟨hu1,hm1⟩,hu2⟩,hm2⟩,hu3⟩,hm3⟩,hn⟩ + subst hu1 hm1 hu2 hm2 hu3 hm3 hn + by_cases h5 : (p == .D0 && v == [0])=true + · rw [if_pos h5] at h + injection h with hr2; subst hr2 + simp only [Bool.and_eq_true,beq_iff_eq] at h5 + rcases h5 with ⟨hp,hv⟩ + subst hp hv + exact w_rot_d0_eq m tail3 + · rw [if_neg h5] at h + by_cases h6 : (p == .D2 && v == [0,1,1,1,1])=true + · rw [if_pos h6] at h + injection h with hr2; subst hr2 + simp only [Bool.and_eq_true,beq_iff_eq] at h6 + rcases h6 with ⟨hp,hv⟩ + subst hp hv + exact w_rot_d2_eq m tail3 + · rw [if_neg h6] at h + exact qh_slow_spec h + · rw [if_neg h4] at h + exact qh_slow_spec h + · rw [if_neg h2] at h + exact qh_slow_spec h +def qh : qv → Runs → Option Runs + | [],r => q3 r (fun r' => some r') + | (p,n) :: xs,r => + match qh_one p n r with + | none => none + | some r2 => qh xs r2 +theorem qF {xs : qv} {r r' : Runs} + (h : qh xs r=some r') : + Runs.denote r=(q9 xs) +> Runs.denote r':= by + induction xs generalizing r with + | nil => + unfold qh at h + simp only [strictRuns_eq] at h + injection h with hr'; subst hr'; rfl + | cons pn xs ih => + rcases pn with ⟨p,n⟩ + unfold qh at h + cases hr2 : qh_one p n r with + | none => rw [hr2] at h; contradiction + | some r2 => + rw [hr2] at h + dsimp only at h + rw [qh_one_spec hr2,ih h,q9,append_assoc,append_assoc] +def qw : qv → Runs → Runs + | [],r => r + | (p,n) :: xs,r => + q3 (qw xs r) (fun r1 => + q3 (Runs.push W n r1) (fun r2 => + Runs.push (qn p) 1 r2)) +theorem qR (xs : qv) (r : Runs) : + Runs.denote (qw xs r)=(q9 xs) +> Runs.denote r:= by + induction xs with + | nil => rfl + | cons pn xs ih => + rcases pn with ⟨p,n⟩ + unfold qw q9 + simp only [strictRuns_eq] + rw [Runs.push_spec,Runs.push_spec,ih] + have hw1 : (qn p) ^ (1 : ℕ)=qn p:= by simp [pow_succ_list] + rw [hw1,append_assoc,append_assoc] +def W_s0 : List (Fin 2):=[1,0,1,1,0,0,1,1,0,1] +def W_s1 : List (Fin 2):=[0,1,1,0,1,1,0,1,1,0] +theorem w_s0_step : W_s1 ++ [0,1,1,0,1]=[0,1,1,0,1] ++ W_s0:=rfl +theorem w_s0_comm (m : ℕ) : W_s1 ^ m ++ [0,1,1,0,1]=[0,1,1,0,1] ++ W_s0 ^ m:= by + induction m with + | zero => rfl + | succ m ih => + rw [pow_succ_list,List.append_assoc,ih,← List.append_assoc,w_s0_step,List.append_assoc,← pow_succ_list] +theorem w_s0_append (m : ℕ) (s : ListBlank (Fin 2)) : + (W_s1 ^ m) +> ([0,1,1,0,1] +> s)=[0,1,1,0,1] +> (W_s0 ^ m) +> s:= by + rw [← append_assoc,w_s0_comm,append_assoc] +theorem w_s0_tail_eq (k : ℕ) (s : ListBlank (Fin 2)) : + ([0,1] ^ (1 : ℕ)) +> ([1,0,1] ^ (k + 1)) +> s = + [0,1,1,0,1] +> ([1,0,1] ^ k) +> s:=rfl +theorem w_s0_head_eq (m : ℕ) (s : ListBlank (Fin 2)) : + ([1,0,1,1,0] ^ (1 : ℕ)) +> [0,1,1,0,1] +> (W_s0 ^ m) +> s = + (W_s0 ^ (m + 1)) +> s:=rfl +theorem w_s0_eq (m k : ℕ) (rest : Runs) : + Runs.denote (([1,0,1,1,0],1) :: (W_s1,m) :: ([0,1],1) :: ([1,0,1],k + 1) :: rest) = + (W_s0 ^ (m + 1)) +> Runs.denote (([1,0,1],k) :: rest):= by + simp only [Runs.denote,w_s0_tail_eq,w_s0_append,w_s0_head_eq] +def W_s5 : List (Fin 2):=[1,0,1,1,0,1] +theorem w_s5_eq (rest : Runs) : + Runs.denote (([1,0,1],3) :: ([1,0,1,1,0,1,1,0],1) :: rest) = + (W_s5 ^ (2 : ℕ)) +> Runs.denote (([1,0,1,1,0],1) :: rest):=rfl +def W_s9 : List (Fin 2):=[1,1,1] +theorem w_s9_4_eq1 (rest : Runs) : + Runs.denote (([1,1,1,1,1,1,1,1,1],1) :: (W,1) :: rest) = + (W_s9 ^ (4 : ℕ)) +> Runs.denote (([1,0,1,1,1,1,1],1) :: rest):=rfl +theorem w_s9_4_eq2 (m : ℕ) (rest : Runs) : + Runs.denote (([1,1,1,1,1,1,1,1,1],1) :: (W,m + 1) :: rest) = + (W_s9 ^ (4 : ℕ)) +> Runs.denote (([1,0,1,1,1,1,1],1) :: (W,m) :: rest):=rfl +theorem w_s9_5_eq1 (rest : Runs) : + Runs.denote (([1,1,1,1,1,1,1,1,1,1,1,1],1) :: (W,1) :: rest) = + (W_s9 ^ (5 : ℕ)) +> Runs.denote (([1,0,1,1,1,1,1],1) :: rest):=rfl +theorem w_s9_5_eq2 (m : ℕ) (rest : Runs) : + Runs.denote (([1,1,1,1,1,1,1,1,1,1,1,1],1) :: (W,m + 1) :: rest) = + (W_s9 ^ (5 : ℕ)) +> Runs.denote (([1,0,1,1,1,1,1],1) :: (W,m) :: rest):=rfl +def W_s1_in : List (Fin 2):=[1,0,1,1,1,1,1,1,1,1] +theorem w_s1_in_step : W ++ [1,1,1]=[1,1,1] ++ W_s1_in:=rfl +theorem w_s1_in_comm (m : ℕ) : W ^ m ++ [1,1,1]=[1,1,1] ++ W_s1_in ^ m:= by + induction m with + | zero => rfl + | succ m ih => + rw [pow_succ_list,List.append_assoc,ih,← List.append_assoc,w_s1_in_step,List.append_assoc,← pow_succ_list] +theorem w_s1_in_append (m : ℕ) (s : ListBlank (Fin 2)) : + (W ^ m) +> ([1,1,1] +> s)=[1,1,1] +> (W_s1_in ^ m) +> s:= by + rw [← append_assoc,w_s1_in_comm,append_assoc] +theorem w_s1_in_head_eq (m : ℕ) (s : ListBlank (Fin 2)) : + ([1,0,1,1,1,1,1] ^ (1 : ℕ)) +> [1,1,1] +> (W_s1_in ^ m) +> s = + (W_s1_in ^ (m + 1)) +> s:=rfl +theorem w_s1_in_tail1 (s : ListBlank (Fin 2)) : + ([1,1,1,1,1,1,1,1,1,1,1,1] ^ (1 : ℕ)) +> s = + [1,1,1] +> ([1,1,1,1,1,1,1,1,1] ^ (1 : ℕ)) +> s:=rfl +theorem w_s1_in_eq1 (m : ℕ) (rest : Runs) : + Runs.denote (([1,0,1,1,1,1,1],1) :: (W,m) :: ([1,1,1,1,1,1,1,1,1,1,1,1],1) :: rest) = + (W_s1_in ^ (m + 1)) +> Runs.denote (([1,1,1,1,1,1,1,1,1],1) :: rest):= by + simp only [Runs.denote,w_s1_in_tail1,w_s1_in_append,w_s1_in_head_eq] +theorem w_s1_in_tail2 (s : ListBlank (Fin 2)) : + ([1] ^ (3 : ℕ)) +> s=[1,1,1] +> s:=rfl +theorem w_s1_in_eq2 (m : ℕ) (rest : Runs) : + Runs.denote (([1,0,1,1,1,1,1],1) :: (W,m) :: ([1],3) :: rest) = + (W_s1_in ^ (m + 1)) +> Runs.denote rest:= by + simp only [Runs.denote,w_s1_in_tail2,w_s1_in_append,w_s1_in_head_eq] +def qe_fast (w : List (Fin 2)) (r : Runs) : Option (ℕ × Runs) := + match r with + | (v1,m1) :: (v2,m2) :: rest2 => + if w == W_s5 && v1 == [1,0,1] && m1 == 3 && v2 == [1,0,1,1,0,1,1,0] && m2 == 1 then + some (2,([1,0,1,1,0],1) :: rest2) + else if w == W_s9 && m1 == 1 && v2 == W then + match m2 with + | 0 => none + | 1 => + if v1 == [1,1,1,1,1,1,1,1,1] then + some (4,([1,0,1,1,1,1,1],1) :: rest2) + else if v1 == [1,1,1,1,1,1,1,1,1,1,1,1] then + some (5,([1,0,1,1,1,1,1],1) :: rest2) + else none + | m + 2 => + if v1 == [1,1,1,1,1,1,1,1,1] then + some (4,([1,0,1,1,1,1,1],1) :: (W,m + 1) :: rest2) + else if v1 == [1,1,1,1,1,1,1,1,1,1,1,1] then + some (5,([1,0,1,1,1,1,1],1) :: (W,m + 1) :: rest2) + else none + else + match rest2 with + | (v3,m3) :: rest3 => + if w == W_s1_in && v1 == [1,0,1,1,1,1,1] && m1 == 1 && v2 == W then + if v3 == [1,1,1,1,1,1,1,1,1,1,1,1] && m3 == 1 then + q4 (m2 + 1) (fun n => some (n,([1,1,1,1,1,1,1,1,1],1) :: rest3)) + else if v3 == [1] && m3 == 3 then + q4 (m2 + 1) (fun n => some (n,rest3)) + else none + else + match rest3 with + | (v4,k + 2) :: rest4 => + if w == W_s0 && v1 == [1,0,1,1,0] && m1 == 1 && v2 == W_s1 && v3 == [0,1] && m3 == 1 && v4 == [1,0,1] then + q4 (m2 + 1) (fun n => some (n,([1,0,1],k + 1) :: rest4)) + else none + | _ => none + | _ => none + | _ => none +theorem qe_fast_spec {w : List (Fin 2)} {r s : Runs} {n : ℕ} + (h : qe_fast w r=some (n,s)) : + Runs.denote r=(w ^ n) +> Runs.denote s:= by + rcases r with _ | ⟨⟨v1,m1⟩,_ | ⟨⟨v2,m2⟩,rest2⟩⟩ + · contradiction + · contradiction + · unfold qe_fast at h + dsimp only at h + by_cases h1 : (w == W_s5 && v1 == [1,0,1] && m1 == 3 && v2 == [1,0,1,1,0,1,1,0] && m2 == 1)=true + · rw [if_pos h1] at h + injection h with hpair + injection hpair with hn hs + subst hn hs + simp only [Bool.and_eq_true,beq_iff_eq] at h1 + rcases h1 with ⟨⟨⟨⟨hw,hv1⟩,hm1⟩,hv2⟩,hm2⟩ + subst hw hv1 hm1 hv2 hm2 + exact w_s5_eq rest2 + · rw [if_neg h1] at h + by_cases h2 : (w == W_s9 && m1 == 1 && v2 == W)=true + · rw [if_pos h2] at h + simp only [Bool.and_eq_true,beq_iff_eq] at h2 + rcases h2 with ⟨⟨hw,hm1⟩,hv2⟩ + subst hw hm1 hv2 + rcases m2 with _ | _ | m + · contradiction + · dsimp only at h + by_cases h3 : (v1 == [1,1,1,1,1,1,1,1,1])=true + · rw [if_pos h3] at h + injection h with hpair; injection hpair with hn hs; subst hn hs + have hv1 : v1=[1,1,1,1,1,1,1,1,1]:=beq_iff_eq.mp h3 + subst hv1 + exact w_s9_4_eq1 rest2 + · rw [if_neg h3] at h + by_cases h4 : (v1 == [1,1,1,1,1,1,1,1,1,1,1,1])=true + · rw [if_pos h4] at h + injection h with hpair; injection hpair with hn hs; subst hn hs + have hv1 : v1=[1,1,1,1,1,1,1,1,1,1,1,1]:=beq_iff_eq.mp h4 + subst hv1 + exact w_s9_5_eq1 rest2 + · rw [if_neg h4] at h; contradiction + · dsimp only at h + by_cases h3 : (v1 == [1,1,1,1,1,1,1,1,1])=true + · rw [if_pos h3] at h + injection h with hpair; injection hpair with hn hs; subst hn hs + have hv1 : v1=[1,1,1,1,1,1,1,1,1]:=beq_iff_eq.mp h3 + subst hv1 + exact w_s9_4_eq2 (m + 1) rest2 + · rw [if_neg h3] at h + by_cases h4 : (v1 == [1,1,1,1,1,1,1,1,1,1,1,1])=true + · rw [if_pos h4] at h + injection h with hpair; injection hpair with hn hs; subst hn hs + have hv1 : v1=[1,1,1,1,1,1,1,1,1,1,1,1]:=beq_iff_eq.mp h4 + subst hv1 + exact w_s9_5_eq2 (m + 1) rest2 + · rw [if_neg h4] at h; contradiction + · rw [if_neg h2] at h + rcases rest2 with _ | ⟨⟨v3,m3⟩,rest3⟩ + · contradiction + · dsimp only at h + by_cases h5 : (w == W_s1_in && v1 == [1,0,1,1,1,1,1] && m1 == 1 && v2 == W)=true + · rw [if_pos h5] at h + simp only [Bool.and_eq_true,beq_iff_eq] at h5 + rcases h5 with ⟨⟨⟨hw,hv1⟩,hm1⟩,hv2⟩ + subst hw hm1 hv2 hv1 + by_cases h6 : (v3 == [1,1,1,1,1,1,1,1,1,1,1,1] && m3 == 1)=true + · rw [if_pos h6] at h + simp only [strictNat_eq] at h + injection h with hpair; injection hpair with hn hs; subst hn hs + simp only [Bool.and_eq_true,beq_iff_eq] at h6 + rcases h6 with ⟨hv3,hm3⟩ + subst hv3 hm3 + exact w_s1_in_eq1 m2 rest3 + · rw [if_neg h6] at h + by_cases h7 : (v3 == [1] && m3 == 3)=true + · rw [if_pos h7] at h + simp only [strictNat_eq] at h + injection h with hpair; injection hpair with hn hs; subst hn hs + simp only [Bool.and_eq_true,beq_iff_eq] at h7 + rcases h7 with ⟨hv3,hm3⟩ + subst hv3 hm3 + exact w_s1_in_eq2 m2 rest3 + · rw [if_neg h7] at h; contradiction + · rw [if_neg h5] at h + rcases rest3 with _ | ⟨⟨v4,_ | _ | k⟩,rest4⟩ + · contradiction + · contradiction + · contradiction + · dsimp only at h + by_cases h8 : (w == W_s0 && v1 == [1,0,1,1,0] && m1 == 1 && v2 == W_s1 && v3 == [0,1] && m3 == 1 && v4 == [1,0,1])=true + · rw [if_pos h8] at h + simp only [strictNat_eq] at h + injection h with hpair; injection hpair with hn hs; subst hn hs + simp only [Bool.and_eq_true,beq_iff_eq] at h8 + rcases h8 with ⟨⟨⟨⟨⟨⟨hw,hv1⟩,hm1⟩,hv2⟩,hv3⟩,hm3⟩,hv4⟩ + subst hw hv1 hm1 hv2 hv3 hm3 hv4 + exact w_s0_eq m2 (k + 1) rest4 + · rw [if_neg h8] at h; contradiction +def qe : ℕ → List (Fin 2) → Runs → ℕ × Runs + | 0,_,r => (0,r) + | fuel + 1,w,r => + match qe_fast w r with + | some res => res + | none => + match r with + | [] => (0,[]) + | (v,m) :: ys => + if w == v then + match qe fuel w ys with + | (n,s') => q4 (m + n) (fun mn => (mn,s')) + else if (strip_step w v).isNone then (0,r) + else + match q4 (Runs.size (r.take 2)) (fun sz => Runs.skip w sz r) with + | some (k,s) => + match qe fuel w s with + | (n,s') => q4 (k + n) (fun kn => (kn,s')) + | none => + match Runs.remove w r with + | some s => + match qe fuel w s with + | (n,s') => q4 (1 + n) (fun n1 => (n1,s')) + | none => (0,r) +theorem qe_spec (fuel : ℕ) (w : List (Fin 2)) (r : Runs) : + Runs.denote r=(w ^ (qe fuel w r).1) +> Runs.denote (qe fuel w r).2:= by + induction fuel generalizing r with + | zero => rfl + | succ fuel ih => + unfold qe + cases hfast : qe_fast w r with + | some res => + rcases res with ⟨n,s⟩ + exact qe_fast_spec hfast + | none => + rcases r with _ | ⟨⟨v,m⟩,ys⟩ + · rfl + · dsimp only + split_ifs with hwv hst + · have hwv_eq : w=v:=beq_iff_eq.mp hwv + subst hwv_eq + have h_ih:=ih ys + rcases hqe : qe fuel w ys with ⟨n,s'⟩ + rw [hqe] at h_ih + simp only [strictNat_eq,Runs.denote,h_ih,qb,append_assoc] + · rfl + · simp only [strictNat_eq] + cases hskip : Runs.skip w (Runs.size (((v,m) :: ys).take 2)) ((v,m) :: ys) with + | some ks => + rcases ks with ⟨k,s⟩ + dsimp only + have h_ih:=ih s + rcases hqe : qe fuel w s with ⟨n,s'⟩ + rw [hqe] at h_ih + dsimp only + rw [(Runs.skip_spec hskip).2,h_ih,qb,append_assoc] + | none => + dsimp only + cases hrem : Runs.remove w ((v,m) :: ys) with + | none => rfl + | some s => + dsimp only + have h_ih:=ih s + rcases hqe : qe fuel w s with ⟨n,s'⟩ + rw [hqe] at h_ih + dsimp only + have h1n : 1 + n=n + 1:=Nat.add_comm 1 n + rw [Runs.remove_spec hrem,h_ih,h1n,pow_succ_list,append_assoc] +def first_bad : ℕ → Digit → ℕ → ℕ + | 0,_,_ => 1 + | fuel + 1,p,n => + if take p ≤ n then 1 + first_bad fuel (next p) (n - take p) else 1 +def unsafe_bound (p : Digit) (n : ℕ) : ℕ := + 6 * (n / 2) + first_bad 6 p (n % 2) +def match_digit (v : List (Fin 2)) : Option Digit := + if v == [0,1] then some .D0 + else if v == [1,1,1,1] then some .D1 + else if v == [0,1,1,1,1,1] then some .D2 + else if v == [1,1,1,1,1,1,1,1] then some .D3 + else if v == [0,1,1,1,1,1,1,1,1,1] then some .D4 + else if v == [1,1,1,1,1,1,1,1,1,1,1,1] then some .D5 + else none +theorem match_digit_spec {v : List (Fin 2)} {p : Digit} (h : match_digit v=some p) : + v=qn p:= by + unfold match_digit at h + split_ifs at h with h0 h1 h2 h3 h4 h5 + · injection h with hp; subst hp; exact beq_iff_eq.mp h0 + · injection h with hp; subst hp; exact beq_iff_eq.mp h1 + · injection h with hp; subst hp; exact beq_iff_eq.mp h2 + · injection h with hp; subst hp; exact beq_iff_eq.mp h3 + · injection h with hp; subst hp; exact beq_iff_eq.mp h4 + · injection h with hp; subst hp; exact beq_iff_eq.mp h5 +def choose_opt_slow (r : Runs) : Option (Digit × ℕ × Runs) := + match Runs.pop r with + | (b,r1) => + if b == 0 then + match Runs.remove [1] r1 with + | none => none + | some r_d0 => + match qe 32 W r_d0 with + | (n0,rt0) => + if 0 < n0 then some (.D0,n0,rt0) + else match Runs.remove [1,1,1,1] r_d0 with + | none => some (.D0,0,r_d0) + | some r_d2 => + match qe 32 W r_d2 with + | (n2,rt2) => + if 0 < n2 then some (.D2,n2,rt2) + else match Runs.remove [1,1,1,1] r_d2 with + | none => some (.D2,0,r_d2) + | some r_d4 => + match qe 32 W r_d4 with + | (n4,rt4) => some (.D4,n4,rt4) + else + match Runs.remove [1,1,1] r1 with + | none => none + | some r_d1 => + match qe 32 W r_d1 with + | (n1,rt1) => + if 0 < n1 then some (.D1,n1,rt1) + else match Runs.remove [1,1,1,1] r_d1 with + | none => some (.D1,0,r_d1) + | some r_d3 => + match qe 32 W r_d3 with + | (n3,rt3) => + if 0 < n3 then some (.D3,n3,rt3) + else match Runs.remove [1,1,1,1] r_d3 with + | none => some (.D3,0,r_d3) + | some r_d5 => + match qe 32 W r_d5 with + | (n5,rt5) => some (.D5,n5,rt5) +def choose_opt (r : Runs) : Option (Digit × ℕ × Runs) := + match r with + | (v,1) :: (w,m) :: rest => + if w == W && 0 < m then + match match_digit v with + | some p => + match rest with + | [([1],3)] => some (p,m,rest) + | (v2,1) :: (w2,m2) :: _ => + if w2 == W && 0 < m2 && (match_digit v2).isSome then some (p,m,rest) + else + match qe 32 W ((w,m) :: rest) with + | (n,rt) => some (p,n,rt) + | _ => + match qe 32 W ((w,m) :: rest) with + | (n,rt) => some (p,n,rt) + | none => choose_opt_slow r + else choose_opt_slow r + | _ => choose_opt_slow r +def parse_cells_rem : ℕ → Runs → qv × Runs + | 0,r => ([],r) + | fuel + 1,r => + match r with + | (v,mv) :: (w,m) :: rest => + if mv == 1 && w == W && 0 < m then + match match_digit v with + | some p => + match parse_cells_rem fuel rest with + | (xs,rem) => ((p,m) :: xs,rem) + | none => ([],r) + else if mv == 1 && w == W_rot then + match rest with + | (u1,m1) :: tail1 => + if v == [0] && u1 == [1] && m1 == 4 then + ([(.D0,m)],([1],3) :: tail1) + else + match tail1 with + | (u2,m2) :: (u3,m3) :: tail3 => + if u1 == [1,1,1,1] && m1 == 1 && u2 == [1,0,1,1,1,1] && m2 == 1 && u3 == [1,0] && m3 == 1 then + if v == [0] then + q4 (m + 1) (fun m1 => + match parse_cells_rem fuel (([0],1) :: tail3) with + | (xs,rem) => ((.D0,m1) :: xs,rem)) + else if v == [0,1,1,1,1] then + q4 (m + 1) (fun m1 => + match parse_cells_rem fuel (([0],1) :: tail3) with + | (xs,rem) => ((.D2,m1) :: xs,rem)) + else ([],r) + else ([],r) + | _ => ([],r) + | _ => ([],r) + else ([],r) + | _ => ([],r) +theorem parse_cells_rem_spec (fuel : ℕ) (r : Runs) : + Runs.denote r=(q9 (parse_cells_rem fuel r).1) +> Runs.denote (parse_cells_rem fuel r).2:= by + induction fuel generalizing r with + | zero => rfl + | succ fuel ih => + rcases r with _ | ⟨⟨v,mv⟩,_ | ⟨⟨w,m⟩,rest⟩⟩ + · rfl + · rfl + · unfold parse_cells_rem + dsimp only + by_cases h1 : (mv == 1 && w == W && 0 < m)=true + · rw [if_pos h1] + cases hmd : match_digit v with + | none => rfl + | some p => + dsimp only + have h_ih:=ih rest + rcases hpcr : parse_cells_rem fuel rest with ⟨xs,rem⟩ + rw [hpcr] at h_ih + dsimp only at h_ih ⊢ + simp only [Bool.and_eq_true,beq_iff_eq] at h1 + rcases h1 with ⟨⟨hmv,hw⟩,_⟩ + have hv:=match_digit_spec hmd + subst hmv hw hv + simp [Runs.denote,pow_succ_list,h_ih,q9,append_assoc] + · rw [if_neg h1] + by_cases h2 : (mv == 1 && w == W_rot)=true + · rw [if_pos h2] + simp only [Bool.and_eq_true,beq_iff_eq] at h2 + rcases h2 with ⟨hmv,hw⟩ + subst hmv hw + rcases rest with _ | ⟨⟨u1,m1⟩,tail1⟩ + · rfl + · dsimp only + by_cases h3 : (v == [0] && u1 == [1] && m1 == 4)=true + · rw [if_pos h3] + dsimp only + simp only [Bool.and_eq_true,beq_iff_eq] at h3 + rcases h3 with ⟨⟨hv,hu1⟩,hm1⟩ + subst hv hu1 hm1 + simpa [q9,append_assoc] using w_rot_end_eq m tail1 + · rw [if_neg h3] + rcases tail1 with _ | ⟨⟨u2,m2⟩,_ | ⟨⟨u3,m3⟩,tail3⟩⟩ + · rfl + · rfl + · dsimp only + by_cases h4 : (u1 == [1,1,1,1] && m1 == 1 && u2 == [1,0,1,1,1,1] && m2 == 1 && u3 == [1,0] && m3 == 1)=true + · rw [if_pos h4] + simp only [Bool.and_eq_true,beq_iff_eq] at h4 + rcases h4 with ⟨⟨⟨⟨⟨hu1,hm1⟩,hu2⟩,hm2⟩,hu3⟩,hm3⟩ + subst hu1 hm1 hu2 hm2 hu3 hm3 + by_cases h5 : (v == [0])=true + · rw [if_pos h5] + simp only [strictNat_eq] + have hv : v=[0]:=beq_iff_eq.mp h5 + subst hv + have h_ih:=ih (([0],1) :: tail3) + rcases hpcr : parse_cells_rem fuel (([0],1) :: tail3) with ⟨xs,rem⟩ + rw [hpcr] at h_ih + dsimp only at h_ih ⊢ + rw [w_rot_d0_eq m tail3,h_ih,q9,append_assoc,append_assoc] + · rw [if_neg h5] + by_cases h6 : (v == [0,1,1,1,1])=true + · rw [if_pos h6] + simp only [strictNat_eq] + have hv : v=[0,1,1,1,1]:=beq_iff_eq.mp h6 + subst hv + have h_ih:=ih (([0],1) :: tail3) + rcases hpcr : parse_cells_rem fuel (([0],1) :: tail3) with ⟨xs,rem⟩ + rw [hpcr] at h_ih + dsimp only at h_ih ⊢ + rw [w_rot_d2_eq m tail3,h_ih,q9,append_assoc,append_assoc] + · rw [if_neg h6]; rfl + · rw [if_neg h4]; rfl + · rw [if_neg h2]; rfl +def push_qv : Digit → ℕ → qv → qv + | p,0,[] => [(p,0)] + | p,n + 1,xs => (p,n + 1) :: xs + | p,0,(p2,m) :: xs => + match p2 with + | .D1 => + match p with + | .D0 => push_qv .D2 m xs + | .D1 => push_qv .D3 m xs + | .D2 => push_qv .D4 m xs + | .D3 => push_qv .D5 m xs + | _ => (p,0) :: (.D1,m) :: xs + | .D3 => + match p with + | .D0 => push_qv .D4 m xs + | .D1 => push_qv .D5 m xs + | .D2 => (.D4,0) :: push_qv .D1 m xs + | .D3 => (.D5,0) :: push_qv .D1 m xs + | _ => (p,0) :: (.D3,m) :: xs + | .D5 => + match p with + | .D0 => (.D4,0) :: push_qv .D1 m xs + | .D1 => (.D5,0) :: push_qv .D1 m xs + | .D2 => (.D4,0) :: push_qv .D3 m xs + | .D3 => (.D5,0) :: push_qv .D3 m xs + | _ => (p,0) :: (.D5,m) :: xs + | .D2 => + match p with + | .D2 => q4 (m + 1) (fun m1 => (.D0,m1) :: xs) + | .D3 => q4 (m + 1) (fun m1 => (.D1,m1) :: xs) + | .D4 => q4 (m + 1) (fun m1 => (.D2,m1) :: xs) + | .D5 => q4 (m + 1) (fun m1 => (.D3,m1) :: xs) + | _ => (p,0) :: (.D2,m) :: xs + | .D4 => + match p with + | .D2 => (.D0,1) :: push_qv .D1 m xs + | .D3 => (.D1,1) :: push_qv .D1 m xs + | .D4 => (.D2,1) :: push_qv .D1 m xs + | .D5 => (.D3,1) :: push_qv .D1 m xs + | _ => (p,0) :: (.D4,m) :: xs + | .D0 => + match m with + | 0 => (p,0) :: (.D0,0) :: xs + | m' + 1 => + match p with + | .D2 => (.D0,1) :: push_qv .D2 m' xs + | .D3 => (.D1,1) :: push_qv .D2 m' xs + | .D4 => (.D2,1) :: push_qv .D2 m' xs + | .D5 => (.D3,1) :: push_qv .D2 m' xs + | _ => (p,0) :: (.D0,m' + 1) :: xs +theorem push_qv_spec (p : Digit) (n : ℕ) (xs : qv) : + q9 (push_qv p n xs)=qn p ++ W ^ n ++ q9 xs:= by + induction xs generalizing p n with + | nil => + cases n <;> rfl + | cons pm xs ih => + rcases pm with ⟨p2,m⟩ + cases n with + | succ n => rfl + | zero => + cases p2 <;> cases p + all_goals try rfl + all_goals (try cases m <;> try rfl) + all_goals ( + unfold push_qv + simp only [strictNat_eq,q9,ih,pow_succ_list,pow_zero_list,List.nil_append,List.append_nil,← List.append_assoc] + rfl) +def qU_norm : ℕ → qv → Option (ℕ × qv) + | t,[] => if Nat.beq t 0 then some (0,[]) else none + | t,(p,n) :: xs => + if Nat.beq t 0 then some (0,(p,n) :: xs) + else + match qy p t with + | ⟨ph,u,g,s⟩ => + if Nat.ble u n then + match qU_norm s xs with + | some (e,ys) => + q4 (n - u + e) (fun m => + some (g,push_qv ph m ys)) + | none => none + else none +theorem qU_norm_spec {t : ℕ} {xs : qv} {e : ℕ} {ys : qv} + (h : qU_norm t xs=some (e,ys)) : + ∃ ys0,qU t xs=some (e,ys0) ∧ q9 ys=q9 ys0:= by + induction xs generalizing t e ys with + | nil => + unfold qU_norm at h + split_ifs at h with ht + injection h with hpair; injection hpair with he hys; subst he hys + exact ⟨[],by simp [qU,ht],rfl⟩ + | cons pn xs ih => + rcases pn with ⟨p,n⟩ + unfold qU_norm at h + split_ifs at h with ht0 + · injection h with hpair; injection hpair with he hys; subst he hys + exact ⟨(p,n) :: xs,by simp [qU,ht0],rfl⟩ + · dsimp only at h + split_ifs at h with hle + cases hb : qU_norm (qy p t).sent xs with + | none => rw [hb] at h; contradiction + | some eys => + rcases eys with ⟨e',ys'⟩ + rw [hb] at h + simp only [strictNat_eq] at h + injection h with hpair; injection hpair with he hys; subst he hys + rcases ih hb with ⟨ys0,hqU,hq9⟩ + refine ⟨((qy p t).phase,n - (qy p t).used + e') :: ys0,by simp [qU,ht0,hle,hqU],?_⟩ + rw [push_qv_spec,q9,hq9] +def ub_rem : Digit → ℕ → ℕ + | .D0,0 => 1 | .D0,_ => 3 + | .D1,0 => 0 | .D1,_ => 2 + | .D2,0 => 1 | .D2,_ => 5 + | .D3,0 => 0 | .D3,_ => 4 + | .D4,0 => 3 | .D4,_ => 5 + | .D5,0 => 2 | .D5,_ => 4 +def unsafe_bound_m1 (p : Digit) (n : ℕ) : ℕ := + 6 * (n / 2) + ub_rem p (n % 2) +def min_nat (a b : ℕ) : ℕ := + if Nat.ble a b then a else b +def qe_xs_cap : qv → ℕ → ℕ + | [],_ => 0 + | (p,n) :: xs,cap => + q4 (if Nat.ble cap n && Nat.ble 2 n then cap else min_nat (unsafe_bound_m1 p n) cap) (fun t => + q4 ((t + p.index) / 6) (fun child => + if Nat.beq child 0 then t + else + q4 (qe_xs_cap xs child) (fun u => + if Nat.beq u child then t else min_nat t (6 * u + 5 - p.index)))) +def qe_xs : qv → ℕ + | [] => 0 + | (p,n) :: xs => + q4 (unsafe_bound_m1 p n) (fun t => + q4 ((t + p.index) / 6) (fun child => + if Nat.beq child 0 then t + else + q4 (qe_xs_cap xs child) (fun u => + if Nat.beq u child then t else min_nat t (6 * u + 5 - p.index)))) +def qv_loop : ℕ → ℕ → qv → ℕ × qv + | 0,k,xs => (k,xs) + | fuel + 1,k,xs => + q4 (qe_xs xs) (fun t => + if Nat.beq t 0 then (k,xs) + else + match qU_norm t xs with + | some (e,ys) => + q4 (k + e) (fun k' => qv_loop fuel k' ys) + | none => (k,xs)) +theorem qa1 {tm : Machine (Fin 2) (Fin 6)} + (hrule : ∀ t xs e ys k r,qU t xs=some (e,ys) → + (([1,0,1] +> default) {{E}}> ((W ^ k) +> (q9 xs) +> r)) [tm]⊢* + (([1,0,1] +> default) {{E}}> ((W ^ (k + e)) +> (q9 ys) +> r))) + (fuel k : ℕ) (xs : qv) (r : ListBlank (Fin 2)) : + let res:=qv_loop fuel k xs + (([1,0,1] +> default) {{E}}> ((W ^ k) +> (q9 xs) +> r)) [tm]⊢* + (([1,0,1] +> default) {{E}}> ((W ^ res.1) +> (q9 res.2) +> r)):= by + induction fuel generalizing k xs with + | zero => exact ⟨0,rfl⟩ + | succ fuel ih => + unfold qv_loop + simp only [strictNat_eq] + split_ifs with ht + · exact ⟨0,rfl⟩ + · cases hb : qU_norm (qe_xs xs) xs with + | none => exact ⟨0,rfl⟩ + | some eys => + rcases eys with ⟨e,ys⟩ + dsimp only + rcases qU_norm_spec hb with ⟨ys0,hqU,hq9⟩ + have hstep:=hrule (qe_xs xs) xs e ys0 k r hqU + rw [← hq9] at hstep + exact q0 hstep (ih (k + e) ys) +theorem step7_pre (rest : Runs) : + Runs.denote (([0],1) :: ([1],1) :: ([0],1) :: ([1],1) :: ([1,1,1,1,0,1,1,1,1],1) :: rest) = + (W ^ 0) +> (q9 [(.D0,0)]) +> Runs.denote (([0],1) :: ([1],1) :: ([1,1,1,1,0,1,1,1,1],1) :: rest):=rfl +theorem step7_post (rest : Runs) : + (W ^ 0) +> (q9 [(.D1,0)]) +> Runs.denote (([0],1) :: ([1],1) :: ([1,1,1,1,0,1,1,1,1],1) :: rest) = + (W ^ 1) +> Runs.denote (([0,1,1,1,1],1) :: rest):=rfl +theorem step7_qU : qU 1 [(.D0,0)]=some (0,[(.D1,0)]):=rfl +theorem step7_rule {tm : Machine (Fin 2) (Fin 6)} + (hrule : ∀ t xs e ys k r,qU t xs=some (e,ys) → + (([1,0,1] +> default) {{E}}> ((W ^ k) +> (q9 xs) +> r)) [tm]⊢* + (([1,0,1] +> default) {{E}}> ((W ^ (k + e)) +> (q9 ys) +> r))) + (rest : Runs) : + (([1,0,1] +> default) {{E}}> Runs.denote (([0],1) :: ([1],1) :: ([0],1) :: ([1],1) :: ([1,1,1,1,0,1,1,1,1],1) :: rest)) [tm]⊢* + (([1,0,1] +> default) {{E}}> ((W ^ 1) +> Runs.denote (([0,1,1,1,1],1) :: rest))):= by + rw [step7_pre,← step7_post] + exact hrule 1 [(.D0,0)] 0 [(.D1,0)] 0 _ step7_qU +def qa0_wk (cnt k : ℕ) (l r_cells : Runs) : RMConfig := + match parse_cells_rem 32 r_cells with + | (xs,r1) => + match qv_loop cnt k xs with + | (k_new,ys) => + q3 (qw ys r1) (fun r2 => + q3 (Runs.push W k_new r2) (fun r3 => + ⟨l,r3,E,.right⟩)) +theorem qa0_wk_spec {tm : Machine (Fin 2) (Fin 6)} + (hrule : ∀ t xs e ys k r,qU t xs=some (e,ys) → + (([1,0,1] +> default) {{E}}> ((W ^ k) +> (q9 xs) +> r)) [tm]⊢* + (([1,0,1] +> default) {{E}}> ((W ^ (k + e)) +> (q9 ys) +> r))) + (cnt k : ℕ) (l r_cells : Runs) (hl : Runs.denote l=[1,0,1] +> default) : + (([1,0,1] +> default) {{E}}> ((W ^ k) +> Runs.denote r_cells)) [tm]⊢* + (qa0_wk cnt k l r_cells).denote:= by + unfold qa0_wk + have hpcr:=parse_cells_rem_spec 32 r_cells + rcases h1 : parse_cells_rem 32 r_cells with ⟨xs,r1⟩ + rw [h1] at hpcr; dsimp only at hpcr ⊢ + have hbl:=qa1 hrule cnt k xs (Runs.denote r1) + rcases h2 : qv_loop cnt k xs with ⟨k_new,ys⟩ + rw [h2] at hbl; dsimp only at hbl ⊢ + simp only [strictRuns_eq,RMConfig.denote,hl,Runs.push_spec,qR,hpcr] + exact hbl +def qa0 (cnt : ℕ) (c : RMConfig) : Option RMConfig := + if c.state == E then + let z:=qk .right c + match Runs.remove [1,0,1] z.left with + | some l0 => + if Runs.zeros l0 then + match z.right with + | (w,k) :: rest => + if w == W then + some (qa0_wk cnt k z.left rest) + else + match cnt,rest with + | cnt' + 1,(u1,m1) :: (u2,m2) :: (u3,m3) :: (u4,m4) :: rest4 => + if w == [0] && k == 1 && u1 == [1] && m1 == 1 && u2 == [0] && m2 == 1 && u3 == [1] && m3 == 1 && u4 == [1,1,1,1,0,1,1,1,1] && m4 == 1 then + some (qa0_wk cnt' 1 z.left (([0,1,1,1,1],1) :: rest4)) + else none + | _,_ => none + | [] => none + else none + | none => none + else none +theorem qa3 {tm : Machine (Fin 2) (Fin 6)} + (hrule : ∀ t xs e ys k r,qU t xs=some (e,ys) → + (([1,0,1] +> default) {{E}}> ((W ^ k) +> (q9 xs) +> r)) [tm]⊢* + (([1,0,1] +> default) {{E}}> ((W ^ (k + e)) +> (q9 ys) +> r))) + {cnt : ℕ} {c c' : RMConfig} (h : qa0 cnt c=some c') : + (c.denote) [tm]⊢* (c'.denote):= by + unfold qa0 at h + split_ifs at h with hq + have hq_eq : c.state=E:=beq_iff_eq.mp hq + rw [← qS .right c] + have hd_z : (qk .right c).dir=.right:=qW .right c + have hq_z : (qk .right c).state=E:= by rw [qI,hq_eq] + rcases hz : qk .right c with ⟨l,r,qz,dz⟩ + rw [hz] at hd_z hq_z h + dsimp only at hd_z hq_z h + subst hd_z hq_z + cases hl0 : Runs.remove [1,0,1] l with + | none => rw [hl0] at h; contradiction + | some l0 => + rw [hl0] at h + dsimp only at h + split_ifs at h with hz0 + have hl_den : Runs.denote l=[1,0,1] +> default:= by + rw [Runs.remove_spec hl0,Runs.zeros_spec hz0] + rcases r with _ | ⟨⟨w,k⟩,rest⟩ + · contradiction + · dsimp only at h + by_cases hw : (w == W)=true + · rw [if_pos hw] at h + injection h with hc'; subst hc' + have hw_eq : w=W:=beq_iff_eq.mp hw + subst hw_eq + unfold RMConfig.denote + dsimp only + rw [hl_den,Runs.denote] + exact qa0_wk_spec hrule cnt k l rest hl_den + · rw [if_neg hw] at h + rcases cnt with _ | cnt' + · contradiction + · rcases rest with _ | ⟨⟨u1,m1⟩,_ | ⟨⟨u2,m2⟩,_ | ⟨⟨u3,m3⟩,_ | ⟨⟨u4,m4⟩,rest4⟩⟩⟩⟩ + · contradiction + · contradiction + · contradiction + · contradiction + · dsimp only at h + split_ifs at h with hstep7 + injection h with hc'; subst hc' + simp only [Bool.and_eq_true,beq_iff_eq] at hstep7 + rcases hstep7 with ⟨⟨⟨⟨⟨⟨⟨⟨⟨hw0,hk⟩,hu1⟩,hm1⟩,hu2⟩,hm2⟩,hu3⟩,hm3⟩,hu4⟩,hm4⟩ + subst hw0 hk hu1 hm1 hu2 hm2 hu3 hm3 hu4 hm4 + unfold RMConfig.denote + dsimp only + rw [hl_den] + exact q0 (step7_rule hrule rest4) (qa0_wk_spec hrule cnt' 1 l (([0,1,1,1,1],1) :: rest4) hl_den) +def qq : ℕ → Runs → Option ℕ → ℕ × qv + | 0,_,_ => (0,[]) + | fuel + 1,r,cap => + match choose_opt r with + | none => (0,[]) + | some (p,n,r2) => + q4 (unsafe_bound p n - 1) (fun t0 => + q4 (match cap with | none => t0 | some u => min t0 u) (fun t => + q4 ((t + p.index) / 6) (fun child => + if child == 0 then (t,[(p,n)]) + else + match qq fuel r2 (some child) with + | (u,xs) => + q4 (min t (6 * u + 5 - p.index)) (fun t' => + (t',(p,n) :: xs))))) +def qT (q : Fin 6) (c : RMConfig) : Option RMConfig := + if c.state == q then + let z:=qk .right c + match qe 32 W z.right with + | (k,r0) => + match qq 32 r0 none with + | (t,xs) => + if t == 0 then none + else + match Runs.remove [1,0,1] z.left,qU t xs with + | some l0,some (e,ys) => + if Runs.zeros l0 then + match qh xs r0 with + | some r1 => + q4 (k + e) (fun ke => + q3 (qw ys r1) (fun r2 => + q3 (Runs.push W ke r2) (fun r3 => + some ⟨z.left,r3,q,.right⟩))) + | none => none + else none + | _,_ => none + else none +theorem qV {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (hrule : ∀ t xs e ys k r,qU t xs=some (e,ys) → + (([1,0,1] +> default) {{q}}> ((W ^ k) +> (q9 xs) +> r)) [tm]⊢* + (([1,0,1] +> default) {{q}}> ((W ^ (k + e)) +> (q9 ys) +> r))) + {c c' : RMConfig} (h : qT q c=some c') : + (c.denote) [tm]⊢* (c'.denote):= by + unfold qT at h + split_ifs at h with hq + have hq_eq : c.state=q:=beq_iff_eq.mp hq + rw [← qS .right c] + have hd_z : (qk .right c).dir=.right:=qW .right c + have hq_z : (qk .right c).state=q:= by rw [qI,hq_eq] + rcases hz : qk .right c with ⟨l,r,qz,dz⟩ + rw [hz] at hd_z hq_z h + dsimp only at hd_z hq_z h + subst hd_z hq_z + have hqe_spec:=qe_spec 32 W r + rcases hqe : qe 32 W r with ⟨k,r0⟩ + rw [hqe] at h hqe_spec + dsimp only at h hqe_spec + rcases hqq : qq 32 r0 none with ⟨t,xs⟩ + rw [hqq] at h + dsimp only at h + split_ifs at h with ht0 + cases hl0 : Runs.remove [1,0,1] l with + | none => rw [hl0] at h; contradiction + | some l0 => + rw [hl0] at h + cases hb : qU t xs with + | none => rw [hb] at h; contradiction + | some eys => + rcases eys with ⟨e,ys⟩ + rw [hb] at h + dsimp only at h + split_ifs at h with hz0 + cases hrc : qh xs r0 with + | none => rw [hrc] at h; contradiction + | some r1 => + rw [hrc] at h + simp only [strictNat_eq,strictRuns_eq] at h + injection h with hc'; subst hc' + unfold RMConfig.denote + dsimp only + have hl_den : Runs.denote l=[1,0,1] +> default:= by + rw [Runs.remove_spec hl0,Runs.zeros_spec hz0] + rw [hl_den,Runs.push_spec,qR,hqe_spec,qF hrc] + exact hrule t xs e ys k (Runs.denote r1) hb +def qc_zero (s : Scan) (c : RMConfig) : Option RMConfig := + if c.state == s.q then + let z:=qk s.dir c + match s.dir with + | .left => + match Runs.remove s.context z.right with + | some r' => + match qe 32 s.scan_in.reverse z.left with + | (n,l') => + q3 (Runs.push s.scan_out n r') (fun r1 => + q3 (Runs.push s.context 1 r1) (fun r2 => + some ⟨l',r2,s.q,.left⟩)) + | none => none + | .right => + match Runs.remove s.context.reverse z.left with + | some l' => + match qe 32 s.scan_in z.right with + | (n,r') => + q3 (Runs.push s.scan_out.reverse n l') (fun l1 => + q3 (Runs.push s.context.reverse 1 l1) (fun l2 => + some ⟨l2,r',s.q,.right⟩)) + | none => none + else none +theorem qc_zero_spec {tm : Machine (Fin 2) (Fin 6)} {s : Scan} {c c' : RMConfig} + (hv : q5 tm s) (h : qc_zero s c=some c') : + (c.denote) [tm]⊢* (c'.denote):= by + unfold qc_zero at h + split_ifs at h with hq + have hq_eq : c.state=s.q:=beq_iff_eq.mp hq + rw [← qS s.dir c] + have hd_z : (qk s.dir c).dir=s.dir:=qW s.dir c + have hq_z : (qk s.dir c).state=s.q:= by rw [qI,hq_eq] + rcases hz : qk s.dir c with ⟨l,r,qz,dz⟩ + rw [hz] at hd_z hq_z h + dsimp only at hd_z hq_z h + subst hd_z hq_z + unfold q5 at hv + rcases s with ⟨sq,d,sin,sout,ctx⟩ + cases d + · dsimp only at h hv + cases hr : Runs.remove ctx r with + | none => rw [hr] at h; contradiction + | some r0 => + rw [hr] at h + have hqe_spec:=qe_spec 32 sin.reverse l + rcases hqe : qe 32 sin.reverse l with ⟨n,l0⟩ + rw [hqe] at h hqe_spec + simp only [strictRuns_eq] at h + injection h with hc'; subst hc' + unfold RMConfig.denote + dsimp only + rw [Runs.push_spec,Runs.push_spec,Runs.remove_spec hr,hqe_spec] + have hc1 : ctx ^ (1 : ℕ)=ctx:= by simp [pow_succ_list] + rw [hc1] + exact hv n (Runs.denote l0) (Runs.denote r0) + · dsimp only at h hv + cases hl : Runs.remove ctx.reverse l with + | none => rw [hl] at h; contradiction + | some l0 => + rw [hl] at h + have hqe_spec:=qe_spec 32 sin r + rcases hqe : qe 32 sin r with ⟨n,r0⟩ + rw [hqe] at h hqe_spec + simp only [strictRuns_eq] at h + injection h with hc'; subst hc' + unfold RMConfig.denote + dsimp only + rw [Runs.push_spec,Runs.push_spec,Runs.remove_spec hl,hqe_spec] + have hc1 : ctx.reverse ^ (1 : ℕ)=ctx.reverse:= by simp [pow_succ_list] + rw [hc1] + exact hv n (Runs.denote l0) (Runs.denote r0) +def qc (s : Scan) (keep : ℕ) (c : RMConfig) : Option RMConfig := + if keep == 0 then qc_zero s c + else + let z:=qk s.dir c + let w:=match s.dir with | .left => s.scan_in.reverse | .right => s.scan_in + let src:=match s.dir with | .left => z.left | .right => z.right + q4 ((qe 32 w src).1 - keep) (fun n => use_scan s n c) +theorem q8 {tm : Machine (Fin 2) (Fin 6)} {s : Scan} {keep : ℕ} {c c' : RMConfig} + (hv : q5 tm s) (h : qc s keep c=some c') : + (c.denote) [tm]⊢* (c'.denote):= by + unfold qc at h + split_ifs at h with hk0 + · exact qc_zero_spec hv h + · simp only [strictNat_eq] at h + exact use_scan_spec hv h +theorem wall_1 : q2 target_tm E 1 1 W W:= by + apply qG (w_mid:=[1,0,1,1,0,0,1,1,0,1]) + · intro l r; dsimp [W,ListBlank.append]; execute90 + · intro l r; dsimp [W,ListBlank.append]; execute90 +theorem inc0 : q2 target_tm E 1 0 (qn .D0) (qn .D1):= by + apply qj + intro l r; dsimp [qn,ListBlank.append]; execute90 +theorem inc1 : q2 target_tm E 1 0 (qn .D1 ++ W) (W ++ qn .D2):= by + apply qj + intro l r; dsimp [qn,W,ListBlank.append]; execute90 +theorem inc2 : q2 target_tm E 1 0 (qn .D2) (qn .D3):= by + apply qj + intro l r; dsimp [qn,ListBlank.append]; execute90 +theorem inc3 : q2 target_tm E 1 0 (qn .D3 ++ W) (W ++ qn .D4):= by + apply qj + intro l r; dsimp [qn,W,ListBlank.append]; execute90 +theorem inc4 : q2 target_tm E 1 0 (qn .D4) (qn .D5):= by + apply qj + intro l r; dsimp [qn,ListBlank.append]; execute90 +theorem inc5 : q2 target_tm E 1 1 (qn .D5) (W ++ qn .D0):= by + apply qG (w_mid:=[1,0,1,1,0,1,1,0,1,1,0,1]) + · intro l r; dsimp [qn,W,ListBlank.append]; execute90 + · intro l r; dsimp [qn,W,ListBlank.append]; execute90 +theorem one (p : Digit) (n : ℕ) : + q2 target_tm E 1 (qL p) + (qn p ++ W ^ (take p + n)) + (W ^ (give p) ++ qn (next p) ++ W ^ n):= by + cases p + · dsimp only [take,give,qL,next] + simpa only [Nat.zero_add,pow_zero_list,List.nil_append] using + q6 inc0 (qg target_tm E (W ^ n)) + · dsimp only [take,give,qL,next] + have h:=q6 inc1 (qg target_tm E (W ^ n)) + have h1 : 1 + n=n + 1:= by omega + rw [h1,pow_succ_list,pow_succ_list,pow_zero_list,List.append_nil] + simpa only [List.append_assoc] using h + · dsimp only [take,give,qL,next] + simpa only [Nat.zero_add,pow_zero_list,List.nil_append] using + q6 inc2 (qg target_tm E (W ^ n)) + · dsimp only [take,give,qL,next] + have h:=q6 inc3 (qg target_tm E (W ^ n)) + have h1 : 1 + n=n + 1:= by omega + rw [h1,pow_succ_list,pow_succ_list,pow_zero_list,List.append_nil] + simpa only [List.append_assoc] using h + · dsimp only [take,give,qL,next] + simpa only [Nat.zero_add,pow_zero_list,List.nil_append] using + q6 inc4 (qg target_tm E (W ^ n)) + · dsimp only [take,give,qL,next] + have h:=q6 inc5 (wall_n wall_1 n) + rw [Nat.zero_add,pow_succ_list,pow_zero_list,List.append_nil] + simpa only [List.append_assoc] using h +theorem emit (r : ListBlank (Fin 2)) : + (default <{{E}} ([1] +> r)) [target_tm]⊢* (([1,0,1] +> default) {{E}}> r):= by + dsimp [ListBlank.append]; execute90 +theorem batch_step (t : ℕ) (xs : qv) (e : ℕ) (ys : qv) (k : ℕ) (r : ListBlank (Fin 2)) + (h : qU t xs=some (e,ys)) : + (([1,0,1] +> default) {{E}}> ((W ^ k) +> (q9 xs) +> r)) [target_tm]⊢* + (([1,0,1] +> default) {{E}}> ((W ^ (k + e)) +> (q9 ys) +> r)) := + batch_root emit wall_1 one t xs e ys k r h +def scan_0 : Scan:=⟨A,.left,[1,0,1,1,0,0,1,1,0,1],[1,1,1,1,1,0,1,1,1,1],[0,1,0]⟩ +theorem scan_0_valid : q5 target_tm scan_0:= by + apply qf rfl + intro l r; dsimp [scan_0,List.reverse,List.reverseAux,ListBlank.append]; execute90 +def scan_1 : Scan:=⟨E,.right,[1,0,1,1,1,1,1,1,1,1],[0,1,1,0,1,1,0,1,1,0],[1]⟩ +theorem scan_1_valid : q5 target_tm scan_1:= by + apply qo rfl + intro l r; dsimp [scan_1,List.reverse,List.reverseAux,ListBlank.append]; execute90 +def scan_2 : Scan:=⟨C,.left,[1,1,0,1,1,0,0,1,1,0],[1,1,1,1,0,1,1,1,1,1],[0,1]⟩ +theorem scan_2_valid : q5 target_tm scan_2:= by + apply qf rfl + intro l r; dsimp [scan_2,List.reverse,List.reverseAux,ListBlank.append]; execute90 +def scan_3 : Scan:=⟨E,.right,[1,1,1,1,0,1,1,1,1,1],[1,0,1,1,0,0,1,1,0,1],[1,0,1]⟩ +theorem scan_3_valid : q5 target_tm scan_3:= by + apply qo rfl + intro l r; dsimp [scan_3,List.reverse,List.reverseAux,ListBlank.append]; execute90 +def scan_4 : Scan:=⟨E,.left,[1,1,0,1,1,0,0,1,1,0],[1,1,1,1,1,0,1,1,1,1],[1,1,1,0]⟩ +theorem scan_4_valid : q5 target_tm scan_4:= by + apply qf rfl + intro l r; dsimp [scan_4,List.reverse,List.reverseAux,ListBlank.append]; execute90 +def scan_5 : Scan:=⟨A,.left,[1,0,1,1,0,1],[1,0,1,1,1,1],[0]⟩ +theorem scan_5_valid : q5 target_tm scan_5:= by + apply qf rfl + intro l r; dsimp [scan_5,List.reverse,List.reverseAux,ListBlank.append]; execute90 +def scan_6 : Scan:=⟨C,.left,[1,1,0,1,1,0],[0,1,1,1,1,1],[]⟩ +theorem scan_6_valid : q5 target_tm scan_6:= by + apply qf rfl + intro l r; dsimp [scan_6,List.reverse,List.reverseAux,ListBlank.append]; execute90 +def scan_7 : Scan:=⟨E,.left,[1,1,0,1,1,0],[1,1,1,0,1,1],[]⟩ +theorem scan_7_valid : q5 target_tm scan_7:= by + apply qf rfl + intro l r; dsimp [scan_7,List.reverse,List.reverseAux,ListBlank.append]; execute90 +def scan_8 : Scan:=⟨A,.right,[1,1,1],[1,0,1],[1,0]⟩ +theorem scan_8_valid : q5 target_tm scan_8:= by + apply qo rfl + intro l r; dsimp [scan_8,List.reverse,List.reverseAux,ListBlank.append]; execute90 +def scan_9 : Scan:=⟨E,.right,[1,1,1],[1,0,1],[1,0,1]⟩ +theorem scan_9_valid : q5 target_tm scan_9:= by + apply qo rfl + intro l r; dsimp [scan_9,List.reverse,List.reverseAux,ListBlank.append]; execute90 +def run_raw (tm : Machine (Fin 2) (Fin 6)) : ℕ → RMConfig → Option RMConfig + | 0,c => some c + | n + 1,c => + match RM.raw tm c with + | some c' => run_raw tm n c' + | none => none +theorem run_raw_spec {n : ℕ} {c c' : RMConfig} + (h : run_raw target_tm n c=some c') : + (c.denote) [target_tm]⊢* (c'.denote):= by + induction n generalizing c with + | zero => + injection h with heq; subst heq; exact ⟨0,rfl⟩ + | succ n ih => + unfold run_raw at h + cases hr : RM.raw target_tm c with + | none => rw [hr] at h; contradiction + | some c₁ => + rw [hr] at h + exact q0 (RM.raw_spec hr) (ih h) +def qs (op arg : ℕ) (c : RMConfig) : Option RMConfig := + match op with + | 0 => run_raw target_tm arg c + | 1 => qT E c + | 2 => qc scan_0 arg c + | 3 => qc scan_1 arg c + | 4 => qc scan_2 arg c + | 5 => qc scan_3 arg c + | 6 => qc scan_4 arg c + | 7 => qc scan_5 arg c + | 8 => qc scan_6 arg c + | 9 => qc scan_7 arg c + | 10 => qc scan_8 arg c + | 11 => qc scan_9 arg c + | 12 => qa0 arg c + | _ => none +theorem qp {op arg : ℕ} {c c' : RMConfig} + (h : qs op arg c=some c') : + (c.denote) [target_tm]⊢* (c'.denote):= by + unfold qs at h + rcases op with _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | op + · exact run_raw_spec h + · exact qV batch_step h + · exact q8 scan_0_valid h + · exact q8 scan_1_valid h + · exact q8 scan_2_valid h + · exact q8 scan_3_valid h + · exact q8 scan_4_valid h + · exact q8 scan_5_valid h + · exact q8 scan_6_valid h + · exact q8 scan_7_valid h + · exact q8 scan_8_valid h + · exact q8 scan_9_valid h + · exact qa3 batch_step h + · contradiction +def qO : ℕ → ℕ → ℕ → RMConfig → Option RMConfig + | 0,_,_,c => some c + | n + 1,op,arg,c => + match qs op arg c with + | some c' => qO n op arg c' + | none => none +theorem run_rep1_spec {n op arg : ℕ} {c c' : RMConfig} + (h : qO n op arg c=some c') : + (c.denote) [target_tm]⊢* (c'.denote):= by + induction n generalizing c with + | zero => + injection h with heq; subst heq; exact ⟨0,rfl⟩ + | succ n ih => + unfold qO at h + cases ho : qs op arg c with + | none => rw [ho] at h; contradiction + | some c₁ => + rw [ho] at h + exact q0 (qp ho) (ih h) +def qN : ℕ → ℕ → ℕ → ℕ → ℕ → RMConfig → Option RMConfig + | 0,_,_,_,_,c => some c + | n + 1,op1,arg1,op2,arg2,c => + match qs op1 arg1 c with + | some c₁ => + match qs op2 arg2 c₁ with + | some c₂ => qN n op1 arg1 op2 arg2 c₂ + | none => none + | none => none +theorem run_rep2_spec {n op1 arg1 op2 arg2 : ℕ} {c c' : RMConfig} + (h : qN n op1 arg1 op2 arg2 c=some c') : + (c.denote) [target_tm]⊢* (c'.denote):= by + induction n generalizing c with + | zero => + injection h with heq; subst heq; exact ⟨0,rfl⟩ + | succ n ih => + unfold qN at h + cases ho1 : qs op1 arg1 c with + | none => rw [ho1] at h; contradiction + | some c₁ => + rw [ho1] at h; dsimp only at h + cases ho2 : qs op2 arg2 c₁ with + | none => rw [ho2] at h; contradiction + | some c₂ => + rw [ho2] at h; dsimp only at h + exact q0 (qp ho1) (q0 (qp ho2) (ih h)) +inductive Cmd where + | one (op arg : ℕ) + | rep1 (cnt op arg : ℕ) + | rep2 (cnt op1 arg1 op2 arg2 : ℕ) +def exec_cmd (cmd : Cmd) (c : RMConfig) : Option RMConfig := + match cmd with + | .one op arg => qs op arg c + | .rep1 cnt op arg => qO cnt op arg c + | .rep2 cnt op1 arg1 op2 arg2 => qN cnt op1 arg1 op2 arg2 c +theorem exec_cmd_spec {cmd : Cmd} {c c' : RMConfig} + (h : exec_cmd cmd c=some c') : + (c.denote) [target_tm]⊢* (c'.denote):= by + cases cmd with + | one op arg => exact qp h + | rep1 cnt op arg => exact run_rep1_spec h + | rep2 cnt op1 arg1 op2 arg2 => exact run_rep2_spec h +def q7 : List Cmd → RMConfig → Option RMConfig + | [],c => some c + | cmd :: rest,c => + match exec_cmd cmd c with + | some c' => q7 rest c' + | none => none +theorem q1 {cs : List Cmd} {c c' : RMConfig} + (h : q7 cs c=some c') : + (c.denote) [target_tm]⊢* (c'.denote):= by + induction cs generalizing c with + | nil => + injection h with heq; subst heq; exact ⟨0,rfl⟩ + | cons cmd rest ih => + unfold q7 at h + cases hc : exec_cmd cmd c with + | none => rw [hc] at h; contradiction + | some c₁ => + rw [hc] at h; dsimp only at h + exact q0 (exec_cmd_spec hc) (ih h) +def isHalted (tm : Machine (Fin 2) (Fin 6)) (c : RMConfig) : Bool := + let b:=match c.dir with + | .left => (Runs.pop c.left).1 + | .right => (Runs.pop c.right).1 + (tm c.state b).isNone +theorem isHalted_spec {c : RMConfig} (h : isHalted target_tm c=true) : + (step target_tm c.denote).isNone:= by + rcases c with ⟨l,r,q,d⟩ + unfold isHalted at h + cases d + · dsimp only at h + unfold RMConfig.denote step + dsimp only + rw [Runs.pop_spec l,Turing.ListBlank.head_cons] + cases htm : target_tm q (Runs.pop l).1 with + | none => rfl + | some _ => rw [htm] at h; contradiction + · dsimp only at h + unfold RMConfig.denote step + dsimp only + rw [Runs.pop_spec r,Turing.ListBlank.head_cons] + cases htm : target_tm q (Runs.pop r).1 with + | none => rfl + | some _ => rw [htm] at h; contradiction +def cfg_0 : RMConfig:=⟨[],[],A,.right⟩ +def cfg_1 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],14),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],8),([1],3)],E,.right⟩ +def cfg_2 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],241),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],53),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],5),([1],3)],E,.right⟩ +def cfg_3 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],1729),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],782),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],210),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],16),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],13),([1],3)],E,.right⟩ +def cfg_4 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],3887),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],6022),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],8174),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],5646),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],605),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],51),([1],3)],E,.right⟩ +def cfg_5 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],139967),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],226237),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],26610),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],34796),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],4289),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],4998),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],497),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],27),([1],3)],E,.right⟩ +def cfg_6 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],1632251),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],11843205),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],797367),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],181662),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],8805),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],4241),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],371),([1,1,1,1,1,1,1,1],1)],E,.right⟩ +def cfg_7 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],4572289),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],590979),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1072378),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],11749893),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],781815),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],179070),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],8373),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],4169),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],356),([1],3)],E,.right⟩ +def cfg_8 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],30233087),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1945900),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],67310045),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2861710),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],232570),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],11609925),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],758487),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],175182),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],7725),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],4061),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],332),([1],3)],E,.right⟩ +def cfg_9 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],2295683953),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],202569288),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],241946316),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],54454285),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],719083),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],11446630),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],731271),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],170646),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],6969),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3935),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],304),([1],3)],E,.right⟩ +def cfg_10 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],433652009),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],16189663086),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1363751089),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],47247144),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],216059292),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],50139781),([1,1,1,1],2),([1,1,1,1,0,1,1,1,1,1],11326784),([0,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],711297),([0,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],167317),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],6414),([1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3843),([1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],284),([1],3)],E,.right⟩ +def cfg_11 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],14279327156),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],12993403879),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],15126217323),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1186510129),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],17706984),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],211135932),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],49319221),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],11190023),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],688503),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],163518),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],5781),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3737),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],260),([1],3)],E,.right⟩ +def cfg_12 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],39182082047),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],63568800907),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],85467965436),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],41668468650),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],8717755377),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],14413609239),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1067742115),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],206097084),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],48479413),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],11050055),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],665175),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],159630),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],5133),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3629),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],236),([1],3)],E,.right⟩ +def cfg_13 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],947788796189),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3338260719276),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],80777430892),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],49551056890),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],35682317226),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],7720063473),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],14247327255),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1040028451),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],201478140),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],47709589),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],10921751),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],643791),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],156066),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],4539),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3530),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],214),([1],3)],E,.right⟩ +def cfg_14 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],8463329722367),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],15015622214732),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],11794710009590),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],566880020609),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2699281072528),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],10368974843),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],29151970218),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],6631672305),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],14065928727),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1009795363),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],196439292),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],46869781),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],10781783),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],620463),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],152178),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3891),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3422),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],190),([1],3)],E,.right⟩ +def cfg_15 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],643687451900791),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],421120352273026),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],16167460699058),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2118173193801),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],8517739583725),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],20718282965),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2608254116254),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],22621623209),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],5543281137),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],13884530199),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],979562275),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],191400444),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],46029973),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],10641815),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],597135),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],148290),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3243),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3314),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],166),([1],3)],E,.right⟩ +def cfg_16 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],4466942543772001),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2775521742390931),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3245935587750055),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],185028888216425),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],344677258325632),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3426945041159),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],8159464635577),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2565806860701),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],15547080617),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],4364190705),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],13688015127),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],946809763),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],185941692),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],45120181),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],10490183),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],571863),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],144078),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2541),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3197),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],140),([1],3)],E,.right⟩ +def cfg_17 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],10968475320188927),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],22072363915935747),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],21900271405424549),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1099782457362068),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2966645706911911),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],138480574743401),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],336919206080128),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2133936333575),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],7943963184313),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2529889952157),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],9560929193),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3366498801),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],13521733143),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],919096099),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],181322748),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],44350357),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],10361879),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],550479),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],140514),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1947),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3098),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],118),([1],3)],E,.right⟩ +def cfg_18 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],147962543465675451),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],35529259535392476),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],143551584287734354),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],14725619833585334),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2687355826073766),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],91932261270377),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],329161153834624),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],840927625991),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],7728461733049),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2493973043613),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],3574777769),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2368806897),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],13355451159),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],891382435),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],176703804),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],43580533),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],10233575),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],529095),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],136950),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1353),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2999),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],96),([1],3)],E,.right⟩ +def cfg_19 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],36514618862704129),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],46569173798179584),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],806290250466731119),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],603374972797170723),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],136963769242827634),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],13627650659434214),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2504360963715246),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],61433117543957),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],324077963213554),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],7582036317864),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2469568807749),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1280415728),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],13174052631),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],861149347),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],171664956),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],42740725),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],10093607),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],505767),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],133062),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],705),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2891),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],72),([1],3)],E,.right⟩ +def cfg_20 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],144515463148616111),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1763371228290069298),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],54106918031395816),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],744645192201139930),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],794196152293467251),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],601359289768293411),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],136627822071348082),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],13571659464187622),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2495029097840814),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],59877806564885),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],323818744717042),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],7538833235112),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2462368293957),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],80330096),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],12974038359),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],827813635),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],166109004),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],41814733),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],9939275),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],480045),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],128775),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2765),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],44),([1],3)],E,.right⟩ +def cfg_21 : RMConfig:=⟨[([1],1),([0],1),([1],1)],[([1,1,1,1,0,1,1,1,1,1],394865111526801407),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],5571086799836381189),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],294919453089922226),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],1562811241455326001),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],20680253558938600),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],739074081455730394),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],793267633835898995),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],601204536692032035),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],136602029891971186),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],13567360767624806),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2494312648413678),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],59758398327029),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],323798843344066),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],7535516339616),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2461815478041),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],12948844121),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],823614595),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],165409164),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],41698093),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],9919835),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],476805),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],128235),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],2675),([1,1,1,1,1,1,1,1,1,1,1,1],1),([1,1,1,1,0,1,1,1,1,1],24),([1],3)],E,.right⟩ +def cfg_22 : RMConfig:=⟨[([0,1,1,0,1,1,0,1,1,0],2562),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],127559),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],472754),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],9895534),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],41552292),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],164534363),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],818365794),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],12917351320),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],2461626521240),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],7534382598815),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],323792040899265),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],59717583658228),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],2494067760400877),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],13565891439548005),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],136593213923510385),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],601151640881267234),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],792950258971310194),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],737169832268197593),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],9254758433741799),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],1494258270704145199),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],3685171709879685247),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],34617925443173174206),([0,1],1),([1,0,1],4),([1,0,1,1,0,1,1,0],1),([0,1,1,0,1,1,0,1,1,0],378258698465341521),([0,1],1),([1,0,1],5),([1,0,1,1,0,0,1,1,0,1],5133246449848418304),([1],1),([0],1),([1],2),([0],2),([1],2),([0],1),([1],1)],[([1],2),([0],1),([1],5),([0],1),([1],4)],F,.left⟩ +def cmds_0 : List Cmd:=[.one 0 72,.one 1 0,.one 0 112,.one 1 0,.one 0 139,.one 1 0,.one 1 0,.one 0 35,.one 10 0,.one 0 97,.one 1 0,.one 1 0,.one 0 56,.one 10 0,.one 0 2,.one 8 0,.one 0 121,.one 1 0,.one 1 0,.one 0 56,.one 10 0,.one 0 89,.one 7 0,.one 0 145,.one 1 0,.one 1 0,.one 5 0,.one 11 0,.one 0 16,.one 8 0,.one 0 299,.one 1 0,.one 1 0,.one 5 0,.one 0 46,.one 8 0,.one 0 259,.one 1 0,.one 1 0,.one 0 56,.one 10 0,.one 0 1,.one 3 0,.one 0 26,.one 4 0,.one 0 163,.one 1 0,.one 1 0,.one 5 0,.one 11 0,.one 0 155,.one 7 0,.one 0 265,.one 1 0,.one 1 0,.one 12 4,.one 5 0,.one 11 0,.one 0 16,.one 8 0,.one 4 0,.one 0 71,.one 1 0,.one 1 0,.one 5 0,.one 0 46,.one 8 0,.one 0 40,.one 2 0,.one 0 35,.one 1 0,.one 1 0,.one 0 56,.one 10 0,.one 0 1,.one 3 0,.one 0 26,.one 4 0,.one 0 163,.one 1 0,.one 1 0,.one 5 0,.one 11 0,.one 3 0,.one 0 7,.one 2 0,.one 0 281,.one 1 0,.one 1 0,.one 12 4] +set_option maxHeartbeats 8000000 in +theorem chunk_0_ok : q7 cmds_0 cfg_0=some cfg_1:= by decide +kernel +def cmds_1 : List Cmd:=[.one 5 0,.one 11 0,.one 3 0,.one 0 7,.one 2 0,.one 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 2 11 0 3 0,.one 0 7,.rep2 2 2 0 7 0,.one 2 0,.one 0 35,.one 12 8,.one 1 0,.one 5 0,.one 11 0,.one 3 0,.one 0 7,.one 2 0,.one 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 2 11 0 3 0,.one 0 7,.rep2 2 2 0 7 0,.one 2 0,.one 0 35,.one 12 8,.one 5 0,.one 11 0,.one 3 0,.one 11 0,.one 0 73,.one 7 0,.one 2 0,.one 7 0,.one 2 0,.one 0 35,.one 1 0,.one 1 0,.one 5 0,.rep2 2 11 0 3 0,.one 0 46,.one 8 0,.rep2 2 4 0 8 0,.one 4 0,.one 0 71,.one 1 0,.one 1 0,.one 12 1,.one 1 0,.one 5 0,.one 11 0,.one 3 0,.one 0 31,.one 8 0,.one 0 40,.one 2 0,.one 7 0,.one 2 0,.one 0 35,.one 1 0,.one 1 0,.one 5 0,.rep2 2 11 0 3 0,.one 0 26,.rep2 2 4 0 8 0,.one 4 0,.one 0 71,.one 1 0,.one 1 0,.one 5 0,.rep2 2 11 0 3 0,.one 0 7,.rep2 2 2 0 7 0,.one 2 0,.one 0 35,.one 12 8,.one 5 0,.rep2 2 11 0 3 0,.one 0 7,.rep2 2 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 3 11 0 3 0,.one 0 7,.rep2 3 2 0 7 0,.one 2 0,.one 0 35,.one 12 13] +set_option maxHeartbeats 8000000 in +theorem chunk_1_ok : q7 cmds_1 cfg_1=some cfg_2:= by decide +kernel +def cmds_2 : List Cmd:=[.one 5 0,.rep2 2 11 0 3 0,.one 0 7,.rep2 2 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 3 11 0 3 0,.one 0 7,.rep2 3 2 0 7 0,.one 2 0,.one 0 35,.one 12 9,.one 5 0,.rep2 2 11 0 3 0,.one 11 0,.one 0 73,.one 7 0,.rep2 2 2 0 7 0,.one 2 0,.one 0 35,.one 1 0,.one 1 0,.one 5 0,.rep2 3 11 0 3 0,.one 0 46,.one 8 0,.rep2 3 4 0 8 0,.one 4 0,.one 0 71,.one 1 0,.one 1 0,.one 12 4,.one 5 0,.rep2 2 11 0 3 0,.one 0 31,.one 8 0,.one 0 40,.rep2 2 2 0 7 0,.one 2 0,.one 0 35,.one 1 0,.one 1 0,.one 5 0,.rep2 3 11 0 3 0,.one 0 26,.rep2 3 4 0 8 0,.one 4 0,.one 0 71,.one 1 0,.one 1 0,.one 5 0,.rep2 3 11 0 3 0,.one 0 7,.rep2 3 2 0 7 0,.one 2 0,.one 0 35,.one 12 10,.one 5 0,.rep2 3 11 0 3 0,.one 0 7,.rep2 3 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 4 11 0 3 0,.one 0 7,.rep2 4 2 0 7 0,.one 2 0,.one 0 35,.one 12 15,.one 5 0,.rep2 3 11 0 3 0,.one 0 7,.rep2 3 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 4 11 0 3 0,.one 0 7,.rep2 4 2 0 7 0,.one 2 0,.one 0 35,.one 12 10] +set_option maxHeartbeats 8000000 in +theorem chunk_2_ok : q7 cmds_2 cfg_2=some cfg_3:= by decide +kernel +def cmds_3 : List Cmd:=[.one 5 0,.rep2 4 11 0 3 0,.one 0 7,.rep2 4 2 0 7 0,.one 2 0,.one 0 35,.one 12 8,.one 5 0,.rep2 4 11 0 3 0,.one 0 7,.rep2 4 2 0 7 0,.one 2 0,.one 0 35,.one 12 6,.one 5 0,.rep2 4 11 0 3 0,.one 0 7,.rep2 4 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 5 11 0 3 0,.one 0 7,.rep2 5 2 0 7 0,.one 2 0,.one 0 35,.one 12 17,.one 5 0,.rep2 4 11 0 3 0,.one 0 7,.rep2 4 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 4 11 0 3 0,.one 11 0,.one 0 73,.one 7 0,.rep2 4 2 0 7 0,.one 2 0,.one 0 35,.one 1 0,.one 1 0,.one 12 10,.one 5 0,.rep2 4 11 0 3 0,.one 0 46,.one 8 0,.rep2 4 4 0 8 0,.one 4 0,.one 0 71,.one 1 0,.one 1 0,.one 12 1,.one 5 0,.rep2 4 11 0 3 0,.one 0 31,.one 8 0,.one 0 40,.rep2 4 2 0 7 0,.one 2 0,.one 0 35,.one 1 0,.one 1 0,.one 12 5,.one 5 0,.rep2 4 11 0 3 0,.one 0 26,.rep2 4 4 0 8 0,.one 4 0,.one 0 71,.one 1 0,.one 1 0,.one 5 0,.rep2 4 11 0 3 0,.one 0 7,.rep2 4 2 0 7 0,.one 2 0,.one 0 35,.one 12 3,.one 5 0,.rep2 5 11 0 3 0,.one 0 7,.rep2 5 2 0 7 0,.one 2 0,.one 0 35,.one 12 16,.one 5 0,.rep2 4 11 0 3 0,.one 0 7,.rep2 4 2 0 7 0,.one 2 0,.one 0 35,.one 12 2] +set_option maxHeartbeats 8000000 in +theorem chunk_3_ok : q7 cmds_3 cfg_3=some cfg_4:= by decide +kernel +def cmds_4 : List Cmd:=[.one 5 0,.rep2 5 11 0 3 0,.one 0 7,.rep2 5 2 0 7 0,.one 2 0,.one 0 35,.one 12 12,.one 5 0,.rep2 5 11 0 3 0,.one 0 7,.rep2 5 2 0 7 0,.one 2 0,.one 0 35,.one 12 10,.one 5 0,.rep2 5 11 0 3 0,.one 0 7,.rep2 5 2 0 7 0,.one 2 0,.one 0 35,.one 12 3,.one 5 0,.rep2 6 11 0 3 0,.one 0 7,.rep2 6 2 0 7 0,.one 2 0,.one 0 35,.one 12 7,.one 5 0,.rep2 6 11 0 3 0,.one 0 7,.rep2 6 2 0 7 0,.one 2 0,.one 0 35,.one 12 20,.one 5 0,.rep2 5 11 0 3 0,.one 0 7,.rep2 5 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 6 11 0 3 0,.one 0 7,.rep2 6 2 0 7 0,.one 2 0,.one 0 35,.one 12 13,.one 5 0,.rep2 6 11 0 3 0,.one 0 7,.rep2 6 2 0 7 0,.one 2 0,.one 0 35,.one 12 8,.one 5 0,.rep2 6 11 0 3 0,.one 0 7,.rep2 6 2 0 7 0,.one 2 0,.one 0 35,.one 12 14,.one 5 0,.rep2 6 11 0 3 0,.one 0 7,.rep2 6 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 7 11 0 3 0,.one 0 7,.rep2 7 2 0 7 0,.one 2 0,.one 0 35,.one 12 20,.one 5 0,.rep2 6 11 0 3 0,.one 0 7,.rep2 6 2 0 7 0,.one 2 0,.one 0 35,.one 12 2] +set_option maxHeartbeats 8000000 in +theorem chunk_4_ok : q7 cmds_4 cfg_4=some cfg_5:= by decide +kernel +def cmds_5 : List Cmd:=[.one 5 0,.rep2 7 11 0 3 0,.one 0 7,.rep2 7 2 0 7 0,.one 2 0,.one 0 35,.one 12 14,.one 5 0,.rep2 7 11 0 3 0,.one 0 7,.rep2 7 2 0 7 0,.one 2 0,.one 0 35,.one 12 12,.one 5 0,.rep2 7 11 0 3 0,.one 0 7,.rep2 7 2 0 7 0,.one 2 0,.one 0 35,.one 12 10,.one 5 0,.rep2 7 11 0 3 0,.one 0 7,.rep2 7 2 0 7 0,.one 2 0,.one 0 35,.one 12 15,.one 5 0,.rep2 7 11 0 3 0,.one 0 7,.rep2 7 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 8 11 0 3 0,.one 0 7,.rep2 8 2 0 7 0,.one 2 0,.one 0 35,.one 12 27,.one 5 0,.rep2 7 11 0 3 0,.one 0 7,.rep2 7 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 8 11 0 3 0,.one 0 7,.rep2 8 2 0 7 0,.one 2 0,.one 0 35,.one 12 23,.one 5 0,.rep2 7 11 0 3 0,.one 0 7,.rep2 7 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 8 11 0 3 0,.one 0 7,.rep2 8 2 0 7 0,.one 2 0,.one 0 35,.one 12 16,.one 5 0,.rep2 8 11 0 3 0,.one 0 7,.rep2 8 2 0 7 0,.one 2 0,.one 0 35,.one 12 14,.one 5 0,.rep2 8 11 0 3 0,.one 0 7,.rep2 8 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 9 11 0 3 0,.one 0 7,.rep2 9 2 0 7 0,.one 2 0,.one 0 35,.one 12 30,.one 5 0,.rep2 7 11 0 3 0,.one 11 0,.one 0 73,.one 7 0,.rep2 7 2 0 7 0,.one 2 0,.one 0 35,.one 1 0,.one 1 0,.one 12 14,.one 5 0,.rep2 6 11 0 3 0,.one 0 46,.one 8 0,.rep2 6 4 0 8 0,.one 4 0,.one 0 71,.one 1 0,.one 1 0] +set_option maxHeartbeats 8000000 in +theorem chunk_5_ok : q7 cmds_5 cfg_5=some cfg_6:= by decide +kernel +def cmds_6 : List Cmd:=[.one 5 0,.rep2 6 11 0 3 0,.one 0 31,.one 8 0,.one 0 40,.rep2 6 2 0 7 0,.one 2 0,.one 0 35,.one 1 0,.one 1 0,.one 5 0,.rep2 7 11 0 3 0,.one 0 26,.rep2 7 4 0 8 0,.one 4 0,.one 0 71,.one 1 0,.one 1 0,.one 5 0,.rep2 7 11 0 3 0,.one 0 7,.rep2 7 2 0 7 0,.one 2 0,.one 0 35,.one 12 15,.one 5 0,.rep2 7 11 0 3 0,.one 0 7,.rep2 7 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 8 11 0 3 0,.one 0 7,.rep2 8 2 0 7 0,.one 2 0,.one 0 35,.one 12 26,.one 5 0,.rep2 7 11 0 3 0,.one 0 7,.rep2 7 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 8 11 0 3 0,.one 0 7,.rep2 8 2 0 7 0,.one 2 0,.one 0 35,.one 12 16,.one 5 0,.rep2 8 11 0 3 0,.one 0 7,.rep2 8 2 0 7 0,.one 2 0,.one 0 35,.one 12 14] +set_option maxHeartbeats 8000000 in +theorem chunk_6_ok : q7 cmds_6 cfg_6=some cfg_7:= by decide +kernel +def cmds_7 : List Cmd:=[.one 5 0,.rep2 8 11 0 3 0,.one 0 7,.rep2 8 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 9 11 0 3 0,.one 0 7,.rep2 9 2 0 7 0,.one 2 0,.one 0 35,.one 12 26,.one 5 0,.rep2 8 11 0 3 0,.one 0 7,.rep2 8 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 9 11 0 3 0,.one 0 7,.rep2 9 2 0 7 0,.one 2 0,.one 0 35,.one 12 28,.one 5 0,.rep2 8 11 0 3 0,.one 0 7,.rep2 8 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 9 11 0 3 0,.one 0 7,.rep2 9 2 0 7 0,.one 2 0,.one 0 35,.one 12 17,.one 5 0,.rep2 9 11 0 3 0,.one 0 7,.rep2 9 2 0 7 0,.one 2 0,.one 0 35,.one 12 15,.one 5 0,.rep2 9 11 0 3 0,.one 0 7,.rep2 9 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 10 11 0 3 0,.one 0 7,.rep2 10 2 0 7 0,.one 2 0,.one 0 35,.one 12 32,.one 5 0,.rep2 9 11 0 3 0,.one 0 7,.rep2 9 2 0 7 0,.one 2 0,.one 0 35,.one 12 12,.one 5 0,.rep2 9 11 0 3 0,.one 0 7,.rep2 9 2 0 7 0,.one 2 0,.one 0 35,.one 12 14,.one 5 0,.rep2 9 11 0 3 0,.one 0 7,.rep2 9 2 0 7 0,.one 2 0,.one 0 35,.one 12 3] +set_option maxHeartbeats 8000000 in +theorem chunk_7_ok : q7 cmds_7 cfg_7=some cfg_8:= by decide +kernel +def cmds_8 : List Cmd:=[.one 5 0,.rep2 10 11 0 3 0,.one 0 7,.rep2 10 2 0 7 0,.one 2 0,.one 0 35,.one 12 13,.one 5 0,.rep2 10 11 0 3 0,.one 0 7,.rep2 10 2 0 7 0,.one 2 0,.one 0 35,.one 12 14,.one 5 0,.rep2 10 11 0 3 0,.one 0 7,.rep2 10 2 0 7 0,.one 2 0,.one 0 35,.one 12 16,.one 5 0,.rep2 10 11 0 3 0,.one 0 7,.rep2 10 2 0 7 0,.one 2 0,.one 0 35,.one 12 10,.one 5 0,.rep2 10 11 0 3 0,.one 0 7,.rep2 10 2 0 7 0,.one 2 0,.one 0 35,.one 12 19,.one 5 0,.rep2 10 11 0 3 0,.one 0 7,.rep2 10 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 11 11 0 3 0,.one 0 7,.rep2 11 2 0 7 0,.one 2 0,.one 0 35,.one 12 34,.one 5 0,.rep2 10 11 0 3 0,.one 0 7,.rep2 10 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 11 11 0 3 0,.one 0 7,.rep2 11 2 0 7 0,.one 2 0,.one 0 35,.one 12 32,.one 5 0,.rep2 10 11 0 3 0,.one 0 7,.rep2 10 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 11 11 0 3 0,.one 0 7,.rep2 11 2 0 7 0,.one 2 0,.one 0 35,.one 12 19,.one 5 0,.rep2 11 11 0 3 0,.one 0 7,.rep2 11 2 0 7 0,.one 2 0,.one 0 35,.one 12 17,.one 5 0,.rep2 11 11 0 3 0,.one 0 7,.rep2 11 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 12 11 0 3 0,.one 0 7,.rep2 12 2 0 7 0,.one 2 0,.one 0 35,.one 12 45] +set_option maxHeartbeats 8000000 in +theorem chunk_8_ok : q7 cmds_8 cfg_8=some cfg_9:= by decide +kernel +def cmds_9 : List Cmd:=[.one 5 0,.rep2 10 11 0 3 0,.one 0 7,.rep2 10 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 11 11 0 3 0,.one 0 7,.rep2 11 2 0 7 0,.one 2 0,.one 0 35,.one 12 19,.one 5 0,.rep2 11 11 0 3 0,.one 0 7,.rep2 11 2 0 7 0,.one 2 0,.one 0 35,.one 12 17,.one 5 0,.rep2 11 11 0 3 0,.one 0 7,.rep2 11 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 12 11 0 3 0,.one 0 7,.rep2 12 2 0 7 0,.one 2 0,.one 0 35,.one 12 37,.one 5 0,.rep2 11 11 0 3 0,.one 0 7,.rep2 11 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 12 11 0 3 0,.one 0 7,.rep2 12 2 0 7 0,.one 2 0,.one 0 35,.one 12 21,.one 5 0,.rep2 12 11 0 3 0,.one 0 7,.rep2 12 2 0 7 0,.one 2 0,.one 0 35,.one 12 19,.one 5 0,.rep2 12 11 0 3 0,.one 0 7,.rep2 12 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 13 11 0 3 0,.one 0 7,.rep2 13 2 0 7 0,.one 2 0,.one 0 35,.one 12 41,.one 5 0,.rep2 12 11 0 3 0,.one 0 7,.rep2 12 2 0 7 0,.one 2 0,.one 0 35,.one 12 21,.one 1 0] +set_option maxHeartbeats 8000000 in +theorem chunk_9_ok : q7 cmds_9 cfg_9=some cfg_10:= by decide +kernel +def cmds_10 : List Cmd:=[.one 1 0,.one 5 0,.rep2 11 11 0 3 0,.one 0 7,.rep2 11 2 0 7 0,.one 2 0,.one 0 35,.one 12 4,.one 5 0,.rep2 12 11 0 3 0,.one 0 7,.rep2 12 2 0 7 0,.one 2 0,.one 0 35,.one 12 17,.one 5 0,.rep2 12 11 0 3 0,.one 0 7,.rep2 12 2 0 7 0,.one 2 0,.one 0 35,.one 12 38,.one 5 0,.rep2 11 11 0 3 0,.one 0 7,.rep2 11 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 12 11 0 3 0,.one 0 7,.rep2 12 2 0 7 0,.one 2 0,.one 0 35,.one 12 21,.one 5 0,.rep2 12 11 0 3 0,.one 0 7,.rep2 12 2 0 7 0,.one 2 0,.one 0 35,.one 12 19,.one 5 0,.rep2 12 11 0 3 0,.one 0 7,.rep2 12 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 13 11 0 3 0,.one 0 7,.rep2 13 2 0 7 0,.one 2 0,.one 0 35,.one 12 40,.one 5 0,.rep2 12 11 0 3 0,.one 0 7,.rep2 12 2 0 7 0,.one 2 0,.one 0 35,.one 12 18,.one 5 0,.rep2 12 11 0 3 0,.one 0 7,.rep2 12 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 13 11 0 3 0,.one 0 7,.rep2 13 2 0 7 0,.one 2 0,.one 0 35,.one 12 37] +set_option maxHeartbeats 8000000 in +theorem chunk_10_ok : q7 cmds_10 cfg_10=some cfg_11:= by decide +kernel +def cmds_11 : List Cmd:=[.one 5 0,.rep2 12 11 0 3 0,.one 0 7,.rep2 12 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 13 11 0 3 0,.one 0 7,.rep2 13 2 0 7 0,.one 2 0,.one 0 35,.one 12 22,.one 5 0,.rep2 13 11 0 3 0,.one 0 7,.rep2 13 2 0 7 0,.one 2 0,.one 0 35,.one 12 20,.one 5 0,.rep2 13 11 0 3 0,.one 0 7,.rep2 13 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 14 11 0 3 0,.one 0 7,.rep2 14 2 0 7 0,.one 2 0,.one 0 35,.one 12 37,.one 5 0,.rep2 13 11 0 3 0,.one 0 7,.rep2 13 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 14 11 0 3 0,.one 0 7,.rep2 14 2 0 7 0,.one 2 0,.one 0 35,.one 12 25,.one 5 0,.rep2 14 11 0 3 0,.one 0 7,.rep2 14 2 0 7 0,.one 2 0,.one 0 35,.one 12 26,.one 5 0,.rep2 13 11 0 3 0,.one 0 7,.rep2 13 2 0 7 0,.one 2 0,.one 0 35,.one 12 22,.one 5 0,.rep2 13 11 0 3 0,.one 0 7,.rep2 13 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 14 11 0 3 0,.one 0 7,.rep2 14 2 0 7 0,.one 2 0,.one 0 35,.one 12 39,.one 5 0,.rep2 13 11 0 3 0,.one 0 7,.rep2 13 2 0 7 0,.one 2 0,.one 0 35,.one 12 2] +set_option maxHeartbeats 8000000 in +theorem chunk_11_ok : q7 cmds_11 cfg_11=some cfg_12:= by decide +kernel +def cmds_12 : List Cmd:=[.one 5 0,.rep2 14 11 0 3 0,.one 0 7,.rep2 14 2 0 7 0,.one 2 0,.one 0 35,.one 12 23,.one 5 0,.rep2 14 11 0 3 0,.one 0 7,.rep2 14 2 0 7 0,.one 2 0,.one 0 35,.one 12 21,.one 5 0,.rep2 14 11 0 3 0,.one 0 7,.rep2 14 2 0 7 0,.one 2 0,.one 0 35,.one 12 3,.one 5 0,.rep2 15 11 0 3 0,.one 0 7,.rep2 15 2 0 7 0,.one 2 0,.one 0 35,.one 12 43,.one 5 0,.rep2 14 11 0 3 0,.one 0 7,.rep2 14 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 15 11 0 3 0,.one 0 7,.rep2 15 2 0 7 0,.one 2 0,.one 0 35,.one 12 25,.one 5 0,.rep2 15 11 0 3 0,.one 0 7,.rep2 15 2 0 7 0,.one 2 0,.one 0 35,.one 12 20,.one 5 0,.rep2 15 11 0 3 0,.one 0 7,.rep2 15 2 0 7 0,.one 2 0,.one 0 35,.one 12 5,.one 5 0,.rep2 16 11 0 3 0,.one 0 7,.rep2 16 2 0 7 0,.one 2 0,.one 0 35,.one 12 18,.one 5 0,.rep2 16 11 0 3 0,.one 0 7,.rep2 16 2 0 7 0,.one 2 0,.one 0 35,.one 12 48,.one 5 0,.rep2 15 11 0 3 0,.one 0 7,.rep2 15 2 0 7 0,.one 2 0,.one 0 35,.one 12 23] +set_option maxHeartbeats 8000000 in +theorem chunk_12_ok : q7 cmds_12 cfg_12=some cfg_13:= by decide +kernel +def cmds_13 : List Cmd:=[.one 5 0,.rep2 15 11 0 3 0,.one 0 7,.rep2 15 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 16 11 0 3 0,.one 0 7,.rep2 16 2 0 7 0,.one 2 0,.one 0 35,.one 12 43,.one 5 0,.rep2 15 11 0 3 0,.one 0 7,.rep2 15 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 16 11 0 3 0,.one 0 7,.rep2 16 2 0 7 0,.one 2 0,.one 0 35,.one 12 27,.one 5 0,.rep2 16 11 0 3 0,.one 0 7,.rep2 16 2 0 7 0,.one 2 0,.one 0 35,.one 12 19,.one 5 0,.rep2 16 11 0 3 0,.one 0 7,.rep2 16 2 0 7 0,.one 2 0,.one 0 35,.one 12 26,.one 5 0,.rep2 16 11 0 3 0,.one 0 7,.rep2 16 2 0 7 0,.one 2 0,.one 0 35,.one 12 3,.one 5 0,.rep2 17 11 0 3 0,.one 0 7,.rep2 17 2 0 7 0,.one 2 0,.one 0 35,.one 12 44,.one 5 0,.rep2 16 11 0 3 0,.one 0 7,.rep2 16 2 0 7 0,.one 2 0,.one 0 35,.one 12 23,.one 5 0,.rep2 16 11 0 3 0,.one 0 7,.rep2 16 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 17 11 0 3 0,.one 0 7,.rep2 17 2 0 7 0,.one 2 0,.one 0 35,.one 12 48,.one 5 0,.rep2 16 11 0 3 0,.one 0 7,.rep2 16 2 0 7 0,.one 2 0,.one 0 35,.one 12 2] +set_option maxHeartbeats 8000000 in +theorem chunk_13_ok : q7 cmds_13 cfg_13=some cfg_14:= by decide +kernel +def cmds_14 : List Cmd:=[.one 5 0,.rep2 17 11 0 3 0,.one 0 7,.rep2 17 2 0 7 0,.one 2 0,.one 0 35,.one 12 27,.one 5 0,.rep2 17 11 0 3 0,.one 0 7,.rep2 17 2 0 7 0,.one 2 0,.one 0 35,.one 12 25,.one 5 0,.rep2 17 11 0 3 0,.one 0 7,.rep2 17 2 0 7 0,.one 2 0,.one 0 35,.one 12 3,.one 5 0,.rep2 18 11 0 3 0,.one 0 7,.rep2 18 2 0 7 0,.one 2 0,.one 0 35,.one 12 21,.one 5 0,.rep2 18 11 0 3 0,.one 0 7,.rep2 18 2 0 7 0,.one 2 0,.one 0 35,.one 12 26,.one 5 0,.rep2 18 11 0 3 0,.one 0 7,.rep2 18 2 0 7 0,.one 2 0,.one 0 35,.one 12 25,.one 5 0,.rep2 18 11 0 3 0,.one 0 7,.rep2 18 2 0 7 0,.one 2 0,.one 0 35,.one 12 24,.one 5 0,.rep2 18 11 0 3 0,.one 0 7,.rep2 18 2 0 7 0,.one 2 0,.one 0 35,.one 12 26,.one 5 0,.rep2 18 11 0 3 0,.one 0 7,.rep2 18 2 0 7 0,.one 2 0,.one 0 35,.one 12 3,.one 5 0,.rep2 19 11 0 3 0,.one 0 7,.rep2 19 2 0 7 0,.one 2 0,.one 0 35,.one 12 50,.one 5 0,.rep2 18 11 0 3 0,.one 0 7,.rep2 18 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 19 11 0 3 0,.one 0 7,.rep2 19 2 0 7 0,.one 2 0,.one 0 35,.one 12 49] +set_option maxHeartbeats 8000000 in +theorem chunk_14_ok : q7 cmds_14 cfg_14=some cfg_15:= by decide +kernel +def cmds_15 : List Cmd:=[.one 5 0,.rep2 18 11 0 3 0,.one 0 7,.rep2 18 2 0 7 0,.one 2 0,.one 0 35,.one 12 4,.one 5 0,.rep2 19 11 0 3 0,.one 0 7,.rep2 19 2 0 7 0,.one 2 0,.one 0 35,.one 12 20,.one 5 0,.rep2 19 11 0 3 0,.one 0 7,.rep2 19 2 0 7 0,.one 2 0,.one 0 35,.one 12 56,.one 5 0,.rep2 18 11 0 3 0,.one 0 7,.rep2 18 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 19 11 0 3 0,.one 0 7,.rep2 19 2 0 7 0,.one 2 0,.one 0 35,.one 12 30,.one 5 0,.rep2 19 11 0 3 0,.one 0 7,.rep2 19 2 0 7 0,.one 2 0,.one 0 35,.one 12 28,.one 5 0,.rep2 19 11 0 3 0,.one 0 7,.rep2 19 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 20 11 0 3 0,.one 0 7,.rep2 20 2 0 7 0,.one 2 0,.one 0 35,.one 12 58,.one 5 0,.rep2 19 11 0 3 0,.one 0 7,.rep2 19 2 0 7 0,.one 2 0,.one 0 35,.one 12 27,.one 5 0,.rep2 19 11 0 3 0,.one 0 7,.rep2 19 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 20 11 0 3 0,.one 0 7,.rep2 20 2 0 7 0,.one 2 0,.one 0 35,.one 12 56,.one 5 0,.rep2 19 11 0 3 0,.one 0 7,.rep2 19 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 20 11 0 3 0,.one 0 7,.rep2 20 2 0 7 0,.one 2 0,.one 0 35,.one 12 51] +set_option maxHeartbeats 8000000 in +theorem chunk_15_ok : q7 cmds_15 cfg_15=some cfg_16:= by decide +kernel +def cmds_16 : List Cmd:=[.one 5 0,.rep2 19 11 0 3 0,.one 0 7,.rep2 19 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 20 11 0 3 0,.one 0 7,.rep2 20 2 0 7 0,.one 2 0,.one 0 35,.one 12 31,.one 5 0,.rep2 20 11 0 3 0,.one 0 7,.rep2 20 2 0 7 0,.one 2 0,.one 0 35,.one 12 29,.one 5 0,.rep2 20 11 0 3 0,.one 0 7,.rep2 20 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 21 11 0 3 0,.one 0 7,.rep2 21 2 0 7 0,.one 2 0,.one 0 35,.one 12 84,.one 5 0,.rep2 19 11 0 3 0,.one 0 7,.rep2 19 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 20 11 0 3 0,.one 0 7,.rep2 20 2 0 7 0,.one 2 0,.one 0 35,.one 12 31,.one 5 0,.rep2 20 11 0 3 0,.one 0 7,.rep2 20 2 0 7 0,.one 2 0,.one 0 35,.one 12 29,.one 5 0,.rep2 20 11 0 3 0,.one 0 7,.rep2 20 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 21 11 0 3 0,.one 0 7,.rep2 21 2 0 7 0,.one 2 0,.one 0 35,.one 12 60,.one 5 0,.rep2 20 11 0 3 0,.one 0 7,.rep2 20 2 0 7 0,.one 2 0,.one 0 35,.one 12 2] +set_option maxHeartbeats 8000000 in +theorem chunk_16_ok : q7 cmds_16 cfg_16=some cfg_17:= by decide +kernel +def cmds_17 : List Cmd:=[.one 5 0,.rep2 21 11 0 3 0,.one 0 7,.rep2 21 2 0 7 0,.one 2 0,.one 0 35,.one 12 32,.one 5 0,.rep2 21 11 0 3 0,.one 0 7,.rep2 21 2 0 7 0,.one 2 0,.one 0 35,.one 12 30,.one 5 0,.rep2 21 11 0 3 0,.one 0 7,.rep2 21 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 22 11 0 3 0,.one 0 7,.rep2 22 2 0 7 0,.one 2 0,.one 0 35,.one 12 64,.one 5 0,.rep2 21 11 0 3 0,.one 0 7,.rep2 21 2 0 7 0,.one 2 0,.one 0 35,.one 12 27,.one 5 0,.rep2 21 11 0 3 0,.one 0 7,.rep2 21 2 0 7 0,.one 2 0,.one 0 35,.one 12 31,.one 5 0,.rep2 21 11 0 3 0,.one 0 7,.rep2 21 2 0 7 0,.one 2 0,.one 0 35,.one 12 33,.one 5 0,.rep2 21 11 0 3 0,.one 0 7,.rep2 21 2 0 7 0,.one 2 0,.one 0 35,.one 12 27,.one 5 0,.rep2 21 11 0 3 0,.one 0 7,.rep2 21 2 0 7 0,.one 2 0,.one 0 35,.one 12 33,.one 5 0,.rep2 21 11 0 3 0,.one 0 7,.rep2 21 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 22 11 0 3 0,.one 0 7,.rep2 22 2 0 7 0,.one 2 0,.one 0 35,.one 12 63] +set_option maxHeartbeats 8000000 in +theorem chunk_17_ok : q7 cmds_17 cfg_17=some cfg_18:= by decide +kernel +def cmds_18 : List Cmd:=[.one 5 0,.rep2 21 11 0 3 0,.one 0 7,.rep2 21 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 22 11 0 3 0,.one 0 7,.rep2 22 2 0 7 0,.one 2 0,.one 0 35,.one 12 34,.one 5 0,.rep2 22 11 0 3 0,.one 0 7,.rep2 22 2 0 7 0,.one 2 0,.one 0 35,.one 12 32,.one 5 0,.rep2 22 11 0 3 0,.one 0 7,.rep2 22 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 23 11 0 3 0,.one 0 7,.rep2 23 2 0 7 0,.one 2 0,.one 0 35,.one 12 63,.one 5 0,.rep2 22 11 0 3 0,.one 0 7,.rep2 22 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 23 11 0 3 0,.one 0 7,.rep2 23 2 0 7 0,.one 2 0,.one 0 35,.one 12 105,.one 5 0,.rep2 20 11 0 3 0,.one 0 7,.rep2 20 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 21 11 0 3 0,.one 0 7,.rep2 21 2 0 7 0,.one 2 0,.one 0 35,.one 12 32,.one 5 0,.rep2 21 11 0 3 0,.one 0 7,.rep2 21 2 0 7 0,.one 2 0,.one 0 35,.one 12 30,.one 5 0,.rep2 21 11 0 3 0,.one 0 7,.rep2 21 2 0 7 0,.one 2 0,.one 0 35,.one 12 21,.one 5 0,.rep2 21 11 0 3 0,.one 0 7,.rep2 21 2 0 7 0,.one 2 0,.one 0 35,.one 12 33] +set_option maxHeartbeats 8000000 in +theorem chunk_18_ok : q7 cmds_18 cfg_18=some cfg_19:= by decide +kernel +def cmds_19 : List Cmd:=[.one 5 0,.rep2 21 11 0 3 0,.one 0 7,.rep2 21 2 0 7 0,.one 2 0,.one 0 35,.one 12 3,.one 5 0,.rep2 22 11 0 3 0,.one 0 7,.rep2 22 2 0 7 0,.one 2 0,.one 0 35,.one 12 29,.one 5 0,.rep2 22 11 0 3 0,.one 0 7,.rep2 22 2 0 7 0,.one 2 0,.one 0 35,.one 12 59,.one 5 0,.rep2 21 11 0 3 0,.one 0 7,.rep2 21 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 22 11 0 3 0,.one 0 7,.rep2 22 2 0 7 0,.one 2 0,.one 0 35,.one 12 34,.one 5 0,.rep2 22 11 0 3 0,.one 0 7,.rep2 22 2 0 7 0,.one 2 0,.one 0 35,.one 12 32,.one 5 0,.rep2 22 11 0 3 0,.one 0 7,.rep2 22 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 23 11 0 3 0,.one 0 7,.rep2 23 2 0 7 0,.one 2 0,.one 0 35,.one 12 66,.one 5 0,.rep2 22 11 0 3 0,.one 0 7,.rep2 22 2 0 7 0,.one 2 0,.one 0 35,.one 12 28,.one 5 0,.rep2 22 11 0 3 0,.one 0 7,.rep2 22 2 0 7 0,.one 2 0,.one 0 35,.one 12 3,.one 5 0,.rep2 23 11 0 3 0,.one 0 7,.rep2 23 2 0 7 0,.one 2 0,.one 0 35,.one 12 34,.one 5 0,.rep2 23 11 0 3 0,.one 0 7,.rep2 23 2 0 7 0,.one 2 0,.one 0 35,.one 12 30,.one 5 0,.rep2 23 11 0 3 0,.one 0 7,.rep2 23 2 0 7 0,.one 2 0,.one 0 35,.one 12 33,.one 5 0,.rep2 23 11 0 3 0,.one 0 7,.rep2 23 2 0 7 0,.one 2 0,.one 0 35,.one 12 28] +set_option maxHeartbeats 8000000 in +theorem chunk_19_ok : q7 cmds_19 cfg_19=some cfg_20:= by decide +kernel +def cmds_20 : List Cmd:=[.one 5 0,.rep2 22 11 0 3 0,.one 0 7,.rep2 22 2 0 7 0,.one 2 0,.one 0 35,.one 12 34,.one 5 0,.rep2 22 11 0 3 0,.one 0 7,.rep2 22 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 23 11 0 3 0,.one 0 7,.rep2 23 2 0 7 0,.one 2 0,.one 0 35,.one 12 65,.one 5 0,.rep2 22 11 0 3 0,.one 0 7,.rep2 22 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 23 11 0 3 0,.one 0 7,.rep2 23 2 0 7 0,.one 2 0,.one 0 35,.one 12 35,.one 5 0,.rep2 23 11 0 3 0,.one 0 7,.rep2 23 2 0 7 0,.one 2 0,.one 0 35,.one 12 14,.one 5 0,.rep2 23 11 0 3 0,.one 0 7,.rep2 23 2 0 7 0,.one 2 0,.one 0 35,.one 12 36,.one 5 0,.rep2 23 11 0 3 0,.one 0 7,.rep2 23 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 24 11 0 3 0,.one 0 7,.rep2 24 2 0 7 0,.one 2 0,.one 0 35,.one 12 95,.one 5 0,.rep2 22 11 0 3 0,.one 0 7,.rep2 22 2 0 7 0,.one 2 0,.one 0 35,.one 12 2] +set_option maxHeartbeats 8000000 in +theorem chunk_20_ok : q7 cmds_20 cfg_20=some cfg_21:= by decide +kernel +def cmds_21 : List Cmd:=[.one 5 0,.rep2 23 11 0 3 0,.one 0 7,.rep2 23 2 0 7 0,.one 2 0,.one 0 35,.one 12 35,.one 5 0,.rep2 23 11 0 3 0,.one 0 7,.rep2 23 2 0 7 0,.one 2 0,.one 0 35,.one 12 33,.one 5 0,.rep2 23 11 0 3 0,.one 0 7,.rep2 23 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 24 11 0 3 0,.one 0 7,.rep2 24 2 0 7 0,.one 2 0,.one 0 35,.one 12 68,.one 5 0,.rep2 23 11 0 3 0,.one 0 7,.rep2 23 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 24 11 0 3 0,.one 0 7,.rep2 24 2 0 7 0,.one 2 0,.one 0 35,.one 12 36,.one 5 0,.rep2 24 11 0 3 0,.one 0 7,.rep2 24 2 0 7 0,.one 2 0,.one 0 35,.one 12 34,.one 5 0,.rep2 24 11 0 3 0,.one 0 7,.rep2 24 2 0 7 0,.one 2 0,.one 0 35,.one 12 2,.one 5 0,.rep2 25 11 0 3 0,.one 0 7,.rep2 25 2 0 7 0,.one 2 0,.one 0 35,.one 12 100,.one 5 0,.rep2 23 11 0 3 0,.one 0 7,.rep2 23 2 0 7 0,.one 2 0,.one 0 35,.one 12 31,.one 5 0,.rep2 23 11 0 3 0,.one 0 7,.rep2 23 2 0 7 0,.one 2 0,.one 0 35,.one 12 35,.one 5 0,.rep2 22 11 0 3 0,.one 11 0,.one 0 155,.one 7 0,.rep2 22 2 0 7 0,.one 2 0,.one 0 35,.one 1 0,.one 1 0,.one 5 0,.rep2 23 11 0 3 0,.one 11 0,.one 0 2,.one 9 0,.one 6 0,.one 0 13,.rep2 22 2 0 7 0,.one 2 0,.one 0 35,.one 1 0,.one 1 0,.one 12 31,.one 1 0,.one 1 0,.one 5 0,.rep2 23 11 0 3 0,.one 0 66,.rep2 23 4 0 8 0,.one 4 0,.one 0 71,.one 1 0,.one 1 0,.one 0 36,.one 5 0,.rep2 23 11 0 3 0,.one 0 72] +set_option maxHeartbeats 8000000 in +theorem chunk_21_ok : q7 cmds_21 cfg_21=some cfg_22:= by decide +kernel +theorem halted_final : isHalted target_tm cfg_22=true:= by decide +kernel +theorem init_eq_cfg_0 : cfg_0.denote=init []:=rfl + +end Solution + +public section + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 +open Solution in +theorem is_halt : IsHalt target := by + refine ⟨cfg_22.denote,?_,isHalted_spec halted_final⟩ + rw [← init_eq_cfg_0] + refine q0 (q1 chunk_0_ok) ?_ + refine q0 (q1 chunk_1_ok) ?_ + refine q0 (q1 chunk_2_ok) ?_ + refine q0 (q1 chunk_3_ok) ?_ + refine q0 (q1 chunk_4_ok) ?_ + refine q0 (q1 chunk_5_ok) ?_ + refine q0 (q1 chunk_6_ok) ?_ + refine q0 (q1 chunk_7_ok) ?_ + refine q0 (q1 chunk_8_ok) ?_ + refine q0 (q1 chunk_9_ok) ?_ + refine q0 (q1 chunk_10_ok) ?_ + refine q0 (q1 chunk_11_ok) ?_ + refine q0 (q1 chunk_12_ok) ?_ + refine q0 (q1 chunk_13_ok) ?_ + refine q0 (q1 chunk_14_ok) ?_ + refine q0 (q1 chunk_15_ok) ?_ + refine q0 (q1 chunk_16_ok) ?_ + refine q0 (q1 chunk_17_ok) ?_ + refine q0 (q1 chunk_18_ok) ?_ + refine q0 (q1 chunk_19_ok) ?_ + refine q0 (q1 chunk_20_ok) ?_ + refine q0 (q1 chunk_21_ok) ?_ + exact ⟨0,rfl⟩ + +end + +end BusyBeaver.M_1RB1RE_1RC1LE_1LD0RA_1LF0LA_1LB0LC_HHH1RA diff --git a/BusyBeaver/BB6/Halt/M_1RB1RF_0RC0RE_0RD1RA_1LE0LA_1LB0LD_0RDHHH.lean b/BusyBeaver/BB6/Halt/M_1RB1RF_0RC0RE_0RD1RA_1LE0LA_1LB0LD_0RDHHH.lean new file mode 100644 index 00000000..5faadb7c --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB1RF_0RC0RE_0RD1RA_1LE0LA_1LB0LD_0RDHHH.lean @@ -0,0 +1,384 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.HaltShared + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.M_1RB1RF_0RC0RE_0RD1RA_1LE0LA_1LB0LD_0RDHHH + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_0RC0RE_0RD1RA_1LE0LA_1LB0LD_0RDHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +@[simp] theorem isFlipped_tm : BusyBeaver.RleStackEngine.isFlipped target_tm = true := rfl + +namespace Solution + +open BusyBeaver.RleStackEngine + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + +@[simp] theorem init_nil : (init ([] : List (Fin 2))) = ⟨some A, ⟨0, default, default⟩⟩ := rfl + +def cfg_Halt (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some F, ⟨1, r, l⟩⟩ + +macro "finish" : tactic => `(tactic| ( + refine ⟨0, ?_⟩ + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, listblank_append_cons, + listblank_append_nil, zero_cons_default, encLeft_nil, encRight_nil, encLeft_cons_one, + encRight_cons_one, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, multiStep_zero] + try rfl)) +macro "step" : tactic => `(tactic| ( + try refine stepPlus_stepStar ?_ + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, listblank_append_cons, + listblank_append_nil, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, default_head] + apply step_stepStar_stepPlus (by rfl) + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, + listblank_append_cons, listblank_append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail])) +macro "execute" n:num : tactic => `(tactic| ( + iterate $n step + finish)) + +theorem init_reaches_stack : (init []) [target_tm]⊢⁺ (cfg_C target_tm [] [0]) := by + rw [init_nil]; unfold cfg_C; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encLeft_zero, encLeft_nil, encRight_nil]; execute 1 + +theorem rule_B_nil (L : List ℕ) : + (cfg_B target_tm L []) [target_tm]⊢⁺ (cfg_C target_tm (bumpHead L) []) := by + unfold cfg_B cfg_C; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encLeft_nil]; execute 1 + +theorem rule_B_zero (L R : List ℕ) : + (cfg_B target_tm L (0 :: R)) [target_tm]⊢⁺ (cfg_B target_tm (0 :: L) R) := by + unfold cfg_B; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encLeft_zero R, encRight_zero L]; + execute 4 + +theorem rule_B_succ (d : ℕ) (L R : List ℕ) : + (cfg_B target_tm L ((d + 1) :: R)) [target_tm]⊢⁺ (cfg_BR target_tm L (0 :: d :: R)) := by + unfold cfg_B cfg_BR; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encLeft_succ d R, encLeft_zero (d :: R), encLeft_expose d R]; execute 2 + +theorem rule_BR_nil (L : List ℕ) : + (cfg_BR target_tm L []) [target_tm]⊢⁺ (cfg_C target_tm (bumpHead L) []) := + rule_B_nil L + +theorem rule_BR_zero (L R : List ℕ) : + (cfg_BR target_tm L (0 :: R)) [target_tm]⊢⁺ (cfg_BR target_tm (0 :: L) R) := by + unfold cfg_BR; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encLeft_zero R, encRight_zero L]; + execute 2 + +theorem rule_BR_one (L R : List ℕ) : + (cfg_BR target_tm L (1 :: R)) [target_tm]⊢⁺ (cfg_DR0 target_tm L (bumpHead R)) := by + unfold cfg_BR cfg_DR0; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encLeft_succ 0 R, + encLeft_zero R]; execute 4 + +theorem rule_BR_add_two (d : ℕ) (L R : List ℕ) : + (cfg_BR target_tm L ((d + 2) :: R)) [target_tm]⊢⁺ (cfg_B target_tm (bumpHead L) (d :: R)) := + by + unfold cfg_BR cfg_B; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encLeft_succ (d + 1) R, encLeft_succ d R, encLeft_expose d R]; execute 5 + +theorem rule_DR0_nil (R : List ℕ) : + (cfg_DR0 target_tm [] R) [target_tm]⊢⁺ (cfg_C target_tm [1] R) := by + unfold cfg_DR0 cfg_C; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encRight_nil, encRight_succ 0 [], encRight_zero [], encRight_nil]; execute 3 + +theorem rule_DR0_zero (L R : List ℕ) : + (cfg_DR0 target_tm (0 :: L) R) [target_tm]⊢⁺ (cfg_DR0 target_tm L (0 :: R)) := by + unfold cfg_DR0; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encRight_zero L, encLeft_zero R]; + execute 4 + +theorem rule_DR0_succ (a : ℕ) (L R : List ℕ) : + (cfg_DR0 target_tm ((a + 1) :: L) R) [target_tm]⊢⁺ (cfg_C target_tm (a :: L) (0 :: R)) := by + unfold cfg_DR0 cfg_C; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encRight_succ a L, + encLeft_zero R]; execute 3 + +theorem rule_C_nil (R : List ℕ) : + (cfg_C target_tm [] R) [target_tm]⊢⁺ (cfg_DR0 target_tm [] R) := by + unfold cfg_C cfg_DR0; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encRight_nil]; execute 1 + +theorem rule_C_zero_nil (R : List ℕ) : + (cfg_C target_tm [0] R) [target_tm]⊢⁺ (cfg_C target_tm [] (1 :: R)) := by + unfold cfg_C; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encRight_zero [], encRight_nil, encLeft_succ 0 R, encLeft_zero R]; execute 3 + +theorem rule_C_zero_zero (L R : List ℕ) : + (cfg_C target_tm (0 :: 0 :: L) R) [target_tm]⊢⁺ (cfg_C target_tm (bumpHead L) (1 :: R)) := by + unfold cfg_C; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encRight_zero (0 :: L), encRight_zero L, encLeft_succ 0 R, encLeft_zero R]; execute 5 + +theorem rule_C_zero_one (L R : List ℕ) : + (cfg_C target_tm (0 :: 1 :: L) R) [target_tm]⊢⁺ + (cfg_C target_tm (bumpHead (bumpHead L)) (0 :: bumpHead R)) := by + unfold cfg_C; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encRight_zero (1 :: L), encRight_succ 0 L, encRight_zero L, encLeft_zero (bumpHead R)] + execute 17 + +theorem rule_C_zero_add_two (a : ℕ) (L R : List ℕ) : + (cfg_C target_tm (0 :: (a + 2) :: L) R) [target_tm]⊢⁺ (cfg_BR target_tm (a :: L) (0 :: 1 :: + R)) := by + unfold cfg_C cfg_BR; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encRight_zero ((a + 2) :: L), encRight_succ (a + 1) L, encRight_succ a L, + encLeft_zero (1 :: R), encLeft_succ 0 R, encLeft_zero R]; execute 4 + +theorem rule_C_one_nil (R : List ℕ) : + (cfg_C target_tm [1] R) [target_tm]⊢⁺ (cfg_B target_tm [0] (1 :: R)) := by + unfold cfg_C cfg_B; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encRight_succ 0 [], encRight_zero [], encRight_nil, encLeft_succ 0 R, encLeft_zero R] + execute 5 + +theorem rule_C_one_zero (L R : List ℕ) : + (cfg_C target_tm (1 :: 0 :: L) R) [target_tm]⊢⁺ (cfg_DR0 target_tm L (2 :: R)) := by + unfold cfg_C cfg_DR0; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encRight_succ 0 (0 :: L), encRight_zero (0 :: L), encRight_zero L, + encLeft_succ 1 R, encLeft_succ 0 R, encLeft_zero R]; execute 7 + +theorem rule_C_one_succ (a : ℕ) (L R : List ℕ) : + (cfg_C target_tm (1 :: (a + 1) :: L) R) [target_tm]⊢⁺ (cfg_C target_tm (a :: L) (2 :: R)) := + by + unfold cfg_C; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encRight_succ 0 ((a + 1) :: L), encRight_zero ((a + 1) :: L), encRight_succ a L, + encLeft_succ 1 R, encLeft_succ 0 R, encLeft_zero R]; execute 6 + +theorem rule_C_add_two_step (a : ℕ) (L R : List ℕ) : + (cfg_C target_tm ((a + 2) :: L) R) [target_tm]⊢⁺ + (cfg_Halt (((encRight1 L).cons 0) <+ (([1] : List (Fin 2)) ^ a)) + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> encLeft1 R)) := by + unfold cfg_C cfg_Halt; dsimp only [isFlipped_tm, ite_true, ite_false] + rw [encRight_succ (a + 1) L, encRight_succ a L, encRight_expose a L]; execute 3 + +theorem rule_C_add_two_halt (a : ℕ) (L R : List ℕ) : + ∃ cfg', ((cfg_C target_tm ((a + 2) :: L) R) [target_tm]⊢⁺ cfg') ∧ + (step target_tm cfg').isNone := + ⟨cfg_Halt (((encRight1 L).cons 0) <+ (([1] : List (Fin 2)) ^ a)) + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> encLeft1 R), + rule_C_add_two_step a L R, rfl⟩ + + +instance : HasRleStackRules target_tm where + rule_B_nil := rule_B_nil + rule_B_zero := rule_B_zero + rule_B_succ := rule_B_succ + rule_BR_nil := rule_BR_nil + rule_BR_zero := rule_BR_zero + rule_BR_one := rule_BR_one + rule_BR_add_two := rule_BR_add_two + rule_DR0_nil := rule_DR0_nil + rule_DR0_zero := rule_DR0_zero + rule_DR0_succ := rule_DR0_succ + rule_C_nil := rule_C_nil + rule_C_zero_nil := rule_C_zero_nil + rule_C_zero_zero := rule_C_zero_zero + rule_C_zero_one := rule_C_zero_one + rule_C_zero_add_two := rule_C_zero_add_two + rule_C_one_nil := rule_C_one_nil + rule_C_one_zero := rule_C_one_zero + rule_C_one_succ := rule_C_one_succ + rule_C_add_two_halt := rule_C_add_two_halt + +def ckpt0 : RleFullState := ⟨.C, .raw [], [.z 1], false⟩ + +def ckpt6 : RleFullState := ⟨.C, .raw [.z 1, .k 281358 77415, .k 142094 1, .k 2229006 1, .k + 4440846 48275, .k 29606670 1, .k 17023758 33721, .k 50578190 1, .k 79938318 980, .k 265280270 + 1, .k 319753998 203, .k 386862862 1, .k 521080590 6175, .k 789516046 1, .k 1326386958 309, .k + 2270693102 1, .k 5305547838 277, .k 1110974254 1, .k 67113177358 1, .k 84888764430 263, .k + 230838460430 1, .k 339555069966 5, .k 860299088330 1, .k 1358220279870 92, .k 2457731907646 1 + , .k 4656755163198 20, .k 4540718317493 1, .k 1856589531279 1, .z 2], [.k 150286 1, .k 84750 + 876511, .k 51982 1, .k 35598 1737322, .k 19214 1, .k 11022 38203784, .k 8974 1, .k 7950 + 27434495, .k 4878 42087863, .k 2830 1, .k 1806 73686092, .k 526 1, .k 142 1, .k 174 475716378 + , .k 110 1, .k 78 13551424202, .k 126 1, .k 30 505632912192, .k 14 1, .k 6 47526570402450, .k + 4 1, .k 3 57901138422179, .z 3, .d 2, .k 0 37610989893458, .d 2], false⟩ + +def ckpt12 : RleFullState := ⟨.BR, .clean 3 [(5399298, 13551424202), (7496450, 1), (11690754, + 475716378), (9593602, 1), (34759426, 1), (118645506, 73686092), (185754370, 1), (319972098, + 42087863), (521298690, 27434495), (588407554, 1), (722625282, 38203784), (1259496194, 1), + (2333238018, 1737322), (3406979842, 1), (5554463490, 876511), (9849430786, 1), (18439365378, + 77415), (9312559874, 1), (146080424706, 1), (291035570946, 48275), (1940303012610, 1), + (1115669291778, 32810), (1394586614730, 1), (278917322970, 909), (828673136858, 1), + (1309709474010, 980), (4346352015578, 1), (5238849575130, 203), (6338361202906, 1), + (8537384458458, 6175), (12935430969562, 1), (21731523991770, 309), (37203035855066, 1), + (86926095849690, 277), (18202202249434, 1), (1099582297905370, 1), (1390817516493018, 263), + (3782057335757018, 1), (5563270266394842, 5), (14095140263270618, 1), (22253081065461978, 6), + (81803770100545754, 1), (89012324261841114, 8), (190258379573867327, 1), (356049297047364462, + 69), (73427410834671118, 1), (4521950179403093518, 1), (5425513671652212490, 1), + (4340401297689886786, 1), (91148620044125286401, 1), (15, 1), (1458377920706004582399, 2)] + 364594480176501145522, [.k 8545026 1, .k 2253570 505632912192, .k 1204994 1, .k 680706 + 26720150428303, .k 336210 1, .k 21536 1, .k 42549 20806419974146, .k 34357 1, .k 30261 + 57901138422180, .k 17973 37610989893458, .k 9781 1, .k 5685 30716371615732, .k 3637 1, .k 2613 + 305490132233582, .k 5685 1, .k 4149 270647459772345, .k 3925 1, .k 22 1, .k 267 + 139989328324157, .k 107 1, .k 24 1, .k 30 781492533683413, .k 26 1, .k 15 271475135198707, .k + 13 1, .k 12 48671766179730583, .k 15 1, .k 9 94767307651599602, .k 12 1, .k 6 + 331887753716974115, .k 3 744220640956988995, .k 1 1, .k 0 18310355970030908204, .d 2], false⟩ + +def ckpt18 : RleFullState := ⟨.DR0, .raw [.z 3], [.d 1, .z 637191343783878439541550, .d 2, .d 1, + .k 53511727938691907386159 1, .k 93336186925184309857071 9, .k 55083803111267391840815 1, .k + 23334046731296077464111 50, .k 12468773163752969224751 1, .k 5833511682824019329583 8, .k + 5361091877309366616623 1, .k 1458377920706116272687 6, .k 923739112293703303727 1, .k + 364594480178452447791 5, .k 247860909556172014127 1, .k 91148616760886510127 263, .k + 72062225475526410799 1, .k 1192899526618989103 1, .k 5696788617605366319 277, .k + 2438138157797687855 1, .k 1424197156324721199 309, .k 847736404021297711 1, .k + 559506027869585967 6175, .k 415390839793730095 1, .k 343333245755802159 203, .k + 284842525693002287 1, .k 85833120088801839 980, .k 54307922697208367 1, .k 18279125678244399 + 909, .k 91395628383027759 1, .k 73116502706045487 8, .k 18279125676510767 1, .k + 18279125676511791 32801, .k 31789924558623279 1, .k 4768326794400303 48275, .k + 2393381678404143 1, .k 152576980996655 1, .k 302110562374191 77415, .k 161373074018863 1, .k + 91004329841199 876511, .k 55819957752367 1, .k 38227771707951 1737322, .k 20635585663535 1, .k + 11839492641327 38203784, .k 9640469385775 1, .k 8540957757999 27434495, .k 5242422874671 + 42087863, .k 3043399619119 1, .k 1943887991343 73686092, .k 569498456623 1, .k 157181596207 1 + , .k 191541334575 475716378, .k 122821857839 1, .k 88462119471 13551424202, .k 140001727023 1 + , .k 36922511919 505632912192, .k 19742642735 1, .k 11152708143 24723210206458, .z 9034176083 + , .d 1, .z 529633014, .d 2, .d 1, .k 2788177035 1996940221844, .k 1377121419 1, .k 88216715 1 + , .k 174285963 20806419974146, .k 140731531 1, .k 123954315 57901138422180, .k 73622667 + 37610989893458, .k 40068235 1, .k 23291019 30716371615732, .k 14902411 1, .k 10708107 + 305490132233582, .k 23291019 1, .k 16999563 270647459772345, .k 16082059 1, .k 95371 1, .k + 1098891 139989328324157, .k 443531 1, .k 103563 1, .k 128139 781492533683413, .k 111755 1, .k + 66699 271475135198707, .k 58507 1, .k 54411 48671766179730583, .k 66699 1, .k 42123 + 94767307651599602, .k 54411 1, .k 29835 331887753716974115, .k 17547 744220640956988995, .k + 9355 1, .k 5259 382904836146532053728, .k 3211 1, .k 2187 210157523808992004318, .k 1931 1, .k + 651 2160111270177901513702, .k 523 1, .k 459 660481848050345900758, .z 87, .d 1, .z 92, .d 2, + .d 1, .k 114 9040449275367983386986, .k 66 906038693021585505429, .k 41 1, .k 15 + 6063759545596197098728, .k 7 1, .k 3 30646279106479104971761, .k 1 1, .k 0 + 1009331069384952120084451, .d 2], false⟩ + +def ckpt24 : RleFullState := ⟨.C, .raw [.z 1, .k 11175430935936220053061216 1, .k + 203498126670575412323054098 1, .k 382305021645554933172033474 33, .k + 188683387653217877438607425 1, .z 2], [.k 23894063852847183323252097 4, .k + 10778816692974141806191745 1, .k 5973515963211795830813313 8, .k 3192005929920760121537153 1, + .k 1493378990802948948374145 8, .k 1372439520591197853856385 1, .k 373344747700765765808769 6 + , .k 236477212747188045755009 1, .k 93336186925683826635393 5, .k 63452392846380035617409 1, + .k 23334045890786946593409 263, .k 18447929721734761165441 1, .k 305382278814461211265 1, .k + 1458377886106973778561 277, .k 624163368396208091777 1, .k 364594472019128627841 309, .k + 217020519429452214913 1, .k 143233543134614008449 6175, .k 106340054987194905217 1, .k + 87893310913485353601 203, .k 72919686577408586369 1, .k 21973278742733271681 980, .k + 13902828210485342849 1, .k 4679456173630567041 909, .k 23397280866055107201 1, .k + 18717824692747645569 8, .k 4679456173186757249 1, .k 4679456173187019393 32801, .k + 8138220687007560321 1, .k 1220691659366478465 48275, .k 612705709671461505 1, .k + 39059707135144577 1, .k 77340303967793793 77415, .k 41311506948829825 1, .k 23297108439347841 + 876511, .k 14289909184606849 1, .k 9786309557236353 1737322, .k 5282709929865857 1, .k + 3030910116180609 38203784, .k 2467960162759297 1, .k 2186485186048641 27434495, .k + 1342060255916673 42087863, .k 779110302495361 1, .k 497635325784705 73686092, .k + 145791604896385 1, .k 40238488629889 1, .k 49034581652097 475716378, .k 31442395607681 1, .k + 22646302585473 13551424202, .k 35840442118785 1, .k 9452163052161 505632912192, .k + 5054116541057 1, .k 2855093285505 26720150428303, .k 1410172334721 1, .k 90333917825 1, .k + 178468827777 20806419974146, .k 144109089409 1, .k 126929220225 57901138422180, .k 75389612673 + 37610989893458, .k 41029874305 1, .k 23850005121 30716371615732, .k 15260070529 1, .k + 10965103233 305490132233582, .k 23850005121 1, .k 17407554177 270647459772345, .k 16468030081 + 1, .k 97661569 1, .k 1125266049 139989328324157, .k 454177409 1, .k 106050177 1, .k 131216001 + 781492533683413, .k 114438785 1, .k 68301441 271475135198707, .k 59912833 1, .k 55718529 + 48671766179730583, .k 68301441 1, .k 43135617 94767307651599602, .k 55718529 1, .k 30552705 + 331887753716974115, .k 17969793 744220640956988995, .k 9581185 1, .k 5386881 + 7072824145170092509, .k 5265677 1, .k 1346721 176244060668935040975, .k 350513 1, .k 336681 + 67361141208737850269, .k 123857 1, .k 84189 132226810123689069972, .k 51421 1, .k 35037 + 210157523808992004318, .k 30941 1, .k 10461 2160111270177901513702, .k 8413 1, .k 7389 + 660481848050345900758, .k 1437 1, .k 413 1, .k 501 9040449275367983386986, .k 309 + 906038693021585505429, .k 209 1, .k 105 6063759545596197098728, .k 73 1, .k 57 + 30646279106479104971761, .k 49 1, .k 45 1009331069384952120084451, .k 57 1, .k 33 + 7537176816673596729879974, .k 21 5622837964162795894755808, .k 13 1, .k 9 + 39547083232249886800713772, .k 5 1, .k 3 654276377082664764984814935, .k 6 1, .k 0 + 1615416730339319185619342344, .d 2], false⟩ + +def ckpt30 : RleFullState := ⟨.C, .raw [.z 1, .k 817153518059714591113512431 1, .k + 1529220086582219732688209391 8, .k 2759377073401380302385087983 1, .k + 6116880346328878930752538095 4, .k 2860910319599672333583672559 1, .k + 52095520427667305554701850351 1, .k 97870085541262062892040570607 8, .k + 259531341126341969520301487855 1, .k 391480342165048251568162282479 3, .k + 1513521437247345871367607986543 1, .k 1565921368660193006272649129967 4, .k + 4190496403530834217529157521375 1, .k 6263685474640772025090596519919 2, .k + 2515196707816662475441974916831 1, .z 2], [.k 382305021645554930783782383 8, .k + 351344517271346650587235823 1, .k 95576255411396036047046127 6, .k 60538166463280139713283567 + 1, .k 23894063852975059618661871 5, .k 16243812568673289118057967 1, .k + 5973515748041458327913967 263, .k 4722670008764098858354159 1, .k 78177863376502070085103 1, + .k 373344738843385287312879 277, .k 159785822309429271496175 1, .k 93336184836896928728559 309 + , .k 55557252973939767018991 1, .k 36667787042461186164207 6175, .k 27223054076721895736815 1 + , .k 22500687593852250523119 203, .k 18667439763816598111727 1, .k 5625159358139717551599 980 + , .k 3559124021884247770607 1, .k 1197940780449425163759 909, .k 5989703901710107444719 1, .k + 4791763121343397266927 8, .k 1197940780335809857007 1, .k 1197940780335876965871 32801, .k + 2083384495873935443439 1, .k 312497064797818488303 48275, .k 156852661675894146543 1, .k + 9999285026597012975 1, .k 19799117815755212271 77415, .k 10575745778900436463 1, .k + 5964059760473048559 876511, .k 3658216751259354607 1, .k 2505295246652507631 1737322, .k + 1352373742045660655 1, .k 775912989742237167 38203784, .k 631797801666381295 1, .k + 559740207628453359 27434495, .k 343567425514669551 42087863, .k 199452237438813679 1, .k + 127394643400885743 73686092, .k 37322650853475823 1, .k 10301053089252847 1, .k + 12552852902938095 475716378, .k 8049253275567599 1, .k 5797453461882351 13551424202, .k + 9175153182410223 1, .k 2419753741354479 505632912192, .k 1293853834511855 1, .k + 730903881090543 26720150428303, .k 361004117689839 1, .k 23125482964463 1, .k 45688019912175 + 20806419974146, .k 36891926889967 1, .k 32493880378863 57901138422180, .k 19299740845551 + 37610989893458, .k 10503647823343 1, .k 6105601312239 30716371615732, .k 3906578056687 1, .k + 2807066428911 305490132233582, .k 6105601312239 1, .k 4456333870575 270647459772345, .k + 4215815701999 1, .k 25001362927 1, .k 288068109807 139989328324157, .k 116269417967 1, .k + 27148846575 1, .k 33591297519 781492533683413, .k 29296330223 1, .k 17485170159 + 271475135198707, .k 15337686511 1, .k 14263944687 48671766179730583, .k 17485170159 1, .k + 11042719215 94767307651599602, .k 14263944687 1, .k 7821493743 331887753716974115, .k + 4600268271 744220640956988995, .k 2452784623 1, .k 1379042799 7072824145170092509, .k + 1348014575 1, .k 344761839 176244060668935040975, .k 89732591 1, .k 86191599 + 67361141208737850269, .k 31708655 1, .k 21553647 132226810123689069972, .k 13165039 1, .k + 8970735 210157523808992004318, .k 7922159 1, .k 2679279 2160111270177901513702, .k 2154991 1, + .k 1892847 660481848050345900758, .k 369135 1, .k 106991 1, .k 129519 9040449275367983386986, + .k 80367 906038693021585505429, .k 54767 1, .k 28143 6063759545596197098728, .k 19951 1, .k + 15855 30646279106479104971761, .k 13807 1, .k 12783 1009331069384952120084451, .k 15855 1, .k + 9711 7537176816673596729879974, .k 6639 5622837964162795894755808, .k 4591 1, .k 3567 + 39547083232249886800713772, .k 2543 1, .k 2031 538559066387679221350882238, .k 1583 1, .k 495 + 115717310694985543633932696, .k 687 1, .k 303 1615416730339319185619342344, .k 495 1, .k 111 + 274784465758569372306465281757, .k 79 1, .k 63 507674404248318560861238978904, .k 111 1, .k 15 + 2504802967801580957720172775389, .k 7 1, .k 3 6623541416857744891568440848885, .k 1 1, .k 0 + 4682218824069723167996109957596, .d 2], false⟩ + +-- Each chunk reduces 120 (or 140) RLE batches in the kernel via `rfl`. +set_option maxRecDepth 2000000 in +theorem chunk_0 : runBatches 120 ckpt0 = ckpt6 := rfl +set_option maxRecDepth 2000000 in +theorem chunk_1 : runBatches 120 ckpt6 = ckpt12 := rfl +set_option maxRecDepth 2000000 in +theorem chunk_2 : runBatches 120 ckpt12 = ckpt18 := rfl +set_option maxRecDepth 2000000 in +theorem chunk_3 : runBatches 120 ckpt18 = ckpt24 := rfl +set_option maxRecDepth 2000000 in +theorem chunk_4 : runBatches 120 ckpt24 = ckpt30 := rfl +set_option maxRecDepth 2000000 in +theorem chunk_5 : (runBatches 140 ckpt30).halted = true := rfl + +theorem reach_30 : StateHalts target_tm ckpt30 := + runBatches_halts 140 ckpt30 (Or.inl chunk_5) +theorem reach_24 : StateHalts target_tm ckpt24 := chunk_back_batches chunk_4 reach_30 +theorem reach_18 : StateHalts target_tm ckpt18 := chunk_back_batches chunk_3 reach_24 +theorem reach_12 : StateHalts target_tm ckpt12 := chunk_back_batches chunk_2 reach_18 +theorem reach_6 : StateHalts target_tm ckpt6 := chunk_back_batches chunk_1 reach_12 +theorem reach_0 : StateHalts target_tm ckpt0 := chunk_back_batches chunk_0 reach_6 + +end Solution + +public section + +open Solution BusyBeaver.RleStackEngine in +theorem is_halt : IsHalt target := by + rcases reach_0 with hfalse | hcan + · simp [ckpt0] at hfalse + · exact canHalt_of_stepPlus init_reaches_stack hcan + +end + +end BusyBeaver.M_1RB1RF_0RC0RE_0RD1RA_1LE0LA_1LB0LD_0RDHHH diff --git a/BusyBeaver/BB6/Halt/M_1RB1RF_1LC0RA_HHH0LD_1RE1LD_0LF0LB_1RA1LE.lean b/BusyBeaver/BB6/Halt/M_1RB1RF_1LC0RA_HHH0LD_1RE1LD_0LF0LB_1RA1LE.lean new file mode 100644 index 00000000..cb0a853a --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RB1RF_1LC0RA_HHH0LD_1RE1LD_0LF0LB_1RA1LE.lean @@ -0,0 +1,2069 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1RF_1LC0RA_HHH0LD_1RE1LD_0LF0LB_1RA1LE + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1LC0RA_HHH0LD_1RE1LD_0LF0LB_1RA1LE" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + + +-- ============================================================================ +-- Backward Reachability & Fast Symbolic Execution Infrastructure +-- ============================================================================ + +abbrev b0 : Fin 2 := 0 +abbrev b1 : Fin 2 := 1 + +inductive ReachHalt : Cfg (Fin 2) (Fin 6) → Prop + | done {c} : (step target_tm c).isNone → ReachHalt c + | next {c c'} : step target_tm c = some c' → ReachHalt c' → ReachHalt c + +def Reaches (c c' : Cfg (Fin 2) (Fin 6)) : Prop := + ReachHalt c' → ReachHalt c + +theorem Reaches.refl (c : Cfg (Fin 2) (Fin 6)) : Reaches c c := id + +theorem Reaches.trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} (h₁ : Reaches c₁ c₂) (h₂ : Reaches c₂ c₃) : + Reaches c₁ c₃ := + fun h => h₁ (h₂ h) + +theorem multiStep_succ_of_step {c c' : Cfg (Fin 2) (Fin 6)} (n : ℕ) + (h : step target_tm c = some c') : + multiStep target_tm c (n + 1) = multiStep target_tm c' n := by + unfold multiStep + rw [Function.iterate_succ_apply] + change (Option.bind · (step target_tm))^[n] (step target_tm c) = _ + rw [h] + +theorem ReachHalt.to_isHalt {c : Cfg (Fin 2) (Fin 6)} (h : ReachHalt c) : + ∃ cfg, (c [target_tm]⊢* cfg) ∧ (step target_tm cfg).isNone := by + induction h with + | done hnone => exact ⟨_, ⟨0, rfl⟩, hnone⟩ + | next hstep _ ih => + rcases ih with ⟨cfg, ⟨n, hn⟩, hnone⟩ + exact ⟨cfg, ⟨n + 1, by rw [multiStep_succ_of_step n hstep, hn]⟩, hnone⟩ + +def cfg (q : Fin 6) (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some q, ⟨r.head, l, r.tail⟩⟩ + +@[simp] theorem zero_cons_default : b0 >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = b0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +theorem init_eq_cfg : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = cfg A default default := rfl + +theorem step_cfg_right {q q' : Fin 6} {b a : Fin 2} + (h : target_tm q b = some (some q', Stmt.write a Dir.right)) + (l r : ListBlank (Fin 2)) : + step target_tm (cfg q l (b >> r)) = some (cfg q' (a >> l) r) := by + simp [cfg, step, h, Turing.Tape.write, Turing.Tape.move] + +theorem step_cfg_left {q q' : Fin 6} {b a : Fin 2} + (h : target_tm q b = some (some q', Stmt.write a Dir.left)) + (c : Fin 2) (l r : ListBlank (Fin 2)) : + step target_tm (cfg q (c >> l) (b >> r)) = some (cfg q' l (c >> a >> r)) := by + simp [cfg, step, h, Turing.Tape.write, Turing.Tape.move] + +theorem step_cfg_right_nil {q q' : Fin 6} {a : Fin 2} + (h : target_tm q b0 = some (some q', Stmt.write a Dir.right)) + (l : ListBlank (Fin 2)) : + step target_tm (cfg q l default) = some (cfg q' (a >> l) default) := by + simpa using step_cfg_right h l default + +theorem step_cfg_left_nil {q q' : Fin 6} {a : Fin 2} + (h : target_tm q b0 = some (some q', Stmt.write a Dir.left)) + (c : Fin 2) (l : ListBlank (Fin 2)) : + step target_tm (cfg q (c >> l) default) = some (cfg q' l (c >> a >> default)) := by + simpa using step_cfg_left h c l default + +theorem step_cfg_left_lnil {q q' : Fin 6} {b a : Fin 2} + (h : target_tm q b = some (some q', Stmt.write a Dir.left)) + (r : ListBlank (Fin 2)) : + step target_tm (cfg q default (b >> r)) = some (cfg q' default (b0 >> a >> r)) := by + simpa using step_cfg_left h b0 default r + +theorem reach_right {q q' : Fin 6} {b a : Fin 2} + (h : target_tm q b = some (some q', Stmt.write a Dir.right)) + {l r : ListBlank (Fin 2)} {target : Cfg (Fin 2) (Fin 6)} + (hr : Reaches (cfg q' (a >> l) r) target) : + Reaches (cfg q l (b >> r)) target := + fun ht => ReachHalt.next (step_cfg_right h l r) (hr ht) + +theorem reach_left {q q' : Fin 6} {b a : Fin 2} + (h : target_tm q b = some (some q', Stmt.write a Dir.left)) + {c : Fin 2} {l r : ListBlank (Fin 2)} {target : Cfg (Fin 2) (Fin 6)} + (hr : Reaches (cfg q' l (c >> a >> r)) target) : + Reaches (cfg q (c >> l) (b >> r)) target := + fun ht => ReachHalt.next (step_cfg_left h c l r) (hr ht) + +theorem reach_right_nil {q q' : Fin 6} {a : Fin 2} + (h : target_tm q b0 = some (some q', Stmt.write a Dir.right)) + {l : ListBlank (Fin 2)} {target : Cfg (Fin 2) (Fin 6)} + (hr : Reaches (cfg q' (a >> l) default) target) : + Reaches (cfg q l default) target := + fun ht => ReachHalt.next (step_cfg_right_nil h l) (hr ht) + +theorem reach_left_nil {q q' : Fin 6} {a : Fin 2} + (h : target_tm q b0 = some (some q', Stmt.write a Dir.left)) + {c : Fin 2} {l : ListBlank (Fin 2)} {target : Cfg (Fin 2) (Fin 6)} + (hr : Reaches (cfg q' l (c >> a >> default)) target) : + Reaches (cfg q (c >> l) default) target := + fun ht => ReachHalt.next (step_cfg_left_nil h c l) (hr ht) + +theorem reach_left_lnil {q q' : Fin 6} {b a : Fin 2} + (h : target_tm q b = some (some q', Stmt.write a Dir.left)) + {r : ListBlank (Fin 2)} {target : Cfg (Fin 2) (Fin 6)} + (hr : Reaches (cfg q' default (b0 >> a >> r)) target) : + Reaches (cfg q default (b >> r)) target := + fun ht => ReachHalt.next (step_cfg_left_lnil h r) (hr ht) + +macro "step_tm" : tactic => `(tactic| + first + | refine reach_right rfl ?_ + | refine reach_left rfl ?_ + | refine reach_right_nil rfl ?_ + | refine reach_left_nil rfl ?_ + | refine reach_left_lnil rfl ?_) + +macro "exec_tm" n:num : tactic => `(tactic| ( + iterate $n step_tm + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, zero_cons_default] + exact Reaches.refl _)) + +-- ============================================================================ +-- Tape Encodings & Shift Lemmas +-- ============================================================================ + +def L01 : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, l => l + | k + 1, l => b0 >> b1 >> L01 k l + +def L11 : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, l => l + | n + 1, l => b1 >> b1 >> L11 n l + +def R1 : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, r => r + | c + 1, r => b1 >> R1 c r + +def R01 : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, r => r + | d + 1, r => b0 >> b1 >> R01 d r + +def L0 : ListBlank (Fin 2) := b0 >> b1 >> b0 >> b1 >> b1 >> default + +@[simp] theorem L01_zero (l : ListBlank (Fin 2)) : L01 0 l = l := rfl +@[simp] theorem L01_succ (k : Nat) (l : ListBlank (Fin 2)) : L01 (k + 1) l = b0 >> b1 >> L01 k l := rfl +@[simp] theorem L11_zero (l : ListBlank (Fin 2)) : L11 0 l = l := rfl +@[simp] theorem L11_succ (n : Nat) (l : ListBlank (Fin 2)) : L11 (n + 1) l = b1 >> b1 >> L11 n l := rfl +@[simp] theorem R1_zero (r : ListBlank (Fin 2)) : R1 0 r = r := rfl +@[simp] theorem R1_succ (c : Nat) (r : ListBlank (Fin 2)) : R1 (c + 1) r = b1 >> R1 c r := rfl +@[simp] theorem R01_zero (r : ListBlank (Fin 2)) : R01 0 r = r := rfl +@[simp] theorem R01_succ (d : Nat) (r : ListBlank (Fin 2)) : R01 (d + 1) r = b0 >> b1 >> R01 d r := rfl + +theorem L01_add (a b : Nat) (l : ListBlank (Fin 2)) : L01 (a + b) l = L01 a (L01 b l) := by + induction a with + | zero => simp + | succ a ih => simp [Nat.succ_add, ih] + +theorem L11_add (a b : Nat) (l : ListBlank (Fin 2)) : L11 (a + b) l = L11 a (L11 b l) := by + induction a with + | zero => simp + | succ a ih => simp [Nat.succ_add, ih] + +theorem R1_add (a b : Nat) (r : ListBlank (Fin 2)) : R1 (a + b) r = R1 a (R1 b r) := by + induction a with + | zero => simp + | succ a ih => simp [Nat.succ_add, ih] + +theorem R01_add (a b : Nat) (r : ListBlank (Fin 2)) : R01 (a + b) r = R01 a (R01 b r) := by + induction a with + | zero => simp + | succ a ih => simp [Nat.succ_add, ih] + +theorem L11_eq_R1 (n : Nat) (l : ListBlank (Fin 2)) : L11 n l = R1 (2 * n) l := by + induction n with + | zero => rfl + | succ n ih => + have h : 2 * (n + 1) = 2 + 2 * n := by omega + rw [h, R1_add] + simp [ih] + +theorem cons1_L11_cons1 (m : Nat) (l : ListBlank (Fin 2)) : + b1 >> L11 m (b1 >> l) = L11 (m + 1) l := by + induction m with + | zero => rfl + | succ m ih => simp [ih] + +theorem L0_eq_L01 : L0 = L01 2 (b1 >> default) := rfl + +theorem shift_A_01 (d : Nat) (l r : ListBlank (Fin 2)) : + Reaches (cfg A l (R01 d r)) (cfg A (L01 d l) r) := by + induction d generalizing l with + | zero => exact Reaches.refl _ + | succ d ih => + have h1 : Reaches (cfg A l (b0 >> b1 >> R01 d r)) (cfg A (b0 >> b1 >> l) (R01 d r)) := by + exec_tm 2 + refine h1.trans ?_ + have h2 := ih (b0 >> b1 >> l) + have h_eq : L01 d (b0 >> b1 >> l) = L01 (d + 1) l := by + change L01 d (L01 1 l) = L01 (d + 1) l + rw [← L01_add] + rwa [h_eq] at h2 + +theorem shift_F_01 (d : Nat) (l r : ListBlank (Fin 2)) : + Reaches (cfg F l (R01 d r)) (cfg F (L11 d l) r) := by + induction d generalizing l with + | zero => exact Reaches.refl _ + | succ d ih => + have h1 : Reaches (cfg F l (b0 >> b1 >> R01 d r)) (cfg F (b1 >> b1 >> l) (R01 d r)) := by + exec_tm 2 + refine h1.trans ?_ + have h2 := ih (b1 >> b1 >> l) + have h_eq : L11 d (b1 >> b1 >> l) = L11 (d + 1) l := by + change L11 d (L11 1 l) = L11 (d + 1) l + rw [← L11_add] + rwa [h_eq] at h2 + +theorem shift_A_1_01 (d : Nat) (l r : ListBlank (Fin 2)) : + Reaches (cfg A l (b1 >> R01 d r)) (cfg A (L11 d l) (b1 >> r)) := by + induction d generalizing l with + | zero => exact Reaches.refl _ + | succ d ih => + have h1 : Reaches (cfg A l (b1 >> b0 >> b1 >> R01 d r)) (cfg A (b1 >> b1 >> l) (b1 >> R01 d r)) := by + exec_tm 2 + refine h1.trans ?_ + have h2 := ih (b1 >> b1 >> l) + have h_eq : L11 d (b1 >> b1 >> l) = L11 (d + 1) l := by + change L11 d (L11 1 l) = L11 (d + 1) l + rw [← L11_add] + rwa [h_eq] at h2 + +theorem shift_D_1 (m : Nat) (l r : ListBlank (Fin 2)) : + Reaches (cfg D (R1 m l) (b1 >> r)) (cfg D l (R1 (m + 1) r)) := by + induction m generalizing r with + | zero => exact Reaches.refl _ + | succ m ih => + have h1 : Reaches (cfg D (b1 >> R1 m l) (b1 >> r)) (cfg D (R1 m l) (b1 >> (b1 >> r))) := by + exec_tm 1 + refine h1.trans ?_ + have h2 := ih (b1 >> r) + have h_eq : R1 (m + 1) (b1 >> r) = R1 (m + 2) r := by + change R1 (m + 1) (R1 1 r) = R1 (m + 1 + 1) r + rw [← R1_add] + rwa [h_eq] at h2 + +theorem shift_E_01_pair (j : Nat) (l r : ListBlank (Fin 2)) : + Reaches (cfg E (L01 (2 * j) l) (b1 >> b1 >> r)) (cfg E l (b1 >> b1 >> R01 (2 * j) r)) := by + induction j generalizing r with + | zero => exact Reaches.refl _ + | succ j ih => + have h_split : 2 * (j + 1) = 2 + 2 * j := by omega + rw [h_split, L01_add] + have h1 : Reaches (cfg E (b0 >> b1 >> b0 >> b1 >> L01 (2 * j) l) (b1 >> b1 >> r)) + (cfg E (L01 (2 * j) l) (b1 >> b1 >> (b0 >> b1 >> b0 >> b1 >> r))) := by + exec_tm 6 + refine h1.trans ?_ + have h2 := ih (b0 >> b1 >> b0 >> b1 >> r) + have h_eq : R01 (2 * j) (b0 >> b1 >> b0 >> b1 >> r) = R01 (2 + 2 * j) r := by + change R01 (2 * j) (R01 2 r) = R01 (2 + 2 * j) r + rw [← R01_add, Nat.add_comm] + rwa [h_eq] at h2 + +theorem reach_C_from_even (j : Nat) (l : ListBlank (Fin 2)) : + Reaches (cfg A (L01 (2 * j) l) default) (cfg C l (b1 >> b1 >> R01 (2 * j) default)) := by + cases j with + | zero => + simp only [Nat.mul_zero, L01_zero, R01_zero] + exec_tm 2 + | succ j => + have h_split : 2 * (j + 1) = 1 + (2 * j + 1) := by omega + have h_r2 : b0 >> b1 >> R01 (2 * j + 1) default = R01 (2 * (j + 1)) default := by + have h_idx : 2 * (j + 1) = (2 * j + 1) + 1 := by omega + rw [h_idx]; rfl + rw [← h_r2, h_split, L01_add, L01_add] + change Reaches (cfg A (b0 >> b1 >> L01 (2 * j) (b0 >> b1 >> l)) default) _ + have h1 : Reaches (cfg A (b0 >> b1 >> L01 (2 * j) (b0 >> b1 >> l)) default) + (cfg E (L01 (2 * j) (b0 >> b1 >> l)) (b1 >> b1 >> R01 1 default)) := by + exec_tm 6 + refine h1.trans ?_ + refine (shift_E_01_pair j (b0 >> b1 >> l) (R01 1 default)).trans ?_ + have h_r : R01 (2 * j) (R01 1 default) = R01 (2 * j + 1) default := by + rw [← R01_add] + rw [h_r] + exec_tm 2 + +theorem restore_L0 (m : Nat) : + Reaches (cfg A (L01 (2 * (m + 1)) default) default) (cfg A (L01 (2 * (m + 1)) L0) default) := by + have h1 := reach_C_from_even (m + 1) default + refine h1.trans ?_ + have h2 : Reaches (cfg C default (b1 >> b1 >> R01 (2 * (m + 1)) default)) + (cfg A (b1 >> default) (R01 (2 * (m + 1) + 2) default)) := by + exec_tm 6 + refine h2.trans ?_ + have h3 := shift_A_01 (2 * (m + 1) + 2) (b1 >> default) default + have h_eq : L01 (2 * (m + 1) + 2) (b1 >> default) = L01 (2 * (m + 1)) L0 := by + rw [L01_add]; rfl + rwa [h_eq] at h3 + +theorem c_b1_bounce (r : ListBlank (Fin 2)) : + Reaches (cfg C (b1 >> default) (b1 >> b1 >> r)) (cfg A L0 (b1 >> r)) := by + exec_tm 17 + +theorem d_L0_bounce (r : ListBlank (Fin 2)) : + Reaches (cfg D L0 (b1 >> b1 >> r)) (cfg A (L01 1 L0) r) := by + exec_tm 6 + +theorem d_b01_shift (l' r' : ListBlank (Fin 2)) : + Reaches (cfg D (b0 >> b1 >> l') (b1 >> b1 >> r')) + (cfg A (b0 >> b1 >> b0 >> b1 >> l') r') := by + exec_tm 6 + +theorem drain_C_L11 (m : Nat) (l r : ListBlank (Fin 2)) : + Reaches (cfg C (L11 (m + 1) l) (b1 >> b1 >> r)) + (cfg D l (R1 (2 * m + 2) (b0 >> b1 >> r))) := by + rw [L11_succ, L11_eq_R1] + have h1 : Reaches (cfg C (b1 >> b1 >> R1 (2 * m) l) (b1 >> b1 >> r)) + (cfg D (R1 (2 * m + 1) l) (b1 >> (b0 >> b1 >> r))) := by + have h_eq : b1 >> R1 (2 * m) l = R1 (2 * m + 1) l := by + change R1 1 (R1 (2 * m) l) = R1 (2 * m + 1) l + rw [← R1_add, Nat.add_comm] + rw [← h_eq] + exec_tm 1 + refine h1.trans ?_ + exact shift_D_1 (2 * m + 1) l (b0 >> b1 >> r) + +-- ============================================================================ +-- Canonical Configurations & Basic Macro-Step Rules +-- ============================================================================ + +inductive RBlocks where + | nil : RBlocks + | cons : Nat → Nat → RBlocks → RBlocks +deriving DecidableEq, Repr + +def evalRBlocks : RBlocks → ListBlank (Fin 2) + | .nil => default + | .cons c d rest => R1 c (R01 d (evalRBlocks rest)) + +@[simp] theorem evalRBlocks_nil : evalRBlocks .nil = default := rfl +@[simp] theorem evalRBlocks_cons (c d : Nat) (rest : RBlocks) : + evalRBlocks (.cons c d rest) = R1 c (R01 d (evalRBlocks rest)) := rfl + +def toCfg (k n : Nat) (blks : RBlocks) : Cfg (Fin 2) (Fin 6) := + cfg A (L01 k (L11 n L0)) (evalRBlocks blks) + +theorem rule_c0 (k n d : Nat) (rest : RBlocks) : + Reaches (toCfg k n (.cons 0 d rest)) (toCfg (k + d) n rest) := by + unfold toCfg + rw [evalRBlocks_cons, R1_zero] + have h := shift_A_01 d (L01 k (L11 n L0)) (evalRBlocks rest) + have h_eq : L01 d (L01 k (L11 n L0)) = L01 (k + d) (L11 n L0) := by + rw [← L01_add, Nat.add_comm] + rwa [h_eq] at h + +theorem step_even_nge1_one (j : Nat) (l r : ListBlank (Fin 2)) : + Reaches (cfg A (L01 (2 * j) (b1 >> b1 >> l)) (b1 >> b1 >> r)) + (cfg A (L01 (2 * (j + 1)) l) r) := by + have h1 : Reaches (cfg A (L01 (2 * j) (b1 >> b1 >> l)) (b1 >> b1 >> r)) + (cfg E (L01 (2 * j) (b1 >> b1 >> l)) (b1 >> b1 >> r)) := by + exec_tm 2 + refine h1.trans ?_ + refine (shift_E_01_pair j (b1 >> b1 >> l) r).trans ?_ + have h2 : Reaches (cfg E (b1 >> b1 >> l) (b1 >> b1 >> R01 (2 * j) r)) + (cfg A (L01 1 l) (R01 (2 * j + 1) r)) := by + have h_r : b0 >> b1 >> R01 (2 * j) r = R01 (2 * j + 1) r := rfl + rw [← h_r] + exec_tm 2 + refine h2.trans ?_ + have h3 := shift_A_01 (2 * j + 1) (L01 1 l) r + have h_eq : L01 (2 * j + 1) (L01 1 l) = L01 (2 * (j + 1)) l := by + rw [← L01_add] + congr 1 + rwa [h_eq] at h3 + +theorem step_even_nge1 (m j : Nat) (l r : ListBlank (Fin 2)) : + Reaches (cfg A (L01 (2 * j) (L11 m l)) (R1 (2 * m) r)) + (cfg A (L01 (2 * (j + m)) l) r) := by + induction m generalizing j with + | zero => + simp only [Nat.add_zero, Nat.mul_zero, L11_zero, R1_zero] + exact Reaches.refl _ + | succ m ih => + have h_r : 2 * (m + 1) = 2 + 2 * m := by omega + rw [L11_succ, h_r, R1_add] + change Reaches (cfg A (L01 (2 * j) (b1 >> b1 >> L11 m l)) (b1 >> b1 >> R1 (2 * m) r)) _ + refine (step_even_nge1_one j (L11 m l) (R1 (2 * m) r)).trans ?_ + have h2 := ih (j + 1) + have h_eq : 2 * (j + 1 + m) = 2 * (j + (m + 1)) := by omega + rwa [h_eq] at h2 + +theorem rule_even_nge1 (m j n c d : Nat) (rest : RBlocks) : + Reaches (toCfg (2 * j) (m + n) (.cons (2 * m + c) d rest)) + (toCfg (2 * j + 2 * m) n (.cons c d rest)) := by + unfold toCfg + rw [evalRBlocks_cons, evalRBlocks_cons, L11_add, R1_add] + have h := step_even_nge1 m j (L11 n L0) (R1 c (R01 d (evalRBlocks rest))) + have h_eq : 2 * (j + m) = 2 * j + 2 * m := by omega + rwa [h_eq] at h + +theorem step_odd_n0 (j : Nat) (r : ListBlank (Fin 2)) : + Reaches (cfg A (L01 (2 * j + 1) L0) (b1 >> b1 >> r)) + (cfg A (L11 (2 * j + 3) L0) (b1 >> r)) := by + have h_l : L01 (2 * j + 1) L0 = L01 (2 * (j + 1)) (b0 >> b1 >> b1 >> default) := by + rw [L0_eq_L01, ← L01_add] + have h_idx : 2 * j + 1 + 2 = 2 * (j + 1) + 1 := by omega + rw [h_idx, L01_add]; rfl + rw [h_l] + have h1 : Reaches (cfg A (L01 (2 * (j + 1)) (b0 >> b1 >> b1 >> default)) (b1 >> b1 >> r)) + (cfg E (L01 (2 * (j + 1)) (b0 >> b1 >> b1 >> default)) (b1 >> b1 >> r)) := by + exec_tm 2 + refine h1.trans ?_ + refine (shift_E_01_pair (j + 1) (b0 >> b1 >> b1 >> default) r).trans ?_ + have h2 : Reaches (cfg E (b0 >> b1 >> b1 >> default) (b1 >> b1 >> R01 (2 * (j + 1)) r)) + (cfg C (b1 >> default) (b1 >> b1 >> R01 (2 * j + 3) r)) := by + have h_r : b0 >> b1 >> R01 (2 * (j + 1)) r = R01 (2 * j + 3) r := rfl + rw [← h_r] + exec_tm 2 + refine h2.trans ?_ + refine (c_b1_bounce (R01 (2 * j + 3) r)).trans ?_ + exact shift_A_1_01 (2 * j + 3) L0 r + +theorem rule_odd_n0 (j c d : Nat) (rest : RBlocks) : + Reaches (toCfg (2 * j + 1) 0 (.cons (c + 2) d rest)) + (toCfg 0 (3 + 2 * j) (.cons (c + 1) d rest)) := by + unfold toCfg + have h_c : c + 2 = 2 + c := by omega + have h_c1 : c + 1 = 1 + c := by omega + rw [evalRBlocks_cons, evalRBlocks_cons, L11_zero, L01_zero, h_c, R1_add, h_c1, R1_add] + have h := step_odd_n0 j (R1 c (R01 d (evalRBlocks rest))) + have h_n : 2 * j + 3 = 3 + 2 * j := by omega + rwa [h_n] at h + +theorem step_k1_to_k6 (c0 d : Nat) (rest : RBlocks) : + Reaches (toCfg 1 0 (.cons (c0 + 7) d rest)) (toCfg 6 0 (.cons c0 d rest)) := by + have h1 : toCfg 1 0 (.cons (c0 + 7) d rest) = toCfg (2 * 0 + 1) 0 (.cons ((c0 + 5) + 2) d rest) := by + simp [Nat.add_assoc] + rw [h1] + refine (rule_odd_n0 0 (c0 + 5) d rest).trans ?_ + have h2 : toCfg 0 (3 + 2 * 0) (.cons ((c0 + 5) + 1) d rest) = + toCfg (2 * 0) (3 + 0) (.cons (2 * 3 + c0) d rest) := by + congr 2; omega + rw [h2] + exact rule_even_nge1 3 0 0 c0 d rest + +theorem step_odd_nge1 (j m : Nat) (r : ListBlank (Fin 2)) : + Reaches (cfg A (L01 (2 * j + 1) (L11 (m + 1) L0)) (b1 >> b1 >> r)) + (cfg A (L01 1 L0) (R1 (2 * m) (R01 (2 * j + 2) r))) := by + have h_l : L01 (2 * j + 1) (L11 (m + 1) L0) = L01 (2 * j) (b0 >> b1 >> L11 (m + 1) L0) := by + rw [L01_add]; rfl + rw [h_l] + have h1 : Reaches (cfg A (L01 (2 * j) (b0 >> b1 >> L11 (m + 1) L0)) (b1 >> b1 >> r)) + (cfg E (L01 (2 * j) (b0 >> b1 >> L11 (m + 1) L0)) (b1 >> b1 >> r)) := by + exec_tm 2 + refine h1.trans ?_ + refine (shift_E_01_pair j (b0 >> b1 >> L11 (m + 1) L0) r).trans ?_ + have h2 : Reaches (cfg E (b0 >> b1 >> L11 (m + 1) L0) (b1 >> b1 >> R01 (2 * j) r)) + (cfg C (L11 (m + 1) L0) (b1 >> b1 >> R01 (2 * j + 1) r)) := by + have h_r : b0 >> b1 >> R01 (2 * j) r = R01 (2 * j + 1) r := rfl + rw [← h_r] + exec_tm 2 + refine h2.trans ?_ + refine (drain_C_L11 m L0 (R01 (2 * j + 1) r)).trans ?_ + have h_r2 : R1 (2 * m + 2) (b0 >> b1 >> R01 (2 * j + 1) r) = + b1 >> b1 >> R1 (2 * m) (R01 (2 * j + 2) r) := by + have h_split : 2 * m + 2 = 2 + 2 * m := by omega + rw [h_split, R1_add]; rfl + rw [h_r2] + exact d_L0_bounce (R1 (2 * m) (R01 (2 * j + 2) r)) + +theorem rule_odd_nge1 (j m c d : Nat) (rest : RBlocks) : + Reaches (toCfg (2 * j + 1) (m + 1) (.cons (c + 2) d rest)) + (toCfg 1 0 (.cons (2 * m) (2 + 2 * j) (.cons c d rest))) := by + unfold toCfg + have h_c : c + 2 = 2 + c := by omega + have h_j : 2 + 2 * j = 2 * j + 2 := by omega + rw [evalRBlocks_cons, evalRBlocks_cons, evalRBlocks_cons, L11_zero, h_c, R1_add, h_j] + exact step_odd_nge1 j m (R1 c (R01 d (evalRBlocks rest))) + +theorem even_n0_boundary (j : Nat) (r : ListBlank (Fin 2)) : + Reaches (cfg A (L01 (2 * j) L0) (b1 >> b1 >> r)) + (cfg A (L01 (2 * j + 3) default) r) := by + have h1 : Reaches (cfg A (L01 (2 * j) L0) (b1 >> b1 >> r)) + (cfg E (L01 (2 * j) L0) (b1 >> b1 >> r)) := by + exec_tm 2 + refine h1.trans ?_ + refine (shift_E_01_pair j L0 r).trans ?_ + have h2 : Reaches (cfg E L0 (b1 >> b1 >> R01 (2 * j) r)) + (cfg A default (R01 (2 * j + 3) r)) := by + have h_r : b0 >> b1 >> b0 >> b1 >> b0 >> b1 >> R01 (2 * j) r = R01 (2 * j + 3) r := by + have h_idx : 2 * j + 3 = 3 + 2 * j := by omega + rw [h_idx, R01_add]; rfl + rw [← h_r] + exec_tm 8 + refine h2.trans ?_ + exact shift_A_01 (2 * j + 3) default r + +theorem step_even_n0_c4 (j : Nat) (r_rem : ListBlank (Fin 2)) : + Reaches (cfg A (L01 (2 * j) L0) (b1 >> b1 >> b1 >> b1 >> r_rem)) + (cfg A (L01 (2 * j + 3) L0) r_rem) := by + refine (even_n0_boundary j (b1 >> b1 >> r_rem)).trans ?_ + have h_l : L01 (2 * j + 3) default = L01 (2 * (j + 1)) (b0 >> b1 >> default) := by + have h_idx : 2 * j + 3 = 2 * (j + 1) + 1 := by omega + rw [h_idx, L01_add]; rfl + rw [h_l] + have h1 : Reaches (cfg A (L01 (2 * (j + 1)) (b0 >> b1 >> default)) (b1 >> b1 >> r_rem)) + (cfg E (L01 (2 * (j + 1)) (b0 >> b1 >> default)) (b1 >> b1 >> r_rem)) := by + exec_tm 2 + refine h1.trans ?_ + refine (shift_E_01_pair (j + 1) (b0 >> b1 >> default) r_rem).trans ?_ + have h2 : Reaches (cfg E (b0 >> b1 >> default) (b1 >> b1 >> R01 (2 * (j + 1)) r_rem)) + (cfg A (b1 >> default) (R01 (2 * j + 5) r_rem)) := by + have h_r : b0 >> b1 >> b0 >> b1 >> b0 >> b1 >> R01 (2 * (j + 1)) r_rem = R01 (2 * j + 5) r_rem := by + have h_idx : 2 * j + 5 = 3 + 2 * (j + 1) := by omega + rw [h_idx, R01_add]; rfl + rw [← h_r] + exec_tm 8 + refine h2.trans ?_ + have h3 := shift_A_01 (2 * j + 5) (b1 >> default) r_rem + have h_eq : L01 (2 * j + 5) (b1 >> default) = L01 (2 * j + 3) L0 := by + have h_idx : 2 * j + 5 = (2 * j + 3) + 2 := by omega + rw [h_idx, L01_add]; rfl + rwa [h_eq] at h3 + +theorem rule_even_n0_c4 (j d : Nat) (rest : RBlocks) : + Reaches (toCfg (2 * j) 0 (.cons 4 d rest)) + (toCfg (3 + 2 * j + d) 0 rest) := by + unfold toCfg + rw [evalRBlocks_cons, L11_zero] + change Reaches (cfg A (L01 (2 * j) L0) (b1 >> b1 >> b1 >> b1 >> R01 d (evalRBlocks rest))) _ + refine (step_even_n0_c4 j (R01 d (evalRBlocks rest))).trans ?_ + have h := shift_A_01 d (L01 (2 * j + 3) L0) (evalRBlocks rest) + have h_eq : L01 d (L01 (2 * j + 3) L0) = L01 (3 + 2 * j + d) L0 := by + rw [← L01_add]; congr 1; omega + rwa [h_eq] at h + +theorem rule_even_n0_cge6 (j c d : Nat) (rest : RBlocks) : + Reaches (toCfg (2 * j) 0 (.cons (c + 6) d rest)) + (toCfg 0 (5 + 2 * j) (.cons (c + 1) d rest)) := by + have h_c : c + 6 = 4 + (c + 2) := by omega + unfold toCfg + rw [evalRBlocks_cons, L11_zero, h_c, R1_add] + change Reaches (cfg A (L01 (2 * j) L0) (b1 >> b1 >> b1 >> b1 >> evalRBlocks (.cons (c + 2) d rest))) _ + refine (step_even_n0_c4 j (evalRBlocks (.cons (c + 2) d rest))).trans ?_ + have h1 : cfg A (L01 (2 * j + 3) L0) (evalRBlocks (.cons (c + 2) d rest)) = + toCfg (2 * (j + 1) + 1) 0 (.cons (c + 2) d rest) := by + unfold toCfg + have h_idx : 2 * j + 3 = 2 * (j + 1) + 1 := by omega + rw [L11_zero, h_idx] + rw [h1] + have h2 := rule_odd_n0 (j + 1) c d rest + have h_n : 3 + 2 * (j + 1) = 5 + 2 * j := by omega + rwa [h_n] at h2 + +theorem cons1_R1 (c : Nat) (r : ListBlank (Fin 2)) : + b1 >> R1 c r = R1 c (b1 >> r) := by + induction c with + | zero => rfl + | succ c ih => simp [ih] + +theorem bounce_A_1_01_end (d : Nat) (l : ListBlank (Fin 2)) : + Reaches (cfg A l (b1 >> R01 d default)) + (cfg D l (b1 >> b1 >> R1 (2 * d) (R01 1 default))) := by + have h1 : Reaches (cfg A l (b1 >> R01 d default)) (cfg F (b1 >> l) (R01 d default)) := by + exec_tm 1 + refine h1.trans ?_ + refine (shift_F_01 d (b1 >> l) default).trans ?_ + have h2 : Reaches (cfg F (L11 d (b1 >> l)) default) + (cfg C (L11 (d + 1) l) (b1 >> b1 >> default)) := by + rw [← cons1_L11_cons1] + exec_tm 3 + refine h2.trans ?_ + have h3 := drain_C_L11 d l default + have h_r : R1 (2 * d + 2) (b0 >> b1 >> default) = b1 >> b1 >> R1 (2 * d) (R01 1 default) := by + have h_split : 2 * d + 2 = 2 + 2 * d := by omega + rw [h_split, R1_add]; rfl + rwa [h_r] at h3 + +theorem rule_c1_end (k n d : Nat) : + Reaches (toCfg (k + 1) n (.cons 1 d .nil)) + (toCfg (1 + (k + 1)) n (.cons (2 * d) 1 .nil)) := by + unfold toCfg + rw [evalRBlocks_cons, evalRBlocks_nil, R1_succ, R1_zero] + refine (bounce_A_1_01_end d (L01 (k + 1) (L11 n L0))).trans ?_ + rw [L01_succ] + have h := d_b01_shift (L01 k (L11 n L0)) (R1 (2 * d) (R01 1 default)) + have h_l : b0 >> b1 >> b0 >> b1 >> L01 k (L11 n L0) = L01 (1 + (k + 1)) (L11 n L0) := by + have h_idx : 1 + (k + 1) = k + 1 + 1 := by omega + rw [h_idx]; rfl + rwa [h_l] at h + +theorem rule_c1_large_c2 (k n d c1 d2 : Nat) (rest2 : RBlocks) : + Reaches (toCfg k n (.cons 1 (d + 1) (.cons (2 * (d + 1) + c1 - 1) d2 rest2))) + (toCfg (k + 2 * (d + 1)) n (.cons c1 d2 rest2)) := by + unfold toCfg + rw [evalRBlocks_cons, evalRBlocks_cons, R1_succ, R1_zero] + refine (shift_A_1_01 (d + 1) (L01 k (L11 n L0)) (R1 (2 * (d + 1) + c1 - 1) (R01 d2 (evalRBlocks rest2)))).trans ?_ + have h_r : b1 >> R1 (2 * (d + 1) + c1 - 1) (R01 d2 (evalRBlocks rest2)) = + R1 (2 * (d + 1)) (R1 c1 (R01 d2 (evalRBlocks rest2))) := by + have h_c2 : 2 * (d + 1) + c1 - 1 + 1 = 2 * (d + 1) + c1 := by omega + rw [← R1_succ, h_c2, R1_add] + rw [h_r] + have h2 := step_even_nge1 (d + 1) 0 (L01 k (L11 n L0)) (R1 c1 (R01 d2 (evalRBlocks rest2))) + simp only [Nat.mul_zero, L01_zero, Nat.zero_add] at h2 + have h_l : L01 (2 * (d + 1)) (L01 k (L11 n L0)) = L01 (k + 2 * (d + 1)) (L11 n L0) := by + rw [← L01_add, Nat.add_comm] + rwa [h_l] at h2 + +theorem L01_cons01 (k : Nat) (l : ListBlank (Fin 2)) : + b0 >> b1 >> L01 k l = L01 k (b0 >> b1 >> l) := by + induction k with + | zero => rfl + | succ k ih => simp [ih] + +theorem step_c1_small_c2_core (r m' d2' : Nat) (l : ListBlank (Fin 2)) : + Reaches (cfg A l (b1 >> R01 ((m' + 1) + (r + 1)) (R1 (2 * (m' + 1)) (R01 (d2' + 1) default)))) + (cfg D l (b1 >> b1 >> R1 (2 * r) (R01 (2 + 2 * (m' + 1)) (R1 (2 * d2') (R01 1 default))))) := by + refine (shift_A_1_01 ((m' + 1) + (r + 1)) l (R1 (2 * (m' + 1)) (R01 (d2' + 1) default))).trans ?_ + rw [L11_add, cons1_R1] + have h1 := step_even_nge1 (m' + 1) 0 (L11 (r + 1) l) (b1 >> R01 (d2' + 1) default) + simp only [Nat.mul_zero, L01_zero, Nat.zero_add] at h1 + refine h1.trans ?_ + refine (bounce_A_1_01_end (d2' + 1) (L01 (2 * (m' + 1)) (L11 (r + 1) l))).trans ?_ + have h_split : 2 * (m' + 1) = (2 * m' + 1) + 1 := by omega + rw [h_split, L01_succ] + refine (d_b01_shift (L01 (2 * m' + 1) (L11 (r + 1) l)) (R1 (2 * (d2' + 1)) (R01 1 default))).trans ?_ + have h_l3 : b0 >> b1 >> b0 >> b1 >> L01 (2 * m' + 1) (L11 (r + 1) l) = + L01 (2 * (m' + 1)) (b0 >> b1 >> L11 (r + 1) l) := by + rw [L01_cons01, h_split]; rfl + have h_r3 : R1 (2 * (d2' + 1)) (R01 1 default) = b1 >> b1 >> R1 (2 * d2') (R01 1 default) := by + have h_s2 : 2 * (d2' + 1) = 2 + 2 * d2' := by omega + rw [h_s2, R1_add]; rfl + rw [h_l3, h_r3] + have h3 : Reaches (cfg A (L01 (2 * (m' + 1)) (b0 >> b1 >> L11 (r + 1) l)) (b1 >> b1 >> R1 (2 * d2') (R01 1 default))) + (cfg E (L01 (2 * (m' + 1)) (b0 >> b1 >> L11 (r + 1) l)) (b1 >> b1 >> R1 (2 * d2') (R01 1 default))) := by + exec_tm 2 + refine h3.trans ?_ + refine (shift_E_01_pair (m' + 1) (b0 >> b1 >> L11 (r + 1) l) (R1 (2 * d2') (R01 1 default))).trans ?_ + have h4 : Reaches (cfg E (b0 >> b1 >> L11 (r + 1) l) (b1 >> b1 >> R01 (2 * (m' + 1)) (R1 (2 * d2') (R01 1 default)))) + (cfg C (L11 (r + 1) l) (b1 >> b1 >> R01 (1 + 2 * (m' + 1)) (R1 (2 * d2') (R01 1 default)))) := by + have h_r01 : b0 >> b1 >> R01 (2 * (m' + 1)) (R1 (2 * d2') (R01 1 default)) = + R01 (1 + 2 * (m' + 1)) (R1 (2 * d2') (R01 1 default)) := by + have h_idx : 1 + 2 * (m' + 1) = 2 * (m' + 1) + 1 := by omega + rw [h_idx]; rfl + rw [← h_r01] + exec_tm 2 + refine h4.trans ?_ + refine (drain_C_L11 r l (R01 (1 + 2 * (m' + 1)) (R1 (2 * d2') (R01 1 default)))).trans ?_ + have h_r4 : R1 (2 * r + 2) (b0 >> b1 >> R01 (1 + 2 * (m' + 1)) (R1 (2 * d2') (R01 1 default))) = + b1 >> b1 >> R1 (2 * r) (R01 (2 + 2 * (m' + 1)) (R1 (2 * d2') (R01 1 default))) := by + have h_s3 : 2 * r + 2 = 2 + 2 * r := by omega + have h_idx : 2 + 2 * (m' + 1) = (1 + 2 * (m' + 1)) + 1 := by omega + rw [h_s3, R1_add, h_idx]; rfl + rw [h_r4] + exact Reaches.refl _ + +theorem step_c1_small_c2 (k n r' m' d2' : Nat) : + Reaches (toCfg (k + 1) n (.cons 1 ((m' + 1) + (r' + 1)) (.cons (2 * (m' + 1)) (d2' + 1) .nil))) + (cfg A (L01 (k + 2) (L11 n L0)) + (R1 (2 * r') (R01 (2 + 2 * (m' + 1)) (R1 (2 * d2') (R01 1 default))))) := by + unfold toCfg + rw [evalRBlocks_cons, evalRBlocks_cons, evalRBlocks_nil, R1_succ, R1_zero] + refine (step_c1_small_c2_core r' m' d2' (L01 (k + 1) (L11 n L0))).trans ?_ + exact d_b01_shift (L01 k (L11 n L0)) (R1 (2 * r') (R01 (2 + 2 * (m' + 1)) (R1 (2 * d2') (R01 1 default)))) + +theorem rule_nil_even_nge2 (j m' : Nat) : + Reaches (toCfg (2 * j) (m' + 2) .nil) + (toCfg 1 0 (.cons (2 * m' + 2) (1 + 2 * j) .nil)) := by + unfold toCfg + rw [evalRBlocks_nil, evalRBlocks_cons, evalRBlocks_nil, L11_zero] + refine (reach_C_from_even j (L11 (m' + 1 + 1) L0)).trans ?_ + refine (drain_C_L11 (m' + 1) L0 (R01 (2 * j) default)).trans ?_ + have h_r : R1 (2 * (m' + 1) + 2) (b0 >> b1 >> R01 (2 * j) default) = + b1 >> b1 >> R1 (2 * m' + 2) (R01 (1 + 2 * j) default) := by + have h_split : 2 * (m' + 1) + 2 = 2 + (2 * m' + 2) := by omega + have h_idx : 1 + 2 * j = 2 * j + 1 := by omega + rw [h_split, R1_add, h_idx]; rfl + rw [h_r] + exact d_L0_bounce (R1 (2 * m' + 2) (R01 (1 + 2 * j) default)) + +abbrev lb0 : ListBlank (Fin 2) := default + +theorem rule_nil_even_n0 (j : Nat) : + Reaches (toCfg (2 * j) 0 .nil) + (toCfg 1 0 (.cons (4 + 4 * j) 1 .nil)) := by + have h_start : toCfg (2 * j) 0 .nil = cfg A (L01 (2 * (j + 1)) (b1 >> lb0)) default := by + unfold toCfg + have h_idx : 2 * j + 2 = 2 * (j + 1) := by omega + rw [evalRBlocks_nil, L11_zero, L0_eq_L01, ← L01_add, h_idx] + rw [h_start] + refine (reach_C_from_even (j + 1) (b1 >> lb0)).trans ?_ + refine (c_b1_bounce (R01 (2 * (j + 1)) default)).trans ?_ + refine (shift_A_1_01 (2 * (j + 1)) L0 default).trans ?_ + have h1 : Reaches (cfg A (L11 (2 * (j + 1)) L0) (b1 >> lb0)) + (toCfg (2 * 0) ((2 * j + 1) + 2) .nil) := by + unfold toCfg + have h_n : (2 * j + 1) + 2 = 2 * (j + 1) + 1 := by omega + rw [evalRBlocks_nil, Nat.mul_zero, L01_zero, h_n, L11_succ] + exec_tm 2 + refine h1.trans ?_ + have h2 := rule_nil_even_nge2 0 (2 * j + 1) + have h_c : 2 * (2 * j + 1) + 2 = 4 + 4 * j := by omega + rwa [h_c] at h2 + +theorem step_nil_odd_ind (n j : Nat) : + Reaches (toCfg (2 * j + 1) n .nil) + (toCfg (2 * (j + n) + 1) 0 .nil) := by + induction n generalizing j with + | zero => + simp only [Nat.add_zero] + exact Reaches.refl _ + | succ n ih => + unfold toCfg + rw [evalRBlocks_nil] + have h_l : L01 (2 * j + 1) (L11 (n + 1) L0) = L01 (2 * j) (b0 >> b1 >> L11 (n + 1) L0) := by + rw [L01_add]; rfl + rw [h_l] + refine (reach_C_from_even j (b0 >> b1 >> L11 (n + 1) L0)).trans ?_ + have h1 : Reaches (cfg C (b0 >> b1 >> L11 (n + 1) L0) (b1 >> b1 >> R01 (2 * j) default)) + (cfg A (L01 1 (L11 n L0)) (R01 (2 * j + 2) default)) := by + rw [L11_succ] + have h_r : b0 >> b1 >> b0 >> b1 >> R01 (2 * j) default = R01 (2 * j + 2) default := by + have h_idx : 2 * j + 2 = 2 + 2 * j := by omega + rw [h_idx, R01_add]; rfl + rw [← h_r] + exec_tm 6 + refine h1.trans ?_ + refine (shift_A_01 (2 * j + 2) (L01 1 (L11 n L0)) default).trans ?_ + have h_l2 : cfg A (L01 (2 * j + 2) (L01 1 (L11 n L0))) default = toCfg (2 * (j + 1) + 1) n .nil := by + unfold toCfg + have h_idx : 2 * j + 2 + 1 = 2 * (j + 1) + 1 := by omega + rw [evalRBlocks_nil, ← L01_add, h_idx] + rw [h_l2] + have h2 := ih (j + 1) + have h_idx : j + 1 + n = j + (n + 1) := by omega + rwa [h_idx] at h2 + +theorem rule_nil_odd (j n : Nat) : + Reaches (toCfg (2 * j + 1) n .nil) + (toCfg 1 0 (.cons (12 + 4 * j + 4 * n) 1 .nil)) := by + refine (step_nil_odd_ind n j).trans ?_ + let J := j + n + have h_l : toCfg (2 * J + 1) 0 .nil = cfg A (L01 (2 * (J + 1)) (b0 >> b1 >> b1 >> lb0)) default := by + unfold toCfg + rw [evalRBlocks_nil, L11_zero, L0_eq_L01, ← L01_add] + have h_idx : 2 * J + 1 + 2 = 2 * (J + 1) + 1 := by omega + rw [h_idx, L01_add]; rfl + rw [h_l] + refine (reach_C_from_even (J + 1) (b0 >> b1 >> b1 >> lb0)).trans ?_ + have h1 : Reaches (cfg C (b0 >> b1 >> b1 >> lb0) (b1 >> b1 >> R01 (2 * (J + 1)) default)) + (cfg A default (R01 (2 * (J + 2)) default)) := by + have h_r : b0 >> b1 >> b0 >> b1 >> R01 (2 * (J + 1)) default = R01 (2 * (J + 2)) default := by + have h_idx : 2 * (J + 2) = 2 + 2 * (J + 1) := by omega + rw [h_idx, R01_add]; rfl + rw [← h_r] + exec_tm 6 + refine h1.trans ?_ + refine (shift_A_01 (2 * (J + 2)) default default).trans ?_ + refine (restore_L0 (J + 1)).trans ?_ + have h2 := rule_nil_even_n0 (J + 2) + have h_c : 4 + 4 * (J + 2) = 12 + 4 * j + 4 * n := by omega + rwa [h_c] at h2 + +theorem halt_from_E_default (r : ListBlank (Fin 2)) : + ReachHalt (cfg E default (b1 >> b1 >> r)) := by + refine ReachHalt.next (step_cfg_left_lnil rfl (b1 >> r)) ?_ + refine ReachHalt.next (step_cfg_left_lnil rfl (b0 >> b1 >> r)) ?_ + exact ReachHalt.done (by simp [cfg, step, target_tm]; rfl) + +theorem rule_even_n0_c2 (j m : Nat) : + Reaches (toCfg (2 * j) 0 (.cons 2 (2 * m + 1) .nil)) + (toCfg (3 + 2 * j + (2 * m + 1)) 0 .nil) := by + unfold toCfg + rw [evalRBlocks_cons, evalRBlocks_nil, L11_zero] + change Reaches (cfg A (L01 (2 * j) L0) (b1 >> b1 >> R01 (2 * m + 1) default)) _ + refine (even_n0_boundary j (R01 (2 * m + 1) default)).trans ?_ + refine (shift_A_01 (2 * m + 1) (L01 (2 * j + 3) default) default).trans ?_ + have h_eq : (2 * m + 1) + (2 * j + 3) = 2 * (j + m + 1 + 1) := by omega + rw [← L01_add, h_eq] + have h2 := restore_L0 (j + m + 1) + have h_eq2 : 2 * (j + m + 1 + 1) = 3 + 2 * j + (2 * m + 1) := by omega + rw [← h_eq2] + exact h2 + +theorem rule_halt_c3 (j r' m' : Nat) : + ReachHalt (toCfg (2 * j) 0 (.cons 3 ((m' + 1) + (r' + 2)) (.cons (2 * (m' + 1)) 1 .nil))) := by + unfold toCfg + rw [evalRBlocks_cons, evalRBlocks_cons, evalRBlocks_nil, L11_zero] + change ReachHalt (cfg A (L01 (2 * j) L0) (b1 >> b1 >> b1 >> R01 ((m' + 1) + (r' + 2)) (R1 (2 * (m' + 1)) (R01 1 default)))) + refine even_n0_boundary j (b1 >> R01 ((m' + 1) + (r' + 2)) (R1 (2 * (m' + 1)) (R01 1 default))) ?_ + refine step_c1_small_c2_core (r' + 1) m' 0 (L01 (2 * j + 3) default) ?_ + have h_r : R1 (2 * (r' + 1)) (R01 (2 + 2 * (m' + 1)) (R1 (2 * 0) (R01 1 default))) = + b1 >> b1 >> R1 (2 * r') (R01 (2 + 2 * (m' + 1)) (R01 1 default)) := by + have h_split : 2 * (r' + 1) = 2 + 2 * r' := by omega + rw [h_split, R1_add]; rfl + rw [h_r] + refine d_b01_shift (L01 (2 * j + 2) default) (b1 >> b1 >> R1 (2 * r') (R01 (2 + 2 * (m' + 1)) (R01 1 default))) ?_ + change ReachHalt (cfg A (L01 (2 * j + 4) default) (b1 >> b1 >> R1 (2 * r') (R01 (2 + 2 * (m' + 1)) (R01 1 default)))) + have h_l2 : 2 * j + 4 = 2 * (j + 2) := by omega + rw [h_l2] + have h_ae : Reaches (cfg A (L01 (2 * (j + 2)) default) (b1 >> b1 >> R1 (2 * r') (R01 (2 + 2 * (m' + 1)) (R01 1 default)))) + (cfg E (L01 (2 * (j + 2)) default) (b1 >> b1 >> R1 (2 * r') (R01 (2 + 2 * (m' + 1)) (R01 1 default)))) := by + exec_tm 2 + refine h_ae ?_ + refine shift_E_01_pair (j + 2) default (R1 (2 * r') (R01 (2 + 2 * (m' + 1)) (R01 1 default))) ?_ + exact halt_from_E_default _ + +-- ============================================================================ +-- Accelerated Era Loops: `step_withR_iter` and `step_outer_era_iter` +-- ============================================================================ + +theorem five_mul_le_pow2 (r : Nat) : 5 * r ≤ 20 * (2 ^ r - 1) := by + induction r with + | zero => simp + | succ r ih => + have h_pow : 2 ^ (r + 1) = 2 * 2 ^ r := Nat.pow_succ' + have h_pos : 1 ≤ 2 ^ r := Nat.one_le_pow r 2 (by decide) + omega + +theorem mul_pow2_sub_one_succ (m p : Nat) (hp : 1 ≤ p) : + 4 * (m + 5) * (2 * p - 1) = (4 * m + 20) + 4 * ((2 * m + 5) + 5) * (p - 1) := by + have h_sub : 2 * p - 1 = 1 + 2 * (p - 1) := by omega + have h_m : 4 * (m + 5) * 2 = 4 * ((2 * m + 5) + 5) := by omega + have h_m1 : 4 * (m + 5) * 1 = 4 * m + 20 := by omega + rw [h_sub, Nat.mul_add, h_m1, ← Nat.mul_assoc, h_m] + +theorem step_withR_one (m c d : Nat) (rest : RBlocks) : + Reaches (toCfg (2 * m) 0 (.cons (c + 1 + (4 * m + 15)) d rest)) + (toCfg (2 * (2 * m + 5)) 0 (.cons (c + 1) d rest)) := by + have h1 : c + 1 + (4 * m + 15) = (c + (4 * m + 10)) + 6 := by omega + rw [h1] + refine (rule_even_n0_cge6 m (c + (4 * m + 10)) d rest).trans ?_ + have h2 : (c + (4 * m + 10)) + 1 = 2 * (5 + 2 * m) + (c + 1) := by omega + rw [h2] + have h3 := rule_even_nge1 (5 + 2 * m) 0 0 (c + 1) d rest + have h4 : 2 * 0 + 2 * (5 + 2 * m) = 2 * (2 * m + 5) := by omega + rwa [h4] at h3 + +theorem step_withR_iter (r m c_start c_end d : Nat) (rest : RBlocks) + (h_c : 1 ≤ c_end) + (h_eq : c_start + 5 * r = c_end + 4 * (m + 5) * (2 ^ r - 1)) : + Reaches (toCfg (2 * m) 0 (.cons c_start d rest)) + (toCfg (2 * ((m + 5) * 2 ^ r - 5)) 0 (.cons c_end d rest)) := by + induction r generalizing m c_start with + | zero => + have h_c_eq : c_start = c_end := by + simp only [Nat.pow_zero, Nat.sub_self, Nat.mul_zero, Nat.add_zero] at h_eq + exact h_eq + have h_k_eq : 2 * ((m + 5) * 2 ^ 0 - 5) = 2 * m := by simp + rw [h_c_eq, h_k_eq] + exact Reaches.refl _ + | succ r ih => + have h_pow : 2 ^ (r + 1) = 2 * 2 ^ r := Nat.pow_succ' + have h_pos : 1 ≤ 2 ^ r := Nat.one_le_pow r 2 (by decide) + have h_five := five_mul_le_pow2 r + have h_mul : 20 * (2 ^ r - 1) ≤ 4 * ((2 * m + 5) + 5) * (2 ^ r - 1) := + Nat.mul_le_mul_right (2 ^ r - 1) (by omega) + rw [h_pow, mul_pow2_sub_one_succ m (2 ^ r) h_pos] at h_eq + let c_mid := c_start - (4 * m + 15) + have h_cmid_ge : 1 ≤ c_mid := by omega + have h_cstart : c_start = (c_mid - 1) + 1 + (4 * m + 15) := by omega + rw [h_cstart] + refine (step_withR_one m (c_mid - 1) d rest).trans ?_ + have h_cmid_eq : c_mid - 1 + 1 = c_mid := by omega + rw [h_cmid_eq] + have h_ih := ih (2 * m + 5) c_mid (by omega) + have h_k : (2 * m + 5 + 5) * 2 ^ r = (m + 5) * 2 ^ (r + 1) := by + have h_2m : 2 * m + 5 + 5 = (m + 5) * 2 := by omega + rw [h_pow, h_2m, Nat.mul_assoc] + rwa [h_k] at h_ih + +theorem toCfg_cons_zero (k n c1 d1 d2 : Nat) (rest : RBlocks) : + toCfg k n (.cons c1 d1 (.cons 0 d2 rest)) = toCfg k n (.cons c1 (d1 + d2) rest) := by + unfold toCfg + simp [R01_add] + +theorem step_outer_era_pair (jc jr p jr2 p2 D_half limit h : Nat) + (hp : p = 2 ^ (2 * jr + 1)) + (hp2 : p2 = 2 ^ (2 * jr2)) + (h_jc : 4 ≤ jc) + (h_jr : 1 ≤ jr) + (h_jr2 : 1 ≤ jr2) + (h_b1 : 8 + 32 * p ≤ 30 + 2 * jc + 10 * jr) + (h_b2 : 71 + 2 * jc + 10 * jr ≤ 64 * p) + (h_b3 : 1 + 64 * p ≤ 44 + 2 * jc + 64 * p2 + 20 * jr) + (h_D : 2 * D_half = 44 + 2 * jc + 64 * p2 + 20 * jr - 64 * p) + (h_b4 : 30 + (64 * p - (36 + 2 * jc + 10 * jr)) + 10 * jr2 ≤ 64 * p2) + (h_p2_lin : 26 + 10 * jr2 ≤ 32 * p2) + (h_lim : limit = 18 + (64 * p - (36 + 2 * jc + 10 * jr)) + 2 * D_half + 10 * jr2 - 32 * p2) + (h_le : 2 * h + 2 * D_half ≤ limit) : + Reaches (toCfg 1 0 (.cons (2 * jc + 2 * h) 1 .nil)) + (toCfg 1 0 (.cons (2 * jc + 2 * D_half + 4 * h) 1 .nil)) := by + have hp_ge : 8 ≤ p := by + rw [hp] + have : 2 ^ 3 ≤ 2 ^ (2 * jr + 1) := Nat.pow_le_pow_right (by decide) (by omega) + omega + have hp2_ge : 4 ≤ p2 := by + rw [hp2] + have : 2 ^ 2 ≤ 2 ^ (2 * jr2) := Nat.pow_le_pow_right (by decide) (by omega) + omega + let m1 := (12 + jc + 5 * jr + h) - 16 * p + let n_rem1' := 32 * p - (18 + jc + 5 * jr + h) + let m2 := (10 + n_rem1' + 5 * jr2) - 16 * p2 + let n_rem2 := (16 * p2 - 5) - m2 + have hm1 : m1 = (12 + jc + 5 * jr + h) - 16 * p := rfl + have hn1 : n_rem1' = 32 * p - (18 + jc + 5 * jr + h) := rfl + have hm2 : m2 = (10 + n_rem1' + 5 * jr2) - 16 * p2 := rfl + have hn2 : n_rem2 = (16 * p2 - 5) - m2 := rfl + have h_e1_start : 2 * jc + 2 * h = (2 * jc + 2 * h - 7) + 7 := by omega + rw [h_e1_start] + refine (step_k1_to_k6 (2 * jc + 2 * h - 7) 1 .nil).trans ?_ + have h_r1 := step_withR_iter (2 * jr + 1) 3 (2 * jc + 2 * h - 7) (2 * m1 + 6) 1 .nil (by omega) (by rw [← hp]; omega) + have h_k1 : 2 * ((3 + 5) * 2 ^ (2 * jr + 1) - 5) = 2 * (8 * p - 5) := by rw [← hp] + rw [h_k1] at h_r1 + refine (show Reaches (toCfg (2 * 3) 0 _) _ from h_r1).trans ?_ + refine (rule_even_n0_cge6 (8 * p - 5) (2 * m1) 1 .nil).trans ?_ + have h_mid1 : 5 + 2 * (8 * p - 5) = m1 + (n_rem1' + 1) := by omega + rw [h_mid1] + refine (rule_even_nge1 m1 0 (n_rem1' + 1) 1 1 .nil).trans ?_ + have h_c1_in : 2 * 0 + 2 * m1 = (2 * m1 - 1) + 1 := by omega + rw [h_c1_in] + refine (rule_c1_end (2 * m1 - 1) (n_rem1' + 1) 1).trans ?_ + have h_odd1_in : 1 + ((2 * m1 - 1) + 1) = 2 * m1 + 1 := by omega + rw [h_odd1_in] + refine (rule_odd_nge1 m1 n_rem1' 0 1 .nil).trans ?_ + rw [toCfg_cons_zero] + have h_e2_c : 2 * n_rem1' = (2 * n_rem1' - 7) + 7 := by omega + have h_e2_d : 2 + 2 * m1 + 1 = 2 * m1 + 3 := by omega + rw [h_e2_c, h_e2_d] + refine (step_k1_to_k6 (2 * n_rem1' - 7) (2 * m1 + 3) .nil).trans ?_ + have h_r2 := step_withR_iter (2 * jr2) 3 (2 * n_rem1' - 7) (2 * m2 + 5) (2 * m1 + 3) .nil (by omega) (by rw [← hp2]; omega) + have h_k2 : 2 * ((3 + 5) * 2 ^ (2 * jr2) - 5) = 2 * (8 * p2 - 5) := by rw [← hp2] + rw [h_k2] at h_r2 + refine (show Reaches (toCfg (2 * 3) 0 _) _ from h_r2).trans ?_ + have h_cge6_in : 2 * m2 + 5 = (2 * m2 - 1) + 6 := by omega + rw [h_cge6_in] + refine (rule_even_n0_cge6 (8 * p2 - 5) (2 * m2 - 1) (2 * m1 + 3) .nil).trans ?_ + have h_mid2_n : 5 + 2 * (8 * p2 - 5) = m2 + n_rem2 := by omega + have h_mid2_c : (2 * m2 - 1) + 1 = 2 * m2 + 0 := by omega + rw [h_mid2_n, h_mid2_c] + refine (rule_even_nge1 m2 0 n_rem2 0 (2 * m1 + 3) .nil).trans ?_ + refine (rule_c0 (2 * 0 + 2 * m2) n_rem2 (2 * m1 + 3) .nil).trans ?_ + have h_nil_in : 2 * 0 + 2 * m2 + (2 * m1 + 3) = 2 * (m2 + m1 + 1) + 1 := by omega + rw [h_nil_in] + have h_end := rule_nil_odd (m2 + m1 + 1) n_rem2 + have h_final : 12 + 4 * (m2 + m1 + 1) + 4 * n_rem2 = 2 * jc + 2 * D_half + 4 * h := by omega + rwa [h_final] at h_end + +theorem step_outer_era_iter (i : Nat) (jc jr p jr2 p2 D_half limit : Nat) + (hp : p = 2 ^ (2 * jr + 1)) + (hp2 : p2 = 2 ^ (2 * jr2)) + (h_jc : 4 ≤ jc) + (h_jr : 1 ≤ jr) + (h_jr2 : 1 ≤ jr2) + (h_b1 : 8 + 32 * p ≤ 30 + 2 * jc + 10 * jr) + (h_b2 : 71 + 2 * jc + 10 * jr ≤ 64 * p) + (h_b3 : 1 + 64 * p ≤ 44 + 2 * jc + 64 * p2 + 20 * jr) + (h_D : 2 * D_half = 44 + 2 * jc + 64 * p2 + 20 * jr - 64 * p) + (h_b4 : 30 + (64 * p - (36 + 2 * jc + 10 * jr)) + 10 * jr2 ≤ 64 * p2) + (h_p2_lin : 26 + 10 * jr2 ≤ 32 * p2) + (h_lim : limit = 18 + (64 * p - (36 + 2 * jc + 10 * jr)) + 2 * D_half + 10 * jr2 - 32 * p2) + (h_le : 2 * D_half * 2 ^ i ≤ 2 * limit) : + Reaches (toCfg 1 0 (.cons (2 * jc) 1 .nil)) + (toCfg 1 0 (.cons (2 * jc + 2 * D_half * (2 ^ i - 1)) 1 .nil)) := by + induction i with + | zero => + simp only [Nat.pow_zero, Nat.sub_self, Nat.mul_zero, Nat.add_zero] + exact Reaches.refl _ + | succ i ih => + have h_pow : 2 ^ (i + 1) = 2 * 2 ^ i := Nat.pow_succ' + have h_pos : 1 ≤ 2 ^ i := Nat.one_le_pow i 2 (by decide) + have h_2h : 2 * (D_half * (2 ^ i - 1)) = 2 * D_half * (2 ^ i - 1) := by + rw [← Nat.mul_assoc] + have h_4h : 4 * (D_half * (2 ^ i - 1)) = 2 * (2 * D_half * (2 ^ i - 1)) := by + have : 4 = 2 * 2 := rfl + rw [this, Nat.mul_assoc, h_2h] + have h_sub : 2 * D_half * (2 ^ (i + 1) - 1) = 2 * D_half + 2 * (2 * D_half * (2 ^ i - 1)) := by + have h1 : 2 ^ (i + 1) - 1 = 1 + 2 * (2 ^ i - 1) := by omega + rw [h1, Nat.mul_add, Nat.mul_one, Nat.mul_left_comm] + have h_id : 2 * (D_half * (2 ^ i - 1)) + 2 * D_half = 2 * D_half * 2 ^ i := by + have h1 : 1 + (2 ^ i - 1) = 2 ^ i := by omega + calc 2 * (D_half * (2 ^ i - 1)) + 2 * D_half + _ = 2 * D_half + 2 * D_half * (2 ^ i - 1) := by omega + _ = 2 * D_half * (1 + (2 ^ i - 1)) := by rw [Nat.mul_add, Nat.mul_one] + _ = 2 * D_half * 2 ^ i := by rw [h1] + have h_dbl : 2 * D_half * 2 ^ (i + 1) = 2 * (2 * D_half * 2 ^ i) := by + rw [h_pow, Nat.mul_left_comm] + refine (ih (by omega)).trans ?_ + rw [← h_2h] + have h_step := step_outer_era_pair jc jr p jr2 p2 D_half limit (D_half * (2 ^ i - 1)) + hp hp2 h_jc h_jr h_jr2 h_b1 h_b2 h_b3 h_D h_b4 h_p2_lin h_lim (by omega) + have h_out : 2 * jc + 2 * D_half + 4 * (D_half * (2 ^ i - 1)) = 2 * jc + 2 * D_half * (2 ^ (i + 1) - 1) := by + omega + rwa [h_out] at h_step + +-- ============================================================================ +-- Executable Macro-Simulator & Soundness +-- ============================================================================ + +inductive HState where + | active : Nat → Nat → RBlocks → HState + | halted : HState +deriving DecidableEq, Repr + +def bindNat {α : Type} (n : Nat) (k : Nat → α) : α := + match Nat.add 1 n with + | 0 => k 0 + | m + 1 => k m + +def bindBool {α : Type} (b : Bool) (k : Bool → α) : α := + match b with + | true => k true + | false => k false + +@[simp] theorem bindNat_eq {α : Type} (n : Nat) (k : Nat → α) : bindNat n k = k n := by + unfold bindNat + rw [show Nat.add 1 n = n + 1 from Nat.add_comm 1 n] + +@[simp] theorem bindBool_eq {α : Type} (b : Bool) (k : Bool → α) : bindBool b k = k b := by + cases b <;> rfl + +@[simp] theorem nat_ble_eq_true (a b : Nat) : (Nat.ble a b = true) ↔ a ≤ b := + ⟨Nat.le_of_ble_eq_true, Nat.ble_eq_true_of_le⟩ + +@[simp] theorem nat_beq_eq_true (a b : Nat) : (Nat.beq a b = true) ↔ a = b := by + simp [Nat.beq_eq] + +def bindState (s : HState) (f : HState → HState) : HState := + match s with + | .halted => .halted + | .active k n blks => f (.active k n blks) + +inductive ValidState : HState → Prop + | halted : ValidState .halted + | active {k n blks} : ReachHalt (toCfg k n blks) → ValidState (.active k n blks) + +@[irreducible] def ValidFrom (k n : Nat) (blks : RBlocks) (s : HState) : Prop := + ValidState s → ReachHalt (toCfg k n blks) + +theorem ValidFrom.self (k n : Nat) (blks : RBlocks) : + ValidFrom k n blks (.active k n blks) := by + unfold ValidFrom + intro hs; cases hs with | active h => exact h + +theorem ValidFrom.halted {k n : Nat} {blks : RBlocks} (h : ReachHalt (toCfg k n blks)) : + ValidFrom k n blks .halted := by + unfold ValidFrom + exact fun _ => h + +theorem ValidFrom.of_reaches {k n k' n' : Nat} {blks blks' : RBlocks} {s : HState} + (h1 : Reaches (toCfg k n blks) (toCfg k' n' blks')) + (h2 : ValidFrom k' n' blks' s) : + ValidFrom k n blks s := by + unfold ValidFrom at * + exact fun hs => h1 (h2 hs) + +theorem ValidState.of_validFrom {k n : Nat} {blks : RBlocks} {s : HState} + (h : ValidFrom k n blks s) (hs : ValidState s) : + ValidState (.active k n blks) := by + unfold ValidFrom at h + exact ValidState.active (h hs) + +theorem min_le_left_sub (n c : Nat) : Nat.min n (c / 2) + (n - Nat.min n (c / 2)) = n := by + change min n (c / 2) + (n - min n (c / 2)) = n + omega + +theorem min_le_right_sub (n c : Nat) : 2 * Nat.min n (c / 2) + (c - 2 * Nat.min n (c / 2)) = c := by + change 2 * min n (c / 2) + (c - 2 * min n (c / 2)) = c + omega + +def mkActive0 (k n : Nat) : HState := + bindNat k fun k' => + bindNat n fun n' => + HState.active k' n' .nil + +def mkActiveRaw1 (k n c d : Nat) (rest : RBlocks) : HState := + bindNat k fun k' => + bindNat n fun n' => + bindNat c fun c' => + bindNat d fun d' => + HState.active k' n' (.cons c' d' rest) + +def mkActiveRaw2 (k n c1 d1 c2 d2 : Nat) (rest : RBlocks) : HState := + bindNat k fun k' => + bindNat n fun n' => + bindNat c1 fun c1' => + bindNat d1 fun d1' => + bindNat c2 fun c2' => + bindNat d2 fun d2' => + HState.active k' n' (.cons c1' d1' (.cons c2' d2' rest)) + +def mkActiveRest0 (k n : Nat) : HState := + bindNat k fun k' => + bindNat n fun n' => + if Nat.beq (k' % 2) 1 then + bindNat ((k' - 1) / 2) fun j => + mkActiveRaw1 1 0 (12 + (4 * j + 4 * n')) 1 .nil + else if Nat.beq n' 0 then + bindNat (k' / 2) fun j => + mkActiveRaw1 1 0 (4 + 4 * j) 1 .nil + else + mkActive0 k' n' + +theorem mkActiveRest0_sound (k n : Nat) : + ValidFrom k n .nil (mkActiveRest0 k n) := by + unfold mkActiveRest0 mkActiveRaw1 mkActive0 + simp only [bindNat_eq] + split + · next h_odd => + simp only [nat_beq_eq_true] at h_odd + have hk : 2 * ((k - 1) / 2) + 1 = k := by omega + have hc : 12 + 4 * ((k - 1) / 2) + 4 * n = 12 + (4 * ((k - 1) / 2) + 4 * n) := by omega + have h_step := rule_nil_odd ((k - 1) / 2) n + rw [hk, hc] at h_step + exact ValidFrom.of_reaches h_step (ValidFrom.self _ _ _) + · next h_even => + simp only [nat_beq_eq_true] at h_even + split + · next hn0 => + simp only [nat_beq_eq_true] at hn0 + have hk : 2 * (k / 2) = k := by omega + have h_step := rule_nil_even_n0 (k / 2) + rw [hk] at h_step + rw [hn0] + exact ValidFrom.of_reaches h_step (ValidFrom.self _ _ _) + · exact ValidFrom.self _ _ _ + +theorem step_mk10_c1 (j m d : Nat) (hj : 1 ≤ j) (hd : 1 ≤ d) : + Reaches (toCfg (2 * j) (m + 1) (.cons 1 d .nil)) + (toCfg 1 0 (.cons (2 * m) (2 + 2 * j) (.cons (2 * d - 2) 1 .nil))) := by + have h1 := rule_c1_end (2 * j - 1) (m + 1) d + have hk1 : (2 * j - 1) + 1 = 2 * j := by omega + have hk2 : 1 + 2 * j = 2 * j + 1 := by omega + rw [hk1, hk2] at h1 + have h2 := rule_odd_nge1 j m (2 * d - 2) 1 .nil + have hd2 : (2 * d - 2) + 2 = 2 * d := by omega + rw [hd2] at h2 + exact h1.trans h2 + +def mkActive10 (k n c d : Nat) (rest : RBlocks) : HState := + bindNat k fun k' => + bindNat n fun n' => + bindNat c fun c' => + bindNat d fun d' => + match rest with + | .nil => + if Nat.beq c' 0 then + mkActiveRest0 (k' + d') n' + else if Nat.beq c' 1 && Nat.ble 1 d' && Nat.ble 2 k' && Nat.beq (k' % 2) 0 && Nat.ble 1 n' then + if Nat.beq d' 1 then + if Nat.beq n' 1 then + mkActiveRest0 (4 + k') 0 + else + mkActiveRaw1 1 0 (2 * n' - 2) (3 + k') .nil + else + mkActiveRaw2 1 0 (2 * n' - 2) (2 + k') (2 * d' - 2) 1 .nil + else if Nat.beq c' 2 && Nat.beq n' 0 && Nat.beq (k' % 2) 0 && Nat.beq (d' % 2) 1 then + mkActiveRest0 (3 + (k' + d')) 0 + else + mkActiveRaw1 k' n' c' d' .nil + | .cons _ _ _ => + if Nat.beq c' 0 then + HState.active (k' + d') n' rest + else + mkActiveRaw1 k' n' c' d' rest + +theorem mkActive10_sound (k n c d : Nat) (rest : RBlocks) : + ValidFrom k n (.cons c d rest) (mkActive10 k n c d rest) := by + cases rest with + | cons c2 d2 rest2 => + simp only [mkActive10, mkActiveRaw1, bindNat_eq] + split + · next hc0 => + simp only [nat_beq_eq_true] at hc0 + rw [hc0] + exact ValidFrom.of_reaches (rule_c0 k n d (.cons c2 d2 rest2)) (ValidFrom.self _ _ _) + · exact ValidFrom.self _ _ _ + | nil => + simp only [mkActive10, mkActiveRaw1, mkActiveRaw2, bindNat_eq] + split + · next hc0 => + simp only [nat_beq_eq_true] at hc0 + rw [hc0] + exact ValidFrom.of_reaches (rule_c0 k n d .nil) (mkActiveRest0_sound (k + d) n) + · next hnc0 => + split + · next h_c1 => + simp only [Bool.and_eq_true, nat_beq_eq_true, nat_ble_eq_true] at h_c1 + have hc : c = 1 := by omega + have hk : 2 * (k / 2) = k := by omega + have hn : (n - 1) + 1 = n := by omega + have hc_out : 2 * (n - 1) = 2 * n - 2 := by omega + have h_step := step_mk10_c1 (k / 2) (n - 1) d (by omega) (by omega) + rw [hk, hn, hc_out] at h_step + rw [hc] + split + · next hd1 => + simp only [nat_beq_eq_true] at hd1 + have hd_z : 2 * d - 2 = 0 := by omega + have hd_k : 2 + k + 1 = 3 + k := by omega + rw [hd_z, toCfg_cons_zero, hd_k] at h_step + split + · next hn1 => + simp only [nat_beq_eq_true] at hn1 + have hn_z : 2 * n - 2 = 0 := by omega + rw [hn_z] at h_step + have h_c0 := rule_c0 1 0 (3 + k) .nil + have hk4 : 1 + (3 + k) = 4 + k := by omega + rw [hk4] at h_c0 + exact ValidFrom.of_reaches (h_step.trans h_c0) (mkActiveRest0_sound (4 + k) 0) + · exact ValidFrom.of_reaches h_step (ValidFrom.self _ _ _) + · exact ValidFrom.of_reaches h_step (ValidFrom.self _ _ _) + · next h_nc1 => + split + · next h_c2 => + simp only [Bool.and_eq_true, nat_beq_eq_true] at h_c2 + have hc : c = 2 := by omega + have hn : n = 0 := by omega + have hk : 2 * (k / 2) = k := by omega + have hd : 2 * ((d - 1) / 2) + 1 = d := by omega + have h_out : 3 + k + d = 3 + (k + d) := by omega + have h_step := rule_even_n0_c2 (k / 2) ((d - 1) / 2) + rw [hk, hd, h_out] at h_step + rw [hc, hn] + exact ValidFrom.of_reaches h_step (mkActiveRest0_sound (3 + (k + d)) 0) + · exact ValidFrom.self _ _ _ + +def mkActiveRest (k n : Nat) (rest : RBlocks) : HState := + bindNat k fun k' => + bindNat n fun n' => + match rest with + | .nil => mkActiveRest0 k' n' + | .cons c2 d2 rest2 => + if Nat.beq (k' % 2) 0 && Nat.ble 1 n' && Nat.ble 2 c2 then + bindNat (Nat.min n' (c2 / 2)) fun m => + mkActive10 (k' + 2 * m) (n' - m) (c2 - 2 * m) d2 rest2 + else + HState.active k' n' rest + +theorem mkActiveRest_sound (k n : Nat) (rest : RBlocks) : + ValidFrom k n rest (mkActiveRest k n rest) := by + cases rest with + | nil => + simp only [mkActiveRest, bindNat_eq] + exact mkActiveRest0_sound k n + | cons c2 d2 rest2 => + simp only [mkActiveRest, bindNat_eq] + split + · next h_cond => + simp only [Bool.and_eq_true, nat_beq_eq_true, nat_ble_eq_true] at h_cond + have hk : 2 * (k / 2) = k := by omega + have h_step := rule_even_nge1 (Nat.min n (c2 / 2)) (k / 2) (n - Nat.min n (c2 / 2)) (c2 - 2 * Nat.min n (c2 / 2)) d2 rest2 + rw [hk, min_le_left_sub, min_le_right_sub] at h_step + exact ValidFrom.of_reaches h_step (mkActive10_sound _ _ _ d2 rest2) + · exact ValidFrom.self _ _ _ + +def mkActive1 (k n c d : Nat) (rest : RBlocks) : HState := + bindNat k fun k' => + bindNat n fun n' => + bindNat c fun c' => + bindNat d fun d' => + if Nat.beq c' 0 then + mkActiveRest (k' + d') n' rest + else + mkActive10 k' n' c' d' rest + +theorem mkActive1_sound (k n c d : Nat) (rest : RBlocks) : + ValidFrom k n (.cons c d rest) (mkActive1 k n c d rest) := by + unfold mkActive1 + simp only [bindNat_eq] + split + · next hc0 => + simp only [nat_beq_eq_true] at hc0 + rw [hc0] + exact ValidFrom.of_reaches (rule_c0 k n d rest) (mkActiveRest_sound (k + d) n rest) + · exact mkActive10_sound k n c d rest + +def mkActive1Drain (k1 n c1 d2 : Nat) (rest2 : RBlocks) : HState := + bindNat k1 fun k1' => + bindNat n fun n' => + bindNat c1 fun c1' => + if Nat.beq (k1' % 2) 0 && Nat.ble 1 n' && Nat.ble 2 c1' then + bindNat (Nat.min n' (c1' / 2)) fun m => + mkActive1 (k1' + 2 * m) (n' - m) (c1' - 2 * m) d2 rest2 + else + mkActive1 k1' n' c1' d2 rest2 + +theorem mkActive1Drain_sound (k1 n c1 d2 : Nat) (rest2 : RBlocks) : + ValidFrom k1 n (.cons c1 d2 rest2) (mkActive1Drain k1 n c1 d2 rest2) := by + unfold mkActive1Drain + simp only [bindNat_eq] + split + · next h_cond => + simp only [Bool.and_eq_true, nat_beq_eq_true, nat_ble_eq_true] at h_cond + have hk : 2 * (k1 / 2) = k1 := by omega + have h_step := rule_even_nge1 (Nat.min n (c1 / 2)) (k1 / 2) (n - Nat.min n (c1 / 2)) (c1 - 2 * Nat.min n (c1 / 2)) d2 rest2 + rw [hk, min_le_left_sub, min_le_right_sub] at h_step + exact ValidFrom.of_reaches h_step (mkActive1_sound _ _ _ d2 rest2) + · exact mkActive1_sound k1 n c1 d2 rest2 + +def mkActive2 (k n c1 d1 c2 d2 : Nat) (rest : RBlocks) : HState := + bindNat k fun k' => + bindNat n fun n' => + bindNat c1 fun c1' => + bindNat d1 fun d1' => + bindNat c2 fun c2' => + bindNat d2 fun d2' => + if Nat.beq c1' 0 then + mkActive1 (k' + d1') n' c2' d2' rest + else + HState.active k' n' (.cons c1' d1' (.cons c2' d2' rest)) + +theorem mkActive2_sound (k n c1 d1 c2 d2 : Nat) (rest : RBlocks) : + ValidFrom k n (.cons c1 d1 (.cons c2 d2 rest)) (mkActive2 k n c1 d1 c2 d2 rest) := by + unfold mkActive2 + simp only [bindNat_eq] + split + · next hc0 => + have hc : c1 = 0 := Nat.eq_of_beq_eq_true hc0 + rw [hc] + exact ValidFrom.of_reaches (rule_c0 k n d1 (.cons c2 d2 rest)) (mkActive1_sound (k + d1) n c2 d2 rest) + · exact ValidFrom.self _ _ _ + +def pow2_256 : Nat := 115792089237316195423570985008687907853269984665640564039457584007913129639936 +def pow2_128 : Nat := 340282366920938463463374607431768211456 +def pow2_64 : Nat := 18446744073709551616 +def pow2_32 : Nat := 4294967296 +def pow2_16 : Nat := 65536 + +def stepBSearch (K c bit powBit r p : Nat) (cont : Nat → Nat → HState) : HState := + bindNat (bit + r) fun r' => + bindNat (p * powBit) fun p' => + bindBool (Nat.ble (1 + K * (2 * p' - 2)) (c + 5 * r')) fun ok => + bindNat (if ok then r' else r) fun r_next => + bindNat (if ok then p' else p) fun p_next => + cont r_next p_next + +def withR (K c : Nat) (cont : Nat → Nat → HState) : HState := + stepBSearch K c 256 pow2_256 0 1 fun r p => + stepBSearch K c 128 pow2_128 r p fun r p => + stepBSearch K c 64 pow2_64 r p fun r p => + stepBSearch K c 32 pow2_32 r p fun r p => + stepBSearch K c 16 pow2_16 r p fun r p => + stepBSearch K c 8 256 r p fun r p => + stepBSearch K c 4 16 r p fun r p => + stepBSearch K c 2 4 r p fun r p => + stepBSearch K c 1 2 r p cont + +theorem stepBSearch_spec (K c bit powBit r p : Nat) (cont : Nat → Nat → HState) + (P : HState → Prop) + (h_pow : powBit = 2 ^ bit) + (h_p : p = 2 ^ r) + (h_cont : ∀ r' p', p' = 2 ^ r' → P (cont r' p')) : + P (stepBSearch K c bit powBit r p cont) := by + unfold stepBSearch + simp only [bindNat_eq, bindBool_eq] + split + · apply h_cont + rw [h_p, h_pow, Nat.add_comm bit r, Nat.pow_add] + · exact h_cont r p h_p + +theorem withR_spec (K c : Nat) (cont : Nat → Nat → HState) (P : HState → Prop) + (h_cont : ∀ r p, p = 2 ^ r → P (cont r p)) : + P (withR K c cont) := by + unfold withR + refine stepBSearch_spec K c 256 pow2_256 0 1 _ P rfl rfl fun r p hp => ?_ + refine stepBSearch_spec K c 128 pow2_128 r p _ P rfl hp fun r p hp => ?_ + refine stepBSearch_spec K c 64 pow2_64 r p _ P rfl hp fun r p hp => ?_ + refine stepBSearch_spec K c 32 pow2_32 r p _ P rfl hp fun r p hp => ?_ + refine stepBSearch_spec K c 16 pow2_16 r p _ P rfl hp fun r p hp => ?_ + refine stepBSearch_spec K c 8 256 r p _ P rfl hp fun r p hp => ?_ + refine stepBSearch_spec K c 4 16 r p _ P rfl hp fun r p hp => ?_ + refine stepBSearch_spec K c 2 4 r p _ P rfl hp fun r p hp => ?_ + exact stepBSearch_spec K c 1 2 r p cont P rfl hp h_cont + +def stepSSearch (D limit bit powBit q pq : Nat) (cont : Nat → Nat → HState) : HState := + bindNat (bit + q) fun q' => + bindNat (pq * powBit) fun pq' => + bindBool (Nat.ble (D * pq') limit) fun ok => + bindNat (if ok then q' else q) fun q_next => + bindNat (if ok then pq' else pq) fun pq_next => + cont q_next pq_next + +def withS (D limit : Nat) (cont : Nat → Nat → HState) : HState := + stepSSearch D limit 256 pow2_256 0 1 fun q pq => + stepSSearch D limit 128 pow2_128 q pq fun q pq => + stepSSearch D limit 64 pow2_64 q pq fun q pq => + stepSSearch D limit 32 pow2_32 q pq fun q pq => + stepSSearch D limit 16 pow2_16 q pq fun q pq => + stepSSearch D limit 8 256 q pq fun q pq => + stepSSearch D limit 4 16 q pq fun q pq => + stepSSearch D limit 2 4 q pq fun q pq => + stepSSearch D limit 1 2 q pq fun q pq => + bindNat (1 + q) fun s_era => + bindNat (2 * pq) fun ps => + cont s_era ps + +theorem stepSSearch_spec (D limit bit powBit q pq : Nat) (cont : Nat → Nat → HState) + (P : HState → Prop) + (h_pow : powBit = 2 ^ bit) + (h_pq : pq = 2 ^ q) + (h_le : D * pq ≤ limit) + (h_cont : ∀ q' pq', pq' = 2 ^ q' → D * pq' ≤ limit → P (cont q' pq')) : + P (stepSSearch D limit bit powBit q pq cont) := by + unfold stepSSearch + simp only [bindNat_eq, bindBool_eq] + split + · next h_ok => + apply h_cont + · rw [h_pq, h_pow, Nat.add_comm bit q, Nat.pow_add] + · exact Nat.le_of_ble_eq_true h_ok + · exact h_cont q pq h_pq h_le + +theorem withS_spec (D limit : Nat) (cont : Nat → Nat → HState) (P : HState → Prop) + (h_D : D ≤ limit) + (h_cont : ∀ s_era ps, ps = 2 ^ s_era → D * ps ≤ 2 * limit → P (cont s_era ps)) : + P (withS D limit cont) := by + unfold withS + have h0 : D * 1 ≤ limit := by omega + refine stepSSearch_spec D limit 256 pow2_256 0 1 _ P rfl rfl h0 fun q pq hpq hle => ?_ + refine stepSSearch_spec D limit 128 pow2_128 q pq _ P rfl hpq hle fun q pq hpq hle => ?_ + refine stepSSearch_spec D limit 64 pow2_64 q pq _ P rfl hpq hle fun q pq hpq hle => ?_ + refine stepSSearch_spec D limit 32 pow2_32 q pq _ P rfl hpq hle fun q pq hpq hle => ?_ + refine stepSSearch_spec D limit 16 pow2_16 q pq _ P rfl hpq hle fun q pq hpq hle => ?_ + refine stepSSearch_spec D limit 8 256 q pq _ P rfl hpq hle fun q pq hpq hle => ?_ + refine stepSSearch_spec D limit 4 16 q pq _ P rfl hpq hle fun q pq hpq hle => ?_ + refine stepSSearch_spec D limit 2 4 q pq _ P rfl hpq hle fun q pq hpq hle => ?_ + refine stepSSearch_spec D limit 1 2 q pq _ P rfl hpq hle fun q pq hpq hle => ?_ + simp only [bindNat_eq] + apply h_cont + · rw [hpq, Nat.add_comm 1 q, Nat.pow_succ'] + · rw [Nat.mul_left_comm D 2 pq]; omega + +def stepEvenN0Cge6 (k_even c_in d : Nat) (rest : RBlocks) : HState := + bindNat (5 + k_even) fun n_mid => + bindNat (c_in - 5) fun c_mid => + bindNat (Nat.min n_mid (c_mid / 2)) fun m => + mkActive1 (2 * m) (n_mid - m) (c_mid - 2 * m) d rest + +theorem stepEvenN0Cge6_sound (k_even c_in d : Nat) (rest : RBlocks) + (hk : k_even % 2 = 0) (hc : 6 ≤ c_in) : + ValidFrom k_even 0 (.cons c_in d rest) (stepEvenN0Cge6 k_even c_in d rest) := by + unfold stepEvenN0Cge6 + simp only [bindNat_eq] + have hk_eq : 2 * (k_even / 2) = k_even := by omega + have hc_eq : (c_in - 6) + 6 = c_in := by omega + have hc_5 : (c_in - 6) + 1 = c_in - 5 := by omega + have h1 := rule_even_n0_cge6 (k_even / 2) (c_in - 6) d rest + rw [hk_eq, hc_eq, hc_5] at h1 + have h2 := rule_even_nge1 (Nat.min (5 + k_even) ((c_in - 5) / 2)) 0 + ((5 + k_even) - Nat.min (5 + k_even) ((c_in - 5) / 2)) + ((c_in - 5) - 2 * Nat.min (5 + k_even) ((c_in - 5) / 2)) d rest + rw [min_le_left_sub, min_le_right_sub, Nat.mul_zero, Nat.zero_add] at h2 + exact ValidFrom.of_reaches (h1.trans h2) (mkActive1_sound _ _ _ d rest) + +def stepOddWithRDefault (c0 r p d : Nat) (rest : RBlocks) : HState := + bindNat ((c0 + 5 * r) - 16 * (2 * p - 2)) fun c_new => + bindNat (16 * p - 10) fun k_new => + if Nat.ble 6 c_new then + stepEvenN0Cge6 k_new c_new d rest + else + mkActive1 k_new 0 c_new d rest + +theorem stepOddWithRDefault_sound (c c0 r p d : Nat) (rest : RBlocks) + (hc : c0 + 7 = c) (hp : p = 2 ^ r) (hr : 1 ≤ r) + (h_le : 1 + 16 * (2 * p - 2) ≤ c0 + 5 * r) : + ValidFrom 1 0 (.cons c d rest) (stepOddWithRDefault c0 r p d rest) := by + unfold stepOddWithRDefault + simp only [bindNat_eq] + let c_new := (c0 + 5 * r) - 16 * (2 * p - 2) + let k_new := 16 * p - 10 + have h_pos : 2 ≤ p := by + have := Nat.pow_le_pow_right (by decide : 1 ≤ 2) hr + omega + have h1 : Reaches (toCfg 1 0 (.cons c d rest)) (toCfg 6 0 (.cons c0 d rest)) := by + rw [← hc] + exact step_k1_to_k6 c0 d rest + have h2 := step_withR_iter r 3 c0 c_new d rest (by omega) (by rw [← hp]; omega) + have hk_eq : 2 * ((3 + 5) * 2 ^ r - 5) = k_new := by + change 2 * ((3 + 5) * 2 ^ r - 5) = 16 * p - 10 + rw [← hp]; omega + rw [hk_eq] at h2 + have h12 : Reaches (toCfg 1 0 (.cons c d rest)) (toCfg k_new 0 (.cons c_new d rest)) := + h1.trans h2 + split + · next hc6 => + have hc_ge : 6 ≤ c_new := Nat.le_of_ble_eq_true hc6 + exact ValidFrom.of_reaches h12 (stepEvenN0Cge6_sound k_new c_new d rest (by omega) hc_ge) + · exact ValidFrom.of_reaches h12 (mkActive1_sound k_new 0 c_new d rest) + +theorem rule_c1_small_c2 (k n r' m' d2' : Nat) : + Reaches (toCfg (k + 1) n (.cons 1 ((m' + 1) + (r' + 1)) (.cons (2 * (m' + 1)) (d2' + 1) .nil))) + (toCfg (1 + (k + 1)) n (.cons (2 * r') (2 + 2 * (m' + 1)) (.cons (2 * d2') 1 .nil))) := by + have h := step_c1_small_c2 k n r' m' d2' + have hk : k + 2 = 1 + (k + 1) := by omega + rw [hk] at h + exact h + +def stepHC1 (k n d : Nat) (rest : RBlocks) : HState := + if Nat.ble 1 k && Nat.ble 1 d then + match rest with + | .nil => + mkActiveRaw1 (1 + k) n (2 * d) 1 .nil + | .cons c2 d2 rest2 => + if Nat.ble (2 * d) (1 + c2) then + mkActive1Drain (k + 2 * d) n ((1 + c2) - 2 * d) d2 rest2 + else + match rest2 with + | .nil => + if Nat.ble 2 c2 && Nat.beq (c2 % 2) 0 && Nat.ble 1 d2 then + bindNat (c2 / 2) fun m => + bindNat (d - m) fun r => + if Nat.beq d2 1 then + mkActive1 (1 + k) n (2 * r - 2) (3 + 2 * m) .nil + else + mkActive2 (1 + k) n (2 * r - 2) (2 + 2 * m) (2 * d2 - 2) 1 .nil + else .active k n (.cons 1 d (.cons c2 d2 .nil)) + | .cons _ _ _ => .active k n (.cons 1 d (.cons c2 d2 rest2)) + else .active k n (.cons 1 d rest) + +theorem stepHC1_sound (k n d : Nat) (rest : RBlocks) : + ValidFrom k n (.cons 1 d rest) (stepHC1 k n d rest) := by + unfold stepHC1 + split + · next hkd => + simp only [Bool.and_eq_true, nat_ble_eq_true] at hkd + cases rest with + | nil => + simp only [mkActiveRaw1, bindNat_eq] + have hk : (k - 1) + 1 = k := by omega + have h_step := rule_c1_end (k - 1) n d + rw [hk] at h_step + exact ValidFrom.of_reaches h_step (ValidFrom.self _ _ _) + | cons c2 d2 rest2 => + dsimp only [] + split + · next h_large => + simp only [nat_ble_eq_true] at h_large + have hd : (d - 1) + 1 = d := by omega + have hc2 : 2 * d + ((1 + c2) - 2 * d) - 1 = c2 := by omega + have h_step := rule_c1_large_c2 k n (d - 1) ((1 + c2) - 2 * d) d2 rest2 + rw [hd, hc2] at h_step + exact ValidFrom.of_reaches h_step (mkActive1Drain_sound (k + 2 * d) n ((1 + c2) - 2 * d) d2 rest2) + · next h_small => + simp only [nat_ble_eq_true] at h_small + cases rest2 with + | cons _ _ _ => + dsimp only [] + exact ValidFrom.self _ _ _ + | nil => + dsimp only [] + split + · next h_cond => + simp only [Bool.and_eq_true, nat_ble_eq_true, nat_beq_eq_true] at h_cond + simp only [bindNat_eq] + let m := c2 / 2 + let r := d - m + have hk : (k - 1) + 1 = k := by omega + have hm : 2 * ((m - 1) + 1) = c2 := by omega + have hd_eq : ((m - 1) + 1) + ((r - 1) + 1) = d := by omega + have hd2_eq : (d2 - 1) + 1 = d2 := by omega + have hr_out : 2 * (r - 1) = 2 * r - 2 := by omega + have hm_out : 2 + 2 * ((m - 1) + 1) = 2 + 2 * m := by omega + have hd2_out : 2 * (d2 - 1) = 2 * d2 - 2 := by omega + have h_step := rule_c1_small_c2 (k - 1) n (r - 1) (m - 1) (d2 - 1) + rw [hk, hm_out, hm, hd_eq, hd2_eq, hr_out, hd2_out] at h_step + split + · next hd2_1 => + simp only [nat_beq_eq_true] at hd2_1 + have hd2_z : 2 * d2 - 2 = 0 := by omega + have hm3 : 2 + 2 * m + 1 = 3 + 2 * m := by omega + rw [hd2_z, toCfg_cons_zero, hm3] at h_step + exact ValidFrom.of_reaches h_step (mkActive1_sound (1 + k) n (2 * r - 2) (3 + 2 * m) .nil) + · exact ValidFrom.of_reaches h_step (mkActive2_sound (1 + k) n (2 * r - 2) (2 + 2 * m) (2 * d2 - 2) 1 .nil) + · exact ValidFrom.self _ _ _ + · exact ValidFrom.self _ _ _ + +def stepHEvenSmall (k c d : Nat) (rest : RBlocks) : HState := + bindNat (k / 2) fun j => + if Nat.beq c 2 then + match rest with + | .nil => + if Nat.beq (d % 2) 1 then + mkActiveRest0 (3 + (2 * j + d)) 0 + else .active k 0 (.cons c d .nil) + | .cons c2 d2 rest2 => .active k 0 (.cons c d (.cons c2 d2 rest2)) + else if Nat.beq c 3 then + match rest with + | .nil => .active k 0 (.cons c d .nil) + | .cons c2 d2 .nil => + if Nat.ble 2 c2 && Nat.ble (4 + c2) (2 * d) && Nat.beq (c2 % 2) 0 && Nat.beq d2 1 then + .halted + else .active k 0 (.cons c d (.cons c2 d2 .nil)) + | .cons c2 d2 (.cons c3 d3 rest3) => .active k 0 (.cons c d (.cons c2 d2 (.cons c3 d3 rest3))) + else if Nat.beq c 4 then + mkActiveRest (3 + (2 * j + d)) 0 rest + else if Nat.ble 6 c then + stepEvenN0Cge6 k c d rest + else .active k 0 (.cons c d rest) + +theorem stepHEvenSmall_sound (k c d : Nat) (rest : RBlocks) (hk_mod : k % 2 = 0) : + ValidFrom k 0 (.cons c d rest) (stepHEvenSmall k c d rest) := by + unfold stepHEvenSmall + simp only [bindNat_eq] + split + · next hc2 => + simp only [nat_beq_eq_true] at hc2 + cases rest with + | cons _ _ _ => + dsimp only [] + exact ValidFrom.self _ _ _ + | nil => + dsimp only [] + split + · next hd_odd => + simp only [nat_beq_eq_true] at hd_odd + have hk_eq : 2 * (k / 2) = k := by omega + have hd_eq : 2 * ((d - 1) / 2) + 1 = d := by omega + have h_out : 3 + k + d = 3 + (2 * (k / 2) + d) := by omega + have h_step := rule_even_n0_c2 (k / 2) ((d - 1) / 2) + rw [hk_eq, hd_eq, h_out] at h_step + rw [hc2] + exact ValidFrom.of_reaches h_step (mkActiveRest0_sound (3 + (2 * (k / 2) + d)) 0) + · exact ValidFrom.self _ _ _ + · next hnc2 => + split + · next hc3 => + simp only [nat_beq_eq_true] at hc3 + cases rest with + | nil => + dsimp only [] + exact ValidFrom.self _ _ _ + | cons c2 d2 rest2 => + cases rest2 with + | cons _ _ _ => + dsimp only [] + exact ValidFrom.self _ _ _ + | nil => + dsimp only [] + split + · next h_halt => + simp only [Bool.and_eq_true, nat_ble_eq_true, nat_beq_eq_true] at h_halt + have hk_eq : 2 * (k / 2) = k := by omega + have hm_eq : 2 * ((c2 / 2 - 1) + 1) = c2 := by omega + have hd_eq : ((c2 / 2 - 1) + 1) + ((d - c2 / 2 - 2) + 2) = d := by omega + have hd2_eq : d2 = 1 := h_halt.2 + have h_step := rule_halt_c3 (k / 2) (d - c2 / 2 - 2) (c2 / 2 - 1) + rw [hk_eq, hm_eq, hd_eq, ← hc3, ← hd2_eq] at h_step + exact ValidFrom.halted h_step + · exact ValidFrom.self _ _ _ + · next hnc3 => + split + · next hc4 => + simp only [nat_beq_eq_true] at hc4 + have hk_eq : 2 * (k / 2) = k := by omega + have h_out : 3 + k + d = 3 + (2 * (k / 2) + d) := by omega + have h_step := rule_even_n0_c4 (k / 2) d rest + rw [hk_eq, h_out] at h_step + rw [hc4] + exact ValidFrom.of_reaches h_step (mkActiveRest_sound (3 + (2 * (k / 2) + d)) 0 rest) + · next hnc4 => + split + · next hc6 => + simp only [nat_ble_eq_true] at hc6 + exact stepEvenN0Cge6_sound k c d rest hk_mod hc6 + · exact ValidFrom.self _ _ _ + +def stepHEven (k n c d : Nat) (rest : RBlocks) : HState := + if Nat.beq n 0 then + if Nat.ble (16 + 2 * k) c then + bindNat (10 + k) fun K => + withR K c fun r p => + if Nat.ble 1 r && Nat.ble (1 + K * (2 * p - 2)) (c + 5 * r) then + bindNat ((c + 5 * r) - K * (2 * p - 2)) fun c_new => + bindNat (K * p - 10) fun k_new => + if Nat.ble 6 c_new then + stepEvenN0Cge6 k_new c_new d rest + else + mkActive1 k_new 0 c_new d rest + else .active k 0 (.cons c d rest) + else + stepHEvenSmall k c d rest + else + bindNat (Nat.min n (c / 2)) fun m => + mkActive1 (k + 2 * m) (n - m) (c - 2 * m) d rest + +theorem stepHEven_sound (k n c d : Nat) (rest : RBlocks) (hk_mod : k % 2 = 0) : + ValidFrom k n (.cons c d rest) (stepHEven k n c d rest) := by + unfold stepHEven + split + · next hn0 => + simp only [nat_beq_eq_true] at hn0 + rw [hn0] + split + · next h_withR => + simp only [bindNat_eq] + refine withR_spec (10 + k) c _ (ValidFrom k 0 (.cons c d rest)) fun r p hp => ?_ + split + · next h_ok => + simp only [Bool.and_eq_true, nat_ble_eq_true] at h_ok + let c_new := (c + 5 * r) - (10 + k) * (2 * p - 2) + let k_new := (10 + k) * p - 10 + have h_pos : 2 ≤ p := by + have := Nat.pow_le_pow_right (by decide : 1 ≤ 2) h_ok.1 + omega + have hk_eq : 2 * (k / 2) = k := by omega + have hK : 2 * (k / 2 + 5) = 10 + k := by omega + have h_mul1 : 4 * (k / 2 + 5) * (p - 1) = (10 + k) * (2 * p - 2) := by + have h1 : 4 * (k / 2 + 5) = (10 + k) * 2 := by omega + have h2 : 2 * (p - 1) = 2 * p - 2 := by omega + rw [h1, Nat.mul_assoc, h2] + have h_mul2 : 2 * ((k / 2 + 5) * p) = (10 + k) * p := by + rw [← Nat.mul_assoc, hK] + have h_step := step_withR_iter r (k / 2) c c_new d rest (by omega) (by rw [← hp, h_mul1]; omega) + have hk_out : 2 * ((k / 2 + 5) * 2 ^ r - 5) = k_new := by + change 2 * ((k / 2 + 5) * 2 ^ r - 5) = (10 + k) * p - 10 + rw [← hp]; omega + rw [hk_eq, hk_out] at h_step + split + · next hc6 => + simp only [nat_ble_eq_true] at hc6 + exact ValidFrom.of_reaches h_step (stepEvenN0Cge6_sound k_new c_new d rest (by omega) hc6) + · exact ValidFrom.of_reaches h_step (mkActive1_sound k_new 0 c_new d rest) + · exact ValidFrom.self _ _ _ + · exact stepHEvenSmall_sound k c d rest hk_mod + · next hn_pos => + simp only [nat_beq_eq_true] at hn_pos + simp only [bindNat_eq] + have hk_eq : 2 * (k / 2) = k := by omega + have h_step := rule_even_nge1 (Nat.min n (c / 2)) (k / 2) (n - Nat.min n (c / 2)) (c - 2 * Nat.min n (c / 2)) d rest + rw [hk_eq, min_le_left_sub, min_le_right_sub] at h_step + exact ValidFrom.of_reaches h_step (mkActive1_sound _ _ _ d rest) + +def stepHOddK1 (c d : Nat) (rest : RBlocks) : HState := + bindNat (c - 7) fun c0 => + if Nat.ble 28 c0 then + withR 16 c0 fun r p => + if Nat.ble 1 r && Nat.ble (1 + 16 * (2 * p - 2)) (c0 + 5 * r) then + match rest with + | .nil => + if Nat.beq d 1 && Nat.ble 3 r && Nat.beq (r % 2) 1 && Nat.beq (c % 2) 0 && + Nat.ble (8 + 32 * p) (25 + (c + 5 * r)) && Nat.ble (66 + (c + 5 * r)) (64 * p) then + bindNat (64 * p - (31 + (c + 5 * r))) fun c_prime => + bindNat (c_prime - 7) fun c_prime0 => + withR 16 c_prime0 fun r2 p2 => + if Nat.ble 2 r2 && Nat.beq (r2 % 2) 0 && + Nat.ble (1 + 16 * (2 * p2 - 2)) (c_prime0 + 5 * r2) && + Nat.ble (30 + (c_prime + 5 * r2)) (64 * p2) && + Nat.ble (26 + 5 * r2) (32 * p2) && + Nat.ble (1 + 64 * p) (34 + (c + (64 * p2 + 10 * r))) then + bindNat ((34 + (c + (64 * p2 + 10 * r))) - 64 * p) fun D => + if Nat.ble (32 * p2) (18 + (c_prime + (D + 5 * r2))) then + bindNat ((18 + (c_prime + (D + 5 * r2))) - 32 * p2) fun limit => + if Nat.ble D limit then + withS D limit fun _ ps => + mkActiveRaw1 1 0 (c + D * (ps - 1)) 1 .nil + else + stepOddWithRDefault c0 r p d .nil + else + stepOddWithRDefault c0 r p d .nil + else + stepOddWithRDefault c0 r p d .nil + else + stepOddWithRDefault c0 r p d .nil + | .cons c2 d2 rest2 => + stepOddWithRDefault c0 r p d (.cons c2 d2 rest2) + else .active 1 0 (.cons c d rest) + else if Nat.ble 6 c0 then + stepEvenN0Cge6 6 c0 d rest + else + mkActive1 6 0 c0 d rest + +theorem stepHOddK1_sound (c d : Nat) (rest : RBlocks) (hc_ge : 7 ≤ c) : + ValidFrom 1 0 (.cons c d rest) (stepHOddK1 c d rest) := by + unfold stepHOddK1 + simp only [bindNat_eq] + have hc0_eq : (c - 7) + 7 = c := by omega + split + · next hc0_28 => + refine withR_spec 16 (c - 7) _ (ValidFrom 1 0 (.cons c d rest)) fun r p hp => ?_ + split + · next h_r_ok => + simp only [Bool.and_eq_true, nat_ble_eq_true] at h_r_ok + cases rest with + | cons c2 d2 rest2 => + dsimp only [] + exact stepOddWithRDefault_sound c (c - 7) r p d (.cons c2 d2 rest2) hc0_eq hp h_r_ok.1 h_r_ok.2 + | nil => + dsimp only [] + split + · next h_era1 => + simp only [Bool.and_eq_true, nat_beq_eq_true, nat_ble_eq_true] at h_era1 + let c_prime := 64 * p - (31 + (c + 5 * r)) + refine withR_spec 16 (c_prime - 7) _ (ValidFrom 1 0 (.cons c d .nil)) fun r2 p2 hp2 => ?_ + split + · next h_era2 => + simp only [Bool.and_eq_true, nat_beq_eq_true, nat_ble_eq_true] at h_era2 + let D := (34 + (c + (64 * p2 + 10 * r))) - 64 * p + split + · next h_era3 => + simp only [nat_ble_eq_true] at h_era3 + let limit := (18 + (c_prime + (D + 5 * r2))) - 32 * p2 + split + · next h_D_lim => + simp only [nat_ble_eq_true] at h_D_lim + refine withS_spec D limit _ (ValidFrom 1 0 (.cons c d .nil)) h_D_lim fun s_era ps hps h_ps_le => ?_ + unfold mkActiveRaw1; simp only [bindNat_eq] + let jc := c / 2 + let jr := (r - 1) / 2 + let jr2 := r2 / 2 + let D_half := D / 2 + have hjc : jc = c / 2 := rfl + have hjr : jr = (r - 1) / 2 := rfl + have hjr2 : jr2 = r2 / 2 := rfl + have hc_prime_def : c_prime = 64 * p - (31 + (c + 5 * r)) := rfl + have hD_def : D = (34 + (c + (64 * p2 + 10 * r))) - 64 * p := rfl + have hlim_def : limit = (18 + (c_prime + (D + 5 * r2))) - 32 * p2 := rfl + have hD_half_def : D_half = D / 2 := rfl + have hd1 : d = 1 := h_era1.1.1.1.1.1 + have hc_even : 2 * jc = c := by omega + have hr_odd : 2 * jr + 1 = r := by omega + have hr2_even : 2 * jr2 = r2 := by omega + have hp_jr : p = 2 ^ (2 * jr + 1) := by rw [hr_odd, hp] + have hp2_jr2 : p2 = 2 ^ (2 * jr2) := by rw [hr2_even, hp2] + have h_D_even : 2 * D_half = 44 + 2 * jc + 64 * p2 + 20 * jr - 64 * p := by omega + have h_2D : 2 * D_half = D := by omega + have h_step := step_outer_era_iter s_era jc jr p jr2 p2 D_half limit + hp_jr hp2_jr2 (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) + h_D_even (by omega) (by omega) (by omega) + (by + rw [h_2D, ← hps] + exact h_ps_le) + have h_out : c + 2 * D_half * (2 ^ s_era - 1) = c + D * (ps - 1) := by + rw [h_2D, ← hps] + rw [hc_even, h_out] at h_step + rw [hd1] + exact ValidFrom.of_reaches h_step (ValidFrom.self _ _ _) + · exact stepOddWithRDefault_sound c (c - 7) r p d .nil hc0_eq hp h_r_ok.1 h_r_ok.2 + · exact stepOddWithRDefault_sound c (c - 7) r p d .nil hc0_eq hp h_r_ok.1 h_r_ok.2 + · exact stepOddWithRDefault_sound c (c - 7) r p d .nil hc0_eq hp h_r_ok.1 h_r_ok.2 + · exact stepOddWithRDefault_sound c (c - 7) r p d .nil hc0_eq hp h_r_ok.1 h_r_ok.2 + · exact ValidFrom.self _ _ _ + · next hc0_lt28 => + split + · next hc0_6 => + simp only [nat_ble_eq_true] at hc0_6 + have h1 : Reaches (toCfg 1 0 (.cons c d rest)) (toCfg 6 0 (.cons (c - 7) d rest)) := by + rw [← hc0_eq] + exact step_k1_to_k6 (c - 7) d rest + exact ValidFrom.of_reaches h1 (stepEvenN0Cge6_sound 6 (c - 7) d rest rfl hc0_6) + · next hc0_lt6 => + have h1 : Reaches (toCfg 1 0 (.cons c d rest)) (toCfg 6 0 (.cons (c - 7) d rest)) := by + rw [← hc0_eq] + exact step_k1_to_k6 (c - 7) d rest + exact ValidFrom.of_reaches h1 (mkActive1_sound 6 0 (c - 7) d rest) + +def stepHOdd (k n c d : Nat) (rest : RBlocks) : HState := + bindNat ((k - 1) / 2) fun j => + if Nat.beq n 0 then + if Nat.beq k 1 && Nat.ble 7 c then + stepHOddK1 c d rest + else if Nat.beq c 2 then .active k 0 (.cons c d rest) + else if Nat.ble 2 c then + mkActive1 0 (3 + 2 * j) (c - 1) d rest + else .active k 0 (.cons c d rest) + else + if Nat.beq c 2 then + mkActive1 1 0 (2 * n - 2) (2 + (2 * j + d)) rest + else if Nat.ble 3 c then + mkActive2 1 0 (2 * n - 2) (2 + 2 * j) (c - 2) d rest + else .active k n (.cons c d rest) + +theorem stepHOdd_sound (k n c d : Nat) (rest : RBlocks) (hk_odd : ¬ k % 2 = 0) : + ValidFrom k n (.cons c d rest) (stepHOdd k n c d rest) := by + unfold stepHOdd + simp only [bindNat_eq] + have hk_eq : 2 * ((k - 1) / 2) + 1 = k := by omega + split + · next hn0 => + simp only [nat_beq_eq_true] at hn0 + rw [hn0] + split + · next hk1_c7 => + simp only [Bool.and_eq_true, nat_beq_eq_true, nat_ble_eq_true] at hk1_c7 + rw [hk1_c7.1] + exact stepHOddK1_sound c d rest hk1_c7.2 + · next h_not_k1_c7 => + split + · exact ValidFrom.self _ _ _ + · split + · next hc2_ge => + simp only [nat_ble_eq_true] at hc2_ge + have hc_in : (c - 2) + 2 = c := by omega + have hc_out : (c - 2) + 1 = c - 1 := by omega + have h_step := rule_odd_n0 ((k - 1) / 2) (c - 2) d rest + rw [hk_eq, hc_in, hc_out] at h_step + exact ValidFrom.of_reaches h_step (mkActive1_sound 0 (3 + 2 * ((k - 1) / 2)) (c - 1) d rest) + · exact ValidFrom.self _ _ _ + · next hn_pos => + simp only [nat_beq_eq_true] at hn_pos + have hn_eq : (n - 1) + 1 = n := by omega + have hn_out : 2 * (n - 1) = 2 * n - 2 := by omega + split + · next hc2 => + simp only [nat_beq_eq_true] at hc2 + have h_step := rule_odd_nge1 ((k - 1) / 2) (n - 1) 0 d rest + have hd_out : 2 + 2 * ((k - 1) / 2) + d = 2 + (2 * ((k - 1) / 2) + d) := by omega + rw [hk_eq, hn_eq, hn_out, toCfg_cons_zero, hd_out] at h_step + rw [hc2] + exact ValidFrom.of_reaches h_step (mkActive1_sound 1 0 (2 * n - 2) (2 + (2 * ((k - 1) / 2) + d)) rest) + · next hnc2 => + split + · next hc3 => + simp only [nat_ble_eq_true] at hc3 + have hc_eq : (c - 2) + 2 = c := by omega + have h_step := rule_odd_nge1 ((k - 1) / 2) (n - 1) (c - 2) d rest + rw [hk_eq, hn_eq, hn_out, hc_eq] at h_step + exact ValidFrom.of_reaches h_step (mkActive2_sound 1 0 (2 * n - 2) (2 + 2 * ((k - 1) / 2)) (c - 2) d rest) + · exact ValidFrom.self _ _ _ + +def stepH (s : HState) : HState := + match s with + | .halted => .halted + | .active k n blks => + match blks with + | .nil => mkActiveRest0 k n + | .cons c d rest => + if Nat.beq c 0 then + mkActiveRest (k + d) n rest + else if Nat.beq c 1 then + stepHC1 k n d rest + else if Nat.beq (k % 2) 0 then + stepHEven k n c d rest + else + stepHOdd k n c d rest + +theorem stepH_sound_aux (k n : Nat) (blks : RBlocks) : + ValidFrom k n blks (stepH (.active k n blks)) := by + cases blks with + | nil => + dsimp only [stepH] + exact mkActiveRest0_sound k n + | cons c d rest => + dsimp only [stepH] + split + · next hc0 => + simp only [nat_beq_eq_true] at hc0 + rw [hc0] + exact ValidFrom.of_reaches (rule_c0 k n d rest) (mkActiveRest_sound (k + d) n rest) + · next hnc0 => + split + · next hc1 => + simp only [nat_beq_eq_true] at hc1 + rw [hc1] + exact stepHC1_sound k n d rest + · next hnc1 => + split + · next hk_even => + simp only [nat_beq_eq_true] at hk_even + exact stepHEven_sound k n c d rest hk_even + · next hk_odd => + simp only [nat_beq_eq_true] at hk_odd + exact stepHOdd_sound k n c d rest hk_odd + +theorem stepH_sound (s : HState) : ValidState (stepH s) → ValidState s := by + cases s with + | halted => exact id + | active k n blks => exact ValidState.of_validFrom (stepH_sound_aux k n blks) + +def runPow : Nat → HState → HState + | 0, s => stepH s + | k + 1, s => bindState (runPow k s) (runPow k) + +theorem bindState_sound (s : HState) (f : HState → HState) + (hf : ∀ x, ValidState (f x) → ValidState x) : + ValidState (bindState s f) → ValidState s := by + cases s with + | halted => exact id + | active k n blks => exact hf (.active k n blks) + +theorem runPow_sound (k : Nat) : ∀ s, ValidState (runPow k s) → ValidState s := by + induction k with + | zero => exact stepH_sound + | succ k ih => + intro s hs + exact ih s (bindState_sound (runPow k s) (runPow k) ih hs) + +def s0 : HState := HState.active 1 0 (RBlocks.cons 16 1 RBlocks.nil) + +theorem reach_init_s0 : Reaches (init []) (toCfg 1 0 (.cons 16 1 .nil)) := by + have h1 : Reaches (init []) (toCfg 0 0 .nil) := by + unfold toCfg; rw [evalRBlocks_nil, L11_zero, L01_zero]; exec_tm 12 + refine h1.trans ?_ + refine (rule_nil_even_n0 0).trans ?_ + refine (show Reaches (toCfg (2 * 0 + 1) 0 (.cons (2 + 2) 1 .nil)) _ from + rule_odd_n0 0 2 1 .nil).trans ?_ + refine (show Reaches (toCfg (2 * 0) (1 + 2) (.cons (2 * 1 + 1) 1 .nil)) _ from + rule_even_nge1 1 0 2 1 1 .nil).trans ?_ + have h5 := step_mk10_c1 1 1 1 (by decide) (by decide) + rw [show 2 * 1 - 2 = 0 from rfl, toCfg_cons_zero] at h5 + refine (show Reaches (toCfg 2 2 (.cons 1 1 .nil)) _ from h5).trans ?_ + refine (show Reaches (toCfg (2 * 0 + 1) 0 (.cons (0 + 2) 5 .nil)) _ from + rule_odd_n0 0 0 5 .nil).trans ?_ + have h7 : Reaches (toCfg 0 3 (.cons 1 5 .nil)) (cfg A (L11 5 (L11 3 L0)) (b1 >> lb0)) := by + unfold toCfg + rw [evalRBlocks_cons, evalRBlocks_nil, R1_succ, R1_zero, L01_zero] + exact shift_A_1_01 5 (L11 3 L0) default + refine h7.trans ?_ + rw [← L11_add] + have h8 : Reaches (cfg A (L11 8 L0) (b1 >> lb0)) (toCfg (2 * 0) (7 + 2) .nil) := by + unfold toCfg + rw [evalRBlocks_nil, L01_zero] + exec_tm 2 + refine h8.trans ?_ + exact rule_nil_even_nge2 0 7 + +theorem holdout_halt_of_runPow (h_halt : runPow 13 s0 = HState.halted) : IsHalt target_tm := by + have h_valid : ValidState (runPow 13 s0) := by + rw [h_halt]; exact ValidState.halted + have h_s0_valid : ValidState s0 := + runPow_sound 13 s0 h_valid + have h_s0 : ReachHalt (toCfg 1 0 (.cons 16 1 .nil)) := by + cases h_s0_valid with | active h => exact h + exact ReachHalt.to_isHalt (reach_init_s0 h_s0) + +set_option maxHeartbeats 10000000 in +theorem reaches_halt : runPow 13 s0 = HState.halted := by decide +kernel + +public section + +theorem is_halt : IsHalt target := holdout_halt_of_runPow reaches_halt + +end + +end BusyBeaver.M_1RB1RF_1LC0RA_HHH0LD_1RE1LD_0LF0LB_1RA1LE diff --git a/BusyBeaver/BB6/Halt/M_1RBHHH_1LC1RE_1LA0LD_0RE1LC_1LC1RF_1RB0RD.lean b/BusyBeaver/BB6/Halt/M_1RBHHH_1LC1RE_1LA0LD_0RE1LC_1LC1RF_1RB0RD.lean new file mode 100644 index 00000000..8b74c0f1 --- /dev/null +++ b/BusyBeaver/BB6/Halt/M_1RBHHH_1LC1RE_1LA0LD_0RE1LC_1LC1RF_1RB0RD.lean @@ -0,0 +1,80 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.HaltShared + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RBHHH_1LC1RE_1LA0LD_0RE1LC_1LC1RF_1RB0RD + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1LC1RE_1LA0LD_0RE1LC_1LC1RF_1RB0RD" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +namespace Solution + +open Counter BusyBeaver.BufferChainEngine + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +set_option maxHeartbeats 1000000 in +-- 25- to 41-step symbolic reductions require slightly more heartbeats. +theorem spec : Spec target_tm D F where + w0_1 xs r := ⟨13, by buf_run_steps 13⟩ + w10 xs r := ⟨25, by buf_run_steps 25⟩ + w11_1 xs r := ⟨6, by buf_run_steps 6⟩ + rw0 xs r := ⟨3, by buf_run_steps 3⟩ + rw11 xs' r := ⟨18, by buf_run_steps 18⟩ + turn x := ⟨19, by buf_run_steps 19⟩ + lov_nil r := ⟨33, by buf_run_steps 33⟩ + lov_w0 u r := ⟨3, by buf_run_steps 3⟩ + lov_w11_0 x r := ⟨18, by buf_run_steps 18⟩ + lov_w11_1_start z r := ⟨8, by buf_run_steps 8⟩ + lov_w11_1_end z' r := ⟨9, by buf_run_steps 9⟩ + lov_finish y := ⟨8, by buf_run_steps 8⟩ + +set_option maxRecDepth 200000 in +-- Kernel reflection of the 657-step initial transition trace requires deeper recursion. +theorem init_to_x0 : (init []) [target_tm]⊢* (cfgL D (Lmp x0) (RC 1)) := + init_to_x0_of_cmultiStep (k := 657) (by decide) + +def c_msb_start : CCfg (Fin 2) (Fin 6) := + ⟨D, 1, (encWords encWord msb_17 ++ [1, 1, 1, 1, 1, 1]).tail, [0, 1, 0, 1]⟩ + +def c_msb_halt : CCfg (Fin 2) (Fin 6) := + (cmultiStep target_tm 1002 c_msb_start).getD c_msb_start + +set_option maxRecDepth 200000 in +-- Kernel reflection of the 1002-step MSB-17 terminal trace requires deeper recursion. +theorem msb_17_halt (r : ListBlank (Fin 2)) : + ∃ cfg, ((cfgL D (Lmp msb_17) ([1] +> r)) [target_tm]⊢* cfg) ∧ + (step target_tm cfg).isNone := by + have h_start : cfgL D (Lmp msb_17) ([1] +> r) = evalCCfg r c_msb_start := rfl + have h_msb : cmultiStep target_tm 1002 c_msb_start = some c_msb_halt := by decide + have h_q : c_msb_halt.q = A := by decide + have h_cur : c_msb_halt.cur = 1 := by decide + refine ⟨evalCCfg r c_msb_halt, ?_, ?_⟩ + · rw [h_start] + exact ⟨1002, cmultiStep_sound 1002 c_msb_start c_msb_halt r h_msb⟩ + · simp [step, h_q, h_cur, A, target_tm]; rfl + +end Solution + +public section + +open Solution BusyBeaver.BufferChainEngine in +theorem is_halt : IsHalt target := + is_halt_of_msb17_1 spec init_to_x0 msb_17_halt + +end + +end BusyBeaver.M_1RBHHH_1LC1RE_1LA0LD_0RE1LC_1LC1RF_1RB0RD diff --git a/BusyBeaver/BB6/M_1RB0LD_1LC1RA_1RA1LC_1LE1LA_0RF1LD_HHH1RE.lean b/BusyBeaver/BB6/M_1RB0LD_1LC1RA_1RA1LC_1LE1LA_0RF1LD_HHH1RE.lean index 0b80dcf0..a2538574 100644 --- a/BusyBeaver/BB6/M_1RB0LD_1LC1RA_1RA1LC_1LE1LA_0RF1LD_HHH1RE.lean +++ b/BusyBeaver/BB6/M_1RB0LD_1LC1RA_1RA1LC_1LE1LA_0RF1LD_HHH1RE.lean @@ -2470,16 +2470,10 @@ private theorem rule_odd_gen (a g h : Nat) (ha : a ≥ 1) (hg : g % 2 = 1) (hh : 0] : List (Fin 2))^(k+3) +> default) {{E}}> ((1 : Fin 2) >> ([1] : List (Fin 2))^(h-3) +> default)) := by dsimp -failIfUnchanged [c2] - have h_head : ((1 : Fin 2) >> ([1] : List (Fin 2))^(h-3) - +> default : ListBlank (Fin 2)).head = 1 := by - rw [Turing.ListBlank.head_cons] - have h_tail : ((1 : Fin 2) >> ([1] : List (Fin 2))^(h-3) - +> default : ListBlank (Fin 2)).tail = ([1] : List (Fin 2))^(h-3) +> default := by - rw [Turing.ListBlank.tail_cons] - rw [Cfg.headRight, h_head, h_tail] + simp only [Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] rw [h_bounce_cast] at h_phases3_plus have h_final := ReachesPlus.trans_star h_phases3_plus h_bounce - simp only [Cfg.headRight, ListBlank.head_cons, ListBlank.tail_cons] at h_final + simp only [ListBlank.head_cons, ListBlank.tail_cons] at h_final have h_final_cast : (⟨some A, ⟨1, ([1] : List (Fin 2))^2 +> ([1, 0] : List (Fin 2))^(k+2) +> default, ([1] : List (Fin 2))^(h-3) +> default⟩⟩ : Cfg (Fin 2) (Fin 6)) = diff --git a/BusyBeaver/BB6/M_1RB0LE_0RC1RC_0RD1LA_1LD0LA_1LF1LC_HHH0LA.lean b/BusyBeaver/BB6/M_1RB0LE_0RC1RC_0RD1LA_1LD0LA_1LF1LC_HHH0LA.lean index ccec8dbe..22cde684 100644 --- a/BusyBeaver/BB6/M_1RB0LE_0RC1RC_0RD1LA_1LD0LA_1LF1LC_HHH0LA.lean +++ b/BusyBeaver/BB6/M_1RB0LE_0RC1RC_0RD1LA_1LD0LA_1LF1LC_HHH0LA.lean @@ -255,7 +255,7 @@ def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_D, .not (.ge_const 2 2))] def D_cfg (a b c d : Nat) : Cfg (Fin 2) (Fin 6) := - default {{D}}> + Cfg.headRight D default (([1, 0] : List (Fin 2))^a +> (([1, 1, 0] : List (Fin 2))^b +> (([0] : List (Fin 2))^c +> @@ -276,7 +276,8 @@ private theorem closes_of_in_ps {c_1 : Cfg (Fin 2) (Fin 6)} {a b c d : Nat} StepsToClosed.of_isInPatternSet h₁ (in_ps_D a b c d hc) def H_mid (a b m : Nat) : Cfg (Fin 2) (Fin 6) := - ((((default <+ ([0, 1] : List (Fin 2))^a) <+ [1]) <+ ([1, 1, 1] : List (Fin 2))^b) <+ [0]) {{D}}> + Cfg.headRight D + ((((default <+ ([0, 1] : List (Fin 2))^a) <+ [1]) <+ ([1, 1, 1] : List (Fin 2))^b) <+ [0]) (([1] : List (Fin 2))^m +> default) private theorem step_H_mid_a0_m1 (b : Nat) : @@ -620,12 +621,14 @@ private theorem closes_H_mid (a : Nat) : (ih a' (by omega) (b + 2) m') def B_mid (a k b d : Nat) : Cfg (Fin 2) (Fin 6) := - (((default <+ ([0, 1] : List (Fin 2))^a) <+ ([1] : List (Fin 2))^k) {{B}}> - ([0, 0] +> (([1, 1, 0] : List (Fin 2))^b +> ([0] +> (([1] : List (Fin 2))^d +> default))))) + Cfg.headRight B + (((default <+ ([0, 1] : List (Fin 2))^a) <+ ([1] : List (Fin 2))^k)) + ([0, 0] +> (([1, 1, 0] : List (Fin 2))^b +> ([0] +> (([1] : List (Fin 2))^d +> default)))) def A_rem (a k q m : Nat) : Cfg (Fin 2) (Fin 6) := - (((default <+ ([0, 1] : List (Fin 2))^a) <+ ([1] : List (Fin 2))^k) <{{A}} - (([1, 1, 0] : List (Fin 2))^q +> ([0] +> (([1] : List (Fin 2))^m +> default)))) + Cfg.headLeft A + (((default <+ ([0, 1] : List (Fin 2))^a) <+ ([1] : List (Fin 2))^k)) + (([1, 1, 0] : List (Fin 2))^q +> ([0] +> (([1] : List (Fin 2))^m +> default))) private theorem step_B_mid_bsucc (a k b d : Nat) : (B_mid a (k + 1) (b + 1) d) [target]⊢⁺ (B_mid a (k + 2) b (d + 2)) := by diff --git a/BusyBeaver/BB6/M_1RB0LE_0RC1RC_0RD1LA_1LD0LA_1LF1LC_HHH1LC.lean b/BusyBeaver/BB6/M_1RB0LE_0RC1RC_0RD1LA_1LD0LA_1LF1LC_HHH1LC.lean index 7a0597c9..e42da8b6 100644 --- a/BusyBeaver/BB6/M_1RB0LE_0RC1RC_0RD1LA_1LD0LA_1LF1LC_HHH1LC.lean +++ b/BusyBeaver/BB6/M_1RB0LE_0RC1RC_0RD1LA_1LD0LA_1LF1LC_HHH1LC.lean @@ -238,7 +238,7 @@ def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_D, .not (.ge_const 2 2))] def D_cfg (a b c d : Nat) : Cfg (Fin 2) (Fin 6) := - default {{D}}> + Cfg.headRight D default (([1, 0] : List (Fin 2))^a +> (([1, 1, 0] : List (Fin 2))^b +> (([0] : List (Fin 2))^c +> @@ -259,7 +259,8 @@ private theorem closes_of_in_ps {c_1 : Cfg (Fin 2) (Fin 6)} {a b c d : Nat} StepsToClosed.of_isInPatternSet h₁ (in_ps_D a b c d hc) def A_ones (a k b d : Nat) : Cfg (Fin 2) (Fin 6) := - ((default <+ ([0, 1] : List (Fin 2))^a) <+ ([1] : List (Fin 2))^(k + 1)) <{{A}} + Cfg.headLeft A + ((default <+ ([0, 1] : List (Fin 2))^a) <+ ([1] : List (Fin 2))^(k + 1)) (([1, 1, 0] : List (Fin 2))^b +> (([0] : List (Fin 2)) +> (([1] : List (Fin 2))^d +> default))) private theorem step_A_ones_k2 (a b d : Nat) : @@ -345,7 +346,8 @@ private theorem step_A_ones_ksucc3 (a k b d : Nat) : bb_steps def H_mid (a b m : Nat) : Cfg (Fin 2) (Fin 6) := - ((((default <+ ([0, 1] : List (Fin 2))^a) <+ [1]) <+ ([1, 1, 1] : List (Fin 2))^b) <+ [0]) {{D}}> + Cfg.headRight D + ((((default <+ ([0, 1] : List (Fin 2))^a) <+ [1]) <+ ([1, 1, 1] : List (Fin 2))^b) <+ [0]) (([1] : List (Fin 2))^m +> default) private theorem step_H_mid_a0_m1 (b : Nat) : @@ -634,7 +636,8 @@ private theorem closes_H_mid (a : Nat) : (ih a' (by omega) (b + 2) m') def B_mid (a k b d : Nat) : Cfg (Fin 2) (Fin 6) := - ((default <+ ([0, 1] : List (Fin 2))^a) <+ ([1] : List (Fin 2))^k) {{B}}> + Cfg.headRight B + ((default <+ ([0, 1] : List (Fin 2))^a) <+ ([1] : List (Fin 2))^k) ([0, 0] +> (([1, 1, 0] : List (Fin 2))^b +> (([0] : List (Fin 2)) +> (([1] : List (Fin 2))^d +> default)))) diff --git a/BusyBeaver/BB6/M_1RB0LF_1LC0LD_1RD1LB_HHH1RE_0RA1RE_1LA0LE.lean b/BusyBeaver/BB6/M_1RB0LF_1LC0LD_1RD1LB_HHH1RE_0RA1RE_1LA0LE.lean index e40a3fda..8c68bbb8 100644 --- a/BusyBeaver/BB6/M_1RB0LF_1LC0LD_1RD1LB_HHH1RE_0RA1RE_1LA0LE.lean +++ b/BusyBeaver/BB6/M_1RB0LF_1LC0LD_1RD1LB_HHH1RE_0RA1RE_1LA0LE.lean @@ -152,13 +152,13 @@ private def cfg_E (a b : Nat) : Cfg (Fin 2) (Fin 6) := {{E}}> default def F_R (b k : Nat) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := - (((default : ListBlank (Fin 2)) <+ ([1] : List (Fin 2)) ^ b) <+ ([1, 0] : List (Fin 2)) ^ k) - {{F}}> + Cfg.headRight F + ((((default : ListBlank (Fin 2)) <+ ([1] : List (Fin 2)) ^ b) <+ ([1, 0] : List (Fin 2)) ^ k)) ([0, 0] +> r) def cfg_A (b k c : Nat) : Cfg (Fin 2) (Fin 6) := - (((default : ListBlank (Fin 2)) <+ ([1] : List (Fin 2)) ^ b) <+ ([1, 0] : List (Fin 2)) ^ k) - {{F}}> + Cfg.headRight F + ((((default : ListBlank (Fin 2)) <+ ([1] : List (Fin 2)) ^ b) <+ ([1, 0] : List (Fin 2)) ^ k)) ([0, 0] +> (([1] : List (Fin 2)) ^ c +> default)) private theorem cfg_A_eq_F_R (b k c : Nat) : @@ -201,7 +201,9 @@ private theorem step_E_b0 (a : Nat) : ((((default : ListBlank (Fin 2)) <+ ([1, 0] : List (Fin 2)) ^ a) <+ [0]) {{C}}> ([1] +> ([1] +> default))) := by bb_steps - rw [ListBlank.append_cons, ListBlank.append_nil, <- default_append_01_pow a] at h1 + have heq : (([0] : List (Fin 2)) +> [1, 0] ^ a +> default) = (([0, 1] : List (Fin 2)) ^ a +> default) := by + rw [ListBlank.append_cons, ListBlank.append_nil, ← default_append_01_pow] + rw [heq] at h1 have h2 := shift_CB_left a default ([1] +> default) rw [pair_pow_eq_singleton_pow_two_mul 1 a] at h2 have h3 : ((default : ListBlank (Fin 2)) {{C}}> ([1] +> (([1] : List (Fin 2)) ^ (2 * a) +> ([1] @@ -430,7 +432,9 @@ private theorem D100_0_11 (k : Nat) (r : ListBlank (Fin 2)) : (D100 0 k ([1, 1] +> r)) [target]⊢⁺ (F_R 1 (k + 1) r) := by unfold D100 F_R simp only [list_pow_zero, ListBlank.append_nil] - rw [ListBlank.append_cons, ListBlank.append_nil, <- default_append_01_pow k] + have heq : (([0] : List (Fin 2)) +> [1, 0] ^ k +> default) = (([0, 1] : List (Fin 2)) ^ k +> default) := by + rw [ListBlank.append_cons, ListBlank.append_nil, ← default_append_01_pow] + rw [heq] have h1 : (((default : ListBlank (Fin 2)) <+ ([0, 1] : List (Fin 2)) ^ k) {{D}}> ([1, 0, 0] +> ([1, 1] +> r))) [target]⊢⁺ @@ -824,8 +828,9 @@ def Odd_cfg (p k n m c : Nat) : Cfg (Fin 2) (Fin 6) := (([0, 1] : List (Fin 2)) ^ (m + 1) +> (([1] : List (Fin 2)) ^ c +> default))) def ETail_cfg (k m c : Nat) : Cfg (Fin 2) (Fin 6) := - (((default : ListBlank (Fin 2)) <+ ([1] : List (Fin 2)) ^ (2 * (k + 4) + 1)) {{E}}> - (([0, 1] : List (Fin 2)) ^ m +> (([1] : List (Fin 2)) ^ c +> default))) + Cfg.headRight E + ((default : ListBlank (Fin 2)) <+ ([1] : List (Fin 2)) ^ (2 * (k + 4) + 1)) + (([0, 1] : List (Fin 2)) ^ m +> (([1] : List (Fin 2)) ^ c +> default)) private theorem rule_A_b2_ksucc_c1 (k c : Nat) : (cfg_A 2 (k + 1) (c + 1)) [target]⊢⁺ (Odd_cfg 2 0 0 k c) := by diff --git a/BusyBeaver/BB6/M_1RB0RC_1LC1RE_1RA1LD_0LC0LA_1RF1RD_HHH0RD.lean b/BusyBeaver/BB6/M_1RB0RC_1LC1RE_1RA1LD_0LC0LA_1RF1RD_HHH0RD.lean index 3d679a66..8af95a08 100644 --- a/BusyBeaver/BB6/M_1RB0RC_1LC1RE_1RA1LD_0LC0LA_1RF1RD_HHH0RD.lean +++ b/BusyBeaver/BB6/M_1RB0RC_1LC1RE_1RA1LD_0LC0LA_1RF1RD_HHH0RD.lean @@ -172,7 +172,7 @@ private def cfg_D (a b : Nat) : Cfg (Fin 2) (Fin 6) := default)) abbrev cfg_A (l : ListBlank (Fin 2)) (k j c : Nat) : Cfg (Fin 2) (Fin 6) := - (l <+ ([1] : List (Fin 2)) ^ k) {{D}}> + Cfg.headRight D (l <+ ([1] : List (Fin 2)) ^ k) ([1, 1] +> (([0, 1] : List (Fin 2)) ^ j +> (([1] : List (Fin 2)) ^ c +> default))) abbrev l_hat : ListBlank (Fin 2) := @@ -182,7 +182,7 @@ abbrev l_ones3 : ListBlank (Fin 2) := (default : ListBlank (Fin 2)) <+ ([1] : List (Fin 2)) ^ 3 abbrev cfg_C001 (l : ListBlank (Fin 2)) (a b : Nat) : Cfg (Fin 2) (Fin 6) := - l {{C}}> ([0, 0, 1] +> (([0, 1] : List (Fin 2)) ^ a +> (([1] : List (Fin 2)) ^ b +> default))) + Cfg.headRight C l ([0, 0, 1] +> (([0, 1] : List (Fin 2)) ^ a +> (([1] : List (Fin 2)) ^ b +> default))) def pat_A : TapePattern (Fin 2) (Fin 6) := { left := .rep [1] 0 (.rep [0, 1, 1, 1] 1 .default) diff --git a/BusyBeaver/BB6/M_1RB0RE_1LC0RA_1RF0RD_HHH1LE_0LB1LE_1LE1RC.lean b/BusyBeaver/BB6/M_1RB0RE_1LC0RA_1RF0RD_HHH1LE_0LB1LE_1LE1RC.lean index b3f28d97..a4db544b 100644 --- a/BusyBeaver/BB6/M_1RB0RE_1LC0RA_1RF0RD_HHH1LE_0LB1LE_1LE1RC.lean +++ b/BusyBeaver/BB6/M_1RB0RE_1LC0RA_1RF0RD_HHH1LE_0LB1LE_1LE1RC.lean @@ -170,13 +170,13 @@ private def cfg_E (a b : Nat) : Cfg (Fin 2) (Fin 6) := {{E}}> default def F_R (b k : Nat) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := - (((default : ListBlank (Fin 2)) <+ ([1] : List (Fin 2)) ^ b) <+ ([1, 0] : List (Fin 2)) ^ k) - {{F}}> + Cfg.headRight F + ((((default : ListBlank (Fin 2)) <+ ([1] : List (Fin 2)) ^ b) <+ ([1, 0] : List (Fin 2)) ^ k)) ([0, 0] +> r) def cfg_F (b k c : Nat) : Cfg (Fin 2) (Fin 6) := - (((default : ListBlank (Fin 2)) <+ ([1] : List (Fin 2)) ^ b) <+ ([1, 0] : List (Fin 2)) ^ k) - {{F}}> + Cfg.headRight F + ((((default : ListBlank (Fin 2)) <+ ([1] : List (Fin 2)) ^ b) <+ ([1, 0] : List (Fin 2)) ^ k)) ([0, 0] +> (([1] : List (Fin 2)) ^ c +> default)) private theorem cfg_F_eq_F_R (b k c : Nat) : @@ -212,7 +212,9 @@ private theorem step_E_b0 (a : Nat) : ((((default : ListBlank (Fin 2)) <+ ([1, 0] : List (Fin 2)) ^ a) <+ [0]) {{C}}> ([1] +> ([1] +> default))) := by bb_steps - rw [ListBlank.append_cons, ListBlank.append_nil, <- default_append_01_pow a] at h1 + have heq : (([0] : List (Fin 2)) +> [1, 0] ^ a +> default) = (([0, 1] : List (Fin 2)) ^ a +> default) := by + rw [ListBlank.append_cons, ListBlank.append_nil, ← default_append_01_pow] + rw [heq] at h1 have h2 := shift_CB_left a default ([1] +> default) rw [pair_pow_eq_singleton_pow_two_mul 1 a] at h2 have h3 : ((default : ListBlank (Fin 2)) {{C}}> ([1] +> (([1] : List (Fin 2)) ^ (2 * a) +> ([1] @@ -435,7 +437,9 @@ private theorem D100_0_11 (k : Nat) (r : ListBlank (Fin 2)) : (D100 0 k ([1, 1] +> r)) [mirrorMachine]⊢⁺ (F_R 1 (k + 1) r) := by unfold D100 F_R simp only [list_pow_zero, ListBlank.append_nil] - rw [ListBlank.append_cons, ListBlank.append_nil, <- default_append_01_pow k] + have heq : (([0] : List (Fin 2)) +> [1, 0] ^ k +> default) = (([0, 1] : List (Fin 2)) ^ k +> default) := by + rw [ListBlank.append_cons, ListBlank.append_nil, ← default_append_01_pow] + rw [heq] have h1 : (((default : ListBlank (Fin 2)) <+ ([0, 1] : List (Fin 2)) ^ k) {{D}}> ([1, 0, 0] +> ([1, 1] +> r))) [mirrorMachine]⊢⁺ @@ -830,8 +834,9 @@ def Odd_cfg (p k n m c : Nat) : Cfg (Fin 2) (Fin 6) := (([0, 1] : List (Fin 2)) ^ (m + 1) +> (([1] : List (Fin 2)) ^ c +> default))) def ETail_cfg (k m c : Nat) : Cfg (Fin 2) (Fin 6) := - (((default : ListBlank (Fin 2)) <+ ([1] : List (Fin 2)) ^ (2 * (k + 4) + 1)) {{E}}> - (([0, 1] : List (Fin 2)) ^ m +> (([1] : List (Fin 2)) ^ c +> default))) + Cfg.headRight E + ((default : ListBlank (Fin 2)) <+ ([1] : List (Fin 2)) ^ (2 * (k + 4) + 1)) + (([0, 1] : List (Fin 2)) ^ m +> (([1] : List (Fin 2)) ^ c +> default)) private theorem rule_F_b2_ksucc_c1 (k c : Nat) : (cfg_F 2 (k + 1) (c + 1)) [mirrorMachine]⊢⁺ (Odd_cfg 2 0 0 k c) := by @@ -1135,7 +1140,7 @@ def ps : TapePatternSet (Fin 2) (Fin 6) := private theorem eval_pat_A (vars : Nat -> Nat) : evalTapePattern pat_A vars = mirrorCfg (cfg_F (vars 0) (vars 1) (vars 2)) := by - unfold evalTapePattern pat_A mirrorCfg mirrorTape cfg_F Cfg.headRight evalTapeExpr π A F + unfold evalTapePattern pat_A mirrorCfg mirrorTape cfg_F evalTapeExpr π A F simp only [evalTapeExpr, ListBlank.append_cons, ListBlank.append_nil, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Option.map_some] diff --git a/BusyBeaver/BB6/M_1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RBHHH.lean b/BusyBeaver/BB6/M_1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RBHHH.lean index 1f51f346..35faf577 100644 --- a/BusyBeaver/BB6/M_1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RBHHH.lean +++ b/BusyBeaver/BB6/M_1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RBHHH.lean @@ -6,6 +6,7 @@ module public import BusyBeaver.Basic public import BusyBeaver.Bridge +import BusyBeaver.BB6.Pomme.NonHalt /-! # Busy Beaver Holdout `1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RB---` (Resolved Non-Halting) @@ -6051,4 +6052,9 @@ theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := is_valid_acceleration.collatzHalts_iff is_valid_highLevel_acceleration + +/-- Main non-halting theorem for `1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RB---`. -/ +theorem is_not_halt : IsNotHalt target := + Pomme.NonHalt.is_not_halt + end BusyBeaver.M_1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RBHHH diff --git a/BusyBeaver/BB6/M_1RB1LC_1RC0RF_1RD0LB_1RE0LD_1LFHHH_0RA1LA.lean b/BusyBeaver/BB6/M_1RB1LC_1RC0RF_1RD0LB_1RE0LD_1LFHHH_0RA1LA.lean index e470a86b..e3b6f275 100644 --- a/BusyBeaver/BB6/M_1RB1LC_1RC0RF_1RD0LB_1RE0LD_1LFHHH_0RA1LA.lean +++ b/BusyBeaver/BB6/M_1RB1LC_1RC0RF_1RD0LB_1RE0LD_1LFHHH_0RA1LA.lean @@ -735,18 +735,18 @@ private theorem drain_A_any_to_LA7 (k : Nat) (r : ListBlank (Fin 2)) : -- Section 7: Pattern Families & Remainder Lemmas -- ============================================================================ -private def P_cfg (n : Nat) : Cfg (Fin 2) (Fin 6) := (LA n) {{A}}> default -def R1_cfg (n : Nat) : Cfg (Fin 2) (Fin 6) := (LA n <+ [0, 0, 1]) {{A}}> default -def R2_cfg (n : Nat) : Cfg (Fin 2) (Fin 6) := (LA n <+ [0, 0, 1, 0, 0, 1]) {{A}}> default +private def P_cfg (n : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight A (LA n) default +def R1_cfg (n : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight A (LA n <+ [0, 0, 1]) default +def R2_cfg (n : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight A (LA n <+ [0, 0, 1, 0, 0, 1]) default private def R3_cfg (n : Nat) : Cfg (Fin 2) (Fin 6) := - (LA n <+ [0, 0, 1, 0, 0, 1, 0, 0, 1]) {{A}}> default -private def T1_cfg (n : Nat) : Cfg (Fin 2) (Fin 6) := (LA n <+ [0, 0, 1, 0, 0, 1, 1, 0, 0, - 1]) {{A}}> default -def Q_cfg (n : Nat) : Cfg (Fin 2) (Fin 6) := (LA n <+ [0, 0, 1, 1, 1, 1]) {{A}}> default -def S4_cfg (n : Nat) : Cfg (Fin 2) (Fin 6) := (LA n <+ [0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, - 1]) {{A}}> default -def S6_cfg (n : Nat) : Cfg (Fin 2) (Fin 6) := (LA n <+ [0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, - 1]) {{A}}> default + Cfg.headRight A (LA n <+ [0, 0, 1, 0, 0, 1, 0, 0, 1]) default +private def T1_cfg (n : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight A (LA n <+ [0, 0, 1, 0, 0, 1, 1, 0, 0, + 1]) default +def Q_cfg (n : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight A (LA n <+ [0, 0, 1, 1, 1, 1]) default +def S4_cfg (n : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight A (LA n <+ [0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, + 1]) default +def S6_cfg (n : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight A (LA n <+ [0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, + 1]) default private abbrev r_R2 : List (Fin 2) := [1, 0, 0, 1] private abbrev r_3 : List (Fin 2) := [1, 0, 1, 1, 0, 1, 0, 0, 1] diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC.lean b/BusyBeaver/BB6/NonHalt/M_1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC.lean new file mode 100644 index 00000000..86cf8315 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC.lean @@ -0,0 +1,577 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Basic + +open Mathlib Relation Nat Turing BusyBeaver SixState + +@[expose] public section + +namespace BusyBeaver.M_1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end BusyBeaver.M_1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC + +end + +namespace BusyBeaver.M_1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (c : Cfg Γ Λ) : multiStep M c 0 = some c := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (c : Cfg Γ Λ) : multiStep M c 1 = step M c := rfl + +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (c : Cfg Γ Λ) (n : ℕ) : + multiStep M c (n + 1) = (multiStep M c n).bind (step M) := by + simp only [multiStep, Function.iterate_succ_apply'] + +theorem multiStep_add (M : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : ℕ) : + multiStep M c₁ (n + m) = (multiStep M c₁ n).bind (fun c₂ => multiStep M c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans (M : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : ℕ) + (h₁ : c₁ [M]⊢^{n} c₂) (h₂ : c₂ [M]⊢^{m} c₃) : + c₁ [M]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +@[simp] theorem pow_zero_list (u : List (Fin 2)) : u ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (u : List (Fin 2)) (n : Nat) : u ^ (n + 1) = u ++ u ^ n := rfl +@[simp] theorem nil_append_list (l : List (Fin 2)) : ([] : List (Fin 2)) ++ l = l := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ + ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : + (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, + BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, + default_head, default_tail]) +macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> + (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> + (any_goals (first | finish | step))) +macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +theorem multiStep_step_isSome {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₀ cfg cfg' : Cfg Γ Λ) (n m : Nat) + (hn : multiStep M c₀ n = some cfg) + (hnm : multiStep M c₀ (n + (1 + m)) = some cfg') : + (step M cfg).isSome := by + rw [multiStep_add M c₀ n (1 + m), hn] at hnm + dsimp [Option.bind] at hnm + rw [multiStep_add M cfg 1 m, multiStep_one] at hnm + cases hs : step M cfg with + | none => + rw [hs] at hnm + nomatch hnm + | some c₁ => rfl + +theorem inv_reaches_beyond {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) {c_init : Cfg Γ Λ} (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, (c_init [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') + (N : Nat) : + ∃ (m : Nat) (cfg' : Cfg Γ Λ), multiStep M c_init (N + m) = some cfg' ∧ Inv cfg' := by + induction N with + | zero => + obtain ⟨cfg₀, ⟨n₀, hn₀⟩, h_inv₀⟩ := h_init + refine ⟨n₀, cfg₀, ?_, h_inv₀⟩ + rwa [Nat.zero_add] + | succ N ih => + obtain ⟨m, cfg₁, hm, h_inv₁⟩ := ih + cases m with + | zero => + obtain ⟨cfg₂, ⟨k, hk_pos, hk⟩, h_inv₂⟩ := h_step cfg₁ h_inv₁ + cases k with + | zero => omega + | succ k' => + refine ⟨k', cfg₂, ?_, h_inv₂⟩ + have h_trans := multiStep_trans M c_init cfg₁ cfg₂ N (k' + 1) hm hk + have h_eq : (N + 1) + k' = N + (k' + 1) := by omega + rwa [h_eq] + | succ m' => + refine ⟨m', cfg₁, ?_, h_inv₁⟩ + have h_eq : (N + 1) + m' = N + (m' + 1) := by omega + rwa [h_eq] + +theorem closed_inv_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) {c_init : Cfg Γ Λ} (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, (c_init [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') : + ∀ cfg : Cfg Γ Λ, (c_init [M]⊢* cfg) → (step M cfg).isSome := by + intro cfg ⟨n, hn⟩ + obtain ⟨m, cfg', hnm, _⟩ := inv_reaches_beyond M Inv h_init h_step (n + 1) + have h_eq : (n + 1) + m = n + (1 + m) := by omega + rw [h_eq] at hnm + exact multiStep_step_isSome M c_init cfg cfg' n m hn hnm + +def B00 (m l : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ([0, 0] +> m) {{B}}> l + +def F11 (m l : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + m <{{F}} ([1, 1] +> l) + +def A0 (m l : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + m <{{A}} ((0 : Fin 2) >> l) + +theorem rule_B00_111 (m l : ListBlank (Fin 2)) : + (B00 m ([1, 1, 1] +> l)) [target_tm]⊢⁺ (B00 ([0, 0, 0] +> m) l) := by + dsimp [B00, ListBlank.append]; execute + +theorem rule_B00_011 (m l : ListBlank (Fin 2)) : + (B00 m ([0, 1, 1] +> l)) [target_tm]⊢⁺ (B00 ([1, 1, 0] +> m) l) := by + dsimp [B00, ListBlank.append]; execute + +theorem rule_B00_00 (m l : ListBlank (Fin 2)) : + (B00 m ([0, 0] +> l)) [target_tm]⊢⁺ (A0 m ([0, 1, 1] +> l)) := by + dsimp [B00, A0, ListBlank.append]; execute + +theorem rule_B00_nil (m : ListBlank (Fin 2)) : + (B00 m default) [target_tm]⊢⁺ (A0 m ([0, 1, 1] +> default)) := by + dsimp [B00, A0, ListBlank.append]; execute + +theorem rule_F11_000 (m l : ListBlank (Fin 2)) : + (F11 ([0, 0, 0] +> m) l) [target_tm]⊢⁺ (B00 ([0, 1, 0] +> m) l) := by + dsimp [F11, B00, ListBlank.append]; execute + +theorem rule_F11_00 (m l : ListBlank (Fin 2)) : + (F11 ([0, 0] +> m) l) [target_tm]⊢⁺ (B00 ([0, 1] +> m) l) := by + dsimp [F11, B00, ListBlank.append]; execute + +theorem rule_F11_010 (m l : ListBlank (Fin 2)) : + (F11 ([0, 1, 0] +> m) l) [target_tm]⊢⁺ (F11 m ([1, 1, 1] +> l)) := by + dsimp [F11, ListBlank.append]; execute + +theorem rule_F11_110 (m l : ListBlank (Fin 2)) : + (F11 ([1, 1, 0] +> m) l) [target_tm]⊢⁺ (F11 m ([0, 1, 1] +> l)) := by + dsimp [F11, ListBlank.append]; execute + +theorem rule_F11_01 (m l : ListBlank (Fin 2)) : + (F11 ([0, 1] +> m) l) [target_tm]⊢⁺ (A0 m ([1, 1, 1] +> l)) := by + dsimp [F11, A0, ListBlank.append]; execute + +theorem rule_A0_000 (m l : ListBlank (Fin 2)) : + (A0 ([0, 0, 0] +> m) l) [target_tm]⊢⁺ (B00 ([0, 1] +> m) l) := by + dsimp [A0, B00, ListBlank.append]; execute + +theorem rule_A0_010 (m l : ListBlank (Fin 2)) : + (A0 ([0, 1, 0] +> m) l) [target_tm]⊢⁺ (A0 m ([0, 1, 1] +> l)) := by + dsimp [A0, ListBlank.append]; execute + +theorem rule_A0_110 (m l : ListBlank (Fin 2)) : + (A0 ([1, 1, 0] +> m) l) [target_tm]⊢⁺ (F11 m ([0, 0] +> l)) := by + dsimp [A0, F11, ListBlank.append]; execute + +theorem rule_A0_01_01 (l : ListBlank (Fin 2)) : + (A0 ([0, 1] +> ([0, 1] +> default)) l) [target_tm]⊢⁺ + (B00 ([0, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([0, 1] +> default)))) l) := by + dsimp [A0, B00, ListBlank.append]; execute; execute + +abbrev RoundF (m m' : ListBlank (Fin 2)) : Prop := + ∀ l : ListBlank (Fin 2), (F11 m l) [target_tm]⊢⁺ (B00 m' l) + +abbrev RoundA (m m' : ListBlank (Fin 2)) : Prop := + ∀ l : ListBlank (Fin 2), (A0 m l) [target_tm]⊢⁺ (B00 m' l) + +theorem roundF_000 (m : ListBlank (Fin 2)) : + RoundF ([0, 0, 0] +> m) ([0, 1, 0] +> m) := + fun l => rule_F11_000 m l + +theorem roundF_00 (m : ListBlank (Fin 2)) : + RoundF ([0, 0] +> m) ([0, 1] +> m) := + fun l => rule_F11_00 m l + +theorem roundF_010 {m m' : ListBlank (Fin 2)} (h : RoundF m m') : + RoundF ([0, 1, 0] +> m) ([0, 0, 0] +> m') := + fun l => + stepPlus_trans (rule_F11_010 m l) (stepPlus_trans (h ([1, 1, 1] +> l)) (rule_B00_111 m' l)) + +theorem roundF_110 {m m' : ListBlank (Fin 2)} (h : RoundF m m') : + RoundF ([1, 1, 0] +> m) ([1, 1, 0] +> m') := + fun l => + stepPlus_trans (rule_F11_110 m l) (stepPlus_trans (h ([0, 1, 1] +> l)) (rule_B00_011 m' l)) + +theorem roundF_01 {m m' : ListBlank (Fin 2)} (h : RoundA m m') : + RoundF ([0, 1] +> m) ([0, 0, 0] +> m') := + fun l => + stepPlus_trans (rule_F11_01 m l) (stepPlus_trans (h ([1, 1, 1] +> l)) (rule_B00_111 m' l)) + +theorem roundA_000 (m : ListBlank (Fin 2)) : + RoundA ([0, 0, 0] +> m) ([0, 1] +> m) := + fun l => rule_A0_000 m l + +theorem roundA_010 {m m' : ListBlank (Fin 2)} (h : RoundA m m') : + RoundA ([0, 1, 0] +> m) ([1, 1, 0] +> m') := + fun l => + stepPlus_trans (rule_A0_010 m l) (stepPlus_trans (h ([0, 1, 1] +> l)) (rule_B00_011 m' l)) + +theorem roundA_110 {m m₁ m₂ : ListBlank (Fin 2)} (h₁ : RoundF m m₁) (h₂ : RoundA m₁ m₂) : + RoundA ([1, 1, 0] +> m) ([1, 1, 0] +> m₂) := + fun l => stepPlus_trans (rule_A0_110 m l) + (stepPlus_trans (h₁ ([0, 0] +> l)) + (stepPlus_trans (rule_B00_00 m₁ l) + (stepPlus_trans (h₂ ([0, 1, 1] +> l)) (rule_B00_011 m₂ l)))) + +theorem roundA_01_01 : + RoundA ([0, 1] +> ([0, 1] +> default)) + ([0, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([0, 1] +> default)))) := + fun l => rule_A0_01_01 l + +inductive SweepsF : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) → Prop + | zero (r : ListBlank (Fin 2)) : SweepsF 0 r r + | succ {n : Nat} {r r₁ r₂ : ListBlank (Fin 2)} : + RoundF r r₁ → SweepsF n r₁ r₂ → SweepsF (n + 1) r r₂ + +theorem SweepsF.trans {a b : Nat} {r₁ r₂ r₃ : ListBlank (Fin 2)} + (h₁ : SweepsF a r₁ r₂) (h₂ : SweepsF b r₂ r₃) : SweepsF (a + b) r₁ r₃ := by + induction h₁ with + | zero _ => simpa using h₂ + | succ hr _ ih => + rw [Nat.succ_add] + exact SweepsF.succ hr (ih h₂) + +theorem sweepsF_split_last {n : Nat} {r r' : ListBlank (Fin 2)} (h : SweepsF (n + 1) r r') : + ∃ r₁ : ListBlank (Fin 2), SweepsF n r r₁ ∧ RoundF r₁ r' := by + induction n generalizing r with + | zero => + cases h with + | succ hr h0 => + cases h0 with + | zero _ => exact ⟨r, SweepsF.zero r, hr⟩ + | succ m ih => + cases h with + | succ hr hs => + obtain ⟨r₁, hs₁, hr₁⟩ := ih hs + exact ⟨r₁, SweepsF.succ hr hs₁, hr₁⟩ + +theorem sweepsF_110 {n : Nat} {r r' : ListBlank (Fin 2)} (h : SweepsF n r r') : + SweepsF n ([1, 1, 0] +> r) ([1, 1, 0] +> r') := by + induction h with + | zero r => exact SweepsF.zero _ + | succ hr _ ih => exact SweepsF.succ (roundF_110 hr) ih + +theorem sweepsF_000_even {k : Nat} {r r' : ListBlank (Fin 2)} (h : SweepsF k r r') : + SweepsF (2 * k) ([0, 0, 0] +> r) ([0, 0, 0] +> r') := by + induction h with + | zero r => exact SweepsF.zero _ + | @succ m r₀ r₁ r₂ hr _ ih => + have h2 : SweepsF 2 ([0, 0, 0] +> r₀) ([0, 0, 0] +> r₁) := + SweepsF.succ (roundF_000 r₀) (SweepsF.succ (roundF_010 hr) (SweepsF.zero _)) + have htr := SweepsF.trans h2 ih + rw [show 2 + 2 * m = 2 * (m + 1) by omega] at htr + exact htr + +theorem sweepsF_000_odd {k : Nat} {r r' : ListBlank (Fin 2)} (h : SweepsF k r r') : + SweepsF (2 * k + 1) ([0, 0, 0] +> r) ([0, 1, 0] +> r') := by + have he := sweepsF_000_even h + have h1 : SweepsF 1 ([0, 0, 0] +> r') ([0, 1, 0] +> r') := + SweepsF.succ (roundF_000 r') (SweepsF.zero _) + exact SweepsF.trans he h1 + +def SweepsFA (n : Nat) (r r' : ListBlank (Fin 2)) : Prop := + ∃ r₁ : ListBlank (Fin 2), SweepsF n r r₁ ∧ RoundA r₁ r' + +theorem sweepsFA_succ {n : Nat} {r r₁ r₂ : ListBlank (Fin 2)} + (hr : RoundF r r₁) (hs : SweepsFA n r₁ r₂) : SweepsFA (n + 1) r r₂ := by + obtain ⟨r_m, hs_m, ha⟩ := hs + exact ⟨r_m, SweepsF.succ hr hs_m, ha⟩ + +theorem sweepsFA_110 {n : Nat} {r r' : ListBlank (Fin 2)} (h : SweepsFA (n + 1) r r') : + SweepsFA n ([1, 1, 0] +> r) ([1, 1, 0] +> r') := by + obtain ⟨r₁, hs, ha⟩ := h + obtain ⟨r₀, hs₀, hr₀⟩ := sweepsF_split_last hs + exact ⟨[1, 1, 0] +> r₀, sweepsF_110 hs₀, roundA_110 hr₀ ha⟩ + +theorem sweepsFA_000_odd {k : Nat} {r r' : ListBlank (Fin 2)} (h : SweepsFA k r r') : + SweepsFA (2 * k + 1) ([0, 0, 0] +> r) ([1, 1, 0] +> r') := by + obtain ⟨r₁, hs, ha⟩ := h + exact ⟨[0, 1, 0] +> r₁, sweepsF_000_odd hs, roundA_010 ha⟩ + +theorem sweepsFA_000_even {k : Nat} {r r_m : ListBlank (Fin 2)} (hs : SweepsF k r r_m) : + SweepsFA (2 * k) ([0, 0, 0] +> r) ([0, 1] +> r_m) := + ⟨[0, 0, 0] +> r_m, sweepsF_000_even hs, roundA_000 r_m⟩ + +theorem default_eq_b000 : + (default : ListBlank (Fin 2)) = [0, 0, 0] +> default := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b01_default_eq : + ([0, 1] +> default : ListBlank (Fin 2)) = [0, 1, 0] +> default := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem roundA_default : + RoundA default ([0, 1] +> default) := by + have h := roundA_000 default + rwa [← default_eq_b000] at h + +theorem roundA_01_bot : + RoundA ([0, 1] +> default) ([1, 1, 0] +> ([0, 1] +> default)) := by + have h0 := roundA_010 roundA_default + rwa [← b01_default_eq] at h0 + +inductive Valid : Nat → ListBlank (Fin 2) → Prop + | bot (n : Nat) : + Valid n ([0, 1] +> default) + | t_110 {n : Nat} {r : ListBlank (Fin 2)} (hr : Valid (n + 1) r) : + Valid n ([1, 1, 0] +> r) + | t_01 {n : Nat} {r_k r₁ : ListBlank (Fin 2)} (hn : n ≥ 1) + (hround : RoundA r_k r₁) (hr : Valid ((n - 1) / 2) r₁) : + Valid n ([0, 1] +> r_k) + +theorem Valid.mono {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) {n' : Nat} (hle : n ≤ n') : + Valid n' r := by + induction h generalizing n' with + | bot _ => exact Valid.bot n' + | t_110 _ ih => exact Valid.t_110 (ih (by omega)) + | t_01 hn hround _ ih => exact Valid.t_01 (by omega) hround (ih (by omega)) + +theorem valid_sweeps_bot : ∀ n : Nat, + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ SweepsFA n ([0, 1] +> default) r' := by + intro n + induction n using Nat.strongRecOn with + | ind n ih => + rcases (by omega : n = 0 ∨ (n ≥ 1 ∧ (n - 1) % 2 = 1) ∨ (n ≥ 1 ∧ + (n - 1) % 2 = 0)) with rfl | ⟨hn1, hod⟩ | ⟨hn1, hev⟩ + · refine ⟨[1, 1, 0] +> ([0, 1] +> default), Valid.t_110 (Valid.bot 1), ?_⟩ + exact ⟨[0, 1] +> default, SweepsF.zero _, roundA_01_bot⟩ + · obtain ⟨r₂, hr₂, hs₂⟩ := ih ((n - 1) / 2) (by omega) + refine ⟨[1, 1, 0] +> r₂, Valid.t_110 (hr₂.mono (by omega)), ?_⟩ + have hs_odd := sweepsFA_000_odd hs₂ + rw [show 2 * ((n - 1) / 2) + 1 = n - 1 by omega] at hs_odd + have hs_all := sweepsFA_succ (roundF_01 roundA_default) hs_odd + rwa [show (n - 1) + 1 = n by omega] at hs_all + · obtain ⟨r₂, hr₂, hs₂⟩ := ih ((n - 1) / 2) (by omega) + obtain ⟨r_m, hs_m, hround₂⟩ := hs₂ + refine ⟨[0, 1] +> r_m, Valid.t_01 hn1 hround₂ hr₂, ?_⟩ + have hs_even := sweepsFA_000_even hs_m + rw [show 2 * ((n - 1) / 2) = n - 1 by omega] at hs_even + have hs_all := sweepsFA_succ (roundF_01 roundA_default) hs_even + rwa [show (n - 1) + 1 = n by omega] at hs_all + +theorem valid_sweeps {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) : + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ SweepsFA n r r' := by + induction h with + | bot n => exact valid_sweeps_bot n + | t_110 _ ih => + obtain ⟨r', hr', hs'⟩ := ih + exact ⟨[1, 1, 0] +> r', Valid.t_110 hr', sweepsFA_110 hs'⟩ + | @t_01 n r_k r₁ hn hround _ ih => + obtain ⟨r₂, hr₂, hs₂⟩ := ih + rcases (by omega : (n - 1) % 2 = 1 ∨ (n - 1) % 2 = 0) with hod | hev + · refine ⟨[1, 1, 0] +> r₂, Valid.t_110 (hr₂.mono (by omega)), ?_⟩ + have hs_odd := sweepsFA_000_odd hs₂ + rw [show 2 * ((n - 1) / 2) + 1 = n - 1 by omega] at hs_odd + have hs_all := sweepsFA_succ (roundF_01 hround) hs_odd + rwa [show (n - 1) + 1 = n by omega] at hs_all + · obtain ⟨r_m, hs_m, hround₂⟩ := hs₂ + refine ⟨[0, 1] +> r_m, Valid.t_01 hn hround₂ hr₂, ?_⟩ + have hs_even := sweepsFA_000_even hs_m + rw [show 2 * ((n - 1) / 2) = n - 1 by omega] at hs_even + have hs_all := sweepsFA_succ (roundF_01 hround) hs_even + rwa [show (n - 1) + 1 = n by omega] at hs_all + +theorem era_step_of_roundA {r r₁ : ListBlank (Fin 2)} (ha : RoundA r r₁) : + (B00 r default) [target_tm]⊢⁺ (B00 ([1, 1, 0] +> r₁) default) := + stepPlus_trans (rule_B00_nil r) + (stepPlus_trans (ha ([0, 1, 1] +> default)) (rule_B00_011 r₁ default)) + +theorem era_step {r : ListBlank (Fin 2)} (h : Valid 0 r) : + ∃ r' : ListBlank (Fin 2), Valid 0 r' ∧ ((B00 r default) [target_tm]⊢⁺ (B00 r' default)) := by + obtain ⟨r', hr', hs'⟩ := valid_sweeps h + obtain ⟨r₁, hs₁, ha⟩ := hs' + cases hs₁ with + | zero _ => + exact ⟨[1, 1, 0] +> r', Valid.t_110 (hr'.mono (by omega)), era_step_of_roundA ha⟩ + +def m_69 : ListBlank (Fin 2) := + [0, 0, 1, 1, 0, 1, 1, 0, 0, 1] +> default + +def m_129 : ListBlank (Fin 2) := + [1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1] +> default + +def m_176 : ListBlank (Fin 2) := + [0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1] +> default + +def l_176 : ListBlank (Fin 2) := + [0, 0, 0, 1, 1] +> default + +def m_era0 : ListBlank (Fin 2) := + [1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> + ([0, 0, 0] +> ([0, 0, 0] +> ([0, 1] +> default)))))) + +theorem step_0_to_69 : ((default : ListBlank (Fin 2)) {{E}}> default) [target_tm]⊢⁺ (B00 m_69 + default) := by + dsimp [m_69, B00, ListBlank.append]; execute; execute + +theorem step_69_to_129 : (B00 m_69 default) [target_tm]⊢⁺ (B00 m_129 default) := by + dsimp [m_69, m_129, B00, ListBlank.append]; execute; execute + +theorem step_129_to_176 : (B00 m_129 default) [target_tm]⊢⁺ (B00 m_176 l_176) := by + dsimp [m_129, m_176, l_176, B00, ListBlank.append]; execute; execute + +theorem step_176_to_247 : (B00 m_176 l_176) [target_tm]⊢⁺ (B00 m_era0 default) := by + dsimp [m_176, l_176, m_era0, B00, ListBlank.append]; execute; execute; execute + +theorem roundA_era1 : + RoundA m_era0 + ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> + ([0, 1] +> ([0, 0, 0] +> ([0, 0, 0] +> ([0, 1] +> default)))))))) := + (roundA_110 (roundF_110 (roundF_110 (roundF_110 (roundF_000 _)))) (roundA_110 (roundF_110 + (roundF_110 (roundF_010 (roundF_000 _)))) (roundA_110 (roundF_110 (roundF_000 _)) (roundA_110 + (roundF_010 (roundF_010 (roundF_01 roundA_default))) (roundA_000 _))))) + +def m_era1 : ListBlank (Fin 2) := + [1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> + ([0, 1] +> ([0, 0, 0] +> ([0, 0, 0] +> ([0, 1] +> default)))))))) + +theorem roundA_era2 : + RoundA m_era1 + ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> + ([0, 1] +> ([0, 1, 0] +> ([0, 1] +> ([0, 1] +> default))))))))) := + (roundA_110 (roundF_110 (roundF_110 (roundF_110 (roundF_110 (roundF_01 (roundA_000 _)))))) + (roundA_110 (roundF_110 (roundF_110 (roundF_110 (roundF_000 _)))) (roundA_110 (roundF_110 + (roundF_110 (roundF_010 (roundF_01 (roundA_000 _))))) (roundA_110 (roundF_110 (roundF_000 _)) + (roundA_110 (roundF_010 (roundF_000 _)) (roundA_000 _)))))) + +def m_era2 : ListBlank (Fin 2) := + [1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> + ([0, 1] +> ([0, 1, 0] +> ([0, 1] +> ([0, 1] +> default))))))))) + +theorem roundA_era3 : + RoundA m_era2 + ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> + ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> + ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> + ([0, 1] +> ([0, 1] +> default)))))))))))))))) := + (roundA_110 (roundF_110 (roundF_110 (roundF_110 (roundF_110 (roundF_110 (roundF_01 (roundA_010 + roundA_01_01))))))) (roundA_110 (roundF_110 (roundF_110 (roundF_110 (roundF_110 (roundF_000 + _))))) (roundA_110 (roundF_110 (roundF_110 (roundF_110 (roundF_010 (roundF_110 (roundF_00 + _)))))) (roundA_110 (roundF_110 (roundF_110 (roundF_000 _))) (roundA_110 (roundF_110 + (roundF_010 (roundF_110 (roundF_01 (roundA_110 (roundF_110 (roundF_01 roundA_default)) + (roundA_110 (roundF_000 _) (roundA_010 roundA_01_bot))))))) (roundA_110 (roundF_000 _) + (roundA_010 (roundA_110 (roundF_000 _) (roundA_010 (roundA_110 (roundF_110 (roundF_110 + (roundF_110 (roundF_01 roundA_default)))) (roundA_110 (roundF_110 (roundF_110 (roundF_000 _))) + (roundA_110 (roundF_110 (roundF_010 (roundF_01 roundA_default))) (roundA_110 (roundF_000 _) + (roundA_010 (roundA_000 _))))))))))))))) + +def era3_m : ListBlank (Fin 2) := + [1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> + ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> + ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> ([1, 1, 0] +> + ([0, 1] +> ([0, 1] +> default)))))))))))))))) + +theorem valid_era3_m : Valid 0 era3_m := + Valid.t_110 (Valid.t_110 (Valid.t_110 (Valid.t_110 (Valid.t_110 + (Valid.t_110 (Valid.t_110 (Valid.t_110 (Valid.t_110 (Valid.t_110 + (Valid.t_110 (Valid.t_110 (Valid.t_110 (Valid.t_110 (Valid.t_110 + (Valid.t_01 (by omega) roundA_01_bot (Valid.t_110 (Valid.bot 8))))))))))))))))) + +theorem init_E_reaches_era3 : + ((default : ListBlank (Fin 2)) {{E}}> default) [target_tm]⊢* (B00 era3_m default) := by + apply stepPlus_stepStar + exact stepPlus_trans step_0_to_69 + (stepPlus_trans step_69_to_129 + (stepPlus_trans step_129_to_176 + (stepPlus_trans step_176_to_247 + (stepPlus_trans (era_step_of_roundA roundA_era1) + (stepPlus_trans (era_step_of_roundA roundA_era2) + (era_step_of_roundA roundA_era3)))))) + + +def era0_m : ListBlank (Fin 2) := + [0, 1] +> default + +theorem init_reaches_era0 : + (init []) [target_tm]⊢* (B00 era0_m default) := by + apply stepPlus_stepStar + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + dsimp [era0_m, B00, ListBlank.append] + execute + +def era0_m_0676 : ListBlank (Fin 2) := + [1, 1, 0] +> ([0, 1] +> default) + +theorem init_F_reaches_era0 : + ((default : ListBlank (Fin 2)) {{F}}> default) [target_tm]⊢* (B00 era0_m_0676 default) := by + apply stepPlus_stepStar + dsimp [era0_m_0676, B00, ListBlank.append] + execute + +end Solution + +open Solution + +public section + +theorem is_not_halt_from_0676 : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{5}}> default) [target]⊢* cfg) → + (step target cfg).isSome := by + refine closed_inv_does_not_halt target_tm + (fun cfg => ∃ r : ListBlank (Fin 2), Valid 0 r ∧ cfg = B00 r default) + ⟨B00 era0_m_0676 default, init_F_reaches_era0, ⟨era0_m_0676, Valid.t_110 (Valid.bot 1), rfl⟩⟩ ?_ + intro cfg ⟨r, hr, hcfg⟩ + subst hcfg + obtain ⟨r', hr', hstep⟩ := era_step hr + exact ⟨B00 r' default, hstep, ⟨r', hr', rfl⟩⟩ + +theorem is_not_halt_from_0772 : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{4}}> default) [target]⊢* cfg) → + (step target cfg).isSome := by + refine closed_inv_does_not_halt target_tm + (fun cfg => ∃ r : ListBlank (Fin 2), Valid 0 r ∧ cfg = B00 r default) + ⟨B00 era3_m default, init_E_reaches_era3, ⟨era3_m, valid_era3_m, rfl⟩⟩ ?_ + intro cfg ⟨r, hr, hcfg⟩ + subst hcfg + obtain ⟨r', hr', hstep⟩ := era_step hr + exact ⟨B00 r' default, hstep, ⟨r', hr', rfl⟩⟩ + +theorem is_not_halt : IsNotHalt target := by + refine closed_inv_does_not_halt target_tm + (fun cfg => ∃ r : ListBlank (Fin 2), Valid 0 r ∧ cfg = B00 r default) + ⟨B00 era0_m default, init_reaches_era0, ⟨era0_m, Valid.bot 0, rfl⟩⟩ ?_ + intro cfg ⟨r, hr, hcfg⟩ + subst hcfg + obtain ⟨r', hr', hstep⟩ := era_step hr + exact ⟨B00 r' default, hstep, ⟨r', hr', rfl⟩⟩ + +end + +end BusyBeaver.M_1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0LA_0RC1LE_0RD1RE_1LA1RF_1RB0LD_1RCHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0LA_0RC1LE_0RD1RE_1LA1RF_1RB0LD_1RCHHH.lean new file mode 100644 index 00000000..c4648df5 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0LA_0RC1LE_0RD1RE_1LA1RF_1RB0LD_1RCHHH.lean @@ -0,0 +1,2250 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0LA_0RC1LE_0RD1RE_1LA1RF_1RB0LD_1RCHHH + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LA_0RC1LE_0RD1RE_1LA1RF_1RB0LD_1RCHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {zG_ zL_ α β γ : Type*} [Inhabited zG_] [Inhabited zL_] +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +-- ============================================================================ +-- Section 2: Turing Machine Infrastructure & Notations +-- ============================================================================ + + +/- A Turing machine statement writing a symbol and moving in direction `dir`. -/ +-- ============================================================================ +-- Section 5: Specific Turing Machine: holdout_0010 +-- ============================================================================ +/- Transition function for holdout_0010: `1RB0LA_0RC1LE_0RD1RE_1LA1RF_1RB0LD_1RC---` -/ + +set_option maxHeartbeats 8000000 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem pow_zero_list (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +omit [Inhabited Γ] in +@[simp] +theorem list_pow_append_one (u : List (Fin 2)) (k : Nat) : + u^k ++ u = u^(k + 1) := by + have h := list_pow_add_comm u k 1 + dsimp -failIfUnchanged [HPow.hPow] at h ⊢ + rw [List.append_nil] at h + exact h + +theorem cons_eq_singleton_append (x : Fin 2) (r : ListBlank (Fin 2)) : + x >> r = [x] +> r := rfl + +theorem pow_add_append_right (u : List (Fin 2)) (m n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (m + n)) +> r = (u ^ m) +> ((u ^ n) +> r) := by + rw [list_pow_add, ← listblank_append_append] + +theorem pow_succ_append_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (n + 1)) +> r = u +> ((u ^ n) +> r) := by + rw [pow_succ_list, ← listblank_append_append] + +theorem pow_add_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (m n : Nat) : + s <+ (u ^ (m + n)) = (s <+ (u ^ m)) <+ (u ^ n) := by + rw [listblank_append_append, ← list_pow_add, add_comm] + +theorem pow_succ_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (m : Nat) : + (s <+ (u ^ m)) <+ u = s <+ (u ^ (m + 1)) := by + rw [listblank_append_append, ← pow_succ_list] + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus h₁ (stepPlus_stepStar h₂) + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) + +/-- Universal non-halting principle from an infinite `⊢⁺` chain. -/ +theorem nonhalt_of_chain {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c : Nat → Cfg Γ Λ) + (h0 : (init []) [M]⊢* c 0) + (hstep : ∀ k, (c k) [M]⊢⁺ c (k + 1)) : + IsDoesNotHalt M := by + have hreach : ∀ k, ∃ m ≥ k, multiStep M (init []) m = some (c k) := by + intro k + induction k with + | zero => + obtain ⟨m, hm⟩ := h0 + exact ⟨m, Nat.zero_le m, hm⟩ + | succ k ih => + obtain ⟨m, hge, hm⟩ := ih + obtain ⟨d, hd_pos, hd⟩ := hstep k + refine ⟨m + d, by omega, multiStep_trans M (init []) (c k) (c (k + 1)) m d hm hd⟩ + intro cfg ⟨n, hn⟩ + rw [Option.isSome_iff_ne_none] + intro hnone + obtain ⟨m, hge, hm⟩ := hreach (n + 1) + have hm_eq : m = n + (1 + (m - n - 1)) := by omega + rw [hm_eq, multiStep_add M (init []) n (1 + (m - n - 1)), hn] at hm + simp only [Option.bind] at hm + rw [multiStep_add M cfg 1 (m - n - 1), multiStep_one, hnone] at hm + simp only [Option.bind] at hm + cases hm + +-- ============================================================================ +-- Section 6: Row9 Evaluator (`Row9Eval.v`) +-- ============================================================================ + +namespace Row9 + +abbrev word := List Nat +abbrev result := Option word + +def bind_res (r : result) (h : word → result) : result := + match r with + | none => none + | some W => h W + +def first_plus (k : Nat) (W : word) : word := + match W with + | [] => [] + | a :: U => (a + k) :: U + +def lift_plus (k : Nat) (r : result) : result := + Option.map (first_plus k) r + +def lift_prefix (U : word) (r : result) : result := + Option.map (U ++ ·) r + +inductive Eval : word → result → Prop where + | nil : Eval [] (some [1]) + | one {U r} : Eval U r → Eval (1 :: U) (lift_plus 4 r) + | two {U r} : Eval U r → Eval (2 :: U) (lift_prefix [2] r) + | three_halt {U} : Eval U none → Eval (3 :: U) none + | three {U V r} : Eval U (some V) → Eval V r → Eval (3 :: U) (lift_prefix [3] r) + | large (g : Nat) (U : word) : Eval ((g + 4) :: U) (some (1 :: g :: U)) + | zero : Eval [0] (some [2, 2]) + | zero_zero (U : word) : Eval (0 :: 0 :: U) none + | zero_one {U r} : Eval U r → Eval (0 :: 1 :: U) (lift_prefix [2] (lift_plus 2 r)) + | zero_two {U r} : Eval U r → Eval (0 :: 2 :: U) (lift_prefix [2, 0] r) + | zero_large (g : Nat) {U r} : Eval (g :: U) r → Eval (0 :: (g + 3) :: U) (lift_prefix [2] (lift_plus 1 r)) + +def label_weight (a : Nat) : Nat := (a + 3) % 4 + +def Pplus : word → Nat + | [] => 0 + | a :: U => label_weight a + Pplus U + +def positive_head (W : word) : Prop := + ∃ a U, W = a :: U ∧ 0 < a ∧ a % 4 ≠ 0 + +theorem label_weight_period (a : Nat) : label_weight (a + 4) = label_weight a := by + unfold label_weight; omega + +theorem label_weight_bound (a : Nat) : label_weight a < 4 := by + unfold label_weight; omega + +theorem label_weight_shift (a k : Nat) : label_weight (a + k) ≤ label_weight a + k := by + unfold label_weight; omega + +theorem label_weight_back_three (a : Nat) : label_weight a ≤ label_weight (a + 3) + 1 := by + unfold label_weight; omega + +theorem Pplus_first_plus_four (W : word) : Pplus (first_plus 4 W) = Pplus W := by + cases W with + | nil => rfl + | cons a U => simp [first_plus, Pplus, label_weight_period] + +theorem Pplus_first_plus_bound (W : word) (k : Nat) : Pplus (first_plus k W) ≤ Pplus W + k := by + cases W with + | nil => simp [first_plus, Pplus] + | cons a U => + simp only [first_plus, Pplus] + have h := label_weight_shift a k + (try omega) +theorem positive_head_plus_four {W : word} (h : positive_head W) : positive_head (first_plus 4 W) := by + rcases h with ⟨a, U, rfl, ha, hmod⟩ + refine ⟨a + 4, U, rfl, by omega, by omega⟩ + +theorem Eval_deterministic {W : word} {r : result} (E : Eval W r) : + ∀ {s : result}, Eval W s → r = s := by + induction E with + | nil => intro s E'; cases E'; rfl + | one h ih => + intro s E'; cases E' with + | one h' => rw [ih h'] + | two h ih => + intro s E'; cases E' with + | two h' => rw [ih h'] + | three_halt h ih => + intro s E'; cases E' with + | three_halt h' => rfl + | three h1 _ => have := ih h1; contradiction + | three h1 h2 ih1 ih2 => + intro s E'; cases E' with + | three_halt h' => have := ih1 h'; contradiction + | three h1' h2' => + have hv := Option.some.inj (ih1 h1') + subst hv + rw [ih2 h2'] + | large g U => + intro s E'; cases E'; rfl + | zero => + intro s E'; cases E'; rfl + | zero_zero U => + intro s E'; cases E'; rfl + | zero_one h ih => + intro s E'; cases E' with + | zero_one h' => rw [ih h'] + | zero_two h ih => + intro s E'; cases E' with + | zero_two h' => rw [ih h'] + | zero_large g h ih => + intro s E'; cases E' with + | zero_large _ h' => rw [ih h'] + +theorem Eval_success_properties {W : word} {r : result} (E : Eval W r) : + ∀ {V : word}, r = some V → positive_head V ∧ Pplus V ≤ Pplus W := by + induction E with + | nil => + intro V hV; injection hV with hV; subst hV + exact ⟨⟨1, [], rfl, by decide, by decide⟩, by decide⟩ + | one h ih => + rename_i U r' + intro V hV + rcases r' with _ | V' + · cases hV + · simp only [lift_plus, Option.map] at hV + injection hV with hV; subst hV + obtain ⟨hpos, hp⟩ := ih rfl + refine ⟨positive_head_plus_four hpos, ?_⟩ + rw [Pplus_first_plus_four] + simp only [Pplus, label_weight] + (try omega) + | two h ih => + rename_i U r' + intro V hV + rcases r' with _ | V' + · cases hV + · simp only [lift_prefix, Option.map, List.singleton_append] at hV + injection hV with hV; subst hV + obtain ⟨_, hp⟩ := ih rfl + refine ⟨⟨2, V', rfl, by decide, by decide⟩, ?_⟩ + simp only [Pplus, label_weight]; omega + | three_halt _ => + intro V hV; cases hV + | three h1 h2 ih1 ih2 => + rename_i U V1 r' + intro V hV + rcases r' with _ | V2 + · cases hV + · simp only [lift_prefix, Option.map, List.singleton_append] at hV + injection hV with hV; subst hV + obtain ⟨_, hp1⟩ := ih1 rfl + obtain ⟨_, hp2⟩ := ih2 rfl + refine ⟨⟨3, V2, rfl, by decide, by decide⟩, ?_⟩ + simp only [Pplus, label_weight]; omega + | large g U => + intro V hV; injection hV with hV; subst hV + refine ⟨⟨1, g :: U, rfl, by decide, by decide⟩, ?_⟩ + simp only [Pplus, label_weight_period, label_weight]; omega + | zero => + intro V hV; injection hV with hV; subst hV + exact ⟨⟨2, [2], rfl, by decide, by decide⟩, by decide⟩ + | zero_zero _ => + intro V hV; cases hV + | zero_one h ih => + rename_i U r' + intro V hV + rcases r' with _ | V' + · cases hV + · simp only [lift_prefix, lift_plus, Option.map, List.singleton_append] at hV + injection hV with hV; subst hV + obtain ⟨_, hp⟩ := ih rfl + refine ⟨⟨2, first_plus 2 V', rfl, by decide, by decide⟩, ?_⟩ + simp only [Pplus, label_weight] + have hb := Pplus_first_plus_bound V' 2 + (try omega) + | zero_two h ih => + rename_i U r' + intro V hV + rcases r' with _ | V' + · cases hV + · simp only [lift_prefix, Option.map] at hV + injection hV with hV; subst hV + obtain ⟨_, hp⟩ := ih rfl + refine ⟨⟨2, 0 :: V', rfl, by decide, by decide⟩, ?_⟩ + simp only [Pplus, label_weight, List.cons_append, List.nil_append]; omega + | zero_large g h ih => + rename_i U r' + intro V hV + rcases r' with _ | V' + · cases hV + · simp only [lift_prefix, lift_plus, Option.map, List.singleton_append] at hV + injection hV with hV; subst hV + obtain ⟨_, hp⟩ := ih rfl + refine ⟨⟨2, first_plus 1 V', rfl, by decide, by decide⟩, ?_⟩ + simp only [Pplus, label_weight] at hp ⊢ + have hb1 := Pplus_first_plus_bound V' 1 + (try omega) +theorem Eval_exists_aux (p : Nat) : + ∀ (n : Nat) (W : word), Pplus W = p → W.length = n → ∃ r, Eval W r := by + induction p using Nat.strongRecOn with + | ind p ihp => + intro n + induction n using Nat.strongRecOn with + | ind n ihn => + intro W hp hn + rcases W with _ | ⟨a, U⟩ + · exact ⟨some [1], .nil⟩ + · rcases a with _ | _ | _ | _ | g + · rcases U with _ | ⟨b, U'⟩ + · exact ⟨some [2, 2], .zero⟩ + · rcases b with _ | _ | _ | g' + · exact ⟨none, .zero_zero U'⟩ + · have hlt : Pplus U' < p := by + subst hp; simp only [Pplus, label_weight]; omega + obtain ⟨r, hr⟩ := ihp (Pplus U') hlt U'.length U' rfl rfl + exact ⟨lift_prefix [2] (lift_plus 2 r), .zero_one hr⟩ + · have hlt : Pplus U' < p := by + subst hp; simp only [Pplus, label_weight]; omega + obtain ⟨r, hr⟩ := ihp (Pplus U') hlt U'.length U' rfl rfl + exact ⟨lift_prefix [2, 0] r, .zero_two hr⟩ + · have hlt : Pplus (g' :: U') < p := by + subst hp; simp only [Pplus, label_weight]; omega + obtain ⟨r, hr⟩ := ihp (Pplus (g' :: U')) hlt (g' :: U').length (g' :: U') rfl rfl + exact ⟨lift_prefix [2] (lift_plus 1 r), .zero_large g' hr⟩ + · have hp' : Pplus U = p := by + subst hp; simp [Pplus, label_weight] + have hn' : U.length < n := by + subst hn; simp + obtain ⟨r, hr⟩ := ihn U.length hn' U hp' rfl + exact ⟨lift_plus 4 r, .one hr⟩ + · have hlt : Pplus U < p := by + subst hp; simp only [Pplus, label_weight]; omega + obtain ⟨r, hr⟩ := ihp (Pplus U) hlt U.length U rfl rfl + exact ⟨lift_prefix [2] r, .two hr⟩ + · have hlt : Pplus U < p := by + subst hp; simp only [Pplus, label_weight]; omega + obtain ⟨r1, hr1⟩ := ihp (Pplus U) hlt U.length U rfl rfl + rcases r1 with _ | V + · exact ⟨none, .three_halt hr1⟩ + · have hV : Pplus V ≤ Pplus U := (Eval_success_properties hr1 rfl).2 + have hltV : Pplus V < p := by omega + obtain ⟨r2, hr2⟩ := ihp (Pplus V) hltV V.length V rfl rfl + exact ⟨lift_prefix [3] r2, .three hr1 hr2⟩ + · exact ⟨some (1 :: g :: U), .large g U⟩ + +theorem Eval_exists (W : word) : ∃ r, Eval W r := + Eval_exists_aux (Pplus W) W.length W rfl rfl + +noncomputable def f (W : word) : result := + Classical.choose (Eval_exists W) + +theorem f_spec (W : word) : Eval W (f W) := + Classical.choose_spec (Eval_exists W) + + +theorem Eval_iff_f {W : word} {r : result} : Eval W r ↔ f W = r := + ⟨fun h => Eval_deterministic (f_spec W) h, fun h => h ▸ f_spec W⟩ + +theorem f_nil : f [] = some [1] := Eval_iff_f.mp .nil +theorem f_one (U : word) : f (1 :: U) = lift_plus 4 (f U) := Eval_iff_f.mp (.one (f_spec U)) +theorem f_two (U : word) : f (2 :: U) = lift_prefix [2] (f U) := Eval_iff_f.mp (.two (f_spec U)) +theorem f_three (U : word) : f (3 :: U) = lift_prefix [3] (bind_res (f U) f) := by + apply Eval_iff_f.mp + have h := f_spec U + rcases hU : f U with _ | V + · rw [hU] at h; exact .three_halt h + · rw [hU] at h; exact .three h (f_spec V) +theorem f_large (g : Nat) (U : word) : f ((g + 4) :: U) = some (1 :: g :: U) := Eval_iff_f.mp (.large g U) +theorem f_zero : f [0] = some [2, 2] := Eval_iff_f.mp .zero +theorem f_zero_zero (U : word) : f (0 :: 0 :: U) = none := Eval_iff_f.mp (.zero_zero U) +theorem f_zero_one (U : word) : f (0 :: 1 :: U) = lift_prefix [2] (lift_plus 2 (f U)) := Eval_iff_f.mp (.zero_one (f_spec U)) +theorem f_zero_two (U : word) : f (0 :: 2 :: U) = lift_prefix [2, 0] (f U) := Eval_iff_f.mp (.zero_two (f_spec U)) +theorem f_zero_large (g : Nat) (U : word) : f (0 :: (g + 3) :: U) = lift_prefix [2] (lift_plus 1 (f (g :: U))) := + Eval_iff_f.mp (.zero_large g (f_spec (g :: U))) + +theorem f_success_nonempty {W V : word} (h : f W = some V) : V ≠ [] := by + have he := Eval_iff_f.mpr h + obtain ⟨⟨a, U, rfl, _, _⟩, _⟩ := Eval_success_properties he rfl + intro hnil; cases hnil + +-- ============================================================================ +-- Section 7: Abstract Clock Algebra & Operators (`Row9Algebra.v` + `Row9Operators.v`) +-- ============================================================================ + +def power {α : Type*} (fn : α → α) : Nat → α → α + | 0, x => x + | n + 1, x => fn (power fn n x) + +theorem power_add {α : Type*} (fn : α → α) (a b : Nat) (x : α) : + power fn (a + b) x = power fn a (power fn b x) := by + induction a with + | zero => rw [Nat.zero_add]; rfl + | succ a ih => simp only [Nat.succ_add, power, ih] + +theorem power_succ_r {α : Type*} (fn : α → α) (a : Nat) (x : α) : + power fn (a + 1) x = power fn a (fn x) := by + induction a with + | zero => rfl + | succ a ih => + change fn (power fn (a + 1) x) = fn (power fn a (fn x)) + rw [ih] + +theorem power_commute {α : Type*} (fn gn : α → α) (h : ∀ x, fn (gn x) = gn (fn x)) (n : Nat) (x : α) : + power fn n (gn x) = gn (power fn n x) := by + induction n with + | zero => rfl + | succ n ih => simp only [power, ih, h] + +theorem power_ext {α : Type*} (fn gn : α → α) (h : ∀ x, fn x = gn x) (n : Nat) (x : α) : + power fn n x = power gn n x := by + induction n with + | zero => rfl + | succ n ih => simp only [power, ih, h] + +theorem power_mul {α : Type*} (fn : α → α) (a b : Nat) (x : α) : + power fn (a * b) x = power (fun y => power fn b y) a x := by + induction a with + | zero => rw [Nat.zero_mul]; rfl + | succ a ih => rw [Nat.succ_mul, Nat.add_comm _ b, power_add, ih]; rfl + +theorem power_strict {α : Type*} (fn : Option α → Option α) (h : fn none = none) (n : Nat) : + power fn n none = none := by + induction n with + | zero => rfl + | succ n ih => simp only [power, ih, h] + +theorem power_halt_mono {α : Type*} (fn : Option α → Option α) (h : fn none = none) + {a b : Nat} {x : Option α} (hab : a ≤ b) (ha : power fn a x = none) : + power fn b x = none := by + have hb : b = (b - a) + a := by omega + rw [hb, power_add, ha, power_strict fn h] + +theorem power_injective_none {α : Type*} (fn : Option α → Option α) + (h : ∀ x, fn x = none ↔ x = none) (n : Nat) (x : Option α) : + power fn n x = none ↔ x = none := by + induction n with + | zero => exact Iff.rfl + | succ n ih => simp only [power, h, ih] + +theorem power_product {α : Type*} (fn gn : α → α) (h : ∀ x, fn (gn x) = gn (fn x)) (n : Nat) (x : α) : + power (fun y => fn (gn y)) n x = power fn n (power gn n x) := by + induction n with + | zero => rfl + | succ n ih => simp only [power, ih, power_commute fn gn h] + +def eventually {α : Type*} (fn : Option α → Option α) (x : Option α) : Prop := + ∃ k, power fn k x = none + +theorem eventually_step {α : Type*} (fn : Option α → Option α) (h : fn none = none) (x : Option α) : + eventually fn x ↔ eventually fn (fn x) := by + constructor + · rintro ⟨k, hk⟩ + refine ⟨k, ?_⟩ + rw [← power_succ_r] + exact power_halt_mono fn h (Nat.le_succ k) hk + · rintro ⟨k, hk⟩ + exact ⟨k + 1, by rw [power_succ_r, hk]⟩ + +theorem eventually_rotate {α : Type*} (fn gn : Option α → Option α) + (hf : fn none = none) (hg : gn none = none) (x : Option α) : + eventually (fun y => fn (gn y)) x ↔ eventually (fun y => gn (fn y)) (gn x) := by + have hC : ∀ k y, power (fun z => gn (fn z)) k (gn y) = gn (power (fun z => fn (gn z)) k y) := by + intro k; induction k with + | zero => intro y; rfl + | succ k ih => intro y; simp only [power, ih] + have hD : ∀ k y, power (fun z => fn (gn z)) k (fn y) = fn (power (fun z => gn (fn z)) k y) := by + intro k; induction k with + | zero => intro y; rfl + | succ k ih => intro y; simp only [power, ih] + constructor + · rintro ⟨k, hk⟩ + exact ⟨k, by rw [hC, hk, hg]⟩ + · rintro ⟨k, hk⟩ + exact ⟨k + 1, by rw [power_succ_r, hD, hk, hf]⟩ + +noncomputable def opF (x : result) : result := bind_res x f +def pfx (d : Nat) (x : result) : result := Option.map (d :: ·) x +def Q : result → result := pfx 2 +def Z : result → result := pfx 0 +noncomputable def G (x : result) : result := Option.map List.tail (opF (Z x)) +noncomputable def T (n : Nat) (x : result) : result := Z (power opF n x) +noncomputable def H (n : Nat) (x : result) : result := G (power opF n x) +def P (n : Nat) (x : result) : result := Z (power Q n x) +def K (n : Nat) (x : result) : Prop := eventually (H n) x + +theorem opF_none : opF none = none := rfl +theorem G_none : G none = none := rfl + +theorem pfx_none (d : Nat) (x : result) : pfx d x = none ↔ x = none := by + cases x <;> simp [pfx] + +theorem Q_none (x : result) : Q x = none ↔ x = none := pfx_none 2 x +theorem Z_none (x : result) : Z x = none ↔ x = none := pfx_none 0 x + +theorem opF_Q (x : result) : opF (Q x) = Q (opF x) := by + rcases x with _ | U; · rfl + simp only [opF, Q, pfx, bind_res, Option.map, f_two] + cases f U <;> rfl + +theorem f_zero_head_eq (U : word) : f (0 :: U) = Q (Option.map List.tail (f (0 :: U))) := by + rcases U with _ | ⟨a, U'⟩ + · rw [f_zero]; rfl + · rcases a with _ | _ | _ | a' + · rw [f_zero_zero]; rfl + · rw [f_zero_one]; cases f U' <;> rfl + · rw [f_zero_two]; cases f U' <;> rfl + · rw [f_zero_large]; cases f (a' :: U') <;> rfl + +theorem opF_Z (x : result) : opF (Z x) = Q (G x) := by + rcases x with _ | U; · rfl + exact f_zero_head_eq U + +theorem G_Q (x : result) : G (Q x) = Z (opF x) := by + rcases x with _ | U; · rfl + simp only [G, opF, Z, Q, pfx, bind_res, Option.map, f_zero_two] + cases f U <;> rfl + +theorem G_nine (U : word) : G (some (9 :: U)) = some (2 :: 2 :: U) := by + unfold G opF Z pfx bind_res + simp only [Option.map] + have h9 : (9 : Nat) = 6 + 3 := rfl + rw [h9, f_zero_large] + have h6 : (6 : Nat) = 2 + 4 := rfl + rw [h6, f_large] + rfl + +theorem opF_three (x : result) : opF (pfx 3 x) = pfx 3 (opF (opF x)) := by + rcases x with _ | U; · rfl + simp only [opF, pfx, bind_res, Option.map, f_three] + cases f U <;> rfl + +theorem G_three (x : result) : G (pfx 3 x) = pfx 3 (G x) := by + rcases x with _ | U; · rfl + unfold G opF Z pfx bind_res + simp only [Option.map] + have h3 : (3 : Nat) = 0 + 3 := rfl + rw [h3, f_zero_large] + have hfz := f_zero_head_eq U + rcases hfu : f (0 :: U) with _ | V + · rfl + · rw [hfu] at hfz + rcases V with _ | ⟨a, V'⟩ + · cases hfz + · simp only [Q, pfx, Option.map] at hfz + injection hfz with hfz + injection hfz with ha _ + subst ha + rfl + +theorem opF_power_Q (n : Nat) (x : result) : power opF n (Q x) = Q (power opF n x) := + power_commute opF Q opF_Q n x + +theorem opF_power_Z (n : Nat) (x : result) : power opF (n + 1) (Z x) = Q (power opF n (G x)) := by + rw [power_succ_r, opF_Z, opF_power_Q] + +theorem H_Q (n : Nat) (x : result) : H n (Q x) = T n (opF x) := by + unfold H T + rw [opF_power_Q, G_Q, ← power_succ_r] + rfl + +theorem H_T (n : Nat) (x : result) (hn : 1 ≤ n) : H n (T n x) = T n (H n x) := by + rcases n with _ | m; · omega + unfold H T + rw [opF_power_Z, G_Q] + rfl + +theorem H_strict (n : Nat) : H n none = none := by + unfold H; rw [power_strict opF opF_none]; rfl + +theorem T_strict (n : Nat) : T n none = none := by + unfold T; rw [power_strict opF opF_none]; rfl + +theorem P_none (n : Nat) (x : result) : P n x = none ↔ x = none := by + unfold P; rw [Z_none]; exact power_injective_none Q Q_none n x + +theorem opF_Q_power (k : Nat) (x : result) : opF (power Q k x) = power Q k (opF x) := + (power_commute Q opF (fun y => (opF_Q y).symm) k x).symm + +theorem transport (j : Nat) : + ∀ (l : Nat) (x : result), + power opF j (Z (power Q (j + l) x)) = power Q j (Z (power Q l (power opF j x))) := by + induction j with + | zero => intro l x; rw [Nat.zero_add]; rfl + | succ j ih => + intro l x + rw [Nat.succ_add] + change power opF (j + 1) (Z (Q (power Q (j + l) x))) = Q (power Q j (Z (power Q l (power opF (j + 1) x)))) + rw [opF_power_Z, G_Q, opF_Q_power, ih, ← power_succ_r] + +theorem H_P (n : Nat) (x : result) (hn : 1 ≤ n) : H n (P n x) = P n (H n x) := by + unfold H P + have htr := transport n 0 x + rw [Nat.add_zero] at htr + rw [htr] + simp only [power] + rcases n with _ | m; · omega + simp only [power] + rw [G_Q, opF_Q_power, opF_Z, power_commute Q Q (fun _ => rfl) m] + +theorem bounded_factor (n : Nat) (hn : 1 ≤ n) (j : Nat) : + ∀ (x : result), j ≤ n → + power (T n) (j + 1) x = Z (power Q j (power opF (n - j) (power (H n) j x))) := by + induction j with + | zero => + intro x _; simp only [power, Nat.sub_zero]; rfl + | succ j ih => + intro x hj + rw [power_succ_r, ih (T n x) (by omega)] + rw [power_commute (H n) (T n) (fun y => H_T n y hn)] + unfold T + have hsub : n - j = (n - (j + 1)) + 1 := by omega + rw [hsub, opF_power_Z, ← power_succ_r] + rfl + +theorem T_factor (n : Nat) (x : result) (hn : 1 ≤ n) : + power (T n) (n + 1) x = P n (power (H n) n x) := by + rw [bounded_factor n hn n x (Nat.le_refl n)] + unfold P + rw [Nat.sub_self] + rfl + +theorem T_cofinal_factor (n k : Nat) (x : result) (hn : 1 ≤ n) : + power (T n) (k * (n + 1)) x = power (P n) k (power (H n) (k * n) x) := by + rw [power_mul, power_mul] + rw [power_ext (fun y => power (T n) (n + 1) y) (fun y => P n (power (H n) n y)) (fun y => T_factor n y hn)] + refine power_product (P n) (fun y => power (H n) n y) ?_ k x + intro y + exact (power_commute (H n) (P n) (fun z => H_P n z hn) n y).symm + +theorem K_T_equiv (n : Nat) (x : result) (hn : 1 ≤ n) : + eventually (T n) x ↔ K n x := by + unfold K + constructor + · rintro ⟨k, hk⟩ + have hD : power (T n) (k * (n + 1)) x = none := + power_halt_mono (T n) (T_strict n) (by exact Nat.le_mul_of_pos_right k (by omega)) hk + rw [T_cofinal_factor n k x hn] at hD + have hH := (power_injective_none (P n) (P_none n) k _).mp hD + exact ⟨k * n, hH⟩ + · rintro ⟨k, hk⟩ + refine ⟨k * (n + 1), ?_⟩ + rw [T_cofinal_factor n k x hn] + have hD : power (H n) (k * n) x = none := + power_halt_mono (H n) (H_strict n) (by exact Nat.le_mul_of_pos_right k hn) hk + rw [hD] + exact power_strict (P n) ((P_none n none).mpr rfl) k + +theorem H_Q_power (n k : Nat) (x : result) (hn : 1 ≤ n) : + power (H n) (k + 1) (Q x) = T n (power (H n) k (opF x)) := by + rw [power_succ_r, H_Q] + exact power_commute (H n) (T n) (fun y => H_T n y hn) k (opF x) + +theorem T_halt_G (n : Nat) (x : result) (h : T n x = none) : H n x = none := by + unfold T H at * + have hz := (Z_none _).mp h + rw [hz]; rfl + +theorem Q_index_nonincrease (n k : Nat) (x : result) (hn : 1 ≤ n) + (h : power (H n) k (Q x) = none) : power (H n) k (opF x) = none := by + rcases k with _ | k + · simp only [power] at h ⊢ + rw [(Q_none x).mp h]; rfl + · rw [H_Q_power n k x hn] at h + exact T_halt_G n _ h + +theorem H_Z (n : Nat) (x : result) (hn : 1 ≤ n) : H n (Z x) = T n (G x) := by + rcases n with _ | m; · omega + unfold H T + rw [opF_power_Z, G_Q] + rfl + +theorem H_Z_power (n k : Nat) (x : result) (hn : 1 ≤ n) : + power (H n) (k + 1) (Z x) = T n (power (H n) k (G x)) := by + rw [power_succ_r, H_Z n x hn] + exact power_commute (H n) (T n) (fun y => H_T n y hn) k (G x) + +theorem K_Z (n : Nat) (x : result) (hn : 1 ≤ n) : + K n (Z x) ↔ K n (G x) := by + unfold K eventually + constructor + · rintro ⟨k, hk⟩ + rcases k with _ | k + · simp only [power] at hk + rw [(Z_none x).mp hk] + exact ⟨0, rfl⟩ + · rw [H_Z_power n k x hn] at hk + exact ⟨k + 1, T_halt_G n _ hk⟩ + · rintro ⟨k, hk⟩ + refine ⟨k + 1, ?_⟩ + rw [H_Z_power n k x hn, hk, T_strict] + +theorem K_H (n : Nat) (x : result) : K n x ↔ K n (H n x) := + eventually_step (H n) (H_strict n) x + +theorem K_T (n : Nat) (x : result) (hn : 1 ≤ n) : K n x ↔ K n (T n x) := by + rw [← K_T_equiv n x hn, ← K_T_equiv n (T n x) hn] + exact eventually_step (T n) (T_strict n) x + +theorem opF_power_three (n : Nat) (x : result) : + power opF n (pfx 3 x) = pfx 3 (power opF (2 * n) x) := by + induction n with + | zero => rfl + | succ n ih => + simp only [power, ih, opF_three] + have h2 : 2 * (n + 1) = (2 * n) + 1 + 1 := by omega + rw [h2]; rfl + +theorem H_three (n : Nat) (x : result) : H n (pfx 3 x) = pfx 3 (H (2 * n) x) := by + unfold H; rw [opF_power_three, G_three] + +theorem H_power_three (n k : Nat) (x : result) : + power (H n) k (pfx 3 x) = pfx 3 (power (H (2 * n)) k x) := by + induction k with + | zero => rfl + | succ k ih => simp only [power, ih, H_three] + +theorem K_three (n : Nat) (x : result) : K n (pfx 3 x) ↔ K (2 * n) x := by + unfold K eventually + constructor <;> rintro ⟨k, hk⟩ <;> refine ⟨k, ?_⟩ + · rw [H_power_three] at hk; exact (pfx_none 3 _).mp hk + · rw [H_power_three, hk]; rfl + +-- ============================================================================ +-- Section 8: Binary Prefix Rules & Four Clock (`Row9Binary.v` + `Row9Four.v`) +-- ============================================================================ + +def opD (x : result) : result := lift_plus 4 x +def L1 (x : result) : result := pfx 1 x + +theorem acc_F_valid (x : result) : opF x ≠ some [] := by + rcases x with _ | w; · intro h; cases h + exact fun h => f_success_nonempty h rfl + +theorem acc_power_valid (n : Nat) {x : result} (hx : x ≠ some []) : power opF n x ≠ some [] := by + cases n with + | zero => exact hx + | succ n => exact acc_F_valid _ + +theorem acc_F_D {x : result} (hx : x ≠ some []) : opF (opD x) = L1 x := by + rcases x with _ | ⟨_ | ⟨a, u⟩⟩ + · rfl + · exact False.elim (hx rfl) + · exact f_large a u + +theorem acc_F_L (x : result) : opF (L1 x) = opD (opF x) := by + rcases x with _ | w; · rfl + exact f_one w + +theorem acc_D_even (n : Nat) {x : result} (hx : x ≠ some []) : + power opF (2 * n) (opD x) = opD (power opF n x) := by + induction n with + | zero => rfl + | succ n ih => + have h2 : 2 * (n + 1) = (2 * n) + 1 + 1 := by omega + rw [h2] + simp only [power] + rw [ih, acc_F_D (acc_power_valid n hx), acc_F_L] + +theorem acc_D_odd (n : Nat) {x : result} (hx : x ≠ some []) : + power opF (2 * n + 1) (opD x) = L1 (power opF n x) := by + simp only [power] + rw [acc_D_even n hx, acc_F_D (acc_power_valid n hx)] + +theorem acc_L_even (n : Nat) (x : result) : + power opF (2 * n) (L1 x) = L1 (power opF n x) := by + induction n with + | zero => rfl + | succ n ih => + have h2 : 2 * (n + 1) = (2 * n) + 1 + 1 := by omega + rw [h2] + simp only [power] + rw [ih, acc_F_L, acc_F_D (acc_F_valid _)] + +theorem acc_L_odd (n : Nat) (x : result) : + power opF (2 * n + 1) (L1 x) = opD (power opF (n + 1) x) := by + simp only [power] + rw [acc_L_even, acc_F_L] + +theorem acc_power_two (n : Nat) (x : result) : + power opF n (pfx 2 x) = pfx 2 (power opF n x) := opF_power_Q n x + +theorem acc_power_three (n : Nat) (x : result) : + power opF n (pfx 3 x) = pfx 3 (power opF (2 * n) x) := opF_power_three n x + +theorem four_G_one (x : result) : G (pfx 1 x) = lift_plus 2 (opF x) := by + rcases x with _ | U; · rfl + unfold G opF Z pfx bind_res + simp only [Option.map, f_zero_one] + cases f U <;> rfl + +theorem four_G_six (x : result) : G (pfx 6 x) = pfx 4 (opF (opF x)) := by + rcases x with _ | U; · rfl + unfold G opF Z pfx + simp only [Option.map, bind_res] + have h6 : (6 : Nat) = 3 + 3 := rfl + rw [h6, f_zero_large, f_three] + simp only [bind_res, lift_prefix, lift_plus, first_plus, Option.map] + rcases f U with _ | V + · rfl + · dsimp -failIfUnchanged only + rcases f V with _ | W <;> rfl + +theorem four_prefix_D_Z (x : result) : pfx 4 x = opD (Z x) := by + cases x <;> rfl + +theorem four_D_Q (x : result) : opD (Q x) = pfx 6 x := by + cases x <;> rfl + +theorem four_plus_Q (x : result) : lift_plus 2 (Q x) = pfx 4 x := by + cases x <;> rfl + +theorem H_four_even (m : Nat) (x : result) (hm : 1 ≤ m) : + H (2 * m) (pfx 4 x) = pfx 4 (power opF (m + 1) (G x)) := by + unfold H + rw [four_prefix_D_Z, acc_D_even m (by cases x <;> intro h <;> cases h)] + rcases m with _ | m'; · omega + rw [opF_power_Z, four_D_Q, four_G_six] + rfl + +theorem H_four_odd (m : Nat) (x : result) (hm : 1 ≤ m) : + H (2 * m + 1) (pfx 4 x) = pfx 4 (power opF m (G x)) := by + unfold H + rw [four_prefix_D_Z, acc_D_odd m (by cases x <;> intro h <;> cases h)] + rcases m with _ | m'; · omega + rw [opF_power_Z] + unfold L1 + rw [four_G_one, opF_Q, four_plus_Q] + rfl + +theorem H_four_one (x : result) : H 1 (pfx 4 x) = pfx 4 (G x) := by + unfold H + rw [four_prefix_D_Z] + have h1 : (1 : Nat) = 2 * 0 + 1 := rfl + rw [h1, acc_D_odd 0 (by cases x <;> intro h <;> cases h)] + simp only [power] + unfold L1 + rw [four_G_one, opF_Z, four_plus_Q] + +theorem K_four_transfer (n e : Nat) (x : result) + (hE : ∀ y, H n (pfx 4 y) = pfx 4 (power opF e (G y))) : + K n (pfx 4 x) ↔ K e (G x) := by + have hC : ∀ k y, power (H n) k (pfx 4 y) = pfx 4 (power (fun z => power opF e (G z)) k y) := by + intro k; induction k with + | zero => intro y; rfl + | succ k ih => intro y; simp only [power, ih, hE] + have hB : K n (pfx 4 x) ↔ eventually (fun z => power opF e (G z)) x := by + unfold K eventually + constructor <;> rintro ⟨k, hk⟩ <;> refine ⟨k, ?_⟩ + · rw [hC] at hk; exact (pfx_none 4 _).mp hk + · rw [hC, hk]; rfl + rw [hB] + unfold K H + exact eventually_rotate (power opF e) G (power_strict opF opF_none e) G_none x + +def four_clock (n : Nat) : Nat := + if n % 2 == 0 then n / 2 + 1 else (n - 1) / 2 + +theorem four_clock_even (m : Nat) : four_clock (2 * m) = m + 1 := by + unfold four_clock + have h : ((2 * m) % 2 == 0) = true := by rw [beq_iff_eq]; omega + rw [if_pos h]; omega + +theorem four_clock_odd (m : Nat) : four_clock (2 * m + 1) = m := by + unfold four_clock + have h : ¬ (((2 * m + 1) % 2 == 0) = true) := by rw [beq_iff_eq]; omega + rw [if_neg h]; omega + +theorem H_four (n : Nat) (x : result) (hn : 1 ≤ n) : + H n (pfx 4 x) = pfx 4 (power opF (four_clock n) (G x)) := by + rcases Nat.even_or_odd' n with ⟨m, rfl | rfl⟩ + · rw [four_clock_even]; exact H_four_even m x (by omega) + · rw [four_clock_odd] + rcases m with _ | m' + · exact H_four_one x + · exact H_four_odd (m' + 1) x (by omega) + +theorem K_four (n : Nat) (x : result) (hn : 2 ≤ n) : + K n (pfx 4 x) ↔ K (four_clock n) (G x) := + K_four_transfer n (four_clock n) x (fun y => H_four n y (by omega)) + +-- ============================================================================ +-- Section 9: Binary Gap Numerals & Productive Family (`Row9Numerals.v` + `Row9Family.v`) +-- ============================================================================ + +def numeral_fuel : Nat → Nat → word + | 0, _ => [] + | _, 0 => [] + | fuel + 1, n + 1 => + if (n + 1) % 2 == 1 then 1 :: numeral_fuel fuel ((n + 1) / 2) + else first_plus 4 (numeral_fuel fuel ((n + 1) / 2)) + +def numeral (n : Nat) : word := numeral_fuel n n + +theorem numeral_fuel_eq (f1 : Nat) : + ∀ (f2 n : Nat), n ≤ f1 → n ≤ f2 → numeral_fuel f1 n = numeral_fuel f2 n := by + induction f1 with + | zero => + intro f2 n h1 _ + have hn : n = 0 := by omega + subst hn + cases f2 <;> rfl + | succ f1 ih => + intro f2 n h1 h2 + cases n with + | zero => cases f2 <;> rfl + | succ m => + cases f2 with + | zero => omega + | succ f2 => + simp only [numeral_fuel] + rw [ih f2 ((m + 1) / 2) (by omega) (by omega)] + +theorem numeral_zero : numeral 0 = [] := rfl + +theorem numeral_double (n : Nat) : numeral (2 * n) = first_plus 4 (numeral n) := by + cases n with + | zero => rfl + | succ m => + unfold numeral + have h2 : 2 * (m + 1) = (2 * m + 1) + 1 := by omega + rw [h2] + simp only [numeral_fuel] + have hmod : ¬ (((2 * m + 1 + 1) % 2 == 1) = true) := by + rw [beq_iff_eq]; omega + have hdiv : (2 * m + 1 + 1) / 2 = m + 1 := by omega + rw [if_neg hmod, hdiv] + rw [numeral_fuel_eq (2 * m + 1) (m + 1) (m + 1) (by omega) (by omega)] + rfl + +theorem numeral_odd (n : Nat) : numeral (2 * n + 1) = 1 :: numeral n := by + unfold numeral + simp only [numeral_fuel] + have hmod : ((2 * n + 1) % 2 == 1) = true := by + rw [beq_iff_eq]; omega + have hdiv : (2 * n + 1) / 2 = n := by omega + rw [if_pos hmod, hdiv] + rw [numeral_fuel_eq (2 * n) n n (by omega) (by omega)] + +theorem numeral_nonempty (n : Nat) (hn : 0 < n) : numeral n ≠ [] := by + induction n using Nat.strongRecOn with + | ind n ih => + intro hnil + rcases Nat.even_or_odd' n with ⟨k, rfl | rfl⟩ + · have hk : 0 < k := by omega + rw [numeral_double] at hnil + cases h : numeral k with + | nil => exact ih k (by omega) hk h + | cons a u => simp [first_plus, h] at hnil + · rw [numeral_odd] at hnil + cases hnil + +theorem Eval_numeral_succ (n : Nat) : Eval (numeral n) (some (numeral (n + 1))) := by + induction n using Nat.strongRecOn with + | ind n ih => + rcases n with _ | m + · exact .nil + · rcases Nat.even_or_odd' (m + 1) with ⟨k, hk | hk⟩ + · have hk_pos : 0 < k := by omega + have hne := numeral_nonempty k hk_pos + rw [hk, numeral_double k, numeral_odd k] + cases hnum : numeral k with + | nil => exact False.elim (hne hnum) + | cons a u => + simp only [first_plus] + exact .large a u + · have hsucc : m + 1 + 1 = 2 * (k + 1) := by omega + rw [hsucc, hk, numeral_odd k, numeral_double (k + 1)] + exact .one (ih k (by omega)) + +theorem f_numeral (n : Nat) : f (numeral n) = some (numeral (n + 1)) := + Eval_iff_f.mp (Eval_numeral_succ n) + +theorem opF_numeral (n : Nat) : opF (some (numeral n)) = some (numeral (n + 1)) := + f_numeral n + +theorem power_F_numeral (a n : Nat) : + power opF a (some (numeral n)) = some (numeral (n + a)) := by + induction a with + | zero => rw [Nat.add_zero]; rfl + | succ a ih => + simp only [power, ih, opF_numeral, Nat.add_succ] + +theorem power_F_nil (a : Nat) : power opF a (some []) = some (numeral a) := by + have h := power_F_numeral a 0 + rw [Nat.zero_add] at h + exact h + +theorem numeral_eight_four (n : Nat) : numeral (8 * n + 4) = 9 :: numeral n := by + have h : 8 * n + 4 = 2 * (2 * (2 * n + 1)) := by omega + rw [h, numeral_double, numeral_double, numeral_odd] + rfl + +theorem numeral_boundary (m : Nat) (hm : 2 ≤ m) : + numeral (m + (7 * m - 12)) = 9 :: numeral (m - 2) := by + have h : m + (7 * m - 12) = 8 * (m - 2) + 4 := by omega + rw [h, numeral_eight_four] + +theorem H_numeral_boundary (m : Nat) (hm : 2 ≤ m) : + H (7 * m - 12) (some (numeral m)) = Q (Q (some (numeral (m - 2)))) := by + unfold H + rw [power_F_numeral, numeral_boundary m hm, G_nine] + rfl + +theorem productive_numeric_family_index (m : Nat) (hm : 2 ≤ m) (k : Nat) : + power (H (7 * m - 12)) k (some (numeral m)) ≠ none := by + induction k with + | zero => intro h; cases h + | succ k ih => + intro h + rw [power_succ_r, H_numeral_boundary m hm] at h + have h1 := Q_index_nonincrease (7 * m - 12) k (Q (some (numeral (m - 2)))) (by omega) h + rw [opF_Q, opF_numeral] at h1 + have h2 := Q_index_nonincrease (7 * m - 12) k (some (numeral (m - 2 + 1))) (by omega) h1 + rw [opF_numeral] at h2 + have hm_eq : m - 2 + 1 + 1 = m := by omega + rw [hm_eq] at h2 + exact ih h2 + +theorem productive_numeric_family_boundary (m : Nat) (hm : 2 ≤ m) : + ¬ K (7 * m - 12) (Q (Q (some (numeral (m - 2))))) := by + rintro ⟨k, hk⟩ + apply productive_numeric_family_index m hm (k + 1) + rw [power_succ_r, H_numeral_boundary m hm] + exact hk + +theorem numeral_9070 : numeral 9070 = [5, 1, 1, 5, 1, 5, 1, 13] := rfl + +theorem selected_numeric_endpoint_nonhalting : + ¬ K 63492 (some [2, 2, 5, 1, 1, 5, 1, 5, 1, 13]) := by + have h := productive_numeric_family_boundary 9072 (by decide) + have h1 : 7 * 9072 - 12 = 63492 := rfl + have h2 : 9072 - 2 = 9070 := rfl + rw [h1, h2, numeral_9070] at h + exact h + +-- ============================================================================ +-- Section 10: Fast Binary Prefix Accelerator (`Row9Acceleration.v`) +-- ============================================================================ + +def fast_power : Nat → Nat → word → Option word + | 0, _, _ => none + | _ + 1, 0, w => some w + | fuel + 1, p + 1, [] => some (numeral (p + 1)) + | _ + 1, _ + 1, 0 :: _ => none + | fuel + 1, p + 1, 1 :: u => + if (p + 1) % 2 == 1 then + Option.map (first_plus 4) (fast_power fuel ((p + 1) / 2 + 1) u) + else + Option.map (1 :: ·) (fast_power fuel ((p + 1) / 2) u) + | fuel + 1, p + 1, 2 :: u => + Option.map (2 :: ·) (fast_power fuel (p + 1) u) + | fuel + 1, p + 1, 3 :: u => + Option.map (3 :: ·) (fast_power fuel (2 * (p + 1)) u) + | fuel + 1, p + 1, (g + 4) :: u => + if (p + 1) % 2 == 1 then + Option.map (1 :: ·) (fast_power fuel ((p + 1) / 2) (g :: u)) + else + Option.map (first_plus 4) (fast_power fuel ((p + 1) / 2) (g :: u)) + +def checked_f : Nat → Nat → word → Option result + | _, 0, _ => none + | accel, fuel + 1, w => + match fast_power accel 1 w with + | some v => some (some v) + | none => + match w with + | [] => some (some [1]) + | 1 :: u => Option.map (lift_plus 4) (checked_f accel fuel u) + | 2 :: u => Option.map (lift_prefix [2]) (checked_f accel fuel u) + | 3 :: u => + match checked_f accel fuel u with + | none => none + | some none => some none + | some (some v) => Option.map (lift_prefix [3]) (checked_f accel fuel v) + | (g + 4) :: u => some (some (1 :: g :: u)) + | [0] => some (some [2, 2]) + | 0 :: 0 :: _ => some none + | 0 :: 1 :: u => Option.map (fun r => lift_prefix [2] (lift_plus 2 r)) (checked_f accel fuel u) + | 0 :: 2 :: u => Option.map (lift_prefix [2, 0]) (checked_f accel fuel u) + | 0 :: (g + 3) :: u => Option.map (fun r => lift_prefix [2] (lift_plus 1 r)) (checked_f accel fuel (g :: u)) + +theorem acc_D_binary (n : Nat) {x : result} (hx : x ≠ some []) : + power opF n (opD x) = + if n % 2 == 1 then L1 (power opF (n / 2) x) + else opD (power opF (n / 2) x) := by + rcases Nat.even_or_odd' n with ⟨k, rfl | rfl⟩ + · have hmod : ¬ (((2 * k) % 2 == 1) = true) := by rw [beq_iff_eq]; omega + have hdiv : (2 * k) / 2 = k := by omega + rw [if_neg hmod, hdiv] + exact acc_D_even k hx + · have hmod : ((2 * k + 1) % 2 == 1) = true := by rw [beq_iff_eq]; omega + have hdiv : (2 * k + 1) / 2 = k := by omega + rw [if_pos hmod, hdiv] + exact acc_D_odd k hx + +theorem acc_L_binary (n : Nat) (x : result) : + power opF n (L1 x) = + if n % 2 == 1 then opD (power opF (n / 2 + 1) x) + else L1 (power opF (n / 2) x) := by + rcases Nat.even_or_odd' n with ⟨k, rfl | rfl⟩ + · have hmod : ¬ (((2 * k) % 2 == 1) = true) := by rw [beq_iff_eq]; omega + have hdiv : (2 * k) / 2 = k := by omega + rw [if_neg hmod, hdiv] + exact acc_L_even k x + · have hmod : ((2 * k + 1) % 2 == 1) = true := by rw [beq_iff_eq]; omega + have hdiv : (2 * k + 1) / 2 = k := by omega + rw [if_pos hmod, hdiv] + exact acc_L_odd k x + +theorem fast_power_sound (fuel : Nat) : + ∀ (p : Nat) (w v : word), fast_power fuel p w = some v → power opF p (some w) = some v := by + induction fuel with + | zero => intro p w v h; cases h + | succ fuel ih => + intro p w v h + rcases p with _ | p + · simp only [fast_power] at h; injection h with h; subst h; rfl + · rcases w with _ | ⟨g, u⟩ + · simp only [fast_power] at h; injection h with h; subst h + exact power_F_nil (p + 1) + · rcases g with _ | _ | _ | _ | g' + · simp only [fast_power] at h; cases h + · simp only [fast_power] at h + change power opF (p + 1) (L1 (some u)) = some v + rw [acc_L_binary] + split at h <;> rename_i hcond + · rcases hfp : fast_power fuel ((p + 1) / 2 + 1) u with _ | a + · rw [hfp] at h; cases h + · rw [hfp] at h; simp only [Option.map] at h; injection h with h; subst h + rw [if_pos hcond, ih _ _ _ hfp]; rfl + · rcases hfp : fast_power fuel ((p + 1) / 2) u with _ | a + · rw [hfp] at h; cases h + · rw [hfp] at h; simp only [Option.map] at h; injection h with h; subst h + rw [if_neg hcond, ih _ _ _ hfp]; rfl + · simp only [fast_power] at h + change power opF (p + 1) (pfx 2 (some u)) = some v + rw [acc_power_two] + rcases hfp : fast_power fuel (p + 1) u with _ | a + · rw [hfp] at h; cases h + · rw [hfp] at h; simp only [Option.map] at h; injection h with h; subst h + rw [ih _ _ _ hfp]; rfl + · simp only [fast_power] at h + change power opF (p + 1) (pfx 3 (some u)) = some v + rw [acc_power_three] + rcases hfp : fast_power fuel (2 * (p + 1)) u with _ | a + · rw [hfp] at h; cases h + · rw [hfp] at h; simp only [Option.map] at h; injection h with h; subst h + rw [ih _ _ _ hfp]; rfl + · simp only [fast_power] at h + change power opF (p + 1) (opD (some (g' :: u))) = some v + rw [acc_D_binary (p + 1) (by intro hc; cases hc)] + split at h <;> rename_i hcond + · rcases hfp : fast_power fuel ((p + 1) / 2) (g' :: u) with _ | a + · rw [hfp] at h; cases h + · rw [hfp] at h; simp only [Option.map] at h; injection h with h; subst h + rw [if_pos hcond, ih _ _ _ hfp]; rfl + · rcases hfp : fast_power fuel ((p + 1) / 2) (g' :: u) with _ | a + · rw [hfp] at h; cases h + · rw [hfp] at h; simp only [Option.map] at h; injection h with h; subst h + rw [if_neg hcond, ih _ _ _ hfp]; rfl + +theorem checked_f_sound (accel fuel : Nat) : + ∀ (w : word) (r : result), checked_f accel fuel w = some r → f w = r := by + induction fuel with + | zero => intro w r h; cases h + | succ fuel ih => + intro w r h + unfold checked_f at h + rcases hfp : fast_power accel 1 w with _ | v + · rw [hfp] at h + rcases w with _ | ⟨g, u⟩ + · dsimp -failIfUnchanged only at h; injection h with h; subst h; exact f_nil + · rcases g with _ | _ | _ | _ | g' + · rcases u with _ | ⟨b, u'⟩ + · dsimp -failIfUnchanged only at h; injection h with h; subst h; exact f_zero + · rcases b with _ | _ | _ | b' + · dsimp -failIfUnchanged only at h; injection h with h; subst h; exact f_zero_zero u' + · dsimp -failIfUnchanged only at h + rcases hcf : checked_f accel fuel u' with _ | a + · rw [hcf] at h; cases h + · rw [hcf] at h; simp only [Option.map] at h; injection h with h; subst h + rw [f_zero_one, ih _ _ hcf] + · dsimp -failIfUnchanged only at h + rcases hcf : checked_f accel fuel u' with _ | a + · rw [hcf] at h; cases h + · rw [hcf] at h; simp only [Option.map] at h; injection h with h; subst h + rw [f_zero_two, ih _ _ hcf] + · dsimp -failIfUnchanged only at h + rcases hcf : checked_f accel fuel (b' :: u') with _ | a + · rw [hcf] at h; cases h + · rw [hcf] at h; simp only [Option.map] at h; injection h with h; subst h + rw [f_zero_large, ih _ _ hcf] + · dsimp -failIfUnchanged only at h + rcases hcf : checked_f accel fuel u with _ | a + · rw [hcf] at h; cases h + · rw [hcf] at h; simp only [Option.map] at h; injection h with h; subst h + rw [f_one, ih _ _ hcf] + · dsimp -failIfUnchanged only at h + rcases hcf : checked_f accel fuel u with _ | a + · rw [hcf] at h; cases h + · rw [hcf] at h; simp only [Option.map] at h; injection h with h; subst h + rw [f_two, ih _ _ hcf] + · dsimp -failIfUnchanged only at h + rcases hcf : checked_f accel fuel u with _ | ⟨_ | a⟩ + · rw [hcf] at h; cases h + · rw [hcf] at h; injection h with h; subst h + rw [f_three, ih _ _ hcf]; rfl + · rw [hcf] at h; dsimp -failIfUnchanged only at h + rcases hcf2 : checked_f accel fuel a with _ | b + · rw [hcf2] at h; cases h + · rw [hcf2] at h; simp only [Option.map] at h; injection h with h; subst h + rw [f_three, ih _ _ hcf] + simp only [bind_res] + rw [ih _ _ hcf2] + · dsimp -failIfUnchanged only at h; injection h with h; subst h; exact f_large g' u + · rw [hfp] at h + dsimp -failIfUnchanged only at h + injection h with h; subst h + exact fast_power_sound accel 1 w v hfp + +theorem row9_cert_G {u v : word} (h : f (0 :: u) = some (2 :: v)) : G (some u) = some v := by + unfold G opF Z pfx bind_res + simp only [Option.map, h, List.tail_cons] + +theorem row9_cert_T {u a b v : word} + (h0 : f u = some a) (h1 : f a = some b) (h2 : f b = some v) : + T 3 (some u) = some (0 :: v) := by + unfold T + simp only [power, opF, bind_res, h0, h1, h2, Z, pfx, Option.map] + +theorem row9_cert_H {u a b c v : word} + (h0 : f u = some a) (h1 : f a = some b) (h2 : f b = some c) (h3 : f (0 :: c) = some (2 :: v)) : + H 3 (some u) = some v := by + unfold H + simp only [power, opF, bind_res, h0, h1, h2] + exact row9_cert_G h3 + +theorem step_edge_T {u a b v : word} + (h0 : f u = some a) (h1 : f a = some b) (h2 : f b = some v) : + K 3 (some u) ↔ K 3 (some (0 :: v)) := by + rw [K_T 3 (some u) (by decide), row9_cert_T h0 h1 h2] + +theorem step_edge_H {u a b c v : word} + (h0 : f u = some a) (h1 : f a = some b) (h2 : f b = some c) (h3 : f (0 :: c) = some (2 :: v)) : + K 3 (some u) ↔ K 3 (some v) := by + rw [K_H 3 (some u), row9_cert_H h0 h1 h2 h3] + +theorem step_normal_Z {n : Nat} {u v : word} (hn : 1 ≤ n) (h : f (0 :: u) = some (2 :: v)) : + K n (some (0 :: u)) ↔ K n (some v) := by + change K n (Z (some u)) ↔ K n (some v) + rw [K_Z n (some u) hn, row9_cert_G h] + +theorem step_normal_three {n m : Nat} {u : word} (hm : 2 * n = m) : + K n (some (3 :: u)) ↔ K m (some u) := by + subst hm; exact K_three n (some u) + +theorem step_normal_four {n m : Nat} {u v : word} (hn : 2 ≤ n) (hm : four_clock n = m) + (h : f (0 :: u) = some (2 :: v)) : + K n (some (4 :: u)) ↔ K m (some v) := by + subst hm + change K n (pfx 4 (some u)) ↔ K (four_clock n) (some v) + rw [K_four n (some u) hn, row9_cert_G h] + +-- ============================================================================ +-- Section 11: 222 Certificate Calls (`Row9CertificateCalls.v`) +-- ============================================================================ + +theorem row9_f_0 : f [] = some [1] := checked_f_sound 256 128 [] (some [1]) rfl +theorem row9_f_1 : f [1] = some [5] := checked_f_sound 256 128 [1] (some [5]) rfl +theorem row9_f_2 : f [5] = some [1, 1] := checked_f_sound 256 128 [5] (some [1, 1]) rfl +theorem row9_f_3 : f [0, 1, 1] = some [2, 7] := checked_f_sound 256 128 [0, 1, 1] (some [2, 7]) rfl +theorem row9_f_8 : f [2, 7] = some [2, 1, 3] := checked_f_sound 256 128 [2, 7] (some [2, 1, 3]) rfl +theorem row9_f_9 : f [2, 1, 3] = some [2, 7, 5] := checked_f_sound 256 128 [2, 1, 3] (some [2, 7, 5]) rfl +theorem row9_f_10 : f [0, 2, 7, 5] = some [2, 0, 1, 3, 5] := checked_f_sound 256 128 [0, 2, 7, 5] (some [2, 0, 1, 3, 5]) rfl +theorem row9_f_22 : f [2, 0, 1, 3, 5] = some [2, 2, 5, 9] := checked_f_sound 256 128 [2, 0, 1, 3, 5] (some [2, 2, 5, 9]) rfl +theorem row9_f_23 : f [2, 2, 5, 9] = some [2, 2, 1, 1, 9] := checked_f_sound 256 128 [2, 2, 5, 9] (some [2, 2, 1, 1, 9]) rfl +theorem row9_f_24 : f [0, 2, 2, 1, 1, 9] = some [2, 0, 2, 9, 5] := checked_f_sound 256 128 [0, 2, 2, 1, 1, 9] (some [2, 0, 2, 9, 5]) rfl +theorem row9_f_49 : f [2, 0, 2, 9, 5] = some [2, 2, 0, 1, 5, 5] := checked_f_sound 256 128 [2, 0, 2, 9, 5] (some [2, 2, 0, 1, 5, 5]) rfl +theorem row9_f_50 : f [2, 2, 0, 1, 5, 5] = some [2, 2, 2, 3, 1, 5] := checked_f_sound 256 128 [2, 2, 0, 1, 5, 5] (some [2, 2, 2, 3, 1, 5]) rfl +theorem row9_f_52 : f [0, 2, 2, 2, 3, 1, 5] = some [2, 0, 2, 2, 3, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 1, 5] (some [2, 0, 2, 2, 3, 1, 1, 1]) rfl +theorem row9_f_60 : f [0, 2, 2, 3, 1, 1, 1] = some [2, 0, 2, 3, 1, 9] := checked_f_sound 256 128 [0, 2, 2, 3, 1, 1, 1] (some [2, 0, 2, 3, 1, 9]) rfl +theorem row9_f_79 : f [2, 0, 2, 3, 1, 9] = some [2, 2, 0, 3, 1, 1, 5] := checked_f_sound 256 128 [2, 0, 2, 3, 1, 9] (some [2, 2, 0, 3, 1, 1, 5]) rfl +theorem row9_f_80 : f [2, 2, 0, 3, 1, 1, 5] = some [2, 2, 2, 3, 7, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 1, 1, 5] (some [2, 2, 2, 3, 7, 1]) rfl +theorem row9_f_82 : f [0, 2, 2, 2, 3, 7, 1] = some [2, 0, 2, 2, 3, 7, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 7, 1] (some [2, 0, 2, 2, 3, 7, 1, 1]) rfl +theorem row9_f_89 : f [0, 2, 2, 3, 7, 1, 1] = some [2, 0, 2, 3, 7, 1, 5] := checked_f_sound 256 128 [0, 2, 2, 3, 7, 1, 1] (some [2, 0, 2, 3, 7, 1, 5]) rfl +theorem row9_f_111 : f [2, 0, 2, 3, 7, 1, 5] = some [2, 2, 0, 3, 7, 1, 1, 1] := checked_f_sound 256 128 [2, 0, 2, 3, 7, 1, 5] (some [2, 2, 0, 3, 7, 1, 1, 1]) rfl +theorem row9_f_112 : f [2, 2, 0, 3, 7, 1, 1, 1] = some [2, 2, 2, 3, 2, 0, 1, 1, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 7, 1, 1, 1] (some [2, 2, 2, 3, 2, 0, 1, 1, 1]) rfl +theorem row9_f_114 : f [0, 2, 2, 2, 3, 2, 0, 1, 1, 1] = some [2, 0, 2, 2, 3, 2, 2, 1, 7] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 2, 0, 1, 1, 1] (some [2, 0, 2, 2, 3, 2, 2, 1, 7]) rfl +theorem row9_f_125 : f [0, 2, 2, 3, 2, 2, 1, 7] = some [2, 0, 2, 3, 2, 2, 1, 1, 3] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 1, 7] (some [2, 0, 2, 3, 2, 2, 1, 1, 3]) rfl +theorem row9_f_145 : f [2, 0, 2, 3, 2, 2, 1, 1, 3] = some [2, 2, 0, 3, 2, 2, 1, 7, 5] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 1, 1, 3] (some [2, 2, 0, 3, 2, 2, 1, 7, 5]) rfl +theorem row9_f_146 : f [2, 2, 0, 3, 2, 2, 1, 7, 5] = some [2, 2, 2, 3, 0, 2, 5, 3, 5] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 1, 7, 5] (some [2, 2, 2, 3, 0, 2, 5, 3, 5]) rfl +theorem row9_f_148 : f [0, 2, 2, 2, 3, 0, 2, 5, 3, 5] = some [2, 0, 2, 2, 3, 2, 2, 9, 9] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 5, 3, 5] (some [2, 0, 2, 2, 3, 2, 2, 9, 9]) rfl +theorem row9_f_173 : f [0, 2, 2, 3, 2, 2, 9, 9] = some [2, 0, 2, 3, 2, 2, 5, 1, 9] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 9, 9] (some [2, 0, 2, 3, 2, 2, 5, 1, 9]) rfl +theorem row9_f_191 : f [2, 0, 2, 3, 2, 2, 5, 1, 9] = some [2, 2, 0, 3, 2, 2, 13, 5] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 5, 1, 9] (some [2, 2, 0, 3, 2, 2, 13, 5]) rfl +theorem row9_f_192 : f [2, 2, 0, 3, 2, 2, 13, 5] = some [2, 2, 2, 3, 0, 2, 1, 9, 5] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 13, 5] (some [2, 2, 2, 3, 0, 2, 1, 9, 5]) rfl +theorem row9_f_194 : f [0, 2, 2, 2, 3, 0, 2, 1, 9, 5] = some [2, 0, 2, 2, 3, 2, 2, 3, 1, 1, 5] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 1, 9, 5] (some [2, 0, 2, 2, 3, 2, 2, 3, 1, 1, 5]) rfl +theorem row9_f_220 : f [0, 2, 2, 3, 2, 2, 3, 1, 1, 5] = some [2, 0, 2, 3, 2, 2, 3, 1, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 1, 1, 5] (some [2, 0, 2, 3, 2, 2, 3, 1, 1, 1, 1]) rfl +theorem row9_f_238 : f [2, 0, 2, 3, 2, 2, 3, 1, 1, 1, 1] = some [2, 2, 0, 3, 2, 2, 3, 1, 1, 9] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 1, 1, 1, 1] (some [2, 2, 0, 3, 2, 2, 3, 1, 1, 9]) rfl +theorem row9_f_239 : f [2, 2, 0, 3, 2, 2, 3, 1, 1, 9] = some [2, 2, 2, 3, 0, 2, 3, 1, 5, 5] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 1, 1, 9] (some [2, 2, 2, 3, 0, 2, 3, 1, 5, 5]) rfl +theorem row9_f_241 : f [0, 2, 2, 2, 3, 0, 2, 3, 1, 5, 5] = some [2, 0, 2, 2, 3, 2, 2, 3, 11, 1] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 1, 5, 5] (some [2, 0, 2, 2, 3, 2, 2, 3, 11, 1]) rfl +theorem row9_f_278 : f [0, 2, 2, 3, 2, 2, 3, 11, 1] = some [2, 0, 2, 3, 2, 2, 3, 11, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 11, 1] (some [2, 0, 2, 3, 2, 2, 3, 11, 1, 1]) rfl +theorem row9_f_295 : f [2, 0, 2, 3, 2, 2, 3, 11, 1, 1] = some [2, 2, 0, 3, 2, 2, 3, 11, 1, 5] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 11, 1, 1] (some [2, 2, 0, 3, 2, 2, 3, 11, 1, 5]) rfl +theorem row9_f_296 : f [2, 2, 0, 3, 2, 2, 3, 11, 1, 5] = some [2, 2, 2, 3, 0, 2, 3, 5, 3, 1, 5] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 11, 1, 5] (some [2, 2, 2, 3, 0, 2, 3, 5, 3, 1, 5]) rfl +theorem row9_f_298 : f [0, 2, 2, 2, 3, 0, 2, 3, 5, 3, 1, 5] = some [2, 0, 2, 2, 3, 2, 2, 3, 2, 4, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 5, 3, 1, 5] (some [2, 0, 2, 2, 3, 2, 2, 3, 2, 4, 1, 1, 1]) rfl +theorem row9_f_351 : f [0, 2, 2, 3, 2, 2, 3, 2, 4, 1, 1, 1] = some [2, 0, 2, 3, 2, 2, 3, 2, 6, 1, 7] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 2, 4, 1, 1, 1] (some [2, 0, 2, 3, 2, 2, 3, 2, 6, 1, 7]) rfl +theorem row9_f_376 : f [2, 0, 2, 3, 2, 2, 3, 2, 6, 1, 7] = some [2, 2, 0, 3, 2, 2, 3, 2, 6, 1, 1, 3] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 6, 1, 7] (some [2, 2, 0, 3, 2, 2, 3, 2, 6, 1, 1, 3]) rfl +theorem row9_f_377 : f [2, 2, 0, 3, 2, 2, 3, 2, 6, 1, 1, 3] = some [2, 2, 2, 3, 0, 2, 3, 2, 6, 11, 5] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 6, 1, 1, 3] (some [2, 2, 2, 3, 0, 2, 3, 2, 6, 11, 5]) rfl +theorem row9_f_379 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 6, 11, 5] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 1, 2, 1, 7, 5] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 6, 11, 5] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 1, 2, 1, 7, 5]) rfl +theorem row9_f_455 : f [0, 2, 2, 3, 2, 2, 3, 0, 1, 2, 1, 7, 5] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 9] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 1, 2, 1, 7, 5] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 9]) rfl +theorem row9_f_485 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 9] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 9, 1] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 9] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 9, 1]) rfl +theorem row9_f_486 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 9, 1] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 17] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 9, 1] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 17]) rfl +theorem row9_f_488 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 17] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 13, 1] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 17] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 13, 1]) rfl +theorem row9_f_579 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 13, 1] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 14] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 13, 1] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 14]) rfl +theorem row9_f_614 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 14] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 14, 1] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 14] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 14, 1]) rfl +theorem row9_f_615 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 14, 1] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 9, 2, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 14, 1] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 9, 2, 1]) rfl +theorem row9_f_617 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 9, 2, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 9, 2, 5] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 9, 2, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 9, 2, 5]) rfl +theorem row9_f_709 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 9, 2, 5] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 1, 5, 2, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 9, 2, 5] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 1, 5, 2, 1, 1]) rfl +theorem row9_f_779 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 1, 5, 2, 1, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 1, 2, 5, 5] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 1, 5, 2, 1, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 1, 2, 5, 5]) rfl +theorem row9_f_780 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 1, 2, 5, 5] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 1, 2, 5, 1, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 1, 2, 5, 5] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 1, 2, 5, 1, 1]) rfl +theorem row9_f_782 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 1, 2, 5, 1, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 1, 2, 5, 1, 5] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 1, 2, 5, 1, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 1, 2, 5, 1, 5]) rfl +theorem row9_f_874 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 1, 2, 5, 1, 5] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 1, 2, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 1, 2, 5, 1, 5] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 1, 2, 1, 1, 1, 1, 1]) rfl +theorem row9_f_951 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 1, 2, 1, 1, 1, 1, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 5, 1, 2] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 1, 2, 1, 1, 1, 1, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 5, 1, 2]) rfl +theorem row9_f_952 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 5, 1, 2] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 5, 6, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 5, 1, 2] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 5, 6, 1]) rfl +theorem row9_f_954 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 5, 6, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 5, 6, 5] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 5, 6, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 5, 6, 5]) rfl +theorem row9_f_1046 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 5, 6, 5] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 1, 1, 6, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 5, 6, 5] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 1, 1, 6, 1, 1]) rfl +theorem row9_f_1152 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 1, 1, 6, 1, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 1, 9] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 1, 1, 6, 1, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 1, 9]) rfl +theorem row9_f_1153 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 1, 9] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 1, 5, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 1, 9] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 1, 5, 1]) rfl +theorem row9_f_1155 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 1, 5, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 1, 5, 5] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 1, 5, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 1, 5, 5]) rfl +theorem row9_f_1247 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 1, 5, 5] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 5, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 1, 5, 5] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 5, 1, 1, 1]) rfl +theorem row9_f_1370 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 5, 1, 1, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 7, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 5, 1, 1, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 7, 13]) rfl +theorem row9_f_1371 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 7, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 7, 9, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 7, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 7, 9, 1]) rfl +theorem row9_f_1373 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 7, 9, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 7, 9, 5] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 7, 9, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 7, 9, 5]) rfl +theorem row9_f_1465 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 7, 9, 5] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 1, 3, 9, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 7, 9, 5] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 1, 3, 9, 1, 1]) rfl +theorem row9_f_1634 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 1, 3, 9, 1, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 1, 1, 1, 1] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 1, 3, 9, 1, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 1, 1, 1, 1]) rfl +theorem row9_f_1635 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 1, 1, 1, 1] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 1, 1, 1, 5] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 1, 1, 1, 1] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 1, 1, 1, 5]) rfl +theorem row9_f_1637 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 1, 1, 1, 5] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 1, 1, 1, 9] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 1, 1, 1, 5] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 1, 1, 1, 9]) rfl +theorem row9_f_1729 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 1, 1, 1, 9] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 1, 9, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 1, 1, 1, 9] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 1, 9, 1, 1]) rfl +theorem row9_f_1916 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 1, 9, 1, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 11, 5, 1] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 1, 9, 1, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 11, 5, 1]) rfl +theorem row9_f_1917 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 11, 5, 1] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 11, 5, 5] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 11, 5, 1] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 11, 5, 5]) rfl +theorem row9_f_1919 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 11, 5, 5] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 11, 5, 9] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 11, 5, 5] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 11, 5, 9]) rfl +theorem row9_f_2011 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 11, 5, 9] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 5, 3, 5, 5, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 11, 5, 9] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 5, 3, 5, 5, 1]) rfl +theorem row9_f_2235 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 5, 3, 5, 5, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 6, 3, 1, 1, 5] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 5, 3, 5, 5, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 6, 3, 1, 1, 5]) rfl +theorem row9_f_2236 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 6, 3, 1, 1, 5] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 6, 3, 1, 1, 9] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 6, 3, 1, 1, 5] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 6, 3, 1, 1, 9]) rfl +theorem row9_f_2238 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 6, 3, 1, 1, 9] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 6, 3, 1, 1, 13] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 6, 3, 1, 1, 9] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 6, 3, 1, 1, 13]) rfl +theorem row9_f_2330 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 6, 3, 1, 1, 13] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 6, 3, 1, 5, 5, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 6, 3, 1, 1, 13] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 6, 3, 1, 5, 5, 1]) rfl +theorem row9_f_2578 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 6, 3, 1, 5, 5, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 1, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 6, 3, 1, 5, 5, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 1, 13]) rfl +theorem row9_f_2579 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 1, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 1, 17] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 1, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 1, 17]) rfl +theorem row9_f_2581 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 1, 17] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 1, 21] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 1, 17] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 1, 21]) rfl +theorem row9_f_2673 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 1, 21] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 1, 5, 9, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 1, 21] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 1, 5, 9, 1]) rfl +theorem row9_f_2947 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 1, 5, 9, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 1, 1, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 1, 5, 9, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 1, 1, 13]) rfl +theorem row9_f_2948 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 1, 1, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 1, 1, 17] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 1, 1, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 1, 1, 17]) rfl +theorem row9_f_2950 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 1, 1, 17] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 1, 1, 21] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 1, 1, 17] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 1, 1, 21]) rfl +theorem row9_f_3042 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 1, 1, 21] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 1, 1, 5, 9, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 1, 1, 21] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 1, 1, 5, 9, 1]) rfl +theorem row9_f_3323 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 1, 1, 5, 9, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 7, 1, 1, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 1, 1, 5, 9, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 7, 1, 1, 13]) rfl +theorem row9_f_3324 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 7, 1, 1, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 7, 1, 1, 17] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 7, 1, 1, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 7, 1, 1, 17]) rfl +theorem row9_f_3326 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 7, 1, 1, 17] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 7, 1, 1, 21] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 7, 1, 1, 17] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 7, 1, 1, 21]) rfl +theorem row9_f_3418 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 7, 1, 1, 21] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 7, 1, 1, 5, 9, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 7, 1, 1, 21] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 7, 1, 1, 5, 9, 1]) rfl +theorem row9_f_3754 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 7, 1, 1, 5, 9, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 0, 1, 1, 5, 1, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 7, 1, 1, 5, 9, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 0, 1, 1, 5, 1, 13]) rfl +theorem row9_f_3755 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 0, 1, 1, 5, 1, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 1, 3, 1, 21] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 0, 1, 1, 5, 1, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 1, 3, 1, 21]) rfl +theorem row9_f_3757 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 1, 3, 1, 21] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 1, 3, 1, 25] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 1, 3, 1, 21] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 1, 3, 1, 25]) rfl +theorem row9_f_3849 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 1, 3, 1, 25] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 1, 3, 1, 9, 9, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 1, 3, 1, 25] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 1, 3, 1, 9, 9, 1]) rfl +theorem row9_f_4194 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 1, 3, 1, 9, 9, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 7, 1, 1, 5, 1, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 1, 3, 1, 9, 9, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 7, 1, 1, 5, 1, 13]) rfl +theorem row9_f_4195 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 7, 1, 1, 5, 1, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 9, 5, 9, 9] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 7, 1, 1, 5, 1, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 9, 5, 9, 9]) rfl +theorem row9_f_4197 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 9, 5, 9, 9] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 9, 5, 5, 1, 9] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 9, 5, 9, 9] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 9, 5, 5, 1, 9]) rfl +theorem row9_f_4289 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 9, 5, 5, 1, 9] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 9, 1, 1, 13, 5] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 9, 5, 5, 1, 9] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 9, 1, 1, 13, 5]) rfl +theorem row9_f_4656 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 9, 1, 1, 13, 5] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 1, 5, 1, 5, 1, 5, 5] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 9, 1, 1, 13, 5] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 1, 5, 1, 5, 1, 5, 5]) rfl +theorem row9_f_4657 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 1, 5, 1, 5, 1, 5, 5] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 13, 1, 9, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 1, 5, 1, 5, 1, 5, 5] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 13, 1, 9, 1]) rfl +theorem row9_f_4659 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 13, 1, 9, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 13, 1, 17] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 13, 1, 9, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 13, 1, 17]) rfl +theorem row9_f_4751 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 13, 1, 17] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 13, 5, 5, 5] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 13, 1, 17] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 13, 5, 5, 5]) rfl +theorem row9_f_5125 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 13, 5, 5, 5] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 5, 5, 9, 5, 1] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 13, 5, 5, 5] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 5, 5, 9, 5, 1]) rfl +theorem row9_f_5126 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 5, 5, 9, 5, 1] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 1, 5, 9, 5] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 5, 5, 9, 5, 1] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 1, 5, 9, 5]) rfl +theorem row9_f_5128 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 1, 5, 9, 5] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 1, 5, 9, 9] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 1, 5, 9, 5] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 1, 5, 9, 9]) rfl +theorem row9_f_5220 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 1, 5, 9, 9] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 1, 5, 5, 1, 5, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 1, 5, 9, 9] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 1, 5, 5, 1, 5, 1]) rfl +theorem row9_f_5623 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 1, 5, 5, 1, 5, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 1, 1, 1, 5, 5, 9] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 1, 5, 5, 1, 5, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 1, 1, 1, 5, 5, 9]) rfl +theorem row9_f_5624 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 1, 1, 1, 5, 5, 9] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 7, 1, 5, 17] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 1, 1, 1, 5, 5, 9] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 7, 1, 5, 17]) rfl +theorem row9_f_5626 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 7, 1, 5, 17] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 7, 1, 5, 21] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 7, 1, 5, 17] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 7, 1, 5, 21]) rfl +theorem row9_f_5718 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 7, 1, 5, 21] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 7, 1, 5, 5, 9, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 7, 1, 5, 21] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 7, 1, 5, 5, 9, 1]) rfl +theorem row9_f_6135 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 7, 1, 5, 5, 9, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 7, 1, 1, 1, 5, 1, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 7, 1, 5, 5, 9, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 7, 1, 1, 1, 5, 1, 13]) rfl +theorem row9_f_6136 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 7, 1, 1, 1, 5, 1, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 7, 1, 1, 1, 5, 1, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1]) rfl +theorem row9_f_6138 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1]) rfl +theorem row9_f_6230 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 1, 3, 1, 1, 1, 1, 13, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 1, 3, 1, 1, 1, 1, 13, 1]) rfl +theorem row9_f_6676 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 1, 3, 1, 1, 1, 1, 13, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 1, 3, 1, 13, 1, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 1, 3, 1, 1, 1, 1, 13, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 1, 3, 1, 13, 1, 13]) rfl +theorem row9_f_6677 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 1, 3, 1, 13, 1, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 5, 1, 1, 1, 13, 9] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 1, 3, 1, 13, 1, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 5, 1, 1, 1, 13, 9]) rfl +theorem row9_f_6679 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 5, 1, 1, 1, 13, 9] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 5, 1, 1, 1, 9, 1, 9] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 5, 1, 1, 1, 13, 9] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 5, 1, 1, 1, 9, 1, 9]) rfl +theorem row9_f_6771 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 5, 1, 1, 1, 9, 1, 9] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 5, 1, 1, 5, 13, 5] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 5, 1, 1, 1, 9, 1, 9] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 5, 1, 1, 5, 13, 5]) rfl +theorem row9_f_7223 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 5, 1, 1, 5, 13, 5] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 17, 5, 1, 5, 5] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 5, 1, 1, 5, 13, 5] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 17, 5, 1, 5, 5]) rfl +theorem row9_f_7224 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 17, 5, 1, 5, 5] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 5, 1, 9, 9, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 17, 5, 1, 5, 5] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 5, 1, 9, 9, 1]) rfl +theorem row9_f_7226 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 5, 1, 9, 9, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 5, 1, 9, 17] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 5, 1, 9, 9, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 5, 1, 9, 17]) rfl +theorem row9_f_7318 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 5, 1, 9, 17] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 5, 1, 13, 5, 5] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 5, 1, 9, 17] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 5, 1, 13, 5, 5]) rfl +theorem row9_f_7791 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 5, 1, 13, 5, 5] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 5, 5, 13, 5, 1] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 5, 1, 13, 5, 5] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 5, 5, 13, 5, 1]) rfl +theorem row9_f_7792 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 5, 5, 13, 5, 1] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 5, 1, 17, 5] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 5, 5, 13, 5, 1] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 5, 1, 17, 5]) rfl +theorem row9_f_7794 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 5, 1, 17, 5] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 5, 1, 17, 9] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 5, 1, 17, 5] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 5, 1, 17, 9]) rfl +theorem row9_f_7886 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 5, 1, 17, 9] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 5, 1, 13, 1, 5, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 5, 1, 17, 9] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 5, 1, 13, 1, 5, 1]) rfl +theorem row9_f_8365 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 5, 1, 13, 1, 5, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 5, 1, 1, 9, 5, 9] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 5, 1, 13, 1, 5, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 5, 1, 1, 9, 5, 9]) rfl +theorem row9_f_8366 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 5, 1, 1, 9, 5, 9] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 5, 5, 1, 21] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 5, 1, 1, 9, 5, 9] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 5, 5, 1, 21]) rfl +theorem row9_f_8368 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 5, 5, 1, 21] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 5, 5, 1, 25] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 5, 5, 1, 21] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 5, 5, 1, 25]) rfl +theorem row9_f_8460 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 5, 5, 1, 25] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 5, 5, 1, 9, 9, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 5, 5, 1, 25] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 5, 5, 1, 9, 9, 1]) rfl +theorem row9_f_8963 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 5, 5, 1, 9, 9, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 5, 5, 5, 5, 1, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 5, 5, 1, 9, 9, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 5, 5, 5, 5, 1, 13]) rfl +theorem row9_f_8964 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 5, 5, 5, 5, 1, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 5, 5, 5, 5, 1, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1]) rfl +theorem row9_f_8966 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1]) rfl +theorem row9_f_9058 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 5, 1, 1, 1, 13, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 5, 1, 1, 1, 13, 1]) rfl +theorem row9_f_9568 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 5, 1, 1, 1, 13, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 5, 13, 1, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 5, 1, 1, 1, 13, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 5, 13, 1, 13]) rfl +theorem row9_f_9569 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 5, 13, 1, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 11, 1, 1, 1, 5, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 5, 13, 1, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 11, 1, 1, 1, 5, 1, 1, 1, 1, 1]) rfl +theorem row9_f_9571 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 11, 1, 1, 1, 5, 1, 1, 1, 1, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 11, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 11, 1, 1, 1, 5, 1, 1, 1, 1, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 11, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1]) rfl +theorem row9_f_9663 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 11, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 11, 1, 1, 1, 5, 1, 1, 13, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 11, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 11, 1, 1, 1, 5, 1, 1, 13, 1]) rfl +theorem row9_f_10217 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 11, 1, 1, 1, 5, 1, 1, 13, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 11, 1, 1, 1, 17, 1, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 11, 1, 1, 1, 5, 1, 1, 13, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 11, 1, 1, 1, 17, 1, 13]) rfl +theorem row9_f_10218 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 11, 1, 1, 1, 17, 1, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 6, 1, 1, 3, 1, 9, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 11, 1, 1, 1, 17, 1, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 6, 1, 1, 3, 1, 9, 1, 1, 1, 1, 1]) rfl +theorem row9_f_10220 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 6, 1, 1, 3, 1, 9, 1, 1, 1, 1, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 6, 1, 1, 3, 1, 9, 1, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 6, 1, 1, 3, 1, 9, 1, 1, 1, 1, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 6, 1, 1, 3, 1, 9, 1, 1, 1, 1, 1, 1]) rfl +theorem row9_f_10312 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 6, 1, 1, 3, 1, 9, 1, 1, 1, 1, 1, 1] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 6, 1, 1, 3, 1, 9, 1, 1, 13, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 6, 1, 1, 3, 1, 9, 1, 1, 1, 1, 1, 1] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 6, 1, 1, 3, 1, 9, 1, 1, 13, 1]) rfl +theorem row9_f_10893 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 6, 1, 1, 3, 1, 9, 1, 1, 13, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 6, 1, 1, 3, 1, 21, 1, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 6, 1, 1, 3, 1, 9, 1, 1, 13, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 6, 1, 1, 3, 1, 21, 1, 13]) rfl +theorem row9_f_10894 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 6, 1, 1, 3, 1, 21, 1, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 6, 7, 1, 9, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 6, 1, 1, 3, 1, 21, 1, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 6, 7, 1, 9, 1, 1, 1, 1, 1]) rfl +theorem row9_f_10896 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 6, 7, 1, 9, 1, 1, 1, 1, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 6, 7, 1, 9, 1, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 6, 7, 1, 9, 1, 1, 1, 1, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 6, 7, 1, 9, 1, 1, 1, 1, 1, 1]) rfl +theorem row9_f_10988 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 6, 7, 1, 9, 1, 1, 1, 1, 1, 1] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 6, 7, 1, 9, 1, 1, 13, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 6, 7, 1, 9, 1, 1, 1, 1, 1, 1] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 6, 7, 1, 9, 1, 1, 13, 1]) rfl +theorem row9_f_11624 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 6, 7, 1, 9, 1, 1, 13, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 6, 7, 1, 21, 1, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 6, 7, 1, 9, 1, 1, 13, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 6, 7, 1, 21, 1, 13]) rfl +theorem row9_f_11625 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 6, 7, 1, 21, 1, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 1, 1, 1, 5, 1, 1, 1, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 6, 7, 1, 21, 1, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 1, 1, 1, 5, 1, 1, 1, 1]) rfl +theorem row9_f_11627 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 1, 1, 1, 5, 1, 1, 1, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 1, 1, 1, 5, 1, 1, 1, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1]) rfl +theorem row9_f_11719 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 1, 1, 1, 5, 1, 13, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 1, 1, 1, 5, 1, 13, 1]) rfl +theorem row9_f_12389 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 1, 1, 1, 5, 1, 13, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 5, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 1, 1, 1, 5, 1, 13, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 5, 13]) rfl +theorem row9_f_12390 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 5, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 5, 5, 1, 5, 1, 1, 1, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 5, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 5, 5, 1, 5, 1, 1, 1, 1]) rfl +theorem row9_f_12392 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 5, 5, 1, 5, 1, 1, 1, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 5, 5, 1, 5, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 5, 5, 1, 5, 1, 1, 1, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 5, 5, 1, 5, 1, 1, 1, 1, 1]) rfl +theorem row9_f_12484 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 5, 5, 1, 5, 1, 1, 1, 1, 1] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 5, 5, 1, 5, 1, 13, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 5, 5, 1, 5, 1, 1, 1, 1, 1] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 5, 5, 1, 5, 1, 13, 1]) rfl +theorem row9_f_13175 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 5, 5, 1, 5, 1, 13, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 5, 5, 1, 1, 1, 1, 5, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 5, 5, 1, 5, 1, 13, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 5, 5, 1, 1, 1, 1, 5, 13]) rfl +theorem row9_f_13176 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 5, 5, 1, 1, 1, 1, 5, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 9, 5, 1, 5, 1, 1, 1, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 5, 5, 1, 1, 1, 1, 5, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 9, 5, 1, 5, 1, 1, 1, 1]) rfl +theorem row9_f_13178 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 9, 5, 1, 5, 1, 1, 1, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 9, 5, 1, 5, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 9, 5, 1, 5, 1, 1, 1, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 9, 5, 1, 5, 1, 1, 1, 1, 1]) rfl +theorem row9_f_13270 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 9, 5, 1, 5, 1, 1, 1, 1, 1] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 9, 5, 1, 5, 1, 13, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 9, 5, 1, 5, 1, 1, 1, 1, 1] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 9, 5, 1, 5, 1, 13, 1]) rfl +theorem row9_f_13968 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 9, 5, 1, 5, 1, 13, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 9, 5, 1, 1, 1, 1, 5, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 9, 5, 1, 5, 1, 13, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 9, 5, 1, 1, 1, 1, 5, 13]) rfl +theorem row9_f_13969 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 9, 5, 1, 1, 1, 1, 5, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 1, 1, 9, 1, 5, 1, 1, 1, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 9, 5, 1, 1, 1, 1, 5, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 1, 1, 9, 1, 5, 1, 1, 1, 1]) rfl +theorem row9_f_13971 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 1, 1, 9, 1, 5, 1, 1, 1, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 1, 1, 9, 1, 5, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 1, 1, 9, 1, 5, 1, 1, 1, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 1, 1, 9, 1, 5, 1, 1, 1, 1, 1]) rfl +theorem row9_f_14063 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 1, 1, 9, 1, 5, 1, 1, 1, 1, 1] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 1, 1, 9, 1, 5, 1, 13, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 1, 1, 9, 1, 5, 1, 1, 1, 1, 1] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 1, 1, 9, 1, 5, 1, 13, 1]) rfl +theorem row9_f_14812 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 1, 1, 9, 1, 5, 1, 13, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 1, 1, 9, 1, 1, 1, 1, 5, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 1, 1, 9, 1, 5, 1, 13, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 1, 1, 9, 1, 1, 1, 1, 5, 13]) rfl +theorem row9_f_14813 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 1, 1, 9, 1, 1, 1, 1, 5, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 1, 1, 13, 1, 5, 1, 1, 1, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 1, 1, 9, 1, 1, 1, 1, 5, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 1, 1, 13, 1, 5, 1, 1, 1, 1]) rfl +theorem row9_f_14815 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 1, 1, 13, 1, 5, 1, 1, 1, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 1, 1, 13, 1, 5, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 1, 1, 13, 1, 5, 1, 1, 1, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 1, 1, 13, 1, 5, 1, 1, 1, 1, 1]) rfl +theorem row9_f_14907 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 1, 1, 13, 1, 5, 1, 1, 1, 1, 1] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 1, 1, 13, 1, 5, 1, 13, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 1, 1, 13, 1, 5, 1, 1, 1, 1, 1] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 1, 1, 13, 1, 5, 1, 13, 1]) rfl +theorem row9_f_15663 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 1, 1, 13, 1, 5, 1, 13, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 1, 1, 13, 1, 1, 1, 1, 5, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 1, 1, 13, 1, 5, 1, 13, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 1, 1, 13, 1, 1, 1, 1, 5, 13]) rfl +theorem row9_f_15664 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 1, 1, 13, 1, 1, 1, 1, 5, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 11, 1, 13, 1, 5, 1, 1, 1, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 1, 1, 13, 1, 1, 1, 1, 5, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 11, 1, 13, 1, 5, 1, 1, 1, 1]) rfl +theorem row9_f_15666 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 11, 1, 13, 1, 5, 1, 1, 1, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 11, 1, 13, 1, 5, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 11, 1, 13, 1, 5, 1, 1, 1, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 11, 1, 13, 1, 5, 1, 1, 1, 1, 1]) rfl +theorem row9_f_15758 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 11, 1, 13, 1, 5, 1, 1, 1, 1, 1] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 11, 1, 13, 1, 5, 1, 13, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 11, 1, 13, 1, 5, 1, 1, 1, 1, 1] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 11, 1, 13, 1, 5, 1, 13, 1]) rfl +theorem row9_f_16544 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 11, 1, 13, 1, 5, 1, 13, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 11, 1, 13, 1, 1, 1, 1, 5, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 11, 1, 13, 1, 5, 1, 13, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 11, 1, 13, 1, 1, 1, 1, 5, 13]) rfl +theorem row9_f_16545 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 11, 1, 13, 1, 1, 1, 1, 5, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 6, 1, 3, 1, 1, 1, 1, 5, 5, 1, 1, 1, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 11, 1, 13, 1, 1, 1, 1, 5, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 6, 1, 3, 1, 1, 1, 1, 5, 5, 1, 1, 1, 1]) rfl +theorem row9_f_16547 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 6, 1, 3, 1, 1, 1, 1, 5, 5, 1, 1, 1, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 6, 1, 3, 1, 1, 1, 1, 5, 5, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 6, 1, 3, 1, 1, 1, 1, 5, 5, 1, 1, 1, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 6, 1, 3, 1, 1, 1, 1, 5, 5, 1, 1, 1, 1, 1]) rfl +theorem row9_f_16639 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 6, 1, 3, 1, 1, 1, 1, 5, 5, 1, 1, 1, 1, 1] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 6, 1, 3, 1, 1, 1, 1, 5, 5, 1, 13, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 6, 1, 3, 1, 1, 1, 1, 5, 5, 1, 1, 1, 1, 1] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 6, 1, 3, 1, 1, 1, 1, 5, 5, 1, 13, 1]) rfl +theorem row9_f_17447 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 6, 1, 3, 1, 1, 1, 1, 5, 5, 1, 13, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 6, 1, 3, 1, 1, 1, 1, 5, 1, 1, 1, 5, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 6, 1, 3, 1, 1, 1, 1, 5, 5, 1, 13, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 6, 1, 3, 1, 1, 1, 1, 5, 1, 1, 1, 5, 13]) rfl +theorem row9_f_17448 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 6, 1, 3, 1, 1, 1, 1, 5, 1, 1, 1, 5, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 1, 3, 1, 5, 1, 5, 5, 1, 1, 1, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 6, 1, 3, 1, 1, 1, 1, 5, 1, 1, 1, 5, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 1, 3, 1, 5, 1, 5, 5, 1, 1, 1, 1]) rfl +theorem row9_f_17450 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 1, 3, 1, 5, 1, 5, 5, 1, 1, 1, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 1, 3, 1, 5, 1, 5, 5, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 1, 3, 1, 5, 1, 5, 5, 1, 1, 1, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 1, 3, 1, 5, 1, 5, 5, 1, 1, 1, 1, 1]) rfl +theorem row9_f_17542 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 1, 3, 1, 5, 1, 5, 5, 1, 1, 1, 1, 1] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 1, 3, 1, 5, 1, 5, 5, 1, 13, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 1, 3, 1, 5, 1, 5, 5, 1, 1, 1, 1, 1] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 1, 3, 1, 5, 1, 5, 5, 1, 13, 1]) rfl +theorem row9_f_18392 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 1, 3, 1, 5, 1, 5, 5, 1, 13, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 1, 3, 1, 5, 1, 5, 1, 1, 1, 5, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 1, 3, 1, 5, 1, 5, 5, 1, 13, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 1, 3, 1, 5, 1, 5, 1, 1, 1, 5, 13]) rfl +theorem row9_f_18393 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 1, 3, 1, 5, 1, 5, 1, 1, 1, 5, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 1, 9, 1, 5, 5, 1, 1, 1, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 1, 3, 1, 5, 1, 5, 1, 1, 1, 5, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 1, 9, 1, 5, 5, 1, 1, 1, 1]) rfl +theorem row9_f_18395 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 1, 9, 1, 5, 5, 1, 1, 1, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 1, 9, 1, 5, 5, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 1, 9, 1, 5, 5, 1, 1, 1, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 1, 9, 1, 5, 5, 1, 1, 1, 1, 1]) rfl +theorem row9_f_18487 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 1, 9, 1, 5, 5, 1, 1, 1, 1, 1] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 1, 9, 1, 5, 5, 1, 13, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 1, 9, 1, 5, 5, 1, 1, 1, 1, 1] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 1, 9, 1, 5, 5, 1, 13, 1]) rfl +theorem row9_f_19358 : f [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 1, 9, 1, 5, 5, 1, 13, 1] = some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 1, 9, 1, 5, 1, 1, 1, 5, 13] := checked_f_sound 256 128 [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 1, 9, 1, 5, 5, 1, 13, 1] (some [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 1, 9, 1, 5, 1, 1, 1, 5, 13]) rfl +theorem row9_f_19359 : f [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 1, 9, 1, 5, 1, 1, 1, 5, 13] = some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 5, 1, 1, 1, 1] := checked_f_sound 256 128 [2, 2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 1, 9, 1, 5, 1, 1, 1, 5, 13] (some [2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 5, 1, 1, 1, 1]) rfl +theorem row9_f_19361 : f [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 5, 1, 1, 1, 1] = some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 5, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 5, 1, 1, 1, 1] (some [2, 0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 5, 1, 1, 1, 1, 1]) rfl +theorem row9_f_19453 : f [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 5, 1, 1, 1, 1, 1] = some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 5, 1, 13, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 5, 1, 1, 1, 1, 1] (some [2, 0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 5, 1, 13, 1]) rfl +theorem row9_f_19690 : f [0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 5, 1, 13, 1] = some [2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 1, 1, 1, 5, 13] := checked_f_sound 256 128 [0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 5, 1, 13, 1] (some [2, 0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 1, 1, 1, 5, 13]) rfl +theorem row9_f_20031 : f [0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 1, 1, 1, 5, 13] = some [2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1] := checked_f_sound 256 128 [0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 1, 1, 1, 5, 13] (some [2, 3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1]) rfl +theorem row9_f_20375 : f [0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1] = some [2, 0, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 5] := checked_f_sound 256 128 [0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1] (some [2, 0, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 5]) rfl +theorem row9_f_20378 : f [0, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 5] = some [2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [0, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 5] (some [2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1, 1]) rfl +theorem row9_f_20486 : f [0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1, 1] = some [2, 4, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1, 5] := checked_f_sound 256 128 [0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1, 1] (some [2, 4, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1, 5]) rfl +theorem row9_f_20495 : f [0, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1, 5] = some [2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 13, 1] := checked_f_sound 256 128 [0, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1, 5] (some [2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 13, 1]) rfl +theorem row9_f_20727 : f [0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 13, 1] = some [2, 3, 4, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 5, 5, 1] := checked_f_sound 256 128 [0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 13, 1] (some [2, 3, 4, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 5, 5, 1]) rfl +theorem row9_f_20734 : f [0, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 5, 5, 1] = some [2, 0, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 5, 1] := checked_f_sound 256 128 [0, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 5, 5, 1] (some [2, 0, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 5, 1]) rfl +theorem row9_f_20742 : f [0, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 5, 1] = some [2, 3, 4, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 5, 1, 1] := checked_f_sound 256 128 [0, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 5, 1] (some [2, 3, 4, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 5, 1, 1]) rfl +theorem row9_f_20754 : f [0, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 5, 1, 1] = some [2, 0, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 5, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 5, 1, 1] (some [2, 0, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 5, 1, 1, 1]) rfl +theorem row9_f_20776 : f [0, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 5, 1, 1, 1] = some [2, 0, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1, 1, 1] := checked_f_sound 256 128 [0, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 5, 1, 1, 1] (some [2, 0, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1, 1, 1]) rfl +theorem row9_f_20789 : f [0, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1, 1, 1] = some [2, 3, 0, 6, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 21] := checked_f_sound 256 128 [0, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1, 1, 1] (some [2, 3, 0, 6, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 21]) rfl +theorem row9_f_20806 : f [0, 6, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 21] = some [2, 4, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 5, 13] := checked_f_sound 256 128 [0, 6, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 21] (some [2, 4, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 5, 13]) rfl +theorem row9_f_20825 : f [0, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 5, 13] = some [2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 1, 1, 1, 5, 13] := checked_f_sound 256 128 [0, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 5, 13] (some [2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 1, 1, 1, 5, 13]) rfl +theorem row9_f_21086 : f [0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 1, 1, 1, 5, 13] = some [2, 0, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 13, 1, 13] := checked_f_sound 256 128 [0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 1, 1, 1, 5, 13] (some [2, 0, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 13, 1, 13]) rfl +theorem row9_f_21089 : f [0, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 13, 1, 13] = some [2, 3, 0, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 9, 9, 1, 13] := checked_f_sound 256 128 [0, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 13, 1, 13] (some [2, 3, 0, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 9, 9, 1, 13]) rfl +theorem row9_f_21096 : f [0, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 9, 9, 1, 13] = some [2, 0, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 1, 9, 1, 13] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 9, 9, 1, 13] (some [2, 0, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 1, 9, 1, 13]) rfl +theorem row9_f_21099 : f [0, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 1, 9, 1, 13] = some [2, 0, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 13, 5, 1, 13] := checked_f_sound 256 128 [0, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 1, 9, 1, 13] (some [2, 0, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 13, 5, 1, 13]) rfl +theorem row9_f_21106 : f [0, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 13, 5, 1, 13] = some [2, 0, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 5, 1, 13] := checked_f_sound 256 128 [0, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 13, 5, 1, 13] (some [2, 0, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 5, 1, 13]) rfl +theorem row9_f_21111 : f [0, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 5, 1, 13] = some [2, 3, 3, 3, 3, 0, 6, 2, 6, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 9, 1, 5, 5, 1, 13] := checked_f_sound 256 128 [0, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 5, 1, 13] (some [2, 3, 3, 3, 3, 0, 6, 2, 6, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 9, 1, 5, 5, 1, 13]) rfl +theorem row9_f_21130 : f [0, 6, 2, 6, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 9, 1, 5, 5, 1, 13] = some [2, 4, 2, 6, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 1, 1, 5, 5, 1, 13] := checked_f_sound 256 128 [0, 6, 2, 6, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 9, 1, 5, 5, 1, 13] (some [2, 4, 2, 6, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 1, 1, 5, 5, 1, 13]) rfl +theorem row9_f_21137 : f [0, 2, 6, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 1, 1, 5, 5, 1, 13] = some [2, 0, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 1, 1, 5, 5, 1, 13] := checked_f_sound 256 128 [0, 2, 6, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 1, 1, 5, 5, 1, 13] (some [2, 0, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 1, 1, 5, 5, 1, 13]) rfl +theorem row9_f_21146 : f [0, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 1, 1, 5, 5, 1, 13] = some [2, 4, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 17, 1, 5, 1, 13] := checked_f_sound 256 128 [0, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 1, 1, 5, 5, 1, 13] (some [2, 4, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 17, 1, 5, 1, 13]) rfl +theorem row9_f_21166 : f [0, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 17, 1, 5, 1, 13] = some [2, 0, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 9, 1, 5, 1, 13] := checked_f_sound 256 128 [0, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 17, 1, 5, 1, 13] (some [2, 0, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 9, 1, 5, 1, 13]) rfl +theorem row9_f_21186 : f [0, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 9, 1, 5, 1, 13] = some [2, 0, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 9, 5, 1, 5, 1, 13] := checked_f_sound 256 128 [0, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 9, 1, 5, 1, 13] (some [2, 0, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 9, 5, 1, 5, 1, 13]) rfl +theorem row9_f_21213 : f [0, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 9, 5, 1, 5, 1, 13] = some [2, 3, 3, 3, 0, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 17, 5, 5, 1, 5, 1, 13] := checked_f_sound 256 128 [0, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 9, 5, 1, 5, 1, 13] (some [2, 3, 3, 3, 0, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 17, 5, 5, 1, 5, 1, 13]) rfl +theorem row9_f_21241 : f [0, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 17, 5, 5, 1, 5, 1, 13] = some [2, 0, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 5, 5, 5, 1, 5, 1, 13] := checked_f_sound 256 128 [0, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 17, 5, 5, 1, 5, 1, 13] (some [2, 0, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 5, 5, 5, 1, 5, 1, 13]) rfl +theorem row9_f_21244 : f [0, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 5, 5, 5, 1, 5, 1, 13] = some [2, 3, 0, 6, 2, 2, 2, 2, 3, 2, 2, 3, 13, 1, 5, 5, 1, 5, 1, 13] := checked_f_sound 256 128 [0, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 5, 5, 5, 1, 5, 1, 13] (some [2, 3, 0, 6, 2, 2, 2, 2, 3, 2, 2, 3, 13, 1, 5, 5, 1, 5, 1, 13]) rfl +theorem row9_f_21251 : f [0, 6, 2, 2, 2, 2, 3, 2, 2, 3, 13, 1, 5, 5, 1, 5, 1, 13] = some [2, 4, 2, 2, 2, 2, 3, 2, 2, 3, 21, 1, 5, 1, 5, 1, 13] := checked_f_sound 256 128 [0, 6, 2, 2, 2, 2, 3, 2, 2, 3, 13, 1, 5, 5, 1, 5, 1, 13] (some [2, 4, 2, 2, 2, 2, 3, 2, 2, 3, 21, 1, 5, 1, 5, 1, 13]) rfl +theorem row9_f_21260 : f [0, 2, 2, 2, 2, 3, 2, 2, 3, 21, 1, 5, 1, 5, 1, 13] = some [2, 0, 2, 2, 2, 3, 2, 2, 3, 9, 9, 1, 5, 1, 5, 1, 13] := checked_f_sound 256 128 [0, 2, 2, 2, 2, 3, 2, 2, 3, 21, 1, 5, 1, 5, 1, 13] (some [2, 0, 2, 2, 2, 3, 2, 2, 3, 9, 9, 1, 5, 1, 5, 1, 13]) rfl +theorem row9_f_21272 : f [0, 2, 2, 2, 3, 2, 2, 3, 9, 9, 1, 5, 1, 5, 1, 13] = some [2, 0, 2, 2, 3, 2, 2, 3, 13, 5, 1, 5, 1, 5, 1, 13] := checked_f_sound 256 128 [0, 2, 2, 2, 3, 2, 2, 3, 9, 9, 1, 5, 1, 5, 1, 13] (some [2, 0, 2, 2, 3, 2, 2, 3, 13, 5, 1, 5, 1, 5, 1, 13]) rfl +theorem row9_f_21283 : f [0, 2, 2, 3, 2, 2, 3, 13, 5, 1, 5, 1, 5, 1, 13] = some [2, 0, 2, 3, 2, 2, 3, 9, 1, 5, 1, 5, 1, 5, 1, 13] := checked_f_sound 256 128 [0, 2, 2, 3, 2, 2, 3, 13, 5, 1, 5, 1, 5, 1, 13] (some [2, 0, 2, 3, 2, 2, 3, 9, 1, 5, 1, 5, 1, 5, 1, 13]) rfl +theorem row9_f_21296 : f [0, 2, 3, 2, 2, 3, 9, 1, 5, 1, 5, 1, 5, 1, 13] = some [2, 0, 3, 2, 2, 3, 17, 1, 1, 5, 1, 5, 1, 13] := checked_f_sound 256 128 [0, 2, 3, 2, 2, 3, 9, 1, 5, 1, 5, 1, 5, 1, 13] (some [2, 0, 3, 2, 2, 3, 17, 1, 1, 5, 1, 5, 1, 13]) rfl +theorem row9_f_21309 : f [0, 3, 2, 2, 3, 17, 1, 1, 5, 1, 5, 1, 13] = some [2, 3, 0, 2, 3, 5, 9, 1, 1, 5, 1, 5, 1, 13] := checked_f_sound 256 128 [0, 3, 2, 2, 3, 17, 1, 1, 5, 1, 5, 1, 13] (some [2, 3, 0, 2, 3, 5, 9, 1, 1, 5, 1, 5, 1, 13]) rfl +theorem row9_f_21349 : f [0, 2, 3, 5, 9, 1, 1, 5, 1, 5, 1, 13] = some [2, 0, 3, 9, 5, 1, 1, 5, 1, 5, 1, 13] := checked_f_sound 256 128 [0, 2, 3, 5, 9, 1, 1, 5, 1, 5, 1, 13] (some [2, 0, 3, 9, 5, 1, 1, 5, 1, 5, 1, 13]) rfl +theorem row9_f_21352 : f [0, 3, 9, 5, 1, 1, 5, 1, 5, 1, 13] = some [2, 3, 2, 2, 5, 1, 1, 5, 1, 5, 1, 13] := checked_f_sound 256 128 [0, 3, 9, 5, 1, 1, 5, 1, 5, 1, 13] (some [2, 3, 2, 2, 5, 1, 1, 5, 1, 5, 1, 13]) rfl + +-- ============================================================================ +-- Section 12: Certificate Path (`Row9Certificate.v`) +-- ============================================================================ + +theorem row9_edge_0 : K 3 (some []) ↔ K 3 (some [0, 1, 1]) := step_edge_T row9_f_0 row9_f_1 row9_f_2 +theorem row9_edge_6 : K 3 (some [0, 1, 1]) ↔ K 3 (some [0, 2, 7, 5]) := step_edge_T row9_f_3 row9_f_8 row9_f_9 +theorem row9_edge_15 : K 3 (some [0, 2, 7, 5]) ↔ K 3 (some [0, 2, 2, 1, 1, 9]) := step_edge_T row9_f_10 row9_f_22 row9_f_23 +theorem row9_edge_30 : K 3 (some [0, 2, 2, 1, 1, 9]) ↔ K 3 (some [0, 2, 2, 3, 1, 1, 1]) := step_edge_H row9_f_24 row9_f_49 row9_f_50 row9_f_52 +theorem row9_edge_48 : K 3 (some [0, 2, 2, 3, 1, 1, 1]) ↔ K 3 (some [0, 2, 2, 3, 7, 1, 1]) := step_edge_H row9_f_60 row9_f_79 row9_f_80 row9_f_82 +theorem row9_edge_66 : K 3 (some [0, 2, 2, 3, 7, 1, 1]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 1, 7]) := step_edge_H row9_f_89 row9_f_111 row9_f_112 row9_f_114 +theorem row9_edge_84 : K 3 (some [0, 2, 2, 3, 2, 2, 1, 7]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 9, 9]) := step_edge_H row9_f_125 row9_f_145 row9_f_146 row9_f_148 +theorem row9_edge_102 : K 3 (some [0, 2, 2, 3, 2, 2, 9, 9]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 1, 1, 5]) := step_edge_H row9_f_173 row9_f_191 row9_f_192 row9_f_194 +theorem row9_edge_120 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 1, 1, 5]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 11, 1]) := step_edge_H row9_f_220 row9_f_238 row9_f_239 row9_f_241 +theorem row9_edge_138 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 11, 1]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 2, 4, 1, 1, 1]) := step_edge_H row9_f_278 row9_f_295 row9_f_296 row9_f_298 +theorem row9_edge_156 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 2, 4, 1, 1, 1]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 1, 2, 1, 7, 5]) := step_edge_H row9_f_351 row9_f_376 row9_f_377 row9_f_379 +theorem row9_edge_174 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 1, 2, 1, 7, 5]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 13, 1]) := step_edge_H row9_f_455 row9_f_485 row9_f_486 row9_f_488 +theorem row9_edge_192 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 13, 1]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 9, 2, 5]) := step_edge_H row9_f_579 row9_f_614 row9_f_615 row9_f_617 +theorem row9_edge_210 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 9, 2, 5]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 1, 2, 5, 1, 5]) := step_edge_H row9_f_709 row9_f_779 row9_f_780 row9_f_782 +theorem row9_edge_228 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 1, 2, 5, 1, 5]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 5, 6, 5]) := step_edge_H row9_f_874 row9_f_951 row9_f_952 row9_f_954 +theorem row9_edge_246 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 5, 6, 5]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 1, 5, 5]) := step_edge_H row9_f_1046 row9_f_1152 row9_f_1153 row9_f_1155 +theorem row9_edge_264 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 1, 5, 5]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 7, 9, 5]) := step_edge_H row9_f_1247 row9_f_1370 row9_f_1371 row9_f_1373 +theorem row9_edge_282 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 7, 9, 5]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 1, 1, 1, 9]) := step_edge_H row9_f_1465 row9_f_1634 row9_f_1635 row9_f_1637 +theorem row9_edge_300 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 1, 1, 1, 9]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 11, 5, 9]) := step_edge_H row9_f_1729 row9_f_1916 row9_f_1917 row9_f_1919 +theorem row9_edge_318 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 11, 5, 9]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 6, 3, 1, 1, 13]) := step_edge_H row9_f_2011 row9_f_2235 row9_f_2236 row9_f_2238 +theorem row9_edge_336 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 6, 3, 1, 1, 13]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 1, 21]) := step_edge_H row9_f_2330 row9_f_2578 row9_f_2579 row9_f_2581 +theorem row9_edge_354 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 1, 21]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 1, 1, 21]) := step_edge_H row9_f_2673 row9_f_2947 row9_f_2948 row9_f_2950 +theorem row9_edge_372 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 1, 1, 21]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 7, 1, 1, 21]) := step_edge_H row9_f_3042 row9_f_3323 row9_f_3324 row9_f_3326 +theorem row9_edge_390 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 7, 1, 1, 21]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 1, 3, 1, 25]) := step_edge_H row9_f_3418 row9_f_3754 row9_f_3755 row9_f_3757 +theorem row9_edge_408 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 1, 3, 1, 25]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 9, 5, 5, 1, 9]) := step_edge_H row9_f_3849 row9_f_4194 row9_f_4195 row9_f_4197 +theorem row9_edge_426 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 9, 5, 5, 1, 9]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 13, 1, 17]) := step_edge_H row9_f_4289 row9_f_4656 row9_f_4657 row9_f_4659 +theorem row9_edge_444 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 13, 1, 17]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 1, 5, 9, 9]) := step_edge_H row9_f_4751 row9_f_5125 row9_f_5126 row9_f_5128 +theorem row9_edge_462 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 1, 5, 9, 9]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 7, 1, 5, 21]) := step_edge_H row9_f_5220 row9_f_5623 row9_f_5624 row9_f_5626 +theorem row9_edge_480 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 7, 1, 5, 21]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1]) := step_edge_H row9_f_5718 row9_f_6135 row9_f_6136 row9_f_6138 +theorem row9_edge_498 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 5, 1, 1, 1, 9, 1, 9]) := step_edge_H row9_f_6230 row9_f_6676 row9_f_6677 row9_f_6679 +theorem row9_edge_516 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 5, 1, 1, 1, 9, 1, 9]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 5, 1, 9, 17]) := step_edge_H row9_f_6771 row9_f_7223 row9_f_7224 row9_f_7226 +theorem row9_edge_534 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 5, 1, 9, 17]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 5, 1, 17, 9]) := step_edge_H row9_f_7318 row9_f_7791 row9_f_7792 row9_f_7794 +theorem row9_edge_552 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 5, 1, 17, 9]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 5, 5, 1, 25]) := step_edge_H row9_f_7886 row9_f_8365 row9_f_8366 row9_f_8368 +theorem row9_edge_570 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 5, 5, 1, 25]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1]) := step_edge_H row9_f_8460 row9_f_8963 row9_f_8964 row9_f_8966 +theorem row9_edge_588 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 11, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1]) := step_edge_H row9_f_9058 row9_f_9568 row9_f_9569 row9_f_9571 +theorem row9_edge_606 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 11, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 6, 1, 1, 3, 1, 9, 1, 1, 1, 1, 1, 1]) := step_edge_H row9_f_9663 row9_f_10217 row9_f_10218 row9_f_10220 +theorem row9_edge_624 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 6, 1, 1, 3, 1, 9, 1, 1, 1, 1, 1, 1]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 6, 7, 1, 9, 1, 1, 1, 1, 1, 1]) := step_edge_H row9_f_10312 row9_f_10893 row9_f_10894 row9_f_10896 +theorem row9_edge_642 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 6, 7, 1, 9, 1, 1, 1, 1, 1, 1]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1]) := step_edge_H row9_f_10988 row9_f_11624 row9_f_11625 row9_f_11627 +theorem row9_edge_660 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 5, 5, 1, 5, 1, 1, 1, 1, 1]) := step_edge_H row9_f_11719 row9_f_12389 row9_f_12390 row9_f_12392 +theorem row9_edge_678 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 5, 5, 1, 5, 1, 1, 1, 1, 1]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 9, 5, 1, 5, 1, 1, 1, 1, 1]) := step_edge_H row9_f_12484 row9_f_13175 row9_f_13176 row9_f_13178 +theorem row9_edge_696 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 9, 5, 1, 5, 1, 1, 1, 1, 1]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 1, 1, 9, 1, 5, 1, 1, 1, 1, 1]) := step_edge_H row9_f_13270 row9_f_13968 row9_f_13969 row9_f_13971 +theorem row9_edge_714 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 1, 1, 9, 1, 5, 1, 1, 1, 1, 1]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 1, 1, 13, 1, 5, 1, 1, 1, 1, 1]) := step_edge_H row9_f_14063 row9_f_14812 row9_f_14813 row9_f_14815 +theorem row9_edge_732 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 1, 1, 13, 1, 5, 1, 1, 1, 1, 1]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 11, 1, 13, 1, 5, 1, 1, 1, 1, 1]) := step_edge_H row9_f_14907 row9_f_15663 row9_f_15664 row9_f_15666 +theorem row9_edge_750 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 11, 1, 13, 1, 5, 1, 1, 1, 1, 1]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 6, 1, 3, 1, 1, 1, 1, 5, 5, 1, 1, 1, 1, 1]) := step_edge_H row9_f_15758 row9_f_16544 row9_f_16545 row9_f_16547 +theorem row9_edge_768 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 6, 1, 3, 1, 1, 1, 1, 5, 5, 1, 1, 1, 1, 1]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 1, 3, 1, 5, 1, 5, 5, 1, 1, 1, 1, 1]) := step_edge_H row9_f_16639 row9_f_17447 row9_f_17448 row9_f_17450 +theorem row9_edge_786 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 1, 3, 1, 5, 1, 5, 5, 1, 1, 1, 1, 1]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 1, 9, 1, 5, 5, 1, 1, 1, 1, 1]) := step_edge_H row9_f_17542 row9_f_18392 row9_f_18393 row9_f_18395 +theorem row9_edge_804 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 1, 9, 1, 5, 5, 1, 1, 1, 1, 1]) ↔ K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 5, 1, 1, 1, 1, 1]) := step_edge_H row9_f_18487 row9_f_19358 row9_f_19359 row9_f_19361 +theorem row9_normal_2233 : K 3 (some [0, 2, 2, 3, 2, 2, 3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 5, 1, 1, 1, 1, 1]) ↔ K 3 (some [0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 5, 1, 13, 1]) := step_normal_Z (by decide) row9_f_19453 +theorem row9_normal_2234 : K 3 (some [0, 2, 3, 2, 2, 3, 2, 1, 2, 3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 5, 1, 13, 1]) ↔ K 3 (some [0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 1, 1, 1, 5, 13]) := step_normal_Z (by decide) row9_f_19690 +theorem row9_normal_2235 : K 3 (some [0, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 7, 1, 1, 1, 5, 5, 1, 1, 1, 5, 13]) ↔ K 3 (some [3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1]) := step_normal_Z (by decide) row9_f_20031 +theorem row9_normal_2236 : K 3 (some [3, 0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1]) ↔ K 6 (some [0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1]) := step_normal_three rfl +theorem row9_normal_2237 : K 6 (some [0, 2, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1]) ↔ K 6 (some [0, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 5]) := step_normal_Z (by decide) row9_f_20375 +theorem row9_normal_2238 : K 6 (some [0, 3, 2, 1, 2, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 5]) ↔ K 6 (some [3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1, 1]) := step_normal_Z (by decide) row9_f_20378 +theorem row9_normal_2239 : K 6 (some [3, 0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1, 1]) ↔ K 12 (some [0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1, 1]) := step_normal_three rfl +theorem row9_normal_2240 : K 12 (some [0, 6, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1, 1]) ↔ K 12 (some [4, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1, 5]) := step_normal_Z (by decide) row9_f_20486 +theorem row9_normal_2241 : K 12 (some [4, 3, 3, 2, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1, 5]) ↔ K 7 (some [3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 13, 1]) := step_normal_four (by decide) rfl row9_f_20495 +theorem row9_normal_2242 : K 7 (some [3, 3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 13, 1]) ↔ K 14 (some [3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 13, 1]) := step_normal_three rfl +theorem row9_normal_2243 : K 14 (some [3, 0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 13, 1]) ↔ K 28 (some [0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 13, 1]) := step_normal_three rfl +theorem row9_normal_2244 : K 28 (some [0, 3, 6, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 13, 1]) ↔ K 28 (some [3, 4, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 5, 5, 1]) := step_normal_Z (by decide) row9_f_20727 +theorem row9_normal_2245 : K 28 (some [3, 4, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 5, 5, 1]) ↔ K 56 (some [4, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 5, 5, 1]) := step_normal_three rfl +theorem row9_normal_2246 : K 56 (some [4, 2, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 5, 5, 1]) ↔ K 29 (some [0, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 5, 1]) := step_normal_four (by decide) rfl row9_f_20734 +theorem row9_normal_2247 : K 29 (some [0, 3, 6, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 5, 1]) ↔ K 29 (some [3, 4, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 5, 1, 1]) := step_normal_Z (by decide) row9_f_20742 +theorem row9_normal_2248 : K 29 (some [3, 4, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 5, 1, 1]) ↔ K 58 (some [4, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 5, 1, 1]) := step_normal_three rfl +theorem row9_normal_2249 : K 58 (some [4, 2, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 5, 1, 1]) ↔ K 30 (some [0, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 5, 1, 1, 1]) := step_normal_four (by decide) rfl row9_f_20754 +theorem row9_normal_2250 : K 30 (some [0, 2, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 5, 1, 1, 1]) ↔ K 30 (some [0, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1, 1, 1]) := step_normal_Z (by decide) row9_f_20776 +theorem row9_normal_2251 : K 30 (some [0, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 1, 1, 1, 1, 1]) ↔ K 30 (some [3, 0, 6, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 21]) := step_normal_Z (by decide) row9_f_20789 +theorem row9_normal_2252 : K 30 (some [3, 0, 6, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 21]) ↔ K 60 (some [0, 6, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 21]) := step_normal_three rfl +theorem row9_normal_2253 : K 60 (some [0, 6, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 21]) ↔ K 60 (some [4, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 5, 13]) := step_normal_Z (by decide) row9_f_20806 +theorem row9_normal_2254 : K 60 (some [4, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 1, 5, 13]) ↔ K 31 (some [3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 1, 1, 1, 5, 13]) := step_normal_four (by decide) rfl row9_f_20825 +theorem row9_normal_2255 : K 31 (some [3, 3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 1, 1, 1, 5, 13]) ↔ K 62 (some [3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 1, 1, 1, 5, 13]) := step_normal_three rfl +theorem row9_normal_2256 : K 62 (some [3, 3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 1, 1, 1, 5, 13]) ↔ K 124 (some [3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 1, 1, 1, 5, 13]) := step_normal_three rfl +theorem row9_normal_2257 : K 124 (some [3, 0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 1, 1, 1, 5, 13]) ↔ K 248 (some [0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 1, 1, 1, 5, 13]) := step_normal_three rfl +theorem row9_normal_2258 : K 248 (some [0, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 1, 1, 1, 5, 13]) ↔ K 248 (some [0, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 13, 1, 13]) := step_normal_Z (by decide) row9_f_21086 +theorem row9_normal_2259 : K 248 (some [0, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 13, 1, 13]) ↔ K 248 (some [3, 0, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 9, 9, 1, 13]) := step_normal_Z (by decide) row9_f_21089 +theorem row9_normal_2260 : K 248 (some [3, 0, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 9, 9, 1, 13]) ↔ K 496 (some [0, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 9, 9, 1, 13]) := step_normal_three rfl +theorem row9_normal_2261 : K 496 (some [0, 2, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 9, 9, 1, 13]) ↔ K 496 (some [0, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 1, 9, 1, 13]) := step_normal_Z (by decide) row9_f_21096 +theorem row9_normal_2262 : K 496 (some [0, 2, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 1, 9, 1, 13]) ↔ K 496 (some [0, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 13, 5, 1, 13]) := step_normal_Z (by decide) row9_f_21099 +theorem row9_normal_2263 : K 496 (some [0, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 13, 5, 1, 13]) ↔ K 496 (some [0, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 5, 1, 13]) := step_normal_Z (by decide) row9_f_21106 +theorem row9_normal_2264 : K 496 (some [0, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 5, 5, 5, 1, 13]) ↔ K 496 (some [3, 3, 3, 3, 0, 6, 2, 6, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 9, 1, 5, 5, 1, 13]) := step_normal_Z (by decide) row9_f_21111 +theorem row9_normal_2265 : K 496 (some [3, 3, 3, 3, 0, 6, 2, 6, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 9, 1, 5, 5, 1, 13]) ↔ K 992 (some [3, 3, 3, 0, 6, 2, 6, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 9, 1, 5, 5, 1, 13]) := step_normal_three rfl +theorem row9_normal_2266 : K 992 (some [3, 3, 3, 0, 6, 2, 6, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 9, 1, 5, 5, 1, 13]) ↔ K 1984 (some [3, 3, 0, 6, 2, 6, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 9, 1, 5, 5, 1, 13]) := step_normal_three rfl +theorem row9_normal_2267 : K 1984 (some [3, 3, 0, 6, 2, 6, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 9, 1, 5, 5, 1, 13]) ↔ K 3968 (some [3, 0, 6, 2, 6, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 9, 1, 5, 5, 1, 13]) := step_normal_three rfl +theorem row9_normal_2268 : K 3968 (some [3, 0, 6, 2, 6, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 9, 1, 5, 5, 1, 13]) ↔ K 7936 (some [0, 6, 2, 6, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 9, 1, 5, 5, 1, 13]) := step_normal_three rfl +theorem row9_normal_2269 : K 7936 (some [0, 6, 2, 6, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 9, 1, 5, 5, 1, 13]) ↔ K 7936 (some [4, 2, 6, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 1, 1, 5, 5, 1, 13]) := step_normal_Z (by decide) row9_f_21130 +theorem row9_normal_2270 : K 7936 (some [4, 2, 6, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 1, 1, 5, 5, 1, 13]) ↔ K 3969 (some [0, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 1, 1, 5, 5, 1, 13]) := step_normal_four (by decide) rfl row9_f_21137 +theorem row9_normal_2271 : K 3969 (some [0, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 1, 1, 5, 5, 1, 13]) ↔ K 3969 (some [4, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 17, 1, 5, 1, 13]) := step_normal_Z (by decide) row9_f_21146 +theorem row9_normal_2272 : K 3969 (some [4, 2, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 17, 1, 5, 1, 13]) ↔ K 1984 (some [0, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 9, 1, 5, 1, 13]) := step_normal_four (by decide) rfl row9_f_21166 +theorem row9_normal_2273 : K 1984 (some [0, 2, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 5, 9, 1, 5, 1, 13]) ↔ K 1984 (some [0, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 9, 5, 1, 5, 1, 13]) := step_normal_Z (by decide) row9_f_21186 +theorem row9_normal_2274 : K 1984 (some [0, 3, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 1, 9, 5, 1, 5, 1, 13]) ↔ K 1984 (some [3, 3, 3, 0, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 17, 5, 5, 1, 5, 1, 13]) := step_normal_Z (by decide) row9_f_21213 +theorem row9_normal_2275 : K 1984 (some [3, 3, 3, 0, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 17, 5, 5, 1, 5, 1, 13]) ↔ K 3968 (some [3, 3, 0, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 17, 5, 5, 1, 5, 1, 13]) := step_normal_three rfl +theorem row9_normal_2276 : K 3968 (some [3, 3, 0, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 17, 5, 5, 1, 5, 1, 13]) ↔ K 7936 (some [3, 0, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 17, 5, 5, 1, 5, 1, 13]) := step_normal_three rfl +theorem row9_normal_2277 : K 7936 (some [3, 0, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 17, 5, 5, 1, 5, 1, 13]) ↔ K 15872 (some [0, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 17, 5, 5, 1, 5, 1, 13]) := step_normal_three rfl +theorem row9_normal_2278 : K 15872 (some [0, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 17, 5, 5, 1, 5, 1, 13]) ↔ K 15872 (some [0, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 5, 5, 5, 1, 5, 1, 13]) := step_normal_Z (by decide) row9_f_21241 +theorem row9_normal_2279 : K 15872 (some [0, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 9, 5, 5, 5, 1, 5, 1, 13]) ↔ K 15872 (some [3, 0, 6, 2, 2, 2, 2, 3, 2, 2, 3, 13, 1, 5, 5, 1, 5, 1, 13]) := step_normal_Z (by decide) row9_f_21244 +theorem row9_normal_2280 : K 15872 (some [3, 0, 6, 2, 2, 2, 2, 3, 2, 2, 3, 13, 1, 5, 5, 1, 5, 1, 13]) ↔ K 31744 (some [0, 6, 2, 2, 2, 2, 3, 2, 2, 3, 13, 1, 5, 5, 1, 5, 1, 13]) := step_normal_three rfl +theorem row9_normal_2281 : K 31744 (some [0, 6, 2, 2, 2, 2, 3, 2, 2, 3, 13, 1, 5, 5, 1, 5, 1, 13]) ↔ K 31744 (some [4, 2, 2, 2, 2, 3, 2, 2, 3, 21, 1, 5, 1, 5, 1, 13]) := step_normal_Z (by decide) row9_f_21251 +theorem row9_normal_2282 : K 31744 (some [4, 2, 2, 2, 2, 3, 2, 2, 3, 21, 1, 5, 1, 5, 1, 13]) ↔ K 15873 (some [0, 2, 2, 2, 3, 2, 2, 3, 9, 9, 1, 5, 1, 5, 1, 13]) := step_normal_four (by decide) rfl row9_f_21260 +theorem row9_normal_2283 : K 15873 (some [0, 2, 2, 2, 3, 2, 2, 3, 9, 9, 1, 5, 1, 5, 1, 13]) ↔ K 15873 (some [0, 2, 2, 3, 2, 2, 3, 13, 5, 1, 5, 1, 5, 1, 13]) := step_normal_Z (by decide) row9_f_21272 +theorem row9_normal_2284 : K 15873 (some [0, 2, 2, 3, 2, 2, 3, 13, 5, 1, 5, 1, 5, 1, 13]) ↔ K 15873 (some [0, 2, 3, 2, 2, 3, 9, 1, 5, 1, 5, 1, 5, 1, 13]) := step_normal_Z (by decide) row9_f_21283 +theorem row9_normal_2285 : K 15873 (some [0, 2, 3, 2, 2, 3, 9, 1, 5, 1, 5, 1, 5, 1, 13]) ↔ K 15873 (some [0, 3, 2, 2, 3, 17, 1, 1, 5, 1, 5, 1, 13]) := step_normal_Z (by decide) row9_f_21296 +theorem row9_normal_2286 : K 15873 (some [0, 3, 2, 2, 3, 17, 1, 1, 5, 1, 5, 1, 13]) ↔ K 15873 (some [3, 0, 2, 3, 5, 9, 1, 1, 5, 1, 5, 1, 13]) := step_normal_Z (by decide) row9_f_21309 +theorem row9_normal_2287 : K 15873 (some [3, 0, 2, 3, 5, 9, 1, 1, 5, 1, 5, 1, 13]) ↔ K 31746 (some [0, 2, 3, 5, 9, 1, 1, 5, 1, 5, 1, 13]) := step_normal_three rfl +theorem row9_normal_2288 : K 31746 (some [0, 2, 3, 5, 9, 1, 1, 5, 1, 5, 1, 13]) ↔ K 31746 (some [0, 3, 9, 5, 1, 1, 5, 1, 5, 1, 13]) := step_normal_Z (by decide) row9_f_21349 +theorem row9_normal_2289 : K 31746 (some [0, 3, 9, 5, 1, 1, 5, 1, 5, 1, 13]) ↔ K 31746 (some [3, 2, 2, 5, 1, 1, 5, 1, 5, 1, 13]) := step_normal_Z (by decide) row9_f_21352 +theorem row9_normal_2290 : K 31746 (some [3, 2, 2, 5, 1, 1, 5, 1, 5, 1, 13]) ↔ K 63492 (some [2, 2, 5, 1, 1, 5, 1, 5, 1, 13]) := step_normal_three rfl + +theorem row9_selected_path : K 3 (some []) ↔ K 63492 (some [2, 2, 5, 1, 1, 5, 1, 5, 1, 13]) := by + refine Iff.trans row9_edge_0 ?_ + refine Iff.trans row9_edge_6 ?_ + refine Iff.trans row9_edge_15 ?_ + refine Iff.trans row9_edge_30 ?_ + refine Iff.trans row9_edge_48 ?_ + refine Iff.trans row9_edge_66 ?_ + refine Iff.trans row9_edge_84 ?_ + refine Iff.trans row9_edge_102 ?_ + refine Iff.trans row9_edge_120 ?_ + refine Iff.trans row9_edge_138 ?_ + refine Iff.trans row9_edge_156 ?_ + refine Iff.trans row9_edge_174 ?_ + refine Iff.trans row9_edge_192 ?_ + refine Iff.trans row9_edge_210 ?_ + refine Iff.trans row9_edge_228 ?_ + refine Iff.trans row9_edge_246 ?_ + refine Iff.trans row9_edge_264 ?_ + refine Iff.trans row9_edge_282 ?_ + refine Iff.trans row9_edge_300 ?_ + refine Iff.trans row9_edge_318 ?_ + refine Iff.trans row9_edge_336 ?_ + refine Iff.trans row9_edge_354 ?_ + refine Iff.trans row9_edge_372 ?_ + refine Iff.trans row9_edge_390 ?_ + refine Iff.trans row9_edge_408 ?_ + refine Iff.trans row9_edge_426 ?_ + refine Iff.trans row9_edge_444 ?_ + refine Iff.trans row9_edge_462 ?_ + refine Iff.trans row9_edge_480 ?_ + refine Iff.trans row9_edge_498 ?_ + refine Iff.trans row9_edge_516 ?_ + refine Iff.trans row9_edge_534 ?_ + refine Iff.trans row9_edge_552 ?_ + refine Iff.trans row9_edge_570 ?_ + refine Iff.trans row9_edge_588 ?_ + refine Iff.trans row9_edge_606 ?_ + refine Iff.trans row9_edge_624 ?_ + refine Iff.trans row9_edge_642 ?_ + refine Iff.trans row9_edge_660 ?_ + refine Iff.trans row9_edge_678 ?_ + refine Iff.trans row9_edge_696 ?_ + refine Iff.trans row9_edge_714 ?_ + refine Iff.trans row9_edge_732 ?_ + refine Iff.trans row9_edge_750 ?_ + refine Iff.trans row9_edge_768 ?_ + refine Iff.trans row9_edge_786 ?_ + refine Iff.trans row9_edge_804 ?_ + refine Iff.trans row9_normal_2233 ?_ + refine Iff.trans row9_normal_2234 ?_ + refine Iff.trans row9_normal_2235 ?_ + refine Iff.trans row9_normal_2236 ?_ + refine Iff.trans row9_normal_2237 ?_ + refine Iff.trans row9_normal_2238 ?_ + refine Iff.trans row9_normal_2239 ?_ + refine Iff.trans row9_normal_2240 ?_ + refine Iff.trans row9_normal_2241 ?_ + refine Iff.trans row9_normal_2242 ?_ + refine Iff.trans row9_normal_2243 ?_ + refine Iff.trans row9_normal_2244 ?_ + refine Iff.trans row9_normal_2245 ?_ + refine Iff.trans row9_normal_2246 ?_ + refine Iff.trans row9_normal_2247 ?_ + refine Iff.trans row9_normal_2248 ?_ + refine Iff.trans row9_normal_2249 ?_ + refine Iff.trans row9_normal_2250 ?_ + refine Iff.trans row9_normal_2251 ?_ + refine Iff.trans row9_normal_2252 ?_ + refine Iff.trans row9_normal_2253 ?_ + refine Iff.trans row9_normal_2254 ?_ + refine Iff.trans row9_normal_2255 ?_ + refine Iff.trans row9_normal_2256 ?_ + refine Iff.trans row9_normal_2257 ?_ + refine Iff.trans row9_normal_2258 ?_ + refine Iff.trans row9_normal_2259 ?_ + refine Iff.trans row9_normal_2260 ?_ + refine Iff.trans row9_normal_2261 ?_ + refine Iff.trans row9_normal_2262 ?_ + refine Iff.trans row9_normal_2263 ?_ + refine Iff.trans row9_normal_2264 ?_ + refine Iff.trans row9_normal_2265 ?_ + refine Iff.trans row9_normal_2266 ?_ + refine Iff.trans row9_normal_2267 ?_ + refine Iff.trans row9_normal_2268 ?_ + refine Iff.trans row9_normal_2269 ?_ + refine Iff.trans row9_normal_2270 ?_ + refine Iff.trans row9_normal_2271 ?_ + refine Iff.trans row9_normal_2272 ?_ + refine Iff.trans row9_normal_2273 ?_ + refine Iff.trans row9_normal_2274 ?_ + refine Iff.trans row9_normal_2275 ?_ + refine Iff.trans row9_normal_2276 ?_ + refine Iff.trans row9_normal_2277 ?_ + refine Iff.trans row9_normal_2278 ?_ + refine Iff.trans row9_normal_2279 ?_ + refine Iff.trans row9_normal_2280 ?_ + refine Iff.trans row9_normal_2281 ?_ + refine Iff.trans row9_normal_2282 ?_ + refine Iff.trans row9_normal_2283 ?_ + refine Iff.trans row9_normal_2284 ?_ + refine Iff.trans row9_normal_2285 ?_ + refine Iff.trans row9_normal_2286 ?_ + refine Iff.trans row9_normal_2287 ?_ + refine Iff.trans row9_normal_2288 ?_ + refine Iff.trans row9_normal_2289 ?_ + refine Iff.trans row9_normal_2290 ?_ + exact Iff.rfl + +theorem not_K_3_nil : ¬ K 3 (some []) := by + rw [row9_selected_path] + exact selected_numeric_endpoint_nonhalting + +theorem T3_never_none (k : Nat) : power (T 3) k (some []) ≠ none := by + intro hk + apply not_K_3_nil + exact (K_T_equiv 3 (some []) (by decide)).mp ⟨k, hk⟩ + +end Row9 + +-- ============================================================================ +-- Section 13: Physical Turing Machine Embedding (`Row9Machine.v` + `Row9Bridge.v`) +-- ============================================================================ + +open Row9 + +def word_tape : word → ListBlank (Fin 2) + | [] => (1 : Fin 2) >> default + | g :: u => (1 : Fin 2) >> (([0] : List (Fin 2)) ^ g +> ((1 : Fin 2) >> ((0 : Fin 2) >> word_tape u))) + +theorem word_tape_nil : word_tape [] = (1 : Fin 2) >> default := rfl +theorem word_tape_cons (g : Nat) (u : word) : + word_tape (g :: u) = (1 : Fin 2) >> (([0] : List (Fin 2)) ^ g +> ((1 : Fin 2) >> ((0 : Fin 2) >> word_tape u))) := rfl + +def reset (l : ListBlank (Fin 2)) (w : word) : Cfg (Fin 2) (Fin 6) := + ((l <+ ([1, 0, 1] : List (Fin 2))) {{B}}> word_tape w) + +def scan (k : Nat) (l : ListBlank (Fin 2)) (w : word) : Cfg (Fin 2) (Fin 6) := + (((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (2 + k)) {{C}}> word_tape w) + +theorem word_tape_head (w : word) : ∃ r, word_tape w = (1 : Fin 2) >> r := by + cases w <;> exact ⟨_, rfl⟩ + +theorem a_sweep (n : Nat) (l r : ListBlank (Fin 2)) : + (((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ n) <{{A}} r) [target_tm]⊢⁺ + ((l <+ ([1] : List (Fin 2))) {{B}}> (([0] : List (Fin 2)) ^ n +> r)) := by + induction n generalizing l r with + | zero => + simp only [pow_zero_list, listblank_append_nil, listblank_append_cons] + execute + | succ n ih => + rw [pow_succ_list, ← listblank_append_append] + have h1 : ((((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ n) <+ ([1] : List (Fin 2))) <{{A}} r) + [target_tm]⊢⁺ + (((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ n) <{{A}} ((0 : Fin 2) >> r)) := by + dsimp -failIfUnchanged [ListBlank.append] + execute + have h2 := ih l ((0 : Fin 2) >> r) + have h_eq : (([0] : List (Fin 2)) ^ n +> ((0 : Fin 2) >> r)) = (([0] : List (Fin 2)) ^ (n + 1) +> r) := by + rw [cons_eq_singleton_append 0 r, listblank_append_append, list_pow_append_one] + rw [h_eq] at h2 + exact stepPlus_trans h1 h2 + +theorem carry (l : ListBlank (Fin 2)) (w : word) (k : Nat) : + (reset ((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (2 + k)) w) [target_tm]⊢⁺ + (reset l (k :: w)) := by + obtain ⟨r, hr⟩ := word_tape_head w + unfold reset + rw [hr] + have h1 : ((((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (2 + k)) <+ ([1, 0, 1] : List (Fin 2))) {{B}}> ((1 : Fin 2) >> r)) + [target_tm]⊢⁺ + ((((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (2 + k)) <+ ([1] : List (Fin 2))) <{{A}} + ((1 : Fin 2) >> ((0 : Fin 2) >> ((1 : Fin 2) >> r)))) := by + dsimp -failIfUnchanged [ListBlank.append] + execute + rw [pow_succ_append_left (l <+ ([0] : List (Fin 2))) ([1] : List (Fin 2)) (2 + k)] at h1 + have h2 := a_sweep (2 + k + 1) l ((1 : Fin 2) >> ((0 : Fin 2) >> ((1 : Fin 2) >> r))) + have h12 := stepPlus_trans h1 h2 + have hk : 2 + k + 1 = 3 + k := by omega + rw [hk, pow_add_append_right ([0] : List (Fin 2)) 3 k] at h12 + have h3 : ((l <+ ([1] : List (Fin 2))) {{B}}> + (([0] : List (Fin 2)) ^ 3 +> (([0] : List (Fin 2)) ^ k +> ((1 : Fin 2) >> ((0 : Fin 2) >> ((1 : Fin 2) >> r)))))) + [target_tm]⊢⁺ + ((l <+ ([1, 0, 1] : List (Fin 2))) {{B}}> + ((1 : Fin 2) >> (([0] : List (Fin 2)) ^ k +> ((1 : Fin 2) >> ((0 : Fin 2) >> ((1 : Fin 2) >> r)))))) := by + dsimp -failIfUnchanged [ListBlank.append] + execute + have h_tot := stepPlus_trans h12 h3 + rw [word_tape_cons, hr] + exact h_tot + +theorem short_even (l : ListBlank (Fin 2)) (w : word) : + (reset (l <+ ([0] : List (Fin 2))) w) [target_tm]⊢⁺ + (scan 0 (l <+ ([1] : List (Fin 2))) w) := by + obtain ⟨r, hr⟩ := word_tape_head w + unfold reset scan + rw [hr] + dsimp -failIfUnchanged [ListBlank.append] + execute + +theorem short_one (l : ListBlank (Fin 2)) (w : word) : + (reset (l <+ ([1, 0] : List (Fin 2))) w) [target_tm]⊢⁺ + (scan 0 (l <+ ([0, 1] : List (Fin 2))) w) := by + obtain ⟨r, hr⟩ := word_tape_head w + unfold reset scan + rw [hr] + dsimp -failIfUnchanged [ListBlank.append] + execute + +theorem scan_one (k : Nat) (l : ListBlank (Fin 2)) (u : word) : + (scan k l (1 :: u)) [target_tm]⊢⁺ (scan (k + 4) l u) := by + obtain ⟨r, hr⟩ := word_tape_head u + unfold scan + rw [word_tape_cons, hr] + have hk : 2 + (k + 4) = (2 + k) + 4 := by omega + rw [hk, pow_add_append_left (l <+ ([0] : List (Fin 2))) ([1] : List (Fin 2)) (2 + k) 4] + dsimp -failIfUnchanged [ListBlank.append] + execute + +theorem scan_two (k : Nat) (l : ListBlank (Fin 2)) (u : word) : + (scan k l (2 :: u)) [target_tm]⊢⁺ + (scan 0 ((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (4 + k)) u) := by + obtain ⟨r, hr⟩ := word_tape_head u + unfold scan + rw [word_tape_cons, hr] + have hk : 4 + k = (2 + k) + 2 := by omega + rw [hk, pow_add_append_left (l <+ ([0] : List (Fin 2))) ([1] : List (Fin 2)) (2 + k) 2] + dsimp -failIfUnchanged [ListBlank.append] + execute + +theorem scan_three (k : Nat) (l : ListBlank (Fin 2)) (u : word) : + (scan k l (3 :: u)) [target_tm]⊢⁺ + (scan 0 (((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (4 + k)) <+ ([0] : List (Fin 2))) u) := by + obtain ⟨r, hr⟩ := word_tape_head u + unfold scan + rw [word_tape_cons, hr] + have hk : 4 + k = (2 + k) + 2 := by omega + rw [hk, pow_add_append_left (l <+ ([0] : List (Fin 2))) ([1] : List (Fin 2)) (2 + k) 2] + dsimp -failIfUnchanged [ListBlank.append] + execute + +theorem scan_zero_one (k : Nat) (l : ListBlank (Fin 2)) (u : word) : + (scan k l (0 :: 1 :: u)) [target_tm]⊢⁺ + (scan 2 ((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (4 + k)) u) := by + obtain ⟨r, hr⟩ := word_tape_head u + unfold scan + rw [word_tape_cons, word_tape_cons, hr] + have hk : 4 + k = (2 + k) + 2 := by omega + rw [hk, pow_add_append_left (l <+ ([0] : List (Fin 2))) ([1] : List (Fin 2)) (2 + k) 2] + dsimp -failIfUnchanged [ListBlank.append] + execute + +theorem scan_zero_two (k : Nat) (l : ListBlank (Fin 2)) (u : word) : + (scan k l (0 :: 2 :: u)) [target_tm]⊢⁺ + (scan 0 (((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (4 + k)) <+ ([1, 1, 0] : List (Fin 2))) u) := by + obtain ⟨r, hr⟩ := word_tape_head u + unfold scan + rw [word_tape_cons, word_tape_cons, hr] + have hk : 4 + k = (2 + k) + 2 := by omega + rw [hk, pow_add_append_left (l <+ ([0] : List (Fin 2))) ([1] : List (Fin 2)) (2 + k) 2] + dsimp -failIfUnchanged [ListBlank.append] + execute + +theorem scan_zero_large (k : Nat) (l : ListBlank (Fin 2)) (g : Nat) (u : word) : + (scan k l (0 :: (g + 3) :: u)) [target_tm]⊢⁺ + (scan 1 ((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (4 + k)) (g :: u)) := by + obtain ⟨r, hr⟩ := word_tape_head u + unfold scan + rw [word_tape_cons, word_tape_cons, word_tape_cons, hr] + have hk : 4 + k = (2 + k) + 2 := by omega + have hg : g + 3 = 3 + g := by omega + rw [hk, pow_add_append_left (l <+ ([0] : List (Fin 2))) ([1] : List (Fin 2)) (2 + k) 2, + hg, pow_add_append_right ([0] : List (Fin 2)) 3 g] + dsimp -failIfUnchanged [ListBlank.append] + execute + +theorem scan_zero (k : Nat) (l : ListBlank (Fin 2)) : + (scan k l [0]) [target_tm]⊢⁺ + (scan 1 ((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (4 + k)) []) := by + unfold scan + rw [word_tape_cons, word_tape_nil] + have hk : 4 + k = (2 + k) + 2 := by omega + rw [hk, pow_add_append_left (l <+ ([0] : List (Fin 2))) ([1] : List (Fin 2)) (2 + k) 2] + dsimp -failIfUnchanged [ListBlank.append] + execute + +theorem scan_large (k : Nat) (l : ListBlank (Fin 2)) (g : Nat) (u : word) : + (scan k l ((g + 4) :: u)) [target_tm]⊢⁺ + (reset ((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (3 + k)) (g :: u)) := by + obtain ⟨r, hr⟩ := word_tape_head u + unfold scan reset + rw [word_tape_cons, word_tape_cons, hr] + have hk : 3 + k = (2 + k) + 1 := by omega + have hg : g + 4 = 4 + g := by omega + rw [hk, pow_add_append_left (l <+ ([0] : List (Fin 2))) ([1] : List (Fin 2)) (2 + k) 1, + hg, pow_add_append_right ([0] : List (Fin 2)) 4 g] + dsimp -failIfUnchanged [ListBlank.append] + execute + +theorem scan_nil (k : Nat) (l : ListBlank (Fin 2)) : + (scan k l []) [target_tm]⊢⁺ + (reset ((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (3 + k)) []) := by + unfold scan reset + rw [word_tape_nil] + have hk : 3 + k = (2 + k) + 1 := by omega + rw [hk, pow_add_append_left (l <+ ([0] : List (Fin 2))) ([1] : List (Fin 2)) (2 + k) 1] + dsimp -failIfUnchanged [ListBlank.append] + execute + +theorem first_plus_0 (w : word) : first_plus 0 w = w := by + cases w with + | nil => rfl + | cons a u => simp [first_plus] + +theorem first_plus_comp (k j : Nat) (w : word) : + first_plus k (first_plus j w) = first_plus (j + k) w := by + cases w with + | nil => rfl + | cons a u => simp [first_plus, Nat.add_assoc] + +theorem scan_nil_return (k : Nat) (l : ListBlank (Fin 2)) : + (scan k l []) [target_tm]⊢⁺ (reset l [1 + k]) := by + have h1 := scan_nil k l + have hk : 3 + k = 2 + (1 + k) := by omega + rw [hk] at h1 + exact stepPlus_trans h1 (carry l [] (1 + k)) + +theorem scan_large_return (k : Nat) (l : ListBlank (Fin 2)) (g : Nat) (u : word) : + (scan k l ((g + 4) :: u)) [target_tm]⊢⁺ (reset l ((1 + k) :: g :: u)) := by + have h1 := scan_large k l g u + have hk : 3 + k = 2 + (1 + k) := by omega + rw [hk] at h1 + exact stepPlus_trans h1 (carry l (g :: u) (1 + k)) + +theorem eval_embedding_some {u : word} {r : result} (H : Eval u r) : + ∀ (v : word) (k : Nat) (l : ListBlank (Fin 2)), + r = some v → (scan k l u) [target_tm]⊢⁺ (reset l (first_plus k v)) := by + induction H with + | nil => + intro v k l hv; injection hv with hv; subst hv + exact scan_nil_return k l + | one h ih => + rename_i U r' + intro v k l hv + rcases r' with _ | v' + · cases hv + · simp only [lift_plus, Option.map] at hv + injection hv with hv; subst hv + rw [first_plus_comp] + have hk : 4 + k = k + 4 := by omega + rw [hk] + exact stepPlus_trans (scan_one k l U) (ih v' (k + 4) l rfl) + | two h ih => + rename_i U r' + intro v k l hv + rcases r' with _ | v' + · cases hv + · simp only [lift_prefix, Option.map, List.singleton_append] at hv + injection hv with hv; subst hv + have h1 := scan_two k l U + have h2 := ih v' 0 ((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (4 + k)) rfl + rw [first_plus_0] at h2 + have h3 := carry l v' (2 + k) + have hk : 2 + (2 + k) = 4 + k := by omega + rw [hk] at h3 + exact stepPlus_trans (stepPlus_trans h1 h2) h3 + | three_halt _ => + intro v k l hv; cases hv + | three h1 h2 ih1 ih2 => + rename_i U V r' + intro v k l hv + rcases r' with _ | v' + · cases hv + · simp only [lift_prefix, Option.map, List.singleton_append] at hv + injection hv with hv; subst hv + have hs1 := scan_three k l U + have hs2 := ih1 V 0 (((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (4 + k)) <+ ([0] : List (Fin 2))) rfl + rw [first_plus_0] at hs2 + have hs3 := short_even ((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (4 + k)) V + have hs4 := ih2 v' 0 (((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (4 + k)) <+ ([1] : List (Fin 2))) rfl + rw [first_plus_0] at hs4 + have hs1234 := stepPlus_trans (stepPlus_trans (stepPlus_trans hs1 hs2) hs3) hs4 + have h_eq : (((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (4 + k)) <+ ([1] : List (Fin 2))) = + ((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (2 + (3 + k))) := by + rw [pow_succ_append_left (l <+ ([0] : List (Fin 2))) ([1] : List (Fin 2)) (4 + k)] + have hk : 4 + k + 1 = 2 + (3 + k) := by omega + rw [hk] + rw [h_eq] at hs1234 + have hs5 := carry l v' (3 + k) + exact stepPlus_trans hs1234 hs5 + | large g U => + intro v k l hv; injection hv with hv; subst hv + exact scan_large_return k l g U + | zero => + intro v k l hv; injection hv with hv; subst hv + have hs1 := scan_zero k l + have hs2 := scan_nil_return 1 ((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (4 + k)) + have hs3 := carry l [2] (2 + k) + have hk : 2 + (2 + k) = 4 + k := by omega + rw [hk] at hs3 + exact stepPlus_trans (stepPlus_trans hs1 hs2) hs3 + | zero_zero _ => + intro v k l hv; cases hv + | zero_one h ih => + rename_i U r' + intro v k l hv + rcases r' with _ | v' + · cases hv + · simp only [lift_prefix, lift_plus, Option.map, List.singleton_append] at hv + injection hv with hv; subst hv + have hs1 := scan_zero_one k l U + have hs2 := ih v' 2 ((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (4 + k)) rfl + have hs3 := carry l (first_plus 2 v') (2 + k) + have hk : 2 + (2 + k) = 4 + k := by omega + rw [hk] at hs3 + exact stepPlus_trans (stepPlus_trans hs1 hs2) hs3 + | zero_two h ih => + rename_i U r' + intro v k l hv + rcases r' with _ | v' + · cases hv + · simp only [lift_prefix, Option.map] at hv + injection hv with hv; subst hv + have hs1 := scan_zero_two k l U + have hs2 := ih v' 0 (((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (4 + k)) <+ ([1, 1, 0] : List (Fin 2))) rfl + rw [first_plus_0] at hs2 + have h_eq : (((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (4 + k)) <+ ([1, 1, 0] : List (Fin 2))) = + ((((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (4 + k)) <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (2 + 0)) := by + rw [listblank_append_append] + rfl + rw [h_eq] at hs2 + have hs3 := carry ((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (4 + k)) v' 0 + have hs4 := carry l (0 :: v') (2 + k) + have hk : 2 + (2 + k) = 4 + k := by omega + rw [hk] at hs4 + exact stepPlus_trans (stepPlus_trans (stepPlus_trans hs1 hs2) hs3) hs4 + | zero_large g h ih => + rename_i U r' + intro v k l hv + rcases r' with _ | v' + · cases hv + · simp only [lift_prefix, lift_plus, Option.map, List.singleton_append] at hv + injection hv with hv; subst hv + have hs1 := scan_zero_large k l g U + have hs2 := ih v' 1 ((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2)) ^ (4 + k)) rfl + have hs3 := carry l (first_plus 1 v') (2 + k) + have hk : 2 + (2 + k) = 4 + k := by omega + rw [hk] at hs3 + exact stepPlus_trans (stepPlus_trans hs1 hs2) hs3 + +theorem f_embedding_some {u v : word} (h : f u = some v) (k : Nat) (l : ListBlank (Fin 2)) : + (scan k l u) [target_tm]⊢⁺ (reset l (first_plus k v)) := + eval_embedding_some (f_spec u) v k l h + +theorem init_to_reset : (init []) [target_tm]⊢⁺ (reset default []) := by + unfold init reset word_tape + simp only [Tape.mk₁, Tape.mk₂, Tape.mk', listblank_append_cons, listblank_append_nil, + zero_cons_default, default_head, default_tail] + execute + +theorem default_append_zero : (default : ListBlank (Fin 2)) <+ ([0] : List (Fin 2)) = default := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem short_initial (w : word) : + (reset default w) [target_tm]⊢⁺ (scan 0 (default <+ ([1] : List (Fin 2))) w) := by + have h := short_even default w + rw [default_append_zero] at h + exact h + +theorem short_second (w : word) : + (reset (default <+ ([1] : List (Fin 2))) w) [target_tm]⊢⁺ + (scan 0 (default <+ ([0, 1] : List (Fin 2))) w) := by + have h := short_one default w + have heq : (default : ListBlank (Fin 2)) <+ ([1, 0] : List (Fin 2)) = default <+ ([1] : List (Fin 2)) := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + rw [heq] at h + exact h + +theorem short_third (w : word) : + (reset (default <+ ([0, 1] : List (Fin 2))) w) [target_tm]⊢⁺ + (scan 0 (default <+ ([1, 1] : List (Fin 2))) w) := by + have h := short_even (default <+ ([1] : List (Fin 2))) w + rw [listblank_append_append, listblank_append_append] at h + exact h + +theorem phase_carry (w : word) : + (reset (default <+ ([1, 1] : List (Fin 2))) w) [target_tm]⊢⁺ + (reset default (0 :: w)) := by + have h := carry default w 0 + rw [default_append_zero] at h + exact h + +theorem T3_embedding {w z : word} (h : T 3 (some w) = some z) : + (reset default w) [target_tm]⊢⁺ (reset default z) := by + unfold T at h + simp only [power, opF, bind_res] at h + rcases h1 : f w with _ | u + · rw [h1] at h; cases h + · rw [h1] at h; simp only [bind_res] at h + rcases h2 : f u with _ | v + · rw [h2] at h; cases h + · rw [h2] at h; simp only [bind_res] at h + rcases h3 : f v with _ | y + · rw [h3] at h; cases h + · rw [h3] at h; simp only [Z, pfx, Option.map] at h + injection h with h; subst h + have s1 := short_initial w + have s2 := f_embedding_some h1 0 (default <+ ([1] : List (Fin 2))) + rw [first_plus_0] at s2 + have s3 := short_second u + have s4 := f_embedding_some h2 0 (default <+ ([0, 1] : List (Fin 2))) + rw [first_plus_0] at s4 + have s5 := short_third v + have s6 := f_embedding_some h3 0 (default <+ ([1, 1] : List (Fin 2))) + rw [first_plus_0] at s6 + have s7 := phase_carry y + exact stepPlus_trans (stepPlus_trans (stepPlus_trans (stepPlus_trans (stepPlus_trans (stepPlus_trans s1 s2) s3) s4) s5) s6) s7 + +noncomputable def T3_word (k : Nat) : word := + match h : power (T 3) k (some []) with + | some w => w + | none => False.elim (T3_never_none k h) + +theorem T3_word_spec (k : Nat) : power (T 3) k (some []) = some (T3_word k) := by + unfold T3_word + split + · rename_i w hw; exact hw.symm ▸ rfl + · rename_i hnone; exact False.elim (T3_never_none k hnone) + +theorem T3_word_zero : T3_word 0 = [] := by + have h := T3_word_spec 0 + simp only [power] at h + exact (Option.some.inj h).symm + +theorem T3_word_step (k : Nat) : T 3 (some (T3_word k)) = some (T3_word (k + 1)) := by + have h1 := T3_word_spec k + have h2 := T3_word_spec (k + 1) + simp only [power, h1] at h2 + exact h2 + +-- ============================================================================ +-- Section 14: Main Theorem Statement (`holdout_0010_nonhalt`) +-- ============================================================================ + +end Solution + + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + refine nonhalt_of_chain target_tm (fun k => reset default (T3_word k)) ?_ ?_ + · dsimp -failIfUnchanged only + rw [T3_word_zero] + exact stepPlus_stepStar init_to_reset + · intro k + exact T3_embedding (T3_word_step k) + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0LA_0RC1LE_0RD1RE_1LA1RF_1RB0LD_1RCHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RCHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RCHHH.lean new file mode 100644 index 00000000..389aa3a8 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RCHHH.lean @@ -0,0 +1,457 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.Calculi.Longitudinal + +open Mathlib Relation Nat Turing BusyBeaver SixState + +@[expose] public section + +namespace BusyBeaver.M_1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RCHHH + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RCHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end BusyBeaver.M_1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RCHHH + +end + +namespace BusyBeaver.M_1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RCHHH + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +def target_tm : Machine (Fin 2) (Fin 6) + | 0, 0 => some (some 1, Stmt.write 1 Dir.right) + | 0, 1 => some (some 0, Stmt.write 0 Dir.left) + | 1, 0 => some (some 2, Stmt.write 0 Dir.right) + | 1, 1 => some (some 3, Stmt.write 1 Dir.right) + | 2, 0 => some (some 3, Stmt.write 0 Dir.left) + | 2, 1 => some (some 4, Stmt.write 1 Dir.right) + | 3, 0 => some (some 0, Stmt.write 1 Dir.left) + | 3, 1 => some (some 1, Stmt.write 0 Dir.right) + | 4, 0 => some (some 3, Stmt.write 0 Dir.right) + | 4, 1 => some (some 5, Stmt.write 1 Dir.right) + | 5, 0 => some (some 2, Stmt.write 1 Dir.right) + | 5, 1 => none + +theorem target_eq_target_tm : target = target_tm := by + funext q a + fin_cases q <;> fin_cases a <;> simp [target, machine, ConjectureMachines.Machine.toBB, + ConjectureMachines.Machine.ofRows, target_tm] +open BusyBeaver.Longitudinal (DH0 toDHCfg flipTM SegRL SegRR SegLL SegRLs SideRLs) +open BusyBeaver.Longitudinal.BoundedConfig (toCfg all0_spec steps_spec steps1_spec_true + segRLs_c_spec sideRLs_c_spec) +open BusyBeaver.Longitudinal.SBC (RC0 RC1 RC2 CfgAt S) + +namespace Solution + +abbrev w : List (Fin 2) := [1, 0, 0, 1, 0] +abbrev u : List (Fin 2) := [1, 0, 0, 0, 0] +abbrev v : List (Fin 2) := [0, 0, 0, 1, 0] +abbrev z : List (Fin 2) := [1, 1, 0] +abbrev d₀ : List (Fin 2) := [0, 0, 1, 0] +abbrev d₁ : List (Fin 2) := [1, 0, 1, 0] +abbrev d₁' : List (Fin 2) := [1, 0, 1, 0] +abbrev dh : ListBlank (Fin 2) := [1] +> default + +abbrev hR : DH0 (Fin 2) (Fin 6) := (C, [0]) +abbrev hL : DH0 (Fin 2) (Fin 6) := (A, [0]) +abbrev huR : DH0 (Fin 2) (Fin 6) := (C, [0, 0]) +abbrev huL : DH0 (Fin 2) (Fin 6) := (A, [0, 0]) +abbrev hu : DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6) := (huR, huL) +abbrev hrstL : DH0 (Fin 2) (Fin 6) := (D, [0, 1, 0]) + +theorem rule_wall : SegRLs target_tm ([(hR, hL)] ^ 2) ([(hR, hL)] ^ 2) w w := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem rule_pair : SegRLs target_tm ([(hR, hL)] ^ 6) ([(hR, + hL)] ^ 2) (z ++ w ++ w) (w ++ w ++ z) := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem seg_w_hu : SegRLs target_tm [hu] [hu] w w := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem seg_u_hu : SegRLs target_tm [hu] [hu] u u := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem side_hu : SideRLs target_tm [hu] default (u +> default) := + sideRLs_c_spec target_tm (hs := [hu]) (r := []) (r' := u) (T := 200) (by decide) + +theorem side_u_pow (m : ℕ) : + SideRLs target_tm [hu] (u ^ m +> default) (u ^ (1 + m) +> default) := by + induction m with + | zero => + simpa [pow_zero_list, pow_succ_list] using side_hu + | succ m ih => + have h := seg_u_hu.sideRLs_concat ih + have h₁ : 1 + (m + 1) = (1 + m) + 1 := by omega + rw [pow_succ_list u m, ListBlank.append_assoc, h₁, pow_succ_list u (1 + m), + ListBlank.append_assoc] + exact h + +theorem side_w_u_pow (n m : ℕ) : + SideRLs target_tm [hu] (w ^ n +> (u ^ m +> default)) (w ^ n +> (u ^ (1 + m) +> default)) := by + induction n with + | zero => + simpa [pow_zero_list] using side_u_pow m + | succ n ih => + have h := seg_w_hu.sideRLs_concat ih + rw [pow_succ_list w n, ListBlank.append_assoc, ListBlank.append_assoc] + exact h + +theorem seg_zww_hu : SegRLs target_tm ([(hR, hL)] ^ 6) [hu] (z ++ w ++ w) (w ++ w ++ z) := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem rule_R (n m : ℕ) : + SideRLs target_tm ([(hR, hL)] ^ 6) (RC0 w u z 0 (2 + n) m) (RC0 w u z 2 n (1 + m)) := by + have h := seg_zww_hu.sideRLs_concat (side_w_u_pow n m) + have h_lhs : (z ++ w ++ w) +> (w ^ n +> (u ^ m +> default)) = RC0 w u z 0 (2 + n) m := by + unfold RC0 + have h2 : 2 + n = n + 1 + 1 := by omega + rw [h2, pow_zero_list, pow_succ_list w (n + 1), pow_succ_list w n] + simp only [List.append_assoc, ListBlank.append_nil, ListBlank.append_assoc] + have h_rhs : (w ++ w ++ z) +> (w ^ n +> (u ^ (1 + m) +> default)) = + RC0 w u z 2 n (1 + m) := by + unfold RC0 + change (w ++ w ++ z) +> (w ^ n +> (u ^ (1 + m) +> default)) = + (w ++ (w ++ [])) +> (z +> (w ^ n +> (u ^ (1 + m) +> default))) + simp only [List.append_nil, List.append_assoc, ListBlank.append_assoc] + rwa [h_lhs, h_rhs] at h + +theorem seg_zu : SegRLs target_tm ([(hR, hL)] ^ 4) [] (z ++ u) (w ++ z) := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem rule_U (m : ℕ) : + SideRLs target_tm ([(hR, hL)] ^ 4) (RC0 w u z 0 0 (1 + m)) (RC0 w u z 1 0 m) := by + have h := seg_zu.sideRLs_concat (SideRLs.nil (u ^ m +> default)) + have h_lhs : (z ++ u) +> (u ^ m +> default) = RC0 w u z 0 0 (1 + m) := by + unfold RC0 + have h1 : 1 + m = m + 1 := by omega + rw [h1, pow_succ_list u m] + change (z ++ u) +> (u ^ m +> default) = [] +> (z +> ([] +> ((u ++ u ^ m) +> default))) + simp only [ListBlank.append_nil, ListBlank.append_assoc] + have h_rhs : (w ++ z) +> (u ^ m +> default) = RC0 w u z 1 0 m := by + unfold RC0 + change (w ++ z) +> (u ^ m +> default) = (w ++ []) +> (z +> ([] +> (u ^ m +> default))) + simp only [List.append_nil, ListBlank.append_nil, ListBlank.append_assoc] + rwa [h_lhs, h_rhs] at h + +theorem zeros3_u_pow_eq_v_pow (k : ℕ) : + ([0, 0, 0] : List (Fin 2)) +> (u ^ k +> default) = v ^ k +> default := by + induction k with + | zero => + exact all0_spec (by decide) + | succ k ih => + rw [pow_succ_list u k, pow_succ_list v k, ListBlank.append_assoc, ListBlank.append_assoc, ← ih] + rfl + +theorem seg_zw_hu : SegRLs target_tm ([(hR, hL)] ^ 2) [hu] (z ++ w) (w ++ [0, 0, 0]) := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem rule_odd (m : ℕ) : + SideRLs target_tm ([(hR, hL)] ^ 2) (RC0 w u z 0 1 m) (RC1 w v 0 (1 + m)) := by + have h := seg_zw_hu.sideRLs_concat (side_u_pow m) + have h_lhs : (z ++ w) +> (u ^ m +> default) = RC0 w u z 0 1 m := by + unfold RC0 + change (z ++ w) +> (u ^ m +> default) = [] +> (z +> ((w ++ []) +> (u ^ m +> default))) + simp only [List.append_nil, ListBlank.append_nil, ListBlank.append_assoc] + have h_rhs : (w ++ [0, 0, 0]) +> (u ^ (1 + m) +> default) = RC1 w v 0 (1 + m) := by + unfold RC1 + rw [ListBlank.append_assoc, zeros3_u_pow_eq_v_pow] + change w +> (v ^ (1 + m) +> default) = (w ++ []) +> (v ^ (1 + m) +> default) + simp only [List.append_nil] + rwa [h_lhs, h_rhs] at h + +theorem seg_wv : SegRLs target_tm ([(hR, hL)] ^ 2) [] (w ++ v) (w ++ w) := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem rule_V (m : ℕ) : + SideRLs target_tm ([(hR, hL)] ^ 2) (RC1 w v 0 (1 + m)) (RC1 w v 1 m) := by + have h := seg_wv.sideRLs_concat (SideRLs.nil (v ^ m +> default)) + have h_lhs : (w ++ v) +> (v ^ m +> default) = RC1 w v 0 (1 + m) := by + unfold RC1 + have h1 : 1 + m = m + 1 := by omega + rw [h1, pow_succ_list v m] + change (w ++ v) +> (v ^ m +> default) = (w ++ []) +> ((v ++ v ^ m) +> default) + simp only [List.append_nil, ListBlank.append_assoc] + have h_rhs : (w ++ w) +> (v ^ m +> default) = RC1 w v 1 m := by + unfold RC1 + change (w ++ w) +> (v ^ m +> default) = (w ++ (w ++ [])) +> (v ^ m +> default) + simp only [List.append_nil] + rwa [h_lhs, h_rhs] at h + +theorem rule_empty : SideRLs target_tm ([(hR, hL)] ^ 4) (RC0 w u z 0 0 0) (RC2 w u 1 0) := + sideRLs_c_spec target_tm (hs := [(hR, hL)] ^ 4) (r := z) (r' := w ++ w) (T := 200) + (by decide) + +theorem seg_w_grow : SegRLs target_tm ([(hR, hL)] ^ 2) [hu] w w := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem rule_grow (m : ℕ) : + SideRLs target_tm ([(hR, hL)] ^ 2) (RC2 w u 0 m) (RC2 w u 0 (1 + m)) := + seg_w_grow.sideRLs_concat (side_u_pow m) + +theorem seg_reset_d1 : SegRLs (flipTM target_tm) [(hL, hrstL)] [(hL, hrstL)] d₁ d₀ := + segRLs_c_spec (flipTM target_tm) (T := 200) (by decide) + +theorem side_reset_dh : SideRLs (flipTM target_tm) [(hL, hrstL)] dh dh := + sideRLs_c_spec (flipTM target_tm) (hs := [(hL, hrstL)]) (r := [1]) (r' := [1]) + (T := 200) (by decide) + +theorem side_reset_d1_pow (n : ℕ) : + SideRLs (flipTM target_tm) [(hL, hrstL)] (d₁ ^ n +> dh) (d₀ ^ n +> dh) := by + induction n with + | zero => + simpa [pow_zero_list] using side_reset_dh + | succ n ih => + have h := seg_reset_d1.sideRLs_concat ih + rw [pow_succ_list d₁ n, pow_succ_list d₀ n, ListBlank.append_assoc, ListBlank.append_assoc] + exact h + +theorem reset_tail (L r : ListBlank (Fin 2)) : + (toDHCfg (hrstL, .right) (d₀ +> L) (w +> r)) [target_tm]⊢* + (toDHCfg (hR, .right) (d₀ +> (d₁ +> L)) (z +> r)) := by + have h₁ := steps_spec target_tm 20 ⟨[0, 1, 0], [1, 0, 0], D, .right⟩ + (x' := ⟨[0, 1, 0, 1, 0, 1], [], A, .left⟩) (by decide) (d₀ +> L) ([1, 0] +> r) + have h₂ := steps_spec target_tm 30 ⟨[0, 1, 0, 1, 0], d₀, A, .left⟩ + (x' := ⟨[0, 0, 0, 1, 0, 1, 0, 1, 0], [], C, .right⟩) (by decide) L (z +> r) + simp only [toCfg, toDHCfg, w, z, d₀, d₁, + ListBlank.append_nil, ListBlank.append_cons] at h₁ h₂ ⊢ + exact stepStar_trans h₁ h₂ + +theorem rule_reset (k : ℕ) (r : ListBlank (Fin 2)) : + (toDHCfg (hL, .left) (d₁ ^ (1 + k) +> dh) (w +> r)) [target_tm]⊢* + (toDHCfg (hR, .right) (d₀ +> (d₁ +> (d₀ ^ k +> dh))) (z +> r)) := by + have h₂ := stepPlus_stepStar ((side_reset_d1_pow (1 + k)).elim_single_left (w +> r)) + have h_eq : d₀ ^ (1 + k) +> dh = d₀ +> (d₀ ^ k +> dh) := by + have hk : 1 + k = k + 1 := by omega + rw [hk, pow_succ_list, ListBlank.append_assoc] + rw [h_eq] at h₂ + exact stepStar_trans h₂ (reset_tail (d₀ ^ k +> dh) r) + +theorem rule_zero : SegRL (flipTM target_tm) hL hR d₀ d₁ := fun l r => by + have h := steps1_spec_true (flipTM target_tm) 50 ⟨[0], d₀, hL.1, .right⟩ + (x' := ⟨[0] ++ d₁, [], hR.1, .left⟩) (by decide) l r + simpa [toCfg, toDHCfg, ListBlank.append_assoc] using h + +theorem rule_carry : SegRR (flipTM target_tm) hL hL d₁ d₁' := fun l r => by + have h := steps_spec (flipTM target_tm) 50 ⟨[0], d₁, hL.1, .right⟩ + (x' := ⟨[0] ++ d₁', [], hL.1, .right⟩) (by decide) l r + simpa [toCfg, toDHCfg, ListBlank.append_assoc] using h + +theorem rule_return : SegLL (flipTM target_tm) hR hR d₁' d₀ := fun l r => by + have h := steps_spec (flipTM target_tm) 50 ⟨[0], d₁', hR.1, .left⟩ + (x' := ⟨[0] ++ d₀, [], hR.1, .left⟩) (by decide) l r + simpa [toCfg, toDHCfg, ListBlank.append_assoc] using h + +theorem sbc_rules : Longitudinal.SBC.Rules target_tm hR hL w u v z d₀ d₁ d₁' dh where + rule_wall := rule_wall + rule_pair := rule_pair + rule_R := rule_R + rule_U := rule_U + rule_odd := rule_odd + rule_V := rule_V + rule_empty := rule_empty + rule_grow := rule_grow + rule_reset := rule_reset + rule_zero := rule_zero + rule_carry := rule_carry + rule_return := rule_return + +theorem init_to_step76 : + (init []) [target_tm]⊢* + (([1, 1, 1, 0, 1, 0, 1] +> ([0, 0, 0, 1, 0, 1] +> default)) {{D}}> ([0] +> default)) := by + have h := steps_spec target_tm 100 + ⟨[0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], A, .right⟩ + (x' := ⟨[1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1], [], D, .right⟩) + (by decide) default default + have h_l : ([0, 0, 0, 0, 0] : List (Fin 2)) +> default = default := + all0_spec (by decide) + have h_r : ([0, 0, 0, 0, 0, 0, 0, 0] : List (Fin 2)) +> default = default := + all0_spec (by decide) + have h_0 : ([0] : List (Fin 2)) +> default = default := + all0_spec (by decide) + have h_init : (default {{A}}> default : Cfg (Fin 2) (Fin 6)) = init [] := rfl + dsimp only [toCfg] at h + rw [h_l, h_r, ListBlank.append_nil, h_init] at h + rw [h_0] + simpa [ListBlank.append_cons, ListBlank.append_nil] using h + +theorem step76_to_step103 : + (([1, 1, 1, 0, 1, 0, 1] +> ([0, 0, 0, 1, 0, 1] +> default)) {{D}}> ([0] +> default)) + [target_tm]⊢* + (CfgAt hR d₀ d₁ dh 0 ([1, 0, 0, 1] +> default)) := by + have h₁ := steps_spec target_tm 100 ⟨[1, 1, 1, 0, 1, 0, 1], [0], D, .right⟩ + (x' := ⟨[0, 0, 1, 0, 1, 0, 0, 1], [], A, .left⟩) (by decide) + ([0, 0, 0, 1, 0, 1] +> default) default + have h₂ := steps_spec target_tm 100 ⟨[0, 0, 1, 0], [0, 0], A, .left⟩ + (x' := ⟨[0, 0, 0, 1, 0, 1], [], C, .right⟩) (by decide) + ([0, 1, 0, 1] +> default) ([1, 0, 0, 1] +> default) + simp only [toCfg, CfgAt, toDHCfg, d₀, d₁, dh, pow_zero_list, + ListBlank.append_nil, ListBlank.append_cons] at h₁ h₂ ⊢ + exact stepStar_trans h₁ h₂ + +theorem round0 : + (CfgAt hR d₀ d₁ dh 0 ([1, 0, 0, 1] +> default)) [target_tm]⊢⁺ + (CfgAt hR d₀ d₁ dh 1 ([1, 1, 0, 1] +> default)) := by + have hG : Longitudinal.SBC.G target_tm hR hL 2 + ([1, 0, 0, 1] +> default) (w +> ([1] +> default)) := by + have h := sideRLs_c_spec target_tm (hs := [(hR, hL)] ^ 2) + (r := [1, 0, 0, 1]) (r' := w ++ [1]) (T := 200) (by decide) + rwa [ListBlank.append_assoc] at h + have hr := Longitudinal.SBC.round sbc_rules (k := 0) (n := 2) (s := [1] +> default) (by decide) hG + exact hr + +theorem round1 : + (CfgAt hR d₀ d₁ dh 1 ([1, 1, 0, 1] +> default)) [target_tm]⊢⁺ + (CfgAt hR d₀ d₁ dh 2 ([1, 1, 0, 1, 0, 0, 1, 1] +> default)) := by + have hG : Longitudinal.SBC.G target_tm hR hL 6 + ([1, 1, 0, 1] +> default) (w +> ([1, 0, 0, 1, 1] +> default)) := by + have h := sideRLs_c_spec target_tm (hs := [(hR, hL)] ^ 6) + (r := [1, 1, 0, 1]) (r' := w ++ [1, 0, 0, 1, 1]) (T := 200) (by decide) + rwa [ListBlank.append_assoc] at h + have hr := Longitudinal.SBC.round sbc_rules (k := 1) (n := 6) (s := + [1, 0, 0, 1, 1] +> default) (by decide) hG + exact hr + +theorem round2 : + (CfgAt hR d₀ d₁ dh 2 ([1, 1, 0, 1, 0, 0, 1, 1] +> default)) [target_tm]⊢⁺ + (S hR w u z d₀ d₁ dh 3 3 2) := by + have hG : Longitudinal.SBC.G target_tm hR hL 14 + ([1, 1, 0, 1, 0, 0, 1, 1] +> default) (w +> (w ^ 3 +> (u ^ 2 +> default))) := by + have h := sideRLs_c_spec target_tm (hs := [(hR, hL)] ^ 14) + (r := [1, 1, 0, 1, 0, 0, 1, 1]) (r' := w ++ (w ^ 3 ++ u ^ 2)) (T := 200) (by decide) + rwa [ListBlank.append_assoc, ListBlank.append_assoc] at h + have hr := Longitudinal.SBC.round sbc_rules (k := 2) (n := 14) (s := w ^ 3 +> (u ^ 2 +> default)) + (by decide) hG + exact hr + +theorem init_reaches : (init []) [target_tm]⊢* (S hR w u z d₀ d₁ dh 3 3 2) := + stepStar_trans init_to_step76 + (stepStar_trans step76_to_step103 + (stepPlus_stepStar (stepPlus_trans round0 (stepPlus_trans round1 round2)))) + + + + +theorem init_to_step147_0792 : + (((default : ListBlank (Fin 2)) {{5}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢* + (([0] +> default) <{{A}} + ([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0] +> ([0, 0, 0, 1] +> default))) := by + have h := steps_spec target_tm 200 + ⟨[0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], F, .right⟩ + (x' := ⟨[0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1], [], A, .left⟩) + (by decide) default default + have h_l : ([0, 0, 0, 0, 0] : List (Fin 2)) +> default = default := + all0_spec (by decide) + have h_r : ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] : List (Fin 2)) +> default = default := + all0_spec (by decide) + dsimp only [toCfg] at h + rw [h_l, h_r, ListBlank.append_nil] at h + simpa [ListBlank.append_cons, ListBlank.append_nil] using h + +theorem step147_to_step186_0792 : + (([0] +> default) <{{A}} + ([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0] +> ([0, 0, 0, 1] +> default))) + [target_tm]⊢* + (CfgAt hR d₀ d₁ dh 1 ([1, 0, 0, 1] +> default)) := by + have h₁ := steps_spec target_tm 200 + ⟨[0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [0], A, .left⟩ + (x' := ⟨[0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1], [], C, .right⟩) (by decide) + default ([0, 0, 0, 1] +> default) + have h₂ := steps_spec target_tm 200 + ⟨[0, 0, 0, 1, 0], [0, 0], C, .right⟩ + (x' := ⟨[0, 1, 0, 1, 0, 1, 0], [], A, .left⟩) (by decide) + ([0, 0, 1, 0, 0, 0, 1, 0, 1] +> default) ([0, 1] +> default) + have h₃ := steps_spec target_tm 200 + ⟨[0, 1, 0, 1, 0], [0], A, .left⟩ + (x' := ⟨[0, 0, 0, 1, 0, 1], [], C, .right⟩) (by decide) + ([0, 1, 0, 0, 0, 1, 0, 1] +> default) ([1, 0, 0, 1] +> default) + simp only [toCfg, CfgAt, toDHCfg, d₀, d₁, dh, pow_zero_list, pow_succ_list, + List.cons_append, List.nil_append, ListBlank.append_nil, ListBlank.append_cons] at h₁ h₂ h₃ ⊢ + exact stepStar_trans h₁ (stepStar_trans h₂ h₃) + +theorem round1_0792 : + (CfgAt hR d₀ d₁ dh 1 ([1, 0, 0, 1] +> default)) [target_tm]⊢⁺ + (CfgAt hR d₀ d₁ dh 2 ([1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] +> default)) := by + have hG : Longitudinal.SBC.G target_tm hR hL 6 + ([1, 0, 0, 1] +> default) + (w +> ([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] +> default)) := by + have h := sideRLs_c_spec target_tm (hs := [(hR, hL)] ^ 6) + (r := [1, 0, 0, 1]) (r' := w ++ [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]) (T := 200) (by decide) + rwa [ListBlank.append_assoc] at h + exact Longitudinal.SBC.round sbc_rules (k := 1) (n := 6) + (s := [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] +> default) (by decide) hG + +theorem round2_0792 : + (CfgAt hR d₀ d₁ dh 2 ([1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] +> default)) + [target_tm]⊢⁺ + (CfgAt hR d₀ d₁ dh 3 + ([1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1] +> default)) := by + have hG : Longitudinal.SBC.G target_tm hR hL 14 + ([1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] +> default) + (w +> ([1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1] +> default)) := by + have h := sideRLs_c_spec target_tm (hs := [(hR, hL)] ^ 14) + (r := [1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]) + (r' := w ++ [1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1]) (T := 200) (by decide) + rwa [ListBlank.append_assoc] at h + exact Longitudinal.SBC.round sbc_rules (k := 2) (n := 14) + (s := [1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1] +> default) (by decide) hG + +theorem round3_0792 : + (CfgAt hR d₀ d₁ dh 3 + ([1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1] +> default)) [target_tm]⊢⁺ + (S hR w u z d₀ d₁ dh 4 6 5) := by + have hG : Longitudinal.SBC.G target_tm hR hL 30 + ([1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1] +> default) + (w +> (w ^ 6 +> (u ^ 5 +> default))) := by + have h := sideRLs_c_spec target_tm (hs := [(hR, hL)] ^ 30) + (r := [1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1]) + (r' := w ++ (w ^ 6 ++ u ^ 5)) (T := 400) (by decide) + rwa [ListBlank.append_assoc, ListBlank.append_assoc] at h + exact Longitudinal.SBC.round sbc_rules (k := 3) (n := 30) (s := w ^ 6 +> (u ^ 5 +> default)) + (by decide) hG + +theorem init_reaches_0792 : + (((default : ListBlank (Fin 2)) {{5}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢* + (S hR w u z d₀ d₁ dh 4 6 5) := + stepStar_trans init_to_step147_0792 + (stepStar_trans step147_to_step186_0792 + (stepPlus_stepStar (stepPlus_trans round1_0792 (stepPlus_trans round2_0792 round3_0792)))) + +theorem is_does_not_halt : IsNotHalt target_tm := + Longitudinal.SBC.does_not_halt sbc_rules init_reaches (by decide) (by decide) + +end Solution + +public section + +open Solution in +theorem is_not_halt_from_0792 : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{5}}> default) [target]⊢* cfg) → + (step target cfg).isSome := by + rw [target_eq_target_tm] + refine Counter.does_not_halt_of_invariant + (Inv := fun c => ∃ k n m, c = S hR w u z d₀ d₁ dh k n m ∧ 2 ≤ k ∧ n + m + 2 ≤ 2 ^ k) + ⟨S hR w u z d₀ d₁ dh 4 6 5, init_reaches_0792, 4, 6, 5, rfl, by decide, by decide⟩ ?_ + rintro _ ⟨k, n, m, rfl, hk, hsum⟩ + obtain ⟨k', n', m', h_step, hk', hsum'⟩ := Longitudinal.SBC.closed sbc_rules hk hsum + exact ⟨S hR w u z d₀ d₁ dh k' n' m', h_step, k', n', m', rfl, hk', hsum'⟩ + +open Solution in +theorem is_not_halt : IsNotHalt target := by + rw [target_eq_target_tm] + exact is_does_not_halt + +end + +end BusyBeaver.M_1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RCHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0LB_1LC1LB_1RD1LA_0RE0RE_0RA1RF_HHH1RD.lean b/BusyBeaver/BB6/NonHalt/M_1RB0LB_1LC1LB_1RD1LA_0RE0RE_0RA1RF_HHH1RD.lean new file mode 100644 index 00000000..c90b920a --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0LB_1LC1LB_1RD1LA_0RE0RE_0RA1RF_HHH1RD.lean @@ -0,0 +1,2458 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge + +open Mathlib Relation Nat Turing BusyBeaver SixState + +@[expose] public section + +namespace BusyBeaver.M_1RB0LB_1LC1LB_1RD1LA_0RE0RE_0RA1RF_HHH1RD + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LB_1LC1LB_1RD1LA_0RE0RE_0RA1RF_HHH1RD" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end BusyBeaver.M_1RB0LB_1LC1LB_1RD1LA_0RE0RE_0RA1RF_HHH1RD + +end + +namespace BusyBeaver.M_1RB0LB_1LC1LB_1RD1LA_0RE0RE_0RA1RF_HHH1RD + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +namespace Solution +-- ============================================================================ +-- Section 1: Execution Helpers, Closed-Invariant Criterion & Stack Rules +-- ============================================================================ + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (c : Cfg Γ Λ) : multiStep M c 0 = some c := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (c : Cfg Γ Λ) : multiStep M c 1 = step M c := rfl + +theorem multiStep_succ (M : Machine Γ Λ) (c : Cfg Γ Λ) (n : ℕ) : + multiStep M c (n + 1) = (multiStep M c n).bind (step M) := by + simp only [multiStep, Function.iterate_succ_apply'] + +theorem multiStep_add (M : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : ℕ) : + multiStep M c₁ (n + m) = (multiStep M c₁ n).bind (fun c₂ => multiStep M c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans (M : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : ℕ) + (h₁ : c₁ [M]⊢^{n} c₂) (h₂ : c₂ [M]⊢^{m} c₃) : + c₁ [M]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem multiStep_step_isSome {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₀ cfg cfg' : Cfg Γ Λ) (n m : Nat) + (hn : multiStep M c₀ n = some cfg) + (hnm : multiStep M c₀ (n + (1 + m)) = some cfg') : + (step M cfg).isSome := by + rw [multiStep_add M c₀ n (1 + m), hn] at hnm + dsimp [Option.bind] at hnm + rw [multiStep_add M cfg 1 m, multiStep_one] at hnm + cases hs : step M cfg with + | none => rw [hs] at hnm; nomatch hnm + | some _ => rfl + +theorem inv_reaches_beyond {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) {c_init : Cfg Γ Λ} (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, (c_init [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') + (N : Nat) : + ∃ (m : Nat) (cfg' : Cfg Γ Λ), multiStep M c_init (N + m) = some cfg' ∧ Inv cfg' := by + induction N with + | zero => + obtain ⟨cfg₀, ⟨n₀, hn₀⟩, h_inv₀⟩ := h_init + refine ⟨n₀, cfg₀, ?_, h_inv₀⟩ + rwa [Nat.zero_add] + | succ N ih => + obtain ⟨m, cfg₁, hm, h_inv₁⟩ := ih + cases m with + | zero => + obtain ⟨cfg₂, ⟨k, hk_pos, hk⟩, h_inv₂⟩ := h_step cfg₁ h_inv₁ + cases k with + | zero => omega + | succ k' => + refine ⟨k', cfg₂, ?_, h_inv₂⟩ + have h_trans := multiStep_trans M c_init cfg₁ cfg₂ N (k' + 1) hm hk + have h_eq : (N + 1) + k' = N + (k' + 1) := by omega + rwa [h_eq] + | succ m' => + refine ⟨m', cfg₁, ?_, h_inv₁⟩ + have h_eq : (N + 1) + m' = N + (m' + 1) := by omega + rwa [h_eq] + +theorem closed_inv_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) {c_init : Cfg Γ Λ} (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, (c_init [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') : + ∀ cfg : Cfg Γ Λ, (c_init [M]⊢* cfg) → (step M cfg).isSome := by + intro cfg ⟨n, hn⟩ + obtain ⟨m, cfg', hnm, _⟩ := inv_reaches_beyond M Inv h_init h_step (n + 1) + have h_eq : (n + 1) + m = n + (1 + m) := by omega + rw [h_eq] at hnm + exact multiStep_step_isSome M c_init cfg cfg' n m hn hnm + +@[simp] theorem pow_zero_list (u : List (Fin 2)) : u ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (u : List (Fin 2)) (n : Nat) : u ^ (n + 1) = u ++ u ^ n := rfl +@[simp] theorem nil_append_list (l : List (Fin 2)) : ([] : List (Fin 2)) ++ l = l := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ + ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : + (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl +@[simp] theorem init_nil : (init ([] : List (Fin 2))) = ⟨some A, ⟨0, default, default⟩⟩ := rfl + +omit [Inhabited Γ] in +@[simp] +theorem listblank_append_pow_add (s : ListBlank (Fin 2)) (n m : ℕ) : + (s <+ (([1] : List (Fin 2)) ^ n)) <+ (([1] : List (Fin 2)) ^ m) = + s <+ (([1] : List (Fin 2)) ^ (n + m)) := by + rw [listblank_append_append, list_pow_add_comm, ← list_pow_add] + +theorem listblank_right_pow_add (s : ListBlank (Fin 2)) (n m : ℕ) : + (([1] : List (Fin 2)) ^ n) +> ((([1] : List (Fin 2)) ^ m) +> s) = + (([1] : List (Fin 2)) ^ (n + m)) +> s := by + rw [← listblank_append_right_assoc, ← list_pow_add] + +def encLeft1 : List ℕ → ListBlank (Fin 2) + | [] => default + | a :: L => ((encLeft1 L).cons 0) <+ (([1] : List (Fin 2)) ^ (a + 1)) + +def encRight1 : List ℕ → ListBlank (Fin 2) + | [] => default + | d :: R => (([1] : List (Fin 2)) ^ (d + 1)) +> ((encRight1 R).cons 0) + +@[simp] theorem encLeft_nil : encLeft1 [] = default := rfl +@[simp] theorem encLeft_cons (a : ℕ) (L : List ℕ) : + encLeft1 (a :: L) = ((encLeft1 L).cons 0) <+ (([1] : List (Fin 2)) ^ (a + 1)) := rfl +@[simp] theorem encRight_nil : encRight1 [] = default := rfl +@[simp] theorem encRight_cons (d : ℕ) (R : List ℕ) : + encRight1 (d :: R) = (([1] : List (Fin 2)) ^ (d + 1)) +> ((encRight1 R).cons 0) := rfl + +def bumpHead : List ℕ → List ℕ + | [] => [0] + | b :: L => (b + 1) :: L + +@[simp] theorem encLeft_cons_one (L : List ℕ) : + (1 : Fin 2) >> encLeft1 L = encLeft1 (bumpHead L) := by + cases L with + | nil => simp [bumpHead, encLeft1] + | cons b L' => rfl + +@[simp] theorem encRight_cons_one (R : List ℕ) : + (1 : Fin 2) >> encRight1 R = encRight1 (bumpHead R) := by + cases R with + | nil => simp [bumpHead, encRight1] + | cons d R' => rfl + +def tailWeight : List ℕ → ℕ + | [] => 0 + | d :: _ => d + +def headWeight : List ℕ → ℕ + | [] => 0 + | a :: _ => a + 1 + +@[simp] theorem encRight_tail_cons_one (R : List ℕ) : + (1 : Fin 2) >> (encRight1 R).tail = encRight1 (tailWeight R :: R.tail) := by + cases R with + | nil => simp [tailWeight, encRight1] + | cons d R' => dsimp [tailWeight, List.tail]; simp + +@[simp] theorem encRight_bumpHead_tail (R : List ℕ) : + (encRight1 (bumpHead R)).tail = encRight1 R := by + cases R with + | nil => simp [bumpHead, encRight1] + | cons d R' => dsimp [bumpHead, encRight1]; simp + +theorem encRight_tail_decomp (R : List ℕ) : + (encRight1 R).tail = (([1] : List (Fin 2)) ^ (tailWeight R)) +> ((encRight1 R.tail).cons 0) := + by + cases R with + | nil => simp [tailWeight, encRight1] + | cons d R' => dsimp [tailWeight, List.tail, encRight1]; simp + +theorem encLeft_decomp (L : List ℕ) : + encLeft1 L = ((encLeft1 L.tail).cons 0) <+ (([1] : List (Fin 2)) ^ (headWeight L)) := by + cases L <;> simp [headWeight, encLeft1] + +macro "finish" : tactic => + `(tactic| (refine ⟨0, ?_⟩; simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, + zero_cons_default, encLeft_nil, encRight_nil, encLeft_cons_one, encRight_cons_one, + encRight_tail_cons_one, encRight_bumpHead_tail, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons, multiStep_zero]; try rfl)) +macro "step" : tactic => `(tactic| ( + try refine stepPlus_stepStar ?_ + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, listblank_append_cons, + listblank_append_nil, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, default_head, + default_tail] + apply step_stepStar_stepPlus (by rfl) + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, + zero_cons_default, default_head, default_tail])) +macro "execute" n:num : tactic => `(tactic| ( + iterate $n step + finish)) + +def cfg_BR (L R : List ℕ) : Cfg (Fin 2) (Fin 6) := + ⟨some B, ⟨0, encLeft1 L, (encRight1 R).tail⟩⟩ + +def cfg_ER (L R : List ℕ) : Cfg (Fin 2) (Fin 6) := + ((encLeft1 L).cons 0) {{E}}> ((encRight1 R).tail) + +def cfg_E00 (L R : List ℕ) : Cfg (Fin 2) (Fin 6) := + cfg_ER L (0 :: R) + +theorem b_walk_left (k : ℕ) (l r : ListBlank (Fin 2)) : + ((l <+ (([1] : List (Fin 2)) ^ k)) <{{B}} r) [target_tm]⊢* + (l <{{B}} ((([1] : List (Fin 2)) ^ k) +> r)) := by + induction k generalizing l r with + | zero => + dsimp [HPow.hPow] + try exact ⟨0, rfl⟩ + | succ k ih => + have h_split : k + 1 = 1 + k := by omega + rw [h_split, list_pow_add, listblank_append_right_assoc] + have h1 : (((l <+ (([1] : List (Fin 2)) ^ k)) <+ (([1] : List (Fin 2)) ^ 1)) <{{B}} r) + [target_tm]⊢⁺ + ((l <+ (([1] : List (Fin 2)) ^ k)) <{{B}} (([1] : List (Fin 2)) ^ 1 +> r)) := by + dsimp [HPow.hPow] + execute 1 + refine stepStar_trans (stepPlus_stepStar h1) ?_ + refine stepStar_trans (ih l (([1] : List (Fin 2)) ^ 1 +> r)) ?_ + rw [← listblank_append_right_assoc, list_pow_add_comm] + try exact ⟨0, rfl⟩ + +theorem rule_BR_nil (R : List ℕ) : + (cfg_BR [] R) [target_tm]⊢⁺ (cfg_ER [0] R) := by + unfold cfg_BR cfg_ER + rw [encLeft_cons, encLeft_nil] + dsimp [HPow.hPow] + execute 3 + +theorem rule_BR_zero (L R : List ℕ) : + (cfg_BR (0 :: L) R) [target_tm]⊢⁺ + (cfg_BR L.tail ((tailWeight R + headWeight L + 3) :: R.tail)) := by + unfold cfg_BR + rw [encLeft_cons 0 L, encLeft_decomp L, encRight_tail_decomp R] + have h_pre : (⟨some B, ⟨0, + ((((encLeft1 L.tail).cons 0) <+ (([1] : List (Fin 2)) ^ (headWeight L))).cons 0) <+ (([1] : + List (Fin 2)) ^ (0 + 1)), + (([1] : List (Fin 2)) ^ (tailWeight R)) +> + ((encRight1 R.tail).cons 0)⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ((((encLeft1 L.tail).cons 0) <+ (([1] : List (Fin 2)) ^ (headWeight L))) <{{B}} ((([1] : List + (Fin 2)) ^ 3) +> ((([1] : List (Fin 2)) ^ (tailWeight R)) +> + ((encRight1 R.tail).cons 0)))) := by + dsimp [HPow.hPow] + execute 5 + refine stepPlus_stepStar_stepPlus h_pre ?_ + refine stepStar_trans (b_walk_left (headWeight L) ((encLeft1 L.tail).cons 0) ((([1] : List (Fin + 2)) ^ 3) +> ((([1] : List (Fin 2)) ^ (tailWeight R)) +> ((encRight1 R.tail).cons 0)))) ?_ + rw [listblank_right_pow_add, listblank_right_pow_add] + have h_eq : headWeight L + 3 + tailWeight R = tailWeight R + headWeight L + 3 := by omega + rw [h_eq, encRight_tail_decomp ((tailWeight R + headWeight L + 3) :: R.tail)] + dsimp [tailWeight, List.tail] + finish + +theorem rule_BR_one (L R : List ℕ) : + (cfg_BR (1 :: L) R) [target_tm]⊢⁺ (cfg_BR L (0 :: (tailWeight R + 1) :: R.tail)) := by + unfold cfg_BR + rw [encLeft_cons 1 L] + dsimp [HPow.hPow] + execute 3 + +theorem rule_BR_ge2 (a : ℕ) (L R : List ℕ) : + (cfg_BR ((a + 2) :: L) R) [target_tm]⊢⁺ + (cfg_BR L ((a + 1) :: (tailWeight R + 1) :: R.tail)) := by + unfold cfg_BR + rw [encLeft_cons (a + 2) L] + have h_split : a + 2 + 1 = 2 + (a + 1) := by omega + rw [h_split, list_pow_add, listblank_append_right_assoc] + have h_pre : (⟨some B, ⟨0, + (((encLeft1 L).cons 0) <+ (([1] : List (Fin 2)) ^ (a + 1))) <+ (([1] : List (Fin 2)) ^ 2), + (encRight1 R).tail⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ((((encLeft1 L).cons 0) <+ (([1] : List (Fin 2)) ^ (a + 1))) <{{B}} ((encRight1 ((tailWeight R + + 1) :: R.tail)).cons 0)) := by + dsimp [HPow.hPow] + execute 3 + refine stepPlus_stepStar_stepPlus h_pre ?_ + refine stepStar_trans (b_walk_left (a + 1) ((encLeft1 L).cons 0) ((encRight1 ((tailWeight R + 1) + :: R.tail)).cons 0)) ?_ + rw [encRight_tail_decomp ((a + 1) :: (tailWeight R + 1) :: R.tail)] + dsimp [tailWeight, List.tail] + finish + +theorem rule_ER_nil (L : List ℕ) : + (cfg_ER L []) [target_tm]⊢⁺ (cfg_BR L [3]) := by + unfold cfg_ER cfg_BR + rw [encRight_cons 3 [], encRight_nil] + dsimp [HPow.hPow] + execute 7 + +theorem rule_ER_zero_zero_nil (L : List ℕ) : + (cfg_ER L [0, 0]) [target_tm]⊢⁺ (cfg_BR (bumpHead L) [3]) := by + unfold cfg_ER cfg_BR + rw [encRight_cons 0 [0], encRight_cons 0 [], encRight_cons 3 [], encRight_nil] + dsimp [HPow.hPow] + execute 12 + +theorem rule_ER_zero_zero_cons (e : ℕ) (L R' : List ℕ) : + (cfg_ER L (0 :: 0 :: e :: R')) [target_tm]⊢⁺ + (cfg_ER (bumpHead (bumpHead L)) ((e + 2) :: R')) := by + unfold cfg_ER + rw [encRight_cons 0 (0 :: e :: R'), encRight_cons 0 (e :: R'), encRight_cons e R', + encRight_cons (e + 2) R'] + dsimp [HPow.hPow] + execute 12 + +theorem rule_ER_zero_succ (d : ℕ) (L R' : List ℕ) : + (cfg_ER L (0 :: (d + 1) :: R')) [target_tm]⊢⁺ (cfg_ER (bumpHead L) (0 :: d :: R')) := by + unfold cfg_ER + rw [encRight_cons 0 ((d + 1) :: R'), encRight_cons (d + 1) R', encRight_cons 0 (d :: R'), + encRight_cons d R'] + dsimp [HPow.hPow] + execute 5 + +theorem rule_ER_two (L R' : List ℕ) : + (cfg_ER L (2 :: R')) [target_tm]⊢⁺ (cfg_ER (1 :: L) (bumpHead R')) := by + unfold cfg_ER + rw [encRight_cons 2 R', encLeft_cons 1 L] + dsimp [HPow.hPow] + execute 3 + +theorem rule_ER_ge3 (d : ℕ) (L R' : List ℕ) : + (cfg_ER L ((d + 3) :: R')) [target_tm]⊢⁺ (cfg_ER (1 :: L) (d :: R')) := by + unfold cfg_ER + rw [encRight_tail_decomp ((d + 3) :: R'), encRight_tail_decomp (d :: R'), encLeft_cons 1 L] + dsimp [tailWeight, List.tail, HPow.hPow] + execute 3 + +theorem rule_ER_peel_all (L R : List ℕ) (d k : ℕ) : + (cfg_ER L ((d + 3 * k) :: R)) [target_tm]⊢* + (cfg_ER (List.replicate k 1 ++ L) (d :: R)) := by + induction k generalizing L with + | zero => + simp only [Nat.mul_zero, Nat.add_zero, List.replicate, List.nil_append] + try exact ⟨0, rfl⟩ + | succ k ih => + have h_arith : d + 3 * (k + 1) = (d + 3 * k) + 3 := by omega + rw [h_arith] + refine stepStar_trans (stepPlus_stepStar (rule_ER_ge3 (d + 3 * k) L R)) ?_ + refine stepStar_trans (ih (1 :: L)) ?_ + have h_rep : List.replicate k 1 ++ (1 :: L) = List.replicate (k + 1) 1 ++ L := by + rw [List.replicate_succ', List.append_assoc, List.singleton_append] + rw [h_rep] + try exact ⟨0, rfl⟩ + +theorem rule_E00_peel_all (a d k : ℕ) (L R : List ℕ) : + (cfg_E00 (a :: L) ((d + k) :: R)) [target_tm]⊢* + (cfg_E00 ((a + k) :: L) (d :: R)) := by + unfold cfg_E00 + induction k generalizing a with + | zero => + simp only [Nat.add_zero] + try exact ⟨0, rfl⟩ + | succ k ih => + have h_arith : d + (k + 1) = (d + k) + 1 := by omega + rw [h_arith] + have h1 := rule_ER_zero_succ (d + k) (a :: L) R + dsimp [bumpHead] at h1 + refine stepStar_trans (stepPlus_stepStar h1) ?_ + refine stepStar_trans (ih (a + 1)) ?_ + have h_eq : (a + 1) + k = a + (k + 1) := by omega + rw [h_eq] + try exact ⟨0, rfl⟩ + +theorem init_to_cfg_BR : + (init []) [target_tm]⊢⁺ (cfg_BR [0] []) := by + unfold cfg_BR + rw [encLeft_cons, encLeft_nil, encRight_nil] + dsimp [HPow.hPow] + execute 1 + +-- ============================================================================ +-- Section 2: `B`-Coordinates, `SweepRel`, and Machine Soundness (`SweepRel_sound`) +-- ============================================================================ + +def incList (B : List ℕ) : List ℕ := B.map (· + 1) + +@[simp] theorem incList_nil : incList [] = [] := rfl +@[simp] theorem incList_cons (b : ℕ) (B : List ℕ) : incList (b :: B) = (b + 1) :: incList B := rfl + +theorem incList_append (X Y : List ℕ) : incList (X ++ Y) = incList X ++ incList Y := + List.map_append + +theorem incList_replicate_zero (n : ℕ) : incList (List.replicate n 0) = List.replicate n 1 := by + induction n <;> simp [incList, *] + +def midR : List ℕ → List ℕ + | [] => [] + | b₀ :: B' => b₀ :: incList B' + +def toR_B : List ℕ → List ℕ + | [] => [] + | b₀ :: B' => (b₀ + 3) :: incList B' + +def evalB (B : List ℕ) : Cfg (Fin 2) (Fin 6) := + cfg_ER [0] (toR_B B) + +def fromQ (u : List ℕ) : List ℕ := u.map (3 * ·) + +@[simp] theorem fromQ_nil : fromQ [] = [] := rfl +@[simp] theorem fromQ_cons (q : ℕ) (u : List ℕ) : fromQ (q :: u) = (3 * q) :: fromQ u := rfl + +theorem fromQ_append (u v : List ℕ) : fromQ (u ++ v) = fromQ u ++ fromQ v := + List.map_append + +theorem fromQ_replicate_zero (n : ℕ) : fromQ (List.replicate n 0) = List.replicate n 0 := by + induction n <;> simp [fromQ, *] + +def stepBlock : List ℕ → List ℕ + | [] => [] + | [q] => List.replicate q 0 + | q :: y :: rest => List.replicate q 0 ++ (y + 1) :: stepBlock rest + +def sb₁ (u : List ℕ) : List ℕ := stepBlock (0 :: u) + +def sumQ1 : List ℕ → ℕ + | [] => 0 + | q :: rest => (q + 1) + sumQ1 rest + +def weightDigit (b : ℕ) : ℕ := + if b % 3 == 2 then b + 4 else b + 3 + +def weightB : List ℕ → ℕ + | [] => 0 + | b :: rest => weightDigit b + weightB rest + +theorem rule_BR_midR (a : ℕ) (L B : List ℕ) (hB : B ≠ []) : + (cfg_BR ((a + 1) :: L) (midR B)) [target_tm]⊢⁺ (cfg_BR L (midR (a :: B))) := by + cases B with + | nil => contradiction + | cons b₀ B' => + cases a with + | zero => + have h := rule_BR_one L (b₀ :: incList B') + dsimp [tailWeight, List.tail, midR] at h ⊢ + exact h + | succ a' => + have h := rule_BR_ge2 a' L (b₀ :: incList B') + dsimp [tailWeight, List.tail, midR] at h ⊢ + exact h + +theorem br_sweep_midR (A B : List ℕ) (hB : B ≠ []) : + (cfg_BR (incList A ++ [0]) (midR B)) [target_tm]⊢* (cfg_BR [0] (midR (A.reverse ++ B))) := by + induction A generalizing B with + | nil => + simp only [incList_nil, List.nil_append, List.reverse_nil] + try exact ⟨0, rfl⟩ + | cons a A' ih => + simp only [incList_cons, List.cons_append, List.reverse_cons, List.append_assoc] + refine stepStar_trans (stepPlus_stepStar (rule_BR_midR a (incList A' ++ [0]) B hB)) ?_ + exact ih (a :: B) (List.cons_ne_nil a B) + +theorem br_sweep (A : List ℕ) : + (cfg_BR (incList A.reverse ++ [0]) [3]) [target_tm]⊢⁺ evalB (A ++ [3]) := by + have h1 : (cfg_BR (incList A.reverse ++ [0]) (midR [3])) [target_tm]⊢* + (cfg_BR [0] (midR (A.reverse.reverse ++ [3]))) := + br_sweep_midR A.reverse [3] (by decide) + have h_mid3 : midR [3] = [3] := rfl + rw [h_mid3, List.reverse_reverse] at h1 + refine stepStar_stepPlus_stepPlus h1 ?_ + cases hA : A ++ [3] with + | nil => + have : (A ++ [3]).length = ([] : List ℕ).length := congrArg List.length hA + simp at this + | cons b₀ B' => + dsimp [midR] + have h2 := rule_BR_zero [] (b₀ :: incList B') + dsimp [tailWeight, headWeight, List.tail] at h2 + have h_add : b₀ + 0 + 3 = b₀ + 3 := by omega + rw [h_add] at h2 + refine stepPlus_trans h2 ?_ + have h3 := rule_BR_nil ((b₀ + 3) :: incList B') + dsimp [evalB, toR_B] + exact h3 + +inductive SweepRel : List ℕ → List ℕ → Prop + | single_end (P : List ℕ) (hP : P.length % 2 = 0) : + SweepRel (fromQ (P ++ [1])) (fromQ (stepBlock P ++ [0, 0, 1])) + | pair_end (P : List ℕ) (hP : P.length % 2 = 1) : + SweepRel (fromQ (P ++ [1])) (fromQ (stepBlock P) ++ [5, 3]) + | append_odd (P : List ℕ) (k : ℕ) (Q Q' : List ℕ) + (hP : P.length % 2 = 1) (hk : 1 ≤ k) (hQ : SweepRel Q Q') : + SweepRel (fromQ P ++ (3 * k + 2) :: Q) (fromQ (stepBlock P) ++ (3 * (k + 1) + 2) :: Q') + | two_end (P : List ℕ) (k : ℕ) (C : List ℕ) (hP : P.length % 2 = 0) : + SweepRel (fromQ P ++ (3 * k + 2) :: fromQ (C ++ [1])) + (fromQ (stepBlock P ++ List.replicate (k + 2 + sumQ1 (C ++ [1])) 0 ++ [1])) + +inductive SweepSteps : ℕ → List ℕ → List ℕ → Prop + | zero (X : List ℕ) : SweepSteps 0 X X + | succ {t : ℕ} {X Y Z : List ℕ} (h1 : SweepRel X Y) (h2 : SweepSteps t Y Z) : + SweepSteps (t + 1) X Z + +theorem SweepSteps_trans {s t : ℕ} {X Y Z : List ℕ} + (h1 : SweepSteps s X Y) (h2 : SweepSteps t Y Z) : SweepSteps (s + t) X Z := by + induction h1 with + | zero _ => + rw [Nat.zero_add] + exact h2 + | @succ s' X' Y' _ hrel _ ih => + rw [Nat.succ_add] + exact SweepSteps.succ hrel (ih h2) + +theorem SweepRel_nonempty {X Y : List ℕ} (h : SweepRel X Y) : X ≠ [] := by + cases h <;> simp [fromQ] + +theorem incList_rev_append_zeros (A : List ℕ) (m : ℕ) : + List.replicate m 1 ++ (incList A.reverse ++ [0]) = + incList (A ++ List.replicate m 0).reverse ++ [0] := by + simp [incList, List.map_replicate, List.append_assoc] + +theorem incList_rev_append_zeros_cons (A : List ℕ) (q z : ℕ) : + (z + 1) :: (List.replicate q 1 ++ (incList A.reverse ++ [0])) = + incList (A ++ List.replicate q 0 ++ [z]).reverse ++ [0] := by + simp [incList, List.map_replicate, List.append_assoc] + +theorem er_pair_step (q y : ℕ) (A rest : List ℕ) (hrest : rest ≠ []) : + (cfg_ER (incList A.reverse ++ [0]) (toR_B (3 * q :: 3 * y :: rest))) [target_tm]⊢⁺ + (cfg_ER (incList (A ++ List.replicate q 0 ++ [3 * (y + 1)]).reverse ++ [0]) (toR_B rest)) := by + cases rest with + | nil => contradiction + | cons r₀ rest' => + have h_toR : toR_B (3 * q :: 3 * y :: r₀ :: rest') = + (0 + 3 * (q + 1)) :: (3 * y + 1) :: (r₀ + 1) :: incList rest' := by + dsimp [toR_B, incList]; congr 1; omega + rw [h_toR] + have h1 := rule_ER_peel_all (incList A.reverse ++ [0]) + ((3 * y + 1) :: (r₀ + 1) :: incList rest') 0 (q + 1) + rw [List.replicate_succ, List.cons_append] at h1 + refine stepStar_stepPlus_stepPlus h1 ?_ + have h2 := rule_E00_peel_all 1 0 (3 * y + 1) + (List.replicate q 1 ++ (incList A.reverse ++ [0])) ((r₀ + 1) :: incList rest') + unfold cfg_E00 at h2 + rw [Nat.zero_add] at h2 + refine stepStar_stepPlus_stepPlus h2 ?_ + have h3 := rule_ER_zero_zero_cons (r₀ + 1) + ((1 + (3 * y + 1)) :: (List.replicate q 1 ++ (incList A.reverse ++ [0]))) (incList rest') + dsimp [bumpHead] at h3 + have h_l : 1 + (3 * y + 1) + 1 + 1 = 3 * (y + 1) + 1 := by omega + have h_r : r₀ + 1 + 2 = r₀ + 3 := by omega + rw [h_l, h_r, incList_rev_append_zeros_cons A q (3 * (y + 1))] at h3 + exact h3 + +theorem er_even_prefix : ∀ (P : List ℕ), P.length % 2 = 0 → ∀ (A rest : List ℕ), rest ≠ [] → + (cfg_ER (incList A.reverse ++ [0]) (toR_B (fromQ P ++ rest))) [target_tm]⊢* + (cfg_ER (incList (A ++ fromQ (stepBlock P)).reverse ++ [0]) (toR_B rest)) + | [], _, A, rest, _ => by + simp [fromQ, stepBlock] + try exact ⟨0, rfl⟩ + | [q], hP, _, _, _ => by + simp at hP + | q :: y :: P', hP, A, rest, hrest => by + have hP' : P'.length % 2 = 0 := by simp only [List.length_cons] at hP; omega + have h_rest' : fromQ P' ++ rest ≠ [] := by + intro h; exact hrest (List.append_eq_nil_iff.mp h).2 + have h1 := er_pair_step q y A (fromQ P' ++ rest) h_rest' + have h2 := er_even_prefix P' hP' (A ++ List.replicate q 0 ++ [3 * (y + 1)]) rest hrest + refine stepStar_trans (stepPlus_stepStar h1) ?_ + have h_eq : A ++ List.replicate q 0 ++ [3 * (y + 1)] ++ fromQ (stepBlock P') = + A ++ fromQ (stepBlock (q :: y :: P')) := by + simp [stepBlock, fromQ, List.map_replicate, List.append_assoc] + rw [h_eq] at h2 + exact h2 + +theorem er_single_end_base (A : List ℕ) : + (cfg_ER (incList A.reverse ++ [0]) (toR_B (fromQ [1]))) [target_tm]⊢⁺ + evalB (A ++ fromQ [0, 0, 1]) := by + have h_toR : toR_B (fromQ [1]) = [0 + 3 * 2] := rfl + rw [h_toR] + refine stepStar_stepPlus_stepPlus (rule_ER_peel_all (incList A.reverse ++ [0]) [] 0 2) ?_ + have h_er0 : cfg_ER (List.replicate 2 1 ++ (incList A.reverse ++ [0])) [0] = + cfg_ER (incList (A ++ [0, 0]).reverse ++ [0]) [] := by + rw [incList_rev_append_zeros A 2] + simp [cfg_ER, encRight1] + rw [h_er0] + refine stepPlus_trans (rule_ER_nil (incList (A ++ [0, 0]).reverse ++ [0])) ?_ + have h_br := br_sweep (A ++ [0, 0]) + have h_eq : A ++ [0, 0] ++ [3] = A ++ fromQ [0, 0, 1] := by simp [fromQ, List.append_assoc] + rwa [h_eq] at h_br + +theorem er_pair_end_base (q : ℕ) (A : List ℕ) : + (cfg_ER (incList A.reverse ++ [0]) (toR_B (fromQ [q, 1]))) [target_tm]⊢⁺ + evalB (A ++ fromQ (stepBlock [q]) ++ [5, 3]) := by + have h_toR : toR_B (fromQ [q, 1]) = (0 + 3 * (q + 1)) :: [4] := by + dsimp [fromQ, toR_B, incList]; congr 1; omega + rw [h_toR] + have h1 := rule_ER_peel_all (incList A.reverse ++ [0]) [4] 0 (q + 1) + rw [List.replicate_succ, List.cons_append] at h1 + refine stepStar_stepPlus_stepPlus h1 ?_ + have h2 := rule_E00_peel_all 1 0 4 (List.replicate q 1 ++ (incList A.reverse ++ [0])) [] + unfold cfg_E00 at h2 + rw [Nat.zero_add] at h2 + refine stepStar_stepPlus_stepPlus h2 ?_ + have h3 := rule_ER_zero_zero_nil ((1 + 4) :: (List.replicate q 1 ++ (incList A.reverse ++ [0]))) + dsimp [bumpHead] at h3 + rw [incList_rev_append_zeros_cons A q 5] at h3 + refine stepPlus_trans h3 ?_ + have h_br := br_sweep (A ++ List.replicate q 0 ++ [5]) + have h_eq : A ++ List.replicate q 0 ++ [5] ++ [3] = + A ++ fromQ (stepBlock [q]) ++ [5, 3] := by + simp [stepBlock, fromQ, List.map_replicate, List.append_assoc] + rwa [h_eq] at h_br + +theorem er_odd_cons_base (q k : ℕ) (A Q : List ℕ) (hQ : Q ≠ []) : + (cfg_ER (incList A.reverse ++ [0]) (toR_B (3 * q :: (3 * k + 2) :: Q))) [target_tm]⊢⁺ + (cfg_ER (incList (A ++ fromQ (stepBlock [q]) ++ [3 * (k + 1) + 2]).reverse ++ [0]) (toR_B Q)) := + by + cases Q with + | nil => contradiction + | cons r₀ Q' => + have h_toR : toR_B (3 * q :: (3 * k + 2) :: r₀ :: Q') = + (0 + 3 * (q + 1)) :: (3 * k + 3) :: (r₀ + 1) :: incList Q' := by + dsimp [toR_B, incList]; congr 1; omega + rw [h_toR] + have h1 := rule_ER_peel_all (incList A.reverse ++ [0]) + ((3 * k + 3) :: (r₀ + 1) :: incList Q') 0 (q + 1) + rw [List.replicate_succ, List.cons_append] at h1 + refine stepStar_stepPlus_stepPlus h1 ?_ + have h2 := rule_E00_peel_all 1 0 (3 * k + 3) + (List.replicate q 1 ++ (incList A.reverse ++ [0])) ((r₀ + 1) :: incList Q') + unfold cfg_E00 at h2 + rw [Nat.zero_add] at h2 + refine stepStar_stepPlus_stepPlus h2 ?_ + have h3 := rule_ER_zero_zero_cons (r₀ + 1) + ((1 + (3 * k + 3)) :: (List.replicate q 1 ++ (incList A.reverse ++ [0]))) (incList Q') + dsimp [bumpHead] at h3 + have h_l : 1 + (3 * k + 3) + 1 + 1 = (3 * (k + 1) + 2) + 1 := by omega + have h_r : r₀ + 1 + 2 = r₀ + 3 := by omega + rw [h_l, h_r, incList_rev_append_zeros_cons A q (3 * (k + 1) + 2)] at h3 + have h_eq : A ++ List.replicate q 0 ++ [3 * (k + 1) + 2] = + A ++ fromQ (stepBlock [q]) ++ [3 * (k + 1) + 2] := by + simp [stepBlock, fromQ, List.map_replicate, List.append_assoc] + rwa [h_eq] at h3 + +theorem er_peel_two_chain (C : List ℕ) (L : List ℕ) : + (cfg_ER L (bumpHead (incList (fromQ (C ++ [1]))))) [target_tm]⊢* + (cfg_ER (List.replicate (sumQ1 (C ++ [1])) 1 ++ L) [0]) := by + induction C generalizing L with + | nil => + dsimp [fromQ, incList, bumpHead, sumQ1] + have h1 := rule_ER_peel_all L [] 2 1 + refine stepStar_trans h1 ?_ + have h2 := rule_ER_two (1 :: L) [] + dsimp [bumpHead] at h2 + exact stepPlus_stepStar h2 + | cons q C' ih => + have h_head : bumpHead (incList (fromQ ((q :: C') ++ [1]))) = + (2 + 3 * q) :: incList (fromQ (C' ++ [1])) := by + simp [fromQ, incList, bumpHead]; omega + rw [h_head] + refine stepStar_trans (rule_ER_peel_all L (incList (fromQ (C' ++ [1]))) 2 q) ?_ + refine stepStar_trans (stepPlus_stepStar (rule_ER_two (List.replicate q 1 ++ L) + (incList (fromQ (C' ++ [1]))))) ?_ + refine stepStar_trans (ih (1 :: (List.replicate q 1 ++ L))) ?_ + have h_rep : List.replicate (sumQ1 (C' ++ [1])) 1 ++ (1 :: (List.replicate q 1 ++ L)) = + List.replicate (sumQ1 ((q :: C') ++ [1])) 1 ++ L := by + simp only [sumQ1, List.cons_append] + rw [show (q + 1) + sumQ1 (C' ++ [1]) = sumQ1 (C' ++ [1]) + 1 + q by omega] + rw [List.replicate_add, List.replicate_add, List.replicate_one] + simp [List.append_assoc] + rw [h_rep] + try exact ⟨0, rfl⟩ + +theorem er_two_end_base (k : ℕ) (C A : List ℕ) : + (cfg_ER (incList A.reverse ++ [0]) (toR_B ((3 * k + 2) :: fromQ (C ++ [1])))) [target_tm]⊢⁺ + evalB (A ++ fromQ (List.replicate (k + 2 + sumQ1 (C ++ [1])) 0 ++ [1])) := by + have h_toR : toR_B ((3 * k + 2) :: fromQ (C ++ [1])) = + (2 + 3 * (k + 1)) :: incList (fromQ (C ++ [1])) := by + dsimp [toR_B]; congr 1; omega + rw [h_toR] + refine stepStar_stepPlus_stepPlus + (rule_ER_peel_all (incList A.reverse ++ [0]) (incList (fromQ (C ++ [1]))) 2 (k + 1)) ?_ + refine stepPlus_stepStar_stepPlus + (rule_ER_two (List.replicate (k + 1) 1 ++ (incList A.reverse ++ [0])) + (incList (fromQ (C ++ [1])))) ?_ + refine stepStar_trans + (er_peel_two_chain C (1 :: (List.replicate (k + 1) 1 ++ (incList A.reverse ++ [0])))) ?_ + have h_er0 : cfg_ER (List.replicate (sumQ1 (C ++ [1])) 1 ++ + (1 :: (List.replicate (k + 1) 1 ++ (incList A.reverse ++ [0])))) [0] = + cfg_ER (incList (A ++ List.replicate (k + 2 + sumQ1 (C ++ [1])) 0).reverse ++ [0]) [] := by + have h_l : List.replicate (sumQ1 (C ++ [1])) 1 ++ + (1 :: (List.replicate (k + 1) 1 ++ (incList A.reverse ++ [0]))) = + incList (A ++ List.replicate (k + 2 + sumQ1 (C ++ [1])) 0).reverse ++ [0] := by + change List.replicate (sumQ1 (C ++ [1])) 1 ++ + (List.replicate (k + 2) 1 ++ (incList A.reverse ++ [0])) = _ + rw [← List.append_assoc, ← List.replicate_add, + show sumQ1 (C ++ [1]) + (k + 2) = k + 2 + sumQ1 (C ++ [1]) by omega, + incList_rev_append_zeros] + rw [h_l] + simp [cfg_ER, encRight1] + rw [h_er0] + refine stepPlus_stepStar (stepPlus_trans + (rule_ER_nil (incList (A ++ List.replicate (k + 2 + sumQ1 (C ++ [1])) 0).reverse ++ [0])) ?_) + have h_br := br_sweep (A ++ List.replicate (k + 2 + sumQ1 (C ++ [1])) 0) + have h_eq : A ++ List.replicate (k + 2 + sumQ1 (C ++ [1])) 0 ++ [3] = + A ++ fromQ (List.replicate (k + 2 + sumQ1 (C ++ [1])) 0 ++ [1]) := by + simp [fromQ, List.map_replicate, List.append_assoc] + rwa [h_eq] at h_br + +-- ============================================================================ +-- Section 3: Graded Homomorphism Laws for `stepBlock` & `SweepRel_sound` +-- ============================================================================ + +@[simp] theorem stepBlock_nil : stepBlock [] = [] := rfl +@[simp] theorem sb₁_nil : sb₁ [] = [] := rfl +theorem sb₁_cons (x : ℕ) (rest : List ℕ) : sb₁ (x :: rest) = (x + 1) :: stepBlock rest := rfl + +theorem stepBlock_iterate_nil (s : ℕ) : stepBlock^[s] [] = [] := by + induction s <;> simp [*] + +theorem length_append_even {u v : List ℕ} (hu : u.length % 2 = 0) (hv : v.length % 2 = 0) : + (u ++ v).length % 2 = 0 := by + rw [List.length_append]; omega + +theorem length_append_odd_odd {u v : List ℕ} (hu : u.length % 2 = 1) (hv : v.length % 2 = 1) : + (u ++ v).length % 2 = 0 := by + rw [List.length_append]; omega + +theorem length_append_odd_even {u v : List ℕ} (hu : u.length % 2 = 1) (hv : v.length % 2 = 0) : + (u ++ v).length % 2 = 1 := by + rw [List.length_append]; omega + +theorem pow_two_succ (n : ℕ) : 2 ^ (n + 1) = 2 ^ n + 2 ^ n := by + rw [Nat.pow_succ]; omega + +theorem stepBlock_append_even : ∀ (P Q : List ℕ), P.length % 2 = 0 → + stepBlock (P ++ Q) = stepBlock P ++ stepBlock Q + | [], Q, _ => rfl + | [q], _, hP => by simp at hP + | q :: y :: P', Q, hP => by + have hP' : P'.length % 2 = 0 := by simp only [List.length_cons] at hP; omega + simp only [List.cons_append, stepBlock, stepBlock_append_even P' Q hP', List.append_assoc] + +theorem stepBlock_append_odd : ∀ (P Q : List ℕ), P.length % 2 = 1 → + stepBlock (P ++ Q) = stepBlock P ++ sb₁ Q + | [], _, hP => by simp at hP + | [q], Q, _ => by + cases Q with + | nil => simp [stepBlock, sb₁] + | cons y Q' => simp [stepBlock, sb₁] + | q :: y :: P', Q, hP => by + have hP' : P'.length % 2 = 1 := by simp only [List.length_cons] at hP; omega + simp only [List.cons_append, stepBlock, stepBlock_append_odd P' Q hP', List.append_assoc] + +theorem sb₁_append_even (P Q : List ℕ) (hP : P.length % 2 = 0) : + sb₁ (P ++ Q) = sb₁ P ++ sb₁ Q := by + cases P with + | nil => rfl + | cons x P' => + have hP' : P'.length % 2 = 1 := by simp only [List.length_cons] at hP; omega + simp only [List.cons_append, sb₁_cons, stepBlock_append_odd P' Q hP'] + +theorem sb₁_append_odd (P Q : List ℕ) (hP : P.length % 2 = 1) : + sb₁ (P ++ Q) = sb₁ P ++ stepBlock Q := by + cases P with + | nil => simp at hP + | cons x P' => + have hP' : P'.length % 2 = 0 := by simp only [List.length_cons] at hP; omega + simp only [List.cons_append, sb₁_cons, stepBlock_append_even P' Q hP'] + +theorem odd_split_even_last : ∀ (P : List ℕ), P.length % 2 = 1 → + ∃ P₀ q, P = P₀ ++ [q] ∧ P₀.length % 2 = 0 ∧ stepBlock P = stepBlock P₀ ++ stepBlock [q] + | [], hP => by simp at hP + | [q], _ => ⟨[], q, rfl, rfl, rfl⟩ + | x :: y :: P', hP => by + have hP' : P'.length % 2 = 1 := by simp only [List.length_cons] at hP; omega + obtain ⟨P₀, q, rfl, hP₀, hsb⟩ := odd_split_even_last P' hP' + refine ⟨x :: y :: P₀, q, by simp, by simp only [List.length_cons] at hP₀ ⊢; omega, ?_⟩ + simp only [List.cons_append, stepBlock, hsb, List.append_assoc] + +theorem SweepRel_sound_acc {X Y : List ℕ} (h : SweepRel X Y) (A : List ℕ) : + (cfg_ER (incList A.reverse ++ [0]) (toR_B X)) [target_tm]⊢⁺ evalB (A ++ Y) := by + induction h generalizing A with + | single_end P hP => + rw [fromQ_append] + have h_pre := er_even_prefix P hP A (fromQ [1]) (by decide) + refine stepStar_stepPlus_stepPlus h_pre ?_ + have h_base := er_single_end_base (A ++ fromQ (stepBlock P)) + have h_eq : A ++ fromQ (stepBlock P) ++ fromQ [0, 0, 1] = + A ++ fromQ (stepBlock P ++ [0, 0, 1]) := by + simp [fromQ_append, List.append_assoc] + rwa [h_eq] at h_base + | pair_end P hP => + obtain ⟨P₀, q, rfl, hP₀, hsb⟩ := odd_split_even_last P hP + rw [List.append_assoc, fromQ_append] + have h_pre := er_even_prefix P₀ hP₀ A (fromQ [q, 1]) (by simp [fromQ]) + refine stepStar_stepPlus_stepPlus h_pre ?_ + have h_base := er_pair_end_base q (A ++ fromQ (stepBlock P₀)) + have h_eq : A ++ fromQ (stepBlock P₀) ++ fromQ (stepBlock [q]) ++ [5, 3] = + A ++ (fromQ (stepBlock (P₀ ++ [q])) ++ [5, 3]) := by + rw [hsb, fromQ_append] + simp [List.append_assoc] + rwa [h_eq] at h_base + | append_odd P k Q Q' hP _ hQ ih => + obtain ⟨P₀, q, rfl, hP₀, hsb⟩ := odd_split_even_last P hP + have h_split : fromQ (P₀ ++ [q]) ++ (3 * k + 2) :: Q = + fromQ P₀ ++ (3 * q :: (3 * k + 2) :: Q) := by + simp [fromQ_append] + rw [h_split] + have h_pre := er_even_prefix P₀ hP₀ A (3 * q :: (3 * k + 2) :: Q) (by simp) + refine stepStar_stepPlus_stepPlus h_pre ?_ + have h_mid := er_odd_cons_base q k (A ++ fromQ (stepBlock P₀)) Q (SweepRel_nonempty hQ) + refine stepPlus_trans h_mid ?_ + have h_rec := ih (A ++ fromQ (stepBlock P₀) ++ fromQ (stepBlock [q]) ++ [3 * (k + 1) + 2]) + have h_eq : A ++ fromQ (stepBlock P₀) ++ fromQ (stepBlock [q]) ++ [3 * (k + 1) + 2] ++ Q' = + A ++ (fromQ (stepBlock (P₀ ++ [q])) ++ (3 * (k + 1) + 2) :: Q') := by + rw [hsb, fromQ_append] + simp [List.append_assoc] + rwa [h_eq] at h_rec + | two_end P k C hP => + have h_pre := er_even_prefix P hP A ((3 * k + 2) :: fromQ (C ++ [1])) (by simp) + refine stepStar_stepPlus_stepPlus h_pre ?_ + have h_base := er_two_end_base k C (A ++ fromQ (stepBlock P)) + have h_eq : A ++ fromQ (stepBlock P) ++ + fromQ (List.replicate (k + 2 + sumQ1 (C ++ [1])) 0 ++ [1]) = + A ++ fromQ (stepBlock P ++ List.replicate (k + 2 + sumQ1 (C ++ [1])) 0 ++ [1]) := by + simp [fromQ_append, List.append_assoc] + rwa [h_eq] at h_base + +theorem SweepRel_sound {X Y : List ℕ} (h : SweepRel X Y) : + (evalB X) [target_tm]⊢⁺ (evalB Y) := by + have h0 := SweepRel_sound_acc h [] + simpa [evalB, incList] using h0 + +theorem SweepSteps_sound_plus {t : ℕ} {X Y : List ℕ} (h : SweepSteps (t + 1) X Y) : + (evalB X) [target_tm]⊢⁺ (evalB Y) := by + induction t generalizing X with + | zero => + cases h with + | succ h1 h2 => + cases h2 + exact SweepRel_sound h1 + | succ t' ih => + cases h with + | succ h1 h2 => + exact stepPlus_trans (SweepRel_sound h1) (ih h2) + +-- ============================================================================ +-- Section 4: Additive Weight Conservation & Even-Prefix Prepend +-- ============================================================================ + +@[simp] theorem sumQ1_nil : sumQ1 [] = 0 := rfl +@[simp] theorem sumQ1_cons (q : ℕ) (rest : List ℕ) : sumQ1 (q :: rest) = (q + 1) + sumQ1 rest := rfl +@[simp] theorem weightB_nil : weightB [] = 0 := rfl +@[simp] theorem weightB_cons (b : ℕ) (rest : List ℕ) : weightB (b :: rest) = + weightDigit b + weightB rest := rfl + +theorem weightDigit_mul_three (q : ℕ) : weightDigit (3 * q) = 3 * (q + 1) := by + unfold weightDigit + have h : (3 * q) % 3 = 0 := Nat.mul_mod_right 3 q + simp [h]; omega + +theorem weightDigit_two_mod_three (k : ℕ) : weightDigit (3 * k + 2) = 3 * k + 6 := by + unfold weightDigit + have h : (3 * k + 2) % 3 = 2 := by omega + simp [h] + +theorem sumQ1_append (u v : List ℕ) : sumQ1 (u ++ v) = sumQ1 u + sumQ1 v := by + induction u with + | nil => simp + | cons q u' ih => simp only [List.cons_append, sumQ1_cons, ih]; omega + +theorem sumQ1_replicate_zero (n : ℕ) : sumQ1 (List.replicate n 0) = n := by + induction n with + | zero => rfl + | succ n ih => simp only [List.replicate_succ, sumQ1_cons, ih]; omega + +theorem weightB_append (X Y : List ℕ) : weightB (X ++ Y) = weightB X + weightB Y := by + induction X with + | nil => simp + | cons b X' ih => simp only [List.cons_append, weightB_cons, ih]; omega + +theorem weightB_fromQ (u : List ℕ) : weightB (fromQ u) = 3 * sumQ1 u := by + induction u with + | nil => rfl + | cons q u' ih => + simp only [fromQ_cons, weightB_cons, weightDigit_mul_three, sumQ1_cons, ih]; omega + +theorem sumQ1_stepBlock_even : ∀ (P : List ℕ), P.length % 2 = 0 → + sumQ1 (stepBlock P) = sumQ1 P + | [], _ => rfl + | [q], hP => by simp at hP + | q :: y :: P', hP => by + have hP' : P'.length % 2 = 0 := by simp only [List.length_cons] at hP; omega + simp only [stepBlock, sumQ1_append, sumQ1_replicate_zero, sumQ1_cons, + sumQ1_stepBlock_even P' hP'] + omega + +theorem sumQ1_stepBlock_odd : ∀ (P : List ℕ), P.length % 2 = 1 → + sumQ1 P = sumQ1 (stepBlock P) + 1 + | [], hP => by simp at hP + | [q], _ => by simp [stepBlock, sumQ1_replicate_zero] + | q :: y :: P', hP => by + have hP' : P'.length % 2 = 1 := by simp only [List.length_cons] at hP; omega + have ih := sumQ1_stepBlock_odd P' hP' + simp only [stepBlock, sumQ1_append, sumQ1_replicate_zero, sumQ1_cons] + omega + +theorem SweepRel_weightB {X Y : List ℕ} (h : SweepRel X Y) : weightB Y = weightB X + 6 := by + induction h with + | single_end P hP => + have h_ev := sumQ1_stepBlock_even P hP + simp only [weightB_fromQ, sumQ1_append, h_ev, sumQ1_cons, sumQ1_nil] + omega + | pair_end P hP => + have h_od := sumQ1_stepBlock_odd P hP + simp only [weightB_append, weightB_fromQ, sumQ1_append, h_od, + sumQ1_cons, sumQ1_nil, weightB_cons, weightB_nil] + dsimp [weightDigit] + omega + | append_odd P k Q Q' hP _ _ ih => + have h_od := sumQ1_stepBlock_odd P hP + simp only [weightB_append, weightB_fromQ, h_od, weightB_cons, weightDigit_two_mod_three] + omega + | two_end P k C hP => + have h_ev := sumQ1_stepBlock_even P hP + rw [weightB_fromQ, sumQ1_append, sumQ1_append, sumQ1_replicate_zero, h_ev, + weightB_append, weightB_fromQ, weightB_cons, weightDigit_two_mod_three, weightB_fromQ] + simp only [sumQ1_cons, sumQ1_nil] + omega + +theorem SweepSteps_weightB {t : ℕ} {X Y : List ℕ} (h : SweepSteps t X Y) : + weightB Y = weightB X + 6 * t := by + induction h with + | zero _ => simp + | succ h1 _ ih => + have hw := SweepRel_weightB h1 + omega + +theorem SweepSteps_sumQ1 {t : ℕ} {C : List ℕ} + (h : SweepSteps t (fromQ [1]) (fromQ (C ++ [1]))) : + sumQ1 (C ++ [1]) = 2 * t + 2 := by + have hw := SweepSteps_weightB h + rw [weightB_fromQ, weightB_fromQ] at hw + dsimp [sumQ1] at hw + omega + +theorem SweepRel_prepend_even (P : List ℕ) (hP : P.length % 2 = 0) {Q Q' : List ℕ} + (hQ : SweepRel Q Q') : + SweepRel (fromQ P ++ Q) (fromQ (stepBlock P) ++ Q') := by + cases hQ with + | single_end P₂ hP₂ => + rw [← fromQ_append, ← List.append_assoc] + have h_step := SweepRel.single_end (P ++ P₂) (length_append_even hP hP₂) + rw [stepBlock_append_even P P₂ hP] at h_step + simpa [fromQ_append, List.append_assoc] using h_step + | pair_end P₂ hP₂ => + rw [← fromQ_append, ← List.append_assoc] + have h_step := SweepRel.pair_end (P ++ P₂) (by rw [List.length_append]; omega) + rw [stepBlock_append_even P P₂ hP] at h_step + simpa [fromQ_append, List.append_assoc] using h_step + | append_odd P₂ k R R' hP₂ hk hR => + rw [← List.append_assoc, ← fromQ_append] + have h_step := SweepRel.append_odd (P ++ P₂) k R R' (by rw [List.length_append]; omega) hk hR + rw [stepBlock_append_even P P₂ hP] at h_step + simpa [fromQ_append, List.append_assoc] using h_step + | two_end P₂ k C hP₂ => + rw [← List.append_assoc, ← fromQ_append] + have h_step := SweepRel.two_end (P ++ P₂) k C (length_append_even hP hP₂) + rw [stepBlock_append_even P P₂ hP] at h_step + simpa [fromQ_append, List.append_assoc] using h_step + +theorem SweepSteps_prepend_even {t : ℕ} (P : List ℕ) {Q Q' : List ℕ} + (hQ : SweepSteps t Q Q') + (hEven : ∀ s < t, (stepBlock^[s] P).length % 2 = 0) : + SweepSteps t (fromQ P ++ Q) (fromQ (stepBlock^[t] P) ++ Q') := by + induction hQ generalizing P with + | zero _ => + simp only [Function.iterate_zero, id_eq] + exact SweepSteps.zero _ + | @succ t' X Y Z h1 _ ih => + have hP0 : P.length % 2 = 0 := hEven 0 (Nat.zero_lt_succ t') + refine SweepSteps.succ (SweepRel_prepend_even P hP0 h1) ?_ + have h_rec := ih (stepBlock P) (fun s hs => by + have h_lt : s + 1 < t' + 1 := Nat.succ_lt_succ hs + have h_it := hEven (s + 1) h_lt + rwa [Function.iterate_succ_apply] at h_it) + rwa [← Function.iterate_succ_apply stepBlock t' P] at h_rec + +-- ============================================================================ +-- Section 5: Iterated `stepBlock` Lemmas, `zeroBlock`, and `psi` / `phi` Lifts +-- ============================================================================ + +theorem stepBlock_iterate_append_even (t : ℕ) (P Q : List ℕ) + (hEven : ∀ s < t, (stepBlock^[s] P).length % 2 = 0) : + stepBlock^[t] (P ++ Q) = stepBlock^[t] P ++ stepBlock^[t] Q := by + induction t generalizing P Q with + | zero => rfl + | succ t' ih => + have h0 : P.length % 2 = 0 := hEven 0 (Nat.zero_lt_succ t') + rw [Function.iterate_succ_apply, stepBlock_append_even P Q h0] + have h_rec := ih (stepBlock P) (stepBlock Q) (fun s hs => by + have h_it := hEven (s + 1) (Nat.succ_lt_succ hs) + rwa [Function.iterate_succ_apply] at h_it) + rwa [← Function.iterate_succ_apply stepBlock t' P, + ← Function.iterate_succ_apply stepBlock t' Q] at h_rec + +theorem stepBlock_iterate_append_singleton (j : ℕ) (u : List ℕ) (d : ℕ) + (hEven : ∀ s < j, (stepBlock^[s] (u ++ [d])).length % 2 = 0) : + stepBlock^[j] (u ++ [d]) = stepBlock^[j] u ++ [d + j] := by + induction j generalizing u d with + | zero => simp + | succ j' ih => + have h0 : (u ++ [d]).length % 2 = 0 := hEven 0 (Nat.zero_lt_succ j') + have hu : u.length % 2 = 1 := by rw [List.length_append] at h0; dsimp at h0; omega + have h1 : stepBlock (u ++ [d]) = stepBlock u ++ [d + 1] := by + rw [stepBlock_append_odd u [d] hu] + rfl + rw [Function.iterate_succ_apply, h1] + have h_rec := ih (stepBlock u) (d + 1) (fun s hs => by + have h_it := hEven (s + 1) (Nat.succ_lt_succ hs) + rwa [Function.iterate_succ_apply, h1] at h_it) + rw [h_rec, ← Function.iterate_succ_apply stepBlock j' u] + have h_add : d + 1 + j' = d + (j' + 1) := by omega + rw [h_add] + +def zeroBlock (k d : ℕ) : List ℕ := + List.replicate (2 ^ k - 1) 0 ++ [d] + +theorem zeroBlock_zero (d : ℕ) : zeroBlock 0 d = [d] := rfl + +theorem zeroBlock_succ (k d : ℕ) : zeroBlock (k + 1) d = zeroBlock k 0 ++ zeroBlock k d := by + unfold zeroBlock + have h_pos : 1 ≤ 2 ^ k := Nat.one_le_pow k 2 (by decide) + have h_pow : 2 ^ (k + 1) - 1 = (2 ^ k - 1) + 1 + (2 ^ k - 1) := by + rw [pow_two_succ k]; omega + rw [h_pow, List.replicate_add, List.replicate_add, List.replicate_one] + simp [List.append_assoc] + +theorem zeroBlock_props (k : ℕ) : + (∀ d, ∀ s < 2 ^ k - 1, (stepBlock^[s] (zeroBlock k d)).length % 2 = 0) ∧ + (∀ d, stepBlock^[2 ^ k - 1] (zeroBlock k d) = [d + (2 ^ k - 1)]) := by + induction k with + | zero => + refine ⟨?_, ?_⟩ + · intro d s hs; change s < 0 at hs; omega + · intro d; rfl + | succ k ih => + obtain ⟨ih_even, ih_end⟩ := ih + have h_pos : 1 ≤ 2 ^ k := Nat.one_le_pow k 2 (by decide) + have h_mid : ∀ d, stepBlock^[2 ^ k - 1] (zeroBlock (k + 1) d) = + [2 ^ k - 1, d + (2 ^ k - 1)] := by + intro d + rw [zeroBlock_succ] + rw [stepBlock_iterate_append_even (2 ^ k - 1) (zeroBlock k 0) (zeroBlock k d) (ih_even 0)] + rw [ih_end 0, ih_end d, Nat.zero_add] + rfl + have h_mid_next : ∀ d, stepBlock^[2 ^ k] (zeroBlock (k + 1) d) = zeroBlock k (d + 2 ^ k) := by + intro d + have h_split : 2 ^ k = (2 ^ k - 1) + 1 := by omega + have h_step : stepBlock^[2 ^ k] (zeroBlock (k + 1) d) = + stepBlock (stepBlock^[2 ^ k - 1] (zeroBlock (k + 1) d)) := by + rw [h_split] + exact Function.iterate_succ_apply' stepBlock (2 ^ k - 1) (zeroBlock (k + 1) d) + rw [h_step, h_mid d] + dsimp [stepBlock, zeroBlock] + have h_add : d + (2 ^ k - 1) + 1 = d + 2 ^ k := by omega + rw [h_add] + refine ⟨?_, ?_⟩ + · intro d s hs + rcases (by omega : s < 2 ^ k - 1 ∨ s = 2 ^ k - 1 ∨ 2 ^ k ≤ s) with hlt | rfl | hge + · rw [zeroBlock_succ] + rw [stepBlock_iterate_append_even s (zeroBlock k 0) (zeroBlock k d) + (fun s' hs' => ih_even 0 s' (Nat.lt_trans hs' hlt))] + exact length_append_even (ih_even 0 s hlt) (ih_even d s hlt) + · rw [h_mid d]; simp + · obtain ⟨s', rfl⟩ : ∃ s', s = s' + 2 ^ k := ⟨s - 2 ^ k, by omega⟩ + have hs' : s' < 2 ^ k - 1 := by + rw [pow_two_succ k] at hs; omega + rw [Function.iterate_add_apply, h_mid_next d] + exact ih_even (d + 2 ^ k) s' hs' + · intro d + have h_split : 2 ^ (k + 1) - 1 = (2 ^ k - 1) + 2 ^ k := by + rw [pow_two_succ k]; omega + have h_step : stepBlock^[2 ^ (k + 1) - 1] (zeroBlock (k + 1) d) = + stepBlock^[2 ^ k - 1] (stepBlock^[2 ^ k] (zeroBlock (k + 1) d)) := by + rw [← Function.iterate_add_apply, h_split] + rw [h_step, h_mid_next d, ih_end (d + 2 ^ k)] + have h_add : d + 2 ^ k + (2 ^ k - 1) = d + (2 ^ (k + 1) - 1) := by + rw [pow_two_succ k]; omega + rw [h_add] + +theorem zeroBlock_double_props (k d : ℕ) : + (∀ s ≤ 2 ^ (k + 1) - 1, (stepBlock^[s] (zeroBlock (k + 2) d)).length % 2 = 0) ∧ + stepBlock^[2 ^ (k + 1) - 1] (zeroBlock (k + 2) d) = + [2 ^ (k + 1) - 1, d + (2 ^ (k + 1) - 1)] := by + have h_pos : 1 ≤ 2 ^ (k + 1) := Nat.one_le_pow (k + 1) 2 (by decide) + have h_lt : ∀ s ≤ 2 ^ (k + 1) - 1, s < 2 ^ (k + 2) - 1 := by + intro s hs; rw [pow_two_succ (k + 1)]; omega + refine ⟨fun s hs => (zeroBlock_props (k + 2)).1 d s (h_lt s hs), ?_⟩ + rw [zeroBlock_succ (k + 1) d] + rw [stepBlock_iterate_append_even (2 ^ (k + 1) - 1) (zeroBlock (k + 1) 0) (zeroBlock (k + 1) d) + ((zeroBlock_props (k + 1)).1 0)] + rw [(zeroBlock_props (k + 1)).2 0, (zeroBlock_props (k + 1)).2 d, Nat.zero_add] + rfl + +theorem zeroBlock_shift_sb1 (k d : ℕ) (rest : List ℕ) : + List.replicate (2 ^ (k + 1) - 1) 0 ++ + sb₁ ((2 ^ (k + 1) - 1) :: (d + (2 ^ (k + 1) - 1)) :: rest) = + zeroBlock (k + 1) (2 ^ (k + 1)) ++ + (List.replicate (d + (2 ^ (k + 1) - 1)) 0 ++ sb₁ rest) := by + change List.replicate (2 ^ (k + 1) - 1) 0 ++ + sb₁ ([2 ^ (k + 1) - 1, d + (2 ^ (k + 1) - 1)] ++ rest) = _ + rw [sb₁_append_even [2 ^ (k + 1) - 1, d + (2 ^ (k + 1) - 1)] rest (by simp)] + have h_pos : 2 ^ (k + 1) - 1 + 1 = 2 ^ (k + 1) := + Nat.sub_add_cancel (Nat.one_le_pow (k + 1) 2 (by decide)) + have h_sb1 : sb₁ [2 ^ (k + 1) - 1, d + (2 ^ (k + 1) - 1)] = + [2 ^ (k + 1)] ++ List.replicate (d + (2 ^ (k + 1) - 1)) 0 := by + simp [sb₁, stepBlock, h_pos] + rw [h_sb1] + simp [zeroBlock, List.append_assoc] + +theorem zeroBlock_shift_sb1_zero (k : ℕ) (rest : List ℕ) : + List.replicate (2 ^ (k + 1) - 1) 0 ++ + sb₁ ((2 ^ (k + 1) - 1) :: (2 ^ (k + 1) - 1) :: rest) = + zeroBlock (k + 1) (2 ^ (k + 1)) ++ + (List.replicate (2 ^ (k + 1) - 1) 0 ++ sb₁ rest) := by + simpa using zeroBlock_shift_sb1 k 0 rest + +def psi : List ℕ → List ℕ + | [] => [] + | x :: u => 0 :: (2 * x) :: psi u + +def phi (u : List ℕ) : List ℕ := + psi u ++ [0] + +def oddMap : List ℕ → List ℕ + | [] => [] + | x :: u => (2 * x + 1) :: oddMap u + +theorem psi_append (u v : List ℕ) : psi (u ++ v) = psi u ++ psi v := by + induction u with + | nil => rfl + | cons x u' ih => simp [psi, ih] + +theorem phi_append (u v : List ℕ) : phi (u ++ v) = psi u ++ phi v := by + simp [phi, psi_append, List.append_assoc] + +theorem psi_replicate_zero (n : ℕ) : psi (List.replicate n 0) = List.replicate (2 * n) 0 := by + induction n with + | zero => rfl + | succ n ih => + rw [List.replicate_succ, psi, Nat.mul_zero, ih] + have h_eq : 2 * (n + 1) = 2 + 2 * n := by omega + rw [h_eq, List.replicate_add] + rfl + +theorem phi_replicate_zero (n : ℕ) : phi (List.replicate n 0) = List.replicate (2 * n + 1) 0 := by + unfold phi + rw [psi_replicate_zero, ← List.replicate_succ'] + +theorem psi_length_even (u : List ℕ) : (psi u).length % 2 = 0 := by + induction u with + | nil => rfl + | cons x u' ih => simp [psi]; omega + +theorem phi_length_odd (u : List ℕ) : (phi u).length % 2 = 1 := by + unfold phi + have h := psi_length_even u + simp [List.length_append]; omega + +theorem oddMap_length (u : List ℕ) : (oddMap u).length = u.length := by + induction u with + | nil => rfl + | cons x u' ih => simp [oddMap, ih] + +theorem stepBlock_psi (u : List ℕ) : stepBlock (psi u) = oddMap u := by + induction u with + | nil => rfl + | cons x u' ih => simp [psi, stepBlock, oddMap, ih] + +theorem stepBlock_phi (u : List ℕ) : stepBlock (phi u) = oddMap u := by + unfold phi + rw [stepBlock_append_even (psi u) [0] (psi_length_even u), stepBlock_psi] + simp [stepBlock] + +theorem stepBlock_oddMap_even : ∀ (u : List ℕ), u.length % 2 = 0 → + stepBlock (oddMap u) = psi (stepBlock u) + | [], _ => rfl + | [q], hu => by simp at hu + | q :: y :: u', hu => by + have hu' : u'.length % 2 = 0 := by simp only [List.length_cons] at hu; omega + simp only [oddMap, stepBlock, psi_append, psi_replicate_zero, + stepBlock_oddMap_even u' hu'] + rw [List.replicate_succ', List.append_assoc] + dsimp [psi] + have h_y : 2 * y + 1 + 1 = 2 * (y + 1) := by omega + rw [h_y] + +theorem stepBlock_oddMap_odd : ∀ (u : List ℕ), u.length % 2 = 1 → + stepBlock (oddMap u) = phi (stepBlock u) + | [], hu => by simp at hu + | [q], _ => by + dsimp [oddMap, stepBlock] + rw [← phi_replicate_zero q] + | q :: y :: u', hu => by + have hu' : u'.length % 2 = 1 := by simp only [List.length_cons] at hu; omega + simp only [oddMap, stepBlock, phi_append, psi_replicate_zero, + stepBlock_oddMap_odd u' hu'] + rw [List.replicate_succ', List.append_assoc] + dsimp [psi] + have h_y : 2 * y + 1 + 1 = 2 * (y + 1) := by omega + rw [h_y] + simp [phi, psi] + +theorem stepBlock_iterate_psi (j : ℕ) (u : List ℕ) + (hEven : ∀ s < j, (stepBlock^[s] u).length % 2 = 0) : + (∀ s < 2 * j, (stepBlock^[s] (psi u)).length % 2 = 0) ∧ + stepBlock^[2 * j] (psi u) = psi (stepBlock^[j] u) := by + induction j generalizing u with + | zero => + refine ⟨fun s hs => by omega, rfl⟩ + | succ j' ih => + have h0 : u.length % 2 = 0 := hEven 0 (Nat.zero_lt_succ j') + have h1 : stepBlock (psi u) = oddMap u := stepBlock_psi u + have h2 : stepBlock^[2] (psi u) = psi (stepBlock u) := by + change stepBlock (stepBlock (psi u)) = psi (stepBlock u) + rw [h1, stepBlock_oddMap_even u h0] + have h_rec := ih (stepBlock u) (fun s hs => by + have h_it := hEven (s + 1) (Nat.succ_lt_succ hs) + rwa [Function.iterate_succ_apply] at h_it) + refine ⟨?_, ?_⟩ + · intro s hs + rcases (by omega : s = 0 ∨ s = 1 ∨ 2 ≤ s) with rfl | rfl | hge + · exact psi_length_even u + · rw [Function.iterate_one, h1, oddMap_length]; exact h0 + · obtain ⟨s', rfl⟩ : ∃ s', s = s' + 2 := ⟨s - 2, by omega⟩ + rw [Function.iterate_add_apply, h2] + exact h_rec.1 s' (by omega) + · have h_mul : 2 * (j' + 1) = 2 * j' + 2 := by omega + rw [h_mul, Function.iterate_add_apply, h2, h_rec.2, + ← Function.iterate_succ_apply stepBlock j' u] + +theorem stepBlock_iterate_phi (j : ℕ) (u : List ℕ) + (hOdd : ∀ s < j, (stepBlock^[s] u).length % 2 = 1) + (hEnd : (stepBlock^[j] u).length % 2 = 0) : + (∀ s < 2 * j + 1, (stepBlock^[s] (phi u)).length % 2 = 1) ∧ + (stepBlock^[2 * j + 1] (phi u)).length % 2 = 0 ∧ + stepBlock^[2 * j + 2] (phi u) = psi (stepBlock^[j + 1] u) := by + induction j generalizing u with + | zero => + dsimp at hEnd + have h1 : stepBlock (phi u) = oddMap u := stepBlock_phi u + refine ⟨?_, ?_, ?_⟩ + · intro s hs + have hs0 : s = 0 := by omega + subst hs0 + exact phi_length_odd u + · rw [Function.iterate_one, h1, oddMap_length]; exact hEnd + · change stepBlock (stepBlock (phi u)) = psi (stepBlock u) + rw [h1, stepBlock_oddMap_even u hEnd] + | succ j' ih => + have h0 : u.length % 2 = 1 := hOdd 0 (Nat.zero_lt_succ j') + have h1 : stepBlock (phi u) = oddMap u := stepBlock_phi u + have h2 : stepBlock^[2] (phi u) = phi (stepBlock u) := by + change stepBlock (stepBlock (phi u)) = phi (stepBlock u) + rw [h1, stepBlock_oddMap_odd u h0] + have h_rec := ih (stepBlock u) (fun s hs => by + have h_it := hOdd (s + 1) (Nat.succ_lt_succ hs) + rwa [Function.iterate_succ_apply] at h_it) (by + rwa [← Function.iterate_succ_apply stepBlock j' u]) + refine ⟨?_, ?_, ?_⟩ + · intro s hs + rcases (by omega : s = 0 ∨ s = 1 ∨ 2 ≤ s) with rfl | rfl | hge + · exact phi_length_odd u + · rw [Function.iterate_one, h1, oddMap_length]; exact h0 + · obtain ⟨s', rfl⟩ : ∃ s', s = s' + 2 := ⟨s - 2, by omega⟩ + rw [Function.iterate_add_apply, h2] + exact h_rec.1 s' (by omega) + · have h_idx : 2 * (j' + 1) + 1 = (2 * j' + 1) + 2 := by omega + rw [h_idx, Function.iterate_add_apply, h2] + exact h_rec.2.1 + · have h_idx : 2 * (j' + 1) + 2 = (2 * j' + 2) + 2 := by omega + rw [h_idx, Function.iterate_add_apply, h2, h_rec.2.2, + ← Function.iterate_succ_apply stepBlock (j' + 1) u] + +-- ============================================================================ +-- Section 6: 0-Indexed `Pc` / `Sc`, `rawP'` / `rawS`, and Stage-$k$ Cascade +-- ============================================================================ + +def PSc : Bool → ℕ → ℕ → List ℕ + | true, 0, c => [1 + c] + | false, 0, c => [c] + | true, k + 1, c => PSc true k 1 ++ PSc false k c + | false, k + 1, c => PSc false k 0 ++ PSc true k c + +def Pc (k c : ℕ) : List ℕ := PSc true k c +def Sc (k c : ℕ) : List ℕ := PSc false k c + +@[simp] theorem Pc_zero (c : ℕ) : Pc 0 c = [1 + c] := rfl +@[simp] theorem Sc_zero (c : ℕ) : Sc 0 c = [c] := rfl +theorem Pc_succ (k c : ℕ) : Pc (k + 1) c = Pc k 1 ++ Sc k c := rfl +theorem Sc_succ (k c : ℕ) : Sc (k + 1) c = Sc k 0 ++ Pc k c := rfl + +def nextMid : List Bool → List Bool + | [] => [] + | false :: bs => true :: nextMid bs + | true :: bs => true :: false :: false :: nextMid bs + +def stepBs (bs : List Bool) : List Bool := + nextMid bs ++ [true] + +def bsSeq : ℕ → List Bool + | 0 => [] + | k + 1 => stepBs (bsSeq k) + +theorem stepBs_iterate_eq (k : ℕ) : stepBs^[k] [] = bsSeq k := by + induction k with + | zero => rfl + | succ k' ih => rw [Function.iterate_succ_apply', ih]; rfl + +def evalW : List Bool → List ℕ + | [] => [] + | false :: bs => 1 :: evalW bs + | true :: bs => 1 :: 0 :: 0 :: evalW bs + +def tailRaw (rkind : Bool) (d : ℕ) : List ℕ := + if rkind then [d + 1] else [0, d] + +def MSeq1 (m : ℕ) : List ℕ := + evalW (bsSeq m) ++ [1] + +def rawP' (m d : ℕ) : List ℕ := + MSeq1 m ++ tailRaw ((m + 1) % 2 == 1) d + +def rawS (m d : ℕ) : List ℕ := + MSeq1 m ++ tailRaw ((m + 1) % 2 == 0) d + +theorem nextMid_append (xs ys : List Bool) : nextMid (xs ++ ys) = nextMid xs ++ nextMid ys := by + induction xs with + | nil => rfl + | cons b xs' ih => cases b <;> simp [nextMid, ih] + +theorem evalW_append (xs ys : List Bool) : evalW (xs ++ ys) = evalW xs ++ evalW ys := by + induction xs with + | nil => rfl + | cons b xs' ih => cases b <;> simp [evalW, ih] + +theorem bsSeq_succ_eq (m : ℕ) : + bsSeq (m + 1) = bsSeq m ++ (if (m + 1) % 2 = 1 then [true] else [false, false]) ++ bsSeq m := by + induction m with + | zero => rfl + | succ m' ih => + have h_lhs : bsSeq (m' + 2) = + nextMid (bsSeq m' ++ (if (m' + 1) % 2 = 1 then [true] else [false, + false]) ++ bsSeq m') ++ [true] := by + change nextMid (bsSeq (m' + 1)) ++ [true] = _ + rw [ih] + rw [h_lhs, nextMid_append, nextMid_append] + change _ = (nextMid (bsSeq m') ++ [true]) ++ + (if (m' + 1 + 1) % 2 = 1 then [true] else [false, false]) ++ + (nextMid (bsSeq m') ++ [true]) + rcases (by omega : (m' + 1) % 2 = 1 ∨ (m' + 1) % 2 = 0) with hod | hev + · have h_next : (m' + 1 + 1) % 2 = 0 := by omega + simp [hod, h_next, nextMid, List.append_assoc] + · have h_next : (m' + 1 + 1) % 2 = 1 := by omega + simp [hev, h_next, nextMid, List.append_assoc] + +theorem MSeq1_succ_eq (m : ℕ) : + MSeq1 (m + 1) = rawS m 0 ++ MSeq1 m := by + unfold rawS MSeq1 + rw [bsSeq_succ_eq m, evalW_append, evalW_append] + rcases (by omega : (m + 1) % 2 = 1 ∨ (m + 1) % 2 = 0) with hod | hev + · simp [hod, evalW, tailRaw, List.append_assoc] + · simp [hev, evalW, tailRaw, List.append_assoc] + +theorem rawP'_succ (m d : ℕ) : rawP' (m + 1) d = rawS m 0 ++ rawS m d := by + unfold rawP' + rw [MSeq1_succ_eq m, List.append_assoc] + have h_b : ((m + 1 + 1) % 2 == 1) = ((m + 1) % 2 == 0) := by + rcases (by omega : (m + 1) % 2 = 0 ∨ (m + 1) % 2 = 1) with h | h + · have h2 : (m + 1 + 1) % 2 = 1 := by omega + simp [h, h2] + · have h2 : (m + 1 + 1) % 2 = 0 := by omega + simp [h, h2] + rw [h_b] + rfl + +theorem rawS_succ (m d : ℕ) : rawS (m + 1) d = rawS m 0 ++ rawP' m d := by + unfold rawS + rw [MSeq1_succ_eq m, List.append_assoc] + have h_b : ((m + 1 + 1) % 2 == 0) = ((m + 1) % 2 == 1) := by + rcases (by omega : (m + 1) % 2 = 0 ∨ (m + 1) % 2 = 1) with h | h + · have h2 : (m + 1 + 1) % 2 = 1 := by omega + simp [h, h2] + · have h2 : (m + 1 + 1) % 2 = 0 := by omega + simp [h, h2] + rw [h_b] + rfl + +theorem rawP'_rawS_len (m : ℕ) : + (∀ d, (rawP' m d).length % 2 = 0) ∧ (∀ d, (rawS m d).length % 2 = 1) := by + induction m with + | zero => + refine ⟨fun d => by simp [rawP', MSeq1, bsSeq, evalW, tailRaw], + fun d => by simp [rawS, MSeq1, bsSeq, evalW, tailRaw]⟩ + | succ m' ih => + refine ⟨fun d => ?_, fun d => ?_⟩ + · rw [rawP'_succ]; exact length_append_odd_odd (ih.2 0) (ih.2 d) + · rw [rawS_succ]; exact length_append_odd_even (ih.2 0) (ih.1 d) + +theorem rawP'_rawS_eval (m : ℕ) : + (∀ d, sb₁ (rawP' m d) = Pc (m + 1) 0 ++ List.replicate d 0) ∧ + (∀ d, stepBlock (rawS m d) = Sc (m + 1) 0 ++ List.replicate d 0) ∧ + (∀ d, stepBlock (rawP' m d) = Sc (m + 1) (d + 1)) ∧ + (∀ d, sb₁ (rawS m d) = Pc (m + 1) (d + 1)) := by + induction m with + | zero => + refine ⟨?_, ?_, ?_, ?_⟩ + · intro d; simp [rawP', MSeq1, bsSeq, evalW, tailRaw, sb₁, stepBlock, Pc, PSc, + List.replicate_succ] + · intro d; simp [rawS, MSeq1, bsSeq, evalW, tailRaw, stepBlock, Sc, PSc, List.replicate_succ] + · intro d + dsimp [rawP', MSeq1, bsSeq, evalW, tailRaw, stepBlock, Sc, PSc] + rw [show d + 1 + 1 = 1 + (d + 1) by omega] + · intro d; simp [rawS, MSeq1, bsSeq, evalW, tailRaw, sb₁, stepBlock, Pc, PSc] + | succ m' ih => + obtain ⟨ih1, ih2, ih3, ih4⟩ := ih + have h_odd0 : (rawS m' 0).length % 2 = 1 := (rawP'_rawS_len m').2 0 + refine ⟨?_, ?_, ?_, ?_⟩ + · intro d + rw [rawP'_succ, sb₁_append_odd (rawS m' 0) (rawS m' d) h_odd0, ih4 0, ih2 d] + simp [Pc_succ, List.append_assoc] + · intro d + rw [rawS_succ, stepBlock_append_odd (rawS m' 0) (rawP' m' d) h_odd0, ih2 0, ih1 d] + simp [Sc_succ, List.append_assoc] + · intro d + rw [rawP'_succ, stepBlock_append_odd (rawS m' 0) (rawS m' d) h_odd0, ih2 0, ih4 d] + simp [Sc_succ] + · intro d + rw [rawS_succ, sb₁_append_odd (rawS m' 0) (rawP' m' d) h_odd0, ih4 0, ih3 d] + rfl + +def endP : ℕ → ℕ → List ℕ + | 0, c => [0, 0, 1 + c] + | m + 1, c => 0 :: rawP' m (2 ^ (m + 2) - 1 + c) + +def endS : ℕ → ℕ → List ℕ + | 0, c => [2 + c] + | m + 1, c => rawS m (2 ^ (m + 2) - 1 + c) + +theorem endP_len_odd (k c : ℕ) : (endP k c).length % 2 = 1 := by + cases k with + | zero => simp [endP] + | succ m => + dsimp [endP] + have h := (rawP'_rawS_len m).1 (2 ^ (m + 2) - 1 + c) + omega + +theorem endS_len_odd (k c : ℕ) : (endS k c).length % 2 = 1 := by + cases k with + | zero => simp [endS] + | succ m => exact (rawP'_rawS_len m).2 (2 ^ (m + 2) - 1 + c) + +theorem stepBlock_endP (k c : ℕ) : + stepBlock (endP k c) = Pc k 0 ++ List.replicate (2 ^ (k + 1) - 1 + c) 0 := by + cases k with + | zero => rfl + | succ m => exact (rawP'_rawS_eval m).1 (2 ^ (m + 2) - 1 + c) + +theorem stepBlock_endS (k c : ℕ) : + stepBlock (endS k c) = Sc k 0 ++ List.replicate (2 ^ (k + 1) - 1 + c) 0 := by + cases k with + | zero => + dsimp [endS, stepBlock, Sc_zero] + rw [show 2 + c = (1 + c) + 1 by omega, List.replicate_succ] + | succ m => exact (rawP'_rawS_eval m).2.1 (2 ^ (m + 2) - 1 + c) + +theorem sb₁_endP (k c : ℕ) : + sb₁ (endP k c) = [1] ++ Sc k (2 ^ (k + 1) + c) := by + cases k with + | zero => + dsimp [endP, sb₁, stepBlock, Sc_zero] + rw [show 1 + c + 1 = 2 + c by omega] + | succ m => + change stepBlock ([0, 0] ++ rawP' m (2 ^ (m + 2) - 1 + c)) = _ + rw [stepBlock_append_even [0, 0] _ (by simp), (rawP'_rawS_eval m).2.2.1] + have h_pos : 1 ≤ 2 ^ (m + 2) := Nat.one_le_pow (m + 2) 2 (by decide) + have h_add : 2 ^ (m + 2) - 1 + c + 1 = 2 ^ (m + 2) + c := by omega + rw [h_add] + rfl + +theorem sb₁_endS (k c : ℕ) : + sb₁ (endS k c) = Pc k (2 ^ (k + 1) + c) := by + cases k with + | zero => + dsimp [endS, sb₁, stepBlock, Pc_zero] + rw [show 2 + c + 1 = 1 + (2 + c) by omega] + | succ m => + dsimp [endS] + rw [(rawP'_rawS_eval m).2.2.2] + have h_pos : 1 ≤ 2 ^ (m + 2) := Nat.one_le_pow (m + 2) 2 (by decide) + have h_add : 2 ^ (m + 2) - 1 + c + 1 = 2 ^ (m + 2) + c := by omega + rw [h_add] + +def evalMid (k : ℕ) : List Bool → List ℕ + | [] => [] + | false :: bs => zeroBlock (k + 1) 0 ++ evalMid k bs + | true :: bs => zeroBlock (k + 1) (2 ^ (k + 1)) ++ evalMid k bs + +def tailStage (k : ℕ) (rkind : Bool) (c : ℕ) : List ℕ := + if rkind then + zeroBlock (k + 1) 0 ++ Pc k c + else + zeroBlock (k + 1) 1 ++ Sc k c + +def stage (k : ℕ) (lkind rkind : Bool) (bs : List Bool) (c : ℕ) : List ℕ := + PSc lkind k 0 ++ evalMid k bs ++ tailStage k rkind c + +theorem evalMid_append (k : ℕ) (xs ys : List Bool) : + evalMid k (xs ++ ys) = evalMid k xs ++ evalMid k ys := by + induction xs with + | nil => rfl + | cons b xs' ih => cases b <;> simp [evalMid, ih, List.append_assoc] + +theorem evalMid_zero_props (bs : List Bool) : + (evalMid 0 bs).length % 2 = 0 ∧ sb₁ (evalMid 0 bs) = evalW bs := by + induction bs with + | nil => exact ⟨rfl, rfl⟩ + | cons b bs' ih => + cases b + · have h_zb : zeroBlock 1 0 = [0, 0] := rfl + dsimp [evalMid, evalW] + rw [h_zb] + refine ⟨length_append_even (by simp) ih.1, ?_⟩ + rw [sb₁_append_even [0, 0] (evalMid 0 bs') (by simp), ih.2] + rfl + · have h_zb : zeroBlock 1 2 = [0, 2] := rfl + dsimp [evalMid, evalW] + rw [h_zb] + refine ⟨length_append_even (by simp) ih.1, ?_⟩ + rw [sb₁_append_even [0, 2] (evalMid 0 bs') (by simp), ih.2] + rfl + +theorem stage_zero_props (lkind rkind : Bool) (bs : List Bool) (c : ℕ) : + (stage 0 lkind rkind bs c).length % 2 = 0 ∧ + stepBlock (stage 0 lkind rkind bs c) = + (if lkind then [0] else []) ++ evalW bs ++ [1] ++ tailRaw rkind (1 + c) := by + unfold stage + have h_left : (PSc lkind 0 0).length % 2 = 1 ∧ + stepBlock (PSc lkind 0 0) = (if lkind then [0] else []) := by + cases lkind <;> exact ⟨by simp [PSc], rfl⟩ + have h_mid := evalMid_zero_props bs + have h_tail : (tailStage 0 rkind c).length % 2 = 1 ∧ + sb₁ (tailStage 0 rkind c) = [1] ++ tailRaw rkind (1 + c) := by + cases rkind + · refine ⟨by simp [tailStage, zeroBlock, Sc_zero], ?_⟩ + dsimp [tailStage, zeroBlock, Sc_zero, tailRaw, sb₁, stepBlock] + rw [Nat.add_comm c 1] + · refine ⟨by simp [tailStage, zeroBlock, Pc_zero], ?_⟩ + rfl + refine ⟨length_append_odd_odd (length_append_odd_even h_left.1 h_mid.1) h_tail.1, ?_⟩ + rw [List.append_assoc, stepBlock_append_odd _ _ h_left.1, h_left.2] + rw [sb₁_append_even (evalMid 0 bs) (tailStage 0 rkind c) h_mid.1, h_mid.2, h_tail.2] + simp [List.append_assoc] + +def evalMid1 (k : ℕ) : List Bool → List ℕ + | [] => [] + | false :: bs => [2 ^ (k + 1) - 1, 2 ^ (k + 1) - 1] ++ evalMid1 k bs + | true :: bs => [2 ^ (k + 1) - 1, 2 ^ (k + 2) + (2 ^ (k + 1) - 1)] ++ evalMid1 k bs + +def tailStage1 (k : ℕ) (rkind : Bool) (c : ℕ) : List ℕ := + if rkind then + [2 ^ (k + 1) - 1, 2 ^ (k + 1) - 1] ++ endP k c + else + [2 ^ (k + 1) - 1, 1 + (2 ^ (k + 1) - 1)] ++ endS k c + +theorem evalMid_succ_step (k : ℕ) (bs : List Bool) : + (∀ s ≤ 2 ^ (k + 1) - 1, (stepBlock^[s] (evalMid (k + 1) bs)).length % 2 = 0) ∧ + stepBlock^[2 ^ (k + 1) - 1] (evalMid (k + 1) bs) = evalMid1 k bs := by + induction bs with + | nil => + refine ⟨fun s _ => by simp [evalMid, stepBlock_iterate_nil], stepBlock_iterate_nil _⟩ + | cons b bs' ih => + cases b + · dsimp [evalMid, evalMid1] + have hz := zeroBlock_double_props k 0 + refine ⟨fun s hs => ?_, ?_⟩ + · rw [stepBlock_iterate_append_even s _ _ (fun s' hs' => + hz.1 s' (Nat.le_of_lt (Nat.lt_of_lt_of_le hs' hs)))] + exact length_append_even (hz.1 s hs) (ih.1 s hs) + · rw [stepBlock_iterate_append_even (2 ^ (k + 1) - 1) _ _ (fun s' hs' => + hz.1 s' (Nat.le_of_lt hs'))] + rw [hz.2, ih.2, Nat.zero_add] + rfl + · dsimp [evalMid, evalMid1] + have hz := zeroBlock_double_props k (2 ^ (k + 2)) + refine ⟨fun s hs => ?_, ?_⟩ + · rw [stepBlock_iterate_append_even s _ _ (fun s' hs' => + hz.1 s' (Nat.le_of_lt (Nat.lt_of_lt_of_le hs' hs)))] + exact length_append_even (hz.1 s hs) (ih.1 s hs) + · rw [stepBlock_iterate_append_even (2 ^ (k + 1) - 1) _ _ (fun s' hs' => + hz.1 s' (Nat.le_of_lt hs'))] + rw [hz.2, ih.2] + rfl + +theorem evalMid1_shift_sb1 (k : ℕ) (bs : List Bool) (rest : List ℕ) : + List.replicate (2 ^ (k + 1) - 1) 0 ++ sb₁ (evalMid1 k bs ++ rest) = + evalMid k (nextMid bs) ++ (List.replicate (2 ^ (k + 1) - 1) 0 ++ sb₁ rest) := by + induction bs with + | nil => simp [evalMid1, nextMid, evalMid] + | cons b bs' ih => + cases b + · dsimp [evalMid1, nextMid, evalMid] + rw [zeroBlock_shift_sb1_zero k (evalMid1 k bs' ++ rest), ih] + simp [List.append_assoc] + · dsimp [evalMid1, nextMid, evalMid] + rw [zeroBlock_shift_sb1 k (2 ^ (k + 2)) (evalMid1 k bs' ++ rest)] + have h_split : 2 ^ (k + 2) + (2 ^ (k + 1) - 1) = + 2 ^ (k + 1) + 2 ^ (k + 1) + (2 ^ (k + 1) - 1) := by + rw [pow_two_succ (k + 1)] + have h_z0 : zeroBlock (k + 1) 0 = List.replicate (2 ^ (k + 1)) 0 := by + unfold zeroBlock + have h_pos : 2 ^ (k + 1) - 1 + 1 = 2 ^ (k + 1) := + Nat.sub_add_cancel (Nat.one_le_pow (k + 1) 2 (by decide)) + rw [← List.replicate_succ', h_pos] + rw [h_split, List.replicate_add, List.replicate_add, ← h_z0, List.append_assoc, + List.append_assoc, ih] + simp [List.append_assoc] + +theorem tailStage1_shift_sb1 (k : ℕ) (rkind : Bool) (c : ℕ) : + List.replicate (2 ^ (k + 1) - 1) 0 ++ sb₁ (tailStage1 k rkind c) = + evalMid k [true] ++ tailStage k (!rkind) (2 ^ (k + 1) + c) := by + have h_pos : 2 ^ (k + 1) - 1 + 1 = 2 ^ (k + 1) := + Nat.sub_add_cancel (Nat.one_le_pow (k + 1) 2 (by decide)) + cases rkind + · dsimp [tailStage1, evalMid, tailStage] + rw [zeroBlock_shift_sb1 k 1 (endS k c), Nat.add_comm 1 (2 ^ (k + 1) - 1), h_pos, sb₁_endS k c] + have h_z0 : zeroBlock (k + 1) 0 = List.replicate (2 ^ (k + 1)) 0 := by + unfold zeroBlock; rw [← List.replicate_succ', h_pos] + rw [h_z0] + simp + · dsimp [tailStage1, evalMid, tailStage] + rw [zeroBlock_shift_sb1_zero k (endP k c), sb₁_endP k c] + unfold zeroBlock + simp [List.append_assoc] + +theorem flip_iterate_eq (k : ℕ) : + (! ·)^[k] true = ((k + 1) % 2 == 1) ∧ (! ·)^[k] false = ((k + 1) % 2 == 0) := by + induction k with + | zero => exact ⟨rfl, rfl⟩ + | succ k' ih => + rw [Function.iterate_succ_apply', Function.iterate_succ_apply', ih.1, ih.2] + rcases (by omega : (k' + 1) % 2 = 0 ∨ (k' + 1) % 2 = 1) with h | h + · have h2 : (k' + 1 + 1) % 2 = 1 := by omega + simp [h, h2] + · have h2 : (k' + 1 + 1) % 2 = 0 := by omega + simp [h, h2] + +theorem Pc_Sc_cascade (k : ℕ) : + (∀ b c, ∀ s < 2 ^ (k + 1) - 1, (stepBlock^[s] (PSc b (k + 1) c)).length % 2 = 0) ∧ + (∀ c, stepBlock^[2 ^ (k + 1) - 1] (Pc (k + 1) c) = endP k c) ∧ + (∀ c, stepBlock^[2 ^ (k + 1) - 1] (Sc (k + 1) c) = endS k c) ∧ + (∀ lkind rkind bs c, + (∀ s < 2 ^ (k + 1) - 1, (stepBlock^[s] (stage k lkind rkind bs c)).length % 2 = 0) ∧ + stepBlock^[2 ^ (k + 1) - 1] (stage k lkind rkind bs c) = + (if lkind then [0] else []) ++ evalW (stepBs^[k] bs) ++ [1] ++ + tailRaw ((! ·)^[k] rkind) (2 ^ (k + 1) - 1 + c)) := by + induction k with + | zero => + refine ⟨?_, ?_, ?_, ?_⟩ + · intro b c s hs + have hs0 : s = 0 := by change s < 1 at hs; omega + subst hs0 + cases b <;> simp [PSc] + · intro c + change [0, 0, c + 1] = [0, 0, 1 + c] + rw [Nat.add_comm c 1] + · intro c + change [1 + c + 1] = [2 + c] + rw [show 1 + c + 1 = 2 + c by omega] + · intro lkind rkind bs c + have h_st := stage_zero_props lkind rkind bs c + refine ⟨?_, ?_⟩ + · intro s hs + have hs0 : s = 0 := by change s < 1 at hs; omega + subst hs0 + exact h_st.1 + · change stepBlock (stage 0 lkind rkind bs c) = _ + rw [h_st.2] + rfl + | succ k' ih => + obtain ⟨ih_even, ih_endP, ih_endS, ih_stage⟩ := ih + have h_pos : 1 ≤ 2 ^ (k' + 1) := Nat.one_le_pow (k' + 1) 2 (by decide) + have h_PSc_end : ∀ (b : Bool) (c : ℕ), stepBlock^[2 ^ (k' + 1) - 1] (PSc b (k' + 1) c) = + if b then endP k' c else endS k' c := by + intro b c; cases b + · exact ih_endS c + · exact ih_endP c + have h_PSc_end_odd : ∀ (b : Bool) (c : ℕ), + (if b then endP k' c else endS k' c).length % 2 = 1 := by + intro b c; cases b + · exact endS_len_odd k' c + · exact endP_len_odd k' c + have h_stage_succ : ∀ lkind rkind bs c, + (∀ s < 2 ^ (k' + 2) - 1, (stepBlock^[s] (stage (k' + 1) lkind rkind bs c)).length % 2 = 0) ∧ + stepBlock^[2 ^ (k' + 2) - 1] (stage (k' + 1) lkind rkind bs c) = + (if lkind then [0] else []) ++ evalW (stepBs^[k' + 1] bs) ++ [1] ++ + tailRaw ((! ·)^[k' + 1] rkind) (2 ^ (k' + 2) - 1 + c) := by + intro lkind rkind bs c + have h_mid := evalMid_succ_step k' bs + have h_tail : (∀ s < 2 ^ (k' + 1) - 1, + (stepBlock^[s] (tailStage (k' + 1) rkind c)).length % 2 = 0) ∧ + stepBlock^[2 ^ (k' + 1) - 1] (tailStage (k' + 1) rkind c) = tailStage1 k' rkind c := by + cases rkind + · change (∀ s < 2 ^ (k' + 1) - 1, + (stepBlock^[s] (zeroBlock (k' + 2) 1 ++ Sc (k' + 1) c)).length % 2 = 0) ∧ + stepBlock^[2 ^ (k' + 1) - 1] (zeroBlock (k' + 2) 1 ++ Sc (k' + 1) c) = + [2 ^ (k' + 1) - 1, 1 + (2 ^ (k' + 1) - 1)] ++ endS k' c + have hz := zeroBlock_double_props k' 1 + refine ⟨fun s hs => ?_, ?_⟩ + · rw [stepBlock_iterate_append_even s _ _ (fun s' hs' => + hz.1 s' (Nat.le_of_lt (Nat.lt_trans hs' hs)))] + exact length_append_even (hz.1 s (Nat.le_of_lt hs)) (ih_even false c s hs) + · rw [stepBlock_iterate_append_even (2 ^ (k' + 1) - 1) _ _ (fun s' hs' => + hz.1 s' (Nat.le_of_lt hs'))] + rw [hz.2, ih_endS c] + · change (∀ s < 2 ^ (k' + 1) - 1, + (stepBlock^[s] (zeroBlock (k' + 2) 0 ++ Pc (k' + 1) c)).length % 2 = 0) ∧ + stepBlock^[2 ^ (k' + 1) - 1] (zeroBlock (k' + 2) 0 ++ Pc (k' + 1) c) = + [2 ^ (k' + 1) - 1, 2 ^ (k' + 1) - 1] ++ endP k' c + have hz := zeroBlock_double_props k' 0 + refine ⟨fun s hs => ?_, ?_⟩ + · rw [stepBlock_iterate_append_even s _ _ (fun s' hs' => + hz.1 s' (Nat.le_of_lt (Nat.lt_trans hs' hs)))] + exact length_append_even (hz.1 s (Nat.le_of_lt hs)) (ih_even true c s hs) + · rw [stepBlock_iterate_append_even (2 ^ (k' + 1) - 1) _ _ (fun s' hs' => + hz.1 s' (Nat.le_of_lt hs'))] + rw [hz.2, ih_endP c, Nat.zero_add] + have h_at_mid : stepBlock^[2 ^ (k' + 1) - 1] (stage (k' + 1) lkind rkind bs c) = + (if lkind then endP k' 0 else endS k' 0) ++ evalMid1 k' bs ++ tailStage1 k' rkind c := by + unfold stage + rw [List.append_assoc] + rw [stepBlock_iterate_append_even (2 ^ (k' + 1) - 1) (PSc lkind (k' + 1) 0) _ (ih_even lkind + 0)] + rw [stepBlock_iterate_append_even (2 ^ (k' + 1) - 1) (evalMid (k' + 1) bs) _ + (fun s' hs' => h_mid.1 s' (Nat.le_of_lt hs'))] + rw [h_PSc_end lkind 0, h_mid.2, h_tail.2, List.append_assoc] + have h_at_next : stepBlock^[2 ^ (k' + 1)] (stage (k' + 1) lkind rkind bs c) = + stage k' lkind (!rkind) (stepBs bs) (2 ^ (k' + 1) + c) := by + have h_split : 2 ^ (k' + 1) = (2 ^ (k' + 1) - 1) + 1 := by omega + have h_step : stepBlock^[2 ^ (k' + 1)] (stage (k' + 1) lkind rkind bs c) = + stepBlock (stepBlock^[2 ^ (k' + 1) - 1] (stage (k' + 1) lkind rkind bs c)) := by + rw [h_split] + exact Function.iterate_succ_apply' stepBlock (2 ^ (k' + 1) - 1) + (stage (k' + 1) lkind rkind bs c) + rw [h_step, h_at_mid] + rw [List.append_assoc, stepBlock_append_odd _ _ (h_PSc_end_odd lkind 0)] + have h_sb_left : stepBlock (if lkind then endP k' 0 else endS k' 0) = + PSc lkind k' 0 ++ List.replicate (2 ^ (k' + 1) - 1) 0 := by + cases lkind + · exact stepBlock_endS k' 0 + · exact stepBlock_endP k' 0 + rw [h_sb_left, List.append_assoc, evalMid1_shift_sb1 k' bs (tailStage1 k' rkind c), + tailStage1_shift_sb1 k' rkind c] + unfold stage stepBs + rw [evalMid_append] + simp [List.append_assoc] + have h_sub := ih_stage lkind (!rkind) (stepBs bs) (2 ^ (k' + 1) + c) + refine ⟨?_, ?_⟩ + · intro s hs + rcases (by omega : s < 2 ^ (k' + 1) - 1 ∨ s = 2 ^ (k' + 1) - 1 ∨ + 2 ^ (k' + 1) ≤ s) with hlt | rfl | hge + · unfold stage + rw [List.append_assoc] + rw [stepBlock_iterate_append_even s (PSc lkind (k' + 1) 0) _ + (fun s' hs' => ih_even lkind 0 s' (Nat.lt_trans hs' hlt))] + rw [stepBlock_iterate_append_even s (evalMid (k' + 1) bs) _ + (fun s' hs' => h_mid.1 s' (Nat.le_of_lt (Nat.lt_trans hs' hlt)))] + exact length_append_even (ih_even lkind 0 s hlt) + (length_append_even (h_mid.1 s (Nat.le_of_lt hlt)) (h_tail.1 s hlt)) + · rw [h_at_mid] + have h1 := h_PSc_end_odd lkind 0 + have h2 : (evalMid1 k' bs).length % 2 = 0 := by + rw [← h_mid.2]; exact h_mid.1 (2 ^ (k' + 1) - 1) (le_refl _) + have h3 : (tailStage1 k' rkind c).length % 2 = 1 := by + cases rkind <;> dsimp [tailStage1] + · have h := endS_len_odd k' c; omega + · have h := endP_len_odd k' c; omega + exact length_append_odd_odd (length_append_odd_even h1 h2) h3 + · obtain ⟨s', rfl⟩ : ∃ s', s = s' + 2 ^ (k' + 1) := ⟨s - 2 ^ (k' + 1), by omega⟩ + have hs' : s' < 2 ^ (k' + 1) - 1 := by + rw [pow_two_succ (k' + 1)] at hs; omega + rw [Function.iterate_add_apply, h_at_next] + exact h_sub.1 s' hs' + · have h_split : 2 ^ (k' + 2) - 1 = (2 ^ (k' + 1) - 1) + 2 ^ (k' + 1) := by + rw [pow_two_succ (k' + 1)]; omega + have h_step : stepBlock^[2 ^ (k' + 2) - 1] (stage (k' + 1) lkind rkind bs c) = + stepBlock^[2 ^ (k' + 1) - 1] (stepBlock^[2 ^ (k' + 1)] (stage (k' + 1) lkind rkind bs + c)) := by + rw [← Function.iterate_add_apply, h_split] + rw [h_step, h_at_next, h_sub.2] + have h_add : 2 ^ (k' + 1) - 1 + (2 ^ (k' + 1) + c) = 2 ^ (k' + 2) - 1 + c := by + rw [pow_two_succ (k' + 1)]; omega + rw [← Function.iterate_succ_apply stepBs k' bs, + ← Function.iterate_succ_apply (! ·) k' rkind, h_add] + have h_Pc_mid : ∀ c, stepBlock^[2 ^ (k' + 1) - 1] (Pc (k' + 2) c) = + endP k' 1 ++ endS k' c := by + intro c + rw [Pc_succ] + rw [stepBlock_iterate_append_even (2 ^ (k' + 1) - 1) (Pc (k' + 1) 1) (Sc (k' + 1) c) + (ih_even true 1)] + rw [ih_endP 1, ih_endS c] + have h_Pc_next : ∀ c, stepBlock^[2 ^ (k' + 1)] (Pc (k' + 2) c) = + stage k' true true [] (2 ^ (k' + 1) + c) := by + intro c + have h_split : 2 ^ (k' + 1) = (2 ^ (k' + 1) - 1) + 1 := by omega + have h_step : stepBlock^[2 ^ (k' + 1)] (Pc (k' + 2) c) = + stepBlock (stepBlock^[2 ^ (k' + 1) - 1] (Pc (k' + 2) c)) := by + rw [h_split] + exact Function.iterate_succ_apply' stepBlock (2 ^ (k' + 1) - 1) (Pc (k' + 2) c) + rw [h_step, h_Pc_mid c] + rw [stepBlock_append_odd (endP k' 1) (endS k' c) (endP_len_odd k' 1), + stepBlock_endP k' 1, sb₁_endS k' c] + rw [List.replicate_succ'] + unfold stage evalMid tailStage zeroBlock Pc + simp only [List.append_assoc, List.nil_append, ↓reduceIte] + have h_Sc_mid : ∀ c, stepBlock^[2 ^ (k' + 1) - 1] (Sc (k' + 2) c) = + endS k' 0 ++ endP k' c := by + intro c + rw [Sc_succ] + rw [stepBlock_iterate_append_even (2 ^ (k' + 1) - 1) (Sc (k' + 1) 0) (Pc (k' + 1) c) + (ih_even false 0)] + rw [ih_endS 0, ih_endP c] + have h_Sc_next : ∀ c, stepBlock^[2 ^ (k' + 1)] (Sc (k' + 2) c) = + stage k' false false [] (2 ^ (k' + 1) + c) := by + intro c + have h_split : 2 ^ (k' + 1) = (2 ^ (k' + 1) - 1) + 1 := by omega + have h_step : stepBlock^[2 ^ (k' + 1)] (Sc (k' + 2) c) = + stepBlock (stepBlock^[2 ^ (k' + 1) - 1] (Sc (k' + 2) c)) := by + rw [h_split] + exact Function.iterate_succ_apply' stepBlock (2 ^ (k' + 1) - 1) (Sc (k' + 2) c) + rw [h_step, h_Sc_mid c] + rw [stepBlock_append_odd (endS k' 0) (endP k' c) (endS_len_odd k' 0), + stepBlock_endS k' 0, sb₁_endP k' c] + unfold stage evalMid tailStage zeroBlock Sc + simp only [Nat.add_zero, List.append_assoc, List.nil_append, Bool.false_eq_true, ↓reduceIte] + refine ⟨?_, ?_, ?_, h_stage_succ⟩ + · intro b c s hs + cases b + · change (stepBlock^[s] (Sc (k' + 2) c)).length % 2 = 0 + rcases (by omega : s < 2 ^ (k' + 1) - 1 ∨ s = 2 ^ (k' + 1) - 1 ∨ + 2 ^ (k' + 1) ≤ s) with hlt | rfl | hge + · rw [Sc_succ, stepBlock_iterate_append_even s (Sc (k' + 1) 0) (Pc (k' + 1) c) + (fun s' hs' => ih_even false 0 s' (Nat.lt_trans hs' hlt))] + exact length_append_even (ih_even false 0 s hlt) (ih_even true c s hlt) + · rw [h_Sc_mid c] + exact length_append_odd_odd (endS_len_odd k' 0) (endP_len_odd k' c) + · obtain ⟨s', rfl⟩ : ∃ s', s = s' + 2 ^ (k' + 1) := ⟨s - 2 ^ (k' + 1), by omega⟩ + have hs' : s' < 2 ^ (k' + 1) - 1 := by rw [pow_two_succ (k' + 1)] at hs; omega + rw [Function.iterate_add_apply, h_Sc_next c] + exact (ih_stage false false [] (2 ^ (k' + 1) + c)).1 s' hs' + · change (stepBlock^[s] (Pc (k' + 2) c)).length % 2 = 0 + rcases (by omega : s < 2 ^ (k' + 1) - 1 ∨ s = 2 ^ (k' + 1) - 1 ∨ + 2 ^ (k' + 1) ≤ s) with hlt | rfl | hge + · rw [Pc_succ, stepBlock_iterate_append_even s (Pc (k' + 1) 1) (Sc (k' + 1) c) + (fun s' hs' => ih_even true 1 s' (Nat.lt_trans hs' hlt))] + exact length_append_even (ih_even true 1 s hlt) (ih_even false c s hlt) + · rw [h_Pc_mid c] + exact length_append_odd_odd (endP_len_odd k' 1) (endS_len_odd k' c) + · obtain ⟨s', rfl⟩ : ∃ s', s = s' + 2 ^ (k' + 1) := ⟨s - 2 ^ (k' + 1), by omega⟩ + have hs' : s' < 2 ^ (k' + 1) - 1 := by rw [pow_two_succ (k' + 1)] at hs; omega + rw [Function.iterate_add_apply, h_Pc_next c] + exact (ih_stage true true [] (2 ^ (k' + 1) + c)).1 s' hs' + · intro c + have h_split : 2 ^ (k' + 2) - 1 = (2 ^ (k' + 1) - 1) + 2 ^ (k' + 1) := by + rw [pow_two_succ (k' + 1)]; omega + have h_step : stepBlock^[2 ^ (k' + 2) - 1] (Pc (k' + 2) c) = + stepBlock^[2 ^ (k' + 1) - 1] (stepBlock^[2 ^ (k' + 1)] (Pc (k' + 2) c)) := by + rw [← Function.iterate_add_apply, h_split] + rw [h_step, h_Pc_next c, (ih_stage true true [] (2 ^ (k' + 1) + c)).2] + rw [stepBs_iterate_eq k', (flip_iterate_eq k').1] + have h_add : 2 ^ (k' + 1) - 1 + (2 ^ (k' + 1) + c) = 2 ^ (k' + 2) - 1 + c := by + rw [pow_two_succ (k' + 1)]; omega + rw [h_add] + rfl + · intro c + have h_split : 2 ^ (k' + 2) - 1 = (2 ^ (k' + 1) - 1) + 2 ^ (k' + 1) := by + rw [pow_two_succ (k' + 1)]; omega + have h_step : stepBlock^[2 ^ (k' + 2) - 1] (Sc (k' + 2) c) = + stepBlock^[2 ^ (k' + 1) - 1] (stepBlock^[2 ^ (k' + 1)] (Sc (k' + 2) c)) := by + rw [← Function.iterate_add_apply, h_split] + rw [h_step, h_Sc_next c, (ih_stage false false [] (2 ^ (k' + 1) + c)).2] + rw [stepBs_iterate_eq k', (flip_iterate_eq k').2] + have h_add : 2 ^ (k' + 1) - 1 + (2 ^ (k' + 1) + c) = 2 ^ (k' + 2) - 1 + c := by + rw [pow_two_succ (k' + 1)]; omega + rw [h_add] + rfl + +-- ============================================================================ +-- Section 7: Simultaneous Era Induction (`tail` & `top`) and `is_does_not_halt` +-- ============================================================================ + +def BSeq (k : ℕ) : List ℕ := + Pc k 0 ++ List.replicate (2 ^ (k + 1)) 0 + +def mSteps : ℕ → ℕ + | 0 => 0 + | 1 => 1 + | k + 2 => 2 ^ (k + 1) + mSteps k + +def ESeq : ℕ → List ℕ + | 0 => BSeq 0 + | 1 => stepBlock (BSeq 1) ++ [0, 0] + | k + 2 => stepBlock^[mSteps (k + 2)] (BSeq (k + 2)) ++ ESeq k + +theorem mSteps_sum (k : ℕ) : mSteps k + mSteps (k + 1) = 2 ^ (k + 1) - 1 := by + induction k with + | zero => rfl + | succ k' ih => + have h_pos : 1 ≤ 2 ^ (k' + 1) := Nat.one_le_pow (k' + 1) 2 (by decide) + change mSteps (k' + 1) + (2 ^ (k' + 1) + mSteps k') = 2 ^ (k' + 2) - 1 + rw [pow_two_succ (k' + 1)] + omega + +theorem mSteps_pos (k : ℕ) : 1 ≤ mSteps (k + 1) := by + cases k with + | zero => rfl + | succ k' => + change 1 ≤ 2 ^ (k' + 1) + mSteps k' + have h_pos : 1 ≤ 2 ^ (k' + 1) := Nat.one_le_pow (k' + 1) 2 (by decide) + omega + +theorem mSteps_lt_pow (k : ℕ) : mSteps k < 2 ^ k := by + induction k using Nat.strongRecOn with + | ind k ih => + rcases k with _ | _ | k' + · decide + · decide + · have hk' := ih k' (by omega) + change 2 ^ (k' + 1) + mSteps k' < 2 ^ (k' + 2) + have h_pow : 2 ^ (k' + 2) = 2 ^ (k' + 1) + 2 ^ k' + 2 ^ k' := by + rw [pow_two_succ (k' + 1), pow_two_succ k']; omega + omega + +theorem two_mul_mSteps (k : ℕ) : + 2 * mSteps (k + 1) = if k % 2 = 0 then mSteps (k + 2) else mSteps (k + 2) - 1 := by + induction k using Nat.strongRecOn with + | ind k ih => + rcases k with _ | _ | k' + · rfl + · rfl + · have hk' := ih k' (by omega) + have h_pos : 1 ≤ mSteps (k' + 2) := mSteps_pos (k' + 1) + have h_pow : 2 ^ (k' + 3) = 2 ^ (k' + 2) + 2 ^ (k' + 2) := pow_two_succ (k' + 2) + change 2 * (2 ^ (k' + 2) + mSteps (k' + 1)) = + if (k' + 2) % 2 = 0 then 2 ^ (k' + 3) + mSteps (k' + 2) + else 2 ^ (k' + 3) + mSteps (k' + 2) - 1 + rw [Nat.add_mod_right k' 2, Nat.mul_add, hk'] + rcases (by omega : k' % 2 = 0 ∨ ¬(k' % 2 = 0)) with hev | hod + · simp only [hev, ↓reduceIte]; omega + · simp only [hod, ↓reduceIte]; omega + +theorem Pc_step_pow (k c : ℕ) : + stepBlock^[2 ^ (k + 1)] (Pc (k + 2) c) = BSeq k ++ Pc k (2 ^ (k + 1) + c) := by + have h_pos : 1 ≤ 2 ^ (k + 1) := Nat.one_le_pow (k + 1) 2 (by decide) + have h_split : 2 ^ (k + 1) = (2 ^ (k + 1) - 1) + 1 := by omega + have h_step : stepBlock^[2 ^ (k + 1)] (Pc (k + 2) c) = + stepBlock (stepBlock^[2 ^ (k + 1) - 1] (Pc (k + 2) c)) := by + rw [h_split] + exact Function.iterate_succ_apply' stepBlock (2 ^ (k + 1) - 1) (Pc (k + 2) c) + rw [h_step, Pc_succ] + rw [stepBlock_iterate_append_even (2 ^ (k + 1) - 1) (Pc (k + 1) 1) (Sc (k + 1) c) + ((Pc_Sc_cascade k).1 true 1)] + rw [(Pc_Sc_cascade k).2.1 1, (Pc_Sc_cascade k).2.2.1 c] + rw [stepBlock_append_odd (endP k 1) (endS k c) (endP_len_odd k 1), + stepBlock_endP k 1, sb₁_endS k c] + have h_sub : 2 ^ (k + 1) - 1 + 1 = 2 ^ (k + 1) := by omega + rw [h_sub] + simp [BSeq, List.append_assoc] + +theorem BSeq_even_succ (k : ℕ) : + ∀ s < 2 ^ (k + 1) - 1, (stepBlock^[s] (BSeq (k + 1))).length % 2 = 0 := by + intro s hs + have h_pos : 1 ≤ 2 ^ (k + 2) := Nat.one_le_pow (k + 2) 2 (by decide) + have h_B : BSeq (k + 1) = Pc (k + 1) 0 ++ zeroBlock (k + 2) 0 := by + unfold BSeq zeroBlock + have h_sub : 2 ^ (k + 2) - 1 + 1 = 2 ^ (k + 2) := by omega + rw [← List.replicate_succ', h_sub] + rw [h_B] + rw [stepBlock_iterate_append_even s (Pc (k + 1) 0) (zeroBlock (k + 2) 0) + (fun s' hs' => (Pc_Sc_cascade k).1 true 0 s' (Nat.lt_trans hs' hs))] + exact length_append_even ((Pc_Sc_cascade k).1 true 0 s hs) + ((zeroBlock_double_props k 0).1 s (Nat.le_of_lt hs)) + +theorem BSeq_even_mSteps (k : ℕ) : + ∀ s < mSteps k, (stepBlock^[s] (BSeq k)).length % 2 = 0 := by + rcases k with _ | _ | k' + · intro s hs; change s < 0 at hs; omega + · intro s hs + have hs0 : s = 0 := by change s < 1 at hs; omega + subst hs0; rfl + · intro s hs + have h_lt : mSteps (k' + 2) ≤ 2 ^ (k' + 2) - 1 := by + have := mSteps_lt_pow (k' + 2); omega + exact BSeq_even_succ (k' + 1) s (Nat.lt_of_lt_of_le hs h_lt) + +theorem Pc_to_ESeq (k : ℕ) : + ∀ c, stepBlock^[2 ^ (k + 1) + mSteps k] (Pc (k + 2) c) = + ESeq k ++ [2 * mSteps (k + 1) + 1 + c] := by + induction k using Nat.strongRecOn with + | ind k ih => + rcases k with _ | _ | k' + · intro c + change stepBlock^[2 ^ 1] (Pc 2 c) = BSeq 0 ++ [3 + c] + rw [Pc_step_pow 0 c] + dsimp [Pc, PSc] + congr 2; omega + · intro c + change stepBlock^[2 ^ 2 + 1] (Pc 3 c) = (stepBlock (BSeq 1) ++ [0, 0]) ++ [5 + c] + have h_step : stepBlock^[2 ^ 2 + 1] (Pc 3 c) = + stepBlock (stepBlock^[2 ^ 2] (Pc 3 c)) := + Function.iterate_succ_apply' stepBlock (2 ^ 2) (Pc 3 c) + rw [h_step, Pc_step_pow 1 c] + rw [stepBlock_append_even (BSeq 1) (Pc 1 (2 ^ (1 + 1) + c)) rfl] + have h_pc1 : stepBlock (Pc 1 (2 ^ (1 + 1) + c)) = [0, 0, 5 + c] := by + dsimp [Pc, PSc, stepBlock] + congr 3; omega + rw [h_pc1] + simp [List.append_assoc] + · intro c + have h_split : 2 ^ (k' + 3) + mSteps (k' + 2) = mSteps (k' + 2) + 2 ^ (k' + 3) := by omega + rw [h_split, Function.iterate_add_apply, Pc_step_pow (k' + 2) c] + rw [stepBlock_iterate_append_even (mSteps (k' + 2)) (BSeq (k' + 2)) + (Pc (k' + 2) (2 ^ (k' + 3) + c)) (BSeq_even_mSteps (k' + 2))] + have h_sub := ih k' (by omega) (2 ^ (k' + 3) + c) + change stepBlock^[mSteps (k' + 2)] (Pc (k' + 2) (2 ^ (k' + 3) + c)) = _ at h_sub + rw [h_sub] + change _ = (stepBlock^[mSteps (k' + 2)] (BSeq (k' + 2)) ++ ESeq k') ++ + [2 * mSteps (k' + 3) + 1 + c] + have h_arith : 2 * mSteps (k' + 1) + 1 + (2 ^ (k' + 3) + c) = + 2 * mSteps (k' + 3) + 1 + c := by + change 2 * mSteps (k' + 1) + 1 + (2 ^ (k' + 3) + c) = + 2 * (2 ^ (k' + 2) + mSteps (k' + 1)) + 1 + c + rw [pow_two_succ (k' + 2)]; omega + rw [h_arith, List.append_assoc] + +theorem ESeq_append_singleton_even (k : ℕ) : + ∀ s < mSteps (k + 1), + (stepBlock^[s] (ESeq k ++ [2 * mSteps (k + 1) + 1])).length % 2 = 0 := by + intro s hs + have h_eq := (Pc_to_ESeq k 0).symm + rw [Nat.add_zero] at h_eq + rw [h_eq, ← Function.iterate_add_apply] + have h_pos : 1 ≤ 2 ^ (k + 1) := Nat.one_le_pow (k + 1) 2 (by decide) + have h_sum := mSteps_sum k + have h_lt : s + (2 ^ (k + 1) + mSteps k) < 2 ^ (k + 2) - 1 := by + rw [pow_two_succ (k + 1)]; omega + exact (Pc_Sc_cascade (k + 1)).1 true 0 _ h_lt + +theorem ESeq_odd_lt (k : ℕ) : + ∀ j < mSteps (k + 1), (stepBlock^[j] (ESeq k)).length % 2 = 1 := by + intro j hj + have h_ev := ESeq_append_singleton_even k j hj + have h_iter := stepBlock_iterate_append_singleton j (ESeq k) (2 * mSteps (k + 1) + 1) + (fun s hs => ESeq_append_singleton_even k s (Nat.lt_trans hs hj)) + rw [h_iter, List.length_append] at h_ev + dsimp at h_ev + omega + +theorem ESeq_at_mSteps_eq (k : ℕ) : + stepBlock^[mSteps (k + 1)] (ESeq k) ++ [3 * mSteps (k + 1) + 1] = endP (k + 1) 0 := by + have h_iter := stepBlock_iterate_append_singleton (mSteps (k + 1)) (ESeq k) + (2 * mSteps (k + 1) + 1) (ESeq_append_singleton_even k) + have h_add : 2 * mSteps (k + 1) + 1 + mSteps (k + 1) = 3 * mSteps (k + 1) + 1 := by omega + rw [h_add] at h_iter + rw [← h_iter] + have h_eq := (Pc_to_ESeq k 0).symm + rw [Nat.add_zero] at h_eq + rw [h_eq, ← Function.iterate_add_apply] + have h_pos : 1 ≤ 2 ^ (k + 1) := Nat.one_le_pow (k + 1) 2 (by decide) + have h_sum := mSteps_sum k + have h_idx : mSteps (k + 1) + (2 ^ (k + 1) + mSteps k) = 2 ^ (k + 2) - 1 := by + rw [pow_two_succ (k + 1)]; omega + rw [h_idx] + exact (Pc_Sc_cascade (k + 1)).2.1 0 + +theorem ESeq_even_at (k : ℕ) : + (stepBlock^[mSteps (k + 1)] (ESeq k)).length % 2 = 0 := by + have h_eq := congrArg List.length (ESeq_at_mSteps_eq k) + have h_odd := endP_len_odd (k + 1) 0 + rw [List.length_append] at h_eq + dsimp at h_eq + omega + +theorem ESeq_to_next_BSeq (k : ℕ) : + stepBlock^[mSteps (k + 1) + 1] (ESeq k) ++ List.replicate (3 * mSteps (k + 1) + 2) 0 = + BSeq (k + 1) := by + have h_sb := congrArg stepBlock (ESeq_at_mSteps_eq k) + rw [stepBlock_append_even (stepBlock^[mSteps (k + 1)] (ESeq k)) [3 * mSteps (k + 1) + 1] + (ESeq_even_at k), stepBlock_endP (k + 1) 0, Nat.add_zero] at h_sb + dsimp [stepBlock] at h_sb + rw [← Function.iterate_succ_apply' stepBlock (mSteps (k + 1)) (ESeq k)] at h_sb + have h_app := congrArg (· ++ [0]) h_sb + have h_pos : 2 ^ (k + 2) - 1 + 1 = 2 ^ (k + 2) := + Nat.sub_add_cancel (Nat.one_le_pow (k + 2) 2 (by decide)) + simp only [List.append_assoc, ← List.replicate_succ'] at h_app + rw [h_pos] at h_app + exact h_app + +theorem SweepSteps_append_odd_iter {t : ℕ} (P : List ℕ) (k : ℕ) {Q Q' : List ℕ} + (hk : 1 ≤ k) (hQ : SweepSteps t Q Q') + (hOdd : ∀ s < t, (stepBlock^[s] P).length % 2 = 1) : + SweepSteps t (fromQ P ++ (3 * k + 2) :: Q) + (fromQ (stepBlock^[t] P) ++ (3 * (k + t) + 2) :: Q') := by + induction hQ generalizing P k with + | zero _ => + simp only [Function.iterate_zero, id_eq, Nat.add_zero] + exact SweepSteps.zero _ + | @succ t' X Y Z h1 _ ih => + have hP0 : P.length % 2 = 1 := hOdd 0 (Nat.zero_lt_succ t') + refine SweepSteps.succ (SweepRel.append_odd P k X Y hP0 hk h1) ?_ + have h_rec := ih (stepBlock P) (k + 1) (by omega) (fun s hs => by + have h_it := hOdd (s + 1) (Nat.succ_lt_succ hs) + rwa [Function.iterate_succ_apply] at h_it) + have h_add : k + 1 + t' = k + (t' + 1) := by omega + rwa [← Function.iterate_succ_apply stepBlock t' P, h_add] at h_rec + +theorem tail_era_induction (k : ℕ) : + SweepSteps (2 ^ (k + 1)) (fromQ [1]) (fromQ (BSeq k ++ [1])) ∧ + SweepSteps (mSteps (k + 2)) (fromQ [1]) (fromQ (ESeq k ++ [1])) ∧ + (∃ C, SweepSteps (mSteps (k + 1) - 1) (fromQ [1]) (fromQ (C ++ [1]))) := by + induction k using Nat.strongRecOn with + | ind k ih => + have h_df : ∃ C, SweepSteps (mSteps (k + 1) - 1) (fromQ [1]) (fromQ (C ++ [1])) := by + rcases k with _ | _ | k' + · exact ⟨[], SweepSteps.zero _⟩ + · exact ⟨[0, 0], SweepSteps.succ (SweepRel.single_end [] rfl) (SweepSteps.zero _)⟩ + · obtain ⟨hB_prev, _, _⟩ := ih (k' + 1) (by omega) + obtain ⟨_, _, ⟨C₀, hC₀⟩⟩ := ih k' (by omega) + have h_pos : 1 ≤ mSteps (k' + 1) := mSteps_pos k' + have h_lt : mSteps (k' + 1) - 1 < 2 ^ (k' + 1) - 1 := by + have := mSteps_lt_pow (k' + 1); omega + have h_prep := SweepSteps_prepend_even (BSeq (k' + 1)) hC₀ (fun s hs => + BSeq_even_succ k' s (Nat.lt_trans hs h_lt)) + rw [← fromQ_append, ← fromQ_append, ← List.append_assoc] at h_prep + have h_tr := SweepSteps_trans hB_prev h_prep + have h_steps : 2 ^ (k' + 2) + (mSteps (k' + 1) - 1) = mSteps (k' + 3) - 1 := + (Nat.add_sub_assoc h_pos (2 ^ (k' + 2))).symm + rw [h_steps] at h_tr + exact ⟨_, h_tr⟩ + rcases k with _ | k₀ + · have h1 : SweepRel (fromQ ([] ++ [1])) (fromQ (stepBlock [] ++ [0, 0, 1])) := + SweepRel.single_end [] rfl + have h2 : SweepRel (fromQ ([0, 0] ++ [1])) (fromQ (stepBlock [0, 0] ++ [0, 0, 1])) := + SweepRel.single_end [0, 0] rfl + have h_two : SweepSteps 2 (fromQ [1]) (fromQ (BSeq 0 ++ [1])) := + SweepSteps.succ h1 (SweepSteps.succ h2 (SweepSteps.zero _)) + exact ⟨h_two, h_two, h_df⟩ + · obtain ⟨_, hE_prev, h_df_prev⟩ := ih k₀ (by omega) + obtain ⟨C, hC⟩ := h_df_prev + have h_pos : 1 ≤ mSteps (k₀ + 1) := mSteps_pos k₀ + have h_pair := SweepRel.pair_end (ESeq k₀) (ESeq_odd_lt k₀ 0 h_pos) + have h_iter := SweepSteps_append_odd_iter (stepBlock (ESeq k₀)) 1 (le_refl 1) hC + (fun s hs => by + have h_lt : s + 1 < mSteps (k₀ + 1) := by omega + have h_od := ESeq_odd_lt k₀ (s + 1) h_lt + rwa [Function.iterate_succ_apply] at h_od) + have h_idx1 : 1 + (mSteps (k₀ + 1) - 1) = mSteps (k₀ + 1) := by omega + have h_idx2 : (mSteps (k₀ + 1) - 1).succ = mSteps (k₀ + 1) := by omega + rw [← Function.iterate_succ_apply stepBlock (mSteps (k₀ + 1) - 1) (ESeq k₀), + h_idx1, h_idx2] at h_iter + have h_two := SweepRel.two_end (stepBlock^[mSteps (k₀ + 1)] (ESeq k₀)) + (mSteps (k₀ + 1)) C (ESeq_even_at k₀) + have h_sumQ := SweepSteps_sumQ1 hC + have h_zeros : mSteps (k₀ + 1) + 2 + sumQ1 (C ++ [1]) = 3 * mSteps (k₀ + 1) + 2 := by omega + rw [h_zeros, ← Function.iterate_succ_apply' stepBlock (mSteps (k₀ + 1)) (ESeq k₀), + ESeq_to_next_BSeq k₀] at h_two + have h_phase2 : SweepSteps (mSteps (k₀ + 1) + 1) + (fromQ (ESeq k₀ ++ [1])) (fromQ (BSeq (k₀ + 1) ++ [1])) := by + have h_tail := SweepSteps_trans h_iter (SweepSteps.succ h_two (SweepSteps.zero _)) + have h_full := SweepSteps.succ h_pair h_tail + have h_cnt : (mSteps (k₀ + 1) - 1) + 1 + 1 = mSteps (k₀ + 1) + 1 := by omega + rwa [h_cnt] at h_full + have hB_curr : SweepSteps (2 ^ (k₀ + 2)) (fromQ [1]) (fromQ (BSeq (k₀ + 1) ++ [1])) := by + have h_tr := SweepSteps_trans hE_prev h_phase2 + have h_sum := mSteps_sum k₀ + have h_cnt : mSteps (k₀ + 2) + (mSteps (k₀ + 1) + 1) = 2 ^ (k₀ + 2) := by + change 2 ^ (k₀ + 1) + mSteps k₀ + (mSteps (k₀ + 1) + 1) = 2 ^ (k₀ + 2) + have h_p : 1 ≤ 2 ^ (k₀ + 1) := Nat.one_le_pow (k₀ + 1) 2 (by decide) + rw [pow_two_succ (k₀ + 1)]; omega + rwa [h_cnt] at h_tr + have hE_curr : SweepSteps (mSteps (k₀ + 3)) (fromQ [1]) (fromQ (ESeq (k₀ + 1) ++ [1])) := by + cases k₀ with + | zero => + have h_step1 := SweepRel.single_end (BSeq 1) rfl + have h_tr := SweepSteps_trans hB_curr (SweepSteps.succ h_step1 (SweepSteps.zero _)) + simpa [ESeq, mSteps, List.append_assoc] using h_tr + | succ k' => + obtain ⟨_, hE_k', _⟩ := ih k' (by omega) + have h_prep := SweepSteps_prepend_even (BSeq (k' + 2)) hE_k' (BSeq_even_mSteps (k' + 2)) + rw [← fromQ_append, ← fromQ_append, ← List.append_assoc] at h_prep + have h_tr := SweepSteps_trans hB_curr h_prep + exact h_tr + exact ⟨hB_curr, hE_curr, h_df⟩ + +theorem reach_tail_two_mul_mSteps (k : ℕ) : + ∃ C, SweepSteps (2 * mSteps (k + 1)) (fromQ [1]) (fromQ (C ++ [1])) := by + have h_eq := two_mul_mSteps k + rcases (by omega : k % 2 = 0 ∨ ¬(k % 2 = 0)) with hev | hod + · rw [hev, ite_eq_left rfl] at h_eq + rw [h_eq] + exact ⟨ESeq k, (tail_era_induction k).2.1⟩ + · rw [ite_eq_right hod] at h_eq + rw [h_eq] + exact (tail_era_induction (k + 1)).2.2 + +theorem top_ESeq_to_next_BSeq (k : ℕ) : + SweepSteps (2 * mSteps (k + 1) + 2) + (fromQ (phi (ESeq k) ++ [1])) (fromQ (phi (BSeq (k + 1)) ++ [1])) := by + set L := mSteps (k + 1) + obtain ⟨h_odd, h_even, h_end⟩ := stepBlock_iterate_phi L (ESeq k) (ESeq_odd_lt k) (ESeq_even_at k) + obtain ⟨C, hC⟩ := reach_tail_two_mul_mSteps k + have h_pair := SweepRel.pair_end (phi (ESeq k)) (phi_length_odd (ESeq k)) + have h_iter := SweepSteps_append_odd_iter (stepBlock (phi (ESeq k))) 1 (le_refl 1) hC + (fun s hs => by + have h_it := h_odd (s + 1) (by omega) + rwa [Function.iterate_succ_apply] at h_it) + rw [← Function.iterate_succ_apply stepBlock (2 * L) (phi (ESeq k)), + Nat.add_comm 1 (2 * L)] at h_iter + have h_two := SweepRel.two_end (stepBlock^[2 * L + 1] (phi (ESeq k))) (2 * L + 1) C h_even + have h_sumQ := SweepSteps_sumQ1 hC + have h_zeros : (2 * L + 1) + 2 + sumQ1 (C ++ [1]) = 2 * (3 * L + 2) + 1 := by omega + rw [h_zeros, ← Function.iterate_succ_apply' stepBlock (2 * L + 1) (phi (ESeq k)), + h_end, ← phi_replicate_zero (3 * L + 2), ← phi_append, ESeq_to_next_BSeq k] at h_two + have h_tail := SweepSteps_trans h_iter (SweepSteps.succ h_two (SweepSteps.zero _)) + exact SweepSteps.succ h_pair h_tail + +theorem top_zero_to_phi_00 : + SweepSteps 2 (fromQ [0, 1]) (fromQ (phi [0, 0] ++ [1])) := by + have h1 : SweepRel (fromQ ([0] ++ [1])) (fromQ (stepBlock [0]) ++ [5, 3]) := + SweepRel.pair_end [0] rfl + have h2 : SweepRel (fromQ [] ++ (3 * 1 + 2) :: fromQ ([] ++ [1])) + (fromQ (stepBlock [] ++ List.replicate (1 + 2 + sumQ1 ([] ++ [1])) 0 ++ [1])) := + SweepRel.two_end [] 1 [] rfl + exact SweepSteps.succ h1 (SweepSteps.succ h2 (SweepSteps.zero _)) + +theorem top_phi_00_to_ESeq0 : + SweepSteps 2 (fromQ (phi [0, 0] ++ [1])) (fromQ (phi (ESeq 0) ++ [1])) := by + have h1 : SweepRel (fromQ (phi [0, 0] ++ [1])) (fromQ (stepBlock (phi [0, 0])) ++ [5, 3]) := + SweepRel.pair_end (phi [0, 0]) rfl + have h2 : SweepRel (fromQ [1, 1] ++ (3 * 1 + 2) :: fromQ ([] ++ [1])) + (fromQ (stepBlock [1, 1] ++ List.replicate (1 + 2 + sumQ1 ([] ++ [1])) 0 ++ [1])) := + SweepRel.two_end [1, 1] 1 [] rfl + exact SweepSteps.succ h1 (SweepSteps.succ h2 (SweepSteps.zero _)) + +theorem top_BSeq_to_ESeq (k : ℕ) + (h_prev : ∀ k' < k, SweepSteps (2 * mSteps (k' + 2)) (fromQ [0, + 1]) (fromQ (phi (ESeq k') ++ [1]))) : + SweepSteps (2 * mSteps (k + 1)) + (fromQ (phi (BSeq (k + 1)) ++ [1])) (fromQ (phi (ESeq (k + 1)) ++ [1])) := by + have h_start : fromQ (phi (BSeq (k + 1)) ++ [1]) = fromQ (psi (BSeq (k + 1))) ++ fromQ [0, 1] := + by + unfold phi + simp [fromQ_append, List.append_assoc] + rw [h_start] + cases k with + | zero => + have h_psi := stepBlock_iterate_psi 1 (BSeq 1) (BSeq_even_mSteps 1) + have h_prep := SweepSteps_prepend_even (psi (BSeq 1)) top_zero_to_phi_00 h_psi.1 + rw [h_psi.2, ← fromQ_append (psi (stepBlock^[1] (BSeq 1))), ← List.append_assoc, + ← phi_append] at h_prep + exact h_prep + | succ k' => + have h_psi := + stepBlock_iterate_psi (mSteps (k' + 2)) (BSeq (k' + 2)) (BSeq_even_mSteps (k' + 2)) + have h_sub := h_prev k' (Nat.lt_succ_self k') + have h_prep := SweepSteps_prepend_even (psi (BSeq (k' + 2))) h_sub h_psi.1 + rw [h_psi.2, ← fromQ_append (psi (stepBlock^[mSteps (k' + 2)] (BSeq (k' + 2)))), + ← List.append_assoc, ← phi_append] at h_prep + exact h_prep + +theorem top_era_reach (k : ℕ) : + SweepSteps (2 * mSteps (k + 2)) (fromQ [0, 1]) (fromQ (phi (ESeq k) ++ [1])) := by + induction k using Nat.strongRecOn with + | ind k ih => + cases k with + | zero => + exact SweepSteps_trans top_zero_to_phi_00 top_phi_00_to_ESeq0 + | succ k₀ => + have h_prev := ih k₀ (Nat.lt_succ_self k₀) + have h_to_B := top_ESeq_to_next_BSeq k₀ + have h_to_E := + top_BSeq_to_ESeq k₀ (fun k' hk' => ih k' (Nat.lt_trans hk' (Nat.lt_succ_self k₀))) + have h_tr := SweepSteps_trans h_prev (SweepSteps_trans h_to_B h_to_E) + have h_sum := mSteps_sum k₀ + have h_cnt : 2 * mSteps (k₀ + 2) + ((2 * mSteps (k₀ + 1) + 2) + 2 * mSteps (k₀ + 1)) = + 2 * mSteps (k₀ + 3) := by + change 2 * (2 ^ (k₀ + 1) + mSteps k₀) + ((2 * mSteps (k₀ + 1) + 2) + 2 * mSteps (k₀ + 1)) = + 2 * (2 ^ (k₀ + 2) + mSteps (k₀ + 1)) + have h_p : 1 ≤ 2 ^ (k₀ + 1) := Nat.one_le_pow (k₀ + 1) 2 (by decide) + rw [pow_two_succ (k₀ + 1)]; omega + rwa [h_cnt] at h_tr + +theorem top_era_step (k : ℕ) : + (evalB (fromQ (phi (ESeq k) ++ [1]))) [target_tm]⊢⁺ (evalB (fromQ (phi (ESeq (k + 1)) ++ + [1]))) := by + have h_to_B := top_ESeq_to_next_BSeq k + have h_to_E := top_BSeq_to_ESeq k (fun k' _ => top_era_reach k') + have h_tr := SweepSteps_trans h_to_B h_to_E + have h_cnt : (2 * mSteps (k + 1) + 2) + 2 * mSteps (k + 1) = + (4 * mSteps (k + 1) + 1) + 1 := by omega + rw [h_cnt] at h_tr + exact SweepSteps_sound_plus h_tr + +theorem init_reaches_fromQ_01 : + (init []) [target_tm]⊢⁺ (evalB (fromQ [0, 1])) := by + refine stepPlus_trans init_to_cfg_BR ?_ + have h1 := rule_BR_zero [] [] + dsimp [tailWeight, headWeight, List.tail] at h1 + refine stepPlus_trans h1 ?_ + refine stepPlus_trans (rule_BR_nil [3]) ?_ + refine stepPlus_trans (rule_ER_ge3 0 [0] []) ?_ + have h_er0 : cfg_ER [1, 0] [0] = cfg_ER [1, 0] [] := by simp [cfg_ER, encRight1] + rw [h_er0] + refine stepPlus_trans (rule_ER_nil [1, 0]) ?_ + exact br_sweep [0] + +def EraInv (cfg : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ k : ℕ, cfg = evalB (fromQ (phi (ESeq k) ++ [1])) + +theorem era_inv_init : ∃ cfg₀, ((init []) [target_tm]⊢* cfg₀) ∧ EraInv cfg₀ := by + have h1 := init_reaches_fromQ_01 + have h2 := SweepSteps_sound_plus (top_era_reach 0) + exact ⟨_, stepPlus_stepStar (stepPlus_trans h1 h2), ⟨0, rfl⟩⟩ + +theorem era_inv_step (cfg : Cfg (Fin 2) (Fin 6)) (hinv : EraInv cfg) : + ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ EraInv cfg' := by + obtain ⟨k, rfl⟩ := hinv + exact ⟨_, top_era_step k, ⟨k + 1, rfl⟩⟩ + + + + +theorem tail_era_step (k₀ : ℕ) : + (evalB (fromQ (ESeq k₀ ++ [1]))) [target_tm]⊢⁺ (evalB (fromQ (ESeq (k₀ + 1) ++ [1]))) := by + obtain ⟨_, _, ⟨C, hC⟩⟩ := tail_era_induction k₀ + have h_pos : 1 ≤ mSteps (k₀ + 1) := mSteps_pos k₀ + have h_pair := SweepRel.pair_end (ESeq k₀) (ESeq_odd_lt k₀ 0 h_pos) + have h_iter := SweepSteps_append_odd_iter (stepBlock (ESeq k₀)) 1 (le_refl 1) hC + (fun s hs => by + have h_lt : s + 1 < mSteps (k₀ + 1) := by omega + have h_od := ESeq_odd_lt k₀ (s + 1) h_lt + rwa [Function.iterate_succ_apply] at h_od) + have h_idx1 : 1 + (mSteps (k₀ + 1) - 1) = mSteps (k₀ + 1) := by omega + have h_idx2 : (mSteps (k₀ + 1) - 1).succ = mSteps (k₀ + 1) := by omega + rw [← Function.iterate_succ_apply stepBlock (mSteps (k₀ + 1) - 1) (ESeq k₀), + h_idx1, h_idx2] at h_iter + have h_two := SweepRel.two_end (stepBlock^[mSteps (k₀ + 1)] (ESeq k₀)) + (mSteps (k₀ + 1)) C (ESeq_even_at k₀) + have h_sumQ := SweepSteps_sumQ1 hC + have h_zeros : mSteps (k₀ + 1) + 2 + sumQ1 (C ++ [1]) = 3 * mSteps (k₀ + 1) + 2 := by omega + rw [h_zeros, ← Function.iterate_succ_apply' stepBlock (mSteps (k₀ + 1)) (ESeq k₀), + ESeq_to_next_BSeq k₀] at h_two + have h_phase2 : SweepSteps (mSteps (k₀ + 1) + 1) + (fromQ (ESeq k₀ ++ [1])) (fromQ (BSeq (k₀ + 1) ++ [1])) := by + have h_tail := SweepSteps_trans h_iter (SweepSteps.succ h_two (SweepSteps.zero _)) + have h_full := SweepSteps.succ h_pair h_tail + have h_cnt : (mSteps (k₀ + 1) - 1) + 1 + 1 = mSteps (k₀ + 1) + 1 := by omega + rwa [h_cnt] at h_full + have h_phase1 : SweepSteps (mSteps (k₀ + 1)) + (fromQ (BSeq (k₀ + 1) ++ [1])) (fromQ (ESeq (k₀ + 1) ++ [1])) := by + cases k₀ with + | zero => + have h_step1 := SweepRel.single_end (BSeq 1) rfl + simpa [ESeq, mSteps, List.append_assoc] using SweepSteps.succ h_step1 (SweepSteps.zero _) + | succ k' => + obtain ⟨_, hE_k', _⟩ := tail_era_induction k' + have h_prep := SweepSteps_prepend_even (BSeq (k' + 2)) hE_k' (BSeq_even_mSteps (k' + 2)) + rw [← fromQ_append, ← fromQ_append, ← List.append_assoc] at h_prep + exact h_prep + have h_tr := SweepSteps_trans h_phase2 h_phase1 + have h_cnt : (mSteps (k₀ + 1) + 1) + mSteps (k₀ + 1) = (2 * mSteps (k₀ + 1)) + 1 := by omega + rw [h_cnt] at h_tr + exact SweepSteps_sound_plus h_tr + +theorem init_B_to_cfg_ER : + (((default : ListBlank (Fin 2)) {{1}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢⁺ + (cfg_ER [0] []) := by + unfold cfg_ER + rw [encLeft_cons, encLeft_nil, encRight_nil] + dsimp [HPow.hPow] + execute 3 + +theorem init_B_reaches_fromQ_1 : + (((default : ListBlank (Fin 2)) {{1}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢⁺ + (evalB (fromQ [1])) := by + refine stepPlus_trans init_B_to_cfg_ER ?_ + refine stepPlus_trans (rule_ER_nil [0]) ?_ + have h1 := rule_BR_zero [] [3] + dsimp [tailWeight, headWeight, List.tail] at h1 + refine stepPlus_trans h1 ?_ + exact rule_BR_nil [6] + +def EraInv_0608 (cfg : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ k : ℕ, cfg = evalB (fromQ (ESeq k ++ [1])) + +theorem era_inv_init_0608 : + ∃ cfg₀, + ((((default : ListBlank (Fin 2)) {{1}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢* cfg₀) + ∧ + EraInv_0608 cfg₀ := by + have h1 := init_B_reaches_fromQ_1 + have h2 := SweepSteps_sound_plus (tail_era_induction 0).2.1 + exact ⟨_, stepPlus_stepStar (stepPlus_trans h1 h2), ⟨0, rfl⟩⟩ + +theorem era_inv_step_0608 (cfg : Cfg (Fin 2) (Fin 6)) (hinv : EraInv_0608 cfg) : + ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ EraInv_0608 cfg' := by + obtain ⟨k, rfl⟩ := hinv + exact ⟨_, tail_era_step k, ⟨k + 1, rfl⟩⟩ + +theorem is_does_not_halt : IsNotHalt target_tm := + closed_inv_does_not_halt target_tm EraInv era_inv_init era_inv_step + +end Solution + +public section + +open Solution in +theorem is_not_halt_from_0608 : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{1}}> default) [target]⊢* cfg) → + (step target cfg).isSome := + closed_inv_does_not_halt target_tm EraInv_0608 era_inv_init_0608 era_inv_step_0608 + +open Solution in +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0LB_1LC1LB_1RD1LA_0RE0RE_0RA1RF_HHH1RD diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0LC_0LC1RE_1LD1LC_1LA1RD_HHH1RF_0RA0RF.lean b/BusyBeaver/BB6/NonHalt/M_1RB0LC_0LC1RE_1LD1LC_1LA1RD_HHH1RF_0RA0RF.lean new file mode 100644 index 00000000..571cd2be --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0LC_0LC1RE_1LD1LC_1LA1RD_HHH1RF_0RA0RF.lean @@ -0,0 +1,1402 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0LC_0LC1RE_1LD1LC_1LA1RD_HHH1RF_0RA0RF + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LC_0LC1RE_1LD1LC_1LA1RD_HHH1RF_0RA0RF" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + +-- ============================================================================ +-- Section 6: Proof of Non-Halting (IsDoesNotHalt target_tm) +-- ============================================================================ + +namespace Solution + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : + multiStep M config 0 = some config := rfl + +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : + multiStep M config 1 = step M config := rfl + +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +theorem multiStep_add (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_refl (tm : Machine Γ Λ) (c : Cfg Γ Λ) : c [tm]⊢* c := + ⟨0, rfl⟩ + +theorem step_to_stepStar {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢* c₂ := + ⟨1, h⟩ + +theorem step_to_stepPlus {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢⁺ c₂ := + ⟨1, Nat.succ_pos 0, h⟩ + +theorem stepPlus_to_stepStar {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by + rcases h with ⟨n, _, hn⟩; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_trans {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + rcases h₁ with ⟨n, hn_pos, hn⟩; rcases h₂ with ⟨m, hm⟩ + exact ⟨n + m, Nat.add_pos_left hn_pos m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_trans {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + rcases h₁ with ⟨n, hn⟩; rcases h₂ with ⟨m, hm_pos, hm⟩ + exact ⟨n + m, Nat.add_pos_right n hm_pos, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem step_stepStar_trans {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_trans (step_to_stepPlus h₁) h₂ + +theorem step_stepPlus_trans {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_trans (step_to_stepPlus h₁) h₂ + +-- ============================================================================ +-- Tape & List Algebra Lemmas +-- ============================================================================ + +theorem multiStep_step {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} {n : Nat} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢^{n} c₃) : c₁ [tm]⊢^{n + 1} c₃ := by + have := multiStep_trans tm c₁ c₂ c₃ 1 n h₁ h₂ + rwa [Nat.add_comm 1 n] at this + +omit [Inhabited Γ] in +@[simp] theorem pow_zero_list (l : List Γ) : l ^ (0 : Nat) = [] := rfl + +omit [Inhabited Γ] in +theorem pow_succ_list (l : List Γ) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl + +omit [Inhabited Γ] in +@[simp] theorem list_pow_add (l : List Γ) (n m : Nat) : l ^ (n + m) = l ^ n ++ l ^ m := by + induction n with + | zero => simp [pow_zero_list] + | succ n ih => + rw [Nat.succ_add, pow_succ_list, pow_succ_list, ih, List.append_assoc] + +omit [Inhabited Γ] in +theorem pow_succ_right (l : List Γ) (n : Nat) : l ^ (n + 1) = l ^ n ++ l := by + rw [list_pow_add]; simp [pow_succ_list, pow_zero_list] + +@[simp] theorem listblank_append_nil (s : ListBlank Γ) : ([] : List Γ) +> s = s := rfl + +@[simp] theorem listblank_append_cons (a : Γ) (l : List Γ) (s : ListBlank Γ) : + (a :: l) +> s = a >> (l +> s) := rfl + +@[simp] theorem listblank_append_assoc (l₁ l₂ : List Γ) (s : ListBlank Γ) : + (l₁ ++ l₂) +> s = l₁ +> (l₂ +> s) := by + exact Turing.ListBlank.append_assoc l₁ l₂ s + +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +@[simp] theorem zero_cons_default : (0 : Fin 2) >> (default : ListBlank (Fin 2)) = default := by + change ListBlank.cons default default = default + exact ListBlank.cons_head_tail default + +@[simp] theorem init_nil : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = + ⟨some A, ⟨0, default, default⟩⟩ := rfl + +macro "step1" : tactic => `(tactic| ( + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, init_nil, pow_succ_list, pow_zero_list, + List.singleton_append, List.nil_append, List.cons_append, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail] + refine multiStep_step (by rfl) ?_ + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Tape.write, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail])) + +macro "run_steps" n:num : tactic => `(tactic| ( + iterate $n step1 + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, pow_succ_list, pow_zero_list, + List.singleton_append, List.nil_append, List.cons_append, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail, multiStep_zero] + rfl)) + +@[simp] theorem zeros_append_default (n : Nat) : + ([0] : List (Fin 2)) ^ n +> (default : ListBlank (Fin 2)) = default := by + induction n with + | zero => rfl + | succ n ih => + rw [pow_succ_list, List.singleton_append, listblank_append_cons, ih, zero_cons_default] + +theorem one_pow_comm_cons (k : Nat) (s : ListBlank (Fin 2)) : + ([1] : List (Fin 2)) ^ k +> ((1 : Fin 2) >> s) = + (1 : Fin 2) >> (([1] : List (Fin 2)) ^ k +> s) := by + change ([1] : List (Fin 2)) ^ k +> (([1] : List (Fin 2)) ^ 1 +> s) = _ + rw [← listblank_append_assoc, ← list_pow_add, Nat.add_comm k 1, list_pow_add, listblank_append_assoc] + rfl + +theorem append_pow_split (l : List (Fin 2)) (a b : Nat) (s : ListBlank (Fin 2)) : + l ^ (a + b) +> s = l ^ a +> (l ^ b +> s) := by + rw [list_pow_add, listblank_append_assoc] + +/-- Key pattern shift identity: `[1, 1, 1] ++ [0, 1, 1, 1]^b ++ [0] = [1, 1, 1, 0]^(b+1)`. -/ +theorem shift_0111_to_1110 (b : Nat) (s : ListBlank (Fin 2)) : + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (([0, 1, 1, 1] : List (Fin 2)) ^ b +> ((0 : Fin 2) >> s)) = + ([1, 1, 1, 0] : List (Fin 2)) ^ (b + 1) +> s := by + induction b with + | zero => rfl + | succ b ih => + rw [pow_succ_list] + change (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (([0, 1, 1, 1] : List (Fin 2)) ^ b +> ((0 : Fin 2) >> s)) = _ + rw [ih] + rfl + +theorem shift_00111_to_0001110 (b : Nat) (s : ListBlank (Fin 2)) : + (0 : Fin 2) >> (0 : Fin 2) >> (([0, 1, 1, 1] : List (Fin 2)) ^ b +> ((0 : Fin 2) >> s)) = + (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (([1, 1, 1, 0] : List (Fin 2)) ^ b +> s) := by + cases b with + | zero => rfl + | succ b => + have h1 : ([0, 1, 1, 1] : List (Fin 2)) ^ (b + 1) +> ((0 : Fin 2) >> s) = + (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (([0, 1, 1, 1] : List (Fin 2)) ^ b +> ((0 : Fin 2) >> s)) := by + rw [pow_succ_list]; rfl + rw [h1, shift_0111_to_1110 b s] + +theorem shift_1110_111_0111 (b : Nat) (s : ListBlank (Fin 2)) : + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (([0, 1, 1, 1] : List (Fin 2)) ^ b +> ((0 : Fin 2) >> s)) = + ([1, 1, 1, 0] : List (Fin 2)) ^ (b + 2) +> s := by + rw [shift_0111_to_1110 b s] + rfl + +-- ============================================================================ +-- Section 6.1: Primitive Sweep Loops & Micro-Step Building Blocks +-- ============================================================================ + +/-- `F` sweeps right across `1^m`, turning `1`s into `0`s on the left tape. -/ +theorem F_sweep (m : Nat) (L R : ListBlank (Fin 2)) : + (⟨some F, ⟨((([1] : List (Fin 2)) ^ m +> R)).head, L, + ((([1] : List (Fin 2)) ^ m +> R)).tail⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢* + ⟨some F, ⟨R.head, ([0] : List (Fin 2)) ^ m +> L, R.tail⟩⟩ := by + induction m generalizing L with + | zero => exact stepStar_refl _ _ + | succ m ih => + have h1 : + (⟨some F, ⟨((([1] : List (Fin 2)) ^ (m + 1) +> R)).head, L, + ((([1] : List (Fin 2)) ^ (m + 1) +> R)).tail⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢^{1} + ⟨some F, ⟨((([1] : List (Fin 2)) ^ m +> R)).head, (0 : Fin 2) >> L, + ((([1] : List (Fin 2)) ^ m +> R)).tail⟩⟩ := by run_steps 1 + refine stepStar_trans (step_to_stepStar h1) ?_ + have h2 := ih ((0 : Fin 2) >> L) + have heq : ([0] : List (Fin 2)) ^ m +> ((0 : Fin 2) >> L) = + ([0] : List (Fin 2)) ^ (m + 1) +> L := by + rw [pow_succ_right, listblank_append_assoc]; rfl + rw [heq] at h2 + exact h2 + +/-- `D` sweeps right across `1^m` and lands on `0`. -/ +theorem D_sweep (m : Nat) (L R : ListBlank (Fin 2)) : + (⟨some D, ⟨1, L, ([1] : List (Fin 2)) ^ m +> ((0 : Fin 2) >> R)⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ⟨some D, ⟨0, ([1] : List (Fin 2)) ^ (m + 1) +> L, R⟩⟩ := by + induction m generalizing L with + | zero => exact ⟨1, by decide, by run_steps 1⟩ + | succ m ih => + have h1 : + (⟨some D, ⟨1, L, ([1] : List (Fin 2)) ^ (m + 1) +> ((0 : Fin 2) >> R)⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢^{1} + ⟨some D, ⟨1, (1 : Fin 2) >> L, ([1] : List (Fin 2)) ^ m +> ((0 : Fin 2) >> R)⟩⟩ := by run_steps 1 + refine step_stepPlus_trans h1 ?_ + have h2 := ih ((1 : Fin 2) >> L) + have heq : ([1] : List (Fin 2)) ^ (m + 1) +> ((1 : Fin 2) >> L) = + ([1] : List (Fin 2)) ^ (m + 2) +> L := by + rw [one_pow_comm_cons]; rfl + rw [heq] at h2 + exact h2 + +/-- `C` sweeps left across `1^m` and lands on `0`. -/ +theorem C_sweep (m : Nat) (L R : ListBlank (Fin 2)) : + (⟨some C, ⟨1, ([1] : List (Fin 2)) ^ m +> ((0 : Fin 2) >> L), R⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ⟨some C, ⟨0, L, ([1] : List (Fin 2)) ^ (m + 1) +> R⟩⟩ := by + induction m generalizing R with + | zero => exact ⟨1, by decide, by run_steps 1⟩ + | succ m ih => + have h1 : + (⟨some C, ⟨1, ([1] : List (Fin 2)) ^ (m + 1) +> ((0 : Fin 2) >> L), R⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢^{1} + ⟨some C, ⟨1, ([1] : List (Fin 2)) ^ m +> ((0 : Fin 2) >> L), (1 : Fin 2) >> R⟩⟩ := by run_steps 1 + refine step_stepPlus_trans h1 ?_ + have h2 := ih ((1 : Fin 2) >> R) + have heq : ([1] : List (Fin 2)) ^ (m + 1) +> ((1 : Fin 2) >> R) = + ([1] : List (Fin 2)) ^ (m + 2) +> R := by + rw [one_pow_comm_cons]; rfl + rw [heq] at h2 + exact h2 + +/-- Forward sweep across `1^m 0 1`: turns `1^m` into `0^m` on the left tape and consumes `0 1`. -/ +theorem forward_sweep (m : Nat) (L R : ListBlank (Fin 2)) : + (⟨some C, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> L, + ([1] : List (Fin 2)) ^ m +> ((0 : Fin 2) >> (1 : Fin 2) >> R)⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ⟨some C, ⟨0, ([0] : List (Fin 2)) ^ m +> ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L), + (0 : Fin 2) >> R⟩⟩ := by + have h5 : + (⟨some C, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> L, + ([1] : List (Fin 2)) ^ m +> ((0 : Fin 2) >> (1 : Fin 2) >> R)⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢^{5} + ⟨some F, ⟨((([1] : List (Fin 2)) ^ m +> ((0 : Fin 2) >> (1 : Fin 2) >> R))).head, + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L, + ((([1] : List (Fin 2)) ^ m +> ((0 : Fin 2) >> (1 : Fin 2) >> R))).tail⟩⟩ := by run_steps 5 + have hF := F_sweep m ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L) ((0 : Fin 2) >> (1 : Fin 2) >> R) + simp only [Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] at hF + have h2 : + (⟨some F, ⟨0, ([0] : List (Fin 2)) ^ m +> ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L), + (1 : Fin 2) >> R⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢^{2} + ⟨some C, ⟨0, ([0] : List (Fin 2)) ^ m +> ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L), + (0 : Fin 2) >> R⟩⟩ := by run_steps 2 + exact stepPlus_trans (stepPlus_stepStar_trans ⟨5, by decide, h5⟩ hF) ⟨2, by decide, h2⟩ + +/-- Return sweep across `1^m 0`: consumes `1 1 1 0` on the left and produces `1^(m+3) 0 1` on the right. -/ +theorem return_sweep (m : Nat) (L R : ListBlank (Fin 2)) : + (⟨some C, ⟨0, (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L, + ([1] : List (Fin 2)) ^ m +> ((0 : Fin 2) >> R)⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ⟨some C, ⟨0, L, ([1] : List (Fin 2)) ^ (m + 3) +> ((0 : Fin 2) >> (1 : Fin 2) >> R)⟩⟩ := by + have h1 : + (⟨some C, ⟨0, (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L, + ([1] : List (Fin 2)) ^ m +> ((0 : Fin 2) >> R)⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢^{1} + ⟨some D, ⟨1, (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L, + ([1] : List (Fin 2)) ^ (m + 1) +> ((0 : Fin 2) >> R)⟩⟩ := by run_steps 1 + have hD := D_sweep (m + 1) ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L) R + have h2 : + (⟨some D, ⟨0, ([1] : List (Fin 2)) ^ (m + 2) +> ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L), R⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢^{2} + ⟨some C, ⟨1, ([1] : List (Fin 2)) ^ (m + 2) +> ((0 : Fin 2) >> L), + (0 : Fin 2) >> (1 : Fin 2) >> R⟩⟩ := by + have heq : ([1] : List (Fin 2)) ^ (m + 2) +> ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L) = + (1 : Fin 2) >> (1 : Fin 2) >> (([1] : List (Fin 2)) ^ (m + 2) +> ((0 : Fin 2) >> L)) := by + repeat rw [one_pow_comm_cons] + rw [heq]; run_steps 2 + have hC := C_sweep (m + 2) L ((0 : Fin 2) >> (1 : Fin 2) >> R) + exact step_stepPlus_trans h1 (stepPlus_trans hD (stepPlus_trans ⟨2, by decide, h2⟩ hC)) + +/-- Return sweep with 6 ones on the left: consumes `1^6 0` and produces `1^(m+6) 0 1` on the right. -/ +theorem return_sweep_6 (m : Nat) (L R : ListBlank (Fin 2)) : + (⟨some C, ⟨0, (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L, + ([1] : List (Fin 2)) ^ m +> ((0 : Fin 2) >> R)⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ⟨some C, ⟨0, L, ([1] : List (Fin 2)) ^ (m + 6) +> ((0 : Fin 2) >> (1 : Fin 2) >> R)⟩⟩ := by + have h1 : + (⟨some C, ⟨0, (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L, + ([1] : List (Fin 2)) ^ m +> ((0 : Fin 2) >> R)⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢^{1} + ⟨some D, ⟨1, (1 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L, + ([1] : List (Fin 2)) ^ (m + 1) +> ((0 : Fin 2) >> R)⟩⟩ := by run_steps 1 + have hD := D_sweep (m + 1) ((1 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L) R + have h2 : + (⟨some D, ⟨0, ([1] : List (Fin 2)) ^ (m + 2) +> + ((1 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L), R⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢^{2} + ⟨some C, ⟨1, ([1] : List (Fin 2)) ^ (m + 5) +> ((0 : Fin 2) >> L), + (0 : Fin 2) >> (1 : Fin 2) >> R⟩⟩ := by + have heq : ([1] : List (Fin 2)) ^ (m + 2) +> + ((1 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L) = + (1 : Fin 2) >> (1 : Fin 2) >> (([1] : List (Fin 2)) ^ (m + 5) +> ((0 : Fin 2) >> L)) := by + repeat rw [one_pow_comm_cons] + rfl + rw [heq]; run_steps 2 + have hC := C_sweep (m + 5) L ((0 : Fin 2) >> (1 : Fin 2) >> R) + exact step_stepPlus_trans h1 (stepPlus_trans hD (stepPlus_trans ⟨2, by decide, h2⟩ hC)) + +/-- 5-step turnaround: consumes `0 1 1 1 0` on the left and prepends `1^2 0 1^2` on the right. -/ +theorem turnaround_5step (m : Nat) (L R : ListBlank (Fin 2)) : + (⟨some C, ⟨0, (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L, + ([1] : List (Fin 2)) ^ m +> R⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ⟨some C, ⟨0, L, ([1] : List (Fin 2)) ^ 2 +> ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (m + 2) +> R))⟩⟩ := by + have heq : (1 : Fin 2) >> (1 : Fin 2) >> (([1] : List (Fin 2)) ^ m +> R) = + ([1] : List (Fin 2)) ^ (m + 2) +> R := by + rw [show m + 2 = 2 + m by omega, list_pow_add, listblank_append_assoc]; rfl + refine ⟨5, by decide, ?_⟩ + rw [← heq] + run_steps 5 + +/-- 9-step turnaround on empty right tape (`default`). -/ +theorem turnaround_empty (L : ListBlank (Fin 2)) : + (⟨some C, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> L, default⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ⟨some C, ⟨0, (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L, + ([1] : List (Fin 2)) ^ 1 +> default⟩⟩ := + ⟨9, by decide, by run_steps 9⟩ + +/-- 10-step initial expansion on `[1] +> default`. -/ +theorem start_10step (L : ListBlank (Fin 2)) : + (⟨some C, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> L, + ([1] : List (Fin 2)) ^ 1 +> default⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ⟨some C, ⟨0, (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L, + ([1] : List (Fin 2)) ^ 1 +> default⟩⟩ := + ⟨10, by decide, by run_steps 10⟩ + +/-- Bounce across `0 0 1^(m+2)` at the right end of the tape (`default`). -/ +theorem bounce_right_F (m : Nat) (L : ListBlank (Fin 2)) : + (⟨some C, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> L, + (0 : Fin 2) >> (0 : Fin 2) >> (([1] : List (Fin 2)) ^ (m + 2) +> default)⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ⟨some C, ⟨0, ([0] : List (Fin 2)) ^ m +> + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L), + ([1] : List (Fin 2)) ^ 1 +> default⟩⟩ := by + have heq : ([1] : List (Fin 2)) ^ (m + 2) +> (default : ListBlank (Fin 2)) = + (1 : Fin 2) >> (1 : Fin 2) >> (([1] : List (Fin 2)) ^ m +> default) := by + rw [show m + 2 = 2 + m by omega, list_pow_add, listblank_append_assoc]; rfl + rw [heq] + have h9 : + (⟨some C, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> L, + (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (([1] : List (Fin 2)) ^ m +> default)⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢^{9} + ⟨some F, ⟨((([1] : List (Fin 2)) ^ m +> default)).head, + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L, + ((([1] : List (Fin 2)) ^ m +> default)).tail⟩⟩ := by run_steps 9 + have hF := F_sweep m + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L) default + have h4 : + (⟨some F, ⟨0, ([0] : List (Fin 2)) ^ m +> + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L), + default⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢^{4} + ⟨some C, ⟨0, ([0] : List (Fin 2)) ^ m +> + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L), + ([1] : List (Fin 2)) ^ 1 +> default⟩⟩ := by run_steps 4 + exact stepPlus_trans (stepPlus_stepStar_trans ⟨9, by decide, h9⟩ hF) ⟨4, by decide, h4⟩ + +/-- Bounce across `0 0 1^(m+2) 0 1` when another block follows on the right. -/ +theorem bounce_right_F_block (m : Nat) (L R : ListBlank (Fin 2)) : + (⟨some C, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> L, + (0 : Fin 2) >> (0 : Fin 2) >> + (([1] : List (Fin 2)) ^ (m + 2) +> ((0 : Fin 2) >> (1 : Fin 2) >> R))⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ⟨some C, ⟨0, ([0] : List (Fin 2)) ^ m +> + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L), + (0 : Fin 2) >> R⟩⟩ := by + have heq : ([1] : List (Fin 2)) ^ (m + 2) +> ((0 : Fin 2) >> (1 : Fin 2) >> R) = + (1 : Fin 2) >> (1 : Fin 2) >> (([1] : List (Fin 2)) ^ m +> ((0 : Fin 2) >> (1 : Fin 2) >> R)) := by + rw [show m + 2 = 2 + m by omega, list_pow_add, listblank_append_assoc]; rfl + rw [heq] + have h9 : + (⟨some C, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> L, + (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (([1] : List (Fin 2)) ^ m +> ((0 : Fin 2) >> (1 : Fin 2) >> R))⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢^{9} + ⟨some F, ⟨((([1] : List (Fin 2)) ^ m +> ((0 : Fin 2) >> (1 : Fin 2) >> R))).head, + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L, + ((([1] : List (Fin 2)) ^ m +> ((0 : Fin 2) >> (1 : Fin 2) >> R))).tail⟩⟩ := by run_steps 9 + have hF := F_sweep m + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L) ((0 : Fin 2) >> (1 : Fin 2) >> R) + simp only [Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] at hF + have h2 : + (⟨some F, ⟨0, ([0] : List (Fin 2)) ^ m +> + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L), + (1 : Fin 2) >> R⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢^{2} + ⟨some C, ⟨0, ([0] : List (Fin 2)) ^ m +> + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L), + (0 : Fin 2) >> R⟩⟩ := by run_steps 2 + exact stepPlus_trans (stepPlus_stepStar_trans ⟨9, by decide, h9⟩ hF) ⟨2, by decide, h2⟩ + +-- ============================================================================ +-- Section 6.2: Higher-Order Recursive & Exponential Counter Lemmas +-- ============================================================================ + +/-- Exponential $O(2^k)$ Hanoi chain: turns `0^(3k)` on the left and `0 1^k` on the right + into `1^(3k) 0 1^k` on the right. -/ +theorem hanoi_chain (k : Nat) (L R : ListBlank (Fin 2)) : + (⟨some C, ⟨0, ([0] : List (Fin 2)) ^ (3 * k) +> L, + (0 : Fin 2) >> (([1] : List (Fin 2)) ^ k +> R)⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢* + ⟨some C, ⟨0, L, ([1] : List (Fin 2)) ^ (3 * k) +> ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ k +> R))⟩⟩ := by + induction k generalizing L R with + | zero => exact stepStar_refl _ _ + | succ k ih => + have hL : ([0] : List (Fin 2)) ^ (3 * (k + 1)) +> L = + ([0] : List (Fin 2)) ^ (3 * k) +> ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> L) := by + rw [show 3 * (k + 1) = 3 * k + 3 by omega, list_pow_add, listblank_append_assoc]; rfl + have hR : ([1] : List (Fin 2)) ^ (k + 1) +> R = + ([1] : List (Fin 2)) ^ k +> ((1 : Fin 2) >> R) := by + rw [pow_succ_right, listblank_append_assoc]; rfl + rw [hL, hR] + have s1 := ih ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> L) ((1 : Fin 2) >> R) + have hR' : (0 : Fin 2) >> (([1] : List (Fin 2)) ^ k +> ((1 : Fin 2) >> R)) = + (0 : Fin 2) >> (1 : Fin 2) >> (([1] : List (Fin 2)) ^ k +> R) := by + rw [← hR, pow_succ_list, List.singleton_append, listblank_append_cons] + have s2 : + (⟨some C, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> L, + ([1] : List (Fin 2)) ^ (3 * k) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ k +> ((1 : Fin 2) >> R)))⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ⟨some C, ⟨0, ([0] : List (Fin 2)) ^ (3 * k) +> + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L), + (0 : Fin 2) >> (([1] : List (Fin 2)) ^ k +> R)⟩⟩ := by + rw [hR'] + exact forward_sweep (3 * k) ((0 : Fin 2) >> L) (([1] : List (Fin 2)) ^ k +> R) + have s3 := ih ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L) R + have s4 := return_sweep (3 * k) L (([1] : List (Fin 2)) ^ k +> R) + have hR'' : (0 : Fin 2) >> (1 : Fin 2) >> (([1] : List (Fin 2)) ^ k +> R) = + (0 : Fin 2) >> (([1] : List (Fin 2)) ^ k +> ((1 : Fin 2) >> R)) := hR'.symm + rw [hR''] at s4 + exact stepPlus_to_stepStar + (stepStar_stepPlus_trans s1 (stepPlus_trans s2 (stepStar_stepPlus_trans s3 s4))) + +/-- Single exponential increment step: `1^(3k) 0 1^(k+1) -> 1^(3k+3) 0 1^(k+1)` consuming `0^3`. -/ +theorem hanoi_inc (k : Nat) (L R : ListBlank (Fin 2)) : + (⟨some C, ⟨0, ([0] : List (Fin 2)) ^ 3 +> L, + ([1] : List (Fin 2)) ^ (3 * k) +> ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (k + 1) +> R))⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ⟨some C, ⟨0, L, ([1] : List (Fin 2)) ^ (3 * (k + 1)) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (k + 1) +> R))⟩⟩ := by + have hR : ([1] : List (Fin 2)) ^ (k + 1) +> R = (1 : Fin 2) >> (([1] : List (Fin 2)) ^ k +> R) := by + rw [pow_succ_list]; rfl + rw [hR] + have s1 := forward_sweep (3 * k) ((0 : Fin 2) >> L) (([1] : List (Fin 2)) ^ k +> R) + have s2 := hanoi_chain k ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L) R + have s3 := return_sweep (3 * k) L (([1] : List (Fin 2)) ^ k +> R) + exact stepPlus_trans s1 (stepStar_stepPlus_trans s2 s3) + +/-- Iterated exponential increment: `n` rounds of `hanoi_inc`. -/ +theorem hanoi_inc_iter (n k d : Nat) (L R : ListBlank (Fin 2)) : + (⟨some C, ⟨0, ([0] : List (Fin 2)) ^ (3 * n) +> L, + ([1] : List (Fin 2)) ^ (3 * k) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (k + n + d) +> R))⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢* + ⟨some C, ⟨0, L, ([1] : List (Fin 2)) ^ (3 * (k + n)) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (k + n + d) +> R))⟩⟩ := by + induction n generalizing k d L with + | zero => + simp only [Nat.mul_zero, Nat.add_zero, pow_zero_list, listblank_append_nil] + try exact stepStar_refl _ _ + | succ n ih => + have hL : ([0] : List (Fin 2)) ^ (3 * (n + 1)) +> L = + ([0] : List (Fin 2)) ^ 3 +> (([0] : List (Fin 2)) ^ (3 * n) +> L) := by + rw [show 3 * (n + 1) = 3 + 3 * n by omega, list_pow_add, listblank_append_assoc] + have hR : ([1] : List (Fin 2)) ^ (k + (n + 1) + d) +> R = + ([1] : List (Fin 2)) ^ (k + 1) +> (([1] : List (Fin 2)) ^ (n + d) +> R) := by + rw [show k + (n + 1) + d = (k + 1) + (n + d) by omega, list_pow_add, listblank_append_assoc] + rw [hL, hR] + have s1 := hanoi_inc k (([0] : List (Fin 2)) ^ (3 * n) +> L) (([1] : List (Fin 2)) ^ (n + d) +> R) + have hR2 : ([1] : List (Fin 2)) ^ (k + 1) +> (([1] : List (Fin 2)) ^ (n + d) +> R) = + ([1] : List (Fin 2)) ^ ((k + 1) + n + d) +> R := by + rw [← hR, show k + (n + 1) + d = (k + 1) + n + d by omega] + rw [hR2] at s1 ⊢ + have s2 := ih (k + 1) d L + rw [show (k + 1) + n = k + (n + 1) by omega] at s1 s2 ⊢ + exact stepStar_trans (stepPlus_to_stepStar s1) s2 + +/-- Rule R2: `1^(3k+2) 0 1^(k+2+d) -> 1^(3k+6) 0 1^(k+1+d)` consuming `0^3`. -/ +theorem rule_r2 (k d : Nat) (L R : ListBlank (Fin 2)) : + (⟨some C, ⟨0, ([0] : List (Fin 2)) ^ 3 +> L, + ([1] : List (Fin 2)) ^ (3 * k + 2) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (k + 2 + d) +> R))⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ⟨some C, ⟨0, L, ([1] : List (Fin 2)) ^ (3 * (k + 2)) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (k + 1 + d) +> R))⟩⟩ := by + have hR1 : ([1] : List (Fin 2)) ^ (k + 2 + d) +> R = + (1 : Fin 2) >> (([1] : List (Fin 2)) ^ k +> ((1 : Fin 2) >> (([1] : List (Fin 2)) ^ d +> R))) := by + rw [show k + 2 + d = 1 + k + 1 + d by omega] + repeat rw [list_pow_add] + repeat rw [listblank_append_assoc] + rfl + rw [hR1] + have s1 := forward_sweep (3 * k + 2) ((0 : Fin 2) >> L) + (([1] : List (Fin 2)) ^ k +> ((1 : Fin 2) >> (([1] : List (Fin 2)) ^ d +> R))) + have hL1 : ([0] : List (Fin 2)) ^ (3 * k + 2) +> + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L) = + ([0] : List (Fin 2)) ^ (3 * k) +> + ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L) := by + rw [list_pow_add, listblank_append_assoc]; rfl + rw [hL1] at s1 + have s2 := hanoi_chain k + ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L) + ((1 : Fin 2) >> (([1] : List (Fin 2)) ^ d +> R)) + have hR2 : (0 : Fin 2) >> (([1] : List (Fin 2)) ^ k +> ((1 : Fin 2) >> (([1] : List (Fin 2)) ^ d +> R))) = + (0 : Fin 2) >> (1 : Fin 2) >> (([1] : List (Fin 2)) ^ k +> (([1] : List (Fin 2)) ^ d +> R)) := by + rw [one_pow_comm_cons] + have s3 : + (⟨some C, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L, + ([1] : List (Fin 2)) ^ (3 * k) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ k +> ((1 : Fin 2) >> (([1] : List (Fin 2)) ^ d +> R))))⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ⟨some C, ⟨0, ([0] : List (Fin 2)) ^ (3 * k) +> + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L), + (0 : Fin 2) >> (([1] : List (Fin 2)) ^ k +> (([1] : List (Fin 2)) ^ d +> R))⟩⟩ := by + rw [hR2] + exact forward_sweep (3 * k) + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L) + (([1] : List (Fin 2)) ^ k +> (([1] : List (Fin 2)) ^ d +> R)) + have s4 := hanoi_chain k + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L) + (([1] : List (Fin 2)) ^ d +> R) + have s5 := return_sweep_6 (3 * k) L (([1] : List (Fin 2)) ^ k +> (([1] : List (Fin 2)) ^ d +> R)) + have hR3 : (0 : Fin 2) >> (1 : Fin 2) >> (([1] : List (Fin 2)) ^ k +> (([1] : List (Fin 2)) ^ d +> R)) = + (0 : Fin 2) >> (([1] : List (Fin 2)) ^ (k + 1 + d) +> R) := by + rw [show k + 1 + d = 1 + k + d by omega, list_pow_add, list_pow_add, listblank_append_assoc, listblank_append_assoc]; rfl + rw [hR3] at s5 + exact stepPlus_trans s1 (stepStar_stepPlus_trans s2 (stepPlus_trans s3 (stepStar_stepPlus_trans s4 s5))) + +/-- Combined R2 + iterated increment: `[3*k + 2, k + 3 + d] -> [3*(k + 2 + d), k + 2 + d]` consuming `0^(3*d + 3)`. -/ +theorem stage_from_r2 (k d : Nat) (L R : ListBlank (Fin 2)) : + (⟨some C, ⟨0, ([0] : List (Fin 2)) ^ (3 * d + 3) +> L, + ([1] : List (Fin 2)) ^ (3 * k + 2) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (k + 3 + d) +> R))⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ⟨some C, ⟨0, L, ([1] : List (Fin 2)) ^ (3 * (k + 2 + d)) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (k + 2 + d) +> R))⟩⟩ := by + have hL : ([0] : List (Fin 2)) ^ (3 * d + 3) +> L = + ([0] : List (Fin 2)) ^ 3 +> (([0] : List (Fin 2)) ^ (3 * d) +> L) := by + rw [show 3 * d + 3 = 3 + 3 * d by omega, list_pow_add, listblank_append_assoc] + have hR1 : k + 3 + d = k + 2 + (d + 1) := by omega + rw [hL, hR1] + have s1 := rule_r2 k (d + 1) (([0] : List (Fin 2)) ^ (3 * d) +> L) R + have hR2 : k + 1 + (d + 1) = (k + 2) + d + 0 := by omega + rw [hR2] at s1 + have s2 := hanoi_inc_iter d (k + 2) 0 L R + have h_step := stepPlus_stepStar_trans s1 s2 + simpa only [Nat.add_zero] using h_step + +/-- Descending overflow staircase configuration. -/ +def Stair (d : Nat) (L R : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some C, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> L, + ([1] : List (Fin 2)) ^ (3 * d) +> ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ d +> R))⟩⟩ + +/-- Single step of the descending overflow staircase: `Stair (d+1) -> Stair d`. -/ +theorem stair_step (d : Nat) (L R : ListBlank (Fin 2)) : + (Stair (d + 1) L R) [target_tm]⊢⁺ (Stair d (([0, 1, 1, 1] : List (Fin 2)) +> L) R) := by + unfold Stair + have hR : ([1] : List (Fin 2)) ^ (d + 1) +> R = (1 : Fin 2) >> (([1] : List (Fin 2)) ^ d +> R) := by + rw [pow_succ_list]; rfl + rw [hR] + have s1 := forward_sweep (3 * (d + 1)) L (([1] : List (Fin 2)) ^ d +> R) + have hL : ([0] : List (Fin 2)) ^ (3 * (d + 1)) +> ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L) = + ([0] : List (Fin 2)) ^ (3 * d) +> + ((0 : Fin 2) >> (0 : Fin 2) >> (([0, 1, 1, 1] : List (Fin 2)) +> L)) := by + rw [show 3 * (d + 1) = 3 * d + 3 by omega, list_pow_add, listblank_append_assoc]; rfl + rw [hL] at s1 + have s2 := hanoi_chain d ((0 : Fin 2) >> (0 : Fin 2) >> (([0, 1, 1, 1] : List (Fin 2)) +> L)) R + exact stepPlus_stepStar_trans s1 s2 + +/-- Iterated descending staircase: `Stair b L R ⊢* Stair 0 ([0, 1, 1, 1]^b +> L) R`. -/ +theorem stair_iter (b : Nat) (L R : ListBlank (Fin 2)) : + (Stair b L R) [target_tm]⊢* (Stair 0 (([0, 1, 1, 1] : List (Fin 2)) ^ b +> L) R) := by + induction b generalizing L with + | zero => exact stepStar_refl _ _ + | succ b ih => + have s1 := stair_step b L R + have s2 := ih (([0, 1, 1, 1] : List (Fin 2)) +> L) + have heq : ([0, 1, 1, 1] : List (Fin 2)) ^ b +> (([0, 1, 1, 1] : List (Fin 2)) +> L) = + ([0, 1, 1, 1] : List (Fin 2)) ^ (b + 1) +> L := by + rw [pow_succ_right, listblank_append_assoc] + rw [heq] at s2 + exact stepStar_trans (stepPlus_to_stepStar s1) s2 + +/-- Iterated return sweep across `[1, 1, 1, 0]^n` on the left tape. -/ +theorem return_sweep_iter (n a b : Nat) (L R : ListBlank (Fin 2)) : + (⟨some C, ⟨0, ([1, 1, 1, 0] : List (Fin 2)) ^ n +> L, + ([1] : List (Fin 2)) ^ a +> ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ b +> R))⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢* + ⟨some C, ⟨0, L, ([1] : List (Fin 2)) ^ (a + 3 * n) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (b + n) +> R))⟩⟩ := by + induction n generalizing a b L with + | zero => + simp only [Nat.mul_zero, Nat.add_zero, pow_zero_list, listblank_append_nil] + try exact stepStar_refl _ _ + | succ n ih => + have hL : ([1, 1, 1, 0] : List (Fin 2)) ^ (n + 1) +> L = + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (([1, 1, 1, 0] : List (Fin 2)) ^ n +> L) := by + rw [pow_succ_list]; rfl + rw [hL] + have s1 := return_sweep a (([1, 1, 1, 0] : List (Fin 2)) ^ n +> L) (([1] : List (Fin 2)) ^ b +> R) + have hR : (0 : Fin 2) >> (1 : Fin 2) >> (([1] : List (Fin 2)) ^ b +> R) = + (0 : Fin 2) >> (([1] : List (Fin 2)) ^ (b + 1) +> R) := by + rw [pow_succ_list]; rfl + rw [hR] at s1 + have s2 := ih (a + 3) (b + 1) L + rw [show a + 3 + 3 * n = a + 3 * (n + 1) by omega, + show b + 1 + n = b + (n + 1) by omega] at s2 + exact stepStar_trans (stepPlus_to_stepStar s1) s2 + +-- ============================================================================ +-- Section 6.3: Era Hub & Multi-Stage Drain Lemmas +-- ============================================================================ + +/-- Canonical 3-block Hub configuration: `L + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ b +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ c +> default))))⟩⟩ + +/-- Collapse from `[3*(k+1) + 1, k + 1]` to `[2, 3*k + 6, k + 1]` consuming `0^3`. -/ +theorem collapse_to_2 (k : Nat) (L : ListBlank (Fin 2)) : + (⟨some C, ⟨0, ([0] : List (Fin 2)) ^ 3 +> L, + ([1] : List (Fin 2)) ^ (3 * (k + 1) + 1) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (k + 1) +> default))⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ⟨some C, ⟨0, L, ([1] : List (Fin 2)) ^ 2 +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (3 * k + 6) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (k + 1) +> default))))⟩⟩ := by + have hR1 : ([1] : List (Fin 2)) ^ (k + 1) +> (default : ListBlank (Fin 2)) = + (1 : Fin 2) >> (([1] : List (Fin 2)) ^ k +> default) := by + rw [pow_succ_list]; rfl + rw [hR1] + have s1 := forward_sweep (3 * (k + 1) + 1) ((0 : Fin 2) >> L) (([1] : List (Fin 2)) ^ k +> default) + have hL1 : ([0] : List (Fin 2)) ^ (3 * (k + 1) + 1) +> + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L) = + ([0] : List (Fin 2)) ^ (3 * k) +> + ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L) := by + rw [show 3 * (k + 1) + 1 = 3 * k + 4 by omega, list_pow_add, listblank_append_assoc]; rfl + rw [hL1] at s1 + have s2 := hanoi_chain k + ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L) default + have s3 := stair_iter k + ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L) default + have hStair0 : Stair 0 + (([0, 1, 1, 1] : List (Fin 2)) ^ k +> + ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L)) default = + ⟨some C, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (([1, 1, 1, 0] : List (Fin 2)) ^ k +> + ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L)), + default⟩⟩ := by + unfold Stair + rw [shift_00111_to_0001110 k ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L)] + simp only [Nat.mul_zero, pow_zero_list, listblank_append_nil, zero_cons_default] + rw [hStair0] at s3 + have s4 := turnaround_empty + (([1, 1, 1, 0] : List (Fin 2)) ^ k +> + ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L)) + have hL2 : (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (([1, 1, 1, 0] : List (Fin 2)) ^ k +> + ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L)) = + ([1, 1, 1, 0] : List (Fin 2)) ^ (k + 1) +> + ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L) := by + rw [pow_succ_list]; rfl + have hR2 : ([1] : List (Fin 2)) ^ 1 +> (default : ListBlank (Fin 2)) = + ([1] : List (Fin 2)) ^ 1 +> ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 0 +> default)) := by + simp only [pow_zero_list, listblank_append_nil, zero_cons_default] + rw [hL2, hR2] at s4 + have s5 := return_sweep_iter (k + 1) 1 0 + ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L) default + rw [show 1 + 3 * (k + 1) = 3 * k + 4 by omega, show 0 + (k + 1) = k + 1 by omega] at s5 + have s6 := turnaround_5step (3 * k + 4) L + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (k + 1) +> default)) + rw [show 3 * k + 4 + 2 = 3 * k + 6 by omega] at s6 + rw [← hR1] + exact stepPlus_trans s1 + (stepStar_stepPlus_trans s2 + (stepStar_stepPlus_trans s3 + (stepPlus_trans s4 + (stepStar_stepPlus_trans s5 s6)))) + +/-- Final stage of a drain: from `[3*m, m]` (for `m >= 1`) with `0^15` on the left to `Hub 12 (3*m + 5) (m + 1)`. -/ +theorem stage_final (m : Nat) (L : ListBlank (Fin 2)) : + (⟨some C, ⟨0, ([0] : List (Fin 2)) ^ 15 +> L, + ([1] : List (Fin 2)) ^ (3 * m) +> ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ m +> default))⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + (Hub 12 (3 * m + 5) (m + 1) L) := by + have hL1 : ([0] : List (Fin 2)) ^ 15 +> L = + (0 : Fin 2) >> (0 : Fin 2) >> ((0 : Fin 2) >> (([0] : List (Fin 2)) ^ 12 +> L)) := by + rw [show (15 : Nat) = 3 + 12 by omega, list_pow_add, listblank_append_assoc]; rfl + rw [hL1] + have s1 := stair_iter m ((0 : Fin 2) >> (([0] : List (Fin 2)) ^ 12 +> L)) default + have hStair0 : Stair 0 (([0, 1, 1, 1] : List (Fin 2)) ^ m +> ((0 : Fin 2) >> (([0] : List (Fin 2)) ^ 12 +> L))) default = + ⟨some C, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (([1, 1, 1, 0] : List (Fin 2)) ^ m +> (([0] : List (Fin 2)) ^ 12 +> L)), + default⟩⟩ := by + unfold Stair + rw [shift_00111_to_0001110 m (([0] : List (Fin 2)) ^ 12 +> L)] + simp only [Nat.mul_zero, pow_zero_list, listblank_append_nil, zero_cons_default] + rw [hStair0] at s1 + have s2 := turnaround_empty (([1, 1, 1, 0] : List (Fin 2)) ^ m +> (([0] : List (Fin 2)) ^ 12 +> L)) + have hL2 : (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (([1, 1, 1, 0] : List (Fin 2)) ^ m +> (([0] : List (Fin 2)) ^ 12 +> L)) = + ([1, 1, 1, 0] : List (Fin 2)) ^ (m + 1) +> (([0] : List (Fin 2)) ^ 12 +> L) := by + rw [pow_succ_list]; rfl + have hR2 : ([1] : List (Fin 2)) ^ 1 +> (default : ListBlank (Fin 2)) = + ([1] : List (Fin 2)) ^ 1 +> ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 0 +> default)) := by + simp only [pow_zero_list, listblank_append_nil, zero_cons_default] + rw [hL2, hR2] at s2 + have s3 := return_sweep_iter (m + 1) 1 0 (([0] : List (Fin 2)) ^ 12 +> L) default + rw [show 1 + 3 * (m + 1) = 3 * (m + 1) + 1 by omega, show 0 + (m + 1) = m + 1 by omega] at s3 + have hL3 : ([0] : List (Fin 2)) ^ 12 +> L = + ([0] : List (Fin 2)) ^ 3 +> (([0] : List (Fin 2)) ^ 9 +> L) := by + rw [show (12 : Nat) = 3 + 9 by omega, list_pow_add, listblank_append_assoc] + have s4 := collapse_to_2 m (([0] : List (Fin 2)) ^ 9 +> L) + rw [← hL3] at s4 + have hL4' : ([0] : List (Fin 2)) ^ 9 +> L = + ([0] : List (Fin 2)) ^ 3 +> (([0] : List (Fin 2)) ^ (3 * 2) +> L) := by + rw [show (9 : Nat) = 3 + 6 by omega, list_pow_add, listblank_append_assoc] + have hR4' : 3 * m + 6 = 0 + 2 + (3 * m + 4) := by omega + rw [hL4', hR4'] at s4 + have s5a := rule_r2 0 (3 * m + 4) (([0] : List (Fin 2)) ^ (3 * 2) +> L) + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (m + 1) +> default)) + have hR5 : 0 + 1 + (3 * m + 4) = 2 + 2 + (3 * m + 1) := by omega + rw [hR5] at s5a + have s5b := hanoi_inc_iter 2 2 (3 * m + 1) L + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (m + 1) +> default)) + have hR6 : 2 + 2 + (3 * m + 1) = 3 * m + 5 := by omega + rw [hR6] at s5a s5b + exact stepStar_stepPlus_trans s1 + (stepPlus_trans s2 + (stepStar_stepPlus_trans s3 + (stepPlus_trans s4 + (stepPlus_stepStar_trans s5a s5b)))) + +/-- 19-step bounce on `0 0 1^3`: from `Stair 0 L (0 >> 1^3)` to `[2, 3]` with `1 1 1 >> L`. -/ +theorem bounce_3 (L : ListBlank (Fin 2)) : + (Stair 0 L ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 3 +> default))) + [target_tm]⊢⁺ + ⟨some C, ⟨0, (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L, + ([1] : List (Fin 2)) ^ 2 +> ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 3 +> default))⟩⟩ := by + unfold Stair + simp only [Nat.mul_zero, pow_zero_list, listblank_append_nil] + have s1 := bounce_right_F 1 L + have s2 := turnaround_5step 1 ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L) default + exact stepPlus_trans s1 s2 + +/-- Stage from `Hub (3*m) m 3` (consuming `0^21`) to `Hub 12 (3*m + 14) (m + 4)`. -/ +theorem stage_from_3 (m : Nat) (L : ListBlank (Fin 2)) : + (Hub (3 * m) m 3 (([0] : List (Fin 2)) ^ 21 +> L)) + [target_tm]⊢⁺ + (Hub 12 (3 * m + 14) (m + 4) L) := by + unfold Hub + have hL1 : ([0] : List (Fin 2)) ^ 21 +> L = + (0 : Fin 2) >> (0 : Fin 2) >> ((0 : Fin 2) >> (([0] : List (Fin 2)) ^ 18 +> L)) := by + rw [show (21 : Nat) = 3 + 18 by omega, list_pow_add, listblank_append_assoc]; rfl + rw [hL1] + have s1 := stair_iter m ((0 : Fin 2) >> (([0] : List (Fin 2)) ^ 18 +> L)) + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 3 +> default)) + have s2 := bounce_3 (([0, 1, 1, 1] : List (Fin 2)) ^ m +> ((0 : Fin 2) >> (([0] : List (Fin 2)) ^ 18 +> L))) + rw [shift_0111_to_1110 m (([0] : List (Fin 2)) ^ 18 +> L)] at s2 + have s3 := return_sweep_iter (m + 1) 2 3 (([0] : List (Fin 2)) ^ 18 +> L) default + rw [show 2 + 3 * (m + 1) = 3 * (m + 1) + 2 by omega, + show 3 + (m + 1) = (m + 1) + 2 + 1 by omega] at s3 + have hL2 : ([0] : List (Fin 2)) ^ 18 +> L = + ([0] : List (Fin 2)) ^ 3 +> (([0] : List (Fin 2)) ^ 15 +> L) := by + rw [show (18 : Nat) = 3 + 15 by omega, list_pow_add, listblank_append_assoc] + have s4 := rule_r2 (m + 1) 1 (([0] : List (Fin 2)) ^ 15 +> L) default + rw [← hL2, show (m + 1) + 1 + 1 = m + 3 by omega, show (m + 1) + 2 = m + 3 by omega] at s4 + have s5 := stage_final (m + 3) L + unfold Hub at s5 + rw [show 3 * (m + 3) + 5 = 3 * m + 14 by omega, show m + 3 + 1 = m + 4 by omega] at s5 + exact stepStar_stepPlus_trans s1 + (stepPlus_trans s2 + (stepStar_stepPlus_trans s3 + (stepPlus_trans s4 s5))) + +/-- Stage from `[3*k + 2, k + 12, 3]` (consuming `0^51`) to `Hub 12 (3*k + 47) (k + 15)`. -/ +theorem stage_from_2_m_3 (k : Nat) (L : ListBlank (Fin 2)) : + (⟨some C, ⟨0, ([0] : List (Fin 2)) ^ 51 +> L, + ([1] : List (Fin 2)) ^ (3 * k + 2) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (k + 12) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 3 +> default))))⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + (Hub 12 (3 * k + 47) (k + 15) L) := by + have hL1 : ([0] : List (Fin 2)) ^ 51 +> L = + ([0] : List (Fin 2)) ^ (3 * 9 + 3) +> (([0] : List (Fin 2)) ^ 21 +> L) := by + rw [show (51 : Nat) = (3 * 9 + 3) + 21 by omega, list_pow_add, listblank_append_assoc] + have hR1 : k + 12 = k + 3 + 9 := by omega + rw [hL1, hR1] + have s1 := stage_from_r2 k 9 (([0] : List (Fin 2)) ^ 21 +> L) + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 3 +> default)) + rw [show k + 2 + 9 = k + 11 by omega] at s1 + have s2 := stage_from_3 (k + 11) L + unfold Hub at s2 ⊢ + rw [show 3 * (k + 11) + 14 = 3 * k + 47 by omega, show k + 11 + 4 = k + 15 by omega] at s2 + exact stepPlus_trans s1 s2 + +/-- 308-step macro-transition from `Start(0^12 +> L)` to `[2, 12, 3]`. -/ +theorem start_12_to_2_12_3 (L : ListBlank (Fin 2)) : + (⟨some C, ⟨0, ([0] : List (Fin 2)) ^ 12 +> L, ([1] : List (Fin 2)) ^ 1 +> default⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ⟨some C, ⟨0, L, ([1] : List (Fin 2)) ^ 2 +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 12 +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 3 +> default))))⟩⟩ := by + have hL1 : ([0] : List (Fin 2)) ^ 12 +> L = + (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (([0] : List (Fin 2)) ^ 9 +> L) := by + rw [show (12 : Nat) = 3 + 9 by omega, list_pow_add, listblank_append_assoc]; rfl + rw [hL1] + have s1 := start_10step (([0] : List (Fin 2)) ^ 9 +> L) + have s2 := turnaround_5step 1 (([0] : List (Fin 2)) ^ 9 +> L) default + have hL2 : ([0] : List (Fin 2)) ^ 9 +> L = + ([0] : List (Fin 2)) ^ 3 +> + ((0 : Fin 2) >> (0 : Fin 2) >> ((0 : Fin 2) >> (([0] : List (Fin 2)) ^ 3 +> L))) := by + rw [show (9 : Nat) = 3 + (3 + 3) by omega, list_pow_add, list_pow_add, + listblank_append_assoc, listblank_append_assoc]; rfl + rw [hL2] at s2 + have s3 := rule_r2 0 1 + ((0 : Fin 2) >> (0 : Fin 2) >> ((0 : Fin 2) >> (([0] : List (Fin 2)) ^ 3 +> L))) default + have s4 := stair_iter 2 ((0 : Fin 2) >> (([0] : List (Fin 2)) ^ 3 +> L)) default + have hStair0 : Stair 0 (([0, 1, 1, 1] : List (Fin 2)) ^ 2 +> ((0 : Fin 2) >> (([0] : List (Fin 2)) ^ 3 +> L))) default = + ⟨some C, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (([1, 1, 1, 0] : List (Fin 2)) ^ 2 +> (([0] : List (Fin 2)) ^ 3 +> L)), + default⟩⟩ := by + unfold Stair + rw [shift_00111_to_0001110 2 (([0] : List (Fin 2)) ^ 3 +> L)] + simp only [Nat.mul_zero, pow_zero_list, listblank_append_nil, zero_cons_default] + rw [hStair0] at s4 + have s5 := turnaround_empty (([1, 1, 1, 0] : List (Fin 2)) ^ 2 +> (([0] : List (Fin 2)) ^ 3 +> L)) + have hL3 : (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (([1, 1, 1, 0] : List (Fin 2)) ^ 2 +> (([0] : List (Fin 2)) ^ 3 +> L)) = + ([1, 1, 1, 0] : List (Fin 2)) ^ 3 +> (([0] : List (Fin 2)) ^ 3 +> L) := rfl + have hR3 : ([1] : List (Fin 2)) ^ 1 +> (default : ListBlank (Fin 2)) = + ([1] : List (Fin 2)) ^ 1 +> ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 0 +> default)) := by + simp only [pow_zero_list, listblank_append_nil, zero_cons_default] + rw [hL3, hR3] at s5 + have s6 := return_sweep_iter 3 1 0 (([0] : List (Fin 2)) ^ 3 +> L) default + have s7 := collapse_to_2 2 L + exact stepPlus_trans s1 + (stepPlus_trans s2 + (stepPlus_trans s3 + (stepStar_stepPlus_trans s4 + (stepPlus_trans s5 + (stepStar_stepPlus_trans s6 s7))))) + +/-- Base Era 0 reachability: `Start(0^63 +> L) ⊢⁺ Hub 12 47 15 L`. -/ +theorem era_reach_0 (L : ListBlank (Fin 2)) : + (⟨some C, ⟨0, ([0] : List (Fin 2)) ^ 63 +> L, ([1] : List (Fin 2)) ^ 1 +> default⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + (Hub 12 47 15 L) := by + have hL : ([0] : List (Fin 2)) ^ 63 +> L = + ([0] : List (Fin 2)) ^ 12 +> (([0] : List (Fin 2)) ^ 51 +> L) := by + rw [show (63 : Nat) = 12 + 51 by omega, list_pow_add, listblank_append_assoc] + rw [hL] + exact stepPlus_trans (start_12_to_2_12_3 (([0] : List (Fin 2)) ^ 51 +> L)) (stage_from_2_m_3 0 L) + +/-- 175-step bounce across `0 0 1^12 0 1^3`: from `Stair 0 L (0 >> 1^12 0 1^3)` to `[2, 12, 3]` with `1 1 1 >> L`. -/ +theorem bounce_12_3 (L : ListBlank (Fin 2)) : + (Stair 0 L ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 12 +> ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 3 +> default))))) + [target_tm]⊢⁺ + ⟨some C, ⟨0, (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L, + ([1] : List (Fin 2)) ^ 2 +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 12 +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 3 +> default))))⟩⟩ := by + unfold Stair + simp only [Nat.mul_zero, pow_zero_list, listblank_append_nil] + have s1 := bounce_right_F_block 10 L (([1] : List (Fin 2)) ^ 2 +> default) + have hL1 : ([0] : List (Fin 2)) ^ 10 +> + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L) = + ([0] : List (Fin 2)) ^ (3 * 2) +> + ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L) := rfl + rw [hL1] at s1 + have s2 := hanoi_chain 2 + ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L) default + have s3 := stair_iter 2 + ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L) default + have hStair0 : Stair 0 + (([0, 1, 1, 1] : List (Fin 2)) ^ 2 +> + ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L)) default = + ⟨some C, ⟨0, (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (([1, 1, 1, 0] : List (Fin 2)) ^ 2 +> + ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L)), + default⟩⟩ := by + unfold Stair + rw [shift_00111_to_0001110 2 + ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L)] + simp only [Nat.mul_zero, pow_zero_list, listblank_append_nil, zero_cons_default] + rw [hStair0] at s3 + have s4 := turnaround_empty + (([1, 1, 1, 0] : List (Fin 2)) ^ 2 +> + ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L)) + have hL2 : (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (([1, 1, 1, 0] : List (Fin 2)) ^ 2 +> + ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L)) = + ([1, 1, 1, 0] : List (Fin 2)) ^ 3 +> + ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L) := rfl + have hR2 : ([1] : List (Fin 2)) ^ 1 +> (default : ListBlank (Fin 2)) = + ([1] : List (Fin 2)) ^ 1 +> ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 0 +> default)) := by + simp only [pow_zero_list, listblank_append_nil, zero_cons_default] + rw [hL2, hR2] at s4 + have s5 := return_sweep_iter 3 1 0 + ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L) default + have s6 := turnaround_5step 10 ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L) + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 3 +> default)) + exact stepPlus_trans s1 + (stepStar_stepPlus_trans s2 + (stepStar_stepPlus_trans s3 + (stepPlus_trans s4 + (stepStar_stepPlus_trans s5 s6)))) + +/-- 339-step bounce across `0 0 1^15`: from `Stair 0 L (0 >> 1^15)` to `[2, 4, 12, 3]` with `1 1 1 >> L`. -/ +theorem bounce_15 (L : ListBlank (Fin 2)) : + (Stair 0 L ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 15 +> default))) + [target_tm]⊢⁺ + ⟨some C, ⟨0, (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L, + ([1] : List (Fin 2)) ^ 2 +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 4 +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 12 +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 3 +> default))))))⟩⟩ := by + unfold Stair + simp only [Nat.mul_zero, pow_zero_list, listblank_append_nil] + have s1 := bounce_right_F 13 L + have hL1 : ([0] : List (Fin 2)) ^ 13 +> + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L) = + ([0] : List (Fin 2)) ^ 12 +> + ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L) := rfl + rw [hL1] at s1 + have s2 := start_12_to_2_12_3 + ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L) + have s3 := turnaround_5step 2 ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> L) + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 12 +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 3 +> default)))) + exact stepPlus_trans s1 (stepPlus_trans s2 s3) + +/-- First 12-zero stage of Era 0 drain (`c_0 = 15`): + `Hub (3*b) b 15 (0^12 +> L) ⊢⁺ [3*(b+5) + 2, (b+5) + 12, 3]`. -/ +theorem drain_0_first_12 (b : Nat) (L : ListBlank (Fin 2)) : + (Hub (3 * b) b 15 (([0] : List (Fin 2)) ^ 12 +> L)) + [target_tm]⊢⁺ + ⟨some C, ⟨0, L, ([1] : List (Fin 2)) ^ (3 * (b + 5) + 2) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ ((b + 5) + 12) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 3 +> default))))⟩⟩ := by + unfold Hub + have hL1 : ([0] : List (Fin 2)) ^ 12 +> L = + (0 : Fin 2) >> (0 : Fin 2) >> ((0 : Fin 2) >> (([0] : List (Fin 2)) ^ 9 +> L)) := by + rw [show (12 : Nat) = 3 + 9 by omega, list_pow_add, listblank_append_assoc]; rfl + rw [hL1] + have s1 := stair_iter b ((0 : Fin 2) >> (([0] : List (Fin 2)) ^ 9 +> L)) + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 15 +> default)) + have s2 := bounce_15 (([0, 1, 1, 1] : List (Fin 2)) ^ b +> ((0 : Fin 2) >> (([0] : List (Fin 2)) ^ 9 +> L))) + rw [shift_0111_to_1110 b (([0] : List (Fin 2)) ^ 9 +> L)] at s2 + have s3 := return_sweep_iter (b + 1) 2 4 (([0] : List (Fin 2)) ^ 9 +> L) + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 12 +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 3 +> default)))) + rw [show 2 + 3 * (b + 1) = 3 * (b + 1) + 2 by omega, + show 4 + (b + 1) = (b + 1) + 3 + 1 by omega] at s3 + have hL2 : ([0] : List (Fin 2)) ^ 9 +> L = + ([0] : List (Fin 2)) ^ (3 * 1 + 3) +> + ((0 : Fin 2) >> (0 : Fin 2) >> ((0 : Fin 2) >> L)) := by + rw [show (9 : Nat) = 6 + 3 by omega, list_pow_add, listblank_append_assoc]; rfl + have s4 := stage_from_r2 (b + 1) 1 + ((0 : Fin 2) >> (0 : Fin 2) >> ((0 : Fin 2) >> L)) + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 12 +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 3 +> default)))) + rw [← hL2, show (b + 1) + 2 + 1 = b + 4 by omega] at s4 + have s5 := stair_iter (b + 4) ((0 : Fin 2) >> L) + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 12 +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 3 +> default)))) + have s6 := bounce_12_3 + (([0, 1, 1, 1] : List (Fin 2)) ^ (b + 4) +> ((0 : Fin 2) >> L)) + rw [shift_0111_to_1110 (b + 4) L] at s6 + have s7 := return_sweep_iter (b + 5) 2 12 L + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ 3 +> default)) + rw [show 2 + 3 * (b + 5) = 3 * (b + 5) + 2 by omega, + show 12 + (b + 5) = (b + 5) + 12 by omega] at s7 + exact stepStar_stepPlus_trans s1 + (stepPlus_trans s2 + (stepStar_stepPlus_trans s3 + (stepPlus_trans s4 + (stepStar_stepPlus_trans s5 + (stepPlus_stepStar_trans s6 s7))))) + +theorem stepPlus_Hub_congr {c : Cfg (Fin 2) (Fin 6)} {a b₁ b₂ c₁ c₂ : Nat} {L : ListBlank (Fin 2)} + (h : c [target_tm]⊢⁺ (Hub a b₁ c₁ L)) (hb : b₁ = b₂) (hc : c₁ = c₂) : + c [target_tm]⊢⁺ (Hub a b₂ c₂ L) := by + subst hb hc; exact h + +theorem Hub_stepPlus_congr {c : Cfg (Fin 2) (Fin 6)} {a b c_m : Nat} {L₁ L₂ : ListBlank (Fin 2)} + (h : (Hub a b c_m L₁) [target_tm]⊢⁺ c) (hL : L₂ = L₁) : + (Hub a b c_m L₂) [target_tm]⊢⁺ c := by + subst hL; exact h + +/-- Base Era 0 drain (`c_0 = 15`): `Hub (3*b) b 15 (0^63 +> L) ⊢⁺ Hub 12 (3*b + 62) (b + 20) L`. -/ +theorem drain_0 (b : Nat) (L : ListBlank (Fin 2)) : + (Hub (3 * b) b 15 (([0] : List (Fin 2)) ^ 63 +> L)) + [target_tm]⊢⁺ + (Hub 12 (3 * b + 62) (b + 20) L) := by + refine Hub_stepPlus_congr (stepPlus_trans + (drain_0_first_12 b (([0] : List (Fin 2)) ^ 51 +> L)) + (stepPlus_Hub_congr (stage_from_2_m_3 (b + 5) L) (by omega) (by omega))) ?_ + exact append_pow_split ([0] : List (Fin 2)) 12 51 L + +-- ============================================================================ +-- Section 6.4: Era Parameter Sequences & Inductive Closure Across All Eras +-- ============================================================================ + +mutual +def S_seq : Nat → Nat + | 0 => 0 + | m + 1 => S_seq m + b_seq m + 1 + +def b_seq : Nat → Nat + | 0 => 47 + | m + 1 => 3 * (b_seq m + S_seq m) + 62 + +def c_seq : Nat → Nat + | 0 => 15 + | m + 1 => b_seq m + S_seq m + 20 +end + +def a_seq : Nat → Nat + | 0 => 4 + | 1 => 8 + | m + 2 => 2 * a_seq (m + 1) + 2 + +def W_seq : Nat → Nat + | 0 => 63 + | m + 1 => W_seq m + 3 * (b_seq m - a_seq m - 1) + +def E_seq : Nat → Nat + | 0 => 63 + | m + 1 => E_seq m + 3 * (b_seq m - a_seq m) + W_seq m + 3 * (a_seq (m + 1) - 4) + +theorem era_params_spec (m : Nat) : + b_seq m = 3 * c_seq m + 2 ∧ + (m = 0 ∨ S_seq m + 19 = c_seq m) ∧ + (m = 0 ∨ W_seq m + 3 * a_seq m = 3 * c_seq m + 12) ∧ + E_seq m + 4 = c_seq (m + 1) ∧ + b_seq m ≥ a_seq m + 2 ∧ + a_seq m ≥ 4 := by + induction m with + | zero => + decide + | succ m ih => + rcases m with _ | m' + · decide + · have hS : S_seq (m' + 1 + 1) = S_seq (m' + 1) + b_seq (m' + 1) + 1 := rfl + have hb : b_seq (m' + 1 + 1) = 3 * (b_seq (m' + 1) + S_seq (m' + 1)) + 62 := rfl + have hc : c_seq (m' + 1 + 1) = b_seq (m' + 1) + S_seq (m' + 1) + 20 := rfl + have hc3 : c_seq (m' + 1 + 1 + 1) = b_seq (m' + 1 + 1) + S_seq (m' + 1 + 1) + 20 := rfl + have ha : a_seq (m' + 1 + 1) = 2 * a_seq (m' + 1) + 2 := rfl + have hW : W_seq (m' + 1 + 1) = W_seq (m' + 1) + 3 * (b_seq (m' + 1) - a_seq (m' + 1) - 1) := rfl + have hE : E_seq (m' + 1 + 1) = E_seq (m' + 1) + 3 * (b_seq (m' + 1) - a_seq (m' + 1)) + + W_seq (m' + 1) + 3 * (a_seq (m' + 1 + 1) - 4) := rfl + omega + +/-- Mid-era hub transition: from `Hub (3*a) b_m c_m (0 >> 0 >> ([1, 1, 1, 0]^(b+2) +> L))` + to `Hub (3*(b + a + 3)) (b + b_m + 1) c_m L`. -/ +theorem hub_absorb_1110 (a b b_m c_m : Nat) (hb : b_m ≥ a + 1) (L : ListBlank (Fin 2)) : + (Hub (3 * a) b_m c_m + ((0 : Fin 2) >> (0 : Fin 2) >> (([1, 1, 1, 0] : List (Fin 2)) ^ (b + 2) +> L))) + [target_tm]⊢⁺ + (Hub (3 * (b + a + 3)) (b + b_m + 1) c_m L) := by + unfold Hub + have hR1 : ([1] : List (Fin 2)) ^ b_m +> ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ c_m +> default)) = + (1 : Fin 2) >> + (([1] : List (Fin 2)) ^ a +> + (([1] : List (Fin 2)) ^ (b_m - a - 1) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ c_m +> default)))) := by + have h1 : (1 : Fin 2) >> + (([1] : List (Fin 2)) ^ a +> + (([1] : List (Fin 2)) ^ (b_m - a - 1) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ c_m +> default)))) = + ([1] : List (Fin 2)) ^ (1 + a + (b_m - a - 1)) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ c_m +> default)) := by + repeat rw [list_pow_add] + repeat rw [listblank_append_assoc] + rfl + rw [h1, show 1 + a + (b_m - a - 1) = b_m by omega] + rw [hR1] + have s1 := forward_sweep (3 * a) (([1, 1, 1, 0] : List (Fin 2)) ^ (b + 2) +> L) + (([1] : List (Fin 2)) ^ a +> + (([1] : List (Fin 2)) ^ (b_m - a - 1) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ c_m +> default)))) + have s2 := hanoi_chain a + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (([1, 1, 1, 0] : List (Fin 2)) ^ (b + 2) +> L)) + (([1] : List (Fin 2)) ^ (b_m - a - 1) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ c_m +> default))) + have hL2 : (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (([1, 1, 1, 0] : List (Fin 2)) ^ (b + 2) +> L) = + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (([1, 1, 1, 0] : List (Fin 2)) ^ (b + 1) +> L) := by + rw [show b + 2 = 1 + (b + 1) by omega, list_pow_add, listblank_append_assoc]; rfl + rw [hL2] at s2 + have s3 := return_sweep_6 (3 * a) (([1, 1, 1, 0] : List (Fin 2)) ^ (b + 1) +> L) + (([1] : List (Fin 2)) ^ a +> + (([1] : List (Fin 2)) ^ (b_m - a - 1) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ c_m +> default)))) + have hR3 : (0 : Fin 2) >> (1 : Fin 2) >> + (([1] : List (Fin 2)) ^ a +> + (([1] : List (Fin 2)) ^ (b_m - a - 1) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ c_m +> default)))) = + (0 : Fin 2) >> (([1] : List (Fin 2)) ^ b_m +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ c_m +> default))) := by + rw [hR1] + rw [hR3] at s3 + have s4 := return_sweep_iter (b + 1) (3 * a + 6) b_m L + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ c_m +> default)) + rw [show 3 * a + 6 + 3 * (b + 1) = 3 * (b + a + 3) by omega, + show b_m + (b + 1) = b + b_m + 1 by omega] at s4 + exact stepPlus_trans s1 (stepStar_stepPlus_trans s2 (stepPlus_stepStar_trans s3 s4)) + +/-- Simultaneous induction proving `EraReach m` and `Drain m` for all eras `m >= 0`. -/ +theorem era_and_drain (m : Nat) : + (∀ L : ListBlank (Fin 2), + (⟨some C, ⟨0, ([0] : List (Fin 2)) ^ (E_seq m) +> L, + ([1] : List (Fin 2)) ^ 1 +> default⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + (Hub (3 * a_seq m) (b_seq m) (c_seq m) L)) ∧ + (∀ b : Nat, ∀ L : ListBlank (Fin 2), + (Hub (3 * b) b (c_seq m) (([0] : List (Fin 2)) ^ (W_seq m) +> L)) + [target_tm]⊢⁺ + (Hub 12 (3 * (b + S_seq m) + 62) (b + S_seq m + 20) L)) := by + induction m with + | zero => + refine ⟨era_reach_0, ?_⟩ + intro b L + simpa [S_seq, c_seq, W_seq] using drain_0 b L + | succ m ih => + rcases ih with ⟨ih_era, ih_drain⟩ + have hspec_m := era_params_spec m + have hspec_m1 := era_params_spec (m + 1) + have h_era_succ : ∀ L : ListBlank (Fin 2), + (⟨some C, ⟨0, ([0] : List (Fin 2)) ^ (E_seq (m + 1)) +> L, + ([1] : List (Fin 2)) ^ 1 +> default⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + (Hub (3 * a_seq (m + 1)) (b_seq (m + 1)) (c_seq (m + 1)) L) := by + intro L + have hL1 : ([0] : List (Fin 2)) ^ (E_seq (m + 1)) +> L = + ([0] : List (Fin 2)) ^ (E_seq m) +> + (([0] : List (Fin 2)) ^ (3 * (b_seq m - a_seq m)) +> + (([0] : List (Fin 2)) ^ (W_seq m) +> + (([0] : List (Fin 2)) ^ (3 * (a_seq (m + 1) - 4)) +> L))) := by + have hE : E_seq (m + 1) = E_seq m + (3 * (b_seq m - a_seq m) + + (W_seq m + 3 * (a_seq (m + 1) - 4))) := by + have : E_seq (m + 1) = E_seq m + 3 * (b_seq m - a_seq m) + W_seq m + 3 * (a_seq (m + 1) - 4) := rfl + omega + rw [hE] + repeat rw [list_pow_add] + repeat rw [listblank_append_assoc] + rw [hL1] + have s1 := ih_era + (([0] : List (Fin 2)) ^ (3 * (b_seq m - a_seq m)) +> + (([0] : List (Fin 2)) ^ (W_seq m) +> + (([0] : List (Fin 2)) ^ (3 * (a_seq (m + 1) - 4)) +> L))) + have s2 := hanoi_inc_iter (b_seq m - a_seq m) (a_seq m) 0 + (([0] : List (Fin 2)) ^ (W_seq m) +> + (([0] : List (Fin 2)) ^ (3 * (a_seq (m + 1) - 4)) +> L)) + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (c_seq m) +> default)) + have hb_eq : a_seq m + (b_seq m - a_seq m) + 0 = b_seq m := by omega + have hb_eq' : a_seq m + (b_seq m - a_seq m) = b_seq m := by omega + rw [hb_eq, hb_eq'] at s2 + have s3 := ih_drain (b_seq m) + (([0] : List (Fin 2)) ^ (3 * (a_seq (m + 1) - 4)) +> L) + have hb1_def : 3 * (b_seq m + S_seq m) + 62 = b_seq (m + 1) := rfl + have hc1_def : b_seq m + S_seq m + 20 = c_seq (m + 1) := rfl + rw [hb1_def, hc1_def] at s3 + have s4 := hanoi_inc_iter (a_seq (m + 1) - 4) 4 (b_seq (m + 1) - a_seq (m + 1)) L + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (c_seq (m + 1)) +> default)) + have ha_eq : 4 + (a_seq (m + 1) - 4) + (b_seq (m + 1) - a_seq (m + 1)) = b_seq (m + 1) := by omega + have ha_eq' : 4 + (a_seq (m + 1) - 4) = a_seq (m + 1) := by omega + rw [ha_eq, ha_eq'] at s4 + exact stepPlus_trans s1 (stepStar_stepPlus_trans s2 (stepPlus_stepStar_trans s3 s4)) + refine ⟨h_era_succ, ?_⟩ + intro b L + have hL1 : ([0] : List (Fin 2)) ^ (W_seq (m + 1)) +> L = + (0 : Fin 2) >> (0 : Fin 2) >> + ((0 : Fin 2) >> + (([0] : List (Fin 2)) ^ (3 * (b_seq m - a_seq m - 2)) +> + (([0] : List (Fin 2)) ^ (W_seq m) +> L))) := by + have hW : W_seq (m + 1) = 3 + (3 * (b_seq m - a_seq m - 2) + W_seq m) := by + have : W_seq (m + 1) = W_seq m + 3 * (b_seq m - a_seq m - 1) := rfl + omega + rw [hW] + repeat rw [list_pow_add] + repeat rw [listblank_append_assoc] + rfl + unfold Hub + rw [hL1] + set L_rem := ([0] : List (Fin 2)) ^ (3 * (b_seq m - a_seq m - 2)) +> + (([0] : List (Fin 2)) ^ (W_seq m) +> L) + have s1 := stair_iter b ((0 : Fin 2) >> L_rem) + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (c_seq (m + 1)) +> default)) + have hc_eq : c_seq (m + 1) = (E_seq m + 2) + 2 := by omega + have s2 := bounce_right_F (E_seq m + 2) (([0, 1, 1, 1] : List (Fin 2)) ^ b +> ((0 : Fin 2) >> L_rem)) + rw [← hc_eq] at s2 + have hL2 : ([0] : List (Fin 2)) ^ (E_seq m + 2) +> + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (([0, 1, 1, 1] : List (Fin 2)) ^ b +> ((0 : Fin 2) >> L_rem))) = + ([0] : List (Fin 2)) ^ (E_seq m) +> + ((0 : Fin 2) >> (0 : Fin 2) >> (([1, 1, 1, 0] : List (Fin 2)) ^ (b + 2) +> L_rem)) := by + rw [shift_1110_111_0111 b L_rem, list_pow_add, listblank_append_assoc]; rfl + rw [hL2] at s2 + have s3 := ih_era + ((0 : Fin 2) >> (0 : Fin 2) >> (([1, 1, 1, 0] : List (Fin 2)) ^ (b + 2) +> L_rem)) + have s4 := hub_absorb_1110 (a_seq m) b (b_seq m) (c_seq m) (by omega) L_rem + have s5 := hanoi_inc_iter (b_seq m - a_seq m - 2) (b + a_seq m + 3) 0 + (([0] : List (Fin 2)) ^ (W_seq m) +> L) + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (c_seq m) +> default)) + have hb_sum : (b + a_seq m + 3) + (b_seq m - a_seq m - 2) + 0 = b + b_seq m + 1 := by omega + have hb_sum' : (b + a_seq m + 3) + (b_seq m - a_seq m - 2) = b + b_seq m + 1 := by omega + rw [hb_sum, hb_sum'] at s5 + have s6 := ih_drain (b + b_seq m + 1) L + have hS_eq : b + b_seq m + 1 + S_seq m = b + S_seq (m + 1) := by + have : S_seq (m + 1) = S_seq m + b_seq m + 1 := rfl + omega + rw [hS_eq] at s6 + exact stepStar_stepPlus_trans s1 + (stepPlus_trans s2 + (stepPlus_trans s3 + (stepPlus_trans s4 + (stepStar_stepPlus_trans s5 s6)))) + +-- ============================================================================ +-- Section 6.5: Blank-Tape Reachability & Unconditional Non-Halting Theorem +-- ============================================================================ + +/-- `init []` reaches `Hub 12 (b_seq 0) (c_seq 0) default` in positive steps. -/ +theorem init_reaches_hub_0 : + (init []) [target_tm]⊢* (Hub 12 (b_seq 0) (c_seq 0) default) := by + have h3 : (init []) [target_tm]⊢^{3} + ⟨some C, ⟨0, default, ([1] : List (Fin 2)) ^ 1 +> default⟩⟩ := by + run_steps 3 + have h_era0 := era_reach_0 default + rw [zeros_append_default 63] at h_era0 + exact stepStar_trans ⟨3, h3⟩ (stepPlus_to_stepStar h_era0) + +/-- Every era hub transitions in `1` or more steps to the next era hub: + `Hub 12 (b_seq m) (c_seq m) default ⊢⁺ Hub 12 (b_seq (m+1)) (c_seq (m+1)) default`. -/ +theorem hub_step (m : Nat) : + (Hub 12 (b_seq m) (c_seq m) default) + [target_tm]⊢⁺ + (Hub 12 (b_seq (m + 1)) (c_seq (m + 1)) default) := by + have hspec := era_params_spec m + have s1 := hanoi_inc_iter (b_seq m - 4) 4 0 default + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (c_seq m) +> default)) + rw [zeros_append_default (3 * (b_seq m - 4)), + show 4 + (b_seq m - 4) + 0 = b_seq m by omega, + show 4 + (b_seq m - 4) = b_seq m by omega] at s1 + have s2 := (era_and_drain m).2 (b_seq m) default + rw [zeros_append_default (W_seq m)] at s2 + exact stepStar_stepPlus_trans s1 s2 + +theorem multiStep_none_add {c : Cfg (Fin 2) (Fin 6)} {k : Nat} + (h : multiStep target_tm c k = none) (d : Nat) : + multiStep target_tm c (k + d) = none := by + rw [multiStep_add, h]; rfl + +/-- For every `m : Nat`, `init []` runs for at least `m` steps and reaches `Hub 12 (b_seq m) (c_seq m) default`. -/ +theorem reach_arbitrarily_long : + ∀ m : Nat, ∃ N : Nat, m ≤ N ∧ + multiStep target_tm (init []) N = some (Hub 12 (b_seq m) (c_seq m) default) + | 0 => by + rcases init_reaches_hub_0 with ⟨N₀, hN₀⟩ + exact ⟨N₀, Nat.zero_le N₀, hN₀⟩ + | m + 1 => by + rcases reach_arbitrarily_long m with ⟨N, h_le, hN⟩ + rcases hub_step m with ⟨k, hk_pos, hk⟩ + exact ⟨N + k, by omega, multiStep_trans target_tm _ _ _ N k hN hk⟩ + + +end Solution + + + +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg ⟨k, hk⟩ + cases h_step : step target_tm cfg with + | some cfg' => rfl + | none => + have h_none : multiStep target_tm (init []) (k + 1) = none := by + rw [multiStep_succ', hk]; exact h_step + rcases reach_arbitrarily_long (k + 1) with ⟨N, h_ge, hN⟩ + have h_split : N = (k + 1) + (N - (k + 1)) := by omega + have h_none_N : multiStep target_tm (init []) N = none := by + rw [h_split] + exact multiStep_none_add h_none (N - (k + 1)) + rw [h_none_N] at hN + nomatch hN + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0LC_0LC1RE_1LD1LC_1LA1RD_HHH1RF_0RA0RF diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0LC_1LA0RE_0RD0LA_1RE1RA_0LD1RF_0RBHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0LC_1LA0RE_0RD0LA_1RE1RA_0LD1RF_0RBHHH.lean new file mode 100644 index 00000000..80cee973 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0LC_1LA0RE_0RD0LA_1RE1RA_0LD1RF_0RBHHH.lean @@ -0,0 +1,63 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Basic +import BusyBeaver.Calculi.Longitudinal +import BusyBeaver.Calculi.LongitudinalCascade + +open Mathlib Relation Nat Turing BusyBeaver SixState +open BusyBeaver.Longitudinal +open BusyBeaver.LongitudinalCascade + +namespace BusyBeaver.M_1RB0LC_1LA0RE_0RD0LA_1RE1RA_0LD1RF_0RBHHH + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LC_1LA0RE_0RD0LA_1RE1RA_0LD1RF_0RBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +theorem target_eq_tm1 : target = tm1 := by + funext ⟨q, hq⟩ ⟨a, ha⟩ + rcases q with _ | _ | _ | _ | _ | _ | q <;> rcases a with _ | _ | a <;> (try rfl) <;> omega + +theorem init_raw : + (init ([] : List Sym)) [tm1]⊢* + NatCfg.toCfg (K := 6) ⟨2, 0, 0, 733815953114⟩ := by + rw [← toCfg_zero (K := 6)] + exact ⟨2669, stepsNat_sound tm1 2669 ⟨0, 0, 0, 0⟩ ⟨2, 0, 0, 733815953114⟩ + (by decide +kernel) (by decide)⟩ + +theorem toCfg_eq : + NatCfg.toCfg (K := 6) ⟨2, 0, 0, 733815953114⟩ = + cfg (prefix_word 3 +> (t ^ 4 +> default)) := by + have h1 : NatCfg.toCfg (K := 6) ⟨2, 0, 0, 733815953114⟩ = + Cfg.headRight C (decodeHalf 0) (decodeHalf (2 * 733815953114)) := + toCfg_headRight (K := 6) C 0 (2 * 733815953114) + have h2 : decodeHalf (2 * 733815953114) = + ([0, 0, 1, 0] ++ prefix_word 3 ++ t ^ 4) +> (default : ListBlank Sym) := by + rw [← decodeHalf_zero, decodeHalf_encodeList] + congr 1 + rw [h1, h2, decodeHalf_zero] + simp only [cfg, Cfg.headRight, append_assoc] + +public section + +theorem is_not_halt : IsNotHalt target := by + rw [target_eq_tm1] + have h_reach : (init ([] : List Sym)) [tm1]⊢* + cfg (prefix_word 3 +> (t ^ 4 +> default)) := by + rw [← toCfg_eq] + exact init_raw + exact nonHaltFrom_of_stepStar h_reach (normal_nonhalt (Or.inl initial_root)) + +end + +end BusyBeaver.M_1RB0LC_1LA0RE_0RD0LA_1RE1RA_0LD1RF_0RBHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0LC_1LA0RE_0RD1LF_1LC1LB_0LD0RB_0LAHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0LC_1LA0RE_0RD1LF_1LC1LB_0LD0RB_0LAHHH.lean new file mode 100644 index 00000000..bb3189b5 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0LC_1LA0RE_0RD1LF_1LC1LB_0LD0RB_0LAHHH.lean @@ -0,0 +1,117 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Basic +import BusyBeaver.Calculi.Longitudinal +import BusyBeaver.Calculi.LongitudinalCascade + +open Mathlib Relation Nat Turing BusyBeaver SixState +open BusyBeaver.Longitudinal +open BusyBeaver.LongitudinalCascade + +namespace BusyBeaver.M_1RB0LC_1LA0RE_0RD1LF_1LC1LB_0LD0RB_0LAHHH + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LC_1LA0RE_0RD1LF_1LC1LB_0LD0RB_0LAHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +def target_flip : Machine Sym Q + | 0, 0 => some (some 1, Stmt.write 1 Dir.left) + | 0, 1 => some (some 2, Stmt.write 0 Dir.right) + | 1, 0 => some (some 0, Stmt.write 1 Dir.right) + | 1, 1 => some (some 4, Stmt.write 0 Dir.left) + | 2, 0 => some (some 3, Stmt.write 0 Dir.left) + | 2, 1 => some (some 5, Stmt.write 1 Dir.right) + | 3, 0 => some (some 2, Stmt.write 1 Dir.right) + | 3, 1 => some (some 1, Stmt.write 1 Dir.right) + | 4, 0 => some (some 3, Stmt.write 0 Dir.right) + | 4, 1 => some (some 1, Stmt.write 0 Dir.left) + | 5, 0 => some (some 0, Stmt.write 0 Dir.right) + | 5, 1 => none + +theorem init_flip_raw : + (init ([] : List Sym)) [target_flip]⊢* + NatCfg.toCfg (K := 6) ⟨4, 0, 0, 19288074671834⟩ := by + rw [← toCfg_zero (K := 6)] + exact ⟨4293, stepsNat_sound target_flip 4293 ⟨0, 0, 0, 0⟩ ⟨4, 0, 0, 19288074671834⟩ + (by decide +kernel) (by decide)⟩ + +def statePerm : Q → Q + | 0 => 1 | 1 => 0 | 2 => 4 | 3 => 3 | 4 => 2 | 5 => 5 + +theorem step_statePerm (c : Cfg Sym Q) : + step target_flip (mapCfg statePerm c) = (step tm1 c).map (mapCfg statePerm) := by + rcases c with ⟨_ | ⟨_ | _ | _ | _ | _ | _ | q, hq⟩, ⟨⟨_ | _ | h, hh⟩, l, r⟩⟩ <;> + (try rfl) <;> + omega + +theorem multiStep_statePerm (c : Cfg Sym Q) (n : Nat) : + multiStep target_flip (mapCfg statePerm c) n = (multiStep tm1 c n).map (mapCfg statePerm) := by + induction n generalizing c with + | zero => rfl + | succ n ih => + rw [BusyBeaver.multiStep_succ', BusyBeaver.multiStep_succ', ih] + rcases multiStep tm1 c n with _ | c' + · rfl + · exact step_statePerm c' + +theorem nonHaltFrom_statePerm {c : Cfg Sym Q} (h : NonHaltFrom tm1 c) : + NonHaltFrom target_flip (mapCfg statePerm c) := by + intro c' ⟨n, hn⟩ + rw [multiStep_statePerm, Option.map_eq_some_iff] at hn + rcases hn with ⟨d, hd, rfl⟩ + rw [step_statePerm, Option.isSome_map] + exact h d ⟨n, hd⟩ + +theorem target_eq_flipTM : target = flipTM target_flip := by + funext ⟨q, hq⟩ ⟨a, ha⟩ + rcases q with _ | _ | _ | _ | _ | _ | q <;> rcases a with _ | _ | a <;> (try rfl) <;> omega + +theorem isNotHalt_flipTM {M : Machine Sym Q} (h : IsNotHalt M) : + IsNotHalt (flipTM M) := by + intro c ⟨n, hn⟩ + have h_init : (init ([] : List Sym) : Cfg Sym Q) = + flipCfg (init ([] : List Sym) : Cfg Sym Q) := rfl + rw [h_init, multiStep_flipTM, Option.map_eq_some_iff] at hn + rcases hn with ⟨d, hd, rfl⟩ + rw [step_flipTM, Option.isSome_map] + exact h d ⟨n, hd⟩ + +theorem toCfg_flip_eq : + NatCfg.toCfg (K := 6) ⟨4, 0, 0, 19288074671834⟩ = + mapCfg statePerm (cfg (prefix_word 3 +> (word 3 11 +> ([0, 0, 1, 0] +> default)))) := by + have h1 : NatCfg.toCfg (K := 6) ⟨4, 0, 0, 19288074671834⟩ = + Cfg.headRight E (decodeHalf 0) (decodeHalf (2 * 19288074671834)) := + toCfg_headRight (K := 6) E 0 (2 * 19288074671834) + have h2 : decodeHalf (2 * 19288074671834) = + ([0, 0, 1, 0] ++ prefix_word 3 ++ word 3 11 ++ [0, 0, 1, 0]) +> + (default : ListBlank Sym) := by + rw [← decodeHalf_zero, decodeHalf_encodeList] + congr 1 + rw [h1, h2, decodeHalf_zero] + simp only [cfg, mapCfg, statePerm, Option.map_some, Cfg.headRight, append_assoc] + +public section + +theorem is_not_halt : IsNotHalt target := by + rw [target_eq_flipTM] + apply isNotHalt_flipTM + have h_reach : (init ([] : List Sym)) [target_flip]⊢* + mapCfg statePerm (cfg (prefix_word 3 +> (word 3 11 +> ([0, 0, 1, 0] +> default)))) := by + rw [← toCfg_flip_eq] + exact init_flip_raw + exact nonHaltFrom_of_stepStar h_reach + (nonHaltFrom_statePerm (normal_nonhalt (Or.inl initial2_root))) + +end + +end BusyBeaver.M_1RB0LC_1LA0RE_0RD1LF_1LC1LB_0LD0RB_0LAHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0LC_1LC0RB_0LE0LD_1LCHHH_0RA1LF_1LA1LF.lean b/BusyBeaver/BB6/NonHalt/M_1RB0LC_1LC0RB_0LE0LD_1LCHHH_0RA1LF_1LA1LF.lean new file mode 100644 index 00000000..6e6610d2 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0LC_1LC0RB_0LE0LD_1LCHHH_0RA1LF_1LA1LF.lean @@ -0,0 +1,3886 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0LC_1LC0RB_0LE0LD_1LCHHH_0RA1LF_1LA1LF + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LC_1LC0RB_0LE0LD_1LCHHH_0RA1LF_1LA1LF" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +set_option maxHeartbeats 2000000 +set_option maxRecDepth 200000 + +def iterOpt {α : Type*} (f : α → Option α) : ℕ → α → Option α + | 0, x => some x + | n + 1, x => (f x).bind (iterOpt f n) + + +@[simp] theorem iterOpt_zero {α : Type*} (f : α → Option α) (x : α) : + iterOpt f 0 x = some x := rfl + + +@[simp] theorem iterOpt_succ {α : Type*} (f : α → Option α) (n : ℕ) (x : α) : + iterOpt f (n + 1) x = (f x).bind (iterOpt f n) := rfl + + +@[simp] theorem option_some_bind {α β : Type*} (x : α) (f : α → Option β) : + (some x).bind f = f x := rfl + + +@[simp] theorem option_bind_some_fun {α : Type*} (o : Option α) : + o.bind (fun a => some a) = o := by + cases o <;> rfl + + +theorem iterOpt_add {α : Type*} (f : α → Option α) (m n : ℕ) (x : α) : + iterOpt f (m + n) x = (iterOpt f m x).bind (iterOpt f n) := by + induction m generalizing x with + | zero => simp + | succ m ih => + rw [Nat.succ_add, iterOpt_succ, iterOpt_succ] + cases f x <;> simp [ih] + + +theorem iterOpt_trans {α : Type*} {f : α → Option α} {m n : ℕ} {x y z : α} + (h1 : iterOpt f m x = some y) (h2 : iterOpt f n y = some z) : + iterOpt f (m + n) x = some z := by + rw [iterOpt_add, h1, option_some_bind, h2] + +@[simp] theorem dirL_cons (q : Fin 6) (a : Fin 2) (l r : ListBlank (Fin 2)) : + ((ListBlank.cons a l) <{{q}} r) = ⟨some q, ⟨a, l, r⟩⟩ := by simp + + +@[simp] theorem dirR_cons (q : Fin 6) (a : Fin 2) (l r : ListBlank (Fin 2)) : + (l {{q}}> (ListBlank.cons a r)) = ⟨some q, ⟨a, l, r⟩⟩ := by simp + + +@[simp] theorem dirL_default (q : Fin 6) (r : ListBlank (Fin 2)) : + ((default : ListBlank (Fin 2)) <{{q}} r) = ⟨some q, ⟨0, default, r⟩⟩ := rfl + + +@[simp] theorem dirR_default (q : Fin 6) (l : ListBlank (Fin 2)) : + (l {{q}}> (default : ListBlank (Fin 2))) = ⟨some q, ⟨0, l, default⟩⟩ := rfl + + +@[simp] theorem listBlank_append_nil (s : ListBlank (Fin 2)) : + ([] : List (Fin 2)) +> s = s := rfl + + +@[simp] theorem listBlank_append_cons (a : Fin 2) (l : List (Fin 2)) (s : ListBlank (Fin 2)) : + (a :: l) +> s = ListBlank.cons a (l +> s) := rfl + + +@[simp] theorem listBlank_cons_zero_default : + ListBlank.cons (0 : Fin 2) (default : ListBlank (Fin 2)) = default := by + apply ListBlank.ext + intro i + cases i <;> rfl + + +@[simp] theorem step_0135_0_0 (l r : ListBlank (Fin 2)) : + step target_tm ⟨some 0, ⟨0, l, r⟩⟩ = some ((ListBlank.cons 1 l) {{1}}> r) := rfl + + +@[simp] theorem step_0135_0_1 (l r : ListBlank (Fin 2)) : + step target_tm ⟨some 0, ⟨1, l, r⟩⟩ = some (l <{{2}} (ListBlank.cons 0 r)) := rfl + + +@[simp] theorem step_0135_1_0 (l r : ListBlank (Fin 2)) : + step target_tm ⟨some 1, ⟨0, l, r⟩⟩ = some (l <{{2}} (ListBlank.cons 1 r)) := rfl + + +@[simp] theorem step_0135_1_1 (l r : ListBlank (Fin 2)) : + step target_tm ⟨some 1, ⟨1, l, r⟩⟩ = some ((ListBlank.cons 0 l) {{1}}> r) := rfl + + +@[simp] theorem step_0135_2_0 (l r : ListBlank (Fin 2)) : + step target_tm ⟨some 2, ⟨0, l, r⟩⟩ = some (l <{{4}} (ListBlank.cons 0 r)) := rfl + + +@[simp] theorem step_0135_2_1 (l r : ListBlank (Fin 2)) : + step target_tm ⟨some 2, ⟨1, l, r⟩⟩ = some (l <{{3}} (ListBlank.cons 0 r)) := rfl + + +@[simp] theorem step_0135_3_0 (l r : ListBlank (Fin 2)) : + step target_tm ⟨some 3, ⟨0, l, r⟩⟩ = some (l <{{2}} (ListBlank.cons 1 r)) := rfl + + +@[simp] theorem step_0135_4_0 (l r : ListBlank (Fin 2)) : + step target_tm ⟨some 4, ⟨0, l, r⟩⟩ = some ((ListBlank.cons 0 l) {{0}}> r) := rfl + + +@[simp] theorem step_0135_4_1 (l r : ListBlank (Fin 2)) : + step target_tm ⟨some 4, ⟨1, l, r⟩⟩ = some (l <{{5}} (ListBlank.cons 1 r)) := rfl + + +@[simp] theorem step_0135_5_0 (l r : ListBlank (Fin 2)) : + step target_tm ⟨some 5, ⟨0, l, r⟩⟩ = some (l <{{0}} (ListBlank.cons 1 r)) := rfl + + +@[simp] theorem step_0135_5_1 (l r : ListBlank (Fin 2)) : + step target_tm ⟨some 5, ⟨1, l, r⟩⟩ = some (l <{{5}} (ListBlank.cons 1 r)) := rfl + +-- ---------------------------------------------------------------------------- +-- Layer 1B: Stage 1 (decode_blk and 22-Clause Transducer step_blk) +-- ---------------------------------------------------------------------------- + + +inductive LToken where + | L1 | L10 | L00 + deriving DecidableEq, Repr + + +def toLC : List LToken → ListBlank (Fin 2) + | [] => default + | .L1 :: l => ListBlank.cons 1 (toLC l) + | .L10 :: l => ListBlank.cons 0 (ListBlank.cons 1 (toLC l)) + | .L00 :: l => ListBlank.cons 0 (ListBlank.cons 0 (toLC l)) + + +@[simp] theorem toLC_nil : toLC [] = default := rfl +@[simp] theorem toLC_L1 (l : List LToken) : toLC (.L1 :: l) = ListBlank.cons 1 (toLC l) := rfl +@[simp] theorem toLC_L10 (l : List LToken) : + toLC (.L10 :: l) = ListBlank.cons 0 (ListBlank.cons 1 (toLC l)) := rfl + +@[simp] theorem toLC_L00 (l : List LToken) : + toLC (.L00 :: l) = ListBlank.cons 0 (ListBlank.cons 0 (toLC l)) := rfl + + +def toRBlank : List ℕ → ListBlank (Fin 2) + | [] => default + | 0 :: B => ListBlank.cons 1 (toRBlank B) + | (a + 1) :: B => ListBlank.cons 0 (toRBlank (a :: B)) + + +@[simp] theorem toRBlank_nil : toRBlank [] = default := by rw [toRBlank] +@[simp] theorem toRBlank_zero (B : List ℕ) : + toRBlank (0 :: B) = ListBlank.cons 1 (toRBlank B) := by rw [toRBlank] + +@[simp] theorem toRBlank_succ (a : ℕ) (B : List ℕ) : + toRBlank ((a + 1) :: B) = ListBlank.cons 0 (toRBlank (a :: B)) := by rw [toRBlank] + + +inductive Mode6 where + | h11D | h10B | h100F | h10F | h1E | hL + deriving DecidableEq, Repr + + +abbrev BlkCfg := Mode6 × List LToken × List ℕ + + +def decode_blk : BlkCfg → Cfg (Fin 2) (Fin 6) + | (.h11D, l, B) => (toRBlank B) <{{0}} ([1, 1] +> toLC l) + | (.h10B, l, B) => (toRBlank B) <{{2}} ([0, 1] +> toLC l) + | (.h100F, l, B) => (toRBlank B) <{{3}} ([0, 0, 1] +> toLC l) + | (.h10F, l, B) => (toRBlank B) <{{3}} ([0, 1] +> toLC l) + | (.h1E, l, B) => (toRBlank B) <{{5}} ([1] +> toLC l) + | (.hL, l, B) => ([0, 0] +> toRBlank B) {{1}}> (toLC l) + + +theorem init_reaches_blk0 : + (init []) [target_tm]⊢^{12} (decode_blk (.h11D, [.L10, .L1], [])) := by + change multiStep target_tm ⟨some 0, ⟨0, default, default⟩⟩ 12 = + some (decode_blk (.h11D, [.L10, .L1], [])) + simp [decode_blk, multiStep_succ', multiStep_zero] + + +def step_blk : BlkCfg → Option BlkCfg + | (.h11D, l, []) => some (.hL, l, [0]) + | (.h11D, l, 0 :: B') => some (.h10B, .L1 :: l, B') + | (.h11D, l, (a + 1) :: B') => some (.hL, l, 0 :: a :: B') + | (.h10B, l, []) => some (.h11D, .L10 :: .L1 :: .L1 :: l, []) + | (.h10B, l, 0 :: B') => some (.h100F, l, B') + | (.h10B, l, 1 :: B') => some (.h1E, .L00 :: .L1 :: l, B') + | (.h10B, l, 2 :: B') => some (.h10F, .L10 :: .L1 :: l, B') + | (.h10B, l, 3 :: B') => some (.h1E, .L10 :: .L10 :: .L1 :: l, B') + | (.h10B, l, (a + 4) :: B') => some (.h11D, .L10 :: .L1 :: .L1 :: l, a :: B') + | (.h100F, l, []) => some (.h11D, .L10 :: .L10 :: l, []) + | (.h100F, _, 0 :: _) => none + | (.h100F, l, 1 :: B') => some (.h10F, .L00 :: .L1 :: l, B') + | (.h100F, l, 2 :: B') => some (.h1E, .L10 :: .L00 :: .L1 :: l, B') + | (.h100F, l, (a + 3) :: B') => some (.h11D, .L10 :: .L10 :: l, a :: B') + | (.h10F, l, []) => some (.h11D, .L10 :: .L1 :: l, []) + | (.h10F, _, 0 :: _) => none + | (.h10F, l, 1 :: B') => some (.h10F, .L10 :: l, B') + | (.h10F, l, 2 :: B') => some (.h1E, .L10 :: .L10 :: l, B') + | (.h10F, l, (a + 3) :: B') => some (.h11D, .L10 :: .L1 :: l, a :: B') + | (.h1E, l, []) => some (.h11D, l, []) + | (.h1E, l, 0 :: B') => some (.h1E, .L1 :: l, B') + | (.h1E, l, (a + 1) :: B') => some (.h11D, l, a :: B') + | (.hL, _, []) => none + | (.hL, [], a :: B') => some (.h11D, [.L10], a :: B') + | (.hL, .L00 :: l', a :: B') => some (.h11D, .L10 :: l', a :: B') + | (.hL, .L10 :: l', a :: B') => some (.hL, l', 0 :: (a + 1) :: B') + | (.hL, .L1 :: l', a :: B') => some (.hL, l', (a + 1) :: B') + + +theorem step_blk_correct (c c' : BlkCfg) (h : step_blk c = some c') : + (decode_blk c) [target_tm]⊢⁺ (decode_blk c') := by + rcases c with ⟨m, l, B⟩ + cases m with + | h11D => + rcases B with _ | ⟨a, B'⟩ + · simp [step_blk] at h; subst h + exact ⟨3, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + · rcases a with _ | a + · simp [step_blk] at h; subst h + exact ⟨1, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + · simp [step_blk] at h; subst h + exact ⟨3, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + | h10B => + rcases B with _ | ⟨a, B'⟩ + · simp [step_blk] at h; subst h + exact ⟨14, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + · rcases a with _ | _ | _ | _ | a + · simp [step_blk] at h; subst h + exact ⟨1, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + · simp [step_blk] at h; subst h + exact ⟨2, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + · simp [step_blk] at h; subst h + exact ⟨7, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + · simp [step_blk] at h; subst h + exact ⟨8, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + · simp [step_blk] at h; subst h + exact ⟨14, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + | h100F => + rcases B with _ | ⟨a, B'⟩ + · simp [step_blk] at h; subst h + exact ⟨9, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + · rcases a with _ | _ | _ | a + · simp [step_blk] at h + · simp [step_blk] at h; subst h + exact ⟨2, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + · simp [step_blk] at h; subst h + exact ⟨3, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + · simp [step_blk] at h; subst h + exact ⟨9, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + | h10F => + rcases B with _ | ⟨a, B'⟩ + · simp [step_blk] at h; subst h + exact ⟨9, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + · rcases a with _ | _ | _ | a + · simp [step_blk] at h + · simp [step_blk] at h; subst h + exact ⟨2, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + · simp [step_blk] at h; subst h + exact ⟨3, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + · simp [step_blk] at h; subst h + exact ⟨9, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + | h1E => + rcases B with _ | ⟨a, B'⟩ + · simp [step_blk] at h; subst h + exact ⟨1, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + · rcases a with _ | a + · simp [step_blk] at h; subst h + exact ⟨1, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + · simp [step_blk] at h; subst h + exact ⟨1, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + | hL => + rcases B with _ | ⟨a, B'⟩ + · simp [step_blk] at h + · rcases l with _ | ⟨tok, l'⟩ + · simp [step_blk] at h; subst h + exact ⟨9, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + · cases tok with + | L00 => + simp [step_blk] at h; subst h + exact ⟨9, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + | L10 => + simp [step_blk] at h; subst h + exact ⟨6, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + | L1 => + simp [step_blk] at h; subst h + exact ⟨1, by omega, by simp [decode_blk, multiStep_succ', multiStep_zero]⟩ + +-- ---------------------------------------------------------------------------- +-- Layer 1C: Stage 2 (SBlock, Phi, and 25-Clause Transducer step_5mode) +-- ---------------------------------------------------------------------------- + + +inductive SBlock where + | A (k : ℕ) + | B (k : ℕ) + deriving DecidableEq, Repr + + +def evalSB : List SBlock → List LToken + | [] => [] + | .A k :: ls => List.replicate k .L1 ++ (.L10 :: evalSB ls) + | .B k :: ls => List.replicate k .L1 ++ (.L00 :: evalSB ls) + + +@[simp] theorem evalSB_nil : evalSB [] = [] := rfl +@[simp] theorem evalSB_A (k : ℕ) (ls : List SBlock) : + evalSB (.A k :: ls) = List.replicate k .L1 ++ (.L10 :: evalSB ls) := rfl + +@[simp] theorem evalSB_B (k : ℕ) (ls : List SBlock) : + evalSB (.B k :: ls) = List.replicate k .L1 ++ (.L00 :: evalSB ls) := rfl + + +def incTop : List SBlock → ℕ → List SBlock + | [], d => [.A d] + | .A k :: ls, d => .A (k + d) :: ls + | .B k :: ls, d => .B (k + d) :: ls + + +@[simp] theorem incTop_nil (d : ℕ) : incTop [] d = [.A d] := rfl +@[simp] theorem incTop_A (k : ℕ) (ls : List SBlock) (d : ℕ) : + incTop (.A k :: ls) d = .A (k + d) :: ls := rfl + +@[simp] theorem incTop_B (k : ℕ) (ls : List SBlock) (d : ℕ) : + incTop (.B k :: ls) d = .B (k + d) :: ls := rfl + + +theorem evalSB_incTop {ls : List SBlock} (hls : ls ≠ []) (d : ℕ) : + evalSB (incTop ls d) = List.replicate d .L1 ++ evalSB ls := by + rcases ls with _ | ⟨sb, lsp⟩ + · contradiction + · cases sb with + | A k => + simp only [evalSB_A, incTop_A, Nat.add_comm k d, List.replicate_add, List.append_assoc] + | B k => + simp only [evalSB_B, incTop_B, Nat.add_comm k d, List.replicate_add, List.append_assoc] + + +inductive Mode5 where + | hL | h10B | h1E | h100F | h10F + deriving DecidableEq, Repr + +abbrev Cfg5 := Mode5 × List SBlock × List ℕ + + +def Phi : Cfg5 → BlkCfg + | (.hL, ls, rs) => (.hL, evalSB ls, 0 :: rs) + | (.h10B, ls, rs) => (.h10B, evalSB ls, rs) + | (.h1E, ls, rs) => (.h1E, evalSB ls, rs) + | (.h100F, ls, rs) => (.h100F, evalSB ls, rs) + | (.h10F, ls, rs) => (.h10F, evalSB ls, rs) + + +theorem pop_L1_run (r a : ℕ) (l' : List LToken) (rs : List ℕ) : + iterOpt step_blk r (.hL, List.replicate r .L1 ++ l', a :: rs) = + some (.hL, l', (a + r) :: rs) := by + induction r generalizing a with + | zero => simp + | succ r ih => + rw [List.replicate_succ, List.cons_append, Nat.add_comm r 1] + have h1 : iterOpt step_blk 1 (.hL, .L1 :: (List.replicate r .L1 ++ l'), a :: rs) = + some (.hL, List.replicate r .L1 ++ l', (a + 1) :: rs) := rfl + refine iterOpt_trans h1 ?_ + rw [ih (a + 1), show a + 1 + r = a + (1 + r) by omega] + + +theorem pop_L1_run_zero (r : ℕ) (l' : List LToken) (rs : List ℕ) : + iterOpt step_blk r (.hL, List.replicate r .L1 ++ l', 0 :: rs) = + some (.hL, l', r :: rs) := by + simpa [Nat.zero_add] using pop_L1_run r 0 l' rs + + +def step_5mode : Cfg5 → Option Cfg5 + | (.hL, [], rs) => some (.h10B, [.A 1], rs) + | (.hL, .A k :: lsp, rs) => some (.hL, lsp, (k + 1) :: rs) + | (.hL, .B 0 :: lsp, rs) => some (.h10B, .A 1 :: lsp, rs) + | (.hL, .B (k + 1) :: lsp, rs) => some (.hL, lsp, 1 :: k :: rs) + | (.h10B, ls, []) => some (.hL, .A 0 :: incTop ls 2, []) + | (.h10B, ls, 0 :: rsp) => some (.h100F, ls, rsp) + | (.h10B, ls, 1 :: rsp) => some (.h1E, .B 0 :: incTop ls 1, rsp) + | (.h10B, ls, 2 :: rsp) => some (.h10F, .A 0 :: incTop ls 1, rsp) + | (.h10B, ls, 3 :: rsp) => some (.h1E, .A 0 :: .A 0 :: incTop ls 1, rsp) + | (.h10B, ls, 4 :: rsp) => some (.h10B, .A 1 :: incTop ls 2, rsp) + | (.h10B, ls, (a + 5) :: rsp) => some (.hL, .A 0 :: incTop ls 2, a :: rsp) + | (.h100F, ls, []) => some (.hL, .A 0 :: .A 0 :: ls, []) + | (.h100F, _, 0 :: _) => none + | (.h100F, ls, 1 :: rsp) => some (.h10F, .B 0 :: incTop ls 1, rsp) + | (.h100F, ls, 2 :: rsp) => some (.h1E, .A 0 :: .B 0 :: incTop ls 1, rsp) + | (.h100F, ls, 3 :: rsp) => some (.h10B, .A 1 :: .A 0 :: ls, rsp) + | (.h100F, ls, (a + 4) :: rsp) => some (.hL, .A 0 :: .A 0 :: ls, a :: rsp) + | (.h10F, ls, []) => some (.hL, .A 0 :: incTop ls 1, []) + | (.h10F, _, 0 :: _) => none + | (.h10F, ls, 1 :: rsp) => some (.h10F, .A 0 :: ls, rsp) + | (.h10F, ls, 2 :: rsp) => some (.h1E, .A 0 :: .A 0 :: ls, rsp) + | (.h10F, ls, 3 :: rsp) => some (.h10B, .A 1 :: incTop ls 1, rsp) + | (.h10F, ls, (a + 4) :: rsp) => some (.hL, .A 0 :: incTop ls 1, a :: rsp) + | (.h1E, ls, []) => some (.hL, ls, []) + | (.h1E, ls, 0 :: rsp) => some (.h1E, incTop ls 1, rsp) + | (.h1E, ls, 1 :: rsp) => some (.h10B, incTop ls 1, rsp) + | (.h1E, ls, (a + 2) :: rsp) => some (.hL, ls, a :: rsp) + + +theorem step_5mode_correct (c c' : Cfg5) + (hguard : c.1 ≠ .hL → c.2.1 ≠ []) + (h : step_5mode c = some c') : + ∃ j > 0, iterOpt step_blk j (Phi c) = some (Phi c') := by + rcases c with ⟨m, ls, rs⟩ + cases m with + | hL => + rcases ls with _ | ⟨sb, lsp⟩ + · simp [step_5mode] at h; subst h + exact ⟨2, by omega, rfl⟩ + · cases sb with + | A k => + simp [step_5mode] at h; subst h + refine ⟨k + 1, by omega, ?_⟩ + simp only [Phi, evalSB_A] + exact iterOpt_trans (pop_L1_run_zero k (.L10 :: evalSB lsp) rs) rfl + | B k => + rcases k with _ | k + · simp [step_5mode] at h; subst h + exact ⟨2, by omega, rfl⟩ + · simp [step_5mode] at h; subst h + refine ⟨(k + 1) + 3, by omega, ?_⟩ + simp only [Phi, evalSB_B] + exact iterOpt_trans (pop_L1_run_zero (k + 1) (.L00 :: evalSB lsp) rs) rfl + | h10B => + have hls : ls ≠ [] := hguard (by intro hc; cases hc) + rcases rs with _ | ⟨r0, rsp⟩ + · simp [step_5mode] at h; subst h + exact ⟨2, by omega, by simp [Phi, step_blk, evalSB_incTop hls]⟩ + · rcases r0 with _ | _ | _ | _ | _ | a + · simp [step_5mode] at h; subst h + exact ⟨1, by omega, by simp [Phi, step_blk]⟩ + · simp [step_5mode] at h; subst h + exact ⟨1, by omega, by simp [Phi, step_blk, evalSB_incTop hls]⟩ + · simp [step_5mode] at h; subst h + exact ⟨1, by omega, by simp [Phi, step_blk, evalSB_incTop hls]⟩ + · simp [step_5mode] at h; subst h + exact ⟨1, by omega, by simp [Phi, step_blk, evalSB_incTop hls]⟩ + · simp [step_5mode] at h; subst h + exact ⟨2, by omega, by simp [Phi, step_blk, evalSB_incTop hls]⟩ + · simp [step_5mode] at h; subst h + exact ⟨2, by omega, by simp [Phi, step_blk, evalSB_incTop hls]⟩ + | h100F => + have hls : ls ≠ [] := hguard (by intro hc; cases hc) + rcases rs with _ | ⟨r0, rsp⟩ + · simp [step_5mode] at h; subst h + exact ⟨2, by omega, by simp [Phi, step_blk]⟩ + · rcases r0 with _ | _ | _ | _ | a + · simp [step_5mode] at h + · simp [step_5mode] at h; subst h + exact ⟨1, by omega, by simp [Phi, step_blk, evalSB_incTop hls]⟩ + · simp [step_5mode] at h; subst h + exact ⟨1, by omega, by simp [Phi, step_blk, evalSB_incTop hls]⟩ + · simp [step_5mode] at h; subst h + exact ⟨2, by omega, by simp [Phi, step_blk]⟩ + · simp [step_5mode] at h; subst h + exact ⟨2, by omega, by simp [Phi, step_blk]⟩ + | h10F => + have hls : ls ≠ [] := hguard (by intro hc; cases hc) + rcases rs with _ | ⟨r0, rsp⟩ + · simp [step_5mode] at h; subst h + exact ⟨2, by omega, by simp [Phi, step_blk, evalSB_incTop hls]⟩ + · rcases r0 with _ | _ | _ | _ | a + · simp [step_5mode] at h + · simp [step_5mode] at h; subst h + exact ⟨1, by omega, by simp [Phi, step_blk]⟩ + · simp [step_5mode] at h; subst h + exact ⟨1, by omega, by simp [Phi, step_blk]⟩ + · simp [step_5mode] at h; subst h + exact ⟨2, by omega, by simp [Phi, step_blk, evalSB_incTop hls]⟩ + · simp [step_5mode] at h; subst h + exact ⟨2, by omega, by simp [Phi, step_blk, evalSB_incTop hls]⟩ + | h1E => + have hls : ls ≠ [] := hguard (by intro hc; cases hc) + rcases rs with _ | ⟨r0, rsp⟩ + · simp [step_5mode] at h; subst h + exact ⟨2, by omega, by simp [Phi, step_blk]⟩ + · rcases r0 with _ | _ | a + · simp [step_5mode] at h; subst h + exact ⟨1, by omega, by simp [Phi, step_blk, evalSB_incTop hls]⟩ + · simp [step_5mode] at h; subst h + exact ⟨2, by omega, by simp [Phi, step_blk, evalSB_incTop hls]⟩ + · simp [step_5mode] at h; subst h + exact ⟨2, by omega, by simp [Phi, step_blk]⟩ + +-- ---------------------------------------------------------------------------- +-- Layer 2: Stage 3 (Spine, step_sq, and Startup to c_319) +-- ---------------------------------------------------------------------------- + + +def W_5 : List SBlock := [.A 3, .A 0, .A 2, .A 0, .A 2] + + +def Spine : ℕ → List SBlock + | 0 => W_5 + | n + 1 => .A 0 :: .A 2 :: Spine n + + +theorem spine_nonempty (n : ℕ) : Spine n ≠ [] := by + cases n <;> simp [Spine, W_5] + + +def rep31 : ℕ → List ℕ + | 0 => [] + | n + 1 => rep31 n ++ [3, 1] + + +theorem spine_left_drain (n : ℕ) (L₀ : List SBlock) (R : List ℕ) : + iterOpt step_5mode (2 * n) (.hL, (List.replicate n [.A 0, .A 2]).flatten ++ L₀, R) = + some (.hL, L₀, rep31 n ++ R) := by + induction n generalizing R with + | zero => simp [rep31] + | succ n ih => + rw [Nat.mul_succ, Nat.add_comm (2 * n) 2] + simp only [List.replicate_succ, List.flatten_cons, List.append_assoc] + have h2 : iterOpt step_5mode 2 + (.hL, .A 0 :: .A 2 :: ((List.replicate n [.A 0, .A 2]).flatten ++ L₀), R) = + some (.hL, (List.replicate n [.A 0, .A 2]).flatten ++ L₀, 3 :: 1 :: R) := rfl + refine iterOpt_trans h2 ?_ + rw [ih (3 :: 1 :: R)] + simp [rep31, List.append_assoc] + + +theorem spine_eq_flatten (n : ℕ) : + Spine n = (List.replicate n [.A 0, .A 2]).flatten ++ W_5 := by + induction n with + | zero => rfl + | succ n ih => simp [Spine, List.replicate_succ, ih] + + +theorem w5_bottom_bounce (R' : List ℕ) : + iterOpt step_5mode 11 (.hL, W_5, R') = some (.h10B, .A 1 :: W_5, R') := rfl + + +theorem spine_right_climb (n : ℕ) (L₀ : List SBlock) (R : List ℕ) : + iterOpt step_5mode (2 * n) (.h10B, .A 1 :: L₀, rep31 n ++ R) = + some (.h10B, .A 1 :: ((List.replicate n [.A 0, .A 2]).flatten ++ L₀), R) := by + induction n generalizing L₀ R with + | zero => simp [rep31] + | succ n ih => + rw [Nat.mul_succ, rep31, List.append_assoc] + have h_ih := ih L₀ ([3, 1] ++ R) + refine iterOpt_trans h_ih ?_ + have h2 : iterOpt step_5mode 2 + (.h10B, .A 1 :: ((List.replicate n [.A 0, .A 2]).flatten ++ L₀), 3 :: 1 :: R) = + some (.h10B, .A 1 :: .A 0 :: .A 2 :: ((List.replicate n [.A 0, .A 2]).flatten ++ L₀), R) := rfl + simpa [List.replicate_succ] using h2 + + +theorem spine_bounce_stationary (n : ℕ) (R : List ℕ) : + iterOpt step_5mode (4 * n + 11) (.hL, Spine n, R) = + some (.h10B, .A 1 :: Spine n, R) := by + rw [spine_eq_flatten] + have h1 := spine_left_drain n W_5 R + have h2 := w5_bottom_bounce (rep31 n ++ R) + have h3 := spine_right_climb n W_5 R + have h12 := iterOpt_trans h1 h2 + have h123 := iterOpt_trans h12 h3 + have h_len : 2 * n + 11 + 2 * n = 4 * n + 11 := by omega + rwa [h_len] at h123 + + +theorem spine_bounce_absorb (n : ℕ) (R : List ℕ) : + iterOpt step_5mode (4 * n + 15) (.hL, [.A 0, .A 2] ++ Spine n, R) = + some (.h10B, .A 1 :: Spine (n + 1), R) := by + have h := spine_bounce_stationary (n + 1) R + have h_len : 4 * (n + 1) + 11 = 4 * n + 15 := by omega + rwa [h_len] at h + + +abbrev CfgSq := Mode5 × List SBlock × List ℕ + + +def Psi_sq (n : ℕ) : CfgSq → Cfg5 + | (m, ls, rs) => (m, ls ++ Spine n, rs) + + +def step_sq : CfgSq → Option CfgSq + | (.hL, [], rs) => some (.h10B, [.A 1], rs) + | (.hL, [.A 0, .A 2], rs) => some (.h10B, [.A 1], rs) + | (.hL, .A k :: lsp, rs) => some (.hL, lsp, (k + 1) :: rs) + | (.hL, .B 0 :: lsp, rs) => some (.h10B, .A 1 :: lsp, rs) + | (.hL, .B (k + 1) :: lsp, rs) => some (.hL, lsp, 1 :: k :: rs) + | (.h10B, ls, []) => some (.hL, .A 0 :: incTop ls 2, []) + | (.h10B, ls, 0 :: rsp) => some (.h100F, ls, rsp) + | (.h10B, ls, 1 :: rsp) => some (.h1E, .B 0 :: incTop ls 1, rsp) + | (.h10B, ls, 2 :: rsp) => some (.h10F, .A 0 :: incTop ls 1, rsp) + | (.h10B, ls, 3 :: rsp) => some (.h1E, .A 0 :: .A 0 :: incTop ls 1, rsp) + | (.h10B, ls, 4 :: rsp) => some (.h10B, .A 1 :: incTop ls 2, rsp) + | (.h10B, ls, (a + 5) :: rsp) => some (.hL, .A 0 :: incTop ls 2, a :: rsp) + | (.h100F, ls, []) => some (.hL, .A 0 :: .A 0 :: ls, []) + | (.h100F, _, 0 :: _) => none + | (.h100F, ls, 1 :: rsp) => some (.h10F, .B 0 :: incTop ls 1, rsp) + | (.h100F, ls, 2 :: rsp) => some (.h1E, .A 0 :: .B 0 :: incTop ls 1, rsp) + | (.h100F, ls, 3 :: rsp) => some (.h10B, .A 1 :: .A 0 :: ls, rsp) + | (.h100F, ls, (a + 4) :: rsp) => some (.hL, .A 0 :: .A 0 :: ls, a :: rsp) + | (.h10F, ls, []) => some (.hL, .A 0 :: incTop ls 1, []) + | (.h10F, _, 0 :: _) => none + | (.h10F, ls, 1 :: rsp) => some (.h10F, .A 0 :: ls, rsp) + | (.h10F, ls, 2 :: rsp) => some (.h1E, .A 0 :: .A 0 :: ls, rsp) + | (.h10F, ls, 3 :: rsp) => some (.h10B, .A 1 :: incTop ls 1, rsp) + | (.h10F, ls, (a + 4) :: rsp) => some (.hL, .A 0 :: incTop ls 1, a :: rsp) + | (.h1E, ls, []) => some (.hL, ls, []) + | (.h1E, ls, 0 :: rsp) => some (.h1E, incTop ls 1, rsp) + | (.h1E, ls, 1 :: rsp) => some (.h10B, incTop ls 1, rsp) + | (.h1E, ls, (a + 2) :: rsp) => some (.hL, ls, a :: rsp) + + +theorem incTop_nonempty (ls : List SBlock) (d : ℕ) : incTop ls d ≠ [] := by + cases ls with + | nil => simp + | cons sb lsp => cases sb <;> simp + + +theorem incTop_append {ls : List SBlock} (hls : ls ≠ []) (S : List SBlock) (d : ℕ) : + incTop (ls ++ S) d = incTop ls d ++ S := by + rcases ls with _ | ⟨sb, lsp⟩ + · contradiction + · cases sb <;> rfl + + +theorem step_sq_preserves_guard (c c' : CfgSq) + (hguard : c.1 ≠ .hL → c.2.1 ≠ []) + (h : step_sq c = some c') : + c'.1 ≠ .hL → c'.2.1 ≠ [] := by + rcases c with ⟨m, ls, rs⟩ + cases m with + | hL => + rcases ls with _ | ⟨sb, lsp⟩ + · simp [step_sq] at h; subst h; simp + · cases sb with + | A k => + rcases k with _ | k + · rcases lsp with _ | ⟨sb2, lsp2⟩ + · simp [step_sq] at h; subst h; simp + · cases sb2 with + | A k2 => + rcases k2 with _ | _ | _ | k2 + · simp [step_sq] at h; subst h; simp + · simp [step_sq] at h; subst h; simp + · rcases lsp2 with _ | ⟨sb3, lsp3⟩ + · simp [step_sq] at h; subst h; simp + · simp [step_sq] at h; subst h; simp + · simp [step_sq] at h; subst h; simp + | B k2 => simp [step_sq] at h; subst h; simp + · simp [step_sq] at h; subst h; simp + | B k => + rcases k with _ | k + · simp [step_sq] at h; subst h; simp + · simp [step_sq] at h; subst h; simp + | h10B => + have hls : ls ≠ [] := hguard (by intro hc; cases hc) + rcases rs with _ | ⟨r0, rsp⟩ + · simp [step_sq] at h; subst h; simp + · rcases r0 with _ | _ | _ | _ | _ | a <;> + (simp [step_sq] at h; subst h; intro _; first | exact hls | exact incTop_nonempty _ _ | simp) + | h100F => + rcases rs with _ | ⟨r0, rsp⟩ + · simp [step_sq] at h; subst h; simp + · rcases r0 with _ | _ | _ | _ | a + · simp [step_sq] at h + · simp [step_sq] at h; subst h; simp + · simp [step_sq] at h; subst h; simp + · simp [step_sq] at h; subst h; simp + · simp [step_sq] at h; subst h; simp + | h10F => + rcases rs with _ | ⟨r0, rsp⟩ + · simp [step_sq] at h; subst h; simp + · rcases r0 with _ | _ | _ | _ | a + · simp [step_sq] at h + · simp [step_sq] at h; subst h; simp + · simp [step_sq] at h; subst h; simp + · simp [step_sq] at h; subst h; simp + · simp [step_sq] at h; subst h; simp + | h1E => + rcases rs with _ | ⟨r0, rsp⟩ + · simp [step_sq] at h; subst h; simp + · rcases r0 with _ | _ | a + · simp [step_sq] at h; subst h; intro _; exact incTop_nonempty _ _ + · simp [step_sq] at h; subst h; intro _; exact incTop_nonempty _ _ + · simp [step_sq] at h; subst h; simp + + +def decode_sq (n : ℕ) (c : CfgSq) : Cfg (Fin 2) (Fin 6) := + decode_blk (Phi (Psi_sq n c)) + + +theorem psi_sq_guard (n : ℕ) (c : CfgSq) : + (Psi_sq n c).1 ≠ .hL → (Psi_sq n c).2.1 ≠ [] := by + rcases c with ⟨m, ls, rs⟩ + intro _ + simp only [Psi_sq] + intro h_empty + have := List.append_eq_nil_iff.mp h_empty + exact spine_nonempty n this.2 + + +theorem step_sq_lift (n : ℕ) (c c' : CfgSq) + (hguard : c.1 ≠ .hL → c.2.1 ≠ []) + (h : step_sq c = some c') : + ∃ n' k, k > 0 ∧ iterOpt step_5mode k (Psi_sq n c) = some (Psi_sq n' c') := by + rcases c with ⟨m, ls, rs⟩ + cases m with + | hL => + rcases ls with _ | ⟨sb, lsp⟩ + · simp [step_sq] at h; subst h + exact ⟨n, 4 * n + 11, by omega, spine_bounce_stationary n rs⟩ + · cases sb with + | A k => + rcases k with _ | k + · rcases lsp with _ | ⟨sb2, lsp2⟩ + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, rfl⟩ + · cases sb2 with + | A k2 => + rcases k2 with _ | _ | _ | k2 + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, rfl⟩ + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, rfl⟩ + · rcases lsp2 with _ | ⟨sb3, lsp3⟩ + · simp [step_sq] at h; subst h + exact ⟨n + 1, 4 * n + 15, by omega, spine_bounce_absorb n rs⟩ + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, rfl⟩ + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, rfl⟩ + | B k2 => + simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, rfl⟩ + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, rfl⟩ + | B k => + rcases k with _ | k + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, rfl⟩ + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, rfl⟩ + | h10B => + have hls : ls ≠ [] := hguard (by intro hc; cases hc) + rcases rs with _ | ⟨r0, rsp⟩ + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, by simp [Psi_sq, step_5mode, incTop_append hls]⟩ + · rcases r0 with _ | _ | _ | _ | _ | a <;> + (simp [step_sq] at h; subst h; + exact ⟨n, 1, by omega, by simp [Psi_sq, step_5mode, incTop_append hls]⟩) + | h100F => + have hls : ls ≠ [] := hguard (by intro hc; cases hc) + rcases rs with _ | ⟨r0, rsp⟩ + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, by simp [Psi_sq, step_5mode]⟩ + · rcases r0 with _ | _ | _ | _ | a + · simp [step_sq] at h + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, by simp [Psi_sq, step_5mode, incTop_append hls]⟩ + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, by simp [Psi_sq, step_5mode, incTop_append hls]⟩ + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, by simp [Psi_sq, step_5mode]⟩ + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, by simp [Psi_sq, step_5mode]⟩ + | h10F => + have hls : ls ≠ [] := hguard (by intro hc; cases hc) + rcases rs with _ | ⟨r0, rsp⟩ + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, by simp [Psi_sq, step_5mode, incTop_append hls]⟩ + · rcases r0 with _ | _ | _ | _ | a + · simp [step_sq] at h + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, by simp [Psi_sq, step_5mode]⟩ + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, by simp [Psi_sq, step_5mode]⟩ + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, by simp [Psi_sq, step_5mode, incTop_append hls]⟩ + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, by simp [Psi_sq, step_5mode, incTop_append hls]⟩ + | h1E => + have hls : ls ≠ [] := hguard (by intro hc; cases hc) + rcases rs with _ | ⟨r0, rsp⟩ + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, by simp [Psi_sq, step_5mode]⟩ + · rcases r0 with _ | _ | a + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, by simp [Psi_sq, step_5mode, incTop_append hls]⟩ + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, by simp [Psi_sq, step_5mode, incTop_append hls]⟩ + · simp [step_sq] at h; subst h + exact ⟨n, 1, by omega, by simp [Psi_sq, step_5mode]⟩ + + +def c0_sq : CfgSq := (.hL, [.A 0], []) + +def c319_sq : CfgSq := (.h10B, [.A 1], [3, 1, 0, 1, 3, 1, 1, 1, 1, 1, 0, 1]) + + +def SqReachesPlus (R₁ R₂ : List ℕ) : Prop := + ∃ k > 0, iterOpt step_sq k (.h10B, [.A 1], R₁) = some (.h10B, [.A 1], R₂) + + +def SqReachesStar (R₁ R₂ : List ℕ) : Prop := + ∃ k, iterOpt step_sq k (.h10B, [.A 1], R₁) = some (.h10B, [.A 1], R₂) + + +theorem sqReachesStar_refl (R : List ℕ) : SqReachesStar R R := + ⟨0, rfl⟩ + + +theorem sqReachesStar_of_plus {R₁ R₂ : List ℕ} (h : SqReachesPlus R₁ R₂) : + SqReachesStar R₁ R₂ := by + rcases h with ⟨k, _, hk⟩ + exact ⟨k, hk⟩ + + +theorem sqReachesPlus_trans {R₁ R₂ R₃ : List ℕ} + (h₁ : SqReachesPlus R₁ R₂) (h₂ : SqReachesPlus R₂ R₃) : + SqReachesPlus R₁ R₃ := by + rcases h₁ with ⟨k₁, hk₁, hstep₁⟩ + rcases h₂ with ⟨k₂, hk₂, hstep₂⟩ + exact ⟨k₁ + k₂, by omega, iterOpt_trans hstep₁ hstep₂⟩ + + +theorem sqReachesPlus_star_trans {R₁ R₂ R₃ : List ℕ} + (h₁ : SqReachesPlus R₁ R₂) (h₂ : SqReachesStar R₂ R₃) : + SqReachesPlus R₁ R₃ := by + rcases h₁ with ⟨k₁, hk₁, hstep₁⟩ + rcases h₂ with ⟨k₂, hstep₂⟩ + exact ⟨k₁ + k₂, by omega, iterOpt_trans hstep₁ hstep₂⟩ + + +theorem sqReachesStar_trans {R₁ R₂ R₃ : List ℕ} + (h₁ : SqReachesStar R₁ R₂) (h₂ : SqReachesStar R₂ R₃) : + SqReachesStar R₁ R₃ := by + rcases h₁ with ⟨k₁, hstep₁⟩ + rcases h₂ with ⟨k₂, hstep₂⟩ + exact ⟨k₁ + k₂, iterOpt_trans hstep₁ hstep₂⟩ + + +theorem replicate_append_cons_same {α : Type*} (k : ℕ) (x : α) (L : List α) : + List.replicate k x ++ (x :: L) = List.replicate (k + 1) x ++ L := by + induction k with + | zero => rfl + | succ k ih => simp [List.replicate_succ, ih] + + +theorem replicate_two_mul_append_two {α : Type*} (k : ℕ) (x : α) (R : List α) : + List.replicate (2 * (k + 1)) x ++ R = List.replicate (2 * k) x ++ (x :: x :: R) := by + rw [Nat.mul_succ, List.replicate_add, List.append_assoc] + rfl + + +theorem incTop_incTop (ls : List SBlock) (d1 d2 : ℕ) : + incTop (incTop ls d1) d2 = incTop ls (d1 + d2) := by + cases ls with + | nil => rfl + | cons sb lsp => cases sb <;> simp [incTop, Nat.add_assoc] + + +theorem scan_ones_h10B (k : ℕ) (ls : List SBlock) (R : List ℕ) : + iterOpt step_sq (2 * (k + 1)) (.h10B, ls, List.replicate (2 * (k + 1)) 1 ++ R) = + some (.h10B, .B 1 :: (List.replicate k (.B 2) ++ incTop ls 1), R) := by + induction k generalizing R with + | zero => rfl + | succ k ih => + rw [replicate_two_mul_append_two (k + 1), Nat.mul_succ 2 (k + 1)] + refine iterOpt_trans (ih (1 :: 1 :: R)) ?_ + have h2 : iterOpt step_sq 2 + (.h10B, .B 1 :: (List.replicate k (.B 2) ++ incTop ls 1), 1 :: 1 :: R) = + some (.h10B, .B 1 :: .B 2 :: (List.replicate k (.B 2) ++ incTop ls 1), R) := rfl + simpa [List.replicate_succ] using h2 + + +theorem scan_ones_h1E (k : ℕ) (ls : List SBlock) (R : List ℕ) : + iterOpt step_sq (2 * (k + 1)) (.h1E, ls, List.replicate (2 * (k + 1)) 1 ++ R) = + some (.h1E, .B 0 :: (List.replicate k (.B 2) ++ incTop ls 2), R) := by + induction k generalizing R with + | zero => + simp [iterOpt, step_sq, incTop_incTop] + | succ k ih => + rw [replicate_two_mul_append_two (k + 1), Nat.mul_succ 2 (k + 1)] + refine iterOpt_trans (ih (1 :: 1 :: R)) ?_ + have h2 : iterOpt step_sq 2 + (.h1E, .B 0 :: (List.replicate k (.B 2) ++ incTop ls 2), 1 :: 1 :: R) = + some (.h1E, .B 0 :: .B 2 :: (List.replicate k (.B 2) ++ incTop ls 2), R) := rfl + simpa [List.replicate_succ] using h2 + + +theorem scan_ones_h10F (k : ℕ) (ls : List SBlock) (R : List ℕ) : + iterOpt step_sq k (.h10F, ls, List.replicate k 1 ++ R) = + some (.h10F, List.replicate k (.A 0) ++ ls, R) := by + induction k generalizing ls with + | zero => rfl + | succ k ih => + rw [List.replicate_succ, List.cons_append] + conv_lhs => rw [Nat.add_comm k 1] + have h1 : iterOpt step_sq 1 (.h10F, ls, 1 :: (List.replicate k 1 ++ R)) = + some (.h10F, .A 0 :: ls, List.replicate k 1 ++ R) := rfl + refine iterOpt_trans h1 ?_ + rw [ih (.A 0 :: ls), replicate_append_cons_same] + + +theorem step_sq_hL_A0 (lsp : List SBlock) (h : lsp ≠ [.A 2]) (rs : List ℕ) : + step_sq (.hL, .A 0 :: lsp, rs) = some (.hL, lsp, 1 :: rs) := by + rcases lsp with _ | ⟨sb, lsp2⟩ + · rfl + · cases sb with + | A k => + rcases k with _ | _ | _ | k + · rfl + · rfl + · rcases lsp2 with _ | ⟨sb3, lsp3⟩ + · exact absurd rfl h + · rfl + · rfl + | B k => rfl + + +theorem replicate_A0_append_ne_A2 (k : ℕ) {ls : List SBlock} (h : ls ≠ [.A 2]) : + List.replicate k (.A 0) ++ ls ≠ [.A 2] := by + cases k with + | zero => exact h + | succ k => + rw [List.replicate_succ, List.cons_append] + intro hc; injection hc with h1 _; cases h1 + + +theorem pop_B2_run_hL (k : ℕ) (ls : List SBlock) (R : List ℕ) : + iterOpt step_sq k (.hL, List.replicate k (.B 2) ++ ls, R) = + some (.hL, ls, List.replicate (2 * k) 1 ++ R) := by + induction k generalizing R with + | zero => rfl + | succ k ih => + rw [List.replicate_succ, List.cons_append] + conv_lhs => rw [Nat.add_comm k 1] + have h1 : iterOpt step_sq 1 (.hL, .B 2 :: (List.replicate k (.B 2) ++ ls), R) = + some (.hL, List.replicate k (.B 2) ++ ls, 1 :: 1 :: R) := rfl + refine iterOpt_trans h1 ?_ + rw [ih (1 :: 1 :: R), ← replicate_two_mul_append_two] + + +def stackAfterOnes (k : ℕ) (L : List SBlock) : List SBlock := + match k with + | 0 => .A 1 :: L + | k' + 1 => .B 1 :: (List.replicate k' (.B 2) ++ (.A 2 :: L)) + + +theorem scan_ones_h10B_any (k : ℕ) (L : List SBlock) (R : List ℕ) : + iterOpt step_sq (2 * k) (.h10B, .A 1 :: L, List.replicate (2 * k) 1 ++ R) = + some (.h10B, stackAfterOnes k L, R) := by + cases k with + | zero => rfl + | succ k' => exact scan_ones_h10B k' (.A 1 :: L) R + + +@[simp] theorem incTop_stackAfterOnes (k : ℕ) (L : List SBlock) : + incTop (stackAfterOnes k L) 1 = List.replicate k (.B 2) ++ (.A 2 :: L) := by + cases k <;> rfl + + +theorem pop_B2_A2_hL (k : ℕ) (L : List SBlock) (R : List ℕ) : + iterOpt step_sq (k + 1) (.hL, List.replicate k (.B 2) ++ (.A 2 :: L), R) = + some (.hL, L, 3 :: (List.replicate (2 * k) 1 ++ R)) := by + refine iterOpt_trans (pop_B2_run_hL k (.A 2 :: L) R) ?_ + rfl + + +theorem rep_B2_A2_ne_A2 (k : ℕ) (L : List SBlock) (h : k ≥ 1 ∨ L ≠ []) : + List.replicate k (.B 2) ++ (.A 2 :: L) ≠ [.A 2] := by + rcases k with _ | k + · simp only [List.replicate_zero, List.nil_append, ne_eq, List.cons.injEq, true_and] + rcases h with hk | hL + · omega + · exact hL + · rw [List.replicate_succ, List.cons_append] + intro hc; injection hc with h1 _; cases h1 + + +theorem pop_B1_B2_A2_hL (k : ℕ) (L : List SBlock) (R : List ℕ) : + iterOpt step_sq (k + 2) (.hL, .B 1 :: (List.replicate k (.B 2) ++ (.A 2 :: L)), R) = + some (.hL, L, 3 :: (List.replicate (2 * k + 1) 1 ++ (0 :: R))) := by + rw [show k + 2 = 1 + (k + 1) by omega] + have h1 : iterOpt step_sq 1 (.hL, .B 1 :: (List.replicate k (.B 2) ++ (.A 2 :: L)), R) = + some (.hL, List.replicate k (.B 2) ++ (.A 2 :: L), 1 :: 0 :: R) := rfl + refine iterOpt_trans h1 ?_ + rw [pop_B2_A2_hL k L (1 :: 0 :: R), replicate_append_cons_same] + + +theorem bounce_hL_suffix (S : List SBlock) (hS : S = [] ∨ S = [.A 0, .A 2]) (R : List ℕ) : + iterOpt step_sq 1 (.hL, S, R) = some (.h10B, [.A 1], R) := by + rcases hS with rfl | rfl <;> rfl + + +theorem double3_reduction (R : List ℕ) : + SqReachesPlus (3 :: 3 :: R) (1 :: 1 :: R) := + ⟨4, by decide, rfl⟩ + +-- ---------------------------------------------------------------------------- +-- Layer 3B: Loop Templates, Tail Reflections, Contraction Loops & Bridges +-- ---------------------------------------------------------------------------- + + +def CfgSqReachesPlus (c₁ c₂ : CfgSq) : Prop := + ∃ k > 0, iterOpt step_sq k c₁ = some c₂ + + +def CfgSqReachesStar (c₁ c₂ : CfgSq) : Prop := + ∃ k, iterOpt step_sq k c₁ = some c₂ + + +theorem cfgSqReachesStar_of_iterOpt {k : ℕ} {c₁ c₂ : CfgSq} + (h : iterOpt step_sq k c₁ = some c₂) : CfgSqReachesStar c₁ c₂ := + ⟨k, h⟩ + + +theorem cfgSqReachesPlus_of_iterOpt {k : ℕ} {c₁ c₂ : CfgSq} + (hk : k > 0) (h : iterOpt step_sq k c₁ = some c₂) : CfgSqReachesPlus c₁ c₂ := + ⟨k, hk, h⟩ + + +theorem cfgSqReachesPlus_trans {c₁ c₂ c₃ : CfgSq} + (h₁ : CfgSqReachesPlus c₁ c₂) (h₂ : CfgSqReachesPlus c₂ c₃) : + CfgSqReachesPlus c₁ c₃ := by + rcases h₁ with ⟨k₁, hk₁, hs₁⟩ + rcases h₂ with ⟨k₂, hk₂, hs₂⟩ + exact ⟨k₁ + k₂, by omega, iterOpt_trans hs₁ hs₂⟩ + + +theorem cfgSqReachesStar_plus_trans {c₁ c₂ c₃ : CfgSq} + (h₁ : CfgSqReachesStar c₁ c₂) (h₂ : CfgSqReachesPlus c₂ c₃) : + CfgSqReachesPlus c₁ c₃ := by + rcases h₁ with ⟨k₁, hs₁⟩ + rcases h₂ with ⟨k₂, hk₂, hs₂⟩ + exact ⟨k₁ + k₂, by omega, iterOpt_trans hs₁ hs₂⟩ + + +def TailWord (w z δ : ℕ) : List ℕ := + List.replicate w 1 ++ (3 :: (List.replicate z 1 ++ [δ, 1])) + + +def R_tail (w z δ : ℕ) : List ℕ := + 3 :: TailWord w z δ + + +def M_sq (v w z δ : ℕ) : List ℕ := + 3 :: (List.replicate v 1 ++ (2 :: 1 :: R_tail w z δ)) + + +def M2_sq (v w Z δ : ℕ) : List ℕ := + 3 :: (List.replicate v 1 ++ (2 :: R_tail w Z δ)) + + +def H_sq (v w0 z δ : ℕ) : List ℕ := + 3 :: (List.replicate v 1 ++ (0 :: R_tail w0 z δ)) + + +def F_sq (u v j w0 z δ : ℕ) : List ℕ := + 3 :: (List.replicate u 1 ++ (3 :: (List.replicate v 1 ++ (3 :: (List.replicate j 1 ++ (0 :: R_tail w0 z δ)))))) + + +def G_sq (v j w z δ : ℕ) : List ℕ := + 3 :: (List.replicate v 1 ++ (3 :: (List.replicate j 1 ++ (0 :: R_tail w z δ)))) + + +def psiTilde (w z : ℕ) : ℕ × ℕ := + if w % 2 = 0 then (w + 1, z) else (w - 1, z + 2) + + +def psiShift (w z : ℕ) : ℕ × ℕ := + if w % 2 = 0 then (w + 1, z + 2) else (w - 1, z + 4) + +-- ---------------------------------------------------------------------------- +-- Multi-Step Lift Lemmas (step_sq -> step_5mode -> step_blk -> target_tm) +-- ---------------------------------------------------------------------------- + +theorem iterOpt_step_blk_plus {j : ℕ} (hj : j > 0) {b₁ b₂ : BlkCfg} + (h : iterOpt step_blk j b₁ = some b₂) : + (decode_blk b₁) [target_tm]⊢⁺ (decode_blk b₂) := by + induction j generalizing b₁ with + | zero => omega + | succ j ih => + rcases hs : step_blk b₁ with _ | bm + · simp [hs] at h + · rcases j with _ | j' + · simp [hs] at h; subst h + exact step_blk_correct b₁ bm hs + · simp only [iterOpt_succ, hs, option_some_bind] at h + exact stepPlus_trans (step_blk_correct b₁ bm hs) (ih (by omega) h) + +theorem step_5mode_preserves_guard (c c' : Cfg5) + (hguard : c.1 ≠ .hL → c.2.1 ≠ []) + (h : step_5mode c = some c') : + c'.1 ≠ .hL → c'.2.1 ≠ [] := by + rcases c with ⟨m, ls, rs⟩ + cases m with + | hL => + rcases ls with _ | ⟨sb, lsp⟩ + · simp [step_5mode] at h; subst h; simp + · cases sb with + | A k => simp [step_5mode] at h; subst h; simp + | B k => + rcases k with _ | k <;> (simp [step_5mode] at h; subst h; simp) + | h10B => + have hls : ls ≠ [] := hguard (by intro hc; cases hc) + rcases rs with _ | ⟨r0, rsp⟩ + · simp [step_5mode] at h; subst h; simp + · rcases r0 with _ | _ | _ | _ | _ | a <;> + (simp [step_5mode] at h; subst h; intro _; first | exact hls | exact incTop_nonempty _ _ | simp) + | h100F => + rcases rs with _ | ⟨r0, rsp⟩ + · simp [step_5mode] at h; subst h; simp + · rcases r0 with _ | _ | _ | _ | a + · simp [step_5mode] at h + · simp [step_5mode] at h; subst h; simp + · simp [step_5mode] at h; subst h; simp + · simp [step_5mode] at h; subst h; simp + · simp [step_5mode] at h; subst h; simp + | h10F => + rcases rs with _ | ⟨r0, rsp⟩ + · simp [step_5mode] at h; subst h; simp + · rcases r0 with _ | _ | _ | _ | a + · simp [step_5mode] at h + · simp [step_5mode] at h; subst h; simp + · simp [step_5mode] at h; subst h; simp + · simp [step_5mode] at h; subst h; simp + · simp [step_5mode] at h; subst h; simp + | h1E => + rcases rs with _ | ⟨r0, rsp⟩ + · simp [step_5mode] at h; subst h; simp + · rcases r0 with _ | _ | a + · simp [step_5mode] at h; subst h; intro _; exact incTop_nonempty _ _ + · simp [step_5mode] at h; subst h; intro _; exact incTop_nonempty _ _ + · simp [step_5mode] at h; subst h; simp + +theorem iterOpt_step_5mode_lift {k : ℕ} (hk : k > 0) {c₁ c₂ : Cfg5} + (hguard : c₁.1 ≠ .hL → c₁.2.1 ≠ []) + (h : iterOpt step_5mode k c₁ = some c₂) : + (decode_blk (Phi c₁)) [target_tm]⊢⁺ (decode_blk (Phi c₂)) := by + induction k generalizing c₁ with + | zero => omega + | succ k ih => + rcases hs : step_5mode c₁ with _ | cm + · simp [hs] at h + · obtain ⟨j, hj, hblk⟩ := step_5mode_correct c₁ cm hguard hs + have hp1 := iterOpt_step_blk_plus hj hblk + rcases k with _ | k' + · simp [hs] at h; subst h; exact hp1 + · simp only [iterOpt_succ, hs, option_some_bind] at h + have hg' := step_5mode_preserves_guard c₁ cm hguard hs + exact stepPlus_trans hp1 (ih (by omega) hg' h) + +theorem iterOpt_step_sq_lift {k : ℕ} (hk : k > 0) (n : ℕ) {c₁ c₂ : CfgSq} + (hguard : c₁.1 ≠ .hL → c₁.2.1 ≠ []) + (h : iterOpt step_sq k c₁ = some c₂) : + ∃ n', (decode_sq n c₁) [target_tm]⊢⁺ (decode_sq n' c₂) := by + induction k generalizing n c₁ with + | zero => omega + | succ k ih => + rcases hs : step_sq c₁ with _ | cm + · simp [hs] at h + · obtain ⟨n_mid, j, hj, h5⟩ := step_sq_lift n c₁ cm hguard hs + have hp1 : (decode_sq n c₁) [target_tm]⊢⁺ (decode_sq n_mid cm) := + iterOpt_step_5mode_lift hj (psi_sq_guard n c₁) h5 + rcases k with _ | k' + · simp [hs] at h; subst h; exact ⟨n_mid, hp1⟩ + · simp only [iterOpt_succ, hs, option_some_bind] at h + have hg' := step_sq_preserves_guard c₁ cm hguard hs + obtain ⟨n', hp2⟩ := ih (by omega) n_mid hg' h + exact ⟨n', stepPlus_trans hp1 hp2⟩ + +theorem sqReachesPlus_to_tm {R₁ R₂ : List ℕ} (h : SqReachesPlus R₁ R₂) (n : ℕ) : + ∃ n', (decode_sq n (.h10B, [.A 1], R₁)) [target_tm]⊢⁺ (decode_sq n' (.h10B, [.A 1], R₂)) := by + rcases h with ⟨k, hk, hiter⟩ + exact iterOpt_step_sq_lift hk n (by simp) hiter + +def c50_sq : CfgSq := (.hL, [.B 2, .A 2, .A 0, .A 2], [1, 4, 1]) +def c100_sq : CfgSq := (.hL, [.B 0, .A 2, .A 0, .A 2], [1, 1, 4, 1]) +def c150_sq : CfgSq := (.hL, [.A 2, .A 2, .A 0, .A 2], [1, 0, 1, 0, 3, 4, 1]) +def c200_sq : CfgSq := (.h10B, [.A 1, .A 1, .B 2, .A 2, .A 0, .A 2], [1, 1, 2, 1]) +def c250_sq : CfgSq := (.h10B, [.A 1, .A 2, .A 0, .B 3, .A 2], [1, 1, 0, 1]) +def c300_sq : CfgSq := (.hL, [.A 0, .B 1, .B 2, .B 2, .A 2, .A 2, .A 1, .A 2, .A 0, .A 2], []) + +theorem init_reaches_c319 : + ∃ n₀, (init []) [target_tm]⊢* (decode_sq n₀ c319_sq) := by + have h1 : (init []) [target_tm]⊢* (decode_blk (.h11D, [.L10, .L1], [])) := + ReachesIn.to_star init_reaches_blk0 + have h2_iter : iterOpt step_blk 35 (.h11D, [.L10, .L1], []) = some (Phi (Psi_sq 0 c0_sq)) := rfl + have h2 : (decode_blk (.h11D, [.L10, .L1], [])) [target_tm]⊢⁺ (decode_sq 0 c0_sq) := + iterOpt_step_blk_plus (by decide) h2_iter + have s1 : iterOpt step_sq 50 c0_sq = some c50_sq := rfl + have s2 : iterOpt step_sq 50 c50_sq = some c100_sq := rfl + have s3 : iterOpt step_sq 50 c100_sq = some c150_sq := rfl + have s4 : iterOpt step_sq 50 c150_sq = some c200_sq := rfl + have s5 : iterOpt step_sq 50 c200_sq = some c250_sq := rfl + have s6 : iterOpt step_sq 50 c250_sq = some c300_sq := rfl + have s7 : iterOpt step_sq 19 c300_sq = some c319_sq := rfl + have h3_iter : iterOpt step_sq 319 c0_sq = some c319_sq := + iterOpt_trans s1 (iterOpt_trans s2 (iterOpt_trans s3 + (iterOpt_trans s4 (iterOpt_trans s5 (iterOpt_trans s6 s7))))) + obtain ⟨n₀, h3⟩ := iterOpt_step_sq_lift (by decide) 0 (by intro hc; exact absurd rfl hc) h3_iter + exact ⟨n₀, stepStar_trans h1 (stepStar_trans (stepPlus_stepStar h2) (stepPlus_stepStar h3))⟩ + +theorem psiTilde_psiTilde (w z : ℕ) : + psiTilde (psiTilde w z).1 (psiTilde w z).2 = (w, z + 2) := by + rcases Nat.mod_two_eq_zero_or_one w with hw | hw + · have h1 : psiTilde w z = (w + 1, z) := by simp [psiTilde, hw] + rw [h1]; simp [psiTilde, show (w + 1) % 2 = 1 by omega] + · have h1 : psiTilde w z = (w - 1, z + 2) := by simp [psiTilde, hw] + rw [h1]; simp [psiTilde, show (w - 1) % 2 = 0 by omega]; omega + + +theorem psiTilde_snd_odd (w z : ℕ) (hz : z % 2 = 1) : + (psiTilde w z).2 % 2 = 1 := by + try dsimp [psiTilde] + split_ifs <;> omega + + +theorem psiTilde_add_two (w z : ℕ) : + psiTilde w (z + 2) = psiShift w z := rfl + + +theorem psiShift_eq_psiTilde_step (w z : ℕ) : + psiShift w z = ((psiTilde w z).1, (psiTilde w z).2 + 2) := by + try dsimp [psiTilde, psiShift] + split_ifs <;> rfl + + +theorem replicate_succ_append {α : Type*} (k : ℕ) (x : α) (R : List α) : + List.replicate (k + 1) x ++ R = List.replicate k x ++ (x :: R) := by + rw [← replicate_append_cons_same] + + +def stackP1 (u : ℕ) (L : List SBlock) : List SBlock := + List.replicate u (.B 2) ++ (.A 2 :: .A 0 :: .A 2 :: L) + + +theorem prefix_P1_scan (u : ℕ) (L : List SBlock) (R : List ℕ) : + CfgSqReachesPlus + (.h10B, .A 1 :: L, 3 :: (List.replicate (2 * (u + 1)) 1 ++ (3 :: R))) + (.h10B, .A 1 :: stackP1 u L, 1 :: R) := by + have h1 : CfgSqReachesPlus + (.h10B, .A 1 :: L, 3 :: (List.replicate (2 * (u + 1)) 1 ++ (3 :: R))) + (.h1E, .A 0 :: .A 0 :: .A 2 :: L, List.replicate (2 * (u + 1)) 1 ++ (3 :: R)) := + ⟨1, by decide, rfl⟩ + have h2 := cfgSqReachesPlus_of_iterOpt (by omega) + (scan_ones_h1E u (.A 0 :: .A 0 :: .A 2 :: L) (3 :: R)) + have h3 : CfgSqReachesPlus + (.h1E, .B 0 :: (List.replicate u (.B 2) ++ (.A 2 :: .A 0 :: .A 2 :: L)), 3 :: R) + (.h10B, .A 1 :: stackP1 u L, 1 :: R) := + ⟨2, by decide, rfl⟩ + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3 + + +theorem prefix_P1_pop (u : ℕ) (L : List SBlock) (R' : List ℕ) : + CfgSqReachesPlus + (.hL, stackP1 u L, R') + (.hL, .A 0 :: .A 2 :: L, 3 :: (List.replicate (2 * u) 1 ++ R')) := + cfgSqReachesPlus_of_iterOpt (by omega) (pop_B2_A2_hL u (.A 0 :: .A 2 :: L) R') + + +def stackP2 (m : ℕ) (L : List SBlock) : List SBlock := + List.replicate m (.B 2) ++ (.A 2 :: L) + + +theorem prefix_P2_scan (m : ℕ) (L : List SBlock) (R : List ℕ) : + CfgSqReachesPlus + (.h10B, .A 1 :: L, 1 :: (List.replicate (2 * m) 1 ++ (3 :: R))) + (.h10B, .A 1 :: stackP2 m L, 1 :: R) := by + rw [← List.cons_append, ← List.replicate_succ, replicate_succ_append] + have h1 := cfgSqReachesStar_of_iterOpt + (scan_ones_h10B_any m L (1 :: 3 :: R)) + have h2 : CfgSqReachesPlus + (.h10B, stackAfterOnes m L, 1 :: 3 :: R) + (.h10B, .A 1 :: stackP2 m L, 1 :: R) := + ⟨3, by decide, by simp [iterOpt, step_sq, stackP2]⟩ + exact cfgSqReachesStar_plus_trans h1 h2 + + +theorem prefix_P2_pop (m : ℕ) (L : List SBlock) (R' : List ℕ) : + CfgSqReachesPlus + (.hL, stackP2 m L, R') + (.hL, L, 3 :: (List.replicate (2 * m) 1 ++ R')) := + cfgSqReachesPlus_of_iterOpt (by omega) (pop_B2_A2_hL m L R') + + +def stackP3 (m : ℕ) (S : List SBlock) : List SBlock := + .A 0 :: (List.replicate m (.B 2) ++ (.A 2 :: S)) + + +theorem prefix_P3_scan_from_S (m : ℕ) (S : List SBlock) (R : List ℕ) : + CfgSqReachesPlus + (.h10B, .A 1 :: S, List.replicate (2 * m) 1 ++ (3 :: 1 :: R)) + (.h10B, .A 1 :: stackP3 m S, R) := by + have h1 := cfgSqReachesStar_of_iterOpt (scan_ones_h10B_any m S (3 :: 1 :: R)) + have h2 : CfgSqReachesPlus + (.h10B, stackAfterOnes m S, 3 :: 1 :: R) + (.h10B, .A 1 :: stackP3 m S, R) := + ⟨2, by decide, by simp [iterOpt, step_sq, stackP3]⟩ + exact cfgSqReachesStar_plus_trans h1 h2 + + +theorem prefix_P3_scan (m : ℕ) (R : List ℕ) : + CfgSqReachesPlus + (.h10B, [.A 1], 3 :: (List.replicate (2 * m + 1) 1 ++ (3 :: 1 :: R))) + (.h10B, .A 1 :: stackP3 m [.A 0, .A 2], R) := by + rw [List.replicate_succ, List.cons_append] + have h0 : CfgSqReachesPlus + (.h10B, [.A 1], 3 :: 1 :: (List.replicate (2 * m) 1 ++ (3 :: 1 :: R))) + (.h10B, .A 1 :: [.A 0, .A 2], List.replicate (2 * m) 1 ++ (3 :: 1 :: R)) := + ⟨2, by decide, rfl⟩ + exact cfgSqReachesPlus_trans h0 (prefix_P3_scan_from_S m [.A 0, .A 2] R) + + +theorem cons_replicate_append {α : Type*} (k : ℕ) (x : α) (R : List α) : + x :: (List.replicate k x ++ R) = List.replicate (k + 1) x ++ R := by + rw [List.replicate_succ, List.cons_append] + + +theorem cons_replicate_odd_append {α : Type*} (j : ℕ) (x : α) (R : List α) : + x :: (List.replicate (2 * j + 1) x ++ R) = List.replicate (2 * (j + 1)) x ++ R := + cons_replicate_append (2 * j + 1) x R + + +theorem prefix_M2_scan (u : ℕ) (L : List SBlock) (R : List ℕ) : + CfgSqReachesPlus + (.h10B, .A 1 :: L, 3 :: (List.replicate (2 * (u + 1)) 1 ++ (2 :: R))) + (.h10B, .A 1 :: stackP1 u L, 0 :: R) := by + have h1 : CfgSqReachesPlus + (.h10B, .A 1 :: L, 3 :: (List.replicate (2 * (u + 1)) 1 ++ (2 :: R))) + (.h1E, .A 0 :: .A 0 :: .A 2 :: L, List.replicate (2 * (u + 1)) 1 ++ (2 :: R)) := + ⟨1, by decide, rfl⟩ + have h2 := cfgSqReachesPlus_of_iterOpt (by omega) + (scan_ones_h1E u (.A 0 :: .A 0 :: .A 2 :: L) (2 :: R)) + have h3 : CfgSqReachesPlus + (.h1E, .B 0 :: (List.replicate u (.B 2) ++ (.A 2 :: .A 0 :: .A 2 :: L)), 2 :: R) + (.h10B, .A 1 :: stackP1 u L, 0 :: R) := + ⟨2, by decide, rfl⟩ + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3 + + +def enc_odd (a b c d : ℕ) : List ℕ := + 3 :: (List.replicate a 1 ++ (0 :: TailWord b c d)) + + +def enc_even (a b c d : ℕ) : List ℕ := + List.replicate (a - 1) 1 ++ (0 :: 1 :: R_tail b c d) + + +def R_mid (c d : ℕ) : List ℕ := + if d = 0 then 3 :: (List.replicate c 1 ++ [3, 1]) + else R_tail (c - 1) 1 0 + + +theorem pass1_turnaround_d0 (r : ℕ) (L : List SBlock) : + CfgSqReachesPlus + (.h10B, .A 1 :: L, List.replicate (2 * r + 1) 1 ++ [0, 1]) + (.hL, L, 3 :: (List.replicate (2 * r + 1) 1 ++ [3, 1])) := by + rw [replicate_succ_append (2 * r)] + have h1 := cfgSqReachesStar_of_iterOpt (scan_ones_h10B_any r L [1, 0, 1]) + have h2 : CfgSqReachesPlus + (.h10B, stackAfterOnes r L, [1, 0, 1]) + (.hL, List.replicate r (.B 2) ++ (.A 2 :: L), [1, 3, 1]) := + ⟨6, by decide, by simp [iterOpt, step_sq]⟩ + have h3 := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B2_A2_hL r L [1, 3, 1]) + rw [replicate_append_cons_same (2 * r)] at h3 + exact cfgSqReachesPlus_trans (cfgSqReachesStar_plus_trans h1 h2) h3 + + +theorem pass1_turnaround_d2 (r : ℕ) (L : List SBlock) : + CfgSqReachesPlus + (.h10B, .A 1 :: L, List.replicate (2 * r + 1) 1 ++ [2, 1]) + (.hL, L, R_tail (2 * r) 1 0) := by + rw [replicate_succ_append (2 * r)] + have h1 := cfgSqReachesStar_of_iterOpt (scan_ones_h10B_any r L [1, 2, 1]) + have h2 : CfgSqReachesPlus + (.h10B, stackAfterOnes r L, [1, 2, 1]) + (.hL, List.replicate r (.B 2) ++ (.A 2 :: L), [3, 1, 0, 1]) := + ⟨9, by decide, by simp [iterOpt, step_sq]⟩ + have h3 := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B2_A2_hL r L [3, 1, 0, 1]) + exact cfgSqReachesPlus_trans (cfgSqReachesStar_plus_trans h1 h2) h3 + + +theorem pass1_turnaround (r d : ℕ) (hd : d = 0 ∨ d = 2) (L : List SBlock) : + CfgSqReachesPlus + (.h10B, .A 1 :: L, List.replicate (2 * r + 1) 1 ++ [d, 1]) + (.hL, L, R_mid (2 * r + 1) d) := by + rcases hd with rfl | rfl + · simpa [R_mid] using pass1_turnaround_d0 r L + · simpa [R_mid] using pass1_turnaround_d2 r L + + +theorem pass2_turnaround (r : ℕ) (L : List SBlock) : + CfgSqReachesPlus + (.h10B, .A 1 :: L, List.replicate (2 * r + 1) 1 ++ [3, 1]) + (.hL, L, R_tail (2 * r) 1 2) := by + rw [replicate_succ_append (2 * r)] + have h1 := cfgSqReachesStar_of_iterOpt (scan_ones_h10B_any r L [1, 3, 1]) + have h2 : CfgSqReachesPlus + (.h10B, stackAfterOnes r L, [1, 3, 1]) + (.hL, List.replicate r (.B 2) ++ (.A 2 :: L), [3, 1, 2, 1]) := + ⟨9, by decide, by simp [iterOpt, step_sq]⟩ + have h3 := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B2_A2_hL r L [3, 1, 2, 1]) + exact cfgSqReachesPlus_trans (cfgSqReachesStar_plus_trans h1 h2) h3 + + +theorem prefix_P2_scan_2 (m : ℕ) (L : List SBlock) (R : List ℕ) : + CfgSqReachesPlus + (.h10B, .A 1 :: L, 1 :: (List.replicate (2 * m) 1 ++ (2 :: R))) + (.h10B, .A 1 :: stackP2 m L, 0 :: R) := by + rw [← List.cons_append, ← List.replicate_succ, replicate_succ_append] + have h1 := cfgSqReachesStar_of_iterOpt + (scan_ones_h10B_any m L (1 :: 2 :: R)) + have h2 : CfgSqReachesPlus + (.h10B, stackAfterOnes m L, 1 :: 2 :: R) + (.h10B, .A 1 :: stackP2 m L, 0 :: R) := + ⟨3, by decide, by simp [iterOpt, step_sq, stackP2]⟩ + exact cfgSqReachesStar_plus_trans h1 h2 + + +theorem psiShift_psiTilde_add (w z k : ℕ) : + psiShift (psiTilde w z).1 ((psiTilde w z).2 + 2 * k) = (w, z + 2 * k + 4) := by + rcases Nat.mod_two_eq_zero_or_one w with hw | hw + · have h1 : psiTilde w z = (w + 1, z) := by simp [psiTilde, hw] + rw [h1]; dsimp [psiShift]; rw [if_neg (by omega)] + · have h1 : psiTilde w z = (w - 1, z + 2) := by simp [psiTilde, hw] + rw [h1]; dsimp [psiShift]; rw [if_pos (by omega)]; exact Prod.ext (by omega) (by omega) + + +theorem exit_3_2 (R : List ℕ) : + SqReachesPlus (3 :: 2 :: R) (1 :: 0 :: R) := + ⟨4, by decide, rfl⟩ + + +theorem exit_odd_0_3 (r : ℕ) (R : List ℕ) : + SqReachesPlus + (List.replicate (2 * r + 1) 1 ++ (0 :: 3 :: R)) + (3 :: (List.replicate (2 * r + 1) 1 ++ (0 :: 1 :: R))) := by + rw [replicate_succ_append (2 * r)] + have h1 := cfgSqReachesStar_of_iterOpt (scan_ones_h10B_any r [] (1 :: 0 :: 3 :: R)) + have h2 : CfgSqReachesPlus + (.h10B, stackAfterOnes r [], 1 :: 0 :: 3 :: R) + (.hL, .B 1 :: (List.replicate r (.B 2) ++ [.A 2]), 1 :: R) := + ⟨3, by decide, by simp [iterOpt, step_sq]⟩ + have h3 := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B1_B2_A2_hL r [] (1 :: R)) + have h4 := cfgSqReachesPlus_of_iterOpt (by decide) + (bounce_hL_suffix [] (Or.inl rfl) + (3 :: (List.replicate (2 * r + 1) 1 ++ (0 :: 1 :: R)))) + exact cfgSqReachesPlus_trans + (cfgSqReachesPlus_trans (cfgSqReachesStar_plus_trans h1 h2) h3) h4 + + +def splitTwoAux : ℕ → ℕ → ℕ × ℕ + | 0, m => (0, m) + | fuel + 1, m => + if m % 2 = 0 then + let p := splitTwoAux fuel (m / 2) + (p.1 + 1, p.2) + else (0, m) + + +def splitTwo (m : ℕ) : ℕ × ℕ := splitTwoAux m m + + +theorem splitTwoAux_eq (f1 f2 m : ℕ) (hm : m ≥ 1) (hf1 : m ≤ f1) (hf2 : m ≤ f2) : + splitTwoAux f1 m = splitTwoAux f2 m := by + induction f1 generalizing f2 m with + | zero => omega + | succ f1 ih => + rcases f2 with _ | f2 + · omega + · dsimp [splitTwoAux] + split_ifs with h0 + · rw [ih f2 (m / 2) (by omega) (by omega) (by omega)] + · rfl + + +theorem splitTwo_odd (m : ℕ) (hm : m % 2 = 1) : splitTwo m = (0, m) := by + rcases m with _ | m + · omega + · dsimp [splitTwo, splitTwoAux] + rw [if_neg (by omega)] + + +theorem splitTwo_two_mul (m : ℕ) (hm : m ≥ 1) : + splitTwo (2 * m) = ((splitTwo m).1 + 1, (splitTwo m).2) := by + have h2m : 2 * m = (2 * m - 1) + 1 := by omega + unfold splitTwo + rw [h2m] + try dsimp [splitTwoAux] + rw [if_pos (by omega), show (2 * m - 1 + 1) / 2 = m by omega] + rw [splitTwoAux_eq (2 * m - 1) m m hm (by omega) (le_refl m)] + + +theorem mul_pos_of_pos_of_odd {x a : ℕ} (hx : x ≥ 1) (ha : a % 2 = 1) : x * a ≥ 1 := by + have ha1 : a ≥ 1 := by omega + calc x * a ≥ 1 * 1 := Nat.mul_le_mul hx ha1 + _ = 1 := rfl + + +theorem splitTwo_pow_mul_odd (ν a : ℕ) (ha : a % 2 = 1) : + splitTwo (2 ^ ν * a) = (ν, a) := by + induction ν with + | zero => simp [splitTwo_odd a ha] + | succ ν ih => + have hpos : 2 ^ ν * a ≥ 1 := mul_pos_of_pos_of_odd Nat.one_le_two_pow ha + rw [Nat.pow_succ', Nat.mul_assoc, splitTwo_two_mul _ hpos, ih] + +-- ---------------------------------------------------------------------------- +-- Stage 4A: Even-Run Turnarounds, Tail Reflection & Separators +-- ---------------------------------------------------------------------------- + +theorem turnaround_even_ones_d0 (r : ℕ) (L' : List SBlock) : + CfgSqReachesPlus + (.h10B, .A 1 :: L', List.replicate (2 * r) 1 ++ [0, 1]) + (.hL, L', 3 :: (List.replicate (2 * r + 1) 1 ++ [0, 1])) := by + have h1 := cfgSqReachesStar_of_iterOpt (scan_ones_h10B_any r L' [0, 1]) + have h2 : CfgSqReachesPlus + (.h10B, stackAfterOnes r L', [0, 1]) + (.hL, .B 1 :: (List.replicate r (.B 2) ++ (.A 2 :: L')), [1]) := + ⟨4, by decide, by simp [iterOpt, step_sq]⟩ + have h3 := cfgSqReachesPlus_of_iterOpt (by omega) (pop_B1_B2_A2_hL r L' [1]) + exact cfgSqReachesPlus_trans (cfgSqReachesStar_plus_trans h1 h2) h3 + +theorem turnaround_even_ones_d2 (r : ℕ) (L' : List SBlock) (hL' : L' ≠ []) : + CfgSqReachesPlus + (.h10B, .A 1 :: L', List.replicate (2 * r) 1 ++ [2, 1]) + (.hL, L', 3 :: (List.replicate (2 * r + 1) 1 ++ [2, 1])) := by + have h1 := cfgSqReachesStar_of_iterOpt (scan_ones_h10B_any r L' [2, 1]) + have h2 : CfgSqReachesPlus + (.h10B, stackAfterOnes r L', [2, 1]) + (.hL, .A 0 :: (List.replicate r (.B 2) ++ (.A 2 :: L')), [2, 1]) := + ⟨5, by decide, by simp [iterOpt, step_sq]⟩ + have hne := rep_B2_A2_ne_A2 r L' (Or.inr hL') + have h3 : CfgSqReachesPlus + (.hL, .A 0 :: (List.replicate r (.B 2) ++ (.A 2 :: L')), [2, 1]) + (.hL, List.replicate r (.B 2) ++ (.A 2 :: L'), [1, 2, 1]) := + ⟨1, by decide, by simp [iterOpt, step_sq_hL_A0 _ hne]⟩ + have h4 := cfgSqReachesPlus_of_iterOpt (by omega) (pop_B2_A2_hL r L' [1, 2, 1]) + rw [replicate_append_cons_same (2 * r)] at h4 + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesStar_plus_trans h1 h2) h3) h4 + +theorem turnaround_even_ones (r d : ℕ) (hd : d = 0 ∨ d = 2) (L' : List SBlock) (hL' : L' ≠ []) : + CfgSqReachesPlus + (.h10B, .A 1 :: L', List.replicate (2 * r) 1 ++ [d, 1]) + (.hL, L', 3 :: (List.replicate (2 * r + 1) 1 ++ [d, 1])) := by + rcases hd with rfl | rfl + · exact turnaround_even_ones_d0 r L' + · exact turnaround_even_ones_d2 r L' hL' + +theorem tail_reflect (w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) + (L : List SBlock) (hL : L ≠ []) : + CfgSqReachesPlus + (.h10B, .A 1 :: L, TailWord w z d) + (.hL, L, R_tail (psiTilde w z).1 (psiTilde w z).2 d) := by + have hz_eq : z = 2 * (z / 2) + 1 := by omega + set s := z / 2 + rcases Nat.mod_two_eq_zero_or_one w with hw | hw + · have hw_eq : w = 2 * (w / 2) := by omega + set k := w / 2 + have hpsi : psiTilde w z = (2 * k + 1, 2 * s + 1) := by + ext <;> dsimp only [psiTilde] <;> split_ifs <;> omega + rw [hpsi] + have htw : TailWord w z d = List.replicate (2 * k) 1 ++ (3 :: 1 :: (List.replicate (2 * s) 1 ++ [d, 1])) := by + simp [TailWord, hw_eq, hz_eq, List.replicate_succ, List.cons_append] + rw [htw] + have h1 := prefix_P3_scan_from_S k L (List.replicate (2 * s) 1 ++ [d, 1]) + have h2 := turnaround_even_ones s d hd (stackP3 k L) (by simp [stackP3]) + have hne := rep_B2_A2_ne_A2 k L (Or.inr hL) + have h3 : CfgSqReachesPlus + (.hL, stackP3 k L, 3 :: (List.replicate (2 * s + 1) 1 ++ [d, 1])) + (.hL, List.replicate k (.B 2) ++ (.A 2 :: L), 1 :: 3 :: (List.replicate (2 * s + 1) 1 ++ [d, 1])) := + ⟨1, by decide, by simp [stackP3, iterOpt, step_sq_hL_A0 _ hne]⟩ + have h4 := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B2_A2_hL k L (1 :: 3 :: (List.replicate (2 * s + 1) 1 ++ [d, 1]))) + rw [replicate_append_cons_same (2 * k)] at h4 + simpa [R_tail, TailWord] using + cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3) h4 + · have hw_eq : w = 2 * (w / 2) + 1 := by omega + set k := w / 2 + have hpsi : psiTilde w z = (2 * k, 2 * (s + 1) + 1) := by + ext <;> dsimp only [psiTilde] <;> split_ifs <;> omega + rw [hpsi] + have htw : TailWord w z d = 1 :: (List.replicate (2 * k) 1 ++ (3 :: (List.replicate (2 * s + 1) 1 ++ [d, 1]))) := by + rw [TailWord, hw_eq, hz_eq, Nat.add_comm (2 * k) 1, List.replicate_add] + rfl + rw [htw] + have h1 := prefix_P2_scan k L (List.replicate (2 * s + 1) 1 ++ [d, 1]) + rw [cons_replicate_odd_append s 1 [d, 1]] at h1 + have h2 := turnaround_even_ones (s + 1) d hd (stackP2 k L) (by cases k <;> simp [stackP2]) + have h3 := prefix_P2_pop k L (3 :: (List.replicate (2 * (s + 1) + 1) 1 ++ [d, 1])) + simpa [R_tail, TailWord] using cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3 + +theorem sep_0 (w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) (L : List SBlock) : + CfgSqReachesPlus + (.h10B, .A 1 :: L, 0 :: R_tail w z d) + (.hL, L, 2 :: 1 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d) := by + have h1 : CfgSqReachesPlus + (.h10B, .A 1 :: L, 0 :: 3 :: TailWord w z d) + (.h10B, .A 1 :: .A 0 :: .A 1 :: L, TailWord w z d) := + ⟨2, by decide, rfl⟩ + have h2 := tail_reflect w z d hz hd (.A 0 :: .A 1 :: L) (by simp) + have h3 : CfgSqReachesPlus + (.hL, .A 0 :: .A 1 :: L, R_tail (psiTilde w z).1 (psiTilde w z).2 d) + (.hL, L, 2 :: 1 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d) := + ⟨2, by decide, rfl⟩ + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3 + +theorem sep_even_0 (k : ℕ) (L : List SBlock) (w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + CfgSqReachesPlus + (.h10B, .A 1 :: L, List.replicate (2 * (k + 1)) 1 ++ (0 :: R_tail w z d)) + (.hL, L, 3 :: (List.replicate (2 * k + 1) 1 ++ (0 :: 1 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d))) := by + have h1 := cfgSqReachesStar_of_iterOpt (scan_ones_h10B_any (k + 1) L (0 :: 3 :: TailWord w z d)) + have h2 : CfgSqReachesPlus + (.h10B, stackAfterOnes (k + 1) L, 0 :: 3 :: TailWord w z d) + (.h10B, .A 1 :: .A 0 :: .B 1 :: (List.replicate k (.B 2) ++ (.A 2 :: L)), TailWord w z d) := + ⟨2, by decide, rfl⟩ + have h3 := tail_reflect w z d hz hd (.A 0 :: .B 1 :: (List.replicate k (.B 2) ++ (.A 2 :: L))) (by simp) + have h4 : CfgSqReachesPlus + (.hL, .A 0 :: .B 1 :: (List.replicate k (.B 2) ++ (.A 2 :: L)), R_tail (psiTilde w z).1 (psiTilde w z).2 d) + (.hL, .B 1 :: (List.replicate k (.B 2) ++ (.A 2 :: L)), 1 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d) := + ⟨1, by decide, rfl⟩ + have h5 := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B1_B2_A2_hL k L (1 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d)) + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesStar_plus_trans h1 h2) h3) h4) h5 + +theorem sep_even_01 (k : ℕ) (L : List SBlock) (w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + CfgSqReachesPlus + (.h10B, .A 1 :: L, List.replicate (2 * k) 1 ++ (0 :: 1 :: R_tail w z d)) + (.hL, L, 3 :: (List.replicate (2 * k + 1) 1 ++ (0 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d))) := by + have h1 := cfgSqReachesStar_of_iterOpt (scan_ones_h10B_any k L (0 :: 1 :: 3 :: TailWord w z d)) + have h2 : CfgSqReachesPlus + (.h10B, stackAfterOnes k L, 0 :: 1 :: 3 :: TailWord w z d) + (.h10B, .A 1 :: .B 1 :: (List.replicate k (.B 2) ++ (.A 2 :: L)), TailWord w z d) := + ⟨3, by decide, by simp [iterOpt, step_sq]⟩ + have h3 := tail_reflect w z d hz hd (.B 1 :: (List.replicate k (.B 2) ++ (.A 2 :: L))) (by simp) + have h4 := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B1_B2_A2_hL k L (R_tail (psiTilde w z).1 (psiTilde w z).2 d)) + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesStar_plus_trans h1 h2) h3) h4 + +theorem sep_even_2 (k : ℕ) (L : List SBlock) (w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + CfgSqReachesPlus + (.h10B, .A 1 :: L, List.replicate (2 * k) 1 ++ (2 :: R_tail w z d)) + (.hL, L, 3 :: (List.replicate (2 * k) 1 ++ (2 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d))) := by + have h1 := cfgSqReachesStar_of_iterOpt (scan_ones_h10B_any k L (2 :: 3 :: TailWord w z d)) + have h2 : CfgSqReachesPlus + (.h10B, stackAfterOnes k L, 2 :: 3 :: TailWord w z d) + (.h10B, .A 1 :: .A 1 :: (List.replicate k (.B 2) ++ (.A 2 :: L)), TailWord w z d) := + ⟨2, by decide, by simp [iterOpt, step_sq]⟩ + have h3 := tail_reflect w z d hz hd (.A 1 :: (List.replicate k (.B 2) ++ (.A 2 :: L))) (by simp) + have h4 : CfgSqReachesPlus + (.hL, .A 1 :: (List.replicate k (.B 2) ++ (.A 2 :: L)), R_tail (psiTilde w z).1 (psiTilde w z).2 d) + (.hL, List.replicate k (.B 2) ++ (.A 2 :: L), 2 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d) := + ⟨1, by decide, rfl⟩ + have h5 := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B2_A2_hL k L (2 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d)) + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesStar_plus_trans h1 h2) h3) h4) h5 + +theorem sep_even_21 (k : ℕ) (L : List SBlock) (hkL : k ≥ 1 ∨ L ≠ []) + (w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + CfgSqReachesPlus + (.h10B, .A 1 :: L, List.replicate (2 * k) 1 ++ (2 :: 1 :: R_tail w z d)) + (.hL, L, 3 :: (List.replicate (2 * k + 1) 1 ++ (2 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d))) := by + have h1 := cfgSqReachesStar_of_iterOpt (scan_ones_h10B_any k L (2 :: 1 :: 3 :: TailWord w z d)) + have h2 : CfgSqReachesPlus + (.h10B, stackAfterOnes k L, 2 :: 1 :: 3 :: TailWord w z d) + (.h10B, .A 1 :: .A 1 :: .A 0 :: (List.replicate k (.B 2) ++ (.A 2 :: L)), TailWord w z d) := + ⟨3, by decide, by simp [iterOpt, step_sq]⟩ + have h3 := tail_reflect w z d hz hd (.A 1 :: .A 0 :: (List.replicate k (.B 2) ++ (.A 2 :: L))) (by simp) + have hne := rep_B2_A2_ne_A2 k L hkL + have h4 : CfgSqReachesPlus + (.hL, .A 1 :: .A 0 :: (List.replicate k (.B 2) ++ (.A 2 :: L)), R_tail (psiTilde w z).1 (psiTilde w z).2 d) + (.hL, List.replicate k (.B 2) ++ (.A 2 :: L), 1 :: 2 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d) := by + refine ⟨2, by decide, ?_⟩ + dsimp only [iterOpt] + have hs1 : step_sq (.hL, .A 1 :: .A 0 :: (List.replicate k (.B 2) ++ (.A 2 :: L)), + R_tail (psiTilde w z).1 (psiTilde w z).2 d) = + some (.hL, .A 0 :: (List.replicate k (.B 2) ++ (.A 2 :: L)), + 2 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d) := rfl + rw [hs1]; dsimp + rw [step_sq_hL_A0 _ hne]; rfl + have h5 := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B2_A2_hL k L (1 :: 2 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d)) + rw [replicate_append_cons_same (2 * k)] at h5 + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesStar_plus_trans h1 h2) h3) h4) h5 + +theorem sep_21_nil (w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus (2 :: 1 :: R_tail w z d) (2 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d) := by + have h1 : CfgSqReachesPlus + (.h10B, [.A 1], 2 :: 1 :: 3 :: TailWord w z d) + (.h10B, [.A 1, .A 1, .A 0, .A 2], TailWord w z d) := + ⟨3, by decide, rfl⟩ + have h2 := tail_reflect w z d hz hd [.A 1, .A 0, .A 2] (by simp) + have h3 : CfgSqReachesPlus + (.hL, [.A 1, .A 0, .A 2], R_tail (psiTilde w z).1 (psiTilde w z).2 d) + (.h10B, [.A 1], 2 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d) := + ⟨2, by decide, rfl⟩ + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3 + +-- ---------------------------------------------------------------------------- +-- Stage 4B: Contraction Loops, Bridges, Phase 1, Phase 2 & Even Cascade +-- ---------------------------------------------------------------------------- + +theorem bounce_from_A0A2 {R₁ R₂ : List ℕ} + (h : CfgSqReachesPlus (.h10B, [.A 1], R₁) (.hL, [.A 0, .A 2], R₂)) : + SqReachesPlus R₁ R₂ := + cfgSqReachesPlus_trans h (cfgSqReachesPlus_of_iterOpt (by decide) (bounce_hL_suffix [.A 0, .A 2] (Or.inr rfl) R₂)) + +theorem bounce_from_nil {R₁ R₂ : List ℕ} + (h : CfgSqReachesPlus (.h10B, [.A 1], R₁) (.hL, [], R₂)) : + SqReachesPlus R₁ R₂ := + cfgSqReachesPlus_trans h (cfgSqReachesPlus_of_iterOpt (by decide) (bounce_hL_suffix [] (Or.inl rfl) R₂)) + +theorem prefix_odd_3 (m : ℕ) (R : List ℕ) : + CfgSqReachesPlus + (.h10B, [.A 1], 3 :: (List.replicate (2 * m + 1) 1 ++ R)) + (.h10B, .A 1 :: [.A 0, .A 2], List.replicate (2 * m) 1 ++ R) := by + rw [Nat.add_comm (2 * m) 1, List.replicate_add] + exact ⟨2, by decide, rfl⟩ + +theorem M2_sq_odd_step (m w Z d : ℕ) (hZ : Z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus (M2_sq (2 * m + 1) w Z d) (M2_sq (2 * m) (psiTilde w Z).1 (psiTilde w Z).2 d) := by + apply bounce_from_A0A2 + exact cfgSqReachesPlus_trans + (prefix_odd_3 m (2 :: R_tail w Z d)) + (sep_even_2 m [.A 0, .A 2] w Z d hZ hd) + +theorem M_sq_odd_to_M2 (m w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus (M_sq (2 * m + 1) w z d) (M2_sq (2 * m) w (z + 2) d) := by + have hb1 : SqReachesPlus (M_sq (2 * m + 1) w z d) + (M2_sq (2 * m + 1) (psiTilde w z).1 (psiTilde w z).2 d) := by + apply bounce_from_A0A2 + exact cfgSqReachesPlus_trans + (prefix_odd_3 m (2 :: 1 :: R_tail w z d)) + (sep_even_21 m [.A 0, .A 2] (Or.inr (by simp)) w z d hz hd) + have hb2 := M2_sq_odd_step m (psiTilde w z).1 (psiTilde w z).2 d (psiTilde_snd_odd w z hz) hd + rw [psiTilde_psiTilde] at hb2 + exact sqReachesPlus_trans hb1 hb2 + +theorem loop_L1F (u v j w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (F_sq (2 * u + 4) (2 * v) (2 * j + 1) w z d) + (F_sq (2 * u) (2 * v) (2 * j + 3) w (z + 2) d) := by + set wt := (psiTilde w z).1 + set zt := (psiTilde w z).2 + have hb1 : SqReachesPlus + (F_sq (2 * u + 4) (2 * v) (2 * j + 1) w z d) + (3 :: (List.replicate (2 * u + 2) 1 ++ (3 :: (List.replicate (2 * v) 1 ++ + (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))))))) := by + apply bounce_from_A0A2 + have h1 : CfgSqReachesPlus + (.h10B, [.A 1], F_sq (2 * u + 4) (2 * v) (2 * j + 1) w z d) + (.h10B, .A 1 :: stackP1 (u + 1) [], 1 :: (List.replicate (2 * v) 1 ++ + (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: R_tail w z d))))) := by + simpa [F_sq, show 2 * u + 4 = 2 * (u + 1 + 1) by omega] using + prefix_P1_scan (u + 1) [] (List.replicate (2 * v) 1 ++ + (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: R_tail w z d)))) + have h2 := prefix_P2_scan v (stackP1 (u + 1) []) (List.replicate (2 * j + 1) 1 ++ (0 :: R_tail w z d)) + rw [cons_replicate_odd_append j 1 (0 :: R_tail w z d)] at h2 + have h3 := sep_even_0 j (stackP2 v (stackP1 (u + 1) [])) w z d hz hd + have h4 := prefix_P2_pop v (stackP1 (u + 1) []) + (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))) + have h5 := prefix_P1_pop (u + 1) [] + (3 :: (List.replicate (2 * v) 1 ++ (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))))) + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3) h4) h5 + have hb2 : SqReachesPlus + (3 :: (List.replicate (2 * u + 2) 1 ++ (3 :: (List.replicate (2 * v) 1 ++ + (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))))))) + (F_sq (2 * u) (2 * v) (2 * j + 3) w (z + 2) d) := by + apply bounce_from_A0A2 + have h1 := prefix_P1_scan u [] (List.replicate (2 * v) 1 ++ + (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d)))) + have h2 := prefix_P2_scan v (stackP1 u []) (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d)) + rw [cons_replicate_odd_append j 1 (0 :: 1 :: R_tail wt zt d)] at h2 + have h3 := sep_even_01 (j + 1) (stackP2 v (stackP1 u [])) wt zt d (psiTilde_snd_odd w z hz) hd + rw [psiTilde_psiTilde] at h3 + have h4 := prefix_P2_pop v (stackP1 u []) + (3 :: (List.replicate (2 * j + 3) 1 ++ (0 :: R_tail w (z + 2) d))) + have h5 := prefix_P1_pop u [] + (3 :: (List.replicate (2 * v) 1 ++ (3 :: (List.replicate (2 * j + 3) 1 ++ (0 :: R_tail w (z + 2) d))))) + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3) h4) h5 + exact sqReachesPlus_trans hb1 hb2 + +theorem bridge_F2 (v j w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (F_sq 2 (2 * v) (2 * j + 1) w z d) + (G_sq (2 * v + 3) (2 * j + 1) w (z + 2) d) := by + set wt := (psiTilde w z).1 + set zt := (psiTilde w z).2 + have hb1 : SqReachesPlus + (F_sq 2 (2 * v) (2 * j + 1) w z d) + (3 :: 3 :: (List.replicate (2 * v) 1 ++ (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))))) := by + apply bounce_from_A0A2 + have h1 := prefix_P1_scan 0 [] (List.replicate (2 * v) 1 ++ + (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: R_tail w z d)))) + have h2 := prefix_P2_scan v (stackP1 0 []) (List.replicate (2 * j + 1) 1 ++ (0 :: R_tail w z d)) + rw [cons_replicate_odd_append j 1 (0 :: R_tail w z d)] at h2 + have h3 := sep_even_0 j (stackP2 v (stackP1 0 [])) w z d hz hd + have h4 := prefix_P2_pop v (stackP1 0 []) + (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))) + have h5 := prefix_P1_pop 0 [] + (3 :: (List.replicate (2 * v) 1 ++ (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))))) + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3) h4) h5 + have hb2 := double3_reduction (List.replicate (2 * v) 1 ++ + (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d)))) + have hb3 : SqReachesPlus + (1 :: 1 :: (List.replicate (2 * v) 1 ++ (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))))) + (G_sq (2 * v + 3) (2 * j + 1) w (z + 2) d) := by + apply bounce_from_nil + have heq : 1 :: 1 :: (List.replicate (2 * v) 1 ++ (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d)))) = + List.replicate (2 * (v + 1)) 1 ++ (3 :: 1 :: (List.replicate (2 * j) 1 ++ (0 :: 1 :: R_tail wt zt d))) := by + rw [show 2 * (v + 1) = 2 + 2 * v by omega, show 2 * j + 1 = 1 + 2 * j by omega] + simp [List.replicate_add, List.cons_append] + rw [heq] + have h1 := prefix_P3_scan_from_S (v + 1) [] (List.replicate (2 * j) 1 ++ (0 :: 1 :: R_tail wt zt d)) + have h2 := sep_even_01 j (stackP3 (v + 1) []) wt zt d (psiTilde_snd_odd w z hz) hd + rw [psiTilde_psiTilde] at h2 + have hne := rep_B2_A2_ne_A2 (v + 1) [] (Or.inl (by omega)) + have h3 : CfgSqReachesPlus + (.hL, stackP3 (v + 1) [], 3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: R_tail w (z + 2) d))) + (.hL, List.replicate (v + 1) (.B 2) ++ [.A 2], 1 :: 3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: R_tail w (z + 2) d))) := + ⟨1, by decide, by simp [stackP3, iterOpt, step_sq_hL_A0 _ hne]⟩ + have h4 := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B2_A2_hL (v + 1) [] (1 :: 3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: R_tail w (z + 2) d)))) + rw [replicate_append_cons_same (2 * (v + 1)), show 2 * (v + 1) + 1 = 2 * v + 3 by omega] at h4 + simpa [G_sq] using cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3) h4 + exact sqReachesPlus_trans (sqReachesPlus_trans hb1 hb2) hb3 + +theorem bridge_F0_ge3 (v j w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (F_sq 0 (2 * v) (2 * j + 3) w z d) + (G_sq (2 * v + 3) (2 * j + 1) w (z + 2) d) := by + set wt := (psiTilde w z).1 + set zt := (psiTilde w z).2 + have hb1 : SqReachesPlus + (F_sq 0 (2 * v) (2 * j + 3) w z d) + (1 :: 1 :: (List.replicate (2 * v) 1 ++ (3 :: (List.replicate (2 * j + 3) 1 ++ (0 :: R_tail w z d))))) := + double3_reduction (List.replicate (2 * v) 1 ++ (3 :: (List.replicate (2 * j + 3) 1 ++ (0 :: R_tail w z d)))) + have hb2 : SqReachesPlus + (1 :: 1 :: (List.replicate (2 * v) 1 ++ (3 :: (List.replicate (2 * j + 3) 1 ++ (0 :: R_tail w z d))))) + (3 :: (List.replicate (2 * v + 3) 1 ++ (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))))) := by + apply bounce_from_nil + have heq : 1 :: 1 :: (List.replicate (2 * v) 1 ++ (3 :: (List.replicate (2 * j + 3) 1 ++ (0 :: R_tail w z d)))) = + List.replicate (2 * (v + 1)) 1 ++ (3 :: 1 :: (List.replicate (2 * (j + 1)) 1 ++ (0 :: R_tail w z d))) := by + rw [show 2 * (v + 1) = 2 + 2 * v by omega, show 2 * j + 3 = 1 + 2 * (j + 1) by omega] + simp [List.replicate_add, List.cons_append] + rw [heq] + have h1 := prefix_P3_scan_from_S (v + 1) [] (List.replicate (2 * (j + 1)) 1 ++ (0 :: R_tail w z d)) + have h2 := sep_even_0 j (stackP3 (v + 1) []) w z d hz hd + have hne := rep_B2_A2_ne_A2 (v + 1) [] (Or.inl (by omega)) + have h3 : CfgSqReachesPlus + (.hL, stackP3 (v + 1) [], 3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))) + (.hL, List.replicate (v + 1) (.B 2) ++ [.A 2], 1 :: 3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))) := + ⟨1, by decide, by simp [stackP3, iterOpt, step_sq_hL_A0 _ hne]⟩ + have h4 := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B2_A2_hL (v + 1) [] (1 :: 3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d)))) + rw [replicate_append_cons_same (2 * (v + 1)), show 2 * (v + 1) + 1 = 2 * v + 3 by omega] at h4 + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3) h4 + have hb3 : SqReachesPlus + (3 :: (List.replicate (2 * v + 3) 1 ++ (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))))) + (G_sq (2 * v + 3) (2 * j + 1) w (z + 2) d) := by + apply bounce_from_A0A2 + have h1 := prefix_P3_scan (v + 1) (List.replicate (2 * j) 1 ++ (0 :: 1 :: R_tail wt zt d)) + have heq1 : 3 :: (List.replicate (2 * (v + 1) + 1) 1 ++ (3 :: 1 :: (List.replicate (2 * j) 1 ++ (0 :: 1 :: R_tail wt zt d)))) = + 3 :: (List.replicate (2 * v + 3) 1 ++ (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d)))) := by + rw [show 2 * (v + 1) + 1 = 2 * v + 3 by omega, show 2 * j + 1 = 1 + 2 * j by omega] + simp [List.replicate_add] + rw [heq1] at h1 + have h2 := sep_even_01 j (stackP3 (v + 1) [.A 0, .A 2]) wt zt d (psiTilde_snd_odd w z hz) hd + rw [psiTilde_psiTilde] at h2 + have hne := rep_B2_A2_ne_A2 (v + 1) [.A 0, .A 2] (Or.inl (by omega)) + have h3 : CfgSqReachesPlus + (.hL, stackP3 (v + 1) [.A 0, .A 2], 3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: R_tail w (z + 2) d))) + (.hL, List.replicate (v + 1) (.B 2) ++ (.A 2 :: [.A 0, .A 2]), 1 :: 3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: R_tail w (z + 2) d))) := + ⟨1, by decide, by simp [stackP3, iterOpt, step_sq_hL_A0 _ hne]⟩ + have h4 := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B2_A2_hL (v + 1) [.A 0, .A 2] (1 :: 3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: R_tail w (z + 2) d)))) + rw [replicate_append_cons_same (2 * (v + 1)), show 2 * (v + 1) + 1 = 2 * v + 3 by omega] at h4 + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3) h4 + exact sqReachesPlus_trans (sqReachesPlus_trans hb1 hb2) hb3 + +theorem bridge_F0_1 (v w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (F_sq 0 (2 * v) 1 w z d) + (M_sq (2 * v + 3) (psiTilde w z).1 (psiTilde w z).2 d) := by + set wt := (psiTilde w z).1 + set zt := (psiTilde w z).2 + have hb1 : SqReachesPlus + (F_sq 0 (2 * v) 1 w z d) + (1 :: 1 :: (List.replicate (2 * v) 1 ++ (3 :: 1 :: 0 :: R_tail w z d))) := + double3_reduction (List.replicate (2 * v) 1 ++ (3 :: 1 :: 0 :: R_tail w z d)) + have hb2 : SqReachesPlus + (1 :: 1 :: (List.replicate (2 * v) 1 ++ (3 :: 1 :: 0 :: R_tail w z d))) + (M_sq (2 * v + 3) wt zt d) := by + apply bounce_from_nil + have heq : 1 :: 1 :: (List.replicate (2 * v) 1 ++ (3 :: 1 :: 0 :: R_tail w z d)) = + List.replicate (2 * (v + 1)) 1 ++ (3 :: 1 :: 0 :: R_tail w z d) := by + rw [show 2 * (v + 1) = 2 + 2 * v by omega] + simp [List.replicate_add, List.cons_append] + rw [heq] + have h1 := prefix_P3_scan_from_S (v + 1) [] (0 :: R_tail w z d) + have h2 := sep_0 w z d hz hd (stackP3 (v + 1) []) + have hne := rep_B2_A2_ne_A2 (v + 1) [] (Or.inl (by omega)) + have h3 : CfgSqReachesPlus + (.hL, stackP3 (v + 1) [], 2 :: 1 :: R_tail wt zt d) + (.hL, List.replicate (v + 1) (.B 2) ++ [.A 2], 1 :: 2 :: 1 :: R_tail wt zt d) := + ⟨1, by decide, by simp [stackP3, iterOpt, step_sq_hL_A0 _ hne]⟩ + have h4 := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B2_A2_hL (v + 1) [] (1 :: 2 :: 1 :: R_tail wt zt d)) + rw [replicate_append_cons_same (2 * (v + 1)), show 2 * (v + 1) + 1 = 2 * v + 3 by omega] at h4 + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3) h4 + exact sqReachesPlus_trans hb1 hb2 + +theorem loop_L2G (m j w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (G_sq (2 * m + 1) (2 * j + 3) w z d) + (G_sq (2 * m + 1) (2 * j + 1) w (z + 2) d) := by + set wt := (psiTilde w z).1 + set zt := (psiTilde w z).2 + have hb1 : SqReachesPlus + (G_sq (2 * m + 1) (2 * j + 3) w z d) + (3 :: (List.replicate (2 * m + 1) 1 ++ (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))))) := by + apply bounce_from_A0A2 + have heq : G_sq (2 * m + 1) (2 * j + 3) w z d = + 3 :: (List.replicate (2 * m + 1) 1 ++ (3 :: 1 :: (List.replicate (2 * (j + 1)) 1 ++ (0 :: R_tail w z d)))) := by + simp [G_sq, show 2 * j + 3 = 1 + 2 * (j + 1) by omega, List.replicate_add] + rw [heq] + have h1 := prefix_P3_scan m (List.replicate (2 * (j + 1)) 1 ++ (0 :: R_tail w z d)) + have h2 := sep_even_0 j (stackP3 m [.A 0, .A 2]) w z d hz hd + have hne := rep_B2_A2_ne_A2 m [.A 0, .A 2] (Or.inr (by simp)) + have h3 : CfgSqReachesPlus + (.hL, stackP3 m [.A 0, .A 2], 3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))) + (.hL, List.replicate m (.B 2) ++ (.A 2 :: [.A 0, .A 2]), 1 :: 3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))) := + ⟨1, by decide, by simp [stackP3, iterOpt, step_sq_hL_A0 _ hne]⟩ + have h4 := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B2_A2_hL m [.A 0, .A 2] (1 :: 3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d)))) + rw [replicate_append_cons_same (2 * m)] at h4 + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3) h4 + have hb2 : SqReachesPlus + (3 :: (List.replicate (2 * m + 1) 1 ++ (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))))) + (G_sq (2 * m + 1) (2 * j + 1) w (z + 2) d) := by + apply bounce_from_A0A2 + have heq : List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d) = + 1 :: (List.replicate (2 * j) 1 ++ (0 :: 1 :: R_tail wt zt d)) := by + rw [Nat.add_comm (2 * j) 1, List.replicate_add]; rfl + rw [heq] + have h1 := prefix_P3_scan m (List.replicate (2 * j) 1 ++ (0 :: 1 :: R_tail wt zt d)) + have h2 := sep_even_01 j (stackP3 m [.A 0, .A 2]) wt zt d (psiTilde_snd_odd w z hz) hd + rw [psiTilde_psiTilde] at h2 + have hne := rep_B2_A2_ne_A2 m [.A 0, .A 2] (Or.inr (by simp)) + have h3 : CfgSqReachesPlus + (.hL, stackP3 m [.A 0, .A 2], 3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: R_tail w (z + 2) d))) + (.hL, List.replicate m (.B 2) ++ (.A 2 :: [.A 0, .A 2]), 1 :: 3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: R_tail w (z + 2) d))) := + ⟨1, by decide, by simp [stackP3, iterOpt, step_sq_hL_A0 _ hne]⟩ + have h4 := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B2_A2_hL m [.A 0, .A 2] (1 :: 3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: R_tail w (z + 2) d)))) + rw [replicate_append_cons_same (2 * m)] at h4 + simpa [G_sq] using cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3) h4 + exact sqReachesPlus_trans hb1 hb2 + +theorem G_odd_1_to_M (m w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (G_sq (2 * m + 1) 1 w z d) + (M_sq (2 * m + 1) (psiTilde w z).1 (psiTilde w z).2 d) := by + apply bounce_from_A0A2 + have h1 := prefix_P3_scan m (0 :: R_tail w z d) + have h2 := sep_0 w z d hz hd (stackP3 m [.A 0, .A 2]) + have hne := rep_B2_A2_ne_A2 m [.A 0, .A 2] (Or.inr (by simp)) + have h3 : CfgSqReachesPlus + (.hL, stackP3 m [.A 0, .A 2], 2 :: 1 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d) + (.hL, List.replicate m (.B 2) ++ (.A 2 :: [.A 0, .A 2]), 1 :: 2 :: 1 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d) := + ⟨1, by decide, by simp [stackP3, iterOpt, step_sq_hL_A0 _ hne]⟩ + have h4 := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B2_A2_hL m [.A 0, .A 2] (1 :: 2 :: 1 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d)) + rw [replicate_append_cons_same (2 * m)] at h4 + simpa [G_sq, M_sq] using cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3) h4 + +theorem G_odd_drain (m j w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (G_sq (2 * m + 1) (2 * j + 1) w z d) + (M2_sq (2 * m) (psiTilde w z).1 ((psiTilde w z).2 + 2 * j + 2) d) := by + induction j generalizing z with + | zero => + have h1 := G_odd_1_to_M m w z d hz hd + have h2 := M_sq_odd_to_M2 m (psiTilde w z).1 (psiTilde w z).2 d (psiTilde_snd_odd w z hz) hd + exact sqReachesPlus_trans h1 h2 + | succ j ih => + rw [show 2 * (j + 1) + 1 = 2 * j + 3 by omega] + have h1 := loop_L2G m j w z d hz hd + have h2 := ih (z + 2) (by omega) + have hpsi : psiTilde w (z + 2) = ((psiTilde w z).1, (psiTilde w z).2 + 2) := by + rw [psiTilde_add_two, psiShift_eq_psiTilde_step] + rw [hpsi] at h2 + have htot := sqReachesPlus_trans h1 h2 + rwa [show (psiTilde w z).2 + 2 + 2 * j + 2 = (psiTilde w z).2 + 2 * (j + 1) + 2 by omega] at htot + +theorem F_universal_drain (u v j w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (F_sq (2 * u) (2 * v) (2 * j + 1) w z d) + (M2_sq (2 * v + 2) (psiTilde w z).1 ((psiTilde w z).2 + 2 * (u + j + 1)) d) := by + have h_even_odd : ∀ k u0, u0 = 0 ∨ u0 = 1 → ∀ j0 z0, z0 % 2 = 1 → + SqReachesPlus + (F_sq (2 * (2 * k + u0)) (2 * v) (2 * j0 + 1) w z0 d) + (M2_sq (2 * v + 2) (psiTilde w z0).1 ((psiTilde w z0).2 + 2 * (2 * k + u0 + j0 + 1)) d) := by + intro k + induction k with + | zero => + intro u0 hu0 j0 z0 hz0 + rcases hu0 with rfl | rfl + · rcases j0 with _ | j' + · have h1 := bridge_F0_1 v w z0 d hz0 hd + have h2 := M_sq_odd_to_M2 (v + 1) (psiTilde w z0).1 (psiTilde w z0).2 d (psiTilde_snd_odd w z0 hz0) hd + rw [show 2 * (v + 1) + 1 = 2 * v + 3 by omega, show 2 * (v + 1) = 2 * v + 2 by omega] at h2 + exact sqReachesPlus_trans h1 h2 + · rw [show 2 * (j' + 1) + 1 = 2 * j' + 3 by omega] + have h1 := bridge_F0_ge3 v j' w z0 d hz0 hd + have h2 := G_odd_drain (v + 1) j' w (z0 + 2) d (by omega) hd + have hpsi : psiTilde w (z0 + 2) = ((psiTilde w z0).1, (psiTilde w z0).2 + 2) := by + rw [psiTilde_add_two, psiShift_eq_psiTilde_step] + rw [hpsi, show 2 * (v + 1) + 1 = 2 * v + 3 by omega, show 2 * (v + 1) = 2 * v + 2 by omega] at h2 + have htot := sqReachesPlus_trans h1 h2 + rwa [show (psiTilde w z0).2 + 2 + 2 * j' + 2 = (psiTilde w z0).2 + 2 * (2 * 0 + 0 + (j' + 1) + 1) by omega] at htot + · have h1 := bridge_F2 v j0 w z0 d hz0 hd + have h2 := G_odd_drain (v + 1) j0 w (z0 + 2) d (by omega) hd + have hpsi : psiTilde w (z0 + 2) = ((psiTilde w z0).1, (psiTilde w z0).2 + 2) := by + rw [psiTilde_add_two, psiShift_eq_psiTilde_step] + rw [hpsi, show 2 * (v + 1) + 1 = 2 * v + 3 by omega, show 2 * (v + 1) = 2 * v + 2 by omega] at h2 + have htot := sqReachesPlus_trans h1 h2 + rwa [show (psiTilde w z0).2 + 2 + 2 * j0 + 2 = (psiTilde w z0).2 + 2 * (2 * 0 + 1 + j0 + 1) by omega] at htot + | succ k ih => + intro u0 hu0 j0 z0 hz0 + have heq : 2 * (2 * (k + 1) + u0) = 2 * (2 * k + u0) + 4 := by omega + rw [heq] + have h1 := loop_L1F (2 * k + u0) v j0 w z0 d hz0 hd + have h2 := ih u0 hu0 (j0 + 1) (z0 + 2) (by omega) + have hpsi : psiTilde w (z0 + 2) = ((psiTilde w z0).1, (psiTilde w z0).2 + 2) := by + rw [psiTilde_add_two, psiShift_eq_psiTilde_step] + rw [hpsi, show 2 * (j0 + 1) + 1 = 2 * j0 + 3 by omega] at h2 + have htot := sqReachesPlus_trans h1 h2 + rwa [show (psiTilde w z0).2 + 2 + 2 * (2 * k + u0 + (j0 + 1) + 1) = + (psiTilde w z0).2 + 2 * (2 * (k + 1) + u0 + j0 + 1) by omega] at htot + have hu_split : u = 2 * (u / 2) + u % 2 := by omega + have hmod : u % 2 = 0 ∨ u % 2 = 1 := Nat.mod_two_eq_zero_or_one u + have hmain := h_even_odd (u / 2) (u % 2) hmod j z hz + rwa [← hu_split] at hmain + +theorem loop_LH (m w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (H_sq (2 * m + 3) w z d) + (H_sq (2 * m + 1) w (z + 2) d) := by + set wt := (psiTilde w z).1 + set zt := (psiTilde w z).2 + have hb1 : SqReachesPlus + (H_sq (2 * m + 3) w z d) + (3 :: (List.replicate (2 * m + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))) := by + apply bounce_from_A0A2 + have h1 := prefix_odd_3 (m + 1) (0 :: R_tail w z d) + rw [show 2 * (m + 1) + 1 = 2 * m + 3 by omega] at h1 + have h2 := sep_even_0 m [.A 0, .A 2] w z d hz hd + exact cfgSqReachesPlus_trans h1 h2 + have hb2 : SqReachesPlus + (3 :: (List.replicate (2 * m + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))) + (H_sq (2 * m + 1) w (z + 2) d) := by + apply bounce_from_A0A2 + have h1 := prefix_odd_3 m (0 :: 1 :: R_tail wt zt d) + have h2 := sep_even_01 m [.A 0, .A 2] wt zt d (psiTilde_snd_odd w z hz) hd + rw [psiTilde_psiTilde] at h2 + exact cfgSqReachesPlus_trans h1 h2 + exact sqReachesPlus_trans hb1 hb2 + +theorem H_base_to_M2 (w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (H_sq 1 w z d) + (M2_sq 0 (psiTilde w z).1 ((psiTilde w z).2 + 2) d) := by + set wt := (psiTilde w z).1 + set zt := (psiTilde w z).2 + have hb1 : SqReachesPlus (H_sq 1 w z d) (2 :: 1 :: R_tail wt zt d) := by + apply bounce_from_A0A2 + exact cfgSqReachesPlus_trans (prefix_odd_3 0 (0 :: R_tail w z d)) (sep_0 w z d hz hd [.A 0, .A 2]) + have hb2 := sep_21_nil wt zt d (psiTilde_snd_odd w z hz) hd + rw [psiTilde_psiTilde] at hb2 + have hb3 : SqReachesPlus (2 :: R_tail w (z + 2) d) (M2_sq 0 wt (zt + 2) d) := by + apply bounce_from_nil + have h := sep_even_2 0 [] w (z + 2) d (by omega) hd + have hpsi : psiTilde w (z + 2) = (wt, zt + 2) := by + rw [psiTilde_add_two, psiShift_eq_psiTilde_step] + rw [hpsi] at h + exact h + exact sqReachesPlus_trans (sqReachesPlus_trans hb1 hb2) hb3 + +theorem H_drain (m w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (H_sq (2 * m + 1) w z d) + (M2_sq 0 (psiTilde w z).1 ((psiTilde w z).2 + 2 * m + 2) d) := by + induction m generalizing z with + | zero => exact H_base_to_M2 w z d hz hd + | succ m ih => + rw [show 2 * (m + 1) + 1 = 2 * m + 3 by omega] + have h1 := loop_LH m w z d hz hd + have h2 := ih (z + 2) (by omega) + have hpsi : psiTilde w (z + 2) = ((psiTilde w z).1, (psiTilde w z).2 + 2) := by + rw [psiTilde_add_two, psiShift_eq_psiTilde_step] + rw [hpsi] at h2 + have htot := sqReachesPlus_trans h1 h2 + rwa [show (psiTilde w z).2 + 2 + 2 * m + 2 = (psiTilde w z).2 + 2 * (m + 1) + 2 by omega] at htot + +-- Phase 1: Unified J_even / J_odd and enc_odd -> M2_sq + +def J_even (m r w z d : ℕ) : List ℕ := + 3 :: (List.replicate (2 * m) 1 ++ (3 :: (List.replicate (2 * r) 1 ++ (2 :: R_tail w z d)))) + +def J_odd (m r w z d : ℕ) : List ℕ := + 3 :: (List.replicate (2 * m) 1 ++ (3 :: (List.replicate (2 * r) 1 ++ (2 :: 1 :: R_tail w z d)))) + +theorem pop_A0_run_hL (k : ℕ) (L : List SBlock) (hL : L ≠ [.A 2]) (R : List ℕ) : + iterOpt step_sq k (.hL, List.replicate k (.A 0) ++ L, R) = + some (.hL, L, List.replicate k 1 ++ R) := by + induction k generalizing R with + | zero => rfl + | succ k ih => + rw [List.replicate_succ, List.cons_append] + conv_lhs => rw [Nat.add_comm k 1] + have hne := replicate_A0_append_ne_A2 k hL + have h1 : iterOpt step_sq 1 (.hL, .A 0 :: (List.replicate k (.A 0) ++ L), R) = + some (.hL, List.replicate k (.A 0) ++ L, 1 :: R) := by + dsimp [iterOpt] + rw [step_sq_hL_A0 _ hne R] + rfl + refine iterOpt_trans h1 ?_ + rw [ih (1 :: R), replicate_append_cons_same] + +theorem enc_odd_b1_step1 (m s d : ℕ) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (enc_odd (2 * m + 1) 1 (2 * s + 1) d) + (3 :: (List.replicate (2 * m + 1) 1 ++ (0 :: R_mid (2 * s + 1) d))) := by + apply bounce_from_A0A2 + have h0 : enc_odd (2 * m + 1) 1 (2 * s + 1) d = + 3 :: (List.replicate (2 * m + 1) 1 ++ (0 :: 1 :: 3 :: (List.replicate (2 * s + 1) 1 ++ [d, 1]))) := rfl + rw [h0] + have h1 := prefix_odd_3 m (0 :: 1 :: 3 :: (List.replicate (2 * s + 1) 1 ++ [d, 1])) + have h2 := cfgSqReachesStar_of_iterOpt + (scan_ones_h10B_any m [.A 0, .A 2] (0 :: 1 :: 3 :: (List.replicate (2 * s + 1) 1 ++ [d, 1]))) + have h3 : CfgSqReachesPlus + (.h10B, stackAfterOnes m [.A 0, .A 2], 0 :: 1 :: 3 :: (List.replicate (2 * s + 1) 1 ++ [d, 1])) + (.h10B, .A 1 :: .B 1 :: (List.replicate m (.B 2) ++ [.A 2, .A 0, .A 2]), List.replicate (2 * s + 1) 1 ++ [d, 1]) := + ⟨3, by decide, by simp [iterOpt, step_sq]⟩ + have h4 := pass1_turnaround s d hd (.B 1 :: (List.replicate m (.B 2) ++ [.A 2, .A 0, .A 2])) + have h5 := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B1_B2_A2_hL m [.A 0, .A 2] (R_mid (2 * s + 1) d)) + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 (cfgSqReachesStar_plus_trans h2 h3)) h4) h5 + +theorem enc_odd_ge2_mid (m k s d : ℕ) (hd : d = 0 ∨ d = 2) : + CfgSqReachesPlus + (.h10B, [.A 1], enc_odd (2 * m + 1) (k + 2) (2 * s + 1) d) + (.h10B, .A 1 :: (List.replicate m (.B 2) ++ [.A 2, .A 0, .A 2]), + List.replicate k 1 ++ (2 :: R_mid (2 * s + 1) d)) := by + have h0 : enc_odd (2 * m + 1) (k + 2) (2 * s + 1) d = + 3 :: (List.replicate (2 * m + 1) 1 ++ (0 :: 1 :: (List.replicate (k + 1) 1 ++ (3 :: (List.replicate (2 * s + 1) 1 ++ [d, 1]))))) := by + simp [enc_odd, TailWord, show k + 2 = 1 + (k + 1) by omega, List.replicate_add] + rw [h0] + have h1 := prefix_odd_3 m (0 :: 1 :: (List.replicate (k + 1) 1 ++ (3 :: (List.replicate (2 * s + 1) 1 ++ [d, 1])))) + have h2 := cfgSqReachesStar_of_iterOpt + (scan_ones_h10B_any m [.A 0, .A 2] (0 :: 1 :: (List.replicate (k + 1) 1 ++ (3 :: (List.replicate (2 * s + 1) 1 ++ [d, 1]))))) + have h3 : CfgSqReachesPlus + (.h10B, stackAfterOnes m [.A 0, .A 2], 0 :: 1 :: (List.replicate (k + 1) 1 ++ (3 :: (List.replicate (2 * s + 1) 1 ++ [d, 1])))) + (.h10F, .B 0 :: (List.replicate m (.B 2) ++ [.A 2, .A 0, .A 2]), List.replicate (k + 1) 1 ++ (3 :: (List.replicate (2 * s + 1) 1 ++ [d, 1]))) := + ⟨2, by decide, by simp [iterOpt, step_sq]⟩ + have h4 := cfgSqReachesStar_of_iterOpt + (scan_ones_h10F (k + 1) (.B 0 :: (List.replicate m (.B 2) ++ [.A 2, .A 0, .A 2])) (3 :: (List.replicate (2 * s + 1) 1 ++ [d, 1]))) + have h5 : CfgSqReachesPlus + (.h10F, List.replicate (k + 1) (.A 0) ++ (.B 0 :: (List.replicate m (.B 2) ++ [.A 2, .A 0, .A 2])), + 3 :: (List.replicate (2 * s + 1) 1 ++ [d, 1])) + (.h10B, .A 1 :: .A 1 :: (List.replicate k (.A 0) ++ (.B 0 :: (List.replicate m (.B 2) ++ [.A 2, .A 0, .A 2]))), + List.replicate (2 * s + 1) 1 ++ [d, 1]) := + ⟨1, by decide, by simp [List.replicate_succ, iterOpt, step_sq]⟩ + have h6 := pass1_turnaround s d hd + (.A 1 :: (List.replicate k (.A 0) ++ (.B 0 :: (List.replicate m (.B 2) ++ [.A 2, .A 0, .A 2])))) + have h7 : CfgSqReachesPlus + (.hL, .A 1 :: (List.replicate k (.A 0) ++ (.B 0 :: (List.replicate m (.B 2) ++ [.A 2, .A 0, .A 2]))), R_mid (2 * s + 1) d) + (.hL, List.replicate k (.A 0) ++ (.B 0 :: (List.replicate m (.B 2) ++ [.A 2, .A 0, .A 2])), 2 :: R_mid (2 * s + 1) d) := + ⟨1, by decide, rfl⟩ + have h8 := cfgSqReachesStar_of_iterOpt + (pop_A0_run_hL k (.B 0 :: (List.replicate m (.B 2) ++ [.A 2, .A 0, .A 2])) (by simp) (2 :: R_mid (2 * s + 1) d)) + have h9 : CfgSqReachesPlus + (.hL, .B 0 :: (List.replicate m (.B 2) ++ [.A 2, .A 0, .A 2]), List.replicate k 1 ++ (2 :: R_mid (2 * s + 1) d)) + (.h10B, .A 1 :: (List.replicate m (.B 2) ++ [.A 2, .A 0, .A 2]), List.replicate k 1 ++ (2 :: R_mid (2 * s + 1) d)) := + ⟨1, by decide, rfl⟩ + exact cfgSqReachesPlus_trans + (cfgSqReachesPlus_trans + (cfgSqReachesPlus_trans + (cfgSqReachesPlus_trans + (cfgSqReachesPlus_trans h1 (cfgSqReachesStar_plus_trans h2 h3)) + (cfgSqReachesStar_plus_trans h4 h5)) + h6) + h7) + (cfgSqReachesStar_plus_trans h8 h9) + +theorem rmid_even_2 (r s d : ℕ) (hd : d = 0 ∨ d = 2) (L : List SBlock) : + CfgSqReachesPlus + (.h10B, .A 1 :: L, List.replicate (2 * r) 1 ++ (2 :: R_mid (2 * s + 1) d)) + (.hL, L, 3 :: (List.replicate (2 * r) 1 ++ (2 :: R_tail (if d = 0 then 2 * s else 2 * s + 1) 1 (2 - d)))) := by + rcases hd with rfl | rfl + · simp only [R_mid, ↓reduceIte] + have h1 := cfgSqReachesStar_of_iterOpt (scan_ones_h10B_any r L (2 :: 3 :: (List.replicate (2 * s + 1) 1 ++ [3, 1]))) + have h2 : CfgSqReachesPlus + (.h10B, stackAfterOnes r L, 2 :: 3 :: (List.replicate (2 * s + 1) 1 ++ [3, 1])) + (.h10B, .A 1 :: .A 1 :: (List.replicate r (.B 2) ++ (.A 2 :: L)), List.replicate (2 * s + 1) 1 ++ [3, 1]) := + ⟨2, by decide, by simp [iterOpt, step_sq]⟩ + have h3 := pass2_turnaround s (.A 1 :: (List.replicate r (.B 2) ++ (.A 2 :: L))) + have h4 : CfgSqReachesPlus + (.hL, .A 1 :: (List.replicate r (.B 2) ++ (.A 2 :: L)), R_tail (2 * s) 1 2) + (.hL, List.replicate r (.B 2) ++ (.A 2 :: L), 2 :: R_tail (2 * s) 1 2) := + ⟨1, by decide, rfl⟩ + have h5 := cfgSqReachesPlus_of_iterOpt (by omega) (pop_B2_A2_hL r L (2 :: R_tail (2 * s) 1 2)) + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesStar_plus_trans h1 h2) h3) h4) h5 + · simp only [R_mid, show (2 : ℕ) ≠ 0 by decide, ↓reduceIte, show 2 * s + 1 - 1 = 2 * s by omega, + show 2 - 2 = 0 by rfl] + have h := sep_even_2 r L (2 * s) 1 0 (by decide) (Or.inl rfl) + simpa [psiTilde] using h + +theorem rmid_odd_2 (r s d : ℕ) (hd : d = 0 ∨ d = 2) (L : List SBlock) : + CfgSqReachesPlus + (.h10B, .A 1 :: L, List.replicate (2 * r + 1) 1 ++ (2 :: R_mid (2 * s + 1) d)) + (.hL, L, 3 :: (List.replicate (2 * r) 1 ++ (2 :: 1 :: R_tail (if d = 0 then 2 * s else 2 * s + 1) 1 (2 - d)))) := by + have heq : List.replicate (2 * r + 1) 1 ++ (2 :: R_mid (2 * s + 1) d) = + 1 :: (List.replicate (2 * r) 1 ++ (2 :: R_mid (2 * s + 1) d)) := by + rw [Nat.add_comm (2 * r) 1, List.replicate_add]; rfl + rw [heq] + have hp := prefix_P2_scan_2 r L (R_mid (2 * s + 1) d) + rcases hd with rfl | rfl + · simp only [R_mid, ↓reduceIte] at hp ⊢ + have h2 : CfgSqReachesPlus + (.h10B, .A 1 :: stackP2 r L, 0 :: 3 :: (List.replicate (2 * s + 1) 1 ++ [3, 1])) + (.h10B, .A 1 :: .A 0 :: .A 1 :: stackP2 r L, List.replicate (2 * s + 1) 1 ++ [3, 1]) := + ⟨2, by decide, rfl⟩ + have h3 := pass2_turnaround s (.A 0 :: .A 1 :: stackP2 r L) + have h4 : CfgSqReachesPlus + (.hL, .A 0 :: .A 1 :: stackP2 r L, R_tail (2 * s) 1 2) + (.hL, stackP2 r L, 2 :: 1 :: R_tail (2 * s) 1 2) := + ⟨2, by decide, rfl⟩ + have h5 := prefix_P2_pop r L (2 :: 1 :: R_tail (2 * s) 1 2) + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans hp h2) h3) h4) h5 + · simp only [R_mid, show (2 : ℕ) ≠ 0 by decide, ↓reduceIte, show 2 * s + 1 - 1 = 2 * s by omega, + show 2 - 2 = 0 by rfl] at hp ⊢ + have h2 := sep_0 (2 * s) 1 0 (by decide) (Or.inl rfl) (stackP2 r L) + have hpsi : psiTilde (2 * s) 1 = (2 * s + 1, 1) := by simp [psiTilde] + rw [hpsi] at h2 + have h3 := prefix_P2_pop r L (2 :: 1 :: R_tail (2 * s + 1) 1 0) + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans hp h2) h3 + +theorem enc_odd_even_b_step1 (m r s d : ℕ) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (enc_odd (2 * m + 1) (2 * r + 2) (2 * s + 1) d) + (J_even m r (if d = 0 then 2 * s else 2 * s + 1) 1 (2 - d)) := by + apply bounce_from_A0A2 + have h1 := enc_odd_ge2_mid m (2 * r) s d hd + have h2 := rmid_even_2 r s d hd (List.replicate m (.B 2) ++ [.A 2, .A 0, .A 2]) + have h3 := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B2_A2_hL m [.A 0, .A 2] (3 :: (List.replicate (2 * r) 1 ++ (2 :: R_tail (if d = 0 then 2 * s else 2 * s + 1) 1 (2 - d))))) + simpa [J_even] using cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3 + +theorem enc_odd_odd_b_step1 (m r s d : ℕ) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (enc_odd (2 * m + 1) (2 * r + 3) (2 * s + 1) d) + (J_odd m r (if d = 0 then 2 * s else 2 * s + 1) 1 (2 - d)) := by + apply bounce_from_A0A2 + have h1 := enc_odd_ge2_mid m (2 * r + 1) s d hd + have h2 := rmid_odd_2 r s d hd (List.replicate m (.B 2) ++ [.A 2, .A 0, .A 2]) + have h3 := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B2_A2_hL m [.A 0, .A 2] (3 :: (List.replicate (2 * r) 1 ++ (2 :: 1 :: R_tail (if d = 0 then 2 * s else 2 * s + 1) 1 (2 - d))))) + simpa [J_odd] using cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3 + +theorem J_even_zero_to_M2 (r w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus (J_even 0 r w z d) (M2_sq (2 * r + 2) (psiTilde w z).1 (psiTilde w z).2 d) := by + have hb1 : SqReachesPlus (J_even 0 r w z d) + (List.replicate (2 * (r + 1)) 1 ++ (2 :: R_tail w z d)) := by + have hd3 : SqReachesPlus (J_even 0 r w z d) + (1 :: 1 :: (List.replicate (2 * r) 1 ++ (2 :: R_tail w z d))) := + double3_reduction (List.replicate (2 * r) 1 ++ (2 :: R_tail w z d)) + have heq : 1 :: 1 :: (List.replicate (2 * r) 1 ++ (2 :: R_tail w z d)) = + List.replicate (2 * (r + 1)) 1 ++ (2 :: R_tail w z d) := by + rw [show 2 * (r + 1) = 2 + 2 * r by omega] + simp [List.replicate_add, List.cons_append] + rwa [heq] at hd3 + have hb2 : SqReachesPlus + (List.replicate (2 * (r + 1)) 1 ++ (2 :: R_tail w z d)) + (M2_sq (2 * (r + 1)) (psiTilde w z).1 (psiTilde w z).2 d) := + bounce_from_nil (sep_even_2 (r + 1) [] w z d hz hd) + rw [show 2 * (r + 1) = 2 * r + 2 by omega] at hb2 + exact sqReachesPlus_trans hb1 hb2 + +theorem J_even_succ_to_J_odd (m r w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus (J_even (m + 1) r w z d) (J_odd m r (psiTilde w z).1 (psiTilde w z).2 d) := by + apply bounce_from_A0A2 + have h1 := prefix_P1_scan m [] (List.replicate (2 * r) 1 ++ (2 :: R_tail w z d)) + have h2 := prefix_P2_scan_2 r (stackP1 m []) (R_tail w z d) + have h3 := sep_0 w z d hz hd (stackP2 r (stackP1 m [])) + have h4 := prefix_P2_pop r (stackP1 m []) (2 :: 1 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d) + have h5 := prefix_P1_pop m [] (3 :: (List.replicate (2 * r) 1 ++ (2 :: 1 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d))) + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3) h4) h5 + +theorem J_odd_zero_to_M2 (r w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus (J_odd 0 r w z d) (M2_sq (2 * r + 2) w (z + 2) d) := by + have hb1 : SqReachesPlus (J_odd 0 r w z d) + (List.replicate (2 * (r + 1)) 1 ++ (2 :: 1 :: R_tail w z d)) := by + have hd3 : SqReachesPlus (J_odd 0 r w z d) + (1 :: 1 :: (List.replicate (2 * r) 1 ++ (2 :: 1 :: R_tail w z d))) := + double3_reduction (List.replicate (2 * r) 1 ++ (2 :: 1 :: R_tail w z d)) + have heq : 1 :: 1 :: (List.replicate (2 * r) 1 ++ (2 :: 1 :: R_tail w z d)) = + List.replicate (2 * (r + 1)) 1 ++ (2 :: 1 :: R_tail w z d) := by + rw [show 2 * (r + 1) = 2 + 2 * r by omega] + simp [List.replicate_add, List.cons_append] + rwa [heq] at hd3 + have hb2 : SqReachesPlus + (List.replicate (2 * (r + 1)) 1 ++ (2 :: 1 :: R_tail w z d)) + (M2_sq (2 * (r + 1) + 1) (psiTilde w z).1 (psiTilde w z).2 d) := + bounce_from_nil (sep_even_21 (r + 1) [] (Or.inl (by omega)) w z d hz hd) + have hb3 := M2_sq_odd_step (r + 1) (psiTilde w z).1 (psiTilde w z).2 d (psiTilde_snd_odd w z hz) hd + rw [psiTilde_psiTilde, show 2 * (r + 1) = 2 * r + 2 by omega] at hb3 + exact sqReachesPlus_trans (sqReachesPlus_trans hb1 hb2) hb3 + +theorem J_odd_succ_to_F (m r w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus (J_odd (m + 1) r w z d) (F_sq (2 * m) (2 * r) 1 (psiTilde w z).1 (psiTilde w z).2 d) := by + apply bounce_from_A0A2 + have h1 := prefix_P1_scan m [] (List.replicate (2 * r) 1 ++ (2 :: 1 :: R_tail w z d)) + have h2 := prefix_P2_scan_2 r (stackP1 m []) (1 :: R_tail w z d) + have h3 := sep_even_01 0 (stackP2 r (stackP1 m [])) w z d hz hd + have h4 := prefix_P2_pop r (stackP1 m []) (3 :: [1] ++ (0 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d)) + have h5 := prefix_P1_pop m [] (3 :: (List.replicate (2 * r) 1 ++ (3 :: [1] ++ (0 :: R_tail (psiTilde w z).1 (psiTilde w z).2 d)))) + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3) h4) h5 + +theorem phase1_b1_d0 (m s : ℕ) : + SqReachesPlus (enc_odd (2 * m + 1) 1 (2 * s + 1) 0) (M2_sq 0 (2 * s) (2 * m + 3) 2) := by + have h1 := enc_odd_b1_step1 m s 0 (Or.inl rfl) + simp only [R_mid, ↓reduceIte] at h1 + rcases m with _ | m' + · have h2 : SqReachesPlus + (3 :: [1] ++ (0 :: 3 :: (List.replicate (2 * s + 1) 1 ++ [3, 1]))) + (2 :: 1 :: R_tail (2 * s) 1 2) := by + apply bounce_from_A0A2 + have ha : CfgSqReachesPlus + (.h10B, [.A 1], 3 :: 1 :: 0 :: 3 :: (List.replicate (2 * s + 1) 1 ++ [3, 1])) + (.h10B, .A 1 :: [.A 0, .A 1, .A 0, .A 2], List.replicate (2 * s + 1) 1 ++ [3, 1]) := + ⟨4, by decide, rfl⟩ + have hb := pass2_turnaround s [.A 0, .A 1, .A 0, .A 2] + have hc : CfgSqReachesPlus + (.hL, [.A 0, .A 1, .A 0, .A 2], R_tail (2 * s) 1 2) + (.hL, [.A 0, .A 2], 2 :: 1 :: R_tail (2 * s) 1 2) := + ⟨2, by decide, rfl⟩ + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans ha hb) hc + have h3 := sep_21_nil (2 * s) 1 2 (by decide) (Or.inr rfl) + have hpsi : psiTilde (2 * s) 1 = (2 * s + 1, 1) := by simp [psiTilde] + rw [hpsi] at h3 + have h4 : SqReachesPlus (2 :: R_tail (2 * s + 1) 1 2) (M2_sq 0 (2 * s) 3 2) := by + have hx := bounce_from_nil (sep_even_2 0 [] (2 * s + 1) 1 2 (by decide) (Or.inr rfl)) + have hpsi2 : psiTilde (2 * s + 1) 1 = (2 * s, 3) := by simp [psiTilde] + rwa [hpsi2] at hx + exact sqReachesPlus_trans (sqReachesPlus_trans (sqReachesPlus_trans h1 h2) h3) h4 + · have h2 : SqReachesPlus + (3 :: (List.replicate (2 * (m' + 1) + 1) 1 ++ (0 :: 3 :: (List.replicate (2 * s + 1) 1 ++ [3, 1])))) + (3 :: (List.replicate (2 * m' + 1) 1 ++ (0 :: 1 :: R_tail (2 * s) 1 2))) := by + apply bounce_from_A0A2 + have ha := prefix_odd_3 (m' + 1) (0 :: 3 :: (List.replicate (2 * s + 1) 1 ++ [3, 1])) + have hb := cfgSqReachesStar_of_iterOpt + (scan_ones_h10B_any (m' + 1) [.A 0, .A 2] (0 :: 3 :: (List.replicate (2 * s + 1) 1 ++ [3, 1]))) + have hc : CfgSqReachesPlus + (.h10B, stackAfterOnes (m' + 1) [.A 0, .A 2], 0 :: 3 :: (List.replicate (2 * s + 1) 1 ++ [3, 1])) + (.h10B, .A 1 :: .A 0 :: .B 1 :: (List.replicate m' (.B 2) ++ [.A 2, .A 0, .A 2]), List.replicate (2 * s + 1) 1 ++ [3, 1]) := + ⟨2, by decide, rfl⟩ + have hd' := pass2_turnaround s (.A 0 :: .B 1 :: (List.replicate m' (.B 2) ++ [.A 2, .A 0, .A 2])) + have he : CfgSqReachesPlus + (.hL, .A 0 :: .B 1 :: (List.replicate m' (.B 2) ++ [.A 2, .A 0, .A 2]), R_tail (2 * s) 1 2) + (.hL, .B 1 :: (List.replicate m' (.B 2) ++ [.A 2, .A 0, .A 2]), 1 :: R_tail (2 * s) 1 2) := + ⟨1, by decide, rfl⟩ + have hf := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B1_B2_A2_hL m' [.A 0, .A 2] (1 :: R_tail (2 * s) 1 2)) + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans ha (cfgSqReachesStar_plus_trans hb hc)) hd') he) hf + have h3 : SqReachesPlus + (3 :: (List.replicate (2 * m' + 1) 1 ++ (0 :: 1 :: R_tail (2 * s) 1 2))) + (H_sq (2 * m' + 1) (2 * s + 1) 1 2) := by + apply bounce_from_A0A2 + have ha := prefix_odd_3 m' (0 :: 1 :: R_tail (2 * s) 1 2) + have hb := sep_even_01 m' [.A 0, .A 2] (2 * s) 1 2 (by decide) (Or.inr rfl) + have hpsi : psiTilde (2 * s) 1 = (2 * s + 1, 1) := by simp [psiTilde] + rw [hpsi] at hb + exact cfgSqReachesPlus_trans ha hb + have h4 := H_drain m' (2 * s + 1) 1 2 (by decide) (Or.inr rfl) + have hpsi2 : psiTilde (2 * s + 1) 1 = (2 * s, 3) := by simp [psiTilde] + rw [hpsi2] at h4 + have htot := sqReachesPlus_trans (sqReachesPlus_trans (sqReachesPlus_trans h1 h2) h3) h4 + rwa [show 3 + 2 * m' + 2 = 2 * (m' + 1) + 3 by omega] at htot + +structure OddState where + a : ℕ + b : ℕ + c : ℕ + d : ℕ + deriving DecidableEq, Repr + +def InSodd (s : OddState) : Prop := + s.a % 2 = 1 ∧ s.b ≥ 1 ∧ s.c ≥ 3 ∧ s.c % 2 = 1 ∧ (s.d = 0 ∨ s.d = 2) + +theorem phase1_to_M2 (s : OddState) (hs : InSodd s) : + SqReachesPlus + (enc_odd s.a s.b s.c s.d) + (M2_sq (2 * (s.b / 2)) + (if (s.b % 2 = 0 ∧ s.d = 0) ∨ (s.b % 2 = 1 ∧ s.d = 2) then s.c else s.c - 1) + (if s.b % 2 = 0 ∧ s.d = 0 then s.a else s.a + 2) + (2 - s.d)) := by + rcases hs with ⟨ha_odd, hb_ge1, hc_ge3, hc_odd, hd⟩ + have ha_eq : s.a = 2 * (s.a / 2) + 1 := by omega + have hc_eq : s.c = 2 * (s.c / 2) + 1 := by omega + set m := s.a / 2 + set sc := s.c / 2 + rcases Nat.mod_two_eq_zero_or_one s.b with hb_ev | hb_od + · -- s.b even >= 2: write s.b = 2 * r + 2 + have hb_eq : s.b = 2 * (s.b / 2 - 1) + 2 := by omega + set r := s.b / 2 - 1 + have hq : 2 * (s.b / 2) = 2 * r + 2 := by omega + set w1 := if s.d = 0 then 2 * sc else 2 * sc + 1 + set dp := 2 - s.d + have hstep1 : SqReachesPlus (enc_odd s.a s.b s.c s.d) (J_even m r w1 1 dp) := by + rw [ha_eq, hb_eq, hc_eq] + exact enc_odd_even_b_step1 m r sc s.d hd + have hdp : dp = 0 ∨ dp = 2 := by dsimp [dp]; omega + have hpsi1 : psiTilde w1 1 = (if s.d = 0 then 2 * sc + 1 else 2 * sc, if s.d = 0 then 1 else 3) := by + ext <;> dsimp only [w1, psiTilde] <;> split_ifs <;> omega + have hJ : SqReachesPlus (J_even m r w1 1 dp) + (M2_sq (2 * r + 2) (psiTilde w1 1).1 ((psiTilde w1 1).2 + 2 * m) dp) := by + rcases m with _ | m1 + · exact J_even_zero_to_M2 r w1 1 dp (by decide) hdp + · rcases m1 with _ | m2 + · have hj1 := J_even_succ_to_J_odd 0 r w1 1 dp (by decide) hdp + have hj2 := J_odd_zero_to_M2 r (psiTilde w1 1).1 (psiTilde w1 1).2 dp (psiTilde_snd_odd w1 1 (by decide)) hdp + exact sqReachesPlus_trans hj1 hj2 + · have hj1 := J_even_succ_to_J_odd (m2 + 1) r w1 1 dp (by decide) hdp + have hj2 := J_odd_succ_to_F m2 r (psiTilde w1 1).1 (psiTilde w1 1).2 dp (psiTilde_snd_odd w1 1 (by decide)) hdp + rw [psiTilde_psiTilde] at hj2 + have hj3 := F_universal_drain m2 r 0 w1 3 dp (by decide) hdp + have hpsi3 : psiTilde w1 3 = ((psiTilde w1 1).1, (psiTilde w1 1).2 + 2) := by + rw [show (3 : ℕ) = 1 + 2 by rfl, psiTilde_add_two, psiShift_eq_psiTilde_step] + rw [hpsi3] at hj3 + have htotJ := sqReachesPlus_trans (sqReachesPlus_trans hj1 hj2) hj3 + rwa [show (psiTilde w1 1).2 + 2 + 2 * (m2 + 0 + 1) = (psiTilde w1 1).2 + 2 * (m2 + 2) by omega] at htotJ + have htot := sqReachesPlus_trans hstep1 hJ + rw [hpsi1, ← hq] at htot + have hw_eq : (if s.d = 0 then 2 * sc + 1 else 2 * sc) = + (if (s.b % 2 = 0 ∧ s.d = 0) ∨ (s.b % 2 = 1 ∧ s.d = 2) then s.c else s.c - 1) := by + split_ifs <;> omega + have hz_eq : (if s.d = 0 then 1 else 3) + 2 * m = + (if s.b % 2 = 0 ∧ s.d = 0 then s.a else s.a + 2) := by + split_ifs <;> omega + rwa [hw_eq, hz_eq] at htot + · -- s.b odd >= 1: split s.b = 1 vs s.b = 2 * r + 3 + rcases (show s.b = 1 ∨ s.b ≥ 3 by omega) with hb1 | hb3 + · rcases hd with hd0 | hd2 + · have hq0 : 2 * (s.b / 2) = 0 := by omega + have hw0 : (if (s.b % 2 = 0 ∧ s.d = 0) ∨ (s.b % 2 = 1 ∧ s.d = 2) then s.c else s.c - 1) = 2 * sc := by + split_ifs <;> omega + have hz0 : (if s.b % 2 = 0 ∧ s.d = 0 then s.a else s.a + 2) = 2 * m + 3 := by + split_ifs <;> omega + have hd0' : 2 - s.d = 2 := by omega + rw [hq0, hw0, hz0, hd0', ha_eq, hb1, hc_eq, hd0] + exact phase1_b1_d0 m sc + · have h1 := enc_odd_b1_step1 m sc 2 (Or.inr rfl) + simp only [R_mid, show (2 : ℕ) ≠ 0 by decide, ↓reduceIte, show 2 * sc + 1 - 1 = 2 * sc by omega] at h1 + have h2 := H_drain m (2 * sc) 1 0 (by decide) (Or.inl rfl) + have hpsi : psiTilde (2 * sc) 1 = (2 * sc + 1, 1) := by + unfold psiTilde; rw [if_pos (by omega)] + rw [hpsi] at h2 + have htot : SqReachesPlus (enc_odd (2 * m + 1) 1 (2 * sc + 1) 2) (M2_sq 0 (2 * sc + 1) (1 + 2 * m + 2) 0) := + sqReachesPlus_trans h1 h2 + have hq0 : 2 * (s.b / 2) = 0 := by omega + have hw0 : (if (s.b % 2 = 0 ∧ s.d = 0) ∨ (s.b % 2 = 1 ∧ s.d = 2) then s.c else s.c - 1) = 2 * sc + 1 := by + split_ifs <;> omega + have hz0 : (if s.b % 2 = 0 ∧ s.d = 0 then s.a else s.a + 2) = 1 + 2 * m + 2 := by + split_ifs <;> omega + have hd2' : 2 - s.d = 0 := by omega + rw [hq0, hw0, hz0, hd2', ha_eq, hb1, hc_eq, hd2] + exact htot + · have hb_eq : s.b = 2 * (s.b / 2 - 1) + 3 := by omega + set r := s.b / 2 - 1 + have hq : 2 * (s.b / 2) = 2 * r + 2 := by omega + set w1 := if s.d = 0 then 2 * sc else 2 * sc + 1 + set dp := 2 - s.d + have hstep1 : SqReachesPlus (enc_odd s.a s.b s.c s.d) (J_odd m r w1 1 dp) := by + rw [ha_eq, hb_eq, hc_eq] + exact enc_odd_odd_b_step1 m r sc s.d hd + have hdp : dp = 0 ∨ dp = 2 := by dsimp [dp]; omega + have hJ : SqReachesPlus (J_odd m r w1 1 dp) (M2_sq (2 * r + 2) w1 (2 * m + 3) dp) := by + rcases m with _ | m1 + · exact J_odd_zero_to_M2 r w1 1 dp (by decide) hdp + · have hj1 := J_odd_succ_to_F m1 r w1 1 dp (by decide) hdp + have hj2 := F_universal_drain m1 r 0 (psiTilde w1 1).1 (psiTilde w1 1).2 dp + (psiTilde_snd_odd w1 1 (by decide)) hdp + rw [psiTilde_psiTilde] at hj2 + have htotJ := sqReachesPlus_trans hj1 hj2 + rwa [show 1 + 2 + 2 * (m1 + 0 + 1) = 2 * (m1 + 1) + 3 by omega] at htotJ + have htot := sqReachesPlus_trans hstep1 hJ + rw [← hq] at htot + have hw_eq : w1 = (if (s.b % 2 = 0 ∧ s.d = 0) ∨ (s.b % 2 = 1 ∧ s.d = 2) then s.c else s.c - 1) := by + dsimp only [w1]; split_ifs <;> omega + have hz_eq : 2 * m + 3 = (if s.b % 2 = 0 ∧ s.d = 0 then s.a else s.a + 2) := by + split_ifs <;> omega + rwa [hw_eq, hz_eq] at htot + +-- Phase 2: M2_sq (2 * (k - 1)) w Z d -> enc_odd / enc_even + +theorem M2_ge4_to_G (m w Z d : ℕ) (hZ : Z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus (M2_sq (2 * m + 4) w Z d) (G_sq (2 * m) 1 w (Z + 2) d) := by + set wt := (psiTilde w Z).1 + set Zt := (psiTilde w Z).2 + have hb1 : SqReachesPlus (M2_sq (2 * m + 4) w Z d) + (3 :: (List.replicate (2 * m + 2) 1 ++ (2 :: 1 :: R_tail wt Zt d))) := by + apply bounce_from_A0A2 + have h1 := prefix_M2_scan (m + 1) [] (R_tail w Z d) + have h2 := sep_0 w Z d hZ hd (stackP1 (m + 1) []) + have h3 := prefix_P1_pop (m + 1) [] (2 :: 1 :: R_tail wt Zt d) + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3 + have hb2 : SqReachesPlus + (3 :: (List.replicate (2 * m + 2) 1 ++ (2 :: 1 :: R_tail wt Zt d))) + (G_sq (2 * m) 1 w (Z + 2) d) := by + apply bounce_from_A0A2 + have h1 := prefix_M2_scan m [] (1 :: R_tail wt Zt d) + have h2 := sep_even_01 0 (stackP1 m []) wt Zt d (psiTilde_snd_odd w Z hZ) hd + rw [psiTilde_psiTilde] at h2 + have h3 := prefix_P1_pop m [] (3 :: [1] ++ (0 :: R_tail w (Z + 2) d)) + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3 + exact sqReachesPlus_trans hb1 hb2 + +theorem loop_L1G (v j w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (G_sq (2 * v + 4) (2 * j + 1) w z d) + (G_sq (2 * v) (2 * j + 3) w (z + 2) d) := by + set wt := (psiTilde w z).1 + set zt := (psiTilde w z).2 + have hb1 : SqReachesPlus + (G_sq (2 * v + 4) (2 * j + 1) w z d) + (3 :: (List.replicate (2 * v + 2) 1 ++ (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))))) := by + apply bounce_from_A0A2 + have h1 := prefix_P1_scan (v + 1) [] (List.replicate (2 * j + 1) 1 ++ (0 :: R_tail w z d)) + rw [cons_replicate_odd_append j 1 (0 :: R_tail w z d)] at h1 + have h2 := sep_even_0 j (stackP1 (v + 1) []) w z d hz hd + have h3 := prefix_P1_pop (v + 1) [] (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))) + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3 + have hb2 : SqReachesPlus + (3 :: (List.replicate (2 * v + 2) 1 ++ (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))))) + (G_sq (2 * v) (2 * j + 3) w (z + 2) d) := by + apply bounce_from_A0A2 + have h1 := prefix_P1_scan v [] (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d)) + rw [cons_replicate_odd_append j 1 (0 :: 1 :: R_tail wt zt d)] at h1 + have h2 := sep_even_01 (j + 1) (stackP1 v []) wt zt d (psiTilde_snd_odd w z hz) hd + rw [psiTilde_psiTilde] at h2 + have h3 := prefix_P1_pop v [] (3 :: (List.replicate (2 * j + 3) 1 ++ (0 :: R_tail w (z + 2) d))) + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3 + exact sqReachesPlus_trans hb1 hb2 + +theorem G_even_0_exit (j w z d : ℕ) : + SqReachesPlus (G_sq 0 (2 * j + 1) w z d) (enc_odd (2 * j + 3) (w + 1) z d) := by + have hb1 : SqReachesPlus (G_sq 0 (2 * j + 1) w z d) + (List.replicate (2 * (j + 1) + 1) 1 ++ (0 :: 3 :: TailWord w z d)) := by + have hd3 : SqReachesPlus (G_sq 0 (2 * j + 1) w z d) + (1 :: 1 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 3 :: TailWord w z d))) := + double3_reduction (List.replicate (2 * j + 1) 1 ++ (0 :: 3 :: TailWord w z d)) + have heq1 : 1 :: 1 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 3 :: TailWord w z d)) = + List.replicate (2 * (j + 1) + 1) 1 ++ (0 :: 3 :: TailWord w z d) := by + rw [show 2 * (j + 1) + 1 = 2 + (2 * j + 1) by omega] + simp [List.replicate_add, List.cons_append] + rwa [heq1] at hd3 + have hb2 := exit_odd_0_3 (j + 1) (TailWord w z d) + have heq : 3 :: (List.replicate (2 * (j + 1) + 1) 1 ++ (0 :: 1 :: TailWord w z d)) = + enc_odd (2 * j + 3) (w + 1) z d := by + rw [show 2 * (j + 1) + 1 = 2 * j + 3 by omega] + simp only [enc_odd, TailWord, List.replicate_succ, List.cons_append] + rw [heq] at hb2 + exact sqReachesPlus_trans hb1 hb2 + +theorem G_even_2_exit (j w z d : ℕ) (hz : z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (G_sq 2 (2 * j + 1) w z d) + (enc_even (2 * j + 4) (psiTilde w z).1 (psiTilde w z).2 d) := by + set wt := (psiTilde w z).1 + set zt := (psiTilde w z).2 + have hb1 : SqReachesPlus (G_sq 2 (2 * j + 1) w z d) + (3 :: 3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))) := by + apply bounce_from_A0A2 + have h1 := prefix_P1_scan 0 [] (List.replicate (2 * j + 1) 1 ++ (0 :: R_tail w z d)) + rw [cons_replicate_odd_append j 1 (0 :: R_tail w z d)] at h1 + have h2 := sep_even_0 j (stackP1 0 []) w z d hz hd + have h3 := prefix_P1_pop 0 [] (3 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d))) + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3 + have hb2 := double3_reduction (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d)) + have heq : 1 :: 1 :: (List.replicate (2 * j + 1) 1 ++ (0 :: 1 :: R_tail wt zt d)) = + enc_even (2 * j + 4) wt zt d := by + rw [enc_even, show 2 * j + 4 - 1 = (2 * j + 1) + 1 + 1 by omega] + simp only [List.replicate_succ, List.cons_append] + rw [heq] at hb2 + exact sqReachesPlus_trans hb1 hb2 + +theorem M2_0_exit (w Z d : ℕ) : + SqReachesPlus (M2_sq 0 w Z d) (enc_odd 1 (w + 1) Z d) := by + have hb1 : SqReachesPlus (M2_sq 0 w Z d) (1 :: 0 :: 3 :: TailWord w Z d) := + exit_3_2 (3 :: TailWord w Z d) + have hb2 : SqReachesPlus (1 :: 0 :: 3 :: TailWord w Z d) + (3 :: (1 :: 0 :: 1 :: TailWord w Z d)) := exit_odd_0_3 0 (TailWord w Z d) + have heq : 3 :: (1 :: 0 :: 1 :: TailWord w Z d) = enc_odd 1 (w + 1) Z d := by + simp only [enc_odd, TailWord, List.replicate_succ, List.replicate_zero, + List.cons_append, List.nil_append] + rw [heq] at hb2 + exact sqReachesPlus_trans hb1 hb2 + +theorem M2_2_exit (w Z d : ℕ) (hZ : Z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus (M2_sq 2 w Z d) (enc_even 2 (psiTilde w Z).1 (psiTilde w Z).2 d) := by + set wt := (psiTilde w Z).1 + set Zt := (psiTilde w Z).2 + have hb1 : SqReachesPlus (M2_sq 2 w Z d) (3 :: 2 :: 1 :: R_tail wt Zt d) := by + apply bounce_from_A0A2 + have h1 := prefix_M2_scan 0 [] (R_tail w Z d) + have h2 := sep_0 w Z d hZ hd (stackP1 0 []) + have h3 := prefix_P1_pop 0 [] (2 :: 1 :: R_tail wt Zt d) + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans h1 h2) h3 + have hb2 := exit_3_2 (1 :: R_tail wt Zt d) + exact sqReachesPlus_trans hb1 hb2 + +theorem G_even_drain_0 (r j w Z d : ℕ) (hZ : Z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus (G_sq (4 * r) (2 * j + 1) w Z d) (enc_odd (2 * (j + r) + 3) (w + 1) (Z + 2 * r) d) := by + induction r generalizing j Z with + | zero => exact G_even_0_exit j w Z d + | succ r ih => + have h1 : SqReachesPlus (G_sq (4 * (r + 1)) (2 * j + 1) w Z d) (G_sq (4 * r) (2 * (j + 1) + 1) w (Z + 2) d) := by + have hl := loop_L1G (2 * r) j w Z d hZ hd + rwa [show 2 * (2 * r) + 4 = 4 * (r + 1) by omega, show 2 * (2 * r) = 4 * r by omega] at hl + have h2 := ih (j + 1) (Z + 2) (by omega) + have htot := sqReachesPlus_trans h1 h2 + rwa [show 2 * (j + 1 + r) + 3 = 2 * (j + (r + 1)) + 3 by omega, + show Z + 2 + 2 * r = Z + 2 * (r + 1) by omega] at htot + +theorem G_even_drain_2 (r j w Z d : ℕ) (hZ : Z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (G_sq (4 * r + 2) (2 * j + 1) w Z d) + (enc_even (2 * (j + r) + 4) (psiTilde w Z).1 ((psiTilde w Z).2 + 2 * r) d) := by + induction r generalizing j Z with + | zero => exact G_even_2_exit j w Z d hZ hd + | succ r ih => + have h1 : SqReachesPlus (G_sq (4 * (r + 1) + 2) (2 * j + 1) w Z d) (G_sq (4 * r + 2) (2 * (j + 1) + 1) w (Z + 2) d) := by + have hl := loop_L1G (2 * r + 1) j w Z d hZ hd + rwa [show 2 * (2 * r + 1) + 4 = 4 * (r + 1) + 2 by omega, show 2 * (2 * r + 1) = 4 * r + 2 by omega] at hl + have h2 := ih (j + 1) (Z + 2) (by omega) + have hpsi : psiTilde w (Z + 2) = ((psiTilde w Z).1, (psiTilde w Z).2 + 2) := by + rw [psiTilde_add_two, psiShift_eq_psiTilde_step] + rw [hpsi] at h2 + have htot := sqReachesPlus_trans h1 h2 + rwa [show 2 * (j + 1 + r) + 4 = 2 * (j + (r + 1)) + 4 by omega, + show (psiTilde w Z).2 + 2 + 2 * r = (psiTilde w Z).2 + 2 * (r + 1) by omega] at htot + +theorem phase2_odd (r w Z d : ℕ) (hZ : Z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus (M2_sq (4 * r) w Z d) (enc_odd (2 * r + 1) (w + 1) (Z + 2 * r) d) := by + rcases r with _ | r' + · exact M2_0_exit w Z d + · have h1 : SqReachesPlus (M2_sq (4 * (r' + 1)) w Z d) (G_sq (4 * r') 1 w (Z + 2) d) := by + have hm := M2_ge4_to_G (2 * r') w Z d hZ hd + rwa [show 2 * (2 * r') + 4 = 4 * (r' + 1) by omega, show 2 * (2 * r') = 4 * r' by omega] at hm + have h2 := G_even_drain_0 r' 0 w (Z + 2) d (by omega) hd + have htot := sqReachesPlus_trans h1 h2 + rwa [show 2 * (0 + r') + 3 = 2 * (r' + 1) + 1 by omega, + show Z + 2 + 2 * r' = Z + 2 * (r' + 1) by omega] at htot + +theorem phase2_even (r w Z d : ℕ) (hZ : Z % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (M2_sq (4 * r + 2) w Z d) + (enc_even (2 * r + 2) (psiTilde w Z).1 ((psiTilde w Z).2 + 2 * r) d) := by + rcases r with _ | r' + · exact M2_2_exit w Z d hZ hd + · have h1 : SqReachesPlus (M2_sq (4 * (r' + 1) + 2) w Z d) (G_sq (4 * r' + 2) 1 w (Z + 2) d) := by + have hm := M2_ge4_to_G (2 * r' + 1) w Z d hZ hd + rwa [show 2 * (2 * r' + 1) + 4 = 4 * (r' + 1) + 2 by omega, show 2 * (2 * r' + 1) = 4 * r' + 2 by omega] at hm + have h2 := G_even_drain_2 r' 0 w (Z + 2) d (by omega) hd + have hpsi : psiTilde w (Z + 2) = ((psiTilde w Z).1, (psiTilde w Z).2 + 2) := by + rw [psiTilde_add_two, psiShift_eq_psiTilde_step] + rw [hpsi] at h2 + have htot := sqReachesPlus_trans h1 h2 + rwa [show 2 * (0 + r') + 4 = 2 * (r' + 1) + 2 by omega, + show (psiTilde w Z).2 + 2 + 2 * r' = (psiTilde w Z).2 + 2 * (r' + 1) by omega] at htot + +-- Even Halving Cascade & R_odd_sound + +theorem enc_even_step1 (k' B C d : ℕ) (hB : B ≥ 1) (hC : C % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (enc_even (2 * (k' + 1)) B C d) + (M_sq (2 * k' + 1) (psiTilde (B - 1) C).1 (psiTilde (B - 1) C).2 d) := by + apply bounce_from_nil + have hrt : R_tail B C d = 3 :: 1 :: TailWord (B - 1) C d := by + have hb_eq : B = (B - 1) + 1 := by omega + dsimp only [R_tail, TailWord] + conv_lhs => rw [hb_eq, List.replicate_succ, List.cons_append] + have heq : enc_even (2 * (k' + 1)) B C d = + List.replicate (2 * k') 1 ++ (1 :: 0 :: 1 :: 3 :: 1 :: TailWord (B - 1) C d) := by + rw [enc_even, hrt, show 2 * (k' + 1) - 1 = 2 * k' + 1 by omega, replicate_succ_append] + rw [heq] + have h1 := cfgSqReachesStar_of_iterOpt + (scan_ones_h10B_any k' [] (1 :: 0 :: 1 :: 3 :: 1 :: TailWord (B - 1) C d)) + have h2 : CfgSqReachesPlus + (.h10B, stackAfterOnes k' [], 1 :: 0 :: 1 :: 3 :: 1 :: TailWord (B - 1) C d) + (.h10B, .A 1 :: .A 0 :: .B 3 :: (List.replicate k' (.B 2) ++ [.A 2]), TailWord (B - 1) C d) := + ⟨5, by decide, by simp [iterOpt, step_sq]⟩ + have h3 := tail_reflect (B - 1) C d hC hd + (.A 0 :: .B 3 :: (List.replicate k' (.B 2) ++ [.A 2])) (by simp) + have h4 : CfgSqReachesPlus + (.hL, .A 0 :: .B 3 :: (List.replicate k' (.B 2) ++ [.A 2]), + R_tail (psiTilde (B - 1) C).1 (psiTilde (B - 1) C).2 d) + (.hL, List.replicate k' (.B 2) ++ [.A 2], + 1 :: 2 :: 1 :: R_tail (psiTilde (B - 1) C).1 (psiTilde (B - 1) C).2 d) := + ⟨2, by decide, rfl⟩ + have h5 := cfgSqReachesPlus_of_iterOpt (by omega) + (pop_B2_A2_hL k' [] (1 :: 2 :: 1 :: R_tail (psiTilde (B - 1) C).1 (psiTilde (B - 1) C).2 d)) + rw [replicate_append_cons_same (2 * k')] at h5 + exact cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesPlus_trans (cfgSqReachesStar_plus_trans h1 h2) h3) h4) h5 + +theorem enc_even_to_M2 (k' B C d : ℕ) (hB : B ≥ 1) (hC : C % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (enc_even (2 * (k' + 1)) B C d) + (M2_sq (2 * k') (psiTilde (B - 1) C).1 ((psiTilde (B - 1) C).2 + 2) d) := + sqReachesPlus_trans + (enc_even_step1 k' B C d hB hC hd) + (M_sq_odd_to_M2 k' (psiTilde (B - 1) C).1 (psiTilde (B - 1) C).2 d + (psiTilde_snd_odd (B - 1) C hC) hd) + +theorem step_even_halve (r B C d : ℕ) (hB : B ≥ 1) (hC : C % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (enc_even (2 * (2 * r + 2)) B C d) + (enc_even (2 * r + 2) (B - 1) (C + (2 * r + 2) + 2) d) := by + have h1 : SqReachesPlus + (enc_even (2 * (2 * r + 2)) B C d) + (M2_sq (4 * r + 2) (psiTilde (B - 1) C).1 ((psiTilde (B - 1) C).2 + 2) d) := by + have he := enc_even_to_M2 (2 * r + 1) B C d hB hC hd + rwa [show 2 * (2 * r + 1 + 1) = 2 * (2 * r + 2) by omega, + show 2 * (2 * r + 1) = 4 * r + 2 by omega] at he + have hCt_odd : ((psiTilde (B - 1) C).2 + 2) % 2 = 1 := by + have := psiTilde_snd_odd (B - 1) C hC; omega + have h2 := phase2_even r (psiTilde (B - 1) C).1 ((psiTilde (B - 1) C).2 + 2) d hCt_odd hd + have hpsi : psiTilde (psiTilde (B - 1) C).1 ((psiTilde (B - 1) C).2 + 2) = (B - 1, C + 4) := by + rw [psiTilde_add_two] + simpa using psiShift_psiTilde_add (B - 1) C 0 + rw [hpsi] at h2 + have htot := sqReachesPlus_trans h1 h2 + rwa [show C + 4 + 2 * r = C + (2 * r + 2) + 2 by omega] at htot + +theorem step_even_exit (r B C d : ℕ) (hB : B ≥ 1) (hC : C % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesPlus + (enc_even (2 * (2 * r + 1)) B C d) + (enc_odd (2 * r + 1) ((psiTilde (B - 1) C).1 + 1) ((psiTilde (B - 1) C).2 + 2 + 2 * r) d) := by + have h1 : SqReachesPlus + (enc_even (2 * (2 * r + 1)) B C d) + (M2_sq (4 * r) (psiTilde (B - 1) C).1 ((psiTilde (B - 1) C).2 + 2) d) := by + have he := enc_even_to_M2 (2 * r) B C d hB hC hd + rwa [show 2 * (2 * r) = 4 * r by omega] at he + have hCt_odd : ((psiTilde (B - 1) C).2 + 2) % 2 = 1 := by + have := psiTilde_snd_odd (B - 1) C hC; omega + exact sqReachesPlus_trans h1 + (phase2_odd r (psiTilde (B - 1) C).1 ((psiTilde (B - 1) C).2 + 2) d hCt_odd hd) + +theorem even_cascade (t a' B C d : ℕ) (ha' : a' % 2 = 1) (hB : B ≥ t) + (hC : C % 2 = 1) (hd : d = 0 ∨ d = 2) : + SqReachesStar + (enc_even (2 ^ (t + 1) * a') B C d) + (enc_even (2 * a') (B - t) (C + (2 ^ (t + 1) - 2) * a' + 2 * t) d) := by + induction t generalizing B C with + | zero => + simpa using sqReachesStar_refl (enc_even (2 * a') B C d) + | succ t ih => + have hpow_ge : 2 ^ (t + 1) * a' ≥ 2 := by + have hp : 2 ^ (t + 1) ≥ 2 := by + rw [Nat.pow_succ'] + have := @Nat.one_le_two_pow t + omega + have ha1 : a' ≥ 1 := by omega + calc 2 ^ (t + 1) * a' ≥ 2 * 1 := Nat.mul_le_mul hp ha1 + _ = 2 := rfl + have hpow_ev : (2 ^ (t + 1) * a') % 2 = 0 := by + rw [Nat.pow_succ', Nat.mul_assoc] + omega + set r := (2 ^ (t + 1) * a' - 2) / 2 + have hr_eq : 2 ^ (t + 1) * a' = 2 * r + 2 := by omega + have hhead : 2 * (2 ^ (t + 1) * a') = 2 ^ (t + 1 + 1) * a' := by + rw [Nat.pow_succ' (n := t + 1), Nat.mul_assoc] + have h1 := sqReachesStar_of_plus (step_even_halve r B C d (by omega) hC hd) + rw [← hr_eq, hhead] at h1 + have h2 := ih (B - 1) (C + 2 ^ (t + 1) * a' + 2) (by omega) (by omega) + have hsub : B - 1 - t = B - (t + 1) := by omega + have hsum : C + 2 ^ (t + 1) * a' + 2 + (2 ^ (t + 1) - 2) * a' + 2 * t = + C + (2 ^ (t + 2) - 2) * a' + 2 * (t + 1) := by + have hp1 : 2 ^ (t + 1) ≥ 2 := by + rw [Nat.pow_succ']; have := @Nat.one_le_two_pow t; omega + have hmul : 2 ^ (t + 1) * a' + (2 ^ (t + 1) - 2) * a' = (2 ^ (t + 2) - 2) * a' := by + rw [← Nat.add_mul, show t + 2 = (t + 1) + 1 by omega, Nat.pow_succ'] + exact congrArg (· * a') (by omega) + omega + rw [hsub, hsum] at h2 + exact sqReachesStar_trans h1 h2 + +-- ---------------------------------------------------------------------------- +-- Stage 5A: OddState, R_odd, Soundness & Sandwich Bounds +-- ---------------------------------------------------------------------------- + +theorem splitTwoAux_spec (fuel m : ℕ) (hm : m ≥ 1) (hfuel : m ≤ fuel) : + 2 ^ (splitTwoAux fuel m).1 * (splitTwoAux fuel m).2 = m ∧ + (splitTwoAux fuel m).2 % 2 = 1 := by + induction fuel generalizing m with + | zero => omega + | succ fuel ih => + dsimp [splitTwoAux] + split_ifs with hev + · obtain ⟨heq, hodd⟩ := ih (m / 2) (by omega) (by omega) + refine ⟨?_, hodd⟩ + rw [Nat.pow_succ', Nat.mul_assoc, heq] + omega + · exact ⟨by simp, by omega⟩ + +theorem splitTwo_spec (m : ℕ) (hm : m ≥ 1) : + 2 ^ (splitTwo m).1 * (splitTwo m).2 = m ∧ (splitTwo m).2 % 2 = 1 := + splitTwoAux_spec m m hm (le_refl m) + +def InSdom (s : OddState) : Prop := + InSodd s ∧ s.c ≥ s.a + +def bInSdom (s : OddState) : Bool := + (s.a % 2 == 1) && (1 ≤ s.b) && (3 ≤ s.c) && (s.c % 2 == 1) && + ((s.d == 0) || (s.d == 2)) && (s.a ≤ s.c) + +theorem bInSdom_iff (s : OddState) : bInSdom s = true ↔ InSdom s := by + simp only [bInSdom, InSdom, InSodd, Bool.and_eq_true, Bool.or_eq_true, beq_iff_eq, decide_eq_true_eq] + omega + +def sigma_true (b d : ℕ) : ℕ := + if b % 4 = 1 then 0 + else if b % 4 = 0 then (if d = 0 then 1 else 0) + else if b % 4 = 2 then (if d = 0 then 1 else 0) + else (if d = 2 then 1 else 0) + +theorem sigma_true_le_one (b d : ℕ) : sigma_true b d ≤ 1 := by + unfold sigma_true; split_ifs <;> omega + +def nu_of (s : OddState) : ℕ := (splitTwo (s.b / 2 + 1)).1 + +def a_next_of (s : OddState) : ℕ := (splitTwo (s.b / 2 + 1)).2 + +def R_odd (s : OddState) : Option OddState := + let m := s.b / 2 + 1 + let ν := nu_of s + let a' := a_next_of s + let σ := sigma_true s.b s.d + if s.c < σ + ν then none + else + let M := s.c - σ - ν + let d' := 2 - s.d + if ν = 0 then + let b' := if s.b % 4 = 1 then s.c + s.d / 2 else s.c + 1 - s.d / 2 + let c' := if s.b % 4 = 1 then s.a + a' + 1 else s.a + a' - 1 + s.d + some ⟨a', b', c', d'⟩ + else + let b' := if M % 2 = 0 then M + 2 else M + let c' := 2 * m - a' + s.a + 2 * ν + + (if s.b % 2 = 1 ∧ s.d = 2 then 2 else 0) + + (if M % 2 = 0 then 0 else 2) - 1 + some ⟨a', b', c', d'⟩ + +theorem R_odd_halt_iff (s : OddState) : + R_odd s = none ↔ s.c < sigma_true s.b s.d + nu_of s := by + unfold R_odd + by_cases h1 : s.c < sigma_true s.b s.d + nu_of s + · simp [h1] + · simp only [h1, ↓reduceIte] + split_ifs <;> simp + +theorem R_odd_sound (s s' : OddState) (hs : InSodd s) (hr : R_odd s = some s') : + SqReachesPlus (enc_odd s.a s.b s.c s.d) (enc_odd s'.a s'.b s'.c s'.d) := by + have hp1 := phase1_to_M2 s hs + rcases hs with ⟨ha_odd, hb_ge1, hc_ge3, hc_odd, hd⟩ + set m := s.b / 2 + 1 + obtain ⟨hm_eq, ha'_odd⟩ : 2 ^ (nu_of s) * (a_next_of s) = m ∧ (a_next_of s) % 2 = 1 := + splitTwo_spec m (by omega) + unfold R_odd at hr + by_cases hlt : s.c < sigma_true s.b s.d + nu_of s + · simp [hlt] at hr + · simp only [hlt, ↓reduceIte] at hr + set w₁ := if (s.b % 2 = 0 ∧ s.d = 0) ∨ (s.b % 2 = 1 ∧ s.d = 2) then s.c else s.c - 1 + set Z₁ := if s.b % 2 = 0 ∧ s.d = 0 then s.a else s.a + 2 + set d' := 2 - s.d + have hd' : d' = 0 ∨ d' = 2 := by dsimp [d']; omega + have hZ₁_odd : Z₁ % 2 = 1 := by dsimp [Z₁]; split_ifs <;> omega + rcases hnu : nu_of s with _ | t + · -- ν = 0: m = a_next_of s is odd, so s.b / 2 = 2 * ((a' - 1) / 2) + simp only [hnu, ↓reduceIte, Option.some.injEq] at hr + subst hr + rw [hnu, Nat.pow_zero, Nat.one_mul] at hm_eq + set r := (a_next_of s - 1) / 2 + have ha'_eq : a_next_of s = 2 * r + 1 := by omega + have hqb : 2 * (s.b / 2) = 4 * r := by omega + rw [hqb] at hp1 + have hp2 := phase2_odd r w₁ Z₁ d' hZ₁_odd hd' + have htot := sqReachesPlus_trans hp1 hp2 + have hbw : w₁ + 1 = (if s.b % 4 = 1 then s.c + s.d / 2 else s.c + 1 - s.d / 2) := by + dsimp [w₁] + rcases hd with hd0 | hd2 <;> (split_ifs <;> omega) + have hcz : Z₁ + 2 * r = (if s.b % 4 = 1 then s.a + a_next_of s + 1 else s.a + a_next_of s - 1 + s.d) := by + dsimp [Z₁] + rcases hd with hd0 | hd2 <;> (split_ifs <;> omega) + rw [← ha'_eq, hbw, hcz] at htot + exact htot + · -- ν = t + 1 ≥ 1: m = 2 ^ (t + 1) * a' is even + simp only [hnu, Nat.succ_ne_zero, ↓reduceIte, Option.some.injEq] at hr + subst hr + rw [hnu] at hm_eq hlt + have hm_ev : m % 2 = 0 := by + rw [← hm_eq, Nat.pow_succ', Nat.mul_assoc]; omega + have hm_ge2 : m ≥ 2 := by omega + set r₀ := (m - 2) / 2 + have hqb : 2 * (s.b / 2) = 4 * r₀ + 2 := by omega + have hr0_m : 2 * r₀ + 2 = m := by omega + rw [hqb] at hp1 + have hp2 := phase2_even r₀ w₁ Z₁ d' hZ₁_odd hd' + rw [hr0_m] at hp2 + -- Evaluate psiTilde w₁ Z₁: since m is even, s.b / 2 is odd, so s.b % 4 ∈ {2, 3}! + have hb_mod4 : s.b % 4 = 2 ∨ s.b % 4 = 3 := by omega + have hsig_eq : sigma_true s.b s.d = + if (s.b % 4 = 2 ∧ s.d = 0) ∨ (s.b % 4 = 3 ∧ s.d = 2) then 1 else 0 := by + unfold sigma_true; split_ifs <;> omega + have hw1_val : (w₁ = s.c ∧ sigma_true s.b s.d = 1) ∨ + (w₁ = s.c - 1 ∧ sigma_true s.b s.d = 0) := by + rw [hsig_eq]; dsimp only [w₁]; split_ifs <;> omega + have hB0 : (psiTilde w₁ Z₁).1 = s.c - sigma_true s.b s.d := by + rcases hw1_val with ⟨hw, hs_eq⟩ | ⟨hw, hs_eq⟩ <;> + (rw [hw, hs_eq]; dsimp only [psiTilde]; split_ifs <;> omega) + have hC0 : (psiTilde w₁ Z₁).2 + 2 * r₀ = + m + s.a + (if s.b % 2 = 1 ∧ s.d = 2 then 2 else 0) := by + have hwZ : (w₁ = s.c ∧ Z₁ = s.a ∧ ¬(s.b % 2 = 1 ∧ s.d = 2)) ∨ + (w₁ = s.c - 1 ∧ Z₁ = s.a + 2 ∧ ¬(s.b % 2 = 1 ∧ s.d = 2)) ∨ + (w₁ = s.c ∧ Z₁ = s.a + 2 ∧ (s.b % 2 = 1 ∧ s.d = 2)) := by + dsimp only [w₁, Z₁]; split_ifs <;> omega + rcases hwZ with ⟨hw, hZ, hbd⟩ | ⟨hw, hZ, hbd⟩ | ⟨hw, hZ, hbd⟩ + · rw [hw, hZ, if_neg hbd]; dsimp only [psiTilde]; split_ifs <;> omega + · rw [hw, hZ, if_neg hbd]; dsimp only [psiTilde]; split_ifs <;> omega + · rw [hw, hZ, if_pos hbd]; dsimp only [psiTilde]; split_ifs <;> omega + rw [hB0, hC0] at hp2 + set B₀ := s.c - sigma_true s.b s.d + set C₀ := m + s.a + (if s.b % 2 = 1 ∧ s.d = 2 then 2 else 0) + have hC0_odd : C₀ % 2 = 1 := by dsimp [C₀]; split_ifs <;> omega + have hB0_ge : B₀ ≥ t + 1 := by dsimp [B₀]; omega + rw [← hm_eq] at hp2 + have hcas := even_cascade t (a_next_of s) B₀ C₀ d' ha'_odd (by omega) hC0_odd hd' + set r' := (a_next_of s - 1) / 2 + have ha'_eq : a_next_of s = 2 * r' + 1 := by omega + set Ct := C₀ + (2 ^ (t + 1) - 2) * (a_next_of s) + 2 * t + have hCt_odd : Ct % 2 = 1 := by + dsimp [Ct] + have : ((2 ^ (t + 1) - 2) * a_next_of s) % 2 = 0 := by + have hp2_ge : 2 ^ (t + 1) ≥ 2 := by + rw [Nat.pow_succ']; have := @Nat.one_le_two_pow t; omega + have hev2 : (2 ^ (t + 1) - 2) % 2 = 0 := by + rw [Nat.pow_succ']; omega + rw [Nat.mul_mod, hev2, Nat.zero_mul] + omega + have hexit := step_even_exit r' (B₀ - t) Ct d' (by omega) hCt_odd hd' + rw [← ha'_eq] at hexit + have htot := sqReachesPlus_trans (sqReachesPlus_trans hp1 (sqReachesPlus_star_trans hp2 hcas)) hexit + set M := s.c - sigma_true s.b s.d - (t + 1) + have hBt : B₀ - t - 1 = M := by dsimp [B₀, M]; omega + rw [hBt] at htot + have hb_final : (psiTilde M Ct).1 + 1 = (if M % 2 = 0 then M + 2 else M) := by + dsimp [psiTilde]; split_ifs <;> omega + have hc_final : (psiTilde M Ct).2 + 2 + 2 * r' = + 2 * m - a_next_of s + s.a + 2 * (t + 1) + + (if s.b % 2 = 1 ∧ s.d = 2 then 2 else 0) + + (if M % 2 = 0 then 0 else 2) - 1 := by + have hm_sub : (2 ^ (t + 1) - 2) * a_next_of s = m - 2 * a_next_of s := by + rw [Nat.sub_mul, hm_eq] + dsimp [psiTilde, Ct, C₀] + rw [hm_sub] + have hm_ge_2a : m ≥ 2 * a_next_of s := by + rw [← hm_eq, Nat.pow_succ', Nat.mul_assoc] + exact Nat.mul_le_mul_left 2 (by + calc 2 ^ t * a_next_of s ≥ 1 * a_next_of s := Nat.mul_le_mul_right _ Nat.one_le_two_pow + _ = a_next_of s := Nat.one_mul _) + split_ifs <;> omega + rw [hb_final, hc_final] at htot + exact htot + +theorem R_odd_props (s s' : OddState) (hs : InSdom s) (hr : R_odd s = some s') : + InSdom s' ∧ + s'.a = a_next_of s ∧ + 2 ^ (nu_of s + 1) * s'.a = 2 * (s.b / 2 + 1) ∧ + 2 * (s.b / 2 + 1) - 2 ≤ s.b ∧ s.b ≤ 2 * (s.b / 2 + 1) - 1 ∧ + s.b + s.a + 2 * nu_of s ≤ 2 * s'.c ∧ + 2 ^ (nu_of s + 1) ≤ s.b + 2 ∧ + (nu_of s = 0 → + s.c ≤ s'.b ∧ s'.b ≤ s.c + 1 ∧ + s.a + s'.a - 1 ≤ s'.c ∧ s'.c ≤ s.a + s'.a + 1) ∧ + (nu_of s ≥ 1 → + s'.b + nu_of s - 2 ≤ s.c ∧ s.c ≤ s'.b + nu_of s + 1 ∧ + 2 * (s.b / 2 + 1) - s'.a + s.a + 2 * nu_of s - 1 ≤ s'.c ∧ + s'.c ≤ 2 * (s.b / 2 + 1) - s'.a + s.a + 2 * nu_of s + 3) := by + rcases hs with ⟨⟨ha_odd, hb_ge1, hc_ge3, hc_odd, hd⟩, hca⟩ + set m := s.b / 2 + 1 + obtain ⟨hm_eq, ha'_odd⟩ : 2 ^ (nu_of s) * (a_next_of s) = m ∧ (a_next_of s) % 2 = 1 := + splitTwo_spec m (by omega) + have h2m : 2 ^ (nu_of s + 1) * a_next_of s = 2 * m := by + rw [Nat.pow_succ', Nat.mul_assoc, hm_eq] + have hsig := sigma_true_le_one s.b s.d + unfold R_odd at hr + by_cases hlt : s.c < sigma_true s.b s.d + nu_of s + · simp [hlt] at hr + · simp only [hlt, ↓reduceIte] at hr + by_cases hnu0 : nu_of s = 0 + · simp only [hnu0, ↓reduceIte, Option.some.injEq] at hr + rw [hnu0, Nat.pow_zero, Nat.one_mul] at hm_eq + have hb4_cases : + (s.b % 4 = 1 ∧ s' = ⟨a_next_of s, s.c + s.d / 2, s.a + a_next_of s + 1, 2 - s.d⟩) ∨ + (s.b % 4 ≠ 1 ∧ s' = ⟨a_next_of s, s.c + 1 - s.d / 2, s.a + a_next_of s - 1 + s.d, 2 - s.d⟩) := by + by_cases hb4 : s.b % 4 = 1 + · rw [if_pos hb4, if_pos hb4] at hr; exact Or.inl ⟨hb4, hr.symm⟩ + · rw [if_neg hb4, if_neg hb4] at hr; exact Or.inr ⟨hb4, hr.symm⟩ + rcases hb4_cases with ⟨hb4, rfl⟩ | ⟨hb4, rfl⟩ <;> rcases hd with hd0 | hd2 + all_goals + dsimp only [InSdom, InSodd] + refine ⟨⟨⟨ha'_odd, by omega, by omega, by omega, by omega⟩, by omega⟩, + rfl, h2m, by omega, by omega, by omega, by rw [hnu0]; omega, + fun _ => ⟨by omega, by omega, by omega, by omega⟩, fun hge => by omega⟩ + · simp only [hnu0, ↓reduceIte, Option.some.injEq] at hr + have hnu_ge1 : nu_of s ≥ 1 := by omega + have hm_ge_2a : m ≥ 2 * a_next_of s := by + rw [← hm_eq] + obtain ⟨t, ht⟩ : ∃ t, nu_of s = t + 1 := ⟨nu_of s - 1, by omega⟩ + rw [ht, Nat.pow_succ', Nat.mul_assoc] + exact Nat.mul_le_mul_left 2 (by + calc 2 ^ t * a_next_of s ≥ 1 * a_next_of s := Nat.mul_le_mul_right _ Nat.one_le_two_pow + _ = a_next_of s := Nat.one_mul _) + have hpow_le : 2 ^ (nu_of s + 1) ≤ 2 * m := by + rw [← h2m] + calc 2 ^ (nu_of s + 1) = 2 ^ (nu_of s + 1) * 1 := (Nat.mul_one _).symm + _ ≤ 2 ^ (nu_of s + 1) * a_next_of s := Nat.mul_le_mul_left _ (by omega) + set M := s.c - sigma_true s.b s.d - nu_of s + have hM_def : M = s.c - sigma_true s.b s.d - nu_of s := rfl + have hs'_cases : + (M % 2 = 0 ∧ (s.b % 2 = 1 ∧ s.d = 2) ∧ + s' = ⟨a_next_of s, M + 2, 2 * m - a_next_of s + s.a + 2 * nu_of s + 2 + 0 - 1, 2 - s.d⟩) ∨ + (M % 2 = 0 ∧ ¬(s.b % 2 = 1 ∧ s.d = 2) ∧ + s' = ⟨a_next_of s, M + 2, 2 * m - a_next_of s + s.a + 2 * nu_of s + 0 + 0 - 1, 2 - s.d⟩) ∨ + (M % 2 ≠ 0 ∧ (s.b % 2 = 1 ∧ s.d = 2) ∧ + s' = ⟨a_next_of s, M, 2 * m - a_next_of s + s.a + 2 * nu_of s + 2 + 2 - 1, 2 - s.d⟩) ∨ + (M % 2 ≠ 0 ∧ ¬(s.b % 2 = 1 ∧ s.d = 2) ∧ + s' = ⟨a_next_of s, M, 2 * m - a_next_of s + s.a + 2 * nu_of s + 0 + 2 - 1, 2 - s.d⟩) := by + by_cases hM : M % 2 = 0 <;> by_cases hbd : s.b % 2 = 1 ∧ s.d = 2 + · rw [if_pos hM, if_pos hbd, if_pos hM] at hr; exact Or.inl ⟨hM, hbd, hr.symm⟩ + · rw [if_pos hM, if_neg hbd, if_pos hM] at hr; exact Or.inr (Or.inl ⟨hM, hbd, hr.symm⟩) + · rw [if_neg hM, if_pos hbd, if_neg hM] at hr; exact Or.inr (Or.inr (Or.inl ⟨hM, hbd, hr.symm⟩)) + · rw [if_neg hM, if_neg hbd, if_neg hM] at hr; exact Or.inr (Or.inr (Or.inr ⟨hM, hbd, hr.symm⟩)) + rcases hs'_cases with ⟨hM, hbd, rfl⟩ | ⟨hM, hbd, rfl⟩ | ⟨hM, hbd, rfl⟩ | ⟨hM, hbd, rfl⟩ + all_goals + dsimp only [InSdom, InSodd] + refine ⟨⟨⟨ha'_odd, by omega, by omega, by omega, by omega⟩, by omega⟩, + rfl, h2m, by omega, by omega, by omega, by omega, + fun hz => absurd hz hnu0, + fun _ => ⟨by omega, by omega, by omega, by omega⟩⟩ + +-- ---------------------------------------------------------------------------- +-- Stage 5B: Two-Step 2-Adic Collapse Bounds (halt_3 & halt_5) +-- ---------------------------------------------------------------------------- + +theorem pow_two_ge_succ (n : ℕ) : 2 ^ n ≥ n + 1 := by + induction n with + | zero => decide + | succ n ih => rw [Nat.pow_succ']; omega + +theorem pow_two_ge_8 (E : ℕ) (hE : E ≥ 3) : 2 ^ (E + 1) ≥ 8 * E - 8 := by + induction E with + | zero => omega + | succ E ih => + rcases (show E = 2 ∨ E ≥ 3 by omega) with rfl | hge + · decide + · have := ih hge; rw [Nat.pow_succ']; omega + +theorem pow_two_ge_14 (E : ℕ) (hE : E ≥ 3) : 2 ^ (E + 1) ≥ 14 * E - 26 := by + induction E with + | zero => omega + | succ E ih => + rcases (show E = 2 ∨ E ≥ 3 by omega) with rfl | hge + · decide + · have := ih hge; rw [Nat.pow_succ']; omega + +theorem pow_two_ge_16 (n : ℕ) (hn : n ≥ 5) : 2 ^ (n + 1) ≥ 16 * n - 16 := by + induction n with + | zero => omega + | succ n ih => + rcases (show n = 4 ∨ n ≥ 5 by omega) with rfl | hge + · decide + · have := ih hge; rw [Nat.pow_succ']; omega + +theorem sq_lt_pow2_succ (E : ℕ) (hE : E ≥ 3) : E * E < 2 ^ (E + 1) := by + induction E with + | zero => omega + | succ E ih => + rcases (show E = 2 ∨ E ≥ 3 by omega) with rfl | hge + · decide + · have h1 := ih hge + have h2 := pow_two_ge_8 E hge + have hexp : (E + 1) * (E + 1) = E * E + 2 * E + 1 := by ring + rw [Nat.pow_succ', hexp]; omega + +theorem quad_step1_lt (E : ℕ) (hE : E ≥ 8) : (5 * E + 5) * E < 2 ^ (E + 1) := by + induction E with + | zero => omega + | succ E ih => + rcases (show E = 7 ∨ E = 8 ∨ E ≥ 9 by omega) with rfl | rfl | hge + · decide + · decide + · have h1 := ih (by omega) + have h2 := pow_two_ge_14 E (by omega) + have hexp : (5 * (E + 1) + 5) * (E + 1) = (5 * E + 5) * E + 10 * E + 10 := by ring + rw [Nat.pow_succ', hexp]; omega + +theorem quad_step2a_lt (ν : ℕ) (hν : ν ≥ 10) : (3 * ν + 6) * (3 * ν + 7) < 2 ^ (ν + 1) := by + induction ν with + | zero => omega + | succ ν ih => + rcases (show ν = 9 ∨ ν ≥ 10 by omega) with rfl | hge + · decide + · have h1 := ih hge + have h2 := pow_two_ge_16 ν (by omega) + have hexp : (3 * (ν + 1) + 6) * (3 * (ν + 1) + 7) = + (3 * ν + 6) * (3 * ν + 7) + 18 * ν + 48 := by ring + have h3 : 2 ^ (ν + 1) > 18 * ν + 48 := by + rcases (show ν = 10 ∨ ν ≥ 11 by omega) with rfl | h11 + · decide + · obtain ⟨k, rfl⟩ : ∃ k, ν = k + 6 := ⟨ν - 6, by omega⟩ + have hk := pow_two_ge_16 (k + 5) (by omega) + have : 2 ^ (k + 6 + 1) = 2 * 2 ^ (k + 5 + 1) := by + rw [show k + 6 + 1 = (k + 5 + 1) + 1 by omega, Nat.pow_succ'] + omega + rw [Nat.pow_succ', hexp]; omega + +theorem quad_step2b_lt (ν : ℕ) (hν : ν ≥ 11) : (6 * ν + 11) * (3 * ν + 8) < 2 ^ (ν + 1) := by + have hlin : ∀ n, n ≥ 11 → 2 ^ (n + 1) > 36 * n + 99 := by + intro n + induction n with + | zero => omega + | succ n ih => + intro hn + rcases (show n = 10 ∨ n ≥ 11 by omega) with rfl | hge + · decide + · have := ih hge; rw [Nat.pow_succ']; omega + induction ν with + | zero => omega + | succ ν ih => + rcases (show ν = 10 ∨ ν ≥ 11 by omega) with rfl | hge + · decide + · have h1 := ih hge + have h2 := hlin ν hge + have hexp : (6 * (ν + 1) + 11) * (3 * (ν + 1) + 8) = + (6 * ν + 11) * (3 * ν + 8) + 36 * ν + 99 := by ring + rw [Nat.pow_succ', hexp]; omega + +theorem pow2_dvd_diff_ge {u w₁ w₂ x₁ x₂ : ℕ} (hu1 : u ≤ w₁) (hu2 : u ≤ w₂) + (hlt : 2 ^ w₁ * x₁ < 2 ^ w₂ * x₂) : + 2 ^ u ≤ 2 ^ w₂ * x₂ - 2 ^ w₁ * x₁ := by + have hw1 : 2 ^ w₁ * x₁ = 2 ^ u * (2 ^ (w₁ - u) * x₁) := by + conv_lhs => rw [show w₁ = u + (w₁ - u) by omega, Nat.pow_add, Nat.mul_assoc] + have hw2 : 2 ^ w₂ * x₂ = 2 ^ u * (2 ^ (w₂ - u) * x₂) := by + conv_lhs => rw [show w₂ = u + (w₂ - u) by omega, Nat.pow_add, Nat.mul_assoc] + rw [hw1, hw2] at hlt ⊢ + rw [← Nat.mul_sub_left_distrib] + have hq : 2 ^ (w₂ - u) * x₂ - 2 ^ (w₁ - u) * x₁ ≥ 1 := by + by_contra h0 + have hle : 2 ^ (w₂ - u) * x₂ ≤ 2 ^ (w₁ - u) * x₁ := by omega + have := Nat.mul_le_mul_left (2 ^ u) hle + omega + calc 2 ^ u = 2 ^ u * 1 := (Nat.mul_one _).symm + _ ≤ 2 ^ u * (2 ^ (w₂ - u) * x₂ - 2 ^ (w₁ - u) * x₁) := Nat.mul_le_mul_left _ hq + +theorem pow2_odd_inj {u₁ u₂ x₁ x₂ : ℕ} (hx1 : x₁ % 2 = 1) (hx2 : x₂ % 2 = 1) + (heq : 2 ^ u₁ * x₁ = 2 ^ u₂ * x₂) : u₁ = u₂ ∧ x₁ = x₂ := by + have h := congrArg splitTwo heq + rw [splitTwo_pow_mul_odd u₁ x₁ hx1, splitTwo_pow_mul_odd u₂ x₂ hx2] at h + exact Prod.mk.inj h + +theorem mul_pred_add_self (A n : ℕ) (hn : n ≥ 1) : A * (n - 1) + A = A * n := by + rcases n with _ | n' + · omega + · simp [Nat.mul_succ] + +theorem halt3_step1_bounds (s2 s1 s0 : OddState) + (hs2 : InSdom s2) (hr2 : R_odd s2 = some s1) + (hr1 : R_odd s1 = some s0) (hr0 : R_odd s0 = none) : + nu_of s2 ≥ 1 ∧ s2.c ≤ s1.b + nu_of s2 + 1 ∧ + (nu_of s2 ≤ 7 → s1.a ≤ 3 ∧ s2.c ≤ 15 ∧ 2 * s1.a + s2.c ≤ 16 ∧ 2 * s1.a + s2.c ≤ nu_of s2 + 11) ∧ + (nu_of s2 ≥ 8 → 4 * s1.a + 2 * s1.b ≤ nu_of s2 + 10) := by + have hp2 := R_odd_props s2 s1 hs2 hr2 + have hs1 : InSdom s1 := hp2.1 + have hp1 := R_odd_props s1 s0 hs1 hr1 + have hs0 : InSdom s0 := hp1.1 + have ha0_s0_odd : s0.a % 2 = 1 := hs0.1.1 + have hhalt0 : s0.c < sigma_true s0.b s0.d + nu_of s0 := (R_odd_halt_iff s0).mp hr0 + have hsig0 := sigma_true_le_one s0.b s0.d + have hE_ge3 : nu_of s0 ≥ 3 := by have := hs0.1.2.2.1; clear hp2 hp1; omega + obtain ⟨hm0_eq, ha0_odd⟩ : 2 ^ (nu_of s0) * (a_next_of s0) = s0.b / 2 + 1 ∧ (a_next_of s0) % 2 = 1 := + splitTwo_spec (s0.b / 2 + 1) (by have := hs0.1.2.1; clear hp2 hp1; omega) + have hm0_pow : 2 ^ (nu_of s0 + 1) * a_next_of s0 = 2 * (s0.b / 2 + 1) := by + rw [Nat.pow_succ', Nat.mul_assoc, hm0_eq] + have hm0_ge_pow : 2 * (s0.b / 2 + 1) ≥ 2 ^ (nu_of s0 + 1) := by + rw [← hm0_pow] + calc 2 ^ (nu_of s0 + 1) = 2 ^ (nu_of s0 + 1) * 1 := (Nat.mul_one _).symm + _ ≤ 2 ^ (nu_of s0 + 1) * a_next_of s0 := Nat.mul_le_mul_left _ (by clear hp2 hp1; omega) + have hp0_8 : 2 ^ (nu_of s0 + 1) ≥ 8 * nu_of s0 - 8 := pow_two_ge_8 (nu_of s0) hE_ge3 + have hb0_lo : 2 * (s0.b / 2 + 1) - 2 ≤ s0.b := by clear hp2 hp1; omega + have hb0_hi : s0.b ≤ 2 * (s0.b / 2 + 1) - 1 := by clear hp2 hp1; omega + -- Uniform s1 -> s0 bounds: nu_of s0 ≥ s1.a + (s1.b + 1) / 2 + 2 * nu_of s1 and 2*(s0.b/2+1) + nu_of s1 - 4 ≤ s1.c ≤ 2*(s0.b/2+1) + nu_of s1 + have hs1_unif : nu_of s0 ≥ s1.a + (s1.b + 1) / 2 + 2 * nu_of s1 ∧ + 2 * (s0.b / 2 + 1) + nu_of s1 - 4 ≤ s1.c ∧ s1.c ≤ 2 * (s0.b / 2 + 1) + nu_of s1 := by + rcases hnu1 : nu_of s1 with _ | t1 + · have h0 := hp1.2.2.2.2.2.2.2.1 hnu1 + have ha0_eq : s0.a = s1.b / 2 + 1 := by + have := hp1.2.2.1; rw [hnu1] at this; clear hp2 hp1; omega + have ha1_eq : a_next_of s1 = s1.b / 2 + 1 := by + rw [← hp1.2.1, ha0_eq] + refine ⟨?_, by clear hp2 hp1; omega, by clear hp2 hp1; omega⟩ + have hhalt0' : s0.c < sigma_true s0.b s0.d + nu_of s0 := hhalt0 + generalize hE0 : nu_of s0 = E0 at hhalt0' ⊢ + clear hE0 + unfold R_odd at hr1 + by_cases hlt1 : s1.c < sigma_true s1.b s1.d + nu_of s1 + · simp [hlt1] at hr1 + · simp only [hlt1, ↓reduceIte] at hr1 + simp only [hnu1, ↓reduceIte, Option.some.injEq] at hr1 + rw [← hr1] at hhalt0' + dsimp only [sigma_true] at hhalt0' + have hc1_odd := hs1.1.2.2.2.1 + have hd1 := hs1.1.2.2.2.2 + clear hp2 hp1 hs2 hs1 hs0 h0 hhalt0 hsig0 hm0_eq hm0_pow hm0_ge_pow hp0_8 hb0_lo hb0_hi hE_ge3 + rcases hd1 with hd10 | hd12 + · simp only [hd10] at hhalt0' + norm_num at hhalt0' + split_ifs at hhalt0' <;> omega + · simp only [hd12] at hhalt0' + norm_num at hhalt0' + split_ifs at hhalt0' <;> omega + · have h1 := hp1.2.2.2.2.2.2.2.2 (by clear hp2 hp1; omega) + have hm1_2 : 2 * (s1.b / 2 + 1) ≥ 4 * s0.a := by + have := hp1.2.2.1 + rw [hnu1, show t1 + 1 + 1 = 2 + t1 by clear hp2 hp1; omega, Nat.pow_add, Nat.mul_assoc] at this + have : 2 ^ t1 * s0.a ≥ s0.a := by + calc 2 ^ t1 * s0.a ≥ 1 * s0.a := Nat.mul_le_mul_right _ Nat.one_le_two_pow + _ = s0.a := Nat.one_mul _ + clear hp2 hp1; omega + have ha0_ge1 : s0.a ≥ 1 := by have := hs0.1.1; clear hp2 hp1; omega + clear hp2 hp1 hs2 hs1 hs0; omega + rcases hs1_unif with ⟨hE_lb, hc1_lo, hc1_hi⟩ + clear hp1 hr1 hr0 hs0 ha0_s0_odd hhalt0 hsig0 hm0_eq hb0_lo hb0_hi + -- Eliminate nu_of s2 = 0 + have hnu2_ge1 : nu_of s2 ≥ 1 := by + by_contra h0 + have hnu2_0 : nu_of s2 = 0 := by clear hp2 hs2 hs1; omega + have hz := hp2.2.2.2.2.2.2.2.1 hnu2_0 + have ha2_le : s2.a ≤ s2.c := hs2.2 + have ha1_ge1 : s1.a ≥ 1 := by have := hs1.1.1; clear hp2 hs2 hs1; omega + clear hp2 hs2 hs1; omega + have hz2 := hp2.2.2.2.2.2.2.2.2 hnu2_ge1 + have hc2_ub : s2.c ≤ s1.b + nu_of s2 + 1 := hz2.2.1 + have hm2_pow : 2 ^ (nu_of s2 + 1) * s1.a = 2 * (s2.b / 2 + 1) := hp2.2.2.1 + have ha2_le_c2 : s2.a ≤ s2.c := hs2.2 + have ha2_odd : s2.a % 2 = 1 := hs2.1.1 + have ha1_odd : s1.a % 2 = 1 := hs1.1.1 + have hb1_ge1 : s1.b ≥ 1 := hs1.1.2.1 + clear hp2 hr2 hs2 hs1 + generalize hE_def : nu_of s0 = E at * + generalize hm0_def : 2 * (s0.b / 2 + 1) = m0_2 at * + generalize hnu2_def : nu_of s2 = nu2 at * + generalize hm2_def : 2 * (s2.b / 2 + 1) = m2_2 at * + generalize hnu1_def : nu_of s1 = nu1 at * + clear hE_def hm0_def hnu2_def hm2_def hnu1_def + have hm2_ge_2a : m2_2 ≥ 2 * s1.a := by + rw [← hm2_pow] + obtain ⟨t2, ht2⟩ : ∃ t2, nu2 = t2 + 1 := ⟨nu2 - 1, by omega⟩ + rw [ht2, show t2 + 1 + 1 = 1 + (t2 + 1) by omega, Nat.pow_add, Nat.mul_assoc] + exact Nat.mul_le_mul_left 2 (by + calc 2 ^ (t2 + 1) * s1.a ≥ 1 * s1.a := Nat.mul_le_mul_right _ Nat.one_le_two_pow + _ = s1.a := Nat.one_mul _) + have ha2_le : s2.a ≤ s1.b + nu2 + 1 := by omega + have ha2_ge1 : s2.a ≥ 1 := by omega + -- Prove m2_2 < m0_2 + have hm2_lt_m0 : m2_2 < m0_2 := by + have hL : m2_2 + 2 * nu2 ≤ m0_2 + s1.a + nu1 := by omega + rcases (show m2_2 < m0_2 ∨ m2_2 = m0_2 ∨ m0_2 < m2_2 by omega) with hlt | heq | hgt + · exact hlt + · rw [← hm2_pow, ← hm0_pow] at heq + obtain ⟨hnu_eq, _⟩ := pow2_odd_inj ha1_odd ha0_odd heq + have : nu2 = E := by omega + omega + · rw [← hm2_pow, ← hm0_pow] at hgt + by_cases hEnu : E ≤ nu2 + · have hdvd := pow2_dvd_diff_ge (u := E + 1) (by omega) (by omega) hgt + rw [hm2_pow, hm0_pow] at hdvd + omega + · have hdvd := pow2_dvd_diff_ge (u := nu2 + 1) (by omega) (by omega) hgt + rw [hm2_pow, hm0_pow] at hdvd + have hpow_le_E : 2 ^ (nu2 + 1) ≤ E := by omega + have ha1_le_E : s1.a ≤ E := by omega + have hprod : m2_2 ≤ E * E := by + rw [← hm2_pow] + exact Nat.mul_le_mul hpow_le_E ha1_le_E + have hsq := sq_lt_pow2_succ E hE_ge3 + omega + have hdiff_ub : m0_2 - m2_2 ≤ s1.b + 3 * nu2 + 8 - s1.a - nu1 := by omega + clear hz2 hc1_lo hc1_hi ha2_le_c2 ha2_odd ha2_le ha2_ge1 + refine ⟨hnu2_ge1, hc2_ub, ?_, ?_⟩ + · -- Suppose nu2 ≤ 7: prove s1.a ≤ 3 ∧ s2.c ≤ 15 + intro hnu2_le7 + by_cases hcaseA : nu2 ≤ E + · -- Case A: nu2 ≤ E + have hdvd : 2 ^ (nu2 + 1) ≤ m0_2 - m2_2 := by + rw [← hm0_pow, ← hm2_pow] + exact pow2_dvd_diff_ge (by omega) (by omega) (by rwa [hm2_pow, hm0_pow]) + have h2E : 2 * E ≥ 2 * s1.a + s1.b := by omega + have hpow_ub : 2 ^ (nu2 + 1) ≤ 2 * E + 3 * nu2 + 5 := by omega + have hE_le7 : E ≤ 7 := by + by_contra hE8 + have hq := quad_step1_lt E (by omega) + have ha1_le : s1.a ≤ E - 1 := by omega + have hp_le : 2 ^ (nu2 + 1) ≤ 5 * E + 5 := by omega + have hprod : m2_2 ≤ (5 * E + 5) * (E - 1) := by + rw [← hm2_pow]; exact Nat.mul_le_mul hp_le ha1_le + have hexp := mul_pred_add_self (5 * E + 5) E (by omega) + omega + -- Since E ≤ 7, 2^(nu2+1) ≤ 19 + 3*nu2 forces nu2 ≤ 3! + have hnu2_le3 : nu2 ≤ 3 := by + rcases (show nu2 ≤ 3 ∨ nu2 = 4 ∨ nu2 = 5 ∨ nu2 = 6 ∨ nu2 = 7 by omega) with h | h4 | h5 | h6 | h7 + · exact h + · rw [h4] at hpow_ub; norm_num at hpow_ub; omega + · rw [h5] at hpow_ub; norm_num at hpow_ub; omega + · rw [h6] at hpow_ub; norm_num at hpow_ub; omega + · rw [h7] at hpow_ub; norm_num at hpow_ub; omega + -- With nu2 ≤ 3, 2^(nu2+1) ≤ 16; E ∈ {6, 7} contradicts hm0_ge_pow + have hpow_le16 : 2 ^ (nu2 + 1) ≤ 16 := by + rcases (show nu2 = 1 ∨ nu2 = 2 ∨ nu2 = 3 by omega) with h1 | h2 | h3 + · rw [h1]; decide + · rw [h2]; decide + · rw [h3]; decide + have hm2_le_16a : m2_2 ≤ 16 * s1.a := by + rw [← hm2_pow]; exact Nat.mul_le_mul_right s1.a hpow_le16 + have hE_le5 : E ≤ 5 := by + rcases (show E ≤ 5 ∨ E = 6 ∨ E = 7 by omega) with h | h6 | h7 + · exact h + · rw [h6] at hm0_ge_pow; norm_num at hm0_ge_pow; omega + · rw [h7] at hm0_ge_pow; norm_num at hm0_ge_pow; omega + omega + · -- Case B with nu2 ≤ 7: E < nu2 ≤ 7, so E ≤ 6 + have hdvd : 2 ^ (E + 1) ≤ m0_2 - m2_2 := by + rw [← hm0_pow, ← hm2_pow] + exact pow2_dvd_diff_ge (by omega) (by omega) (by rwa [hm2_pow, hm0_pow]) + have hp14 := pow_two_ge_14 E hE_ge3 + omega + · -- Suppose nu2 ≥ 8: prove 4 * s1.a + 2 * s1.b ≤ nu2 + 10 + intro hnu2_ge8 + by_cases hcaseA : nu2 ≤ E + · -- Case A impossible for nu2 ≥ 8! + have hdvd : 2 ^ (nu2 + 1) ≤ m0_2 - m2_2 := by + rw [← hm0_pow, ← hm2_pow] + exact pow2_dvd_diff_ge (by omega) (by omega) (by rwa [hm2_pow, hm0_pow]) + have hq := quad_step1_lt E (by omega) + have ha1_le : s1.a ≤ E - 1 := by omega + have hp_le : 2 ^ (nu2 + 1) ≤ 5 * E + 5 := by omega + have hprod : m2_2 ≤ (5 * E + 5) * (E - 1) := by + rw [← hm2_pow]; exact Nat.mul_le_mul hp_le ha1_le + have hexp := mul_pred_add_self (5 * E + 5) E (by omega) + omega + · -- Case B (E < nu2): 14 * E - 26 ≤ 2 ^ (E + 1) ≤ b1 - a1 + 3 * nu2 + 8 + have hdvd : 2 ^ (E + 1) ≤ m0_2 - m2_2 := by + rw [← hm0_pow, ← hm2_pow] + exact pow2_dvd_diff_ge (by omega) (by omega) (by rwa [hm2_pow, hm0_pow]) + have hp14 := pow_two_ge_14 E hE_ge3 + omega + +theorem halt5_nu2_le_7 (s4 s3 s2 s1 s0 : OddState) + (hs4 : InSdom s4) (hr4 : R_odd s4 = some s3) (hr3 : R_odd s3 = some s2) + (hr2 : R_odd s2 = some s1) (hr1 : R_odd s1 = some s0) (hr0 : R_odd s0 = none) : + nu_of s2 ≤ 7 := by + have hp4 := R_odd_props s4 s3 hs4 hr4 + have hs3 : InSdom s3 := hp4.1 + have hp3 := R_odd_props s3 s2 hs3 hr3 + have hs2 : InSdom s2 := hp3.1 + have hstep1 := halt3_step1_bounds s2 s1 s0 hs2 hr2 hr1 hr0 + by_contra hgt7 + have hnu2_ge8 : nu_of s2 ≥ 8 := by omega + have hc2_ub : s2.c ≤ s1.b + nu_of s2 + 1 := hstep1.2.1 + have hlin1 : 4 * s1.a + 2 * s1.b ≤ nu_of s2 + 10 := hstep1.2.2.2 hnu2_ge8 + clear hstep1 hr1 hr0 hgt7 + have hp2 := R_odd_props s2 s1 hs2 hr2 + have hm2_pow : 2 ^ (nu_of s2 + 1) * s1.a = 2 * (s2.b / 2 + 1) := hp2.2.2.1 + have ha1_odd : s1.a % 2 = 1 := hp2.1.1.1 + have hb2_lo : 2 * (s2.b / 2 + 1) - 2 ≤ s2.b := hp2.2.2.2.1 + have hb2_hi : s2.b ≤ 2 * (s2.b / 2 + 1) - 1 := hp2.2.2.2.2.1 + clear hp2 hr2 hs2 + have ha3_odd : s3.a % 2 = 1 := hs3.1.1 + have hb3_ge1 : s3.b ≥ 1 := hs3.1.2.1 + have hb3_sum_raw : s3.b + s3.a + 2 * nu_of s3 ≤ 2 * s2.c := hp3.2.2.2.2.2.1 + have hpow_nu3 : 2 ^ (nu_of s3 + 1) ≤ s3.b + 2 := hp3.2.2.2.2.2.2.1 + have hc3_sand : 2 * (s2.b / 2 + 1) + nu_of s3 - 4 ≤ s3.c ∧ s3.c ≤ 2 * (s2.b / 2 + 1) + nu_of s3 := by + by_cases hnu3_0 : nu_of s3 = 0 + · have hz3 := hp3.2.2.2.2.2.2.2.1 hnu3_0; clear hp4 hp3 hs4 hs3; omega + · have hz3 := hp3.2.2.2.2.2.2.2.2 (by omega); clear hp4 hp3 hs4 hs3; omega + clear hp3 hr3 hs3 hb2_lo hb2_hi + have hb3_sum : s3.b + s3.a + 2 * nu_of s3 ≤ 3 * nu_of s2 + 8 := by + clear hp4 hs4 hr4; omega + clear hb3_sum_raw hc2_ub + have hm4_pow : 2 ^ (nu_of s4 + 1) * s3.a = 2 * (s4.b / 2 + 1) := hp4.2.2.1 + have ha4_odd : s4.a % 2 = 1 := hs4.1.1 + have ha4_le_c4 : s4.a ≤ s4.c := hs4.2 + have hz4_zero := hp4.2.2.2.2.2.2.2.1 + have hz4_pos := hp4.2.2.2.2.2.2.2.2 + clear hp4 hs4 hr4 + generalize hm2_def : 2 * (s2.b / 2 + 1) = m2_2 at * + generalize hm4_def : 2 * (s4.b / 2 + 1) = m4_2 at * + generalize hnu2_def : nu_of s2 = nu2 at * + generalize hnu3_def : nu_of s3 = nu3 at * + generalize hnu4_def : nu_of s4 = nu4 at * + clear hm2_def hm4_def hnu2_def hnu3_def hnu4_def + have hm2_ge_pow : m2_2 ≥ 2 ^ (nu2 + 1) := by + rw [← hm2_pow] + calc 2 ^ (nu2 + 1) = 2 ^ (nu2 + 1) * 1 := (Nat.mul_one _).symm + _ ≤ 2 ^ (nu2 + 1) * s1.a := Nat.mul_le_mul_left _ (by omega) + have hp2_14 : 2 ^ (nu2 + 1) ≥ 14 * nu2 - 26 := pow_two_ge_14 nu2 (by omega) + have hnu4_ge1 : nu4 ≥ 1 := by + by_contra h0 + have hnu4_0 : nu4 = 0 := by omega + have hz4 := hz4_zero hnu4_0 + omega + have hz4 := hz4_pos hnu4_ge1 + clear hz4_zero hz4_pos + have hm4_ge_2a : m4_2 ≥ 2 * s3.a := by + rw [← hm4_pow] + obtain ⟨t4, ht4⟩ : ∃ t4, nu4 = t4 + 1 := ⟨nu4 - 1, by omega⟩ + rw [ht4, show t4 + 1 + 1 = 1 + (t4 + 1) by omega, Nat.pow_add, Nat.mul_assoc] + exact Nat.mul_le_mul_left 2 (by + calc 2 ^ (t4 + 1) * s3.a ≥ 1 * s3.a := Nat.mul_le_mul_right _ Nat.one_le_two_pow + _ = s3.a := Nat.one_mul _) + have ha4_ge1 : s4.a ≥ 1 := by omega + have ha4_le : s4.a ≤ s3.b + nu4 + 1 := by omega + have hL : m4_2 + 2 * nu4 ≤ m2_2 + s3.a + nu3 := by omega + have hU : m2_2 + nu3 ≤ m4_2 + s3.b + 3 * nu4 + 8 - s3.a := by omega + clear hz4 hc3_sand ha4_odd ha4_le_c4 ha4_ge1 ha4_le + -- Compare m4_2 vs m2_2 + rcases (show m4_2 = m2_2 ∨ m2_2 < m4_2 ∨ m4_2 < m2_2 by omega) with heq | hgt | hlt + · -- Branch 1: m4_2 = m2_2 => nu4 = nu2 ∧ s3.a = s1.a + rw [← hm4_pow, ← hm2_pow] at heq + obtain ⟨hnu_eq, ha_eq⟩ := pow2_odd_inj ha3_odd ha1_odd heq + have hnu3_ge3 : nu3 ≥ 3 := by omega + have hp8 := pow_two_ge_8 nu3 hnu3_ge3 + omega + · -- Branch 2: m2_2 < m4_2 + by_cases hnu4_ge : nu2 ≤ nu4 + · have hdvd : 2 ^ (nu2 + 1) ≤ m4_2 - m2_2 := by + rw [← hm4_pow, ← hm2_pow] + exact pow2_dvd_diff_ge (by omega) (by omega) (by rwa [hm2_pow, hm4_pow]) + omega + · have hdvd : 2 ^ (nu4 + 1) ≤ m4_2 - m2_2 := by + rw [← hm4_pow, ← hm2_pow] + exact pow2_dvd_diff_ge (by omega) (by omega) (by rwa [hm2_pow, hm4_pow]) + have hp_ub : 2 ^ (nu4 + 1) ≤ 3 * nu2 + 6 := by omega + have ha3_ub : s3.a ≤ 3 * nu2 + 7 := by omega + rcases (show nu2 = 8 ∨ nu2 = 9 ∨ nu2 ≥ 10 by omega) with h8 | h9 | h10 + · have hnu4_le3 : nu4 ≤ 3 := by + rcases (show nu4 ≤ 3 ∨ nu4 = 4 ∨ nu4 ≥ 5 by omega) with h | h4 | h5 + · exact h + · rw [h4] at hp_ub; omega + · have := pow_two_ge_16 nu4 h5; omega + rcases (show nu4 = 1 ∨ nu4 = 2 ∨ nu4 = 3 by omega) with hnu4 | hnu4 | hnu4 <;> + (rw [h8] at hm2_ge_pow ha3_ub; rw [hnu4] at hm4_pow; norm_num at hm2_ge_pow hm4_pow; omega) + · have hnu4_le3 : nu4 ≤ 3 := by + rcases (show nu4 ≤ 3 ∨ nu4 = 4 ∨ nu4 ≥ 5 by omega) with h | h4 | h5 + · exact h + · rw [h4] at hL hdvd; norm_num at hdvd; omega + · have := pow_two_ge_16 nu4 h5; omega + rcases (show nu4 = 1 ∨ nu4 = 2 ∨ nu4 = 3 by omega) with hnu4 | hnu4 | hnu4 <;> + (rw [h9] at hm2_ge_pow ha3_ub; rw [hnu4] at hm4_pow; norm_num at hm2_ge_pow hm4_pow; omega) + · have hprod : m4_2 ≤ (3 * nu2 + 6) * (3 * nu2 + 7) := by + rw [← hm4_pow]; exact Nat.mul_le_mul hp_ub ha3_ub + have hq := quad_step2a_lt nu2 h10 + omega + · -- Branch 3: m4_2 < m2_2 + by_cases hnu4_ge : nu2 ≤ nu4 + · -- Subbranch 3a: nu2 ≤ nu4 and 2^(nu4+1)*a3 < 2^(nu2+1)*a1 + have hdvd : 2 ^ (nu2 + 1) ≤ m2_2 - m4_2 := by + rw [← hm2_pow, ← hm4_pow] + exact pow2_dvd_diff_ge (by omega) (by omega) (by rwa [hm4_pow, hm2_pow]) + have hquot : 2 ^ (nu4 - nu2) < s1.a := by + have hlt_pow : 2 ^ (nu2 + 1) * (2 ^ (nu4 - nu2) * s3.a) < 2 ^ (nu2 + 1) * s1.a := by + have heq : 2 ^ (nu2 + 1) * (2 ^ (nu4 - nu2) * s3.a) = m4_2 := by + rw [← hm4_pow, ← Nat.mul_assoc, ← Nat.pow_add, show nu2 + 1 + (nu4 - nu2) = nu4 + 1 by omega] + rwa [heq, hm2_pow] + have h1 : 2 ^ (nu4 - nu2) * s3.a < s1.a := Nat.lt_of_mul_lt_mul_left hlt_pow + have h2 : 2 ^ (nu4 - nu2) ≤ 2 ^ (nu4 - nu2) * s3.a := by + calc 2 ^ (nu4 - nu2) = 2 ^ (nu4 - nu2) * 1 := (Nat.mul_one _).symm + _ ≤ 2 ^ (nu4 - nu2) * s3.a := Nat.mul_le_mul_left _ (by omega) + omega + have hsucc := pow_two_ge_succ (nu4 - nu2) + omega + · -- Subbranch 3b: 1 ≤ nu4 < nu2 and m4_2 < m2_2 + have hdvd : 2 ^ (nu4 + 1) ≤ m2_2 - m4_2 := by + rw [← hm2_pow, ← hm4_pow] + exact pow2_dvd_diff_ge (by omega) (by omega) (by rwa [hm4_pow, hm2_pow]) + have h2a3 : 2 ^ (nu4 + 1) + 2 * s3.a ≤ 3 * nu2 + 3 * nu4 + 16 := by omega + have ha3_ub : s3.a ≤ 3 * nu2 + 7 := by omega + rcases (show nu2 = 8 ∨ nu2 = 9 ∨ nu2 = 10 ∨ nu2 ≥ 11 by omega) with h8 | h9 | h10 | h11 + · have hnu4_le4 : nu4 ≤ 4 := by + by_contra h5; have := pow_two_ge_16 nu4 (by omega); omega + rw [h8] at hm2_ge_pow h2a3 hb3_sum + rcases (show nu4 = 1 ∨ nu4 = 2 ∨ nu4 = 3 ∨ nu4 = 4 by omega) with hnu4 | hnu4 | hnu4 | hnu4 <;> + (rw [hnu4] at hm4_pow h2a3 hU; norm_num at hm2_ge_pow hm4_pow h2a3; omega) + · have hnu4_le4 : nu4 ≤ 4 := by + by_contra h5; have := pow_two_ge_16 nu4 (by omega); omega + rw [h9] at hm2_ge_pow h2a3 hb3_sum + rcases (show nu4 = 1 ∨ nu4 = 2 ∨ nu4 = 3 ∨ nu4 = 4 by omega) with hnu4 | hnu4 | hnu4 | hnu4 <;> + (rw [hnu4] at hm4_pow h2a3 hU; norm_num at hm2_ge_pow hm4_pow h2a3; omega) + · have hnu4_le4 : nu4 ≤ 4 := by + by_contra h5; have := pow_two_ge_16 nu4 (by omega); omega + rw [h10] at hm2_ge_pow h2a3 hb3_sum + rcases (show nu4 = 1 ∨ nu4 = 2 ∨ nu4 = 3 ∨ nu4 = 4 by omega) with hnu4 | hnu4 | hnu4 | hnu4 <;> + (rw [hnu4] at hm4_pow h2a3 hU; norm_num at hm2_ge_pow hm4_pow h2a3; omega) + · have hp_ub : 2 ^ (nu4 + 1) ≤ 6 * nu2 + 11 := by omega + have hrem_ub : m2_2 - m4_2 ≤ 6 * nu2 + 11 := by omega + have hprod : m4_2 ≤ (6 * nu2 + 11) * (3 * nu2 + 7) := by + rw [← hm4_pow]; exact Nat.mul_le_mul hp_ub ha3_ub + have hexp : (6 * nu2 + 11) * (3 * nu2 + 7) + (6 * nu2 + 11) = (6 * nu2 + 11) * (3 * nu2 + 8) := by ring + have hq := quad_step2b_lt nu2 h11 + omega + +-- ---------------------------------------------------------------------------- +-- Stage 5C: Analytic 1-Step Inverse, Finite Preimage Exhaustion & Non-Halting +-- ---------------------------------------------------------------------------- + +def candPreimage (s' : OddState) (ν β : ℕ) : OddState := + let d := 2 - s'.d + let b := 2 ^ (ν + 1) * s'.a - 2 + β + let c := + if ν = 0 then + if b % 4 = 1 then s'.b - d / 2 else s'.b + d / 2 - 1 + else + (if s'.b % 2 = 0 then s'.b - 2 else s'.b) + sigma_true b d + ν + let M := c - sigma_true b d - ν + let a := + if ν = 0 then + if b % 4 = 1 then s'.c - s'.a - 1 else s'.c + 1 - s'.a - d + else + s'.c + 1 + s'.a - 2 * (b / 2 + 1) - 2 * ν - + (if b % 2 = 1 ∧ d = 2 then 2 else 0) - (if M % 2 = 0 then 0 else 2) + ⟨a, b, c, d⟩ + +theorem candPreimage_eq (s s' : OddState) (hs : InSdom s) (hr : R_odd s = some s') : + candPreimage s' (nu_of s) (s.b % 2) = s := by + have hp := R_odd_props s s' hs hr + have h2m : 2 ^ (nu_of s + 1) * a_next_of s = 2 * (s.b / 2 + 1) := by + rw [← hp.2.1]; exact hp.2.2.1 + clear hp + rcases hs with ⟨⟨ha_odd, hb_ge1, hc_ge3, hc_odd, hd⟩, hca⟩ + unfold R_odd at hr + by_cases hlt : s.c < sigma_true s.b s.d + nu_of s + · simp [hlt] at hr + · simp only [hlt, ↓reduceIte] at hr + by_cases hnu0 : nu_of s = 0 + · simp only [hnu0, ↓reduceIte, Option.some.injEq] at hr + subst hr + unfold candPreimage + dsimp only [] + simp only [hnu0, ↓reduceIte] + have hb_rec : 2 ^ (0 + 1) * a_next_of s - 2 + s.b % 2 = s.b := by + rw [hnu0] at h2m; omega + have hd_rec : 2 - (2 - s.d) = s.d := by omega + simp only [hb_rec, hd_rec] + have hc_rec : (if s.b % 4 = 1 + then (if s.b % 4 = 1 then s.c + s.d / 2 else s.c + 1 - s.d / 2) - s.d / 2 + else (if s.b % 4 = 1 then s.c + s.d / 2 else s.c + 1 - s.d / 2) + s.d / 2 - 1) = s.c := by + rcases hd with hd0 | hd2 <;> (split_ifs <;> omega) + have ha_rec : (if s.b % 4 = 1 + then (if s.b % 4 = 1 then s.a + a_next_of s + 1 else s.a + a_next_of s - 1 + s.d) - a_next_of s - 1 + else (if s.b % 4 = 1 then s.a + a_next_of s + 1 else s.a + a_next_of s - 1 + s.d) + 1 - a_next_of s - s.d) = s.a := by + rcases hd with hd0 | hd2 <;> (split_ifs <;> omega) + rw [hc_rec, ha_rec] + · simp only [hnu0, ↓reduceIte, Option.some.injEq] at hr + subst hr + unfold candPreimage + dsimp only [] + simp only [hnu0, ↓reduceIte] + have hb_rec : 2 ^ (nu_of s + 1) * a_next_of s - 2 + s.b % 2 = s.b := by omega + have hd_rec : 2 - (2 - s.d) = s.d := by omega + simp only [hb_rec, hd_rec] + set M := s.c - sigma_true s.b s.d - nu_of s + have hM_def : M = s.c - sigma_true s.b s.d - nu_of s := rfl + have hc_rec : (if (if M % 2 = 0 then M + 2 else M) % 2 = 0 + then (if M % 2 = 0 then M + 2 else M) - 2 + else (if M % 2 = 0 then M + 2 else M)) + sigma_true s.b s.d + nu_of s = s.c := by + split_ifs <;> omega + simp only [hc_rec] + have h2m_ge : 2 * (s.b / 2 + 1) ≥ a_next_of s := by + rw [← h2m] + have : 2 ^ (nu_of s + 1) ≥ 1 := Nat.one_le_two_pow + calc 2 ^ (nu_of s + 1) * a_next_of s ≥ 1 * a_next_of s := Nat.mul_le_mul_right _ this + _ = a_next_of s := Nat.one_mul _ + have ha_rec : + (2 * (s.b / 2 + 1) - a_next_of s + s.a + 2 * nu_of s + + (if s.b % 2 = 1 ∧ s.d = 2 then 2 else 0) + (if M % 2 = 0 then 0 else 2) - 1) + 1 + a_next_of s - + 2 * (s.b / 2 + 1) - 2 * nu_of s - + (if s.b % 2 = 1 ∧ s.d = 2 then 2 else 0) - + (if (s.c - sigma_true s.b s.d - nu_of s) % 2 = 0 then 0 else 2) = s.a := by + rw [← hM_def] + split_ifs <;> omega + rw [ha_rec] + +theorem nu_le_of_R_odd (s s' : OddState) (hs : InSdom s) (hr : R_odd s = some s') : + (s'.c ≤ 15 → nu_of s ≤ 4) ∧ (s'.c ≤ 125 → nu_of s ≤ 7) := by + have hp := R_odd_props s s' hs hr + have h2m := hp.2.2.1 + have ha'_ge1 : s'.a ≥ 1 := by have := hp.1.1.1; omega + have ha_ge1 : s.a ≥ 1 := by have := hs.1.1; omega + refine ⟨?_, ?_⟩ + · intro hc15 + by_contra hgt4 + have hnu5 : nu_of s ≥ 5 := by omega + have hz := hp.2.2.2.2.2.2.2.2 (by omega) + have hpow := pow_two_ge_16 (nu_of s) hnu5 + have hm_ge : 2 * (s.b / 2 + 1) ≥ 2 ^ (nu_of s + 1) := by + rw [← h2m] + calc 2 ^ (nu_of s + 1) = 2 ^ (nu_of s + 1) * 1 := (Nat.mul_one _).symm + _ ≤ 2 ^ (nu_of s + 1) * s'.a := Nat.mul_le_mul_left _ ha'_ge1 + have h2m_2a : 2 * (s.b / 2 + 1) ≥ 2 * s'.a := by + rw [← h2m, show nu_of s + 1 = 1 + nu_of s by omega, Nat.pow_add, Nat.mul_assoc] + exact Nat.mul_le_mul_left 2 (by + calc 2 ^ nu_of s * s'.a ≥ 1 * s'.a := Nat.mul_le_mul_right _ Nat.one_le_two_pow + _ = s'.a := Nat.one_mul _) + -- Note 2 * m - s'.a ≥ m ≥ 2^5 = 32 > 15: + have hm_half : 2 * (s.b / 2 + 1) - s'.a ≥ s.b / 2 + 1 := by omega + omega + · intro hc125 + by_contra hgt7 + have hnu8 : nu_of s ≥ 8 := by omega + have hz := hp.2.2.2.2.2.2.2.2 (by omega) + have hpow : 2 ^ (nu_of s + 1) ≥ 512 := by + have : 2 ^ (8 + 1) ≤ 2 ^ (nu_of s + 1) := Nat.pow_le_pow_right (by decide) (by omega) + norm_num at this; exact this + have hm_ge : 2 * (s.b / 2 + 1) ≥ 2 ^ (nu_of s + 1) := by + rw [← h2m] + calc 2 ^ (nu_of s + 1) = 2 ^ (nu_of s + 1) * 1 := (Nat.mul_one _).symm + _ ≤ 2 ^ (nu_of s + 1) * s'.a := Nat.mul_le_mul_left _ ha'_ge1 + have h2m_2a : 2 * (s.b / 2 + 1) ≥ 2 * s'.a := by + rw [← h2m, show nu_of s + 1 = 1 + nu_of s by omega, Nat.pow_add, Nat.mul_assoc] + exact Nat.mul_le_mul_left 2 (by + calc 2 ^ nu_of s * s'.a ≥ 1 * s'.a := Nat.mul_le_mul_right _ Nat.one_le_two_pow + _ = s'.a := Nat.one_mul _) + omega + +def validPreimages (s' : OddState) (max_nu : ℕ) : List OddState := + ((List.range (max_nu + 1)).flatMap fun ν => + [0, 1].map fun β => candPreimage s' ν β).filter fun s => + bInSdom s && (R_odd s == some s') + +theorem validPreimages_complete (s s' : OddState) (max_nu : ℕ) + (hs : InSdom s) (hr : R_odd s = some s') (hnu : nu_of s ≤ max_nu) : + s ∈ validPreimages s' max_nu := by + unfold validPreimages + rw [List.mem_filter] + refine ⟨?_, ?_⟩ + · rw [List.mem_flatMap] + refine ⟨nu_of s, List.mem_range.mpr (by omega), ?_⟩ + rw [List.mem_map] + refine ⟨s.b % 2, ?_, candPreimage_eq s s' hs hr⟩ + rcases Nat.mod_two_eq_zero_or_one s.b with h | h <;> simp [h] + · simp [(bInSdom_iff s).mpr hs, hr] + +def isHalt3Bool (s2 : OddState) : Bool := + bInSdom s2 && + match R_odd s2 with + | none => false + | some s1 => + match R_odd s1 with + | none => false + | some s0 => decide (s0.c < sigma_true s0.b s0.d + nu_of s0) + +def halt3_window : List OddState := + (([1, 2, 3, 4, 5, 6, 7] : List ℕ).flatMap fun ν2 => + [1, 3].flatMap fun a1 => + [0, 1].flatMap fun β2 => + (([3, 5, 7, 9, 11, 13] : List ℕ).filter (fun c2 => ν2 ≤ c2 && 2 * a1 + c2 ≤ ν2 + 11)).flatMap fun c2 => + ([1, 3, 5, 7, 9, 11, 13].filter (· ≤ c2)).flatMap fun a2 => + [0, 2].map fun d2 => + ⟨a2, 2 ^ (ν2 + 1) * a1 - 2 + β2, c2, d2⟩).filter isHalt3Bool + +def w3_list : List OddState := + [⟨3, 6, 3, 2⟩, ⟨1, 7, 3, 0⟩, ⟨5, 31, 5, 0⟩, ⟨3, 62, 7, 0⟩, + ⟨3, 63, 7, 2⟩, ⟨3, 126, 7, 2⟩, ⟨1, 127, 7, 0⟩] + +theorem halt3_window_eq : halt3_window = w3_list := by decide + +def halt4_window : List OddState := + w3_list.flatMap fun s2 => validPreimages s2 4 + +def w4_list : List OddState := + [⟨1, 4, 5, 0⟩, ⟨3, 5, 61, 2⟩, ⟨3, 5, 63, 0⟩, ⟨5, 4, 125, 0⟩] + +theorem halt4_window_eq : halt4_window = w4_list := by decide + +def halt5_window : List OddState := + w4_list.flatMap fun s3 => validPreimages s3 7 + +def w5_list : List OddState := + [⟨3, 1, 3, 2⟩, ⟨1, 2, 3, 2⟩, ⟨9, 46, 9, 0⟩, ⟨9, 47, 9, 2⟩] + +theorem halt5_window_eq : halt5_window = w5_list := by decide + +def halt6_window : List OddState := + w5_list.flatMap fun s4 => validPreimages s4 4 + +theorem w3_list_c_le : ∀ s ∈ w3_list, s.c ≤ 15 := by decide + +theorem w4_list_c_le : ∀ s ∈ w4_list, s.c ≤ 125 := by decide + +theorem w5_list_c_le : ∀ s ∈ w5_list, s.c ≤ 15 := by decide + +theorem halt6_window_eq_nil : halt6_window = [] := by decide + +theorem odd_mem_13 {x : ℕ} (hodd : x % 2 = 1) (hlo : x ≥ 1) (hhi : x ≤ 13) : + x ∈ ([1, 3, 5, 7, 9, 11, 13] : List ℕ) := by + rcases (show x = 1 ∨ x = 3 ∨ x = 5 ∨ x = 7 ∨ x = 9 ∨ x = 11 ∨ x = 13 by omega) with + rfl | rfl | rfl | rfl | rfl | rfl | rfl <;> simp + +theorem odd_mem_3_13 {x : ℕ} (hodd : x % 2 = 1) (hlo : x ≥ 3) (hhi : x ≤ 13) : + x ∈ ([3, 5, 7, 9, 11, 13] : List ℕ) := by + rcases (show x = 3 ∨ x = 5 ∨ x = 7 ∨ x = 9 ∨ x = 11 ∨ x = 13 by omega) with + rfl | rfl | rfl | rfl | rfl | rfl <;> simp + +theorem halt5_s2_in_halt3_window (s4 s3 s2 s1 s0 : OddState) + (hs4 : InSdom s4) (hr4 : R_odd s4 = some s3) (hr3 : R_odd s3 = some s2) + (hr2 : R_odd s2 = some s1) (hr1 : R_odd s1 = some s0) (hr0 : R_odd s0 = none) : + s2 ∈ halt3_window := by + have hs3 : InSdom s3 := (R_odd_props s4 s3 hs4 hr4).1 + have hs2 : InSdom s2 := (R_odd_props s3 s2 hs3 hr3).1 + have hp2 := R_odd_props s2 s1 hs2 hr2 + have hnu2_le7 := halt5_nu2_le_7 s4 s3 s2 s1 s0 hs4 hr4 hr3 hr2 hr1 hr0 + have hstep1 := halt3_step1_bounds s2 s1 s0 hs2 hr2 hr1 hr0 + have hnu2_ge1 := hstep1.1 + have hb1 := hstep1.2.2.1 hnu2_le7 + have hnohalt2 : ¬(s2.c < sigma_true s2.b s2.d + nu_of s2) := by + intro hlt; rw [(R_odd_halt_iff s2).mpr hlt] at hr2; cases hr2 + have hc2_le13 : s2.c ≤ 13 := by + have := hs2.1.2.2.2.1; have := hp2.1.1.1; omega + unfold halt3_window + rw [List.mem_filter] + refine ⟨?_, ?_⟩ + · rw [List.mem_flatMap] + have hnu2_mem : nu_of s2 ∈ ([1, 2, 3, 4, 5, 6, 7] : List ℕ) := by + rcases (show nu_of s2 = 1 ∨ nu_of s2 = 2 ∨ nu_of s2 = 3 ∨ nu_of s2 = 4 ∨ + nu_of s2 = 5 ∨ nu_of s2 = 6 ∨ nu_of s2 = 7 by omega) with + h | h | h | h | h | h | h <;> simp [h] + refine ⟨nu_of s2, hnu2_mem, ?_⟩ + rw [List.mem_flatMap] + have ha1_mem : s1.a ∈ ([1, 3] : List ℕ) := by + have := hp2.1.1.1 + rcases (show s1.a = 1 ∨ s1.a = 3 by omega) with h | h <;> simp [h] + refine ⟨s1.a, ha1_mem, ?_⟩ + rw [List.mem_flatMap] + have hbeta_mem : s2.b % 2 ∈ ([0, 1] : List ℕ) := by + rcases Nat.mod_two_eq_zero_or_one s2.b with h | h <;> simp [h] + refine ⟨s2.b % 2, hbeta_mem, ?_⟩ + rw [List.mem_flatMap] + have hc2_mem : s2.c ∈ ([3, 5, 7, 9, 11, 13] : List ℕ).filter + (fun c2 => nu_of s2 ≤ c2 && 2 * s1.a + c2 ≤ nu_of s2 + 11) := by + rw [List.mem_filter] + exact ⟨odd_mem_3_13 hs2.1.2.2.2.1 hs2.1.2.2.1 hc2_le13, + by simp [show nu_of s2 ≤ s2.c by omega, hb1.2.2.2]⟩ + refine ⟨s2.c, hc2_mem, ?_⟩ + rw [List.mem_flatMap] + have ha2_mem : s2.a ∈ ([1, 3, 5, 7, 9, 11, 13] : List ℕ).filter (· ≤ s2.c) := + List.mem_filter.mpr ⟨odd_mem_13 hs2.1.1 (by have := hs2.1.1; omega) (by have := hs2.2; omega), + decide_eq_true hs2.2⟩ + refine ⟨s2.a, ha2_mem, ?_⟩ + rw [List.mem_map] + have hd2_mem : s2.d ∈ ([0, 2] : List ℕ) := by + rcases hs2.1.2.2.2.2 with h | h <;> simp [h] + refine ⟨s2.d, hd2_mem, ?_⟩ + have hb2_eq : 2 ^ (nu_of s2 + 1) * s1.a - 2 + s2.b % 2 = s2.b := by + have := hp2.2.2.1; omega + rcases s2 with ⟨a2, b2, c2, d2⟩ + dsimp at hb2_eq ⊢ + rw [hb2_eq] + · unfold isHalt3Bool + simp [(bInSdom_iff s2).mpr hs2, hr2, hr1, (R_odd_halt_iff s0).mp hr0] + +theorem no_halt6 (s5 s4 s3 s2 s1 s0 : OddState) + (hs5 : InSdom s5) (hr5 : R_odd s5 = some s4) (hr4 : R_odd s4 = some s3) + (hr3 : R_odd s3 = some s2) (hr2 : R_odd s2 = some s1) + (hr1 : R_odd s1 = some s0) (hr0 : R_odd s0 = none) : False := by + have hs4 : InSdom s4 := (R_odd_props s5 s4 hs5 hr5).1 + have hs3 : InSdom s3 := (R_odd_props s4 s3 hs4 hr4).1 + have hm2 : s2 ∈ w3_list := halt3_window_eq ▸ halt5_s2_in_halt3_window s4 s3 s2 s1 s0 hs4 hr4 hr3 hr2 hr1 hr0 + have hc2 : s2.c ≤ 15 := w3_list_c_le s2 hm2 + have hnu3 : nu_of s3 ≤ 4 := (nu_le_of_R_odd s3 s2 hs3 hr3).1 hc2 + have hm3 : s3 ∈ w4_list := halt4_window_eq ▸ by + unfold halt4_window; rw [List.mem_flatMap] + exact ⟨s2, hm2, validPreimages_complete s3 s2 4 hs3 hr3 hnu3⟩ + have hc3 : s3.c ≤ 125 := w4_list_c_le s3 hm3 + have hnu4 : nu_of s4 ≤ 7 := (nu_le_of_R_odd s4 s3 hs4 hr4).2 hc3 + have hm4 : s4 ∈ w5_list := halt5_window_eq ▸ by + unfold halt5_window; rw [List.mem_flatMap] + exact ⟨s3, hm3, validPreimages_complete s4 s3 7 hs4 hr4 hnu4⟩ + have hc4 : s4.c ≤ 15 := w5_list_c_le s4 hm4 + have hnu5 : nu_of s5 ≤ 4 := (nu_le_of_R_odd s5 s4 hs5 hr5).1 hc4 + have hm5 : s5 ∈ halt6_window := by + unfold halt6_window; rw [List.mem_flatMap] + exact ⟨s4, hm4, validPreimages_complete s5 s4 4 hs5 hr5 hnu5⟩ + rw [halt6_window_eq_nil] at hm5 + cases hm5 + +def P5 (s : OddState) : Prop := + InSdom s ∧ ∃ s1 s2 s3 s4 s5, + R_odd s = some s1 ∧ R_odd s1 = some s2 ∧ R_odd s2 = some s3 ∧ + R_odd s3 = some s4 ∧ R_odd s4 = some s5 + +theorem P5_step (s : OddState) (h : P5 s) : + ∃ s1, R_odd s = some s1 ∧ P5 s1 := by + rcases h with ⟨hs, s1, s2, s3, s4, s5, hr0, hr1, hr2, hr3, hr4⟩ + refine ⟨s1, hr0, (R_odd_props s s1 hs hr0).1, ?_⟩ + rcases hr5 : R_odd s5 with _ | s6 + · exfalso; exact no_halt6 s s1 s2 s3 s4 s5 hs hr0 hr1 hr2 hr3 hr4 hr5 + · exact ⟨s2, s3, s4, s5, s6, hr1, hr2, hr3, hr4, hr5⟩ + +def s0_odd : OddState := ⟨1, 1, 5, 0⟩ + +theorem P5_s0_odd : P5 s0_odd := by + refine ⟨(bInSdom_iff s0_odd).mp (by decide), + ⟨1, 5, 3, 2⟩, ⟨3, 4, 5, 0⟩, ⟨3, 6, 5, 2⟩, ⟨1, 3, 15, 0⟩, ⟨1, 16, 5, 2⟩, + by decide, by decide, by decide, by decide, by decide⟩ + +theorem c319_eq_s0_odd : + c319_sq = (.h10B, [.A 1], enc_odd s0_odd.a s0_odd.b s0_odd.c s0_odd.d) := rfl + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + obtain ⟨n₀, hinit⟩ := init_reaches_c319 + rw [c319_eq_s0_odd] at hinit + refine IsNotHalt.of_reachesPlus_invariant hinit + (P := fun cfg => ∃ n s, P5 s ∧ cfg = decode_sq n (.h10B, [.A 1], enc_odd s.a s.b s.c s.d)) + ⟨n₀, s0_odd, P5_s0_odd, rfl⟩ ?_ + rintro cfg ⟨n, s, hP5, rfl⟩ + obtain ⟨s', hr, hP5'⟩ := P5_step s hP5 + obtain ⟨n', hplus⟩ := sqReachesPlus_to_tm (R_odd_sound s s' hP5.1.1 hr) n + exact ⟨_, hplus, n', s', hP5', rfl⟩ + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0LC_1LC0RB_0LE0LD_1LCHHH_0RA1LF_1LA1LF diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0LC_1LC0RE_1LA1LD_1LA1LB_0RF1RA_HHH0RE.lean b/BusyBeaver/BB6/NonHalt/M_1RB0LC_1LC0RE_1LA1LD_1LA1LB_0RF1RA_HHH0RE.lean new file mode 100644 index 00000000..a1642a7a --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0LC_1LC0RE_1LA1LD_1LA1LB_0RF1RA_HHH0RE.lean @@ -0,0 +1,826 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.Longitudinal + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0LC_1LC0RE_1LA1LD_1LA1LB_0RF1RA_HHH0RE + +open BusyBeaver.Longitudinal +open BusyBeaver.Longitudinal.BoundedConfig (toCfg all0_spec steps_spec steps1_spec_true + segRLs_c_spec sideRLs_c_spec) + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LC_1LC0RE_1LA1LD_1LA1LB_0RF1RA_HHH0RE" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +inductive Digit where + | U + | Z + | O +deriving DecidableEq + +open Digit + +def word : Digit → List (Fin 2) + | U => [1, 1, 0] + | Z => [0, 0] + | O => [1, 0] + +def tape : List Digit → ListBlank (Fin 2) + | [] => default + | d :: r => word d +> tape r + +abbrev hR : DH0 (Fin 2) (Fin 6) := (A, [1]) +abbrev hL : DH0 (Fin 2) (Fin 6) := (E, [0]) +abbrev h : List (DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6)) := [(hR, hL)] + +def left1 (a b : ℕ) : ListBlank (Fin 2) := + ([1, 0, 1] ^ b) +> (([1, 1, 1] ^ a) +> ([1] +> default)) + +def left2 (a b : ℕ) : ListBlank (Fin 2) := + ([1, 0, 1] ^ b) +> (([1, 1, 1] ^ a) +> ([1, 1] +> default)) + +def stateCfg (n : ℕ) (r : List Digit) : Cfg (Fin 2) (Fin 6) := + toDHCfg (hL, .left) (left1 0 n) (tape r) + +structure ElemRules (tm : Machine (Fin 2) (Fin 6)) : Prop where + rule_U : SegRLs tm h h (word U) (word U) + rule_Z : SegRLs tm h [] (word Z) (word O) + rule_O : SegRLs tm h h (word O) (word Z) + rule_nil : SideRLs tm h default (word O +> default) + rule_shortO : SegRLs tm h [] ([0] ++ word O) (word U) + step_L_101 : ∀ L r, + (toDHCfg (hL, .left) ([1, 0, 1] +> L) r) [tm]⊢* + (toDHCfg (hL, .left) L ([1, 1, 0] +> r)) + step_R_A_110 : ∀ L r, + (toDHCfg (hR, .right) L ([1, 1, 0] +> r)) [tm]⊢* + (toDHCfg (hR, .right) ([1, 0, 1] +> L) r) + step_R_C_110 : ∀ L r, + (L {{C}}> ([1, 1, 0] +> r)) [tm]⊢* (([1, 1, 1] +> L) {{C}}> r) + step_L_111_turn : ∀ L r, + (toDHCfg (hL, .left) ([1, 1, 1] +> L) r) [tm]⊢* + (toDHCfg (hR, .right) ([1, 0, 1] +> L) r) + segRL_0_to_1 : ∀ s, SegRL tm hR hL ([0] ++ s) ([1] ++ s) + step_A_to_C : ∀ l r, + (toDHCfg (hR, .right) l ([1] +> r)) [tm]⊢* (([0, 1] +> l) {{C}}> r) + step_C0_to_A : ∀ l r, + (l {{C}}> ([0] +> r)) [tm]⊢* (toDHCfg (hR, .right) l r) + step_E01_left : ∀ l r, + (toDHCfg (hL, .left) ([0, 1] +> l) r) [tm]⊢* + (toDHCfg (hL, .left) l ([0, 0] +> r)) + step_C10_to_A : ∀ l r, + (l {{C}}> ([1, 0] +> r)) [tm]⊢* (toDHCfg (hR, .right) ([1] +> l) r) + step_L20_turn : ∀ r, + (toDHCfg (hL, .left) ([1, 1] +> default) r) [tm]⊢* + (toDHCfg (hR, .right) ([1] +> default) r) + step_L1_turn_C : ∀ r, + (toDHCfg (hL, .left) ([1] +> default) r) [tm]⊢* + (([1] +> default) {{C}}> ([1, 1, 0] +> r)) + +private theorem zero_cons_default : (0 : Fin 2) >> (default : ListBlank (Fin 2)) = default := + all0_spec (a := [0]) (by decide) + +theorem mkElemRules (tm : Machine (Fin 2) (Fin 6)) + (h1 : BoundedConfig.segRLs_c tm h h (word U) (word U) 100 = true) + (h2 : BoundedConfig.segRLs_c tm h [] (word Z) (word O) 100 = true) + (h3 : BoundedConfig.segRLs_c tm h h (word O) (word Z) 100 = true) + (h4 : BoundedConfig.sideRLs_c tm h [] (word O) 100 = true) + (h5 : BoundedConfig.segRLs_c tm h [] ([0] ++ word O) (word U) 100 = true) + (h6 : BoundedConfig.steps tm 10 ⟨[0], [1, 0, 1], E, .left⟩ = + some ⟨[0, 1, 1, 0], [], E, .left⟩) + (h7 : BoundedConfig.steps tm 10 ⟨[1], [1, 1, 0], A, .right⟩ = + some ⟨[1, 1, 0, 1], [], A, .right⟩) + (h8 : BoundedConfig.steps tm 10 ⟨[], [1, 1, 0], C, .right⟩ = + some ⟨[1, 1, 1], [], C, .right⟩) + (h9 : BoundedConfig.steps tm 10 ⟨[0], [1, 1, 1], E, .left⟩ = + some ⟨[1, 1, 0, 1], [], A, .right⟩) + (h10 : BoundedConfig.steps1 tm 10 ⟨[1], [0], A, .right⟩ = + some (⟨[0, 1], [], E, .left⟩, true)) + (h11 : BoundedConfig.steps tm 10 ⟨[1], [1], A, .right⟩ = + some ⟨[0, 1], [], C, .right⟩) + (h12 : BoundedConfig.steps tm 10 ⟨[], [0], C, .right⟩ = + some ⟨[1], [], A, .right⟩) + (h13 : BoundedConfig.steps tm 10 ⟨[0], [0, 1], E, .left⟩ = + some ⟨[0, 0, 0], [], E, .left⟩) + (h14 : BoundedConfig.steps tm 10 ⟨[], [1, 0], C, .right⟩ = + some ⟨[1, 1], [], A, .right⟩) + (h15 : BoundedConfig.steps tm 10 ⟨[0], [1, 1, 0], E, .left⟩ = + some ⟨[1, 1, 0, 0], [], A, .right⟩) + (h16 : BoundedConfig.steps tm 10 ⟨[0], [1, 0], E, .left⟩ = + some ⟨[1, 1, 0], [], B, .left⟩) + (h17 : BoundedConfig.steps tm 10 ⟨[], [0], B, .left⟩ = + some ⟨[1], [], C, .right⟩) : + ElemRules tm where + rule_U := segRLs_c_spec tm (T := 100) h1 + rule_Z := segRLs_c_spec tm (T := 100) h2 + rule_O := segRLs_c_spec tm (T := 100) h3 + rule_nil := sideRLs_c_spec tm (hs := h) (r := []) (r' := word O) (T := 100) h4 + rule_shortO := segRLs_c_spec tm (T := 100) h5 + step_L_101 L r := by + have hs := steps_spec tm 10 ⟨[0], [1, 0, 1], E, .left⟩ + (x' := ⟨[0, 1, 1, 0], [], E, .left⟩) h6 L r + simpa [toCfg, toDHCfg, append_nil, append_cons] using hs + step_R_A_110 L r := by + have hs := steps_spec tm 10 ⟨[1], [1, 1, 0], A, .right⟩ + (x' := ⟨[1, 1, 0, 1], [], A, .right⟩) h7 L r + simpa [toCfg, toDHCfg, append_nil, append_cons] using hs + step_R_C_110 L r := by + have hs := steps_spec tm 10 ⟨[], [1, 1, 0], C, .right⟩ + (x' := ⟨[1, 1, 1], [], C, .right⟩) h8 L r + simpa [toCfg, append_nil, append_cons] using hs + step_L_111_turn L r := by + have hs := steps_spec tm 10 ⟨[0], [1, 1, 1], E, .left⟩ + (x' := ⟨[1, 1, 0, 1], [], A, .right⟩) h9 L r + simpa [toCfg, toDHCfg, append_nil, append_cons] using hs + segRL_0_to_1 s l r := by + have hs := steps1_spec_true tm 10 ⟨[1], [0], A, .right⟩ + (x' := ⟨[0, 1], [], E, .left⟩) h10 l (s +> r) + simpa [toCfg, toDHCfg, append_nil, append_cons] using hs + step_A_to_C l r := by + have hs := steps_spec tm 10 ⟨[1], [1], A, .right⟩ + (x' := ⟨[0, 1], [], C, .right⟩) h11 l r + simpa [toCfg, toDHCfg, append_nil, append_cons] using hs + step_C0_to_A l r := by + have hs := steps_spec tm 10 ⟨[], [0], C, .right⟩ + (x' := ⟨[1], [], A, .right⟩) h12 l r + simpa [toCfg, toDHCfg, append_nil, append_cons] using hs + step_E01_left l r := by + have hs := steps_spec tm 10 ⟨[0], [0, 1], E, .left⟩ + (x' := ⟨[0, 0, 0], [], E, .left⟩) h13 l r + simpa [toCfg, toDHCfg, append_nil, append_cons] using hs + step_C10_to_A l r := by + have hs := steps_spec tm 10 ⟨[], [1, 0], C, .right⟩ + (x' := ⟨[1, 1], [], A, .right⟩) h14 l r + simpa [toCfg, toDHCfg, append_nil, append_cons] using hs + step_L20_turn r := by + have hs := steps_spec tm 10 ⟨[0], [1, 1, 0], E, .left⟩ + (x' := ⟨[1, 1, 0, 0], [], A, .right⟩) h15 default r + simpa [toCfg, toDHCfg, append_cons, append_nil, zero_cons_default] using hs + step_L1_turn_C r := by + have hs1 : (toDHCfg (hL, .left) ([1] +> default) r) [tm]⊢* + (default <{{B}} ([1, 1, 0] +> r)) := by + have hs := steps_spec tm 10 ⟨[0], [1, 0], E, .left⟩ + (x' := ⟨[1, 1, 0], [], B, .left⟩) h16 default r + simpa [toCfg, toDHCfg, append_cons, append_nil, zero_cons_default] using hs + have hs2 : (default <{{B}} ([1, 1, 0] +> r)) [tm]⊢* + (([1] +> default) {{C}}> ([1, 1, 0] +> r)) := by + have hs := steps_spec tm 10 ⟨[], [0], B, .left⟩ + (x' := ⟨[1], [], C, .right⟩) h17 default ([1, 1, 0] +> r) + simpa [toCfg, toDHCfg, append_cons, append_nil, zero_cons_default] using hs + exact stepStar_trans hs1 hs2 + +end + +section + +open Digit + +def potential : List Digit → ℕ + | [] => 0 + | U :: r => max 2 (potential r - 2) + | Z :: r => potential r * 2 + | O :: r => 1 + potential r * 2 + +def prepend (k : ℕ) (r : List Digit) : List Digit := + List.replicate k U ++ r + +theorem tape_prepend (k : ℕ) (r : List Digit) : + tape (prepend k r) = (word U) ^ k +> tape r := by + induction k with + | zero => rfl + | succ k ih => + change word U +> tape (prepend k r) = (word U ++ (word U) ^ k) +> tape r + rw [ih, append_assoc] + +theorem potential_prepend (k : ℕ) (r : List Digit) : + potential (prepend (1 + k) r) = max 2 (potential r - (1 + k) * 2) := by + induction k with + | zero => rfl + | succ k ih => + have h_step : prepend (1 + (k + 1)) r = U :: prepend (1 + k) r := by + unfold prepend + have hk : 1 + (k + 1) = (1 + k) + 1 := by omega + rw [hk, List.replicate_succ, List.cons_append] + rw [h_step] + change max 2 (potential (prepend (1 + k) r) - 2) = max 2 (potential r - (1 + (k + 1)) * 2) + rw [ih] + omega + +theorem potential_bound (k : ℕ) (r : List Digit) : + potential r ≤ potential (prepend k r) + k * 2 := by + rcases k with _ | k + · simp [prepend] + · have hk : k + 1 = 1 + k := by omega + rw [hk, potential_prepend] + omega + +theorem prepend_U (k : ℕ) (r : List Digit) : + prepend k (U :: r) = prepend (1 + k) r := by + induction k with + | zero => rfl + | succ k ih => + have h1 : prepend (k + 1) (U :: r) = U :: prepend k (U :: r) := by + unfold prepend; rw [List.replicate_succ, List.cons_append] + have h2 : prepend (1 + (k + 1)) r = U :: prepend (1 + k) r := by + unfold prepend + have hk : 1 + (k + 1) = (1 + k) + 1 := by omega + rw [hk, List.replicate_succ, List.cons_append] + rw [h1, h2, ih] + +inductive Inc : List Digit → List Digit → Prop where + | nil : Inc [] [O] + | Z (r : List Digit) : Inc (Z :: r) (O :: r) + | O {r r' : List Digit} : Inc r r' → Inc (O :: r) (Z :: r') + | U {r r' : List Digit} : Inc r r' → Inc (U :: r) (U :: r') + +theorem Inc_total (r : List Digit) : + ∃ r', Inc r r' ∧ potential r' ≤ 1 + potential r ∧ O ∈ r' := by + induction r with + | nil => + exact ⟨[O], .nil, by simp [potential], List.Mem.head _⟩ + | cons d r ih => + obtain ⟨r', h_inc, h_pot, h_mem⟩ := ih + cases d with + | U => + refine ⟨U :: r', .U h_inc, ?_, List.Mem.tail _ h_mem⟩ + simp only [potential]; omega + | Z => + refine ⟨O :: r, .Z r, ?_, List.Mem.head _⟩ + simp only [potential]; omega + | O => + refine ⟨Z :: r', .O h_inc, ?_, List.Mem.tail _ h_mem⟩ + simp only [potential]; omega + +theorem one_comm_111_pow (k : ℕ) (L : ListBlank (Fin 2)) : + (1 : Fin 2) >> ([1, 1, 1] ^ k +> L) = [1, 1, 1] ^ k +> ((1 : Fin 2) >> L) := by + induction k with + | zero => rfl + | succ k ih => + rw [pow_succ_list, append_assoc] + dsimp [append_cons] + rw [ih] + +variable {tm : Machine (Fin 2) (Fin 6)} (R : ElemRules tm) +include R + +theorem steps_L_101 (b : ℕ) (L r : ListBlank (Fin 2)) : + (toDHCfg (hL, .left) ([1, 0, 1] ^ b +> L) r) [tm]⊢* + (toDHCfg (hL, .left) L ([1, 1, 0] ^ b +> r)) := by + induction b generalizing r with + | zero => exact stepStar_refl tm _ + | succ b ih => + rw [pow_succ_list, append_assoc] + refine stepStar_trans (R.step_L_101 ([1, 0, 1] ^ b +> L) r) ?_ + have h_ih := ih ([1, 1, 0] +> r) + rw [← append_assoc, ← pow_succ_list'] at h_ih + exact h_ih + +theorem steps_R_A_110 (b : ℕ) (L r : ListBlank (Fin 2)) : + (toDHCfg (hR, .right) L ([1, 1, 0] ^ b +> r)) [tm]⊢* + (toDHCfg (hR, .right) ([1, 0, 1] ^ b +> L) r) := by + induction b generalizing L with + | zero => exact stepStar_refl tm _ + | succ b ih => + rw [pow_succ_list [1, 1, 0] b, append_assoc] + refine stepStar_trans (R.step_R_A_110 L ([1, 1, 0] ^ b +> r)) ?_ + have h_ih := ih ([1, 0, 1] +> L) + rw [← append_assoc, ← pow_succ_list' [1, 0, 1] b] at h_ih + exact h_ih + +theorem steps_R_C_110 (k : ℕ) (L r : ListBlank (Fin 2)) : + (L {{C}}> ([1, 1, 0] ^ k +> r)) [tm]⊢* (([1, 1, 1] ^ k +> L) {{C}}> r) := by + induction k generalizing L with + | zero => exact stepStar_refl tm _ + | succ k ih => + rw [pow_succ_list [1, 1, 0] k, append_assoc] + refine stepStar_trans (R.step_R_C_110 L ([1, 1, 0] ^ k +> r)) ?_ + have h_ih := ih ([1, 1, 1] +> L) + rw [← append_assoc, ← pow_succ_list' [1, 1, 1] k] at h_ih + exact h_ih + +theorem segLR_step (a b : ℕ) (s : List (Fin 2)) : + SegLR tm hL hR + ([1, 0, 1] ^ b ++ [1, 1, 1] ^ (1 + a) ++ s) + ([1, 0, 1] ^ (1 + b) ++ [1, 1, 1] ^ a ++ s) := by + intro l r + have ha : 1 + a = a + 1 := by omega + have hb : 1 + b = b + 1 := by omega + rw [ha, hb, pow_succ_list [1, 1, 1] a, pow_succ_list' [1, 0, 1] b] + simp only [List.append_assoc, append_assoc] + refine stepStar_trans (steps_L_101 R b ([1, 1, 1] +> ([1, 1, 1] ^ a +> (s +> l))) r) ?_ + refine stepStar_trans + (R.step_L_111_turn ([1, 1, 1] ^ a +> (s +> l)) ([1, 1, 0] ^ b +> r)) ?_ + exact steps_R_A_110 R b ([1, 0, 1] +> ([1, 1, 1] ^ a +> (s +> l))) r + +theorem emissions (a b : ℕ) (s : List (Fin 2)) : + SegLRs tm ([(hL, hR)] ^ a) + ([1, 0, 1] ^ b ++ [1, 1, 1] ^ a ++ s) + ([1, 0, 1] ^ (a + b) ++ s) := by + induction a generalizing b with + | zero => + rw [Nat.zero_add, pow_zero_list, pow_zero_list, List.append_nil] + exact .nil _ + | succ a ih => + have h_add : (a + 1) + b = a + (1 + b) := by omega + have ha : a + 1 = 1 + a := by omega + rw [pow_succ_list [(hL, hR)] a, h_add, ha] + exact .cons (segLR_step R a b s) (ih (1 + b)) + +omit R in +theorem bounce (k : ℕ) (w1 w2 w3 w4 : List (Fin 2)) + (h_rr : SegRR tm hR hR w1 w3) + (h_lr : SegLRs tm ([(hL, hR)] ^ k) w3 w4) + (h_ll : SegLL tm hL hL w4 w2) : + SegRLs tm h (h ^ (1 + k)) w1 w2 := by + have hk : 1 + k = k + 1 := by omega + rw [hk, ← lrcons_same hR hL k, ← List.append_nil (lrcons hR ([(hL, hR)] ^ k) hL)] + exact SegRLs.lrcons h_rr h_ll h_lr (.nil w2) + +theorem segRR_shiftZ (k : ℕ) : + SegRR tm hR hR ([1] ++ (word U) ^ k ++ [0]) ([1, 1, 1] ^ k ++ [0, 1]) := by + intro l r + simp only [word, List.append_assoc, append_assoc] + have h1 := R.step_A_to_C l ([1, 1, 0] ^ k +> ([0] +> r)) + have h2 := steps_R_C_110 R k ([0, 1] +> l) ([0] +> r) + have h3 := R.step_C0_to_A ([1, 1, 1] ^ k +> ([0, 1] +> l)) r + exact stepStar_trans h1 (stepStar_trans h2 h3) + +theorem segLL_shiftZ (k : ℕ) : + SegLL tm hL hL ([1, 0, 1] ^ k ++ [0, 1]) (word Z ++ (word U) ^ k) := by + intro l r + simp only [word, append_assoc] + refine stepStar_trans (steps_L_101 R k ([0, 1] +> l) r) ?_ + exact R.step_E01_left l ([1, 1, 0] ^ k +> r) + +theorem rule_shiftZ (k : ℕ) : + SegRLs tm (h ^ 2) (h ^ (1 + k)) ([0] ++ (word U) ^ k ++ [0]) (word Z ++ (word U) ^ k) := by + change SegRLs tm ((hR, hL) :: h) (h ^ (1 + k)) + ([0] ++ ((word U) ^ k ++ [0])) (word Z ++ (word U) ^ k) + refine .cons (R.segRL_0_to_1 ((word U) ^ k ++ [0])) ?_ + refine bounce k ([1] ++ (word U) ^ k ++ [0]) (word Z ++ (word U) ^ k) + ([1, 1, 1] ^ k ++ [0, 1]) ([1, 0, 1] ^ k ++ [0, 1]) + (segRR_shiftZ R k) ?_ (segLL_shiftZ R k) + exact emissions R k 0 [0, 1] + +theorem segRR_shiftO (k : ℕ) : + SegRR tm hR hR ([1] ++ (word U) ^ k ++ word O) ([1, 1, 1] ^ k ++ [1, 0, 1]) := by + intro l r + simp only [word, List.append_assoc, append_assoc] + have h1 := R.step_A_to_C l ([1, 1, 0] ^ k +> ([1, 0] +> r)) + have h2 := steps_R_C_110 R k ([0, 1] +> l) ([1, 0] +> r) + have h3 := R.step_C10_to_A ([1, 1, 1] ^ k +> ([0, 1] +> l)) r + simp only [toDHCfg, append_cons, append_nil] at h1 h2 h3 ⊢ + rw [one_comm_111_pow k (0 >> 1 >> l)] at h3 + exact stepStar_trans h1 (stepStar_trans h2 h3) + +theorem segLL_shiftO (k : ℕ) : + SegLL tm hL hL ([1, 0, 1] ^ k ++ [1, 0, 1]) ((word U) ^ (1 + k)) := by + intro l r + have hk : 1 + k = k + 1 := by omega + rw [hk, ← pow_succ_list' [1, 0, 1] k] + simpa [word] using steps_L_101 R (k + 1) l r + +theorem rule_shiftO (k : ℕ) : + SegRLs tm (h ^ 2) (h ^ (1 + k)) ([0] ++ (word U) ^ k ++ word O) ((word U) ^ (1 + k)) := by + change SegRLs tm ((hR, hL) :: h) (h ^ (1 + k)) + ([0] ++ ((word U) ^ k ++ word O)) ((word U) ^ (1 + k)) + refine .cons (R.segRL_0_to_1 ((word U) ^ k ++ word O)) ?_ + refine bounce k ([1] ++ (word U) ^ k ++ word O) ((word U) ^ (1 + k)) + ([1, 1, 1] ^ k ++ [1, 0, 1]) ([1, 0, 1] ^ k ++ [1, 0, 1]) + (segRR_shiftO R k) ?_ (segLL_shiftO R k) + exact emissions R k 0 [1, 0, 1] + +theorem rule_L1 (a b : ℕ) (r : ListBlank (Fin 2)) : + (toDHCfg (hL, .left) (left1 (1 + a) b) r) [tm]⊢* + (toDHCfg (hR, .right) (left1 a (1 + b)) r) := by + have hs := segLR_step R a b [1] default r + simpa [left1, append_assoc] using hs + +theorem rule_L2 (a b : ℕ) (r : ListBlank (Fin 2)) : + (toDHCfg (hL, .left) (left2 (1 + a) b) r) [tm]⊢* + (toDHCfg (hR, .right) (left2 a (1 + b)) r) := by + have hs := segLR_step R a b [1, 1] default r + simpa [left2, append_assoc] using hs + +theorem rule_L20 (b : ℕ) (r : ListBlank (Fin 2)) : + (toDHCfg (hL, .left) (left2 0 b) r) [tm]⊢* + (toDHCfg (hR, .right) (left1 0 b) r) := by + unfold left2 left1 + refine stepStar_trans (steps_L_101 R b ([1, 1] +> default) r) ?_ + exact stepStar_trans (R.step_L20_turn ([1, 1, 0] ^ b +> r)) + (steps_R_A_110 R b ([1] +> default) r) + +omit R in +theorem merge_110 (b k : ℕ) (s : ListBlank (Fin 2)) : + [1, 1, 0] +> ([1, 1, 0] ^ b +> ([1, 1, 0] ^ k +> s)) = + ([1, 1, 0] ^ (1 + k + b)) +> s := by + have hk : 1 + k + b = (b + 1) + k := by omega + rw [hk, pow_add_list, pow_succ_list, append_assoc, append_assoc] + +theorem rule_LZ (b k : ℕ) (r : ListBlank (Fin 2)) : + (toDHCfg (hL, .left) (left1 0 b) ((word U) ^ k +> (word Z +> r))) [tm]⊢* + (toDHCfg (hR, .right) (left1 (1 + k + b) 0) ([0] +> r)) := by + unfold left1 + dsimp [word] + refine stepStar_trans (steps_L_101 R b ([1] +> default) ([1, 1, 0] ^ k +> ([0, 0] +> r))) ?_ + refine stepStar_trans (R.step_L1_turn_C ([1, 1, 0] ^ b +> ([1, 1, 0] ^ k +> ([0, 0] +> r)))) ?_ + rw [merge_110 b k ([0, 0] +> r)] + refine stepStar_trans (steps_R_C_110 R (1 + k + b) ([1] +> default) ([0, 0] +> r)) ?_ + exact R.step_C0_to_A ([1, 1, 1] ^ (1 + k + b) +> ([1] +> default)) ([0] +> r) + +theorem rule_LO (b k : ℕ) (r : ListBlank (Fin 2)) : + (toDHCfg (hL, .left) (left1 0 b) ((word U) ^ k +> (word O +> r))) [tm]⊢* + (toDHCfg (hR, .right) (left2 (1 + k + b) 0) r) := by + unfold left1 left2 + dsimp [word] + refine stepStar_trans (steps_L_101 R b ([1] +> default) ([1, 1, 0] ^ k +> ([1, 0] +> r))) ?_ + refine stepStar_trans (R.step_L1_turn_C ([1, 1, 0] ^ b +> ([1, 1, 0] ^ k +> ([1, 0] +> r)))) ?_ + rw [merge_110 b k ([1, 0] +> r)] + refine stepStar_trans (steps_R_C_110 R (1 + k + b) ([1] +> default) ([1, 0] +> r)) ?_ + have h_end := R.step_C10_to_A ([1, 1, 1] ^ (1 + k + b) +> ([1] +> default)) r + simp only [toDHCfg, append_cons, append_nil] at h_end ⊢ + rw [one_comm_111_pow (1 + k + b) (1 >> default)] at h_end + exact h_end + +theorem Inc_spec {r r' : List Digit} (h_inc : Inc r r') : + SideRLs tm h (tape r) (tape r') := by + induction h_inc with + | nil => exact R.rule_nil + | Z r => exact R.rule_Z.sideRLs_concat (.nil (tape r)) + | O _ ih => exact R.rule_O.sideRLs_concat ih + | U _ ih => exact R.rule_U.sideRLs_concat ih + +theorem incs_total (m : ℕ) (r : List Digit) : + ∃ r', SideRLs tm (h ^ m) (tape r) (tape r') ∧ + potential r' ≤ m + potential r ∧ (0 < m → O ∈ r') := by + induction m with + | zero => + exact ⟨r, .nil (tape r), by omega, by omega⟩ + | succ m ih => + obtain ⟨r', h_side, h_pot, _⟩ := ih + obtain ⟨r'', h_inc, h_pot', h_mem⟩ := Inc_total r' + refine ⟨r'', h_side.trans_succ (Inc_spec R h_inc), by omega, fun _ => h_mem⟩ + +theorem U_pass (n k : ℕ) : + SegRLs tm (h ^ n) (h ^ n) ((word U) ^ k) ((word U) ^ k) := by + induction k with + | zero => exact SegRLs.empty tm (h ^ n) + | succ k ih => + rw [pow_succ_list (word U) k] + exact (R.rule_U.wall_pow n).concat ih + +theorem Z_even (n : ℕ) : + SegRLs tm (h ^ (n * 2)) (h ^ n) (word Z) (word Z) := by + induction n with + | zero => exact .nil (word Z) + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq, pow_add_list, pow_succ_list h n] + have h_step : SegRLs tm (h ^ 2) h (word Z) (word Z) := by + simpa using R.rule_Z.trans R.rule_O + exact h_step.trans ih + +theorem Z_odd (n : ℕ) : + SegRLs tm (h ^ (1 + n * 2)) (h ^ n) (word Z) (word O) := by + have h_eq : 1 + n * 2 = n * 2 + 1 := by omega + rw [h_eq, pow_add_list, ← List.append_nil (h ^ n)] + exact (Z_even R n).trans R.rule_Z + +theorem shiftZ_even (k n : ℕ) : + SegRLs tm (h ^ (2 + n * 2)) (h ^ (1 + k + n)) + ([0] ++ (word U) ^ k ++ [0]) (word Z ++ (word U) ^ k) := + (rule_shiftZ R k).trans_add ((Z_even R n).concat (U_pass R n k)) + +theorem shiftZ_odd (k n : ℕ) : + SegRLs tm (h ^ (3 + n * 2)) (h ^ (1 + k + n)) + ([0] ++ (word U) ^ k ++ [0]) (word O ++ (word U) ^ k) := by + have h_eq : 3 + n * 2 = 2 + (1 + n * 2) := by omega + rw [h_eq] + exact (rule_shiftZ R k).trans_add ((Z_odd R n).concat (U_pass R n k)) + +theorem shiftO (k n : ℕ) : + SegRLs tm (h ^ (2 + n)) (h ^ (1 + k + n)) + ([0] ++ (word U) ^ k ++ word O) ((word U) ^ (1 + k)) := + (rule_shiftO R k).trans_add (U_pass R n (1 + k)) + +def Normalized (tm : Machine (Fin 2) (Fin 6)) (r : List Digit) (m : ℕ) : Prop := + ∃ r', SideRLs tm (h ^ m) ([0] +> tape r) (tape r') ∧ potential r' ≤ m + potential r + +theorem normalize_empty (m : ℕ) : Normalized tm [] m := by + obtain ⟨r', h_side, h_pot, _⟩ := incs_total R m [] + refine ⟨r', ?_, h_pot⟩ + have h0 : ([0] : List (Fin 2)) +> (default : ListBlank (Fin 2)) = default := + all0_spec (a := [0]) (by decide) + change SideRLs tm (h ^ m) ([0] +> default) (tape r') + rwa [h0] + +theorem normalize_Z (r : List Digit) + (ih : ∀ m, potential r ≤ m → Normalized tm r m) + (k m : ℕ) (h_bound : potential (prepend k (Z :: r)) ≤ m) : + Normalized tm (prepend k (Z :: r)) m := by + rcases k with _ | k + · dsimp [prepend, potential] at h_bound + rcases Nat.mod_two_eq_zero_or_one m with hm0 | hm1 + · obtain ⟨r', h_side, h_pot⟩ := ih (m / 2) (by omega) + refine ⟨Z :: r', ?_, ?_⟩ + · have h_eq : m = (m / 2) * 2 := by omega + rw [h_eq] + change SideRLs tm (h ^ ((m / 2) * 2)) (word Z +> ([0] +> tape r)) (word Z +> tape r') + exact (Z_even R (m / 2)).sideRLs_concat h_side + · dsimp [prepend, potential]; omega + · obtain ⟨r', h_side, h_pot⟩ := ih (m / 2) (by omega) + refine ⟨O :: r', ?_, ?_⟩ + · have h_eq : m = 1 + (m / 2) * 2 := by omega + rw [h_eq] + change SideRLs tm (h ^ (1 + (m / 2) * 2)) (word Z +> ([0] +> tape r)) (word O +> tape r') + exact (Z_odd R (m / 2)).sideRLs_concat h_side + · dsimp [prepend, potential]; omega + · have hk : k + 1 = 1 + k := by omega + rw [hk] at h_bound ⊢ + rw [potential_prepend] at h_bound + set p := m - 2 + have hmp : m = 2 + p := by omega + set q := p / 2 + rcases Nat.mod_two_eq_zero_or_one p with hp0 | hp1 + · obtain ⟨r', h_side, h_pot⟩ := ih (1 + (1 + k) + q) (by dsimp [potential] at h_bound; omega) + refine ⟨Z :: prepend (1 + k) r', ?_, ?_⟩ + · have h_m_eq : m = 2 + q * 2 := by omega + rw [h_m_eq, tape_prepend] + change SideRLs tm (h ^ (2 + q * 2)) + ([0] +> ((word U) ^ (1 + k) +> (word Z +> tape r))) + (word Z +> tape (prepend (1 + k) r')) + rw [tape_prepend] + have h_seg := (shiftZ_even R (1 + k) q).sideRLs_concat h_side + have h_lhs : ([0] ++ (word U) ^ (1 + k) ++ [0]) +> ([0] +> tape r) = + [0] +> ((word U) ^ (1 + k) +> (word Z +> tape r)) := by + simp only [word, List.append_assoc, append_assoc, append_cons, append_nil] + have h_rhs : (word Z ++ (word U) ^ (1 + k)) +> tape r' = + word Z +> ((word U) ^ (1 + k) +> tape r') := by + rw [append_assoc] + rwa [h_lhs, h_rhs] at h_seg + · dsimp [potential] at h_bound ⊢ + rw [potential_prepend, potential_prepend] + dsimp [potential] + omega + · obtain ⟨r', h_side, h_pot⟩ := ih (1 + (1 + k) + q) (by dsimp [potential] at h_bound; omega) + refine ⟨O :: prepend (1 + k) r', ?_, ?_⟩ + · have h_m_eq : m = 3 + q * 2 := by omega + rw [h_m_eq, tape_prepend] + change SideRLs tm (h ^ (3 + q * 2)) + ([0] +> ((word U) ^ (1 + k) +> (word Z +> tape r))) + (word O +> tape (prepend (1 + k) r')) + rw [tape_prepend] + have h_seg := (shiftZ_odd R (1 + k) q).sideRLs_concat h_side + have h_lhs : ([0] ++ (word U) ^ (1 + k) ++ [0]) +> ([0] +> tape r) = + [0] +> ((word U) ^ (1 + k) +> (word Z +> tape r)) := by + simp only [word, List.append_assoc, append_assoc, append_cons, append_nil] + have h_rhs : (word O ++ (word U) ^ (1 + k)) +> tape r' = + word O +> ((word U) ^ (1 + k) +> tape r') := by + rw [append_assoc] + rwa [h_lhs, h_rhs] at h_seg + · dsimp [potential] at h_bound ⊢ + rw [potential_prepend, potential_prepend] + dsimp [potential] + omega + +theorem normalize_O (r : List Digit) (k m : ℕ) + (h_bound : potential (prepend k (O :: r)) ≤ m) : + Normalized tm (prepend k (O :: r)) m := by + rcases k with _ | k + · dsimp [prepend, potential] at h_bound + rcases m with _ | m + · omega + · obtain ⟨r', h_side, h_pot, _⟩ := incs_total R m r + refine ⟨U :: r', ?_, ?_⟩ + · have hm : m + 1 = 1 + m := by omega + rw [hm, pow_add_list] + have h1 : SideRLs tm h ([0] +> tape (O :: r)) (word U +> tape r) := by + have hs := R.rule_shortO.sideRLs_concat (.nil (tape r)) + simpa [tape, append_assoc] using hs + have h2 : SideRLs tm (h ^ m) (word U +> tape r) (tape (U :: r')) := + (R.rule_U.wall_pow m).sideRLs_concat h_side + exact h1.trans h2 + · dsimp [prepend, potential]; omega + · have hk : k + 1 = 1 + k := by omega + rw [hk] at h_bound ⊢ + rw [potential_prepend] at h_bound + set p := m - 2 + have hmp : m = 2 + p := by omega + obtain ⟨r', h_side, h_pot, _⟩ := incs_total R (1 + (1 + k) + p) r + refine ⟨prepend (1 + (1 + k)) r', ?_, ?_⟩ + · rw [hmp, tape_prepend, tape_prepend] + change SideRLs tm (h ^ (2 + p)) + ([0] +> ((word U) ^ (1 + k) +> (word O +> tape r))) + ((word U) ^ (1 + (1 + k)) +> tape r') + have h_seg := (shiftO R (1 + k) p).sideRLs_concat h_side + have h_lhs : ([0] ++ (word U) ^ (1 + k) ++ word O) +> tape r = + [0] +> ((word U) ^ (1 + k) +> (word O +> tape r)) := by + simp only [List.append_assoc, append_assoc] + rwa [h_lhs] at h_seg + · rw [potential_prepend, potential_prepend] + dsimp [potential] at h_bound ⊢ + omega + +theorem normalize_digits (r : List Digit) : + ∀ k m, potential (prepend k r) ≤ m → Normalized tm (prepend k r) m := by + induction r with + | nil => + intro k m h_bound + have h_z : Normalized tm (prepend k [Z]) m := by + refine normalize_Z R [] (fun m' _ => normalize_empty R m') k m ?_ + rcases k with _ | k + · dsimp [prepend, potential] at h_bound ⊢; omega + · have hk : k + 1 = 1 + k := by omega + rw [hk, potential_prepend] at h_bound ⊢ + dsimp [potential] at h_bound ⊢ + omega + obtain ⟨r', h_side, h_pot⟩ := h_z + refine ⟨r', ?_, ?_⟩ + · rw [tape_prepend] at h_side ⊢ + have hz0 : tape [Z] = default := by + change ([0, 0] : List (Fin 2)) +> (default : ListBlank (Fin 2)) = default + exact all0_spec (a := [0, 0]) (by decide) + rwa [hz0] at h_side + · rcases k with _ | k + · dsimp [prepend, potential] at h_pot ⊢; omega + · have hk : k + 1 = 1 + k := by omega + rw [hk, potential_prepend] at h_pot ⊢ + dsimp [potential] at h_pot ⊢ + omega + | cons d r ih => + intro k m h_bound + cases d with + | U => + rw [prepend_U] at h_bound ⊢ + exact ih (1 + k) m h_bound + | Z => + exact normalize_Z R r (ih 0) k m h_bound + | O => + exact normalize_O R r k m h_bound + +theorem normalize_positive (r : List Digit) (m : ℕ) (h_lt : potential r < m) : + ∃ r', SideRLs tm (h ^ m) ([0] +> tape r) (tape r') ∧ + potential r' ≤ m + potential r ∧ O ∈ r' := by + rcases m with _ | m + · omega + · obtain ⟨r', h_side, h_pot⟩ := normalize_digits R r 0 m (by dsimp [prepend]; omega) + dsimp [prepend] at h_side h_pot + obtain ⟨r'', h_inc, h_pot', h_mem⟩ := Inc_total r' + refine ⟨r'', h_side.trans_succ (Inc_spec R h_inc), by omega, h_mem⟩ + +theorem left1_calls (a : ℕ) : + ∀ b r r', SideRLs tm (h ^ a) r r' → + (toDHCfg (hL, .left) (left1 a b) r) [tm]⊢* + (toDHCfg (hL, .left) (left1 0 (b + a)) r') := by + induction a with + | zero => + intro b r r' h_side + cases h_side + rw [Nat.add_zero] + | succ a ih => + intro b r r' h_side + rw [pow_succ_list h a] at h_side + obtain ⟨s, h1, ha⟩ := h_side.split + have h_add : b + (a + 1) = (1 + b) + a := by omega + have ha1 : a + 1 = 1 + a := by omega + rw [h_add, ha1] + exact stepStar_trans (rule_L1 R a b r) + (stepStar_trans (stepPlus_to_stepStar (h1.elim_single (left1 a (1 + b)))) + (ih (1 + b) s r' ha)) + +theorem left2_calls (a : ℕ) : + ∀ b r r', SideRLs tm (h ^ (1 + a)) r r' → + (toDHCfg (hL, .left) (left2 a b) r) [tm]⊢* + (toDHCfg (hL, .left) (left1 0 (b + a)) r') := by + induction a with + | zero => + intro b r r' h_side + exact stepStar_trans (rule_L20 R b r) + (stepPlus_to_stepStar (h_side.elim_single (left1 0 b))) + | succ a ih => + intro b r r' h_side + have h_pow : h ^ (1 + (a + 1)) = h ++ h ^ (1 + a) := by + have hk : 1 + (a + 1) = (1 + a) + 1 := by omega + rw [hk, pow_succ_list] + rw [h_pow] at h_side + obtain ⟨s, h1, ha⟩ := h_side.split + have h_add : b + (a + 1) = (1 + b) + a := by omega + have ha1 : a + 1 = 1 + a := by omega + rw [h_add, ha1] + exact stepStar_trans (rule_L2 R a b r) + (stepStar_trans (stepPlus_to_stepStar (h1.elim_single (left2 a (1 + b)))) + (ih (1 + b) s r' ha)) + +theorem left1_send (a b : ℕ) (r r' : ListBlank (Fin 2)) + (h_side : SideRLs tm (h ^ (1 + a)) r r') : + (toDHCfg (hR, .right) (left1 a b) r) [tm]⊢⁺ + (toDHCfg (hL, .left) (left1 0 (b + a)) r') := by + have hk : 1 + a = a + 1 := by omega + rw [hk, pow_succ_list] at h_side + obtain ⟨s, h1, ha⟩ := h_side.split + exact stepPlus_stepStar_trans (h1.elim_single (left1 a b)) (left1_calls R a b s r' ha) + +theorem left2_send (a b : ℕ) (r r' : ListBlank (Fin 2)) + (h_side : SideRLs tm (h ^ (2 + a)) r r') : + (toDHCfg (hR, .right) (left2 a b) r) [tm]⊢⁺ + (toDHCfg (hL, .left) (left1 0 (b + a)) r') := by + have hk : 2 + a = (1 + a) + 1 := by omega + rw [hk, pow_succ_list] at h_side + obtain ⟨s, h1, ha⟩ := h_side.split + exact stepPlus_stepStar_trans (h1.elim_single (left2 a b)) (left2_calls R a b s r' ha) + +omit R in +theorem first_digit (r : List Digit) (h_mem : O ∈ r) : + ∃ k d t, r = prepend k (d :: t) ∧ (d = Z ∨ d = O) := by + induction r with + | nil => cases h_mem + | cons d r ih => + cases d with + | U => + cases h_mem with + | tail _ h_mem' => + obtain ⟨k, d', t, rfl, hd⟩ := ih h_mem' + refine ⟨1 + k, d', t, ?_, hd⟩ + unfold prepend + have hk : 1 + k = k + 1 := by omega + rw [hk, List.replicate_succ, List.cons_append] + | Z => + exact ⟨0, Z, r, rfl, Or.inl rfl⟩ + | O => + exact ⟨0, O, r, rfl, Or.inr rfl⟩ + +theorem next_step (n : ℕ) (r : List Digit) (h_mem : O ∈ r) (h_pot : potential r ≤ n * 2) : + ∃ n' r', ((stateCfg n r) [tm]⊢⁺ (stateCfg n' r')) ∧ O ∈ r' ∧ potential r' ≤ n' * 2 := by + obtain ⟨k, d, t, rfl, hd⟩ := first_digit r h_mem + have h_pb := potential_bound k (d :: t) + rcases hd with rfl | rfl + · dsimp [potential] at h_pb + obtain ⟨r', h_side, h_pot', h_mem'⟩ := normalize_positive R t (2 + k + n) (by omega) + refine ⟨1 + k + n, r', ?_, h_mem', by omega⟩ + unfold stateCfg + rw [tape_prepend] + dsimp [tape] + have h_lz := rule_LZ R n k (tape t) + have h_s1 := left1_send R (1 + k + n) 0 ([0] +> tape t) (tape r') (by + have hk : 1 + (1 + k + n) = 2 + k + n := by omega + rwa [hk]) + rw [Nat.zero_add] at h_s1 + exact stepStar_stepPlus_trans h_lz h_s1 + · dsimp [potential] at h_pb + obtain ⟨r', h_side, h_pot', h_mem'⟩ := incs_total R (3 + k + n) t + refine ⟨1 + k + n, r', ?_, h_mem' (by omega), by omega⟩ + unfold stateCfg + rw [tape_prepend] + dsimp [tape] + have h_lo := rule_LO R n k (tape t) + have h_s2 := left2_send R (1 + k + n) 0 (tape t) (tape r') (by + have hk : 2 + (1 + k + n) = 3 + k + n := by omega + rwa [hk]) + rw [Nat.zero_add] at h_s2 + exact stepStar_stepPlus_trans h_lo h_s2 + +end + +@[expose] public section + +open Digit + +theorem does_not_halt_of_elem_rules (M : Machine (Fin 2) (Fin 6)) + (R : ElemRules (flipTM M)) + (h_init : (init []) [flipTM M]⊢* (stateCfg 1 [U, O])) : + IsNotHalt M := by + refine Counter.does_not_halt_of_invariant + (Inv := fun c => ∃ n r, c = flipCfg (stateCfg n r) ∧ O ∈ r ∧ potential r ≤ n * 2) + ⟨flipCfg (stateCfg 1 [U, O]), stepStar_unflipTM h_init, 1, [U, O], rfl, by decide, by decide⟩ ?_ + rintro _ ⟨n, r, rfl, h_mem, h_pot⟩ + obtain ⟨n', r', h_step, h_mem', h_pot'⟩ := next_step R n r h_mem h_pot + exact ⟨flipCfg (stateCfg n' r'), stepPlus_unflipTM h_step, n', r', rfl, h_mem', h_pot'⟩ + +set_option maxHeartbeats 2000000 in +-- Justification: Finite computation of the 17 elementary tile rules and initial stem. +theorem is_not_halt : IsNotHalt target := by + refine does_not_halt_of_elem_rules target + (mkElemRules (flipTM target) + (by decide) (by decide) (by decide) (by decide) (by decide) (by decide) + (by decide) (by decide) (by decide) (by decide) (by decide) (by decide) + (by decide) (by decide) (by decide) (by decide) (by decide)) ?_ + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + unfold stateCfg toDHCfg left1 + dsimp [tape, word] + bb_steps + +end + +end BusyBeaver.M_1RB0LC_1LC0RE_1LA1LD_1LA1LB_0RF1RA_HHH0RE diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0LC_1LC0RE_1LA1LD_1LA1LF_0RB1RA_1LCHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0LC_1LC0RE_1LA1LD_1LA1LF_0RB1RA_1LCHHH.lean new file mode 100644 index 00000000..a238695c --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0LC_1LC0RE_1LA1LD_1LA1LF_0RB1RA_1LCHHH.lean @@ -0,0 +1,47 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.BB6.NonHalt.M_1RB0LC_1LC0RE_1LA1LD_1LA1LB_0RF1RA_HHH0RE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0LC_1LC0RE_1LA1LD_1LA1LF_0RB1RA_1LCHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LC_1LC0RE_1LA1LD_1LA1LF_0RB1RA_1LCHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +open BusyBeaver.Longitudinal +open BusyBeaver.M_1RB0LC_1LC0RE_1LA1LD_1LA1LB_0RF1RA_HHH0RE + +public section + +set_option maxHeartbeats 2000000 in +-- Justification: Finite computation of the 17 elementary tile rules and initial stem. +theorem is_not_halt : IsNotHalt target := by + refine does_not_halt_of_elem_rules target + (mkElemRules (flipTM target) + (by decide) (by decide) (by decide) (by decide) (by decide) (by decide) + (by decide) (by decide) (by decide) (by decide) (by decide) (by decide) + (by decide) (by decide) (by decide) (by decide) (by decide)) ?_ + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + unfold stateCfg toDHCfg left1 + dsimp [tape, word] + bb_steps + +end + +end BusyBeaver.M_1RB0LC_1LC0RE_1LA1LD_1LA1LF_0RB1RA_1LCHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0LD_1LC1RB_0LA0LD_1LE0RB_1RF0RE_HHH0RD.lean b/BusyBeaver/BB6/NonHalt/M_1RB0LD_1LC1RB_0LA0LD_1LE0RB_1RF0RE_HHH0RD.lean new file mode 100644 index 00000000..b617dd5b --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0LD_1LC1RB_0LA0LD_1LE0RB_1RF0RE_HHH0RD.lean @@ -0,0 +1,1281 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Longitudinal + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0LD_1LC1RB_0LA0LD_1LE0RB_1RF0RE_HHH0RD + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LD_1LC1RB_0LA0LD_1LE0RB_1RF0RE_HHH0RD" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +set_option maxRecDepth 200000 +set_option maxHeartbeats 20000000 +open BusyBeaver.Longitudinal.BoundedConfig (BCfg toCfg step_r0inf step_r0inf_spec + steps_spec steps1_spec_true all0_spec eqAppR0inf eqAppR0inf_spec) + +theorem neverHaltsFrom_of_reachesStar {c₁ c₂ : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [target_tm]⊢* c₂) (h₂ : NeverHaltsFrom target_tm c₂) : + NeverHaltsFrom target_tm c₁ := by + obtain ⟨k₀, hk₀⟩ := h₁ + intro cfg ⟨k, hk⟩ + rcases Nat.lt_or_ge k k₀ with hlt | hge + · rcases hstep_cfg : step target_tm cfg with _ | _ + · have hnone : (step target_tm cfg).isNone := by simp [hstep_cfg] + have hnone_k₀ : multiStep target_tm c₁ k₀ = none := by + have hsplit : k₀ = k + (k₀ - k) := by omega + rw [hsplit] + exact multiStep_eq_none_of_isNone hk hnone (by omega) + rw [hnone_k₀] at hk₀ + cases hk₀ + · rfl + · have hsplit : k = k₀ + (k - k₀) := by omega + rw [hsplit, multiStep_add, hk₀, Option.bind_some] at hk + exact h₂ cfg ⟨k - k₀, hk⟩ + +theorem B_ones (M : ℕ) (l r : ListBlank (Fin 2)) : + (l {{B}}> (([1] : List (Fin 2)) ^ M +> r)) [target_tm]⊢* + ((([1] : List (Fin 2)) ^ M +> l) {{B}}> r) := by + induction M generalizing l with + | zero => exact ⟨0, rfl⟩ + | succ M ih => + have h₁ := steps_spec target_tm 5 ⟨[], [1], B, .right⟩ + (x' := ⟨[1], [], B, .right⟩) (by decide) l (([1] : List (Fin 2)) ^ M +> r) + dsimp only [toCfg, ListBlank.append_nil] at h₁ + rw [pow_succ_list, ListBlank.append_assoc] + refine stepStar_trans h₁ ?_ + have h₂ := ih ([1] +> l) + rwa [ListBlank.append_pow_comm ([1] : List (Fin 2)) M l] at h₂ + +theorem back_pairs (M : ℕ) (l r : ListBlank (Fin 2)) : + ((([1, 1] : List (Fin 2)) ^ M +> l) <{{D}} ([0] +> r)) [target_tm]⊢* + (l <{{D}} ([0] +> (([0, 1] : List (Fin 2)) ^ M +> r))) := by + induction M generalizing r with + | zero => exact ⟨0, rfl⟩ + | succ M ih => + have h₁ := steps_spec target_tm 10 ⟨[0], [1, 1], D, .left⟩ + (x' := ⟨[0, 0, 1], [], D, .left⟩) (by decide) + (([1, 1] : List (Fin 2)) ^ M +> l) r + dsimp only [toCfg, ListBlank.append_nil] at h₁ + have h_lhs : ([1, 1] : List (Fin 2)) ^ (M + 1) +> l = + [1, 1] +> (([1, 1] : List (Fin 2)) ^ M +> l) := by + rw [pow_succ_list, ListBlank.append_assoc] + have h_mid : ([0, 0, 1] : List (Fin 2)) +> r = [0] +> ([0, 1] +> r) := rfl + rw [h_lhs] + rw [h_mid] at h₁ + refine stepStar_trans h₁ ?_ + have h₂ := ih ([0, 1] +> r) + rwa [ListBlank.append_pow_succ' ([0, 1] : List (Fin 2)) M r] at h₂ + +theorem cross_pairs (M : ℕ) (l r : ListBlank (Fin 2)) : + (([1, 0, 0, 1] +> l) {{B}}> (([0, 1] : List (Fin 2)) ^ M +> r)) [target_tm]⊢* + (([1, 0, 0, 1] +> (([1, 1] : List (Fin 2)) ^ M +> l)) {{B}}> r) := by + induction M generalizing l with + | zero => exact ⟨0, rfl⟩ + | succ M ih => + have h₁ := steps_spec target_tm 20 ⟨[1, 0, 0, 1], [0, 1], B, .right⟩ + (x' := ⟨[1, 0, 0, 1, 1, 1], [], B, .right⟩) (by decide) + l (([0, 1] : List (Fin 2)) ^ M +> r) + dsimp only [toCfg, ListBlank.append_nil] at h₁ + have h_rhs : ([1, 0, 0, 1, 1, 1] : List (Fin 2)) +> l = + [1, 0, 0, 1] +> ([1, 1] +> l) := rfl + rw [pow_succ_list, ListBlank.append_assoc] + rw [h_rhs] at h₁ + refine stepStar_trans h₁ ?_ + have h₂ := ih ([1, 1] +> l) + rwa [ListBlank.append_pow_comm ([1, 1] : List (Fin 2)) M l] at h₂ + +theorem recharge_pairs (M : ℕ) (l r : ListBlank (Fin 2)) : + (([1, 1, 0, 0, 1] +> l) {{B}}> (([0, 1] : List (Fin 2)) ^ M +> r)) [target_tm]⊢* + (([1, 1, 0, 0, 1] +> (([0, 0] : List (Fin 2)) ^ M +> l)) {{B}}> r) := by + induction M generalizing l with + | zero => exact ⟨0, rfl⟩ + | succ M ih => + have h₁ := steps_spec target_tm 20 ⟨[1, 1, 0, 0, 1], [0, 1], B, .right⟩ + (x' := ⟨[1, 1, 0, 0, 1, 0, 0], [], B, .right⟩) (by decide) + l (([0, 1] : List (Fin 2)) ^ M +> r) + dsimp only [toCfg, ListBlank.append_nil] at h₁ + have h_rhs : ([1, 1, 0, 0, 1, 0, 0] : List (Fin 2)) +> l = + [1, 1, 0, 0, 1] +> ([0, 0] +> l) := rfl + rw [pow_succ_list, ListBlank.append_assoc] + rw [h_rhs] at h₁ + refine stepStar_trans h₁ ?_ + have h₂ := ih ([0, 0] +> l) + rwa [ListBlank.append_pow_comm ([0, 0] : List (Fin 2)) M l] at h₂ + +theorem cross_raw (N : ℕ) (l r : ListBlank (Fin 2)) : + (([0, 0] +> l) <{{D}} ([0, 1, 1] +> (([0, 1] : List (Fin 2)) ^ N +> r))) [target_tm]⊢* + (([1, 0, 0, 1] +> (([1, 1] : List (Fin 2)) ^ N +> ([1] +> l))) {{B}}> r) := by + have h₁ := steps_spec target_tm 20 ⟨[0, 1, 1], [0, 0], D, .left⟩ + (x' := ⟨[1, 0, 0, 1, 1], [], B, .right⟩) (by decide) + l (([0, 1] : List (Fin 2)) ^ N +> r) + dsimp only [toCfg, ListBlank.append_nil] at h₁ + have h_mid : ([1, 0, 0, 1, 1] : List (Fin 2)) +> l = [1, 0, 0, 1] +> ([1] +> l) := rfl + rw [h_mid] at h₁ + exact stepStar_trans h₁ (cross_pairs N ([1] +> l) r) + +theorem back_raw (N : ℕ) (l r : ListBlank (Fin 2)) : + ((([1, 1] : List (Fin 2)) ^ N +> ([1, 0, 0] +> l)) <{{D}} ([0, 0, 1] +> r)) [target_tm]⊢* + (([0] +> l) <{{D}} ([0, 1, 1] +> (([0, 1] : List (Fin 2)) ^ (N + 1) +> r))) := by + have h_lhs : ([0, 0, 1] : List (Fin 2)) +> r = [0] +> ([0, 1] +> r) := rfl + rw [h_lhs] + refine stepStar_trans (back_pairs N ([1, 0, 0] +> l) ([0, 1] +> r)) ?_ + have h₂ := steps_spec target_tm 20 ⟨[0, 0, 1], [1, 0], D, .left⟩ + (x' := ⟨[0, 1, 1, 0, 1], [], D, .left⟩) (by decide) + ([0] +> l) (([0, 1] : List (Fin 2)) ^ N +> r) + dsimp only [toCfg, ListBlank.append_nil] at h₂ + have h_mid : ([0] : List (Fin 2)) +> (([0, 1] : List (Fin 2)) ^ N +> ([0, 1] +> r)) = + [0, 0, 1] +> (([0, 1] : List (Fin 2)) ^ N +> r) := by + rw [ListBlank.append_pow_succ' ([0, 1] : List (Fin 2)) N r] + rfl + have h_l : ([1, 0] : List (Fin 2)) +> ([0] +> l) = [1, 0, 0] +> l := rfl + have h_rhs : ([0, 1, 1, 0, 1] : List (Fin 2)) +> (([0, 1] : List (Fin 2)) ^ N +> r) = + [0, 1, 1] +> (([0, 1] : List (Fin 2)) ^ (N + 1) +> r) := by + rw [pow_succ_list, ListBlank.append_assoc] + rfl + rw [h_l, h_rhs] at h₂ + rwa [h_mid] + +theorem bounce_pairs (k : ℕ) (L r : ListBlank (Fin 2)) : + (([1] +> L) {{B}}> (([1, 1] : List (Fin 2)) ^ k +> ([0] +> r))) [target_tm]⊢* + (L <{{D}} ([0] +> (([0, 1] : List (Fin 2)) ^ k +> ([1] +> r)))) := by + have h₁ := B_ones (2 * k) ([1] +> L) ([0] +> r) + rw [← one_pow_two_mul k] at h₁ + rw [swap_1_11_pow k L] at h₁ + have h₂ := steps_spec target_tm 10 ⟨[1], [0], B, .right⟩ + (x' := ⟨[0, 1], [], D, .left⟩) (by decide) + (([1, 1] : List (Fin 2)) ^ k +> L) r + dsimp only [toCfg, ListBlank.append_nil] at h₂ + have h_mid : ([0, 1] : List (Fin 2)) +> r = [0] +> ([1] +> r) := rfl + rw [h_mid] at h₂ + exact stepStar_trans h₁ (stepStar_trans h₂ (back_pairs k L ([1] +> r))) + +theorem R1_raw (l r : ListBlank (Fin 2)) (N a : ℕ) : + (([0, 0, 0, 0] +> l) <{{D}} + ([0, 1, 1] +> (([0, 1] : List (Fin 2)) ^ N +> + ([0, 1, 1, 1, 1, 1, 1, 1] +> (([1, 1] : List (Fin 2)) ^ a +> ([0] +> r)))))) + [target_tm]⊢* + (([0] +> l) <{{D}} + ([0, 1, 1] +> (([0, 1] : List (Fin 2)) ^ (N + 2) +> + ([0, 1, 1, 1, 1] +> (([0, 1] : List (Fin 2)) ^ a +> ([0, 1, 1] +> r)))))) := by + let L : ListBlank (Fin 2) := ([1, 1] : List (Fin 2)) ^ N +> ([1, 0, 0] +> l) + have h₁ : (([0, 0, 0, 0] +> l) <{{D}} + ([0, 1, 1] +> (([0, 1] : List (Fin 2)) ^ N +> + ([0, 1, 1, 1, 1, 1, 1, 1] +> (([1, 1] : List (Fin 2)) ^ a +> ([0] +> r)))))) + [target_tm]⊢* + (([1, 0, 0, 1] +> L) {{B}}> + ([0, 1, 1, 1, 1, 1, 1, 1] +> (([1, 1] : List (Fin 2)) ^ a +> ([0] +> r)))) := + cross_raw N ([0, 0] +> l) + ([0, 1, 1, 1, 1, 1, 1, 1] +> (([1, 1] : List (Fin 2)) ^ a +> ([0] +> r))) + have h₂ := steps_spec target_tm 50 ⟨[1, 0, 0, 1], [0, 1, 1, 1, 1, 1, 1, 1], B, .right⟩ + (x' := ⟨[1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1], [], B, .right⟩) (by decide) + L (([1, 1] : List (Fin 2)) ^ a +> ([0] +> r)) + dsimp only [toCfg, ListBlank.append_nil] at h₂ + have h₂_rhs : ([1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1] : List (Fin 2)) +> L = + [1] +> ([1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1] +> L) := rfl + rw [h₂_rhs] at h₂ + have h₃ := bounce_pairs a ([1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1] +> L) r + have h₄ := steps_spec target_tm 200 ⟨[0], [1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1], D, .left⟩ + (x' := ⟨[0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1], [], D, .left⟩) (by decide) + L (([0, 1] : List (Fin 2)) ^ a +> ([1] +> r)) + dsimp only [toCfg, ListBlank.append_nil] at h₄ + have h₄_rhs : ([0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1] : List (Fin 2)) +> + (([0, 1] : List (Fin 2)) ^ a +> ([1] +> r)) = + [0, 0, 1] +> ([0, 1] +> ([0, 1, 1, 1, 1] +> + (([0, 1] : List (Fin 2)) ^ a +> ([0, 1, 1] +> r)))) := by + have h_comm := (ListBlank.append_pow_comm ([0, 1] : List (Fin 2)) a ([1] +> r)).symm + change [0, 0, 1, 0, 1, 0, 1, 1, 1, 1] +> ([0, 1] +> (([0, 1] : List (Fin 2)) ^ a +> ([1] +> r))) = _ + rw [h_comm] + rfl + rw [h₄_rhs] at h₄ + have h₅ := back_raw N l + ([0, 1] +> ([0, 1, 1, 1, 1] +> (([0, 1] : List (Fin 2)) ^ a +> ([0, 1, 1] +> r)))) + have h₅_rhs : ([0, 1] : List (Fin 2)) ^ (N + 1) +> + ([0, 1] +> ([0, 1, 1, 1, 1] +> (([0, 1] : List (Fin 2)) ^ a +> ([0, 1, 1] +> r)))) = + ([0, 1] : List (Fin 2)) ^ (N + 2) +> + ([0, 1, 1, 1, 1] +> (([0, 1] : List (Fin 2)) ^ a +> ([0, 1, 1] +> r))) := by + exact ListBlank.append_pow_succ' ([0, 1] : List (Fin 2)) (N + 1) _ + rw [h₅_rhs] at h₅ + exact stepStar_trans h₁ (stepStar_trans h₂ (stepStar_trans h₃ (stepStar_trans h₄ h₅))) + +theorem R2_raw (l r : ListBlank (Fin 2)) (N : ℕ) : + (([0, 0, 0, 0] +> l) <{{D}} + ([0, 1, 1] +> (([0, 1] : List (Fin 2)) ^ N +> ([0, 1, 1, 1, 1, 0, 1, 0] +> r)))) + [target_tm]⊢* + (([0] +> l) <{{D}} + ([0, 1, 1] +> (([0, 1] : List (Fin 2)) ^ (N + 1) +> ([0, 1, 1, 1, 1, 1, 1, 1, 1] +> r)))) := by + let L : ListBlank (Fin 2) := ([1, 1] : List (Fin 2)) ^ N +> ([1, 0, 0] +> l) + have h₁ : (([0, 0, 0, 0] +> l) <{{D}} + ([0, 1, 1] +> (([0, 1] : List (Fin 2)) ^ N +> ([0, 1, 1, 1, 1, 0, 1, 0] +> r)))) + [target_tm]⊢* + (([1, 0, 0, 1] +> L) {{B}}> ([0, 1, 1, 1, 1, 0, 1, 0] +> r)) := + cross_raw N ([0, 0] +> l) ([0, 1, 1, 1, 1, 0, 1, 0] +> r) + have h₂ := steps_spec target_tm 200 ⟨[1, 0, 0, 1], [0, 1, 1, 1, 1, 0, 1, 0], B, .right⟩ + (x' := ⟨[0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1], [], D, .left⟩) (by decide) L r + dsimp only [toCfg, ListBlank.append_nil] at h₂ + have h₂_rhs : ([0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1] : List (Fin 2)) +> r = + [0, 0, 1] +> ([0, 1, 1, 1, 1, 1, 1, 1, 1] +> r) := rfl + rw [h₂_rhs] at h₂ + have h₃ := back_raw N l ([0, 1, 1, 1, 1, 1, 1, 1, 1] +> r) + exact stepStar_trans h₁ (stepStar_trans h₂ h₃) + +theorem RB_raw (l r : ListBlank (Fin 2)) (N b : ℕ) : + (([0, 0, 0, 0] +> l) <{{D}} + ([0, 1, 1] +> (([0, 1] : List (Fin 2)) ^ N +> + ([0, 1, 1, 1, 1, 0, 1, 1, 1] +> (([1, 1] : List (Fin 2)) ^ b +> ([0] +> r)))))) + [target_tm]⊢* + (([0] +> l) <{{D}} + ([0, 1, 1] +> (([0, 1] : List (Fin 2)) ^ (N + 1) +> + ([0, 1, 1, 1, 1, 1, 1, 1] +> (([0, 1] : List (Fin 2)) ^ b +> ([0, 1, 1] +> r)))))) := by + let L : ListBlank (Fin 2) := ([1, 1] : List (Fin 2)) ^ N +> ([1, 0, 0] +> l) + have h₁ : (([0, 0, 0, 0] +> l) <{{D}} + ([0, 1, 1] +> (([0, 1] : List (Fin 2)) ^ N +> + ([0, 1, 1, 1, 1, 0, 1, 1, 1] +> (([1, 1] : List (Fin 2)) ^ b +> ([0] +> r)))))) + [target_tm]⊢* + (([1, 0, 0, 1] +> L) {{B}}> + ([0, 1, 1, 1, 1, 0, 1, 1, 1] +> (([1, 1] : List (Fin 2)) ^ b +> ([0] +> r)))) := + cross_raw N ([0, 0] +> l) + ([0, 1, 1, 1, 1, 0, 1, 1, 1] +> (([1, 1] : List (Fin 2)) ^ b +> ([0] +> r))) + have h₂ := steps_spec target_tm 200 ⟨[1, 0, 0, 1], [0, 1, 1, 1, 1, 0, 1, 1, 1], B, .right⟩ + (x' := ⟨[1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1], [], B, .right⟩) (by decide) + L (([1, 1] : List (Fin 2)) ^ b +> ([0] +> r)) + dsimp only [toCfg, ListBlank.append_nil] at h₂ + have h₂_rhs : ([1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1] : List (Fin 2)) +> L = + [1] +> ([1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1] +> L) := rfl + rw [h₂_rhs] at h₂ + have h₃ := bounce_pairs b ([1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1] +> L) r + have h₄ := steps_spec target_tm 200 ⟨[0], [1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1], D, .left⟩ + (x' := ⟨[0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1], [], D, .left⟩) (by decide) + L (([0, 1] : List (Fin 2)) ^ b +> ([1] +> r)) + dsimp only [toCfg, ListBlank.append_nil] at h₄ + have h₄_rhs : ([0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1] : List (Fin 2)) +> + (([0, 1] : List (Fin 2)) ^ b +> ([1] +> r)) = + [0, 0, 1] +> ([0, 1, 1, 1, 1, 1, 1, 1] +> + (([0, 1] : List (Fin 2)) ^ b +> ([0, 1, 1] +> r))) := by + have h_comm := (ListBlank.append_pow_comm ([0, 1] : List (Fin 2)) b ([1] +> r)).symm + change [0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1] +> ([0, 1] +> (([0, 1] : List (Fin 2)) ^ b +> ([1] +> r))) = _ + rw [h_comm] + rfl + rw [h₄_rhs] at h₄ + have h₅ := back_raw N l + ([0, 1, 1, 1, 1, 1, 1, 1] +> (([0, 1] : List (Fin 2)) ^ b +> ([0, 1, 1] +> r))) + exact stepStar_trans h₁ (stepStar_trans h₂ (stepStar_trans h₃ (stepStar_trans h₄ h₅))) + +def reg : List ℕ → List (Fin 2) + | [] => [] + | z :: t => 0 :: (([1] : List (Fin 2)) ^ z ++ reg t) + +def recCfg (N : ℕ) (zs : List ℕ) : Cfg (Fin 2) (Fin 6) := + default <{{D}} ([0, 1, 1] +> (([0, 1] : List (Fin 2)) ^ N +> (reg zs +> default))) + +theorem reg_ones (a : ℕ) (zs : List ℕ) : + reg (List.replicate a 1 ++ zs) = ([0, 1] : List (Fin 2)) ^ a ++ reg zs := by + induction a with + | zero => rfl + | succ a ih => + simp only [List.replicate_succ, List.cons_append, reg, pow_succ_list, pow_zero_list, + List.nil_append, ih] + +theorem pow_one_add_7 (a : ℕ) : + ([1] : List (Fin 2)) ^ (a * 2 + 7) = + [1, 1, 1, 1, 1, 1, 1] ++ ([1, 1] : List (Fin 2)) ^ a := by + have h : a * 2 + 7 = 7 + 2 * a := by omega + rw [h, list_pow_add, ← one_pow_two_mul] + rfl + +theorem pow_one_add_3 (b : ℕ) : + ([1] : List (Fin 2)) ^ (b * 2 + 3) = + [1, 1, 1] ++ ([1, 1] : List (Fin 2)) ^ b := by + have h : b * 2 + 3 = 3 + 2 * b := by omega + rw [h, list_pow_add, ← one_pow_two_mul] + rfl + +theorem pow_one_add_2 (e : ℕ) : + ([1] : List (Fin 2)) ^ (e + 2) = [1, 1] ++ ([1] : List (Fin 2)) ^ e := by + have h : e + 2 = 2 + e := by omega + rw [h, list_pow_add] + rfl + +theorem pow_one_add_8 (y : ℕ) : + ([1] : List (Fin 2)) ^ (y + 8) = [1, 1, 1, 1, 1, 1, 1, 1] ++ ([1] : List (Fin 2)) ^ y := by + have h : y + 8 = 8 + y := by omega + rw [h, list_pow_add] + rfl + +theorem R1 (N a e : ℕ) (zs : List ℕ) : + (recCfg (N + 8) ((a * 2 + 7) :: e :: zs)) [target_tm]⊢* + (recCfg (N + 2 + 8) (4 :: (List.replicate a 1 ++ (e + 2) :: zs))) := by + have h := R1_raw default ((([1] : List (Fin 2)) ^ e ++ reg zs) +> default) (N + 8) a + have h_l4 : ([0, 0, 0, 0] : List (Fin 2)) +> default = default := all0_spec (by decide) + have h_l1 : ([0] : List (Fin 2)) +> default = default := all0_spec (by decide) + have h_r1 : reg ((a * 2 + 7) :: e :: zs) +> default = + [0, 1, 1, 1, 1, 1, 1, 1] +> (([1, 1] : List (Fin 2)) ^ a +> + ([0] +> ((([1] : List (Fin 2)) ^ e ++ reg zs) +> default))) := by + dsimp only [reg] + rw [pow_one_add_7 a] + simp only [pow_succ_list, pow_zero_list, List.nil_append, List.cons_append, List.append_assoc, + ListBlank.append_nil, ListBlank.append_cons, ListBlank.append_assoc] + have h_r2 : reg (4 :: (List.replicate a 1 ++ (e + 2) :: zs)) +> default = + [0, 1, 1, 1, 1] +> (([0, 1] : List (Fin 2)) ^ a +> + ([0, 1, 1] +> ((([1] : List (Fin 2)) ^ e ++ reg zs) +> default))) := by + dsimp only [reg] + rw [reg_ones a ((e + 2) :: zs)] + dsimp only [reg] + rw [pow_one_add_2 e] + simp only [pow_succ_list, pow_zero_list, List.nil_append, List.cons_append, List.append_assoc, + ListBlank.append_nil, ListBlank.append_cons, ListBlank.append_assoc] + have hN : N + 8 + 2 = N + 2 + 8 := by omega + unfold recCfg + rw [h_r1, h_r2, ← hN] + rwa [h_l4, h_l1] at h + +theorem R2 (N y : ℕ) (zs : List ℕ) : + (recCfg (N + 8) (4 :: 1 :: y :: zs)) [target_tm]⊢* + (recCfg (N + 1 + 8) ((y + 8) :: zs)) := by + have h := R2_raw default ((([1] : List (Fin 2)) ^ y ++ reg zs) +> default) (N + 8) + have h_l4 : ([0, 0, 0, 0] : List (Fin 2)) +> default = default := all0_spec (by decide) + have h_l1 : ([0] : List (Fin 2)) +> default = default := all0_spec (by decide) + have h_r1 : reg (4 :: 1 :: y :: zs) +> default = + [0, 1, 1, 1, 1, 0, 1, 0] +> ((([1] : List (Fin 2)) ^ y ++ reg zs) +> default) := rfl + have h_r2 : reg ((y + 8) :: zs) +> default = + [0, 1, 1, 1, 1, 1, 1, 1, 1] +> ((([1] : List (Fin 2)) ^ y ++ reg zs) +> default) := by + dsimp only [reg] + rw [pow_one_add_8 y] + simp only [pow_succ_list, pow_zero_list, List.nil_append, List.cons_append, List.append_assoc, + ListBlank.append_nil, ListBlank.append_cons, ListBlank.append_assoc] + have hN : N + 8 + 1 = N + 1 + 8 := by omega + unfold recCfg + rw [h_r1, h_r2, ← hN] + rwa [h_l4, h_l1] at h + +theorem RB (N b y : ℕ) (zs : List ℕ) : + (recCfg (N + 8) (4 :: (b * 2 + 3) :: y :: zs)) [target_tm]⊢* + (recCfg (N + 1 + 8) (7 :: (List.replicate b 1 ++ (y + 2) :: zs))) := by + have h := RB_raw default ((([1] : List (Fin 2)) ^ y ++ reg zs) +> default) (N + 8) b + have h_l4 : ([0, 0, 0, 0] : List (Fin 2)) +> default = default := all0_spec (by decide) + have h_l1 : ([0] : List (Fin 2)) +> default = default := all0_spec (by decide) + have h_r1 : reg (4 :: (b * 2 + 3) :: y :: zs) +> default = + [0, 1, 1, 1, 1, 0, 1, 1, 1] +> (([1, 1] : List (Fin 2)) ^ b +> + ([0] +> ((([1] : List (Fin 2)) ^ y ++ reg zs) +> default))) := by + dsimp only [reg] + rw [pow_one_add_3 b] + simp only [pow_succ_list, pow_zero_list, List.nil_append, List.cons_append, List.append_assoc, + ListBlank.append_nil, ListBlank.append_cons, ListBlank.append_assoc] + have h_r2 : reg (7 :: (List.replicate b 1 ++ (y + 2) :: zs)) +> default = + [0, 1, 1, 1, 1, 1, 1, 1] +> (([0, 1] : List (Fin 2)) ^ b +> + ([0, 1, 1] +> ((([1] : List (Fin 2)) ^ y ++ reg zs) +> default))) := by + dsimp only [reg] + rw [reg_ones b ((y + 2) :: zs)] + dsimp only [reg] + rw [pow_one_add_2 y] + simp only [pow_succ_list, pow_zero_list, List.nil_append, List.cons_append, List.append_assoc, + ListBlank.append_nil, ListBlank.append_cons, ListBlank.append_assoc] + have hN : N + 8 + 1 = N + 1 + 8 := by omega + unfold recCfg + rw [h_r1, h_r2, ← hN] + rwa [h_l4, h_l1] at h + +def NH (zs : List ℕ) : Prop := + ∀ N : ℕ, NeverHaltsFrom target_tm (recCfg (N + 8) zs) + +theorem NH_rule {zs zs' : List ℕ} (k : ℕ) + (h : ∀ N, (recCfg (N + 8) zs) [target_tm]⊢* (recCfg (N + k + 8) zs')) + (h' : NH zs') : NH zs := by + intro N + exact neverHaltsFrom_of_reachesStar (h N) (h' (N + k)) + +def PI (a : ℕ) : Prop := + ∀ y zs, NH ((a * 2 + 10 + y) :: zs) → NH ((a * 2 + 9) :: y :: zs) + +def QI (a : ℕ) : Prop := + ∀ y zs, NH ((a * 2 + 10 + y) :: zs) → NH (9 :: (List.replicate a 1 ++ y :: zs)) + +theorem PI_zero : PI 0 := by + intro y zs h + have h₁ : 0 * 2 + 9 = 1 * 2 + 7 := rfl + rw [h₁] + refine NH_rule 2 (fun N => R1 N 1 y zs) ?_ + dsimp only [List.replicate_succ, List.replicate_zero, List.cons_append, List.nil_append] + refine NH_rule 1 (fun N => R2 N (y + 2) zs) ?_ + have h₂ : y + 2 + 8 = 0 * 2 + 10 + y := by omega + rwa [h₂] + +theorem PI_succ (a : ℕ) (hQ : QI a) : PI (a + 1) := by + intro y zs h + have h₁ : (a + 1) * 2 + 9 = (a + 2) * 2 + 7 := by omega + rw [h₁] + refine NH_rule 2 (fun N => R1 N (a + 2) y zs) ?_ + dsimp only [List.replicate_succ, List.cons_append] + refine NH_rule 1 (fun N => R2 N 1 (List.replicate a 1 ++ (y + 2) :: zs)) ?_ + refine hQ (y + 2) zs ?_ + have h₂ : a * 2 + 10 + (y + 2) = (a + 1) * 2 + 10 + y := by omega + rwa [h₂] + +theorem classI_QI (a : ℕ) : QI a ∧ PI a := by + induction a with + | zero => exact ⟨PI_zero, PI_zero⟩ + | succ a ih => + have hPI : PI (a + 1) := PI_succ a ih.1 + refine ⟨?_, hPI⟩ + intro y zs h + rw [List.replicate_succ', List.append_assoc] + refine ih.1 1 (y :: zs) ?_ + have h₁ : a * 2 + 10 + 1 = (a + 1) * 2 + 9 := by omega + rw [h₁] + exact hPI y zs h + +theorem classI (a : ℕ) : PI a := (classI_QI a).2 + +def PII (b : ℕ) : Prop := + ∀ y zs, NH (7 :: (b * 2 + 2 + y) :: zs) → NH (7 :: (b * 2 + 1) :: y :: zs) + +def QII (b : ℕ) : Prop := + ∀ y zs, NH (7 :: (b * 2 + 2 + y) :: zs) → NH (7 :: 1 :: (List.replicate b 1 ++ y :: zs)) + +theorem PII_zero : PII 0 := by + intro y zs h + have h₁ : (7 : ℕ) = 0 * 2 + 7 := rfl + rw [h₁] + refine NH_rule 2 (fun N => R1 N 0 1 (y :: zs)) ?_ + dsimp only [List.replicate_zero, List.nil_append] + refine NH_rule 1 (fun N => RB N 0 y zs) ?_ + dsimp only [List.replicate_zero, List.nil_append] + have h₂ : y + 2 = 0 * 2 + 2 + y := by omega + rwa [h₂] + +theorem PII_succ (b : ℕ) (hQ : QII b) : PII (b + 1) := by + intro y zs h + have h₁ : (7 : ℕ) = 0 * 2 + 7 := rfl + rw [h₁] + refine NH_rule 2 (fun N => R1 N 0 ((b + 1) * 2 + 1) (y :: zs)) ?_ + dsimp only [List.replicate_zero, List.nil_append] + refine NH_rule 1 (fun N => RB N (b + 1) y zs) ?_ + dsimp only [List.replicate_succ, List.cons_append] + refine hQ (y + 2) zs ?_ + have h₃ : b * 2 + 2 + (y + 2) = (b + 1) * 2 + 2 + y := by omega + rwa [h₃] + +theorem classII_QII (b : ℕ) : QII b ∧ PII b := by + induction b with + | zero => exact ⟨PII_zero, PII_zero⟩ + | succ b ih => + have hPII : PII (b + 1) := PII_succ b ih.1 + refine ⟨?_, hPII⟩ + intro y zs h + rw [List.replicate_succ', List.append_assoc] + refine ih.1 1 (y :: zs) ?_ + have h₁ : b * 2 + 2 + 1 = (b + 1) * 2 + 1 := by omega + rw [h₁] + exact hPII y zs h + +theorem classII (b : ℕ) : PII b := (classII_QII b).2 + +theorem RB_QII (b y : ℕ) (zs : List ℕ) (h : NH (7 :: (b * 2 + 2 + y) :: zs)) : + NH (4 :: (b * 2 + 3) :: y :: zs) := by + rcases b with _ | b + · refine NH_rule 1 (fun N => RB N 0 y zs) ?_ + dsimp only [List.replicate_zero, List.nil_append] + have h₂ : y + 2 = 0 * 2 + 2 + y := by omega + rwa [h₂] + · refine NH_rule 1 (fun N => RB N (b + 1) y zs) ?_ + dsimp only [List.replicate_succ, List.cons_append] + refine (classII_QII b).1 (y + 2) zs ?_ + have h₃ : b * 2 + 2 + (y + 2) = (b + 1) * 2 + 2 + y := by omega + rwa [h₃] + +def countLead1 : List ℕ → ℕ → ℕ + | [], d => d + | x :: t, d => if x == 1 then countLead1 t (d + 1) else d + +def dropLead1 : List ℕ → List ℕ + | [] => [] + | x :: t => if x == 1 then dropLead1 t else x :: t + +theorem classI_run (t : List ℕ) (a : ℕ) : + match dropLead1 t with + | y :: zs => NH ((countLead1 t a * 2 + 10 + y) :: zs) → NH ((a * 2 + 9) :: t) + | [] => True := by + induction t generalizing a with + | nil => trivial + | cons x xs ih => + dsimp only [dropLead1, countLead1] + split_ifs with hx + · rw [beq_iff_eq] at hx + subst hx + have ih_step := ih (a + 1) + rcases hd : dropLead1 xs with _ | ⟨y, zs⟩ + · rw [hd] at ih_step; trivial + · rw [hd] at ih_step + intro h + have h_eq : a * 2 + 10 + 1 = (a + 1) * 2 + 9 := by omega + refine classI a 1 xs ?_ + rw [h_eq] + exact ih_step h + · exact classI a x xs + +def mstep (zs : List ℕ) : Option (List ℕ) := + match zs with + | X :: t => + if X == (X - 9) / 2 * 2 + 9 then + match dropLead1 t with + | y :: zs' => some ((countLead1 t ((X - 9) / 2) * 2 + 10 + y) :: zs') + | [] => none + else if X == 7 then + match t with + | y :: y' :: t' => + if y == y / 2 * 2 + 1 then + some (7 :: (y / 2 * 2 + 2 + y') :: t') + else + some (4 :: (y + 2) :: y' :: t') + | [y] => some (4 :: (y + 2) :: []) + | [] => none + else if X == 4 then + match t with + | y :: y' :: t' => + if y == 1 then + some ((y' + 8) :: t') + else if y == (y - 3) / 2 * 2 + 3 then + some (7 :: ((y - 3) / 2 * 2 + 2 + y') :: t') + else + none + | _ => none + else + none + | [] => none + +theorem mstep_spec (zs zs' : List ℕ) (h : mstep zs = some zs') (h' : NH zs') : NH zs := by + rcases zs with _ | ⟨X, t⟩ + · cases h + · dsimp only [mstep] at h + split_ifs at h with hX9 hX7 hX4 + · have hrun := classI_run t ((X - 9) / 2) + rcases hd : dropLead1 t with _ | ⟨y, t_rem⟩ + · rw [hd] at h; cases h + · rw [hd] at h hrun + cases h + rw [beq_iff_eq] at hX9 + rw [hX9] + exact hrun h' + · rcases t with _ | ⟨y, _ | ⟨y', t'⟩⟩ + · cases h + · cases h + rw [beq_iff_eq] at hX7 + rw [hX7] + have h_r1 := fun N => R1 N 0 y [] + dsimp only [Nat.zero_mul, Nat.zero_add, List.replicate_zero, List.nil_append] at h_r1 + exact NH_rule 2 h_r1 h' + · dsimp only at h + split_ifs at h with hy_odd + · cases h + rw [beq_iff_eq] at hX7 hy_odd + rw [hX7, hy_odd] + exact classII (y / 2) y' t' h' + · cases h + rw [beq_iff_eq] at hX7 + rw [hX7] + have h_r1 := fun N => R1 N 0 y (y' :: t') + dsimp only [Nat.zero_mul, Nat.zero_add, List.replicate_zero, List.nil_append] at h_r1 + exact NH_rule 2 h_r1 h' + · rcases t with _ | ⟨y, _ | ⟨y', t'⟩⟩ + · cases h + · cases h + · dsimp only at h + split_ifs at h with hy1 hy3 + · cases h + rw [beq_iff_eq] at hX4 hy1 + rw [hX4, hy1] + exact NH_rule 1 (fun N => R2 N y' t') h' + · cases h + rw [beq_iff_eq] at hX4 hy3 + rw [hX4, hy3] + exact RB_QII ((y - 3) / 2) y' t' h' + +def stripPfx : List (Fin 2) → List (Fin 2) → Option (List (Fin 2)) + | [], ys => some ys + | x :: xs, y :: ys => if x == y then stripPfx xs ys else none + | _ :: _, [] => none + +theorem stripPfx_spec {p ys r : List (Fin 2)} (h : stripPfx p ys = some r) : + ys = p ++ r := by + induction p generalizing ys with + | nil => cases h; rfl + | cons x xs ih => + rcases ys with _ | ⟨y, ys⟩ + · cases h + · dsimp only [stripPfx] at h + split_ifs at h with heq + · rw [beq_iff_eq] at heq + rw [heq, List.cons_append, ih h] + +def tailAfter0 : List (Fin 2) → Option (List (Fin 2)) + | [] => some [] + | x :: t => if x == 0 then some t else none + +theorem tailAfter0_spec {r r' : List (Fin 2)} (h : tailAfter0 r = some r') : + r +> (default : ListBlank (Fin 2)) = [0] +> (r' +> default) := by + rcases r with _ | ⟨x, t⟩ + · cases h + exact ListBlank.default_eq_append_zero + · dsimp only [tailAfter0] at h + split_ifs at h with hx + · cases h + rw [beq_iff_eq] at hx + rw [hx] + rfl + +inductive SplitRes where + | mk : ℕ → List (Fin 2) → SplitRes + +def split1 : ℕ → List (Fin 2) → SplitRes + | 0, xs => .mk 0 xs + | fuel + 1, xs => + match stripPfx [1] xs with + | some t => SplitRes.casesOn (split1 fuel t) (fun n r => .mk (n + 1) r) + | none => .mk 0 xs + +theorem split1_spec (fuel : ℕ) (xs : List (Fin 2)) : + SplitRes.casesOn (split1 fuel xs) (fun n r => xs = ([1] : List (Fin 2)) ^ n ++ r) := by + induction fuel generalizing xs with + | zero => rfl + | succ fuel ih => + dsimp only [split1] + rcases h : stripPfx [1] xs with _ | t + · rfl + · dsimp only + have ih_t := ih t + rcases hsp : split1 fuel t with ⟨n, r⟩ + rw [hsp] at ih_t + dsimp only at ih_t ⊢ + rw [stripPfx_spec h, ih_t, pow_succ_list, List.append_assoc] + +def split11 : ℕ → List (Fin 2) → SplitRes + | 0, xs => .mk 0 xs + | fuel + 1, xs => + match stripPfx [1, 1] xs with + | some t => SplitRes.casesOn (split11 fuel t) (fun n r => .mk (n + 1) r) + | none => .mk 0 xs + +theorem split11_spec (fuel : ℕ) (xs : List (Fin 2)) : + SplitRes.casesOn (split11 fuel xs) (fun n r => xs = ([1, 1] : List (Fin 2)) ^ n ++ r) := by + induction fuel generalizing xs with + | zero => rfl + | succ fuel ih => + dsimp only [split11] + rcases h : stripPfx [1, 1] xs with _ | t + · rfl + · dsimp only + have ih_t := ih t + rcases hsp : split11 fuel t with ⟨n, r⟩ + rw [hsp] at ih_t + dsimp only at ih_t ⊢ + rw [stripPfx_spec h, ih_t, pow_succ_list, List.append_assoc] + +def split01Any : ℕ → List (Fin 2) → SplitRes + | 0, xs => .mk 0 xs + | fuel + 1, xs => + match stripPfx [0, 1] xs with + | some t => SplitRes.casesOn (split01Any fuel t) (fun n r => .mk (n + 1) r) + | none => .mk 0 xs + +theorem split01Any_spec (fuel : ℕ) (xs : List (Fin 2)) : + SplitRes.casesOn (split01Any fuel xs) (fun n r => xs = ([0, 1] : List (Fin 2)) ^ n ++ r) := by + induction fuel generalizing xs with + | zero => rfl + | succ fuel ih => + dsimp only [split01Any] + rcases h : stripPfx [0, 1] xs with _ | t + · rfl + · dsimp only + have ih_t := ih t + rcases hsp : split01Any fuel t with ⟨n, r⟩ + rw [hsp] at ih_t + dsimp only at ih_t ⊢ + rw [stripPfx_spec h, ih_t, pow_succ_list, List.append_assoc] + +def split01 : ℕ → List (Fin 2) → SplitRes + | 0, xs => .mk 0 xs + | fuel + 1, xs => + match stripPfx [0, 1, 0] xs with + | some t => SplitRes.casesOn (split01 fuel (0 :: t)) (fun n r => .mk (n + 1) r) + | none => .mk 0 xs + +theorem split01_spec (fuel : ℕ) (xs : List (Fin 2)) : + SplitRes.casesOn (split01 fuel xs) (fun n r => xs = ([0, 1] : List (Fin 2)) ^ n ++ r) := by + induction fuel generalizing xs with + | zero => rfl + | succ fuel ih => + dsimp only [split01] + rcases h : stripPfx [0, 1, 0] xs with _ | t + · rfl + · dsimp only + have ih_t := ih (0 :: t) + rcases hsp : split01 fuel (0 :: t) with ⟨n, r⟩ + rw [hsp] at ih_t + dsimp only at ih_t ⊢ + have h_eq : xs = [0, 1] ++ (0 :: t) := by + rw [stripPfx_spec h]; rfl + rw [h_eq, ih_t, pow_succ_list, List.append_assoc] + +inductive RStepRes where + | mk : ℕ → List (Fin 2) → RStepRes + +def rStep (N : ℕ) (r₂ : List (Fin 2)) : Option RStepRes := + match stripPfx [0, 1, 1, 1, 1, 1, 1, 1] r₂ with + | some r₃ => + SplitRes.casesOn (split11 3000 r₃) (fun a r₄ => + match tailAfter0 r₄ with + | some r₅ => + some (.mk (N + 2) ([0, 1, 1, 1, 1] ++ (([0, 1] : List (Fin 2)) ^ a ++ ([0, 1, 1] ++ r₅)))) + | none => none) + | none => + match stripPfx [0, 1, 1, 1, 1, 0, 1, 1, 1] r₂ with + | some r₃ => + SplitRes.casesOn (split11 3000 r₃) (fun b r₄ => + match tailAfter0 r₄ with + | some r₅ => + some (.mk (N + 1) + ([0, 1, 1, 1, 1, 1, 1, 1] ++ (([0, 1] : List (Fin 2)) ^ b ++ ([0, 1, 1] ++ r₅)))) + | none => none) + | none => + match stripPfx [0, 1, 1, 1, 1, 0, 1] r₂ with + | some r₃ => + match tailAfter0 r₃ with + | some r₅ => some (.mk (N + 1) ([0, 1, 1, 1, 1, 1, 1, 1, 1] ++ r₅)) + | none => none + | none => none + +theorem rStep_spec (N : ℕ) (r₂ : List (Fin 2)) {N' : ℕ} {r₂' : List (Fin 2)} + (h : rStep N r₂ = some (.mk N' r₂')) (l : ListBlank (Fin 2)) : + (([0, 0, 0, 0] +> l) <{{D}} ([0, 1, 1] +> (([0, 1] : List (Fin 2)) ^ N +> (r₂ +> default)))) + [target_tm]⊢* + (([0] +> l) <{{D}} ([0, 1, 1] +> (([0, 1] : List (Fin 2)) ^ N' +> (r₂' +> default)))) := by + dsimp only [rStep] at h + rcases h₁ : stripPfx [0, 1, 1, 1, 1, 1, 1, 1] r₂ with _ | r₃ <;> rw [h₁] at h <;> dsimp only at h + · rcases h₂ : stripPfx [0, 1, 1, 1, 1, 0, 1, 1, 1] r₂ with _ | r₃ <;> rw [h₂] at h <;> dsimp only at h + · rcases h₃ : stripPfx [0, 1, 1, 1, 1, 0, 1] r₂ with _ | r₃ <;> rw [h₃] at h <;> dsimp only at h + · cases h + · rcases ht : tailAfter0 r₃ with _ | r₅ <;> rw [ht] at h + · cases h + · cases h + have hr₂ := stripPfx_spec h₃ + have ht₀ := tailAfter0_spec ht + have h_lhs : r₂ +> (default : ListBlank (Fin 2)) = + [0, 1, 1, 1, 1, 0, 1, 0] +> (r₅ +> default) := by + rw [hr₂, ListBlank.append_assoc, ht₀] + rfl + rw [h_lhs, ListBlank.append_assoc] + exact R2_raw l (r₅ +> default) N + · have hsp := split11_spec 3000 r₃ + rcases hsp_eq : split11 3000 r₃ with ⟨b, r₄⟩ + rw [hsp_eq] at h hsp + dsimp only at h hsp + rcases ht : tailAfter0 r₄ with _ | r₅ <;> rw [ht] at h + · cases h + · cases h + have hr₂ := stripPfx_spec h₂ + have ht₀ := tailAfter0_spec ht + have h_lhs : r₂ +> (default : ListBlank (Fin 2)) = + [0, 1, 1, 1, 1, 0, 1, 1, 1] +> + (([1, 1] : List (Fin 2)) ^ b +> ([0] +> (r₅ +> default))) := by + conv_lhs => rw [hr₂, hsp] + rw [ListBlank.append_assoc, ListBlank.append_assoc, ht₀] + rw [h_lhs, ListBlank.append_assoc, ListBlank.append_assoc, ListBlank.append_assoc] + exact RB_raw l (r₅ +> default) N b + · have hsp := split11_spec 3000 r₃ + rcases hsp_eq : split11 3000 r₃ with ⟨a, r₄⟩ + rw [hsp_eq] at h hsp + dsimp only at h hsp + rcases ht : tailAfter0 r₄ with _ | r₅ <;> rw [ht] at h + · cases h + · cases h + have hr₂ := stripPfx_spec h₁ + have ht₀ := tailAfter0_spec ht + have h_lhs : r₂ +> (default : ListBlank (Fin 2)) = + [0, 1, 1, 1, 1, 1, 1, 1] +> + (([1, 1] : List (Fin 2)) ^ a +> ([0] +> (r₅ +> default))) := by + conv_lhs => rw [hr₂, hsp] + rw [ListBlank.append_assoc, ListBlank.append_assoc, ht₀] + rw [h_lhs, ListBlank.append_assoc, ListBlank.append_assoc, ListBlank.append_assoc] + exact R1_raw l (r₅ +> default) N a + +inductive BurstRes where + | mk : List (Fin 2) → ℕ → List (Fin 2) → BurstRes + +def rBurst : ℕ → List (Fin 2) → ℕ → List (Fin 2) → BurstRes + | 0, ahd, N, r₂ => .mk ahd N r₂ + | fuel + 1, ahd, N, r₂ => + match stripPfx [0, 0, 0, 0] ahd with + | some ahd₀ => + match rStep N r₂ with + | some res => RStepRes.casesOn res (fun N' r₂' => rBurst fuel (0 :: ahd₀) N' r₂') + | none => .mk ahd N r₂ + | none => .mk ahd N r₂ + +theorem rBurst_spec (fuel : ℕ) (ahd : List (Fin 2)) (N : ℕ) (r₂ : List (Fin 2)) + (l₀ : ListBlank (Fin 2)) : + BurstRes.casesOn (rBurst fuel ahd N r₂) (fun ahd' N' r₂' => + ((ahd +> l₀) <{{D}} ([0, 1, 1] +> (([0, 1] : List (Fin 2)) ^ N +> (r₂ +> default)))) + [target_tm]⊢* + ((ahd' +> l₀) <{{D}} + ([0, 1, 1] +> (([0, 1] : List (Fin 2)) ^ N' +> (r₂' +> default))))) := by + induction fuel generalizing ahd N r₂ with + | zero => exact ⟨0, rfl⟩ + | succ fuel ih => + dsimp only [rBurst] + rcases h₁ : stripPfx [0, 0, 0, 0] ahd with _ | ahd₀ + · exact ⟨0, rfl⟩ + · dsimp only + rcases h₂ : rStep N r₂ with _ | ⟨N', r₂'⟩ + · exact ⟨0, rfl⟩ + · dsimp only + have hahd : ahd +> l₀ = [0, 0, 0, 0] +> (ahd₀ +> l₀) := by + rw [stripPfx_spec h₁, ListBlank.append_assoc] + have ih_step := ih (0 :: ahd₀) N' r₂' + rcases hb : rBurst fuel (0 :: ahd₀) N' r₂' with ⟨ahd'', N'', r₂''⟩ + rw [hb] at ih_step + dsimp only at ih_step ⊢ + rw [hahd] + exact stepStar_trans (rStep_spec N r₂ h₂ (ahd₀ +> l₀)) ih_step + +def stepFastB (bhd ahd : List (Fin 2)) : Option (BCfg (Fin 2) (Fin 6)) := + match stripPfx [0, 1] ahd with + | some ahd₁ => + match stripPfx [1, 1, 0, 0, 1] bhd with + | some bhd' => + SplitRes.casesOn (split01Any 3000 ahd₁) (fun m rem => + some ⟨[1, 1, 0, 0, 1] ++ (([0, 0] : List (Fin 2)) ^ (m + 1) ++ bhd'), rem, B, .right⟩) + | none => + match stripPfx [1, 0, 0, 1] bhd with + | some bhd' => + SplitRes.casesOn (split01Any 3000 ahd₁) (fun m rem => + some ⟨[1, 0, 0, 1] ++ (([1, 1] : List (Fin 2)) ^ (m + 1) ++ bhd'), rem, B, .right⟩) + | none => step_r0inf target_tm ⟨bhd, ahd, B, .right⟩ + | none => + match stripPfx [1] ahd with + | some ahd₁ => + SplitRes.casesOn (split1 3000 ahd₁) (fun m rem => + some ⟨([1] : List (Fin 2)) ^ (m + 1) ++ bhd, rem, B, .right⟩) + | none => step_r0inf target_tm ⟨bhd, ahd, B, .right⟩ + +theorem stepFastB_spec (bhd ahd : List (Fin 2)) {y : BCfg (Fin 2) (Fin 6)} + (h : stepFastB bhd ahd = some y) (l₀ : ListBlank (Fin 2)) : + (toCfg ⟨bhd, ahd, B, .right⟩ l₀ default) [target_tm]⊢* (toCfg y l₀ default) := by + dsimp only [stepFastB] at h + rcases ha₁ : stripPfx [0, 1] ahd with _ | ahd₁ <;> rw [ha₁] at h <;> dsimp only at h + · rcases ha₂ : stripPfx [1] ahd with _ | ahd₁ <;> rw [ha₂] at h <;> dsimp only at h + · exact ⟨1, step_r0inf_spec target_tm _ h l₀⟩ + · have hsp := split1_spec 3000 ahd₁ + rcases hsp_eq : split1 3000 ahd₁ with ⟨m, rem⟩ + rw [hsp_eq] at h hsp + cases h + dsimp only [toCfg] at hsp ⊢ + have ha := stripPfx_spec ha₂ + have h_r : ahd +> (default : ListBlank (Fin 2)) = + ([1] : List (Fin 2)) ^ (m + 1) +> (rem +> default) := by + rw [ha, hsp, pow_succ_list, ListBlank.append_assoc, ListBlank.append_assoc] + rfl + rw [h_r, ListBlank.append_assoc] + exact B_ones (m + 1) (bhd +> l₀) (rem +> default) + · rcases hb₁ : stripPfx [1, 1, 0, 0, 1] bhd with _ | bhd' <;> rw [hb₁] at h <;> dsimp only at h + · rcases hb₂ : stripPfx [1, 0, 0, 1] bhd with _ | bhd' <;> rw [hb₂] at h <;> dsimp only at h + · exact ⟨1, step_r0inf_spec target_tm _ h l₀⟩ + · have hsp := split01Any_spec 3000 ahd₁ + rcases hsp_eq : split01Any 3000 ahd₁ with ⟨m, rem⟩ + rw [hsp_eq] at h hsp + cases h + dsimp only [toCfg] at hsp ⊢ + have hb := stripPfx_spec hb₂ + have ha := stripPfx_spec ha₁ + have h_l : bhd +> l₀ = [1, 0, 0, 1] +> (bhd' +> l₀) := by + rw [hb, ListBlank.append_assoc] + have h_r : ahd +> (default : ListBlank (Fin 2)) = + ([0, 1] : List (Fin 2)) ^ (m + 1) +> (rem +> default) := by + rw [ha, hsp, pow_succ_list, ListBlank.append_assoc, ListBlank.append_assoc] + rfl + rw [h_l, h_r, ListBlank.append_assoc, ListBlank.append_assoc] + exact cross_pairs (m + 1) (bhd' +> l₀) (rem +> default) + · have hsp := split01Any_spec 3000 ahd₁ + rcases hsp_eq : split01Any 3000 ahd₁ with ⟨m, rem⟩ + rw [hsp_eq] at h hsp + cases h + dsimp only [toCfg] at hsp ⊢ + have hb := stripPfx_spec hb₁ + have ha := stripPfx_spec ha₁ + have h_l : bhd +> l₀ = [1, 1, 0, 0, 1] +> (bhd' +> l₀) := by + rw [hb, ListBlank.append_assoc] + have h_r : ahd +> (default : ListBlank (Fin 2)) = + ([0, 1] : List (Fin 2)) ^ (m + 1) +> (rem +> default) := by + rw [ha, hsp, pow_succ_list, ListBlank.append_assoc, ListBlank.append_assoc] + rfl + rw [h_l, h_r, ListBlank.append_assoc, ListBlank.append_assoc] + exact recharge_pairs (m + 1) (bhd' +> l₀) (rem +> default) + +def stepFastD (bhd ahd : List (Fin 2)) : Option (BCfg (Fin 2) (Fin 6)) := + match stripPfx [0, 0, 0, 0] ahd with + | some ahd₀ => + match stripPfx [0, 1, 1] bhd with + | some bhd₁ => + SplitRes.casesOn (split01 3000 bhd₁) (fun n₀ r₂ => + match rStep n₀ r₂ with + | some res₁ => + RStepRes.casesOn res₁ (fun N₁ r₂' => + BurstRes.casesOn (rBurst 1000 (0 :: ahd₀) N₁ r₂') (fun ahd' N₂ r₂'' => + some ⟨[0, 1, 1] ++ (([0, 1] : List (Fin 2)) ^ N₂ ++ r₂''), ahd', D, .left⟩)) + | none => step_r0inf target_tm ⟨bhd, ahd, D, .left⟩) + | none => step_r0inf target_tm ⟨bhd, ahd, D, .left⟩ + | none => + match stripPfx [1, 1] ahd with + | some ahd₁ => + match stripPfx [0] bhd with + | some bhd' => + SplitRes.casesOn (split11 3000 ahd₁) (fun m rem => + some ⟨[0] ++ (([0, 1] : List (Fin 2)) ^ (m + 1) ++ bhd'), rem, D, .left⟩) + | none => step_r0inf target_tm ⟨bhd, ahd, D, .left⟩ + | none => step_r0inf target_tm ⟨bhd, ahd, D, .left⟩ + +theorem stepFastD_spec (bhd ahd : List (Fin 2)) {y : BCfg (Fin 2) (Fin 6)} + (h : stepFastD bhd ahd = some y) (l₀ : ListBlank (Fin 2)) : + (toCfg ⟨bhd, ahd, D, .left⟩ l₀ default) [target_tm]⊢* (toCfg y l₀ default) := by + dsimp only [stepFastD] at h + rcases ha₁ : stripPfx [0, 0, 0, 0] ahd with _ | ahd₀ <;> rw [ha₁] at h <;> dsimp only at h + · rcases ha₂ : stripPfx [1, 1] ahd with _ | ahd₁ <;> rw [ha₂] at h <;> dsimp only at h + · exact ⟨1, step_r0inf_spec target_tm _ h l₀⟩ + · rcases hb₂ : stripPfx [0] bhd with _ | bhd' <;> rw [hb₂] at h <;> dsimp only at h + · exact ⟨1, step_r0inf_spec target_tm _ h l₀⟩ + · have hsp := split11_spec 3000 ahd₁ + rcases hsp_eq : split11 3000 ahd₁ with ⟨m, rem⟩ + rw [hsp_eq] at h hsp + cases h + dsimp only [toCfg] at hsp ⊢ + have hb := stripPfx_spec hb₂ + have ha := stripPfx_spec ha₂ + have h_l : ahd +> l₀ = + ([1, 1] : List (Fin 2)) ^ (m + 1) +> (rem +> l₀) := by + rw [ha, hsp, pow_succ_list, ListBlank.append_assoc, ListBlank.append_assoc] + rfl + have h_r : bhd +> (default : ListBlank (Fin 2)) = + [0] +> (bhd' +> default) := by + rw [hb, ListBlank.append_assoc] + rw [h_l, h_r, ListBlank.append_assoc, ListBlank.append_assoc] + exact back_pairs (m + 1) (rem +> l₀) (bhd' +> default) + · rcases hb₁ : stripPfx [0, 1, 1] bhd with _ | bhd₁ <;> rw [hb₁] at h <;> dsimp only at h + · exact ⟨1, step_r0inf_spec target_tm _ h l₀⟩ + · have hsp := split01_spec 3000 bhd₁ + rcases hsp_eq : split01 3000 bhd₁ with ⟨n₀, r₂⟩ + rw [hsp_eq] at h hsp + dsimp only at h hsp + rcases hr : rStep n₀ r₂ with _ | ⟨N₁, r₂'⟩ <;> rw [hr] at h <;> dsimp only at h + · exact ⟨1, step_r0inf_spec target_tm _ h l₀⟩ + · have hburst := rBurst_spec 1000 (0 :: ahd₀) N₁ r₂' l₀ + rcases hb_eq : rBurst 1000 (0 :: ahd₀) N₁ r₂' with ⟨ahd', N₂, r₂''⟩ + rw [hb_eq] at h hburst + cases h + dsimp only [toCfg] at hburst ⊢ + have hb := stripPfx_spec hb₁ + have ha := stripPfx_spec ha₁ + have h_l : ahd +> l₀ = [0, 0, 0, 0] +> (ahd₀ +> l₀) := by + rw [ha, ListBlank.append_assoc] + have h_r : bhd +> (default : ListBlank (Fin 2)) = + [0, 1, 1] +> (([0, 1] : List (Fin 2)) ^ n₀ +> (r₂ +> default)) := by + conv_lhs => rw [hb, hsp] + rw [ListBlank.append_assoc, ListBlank.append_assoc] + rw [h_l, h_r, ListBlank.append_assoc, ListBlank.append_assoc] + exact stepStar_trans (rStep_spec n₀ r₂ hr (ahd₀ +> l₀)) hburst + +def stepFast (x : BCfg (Fin 2) (Fin 6)) : Option (BCfg (Fin 2) (Fin 6)) := + BCfg.casesOn x (fun bhd ahd s sgn => + if s == B && sgn == .right then + stepFastB bhd ahd + else if s == D && sgn == .left then + stepFastD bhd ahd + else + step_r0inf target_tm ⟨bhd, ahd, s, sgn⟩) + +theorem stepFast_spec (x : BCfg (Fin 2) (Fin 6)) {y : BCfg (Fin 2) (Fin 6)} + (h : stepFast x = some y) (l₀ : ListBlank (Fin 2)) : + (toCfg x l₀ default) [target_tm]⊢* (toCfg y l₀ default) := by + rcases x with ⟨bhd, ahd, s, sgn⟩ + dsimp only [stepFast] at h + split_ifs at h with hB hD + · rw [Bool.and_eq_true, beq_iff_eq, beq_iff_eq] at hB + rw [hB.1, hB.2] + exact stepFastB_spec bhd ahd h l₀ + · rw [Bool.and_eq_true, beq_iff_eq, beq_iff_eq] at hD + rw [hD.1, hD.2] + exact stepFastD_spec bhd ahd h l₀ + · exact ⟨1, step_r0inf_spec target_tm _ h l₀⟩ + +def run : ℕ → BCfg (Fin 2) (Fin 6) → BCfg (Fin 2) (Fin 6) + | 0, x => x + | n + 1, x => + match stepFast x with + | some y => run n y + | none => x + +theorem run_spec (n : ℕ) (x : BCfg (Fin 2) (Fin 6)) (l₀ : ListBlank (Fin 2)) : + (toCfg x l₀ default) [target_tm]⊢* (toCfg (run n x) l₀ default) := by + induction n generalizing x with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + dsimp only [run] + rcases h : stepFast x with _ | y + · exact ⟨0, rfl⟩ + · exact stepStar_trans (stepFast_spec x h l₀) (ih y) + +def frame (zs : List ℕ) : BCfg (Fin 2) (Fin 6) := + ⟨[1, 0, 0, 1], ([0, 1] : List (Fin 2)) ^ 8 ++ reg zs, B, .right⟩ + +theorem to_frame (M : ℕ) (zs : List ℕ) : + (recCfg (M + 8) zs) [target_tm]⊢* + (toCfg (frame zs) (([1, 1] : List (Fin 2)) ^ M +> ([1] +> default)) default) := by + have h := cross_raw M default (([0, 1] : List (Fin 2)) ^ 8 +> (reg zs +> default)) + have h_l : ([0, 0] : List (Fin 2)) +> default = default := all0_spec (by decide) + have h_pow : (([0, 1] : List (Fin 2)) ^ M +> + (([0, 1] : List (Fin 2)) ^ 8 +> (reg zs +> default))) = + (([0, 1] : List (Fin 2)) ^ (M + 8) +> (reg zs +> default)) := by + rw [list_pow_add, ListBlank.append_assoc] + rw [h_l, h_pow] at h + dsimp only [frame, toCfg] + rwa [ListBlank.append_assoc] + +def decRuns : List (Fin 2) → ℕ → List ℕ + | [], 0 => [] + | [], k + 1 => [k + 1] + | x :: t, 0 => if x == 1 then decRuns t 1 else decRuns t 0 + | x :: t, k + 1 => if x == 1 then decRuns t (k + 2) else (k + 1) :: decRuns t 0 + +inductive SpecialRes where + | mk : ℕ → List ℕ → SpecialRes + +def specialCheck (l : List (Fin 2)) (d : ℕ) (zs' : List ℕ) : Option SpecialRes := + if 7 ≤ d then + if eqAppR0inf l ([0, 0, 1] ++ (([0, 1] : List (Fin 2)) ^ d ++ reg zs')) then + some (.mk (d - 7) zs') + else + none + else + none + +def specialRuns (l : List (Fin 2)) (runs : List ℕ) : Option SpecialRes := + specialCheck l (countLead1 runs 0) (dropLead1 runs) + +def special (zs : List ℕ) : Option SpecialRes := + BCfg.casesOn (run 2200 (frame zs)) (fun l r s sgn => + if r == [] && s == D && sgn == .left then + specialRuns l (decRuns (l.drop 3) 0) + else + none) + +theorem special_spec (zs : List ℕ) (k : ℕ) (zs' : List ℕ) + (h : special zs = some (.mk k zs')) (h' : NH zs') : NH zs := by + intro M + dsimp only [special] at h + have h₁ := stepStar_trans (to_frame M zs) + (run_spec 2200 (frame zs) (([1, 1] : List (Fin 2)) ^ M +> ([1] +> default))) + rcases hrun : run 2200 (frame zs) with ⟨l', r', s', sgn'⟩ + rw [hrun] at h h₁ + dsimp only at h + split_ifs at h with h_res + rw [Bool.and_assoc, Bool.and_eq_true, beq_iff_eq, Bool.and_eq_true, beq_iff_eq, beq_iff_eq] at h_res + rcases h_res with ⟨hr_nil, hs_D, hsgn_L⟩ + subst hr_nil hs_D hsgn_L + dsimp only [specialRuns, specialCheck] at h + split_ifs at h with hd heq + cases h + dsimp only [toCfg] at h₁ + have h_eq : l' +> (default : ListBlank (Fin 2)) = + [0, 0, 1] +> + (([0, 1] : List (Fin 2)) ^ countLead1 (decRuns (l'.drop 3) 0) 0 +> + (reg (dropLead1 (decRuns (l'.drop 3) 0)) +> default)) := by + rw [eqAppR0inf_spec heq, ListBlank.append_assoc, ListBlank.append_assoc] + rw [h_eq] at h₁ + have h_back := back_raw M default + (([0, 1] : List (Fin 2)) ^ countLead1 (decRuns (l'.drop 3) 0) 0 +> + (reg (dropLead1 (decRuns (l'.drop 3) 0)) +> default)) + have h_l00 : ([1, 0, 0] : List (Fin 2)) +> default = [1] +> default := by + change [1] +> ([0, 0] +> default) = [1] +> default + rw [all0_spec (by decide)] + have h_l0 : ([0] : List (Fin 2)) +> default = default := all0_spec (by decide) + have h_pow : (([0, 1] : List (Fin 2)) ^ (M + 1) +> + (([0, 1] : List (Fin 2)) ^ countLead1 (decRuns (l'.drop 3) 0) 0 +> + (reg (dropLead1 (decRuns (l'.drop 3) 0)) +> default))) = + (([0, 1] : List (Fin 2)) ^ (M + (countLead1 (decRuns (l'.drop 3) 0) 0 - 7) + 8) +> + (reg (dropLead1 (decRuns (l'.drop 3) 0)) +> default)) := by + rw [← ListBlank.append_pow_add] + have h_add : M + 1 + countLead1 (decRuns (l'.drop 3) 0) 0 = + M + (countLead1 (decRuns (l'.drop 3) 0) 0 - 7) + 8 := by omega + rw [h_add] + rw [h_l00, h_l0, h_pow] at h_back + exact neverHaltsFrom_of_reachesStar (stepStar_trans h₁ h_back) + (h' (M + (countLead1 (decRuns (l'.drop 3) 0) 0 - 7))) + +def cyc : List (Fin 2) := [1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0] + +theorem cycle (l : ListBlank (Fin 2)) : + ((cyc +> l) {{B}}> default) [target_tm]⊢⁺ ((cyc +> ([0] +> l)) {{B}}> default) := by + have h := steps1_spec_true target_tm 100 ⟨cyc, [0], B, .right⟩ + (x' := ⟨cyc ++ [0], [], B, .right⟩) (by decide) l default + dsimp only [toCfg, ListBlank.append_nil] at h + have h_r : ([0] : List (Fin 2)) +> default = default := all0_spec (by decide) + rw [h_r, ListBlank.append_assoc] at h + exact h + +def final (zs : List ℕ) : Bool := + BCfg.casesOn (run 521 (frame zs)) (fun l r s sgn => + if r == [] && s == B && sgn == .right then + (stripPfx cyc l).isSome + else + false) + +theorem final_spec (zs : List ℕ) (h : final zs = true) : NH zs := by + intro M + dsimp only [final] at h + have h₁ := stepStar_trans (to_frame M zs) + (run_spec 521 (frame zs) (([1, 1] : List (Fin 2)) ^ M +> ([1] +> default))) + rcases hrun : run 521 (frame zs) with ⟨l', r', s', sgn'⟩ + rw [hrun] at h h₁ + dsimp only at h + split_ifs at h with h_res + rw [Bool.and_assoc, Bool.and_eq_true, beq_iff_eq, Bool.and_eq_true, beq_iff_eq, beq_iff_eq] at h_res + rcases h_res with ⟨hr_nil, hs_B, hsgn_R⟩ + subst hr_nil hs_B hsgn_R + rcases h_sp : stripPfx cyc l' with _ | t + · rw [h_sp] at h; cases h + · dsimp only [toCfg, ListBlank.append_nil] at h₁ + rw [stripPfx_spec h_sp, ListBlank.append_assoc] at h₁ + refine neverHaltsFrom_of_reachesStar h₁ ?_ + exact NeverHaltsFrom.of_reachesPlus_invariant + (P := fun c => ∃ L, c = (cyc +> L) {{B}}> default) + (fun c ⟨L, hL⟩ => by + rw [hL] + exact ⟨(cyc +> ([0] +> L)) {{B}}> default, cycle L, ⟨[0] +> L, rfl⟩⟩) + ⟨t +> (([1, 1] : List (Fin 2)) ^ M +> ([1] +> default)), rfl⟩ + +def driveSteps : ℕ → List ℕ → Option (List ℕ) + | 0, zs => some zs + | k + 1, zs => + match mstep zs with + | some zs₁ => driveSteps k zs₁ + | none => + match special zs with + | some res => SpecialRes.casesOn res (fun _ zs₁ => driveSteps k zs₁) + | none => none + +theorem driveSteps_spec (k : ℕ) (zs zs' : List ℕ) (h : driveSteps k zs = some zs') (h' : NH zs') : + NH zs := by + induction k generalizing zs with + | zero => cases h; exact h' + | succ k ih => + dsimp only [driveSteps] at h + rcases hm : mstep zs with _ | zs₁ <;> rw [hm] at h <;> dsimp only at h + · rcases hs : special zs with _ | ⟨d, zs₁⟩ <;> rw [hs] at h + · cases h + · exact special_spec zs d zs₁ hs (ih zs₁ h) + · exact mstep_spec zs zs₁ hm (ih zs₁ h) + +def driveEnd (k : ℕ) (zs : List ℕ) : Bool := + match driveSteps k zs with + | some zs' => final zs' + | none => false + +theorem driveEnd_spec (k : ℕ) (zs : List ℕ) (h : driveEnd k zs = true) : NH zs := by + dsimp only [driveEnd] at h + rcases hd : driveSteps k zs with _ | zs' <;> rw [hd] at h <;> dsimp only at h + · cases h + · exact driveSteps_spec k zs zs' hd (final_spec zs' h) + +def Z1 : List ℕ := + 13 :: (List.replicate 1193 1 ++ [3, 9] ++ List.replicate 8 1 ++ [2]) + +def checkOpen (x : BCfg (Fin 2) (Fin 6)) : Bool := + BCfg.casesOn x (fun l r s sgn => + r == [] && s == D && sgn == .left && + eqAppR0inf l ([0, 1, 1] ++ (([0, 1] : List (Fin 2)) ^ 10 ++ reg Z1))) + +theorem checkOpen_spec (x : BCfg (Fin 2) (Fin 6)) (h : checkOpen x = true) + (h₁ : (init []) [target_tm]⊢* (toCfg x default default)) : + (init []) [target_tm]⊢* (recCfg 10 Z1) := by + rcases x with ⟨l', r', s', sgn'⟩ + dsimp only [checkOpen] at h + rw [Bool.and_assoc, Bool.and_assoc, Bool.and_eq_true, beq_iff_eq, + Bool.and_eq_true, beq_iff_eq, Bool.and_eq_true, beq_iff_eq] at h + rcases h with ⟨hr_nil, hs_D, hsgn_L, heq⟩ + subst hr_nil hs_D hsgn_L + dsimp only [toCfg] at h₁ + have h_eq : l' +> (default : ListBlank (Fin 2)) = + [0, 1, 1] +> (([0, 1] : List (Fin 2)) ^ 10 +> (reg Z1 +> default)) := by + rw [eqAppR0inf_spec heq, ListBlank.append_assoc, ListBlank.append_assoc] + rw [h_eq] at h₁ + exact h₁ + +def initBCfg : BCfg (Fin 2) (Fin 6) := + ⟨([0] : List (Fin 2)) ^ 2438, [], A, .right⟩ + +def open_ok : Bool := + checkOpen (run 1189 initBCfg) + +theorem opening (h : open_ok = true) : (init []) [target_tm]⊢* (recCfg 10 Z1) := by + have h₁ := run_spec 1189 initBCfg default + have h_init : toCfg initBCfg default default = init [] := by + dsimp only [initBCfg, toCfg, ListBlank.append_nil] + rw [zeros_append_default 2438] + rfl + rw [h_init] at h₁ + exact checkOpen_spec (run 1189 initBCfg) h h₁ + +theorem open_ok_true : open_ok = true := by rfl + +def C9 : List ℕ := [2480, 1, 3, 1, 1, 7, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2] +def C24 : List ℕ := [2558, 1, 1, 1, 3, 1, 1, 5, 1, 6] + +theorem seg1 : driveSteps 3 Z1 = some [2432] := by rfl +theorem seg2 : driveSteps 6 [2432] = some [2454] := by rfl +theorem seg3 : driveSteps 13 [2454] = some [2480] := by rfl +theorem seg4 : driveSteps 6 [2480] = some [2502] := by rfl +theorem seg5 : driveSteps 4 [2502] = some C9 := by rfl +theorem seg6 : driveSteps 19 C9 = some [2532] := by rfl +theorem seg7 : driveSteps 15 [2532] = some [2560] := by rfl +theorem seg8 : driveSteps 13 [2560] = some C24 := by rfl +theorem seg9 : driveSteps 13 C24 = some [2596] := by rfl +theorem seg10 : driveEnd 9 [2596] = true := by rfl + +theorem nh_Z1 : NH Z1 := + driveSteps_spec 3 Z1 [2432] seg1 <| + driveSteps_spec 6 [2432] [2454] seg2 <| + driveSteps_spec 13 [2454] [2480] seg3 <| + driveSteps_spec 6 [2480] [2502] seg4 <| + driveSteps_spec 4 [2502] C9 seg5 <| + driveSteps_spec 19 C9 [2532] seg6 <| + driveSteps_spec 15 [2532] [2560] seg7 <| + driveSteps_spec 13 [2560] C24 seg8 <| + driveSteps_spec 13 C24 [2596] seg9 <| + driveEnd_spec 9 [2596] seg10 + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + rw [isNotHalt_iff_neverHaltsFrom_init] + exact neverHaltsFrom_of_reachesStar (opening open_ok_true) (nh_Z1 2) + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0LD_1LC1RB_0LA0LD_1LE0RB_1RF0RE_HHH0RD diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0LD_1RC0RA_1RD1RF_1LA0LE_1RE1LD_0RBHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0LD_1RC0RA_1RD1RF_1LA0LE_1RE1LD_0RBHHH.lean new file mode 100644 index 00000000..5961e04b --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0LD_1RC0RA_1RD1RF_1LA0LE_1RE1LD_0RBHHH.lean @@ -0,0 +1,2492 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0LD_1RC0RA_1RD1RF_1LA0LE_1RE1LD_0RBHHH + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LD_1RC0RA_1RD1RF_1LA0LE_1RE1LD_0RBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +set_option maxHeartbeats 2000000 +set_option maxRecDepth 2000 + +-- ============================================================================ +-- Section 1: Step Infrastructure, ListBlank Rotation Identities, Shifts & Bounces +-- ============================================================================ + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem pow_zero_list (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +omit [Inhabited Γ] in +@[simp] +theorem list_pow_append_one (u : List (Fin 2)) (k : Nat) : + u^k ++ u = u^(k + 1) := by + have h := list_pow_add_comm u k 1 + dsimp [HPow.hPow] at h ⊢ + rw [List.append_nil] at h + exact h + +theorem pow_add_append_right (u : List (Fin 2)) (m n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (m + n)) +> r = (u ^ m) +> ((u ^ n) +> r) := by + rw [list_pow_add, ← listblank_append_append] + +theorem pow_succ_append_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (n + 1)) +> r = u +> ((u ^ n) +> r) := by + rw [pow_succ_list, ← listblank_append_append] + +theorem pow_succ_append_right' (u : List (Fin 2)) (k : Nat) (r : ListBlank (Fin 2)) : + (u ^ k) +> (u +> r) = (u ^ (k + 1)) +> r := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (m n : Nat) : + s <+ (u ^ (m + n)) = (s <+ (u ^ m)) <+ (u ^ n) := by + rw [listblank_append_append, ← list_pow_add, add_comm] + +theorem pow_succ_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k : Nat) : + (s <+ u) <+ (u ^ k) = s <+ (u ^ (k + 1)) := by + rw [listblank_append_append, list_pow_append_one] + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, _, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +local macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +local macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail]) +local macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step))) +local macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +theorem multiStep_step_isSome {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₀ cfg cfg' : Cfg Γ Λ) (n m : Nat) + (hn : multiStep M c₀ n = some cfg) + (hnm : multiStep M c₀ (n + (1 + m)) = some cfg') : + (step M cfg).isSome := by + rw [multiStep_add M c₀ n (1 + m), hn] at hnm + dsimp [Option.bind] at hnm + rw [multiStep_add M cfg 1 m, multiStep_one] at hnm + cases hs : step M cfg with + | none => + rw [hs] at hnm + nomatch hnm + | some c₁ => rfl + +theorem inv_reaches_beyond {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') + (N : Nat) : + ∃ (m : Nat) (cfg' : Cfg Γ Λ), multiStep M (init []) (N + m) = some cfg' ∧ Inv cfg' := by + induction N with + | zero => + obtain ⟨cfg₀, ⟨n₀, hn₀⟩, h_inv₀⟩ := h_init + refine ⟨n₀, cfg₀, ?_, h_inv₀⟩ + rwa [Nat.zero_add] + | succ N ih => + obtain ⟨m, cfg₁, hm, h_inv₁⟩ := ih + cases m with + | zero => + obtain ⟨cfg₂, ⟨k, hk_pos, hk⟩, h_inv₂⟩ := h_step cfg₁ h_inv₁ + cases k with + | zero => omega + | succ k' => + refine ⟨k', cfg₂, ?_, h_inv₂⟩ + have h_trans := multiStep_trans M (init []) cfg₁ cfg₂ N (k' + 1) hm hk + have h_eq : (N + 1) + k' = N + (k' + 1) := by omega + rwa [h_eq] + | succ m' => + refine ⟨m', cfg₁, ?_, h_inv₁⟩ + have h_eq : (N + 1) + m' = N + (m' + 1) := by omega + rwa [h_eq] + +theorem closed_inv_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') : + IsDoesNotHalt M := by + intro cfg ⟨n, hn⟩ + obtain ⟨m, cfg', hnm, _⟩ := inv_reaches_beyond M Inv h_init h_step (n + 1) + have h_eq : (n + 1) + m = n + (1 + m) := by omega + rw [h_eq] at hnm + exact multiStep_step_isSome M (init []) cfg cfg' n m hn hnm + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + +@[simp] theorem init_nil : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + +theorem pow_01_cons_zero (k : Nat) (r : ListBlank (Fin 2)) : + (([0, 1] : List (Fin 2)) ^ k) +> ((0 : Fin 2) >> r) = + (0 : Fin 2) >> ((([1, 0] : List (Fin 2)) ^ k) +> r) := by + induction k with + | zero => rfl + | succ k ih => + rw [pow_succ_append_right, pow_succ_append_right] + dsimp [ListBlank.append] + rw [ih] + +theorem pow_01_cons_one (k : Nat) (r : ListBlank (Fin 2)) : + (1 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ k) +> r) = + (([1, 0] : List (Fin 2)) ^ k) +> ((1 : Fin 2) >> r) := by + induction k with + | zero => rfl + | succ k ih => + rw [pow_succ_append_right, pow_succ_append_right] + dsimp [ListBlank.append] + rw [← ih] + +theorem pow_10_cons_one (k : Nat) (r : ListBlank (Fin 2)) : + (([1, 0] : List (Fin 2)) ^ k) +> ((1 : Fin 2) >> r) = + (1 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ k) +> r) := + (pow_01_cons_one k r).symm + +theorem left_pow_10_succ (l : ListBlank (Fin 2)) (k : Nat) : + l <+ (([1, 0] : List (Fin 2)) ^ (k + 1)) = + ((l <+ [0]) <+ (([0, 1] : List (Fin 2)) ^ k)) <+ [1] := by + change (([1, 0] : List (Fin 2)) ^ (k + 1)) +> l = (1 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ k) +> ((0 : Fin 2) >> l)) + rw [pow_01_cons_one] + exact (pow_succ_append_right' [1, 0] k l).symm + +theorem left_pow_01_one (l : ListBlank (Fin 2)) (k : Nat) : + (l <+ (([0, 1] : List (Fin 2)) ^ k)) <+ [1] = + (l <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ k) := by + change (1 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ k) +> l) = (([1, 0] : List (Fin 2)) ^ k) +> ((1 : Fin 2) >> l) + exact pow_01_cons_one k l + +-- 5 Elementary Shift Lemmas +theorem shift_AB_R (k : Nat) (l r : ListBlank (Fin 2)) : + (l {{A}}> ((([0, 1] : List (Fin 2)) ^ k) +> r)) [target_tm]⊢* + ((l <+ (([0, 1] : List (Fin 2)) ^ k)) {{A}}> r) := by + induction k generalizing l r with + | zero => + simp only [pow_zero_list, listblank_append_nil] + exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_append_right] + have h1 : (l {{A}}> ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> r))) [target_tm]⊢* + ((l <+ [0, 1]) {{A}}> ((([0, 1] : List (Fin 2)) ^ k) +> r)) := by + dsimp [ListBlank.append]; execute + have h2 := ih (l <+ [0, 1]) r + rw [pow_succ_append_left] at h2 + exact stepStar_trans h1 h2 + +theorem shift_BA_R (k : Nat) (l r : ListBlank (Fin 2)) : + (l {{B}}> ((([1, 0] : List (Fin 2)) ^ k) +> r)) [target_tm]⊢* + ((l <+ (([1, 0] : List (Fin 2)) ^ k)) {{B}}> r) := by + induction k generalizing l r with + | zero => + simp only [pow_zero_list, listblank_append_nil] + exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_append_right] + have h1 : (l {{B}}> ([1, 0] +> ((([1, 0] : List (Fin 2)) ^ k) +> r))) [target_tm]⊢* + ((l <+ [1, 0]) {{B}}> ((([1, 0] : List (Fin 2)) ^ k) +> r)) := by + dsimp [ListBlank.append]; execute + have h2 := ih (l <+ [1, 0]) r + rw [pow_succ_append_left] at h2 + exact stepStar_trans h1 h2 + +theorem shift_AD_L (k : Nat) (l r : ListBlank (Fin 2)) : + ((l <+ (([1, 0] : List (Fin 2)) ^ k)) <{{A}} r) [target_tm]⊢* + (l <{{A}} ((([1, 0] : List (Fin 2)) ^ k) +> r)) := by + induction k generalizing l r with + | zero => + simp only [pow_zero_list, listblank_append_nil] + exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_list, ← listblank_append_append] + have h1 : (((l <+ (([1, 0] : List (Fin 2)) ^ k)) <+ [1, 0]) <{{A}} r) [target_tm]⊢* + ((l <+ (([1, 0] : List (Fin 2)) ^ k)) <{{A}} ([1, 0] +> r)) := by + dsimp [ListBlank.append]; execute + have h2 := ih l ([1, 0] +> r) + rw [pow_succ_append_right'] at h2 + exact stepStar_trans h1 h2 + +theorem shift_DA_L (k : Nat) (l r : ListBlank (Fin 2)) : + ((l <+ (([0, 1] : List (Fin 2)) ^ k)) <{{D}} r) [target_tm]⊢* + (l <{{D}} ((([0, 1] : List (Fin 2)) ^ k) +> r)) := by + induction k generalizing l r with + | zero => + simp only [pow_zero_list, listblank_append_nil] + exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_list, ← listblank_append_append] + have h1 : (((l <+ (([0, 1] : List (Fin 2)) ^ k)) <+ [0, 1]) <{{D}} r) [target_tm]⊢* + ((l <+ (([0, 1] : List (Fin 2)) ^ k)) <{{D}} ([0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + have h2 := ih l ([0, 1] +> r) + rw [pow_succ_append_right'] at h2 + exact stepStar_trans h1 h2 + +theorem shift_DE_L1 (k : Nat) (l r : ListBlank (Fin 2)) : + ((l <+ (([1, 0] : List (Fin 2)) ^ k)) <{{D}} ((1 : Fin 2) >> r)) [target_tm]⊢* + (l <{{D}} ((([1, 0] : List (Fin 2)) ^ k) +> ((1 : Fin 2) >> r))) := by + induction k generalizing l r with + | zero => + simp only [pow_zero_list, listblank_append_nil] + exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_list, ← listblank_append_append] + have h1 : (((l <+ (([1, 0] : List (Fin 2)) ^ k)) <+ [1, 0]) <{{D}} ((1 : Fin 2) >> r)) [target_tm]⊢* + ((l <+ (([1, 0] : List (Fin 2)) ^ k)) <{{D}} ((1 : Fin 2) >> ([0, 1] +> r))) := by + dsimp [ListBlank.append]; execute + have h2 := ih l ([0, 1] +> r) + rw [pow_10_cons_one k ([0, 1] +> r), pow_succ_append_right', ← pow_10_cons_one (k + 1) r] at h2 + exact stepStar_trans h1 h2 + +-- 3 Bounce Helpers +theorem bounce_00_01_cap1 (k : Nat) (l r : ListBlank (Fin 2)) : + (((l <+ [0, 0]) <+ (([0, 1] : List (Fin 2)) ^ k)) <{{D}} ((1 : Fin 2) >> r)) [target_tm]⊢⁺ + ((l <+ [1]) <{{A}} ((([1, 0] : List (Fin 2)) ^ (k + 1)) +> r)) := by + have h1 := shift_DA_L k (l <+ [0, 0]) ((1 : Fin 2) >> r) + have h2 : ((l <+ [0, 0]) <{{D}} ((([0, 1] : List (Fin 2)) ^ k) +> ((1 : Fin 2) >> r))) [target_tm]⊢⁺ + ((l <+ [1]) {{B}}> ((1 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ k) +> ((1 : Fin 2) >> r)))) := by + dsimp [ListBlank.append]; execute + rw [pow_01_cons_one k ((1 : Fin 2) >> r)] at h2 + have h3 := shift_BA_R k (l <+ [1]) ((1 : Fin 2) >> ((1 : Fin 2) >> r)) + have h4 : (((l <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ k)) {{B}}> ((1 : Fin 2) >> ((1 : Fin 2) >> r))) [target_tm]⊢⁺ + (((l <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ k)) <{{A}} ([1, 0] +> r)) := by + dsimp [ListBlank.append]; execute + have h5 := shift_AD_L k (l <+ [1]) ([1, 0] +> r) + rw [pow_succ_append_right'] at h5 + exact stepStar_stepPlus_stepPlus h1 + (stepPlus_trans h2 (stepStar_stepPlus_stepPlus h3 (stepPlus_stepStar_stepPlus h4 h5))) + +theorem sweep_E_left_011_10 (q : Nat) (l r : ListBlank (Fin 2)) : + (((l <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ (q + 1))) <{{E}} r) [target_tm]⊢⁺ + (l <{{D}} ([1, 0] +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ((0 : Fin 2) >> r)))) := by + have h_lhs : ((l <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ (q + 1))) = + ((((l <+ [1, 1]) <+ [0, 0]) <+ (([0, 1] : List (Fin 2)) ^ q)) <+ [1]) := by + rw [left_pow_10_succ] + simp only [listblank_append_append]; rfl + rw [h_lhs] + have h1 : (((((l <+ [1, 1]) <+ [0, 0]) <+ (([0, 1] : List (Fin 2)) ^ q)) <+ [1]) <{{E}} r) [target_tm]⊢⁺ + ((((l <+ [1, 1]) <+ [0, 0]) <+ (([0, 1] : List (Fin 2)) ^ q)) <{{D}} ((1 : Fin 2) >> r)) := by + dsimp [ListBlank.append]; execute + have h2 := bounce_00_01_cap1 q (l <+ [1, 1]) r + have h_rhs : ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r) = + (1 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ q) +> ((0 : Fin 2) >> r)) := by + rw [pow_01_cons_one] + exact (pow_succ_append_right' [1, 0] q r).symm + rw [h_rhs] at h2 + have h3 : (((l <+ [1, 1]) <+ [1]) <{{A}} ((1 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ q) +> ((0 : Fin 2) >> r)))) [target_tm]⊢⁺ + (l <{{D}} ([1, 0] +> ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ q) +> ((0 : Fin 2) >> r))))) := by + dsimp [ListBlank.append]; execute + rw [← pow_succ_append_right [0, 1] q ((0 : Fin 2) >> r)] at h3 + exact stepPlus_trans h1 (stepPlus_trans h2 h3) + +theorem sweep_E_left_0_10 (p : Nat) (l r : ListBlank (Fin 2)) : + (((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ (p + 1))) <{{E}} r) [target_tm]⊢⁺ + (l <{{D}} ((([0, 1] : List (Fin 2)) ^ (p + 1)) +> ((0 : Fin 2) >> r))) := by + have h_lhs : ((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ (p + 1))) = + (((l <+ [0, 0]) <+ (([0, 1] : List (Fin 2)) ^ p)) <+ [1]) := by + rw [left_pow_10_succ] + simp only [listblank_append_append]; rfl + rw [h_lhs] + have h1 : ((((l <+ [0, 0]) <+ (([0, 1] : List (Fin 2)) ^ p)) <+ [1]) <{{E}} r) [target_tm]⊢⁺ + (((l <+ [0, 0]) <+ (([0, 1] : List (Fin 2)) ^ p)) <{{D}} ((1 : Fin 2) >> r)) := by + dsimp [ListBlank.append]; execute + have h2 := bounce_00_01_cap1 p l r + have h_rhs : ((([1, 0] : List (Fin 2)) ^ (p + 1)) +> r) = + (1 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ p) +> ((0 : Fin 2) >> r)) := by + rw [pow_01_cons_one] + exact (pow_succ_append_right' [1, 0] p r).symm + rw [h_rhs] at h2 + have h3 : ((l <+ [1]) <{{A}} ((1 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ p) +> ((0 : Fin 2) >> r)))) [target_tm]⊢⁺ + (l <{{D}} ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ p) +> ((0 : Fin 2) >> r)))) := by + dsimp [ListBlank.append]; execute + rw [← pow_succ_append_right [0, 1] p ((0 : Fin 2) >> r)] at h3 + exact stepPlus_trans h1 (stepPlus_trans h2 h3) + +theorem round_A_10_cap11 (k : Nat) (r : ListBlank (Fin 2)) : + (default <{{A}} ((([1, 0] : List (Fin 2)) ^ k) +> ([1, 1] +> r))) [target_tm]⊢⁺ + (default <{{A}} ((([1, 0] : List (Fin 2)) ^ (k + 2)) +> r)) := by + have h1 : (default <{{A}} ((([1, 0] : List (Fin 2)) ^ k) +> ([1, 1] +> r))) [target_tm]⊢⁺ + ((default <+ [1]) {{B}}> ((([1, 0] : List (Fin 2)) ^ k) +> ([1, 1] +> r))) := by + dsimp [ListBlank.append]; execute + have h2 := shift_BA_R k (default <+ [1]) ([1, 1] +> r) + have h3 : (((default <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ k)) {{B}}> ([1, 1] +> r)) [target_tm]⊢⁺ + (((default <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ k)) <{{A}} ([1, 0] +> r)) := by + dsimp [ListBlank.append]; execute + have h4 := shift_AD_L k (default <+ [1]) ([1, 0] +> r) + rw [pow_succ_append_right'] at h4 + have h5 : ((default <+ [1]) <{{A}} ((([1, 0] : List (Fin 2)) ^ (k + 1)) +> r)) [target_tm]⊢⁺ + (default <{{A}} ([1, 0] +> ((([1, 0] : List (Fin 2)) ^ (k + 1)) +> r))) := by + dsimp [ListBlank.append]; execute + rw [← pow_succ_append_right [1, 0] (k + 1) r] at h5 + exact stepPlus_trans h1 (stepStar_stepPlus_stepPlus h2 (stepPlus_trans h3 (stepStar_stepPlus_stepPlus h4 h5))) + +theorem round_A_10_cap001 (k : Nat) (r : ListBlank (Fin 2)) : + (default <{{A}} ((([1, 0] : List (Fin 2)) ^ k) +> ([0, 0, 1] +> r))) [target_tm]⊢⁺ + (default <{{A}} ((([1, 0] : List (Fin 2)) ^ k) +> ([1, 1] +> ([0, 1, 0] +> r)))) := by + have h1 : (default <{{A}} ((([1, 0] : List (Fin 2)) ^ k) +> ([0, 0, 1] +> r))) [target_tm]⊢⁺ + ((default <+ [1]) {{B}}> ((([1, 0] : List (Fin 2)) ^ k) +> ([0, 0, 1] +> r))) := by + dsimp [ListBlank.append]; execute + have h2 := shift_BA_R k (default <+ [1]) ([0, 0, 1] +> r) + rw [← left_pow_01_one default k] at h2 + have h3 : (((default <+ (([0, 1] : List (Fin 2)) ^ k)) <+ [1]) {{B}}> ([0, 0, 1] +> r)) [target_tm]⊢⁺ + ((default <+ (([0, 1] : List (Fin 2)) ^ k)) <{{D}} ([1, 0, 1, 0] +> r)) := by + dsimp [ListBlank.append]; execute + have h4 := shift_DA_L k default ([1, 0, 1, 0] +> r) + have h5 : (default <{{D}} ((([0, 1] : List (Fin 2)) ^ k) +> ([1, 0, 1, 0] +> r))) [target_tm]⊢⁺ + (default <{{A}} ((1 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ k) +> ([1, 0, 1, 0] +> r)))) := by + dsimp [ListBlank.append]; execute + rw [pow_01_cons_one k ([1, 0, 1, 0] +> r)] at h5 + have h_eq : ((1 : Fin 2) >> ([1, 0, 1, 0] +> r)) = ([1, 1] +> ([0, 1, 0] +> r)) := rfl + rw [h_eq] at h5 + exact stepPlus_trans h1 (stepStar_stepPlus_stepPlus h2 (stepPlus_trans h3 (stepStar_stepPlus_stepPlus h4 h5))) + +-- ============================================================================ +-- Section 2: The 14 Low-Level Sweeps +-- ============================================================================ + +-- 1. Start +theorem Start (h : Nat) (r : ListBlank (Fin 2)) : + (default <{{A}} ((([1, 0] : List (Fin 2)) ^ h) +> ([1, 1, 0, 0, 1] +> r))) [target_tm]⊢⁺ + ((((default <+ (([0, 1] : List (Fin 2)) ^ (4 + h))) <+ [1, 1, 1]) <+ [0]) {{B}}> r) := by + have h_eq1 : ([1, 1, 0, 0, 1] +> r) = ([1, 1] +> ([0, 0, 1] +> r)) := rfl + rw [h_eq1] + have h1 := round_A_10_cap11 h ([0, 0, 1] +> r) + have h2 := round_A_10_cap001 (h + 2) r + have h3 := round_A_10_cap11 (h + 2) ([0, 1, 0] +> r) + have h_add : (h + 2) + 2 = 4 + h := by omega + rw [h_add] at h3 + have h4 : (default <{{A}} ((([1, 0] : List (Fin 2)) ^ (4 + h)) +> ([0, 1, 0] +> r))) [target_tm]⊢⁺ + ((default <+ [1]) {{B}}> ((([1, 0] : List (Fin 2)) ^ (4 + h)) +> ([0, 1, 0] +> r))) := by + dsimp [ListBlank.append]; execute + have h5 := shift_BA_R (4 + h) (default <+ [1]) ([0, 1, 0] +> r) + rw [← left_pow_01_one default (4 + h)] at h5 + have h6 : (((default <+ (([0, 1] : List (Fin 2)) ^ (4 + h))) <+ [1]) {{B}}> ([0, 1, 0] +> r)) [target_tm]⊢⁺ + ((((default <+ (([0, 1] : List (Fin 2)) ^ (4 + h))) <+ [1, 1, 1]) <+ [0]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + exact stepPlus_trans h1 (stepPlus_trans h2 (stepPlus_trans h3 + (stepPlus_trans h4 (stepStar_stepPlus_stepPlus h5 h6)))) + +-- 2. PassR +theorem PassR (l : ListBlank (Fin 2)) (p q : Nat) (r : ListBlank (Fin 2)) : + ((l <+ [0]) {{B}}> ((([1, 0] : List (Fin 2)) ^ p) +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> r)))) [target_tm]⊢* + (((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) <+ [1, 1]) <+ [0]) {{B}}> r) := by + have h_mid : ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> r)) = + [0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ q) +> ([0, 1, 0] +> r)) := by + rw [pow_succ_append_right] + dsimp [ListBlank.append] + rw [pow_01_cons_zero] + rw [h_mid] + have h1 := shift_BA_R p (l <+ [0]) ([0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ q) +> ([0, 1, 0] +> r))) + have h2 : (((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) {{B}}> + ([0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ q) +> ([0, 1, 0] +> r)))) [target_tm]⊢* + ((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) {{B}}> + ((([1, 0] : List (Fin 2)) ^ q) +> ([0, 1, 0] +> r))) := by + dsimp [ListBlank.append]; execute + have h3 := shift_BA_R q (((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) ([0, 1, 0] +> r) + have h4 : (((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) {{B}}> + ([0, 1, 0] +> r)) [target_tm]⊢* + (((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) <+ [1, 1]) <+ [0]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + exact stepStar_trans h1 (stepStar_trans h2 (stepStar_trans h3 h4)) + +-- 3. Borrow +theorem Borrow (l : ListBlank (Fin 2)) (p q : Nat) (r : ListBlank (Fin 2)) : + (l {{B}}> ((([1, 0] : List (Fin 2)) ^ p) +> ((([0, 1] : List (Fin 2)) ^ (q + 2)) +> ([0, 0, 0, 1] +> r)))) [target_tm]⊢* + (l <{{D}} ((([1, 0] : List (Fin 2)) ^ (p + 1)) +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> r)))) := by + have h_mid : ((([0, 1] : List (Fin 2)) ^ (q + 2)) +> ([0, 0, 0, 1] +> r)) = + [0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1] +> r)) := by + rw [pow_succ_append_right] + dsimp [ListBlank.append] + rw [pow_01_cons_zero] + rw [h_mid] + have h1 := shift_BA_R p l ([0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1] +> r))) + have h2 : ((l <+ (([1, 0] : List (Fin 2)) ^ p)) {{B}}> + ([0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1] +> r)))) [target_tm]⊢* + (((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) {{B}}> + ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1] +> r))) := by + dsimp [ListBlank.append]; execute + have h3 := shift_BA_R (q + 1) ((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) ([0, 0, 1] +> r) + have h4 : ((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ (q + 1))) {{B}}> + ([0, 0, 1] +> r)) [target_tm]⊢* + ((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ (q + 1))) <{{E}} + ([0, 1, 0] +> r)) := by + dsimp [ListBlank.append]; execute + have h5 := stepPlus_stepStar (sweep_E_left_011_10 q (l <+ (([1, 0] : List (Fin 2)) ^ p)) ([0, 1, 0] +> r)) + have h_eq5 : ((0 : Fin 2) >> ([0, 1, 0] +> r)) = ([0, 0, 1, 0] +> r) := rfl + rw [h_eq5] at h5 + have h6 := shift_DE_L1 p l ((0 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> r))) + have h_eq6 : ((1 : Fin 2) >> ((0 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> r)))) = + ([1, 0] +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> r))) := rfl + rw [h_eq6, pow_succ_append_right' [1, 0] p] at h6 + exact stepStar_trans h1 (stepStar_trans h2 (stepStar_trans h3 (stepStar_trans h4 (stepStar_trans h5 h6)))) + +-- 4. PassL +theorem PassL (l : ListBlank (Fin 2)) (p q : Nat) (r : ListBlank (Fin 2)) : + (((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ (q + 1))) <+ [1, 1]) <+ [0]) <{{D}} r) [target_tm]⊢* + ((l <+ [0]) <{{D}} ((([1, 0] : List (Fin 2)) ^ (p + 1)) +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 0, 1] +> r)))) := by + have h1 : (((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ (q + 1))) <+ [1, 1]) <+ [0]) <{{D}} r) [target_tm]⊢* + (((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ (q + 1))) <{{E}} ([0, 0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + have h2 := stepPlus_stepStar (sweep_E_left_011_10 q ((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) ([0, 0, 1] +> r)) + have h_eq2 : ((0 : Fin 2) >> ([0, 0, 1] +> r)) = ([0, 0, 0, 1] +> r) := rfl + rw [h_eq2] at h2 + have h3 := shift_DE_L1 p (l <+ [0]) ((0 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 0, 1] +> r))) + have h_eq3 : ((1 : Fin 2) >> ((0 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 0, 1] +> r)))) = + ([1, 0] +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 0, 1] +> r))) := rfl + rw [h_eq3, pow_succ_append_right' [1, 0] p] at h3 + exact stepStar_trans h1 (stepStar_trans h2 h3) + +-- 5. EndPh +theorem EndPh (h : Nat) (r : ListBlank (Fin 2)) : + ((((default <+ (([0, 1] : List (Fin 2)) ^ (4 + h))) <+ [1, 1, 1]) <+ [0]) <{{D}} r) [target_tm]⊢* + (default <{{A}} ((([1, 0] : List (Fin 2)) ^ (4 + h)) +> ([1, 1, 0, 0, 1] +> r))) := by + have h1 : ((((default <+ (([0, 1] : List (Fin 2)) ^ (4 + h))) <+ [1, 1, 1]) <+ [0]) <{{D}} r) [target_tm]⊢* + ((default <+ (([0, 1] : List (Fin 2)) ^ (4 + h))) <{{D}} ([1, 0, 0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + have h2 := shift_DA_L (4 + h) default ([1, 0, 0, 1] +> r) + have h3 : (default <{{D}} ((([0, 1] : List (Fin 2)) ^ (4 + h)) +> ([1, 0, 0, 1] +> r))) [target_tm]⊢* + (default <{{A}} ((1 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ (4 + h)) +> ([1, 0, 0, 1] +> r)))) := by + dsimp [ListBlank.append]; execute + rw [pow_01_cons_one (4 + h) ([1, 0, 0, 1] +> r)] at h3 + have h_eq : ((1 : Fin 2) >> ([1, 0, 0, 1] +> r)) = ([1, 1, 0, 0, 1] +> r) := rfl + rw [h_eq] at h3 + exact stepStar_trans h1 (stepStar_trans h2 h3) + +-- 6. EndT +theorem EndT (l : ListBlank (Fin 2)) (p q : Nat) : + ((((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ (q + 1))) <+ [1, 1]) <+ [0]) {{B}}> default) [target_tm]⊢* + (l <{{D}} ((([1, 0] : List (Fin 2)) ^ (p + 1)) +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> ([1, 0, 1] +> default))))) := by + have h1 : ((((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ (q + 1))) <+ [1, 1]) <+ [0]) {{B}}> default) [target_tm]⊢* + ((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ (q + 1))) <{{E}} ([0, 1, 0] +> ([1, 0, 1] +> default))) := by + dsimp [ListBlank.append]; execute + have h2 := stepPlus_stepStar (sweep_E_left_011_10 q (l <+ (([1, 0] : List (Fin 2)) ^ p)) ([0, 1, 0] +> ([1, 0, 1] +> default))) + have h_eq2 : ((0 : Fin 2) >> ([0, 1, 0] +> ([1, 0, 1] +> default))) = ([0, 0, 1, 0] +> ([1, 0, 1] +> default)) := rfl + rw [h_eq2] at h2 + have h3 := shift_DE_L1 p l ((0 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> ([1, 0, 1] +> default)))) + have h_eq3 : ((1 : Fin 2) >> ((0 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> ([1, 0, 1] +> default))))) = + ([1, 0] +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> ([1, 0, 1] +> default)))) := rfl + rw [h_eq3, pow_succ_append_right' [1, 0] p] at h3 + exact stepStar_trans h1 (stepStar_trans h2 h3) + +-- 7. EndLastT +theorem EndLastT (l : ListBlank (Fin 2)) (p : Nat) : + (((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ [1, 1]) <+ [0]) {{B}}> default) [target_tm]⊢* + (l <{{D}} ((([1, 0] : List (Fin 2)) ^ (p + 4)) +> ([1] +> default))) := by + have h1 : (((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ [1, 1]) <+ [0]) {{B}}> default) [target_tm]⊢* + ((l <+ (([1, 0] : List (Fin 2)) ^ p)) <{{D}} ((([1, 0] : List (Fin 2)) ^ 4) +> ([1] +> default))) := by + dsimp [ListBlank.append]; execute + have h2 := shift_DE_L1 p l ((0 : Fin 2) >> ((([1, 0] : List (Fin 2)) ^ 3) +> ([1] +> default))) + have h_eq : ((1 : Fin 2) >> ((0 : Fin 2) >> ((([1, 0] : List (Fin 2)) ^ 3) +> ([1] +> default)))) = + ((([1, 0] : List (Fin 2)) ^ 4) +> ([1] +> default)) := rfl + rw [h_eq, ← pow_add_append_right [1, 0] p 4 ([1] +> default)] at h2 + exact stepStar_trans h1 h2 + +-- 8. MergeB +theorem MergeB (l : ListBlank (Fin 2)) (p p' : Nat) (r : ListBlank (Fin 2)) : + (l {{B}}> ((([1, 0] : List (Fin 2)) ^ p) +> ([0, 1] +> ([0, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ p') +> r))))) [target_tm]⊢* + (l <{{D}} ((([1, 0] : List (Fin 2)) ^ (p + p' + 3)) +> r)) := by + have h1 := shift_BA_R p l ([0, 1] +> ([0, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ p') +> r))) + have h2 : ((l <+ (([1, 0] : List (Fin 2)) ^ p)) {{B}}> + ([0, 1] +> ([0, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ p') +> r)))) [target_tm]⊢* + ((l <+ (([1, 0] : List (Fin 2)) ^ p)) <{{D}} ((([1, 0] : List (Fin 2)) ^ 3) +> ((([1, 0] : List (Fin 2)) ^ p') +> r))) := by + dsimp [ListBlank.append]; execute + have h3 := shift_DE_L1 p l ((0 : Fin 2) >> ((([1, 0] : List (Fin 2)) ^ 2) +> ((([1, 0] : List (Fin 2)) ^ p') +> r))) + have h_eq : ((1 : Fin 2) >> ((0 : Fin 2) >> ((([1, 0] : List (Fin 2)) ^ 2) +> ((([1, 0] : List (Fin 2)) ^ p') +> r)))) = + ((([1, 0] : List (Fin 2)) ^ 3) +> ((([1, 0] : List (Fin 2)) ^ p') +> r)) := rfl + rw [← pow_add_append_right [1, 0] 3 p' r] at h2 + rw [h_eq, ← pow_add_append_right [1, 0] 3 p' r, ← pow_add_append_right [1, 0] p (3 + p') r] at h3 + have h_add : p + (3 + p') = p + p' + 3 := by omega + rw [h_add] at h3 + exact stepStar_trans h1 (stepStar_trans h2 h3) + +-- 9. MergeE +theorem MergeE (l : ListBlank (Fin 2)) (p : Nat) : + (l {{B}}> ((([1, 0] : List (Fin 2)) ^ p) +> ([0, 1] +> ([0, 0, 0, 1] +> default)))) [target_tm]⊢* + (l <{{D}} ((([1, 0] : List (Fin 2)) ^ (p + 2)) +> ([1] +> default))) := by + have h1 := shift_BA_R p l ([0, 1] +> ([0, 0, 0, 1] +> default)) + have h2 : ((l <+ (([1, 0] : List (Fin 2)) ^ p)) {{B}}> ([0, 1] +> ([0, 0, 0, 1] +> default))) [target_tm]⊢* + ((l <+ (([1, 0] : List (Fin 2)) ^ p)) <{{D}} ((([1, 0] : List (Fin 2)) ^ 2) +> ([1] +> default))) := by + dsimp [ListBlank.append]; execute + have h3 := shift_DE_L1 p l ((0 : Fin 2) >> ((([1, 0] : List (Fin 2)) ^ 1) +> ([1] +> default))) + have h_eq : ((1 : Fin 2) >> ((0 : Fin 2) >> ((([1, 0] : List (Fin 2)) ^ 1) +> ([1] +> default)))) = + ((([1, 0] : List (Fin 2)) ^ 2) +> ([1] +> default)) := rfl + rw [h_eq, ← pow_add_append_right [1, 0] p 2 ([1] +> default)] at h3 + exact stepStar_trans h1 (stepStar_trans h2 h3) + +-- 10. OvT +theorem OvT (l : ListBlank (Fin 2)) (t : Nat) : + ((l <+ [0]) {{B}}> ((([1, 0] : List (Fin 2)) ^ t) +> ([1] +> default))) [target_tm]⊢* + (l <{{D}} ((([0, 1] : List (Fin 2)) ^ (t + 1)) +> ([0, 0, 0, 1] +> default))) := by + have h1 := shift_BA_R t (l <+ [0]) ([1] +> default) + have h2 : (((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ t)) {{B}}> ([1] +> default)) [target_tm]⊢* + ((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ t)) <+ [1, 0]) <{{E}} ([0, 0, 1] +> default)) := by + dsimp [ListBlank.append]; execute + have h_lhs : (((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ t)) <+ [1, 0]) = + ((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ (t + 1))) := by + rw [listblank_append_append, ← pow_succ_list] + rw [h_lhs] at h2 + have h3 := stepPlus_stepStar (sweep_E_left_0_10 t l ([0, 0, 1] +> default)) + have h_eq3 : ((0 : Fin 2) >> ([0, 0, 1] +> default)) = ([0, 0, 0, 1] +> default) := rfl + rw [h_eq3] at h3 + exact stepStar_trans h1 (stepStar_trans h2 h3) + +-- 11. OvL +theorem OvL (l : ListBlank (Fin 2)) (p q : Nat) (r : ListBlank (Fin 2)) : + ((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ (p + 1))) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) <+ [1, 1]) <{{D}} r) [target_tm]⊢* + (l <{{D}} ((([0, 1] : List (Fin 2)) ^ (p + 1)) +> ([0, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r)))) := by + have h1 : ((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ (p + 1))) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) <+ [1, 1]) <{{D}} r) [target_tm]⊢* + (((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ (p + 1))) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) <{{D}} ((1 : Fin 2) >> ((0 : Fin 2) >> r))) := by + dsimp [ListBlank.append]; execute + have h2 := shift_DE_L1 q (((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ (p + 1))) <+ [0, 1, 1]) ((0 : Fin 2) >> r) + have h_eq2 : ((1 : Fin 2) >> ((0 : Fin 2) >> r)) = ([1, 0] +> r) := rfl + rw [h_eq2, pow_succ_append_right' [1, 0] q r] at h2 + have h3 : ((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ (p + 1))) <+ [0, 1, 1]) <{{D}} ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r)) [target_tm]⊢* + (((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ (p + 1))) <{{E}} ([0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r))) := by + dsimp [ListBlank.append]; execute + have h4 := stepPlus_stepStar (sweep_E_left_0_10 p l ([0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r))) + have h_eq4 : ((0 : Fin 2) >> ([0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r))) = + ([0, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r)) := rfl + rw [h_eq4] at h4 + exact stepStar_trans h1 (stepStar_trans h2 (stepStar_trans h3 h4)) + +-- Helper for OvEnd (and step 178 -> 275 of init stem) +theorem OvEnd_tail (h p : Nat) (r : ListBlank (Fin 2)) : + ((default <+ [1]) <{{D}} ((([1, 0] : List (Fin 2)) ^ (5 + h)) +> ((([0, 1] : List (Fin 2)) ^ (p + 2)) +> ([0, 0, 0, 1] +> r)))) [target_tm]⊢* + (default <{{A}} ((([1, 0] : List (Fin 2)) ^ 2) +> ([1, 1, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (h + 5)) +> ((([0, 1] : List (Fin 2)) ^ (p + 1)) +> ([0, 0, 1, 0] +> r)))))) := by + have h_eq1 : (5 + h) = (4 + h) + 1 := by omega + rw [h_eq1, pow_succ_append_right] + have h1 : ((default <+ [1]) <{{D}} ([1, 0] +> ((([1, 0] : List (Fin 2)) ^ (4 + h)) +> ((([0, 1] : List (Fin 2)) ^ (p + 2)) +> ([0, 0, 0, 1] +> r))))) [target_tm]⊢* + ((default <+ [0, 1, 1, 1, 0, 1, 0, 1]) {{B}}> ((([1, 0] : List (Fin 2)) ^ (4 + h)) +> ((([0, 1] : List (Fin 2)) ^ (p + 2)) +> ([0, 0, 0, 1] +> r)))) := by + dsimp [ListBlank.append]; execute + have h2 := Borrow (default <+ [0, 1, 1, 1, 0, 1, 0, 1]) (4 + h) p r + have h_add : (4 + h) + 1 = h + 5 := by omega + rw [h_add] at h2 + have h3 : ((default <+ [0, 1, 1, 1, 0, 1, 0, 1]) <{{D}} ((([1, 0] : List (Fin 2)) ^ (h + 5)) +> ((([0, 1] : List (Fin 2)) ^ (p + 1)) +> ([0, 0, 1, 0] +> r)))) [target_tm]⊢* + (default <{{A}} ((([1, 0] : List (Fin 2)) ^ 2) +> ([1, 1, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (h + 5)) +> ((([0, 1] : List (Fin 2)) ^ (p + 1)) +> ([0, 0, 1, 0] +> r)))))) := by + dsimp [ListBlank.append]; execute + exact stepStar_trans h1 (stepStar_trans h2 h3) + +-- 12. OvEnd +theorem OvEnd (h p : Nat) (r : ListBlank (Fin 2)) : + (((default <+ (([0, 1] : List (Fin 2)) ^ (4 + h))) <+ [1, 1, 1]) <{{D}} ((([0, 1] : List (Fin 2)) ^ (p + 2)) +> ([0, 0, 0, 1] +> r))) [target_tm]⊢* + (default <{{A}} ((([1, 0] : List (Fin 2)) ^ 2) +> ([1, 1, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (h + 5)) +> ((([0, 1] : List (Fin 2)) ^ (p + 1)) +> ([0, 0, 1, 0] +> r)))))) := by + have h_lhs : ((default <+ (([0, 1] : List (Fin 2)) ^ (4 + h))) <+ [1, 1, 1]) = + (((default <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ (4 + h))) <+ [1, 1]) := by + rw [← left_pow_01_one default (4 + h)] + simp only [listblank_append_append]; rfl + rw [h_lhs] + have h1 : ((((default <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ (4 + h))) <+ [1, 1]) <{{D}} ((([0, 1] : List (Fin 2)) ^ (p + 2)) +> ([0, 0, 0, 1] +> r))) [target_tm]⊢* + (((default <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ (4 + h))) <{{D}} ((1 : Fin 2) >> ((0 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ (p + 2)) +> ([0, 0, 0, 1] +> r))))) := by + dsimp [ListBlank.append]; execute + have h2 := shift_DE_L1 (4 + h) (default <+ [1]) ((0 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ (p + 2)) +> ([0, 0, 0, 1] +> r))) + have h_eq2 : ((1 : Fin 2) >> ((0 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ (p + 2)) +> ([0, 0, 0, 1] +> r)))) = + ([1, 0] +> ((([0, 1] : List (Fin 2)) ^ (p + 2)) +> ([0, 0, 0, 1] +> r))) := rfl + rw [h_eq2, pow_succ_append_right' [1, 0] (4 + h)] at h2 + have h_add : (4 + h) + 1 = 5 + h := by omega + rw [h_add] at h2 + exact stepStar_trans h1 (stepStar_trans h2 (OvEnd_tail h p r)) + +-- 13. X1Sw +theorem X1Sw (l : ListBlank (Fin 2)) (p : Nat) (r : ListBlank (Fin 2)) : + ((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ (p + 1))) <+ [0, 1, 1]) <+ [1, 1]) <+ [0]) <{{D}} r) [target_tm]⊢* + (l <{{D}} ((([0, 1] : List (Fin 2)) ^ (p + 1)) +> ([0, 0, 1, 0, 1, 0, 1] +> r))) := by + have h1 : ((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ (p + 1))) <+ [0, 1, 1]) <+ [1, 1]) <+ [0]) <{{D}} r) [target_tm]⊢* + (((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ (p + 1))) <{{E}} ([0, 1, 0, 1, 0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + have h2 := stepPlus_stepStar (sweep_E_left_0_10 p l ([0, 1, 0, 1, 0, 1] +> r)) + have h_eq : ((0 : Fin 2) >> ([0, 1, 0, 1, 0, 1] +> r)) = ([0, 0, 1, 0, 1, 0, 1] +> r) := rfl + rw [h_eq] at h2 + exact stepStar_trans h1 h2 + +-- 14. X2T +theorem X2T (l : ListBlank (Fin 2)) (p q k : Nat) : + ((((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ (q + 1))) <+ [1, 1]) <+ [0]) {{B}}> + ([1, 0, 1, 1, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ (k + 1)) +> default))) [target_tm]⊢* + (l <{{D}} ((([1, 0] : List (Fin 2)) ^ (p + 1)) +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ 3) +> ((([0, 1] : List (Fin 2)) ^ (k + 1)) +> ([0, 0, 0, 1] +> default))))))) := by + have h_rhs1 : ((([0, 1] : List (Fin 2)) ^ (k + 1)) +> default) = + (0 : Fin 2) >> ((([1, 0] : List (Fin 2)) ^ k) +> ([1] +> default)) := by + have h_def : ([1] +> (default : ListBlank (Fin 2))) = (1 : Fin 2) >> ((0 : Fin 2) >> default) := by + simp [ListBlank.append] + rw [h_def, ← pow_01_cons_one k ((0 : Fin 2) >> default), zero_cons_default] + exact pow_succ_append_right [0, 1] k default + rw [h_rhs1] + let L_pre := ((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ (q + 1))) <+ [1, 1]) + have h1 : ((L_pre <+ [0]) {{B}}> ([1, 0, 1, 1, 0, 1] +> ((0 : Fin 2) >> ((([1, 0] : List (Fin 2)) ^ k) +> ([1] +> default))))) [target_tm]⊢* + (((L_pre <+ [1, 1, 1, 0, 1, 0, 1]) <+ [0]) {{B}}> ((([1, 0] : List (Fin 2)) ^ k) +> ([1] +> default))) := by + dsimp [ListBlank.append]; execute + have h2 := OvT (L_pre <+ [1, 1, 1, 0, 1, 0, 1]) k + have h3 : ((L_pre <+ [1, 1, 1, 0, 1, 0, 1]) <{{D}} ((([0, 1] : List (Fin 2)) ^ (k + 1)) +> ([0, 0, 0, 1] +> default))) [target_tm]⊢* + ((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ (q + 1))) <{{E}} + ([0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ 3) +> ((([0, 1] : List (Fin 2)) ^ (k + 1)) +> ([0, 0, 0, 1] +> default))))) := by + dsimp [L_pre, ListBlank.append]; execute + have h4 := stepPlus_stepStar (sweep_E_left_011_10 q (l <+ (([1, 0] : List (Fin 2)) ^ p)) + ([0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ 3) +> ((([0, 1] : List (Fin 2)) ^ (k + 1)) +> ([0, 0, 0, 1] +> default))))) + have h_eq4 : ((0 : Fin 2) >> ([0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ 3) +> ((([0, 1] : List (Fin 2)) ^ (k + 1)) +> ([0, 0, 0, 1] +> default))))) = + ([0, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ 3) +> ((([0, 1] : List (Fin 2)) ^ (k + 1)) +> ([0, 0, 0, 1] +> default)))) := rfl + rw [h_eq4] at h4 + have h5 := shift_DE_L1 p l ((0 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ 3) +> ((([0, 1] : List (Fin 2)) ^ (k + 1)) +> ([0, 0, 0, 1] +> default)))))) + have h_eq5 : ((1 : Fin 2) >> ((0 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ 3) +> ((([0, 1] : List (Fin 2)) ^ (k + 1)) +> ([0, 0, 0, 1] +> default))))))) = + ([1, 0] +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ 3) +> ((([0, 1] : List (Fin 2)) ^ (k + 1)) +> ([0, 0, 0, 1] +> default)))))) := rfl + rw [h_eq5, pow_succ_append_right' [1, 0] p] at h5 + exact stepStar_trans h1 (stepStar_trans h2 (stepStar_trans h3 (stepStar_trans h4 h5))) + +-- ============================================================================ +-- Section 3: Canonical Family K, Multi-Pair Sweeps, 9 Macro Rules & Base Stem +-- ============================================================================ + +abbrev Tri := Nat × Nat × Bool + +def sd (d : Bool) : List (Fin 2) := if d then [0, 0, 0, 1] else [0, 0, 1, 0] + +def RP : List Tri → ListBlank (Fin 2) → ListBlank (Fin 2) + | [], r => r + | (p, q, d) :: P', r => + ((([1, 0] : List (Fin 2)) ^ p) +> ((([0, 1] : List (Fin 2)) ^ q) +> (sd d +> RP P' r))) + +inductive Tl where + | TN + | TA (t : Nat) + | TB (k : Nat) + +open Tl + +def RT : Tl → ListBlank (Fin 2) + | TN => default + | TA t => ((([1, 0] : List (Fin 2)) ^ t) +> ([1] +> default)) + | TB k => ([1, 0, 1, 1, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> default)) + +def K (h : Nat) (P : List Tri) (T : Tl) : Cfg (Fin 2) (Fin 6) := + default <{{A}} ((([1, 0] : List (Fin 2)) ^ h) +> ([1, 1, 0, 0, 1] +> RP P (RT T))) + +def pre (h : Nat) : ListBlank (Fin 2) := + (default <+ (([0, 1] : List (Fin 2)) ^ (4 + h))) <+ [1, 1, 1] + +def reg (p q : Nat) (l : ListBlank (Fin 2)) : ListBlank (Fin 2) := + ((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ (q - 1))) <+ [1, 1] + +def LP : List Tri → ListBlank (Fin 2) → ListBlank (Fin 2) + | [], l => l + | (p, q, _) :: Z', l => LP Z' (reg p q l) + +def OvR : List Tri → ListBlank (Fin 2) → ListBlank (Fin 2) + | [], r => r + | (p, q, _) :: Z', r => + ((([0, 1] : List (Fin 2)) ^ p) +> ([0, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ q) +> OvR Z' r))) + +def touch (x : Tri) : Tri := + match x with + | (p, q, d) => (p + 1, q - 1, !d) + +def okR (x : Tri) : Prop := x.2.2 = false ∧ 1 ≤ x.2.1 +def okL (x : Tri) : Prop := x.2.2 = false ∧ 2 ≤ x.2.1 +def okO (x : Tri) : Prop := 1 ≤ x.1 ∧ 1 ≤ x.2.1 + +theorem RP_app (Z W : List Tri) (r : ListBlank (Fin 2)) : + RP (Z ++ W) r = RP Z (RP W r) := by + induction Z with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + dsimp [RP] + rw [ih] + +theorem LP_app (Z W : List Tri) (l : ListBlank (Fin 2)) : + LP (Z ++ W) l = LP W (LP Z l) := by + induction Z generalizing l with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + dsimp [LP] + exact ih (reg p q l) + +theorem PassesR (Z : List Tri) (hZ : ∀ x ∈ Z, okR x) (l r : ListBlank (Fin 2)) : + ((l <+ [0]) {{B}}> RP Z r) [target_tm]⊢* ((LP Z l <+ [0]) {{B}}> r) := by + induction Z generalizing l r with + | nil => exact ⟨0, rfl⟩ + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + have hx := hZ (p, q, d) List.mem_cons_self + rcases hx with ⟨hd, hq⟩ + dsimp at hd hq + subst hd + cases q with + | zero => omega + | succ q => + simp only [RP, LP, sd] + have h1 := PassR l p q (RP Z r) + have h2 := ih (fun y hy => hZ y (List.mem_cons_of_mem _ hy)) (reg p (q + 1) l) r + simp only [reg] at h2 + exact stepStar_trans h1 h2 + +theorem PassesL (Z : List Tri) (hZ : ∀ x ∈ Z, okL x) (l r : ListBlank (Fin 2)) : + ((LP Z l <+ [0]) <{{D}} r) [target_tm]⊢* ((l <+ [0]) <{{D}} RP (Z.map touch) r) := by + induction Z generalizing l r with + | nil => exact ⟨0, rfl⟩ + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + have hx := hZ (p, q, d) List.mem_cons_self + rcases hx with ⟨hd, hq⟩ + dsimp at hd hq + subst hd + cases q with + | zero => omega + | succ q => + cases q with + | zero => omega + | succ q => + simp only [LP, RP, touch, sd] + have h1 := ih (fun y hy => hZ y (List.mem_cons_of_mem _ hy)) (reg p (q + 2) l) r + have h2 := PassL l p q (RP (Z.map touch) r) + simp only [reg] at h1 + exact stepStar_trans h1 h2 + +theorem OvPasses (Z : List Tri) (hZ : ∀ x ∈ Z, okO x) (l r : ListBlank (Fin 2)) : + (LP Z l <{{D}} r) [target_tm]⊢* (l <{{D}} OvR Z r) := by + induction Z generalizing l r with + | nil => exact ⟨0, rfl⟩ + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + have hx := hZ (p, q, d) List.mem_cons_self + rcases hx with ⟨hp, hq⟩ + dsimp at hp hq + cases p with + | zero => omega + | succ p => + cases q with + | zero => omega + | succ q => + simp only [LP, OvR] + have h1 := ih (fun y hy => hZ y (List.mem_cons_of_mem _ hy)) (reg (p + 1) (q + 1) l) r + have h2 := OvL l p q (OvR Z r) + simp only [reg] at h1 + exact stepStar_trans h1 h2 + +theorem okL_R (Z : List Tri) (hZ : ∀ x ∈ Z, okL x) : ∀ x ∈ Z, okR x := by + intro x hx + obtain ⟨h1, h2⟩ := hZ x hx + exact ⟨h1, by omega⟩ + +-- Macro Rules +theorem Dec (h : Nat) (Z : List Tri) (p q : Nat) (R : List Tri) (T : Tl) + (hZ : ∀ x ∈ Z, okL x) : + (K h (Z ++ (p, q + 2, true) :: R) T) [target_tm]⊢⁺ + (K (4 + h) (Z.map touch ++ (p + 1, q + 1, false) :: R) T) := by + unfold K + rw [RP_app, RP_app] + dsimp [RP, sd] + exact stepPlus_stepStar_stepPlus (Start h _) + (stepStar_trans (PassesR Z (okL_R Z hZ) (pre h) _) + (stepStar_trans (Borrow _ p q _) + (stepStar_trans (PassesL Z hZ (pre h) _) + (EndPh h _)))) + +theorem DecMerge (h : Nat) (Z : List Tri) (p p' q' : Nat) (d' : Bool) (R : List Tri) (T : Tl) + (hZ : ∀ x ∈ Z, okL x) : + (K h (Z ++ (p, 1, true) :: (p', q', d') :: R) T) [target_tm]⊢⁺ + (K (4 + h) (Z.map touch ++ (p + p' + 3, q', d') :: R) T) := by + unfold K + rw [RP_app, RP_app] + dsimp [RP, sd] + exact stepPlus_stepStar_stepPlus (Start h _) + (stepStar_trans (PassesR Z (okL_R Z hZ) (pre h) _) + (stepStar_trans (MergeB _ p p' _) + (stepStar_trans (PassesL Z hZ (pre h) _) + (EndPh h _)))) + +theorem DecMergeTail (h : Nat) (Z : List Tri) (p t : Nat) (hZ : ∀ x ∈ Z, okL x) : + (K h (Z ++ [(p, 1, true)]) (TA t)) [target_tm]⊢⁺ + (K (4 + h) (Z.map touch) (TA (p + t + 3))) := by + unfold K + rw [RP_app] + dsimp [RP, sd, RT] + exact stepPlus_stepStar_stepPlus (Start h _) + (stepStar_trans (PassesR Z (okL_R Z hZ) (pre h) _) + (stepStar_trans (MergeB _ p t _) + (stepStar_trans (PassesL Z hZ (pre h) _) + (EndPh h _)))) + +theorem DecMergeEmpty (h : Nat) (Z : List Tri) (p : Nat) (hZ : ∀ x ∈ Z, okL x) : + (K h (Z ++ [(p, 1, true)]) TN) [target_tm]⊢⁺ + (K (4 + h) (Z.map touch) (TA (p + 2))) := by + unfold K + rw [RP_app] + dsimp [RP, sd, RT] + exact stepPlus_stepStar_stepPlus (Start h _) + (stepStar_trans (PassesR Z (okL_R Z hZ) (pre h) _) + (stepStar_trans (MergeE _ p) + (stepStar_trans (PassesL Z hZ (pre h) _) + (EndPh h _)))) + +theorem EndR (h : Nat) (Z : List Tri) (p q : Nat) (hZ : ∀ x ∈ Z, okL x) : + (K h (Z ++ [(p, q + 2, false)]) TN) [target_tm]⊢⁺ + (K (4 + h) (Z.map touch ++ [(p + 1, q + 1, false)]) (TA 1)) := by + unfold K + have hZ_snoc : ∀ x ∈ Z ++ [(p, q + 2, false)], okR x := by + intro x hx + rcases List.mem_append.mp hx with hxZ | hxp + · exact okL_R Z hZ x hxZ + · rcases List.mem_singleton.mp hxp with rfl + exact ⟨rfl, by dsimp; omega⟩ + have h1 := Start h (RP (Z ++ [(p, q + 2, false)]) (RT TN)) + have h2 := PassesR (Z ++ [(p, q + 2, false)]) hZ_snoc (pre h) (RT TN) + rw [LP_app] at h2 + simp only [LP, RT, reg] at h2 + have h3 := EndT (LP Z (pre h) <+ [0]) p q + have h4 := PassesL Z hZ (pre h) ((([1, 0] : List (Fin 2)) ^ (p + 1)) +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> ([1, 0, 1] +> default)))) + have h5 := EndPh h (RP (Z.map touch ++ [(p + 1, q + 1, false)]) (RT (TA 1))) + have h_rp : RP (Z.map touch ++ [(p + 1, q + 1, false)]) (RT (TA 1)) = + RP (Z.map touch) ((([1, 0] : List (Fin 2)) ^ (p + 1)) +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> ([1, 0, 1] +> default)))) := by + rw [RP_app]; rfl + rw [← h_rp] at h4 + exact stepPlus_stepStar_stepPlus h1 (stepStar_trans h2 (stepStar_trans h3 (stepStar_trans h4 h5))) + +theorem EndLast (h : Nat) (Z : List Tri) (p : Nat) (hZ : ∀ x ∈ Z, okL x) : + (K h (Z ++ [(p, 1, false)]) TN) [target_tm]⊢⁺ + (K (4 + h) (Z.map touch) (TA (p + 4))) := by + unfold K + have hZ_snoc : ∀ x ∈ Z ++ [(p, 1, false)], okR x := by + intro x hx + rcases List.mem_append.mp hx with hxZ | hxp + · exact okL_R Z hZ x hxZ + · rcases List.mem_singleton.mp hxp with rfl + exact ⟨rfl, by dsimp; omega⟩ + have h1 := Start h (RP (Z ++ [(p, 1, false)]) (RT TN)) + have h2 := PassesR (Z ++ [(p, 1, false)]) hZ_snoc (pre h) (RT TN) + rw [LP_app] at h2 + simp only [LP, RT, reg] at h2 + have h3 := EndLastT (LP Z (pre h) <+ [0]) p + have h4 := PassesL Z hZ (pre h) ((([1, 0] : List (Fin 2)) ^ (p + 4)) +> ([1] +> default)) + have h5 := EndPh h (RP (Z.map touch) (RT (TA (p + 4)))) + exact stepPlus_stepStar_stepPlus h1 (stepStar_trans h2 (stepStar_trans h3 (stepStar_trans h4 h5))) + +theorem X2 (h : Nat) (Z : List Tri) (p q k : Nat) (hZ : ∀ x ∈ Z, okL x) : + (K h (Z ++ [(p, q + 2, false)]) (TB (k + 1))) [target_tm]⊢⁺ + (K (4 + h) (Z.map touch ++ [(p + 1, q + 1, false), (3, k + 1, true)]) TN) := by + unfold K + have hZ_snoc : ∀ x ∈ Z ++ [(p, q + 2, false)], okR x := by + intro x hx + rcases List.mem_append.mp hx with hxZ | hxp + · exact okL_R Z hZ x hxZ + · rcases List.mem_singleton.mp hxp with rfl + exact ⟨rfl, by dsimp; omega⟩ + have h1 := Start h (RP (Z ++ [(p, q + 2, false)]) (RT (TB (k + 1)))) + have h2 := PassesR (Z ++ [(p, q + 2, false)]) hZ_snoc (pre h) (RT (TB (k + 1))) + rw [LP_app] at h2 + simp only [LP, RT, reg] at h2 + have h3 := X2T (LP Z (pre h) <+ [0]) p q k + have h4 := PassesL Z hZ (pre h) ((([1, 0] : List (Fin 2)) ^ (p + 1)) +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ 3) +> ((([0, 1] : List (Fin 2)) ^ (k + 1)) +> ([0, 0, 0, 1] +> default)))))) + have h5 := EndPh h (RP (Z.map touch ++ [(p + 1, q + 1, false), (3, k + 1, true)]) (RT TN)) + have h_rp : RP (Z.map touch ++ [(p + 1, q + 1, false), (3, k + 1, true)]) (RT TN) = + RP (Z.map touch) ((([1, 0] : List (Fin 2)) ^ (p + 1)) +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ 3) +> ((([0, 1] : List (Fin 2)) ^ (k + 1)) +> ([0, 0, 0, 1] +> default)))))) := by + rw [RP_app]; rfl + rw [← h_rp] at h4 + exact stepPlus_stepStar_stepPlus h1 (stepStar_trans h2 (stepStar_trans h3 (stepStar_trans h4 h5))) + +def ovp (q : Nat) : List Tri → Nat → List Tri + | [], t => [(q, t + 1, true)] + | (p', q', _) :: Z', t => (q, p', true) :: ovp q' Z' t + +theorem ovp_eq (Z : List Tri) (q t : Nat) : + RP (ovp q Z t) default = + ((([1, 0] : List (Fin 2)) ^ q) +> OvR Z ((([0, 1] : List (Fin 2)) ^ (t + 1)) +> ([0, 0, 0, 1] +> default))) := by + induction Z generalizing q t with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p', q', d⟩ + simp only [ovp, RP, OvR, sd] + rw [ih] + rfl + +theorem Ov (h p1 q1 : Nat) (Z : List Tri) (t : Nat) + (hq1 : 1 ≤ q1) (hR : ∀ x ∈ Z, okR x) (hO : ∀ x ∈ Z, okO x) : + (K h ((p1 + 2, q1, false) :: Z) (TA t)) [target_tm]⊢⁺ + (K 2 ((h + 5, p1 + 1, false) :: ovp q1 Z t) TN) := by + unfold K + have hR_all : ∀ x ∈ (p1 + 2, q1, false) :: Z, okR x := by + intro x hx + rcases List.mem_cons.mp hx with rfl | hxZ + · exact ⟨rfl, hq1⟩ + · exact hR x hxZ + have h1 := Start h (RP ((p1 + 2, q1, false) :: Z) (RT (TA t))) + have h2 := PassesR ((p1 + 2, q1, false) :: Z) hR_all (pre h) (RT (TA t)) + simp only [LP, RT] at h2 + have h3 := OvT (LP Z (reg (p1 + 2) q1 (pre h))) t + have h4 := OvPasses Z hO (reg (p1 + 2) q1 (pre h)) ((([0, 1] : List (Fin 2)) ^ (t + 1)) +> ([0, 0, 0, 1] +> default)) + cases q1 with + | zero => omega + | succ q1 => + simp only [reg] at h4 + have h5 := OvL (pre h) (p1 + 1) q1 (OvR Z ((([0, 1] : List (Fin 2)) ^ (t + 1)) +> ([0, 0, 0, 1] +> default))) + have h6 := OvEnd h p1 ((([1, 0] : List (Fin 2)) ^ (q1 + 1)) +> OvR Z ((([0, 1] : List (Fin 2)) ^ (t + 1)) +> ([0, 0, 0, 1] +> default))) + have h_end : RP ((h + 5, p1 + 1, false) :: ovp (q1 + 1) Z t) (RT TN) = + ((([1, 0] : List (Fin 2)) ^ (h + 5)) +> ((([0, 1] : List (Fin 2)) ^ (p1 + 1)) +> ([0, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ (q1 + 1)) +> OvR Z ((([0, 1] : List (Fin 2)) ^ (t + 1)) +> ([0, 0, 0, 1] +> default)))))) := by + simp only [RP, sd, RT] + rw [ovp_eq] + rfl + rw [← h_end] at h6 + exact stepPlus_stepStar_stepPlus h1 (stepStar_trans h2 (stepStar_trans h3 (stepStar_trans h4 (stepStar_trans h5 h6)))) + +def ovpX (q : Nat) : List Tri → Nat → List Tri + | [], pa => [(q, pa, false)] + | (p', q', _) :: Z', pa => (q, p', true) :: ovpX q' Z' pa + +theorem ovpX_eq (Z : List Tri) (q pa : Nat) (r : ListBlank (Fin 2)) : + RP (ovpX q Z pa) r = + ((([1, 0] : List (Fin 2)) ^ q) +> OvR Z ((([0, 1] : List (Fin 2)) ^ pa) +> ([0, 0, 1, 0] +> r))) := by + induction Z generalizing q pa r with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p', q', d⟩ + simp only [ovpX, RP, OvR, sd] + rw [ih] + rfl + +theorem tailB_eq (n : Nat) : + ([0, 0, 1, 0, 1, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (n + 1)) +> ([1] +> default))) = + ([0, 0, 1, 0] +> RT (TB n)) := by + unfold RT + rw [pow_succ_append_right] + have h_def : ([1] +> (default : ListBlank (Fin 2))) = (1 : Fin 2) >> ((0 : Fin 2) >> default) := by + simp [ListBlank.append] + rw [h_def, pow_10_cons_one n ((0 : Fin 2) >> default), zero_cons_default] + rfl + +theorem X1 (h p1 q1 : Nat) (Z : List Tri) (pa pb : Nat) + (hq1 : 1 ≤ q1) (hR : ∀ x ∈ Z, okR x) (hO : ∀ x ∈ Z, okO x) : + (K h ((p1 + 2, q1, false) :: Z ++ [(pa + 1, 1, false), (pb, 1, false)]) TN) [target_tm]⊢⁺ + (K 2 ((h + 5, p1 + 1, false) :: ovpX q1 Z (pa + 1)) (TB (pb + 3))) := by + unfold K + have hR_all : ∀ x ∈ (p1 + 2, q1, false) :: Z ++ [(pa + 1, 1, false), (pb, 1, false)], okR x := by + intro x hx + rcases List.mem_cons.mp hx with rfl | hx_tail + · exact ⟨rfl, hq1⟩ + · rcases List.mem_append.mp hx_tail with hxZ | hx2 + · exact hR x hxZ + · rcases List.mem_cons.mp hx2 with rfl | hx1 + · exact ⟨rfl, by dsimp; omega⟩ + · rcases List.mem_singleton.mp hx1 with rfl + exact ⟨rfl, by dsimp; omega⟩ + have h1 := Start h (RP ((p1 + 2, q1, false) :: Z ++ [(pa + 1, 1, false), (pb, 1, false)]) (RT TN)) + have h2 := PassesR ((p1 + 2, q1, false) :: Z ++ [(pa + 1, 1, false), (pb, 1, false)]) hR_all (pre h) (RT TN) + rw [LP_app] at h2 + simp only [LP, RT, reg] at h2 + have h3 := EndLastT ((((((LP Z (reg (p1 + 2) q1 (pre h)) <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ (pa + 1))) <+ [0, 1, 1]) <+ [1, 1]) <+ [0])) pb + have h4 := X1Sw (LP Z (reg (p1 + 2) q1 (pre h))) pa ((([1, 0] : List (Fin 2)) ^ (pb + 4)) +> ([1] +> default)) + have h5 := OvPasses Z hO (reg (p1 + 2) q1 (pre h)) ((([0, 1] : List (Fin 2)) ^ (pa + 1)) +> ([0, 0, 1, 0, 1, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (pb + 4)) +> ([1] +> default)))) + cases q1 with + | zero => omega + | succ q1 => + simp only [reg] at h5 + have h6 := OvL (pre h) (p1 + 1) q1 (OvR Z ((([0, 1] : List (Fin 2)) ^ (pa + 1)) +> ([0, 0, 1, 0, 1, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (pb + 4)) +> ([1] +> default))))) + have h7 := OvEnd h p1 ((([1, 0] : List (Fin 2)) ^ (q1 + 1)) +> OvR Z ((([0, 1] : List (Fin 2)) ^ (pa + 1)) +> ([0, 0, 1, 0, 1, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (pb + 4)) +> ([1] +> default))))) + have h_end : RP ((h + 5, p1 + 1, false) :: ovpX (q1 + 1) Z (pa + 1)) (RT (TB (pb + 3))) = + ((([1, 0] : List (Fin 2)) ^ (h + 5)) +> ((([0, 1] : List (Fin 2)) ^ (p1 + 1)) +> ([0, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ (q1 + 1)) +> OvR Z ((([0, 1] : List (Fin 2)) ^ (pa + 1)) +> ([0, 0, 1, 0, 1, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (pb + 4)) +> ([1] +> default)))))))) := by + simp only [RP, sd] + have h_pb : pb + 4 = (pb + 3) + 1 := by omega + rw [h_pb, tailB_eq (pb + 3), ovpX_eq] + rfl + rw [← h_end] at h7 + exact stepPlus_stepStar_stepPlus h1 (stepStar_trans h2 (stepStar_trans h3 (stepStar_trans h4 (stepStar_trans h5 (stepStar_trans h6 h7))))) + +theorem OvEmpty (h t : Nat) : + (K h [] (TA (t + 1))) [target_tm]⊢⁺ (K 2 [(h + 5, t + 1, false)] TN) := by + unfold K + dsimp [RP, sd, RT] + have h1 := Start h ((([1, 0] : List (Fin 2)) ^ (t + 1)) +> ([1] +> default)) + have h2 := OvT (pre h) (t + 1) + have h3 := OvEnd h t default + exact stepPlus_stepStar_stepPlus h1 (stepStar_trans h2 h3) + +-- Stem from init [] to K 2 [(47, 32, false), (16, 15, true), (4, 20, true)] TN +theorem init_to_step275 : + (init []) [target_tm]⊢* (K 2 [(7, 1, false)] TN) := by + have h1 : (init []) [target_tm]⊢* (K 0 [] TN) := by + rw [init_nil]; unfold K; dsimp [RP, RT, ListBlank.append]; execute + have h2 : (K 0 [] TN) [target_tm]⊢* ((((default <+ (([0, 1] : List (Fin 2)) ^ 4)) <+ [1, 1, 1]) <+ [0]) {{B}}> default) := + stepPlus_stepStar (Start 0 default) + have h3 : ((((default <+ (([0, 1] : List (Fin 2)) ^ 4)) <+ [1, 1, 1]) <+ [0]) {{B}}> default) [target_tm]⊢* + (default <{{A}} ((([1, 0] : List (Fin 2)) ^ 4) +> ([1, 1] +> ((([0, 1] : List (Fin 2)) ^ 3) +> default)))) := by + dsimp [ListBlank.append]; execute + have h4 := stepPlus_stepStar (round_A_10_cap11 4 ((([0, 1] : List (Fin 2)) ^ 3) +> default)) + have h5 : (default <{{A}} ((([1, 0] : List (Fin 2)) ^ 6) +> ((([0, 1] : List (Fin 2)) ^ 3) +> default))) [target_tm]⊢* + ((default <+ [1]) {{B}}> ((([1, 0] : List (Fin 2)) ^ 6) +> ((([0, 1] : List (Fin 2)) ^ 3) +> default))) := by + dsimp [ListBlank.append]; execute + have h6 := shift_BA_R 6 (default <+ [1]) ((([0, 1] : List (Fin 2)) ^ 3) +> default) + have h7 : (((default <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ 6)) {{B}}> ((([0, 1] : List (Fin 2)) ^ 3) +> default)) [target_tm]⊢* + (((default <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ 6)) <{{D}} ((1 : Fin 2) >> ((0 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ 2) +> ([0, 0, 0, 1] +> default))))) := by + dsimp [ListBlank.append]; execute + have h8 := shift_DE_L1 6 (default <+ [1]) ((0 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ 2) +> ([0, 0, 0, 1] +> default))) + have h_eq8 : ((1 : Fin 2) >> ((0 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ 2) +> ([0, 0, 0, 1] +> default)))) = + ([1, 0] +> ((([0, 1] : List (Fin 2)) ^ 2) +> ([0, 0, 0, 1] +> default))) := rfl + rw [h_eq8, pow_succ_append_right' [1, 0] 6] at h8 + have h9 := OvEnd_tail 2 0 default + exact stepStar_trans h1 (stepStar_trans h2 (stepStar_trans h3 (stepStar_trans h4 + (stepStar_trans h5 (stepStar_trans h6 (stepStar_trans h7 (stepStar_trans h8 h9))))))) + +theorem init_to_K0 : + (init []) [target_tm]⊢* (K 2 [(11, 11, false)] TN) := by + have h1 := init_to_step275 + have h2 := stepPlus_stepStar (EndLast 2 [] 7 (by intro x hx; nomatch hx)) + have h3 := stepPlus_stepStar (OvEmpty 6 10) + exact stepStar_trans h1 (stepStar_trans h2 h3) + +theorem okL_nil : ∀ x ∈ ([] : List Tri), okL x := by intro x hx; nomatch hx +theorem okR_nil : ∀ x ∈ ([] : List Tri), okR x := by intro x hx; nomatch hx +theorem okO_nil : ∀ x ∈ ([] : List Tri), okO x := by intro x hx; nomatch hx + +theorem okL_cons {p q : Nat} {Z : List Tri} (hq : 2 ≤ q) (hZ : ∀ x ∈ Z, okL x) : + ∀ x ∈ (p, q, false) :: Z, okL x := by + intro x hx + rcases List.mem_cons.mp hx with rfl | hxZ + · exact ⟨rfl, hq⟩ + · exact hZ x hxZ + +theorem okR_cons {p q : Nat} {Z : List Tri} (hq : 1 ≤ q) (hZ : ∀ x ∈ Z, okR x) : + ∀ x ∈ (p, q, false) :: Z, okR x := by + intro x hx + rcases List.mem_cons.mp hx with rfl | hxZ + · exact ⟨rfl, hq⟩ + · exact hZ x hxZ + +theorem okO_cons {p q : Nat} {d : Bool} {Z : List Tri} (hp : 1 ≤ p) (hq : 1 ≤ q) (hZ : ∀ x ∈ Z, okO x) : + ∀ x ∈ (p, q, d) :: Z, okO x := by + intro x hx + rcases List.mem_cons.mp hx with rfl | hxZ + · exact ⟨hp, hq⟩ + · exact hZ x hxZ + +def base23 : List Tri := [(47, 32, false), (16, 15, true), (4, 20, true)] + +theorem init_to_base23 : + (init []) [target_tm]⊢* (K 2 base23 TN) := by + have s0 := init_to_K0 + have s1 := stepPlus_stepStar (EndR 2 [] 11 9 okL_nil) + have s2 := stepPlus_stepStar (Ov 6 10 10 [] 1 (by omega) okR_nil okO_nil) + have s3 := stepPlus_stepStar (Dec 2 [(11, 11, false)] 10 0 [] TN (okL_cons (by omega) okL_nil)) + have s4 := stepPlus_stepStar (Dec 6 [] 12 8 [(11, 1, false)] TN okL_nil) + have s5 := stepPlus_stepStar (EndLast 10 [(13, 9, false)] 11 (okL_cons (by omega) okL_nil)) + have s6 := stepPlus_stepStar (Dec 14 [] 14 6 [] (TA 15) okL_nil) + have s7 := stepPlus_stepStar (Ov 18 13 7 [] 15 (by omega) okR_nil okO_nil) + have s8 := stepPlus_stepStar (Dec 2 [(23, 14, false)] 7 14 [] TN (okL_cons (by omega) okL_nil)) + have s9 := stepPlus_stepStar (Dec 6 [] 24 11 [(8, 15, false)] TN okL_nil) + have s10 := stepPlus_stepStar (EndR 10 [(25, 12, false)] 8 13 (okL_cons (by omega) okL_nil)) + have s11 := stepPlus_stepStar (Dec 14 [] 26 9 [(9, 14, false)] (TA 1) okL_nil) + have s12 := stepPlus_stepStar (Ov 18 25 10 [(9, 14, false)] 1 (by omega) + (okR_cons (by omega) okR_nil) (okO_cons (by omega) (by omega) okO_nil)) + have s13 := stepPlus_stepStar (Dec 2 [(23, 26, false)] 10 7 [(14, 2, true)] TN (okL_cons (by omega) okL_nil)) + have s14 := stepPlus_stepStar (Dec 6 [] 24 23 [(11, 8, false), (14, 2, true)] TN okL_nil) + have s15 := stepPlus_stepStar (Dec 10 [(25, 24, false), (11, 8, false)] 14 0 [] TN + (okL_cons (by omega) (okL_cons (by omega) okL_nil))) + have s16 := stepPlus_stepStar (Dec 14 [] 26 21 [(12, 7, true), (15, 1, false)] TN okL_nil) + have s17 := stepPlus_stepStar (Dec 18 [(27, 22, false)] 12 5 [(15, 1, false)] TN (okL_cons (by omega) okL_nil)) + have s18 := stepPlus_stepStar (Dec 22 [] 28 19 [(13, 6, false), (15, 1, false)] TN okL_nil) + have s19 := stepPlus_stepStar (EndLast 26 [(29, 20, false), (13, 6, false)] 15 + (okL_cons (by omega) (okL_cons (by omega) okL_nil))) + have s20 := stepPlus_stepStar (Dec 30 [] 30 17 [(14, 5, true)] (TA 19) okL_nil) + have s21 := stepPlus_stepStar (Dec 34 [(31, 18, false)] 14 3 [(14, 5, true)].tail (TA 19) (okL_cons (by omega) okL_nil)) + have s22 := stepPlus_stepStar (Dec 38 [] 32 15 [(15, 4, false)] (TA 19) okL_nil) + have s23 := stepPlus_stepStar (Ov 42 31 16 [(15, 4, false)] 19 (by omega) + (okR_cons (by omega) okR_nil) (okO_cons (by omega) (by omega) okO_nil)) + exact stepStar_trans s0 (stepStar_trans s1 (stepStar_trans s2 (stepStar_trans s3 + (stepStar_trans s4 (stepStar_trans s5 (stepStar_trans s6 (stepStar_trans s7 + (stepStar_trans s8 (stepStar_trans s9 (stepStar_trans s10 (stepStar_trans s11 + (stepStar_trans s12 (stepStar_trans s13 (stepStar_trans s14 (stepStar_trans s15 + (stepStar_trans s16 (stepStar_trans s17 (stepStar_trans s18 (stepStar_trans s19 + (stepStar_trans s20 (stepStar_trans s21 (stepStar_trans s22 s23)))))))))))))))))))))) + +-- ============================================================================ +-- Section 4: Closed Invariant J, Per-Pair Arithmetic Lemmas & Jstep +-- ============================================================================ + +def bv (d : Bool) : Nat := if d then 1 else 0 + +def dv : List Tri → Nat + | [] => 0 + | (_, _, d) :: P' => bv d + 2 * dv P' + +def dig (x : Tri) : Bool := x.2.2 +def dig0 (x : Tri) : Prop := x.2.2 = false + +theorem pow_pos (n : Nat) : 1 ≤ 2 ^ n := Nat.one_le_two_pow + +theorem pow_S (n : Nat) : 2 ^ (n + 1) = 2 * 2 ^ n := by + rw [Nat.pow_succ]; omega + +theorem dv_lt (P : List Tri) : dv P < 2 ^ P.length := by + induction P with + | nil => simp [dv] + | cons x P ih => + rcases x with ⟨p, q, d⟩ + dsimp [dv] + rw [pow_S] + cases d <;> dsimp [bv] <;> omega + +theorem dv_zeros (Z R : List Tri) (hZ : ∀ x ∈ Z, dig0 x) : + dv (Z ++ R) = 2 ^ Z.length * dv R := by + induction Z with + | nil => simp [dv]; try omega + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + have hd : d = false := hZ (p, q, d) List.mem_cons_self + subst hd + dsimp [dv, bv] + rw [ih (fun y hy => hZ y (List.mem_cons_of_mem _ hy)), pow_S] + ring + +theorem dv_tz (Z R : List Tri) (hZ : ∀ x ∈ Z, dig0 x) : + dv (Z.map touch ++ R) + 1 = 2 ^ Z.length + 2 ^ Z.length * dv R := by + induction Z with + | nil => simp [dv]; omega + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + have hd : d = false := hZ (p, q, d) List.mem_cons_self + subst hd + simp [dv, touch, bv] + have ih' := ih (fun y hy => hZ y (List.mem_cons_of_mem _ hy)) + rw [pow_S, Nat.mul_assoc] + omega + +theorem dv_zero (Z : List Tri) (hZ : ∀ x ∈ Z, dig0 x) : dv Z = 0 := by + have h := dv_zeros Z [] hZ + rw [List.append_nil] at h + dsimp [dv] at h + omega + +theorem dv_tz' (Z R : List Tri) (hZ : ∀ x ∈ Z, dig0 x) : + dv (Z.map touch ++ R) = 2 ^ Z.length - 1 + 2 ^ Z.length * dv R := by + have h := dv_tz Z R hZ + have hpos := pow_pos Z.length + omega + +def AllI (Pr : Nat → Tri → List Tri → Prop) (i : Nat) : List Tri → Prop + | [] => True + | x :: Y => Pr i x Y ∧ AllI Pr (i + 1) Y + +theorem AllI_app (Pr : Nat → Tri → List Tri → Prop) (Z : List Tri) (i : Nat) (R : List Tri) + (h : AllI Pr i (Z ++ R)) : AllI Pr (i + Z.length) R := by + induction Z generalizing i with + | nil => simpa using! h + | cons x Z ih => + dsimp [AllI] at h + have h_eq : i + (Z.length + 1) = (i + 1) + Z.length := by omega + rw [List.length_cons, h_eq] + exact ih (i + 1) h.2 + +theorem AllI_mono (Pr Pr' : Nat → Tri → List Tri → Prop) (P : List Tri) (i : Nat) + (hm : ∀ j x Y, i ≤ j → Pr j x Y → Pr' j x Y) (h : AllI Pr i P) : + AllI Pr' i P := by + induction P generalizing i with + | nil => exact trivial + | cons x P ih => + dsimp [AllI] at h ⊢ + exact ⟨hm i x P (by omega) h.1, ih (i + 1) (fun j y Y hj => hm j y Y (by omega)) h.2⟩ + +theorem AllI_shift (Pr Pr' : Nat → Tri → List Tri → Prop) (P : List Tri) (i : Nat) + (hm : ∀ j x Y, i ≤ j → Pr (j + 1) x Y → Pr' j x Y) (h : AllI Pr (i + 1) P) : + AllI Pr' i P := by + induction P generalizing i with + | nil => exact trivial + | cons x P ih => + dsimp [AllI] at h ⊢ + exact ⟨hm i x P (by omega) h.1, ih (i + 1) (fun j y Y hj => hm j y Y (by omega)) h.2⟩ + +theorem AllI_touchZ (Pr Pr' : Nat → Tri → List Tri → Prop) (R R' Z : List Tri) (i : Nat) + (hZ : ∀ x ∈ Z, dig0 x) + (hob : ∀ j p q Zr, (∀ x ∈ Zr, dig0 x) → j + (Zr.length + 1) = i + Z.length → + Pr j (p, q, false) (Zr ++ R) → Pr' j (p + 1, q - 1, true) (Zr.map touch ++ R')) + (hA : AllI Pr i (Z ++ R)) + (hR : AllI Pr' (i + Z.length) R') : + AllI Pr' i (Z.map touch ++ R') := by + induction Z generalizing i with + | nil => simpa using! hR + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + have hd : d = false := hZ (p, q, d) List.mem_cons_self + subst hd + have hZ' : ∀ y ∈ Z, dig0 y := fun y hy => hZ y (List.mem_cons_of_mem _ hy) + dsimp [AllI, touch] at hA ⊢ + refine ⟨hob i p q Z hZ' rfl hA.1, ?_⟩ + apply ih (i + 1) hZ' + · intro j p' q' Zr hZr hj + exact hob j p' q' Zr hZr (by dsimp; omega) + · exact hA.2 + · have h_eq : (i + 1) + Z.length = i + (Z.length + 1) := by omega + rw [h_eq] + exact hR + +inductive Phase where + | E1 | E2 | E1t | E2t | T0 | L1 | L2 | LX + deriving DecidableEq + +open Phase + +def PN (ph : Phase) (c4 : Bool) (p q n tv : Nat) : Prop := + match ph with + | E1 => + match n with + | 0 => tv + 2 ^ n + 1 ≤ q ∧ 3 ≤ p + tv + 2 ^ n + | _ + 1 => tv + 3 * 2 ^ n + 1 ≤ q ∧ (p + tv) % 2 = 1 ∧ 3 * 2 ^ n ≤ p + tv + 2 ^ n + | E2 => + match n with + | 0 => tv + 1 ≤ q ∧ 3 ≤ p + tv + | _ + 1 => tv + 2 * 2 ^ n + 1 ≤ q ∧ (p + tv) % 2 = 1 ∧ 3 * 2 ^ n ≤ p + tv + | E1t => + match n with + | 0 => tv + 2 ^ n + 1 ≤ q ∧ p + tv + 2 ^ n = 5 + | _ + 1 => tv + 2 * 2 ^ n + 1 ≤ q ∧ (p + tv) % 2 = 1 ∧ 3 * 2 ^ n ≤ p + tv + 2 ^ n + | E2t => + match n with + | 0 => tv + 1 ≤ q ∧ p + tv = 5 + | _ + 1 => tv + 2 ^ n + 1 ≤ q ∧ (p + tv) % 2 = 1 ∧ 3 * 2 ^ n ≤ p + tv + | T0 => + tv + 7 * 2 ^ n + 1 ≤ q ∧ 6 * 2 ^ n ≤ p + tv + 5 * 2 ^ n ∧ + match n with + | 0 => tv = 0 ∧ p % 2 = 0 + | _ + 1 => (p + tv) % 2 = 1 + | L1 => + tv + 2 ≤ q + 2 ^ n ∧ + match n with + | 0 => q = tv + 2 ^ n + | 1 => (if c4 then 4 else 5) * 2 ^ n ≤ p + tv + 2 ^ n ∧ + (tv + 2 ^ n + 1 ≤ q ∨ (q + tv) % 2 = 0) ∧ (if c4 then q = tv + 2 ^ n else True) + | _ + 2 => (if c4 then 4 else 5) * 2 ^ n ≤ p + tv + 2 ^ n ∧ (q + tv) % 2 = 0 + | LX => + match n with + | 0 => q = tv + 1 + | 1 => 4 * 2 ^ n ≤ p + tv ∧ q = tv + 1 + | _ + 2 => 4 * 2 ^ n ≤ p + tv ∧ (q + tv) % 2 = 0 + | L2 => + (if c4 then 4 else 5) * (2 * 2 ^ n) ≤ p + tv ∧ + match n with + | 0 => (tv + 1 ≤ q ∨ (q + tv) % 2 = 0) ∧ (if c4 then q = tv else True) + | _ + 1 => (q + tv) % 2 = 0 + +def PI (ph : Phase) (h i p q n tv : Nat) : Prop := + match i with + | 1 => + h % 2 = 0 ∧ + match ph with + | E1 | E1t => 2 ≤ n ∧ 11 * 2 ^ n ≤ p + tv + 2 ^ n + 3 ∧ 12 * 2 ^ n ≤ h + 4 * (tv + 2 ^ n) + 6 + | E2 | E2t => 2 ≤ n ∧ 11 * 2 ^ n ≤ p + tv + 3 ∧ 12 * 2 ^ n ≤ h + 4 * tv + 6 + | T0 => 2 ≤ n ∧ 22 * 2 ^ n ≤ p + tv + 5 * 2 ^ n + 3 ∧ 24 * 2 ^ n ≤ h + 4 * (tv + 5 * 2 ^ n) + 6 + | L1 => 2 ≤ n ∧ tv + 3 * 2 ^ n ≤ q ∧ 8 * 2 ^ n ≤ h + 4 * (tv + 2 ^ n) + 6 + | LX => 3 ≤ n ∧ tv + 2 * 2 ^ n ≤ q ∧ 8 * 2 ^ n ≤ h + 4 * tv + 6 + | L2 => 1 ≤ n ∧ tv + 4 * 2 ^ n ≤ q ∧ 16 * 2 ^ n ≤ h + 4 * tv + 6 + | 2 => + match ph with + | E1 | E1t => 7 * 2 ^ n ≤ p + tv + 2 ^ n + 1 + | E2 | E2t => 7 * 2 ^ n ≤ p + tv + 1 + | T0 => 14 * 2 ^ n ≤ p + tv + 5 * 2 ^ n + 1 + | L1 => tv + 2 ^ n + 1 ≤ q + | LX | L2 => tv + 1 ≤ q + | _ => True + +def PC (ph : Phase) (c4 : Bool) (h i p q n tv : Nat) : Prop := + 1 ≤ p ∧ 1 ≤ q ∧ PN ph c4 p q n tv ∧ PI ph h i p q n tv + +def Lift (Pr : Nat → Nat → Nat → Nat → Nat → Prop) (i : Nat) (x : Tri) (Y : List Tri) : Prop := + Pr i x.1 x.2.1 Y.length (dv (x :: Y)) + +def PCx (ph : Phase) (c4 : Bool) (h : Nat) := Lift (PC ph c4 h) + +local macro "split_and" : tactic => + `(tactic| repeat' (refine And.intro ?_ ?_)) + +local macro "cr" : tactic => + `(tactic| (simp -failIfUnchanged only [PN, PI, pow_S, Nat.pow_zero, Bool.false_eq_true, ite_true, ite_false] at *; split_and <;> first | trivial | omega)) + +theorem ob_touch (ph : Phase) (c4 : Bool) (h i p q n tv : Nat) + (ht : 1 ≤ tv) (hq : 2 ≤ q) (hpc : PC ph c4 h i p q n tv) : + PC ph c4 (4 + h) i (p + 1) (q - 1) n (tv - 1) := by + rcases hpc with ⟨hp, hq0, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases n with _ | _ | n <;> [skip; skip; have := pow_pos n] <;> + cases ph <;> cases c4 <;> cr + · have := pow_pos n + rcases i with _ | _ | _ | i <;> try trivial + · cases ph <;> cr + · cases ph <;> cr + +theorem ob_merge (ph : Phase) (c4 : Bool) (h i p q n u U : Nat) + (hph : ph = L1 ∨ ph = L2 ∨ ph = LX) + (hn : 1 ≤ n) (hu : 2 ≤ u) (hu2 : u % 2 = 0) (hU2 : U % 2 = 0) (hUu : U + u ≤ 2 * 2 ^ n) + (hL1 : ph = L1 → U + u ≤ 2 ^ n) (hLX : ph = LX → 2 ≤ n) (hc4 : ph = L1 → c4 = true → 2 ≤ n) + (hi1 : i = 1 → 2 ≤ n) (hiX : ph = LX → i = 1 → 3 ≤ n) (hq : 2 ≤ q) + (hpc : PC ph c4 h i p q (n + 1) (u + 2 * U)) : + PC ph c4 (4 + h) i (p + 1) (q - 1) n (u - 1 + U) := by + rcases hpc with ⟨hp, hq0, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases n with _ | _ | n <;> [omega; skip; have := pow_pos n] <;> + rcases hph with rfl | rfl | rfl <;> cases c4 <;> + (try have := hL1 rfl) <;> (try have := hLX rfl) <;> (try have := hc4 rfl rfl) <;> cr + · have := pow_pos n + rcases i with _ | _ | _ | i <;> try trivial + · rcases hph with rfl | rfl | rfl <;> + (try have := hL1 rfl) <;> (try have := hi1 rfl) <;> (try have := hiX rfl rfl) <;> cr + · rcases hph with rfl | rfl | rfl <;> cr + +theorem ob_mt (c4 : Bool) (h i p q n : Nat) (hq : 2 ≤ q) (hi1 : i = 1 → 1 ≤ n) + (hpc : PC L2 c4 h i p q (n + 1) (2 * 2 ^ n)) : + PC L2 false (4 + h) i (p + 1) (q - 1) n (2 * 2 ^ n - 1) := by + rcases hpc with ⟨hp, hq0, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases n with _ | n <;> [skip; have := pow_pos n] <;> cases c4 <;> cr + · have := pow_pos n + rcases i with _ | _ | _ | i <;> (try have := hi1 rfl) <;> first | trivial | cr + +theorem ob_fuse (ph : Phase) (c4 : Bool) (h h' k p p' q' n tv : Nat) + (hph : ph = L1 ∨ ph = L2 ∨ ph = LX) (hk : 3 ≤ k) + (hpc : PC ph c4 h (k + 1) p' q' n tv) : + PC ph c4 h' k (p + p' + 3) q' n tv := by + rcases hpc with ⟨hp, hq0, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases n with _ | _ | n <;> [skip; skip; have := pow_pos n] <;> + rcases hph with rfl | rfl | rfl <;> cases c4 <;> cr + · rcases k with _ | _ | _ | k <;> [omega; omega; omega; trivial] + +theorem ob_far (ph : Phase) (c4 : Bool) (h h' i j p q n tv : Nat) + (_hi : 3 ≤ i) (hj : 3 ≤ j) (hpc : PC ph c4 h i p q n tv) : + PC ph c4 h' j p q n tv := by + rcases hpc with ⟨hp, hq0, hN, _⟩ + refine ⟨hp, hq0, hN, ?_⟩ + rcases j with _ | _ | _ | j <;> [omega; omega; omega; trivial] + +def endtr (ph ph' : Phase) : Prop := (ph = E1 ∧ ph' = E2) ∨ (ph = E1t ∧ ph' = E2t) + +theorem ob_end (ph ph' : Phase) (h i p q n : Nat) + (hph : endtr ph ph') (hn : 1 ≤ n) (hq : 2 ≤ q) + (hpc : PC ph false h i p q n 0) : + PC ph' false (4 + h) i (p + 1) (q - 1) n (2 ^ n - 1) := by + rcases hpc with ⟨hp, hq0, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases n with _ | n + · omega + · have := pow_pos n; rcases hph with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ <;> cr + · have := pow_pos n + rcases i with _ | _ | _ | i <;> + first | trivial | (rcases hph with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ <;> cr) + +theorem ob_end_top (ph ph' : Phase) (h i p q : Nat) + (hph : endtr ph ph') (hi : 3 ≤ i) + (hpc : PC ph false h i p (q + 2) 0 0) : + PC ph' false (4 + h) i (p + 1) (q + 1) 0 0 := by + rcases hpc with ⟨hp, hq0, hN, _⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases hph with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ <;> cr + · rcases i with _ | _ | _ | i <;> [omega; omega; omega; trivial] + +theorem ob_endlast (c4 : Bool) (h i p q n : Nat) (hq : 2 ≤ q) + (hpc : PC L1 c4 h i p q (n + 1) 0) : + PC L2 c4 (4 + h) i (p + 1) (q - 1) n (2 * 2 ^ n - 1) := by + rcases hpc with ⟨hp, hq0, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases n with _ | n <;> [skip; have := pow_pos n] <;> cases c4 <;> cr + · have := pow_pos n + rcases i with _ | _ | _ | i <;> first | trivial | cr + +theorem ob_x2 (h i p q n : Nat) (hn : 1 ≤ n) (hq : 2 ≤ q) + (hpc : PC T0 false h i p q n 0) : + PC E1t false (4 + h) i (p + 1) (q - 1) (n + 1) (3 * 2 ^ n - 1) := by + rcases hpc with ⟨hp, hq0, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases n with _ | n + · omega + · have := pow_pos n; cr + · have := pow_pos n + rcases i with _ | _ | _ | i <;> first | trivial | cr + +theorem ob_x2_top (h i p q : Nat) (hi : 3 ≤ i) + (hpc : PC T0 false h i p (q + 2) 0 0) : + PC E1t false (4 + h) i (p + 1) (q + 1) 1 2 := by + rcases hpc with ⟨hp, hq0, hN, _⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · cr + · rcases i with _ | _ | _ | i <;> [omega; omega; omega; trivial] + +theorem ob_x2_new (h i k : Nat) (hi : 3 ≤ i) (hk : 3 ≤ k) : + PC E1t false h i 3 k 0 1 := by + refine ⟨by omega, by omega, ?_, ?_⟩ + · cr + · rcases i with _ | _ | _ | i <;> [omega; omega; omega; trivial] + +def ovtr (ph ph' : Phase) (c4' : Bool) (Xp : Nat → Prop) : Prop := + (ph = E2 ∧ ph' = L1 ∧ c4' = false ∧ Xp = (fun x => x ≠ 4)) ∨ + (ph = E2 ∧ ph' = LX ∧ c4' = false ∧ Xp = (fun x => x = 4)) ∨ + (ph = E2t ∧ ph' = L1 ∧ c4' = true ∧ Xp = (fun _ => True)) ∨ + (ph = L2 ∧ ph' = E1 ∧ c4' = false ∧ Xp = (fun _ => True)) + +theorem ob_ov_head (ph ph' : Phase) (c4' : Bool) (Xp : Nat → Prop) (h p1 q1 n : Nat) + (htr : ovtr ph ph' c4' Xp) + (hpc : PC ph false h 1 (p1 + 2) q1 n 0) : + PC ph' c4' 2 1 (h + 5) (p1 + 1) (n + 1) (2 * (2 * 2 ^ n) - 2) := by + rcases hpc with ⟨hp, hq0, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases n with _ | _ | n <;> [skip; skip; have := pow_pos n] <;> + rcases htr with ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, _⟩ <;> cr + · rcases n with _ | _ | n <;> [skip; skip; have := pow_pos n] <;> + rcases htr with ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, _⟩ <;> cr + +theorem ob_ov_step (ph ph' : Phase) (c4' : Bool) (Xp : Nat → Prop) (h i pp q p' q' m : Nat) + (htr : ovtr ph ph' c4' Xp) (hi : 1 ≤ i) + (hpc : PC ph false h i pp q (m + 1) 0) + (hpc' : PC ph false h (i + 1) p' q' m 0) + (hX : m = 0 → Xp p') : + PC ph' c4' 2 (i + 1) q p' (m + 1) (2 * (2 * 2 ^ m) - 1) := by + rcases hpc with ⟨hp, hq0, hN, hI⟩ + rcases hpc' with ⟨hp', hq0', hN', hI'⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases m with _ | _ | m <;> [skip; skip; have := pow_pos m] <;> + rcases htr with ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ <;> + (try have := hX rfl) <;> cr + · rcases i with _ | _ | i <;> [omega; skip; trivial] + rcases m with _ | _ | m <;> [skip; skip; have := pow_pos m] <;> + rcases htr with ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ <;> + (try have := hX rfl) <;> cr + +theorem ob_ov_base (ph ph' : Phase) (c4' : Bool) (Xp : Nat → Prop) (h i pp q t : Nat) + (htr : ovtr ph ph' c4' Xp) (hi : 1 ≤ i) + (ht1 : ph = L2 → 2 ≤ t) (ht2 : ph ≠ L2 → t = 1) + (hpc : PC ph false h i pp q 0 0) : + PC ph' c4' 2 (i + 1) q (t + 1) 0 1 := by + rcases hpc with ⟨hp, hq0, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases htr with ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ + · have := ht2 (by decide); cr + · have := ht2 (by decide); cr + · have := ht2 (by decide); cr + · have := ht1 rfl; cr + · rcases i with _ | _ | i <;> [omega; skip; trivial] + rcases htr with ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ + · have := ht2 (by decide); cr + · have := ht2 (by decide); cr + · have := ht2 (by decide); cr + · have := ht1 rfl; cr + +theorem ob_x1_head (h p1 q1 n : Nat) + (hpc : PC LX false h 1 (p1 + 2) q1 (n + 2) 0) : + PC T0 false 2 1 (h + 5) (p1 + 1) (n + 1) (2 * 2 ^ n - 2) := by + rcases hpc with ⟨hp, hq0, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases n with _ | _ | n <;> [skip; skip; have := pow_pos n] <;> cr + · rcases n with _ | _ | n <;> [skip; skip; have := pow_pos n] <;> cr + +theorem ob_x1_step (h i pp q p' q' m : Nat) (hi : 1 ≤ i) + (hpc : PC LX false h i pp q (m + 3) 0) + (hpc' : PC LX false h (i + 1) p' q' (m + 2) 0) : + PC T0 false 2 (i + 1) q p' (m + 1) (2 * 2 ^ m - 1) := by + rcases hpc with ⟨hp, hq0, hN, hI⟩ + rcases hpc' with ⟨hp', hq0', hN', hI'⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases m with _ | m <;> [skip; have := pow_pos m] <;> cr + · rcases i with _ | _ | i <;> [omega; skip; trivial] + rcases m with _ | m <;> [skip; have := pow_pos m] <;> cr + +theorem ob_x1_base (h i pp q pa : Nat) (hi : 1 ≤ i) + (hpc : PC LX false h i pp q 2 0) + (hpc' : PC LX false h (i + 1) (pa + 1) 1 1 0) : + PC T0 false 2 (i + 1) q (pa + 1) 0 0 := by + rcases hpc with ⟨hp, hq0, hN, hI⟩ + rcases hpc' with ⟨hp', hq0', hN', hI'⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · cr + · rcases i with _ | _ | i <;> [omega; cr; trivial] + +theorem passq (ph : Phase) (c4 : Bool) (h i p q n tv : Nat) + (hpc : PC ph c4 h i p q n tv) (ht : 2 ≤ tv) (ht2 : tv % 2 = 0) : 2 ≤ q := by + rcases hpc with ⟨hp, hq0, hN, _⟩ + rcases n with _ | _ | n <;> [skip; skip; have := pow_pos n] <;> + cases ph <;> cases c4 <;> simp -failIfUnchanged only [PN] at hN <;> + (try simp only [pow_S, Nat.pow_zero, Bool.false_eq_true, ite_true, ite_false] at hN) <;> omega + +theorem borrow1 (ph : Phase) (c4 : Bool) (h k p n tv : Nat) + (hk : 1 ≤ k) (ht : tv % 2 = 1) (hpc : PC ph c4 h k p 1 n tv) : + (ph = L1 ∨ ph = L2 ∨ ph = LX) ∧ 3 ≤ k ∧ + (ph = L1 → 1 ≤ n ∧ tv + 1 ≤ 2 ^ n ∧ (c4 = true → 2 ≤ n)) ∧ (ph = LX → 2 ≤ n) := by + rcases hpc with ⟨hp, hq0, hN, hI⟩ + have hph : ph = L1 ∨ ph = L2 ∨ ph = LX := by + cases ph <;> first + | exact Or.inl rfl + | exact Or.inr (Or.inl rfl) + | exact Or.inr (Or.inr rfl) + | (exfalso; rcases n with _ | n <;> [skip; have := pow_pos n] <;> + simp -failIfUnchanged only [PN] at hN <;> (try simp only [pow_S, Nat.pow_zero] at hN) <;> omega) + refine ⟨hph, ?_, ?_, ?_⟩ + · rcases k with _ | _ | _ | k <;> [omega; skip; skip; omega] <;> + (exfalso; have := pow_pos n; rcases hph with rfl | rfl | rfl <;> + simp -failIfUnchanged only [PI] at hI <;> omega) + · rintro rfl + rcases n with _ | _ | n <;> [skip; skip; have := pow_pos n] <;> + cases c4 <;> simp -failIfUnchanged only [PN] at hN <;> + (try simp only [pow_S, Nat.pow_zero, Bool.false_eq_true, ite_true, ite_false] at hN) <;> + (split_and <;> first | omega | (intro hc; nomatch hc)) + · rintro rfl + rcases n with _ | _ | n <;> [skip; skip; omega] <;> + simp -failIfUnchanged only [PN] at hN <;> (try simp only [pow_S, Nat.pow_zero] at hN) <;> omega + +theorem q2_V0 (ph : Phase) (c4 : Bool) (h i p q n : Nat) + (hpc : PC ph c4 h i p q n 0) (hn : 1 ≤ n) (hX : ph = LX → 2 ≤ n) : 2 ≤ q := by + rcases hpc with ⟨hp, hq0, hN, _⟩ + rcases n with _ | _ | n <;> [omega; skip; have := pow_pos n] <;> + cases ph <;> cases c4 <;> simp -failIfUnchanged only [PN] at hN <;> + simp -failIfUnchanged only [pow_S, Nat.pow_zero, Bool.false_eq_true, ite_true, ite_false] at hN <;> + (try have := hX rfl) <;> omega + +theorem p1_V0 (ph : Phase) (c4 : Bool) (h p q n : Nat) + (hpc : PC ph c4 h 1 p q n 0) (hph : ph = E2 ∨ ph = E2t ∨ ph = L2 ∨ ph = LX) : 2 ≤ p := by + rcases hpc with ⟨hp, hq0, hN, hI⟩ + rcases n with _ | _ | n <;> [skip; skip; have := pow_pos n] <;> + rcases hph with rfl | rfl | rfl | rfl <;> cases c4 <;> + simp -failIfUnchanged only [PN, PI] at hN hI <;> + simp -failIfUnchanged only [pow_S, Nat.pow_zero, Bool.false_eq_true, ite_true, ite_false] at hN hI <;> omega + +theorem L2_c4_V0 (h i p q : Nat) (hpc : PC L2 true h i p q 0 0) : False := by + rcases hpc with ⟨hp, hq0, hN, _⟩ + simp -failIfUnchanged only [PN] at hN + simp -failIfUnchanged only [ite_true] at hN + omega + +-- ============================================================================ +-- Section 4b: List-Level Preservation Lemmas, Invariant J, Jstep & J_base23 +-- ============================================================================ + +theorem ovp_len (q : Nat) (Z : List Tri) (t : Nat) : + (ovp q Z t).length = Z.length + 1 := by + induction Z generalizing q with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p', q', d⟩ + dsimp [ovp] + rw [ih q'] + +theorem ovp_dv (q : Nat) (Z : List Tri) (t : Nat) : + dv (ovp q Z t) + 1 = 2 ^ (Z.length + 1) := by + induction Z generalizing q with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p', q', d⟩ + dsimp [ovp, dv, bv] + have ih' := ih q' + rw [pow_S (Z.length + 1)] + omega + +theorem ovpX_len (q : Nat) (Z : List Tri) (pa : Nat) : + (ovpX q Z pa).length = Z.length + 1 := by + induction Z generalizing q with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p', q', d⟩ + dsimp [ovpX] + rw [ih q'] + +theorem ovpX_dv (q : Nat) (Z : List Tri) (pa : Nat) : + dv (ovpX q Z pa) + 1 = 2 ^ Z.length := by + induction Z generalizing q with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p', q', d⟩ + dsimp [ovpX, dv, bv] + have ih' := ih q' + rw [pow_S Z.length] + omega + +def lastOK (Xp : Nat → Prop) : List Tri → Prop + | [] => True + | [(p, _, _)] => Xp p + | _ :: Z' => lastOK Xp Z' + +theorem lastOK_cons (Xp : Nat → Prop) (p q : Nat) (d : Bool) (Z : List Tri) + (h : lastOK Xp ((p, q, d) :: Z)) : (Z = [] → Xp p) ∧ lastOK Xp Z := by + cases Z with + | nil => exact And.intro (fun _ => h) trivial + | cons z Z' => exact And.intro (fun h' => by nomatch h') h + +theorem lastOK_dec (Z : List Tri) : lastOK (fun x => x = 4) Z ∨ lastOK (fun x => x ≠ 4) Z := by + induction Z with + | nil => exact Or.inl trivial + | cons x Z' ih => + rcases x with ⟨p, q, d⟩ + cases Z' with + | nil => + dsimp [lastOK] + match decEq p 4 with + | isTrue h => exact Or.inl h + | isFalse h => exact Or.inr h + | cons z Z'' => exact ih + +theorem lastOK_True (Z : List Tri) : lastOK (fun _ => True) Z := by + induction Z with + | nil => exact trivial + | cons x Z' ih => + rcases x with ⟨p, q, d⟩ + cases Z' with + | nil => exact trivial + | cons z Z'' => exact ih + +theorem AllI_ovp (ph ph' : Phase) (c4' : Bool) (Xp : Nat → Prop) (h t : Nat) + (htr : ovtr ph ph' c4' Xp) (ht1 : ph = L2 → 2 ≤ t) (ht2 : ph ≠ L2 → t = 1) + (Z : List Tri) (i pp q : Nat) (hi : 1 ≤ i) + (hZ : ∀ x ∈ Z, dig0 x) (hX : lastOK Xp Z) + (hpc : PC ph false h i pp q Z.length 0) + (hA : AllI (PCx ph false h) (i + 1) Z) : + AllI (PCx ph' c4' 2) (i + 1) (ovp q Z t) := by + induction Z generalizing i pp q with + | nil => + dsimp [ovp, AllI] + refine ⟨?_, trivial⟩ + dsimp [PCx, Lift, dv, bv] + exact ob_ov_base ph ph' c4' Xp h i pp q t htr hi ht1 ht2 hpc + | cons x Z ih => + rcases x with ⟨p', q', d'⟩ + have hd' : d' = false := hZ (p', q', d') List.mem_cons_self + subst hd' + have hZ' : ∀ y ∈ Z, dig0 y := fun y hy => hZ y (List.mem_cons_of_mem _ hy) + rcases lastOK_cons Xp p' q' false Z hX with ⟨hX1, hX2⟩ + dsimp [AllI] at hA + rcases hA with ⟨hhead, htail⟩ + dsimp [PCx, Lift] at hhead + rw [dv_zero ((p', q', false) :: Z) hZ] at hhead + dsimp [ovp, AllI] + refine ⟨?_, ?_⟩ + · dsimp [PCx, Lift] + rw [ovp_len] + have h_dv : dv ((q, p', true) :: ovp q' Z t) = 2 * (2 * 2 ^ Z.length) - 1 := by + dsimp [dv, bv] + have E := ovp_dv q' Z t + rw [pow_S Z.length] at E + omega + rw [h_dv] + refine ob_ov_step ph ph' c4' Xp h i pp q p' q' Z.length htr hi hpc hhead ?_ + intro hm + apply hX1 + cases Z with + | nil => rfl + | cons _ _ => nomatch hm + · exact ih (i + 1) p' q' (by omega) hZ' hX2 hhead htail + +theorem AllI_ovpX (h pa pb : Nat) (Z : List Tri) (i pp q : Nat) (hi : 1 ≤ i) + (hZ : ∀ x ∈ Z, dig0 x) + (hpc : PC LX false h i pp q (Z.length + 2) 0) + (hA : AllI (PCx LX false h) (i + 1) (Z ++ [(pa + 1, 1, false), (pb, 1, false)])) : + AllI (PCx T0 false 2) (i + 1) (ovpX q Z (pa + 1)) := by + induction Z generalizing i pp q with + | nil => + dsimp [ovpX, AllI] at hA ⊢ + refine ⟨?_, trivial⟩ + rcases hA with ⟨ha, _⟩ + dsimp [PCx, Lift, dv, bv] at ha ⊢ + exact ob_x1_base h i pp q pa hi hpc ha + | cons x Z ih => + rcases x with ⟨p', q', d'⟩ + have hd' : d' = false := hZ (p', q', d') List.mem_cons_self + subst hd' + have hZ' : ∀ y ∈ Z, dig0 y := fun y hy => hZ y (List.mem_cons_of_mem _ hy) + dsimp [AllI] at hA + rcases hA with ⟨hhead, htail⟩ + have hZ_all : ∀ y ∈ (p', q', false) :: (Z ++ [(pa + 1, 1, false), (pb, 1, false)]), dig0 y := by + intro y hy + rcases List.mem_cons.mp hy with rfl | hy' + · rfl + · rcases List.mem_append.mp hy' with hyZ | hy2 + · exact hZ' y hyZ + · rcases List.mem_cons.mp hy2 with rfl | hy1 + · rfl + · rcases List.mem_singleton.mp hy1 with rfl; rfl + dsimp [PCx, Lift] at hhead + rw [dv_zero _ hZ_all, List.length_append] at hhead + dsimp at hhead + dsimp [ovpX, AllI] + refine ⟨?_, ?_⟩ + · dsimp [PCx, Lift] + rw [ovpX_len] + have h_dv : dv ((q, p', true) :: ovpX q' Z (pa + 1)) = 2 * 2 ^ Z.length - 1 := by + dsimp [dv, bv] + have E := ovpX_dv q' Z (pa + 1) + omega + rw [h_dv] + exact ob_x1_step h i pp q p' q' Z.length hi hpc hhead + · exact ih (i + 1) p' q' (by omega) hZ' hhead htail + +theorem Z_okL (ph : Phase) (c4 : Bool) (h : Nat) (Z : List Tri) (i : Nat) (x : Tri) (R : List Tri) + (hZ : ∀ y ∈ Z, dig0 y) (hx : dig x = true) + (hA : AllI (PCx ph c4 h) i (Z ++ x :: R)) : + ∀ y ∈ Z, okL y := by + induction Z generalizing i with + | nil => intro y hy; nomatch hy + | cons z Z ih => + rcases z with ⟨p, q, d⟩ + have hd : d = false := hZ (p, q, d) List.mem_cons_self + subst hd + have hZ' : ∀ y ∈ Z, dig0 y := fun y hy => hZ y (List.mem_cons_of_mem _ hy) + dsimp [AllI] at hA + rcases hA with ⟨hhead, htail⟩ + intro y hy + rcases List.mem_cons.mp hy with rfl | hyZ + · refine ⟨rfl, ?_⟩ + dsimp [PCx, Lift] at hhead + rcases x with ⟨px, qx, dx⟩ + dsimp [dig] at hx + subst hx + have h_dv : dv ((p, q, false) :: (Z ++ (px, qx, true) :: R)) = 2 * (2 ^ Z.length * (1 + 2 * dv R)) := by + dsimp [dv, bv] + rw [dv_zeros Z ((px, qx, true) :: R) hZ'] + dsimp [dv, bv] + ring + have h_pos : 1 ≤ 2 ^ Z.length * (1 + 2 * dv R) := Nat.mul_pos (pow_pos Z.length) (by omega) + exact passq ph c4 h i p q (Z ++ (px, qx, true) :: R).length + (dv ((p, q, false) :: (Z ++ (px, qx, true) :: R))) hhead (by omega) (by omega) + · exact ih (i + 1) hZ' htail y hyZ + +theorem AllI_okRO (ph : Phase) (c4 : Bool) (h : Nat) (Z : List Tri) (i : Nat) + (hZ : ∀ y ∈ Z, dig0 y) (hA : AllI (PCx ph c4 h) i Z) : + (∀ y ∈ Z, okR y) ∧ (∀ y ∈ Z, okO y) := by + induction Z generalizing i with + | nil => exact ⟨okR_nil, okO_nil⟩ + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + have hd : d = false := hZ (p, q, d) List.mem_cons_self + subst hd + have hZ' : ∀ y ∈ Z, dig0 y := fun y hy => hZ y (List.mem_cons_of_mem _ hy) + dsimp [AllI] at hA + rcases hA with ⟨hhead, htail⟩ + rcases ih (i + 1) hZ' htail with ⟨hR, hO⟩ + dsimp [PCx, Lift, PC] at hhead + rcases hhead with ⟨hp, hq, _⟩ + exact ⟨okR_cons hq hR, okO_cons hp hq hO⟩ + +theorem inv_Dec (ph : Phase) (c4 : Bool) (h : Nat) (Z : List Tri) (p q : Nat) (R : List Tri) + (hZ : ∀ y ∈ Z, dig0 y) + (hA : AllI (PCx ph c4 h) 1 (Z ++ (p, q + 2, true) :: R)) : + AllI (PCx ph c4 (4 + h)) 1 (Z.map touch ++ (p + 1, q + 1, false) :: R) := by + have hB := AllI_app (PCx ph c4 h) Z 1 ((p, q + 2, true) :: R) hA + dsimp [AllI] at hB + rcases hB with ⟨hx, hR⟩ + apply AllI_touchZ (PCx ph c4 h) (PCx ph c4 (4 + h)) ((p, q + 2, true) :: R) ((p + 1, q + 1, false) :: R) Z 1 hZ + · intro j p0 q0 Zr hZr hj h0 + dsimp [PCx, Lift] at h0 ⊢ + rw [List.length_append, List.length_cons] at h0 + rw [List.length_append, List.length_map, List.length_cons] + dsimp [dv, bv] at h0 ⊢ + rw [dv_zeros Zr ((p, q + 2, true) :: R) hZr] at h0 + rw [dv_tz' Zr ((p + 1, q + 1, false) :: R) hZr] + dsimp [dv, bv] at h0 ⊢ + set A := 2 ^ Zr.length + set M := 2 ^ Zr.length * dv R + have hA1 : 1 ≤ A := pow_pos Zr.length + have h_tv0 : 0 + 2 * (A * (1 + 2 * dv R)) = 2 * (A + 2 * M) := by dsimp [A, M]; ring + have h_tv1 : 1 + 2 * (A - 1 + A * (0 + 2 * dv R)) = 2 * (A + 2 * M) - 1 := by + have : A * (0 + 2 * dv R) = 2 * M := by dsimp [A, M]; ring + omega + rw [h_tv0] at h0 + rw [h_tv1] + have hq0 : 2 ≤ q0 := passq ph c4 h j p0 q0 (Zr.length + (R.length + 1)) (2 * (A + 2 * M)) h0 (by omega) (by omega) + exact ob_touch ph c4 h j p0 q0 (Zr.length + (R.length + 1)) (2 * (A + 2 * M)) (by omega) hq0 h0 + · exact hA + · dsimp [AllI] + refine ⟨?_, ?_⟩ + · dsimp [PCx, Lift, dv, bv] at hx ⊢ + have h_eq : 0 + 2 * dv R = (1 + 2 * dv R) - 1 := by omega + rw [h_eq] + exact ob_touch ph c4 h (1 + Z.length) p (q + 2) R.length (1 + 2 * dv R) (by omega) (by omega) hx + · refine AllI_mono (PCx ph c4 h) (PCx ph c4 (4 + h)) R (1 + Z.length + 1) ?_ hR + intro j y Y hj hy + rcases y with ⟨py, qy, dy⟩ + dsimp [PCx, Lift, PC] at hy ⊢ + rcases hy with ⟨hp, hq, hN, hI⟩ + refine ⟨hp, hq, hN, ?_⟩ + rcases j with _ | _ | _ | j <;> [omega; omega; exact hI; trivial] + +theorem snoc_nn (Z : List Tri) (y : Tri) : Z ++ [y] ≠ [] := by + cases Z <;> intro h <;> nomatch h + +def minlen : Phase → Nat + | LX => 3 + | L2 => 1 + | _ => 2 + +theorem head_len (ph : Phase) (c4 : Bool) (h : Nat) (x : Tri) (Y : List Tri) + (hx : PCx ph c4 h 1 x Y) : minlen ph ≤ Y.length := by + rcases x with ⟨p, q, d⟩ + dsimp [PCx, Lift, PC] at hx + rcases hx with ⟨_, _, _, hI⟩ + cases ph <;> simp only [PI, minlen] at hI ⊢ <;> omega + +theorem AllI_len (ph : Phase) (c4 : Bool) (h : Nat) (P : List Tri) + (hP : P ≠ []) (hA : AllI (PCx ph c4 h) 1 P) : minlen ph + 1 ≤ P.length := by + cases P with + | nil => exact False.elim (hP rfl) + | cons x Y => + dsimp [AllI] at hA + have := head_len ph c4 h x Y hA.1 + dsimp + omega + +theorem inv_Merge (ph : Phase) (c4 : Bool) (h : Nat) (Z : List Tri) (p p' q' : Nat) (d' : Bool) (R0 : List Tri) + (hZ : ∀ y ∈ Z, dig0 y) + (hA : AllI (PCx ph c4 h) 1 (Z ++ (p, 1, true) :: (p', q', d') :: R0)) : + AllI (PCx ph c4 (4 + h)) 1 (Z.map touch ++ (p + p' + 3, q', d') :: R0) := by + have hB := AllI_app (PCx ph c4 h) Z 1 ((p, 1, true) :: (p', q', d') :: R0) hA + dsimp [AllI] at hB + rcases hB with ⟨hx, hy, hR⟩ + have hlt := dv_lt ((p', q', d') :: R0) + dsimp [List.length] at hlt + set Hd := dv ((p', q', d') :: R0) + have hx' := hx + dsimp [PCx, Lift, List.length] at hx' + change PC ph c4 h (1 + Z.length) p 1 (R0.length + 1) (1 + 2 * Hd) at hx' + rcases borrow1 ph c4 h (1 + Z.length) p (R0.length + 1) (1 + 2 * Hd) (by omega) (by omega) hx' with ⟨hph, hk, hL1, hLX⟩ + apply AllI_touchZ (PCx ph c4 h) (PCx ph c4 (4 + h)) ((p, 1, true) :: (p', q', d') :: R0) + ((p + p' + 3, q', d') :: R0) Z 1 hZ + · intro j p0 q0 Zr hZr hj h0 + dsimp [PCx, Lift] at h0 ⊢ + rw [List.length_append, List.length_cons, List.length_cons] at h0 + rw [List.length_append, List.length_map, List.length_cons] + dsimp only [dv] at h0 ⊢ + rw [dv_zeros Zr ((p, 1, true) :: (p', q', d') :: R0) hZr] at h0 + rw [dv_tz' Zr ((p + p' + 3, q', d') :: R0) hZr] + dsimp only [dv] at h0 ⊢ + have hHd_eq : bv d' + 2 * dv R0 = Hd := rfl + rw [hHd_eq] at h0 ⊢ + dsimp [bv] at h0 ⊢ + set A := 2 ^ Zr.length + set B := 2 ^ R0.length + have hA1 : 1 ≤ A := pow_pos Zr.length + have hB1 : 1 ≤ B := pow_pos R0.length + have hn : 2 ^ (Zr.length + (R0.length + 1)) = A * (2 * B) := by + rw [Nat.pow_add, pow_S] + rw [pow_S] at hlt + change Hd < 2 * B at hlt + have h_len : Zr.length + (R0.length + 1 + 1) = (Zr.length + (R0.length + 1)) + 1 := by omega + rw [h_len] at h0 + set M := A * Hd + have h_tv0 : 0 + 2 * (A * (1 + 2 * Hd)) = (2 * A) + 2 * (2 * M) := by dsimp [M]; ring + have h_tv1 : 1 + 2 * (A - 1 + A * Hd) = (2 * A) - 1 + (2 * M) := by dsimp [M]; omega + rw [h_tv0] at h0 + rw [h_tv1] + have hq2 : 2 ≤ q0 := passq ph c4 h j p0 q0 ((Zr.length + (R0.length + 1)) + 1) + ((2 * A) + 2 * (2 * M)) h0 (by omega) (by omega) + refine ob_merge ph c4 h j p0 q0 (Zr.length + (R0.length + 1)) (2 * A) (2 * M) + hph (by omega) (by omega) (by omega) (by omega) ?_ ?_ ?_ ?_ ?_ ?_ hq2 h0 + · rw [hn] + have h_le := Nat.mul_le_mul_left (2 * A) (by omega : Hd + 1 ≤ 2 * B) + have h_lhs : 2 * A * (Hd + 1) = 2 * M + 2 * A := by dsimp [M]; ring + have h_rhs : 2 * A * (2 * B) = 2 * (A * (2 * B)) := by ring + omega + · rintro rfl + rcases hL1 rfl with ⟨_, hb, _⟩ + rw [pow_S] at hb + change (1 + 2 * Hd) + 1 ≤ 2 * B at hb + rw [hn] + have h_le := Nat.mul_le_mul_left (2 * A) (by omega : Hd + 1 ≤ B) + have h_lhs : 2 * A * (Hd + 1) = 2 * M + 2 * A := by dsimp [M]; ring + have h_rhs : 2 * A * B = A * (2 * B) := by ring + omega + · rintro rfl; have := hLX rfl; omega + · rintro rfl hc; rcases hL1 rfl with ⟨_, _, hc2⟩; have := hc2 hc; omega + · rintro rfl; omega + · rintro rfl rfl; have := hLX rfl; omega + · exact hA + · dsimp [AllI] + refine ⟨?_, ?_⟩ + · dsimp [PCx, Lift] at hy ⊢ + have hHd_goal : dv ((p + p' + 3, q', d') :: R0) = Hd := rfl + rw [hHd_goal] + exact ob_fuse ph c4 h (4 + h) (1 + Z.length) p p' q' R0.length Hd hph hk hy + · refine AllI_shift (PCx ph c4 h) (PCx ph c4 (4 + h)) R0 (1 + Z.length + 1) ?_ hR + intro j y Y hj hy0 + rcases y with ⟨py, qy, dy⟩ + dsimp [PCx, Lift] at hy0 ⊢ + exact ob_far ph c4 h (4 + h) (j + 1) j py qy Y.length (dv ((py, qy, dy) :: Y)) (by omega) (by omega) hy0 + +theorem inv_MT (c4 : Bool) (h : Nat) (Z : List Tri) (p : Nat) + (hZ : ∀ y ∈ Z, dig0 y) + (hA : AllI (PCx L2 c4 h) 1 (Z ++ [(p, 1, true)])) : + AllI (PCx L2 false (4 + h)) 1 (Z.map touch) ∧ 2 ≤ Z.length := by + have hB := AllI_app (PCx L2 c4 h) Z 1 [(p, 1, true)] hA + dsimp [AllI] at hB + rcases hB with ⟨hx, _⟩ + dsimp [PCx, Lift, List.length, dv, bv] at hx + rcases borrow1 L2 c4 h (1 + Z.length) p 0 (1 + 2 * 0) (by omega) (by omega) hx with ⟨_, hk, _⟩ + refine ⟨?_, by omega⟩ + rw [← List.append_nil (Z.map touch)] + apply AllI_touchZ (PCx L2 c4 h) (PCx L2 false (4 + h)) [(p, 1, true)] [] Z 1 hZ + · intro j p0 q0 Zr hZr hj h0 + dsimp [PCx, Lift] at h0 ⊢ + rw [List.length_append, List.length_singleton] at h0 + rw [List.length_append, List.length_map, List.length_nil, Nat.add_zero] + dsimp [dv, bv] at h0 ⊢ + rw [dv_zeros Zr [(p, 1, true)] hZr] at h0 + rw [dv_tz' Zr [] hZr] + dsimp [dv, bv] at h0 ⊢ + have hpos := pow_pos Zr.length + have h_tv0 : 0 + 2 * (2 ^ Zr.length * 1) = 2 * 2 ^ Zr.length := by ring + have h_tv1 : 1 + 2 * (2 ^ Zr.length - 1) = 2 * 2 ^ Zr.length - 1 := by omega + rw [h_tv0] at h0 + rw [h_tv1] + have hq0 : 2 ≤ q0 := passq L2 c4 h j p0 q0 (Zr.length + 1) (2 * 2 ^ Zr.length) h0 (by omega) (by omega) + exact ob_mt c4 h j p0 q0 Zr.length hq0 (by omega) h0 + · exact hA + · exact trivial + +theorem inv_End (ph ph' : Phase) (h : Nat) (Z : List Tri) (p q : Nat) + (htr : endtr ph ph') (hZ : ∀ y ∈ Z, dig0 y) + (hA : AllI (PCx ph false h) 1 (Z ++ [(p, q + 2, false)])) : + AllI (PCx ph' false (4 + h)) 1 (Z.map touch ++ [(p + 1, q + 1, false)]) := by + have hlen := AllI_len ph false h (Z ++ [(p, q + 2, false)]) (snoc_nn Z _) hA + rw [List.length_append, List.length_singleton] at hlen + have hm : minlen ph = 2 := by rcases htr with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ <;> rfl + have hB := AllI_app (PCx ph false h) Z 1 [(p, q + 2, false)] hA + dsimp [AllI] at hB + rcases hB with ⟨hx, _⟩ + apply AllI_touchZ (PCx ph false h) (PCx ph' false (4 + h)) [(p, q + 2, false)] [(p + 1, q + 1, false)] Z 1 hZ + · intro j p0 q0 Zr hZr hj h0 + dsimp [PCx, Lift] at h0 ⊢ + rw [List.length_append, List.length_singleton] at h0 + rw [List.length_append, List.length_map, List.length_singleton] + dsimp [dv, bv] at h0 ⊢ + rw [dv_zeros Zr [(p, q + 2, false)] hZr] at h0 + rw [dv_tz' Zr [(p + 1, q + 1, false)] hZr] + dsimp [dv, bv] at h0 ⊢ + have hpos := pow_pos Zr.length + have h_tv1 : 1 + 2 * (2 ^ Zr.length - 1) = 2 ^ (Zr.length + 1) - 1 := by + rw [pow_S]; omega + rw [h_tv1] + have hq0 : 2 ≤ q0 := q2_V0 ph false h j p0 q0 (Zr.length + 1) h0 (by omega) + (by rintro rfl; rcases htr with ⟨h1, _⟩ | ⟨h1, _⟩ <;> nomatch h1) + exact ob_end ph ph' h j p0 q0 (Zr.length + 1) htr (by omega) hq0 h0 + · exact hA + · dsimp [AllI] + refine ⟨?_, trivial⟩ + dsimp [PCx, Lift, List.length, dv, bv] at hx ⊢ + exact ob_end_top ph ph' h (1 + Z.length) p q htr (by omega) hx + +theorem inv_X2 (h : Nat) (Z : List Tri) (p q k : Nat) + (hZ : ∀ y ∈ Z, dig0 y) (hk : 3 ≤ k) + (hA : AllI (PCx T0 false h) 1 (Z ++ [(p, q + 2, false)])) : + AllI (PCx E1t false (4 + h)) 1 (Z.map touch ++ [(p + 1, q + 1, false), (3, k, true)]) := by + have hlen := AllI_len T0 false h (Z ++ [(p, q + 2, false)]) (snoc_nn Z _) hA + rw [List.length_append, List.length_singleton] at hlen + dsimp [minlen] at hlen + have hB := AllI_app (PCx T0 false h) Z 1 [(p, q + 2, false)] hA + dsimp [AllI] at hB + rcases hB with ⟨hx, _⟩ + apply AllI_touchZ (PCx T0 false h) (PCx E1t false (4 + h)) [(p, q + 2, false)] + [(p + 1, q + 1, false), (3, k, true)] Z 1 hZ + · intro j p0 q0 Zr hZr hj h0 + dsimp [PCx, Lift] at h0 ⊢ + rw [List.length_append, List.length_singleton] at h0 + rw [List.length_append, List.length_map] + dsimp [List.length, dv, bv] at h0 ⊢ + rw [dv_zeros Zr [(p, q + 2, false)] hZr] at h0 + rw [dv_tz' Zr [(p + 1, q + 1, false), (3, k, true)] hZr] + dsimp [dv, bv] at h0 ⊢ + have hpos := pow_pos Zr.length + have h_tv1 : 1 + 2 * (2 ^ Zr.length - 1 + 2 ^ Zr.length * 2) = 3 * 2 ^ (Zr.length + 1) - 1 := by + rw [pow_S]; omega + rw [h_tv1] + have hq0 : 2 ≤ q0 := q2_V0 T0 false h j p0 q0 (Zr.length + 1) h0 (by omega) (by intro h'; nomatch h') + exact ob_x2 h j p0 q0 (Zr.length + 1) (by omega) hq0 h0 + · exact hA + · dsimp [AllI] + refine ⟨?_, ?_, trivial⟩ + · dsimp [PCx, Lift, List.length, dv, bv] at hx ⊢ + exact ob_x2_top h (1 + Z.length) p q (by omega) hx + · dsimp [PCx, Lift, List.length, dv, bv] + exact ob_x2_new (4 + h) (1 + Z.length + 1) k (by omega) hk + +theorem inv_EndLast (c4 : Bool) (h : Nat) (Z : List Tri) (p : Nat) + (hZ : ∀ y ∈ Z, dig0 y) + (hA : AllI (PCx L1 c4 h) 1 (Z ++ [(p, 1, false)])) : + AllI (PCx L2 c4 (4 + h)) 1 (Z.map touch) ∧ 2 ≤ Z.length := by + have hlen := AllI_len L1 c4 h (Z ++ [(p, 1, false)]) (snoc_nn Z _) hA + rw [List.length_append, List.length_singleton] at hlen + dsimp [minlen] at hlen + refine ⟨?_, by omega⟩ + rw [← List.append_nil (Z.map touch)] + apply AllI_touchZ (PCx L1 c4 h) (PCx L2 c4 (4 + h)) [(p, 1, false)] [] Z 1 hZ + · intro j p0 q0 Zr hZr hj h0 + dsimp [PCx, Lift] at h0 ⊢ + rw [List.length_append, List.length_singleton] at h0 + rw [List.length_append, List.length_map, List.length_nil, Nat.add_zero] + dsimp [dv, bv] at h0 ⊢ + rw [dv_zeros Zr [(p, 1, false)] hZr] at h0 + rw [dv_tz' Zr [] hZr] + dsimp [dv, bv] at h0 ⊢ + have hpos := pow_pos Zr.length + have h_tv1 : 1 + 2 * (2 ^ Zr.length - 1) = 2 * 2 ^ Zr.length - 1 := by omega + rw [h_tv1] + have hq0 : 2 ≤ q0 := q2_V0 L1 c4 h j p0 q0 (Zr.length + 1) h0 (by omega) (by intro h'; nomatch h') + exact ob_endlast c4 h j p0 q0 Zr.length hq0 h0 + · exact hA + · exact trivial + +theorem inv_Ov (ph ph' : Phase) (c4' : Bool) (Xp : Nat → Prop) (h p1 q1 : Nat) (Z : List Tri) (t : Nat) + (htr : ovtr ph ph' c4' Xp) (ht1 : ph = L2 → 2 ≤ t) (ht2 : ph ≠ L2 → t = 1) + (hZ : ∀ y ∈ Z, dig0 y) (hX : lastOK Xp Z) + (hA : AllI (PCx ph false h) 1 ((p1 + 2, q1, false) :: Z)) : + AllI (PCx ph' c4' 2) 1 ((h + 5, p1 + 1, false) :: ovp q1 Z t) := by + dsimp [AllI] at hA ⊢ + rcases hA with ⟨hhead, htail⟩ + have hhead' := hhead + dsimp [PCx, Lift] at hhead' + have hZ_cons : ∀ y ∈ (p1 + 2, q1, false) :: Z, dig0 y := by + intro y hy + rcases List.mem_cons.mp hy with rfl | hyZ + · rfl + · exact hZ y hyZ + rw [dv_zero _ hZ_cons] at hhead' + refine ⟨?_, ?_⟩ + · dsimp [PCx, Lift] + rw [ovp_len] + have h_dv : dv ((h + 5, p1 + 1, false) :: ovp q1 Z t) = 2 * (2 * 2 ^ Z.length) - 2 := by + dsimp [dv, bv] + have E := ovp_dv q1 Z t + rw [pow_S Z.length] at E + omega + rw [h_dv] + exact ob_ov_head ph ph' c4' Xp h p1 q1 Z.length htr hhead' + · exact AllI_ovp ph ph' c4' Xp h t htr ht1 ht2 Z 1 (p1 + 2) q1 (by omega) hZ hX hhead' htail + +theorem inv_X1 (h p1 q1 : Nat) (Z : List Tri) (pa pb : Nat) + (hZ : ∀ y ∈ Z, dig0 y) + (hA : AllI (PCx LX false h) 1 ((p1 + 2, q1, false) :: (Z ++ [(pa + 1, 1, false), (pb, 1, false)]))) : + AllI (PCx T0 false 2) 1 ((h + 5, p1 + 1, false) :: ovpX q1 Z (pa + 1)) := by + dsimp [AllI] at hA ⊢ + rcases hA with ⟨hhead, htail⟩ + have hhead' := hhead + dsimp [PCx, Lift] at hhead' + have hZ_all : ∀ y ∈ (p1 + 2, q1, false) :: (Z ++ [(pa + 1, 1, false), (pb, 1, false)]), dig0 y := by + intro y hy + rcases List.mem_cons.mp hy with rfl | hy' + · rfl + · rcases List.mem_append.mp hy' with hyZ | hy2 + · exact hZ y hyZ + · rcases List.mem_cons.mp hy2 with rfl | hy1 + · rfl + · rcases List.mem_singleton.mp hy1 with rfl; rfl + rw [dv_zero _ hZ_all, List.length_append] at hhead' + dsimp at hhead' + refine ⟨?_, ?_⟩ + · dsimp [PCx, Lift] + rw [ovpX_len] + have h_dv : dv ((h + 5, p1 + 1, false) :: ovpX q1 Z (pa + 1)) = 2 * 2 ^ Z.length - 2 := by + dsimp [dv, bv] + have E := ovpX_dv q1 Z (pa + 1) + omega + rw [h_dv] + exact ob_x1_head h p1 q1 Z.length hhead' + · exact AllI_ovpX h pa pb Z 1 (p1 + 2) q1 (by omega) hZ hhead' htail + +structure St where + sh : Nat + sP : List Tri + sT : Tl + sph : Phase + sc4 : Bool + +def Cf (s : St) : Cfg (Fin 2) (Fin 6) := K s.sh s.sP s.sT + +def TC (ph : Phase) (c4 : Bool) (T : Tl) : Prop := + match ph with + | E1 | E1t | LX => T = TN ∧ c4 = false + | L1 => T = TN + | E2 | E2t => T = TA 1 ∧ c4 = false + | T0 => (∃ k, T = TB k ∧ 3 ≤ k) ∧ c4 = false + | L2 => ∃ t, T = TA t ∧ 2 ≤ t + +def J (s : St) : Prop := + s.sP ≠ [] ∧ TC s.sph s.sc4 s.sT ∧ AllI (PCx s.sph s.sc4 s.sh) 1 s.sP + +theorem split1 (P : List Tri) : + (∃ Z x R, P = Z ++ x :: R ∧ (∀ y ∈ Z, dig0 y) ∧ dig x = true) ∨ (∀ y ∈ P, dig0 y) := by + induction P with + | nil => exact Or.inr (by intro y hy; nomatch hy) + | cons x P' ih => + rcases x with ⟨p, q, d⟩ + cases d with + | true => + exact Or.inl ⟨[], (p, q, true), P', rfl, (by intro y hy; nomatch hy), rfl⟩ + | false => + rcases ih with ⟨Z, x, R, rfl, hZ, hx⟩ | h0 + · refine Or.inl ⟨(p, q, false) :: Z, x, R, rfl, ?_, hx⟩ + intro y hy + rcases List.mem_cons.mp hy with rfl | hyZ + · rfl + · exact hZ y hyZ + · refine Or.inr ?_ + intro y hy + rcases List.mem_cons.mp hy with rfl | hyP + · rfl + · exact h0 y hyP + +theorem exists_last {P : List Tri} (hP : P ≠ []) : ∃ (Z : List Tri) (y : Tri), P = Z ++ [y] := by + induction P with + | nil => exact False.elim (hP rfl) + | cons x P' ih => + cases P' with + | nil => exact ⟨[], x, rfl⟩ + | cons x' P'' => + obtain ⟨Z, y, h_eq⟩ := ih (by intro h; nomatch h) + exact ⟨x :: Z, y, by rw [h_eq]; rfl⟩ + +theorem Z_okL_V0 (ph : Phase) (c4 : Bool) (h : Nat) (y : Tri) (hph : ph ≠ LX) + (Z : List Tri) (i : Nat) + (hZ : ∀ x ∈ Z ++ [y], dig0 x) + (hA : AllI (PCx ph c4 h) i (Z ++ [y])) : + ∀ x ∈ Z, okL x := by + induction Z generalizing i with + | nil => exact okL_nil + | cons z Z ih => + rcases z with ⟨p, q, d⟩ + have hd : d = false := hZ (p, q, d) List.mem_cons_self + subst hd + have hZ' : ∀ x ∈ Z ++ [y], dig0 x := fun x hx => hZ x (List.mem_cons_of_mem _ hx) + have hZ_cons : ∀ x ∈ (p, q, false) :: (Z ++ [y]), dig0 x := hZ + dsimp [AllI] at hA + rcases hA with ⟨hhead, htail⟩ + dsimp [PCx, Lift] at hhead + rw [dv_zero _ hZ_cons, List.length_append, List.length_singleton] at hhead + have hq2 : 2 ≤ q := q2_V0 ph c4 h i p q (Z.length + 1) hhead (by omega) (fun h' => False.elim (hph h')) + exact okL_cons hq2 (ih (i + 1) hZ' htail) + +theorem last_pc (ph : Phase) (c4 : Bool) (h : Nat) (Z : List Tri) (p q : Nat) (d : Bool) + (hZ : ∀ x ∈ Z ++ [(p, q, d)], dig0 x) + (hA : AllI (PCx ph c4 h) 1 (Z ++ [(p, q, d)])) : + d = false ∧ PC ph c4 h (1 + Z.length) p q 0 0 := by + have hd : d = false := hZ (p, q, d) (List.mem_append_right _ (List.mem_singleton.mpr rfl)) + subst hd + refine ⟨rfl, ?_⟩ + have hB := AllI_app (PCx ph c4 h) Z 1 [(p, q, false)] hA + dsimp [AllI, PCx, Lift, List.length, dv, bv] at hB + exact hB.1 + +theorem first_pc (ph : Phase) (c4 : Bool) (h p q : Nat) (d : Bool) (Z : List Tri) + (hZ : ∀ x ∈ (p, q, d) :: Z, dig0 x) + (hA : AllI (PCx ph c4 h) 1 ((p, q, d) :: Z)) : + d = false ∧ PC ph c4 h 1 p q Z.length 0 ∧ (∀ x ∈ Z, dig0 x) ∧ AllI (PCx ph c4 h) 2 Z := by + have hd : d = false := hZ (p, q, d) List.mem_cons_self + subst hd + have hZ' : ∀ x ∈ Z, dig0 x := fun x hx => hZ x (List.mem_cons_of_mem _ hx) + dsimp [AllI] at hA + rcases hA with ⟨hhead, htail⟩ + dsimp [PCx, Lift] at hhead + rw [dv_zero _ hZ] at hhead + exact ⟨rfl, hhead, hZ', htail⟩ + +theorem cons_nn (x : Tri) (Z : List Tri) : x :: Z ≠ [] := by + intro h; nomatch h + +theorem app_cons_nn (Z : List Tri) (x : Tri) (R : List Tri) : Z ++ x :: R ≠ [] := by + cases Z <;> intro h <;> nomatch h + +theorem Jstep (s : St) (hs : J s) : ∃ s', ((Cf s) [target_tm]⊢⁺ (Cf s')) ∧ J s' := by + rcases s with ⟨h, P, T, ph, c4⟩ + rcases hs with ⟨hP, hT, hA⟩ + dsimp [Cf] at hP hT hA ⊢ + rcases split1 P with ⟨Z, ⟨p, q, d⟩, R, rfl, hZ, hd⟩ | h0 + · dsimp [dig] at hd + subst hd + have hZL : ∀ y ∈ Z, okL y := Z_okL ph c4 h Z 1 (p, q, true) R hZ rfl hA + have hB := AllI_app (PCx ph c4 h) Z 1 ((p, q, true) :: R) hA + dsimp [AllI] at hB + rcases hB with ⟨hx, hR⟩ + have hx' := hx + dsimp [PCx, Lift] at hx' + rcases q with _ | _ | q + · exfalso; rcases hx' with ⟨_, hq, _⟩; omega + · rcases borrow1 ph c4 h (1 + Z.length) p R.length (dv ((p, 1, true) :: R)) (by omega) + (by dsimp [dv, bv]; omega) hx' with ⟨hph, hk, hL1, hLX⟩ + cases R with + | nil => + cases T with + | TN => + exfalso + rcases hph with rfl | rfl | rfl + · rcases hL1 rfl with ⟨hn, _⟩; dsimp at hn; omega + · rcases hT with ⟨t, ht, _⟩; nomatch ht + · have hn := hLX rfl; dsimp at hn; omega + | TA t => + have h_ph : ph = L2 := by + rcases hph with rfl | rfl | rfl + · dsimp [TC] at hT; nomatch hT + · rfl + · dsimp [TC] at hT; nomatch hT.1 + subst h_ph + rcases hT with ⟨t', ht, ht2⟩ + cases ht + rcases inv_MT c4 h Z p hZ hA with ⟨hA', hlen⟩ + refine ⟨⟨4 + h, Z.map touch, TA (p + t + 3), L2, false⟩, ?_, ?_⟩ + · exact DecMergeTail h Z p t hZL + · refine ⟨?_, ⟨p + t + 3, rfl, by omega⟩, hA'⟩ + cases Z with + | nil => dsimp at hlen; omega + | cons _ _ => exact cons_nn _ _ + | TB k => + exfalso + rcases hph with rfl | rfl | rfl + · dsimp [TC] at hT; nomatch hT + · rcases hT with ⟨t, ht, _⟩; nomatch ht + · dsimp [TC] at hT; nomatch hT.1 + | cons y R0 => + rcases y with ⟨p', q', d'⟩ + refine ⟨⟨4 + h, Z.map touch ++ (p + p' + 3, q', d') :: R0, T, ph, c4⟩, ?_, ?_⟩ + · exact DecMerge h Z p p' q' d' R0 T hZL + · exact ⟨app_cons_nn _ _ _, hT, inv_Merge ph c4 h Z p p' q' d' R0 hZ hA⟩ + · refine ⟨⟨4 + h, Z.map touch ++ (p + 1, q + 1, false) :: R, T, ph, c4⟩, ?_, ?_⟩ + · exact Dec h Z p q R T hZL + · exact ⟨app_cons_nn _ _ _, hT, inv_Dec ph c4 h Z p q R hZ hA⟩ + · cases ph with + | E1 => + rcases hT with ⟨rfl, rfl⟩ + rcases exists_last hP with ⟨Z, ⟨p, q, d⟩, rfl⟩ + rcases last_pc E1 false h Z p q d h0 hA with ⟨rfl, hy⟩ + have hq : 2 ≤ q := by rcases hy with ⟨_, _, hN, _⟩; simp -failIfUnchanged only [PN] at hN; omega + rcases q with _ | _ | q <;> [omega; omega; skip] + have hZL : ∀ x ∈ Z, okL x := Z_okL_V0 E1 false h (p, q + 2, false) (by decide) Z 1 h0 hA + have hZ : ∀ x ∈ Z, dig0 x := fun x hx => h0 x (List.mem_append_left _ hx) + refine ⟨⟨4 + h, Z.map touch ++ [(p + 1, q + 1, false)], TA 1, E2, false⟩, ?_, ?_⟩ + · exact EndR h Z p q hZL + · exact ⟨snoc_nn _ _, ⟨rfl, rfl⟩, inv_End E1 E2 h Z p q (Or.inl ⟨rfl, rfl⟩) hZ hA⟩ + | E2 => + rcases hT with ⟨rfl, rfl⟩ + cases P with + | nil => exact False.elim (hP rfl) + | cons x Z => + rcases x with ⟨p1, q1, d1⟩ + rcases first_pc E2 false h p1 q1 d1 Z h0 hA with ⟨rfl, hh, hZ, hA2⟩ + have hp1 : 2 ≤ p1 := p1_V0 E2 false h p1 q1 Z.length hh (Or.inl rfl) + rcases p1 with _ | _ | p1 <;> [omega; omega; skip] + rcases AllI_okRO E2 false h Z 2 hZ hA2 with ⟨hR, hO⟩ + have hq1 : 1 ≤ q1 := hh.2.1 + rcases lastOK_dec Z with hX | hX + · refine ⟨⟨2, (h + 5, p1 + 1, false) :: ovp q1 Z 1, TN, LX, false⟩, ?_, ?_⟩ + · exact Ov h p1 q1 Z 1 hq1 hR hO + · refine ⟨cons_nn _ _, ⟨rfl, rfl⟩, ?_⟩ + exact inv_Ov E2 LX false (fun x => x = 4) h p1 q1 Z 1 + (Or.inr (Or.inl ⟨rfl, rfl, rfl, rfl⟩)) (by intro h'; nomatch h') (fun _ => rfl) hZ hX hA + · refine ⟨⟨2, (h + 5, p1 + 1, false) :: ovp q1 Z 1, TN, L1, false⟩, ?_, ?_⟩ + · exact Ov h p1 q1 Z 1 hq1 hR hO + · refine ⟨cons_nn _ _, rfl, ?_⟩ + exact inv_Ov E2 L1 false (fun x => x ≠ 4) h p1 q1 Z 1 + (Or.inl ⟨rfl, rfl, rfl, rfl⟩) (by intro h'; nomatch h') (fun _ => rfl) hZ hX hA + | E1t => + rcases hT with ⟨rfl, rfl⟩ + rcases exists_last hP with ⟨Z, ⟨p, q, d⟩, rfl⟩ + rcases last_pc E1t false h Z p q d h0 hA with ⟨rfl, hy⟩ + have hq : 2 ≤ q := by rcases hy with ⟨_, _, hN, _⟩; simp -failIfUnchanged only [PN] at hN; omega + rcases q with _ | _ | q <;> [omega; omega; skip] + have hZL : ∀ x ∈ Z, okL x := Z_okL_V0 E1t false h (p, q + 2, false) (by decide) Z 1 h0 hA + have hZ : ∀ x ∈ Z, dig0 x := fun x hx => h0 x (List.mem_append_left _ hx) + refine ⟨⟨4 + h, Z.map touch ++ [(p + 1, q + 1, false)], TA 1, E2t, false⟩, ?_, ?_⟩ + · exact EndR h Z p q hZL + · exact ⟨snoc_nn _ _, ⟨rfl, rfl⟩, inv_End E1t E2t h Z p q (Or.inr ⟨rfl, rfl⟩) hZ hA⟩ + | E2t => + rcases hT with ⟨rfl, rfl⟩ + cases P with + | nil => exact False.elim (hP rfl) + | cons x Z => + rcases x with ⟨p1, q1, d1⟩ + rcases first_pc E2t false h p1 q1 d1 Z h0 hA with ⟨rfl, hh, hZ, hA2⟩ + have hp1 : 2 ≤ p1 := p1_V0 E2t false h p1 q1 Z.length hh (Or.inr (Or.inl rfl)) + rcases p1 with _ | _ | p1 <;> [omega; omega; skip] + rcases AllI_okRO E2t false h Z 2 hZ hA2 with ⟨hR, hO⟩ + have hq1 : 1 ≤ q1 := hh.2.1 + refine ⟨⟨2, (h + 5, p1 + 1, false) :: ovp q1 Z 1, TN, L1, true⟩, ?_, ?_⟩ + · exact Ov h p1 q1 Z 1 hq1 hR hO + · refine ⟨cons_nn _ _, rfl, ?_⟩ + exact inv_Ov E2t L1 true (fun _ => True) h p1 q1 Z 1 + (Or.inr (Or.inr (Or.inl ⟨rfl, rfl, rfl, rfl⟩))) (by intro h'; nomatch h') (fun _ => rfl) + hZ (lastOK_True Z) hA + | T0 => + rcases hT with ⟨⟨k, rfl, hk⟩, rfl⟩ + rcases exists_last hP with ⟨Z, ⟨p, q, d⟩, rfl⟩ + rcases last_pc T0 false h Z p q d h0 hA with ⟨rfl, hy⟩ + have hq : 2 ≤ q := by rcases hy with ⟨_, _, hN, _⟩; simp -failIfUnchanged only [PN] at hN; omega + rcases q with _ | _ | q <;> [omega; omega; skip] + rcases k with _ | k <;> [omega; skip] + have hZL : ∀ x ∈ Z, okL x := Z_okL_V0 T0 false h (p, q + 2, false) (by decide) Z 1 h0 hA + have hZ : ∀ x ∈ Z, dig0 x := fun x hx => h0 x (List.mem_append_left _ hx) + refine ⟨⟨4 + h, Z.map touch ++ [(p + 1, q + 1, false), (3, k + 1, true)], TN, E1t, false⟩, ?_, ?_⟩ + · exact X2 h Z p q k hZL + · exact ⟨app_cons_nn _ _ _, ⟨rfl, rfl⟩, inv_X2 h Z p q (k + 1) hZ hk hA⟩ + | L1 => + dsimp [TC] at hT + subst hT + rcases exists_last hP with ⟨Z, ⟨p, q, d⟩, rfl⟩ + rcases last_pc L1 c4 h Z p q d h0 hA with ⟨rfl, hy⟩ + have hq : q = 1 := by rcases hy with ⟨_, _, hN, _⟩; simp -failIfUnchanged only [PN] at hN; omega + subst hq + have hZL : ∀ x ∈ Z, okL x := Z_okL_V0 L1 c4 h (p, 1, false) (by decide) Z 1 h0 hA + have hZ : ∀ x ∈ Z, dig0 x := fun x hx => h0 x (List.mem_append_left _ hx) + rcases inv_EndLast c4 h Z p hZ hA with ⟨hA', hlen⟩ + refine ⟨⟨4 + h, Z.map touch, TA (p + 4), L2, c4⟩, ?_, ?_⟩ + · exact EndLast h Z p hZL + · refine ⟨?_, ⟨p + 4, rfl, by omega⟩, hA'⟩ + cases Z with + | nil => dsimp at hlen; omega + | cons _ _ => exact cons_nn _ _ + | L2 => + rcases hT with ⟨t, rfl, ht⟩ + cases c4 with + | true => + exfalso + rcases exists_last hP with ⟨Z, ⟨p, q, d⟩, rfl⟩ + rcases last_pc L2 true h Z p q d h0 hA with ⟨rfl, hy⟩ + exact L2_c4_V0 h (1 + Z.length) p q hy + | false => + cases P with + | nil => exact False.elim (hP rfl) + | cons x Z => + rcases x with ⟨p1, q1, d1⟩ + rcases first_pc L2 false h p1 q1 d1 Z h0 hA with ⟨rfl, hh, hZ, hA2⟩ + have hp1 : 2 ≤ p1 := p1_V0 L2 false h p1 q1 Z.length hh (Or.inr (Or.inr (Or.inl rfl))) + rcases p1 with _ | _ | p1 <;> [omega; omega; skip] + rcases AllI_okRO L2 false h Z 2 hZ hA2 with ⟨hR, hO⟩ + have hq1 : 1 ≤ q1 := hh.2.1 + refine ⟨⟨2, (h + 5, p1 + 1, false) :: ovp q1 Z t, TN, E1, false⟩, ?_, ?_⟩ + · exact Ov h p1 q1 Z t hq1 hR hO + · refine ⟨cons_nn _ _, ⟨rfl, rfl⟩, ?_⟩ + exact inv_Ov L2 E1 false (fun _ => True) h p1 q1 Z t + (Or.inr (Or.inr (Or.inr ⟨rfl, rfl, rfl, rfl⟩))) (fun _ => ht) (fun h' => False.elim (h' rfl)) + hZ (lastOK_True Z) hA + | LX => + rcases hT with ⟨rfl, rfl⟩ + have hlen := AllI_len LX false h P hP hA + dsimp [minlen] at hlen + rcases exists_last hP with ⟨P1, ⟨pb, qb, db⟩, rfl⟩ + have hP1 : P1 ≠ [] := by + cases P1 with + | nil => dsimp at hlen; omega + | cons _ _ => exact cons_nn _ _ + rcases exists_last hP1 with ⟨P2, ⟨pa, qa, da⟩, rfl⟩ + cases P2 with + | nil => dsimp at hlen; omega + | cons x Z => + rcases x with ⟨p1, q1, d1⟩ + have h_assoc : (p1, q1, d1) :: Z ++ [(pa, qa, da)] ++ [(pb, qb, db)] = + (p1, q1, d1) :: (Z ++ [(pa, qa, da), (pb, qb, db)]) := by simp + rw [h_assoc] at h0 hA ⊢ + rcases first_pc LX false h p1 q1 d1 (Z ++ [(pa, qa, da), (pb, qb, db)]) h0 hA with ⟨rfl, hh, hZab, hA2⟩ + have hZ : ∀ x ∈ Z, dig0 x := fun x hx => hZab x (List.mem_append_left _ hx) + have hda : da = false := hZab (pa, qa, da) (List.mem_append_right _ List.mem_cons_self) + have hdb : db = false := hZab (pb, qb, db) (List.mem_append_right _ (List.mem_cons_of_mem _ (List.mem_singleton.mpr rfl))) + subst hda hdb + have hB := AllI_app (PCx LX false h) Z 2 [(pa, qa, false), (pb, qb, false)] hA2 + dsimp [AllI, PCx, Lift, List.length, dv, bv] at hB + rcases hB with ⟨ha, hb, _⟩ + have hqa : qa = 1 := by rcases ha with ⟨_, _, hN, _⟩; simp -failIfUnchanged only [PN] at hN; omega + have hqb : qb = 1 := by rcases hb with ⟨_, _, hN, _⟩; simp -failIfUnchanged only [PN] at hN; omega + subst hqa hqb + have hpa : 1 ≤ pa := ha.1 + rcases pa with _ | pa <;> [omega; skip] + have hp1 : 2 ≤ p1 := p1_V0 LX false h p1 q1 (Z ++ [(pa + 1, 1, false), (pb, 1, false)]).length hh + (Or.inr (Or.inr (Or.inr rfl))) + rcases p1 with _ | _ | p1 <;> [omega; omega; skip] + rcases AllI_okRO LX false h (Z ++ [(pa + 1, 1, false), (pb, 1, false)]) 2 hZab hA2 with ⟨hR_all, hO_all⟩ + have hR : ∀ x ∈ Z, okR x := fun x hx => hR_all x (List.mem_append_left _ hx) + have hO : ∀ x ∈ Z, okO x := fun x hx => hO_all x (List.mem_append_left _ hx) + have hq1 : 1 ≤ q1 := hh.2.1 + refine ⟨⟨2, (h + 5, p1 + 1, false) :: ovpX q1 Z (pa + 1), TB (pb + 3), T0, false⟩, ?_, ?_⟩ + · exact X1 h p1 q1 Z pa pb hq1 hR hO + · exact ⟨cons_nn _ _, ⟨⟨pb + 3, rfl, by omega⟩, rfl⟩, inv_X1 h p1 q1 Z pa pb hZ hA⟩ + +theorem J_base23 : J ⟨2, base23, TN, E1, false⟩ := by + refine ⟨by decide, ⟨rfl, rfl⟩, ?_⟩ + simp only [base23, AllI, PCx, Lift, PC, PN, PI, dv, bv] + split_and <;> decide + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + refine closed_inv_does_not_halt target_tm (fun cfg => ∃ s, cfg = Cf s ∧ J s) ?_ ?_ + · exact ⟨Cf ⟨2, base23, TN, E1, false⟩, init_to_base23, ⟨2, base23, TN, E1, false⟩, rfl, J_base23⟩ + · rintro cfg ⟨s, rfl, hs⟩ + obtain ⟨s', hstep, hs'⟩ := Jstep s hs + exact ⟨Cf s', hstep, s', rfl, hs'⟩ + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0LD_1RC0RA_1RD1RF_1LA0LE_1RE1LD_0RBHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH.lean new file mode 100644 index 00000000..091a5f77 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH.lean @@ -0,0 +1,1312 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge + +open Mathlib Relation Nat Turing BusyBeaver SixState + +@[expose] public section + +namespace BusyBeaver.M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end BusyBeaver.M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH + +end + +namespace BusyBeaver.M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +namespace Solution + + + + + + + + + + + + + + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = + some config := rfl + +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = + step M config := rfl + +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + + +@[simp] theorem pow_zero_list (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl + +@[simp] theorem pow_succ_list (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl + +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ + ys) := rfl + +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l + +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl + +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x + :: xs) +> b = x >> (xs +> b) := rfl + +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl + +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl + +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + + +omit [Inhabited Γ] in +@[simp] +theorem list_pow_append_one (u : List (Fin 2)) (k : Nat) : + u^k ++ u = u^(k + 1) := by + have h := list_pow_add_comm u k 1 + dsimp [HPow.hPow] at h ⊢ + rw [List.append_nil] at h + exact h + + +theorem pow_add_append_right (u : List (Fin 2)) (m n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (m + n)) +> r = (u ^ m) +> ((u ^ n) +> r) := by + rw [list_pow_add, ← listblank_append_append] + + +theorem pow_succ_append_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (n + 1)) +> r = u +> ((u ^ n) +> r) := by + rw [pow_succ_list, ← listblank_append_append] + + +theorem pow_succ_append_right' (u : List (Fin 2)) (k : Nat) (r : ListBlank (Fin 2)) : + (u ^ k) +> (u +> r) = (u ^ (k + 1)) +> r := by + rw [listblank_append_append, list_pow_append_one] + + +theorem pow_add_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (m n : Nat) : + s <+ (u ^ (m + n)) = (s <+ (u ^ m)) <+ (u ^ n) := by + rw [listblank_append_append, ← list_pow_add, add_comm] + + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + + +theorem stepPlus_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, _, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + + +theorem stepStar_stepPlus_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + + +local macro "finish" : tactic => + `(tactic| exists 0 <;> rfl) + +local macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, + BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, + default_head, default_tail]) + +local macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> + (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> + (any_goals (first | finish | step))) + +local macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + + +def A : Fin 6 := 1 + +def B : Fin 6 := 2 + +def C : Fin 6 := 3 + +def D : Fin 6 := 0 + +def E : Fin 6 := 4 + +def F : Fin 6 := 5 + + + + +/-- `A` shifts rightward over `[1, 0]^k` in `2 * k` steps, writing `[1, 0]^k` to the left tape. -/ +theorem shift_A_right_10_0036 (k : Nat) (l r : ListBlank (Fin 2)) : + (l {{A}}> (([1, 0] : List (Fin 2)) ^ k +> r)) [target_tm]⊢* + ((l <+ ([1, 0] : List (Fin 2)) ^ k) {{A}}> r) := by + induction k generalizing l r with + | zero => + simp only [pow_zero_list, listblank_append_nil] + exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_append_right] + have h1 : (l {{A}}> ([1, 0] +> (([1, 0] : List (Fin 2)) ^ k +> r))) + [target_tm]⊢* + ((l <+ [1, 0]) {{A}}> (([1, 0] : List (Fin 2)) ^ k +> r)) := by + dsimp [ListBlank.append]; step; step; exact ⟨0, rfl⟩ + have h2 := ih (l <+ [1, 0]) r + rw [listblank_append_append, list_pow_append_one] at h2 + exact stepStar_trans h1 h2 + + + +/-- `E` shifts rightward over `[0, 1]^k` in `2 * k` steps, writing `[0, 1]^k` to the left tape. -/ +theorem shift_E_right_01_0036 (k : Nat) (l r : ListBlank (Fin 2)) : + (l {{E}}> (([0, 1] : List (Fin 2)) ^ k +> r)) [target_tm]⊢* + ((l <+ ([0, 1] : List (Fin 2)) ^ k) {{E}}> r) := by + induction k generalizing l r with + | zero => + simp only [pow_zero_list, listblank_append_nil] + exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_append_right] + have h1 : (l {{E}}> ([0, 1] +> (([0, 1] : List (Fin 2)) ^ k +> r))) + [target_tm]⊢* + ((l <+ [0, 1]) {{E}}> (([0, 1] : List (Fin 2)) ^ k +> r)) := by + dsimp [ListBlank.append]; step; step; exact ⟨0, rfl⟩ + have h2 := ih (l <+ [0, 1]) r + rw [listblank_append_append, list_pow_append_one] at h2 + exact stepStar_trans h1 h2 + + + +/-- `<{{D}}` shifts leftward over `[1, 0]^k` in `2 * k` steps, writing `[1, + 0]^k` to the right tape. -/ +theorem shift_D_left_10_0036 (k : Nat) (l r : ListBlank (Fin 2)) : + ((l <+ ([1, 0] : List (Fin 2)) ^ k) <{{D}} r) [target_tm]⊢* + (l <{{D}} (([1, 0] : List (Fin 2)) ^ k +> r)) := by + induction k generalizing l r with + | zero => + simp only [pow_zero_list, listblank_append_nil] + exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_list, ← listblank_append_append] + have h1 : (((l <+ ([1, 0] : List (Fin 2)) ^ k) <+ [1, 0]) <{{D}} r) + [target_tm]⊢* + ((l <+ ([1, 0] : List (Fin 2)) ^ k) <{{D}} ([1, 0] +> r)) := by + dsimp [ListBlank.append]; step; step; exact ⟨0, rfl⟩ + have h2 := ih l (([1, 0] : List (Fin 2)) +> r) + rw [listblank_append_append, list_pow_append_one] at h2 + exact stepStar_trans h1 h2 + + + +theorem multiStep_step_isSome_0036 {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₀ cfg cfg' : Cfg Γ Λ) (n m : Nat) + (hn : multiStep M c₀ n = some cfg) + (hnm : multiStep M c₀ (n + (1 + m)) = some cfg') : + (step M cfg).isSome := by + rw [multiStep_add M c₀ n (1 + m), hn] at hnm + dsimp [Option.bind] at hnm + rw [multiStep_add M cfg 1 m, multiStep_one] at hnm + cases hs : step M cfg with + | none => + rw [hs] at hnm + nomatch hnm + | some c₁ => rfl + +theorem inv_reaches_beyond_0036 {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) {c_init : Cfg Γ Λ} (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, (c_init [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') + (N : Nat) : + ∃ (m : Nat) (cfg' : Cfg Γ Λ), multiStep M c_init (N + m) = some cfg' ∧ Inv cfg' := by + induction N with + | zero => + obtain ⟨cfg₀, ⟨n₀, hn₀⟩, h_inv₀⟩ := h_init + refine ⟨n₀, cfg₀, ?_, h_inv₀⟩ + rwa [Nat.zero_add] + | succ N ih => + obtain ⟨m, cfg₁, hm, h_inv₁⟩ := ih + cases m with + | zero => + obtain ⟨cfg₂, ⟨k, hk_pos, hk⟩, h_inv₂⟩ := h_step cfg₁ h_inv₁ + cases k with + | zero => omega + | succ k' => + refine ⟨k', cfg₂, ?_, h_inv₂⟩ + have h_trans := multiStep_trans M c_init cfg₁ cfg₂ N (k' + 1) hm hk + have h_eq : (N + 1) + k' = N + (k' + 1) := by omega + rwa [h_eq] + | succ m' => + refine ⟨m', cfg₁, ?_, h_inv₁⟩ + have h_eq : (N + 1) + m' = N + (m' + 1) := by omega + rwa [h_eq] + +theorem closed_inv_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) {c_init : Cfg Γ Λ} (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, (c_init [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') : + ∀ cfg : Cfg Γ Λ, (c_init [M]⊢* cfg) → (step M cfg).isSome := by + intro cfg ⟨n, hn⟩ + obtain ⟨m, cfg', hnm, _⟩ := inv_reaches_beyond_0036 M Inv h_init h_step (n + 1) + have h_eq : (n + 1) + m = n + (1 + m) := by omega + rw [h_eq] at hnm + exact multiStep_step_isSome_0036 M c_init cfg cfg' n m hn hnm + + +/-- `6`-step contextual leftward shift step of `<{{C}}` over `[1, + 0]` with 1-cell right lookahead `[0]`. -/ +theorem step_C_left_10_look0_0036 (l r : ListBlank (Fin 2)) : + ((l <+ [1, 0]) <{{C}} ([0] +> r)) [target_tm]⊢⁺ + (l <{{C}} ([0] +> ([0, 1] +> r))) := by + dsimp [ListBlank.append]; execute + +/-- `6 * k`-step contextual leftward shift of `<{{C}}` over `[1, + 0]^k` with 1-cell right lookahead `[0]`, +converting `[1, 0]^k` on the left stack into `[0, 1]^k` behind `[0]` on the right stack. -/ +theorem shift_C_left_10_look0_0036 (k : Nat) (l r : ListBlank (Fin 2)) : + ((l <+ ([1, 0] : List (Fin 2)) ^ k) <{{C}} ([0] +> r)) [target_tm]⊢* + (l <{{C}} ([0] +> (([0, 1] : List (Fin 2)) ^ k +> r))) := by + induction k generalizing l r with + | zero => + simp only [pow_zero_list, listblank_append_nil] + exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_list, ← listblank_append_append] + have h1 := stepPlus_stepStar (step_C_left_10_look0_0036 (l <+ ([1, 0] : List (Fin 2)) ^ k) r) + have h2 := ih l (([0, 1] : List (Fin 2)) +> r) + rw [pow_succ_append_right' ([0, 1] : List (Fin 2)) k r] at h2 + exact stepStar_trans h1 h2 + +-- ============================================================================ +-- Section 16: 2-Mode Stack Configuration Model & 7 Macro Transitions (`m0036`) +-- ============================================================================ + +inductive RItem + | item00 (d c : Nat) + | item01 (d c : Nat) + +def encL : List Nat → ListBlank (Fin 2) + | [] => default + | c :: cs => ((encL cs) <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ c) + +def encR : List RItem → ListBlank (Fin 2) + | [] => [1, 0, 0, 1] +> default + | .item00 d c :: rs => + (([1, 0] : List (Fin 2)) ^ d) +> ([0, 0] +> ((([0, 1] : List (Fin 2)) ^ c) +> encR rs)) + | .item01 d c :: rs => + (([1, 0] : List (Fin 2)) ^ d) +> ((([0, 1] : List (Fin 2)) ^ (c + 1)) +> encR rs) + +def cfgC (cs : List Nat) (rs : List RItem) : Cfg (Fin 2) (Fin 6) := + (encL cs) <{{C}} ([0] +> encR rs) + +def cfgD (cs : List Nat) (c : Nat) (rs : List RItem) : Cfg (Fin 2) (Fin 6) := + (encL cs) <{{D}} ([0, 0] +> ((([0, 1] : List (Fin 2)) ^ c) +> encR rs)) + +def cfgE (cs : List Nat) (c : Nat) (rs : List RItem) : Cfg (Fin 2) (Fin 6) := + ((encL cs) <+ (([0, 1] : List (Fin 2)) ^ (c + 1))) {{E}}> encR rs + +theorem list_one_append_01_pow (k : Nat) : + ([1] : List (Fin 2)) ++ (([0, 1] : List (Fin 2)) ^ k) = (([1, 0] : List (Fin 2)) ^ k) ++ [1] := + by + induction k with + | zero => rfl + | succ k ih => + rw [pow_succ_list, pow_succ_list] + rw [← List.append_assoc ([1] : List (Fin 2)) [0, 1], List.append_assoc ([1, 0] : List (Fin 2))] + change ([1, 0] : List (Fin 2)) ++ ([1] ++ ([0, 1] : List (Fin 2)) ^ k) = + ([1, 0] : List (Fin 2)) ++ ((([1, 0] : List (Fin 2)) ^ k) ++ [1]) + rw [ih] + +theorem cfgE_left_append_one (cs : List Nat) (c : Nat) : + (((encL cs) <+ (([0, 1] : List (Fin 2)) ^ (c + 1))) <+ [1]) = encL ((c + 1) :: cs) := by + change (((encL cs) <+ (([0, 1] : List (Fin 2)) ^ (c + 1))) <+ [1]) = + ((encL cs) <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ (c + 1)) + rw [listblank_append_append, listblank_append_append, list_one_append_01_pow] + +theorem shift_E_01_succ (l : ListBlank (Fin 2)) (c : Nat) (r : ListBlank (Fin 2)) : + ((l <+ [0, 1]) {{E}}> ((([0, 1] : List (Fin 2)) ^ c) +> r)) [target_tm]⊢* + ((l <+ (([0, 1] : List (Fin 2)) ^ (c + 1))) {{E}}> r) := by + have h := shift_E_right_01_0036 c (l <+ [0, 1]) r + rw [listblank_append_append, list_pow_append_one] at h + exact h + +theorem init_to_step25 : (init []) [target_tm]⊢* cfgD [] 1 [] := by + apply stepPlus_stepStar + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{D}}> default) := rfl + rw [h_init] + dsimp [cfgD, encL, encR, ListBlank.append] + step; step; step; step; step; step; step; step; step; step; step; step; step; step; step; step; + step; step; step; step; step; step; step; step; step; exact ⟨0, rfl⟩ + +theorem step_D0_base (r : ListBlank (Fin 2)) : + (default <{{D}} ([0, 0] +> r)) [target_tm]⊢⁺ + (((encL [1]) <+ [0, 1]) {{E}}> r) := by + dsimp [encL, ListBlank.append] + step; step; step; step; step; step; step; step; step; step; step; exact ⟨0, rfl⟩ + +theorem step_D0 (c : Nat) (rs : List RItem) : + (cfgD [] c rs) [target_tm]⊢⁺ (cfgE [1] c rs) := by + dsimp [cfgD, cfgE] + exact stepPlus_stepStar_stepPlus + (step_D0_base ((([0, 1] : List (Fin 2)) ^ c) +> encR rs)) + (shift_E_01_succ (encL [1]) c (encR rs)) + +theorem step_D_one_to_C (l r : ListBlank (Fin 2)) : + ((l <+ [1]) <{{D}} r) [target_tm]⊢⁺ (l <{{C}} ([0] +> r)) := by + dsimp [ListBlank.append]; step; exact ⟨0, rfl⟩ + +theorem step_D_cons_to_C (d : Nat) (cs : List Nat) (c : Nat) (rs : List RItem) : + (cfgD (d :: cs) c rs) [target_tm]⊢⁺ (cfgC cs (.item00 d c :: rs)) := by + dsimp [cfgD, cfgC, encL, encR] + exact stepStar_stepPlus_stepPlus + (shift_D_left_10_0036 d ((encL cs) <+ [1]) ([0, 0] +> ((([0, + 1] : List (Fin 2)) ^ c) +> encR rs))) + (step_D_one_to_C (encL cs) ((([1, 0] : List (Fin 2)) ^ d) +> ([0, 0] +> ((([0, + 1] : List (Fin 2)) ^ c) +> encR rs)))) + +theorem step_C_one_to_D (l r : ListBlank (Fin 2)) : + ((l <+ [1]) <{{C}} ([0] +> r)) [target_tm]⊢⁺ (l <{{D}} ([0, 0] +> r)) := by + dsimp [ListBlank.append]; step; exact ⟨0, rfl⟩ + +theorem step_C_cons_to_D (c' : Nat) (cs : List Nat) (rs : List RItem) : + (cfgC (c' :: cs) rs) [target_tm]⊢⁺ (cfgD cs c' rs) := by + dsimp [cfgC, cfgD, encL] + exact stepStar_stepPlus_stepPlus + (shift_C_left_10_look0_0036 c' ((encL cs) <+ [1]) (encR rs)) + (step_C_one_to_D (encL cs) ((([0, 1] : List (Fin 2)) ^ c') +> encR rs)) + +theorem step_D2 (d c' : Nat) (cs : List Nat) (c : Nat) (rs : List RItem) : + (cfgD (d :: c' :: cs) c rs) [target_tm]⊢⁺ (cfgD cs c' (.item00 d c :: rs)) := + stepPlus_trans (step_D_cons_to_C d (c' :: cs) c rs) (step_C_cons_to_D c' cs (.item00 d c :: rs)) + +theorem step_C_nil_to_A (r : ListBlank (Fin 2)) : + (default <{{C}} ([0] +> r)) [target_tm]⊢⁺ (((default <+ [1]) <+ [1, 0]) {{A}}> r) := by + dsimp [ListBlank.append]; step; step; step; step; exact ⟨0, rfl⟩ + +theorem step_A_00_to_D (l r : ListBlank (Fin 2)) : + (l {{A}}> ([0, 0] +> r)) [target_tm]⊢⁺ (l <{{D}} ([0, 1] +> r)) := by + dsimp [ListBlank.append]; step; step; step; exact ⟨0, rfl⟩ + +theorem step_D_1_bounce_to_A (r : ListBlank (Fin 2)) : + ((default <+ [1]) <{{D}} r) [target_tm]⊢⁺ ((default <+ [1]) {{A}}> ([1, 0] +> r)) := by + dsimp [ListBlank.append]; step; step; step; exact ⟨0, rfl⟩ + +theorem step_A_01_to_E (l r : ListBlank (Fin 2)) : + (l {{A}}> ([0, 1] +> r)) [target_tm]⊢⁺ ((l <+ [0, 1]) {{E}}> r) := by + dsimp [ListBlank.append]; step; step; exact ⟨0, rfl⟩ + +theorem step_C_nil_item00_to_E (d c : Nat) (rs : List RItem) : + (cfgC [] (.item00 d c :: rs)) [target_tm]⊢⁺ (cfgE [d + 2] c rs) := by + dsimp [cfgC, cfgE, encL, encR] + have h1 := + step_C_nil_to_A ((([1, 0] : List (Fin 2)) ^ d) +> ([0, 0] +> ((([0, + 1] : List (Fin 2)) ^ c) +> encR rs))) + have h2 := + shift_A_right_10_0036 d ((default <+ [1]) <+ [1, 0]) ([0, 0] +> ((([0, + 1] : List (Fin 2)) ^ c) +> encR rs)) + rw [pow_succ_append_right' ([1, 0] : List (Fin 2)) d (default <+ [1])] at h2 + have h3 := + step_A_00_to_D ((default <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ (d + 1))) ((([0, + 1] : List (Fin 2)) ^ c) +> encR rs) + have h4 := + shift_D_left_10_0036 (d + 1) (default <+ [1]) ([0, 1] +> ((([0, + 1] : List (Fin 2)) ^ c) +> encR rs)) + have h5 := + step_D_1_bounce_to_A ((([1, 0] : List (Fin 2)) ^ (d + 1)) +> ([0, 1] +> ((([0, + 1] : List (Fin 2)) ^ c) +> encR rs))) + rw [← pow_succ_append_right ([1, 0] : List (Fin 2)) (d + 1)] at h5 + have h6 := + shift_A_right_10_0036 (d + 2) (default <+ [1]) ([0, 1] +> ((([0, + 1] : List (Fin 2)) ^ c) +> encR rs)) + have h7 := + step_A_01_to_E ((default <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ (d + 2))) ((([0, + 1] : List (Fin 2)) ^ c) +> encR rs) + have h8 := shift_E_01_succ ((default <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ (d + 2))) c (encR rs) + exact stepPlus_stepStar_stepPlus + (stepPlus_trans + (stepPlus_stepStar_stepPlus + (stepPlus_trans + (stepPlus_trans + (stepPlus_stepStar_stepPlus h1 h2) + h3) + (stepStar_stepPlus_stepPlus h4 h5)) + h6) + h7) + h8 + +theorem step_D1 (d c : Nat) (rs : List RItem) : + (cfgD [d] c rs) [target_tm]⊢⁺ (cfgE [d + 2] c rs) := + stepPlus_trans (step_D_cons_to_C d [] c rs) (step_C_nil_item00_to_E d c rs) + +theorem step_E0_base (l : ListBlank (Fin 2)) : + (l {{E}}> ([1, 0, 0, 1] +> default)) [target_tm]⊢⁺ + ((l <+ [1]) <{{D}} ([0, 0] +> ([1, 0, 0, 1] +> default))) := by + dsimp [ListBlank.append] + step; step; step; step; step; step; step; step; step; step; step; step; exact ⟨0, rfl⟩ + +theorem step_E0 (cs : List Nat) (c : Nat) : + (cfgE cs c []) [target_tm]⊢⁺ (cfgD ((c + 1) :: cs) 0 []) := by + unfold cfgE cfgD encR + simp only [pow_zero_list, listblank_append_nil] + have h := step_E0_base ((encL cs) <+ (([0, 1] : List (Fin 2)) ^ (c + 1))) + rw [cfgE_left_append_one cs c] at h + exact h + +theorem step_E_10_to_A (l r : ListBlank (Fin 2)) : + (l {{E}}> ([1, 0] +> r)) [target_tm]⊢⁺ (((l <+ [1]) <+ [1]) {{A}}> r) := by + dsimp [ListBlank.append]; step; step; exact ⟨0, rfl⟩ + +theorem step_E_10_pow_succ_to_A (cs : List Nat) (c d : Nat) (r : ListBlank (Fin 2)) : + (((encL cs) <+ (([0, 1] : List (Fin 2)) ^ (c + 1))) {{E}}> ((([1, + 0] : List (Fin 2)) ^ (d + 1)) +> r)) [target_tm]⊢⁺ + ((encL (d :: (c + 1) :: cs)) {{A}}> r) := by + rw [pow_succ_append_right ([1, 0] : List (Fin 2)) d r] + have h1 := + step_E_10_to_A ((encL cs) <+ (([0, 1] : List (Fin 2)) ^ (c + 1))) ((([1, + 0] : List (Fin 2)) ^ d) +> r) + rw [cfgE_left_append_one cs c] at h1 + have h2 := shift_A_right_10_0036 d ((encL ((c + 1) :: cs)) <+ [1]) r + exact stepPlus_stepStar_stepPlus h1 h2 + +theorem step_E_item00_to_C (cs : List Nat) (c d c₂ : Nat) (rs : List RItem) : + (cfgE cs c (.item00 (d + 1) c₂ :: rs)) [target_tm]⊢⁺ (cfgC ((c + 1) :: cs) (.item01 d c₂ :: + rs)) := by + dsimp [cfgE, cfgC, encR] + have h1 := step_E_10_pow_succ_to_A cs c d ([0, 0] +> ((([0, 1] : List (Fin 2)) ^ c₂) +> encR rs)) + have h2 := step_A_00_to_D (encL (d :: (c + 1) :: cs)) ((([0, 1] : List (Fin 2)) ^ c₂) +> encR rs) + rw [← pow_succ_append_right ([0, 1] : List (Fin 2)) c₂ (encR rs)] at h2 + dsimp [encL] at h2 + have h3 := + shift_D_left_10_0036 d ((encL ((c + 1) :: cs)) <+ [1]) ((([0, + 1] : List (Fin 2)) ^ (c₂ + 1)) +> encR rs) + have h4 := + step_D_one_to_C (encL ((c + 1) :: cs)) ((([1, 0] : List (Fin 2)) ^ d) +> ((([0, + 1] : List (Fin 2)) ^ (c₂ + 1)) +> encR rs)) + exact stepPlus_trans + (stepPlus_stepStar_stepPlus (stepPlus_trans h1 h2) h3) + h4 + +theorem step_E1 (cs : List Nat) (c d c₂ : Nat) (rs : List RItem) : + (cfgE cs c (.item00 (d + 1) c₂ :: rs)) [target_tm]⊢⁺ (cfgD cs (c + 1) (.item01 d c₂ :: rs)) := + stepPlus_trans (step_E_item00_to_C cs c d c₂ rs) (step_C_cons_to_D (c + 1) cs (.item01 d c₂ :: + rs)) + +theorem step_E_01_one (l r : ListBlank (Fin 2)) : + (l {{E}}> ([0, 1] +> r)) [target_tm]⊢⁺ ((l <+ [0, 1]) {{E}}> r) := by + dsimp [ListBlank.append]; step; step; exact ⟨0, rfl⟩ + +theorem step_E2 (cs : List Nat) (c c₂ : Nat) (rs : List RItem) : + (cfgE cs c (.item01 0 c₂ :: rs)) [target_tm]⊢⁺ (cfgE cs (c + c₂ + 1) rs) := by + dsimp [cfgE, encR] + have h1 := + step_E_01_one ((encL cs) <+ (([0, 1] : List (Fin 2)) ^ (c + 1))) ((([0, + 1] : List (Fin 2)) ^ c₂) +> encR rs) + have h2 := shift_E_01_succ ((encL cs) <+ (([0, 1] : List (Fin 2)) ^ (c + 1))) c₂ (encR rs) + rw [← pow_add_append_left (encL cs) ([0, 1] : List (Fin 2)) (c + 1) (c₂ + 1)] at h2 + have h_eq : (c + 1) + (c₂ + 1) = c + c₂ + 1 + 1 := by omega + rw [h_eq] at h2 + exact stepPlus_stepStar_stepPlus h1 h2 + +theorem step_E3 (cs : List Nat) (c d c₂ : Nat) (rs : List RItem) : + (cfgE cs c (.item01 (d + 1) c₂ :: rs)) [target_tm]⊢⁺ (cfgE (d :: (c + 1) :: cs) c₂ rs) := by + dsimp [cfgE, encR] + have h1 := step_E_10_pow_succ_to_A cs c d ((([0, 1] : List (Fin 2)) ^ (c₂ + 1)) +> encR rs) + rw [pow_succ_append_right ([0, 1] : List (Fin 2)) c₂ (encR rs)] at h1 + have h2 := step_A_01_to_E (encL (d :: (c + 1) :: cs)) ((([0, 1] : List (Fin 2)) ^ c₂) +> encR rs) + have h3 := shift_E_01_succ (encL (d :: (c + 1) :: cs)) c₂ (encR rs) + exact stepPlus_stepStar_stepPlus (stepPlus_trans h1 h2) h3 + +theorem init_to_cfgD : (init []) [target_tm]⊢* cfgD [10, 7] 0 [] := by + have s0 := init_to_step25 + have s1 := stepPlus_stepStar (step_D0 1 []) + have s2 := stepPlus_stepStar (step_E0 [1] 1) + have s3 := stepPlus_stepStar (step_D2 2 1 [] 0 []) + have s4 := stepPlus_stepStar (step_D0 1 [.item00 2 0]) + have s5 := stepPlus_stepStar (step_E1 [1] 1 1 0 []) + have s6 := stepPlus_stepStar (step_D1 1 2 [.item01 1 0]) + have s7 := stepPlus_stepStar (step_E3 [3] 2 0 0 []) + have s8 := stepPlus_stepStar (step_E0 [0, 3, 3] 0) + have s9 := stepPlus_stepStar (step_D2 1 0 [3, 3] 0 []) + have s10 := stepPlus_stepStar (step_D2 3 3 [] 0 [.item00 1 0]) + have s11 := stepPlus_stepStar (step_D0 3 [.item00 3 0, .item00 1 0]) + have s12 := stepPlus_stepStar (step_E1 [1] 3 2 0 [.item00 1 0]) + have s13 := stepPlus_stepStar (step_D1 1 4 [.item01 2 0, .item00 1 0]) + have s14 := stepPlus_stepStar (step_E3 [3] 4 1 0 [.item00 1 0]) + have s15 := stepPlus_stepStar (step_E1 [1, 5, 3] 0 0 0 []) + have s16 := stepPlus_stepStar (step_D2 1 5 [3] 1 [.item01 0 0]) + have s17 := stepPlus_stepStar (step_D1 3 5 [.item00 1 1, .item01 0 0]) + have s18 := stepPlus_stepStar (step_E1 [5] 5 0 1 [.item01 0 0]) + have s19 := stepPlus_stepStar (step_D1 5 6 [.item01 0 1, .item01 0 0]) + have s20 := stepPlus_stepStar (step_E2 [7] 6 1 [.item01 0 0]) + have s21 := stepPlus_stepStar (step_E2 [7] 8 0 []) + have s22 := stepPlus_stepStar (step_E0 [7] 9) + exact stepStar_trans s0 (stepStar_trans s1 (stepStar_trans s2 (stepStar_trans s3 (stepStar_trans + s4 + (stepStar_trans s5 (stepStar_trans s6 (stepStar_trans s7 (stepStar_trans s8 (stepStar_trans s9 + (stepStar_trans s10 (stepStar_trans s11 (stepStar_trans s12 (stepStar_trans s13 (stepStar_trans + s14 + (stepStar_trans s15 (stepStar_trans s16 (stepStar_trans s17 (stepStar_trans s18 (stepStar_trans + s19 + (stepStar_trans s20 (stepStar_trans s21 s22))))))))))))))))))))) + +-- ============================================================================ +-- Section 17: Step-0 Closed Invariant and Non-Halting Proof +-- ============================================================================ + +abbrev condC (rem re rc c : Nat) : Prop := + c + rem > 2 * re ∨ (re = rc ∧ re > 0) + + + +def remSweeps : List RItem → Nat + | [] => 0 + | .item00 _ _ :: rs => 2 * remSweeps rs + 1 + | .item01 _ _ :: rs => 2 * remSweeps rs + +def remE : List RItem → Nat + | [] => 0 + | .item00 d _ :: rs => if d > 2 * remSweeps rs + 1 then 2 * remE rs + 1 else remE rs + | .item01 d _ :: rs => if d > 2 * remSweeps rs then 2 * remE rs + 1 else remE rs + +def remC : List RItem → Nat + | [] => 0 + | .item00 d c :: rs => + if d > 2 * remSweeps rs + 1 ∧ + condC (remSweeps rs) (remE rs) (remC rs) c then 2 * remC rs + 1 else remC rs + | .item01 d c :: rs => + if d > 2 * remSweeps rs ∧ + condC (remSweeps rs) (remE rs) (remC rs) c then 2 * remC rs + 1 else remC rs + +def lastD : List RItem → Nat + | [] => 0 + | .item00 d _ :: rs => + if d > 2 * remSweeps rs + 1 then max (d - 2 - 2 * remSweeps rs) (2 * remE rs + 1) else lastD + rs + | .item01 d _ :: rs => + if d > 2 * remSweeps rs then max (d - 1 - 2 * remSweeps rs) (2 * remE rs + 1) else lastD rs + +def remCC : List RItem → Nat + | [] => 0 + | .item00 d c :: rs => + if d > 2 * remSweeps rs + 1 ∧ condC (remSweeps rs) (remE rs) (remC rs) c ∧ + condC (remE rs) (remC rs) (remCC rs) (lastD rs) + then 2 * remCC rs + 1 else remCC rs + | .item01 d c :: rs => + if d > 2 * remSweeps rs ∧ condC (remSweeps rs) (remE rs) (remC rs) c ∧ + condC (remE rs) (remC rs) (remCC rs) (lastD rs) + then 2 * remCC rs + 1 else remCC rs + +theorem rem_bounds (rs : List RItem) : + (remE rs = 0 ∧ remC rs = 0 ∧ remCC rs = 0 ∧ lastD rs = 0) ∨ + (remE rs = remC rs ∧ 2 * remCC rs + 1 ≤ remE rs ∧ lastD rs ≥ remE rs ∧ + ∃ m : Nat, remE rs = 2 * remCC rs + 1 + m * (2 * remCC rs + 2)) ∨ + (2 * remC rs + 1 ≤ remE rs ∧ remCC rs = remC rs ∧ lastD rs ≥ remE rs ∧ + ∃ m : Nat, remE rs = 2 * remC rs + 1 + m * (2 * remC rs + 2)) := by + induction rs with + | nil => exact Or.inl ⟨rfl, rfl, rfl, rfl⟩ + | cons item rs ih => + rcases ih with ⟨h1, h2, h3, h4⟩ | ⟨h1, h2, h3, m, hm⟩ | ⟨h1, h2, h3, m, hm⟩ + · rcases item with ⟨d, c⟩ | ⟨d, c⟩ <;> + dsimp [remE, remC, remCC, lastD, condC] <;> + split_ifs + all_goals try (exact Or.inl ⟨by omega, by omega, by omega, by omega⟩) + all_goals try (exact Or.inr (Or.inl ⟨by omega, by omega, by omega, 0, by omega⟩)) + all_goals try (exact Or.inr (Or.inr ⟨by omega, by omega, by omega, 0, by omega⟩)) + · have h_mul1 : m * (2 * (2 * remCC rs + 1) + 2) = 2 * (m * (2 * remCC rs + 2)) := by ring + have h_mul2 : (2 * m + 1) * (2 * remCC rs + 2) = + 2 * (m * (2 * remCC rs + 2)) + (2 * remCC rs + 2) := by ring + rcases item with ⟨d, c⟩ | ⟨d, c⟩ <;> + dsimp [remE, remC, remCC, lastD, condC] <;> + split_ifs + all_goals try (exact Or.inr (Or.inl ⟨by omega, by omega, by omega, m, by omega⟩)) + all_goals try (exact Or.inr (Or.inl ⟨by omega, by omega, by omega, 2 * m + 1, by omega⟩)) + · have h_mul1 : m * (2 * (2 * remC rs + 1) + 2) = 2 * (m * (2 * remC rs + 2)) := by ring + have h_mul2 : (2 * m + 1) * (2 * remC rs + 2) = + 2 * (m * (2 * remC rs + 2)) + (2 * remC rs + 2) := by ring + rcases item with ⟨d, c⟩ | ⟨d, c⟩ <;> + dsimp [remE, remC, remCC, lastD, condC] <;> + split_ifs + all_goals try (exact Or.inr (Or.inr ⟨by omega, by omega, by omega, m, by omega⟩)) + all_goals try (exact Or.inr (Or.inr ⟨by omega, by omega, by omega, 2 * m + 1, by omega⟩)) + +theorem mul_bound (m x : Nat) : m * x = 0 ∨ m * x ≥ x := by + rcases m with _ | m' + · left; ring + · right; have : (m' + 1) * x = m' * x + x := by ring + omega + +def validC (re rc x : Nat) : Prop := + if 2 * rc + 1 ≤ re then + ∃ k : Nat, x = 2 * re + 1 + k * (2 * rc + 2) + else + (re = 0 ∧ x = 1) ∨ x = 4 * re + 3 ∨ (re = 0 ∧ x = 4) ∨ x ≥ 6 * re + 5 + +def validD (rem re rc c d : Nat) : Prop := + if 2 * rc + 1 ≤ re then + d = 2 * rem + 2 * re + 3 ∨ d ≥ 2 * rem + 4 * re + 5 + else + d = 2 * rem + 1 ∨ + (rem = 0 ∧ re = 0 ∧ c = 0 ∧ d ≥ 3) ∨ + (condC rem re rc c ∧ ∃ k : Nat, d = 2 * rem + 2 * re + 3 + k * (2 * re + 2)) + +def above00 (rem re rc x : Nat) : Prop := + (re = 0 ∧ x > 0) ∨ x + 2 * rem > 2 * re + 2 * rc + 1 + +def above01 (rem re rc x : Nat) : Prop := + (re = 0 ∧ x > 1) ∨ x + 2 * rem > 2 * re + 2 * rc + 2 + +def validBase (re rc x : Nat) : Prop := + if 2 * rc + 1 ≤ re then + x + 1 = 2 * re + else + ∃ k : Nat, x = 4 * re + 1 + k * (2 * re + 2) + +def GoodCSD (rem re rc c : Nat) : List Nat → Prop + | [] => + rem ≥ re ∧ (rem > 0 ∨ c = 0) ∧ (re = 0 ∨ c + rem > 2 * re) ∧ + (rem = 0 ∨ validBase re rc (2 * rem - 1)) + | [d] => (re = 0 ∨ c + rem > 2 * re) ∧ validBase re rc (d + 2 * rem) + | d :: cp :: cs => + let rem_n := 2 * rem + 1 + let re_n := if d > 2 * rem + 1 then 2 * re + 1 else re + let rc_n := if d > 2 * rem + 1 ∧ condC rem re rc c then 2 * rc + 1 else rc + validD rem re rc c d ∧ + (d > 2 * rem + 1 ∨ above00 rem re rc cp) ∧ + validC re_n rc_n (cp + rem_n + 1) ∧ + GoodCSD rem_n re_n rc_n cp cs + +def topAbove (c : Nat) : List RItem → Prop + | [] => True + | .item00 d _ :: rs => d > 2 * remSweeps rs + 1 ∨ above00 (remSweeps rs) (remE rs) (remC rs) c + | .item01 d _ :: rs => d > 2 * remSweeps rs ∨ above01 (remSweeps rs) (remE rs) (remC rs) c + +def P01 (d c : Nat) (rs : List RItem) : Prop := + validD (remSweeps rs) (remE rs) (remC rs) c (d + 1) ∧ + validC (remE rs) (remC rs) (c + remSweeps rs + 1) ∧ + topAbove c rs + +def GoodRS : List RItem → Prop + | [] => True + | .item00 d c :: rs => d ≥ 1 ∧ P01 (d - 1) c rs ∧ GoodRS rs + | .item01 d c :: rs => P01 d c rs ∧ GoodRS rs + +def InvD (cs : List Nat) (c : Nat) (rs : List RItem) : Prop := + GoodRS rs ∧ + topAbove c rs ∧ + validC (remE rs) (remC rs) (c + remSweeps rs + 1) ∧ + GoodCSD (remSweeps rs) (remE rs) (remC rs) c cs + +def InvE (cs : List Nat) (c : Nat) (rs : List RItem) : Prop := + GoodRS rs ∧ + topAbove c rs ∧ + cs ≠ [] ∧ + if remSweeps rs = 0 then + GoodCSD (remE rs) (remC rs) (remCC rs) (lastD rs) ((c + 1) :: cs) + else + validC (remE rs) (remC rs) ((c + 1) + (remSweeps rs - 1) + 1) ∧ + GoodCSD (remSweeps rs - 1) (remE rs) (remC rs) (c + 1) cs + +theorem validC_to_validD (rs : List RItem) (x : Nat) (h : validC (remE rs) (remC rs) x) : + validD (remE rs) (remC rs) (remCC rs) (lastD rs) x := by + have hb := rem_bounds rs + dsimp [validC, validD, condC] at h ⊢ + rcases hb with ⟨h1, h2, h3, h4⟩ | ⟨h1, h2, h3, m, hm⟩ | ⟨h1, h2, h3, m, hm⟩ + · split_ifs at h ⊢ <;> omega + · split_ifs at h ⊢ <;> omega + · rw [ite_eq_left h1] at h + have h_not : ¬(2 * remCC rs + 1 ≤ remC rs) := by omega + rw [ite_eq_right h_not] + rcases h with ⟨k, hk⟩ + rcases k with _ | k' + · left; omega + · right; right + have h_mul : (k' + 1) * (2 * remC rs + 2) = k' * (2 * remC rs + 2) + (2 * remC rs + 2) := by + ring + refine ⟨by omega, k', by omega⟩ + +theorem validBase_next (rs : List RItem) (c d' : Nat) + (h_vc : validC (remE rs) (remC rs) (c + 1)) + (h_c : remE rs = 0 ∨ c > 2 * remE rs) + (h_d' : (remE rs = 0 ∧ c = 0 ∧ d' = 1) ∨ (d' ≥ 4 * remC rs + 3 ∧ d' ≥ 2 * remE rs + 1)) : + let rem_n := 2 * remE rs + 1 + let re_n := if c + 1 > 2 * remE rs + 1 then 2 * remC rs + 1 else remC rs + let rc_n := + if c + 1 > 2 * remE rs + 1 ∧ + condC (remE rs) (remC rs) (remCC rs) (lastD rs) then 2 * remCC rs + 1 else remCC rs + rem_n ≥ re_n ∧ (rem_n > 0 ∨ d' = 0) ∧ (re_n = 0 ∨ d' + rem_n > 2 * re_n) ∧ + (rem_n = 0 ∨ validBase re_n rc_n (2 * rem_n - 1)) := by + have hb := rem_bounds rs + dsimp [validBase, validC, condC] at h_vc h_c ⊢ + rcases hb with ⟨h1, h2, h3, h4⟩ | ⟨h1, h2, h3, m, hm⟩ | ⟨h1, h2, h3, m, hm⟩ + · split_ifs + all_goals try omega + all_goals try (exact ⟨by omega, by omega, by omega, Or.inr ⟨0, by omega⟩⟩) + · have h_not : ¬(2 * remC rs + 1 ≤ remE rs) := by omega + rw [ite_eq_right h_not] at h_vc + split_ifs <;> omega + · rw [ite_eq_left h1] at h_vc + have h_mul : (2 * m) * (2 * (2 * remC rs + 1) + 2) = 4 * (m * (2 * remC rs + 2)) := by ring + split_ifs + all_goals try omega + all_goals (exact ⟨by omega, by omega, by omega, Or.inr ⟨2 * m, by omega⟩⟩) + +theorem validBase_to_validC (rs : List RItem) (c d : Nat) + (h_vc : validC (remE rs) (remC rs) (c + 1)) + (h_c : remE rs = 0 ∨ c > 2 * remE rs) + (h : validBase (remE rs) (remC rs) d) : + let rem_n := 2 * remE rs + 1 + let re_n := if c + 1 > 2 * remE rs + 1 then 2 * remC rs + 1 else remC rs + let rc_n := + if c + 1 > 2 * remE rs + 1 ∧ + condC (remE rs) (remC rs) (remCC rs) (lastD rs) then 2 * remCC rs + 1 else remCC rs + validC re_n rc_n ((d + 2) + rem_n + 1) ∧ + ((remE rs = 0 ∧ c = 0 ∧ d + 2 = 1) ∨ (d + 2 ≥ 4 * remC rs + 3 ∧ d + 2 ≥ 2 * remE rs + 1)) := by + have hb := rem_bounds rs + dsimp [validBase, validC, condC] at h_vc h_c h ⊢ + rcases hb with ⟨h1, h2, h3, h4⟩ | ⟨h1, h2, h3, m, hm⟩ | ⟨h1, h2, h3, m, hm⟩ + · have h_not : ¬(2 * remC rs + 1 ≤ remE rs) := by omega + rw [ite_eq_right h_not] at h_vc h + rcases h with ⟨k, hk⟩ + rw [h1] at hk + rw [h1, h2, h3] + split_ifs + all_goals try omega + all_goals try (exact ⟨⟨k + 1, by omega⟩, by omega⟩) + · have h_not : ¬(2 * remC rs + 1 ≤ remE rs) := by omega + rw [ite_eq_right h_not] at h_vc h + rcases h with ⟨k, hk⟩ + have h_mul1 : ((k + 1) * (m + 1)) * (2 * (2 * remCC rs + 1) + 2) = + k * (2 * (2 * remCC rs + 1 + m * (2 * remCC rs + 2)) + 2) + (2 * (2 * remCC rs + 1 + m * (2 + * remCC rs + 2)) + 2) := by ring + have h_mul2 : ((k + 1) * (2 * m + 2)) * (2 * remCC rs + 2) = + k * (2 * (2 * remCC rs + 1 + m * (2 * remCC rs + 2)) + 2) + (2 * (2 * remCC rs + 1 + m * (2 + * remCC rs + 2)) + 2) := by ring + rw [← hm] at h_mul1 h_mul2 + have hk_b := mul_bound k (2 * remE rs + 2) + split_ifs + all_goals try omega + all_goals try (exact ⟨⟨(k + 1) * (m + 1), by omega⟩, by omega⟩) + all_goals try (exact ⟨⟨(k + 1) * (2 * m + 2), by omega⟩, by omega⟩) + · rw [ite_eq_left h1] at h_vc h + rcases h_vc with ⟨kc, hkc⟩ + have hm_b := mul_bound m (2 * remC rs + 2) + have hkc_b := mul_bound kc (2 * remC rs + 2) + split_ifs <;> refine ⟨by omega, by omega⟩ + +theorem validD_zero_to_step (rs : List RItem) (c₂ d : Nat) + (h_vd : validD 0 (remE rs) (remC rs) c₂ (d + 2)) + (h_vc2 : validC (remE rs) (remC rs) (c₂ + 1)) : + let rem_n := 2 * remE rs + 1 + let re_n := if c₂ + 1 > 2 * remE rs + 1 then 2 * remC rs + 1 else remC rs + let rc_n := + if c₂ + 1 > 2 * remE rs + 1 ∧ + condC (remE rs) (remC rs) (remCC rs) (lastD rs) then 2 * remCC rs + 1 else remCC rs + above00 (remE rs) (remC rs) (remCC rs) d ∧ + validC re_n rc_n (d + rem_n + 1) := by + have hb := rem_bounds rs + dsimp [validD, validC, above00, condC] at h_vd h_vc2 ⊢ + rcases hb with ⟨h1, h2, h3, h4⟩ | ⟨h1, h2, h3, m, hm⟩ | ⟨h1, h2, h3, m, hm⟩ + · have h_not : ¬(2 * remC rs + 1 ≤ remE rs) := by omega + rw [ite_eq_right h_not] at h_vd h_vc2 + rcases h_vd with h_d1 | ⟨_, _, h_c0, h_ge3⟩ | ⟨h_cond, k, hk⟩ + · omega + · split_ifs <;> refine ⟨by omega, by omega⟩ + · rw [h1] at hk + rw [h1, h2, h3] + split_ifs + all_goals try (exact ⟨by omega, k, by omega⟩) + all_goals (refine ⟨by omega, by omega⟩) + · have h_not : ¬(2 * remC rs + 1 ≤ remE rs) := by omega + rw [ite_eq_right h_not] at h_vd h_vc2 + rcases h_vd with h_d1 | ⟨_, h_re0, _, _⟩ | ⟨h_cond, k, hk⟩ + · omega + · omega + · have h_mul1 : (k * (m + 1)) * (2 * (2 * remCC rs + 1) + 2) = + k * (2 * (2 * remCC rs + 1 + m * (2 * remCC rs + 2)) + 2) := by ring + have h_mul2 : (k * (2 * m + 2)) * (2 * remCC rs + 2) = + k * (2 * (2 * remCC rs + 1 + m * (2 * remCC rs + 2)) + 2) := by ring + rw [← hm] at h_mul1 h_mul2 + have hk_b := mul_bound k (2 * remE rs + 2) + split_ifs + all_goals try omega + all_goals try (exact ⟨by omega, k * (m + 1), by omega⟩) + all_goals try (exact ⟨by omega, k * (2 * m + 2), by omega⟩) + · rw [ite_eq_left h1] at h_vd h_vc2 + rcases h_vc2 with ⟨kc, hkc⟩ + have hm_b := mul_bound m (2 * remC rs + 2) + have hkc_b := mul_bound kc (2 * remC rs + 2) + split_ifs <;> refine ⟨by omega, by omega⟩ + +theorem topAbove_mono {c₁ c₂ : Nat} (rs : List RItem) (h_le : c₁ ≤ c₂) (h : topAbove c₁ rs) : + topAbove c₂ rs := by + cases rs with + | nil => trivial + | cons item rs' => + cases item <;> { + dsimp [topAbove, above00, above01] at h ⊢ + omega + } + +theorem inv_init : InvD [10, 7] 0 [] := by + dsimp [InvD, GoodRS, topAbove, validC, GoodCSD, remSweeps, remE, remC, condC, validD, validBase] + refine ⟨trivial, trivial, Or.inl ⟨rfl, rfl⟩, Or.inr (Or.inl ⟨rfl, rfl, rfl, by omega⟩), + Or.inl (by omega), ⟨3, rfl⟩, by omega, Or.inl (by omega), Or.inr (by omega), Or.inr rfl⟩ + +theorem invD_nil (c : Nat) (rs : List RItem) (h : InvD [] c rs) : InvE [1] c rs := by + rcases h with ⟨h_rs, h_top, h_vc, h_csd⟩ + have hb := rem_bounds rs + refine ⟨h_rs, h_top, by simp, ?_⟩ + split_ifs with h_rem0 + · rw [h_rem0] at h_vc h_csd + have h_vd := validC_to_validD rs (c + 1) h_vc + have h_re0 : remE rs = 0 ∧ c = 0 := by dsimp [GoodCSD] at h_csd; omega + have h_next := validBase_next rs c 1 h_vc (Or.inl h_re0.1) (Or.inl ⟨h_re0.1, h_re0.2, rfl⟩) + dsimp [GoodCSD] at h_csd ⊢ + refine ⟨h_vd, ?_, ?_, h_next⟩ + · dsimp [above00]; omega + · have h_rc0 : remC rs = 0 ∧ remCC rs = 0 ∧ lastD rs = 0 := by + rcases hb with ⟨_, h2, h3, h4⟩ | ⟨h1, h2, _⟩ | ⟨h1, _, _, _⟩ <;> omega + rw [h_re0.1, h_re0.2, h_rc0.1, h_rc0.2.1, h_rc0.2.2] + dsimp [validC, condC] + omega + · dsimp [GoodCSD] at h_csd ⊢ + rcases h_csd with ⟨_, _, h_cond, h_base⟩ + rcases h_base with h_z | h_vb + · omega + · refine ⟨?_, ?_, ?_⟩ + · have h_eq : (c + 1) + (remSweeps rs - 1) + 1 = c + remSweeps rs + 1 := by omega + rw [h_eq]; exact h_vc + · omega + · have h_eq : 1 + 2 * (remSweeps rs - 1) = 2 * remSweeps rs - 1 := by omega + rw [h_eq]; exact h_vb + +theorem invD_single (d c : Nat) (rs : List RItem) (h : InvD [d] c rs) : InvE [d + 2] c rs := by + rcases h with ⟨h_rs, h_top, h_vc, h_csd⟩ + have hb := rem_bounds rs + refine ⟨h_rs, h_top, by simp, ?_⟩ + split_ifs with h_rem0 + · rw [h_rem0] at h_vc h_csd + rcases h_csd with ⟨h_c_cond, h_vb⟩ + have h_c_gt : remE rs = 0 ∨ c > 2 * remE rs := by omega + have h_vd := validC_to_validD rs (c + 1) h_vc + have ⟨h_vc_next, h_d2_ge⟩ := validBase_to_validC rs c d h_vc h_c_gt h_vb + have h_next := validBase_next rs c (d + 2) h_vc h_c_gt h_d2_ge + dsimp [GoodCSD] + refine ⟨h_vd, ?_, h_vc_next, h_next⟩ + dsimp [above00] + rcases hb with ⟨h1, h2, h3, h4⟩ | ⟨h1, h2, h3, m, hm⟩ | ⟨h1, h2, h3, m, hm⟩ <;> omega + · dsimp [GoodCSD] at h_csd ⊢ + rcases h_csd with ⟨h_c_cond, h_vb⟩ + refine ⟨?_, ?_, ?_⟩ + · have h_eq : (c + 1) + (remSweeps rs - 1) + 1 = c + remSweeps rs + 1 := by omega + rw [h_eq]; exact h_vc + · omega + · have h_eq : (d + 2) + 2 * (remSweeps rs - 1) = d + 2 * remSweeps rs := by omega + rw [h_eq]; exact h_vb + +theorem invD_cons2 (d cp : Nat) (cs : List Nat) (c : Nat) (rs : List RItem) + (h : InvD (d :: cp :: cs) c rs) : InvD cs cp (.item00 d c :: rs) := by + rcases h with ⟨h_rs, h_top, h_vc, h_d_val, h_cp_above, h_cp_val, h_csd⟩ + have hd_ge1 : d ≥ 1 := by + dsimp [validD] at h_d_val + split_ifs at h_d_val + · omega + · rcases h_d_val with h1 | h2 | ⟨_, k, hk⟩ <;> omega + have hd_eq : d - 1 + 1 = d := by omega + refine ⟨⟨hd_ge1, ⟨?_, h_vc, h_top⟩, h_rs⟩, h_cp_above, h_cp_val, h_csd⟩ + rw [hd_eq]; exact h_d_val + +theorem invE_nil (cs : List Nat) (c : Nat) (h : InvE cs c []) : InvD ((c + 1) :: cs) 0 [] := by + rcases h with ⟨_, _, _, h_e⟩ + dsimp [remSweeps, remE, remC, remCC, lastD] at h_e + refine ⟨trivial, trivial, ?_, h_e⟩ + dsimp [validC, remE, remC, remSweeps]; omega + +theorem invE_item00 (cs : List Nat) (c d c₂ : Nat) (rs : List RItem) + (h : InvE cs c (.item00 d c₂ :: rs)) : + ∃ d', d = d' + 1 ∧ InvD cs (c + 1) (.item01 d' c₂ :: rs) := by + rcases h with ⟨⟨hd_ge1, hp, hrs⟩, h_top, h_ne, h_e⟩ + refine ⟨d - 1, by omega, ?_⟩ + have h_rem_ne : remSweeps (.item00 d c₂ :: rs) ≠ 0 := by dsimp [remSweeps]; omega + rw [ite_eq_right h_rem_ne] at h_e + rcases h_e with ⟨h_vc, h_csd⟩ + have h_rem_eq : remSweeps (.item00 d c₂ :: rs) - 1 = remSweeps (.item01 (d - 1) c₂ :: rs) := by + dsimp [remSweeps] + have h_re_eq : remE (.item00 d c₂ :: rs) = remE (.item01 (d - 1) c₂ :: rs) := by + dsimp [remE]; split_ifs <;> omega + have h_rc_eq : remC (.item00 d c₂ :: rs) = remC (.item01 (d - 1) c₂ :: rs) := by + dsimp [remC, condC]; split_ifs <;> omega + rw [h_rem_eq, h_re_eq, h_rc_eq] at h_vc h_csd + refine ⟨⟨hp, hrs⟩, ?_, h_vc, h_csd⟩ + dsimp [topAbove, above00, above01] at h_top ⊢ + omega + +theorem invE_item01_zero (cs : List Nat) (c c₂ : Nat) (rs : List RItem) + (h : InvE cs c (.item01 0 c₂ :: rs)) : InvE cs (c + c₂ + 1) rs := by + rcases h with ⟨⟨⟨h_vd0, h_vc2, h_top2⟩, hrs⟩, h_top, h_ne, h_e⟩ + have hb := rem_bounds rs + have h_rem0_and_not : remSweeps rs = 0 ∧ ¬(2 * remC rs + 1 ≤ remE rs) := by + dsimp [validD] at h_vd0 + split_ifs at h_vd0 with h_gt + · omega + · rcases h_vd0 with h1 | h2 | ⟨_, k, hk⟩ <;> omega + have h_rem0 : remSweeps rs = 0 := h_rem0_and_not.1 + have h_not_gt : ¬(2 * remC rs + 1 ≤ remE rs) := h_rem0_and_not.2 + have h_rem0_cons : remSweeps (.item01 0 c₂ :: rs) = 0 := by dsimp [remSweeps]; omega + rw [ite_eq_left h_rem0_cons] at h_e + have h_re_eq : remE (.item01 0 c₂ :: rs) = remE rs := by rw [remE, h_rem0]; split_ifs <;> omega + have h_rc_eq : remC (.item01 0 c₂ :: rs) = remC rs := by rw [remC, h_rem0]; split_ifs <;> omega + have h_rcc_eq : remCC (.item01 0 c₂ :: rs) = remCC rs := by + rw [remCC, h_rem0]; split_ifs <;> omega + have h_ld_eq : lastD (.item01 0 c₂ :: rs) = lastD rs := by rw [lastD, h_rem0]; split_ifs <;> omega + rw [h_re_eq, h_rc_eq, h_rcc_eq, h_ld_eq] at h_e + have h_c_gt : c + 1 > 2 * remE rs + 1 := by + dsimp [topAbove, above01] at h_top; omega + have h_cc2_gt : c + c₂ + 2 > 2 * remE rs + 1 := by omega + refine ⟨hrs, topAbove_mono rs (by omega) h_top2, h_ne, ?_⟩ + rw [ite_eq_left h_rem0] + rcases List.exists_cons_of_ne_nil h_ne with ⟨cp, cs', rfl⟩ + dsimp [GoodCSD] at h_e ⊢ + rcases h_e with ⟨h_vd_c, h_above_cp, h_vc_cp, h_csd_tail⟩ + have h_re_n_eq : (if c + c₂ + 1 + 1 > 2 * remE rs + 1 then 2 * remC rs + 1 else remC rs) = + (if c + 1 > 2 * remE rs + 1 then 2 * remC rs + 1 else remC rs) := by + split_ifs <;> omega + have h_rc_n_eq : (if c + c₂ + 1 + 1 > 2 * remE rs + 1 ∧ + condC (remE rs) (remC rs) (remCC rs) (lastD rs) then 2 * remCC rs + 1 else remCC rs) = + (if c + 1 > 2 * remE rs + 1 ∧ + condC (remE rs) (remC rs) (remCC rs) (lastD rs) then 2 * remCC rs + 1 else remCC rs) := by + dsimp [condC]; split_ifs <;> omega + rw [h_re_n_eq, h_rc_n_eq] + refine ⟨?_, Or.inl h_cc2_gt, h_vc_cp, h_csd_tail⟩ + dsimp [topAbove, above01] at h_top + dsimp [validD, validC, condC] at h_vd_c h_vc2 ⊢ + rcases hb with ⟨h1, h2, h3, h4⟩ | ⟨h1, h2, h3, m, hm⟩ | ⟨h1, _, _, _⟩ + · split_ifs at h_vd_c h_vc2 ⊢ <;> omega + · split_ifs at h_vd_c h_vc2 ⊢ <;> omega + · exact False.elim (h_not_gt h1) + +theorem invE_item01_succ (cs : List Nat) (c d c₂ : Nat) (rs : List RItem) + (h : InvE cs c (.item01 (d + 1) c₂ :: rs)) : InvE (d :: (c + 1) :: cs) c₂ rs := by + rcases h with ⟨⟨⟨h_vd, h_vc2, h_top2⟩, hrs⟩, h_top, h_ne, h_e⟩ + have hb := rem_bounds rs + refine ⟨hrs, h_top2, by simp, ?_⟩ + split_ifs with h_rem0 + · have h_rem0_cons : remSweeps (.item01 (d + 1) c₂ :: rs) = 0 := by dsimp [remSweeps]; omega + rw [ite_eq_left h_rem0_cons] at h_e + rw [h_rem0] at h_vd h_vc2 + have h_vd_c2 := validC_to_validD rs (c₂ + 1) h_vc2 + have h_step := validD_zero_to_step rs c₂ d h_vd h_vc2 + have h_d_ge : d ≥ 2 * remE rs + 1 := by + dsimp [validD] at h_vd + split_ifs at h_vd + · omega + · rcases h_vd with h1 | h2 | ⟨_, k, hk⟩ <;> omega + have h_c2_cond : condC 0 (remE rs) (remC rs) c₂ ↔ c₂ + 1 > 2 * remE rs + 1 := by + dsimp [condC, validC] at h_vc2 ⊢ + split_ifs at h_vc2 <;> omega + have h_re_eq : remE (.item01 (d + 1) c₂ :: rs) = 2 * remE rs + 1 := by + rw [remE, h_rem0]; split_ifs <;> omega + have h_rc_eq : remC (.item01 (d + 1) c₂ :: rs) = + (if c₂ + 1 > 2 * remE rs + 1 then 2 * remC rs + 1 else remC rs) := by + rw [remC, h_rem0]; dsimp [condC] at h_c2_cond ⊢; split_ifs <;> omega + have h_rcc_eq : remCC (.item01 (d + 1) c₂ :: rs) = + (if c₂ + 1 > 2 * remE rs + 1 ∧ + condC (remE rs) (remC rs) (remCC rs) (lastD rs) then 2 * remCC rs + 1 else remCC rs) := + by + rw [remCC, h_rem0]; dsimp [condC] at h_c2_cond ⊢; split_ifs <;> omega + have h_ld_eq : lastD (.item01 (d + 1) c₂ :: rs) = d := by + rw [lastD, h_rem0]; split_ifs <;> omega + rw [h_re_eq, h_rc_eq, h_rcc_eq, h_ld_eq] at h_e + dsimp [GoodCSD] + exact ⟨h_vd_c2, Or.inr h_step.1, h_step.2, h_e⟩ + · have h_rem_ne_cons : remSweeps (.item01 (d + 1) c₂ :: rs) ≠ 0 := by dsimp [remSweeps]; omega + rw [ite_eq_right h_rem_ne_cons] at h_e + rcases h_e with ⟨h_vc, h_csd⟩ + have h_rem_eq : remSweeps (.item01 (d + 1) c₂ :: rs) - 1 = 2 * (remSweeps rs - 1) + 1 := by + dsimp [remSweeps]; omega + have h_re_eq : remE (.item01 (d + 1) c₂ :: rs) = + (if d > 2 * (remSweeps rs - 1) + 1 then 2 * remE rs + 1 else remE rs) := by + dsimp [remE]; split_ifs <;> omega + have h_rc_eq : remC (.item01 (d + 1) c₂ :: rs) = + (if d > 2 * (remSweeps rs - 1) + 1 ∧ + condC (remSweeps rs - 1) (remE rs) (remC rs) (c₂ + 1) then 2 * remC rs + 1 else remC + rs) := by + dsimp [remC, condC]; split_ifs <;> omega + rw [h_rem_eq, h_re_eq, h_rc_eq] at h_vc h_csd + refine ⟨?_, ?_⟩ + · have h_eq : (c₂ + 1) + (remSweeps rs - 1) + 1 = c₂ + remSweeps rs + 1 := by omega + rw [h_eq]; exact h_vc2 + · dsimp [GoodCSD] + refine ⟨?_, ?_, h_vc, h_csd⟩ + · dsimp [validD, condC] at h_vd ⊢ + split_ifs at h_vd ⊢ + · omega + · rcases h_vd with h1 | h2 | ⟨h_cond, k, hk⟩ + · left; omega + · omega + · right; right; refine ⟨by omega, k, by omega⟩ + · dsimp [topAbove, above01, above00] at h_top ⊢; omega + +def Inv (cfg : Cfg (Fin 2) (Fin 6)) : Prop := + (∃ cs c rs, cfg = cfgD cs c rs ∧ InvD cs c rs) ∨ + (∃ cs c rs, cfg = cfgE cs c rs ∧ InvE cs c rs) + +theorem inv_closed (cfg : Cfg (Fin 2) (Fin 6)) (h : Inv cfg) : + ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ Inv cfg' := by + rcases h with ⟨cs, c, rs, rfl, hD⟩ | ⟨cs, c, rs, rfl, hE⟩ + · rcases cs with _ | ⟨d, _ | ⟨cp, cs⟩⟩ + · exact ⟨cfgE [1] c rs, step_D0 c rs, Or.inr ⟨[1], c, rs, rfl, invD_nil c rs hD⟩⟩ + · exact ⟨cfgE [d + 2] c rs, step_D1 d c rs, Or.inr ⟨[d + 2], c, rs, rfl, invD_single d c rs hD⟩⟩ + · exact ⟨cfgD cs cp (.item00 d c :: rs), step_D2 d cp cs c rs, + Or.inl ⟨cs, cp, .item00 d c :: rs, rfl, invD_cons2 d cp cs c rs hD⟩⟩ + · rcases rs with _ | ⟨⟨d, c₂⟩ | ⟨_ | d, c₂⟩, rs⟩ + · exact ⟨cfgD ((c + 1) :: cs) 0 [], step_E0 cs c, Or.inl ⟨(c + 1) :: cs, 0, [], rfl, + invE_nil cs c hE⟩⟩ + · obtain ⟨d', rfl, hD'⟩ := invE_item00 cs c d c₂ rs hE + exact ⟨cfgD cs (c + 1) (.item01 d' c₂ :: rs), step_E1 cs c d' c₂ rs, + Or.inl ⟨cs, c + 1, .item01 d' c₂ :: rs, rfl, hD'⟩⟩ + · exact ⟨cfgE cs (c + c₂ + 1) rs, step_E2 cs c c₂ rs, + Or.inr ⟨cs, c + c₂ + 1, rs, rfl, invE_item01_zero cs c c₂ rs hE⟩⟩ + · exact ⟨cfgE (d :: (c + 1) :: cs) c₂ rs, step_E3 cs c d c₂ rs, + Or.inr ⟨d :: (c + 1) :: cs, c₂, rs, rfl, invE_item01_succ cs c d c₂ rs hE⟩⟩ + + + + + + + + + + +theorem init_to_step44_0399 : + (((default : ListBlank (Fin 2)) {{2}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢* + (([0, 1] +> default) <{{D}} ([0, 0, 1, 0, 1, 0, 1, 0, 0, 1] +> default)) := by + apply stepPlus_stepStar + dsimp [ListBlank.append] + step; step; step; step; step; step; step; step; step; step; step + step; step; step; step; step; step; step; step; step; step; step + step; step; step; step; step; step; step; step; step; step; step + step; step; step; step; step; step; step; step; step; step; step + exact ⟨0, rfl⟩ + +theorem step44_to_cfgD_0399 : + (([0, 1] +> default) <{{D}} ([0, 0, 1, 0, 1, 0, 1, 0, 0, 1] +> default)) [target_tm]⊢* + cfgD [2, 1] 2 [] := by + apply stepPlus_stepStar + dsimp [cfgD, encL, encR, ListBlank.append] + step; step; step; step; step; step; step; step; step; step; step + step; step; step; step; step; step; step; step; step; step; step + step; step; step; step; step; step; step; step; step; step; step + step; step; step; step; step; step; step; step; step; step; step + step; step; step; exact ⟨0, rfl⟩ + +theorem init_to_cfgD_0399 : + (((default : ListBlank (Fin 2)) {{2}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢* + cfgD [1, 1, 9, 7] 0 [] := by + have h0 := stepStar_trans init_to_step44_0399 step44_to_cfgD_0399 + have h1 : (cfgD [2, 1] 2 []) [target_tm]⊢* cfgD [3, 0, 3, 3] 0 [] := + stepPlus_stepStar (stepPlus_trans (step_D2 2 1 ([] : List Nat) 2 ([] : List RItem)) + (stepPlus_trans (step_D0 1 [.item00 2 2]) + (stepPlus_trans (step_E1 [1] 1 1 2 ([] : List RItem)) + (stepPlus_trans (step_D1 1 2 [.item01 1 2]) + (stepPlus_trans (step_E3 [3] 2 0 2 ([] : List RItem)) + ((step_E0 [0, 3, 3] 2))))))) + have h2 : (cfgD [3, 0, 3, 3] 0 []) [target_tm]⊢* cfgD [1, 1, 9, 7] 0 [] := + stepPlus_stepStar (stepPlus_trans (step_D2 3 0 [3, 3] 0 ([] : List RItem)) + (stepPlus_trans (step_D2 3 3 ([] : List Nat) 0 [.item00 3 0]) + (stepPlus_trans (step_D0 3 [.item00 3 0, .item00 3 0]) + (stepPlus_trans (step_E1 [1] 3 2 0 [.item00 3 0]) + (stepPlus_trans (step_D1 1 4 [.item01 2 0, .item00 3 0]) + (stepPlus_trans (step_E3 [3] 4 1 0 [.item00 3 0]) + (stepPlus_trans (step_E1 [1, 5, 3] 0 2 0 ([] : List RItem)) + (stepPlus_trans (step_D2 1 5 [3] 1 [.item01 2 0]) + (stepPlus_trans (step_D1 3 5 [.item00 1 1, .item01 2 0]) + (stepPlus_trans (step_E1 [5] 5 0 1 [.item01 2 0]) + (stepPlus_trans (step_D1 5 6 [.item01 0 1, .item01 2 0]) + (stepPlus_trans (step_E2 [7] 6 1 [.item01 2 0]) + (stepPlus_trans (step_E3 [7] 8 1 0 ([] : List RItem)) + ((step_E0 [1, 9, 7] 0))))))))))))))) + exact stepStar_trans h0 (stepStar_trans h1 h2) + +theorem inv_init_0399 : InvD [1, 1, 9, 7] 0 [] := by + dsimp only [InvD, GoodRS, topAbove, remSweeps, remE, remC] + refine ⟨trivial, trivial, ?_, ?_⟩ + · dsimp [validC, condC]; omega + · dsimp only [GoodCSD] + refine ⟨?_, ?_, ?_, ?_⟩ + · dsimp [validD, condC]; omega + · dsimp [above00, condC]; omega + · dsimp [validC, condC]; omega + · refine ⟨?_, ?_, ?_, ?_⟩ + · dsimp [validD, condC] + exact Or.inr (Or.inr ⟨by omega, 2, by omega⟩) + · dsimp [above00, condC]; omega + · dsimp [validC, condC]; omega + · refine ⟨?_, ?_, ?_, ?_⟩ + · dsimp [condC]; omega + · dsimp [condC]; omega + · dsimp [condC]; omega + · right + dsimp [validBase, condC] + exact ⟨0, by omega⟩ + +theorem init_to_cfgD_base_0457 : + (((default : ListBlank (Fin 2)) {{3}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢* + cfgD [] 2 [] := by + apply stepPlus_stepStar + dsimp [cfgD, encL, encR, ListBlank.append] + step; step; step; step; step; step; step; step; step; step + step; step; step; step; step; step; step; step; step; step + step; step; step; step; step; step; step; step; step; step + step; step; step; step; step; step; step; step; exact ⟨0, rfl⟩ + +theorem init_to_cfgD_0457 : + (((default : ListBlank (Fin 2)) {{3}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢* + cfgD [1, 1, 3, 3] 0 [] := by + refine stepStar_trans init_to_cfgD_base_0457 (stepPlus_stepStar ?_) + exact stepPlus_trans (step_D0 2 ([] : List RItem)) + (stepPlus_trans (step_E0 [1] 2) + (stepPlus_trans (step_D2 3 1 ([] : List Nat) 0 ([] : List RItem)) + (stepPlus_trans (step_D0 1 [.item00 3 0]) + (stepPlus_trans (step_E1 [1] 1 2 0 ([] : List RItem)) + (stepPlus_trans (step_D1 1 2 [.item01 2 0]) + (stepPlus_trans (step_E3 [3] 2 1 0 ([] : List RItem)) + ((step_E0 [1, 3, 3] 0)))))))) + +theorem inv_init_0457 : InvD [1, 1, 3, 3] 0 [] := by + dsimp only [InvD, GoodRS, topAbove, remSweeps, remE, remC] + refine ⟨trivial, trivial, ?_, ?_⟩ + · dsimp [validC, condC]; omega + · dsimp only [GoodCSD] + refine ⟨?_, ?_, ?_, ?_⟩ + · dsimp [validD, condC]; omega + · dsimp [above00, condC]; omega + · dsimp [validC, condC]; omega + · refine ⟨?_, ?_, ?_, ?_⟩ + · dsimp [validD, condC]; omega + · dsimp [above00, condC]; omega + · dsimp [validC, condC]; omega + · refine ⟨?_, ?_, ?_, ?_⟩ + · dsimp [condC]; omega + · dsimp [condC]; omega + · dsimp [condC]; omega + · right + dsimp [validBase, condC] + exact ⟨2, by omega⟩ + +theorem init_to_cfgD_0465 : + (((default : ListBlank (Fin 2)) {{1}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢* + cfgD [] 0 [] := by + apply stepPlus_stepStar + dsimp [cfgD, encL, encR, ListBlank.append] + step; step; step; step; step; step; step; step; step; step; step; step; step; step + exact ⟨0, rfl⟩ + +theorem inv_init_0465 : InvD [] 0 [] := by + dsimp [InvD, GoodRS, topAbove, validC, GoodCSD, remSweeps, remE, remC, condC] + refine ⟨trivial, trivial, by omega, by omega⟩ + +theorem is_does_not_halt : IsNotHalt target_tm := by + apply closed_inv_does_not_halt target_tm Inv + · exact ⟨cfgD [10, 7] 0 [], init_to_cfgD, Or.inl ⟨[10, 7], 0, [], rfl, inv_init⟩⟩ + · exact inv_closed + +end Solution + +public section + +open Solution in +theorem is_not_halt_from_0399 : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{2}}> default) [target]⊢* cfg) → + (step target cfg).isSome := by + apply closed_inv_does_not_halt target_tm Inv + · exact ⟨cfgD [1, 1, 9, 7] 0 [], init_to_cfgD_0399, Or.inl ⟨[1, 1, 9, 7], 0, [], rfl, + inv_init_0399⟩⟩ + · exact inv_closed + +open Solution in +theorem is_not_halt_from_0457 : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{3}}> default) [target]⊢* cfg) → + (step target cfg).isSome := by + apply closed_inv_does_not_halt target_tm Inv + · exact ⟨cfgD [1, 1, 3, 3] 0 [], init_to_cfgD_0457, Or.inl ⟨[1, 1, 3, 3], 0, [], rfl, + inv_init_0457⟩⟩ + · exact inv_closed + +open Solution in +theorem is_not_halt_from_0465 : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{1}}> default) [target]⊢* cfg) → + (step target cfg).isSome := by + apply closed_inv_does_not_halt target_tm Inv + · exact ⟨cfgD [] 0 [], init_to_cfgD_0465, Or.inl ⟨[], 0, [], rfl, inv_init_0465⟩⟩ + · exact inv_closed + +open Solution in +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0LD_1RC1RF_0RD1RA_1LE1RC_0LA0LD_0RCHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0LD_1RC1RF_0RD1RA_1LE1RC_0LA0LD_0RCHHH.lean new file mode 100644 index 00000000..0b54a9ff --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0LD_1RC1RF_0RD1RA_1LE1RC_0LA0LD_0RCHHH.lean @@ -0,0 +1,1327 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge + +open Mathlib Relation Nat Turing BusyBeaver SixState + +@[expose] public section + +namespace BusyBeaver.M_1RB0LD_1RC1RF_0RD1RA_1LE1RC_0LA0LD_0RCHHH + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LD_1RC1RF_0RD1RA_1LE1RC_0LA0LD_0RCHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end BusyBeaver.M_1RB0LD_1RC1RF_0RD1RA_1LE1RC_0LA0LD_0RCHHH + +end + +namespace BusyBeaver.M_1RB0LD_1RC1RF_0RD1RA_1LE1RC_0LA0LD_0RCHHH + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +namespace Solution + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + +local notation "TapeBlank" => ListBlank (Fin 2) +local notation "SymList" => List (Fin 2) + +@[simp] theorem multiStep_zero_eq {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] (M : Machine Γ Λ) + (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one_eq {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] (M : Machine Γ Λ) + (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ_eq {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] (M : Machine Γ Λ) + (config : Cfg Γ Λ) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] +@[simp] theorem zero_cons_default_eq : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head_eq : (default : TapeBlank).head = 0 := rfl +@[simp] theorem default_tail_eq : (default : TapeBlank).tail = default := rfl +@[simp] theorem append_nil (s : TapeBlank) : ([] : SymList) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : SymList) (s : TapeBlank) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l₁ l₂ : SymList) (s : TapeBlank) : + (l₁ ++ l₂) +> s = l₁ +> (l₂ +> s) := by + induction l₁ with + | nil => rfl + | cons a l₁ ih => simp [ih] +@[simp] theorem pow_zero_list_eq {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list_eq {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := + rfl + +theorem step_to_multiStep {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] (tm : Machine Γ Λ) (c₁ c₂ : Cfg + Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢^{1} c₂ := by simp [h] +theorem step_to_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ + Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢⁺ c₂ := ⟨1, by decide, step_to_multiStep tm c₁ c₂ h⟩ +theorem multiStep_add_eq {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) + (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ_eq, ih, Option.bind_assoc] + simp_rw [multiStep_succ_eq] +theorem multiStep_trans_eq {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] (tm : Machine Γ Λ) (c₁ c₂ c₃ : + Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add_eq, h₁]; simp [h₂] +theorem stepStar_trans_eq {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] {tm : Machine Γ Λ} {c₁ c₂ c₃ : + Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans_eq tm c₁ c₂ c₃ n m hn hm⟩ +theorem stepStar_congr_eq {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} (h₁ : c₁ [target_tm]⊢* c₂) (heq : c₂ = + c₃) : + c₁ [target_tm]⊢* c₃ := heq ▸ h₁ +theorem stepPlus_to_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] {tm : Machine Γ Λ} {c₁ c₂ : + Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ +theorem stepPlus_trans_eq {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] {tm : Machine Γ Λ} {c₁ c₂ c₃ : + Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), + multiStep_trans_eq tm c₁ c₂ c₃ n m hn hm⟩ +theorem stepPlus_stepStar_eq {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] {tm : Machine Γ Λ} {c₁ c₂ + c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), + multiStep_trans_eq tm c₁ c₂ c₃ n m hn hm⟩ +theorem step_stepStar_eq {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] {tm : Machine Γ Λ} {c₁ c₂ c₃ : + Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_trans_eq (step_to_stepPlus tm c₁ c₂ h₁) h₂ + +macro "finish" : tactic => + `(tactic| (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, append_cons, + append_nil, List.cons_append, List.nil_append, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons, zero_cons_default_eq, default_head_eq, + default_tail_eq]) <;> exists 0 <;> fail) +macro "step_tm" : tactic => + `(tactic| (try dsimp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, append_cons, + append_nil]) <;> (try refine stepPlus_to_stepStar ?_) <;> + refine step_stepStar_eq (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, + append_cons, append_nil, Turing.ListBlank.head_cons, default_head_eq]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, append_cons, append_nil, + Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, + zero_cons_default_eq, default_head_eq, default_tail_eq]) +macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> + (any_goals (first | finish | step_tm)) <;> (any_goals (first | finish | step_tm)) <;> + (any_goals (first | finish | step_tm))) +macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5) + +abbrev W0 : SymList := [0] +abbrev W1 : SymList := [1] +abbrev stS : Fin 6 := D +abbrev stT : Fin 6 := C +abbrev stU : Fin 6 := A +abbrev stV : Fin 6 := A + +@[simp] +def LC : List Nat → TapeBlank + | [] => default + | a :: l => ([0] : SymList) +> ((W1 ^ a) +> LC l) + + +@[simp] +def RC : List Nat → TapeBlank + | [] => default + | a :: r => (W1 ^ a) +> (([0] : SymList) +> RC r) + +def S (l : List Nat) (b : Nat) (r : List Nat) : Cfg (Fin 2) (Fin 6) := + ((W1 ^ b) +> LC l) <{{stS}} (RC r) +def T (l : List Nat) (b : Nat) (r : List Nat) : Cfg (Fin 2) (Fin 6) := + ((W1 ^ b) +> LC l) {{stT}}> (RC r) +def U (l : List Nat) (b : Nat) (r : List Nat) : Cfg (Fin 2) (Fin 6) := + ((W1 ^ b) +> LC l) <{{stU}} (RC r) +def V (l : List Nat) (b : Nat) (r : List Nat) : Cfg (Fin 2) (Fin 6) := + ((W1 ^ b) +> LC l) {{stV}}> (RC r) + +theorem Lblanks (l : List Nat) : LC l = LC (l ++ [0]) := by + induction l with + | nil => simp [LC] + | cons a l ih => simp only [LC, List.cons_append]; rw [← ih] + +theorem Rblank (r : List Nat) : RC r = RC (r ++ [0]) := by + induction r with + | nil => simp [RC] + | cons a r ih => simp only [RC, List.cons_append]; rw [← ih] + +theorem Sblankl (l : List Nat) (a : Nat) (r : List Nat) : S l a r = S (l ++ [0]) a r := by + dsimp only [S]; rw [← Lblanks] +theorem Ublankl (l : List Nat) (a : Nat) (r : List Nat) : U l a r = U (l ++ [0]) a r := by + dsimp only [U]; rw [← Lblanks] +theorem Sblankr (l : List Nat) (a : Nat) (r : List Nat) : S l a r = S l a (r ++ [0]) := by + dsimp only [S]; rw [← Rblank] +theorem Tblankr (l : List Nat) (a : Nat) (r : List Nat) : T l a r = T l a (r ++ [0]) := by + dsimp only [T]; rw [← Rblank] +theorem Ublankr (l : List Nat) (a : Nat) (r : List Nat) : U l a r = U l a (r ++ [0]) := by + dsimp only [U]; rw [← Rblank] +theorem Vblankr (l : List Nat) (a : Nat) (r : List Nat) : V l a r = V l a (r ++ [0]) := by + dsimp only [V]; rw [← Rblank] + +theorem Sblankl0 (a : Nat) (r : List Nat) : S [] a r = S [0, 0] a r := by + dsimp [S, LC]; simp +theorem Ublankl0 (a : Nat) (r : List Nat) : U [] a r = U [0] a r := by + dsimp [U, LC]; simp +theorem Tblankr2 (l : List Nat) (a : Nat) : T l a [0, 0] = T l a [0, 0, 0] := by + dsimp [T, RC]; simp + +theorem Spos (l : List Nat) (a : Nat) (r : List Nat) : + (S l (a + 1) r) [target_tm]⊢* (T l (a + 1) r) := by + dsimp [S, T, U, V, LC, RC, W1, pow_zero_list_eq, pow_succ_list_eq]; execute + +theorem Spos_progress (l : List Nat) (a : Nat) (r : List Nat) : + (S l (a + 1) r) [target_tm]⊢⁺ (T l (a + 1) r) := by + dsimp [S, T, U, V, LC, RC, W1, pow_zero_list_eq, pow_succ_list_eq]; execute + +theorem Szero (l : List Nat) (a c : Nat) (r : List Nat) : + (S ((a + 1) :: l) 0 (c :: r)) [target_tm]⊢* (S l a (0 :: (c + 1) :: r)) := by + dsimp [S, T, U, V, LC, RC, W1, pow_zero_list_eq, pow_succ_list_eq]; execute + +theorem Sedge (l : List Nat) (a c : Nat) (r : List Nat) : + (S (0 :: a :: l) 0 (c :: r)) [target_tm]⊢* (U l a (0 :: (c + 1) :: r)) := by + dsimp [S, T, U, V, LC, RC, W1, pow_zero_list_eq, pow_succ_list_eq]; execute + +theorem Upos (l : List Nat) (a : Nat) (r : List Nat) : + (U l (a + 1) r) [target_tm]⊢* (S l a (0 :: r)) := by + dsimp [S, T, U, V, LC, RC, W1, pow_zero_list_eq, pow_succ_list_eq]; execute + +theorem Uzero0 (l : List Nat) (a : Nat) (r : List Nat) : + (U (a :: l) 0 (0 :: r)) [target_tm]⊢* (T l (a + 2) r) := by + dsimp [S, T, U, V, LC, RC, W1, pow_zero_list_eq, pow_succ_list_eq]; execute + +theorem Uzero1 (l : List Nat) (a : Nat) (r : List Nat) : + (U (a :: l) 0 (1 :: r)) [target_tm]⊢* (T ((a + 2) :: l) 0 r) := by + dsimp [S, T, U, V, LC, RC, W1, pow_zero_list_eq, pow_succ_list_eq]; execute + +theorem Tzero (l : List Nat) (a c : Nat) (r : List Nat) : + (T l a (0 :: 0 :: c :: r)) [target_tm]⊢* (U l a (0 :: (c + 1) :: r)) := by + dsimp [S, T, U, V, LC, RC, W1, pow_zero_list_eq, pow_succ_list_eq]; execute + +theorem Tmix (l : List Nat) (a c : Nat) (r : List Nat) : + (T l a (0 :: (c + 1) :: r)) [target_tm]⊢* (T (a :: l) 1 (c :: r)) := by + dsimp [S, T, U, V, LC, RC, W1, pow_zero_list_eq, pow_succ_list_eq]; execute + +theorem Tpos (l : List Nat) (a c : Nat) (r : List Nat) : + (T l a ((c + 1) :: r)) [target_tm]⊢* (V l (a + 1) (c :: r)) := by + dsimp [S, T, U, V, LC, RC, W1, pow_zero_list_eq, pow_succ_list_eq]; execute + +theorem Vpos (l : List Nat) (a c : Nat) (r : List Nat) : + (V l a ((c + 1) :: r)) [target_tm]⊢* (S l a (0 :: c :: r)) := by + dsimp [S, T, U, V, LC, RC, W1, pow_zero_list_eq, pow_succ_list_eq]; execute + +theorem Vzero0 (l : List Nat) (a : Nat) (r : List Nat) : + (V l a (0 :: 0 :: r)) [target_tm]⊢* (T l (a + 2) r) := by + dsimp [S, T, U, V, LC, RC, W1, pow_zero_list_eq, pow_succ_list_eq]; execute + +theorem Vzero1 (l : List Nat) (a : Nat) (r : List Nat) : + (V l a (0 :: 1 :: r)) [target_tm]⊢* (T ((a + 2) :: l) 0 r) := by + dsimp [S, T, U, V, LC, RC, W1, pow_zero_list_eq, pow_succ_list_eq]; execute + +theorem init_to_T : (init []) [target_tm]⊢* (T [] 2 []) := by + simp only [init, Tape.mk₁, T, LC, RC, W1, pow_zero_list_eq, pow_succ_list_eq, List.cons_append, + List.nil_append]; execute + +abbrev rep (x n : Nat) : List Nat := List.replicate n x + +@[simp] theorem rep_zero (x : Nat) : rep x 0 = [] := rfl +@[simp] theorem rep_succ (x n : Nat) : rep x (n + 1) = x :: rep x n := rfl + +theorem rep_snoc (x n : Nat) (l : List Nat) : rep x n ++ x :: l = rep x (n + 1) ++ l := by + induction n with + | zero => rfl + | succ n ih => simp only [rep_succ, List.cons_append, ih] + +theorem Tmixs (n : Nat) (l : List Nat) (a : Nat) (r : List Nat) : + (T l a (0 :: (rep 1 (n + 1) ++ r))) [target_tm]⊢* + (T (rep 1 n ++ a :: l) 1 (0 :: r)) := by + induction n generalizing l a with + | zero => exact Tmix l a 0 r + | succ n ih => + have h1 := Tmix l a 0 (rep 1 (n + 1) ++ r) + have h2 := ih (a :: l) 1 + rw [rep_snoc] at h2 + exact stepStar_trans_eq h1 h2 + +theorem Szeros (n : Nat) (l : List Nat) (c : Nat) (r : List Nat) : + (S (rep 1 (n + 1) ++ l) 0 (c :: r)) [target_tm]⊢* + (S l 0 (0 :: (rep 1 n ++ (c + 1) :: r))) := by + induction n generalizing c r with + | zero => exact Szero l 0 c r + | succ n ih => + have h1 := Szero (rep 1 (n + 1) ++ l) 0 c r + have h2 := ih 0 ((c + 1) :: r) + rw [rep_snoc] at h2 + exact stepStar_trans_eq h1 h2 + +theorem Triple (l : List Nat) (a c : Nat) (r : List Nat) : + (T l a ((c + 3) :: r)) [target_tm]⊢* (T ((a + 1) :: l) 1 (c :: r)) := + stepStar_trans_eq (Tpos l a (c + 2) r) + (stepStar_trans_eq (Vpos l (a + 1) (c + 1) r) + (stepStar_trans_eq (Spos l a (0 :: (c + 1) :: r)) + (Tmix l (a + 1) c r))) + +theorem Triples (n : Nat) (l : List Nat) (a c : Nat) (r : List Nat) : + (T l a (((n + 1) * 3 + c) :: r)) [target_tm]⊢* + (T (rep 2 n ++ (a + 1) :: l) 1 (c :: r)) := by + induction n generalizing l a with + | zero => + rw [show (0 + 1) * 3 + c = c + 3 by omega] + exact Triple l a c r + | succ n ih => + rw [show (n + 1 + 1) * 3 + c = ((n + 1) * 3 + c) + 3 by omega] + have h1 := Triple l a ((n + 1) * 3 + c) r + have h2 := ih ((a + 1) :: l) 1 + rw [rep_snoc] at h2 + exact stepStar_trans_eq h1 h2 + +theorem Pairs (n : Nat) (l r : List Nat) : + (T l 0 (rep 1 (n * 2) ++ r)) [target_tm]⊢* + (T (rep 3 n ++ l) 0 r) := by + induction n generalizing l with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [show (n + 1) * 2 = n * 2 + 2 by omega] + have h1 := Tpos l 0 0 (1 :: (rep 1 (n * 2) ++ r)) + have h2 := Vzero1 l 1 (rep 1 (n * 2) ++ r) + have h3 := ih (3 :: l) + rw [rep_snoc] at h3 + exact stepStar_trans_eq h1 (stepStar_trans_eq h2 h3) + +theorem CycleStep (a : Nat) (l : List Nat) (n c : Nat) (r : List Nat) : + (S ((a + 1) :: l) 1 (0 :: (rep 1 (n + 1) ++ 0 :: c :: r))) [target_tm]⊢* + (S l a (0 :: (rep 1 (n + 2) ++ 0 :: (c + 1) :: r))) := by + have h1 := Spos ((a + 1) :: l) 0 (0 :: (rep 1 (n + 1) ++ 0 :: c :: r)) + have h2 := Tmixs n ((a + 1) :: l) 1 (0 :: c :: r) + rw [rep_snoc] at h2 + have h3 := Tzero (rep 1 (n + 1) ++ (a + 1) :: l) 1 c r + have h4 := Upos (rep 1 (n + 1) ++ (a + 1) :: l) 0 (0 :: (c + 1) :: r) + have h5 := Szeros n ((a + 1) :: l) 0 (0 :: (c + 1) :: r) + rw [rep_snoc] at h5 + have h6 := Szero l a 0 (rep 1 (n + 1) ++ 0 :: (c + 1) :: r) + exact stepStar_trans_eq h1 (stepStar_trans_eq h2 (stepStar_trans_eq h3 (stepStar_trans_eq h4 + (stepStar_trans_eq h5 h6)))) + +theorem CycleCarry (b : Nat) (l : List Nat) (n c : Nat) (r : List Nat) : + (S l (b + 1) (0 :: (rep 1 (n + 2) ++ 0 :: c :: r))) [target_tm]⊢* + (S l b (0 :: (rep 1 (n + 2) ++ 0 :: (c + 1) :: r))) := by + have h1 := Spos l b (0 :: (rep 1 (n + 2) ++ 0 :: c :: r)) + have h2 := Tmixs (n + 1) l (b + 1) (0 :: c :: r) + have h3 := Tzero (rep 1 (n + 1) ++ (b + 1) :: l) 1 c r + have h4 := Upos (rep 1 (n + 1) ++ (b + 1) :: l) 0 (0 :: (c + 1) :: r) + have h5 := Szeros n ((b + 1) :: l) 0 (0 :: (c + 1) :: r) + rw [rep_snoc] at h5 + have h6 := Szero l b 0 (rep 1 (n + 1) ++ 0 :: (c + 1) :: r) + exact stepStar_trans_eq h1 (stepStar_trans_eq h2 (stepStar_trans_eq h3 (stepStar_trans_eq h4 + (stepStar_trans_eq h5 h6)))) + +theorem Cycle2 (l : List Nat) (n c : Nat) (r : List Nat) : + (S (2 :: l) 1 (0 :: (rep 1 (n + 1) ++ 0 :: c :: r))) [target_tm]⊢* + (S l 1 (0 :: (rep 1 (n + 2) ++ 0 :: (c + 1) :: r))) := + CycleStep 1 l n c r + +theorem Cycle (l : List Nat) (n c : Nat) (r : List Nat) : + (S (3 :: l) 1 (0 :: (rep 1 (n + 1) ++ 0 :: c :: r))) [target_tm]⊢* + (S l 1 (0 :: (rep 1 (n + 2) ++ 0 :: (c + 2) :: r))) := + stepStar_trans_eq (CycleStep 2 l n c r) (CycleCarry 1 l n (c + 1) r) + +theorem Cycle4 (l : List Nat) (n c : Nat) (r : List Nat) : + (S (4 :: l) 1 (0 :: (rep 1 (n + 1) ++ 0 :: c :: r))) [target_tm]⊢* + (S l 1 (0 :: (rep 1 (n + 2) ++ 0 :: (c + 3) :: r))) := + stepStar_trans_eq (CycleStep 3 l n c r) (stepStar_trans_eq (CycleCarry 2 l n (c + 1) r) + (CycleCarry 1 l n (c + 2) r)) + +theorem Cycles (m n : Nat) (l : List Nat) (c : Nat) (r : List Nat) : + (S (rep 3 m ++ l) 1 (0 :: (rep 1 (n + 1) ++ 0 :: c :: r))) [target_tm]⊢* + (S l 1 (0 :: (rep 1 (n + 1 + m) ++ 0 :: (m * 2 + c) :: r))) := by + induction m generalizing n c with + | zero => + rw [show 0 * 2 + c = c by omega, show n + 1 + 0 = n + 1 by omega] + exact ⟨0, rfl⟩ + | succ m ih => + simp only [rep_succ, List.cons_append] + have h1 := Cycle (rep 3 m ++ l) n c r + have h2 := ih (n + 1) (c + 2) + rw [show n + 1 + 1 + m = n + 1 + (m + 1) by omega, + show m * 2 + (c + 2) = (m + 1) * 2 + c by omega] at h2 + exact stepStar_trans_eq h1 h2 + +theorem Cycles2 (m n : Nat) (l : List Nat) (c : Nat) (r : List Nat) : + (S (rep 2 m ++ l) 1 (0 :: (rep 1 (n + 1) ++ 0 :: c :: r))) [target_tm]⊢* + (S l 1 (0 :: (rep 1 (n + 1 + m) ++ 0 :: (m + c) :: r))) := by + induction m generalizing n c with + | zero => + rw [show 0 + c = c by omega, show n + 1 + 0 = n + 1 by omega] + exact ⟨0, rfl⟩ + | succ m ih => + simp only [rep_succ, List.cons_append] + have h1 := Cycle2 (rep 2 m ++ l) n c r + have h2 := ih (n + 1) (c + 1) + rw [show n + 1 + 1 + m = n + 1 + (m + 1) by omega, + show m + (c + 1) = (m + 1) + c by omega] at h2 + exact stepStar_trans_eq h1 h2 + +theorem cap_head (r : List Nat) : + (T ([]) 2 (0 :: 1 :: 0 :: 6 :: 1 :: r)) [target_tm]⊢* (T ([4, 2, 2, 0, 5]) 0 (r)) := by + have h0 := Tmix ([]) 2 0 (0 :: 6 :: 1 :: r) + have h1 := Tzero ([2]) 1 6 (1 :: r) + have h2 := Upos ([2]) 0 (0 :: 7 :: 1 :: r) + have h3 := Szero ([]) 1 0 (0 :: 7 :: 1 :: r) + have h4 := Spos ([]) 0 (0 :: 1 :: 0 :: 7 :: 1 :: r) + have h5 := Tmix ([]) 1 0 (0 :: 7 :: 1 :: r) + have h6 := Tzero ([1]) 1 7 (1 :: r) + have h7 := Upos ([1]) 0 (0 :: 8 :: 1 :: r) + have h8 := Szero ([]) 0 0 (0 :: 8 :: 1 :: r) + rw [Sblankl0 0 (0 :: 1 :: 0 :: 8 :: 1 :: r)] at h8 + have h10 := Sedge ([]) 0 0 (1 :: 0 :: 8 :: 1 :: r) + rw [Ublankl0 0 (0 :: 1 :: 1 :: 0 :: 8 :: 1 :: r)] at h10 + have h12 := Uzero0 ([]) 0 (1 :: 1 :: 0 :: 8 :: 1 :: r) + have h13 := Tpos ([]) 2 0 (1 :: 0 :: 8 :: 1 :: r) + have h14 := Vzero1 ([]) 3 (0 :: 8 :: 1 :: r) + have h15 := Tmix ([5]) 0 7 (1 :: r) + have h16 := Triple ([0, 5]) 1 4 (1 :: r) + have h17 := Triple ([2, 0, 5]) 1 1 (1 :: r) + have h18 := Tpos ([2, 2, 0, 5]) 1 0 (1 :: r) + have h19 := Vzero1 ([2, 2, 0, 5]) 2 (r) + exact (stepStar_trans_eq h0 (stepStar_trans_eq h1 (stepStar_trans_eq h2 (stepStar_trans_eq h3 + (stepStar_trans_eq h4 (stepStar_trans_eq h5 (stepStar_trans_eq h6 (stepStar_trans_eq h7 + (stepStar_trans_eq h8 (stepStar_trans_eq h10 (stepStar_trans_eq h12 (stepStar_trans_eq h13 + (stepStar_trans_eq h14 (stepStar_trans_eq h15 (stepStar_trans_eq h16 (stepStar_trans_eq h17 + (stepStar_trans_eq h18 h19))))))))))))))))) + +theorem cap_mid_const (l : List Nat) : + (T (2 :: l) 1 ([2])) [target_tm]⊢* (S (l) 1 ([0, 1, 0, 2])) := by + have h0 := Tpos (2 :: l) 1 1 ([]) + have h1 := Vpos (2 :: l) 2 0 ([]) + have h2 := Spos (2 :: l) 1 ([0, 0]) + rw [Tblankr2 (2 :: l) 2] at h2 + have h4 := Tzero (2 :: l) 2 0 ([]) + have h5 := Upos (2 :: l) 1 ([0, 1]) + have h6 := Spos (2 :: l) 0 ([0, 0, 1]) + have h7 := Tzero (2 :: l) 1 1 ([]) + have h8 := Upos (2 :: l) 0 ([0, 2]) + have h9 := Szero (l) 1 0 ([0, 2]) + exact (stepStar_trans_eq h0 (stepStar_trans_eq h1 (stepStar_trans_eq h2 (stepStar_trans_eq h4 + (stepStar_trans_eq h5 (stepStar_trans_eq h6 (stepStar_trans_eq h7 (stepStar_trans_eq h8 + h9)))))))) + +theorem cap_tail (r : List Nat) : + (S ([0, 5]) 0 (0 :: 1 :: r)) [target_tm]⊢⁺ (T ([]) 2 (0 :: 1 :: 0 :: 6 :: r)) := by + have h0 := Sedge ([]) 5 0 (1 :: r) + have h1 := Upos ([]) 4 (0 :: 1 :: 1 :: r) + have h2 := Spos ([]) 3 (0 :: 0 :: 1 :: 1 :: r) + have h3 := Tzero ([]) 4 1 (1 :: r) + have h4 := Upos ([]) 3 (0 :: 2 :: 1 :: r) + have h5 := Spos ([]) 2 (0 :: 0 :: 2 :: 1 :: r) + have h6 := Tzero ([]) 3 2 (1 :: r) + have h7 := Upos ([]) 2 (0 :: 3 :: 1 :: r) + have h8 := Spos ([]) 1 (0 :: 0 :: 3 :: 1 :: r) + have h9 := Tzero ([]) 2 3 (1 :: r) + have h10 := Upos ([]) 1 (0 :: 4 :: 1 :: r) + have h11 := Spos ([]) 0 (0 :: 0 :: 4 :: 1 :: r) + have h12 := Tzero ([]) 1 4 (1 :: r) + have h13 := Upos ([]) 0 (0 :: 5 :: 1 :: r) + rw [Sblankl0 0 (0 :: 0 :: 5 :: 1 :: r)] at h13 + have h15 := Sedge ([]) 0 0 (0 :: 5 :: 1 :: r) + rw [Ublankl0 0 (0 :: 1 :: 0 :: 5 :: 1 :: r)] at h15 + have h17 := Uzero0 ([]) 0 (1 :: 0 :: 5 :: 1 :: r) + have h18 := Tpos ([]) 2 0 (0 :: 5 :: 1 :: r) + have h19 := Vzero0 ([]) 3 (5 :: 1 :: r) + have h20 := Triple ([]) 5 2 (1 :: r) + have h21 := Tpos ([6]) 1 1 (1 :: r) + have h22 := Vpos ([6]) 2 0 (1 :: r) + have h23 := Spos ([6]) 1 (0 :: 0 :: 1 :: r) + have h24 := Tzero ([6]) 2 1 (r) + have h25 := Upos ([6]) 1 (0 :: 2 :: r) + have h26 := Spos ([6]) 0 (0 :: 0 :: 2 :: r) + have h27 := Tzero ([6]) 1 2 (r) + have h28 := Upos ([6]) 0 (0 :: 3 :: r) + have h29 := Szero ([]) 5 0 (0 :: 3 :: r) + have h30 := Spos ([]) 4 (0 :: 1 :: 0 :: 3 :: r) + have h31 := Tmix ([]) 5 0 (0 :: 3 :: r) + have h32 := Tzero ([5]) 1 3 (r) + have h33 := Upos ([5]) 0 (0 :: 4 :: r) + have h34 := Szero ([]) 4 0 (0 :: 4 :: r) + have h35 := Spos ([]) 3 (0 :: 1 :: 0 :: 4 :: r) + have h36 := Tmix ([]) 4 0 (0 :: 4 :: r) + have h37 := Tzero ([4]) 1 4 (r) + have h38 := Upos ([4]) 0 (0 :: 5 :: r) + have h39 := Szero ([]) 3 0 (0 :: 5 :: r) + have h40 := Spos ([]) 2 (0 :: 1 :: 0 :: 5 :: r) + have h41 := Tmix ([]) 3 0 (0 :: 5 :: r) + have h42 := Tzero ([3]) 1 5 (r) + have h43 := Upos ([3]) 0 (0 :: 6 :: r) + have h44 := Szero ([]) 2 0 (0 :: 6 :: r) + have h45 := Spos_progress ([]) 1 (0 :: 1 :: 0 :: 6 :: r) + exact (stepPlus_stepStar_eq h0 (stepPlus_stepStar_eq h1 (stepPlus_stepStar_eq h2 + (stepPlus_stepStar_eq h3 (stepPlus_stepStar_eq h4 (stepPlus_stepStar_eq h5 + (stepPlus_stepStar_eq h6 (stepPlus_stepStar_eq h7 (stepPlus_stepStar_eq h8 + (stepPlus_stepStar_eq h9 (stepPlus_stepStar_eq h10 (stepPlus_stepStar_eq h11 + (stepPlus_stepStar_eq h12 (stepPlus_stepStar_eq h13 (stepPlus_stepStar_eq h15 + (stepPlus_stepStar_eq h17 (stepPlus_stepStar_eq h18 (stepPlus_stepStar_eq h19 + (stepPlus_stepStar_eq h20 (stepPlus_stepStar_eq h21 (stepPlus_stepStar_eq h22 + (stepPlus_stepStar_eq h23 (stepPlus_stepStar_eq h24 (stepPlus_stepStar_eq h25 + (stepPlus_stepStar_eq h26 (stepPlus_stepStar_eq h27 (stepPlus_stepStar_eq h28 + (stepPlus_stepStar_eq h29 (stepPlus_stepStar_eq h30 (stepPlus_stepStar_eq h31 + (stepPlus_stepStar_eq h32 (stepPlus_stepStar_eq h33 (stepPlus_stepStar_eq h34 + (stepPlus_stepStar_eq h35 (stepPlus_stepStar_eq h36 (stepPlus_stepStar_eq h37 + (stepPlus_stepStar_eq h38 (stepPlus_stepStar_eq h39 (stepPlus_stepStar_eq h40 + (stepPlus_stepStar_eq h41 (stepPlus_stepStar_eq h42 (stepPlus_stepStar_eq h43 + (stepPlus_stepStar_eq h44 h45))))))))))))))))))))))))))))))))))))))))))) + + +def cap (n : Nat) : Cfg (Fin 2) (Fin 6) := + T [] 2 (0 :: 1 :: 0 :: 6 :: (rep 1 (n * 2 + 4) ++ [0, n * 3 + 11])) + +theorem cap_step (n : Nat) : (cap n) [target_tm]⊢⁺ (cap (n + 1)) := by + unfold cap + have heq1 : rep 1 (n * 2 + 3) ++ [0, n * 3 + 11] = rep 1 ((n + 1) * 2) ++ [1, 0, n * 3 + 11] := by + rw [← rep_snoc, show (n + 1) * 2 = n * 2 + 2 by omega] + have s1 := + stepStar_congr_eq (cap_head (rep 1 (n * 2 + 3) ++ [0, n * 3 + 11])) (congrArg (T [4, 2, 2, 0, + 5] 0) heq1) + have s2 := Pairs (n + 1) [4, 2, 2, 0, 5] [1, 0, n * 3 + 11] + have heq3 : [n * 3 + 11] = [((n + 2) + 1) * 3 + 2] := by + rw [show n * 3 + 11 = ((n + 2) + 1) * 3 + 2 by omega] + have s3 := + stepStar_congr_eq (stepStar_trans_eq (Tpos (rep 3 (n + 1) ++ [4, 2, 2, 0, 5]) 0 0 [0, + n * 3 + 11]) + (Vzero0 (rep 3 (n + 1) ++ [4, 2, 2, 0, 5]) 1 [n * 3 + 11])) + (congrArg (T (rep 3 (n + 1) ++ [4, 2, 2, 0, 5]) 3) heq3) + have s4 := Triples (n + 2) (rep 3 (n + 1) ++ [4, 2, 2, 0, 5]) 3 2 [] + have s5 := cap_mid_const (rep 2 (n + 1) ++ 4 :: (rep 3 (n + 1) ++ [4, 2, 2, 0, 5])) + have s6 := Cycles2 (n + 1) 0 (4 :: (rep 3 (n + 1) ++ [4, 2, 2, 0, 5])) 2 [] + rw [show 0 + 1 + (n + 1) = n + 2 by omega, show (n + 1) + 2 = n + 3 by omega] at s6 + have s7 := Cycle4 (rep 3 (n + 1) ++ [4, 2, 2, 0, 5]) (n + 1) (n + 3) [] + have s8 := Cycles (n + 1) (n + 2) [4, 2, 2, 0, 5] (n + 6) [] + rw [show n + 2 + 1 + (n + 1) = n * 2 + 4 by omega, + show (n + 1) * 2 + (n + 6) = n * 3 + 8 by omega] at s8 + have s9 := Cycle4 [2, 2, 0, 5] (n * 2 + 3) (n * 3 + 8) [] + have s10 := Cycles2 2 (n * 2 + 4) [0, 5] (n * 3 + 11) [] + rw [show n * 2 + 4 + 1 + 2 = n * 2 + 7 by omega, + show 2 + (n * 3 + 11) = n * 3 + 13 by omega] at s10 + have s11 := Spos [0, 5] 0 (0 :: (rep 1 (n * 2 + 7) ++ [0, n * 3 + 13])) + have s12 := Tmixs (n * 2 + 6) [0, 5] 1 [0, n * 3 + 13] + rw [rep_snoc] at s12 + have s13 := Tzero (rep 1 (n * 2 + 7) ++ [0, 5]) 1 (n * 3 + 13) [] + have s14 := Upos (rep 1 (n * 2 + 7) ++ [0, 5]) 0 [0, n * 3 + 14] + have s15 := Szeros (n * 2 + 6) [0, 5] 0 [0, n * 3 + 14] + have heq15 : rep 1 (n * 2 + 6) ++ [1, 0, n * 3 + 14] = 1 :: (rep 1 ((n + 1) * 2 + 4) ++ [0, + (n + 1) * 3 + 11]) := by + rw [rep_snoc, show n * 2 + 7 = (n + 1) * 2 + 5 by omega, + show n * 3 + 14 = (n + 1) * 3 + 11 by omega]; rfl + rw [heq15] at s15 + have s16 := cap_tail (rep 1 ((n + 1) * 2 + 4) ++ [0, (n + 1) * 3 + 11]) + exact stepPlus_stepStar_eq s1 (stepPlus_stepStar_eq s2 (stepPlus_stepStar_eq s3 + (stepPlus_stepStar_eq s4 (stepPlus_stepStar_eq s5 (stepPlus_stepStar_eq s6 + (stepPlus_stepStar_eq s7 (stepPlus_stepStar_eq s8 (stepPlus_stepStar_eq s9 + (stepPlus_stepStar_eq s10 (stepPlus_stepStar_eq s11 (stepPlus_stepStar_eq s12 + (stepPlus_stepStar_eq s13 (stepPlus_stepStar_eq s14 (stepPlus_stepStar_eq s15 + s16)))))))))))))) + +-- ============================================================================ +-- Fast Kernel RLE Evaluator +-- ============================================================================ + +noncomputable section + +inductive RList where + | nil : RList + | cons (val : Nat) (cnt : Nat) (tail : RList) : RList +deriving DecidableEq + +inductive Phase where + | pS | pT | pU | pV +deriving DecidableEq + +inductive CfgRLE where + | mk (p : Phase) (l : RList) (a : Nat) (r : RList) : CfgRLE +deriving DecidableEq + +@[simp] +def decodeR : RList → List Nat + | .nil => [] + | .cons v k t => rep v (k + 1) ++ decodeR t + +@[simp] +def decodeCfg : CfgRLE → Cfg (Fin 2) (Fin 6) + | .mk .pS l a r => S (decodeR l) a (decodeR r) + | .mk .pT l a r => T (decodeR l) a (decodeR r) + | .mk .pU l a r => U (decodeR l) a (decodeR r) + | .mk .pV l a r => V (decodeR l) a (decodeR r) + +def bindNat {α : Type} (n : Nat) (k : Nat → α) : α := + Nat.rec (k 0) (fun m _ => k m) (Nat.add 1 n) + +@[simp] +theorem bindNat_eq {α : Type} (n : Nat) (k : Nat → α) : bindNat n k = k n := by + unfold bindNat + rw [show Nat.add 1 n = n + 1 from Nat.add_comm 1 n] + +def pushRep_cons_branch (same : Bool) (v k w m : Nat) (t : RList) : RList := + Bool.rec + (RList.cons v k (RList.cons w m t)) + (bindNat (Nat.add k (Nat.add m 1)) (fun km => RList.cons v km t)) + same + +def pushRep (v k : Nat) (l : RList) : RList := + RList.rec + (RList.cons v k RList.nil) + (fun w m t _ => pushRep_cons_branch (Nat.beq v w) v k w m t) + l + +def push1 (v : Nat) (l : RList) : RList := pushRep v 0 l + +def pushRepN (v n : Nat) (l : RList) : RList := + Nat.rec l (fun k _ => pushRep v k l) n + +def popR_cons_branch {α : Type} (is0 : Bool) (v c : Nat) (t : RList) (k : Nat → RList → α) : α := + Bool.rec + (bindNat (Nat.sub c 1) (fun c' => k v (RList.cons v c' t))) + (k v t) + is0 + +def popRList {α : Type} (xs : RList) (k : Nat → RList → α) : α := + RList.rec + (k 0 RList.nil) + (fun v c t _ => popR_cons_branch (Nat.beq c 0) v c t k) + xs + +def step_U_a0_c (x0 : Nat) (l1 r1 : RList) (c : Nat) : CfgRLE := + Bool.rec + (Bool.rec + (CfgRLE.mk Phase.pU (push1 x0 l1) 0 (push1 c r1)) + (bindNat (Nat.add x0 2) (fun x02 => CfgRLE.mk Phase.pT (push1 x02 l1) 0 r1)) + (Nat.beq c 1)) + (bindNat (Nat.add x0 2) (fun x02 => CfgRLE.mk Phase.pT l1 x02 r1)) + (Nat.beq c 0) + +def step_U (l : RList) (a : Nat) (r : RList) : CfgRLE := + Bool.rec + (bindNat (Nat.sub a 1) (fun a' => CfgRLE.mk Phase.pS l a' (push1 0 r))) + (popRList l (fun x0 l1 => popRList r (fun c r1 => step_U_a0_c x0 l1 r1 c))) + (Nat.beq a 0) + +def step_V_c0_0 (l : RList) (a : Nat) (c1 : Nat) (r2 : RList) : CfgRLE := + Bool.rec + (Bool.rec + (CfgRLE.mk Phase.pV l a (push1 0 (push1 c1 r2))) + (bindNat (Nat.add a 2) (fun a2 => CfgRLE.mk Phase.pT (push1 a2 l) 0 r2)) + (Nat.beq c1 1)) + (bindNat (Nat.add a 2) (fun a2 => CfgRLE.mk Phase.pT l a2 r2)) + (Nat.beq c1 0) + +def step_V (l : RList) (a : Nat) (r : RList) : CfgRLE := + popRList r (fun c0 r1 => + Bool.rec + (bindNat (Nat.sub c0 1) (fun c0' => CfgRLE.mk Phase.pS l a (push1 0 (push1 c0' r1)))) + (popRList r1 (fun c1 r2 => step_V_c0_0 l a c1 r2)) + (Nat.beq c0 0)) + +def step_T_c0_0_fallback (l : RList) (a : Nat) (r1 : RList) : CfgRLE := + popRList r1 (fun c1 r2 => + Bool.rec + (bindNat (Nat.sub c1 1) (fun c1' => CfgRLE.mk Phase.pT (push1 a l) 1 (push1 c1' r2))) + (popRList r2 (fun c2 r3 => + bindNat (Nat.add c2 1) (fun c2' => CfgRLE.mk Phase.pU l a (push1 0 (push1 c2' r3))))) + (Nat.beq c1 0)) + +def step_T_c0_0 (l : RList) (a : Nat) (r1 : RList) : CfgRLE := + RList.rec + (step_T_c0_0_fallback l a RList.nil) + (fun v1 k1 t1 _ => + Bool.rec + (step_T_c0_0_fallback l a (RList.cons v1 k1 t1)) + (CfgRLE.mk Phase.pT (pushRepN 1 k1 (push1 a l)) 1 (push1 0 t1)) + (Nat.beq v1 1)) + r1 + +def step_T_base (l : RList) (a : Nat) (r : RList) : CfgRLE := + popRList r (fun c0 r1 => + Bool.rec + (Bool.rec + (bindNat (Nat.sub c0 1) (fun c0' => CfgRLE.mk Phase.pV l (Nat.add a 1) (push1 c0' r1))) + (bindNat (Nat.div c0 3) (fun q => + bindNat (Nat.sub q 1) (fun q1 => + bindNat (Nat.mod c0 3) (fun rem => + bindNat (Nat.add a 1) (fun a1 => + CfgRLE.mk Phase.pT (pushRepN 2 q1 (push1 a1 l)) 1 (push1 rem r1)))))) + (Nat.ble 3 c0)) + (step_T_c0_0 l a r1) + (Nat.beq c0 0)) + +def step_T (l : RList) (a : Nat) (r : RList) : CfgRLE := + RList.rec + (step_T_base l a RList.nil) + (fun v k t _ => + Bool.rec + (step_T_base l a (RList.cons v k t)) + (bindNat (Nat.div (Nat.add k 1) 2) (fun m => + bindNat (Nat.mod (Nat.add k 1) 2) (fun rem1 => + CfgRLE.mk Phase.pT (pushRepN 3 m l) 0 + (Bool.rec (push1 1 t) t (Nat.beq rem1 0))))) + (Bool.and (Nat.beq a 0) (Bool.and (Nat.beq v 1) (Bool.not (Nat.beq k 0))))) + r + +def step_S_a0_fallback (l : RList) (c : Nat) (r1 : RList) : CfgRLE := + popRList l (fun x0 l1 => + Bool.rec + (bindNat (Nat.sub x0 1) (fun x0' => + bindNat (Nat.add c 1) (fun c1 => + CfgRLE.mk Phase.pS l1 x0' (push1 0 (push1 c1 r1))))) + (popRList l1 (fun x1 l2 => + bindNat (Nat.add c 1) (fun c1 => + CfgRLE.mk Phase.pU l2 x1 (push1 0 (push1 c1 r1))))) + (Nat.beq x0 0)) + +def step_S_a0 (l r : RList) : CfgRLE := + popRList r (fun c r1 => + RList.rec + (step_S_a0_fallback RList.nil c r1) + (fun v k t _ => + Bool.rec + (step_S_a0_fallback (RList.cons v k t) c r1) + (bindNat (Nat.add c 1) (fun c1 => + CfgRLE.mk Phase.pS t 0 (push1 0 (pushRepN 1 k (push1 c1 r1))))) + (Nat.beq v 1)) + l) + +def do_cycle (is3 : Bool) (k_l : Nat) (l_tail : RList) (n : Nat) (r3 : RList) : CfgRLE := + popRList r3 (fun c r_tail => + bindNat (Nat.add k_l 1) (fun m => + bindNat (Nat.add n m) (fun nm => + Bool.rec + (bindNat (Nat.add m c) (fun mc => + CfgRLE.mk Phase.pS l_tail 1 (push1 0 (pushRep 1 nm (push1 0 (push1 mc r_tail)))))) + (bindNat (Nat.add (Nat.mul m 2) c) (fun m2c => + CfgRLE.mk Phase.pS l_tail 1 (push1 0 (pushRep 1 nm (push1 0 (push1 m2c r_tail)))))) + is3))) + +def step_S_pos (l : RList) (a : Nat) (r : RList) : CfgRLE := + RList.rec + (CfgRLE.mk Phase.pT RList.nil a r) + (fun v k_l l_tail _ => + RList.rec + (CfgRLE.mk Phase.pT (RList.cons v k_l l_tail) a RList.nil) + (fun v0 c0 r_a _ => + RList.rec + (CfgRLE.mk Phase.pT (RList.cons v k_l l_tail) a (RList.cons v0 c0 RList.nil)) + (fun v1 n r_b _ => + RList.rec + (CfgRLE.mk Phase.pT (RList.cons v k_l l_tail) a (RList.cons v0 c0 (RList.cons v1 n + RList.nil))) + (fun v2 c2 r3 _ => + Bool.rec + (CfgRLE.mk Phase.pT (RList.cons v k_l l_tail) a (RList.cons v0 c0 (RList.cons v1 + n (RList.cons v2 c2 r3)))) + (do_cycle (Nat.beq v 3) k_l l_tail n r3) + (Bool.and (Nat.beq a 1) + (Bool.and (Bool.or (Nat.beq v 2) (Nat.beq v 3)) + (Bool.and (Nat.beq v0 0) + (Bool.and (Nat.beq c0 0) + (Bool.and (Nat.beq v1 1) + (Bool.and (Nat.beq v2 0) (Nat.beq c2 0)))))))) + r_b) + r_a) + r) + l + +def step_S (l : RList) (a : Nat) (r : RList) : CfgRLE := + Bool.rec + (step_S_pos l a r) + (step_S_a0 l r) + (Nat.beq a 0) + +def rle_step_unpacked (p : Phase) (l : RList) (a : Nat) (r : RList) : CfgRLE := + Phase.rec (step_S l a r) (step_T l a r) (step_U l a r) (step_V l a r) p + +def rp_step (_ : Nat) (ih : Phase → RList → Nat → RList → CfgRLE) + (p : Phase) (l : RList) (a : Nat) (r : RList) : CfgRLE := + CfgRLE.rec ih (ih p l a r) + +def run_pow (k : Nat) (p : Phase) (l : RList) (a : Nat) (r : RList) : CfgRLE := + (Nat.rec rle_step_unpacked rp_step k : Phase → RList → Nat → RList → CfgRLE) p l a r + +def run_seq : List Nat → CfgRLE → CfgRLE + | [], c => c + | k :: ks, c => CfgRLE.rec (fun p l a r => run_seq ks (run_pow k p l a r)) c + +-- ============================================================================ +-- Soundness Proof of Fast Kernel RLE Evaluator +-- ============================================================================ + +theorem rep_add (v m n : Nat) (xs : List Nat) : + rep v m ++ (rep v n ++ xs) = rep v (m + n) ++ xs := by + induction m with + | zero => simp + | succ m ih => simp only [Nat.succ_add, rep_succ, List.cons_append, ih] + +@[simp] +theorem decodeR_pushRep (v k : Nat) (l : RList) : + decodeR (pushRep v k l) = rep v (k + 1) ++ decodeR l := by + cases l with + | nil => simp [pushRep, decodeR] + | cons w m t => + dsimp only [pushRep] + cases hvw : Nat.beq v w with + | false => rfl + | true => + have heq : v = w := Nat.eq_of_beq_eq_true hvw + subst heq + change decodeR (bindNat (k + (m + 1)) (fun km => RList.cons v km t)) = _ + rw [bindNat_eq] + dsimp only [decodeR] + rw [rep_add, show (k + 1) + (m + 1) = k + (m + 1) + 1 by omega] + +@[simp] +theorem decodeR_push1 (v : Nat) (l : RList) : + decodeR (push1 v l) = v :: decodeR l := + decodeR_pushRep v 0 l + +@[simp] +theorem decodeR_pushRepN (v n : Nat) (l : RList) : + decodeR (pushRepN v n l) = rep v n ++ decodeR l := by + cases n with + | zero => rfl + | succ k => exact decodeR_pushRep v k l + +theorem decodeR_cons_pos {v c : Nat} (t : RList) (hc : Nat.beq c 0 = false) : + decodeR (RList.cons v c t) = v :: decodeR (RList.cons v (c - 1) t) := by + have hne : c ≠ 0 := Nat.ne_of_beq_eq_false hc + have heq : c + 1 = (c - 1) + 1 + 1 := by omega + dsimp only [decodeR] + rw [heq, rep_succ, List.cons_append] + +theorem popRList_spec {F : List Nat → Cfg (Fin 2) (Fin 6)} (h0 : F [] = F [0]) + (xs : RList) (k : Nat → RList → CfgRLE) + (hk : ∀ v t, (F (v :: decodeR t)) [target_tm]⊢* (decodeCfg (k v t))) : + (F (decodeR xs)) [target_tm]⊢* (decodeCfg (popRList xs k)) := by + cases xs with + | nil => + change (F []) [target_tm]⊢* (decodeCfg (k 0 RList.nil)) + rw [h0] + exact hk 0 RList.nil + | cons v c t => + dsimp only [popRList] + cases hc : Nat.beq c 0 with + | true => + have hc0 : c = 0 := Nat.eq_of_beq_eq_true hc + subst hc0 + exact hk v t + | false => + change (F (decodeR (RList.cons v c t))) [target_tm]⊢* + (decodeCfg (bindNat (c - 1) (fun c' => k v (RList.cons v c' t)))) + rw [bindNat_eq, decodeR_cons_pos t hc] + exact hk v (RList.cons v (c - 1) t) + +theorem S_nil_l (a : Nat) (r : List Nat) : S [] a r = S [0] a r := Sblankl [] a r +theorem S_nil_l1 (x0 a : Nat) (r : List Nat) : S [x0] a r = S [x0, 0] a r := Sblankl [x0] a r +theorem U_nil_l (a : Nat) (r : List Nat) : U [] a r = U [0] a r := Ublankl [] a r +theorem S_nil_r (l : List Nat) (a : Nat) : S l a [] = S l a [0] := Sblankr l a [] +theorem S_nil_r3 (l : List Nat) (a n : Nat) : + S l a (0 :: (rep 1 (n + 1) ++ [0])) = S l a (0 :: (rep 1 (n + 1) ++ [0, 0])) := by + have h := Sblankr l a (0 :: (rep 1 (n + 1) ++ [0])) + simpa only [List.cons_append, List.append_assoc, List.nil_append] using h +theorem U_nil_r (l : List Nat) (a : Nat) : U l a [] = U l a [0] := Ublankr l a [] +theorem T_nil_r (l : List Nat) (a : Nat) : T l a [] = T l a [0] := Tblankr l a [] +theorem T_nil_r1 (l : List Nat) (a c0 : Nat) : T l a [c0] = T l a [c0, 0] := Tblankr l a [c0] +theorem T_nil_r2 (l : List Nat) (a c0 c1 : Nat) : T l a [c0, c1] = T l a [c0, c1, 0] := + Tblankr l a [c0, c1] +theorem V_nil_r (l : List Nat) (a : Nat) : V l a [] = V l a [0] := Vblankr l a [] +theorem V_nil_r1 (l : List Nat) (a c0 : Nat) : V l a [c0] = V l a [c0, 0] := Vblankr l a [c0] + +theorem nat_not_le_of_ble_eq_false {a b : Nat} (h : Nat.ble a b = false) : ¬ (a ≤ b) := by + intro hle + have h1 : Nat.ble a b = true := Nat.ble_eq_true_of_le hle + rw [h] at h1 + contradiction + +theorem step_U_spec (l : RList) (a : Nat) (r : RList) : + (U (decodeR l) a (decodeR r)) [target_tm]⊢* (decodeCfg (step_U l a r)) := by + unfold step_U + cases ha : Nat.beq a 0 with + | false => + have hne : a ≠ 0 := Nat.ne_of_beq_eq_false ha + change _ [target_tm]⊢* (decodeCfg (bindNat (a - 1) (fun a' => + CfgRLE.mk Phase.pS l a' (push1 0 r)))) + simp only [bindNat_eq, decodeCfg, decodeR_push1] + rw [show a = (a - 1) + 1 by omega] + exact Upos (decodeR l) (a - 1) (decodeR r) + | true => + have ha0 : a = 0 := Nat.eq_of_beq_eq_true ha + subst ha0 + refine popRList_spec (F := + fun xs => U xs 0 (decodeR r)) (U_nil_l 0 (decodeR r)) l _ (fun x0 l1 => ?_) + refine popRList_spec (F := + fun ys => U (x0 :: decodeR l1) 0 ys) (U_nil_r (x0 :: decodeR l1) 0) r _ (fun c r1 => ?_) + unfold step_U_a0_c + cases hc0 : Nat.beq c 0 with + | true => + have hc : c = 0 := Nat.eq_of_beq_eq_true hc0 + subst hc + change _ [target_tm]⊢* (decodeCfg (bindNat (x0 + 2) (fun x02 => + CfgRLE.mk Phase.pT l1 x02 r1))) + simp only [bindNat_eq, decodeCfg] + exact Uzero0 (decodeR l1) x0 (decodeR r1) + | false => + dsimp only + cases hc1 : Nat.beq c 1 with + | true => + have hc : c = 1 := Nat.eq_of_beq_eq_true hc1 + subst hc + change _ [target_tm]⊢* (decodeCfg (bindNat (x0 + 2) (fun x02 => + CfgRLE.mk Phase.pT (push1 x02 l1) 0 r1))) + simp only [bindNat_eq, decodeCfg, decodeR_push1] + exact Uzero1 (decodeR l1) x0 (decodeR r1) + | false => + simp only [decodeCfg, decodeR_push1] + exact ⟨0, rfl⟩ + +theorem step_V_spec (l : RList) (a : Nat) (r : RList) : + (V (decodeR l) a (decodeR r)) [target_tm]⊢* (decodeCfg (step_V l a r)) := by + unfold step_V + refine popRList_spec (F := + fun ys => V (decodeR l) a ys) (V_nil_r (decodeR l) a) r _ (fun c0 r1 => ?_) + cases hc0 : Nat.beq c0 0 with + | false => + have hne : c0 ≠ 0 := Nat.ne_of_beq_eq_false hc0 + change _ [target_tm]⊢* (decodeCfg (bindNat (c0 - 1) (fun c0' => + CfgRLE.mk Phase.pS l a (push1 0 (push1 c0' r1))))) + simp only [bindNat_eq, decodeCfg, decodeR_push1] + rw [show c0 = (c0 - 1) + 1 by omega] + exact Vpos (decodeR l) a (c0 - 1) (decodeR r1) + | true => + have hc : c0 = 0 := Nat.eq_of_beq_eq_true hc0 + subst hc + refine popRList_spec (F := + fun ys => V (decodeR l) a (0 :: ys)) (V_nil_r1 (decodeR l) a 0) r1 _ (fun c1 r2 => ?_) + unfold step_V_c0_0 + cases hc1 : Nat.beq c1 0 with + | true => + have hc1_0 : c1 = 0 := Nat.eq_of_beq_eq_true hc1 + subst hc1_0 + change _ [target_tm]⊢* (decodeCfg (bindNat (a + 2) (fun a2 => CfgRLE.mk Phase.pT l a2 r2))) + simp only [bindNat_eq, decodeCfg] + exact Vzero0 (decodeR l) a (decodeR r2) + | false => + dsimp only + cases hc1_1 : Nat.beq c1 1 with + | true => + have hc1_eq : c1 = 1 := Nat.eq_of_beq_eq_true hc1_1 + subst hc1_eq + change _ [target_tm]⊢* (decodeCfg (bindNat (a + 2) (fun a2 => + CfgRLE.mk Phase.pT (push1 a2 l) 0 r2))) + simp only [bindNat_eq, decodeCfg, decodeR_push1] + exact Vzero1 (decodeR l) a (decodeR r2) + | false => + simp only [decodeCfg, decodeR_push1] + exact ⟨0, rfl⟩ + +theorem step_T_c0_0_fallback_spec (l : RList) (a : Nat) (r1 : RList) : + (T (decodeR l) a (0 :: decodeR r1)) [target_tm]⊢* (decodeCfg (step_T_c0_0_fallback l a r1)) := + by + unfold step_T_c0_0_fallback + refine popRList_spec (F := + fun ys => T (decodeR l) a (0 :: ys)) (T_nil_r1 (decodeR l) a 0) r1 _ (fun c1 r2 => ?_) + cases hc1 : Nat.beq c1 0 with + | false => + have hne : c1 ≠ 0 := Nat.ne_of_beq_eq_false hc1 + change _ [target_tm]⊢* (decodeCfg (bindNat (c1 - 1) (fun c1' => + CfgRLE.mk Phase.pT (push1 a l) 1 (push1 c1' r2)))) + simp only [bindNat_eq, decodeCfg, decodeR_push1] + rw [show c1 = (c1 - 1) + 1 by omega] + exact Tmix (decodeR l) a (c1 - 1) (decodeR r2) + | true => + have hc1_0 : c1 = 0 := Nat.eq_of_beq_eq_true hc1 + subst hc1_0 + refine popRList_spec (F := + fun ys => T (decodeR l) a (0 :: 0 :: ys)) (T_nil_r2 (decodeR l) a 0 0) r2 _ (fun c2 r3 => + ?_) + change _ [target_tm]⊢* (decodeCfg (bindNat (c2 + 1) (fun c2' => + CfgRLE.mk Phase.pU l a (push1 0 (push1 c2' r3))))) + simp only [bindNat_eq, decodeCfg, decodeR_push1] + exact Tzero (decodeR l) a c2 (decodeR r3) + +theorem step_T_c0_0_spec (l : RList) (a : Nat) (r1 : RList) : + (T (decodeR l) a (0 :: decodeR r1)) [target_tm]⊢* (decodeCfg (step_T_c0_0 l a r1)) := by + cases r1 with + | nil => exact step_T_c0_0_fallback_spec l a RList.nil + | cons v1 k1 t1 => + dsimp only [step_T_c0_0] + cases hv1 : Nat.beq v1 1 with + | false => exact step_T_c0_0_fallback_spec l a (RList.cons v1 k1 t1) + | true => + have hv : v1 = 1 := Nat.eq_of_beq_eq_true hv1 + subst hv + simp only [decodeCfg, decodeR_pushRepN, decodeR_push1, decodeR] + exact Tmixs k1 (decodeR l) a (decodeR t1) + +theorem step_T_base_spec (l : RList) (a : Nat) (r : RList) : + (T (decodeR l) a (decodeR r)) [target_tm]⊢* (decodeCfg (step_T_base l a r)) := by + unfold step_T_base + refine popRList_spec (F := + fun ys => T (decodeR l) a ys) (T_nil_r (decodeR l) a) r _ (fun c0 r1 => ?_) + cases hc0 : Nat.beq c0 0 with + | true => + have hc : c0 = 0 := Nat.eq_of_beq_eq_true hc0 + subst hc + exact step_T_c0_0_spec l a r1 + | false => + have hne : c0 ≠ 0 := Nat.ne_of_beq_eq_false hc0 + dsimp only + cases hc3 : Nat.ble 3 c0 with + | false => + change _ [target_tm]⊢* (decodeCfg (bindNat (c0 - 1) (fun c0' => + CfgRLE.mk Phase.pV l (a + 1) (push1 c0' r1)))) + simp only [bindNat_eq, decodeCfg, decodeR_push1] + rw [show c0 = (c0 - 1) + 1 by omega] + exact Tpos (decodeR l) a (c0 - 1) (decodeR r1) + | true => + have hle : 3 ≤ c0 := Nat.le_of_ble_eq_true hc3 + change _ [target_tm]⊢* (decodeCfg + (bindNat (c0 / 3) (fun q => bindNat (q - 1) (fun q1 => bindNat (c0 % 3) (fun rem => + bindNat (a + 1) (fun a1 => + CfgRLE.mk Phase.pT (pushRepN 2 q1 (push1 a1 l)) 1 (push1 rem r1))))))) + simp only [bindNat_eq, decodeCfg, decodeR_pushRepN, decodeR_push1] + have hdiv : ((c0 / 3 - 1) + 1) * 3 + c0 % 3 = c0 := by omega + have hstep := Triples (c0 / 3 - 1) (decodeR l) a (c0 % 3) (decodeR r1) + rw [hdiv] at hstep + exact hstep + +theorem step_T_spec (l : RList) (a : Nat) (r : RList) : + (T (decodeR l) a (decodeR r)) [target_tm]⊢* (decodeCfg (step_T l a r)) := by + cases r with + | nil => exact step_T_base_spec l a RList.nil + | cons v k t => + dsimp only [step_T] + cases hok : Bool.and (Nat.beq a 0) (Bool.and (Nat.beq v 1) (Bool.not (Nat.beq k 0))) with + | false => exact step_T_base_spec l a (RList.cons v k t) + | true => + have ⟨ha, hvk⟩ := Bool.and_eq_true_iff.mp hok + have ⟨hv, _⟩ := Bool.and_eq_true_iff.mp hvk + have ha0 : a = 0 := Nat.eq_of_beq_eq_true ha + have hv1 : v = 1 := Nat.eq_of_beq_eq_true hv + subst ha0; subst hv1 + change _ [target_tm]⊢* (decodeCfg + (bindNat ((k + 1) / 2) (fun m => bindNat ((k + 1) % 2) (fun rem1 => + CfgRLE.mk Phase.pT (pushRepN 3 m l) 0 (Bool.rec (push1 1 t) t (Nat.beq rem1 0)))))) + simp only [bindNat_eq] + cases hrem : Nat.beq ((k + 1) % 2) 0 with + | true => + have hrem0 : (k + 1) % 2 = 0 := Nat.eq_of_beq_eq_true hrem + have hk : ((k + 1) / 2) * 2 = k + 1 := by omega + simp only [decodeCfg, decodeR_pushRepN, decodeR] + have hstep := Pairs ((k + 1) / 2) (decodeR l) (decodeR t) + rw [hk] at hstep + exact hstep + | false => + have hrem_ne : (k + 1) % 2 ≠ 0 := Nat.ne_of_beq_eq_false hrem + have hk : ((k + 1) / 2) * 2 + 1 = k + 1 := by omega + simp only [decodeCfg, decodeR_pushRepN, decodeR_push1, decodeR] + have hstep := Pairs ((k + 1) / 2) (decodeR l) (1 :: decodeR t) + rw [rep_snoc, hk] at hstep + exact hstep + +theorem step_S_a0_fallback_spec (l : RList) (c : Nat) (r1 : RList) : + (S (decodeR l) 0 (c :: decodeR r1)) [target_tm]⊢* (decodeCfg (step_S_a0_fallback l c r1)) := by + unfold step_S_a0_fallback + refine popRList_spec (F := + fun xs => S xs 0 (c :: decodeR r1)) (S_nil_l 0 (c :: decodeR r1)) l _ (fun x0 l1 => ?_) + cases hx0 : Nat.beq x0 0 with + | false => + have hne : x0 ≠ 0 := Nat.ne_of_beq_eq_false hx0 + change _ [target_tm]⊢* (decodeCfg + (bindNat (x0 - 1) (fun x0' => bindNat (c + 1) (fun c1 => + CfgRLE.mk Phase.pS l1 x0' (push1 0 (push1 c1 r1)))))) + simp only [bindNat_eq, decodeCfg, decodeR_push1] + rw [show x0 = (x0 - 1) + 1 by omega] + exact Szero (decodeR l1) (x0 - 1) c (decodeR r1) + | true => + have hx0_0 : x0 = 0 := Nat.eq_of_beq_eq_true hx0 + subst hx0_0 + refine popRList_spec (F := + fun xs => + S (0 :: xs) 0 (c :: decodeR r1)) (S_nil_l1 0 0 (c :: decodeR r1)) l1 _ (fun x1 l2 => ?_) + change _ [target_tm]⊢* (decodeCfg + (bindNat (c + 1) (fun c1 => CfgRLE.mk Phase.pU l2 x1 (push1 0 (push1 c1 r1))))) + simp only [bindNat_eq, decodeCfg, decodeR_push1] + exact Sedge (decodeR l2) x1 c (decodeR r1) + +theorem step_S_a0_spec (l r : RList) : + (S (decodeR l) 0 (decodeR r)) [target_tm]⊢* (decodeCfg (step_S_a0 l r)) := by + unfold step_S_a0 + refine popRList_spec (F := + fun ys => S (decodeR l) 0 ys) (S_nil_r (decodeR l) 0) r _ (fun c r1 => ?_) + cases l with + | nil => exact step_S_a0_fallback_spec RList.nil c r1 + | cons v k t => + dsimp only + cases hv : Nat.beq v 1 with + | false => exact step_S_a0_fallback_spec (RList.cons v k t) c r1 + | true => + have hv1 : v = 1 := Nat.eq_of_beq_eq_true hv + subst hv1 + change _ [target_tm]⊢* (decodeCfg + (bindNat (c + 1) (fun c1 => CfgRLE.mk Phase.pS t 0 (push1 0 (pushRepN 1 k (push1 c1 r1)))))) + simp only [bindNat_eq, decodeCfg, decodeR_push1, decodeR_pushRepN, decodeR] + exact Szeros k (decodeR t) c (decodeR r1) + +theorem step_S_pos_spec (l : RList) (a : Nat) (r : RList) (ha : Nat.beq a 0 = false) : + (S (decodeR l) a (decodeR r)) [target_tm]⊢* (decodeCfg (step_S_pos l a r)) := by + have hne : a ≠ 0 := Nat.ne_of_beq_eq_false ha + have hspos : (S (decodeR l) a (decodeR r)) [target_tm]⊢* (T (decodeR l) a (decodeR r)) := by + rw [show a = (a - 1) + 1 by omega]; exact Spos (decodeR l) (a - 1) (decodeR r) + cases l with + | nil => exact hspos + | cons v k_l l_tail => + cases r with + | nil => exact hspos + | cons v0 c0 r_a => + cases r_a with + | nil => exact hspos + | cons v1 n r_b => + cases r_b with + | nil => exact hspos + | cons v2 c2 r3 => + dsimp only [step_S_pos] + cases hok : Bool.and (Nat.beq a 1) + (Bool.and (Bool.or (Nat.beq v 2) (Nat.beq v 3)) + (Bool.and (Nat.beq v0 0) + (Bool.and (Nat.beq c0 0) + (Bool.and (Nat.beq v1 1) + (Bool.and (Nat.beq v2 0) (Nat.beq c2 0)))))) with + | false => exact hspos + | true => + have ⟨ha1, h1⟩ := Bool.and_eq_true_iff.mp hok + have ⟨hv23, h2⟩ := Bool.and_eq_true_iff.mp h1 + have ⟨hv0, h3⟩ := Bool.and_eq_true_iff.mp h2 + have ⟨hc0, h4⟩ := Bool.and_eq_true_iff.mp h3 + have ⟨hv1, h5⟩ := Bool.and_eq_true_iff.mp h4 + have ⟨hv2, hc2⟩ := Bool.and_eq_true_iff.mp h5 + have ha_eq : a = 1 := Nat.eq_of_beq_eq_true ha1 + have hv0_eq : v0 = 0 := Nat.eq_of_beq_eq_true hv0 + have hc0_eq : c0 = 0 := Nat.eq_of_beq_eq_true hc0 + have hv1_eq : v1 = 1 := Nat.eq_of_beq_eq_true hv1 + have hv2_eq : v2 = 0 := Nat.eq_of_beq_eq_true hv2 + have hc2_eq : c2 = 0 := Nat.eq_of_beq_eq_true hc2 + subst ha_eq; subst hv0_eq; subst hc0_eq; subst hv1_eq; subst hv2_eq; subst hc2_eq + unfold do_cycle + change (S (decodeR (RList.cons v k_l l_tail)) 1 (0 :: (rep 1 (n + 1) ++ + 0 :: decodeR r3))) [target_tm]⊢* _ + refine popRList_spec (F := + fun ys => S (decodeR (RList.cons v k_l l_tail)) 1 (0 :: (rep 1 (n + 1) ++ 0 :: ys))) + (S_nil_r3 (decodeR (RList.cons v k_l l_tail)) 1 n) r3 _ (fun c r_tail => ?_) + simp only [bindNat_eq] + cases hv3 : Nat.beq v 3 with + | true => + have hv_eq : v = 3 := Nat.eq_of_beq_eq_true hv3 + subst hv_eq + change _ [target_tm]⊢* (decodeCfg + (CfgRLE.mk Phase.pS l_tail 1 (push1 0 (pushRep 1 (n + (k_l + 1)) (push1 0 (push1 + ((k_l + 1) * 2 + c) r_tail)))))) + simp only [decodeCfg, decodeR_push1, decodeR_pushRep, decodeR] + have hcyc := Cycles (k_l + 1) n (decodeR l_tail) c (decodeR r_tail) + rw [show n + 1 + (k_l + 1) = n + (k_l + 1) + 1 by omega] at hcyc + exact hcyc + | false => + have hv2 : Nat.beq v 2 = true := by + cases Bool.or_eq_true_iff.mp hv23 with + | inl h => exact h + | inr h => rw [hv3] at h; contradiction + have hv_eq : v = 2 := Nat.eq_of_beq_eq_true hv2 + subst hv_eq + change _ [target_tm]⊢* (decodeCfg + (CfgRLE.mk Phase.pS l_tail 1 (push1 0 (pushRep 1 (n + (k_l + 1)) (push1 0 (push1 + ((k_l + 1) + c) r_tail)))))) + simp only [decodeCfg, decodeR_push1, decodeR_pushRep, decodeR] + have hcyc := Cycles2 (k_l + 1) n (decodeR l_tail) c (decodeR r_tail) + rw [show n + 1 + (k_l + 1) = n + (k_l + 1) + 1 by omega] at hcyc + exact hcyc + +theorem step_S_spec (l : RList) (a : Nat) (r : RList) : + (S (decodeR l) a (decodeR r)) [target_tm]⊢* (decodeCfg (step_S l a r)) := by + unfold step_S + cases ha : Nat.beq a 0 with + | true => + have ha0 : a = 0 := Nat.eq_of_beq_eq_true ha + subst ha0 + exact step_S_a0_spec l r + | false => + exact step_S_pos_spec l a r ha + +theorem rle_step_unpacked_spec (p : Phase) (l : RList) (a : Nat) (r : RList) : + (decodeCfg (CfgRLE.mk p l a r)) [target_tm]⊢* (decodeCfg (rle_step_unpacked p l a r)) := by + cases p with + | pS => exact step_S_spec l a r + | pT => exact step_T_spec l a r + | pU => exact step_U_spec l a r + | pV => exact step_V_spec l a r + +theorem run_pow_spec (k : Nat) (p : Phase) (l : RList) (a : Nat) (r : RList) : + (decodeCfg (CfgRLE.mk p l a r)) [target_tm]⊢* (decodeCfg (run_pow k p l a r)) := by + induction k generalizing p l a r with + | zero => exact rle_step_unpacked_spec p l a r + | succ k ih => + change (decodeCfg (CfgRLE.mk p l a r)) [target_tm]⊢* (decodeCfg (CfgRLE.rec (run_pow k) (run_pow + k p l a r))) + have h1 := ih p l a r + cases hc : run_pow k p l a r with + | mk p' l' a' r' => + rw [hc] at h1 + exact stepStar_trans_eq h1 (ih p' l' a' r') + +theorem run_seq_spec (ks : List Nat) (c : CfgRLE) : + (decodeCfg c) [target_tm]⊢* (decodeCfg (run_seq ks c)) := by + induction ks generalizing c with + | nil => exact ⟨0, rfl⟩ + | cons k ks ih => + cases c with + | mk p l a r => + change (decodeCfg (CfgRLE.mk p l a r)) [target_tm]⊢* (decodeCfg (run_seq ks (run_pow k p l a + r))) + exact stepStar_trans_eq (run_pow_spec k p l a r) (ih (run_pow k p l a r)) + +def cfg_init : CfgRLE := CfgRLE.mk Phase.pT RList.nil 2 RList.nil +def cfg_cap : CfgRLE := + CfgRLE.mk Phase.pT RList.nil 2 + (RList.cons 0 0 (RList.cons 1 0 (RList.cons 0 0 (RList.cons 6 0 + (RList.cons 1 681 (RList.cons 0 0 (RList.cons 1028 0 RList.nil))))))) + + +set_option maxRecDepth 200000 in +set_option maxHeartbeats 10000000 in +-- Bounded RLE simulation over 9 rounds requires higher recursion depth and heartbeats. +theorem reach_cap_rle : + run_seq [15, 13, 11, 10, 7, 6, 4, 1, 0] cfg_init = cfg_cap := by decide +kernel + +theorem init_to_cap : (init []) [target_tm]⊢* (cap 339) := by + have h1 := init_to_T + have h2 := run_seq_spec [15, 13, 11, 10, 7, 6, 4, 1, 0] cfg_init + rw [reach_cap_rle] at h2 + exact stepStar_trans_eq h1 h2 + +theorem multiStep_none_add {c : Cfg (Fin 2) (Fin 6)} {k : Nat} + (h : multiStep target_tm c k = none) (d : Nat) : + multiStep target_tm c (k + d) = none := by + rw [multiStep_add_eq, h]; rfl + +theorem reach_arbitrarily_long : + ∀ m : Nat, ∃ N : Nat, m ≤ N ∧ multiStep target_tm (init []) N = some (cap (m + 339)) + | 0 => by + obtain ⟨N₀, hN₀⟩ := init_to_cap + exact ⟨N₀, Nat.zero_le N₀, hN₀⟩ + | m + 1 => by + obtain ⟨N, h_le, hN⟩ := reach_arbitrarily_long m + obtain ⟨k, hk_pos, hk⟩ := cap_step (m + 339) + rw [show (m + 339) + 1 = m + 1 + 339 by omega] at hk + exact ⟨N + k, by omega, multiStep_trans_eq target_tm _ _ _ N k hN hk⟩ + + + + +theorem init_B_to_T : + (((default : TapeBlank) {{1}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢* (T [] 1 []) := by + simp only [T, LC, RC, W1, pow_zero_list_eq, pow_succ_list_eq, List.cons_append, List.nil_append] + execute + +def cfg_init_0702 : CfgRLE := CfgRLE.mk Phase.pT RList.nil 1 RList.nil +def cfg_cap_0702 : CfgRLE := + CfgRLE.mk Phase.pT RList.nil 2 + (RList.cons 0 0 (RList.cons 1 0 (RList.cons 0 0 (RList.cons 6 0 + (RList.cons 1 955 (RList.cons 0 0 (RList.cons 1439 0 RList.nil))))))) + +set_option maxRecDepth 200000 in +set_option maxHeartbeats 10000000 in +-- Bounded RLE simulation for twin 0702 over 9 rounds requires higher recursion depth. +theorem reach_cap_rle_0702 : + run_seq [15, 14, 13, 12, 10, 9, 6, 5, 3] cfg_init_0702 = cfg_cap_0702 := by decide +kernel + +theorem init_B_to_cap_0702 : + (((default : TapeBlank) {{1}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢* (cap 476) := by + have h1 := init_B_to_T + have h2 := run_seq_spec [15, 14, 13, 12, 10, 9, 6, 5, 3] cfg_init_0702 + rw [reach_cap_rle_0702] at h2 + exact stepStar_trans_eq h1 h2 + +theorem reach_arbitrarily_long_0702 : + ∀ m : Nat, ∃ N : Nat, m ≤ N ∧ + multiStep target_tm ((default : TapeBlank) {{1}}> default) N = some (cap (m + 476)) + | 0 => by + obtain ⟨N₀, hN₀⟩ := init_B_to_cap_0702 + exact ⟨N₀, Nat.zero_le N₀, hN₀⟩ + | m + 1 => by + obtain ⟨N, h_le, hN⟩ := reach_arbitrarily_long_0702 m + obtain ⟨k, hk_pos, hk⟩ := cap_step (m + 476) + rw [show (m + 476) + 1 = m + 1 + 476 by omega] at hk + exact ⟨N + k, by omega, multiStep_trans_eq target_tm _ _ _ N k hN hk⟩ + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg ⟨k, hk⟩ + cases h_step : step target_tm cfg with + | some cfg' => rfl + | none => + have h_none : multiStep target_tm (init []) (k + 1) = none := by + rw [multiStep_succ_eq, hk]; exact h_step + obtain ⟨N, h_ge, hN⟩ := reach_arbitrarily_long (k + 1) + have h_split : N = (k + 1) + (N - (k + 1)) := by omega + have h_none_N : multiStep target_tm (init []) N = none := by + rw [h_split] + exact multiStep_none_add h_none (N - (k + 1)) + rw [hN] at h_none_N + contradiction + +end + +end Solution + +public section + +open Solution in +theorem is_not_halt_from_0702 : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{1}}> default) [target]⊢* cfg) → + (step target cfg).isSome := by + intro cfg ⟨k, hk⟩ + cases h_step : step target_tm cfg with + | some cfg' => rfl + | none => + have h_none : + multiStep target_tm ((default : ListBlank (Fin 2)) {{1}}> default) (k + 1) = none := by + rw [multiStep_succ_eq, hk]; exact h_step + obtain ⟨N, h_ge, hN⟩ := reach_arbitrarily_long_0702 (k + 1) + have h_split : N = (k + 1) + (N - (k + 1)) := by omega + have h_none_N : + multiStep target_tm ((default : ListBlank (Fin 2)) {{1}}> default) N = none := by + rw [h_split] + exact multiStep_none_add h_none (N - (k + 1)) + rw [hN] at h_none_N + contradiction + +open Solution in +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0LD_1RC1RF_0RD1RA_1LE1RC_0LA0LD_0RCHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0LE_1LC1RA_HHH1LD_0RB1LF_1RD1LA_0LA0RD.lean b/BusyBeaver/BB6/NonHalt/M_1RB0LE_1LC1RA_HHH1LD_0RB1LF_1RD1LA_0LA0RD.lean new file mode 100644 index 00000000..60f9da81 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0LE_1LC1RA_HHH1LD_0RB1LF_1RD1LA_0LA0RD.lean @@ -0,0 +1,608 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0LE_1LC1RA_HHH1LD_0RB1LF_1RD1LA_0LA0RD + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LE_1LC1RA_HHH1LD_0RB1LF_1RD1LA_0LA0RD" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + +abbrev b0 : Fin 2 := 0 +abbrev b1 : Fin 2 := 1 + +@[reducible] def c0 (l : ListBlank (Fin 2)) : ListBlank (Fin 2) := ListBlank.cons b0 l +@[reducible] def c1 (l : ListBlank (Fin 2)) : ListBlank (Fin 2) := ListBlank.cons b1 l + +def cfg (q : Fin 6) (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some q, ⟨r.head, l, r.tail⟩⟩ + +@[simp] theorem zero_cons_default : ListBlank.cons (0 : Fin 2) default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = b0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +theorem init_eq_cfg : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = cfg A default default := rfl + +theorem multiStep_succ_of_step {c c' : Cfg (Fin 2) (Fin 6)} (n : ℕ) + (h : step target_tm c = some c') : + multiStep target_tm c (n + 1) = multiStep target_tm c' n := by + unfold multiStep + rw [Function.iterate_succ_apply] + change (Option.bind · (step target_tm))^[n] (step target_tm c) = _ + rw [h] + +@[simp] theorem multiStep_succ_end (c : Cfg (Fin 2) (Fin 6)) (n : ℕ) : + multiStep target_tm c (n + 1) = Option.bind (multiStep target_tm c n) (step target_tm) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +theorem multiStep_add (c₁ : Cfg (Fin 2) (Fin 6)) (n m : Nat) : + multiStep target_tm c₁ (n + m) = (multiStep target_tm c₁ n).bind (fun c₂ => multiStep target_tm c₂ m) := by + induction m with + | zero => simp [multiStep] + | succ m' ih => + rw [Nat.add_succ, multiStep_succ_end, ih, Option.bind_assoc] + simp_rw [multiStep_succ_end] + +theorem multiStep_trans (c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)) (n m : Nat) + (h₁ : multiStep target_tm c₁ n = some c₂) (h₂ : multiStep target_tm c₂ m = some c₃) : + multiStep target_tm c₁ (n + m) = some c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem multiStep_none_add {c : Cfg (Fin 2) (Fin 6)} {k : Nat} + (h : multiStep target_tm c k = none) (d : Nat) : + multiStep target_tm c (k + d) = none := by + rw [multiStep_add, h]; rfl + +inductive StepsStar : Cfg (Fin 2) (Fin 6) → Cfg (Fin 2) (Fin 6) → Prop + | refl (c) : StepsStar c c + | next {c c₁ c₂} : step target_tm c = some c₁ → StepsStar c₁ c₂ → StepsStar c c₂ + +def StepsPlus (c₁ c₂ : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ c', step target_tm c₁ = some c' ∧ StepsStar c' c₂ + +theorem StepsStar.trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h₁ : StepsStar c₁ c₂) (h₂ : StepsStar c₂ c₃) : StepsStar c₁ c₃ := by + induction h₁ with + | refl => exact h₂ + | next hs _ ih => exact StepsStar.next hs (ih h₂) + +theorem StepsStar.to_multiStep {c₁ c₂ : Cfg (Fin 2) (Fin 6)} + (h : StepsStar c₁ c₂) : ∃ n, multiStep target_tm c₁ n = some c₂ := by + induction h with + | refl => exact ⟨0, rfl⟩ + | next hs _ ih => + rcases ih with ⟨n, hn⟩ + exact ⟨n + 1, by rw [multiStep_succ_of_step n hs, hn]⟩ + +theorem StepsPlus.trans_star {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h₁ : StepsPlus c₁ c₂) (h₂ : StepsStar c₂ c₃) : StepsPlus c₁ c₃ := by + rcases h₁ with ⟨c', hs, hstar⟩ + exact ⟨c', hs, StepsStar.trans hstar h₂⟩ + +theorem StepsStar.trans_plus {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h₁ : StepsStar c₁ c₂) (h₂ : StepsPlus c₂ c₃) : StepsPlus c₁ c₃ := by + induction h₁ with + | refl => exact h₂ + | next hs _ ih => + rcases ih h₂ with ⟨c', hs', hstar'⟩ + exact ⟨_, hs, StepsStar.next hs' hstar'⟩ + +theorem StepsPlus.trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h₁ : StepsPlus c₁ c₂) (h₂ : StepsPlus c₂ c₃) : StepsPlus c₁ c₃ := by + rcases h₁ with ⟨c', hs, hstar⟩ + exact ⟨c', hs, StepsPlus.trans_star (StepsStar.trans_plus hstar h₂) (StepsStar.refl _) |> fun ⟨c'', hs'', hst⟩ => StepsStar.next hs'' hst⟩ + +theorem StepsPlus.to_multiStep {c₁ c₂ : Cfg (Fin 2) (Fin 6)} + (h : StepsPlus c₁ c₂) : ∃ n > 0, multiStep target_tm c₁ n = some c₂ := by + rcases h with ⟨c', hs, hstar⟩ + rcases hstar.to_multiStep with ⟨n, hn⟩ + exact ⟨n + 1, by omega, by rw [multiStep_succ_of_step n hs, hn]⟩ + +-- ============================================================================ +-- Canonical Tape Encodings `L1`, `R1`, `R01`, and `Hub` +-- ============================================================================ + +def L1 : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, l => l + | n + 1, l => c1 (L1 n l) + +def R1 : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, r => r + | n + 1, r => c1 (R1 n r) + +def R01 : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, r => r + | n + 1, r => c0 (c1 (R01 n r)) + +theorem step_cfg_right {q q' : Fin 6} {b a : Fin 2} + (h : target_tm q b = some (some q', Stmt.write a Dir.right)) + (l r : ListBlank (Fin 2)) : + step target_tm (cfg q l (ListBlank.cons b r)) = some (cfg q' (ListBlank.cons a l) r) := by + simp [cfg, step, h, Turing.Tape.write, Turing.Tape.move] + +theorem step_cfg_left {q q' : Fin 6} {b a : Fin 2} + (h : target_tm q b = some (some q', Stmt.write a Dir.left)) + (c : Fin 2) (l r : ListBlank (Fin 2)) : + step target_tm (cfg q (ListBlank.cons c l) (ListBlank.cons b r)) = + some (cfg q' l (ListBlank.cons c (ListBlank.cons a r))) := by + simp [cfg, step, h, Turing.Tape.write, Turing.Tape.move] + +theorem step_cfg_right_nil {q q' : Fin 6} {a : Fin 2} + (h : target_tm q (0 : Fin 2) = some (some q', Stmt.write a Dir.right)) + (l : ListBlank (Fin 2)) : + step target_tm (cfg q l default) = some (cfg q' (ListBlank.cons a l) default) := by + simpa using step_cfg_right h l default + +theorem step_cfg_left_nil {q q' : Fin 6} {a : Fin 2} + (h : target_tm q (0 : Fin 2) = some (some q', Stmt.write a Dir.left)) + (c : Fin 2) (l : ListBlank (Fin 2)) : + step target_tm (cfg q (ListBlank.cons c l) default) = + some (cfg q' l (ListBlank.cons c (ListBlank.cons a default))) := by + simpa using step_cfg_left h c l default + +theorem step_cfg_left_lnil {q q' : Fin 6} {b a : Fin 2} + (h : target_tm q b = some (some q', Stmt.write a Dir.left)) + (r : ListBlank (Fin 2)) : + step target_tm (cfg q default (ListBlank.cons b r)) = + some (cfg q' default (ListBlank.cons (0 : Fin 2) (ListBlank.cons a r))) := by + simpa using step_cfg_left h (0 : Fin 2) default r + +theorem step_cfg_left_both_nil {q q' : Fin 6} {a : Fin 2} + (h : target_tm q (0 : Fin 2) = some (some q', Stmt.write a Dir.left)) : + step target_tm (cfg q default default) = + some (cfg q' default (ListBlank.cons (0 : Fin 2) (ListBlank.cons a default))) := by + simpa using step_cfg_left h (0 : Fin 2) default default + +theorem star_right {q q' : Fin 6} {b a : Fin 2} + (h : target_tm q b = some (some q', Stmt.write a Dir.right)) + {l r : ListBlank (Fin 2)} {target : Cfg (Fin 2) (Fin 6)} + (hr : StepsStar (cfg q' (ListBlank.cons a l) r) target) : + StepsStar (cfg q l (ListBlank.cons b r)) target := + StepsStar.next (step_cfg_right h l r) hr + +theorem star_left {q q' : Fin 6} {b a : Fin 2} + (h : target_tm q b = some (some q', Stmt.write a Dir.left)) + {c : Fin 2} {l r : ListBlank (Fin 2)} {target : Cfg (Fin 2) (Fin 6)} + (hr : StepsStar (cfg q' l (ListBlank.cons c (ListBlank.cons a r))) target) : + StepsStar (cfg q (ListBlank.cons c l) (ListBlank.cons b r)) target := + StepsStar.next (step_cfg_left h c l r) hr + +theorem star_right_nil {q q' : Fin 6} {a : Fin 2} + (h : target_tm q (0 : Fin 2) = some (some q', Stmt.write a Dir.right)) + {l : ListBlank (Fin 2)} {target : Cfg (Fin 2) (Fin 6)} + (hr : StepsStar (cfg q' (ListBlank.cons a l) default) target) : + StepsStar (cfg q l default) target := + StepsStar.next (step_cfg_right_nil h l) hr + +theorem star_left_nil {q q' : Fin 6} {a : Fin 2} + (h : target_tm q (0 : Fin 2) = some (some q', Stmt.write a Dir.left)) + {c : Fin 2} {l : ListBlank (Fin 2)} {target : Cfg (Fin 2) (Fin 6)} + (hr : StepsStar (cfg q' l (ListBlank.cons c (ListBlank.cons a default))) target) : + StepsStar (cfg q (ListBlank.cons c l) default) target := + StepsStar.next (step_cfg_left_nil h c l) hr + +theorem star_left_lnil {q q' : Fin 6} {b a : Fin 2} + (h : target_tm q b = some (some q', Stmt.write a Dir.left)) + {r : ListBlank (Fin 2)} {target : Cfg (Fin 2) (Fin 6)} + (hr : StepsStar (cfg q' default (ListBlank.cons (0 : Fin 2) (ListBlank.cons a r))) target) : + StepsStar (cfg q default (ListBlank.cons b r)) target := + StepsStar.next (step_cfg_left_lnil h r) hr + +theorem star_left_both_nil {q q' : Fin 6} {a : Fin 2} + (h : target_tm q (0 : Fin 2) = some (some q', Stmt.write a Dir.left)) + {target : Cfg (Fin 2) (Fin 6)} + (hr : StepsStar (cfg q' default (ListBlank.cons (0 : Fin 2) (ListBlank.cons a default))) target) : + StepsStar (cfg q default default) target := + StepsStar.next (step_cfg_left_both_nil h) hr + +theorem plus_right {q q' : Fin 6} {b a : Fin 2} + (h : target_tm q b = some (some q', Stmt.write a Dir.right)) + {l r : ListBlank (Fin 2)} {target : Cfg (Fin 2) (Fin 6)} + (hr : StepsStar (cfg q' (ListBlank.cons a l) r) target) : + StepsPlus (cfg q l (ListBlank.cons b r)) target := + ⟨_, step_cfg_right h l r, hr⟩ + +macro "step_tm" : tactic => `(tactic| ( + dsimp -failIfUnchanged only [c0, c1, b0, b1] + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, zero_cons_default] + first + | refine star_right rfl ?_ + | refine star_left rfl ?_ + | refine star_right_nil rfl ?_ + | refine star_left_nil rfl ?_ + | refine star_left_lnil rfl ?_ + | refine star_left_both_nil rfl ?_)) + +macro "plus_right_tm" : tactic => `(tactic| ( + dsimp -failIfUnchanged only [c0, c1, b0, b1] + try simp only [zero_cons_default] + refine plus_right rfl ?_)) + +macro "exec_tm" n:num : tactic => `(tactic| ( + iterate $n step_tm + dsimp -failIfUnchanged only [c0, c1, b0, b1] + try simp only [zero_cons_default] + exact StepsStar.refl _)) + +theorem L1_add (m n : Nat) (l : ListBlank (Fin 2)) : L1 (m + n) l = L1 m (L1 n l) := by + induction m with + | zero => simp [L1] + | succ m ih => simp [L1, Nat.succ_add, ih] + +theorem R1_add (m n : Nat) (r : ListBlank (Fin 2)) : R1 (m + n) r = R1 m (R1 n r) := by + induction m with + | zero => simp [R1] + | succ m ih => simp [R1, Nat.succ_add, ih] + +theorem R01_add (m n : Nat) (r : ListBlank (Fin 2)) : R01 (m + n) r = R01 m (R01 n r) := by + induction m with + | zero => simp [R01] + | succ m ih => simp [R01, Nat.succ_add, ih] + +theorem R01_snoc : ∀ (c : Nat) (r : ListBlank (Fin 2)), R01 c (c0 (c1 r)) = c0 (c1 (R01 c r)) + | 0, _ => rfl + | c + 1, r => by simp [R01, R01_snoc c r] + +def Hub (c : Nat) : Cfg (Fin 2) (Fin 6) := + cfg A default (c0 (c0 (R1 c default))) + +theorem init_to_Hub3 : StepsStar (cfg A default default) (Hub 3) := by + dsimp -failIfUnchanged only [Hub, R1] + exec_tm 16 + +-- ============================================================================ +-- The Only Two Primitive 2-Step Loops in the Entire Machine! +-- ============================================================================ + +theorem scan_right_01 : ∀ (k : Nat) (l r : ListBlank (Fin 2)), + StepsStar (cfg A l (R01 k r)) (cfg A (L1 (2 * k) l) r) + | 0, l, r => StepsStar.refl _ + | k + 1, l, r => by + simp only [R01] + step_tm + step_tm + have h2 : L1 (2 * (k + 1)) l = L1 (2 * k) (c1 (c1 l)) := by + rw [show 2 * (k + 1) = 2 * k + 2 by omega, L1_add (2 * k) 2 l]; try rfl + rw [h2] + exact scan_right_01 k (c1 (c1 l)) r + +theorem scan_left_E11 : ∀ (k : Nat) (l r : ListBlank (Fin 2)), + StepsStar (cfg E (L1 (2 * k) l) (c1 r)) (cfg E l (c1 (R01 k r))) + | 0, l, r => StepsStar.refl _ + | k + 1, l, r => by + have h1 : L1 (2 * (k + 1)) l = c1 (c1 (L1 (2 * k) l)) := by + rw [show 2 * (k + 1) = 2 + 2 * k by omega, L1_add 2 (2 * k) l]; try rfl + rw [h1] + step_tm + step_tm + have h2 : R01 (k + 1) r = R01 k (c0 (c1 r)) := (R01_snoc k r).symm + rw [h2] + exact scan_left_E11 k l (c0 (c1 r)) + +-- ============================================================================ +-- Right-End Drain Rules (`even_step`, `drain_even`, `odd_step`, `drain_odd`) +-- ============================================================================ + +theorem step_A4_00 (l r : ListBlank (Fin 2)) : + StepsPlus (cfg A (c1 (c1 (c1 (c1 l)))) (c0 (c0 r))) + (cfg E l (c1 (c0 (c0 (R1 3 r))))) := by + dsimp -failIfUnchanged only [R1] + plus_right_tm + exec_tm 7 + +theorem even_step (k : Nat) (v r : ListBlank (Fin 2)) : + StepsPlus (cfg A (L1 (2 * k + 4) (c0 v)) (c0 (c0 r))) + (cfg A (L1 (2 * k + 2) v) (c0 (c0 (R1 3 r)))) := by + have hl : L1 (2 * k + 4) (c0 v) = c1 (c1 (c1 (c1 (L1 (2 * k) (c0 v))))) := by + rw [show 2 * k + 4 = 4 + 2 * k by omega, L1_add 4 (2 * k)]; try rfl + rw [hl] + refine StepsPlus.trans_star (step_A4_00 (L1 (2 * k) (c0 v)) r) ?_ + refine StepsStar.trans (scan_left_E11 k (c0 v) (c0 (c0 (R1 3 r)))) ?_ + step_tm + have hl2 : 2 * k + 2 = 2 * (k + 1) := by omega + rw [hl2] + exact scan_right_01 (k + 1) v (c0 (c0 (R1 3 r))) + +theorem even_base (r : ListBlank (Fin 2)) : + StepsPlus (cfg A (L1 2 default) (c0 (c0 r))) + (cfg A default (c0 (c0 (R1 3 r)))) := by + dsimp -failIfUnchanged only [L1, R1] + plus_right_tm + exec_tm 6 + +theorem drain_even : ∀ (k c : Nat), + StepsPlus (cfg A (L1 (2 * k + 2) default) (c0 (c0 (R1 c default)))) + (Hub (c + 3 * k + 3)) + | 0, c => by + unfold Hub + have hr : R1 3 (R1 c default) = R1 (c + 3) default := by + rw [← R1_add 3 c default, show 3 + c = c + 3 by omega] + simpa [hr] using even_base (R1 c default) + | k + 1, c => by + have hsplit : 2 * (k + 1) + 2 = 2 * k + 4 := by omega + rw [hsplit] + have h1 : L1 (2 * k + 4) default = L1 (2 * k + 4) (c0 default) := by simp + rw [h1] + have hs := even_step k default (R1 c default) + have hr : R1 3 (R1 c default) = R1 (c + 3) default := by + rw [← R1_add 3 c default, show 3 + c = c + 3 by omega] + rw [hr] at hs + refine StepsPlus.trans hs ?_ + simpa [show (c + 3) + 3 * k + 3 = c + 3 * (k + 1) + 3 by omega] using drain_even k (c + 3) + +theorem odd_step (k : Nat) (v r : ListBlank (Fin 2)) : + StepsPlus (cfg A (L1 (2 * k + 5) (c0 v)) (c0 (c0 r))) + (cfg A (L1 (2 * k + 1) (c0 (c1 v))) (c0 (c0 (R1 3 r)))) := by + have hl : L1 (2 * k + 5) (c0 v) = c1 (c1 (c1 (c1 (L1 (2 * k) (c1 (c0 v)))))) := by + rw [show 2 * k + 5 = 4 + (2 * k + 1) by omega, + L1_add 4 (2 * k + 1), + L1_add (2 * k) 1]; try rfl + rw [hl] + refine StepsPlus.trans_star (step_A4_00 (L1 (2 * k) (c1 (c0 v))) r) ?_ + refine StepsStar.trans (scan_left_E11 k (c1 (c0 v)) (c0 (c0 (R1 3 r)))) ?_ + iterate 5 step_tm + have hl2 : L1 (2 * k + 1) (c0 (c1 v)) = L1 (2 * k) (c1 (c0 (c1 v))) := by + rw [L1_add (2 * k) 1]; try rfl + rw [hl2] + exact scan_right_01 k (c1 (c0 (c1 v))) (c0 (c0 (R1 3 r))) + +theorem odd_base (k : Nat) (r : ListBlank (Fin 2)) : + StepsPlus (cfg A (L1 1 (c0 (L1 (2 * k + 2) default))) (c0 (c0 r))) + (cfg A (L1 (2 * k + 2) default) (c0 (c0 (R1 3 r)))) := by + have hstart : L1 1 (c0 (L1 (2 * k + 2) default)) = + c1 (c0 (c1 (c1 (L1 (2 * k) default)))) := by + rw [show 2 * k + 2 = 2 + 2 * k by omega, L1_add 2 (2 * k)]; try rfl + rw [hstart] + plus_right_tm + iterate 5 step_tm + refine StepsStar.trans (scan_left_E11 k default (c0 (c0 (R1 3 r)))) ?_ + step_tm + try simp only [zero_cons_default] + have heq : 2 * k + 2 = 2 * (k + 1) := by omega + rw [heq] + exact scan_right_01 (k + 1) default (c0 (c0 (R1 3 r))) + +theorem drain_odd_steps : ∀ (m e c : Nat), + StepsStar (cfg A (L1 (4 * m + 1) (c0 (L1 e default))) (c0 (c0 (R1 c default)))) + (cfg A (L1 1 (c0 (L1 (e + m) default))) (c0 (c0 (R1 (c + 3 * m) default)))) + | 0, e, c => by simpa using StepsStar.refl _ + | m + 1, e, c => by + have hsplit : 4 * (m + 1) + 1 = 2 * (2 * m) + 5 := by omega + rw [hsplit] + have hs := odd_step (2 * m) (L1 e default) (R1 c default) + have hr : R1 3 (R1 c default) = R1 (c + 3) default := by + rw [← R1_add 3 c default, show 3 + c = c + 3 by omega] + rw [hr] at hs + rcases hs with ⟨c', h1, hst⟩ + refine StepsStar.next h1 (StepsStar.trans hst ?_) + have h4m : 2 * (2 * m) + 1 = 4 * m + 1 := by omega + have he : c1 (L1 e default) = L1 (e + 1) default := rfl + rw [h4m, he] + simpa [show e + 1 + m = e + (m + 1) by omega, + show c + 3 + 3 * m = c + 3 * (m + 1) by omega] using drain_odd_steps m (e + 1) (c + 3) + +-- ============================================================================ +-- Main Pumping Phase (`P_step6`, `P_drain6`, `branch_mod6_0`, `branch_mod6_3`) +-- ============================================================================ + +theorem P_step6 (k : Nat) (r : ListBlank (Fin 2)) : + StepsStar (cfg A default (R01 (k + 1) (R1 6 r))) + (cfg A default (R01 (k + 5) r)) := by + refine StepsStar.trans (scan_right_01 (k + 1) default (R1 6 r)) ?_ + have hl1 : L1 (2 * (k + 1)) default = c1 (L1 (2 * k) (c1 default)) := by + rw [show 2 * (k + 1) = 1 + (2 * k + 1) by omega, L1_add 1 (2 * k + 1), L1_add (2 * k) 1]; try rfl + have hr1 : R1 6 r = c1 (R1 5 r) := rfl + rw [hl1, hr1] + step_tm + refine StepsStar.trans (scan_left_E11 k (c1 default) (c0 (R1 5 r))) ?_ + iterate 5 step_tm + try simp only [zero_cons_default] + refine StepsStar.trans (scan_right_01 k (c1 (c0 (c1 default))) (c0 (R1 5 r))) ?_ + have hr2 : R1 5 r = c1 (c1 (R1 3 r)) := rfl + rw [hr2] + iterate 3 step_tm + have hl2 : ListBlank.cons 1 (L1 (2 * k) (ListBlank.cons 1 (ListBlank.cons 0 (ListBlank.cons 1 default)))) = + L1 (2 * (k + 1)) (c0 (c1 default)) := by + rw [show 2 * (k + 1) = 1 + (2 * k + 1) by omega, L1_add 1 (2 * k + 1), L1_add (2 * k) 1]; try rfl + rw [hl2] + refine StepsStar.trans (scan_left_E11 (k + 1) (c0 (c1 default)) (c0 (R1 3 r))) ?_ + step_tm + refine StepsStar.trans (scan_right_01 (k + 2) (c1 default) (c0 (R1 3 r))) ?_ + have hr4 : R1 3 r = c1 (c1 (c1 r)) := rfl + rw [hr4] + iterate 3 step_tm + have hl3 : ListBlank.cons 1 (L1 (2 * (k + 2)) (ListBlank.cons 1 default)) = L1 (2 * (k + 3)) default := by + rw [show 2 * (k + 3) = 1 + (2 * (k + 2) + 1) by omega, + L1_add 1 (2 * (k + 2) + 1), L1_add (2 * (k + 2)) 1]; try rfl + rw [hl3] + refine StepsStar.trans (scan_left_E11 (k + 3) default (c0 (c1 r))) ?_ + step_tm + try simp only [zero_cons_default] + have hfin : R01 (k + 5) r = c0 (c1 (R01 (k + 3) (c0 (c1 r)))) := by + rw [show k + 5 = 1 + ((k + 3) + 1) by omega, R01_add 1 ((k + 3) + 1) r, R01_add (k + 3) 1 r]; try rfl + rw [hfin] + exact StepsStar.refl _ + +theorem P_drain6 : ∀ (j k : Nat) (r : ListBlank (Fin 2)), + StepsStar (cfg A default (R01 (k + 1) (R1 (6 * j) r))) + (cfg A default (R01 (4 * j + k + 1) r)) + | 0, k, r => by simpa [R1] using StepsStar.refl _ + | j + 1, k, r => by + have hsplit : R1 (6 * (j + 1)) r = R1 6 (R1 (6 * j) r) := by + rw [show 6 * (j + 1) = 6 + 6 * j by omega, R1_add 6 (6 * j) r] + rw [hsplit] + refine StepsStar.trans (P_step6 k (R1 (6 * j) r)) ?_ + simpa [show 4 * j + (k + 4) + 1 = 4 * (j + 1) + k + 1 by omega] using P_drain6 j (k + 4) r + +theorem Hub_enter_P (c : Nat) : + StepsStar (Hub (c + 1)) (cfg A default (R01 2 (R1 c default))) := by + unfold Hub + have hr : R1 (c + 1) default = c1 (R1 c default) := rfl + rw [hr] + dsimp -failIfUnchanged only [R01] + exec_tm 7 + +theorem branch_mod6_0 (j : Nat) : + StepsPlus (Hub (6 * j + 6)) (Hub (12 * j + 15)) := by + have hs0 : StepsStar (Hub (6 * j + 6)) (cfg A default (R01 (4 * j + 2) (R1 5 default))) := by + refine StepsStar.trans (by simpa [show 6 * j + 6 = (6 * j + 5) + 1 by omega] using Hub_enter_P (6 * j + 5)) ?_ + have hr : R1 (6 * j + 5) default = R1 (6 * j) (R1 5 default) := R1_add (6 * j) 5 default + rw [hr] + exact P_drain6 j 1 (R1 5 default) + refine StepsStar.trans_plus hs0 ?_ + refine StepsStar.trans_plus (scan_right_01 (4 * j + 2) default (R1 5 default)) ?_ + have hl1 : L1 (2 * (4 * j + 2)) default = c1 (L1 (2 * (4 * j + 1)) (c1 default)) := by + rw [show 2 * (4 * j + 2) = 1 + (2 * (4 * j + 1) + 1) by omega, + L1_add 1 (2 * (4 * j + 1) + 1), L1_add (2 * (4 * j + 1)) 1]; try rfl + rw [hl1] + have hs1 : StepsStar (cfg A (c1 (L1 (2 * (4 * j + 1)) (c1 default))) (R1 5 default)) + (cfg A (L1 (2 * (4 * j + 4) + 2) default) (c0 (c0 (R1 0 default)))) := by + dsimp -failIfUnchanged only [R1] + step_tm + refine StepsStar.trans (scan_left_E11 (4 * j + 1) (c1 default) (c0 (c1 (c1 (c1 (c1 default)))))) ?_ + iterate 5 step_tm + try simp only [zero_cons_default] + refine StepsStar.trans (scan_right_01 (4 * j + 1) (c1 (c0 (c1 default))) (c0 (c1 (c1 (c1 (c1 default)))))) ?_ + iterate 3 step_tm + have hl2 : ListBlank.cons 1 (L1 (2 * (4 * j + 1)) (ListBlank.cons 1 (ListBlank.cons 0 (ListBlank.cons 1 default)))) = + L1 (2 * (4 * j + 2)) (c0 (c1 default)) := by + rw [show 2 * (4 * j + 2) = 1 + (2 * (4 * j + 1) + 1) by omega, + L1_add 1 (2 * (4 * j + 1) + 1), L1_add (2 * (4 * j + 1)) 1]; try rfl + rw [hl2] + refine StepsStar.trans (scan_left_E11 (4 * j + 2) (c0 (c1 default)) (c0 (c1 (c1 default)))) ?_ + step_tm + refine StepsStar.trans (scan_right_01 (4 * j + 3) (c1 default) (c0 (c1 (c1 default)))) ?_ + iterate 3 step_tm + try simp only [zero_cons_default] + have hl3 : ListBlank.cons 1 (L1 (2 * (4 * j + 3)) (ListBlank.cons 1 default)) = L1 (2 * (4 * j + 4)) default := by + rw [show 2 * (4 * j + 4) = 1 + (2 * (4 * j + 3) + 1) by omega, + L1_add 1 (2 * (4 * j + 3) + 1), L1_add (2 * (4 * j + 3)) 1]; try rfl + rw [hl3] + refine StepsStar.trans (scan_left_E11 (4 * j + 4) default default) ?_ + step_tm + try simp only [zero_cons_default] + have hl4 : L1 (2 * (4 * j + 5)) default = L1 (2 * (4 * j + 4) + 2) default := rfl + rw [← hl4] + exact scan_right_01 (4 * j + 5) default default + refine StepsStar.trans_plus hs1 ?_ + have hd := drain_even (4 * j + 4) 0 + rwa [show 0 + 3 * (4 * j + 4) + 3 = 12 * j + 15 by omega] at hd + +theorem branch_mod6_3 (j : Nat) : + StepsPlus (Hub (6 * j + 3)) (Hub (9 * j + 9)) := by + have hs0 : StepsStar (Hub (6 * j + 3)) (cfg A default (R01 (4 * j + 2) (R1 2 default))) := by + refine StepsStar.trans (by simpa [show 6 * j + 3 = (6 * j + 2) + 1 by omega] using Hub_enter_P (6 * j + 2)) ?_ + have hr : R1 (6 * j + 2) default = R1 (6 * j) (R1 2 default) := R1_add (6 * j) 2 default + rw [hr] + exact P_drain6 j 1 (R1 2 default) + refine StepsStar.trans_plus hs0 ?_ + refine StepsStar.trans_plus (scan_right_01 (4 * j + 2) default (R1 2 default)) ?_ + have hl1 : L1 (2 * (4 * j + 2)) default = c1 (L1 (2 * (4 * j + 1)) (c1 default)) := by + rw [show 2 * (4 * j + 2) = 1 + (2 * (4 * j + 1) + 1) by omega, + L1_add 1 (2 * (4 * j + 1) + 1), L1_add (2 * (4 * j + 1)) 1]; try rfl + rw [hl1] + have hs1 : StepsStar (cfg A (c1 (L1 (2 * (4 * j + 1)) (c1 default))) (R1 2 default)) + (cfg A (L1 (4 * (2 * j + 1) + 1) (c0 (L1 1 default))) (c0 (c0 (R1 0 default)))) := by + dsimp -failIfUnchanged only [R1] + step_tm + refine StepsStar.trans (scan_left_E11 (4 * j + 1) (c1 default) (c0 (c1 default))) ?_ + iterate 5 step_tm + try simp only [zero_cons_default] + have hr1 : R01 (4 * j + 1) (c0 (c1 default)) = R01 (4 * j + 2) default := by + rw [show 4 * j + 2 = (4 * j + 1) + 1 by omega, R01_add (4 * j + 1) 1 default]; try rfl + rw [hr1] + have hl2 : L1 (2 * (4 * j + 2)) (c1 (c0 (c1 default))) = + L1 (4 * (2 * j + 1) + 1) (ListBlank.cons 0 (L1 1 default)) := by + rw [show 4 * (2 * j + 1) + 1 = 2 * (4 * j + 2) + 1 by omega, L1_add (2 * (4 * j + 2)) 1]; try rfl + rw [← hl2] + exact scan_right_01 (4 * j + 2) (c1 (c0 (c1 default))) default + refine StepsStar.trans_plus hs1 ?_ + refine StepsStar.trans_plus (drain_odd_steps (2 * j + 1) 1 0) ?_ + have hob : StepsPlus (cfg A (L1 1 (c0 (L1 (1 + (2 * j + 1)) default))) (c0 (c0 (R1 (0 + 3 * (2 * j + 1)) default)))) + (cfg A (L1 (2 * j + 2) default) (c0 (c0 (R1 (6 * j + 6) default)))) := by + have heq1 : 1 + (2 * j + 1) = 2 * j + 2 := by omega + have heq2 : R1 3 (R1 (0 + 3 * (2 * j + 1)) default) = R1 (6 * j + 6) default := by + rw [← R1_add 3 (0 + 3 * (2 * j + 1)) default, show 3 + (0 + 3 * (2 * j + 1)) = 6 * j + 6 by omega] + rw [heq1] + have hop := odd_base j (R1 (0 + 3 * (2 * j + 1)) default) + rwa [heq2] at hop + refine StepsPlus.trans hob ?_ + have hd := drain_even j (6 * j + 6) + rwa [show (6 * j + 6) + 3 * j + 3 = 9 * j + 9 by omega] at hd + +-- ============================================================================ +-- Closed Mod-3 Invariant and Main Non-Halting Theorem +-- ============================================================================ + +def Inv (c : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ m : Nat, c = Hub (3 * m + 3) + +theorem Inv_step {c : Cfg (Fin 2) (Fin 6)} (h : Inv c) : + ∃ c', Inv c' ∧ StepsPlus c c' := by + rcases h with ⟨m, rfl⟩ + have hm := Nat.div_add_mod m 2 + have hlt := Nat.mod_lt m (by decide : 0 < 2) + by_cases hpar : m % 2 = 0 + · refine ⟨Hub (9 * (m / 2) + 9), ⟨3 * (m / 2) + 2, by congr 1; omega⟩, ?_⟩ + simpa [show 3 * m + 3 = 6 * (m / 2) + 3 by omega] using branch_mod6_3 (m / 2) + · refine ⟨Hub (12 * (m / 2) + 15), ⟨4 * (m / 2) + 4, by congr 1; omega⟩, ?_⟩ + simpa [show 3 * m + 3 = 6 * (m / 2) + 6 by omega] using branch_mod6_0 (m / 2) + +theorem reach_arbitrarily_long : + ∀ k : Nat, ∃ N c, k ≤ N ∧ Inv c ∧ multiStep target_tm (init []) N = some c + | 0 => by + rcases init_to_Hub3.to_multiStep with ⟨N₀, hN₀⟩ + exact ⟨N₀, Hub 3, Nat.zero_le N₀, ⟨0, rfl⟩, hN₀⟩ + | k + 1 => by + rcases reach_arbitrarily_long k with ⟨N, c, hle, hc, hN⟩ + rcases Inv_step hc with ⟨c', hc', hplus⟩ + rcases hplus.to_multiStep with ⟨m, hm_pos, hm⟩ + exact ⟨N + m, c', by omega, hc', multiStep_trans _ _ _ N m hN hm⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg ⟨k, hk⟩ + cases h_step : step target_tm cfg with + | some cfg' => rfl + | none => + have h_none : multiStep target_tm (init []) (k + 1) = none := by + rw [multiStep_succ_end, hk]; exact h_step + rcases reach_arbitrarily_long (k + 1) with ⟨N, _, h_ge, _, hN⟩ + have h_split : N = (k + 1) + (N - (k + 1)) := by omega + have h_none_N : multiStep target_tm (init []) N = none := by + rw [h_split] + exact multiStep_none_add h_none (N - (k + 1)) + rw [h_none_N] at hN + nomatch hN + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0LE_1LC1RA_HHH1LD_0RB1LF_1RD1LA_0LA0RD diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0LE_1LC1RD_1LA0LC_1RA1RE_0RF0RB_1LCHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0LE_1LC1RD_1LA0LC_1RA1RE_0RF0RB_1LCHHH.lean new file mode 100644 index 00000000..2cc4af3d --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0LE_1LC1RD_1LA0LC_1RA1RE_0RF0RB_1LCHHH.lean @@ -0,0 +1,2818 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0LE_1LC1RD_1LA0LC_1RA1RE_0RF0RB_1LCHHH + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LE_1LC1RD_1LA0LC_1RA1RE_0RF0RB_1LCHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : + multiStep M config 0 = some config := rfl + +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : + multiStep M config 1 = step M config := rfl + +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +theorem multiStep_add (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n + m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem multiStep_step {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} {n : Nat} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢^{n} c₃) : c₁ [tm]⊢^{n + 1} c₃ := by + have := multiStep_trans tm c₁ c₂ c₃ 1 n h₁ h₂ + rwa [Nat.add_comm 1 n] at this + +theorem stepStar_refl (c : Cfg (Fin 2) (Fin 6)) : c [target_tm]⊢* c := ⟨0, rfl⟩ + +theorem stepPlus_to_stepStar {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢⁺ c₂) : + c₁ [target_tm]⊢* c₂ := by + rcases h with ⟨n, _, hn⟩; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [target_tm]⊢⁺ c₂) (h₂ : c₂ [target_tm]⊢* c₃) : c₁ [target_tm]⊢⁺ c₃ := by + rcases h₁ with ⟨n, hn_pos, hn⟩; rcases h₂ with ⟨m, hm⟩ + exact ⟨n + m, Nat.add_pos_left hn_pos m, multiStep_trans target_tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [target_tm]⊢* c₂) (h₂ : c₂ [target_tm]⊢⁺ c₃) : c₁ [target_tm]⊢⁺ c₃ := by + rcases h₁ with ⟨n, hn⟩; rcases h₂ with ⟨m, hm_pos, hm⟩ + exact ⟨n + m, Nat.add_pos_right n hm_pos, multiStep_trans target_tm c₁ c₂ c₃ n m hn hm⟩ + +omit [Inhabited Γ] in +@[simp] theorem pow_zero_list (l : List Γ) : l ^ (0 : Nat) = [] := rfl + +omit [Inhabited Γ] in +theorem pow_succ_list (l : List Γ) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl + +omit [Inhabited Γ] in +@[simp] theorem list_pow_add (l : List Γ) (n m : Nat) : l ^ (n + m) = l ^ n ++ l ^ m := by + induction n with + | zero => simp [pow_zero_list] + | succ n ih => + rw [Nat.succ_add, pow_succ_list, pow_succ_list, ih, List.append_assoc] + +omit [Inhabited Γ] in +theorem pow_succ_right (l : List Γ) (n : Nat) : l ^ (n + 1) = l ^ n ++ l := by + rw [list_pow_add]; simp [pow_succ_list, pow_zero_list] + +@[simp] theorem listblank_append_nil (s : ListBlank Γ) : ([] : List Γ) +> s = s := rfl + +@[simp] theorem listblank_append_cons (a : Γ) (l : List Γ) (s : ListBlank Γ) : + (a :: l) +> s = a >> (l +> s) := rfl + +@[simp] theorem listblank_append_assoc (l₁ l₂ : List Γ) (s : ListBlank Γ) : + (l₁ ++ l₂) +> s = l₁ +> (l₂ +> s) := + Turing.ListBlank.append_assoc l₁ l₂ s + +theorem left_pow_add (l : ListBlank (Fin 2)) (u : List (Fin 2)) (n m : Nat) : + l <+ u ^ (n + m) = l <+ u ^ m <+ u ^ n := by + rw [list_pow_add, listblank_append_assoc] + +theorem left_pow_succ (l : ListBlank (Fin 2)) (u : List (Fin 2)) (n : Nat) : + l <+ u ^ (n + 1) = l <+ u ^ n <+ u := by + rw [pow_succ_list, listblank_append_assoc] + +theorem left_pow_succ_right (l : ListBlank (Fin 2)) (u : List (Fin 2)) (n : Nat) : + l <+ u ^ (n + 1) = l <+ u <+ u ^ n := by + rw [pow_succ_right, listblank_append_assoc] + +theorem right_pow_add (u : List (Fin 2)) (n m : Nat) (r : ListBlank (Fin 2)) : + u ^ (n + m) +> r = u ^ n +> (u ^ m +> r) := by + rw [list_pow_add, listblank_append_assoc] + +theorem right_pow_succ (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + u ^ (n + 1) +> r = u +> (u ^ n +> r) := by + rw [pow_succ_list, listblank_append_assoc] + +theorem right_pow_succ_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + u ^ (n + 1) +> r = u ^ n +> (u +> r) := by + rw [pow_succ_right, listblank_append_assoc] + +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +@[simp] theorem zero_cons_default : (0 : Fin 2) >> (default : ListBlank (Fin 2)) = default := by + change ListBlank.cons default default = default + exact ListBlank.cons_head_tail default + +@[simp] theorem init_nil : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = + ⟨some A, ⟨0, default, default⟩⟩ := rfl + +def ones : List (Fin 2) := [1] +def ld0 : List (Fin 2) := [0, 1, 1, 0, 1, 1] +def ld1 : List (Fin 2) := [0, 1, 1, 1, 1, 1] +def ldh : ListBlank (Fin 2) := default <+ [1] +def rd0 : List (Fin 2) := [0, 0, 0] +def rd1 : List (Fin 2) := [1, 0, 0] +def Half (b : Fin 2) : List (Fin 2) := [b, 1, 1] +def Opp (b : Fin 2) : Fin 2 := if b = 0 then 1 else 0 +def Marked : List (Fin 2) → List (Fin 2) + | [] => [] + | b :: bs => Half b ++ Half 1 ++ Marked bs +def s_tag : List (Fin 2) := [1, 0, 1, 1] +def t_tag : List (Fin 2) := [1, 1, 1, 1] +def cut_tag : List (Fin 2) := [0, 1, 1, 1] + +theorem fin2_cases (b : Fin 2) : b = 0 ∨ b = 1 := by + rcases b with ⟨_ | ⟨_ | n⟩, hlt⟩ + · left; rfl + · right; rfl + · omega + +macro "step1" : tactic => `(tactic| ( + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, init_nil, ones, ld0, ld1, ldh, rd0, rd1, Half, Opp, s_tag, t_tag, cut_tag, + pow_succ_list, pow_zero_list, + List.singleton_append, List.nil_append, List.cons_append, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail] + refine multiStep_step (by rfl) ?_ + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Tape.write, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail])) + +macro "run_steps" n:num : tactic => `(tactic| ( + iterate $n step1 + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, ones, ld0, ld1, ldh, rd0, rd1, Half, Opp, s_tag, t_tag, cut_tag, + pow_succ_list, pow_zero_list, + List.singleton_append, List.nil_append, List.cons_append, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail, multiStep_zero] + rfl)) + +-- ============================================================================ +-- Section 1: Word & Power Commutation Identities +-- ============================================================================ + +theorem left_ld0_eq (l : ListBlank (Fin 2)) : l <+ ld0 = l <+ Half 0 <+ Half 0 := rfl +theorem left_ld1_eq (l : ListBlank (Fin 2)) : l <+ ld1 = l <+ Half 1 <+ Half 0 := rfl + +theorem half0_pairs (n : Nat) : (Half 0) ^ (n * 2) = ld0 ^ n := by + induction n with + | zero => rfl + | succ n ih => + rw [show (n + 1) * 2 = 2 + n * 2 by omega, list_pow_add, ih] + rfl + +theorem half0_pairs_two_mul (n : Nat) : (Half 0) ^ (2 * n) = ld0 ^ n := by + rw [Nat.mul_comm 2 n, half0_pairs] + +theorem half0_comm_ld0_pow (n : Nat) (l : ListBlank (Fin 2)) : + l <+ ld0 ^ n <+ Half 0 = l <+ Half 0 <+ ld0 ^ n := by + induction n generalizing l with + | zero => rfl + | succ n ih => + rw [left_pow_succ_right l ld0 n, ih (l <+ ld0), left_pow_succ_right (l <+ Half 0) ld0 n] + rfl + +theorem one_comm_half1_pow (n : Nat) (l : ListBlank (Fin 2)) : + l <+ (Half 1) ^ n <+ [1] = l <+ [1] <+ (Half 1) ^ n := by + induction n generalizing l with + | zero => rfl + | succ n ih => + rw [left_pow_succ_right l (Half 1) n, ih (l <+ Half 1), left_pow_succ_right (l <+ [1]) (Half 1) n] + rfl + +theorem one_comm_ones_pow (n : Nat) (r : ListBlank (Fin 2)) : + ones ^ n +> ([1] +> r) = [1] +> (ones ^ n +> r) := by + change ones ^ n +> (ones +> r) = ones +> (ones ^ n +> r) + rw [← right_pow_succ_right, ← right_pow_succ] + +-- ============================================================================ +-- Section 2: Constant-Step & Inductive Machine Rules (TM4) +-- ============================================================================ + +theorem LInc_zero (l r : ListBlank (Fin 2)) : + ((l <+ ld0) <{{C}} r) [target_tm]⊢⁺ ((l <+ ld1) {{B}}> r) := + ⟨9, by omega, by run_steps 9⟩ + +theorem RInc_zero (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0] +> r)) [target_tm]⊢⁺ (l <{{C}} ([1] +> r)) := + ⟨1, by omega, by run_steps 1⟩ + +theorem ECarry (l r : ListBlank (Fin 2)) (b : Fin 2) : + ((l <+ Half 1 <+ Half b) <{{E}} ([0] +> r)) [target_tm]⊢⁺ + (l <{{E}} ([0] +> (ones ^ 6 +> r))) := by + rcases fin2_cases b with rfl | rfl + · exact ⟨12, by omega, by run_steps 12⟩ + · exact ⟨12, by omega, by run_steps 12⟩ + +theorem EStop (l r : ListBlank (Fin 2)) (b : Fin 2) : + ((l <+ Half 0 <+ Half b) <{{E}} ([0] +> r)) [target_tm]⊢⁺ + ((l <+ Half 1 <+ s_tag) {{D}}> r) := by + rcases fin2_cases b with rfl | rfl + · exact ⟨12, by omega, by run_steps 12⟩ + · exact ⟨12, by omega, by run_steps 12⟩ + +theorem SOnes_step (l r : ListBlank (Fin 2)) : + ((l <+ s_tag) {{D}}> (ones ^ 6 +> r)) [target_tm]⊢⁺ + ((l <+ ld0 <+ s_tag) {{D}}> r) := + ⟨6, by omega, by run_steps 6⟩ + +theorem SOnes (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ s_tag) {{D}}> (ones ^ (n * 6) +> r)) [target_tm]⊢* + ((l <+ ld0 ^ n <+ s_tag) {{D}}> r) := by + induction n generalizing l with + | zero => try exact stepStar_refl _ + | succ n ih => + rw [show (n + 1) * 6 = 6 + n * 6 by omega, right_pow_add ones 6 (n * 6) r, + left_pow_succ_right l ld0 n] + exact stepStar_trans (stepPlus_to_stepStar (SOnes_step l (ones ^ (n * 6) +> r))) (ih (l <+ ld0)) + +theorem S100 (l r : ListBlank (Fin 2)) : + ((l <+ s_tag) {{D}}> ([1, 0, 0] +> r)) [target_tm]⊢⁺ + ((l <+ Half 1 <+ s_tag) {{D}}> r) := + ⟨13, by omega, by run_steps 13⟩ + +theorem T100 (l r : ListBlank (Fin 2)) : + ((l <+ t_tag) {{D}}> ([1, 0, 0] +> r)) [target_tm]⊢⁺ + (l <{{E}} ([0] +> (ones ^ 6 +> r))) := + ⟨13, by omega, by run_steps 13⟩ + +theorem S000 (l r : ListBlank (Fin 2)) (b : Fin 2) : + ((l <+ Half b <+ s_tag) {{D}}> ([0, 0, 0] +> r)) [target_tm]⊢⁺ + (l <{{E}} ([0] +> (ones ^ 5 +> ([Opp b, 0, 0, 1] +> r)))) := by + rcases fin2_cases b with rfl | rfl + · exact ⟨26, by omega, by run_steps 26⟩ + · exact ⟨16, by omega, by run_steps 16⟩ + +theorem S000_end (l r : ListBlank (Fin 2)) (b : Fin 2) : + ((l <+ s_tag) {{D}}> (ones ^ 5 +> ([Opp b, 0, 0, 1] +> r))) [target_tm]⊢⁺ + ((l <+ Half 0 <+ Half b <+ Half 0 <+ t_tag) {{D}}> r) := by + rcases fin2_cases b with rfl | rfl + · exact ⟨9, by omega, by run_steps 9⟩ + · exact ⟨19, by omega, by run_steps 19⟩ + +theorem MarkedCarry (l r : ListBlank (Fin 2)) (bs : List (Fin 2)) : + ((l <+ Marked bs) <{{E}} ([0] +> r)) [target_tm]⊢* + (l <{{E}} ([0] +> (ones ^ (bs.length * 6) +> r))) := by + induction bs generalizing l r with + | nil => try exact stepStar_refl _ + | cons b bs ih => + have hM : l <+ Marked (b :: bs) = l <+ Marked bs <+ Half 1 <+ Half b := by + simp [Marked, List.append_assoc] + rw [hM, List.length_cons, show (bs.length + 1) * 6 = bs.length * 6 + 6 by omega, + right_pow_add ones (bs.length * 6) 6 r] + exact stepStar_trans (stepPlus_to_stepStar (ECarry (l <+ Marked bs) r b)) (ih l (ones ^ 6 +> r)) + +theorem ECarry_ld1 (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ ld1 ^ n) <{{E}} ([0] +> r)) [target_tm]⊢* + (l <{{E}} ([0] +> (ones ^ (n * 6) +> r))) := by + induction n generalizing r with + | zero => try exact stepStar_refl _ + | succ n ih => + rw [left_pow_succ l ld1 n, left_ld1_eq, show (n + 1) * 6 = n * 6 + 6 by omega, + right_pow_add ones (n * 6) 6 r] + exact stepStar_trans (stepPlus_to_stepStar (ECarry (l <+ ld1 ^ n) r 0)) (ih (ones ^ 6 +> r)) + +theorem ECarry_half1_pair (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ (Half 1) ^ (n * 2)) <{{E}} ([0] +> r)) [target_tm]⊢* + (l <{{E}} ([0] +> (ones ^ (n * 6) +> r))) := by + induction n generalizing r with + | zero => try exact stepStar_refl _ + | succ n ih => + rw [show (n + 1) * 2 = 2 + n * 2 by omega, left_pow_add l (Half 1) 2 (n * 2), + show (Half 1) ^ 2 = Half 1 ++ Half 1 by rfl, listblank_append_assoc, + show (n + 1) * 6 = n * 6 + 6 by omega, right_pow_add ones (n * 6) 6 r] + exact stepStar_trans (stepPlus_to_stepStar (ECarry (l <+ (Half 1) ^ (n * 2)) r 1)) (ih (ones ^ 6 +> r)) + +theorem TStart (l r : ListBlank (Fin 2)) : + ((l <+ t_tag) {{D}}> ([0, 0, 0] +> r)) [target_tm]⊢⁺ + ((l <+ Half 1 <+ Half 1) <{{C}} ([1] +> r)) := + ⟨3, by omega, by run_steps 3⟩ + +theorem LOnes_step (l r : ListBlank (Fin 2)) : + ((l <+ Half 1) <{{C}} r) [target_tm]⊢⁺ + (l <{{C}} (rd0 +> r)) := + ⟨3, by omega, by run_steps 3⟩ + +theorem LOnes (l r : ListBlank (Fin 2)) (h : Nat) : + ((l <+ (Half 1) ^ h) <{{C}} r) [target_tm]⊢* + (l <{{C}} (rd0 ^ h +> r)) := by + induction h generalizing r with + | zero => try exact stepStar_refl _ + | succ h ih => + rw [left_pow_succ l (Half 1) h, right_pow_succ_right rd0 h r] + exact stepStar_trans (stepPlus_to_stepStar (LOnes_step (l <+ (Half 1) ^ h) r)) (ih (rd0 +> r)) + +theorem TZeroEntry (l r : ListBlank (Fin 2)) (h : Nat) : + ((l <+ Half 0 <+ (Half 1) ^ h <+ t_tag) {{D}}> ([0, 0, 0] +> r)) [target_tm]⊢⁺ + ((l <+ Half 0) <{{C}} (rd0 ^ (h + 2) +> ([1] +> r))) := by + have s1 := TStart (l <+ Half 0 <+ (Half 1) ^ h) r + have s2 := LOnes (l <+ Half 0) ([1] +> r) (h + 2) + have heq : l <+ Half 0 <+ (Half 1) ^ (h + 2) = + l <+ Half 0 <+ (Half 1) ^ h <+ Half 1 <+ Half 1 := by + rw [show h + 2 = 2 + h by omega, left_pow_add (l <+ Half 0) (Half 1) 2 h, + show (Half 1) ^ 2 = Half 1 ++ Half 1 by rfl, listblank_append_assoc] + rw [heq] at s2 + exact stepPlus_stepStar_trans s1 s2 + +theorem LBAtoE (l r : ListBlank (Fin 2)) : + ((l <+ Half 1 <+ Half 0) <{{C}} r) [target_tm]⊢⁺ + (l <{{E}} ([0] +> (ones ^ 5 +> r))) := + ⟨10, by omega, by run_steps 10⟩ + +theorem SFive (l r : ListBlank (Fin 2)) : + ((l <+ s_tag) {{D}}> (ones ^ 5 +> r)) [target_tm]⊢⁺ + ((l <+ Half 0 <+ Half 0 <+ Half 0) {{B}}> r) := + ⟨5, by omega, by run_steps 5⟩ + +theorem R100Scan_step (l r : ListBlank (Fin 2)) : + (l {{B}}> (rd1 +> r)) [target_tm]⊢⁺ + ((l <+ Half 1) {{B}}> r) := + ⟨3, by omega, by run_steps 3⟩ + +theorem R100Scan (l r : ListBlank (Fin 2)) (n : Nat) : + (l {{B}}> (rd1 ^ n +> r)) [target_tm]⊢* + ((l <+ (Half 1) ^ n) {{B}}> r) := by + induction n generalizing l with + | zero => try exact stepStar_refl _ + | succ n ih => + rw [right_pow_succ rd1 n r, left_pow_succ_right l (Half 1) n] + exact stepStar_trans (stepPlus_to_stepStar (R100Scan_step l (rd1 ^ n +> r))) (ih (l <+ Half 1)) + +theorem RExit_step (l r : ListBlank (Fin 2)) : + ((l <+ Half 1) {{B}}> ([1] +> r)) [target_tm]⊢⁺ + ((l <+ t_tag) {{D}}> r) := + ⟨1, by omega, by run_steps 1⟩ + +theorem RExit (l r : ListBlank (Fin 2)) (h : Nat) : + (l {{B}}> (rd1 ^ (h + 2) +> ([1] +> r))) [target_tm]⊢⁺ + ((l <+ (Half 1) ^ (h + 1) <+ t_tag) {{D}}> r) := by + have s1 := R100Scan l ([1] +> r) (h + 2) + rw [left_pow_succ l (Half 1) (h + 1)] at s1 + exact stepStar_stepPlus_trans s1 (RExit_step (l <+ (Half 1) ^ (h + 1)) r) + +theorem R111Scan_step (l r : ListBlank (Fin 2)) : + (l {{B}}> ([1, 1, 1] +> r)) [target_tm]⊢⁺ + ((l <+ Half 0) {{B}}> r) := + ⟨3, by omega, by run_steps 3⟩ + +theorem R111Scan (l r : ListBlank (Fin 2)) (n : Nat) : + (l {{B}}> (ones ^ (n * 3) +> r)) [target_tm]⊢* + ((l <+ (Half 0) ^ n) {{B}}> r) := by + induction n generalizing l with + | zero => try exact stepStar_refl _ + | succ n ih => + rw [show (n + 1) * 3 = 3 + n * 3 by omega, right_pow_add ones 3 (n * 3) r, + show ones ^ 3 = [1, 1, 1] by rfl, left_pow_succ_right l (Half 0) n] + exact stepStar_trans (stepPlus_to_stepStar (R111Scan_step l (ones ^ (n * 3) +> r))) (ih (l <+ Half 0)) + +theorem RInc_rule (l r : ListBlank (Fin 2)) (n : Nat) : + (l {{B}}> (rd1 ^ n +> ([0] +> r))) [target_tm]⊢⁺ + (l <{{C}} (rd0 ^ n +> ([1] +> r))) := by + have s1 := R100Scan l ([0] +> r) n + have s2 := RInc_zero (l <+ (Half 1) ^ n) r + have s3 := LOnes l ([1] +> r) n + exact stepStar_stepPlus_trans s1 (stepPlus_stepStar_trans s2 s3) + +theorem EEven_entry (r : ListBlank (Fin 2)) : + (ldh <{{E}} ([0] +> r)) [target_tm]⊢⁺ + (ldh {{B}}> ([1, 1] +> r)) := + ⟨4, by omega, by run_steps 4⟩ + +theorem EEven (r : ListBlank (Fin 2)) (n : Nat) : + (ldh <{{E}} ([0] +> (ones ^ (n * 6 + 5) +> r))) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (n + 1)) {{B}}> ([1] +> r)) := by + have s1 := EEven_entry (ones ^ (n * 6 + 5) +> r) + have h1 : ([1, 1] : List (Fin 2)) +> (ones ^ (n * 6 + 5) +> r) = + ones ^ (((n + 1) * 2) * 3) +> ([1] +> r) := by + change ones ^ 2 +> (ones ^ (n * 6 + 5) +> r) = + ones ^ (((n + 1) * 2) * 3) +> (ones +> r) + rw [← right_pow_add, ← right_pow_succ_right] + have : 2 + (n * 6 + 5) = (n + 1) * 2 * 3 + 1 := by omega + rw [this] + rw [h1] at s1 + have s2 := R111Scan ldh ([1] +> r) ((n + 1) * 2) + rw [half0_pairs (n + 1)] at s2 + exact stepPlus_stepStar_trans s1 s2 + +theorem LOv (r : ListBlank (Fin 2)) (n : Nat) : + ((ldh <+ ld1 ^ (1 + n)) <{{C}} r) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (1 + n)) {{B}}> ([1] +> r)) := by + rw [Nat.add_comm 1 n, left_pow_succ ldh ld1 n, left_ld1_eq] + have s1 := LBAtoE (ldh <+ ld1 ^ n) r + have s2 := ECarry_ld1 ldh (ones ^ 5 +> r) n + rw [← right_pow_add] at s2 + exact stepPlus_trans s1 (stepStar_stepPlus_trans s2 (EEven r n)) + +theorem R1100Turn (l r : ListBlank (Fin 2)) : + (l {{B}}> ([1, 1, 0, 0] +> r)) [target_tm]⊢⁺ + ((l <+ Half 0) <{{C}} ([1] +> r)) := + ⟨4, by omega, by run_steps 4⟩ + +theorem ROvOddRecover (l r : ListBlank (Fin 2)) (a m : Nat) : + ((l <+ ld0 <+ ld1 ^ a) {{B}}> (rd1 ^ (m * 2 + 1) +> ([1, 1, 0, 0] +> r))) [target_tm]⊢⁺ + ((l <+ ld1 <+ ld0 ^ (m + a + 1)) {{B}}> ([1] +> r)) := by + have s1 := R100Scan (l <+ ld0 <+ ld1 ^ a) ([1, 1, 0, 0] +> r) (m * 2 + 1) + have s2 := R1100Turn (l <+ ld0 <+ ld1 ^ a <+ (Half 1) ^ (m * 2 + 1)) r + rw [left_pow_succ (l <+ ld0 <+ ld1 ^ a) (Half 1) (m * 2)] at s2 + have s3 := LBAtoE (l <+ ld0 <+ ld1 ^ a <+ (Half 1) ^ (m * 2)) ([1] +> r) + have s4 := ECarry_half1_pair (l <+ ld0 <+ ld1 ^ a) (ones ^ 5 +> ([1] +> r)) m + have s5 := ECarry_ld1 (l <+ ld0) (ones ^ (m * 6) +> (ones ^ 5 +> ([1] +> r))) a + have h_ones : ones ^ (a * 6) +> (ones ^ (m * 6) +> (ones ^ 5 +> ([1] +> r))) = + ones ^ ((m + a) * 6) +> (ones ^ 5 +> ([1] +> r)) := by + rw [← right_pow_add, show a * 6 + m * 6 = (m + a) * 6 by omega] + rw [h_ones] at s5 + have s6 := EStop l (ones ^ ((m + a) * 6) +> (ones ^ 5 +> ([1] +> r))) 0 + rw [← left_ld0_eq] at s6 + have s7 := SOnes (l <+ Half 1) (ones ^ 5 +> ([1] +> r)) (m + a) + have s8 := SFive (l <+ Half 1 <+ ld0 ^ (m + a)) ([1] +> r) + have heq : l <+ Half 1 <+ ld0 ^ (m + a) <+ Half 0 <+ Half 0 <+ Half 0 = + l <+ ld1 <+ ld0 ^ (m + a + 1) := by + rw [half0_comm_ld0_pow (m + a) (l <+ Half 1), ← left_ld1_eq, ← left_ld0_eq, ← left_pow_succ (l <+ ld1) ld0 (m + a)] + rw [heq] at s8 + exact stepStar_stepPlus_trans s1 + (stepPlus_trans s2 + (stepPlus_trans s3 + (stepStar_stepPlus_trans s4 + (stepStar_stepPlus_trans s5 + (stepPlus_trans s6 + (stepStar_stepPlus_trans s7 s8)))))) + +theorem ROvEven_entry (l r : ListBlank (Fin 2)) : + (l {{B}}> ([1, 1, 0, 0] +> r)) [target_tm]⊢⁺ + ((l <+ [1]) <{{E}} ([0] +> ([1, 1] +> r))) := + ⟨6, by omega, by run_steps 6⟩ + +theorem E01_exit (l r : ListBlank (Fin 2)) : + ((l <+ [1, 0]) <{{E}} ([0] +> r)) [target_tm]⊢⁺ + ((l <+ [1]) {{B}}> ([1, 1] +> r)) := + ⟨4, by omega, by run_steps 4⟩ + +theorem B_four_ones_to_s (l r : ListBlank (Fin 2)) : + (l {{B}}> ([1, 1, 1, 1] +> r)) [target_tm]⊢⁺ + ((l <+ s_tag) {{D}}> r) := + ⟨4, by omega, by run_steps 4⟩ + +theorem ROvEvenAux (l r : ListBlank (Fin 2)) (m : Nat) : + ((l <+ [0]) {{B}}> (rd1 ^ (m * 2) +> ([1, 1, 0, 0] +> r))) [target_tm]⊢⁺ + ((l <+ [1] <+ ld0 ^ m <+ s_tag) {{D}}> r) := by + have s1 := R100Scan (l <+ [0]) ([1, 1, 0, 0] +> r) (m * 2) + have s2 := ROvEven_entry (l <+ [0] <+ (Half 1) ^ (m * 2)) r + have h1 : l <+ [0] <+ (Half 1) ^ (m * 2) <+ [1] = + l <+ [1, 0] <+ (Half 1) ^ (m * 2) := by + rw [one_comm_half1_pow (m * 2) (l <+ [0])] + rfl + rw [h1] at s2 + have s3 := ECarry_half1_pair (l <+ [1, 0]) ([1, 1] +> r) m + have s4 := E01_exit l (ones ^ (m * 6) +> ([1, 1] +> r)) + have h2 : ([1, 1] : List (Fin 2)) +> (ones ^ (m * 6) +> ([1, 1] +> r)) = + ones ^ ((m * 2) * 3) +> ([1, 1, 1, 1] +> r) := by + change ones ^ 2 +> (ones ^ (m * 6) +> (ones ^ 2 +> r)) = + ones ^ ((m * 2) * 3) +> (ones ^ 4 +> r) + rw [← right_pow_add, ← right_pow_add, ← right_pow_add] + have : 2 + m * 6 + 2 = m * 2 * 3 + 4 := by omega + rw [this] + rw [h2] at s4 + have s5 := R111Scan (l <+ [1]) ([1, 1, 1, 1] +> r) (m * 2) + rw [half0_pairs m] at s5 + have s6 := B_four_ones_to_s (l <+ [1] <+ ld0 ^ m) r + exact stepStar_stepPlus_trans s1 + (stepPlus_trans s2 + (stepStar_stepPlus_trans s3 + (stepPlus_trans s4 + (stepStar_stepPlus_trans s5 s6)))) + +theorem ROv101Odd_entry (l r : ListBlank (Fin 2)) : + ((l <+ Half 1) {{B}}> ([1, 0, 1] +> r)) [target_tm]⊢⁺ + ((l <+ [1]) <{{E}} ([0] +> ([1, 1, 1, 1] +> r))) := + ⟨11, by omega, by run_steps 11⟩ + +theorem ROv101Odd (l r : ListBlank (Fin 2)) (m : Nat) : + ((l <+ [0]) {{B}}> (rd1 ^ (m * 2 + 1) +> ([1, 0, 1] +> r))) [target_tm]⊢⁺ + ((l <+ [1] <+ ld0 ^ (m + 1)) {{B}}> r) := by + have s1 := R100Scan (l <+ [0]) ([1, 0, 1] +> r) (m * 2 + 1) + rw [left_pow_succ (l <+ [0]) (Half 1) (m * 2)] at s1 + have s2 := ROv101Odd_entry (l <+ [0] <+ (Half 1) ^ (m * 2)) r + have h1 : l <+ [0] <+ (Half 1) ^ (m * 2) <+ [1] = + l <+ [1, 0] <+ (Half 1) ^ (m * 2) := by + rw [one_comm_half1_pow (m * 2) (l <+ [0])] + rfl + rw [h1] at s2 + have s3 := ECarry_half1_pair (l <+ [1, 0]) ([1, 1, 1, 1] +> r) m + have s4 := E01_exit l (ones ^ (m * 6) +> ([1, 1, 1, 1] +> r)) + have h2 : ([1, 1] : List (Fin 2)) +> (ones ^ (m * 6) +> ([1, 1, 1, 1] +> r)) = + ones ^ (((m + 1) * 2) * 3) +> r := by + change ones ^ 2 +> (ones ^ (m * 6) +> (ones ^ 4 +> r)) = _ + rw [← right_pow_add, ← right_pow_add] + have : 2 + m * 6 + 4 = (m + 1) * 2 * 3 := by omega + rw [this] + rw [h2] at s4 + have s5 := R111Scan (l <+ [1]) r ((m + 1) * 2) + rw [half0_pairs (m + 1)] at s5 + exact stepStar_stepPlus_trans s1 + (stepPlus_trans s2 + (stepStar_stepPlus_trans s3 + (stepPlus_stepStar_trans s4 s5))) + +theorem saturated_one (r : ListBlank (Fin 2)) : + ((ldh <+ ld0) {{B}}> ([1] +> (rd0 +> (rd1 +> r)))) [target_tm]⊢⁺ + ((default <+ cut_tag <+ ld1) {{B}}> ([1, 1, 1, 0, 0] +> r)) := + ⟨50, by omega, by run_steps 50⟩ + +theorem Cap_entry (l r : ListBlank (Fin 2)) : + (l {{B}}> ([1, 1, 1, 0, 0] +> r)) [target_tm]⊢⁺ + ((l <+ [1]) <{{E}} ([0] +> ([1, 1, 0] +> r))) := + ⟨6, by omega, by run_steps 6⟩ + +theorem OddCap_exit (l r : ListBlank (Fin 2)) : + ((l <+ ld1 <+ [1]) <{{E}} ([0, 1] +> r)) [target_tm]⊢⁺ + ((l <+ [1, 1, 1] <+ ld1) {{B}}> r) := + ⟨7, by omega, by run_steps 7⟩ + +theorem odd_capacity_entry (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ ld1) {{B}}> (rd1 ^ (n * 2) +> ([1, 1, 1, 0, 0] +> r))) [target_tm]⊢⁺ + ((l <+ [1, 1, 1] <+ ld1 <+ ld0 ^ n) {{B}}> ([1, 0] +> r)) := by + have s1 := R100Scan (l <+ ld1) ([1, 1, 1, 0, 0] +> r) (n * 2) + have s2 := Cap_entry (l <+ ld1 <+ (Half 1) ^ (n * 2)) r + rw [one_comm_half1_pow (n * 2) (l <+ ld1)] at s2 + have s3 := ECarry_half1_pair (l <+ ld1 <+ [1]) ([1, 1, 0] +> r) n + have h1 : ([0] : List (Fin 2)) +> (ones ^ (n * 6) +> ([1, 1, 0] +> r)) = + [0, 1] +> (ones ^ ((n * 2) * 3) +> ([1, 0] +> r)) := by + have : ones ^ (n * 6) +> ([1] +> ([1, 0] +> r)) = + [1] +> (ones ^ ((n * 2) * 3) +> ([1, 0] +> r)) := by + rw [one_comm_ones_pow (n * 6) ([1, 0] +> r), show n * 6 = n * 2 * 3 by omega] + simpa using! congrArg ((0 : Fin 2) >> ·) this + rw [h1] at s3 + have s4 := OddCap_exit l (ones ^ ((n * 2) * 3) +> ([1, 0] +> r)) + have s5 := R111Scan (l <+ [1, 1, 1] <+ ld1) ([1, 0] +> r) (n * 2) + rw [half0_pairs n] at s5 + exact stepStar_stepPlus_trans s1 + (stepPlus_trans s2 + (stepStar_stepPlus_trans s3 + (stepPlus_stepStar_trans s4 s5))) + +theorem EvenCap_mid (l r : ListBlank (Fin 2)) : + ((l <+ Half 1 <+ [1]) <{{E}} ([0] +> r)) [target_tm]⊢⁺ + (l <{{E}} ([0] +> ([1, 1, 1, 1] +> r))) := + ⟨8, by omega, by run_steps 8⟩ + +theorem EvenCap_exit (r : ListBlank (Fin 2)) : + ((default <+ cut_tag) <{{E}} ([0] +> r)) [target_tm]⊢⁺ + (ldh {{B}}> (ones ^ 6 +> r)) := + ⟨12, by omega, by run_steps 12⟩ + +theorem even_capacity_cleanup (n : Nat) (r : ListBlank (Fin 2)) : + ((default <+ cut_tag <+ ld1 ^ (2 + n * 2)) {{B}}> + (rd1 ^ (1 + n * 2) +> ([1, 1, 1, 0, 0] +> r))) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (4 + n * 3)) {{B}}> ([0] +> r)) := by + have s1 := R100Scan (default <+ cut_tag <+ ld1 ^ (2 + n * 2)) ([1, 1, 1, 0, 0] +> r) (1 + n * 2) + have s2 := Cap_entry (default <+ cut_tag <+ ld1 ^ (2 + n * 2) <+ (Half 1) ^ (1 + n * 2)) r + have h1 : default <+ cut_tag <+ ld1 ^ (2 + n * 2) <+ (Half 1) ^ (1 + n * 2) <+ [1] = + default <+ cut_tag <+ ld1 ^ (2 + n * 2) <+ Half 1 <+ [1] <+ (Half 1) ^ (n * 2) := by + rw [show 1 + n * 2 = n * 2 + 1 by omega, left_pow_succ_right, + one_comm_half1_pow (n * 2) (default <+ cut_tag <+ ld1 ^ (2 + n * 2) <+ Half 1)] + rw [h1] at s2 + have s3 := ECarry_half1_pair (default <+ cut_tag <+ ld1 ^ (2 + n * 2) <+ Half 1 <+ [1]) ([1, 1, 0] +> r) n + have s4 := EvenCap_mid (default <+ cut_tag <+ ld1 ^ (2 + n * 2)) (ones ^ (n * 6) +> ([1, 1, 0] +> r)) + have s5 := ECarry_ld1 (default <+ cut_tag) ([1, 1, 1, 1] +> (ones ^ (n * 6) +> ([1, 1, 0] +> r))) (2 + n * 2) + have s6 := EvenCap_exit (ones ^ ((2 + n * 2) * 6) +> ([1, 1, 1, 1] +> (ones ^ (n * 6) +> ([1, 1, 0] +> r)))) + have h2 : ones ^ 6 +> + (ones ^ ((2 + n * 2) * 6) +> ([1, 1, 1, 1] +> (ones ^ (n * 6) +> ([1, 1, 0] +> r)))) = + ones ^ (((4 + n * 3) * 2) * 3) +> ([0] +> r) := by + have h110 : ([1, 1, 0] : List (Fin 2)) +> r = ones ^ 2 +> ([0] +> r) := rfl + have h1111 : ([1, 1, 1, 1] : List (Fin 2)) = ones ^ 4 := rfl + rw [h110, h1111, ← right_pow_add, ← right_pow_add, ← right_pow_add, ← right_pow_add] + have : 6 + (2 + n * 2) * 6 + 4 + n * 6 + 2 = (4 + n * 3) * 2 * 3 := by omega + rw [this] + rw [h2] at s6 + have s7 := R111Scan ldh ([0] +> r) ((4 + n * 3) * 2) + rw [half0_pairs (4 + n * 3)] at s7 + exact stepStar_stepPlus_trans s1 + (stepPlus_trans s2 + (stepStar_stepPlus_trans s3 + (stepPlus_trans s4 + (stepStar_stepPlus_trans s5 + (stepPlus_stepStar_trans s6 s7))))) + +theorem SZeroEntry (l r : ListBlank (Fin 2)) : + ((l <+ s_tag) {{D}}> ([0, 0, 0] +> r)) [target_tm]⊢⁺ + ((l <+ Half 0) <{{C}} ([0, 0, 0, 1] +> r)) := + ⟨6, by omega, by run_steps 6⟩ + +theorem R11Bit (l r : ListBlank (Fin 2)) (b : Fin 2) : + (l {{B}}> ([1, 1, b, 0, 0] +> r)) [target_tm]⊢⁺ + ((l <+ Half 0) <{{C}} ([1, 0] +> r)) := by + rcases fin2_cases b with rfl | rfl + · exact ⟨4, by omega, by run_steps 4⟩ + · exact ⟨4, by omega, by run_steps 4⟩ + +theorem EHalfBoundary (r : ListBlank (Fin 2)) (b : Fin 2) : + ((ldh <+ Half b) <{{E}} ([0] +> r)) [target_tm]⊢⁺ + (ldh {{B}}> (ones ^ 6 +> r)) := by + rcases fin2_cases b with rfl | rfl + · exact ⟨12, by omega, by run_steps 12⟩ + · exact ⟨12, by omega, by run_steps 12⟩ + +theorem EOdd (r : ListBlank (Fin 2)) (n : Nat) (b : Fin 2) : + ((ldh <+ Half b) <{{E}} ([0] +> (ones ^ (n * 6 + 5) +> r))) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (n + 1) <+ Half 0) {{B}}> ([1, 1] +> r)) := by + have s1 := EHalfBoundary (ones ^ (n * 6 + 5) +> r) b + have h1 : ones ^ 6 +> (ones ^ (n * 6 + 5) +> r) = + ones ^ (((n + 1) * 2 + 1) * 3) +> ([1, 1] +> r) := by + have h11 : ([1, 1] : List (Fin 2)) +> r = ones ^ 2 +> r := rfl + rw [h11, ← right_pow_add, ← right_pow_add] + have : 6 + (n * 6 + 5) = ((n + 1) * 2 + 1) * 3 + 2 := by omega + rw [this] + rw [h1] at s1 + have s2 := R111Scan ldh ([1, 1] +> r) ((n + 1) * 2 + 1) + rw [left_pow_succ, half0_pairs (n + 1)] at s2 + exact stepPlus_stepStar_trans s1 s2 + +theorem LSingle (r : ListBlank (Fin 2)) : + ((ldh <+ Half 0) <{{C}} r) [target_tm]⊢⁺ + ((ldh <+ Half 0) {{B}}> ([1, 1] +> r)) := + ⟨13, by omega, by run_steps 13⟩ + +theorem LZeroEven (r : ListBlank (Fin 2)) (bs : List (Fin 2)) : + ((ldh <+ Marked bs <+ Half 1 <+ Half 0) <{{C}} r) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (bs.length + 1)) {{B}}> ([1] +> r)) := by + have s1 := LBAtoE (ldh <+ Marked bs) r + have s2 := MarkedCarry ldh (ones ^ 5 +> r) bs + rw [← right_pow_add] at s2 + exact stepPlus_trans s1 (stepStar_stepPlus_trans s2 (EEven r bs.length)) + +theorem LZeroOdd (r : ListBlank (Fin 2)) (bs : List (Fin 2)) (b : Fin 2) : + ((ldh <+ Half b <+ Marked bs <+ Half 1 <+ Half 0) <{{C}} r) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (bs.length + 1) <+ Half 0) {{B}}> ([1, 1] +> r)) := by + have s1 := LBAtoE (ldh <+ Half b <+ Marked bs) r + have s2 := MarkedCarry (ldh <+ Half b) (ones ^ 5 +> r) bs + rw [← right_pow_add] at s2 + exact stepPlus_trans s1 (stepStar_stepPlus_trans s2 (EOdd r bs.length b)) + +theorem R101Even_entry (l r : ListBlank (Fin 2)) : + (l {{B}}> ([1, 0, 1, 0, 0] +> r)) [target_tm]⊢⁺ + (l <{{E}} ([0] +> ([1, 1, 0, 0] +> r))) := + ⟨7, by omega, by run_steps 7⟩ + +theorem E0_to_C (l r : ListBlank (Fin 2)) : + ((l <+ [0]) <{{E}} ([0] +> r)) [target_tm]⊢⁺ + ((l <+ [0]) <{{C}} ([1] +> r)) := + ⟨2, by omega, by run_steps 2⟩ + +theorem R101EvenEntry (l r : ListBlank (Fin 2)) (m : Nat) : + ((l <+ [0]) {{B}}> (rd1 ^ (m * 2) +> ([1, 0, 1, 0, 0] +> r))) [target_tm]⊢⁺ + ((l <+ [0]) <{{C}} (ones ^ (m * 6 + 3) +> ([0, 0] +> r))) := by + have s1 := R100Scan (l <+ [0]) ([1, 0, 1, 0, 0] +> r) (m * 2) + have s2 := R101Even_entry (l <+ [0] <+ (Half 1) ^ (m * 2)) r + have s3 := ECarry_half1_pair (l <+ [0]) ([1, 1, 0, 0] +> r) m + have s4 := E0_to_C l (ones ^ (m * 6) +> ([1, 1, 0, 0] +> r)) + have h1 : ([1] : List (Fin 2)) +> (ones ^ (m * 6) +> ([1, 1, 0, 0] +> r)) = + ones ^ (m * 6 + 3) +> ([0, 0] +> r) := by + have h1100 : ([1, 1, 0, 0] : List (Fin 2)) +> r = ones ^ 2 +> ([0, 0] +> r) := rfl + have h1_pow : ([1] : List (Fin 2)) +> (ones ^ (m * 6) +> (ones ^ 2 +> ([0, 0] +> r))) = + ones ^ 1 +> (ones ^ (m * 6) +> (ones ^ 2 +> ([0, 0] +> r))) := rfl + rw [h1100, h1_pow, ← right_pow_add, ← right_pow_add] + have : 1 + m * 6 + 2 = m * 6 + 3 := by omega + rw [this] + rw [h1] at s4 + exact stepStar_stepPlus_trans s1 + (stepPlus_trans s2 + (stepStar_stepPlus_trans s3 s4)) + +theorem init_to_J2 : + (init []) [target_tm]⊢* + ((ldh <+ ld0 ^ 2) <{{C}} ([1, 0] +> (rd1 +> default))) := + ⟨136, by run_steps 136⟩ + + +-- ============================================================================ +-- Section 3: Right Counter (Pair45Right) +-- ============================================================================ + +@[simp] theorem rd0_append_default : rd0 +> (default : ListBlank (Fin 2)) = default := by + simp [rd0] + +inductive RC : Nat → ListBlank (Fin 2) → Prop + | zero : RC 0 default + | d0 (n : Nat) (r : ListBlank (Fin 2)) : RC n r → RC (n * 2) (rd0 +> r) + | d1 (n : Nat) (r : ListBlank (Fin 2)) : RC n r → RC (1 + n * 2) (rd1 +> r) + +inductive FC (tail : ListBlank (Fin 2)) : Nat → Nat → ListBlank (Fin 2) → Prop + | nil : FC tail 0 0 tail + | d0 (k n : Nat) (r : ListBlank (Fin 2)) : FC tail k n r → FC tail (k + 1) (n * 2) (rd0 +> r) + | d1 (k n : Nat) (r : ListBlank (Fin 2)) : FC tail k n r → FC tail (k + 1) (1 + n * 2) (rd1 +> r) + +theorem RC_eq {n m : Nat} {r s : ListBlank (Fin 2)} (h : RC n r) (hn : n = m) (hr : r = s) : + RC m s := by + subst hn; subst hr; exact h + +theorem FC_eq {tail : ListBlank (Fin 2)} {k k' n n' : Nat} {r r' : ListBlank (Fin 2)} + (h : FC tail k n r) (hk : k = k') (hn : n = n') (hr : r = r') : + FC tail k' n' r' := by + subst hk; subst hn; subst hr; exact h + +theorem RC_zero_unique {r : ListBlank (Fin 2)} (h : RC 0 r) : r = default := by + generalize hn : (0 : Nat) = n at h + induction h with + | zero => rfl + | d0 n r _ ih => + have hn0 : n = 0 := by omega + rw [ih hn0.symm, rd0_append_default] + | d1 _ _ _ _ => omega + +theorem RC_inv_d0 {n : Nat} {s : ListBlank (Fin 2)} (hs : RC (n * 2) s) : + (n = 0 ∧ s = default) ∨ ∃ s0, s = rd0 +> s0 ∧ RC n s0 := by + generalize hm : n * 2 = m at hs + cases hs with + | zero => exact Or.inl ⟨by omega, rfl⟩ + | d0 n0 s0 hs0 => + have hn : n0 = n := by omega + subst hn + exact Or.inr ⟨s0, rfl, hs0⟩ + | d1 _ _ _ => omega + +theorem RC_inv_d1 {n : Nat} {s : ListBlank (Fin 2)} (hs : RC (1 + n * 2) s) : + ∃ s0, s = rd1 +> s0 ∧ RC n s0 := by + generalize hm : 1 + n * 2 = m at hs + cases hs with + | zero => omega + | d0 _ _ _ => omega + | d1 n0 s0 hs0 => + have hn : n0 = n := by omega + subst hn + exact ⟨s0, rfl, hs0⟩ + +theorem FC_inv_nil {tail : ListBlank (Fin 2)} {n : Nat} {s : ListBlank (Fin 2)} + (hs : FC tail 0 n s) : s = tail := by + generalize hk : (0 : Nat) = k at hs + cases hs with + | nil => rfl + | d0 _ _ _ _ => omega + | d1 _ _ _ _ => omega + +theorem FC_inv_d0 {tail : ListBlank (Fin 2)} {k n : Nat} {s : ListBlank (Fin 2)} + (hs : FC tail (k + 1) (n * 2) s) : ∃ s0, s = rd0 +> s0 ∧ FC tail k n s0 := by + generalize hk : k + 1 = K, hm : n * 2 = m at hs + cases hs with + | nil => omega + | d0 k0 n0 s0 hs0 => + have hk0 : k0 = k := by omega + have hn0 : n0 = n := by omega + subst hk0; subst hn0 + exact ⟨s0, rfl, hs0⟩ + | d1 _ _ _ _ => omega + +theorem FC_inv_d1 {tail : ListBlank (Fin 2)} {k n : Nat} {s : ListBlank (Fin 2)} + (hs : FC tail (k + 1) (1 + n * 2) s) : ∃ s0, s = rd1 +> s0 ∧ FC tail k n s0 := by + generalize hk : k + 1 = K, hm : 1 + n * 2 = m at hs + cases hs with + | nil => omega + | d0 _ _ _ _ => omega + | d1 k0 n0 s0 hs0 => + have hk0 : k0 = k := by omega + have hn0 : n0 = n := by omega + subst hk0; subst hn0 + exact ⟨s0, rfl, hs0⟩ + +theorem RC_unique {n : Nat} {r s : ListBlank (Fin 2)} (hr : RC n r) (hs : RC n s) : r = s := by + induction hr generalizing s with + | zero => exact (RC_zero_unique hs).symm + | d0 n r hr ih => + rcases RC_inv_d0 hs with ⟨rfl, rfl⟩ | ⟨s0, rfl, hs0⟩ + · rw [RC_zero_unique hr, rd0_append_default] + · rw [ih hs0] + | d1 n r _ ih => + rcases RC_inv_d1 hs with ⟨s0, rfl, hs0⟩ + rw [ih hs0] + +theorem FC_unique {tail : ListBlank (Fin 2)} {k n : Nat} {r s : ListBlank (Fin 2)} + (hr : FC tail k n r) (hs : FC tail k n s) : r = s := by + induction hr generalizing s with + | nil => exact (FC_inv_nil hs).symm + | d0 k n r _ ih => + rcases FC_inv_d0 hs with ⟨s0, rfl, hs0⟩ + rw [ih hs0] + | d1 k n r _ ih => + rcases FC_inv_d1 hs with ⟨s0, rfl, hs0⟩ + rw [ih hs0] + +theorem pow2_pos (k : Nat) : 0 < 2 ^ k := Nat.two_pow_pos k + +theorem nat_even_or_odd (n : Nat) : (∃ m, n = 2 * m) ∨ (∃ m, n = 2 * m + 1) := by + induction n with + | zero => exact Or.inl ⟨0, rfl⟩ + | succ n ih => + rcases ih with ⟨m, rfl⟩ | ⟨m, rfl⟩ + · exact Or.inr ⟨m, rfl⟩ + · exact Or.inl ⟨m + 1, by omega⟩ + +theorem FC_zero (tail : ListBlank (Fin 2)) (k : Nat) : FC tail k 0 (rd0 ^ k +> tail) := by + induction k with + | zero => exact FC.nil + | succ k ih => + rw [right_pow_succ rd0 k tail] + exact FC_eq (FC.d0 k 0 (rd0 ^ k +> tail) ih) rfl (by omega) rfl + +theorem FC_full (tail : ListBlank (Fin 2)) (k : Nat) : FC tail k (2 ^ k - 1) (rd1 ^ k +> tail) := by + induction k with + | zero => exact FC.nil + | succ k ih => + have hp := pow2_pos k + rw [right_pow_succ rd1 k tail] + exact FC_eq (FC.d1 k (2 ^ k - 1) (rd1 ^ k +> tail) ih) rfl (by rw [Nat.pow_succ]; omega) rfl + +theorem FC_full_unique {tail : ListBlank (Fin 2)} {k : Nat} {r : ListBlank (Fin 2)} + (h : FC tail k (2 ^ k - 1) r) : r = rd1 ^ k +> tail := + FC_unique h (FC_full tail k) + +theorem FC_RC {tail : ListBlank (Fin 2)} {k n : Nat} {r : ListBlank (Fin 2)} {m : Nat} + (hf : FC tail k n r) (hr : RC m tail) : RC (n + 2 ^ k * m) r := by + induction hf with + | nil => + exact RC_eq hr (by omega) rfl + | d0 k n r _ ih => + exact RC_eq (RC.d0 (n + 2 ^ k * m) r ih) (by rw [Nat.pow_succ]; ring) rfl + | d1 k n r _ ih => + exact RC_eq (RC.d1 (n + 2 ^ k * m) r ih) (by rw [Nat.pow_succ]; ring) rfl + +theorem RC_zeros {n : Nat} {r : ListBlank (Fin 2)} (k : Nat) (hr : RC n r) : + RC (2 ^ k * n) (rd0 ^ k +> r) := by + simpa using! FC_RC (FC_zero r k) hr + +theorem RC_carry {n : Nat} {r : ListBlank (Fin 2)} (h : RC n r) : + ∃ (k : Nat) (s : ListBlank (Fin 2)), r = rd1 ^ k +> (rd0 +> s) ∧ RC (n + 1) (rd0 ^ k +> (rd1 +> s)) := by + induction h with + | zero => + refine ⟨(0 : Nat), default, ?_, ?_⟩ + · simp + · exact RC_eq (RC.d1 0 default RC.zero) (by omega) rfl + | d0 n r hr _ => + exact ⟨(0 : Nat), r, rfl, RC_eq (RC.d1 n r hr) (by omega) rfl⟩ + | d1 n r _ ih => + rcases ih with ⟨k, s, rfl, hs⟩ + refine ⟨k + 1, s, ?_, ?_⟩ + · rw [right_pow_succ rd1 k (rd0 +> s)] + · rw [right_pow_succ rd0 k (rd1 +> s)] + exact RC_eq (RC.d0 (n + 1) (rd0 ^ k +> (rd1 +> s)) hs) (by omega) rfl + +theorem RC_positive_split {n : Nat} {r : ListBlank (Fin 2)} (h : RC n r) (hn : 0 < n) : + ∃ t q s, r = rd0 ^ t +> (rd1 +> s) ∧ RC q s ∧ n = 2 ^ t * (1 + q * 2) ∧ q < n := by + induction h with + | zero => omega + | d0 n r _ ih => + rcases ih (by omega) with ⟨t, q, s, rfl, hs, heq, hlt⟩ + refine ⟨t + 1, q, s, ?_, hs, ?_, by omega⟩ + · rw [right_pow_succ rd0 t (rd1 +> s)] + · rw [Nat.pow_succ, heq]; ring + | d1 n r hr _ => + exact ⟨0, n, r, rfl, hr, by omega, by omega⟩ + +theorem FC_carry {tail : ListBlank (Fin 2)} {k n : Nat} {r : ListBlank (Fin 2)} + (h : FC tail k n r) (hb : n + 1 < 2 ^ k) : + ∃ j s, j < k ∧ r = rd1 ^ j +> (rd0 +> s) ∧ FC tail k (n + 1) (rd0 ^ j +> (rd1 +> s)) := by + induction h with + | nil => simp at hb + | d0 k n r hr _ => + exact ⟨0, r, by omega, rfl, FC_eq (FC.d1 k n r hr) rfl (by omega) rfl⟩ + | d1 k n r _ ih => + have hb' : n + 1 < 2 ^ k := by rw [Nat.pow_succ] at hb; omega + rcases ih hb' with ⟨j, s, hj, rfl, hs⟩ + refine ⟨j + 1, s, by omega, ?_, ?_⟩ + · rw [right_pow_succ rd1 j (rd0 +> s)] + · rw [right_pow_succ rd0 j (rd1 +> s)] + exact FC_eq (FC.d0 k (n + 1) (rd0 ^ j +> (rd1 +> s)) hs) rfl (by omega) rfl + +theorem RC_tail {n : Nat} {r : ListBlank (Fin 2)} (h : RC n r) : + ∃ (b : Fin 2) (s : ListBlank (Fin 2)), RC (n / 2) s ∧ r = [b, 0, 0] +> s := by + cases h with + | zero => exact ⟨0, default, RC.zero, rd0_append_default.symm⟩ + | d0 n s hs => exact ⟨0, s, RC_eq hs (by omega) rfl, rfl⟩ + | d1 n s hs => exact ⟨1, s, RC_eq hs (by omega) rfl, rfl⟩ + +theorem RScan (l r : ListBlank (Fin 2)) (k : Nat) : + (l {{B}}> (rd1 ^ k +> (rd0 +> r))) [target_tm]⊢⁺ + (l <{{C}} (rd0 ^ k +> (rd1 +> r))) := by + simpa [rd0, rd1] using! RInc_rule l ([0, 0] +> r) k + +theorem RInc_ex {n : Nat} {r : ListBlank (Fin 2)} (h : RC n r) : + ∃ s, RC (n + 1) s ∧ ∀ l, (l {{B}}> r) [target_tm]⊢⁺ (l <{{C}} s) := by + rcases RC_carry h with ⟨k, s, rfl, hs⟩ + exact ⟨rd0 ^ k +> (rd1 +> s), hs, fun l => RScan l s k⟩ + +theorem FiniteRInc_ex {tail : ListBlank (Fin 2)} {k n : Nat} {r : ListBlank (Fin 2)} + (h : FC tail k n r) (hb : n + 1 < 2 ^ k) : + ∃ s, FC tail k (n + 1) s ∧ ∀ l, (l {{B}}> r) [target_tm]⊢⁺ (l <{{C}} s) := by + rcases FC_carry h hb with ⟨j, s, _, rfl, hs⟩ + exact ⟨rd0 ^ j +> (rd1 +> s), hs, fun l => RScan l s j⟩ + +-- ============================================================================ +-- Section 4: HalfCounter Model (Num, Borrow, LInc, Pairs, TZero) +-- ============================================================================ + +def digit (b : Bool) : List (Fin 2) := Half (if b then 0 else 1) + +def l_tape : List Bool → List (Fin 2) + | [] => [] + | b :: w => digit b ++ l_tape w + +@[simp] theorem l_tape_nil : l_tape [] = [] := rfl +@[simp] theorem l_tape_cons (b : Bool) (w : List Bool) : + l_tape (b :: w) = digit b ++ l_tape w := rfl + +inductive Num : Nat → Nat → Nat → List Bool → Prop + | nil : Num 0 0 0 [] + | A (n e o : Nat) (w : List Bool) : Num n e o w → Num (1 + n) (1 + o * 2) e (true :: w) + | B (n e o : Nat) (w : List Bool) : Num n e o w → Num (1 + n) (o * 2) e (false :: w) + +theorem Num_eq {n n' e e' o o' : Nat} {w w' : List Bool} + (h : Num n e o w) (hn : n = n') (he : e = e') (ho : o = o') (hw : w = w') : + Num n' e' o' w' := by + subst hn; subst he; subst ho; subst hw; exact h + +theorem Num_length {n e o : Nat} {w : List Bool} (h : Num n e o w) : w.length = n := by + induction h with + | nil => rfl + | A _ _ _ _ _ ih => simp [ih]; omega + | B _ _ _ _ _ ih => simp [ih]; omega + +theorem Num_bounds {n e o : Nat} {w : List Bool} (h : Num n e o w) : + e < 2 ^ ((n + 1) / 2) ∧ o < 2 ^ (n / 2) := by + induction h with + | nil => simp + | A n e o w _ ih => + rcases ih with ⟨he, ho⟩ + have h1 : (1 + n + 1) / 2 = (n / 2) + 1 := by omega + have h2 : (1 + n) / 2 = (n + 1) / 2 := by omega + rw [h1, h2, Nat.pow_succ] + omega + | B n e o w _ ih => + rcases ih with ⟨he, ho⟩ + have h1 : (1 + n + 1) / 2 = (n / 2) + 1 := by omega + have h2 : (1 + n) / 2 = (n + 1) / 2 := by omega + rw [h1, h2, Nat.pow_succ] + omega + +theorem Num_inv_nil {n e o : Nat} (h : Num n e o []) : n = 0 ∧ e = 0 ∧ o = 0 := by + generalize hw : ([] : List Bool) = w at h + cases h with + | nil => exact ⟨rfl, rfl, rfl⟩ + | A _ _ _ _ _ => cases hw + | B _ _ _ _ _ => cases hw + +theorem Num_inv_true {n e o : Nat} {w : List Bool} (h : Num n e o (true :: w)) : + ∃ n0 o0, n = 1 + n0 ∧ e = 1 + o0 * 2 ∧ Num n0 o o0 w := by + generalize hw : true :: w = u at h + cases h with + | nil => cases hw + | A n0 e0 o0 w0 h0 => + injection hw with _ hw0; subst hw0 + exact ⟨n0, o0, rfl, rfl, h0⟩ + | B _ _ _ _ _ => cases hw + +theorem Num_inv_false {n e o : Nat} {w : List Bool} (h : Num n e o (false :: w)) : + ∃ n0 o0, n = 1 + n0 ∧ e = o0 * 2 ∧ Num n0 o o0 w := by + generalize hw : false :: w = u at h + cases h with + | nil => cases hw + | A _ _ _ _ _ => cases hw + | B n0 e0 o0 w0 h0 => + injection hw with _ hw0; subst hw0 + exact ⟨n0, o0, rfl, rfl, h0⟩ + +theorem Num_inv_cons {n e o : Nat} {b : Bool} {w : List Bool} (h : Num n e o (b :: w)) : + ∃ n0 o0, n = 1 + n0 ∧ e = (if b then 1 + o0 * 2 else o0 * 2) ∧ Num n0 o o0 w := by + cases b + · rcases Num_inv_false h with ⟨n0, o0, hn, he, h0⟩ + exact ⟨n0, o0, hn, he, h0⟩ + · rcases Num_inv_true h with ⟨n0, o0, hn, he, h0⟩ + exact ⟨n0, o0, hn, he, h0⟩ + +inductive Borrow : List Bool → List Bool → Prop + | stop (b : Bool) (w : List Bool) : Borrow (b :: true :: w) (false :: w) + | carry (b : Bool) (w w' : List Bool) : Borrow w w' → Borrow (b :: false :: w) (true :: true :: w') + +theorem Borrow_num {w w' : List Bool} (hb : Borrow w w') : + ∀ {n e o : Nat}, Num n e (1 + o) w → ∃ e', Num n e' o (true :: w') ∧ e ≤ e' := by + induction hb with + | stop b w => + intro n e o h + rcases Num_inv_cons h with ⟨n0, o0, rfl, rfl, h0⟩ + rcases Num_inv_true h0 with ⟨n1, o1, rfl, ho, h1⟩ + refine ⟨1 + o0 * 2, ⟨Num_eq (Num.A _ _ _ _ (Num.B _ _ _ _ h1)) rfl rfl (by omega) rfl, ?_⟩⟩ + cases b <;> (simp; try omega) + | carry b w w' _ ih => + intro n e o h + rcases Num_inv_cons h with ⟨n0, o0, rfl, rfl, h0⟩ + rcases Num_inv_false h0 with ⟨n1, o1, rfl, ho, h1⟩ + have h1' : Num n1 o0 (1 + (o1 - 1)) w := Num_eq h1 rfl rfl (by omega) rfl + rcases ih h1' with ⟨e', hn', hle⟩ + refine ⟨1 + e' * 2, ⟨Num_eq (Num.A _ _ _ _ (Num.A _ _ _ _ hn')) rfl rfl (by omega) rfl, ?_⟩⟩ + cases b <;> (simp; try omega) + +theorem Borrow_ex : ∀ (n : Nat) {e o : Nat} {w : List Bool}, + Num n e (1 + o) w → ∃ w', Borrow w w' := by + intro n + induction n using Nat.strong_induction_on with + | h n ih => + intro e o w hn + rcases w with _ | ⟨b, _ | ⟨c, w1⟩⟩ + · rcases Num_inv_nil hn with ⟨_, _, _⟩; omega + · rcases Num_inv_cons hn with ⟨n0, o0, rfl, rfl, h0⟩ + rcases Num_inv_nil h0 with ⟨_, _, _⟩; omega + · rcases Num_inv_cons hn with ⟨n0, o0, rfl, rfl, h0⟩ + cases c + · rcases Num_inv_false h0 with ⟨n1, o1, rfl, ho, h1⟩ + have h1' : Num n1 o0 (1 + (o1 - 1)) w1 := Num_eq h1 rfl rfl (by omega) rfl + rcases ih n1 (by omega) h1' with ⟨w', hw'⟩ + exact ⟨true :: true :: w', Borrow.carry b w1 w' hw'⟩ + · exact ⟨false :: w1, Borrow.stop b w1⟩ + +theorem Borrow_spec {w w' : List Bool} (hb : Borrow w w') (l r : ListBlank (Fin 2)) : + ((l <+ l_tape w) <{{E}} ([0] +> r)) [target_tm]⊢⁺ + ((l <+ l_tape w' <+ s_tag) {{D}}> r) := by + induction hb generalizing l r with + | stop b w => + have ht : l <+ l_tape (b :: true :: w) = l <+ l_tape w <+ Half 0 <+ Half (if b then 0 else 1) := by + simp [l_tape, digit] + have ht' : l <+ l_tape (false :: w) = l <+ l_tape w <+ Half 1 := by + simp [l_tape, digit] + rw [ht, ht'] + exact EStop (l <+ l_tape w) r (if b then 0 else 1) + | carry b w w' _ ih => + have ht : l <+ l_tape (b :: false :: w) = l <+ l_tape w <+ Half 1 <+ Half (if b then 0 else 1) := by + simp [l_tape, digit] + have ht' : l <+ l_tape (true :: true :: w') = l <+ l_tape w' <+ ld0 ^ 1 := by + simp [l_tape, digit, ld0, Half, pow_succ_list, pow_zero_list] + rw [ht, ht'] + have s1 := ECarry (l <+ l_tape w) r (if b then 0 else 1) + have s2 := ih l (ones ^ 6 +> r) + have s3 := SOnes (l <+ l_tape w') r 1 + exact stepPlus_trans s1 (stepPlus_stepStar_trans s2 s3) + +theorem L_borrow_spec {w w' : List Bool} (hb : Borrow (true :: w) w') (l r : ListBlank (Fin 2)) : + ((l <+ l_tape (true :: w)) <{{C}} r) [target_tm]⊢⁺ + ((l <+ l_tape (true :: w')) {{B}}> r) := by + cases hb with + | stop _ v => + have ht : l <+ l_tape (true :: true :: v) = l <+ l_tape v <+ ld0 := by + simp [l_tape, digit, ld0, Half] + have ht' : l <+ l_tape (true :: false :: v) = l <+ l_tape v <+ ld1 := by + simp [l_tape, digit, ld1, Half] + rw [ht, ht'] + exact LInc_zero (l <+ l_tape v) r + | carry _ v u hv => + have ht : l <+ l_tape (true :: false :: v) = l <+ l_tape v <+ Half 1 <+ Half 0 := by + simp [l_tape, digit] + have ht' : l <+ l_tape (true :: true :: true :: u) = + l <+ l_tape u <+ Half 0 <+ Half 0 <+ Half 0 := by + simp [l_tape, digit] + rw [ht, ht'] + exact stepPlus_trans (LBAtoE (l <+ l_tape v) r) + (stepPlus_trans (Borrow_spec hv l (ones ^ 5 +> r)) (SFive (l <+ l_tape u) r)) + +theorem LInc_num {n e o : Nat} {w : List Bool} (hn : Num n e (1 + o) (true :: w)) : + ∃ e' w', Num n e' o (true :: w') ∧ e ≤ e' ∧ ∀ l r, + ((l <+ l_tape (true :: w)) <{{C}} r) [target_tm]⊢⁺ + ((l <+ l_tape (true :: w')) {{B}}> r) := by + rcases Borrow_ex n hn with ⟨w', hb⟩ + rcases Borrow_num hb hn with ⟨e', hn', hle⟩ + exact ⟨e', w', hn', hle, L_borrow_spec hb⟩ + +theorem RC_pairs (q : Nat) {n e o : Nat} {w : List Bool} {z : Nat} {r : ListBlank (Fin 2)} + (hn : Num n e (q + o) (true :: w)) (hr : RC z r) : + ∃ e' w' r', Num n e' o (true :: w') ∧ e ≤ e' ∧ RC (z + q) r' ∧ ∀ l, + ((l <+ l_tape (true :: w)) <{{C}} r) [target_tm]⊢* + ((l <+ l_tape (true :: w')) <{{C}} r') := by + induction q generalizing e w z r with + | zero => + exact ⟨e, w, r, Num_eq hn rfl rfl (by omega) rfl, Nat.le_refl e, + RC_eq hr (by omega) rfl, fun l => stepStar_refl _⟩ + | succ q ih => + have hn1 : Num n e (1 + (q + o)) (true :: w) := Num_eq hn rfl rfl (by omega) rfl + rcases LInc_num hn1 with ⟨e1, w1, hn_w1, hle1, hL⟩ + rcases RInc_ex hr with ⟨r1, hr1, hR⟩ + rcases ih hn_w1 hr1 with ⟨e2, w2, r2, hn_w2, hle2, hr2, hS⟩ + refine ⟨e2, w2, r2, hn_w2, by omega, RC_eq hr2 (by omega) rfl, fun l => ?_⟩ + exact stepStar_trans (stepPlus_to_stepStar (hL l r)) + (stepStar_trans (stepPlus_to_stepStar (hR (l <+ l_tape (true :: w1)))) (hS l)) + +theorem FC_pairs (tail : ListBlank (Fin 2)) (k q : Nat) {n e o : Nat} {w : List Bool} + {z : Nat} {r : ListBlank (Fin 2)} + (hn : Num n e (q + o) (true :: w)) (hr : FC tail k z r) (hb : z + q < 2 ^ k) : + ∃ e' w' r', Num n e' o (true :: w') ∧ e ≤ e' ∧ FC tail k (z + q) r' ∧ ∀ l, + ((l <+ l_tape (true :: w)) <{{C}} r) [target_tm]⊢* + ((l <+ l_tape (true :: w')) <{{C}} r') := by + induction q generalizing e w z r with + | zero => + exact ⟨e, w, r, Num_eq hn rfl rfl (by omega) rfl, Nat.le_refl e, + FC_eq hr rfl (by omega) rfl, fun l => stepStar_refl _⟩ + | succ q ih => + have hn1 : Num n e (1 + (q + o)) (true :: w) := Num_eq hn rfl rfl (by omega) rfl + rcases LInc_num hn1 with ⟨e1, w1, hn_w1, hle1, hL⟩ + rcases FiniteRInc_ex hr (by omega) with ⟨r1, hr1, hR⟩ + rcases ih hn_w1 hr1 (by omega) with ⟨e2, w2, r2, hn_w2, hle2, hr2, hS⟩ + refine ⟨e2, w2, r2, hn_w2, by omega, FC_eq hr2 rfl (by omega) rfl, fun l => ?_⟩ + exact stepStar_trans (stepPlus_to_stepStar (hL l r)) + (stepStar_trans (stepPlus_to_stepStar (hR (l <+ l_tape (true :: w1)))) (hS l)) + +theorem TZero {n e o : Nat} {w : List Bool} (h : Nat) (l r : ListBlank (Fin 2)) + (hn : Num n e (2 ^ (h + 2) + o) (true :: w)) : + ∃ e' w', Num n e' o (true :: w') ∧ e ≤ e' ∧ + ((l <+ l_tape (true :: w) <+ (Half 1) ^ h <+ t_tag) {{D}}> (rd0 +> r)) [target_tm]⊢⁺ + ((l <+ l_tape (true :: w') <+ (Half 1) ^ (h + 1) <+ t_tag) {{D}}> r) := by + have hp := pow2_pos (h + 2) + have hn' : Num n e ((2 ^ (h + 2) - 1) + (1 + o)) (true :: w) := + Num_eq hn rfl rfl (by omega) rfl + rcases FC_pairs ([1] +> r) (h + 2) (2 ^ (h + 2) - 1) hn' (FC_zero ([1] +> r) (h + 2)) (by omega) + with ⟨e1, w1, r1, h1, hle1, hr1, hS⟩ + rcases LInc_num h1 with ⟨e2, w2, h2, hle2, hL⟩ + have hr1_eq : r1 = rd1 ^ (h + 2) +> ([1] +> r) := + FC_full_unique (FC_eq hr1 rfl (by omega) rfl) + subst hr1_eq + refine ⟨e2, w2, h2, by omega, ?_⟩ + have ht : l <+ l_tape (true :: w) = l <+ l_tape w <+ Half 0 := by simp [l_tape, digit] + have s1 := TZeroEntry (l <+ l_tape w) r h + rw [← ht] at s1 + have s2 := hS l + have s3 := hL l (rd1 ^ (h + 2) +> ([1] +> r)) + have s4 := RExit (l <+ l_tape (true :: w2)) r h + exact stepPlus_trans s1 + (stepStar_stepPlus_trans s2 + (stepPlus_trans s3 s4)) + +-- ============================================================================ +-- Section 5: HalfNormal +-- ============================================================================ + +inductive Normal : Nat → Nat → List Bool → Prop + | nil : Normal 0 0 [] + | one (n k : Nat) (w : List Bool) : Normal n k w → Normal (n + 1) (1 + 2 * k) (true :: true :: w) + | zero (n k : Nat) (w : List Bool) : Normal n k w → Normal (n + 1) (2 * k) (true :: false :: w) + +theorem Normal_eq {n n' k k' : Nat} {w w' : List Bool} + (h : Normal n k w) (hn : n = n') (hk : k = k') (hw : w = w') : + Normal n' k' w' := by + subst hn; subst hk; subst hw; exact h + +theorem normal_num {n k : Nat} {w : List Bool} (h : Normal n k w) : + Num (2 * n) (2 ^ n - 1) k w := by + induction h with + | nil => exact Num.nil + | one n k w _ ih => + have hp := pow2_pos n + exact Num_eq (Num.A _ _ _ _ (Num.A _ _ _ _ ih)) (by omega) (by rw [Nat.pow_succ]; omega) (by omega) rfl + | zero n k w _ ih => + have hp := pow2_pos n + exact Num_eq (Num.A _ _ _ _ (Num.B _ _ _ _ ih)) (by omega) (by rw [Nat.pow_succ]; omega) (by omega) rfl + +theorem normal_bound {n k : Nat} {w : List Bool} (h : Normal n k w) : k < 2 ^ n := by + induction h with + | nil => simp + | one n k w _ ih => rw [Nat.pow_succ]; omega + | zero n k w _ ih => rw [Nat.pow_succ]; omega + +theorem normal_length {n k : Nat} {w : List Bool} (h : Normal n k w) : w.length = 2 * n := + Num_length (normal_num h) + +theorem normal_head {n k : Nat} {w : List Bool} (h : Normal n k w) (hn : 0 < n) : + ∃ v, w = true :: v := by + cases h with + | nil => omega + | one _ _ w _ => exact ⟨true :: w, rfl⟩ + | zero _ _ w _ => exact ⟨false :: w, rfl⟩ + +theorem num_normal : ∀ (n : Nat) {k : Nat} {w : List Bool}, + Num (2 * n) (2 ^ n - 1) k w → Normal n k w := by + intro n + induction n with + | zero => + intro k w h + have hl := Num_length h + rcases w with _ | ⟨b, w⟩ + · rcases Num_inv_nil h with ⟨_, _, rfl⟩ + exact Normal.nil + · simp at hl + | succ n ih => + intro k w h + have hp := pow2_pos n + have hp1 : 2 ^ (n + 1) - 1 = 1 + (2 ^ n - 1) * 2 := by rw [Nat.pow_succ]; omega + have hl := Num_length h + rcases w with _ | ⟨b, _ | ⟨c, w1⟩⟩ + · simp at hl + · simp at hl; omega + · rcases Num_inv_cons h with ⟨n0, o0, hn0, he0, h0⟩ + cases b + · simp at he0; omega + · simp at he0 + rcases Num_inv_cons h0 with ⟨n1, o1, hn1, he1, h1⟩ + have h1' : Num (2 * n) (2 ^ n - 1) o1 w1 := + Num_eq h1 (by omega) (by omega) rfl rfl + cases c + · simp at he1 + exact Normal_eq (Normal.zero n o1 w1 (ih h1')) rfl (by omega) rfl + · simp at he1 + exact Normal_eq (Normal.one n o1 w1 (ih h1')) rfl (by omega) rfl + +theorem normal_full_tape {n k : Nat} {w : List Bool} (h : Normal n k w) (hk : k = 2 ^ n - 1) : + l_tape w = ld0 ^ n := by + induction h with + | nil => rfl + | one n k w _ ih => + have hp := pow2_pos n + have hk' : k = 2 ^ n - 1 := by rw [Nat.pow_succ] at hk; omega + simp [l_tape, digit, Half, ld0, pow_succ_list, ih hk'] + | zero n k w _ _ => + have hp := pow2_pos n + rw [Nat.pow_succ] at hk + omega + +theorem normal_zero_tape {n k : Nat} {w : List Bool} (h : Normal n k w) (hk : k = 0) : + l_tape w = ld1 ^ n := by + induction h with + | nil => rfl + | one _ _ _ _ _ => omega + | zero n k w _ ih => + have hk' : k = 0 := by omega + simp [l_tape, digit, Half, ld1, pow_succ_list, ih hk'] + +theorem normal_full (n : Nat) : Normal n (2 ^ n - 1) (List.replicate (2 * n) true) := by + induction n with + | zero => exact Normal.nil + | succ n ih => + have hp := pow2_pos n + have hrep : List.replicate (2 * (n + 1)) true = true :: true :: List.replicate (2 * n) true := by + rw [show 2 * (n + 1) = (2 * n) + 2 by omega] + rfl + rw [hrep] + exact Normal_eq (Normal.one n (2 ^ n - 1) (List.replicate (2 * n) true) ih) + rfl (by rw [Nat.pow_succ]; omega) rfl + +theorem normal_zero (n : Nat) : ∃ w, Normal n 0 w := by + induction n with + | zero => exact ⟨[], Normal.nil⟩ + | succ n ih => + rcases ih with ⟨w, hw⟩ + exact ⟨true :: false :: w, Normal_eq (Normal.zero n 0 w hw) rfl (by omega) rfl⟩ + +theorem l_tape_append (u v : List Bool) : l_tape (u ++ v) = l_tape u ++ l_tape v := by + induction u with + | nil => rfl + | cons b u ih => simp [l_tape, ih, List.append_assoc] + +theorem l_tape_replicate_true (m : Nat) (w : List Bool) : + l_tape (List.replicate m true ++ w) = (Half 0) ^ m ++ l_tape w := by + induction m with + | zero => rfl + | succ m ih => + rw [List.replicate_succ, List.cons_append, l_tape_cons, ih, pow_succ_list] + simp [digit, List.append_assoc] + +theorem l_tape_replicate_false (m : Nat) (w : List Bool) : + l_tape (List.replicate m false ++ w) = (Half 1) ^ m ++ l_tape w := by + induction m with + | zero => rfl + | succ m ih => + rw [List.replicate_succ, List.cons_append, l_tape_cons, ih, pow_succ_list] + simp [digit, List.append_assoc] + +theorem Num_AA {n e o : Nat} {w : List Bool} (m : Nat) (h : Num n e o w) : + Num (n + 2 * m) ((e + 1) * 2 ^ m - 1) ((o + 1) * 2 ^ m - 1) (List.replicate (2 * m) true ++ w) := by + induction m with + | zero => + exact Num_eq h (by omega) (by omega) (by omega) rfl + | succ m ih => + have hp := pow2_pos m + have hrep : List.replicate (2 * (m + 1)) true ++ w = + true :: true :: (List.replicate (2 * m) true ++ w) := by + rw [show 2 * (m + 1) = 2 + 2 * m by omega, List.replicate_add] + rfl + rw [hrep] + have h1 : 1 + ((e + 1) * 2 ^ m - 1) * 2 = (e + 1) * 2 ^ (m + 1) - 1 := by + have hmul : (e + 1) * 2 ^ (m + 1) = ((e + 1) * 2 ^ m) * 2 := by rw [Nat.pow_succ]; ring + have hpos : 1 ≤ (e + 1) * 2 ^ m := Nat.mul_pos (by omega) hp + rw [hmul]; omega + have h2 : 1 + ((o + 1) * 2 ^ m - 1) * 2 = (o + 1) * 2 ^ (m + 1) - 1 := by + have hmul : (o + 1) * 2 ^ (m + 1) = ((o + 1) * 2 ^ m) * 2 := by rw [Nat.pow_succ]; ring + have hpos : 1 ≤ (o + 1) * 2 ^ m := Nat.mul_pos (by omega) hp + rw [hmul]; omega + exact Num_eq (Num.A _ _ _ _ (Num.A _ _ _ _ ih)) (by omega) h1 h2 rfl + +theorem Num_Aodd {n e o : Nat} {w : List Bool} (m : Nat) (h : Num n e o w) : + Num (n + 2 * m + 1) ((o + 1) * 2 ^ (m + 1) - 1) ((e + 1) * 2 ^ m - 1) + (List.replicate (2 * m + 1) true ++ w) := by + have hp := pow2_pos m + have hAA := Num_AA m h + have hrep : List.replicate (2 * m + 1) true ++ w = + true :: (List.replicate (2 * m) true ++ w) := by + rw [show 2 * m + 1 = 1 + 2 * m by omega, List.replicate_add] + rfl + rw [hrep] + have h1 : 1 + ((o + 1) * 2 ^ m - 1) * 2 = (o + 1) * 2 ^ (m + 1) - 1 := by + have hmul : (o + 1) * 2 ^ (m + 1) = ((o + 1) * 2 ^ m) * 2 := by rw [Nat.pow_succ]; ring + have hpos : 1 ≤ (o + 1) * 2 ^ m := Nat.mul_pos (by omega) hp + rw [hmul]; omega + exact Num_eq (Num.A _ _ _ _ hAA) (by omega) h1 rfl rfl + +theorem normal_LInc {n k : Nat} {w : List Bool} (h : Normal n (1 + k) w) : + ∃ w', Normal n k w' ∧ ∀ l r, + ((l <+ l_tape w) <{{C}} r) [target_tm]⊢⁺ + ((l <+ l_tape w') {{B}}> r) := by + have hb := normal_bound h + have hn : 0 < n := by + cases n with + | zero => simp at hb + | succ n => omega + rcases normal_head h hn with ⟨v, rfl⟩ + rcases LInc_num (normal_num h) with ⟨e', v', hN, hle, hS⟩ + rcases Num_bounds hN with ⟨hmax, _⟩ + have hdiv : (2 * n + 1) / 2 = n := by omega + rw [hdiv] at hmax + have he' : e' = 2 ^ n - 1 := by omega + subst he' + exact ⟨true :: v', num_normal n hN, hS⟩ + +-- ============================================================================ +-- Section 6: HalfZero & HalfDrain +-- ============================================================================ + +theorem zero_pair {n e : Nat} {b c : Bool} {w : List Bool} (h : Num (2 + n) e 0 (b :: c :: w)) : + c = false ∧ ∃ e', Num n e' 0 w := by + rcases Num_inv_cons h with ⟨n0, o0, hn0, _, h0⟩ + rcases Num_inv_cons h0 with ⟨n1, o1, hn1, he1, h1⟩ + cases c + · simp at he1 + exact ⟨rfl, o0, Num_eq h1 (by omega) rfl (by omega) rfl⟩ + · simp at he1; omega + +theorem zero_even : ∀ (m : Nat) {e : Nat} {w : List Bool}, + Num (2 * m) e 0 w → ∃ bs : List (Fin 2), bs.length = m ∧ l_tape w = Marked bs := by + intro m + induction m with + | zero => + intro e w h + have hl := Num_length h + rcases w with _ | ⟨b, w⟩ + · exact ⟨[], rfl, rfl⟩ + · simp at hl + | succ m ih => + intro e w h + have hl := Num_length h + rcases w with _ | ⟨b, _ | ⟨c, w⟩⟩ + · simp at hl + · simp at hl; omega + · have h' : Num (2 + 2 * m) e 0 (b :: c :: w) := Num_eq h (by omega) rfl rfl rfl + rcases zero_pair h' with ⟨rfl, e', hw⟩ + rcases ih hw with ⟨bs, hbs, ht⟩ + refine ⟨(if b then 0 else 1) :: bs, by simp [hbs], ?_⟩ + simp [l_tape, digit, Marked, ht, List.append_assoc] + +theorem zero_odd : ∀ (m : Nat) {e : Nat} {w : List Bool}, + Num (2 * m + 1) e 0 w → + ∃ (bs : List (Fin 2)) (b : Fin 2), bs.length = m ∧ l_tape w = Marked bs ++ Half b := by + intro m + induction m with + | zero => + intro e w h + have hl := Num_length h + rcases w with _ | ⟨b, _ | ⟨c, w⟩⟩ + · simp at hl + · refine ⟨[], if b then 0 else 1, rfl, ?_⟩ + simp [l_tape, digit, Marked] + · simp at hl + | succ m ih => + intro e w h + have hl := Num_length h + rcases w with _ | ⟨b, _ | ⟨c, w⟩⟩ + · simp at hl + · simp at hl + · have h' : Num (2 + (2 * m + 1)) e 0 (b :: c :: w) := Num_eq h (by omega) rfl rfl rfl + rcases zero_pair h' with ⟨rfl, e', hw⟩ + rcases ih hw with ⟨bs, d, hbs, ht⟩ + refine ⟨(if b then 0 else 1) :: bs, d, by simp [hbs], ?_⟩ + simp [l_tape, digit, Marked, ht, List.append_assoc] + +theorem zero_even_A {m e : Nat} {w : List Bool} (h : Num (2 * m) e 0 (true :: w)) : + ∃ bs : List (Fin 2), bs.length + 1 = m ∧ l_tape (true :: w) = Half 0 ++ Half 1 ++ Marked bs := by + cases m with + | zero => + have hl := Num_length h + simp at hl + | succ m => + have hl := Num_length h + rcases w with _ | ⟨c, w⟩ + · simp at hl; omega + · have h' : Num (2 + 2 * m) e 0 (true :: c :: w) := Num_eq h (by omega) rfl rfl rfl + rcases zero_pair h' with ⟨rfl, e', hw⟩ + rcases zero_even m hw with ⟨bs, hbs, ht⟩ + refine ⟨bs, by omega, ?_⟩ + simp [l_tape, digit, ht, List.append_assoc] + +theorem zero_odd_A {m e : Nat} {w : List Bool} (h : Num (2 * m + 1) e 0 (true :: w)) : + (m = 0 ∧ w = []) ∨ + ∃ (bs : List (Fin 2)) (b : Fin 2), bs.length + 1 = m ∧ + l_tape (true :: w) = Half 0 ++ Half 1 ++ Marked bs ++ Half b := by + cases m with + | zero => + have hl := Num_length h + rcases w with _ | ⟨c, w⟩ + · exact Or.inl ⟨rfl, rfl⟩ + · simp at hl + | succ m => + have hl := Num_length h + rcases w with _ | ⟨c, w⟩ + · simp at hl + · have h' : Num (2 + (2 * m + 1)) e 0 (true :: c :: w) := Num_eq h (by omega) rfl rfl rfl + rcases zero_pair h' with ⟨rfl, e', hw⟩ + rcases zero_odd m hw with ⟨bs, b, hbs, ht⟩ + refine Or.inr ⟨bs, b, by omega, ?_⟩ + simp [l_tape, digit, ht, List.append_assoc] + +theorem LZeroEven_num {m e : Nat} {w : List Bool} (r : ListBlank (Fin 2)) + (h : Num (2 * m) e 0 (true :: w)) : + ((ldh <+ l_tape (true :: w)) <{{C}} r) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ m) {{B}}> ([1] +> r)) := by + rcases zero_even_A h with ⟨bs, rfl, ht⟩ + have heq : ldh <+ l_tape (true :: w) = ldh <+ Marked bs <+ Half 1 <+ Half 0 := by + rw [ht]; simp [listblank_append_assoc] + rw [heq] + exact LZeroEven r bs + +theorem LZeroOdd_num {m e : Nat} {w : List Bool} (r : ListBlank (Fin 2)) + (h : Num (2 * m + 1) e 0 (true :: w)) : + ((ldh <+ l_tape (true :: w)) <{{C}} r) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ m <+ Half 0) {{B}}> ([1, 1] +> r)) := by + rcases zero_odd_A h with ⟨rfl, rfl⟩ | ⟨bs, b, rfl, ht⟩ + · simpa [l_tape, digit] using! LSingle r + · have heq : ldh <+ l_tape (true :: w) = ldh <+ Half b <+ Marked bs <+ Half 1 <+ Half 0 := by + rw [ht]; simp [listblank_append_assoc] + rw [heq] + exact LZeroOdd r bs b + +theorem S_even_bound (m e o : Nat) (w : List Bool) (h : Num (2 * (1 + m)) e o w) : + 2 * ((2 + e) / 2) + 1 ≤ 2 ^ (2 + m) - 1 := by + rcases Num_bounds h with ⟨he, _⟩ + have hdiv : (2 * (1 + m) + 1) / 2 = 1 + m := by omega + rw [hdiv] at he + have hp0 := pow2_pos m + have hp1 : 2 ≤ 2 ^ (1 + m) := by rw [Nat.add_comm 1 m, Nat.pow_succ]; omega + have hp : 2 ^ (2 + m) = 2 * 2 ^ (1 + m) := by + rw [show 2 + m = (1 + m) + 1 by omega, Nat.pow_succ] + omega + rw [hp] + omega + +theorem S_odd_bound (m e o : Nat) (w : List Bool) (h : Num (2 * m + 1) e o w) : + 2 + e ≤ 2 ^ (1 + m) + 1 := by + rcases Num_bounds h with ⟨he, _⟩ + have hdiv : (2 * m + 1 + 1) / 2 = 1 + m := by omega + rw [hdiv] at he + omega + +theorem Drain_even {m e o : Nat} {w : List Bool} {z : Nat} {r : ListBlank (Fin 2)} + (hn : Num (2 * m) e o (true :: w)) (hr : RC z r) : + ∃ r', RC (z + o) r' ∧ + ((ldh <+ l_tape (true :: w)) <{{C}} r) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ m) {{B}}> ([1] +> r')) := by + have hn' : Num (2 * m) e (o + 0) (true :: w) := Num_eq hn rfl rfl (by omega) rfl + rcases RC_pairs o hn' hr with ⟨e', w', r', hn1, _, hr1, hS⟩ + exact ⟨r', hr1, stepStar_stepPlus_trans (hS ldh) (LZeroEven_num r' hn1)⟩ + +theorem Drain_odd {m e o : Nat} {w : List Bool} {z : Nat} {r : ListBlank (Fin 2)} + (hn : Num (2 * m + 1) e o (true :: w)) (hr : RC z r) : + ∃ r', RC ((z + o) / 2) r' ∧ + ((ldh <+ l_tape (true :: w)) <{{C}} r) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (1 + m)) <{{C}} ([1, 0] +> r')) := by + have hn' : Num (2 * m + 1) e (o + 0) (true :: w) := Num_eq hn rfl rfl (by omega) rfl + rcases RC_pairs o hn' hr with ⟨e', w', s, hn1, _, hs, hS⟩ + rcases RC_tail hs with ⟨b, r', hr', rfl⟩ + refine ⟨r', hr', ?_⟩ + have s1 := hS ldh + have s2 := LZeroOdd_num ([b, 0, 0] +> r') hn1 + have s3 := R11Bit (ldh <+ ld0 ^ m <+ Half 0) r' b + have heq : ldh <+ ld0 ^ m <+ Half 0 <+ Half 0 = ldh <+ ld0 ^ (1 + m) := by + rw [← left_ld0_eq, Nat.add_comm 1 m, left_pow_succ ldh ld0 m] + rw [heq] at s3 + exact stepStar_stepPlus_trans s1 (stepPlus_trans s2 s3) + +theorem Drain_S_even {m e o : Nat} {w : List Bool} (hn : Num (2 * m) e o w) : + ∃ r', RC ((2 + e) / 2) r' ∧ + ((ldh <+ l_tape w <+ s_tag) {{D}}> default) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (1 + m)) <{{C}} ([1, 0] +> r')) := by + have hn' : Num (2 * m + 1) (1 + o * 2) e (true :: w) := + Num_eq (Num.A _ _ _ _ hn) (by omega) rfl rfl rfl + have hr2 : RC 2 ([0, 0, 0, 1] +> default) := by + have h0 : RC 2 (rd0 +> (rd1 +> default)) := + RC_eq (RC.d0 1 (rd1 +> default) (RC_eq (RC.d1 0 default RC.zero) (by omega) rfl)) (by omega) rfl + have heq : rd0 +> (rd1 +> (default : ListBlank (Fin 2))) = [0, 0, 0, 1] +> default := by + simp [rd0, rd1] + rwa [heq] at h0 + rcases Drain_odd hn' hr2 with ⟨r', hr', hS⟩ + refine ⟨r', hr', ?_⟩ + have s1 := SZeroEntry (ldh <+ l_tape w) default + have h000 : ([0, 0, 0] : List (Fin 2)) +> (default : ListBlank (Fin 2)) = default := + rd0_append_default + rw [h000] at s1 + have ht : ldh <+ l_tape (true :: w) = ldh <+ l_tape w <+ Half 0 := by simp [l_tape, digit] + rw [ht] at hS + exact stepPlus_trans s1 hS + +theorem Drain_S_odd {m e o : Nat} {w : List Bool} (hn : Num (2 * m + 1) e o w) : + ∃ r', RC (2 + e) r' ∧ + ((ldh <+ l_tape w <+ s_tag) {{D}}> default) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (1 + m)) {{B}}> ([1] +> r')) := by + have hn' : Num (2 * (1 + m)) (1 + o * 2) e (true :: w) := + Num_eq (Num.A _ _ _ _ hn) (by omega) rfl rfl rfl + have hr2 : RC 2 ([0, 0, 0, 1] +> default) := by + have h0 : RC 2 (rd0 +> (rd1 +> default)) := + RC_eq (RC.d0 1 (rd1 +> default) (RC_eq (RC.d1 0 default RC.zero) (by omega) rfl)) (by omega) rfl + have heq : rd0 +> (rd1 +> (default : ListBlank (Fin 2))) = [0, 0, 0, 1] +> default := by + simp [rd0, rd1] + rwa [heq] at h0 + rcases Drain_even hn' hr2 with ⟨r', hr', hS⟩ + refine ⟨r', hr', ?_⟩ + have s1 := SZeroEntry (ldh <+ l_tape w) default + have h000 : ([0, 0, 0] : List (Fin 2)) +> (default : ListBlank (Fin 2)) = default := + rd0_append_default + rw [h000] at s1 + have ht : ldh <+ l_tape (true :: w) = ldh <+ l_tape w <+ Half 0 := by simp [l_tape, digit] + rw [ht] at hS + exact stepPlus_trans s1 hS + +-- ============================================================================ +-- Section 7: HalfST & STClosure +-- ============================================================================ + +theorem S000_borrow {n e o : Nat} {b : Bool} {v : List Bool} (h : Num n (2 + e) o (b :: v)) : + ∃ e' u, Borrow v u ∧ Num (n + 1) e' e (true :: b :: true :: u) ∧ 2 * o + 1 ≤ e' := by + rcases Num_inv_cons h with ⟨n0, o0, rfl, he0, h0⟩ + have h0' : Num n0 o (1 + (o0 - 1)) v := by + refine Num_eq h0 rfl rfl ?_ rfl + cases b <;> simp at he0 <;> omega + rcases Borrow_ex n0 h0' with ⟨u, hb⟩ + rcases Borrow_num hb h0' with ⟨e', hN, hle⟩ + refine ⟨1 + e' * 2, u, hb, ?_, by omega⟩ + cases b + · simp at he0 + exact Num_eq (Num.A _ _ _ _ (Num.B _ _ _ _ hN)) (by omega) rfl (by omega) rfl + · simp at he0 + exact Num_eq (Num.A _ _ _ _ (Num.A _ _ _ _ hN)) (by omega) rfl (by omega) rfl + +theorem ST_S100 {n e o : Nat} {w : List Bool} (h : Num n e o w) : + Num (n + 1) (2 * o) e (false :: w) ∧ ∀ l r, + ((l <+ l_tape w <+ s_tag) {{D}}> (rd1 +> r)) [target_tm]⊢⁺ + ((l <+ l_tape (false :: w) <+ s_tag) {{D}}> r) := by + refine ⟨Num_eq (Num.B _ _ _ _ h) (by omega) (by omega) rfl rfl, fun l r => ?_⟩ + simpa [l_tape, digit, rd1] using! S100 (l <+ l_tape w) r + +theorem ST_T100 {n e o : Nat} {w : List Bool} (h : Num n e (1 + o) w) : + ∃ e' w', Num (n + 1) (1 + 2 * o) e' (true :: w') ∧ e ≤ e' ∧ ∀ l r, + ((l <+ l_tape w <+ t_tag) {{D}}> (rd1 +> r)) [target_tm]⊢⁺ + ((l <+ l_tape (true :: w') <+ s_tag) {{D}}> r) := by + rcases Borrow_ex n h with ⟨u, hb⟩ + rcases Borrow_num hb h with ⟨e', hN, hle⟩ + refine ⟨e', true :: u, Num_eq (Num.A _ _ _ _ hN) (by omega) (by omega) rfl rfl, hle, fun l r => ?_⟩ + have s1 := T100 (l <+ l_tape w) r + have s2 := Borrow_spec hb l (ones ^ 6 +> r) + have s3 := SOnes (l <+ l_tape u) r 1 + have ht : l <+ l_tape (true :: true :: u) = l <+ l_tape u <+ ld0 ^ 1 := by + simp [l_tape, digit, ld0, Half, pow_succ_list, pow_zero_list] + rw [ht] + exact stepPlus_trans s1 (stepPlus_stepStar_trans s2 s3) + +theorem ST_S000 {n e o : Nat} {w : List Bool} (h : Num n (2 + e) o w) : + ∃ e' w', Num (n + 1) e' e (true :: w') ∧ 2 * o + 1 ≤ e' ∧ ∀ l r, + ((l <+ l_tape w <+ s_tag) {{D}}> (rd0 +> r)) [target_tm]⊢⁺ + ((l <+ l_tape (true :: w') <+ t_tag) {{D}}> r) := by + rcases w with _ | ⟨b, v⟩ + · rcases Num_inv_nil h with ⟨_, _, _⟩; omega + · rcases S000_borrow h with ⟨e', u, hb, hN, hle⟩ + refine ⟨e', b :: true :: u, hN, hle, fun l r => ?_⟩ + have ht1 : l <+ l_tape (b :: v) = l <+ l_tape v <+ Half (if b then 0 else 1) := by + simp [l_tape, digit] + have ht2 : l <+ l_tape (true :: b :: true :: u) = + l <+ l_tape u <+ Half 0 <+ Half (if b then 0 else 1) <+ Half 0 := by + simp [l_tape, digit] + rw [ht1, ht2] + have s1 := S000 (l <+ l_tape v) r (if b then 0 else 1) + have s2 := Borrow_spec hb l (ones ^ 5 +> ([Opp (if b then 0 else 1), 0, 0, 1] +> r)) + have s3 := S000_end (l <+ l_tape u) r (if b then 0 else 1) + exact stepPlus_trans s1 (stepPlus_trans s2 s3) + +def SC (w : List Bool) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ((ldh <+ l_tape w <+ s_tag) {{D}}> r) + +def TC (w : List Bool) (h : Nat) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ((ldh <+ l_tape (true :: w) <+ (Half 1) ^ h <+ t_tag) {{D}}> r) + +theorem TC_word (w : List Bool) (h : Nat) (r : ListBlank (Fin 2)) : + TC w h r = ((ldh <+ l_tape (List.replicate h false ++ true :: w) <+ t_tag) {{D}}> r) := by + simp [TC, l_tape_replicate_false, listblank_append_assoc] + +theorem Num_B_lower (h : Nat) {n e o : Nat} {w : List Bool} (k : Nat) + (hn : Num n e o w) (he : k ≤ e) (ho : k ≤ o) : + ∃ E O, Num (n + h) E O (List.replicate h false ++ w) ∧ k ≤ E ∧ k ≤ O := by + induction h with + | zero => exact ⟨e, o, Num_eq hn (by omega) rfl rfl rfl, he, ho⟩ + | succ h ih => + rcases ih with ⟨E, O, hN, hE, hO⟩ + refine ⟨O * 2, E, ?_, by omega, hE⟩ + rw [List.replicate_succ, List.cons_append] + exact Num_eq (Num.B _ _ _ _ hN) (by omega) rfl rfl rfl + +inductive STAllowed : Nat → Cfg (Fin 2) (Fin 6) → Prop + | S (n e o : Nat) (w : List Bool) (z : Nat) (r : ListBlank (Fin 2)) : + Num n e o w → 2 ≤ n → 2 * z ≤ e → z ≤ o → RC z r → + STAllowed z (SC w r) + | T (n e o : Nat) (w : List Bool) (h z : Nat) (r : ListBlank (Fin 2)) : + Num n e o (true :: w) → 2 ≤ n → 0 < z → + 2 ^ (h + 2) * z + 1 ≤ e → 2 ^ (h + 2) * (z - 1) + 2 ≤ o → RC z r → + STAllowed z (TC w h r) + +theorem ST_zero_shape {c : Cfg (Fin 2) (Fin 6)} (h : STAllowed 0 c) : + ∃ n e o w, Num n e o w ∧ 2 ≤ n ∧ c = SC w default := by + generalize hz : (0 : Nat) = z at h + cases h with + | S n e o w _ r hn hl _ _ hr => + subst hz + rw [RC_zero_unique hr] + exact ⟨n, e, o, w, hn, hl, rfl⟩ + | T _ _ _ _ _ _ _ _ _ hpos _ _ _ => omega + +theorem ST_positive_step {z : Nat} {c : Cfg (Fin 2) (Fin 6)} (h : STAllowed z c) (hz : 0 < z) : + ∃ c', STAllowed (z / 2) c' ∧ c [target_tm]⊢⁺ c' := by + cases h with + | S n e o w z r hn hl he ho hr => + cases hr with + | zero => omega + | d0 q s hrc => + have hdiv : q * 2 / 2 = q := by omega + rw [hdiv] + have hn' : Num n (2 + (e - 2)) o w := Num_eq hn rfl (by omega) rfl rfl + rcases ST_S000 hn' with ⟨e', w', hN, hle, hS⟩ + refine ⟨TC w' 0 s, ?_, hS ldh s⟩ + exact STAllowed.T (n + 1) e' (e - 2) w' 0 q s hN (by omega) (by omega) (by omega) (by omega) hrc + | d1 q s hrc => + have hdiv : (1 + q * 2) / 2 = q := by omega + rw [hdiv] + rcases ST_S100 hn with ⟨hN, hS⟩ + refine ⟨SC (false :: w) s, ?_, hS ldh s⟩ + exact STAllowed.S (n + 1) (2 * o) e (false :: w) q s hN (by omega) (by omega) (by omega) hrc + | T n e o w h z r hn hl hpos he ho hr => + have hp := pow2_pos (h + 2) + cases hr with + | zero => omega + | d0 q s hrc => + have hdiv : q * 2 / 2 = q := by omega + rw [hdiv] + have hq : 0 < q := by omega + have hb : 2 ^ (h + 2) ≤ o := by + have : 2 ^ (h + 2) * 1 ≤ 2 ^ (h + 2) * (q * 2 - 1) := + Nat.mul_le_mul_left _ (by omega) + omega + have hn' : Num n e (2 ^ (h + 2) + (o - 2 ^ (h + 2))) (true :: w) := + Num_eq hn rfl rfl (by omega) rfl + rcases TZero h ldh s hn' with ⟨e', w', hN, hle, hS⟩ + refine ⟨TC w' (h + 1) s, ?_, hS⟩ + have hcap : 2 ^ (h + 1 + 2) = 2 ^ (h + 2) * 2 := by + rw [show h + 1 + 2 = (h + 2) + 1 by omega, Nat.pow_succ] + have he' : 2 ^ (h + 1 + 2) * q + 1 ≤ e' := by + rw [hcap] + have : 2 ^ (h + 2) * 2 * q = 2 ^ (h + 2) * (q * 2) := by ring + omega + have ho' : 2 ^ (h + 1 + 2) * (q - 1) + 2 ≤ o - 2 ^ (h + 2) := by + rw [hcap] + have : 2 ^ (h + 2) * (q * 2 - 1) = 2 ^ (h + 2) * 2 * (q - 1) + 2 ^ (h + 2) := by + have hq1 : q * 2 - 1 = 2 * (q - 1) + 1 := by omega + rw [hq1]; ring + omega + exact STAllowed.T n e' (o - 2 ^ (h + 2)) w' (h + 1) q s hN hl hq he' ho' hrc + | d1 q s hrc => + have hdiv : (1 + q * 2) / 2 = q := by omega + rw [hdiv] + have hke : q + 1 ≤ e := by + have : 1 * (1 + q * 2) ≤ 2 ^ (h + 2) * (1 + q * 2) := + Nat.mul_le_mul_right _ (by omega) + omega + have hko : q + 1 ≤ o := by + have : 1 * (q * 2) ≤ 2 ^ (h + 2) * (1 + q * 2 - 1) := by + rw [show 1 + q * 2 - 1 = q * 2 by omega] + exact Nat.mul_le_mul_right _ (by omega) + omega + rcases Num_B_lower h (q + 1) hn hke hko with ⟨E, O, hN, hE, hO⟩ + have hN' : Num (n + h) E (1 + (O - 1)) (List.replicate h false ++ true :: w) := + Num_eq hN rfl rfl (by omega) rfl + rcases ST_T100 hN' with ⟨e', w', hN2, hle, hS⟩ + refine ⟨SC (true :: w') s, ?_, ?_⟩ + · exact STAllowed.S (n + h + 1) (1 + 2 * (O - 1)) e' (true :: w') q s + hN2 (by omega) (by omega) (by omega) hrc + · rw [TC_word] + exact hS ldh s + +theorem ST_to_zero : ∀ (z : Nat) {c : Cfg (Fin 2) (Fin 6)}, + STAllowed z c → ∃ c', STAllowed 0 c' ∧ c [target_tm]⊢* c' := by + intro z + induction z using Nat.strong_induction_on with + | h z ih => + intro c hA + rcases Nat.eq_zero_or_pos z with rfl | hz + · exact ⟨c, hA, stepStar_refl _⟩ + · rcases ST_positive_step hA hz with ⟨c1, hA1, hS1⟩ + rcases ih (z / 2) (by omega) hA1 with ⟨c2, hA2, hS2⟩ + exact ⟨c2, hA2, stepStar_trans (stepPlus_to_stepStar hS1) hS2⟩ + +-- ============================================================================ +-- Section 8: HalfTen & TenClosure +-- ============================================================================ + +theorem two_zeros_comm_rd0_pow (t : Nat) (s : ListBlank (Fin 2)) : + ([0, 0] : List (Fin 2)) +> (rd0 ^ t +> s) = rd0 ^ t +> ([0, 0] +> s) := by + induction t with + | zero => rfl + | succ t ih => + rw [right_pow_succ rd0 t s, right_pow_succ rd0 t ([0, 0] +> s), ← ih] + rfl + +theorem ten_prefix (t : Nat) (r : ListBlank (Fin 2)) : + ([1, 0] : List (Fin 2)) +> (rd0 ^ (1 + t) +> (rd1 +> r)) = + rd1 +> (rd0 ^ t +> ([0, 0, 1, 0, 0] +> r)) := by + rw [Nat.add_comm 1 t, right_pow_succ rd0 t (rd1 +> r)] + change rd1 +> (([0, 0] : List (Fin 2)) +> (rd0 ^ t +> (rd1 +> r))) = + rd1 +> (rd0 ^ t +> (([0, 0] : List (Fin 2)) +> (rd1 +> r))) + rw [two_zeros_comm_rd0_pow t (rd1 +> r)] + +theorem A_head {k : Nat} (w : List Bool) (hk : 0 < k) : + ∃ v, List.replicate k true ++ w = true :: v := by + cases k with + | zero => omega + | succ k => exact ⟨List.replicate k true ++ w, rfl⟩ + +theorem flip_A {n e o : Nat} {w : List Bool} (h : Num n e o (true :: w)) : + Num n (e - 1) o (false :: w) ∧ 1 ≤ e := by + rcases Num_inv_true h with ⟨n0, o0, rfl, rfl, h0⟩ + exact ⟨Num_eq (Num.B _ _ _ _ h0) rfl (by omega) rfl rfl, by omega⟩ + +theorem Ten_pre {n e o : Nat} {w : List Bool} (t : Nat) (l r : ListBlank (Fin 2)) + (hn : Num n e (2 ^ (1 + t) - 1 + o) (true :: w)) : + ∃ e' w', Num n e' o (true :: w') ∧ e ≤ e' ∧ + ((l <+ l_tape (true :: w)) <{{C}} ([1, 0] +> (rd0 ^ t +> (rd1 +> r)))) [target_tm]⊢⁺ + ((l <+ l_tape (true :: w')) {{B}}> (rd1 ^ t +> ([1, 0, 1, 0, 0] +> r))) := by + cases t with + | zero => + have hn' : Num n e (1 + o) (true :: w) := Num_eq hn rfl rfl (by simp) rfl + rcases LInc_num hn' with ⟨e', w', h', hle, hS⟩ + exact ⟨e', w', h', hle, hS l ([1, 0, 1, 0, 0] +> r)⟩ + | succ t => + have hp := pow2_pos t + have hp1 : 2 ≤ 2 ^ (1 + t) := by rw [Nat.add_comm 1 t, Nat.pow_succ]; omega + have hn' : Num n e ((2 ^ (1 + t) - 2) + (2 ^ (1 + t) + o + 1)) (true :: w) := + Num_eq hn rfl rfl (by rw [show 1 + (t + 1) = (1 + t) + 1 by omega, Nat.pow_succ]; omega) rfl + have hr : FC ([0, 0, 1, 0, 0] +> r) (1 + t) 1 (rd1 +> (rd0 ^ t +> ([0, 0, 1, 0, 0] +> r))) := + FC_eq (FC.d1 t 0 (rd0 ^ t +> ([0, 0, 1, 0, 0] +> r)) (FC_zero ([0, 0, 1, 0, 0] +> r) t)) + (by omega) (by omega) rfl + rcases FC_pairs ([0, 0, 1, 0, 0] +> r) (1 + t) (2 ^ (1 + t) - 2) hn' hr (by omega) + with ⟨e1, w1, r1, h1, hle1, hr1, hS1⟩ + have h1' : Num n e1 (1 + (2 ^ (1 + t) + o)) (true :: w1) := + Num_eq h1 rfl rfl (by omega) rfl + rcases LInc_num h1' with ⟨e2, w2, h2, hle2, hL2⟩ + have hr1_eq : r1 = rd1 ^ (1 + t) +> ([0, 0, 1, 0, 0] +> r) := + FC_full_unique (FC_eq hr1 rfl (by omega) rfl) + subst hr1_eq + have h2' : Num n e2 ((2 ^ (1 + t) - 1) + (1 + o)) (true :: w2) := + Num_eq h2 rfl rfl (by omega) rfl + rcases FC_pairs ([1, 0, 1, 0, 0] +> r) (1 + t) (2 ^ (1 + t) - 1) h2' + (FC_zero ([1, 0, 1, 0, 0] +> r) (1 + t)) (by omega) + with ⟨e3, w3, r3, h3, hle3, hr3, hS3⟩ + rcases LInc_num h3 with ⟨e4, w4, h4, hle4, hL4⟩ + have hr3_eq : r3 = rd1 ^ (1 + t) +> ([1, 0, 1, 0, 0] +> r) := + FC_full_unique (FC_eq hr3 rfl (by omega) rfl) + subst hr3_eq + refine ⟨e4, w4, h4, by omega, ?_⟩ + rw [show t + 1 = 1 + t by omega, ten_prefix t r] + have s1 := hS1 l + have s2 := hL2 l (rd1 ^ (1 + t) +> ([0, 0, 1, 0, 0] +> r)) + have s3 := RInc_rule (l <+ l_tape (true :: w2)) ([0, 1, 0, 0] +> r) (1 + t) + have heq3 : ([0] : List (Fin 2)) +> ([0, 1, 0, 0] +> r) = [0, 0, 1, 0, 0] +> r := rfl + have heq3' : ([1] : List (Fin 2)) +> ([0, 1, 0, 0] +> r) = [1, 0, 1, 0, 0] +> r := rfl + rw [heq3, heq3'] at s3 + have s4 := hS3 l + have s5 := hL4 l (rd1 ^ (1 + t) +> ([1, 0, 1, 0, 0] +> r)) + exact stepStar_stepPlus_trans s1 + (stepPlus_trans s2 + (stepPlus_trans s3 + (stepStar_stepPlus_trans s4 s5))) + +theorem Ten_even_exit {n e o : Nat} {w : List Bool} (m : Nat) (l r : ListBlank (Fin 2)) + (h : Num n e (1 + o) (true :: w)) : + ∃ n' e' o' v, Num n' e' o' (true :: v) ∧ n ≤ n' ∧ + 2 * o + 1 ≤ e' ∧ e ≤ o' ∧ + ((l <+ l_tape (true :: w)) {{B}}> (rd1 ^ (m * 2) +> ([1, 0, 1, 0, 0] +> r))) [target_tm]⊢⁺ + ((l <+ l_tape (true :: v)) <{{C}} ([1, 0] +> r)) := by + rcases LInc_num h with ⟨e1, w1, h1, hle, hL⟩ + have hN := Num_Aodd m h1 + rcases A_head (true :: w1) (show 0 < 2 * m + 1 by omega) with ⟨v, hv⟩ + have ht := l_tape_replicate_true (2 * m + 1) (true :: w1) + rw [hv] at hN ht + have hp := pow2_pos m + have hp2 : 2 ≤ 2 ^ (m + 1) := by rw [Nat.pow_succ]; omega + refine ⟨n + 2 * m + 1, (o + 1) * 2 ^ (m + 1) - 1, (e1 + 1) * 2 ^ m - 1, v, + hN, by omega, ?_, ?_, ?_⟩ + · have : 2 * o + 2 ≤ (o + 1) * 2 ^ (m + 1) := by + have : (o + 1) * 2 ≤ (o + 1) * 2 ^ (m + 1) := Nat.mul_le_mul_left _ hp2 + omega + omega + · have : e + 1 ≤ (e1 + 1) * 2 ^ m := by + have : (e1 + 1) * 1 ≤ (e1 + 1) * 2 ^ m := Nat.mul_le_mul_left _ hp + omega + omega + · have ht0 : l <+ l_tape (true :: w) = l <+ l_tape w <+ [1, 1] <+ [0] := by + simp [l_tape, digit, Half] + have s1 := R101EvenEntry (l <+ l_tape w <+ [1, 1]) r m + rw [← ht0] at s1 + have s2 := hL l (ones ^ (m * 6 + 3) +> ([0, 0] +> r)) + have hmul : m * 6 + 3 = (2 * m + 1) * 3 := by omega + rw [hmul] at s1 s2 + have s3 := R111Scan (l <+ l_tape (true :: w1)) ([0, 0] +> r) (2 * m + 1) + have ht_v : l <+ l_tape (true :: v) = l <+ l_tape (true :: w1) <+ (Half 0) ^ (2 * m + 1) := by + rw [ht, listblank_append_assoc] + rw [← ht_v] at s3 + have s4 := RInc_rule (l <+ l_tape (true :: v)) ([0] +> r) 0 + have heq4 : rd1 ^ 0 +> ([0] +> ([0] +> r)) = [0, 0] +> r := rfl + have heq4' : rd0 ^ 0 +> ([1] +> ([0] +> r)) = [1, 0] +> r := rfl + rw [heq4, heq4'] at s4 + exact stepPlus_trans s1 + (stepPlus_trans s2 + (stepStar_stepPlus_trans s3 s4)) + +theorem Ten_odd_exit {n e o : Nat} {w : List Bool} (m : Nat) (l r : ListBlank (Fin 2)) + (h : Num n e o (true :: w)) : + ∃ n' e' o' v, Num n' e' o' (true :: v) ∧ n ≤ n' ∧ + 2 * e - 1 ≤ e' ∧ 2 * o + 1 ≤ o' ∧ + ((l <+ l_tape (true :: w)) {{B}}> (rd1 ^ (m * 2 + 1) +> ([1, 0, 1, 0, 0] +> r))) [target_tm]⊢⁺ + ((l <+ l_tape (true :: v)) <{{C}} ([1, 0] +> r)) := by + rcases flip_A h with ⟨hF, he⟩ + have hN := Num_AA (m + 1) hF + rcases A_head (false :: w) (show 0 < 2 * (m + 1) by omega) with ⟨v, hv⟩ + have ht := l_tape_replicate_true (2 * (m + 1)) (false :: w) + rw [hv, half0_pairs_two_mul (m + 1)] at ht + rw [hv] at hN + have hp := pow2_pos m + have hp2 : 2 ≤ 2 ^ (m + 1) := by rw [Nat.pow_succ]; omega + refine ⟨n + 2 * (m + 1), (e - 1 + 1) * 2 ^ (m + 1) - 1, (o + 1) * 2 ^ (m + 1) - 1, v, + hN, by omega, ?_, ?_, ?_⟩ + · have : e * 2 ≤ (e - 1 + 1) * 2 ^ (m + 1) := by + rw [show e - 1 + 1 = e by omega] + exact Nat.mul_le_mul_left e hp2 + omega + · have : 2 * o + 2 ≤ (o + 1) * 2 ^ (m + 1) := by + have : (o + 1) * 2 ≤ (o + 1) * 2 ^ (m + 1) := Nat.mul_le_mul_left _ hp2 + omega + omega + · have ht0 : l <+ l_tape (true :: w) = l <+ l_tape w <+ [1, 1] <+ [0] := by + simp [l_tape, digit, Half] + have s1 := ROv101Odd (l <+ l_tape w <+ [1, 1]) ([0, 0] +> r) m + have heq1 : ([1, 0, 1] : List (Fin 2)) +> ([0, 0] +> r) = [1, 0, 1, 0, 0] +> r := rfl + rw [← ht0, heq1] at s1 + have ht_v : l <+ l_tape (true :: v) = l <+ l_tape w <+ [1, 1] <+ [1] <+ ld0 ^ (m + 1) := by + rw [ht]; simp [l_tape, digit, Half, listblank_append_assoc] + rw [← ht_v] at s1 + have s2 := RInc_rule (l <+ l_tape (true :: v)) ([0] +> r) 0 + have heq2 : rd1 ^ 0 +> ([0] +> ([0] +> r)) = [0, 0] +> r := rfl + have heq2' : rd0 ^ 0 +> ([1] +> ([0] +> r)) = [1, 0] +> r := rfl + rw [heq2, heq2'] at s2 + exact stepPlus_trans s1 s2 + +def JC (w : List Bool) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ((ldh <+ l_tape (true :: w)) <{{C}} ([1, 0] +> r)) + +inductive TenAllowed : Nat → Cfg (Fin 2) (Fin 6) → Prop + | J (n e o : Nat) (w : List Bool) (z : Nat) (r : ListBlank (Fin 2)) : + Num n e o (true :: w) → 4 ≤ n → RC z r → + (z = 0 ∨ (2 * z + 1 ≤ e ∧ 2 * z + 1 ≤ o)) → + TenAllowed z (JC w r) + +theorem Ten_zero_shape {c : Cfg (Fin 2) (Fin 6)} (h : TenAllowed 0 c) : + ∃ n e o w, Num n e o (true :: w) ∧ 4 ≤ n ∧ c = JC w default := by + cases h with + | J n e o w _ r hn hl hr _ => + rw [RC_zero_unique hr] + exact ⟨n, e, o, w, hn, hl, rfl⟩ + +theorem Ten_reserve (t q e o : Nat) + (he : 2 * (2 ^ t * (1 + q * 2)) + 1 ≤ e) + (ho : 2 * (2 ^ t * (1 + q * 2)) + 1 ≤ o) : + 2 ^ (1 + t) - 1 ≤ o ∧ 2 * q + 2 ≤ o - (2 ^ (1 + t) - 1) ∧ 2 * q + 1 ≤ e := by + have hp := pow2_pos t + have hp1 : 2 ^ (1 + t) = 2 * 2 ^ t := by rw [Nat.add_comm 1 t, Nat.pow_succ]; ring + have h1 : 2 * (2 ^ t * (1 + q * 2)) = 2 ^ (1 + t) + 2 ^ (1 + t) * q * 2 := by + rw [hp1]; ring + have h2 : 1 * q * 2 ≤ 2 ^ (1 + t) * q * 2 := by + have : 1 ≤ 2 ^ (1 + t) := pow2_pos (1 + t) + exact Nat.mul_le_mul_right 2 (Nat.mul_le_mul_right q this) + omega + +theorem Ten_positive_step {z : Nat} {c : Cfg (Fin 2) (Fin 6)} (hA : TenAllowed z c) (hz : 0 < z) : + ∃ q c', q < z ∧ TenAllowed q c' ∧ c [target_tm]⊢⁺ c' := by + cases hA with + | J n e o w z r hn hl hr hg => + rcases hg with rfl | ⟨he, ho⟩ + · omega + · rcases RC_positive_split hr hz with ⟨t, q, s, rfl, hs, hez, hqz⟩ + have he' : 2 * (2 ^ t * (1 + q * 2)) + 1 ≤ e := by rw [← hez]; exact he + have ho' : 2 * (2 ^ t * (1 + q * 2)) + 1 ≤ o := by rw [← hez]; exact ho + rcases Ten_reserve t q e o he' ho' with ⟨hb, hbq, heq⟩ + set b := o - (2 ^ (1 + t) - 1) + have hn' : Num n e (2 ^ (1 + t) - 1 + b) (true :: w) := + Num_eq hn rfl rfl (by omega) rfl + rcases Ten_pre t ldh s hn' with ⟨e1, w1, h1, hle1, hS1⟩ + rcases nat_even_or_odd t with ⟨m, rfl⟩ | ⟨m, rfl⟩ + · have h1' : Num n e1 (1 + (b - 1)) (true :: w1) := + Num_eq h1 rfl rfl (by omega) rfl + rcases Ten_even_exit m ldh s h1' with ⟨n2, e2, o2, w2, h2, hlen, hE, hO, hS2⟩ + refine ⟨q, JC w2 s, hqz, ?_, ?_⟩ + · exact TenAllowed.J n2 e2 o2 w2 q s h2 (by omega) hs (Or.inr ⟨by omega, by omega⟩) + · rw [Nat.mul_comm 2 m] at hS1 ⊢ + exact stepPlus_trans hS1 hS2 + · rcases Ten_odd_exit m ldh s h1 with ⟨n2, e2, o2, w2, h2, hlen, hE, hO, hS2⟩ + refine ⟨q, JC w2 s, hqz, ?_, ?_⟩ + · exact TenAllowed.J n2 e2 o2 w2 q s h2 (by omega) hs (Or.inr ⟨by omega, by omega⟩) + · rw [show 2 * m + 1 = m * 2 + 1 by omega] at hS1 ⊢ + exact stepPlus_trans hS1 hS2 + +theorem Ten_to_zero : ∀ (z : Nat) {c : Cfg (Fin 2) (Fin 6)}, + TenAllowed z c → ∃ c', TenAllowed 0 c' ∧ c [target_tm]⊢* c' := by + intro z + induction z using Nat.strong_induction_on with + | h z ih => + intro c hA + rcases Nat.eq_zero_or_pos z with rfl | hz + · exact ⟨c, hA, stepStar_refl _⟩ + · rcases Ten_positive_step hA hz with ⟨q, c1, hq, hA1, hS1⟩ + rcases ih q hq hA1 with ⟨c2, hA2, hS2⟩ + exact ⟨c2, hA2, stepStar_trans (stepPlus_to_stepStar hS1) hS2⟩ + +-- ============================================================================ +-- Section 9: HalfI, HalfTBoundary, PairUnion, NormalReturn, IClosure, +-- PairSpecial, Saturated, PairClosure +-- ============================================================================ + +theorem one_zero_comm_rd0_pow (t : Nat) (s : ListBlank (Fin 2)) : + ([0] : List (Fin 2)) +> (rd0 ^ t +> s) = rd0 ^ t +> ([0] +> s) := by + induction t with + | zero => rfl + | succ t ih => + rw [right_pow_succ rd0 t s, right_pow_succ rd0 t ([0] +> s), ← ih] + rfl + +theorem FC_insert_one (r : ListBlank (Fin 2)) (t : Nat) : + FC ([0, 1, 0, 0] +> r) (t + 1) 1 ([1] +> (rd0 ^ (t + 1) +> (rd1 +> r))) := by + have h0 := FC.d1 t 0 (rd0 ^ t +> ([0, 1, 0, 0] +> r)) (FC_zero ([0, 1, 0, 0] +> r) t) + have heq : rd1 +> (rd0 ^ t +> ([0, 1, 0, 0] +> r)) = + [1] +> (rd0 ^ (t + 1) +> (rd1 +> r)) := by + rw [right_pow_succ rd0 t (rd1 +> r)] + change rd1 +> (rd0 ^ t +> (([0] : List (Fin 2)) +> (rd1 +> r))) = + rd1 +> (([0] : List (Fin 2)) +> (rd0 ^ t +> (rd1 +> r))) + rw [one_zero_comm_rd0_pow t (rd1 +> r)] + exact FC_eq h0 rfl (by omega) heq + +theorem normal_split {n k : Nat} {w : List Bool} (h : Normal n k w) (hk : 0 < k) : + ∃ (v : List Bool) (a : Nat) (u : List Bool), Normal n (k - 1) v ∧ + l_tape w = ld1 ^ a ++ ld0 ++ l_tape u ∧ + l_tape v = ld0 ^ a ++ ld1 ++ l_tape u := by + induction h with + | nil => omega + | one n k w h ih => + refine ⟨true :: false :: w, (0 : Nat), w, ?_, ?_, ?_⟩ + · exact Normal_eq (Normal.zero n k w h) rfl (by omega) rfl + · simp [l_tape, digit, ld0, Half] + · simp [l_tape, digit, ld1, Half] + | zero n k w h ih => + rcases ih (by omega) with ⟨v, a, u, hv, hw_eq, hv_eq⟩ + refine ⟨true :: true :: v, a + 1, u, ?_, ?_, ?_⟩ + · exact Normal_eq (Normal.one n (k - 1) v hv) rfl (by omega) rfl + · simp [l_tape, digit, ld1, Half, pow_succ_list, hw_eq, List.append_assoc] + · simp [l_tape, digit, ld0, Half, pow_succ_list, hv_eq, List.append_assoc] + +theorem normal_AA {n k : Nat} {w : List Bool} (m : Nat) (h : Normal n k w) : + Normal (n + m) ((k + 1) * 2 ^ m - 1) (List.replicate (2 * m) true ++ w) := by + have hp := pow2_pos n + have hpm := pow2_pos m + have hN := Num_AA m (normal_num h) + have h1 : (2 ^ n - 1 + 1) * 2 ^ m - 1 = 2 ^ (n + m) - 1 := by + rw [Nat.sub_add_cancel hp, Nat.pow_add] + exact num_normal (n + m) (Num_eq hN (by omega) h1 rfl rfl) + +theorem Num_flip {n e o : Nat} {w : List Bool} (h : Num n e o (true :: w)) : + Num n (e - 1) o (false :: w) := + (flip_A h).1 + +theorem normal_FC_Rpairs (tail : ListBlank (Fin 2)) (h q : Nat) {n b : Nat} {w : List Bool} + {z : Nat} {r : ListBlank (Fin 2)} + (hn : Normal n (q + b) w) (hr : FC tail h z r) (hb : z + q < 2 ^ h) : + ∃ w' r', Normal n b w' ∧ FC tail h (z + q) r' ∧ ∀ l, + ((l <+ l_tape w) {{B}}> r) [target_tm]⊢* + ((l <+ l_tape w') {{B}}> r') := by + induction q generalizing b w z r with + | zero => + exact ⟨w, r, Normal_eq hn rfl (by omega) rfl, FC_eq hr rfl (by omega) rfl, + fun l => stepStar_refl _⟩ + | succ q ih => + rcases FiniteRInc_ex hr (by omega) with ⟨r1, hr1, hR⟩ + have hn' : Normal n (1 + (q + b)) w := Normal_eq hn rfl (by omega) rfl + rcases normal_LInc hn' with ⟨w1, h1, hL⟩ + rcases ih h1 hr1 (by omega) with ⟨w2, r2, h2, hr2, hS⟩ + refine ⟨w2, r2, h2, FC_eq hr2 rfl (by omega) rfl, fun l => ?_⟩ + exact stepStar_trans (stepPlus_to_stepStar (hR (l <+ l_tape w))) + (stepStar_trans (stepPlus_to_stepStar (hL l r1)) (hS l)) + +theorem I_pre {n b : Nat} {w : List Bool} (t : Nat) (l r : ListBlank (Fin 2)) + (hn : Normal n (2 ^ (1 + t) - 2 + b) w) (_hb : 1 ≤ b) : + ∃ w', Normal n b w' ∧ + ((l <+ l_tape w) {{B}}> ([1] +> (rd0 ^ t +> (rd1 +> r)))) [target_tm]⊢* + ((l <+ l_tape w') {{B}}> (rd1 ^ t +> ([1, 1, 0, 0] +> r))) := by + cases t with + | zero => + refine ⟨w, Normal_eq hn rfl (by simp) rfl, ?_⟩ + try exact stepStar_refl _ + | succ t => + have hp := pow2_pos t + have hp1 : 2 ≤ 2 ^ (t + 1) := by rw [Nat.pow_succ]; omega + have hn' : Normal n ((2 ^ (t + 1) - 2) + (2 ^ (t + 1) + b)) w := + Normal_eq hn rfl (by rw [show 1 + (t + 1) = (t + 1) + 1 by omega, Nat.pow_succ]; omega) rfl + rcases normal_FC_Rpairs ([0, 1, 0, 0] +> r) (t + 1) (2 ^ (t + 1) - 2) hn' (FC_insert_one r t) (by omega) + with ⟨w1, r1, h1, hr1, hS1⟩ + have hr1_eq : r1 = rd1 ^ (t + 1) +> ([0, 1, 0, 0] +> r) := + FC_full_unique (FC_eq hr1 rfl (by omega) rfl) + subst hr1_eq + have h1' : Normal n (1 + ((2 ^ (t + 1) - 1) + b)) w1 := + Normal_eq h1 rfl (by omega) rfl + rcases normal_LInc h1' with ⟨w2, h2, hL⟩ + rcases normal_FC_Rpairs ([1, 1, 0, 0] +> r) (t + 1) (2 ^ (t + 1) - 1) h2 + (FC_zero ([1, 1, 0, 0] +> r) (t + 1)) (by omega) + with ⟨w3, r3, h3, hr3, hS3⟩ + have hr3_eq : r3 = rd1 ^ (t + 1) +> ([1, 1, 0, 0] +> r) := + FC_full_unique (FC_eq hr3 rfl (by omega) rfl) + subst hr3_eq + refine ⟨w3, h3, ?_⟩ + have s1 := hS1 l + have s2 := RInc_rule (l <+ l_tape w1) ([1, 0, 0] +> r) (t + 1) + have heq2 : ([0] : List (Fin 2)) +> ([1, 0, 0] +> r) = [0, 1, 0, 0] +> r := rfl + have heq2' : ([1] : List (Fin 2)) +> ([1, 0, 0] +> r) = [1, 1, 0, 0] +> r := rfl + rw [heq2, heq2'] at s2 + have s3 := hL l (rd0 ^ (t + 1) +> ([1, 1, 0, 0] +> r)) + have s4 := hS3 l + exact stepStar_trans s1 + (stepStar_trans (stepPlus_to_stepStar s2) + (stepStar_trans (stepPlus_to_stepStar s3) s4)) + +theorem I_odd_exit {n b : Nat} {w : List Bool} (m : Nat) (l r : ListBlank (Fin 2)) + (hn : Normal n b w) (hb : 0 < b) : + ∃ w', Normal (n + m + 1) (b * 2 ^ (m + 1) - 1) w' ∧ + ((l <+ l_tape w) {{B}}> (rd1 ^ (m * 2 + 1) +> ([1, 1, 0, 0] +> r))) [target_tm]⊢⁺ + ((l <+ l_tape w') {{B}}> ([1] +> r)) := by + rcases normal_split hn hb with ⟨v, a, u, hv, hw_eq, hv_eq⟩ + refine ⟨List.replicate (2 * (m + 1)) true ++ v, ?_, ?_⟩ + · exact Normal_eq (normal_AA (m + 1) hv) (by omega) (by rw [Nat.sub_add_cancel hb]) rfl + · have ht1 : l <+ l_tape w = l <+ l_tape u <+ ld0 <+ ld1 ^ a := by + rw [hw_eq]; simp [listblank_append_assoc] + have ht2 : l <+ l_tape (List.replicate (2 * (m + 1)) true ++ v) = + l <+ l_tape u <+ ld1 <+ ld0 ^ (m + a + 1) := by + rw [l_tape_append, normal_full_tape (normal_full (m + 1)) rfl, hv_eq, + show m + a + 1 = (m + 1) + a by omega, list_pow_add] + simp [listblank_append_assoc] + rw [ht1, ht2] + exact ROvOddRecover (l <+ l_tape u) r a m + +theorem I_odd {n b : Nat} {w : List Bool} (m : Nat) (l r : ListBlank (Fin 2)) + (hn : Normal n (2 ^ (1 + (m * 2 + 1)) - 2 + b) w) (hb : 1 ≤ b) : + ∃ w', Normal (n + m + 1) (b * 2 ^ (m + 1) - 1) w' ∧ + ((l <+ l_tape w) {{B}}> ([1] +> (rd0 ^ (m * 2 + 1) +> (rd1 +> r)))) [target_tm]⊢⁺ + ((l <+ l_tape w') {{B}}> ([1] +> r)) := by + rcases I_pre (m * 2 + 1) l r hn hb with ⟨v, hv, hP⟩ + rcases I_odd_exit m l r hv (by omega) with ⟨u, hu, hU⟩ + exact ⟨u, hu, stepStar_stepPlus_trans hP hU⟩ + +theorem I_even_exit {n b : Nat} {w : List Bool} (m : Nat) (l r : ListBlank (Fin 2)) + (hn : Normal n b w) (hb : 0 < b) : + ∃ w', Num (2 * (n + m)) ((2 ^ n - 1) * 2 ^ m - 1) ((b + 1) * 2 ^ m - 1) w' ∧ + ((l <+ l_tape w) {{B}}> (rd1 ^ (m * 2) +> ([1, 1, 0, 0] +> r))) [target_tm]⊢⁺ + ((l <+ l_tape w' <+ s_tag) {{D}}> r) := by + have hbound := normal_bound hn + have hpos : 0 < n := by + cases n with + | zero => simp at hbound; omega + | succ n => omega + have hpow : 2 ≤ 2 ^ n := by + cases n with + | zero => omega + | succ n => + have := pow2_pos n + rw [Nat.pow_succ]; omega + rcases normal_head hn hpos with ⟨v, rfl⟩ + refine ⟨List.replicate (2 * m) true ++ false :: v, ?_, ?_⟩ + · have hAA := Num_AA m (Num_flip (normal_num hn)) + have h1 : (2 ^ n - 1 - 1 + 1) * 2 ^ m - 1 = (2 ^ n - 1) * 2 ^ m - 1 := by + rw [show 2 ^ n - 1 - 1 + 1 = 2 ^ n - 1 by omega] + exact Num_eq hAA (by omega) h1 rfl rfl + · have ht1 : l <+ l_tape (true :: v) = l <+ l_tape v <+ [1, 1] <+ [0] := by + simp [l_tape, digit, Half] + have ht2 : l <+ l_tape (List.replicate (2 * m) true ++ false :: v) = + l <+ l_tape v <+ [1, 1] <+ [1] <+ ld0 ^ m := by + rw [l_tape_append, normal_full_tape (normal_full m) rfl] + simp [l_tape, digit, Half, listblank_append_assoc] + rw [ht1, ht2] + exact ROvEvenAux (l <+ l_tape v <+ [1, 1]) r m + +theorem I_even {n b : Nat} {w : List Bool} (m : Nat) (l r : ListBlank (Fin 2)) + (hn : Normal n (2 ^ (1 + m * 2) - 2 + b) w) (hb : 1 ≤ b) : + ∃ w', Num (2 * (n + m)) ((2 ^ n - 1) * 2 ^ m - 1) ((b + 1) * 2 ^ m - 1) w' ∧ + ((l <+ l_tape w) {{B}}> ([1] +> (rd0 ^ (m * 2) +> (rd1 +> r)))) [target_tm]⊢⁺ + ((l <+ l_tape w' <+ s_tag) {{D}}> r) := by + rcases I_pre (m * 2) l r hn hb with ⟨v, hv, hP⟩ + rcases I_even_exit m l r hv (by omega) with ⟨u, hu, hU⟩ + exact ⟨u, hu, stepStar_stepPlus_trans hP hU⟩ + +theorem geometric_step (h k o : Nat) : + 2 ^ (h + 2) * (2 ^ (k + 1) - 1) + o = + 2 ^ (h + 2) + (2 ^ (h + 1 + 2) * (2 ^ k - 1) + o) := by + have hp := pow2_pos k + have h1 : 2 ^ (h + 1 + 2) = 2 ^ (h + 2) * 2 := by + rw [show h + 1 + 2 = (h + 2) + 1 by omega, Nat.pow_succ] + have h2 : 2 ^ (k + 1) - 1 = 1 + 2 * (2 ^ k - 1) := by + rw [Nat.pow_succ]; omega + rw [h1, h2] + ring + +theorem TZeros (k : Nat) {n e o : Nat} {w : List Bool} (h : Nat) (l r : ListBlank (Fin 2)) + (hn : Num n e (2 ^ (h + 2) * (2 ^ k - 1) + o) (true :: w)) : + ∃ e' w', Num n e' o (true :: w') ∧ e ≤ e' ∧ + ((l <+ l_tape (true :: w) <+ (Half 1) ^ h <+ t_tag) {{D}}> (rd0 ^ k +> r)) [target_tm]⊢* + ((l <+ l_tape (true :: w') <+ (Half 1) ^ (h + k) <+ t_tag) {{D}}> r) := by + induction k generalizing e w h r with + | zero => + have hn' : Num n e o (true :: w) := Num_eq hn rfl rfl (by simp) rfl + exact ⟨e, w, hn', Nat.le_refl e, stepStar_refl _⟩ + | succ k ih => + rw [geometric_step h k o] at hn + rcases TZero h l (rd0 ^ k +> r) hn with ⟨e1, w1, h1, hle1, hS1⟩ + rcases ih (h + 1) r h1 with ⟨e2, w2, h2, hle2, hS2⟩ + refine ⟨e2, w2, h2, by omega, ?_⟩ + rw [right_pow_succ rd0 k r, show h + (k + 1) = h + 1 + k by omega] + exact stepStar_trans (stepPlus_to_stepStar hS1) hS2 + +theorem RPairs (l r : ListBlank (Fin 2)) (k : Nat) : + (l {{B}}> (ones ^ (k * 6) +> r)) [target_tm]⊢* + ((l <+ ld0 ^ k) {{B}}> r) := by + rw [show k * 6 = (k * 2) * 3 by omega, ← half0_pairs k] + exact R111Scan l r (k * 2) + +theorem T100_zero_odd {m e : Nat} {w : List Bool} (r : ListBlank (Fin 2)) + (hn : Num (2 * m + 1) e 0 w) : + ((ldh <+ l_tape w <+ t_tag) {{D}}> (rd1 +> r)) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (m + 2)) {{B}}> r) := by + rcases zero_odd m hn with ⟨bs, b, rfl, ht⟩ + have heq : ldh <+ l_tape w = ldh <+ Half b <+ Marked bs := by + rw [ht, listblank_append_assoc] + rw [heq] + have s1 := T100 (ldh <+ Half b <+ Marked bs) r + have s2 := MarkedCarry (ldh <+ Half b) (ones ^ 6 +> r) bs + have s3 := EHalfBoundary (ones ^ (bs.length * 6) +> (ones ^ 6 +> r)) b + have h_ones : ones ^ 6 +> (ones ^ (bs.length * 6) +> (ones ^ 6 +> r)) = + ones ^ ((bs.length + 2) * 6) +> r := by + rw [← right_pow_add, ← right_pow_add, show 6 + bs.length * 6 + 6 = (bs.length + 2) * 6 by omega] + rw [h_ones] at s3 + have s4 := RPairs ldh r (bs.length + 2) + exact stepPlus_trans s1 + (stepStar_stepPlus_trans s2 + (stepPlus_stepStar_trans s3 s4)) + +def IC (w : List Bool) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ((ldh <+ l_tape w) {{B}}> ([1] +> r)) + +def IGuard (n k z : Nat) : Prop := + z = 0 ∨ (∃ d, z < 2 ^ d ∧ d ≤ n ∧ 2 ^ d - 1 ≤ k) ∨ (k = 2 ^ n - 1 ∧ z ≤ 2 ^ n + 1) + +inductive IAllowed : Cfg (Fin 2) (Fin 6) → Prop + | intro (n k : Nat) (w : List Bool) (z : Nat) (r : ListBlank (Fin 2)) : + Normal n k w → 1 ≤ n → RC z r → IGuard n k z → + IAllowed (IC w r) + +inductive Allowed : Cfg (Fin 2) (Fin 6) → Prop + | Ordinary (c : Cfg (Fin 2) (Fin 6)) : IAllowed c → Allowed c + | Ten (z : Nat) (c : Cfg (Fin 2) (Fin 6)) : TenAllowed z c → Allowed c + | Signal (z : Nat) (c : Cfg (Fin 2) (Fin 6)) : STAllowed z c → Allowed c + +theorem I_full (n z : Nat) (r : ListBlank (Fin 2)) + (hn : 1 ≤ n) (hz : z ≤ 2 ^ n + 1) (hr : RC z r) : + IAllowed ((ldh <+ ld0 ^ n) {{B}}> ([1] +> r)) := by + rw [← normal_full_tape (normal_full n) rfl] + exact IAllowed.intro n (2 ^ n - 1) (List.replicate (2 * n) true) z r + (normal_full n) hn hr (Or.inr (Or.inr ⟨rfl, hz⟩)) + +theorem J_full (n z : Nat) (r : ListBlank (Fin 2)) + (hn : 2 ≤ n) (hr : RC z r) (hg : z = 0 ∨ 2 * z + 1 ≤ 2 ^ n - 1) : + TenAllowed z ((ldh <+ ld0 ^ n) <{{C}} ([1, 0] +> r)) := by + rcases normal_head (normal_full n) (by omega) with ⟨w, hw⟩ + have hN := normal_num (normal_full n) + have ht := normal_full_tape (normal_full n) rfl + rw [hw] at hN ht + rw [← ht] + exact TenAllowed.J (2 * n) (2 ^ n - 1) (2 ^ n - 1) w z r hN (by omega) hr + (hg.elim Or.inl (fun h => Or.inr ⟨h, h⟩)) + +theorem J_odd_bound (m e o : Nat) (w : List Bool) (h : Num (2 * (1 + m) + 1) e o w) : + 2 * ((1 + o) / 2) + 1 ≤ 2 ^ (2 + m) - 1 := by + rcases Num_bounds h with ⟨_, ho⟩ + have hdiv : (2 * (1 + m) + 1) / 2 = 1 + m := by omega + rw [hdiv] at ho + have hp : 2 ^ (2 + m) = 2 * 2 ^ (1 + m) := by + rw [show 2 + m = (1 + m) + 1 by omega, Nat.pow_succ] + omega + rw [hp] + omega + +theorem S_zero {c : Cfg (Fin 2) (Fin 6)} (h : STAllowed 0 c) : + ∃ c', Allowed c' ∧ c [target_tm]⊢⁺ c' := by + rcases ST_zero_shape h with ⟨n, e, o, w, hN, hl, rfl⟩ + rcases nat_even_or_odd n with ⟨m, rfl⟩ | ⟨m, rfl⟩ + · rcases Drain_S_even hN with ⟨r', hr', hS⟩ + refine ⟨((ldh <+ ld0 ^ (1 + m)) <{{C}} ([1, 0] +> r')), ?_, hS⟩ + refine Allowed.Ten ((2 + e) / 2) _ (J_full (1 + m) ((2 + e) / 2) r' (by omega) hr' (Or.inr ?_)) + have hN' : Num (2 * (1 + (m - 1))) e o w := Num_eq hN (by omega) rfl rfl rfl + have hb := S_even_bound (m - 1) e o w hN' + rw [show 2 + (m - 1) = 1 + m by omega] at hb + exact hb + · rcases Drain_S_odd hN with ⟨r', hr', hS⟩ + refine ⟨((ldh <+ ld0 ^ (1 + m)) {{B}}> ([1] +> r')), ?_, hS⟩ + exact Allowed.Ordinary _ (I_full (1 + m) (2 + e) r' (by omega) (S_odd_bound m e o w hN) hr') + +theorem J_zero {c : Cfg (Fin 2) (Fin 6)} (h : TenAllowed 0 c) : + ∃ c', Allowed c' ∧ c [target_tm]⊢⁺ c' := by + rcases Ten_zero_shape h with ⟨n, e, o, w, hN, hl, rfl⟩ + have hr1 : RC 1 ([1, 0] +> default) := by + have h0 : RC 1 (rd1 +> default) := RC_eq (RC.d1 0 default RC.zero) (by omega) rfl + have heq : rd1 +> (default : ListBlank (Fin 2)) = [1, 0] +> default := by simp [rd1] + rwa [heq] at h0 + rcases nat_even_or_odd n with ⟨m, rfl⟩ | ⟨m, rfl⟩ + · rcases Drain_even hN hr1 with ⟨r', hr', hS⟩ + refine ⟨((ldh <+ ld0 ^ m) {{B}}> ([1] +> r')), ?_, hS⟩ + rcases Num_bounds hN with ⟨_, ho⟩ + have hdiv : 2 * m / 2 = m := by omega + rw [hdiv] at ho + exact Allowed.Ordinary _ (I_full m (1 + o) r' (by omega) (by omega) hr') + · rcases Drain_odd hN hr1 with ⟨r', hr', hS⟩ + refine ⟨((ldh <+ ld0 ^ (1 + m)) <{{C}} ([1, 0] +> r')), ?_, hS⟩ + refine Allowed.Ten ((1 + o) / 2) _ (J_full (1 + m) ((1 + o) / 2) r' (by omega) hr' (Or.inr ?_)) + have hN' : Num (2 * (1 + (m - 1)) + 1) e o (true :: w) := Num_eq hN (by omega) rfl rfl rfl + have hb := J_odd_bound (m - 1) e o (true :: w) hN' + rw [show 2 + (m - 1) = 1 + m by omega] at hb + exact hb + +theorem even_R_return {n e o : Nat} {w : List Bool} {z : Nat} {r : ListBlank (Fin 2)} + (hn : Num (2 * n) e o (true :: w)) (hlen : 1 ≤ n) (hr : RC z r) (hz : z ≤ 1) : + ∃ c', Allowed c' ∧ ((ldh <+ l_tape (true :: w)) {{B}}> r) [target_tm]⊢⁺ c' := by + rcases Num_bounds hn with ⟨_, hb⟩ + have hdiv : 2 * n / 2 = n := by omega + rw [hdiv] at hb + rcases RInc_ex hr with ⟨s, hs, hR⟩ + rcases Drain_even hn hs with ⟨s', hs', hL⟩ + refine ⟨((ldh <+ ld0 ^ n) {{B}}> ([1] +> s')), ?_, stepPlus_trans (hR (ldh <+ l_tape (true :: w))) hL⟩ + exact Allowed.Ordinary _ (I_full n (z + 1 + o) s' hlen (by omega) hs') + +theorem R_return {n k : Nat} {w : List Bool} {z : Nat} {r : ListBlank (Fin 2)} + (hn : Normal n k w) (hlen : 1 ≤ n) (hr : RC z r) (hz : z ≤ 1) : + ∃ c', Allowed c' ∧ ((ldh <+ l_tape w) {{B}}> r) [target_tm]⊢⁺ c' := by + rcases normal_head hn (by omega) with ⟨v, rfl⟩ + exact even_R_return (normal_num hn) hlen hr hz + +theorem R_zero_full (n : Nat) (hn : 1 ≤ n) : + ∃ c', Allowed c' ∧ ((ldh <+ ld0 ^ n) {{B}}> default) [target_tm]⊢⁺ c' := by + rcases R_return (normal_full n) hn RC.zero (by omega) with ⟨c', hA, hS⟩ + rw [normal_full_tape (normal_full n) rfl] at hS + exact ⟨c', hA, hS⟩ + +theorem I_zero {n k : Nat} {w : List Bool} {r : ListBlank (Fin 2)} + (hn : Normal n k w) (hl : 1 ≤ n) (hr : RC 0 r) : + ∃ c', Allowed c' ∧ (IC w r) [target_tm]⊢⁺ c' := by + rw [RC_zero_unique hr] + have hr1 : RC 1 ([1] +> default) := by + have h0 : RC 1 (rd1 +> default) := RC_eq (RC.d1 0 default RC.zero) (by omega) rfl + have heq : rd1 +> (default : ListBlank (Fin 2)) = [1] +> default := by simp [rd1] + rwa [heq] at h0 + exact R_return hn hl hr1 (by omega) + +theorem small_bounds (n k d t q : Nat) + (hz : 2 ^ t * (1 + q * 2) < 2 ^ d) (hd : d ≤ n) (hk : 2 ^ d - 1 ≤ k) : + ∃ b s, k = 2 ^ (1 + t) - 2 + b ∧ 1 ≤ b ∧ q < 2 ^ s ∧ s ≤ n ∧ 2 ^ s ≤ b ∧ 2 * q + 2 ≤ 2 ^ n := by + have hpt := pow2_pos t + have htd : t < d := by + rcases Nat.lt_or_ge t d with hlt | hge + · exact hlt + · have hle : 2 ^ d ≤ 2 ^ t := Nat.pow_le_pow_right (by omega) hge + have : 2 ^ t * 1 ≤ 2 ^ t * (1 + q * 2) := Nat.mul_le_mul_left _ (by omega) + omega + set s := d - (1 + t) + have hds : d = (1 + t) + s := by omega + have hP : 2 ^ d = 2 ^ (1 + t) * 2 ^ s := by rw [hds, Nat.pow_add] + have hP2 : 2 ^ (1 + t) = 2 ^ t * 2 := by rw [Nat.add_comm 1 t, Nat.pow_succ] + have hps := pow2_pos s + have hdn : 2 ^ d ≤ 2 ^ n := Nat.pow_le_pow_right (by omega) hd + have hqs : q < 2 ^ s := by + rcases Nat.lt_or_ge q (2 ^ s) with hlt | hge + · exact hlt + · have hmul : 2 ^ t * (2 * 2 ^ s) ≤ 2 ^ t * (1 + q * 2) := + Nat.mul_le_mul_left _ (by omega) + have : 2 ^ d = 2 ^ t * (2 * 2 ^ s) := by rw [hP, hP2]; ring + omega + have hcost : 2 ^ (1 + t) - 2 ≤ k := by + have : 2 ^ (1 + t) * 1 ≤ 2 ^ (1 + t) * 2 ^ s := Nat.mul_le_mul_left _ hps + omega + set b := k - (2 ^ (1 + t) - 2) + have hbnd : 2 ^ s ≤ b := by + have h3 : 2 ^ (1 + t) * (2 ^ s - 1) ≥ 2 * (2 ^ s - 1) := + Nat.mul_le_mul_right _ (by omega) + have h4 : 2 ^ (1 + t) * 2 ^ s = 2 ^ (1 + t) + 2 ^ (1 + t) * (2 ^ s - 1) := by + have hs1 : 2 ^ s = 1 + (2 ^ s - 1) := by omega + conv_lhs => rw [hs1] + ring + omega + have h2q : 2 * q + 2 ≤ 2 ^ n := by + have : 2 * q + 1 ≤ 2 ^ t * (1 + q * 2) := by + have : 1 * (1 + q * 2) ≤ 2 ^ t * (1 + q * 2) := Nat.mul_le_mul_right _ hpt + omega + omega + exact ⟨b, s, by omega, by omega, hqs, by omega, hbnd, h2q⟩ + +theorem IClosure_small {n k : Nat} {w : List Bool} {z : Nat} {r : ListBlank (Fin 2)} (d : Nat) + (hn : Normal n k w) (hlen : 1 ≤ n) (hr : RC z r) + (hz : 0 < z) (hcap : z < 2 ^ d) (hd : d ≤ n) (hbudget : 2 ^ d - 1 ≤ k) : + ∃ c', Allowed c' ∧ (IC w r) [target_tm]⊢⁺ c' := by + rcases RC_positive_split hr hz with ⟨t, q, s, rfl, hs, hez, hqz⟩ + have hcap' : 2 ^ t * (1 + q * 2) < 2 ^ d := by rw [← hez]; exact hcap + rcases small_bounds n k d t q hcap' hd hbudget with ⟨b, d', hk, hb, hq, hwidth, hbb, h2q⟩ + rcases nat_even_or_odd t with ⟨m, rfl⟩ | ⟨m, rfl⟩ + · rw [Nat.mul_comm 2 m] at hk ⊢ + have hn' : Normal n (2 ^ (1 + m * 2) - 2 + b) w := Normal_eq hn rfl hk rfl + rcases I_even m ldh s hn' hb with ⟨w', hN, hS⟩ + refine ⟨SC w' s, ?_, hS⟩ + have hpm := pow2_pos m + have he' : 2 * q ≤ (2 ^ n - 1) * 2 ^ m - 1 := by + have : (2 ^ n - 1) * 1 ≤ (2 ^ n - 1) * 2 ^ m := Nat.mul_le_mul_left _ hpm + omega + have ho' : q ≤ (b + 1) * 2 ^ m - 1 := by + have : (b + 1) * 1 ≤ (b + 1) * 2 ^ m := Nat.mul_le_mul_left _ hpm + omega + exact Allowed.Signal q _ (STAllowed.S (2 * (n + m)) _ _ w' q s hN (by omega) he' ho' hs) + · rw [show 2 * m + 1 = m * 2 + 1 by omega] at hk ⊢ + have hn' : Normal n (2 ^ (1 + (m * 2 + 1)) - 2 + b) w := Normal_eq hn rfl hk rfl + rcases I_odd m ldh s hn' hb with ⟨w', hN, hS⟩ + refine ⟨IC w' s, ?_, hS⟩ + have hpm1 := pow2_pos (m + 1) + have hbud' : 2 ^ d' - 1 ≤ b * 2 ^ (m + 1) - 1 := by + have : b * 1 ≤ b * 2 ^ (m + 1) := Nat.mul_le_mul_left _ hpm1 + omega + exact Allowed.Ordinary _ (IAllowed.intro (n + m + 1) _ w' q s hN (by omega) hs + (Or.inr (Or.inl ⟨d', hq, by omega, hbud'⟩))) + +theorem Num_BB {n e o : Nat} {w : List Bool} (m : Nat) (h : Num n e o w) : + Num (n + 2 * m) (e * 2 ^ m) (o * 2 ^ m) (List.replicate (2 * m) false ++ w) := by + induction m with + | zero => exact Num_eq h (by omega) (by omega) (by omega) rfl + | succ m ih => + have hrep : List.replicate (2 * (m + 1)) false ++ w = + false :: false :: (List.replicate (2 * m) false ++ w) := by + rw [show 2 * (m + 1) = 2 + 2 * m by omega, List.replicate_add] + rfl + rw [hrep] + exact Num_eq (Num.B _ _ _ _ (Num.B _ _ _ _ ih)) + (by omega) (by rw [Nat.pow_succ]; ring) (by rw [Nat.pow_succ]; ring) rfl + +theorem Num_Bodd {n e o : Nat} {w : List Bool} (m : Nat) (h : Num n e o w) : + Num (n + 2 * m + 1) (o * 2 ^ (m + 1)) (e * 2 ^ m) (List.replicate (2 * m + 1) false ++ w) := by + have hBB := Num_BB m h + have hrep : List.replicate (2 * m + 1) false ++ w = + false :: (List.replicate (2 * m) false ++ w) := by + rw [show 2 * m + 1 = 1 + 2 * m by omega, List.replicate_add] + rfl + rw [hrep] + exact Num_eq (Num.B _ _ _ _ hBB) (by omega) (by rw [Nat.pow_succ]; ring) rfl rfl + +theorem Num_A_positive {n e o : Nat} {w : List Bool} (h : Num n e o (true :: w)) : 0 < e := by + rcases Num_inv_true h with ⟨_, _, _, rfl, _⟩; omega + +theorem plus_one_tape (k : Nat) {r : ListBlank (Fin 2)} (h : RC (2 ^ (k + 1) + 1) r) : + r = rd1 +> (rd0 ^ k +> (rd1 +> default)) := by + have h0 : RC (2 ^ (k + 1) + 1) (rd1 +> (rd0 ^ k +> (rd1 +> default))) := by + have h1 := RC.d1 (2 ^ k * 1) (rd0 ^ k +> (rd1 +> default)) + (RC_zeros k (RC_eq (RC.d1 0 default RC.zero) (by omega) rfl)) + exact RC_eq h1 (by rw [Nat.pow_succ]; omega) rfl + exact RC_unique h h0 + +theorem Special_entry (n : Nat) (r : ListBlank (Fin 2)) (hn : 1 ≤ n) : + ∃ w, Num (2 * n) (2 ^ n - 2) (2 ^ n - 1) w ∧ + ((ldh <+ ld0 ^ n) {{B}}> ([1] +> (rd1 +> r))) [target_tm]⊢⁺ SC w r := by + have hpow : 2 ≤ 2 ^ n := by + cases n with + | zero => omega + | succ n => have := pow2_pos n; rw [Nat.pow_succ]; omega + rcases I_even_exit 0 ldh r (normal_full n) (by omega) with ⟨w, hN, hS⟩ + rw [normal_full_tape (normal_full n) rfl] at hS + have hN' : Num (2 * n) (2 ^ n - 2) (2 ^ n - 1) w := + Num_eq hN (by omega) (by simp; omega) (by simp) rfl + have heq : rd1 ^ (0 * 2) +> ([1, 1, 0, 0] +> r) = [1] +> (rd1 +> r) := rfl + rw [heq] at hS + exact ⟨w, hN', hS⟩ + +theorem Special_one {r : ListBlank (Fin 2)} (hr : RC (2 ^ 1 + 1) r) : + ∃ c', Allowed c' ∧ ((ldh <+ ld0 ^ 1) {{B}}> ([1] +> r)) [target_tm]⊢⁺ c' := by + rw [plus_one_tape 0 hr] + rcases Special_entry 1 (rd1 +> default) (by omega) with ⟨w, hN, hS⟩ + rcases ST_S100 hN with ⟨hN', hS'⟩ + refine ⟨SC (false :: w) default, ?_, stepPlus_trans hS (hS' ldh default)⟩ + exact Allowed.Signal 0 _ (STAllowed.S (2 * 1 + 1) _ _ (false :: w) 0 default + hN' (by omega) (by omega) (by omega) RC.zero) + +theorem Special_to_T_one (k : Nat) {r : ListBlank (Fin 2)} (hr : RC (2 ^ (k + 2) + 1) r) : + ∃ e w, Num (2 * (k + 2) + 1) e 0 (true :: w) ∧ + ((ldh <+ ld0 ^ (k + 2)) {{B}}> ([1] +> r)) [target_tm]⊢⁺ + TC w k (rd1 +> default) := by + have hr' : RC (2 ^ ((k + 1) + 1) + 1) r := hr + rw [plus_one_tape (k + 1) hr', right_pow_succ rd0 k (rd1 +> default)] + rcases Special_entry (k + 2) (rd0 +> (rd0 ^ k +> (rd1 +> default))) (by omega) with ⟨v, hN, hS⟩ + have hp := pow2_pos k + have hP : 2 ^ (k + 2) = 4 * 2 ^ k := by rw [Nat.pow_add]; ring + have hN' : Num (2 * (k + 2)) (2 + (2 ^ (k + 2) - 4)) (2 ^ (k + 2) - 1) v := + Num_eq hN rfl (by omega) rfl rfl + rcases ST_S000 hN' with ⟨e1, w1, h1, hle1, hS1⟩ + have h1' : Num (2 * (k + 2) + 1) e1 (2 ^ (0 + 2) * (2 ^ k - 1) + 0) (true :: w1) := + Num_eq h1 rfl rfl (by omega) rfl + rcases TZeros k 0 ldh (rd1 +> default) h1' with ⟨e2, w2, h2, hle2, hS2⟩ + refine ⟨e2, w2, h2, ?_⟩ + rw [Nat.zero_add k] at hS2 + exact stepPlus_trans hS (stepPlus_stepStar_trans (hS1 ldh (rd0 ^ k +> (rd1 +> default))) hS2) + +theorem Special_odd (k : Nat) {r : ListBlank (Fin 2)} (hr : RC (2 ^ (2 * k + 3) + 1) r) : + ∃ c', Allowed c' ∧ ((ldh <+ ld0 ^ (2 * k + 3)) {{B}}> ([1] +> r)) [target_tm]⊢⁺ c' := by + have hr' : RC (2 ^ ((2 * k + 1) + 2) + 1) r := hr + rcases Special_to_T_one (2 * k + 1) hr' with ⟨e, w, hN, hS⟩ + have hpos := Num_A_positive hN + have hp := pow2_pos k + have hB := Num_Bodd k hN + have hB' : Num (2 * (2 * k + 1 + 2) + 1 + 2 * k + 1) (0 * 2 ^ (k + 1)) (1 + (e * 2 ^ k - 1)) + (List.replicate (2 * k + 1) false ++ true :: w) := + Num_eq hB rfl rfl (by have : 1 ≤ e * 2 ^ k := Nat.mul_pos hpos hp; omega) rfl + rcases ST_T100 hB' with ⟨e', w', hN', hle, hT⟩ + refine ⟨SC (true :: w') default, ?_, ?_⟩ + · exact Allowed.Signal 0 _ (STAllowed.S _ _ _ (true :: w') 0 default + hN' (by omega) (by omega) (by omega) RC.zero) + · rw [TC_word] at hS + exact stepPlus_trans hS (hT ldh default) + +theorem Special_even_R_zero (k : Nat) {r : ListBlank (Fin 2)} (hr : RC (2 ^ (2 * k + 2) + 1) r) : + ((ldh <+ ld0 ^ (2 * k + 2)) {{B}}> ([1] +> r)) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (3 * k + 4)) {{B}}> default) := by + rcases Special_to_T_one (2 * k) hr with ⟨e, w, hN, hS⟩ + have hB := Num_BB k hN + have hB' : Num (2 * (3 * k + 2) + 1) (e * 2 ^ k) 0 (List.replicate (2 * k) false ++ true :: w) := + Num_eq hB (by omega) rfl (by omega) rfl + have hT := T100_zero_odd default hB' + rw [show 3 * k + 2 + 2 = 3 * k + 4 by omega] at hT + rw [TC_word] at hS + exact stepPlus_trans hS hT + +theorem cap_plus_one (n : Nat) {r : ListBlank (Fin 2)} (hn : 1 ≤ n) (hr : RC (2 ^ n + 1) r) : + ∃ c', Allowed c' ∧ ((ldh <+ ld0 ^ n) {{B}}> ([1] +> r)) [target_tm]⊢⁺ c' := by + rcases n with _ | _ | k + · omega + · exact Special_one hr + · rcases nat_even_or_odd k with ⟨m, rfl⟩ | ⟨m, rfl⟩ + · rcases R_zero_full (3 * m + 4) (by omega) with ⟨c', hA, hS⟩ + exact ⟨c', hA, stepPlus_trans (Special_even_R_zero m hr) hS⟩ + · exact Special_odd m hr + +def cut (n : Nat) : Cfg (Fin 2) (Fin 6) := + ((default <+ cut_tag <+ ld1 ^ n) {{B}}> (rd1 ^ (n - 1) +> ([1, 1, 1, 0, 0] +> default))) + +theorem Num_total (w : List Bool) : ∃ e o, Num w.length e o w := by + induction w with + | nil => exact ⟨0, 0, Num.nil⟩ + | cons b w ih => + rcases ih with ⟨e, o, h⟩ + cases b + · exact ⟨o * 2, e, Num_eq (Num.B _ _ _ _ h) (by simp; omega) rfl rfl rfl⟩ + · exact ⟨1 + o * 2, e, Num_eq (Num.A _ _ _ _ h) (by simp; omega) rfl rfl rfl⟩ + +theorem odd_word (m : Nat) : + ∃ w e o, Num (2 * (3 * m + 2)) e o (true :: w) ∧ + ldh <+ l_tape (true :: w) = + default <+ cut_tag <+ ld1 ^ (m * 2) <+ [1, 1, 1] <+ ld1 <+ ld0 ^ m := by + rcases normal_zero (m * 2) with ⟨z, hz⟩ + have hl := normal_length hz + have ht := normal_zero_tape hz rfl + set u := List.replicate (2 * m) true ++ true :: false :: false :: (z ++ [true]) + have hu : u.length = 2 * (3 * m + 2) := by + simp [u, hl]; omega + have hhead : ∃ w, u = true :: w := by + cases m with + | zero => exact ⟨false :: false :: (z ++ [true]), rfl⟩ + | succ m => + have : 2 * (m + 1) = (2 * m + 1) + 1 := by omega + rw [show u = (List.replicate (2 * (m + 1)) true) ++ true :: false :: false :: (z ++ [true]) by rfl, + this, List.replicate_succ, List.cons_append] + exact ⟨_, rfl⟩ + rcases hhead with ⟨w, hw⟩ + rcases Num_total u with ⟨e, o, hN⟩ + refine ⟨w, e, o, ?_, ?_⟩ + · rw [← hu] + exact Num_eq hN rfl rfl rfl hw + · rw [← hw] + simp only [u, l_tape_append, l_tape_cons, l_tape_nil, + normal_full_tape (normal_full m) rfl, ht] + simp [ldh, cut_tag, digit, Half, ld1, listblank_append_assoc] + +theorem FC_head_one (r : ListBlank (Fin 2)) (t : Nat) : + FC ([0] +> r) (t + 1) 1 ([1] +> (rd0 ^ (t + 1) +> r)) := by + have h0 := FC.d1 t 0 (rd0 ^ t +> ([0] +> r)) (FC_zero ([0] +> r) t) + have heq : rd1 +> (rd0 ^ t +> ([0] +> r)) = [1] +> (rd0 ^ (t + 1) +> r) := by + rw [right_pow_succ rd0 t r] + change rd1 +> (rd0 ^ t +> (([0] : List (Fin 2)) +> r)) = + rd1 +> (([0] : List (Fin 2)) +> (rd0 ^ t +> r)) + rw [one_zero_comm_rd0_pow t r] + exact FC_eq h0 rfl (by omega) heq + +theorem cut_even (m : Nat) : ∃ c', Allowed c' ∧ (cut (2 + m * 2)) [target_tm]⊢⁺ c' := by + rcases R_zero_full (4 + m * 3) (by omega) with ⟨c', hA, hS⟩ + refine ⟨c', hA, ?_⟩ + have s1 := even_capacity_cleanup m default + have heq0 : ([0] : List (Fin 2)) +> (default : ListBlank (Fin 2)) = default := zero_cons_default + rw [heq0] at s1 + have hcut : cut (2 + m * 2) = + ((default <+ cut_tag <+ ld1 ^ (2 + m * 2)) {{B}}> (rd1 ^ (1 + m * 2) +> ([1, 1, 1, 0, 0] +> default))) := by + simp [cut, show 2 + m * 2 - 1 = 1 + m * 2 by omega] + rw [hcut] + exact stepPlus_trans s1 hS + +theorem cut_odd (m : Nat) : ∃ c', Allowed c' ∧ (cut (1 + m * 2)) [target_tm]⊢⁺ c' := by + rcases odd_word m with ⟨w, e, o, hN, ht⟩ + have hr1 : RC 1 ([1, 0] +> default) := by + have h0 : RC 1 (rd1 +> default) := RC_eq (RC.d1 0 default RC.zero) (by omega) rfl + have heq : rd1 +> (default : ListBlank (Fin 2)) = [1, 0] +> default := by simp [rd1] + rwa [heq] at h0 + rcases even_R_return hN (by omega) hr1 (by omega) with ⟨c', hA, hS⟩ + refine ⟨c', hA, ?_⟩ + have s1 := odd_capacity_entry (default <+ cut_tag <+ ld1 ^ (m * 2)) default m + have hcut : cut (1 + m * 2) = + ((default <+ cut_tag <+ ld1 ^ (m * 2) <+ ld1) {{B}}> (rd1 ^ (m * 2) +> ([1, 1, 1, 0, 0] +> default))) := by + dsimp [cut] + rw [show 1 + m * 2 - 1 = m * 2 by omega, + show 1 + m * 2 = m * 2 + 1 by omega, + left_pow_succ (default <+ cut_tag) ld1 (m * 2)] + rw [hcut] + rw [ht] at hS + exact stepPlus_trans s1 hS + +theorem cut_return (n : Nat) (hn : 1 ≤ n) : ∃ c', Allowed c' ∧ (cut n) [target_tm]⊢⁺ c' := by + rcases nat_even_or_odd n with ⟨m, rfl⟩ | ⟨m, rfl⟩ + · cases m with + | zero => omega + | succ m => + rw [show 2 * (m + 1) = 2 + m * 2 by omega] + exact cut_even m + · rw [show 2 * m + 1 = 1 + m * 2 by omega] + exact cut_odd m + +theorem two_batches {n b : Nat} {w : List Bool} (t : Nat) (l r : ListBlank (Fin 2)) + (hn : Normal n (2 ^ (1 + (t + 1)) - 2 + b) w) : + ∃ w', Normal n b w' ∧ + ((l <+ l_tape w) {{B}}> ([1] +> (rd0 ^ (t + 1) +> ([1] +> r)))) [target_tm]⊢* + ((l <+ l_tape w') {{B}}> (rd1 ^ (t + 1) +> ([1, 1] +> r))) := by + have hp := pow2_pos t + have hp1 : 2 ≤ 2 ^ (t + 1) := by rw [Nat.pow_succ]; omega + have hn' : Normal n ((2 ^ (t + 1) - 2) + (2 ^ (t + 1) + b)) w := + Normal_eq hn rfl (by rw [show 1 + (t + 1) = (t + 1) + 1 by omega, Nat.pow_succ]; omega) rfl + rcases normal_FC_Rpairs ([0, 1] +> r) (t + 1) (2 ^ (t + 1) - 2) hn' (FC_head_one ([1] +> r) t) (by omega) + with ⟨w1, r1, h1, hr1, hS1⟩ + have hr1_eq : r1 = rd1 ^ (t + 1) +> ([0, 1] +> r) := + FC_full_unique (FC_eq hr1 rfl (by omega) rfl) + subst hr1_eq + have h1' : Normal n (1 + ((2 ^ (t + 1) - 1) + b)) w1 := + Normal_eq h1 rfl (by omega) rfl + rcases normal_LInc h1' with ⟨w2, h2, hL⟩ + rcases normal_FC_Rpairs ([1, 1] +> r) (t + 1) (2 ^ (t + 1) - 1) h2 + (FC_zero ([1, 1] +> r) (t + 1)) (by omega) + with ⟨w3, r3, h3, hr3, hS3⟩ + have hr3_eq : r3 = rd1 ^ (t + 1) +> ([1, 1] +> r) := + FC_full_unique (FC_eq hr3 rfl (by omega) rfl) + subst hr3_eq + refine ⟨w3, h3, ?_⟩ + have s1 := hS1 l + have s2 := RInc_rule (l <+ l_tape w1) ([1] +> r) (t + 1) + have heq2 : ([0] : List (Fin 2)) +> ([1] +> r) = [0, 1] +> r := rfl + have heq2' : ([1] : List (Fin 2)) +> ([1] +> r) = [1, 1] +> r := rfl + rw [heq2, heq2'] at s2 + have s3 := hL l (rd0 ^ (t + 1) +> ([1, 1] +> r)) + have s4 := hS3 l + exact stepStar_trans s1 + (stepStar_trans (stepPlus_to_stepStar s2) + (stepStar_trans (stepPlus_to_stepStar s3) s4)) + +theorem ldh_ld0_pow_half0 (k : Nat) : + ldh <+ ld0 ^ k <+ Half 0 = default <+ cut_tag <+ ld0 ^ k := by + induction k with + | zero => rfl + | succ k ih => + rw [left_pow_succ ldh ld0 k, left_pow_succ (default <+ cut_tag) ld0 k, ← ih] + rfl + +theorem Saturated_front (n : Nat) : + ((ldh <+ ld0 ^ (n + 1)) {{B}}> ([1] +> (rd0 ^ (n + 1) +> (rd1 +> default)))) [target_tm]⊢⁺ + ((default <+ cut_tag <+ ld0 ^ (n + 1)) <{{C}} ([1] +> (rd0 ^ n +> ([1, 1, 0, 0] +> default)))) := by + have hp := pow2_pos n + have hp1 : 2 ≤ 2 ^ (n + 1) := by rw [Nat.pow_succ]; omega + have hn : Normal (n + 1) ((2 ^ (n + 1) - 2) + 1) (List.replicate (2 * (n + 1)) true) := + Normal_eq (normal_full (n + 1)) rfl (by omega) rfl + rcases normal_FC_Rpairs ([0, 1, 0, 0] +> default) (n + 1) (2 ^ (n + 1) - 2) hn + (FC_insert_one default n) (by omega) with ⟨w1, r1, h1, hr1, hS1⟩ + have hr1_eq : r1 = rd1 ^ (n + 1) +> ([0, 1, 0, 0] +> default) := + FC_full_unique (FC_eq hr1 rfl (by omega) rfl) + subst hr1_eq + have h1' : Normal (n + 1) (1 + 0) w1 := Normal_eq h1 rfl (by omega) rfl + rcases normal_LInc h1' with ⟨w2, h2, hL⟩ + have s1 := hS1 ldh + rw [normal_full_tape (normal_full (n + 1)) rfl] at s1 + have s2 := RInc_rule (ldh <+ l_tape w1) ([1, 0, 0] +> default) (n + 1) + have heq2 : ([0] : List (Fin 2)) +> ([1, 0, 0] +> (default : ListBlank (Fin 2))) = [0, 1, 0, 0] +> default := rfl + have heq2' : ([1] : List (Fin 2)) +> ([1, 0, 0] +> (default : ListBlank (Fin 2))) = [1, 1, 0, 0] +> default := rfl + rw [heq2, heq2'] at s2 + have s3 := hL ldh (rd0 ^ (n + 1) +> ([1, 1, 0, 0] +> default)) + rw [normal_zero_tape h2 rfl] at s3 + have s4 := RInc_rule (ldh <+ ld1 ^ (n + 1)) ([0, 0] +> (rd0 ^ n +> ([1, 1, 0, 0] +> default))) 0 + have heq4 : rd1 ^ 0 +> ([0] +> ([0, 0] +> (rd0 ^ n +> ([1, 1, 0, 0] +> default)))) = + rd0 ^ (n + 1) +> ([1, 1, 0, 0] +> default) := by + rw [right_pow_succ rd0 n ([1, 1, 0, 0] +> default)] + rfl + have heq4' : rd0 ^ 0 +> ([1] +> ([0, 0] +> (rd0 ^ n +> ([1, 1, 0, 0] +> default)))) = + rd1 +> (rd0 ^ n +> ([1, 1, 0, 0] +> default)) := rfl + rw [heq4, heq4'] at s4 + have s5 := LOv (rd1 +> (rd0 ^ n +> ([1, 1, 0, 0] +> default))) n + rw [Nat.add_comm 1 n] at s5 + have s6 := R1100Turn (ldh <+ ld0 ^ (n + 1)) (rd0 ^ n +> ([1, 1, 0, 0] +> default)) + have heq6 : ([1] : List (Fin 2)) +> (rd1 +> (rd0 ^ n +> ([1, 1, 0, 0] +> default))) = + [1, 1, 0, 0] +> (rd0 ^ n +> ([1, 1, 0, 0] +> default)) := rfl + have heq6' := ldh_ld0_pow_half0 (n + 1) + rw [← heq6, heq6'] at s6 + exact stepStar_stepPlus_trans s1 + (stepPlus_trans s2 + (stepPlus_trans s3 + (stepPlus_trans s4 + (stepPlus_trans s5 s6)))) + +theorem to_cut (n : Nat) (hlen : 1 ≤ n) : + ((ldh <+ ld0 ^ n) {{B}}> ([1] +> (rd0 ^ n +> (rd1 +> default)))) [target_tm]⊢⁺ cut n := by + rcases n with _ | _ | n + · omega + · simpa [cut, rd0, rd1] using! saturated_one default + · have hp := pow2_pos n + have hp1 : 2 ≤ 2 ^ (n + 1 + 1) := by rw [Nat.pow_succ, Nat.pow_succ]; omega + have hn : Normal (n + 1 + 1) (1 + (2 ^ (n + 1 + 1) - 2)) (List.replicate (2 * (n + 1 + 1)) true) := + Normal_eq (normal_full (n + 1 + 1)) rfl (by omega) rfl + rcases normal_LInc hn with ⟨w1, h1, hL⟩ + have h1' : Normal (n + 1 + 1) (2 ^ (1 + (n + 1)) - 2 + 0) w1 := + Normal_eq h1 rfl (by rw [show 1 + (n + 1) = n + 1 + 1 by omega]; omega) rfl + rcases two_batches n (default <+ cut_tag) ([1, 0, 0] +> default) h1' with ⟨w2, h2, hS⟩ + rw [normal_zero_tape h2 rfl] at hS + rw [normal_full_tape (normal_full (n + 1 + 1)) rfl] at hL + have s1 := Saturated_front (n + 1) + have s2 := hL (default <+ cut_tag) ([1] +> (rd0 ^ (n + 1) +> ([1, 1, 0, 0] +> default))) + have heq2 : ([1, 1, 0, 0] : List (Fin 2)) +> (default : ListBlank (Fin 2)) = + [1] +> ([1, 0, 0] +> default) := rfl + have heq3 : ([1, 1] : List (Fin 2)) +> ([1, 0, 0] +> (default : ListBlank (Fin 2))) = + [1, 1, 1, 0, 0] +> default := rfl + rw [heq2] at s2 + rw [heq3] at hS + exact stepPlus_trans s1 (stepPlus_stepStar_trans s2 hS) + +theorem Saturated_full {n : Nat} {w : List Bool} {r : ListBlank (Fin 2)} + (hn : Normal n (2 ^ n - 1) w) (hlen : 1 ≤ n) (hr : RC (2 ^ n) r) : + ∃ c', Allowed c' ∧ (IC w r) [target_tm]⊢⁺ c' := by + rcases cut_return n hlen with ⟨c', hA, hS⟩ + have hr1 : RC 1 (rd1 +> default) := RC_eq (RC.d1 0 default RC.zero) (by omega) rfl + have hr0 : RC (2 ^ n) (rd0 ^ n +> (rd1 +> default)) := + RC_eq (RC_zeros n hr1) (by omega) rfl + have hr_eq : r = rd0 ^ n +> (rd1 +> default) := RC_unique hr hr0 + subst hr_eq + refine ⟨c', hA, ?_⟩ + simp only [IC, normal_full_tape hn rfl] + exact stepPlus_trans (to_cut n hlen) hS + +theorem I_step {c : Cfg (Fin 2) (Fin 6)} (hI : IAllowed c) : + ∃ c', Allowed c' ∧ c [target_tm]⊢⁺ c' := by + cases hI with + | intro n k w z r hN hlen hr hg => + rcases Nat.eq_zero_or_pos z with rfl | hz + · exact I_zero hN hlen hr + · rcases hg with rfl | ⟨d, hd, hdn, hk⟩ | ⟨hk, hb⟩ + · omega + · exact IClosure_small d hN hlen hr hz hd hdn hk + · rcases Nat.lt_or_ge z (2 ^ n) with hlt | hge + · exact IClosure_small n hN hlen hr hz hlt (Nat.le_refl n) (by omega) + · rcases Nat.lt_or_ge (2 ^ n) z with hgt | hle + · have hz1 : z = 2 ^ n + 1 := by omega + subst hz1 + simp only [IC, normal_full_tape hN hk] + exact cap_plus_one n hlen hr + · have heq : z = 2 ^ n := by omega + subst heq; subst hk; exact Saturated_full hN hlen hr + +theorem Allowed_step {c : Cfg (Fin 2) (Fin 6)} (hA : Allowed c) : + ∃ c', Allowed c' ∧ c [target_tm]⊢⁺ c' := by + cases hA with + | Ordinary c hI => exact I_step hI + | Ten z c hJ => + rcases Ten_to_zero z hJ with ⟨c1, hJ0, hS1⟩ + rcases J_zero hJ0 with ⟨c2, hA2, hS2⟩ + exact ⟨c2, hA2, stepStar_stepPlus_trans hS1 hS2⟩ + | Signal z c hS => + rcases ST_to_zero z hS with ⟨c1, hS0, hS1⟩ + rcases S_zero hS0 with ⟨c2, hA2, hS2⟩ + exact ⟨c2, hA2, stepStar_stepPlus_trans hS1 hS2⟩ + +theorem seed_allowed : Allowed ((ldh <+ ld0 ^ 2) <{{C}} ([1, 0] +> (rd1 +> default))) := by + have hr1 : RC 1 (rd1 +> default) := RC_eq (RC.d1 0 default RC.zero) (by omega) rfl + exact Allowed.Ten 1 _ (J_full 2 1 (rd1 +> default) (by omega) hr1 (Or.inr (by omega))) + +theorem multiStep_none_add {c : Cfg (Fin 2) (Fin 6)} {k : Nat} + (h : multiStep target_tm c k = none) (d : Nat) : + multiStep target_tm c (k + d) = none := by + rw [multiStep_add, h]; rfl + +theorem reach_arbitrarily_long : + ∀ m : Nat, ∃ N c, m ≤ N ∧ Allowed c ∧ multiStep target_tm (init []) N = some c + | 0 => by + rcases init_to_J2 with ⟨N₀, hN₀⟩ + exact ⟨N₀, _, Nat.zero_le N₀, seed_allowed, hN₀⟩ + | m + 1 => by + rcases reach_arbitrarily_long m with ⟨N, c, h_le, hc, hN⟩ + rcases Allowed_step hc with ⟨c', hc', k, hk_pos, hk⟩ + exact ⟨N + k, c', by omega, hc', multiStep_trans target_tm _ _ _ N k hN hk⟩ + +end Solution + + + +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg ⟨k, hk⟩ + cases h_step : step target_tm cfg with + | some cfg' => rfl + | none => + have h_none : multiStep target_tm (init []) (k + 1) = none := by + rw [multiStep_succ', hk]; exact h_step + rcases reach_arbitrarily_long (k + 1) with ⟨N, _, h_ge, _, hN⟩ + have h_split : N = (k + 1) + (N - (k + 1)) := by omega + have h_none_N : multiStep target_tm (init []) N = none := by + rw [h_split] + exact multiStep_none_add h_none (N - (k + 1)) + rw [h_none_N] at hN + nomatch hN + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0LE_1LC1RD_1LA0LC_1RA1RE_0RF0RB_1LCHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0LE_1RC0LF_0LD0RC_1RA1LD_1LB0LE_HHH0RE.lean b/BusyBeaver/BB6/NonHalt/M_1RB0LE_1RC0LF_0LD0RC_1RA1LD_1LB0LE_HHH0RE.lean new file mode 100644 index 00000000..4217238d --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0LE_1RC0LF_0LD0RC_1RA1LD_1LB0LE_HHH0RE.lean @@ -0,0 +1,615 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.SharedDonorsA + +open Mathlib Relation Nat Turing BusyBeaver + + +namespace BusyBeaver.M_1RB0LE_1RC0LF_0LD0RC_1RA1LD_1LB0LE_HHH0RE + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LE_1RC0LF_0LD0RC_1RA1LD_1LB0LE_HHH0RE" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +open TM24Donor Records Stack Cap + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + + +local infixr:67 " ::ᵇ " => Turing.ListBlank.cons + +def state_map : Fin 6 → Fin 6 + | 0 => 1 + | 1 => 2 + | 2 => 3 + | 3 => 0 + | 4 => 4 + | 5 => 5 + +def mapCfg (c : Cfg (Fin 2) (Fin 6)) : Cfg (Fin 2) (Fin 6) := + ⟨c.q.map state_map, c.tape⟩ + +theorem step_mapCfg (c : Cfg (Fin 2) (Fin 6)) : + step tm24 (mapCfg c) = (step target_tm c).map mapCfg := by + rcases c with ⟨_ | ⟨_ | _ | _ | _ | _ | _ | q, hq⟩, ⟨⟨_ | _ | h, hh⟩, l, r⟩⟩ <;> + (try rfl) <;> + omega + +theorem multiStep_mapCfg (c : Cfg (Fin 2) (Fin 6)) (n : Nat) : + multiStep tm24 (mapCfg c) n = (multiStep target_tm c n).map mapCfg := by + induction n generalizing c with + | zero => rfl + | succ n ih => + rw [multiStep_succ', multiStep_succ', ih] + rcases multiStep target_tm c n with _ | c' + · rfl + · exact step_mapCfg c' + +theorem neverHaltsFrom_of_mapCfg {c₀ : Cfg (Fin 2) (Fin 6)} + (h : NeverHaltsFrom tm24 (mapCfg c₀)) : NeverHaltsFrom target_tm c₀ := by + intro cfg ⟨n, hn⟩ + have hm : (mapCfg c₀) [tm24]⊢* (mapCfg cfg) := by + refine ⟨n, ?_⟩ + rw [multiStep_mapCfg, hn] + rfl + have hstep := h (mapCfg cfg) hm + rcases hst : step target_tm cfg with _ | c' + · rw [step_mapCfg, hst] at hstep + cases hstep + · rfl + +def entry_stack : Stack := + SPush false (SCap C2) [1, 1, 0, 1, 1, 1, 0] 1 + +def entry_records : Records := + REnd [1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1] + +theorem entry_source : Source entry_stack entry_records := by + have hb1 : IsBinary [1, 1, 0, 1, 1, 1, 0] := by + repeat (first | exact IsBinary.nil | refine IsBinary.cons (by decide) ?_) + have hb2 : IsBinary [1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1] := by + repeat (first | exact IsBinary.nil | refine IsBinary.cons (by decide) ?_) + refine ⟨⟨trivial, hb1, by decide, Or.inl rfl, ⟨by decide, by decide⟩, by decide⟩, + ⟨num_binary hb2 false, Or.inl rfl, ⟨by decide, by decide⟩, by decide⟩, + by decide⟩ + +def init_cfg_0 : Cfg (Fin 2) (Fin 6) := + (default {{B}}> default) + +def init_cfg_1 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ default)) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default))))))))))))))))))))))) + +def init_cfg_2 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ default)) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default))))))))))))))))))))))))))))))))) + +def init_cfg_3 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ default)) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ default)))))))))))))))))))))))))))))))))))))))) + +def init_cfg_4 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ default)) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))))))))))))))))))))))))))))))))))))) + +def init_cfg_5 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))))))))))))) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ default)))))))))))))))))))))))))))) + +def init_cfg_6 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ default)) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + +def init_cfg_7 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ default))))))))))))))))))))))))))))))) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))))))))))))))))) + +def init_cfg_8 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ default)) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ default)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + +def init_cfg_9 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ default))))))))))))))))))))))))))))))))))))))))) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))))))))))))))))))) + +def init_cfg_10 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ default))))))) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + +def init_cfg_11 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ default))))))))))))))))))))))))))))))))))))))))))) {{D}}> (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))))))))))))))))) + +def init_cfg_12 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ default)) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ default)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + +def init_cfg_13 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ default)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + +def init_cfg_14 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ default))))))) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + +def init_cfg_15 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))))))))))))))))))))))))))))))))))))))))))))))) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))))))))))))))))))) + +def init_cfg_16 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))))))))))))) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ default)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + +def init_cfg_17 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) {{D}}> (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ default)))))))))))))))))))))))))))))) + +def init_cfg_18 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ default)) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + )))))))) + +def init_cfg_19 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ default))))))))))))))))))))))))))))))) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + +def init_cfg_20 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ default))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) {{D}}> (0 + ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ default)))))))))))))))))))))))))))))) + +def init_cfg_21 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ default)) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + ))))))))))))) + +def init_cfg_22 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) {{D}}> (0 + ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))))))))))))))))) + +def init_cfg_23 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ default))))))))))))))))))))))))))))))))))))))))) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + +def init_cfg_24 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ default))))))) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + ))))))))))) + +def init_cfg_25 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ default))))))))))))))))))))))))))))))))))))))))))) {{D}}> (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + +def init_cfg_26 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ default)) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + ))))))))))))))))))))) + +def init_cfg_27 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + ))))))))) + +def init_cfg_28 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ default))))))) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + )))))))))))))))))))))))) + +def init_cfg_29 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))))))))))))))))))))))))))))))))))))))))))))))) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + +def init_cfg_30 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))))))))))))) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + ))))))) + +def init_cfg_31 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + ))))) {{D}}> (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ default)))))))))))))))))))))))))) + +def init_cfg_32 : Cfg (Fin 2) (Fin 6) := + ((0 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) {{D}}> (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ + (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ (0 ::ᵇ (1 ::ᵇ + (1 ::ᵇ (0 ::ᵇ (0 ::ᵇ (1 ::ᵇ (1 ::ᵇ + default)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + +theorem init_step_0 : init_cfg_0 [tm24]⊢* init_cfg_1 := by + dsimp only [init_cfg_0, init_cfg_1] + execute + +theorem init_step_1 : init_cfg_1 [tm24]⊢* init_cfg_2 := by + dsimp only [init_cfg_1, init_cfg_2] + execute + +theorem init_step_2 : init_cfg_2 [tm24]⊢* init_cfg_3 := by + dsimp only [init_cfg_2, init_cfg_3] + execute + +theorem init_step_3 : init_cfg_3 [tm24]⊢* init_cfg_4 := by + dsimp only [init_cfg_3, init_cfg_4] + execute + +theorem init_step_4 : init_cfg_4 [tm24]⊢* init_cfg_5 := by + dsimp only [init_cfg_4, init_cfg_5] + execute + +theorem init_step_5 : init_cfg_5 [tm24]⊢* init_cfg_6 := by + dsimp only [init_cfg_5, init_cfg_6] + execute + +theorem init_step_6 : init_cfg_6 [tm24]⊢* init_cfg_7 := by + dsimp only [init_cfg_6, init_cfg_7] + execute + +theorem init_step_7 : init_cfg_7 [tm24]⊢* init_cfg_8 := by + dsimp only [init_cfg_7, init_cfg_8] + execute + +theorem init_step_8 : init_cfg_8 [tm24]⊢* init_cfg_9 := by + dsimp only [init_cfg_8, init_cfg_9] + execute + +theorem init_step_9 : init_cfg_9 [tm24]⊢* init_cfg_10 := by + dsimp only [init_cfg_9, init_cfg_10] + execute + +theorem init_step_10 : init_cfg_10 [tm24]⊢* init_cfg_11 := by + dsimp only [init_cfg_10, init_cfg_11] + execute + +theorem init_step_11 : init_cfg_11 [tm24]⊢* init_cfg_12 := by + dsimp only [init_cfg_11, init_cfg_12] + execute + +theorem init_step_12 : init_cfg_12 [tm24]⊢* init_cfg_13 := by + dsimp only [init_cfg_12, init_cfg_13] + execute + +theorem init_step_13 : init_cfg_13 [tm24]⊢* init_cfg_14 := by + dsimp only [init_cfg_13, init_cfg_14] + execute + +theorem init_step_14 : init_cfg_14 [tm24]⊢* init_cfg_15 := by + dsimp only [init_cfg_14, init_cfg_15] + execute + +theorem init_step_15 : init_cfg_15 [tm24]⊢* init_cfg_16 := by + dsimp only [init_cfg_15, init_cfg_16] + execute + +theorem init_step_16 : init_cfg_16 [tm24]⊢* init_cfg_17 := by + dsimp only [init_cfg_16, init_cfg_17] + execute + +set_option maxRecDepth 200000 in +set_option maxHeartbeats 2000000 in +-- Concrete macro step requires extra heartbeats +theorem init_step_17 : init_cfg_17 [tm24]⊢* init_cfg_18 := by + dsimp only [init_cfg_17, init_cfg_18] + execute + +theorem init_step_18 : init_cfg_18 [tm24]⊢* init_cfg_19 := by + dsimp only [init_cfg_18, init_cfg_19] + execute + +theorem init_step_19 : init_cfg_19 [tm24]⊢* init_cfg_20 := by + dsimp only [init_cfg_19, init_cfg_20] + execute + +set_option maxRecDepth 200000 in +set_option maxHeartbeats 2000000 in +-- Concrete macro step requires extra heartbeats +theorem init_step_20 : init_cfg_20 [tm24]⊢* init_cfg_21 := by + dsimp only [init_cfg_20, init_cfg_21] + execute + +set_option maxRecDepth 200000 in +set_option maxHeartbeats 2000000 in +-- Concrete macro step requires extra heartbeats +theorem init_step_21 : init_cfg_21 [tm24]⊢* init_cfg_22 := by + dsimp only [init_cfg_21, init_cfg_22] + execute + +theorem init_step_22 : init_cfg_22 [tm24]⊢* init_cfg_23 := by + dsimp only [init_cfg_22, init_cfg_23] + execute + +theorem init_step_23 : init_cfg_23 [tm24]⊢* init_cfg_24 := by + dsimp only [init_cfg_23, init_cfg_24] + execute + +theorem init_step_24 : init_cfg_24 [tm24]⊢* init_cfg_25 := by + dsimp only [init_cfg_24, init_cfg_25] + execute + +theorem init_step_25 : init_cfg_25 [tm24]⊢* init_cfg_26 := by + dsimp only [init_cfg_25, init_cfg_26] + execute + +theorem init_step_26 : init_cfg_26 [tm24]⊢* init_cfg_27 := by + dsimp only [init_cfg_26, init_cfg_27] + execute + +theorem init_step_27 : init_cfg_27 [tm24]⊢* init_cfg_28 := by + dsimp only [init_cfg_27, init_cfg_28] + execute + +theorem init_step_28 : init_cfg_28 [tm24]⊢* init_cfg_29 := by + dsimp only [init_cfg_28, init_cfg_29] + execute + +theorem init_step_29 : init_cfg_29 [tm24]⊢* init_cfg_30 := by + dsimp only [init_cfg_29, init_cfg_30] + execute + +theorem init_step_30 : init_cfg_30 [tm24]⊢* init_cfg_31 := by + dsimp only [init_cfg_30, init_cfg_31] + execute + +set_option maxRecDepth 200000 in +set_option maxHeartbeats 2000000 in +-- Concrete macro step requires extra heartbeats +theorem init_step_31 : init_cfg_31 [tm24]⊢* init_cfg_32 := by + dsimp only [init_cfg_31, init_cfg_32] + execute + +set_option maxRecDepth 20000 in +theorem mapped_entry : init_cfg_32 = active entry_stack entry_records := rfl + +theorem init_to_entry : + (mapCfg (init [])) [tm24]⊢* active entry_stack entry_records := by + have h0 : (mapCfg (init []) : Cfg (Fin 2) (Fin 6)) = init_cfg_0 := rfl + rw [h0, ← mapped_entry] + refine stepPlus_trans' init_step_0 ?_ + refine stepPlus_trans' init_step_1 ?_ + refine stepPlus_trans' init_step_2 ?_ + refine stepPlus_trans' init_step_3 ?_ + refine stepPlus_trans' init_step_4 ?_ + refine stepPlus_trans' init_step_5 ?_ + refine stepPlus_trans' init_step_6 ?_ + refine stepPlus_trans' init_step_7 ?_ + refine stepPlus_trans' init_step_8 ?_ + refine stepPlus_trans' init_step_9 ?_ + refine stepPlus_trans' init_step_10 ?_ + refine stepPlus_trans' init_step_11 ?_ + refine stepPlus_trans' init_step_12 ?_ + refine stepPlus_trans' init_step_13 ?_ + refine stepPlus_trans' init_step_14 ?_ + refine stepPlus_trans' init_step_15 ?_ + refine stepPlus_trans' init_step_16 ?_ + refine stepPlus_trans' init_step_17 ?_ + refine stepPlus_trans' init_step_18 ?_ + refine stepPlus_trans' init_step_19 ?_ + refine stepPlus_trans' init_step_20 ?_ + refine stepPlus_trans' init_step_21 ?_ + refine stepPlus_trans' init_step_22 ?_ + refine stepPlus_trans' init_step_23 ?_ + refine stepPlus_trans' init_step_24 ?_ + refine stepPlus_trans' init_step_25 ?_ + refine stepPlus_trans' init_step_26 ?_ + refine stepPlus_trans' init_step_27 ?_ + refine stepPlus_trans' init_step_28 ?_ + refine stepPlus_trans' init_step_29 ?_ + refine stepPlus_trans' init_step_30 ?_ + exact init_step_31 + + + +theorem is_does_not_halt : IsNotHalt target_tm := + neverHaltsFrom_of_mapCfg + (neverHaltsFrom_of_reachesStar init_to_entry (source_nonhalt entry_source)) + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0LE_1RC0LF_0LD0RC_1RA1LD_1LB0LE_HHH0RE diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0LE_1RC0RC_1LD0RB_1LA0LE_1LD1LF_1LDHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0LE_1RC0RC_1LD0RB_1LA0LE_1LD1LF_1LDHHH.lean new file mode 100644 index 00000000..03744dfe --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0LE_1RC0RC_1LD0RB_1LA0LE_1LD1LF_1LDHHH.lean @@ -0,0 +1,49 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.BB6.NonHalt.M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RB0LE_1RC0RC_1LD0RB_1LA0LE_1LD1LF_1LDHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LE_1RC0RC_1LD0RB_1LA0LE_1LD1LF_1LDHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +def stateMap_m0399 : Fin 6 → Fin 6 + | 0 => 2 -- m0399 state A + | 1 => 3 -- m0399 state B + | 2 => 0 -- m0399 state C + | 3 => 1 -- m0399 state D + | 4 => 4 -- m0399 state E + | 5 => 5 -- m0399 state F + +public section + +theorem is_not_halt : IsNotHalt target := by + exact Counter.does_not_halt_of_conj_stem + (M_tgt := target) + (M_src := BusyBeaver.M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH.target) + (σ := stateMap_m0399) (f := true) + (c₁ := (default : ListBlank (Fin 2)) {{2}}> default) + (by decide) (Counter.init_reaches_conjCfg_default rfl) + BusyBeaver.M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH.is_not_halt_from_0399 + +end + +end BusyBeaver.M_1RB0LE_1RC0RC_1LD0RB_1LA0LE_1LD1LF_1LDHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0LE_1RC1LA_1LD1RE_1LB0LD_1RF0RC_1RBHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0LE_1RC1LA_1LD1RE_1LB0LD_1RF0RC_1RBHHH.lean new file mode 100644 index 00000000..17aabbb9 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0LE_1RC1LA_1LD1RE_1LB0LD_1RF0RC_1RBHHH.lean @@ -0,0 +1,1265 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0LE_1RC1LA_1LD1RE_1LB0LD_1RF0RC_1RBHHH + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LE_1RC1LA_1LD1RE_1LB0LD_1RF0RC_1RBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +namespace Solution + +-- ============================================================================ +-- Section 1: Basic Utilities, PairWord & Pair3Word +-- ============================================================================ + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : + multiStep M config 0 = some config := rfl + +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : + multiStep M config 1 = step M config := rfl + +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +theorem multiStep_add (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n + m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem multiStep_step {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} {n : Nat} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢^{n} c₃) : c₁ [tm]⊢^{n + 1} c₃ := by + have := multiStep_trans tm c₁ c₂ c₃ 1 n h₁ h₂ + rwa [Nat.add_comm 1 n] at this + +theorem stepStar_refl (c : Cfg (Fin 2) (Fin 6)) : c [target_tm]⊢* c := ⟨0, rfl⟩ + +theorem stepPlus_to_stepStar {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢⁺ c₂) : + c₁ [target_tm]⊢* c₂ := by + rcases h with ⟨n, _, hn⟩; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [target_tm]⊢⁺ c₂) (h₂ : c₂ [target_tm]⊢* c₃) : c₁ [target_tm]⊢⁺ c₃ := by + rcases h₁ with ⟨n, hn_pos, hn⟩; rcases h₂ with ⟨m, hm⟩ + exact ⟨n + m, Nat.add_pos_left hn_pos m, multiStep_trans target_tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [target_tm]⊢* c₂) (h₂ : c₂ [target_tm]⊢⁺ c₃) : c₁ [target_tm]⊢⁺ c₃ := by + rcases h₁ with ⟨n, hn⟩; rcases h₂ with ⟨m, hm_pos, hm⟩ + exact ⟨n + m, Nat.add_pos_right n hm_pos, multiStep_trans target_tm c₁ c₂ c₃ n m hn hm⟩ + +omit [Inhabited Γ] in +@[simp] theorem pow_zero_list (l : List Γ) : l ^ (0 : Nat) = [] := rfl + +omit [Inhabited Γ] in +theorem pow_succ_list (l : List Γ) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl + +omit [Inhabited Γ] in +@[simp] theorem list_pow_add (l : List Γ) (n m : Nat) : l ^ (n + m) = l ^ n ++ l ^ m := by + induction n with + | zero => simp [pow_zero_list] + | succ n ih => + rw [Nat.succ_add, pow_succ_list, pow_succ_list, ih, List.append_assoc] + +omit [Inhabited Γ] in +theorem pow_succ_right (l : List Γ) (n : Nat) : l ^ (n + 1) = l ^ n ++ l := by + rw [list_pow_add]; simp [pow_succ_list, pow_zero_list] + +@[simp] theorem listblank_append_nil (s : ListBlank Γ) : ([] : List Γ) +> s = s := rfl + +@[simp] theorem listblank_append_cons (a : Γ) (l : List Γ) (s : ListBlank Γ) : + (a :: l) +> s = a >> (l +> s) := rfl + +@[simp] theorem listblank_append_assoc (l₁ l₂ : List Γ) (s : ListBlank Γ) : + (l₁ ++ l₂) +> s = l₁ +> (l₂ +> s) := + Turing.ListBlank.append_assoc l₁ l₂ s + +theorem left_pow_add (l : ListBlank (Fin 2)) (u : List (Fin 2)) (n m : Nat) : + l <+ u ^ (n + m) = l <+ u ^ m <+ u ^ n := by + rw [list_pow_add, listblank_append_assoc] + +theorem right_pow_succ (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + u ^ (n + 1) +> r = u +> (u ^ n +> r) := by + rw [pow_succ_list, listblank_append_assoc] + +theorem right_pow_succ_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + u ^ (n + 1) +> r = u ^ n +> (u +> r) := by + rw [pow_succ_right, listblank_append_assoc] + +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +@[simp] theorem zero_cons_default : (0 : Fin 2) >> (default : ListBlank (Fin 2)) = default := by + change ListBlank.cons default default = default + exact ListBlank.cons_head_tail default + +@[simp] theorem init_nil : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = + ⟨some A, ⟨0, default, default⟩⟩ := rfl + +def rd1 : List (Fin 2) := [1, 0, 0, 0] +def rds : List (Fin 2) := [0, 0, 0, 1] + +def bit (b : Bool) : Fin 2 := if b then 1 else 0 + +@[simp] theorem bit_false : bit false = 0 := rfl +@[simp] theorem bit_true : bit true = 1 := rfl + +def pairs : List Bool → List (Fin 2) + | [] => [] + | b :: u => bit b :: 1 :: pairs u + +@[simp] theorem pairs_nil : pairs [] = [] := rfl +@[simp] theorem pairs_cons (b : Bool) (u : List Bool) : + pairs (b :: u) = bit b :: 1 :: pairs u := rfl + +def data (w : List Bool) : ListBlank (Fin 2) := + default <+ [1] <+ pairs w + +@[simp] theorem data_cons (b : Bool) (u : List Bool) : + data (b :: u) = data u <+ [bit b, 1] := rfl + +def insert (b : Bool) (r : ListBlank (Fin 2)) : ListBlank (Fin 2) := + if b then [1] +> r else r + +@[simp] theorem insert_false (r : ListBlank (Fin 2)) : insert false r = r := rfl +@[simp] theorem insert_true (r : ListBlank (Fin 2)) : insert true r = [1] +> r := rfl + +def Conf (w : List Bool) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ((data w <+ [0, 1]) {{C}}> r) + +def inc : List Bool → List Bool × Bool + | [] => ([false], false) + | [_] => ([false, false], true) + | _ :: false :: u => (false :: true :: u, false) + | [_, true] => ([false, false], true) + | _ :: true :: _ :: u => + let (v, e) := inc u + (false :: false :: false :: v, e) + +theorem pairs_ones (n : Nat) (w : List Bool) : + pairs (List.replicate n true ++ w) = ([1, 1] : List (Fin 2)) ^ n ++ pairs w := by + induction n with + | zero => rfl + | succ n ih => + rw [List.replicate_succ, List.cons_append, pairs_cons, bit_true, ih, pow_succ_list] + rfl + +theorem data_ones (n : Nat) (w : List Bool) : + data (List.replicate n true ++ w) = data w <+ ([1, 1] : List (Fin 2)) ^ n := by + simp [data, pairs_ones] + +macro "step1" : tactic => `(tactic| ( + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, init_nil, rd0, rd1, rds, bit_false, bit_true, + pairs_nil, pairs_cons, data, insert_false, insert_true, + pow_succ_list, pow_zero_list, + List.singleton_append, List.nil_append, List.cons_append, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail] + refine multiStep_step (by rfl) ?_ + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Tape.write, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail])) + +macro "run_steps" n:num : tactic => `(tactic| ( + iterate $n step1 + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, rd0, rd1, rds, bit_false, bit_true, + pairs_nil, pairs_cons, data, insert_false, insert_true, + pow_succ_list, pow_zero_list, + List.singleton_append, List.nil_append, List.cons_append, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail, multiStep_zero] + rfl)) + +-- ============================================================================ +-- Section 2: Machine-Specific Rules (A3Words) +-- ============================================================================ + +theorem CScan_step (l r : ListBlank (Fin 2)) : + (l {{C}}> (rd1 +> r)) [target_tm]⊢⁺ + ((l <+ ([1, 1] : List (Fin 2)) ^ 2) {{C}}> r) := + ⟨4, by omega, by run_steps 4⟩ + +theorem CScan (l r : ListBlank (Fin 2)) (n : Nat) : + (l {{C}}> (rd1 ^ n +> r)) [target_tm]⊢* + ((l <+ ([1, 1] : List (Fin 2)) ^ (n * 2)) {{C}}> r) := by + induction n generalizing l with + | zero => try exact stepStar_refl _ + | succ n ih => + rw [right_pow_succ rd1 n r, show (n + 1) * 2 = n * 2 + 2 by omega, + left_pow_add l [1, 1] (n * 2) 2] + exact stepStar_trans (stepPlus_to_stepStar (CScan_step l (rd1 ^ n +> r))) + (ih (l <+ ([1, 1] : List (Fin 2)) ^ 2)) + +theorem CZero (l r : ListBlank (Fin 2)) : + (l {{C}}> ([0] +> r)) [target_tm]⊢⁺ + (l <{{D}} ([1] +> r)) := + ⟨1, by omega, by run_steps 1⟩ + +theorem DScan_step (l r : ListBlank (Fin 2)) : + ((l <+ ([1, 1] : List (Fin 2)) ^ 2) <{{D}} r) [target_tm]⊢⁺ + (l <{{D}} (rd0 +> r)) := + ⟨4, by omega, by run_steps 4⟩ + +theorem DScan (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ ([1, 1] : List (Fin 2)) ^ (n * 2)) <{{D}} r) [target_tm]⊢* + (l <{{D}} (rd0 ^ n +> r)) := by + induction n generalizing r with + | zero => try exact stepStar_refl _ + | succ n ih => + rw [show (n + 1) * 2 = 2 + n * 2 by omega, left_pow_add l [1, 1] 2 (n * 2), + right_pow_succ_right rd0 n r] + exact stepStar_trans (stepPlus_to_stepStar (DScan_step (l <+ ([1, 1] : List (Fin 2)) ^ (n * 2)) r)) + (ih (rd0 +> r)) + +theorem RInc4 (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ [0, 1]) {{C}}> (rd1 ^ n +> ([0] +> r))) [target_tm]⊢⁺ + ((l <+ [0, 1]) <{{D}} (rd0 ^ n +> ([1] +> r))) := by + have s1 := CScan (l <+ [0, 1]) ([0] +> r) n + have s2 := CZero (l <+ [0, 1] <+ ([1, 1] : List (Fin 2)) ^ (n * 2)) r + have s3 := DScan (l <+ [0, 1]) ([1] +> r) n + exact stepStar_stepPlus_trans s1 (stepPlus_stepStar_trans s2 s3) + +theorem LStart (l r : ListBlank (Fin 2)) : + ((l <+ [0, 1]) <{{D}} r) [target_tm]⊢⁺ + (l {{B}}> ([1, 1] +> r)) := + ⟨1, by omega, by run_steps 1⟩ + +theorem C1001_exit (l r : ListBlank (Fin 2)) : + (l {{C}}> ([1, 0, 0, 1] +> r)) [target_tm]⊢⁺ + (l {{B}}> ([1, 1, 1, 1] +> r)) := + ⟨8, by omega, by run_steps 8⟩ + +theorem R1001_bridge (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ [0, 1]) {{C}}> (rd1 ^ n +> ([1, 0, 0, 1] +> r))) [target_tm]⊢⁺ + ((l <+ [0, 1] <+ ([1, 1] : List (Fin 2)) ^ (n * 2)) {{B}}> ([1, 1, 1, 1] +> r)) := + stepStar_stepPlus_trans (CScan (l <+ [0, 1]) ([1, 0, 0, 1] +> r) n) + (C1001_exit (l <+ [0, 1] <+ ([1, 1] : List (Fin 2)) ^ (n * 2)) r) + +theorem ZCarryMarked (a b : Bool) (l r : ListBlank (Fin 2)) : + ((l <+ [bit a, 1, 1, 1, bit b, 1]) {{B}}> ([1] +> r)) [target_tm]⊢⁺ + (l {{B}}> ([1, 1, 1, 1, 1, 1, 1] +> r)) := by + cases a <;> cases b + · exact ⟨16, by omega, by run_steps 16⟩ + · exact ⟨12, by omega, by run_steps 12⟩ + · exact ⟨14, by omega, by run_steps 14⟩ + · exact ⟨10, by omega, by run_steps 10⟩ + +theorem C11_step (l r : ListBlank (Fin 2)) : + (l {{C}}> ([1, 1] +> r)) [target_tm]⊢⁺ + ((l <+ [0, 1]) {{C}}> r) := + ⟨2, by omega, by run_steps 2⟩ + +theorem REleven (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ [0, 1]) {{C}}> (rd1 ^ n +> ([1, 1] +> r))) [target_tm]⊢⁺ + ((l <+ [0, 1] <+ ([1, 1] : List (Fin 2)) ^ (n * 2) <+ [0, 1]) {{C}}> r) := + stepStar_stepPlus_trans (CScan (l <+ [0, 1]) ([1, 1] +> r) n) + (C11_step (l <+ [0, 1] <+ ([1, 1] : List (Fin 2)) ^ (n * 2)) r) + +theorem ZInc_nil (r : ListBlank (Fin 2)) : + (data [] {{B}}> ([1, 1] +> r)) [target_tm]⊢⁺ + ((data [false] <+ [0, 1]) {{C}}> insert false r) := + ⟨14, by omega, by run_steps 14⟩ + +theorem ZInc_one (a : Bool) (r : ListBlank (Fin 2)) : + (data [a] {{B}}> ([1, 1] +> r)) [target_tm]⊢⁺ + ((data [false, false] <+ [0, 1]) {{C}}> insert true r) := by + cases a + · exact ⟨25, by omega, by run_steps 25⟩ + · exact ⟨23, by omega, by run_steps 23⟩ + +theorem ZInc_two_true (a : Bool) (r : ListBlank (Fin 2)) : + (data [a, true] {{B}}> ([1, 1] +> r)) [target_tm]⊢⁺ + ((data [false, false] <+ [0, 1]) {{C}}> insert true r) := by + cases a + · exact ⟨19, by omega, by run_steps 19⟩ + · exact ⟨17, by omega, by run_steps 17⟩ + +theorem ZInc_false (a : Bool) (u : List Bool) (r : ListBlank (Fin 2)) : + (data (a :: false :: u) {{B}}> ([1, 1] +> r)) [target_tm]⊢⁺ + ((data (false :: true :: u) <+ [0, 1]) {{C}}> insert false r) := by + cases a + · exact ⟨12, by omega, by run_steps 12⟩ + · exact ⟨10, by omega, by run_steps 10⟩ + +theorem ZInc_rec_exit (v : List Bool) (e : Bool) (r : ListBlank (Fin 2)) : + ((data v <+ [0, 1]) {{C}}> insert e ([1, 1, 1, 1, 1, 1] +> r)) [target_tm]⊢⁺ + ((data (false :: false :: false :: v) <+ [0, 1]) {{C}}> insert e r) := by + cases e <;> exact ⟨6, by omega, by run_steps 6⟩ + +theorem ZInc (w : List Bool) (r : ListBlank (Fin 2)) : + (data w {{B}}> ([1, 1] +> r)) [target_tm]⊢⁺ + ((data (inc w).1 <+ [0, 1]) {{C}}> insert (inc w).2 r) := by + match w with + | [] => exact ZInc_nil r + | [a] => exact ZInc_one a r + | a :: false :: u => exact ZInc_false a u r + | [a, true] => exact ZInc_two_true a r + | a :: true :: b :: u => + have s1 : (data (a :: true :: b :: u) {{B}}> ([1, 1] +> r)) [target_tm]⊢⁺ + (data u {{B}}> ([1, 1] +> ([1, 1, 1, 1, 1, 1] +> r))) := by + simpa [data, pairs] using ZCarryMarked a b (data u) ([1] +> r) + have s2 := ZInc u ([1, 1, 1, 1, 1, 1] +> r) + have s3 := ZInc_rec_exit (inc u).1 (inc u).2 r + have hinc : inc (a :: true :: b :: u) = (false :: false :: false :: (inc u).1, (inc u).2) := by + simp [inc] + rw [hinc] + exact stepPlus_trans s1 (stepPlus_trans s2 s3) + +theorem LIncWord (w : List Bool) (r : ListBlank (Fin 2)) : + ((data w <+ [0, 1]) <{{D}} r) [target_tm]⊢⁺ + ((data (inc w).1 <+ [0, 1]) {{C}}> insert (inc w).2 r) := + stepPlus_trans (LStart (data w) r) (ZInc w r) + +theorem RZero (w : List Bool) (r : ListBlank (Fin 2)) (n : Nat) : + ((data w <+ [0, 1]) {{C}}> (rd1 ^ n +> ([0] +> r))) [target_tm]⊢⁺ + ((data (inc w).1 <+ [0, 1]) {{C}}> insert (inc w).2 (rd0 ^ n +> ([1] +> r))) := + stepPlus_trans (RInc4 (data w) r n) (LIncWord w (rd0 ^ n +> ([1] +> r))) + +theorem R1001_exit (v : List Bool) (e : Bool) (r : ListBlank (Fin 2)) : + ((data v <+ [0, 1]) {{C}}> insert e ([1, 1] +> r)) [target_tm]⊢⁺ + ((data (false :: v) <+ [0, 1]) {{C}}> insert e r) := by + cases e <;> exact ⟨2, by omega, by run_steps 2⟩ + +theorem R1001 (w : List Bool) (r : ListBlank (Fin 2)) (n : Nat) : + let p := inc (List.replicate (2 * n) true ++ false :: w) + ((data w <+ [0, 1]) {{C}}> (rd1 ^ n +> ([1, 0, 0, 1] +> r))) [target_tm]⊢⁺ + ((data (false :: p.1) <+ [0, 1]) {{C}}> insert p.2 r) := by + dsimp only + have s1 := R1001_bridge (data w) r n + have hdata : data (List.replicate (2 * n) true ++ false :: w) = + data w <+ [0, 1] <+ ([1, 1] : List (Fin 2)) ^ (n * 2) := by + rw [data_ones, Nat.mul_comm 2 n]; rfl + have s2 := ZInc (List.replicate (2 * n) true ++ false :: w) ([1, 1] +> r) + rw [hdata] at s2 + have h1111 : ([1, 1, 1, 1] : List (Fin 2)) +> r = [1, 1] +> ([1, 1] +> r) := rfl + rw [h1111] at s1 + have s3 := R1001_exit (inc (List.replicate (2 * n) true ++ false :: w)).1 + (inc (List.replicate (2 * n) true ++ false :: w)).2 r + exact stepPlus_trans s1 (stepPlus_trans s2 s3) + +theorem init31 : + (init []) [target_tm]⊢* Conf [false, false] default := + ⟨31, by run_steps 31⟩ + +-- ============================================================================ +-- Section 3: Right Counter (Pair12Right & PairOrdinary) +-- ============================================================================ + +theorem FC_leading_one (t : Nat) (r : ListBlank (Fin 2)) : + FC rd1 ([0] +> (rd1 +> r)) (t + 1) 1 ([1] +> (rd0 ^ (t + 1) +> (rd1 +> r))) := by + have h0 := FC.d1 t 0 (rd0 ^ t +> ([0] +> (rd1 +> r))) (FC_zero rd1 ([0] +> (rd1 +> r)) t) + have heq : rd1 +> (rd0 ^ t +> ([0] +> (rd1 +> r))) = + [1] +> (rd0 ^ (t + 1) +> (rd1 +> r)) := by + rw [right_pow_succ rd0 t (rd1 +> r)] + change rd1 +> (rd0 ^ t +> (([0] : List (Fin 2)) +> (rd1 +> r))) = + rd1 +> (([0] : List (Fin 2)) +> (rd0 ^ t +> (rd1 +> r))) + rw [one_zero_comm_rd0_pow t (rd1 +> r)] + exact FC_eq h0 rfl (by omega) heq + +theorem RC_shift3 {n : Nat} {r : ListBlank (Fin 2)} (h : RC rd1 n r) : + RC rds n ([0, 0, 0] +> r) := by + induction h with + | zero => + rw [three_zeros_append_default] + exact RC.zero + | d0 n r _ ih => + have heq : ([0, 0, 0] : List (Fin 2)) +> (rd0 +> r) = rd0 +> ([0, 0, 0] +> r) := rfl + rw [heq] + exact RC.d0 n ([0, 0, 0] +> r) ih + | d1 n r _ ih => + have heq : ([0, 0, 0] : List (Fin 2)) +> (rd1 +> r) = rds +> ([0, 0, 0] +> r) := rfl + rw [heq] + exact RC.d1 n ([0, 0, 0] +> r) ih + +-- ============================================================================ +-- Section 4: Pair3Guard & Pair3EntryGuard +-- ============================================================================ + +def bit_value (b : Bool) : Nat := if b then 1 else 0 +def zero_bit (b : Bool) : Nat := if b then 0 else 1 + +def plane (f : Bool → Nat) : Nat → List Bool → Nat + | _, [] => 0 + | 0, b :: u => f b + 2 * plane f 2 u + | j + 1, _ :: u => plane f j u + +def width : List Bool → Nat + | [] => 0 + | [_] => 0 + | [_, _] => 1 + | _ :: _ :: _ :: u => 1 + width u + +def value (w : List Bool) : Nat := plane bit_value 1 w +def gap0 (w : List Bool) : Nat := 1 + plane zero_bit 1 w +def gap1 (w : List Bool) : Nat := 1 + plane zero_bit 0 w +def gap2 (w : List Bool) : Nat := 2 + 2 * plane zero_bit 2 w + +def guard (n : Nat) (w : List Bool) : Prop := + n ≤ gap0 w ∧ n ≤ gap1 w ∧ n ≤ gap2 w + +theorem gap_bounds (w : List Bool) : guard 1 w := by + dsimp [guard, gap0, gap1, gap2]; omega + +theorem value_gap0 (w : List Bool) : value w + gap0 w = 2 ^ width w := by + match w with + | [] => rfl + | [_] => rfl + | [a, b] => cases b <;> rfl + | a :: b :: c :: u => + have ih := value_gap0 u + dsimp [value, gap0, plane, width] at ih ⊢ + rw [Nat.add_comm 1 (width u), Nat.pow_succ] + cases b <;> dsimp [bit_value, zero_bit] <;> omega + +theorem gap_cons (b : Bool) (w : List Bool) : + gap0 (b :: w) = gap1 w ∧ gap1 (b :: w) + bit_value b = gap2 w ∧ gap2 (b :: w) = 2 * gap0 w := by + cases b <;> dsimp [gap0, gap1, gap2, plane, zero_bit, bit_value] <;> omega + +theorem guard_zero {n : Nat} {w : List Bool} (h : guard n w) : guard n (false :: w) := by + have hc := gap_cons false w + dsimp [guard, bit_value] at hc h ⊢ + omega + +theorem guard_one {n : Nat} {w : List Bool} (h : guard (n + 1) w) : guard n (true :: w) := by + have hc := gap_cons true w + dsimp [guard, bit_value] at hc h ⊢ + omega + +theorem inc_head (w : List Bool) : ∃ u, (inc w).1 = false :: u := by + match w with + | [] => exact ⟨[], rfl⟩ + | [_] => exact ⟨[false], rfl⟩ + | _ :: false :: u => exact ⟨true :: u, rfl⟩ + | [_, true] => exact ⟨[false], rfl⟩ + | _ :: true :: _ :: u => exact ⟨false :: false :: (inc u).1, rfl⟩ + +theorem inc_mono (w : List Bool) : + gap1 w ≤ gap1 (inc w).1 ∧ gap2 w ≤ gap2 (inc w).1 := by + match w with + | [] => dsimp [inc, gap1, gap2, plane, zero_bit]; omega + | [a] => cases a <;> dsimp [inc, gap1, gap2, plane, zero_bit] <;> omega + | a :: false :: u => cases a <;> dsimp [inc, gap1, gap2, plane, zero_bit] <;> omega + | [a, true] => cases a <;> dsimp [inc, gap1, gap2, plane, zero_bit] <;> omega + | a :: true :: c :: u => + have ih := inc_mono u + cases a <;> cases c <;> dsimp [inc, gap1, gap2, plane, zero_bit] at ih ⊢ <;> omega + +theorem inc_interior (w : List Bool) (h : 1 < gap0 w) : + (inc w).2 = false ∧ (inc w).1.length = w.length ∧ gap0 (inc w).1 + 1 = gap0 w := by + match w with + | [] => dsimp [gap0, plane] at h; omega + | [_] => dsimp [gap0, plane] at h; omega + | a :: false :: u => + dsimp [inc, gap0, plane, zero_bit] at h ⊢ + exact ⟨rfl, rfl, by omega⟩ + | [a, true] => + dsimp [gap0, plane, zero_bit] at h + omega + | a :: true :: c :: u => + have hu : 1 < gap0 u := by + dsimp [gap0, plane, zero_bit] at h ⊢ + omega + rcases inc_interior u hu with ⟨he, hl, hg⟩ + dsimp [inc, gap0, plane, zero_bit] at hg ⊢ + refine ⟨he, by simp [hl], by omega⟩ + +inductive inc_steps : Nat → List Bool → List Bool → Prop + | zero (w : List Bool) : inc_steps 0 w w + | succ (q : Nat) (w u v : List Bool) : + inc w = (u, false) → inc_steps q u v → inc_steps (q + 1) w v + +theorem inc_steps_interior (q : Nat) (w : List Bool) (h : q < gap0 w) : + ∃ v, inc_steps q w v ∧ v.length = w.length ∧ gap0 v + q = gap0 w := by + induction q generalizing w with + | zero => exact ⟨w, inc_steps.zero w, rfl, by omega⟩ + | succ q ih => + rcases inc_interior w (by omega) with ⟨he, hl, hg⟩ + have hinc : inc w = ((inc w).1, false) := Prod.ext rfl he + rcases ih (inc w).1 (by omega) with ⟨v, hs, hvl, hvg⟩ + exact ⟨v, inc_steps.succ q w (inc w).1 v hinc hs, by omega, by omega⟩ + +theorem inc_steps_mono {q : Nat} {w v : List Bool} (h : inc_steps q w v) : + gap1 w ≤ gap1 v ∧ gap2 w ≤ gap2 v := by + induction h with + | zero => exact ⟨Nat.le_refl _, Nat.le_refl _⟩ + | succ _ w u _ hinc _ ih => + have hm := inc_mono w + have hu : (inc w).1 = u := congrArg Prod.fst hinc + rw [hu] at hm + omega + +theorem inc_steps_add_inv {p q : Nat} {w v : List Bool} (h : inc_steps (p + q) w v) : + ∃ u, inc_steps p w u ∧ inc_steps q u v := by + induction p generalizing w with + | zero => + rw [Nat.zero_add] at h + exact ⟨w, inc_steps.zero w, h⟩ + | succ p ih => + rw [Nat.succ_add] at h + cases h with + | succ _ _ u _ hinc hs => + rcases ih hs with ⟨mid, hp, hq⟩ + exact ⟨mid, inc_steps.succ p w u mid hinc hp, hq⟩ + +theorem guard_mono {m n : Nat} {w : List Bool} (hm : guard m w) (h : n ≤ m) : guard n w := by + dsimp [guard] at hm ⊢; omega + +theorem guard_two_ones {n : Nat} {w : List Bool} (h : guard (n + 1) w) : + guard n (true :: true :: w) := by + dsimp [guard, gap0, gap1, gap2, plane, zero_bit] at h ⊢; omega + +theorem guard_three_ones {n : Nat} {w : List Bool} (h : guard n w) : + guard n (true :: true :: true :: w) := by + dsimp [guard, gap0, gap1, gap2, plane, zero_bit] at h ⊢; omega + +theorem guard_ones_aux (n k : Nat) (w : List Bool) (h : guard (n + 1) w) : + guard n (List.replicate k true ++ w) := by + match k with + | 0 => exact guard_mono h (by omega) + | 1 => exact guard_one h + | 2 => exact guard_two_ones h + | k + 3 => + have hrep : List.replicate (k + 3) true ++ w = + true :: true :: true :: (List.replicate k true ++ w) := rfl + rw [hrep] + exact guard_three_ones (guard_ones_aux n k w h) + +theorem guard_ones {n : Nat} (k : Nat) {w : List Bool} (hn : 1 ≤ n) (h : guard (n + 1) w) : + guard n (List.replicate k true ++ w) := by + rcases Nat.eq_or_lt_of_le hn with rfl | _ + · exact gap_bounds _ + · exact guard_ones_aux n k w h + +theorem inc_guard (n : Nat) (w : List Bool) (hn : 1 ≤ n) (hg : guard (n + 1) w) : + (inc w).2 = false ∧ guard n (inc w).1 := by + have hm := inc_mono w + have hi : 1 < gap0 w := by dsimp [guard] at hg; omega + rcases inc_interior w hi with ⟨he, _, hg0⟩ + refine ⟨he, ?_⟩ + dsimp [guard] at hg ⊢ + omega + +theorem width_length (k p : Nat) (w : List Bool) (hp : p ≤ 2) (hl : w.length = 3 * k + p) : + width w = k + (if p = 2 then 1 else 0) := by + induction k generalizing w with + | zero => + rcases w with _ | ⟨a, _ | ⟨b, _ | ⟨c, w⟩⟩⟩ <;> dsimp [width] <;> simp at hl <;> split_ifs <;> omega + | succ k ih => + rcases w with _ | ⟨a, _ | ⟨b, _ | ⟨c, w⟩⟩⟩ + · simp at hl; omega + · simp at hl; omega + · simp at hl; omega + · dsimp [width] + have hl' : w.length = 3 * k + p := by simp at hl; omega + rw [ih w hl'] + omega + +theorem plane_zeros (n i : Nat) : plane bit_value i (List.replicate n false) = 0 := by + induction n generalizing i with + | zero => cases i <;> rfl + | succ n ih => + cases i with + | zero => dsimp [List.replicate_succ, plane, bit_value]; rw [ih 2] + | succ j => dsimp [List.replicate_succ, plane]; exact ih j + +theorem value_zeros (n : Nat) : value (List.replicate n false) = 0 := + plane_zeros n 1 + +theorem width_zeros (k p : Nat) (hp : p ≤ 2) : + width (List.replicate (3 * k + p) false) = k + (if p = 2 then 1 else 0) := + width_length k p _ hp List.length_replicate + +theorem gap0_zeros (k p : Nat) (hp : p ≤ 2) : + gap0 (List.replicate (3 * k + p) false) = 2 ^ (k + (if p = 2 then 1 else 0)) := by + have h := value_gap0 (List.replicate (3 * k + p) false) + rw [value_zeros, width_zeros k p hp, Nat.zero_add] at h + exact h + +theorem inc_at_capacity (k p : Nat) (w : List Bool) (hp : p ≤ 2) (hl : w.length = 3 * k + p) + (hg : gap0 w = 1) : + inc w = if p = 0 then (List.replicate (3 * k + 1) false, false) + else (List.replicate (3 * k + 2) false, true) := by + induction k generalizing w with + | zero => + rcases w with _ | ⟨a, _ | ⟨b, _ | ⟨c, w⟩⟩⟩ + · have hp0 : p = 0 := by simp at hl; omega + subst hp0; rfl + · have hp1 : p = 1 := by simp at hl; omega + subst hp1; rfl + · have hp2 : p = 2 := by simp at hl; omega + subst hp2 + cases b + · dsimp [gap0, plane, zero_bit] at hg; omega + · rfl + · simp at hl; omega + | succ k ih => + rcases w with _ | ⟨a, _ | ⟨b, _ | ⟨c, w⟩⟩⟩ + · simp at hl; omega + · simp at hl; omega + · simp at hl; omega + · have hb : b = true ∧ gap0 w = 1 := by + cases b <;> dsimp [gap0, plane, zero_bit] at hg ⊢ + · omega + · exact ⟨rfl, by omega⟩ + rcases hb with ⟨rfl, hg'⟩ + have hl' : w.length = 3 * k + p := by simp at hl; omega + have ihw := ih w hl' hg' + dsimp [inc] + rw [ihw] + split_ifs with hp0 + · have hrep : List.replicate (3 * (k + 1) + 1) false = + false :: false :: false :: List.replicate (3 * k + 1) false := by + rw [show 3 * (k + 1) + 1 = 3 + (3 * k + 1) by omega, List.replicate_add]; rfl + rw [hrep] + · have hrep : List.replicate (3 * (k + 1) + 2) false = + false :: false :: false :: List.replicate (3 * k + 2) false := by + rw [show 3 * (k + 1) + 2 = 3 + (3 * k + 2) by omega, List.replicate_add]; rfl + rw [hrep] + +theorem overflow12 (k p : Nat) (w : List Bool) (hp1 : 1 ≤ p) (hp2 : p ≤ 2) + (hl : w.length = 3 * k + p) (hg : gap0 w = 1) : + inc w = (List.replicate (3 * k + 2) false, true) := by + have h := inc_at_capacity k p w hp2 hl hg + have hp0 : p ≠ 0 := by omega + simpa [hp0] using h + +theorem first_capacity (k p : Nat) (w : List Bool) (hp : p ≤ 2) (hl : w.length = 3 * k + p) : + ∃ u, inc_steps (gap0 w - 1) w u ∧ u.length = w.length ∧ gap0 u = 1 ∧ + inc u = (if p = 0 then (List.replicate (3 * k + 1) false, false) + else (List.replicate (3 * k + 2) false, true)) := by + have hb := (gap_bounds w).1 + rcases inc_steps_interior (gap0 w - 1) w (by omega) with ⟨u, hs, hlen, hgap⟩ + have hu : gap0 u = 1 := by omega + exact ⟨u, hs, hlen, hu, inc_at_capacity k p u hp (by omega) hu⟩ + +theorem inc_markers_mono (w : List Bool) : + plane bit_value 0 (inc w).1 ≤ plane bit_value 0 w ∧ + plane bit_value 2 (inc w).1 ≤ plane bit_value 2 w := by + match w with + | [] => dsimp [inc, plane, bit_value]; omega + | [a] => cases a <;> dsimp [inc, plane, bit_value] <;> omega + | a :: false :: u => cases a <;> dsimp [inc, plane, bit_value] <;> omega + | [a, true] => cases a <;> dsimp [inc, plane, bit_value] <;> omega + | a :: true :: c :: u => + have ih := inc_markers_mono u + cases a <;> cases c <;> dsimp [inc, plane, bit_value] at ih ⊢ <;> omega + +theorem inc_steps_markers_zero {q : Nat} {w v : List Bool} (hs : inc_steps q w v) + (h0 : plane bit_value 0 w = 0) (h2 : plane bit_value 2 w = 0) : + plane bit_value 0 v = 0 ∧ plane bit_value 2 v = 0 := by + induction hs with + | zero => exact ⟨h0, h2⟩ + | succ _ w u _ hinc _ ih => + have hm := inc_markers_mono w + have hu : (inc w).1 = u := congrArg Prod.fst hinc + rw [hu] at hm + exact ih (by omega) (by omega) + +theorem marker_gaps (k : Nat) (w : List Bool) (hl : w.length = 3 * k + 2) + (h0 : plane bit_value 0 w = 0) (h2 : plane bit_value 2 w = 0) : + gap1 w = 2 ^ (k + 1) ∧ gap2 w = 2 ^ (k + 1) := by + induction k generalizing w with + | zero => + rcases w with _ | ⟨a, _ | ⟨b, _ | ⟨c, w⟩⟩⟩ + · simp at hl + · simp at hl + · cases a + · exact ⟨rfl, rfl⟩ + · dsimp [plane, bit_value] at h0; omega + · simp at hl + | succ k ih => + rcases w with _ | ⟨a, _ | ⟨b, _ | ⟨c, w⟩⟩⟩ + · simp at hl + · simp at hl + · simp at hl + · have ha : a = false ∧ c = false ∧ plane bit_value 0 w = 0 ∧ plane bit_value 2 w = 0 := by + cases a <;> cases c <;> dsimp [plane, bit_value] at h0 h2 + · exact ⟨rfl, rfl, by omega, by omega⟩ + · omega + · omega + · omega + rcases ha with ⟨rfl, rfl, hw0, hw2⟩ + have hl' : w.length = 3 * k + 2 := by simp at hl; omega + rcases ih w hl' hw0 hw2 with ⟨hg1, hg2⟩ + dsimp [gap1, gap2, plane, zero_bit] at hg1 hg2 ⊢ + rw [show k + 1 + 1 = (k + 1) + 1 by omega, Nat.pow_succ] + omega + +theorem zero2_gaps (k : Nat) : + gap0 (List.replicate (3 * k + 2) false) = 2 ^ (k + 1) ∧ + gap1 (List.replicate (3 * k + 2) false) = 2 ^ (k + 1) ∧ + gap2 (List.replicate (3 * k + 2) false) = 2 ^ (k + 1) := by + refine ⟨?_, marker_gaps k _ List.length_replicate (plane_zeros _ _) (plane_zeros _ _)⟩ + simpa using gap0_zeros k 2 (by omega) + +theorem zero3_gaps (k : Nat) : + gap0 (List.replicate (3 * k + 3) false) = 2 ^ (k + 1) ∧ + gap1 (List.replicate (3 * k + 3) false) = 2 ^ (k + 1) ∧ + gap2 (List.replicate (3 * k + 3) false) = 2 ^ (k + 2) := by + have hrep : List.replicate (3 * k + 3) false = false :: List.replicate (3 * k + 2) false := by + rw [show 3 * k + 3 = (3 * k + 2) + 1 by omega, List.replicate_succ] + rw [hrep] + have hz2 := zero2_gaps k + have hc := gap_cons false (List.replicate (3 * k + 2) false) + dsimp [bit_value] at hc + rw [show k + 2 = (k + 1) + 1 by omega, Nat.pow_succ] + omega + +theorem strong (k z : Nat) (w : List Bool) (hl : w.length = 3 * k + 2) + (h0 : plane bit_value 0 w = 0) (h2 : plane bit_value 2 w = 0) + (hv : value w = 2 ^ (z + 1) - 2) (hz : z ≤ k) : + guard (2 ^ (k + 1 - z)) (List.replicate (2 * z) true ++ false :: w) := by + rcases marker_gaps k w hl h0 h2 with ⟨hg1, hg2⟩ + have hsum := value_gap0 w + have hw := width_length k 2 w (by omega) hl + simp at hw + rw [hw, hv] at hsum + have hpz0 := pow2_pos z + have hpz : 2 ≤ 2 ^ (z + 1) := by rw [Nat.pow_succ]; omega + have hg : gap0 w + 2 ^ (z + 1) = 2 ^ (k + 1) + 2 := by omega + have hc := gap_cons false w + dsimp [bit_value] at hc + rcases Nat.eq_zero_or_pos z with rfl | hz0 + · simp only [Nat.mul_zero, List.replicate_zero, List.nil_append, Nat.sub_zero] + dsimp [guard] + have hpow1 : 2 ^ (0 + 1) = 2 := rfl + rw [hpow1] at hg + omega + · refine guard_ones (2 * z) (pow2_pos (k + 1 - z)) ?_ + have hb : 2 * 2 ^ (k + 1 - z) ≤ 2 ^ (k + 1) := by + have h1 : 2 * 2 ^ (k + 1 - z) = 2 ^ (k + 1 - z + 1) := by rw [Nat.pow_succ]; ring + rw [h1] + exact Nat.pow_le_pow_right (by omega) (by omega) + have hp := pow2_pos (k + 1 - z) + have hg0 : 2 ^ (k + 1 - z) + 1 ≤ 2 * gap0 w := by + rcases Nat.eq_or_lt_of_le hz with rfl | hlt + · rw [show z + 1 - z = 1 by omega] + omega + · have ht : 2 * 2 ^ (z + 1) ≤ 2 ^ (k + 1) := by + have h1 : 2 * 2 ^ (z + 1) = 2 ^ (z + 1 + 1) := by rw [Nat.pow_succ]; ring + rw [h1] + exact Nat.pow_le_pow_right (by omega) (by omega) + omega + dsimp [guard] + omega + +theorem entry (k z : Nat) (hz : z ≤ k) : + ∃ w, inc_steps (2 ^ (z + 1) - 2) (List.replicate (3 * k + 2) false) w ∧ + guard (2 ^ (k + 1 - z)) (List.replicate (2 * z) true ++ false :: w) := by + have hg := (zero2_gaps k).1 + have hpz0 := pow2_pos z + have hp : 2 ≤ 2 ^ (z + 1) := by rw [Nat.pow_succ]; omega + have hc : 2 ^ (z + 1) ≤ 2 ^ (k + 1) := Nat.pow_le_pow_right (by omega) (by omega) + rcases inc_steps_interior (2 ^ (z + 1) - 2) (List.replicate (3 * k + 2) false) (by omega) + with ⟨w, hs, hl, hw⟩ + rw [List.length_replicate] at hl + rcases inc_steps_markers_zero hs (plane_zeros _ _) (plane_zeros _ _) with ⟨h0, h2⟩ + refine ⟨w, hs, strong k z w hl h0 h2 ?_ hz⟩ + have hv := value_gap0 w + have hwidth := width_length k 2 w (by omega) hl + simp at hwidth + rw [hwidth] at hv + omega + +theorem entry_actual (k z h : Nat) (hz : z ≤ k) (ht : 2 ^ z * (1 + 2 * h) ≤ 2 ^ (k + 1)) : + ∃ w, inc_steps (2 ^ (z + 1) - 2) (List.replicate (3 * k + 2) false) w ∧ + guard (2 * h) (List.replicate (2 * z) true ++ false :: w) := by + rcases entry k z hz with ⟨w, hs, hg⟩ + have he : 2 ^ (k + 1 - z) * 2 ^ z = 2 ^ (k + 1) := by + rw [← Nat.pow_add, show k + 1 - z + z = k + 1 by omega] + have hp := pow2_pos z + have hle : 2 * h ≤ 2 ^ (k + 1 - z) := by + rcases Nat.lt_or_ge (2 ^ (k + 1 - z)) (2 * h) with hlt | hge + · have : 2 ^ z * (2 ^ (k + 1 - z) + 1) ≤ 2 ^ z * (1 + 2 * h) := + Nat.mul_le_mul_left _ (by omega) + have : 2 ^ z * (2 ^ (k + 1 - z) + 1) = 2 ^ (k + 1) + 2 ^ z := by + rw [ ← he ]; ring + omega + · exact hge + exact ⟨w, hs, guard_mono hg hle⟩ + +-- ============================================================================ +-- Section 5: A3Right, A3Entry, A3Region, A3Closure & Full Non-Halting Closure +-- ============================================================================ + +theorem right_step {w v : List Bool} {e : Bool} {n : Nat} {r : ListBlank (Fin 2)} + (he : inc w = (v, e)) (hr : RC rd1 n r) : + ∃ s, RC rd1 (n + 1) s ∧ (Conf w r) [target_tm]⊢⁺ (Conf v (insert e s)) := by + rcases RC_carry hr with ⟨k, s, rfl, hs⟩ + refine ⟨rd0 ^ k +> (rd1 +> s), hs, ?_⟩ + have h := RZero w ([0, 0, 0] +> s) k + rw [he] at h + exact h + +theorem finite_step {w v : List Bool} {n : Nat} {r tail : ListBlank (Fin 2)} {k : Nat} + (he : inc w = (v, false)) (hr : FC rd1 tail k n r) (hb : n + 1 < 2 ^ k) : + ∃ s, FC rd1 tail k (n + 1) s ∧ (Conf w r) [target_tm]⊢⁺ (Conf v s) := by + rcases FC_carry hr hb with ⟨j, s, _, rfl, hs⟩ + refine ⟨rd0 ^ j +> (rd1 +> s), hs, ?_⟩ + have h := RZero w ([0, 0, 0] +> s) j + rw [he] at h + exact h + +theorem right_steps {q : Nat} {w v : List Bool} {n : Nat} {r : ListBlank (Fin 2)} + (hs : inc_steps q w v) (hr : RC rd1 n r) : + ∃ s, RC rd1 (n + q) s ∧ (Conf w r) [target_tm]⊢* (Conf v s) := by + induction hs generalizing n r with + | zero w => + exact ⟨r, RC_eq hr (by omega) rfl, stepStar_refl _⟩ + | succ q w u v hinc _ ih => + rcases right_step hinc hr with ⟨s, hs1, hS1⟩ + rcases ih hs1 with ⟨s', hs2, hS2⟩ + exact ⟨s', RC_eq hs2 (by omega) rfl, stepStar_trans (stepPlus_to_stepStar hS1) hS2⟩ + +theorem finite_steps {q : Nat} {w v : List Bool} {n : Nat} {r tail : ListBlank (Fin 2)} {k : Nat} + (hs : inc_steps q w v) (hr : FC rd1 tail k n r) (hb : n + q < 2 ^ k) : + ∃ s, FC rd1 tail k (n + q) s ∧ (Conf w r) [target_tm]⊢* (Conf v s) := by + induction hs generalizing n r with + | zero w => + exact ⟨r, FC_eq hr rfl (by omega) rfl, stepStar_refl _⟩ + | succ q w u v hinc _ ih => + rcases finite_step hinc hr (by omega) with ⟨s, hs1, hS1⟩ + rcases ih hs1 (by omega) with ⟨s', hs2, hS2⟩ + exact ⟨s', FC_eq hs2 rfl (by omega) rfl, stepStar_trans (stepPlus_to_stepStar hS1) hS2⟩ + +theorem shifted_prefix (n : Nat) {w v : List Bool} (r : ListBlank (Fin 2)) + (h : inc_steps (2 ^ (1 + n) - 1) w v) : + (Conf w (rd0 ^ n +> (rds +> r))) [target_tm]⊢⁺ + (Conf v (rd1 ^ n +> ([1, 0, 0, 1] +> r))) := by + have hp := pow2_pos n + have hsplit : 2 ^ (1 + n) - 1 = (2 ^ n - 1) + (1 + (2 ^ n - 1)) := by + rw [Nat.add_comm 1 n, Nat.pow_succ]; omega + rw [hsplit] at h + rcases inc_steps_add_inv h with ⟨u, hwu, huv⟩ + rw [Nat.add_comm 1 (2 ^ n - 1)] at huv + cases huv with + | succ _ _ u1 _ hinc hu1v => + rcases finite_steps hwu (FC_zero rd1 (rds +> r) n) (by omega) with ⟨s1, hs1, hS1⟩ + have hs1_eq : s1 = rd1 ^ n +> (rds +> r) := FC_full_unique (FC_eq hs1 rfl (by omega) rfl) + subst hs1_eq + rcases finite_steps hu1v (FC_zero rd1 ([1, 0, 0, 1] +> r) n) (by omega) with ⟨s2, hs2, hS2⟩ + have hs2_eq : s2 = rd1 ^ n +> ([1, 0, 0, 1] +> r) := FC_full_unique (FC_eq hs2 rfl (by omega) rfl) + subst hs2_eq + have hm := RZero u ([0, 0, 1] +> r) n + rw [hinc] at hm + have heq1 : rd1 ^ n +> (rds +> r) = rd1 ^ n +> ([0] +> ([0, 0, 1] +> r)) := rfl + have heq2 : insert false (rd0 ^ n +> ([1] +> ([0, 0, 1] +> r))) = + rd0 ^ n +> ([1, 0, 0, 1] +> r) := rfl + rw [heq1] at hS1 + rw [heq2] at hm + exact stepStar_stepPlus_trans hS1 (stepPlus_stepStar_trans hm hS2) + +theorem one_cross (z : Nat) {w v : List Bool} (r : ListBlank (Fin 2)) + (hz : 1 ≤ z) (h : inc_steps (2 ^ z - 1) w v) : + (Conf w ([1] +> (rd0 ^ z +> (rd1 +> r)))) [target_tm]⊢⁺ + (Conf v (rd0 ^ z +> ([1, 1, 0, 0, 0] +> r))) := by + cases z with + | zero => omega + | succ t => + have hp0 := pow2_pos t + have hp : 2 ≤ 2 ^ (t + 1) := by rw [Nat.pow_succ]; omega + have hsplit : 2 ^ (t + 1) - 1 = (2 ^ (t + 1) - 2) + 1 := by omega + rw [hsplit] at h + rcases inc_steps_add_inv h with ⟨u, hw, hu⟩ + cases hu with + | succ _ _ mid _ hinc hlast => + cases hlast + rcases finite_steps hw (FC_leading_one t r) (by omega) with ⟨s, hs, hS⟩ + have hs_eq : s = rd1 ^ (t + 1) +> ([0] +> (rd1 +> r)) := + FC_full_unique (FC_eq hs rfl (by omega) rfl) + subst hs_eq + have hc := RZero u (rd1 +> r) (t + 1) + rw [hinc] at hc + exact stepStar_stepPlus_trans hS hc + +theorem prefix_steps (z : Nat) {w v : List Bool} (r : ListBlank (Fin 2)) + (h : inc_steps (2 ^ (z + 1) - 2) w v) : + (Conf w ([1] +> (rd0 ^ z +> (rd1 +> r)))) [target_tm]⊢* + (Conf v (rd1 ^ z +> ([1, 1, 0, 0, 0] +> r))) := by + cases z with + | zero => + cases h + try exact stepStar_refl _ + | succ t => + have hp0 := pow2_pos (t + 1) + have hsplit : 2 ^ (t + 1 + 1) - 2 = (2 ^ (t + 1) - 1) + (2 ^ (t + 1) - 1) := by + rw [Nat.pow_succ]; omega + rw [hsplit] at h + rcases inc_steps_add_inv h with ⟨u, hw, hv⟩ + rcases finite_steps hv (FC_zero rd1 ([1, 1, 0, 0, 0] +> r) (t + 1)) (by omega) with ⟨s, hs, hS⟩ + have hs_eq : s = rd1 ^ (t + 1) +> ([1, 1, 0, 0, 0] +> r) := + FC_full_unique (FC_eq hs rfl (by omega) rfl) + subst hs_eq + exact stepStar_trans (stepPlus_to_stepStar (one_cross (t + 1) r (by omega) hw)) hS + +theorem eleven_word (z : Nat) (w : List Bool) (r : ListBlank (Fin 2)) : + (Conf w (rd1 ^ z +> ([1, 1] +> r))) [target_tm]⊢⁺ + (Conf (List.replicate (2 * z) true ++ false :: w) r) := by + have h := REleven (data w) r z + have hdata : data (List.replicate (2 * z) true ++ false :: w) = + data w <+ [0, 1] <+ ([1, 1] : List (Fin 2)) ^ (z * 2) := by + rw [data_ones, Nat.mul_comm 2 z]; rfl + simpa [Conf, hdata] using h + +theorem ordinary (z : Nat) {w v : List Bool} (r : ListBlank (Fin 2)) + (h : inc_steps (2 ^ (z + 1) - 2) w v) : + (Conf w ([1] +> (rd0 ^ z +> (rd1 +> r)))) [target_tm]⊢⁺ + (Conf (List.replicate (2 * z) true ++ false :: v) ([0, 0, 0] +> r)) := + stepStar_stepPlus_trans (prefix_steps z r h) (eleven_word z v ([0, 0, 0] +> r)) + +theorem phase1_zero_gap (k : Nat) : gap0 (List.replicate (3 * k + 1) false) = 2 ^ k := by + simpa using gap0_zeros k 1 (by omega) + +theorem phase12 (k p : Nat) (w : List Bool) (x : Nat) (r : ListBlank (Fin 2)) + (hp1 : 1 ≤ p) (hp2 : p ≤ 2) (hl : w.length = 3 * k + p) (hr : RC rd1 x r) : + ∃ s, RC rd1 (x + gap0 w) s ∧ + (Conf w r) [target_tm]⊢⁺ (Conf (List.replicate (3 * k + 2) false) ([1] +> s)) := by + rcases first_capacity k p w hp2 hl with ⟨u, hs, _, _, he⟩ + have hp0 : p ≠ 0 := by omega + simp [hp0] at he + rcases right_steps hs hr with ⟨s1, hr1, hR1⟩ + rcases right_step he hr1 with ⟨s2, hr2, hR2⟩ + have hb := (gap_bounds w).1 + exact ⟨s2, RC_eq hr2 (by omega) rfl, stepStar_stepPlus_trans hR1 hR2⟩ + +theorem phase0_extend (k : Nat) (w : List Bool) (x : Nat) (r : ListBlank (Fin 2)) + (hl : w.length = 3 * k) (hr : RC rd1 x r) : + ∃ s, RC rd1 (x + gap0 w) s ∧ + (Conf w r) [target_tm]⊢⁺ (Conf (List.replicate (3 * k + 1) false) s) := by + rcases first_capacity k 0 w (by omega) (by omega) with ⟨u, hs, _, _, he⟩ + simp at he + rcases right_steps hs hr with ⟨s1, hr1, hR1⟩ + rcases right_step he hr1 with ⟨s2, hr2, hR2⟩ + have hb := (gap_bounds w).1 + exact ⟨s2, RC_eq hr2 (by omega) rfl, stepStar_stepPlus_trans hR1 hR2⟩ + +theorem phase0 (k : Nat) (w : List Bool) (x : Nat) (r : ListBlank (Fin 2)) + (hl : w.length = 3 * k) (hr : RC rd1 x r) : + ∃ s, RC rd1 (x + gap0 w + 2 ^ k) s ∧ + (Conf w r) [target_tm]⊢⁺ (Conf (List.replicate (3 * k + 2) false) ([1] +> s)) := by + rcases phase0_extend k w x r hl hr with ⟨s1, hr1, hS1⟩ + rcases phase12 k 1 (List.replicate (3 * k + 1) false) (x + gap0 w) s1 + (by omega) (by omega) List.length_replicate hr1 with ⟨s2, hr2, hS2⟩ + rw [phase1_zero_gap] at hr2 + exact ⟨s2, hr2, stepPlus_trans hS1 hS2⟩ + +inductive Allowed : Cfg (Fin 2) (Fin 6) → Prop + | Blank (w : List Bool) : Allowed (Conf w default) + | One (w : List Bool) : Allowed (Conf (false :: false :: w) ([1] +> default)) + | Shifted (w : List Bool) (n : Nat) (r : ListBlank (Fin 2)) : + 0 < n → RC rds n r → guard (2 * n) w → Allowed (Conf w r) + +theorem last_signal (n : Nat) (w : List Bool) (b : Bool) : + ∃ c', Allowed c' ∧ (Conf w (rd1 ^ n +> ([1, 0, 0, 1] +> insert b default))) [target_tm]⊢⁺ c' := by + have hs := R1001 w (insert b default) n + dsimp only at hs + rcases inc_head (List.replicate (2 * n) true ++ false :: w) with ⟨u, hu⟩ + rw [hu] at hs + cases b <;> cases h2 : (inc (List.replicate (2 * n) true ++ false :: w)).2 <;> + rw [h2] at hs <;> simp only [insert_false, insert_true] at hs + · exact ⟨Conf (false :: false :: u) default, Allowed.Blank _, hs⟩ + · exact ⟨Conf (false :: false :: u) ([1] +> default), Allowed.One u, hs⟩ + · exact ⟨Conf (false :: false :: u) ([1] +> default), Allowed.One u, hs⟩ + · exact ⟨Conf (false :: false :: false :: u) default, Allowed.Blank _, + stepPlus_trans hs (eleven_word 0 (false :: false :: u) default)⟩ + +theorem last_shift (n : Nat) (w : List Bool) (b : Bool) (hg : 2 ^ (1 + n) ≤ gap0 w) : + ∃ c', Allowed c' ∧ (Conf w (rd0 ^ n +> (rds +> insert b default))) [target_tm]⊢⁺ c' := by + have hp := pow2_pos (1 + n) + rcases inc_steps_interior (2 ^ (1 + n) - 1) w (by omega) with ⟨v, hv, _⟩ + rcases last_signal n v b with ⟨c', hA, hS⟩ + exact ⟨c', hA, stepPlus_trans (shifted_prefix n (insert b default) hv) hS⟩ + +theorem shifted_step (n : Nat) (w : List Bool) (r : ListBlank (Fin 2)) + (hn : 0 < n) (hr : RC rds n r) (hg : guard (2 * n) w) : + ∃ c', Allowed c' ∧ (Conf w r) [target_tm]⊢⁺ c' := by + rcases RC_positive_split hr hn with ⟨t, q, s, rfl, hs, hen, _⟩ + rw [hen] at hg + cases q with + | zero => + rw [RC_zero_unique hs] + refine last_shift t w false ?_ + dsimp [guard] at hg + rw [Nat.add_comm 1 t, Nat.pow_succ] + omega + | succ q => + have hp := pow2_pos t + have hpow : 2 ^ (1 + t) = 2 * 2 ^ t := by rw [Nat.add_comm 1 t, Nat.pow_succ]; ring + have hp1 : 2 ≤ 2 ^ (1 + t) := by rw [hpow]; omega + have hmul : 2 * (2 ^ t * (1 + (q + 1) * 2)) = 2 ^ (1 + t) + 2 ^ (1 + t) * (2 * (q + 1)) := by + rw [hpow]; ring + have hge2 : 2 * (2 * (q + 1)) ≤ 2 ^ (1 + t) * (2 * (q + 1)) := + Nat.mul_le_mul_right (2 * (q + 1)) hp1 + have hq : 2 ^ (1 + t) - 1 < gap0 w := by + dsimp [guard] at hg; omega + rcases inc_steps_interior (2 ^ (1 + t) - 1) w hq with ⟨v, hv, _, hd⟩ + have hm := inc_steps_mono hv + have hvg : guard (2 * (q + 1) + 2) v := by + dsimp [guard] at hg hm ⊢ + have hg0 : 2 * (2 ^ t * (1 + (q + 1) * 2)) ≤ gap0 w := hg.1 + have hg1 : 2 * (2 ^ t * (1 + (q + 1) * 2)) ≤ gap1 w := hg.2.1 + have hg2 : 2 * (2 ^ t * (1 + (q + 1) * 2)) ≤ gap2 w := hg.2.2 + rw [hmul] at hg0 hg1 hg2 + omega + have hu : guard (2 * (q + 1) + 1) (List.replicate (2 * t) true ++ false :: v) := + guard_ones (2 * t) (by omega) (guard_zero (guard_mono hvg (by omega))) + rcases inc_guard (2 * (q + 1)) (List.replicate (2 * t) true ++ false :: v) (by omega) hu + with ⟨he, hu'⟩ + refine ⟨Conf (false :: (inc (List.replicate (2 * t) true ++ false :: v)).1) s, + Allowed.Shifted _ (q + 1) s (by omega) hs (guard_zero hu'), ?_⟩ + have hs1 := shifted_prefix t s hv + have hs2 := R1001 v s t + dsimp only at hs2 + rw [he, insert_false] at hs2 + exact stepPlus_trans hs1 hs2 + +theorem RC_power (a : Nat) : RC rd1 (2 ^ a) (rd0 ^ a +> (rd1 +> default)) := by + have h1 : RC rd1 1 (rd1 +> default) := RC_eq (RC.d1 0 default RC.zero) (by omega) rfl + exact RC_eq (RC_zeros a h1) (by omega) rfl + +theorem exceptional (k : Nat) {r : ListBlank (Fin 2)} (hr : RC rd1 (2 ^ (k + 1)) r) : + ∃ c', Allowed c' ∧ (Conf (List.replicate (3 * k + 2) false) ([1] +> r)) [target_tm]⊢⁺ c' := by + have hr_eq : r = rd0 ^ (k + 1) +> (rd1 +> default) := RC_unique hr (RC_power (k + 1)) + subst hr_eq + have hg := (zero2_gaps k).1 + have hp := pow2_pos (k + 1) + rcases inc_steps_interior (2 ^ (k + 1) - 1) (List.replicate (3 * k + 2) false) (by omega) + with ⟨v, hv, hl, hd⟩ + rw [List.length_replicate] at hl + have hei : inc v = (List.replicate (3 * k + 2) false, true) := + overflow12 k 2 v (by omega) (by omega) hl (by omega) + have hb : 2 ^ (1 + k) ≤ gap0 (List.replicate (3 * k + 3) false) := by + rw [(zero3_gaps k).1, Nat.add_comm 1 k] + rcases last_shift k (List.replicate (3 * k + 3) false) true hb with ⟨c', hA, hS⟩ + refine ⟨c', hA, ?_⟩ + have s1 := one_cross (k + 1) default (by omega) hv + have s2 := RZero v ([0, 0, 0] +> (rd0 ^ k +> ([1, 1] +> default))) 0 + rw [hei] at s2 + dsimp only at s2 + have heq2 : rd0 ^ (k + 1) +> ([1, 1, 0, 0, 0] +> (default : ListBlank (Fin 2))) = + rd1 ^ 0 +> ([0] +> ([0, 0, 0] +> (rd0 ^ k +> ([1, 1] +> default)))) := by + rw [right_pow_succ rd0 k ([1, 1, 0, 0, 0] +> default)] + simp [rd0] + rw [heq2] at s1 + have heq3 : insert true (rd0 ^ 0 +> ([1] +> ([0, 0, 0] +> (rd0 ^ k +> ([1, 1] +> default))))) = + rd1 ^ 0 +> ([1, 1] +> (rd0 ^ k +> (rds +> insert true default))) := by + change [1, 1] +> (([0, 0, 0] : List (Fin 2)) +> (rd0 ^ k +> ([1, 1] +> default))) = + [1, 1] +> (rd0 ^ k +> (rds +> insert true default)) + rw [zero3_rd0 k ([1, 1] +> default)] + rfl + rw [heq3] at s2 + have s3 := eleven_word 0 (List.replicate (3 * k + 2) false) + (rd0 ^ k +> (rds +> insert true default)) + have hrep : List.replicate (2 * 0) true ++ false :: List.replicate (3 * k + 2) false = + List.replicate (3 * k + 3) false := by + rw [show 3 * k + 3 = (3 * k + 2) + 1 by omega, List.replicate_succ] + rfl + rw [hrep] at s3 + exact stepPlus_trans s1 (stepPlus_trans s2 (stepPlus_trans s3 hS)) + +theorem post_first (k T : Nat) {r : ListBlank (Fin 2)} + (hr : RC rd1 T r) (ht : 0 < T) (hb : T ≤ 2 ^ (k + 1)) : + ∃ c', Allowed c' ∧ (Conf (List.replicate (3 * k + 2) false) ([1] +> r)) [target_tm]⊢⁺ c' := by + rcases Nat.eq_or_lt_of_le hb with rfl | hlt + · exact exceptional k hr + · rcases RC_positive_split hr ht with ⟨z, h, s, rfl, hs, het, _⟩ + have hz : z ≤ k := by + rcases Nat.lt_or_ge k z with hgt | hle + · have hp : 2 ^ (k + 1) ≤ 2 ^ z := Nat.pow_le_pow_right (by omega) hgt + have : 2 ^ z * 1 ≤ 2 ^ z * (1 + h * 2) := Nat.mul_le_mul_left _ (by omega) + omega + · exact hle + have hmul : 2 ^ z * (1 + 2 * h) ≤ 2 ^ (k + 1) := by + rw [Nat.mul_comm 2 h]; omega + rcases entry_actual k z h hz hmul with ⟨w, hw, hg⟩ + refine ⟨Conf (List.replicate (2 * z) true ++ false :: w) ([0, 0, 0] +> s), ?_, + ordinary z s hw⟩ + cases h with + | zero => + rw [RC_zero_unique hs, three_zeros_append_default] + exact Allowed.Blank _ + | succ h => + exact Allowed.Shifted _ (h + 1) ([0, 0, 0] +> s) (by omega) (RC_shift3 hs) hg + +theorem RC_odd_inv {h : Nat} {r : ListBlank (Fin 2)} (hr : RC rd1 (1 + 2 * h) r) : + ∃ s, RC rd1 h s ∧ r = rd1 +> s := by + have hr' : RC rd1 (1 + h * 2) r := RC_eq hr (by omega) rfl + rcases RC_inv_d1 hr' with ⟨s, rfl, hs⟩ + exact ⟨s, hs, rfl⟩ + +theorem odd_entry (k h : Nat) {r : ListBlank (Fin 2)} + (hr : RC rd1 (1 + 2 * h) r) (hb : 2 * h ≤ 2 ^ (k + 1)) : + ∃ c', Allowed c' ∧ (Conf (List.replicate (3 * k + 2) false) ([1] +> r)) [target_tm]⊢⁺ c' := by + rcases RC_odd_inv hr with ⟨s, hs, rfl⟩ + have h11 : ([1] : List (Fin 2)) +> (rd1 +> s) = rd1 ^ 0 +> ([1, 1] +> ([0, 0, 0] +> s)) := rfl + rw [h11] + refine ⟨Conf (false :: List.replicate (3 * k + 2) false) ([0, 0, 0] +> s), ?_, + eleven_word 0 (List.replicate (3 * k + 2) false) ([0, 0, 0] +> s)⟩ + cases h with + | zero => + rw [RC_zero_unique hs, three_zeros_append_default] + exact Allowed.Blank _ + | succ h => + refine Allowed.Shifted _ (h + 1) ([0, 0, 0] +> s) (by omega) (RC_shift3 hs) ?_ + have hg := zero3_gaps k + have hrep : List.replicate (3 * k + 3) false = false :: List.replicate (3 * k + 2) false := by + rw [show 3 * k + 3 = (3 * k + 2) + 1 by omega, List.replicate_succ] + rw [hrep, show k + 2 = (k + 1) + 1 by omega, Nat.pow_succ] at hg + dsimp [guard] + omega + +theorem length_split (w : List Bool) : ∃ k p, p ≤ 2 ∧ w.length = 3 * k + p := + ⟨w.length / 3, w.length % 3, by omega, by omega⟩ + +theorem capacity_bound (k p : Nat) (w : List Bool) (hp : p ≤ 2) (hl : w.length = 3 * k + p) : + gap0 w ≤ 2 ^ (k + (if p = 2 then 1 else 0)) := by + have h := value_gap0 w + rw [width_length k p w hp hl] at h + omega + +theorem pow_twice (k : Nat) : 2 ^ (k + 1) = 2 * 2 ^ k := by + rw [Nat.pow_succ]; ring + +theorem right_one : RC rd1 1 ([1] +> default) := by + have h0 : RC rd1 1 (rd1 +> default) := RC_eq (RC.d1 0 default RC.zero) (by omega) rfl + have heq : rd1 +> (default : ListBlank (Fin 2)) = [1] +> default := by simp [rd1] + rwa [heq] at h0 + +theorem blank_step (w : List Bool) : + ∃ c', Allowed c' ∧ (Conf w default) [target_tm]⊢⁺ c' := by + rcases length_split w with ⟨k, p, hp, hl⟩ + have hb := capacity_bound k p w hp hl + have hg := (gap_bounds w).1 + rcases Nat.eq_zero_or_pos p with rfl | hp_pos + · simp at hl hb + rcases phase0 k w 0 default hl RC.zero with ⟨s, hr, hS⟩ + have hle : 0 + gap0 w + 2 ^ k ≤ 2 ^ (k + 1) := by rw [pow_twice]; omega + rcases post_first k (0 + gap0 w + 2 ^ k) hr (by omega) hle with ⟨c', hA, hT⟩ + exact ⟨c', hA, stepPlus_trans hS hT⟩ + · have hu : gap0 w ≤ 2 ^ (k + 1) := by + refine Nat.le_trans hb (Nat.pow_le_pow_right (by omega) ?_) + split_ifs <;> omega + rcases phase12 k p w 0 default hp_pos hp hl RC.zero with ⟨s, hr, hS⟩ + rcases post_first k (0 + gap0 w) hr (by omega) (by omega) with ⟨c', hA, hT⟩ + exact ⟨c', hA, stepPlus_trans hS hT⟩ + +theorem one_step (u : List Bool) : + ∃ c', Allowed c' ∧ (Conf (false :: false :: u) ([1] +> default)) [target_tm]⊢⁺ c' := by + set w := false :: false :: u + set a := 1 + plane zero_bit 2 u + have heg : gap0 w = 2 * a := by + dsimp [w, a, gap0, plane, zero_bit]; omega + rcases length_split w with ⟨k, p, hp, hl⟩ + have hb := capacity_bound k p w hp hl + rcases Nat.eq_zero_or_pos p with rfl | hp_pos + · simp at hl hb + have hk : 1 ≤ k := by + have : 2 ≤ w.length := by simp [w] + omega + cases k with + | zero => omega + | succ k => + rcases phase0 (k + 1) w 1 ([1] +> default) hl right_one with ⟨s, hr, hS⟩ + rw [heg] at hr + have hr' : RC rd1 (1 + 2 * (a + 2 ^ k)) s := + RC_eq hr (by rw [pow_twice]; omega) rfl + have hu : 2 * (a + 2 ^ k) ≤ 2 ^ (k + 1 + 1) := by + rw [pow_twice (k + 1)]; omega + rcases odd_entry (k + 1) (a + 2 ^ k) hr' hu with ⟨c', hA, hT⟩ + exact ⟨c', hA, stepPlus_trans hS hT⟩ + · have hu : 2 * a ≤ 2 ^ (k + 1) := by + rw [← heg] + refine Nat.le_trans hb (Nat.pow_le_pow_right (by omega) ?_) + split_ifs <;> omega + rcases phase12 k p w 1 ([1] +> default) hp_pos hp hl right_one with ⟨s, hr, hS⟩ + rw [heg] at hr + rcases odd_entry k a hr hu with ⟨c', hA, hT⟩ + exact ⟨c', hA, stepPlus_trans hS hT⟩ + +theorem Allowed_step {c : Cfg (Fin 2) (Fin 6)} (hA : Allowed c) : + ∃ c', Allowed c' ∧ c [target_tm]⊢⁺ c' := by + cases hA with + | Blank w => exact blank_step w + | One w => exact one_step w + | Shifted w n r hn hr hg => exact shifted_step n w r hn hr hg + +theorem multiStep_none_add {c : Cfg (Fin 2) (Fin 6)} {k : Nat} + (h : multiStep target_tm c k = none) (d : Nat) : + multiStep target_tm c (k + d) = none := by + rw [multiStep_add, h]; rfl + +theorem reach_arbitrarily_long : + ∀ m : Nat, ∃ N c, m ≤ N ∧ Allowed c ∧ multiStep target_tm (init []) N = some c + | 0 => by + rcases init31 with ⟨N₀, hN₀⟩ + exact ⟨N₀, _, Nat.zero_le N₀, Allowed.Blank [false, false], hN₀⟩ + | m + 1 => by + rcases reach_arbitrarily_long m with ⟨N, c, h_le, hc, hN⟩ + rcases Allowed_step hc with ⟨c', hc', k, hk_pos, hk⟩ + exact ⟨N + k, c', by omega, hc', multiStep_trans target_tm _ _ _ N k hN hk⟩ + +end Solution + + + +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg ⟨k, hk⟩ + cases h_step : step target_tm cfg with + | some cfg' => rfl + | none => + have h_none : multiStep target_tm (init []) (k + 1) = none := by + rw [multiStep_succ', hk]; exact h_step + rcases reach_arbitrarily_long (k + 1) with ⟨N, _, h_ge, _, hN⟩ + have h_split : N = (k + 1) + (N - (k + 1)) := by omega + have h_none_N : multiStep target_tm (init []) N = none := by + rw [h_split] + exact multiStep_none_add h_none (N - (k + 1)) + rw [h_none_N] at hN + nomatch hN + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0LE_1RC1LA_1LD1RE_1LB0LD_1RF0RC_1RBHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0LF_0RCHHH_1RD0RA_1LE0RC_0LA0LE_1LE1LB.lean b/BusyBeaver/BB6/NonHalt/M_1RB0LF_0RCHHH_1RD0RA_1LE0RC_0LA0LE_1LE1LB.lean new file mode 100644 index 00000000..a8ff37f9 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0LF_0RCHHH_1RD0RA_1LE0RC_0LA0LE_1LE1LB.lean @@ -0,0 +1,2442 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.Longitudinal + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0LF_0RCHHH_1RD0RA_1LE0RC_0LA0LE_1LE1LB + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LF_0RCHHH_1RD0RA_1LE0RC_0LA0LE_1LE1LB" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem pow_zero_list (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := ListBlank.cons_zero_default +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl +@[simp] theorem init_nil : (init ([] : List (Fin 2))) = (default {{A}}> default) := rfl + +theorem str_app_assoc (xs ys : List (Fin 2)) (s : ListBlank (Fin 2)) : + (xs ++ ys) +> s = xs +> (ys +> s) := + ListBlank.append_assoc xs ys s + +theorem lpow_add {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := + list_pow_add l m n + +theorem lpow_shift {α : Type*} (l : List α) (n : Nat) : l ^ n ++ l = l ^ (n + 1) := + (list_pow_succ' l n).symm + +theorem step_multiStep (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢^{1} c₂ := by simp [h] + +theorem step_stepStar (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢* c₂ := ⟨1, step_multiStep tm c₁ c₂ h⟩ + +theorem step_stepPlus (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢⁺ c₂ := ⟨1, by decide, step_multiStep tm c₁ c₂ h⟩ + +theorem multiStep_add (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_trans {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_stepPlus {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_trans {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus h₁ (stepPlus_stepStar h₂) + +theorem step_stepStar_stepPlus {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +macro "finish" : tactic => + `(tactic| (refine ⟨0, ?_⟩; simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, init_nil, multiStep_zero, pow_zero_list, pow_succ_list, cons_append_list, append_nil_list, listblank_append_nil, listblank_append_cons, zero_cons_default]; rfl)) +macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, init_nil, pow_zero_list, pow_succ_list, cons_append_list, append_nil_list, listblank_append_nil, listblank_append_cons, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, default_head, default_tail]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, init_nil, pow_zero_list, pow_succ_list, cons_append_list, append_nil_list, listblank_append_nil, listblank_append_cons, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail]) +macro "execute" : tactic => + `(tactic| (repeat' (first | exact ⟨0, rfl⟩ | step))) + +-- ============================================================================ +-- Token and Processed-Token Encodings (`PR_SBC.v`) +-- ============================================================================ + +inductive tok where + | T0 | T1 | TZ + deriving DecidableEq, Repr + +@[simp] def tokw : tok → List (Fin 2) + | .T0 => [0, 0] + | .T1 => [0, 1] + | .TZ => [1, 0, 0] + +@[simp] def tw : List tok → List (Fin 2) + | [] => [] + | t :: ts => tokw t ++ tw ts + +inductive ptok where + | P | PZ + deriving DecidableEq, Repr + +@[simp] def pw : ptok → List (Fin 2) + | .P => [0, 1] + | .PZ => [0, 1, 0] + +@[simp] def pl : List ptok → List (Fin 2) + | [] => [] + | p :: ps => pw p ++ pl ps + +@[simp] def proc : tok → ptok + | .TZ => .PZ + | _ => .P + +@[simp] def rep {α : Type*} (x : α) : Nat → List α + | 0 => [] + | n + 1 => x :: rep x n + +@[simp] theorem rep_add_two {α : Type*} (x : α) (n : Nat) : rep x (n + 2) = x :: x :: rep x n := rfl + +theorem rep_length {α : Type*} (x : α) (n : Nat) : (rep x n).length = n := by + induction n with + | zero => rfl + | succ n ih => simp [rep, ih] + +theorem repeat_snoc {α : Type*} (x : α) (n : Nat) : rep x n ++ [x] = x :: rep x n := by + induction n with + | zero => rfl + | succ n ih => simp [rep, ih] + +theorem tw_app (xs ys : List tok) : tw (xs ++ ys) = tw xs ++ tw ys := by + induction xs with + | nil => rfl + | cons x xs ih => simp [tw, ih, List.append_assoc] + +theorem tw_cons (x : tok) (xs : List tok) : tw (x :: xs) = tokw x ++ tw xs := rfl + +theorem pl_app (xs ys : List ptok) : pl (xs ++ ys) = pl xs ++ pl ys := by + induction xs with + | nil => rfl + | cons x xs ih => simp [pl, ih, List.append_assoc] + +-- ============================================================================ +-- Elementary Finite-Step Rules (`es`) +-- ============================================================================ + +theorem AT0 (l r : ListBlank (Fin 2)) : + (l {{A}}> (([0, 0] : List (Fin 2)) +> r)) [target_tm]⊢* + ((([0, 1] : List (Fin 2)) +> l) {{C}}> r) := by execute + +theorem AT0p (l r : ListBlank (Fin 2)) : + (l {{A}}> (([0, 0] : List (Fin 2)) +> r)) [target_tm]⊢⁺ + ((([0, 1] : List (Fin 2)) +> l) {{C}}> r) := by execute + +theorem CT1 (l r : ListBlank (Fin 2)) : + (l {{C}}> (([0, 1] : List (Fin 2)) +> r)) [target_tm]⊢* + ((([0, 1] : List (Fin 2)) +> l) {{C}}> r) := by execute + +theorem CTZ (l r : ListBlank (Fin 2)) : + (l {{C}}> (([1, 0, 0] : List (Fin 2)) +> r)) [target_tm]⊢* + ((([0, 1, 0] : List (Fin 2)) +> l) {{C}}> r) := by execute + +theorem CT0 (l r : ListBlank (Fin 2)) : + (l {{C}}> (([0, 0] : List (Fin 2)) +> r)) [target_tm]⊢* + (l <{{E}} (([0, 1] : List (Fin 2)) +> r)) := by execute + +theorem EPZ (l r : ListBlank (Fin 2)) : + ((([0, 1, 0] : List (Fin 2)) +> l) <{{E}} r) [target_tm]⊢* + (l <{{E}} (([1, 0, 0] : List (Fin 2)) +> r)) := by execute + +theorem EP (l r : ListBlank (Fin 2)) : + ((([0, 1] : List (Fin 2)) +> l) <{{E}} r) [target_tm]⊢* + (l <{{F}} (([0, 0] : List (Fin 2)) +> r)) := by execute + +theorem FP (l r : ListBlank (Fin 2)) : + ((([0, 1] : List (Fin 2)) +> l) <{{F}} r) [target_tm]⊢* + (l <{{E}} (([0, 1] : List (Fin 2)) +> r)) := by execute + +theorem FPZP (l r : ListBlank (Fin 2)) : + ((([0, 1, 0] : List (Fin 2)) +> (([0, 1] : List (Fin 2)) +> l)) <{{F}} (([0, 0] : List (Fin 2)) +> r)) [target_tm]⊢* + (l <{{E}} (([0, 0] : List (Fin 2)) +> (([1, 0, 0] : List (Fin 2)) +> (([0, 1] : List (Fin 2)) +> r)))) := by execute + +theorem ENDl (l r : ListBlank (Fin 2)) : + ((([0, 0] : List (Fin 2)) +> l) <{{F}} r) [target_tm]⊢* + (l <{{A}} (([0, 1] : List (Fin 2)) +> r)) := by execute + +theorem B1 (l r : ListBlank (Fin 2)) : + ((([1, 0] : List (Fin 2)) +> l) <{{F}} r) [target_tm]⊢* + ((([0, 0] : List (Fin 2)) +> l) {{A}}> r) := by execute + +theorem BN (l r : ListBlank (Fin 2)) : + ((([0, 1, 0, 0, 1, 0] : List (Fin 2)) +> l) <{{F}} (([0, 0] : List (Fin 2)) +> r)) [target_tm]⊢* + (l <{{A}} (([0, 0, 0, 1, 0, 0, 0, 1] : List (Fin 2)) +> r)) := by execute + +theorem ENDZX (l r : ListBlank (Fin 2)) : + ((([0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0] : List (Fin 2)) +> l) <{{F}} r) [target_tm]⊢* + (l <{{A}} (([0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1] : List (Fin 2)) +> r)) := by execute + +theorem Bnc (X : ListBlank (Fin 2)) : + (default <{{F}} (([0, 0] : List (Fin 2)) +> (([1, 0, 0] : List (Fin 2)) +> X))) [target_tm]⊢* + (default {{A}}> (([0, 0] : List (Fin 2)) +> (([1, 0, 0] : List (Fin 2)) +> (([1, 0, 0] : List (Fin 2)) +> X)))) := by + execute + +-- ============================================================================ +-- Sweeps & Return Transducer (`Csweep`, `retf`, `CTZs`, `EPZs`) +-- ============================================================================ + +@[simp] def noT0 : List tok → Prop + | [] => True + | .T0 :: _ => False + | _ :: ts => noT0 ts + +def prc (ts : List tok) : List ptok := (ts.map proc).reverse + +theorem prc_app (xs ys : List tok) : prc (xs ++ ys) = prc ys ++ prc xs := by + simp [prc, List.map_append, List.reverse_append] + +theorem Csweep (ts : List tok) (h : noT0 ts) (l r : ListBlank (Fin 2)) : + (l {{C}}> (tw ts +> r)) [target_tm]⊢* ((pl (prc ts) +> l) {{C}}> r) := by + induction ts generalizing l with + | nil => try exact ⟨0, rfl⟩ + | cons t ts ih => + have hprc : pl (prc (t :: ts)) +> l = pl (prc ts) +> (pw (proc t) +> l) := by + simp [prc, pl_app, str_app_assoc] + rw [hprc] + cases t with + | T0 => exact False.elim h + | T1 => + simp only [tw, tokw, str_app_assoc] + exact stepStar_trans (CT1 l (tw ts +> r)) (ih h (([0, 1] : List (Fin 2)) +> l)) + | TZ => + simp only [tw, tokw, str_app_assoc] + exact stepStar_trans (CTZ l (tw ts +> r)) (ih h (([0, 1, 0] : List (Fin 2)) +> l)) + +def retf (m : Fin 6) : List ptok → List tok → Fin 6 × List ptok × List tok + | [], rs => (m, [], rs) + | .PZ :: ps', rs => + if m = E then retf E ps' (.TZ :: rs) + else if m = F then + match ps' with + | .P :: ps'' => + match rs with + | .T0 :: rs' => retf E ps'' (.T0 :: .TZ :: .T1 :: rs') + | _ => (m, .PZ :: ps', rs) + | _ => (m, .PZ :: ps', rs) + else (m, .PZ :: ps', rs) + | .P :: ps', rs => + if m = E then retf F ps' (.T0 :: rs) + else if m = F then retf E ps' (.T1 :: rs) + else (m, .P :: ps', rs) + +@[simp] theorem retf_E_P (ps : List ptok) (rs : List tok) : + retf E (.P :: ps) rs = retf F ps (.T0 :: rs) := rfl + +@[simp] theorem retf_F_P (ps : List ptok) (rs : List tok) : + retf F (.P :: ps) rs = retf E ps (.T1 :: rs) := rfl + +@[simp] theorem retf_E_PZ (ps : List ptok) (rs : List tok) : + retf E (.PZ :: ps) rs = retf E ps (.TZ :: rs) := by + cases ps with + | nil => rfl + | cons p ps' => + cases p <;> (try rfl) <;> cases rs <;> (try rfl) <;> rename_i r0 _ <;> cases r0 <;> rfl + +@[simp] theorem retf_F_PZ_P (ps : List ptok) (rs : List tok) : + retf F (.PZ :: .P :: ps) (.T0 :: rs) = retf E ps (.T0 :: .TZ :: .T1 :: rs) := rfl + +theorem retf_spec_n : ∀ (n : Nat) (ps : List ptok), ps.length ≤ n → + ∀ (m : Fin 6) (rs : List tok) (m' : Fin 6) (ps' : List ptok) (rs' : List tok), + retf m ps rs = (m', ps', rs') → + ∀ (l r : ListBlank (Fin 2)), + ((pl ps +> l) <{{m}} (tw rs +> r)) [target_tm]⊢* ((pl ps' +> l) <{{m'}} (tw rs' +> r)) + | 0, ps, hn, m, rs, m', ps', rs', hr, l, r => by + cases ps with + | nil => + rcases hr with ⟨rfl, rfl, rfl⟩ + try exact ⟨0, rfl⟩ + | cons _ _ => simp at hn + | n + 1, [], _, m, rs, m', ps', rs', hr, l, r => by + rcases hr with ⟨rfl, rfl, rfl⟩ + try exact ⟨0, rfl⟩ + | n + 1, .P :: ps, hn, m, rs, m', ps', rs', hr, l, r => by + by_cases hmE : m = E + · subst hmE + have hr' : retf F ps (.T0 :: rs) = (m', ps', rs') := hr + have h1 : ((pl (.P :: ps) +> l) <{{E}} (tw rs +> r)) [target_tm]⊢* + ((pl ps +> l) <{{F}} (tw (.T0 :: rs) +> r)) := by + simpa [pl, pw, tw, tokw, str_app_assoc] using EP (pl ps +> l) (tw rs +> r) + exact stepStar_trans h1 (retf_spec_n n ps (by simpa using hn) F (.T0 :: rs) m' ps' rs' hr' l r) + · by_cases hmF : m = F + · subst hmF + have hr' : retf E ps (.T1 :: rs) = (m', ps', rs') := hr + have h1 : ((pl (.P :: ps) +> l) <{{F}} (tw rs +> r)) [target_tm]⊢* + ((pl ps +> l) <{{E}} (tw (.T1 :: rs) +> r)) := by + simpa [pl, pw, tw, tokw, str_app_assoc] using FP (pl ps +> l) (tw rs +> r) + exact stepStar_trans h1 (retf_spec_n n ps (by simpa using hn) E (.T1 :: rs) m' ps' rs' hr' l r) + · unfold retf at hr + simp only [hmE, hmF, ite_false] at hr + rcases hr with ⟨rfl, rfl, rfl⟩ + try exact ⟨0, rfl⟩ + | n + 1, .PZ :: ps, hn, m, rs, m', ps', rs', hr, l, r => by + by_cases hmE : m = E + · subst hmE + have hr' : retf E ps (.TZ :: rs) = (m', ps', rs') := by unfold retf at hr; exact hr + have h1 : ((pl (.PZ :: ps) +> l) <{{E}} (tw rs +> r)) [target_tm]⊢* + ((pl ps +> l) <{{E}} (tw (.TZ :: rs) +> r)) := by + simpa [pl, pw, tw, tokw, str_app_assoc] using EPZ (pl ps +> l) (tw rs +> r) + exact stepStar_trans h1 (retf_spec_n n ps (by simpa using hn) E (.TZ :: rs) m' ps' rs' hr' l r) + · by_cases hmF : m = F + · subst hmF + cases ps with + | nil => + rcases hr with ⟨rfl, rfl, rfl⟩ + try exact ⟨0, rfl⟩ + | cons p2 ps'' => + cases p2 with + | PZ => + rcases hr with ⟨rfl, rfl, rfl⟩ + try exact ⟨0, rfl⟩ + | P => + cases rs with + | nil => + rcases hr with ⟨rfl, rfl, rfl⟩ + try exact ⟨0, rfl⟩ + | cons r0 rs0 => + cases r0 with + | T1 => + rcases hr with ⟨rfl, rfl, rfl⟩ + try exact ⟨0, rfl⟩ + | TZ => + rcases hr with ⟨rfl, rfl, rfl⟩ + try exact ⟨0, rfl⟩ + | T0 => + have hr' : retf E ps'' (.T0 :: .TZ :: .T1 :: rs0) = (m', ps', rs') := hr + have h1 : ((pl (.PZ :: .P :: ps'') +> l) <{{F}} (tw (.T0 :: rs0) +> r)) [target_tm]⊢* + ((pl ps'' +> l) <{{E}} (tw (.T0 :: .TZ :: .T1 :: rs0) +> r)) := by + simpa [pl, pw, tw, tokw, str_app_assoc] using FPZP (pl ps'' +> l) (tw rs0 +> r) + have hlen : ps''.length ≤ n := by simp at hn; omega + exact stepStar_trans h1 (retf_spec_n n ps'' hlen E (.T0 :: .TZ :: .T1 :: rs0) m' ps' rs' hr' l r) + · unfold retf at hr + simp only [hmE, hmF, ite_false] at hr + rcases hr with ⟨rfl, rfl, rfl⟩ + try exact ⟨0, rfl⟩ + +theorem retf_spec (ps : List ptok) (m : Fin 6) (rs : List tok) (m' : Fin 6) (ps' : List ptok) (rs' : List tok) + (hr : retf m ps rs = (m', ps', rs')) (l r : ListBlank (Fin 2)) : + ((pl ps +> l) <{{m}} (tw rs +> r)) [target_tm]⊢* ((pl ps' +> l) <{{m'}} (tw rs' +> r)) := + retf_spec_n ps.length ps (Nat.le_refl _) m rs m' ps' rs' hr l r + +theorem CTZs (g : Nat) (l r : ListBlank (Fin 2)) : + (l {{C}}> ((([1, 0, 0] : List (Fin 2)) ^ g) +> r)) [target_tm]⊢* + ((((([0, 1, 0] : List (Fin 2)) ^ g) +> l)) {{C}}> r) := by + induction g generalizing l with + | zero => try exact ⟨0, rfl⟩ + | succ g ih => + rw [pow_succ_list, str_app_assoc] + have h1 := CTZ l ((([1, 0, 0] : List (Fin 2)) ^ g) +> r) + have h2 := ih (([0, 1, 0] : List (Fin 2)) +> l) + have hrew : (([0, 1, 0] : List (Fin 2)) ^ g) +> (([0, 1, 0] : List (Fin 2)) +> l) = + (([0, 1, 0] : List (Fin 2)) ^ (g + 1)) +> l := by + rw [← str_app_assoc, lpow_shift] + rw [hrew] at h2 + exact stepStar_trans h1 h2 + +theorem EPZs (g : Nat) (l r : ListBlank (Fin 2)) : + ((((([0, 1, 0] : List (Fin 2)) ^ g) +> l)) <{{E}} r) [target_tm]⊢* + (l <{{E}} ((([1, 0, 0] : List (Fin 2)) ^ g) +> r)) := by + induction g generalizing r with + | zero => try exact ⟨0, rfl⟩ + | succ g ih => + rw [pow_succ_list, str_app_assoc] + have h1 := EPZ ((([0, 1, 0] : List (Fin 2)) ^ g) +> l) r + have h2 := ih (([1, 0, 0] : List (Fin 2)) +> r) + have hrew : (([1, 0, 0] : List (Fin 2)) ^ g) +> (([1, 0, 0] : List (Fin 2)) +> r) = + (([1, 0, 0] : List (Fin 2)) ^ (g + 1)) +> r := by + rw [← str_app_assoc, lpow_shift] + rw [hrew] at h2 + exact stepStar_trans h1 h2 + +theorem tw_Z (g : Nat) : tw (rep .TZ g) = ([1, 0, 0] : List (Fin 2)) ^ g := by + induction g with + | zero => rfl + | succ g ih => simp [rep, tw, tokw, ih] + +theorem tw_T0_cons' (xs : List tok) (r : ListBlank (Fin 2)) : + tw (.T0 :: xs) +> r = ([0, 0] : List (Fin 2)) +> (tw xs +> r) := by + rw [tw_cons, str_app_assoc]; rfl + +theorem tw_T1_cons' (xs : List tok) (r : ListBlank (Fin 2)) : + tw (.T1 :: xs) +> r = ([0, 1] : List (Fin 2)) +> (tw xs +> r) := by + rw [tw_cons, str_app_assoc]; rfl + +theorem tw_TZ_cons' (xs : List tok) (r : ListBlank (Fin 2)) : + tw (.TZ :: xs) +> r = ([1, 0, 0] : List (Fin 2)) +> (tw xs +> r) := by + rw [tw_cons, str_app_assoc]; rfl + +theorem tw_rep_TZ_app (g : Nat) (xs : List tok) (r : ListBlank (Fin 2)) : + tw (rep .TZ g ++ xs) +> r = ((([1, 0, 0] : List (Fin 2)) ^ g) +> (tw xs +> r)) := by + rw [tw_app, tw_Z, str_app_assoc] + +def bit (v : Nat) : tok := if v % 2 = 1 then .T1 else .T0 + +def ctr : List Nat → Nat → List tok + | [], v => [bit v] + | g :: gs', v => bit v :: .TZ :: .T1 :: (rep .TZ g ++ ctr gs' (v / 2)) + +theorem bit_even (w : Nat) : bit (2 * w) = .T0 := by + unfold bit + have : (2 * w) % 2 = 0 := by omega + simp [this] + +theorem bit_odd (w : Nat) : bit (2 * w + 1) = .T1 := by + unfold bit + have : (2 * w + 1) % 2 = 1 := by omega + simp [this] + +theorem ctr_even (g : Nat) (gs : List Nat) (w : Nat) : + ctr (g :: gs) (2 * w) = .T0 :: .TZ :: .T1 :: (rep .TZ g ++ ctr gs w) := by + have hd : (2 * w) / 2 = w := by omega + simp [ctr, bit_even, hd] + +theorem ctr_odd (g : Nat) (gs : List Nat) (w : Nat) : + ctr (g :: gs) (2 * w + 1) = .T1 :: .TZ :: .T1 :: (rep .TZ g ++ ctr gs w) := by + have hd : (2 * w + 1) / 2 = w := by omega + simp [ctr, bit_odd, hd] + +theorem ctr_hd_even (gs : List Nat) (w : Nat) : + ∃ rest, ctr gs (2 * w) = .T0 :: rest ∧ ctr gs (2 * w + 1) = .T1 :: rest := by + cases gs with + | nil => exact ⟨[], by simp [ctr, bit_even], by simp [ctr, bit_odd]⟩ + | cons g gs' => exact ⟨.TZ :: .T1 :: (rep .TZ g ++ ctr gs' w), ctr_even g gs' w, ctr_odd g gs' w⟩ + +theorem pow2S (n : Nat) : 2 ^ (n + 1) = 2 * 2 ^ n := by ring + +theorem IncC (gs : List Nat) : ∀ (v : Nat), v + 1 < 2 ^ (gs.length + 1) → + ∀ (l r : ListBlank (Fin 2)) (t : List tok), + (l {{C}}> (tw (ctr gs v ++ t) +> r)) [target_tm]⊢* + (l <{{E}} (tw (ctr gs (v + 1) ++ t) +> r)) := by + induction gs with + | nil => + intro v hv l r t + rcases BusyBeaver.nat_even_or_odd_two_mul v with ⟨w, rfl⟩ | ⟨w, rfl⟩ + · simp only [ctr, bit_even, bit_odd, List.singleton_append, tw, tokw, str_app_assoc] + exact CT0 l (tw t +> r) + · simp at hv + | cons g gs ih => + intro v hv l r t + rcases BusyBeaver.nat_even_or_odd_two_mul v with ⟨w, rfl⟩ | ⟨w, rfl⟩ + · rcases ctr_hd_even (g :: gs) w with ⟨rest, h0, h1⟩ + rw [h0, h1] + simp only [List.cons_append, tw, tokw, str_app_assoc] + exact CT0 l (tw (rest ++ t) +> r) + · have hsucc : 2 * w + 1 + 1 = 2 * (w + 1) := by omega + rw [ctr_odd, hsucc, ctr_even] + have hvw : w + 1 < 2 ^ (gs.length + 1) := by + simp only [List.length_cons] at hv + rw [pow2S (gs.length + 1)] at hv + omega + simp only [List.cons_append, List.append_assoc, tw_T0_cons', tw_T1_cons', tw_TZ_cons', tw_rep_TZ_app] + have s1 := CT1 l (([1, 0, 0] : List (Fin 2)) +> (([0, 1] : List (Fin 2)) +> ((([1, 0, 0] : List (Fin 2)) ^ g) +> (tw (ctr gs w ++ t) +> r)))) + have s2 := CTZ (([0, 1] : List (Fin 2)) +> l) (([0, 1] : List (Fin 2)) +> ((([1, 0, 0] : List (Fin 2)) ^ g) +> (tw (ctr gs w ++ t) +> r))) + have s3 := CT1 (([0, 1, 0] : List (Fin 2)) +> (([0, 1] : List (Fin 2)) +> l)) ((([1, 0, 0] : List (Fin 2)) ^ g) +> (tw (ctr gs w ++ t) +> r)) + have s4 := CTZs g (([0, 1] : List (Fin 2)) +> (([0, 1, 0] : List (Fin 2)) +> (([0, 1] : List (Fin 2)) +> l))) (tw (ctr gs w ++ t) +> r) + have s5 := ih w hvw ((([0, 1, 0] : List (Fin 2)) ^ g) +> (([0, 1] : List (Fin 2)) +> (([0, 1, 0] : List (Fin 2)) +> (([0, 1] : List (Fin 2)) +> l)))) r t + have s6 := EPZs g (([0, 1] : List (Fin 2)) +> (([0, 1, 0] : List (Fin 2)) +> (([0, 1] : List (Fin 2)) +> l))) (tw (ctr gs (w + 1) ++ t) +> r) + have s7 := EP (([0, 1, 0] : List (Fin 2)) +> (([0, 1] : List (Fin 2)) +> l)) ((([1, 0, 0] : List (Fin 2)) ^ g) +> (tw (ctr gs (w + 1) ++ t) +> r)) + have s8 := FPZP l ((([1, 0, 0] : List (Fin 2)) ^ g) +> (tw (ctr gs (w + 1) ++ t) +> r)) + exact stepStar_trans s1 (stepStar_trans s2 (stepStar_trans s3 (stepStar_trans s4 (stepStar_trans s5 (stepStar_trans s6 (stepStar_trans s7 s8)))))) + +theorem IncL (gs : List Nat) (v a : Nat) (hv : v + 1 < 2 ^ (gs.length + 1)) + (l r : ListBlank (Fin 2)) (t : List tok) : + (l {{A}}> (tw (.T0 :: (rep .TZ a ++ (ctr gs v ++ t))) +> r)) [target_tm]⊢* + (l <{{F}} (tw (.T0 :: (rep .TZ a ++ (ctr gs (v + 1) ++ t))) +> r)) := by + simp only [tw_T0_cons', tw_rep_TZ_app] + have s1 := AT0 l ((([1, 0, 0] : List (Fin 2)) ^ a) +> (tw (ctr gs v ++ t) +> r)) + have s2 := CTZs a (([0, 1] : List (Fin 2)) +> l) (tw (ctr gs v ++ t) +> r) + have s3 := IncC gs v hv ((([0, 1, 0] : List (Fin 2)) ^ a) +> (([0, 1] : List (Fin 2)) +> l)) r t + have s4 := EPZs a (([0, 1] : List (Fin 2)) +> l) (tw (ctr gs (v + 1) ++ t) +> r) + have s5 := EP l ((([1, 0, 0] : List (Fin 2)) ^ a) +> (tw (ctr gs (v + 1) ++ t) +> r)) + exact stepStar_trans s1 (stepStar_trans s2 (stepStar_trans s3 (stepStar_trans s4 s5))) + +theorem TwoInc (gs : List Nat) (v p : Nat) (t : List tok) (L r : ListBlank (Fin 2)) + (hv : v + 2 < 2 ^ (gs.length + 1)) : + ((([1, 0] : List (Fin 2)) +> (([0] : List (Fin 2)) +> L)) {{A}}> (tw (.T0 :: (rep .TZ p ++ (ctr gs v ++ t))) +> r)) [target_tm]⊢* + (L {{A}}> (tw (.T0 :: (rep .TZ (p + 1) ++ (ctr gs (v + 2) ++ t))) +> r)) := by + have s1 := IncL gs v p (by omega) (([1, 0] : List (Fin 2)) +> (([0] : List (Fin 2)) +> L)) r t + have s2 := B1 (([0] : List (Fin 2)) +> L) (tw (.T0 :: (rep .TZ p ++ (ctr gs (v + 1) ++ t))) +> r) + have s3 := IncL gs (v + 1) p hv (([0, 0] : List (Fin 2)) +> (([0] : List (Fin 2)) +> L)) r t + have s4 := ENDl (([0] : List (Fin 2)) +> L) (tw (.T0 :: (rep .TZ p ++ (ctr gs (v + 2) ++ t))) +> r) + have h_rhs : ((([0] : List (Fin 2)) +> L) <{{A}} (([0, 1] : List (Fin 2)) +> (tw (.T0 :: (rep .TZ p ++ (ctr gs (v + 2) ++ t))) +> r))) = + (L {{A}}> (tw (.T0 :: (rep .TZ (p + 1) ++ (ctr gs (v + 2) ++ t))) +> r)) := by + simp [rep, tw, tokw, str_app_assoc] + rw [h_rhs] at s4 + exact stepStar_trans s1 (stepStar_trans s2 (stepStar_trans s3 s4)) + +theorem ZXg (gs : List Nat) (v p : Nat) (t : List tok) (L r : ListBlank (Fin 2)) + (hv : v + 2 < 2 ^ (gs.length + 1)) : + ((([1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0] : List (Fin 2)) +> (([0] : List (Fin 2)) +> L)) {{A}}> + (tw (.T0 :: (rep .TZ p ++ (ctr gs v ++ t))) +> r)) [target_tm]⊢* + (L {{A}}> (tw (.T0 :: (ctr ((p + 2) :: gs) (2 * (v + 2)) ++ t)) +> r)) := by + have hsplit : (([1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0] : List (Fin 2)) +> (([0] : List (Fin 2)) +> L)) = + (([1, 0] : List (Fin 2)) +> (([1, 0, 0, 1, 0, 1, 0, 0, 1, 0] : List (Fin 2)) +> (([0] : List (Fin 2)) +> L))) := by simp + rw [hsplit] + have s1 := IncL gs v p (by omega) (([1, 0] : List (Fin 2)) +> (([1, 0, 0, 1, 0, 1, 0, 0, 1, 0] : List (Fin 2)) +> (([0] : List (Fin 2)) +> L))) r t + have s2 := B1 (([1, 0, 0, 1, 0, 1, 0, 0, 1, 0] : List (Fin 2)) +> (([0] : List (Fin 2)) +> L)) (tw (.T0 :: (rep .TZ p ++ (ctr gs (v + 1) ++ t))) +> r) + have s3 := IncL gs (v + 1) p hv (([0, 0] : List (Fin 2)) +> (([1, 0, 0, 1, 0, 1, 0, 0, 1, 0] : List (Fin 2)) +> (([0] : List (Fin 2)) +> L))) r t + have hmerge : (([0, 0] : List (Fin 2)) +> (([1, 0, 0, 1, 0, 1, 0, 0, 1, 0] : List (Fin 2)) +> (([0] : List (Fin 2)) +> L))) = + (([0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0] : List (Fin 2)) +> (([0] : List (Fin 2)) +> L)) := by simp + rw [hmerge] at s3 + have s4 := ENDZX (([0] : List (Fin 2)) +> L) (tw (.T0 :: (rep .TZ p ++ (ctr gs (v + 2) ++ t))) +> r) + have h_rhs : ((([0] : List (Fin 2)) +> L) <{{A}} (([0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1] : List (Fin 2)) +> (tw (.T0 :: (rep .TZ p ++ (ctr gs (v + 2) ++ t))) +> r))) = + (L {{A}}> (tw (.T0 :: (ctr ((p + 2) :: gs) (2 * (v + 2)) ++ t)) +> r)) := by + rw [ctr_even] + simp [rep, tw, tokw, tw_app, tw_Z, str_app_assoc] + rw [h_rhs] at s4 + exact stepStar_trans s1 (stepStar_trans s2 (stepStar_trans s3 s4)) + +theorem ZXP2g (gs : List Nat) (v p : Nat) (t : List tok) (L r : ListBlank (Fin 2)) + (hv : v + 1 < 2 ^ (gs.length + 1)) : + ((([0, 1, 0, 0, 1, 0] : List (Fin 2)) +> (([0] : List (Fin 2)) +> L)) {{A}}> + (tw (.T0 :: (rep .TZ p ++ (ctr gs v ++ t))) +> r)) [target_tm]⊢* + (L {{A}}> (tw (.T0 :: (ctr (p :: gs) (2 * (v + 1)) ++ t)) +> r)) := by + have s1 := IncL gs v p hv (([0, 1, 0, 0, 1, 0] : List (Fin 2)) +> (([0] : List (Fin 2)) +> L)) r t + rw [tw_T0_cons'] at s1 + have s2 := BN (([0] : List (Fin 2)) +> L) (tw (rep .TZ p ++ (ctr gs (v + 1) ++ t)) +> r) + have h_rhs : ((([0] : List (Fin 2)) +> L) <{{A}} (([0, 0, 0, 1, 0, 0, 0, 1] : List (Fin 2)) +> (tw (rep .TZ p ++ (ctr gs (v + 1) ++ t)) +> r))) = + (L {{A}}> (tw (.T0 :: (ctr (p :: gs) (2 * (v + 1)) ++ t)) +> r)) := by + rw [ctr_even] + simp [tw, tokw, tw_app, tw_Z, str_app_assoc] + rw [h_rhs] at s2 + exact stepStar_trans s1 s2 + +-- ============================================================================ +-- Right-Tail Grammar (`tailx`, `tailw`, `Lst`, `Tail10`, `Tail0z`, `Tail11`) +-- ============================================================================ + +@[simp] def bt (b : Bool) : tok := if b then .T1 else .T0 + +def tailx (y z b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 : Bool) (e : List Bool) : List tok := + bt y :: bt z :: .TZ :: .T1 :: bt b4 :: bt b5 :: .TZ :: .T1 :: bt b6 :: .TZ :: bt b7 :: .TZ :: .T1 :: + bt b8 :: bt b9 :: .TZ :: bt b10 :: .TZ :: .T1 :: bt b11 :: .TZ :: bt b12 :: .TZ :: bt b13 :: .TZ :: + bt b14 :: .TZ :: bt b15 :: .TZ :: .T1 :: (e.map bt ++ [.T1]) + +def tailw (x y z b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 : Bool) (e : List Bool) : List tok := + bt x :: tailx y z b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e + +def Lst (y z : Bool) (S : ListBlank (Fin 2)) : Prop := + ∃ b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e, + S = tw (tailw true y z b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e) +> default + +theorem tw_T0_cons (xs : List tok) (r : ListBlank (Fin 2)) : + tw (.T0 :: xs) +> r = ([0, 0] : List (Fin 2)) +> (tw xs +> r) := by + rw [tw_cons, str_app_assoc]; rfl + +theorem tw_T1_cons (xs : List tok) (r : ListBlank (Fin 2)) : + ([0, 1] : List (Fin 2)) +> (tw xs +> r) = tw (.T1 :: xs) +> r := by + rw [tw_cons, str_app_assoc]; rfl + +theorem TailRet (pre rest : List tok) (m : Fin 6) (out : List tok) + (hn : noT0 pre) (hr : retf E (prc pre) [.T1] = (m, [], out)) + (l R : ListBlank (Fin 2)) : + (l {{C}}> (tw (pre ++ (.T0 :: rest)) +> R)) [target_tm]⊢* + (l <{{m}} (tw (out ++ rest) +> R)) := by + rw [tw_app, str_app_assoc, tw_T0_cons'] + have s1 := Csweep pre hn l (([0, 0] : List (Fin 2)) +> (tw rest +> R)) + have s2 := CT0 (pl (prc pre) +> l) (tw rest +> R) + have s3 := retf_spec (prc pre) E [.T1] m [] out hr l (tw rest +> R) + rw [← tw_T1_cons'] at s2 + have s123 := stepStar_trans s1 (stepStar_trans s2 s3) + simp only [pl, listblank_append_nil] at s123 + rw [tw_app, str_app_assoc] + exact s123 + +theorem TailRet' (w pre rest : List tok) (m : Fin 6) (out w' : List tok) + (hw : w = pre ++ (.T0 :: rest)) + (hn : noT0 pre) (hr : retf E (prc pre) [.T1] = (m, [], out)) + (hw' : out ++ rest = w') + (l R : ListBlank (Fin 2)) : + (l {{C}}> (tw w +> R)) [target_tm]⊢* + (l <{{m}} (tw w' +> R)) := by + subst hw; subst hw' + exact TailRet pre rest m out hn hr l R + +theorem TailRetF' (w pre rest : List tok) (out w' : List tok) + (hw : w = pre ++ (.T0 :: rest)) + (hn : noT0 pre) (hr : retf E (prc pre) [.T1] = (F, [], .T0 :: out)) + (hw' : out ++ rest = w') + (l R : ListBlank (Fin 2)) : + (l {{C}}> (tw w +> R)) [target_tm]⊢* + (l <{{F}} (([0, 0] : List (Fin 2)) +> (tw w' +> R))) := by + subst hw; subst hw' + have h := TailRet pre rest F (.T0 :: out) hn hr l R + have hcons : (.T0 :: out) ++ rest = .T0 :: (out ++ rest) := rfl + rw [hcons, tw_T0_cons] at h + exact h + +theorem Tail10 (l : ListBlank (Fin 2)) (b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 : Bool) (e : List Bool) : + (l {{C}}> (tw (tailw true true false b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e) +> default)) [target_tm]⊢* + (l <{{E}} (tw (tailw true false true b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e) +> default)) := + TailRet' _ [.T1, .T1] ((tailx true true b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e).tail.tail) + E [.T1, .T0, .T1] _ rfl trivial rfl rfl l default + +theorem Tail0z (l : ListBlank (Fin 2)) (z b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 : Bool) (e : List Bool) : + (l {{C}}> (tw (tailw true false z b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e) +> default)) [target_tm]⊢* + (l <{{F}} (([0, 0] : List (Fin 2)) +> (tw (tailx true z b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e) +> default))) := + TailRetF' _ [.T1] ((tailx true z b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e).tail) + [.T1] _ rfl trivial rfl rfl l default + +@[irreducible] def F1 : List tok := + [.T1, .T1, .T1, .TZ, .T1, .T1, .T1, .TZ, .T1, .T1, .TZ, .T1, .TZ, .T1, .T1, .T1, + .TZ, .T1, .TZ, .T1, .T1, .TZ, .T1, .TZ, .T1, .TZ, .T1, .TZ, .T1, .TZ, .T1] + +@[irreducible] def F1E : List tok := + [.T1, .T0, .T0, .TZ, .T1, .T1, .T0, .TZ, .T1, .T0, .TZ, .T0, .TZ, .T1, .T1, .T0, + .TZ, .T0, .TZ, .T1, .T0, .TZ, .T1, .TZ, .T0, .TZ, .T1, .TZ, .T0, .TZ, .T1] + +@[irreducible] def F1F_tail : List tok := + [.T1, .T0, .TZ, .T1, .T0, .T0, .TZ, .T1, .T0, .TZ, .T1, .TZ, .T1, .T0, .T0, + .TZ, .T1, .TZ, .T1, .T0, .TZ, .T0, .TZ, .T1, .TZ, .T0, .TZ, .T1, .TZ, .T1] + +theorem noT0_F1 : noT0 F1 := by unfold F1; trivial +theorem F1E_ret (X : List tok) : retf E (prc F1) X = (E, [], F1E ++ X) := by unfold F1 F1E; rfl +theorem F1F_ret (X : List tok) : retf F (prc F1) X = (F, [], .T0 :: (F1F_tail ++ X)) := by unfold F1 F1F_tail; rfl + +theorem tailw_ones (e : List Bool) : + tailw true true true true true true true true true true true true true true true e = + F1 ++ (e.map bt ++ [.T1]) := by unfold F1; rfl + +theorem tailw_F1E (X : List Bool) : + tailw true false false true false false false true false false false true false true false X = + F1E ++ (X.map bt ++ [.T1]) := by unfold F1E; rfl + +theorem tailw_F1F (X : List Bool) : + tailw true true false false false false true false false true false false true false true (false :: X) = + .T1 :: (F1F_tail ++ (.T0 :: (X.map bt ++ [.T1]))) := by unfold F1F_tail; rfl + + +theorem prc_T1s (j : Nat) : prc (rep .T1 j) = rep .P j := by + induction j with + | zero => rfl + | succ j ih => + have hcons : prc (.T1 :: rep .T1 j) = prc (rep .T1 j) ++ [.P] := by + simp only [prc, List.map_cons, proc, List.reverse_cons] + rw [rep, hcons, ih, repeat_snoc]; rfl + +theorem noT0_app (xs ys : List tok) (hx : noT0 xs) (hy : noT0 ys) : noT0 (xs ++ ys) := by + induction xs with + | nil => exact hy + | cons x xs ih => + cases x with + | T0 => exact False.elim hx + | T1 => exact ih hx + | TZ => exact ih hx + +theorem noT0_T1s (j : Nat) : noT0 (rep .T1 j) := by + induction j with + | zero => trivial + | succ j ih => exact ih + +theorem noT0_F1_T1s (j : Nat) : noT0 (F1 ++ rep .T1 j) := + noT0_app F1 (rep .T1 j) noT0_F1 (noT0_T1s j) + +theorem map_bt_true (j : Nat) : (rep true j).map bt = rep .T1 j := by + induction j with + | zero => rfl + | succ j ih => + rw [rep, List.map_cons, ih] + rfl + +theorem map_bt_alt (i : Nat) : (([true, false] : List Bool) ^ i).map bt = ([tok.T1, tok.T0] : List tok) ^ i := by + induction i with + | zero => rfl + | succ i ih => + rw [list_pow_succ, list_pow_succ, List.map_append, ih] + rfl + +theorem retf_PP (i : Nat) (ps : List ptok) (rs : List tok) : + retf E (rep .P (2 * i) ++ ps) rs = retf E ps ((([tok.T1, tok.T0] : List tok) ^ i) ++ rs) := by + induction i generalizing rs with + | zero => rfl + | succ i ih => + have h2 : 2 * (i + 1) = (2 * i) + 1 + 1 := by omega + rw [h2, rep, rep, List.cons_append, List.cons_append, retf_E_P, retf_F_P] + rw [ih (.T1 :: .T0 :: rs)] + have hshift : (([tok.T1, tok.T0] : List tok) ^ i) ++ (.T1 :: .T0 :: rs) = + (([tok.T1, tok.T0] : List tok) ^ (i + 1)) ++ rs := by + change (([tok.T1, tok.T0] : List tok) ^ i) ++ ([tok.T1, tok.T0] ++ rs) = _ + rw [← List.append_assoc, lpow_shift] + rw [hshift] + +theorem retf_PPP (i : Nat) (ps : List ptok) (rs : List tok) : + retf E (rep .P (2 * i + 1) ++ ps) rs = retf F ps (.T0 :: ((([tok.T1, tok.T0] : List tok) ^ i) ++ rs)) := by + have hrep : rep ptok.P (2 * i + 1) ++ ps = rep ptok.P (2 * i) ++ (.P :: ps) := by + rw [rep, ← repeat_snoc, List.append_assoc]; rfl + rw [hrep, retf_PP, retf_E_P] + +theorem e_split (e : List Bool) : + (∃ j e', e = rep true j ++ (false :: e')) ∨ (∃ m, e = rep true m) := by + induction e with + | nil => exact Or.inr ⟨0, rfl⟩ + | cons b e ih => + cases b with + | false => exact Or.inl ⟨0, e, rfl⟩ + | true => + rcases ih with ⟨j, e', rfl⟩ | ⟨m, rfl⟩ + · exact Or.inl ⟨j + 1, e', rfl⟩ + · exact Or.inr ⟨m + 1, rfl⟩ + +@[simp] theorem bt_true : bt true = .T1 := rfl +@[simp] theorem bt_false : bt false = .T0 := rfl + +theorem tw_T1_end (xs : List tok) : + tw (xs ++ [.T1]) +> (default : ListBlank (Fin 2)) = + tw (xs ++ [.T1, .T0]) +> default := by + rw [tw_app, tw_app, str_app_assoc, str_app_assoc] + apply congrArg (fun r => tw xs +> r) + simp only [tw, tokw, List.cons_append, List.nil_append, listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem tw_T1_cons_eq (xs ys : List tok) (r : ListBlank (Fin 2)) (h : .T1 :: xs = ys) : + ([0, 1] : List (Fin 2)) +> (tw xs +> r) = tw ys +> r := by + subst h; exact tw_T1_cons xs r + +theorem TailRet_eq (w1 w2 : List tok) (m : Fin 6) (S' : ListBlank (Fin 2)) (l : ListBlank (Fin 2)) + (hw : tw w1 +> default = tw w2 +> default) + (hstep : (l {{C}}> (tw w2 +> default)) [target_tm]⊢* (l <{{m}} S')) : + (l {{C}}> (tw w1 +> default)) [target_tm]⊢* (l <{{m}} S') := by + rw [hw]; exact hstep + +theorem list_hs1_aux (xs : List tok) (j : Nat) (e' : List Bool) : + xs ++ ((rep true j ++ (false :: e')).map bt ++ [.T1]) = + (xs ++ rep .T1 j) ++ (.T0 :: (e'.map bt ++ [.T1])) := by + simp only [List.map_append, map_bt_true, List.map_cons, bt_false, List.cons_append, List.nil_append, List.append_assoc] + +theorem Tail11_end_hs1 (j : Nat) (e' : List Bool) : + tailw true true true true true true true true true true true true true true true (rep true j ++ (false :: e')) = + (F1 ++ rep .T1 j) ++ (.T0 :: (e'.map bt ++ [.T1])) := + (tailw_ones _).trans (list_hs1_aux F1 j e') + +theorem Tail11_end_ret_even (i : Nat) : + retf E (prc (F1 ++ rep .T1 (2 * i))) [.T1] = + (E, [], F1E ++ ((([tok.T1, tok.T0] : List tok) ^ i) ++ [.T1])) := by + rw [prc_app, prc_T1s, retf_PP, F1E_ret] + +theorem Tail11_end_ret_odd (i : Nat) : + retf E (prc (F1 ++ rep .T1 (2 * i + 1))) [.T1] = + (F, [], .T0 :: (F1F_tail ++ (.T0 :: ((([tok.T1, tok.T0] : List tok) ^ i) ++ [.T1])))) := by + rw [prc_app, prc_T1s, retf_PPP, F1F_ret] + +theorem list_lst_even1_aux (xs : List tok) (i : Nat) (e' : List Bool) : + (xs ++ ((([tok.T1, tok.T0] : List tok) ^ i) ++ [.T1])) ++ (e'.map bt ++ [.T1]) = + xs ++ (((([true, false] : List Bool) ^ i) ++ (true :: e')).map bt ++ [.T1]) := by + simp only [List.map_append, map_bt_alt, List.map_cons, bt_true, List.cons_append, List.nil_append, List.append_assoc] + +theorem Tail11_end_lst_even1 (i : Nat) (e' : List Bool) : + (F1E ++ ((([tok.T1, tok.T0] : List tok) ^ i) ++ [.T1])) ++ (e'.map bt ++ [.T1]) = + tailw true false false true false false false true false false false true false true false ((([true, false] : List Bool) ^ i) ++ (true :: e')) := + (list_lst_even1_aux F1E i e').trans (tailw_F1E _).symm + +theorem list_lst_odd1_aux (xs : List tok) (i : Nat) (e' : List Bool) : + .T1 :: ((xs ++ (.T0 :: ((([tok.T1, tok.T0] : List tok) ^ i) ++ [.T1]))) ++ (e'.map bt ++ [.T1])) = + .T1 :: (xs ++ (.T0 :: (((([true, false] : List Bool) ^ i) ++ (true :: e')).map bt ++ [.T1]))) := by + simp only [List.map_append, map_bt_alt, List.map_cons, bt_true, List.cons_append, List.nil_append, List.append_assoc] + +theorem Tail11_end_lst_odd1 (i : Nat) (e' : List Bool) : + .T1 :: ((F1F_tail ++ (.T0 :: ((([tok.T1, tok.T0] : List tok) ^ i) ++ [.T1]))) ++ (e'.map bt ++ [.T1])) = + tailw true true false false false false true false false true false false true false true (false :: ((([true, false] : List Bool) ^ i) ++ (true :: e'))) := + (list_lst_odd1_aux F1F_tail i e').trans (tailw_F1F _).symm + +theorem rep_snoc {α : Type*} (x : α) (n : Nat) : rep x (n + 1) = rep x n ++ [x] := + (repeat_snoc x n).symm + +theorem list_hs2_aux1 (xs : List tok) (m : Nat) : + xs ++ ((rep true m).map bt ++ [.T1]) = (xs ++ rep .T1 m) ++ [.T1] := by + rw [map_bt_true, List.append_assoc] + +theorem list_hs2_aux2 (xs : List tok) (m : Nat) : + (xs ++ rep .T1 m) ++ [.T1, .T0] = (xs ++ rep .T1 (m + 1)) ++ [.T0] := by + rw [rep_snoc] + simp only [List.append_assoc, List.cons_append, List.nil_append] + +theorem Tail11_end_hs2 (m k : Nat) (hk : m + 1 = k) : + tw (tailw true true true true true true true true true true true true true true true (rep true m)) +> (default : ListBlank (Fin 2)) = + tw ((F1 ++ rep .T1 k) ++ [.T0]) +> default := by + subst hk + rw [tailw_ones, list_hs2_aux1, tw_T1_end, list_hs2_aux2] + +theorem Tail11_end_lst_even2 (i : Nat) : + (F1E ++ ((([tok.T1, tok.T0] : List tok) ^ i) ++ [.T1])) ++ [] = + tailw true false false true false false false true false false false true false true false (([true, false] : List Bool) ^ i) := by + rw [tailw_F1E, map_bt_alt, List.append_nil] + +theorem Tail11_end_lst_odd2 (i : Nat) : + .T1 :: ((F1F_tail ++ (.T0 :: ((([tok.T1, tok.T0] : List tok) ^ i) ++ [.T1]))) ++ []) = + tailw true true false false false false true false false true false false true false true (false :: (([true, false] : List Bool) ^ i)) := by + rw [tailw_F1F, map_bt_alt, List.append_nil] + +theorem Lst_intro (y z b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 : Bool) (e : List Bool) + (S : ListBlank (Fin 2)) + (h : S = tw (tailw true y z b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e) +> default) : + Lst y z S := + ⟨b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, e, h⟩ + +theorem Tail11_inl (w pre rest out : List tok) + (b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 : Bool) (e : List Bool) + (hw : w = pre ++ (.T0 :: rest)) + (hn : noT0 pre) + (hr : retf E (prc pre) [.T1] = (E, [], out)) + (hw' : out ++ rest = tailw true false false b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e) : + (∃ S', (∀ l, (l {{C}}> (tw w +> default)) [target_tm]⊢* (l <{{E}} S')) ∧ Lst false false S') ∨ + (∃ S', (∀ l, (l {{C}}> (tw w +> default)) [target_tm]⊢* (l <{{F}} (([0, 0] : List (Fin 2)) +> S'))) ∧ Lst true false (([0, 1] : List (Fin 2)) +> S')) := + Or.inl ⟨tw (tailw true false false b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e) +> default, + fun l => TailRet' w pre rest E out _ hw hn hr hw' l default, + Lst_intro false false b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e _ rfl⟩ + +theorem Tail11_inr (w pre rest out : List tok) + (b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 : Bool) (e : List Bool) + (hw : w = pre ++ (.T0 :: rest)) + (hn : noT0 pre) + (hr : retf E (prc pre) [.T1] = (F, [], .T0 :: out)) + (hw' : .T1 :: (out ++ rest) = tailw true true false b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e) : + (∃ S', (∀ l, (l {{C}}> (tw w +> default)) [target_tm]⊢* (l <{{E}} S')) ∧ Lst false false S') ∨ + (∃ S', (∀ l, (l {{C}}> (tw w +> default)) [target_tm]⊢* (l <{{F}} (([0, 0] : List (Fin 2)) +> S'))) ∧ Lst true false (([0, 1] : List (Fin 2)) +> S')) := + Or.inr ⟨tw (out ++ rest) +> default, + fun l => TailRetF' w pre rest out (out ++ rest) hw hn hr rfl l default, + Lst_intro true false b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e _ (tw_T1_cons_eq (out ++ rest) _ default hw')⟩ + +theorem Tail11_inl_eq (w pre rest out : List tok) + (b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 : Bool) (e : List Bool) + (hw : tw w +> default = tw (pre ++ (.T0 :: rest)) +> default) + (hn : noT0 pre) + (hr : retf E (prc pre) [.T1] = (E, [], out)) + (hw' : out ++ rest = tailw true false false b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e) : + (∃ S', (∀ l, (l {{C}}> (tw w +> default)) [target_tm]⊢* (l <{{E}} S')) ∧ Lst false false S') ∨ + (∃ S', (∀ l, (l {{C}}> (tw w +> default)) [target_tm]⊢* (l <{{F}} (([0, 0] : List (Fin 2)) +> S'))) ∧ Lst true false (([0, 1] : List (Fin 2)) +> S')) := + Or.inl ⟨tw (tailw true false false b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e) +> default, + fun l => TailRet_eq w (pre ++ (.T0 :: rest)) E _ l hw (TailRet' _ pre rest E out _ rfl hn hr hw' l default), + Lst_intro false false b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e _ rfl⟩ + +theorem Tail11_inr_eq (w pre rest out : List tok) + (b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 : Bool) (e : List Bool) + (hw : tw w +> default = tw (pre ++ (.T0 :: rest)) +> default) + (hn : noT0 pre) + (hr : retf E (prc pre) [.T1] = (F, [], .T0 :: out)) + (hw' : .T1 :: (out ++ rest) = tailw true true false b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e) : + (∃ S', (∀ l, (l {{C}}> (tw w +> default)) [target_tm]⊢* (l <{{E}} S')) ∧ Lst false false S') ∨ + (∃ S', (∀ l, (l {{C}}> (tw w +> default)) [target_tm]⊢* (l <{{F}} (([0, 0] : List (Fin 2)) +> S'))) ∧ Lst true false (([0, 1] : List (Fin 2)) +> S')) := + Or.inr ⟨tw (out ++ rest) +> default, + fun l => TailRet_eq w (pre ++ (.T0 :: rest)) F _ l hw (TailRetF' _ pre rest out (out ++ rest) rfl hn hr rfl l default), + Lst_intro true false b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e _ (tw_T1_cons_eq (out ++ rest) _ default hw')⟩ + +theorem Tail11_end (e : List Bool) : + (∃ S', (∀ l, (l {{C}}> (tw (tailw true true true true true true true true true true true true true true true e) +> default)) [target_tm]⊢* + (l <{{E}} S')) ∧ Lst false false S') ∨ + (∃ S', (∀ l, (l {{C}}> (tw (tailw true true true true true true true true true true true true true true true e) +> default)) [target_tm]⊢* + (l <{{F}} (([0, 0] : List (Fin 2)) +> S'))) ∧ Lst true false (([0, 1] : List (Fin 2)) +> S')) := by + rcases e_split e with ⟨j, e', rfl⟩ | ⟨m, rfl⟩ + · rcases BusyBeaver.nat_even_or_odd_two_mul j with ⟨i, rfl⟩ | ⟨i, rfl⟩ + · exact Tail11_inl _ (F1 ++ rep .T1 (2 * i)) (e'.map bt ++ [.T1]) + (F1E ++ ((([tok.T1, tok.T0] : List tok) ^ i) ++ [.T1])) + true false false false true false false false true false true false + ((([true, false] : List Bool) ^ i) ++ (true :: e')) + (Tail11_end_hs1 (2 * i) e') (noT0_F1_T1s (2 * i)) (Tail11_end_ret_even i) (Tail11_end_lst_even1 i e') + · exact Tail11_inr _ (F1 ++ rep .T1 (2 * i + 1)) (e'.map bt ++ [.T1]) + (F1F_tail ++ (.T0 :: ((([tok.T1, tok.T0] : List tok) ^ i) ++ [.T1]))) + false false false true false false true false false true false true + (false :: ((([true, false] : List Bool) ^ i) ++ (true :: e'))) + (Tail11_end_hs1 (2 * i + 1) e') (noT0_F1_T1s (2 * i + 1)) (Tail11_end_ret_odd i) (Tail11_end_lst_odd1 i e') + · rcases BusyBeaver.nat_even_or_odd_two_mul (m + 1) with ⟨i, hi⟩ | ⟨i, hi⟩ + · exact Tail11_inl_eq _ (F1 ++ rep .T1 (2 * i)) [] + (F1E ++ ((([tok.T1, tok.T0] : List tok) ^ i) ++ [.T1])) + true false false false true false false false true false true false + (([true, false] : List Bool) ^ i) + (Tail11_end_hs2 m (2 * i) hi) (noT0_F1_T1s (2 * i)) (Tail11_end_ret_even i) (Tail11_end_lst_even2 i) + · exact Tail11_inr_eq _ (F1 ++ rep .T1 (2 * i + 1)) [] + (F1F_tail ++ (.T0 :: ((([tok.T1, tok.T0] : List tok) ^ i) ++ [.T1]))) + false false false true false false true false false true false true + (false :: (([true, false] : List Bool) ^ i)) + (Tail11_end_hs2 m (2 * i + 1) hi) (noT0_F1_T1s (2 * i + 1)) (Tail11_end_ret_odd i) (Tail11_end_lst_odd2 i) + +theorem Tail11 (b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 : Bool) (e : List Bool) : + (∃ S', (∀ l, (l {{C}}> (tw (tailw true true true b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e) +> default)) [target_tm]⊢* + (l <{{E}} S')) ∧ Lst false false S') ∨ + (∃ S', (∀ l, (l {{C}}> (tw (tailw true true true b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e) +> default)) [target_tm]⊢* + (l <{{F}} (([0, 0] : List (Fin 2)) +> S'))) ∧ Lst true false (([0, 1] : List (Fin 2)) +> S')) := by + cases b4 + · exact Tail11_inl _ [.T1, .T1, .T1, .TZ, .T1] + (bt b5 :: .TZ :: .T1 :: bt b6 :: .TZ :: bt b7 :: .TZ :: .T1 :: bt b8 :: bt b9 :: .TZ :: bt b10 :: .TZ :: .T1 :: bt b11 :: .TZ :: bt b12 :: .TZ :: bt b13 :: .TZ :: bt b14 :: .TZ :: bt b15 :: .TZ :: .T1 :: (e.map bt ++ [.T1])) + [.T1, .T0, .T0, .TZ, .T1, .T1] + true b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e rfl trivial rfl rfl + cases b5 + · exact Tail11_inr _ [.T1, .T1, .T1, .TZ, .T1, .T1] + (.TZ :: .T1 :: bt b6 :: .TZ :: bt b7 :: .TZ :: .T1 :: bt b8 :: bt b9 :: .TZ :: bt b10 :: .TZ :: .T1 :: bt b11 :: .TZ :: bt b12 :: .TZ :: bt b13 :: .TZ :: bt b14 :: .TZ :: bt b15 :: .TZ :: .T1 :: (e.map bt ++ [.T1])) + [.T1, .T0, .TZ, .T1, .T0, .T1] + false true b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e rfl trivial rfl rfl + cases b6 + · exact Tail11_inr _ [.T1, .T1, .T1, .TZ, .T1, .T1, .T1, .TZ, .T1] + (.TZ :: bt b7 :: .TZ :: .T1 :: bt b8 :: bt b9 :: .TZ :: bt b10 :: .TZ :: .T1 :: bt b11 :: .TZ :: bt b12 :: .TZ :: bt b13 :: .TZ :: bt b14 :: .TZ :: bt b15 :: .TZ :: .T1 :: (e.map bt ++ [.T1])) + [.T1, .T0, .TZ, .T1, .T0, .T0, .TZ, .T1, .T1] + false false true b7 b8 b9 b10 b11 b12 b13 b14 b15 e rfl trivial rfl rfl + cases b7 + · exact Tail11_inl _ [.T1, .T1, .T1, .TZ, .T1, .T1, .T1, .TZ, .T1, .T1, .TZ] + (.TZ :: .T1 :: bt b8 :: bt b9 :: .TZ :: bt b10 :: .TZ :: .T1 :: bt b11 :: .TZ :: bt b12 :: .TZ :: bt b13 :: .TZ :: bt b14 :: .TZ :: bt b15 :: .TZ :: .T1 :: (e.map bt ++ [.T1])) + [.T1, .T0, .T0, .TZ, .T1, .T1, .T0, .TZ, .T1, .T0, .TZ, .T1] + true false false true b8 b9 b10 b11 b12 b13 b14 b15 e rfl trivial rfl rfl + cases b8 + · exact Tail11_inl _ [.T1, .T1, .T1, .TZ, .T1, .T1, .T1, .TZ, .T1, .T1, .TZ, .T1, .TZ, .T1] + (bt b9 :: .TZ :: bt b10 :: .TZ :: .T1 :: bt b11 :: .TZ :: bt b12 :: .TZ :: bt b13 :: .TZ :: bt b14 :: .TZ :: bt b15 :: .TZ :: .T1 :: (e.map bt ++ [.T1])) + [.T1, .T0, .T0, .TZ, .T1, .T1, .T0, .TZ, .T1, .T0, .TZ, .T0, .TZ, .T1, .T1] + true false false false true b9 b10 b11 b12 b13 b14 b15 e rfl trivial rfl rfl + cases b9 + · exact Tail11_inr _ [.T1, .T1, .T1, .TZ, .T1, .T1, .T1, .TZ, .T1, .T1, .TZ, .T1, .TZ, .T1, .T1] + (.TZ :: bt b10 :: .TZ :: .T1 :: bt b11 :: .TZ :: bt b12 :: .TZ :: bt b13 :: .TZ :: bt b14 :: .TZ :: bt b15 :: .TZ :: .T1 :: (e.map bt ++ [.T1])) + [.T1, .T0, .TZ, .T1, .T0, .T0, .TZ, .T1, .T0, .TZ, .T1, .TZ, .T1, .T0, .T1] + false false false true false true b10 b11 b12 b13 b14 b15 e rfl trivial rfl rfl + cases b10 + · exact Tail11_inl _ [.T1, .T1, .T1, .TZ, .T1, .T1, .T1, .TZ, .T1, .T1, .TZ, .T1, .TZ, .T1, .T1, .T1, .TZ] + (.TZ :: .T1 :: bt b11 :: .TZ :: bt b12 :: .TZ :: bt b13 :: .TZ :: bt b14 :: .TZ :: bt b15 :: .TZ :: .T1 :: (e.map bt ++ [.T1])) + [.T1, .T0, .T0, .TZ, .T1, .T1, .T0, .TZ, .T1, .T0, .TZ, .T0, .TZ, .T1, .T1, .T0, .TZ, .T1] + true false false false true false true b11 b12 b13 b14 b15 e rfl trivial rfl rfl + cases b11 + · exact Tail11_inl _ [.T1, .T1, .T1, .TZ, .T1, .T1, .T1, .TZ, .T1, .T1, .TZ, .T1, .TZ, .T1, .T1, .T1, .TZ, .T1, .TZ, .T1] + (.TZ :: bt b12 :: .TZ :: bt b13 :: .TZ :: bt b14 :: .TZ :: bt b15 :: .TZ :: .T1 :: (e.map bt ++ [.T1])) + [.T1, .T0, .T0, .TZ, .T1, .T1, .T0, .TZ, .T1, .T0, .TZ, .T0, .TZ, .T1, .T1, .T0, .TZ, .T0, .TZ, .T1, .T1] + true false false false true false false true b12 b13 b14 b15 e rfl trivial rfl rfl + cases b12 + · exact Tail11_inr _ [.T1, .T1, .T1, .TZ, .T1, .T1, .T1, .TZ, .T1, .T1, .TZ, .T1, .TZ, .T1, .T1, .T1, .TZ, .T1, .TZ, .T1, .T1, .TZ] + (.TZ :: bt b13 :: .TZ :: bt b14 :: .TZ :: bt b15 :: .TZ :: .T1 :: (e.map bt ++ [.T1])) + [.T1, .T0, .TZ, .T1, .T0, .T0, .TZ, .T1, .T0, .TZ, .T1, .TZ, .T1, .T0, .T0, .TZ, .T1, .TZ, .T1, .T0, .TZ, .T1] + false false false true false false true false true b13 b14 b15 e rfl trivial rfl rfl + cases b13 + · exact Tail11_inl _ [.T1, .T1, .T1, .TZ, .T1, .T1, .T1, .TZ, .T1, .T1, .TZ, .T1, .TZ, .T1, .T1, .T1, .TZ, .T1, .TZ, .T1, .T1, .TZ, .T1, .TZ] + (.TZ :: bt b14 :: .TZ :: bt b15 :: .TZ :: .T1 :: (e.map bt ++ [.T1])) + [.T1, .T0, .T0, .TZ, .T1, .T1, .T0, .TZ, .T1, .T0, .TZ, .T0, .TZ, .T1, .T1, .T0, .TZ, .T0, .TZ, .T1, .T0, .TZ, .T1, .TZ, .T1] + true false false false true false false false true true b14 b15 e rfl trivial rfl rfl + cases b14 + · exact Tail11_inr _ [.T1, .T1, .T1, .TZ, .T1, .T1, .T1, .TZ, .T1, .T1, .TZ, .T1, .TZ, .T1, .T1, .T1, .TZ, .T1, .TZ, .T1, .T1, .TZ, .T1, .TZ, .T1, .TZ] + (.TZ :: bt b15 :: .TZ :: .T1 :: (e.map bt ++ [.T1])) + [.T1, .T0, .TZ, .T1, .T0, .T0, .TZ, .T1, .T0, .TZ, .T1, .TZ, .T1, .T0, .T0, .TZ, .T1, .TZ, .T1, .T0, .TZ, .T0, .TZ, .T1, .TZ, .T1] + false false false true false false true false false true true b15 e rfl trivial rfl rfl + cases b15 + · exact Tail11_inl _ [.T1, .T1, .T1, .TZ, .T1, .T1, .T1, .TZ, .T1, .T1, .TZ, .T1, .TZ, .T1, .T1, .T1, .TZ, .T1, .TZ, .T1, .T1, .TZ, .T1, .TZ, .T1, .TZ, .T1, .TZ] + (.TZ :: .T1 :: (e.map bt ++ [.T1])) + [.T1, .T0, .T0, .TZ, .T1, .T1, .T0, .TZ, .T1, .T0, .TZ, .T0, .TZ, .T1, .T1, .T0, .TZ, .T0, .TZ, .T1, .T0, .TZ, .T1, .TZ, .T0, .TZ, .T1, .TZ, .T1] + true false false false true false false false true false true true e rfl trivial rfl rfl + exact Tail11_end e + +-- ============================================================================ +-- Overflow & Digit-Block Return Algebra (`retf_app`, `RB_*`, `LD`, `OvN1`, `OvN0`, `OvS1`) +-- ============================================================================ + +theorem retf_app_n : ∀ (n : Nat) (ps1 : List ptok), ps1.length ≤ n → + ∀ (m : Fin 6) (ps2 : List ptok) (rs : List tok) (m1 : Fin 6) (rs1 : List tok), + retf m ps1 rs = (m1, [], rs1) → + retf m (ps1 ++ ps2) rs = retf m1 ps2 rs1 + | 0, ps1, hn, m, ps2, rs, m1, rs1, hr => by + cases ps1 with + | nil => + rcases hr with ⟨rfl, _, rfl⟩ + rfl + | cons _ _ => simp at hn + | n + 1, [], _, m, ps2, rs, m1, rs1, hr => by + rcases hr with ⟨rfl, _, rfl⟩ + rfl + | n + 1, .P :: ps1, hn, m, ps2, rs, m1, rs1, hr => by + by_cases hmE : m = E + · subst hmE + have hr' : retf F ps1 (.T0 :: rs) = (m1, [], rs1) := by unfold retf at hr; exact hr + rw [List.cons_append, retf_E_P] + exact retf_app_n n ps1 (by simpa using hn) F ps2 (.T0 :: rs) m1 rs1 hr' + · by_cases hmF : m = F + · subst hmF + have hr' : retf E ps1 (.T1 :: rs) = (m1, [], rs1) := by unfold retf at hr; exact hr + rw [List.cons_append, retf_F_P] + exact retf_app_n n ps1 (by simpa using hn) E ps2 (.T1 :: rs) m1 rs1 hr' + · unfold retf at hr + simp only [hmE, hmF, ite_false] at hr + nomatch hr + | n + 1, .PZ :: ps1, hn, m, ps2, rs, m1, rs1, hr => by + by_cases hmE : m = E + · subst hmE + have hr' : retf E ps1 (.TZ :: rs) = (m1, [], rs1) := by unfold retf at hr; exact hr + rw [List.cons_append, retf_E_PZ] + exact retf_app_n n ps1 (by simpa using hn) E ps2 (.TZ :: rs) m1 rs1 hr' + · by_cases hmF : m = F + · subst hmF + cases ps1 with + | nil => nomatch hr + | cons p2 ps'' => + cases p2 with + | PZ => nomatch hr + | P => + cases rs with + | nil => nomatch hr + | cons r0 rs0 => + cases r0 with + | T1 => nomatch hr + | TZ => nomatch hr + | T0 => + have hr' : retf E ps'' (.T0 :: .TZ :: .T1 :: rs0) = (m1, [], rs1) := by unfold retf at hr; exact hr + have hlen : ps''.length ≤ n := by simp at hn; omega + rw [List.cons_append, List.cons_append, retf_F_PZ_P] + exact retf_app_n n ps'' hlen E ps2 (.T0 :: .TZ :: .T1 :: rs0) m1 rs1 hr' + · unfold retf at hr + simp only [hmE, hmF, ite_false] at hr + nomatch hr + +theorem retf_app (m : Fin 6) (ps1 ps2 : List ptok) (rs : List tok) (m1 : Fin 6) (rs1 : List tok) + (hr : retf m ps1 rs = (m1, [], rs1)) : + retf m (ps1 ++ ps2) rs = retf m1 ps2 rs1 := + retf_app_n ps1.length ps1 (Nat.le_refl _) m ps2 rs m1 rs1 hr + +theorem RB_E2 (n : Nat) (rs : List tok) : + retf E (([ptok.PZ, ptok.P] : List ptok) ^ (2 * n)) rs = + (E, [], (([tok.T0, tok.TZ, tok.T1, tok.TZ] : List tok) ^ n) ++ rs) := by + induction n generalizing rs with + | zero => rfl + | succ n ih => + have h2 : 2 * (n + 1) = (2 * n) + 1 + 1 := by omega + rw [h2, list_pow_succ, list_pow_succ] + simp only [List.cons_append, List.nil_append, retf_E_PZ, retf_E_P, retf_F_PZ_P] + rw [ih (.T0 :: .TZ :: .T1 :: .TZ :: rs)] + have hshift : (([tok.T0, tok.TZ, tok.T1, tok.TZ] : List tok) ^ n) ++ (.T0 :: .TZ :: .T1 :: .TZ :: rs) = + (([tok.T0, tok.TZ, tok.T1, tok.TZ] : List tok) ^ (n + 1)) ++ rs := by + change (([tok.T0, tok.TZ, tok.T1, tok.TZ] : List tok) ^ n) ++ ([tok.T0, tok.TZ, tok.T1, tok.TZ] ++ rs) = _ + rw [← List.append_assoc, lpow_shift] + rw [hshift] + +theorem RB_F2 (n : Nat) (rs : List tok) : + retf F (([ptok.PZ, ptok.P] : List ptok) ^ (2 * n)) (.T0 :: rs) = + (F, [], .T0 :: ((([tok.TZ, tok.T0, tok.TZ, tok.T1] : List tok) ^ n) ++ rs)) := by + induction n generalizing rs with + | zero => rfl + | succ n ih => + have h2 : 2 * (n + 1) = (2 * n) + 1 + 1 := by omega + rw [h2, list_pow_succ, list_pow_succ] + simp only [List.cons_append, List.nil_append, retf_F_PZ_P, retf_E_PZ, retf_E_P] + rw [ih (.TZ :: .T0 :: .TZ :: .T1 :: rs)] + have hshift : (([tok.TZ, tok.T0, tok.TZ, tok.T1] : List tok) ^ n) ++ (.TZ :: .T0 :: .TZ :: .T1 :: rs) = + (([tok.TZ, tok.T0, tok.TZ, tok.T1] : List tok) ^ (n + 1)) ++ rs := by + change (([tok.TZ, tok.T0, tok.TZ, tok.T1] : List tok) ^ n) ++ ([tok.TZ, tok.T0, tok.TZ, tok.T1] ++ rs) = _ + rw [← List.append_assoc, lpow_shift] + rw [hshift] + +theorem RB_E1 (n : Nat) (rs : List tok) : + retf E (([ptok.PZ, ptok.P] : List ptok) ^ (2 * n + 1)) rs = + (F, [], .T0 :: ((([tok.TZ, tok.T0, tok.TZ, tok.T1] : List tok) ^ n) ++ (.TZ :: rs))) := by + rw [list_pow_succ] + simp only [List.cons_append, List.nil_append, retf_E_PZ, retf_E_P] + exact RB_F2 n (.TZ :: rs) + +theorem RB_F1 (n : Nat) (rs : List tok) : + retf F (([ptok.PZ, ptok.P] : List ptok) ^ (2 * n + 1)) (.T0 :: rs) = + (E, [], (([tok.T0, tok.TZ, tok.T1, tok.TZ] : List tok) ^ n) ++ (.T0 :: .TZ :: .T1 :: rs)) := by + rw [list_pow_succ] + simp only [List.cons_append, List.nil_append, retf_F_PZ_P] + exact RB_E2 n (.T0 :: .TZ :: .T1 :: rs) + +theorem shift4 (n : Nat) : + [.T0, .TZ, .T1] ++ (([tok.TZ, tok.T0, tok.TZ, tok.T1] : List tok) ^ n) = + (([tok.T0, tok.TZ, tok.T1, tok.TZ] : List tok) ^ n) ++ [.T0, .TZ, .T1] := by + induction n with + | zero => rfl + | succ n ih => + rw [list_pow_succ, list_pow_succ] + have h1 : ([tok.T0, tok.TZ, tok.T1] : List tok) ++ ([.TZ, .T0, .TZ, .T1] ++ (([tok.TZ, tok.T0, tok.TZ, tok.T1] : List tok) ^ n)) = + [.T0, .TZ, .T1, .TZ] ++ ([.T0, .TZ, .T1] ++ (([tok.TZ, tok.T0, tok.TZ, tok.T1] : List tok) ^ n)) := rfl + rw [h1, ih, List.append_assoc] + +def dig (b : tok) (g : Nat) : List tok := b :: .TZ :: .T1 :: rep .TZ g + +@[simp] def LD (b : tok) : List Nat → List tok + | [] => [] + | g :: G' => dig b g ++ LD b G' + +theorem LD_app (b : tok) (G1 G2 : List Nat) : LD b (G1 ++ G2) = LD b G1 ++ LD b G2 := by + induction G1 with + | nil => rfl + | cons g G1 ih => simp only [List.cons_append, LD, ih, List.append_assoc] + +theorem LD_ones (b : tok) (r : Nat) : LD b (rep 1 r) = ([b, .TZ, .T1, .TZ] : List tok) ^ r := by + induction r with + | zero => rfl + | succ r ih => + rw [rep, LD, ih, list_pow_succ] + rfl + +theorem ctr_zero (gs : List Nat) : ctr gs 0 = LD .T0 gs ++ [.T0] := by + induction gs with + | nil => rfl + | cons g gs ih => simp only [ctr, bit, LD, dig, ih, List.cons_append, List.nil_append, List.append_assoc]; rfl + +theorem pow_pos (n : Nat) : 0 < 2 ^ n := Nat.two_pow_pos n + +theorem ctr_ones (gs : List Nat) : ctr gs (2 ^ (gs.length + 1) - 1) = LD .T1 gs ++ [.T1] := by + induction gs with + | nil => rfl + | cons g gs ih => + have hp := pow_pos (gs.length + 1) + have hlen : 2 ^ ((g :: gs).length + 1) - 1 = 2 * (2 ^ (gs.length + 1) - 1) + 1 := by + simp only [List.length_cons] + rw [pow2S (gs.length + 1)] + omega + rw [hlen, ctr_odd, ih] + simp only [LD, dig, List.cons_append, List.append_assoc] + +theorem noT0_TZ (a : Nat) : noT0 (rep .TZ a) := by + induction a with + | zero => trivial + | succ a ih => exact ih + +theorem noT0_LD1 (G : List Nat) : noT0 (LD .T1 G) := by + induction G with + | nil => trivial + | cons g G ih => + simp only [LD, dig] + exact noT0_app _ _ (noT0_TZ g) ih + +theorem noT0_U (q : Nat) : noT0 (([tok.T1, tok.TZ] : List tok) ^ q) := by + induction q with + | zero => trivial + | succ q ih => + rw [list_pow_succ] + exact ih + +theorem prc_TZ (a : Nat) : prc (rep .TZ a) = rep .PZ a := by + induction a with + | zero => rfl + | succ a ih => + have hcons : prc (.TZ :: rep .TZ a) = prc (rep .TZ a) ++ [.PZ] := by + simp only [prc, List.map_cons, proc, List.reverse_cons] + rw [rep, hcons, ih, repeat_snoc]; rfl + +theorem prc_U (q : Nat) : prc (([tok.T1, tok.TZ] : List tok) ^ q) = ([ptok.PZ, ptok.P] : List ptok) ^ q := by + induction q with + | zero => rfl + | succ q ih => + rw [list_pow_succ, prc_app, ih] + exact lpow_shift [ptok.PZ, ptok.P] q + +theorem prc_dig (g : Nat) : prc (dig .T1 g) = rep .PZ g ++ [.P, .PZ, .P] := by + change prc ([.T1, .TZ, .T1] ++ rep .TZ g) = _ + rw [prc_app, prc_TZ]; rfl + +@[simp] def flatMapDig : List Nat → List ptok + | [] => [] + | g :: gs => (rep .PZ g ++ [.P, .PZ, .P]) ++ flatMapDig gs + +theorem flatMapDig_app (xs ys : List Nat) : flatMapDig (xs ++ ys) = flatMapDig xs ++ flatMapDig ys := by + induction xs with + | nil => rfl + | cons x xs ih => simp only [List.cons_append, flatMapDig, ih, List.append_assoc] + +theorem prc_LD (G : List Nat) : prc (LD .T1 G) = flatMapDig G.reverse := by + induction G with + | nil => rfl + | cons g G ih => + simp only [LD, prc_app, ih, prc_dig, List.reverse_cons, flatMapDig_app, flatMapDig, List.append_nil] + +theorem retf_dig (g : Nat) (ps : List ptok) (rs : List tok) : + retf E (rep .PZ g ++ ([.P, .PZ, .P] ++ ps)) rs = retf E ps (dig .T0 g ++ rs) := by + induction g generalizing rs with + | zero => + simp only [rep, List.nil_append, List.cons_append, retf_E_P, retf_F_PZ_P] + rfl + | succ g ih => + rw [rep, List.cons_append, retf_E_PZ, ih (.TZ :: rs)] + have hdig : dig .T0 g ++ (.TZ :: rs) = dig .T0 (g + 1) ++ rs := by + simp only [dig, List.cons_append, List.append_assoc] + congr 3 + change rep tok.TZ g ++ ([.TZ] ++ rs) = _ + rw [← List.append_assoc, repeat_snoc]; rfl + rw [hdig] + +theorem retf_LD (G : List Nat) (ps : List ptok) (rs : List tok) : + retf E (prc (LD .T1 G) ++ ps) rs = retf E ps (LD .T0 G ++ rs) := by + induction G generalizing ps rs with + | nil => rfl + | cons g G ih => + simp only [LD, prc_app, List.append_assoc] + rw [ih, prc_dig, List.append_assoc, retf_dig] + +theorem retf_lead (a : Nat) (rs : List tok) : + retf E (rep .PZ a ++ [.P]) rs = (F, [], .T0 :: (rep .TZ a ++ rs)) := by + induction a generalizing rs with + | zero => rfl + | succ a ih => + rw [rep, List.cons_append, retf_E_PZ, ih (.TZ :: rs)] + have hrep : rep tok.TZ a ++ (.TZ :: rs) = rep tok.TZ (a + 1) ++ rs := by + change rep tok.TZ a ++ ([.TZ] ++ rs) = _ + rw [← List.append_assoc, repeat_snoc]; rfl + rw [hrep] + +theorem OvSweep (w : List tok) (hw : noT0 w) (l S : ListBlank (Fin 2)) : + (l {{A}}> (tw (.T0 :: w) +> S)) [target_tm]⊢⁺ ((pl (prc w ++ [.P]) +> l) {{C}}> S) := by + rw [tw_cons, str_app_assoc] + have s1 := AT0p l (tw w +> S) + have s2 := Csweep w hw (([0, 1] : List (Fin 2)) +> l) S + rw [pl_app, str_app_assoc] + exact stepPlus_stepStar_stepPlus s1 s2 + +def sfx (H : Bool) : List tok := if H then [.TZ] else [.TZ, .T1, .TZ] +def gsof (G : List Nat) (r1 : Nat) : List Nat := G ++ (2 :: rep 1 r1) +def qof (H : Bool) (r1 : Nat) : Nat := if H then 2 * r1 + 1 else 2 * (r1 + 1) +def ones (gs : List Nat) : Nat := 2 ^ (gs.length + 1) - 1 + +@[simp] theorem sfx_true : sfx true = [.TZ] := rfl +@[simp] theorem sfx_false : sfx false = [.TZ, .T1, .TZ] := rfl +@[simp] theorem qof_true (r1 : Nat) : qof true r1 = 2 * r1 + 1 := rfl +@[simp] theorem qof_false (r1 : Nat) : qof false r1 = 2 * (r1 + 1) := rfl + +theorem U2 (r : Nat) : ([tok.T1, .TZ, .T1, .TZ] : List tok) ^ r = ([tok.T1, .TZ] : List tok) ^ (2 * r) := by + induction r with + | zero => rfl + | succ r ih => + have h2 : 2 * (r + 1) = (2 * r) + 1 + 1 := by omega + rw [h2, list_pow_succ, list_pow_succ, list_pow_succ, ih] + rfl + +theorem body_ones (G : List Nat) (r1 : Nat) (H : Bool) : + ctr (gsof G r1) (ones (gsof G r1)) ++ sfx H = + LD .T1 G ++ (dig .T1 2 ++ (([tok.T1, .TZ] : List tok) ^ (qof H r1))) := by + unfold ones gsof + rw [ctr_ones, LD_app] + simp only [LD, LD_ones, U2, List.append_assoc] + congr 2 + cases H + · change ([tok.T1, tok.TZ] : List tok) ^ (2 * r1) ++ ([tok.T1, tok.TZ] ++ [tok.T1, tok.TZ]) = + ([tok.T1, tok.TZ] : List tok) ^ ((2 * r1 + 1) + 1) + rw [← List.append_assoc, lpow_shift, lpow_shift] + · exact lpow_shift ([tok.T1, tok.TZ] : List tok) (2 * r1) + +theorem body_zero (G : List Nat) (r1 : Nat) : + ctr (gsof G r1) 0 = LD .T0 G ++ (dig .T0 2 ++ ((([tok.T0, .TZ, .T1, .TZ] : List tok) ^ r1) ++ [.T0])) := by + unfold gsof + rw [ctr_zero, LD_app] + simp only [LD, LD_ones, List.append_assoc] + +theorem noT0_w (a : Nat) (G : List Nat) (q : Nat) : + noT0 (rep .TZ a ++ (LD .T1 G ++ (dig .T1 2 ++ (([tok.T1, .TZ] : List tok) ^ q)))) := + noT0_app _ _ (noT0_TZ a) (noT0_app _ _ (noT0_LD1 G) (noT0_app _ _ trivial (noT0_U q))) + +theorem prc_w (a : Nat) (G : List Nat) (q : Nat) : + prc (rep .TZ a ++ (LD .T1 G ++ (dig .T1 2 ++ (([tok.T1, .TZ] : List tok) ^ q)))) ++ [.P] = + (([ptok.PZ, ptok.P] : List ptok) ^ q) ++ ([.PZ, .PZ, .P, .PZ, .P] ++ (prc (LD .T1 G) ++ (rep .PZ a ++ [.P]))) := by + simp only [prc_app, prc_U, prc_TZ, prc_dig, List.append_assoc, List.cons_append, List.nil_append] + rfl + +theorem BNp (ps : List ptok) (l r : ListBlank (Fin 2)) : + ((pl ([.PZ, .PZ, .P, .PZ, .P] ++ ps) +> l) <{{F}} (([0, 0] : List (Fin 2)) +> r)) [target_tm]⊢* + ((([1, 0, 1, 0, 0, 1] : List (Fin 2)) +> (pl ps +> l)) {{A}}> (([0, 0, 0, 0, 1, 0, 0, 0, 1] : List (Fin 2)) +> r)) := by + rw [pl_app, str_app_assoc] + simp only [pl, pw, List.cons_append, List.nil_append] + execute + +theorem tw_T00Z1 : tw [.T0, .T0, .TZ, .T1] = ([0, 0, 0, 0, 1, 0, 0, 0, 1] : List (Fin 2)) := rfl + +theorem OvN1 (G : List Nat) (r1 a : Nat) (l St St' : ListBlank (Fin 2)) + (ht : ∀ l', (l' {{C}}> St) [target_tm]⊢* (l' <{{E}} St')) : + (l {{A}}> (tw (.T0 :: (rep .TZ a ++ (ctr (gsof G r1) (ones (gsof G r1)) ++ sfx true))) +> St)) [target_tm]⊢⁺ + ((([1, 0, 1, 0, 0, 1] : List (Fin 2)) +> (pl (prc (LD .T1 G) ++ (rep .PZ a ++ [.P])) +> l)) {{A}}> + (tw (.T0 :: (ctr (rep 1 r1) 0 ++ sfx false)) +> St')) := by + rw [body_ones] + have s1 := OvSweep (rep .TZ a ++ (LD .T1 G ++ (dig .T1 2 ++ (([tok.T1, .TZ] : List tok) ^ (qof true r1))))) + (noT0_w a G (qof true r1)) l St + rw [prc_w] at s1 + let X := prc (LD .T1 G) ++ (rep .PZ a ++ [.P]) + have s2 := ht (pl ((([ptok.PZ, ptok.P] : List ptok) ^ (qof true r1)) ++ ([.PZ, .PZ, .P, .PZ, .P] ++ X)) +> l) + have hr : retf E ((([ptok.PZ, ptok.P] : List ptok) ^ (qof true r1)) ++ ([.PZ, .PZ, .P, .PZ, .P] ++ X)) [] = + (F, [.PZ, .PZ, .P, .PZ, .P] ++ X, .T0 :: ((([tok.TZ, .T0, .TZ, .T1] : List tok) ^ r1) ++ [.TZ])) := by + exact retf_app E (([ptok.PZ, ptok.P] : List ptok) ^ (2 * r1 + 1)) ([.PZ, .PZ, .P, .PZ, .P] ++ X) [] F + (.T0 :: ((([tok.TZ, .T0, .TZ, .T1] : List tok) ^ r1) ++ [.TZ])) (RB_E1 r1 []) + have s3 := retf_spec ((([ptok.PZ, ptok.P] : List ptok) ^ (qof true r1)) ++ ([.PZ, .PZ, .P, .PZ, .P] ++ X)) + E [] F ([.PZ, .PZ, .P, .PZ, .P] ++ X) (.T0 :: ((([tok.TZ, .T0, .TZ, .T1] : List tok) ^ r1) ++ [.TZ])) hr l St' + rw [tw_T0_cons'] at s3 + have s4 := BNp X l (tw ((([tok.TZ, .T0, .TZ, .T1] : List tok) ^ r1) ++ [.TZ]) +> St') + have heq : tw (.T0 :: (ctr (rep 1 r1) 0 ++ sfx false)) +> St' = + (([0, 0, 0, 0, 1, 0, 0, 0, 1] : List (Fin 2)) +> (tw ((([tok.TZ, .T0, .TZ, .T1] : List tok) ^ r1) ++ [.TZ]) +> St')) := by + rw [ctr_zero, LD_ones] + have htok : (.T0 :: (((([tok.T0, .TZ, .T1, .TZ] : List tok) ^ r1) ++ [.T0]) ++ sfx false)) = + ([.T0, .T0, .TZ, .T1] ++ ((([tok.TZ, .T0, .TZ, .T1] : List tok) ^ r1) ++ [.TZ])) := by + simp only [sfx_false, List.cons_append, List.nil_append, List.append_assoc] + have hsh := (shift4 r1).symm + have hsh' := congrArg (fun u => tok.T0 :: (u ++ [.TZ])) hsh + simpa only [List.cons_append, List.nil_append, List.append_assoc] using hsh' + rw [htok, tw_app, str_app_assoc, tw_T00Z1] + rw [← heq] at s4 + exact stepPlus_stepStar_stepPlus s1 (stepStar_trans s2 (stepStar_trans s3 s4)) + +theorem OvN0 (G : List Nat) (r1 a : Nat) (l St S0 : ListBlank (Fin 2)) + (ht : ∀ l', (l' {{C}}> St) [target_tm]⊢* (l' <{{F}} (([0, 0] : List (Fin 2)) +> S0))) : + (l {{A}}> (tw (.T0 :: (rep .TZ a ++ (ctr (gsof G r1) (ones (gsof G r1)) ++ sfx false))) +> St)) [target_tm]⊢⁺ + ((([1, 0, 1, 0, 0, 1] : List (Fin 2)) +> (pl (prc (LD .T1 G) ++ (rep .PZ a ++ [.P])) +> l)) {{A}}> + (tw (.T0 :: (ctr (rep 1 (r1 + 1)) 0 ++ sfx true)) +> (([0, 1] : List (Fin 2)) +> S0))) := by + rw [body_ones] + have s1 := OvSweep (rep .TZ a ++ (LD .T1 G ++ (dig .T1 2 ++ (([tok.T1, .TZ] : List tok) ^ (qof false r1))))) + (noT0_w a G (qof false r1)) l St + rw [prc_w] at s1 + let X := prc (LD .T1 G) ++ (rep .PZ a ++ [.P]) + have s2 := ht (pl ((([ptok.PZ, ptok.P] : List ptok) ^ (qof false r1)) ++ ([.PZ, .PZ, .P, .PZ, .P] ++ X)) +> l) + have hr : retf F ((([ptok.PZ, ptok.P] : List ptok) ^ (qof false r1)) ++ ([.PZ, .PZ, .P, .PZ, .P] ++ X)) [.T0] = + (F, [.PZ, .PZ, .P, .PZ, .P] ++ X, .T0 :: ((([tok.TZ, .T0, .TZ, .T1] : List tok) ^ (r1 + 1)) ++ [])) := by + exact retf_app F (([ptok.PZ, ptok.P] : List ptok) ^ (2 * (r1 + 1))) ([.PZ, .PZ, .P, .PZ, .P] ++ X) [.T0] F + (.T0 :: ((([tok.TZ, .T0, .TZ, .T1] : List tok) ^ (r1 + 1)) ++ [])) (RB_F2 (r1 + 1) []) + have s3 := retf_spec ((([ptok.PZ, ptok.P] : List ptok) ^ (qof false r1)) ++ ([.PZ, .PZ, .P, .PZ, .P] ++ X)) + F [.T0] F ([.PZ, .PZ, .P, .PZ, .P] ++ X) (.T0 :: ((([tok.TZ, .T0, .TZ, .T1] : List tok) ^ (r1 + 1)) ++ [])) hr l S0 + rw [tw_T0_cons', List.append_nil, tw_T0_cons'] at s3 + have s4 := BNp X l (tw (([tok.TZ, .T0, .TZ, .T1] : List tok) ^ (r1 + 1)) +> S0) + have heq : tw (.T0 :: (ctr (rep 1 (r1 + 1)) 0 ++ sfx true)) +> (([0, 1] : List (Fin 2)) +> S0) = + (([0, 0, 0, 0, 1, 0, 0, 0, 1] : List (Fin 2)) +> (tw (([tok.TZ, .T0, .TZ, .T1] : List tok) ^ (r1 + 1)) +> S0)) := by + have h01 : (([0, 1] : List (Fin 2)) +> S0) = tw [.T1] +> S0 := rfl + rw [h01, ← str_app_assoc, ← tw_app, ctr_zero, LD_ones] + have htok : (.T0 :: (((([tok.T0, .TZ, .T1, .TZ] : List tok) ^ (r1 + 1)) ++ [.T0]) ++ sfx true)) ++ [.T1] = + [.T0, .T0, .TZ, .T1] ++ (([tok.TZ, .T0, .TZ, .T1] : List tok) ^ (r1 + 1)) := by + simp only [sfx_true, List.cons_append, List.nil_append, List.append_assoc] + have hsh := (shift4 (r1 + 1)).symm + simpa only [List.cons_append, List.nil_append, List.append_assoc] using congrArg (fun u => tok.T0 :: u) hsh + rw [htok, tw_app, str_app_assoc, tw_T00Z1] + rw [← heq] at s4 + exact stepPlus_stepStar_stepPlus s1 (stepStar_trans s2 (stepStar_trans s3 s4)) + +theorem OvS1 (G : List Nat) (r1 a : Nat) (l St S0 : ListBlank (Fin 2)) + (ht : ∀ l', (l' {{C}}> St) [target_tm]⊢* (l' <{{F}} (([0, 0] : List (Fin 2)) +> S0))) : + (l {{A}}> (tw (.T0 :: (rep .TZ a ++ (ctr (gsof G r1) (ones (gsof G r1)) ++ sfx true))) +> St)) [target_tm]⊢⁺ + (l <{{F}} (tw (.T0 :: (rep .TZ a ++ (ctr (gsof G r1) 0 ++ sfx true))) +> (([0, 1] : List (Fin 2)) +> S0))) := by + rw [body_ones] + have s1 := OvSweep (rep .TZ a ++ (LD .T1 G ++ (dig .T1 2 ++ (([tok.T1, .TZ] : List tok) ^ (qof true r1))))) + (noT0_w a G (qof true r1)) l St + rw [prc_w] at s1 + have s2 := ht (pl ((([ptok.PZ, ptok.P] : List ptok) ^ (qof true r1)) ++ ([.PZ, .PZ, .P, .PZ, .P] ++ (prc (LD .T1 G) ++ (rep .PZ a ++ [.P])))) +> l) + have hr : retf F ((([ptok.PZ, ptok.P] : List ptok) ^ (qof true r1)) ++ ([.PZ, .PZ, .P, .PZ, .P] ++ (prc (LD .T1 G) ++ (rep .PZ a ++ [.P])))) [.T0] = + (F, [], .T0 :: (rep .TZ a ++ (LD .T0 G ++ (dig .T0 2 ++ ((([tok.T0, .TZ, .T1, .TZ] : List tok) ^ r1) ++ [.T0, .TZ, .T1]))))) := by + have h1 := retf_app F (([ptok.PZ, ptok.P] : List ptok) ^ (2 * r1 + 1)) + ([.PZ, .PZ, .P, .PZ, .P] ++ (prc (LD .T1 G) ++ (rep .PZ a ++ [.P]))) [.T0] E + ((([tok.T0, .TZ, .T1, .TZ] : List tok) ^ r1) ++ [.T0, .TZ, .T1]) (RB_F1 r1 []) + simp only [qof_true] + rw [h1] + change retf E (rep .PZ 2 ++ ([.P, .PZ, .P] ++ (prc (LD .T1 G) ++ (rep .PZ a ++ [.P])))) + ((([tok.T0, .TZ, .T1, .TZ] : List tok) ^ r1) ++ [.T0, .TZ, .T1]) = _ + rw [retf_dig, retf_LD, retf_lead] + have s3 := retf_spec ((([ptok.PZ, ptok.P] : List ptok) ^ (qof true r1)) ++ ([.PZ, .PZ, .P, .PZ, .P] ++ (prc (LD .T1 G) ++ (rep .PZ a ++ [.P])))) + F [.T0] F [] (.T0 :: (rep .TZ a ++ (LD .T0 G ++ (dig .T0 2 ++ ((([tok.T0, .TZ, .T1, .TZ] : List tok) ^ r1) ++ [.T0, .TZ, .T1]))))) hr l S0 + rw [tw_T0_cons'] at s3 + simp only [pl, listblank_append_nil] at s3 + have heq : tw (.T0 :: (rep .TZ a ++ (ctr (gsof G r1) 0 ++ sfx true))) +> (([0, 1] : List (Fin 2)) +> S0) = + tw (.T0 :: (rep .TZ a ++ (LD .T0 G ++ (dig .T0 2 ++ ((([tok.T0, .TZ, .T1, .TZ] : List tok) ^ r1) ++ [.T0, .TZ, .T1]))))) +> S0 := by + have h01 : (([0, 1] : List (Fin 2)) +> S0) = tw [.T1] +> S0 := rfl + rw [h01, ← str_app_assoc, ← tw_app, body_zero] + simp only [sfx_true, List.cons_append, List.nil_append, List.append_assoc] + rw [← heq] at s3 + exact stepPlus_stepStar_stepPlus s1 (stepStar_trans s2 s3) + +-- High-Level Configurations & Zone / Orbit Lemmas (`KP`, `KX`, `Zones`, `NOrb`, `POrb`) +-- ============================================================================ + +def KP (W : ListBlank (Fin 2)) (p : Nat) (gs : List Nat) (v : Nat) (H : Bool) (St : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + W {{A}}> (tw (.T0 :: (rep .TZ p ++ (ctr gs v ++ sfx H))) +> St) + +def NN (gs : List Nat) : Nat := 2 ^ (gs.length + 1) + +theorem wall0 : (([1] : List (Fin 2)) +> (default : ListBlank (Fin 2))) = + (([1, 0] : List (Fin 2)) +> (([0] : List (Fin 2)) +> default)) := by + simp + +theorem P100 (n : Nat) (l : ListBlank (Fin 2)) (p : Nat) (gs : List Nat) (v : Nat) (H : Bool) (St : ListBlank (Fin 2)) + (hv : v + 2 < NN gs) : + (KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 1))) +> l)) p gs v H St) [target_tm]⊢* + (KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ n)) +> l)) (p + 1) gs (v + 2) H St) := by + have hL : (([1] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 1))) +> l) = + (([1, 0] : List (Fin 2)) +> (([0] : List (Fin 2)) +> ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ n)) +> l)))) := by + rw [list_pow_succ]; simp only [List.cons_append, List.nil_append, listblank_append_cons, listblank_append_nil] + unfold KP + rw [hL] + exact TwoInc gs v p (sfx H) ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ n)) +> l)) St hv + +theorem P100s (m : Nat) : ∀ (n : Nat) (l : ListBlank (Fin 2)) (p : Nat) (gs : List Nat) (v : Nat) (H : Bool) (St : ListBlank (Fin 2)), + 2 * m + v < NN gs → + (KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ (m + n))) +> l)) p gs v H St) [target_tm]⊢* + (KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ n)) +> l)) (m + p) gs (2 * m + v) H St) := by + induction m with + | zero => + intro n l p gs v H St _ + simp + try exact ⟨0, rfl⟩ + | succ m ih => + intro n l p gs v H St hv + have hm : m + 1 + n = (m + n) + 1 := by omega + rw [hm] + have s1 := P100 (m + n) l p gs v H St (by omega) + have s2 := ih n l (p + 1) gs (v + 2) H St (by omega) + have hp : m + (p + 1) = (m + 1) + p := by omega + have hv' : 2 * m + (v + 2) = 2 * (m + 1) + v := by omega + rw [hp, hv'] at s2 + exact stepStar_trans s1 s2 + +theorem WX (p : Nat) (gs : List Nat) (v : Nat) (H : Bool) (St : ListBlank (Fin 2)) + (hv : v + 2 < NN gs) : + (KP (([1] : List (Fin 2)) +> default) p gs v H St) [target_tm]⊢* + (KP default (p + 1) gs (v + 2) H St) := by + unfold KP + rw [wall0] + exact TwoInc gs v p (sfx H) default St hv + +theorem stepStar_F_A_of_eq {R₁ R₂ R₁' R₂' : ListBlank (Fin 2)} + (h₁ : R₁' = R₁) (h₂ : R₂' = R₂) + (h : (default <{{F}} R₁) [target_tm]⊢* (default {{A}}> R₂)) : + (default <{{F}} R₁') [target_tm]⊢* (default {{A}}> R₂') := by + subst h₁; subst h₂; exact h + +theorem tw_bnc1 (a : Nat) (xs : List tok) : + tw (.T0 :: (rep .TZ (a + 1) ++ xs)) = [0, 0] ++ ([1, 0, 0] ++ tw (rep .TZ a ++ xs)) := rfl + +theorem tw_bnc2 (a : Nat) (xs : List tok) : + tw (.T0 :: (rep .TZ (a + 2) ++ xs)) = [0, 0] ++ ([1, 0, 0] ++ ([1, 0, 0] ++ tw (rep .TZ a ++ xs))) := rfl + +theorem Bnc_h1_a (a : Nat) (xs : List tok) (St : ListBlank (Fin 2)) : + tw (.T0 :: (rep .TZ (a + 1) ++ xs)) +> St = + ([0, 0] ++ ([1, 0, 0] ++ tw (rep .TZ a ++ xs))) +> St := + congrArg (fun l => l +> St) (tw_bnc1 a xs) + +theorem Bnc_h1_b (ys : List (Fin 2)) (St : ListBlank (Fin 2)) : + ([0, 0] ++ ([1, 0, 0] ++ ys)) +> St = + ([0, 0] : List (Fin 2)) +> (([1, 0, 0] ++ ys) +> St) := + str_app_assoc [0, 0] ([1, 0, 0] ++ ys) St + +theorem Bnc_h1_c (ys : List (Fin 2)) (St : ListBlank (Fin 2)) : + ([0, 0] : List (Fin 2)) +> (([1, 0, 0] ++ ys) +> St) = + ([0, 0] : List (Fin 2)) +> (([1, 0, 0] : List (Fin 2)) +> (ys +> St)) := + congrArg (fun r => ([0, 0] : List (Fin 2)) +> r) (str_app_assoc [1, 0, 0] ys St) + +theorem Bnc_h1 (a : Nat) (xs : List tok) (St : ListBlank (Fin 2)) : + tw (.T0 :: (rep .TZ (a + 1) ++ xs)) +> St = + ([0, 0] : List (Fin 2)) +> (([1, 0, 0] : List (Fin 2)) +> (tw (rep .TZ a ++ xs) +> St)) := by + have ha := Bnc_h1_a a xs St + have hb := Bnc_h1_b (tw (rep .TZ a ++ xs)) St + have hc := Bnc_h1_c (tw (rep .TZ a ++ xs)) St + exact Eq.trans ha (Eq.trans hb hc) + +theorem Bnc_h2_a (a : Nat) (xs : List tok) (St : ListBlank (Fin 2)) : + tw (.T0 :: (rep .TZ (a + 2) ++ xs)) +> St = + ([0, 0] ++ ([1, 0, 0] ++ ([1, 0, 0] ++ tw (rep .TZ a ++ xs)))) +> St := + congrArg (fun l => l +> St) (tw_bnc2 a xs) + +theorem Bnc_h2_b (ys : List (Fin 2)) (St : ListBlank (Fin 2)) : + ([0, 0] ++ ([1, 0, 0] ++ ([1, 0, 0] ++ ys))) +> St = + ([0, 0] : List (Fin 2)) +> (([1, 0, 0] : List (Fin 2)) +> (([1, 0, 0] : List (Fin 2)) +> (ys +> St))) := by + have h1 := str_app_assoc [0, 0] ([1, 0, 0] ++ ([1, 0, 0] ++ ys)) St + have h2 := Bnc_h1_c ([1, 0, 0] ++ ys) St + have h3 := congrArg (fun r => ([0, 0] : List (Fin 2)) +> (([1, 0, 0] : List (Fin 2)) +> r)) (str_app_assoc [1, 0, 0] ys St) + exact Eq.trans h1 (Eq.trans h2 h3) + +theorem Bnc_h2 (a : Nat) (xs : List tok) (St : ListBlank (Fin 2)) : + tw (.T0 :: (rep .TZ (a + 2) ++ xs)) +> St = + ([0, 0] : List (Fin 2)) +> (([1, 0, 0] : List (Fin 2)) +> (([1, 0, 0] : List (Fin 2)) +> (tw (rep .TZ a ++ xs) +> St))) := by + have ha := Bnc_h2_a a xs St + have hb := Bnc_h2_b (tw (rep .TZ a ++ xs)) St + exact Eq.trans ha hb + +theorem Bnc_TZ (a : Nat) (xs : List tok) (St : ListBlank (Fin 2)) : + (default <{{F}} (tw (.T0 :: (rep .TZ (a + 1) ++ xs)) +> St)) [target_tm]⊢* + (default {{A}}> (tw (.T0 :: (rep .TZ (a + 2) ++ xs)) +> St)) := by + have h1 := Bnc_h1 a xs St + have h2 := Bnc_h2 a xs St + have hb := Bnc (tw (rep .TZ a ++ xs) +> St) + exact stepStar_F_A_of_eq h1 h2 hb + +theorem Inc1 (a : Nat) (gs : List Nat) (v : Nat) (H : Bool) (St : ListBlank (Fin 2)) + (hv : v + 1 < NN gs) : + (KP default (a + 1) gs v H St) [target_tm]⊢* + (KP default (a + 2) gs (v + 1) H St) := by + have s1 := IncL gs v (a + 1) hv default St (sfx H) + have s2 := Bnc_TZ a (ctr gs (v + 1) ++ sfx H) St + exact stepStar_trans s1 s2 + +theorem Incs (m : Nat) : ∀ (a : Nat) (gs : List Nat) (v : Nat) (H : Bool) (St : ListBlank (Fin 2)), + m + v < NN gs → + (KP default (a + 1) gs v H St) [target_tm]⊢* + (KP default (m + (a + 1)) gs (m + v) H St) := by + induction m with + | zero => + intro a gs v H St _ + simp + try exact ⟨0, rfl⟩ + | succ m ih => + intro a gs v H St hv + have s1 := Inc1 a gs v H St (by omega) + have s2 := ih (a + 1) gs (v + 1) H St (by omega) + have ha : m + (a + 2) = (m + 1) + (a + 1) := by omega + have hv' : m + (v + 1) = (m + 1) + v := by omega + rw [ha, hv'] at s2 + exact stepStar_trans s1 s2 + +@[simp] def zw : List Nat → List (Fin 2) + | [] => [] + | g :: L' => [1, 0, 0, 1] ++ ((([0, 1, 0] : List (Fin 2)) ^ (g + 1)) ++ zw L') + +@[simp] def zv : List Nat → Nat → Nat + | [], v => v + | g :: L', v => zv L' (2 * v + 2 * g) + +@[simp] def zg : List Nat → Nat → List Nat → List Nat + | [], _, gs => gs + | g :: L', p, gs => zg L' (g - 2) ((p + 2) :: gs) + +@[simp] def zp : List Nat → Nat → Nat + | [], p => p + | g :: L', _ => zp L' (g - 2) + +theorem P010s (m : Nat) : ∀ (X : List (Fin 2)) (Y : ListBlank (Fin 2)) (p : Nat) (gs : List Nat) (v : Nat) (H : Bool) (St : ListBlank (Fin 2)), + 2 * m + v < NN gs → + (KP ((([1, 0] ++ ((([0, 1, 0] : List (Fin 2)) ^ m) ++ X)) +> Y)) p gs v H St) [target_tm]⊢* + (KP ((([1, 0] ++ X) +> Y)) (m + p) gs (2 * m + v) H St) := by + induction m with + | zero => + intro X Y p gs v H St _ + simp + try exact ⟨0, rfl⟩ + | succ m ih => + intro X Y p gs v H St hv + have hL : (([1, 0] ++ ((([0, 1, 0] : List (Fin 2)) ^ (m + 1)) ++ X)) +> Y) = + (([1, 0] : List (Fin 2)) +> (([0] : List (Fin 2)) +> ((([1, 0] ++ ((([0, 1, 0] : List (Fin 2)) ^ m) ++ X)) +> Y)))) := by + rw [list_pow_succ]; simp only [List.cons_append, List.nil_append, listblank_append_cons, listblank_append_nil] + have s1 : (KP ((([1, 0] ++ ((([0, 1, 0] : List (Fin 2)) ^ (m + 1)) ++ X)) +> Y)) p gs v H St) [target_tm]⊢* + (KP ((([1, 0] ++ ((([0, 1, 0] : List (Fin 2)) ^ m) ++ X)) +> Y)) (p + 1) gs (v + 2) H St) := by + unfold KP + rw [hL] + exact TwoInc gs v p (sfx H) ((([1, 0] ++ ((([0, 1, 0] : List (Fin 2)) ^ m) ++ X)) +> Y)) St (by unfold NN at hv; omega) + have s2 := ih X Y (p + 1) gs (v + 2) H St (by omega) + have hp : m + (p + 1) = (m + 1) + p := by omega + have hv' : 2 * m + (v + 2) = 2 * (m + 1) + v := by omega + rw [hp, hv'] at s2 + exact stepStar_trans s1 s2 + +theorem Zone (g : Nat) (L : List Nat) (X : List (Fin 2)) (Y : ListBlank (Fin 2)) + (p : Nat) (gs : List Nat) (v : Nat) (H : Bool) (St : ListBlank (Fin 2)) + (hg : 2 ≤ g) (hv : v + g < NN gs) : + (KP ((([1, 0] ++ (zw (g :: L) ++ X)) +> Y)) p gs v H St) [target_tm]⊢* + (KP ((([1, 0] ++ (zw L ++ X)) +> Y)) (g - 2) ((p + 2) :: gs) (2 * v + 2 * g) H St) := by + obtain ⟨g', rfl⟩ : ∃ g', g = g' + 2 := ⟨g - 2, by omega⟩ + have hsub : g' + 2 - 2 = g' := by omega + rw [hsub] + have hL : (([1, 0] ++ (zw ((g' + 2) :: L) ++ X)) +> Y) = + (([1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0] : List (Fin 2)) +> + (([0] : List (Fin 2)) +> ((([1, 0] ++ ((([0, 1, 0] : List (Fin 2)) ^ g') ++ (zw L ++ X))) +> Y)))) := by + simp only [zw, pow_succ_list, List.cons_append, List.nil_append, List.append_assoc, listblank_append_cons, listblank_append_nil] + have s1 : (KP ((([1, 0] ++ (zw ((g' + 2) :: L) ++ X)) +> Y)) p gs v H St) [target_tm]⊢* + (KP ((([1, 0] ++ ((([0, 1, 0] : List (Fin 2)) ^ g') ++ (zw L ++ X))) +> Y)) 0 ((p + 2) :: gs) (2 * (v + 2)) H St) := by + unfold KP + rw [hL] + exact ZXg gs v p (sfx H) ((([1, 0] ++ ((([0, 1, 0] : List (Fin 2)) ^ g') ++ (zw L ++ X))) +> Y)) St (by unfold NN at hv; omega) + have hbound : 2 * g' + 2 * (v + 2) < NN ((p + 2) :: gs) := by + unfold NN at hv ⊢ + simp only [List.length_cons] + rw [pow2S (gs.length + 1)] + omega + have s2 := P010s g' (zw L ++ X) Y 0 ((p + 2) :: gs) (2 * (v + 2)) H St hbound + have hp : g' + 0 = g' := by omega + have hv' : 2 * g' + 2 * (v + 2) = 2 * v + 2 * (g' + 2) := by omega + rw [hp, hv'] at s2 + exact stepStar_trans s1 s2 + +theorem zv_ge (L : List Nat) : ∀ v, 2 ^ L.length * v ≤ zv L v := by + induction L with + | nil => intro v; simp + | cons g L ih => + intro v + have h := ih (2 * v + 2 * g) + simp only [zv, List.length_cons, pow2S] + have hle : 2 * 2 ^ L.length * v ≤ 2 ^ L.length * (2 * v + 2 * g) := by + have h1 : 2 * 2 ^ L.length * v = 2 ^ L.length * (2 * v) := by ring + rw [h1] + exact Nat.mul_le_mul_left (2 ^ L.length) (by omega) + exact Nat.le_trans hle h + +theorem zg_len (L : List Nat) : ∀ p gs, (zg L p gs).length = L.length + gs.length := by + induction L with + | nil => intro p gs; simp + | cons g L ih => intro p gs; simp [zg, ih]; omega + +@[simp] def AllGe2 : List Nat → Prop + | [] => True + | g :: L => 2 ≤ g ∧ AllGe2 L + +theorem AllGe2_app (L1 L2 : List Nat) (h1 : AllGe2 L1) (h2 : AllGe2 L2) : AllGe2 (L1 ++ L2) := by + induction L1 with + | nil => exact h2 + | cons g L1 ih => exact ⟨h1.1, ih h1.2⟩ + +theorem AllGe2_rev (L : List Nat) (h : AllGe2 L) : AllGe2 L.reverse := by + induction L with + | nil => trivial + | cons g L ih => + simp only [List.reverse_cons] + exact AllGe2_app L.reverse [g] (ih h.2) ⟨h.1, trivial⟩ + +theorem Zones (L : List Nat) (hL : AllGe2 L) : + ∀ (X : List (Fin 2)) (Y : ListBlank (Fin 2)) (p : Nat) (gs : List Nat) (v : Nat) (H : Bool) (St : ListBlank (Fin 2)), + zv L v < 2 ^ ((gs.length + 1) + L.length) → + (KP ((([1, 0] ++ (zw L ++ X)) +> Y)) p gs v H St) [target_tm]⊢* + (KP ((([1, 0] ++ X) +> Y)) (zp L p) (zg L p gs) (zv L v) H St) := by + induction L with + | nil => + intro X Y p gs v H St _ + simp [zw, zp, zg, zv] + try exact ⟨0, rfl⟩ + | cons g L ih => + intro X Y p gs v H St hv + rcases hL with ⟨hg, hL'⟩ + simp only [zv, zp, zg, List.length_cons] at hv ⊢ + have hz := zv_ge L (2 * v + 2 * g) + have hn : v + g < NN gs := by + unfold NN + have he : 2 ^ ((gs.length + 1) + (L.length + 1)) = 2 ^ L.length * (2 * 2 ^ (gs.length + 1)) := by + rw [← Nat.add_assoc, pow2S, Nat.pow_add]; ring + rw [he] at hv + have hp := pow_pos L.length + nlinarith + have s1 := Zone g L X Y p gs v H St hg hn + have heq : (((p + 2) :: gs).length + 1) + L.length = (gs.length + 1) + (L.length + 1) := by + simp; omega + have s2 := ih hL' X Y (g - 2) ((p + 2) :: gs) (2 * v + 2 * g) H St (by rw [heq]; exact hv) + exact stepStar_trans s1 s2 + +@[simp] def gval : List Nat → Nat + | [] => 0 + | g :: G' => 2 * (g + gval G') + +theorem zv_app (L1 L2 : List Nat) : ∀ v, zv (L1 ++ L2) v = zv L2 (zv L1 v) := by + induction L1 with + | nil => intro v; rfl + | cons g L1 ih => intro v; exact ih (2 * v + 2 * g) + +theorem zp_app (L1 L2 : List Nat) : ∀ p, zp (L1 ++ L2) p = zp L2 (zp L1 p) := by + induction L1 with + | nil => intro p; rfl + | cons g L1 ih => intro p; exact ih (g - 2) + +theorem zg_app (L1 L2 : List Nat) : ∀ p gs, zg (L1 ++ L2) p gs = zg L2 (zp L1 p) (zg L1 p gs) := by + induction L1 with + | nil => intro p gs; rfl + | cons g L1 ih => intro p gs; exact ih (g - 2) ((p + 2) :: gs) + +theorem zw_app (L1 L2 : List Nat) : zw (L1 ++ L2) = zw L1 ++ zw L2 := by + induction L1 with + | nil => rfl + | cons g L1 ih => simp [zw, ih, List.append_assoc] + +theorem zv_rev (G : List Nat) : zv G.reverse 0 = gval G := by + induction G with + | nil => rfl + | cons g G ih => + simp [List.reverse_cons, zv_app, ih, gval] + omega + +theorem zg_rev (G gs0 : List Nat) (hG : AllGe2 G) : + (zp G.reverse 0 + 2) :: zg G.reverse 0 gs0 = G ++ (2 :: gs0) := by + induction G with + | nil => rfl + | cons g G ih => + rcases hG with ⟨hg, hG'⟩ + simp only [List.reverse_cons, zp_app, zg_app, zp, zg] + rw [ih hG'] + have hsub : g - 2 + 2 = g := by omega + simp [hsub] + +theorem zp_rev_last (G : List Nat) (p : Nat) : zp (G.reverse ++ [p]) 0 = p - 2 := by + rw [zp_app]; rfl + +theorem zv_rev_last (G : List Nat) (p : Nat) : zv (G.reverse ++ [p]) 0 = 2 * gval G + 2 * p := by + rw [zv_app, zv_rev]; rfl + +theorem zg_rev_last (G : List Nat) (p : Nat) (gs0 : List Nat) (hG : AllGe2 G) : + zg (G.reverse ++ [p]) 0 gs0 = G ++ (2 :: gs0) := by + rw [zg_app]; exact zg_rev G gs0 hG + +theorem pl_lead (a : Nat) : pl (rep .PZ a ++ [.P]) = [0, 1] ++ (([0, 0, 1] : List (Fin 2)) ^ a) := by + induction a with + | zero => rfl + | succ a ih => + rw [rep, List.cons_append, pl, pw, ih, list_pow_succ]; rfl + +theorem pl_PZ (g : Nat) : pl (rep .PZ g) = ([0, 1, 0] : List (Fin 2)) ^ g := by + induction g with + | zero => rfl + | succ g ih => + rw [rep, pl, pw, ih, list_pow_succ] + +theorem zw_LD_gen (L : List Nat) : + ([1, 0, 0, 1] : List (Fin 2)) ++ pl (flatMapDig L) = zw L ++ [1, 0, 0, 1] := by + induction L with + | nil => rfl + | cons g L ih => + simp only [flatMapDig, zw, pl_app, pl_PZ, pl, pw, List.cons_append, List.nil_append, List.append_assoc] + have ih' : (1 :: 0 :: 0 :: 1 :: pl (flatMapDig L)) = zw L ++ [1, 0, 0, 1] := ih + rw [ih'] + change (1 : Fin 2) :: 0 :: 0 :: 1 :: ((([0, 1, 0] : List (Fin 2)) ^ g) ++ ([0, 1, 0] ++ (zw L ++ [1, 0, 0, 1]))) = _ + rw [← List.append_assoc ((([0, 1, 0] : List (Fin 2)) ^ g)), lpow_shift] + +theorem wallOv (G : List Nat) (W : List ptok) (l : ListBlank (Fin 2)) : + (([1, 0, 1, 0, 0, 1] : List (Fin 2)) +> (pl (prc (LD .T1 G) ++ W) +> l)) = + (([1, 0] ++ (zw G.reverse ++ ([1, 0, 0, 1] ++ pl W))) +> l) := by + rw [← str_app_assoc, pl_app, prc_LD] + congr 1 + change ([1, 0] ++ [1, 0, 0, 1]) ++ (pl (flatMapDig G.reverse) ++ pl W) = _ + rw [List.append_assoc [1, 0], ← List.append_assoc [1, 0, 0, 1], zw_LD_gen] + simp [List.append_assoc] + +theorem wallPO (G : List Nat) (p n : Nat) (l : ListBlank (Fin 2)) : + (([1, 0] ++ (zw G.reverse ++ ([1, 0, 0, 1] ++ pl (rep .PZ p ++ [.P])))) +> + ((([0, 0, 0, 1] ++ (([0, 0, 1] : List (Fin 2)) ^ n)) +> l))) = + (([1, 0] ++ (zw (G.reverse ++ [p]) ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 1)))) +> l) := by + rw [← str_app_assoc, zw_app, pl_app, pl_PZ] + congr 1 + simp only [zw, List.append_nil, List.append_assoc] + congr 3 + change (([0, 1, 0] : List (Fin 2)) ^ p) ++ ([0, 1, 0] ++ ([0, 0, 1] ++ (([0, 0, 1] : List (Fin 2)) ^ n))) = + (([0, 1, 0] : List (Fin 2)) ^ (p + 1)) ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 1)) + rw [← List.append_assoc ((([0, 1, 0] : List (Fin 2)) ^ p)), lpow_shift] + rfl + +theorem ZXN (a : Nat) (l : ListBlank (Fin 2)) (p : Nat) (gs : List Nat) (v : Nat) (H : Bool) (St : ListBlank (Fin 2)) + (hv : v + 2 < NN gs) : + (KP ((([1, 0] ++ ([1, 0, 0, 1] ++ pl (rep .PZ (a + 2) ++ [.P]))) +> l)) p gs v H St) [target_tm]⊢* + (KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ a)) +> l)) 0 ((p + 2) :: gs) (2 * (v + 2)) H St) := by + unfold KP + rw [pl_lead] + have hL : (([1, 0] ++ ([1, 0, 0, 1] ++ ([0, 1] ++ (([0, 0, 1] : List (Fin 2)) ^ (a + 2))))) +> l) = + (([1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0] : List (Fin 2)) +> (([0] : List (Fin 2)) +> ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ a)) +> l)))) := by + rw [list_pow_succ, list_pow_succ]; simp only [List.cons_append, List.nil_append, listblank_append_cons, listblank_append_nil] + rw [hL] + exact ZXg gs v p (sfx H) ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ a)) +> l)) St hv + +theorem ZXP (n : Nat) (l : ListBlank (Fin 2)) (p : Nat) (gs : List Nat) (v : Nat) (H : Bool) (St : ListBlank (Fin 2)) + (hv : v + 3 < NN gs) : + (KP ((([1, 0] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 3))) +> l)) p gs v H St) [target_tm]⊢* + (KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ n)) +> l)) 0 ((p + 1) :: gs) (2 * (v + 3)) H St) := by + have hL1 : (([1, 0] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 3))) +> l) = + (([1, 0] : List (Fin 2)) +> (([0] : List (Fin 2)) +> ((([0, 1] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 2))) +> l)))) := by + rw [list_pow_succ]; simp only [List.cons_append, List.nil_append, listblank_append_cons, listblank_append_nil] + have s1 : (KP ((([1, 0] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 3))) +> l)) p gs v H St) [target_tm]⊢* + (KP ((([0, 1] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 2))) +> l)) (p + 1) gs (v + 2) H St) := by + unfold KP + rw [hL1] + exact TwoInc gs v p (sfx H) ((([0, 1] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 2))) +> l)) St (by unfold NN at hv; omega) + have hL2 : (([0, 1] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 2))) +> l) = + (([0, 1, 0, 0, 1, 0] : List (Fin 2)) +> (([0] : List (Fin 2)) +> ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ n)) +> l)))) := by + rw [list_pow_succ, list_pow_succ]; simp only [List.cons_append, List.nil_append, listblank_append_cons, listblank_append_nil] + have s2 : (KP ((([0, 1] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 2))) +> l)) (p + 1) gs (v + 2) H St) [target_tm]⊢* + (KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ n)) +> l)) 0 ((p + 1) :: gs) (2 * (v + 3)) H St) := by + unfold KP + rw [hL2] + exact ZXP2g gs (v + 2) (p + 1) (sfx H) ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ n)) +> l)) St hv + exact stepStar_trans s1 s2 + +def OvNp (H : Bool) (r1 : Nat) (St : ListBlank (Fin 2)) (H' : Bool) (r1' : Nat) (St' : ListBlank (Fin 2)) : Prop := + ∀ G a l, + (l {{A}}> (tw (.T0 :: (rep .TZ a ++ (ctr (gsof G r1) (ones (gsof G r1)) ++ sfx H))) +> St)) [target_tm]⊢⁺ + ((([1, 0, 1, 0, 0, 1] : List (Fin 2)) +> (pl (prc (LD .T1 G) ++ (rep .PZ a ++ [.P])) +> l)) {{A}}> + (tw (.T0 :: (ctr (rep 1 r1') 0 ++ sfx H')) +> St')) + +def OvSp (r1 : Nat) (St St' : ListBlank (Fin 2)) : Prop := + ∀ G a l, + (l {{A}}> (tw (.T0 :: (rep .TZ a ++ (ctr (gsof G r1) (ones (gsof G r1)) ++ sfx true))) +> St)) [target_tm]⊢⁺ + (l <{{F}} (tw (.T0 :: (rep .TZ a ++ (ctr (gsof G r1) 0 ++ sfx true))) +> St')) + +theorem OvNp1 (r1 : Nat) (St St' : ListBlank (Fin 2)) + (ht : ∀ l', (l' {{C}}> St) [target_tm]⊢* (l' <{{E}} St')) : + OvNp true r1 St false r1 St' := + fun G a l => OvN1 G r1 a l St St' ht + +theorem OvNp0 (r1 : Nat) (St S0 : ListBlank (Fin 2)) + (ht : ∀ l', (l' {{C}}> St) [target_tm]⊢* (l' <{{F}} (([0, 0] : List (Fin 2)) +> S0))) : + OvNp false r1 St true (r1 + 1) (([0, 1] : List (Fin 2)) +> S0) := + fun G a l => OvN0 G r1 a l St S0 ht + +theorem OvSp1 (r1 : Nat) (St S0 : ListBlank (Fin 2)) + (ht : ∀ l', (l' {{C}}> St) [target_tm]⊢* (l' <{{F}} (([0, 0] : List (Fin 2)) +> S0))) : + OvSp r1 St (([0, 1] : List (Fin 2)) +> S0) := + fun G a l => OvS1 G r1 a l St S0 ht + +theorem len_gsof (G : List Nat) (r1 : Nat) : (gsof G r1).length = G.length + (r1 + 1) := by + simp [gsof, rep_length] + +theorem pS (k r : Nat) : 2 ^ (k + (r + 1)) = 2 * 2 ^ (k + r) := by + rw [← Nat.add_assoc, pow2S] + +theorem NN_gsof (G : List Nat) (r1 : Nat) : NN (gsof G r1) = 4 * 2 ^ (G.length + r1) := by + unfold NN + rw [len_gsof] + have h1 : G.length + (r1 + 1) + 1 = (G.length + r1) + 1 + 1 := by omega + rw [h1, pow2S, pow2S]; ring + +theorem ones_gsof (G : List Nat) (r1 : Nat) : ones (gsof G r1) = 4 * 2 ^ (G.length + r1) - 1 := by + unfold ones + have h := NN_gsof G r1 + unfold NN at h + omega + +theorem Q_cons (g : Nat) (G : List Nat) (r1 : Nat) : + 2 ^ ((g :: G).length + (r1 + 1)) = 4 * 2 ^ (G.length + r1) := by + simp only [List.length_cons] + have h1 : G.length + 1 + (r1 + 1) = (G.length + r1) + 1 + 1 := by omega + rw [h1, pow2S, pow2S]; ring + +theorem KP_eq (W : ListBlank (Fin 2)) (p p' : Nat) (gs : List Nat) (v v' : Nat) (H : Bool) (St : ListBlank (Fin 2)) + (hp : p = p') (hv : v = v') : KP W p gs v H St = KP W p' gs v' H St := by + subst hp; subst hv; rfl + +theorem stepStar_KP_r {c₁ : Cfg (Fin 2) (Fin 6)} {W : ListBlank (Fin 2)} {p p' : Nat} {gs gs' : List Nat} {v v' : Nat} {H : Bool} {St : ListBlank (Fin 2)} + (h : c₁ [target_tm]⊢* KP W p gs v H St) (hp : p = p') (hgs : gs = gs') (hv : v = v') : + c₁ [target_tm]⊢* KP W p' gs' v' H St := by + subst hp; subst hgs; subst hv; exact h + +theorem stepPlus_KP_pow_r {c₁ : Cfg (Fin 2) (Fin 6)} {e e' : Nat} {l : ListBlank (Fin 2)} {p : Nat} {gs : List Nat} {v : Nat} {H : Bool} {St : ListBlank (Fin 2)} + (h : c₁ [target_tm]⊢⁺ KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ e)) +> l)) p gs v H St) (he : e = e') : + c₁ [target_tm]⊢⁺ KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ e')) +> l)) p gs v H St := by + subst he; exact h + +theorem stepStar_KP_pow_r {c₁ : Cfg (Fin 2) (Fin 6)} {e e' : Nat} {l : ListBlank (Fin 2)} {p : Nat} {gs : List Nat} {v : Nat} {H : Bool} {St : ListBlank (Fin 2)} + (h : c₁ [target_tm]⊢* KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ e)) +> l)) p gs v H St) (he : e = e') : + c₁ [target_tm]⊢* KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ e')) +> l)) p gs v H St := by + subst he; exact h + +theorem stepStar_KP_pow0_r {c₁ : Cfg (Fin 2) (Fin 6)} {l : ListBlank (Fin 2)} {p : Nat} {gs : List Nat} {v : Nat} {H : Bool} {St : ListBlank (Fin 2)} + (h : c₁ [target_tm]⊢* KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ 0)) +> l)) p gs v H St) : + c₁ [target_tm]⊢* KP (([1] : List (Fin 2)) +> l) p gs v H St := h + +theorem ones_S (gs : List Nat) : (ones gs - 1) + 1 = ones gs := by + unfold ones + have hp := pow_pos gs.length + rw [pow2S] + omega + +theorem ones_lt (gs : List Nat) : ones gs < NN gs := by + unfold ones NN + have hp := pow_pos (gs.length + 1) + omega + +theorem NOrb (H : Bool) (r1 : Nat) (St : ListBlank (Fin 2)) (H' : Bool) (r1' : Nat) (St' : ListBlank (Fin 2)) + (G : List Nat) (a : Nat) + (hov : OvNp H r1 St H' r1' St') (hG : AllGe2 G) + (hv : gval G + 2 < 2 ^ (G.length + (r1' + 1))) : + (KP default (a + 2) (gsof G r1) (ones (gsof G r1)) H St) [target_tm]⊢⁺ + (KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ a)) +> default)) 0 (gsof G r1') (2 * gval G + 4) H' St') := by + have s1 := hov G (a + 2) default + rw [wallOv] at s1 + have hGr : AllGe2 G.reverse := AllGe2_rev G hG + have hz : zv G.reverse 0 < 2 ^ (((rep 1 r1').length + 1) + G.reverse.length) := by + rw [zv_rev, rep_length, List.length_reverse] + have heq : (r1' + 1) + G.length = G.length + (r1' + 1) := by omega + rw [heq]; omega + have s2 := Zones G.reverse hGr ([1, 0, 0, 1] ++ pl (rep .PZ (a + 2) ++ [.P])) default 0 (rep 1 r1') 0 H' St' hz + have hx : zv G.reverse 0 + 2 < NN (zg G.reverse 0 (rep 1 r1')) := by + unfold NN + rw [zg_len, zv_rev, rep_length, List.length_reverse] + have heq : (G.length + r1') + 1 = G.length + (r1' + 1) := by omega + rw [heq]; exact hv + have s3 := ZXN a default (zp G.reverse 0) (zg G.reverse 0 (rep 1 r1')) (zv G.reverse 0) H' St' hx + have s23 := stepStar_trans s2 s3 + have s23' := stepStar_KP_r s23 rfl (zg_rev G (rep 1 r1') hG) + (by rw [zv_rev]; omega : 2 * (zv G.reverse 0 + 2) = 2 * gval G + 4) + exact stepPlus_stepStar_stepPlus s1 s23' + +theorem POrb (H : Bool) (r1 : Nat) (St : ListBlank (Fin 2)) (H' : Bool) (r1' : Nat) (St' : ListBlank (Fin 2)) + (G : List Nat) (p n : Nat) (l0 : ListBlank (Fin 2)) + (hov : OvNp H r1 St H' r1' St') (hG : AllGe2 G) (hp : 2 ≤ p) + (hv : 2 * gval G + 2 * p + 3 < 2 ^ (G.length + (r1' + 2))) : + (KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 3))) +> l0)) p (gsof G r1) (ones (gsof G r1) - 1) H St) [target_tm]⊢* + (KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ n)) +> l0)) 0 (gsof (((p - 2) + 1) :: G) r1') (2 * (2 * gval G + 2 * p + 3)) H' St') := by + have hI : (ones (gsof G r1) - 1) + 1 < 2 ^ ((gsof G r1).length + 1) := by + rw [ones_S]; exact ones_lt (gsof G r1) + have s1 := IncL (gsof G r1) (ones (gsof G r1) - 1) p hI ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 3))) +> l0)) St (sfx H) + rw [ones_S] at s1 + have hL1 : (([1] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 3))) +> l0) = + (([1, 0] : List (Fin 2)) +> ((([0, 1] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 2))) +> l0))) := by + rw [list_pow_succ]; simp only [List.cons_append, List.nil_append, listblank_append_cons, listblank_append_nil] + rw [hL1] at s1 + have s2 := B1 ((([0, 1] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 2))) +> l0)) + (tw (.T0 :: (rep .TZ p ++ (ctr (gsof G r1) (ones (gsof G r1)) ++ sfx H))) +> St) + have s3 := stepPlus_stepStar (hov G p (([0, 0] : List (Fin 2)) +> ((([0, 1] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 2))) +> l0)))) + rw [wallOv] at s3 + have hL2 : (([0, 0] : List (Fin 2)) +> ((([0, 1] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 2))) +> l0))) = + ((([0, 0, 0, 1] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 2))) +> l0)) := by + simp only [List.cons_append, List.nil_append, listblank_append_cons, listblank_append_nil] + rw [hL2, wallPO] at s3 + have hGr : AllGe2 (G.reverse ++ [p]) := AllGe2_app G.reverse [p] (AllGe2_rev G hG) ⟨hp, trivial⟩ + have hz : zv (G.reverse ++ [p]) 0 < 2 ^ (((rep 1 r1').length + 1) + (G.reverse ++ [p]).length) := by + rw [zv_rev_last, rep_length, List.length_append, List.length_reverse] + simp only [List.length_singleton] + have heq : (r1' + 1) + (G.length + 1) = G.length + (r1' + 2) := by omega + rw [heq]; omega + have s4 := Zones (G.reverse ++ [p]) hGr (([0, 0, 1] : List (Fin 2)) ^ (n + 3)) l0 0 (rep 1 r1') 0 H' St' hz + have hx : zv (G.reverse ++ [p]) 0 + 3 < NN (zg (G.reverse ++ [p]) 0 (rep 1 r1')) := by + unfold NN + rw [zg_len, zv_rev_last, rep_length, List.length_append, List.length_reverse] + simp only [List.length_singleton] + have heq : ((G.length + 1) + r1') + 1 = G.length + (r1' + 2) := by omega + rw [heq]; exact hv + have s5 := ZXP n l0 (zp (G.reverse ++ [p]) 0) (zg (G.reverse ++ [p]) 0 (rep 1 r1')) (zv (G.reverse ++ [p]) 0) H' St' hx + have s45 := stepStar_trans s4 s5 + have hgs : (zp (G.reverse ++ [p]) 0 + 1) :: zg (G.reverse ++ [p]) 0 (rep 1 r1') = gsof (((p - 2) + 1) :: G) r1' := by + rw [zp_rev_last, zg_rev_last G p (rep 1 r1') hG]; rfl + have s45' := stepStar_KP_r s45 rfl hgs (by rw [zv_rev_last]) + exact stepStar_trans s1 (stepStar_trans s2 (stepStar_trans s3 s45')) + +theorem SILENTP (r1 : Nat) (St St' : ListBlank (Fin 2)) (G : List Nat) (p n : Nat) (l0 : ListBlank (Fin 2)) + (hov : OvSp r1 St St') : + (KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 1))) +> l0)) p (gsof G r1) (ones (gsof G r1) - 1) true St) [target_tm]⊢* + (KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ n)) +> l0)) (p + 1) (gsof G r1) 0 true St') := by + have hI : (ones (gsof G r1) - 1) + 1 < 2 ^ ((gsof G r1).length + 1) := by + rw [ones_S]; exact ones_lt (gsof G r1) + have s1 := IncL (gsof G r1) (ones (gsof G r1) - 1) p hI ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 1))) +> l0)) St (sfx true) + rw [ones_S] at s1 + have hL1 : (([1] ++ (([0, 0, 1] : List (Fin 2)) ^ (n + 1))) +> l0) = + (([1, 0] : List (Fin 2)) +> ((([0, 1] ++ (([0, 0, 1] : List (Fin 2)) ^ n)) +> l0))) := by + rw [list_pow_succ]; simp only [List.cons_append, List.nil_append, listblank_append_cons, listblank_append_nil] + rw [hL1] at s1 + have s2 := B1 ((([0, 1] ++ (([0, 0, 1] : List (Fin 2)) ^ n)) +> l0)) + (tw (.T0 :: (rep .TZ p ++ (ctr (gsof G r1) (ones (gsof G r1)) ++ sfx true))) +> St) + have s3 := stepPlus_stepStar (hov G p (([0, 0] : List (Fin 2)) +> ((([0, 1] ++ (([0, 0, 1] : List (Fin 2)) ^ n)) +> l0)))) + have s4 := ENDl ((([0, 1] ++ (([0, 0, 1] : List (Fin 2)) ^ n)) +> l0)) (tw (.T0 :: (rep .TZ p ++ (ctr (gsof G r1) 0 ++ sfx true))) +> St') + have h_s4 : (((([0, 1] ++ (([0, 0, 1] : List (Fin 2)) ^ n)) +> l0)) <{{A}} (([0, 1] : List (Fin 2)) +> (tw (.T0 :: (rep .TZ p ++ (ctr (gsof G r1) 0 ++ sfx true))) +> St'))) = + (KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ n)) +> l0)) (p + 1) (gsof G r1) 0 true St') := by + unfold KP + simp only [rep, List.cons_append, tw_T0_cons', tw_TZ_cons', listblank_append_cons, listblank_append_nil, ListBlank.head_cons, ListBlank.tail_cons] + rw [h_s4] at s4 + exact stepStar_trans s1 (stepStar_trans s2 (stepStar_trans s3 s4)) + +theorem SILENT (r1 : Nat) (St St' : ListBlank (Fin 2)) (G : List Nat) (a : Nat) + (hov : OvSp r1 St St') : + (KP default (a + 1) (gsof G r1) (ones (gsof G r1)) true St) [target_tm]⊢⁺ + (KP default (a + 2) (gsof G r1) 0 true St') := by + have s1 := hov G (a + 1) default + have s2 := Bnc_TZ a (ctr (gsof G r1) 0 ++ sfx true) St' + exact stepPlus_stepStar_stepPlus s1 s2 + +def KX (a : Nat) (G : List Nat) (r1 : Nat) (St : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + KP default a (gsof G r1) (ones (gsof G r1)) true St + +-- ============================================================================ +-- Macro-Step Paths (`pathS`, `pre1`, `pathP1`, `pathP1S`, `pathP3`) +-- ============================================================================ + +theorem pathS (a : Nat) (G : List Nat) (r1 : Nat) (St St' : ListBlank (Fin 2)) + (hov : OvSp r1 St St') (ha : 1 ≤ a) : + (KX a G r1 St) [target_tm]⊢⁺ (KX (a + 4 * 2 ^ (G.length + r1)) G r1 St') := by + unfold KX + have hO := ones_gsof G r1 + have hN := NN_gsof G r1 + have hP := pow_pos (G.length + r1) + have ha1 : a = (a - 1) + 1 := by omega + rw [ha1] + have s1 := SILENT r1 St St' G (a - 1) hov + have s2 := Incs (ones (gsof G r1)) (a - 1 + 1) (gsof G r1) 0 true St' (by omega) + have s2' := stepStar_KP_r s2 + (by omega : ones (gsof G r1) + (a - 1 + 1 + 1) = a - 1 + 1 + 4 * 2 ^ (G.length + r1)) + rfl + (by omega : ones (gsof G r1) + 0 = ones (gsof G r1)) + exact stepPlus_stepStar_stepPlus s1 s2' + +def TailF (St S0 : ListBlank (Fin 2)) : Prop := + ∀ l', (l' {{C}}> St) [target_tm]⊢* (l' <{{F}} (([0, 0] : List (Fin 2)) +> S0)) + +theorem pre1 (a : Nat) (G : List Nat) (r1 : Nat) (St St1 S0 : ListBlank (Fin 2)) (kap s : Nat) + (hov1 : OvNp true r1 St false r1 St1) (ht2 : TailF St1 S0) + (hG : AllGe2 G) (hV : gval G + 6 + kap = 2 ^ (G.length + r1)) + (ha : a = s + 2 ^ (G.length + r1) + kap) (hs : 8 ≤ s) : + (KX a G r1 St) [target_tm]⊢⁺ + (KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ (s - 8))) +> default)) 0 + (gsof ((2 ^ (G.length + r1) + 2 + kap) :: G) (r1 + 1)) + (8 * 2 ^ (G.length + r1) - 6) true (([0, 1] : List (Fin 2)) +> S0)) := by + unfold KX + let Q := 2 ^ (G.length + r1) + have hO : ones (gsof G r1) = 4 * Q - 1 := ones_gsof G r1 + have hN : NN (gsof G r1) = 4 * Q := NN_gsof G r1 + have hP : 0 < Q := pow_pos (G.length + r1) + have ha2 : a = (a - 2) + 2 := by omega + rw [ha2] + have hNOrb_cond : gval G + 2 < 2 ^ (G.length + (r1 + 1)) := by + rw [pS]; change gval G + 2 < 2 * Q; omega + have s1 := NOrb true r1 St false r1 St1 G (a - 2) hov1 hG hNOrb_cond + have ha_split : a - 2 = (Q + 3 + kap) + ((s - 8) + 3) := by omega + have s1' := stepPlus_KP_pow_r s1 ha_split + have s2 := P100s (Q + 3 + kap) ((s - 8) + 3) default 0 (gsof G r1) (2 * gval G + 4) false St1 (by omega) + have s2' := stepStar_KP_r s2 + (by omega : (Q + 3 + kap) + 0 = Q + 3 + kap) + rfl + (by omega : 2 * (Q + 3 + kap) + (2 * gval G + 4) = ones (gsof G r1) - 1) + have hPOrb_cond : 2 * gval G + 2 * (Q + 3 + kap) + 3 < 2 ^ (G.length + (r1 + 1 + 2)) := by + have hpow : 2 ^ (G.length + (r1 + 1 + 2)) = 8 * Q := by + have : G.length + (r1 + 1 + 2) = ((G.length + r1) + 1) + 1 + 1 := by omega + rw [this, pow2S, pow2S, pow2S]; ring + rw [hpow]; omega + have hov0 := OvNp0 r1 St1 S0 ht2 + have hp_cond : 2 ≤ Q + 3 + kap := by omega + have s3 := POrb false r1 St1 true (r1 + 1) (([0, 1] : List (Fin 2)) +> S0) G (Q + 3 + kap) (s - 8) default + hov0 hG hp_cond hPOrb_cond + have hsub : (Q + 3 + kap - 2) + 1 = Q + 2 + kap := by omega + have s3' := stepStar_KP_r s3 rfl (by rw [hsub]) + (by omega : 2 * (2 * gval G + 2 * (Q + 3 + kap) + 3) = 8 * Q - 6) + have s23 := stepStar_trans s2' s3' + exact stepPlus_stepStar_stepPlus s1' s23 + +theorem pathP1 (a : Nat) (G : List Nat) (r1 : Nat) (St St1 S0 : ListBlank (Fin 2)) (kap s : Nat) + (hov1 : OvNp true r1 St false r1 St1) (ht2 : TailF St1 S0) + (hG : AllGe2 G) (hV : gval G + 6 + kap = 2 ^ (G.length + r1)) + (ha : a = s + 2 ^ (G.length + r1) + kap) (hs1 : 8 ≤ s) (hs2 : s ≤ 4 * 2 ^ (G.length + r1) + 9) : + (KX a G r1 St) [target_tm]⊢⁺ + (KX (8 * 2 ^ (G.length + r1) + 12 - s) ((2 ^ (G.length + r1) + 2 + kap) :: G) (r1 + 1) (([0, 1] : List (Fin 2)) +> S0)) := by + let Q := 2 ^ (G.length + r1) + let G' := (Q + 2 + kap) :: G + have hP : 0 < Q := pow_pos (G.length + r1) + have hN : NN (gsof G' (r1 + 1)) = 16 * Q := by + rw [NN_gsof]; unfold G'; rw [Q_cons]; change 4 * (4 * Q) = 16 * Q; omega + have hO : ones (gsof G' (r1 + 1)) = 16 * Q - 1 := by + rw [ones_gsof]; unfold G'; rw [Q_cons]; change 4 * (4 * Q) - 1 = 16 * Q - 1; omega + have s1 := pre1 a G r1 St St1 S0 kap s hov1 ht2 hG hV ha hs1 + have s1' := stepPlus_KP_pow_r s1 (by omega : s - 8 = (s - 8) + 0) + have s2 := P100s (s - 8) 0 default 0 (gsof G' (r1 + 1)) (8 * Q - 6) true (([0, 1] : List (Fin 2)) +> S0) (by omega) + have s2' := stepStar_KP_r (stepStar_KP_pow0_r s2) (by omega : (s - 8) + 0 = s - 8) rfl rfl + have s3 := WX (s - 8) (gsof G' (r1 + 1)) (2 * (s - 8) + (8 * Q - 6)) true (([0, 1] : List (Fin 2)) +> S0) (by omega) + have s4 := Incs (8 * Q + 19 - 2 * s) (s - 8) (gsof G' (r1 + 1)) (2 * (s - 8) + (8 * Q - 6) + 2) true (([0, 1] : List (Fin 2)) +> S0) (by omega) + unfold KX + have s4' := stepStar_KP_r s4 + (by omega : (8 * Q + 19 - 2 * s) + (s - 8 + 1) = 8 * Q + 12 - s) + rfl + (by omega : (8 * Q + 19 - 2 * s) + (2 * (s - 8) + (8 * Q - 6) + 2) = ones (gsof G' (r1 + 1))) + have s34 := stepStar_trans s3 s4' + have s234 := stepStar_trans s2' s34 + exact stepPlus_stepStar_stepPlus s1' s234 + +theorem pathP1S (a : Nat) (G : List Nat) (r1 : Nat) (St St1 S0 St3 : ListBlank (Fin 2)) (kap s : Nat) + (hov1 : OvNp true r1 St false r1 St1) (ht2 : TailF St1 S0) (hov3 : OvSp (r1 + 1) (([0, 1] : List (Fin 2)) +> S0) St3) + (hG : AllGe2 G) (hV : gval G + 6 + kap = 2 ^ (G.length + r1)) + (ha : a = s + 2 ^ (G.length + r1) + kap) (hs1 : 4 * 2 ^ (G.length + r1) + 11 ≤ s) (hs2 : s ≤ 12 * 2 ^ (G.length + r1) + 9) : + (KX a G r1 St) [target_tm]⊢⁺ + (KX (24 * 2 ^ (G.length + r1) + 12 - s) ((2 ^ (G.length + r1) + 2 + kap) :: G) (r1 + 1) St3) := by + let Q := 2 ^ (G.length + r1) + let G' := (Q + 2 + kap) :: G + have hP : 0 < Q := pow_pos (G.length + r1) + have hN : NN (gsof G' (r1 + 1)) = 16 * Q := by + rw [NN_gsof]; unfold G'; rw [Q_cons]; change 4 * (4 * Q) = 16 * Q; omega + have hO : ones (gsof G' (r1 + 1)) = 16 * Q - 1 := by + rw [ones_gsof]; unfold G'; rw [Q_cons]; change 4 * (4 * Q) - 1 = 16 * Q - 1; omega + have s1 := pre1 a G r1 St St1 S0 kap s hov1 ht2 hG hV ha (by omega) + have hs_split : s - 8 = (4 * Q + 2) + ((s - 4 * Q - 11) + 1) := by omega + have s1' := stepPlus_KP_pow_r s1 hs_split + have s2 := P100s (4 * Q + 2) ((s - 4 * Q - 11) + 1) default 0 (gsof G' (r1 + 1)) (8 * Q - 6) true (([0, 1] : List (Fin 2)) +> S0) (by omega) + have s2' := stepStar_KP_r s2 + (by omega : (4 * Q + 2) + 0 = 4 * Q + 2) + rfl + (by omega : 2 * (4 * Q + 2) + (8 * Q - 6) = ones (gsof G' (r1 + 1)) - 1) + have s3 := SILENTP (r1 + 1) (([0, 1] : List (Fin 2)) +> S0) St3 G' (4 * Q + 2) (s - 4 * Q - 11) default hov3 + have s3' := stepStar_KP_pow_r s3 (by omega : s - 4 * Q - 11 = (s - 4 * Q - 11) + 0) + have s4 := P100s (s - 4 * Q - 11) 0 default (4 * Q + 2 + 1) (gsof G' (r1 + 1)) 0 true St3 (by omega) + have s4' := stepStar_KP_r (stepStar_KP_pow0_r s4) rfl rfl + (by omega : 2 * (s - 4 * Q - 11) + 0 = 2 * (s - 4 * Q - 11)) + have s5 := WX ((s - 4 * Q - 11) + (4 * Q + 2 + 1)) (gsof G' (r1 + 1)) (2 * (s - 4 * Q - 11)) true St3 (by omega) + have s6 := Incs (24 * Q + 19 - 2 * s) ((s - 4 * Q - 11) + (4 * Q + 2 + 1)) (gsof G' (r1 + 1)) (2 * (s - 4 * Q - 11) + 2) true St3 (by omega) + unfold KX + have s6' := stepStar_KP_r s6 + (by omega : (24 * Q + 19 - 2 * s) + ((s - 4 * Q - 11) + (4 * Q + 2 + 1) + 1) = 24 * Q + 12 - s) + rfl + (by omega : (24 * Q + 19 - 2 * s) + (2 * (s - 4 * Q - 11) + 2) = ones (gsof G' (r1 + 1))) + have s56 := stepStar_trans s5 s6' + have s456 := stepStar_trans s4' s56 + have s3456 := stepStar_trans s3' s456 + have s23456 := stepStar_trans s2' s3456 + exact stepPlus_stepStar_stepPlus s1' s23456 + +theorem pathP3 (a : Nat) (G : List Nat) (r1 : Nat) (St St1 S0 St3 S4 : ListBlank (Fin 2)) (kap s : Nat) + (hov1 : OvNp true r1 St false r1 St1) (ht2 : TailF St1 S0) + (hov3 : OvNp true (r1 + 1) (([0, 1] : List (Fin 2)) +> S0) false (r1 + 1) St3) (ht4 : TailF St3 S4) + (hG : AllGe2 G) (hV : gval G + 6 + kap = 2 ^ (G.length + r1)) + (ha : a = s + 2 ^ (G.length + r1) + kap) (hs1 : 4 * 2 ^ (G.length + r1) + 24 ≤ s) (hs2 : s ≤ 36 * 2 ^ (G.length + r1) + 31) : + (KX a G r1 St) [target_tm]⊢⁺ + (KX (68 * 2 ^ (G.length + r1) + 40 - s) (7 :: (4 * 2 ^ (G.length + r1) + 1) :: (2 ^ (G.length + r1) + 2 + kap) :: G) + (r1 + 2) (([0, 1] : List (Fin 2)) +> S4)) := by + let Q := 2 ^ (G.length + r1) + let G' := (Q + 2 + kap) :: G + let G'' := (4 * Q + 1) :: G' + let G3 := 7 :: G'' + have hP : 0 < Q := pow_pos (G.length + r1) + have hN : NN (gsof G' (r1 + 1)) = 16 * Q := by + rw [NN_gsof]; unfold G'; rw [Q_cons]; change 4 * (4 * Q) = 16 * Q; omega + have hO : ones (gsof G' (r1 + 1)) = 16 * Q - 1 := by + rw [ones_gsof]; unfold G'; rw [Q_cons]; change 4 * (4 * Q) - 1 = 16 * Q - 1; omega + have hG' : AllGe2 G' := ⟨by omega, hG⟩ + have hV' : gval G' = 4 * Q - 8 := by simp [G', gval]; omega + have s1 := pre1 a G r1 St St1 S0 kap s hov1 ht2 hG hV ha (by omega) + have hs_split1 : s - 8 = (4 * Q + 2) + ((s - 4 * Q - 13) + 3) := by omega + have s1' := stepPlus_KP_pow_r s1 hs_split1 + have s2 := P100s (4 * Q + 2) ((s - 4 * Q - 13) + 3) default 0 (gsof G' (r1 + 1)) (8 * Q - 6) true (([0, 1] : List (Fin 2)) +> S0) (by omega) + have s2' := stepStar_KP_r s2 + (by omega : (4 * Q + 2) + 0 = 4 * Q + 2) + rfl + (by omega : 2 * (4 * Q + 2) + (8 * Q - 6) = ones (gsof G' (r1 + 1)) - 1) + have hPOrb1 : 2 * gval G' + 2 * (4 * Q + 2) + 3 < 2 ^ (G'.length + (r1 + 1 + 2)) := by + have hpow : 2 ^ (G'.length + (r1 + 1 + 2)) = 16 * Q := by + simp only [G', List.length_cons] + have : (G.length + 1) + (r1 + 1 + 2) = (((G.length + r1) + 1) + 1) + 1 + 1 := by omega + rw [this, pow2S, pow2S, pow2S, pow2S]; ring + rw [hpow]; omega + have hp1 : 2 ≤ 4 * Q + 2 := by omega + have s3 := POrb true (r1 + 1) (([0, 1] : List (Fin 2)) +> S0) false (r1 + 1) St3 G' (4 * Q + 2) (s - 4 * Q - 13) default + hov3 hG' hp1 hPOrb1 + have hsub1 : (4 * Q + 2 - 2) + 1 = 4 * Q + 1 := by omega + have hs_split2 : s - 4 * Q - 13 = 8 + ((s - 4 * Q - 24) + 3) := by omega + have s3' := stepStar_KP_pow_r (stepStar_KP_r s3 rfl (by rw [hsub1]) rfl) hs_split2 + have hN2 : NN (gsof G'' (r1 + 1)) = 32 * Q := by + rw [NN_gsof]; simp only [G'', G', List.length_cons] + have : ((G.length + 1) + 1) + (r1 + 1) = (((G.length + r1) + 1) + 1) + 1 := by omega + rw [this, pow2S, pow2S, pow2S]; ring + have hO2 : ones (gsof G'' (r1 + 1)) = 32 * Q - 1 := by unfold ones NN at *; omega + have hG'' : AllGe2 G'' := ⟨by omega, hG'⟩ + have hV'' : gval G'' = 16 * Q - 14 := by simp [G'', gval, hV']; omega + have s4 := P100s 8 ((s - 4 * Q - 24) + 3) default 0 (gsof G'' (r1 + 1)) + (2 * (2 * gval G' + 2 * (4 * Q + 2) + 3)) false St3 (by omega) + have s4' := stepStar_KP_r s4 + (by omega : 8 + 0 = 8) + rfl + (by omega : 2 * 8 + 2 * (2 * gval G' + 2 * (4 * Q + 2) + 3) = ones (gsof G'' (r1 + 1)) - 1) + have hPOrb2 : 2 * gval G'' + 2 * 8 + 3 < 2 ^ (G''.length + (r1 + 1 + 1 + 2)) := by + have hpow : 2 ^ (G''.length + (r1 + 1 + 1 + 2)) = 64 * Q := by + simp only [G'', G', List.length_cons] + have : ((G.length + 1) + 1) + (r1 + 1 + 1 + 2) = (((((G.length + r1) + 1) + 1) + 1) + 1) + 1 + 1 := by omega + rw [this, pow2S, pow2S, pow2S, pow2S, pow2S, pow2S]; ring + rw [hpow]; omega + have hov0 := OvNp0 (r1 + 1) St3 S4 ht4 + have hp2 : 2 ≤ 8 := by omega + have s5 := POrb false (r1 + 1) St3 true (r1 + 2) (([0, 1] : List (Fin 2)) +> S4) G'' 8 (s - 4 * Q - 24) default + hov0 hG'' hp2 hPOrb2 + have hsub2 : (8 - 2) + 1 = 7 := rfl + have s5' := stepStar_KP_pow_r (stepStar_KP_r s5 rfl (by rw [hsub2]) rfl) (by omega : s - 4 * Q - 24 = (s - 4 * Q - 24) + 0) + have hN3 : NN (gsof G3 (r1 + 2)) = 128 * Q := by + rw [NN_gsof]; simp only [G3, G'', G', List.length_cons] + have : (((G.length + 1) + 1) + 1) + (r1 + 2) = ((((G.length + r1) + 1) + 1) + 1) + 1 + 1 := by omega + rw [this, pow2S, pow2S, pow2S, pow2S, pow2S]; ring + have hO3 : ones (gsof G3 (r1 + 2)) = 128 * Q - 1 := by unfold ones NN at *; omega + have s6 := P100s (s - 4 * Q - 24) 0 default 0 (gsof G3 (r1 + 2)) (2 * (2 * gval G'' + 2 * 8 + 3)) true (([0, 1] : List (Fin 2)) +> S4) (by omega) + have s6' := stepStar_KP_r (stepStar_KP_pow0_r s6) (by omega : (s - 4 * Q - 24) + 0 = s - 4 * Q - 24) rfl rfl + have s7 := WX (s - 4 * Q - 24) (gsof G3 (r1 + 2)) (2 * (s - 4 * Q - 24) + 2 * (2 * gval G'' + 2 * 8 + 3)) true (([0, 1] : List (Fin 2)) +> S4) (by omega) + have s8 := Incs (72 * Q + 63 - 2 * s) (s - 4 * Q - 24) (gsof G3 (r1 + 2)) + (2 * (s - 4 * Q - 24) + 2 * (2 * gval G'' + 2 * 8 + 3) + 2) true (([0, 1] : List (Fin 2)) +> S4) (by omega) + unfold KX + have s8' := stepStar_KP_r s8 + (by omega : (72 * Q + 63 - 2 * s) + (s - 4 * Q - 24 + 1) = 68 * Q + 40 - s) + rfl + (by omega : (72 * Q + 63 - 2 * s) + (2 * (s - 4 * Q - 24) + 2 * (2 * gval G'' + 2 * 8 + 3) + 2) = ones (gsof G3 (r1 + 2))) + have s78 := stepStar_trans s7 s8' + have s678 := stepStar_trans s6' s78 + have s5678 := stepStar_trans s5' s678 + have s45678 := stepStar_trans s4' s5678 + have s345678 := stepStar_trans s3' s45678 + have s2345678 := stepStar_trans s2' s345678 + exact stepPlus_stepStar_stepPlus s1' s2345678 + +-- ============================================================================ +-- Global Invariant (`INV`), Step Closure (`step`), and Non-Halting (`nonhalt`) +-- ============================================================================ + +def INV (a : Nat) (G : List Nat) (r1 : Nat) (St : ListBlank (Fin 2)) : Prop := + AllGe2 G ∧ 64 ≤ 2 ^ (G.length + r1) ∧ + ∃ kap s, (kap = 2 ∨ kap = 8) ∧ gval G + 6 + kap = 2 ^ (G.length + r1) ∧ + a = s + 2 ^ (G.length + r1) + kap ∧ + ((Lst true true St ∧ 24 ≤ s ∧ s ≤ 2 ^ (G.length + r1) + 2) ∨ + (Lst true false St ∧ ((8 ≤ s ∧ s ≤ 4 * 2 ^ (G.length + r1) - 14) ∨ + (4 * 2 ^ (G.length + r1) + 24 ≤ s ∧ s ≤ 8 * 2 ^ (G.length + r1))))) + +theorem Lst_tailx (y z b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 : Bool) (e : List Bool) : + Lst y z (([0, 1] : List (Fin 2)) +> (tw (tailx y z b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e) +> default)) := + Lst_intro y z b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e _ (tw_T1_cons _ default) + +theorem Q1 (g : Nat) (G : List Nat) (r1 : Nat) : 2 ^ ((g :: G).length + (r1 + 1)) = 4 * 2 ^ (G.length + r1) := + Q_cons g G r1 + +theorem Q3 (g1 g2 g3 : Nat) (G : List Nat) (r1 : Nat) : + 2 ^ ((g1 :: g2 :: g3 :: G).length + (r1 + 2)) = 32 * 2 ^ (G.length + r1) := by + simp only [List.length_cons] + have : (((G.length + 1) + 1) + 1) + (r1 + 2) = ((((G.length + r1) + 1) + 1) + 1) + 1 + 1 := by omega + rw [this, pow2S, pow2S, pow2S, pow2S, pow2S]; ring + +theorem step_inv (a : Nat) (G : List Nat) (r1 : Nat) (St : ListBlank (Fin 2)) (hinv : INV a G r1 St) : + ∃ a' G' r1' St', ((KX a G r1 St) [target_tm]⊢⁺ (KX a' G' r1' St')) ∧ INV a' G' r1' St' := by + rcases hinv with ⟨hG, hQ, kap, s, hk, hV, ha, ht⟩ + let Q := 2 ^ (G.length + r1) + have hQ_def : 2 ^ (G.length + r1) = Q := rfl + rcases ht with ⟨hL, hs1, hs2⟩ | ⟨hL, hs⟩ + · rcases hL with ⟨b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, e, rfl⟩ + rcases Tail11 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e with ⟨S', hE, hL'⟩ | ⟨S0, hF, hL'⟩ + · rcases hL' with ⟨c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, e', rfl⟩ + let S0 := tw (tailx true false c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 e') +> default + have ht2 : TailF (tw (tailw true false false c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 e') +> default) S0 := + fun l => Tail0z l false c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 e' + refine ⟨8 * Q + 12 - s, (Q + 2 + kap) :: G, r1 + 1, ([0, 1] : List (Fin 2)) +> S0, ?_, ?_⟩ + · exact pathP1 a G r1 _ _ S0 kap s (OvNp1 r1 _ _ hE) ht2 hG hV ha (by omega) (by omega) + · refine ⟨⟨by omega, hG⟩, ?_, 2, 4 * Q + 10 - s, Or.inl rfl, ?_, ?_, Or.inr ⟨Lst_tailx true false c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 e', Or.inl ⟨?_, ?_⟩⟩⟩ + · rw [Q1, hQ_def]; omega + · rw [Q1, hQ_def]; simp [gval]; omega + · rw [Q1, hQ_def]; omega + · omega + · rw [Q1, hQ_def]; omega + · refine ⟨a + 4 * Q, G, r1, ([0, 1] : List (Fin 2)) +> S0, ?_, ?_⟩ + · exact pathS a G r1 _ _ (OvSp1 r1 _ S0 hF) (by omega) + · refine ⟨hG, hQ, kap, s + 4 * Q, hk, hV, by omega, Or.inr ⟨hL', Or.inr ⟨by omega, by omega⟩⟩⟩ + · rcases hL with ⟨b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, e, rfl⟩ + let St1 := tw (tailw true false true b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e) +> default + have hE : ∀ l, (l {{C}}> (tw (tailw true true false b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e) +> default)) [target_tm]⊢* + (l <{{E}} St1) := fun l => Tail10 l b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e + let S0 := tw (tailx true true b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e) +> default + have ht2 : TailF St1 S0 := fun l => Tail0z l true b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e + rcases hs with ⟨hs1, hs2⟩ | ⟨hs1, hs2⟩ + · refine ⟨8 * Q + 12 - s, (Q + 2 + kap) :: G, r1 + 1, ([0, 1] : List (Fin 2)) +> S0, ?_, ?_⟩ + · exact pathP1 a G r1 _ St1 S0 kap s (OvNp1 r1 _ _ hE) ht2 hG hV ha (by omega) (by omega) + · refine ⟨⟨by omega, hG⟩, ?_, 2, 4 * Q + 10 - s, Or.inl rfl, ?_, ?_, Or.inl ⟨Lst_tailx true true b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e, ?_, ?_⟩⟩ + · rw [Q1, hQ_def]; omega + · rw [Q1, hQ_def]; simp [gval]; omega + · rw [Q1, hQ_def]; omega + · omega + · rw [Q1, hQ_def]; omega + · rcases Tail11 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 e with ⟨S3, hE3, hL3⟩ | ⟨S3, hF3, hL3⟩ + · rcases hL3 with ⟨c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, e', rfl⟩ + let S4 := tw (tailx true false c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 e') +> default + have ht4 : TailF (tw (tailw true false false c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 e') +> default) S4 := + fun l => Tail0z l false c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 e' + refine ⟨68 * Q + 40 - s, 7 :: (4 * Q + 1) :: (Q + 2 + kap) :: G, r1 + 2, ([0, 1] : List (Fin 2)) +> S4, ?_, ?_⟩ + · exact pathP3 a G r1 _ St1 S0 _ S4 kap s (OvNp1 r1 _ _ hE) ht2 (OvNp1 (r1 + 1) _ _ hE3) ht4 hG hV ha (by omega) (by omega) + · refine ⟨⟨by omega, ⟨by omega, ⟨by omega, hG⟩⟩⟩, ?_, 8, 36 * Q + 32 - s, Or.inr rfl, ?_, ?_, Or.inr ⟨Lst_tailx true false c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 e', Or.inl ⟨?_, ?_⟩⟩⟩ + · rw [Q3, hQ_def]; omega + · rw [Q3, hQ_def]; simp [gval]; omega + · rw [Q3, hQ_def]; omega + · omega + · rw [Q3, hQ_def]; omega + · refine ⟨24 * Q + 12 - s, (Q + 2 + kap) :: G, r1 + 1, ([0, 1] : List (Fin 2)) +> S3, ?_, ?_⟩ + · exact pathP1S a G r1 _ St1 S0 _ kap s (OvNp1 r1 _ _ hE) ht2 (OvSp1 (r1 + 1) _ S3 hF3) hG hV ha (by omega) (by omega) + · refine ⟨⟨by omega, hG⟩, ?_, 2, 20 * Q + 10 - s, Or.inl rfl, ?_, ?_, Or.inr ⟨hL3, Or.inl ⟨?_, ?_⟩⟩⟩ + · rw [Q1, hQ_def]; omega + · rw [Q1, hQ_def]; simp [gval]; omega + · rw [Q1, hQ_def]; omega + · omega + · rw [Q1, hQ_def]; omega + +def St0 : ListBlank (Fin 2) := + tw (tailw true true true true true true false true true true true false true false true [false, true, false]) +> default + +theorem W1 (p : Nat) (gs : List Nat) (v : Nat) (H : Bool) (St : ListBlank (Fin 2)) + (hv : v + 1 < NN gs) : + (KP (([1] : List (Fin 2)) +> default) p gs v H St) [target_tm]⊢* + (KP default p gs (v + 1) H St) := by + unfold KP + have h1 : (([1] : List (Fin 2)) +> (default : ListBlank (Fin 2))) = (([1, 0] : List (Fin 2)) +> default) := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + have h2 : (([0, 0] : List (Fin 2)) +> (default : ListBlank (Fin 2))) = default := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + rw [h1] + have s1 := IncL gs v p hv (([1, 0] : List (Fin 2)) +> default) St (sfx H) + have s2 := B1 default (tw (.T0 :: (rep .TZ p ++ (ctr gs (v + 1) ++ sfx H))) +> St) + rw [h2] at s2 + exact stepStar_trans s1 s2 + + +-- ============================================================================ +-- Bignum-Accelerated NatCfg Simulator (`NatSim`) +-- ============================================================================ + +open BusyBeaver.Longitudinal + +def St_5786 : ListBlank (Fin 2) := + tw (tailw true true true false true true false true true true true false true false true [false, true, false]) +> default + +def St_6060 : ListBlank (Fin 2) := + tw (tailw true false false true true true false true true true true false true false true [false, true, false]) +> default + +def S0_6060 : ListBlank (Fin 2) := + tw (tailx true false true true true false true true true true false true false true [false, true, false]) +> default + +def St_17206 : ListBlank (Fin 2) := + tw (tailw true true false true true true false true true true true false true false true [false, true, false]) +> default + +def St_17206_1 : ListBlank (Fin 2) := + tw (tailw true false true true true true false true true true true false true false true [false, true, false]) +> default + +def S0_17206 : ListBlank (Fin 2) := + tw (tailx true true true true true false true true true true false true false true [false, true, false]) +> default + +theorem init_4353 : + multiStep target_tm (init []) 4353 = + some (NatCfg.toCfg ⟨0, 0, 2396745, 726013156963562508614058902102144551304⟩) := by + rw [← toCfg_zero] + exact stepsNat_sound target_tm 4353 ⟨0, 0, 0, 0⟩ _ (by decide +kernel) (by decide) + +theorem init_to_4353_cfg_eq : + NatCfg.toCfg (K := 6) ⟨0, 0, 2396745, 726013156963562508614058902102144551304⟩ = + KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ 7)) +> default)) 0 (gsof [] 3) 10 true St_5786 := by + have hcfg := toCfg_headRight A 2396745 1452026313927125017228117804204289102608 + have hl : (([1] ++ (([0, 0, 1] : List (Fin 2)) ^ 7)) +> default) = decodeHalf 2396745 := by + rw [← decodeHalf_zero, decodeHalf_encodeList] + rfl + have hr : tw (.T0 :: (rep .TZ 0 ++ (ctr (gsof [] 3) 10 ++ sfx true))) +> St_5786 = + decodeHalf 1452026313927125017228117804204289102608 := by + unfold St_5786 + rw [← str_app_assoc, ← decodeHalf_zero, decodeHalf_encodeList] + rfl + unfold KP + rw [hl, hr] + exact hcfg + +theorem init_to_4353 : (init []) [target_tm]⊢* + (KP ((([1] ++ (([0, 0, 1] : List (Fin 2)) ^ 7)) +> default)) 0 (gsof [] 3) 10 true St_5786) := by + refine ⟨4353, ?_⟩ + rw [← init_to_4353_cfg_eq] + exact init_4353 + +theorem init_reaches : (init []) [target_tm]⊢* (KX 121 [28] 5 St0) := by + have s0 := init_to_4353 + have s1_raw := P100s 7 0 default 0 (gsof [] 3) 10 true St_5786 (by decide) + have s1 := stepStar_KP_r (stepStar_KP_pow0_r s1_raw) rfl rfl rfl + have s01 := stepStar_trans s0 s1 + have s2 := W1 7 (gsof [] 3) 24 true St_5786 (by decide) + have s02 := stepStar_trans s01 s2 + have s3_raw := Incs 6 6 (gsof [] 3) 25 true St_5786 (by decide) + have s3 := stepStar_KP_r s3_raw rfl rfl rfl + have s03 := stepStar_trans s02 s3 + have ht_5786 : ∀ l, (l {{C}}> St_5786) [target_tm]⊢* (l <{{E}} St_6060) := fun l => + TailRet' + (tailw true true true false true true false true true true true false true false true [false, true, false]) + [.T1, .T1, .T1, .TZ, .T1] + (bt true :: .TZ :: .T1 :: bt true :: .TZ :: bt false :: .TZ :: .T1 :: bt true :: bt true :: .TZ :: bt true :: .TZ :: .T1 :: bt true :: .TZ :: bt false :: .TZ :: bt true :: .TZ :: bt false :: .TZ :: bt true :: .TZ :: .T1 :: ([false, true, false].map bt ++ [.T1])) + E [.T1, .T0, .T0, .TZ, .T1, .T1] + (tailw true false false true true true false true true true true false true false true [false, true, false]) + rfl trivial rfl rfl l default + have s4_raw := stepPlus_stepStar (NOrb true 3 St_5786 false 3 St_6060 [] 11 (OvNp1 3 St_5786 St_6060 ht_5786) trivial (by decide)) + have s4 := stepStar_KP_r s4_raw rfl rfl rfl + have s04 := stepStar_trans s03 s4 + have s5_raw := P100s 11 0 default 0 (gsof [] 3) 4 false St_6060 (by decide) + have s5 := stepStar_KP_r (stepStar_KP_pow0_r s5_raw) rfl rfl rfl + have s05 := stepStar_trans s04 s5 + have s6 := W1 11 (gsof [] 3) 26 false St_6060 (by decide) + have s06 := stepStar_trans s05 s6 + have s7_raw := Incs 4 10 (gsof [] 3) 27 false St_6060 (by decide) + have s7 := stepStar_KP_r s7_raw rfl rfl rfl + have s07 := stepStar_trans s06 s7 + have ht_6060 : ∀ l, (l {{C}}> St_6060) [target_tm]⊢* (l <{{F}} (([0, 0] : List (Fin 2)) +> S0_6060)) := fun l => + Tail0z l false true true true false true true true true false true false true [false, true, false] + have s8_raw := stepPlus_stepStar (NOrb false 3 St_6060 true 4 (([0, 1] : List (Fin 2)) +> S0_6060) [] 13 (OvNp0 3 St_6060 S0_6060 ht_6060) trivial (by decide)) + have hSt : (([0, 1] : List (Fin 2)) +> S0_6060) = St_17206 := tw_T1_cons_eq _ _ default rfl + have s8 := s8_raw + rw [hSt] at s8 + have s08 := stepStar_trans s07 s8 + have s9_raw := P100s 13 0 default 0 (gsof [] 4) 4 true St_17206 (by decide) + have s9 := stepStar_KP_r (stepStar_KP_pow0_r s9_raw) rfl rfl rfl + have s09 := stepStar_trans s08 s9 + have s10 := W1 13 (gsof [] 4) 30 true St_17206 (by decide) + have s010 := stepStar_trans s09 s10 + have s11_raw := Incs 32 12 (gsof [] 4) 31 true St_17206 (by decide) + have s11 : (KP default 13 (gsof [] 4) 31 true St_17206) [target_tm]⊢* (KX 45 [] 4 St_17206) := s11_raw + have s011 := stepStar_trans s010 s11 + have ht_17206 : ∀ l, (l {{C}}> St_17206) [target_tm]⊢* (l <{{E}} St_17206_1) := fun l => + Tail10 l true true true false true true true true false true false true [false, true, false] + have ht2_17206 : TailF St_17206_1 S0_17206 := fun l => + Tail0z l true true true true false true true true true false true false true [false, true, false] + have s12 := stepPlus_stepStar (pathP1 45 [] 4 St_17206 St_17206_1 S0_17206 10 19 + (OvNp1 4 St_17206 St_17206_1 ht_17206) ht2_17206 trivial rfl rfl (by decide) (by decide)) + have hSt0 : (([0, 1] : List (Fin 2)) +> S0_17206) = St0 := tw_T1_cons_eq _ _ default rfl + rw [hSt0] at s12 + exact stepStar_trans s011 s12 + +theorem INV0 : INV 121 [28] 5 St0 := by + refine ⟨⟨by decide, trivial⟩, by decide, 2, 55, Or.inl rfl, by decide, by decide, + Or.inl ⟨Lst_intro true true true true true false true true true true false true false true [false, true, false] _ rfl, by decide, by decide⟩⟩ + +end Solution + + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + refine BusyBeaver.Counter.does_not_halt_of_invariant + (fun cfg => ∃ a G r1 St, cfg = KX a G r1 St ∧ INV a G r1 St) ?_ ?_ + · exact ⟨KX 121 [28] 5 St0, init_reaches, 121, [28], 5, St0, rfl, INV0⟩ + · rintro _ ⟨a, G, r1, St, rfl, hinv⟩ + rcases step_inv a G r1 St hinv with ⟨a', G', r1', St', hstep, hinv'⟩ + exact ⟨KX a' G' r1' St', hstep, a', G', r1', St', rfl, hinv'⟩ + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0LF_0RCHHH_1RD0RA_1LE0RC_0LA0LE_1LE1LB diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RA_0LC0LA_1RF1LD_1LE0LD_1LC1LF_HHH1RA.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RA_0LC0LA_1RF1LD_1LE0LD_1LC1LF_HHH1RA.lean new file mode 100644 index 00000000..ea526216 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RA_0LC0LA_1RF1LD_1LE0LD_1LC1LF_HHH1RA.lean @@ -0,0 +1,1818 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RA_0LC0LA_1RF1LD_1LE0LD_1LC1LF_HHH1RA + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_0LC0LA_1RF1LD_1LE0LD_1LC1LF_HHH1RA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +namespace M8 +inductive St | A | B | C | D | E | F | H + deriving DecidableEq, Repr +structure Cfg where + st : St + L : List Bool + h : Bool + R : List Bool + deriving DecidableEq, Repr +def mR (s : St) (w : Bool) (c : Cfg) : Cfg := ⟨s, w :: c.L, c.R.headD false, c.R.tail⟩ +def mL (s : St) (w : Bool) (c : Cfg) : Cfg := ⟨s, c.L.tail, c.L.headD false, w :: c.R⟩ +def step (c : Cfg) : Cfg := + match c.st, c.h with + | .A, false => mR .B true c + | .A, true => mR .A false c + | .B, false => mL .C false c + | .B, true => mL .A false c + | .C, false => mR .F true c + | .C, true => mL .D true c + | .D, false => mL .E true c + | .D, true => mL .D false c + | .E, false => mL .C true c + | .E, true => mL .F true c + | .F, false => { c with st := .H } + | .F, true => mR .A true c + | .H, _ => c +def run : Nat -> Cfg -> Cfg + | 0, c => c + | n + 1, c => run n (step c) +theorem run_add (m n : Nat) (c : Cfg) : run (m + n) c = run n (run m c) := by + induction m generalizing c with + | zero => simp [run] + | succ m ih => + rw [Nat.succ_add] + simp only [run] + exact ih (step c) +def halted (c : Cfg) : Prop := c.st = .H +def init : Cfg := ⟨.A, [], false, []⟩ +theorem run_H (n : Nat) (c : Cfg) (h : c.st = .H) : run n c = c := by + induction n with + | zero => rfl + | succ n ih => + simp only [run] + have : step c = c := by + obtain ⟨s, L, x, R⟩ := c + simp at h; subst h; cases x <;> rfl + rw [this, ih] +end M8 +namespace M8 +def mvDir : St -> Bool -> Option Bool + | .A, _ => some true + | .B, _ => some false + | .C, false => some true + | .C, true => some false + | .D, _ => some false + | .E, _ => some false + | .F, false => none + | .F, true => some true + | .H, _ => none +def stepB (c : Cfg) : Option Cfg := + match mvDir c.st c.h with + | some true => if c.R.isEmpty then none else some (step c) + | some false => if c.L.isEmpty then none else some (step c) + | none => some (step c) +def runB : Nat -> Cfg -> Option Cfg + | 0, c => some c + | n + 1, c => (stepB c).bind (runB n) +def ext (c : Cfg) (Lt Rt : List Bool) : Cfg := ⟨c.st, c.L ++ Lt, c.h, c.R ++ Rt⟩ +theorem stepB_frame {c c' : Cfg} (Lt Rt : List Bool) (h : stepB c = some c') : + step (ext c Lt Rt) = ext c' Lt Rt := by + obtain ⟨s, L, x, R⟩ := c + cases s <;> cases x <;> simp only [stepB, mvDir] at h <;> + first + | (cases R with + | nil => simp at h + | cons r rs => simp at h; subst h; simp [ext, step, mR]) + | (cases L with + | nil => simp at h + | cons l ls => simp at h; subst h; simp [ext, step, mL]) + | (simp at h; subst h; simp [ext, step]) +theorem runB_frame (n : Nat) (Lt Rt : List Bool) : + ∀ {c c' : Cfg}, runB n c = some c' -> run n (ext c Lt Rt) = ext c' Lt Rt := by + induction n with + | zero => intro c c' h; simp [runB] at h; subst h; rfl + | succ n ih => + intro c c' h + simp only [runB, Option.bind_eq_some_iff] at h + obtain ⟨c1, h1, h2⟩ := h + show run n (step (ext c Lt Rt)) = _ + rw [stepB_frame Lt Rt h1] + exact ih h2 +theorem frame {n : Nat} {s s' : St} {L h R L' h' R'} (Lt Rt : List Bool) + (hb : runB n ⟨s, L, h, R⟩ = some ⟨s', L', h', R'⟩) : + run n ⟨s, L ++ Lt, h, R ++ Rt⟩ = ⟨s', L' ++ Lt, h', R' ++ Rt⟩ := + runB_frame n Lt Rt hb +end M8 +namespace M8 +def cons' : Bool -> List Bool -> List Bool + | false, [] => [] + | x, t => x :: t +def trim : List Bool -> List Bool + | [] => [] + | x :: xs => cons' x (trim xs) +@[simp] theorem trim_nil : trim [] = [] := rfl +@[simp] theorem trim_cons (x : Bool) (xs : List Bool) : trim (x :: xs) = cons' x (trim xs) := rfl +theorem trim_headD (l : List Bool) : (trim l).headD false = l.headD false := by + cases l with + | nil => rfl + | cons x xs => + simp only [trim_cons, List.headD_cons] + cases x <;> cases trim xs <;> rfl +theorem trim_tail (l : List Bool) : trim l.tail = (trim l).tail := by + cases l with + | nil => rfl + | cons x xs => + simp only [trim_cons, List.tail_cons] + cases x <;> cases trim xs <;> simp [cons'] +def PE (c d : Cfg) : Prop := c.st = d.st /\ c.h = d.h /\ trim c.L = trim d.L /\ trim c.R = trim d.R +theorem PE.refl (c : Cfg) : PE c c := ⟨rfl, rfl, rfl, rfl⟩ +theorem PE.symm {c d : Cfg} (h : PE c d) : PE d c := ⟨h.1.symm, h.2.1.symm, h.2.2.1.symm, h.2.2.2.symm⟩ +theorem PE.trans {c d e : Cfg} (h : PE c d) (h' : PE d e) : PE c e := + ⟨h.1.trans h'.1, h.2.1.trans h'.2.1, h.2.2.1.trans h'.2.2.1, h.2.2.2.trans h'.2.2.2⟩ +theorem PE_step {c d : Cfg} (h : PE c d) : PE (step c) (step d) := by + obtain ⟨s, L, x, R⟩ := c + obtain ⟨s', L', x', R'⟩ := d + obtain ⟨h1, h2, h3, h4⟩ := h + simp only at h1 h2 h3 h4 + subst h1 h2 + have hL0 : L.headD false = L'.headD false := by rw [<- trim_headD, h3, trim_headD] + have hR0 : R.headD false = R'.headD false := by rw [<- trim_headD, h4, trim_headD] + have hL1 : trim L.tail = trim L'.tail := by rw [trim_tail, h3, trim_tail] + have hR1 : trim R.tail = trim R'.tail := by rw [trim_tail, h4, trim_tail] + cases s <;> cases x <;> + simp only [step, mR, mL, PE, trim_cons, hL0, hR0, hL1, hR1, h3, h4, and_self] +theorem PE_run (n : Nat) {c d : Cfg} (h : PE c d) : PE (run n c) (run n d) := by + induction n generalizing c d with + | zero => exact h + | succ n ih => exact ih (PE_step h) +theorem trim_blank (l : List Bool) (hl : ∀ x ∈ l, x = false) : trim l = [] := by + induction l with + | nil => rfl + | cons x xs ih => + have hx := hl x (by simp) + subst hx + rw [trim_cons, ih (fun y hy => hl y (by simp [hy]))]; rfl +theorem trim_append_blank (l p : List Bool) (hp : ∀ x ∈ p, x = false) : trim (l ++ p) = trim l := by + induction l with + | nil => exact trim_blank p hp + | cons x xs ih => simp [ih] +theorem trim_append_repl (l : List Bool) (n : Nat) : trim (l ++ List.replicate n false) = trim l := + trim_append_blank l _ (fun x hx => (List.mem_replicate.1 hx).2) +theorem PE_pad (s : St) (L R : List Bool) (h : Bool) (a b : Nat) : + PE ⟨s, L ++ List.replicate a false, h, R ++ List.replicate b false⟩ ⟨s, L, h, R⟩ := + ⟨rfl, rfl, trim_append_repl L a, trim_append_repl R b⟩ +theorem PE_halted {c d : Cfg} (h : PE c d) : halted c <-> halted d := by + unfold halted; rw [h.1] +theorem trim_append_congr (p : List Bool) {l l' : List Bool} (h : trim l = trim l') : + trim (p ++ l) = trim (p ++ l') := by + induction p with + | nil => exact h + | cons x xs ih => simp [ih] +end M8 +namespace M8 +open List +def Lu : List Bool := [false, true, true, true] +def Rr : List Bool := [false, false, true, true] +def Mr : List Bool := [false, false, true, true, true, true] +def pw (l : List Bool) : Nat -> List Bool + | 0 => [] + | n + 1 => l ++ pw l n +@[simp] theorem pw_zero (l : List Bool) : pw l 0 = [] := rfl +@[simp] theorem pw_succ (l : List Bool) (n : Nat) : pw l (n + 1) = l ++ pw l n := rfl +theorem pw_add (l : List Bool) (m n : Nat) : pw l (m + n) = pw l m ++ pw l n := by + induction m with + | zero => simp + | succ m ih => rw [Nat.succ_add, pw_succ, pw_succ, ih, List.append_assoc] +theorem pw_succ' (l : List Bool) (n : Nat) : pw l (n + 1) = pw l n ++ l := by + rw [pw_add]; simp +def hc (P R : List Bool) : Cfg := ⟨.B, true :: P, true, [true, true] ++ R⟩ +def dc (L R : List Bool) : Cfg := ⟨.D, L.tail, L.headD false, R⟩ +def ac (L R : List Bool) : Cfg := ⟨.A, L, R.headD false, R.tail⟩ +theorem dstep (L R : List Bool) : run 1 ⟨.D, L, true, R⟩ = dc L (false :: R) := rfl +theorem cstep (L R : List Bool) : run 1 ⟨.C, L, true, R⟩ = dc L (true :: R) := rfl +theorem astep (L R : List Bool) : run 1 ⟨.A, L, true, R⟩ = ac (false :: L) R := rfl +theorem restart (L R : List Bool) : run 1 (ac L (Lu ++ R)) = hc L R := rfl +theorem unit (P R : List Bool) : run 18 (hc P (Lu ++ R)) = hc (Rr ++ P) R := by + have h := frame (n := 18) (s := .B) (s' := .B) (L := [true]) (h := true) + (R := [true, true, false, true, true, true]) (L' := [true, false, false, true, true]) (h' := true) + (R' := [true, true]) P R (by decide) + simpa [hc, Lu, Rr] using h +theorem pass (P R : List Bool) : + run 36 (hc (Rr ++ P) ([true, false] ++ false :: R)) = hc (Mr ++ P) (false :: R) := by + have h := frame (n := 36) (s := .B) (s' := .B) (L := [true, false, false, true, true]) (h := true) + (R := [true, true, true, false, false]) (L' := [true, false, false, true, true, true, true]) (h' := true) + (R' := [true, true, false]) P R (by decide) + simpa [hc, Mr, Rr] using h +theorem turn (P X : List Bool) : + run 24 (hc P ([false, false] ++ X)) = dc P (Lu ++ [true, false] ++ X) := by + have h := frame (n := 23) (s := .B) (s' := .D) (L := [true]) (h := true) + (R := [true, true, false, false]) (L' := []) (h' := true) + (R' := [true, true, true, true, false]) P X (by decide) + rw [show 24 = 23 + 1 from rfl, run_add] + simp only [hc, List.cons_append, List.nil_append] at h ⊢ + rw [h, dstep]; rfl +theorem lunit (L R : List Bool) : run 4 (dc (Rr ++ L) R) = dc L (Lu ++ R) := by + have h := frame (n := 3) (s := .D) (s' := .D) (L := [false, true, true]) (h := false) + (R := []) (L' := []) (h' := true) (R' := [true, true, true]) L R (by decide) + rw [show 4 = 3 + 1 from rfl, run_add] + simp only [dc, Rr, List.cons_append, List.nil_append, List.tail_cons, List.headD_cons] at h ⊢ + rw [h, dstep]; rfl +theorem lmark (L R : List Bool) : run 6 (dc (Mr ++ L) R) = dc L ([false, false] ++ Lu ++ R) := by + have h := frame (n := 5) (s := .D) (s' := .D) (L := [false, true, true, true, true]) (h := false) + (R := []) (L' := []) (h' := true) (R' := [false, false, true, true, true]) L R (by decide) + rw [show 6 = 5 + 1 from rfl, run_add] + simp only [dc, Mr, List.cons_append, List.nil_append, List.tail_cons, List.headD_cons] at h ⊢ + rw [h, dstep]; rfl +theorem rsweep (n : Nat) (P R : List Bool) : + run (18 * n) (hc P (pw Lu n ++ R)) = hc (pw Rr n ++ P) R := by + induction n generalizing P with + | zero => rfl + | succ n ih => + rw [Nat.mul_succ, Nat.add_comm, run_add, pw_succ, List.append_assoc, unit, ih, + pw_succ', List.append_assoc] +theorem lsweep (n : Nat) (L R : List Bool) : + run (4 * n) (dc (pw Rr n ++ L) R) = dc L (pw Lu n ++ R) := by + induction n generalizing R with + | zero => rfl + | succ n ih => + rw [Nat.mul_succ, Nat.add_comm, run_add, pw_succ, List.append_assoc, lunit, ih, pw_succ', List.append_assoc] +end M8 +namespace M8 +open List +inductive Dg | z | o | t + deriving DecidableEq, Repr +def rdig : Dg -> List Bool + | .z => [false, false, false] + | .o => [false, true, true] + | .t => [false, false, true] +def Sr (ds : List Dg) : List Bool := ds.flatMap rdig +@[simp] theorem Sr_nil : Sr [] = [] := rfl +@[simp] theorem Sr_cons (d : Dg) (ds : List Dg) : Sr (d :: ds) = rdig d ++ Sr ds := by + simp [Sr] +def inc : List Dg -> List Dg + | [] => [.o] + | .z :: r => .o :: r + | .o :: r => .t :: r + | .t :: r => .z :: inc r +def tz : List Dg -> Nat + | .t :: r => tz r + 1 + | _ => 0 +def lowOk : List Dg -> Bool + | [] => false + | .t :: r => lowOk r + | _ => true +def val : List Dg -> Nat + | [] => 0 + | d :: r => (match d with | .z => 0 | .o => 1 | .t => 2) + 3 * val r +theorem val_inc (ds : List Dg) : val (inc ds) = val ds + 1 := by + induction ds with + | nil => rfl + | cons d r ih => cases d <;> simp [inc, val, ih] <;> omega +theorem cdig2 (L R : List Bool) : run 3 (dc (rdig .t ++ L) R) = dc L ([true, true, true] ++ R) := by + have h := frame (n := 2) (s := .D) (s' := .C) (L := [false, true]) (h := false) + (R := []) (L' := []) (h' := true) (R' := [true, true]) L R (by decide) + rw [show 3 = 2 + 1 from rfl, run_add] + simp only [dc, rdig, List.cons_append, List.nil_append, List.tail_cons, List.headD_cons] at h ⊢ + rw [h, cstep]; rfl +theorem cdig0 (L R : List Bool) : run 5 (dc (rdig .z ++ L) R) = ac (rdig .o ++ L) R := by + have h := frame (n := 4) (s := .D) (s' := .A) (L := [false, false]) (h := false) + (R := []) (L' := [true, true]) (h' := true) (R' := []) L R (by decide) + rw [show 5 = 4 + 1 from rfl, run_add] + simp only [dc, rdig, List.cons_append, List.nil_append, List.tail_cons, List.headD_cons] at h ⊢ + rw [h, astep] +theorem cdig1 (L R : List Bool) : run 5 (dc (rdig .o ++ L) R) = ac (rdig .t ++ L) R := by + have h := frame (n := 4) (s := .D) (s' := .A) (L := [true, true]) (h := false) + (R := []) (L' := [false, true]) (h' := true) (R' := []) L R (by decide) + rw [show 5 = 4 + 1 from rfl, run_add] + simp only [dc, rdig, List.cons_append, List.nil_append, List.tail_cons, List.headD_cons] at h ⊢ + rw [h, astep] +theorem erase (L R : List Bool) : run 3 (ac L ([true, true, true] ++ R)) = ac ([false, false, false] ++ L) R := by + show run 1 (run 1 (run 1 ⟨.A, L, true, [true, true] ++ R⟩)) = _ + rfl +theorem cnt (ds : List Dg) (hok : lowOk ds = true) (L R : List Bool) : + run (6 * tz ds + 5) (dc (Sr ds ++ L) R) = ac (Sr (inc ds) ++ L) R := by + induction ds generalizing R with + | nil => simp [lowOk] at hok + | cons d r ih => + cases d with + | z => simpa [tz, inc, List.append_assoc] using cdig0 (Sr r ++ L) R + | o => simpa [tz, inc, List.append_assoc] using cdig1 (Sr r ++ L) R + | t => + simp only [lowOk] at hok + simp only [tz, inc, Sr_cons, List.append_assoc] + rw [show 6 * (tz r + 1) + 5 = 3 + (6 * tz r + 5) + 3 by omega, run_add, run_add, cdig2, + ih hok, erase] + rfl +theorem cnt_top (n : Nat) (L R : List Bool) : + run (6 * n + 5) (dc (Sr (List.replicate n .t) ++ [false, false, false] ++ L) R) + = ac (Sr (inc (List.replicate n .t)) ++ L) R := by + have key : ∀ n, Sr (List.replicate n .t) ++ [false, false, false] = Sr (List.replicate n .t ++ [.z]) + /\ tz (List.replicate n .t ++ [.z]) = n /\ lowOk (List.replicate n .t ++ [.z]) = true + /\ inc (List.replicate n .t ++ [.z]) = inc (List.replicate n .t) := by + intro n + induction n with + | zero => simp [Sr, rdig, tz, lowOk, inc] + | succ n ih => + obtain ⟨h1, h2, h3, h4⟩ := ih + refine ⟨?_, ?_, ?_, ?_⟩ + · simp only [List.replicate_succ, List.cons_append, Sr_cons, List.append_assoc] at h1 ⊢ + rw [h1] + · simp [List.replicate_succ, tz, h2] + · simp [List.replicate_succ, lowOk, h3] + · simp [List.replicate_succ, inc, h4] + obtain ⟨h1, h2, h3, h4⟩ := key n + rw [h1, <- h4, <- cnt _ h3, h2] +end M8 +namespace M8 +open List +def rtt : List Nat -> List Bool -> List Bool + | [], R => R + | b :: bs, R => [true, false] ++ pw Lu b ++ rtt bs R +def Q : List Nat -> List Bool -> List Bool + | [], P => P + | b :: bs, P => Q bs (pw Rr (b - 1) ++ Mr ++ P) +def E : List Nat -> List Bool + | [] => [] + | b :: bs => [false, false] ++ pw Lu b ++ E bs +def swT : List Nat -> Nat + | [] => 0 + | b :: bs => 36 + 18 * b + swT bs +def lqT : List Nat -> Nat + | [] => 0 + | b :: bs => lqT bs + 4 * (b - 1) + 6 +theorem swT_eq (bs : List Nat) : swT bs = 36 * bs.length + 18 * bs.sum := by + induction bs with + | nil => rfl + | cons b bs ih => simp [swT, ih]; omega +theorem lqT_eq (bs : List Nat) (hb : ∀ b ∈ bs, 1 ≤ b) : lqT bs = 4 * bs.sum + 2 * bs.length := by + induction bs with + | nil => rfl + | cons b bs ih => + have h1 := hb b (by simp) + have := ih (fun x hx => hb x (by simp [hx])) + simp [lqT, this]; omega +theorem swp (bs : List Nat) (hb : ∀ b ∈ bs, 1 ≤ b) (P R : List Bool) : + run (swT bs) (hc (Rr ++ P) (rtt bs R)) = hc (Rr ++ Q bs P) R := by + induction bs generalizing P with + | nil => rfl + | cons b bs ih => + obtain ⟨b', rfl⟩ : ∃ b', b = b' + 1 := ⟨b - 1, by have := hb b (by simp); omega⟩ + have ih' := ih (fun x hx => hb x (by simp [hx])) + simp only [swT, rtt, Q, Nat.add_sub_cancel] + rw [run_add, run_add] + have e : [true, false] ++ pw Lu (b' + 1) ++ rtt bs R + = [true, false] ++ false :: ([true, true, true] ++ pw Lu b' ++ rtt bs R) := by + simp [Lu] + rw [e, pass] + have e2 : false :: ([true, true, true] ++ pw Lu b' ++ rtt bs R) = pw Lu (b' + 1) ++ rtt bs R := by + simp [Lu] + rw [e2, rsweep, pw_succ, List.append_assoc, ih'] + simp [List.append_assoc] +theorem lqp (bs : List Nat) (hb : ∀ b ∈ bs, 1 ≤ b) (P R : List Bool) : + run (lqT bs) (dc (Q bs P) R) = dc P (E bs ++ R) := by + induction bs generalizing P R with + | nil => rfl + | cons b bs ih => + obtain ⟨b', rfl⟩ : ∃ b', b = b' + 1 := ⟨b - 1, by have := hb b (by simp); omega⟩ + have ih' := ih (fun x hx => hb x (by simp [hx])) + simp only [lqT, Q, E, Nat.add_sub_cancel] + rw [run_add, run_add, ih', List.append_assoc, lsweep, lmark] + simp [pw_succ, List.append_assoc] +theorem start (bs : List Nat) (hb : ∀ b ∈ bs, 1 ≤ b) (k m n : Nat) (hn : m + k = n + 1) + (S R : List Bool) : + run (18 * m + swT bs) (hc (pw Rr k ++ S) (pw Lu m ++ rtt bs R)) + = hc (Rr ++ Q bs (pw Rr n ++ S)) R := by + rw [run_add, rsweep, <- List.append_assoc, <- pw_add, hn, pw_succ, List.append_assoc, swp bs hb] +theorem finish (bs : List Nat) (hb : ∀ b ∈ bs, 1 ≤ b) (ds : List Dg) (hok : lowOk ds = true) + (k' m' : Nat) (Lt R : List Bool) : + run (lqT bs + 4 * (k' + 1 + m') + (6 * tz ds + 5) + 1 + 18 * k') + (dc (Q bs (pw Rr (k' + 1 + m') ++ (Sr ds ++ Lt))) R) + = hc (pw Rr k' ++ (Sr (inc ds) ++ Lt)) (pw Lu m' ++ (E bs ++ R)) := by + rw [run_add _ (18 * k'), run_add _ 1, run_add _ (6 * tz ds + 5), run_add (lqT bs), lqp bs hb, + lsweep, cnt ds hok] + rw [show k' + 1 + m' = (k' + m') + 1 by omega, pw_succ, List.append_assoc, restart, pw_add, + List.append_assoc, rsweep] +theorem incr (ds : List Dg) (hok : lowOk ds = true) (bs : List Nat) (hb : ∀ b ∈ bs, 1 ≤ b) + (k m k' m' : Nat) (hkm : k + m = k' + m' + 2) (Lt X : List Bool) : + run (22 * m + 22 * bs.sum + 38 * bs.length + 4 * k + 30 + 6 * tz ds + 18 * k') + (hc (pw Rr k ++ Sr ds ++ Lt) (pw Lu m ++ rtt bs ([false, false] ++ X))) + = hc (pw Rr k' ++ Sr (inc ds) ++ Lt) + (pw Lu m' ++ E bs ++ pw Lu 2 ++ [true, false] ++ X) := by + have e : 22 * m + 22 * bs.sum + 38 * bs.length + 4 * k + 30 + 6 * tz ds + 18 * k' + = (18 * m + swT bs) + (24 + (4 + (lqT bs + 4 * (k' + 1 + m') + (6 * tz ds + 5) + 1 + 18 * k'))) := by + rw [swT_eq, lqT_eq bs hb]; omega + rw [e, run_add, List.append_assoc, start bs hb k m (k' + 1 + m') (by omega), run_add, turn, + run_add, lunit, finish bs hb ds hok k' m' Lt] + simp [List.append_assoc, Lu] +theorem ovf (ds : List Dg) (hok : lowOk ds = true) (bs : List Nat) (hb : ∀ b ∈ bs, 1 ≤ b) + (k m k' m' : Nat) (hkm : k + m = k' + m' + 2) (Lt X : List Bool) : + run (22 * m + 22 * bs.sum + 38 * (bs.length + 1) + 4 * k + 30 + 6 * tz ds + 18 * k') + (hc (pw Rr k ++ Sr ds ++ Lt) (pw Lu m ++ rtt bs ([true, false] ++ [false, false] ++ X))) + = hc (pw Rr k' ++ Sr (inc ds) ++ Lt) + (pw Lu m' ++ E bs ++ [false, false] ++ pw Lu 2 ++ [true, false] ++ X) := by + have e : 22 * m + 22 * bs.sum + 38 * (bs.length + 1) + 4 * k + 30 + 6 * tz ds + 18 * k' + = (18 * m + swT bs) + (36 + (24 + (6 + (lqT bs + 4 * (k' + 1 + m') + (6 * tz ds + 5) + 1 + 18 * k')))) := by + rw [swT_eq, lqT_eq bs hb]; omega + rw [e, run_add, List.append_assoc, start bs hb k m (k' + 1 + m') (by omega), run_add] + rw [show [true, false] ++ [false, false] ++ X = [true, false] ++ false :: (false :: X) by rfl, pass, + run_add, show false :: false :: X = [false, false] ++ X by rfl, turn, run_add, lmark, + finish bs hb ds hok k' m' Lt] + simp [List.append_assoc, Lu] +def zz : List Dg -> Nat + | .z :: r => zz r + 1 + | _ => 0 +def kc (ds : List Dg) : Nat := 3 - min (zz ds) 3 +def ck (ds : List Dg) (B1 : Nat) (T : List Bool) : Cfg := + hc (pw Rr (kc ds) ++ Sr ds ++ []) (pw Lu (B1 - kc ds - 1) ++ T) +theorem kc_inc (ds : List Dg) (hok : lowOk ds = true) : kc (inc ds) = 3 - min (tz ds) 3 := by + unfold kc; congr 2 + induction ds with + | nil => simp [lowOk] at hok + | cons d r ih => + cases d with + | z => rfl + | o => rfl + | t => simp only [lowOk] at hok; simp [inc, tz, zz, ih hok] +theorem incr_canon (ds : List Dg) (hok : lowOk ds = true) (bs : List Nat) (hb : ∀ b ∈ bs, 1 ≤ b) + (B1 : Nat) (hB : 6 ≤ B1) (X : List Bool) : + run (22 * (B1 + bs.sum) + 38 * bs.length + 8 + 18 * min (zz ds) 3 + 18 * (tz ds - 3) - 12 * tz ds) + (ck ds B1 (rtt bs ([false, false] ++ X))) + = ck (inc ds) (if bs = [] then B1 else B1 - 2) + (E bs ++ (if bs = [] then [] else pw Lu 2) ++ [true, false] ++ X) := by + have hk := kc_inc ds hok + have h1 : kc ds ≤ 3 := by unfold kc; omega + have h2 : kc (inc ds) ≤ 3 := by rw [hk]; omega + have h := incr ds hok bs hb (kc ds) (B1 - kc ds - 1) (kc (inc ds)) (B1 - kc ds - 1 + kc ds - kc (inc ds) - 2) + (by omega) [] X + have et : 22 * (B1 + bs.sum) + 38 * bs.length + 8 + 18 * min (zz ds) 3 + 18 * (tz ds - 3) - 12 * tz ds + = 22 * (B1 - kc ds - 1) + 22 * bs.sum + 38 * bs.length + 4 * kc ds + 30 + 6 * tz ds + 18 * kc (inc ds) := by + rw [hk]; unfold kc; omega + unfold ck; rw [et, h] + by_cases hbs : bs = [] + · subst hbs + simp only [if_true, E, List.nil_append, List.append_nil] + rw [show B1 - kc (inc ds) - 1 = (B1 - kc ds - 1 + kc ds - kc (inc ds) - 2) + 2 by omega, pw_add] + simp [List.append_assoc] + · simp only [hbs, if_false, List.append_nil] + rw [show B1 - 2 - kc (inc ds) - 1 = B1 - kc ds - 1 + kc ds - kc (inc ds) - 2 by omega] + simp [List.append_assoc] +theorem ovf_canon (ds : List Dg) (hok : lowOk ds = true) (bs : List Nat) (hb : ∀ b ∈ bs, 1 ≤ b) + (B1 : Nat) (hB : 6 ≤ B1) (X : List Bool) : + run (22 * (B1 + bs.sum) + 38 * (bs.length + 1) + 8 + 18 * min (zz ds) 3 + 18 * (tz ds - 3) - 12 * tz ds) + (ck ds B1 (rtt bs ([true, false] ++ [false, false] ++ X))) + = ck (inc ds) (B1 - 2) (E bs ++ [false, false] ++ pw Lu 2 ++ [true, false] ++ X) := by + have hk := kc_inc ds hok + have h1 : kc ds ≤ 3 := by unfold kc; omega + have h2 : kc (inc ds) ≤ 3 := by rw [hk]; omega + have h := ovf ds hok bs hb (kc ds) (B1 - kc ds - 1) (kc (inc ds)) (B1 - kc ds - 1 + kc ds - kc (inc ds) - 2) + (by omega) [] X + have et : 22 * (B1 + bs.sum) + 38 * (bs.length + 1) + 8 + 18 * min (zz ds) 3 + 18 * (tz ds - 3) - 12 * tz ds + = 22 * (B1 - kc ds - 1) + 22 * bs.sum + 38 * (bs.length + 1) + 4 * kc ds + 30 + 6 * tz ds + + 18 * kc (inc ds) := by + rw [hk]; unfold kc; omega + unfold ck; rw [et, h] + rw [show B1 - 2 - kc (inc ds) - 1 = B1 - kc ds - 1 + kc ds - kc (inc ds) - 2 by omega] + simp [List.append_assoc] +end M8 +namespace M8 +open List +theorem run_trans {a b : Nat} {c c' c'' : Cfg} (h1 : run a c = c') (h2 : run b c' = c'') : + run (a + b) c = c'' := by rw [run_add, h1, h2] +theorem rep_add {α} (a : α) (m n : Nat) : List.replicate (m + n) a = List.replicate m a ++ List.replicate n a := + List.replicate_append_replicate.symm +def T3 : List Bool := [true, true, true] +def F3 : List Bool := [false, false, false] +theorem carry2 (n : Nat) (L R : List Bool) : + run (3 * n) (dc (Sr (List.replicate n Dg.t) ++ L) R) = dc L (pw T3 n ++ R) := by + induction n generalizing R with + | zero => rfl + | succ n ih => + rw [show 3 * (n + 1) = 3 + 3 * n by omega, run_add, List.replicate_succ, Sr_cons, + List.append_assoc, cdig2, ih, pw_succ', List.append_assoc] + rfl +theorem zip1 (L R : List Bool) : + run 3 ⟨.A, L, false, true :: R⟩ = ⟨.A, false :: L, false, R⟩ := rfl +theorem zip (n : Nat) (L R : List Bool) : + run (3 * n) ⟨.A, L, false, List.replicate n true ++ R⟩ + = ⟨.A, List.replicate n false ++ L, false, R⟩ := by + induction n generalizing L with + | zero => rfl + | succ n ih => + rw [show 3 * (n + 1) = 3 + 3 * n by omega, run_add, List.replicate_succ, List.cons_append, zip1, ih, + List.replicate_succ', List.append_assoc] + rfl +theorem pw_T3 (n : Nat) : pw T3 n = List.replicate (3 * n) true := by + induction n with + | zero => rfl + | succ n ih => rw [pw_succ, ih, show 3 * (n + 1) = 3 + 3 * n by omega, rep_add]; rfl +theorem Sr_zeros (n : Nat) : Sr (List.replicate n Dg.z) = List.replicate (3 * n) false := by + induction n with + | zero => rfl + | succ n ih => + rw [List.replicate_succ, Sr_cons, ih, show 3 * (n + 1) = 3 + 3 * n by omega, rep_add]; rfl +theorem realign_end (L R : List Bool) : + run 10 ⟨.A, F3 ++ L, false, Lu ++ R⟩ = hc (Rr ++ L) R := by + have h := frame (n := 10) (s := .A) (s' := .B) (L := [false, false, false]) (h := false) + (R := [false, true, true, true]) (L' := [true, false, false, true, true]) (h' := true) + (R' := [true, true]) L R (by decide) + simpa [hc, F3, Lu, Rr] using h +theorem realign (n : Nat) (hi : List Dg) (hok : lowOk hi = true) (L R : List Bool) : + run (3 * (n + 1) + (1 + ((6 * tz hi + 5) + (3 * (3 * (n + 1)) + 10)))) + (dc (Sr (List.replicate (n + 1) Dg.t) ++ [true] ++ Sr hi ++ L) (Lu ++ R)) + = hc (Rr ++ Sr (List.replicate n Dg.z) ++ Sr (inc hi) ++ L) R := by + have s0 := carry2 (n + 1) ([true] ++ Sr hi ++ L) (Lu ++ R) + have s1 : run 1 (dc ([true] ++ Sr hi ++ L) (pw T3 (n + 1) ++ (Lu ++ R))) + = dc (Sr hi ++ L) (false :: (pw T3 (n + 1) ++ (Lu ++ R))) := rfl + have s2 := cnt hi hok L (false :: (pw T3 (n + 1) ++ (Lu ++ R))) + have e2 : ac (Sr (inc hi) ++ L) (false :: (pw T3 (n + 1) ++ (Lu ++ R))) + = ⟨.A, Sr (inc hi) ++ L, false, List.replicate (3 * (n + 1)) true ++ (Lu ++ R)⟩ := by + simp only [ac, List.headD_cons, List.tail_cons, pw_T3] + have s3 := zip (3 * (n + 1)) (Sr (inc hi) ++ L) (Lu ++ R) + have e3 : List.replicate (3 * (n + 1)) false ++ (Sr (inc hi) ++ L) + = F3 ++ (Sr (List.replicate n Dg.z) ++ Sr (inc hi) ++ L) := by + rw [Sr_zeros, show 3 * (n + 1) = 3 + 3 * n by omega, rep_add]; simp [F3] + have s4 := realign_end (Sr (List.replicate n Dg.z) ++ Sr (inc hi) ++ L) R + refine run_trans (by simpa [List.append_assoc] using s0) (run_trans s1 (run_trans s2 ?_)) + rw [e2]; refine run_trans s3 ?_ + rw [e3]; simpa [List.append_assoc] using s4 +theorem realign0 (hi : List Dg) (hok : lowOk hi = true) (hok' : lowOk (inc hi) = true) + (L R : List Bool) : + run (1 + ((6 * tz hi + 5) + (3 + ((6 * tz (inc hi) + 5) + (1 + 1))))) + (dc ([true] ++ Sr hi ++ L) (Lu ++ R)) + = hc ([false] ++ Sr (inc (inc hi)) ++ L) R := by + have s1 : run 1 (dc ([true] ++ Sr hi ++ L) (Lu ++ R)) = dc (Sr hi ++ L) (false :: (Lu ++ R)) := rfl + have s2 := cnt hi hok L (false :: (Lu ++ R)) + have s3 : run 3 (ac (Sr (inc hi) ++ L) (false :: (Lu ++ R))) + = dc (Sr (inc hi) ++ L) ([true] ++ (Lu ++ R)) := rfl + have s4 := cnt (inc hi) hok' L ([true] ++ (Lu ++ R)) + have s5 : run 1 (ac (Sr (inc (inc hi)) ++ L) ([true] ++ (Lu ++ R))) + = ac ([false] ++ Sr (inc (inc hi)) ++ L) (Lu ++ R) := rfl + have s6 := restart ([false] ++ Sr (inc (inc hi)) ++ L) R + exact run_trans s1 (run_trans s2 (run_trans s3 (run_trans s4 (run_trans s5 s6)))) +theorem absHead (L X : List Bool) : + run 3 (ac L ([false, false] ++ X)) = dc L ([true, false] ++ X) := rfl +theorem absTailZ (L R : List Bool) : + run 11 ⟨.A, rdig .z ++ L, true, [false] ++ Lu ++ R⟩ = hc (Rr ++ [false] ++ L) R := by + have h := frame (n := 11) (s := .A) (s' := .B) (L := [false, false, false]) (h := true) + (R := [false, false, true, true, true]) (L' := [true, false, false, true, true, false]) (h' := true) + (R' := [true, true]) L R (by decide) + simpa [hc, rdig, Lu, Rr] using h +theorem absTailT (L R : List Bool) : + run 11 ⟨.A, rdig .t ++ L, true, [false] ++ Lu ++ R⟩ = hc (Rr ++ [true] ++ L) R := by + have h := frame (n := 11) (s := .A) (s' := .B) (L := [false, false, true]) (h := true) + (R := [false, false, true, true, true]) (L' := [true, false, false, true, true, true]) (h' := true) + (R' := [true, true]) L R (by decide) + simpa [hc, rdig, Lu, Rr] using h +theorem absTailO1 (L R : List Bool) : + run 8 ⟨.A, rdig .o ++ L, true, [false] ++ Lu ++ R⟩ + = dc L ([false, true, true, true, true] ++ Lu ++ R) := by + have h := frame (n := 7) (s := .A) (s' := .D) (L := [false, true, true]) (h := true) + (R := [false, false]) (L' := []) (h' := true) + (R' := [true, true, true, true, false]) L ([true, true, true] ++ R) (by decide) + rw [show 8 = 7 + 1 from rfl, run_add] + simp only [rdig, Lu, List.cons_append, List.nil_append] at h ⊢ + rw [h, dstep] +theorem absTailO2 (L R : List Bool) : + run 4 (ac L ([false, true, true, true, true] ++ R)) = hc ([false] ++ L) R := rfl +end M8 +namespace M8 +open List +def Reach1 (c c' : Cfg) : Prop := ∃ n, 0 < n /\ run n c = c' +theorem Reach1.trans {c c' c'' : Cfg} (h : Reach1 c c') (h' : Reach1 c' c'') : Reach1 c c'' := by + obtain ⟨a, ha, e⟩ := h + obtain ⟨b, hb, e'⟩ := h' + exact ⟨a + b, by omega, by rw [run_add, e, e']⟩ +theorem absFirst (ds : List Dg) (h1 : lowOk ds = true) (h2 : lowOk (inc ds) = true) + (b : Nat) (bs : List Nat) (hb : ∀ x ∈ b :: bs, 1 ≤ x) (L X : List Bool) : + ∃ n, 0 < n /\ run n (hc (Sr ds ++ L) (Lu ++ rtt (b :: bs) ([false, false] ++ X))) + = ac (Sr (inc (inc ds)) ++ L) ([true, false] ++ pw Lu b ++ E bs ++ pw Lu 2 ++ [true, false] ++ X) := by + have s1 := start (b :: bs) hb 0 1 0 rfl (Sr ds ++ L) ([false, false] ++ X) + have s2 := turn (Rr ++ Q (b :: bs) (pw Rr 0 ++ (Sr ds ++ L))) X + have s3 := lunit (Q (b :: bs) (pw Rr 0 ++ (Sr ds ++ L))) (Lu ++ [true, false] ++ X) + have s4 := lqp (b :: bs) hb (pw Rr 0 ++ (Sr ds ++ L)) (Lu ++ (Lu ++ [true, false] ++ X)) + have s5 := cnt ds h1 L (E (b :: bs) ++ (Lu ++ (Lu ++ [true, false] ++ X))) + have s6 := absHead (Sr (inc ds) ++ L) (pw Lu b ++ E bs ++ (Lu ++ (Lu ++ [true, false] ++ X))) + have s7 := cnt (inc ds) h2 L ([true, false] ++ (pw Lu b ++ E bs ++ (Lu ++ (Lu ++ [true, false] ++ X)))) + simp only [pw_zero, List.nil_append, pw_succ, List.append_nil] at s1 s2 s3 s4 + have e5 : E (b :: bs) ++ (Lu ++ (Lu ++ [true, false] ++ X)) + = [false, false] ++ (pw Lu b ++ E bs ++ (Lu ++ (Lu ++ [true, false] ++ X))) := by + simp [E, List.append_assoc] + rw [e5] at s5 + refine ⟨_, ?_, run_trans s1 (run_trans s2 (run_trans s3 (run_trans s4 (run_trans s5 + (run_trans s6 (s7.trans (by simp [List.append_assoc, pw_succ])))))))⟩ + omega +theorem pw_pos (l : List Bool) (b : Nat) (hb : 1 ≤ b) (R : List Bool) : + pw l b ++ R = l ++ (pw l (b - 1) ++ R) := by + obtain ⟨b', rfl⟩ : ∃ b', b = b' + 1 := ⟨b - 1, by omega⟩ + simp [List.append_assoc] +theorem absorbZ (ds : List Dg) (h1 : lowOk ds = true) (h2 : lowOk (inc ds) = true) (r : List Dg) + (hr : inc (inc ds) = .z :: r) + (b : Nat) (bs : List Nat) (hb : ∀ x ∈ b :: bs, 1 ≤ x) (L X : List Bool) : + Reach1 (hc (Sr ds ++ L) (Lu ++ rtt (b :: bs) ([false, false] ++ X))) + (hc (Rr ++ [false] ++ Sr r ++ L) (pw Lu (b - 1) ++ E bs ++ pw Lu 2 ++ [true, false] ++ X)) := by + obtain ⟨n, hn, e⟩ := absFirst ds h1 h2 b bs hb L X + have hb1 : 1 ≤ b := hb b (by simp) + have t := absTailZ (Sr r ++ L) (pw Lu (b - 1) ++ E bs ++ pw Lu 2 ++ [true, false] ++ X) + refine ⟨n + 11, by omega, ?_⟩ + rw [run_add, e, hr, Sr_cons] + have : ac ((rdig .z ++ Sr r) ++ L) ([true, false] ++ pw Lu b ++ E bs ++ pw Lu 2 ++ [true, false] ++ X) + = ⟨.A, rdig .z ++ (Sr r ++ L), true, + [false] ++ Lu ++ (pw Lu (b - 1) ++ E bs ++ pw Lu 2 ++ [true, false] ++ X)⟩ := by + simp only [ac, List.append_assoc, List.cons_append, List.nil_append, List.headD_cons, List.tail_cons] + rw [pw_pos Lu b hb1] + rw [this, t]; simp [List.append_assoc] +theorem absorbT (ds : List Dg) (h1 : lowOk ds = true) (h2 : lowOk (inc ds) = true) (r : List Dg) + (hr : inc (inc ds) = .t :: r) + (b : Nat) (bs : List Nat) (hb : ∀ x ∈ b :: bs, 1 ≤ x) (L X : List Bool) : + Reach1 (hc (Sr ds ++ L) (Lu ++ rtt (b :: bs) ([false, false] ++ X))) + (hc (Rr ++ [true] ++ Sr r ++ L) (pw Lu (b - 1) ++ E bs ++ pw Lu 2 ++ [true, false] ++ X)) := by + obtain ⟨n, hn, e⟩ := absFirst ds h1 h2 b bs hb L X + have hb1 : 1 ≤ b := hb b (by simp) + have t := absTailT (Sr r ++ L) (pw Lu (b - 1) ++ E bs ++ pw Lu 2 ++ [true, false] ++ X) + refine ⟨n + 11, by omega, ?_⟩ + rw [run_add, e, hr, Sr_cons] + have : ac ((rdig .t ++ Sr r) ++ L) ([true, false] ++ pw Lu b ++ E bs ++ pw Lu 2 ++ [true, false] ++ X) + = ⟨.A, rdig .t ++ (Sr r ++ L), true, + [false] ++ Lu ++ (pw Lu (b - 1) ++ E bs ++ pw Lu 2 ++ [true, false] ++ X)⟩ := by + simp only [ac, List.append_assoc, List.cons_append, List.nil_append, List.headD_cons, List.tail_cons] + rw [pw_pos Lu b hb1] + rw [this, t]; simp [List.append_assoc] +theorem absorbO (ds : List Dg) (h1 : lowOk ds = true) (h2 : lowOk (inc ds) = true) (r : List Dg) + (hr : inc (inc ds) = .o :: r) (h3 : lowOk r = true) + (b : Nat) (bs : List Nat) (hb : ∀ x ∈ b :: bs, 1 ≤ x) (L X : List Bool) : + Reach1 (hc (Sr ds ++ L) (Lu ++ rtt (b :: bs) ([false, false] ++ X))) + (hc ([false] ++ Sr (inc r) ++ L) (pw Lu b ++ E bs ++ pw Lu 2 ++ [true, false] ++ X)) := by + obtain ⟨n, hn, e⟩ := absFirst ds h1 h2 b bs hb L X + have hb1 : 1 ≤ b := hb b (by simp) + have t1 := absTailO1 (Sr r ++ L) (pw Lu (b - 1) ++ E bs ++ pw Lu 2 ++ [true, false] ++ X) + have t2 := cnt r h3 L ([false, true, true, true, true] ++ Lu ++ + (pw Lu (b - 1) ++ E bs ++ pw Lu 2 ++ [true, false] ++ X)) + have t3 := absTailO2 (Sr (inc r) ++ L) (Lu ++ (pw Lu (b - 1) ++ E bs ++ pw Lu 2 ++ [true, false] ++ X)) + refine ⟨n + (8 + ((6 * tz r + 5) + 4)), by omega, ?_⟩ + rw [run_add, e, hr, Sr_cons] + have : ac ((rdig .o ++ Sr r) ++ L) ([true, false] ++ pw Lu b ++ E bs ++ pw Lu 2 ++ [true, false] ++ X) + = ⟨.A, rdig .o ++ (Sr r ++ L), true, + [false] ++ Lu ++ (pw Lu (b - 1) ++ E bs ++ pw Lu 2 ++ [true, false] ++ X)⟩ := by + simp only [ac, List.append_assoc, List.cons_append, List.nil_append, List.headD_cons, List.tail_cons] + rw [pw_pos Lu b hb1] + rw [this] + refine run_trans t1 (run_trans t2 ?_) + rw [List.append_assoc _ Lu, t3] + have := pw_pos Lu b hb1 (E bs ++ pw Lu 2 ++ [true, false] ++ X) + simp only [List.append_assoc] at this ⊢ + rw [this] +end M8 +namespace M8 +open List +theorem absGenZ (r : List Dg) (b : Nat) (hb1 : 1 ≤ b) (L Y : List Bool) : + run 11 (ac (Sr (.z :: r) ++ L) ([true, false] ++ pw Lu b ++ Y)) + = hc (Rr ++ [false] ++ Sr r ++ L) (pw Lu (b - 1) ++ Y) := by + have t := absTailZ (Sr r ++ L) (pw Lu (b - 1) ++ Y) + have : ac (Sr (.z :: r) ++ L) ([true, false] ++ pw Lu b ++ Y) + = ⟨.A, rdig .z ++ (Sr r ++ L), true, [false] ++ Lu ++ (pw Lu (b - 1) ++ Y)⟩ := by + simp only [Sr_cons, ac, List.append_assoc, List.cons_append, List.nil_append, List.headD_cons, + List.tail_cons] + rw [pw_pos Lu b hb1] + rw [this, t]; simp [List.append_assoc] +theorem absGenT (r : List Dg) (b : Nat) (hb1 : 1 ≤ b) (L Y : List Bool) : + run 11 (ac (Sr (.t :: r) ++ L) ([true, false] ++ pw Lu b ++ Y)) + = hc (Rr ++ [true] ++ Sr r ++ L) (pw Lu (b - 1) ++ Y) := by + have t := absTailT (Sr r ++ L) (pw Lu (b - 1) ++ Y) + have : ac (Sr (.t :: r) ++ L) ([true, false] ++ pw Lu b ++ Y) + = ⟨.A, rdig .t ++ (Sr r ++ L), true, [false] ++ Lu ++ (pw Lu (b - 1) ++ Y)⟩ := by + simp only [Sr_cons, ac, List.append_assoc, List.cons_append, List.nil_append, List.headD_cons, + List.tail_cons] + rw [pw_pos Lu b hb1] + rw [this, t]; simp [List.append_assoc] +theorem absGenO (r : List Dg) (h3 : lowOk r = true) (b : Nat) (hb1 : 1 ≤ b) (L Y : List Bool) : + run (8 + ((6 * tz r + 5) + 4)) (ac (Sr (.o :: r) ++ L) ([true, false] ++ pw Lu b ++ Y)) + = hc ([false] ++ Sr (inc r) ++ L) (pw Lu b ++ Y) := by + have t1 := absTailO1 (Sr r ++ L) (pw Lu (b - 1) ++ Y) + have t2 := cnt r h3 L ([false, true, true, true, true] ++ Lu ++ (pw Lu (b - 1) ++ Y)) + have t3 := absTailO2 (Sr (inc r) ++ L) (Lu ++ (pw Lu (b - 1) ++ Y)) + have : ac (Sr (.o :: r) ++ L) ([true, false] ++ pw Lu b ++ Y) + = ⟨.A, rdig .o ++ (Sr r ++ L), true, [false] ++ Lu ++ (pw Lu (b - 1) ++ Y)⟩ := by + simp only [Sr_cons, ac, List.append_assoc, List.cons_append, List.nil_append, List.headD_cons, + List.tail_cons] + rw [pw_pos Lu b hb1] + rw [this] + refine run_trans t1 (run_trans t2 ?_) + rw [List.append_assoc _ Lu, t3] + have := pw_pos Lu b hb1 Y + simp only [List.append_assoc] at this ⊢ + rw [this] +theorem absFirstOvf (ds : List Dg) (h1 : lowOk ds = true) (h2 : lowOk (inc ds) = true) + (b : Nat) (bs : List Nat) (hb : ∀ x ∈ b :: bs, 1 ≤ x) (L X : List Bool) : + ∃ n, 0 < n /\ run n (hc (Sr ds ++ L) (Lu ++ rtt (b :: bs) ([true, false] ++ [false, false] ++ X))) + = ac (Sr (inc (inc ds)) ++ L) + ([true, false] ++ pw Lu b ++ (E bs ++ [false, false] ++ pw Lu 2 ++ [true, false] ++ X)) := by + have s1 := start (b :: bs) hb 0 1 0 rfl (Sr ds ++ L) ([true, false] ++ [false, false] ++ X) + simp only [pw_zero, List.nil_append, pw_succ, List.append_nil] at s1 + have s2 := pass (Q (b :: bs) (Sr ds ++ L)) (false :: X) + have s3 := turn (Mr ++ Q (b :: bs) (Sr ds ++ L)) X + have s4 := lmark (Q (b :: bs) (Sr ds ++ L)) (Lu ++ [true, false] ++ X) + have s3' : run 24 (hc (Mr ++ Q (b :: bs) (Sr ds ++ L)) (false :: false :: X)) + = dc (Mr ++ Q (b :: bs) (Sr ds ++ L)) (Lu ++ [true, false] ++ X) := s3 + have s5 := lqp (b :: bs) hb (Sr ds ++ L) ([false, false] ++ Lu ++ (Lu ++ [true, false] ++ X)) + have s6 := cnt ds h1 L (E (b :: bs) ++ ([false, false] ++ Lu ++ (Lu ++ [true, false] ++ X))) + have e6 : E (b :: bs) ++ ([false, false] ++ Lu ++ (Lu ++ [true, false] ++ X)) + = [false, false] ++ (pw Lu b ++ (E bs ++ [false, false] ++ pw Lu 2 ++ [true, false] ++ X)) := by + simp [E, List.append_assoc, pw_succ] + rw [e6] at s6 s5 + have s7 := absHead (Sr (inc ds) ++ L) (pw Lu b ++ (E bs ++ [false, false] ++ pw Lu 2 ++ [true, false] ++ X)) + have s8 := cnt (inc ds) h2 L ([true, false] ++ (pw Lu b ++ (E bs ++ [false, false] ++ pw Lu 2 ++ [true, false] ++ X))) + have e1 : [true, false] ++ [false, false] ++ X = [true, false] ++ false :: (false :: X) := rfl + rw [e1] at s1 + refine ⟨_, ?_, run_trans s1 (run_trans s2 (run_trans s3' (run_trans s4 (run_trans s5 + (run_trans s6 (run_trans s7 (s8.trans ?_)))))))⟩ + · omega + · simp [List.append_assoc] +theorem absorbZo (ds : List Dg) (h1 : lowOk ds = true) (h2 : lowOk (inc ds) = true) (r : List Dg) + (hr : inc (inc ds) = .z :: r) (b : Nat) (bs : List Nat) (hb : ∀ x ∈ b :: bs, 1 ≤ x) (L X : List Bool) : + Reach1 (hc (Sr ds ++ L) (Lu ++ rtt (b :: bs) ([true, false] ++ [false, false] ++ X))) + (hc (Rr ++ [false] ++ Sr r ++ L) + (pw Lu (b - 1) ++ (E bs ++ [false, false] ++ pw Lu 2 ++ [true, false] ++ X))) := by + obtain ⟨n, hn, e⟩ := absFirstOvf ds h1 h2 b bs hb L X + refine ⟨n + 11, by omega, ?_⟩ + rw [run_add, e, hr, absGenZ r b (hb b (by simp))] +theorem absorbTo (ds : List Dg) (h1 : lowOk ds = true) (h2 : lowOk (inc ds) = true) (r : List Dg) + (hr : inc (inc ds) = .t :: r) (b : Nat) (bs : List Nat) (hb : ∀ x ∈ b :: bs, 1 ≤ x) (L X : List Bool) : + Reach1 (hc (Sr ds ++ L) (Lu ++ rtt (b :: bs) ([true, false] ++ [false, false] ++ X))) + (hc (Rr ++ [true] ++ Sr r ++ L) + (pw Lu (b - 1) ++ (E bs ++ [false, false] ++ pw Lu 2 ++ [true, false] ++ X))) := by + obtain ⟨n, hn, e⟩ := absFirstOvf ds h1 h2 b bs hb L X + refine ⟨n + 11, by omega, ?_⟩ + rw [run_add, e, hr, absGenT r b (hb b (by simp))] +theorem absorbOo (ds : List Dg) (h1 : lowOk ds = true) (h2 : lowOk (inc ds) = true) (r : List Dg) + (hr : inc (inc ds) = .o :: r) (h3 : lowOk r = true) + (b : Nat) (bs : List Nat) (hb : ∀ x ∈ b :: bs, 1 ≤ x) (L X : List Bool) : + Reach1 (hc (Sr ds ++ L) (Lu ++ rtt (b :: bs) ([true, false] ++ [false, false] ++ X))) + (hc ([false] ++ Sr (inc r) ++ L) + (pw Lu b ++ (E bs ++ [false, false] ++ pw Lu 2 ++ [true, false] ++ X))) := by + obtain ⟨n, hn, e⟩ := absFirstOvf ds h1 h2 b bs hb L X + refine ⟨n + (8 + ((6 * tz r + 5) + 4)), by omega, ?_⟩ + rw [run_add, e, hr, absGenO r h3 b (hb b (by simp))] +end M8 +namespace M8.R3 +open List +def dv : Dg -> Nat + | .z => 0 + | .o => 1 + | .t => 2 +def dg : Nat -> Dg + | 0 => .z + | 1 => .o + | _ => .t +theorem val_cons (d : Dg) (r : List Dg) : val (d :: r) = dv d + 3 * val r := by + cases d <;> rfl +def dig (n : Nat) : List Dg := + if h : n = 0 then [] else dg (n % 3) :: dig (n / 3) +decreasing_by omega +theorem dv_dg (n : Nat) (h : n < 3) : dv (dg n) = n := by + match n, h with + | 0, _ => rfl + | 1, _ => rfl + | 2, _ => rfl +theorem val_dig (n : Nat) : val (dig n) = n := by + induction n using Nat.strongRecOn with + | _ n ih => + unfold dig + split + · subst_vars; rfl + · rw [val_cons, ih (n / 3) (by omega), dv_dg _ (Nat.mod_lt _ (by omega))]; omega +theorem dig_zero : dig 0 = [] := by unfold dig; simp +theorem dig_pos (n : Nat) (h : n ≠ 0) : dig n = dg (n % 3) :: dig (n / 3) := by + rw [dig]; simp [h] +theorem trim_Sr_dig (ds : List Dg) : trim (Sr ds) = trim (Sr (dig (val ds))) := by + induction ds with + | nil => show trim (Sr []) = trim (Sr (dig 0)); rw [dig_zero] + | cons d r ih => + rw [val_cons] + by_cases h0 : dv d + 3 * val r = 0 + · have hd : d = .z := by cases d <;> simp [dv] at h0 ⊢ + have hr : val r = 0 := by omega + subst hd + rw [h0, dig_zero, Sr_cons] + rw [hr, dig_zero] at ih + simp [rdig, ih, cons'] + · rw [dig_pos _ h0, Sr_cons, Sr_cons] + have e1 : dg ((dv d + 3 * val r) % 3) = d := by + cases d <;> simp [dv, dg] <;> omega + have e2 : (dv d + 3 * val r) / 3 = val r := by cases d <;> simp [dv] <;> omega + rw [e1, e2] + exact trim_append_congr _ ih +theorem trim_Sr_val {ds ds' : List Dg} (h : val ds = val ds') : trim (Sr ds) = trim (Sr ds') := by + rw [trim_Sr_dig ds, trim_Sr_dig ds', h] +theorem Sr_append (a b : List Dg) : Sr (a ++ b) = Sr a ++ Sr b := by + simp [Sr] +theorem val_append (a b : List Dg) : val (a ++ b) = val a + 3 ^ a.length * val b := by + induction a with + | nil => simp [val] + | cons d r ih => + rw [List.cons_append, val_cons, val_cons, ih, List.length_cons, Nat.pow_succ] + have e : 3 * (3 ^ r.length * val b) = 3 ^ r.length * 3 * val b := by + rw [Nat.mul_comm (3 ^ r.length) 3, Nat.mul_assoc] + rw [Nat.mul_add, e, Nat.add_assoc] +inductive CF + | cl (v : Nat) + | lone (lo : List Dg) (hv : Nat) +def shl (n : Nat) : List Dg × Nat := + if h : n = 0 then ([], 0) + else if n % 3 = 0 then (.z :: (shl (n / 3)).1, (shl (n / 3)).2) + else if n % 3 = 1 then ([.t], n / 3) else ([.z], n / 3) +decreasing_by omega +def shv (n : Nat) : CF := if n = 0 then .cl 0 else .lone (shl n).1 (shl n).2 +def ctape : CF -> List Bool + | .cl v => Sr (dig v) + | .lone lo hv => Sr lo ++ [true] ++ Sr (dig hv) +def lad : List (Bool × Nat) -> List Bool + | [] => [true, false] + | (s, b) :: r => (if s then [true, false] else [false, false]) ++ pw Lu b ++ lad r +def linc : Nat -> List (Bool × Nat) -> Nat × List (Bool × Nat) + | B, [] => (B - 2, [(false, 2)]) + | B, (false, c) :: r => (B, (true, c) :: r) + | B, (true, c) :: r => (B - 2, (false, (linc c r).1 + 2) :: (linc c r).2) +def cph : CF -> Nat × CF + | .cl v => (0, .cl (v + 1)) + | .lone lo hv => + if lowOk lo then (0, .lone (inc lo) hv) + else if lo = [] then (0, shv (hv + 2)) + else (1, .cl (3 ^ (lo.length - 1) * (hv + 1))) +structure AS where + k : Nat + C : CF + m : Nat + L : List (Bool × Nat) +def absStep : CF -> List (Bool × Nat) -> AS + | .cl v, (_, b) :: rest => + if (v + 2) % 3 = 0 then ⟨1, shv ((v + 2) / 3), b - 1, rest⟩ + else if (v + 2) % 3 = 2 then ⟨1, .lone [] ((v + 2) / 3), b - 1, rest⟩ + else ⟨0, shv ((v + 2) / 3 + 1), b, rest⟩ + | C, L => ⟨0, C, 0, L⟩ +def mstep (S : AS) : AS := + match linc (S.k + 1 + S.m) S.L with + | (0, L') => absStep S.C L' + | (p + 1, L') => ⟨(cph S.C).1, (cph S.C).2, p, L'⟩ +def tape (S : AS) : Cfg := hc (pw Rr S.k ++ ctape S.C) (pw Lu S.m ++ lad S.L) +theorem shl_eq (n : Nat) (hn : n ≠ 0) : + [false] ++ Sr (dig n) = Sr (shl n).1 ++ [true] ++ Sr (dig (shl n).2) := by + induction n using Nat.strongRecOn with + | _ n ih => + rw [dig_pos n hn, shl] + simp only [hn, dite_false] + by_cases h0 : n % 3 = 0 + · simp only [h0, if_true] + have hn3 : n / 3 ≠ 0 := by omega + have := ih (n / 3) (by omega) hn3 + simp only [Sr_cons, dg, rdig] at this ⊢ + simp only [List.cons_append, List.nil_append] at this ⊢ + rw [<- this] + · by_cases h1 : n % 3 = 1 + · simp [h0, h1, dg, rdig, Sr_cons] + · have h2 : n % 3 = 2 := by omega + simp [h0, h1, h2, dg, rdig, Sr_cons] +theorem sh_tape (n : Nat) : trim ([false] ++ Sr (dig n)) = trim (ctape (shv n)) := by + by_cases hn : n = 0 + · subst hn; simp [shv, ctape, dig_zero, cons'] + · simp only [shv, hn, if_false, ctape]; rw [shl_eq n hn] +end M8.R3 +namespace M8.R3 +open List +def Adv (c d : Cfg) : Prop := ∃ n, 0 < n /\ PE (run n c) d +theorem Adv.trans {c d e : Cfg} (h1 : Adv c d) (h2 : Adv d e) : Adv c e := by + obtain ⟨a, ha, e1⟩ := h1 + obtain ⟨b, hb, e2⟩ := h2 + exact ⟨a + b, by omega, by rw [run_add]; exact (PE_run b e1).trans e2⟩ +theorem Adv_run {n : Nat} {c d : Cfg} (h : run n c = d) (hn : 0 < n) : Adv c d := + ⟨n, hn, h ▸ PE.refl _⟩ +theorem Adv.pe_left {c c' d : Cfg} (h : PE c c') (h2 : Adv c' d) : Adv c d := by + obtain ⟨n, hn, e⟩ := h2 + exact ⟨n, hn, (PE_run n h).trans e⟩ +theorem Adv.pe_right {c d d' : Cfg} (h2 : Adv c d) (h : PE d d') : Adv c d' := by + obtain ⟨n, hn, e⟩ := h2 + exact ⟨n, hn, e.trans h⟩ +theorem PE_dc {L L' : List Bool} (h : trim L = trim L') (R : List Bool) : PE (dc L R) (dc L' R) := by + refine ⟨rfl, ?_, ?_, rfl⟩ + · show L.headD false = L'.headD false + rw [<- trim_headD, h, trim_headD] + · show trim L.tail = trim L'.tail + rw [trim_tail, h, trim_tail] +theorem PE_hc {P P' : List Bool} (h : trim P = trim P') (R : List Bool) : PE (hc P R) (hc P' R) := by + refine ⟨rfl, rfl, ?_, rfl⟩ + show trim (true :: P) = trim (true :: P') + simp [h] +theorem PE_hcR (P : List Bool) {R R' : List Bool} (h : trim R = trim R') : PE (hc P R) (hc P R') := by + refine ⟨rfl, rfl, rfl, ?_⟩ + show trim ([true, true] ++ R) = trim ([true, true] ++ R') + exact trim_append_congr _ h +theorem PE_dc_R {S R R' : List Bool} (h : R = R') : PE (dc S R) (dc S R') := h ▸ PE.refl _ +theorem trim_zpad (l : List Bool) (ds : List Dg) (n : Nat) : + trim (l ++ Sr (ds ++ List.replicate n .z)) = trim (l ++ Sr ds) := by + rw [Sr_append, <- List.append_assoc, trim_append_blank] + intro x hx + simp [Sr, rdig, List.mem_flatMap, List.mem_replicate] at hx + exact hx.2 +def tl (bs : List Nat) : List (Bool × Nat) := bs.map (fun b => (true, b)) +theorem lad_tl (bs : List Nat) (M : List (Bool × Nat)) : lad (tl bs ++ M) = rtt bs (lad M) := by + induction bs with + | nil => rfl + | cons b bs ih => simp [tl, lad, rtt] at ih ⊢; rw [ih] +theorem rtt_app (bs : List Nat) (R Y : List Bool) : rtt bs R ++ Y = rtt bs (R ++ Y) := by + induction bs with + | nil => rfl + | cons b bs ih => simp [rtt, ih] +def lincT : List Nat -> List (Bool × Nat) + | [] => [] + | [b] => [(false, b + 2)] + | b :: b' :: bs => (false, b) :: lincT (b' :: bs) +theorem linc_split (bs : List Nat) (hb : ∀ b ∈ bs, 2 ≤ b) (c : Nat) (r : List (Bool × Nat)) (B : Nat) : + linc B (tl bs ++ (false, c) :: r) = (if bs = [] then B else B - 2, lincT bs ++ (true, c) :: r) := by + induction bs generalizing B with + | nil => rfl + | cons b bs ih => + have ih' := ih (fun x hx => hb x (by simp [hx])) b + have hb0 := hb b (by simp) + simp only [tl, List.map_cons, List.cons_append] at ih' ⊢ + rw [linc, ih'] + cases bs with + | nil => simp [lincT] + | cons b' bs => simp [lincT]; omega +theorem lad_lincT (bs : List Nat) (hbs : bs ≠ []) (M : List (Bool × Nat)) : + lad (lincT bs ++ M) = E bs ++ pw Lu 2 ++ lad M := by + induction bs with + | nil => exact absurd rfl hbs + | cons b bs ih => + cases bs with + | nil => + simp only [lincT, List.cons_append, List.nil_append, lad, E, if_false] + rw [pw_add]; simp [List.append_assoc] + | cons b' bs => + have := ih (by simp) + simp only [lincT, List.cons_append, lad, if_false] at this ⊢ + rw [this]; simp [E, List.append_assoc] +theorem linc_tl (bs : List Nat) (hb : ∀ b ∈ bs, 2 ≤ b) (B : Nat) : + linc B (tl bs) = (B - 2, bs.map (fun b => (false, b)) ++ [(false, 2)]) := by + induction bs generalizing B with + | nil => rfl + | cons b bs ih => + have ih' := ih (fun x hx => hb x (by simp [hx])) b + have hb0 := hb b (by simp) + simp only [tl, List.map_cons] at ih' ⊢ + rw [linc, ih'] + simp; omega +theorem lad_fl (bs : List Nat) (M : List (Bool × Nat)) : + lad (bs.map (fun b => (false, b)) ++ M) = E bs ++ lad M := by + induction bs with + | nil => rfl + | cons b bs ih => simp [lad, E, ih, List.append_assoc] +theorem lad_decomp (L : List (Bool × Nat)) : + (∃ bs c r, L = tl bs ++ (false, c) :: r) \/ ∃ bs, L = tl bs := by + induction L with + | nil => exact Or.inr ⟨[], rfl⟩ + | cons x r ih => + obtain ⟨s, b⟩ := x + cases s with + | false => exact Or.inl ⟨[], b, r, rfl⟩ + | true => + rcases ih with ⟨bs, c, r', rfl⟩ | ⟨bs, rfl⟩ + · exact Or.inl ⟨b :: bs, c, r', rfl⟩ + · exact Or.inr ⟨b :: bs, rfl⟩ +theorem lphase (k m : Nat) (hkm : 1 ≤ k + m) (S : List Bool) (L : List (Bool × Nat)) + (hL : ∀ x ∈ L, 2 ≤ x.2) : + Adv (hc (pw Rr k ++ S) (pw Lu m ++ lad L)) + (dc S (pw Lu (linc (k + 1 + m) L).1 ++ lad (linc (k + 1 + m) L).2)) := by + obtain ⟨n, hn⟩ : ∃ n, m + k = n + 1 := ⟨k + m - 1, by omega⟩ + rcases lad_decomp L with ⟨bs, c, r, rfl⟩ | ⟨bs, rfl⟩ + · have hb2 : ∀ b ∈ bs, 2 ≤ b := fun b hb => hL (true, b) (by simp [tl, hb]) + have hb1 : ∀ b ∈ bs, 1 ≤ b := fun b hb => by have := hb2 b hb; omega + have eL : lad (tl bs ++ (false, c) :: r) = rtt bs ([false, false] ++ (pw Lu c ++ lad r)) := by + rw [lad_tl]; simp [lad] + rw [eL, linc_split bs hb2] + have s1 := start bs hb1 k m n hn S ([false, false] ++ (pw Lu c ++ lad r)) + have s2 := turn (Rr ++ Q bs (pw Rr n ++ S)) (pw Lu c ++ lad r) + have s3 := lunit (Q bs (pw Rr n ++ S)) (Lu ++ [true, false] ++ (pw Lu c ++ lad r)) + have s4 := lqp bs hb1 (pw Rr n ++ S) (Lu ++ (Lu ++ [true, false] ++ (pw Lu c ++ lad r))) + have s5 := lsweep n S (E bs ++ (Lu ++ (Lu ++ [true, false] ++ (pw Lu c ++ lad r)))) + refine Adv_run (run_trans s1 (run_trans s2 (run_trans s3 (run_trans s4 s5)))) (by omega) |>.pe_right ?_ + refine PE_dc_R ?_ + by_cases hbs : bs = [] + · subst hbs + simp only [if_true, E, List.nil_append, lincT] + rw [show k + 1 + m = n + 2 by omega, pw_add] + simp [lad, List.append_assoc] + · simp only [hbs, if_false, lad_lincT bs hbs] + rw [show k + 1 + m - 2 = n by omega] + simp [lad, List.append_assoc] + · have hb2 : ∀ b ∈ bs, 2 ≤ b := fun b hb => hL (true, b) (by simp [tl, hb]) + have hb1 : ∀ b ∈ bs, 1 ≤ b := fun b hb => by have := hb2 b hb; omega + rw [linc_tl bs hb2, lad_fl] + have ep : PE (hc (pw Rr k ++ S) (pw Lu m ++ lad (tl bs))) + (hc (pw Rr k ++ S) (pw Lu m ++ rtt bs ([true, false] ++ false :: [false]))) := by + apply PE_hcR + rw [show lad (tl bs) = rtt bs [true, false] by simpa [lad] using lad_tl bs []] + rw [show [true, false] ++ false :: [false] = [true, false] ++ [false, false] from rfl, <- rtt_app, + <- List.append_assoc] + exact (trim_append_blank _ [false, false] (by simp)).symm + refine Adv.pe_left ep ?_ + have s1 := start bs hb1 k m n hn S ([true, false] ++ false :: [false]) + have s2 := pass (Q bs (pw Rr n ++ S)) [false] + have s3 : run 24 (hc (Mr ++ Q bs (pw Rr n ++ S)) (false :: [false])) + = dc (Mr ++ Q bs (pw Rr n ++ S)) (Lu ++ [true, false] ++ []) := turn _ [] + have s4 := lmark (Q bs (pw Rr n ++ S)) (Lu ++ [true, false] ++ []) + have s5 := lqp bs hb1 (pw Rr n ++ S) ([false, false] ++ Lu ++ (Lu ++ [true, false] ++ [])) + have s6 := lsweep n S (E bs ++ ([false, false] ++ Lu ++ (Lu ++ [true, false] ++ []))) + refine Adv_run (run_trans s1 (run_trans s2 (run_trans s3 (run_trans s4 (run_trans s5 s6))))) + (by omega) |>.pe_right ?_ + rw [show k + 1 + m - 2 = n by omega] + apply PE_dc_R + simp [lad, pw_add, List.append_assoc] +theorem lowOk_app_z (l : List Dg) : lowOk (l ++ [.z]) = true := by + induction l with + | nil => rfl + | cons d r ih => cases d <;> simp [lowOk, ih] +theorem inc_app (l X : List Dg) (h : lowOk l = true) : inc (l ++ X) = inc l ++ X := by + induction l with + | nil => simp [lowOk] at h + | cons d r ih => + cases d with + | z => rfl + | o => rfl + | t => simp only [lowOk] at h; simp [inc, ih h] +theorem inc_ne_nil (l : List Dg) : inc l ≠ [] := by + cases l with + | nil => simp [inc] + | cons d r => cases d <;> simp [inc] +theorem val_rep_z (n : Nat) : val (List.replicate n Dg.z) = 0 := by + induction n with + | zero => rfl + | succ n ih => rw [List.replicate_succ, val_cons, ih]; rfl +theorem lowOk_false_rep (lo : List Dg) (h : lowOk lo = false) : lo = List.replicate lo.length .t := by + induction lo with + | nil => rfl + | cons d r ih => + cases d with + | z => simp [lowOk] at h + | o => simp [lowOk] at h + | t => simp only [lowOk] at h; simp [List.replicate_succ]; exact ih h +theorem val_inc2pad (v : Nat) : + ∃ d0 r, inc (inc (dig v ++ [.z, .z, .z])) = d0 :: r /\ lowOk r = true /\ dv d0 + 3 * val r = v + 2 /\ + lowOk (dig v ++ [.z, .z, .z]) = true /\ lowOk (inc (dig v ++ [.z, .z, .z])) = true := by + have e1 : inc (dig v ++ [.z, .z, .z]) = inc (dig v ++ [.z]) ++ [.z, .z] := by + rw [show dig v ++ [.z, .z, .z] = (dig v ++ [.z]) ++ [.z, .z] by simp, inc_app _ _ (lowOk_app_z _)] + have e2 : inc (inc (dig v ++ [.z]) ++ [.z, .z]) = inc (inc (dig v ++ [.z]) ++ [.z]) ++ [.z] := by + rw [show inc (dig v ++ [.z]) ++ [.z, .z] = (inc (dig v ++ [.z]) ++ [.z]) ++ [.z] by simp, + inc_app _ _ (lowOk_app_z _)] + obtain ⟨d0, l2, hl2⟩ : ∃ d0 l2, inc (inc (dig v ++ [.z]) ++ [.z]) = d0 :: l2 := by + cases h : inc (inc (dig v ++ [.z]) ++ [.z]) with + | nil => exact absurd h (inc_ne_nil _) + | cons d l => exact ⟨d, l, rfl⟩ + refine ⟨d0, l2 ++ [.z], ?_, lowOk_app_z _, ?_, ?_, ?_⟩ + · rw [e1, e2, hl2]; rfl + · have hv : val (inc (inc (dig v ++ [.z, .z, .z]))) = v + 2 := by + rw [val_inc, val_inc, val_append, val_dig]; simp [val] + rw [e1, e2, hl2] at hv + rw [<- val_cons]; simpa [val_append, val] using hv + · rw [show dig v ++ [.z, .z, .z] = (dig v ++ [.z, .z]) ++ [.z] by simp]; exact lowOk_app_z _ + · rw [e1, show inc (dig v ++ [.z]) ++ [.z, .z] = (inc (dig v ++ [.z]) ++ [.z]) ++ [.z] by simp] + exact lowOk_app_z _ +theorem cphase (C : CF) (p : Nat) (R : List Bool) : + Adv (dc (ctape C) (pw Lu (p + 1) ++ R)) (hc (pw Rr (cph C).1 ++ ctape (cph C).2) (pw Lu p ++ R)) := by + have eR : pw Lu (p + 1) ++ R = Lu ++ (pw Lu p ++ R) := by simp [List.append_assoc] + rw [eR] + cases C with + | cl v => + have hok := lowOk_app_z (dig v) + have e0 : PE (dc (Sr (dig v)) (Lu ++ (pw Lu p ++ R))) (dc (Sr (dig v ++ [.z]) ++ []) (Lu ++ (pw Lu p ++ R))) := by + apply PE_dc; simpa using (trim_zpad [] (dig v) 1).symm + refine Adv.pe_left e0 ?_ + have s1 := cnt _ hok [] (Lu ++ (pw Lu p ++ R)) + have s2 := restart (Sr (inc (dig v ++ [.z])) ++ []) (pw Lu p ++ R) + refine Adv_run (run_trans s1 s2) (by omega) |>.pe_right ?_ + apply PE_hc + simp only [cph, ctape, pw_zero, List.nil_append, List.append_nil] + apply trim_Sr_val + rw [val_inc, val_append, val_dig, val_dig]; simp [val] + | lone lo hv => + by_cases hok : lowOk lo = true + · have s1 := cnt lo hok ([true] ++ Sr (dig hv)) (Lu ++ (pw Lu p ++ R)) + have s2 := restart (Sr (inc lo) ++ ([true] ++ Sr (dig hv))) (pw Lu p ++ R) + refine Adv_run ?_ (show 0 < (6 * tz lo + 5) + 1 by omega) + simp only [cph, hok, if_true, ctape, pw_zero, List.nil_append, List.append_assoc] + exact run_trans s1 s2 + · have hok' : lowOk lo = false := by simpa using hok + by_cases hlo : lo = [] + · subst hlo + have h1 : lowOk (dig hv ++ [.z, .z]) = true := by + rw [show dig hv ++ [.z, .z] = (dig hv ++ [.z]) ++ [.z] by simp]; exact lowOk_app_z _ + have h2 : lowOk (inc (dig hv ++ [.z, .z])) = true := by + rw [show dig hv ++ [.z, .z] = (dig hv ++ [.z]) ++ [.z] by simp, inc_app _ _ (lowOk_app_z _)] + exact lowOk_app_z _ + have e0 : PE (dc (ctape (.lone [] hv)) (Lu ++ (pw Lu p ++ R))) + (dc ([true] ++ Sr (dig hv ++ [.z, .z]) ++ []) (Lu ++ (pw Lu p ++ R))) := by + apply PE_dc; simp only [ctape, Sr_nil, List.nil_append, List.append_nil] + exact (trim_zpad [true] (dig hv) 2).symm + refine Adv.pe_left e0 ?_ + have s := realign0 _ h1 h2 [] (pw Lu p ++ R) + refine Adv_run s (by omega) |>.pe_right ?_ + apply PE_hc + have hc : cph (.lone [] hv) = (0, shv (hv + 2)) := by simp [cph, lowOk] + rw [hc]; simp only [pw_zero, List.nil_append, List.append_nil] + rw [<- sh_tape] + apply trim_append_congr + apply trim_Sr_val + rw [val_inc, val_inc, val_append, val_dig, val_dig]; simp [val] + · obtain ⟨n, hn⟩ : ∃ n, lo.length = n + 1 := ⟨lo.length - 1, by + cases lo with + | nil => exact absurd rfl hlo + | cons _ _ => simp⟩ + have hrep := lowOk_false_rep lo hok' + rw [hn] at hrep + have h1 := lowOk_app_z (dig hv) + have e0 : PE (dc (ctape (.lone lo hv)) (Lu ++ (pw Lu p ++ R))) + (dc (Sr (List.replicate (n + 1) Dg.t) ++ [true] ++ Sr (dig hv ++ [.z]) ++ []) (Lu ++ (pw Lu p ++ R))) := by + apply PE_dc; simp only [ctape, List.append_nil]; rw [<- hrep] + have := trim_zpad (Sr lo ++ [true]) (dig hv) 1 + simp only [List.replicate] at this; exact this.symm + refine Adv.pe_left e0 ?_ + have s := realign n _ h1 [] (pw Lu p ++ R) + refine Adv_run s (by omega) |>.pe_right ?_ + apply PE_hc + have hc : cph (.lone lo hv) = (1, .cl (3 ^ n * (hv + 1))) := by simp [cph, hok', hlo, hn] + rw [hc]; simp only [pw_succ, pw_zero, List.append_nil, ctape] + rw [List.append_assoc] + apply trim_append_congr + rw [<- Sr_append] + apply trim_Sr_val + rw [val_append, val_rep_z, val_inc, val_append, val_dig, val_dig, List.length_replicate] + simp [val] +theorem aphase (v b : Nat) (hb : 1 ≤ b) (rest : List (Bool × Nat)) : + Adv (dc (ctape (.cl v)) (pw Lu 0 ++ lad ((false, b) :: rest))) + (tape (absStep (.cl v) ((false, b) :: rest))) := by + obtain ⟨d0, r, hr, hok, hval, h1, h2⟩ := val_inc2pad v + have eY : pw Lu 0 ++ lad ((false, b) :: rest) = [false, false] ++ (pw Lu b ++ lad rest) := by + simp [lad] + rw [eY] + have e0 : PE (dc (ctape (.cl v)) ([false, false] ++ (pw Lu b ++ lad rest))) + (dc (Sr (dig v ++ [.z, .z, .z]) ++ []) ([false, false] ++ (pw Lu b ++ lad rest))) := by + apply PE_dc; simpa [ctape] using (trim_zpad [] (dig v) 3).symm + refine Adv.pe_left e0 ?_ + have s1 := cnt _ h1 [] ([false, false] ++ (pw Lu b ++ lad rest)) + have s2 := absHead (Sr (inc (dig v ++ [.z, .z, .z])) ++ []) (pw Lu b ++ lad rest) + have s3 := cnt _ h2 [] ([true, false] ++ (pw Lu b ++ lad rest)) + rw [hr] at s3 + have hd : dv d0 ≤ 2 := by cases d0 <;> simp [dv] + have hq : (v + 2) / 3 = val r := by omega + cases d0 with + | z => + have s4 := absGenZ r b hb [] (lad rest) + rw [show [true, false] ++ pw Lu b ++ lad rest = [true, false] ++ (pw Lu b ++ lad rest) from + List.append_assoc _ _ _] at s4 + have hm : (v + 2) % 3 = 0 := by simp [dv] at hval; omega + refine Adv_run (run_trans s1 (run_trans s2 (run_trans s3 s4))) (by omega) |>.pe_right ?_ + simp only [absStep, hm, if_true, tape, pw_succ, pw_zero, List.append_nil] + apply PE_hc + rw [hq, List.append_assoc] + apply trim_append_congr + rw [<- sh_tape]; exact trim_append_congr _ (trim_Sr_dig r) + | t => + have s4 := absGenT r b hb [] (lad rest) + rw [show [true, false] ++ pw Lu b ++ lad rest = [true, false] ++ (pw Lu b ++ lad rest) from + List.append_assoc _ _ _] at s4 + have hm : (v + 2) % 3 = 2 := by simp [dv] at hval; omega + refine Adv_run (run_trans s1 (run_trans s2 (run_trans s3 s4))) (by omega) |>.pe_right ?_ + simp only [absStep, hm, show (2:Nat) ≠ 0 by omega, if_false, if_true, tape, pw_succ, pw_zero, + List.append_nil, ctape] + apply PE_hc + rw [hq, List.append_assoc] + apply trim_append_congr + exact trim_append_congr _ (trim_Sr_dig r) + | o => + have s4 := absGenO r hok b hb [] (lad rest) + rw [show [true, false] ++ pw Lu b ++ lad rest = [true, false] ++ (pw Lu b ++ lad rest) from + List.append_assoc _ _ _] at s4 + have hm : (v + 2) % 3 = 1 := by simp [dv] at hval; omega + refine Adv_run (run_trans s1 (run_trans s2 (run_trans s3 s4))) (by omega) |>.pe_right ?_ + simp only [absStep, hm, show (1:Nat) ≠ 0 by omega, show (1:Nat) ≠ 2 by omega, if_false, tape, pw_zero, + List.nil_append, List.append_nil] + apply PE_hc + rw [hq, <- sh_tape] + apply trim_append_congr + apply trim_Sr_val + rw [val_inc, val_dig] +def okS (S : AS) : Prop := + 1 ≤ S.k + S.m /\ (∀ x ∈ S.L, 2 ≤ x.2) /\ + ((linc (S.k + 1 + S.m) S.L).1 = 0 -> (∃ v, S.C = .cl v) /\ + ∃ b rest, (linc (S.k + 1 + S.m) S.L).2 = (false, b) :: rest /\ 1 ≤ b) +theorem sim (S : AS) (h : okS S) : Adv (tape S) (tape (mstep S)) := by + obtain ⟨h1, h2, h3⟩ := h + have a1 := lphase S.k S.m h1 (ctape S.C) S.L h2 + show Adv (hc (pw Rr S.k ++ ctape S.C) (pw Lu S.m ++ lad S.L)) _ + unfold mstep + revert h3 a1 + generalize linc (S.k + 1 + S.m) S.L = q + obtain ⟨p, L'⟩ := q + intro h3 a1 + cases p with + | zero => + obtain ⟨⟨v, hv⟩, b, rest, hL, hb⟩ := h3 rfl + simp only at hL; subst hL + rw [hv] at a1 ⊢ + exact a1.trans (aphase v b hb rest) + | succ p => + exact a1.trans (cphase S.C p (lad L')) +end M8.R3 +namespace M8.R3 +open List +def Lam : Nat -> Nat -> List (Bool × Nat) + | 0, N => [(decide (N % 2 = 1), 2)] + | l + 1, N => (decide (N % 2 = 1), 2 ^ (l + 1) + 2 * ((N + 2) / 4)) :: Lam l (N / 2) +def Ol : Nat -> List (Bool × Nat) + | 0 => [] + | l + 1 => (true, 2 ^ (l + 1)) :: Ol l +theorem two_le_pow (l : Nat) : 2 ≤ 2 ^ (l + 1) := by + rw [Nat.pow_succ]; have := Nat.one_le_two_pow (n := l); omega +theorem linc_Lam (l N B : Nat) (hN : N + 1 < 2 ^ (l + 1)) (hB : 2 ≤ B) : + linc B (Lam l N) = (if N % 2 = 1 then B - 2 else B, Lam l (N + 1)) := by + induction l generalizing N B with + | zero => + have : N = 0 := by simp at hN; omega + subst this; rfl + | succ l ih => + have hP := two_le_pow l + have hpow : 2 ^ (l + 1 + 1) = 2 * 2 ^ (l + 1) := by rw [Nat.pow_succ]; omega + by_cases hp : N % 2 = 1 + · have ih' := ih (N / 2) (2 ^ (l + 1) + 2 * ((N + 2) / 4)) (by omega) (by omega) + simp only [Lam, hp, decide_true, linc, ih', if_true] + have e1 : (N + 1) / 2 = N / 2 + 1 := by omega + have e2 : decide ((N + 1) % 2 = 1) = false := by simp; omega + rw [e1, e2] + congr 3 + split <;> omega + · simp only [Lam, hp, decide_false, linc, if_false] + have e1 : (N + 1) / 2 = N / 2 := by omega + have e2 : decide ((N + 1) % 2 = 1) = true := by simp; omega + rw [e1, e2] + congr 3 + omega +theorem linc_Ol (l B : Nat) (hB : 2 ≤ B) : linc B (Ol l) = (B - 2, Lam l 0) := by + induction l generalizing B with + | zero => rfl + | succ l ih => + have hP := two_le_pow l + simp only [Ol, linc, ih (2 ^ (l + 1)) hP, Lam] + simp; omega +theorem Lam_top (l : Nat) : Lam l (2 ^ (l + 1) - 1) = Ol (l + 1) := by + induction l with + | zero => rfl + | succ l ih => + have hP := two_le_pow l + have hpow : 2 ^ (l + 1 + 1) = 2 * 2 ^ (l + 1) := by rw [Nat.pow_succ]; omega + have e1 : (2 ^ (l + 1 + 1) - 1) / 2 = 2 ^ (l + 1) - 1 := by omega + rw [Lam, e1, ih, Ol] + have e2 : decide ((2 ^ (l + 1 + 1) - 1) % 2 = 1) = true := by simp only [decide_eq_true_eq]; omega + rw [e2] + congr 2 + omega +theorem Lam_even (l a : Nat) : + Lam (l + 1) (2 * a) = (false, 2 ^ (l + 1) + 2 * ((a + 1) / 2)) :: Lam l a := by + simp only [Lam] + have e1 : 2 * a / 2 = a := by omega + have e2 : (2 * a + 2) / 4 = (a + 1) / 2 := by omega + rw [e1, e2]; simp +theorem Lam_blocks (l N : Nat) : ∀ x ∈ Lam l N, 2 ≤ x.2 := by + induction l generalizing N with + | zero => intro x hx; simp [Lam] at hx; subst hx; simp + | succ l ih => + intro x hx + simp only [Lam, List.mem_cons] at hx + rcases hx with rfl | hx + · have := two_le_pow l; simp; omega + · exact ih _ x hx +theorem Ol_blocks (l : Nat) : ∀ x ∈ Ol l, 2 ≤ x.2 := by + induction l with + | zero => intro x hx; simp [Ol] at hx + | succ l ih => + intro x hx + simp only [Ol, List.mem_cons] at hx + rcases hx with rfl | hx + · exact two_le_pow l + · exact ih x hx +def epL (l a i : Nat) : List (Bool × Nat) := + if a + i < 2 ^ (l + 1) then Lam l (a + i) else Lam (l + 1) (a + i - 2 ^ (l + 1)) +theorem epL_blocks (l a i : Nat) : ∀ x ∈ epL l a i, 2 ≤ x.2 := by + unfold epL; split + · exact Lam_blocks _ _ + · exact Lam_blocks _ _ +theorem linc_epL (l a i B : Nat) (ha : a < 2 ^ (l + 1)) (hi : i < 2 ^ (l + 1) + a + 1) (hB : 2 ≤ B) : + linc B (epL l a i) = (if (a + i) % 2 = 1 then B - 2 else B, epL l a (i + 1)) := by + have hP := two_le_pow l + have hpow : 2 ^ (l + 1 + 1) = 2 * 2 ^ (l + 1) := by rw [Nat.pow_succ]; omega + unfold epL + by_cases h1 : a + i + 1 < 2 ^ (l + 1) + · have c1 : a + i < 2 ^ (l + 1) := by omega + have c2 : a + (i + 1) < 2 ^ (l + 1) := by omega + rw [if_pos c1, if_pos c2, linc_Lam l _ B h1 hB, Nat.add_assoc] + · by_cases h2 : a + i < 2 ^ (l + 1) + · have e : a + i = 2 ^ (l + 1) - 1 := by omega + have c2 : ¬ a + (i + 1) < 2 ^ (l + 1) := by omega + have c3 : (a + i) % 2 = 1 := by omega + rw [if_pos h2, if_neg c2, e, Lam_top, linc_Ol _ B hB, <- e, if_pos c3] + have e4 : a + (i + 1) - 2 ^ (l + 1) = 0 := by omega + rw [e4] + · have c2 : ¬ a + (i + 1) < 2 ^ (l + 1) := by omega + have c3 : a + i - 2 ^ (l + 1) + 1 < 2 ^ (l + 1 + 1) := by omega + rw [if_neg h2, if_neg c2, linc_Lam (l + 1) _ B c3 hB] + have e : (a + i - 2 ^ (l + 1)) % 2 = (a + i) % 2 := by omega + have e4 : a + (i + 1) - 2 ^ (l + 1) = a + i - 2 ^ (l + 1) + 1 := by omega + rw [e, e4] +end M8.R3 +namespace M8.R3 +open List +theorem val_lt (ds : List Dg) : val ds < 3 ^ ds.length := by + induction ds with + | nil => simp [val] + | cons d r ih => + rw [val_cons, List.length_cons, Nat.pow_succ] + have : dv d ≤ 2 := by cases d <;> simp [dv] + omega +theorem lowOk_iff (ds : List Dg) : lowOk ds = true <-> val ds + 1 < 3 ^ ds.length := by + induction ds with + | nil => simp [lowOk, val] + | cons d r ih => + have hl := val_lt r + rw [val_cons, List.length_cons, Nat.pow_succ] + cases d with + | z => simp [lowOk, dv]; omega + | o => simp [lowOk, dv]; omega + | t => simp only [lowOk, dv]; rw [ih]; omega +theorem length_inc (ds : List Dg) (h : lowOk ds = true) : (inc ds).length = ds.length := by + induction ds with + | nil => simp [lowOk] at h + | cons d r ih => + cases d with + | z => rfl + | o => rfl + | t => simp only [lowOk] at h; simp [inc, ih h] +def Pend (C : CF) (j Vr : Nat) : Prop := + ∃ lo hv, C = .lone lo hv /\ lo ≠ [] /\ val lo + j = 3 ^ lo.length /\ Vr = 3 ^ (lo.length - 1) * (hv + 1) +def PendX (C : CF) (j Vr : Nat) : Prop := + Pend C j Vr \/ ∃ q j', C = .lone [] q /\ j = j' + 1 /\ Pend (shv (q + 2)) j' Vr +theorem Pend_pos {C : CF} {j Vr : Nat} (h : Pend C j Vr) : 1 ≤ j := by + obtain ⟨lo, hv, _, _, h1, _⟩ := h + have := val_lt lo; omega +theorem cph_pend2 {C : CF} {j Vr : Nat} (h : PendX C (j + 2) Vr) : + ∃ C', cph C = (0, C') /\ Pend C' (j + 1) Vr := by + rcases h with ⟨lo, hv, rfl, hne, h1, h2⟩ | ⟨q, j', rfl, hj, hp⟩ + · have hok : lowOk lo = true := by rw [lowOk_iff]; omega + refine ⟨.lone (inc lo) hv, by simp [cph, hok], inc lo, hv, rfl, inc_ne_nil lo, ?_, ?_⟩ + · rw [val_inc, length_inc lo hok]; omega + · rw [length_inc lo hok]; exact h2 + · have hj' : j' = j + 1 := by omega + subst hj' + exact ⟨shv (q + 2), by simp [cph, lowOk], hp⟩ +theorem cph_pend1 {C : CF} {Vr : Nat} (h : PendX C 1 Vr) : cph C = (1, .cl Vr) := by + rcases h with ⟨lo, hv, rfl, hne, h1, h2⟩ | ⟨q, j', rfl, hj, hp⟩ + · have hok : lowOk lo = false := by + cases h : lowOk lo with + | false => rfl + | true => rw [lowOk_iff] at h; omega + simp [cph, hok, hne, h2] + · have : j' = 0 := by omega + subst this + have := Pend_pos hp; omega +theorem cph_k (C : CF) : (cph C).1 ≤ 1 := by + cases C with + | cl v => simp [cph] + | lone lo hv => + simp only [cph] + by_cases h1 : lowOk lo = true + · simp [h1] + · by_cases h2 : lo = [] + · subst h2; simp [lowOk] + · simp [h1, h2] +theorem shv_ne (n : Nat) (hn : n ≠ 0) : shv n = .lone (shl n).1 (shl n).2 := by simp [shv, hn] +theorem shl_pos (n : Nat) (hn : n ≠ 0) : + shl n = if n % 3 = 0 then (.z :: (shl (n / 3)).1, (shl (n / 3)).2) + else if n % 3 = 1 then ([.t], n / 3) else ([.z], n / 3) := by + rw [shl]; simp [hn] +theorem shv_pend (n : Nat) (hn : 1 ≤ n) : + ∃ j Vr, Pend (shv n) j Vr /\ 2 * j ≤ 3 * n /\ 3 * Vr ≤ 3 * j + n := by + induction n using Nat.strongRecOn with + | _ n ih => + rw [shv_ne n (by omega), shl_pos n (by omega)] + by_cases h0 : n % 3 = 0 + · rw [if_pos h0] + obtain ⟨j', Vr', ⟨lo', hv', hc, hne, h1, h2⟩, b1, b2⟩ := ih (n / 3) (by omega) (by omega) + rw [shv_ne _ (by omega)] at hc + injection hc with e1 e2 + rw [e1, e2] + obtain ⟨t, ht⟩ : ∃ t, lo'.length = t + 1 := ⟨lo'.length - 1, by + cases lo' with + | nil => exact absurd rfl hne + | cons _ _ => simp⟩ + refine ⟨3 * j', 3 * Vr', ⟨.z :: lo', hv', rfl, by simp, ?_, ?_⟩, by omega, by omega⟩ + · rw [val_cons, List.length_cons, Nat.pow_succ]; simp [dv]; omega + · rw [h2, List.length_cons, ht, Nat.add_sub_cancel, Nat.add_sub_cancel, Nat.pow_succ, + Nat.mul_comm (3 ^ t) 3, Nat.mul_assoc] + · rw [if_neg h0] + by_cases h1 : n % 3 = 1 + · rw [if_pos h1] + refine ⟨1, n / 3 + 1, ⟨[.t], n / 3, rfl, by simp, by simp [val], by simp⟩, by omega, by omega⟩ + · rw [if_neg h1] + refine ⟨3, n / 3 + 1, ⟨[.z], n / 3, rfl, by simp, by simp [val], by simp⟩, by omega, by omega⟩ +def preL (l a : Nat) : List (Bool × Nat) := if a = 0 then Ol (l + 1) else Lam (l + 1) (2 * a - 1) +def EE (l a : Nat) : Nat := 2 ^ (l + 1) + a + 1 +def PreInv (S : AS) : Prop := + ∃ l a v, a < 2 ^ (l + 1) /\ S.C = .cl v /\ S.k + S.m = 1 /\ S.k ≤ 1 /\ S.L = preL l a /\ + 1 ≤ v /\ 5 * v ≤ 6 * EE l a /\ 15 ≤ EE l a +def EpInv (l a R Vr i : Nat) (S : AS) : Prop := + S.L = epL l a i /\ S.k ≤ 1 /\ + ((i < R /\ S.k + 1 + S.m = EE l a - i + (a + i) % 2 /\ PendX S.C (R - i) Vr) \/ + (R ≤ i /\ S.k + 1 + S.m = EE l a - i + 1 + (a + i) % 2 /\ S.C = .cl (Vr + i - R))) +theorem epoch_step (l a R Vr i : Nat) (S : AS) (ha : a < 2 ^ (l + 1)) (hR : R + 1 ≤ EE l a) + (hi : i < EE l a) (h : EpInv l a R Vr i S) : + okS S /\ EpInv l a R Vr (i + 1) (mstep S) := by + obtain ⟨hL, hk, hc⟩ := h + have hP := two_le_pow l + unfold EE at hR hi + have hB : 2 ≤ S.k + 1 + S.m := by rcases hc with ⟨h1, h2, _⟩ | ⟨h1, h2, _⟩ <;> unfold EE at h2 <;> omega + have hlinc := linc_epL l a i (S.k + 1 + S.m) ha (by omega) hB + rw [<- hL] at hlinc + have hp : 1 ≤ (if (a + i) % 2 = 1 then S.k + 1 + S.m - 2 else S.k + 1 + S.m) := by + rcases hc with ⟨h1, h2, _⟩ | ⟨h1, h2, _⟩ <;> unfold EE at h2 <;> split <;> omega + refine ⟨⟨by omega, hL ▸ epL_blocks l a i, fun h0 => by rw [hlinc] at h0; simp only at h0; omega⟩, ?_⟩ + obtain ⟨p, hpe⟩ : ∃ p, (if (a + i) % 2 = 1 then S.k + 1 + S.m - 2 else S.k + 1 + S.m) = p + 1 := + ⟨_, (Nat.sub_add_cancel hp).symm⟩ + have hms : mstep S = ⟨(cph S.C).1, (cph S.C).2, p, epL l a (i + 1)⟩ := by + unfold mstep; rw [hlinc, hpe] + rw [hms] + refine ⟨rfl, cph_k _, ?_⟩ + simp only + have hpar : (a + (i + 1)) % 2 = 1 - (a + i) % 2 := by omega + rcases hc with ⟨h1, h2, h3⟩ | ⟨h1, h2, h3⟩ + · by_cases hlast : i + 1 < R + · obtain ⟨C', e, hC'⟩ := cph_pend2 (j := R - i - 2) (by rw [show R - i - 2 + 2 = R - i by omega]; exact h3) + rw [e] + refine Or.inl ⟨hlast, ?_, Or.inl (by rw [show R - (i + 1) = R - i - 2 + 1 by omega]; exact hC')⟩ + simp only; unfold EE at h2 ⊢; split at hpe <;> omega + · have hR1 : R - i = 1 := by omega + rw [hR1] at h3 + rw [cph_pend1 h3] + refine Or.inr ⟨by omega, ?_, by simp only; congr 1; omega⟩ + simp only; unfold EE at h2 ⊢; split at hpe <;> omega + · rw [h3] + refine Or.inr ⟨by omega, ?_, by simp only [cph]; congr 1; omega⟩ + simp only [cph]; unfold EE at h2 ⊢; split at hpe <;> omega +end M8.R3 +namespace M8.R3 +open List +theorem epL_zero (l a : Nat) (ha : a < 2 ^ (l + 1)) : epL l a 0 = Lam l a := by + unfold epL; rw [if_pos (by omega), Nat.add_zero] +theorem preL_blocks (l a : Nat) : ∀ x ∈ preL l a, 2 ≤ x.2 := by + unfold preL; split + · exact Ol_blocks _ + · exact Lam_blocks _ _ +theorem linc_preL (l a : Nat) (ha : a < 2 ^ (l + 1)) : + linc 2 (preL l a) = (0, (false, 2 ^ (l + 1) + 2 * ((a + 1) / 2)) :: Lam l a) := by + have hpow : 2 ^ (l + 1 + 1) = 2 * 2 ^ (l + 1) := by rw [Nat.pow_succ]; omega + rw [<- Lam_even] + unfold preL + split + · subst_vars; rw [linc_Ol _ 2 (by omega)] + · rw [linc_Lam (l + 1) (2 * a - 1) 2 (by omega) (by omega), if_pos (by omega)] + congr 2; omega +theorem epoch_start (S : AS) (h : PreInv S) : + ∃ l a R Vr, a < 2 ^ (l + 1) /\ okS S /\ EpInv l a R Vr 0 (mstep S) /\ R + 1 ≤ EE l a /\ + 5 * (Vr + EE l a - R) ≤ 6 * (EE l a + 1) /\ 15 ≤ EE l a := by + obtain ⟨l, a, v, ha, hC, hkm, hk, hL, hv1, hv2, hE⟩ := h + have hP := two_le_pow l + have hB : S.k + 1 + S.m = 2 := by omega + have hl : linc (S.k + 1 + S.m) S.L = (0, (false, 2 ^ (l + 1) + 2 * ((a + 1) / 2)) :: Lam l a) := by + rw [hB, hL]; exact linc_preL l a ha + have hok : okS S := ⟨by omega, hL ▸ preL_blocks l a, fun _ => ⟨⟨v, hC⟩, _, _, by rw [hl], by omega⟩⟩ + have hms : mstep S = absStep (.cl v) ((false, 2 ^ (l + 1) + 2 * ((a + 1) / 2)) :: Lam l a) := by + unfold mstep; rw [hl, hC] + rw [hms] + unfold EE at hv2 hE ⊢ + have hb : 2 ^ (l + 1) + 2 * ((a + 1) / 2) + 1 = 2 ^ (l + 1) + a + 1 + a % 2 := by omega + by_cases h0 : (v + 2) % 3 = 0 + · obtain ⟨j, Vr, hp, b1, b2⟩ := shv_pend ((v + 2) / 3) (by omega) + refine ⟨l, a, j, Vr, ha, hok, ⟨?_, ?_, Or.inl ⟨Pend_pos hp, ?_, Or.inl ?_⟩⟩, ?_, ?_, hE⟩ + · simp only [absStep, h0, if_true]; exact (epL_zero l a ha).symm + · simp only [absStep, h0, if_true]; omega + · simp only [absStep, h0, if_true]; (try unfold EE); omega + · simp only [absStep, h0, if_true, Nat.sub_zero]; exact hp + · (try unfold EE); omega + · (try unfold EE); omega + · by_cases h2 : (v + 2) % 3 = 2 + · obtain ⟨j, Vr, hp, b1, b2⟩ := shv_pend ((v + 2) / 3 + 2) (by omega) + have hne : (v + 2) % 3 ≠ 0 := h0 + have h20 : ¬ ((2 : Nat) = 0) := by decide + refine ⟨l, a, j + 1, Vr, ha, hok, ⟨?_, ?_, Or.inl ⟨by omega, ?_, Or.inr ?_⟩⟩, ?_, ?_, hE⟩ + · simp only [absStep, hne, h2, h20, if_false, if_true]; exact (epL_zero l a ha).symm + · simp only [absStep, hne, h2, h20, if_false, if_true]; omega + · simp only [absStep, hne, h2, h20, if_false, if_true]; (try unfold EE); omega + · simp only [absStep, hne, h2, h20, if_false, if_true, Nat.sub_zero] + exact ⟨_, j, rfl, rfl, hp⟩ + · (try unfold EE); omega + · (try unfold EE); omega + · have h1 : (v + 2) % 3 = 1 := by omega + obtain ⟨j, Vr, hp, b1, b2⟩ := shv_pend ((v + 2) / 3 + 1) (by omega) + have hne : (v + 2) % 3 ≠ 0 := h0 + refine ⟨l, a, j, Vr, ha, hok, ⟨?_, ?_, Or.inl ⟨Pend_pos hp, ?_, Or.inl ?_⟩⟩, ?_, ?_, hE⟩ + · simp only [absStep, hne, h2, if_false]; exact (epL_zero l a ha).symm + · simp only [absStep, hne, h2, if_false]; omega + · simp only [absStep, hne, h2, if_false]; (try unfold EE); omega + · simp only [absStep, hne, h2, if_false, Nat.sub_zero]; exact hp + · (try unfold EE); omega + · (try unfold EE); omega +def itr : Nat -> AS -> AS + | 0, S => S + | n + 1, S => mstep (itr n S) +theorem epoch_iter (l a R Vr : Nat) (S0 : AS) (ha : a < 2 ^ (l + 1)) (hR : R + 1 ≤ EE l a) + (h0 : EpInv l a R Vr 0 S0) : + ∀ i, i ≤ EE l a -> EpInv l a R Vr i (itr i S0) /\ + (i = 0 \/ Adv (tape S0) (tape (itr i S0))) := by + intro i + induction i with + | zero => intro _; exact ⟨h0, Or.inl rfl⟩ + | succ i ih => + intro hi + obtain ⟨h1, h2⟩ := ih (by omega) + obtain ⟨hok, h3⟩ := epoch_step l a R Vr i _ ha hR (by omega) h1 + show EpInv l a R Vr (i + 1) (mstep (itr i S0)) /\ (i + 1 = 0 \/ Adv (tape S0) (tape (mstep (itr i S0)))) + refine ⟨h3, Or.inr ?_⟩ + rcases h2 with h2 | h2 + · subst h2; exact sim _ hok + · exact h2.trans (sim _ hok) +theorem epoch_end (l a R Vr : Nat) (S : AS) (ha : a < 2 ^ (l + 1)) (hR : R + 1 ≤ EE l a) + (hV : 5 * (Vr + EE l a - R) ≤ 6 * (EE l a + 1)) (hE : 15 ≤ EE l a) + (h : EpInv l a R Vr (EE l a) S) : PreInv S := by + obtain ⟨hL, hk, hc⟩ := h + have hP := two_le_pow l + have hpow : 2 ^ (l + 1 + 1) = 2 * 2 ^ (l + 1) := by rw [Nat.pow_succ]; omega + rcases hc with ⟨h1, _, _⟩ | ⟨h1, h2, h3⟩ + · omega + unfold EE at * + have hL' : S.L = Lam (l + 1) (2 * a + 1) := by + rw [hL]; unfold epL; rw [if_neg (by omega)]; congr 1; omega + by_cases hlast : a + 1 < 2 ^ (l + 1) + · refine ⟨l, a + 1, Vr + (2 ^ (l + 1) + a + 1) - R, hlast, h3, by omega, hk, ?_, by omega, ?_, ?_⟩ + · rw [hL']; unfold preL; rw [if_neg (by omega)]; congr 1 + · (try unfold EE); omega + · (try unfold EE); omega + · refine ⟨l + 1, 0, Vr + (2 ^ (l + 1) + a + 1) - R, by omega, h3, by omega, hk, ?_, by omega, ?_, ?_⟩ + · rw [hL']; unfold preL; rw [if_pos rfl, <- Lam_top]; congr 1; omega + · (try unfold EE); omega + · (try unfold EE); omega +theorem epoch (S : AS) (h : PreInv S) : ∃ S', PreInv S' /\ Adv (tape S) (tape S') := by + obtain ⟨l, a, R, Vr, ha, hok, h0, hR, hV, hE⟩ := epoch_start S h + obtain ⟨hEnd, hAdv⟩ := epoch_iter l a R Vr _ ha hR h0 (EE l a) (Nat.le_refl _) + refine ⟨_, epoch_end l a R Vr _ ha hR hV hE hEnd, ?_⟩ + have a0 := sim S hok + rcases hAdv with h1 | h1 + · unfold EE at h1; omega + · exact a0.trans h1 +theorem tape_st (S : AS) : (tape S).st = .B := rfl +theorem nonhalt_from (c : Cfg) (S : AS) (hS : PreInv S) (hc : PE c (tape S)) : + ∀ n, ¬ halted (run n c) := by + have key : ∀ t, ∃ n, t ≤ n /\ ∃ S, PreInv S /\ PE (run n c) (tape S) := by + intro t + induction t with + | zero => exact ⟨0, (Nat.le_refl _), S, hS, hc⟩ + | succ t ih => + obtain ⟨n, hn, S1, h1, h2⟩ := ih + obtain ⟨S2, h3, d, hd, h4⟩ := epoch S1 h1 + refine ⟨n + d, by omega, S2, h3, ?_⟩ + rw [run_add] + exact (PE_run d h2).trans h4 + intro n hn + obtain ⟨N, hN, S1, _, h2⟩ := key n + have e : run N c = run n c := by + rw [show N = n + (N - n) by omega, run_add] + exact run_H _ _ hn + have := h2.1 + rw [e, hn] at this + exact absurd this (by rw [tape_st]; decide) +end M8.R3 +namespace M8.R3 +set_option maxRecDepth 1000000 +def c0 : Cfg := ⟨.B, [true, false, false, true, false, false, true, false, true, true], true, [true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, true, false]⟩ +theorem run_zero (c : Cfg) : run 0 c = c := rfl +def ck_0 : Cfg := init +def ck_1 : Cfg := ⟨.D, [false, false, false, false, false, false, true, true], false, [true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_2 : Cfg := ⟨.A, [false, false, true, true, false, false, true, true, false, false, true, true, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, true, false, true, true], true, [false, true, true, false, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_3 : Cfg := ⟨.A, [false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, true, true, false, false, true, true], true, [false, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_4 : Cfg := ⟨.D, [false, false, false, false, true, true, false, false, false, false, false, true, true], false, [true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_5 : Cfg := ⟨.E, [true, true, false, false, true, true, false, false, true, true, false, false, true, false, true, true], false, [true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_6 : Cfg := ⟨.A, [false, false, false, false, true, true, false, false, true, true, false, false, false, false, true, true], false, [true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_7 : Cfg := ⟨.D, [false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, true, true, false, false, true, true, false, false, true, true, false, false, true, false, false, true], false, [false, true, true, true, true, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_8 : Cfg := ⟨.B, [true, false, false, false, true, true, false, false, true, true, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, false, false, true, true], true, [true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_9 : Cfg := ⟨.F, [true], true, [true, true, true, true, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_10 : Cfg := ⟨.A, [false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, true, true, true, false, true, true], false, [false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_11 : Cfg := ⟨.D, [false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, true, true, false, true, true], true, [false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_12 : Cfg := ⟨.C, [false, false, true, true, false, true, true], false, [true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_13 : Cfg := ⟨.A, [true, true, false, false, true, false, true, true], true, [true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_14 : Cfg := ⟨.A, [true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, false, false, false, false, false, true, true], true, [true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_15 : Cfg := ⟨.E, [true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, true, true, false, true, true, false, true, true, false, true, true], false, [true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_16 : Cfg := ⟨.A, [false, false, true, true, false, false, true, true, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true], false, [true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_17 : Cfg := ⟨.B, [true, false, false, false, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, false, false, false, true], false, [true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_18 : Cfg := ⟨.E, [true, true, false, false, true, true, false, false, true, true, false, false, true, true, true, true, false, false, true, true, false, false, true, true, false, true, true, false, false, false, false, true, true], false, [true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_19 : Cfg := ⟨.D, [false, true, true, false, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, true, true, false, false, false, true], false, [true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_20 : Cfg := ⟨.A, [false, false, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, false, true, true, true], false, [true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_21 : Cfg := ⟨.C, [false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, false, false, true, true], false, [true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_22 : Cfg := ⟨.D, [true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, true, true, false, true, true, false, false, true], true, [true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_23 : Cfg := ⟨.E, [true, true, false, false, true, false, false, true, true], false, [true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_24 : Cfg := ⟨.D, [false, false, false, false, false, false, false, true], false, [true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_25 : Cfg := ⟨.A, [false, false, false, false, true, true, false, false, true, true, false, false, true, true, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, false, false, false, false, false, true, true], true, [false, false, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_26 : Cfg := ⟨.B, [true, false, false, false, false, false, false, false, false, true, false, true, true], false, [true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_27 : Cfg := ⟨.A, [false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true], true, [false, true, true, false, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_28 : Cfg := ⟨.D, [false, false, false, false, true, true, false, false, true, true, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, false, true, true], false, [true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_29 : Cfg := ⟨.A, [true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, false, false, false, false, false, true, true], true, [true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_30 : Cfg := ⟨.A, [false, false, false, false, true, true, false, false, true, true, false, false, true, true, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true, false, true, true, false, true, true, false, true, true], true, [false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, true, false]⟩ +def ck_31 : Cfg := ⟨.B, [true, false, false, true, false, false, true, false, true, true], true, [true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, true, true, false, false, true, true, true, false, true, true, true, true, false]⟩ +theorem run_ck_0 : run 1500 ck_0 = ck_1 := by decide +kernel +theorem run_ck_1 : run 1500 ck_1 = ck_2 := by decide +kernel +theorem run_ck_2 : run 1500 ck_2 = ck_3 := by decide +kernel +theorem run_ck_3 : run 1500 ck_3 = ck_4 := by decide +kernel +theorem run_ck_4 : run 1500 ck_4 = ck_5 := by decide +kernel +theorem run_ck_5 : run 1500 ck_5 = ck_6 := by decide +kernel +theorem run_ck_6 : run 1500 ck_6 = ck_7 := by decide +kernel +theorem run_ck_7 : run 1500 ck_7 = ck_8 := by decide +kernel +theorem run_ck_8 : run 1500 ck_8 = ck_9 := by decide +kernel +theorem run_ck_9 : run 1500 ck_9 = ck_10 := by decide +kernel +theorem run_ck_10 : run 1500 ck_10 = ck_11 := by decide +kernel +theorem run_ck_11 : run 1500 ck_11 = ck_12 := by decide +kernel +theorem run_ck_12 : run 1500 ck_12 = ck_13 := by decide +kernel +theorem run_ck_13 : run 1500 ck_13 = ck_14 := by decide +kernel +theorem run_ck_14 : run 1500 ck_14 = ck_15 := by decide +kernel +theorem run_ck_15 : run 1500 ck_15 = ck_16 := by decide +kernel +theorem run_ck_16 : run 1500 ck_16 = ck_17 := by decide +kernel +theorem run_ck_17 : run 1500 ck_17 = ck_18 := by decide +kernel +theorem run_ck_18 : run 1500 ck_18 = ck_19 := by decide +kernel +theorem run_ck_19 : run 1500 ck_19 = ck_20 := by decide +kernel +theorem run_ck_20 : run 1500 ck_20 = ck_21 := by decide +kernel +theorem run_ck_21 : run 1500 ck_21 = ck_22 := by decide +kernel +theorem run_ck_22 : run 1500 ck_22 = ck_23 := by decide +kernel +theorem run_ck_23 : run 1500 ck_23 = ck_24 := by decide +kernel +theorem run_ck_24 : run 1500 ck_24 = ck_25 := by decide +kernel +theorem run_ck_25 : run 1500 ck_25 = ck_26 := by decide +kernel +theorem run_ck_26 : run 1500 ck_26 = ck_27 := by decide +kernel +theorem run_ck_27 : run 1500 ck_27 = ck_28 := by decide +kernel +theorem run_ck_28 : run 1500 ck_28 = ck_29 := by decide +kernel +theorem run_ck_29 : run 1500 ck_29 = ck_30 := by decide +kernel +theorem run_ck_30 : run 1083 ck_30 = ck_31 := by decide +kernel +theorem base_run : run 46083 init = c0 := by + change run 46083 ck_0 = ck_31 + rw [show 46083 = 1500 + 44583 from rfl, run_add, run_ck_0] + rw [show 44583 = 1500 + 43083 from rfl, run_add, run_ck_1] + rw [show 43083 = 1500 + 41583 from rfl, run_add, run_ck_2] + rw [show 41583 = 1500 + 40083 from rfl, run_add, run_ck_3] + rw [show 40083 = 1500 + 38583 from rfl, run_add, run_ck_4] + rw [show 38583 = 1500 + 37083 from rfl, run_add, run_ck_5] + rw [show 37083 = 1500 + 35583 from rfl, run_add, run_ck_6] + rw [show 35583 = 1500 + 34083 from rfl, run_add, run_ck_7] + rw [show 34083 = 1500 + 32583 from rfl, run_add, run_ck_8] + rw [show 32583 = 1500 + 31083 from rfl, run_add, run_ck_9] + rw [show 31083 = 1500 + 29583 from rfl, run_add, run_ck_10] + rw [show 29583 = 1500 + 28083 from rfl, run_add, run_ck_11] + rw [show 28083 = 1500 + 26583 from rfl, run_add, run_ck_12] + rw [show 26583 = 1500 + 25083 from rfl, run_add, run_ck_13] + rw [show 25083 = 1500 + 23583 from rfl, run_add, run_ck_14] + rw [show 23583 = 1500 + 22083 from rfl, run_add, run_ck_15] + rw [show 22083 = 1500 + 20583 from rfl, run_add, run_ck_16] + rw [show 20583 = 1500 + 19083 from rfl, run_add, run_ck_17] + rw [show 19083 = 1500 + 17583 from rfl, run_add, run_ck_18] + rw [show 17583 = 1500 + 16083 from rfl, run_add, run_ck_19] + rw [show 16083 = 1500 + 14583 from rfl, run_add, run_ck_20] + rw [show 14583 = 1500 + 13083 from rfl, run_add, run_ck_21] + rw [show 13083 = 1500 + 11583 from rfl, run_add, run_ck_22] + rw [show 11583 = 1500 + 10083 from rfl, run_add, run_ck_23] + rw [show 10083 = 1500 + 8583 from rfl, run_add, run_ck_24] + rw [show 8583 = 1500 + 7083 from rfl, run_add, run_ck_25] + rw [show 7083 = 1500 + 5583 from rfl, run_add, run_ck_26] + rw [show 5583 = 1500 + 4083 from rfl, run_add, run_ck_27] + rw [show 4083 = 1500 + 2583 from rfl, run_add, run_ck_28] + rw [show 2583 = 1500 + 1083 from rfl, run_add, run_ck_29] + exact run_ck_30 +def S0 : AS := ⟨0, .cl 17, 1, Ol 4⟩ +theorem dig17 : dig 17 = [.t, .t, .o] := by + rw [dig_pos 17 (by decide)] + rw [show 17 / 3 = 5 from rfl, dig_pos 5 (by decide), show 5 / 3 = 1 from rfl, dig_pos 1 (by decide), + show 1 / 3 = 0 from rfl, dig_zero] + rfl +theorem base_pe : PE c0 (tape S0) := by + unfold tape S0 ctape + simp only [dig17] + unfold PE + decide +kernel +theorem base_inv : PreInv S0 := + ⟨3, 0, 17, by decide, rfl, rfl, by decide, rfl, by decide, by decide, by decide⟩ +theorem nonhalt : ∀ n, ¬ halted (run n init) := by + intro n + have h := nonhalt_from (run 46083 init) S0 base_inv (base_run ▸ base_pe) + by_cases hn : 46083 ≤ n + · rw [show n = 46083 + (n - 46083) by omega, run_add]; exact h _ + · intro hh + have e : run 46083 init = run n init := by + rw [show 46083 = n + (46083 - n) by omega, run_add]; exact run_H _ _ hh + have h0 := h 0 + rw [run_zero, e] at h0 + exact h0 hh +end M8.R3 +variable {zG_ zL_ α β γ : Type*} [Inhabited zG_] [Inhabited zL_] +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +def b2fin (b : Bool) : Fin 2 := if b then 1 else 0 +def toSt : M8.St -> Option (Fin 6) + | .A => some 0 | .B => some 1 | .C => some 2 + | .D => some 3 | .E => some 4 | .F => some 5 + | .H => none +def toCfg (c : M8.Cfg) : Cfg (Fin 2) (Fin 6) := + ⟨toSt c.st, ⟨b2fin c.h, ListBlank.mk (c.L.map b2fin), ListBlank.mk (c.R.map b2fin)⟩⟩ +theorem step_toCfg (c : M8.Cfg) (hne : (M8.step c).st ≠ .H) : + step target_tm (toCfg c) = some (toCfg (M8.step c)) := by + rcases c with ⟨st, L, h, R⟩ + cases st <;> cases h + · cases R <;> rfl + · cases R <;> rfl + · cases L <;> rfl + · cases L <;> rfl + · cases R <;> rfl + · cases L <;> rfl + · cases L <;> rfl + · cases L <;> rfl + · cases L <;> rfl + · cases L <;> rfl + · exfalso; apply hne; rfl + · cases R <;> rfl + · exfalso; apply hne; rfl + · exfalso; apply hne; rfl +theorem multiStep_toCfg (n : Nat) : + multiStep target_tm (init []) n = some (toCfg (M8.run n M8.init)) := by + induction n with + | zero => + rfl + | succ n ih => + rw [multiStep, Function.iterate_succ', Function.comp_apply, <- multiStep, ih, Option.bind_some] + have hrun : M8.run (n + 1) M8.init = M8.step (M8.run n M8.init) := M8.run_add n 1 M8.init + have hne : (M8.step (M8.run n M8.init)).st ≠ .H := by + rw [<- hrun]; exact M8.R3.nonhalt (n + 1) + rw [hrun] + exact step_toCfg (M8.run n M8.init) hne + +end Solution + + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg ⟨n, hn⟩ + rw [multiStep_toCfg n, Option.some.injEq] at hn + subst hn + have hrun : M8.run (n + 1) M8.init = M8.step (M8.run n M8.init) := M8.run_add n 1 M8.init + have hne : (M8.step (M8.run n M8.init)).st ≠ .H := by + rw [<- hrun]; exact M8.R3.nonhalt (n + 1) + rw [step_toCfg (M8.run n M8.init) hne] + rfl + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RA_0LC0LA_1RF1LD_1LE0LD_1LC1LF_HHH1RA diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RA_0RC0LD_1LA1RF_1LE1LD_1LB1RE_HHH1RA.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RA_0RC0LD_1LA1RF_1LE1LD_1LB1RE_HHH1RA.lean new file mode 100644 index 00000000..f9ce0abd --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RA_0RC0LD_1LA1RF_1LE1LD_1LB1RE_HHH1RA.lean @@ -0,0 +1,49 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.SharedDonorsA + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RB0RA_0RC0LD_1LA1RF_1LE1LD_1LB1RE_HHH1RA + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_0RC0LD_1LA1RF_1LE1LD_1LB1RE_HHH1RA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +open BusyBeaver.Excursion +open M240 + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +theorem entry : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) [tm]⊢⁺ Beq 5 [] := by + have h23 : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) [tm]⊢^{23} Bev 0 [] 4 [] := by + unfold Bev; rw [encL_nil, encS_nil]; run_steps 23 + exact sp_trans (stepN_to_sp (by decide) h23) + (sp_trans (bev0_nil_bounce 0 []) (R12 0 [])) + +theorem is_does_not_halt : IsNotHalt target_tm := by + exact BusyBeaver.Excursion.does_not_halt_of_advances + (M240.sp_to_ss entry) + (M240.root_of_5 M240.validL_nil) + M240.root_advances + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RA_0RC0LD_1LA1RF_1LE1LD_1LB1RE_HHH1RA diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RA_0RC0LE_1LD1RF_1LB1RD_1LD1LE_HHH1RA.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RA_0RC0LE_1LD1RF_1LB1RD_1LD1LE_HHH1RA.lean new file mode 100644 index 00000000..ad2971a7 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RA_0RC0LE_1LD1RF_1LB1RD_1LD1LE_HHH1RA.lean @@ -0,0 +1,6660 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Basic +import BusyBeaver.Calculi.Counter +import BusyBeaver.Calculi.SegmentChain + +namespace BusyBeaver.M_1RB0RA_0RC0LE_1LD1RF_1LB1RD_1LD1LE_HHH1RA + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_0RC0LE_1LD1RF_1LB1RD_1LD1LE_HHH1RA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +section + +open Mathlib Relation Nat Turing BusyBeaver SixState BusyBeaver.SegmentChain + +set_option maxRecDepth 2000 + +private theorem if_pos {c : Prop} [Decidable c] (hc : c) {α : Sort*} {t e : α} : + (if c then t else e) = t := by + simp [hc] + +private theorem if_neg {c : Prop} [Decidable c] (hnc : ¬c) {α : Sort*} {t e : α} : + (if c then t else e) = e := by + simp [hnc] + +theorem target_eq : target = target_tm := by + funext q s + fin_cases q <;> fin_cases s <;> rfl + +namespace ChainClosure + +theorem dec_or (P : Prop) : P ∨ ¬ P := + Classical.em P + +-- ============================================================================ +-- Section 5g.1: Normalized Segment Representation & 1-Step Chain Equivalence +-- ============================================================================ + +structure SegState where + b : Bool + segs : List (Nat × Nat) + zl : Nat + cp1 : Nat + kb : Nat + mrg : Nat + ds : List Nat + +def normSeg (z m : Nat) : Nat × Nat := + if m = 0 then (z + 1, 0) else (z, m) + +def pushSeg (has_p5 : Bool) (z_new m_rem : Nat) (rest : List (Nat × Nat)) (zl : Nat) : + List (Nat × Nat) × Nat := + if has_p5 then (normSeg z_new m_rem :: rest, zl) else ([], z_new) + +def encSegs : List (Nat × Nat) → Nat → List LTok + | [], zl => z0Rep zl [] + | (z, 0) :: rest, zl => z0Rep z (.p5 :: encSegs rest zl) + | (z, m + 1) :: rest, zl => z0Rep z (.p3z (m + 1) :: .p5 :: encSegs rest zl) + +theorem z0Rep_succ_right (n : Nat) (rest : List LTok) : + z0Rep (n + 1) rest = z0Rep n (.p3z 0 :: rest) := by + induction n with + | zero => rfl + | succ n ih => + change LTok.p3z 0 :: z0Rep (n + 1) rest = LTok.p3z 0 :: z0Rep n (.p3z 0 :: rest) + rw [ih] + +theorem encSegs_normSeg (z m : Nat) (rest : List (Nat × Nat)) (zl : Nat) : + encSegs (normSeg z m :: rest) zl = z0Rep z (.p3z m :: .p5 :: encSegs rest zl) := by + cases m with + | zero => + dsimp only [normSeg, ite_true, encSegs] + exact z0Rep_succ_right z (.p5 :: encSegs rest zl) + | succ m' => rfl + +theorem encSegs_pushSeg (hp : Bool) (z_new m_rem : Nat) (rest : List (Nat × Nat)) (zl : Nat) : + encSegs (pushSeg hp z_new m_rem rest zl).1 (pushSeg hp z_new m_rem rest zl).2 = + z0Rep z_new (if hp then .p3z m_rem :: .p5 :: encSegs rest zl else []) := by + cases hp with + | false => rfl + | true => exact encSegs_normSeg z_new m_rem rest zl + +theorem z0_z0Rep_of_zero {rest : List LTok} (h : z0 rest = 0) (n : Nat) : + z0 (z0Rep n rest) = n := by + induction n with + | zero => exact h + | succ n ih => simp only [z0Rep, z0, ih]; omega + +theorem dropZ0_z0Rep_of_nonz0 {rest : List LTok} (h : dropZ0 rest = rest) (n : Nat) : + dropZ0 (z0Rep n rest) = rest := by + induction n with + | zero => exact h + | succ n ih => simp only [z0Rep, dropZ0, ih] + +theorem hasOdd_z0Rep (n : Nat) (rest : List LTok) : + hasOdd (z0Rep n rest) = hasOdd rest := by + induction n with + | zero => rfl + | succ n ih => simp only [z0Rep, hasOdd, ih]; rfl + +theorem hasP5_z0Rep (n : Nat) (rest : List LTok) : + hasP5 (z0Rep n rest) = hasP5 rest := by + induction n with + | zero => rfl + | succ n ih => simp only [z0Rep, hasP5, ih] + +theorem p5Suf_z0Rep (n : Nat) (rest : List LTok) : + p5Suf (z0Rep n rest) = p5Suf rest := by + induction n with + | zero => rfl + | succ n ih => simp only [z0Rep, p5Suf, ih] + +theorem MustDrain_z0Rep (n : Nat) (rest : List LTok) : + MustDrain (z0Rep n rest) = MustDrain rest := by + induction n with + | zero => rfl + | succ n ih => simp only [z0Rep, MustDrain, ih]; rfl + +theorem ep_z0Rep (n : Nat) (rest : List LTok) : + ep (z0Rep n rest) = n + ep rest := by + induction n with + | zero => simp only [z0Rep, Nat.zero_add] + | succ n ih => + have h0 : (0 : Nat) % 2 = 1 ↔ False := by decide + simp only [z0Rep, ep, h0, ite_false, ih] + omega + +theorem epSum_z0Rep (n : Nat) (rest : List LTok) : + epSum (z0Rep n rest) = epSum rest := by + induction n with + | zero => rfl + | succ n ih => + have h0 : (0 : Nat) % 2 = 1 ↔ False := by decide + simp only [z0Rep, epSum, h0, ite_false, Nat.zero_add, ih] + +theorem epW_z0Rep_nil (n : Nat) : epW (z0Rep n []) = n := by + induction n with + | zero => rfl + | succ n ih => + cases n with + | zero => rfl + | succ n' => + change (if 0 % 2 = 1 then 0 else 1 + epW (z0Rep (n' + 1) [])) = n' + 2 + rw [ih, if_neg (by decide)]; omega + +theorem epW_z0Rep_p3z (n m : Nat) (suf : List LTok) : + epW (z0Rep n (.p3z m :: .p5 :: suf)) = n := by + induction n with + | zero => + dsimp [z0Rep, epW] + rcases dec_or (m % 2 = 1) with hm | hm + · rw [if_pos hm] + · rw [if_neg hm] + | succ n ih => + cases n with + | zero => + change (if 0 % 2 = 1 then 0 else 1 + epW (.p3z m :: .p5 :: suf)) = 1 + have h0 : epW (.p3z m :: .p5 :: suf) = 0 := ih + rw [h0]; rfl + | succ n' => + change (if 0 % 2 = 1 then 0 else 1 + epW (z0Rep (n' + 1) (.p3z m :: .p5 :: suf))) = n' + 2 + rw [ih, if_neg (by decide)]; omega + +theorem isHeadP5_z0Rep_p3z (n m : Nat) (suf : List LTok) : + isHeadP5 (z0Rep n (.p3z m :: suf)) = false := by + cases n <;> rfl + +def isDrainRstDs : List Nat → Bool + | [d] => decide (d ≥ 8) + | [d, 0] => decide (d ≥ 8) + | _ => false + +def isRank0 : List Nat → Bool + | [] => true + | [0] => true + | [1] => true + | [2] => true + | _ => false + +theorem isRank0_iff (ds : List Nat) : + isRank0 ds = true ↔ (ds = [] ∨ ds = [0] ∨ ds = [1] ∨ ds = [2]) := by + rcases ds with _ | ⟨d, _ | ⟨d2, ds2⟩⟩ + · simp [isRank0] + · rcases d with _ | _ | _ | d3 <;> simp [isRank0] + · simp [isRank0] + +def drainPopGuards (phiWp1 : Nat) (ds : List Nat) : Bool := + if isDrainRstDs ds then + decide (phiWp1 ≥ if isOddDrainDs ds then 18 else 16) + else if isRank0 ds then + decide (phiWp1 ≥ 2) + else + match ds with + | d :: d2 :: ds2 => + decide (d ≥ 3 ∧ d2 ≥ 1) && + (!decide (d % 2 = 0 ∧ d ≤ 2 * d2 + 4) || GoodDs ((d2 - 1) :: ds2)) && + (!decide (d % 2 = 0 ∧ d + 14 ≤ 2 * d2) || GoodDs ((d2 - 2) :: ds2)) && + decide (phiWp1 ≥ 16) + | _ => false + +def drainPopStep (has_p5 : Bool) (phiWp1 m_rem : Nat) (rest : List (Nat × Nat)) (zl : Nat) + (ds : List Nat) : SegState := + if isDrainRstDs ds then + let p := pushSeg has_p5 (phiWp1 + 2) m_rem rest zl + let m_rst := headNat ds - 7 + if m_rst = 1 then + ⟨false, p.1, p.2, 2, 1, 0, [3, 1]⟩ + else + ⟨true, normSeg 0 (m_rst - 2) :: p.1, p.2, 3, 0, 8, [1]⟩ + else if isRank0 ds then + if ds = [] then + let p := pushSeg has_p5 (phiWp1 + 1) m_rem rest zl + ⟨false, p.1, p.2, 1, 1, 0, []⟩ + else if ds = [0] then + let p := pushSeg has_p5 (phiWp1 + 2) m_rem rest zl + ⟨true, p.1, p.2, 2, 2, 6, []⟩ + else if ds = [1] then + let p := pushSeg has_p5 (phiWp1 + 3) m_rem rest zl + ⟨true, p.1, p.2, 2, 0, 6, []⟩ + else + let p := pushSeg has_p5 (phiWp1 + 2) m_rem rest zl + ⟨false, p.1, p.2, 1, 1, 0, [0]⟩ + else + match ds with + | d :: d2 :: ds2 => + let p := pushSeg has_p5 (phiWp1 + 2) m_rem rest zl + if d2 = 1 ∧ ds2 = [] ∧ d ≥ 25 then + ⟨true, normSeg 0 (d - 11) :: p.1, p.2, 5, 0, 12, [2]⟩ + else + ⟨true, normSeg 0 (d - 3) :: p.1, p.2, d2 - 1, 0, 2 * d2, ds2⟩ + | _ => ⟨true, [], 0, 0, 0, 0, []⟩ + +def stepGuards (s : SegState) : Bool := + match s.b with + | false => + let c := s.cp1 + let k := s.kb + match s.segs with + | [] => + let cz := c + s.zl + GoodPhiW (cz - 1) s.ds false && GoodPsi (cz - 1) s.ds + | (_, 0) :: _ => true + | (z0, m + 1) :: _ => + let m0 := m + 1 + let cz := c + z0 + let kz := k + 2 * z0 + GoodPhiW (cz - 1) s.ds false && + if m0 = 1 then GoodPsi cz s.ds + else + GoodPsi (cz - 1) s.ds && + if m0 % 2 = 0 ∧ m0 ≤ 2 * kz + 10 then true + else if m0 % 2 = 1 ∧ m0 ≤ 2 * kz + 11 then GoodDs ((kz + 2) :: cz :: s.ds) + else true + | true => + match s.segs with + | [] => drainPopGuards (s.cp1 + s.zl) s.ds + | (_, 0) :: _ => decide (s.mrg ≥ s.kb) + | (z0, m + 1) :: _ => + let m0 := m + 1 + if m0 % 2 = 1 then + if decide (s.mrg ≥ s.kb + m) then GoodDs ((s.cp1 + z0) :: s.ds) + else drainPopGuards (s.cp1 + z0) s.ds + else + if decide (s.mrg ≥ s.kb + m0) then true + else drainPopGuards (s.cp1 + z0) s.ds + +def stepSegs (s : SegState) : SegState := + match s.b with + | false => + let c := s.cp1 + let k := s.kb + match s.segs with + | [] => + let cz := c + s.zl + let kz := k + 2 * s.zl + ⟨true, [], 0, kz + 2, 0, 2 * kz + 6, cz :: s.ds⟩ + | (z0, 0) :: rest => + let cz := c + z0 + let kz := k + 2 * z0 + ⟨true, rest, s.zl, cz + 3, kz + 3, 2 * cz + 8, s.ds⟩ + | (z0, m + 1) :: rest => + let m0 := m + 1 + let cz := c + z0 + let kz := k + 2 * z0 + if m0 = 1 then + ⟨false, rest, s.zl, kz + 4, 1, 0, (cz + 1) :: s.ds⟩ + else if m0 % 2 = 0 ∧ m0 ≤ 2 * kz + 10 then + ⟨false, rest, s.zl, kz + 4, m0 + 1, 0, cz :: s.ds⟩ + else if m0 % 2 = 1 ∧ m0 ≤ 2 * kz + 11 then + ⟨false, rest, s.zl, m0 - 1, 1, 0, (kz + 2) :: cz :: s.ds⟩ + else + ⟨true, normSeg 0 (m0 - 4) :: rest, s.zl, kz + 2, 0, 2 * kz + 6, cz :: s.ds⟩ + | true => + match s.segs with + | [] => drainPopStep false (s.cp1 + s.zl) 0 [] s.zl s.ds + | (z0, 0) :: rest => ⟨false, rest, s.zl, s.cp1 + z0 + 1, s.kb + 2 * z0 + 3, 0, s.ds⟩ + | (z0, m + 1) :: rest => + let m0 := m + 1 + if m0 % 2 = 1 then + if decide (s.mrg ≥ s.kb + m) then + ⟨false, rest, s.zl, s.kb + m + 2 * z0 + 4, 1, 0, (s.cp1 + z0) :: s.ds⟩ + else + drainPopStep true (s.cp1 + z0) (s.kb + m0 - (s.mrg + 2)) rest s.zl s.ds + else + if decide (s.mrg ≥ s.kb + m0) then + ⟨false, rest, s.zl, s.cp1 + z0 + 2, s.kb + m0 + 2 * z0 + 5, 0, s.ds⟩ + else + drainPopStep true (s.cp1 + z0) (s.kb + m0 - (s.mrg + 2)) rest s.zl s.ds + +theorem drainPop_eq_checkChain (fuel : Nat) (ls : List LTok) (cp1 kb mrg : Nat) (ds : List Nat) + (has_p5 : Bool) (m_rem_arg : Nat) (rest : List (Nat × Nat)) (zl : Nat) + (h1 : (hasOdd ls && decide (mrg ≥ kb + epSum ls)) = false) + (h2 : (!hasOdd ls && hasP5 ls && (isHeadP5 ls || decide (mrg ≥ kb + epSum ls))) = false) + (hp5 : hasP5 ls = has_p5) + (hsuf : has_p5 = true → p5Suf ls = encSegs rest zl) + (hmrem : has_p5 = true → kb + epSum ls + (if hasOdd ls then 1 else 0) - (mrg + 2) = m_rem_arg) + (hg : drainPopGuards (cp1 + epW ls) ds = true) : + checkChainAux (fuel + 1) true ls cp1 kb mrg ds = + let s' := drainPopStep has_p5 (cp1 + epW ls) m_rem_arg rest zl ds + checkChainAux fuel s'.b (encSegs s'.segs s'.zl) s'.cp1 s'.kb s'.mrg s'.ds := by + conv_lhs => unfold checkChainAux + rw [if_neg (by rw [h1]; decide), if_neg (by rw [h2]; decide)] + have htail : + (if hasP5 ls = true then + LTok.p3z (kb + epSum ls + (if hasOdd ls = + true then 1 else 0) - (mrg + 2)) :: .p5 :: p5Suf ls + else []) = + (if has_p5 then LTok.p3z m_rem_arg :: .p5 :: encSegs rest zl else []) := by + cases has_p5 with + | false => simp [hp5] + | true => simp only [hp5, ite_true, hsuf rfl, hmrem rfl] + unfold drainPopGuards drainPopStep at * + rcases ds with _ | ⟨d, _ | ⟨_ | d2, ds2⟩⟩ + · -- ds = [] + simp only [isDrainRstDs, isRank0, Bool.false_eq_true, ite_false, ite_true, + decide_eq_true_eq] at hg ⊢ + have hlt2 : ¬ (cp1 + epW ls < 2) := by omega + rw [if_pos (Or.inl trivial), if_neg hlt2, encSegs_pushSeg, htail] + · -- ds = [d] + rcases dec_or (d ≥ 8) with hd8 | hd8 + · have hd8b : decide (d ≥ 8) = true := decide_eq_true hd8 + simp only [isDrainRstDs, hd8b, ite_true] at hg ⊢ + have hlt : ¬ (cp1 + epW ls < if isOddDrainDs [d] = true then 18 else 16) := by + simp only [decide_eq_true_eq] at hg; omega + rw [if_neg hlt] + rcases dec_or (headNat [d] - 7 = 1) with hm1 | hm1 + · rw [if_pos hm1, if_pos hm1]; dsimp only; rw [encSegs_pushSeg, htail] + · rw [if_neg hm1, if_neg hm1]; dsimp only; rw [encSegs_normSeg, z0Rep, encSegs_pushSeg, htail] + · have hd8b : decide (d ≥ 8) = false := decide_eq_false hd8 + simp only [isDrainRstDs, hd8b, Bool.false_eq_true, ite_false] at hg ⊢ + cases h_r0 : isRank0 [d] with + | false => simp [h_r0] at hg + | true => + have hr0_prop : ([d] : List Nat) = [] ∨ [d] = [0] ∨ [d] = [1] ∨ [d] = [2] := + (isRank0_iff [d]).mp h_r0 + rw [if_pos hr0_prop] + simp only [h_r0, ite_true, decide_eq_true_eq] at hg ⊢ + have hlt2 : ¬ (cp1 + epW ls < 2) := by omega + rw [if_neg hlt2] + rcases hr0_prop with hnil | h0 | h1' | h2' + · cases hnil + · injection h0 with hd0; subst hd0 + have h01 : ([0] : List Nat) ≠ [1] := by decide + have h0nil : ([0] : List Nat) ≠ [] := by decide + simp only [h0nil, h01, ite_false, ite_true]; rw [encSegs_pushSeg, htail] + · injection h1' with hd1; subst hd1 + have h10 : ([1] : List Nat) ≠ [0] := by decide + have h1nil : ([1] : List Nat) ≠ [] := by decide + simp only [h1nil, h10, ite_false, ite_true]; rw [encSegs_pushSeg, htail] + · injection h2' with hd2; subst hd2 + have h2nil : ([2] : List Nat) ≠ [] := by decide + have h20 : ([2] : List Nat) ≠ [0] := by decide + have h21 : ([2] : List Nat) ≠ [1] := by decide + simp only [h2nil, h20, h21, ite_false]; rw [encSegs_pushSeg, htail] + · -- ds = d :: 0 :: ds2 + rcases ds2 with _ | ⟨d3, ds3⟩ + · -- ds = [d, 0] + rcases dec_or (d ≥ 8) with hd8 | hd8 + · have hd8b : decide (d ≥ 8) = true := decide_eq_true hd8 + simp only [isDrainRstDs, hd8b, ite_true] at hg ⊢ + have hlt : ¬ (cp1 + epW ls < if isOddDrainDs [d, 0] = true then 18 else 16) := by + simp only [decide_eq_true_eq] at hg; omega + rw [if_neg hlt] + rcases dec_or (headNat [d, 0] - 7 = 1) with hm1 | hm1 + · rw [if_pos hm1, if_pos hm1]; dsimp only; rw [encSegs_pushSeg, htail] + · rw [if_neg hm1, if_neg hm1]; dsimp only; rw [encSegs_normSeg, z0Rep, encSegs_pushSeg, + htail] + · have hd8b : decide (d ≥ 8) = false := decide_eq_false hd8 + simp [isDrainRstDs, isRank0, hd8b] at hg + · -- ds = d :: 0 :: d3 :: ds3 + simp [isDrainRstDs, isRank0] at hg + · -- ds = d :: (d2 + 1) :: ds2 + have h_ge2_step : ∀ ts : List Nat, + isDrainRstDs (d :: (d2 + 1) :: ts) = false → + ((decide (d ≥ 3 ∧ d2 + 1 ≥ 1) && + (!decide (d % 2 = 0 ∧ d ≤ 2 * (d2 + 1) + 4) || GoodDs (((d2 + 1) - 1) :: ts)) && + (!decide (d % 2 = 0 ∧ d + 14 ≤ 2 * (d2 + 1)) || GoodDs (((d2 + 1) - 2) :: ts)) && + decide (cp1 + epW ls ≥ 16)) = true) → + (if d :: (d2 + 1) :: ts = [] ∨ d :: (d2 + 1) :: ts = [0] ∨ + d :: (d2 + 1) :: ts = [1] ∨ d :: (d2 + 1) :: ts = [2] then + let phiWp1 := cp1 + epW ls + if phiWp1 < 2 then true + else + let m_rem := kb + epSum ls + (if hasOdd ls then 1 else 0) - (mrg + 2) + let tail_b2 := if hasP5 ls then LTok.p3z m_rem :: LTok.p5 :: p5Suf ls else [] + if d :: (d2 + 1) :: ts = + [] then checkChainAux fuel false (z0Rep (phiWp1 + 1) tail_b2) 1 1 0 [] + else if d :: (d2 + 1) :: ts = + [0] then checkChainAux fuel true (z0Rep (phiWp1 + 2) tail_b2) 2 2 6 [] + else if d :: (d2 + 1) :: ts = + [1] then checkChainAux fuel true (z0Rep (phiWp1 + 3) tail_b2) 2 0 6 [] + else checkChainAux fuel false (z0Rep (phiWp1 + 2) tail_b2) 1 1 0 [0] + else + if d ≥ 3 ∧ d2 + 1 ≥ 1 then + if d % 2 = 0 ∧ d ≤ 2 * (d2 + 1) + 4 ∧ GoodDs (((d2 + 1) - 1) :: ts) = false then false + else if d % 2 = 0 ∧ d + 14 ≤ 2 * (d2 + 1) ∧ + GoodDs (((d2 + 1) - 2) :: ts) = false then false + else if cp1 + epW ls < 16 then false + else + let phiWp1 := cp1 + epW ls + let m_rem := kb + epSum ls + (if hasOdd ls then 1 else 0) - (mrg + 2) + let tail_b2 := if hasP5 ls then LTok.p3z m_rem :: LTok.p5 :: p5Suf ls else [] + let ls_b2 := z0Rep phiWp1 tail_b2 + if d2 + 1 = 1 ∧ ts = [] ∧ d ≥ 25 then + checkChainAux fuel true (LTok.p3z (d - + 11) :: LTok.p5 :: LTok.p3z 0 :: LTok.p3z 0 :: ls_b2) 5 0 12 [2] + else + checkChainAux fuel true (LTok.p3z (d - + 3) :: LTok.p5 :: LTok.p3z 0 :: LTok.p3z 0 :: ls_b2) + ((d2 + 1) - 1) 0 (2 * (d2 + 1)) ts + else true) = + (let p := pushSeg has_p5 (cp1 + epW ls + 2) m_rem_arg rest zl + let s' : SegState := + if d2 + 1 = 1 ∧ ts = [] ∧ d ≥ 25 then + ⟨true, normSeg 0 (d - 11) :: p.1, p.2, 5, 0, 12, [2]⟩ + else + ⟨true, normSeg 0 (d - 3) :: p.1, p.2, (d2 + 1) - 1, 0, 2 * (d2 + 1), ts⟩ + checkChainAux fuel s'.b (encSegs s'.segs s'.zl) s'.cp1 s'.kb s'.mrg s'.ds) := by + intro ts _ hg_ts + dsimp only + rw [if_neg (by simp)] + simp only [Bool.and_eq_true, Bool.or_eq_true, Bool.not_eq_true', decide_eq_false_iff_not, + decide_eq_true_eq] at hg_ts + rcases hg_ts with ⟨⟨⟨hd32, hg1⟩, hg2⟩, hphi16⟩ + rw [if_pos hd32] + have hc1 : ¬ (d % 2 = 0 ∧ d ≤ 2 * (d2 + 1) + 4 ∧ GoodDs (((d2 + 1) - 1) :: ts) = false) := by + intro ⟨he, hle, hgf⟩ + rcases hg1 with hnot | hgt + · exact hnot ⟨he, hle⟩ + · rw [hgf] at hgt; cases hgt + have hc2 : ¬ (d % 2 = 0 ∧ d + 14 ≤ 2 * (d2 + 1) ∧ GoodDs (((d2 + 1) - 2) :: ts) = false) := by + intro ⟨he, hle, hgf⟩ + rcases hg2 with hnot | hgt + · exact hnot ⟨he, hle⟩ + · rw [hgf] at hgt; cases hgt + have hc3 : ¬ (cp1 + epW ls < 16) := by omega + rw [if_neg hc1, if_neg hc2, if_neg hc3] + rcases dec_or (d2 + 1 = 1 ∧ ts = [] ∧ d ≥ 25) with hrst2 | hrst2 + · rw [if_pos hrst2]; rw [if_pos hrst2]; dsimp only; rw [encSegs_normSeg, z0Rep, + encSegs_pushSeg, htail]; rfl + · rw [if_neg hrst2]; rw [if_neg hrst2]; dsimp only; rw [encSegs_normSeg, z0Rep, + encSegs_pushSeg, htail]; rfl + rcases ds2 with _ | ⟨d3, ds3⟩ + · change (if false = true then _ else _) = _ + rw [if_neg Bool.false_ne_true] + have hf1 : isDrainRstDs [d, d2 + 1] = false := rfl + have hf2 : isRank0 [d, d2 + 1] = false := by rcases d with _ | _ | _ | _ <;> rfl + rw [hf1, hf2, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true] at hg ⊢ + dsimp only + exact h_ge2_step [] hf1 hg + · change (if false = true then _ else _) = _ + rw [if_neg Bool.false_ne_true] + have hf1 : isDrainRstDs (d :: (d2 + 1) :: d3 :: ds3) = false := rfl + have hf2 : isRank0 (d :: (d2 + 1) :: d3 :: ds3) = false := by + rcases d with _ | _ | _ | _ <;> rfl + rw [hf1, hf2, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true] at hg ⊢ + dsimp only + exact h_ge2_step (d3 :: ds3) hf1 hg + +theorem checkChainAux_eq_of_guards (fuel : Nat) (s : SegState) (hg : stepGuards s = true) : + checkChainAux (fuel + 1) s.b (encSegs s.segs s.zl) s.cp1 s.kb s.mrg s.ds = + let s' := stepSegs s + checkChainAux fuel s'.b (encSegs s'.segs s'.zl) s'.cp1 s'.kb s'.mrg s'.ds := by + rcases s with ⟨b, segs, zl, cp1, kb, mrg, ds⟩ + cases b with + | false => + rcases segs with _ | ⟨⟨z, m⟩, rest⟩ + · dsimp [stepGuards, stepSegs, encSegs] at hg ⊢ + simp only [Bool.and_eq_true] at hg + rcases hg with ⟨hphi, hpsi⟩ + conv_lhs => unfold checkChainAux + rw [z0_z0Rep_of_zero rfl zl, dropZ0_z0Rep_of_nonz0 rfl zl] + have hhd : (!isHeadP5 [] && !GoodPhiW (cp1 + zl - 1) ds false) = false := by + simp [isHeadP5, hphi] + rw [if_neg (by rw [hhd]; decide)] + dsimp only + rw [hpsi, Bool.true_and] + have h6 : 2 * (kb + 2 * zl + 1) + 4 = 2 * (kb + 2 * zl) + 6 := by omega + rw [h6]; rfl + · cases m with + | zero => + dsimp [stepGuards, stepSegs, encSegs] at hg ⊢ + conv_lhs => unfold checkChainAux + rw [z0_z0Rep_of_zero rfl z, dropZ0_z0Rep_of_nonz0 rfl z] + have hhd : (!isHeadP5 (.p5 :: encSegs rest zl) && !GoodPhiW (cp1 + z - 1) ds false) = + false := by + simp [isHeadP5] + rw [if_neg (by rw [hhd]; decide)] + dsimp only + have h8 : 2 * (cp1 + z + 2) + 4 = 2 * (cp1 + z) + 8 := by omega + rw [h8] + | succ m' => + dsimp [stepGuards, stepSegs, encSegs] at hg ⊢ + simp only [Bool.and_eq_true] at hg + rcases hg with ⟨hphi, hg_rest⟩ + conv_lhs => unfold checkChainAux + rw [z0_z0Rep_of_zero rfl z, dropZ0_z0Rep_of_nonz0 rfl z] + have hhd : (!isHeadP5 (.p3z (m' + 1) :: .p5 :: encSegs rest zl) && + !GoodPhiW (cp1 + z - 1) ds false) = false := by + simp [isHeadP5, hphi] + rw [if_neg (by rw [hhd]; decide)] + dsimp only [drop1L] + rcases dec_or (m' + 1 = 1) with hm1 | hm1 + · rw [if_pos hm1] at hg_rest + rw [if_pos hm1, if_pos hm1] + dsimp only + rw [hg_rest, Bool.true_and] + · rw [if_neg hm1] at hg_rest + rw [if_neg hm1, if_neg hm1] + simp only [Bool.and_eq_true] at hg_rest + rcases hg_rest with ⟨hpsi, hg_sub⟩ + have hnpsi : (!GoodPsi (cp1 + z - 1) ds) = false := by simp [hpsi] + rw [if_neg (by rw [hnpsi]; decide)] + rcases dec_or ((m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (kb + 2 * z) + 10) with hev | hev + · rw [if_pos hev, if_pos hev] + · rw [if_neg hev] at hg_sub + rw [if_neg hev, if_neg hev] + rcases dec_or ((m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (kb + 2 * z) + 11) with hod | hod + · rw [if_pos hod] at hg_sub + rw [if_pos hod, if_pos hod] + dsimp only + rw [hg_sub, Bool.true_and] + rfl + · rw [if_neg hod, if_neg hod] + dsimp only + rw [encSegs_normSeg, z0Rep] + have h6 : 2 * (kb + 2 * z + 1) + 4 = 2 * (kb + 2 * z) + 6 := by omega + rw [h6] + | true => + rcases segs with _ | ⟨⟨z, m⟩, rest⟩ + · dsimp [stepGuards, stepSegs, encSegs] at hg ⊢ + have hepw : epW (z0Rep zl []) = zl := epW_z0Rep_nil zl + have h1 : (hasOdd (z0Rep zl []) && decide (mrg ≥ kb + epSum (z0Rep zl []))) = false := by + rw [hasOdd_z0Rep]; rfl + have h2 : (!hasOdd (z0Rep zl []) && hasP5 (z0Rep zl []) && + (isHeadP5 (z0Rep zl []) || decide (mrg ≥ kb + epSum (z0Rep zl [])))) = false := by + rw [hasP5_z0Rep]; simp [hasP5] + have h_eq := drainPop_eq_checkChain fuel (z0Rep zl []) cp1 kb mrg ds false 0 [] zl + h1 h2 (by rw [hasP5_z0Rep]; rfl) (by intro h; cases h) (by intro h; cases h) + (by rw [hepw]; exact hg) + rw [hepw] at h_eq + exact h_eq + · cases m with + | zero => + dsimp [stepGuards, stepSegs, encSegs] at hg ⊢ + simp only [decide_eq_true_eq] at hg + conv_lhs => unfold checkChainAux + have hodd : hasOdd (z0Rep z (.p5 :: encSegs rest zl)) = false := by + rw [hasOdd_z0Rep]; rfl + have hp5 : hasP5 (z0Rep z (.p5 :: encSegs rest zl)) = true := by + rw [hasP5_z0Rep]; rfl + have heps : epSum (z0Rep z (.p5 :: encSegs rest zl)) = 0 := by + rw [epSum_z0Rep]; rfl + have hep : ep (z0Rep z (.p5 :: encSegs rest zl)) = z := by + rw [ep_z0Rep]; simp [ep] + have hsuf : p5Suf (z0Rep z (.p5 :: encSegs rest zl)) = encSegs rest zl := by + rw [p5Suf_z0Rep]; rfl + have h1 : (hasOdd (z0Rep z (.p5 :: encSegs rest zl)) && + decide (mrg ≥ kb + epSum (z0Rep z (.p5 :: encSegs rest zl)))) = false := by + rw [hodd]; rfl + have h2 : (!hasOdd (z0Rep z (.p5 :: encSegs rest zl)) && + hasP5 (z0Rep z (.p5 :: encSegs rest zl)) && + (isHeadP5 (z0Rep z (.p5 :: encSegs rest zl)) || + decide (mrg ≥ kb + epSum (z0Rep z (.p5 :: encSegs rest zl))))) = true := by + rw [hodd, hp5, heps] + have hdec : decide (mrg ≥ kb + 0) = true := decide_eq_true (by omega) + rw [hdec, Bool.or_true]; rfl + rw [if_neg (by rw [h1]; decide), if_pos h2, hsuf, hep, heps] + have hk3 : kb + 0 + 2 * z + 3 = kb + 2 * z + 3 := by omega + rw [hk3] + | succ m' => + dsimp [stepGuards, stepSegs, encSegs] at hg ⊢ + set ls := z0Rep z (.p3z (m' + 1) :: .p5 :: encSegs rest zl) + have hp5 : hasP5 ls = true := by rw [hasP5_z0Rep]; rfl + have hsuf : p5Suf ls = encSegs rest zl := by rw [p5Suf_z0Rep]; rfl + have hhd : isHeadP5 ls = false := isHeadP5_z0Rep_p3z z (m' + 1) (.p5 :: encSegs rest zl) + have hepw : epW ls = z := epW_z0Rep_p3z z (m' + 1) (encSegs rest zl) + rcases dec_or ((m' + 1) % 2 = 1) with hm_odd | hm_even + · rw [if_pos hm_odd] at hg ⊢ + have hodd : hasOdd ls = true := by + rw [hasOdd_z0Rep]; dsimp [hasOdd]; rw [if_pos hm_odd] + have hmd : MustDrain ls = false := by + rw [MustDrain_z0Rep]; dsimp [MustDrain]; rw [if_pos hm_odd] + have hep : ep ls = z := by + rw [ep_z0Rep]; dsimp [ep]; rw [if_pos hm_odd]; omega + have heps : epSum ls = m' := by + rw [epSum_z0Rep]; dsimp [epSum]; rw [if_pos hm_odd] + cases hd_mrg : decide (mrg ≥ kb + m') with + | true => + simp only [hd_mrg, ite_true] at hg ⊢ + conv_lhs => unfold checkChainAux + have h1 : (hasOdd ls && decide (mrg ≥ kb + epSum ls)) = true := by + rw [hodd, heps, hd_mrg]; rfl + rw [if_pos h1] + dsimp only + rw [hmd, hp5, hsuf, hep, heps] + change (GoodDs ((cp1 + z) :: ds) && + checkChainAux fuel false (encSegs rest zl) (kb + m' + 2 * z + 4) 1 0 ((cp1 + + z) :: ds)) = _ + rw [hg, Bool.true_and] + | false => + simp only [hd_mrg, Bool.false_eq_true, ite_false] at hg ⊢ + have h1 : (hasOdd ls && decide (mrg ≥ kb + epSum ls)) = false := by + rw [hodd, heps, hd_mrg]; rfl + have h2 : (!hasOdd ls && hasP5 ls && + (isHeadP5 ls || decide (mrg ≥ kb + epSum ls))) = false := by + rw [hodd]; rfl + have h_eq := drainPop_eq_checkChain fuel ls cp1 kb mrg ds true + (kb + (m' + 1) - (mrg + 2)) rest zl h1 h2 hp5 (fun _ => hsuf) + (fun _ => by rw [heps, hodd]; simp only [ite_true, Nat.add_assoc]) + (by rw [hepw]; exact hg) + rw [hepw] at h_eq + exact h_eq + · rw [if_neg hm_even] at hg ⊢ + have hodd : hasOdd ls = false := by + rw [hasOdd_z0Rep]; dsimp [hasOdd]; rw [if_neg hm_even] + have hep : ep ls = z + 1 := by + rw [ep_z0Rep]; dsimp [ep]; rw [if_neg hm_even] + have heps : epSum ls = m' + 1 := by + rw [epSum_z0Rep]; dsimp [epSum]; rw [if_neg hm_even] + cases hd_mrg : decide (mrg ≥ kb + (m' + 1)) with + | true => + simp only [hd_mrg, ite_true] at hg ⊢ + conv_lhs => unfold checkChainAux + have h1 : (hasOdd ls && decide (mrg ≥ kb + epSum ls)) = false := by + rw [hodd]; rfl + have h2 : (!hasOdd ls && hasP5 ls && + (isHeadP5 ls || decide (mrg ≥ kb + epSum ls))) = true := by + rw [hodd, hp5, hhd, heps, hd_mrg]; rfl + rw [if_neg (by rw [h1]; decide), if_pos h2, hsuf, hep, heps] + have hc2 : cp1 + (z + 1) + 1 = cp1 + z + 2 := by omega + have hk5 : kb + (m' + 1) + 2 * (z + 1) + 3 = kb + (m' + 1) + 2 * z + 5 := by omega + rw [hc2, hk5] + | false => + simp only [hd_mrg, Bool.false_eq_true, ite_false] at hg ⊢ + have h1 : (hasOdd ls && decide (mrg ≥ kb + epSum ls)) = false := by + rw [hodd]; rfl + have h2 : (!hasOdd ls && hasP5 ls && + (isHeadP5 ls || decide (mrg ≥ kb + epSum ls))) = false := by + rw [hodd, hp5, hhd, heps, hd_mrg]; rfl + have h_eq := drainPop_eq_checkChain fuel ls cp1 kb mrg ds true + (kb + (m' + 1) - (mrg + 2)) rest zl h1 h2 hp5 (fun _ => hsuf) + (fun _ => by rw [heps, hodd]; simp only [Bool.false_eq_true, ite_false, Nat.add_zero]) + (by rw [hepw]; exact hg) + rw [hepw] at h_eq + exact h_eq + + +-- ============================================================================ +-- Section 5g.2: Fuel-Bounded LeadsUpTo Framework & Stack-Polymorphic Excursion +-- ============================================================================ + +def FailsIn (s : SegState) (n : Nat) : Prop := + checkChainAux n s.b (encSegs s.segs s.zl) s.cp1 s.kb s.mrg s.ds = false + +def ChainLeadsUpTo (N : Nat) (s : SegState) (P : SegState → Prop) : Prop := + ∀ n, n ≤ N → FailsIn s n → ∃ m s', m ≤ n ∧ P s' ∧ FailsIn s' m + +def ChainLeads (s : SegState) (P : SegState → Prop) : Prop := + ∀ N, ChainLeadsUpTo N s P + +def ChainAdvances (s : SegState) (P : SegState → Prop) : Prop := + stepGuards s = true ∧ ChainLeads (stepSegs s) P + +theorem not_failsIn_zero (s : SegState) : ¬FailsIn s 0 := by + intro h; cases h + +theorem chainLeadsUpTo_here {N : Nat} {s : SegState} {P : SegState → Prop} (hp : P s) : + ChainLeadsUpTo N s P := by + intro n _ hf + exact ⟨n, s, Nat.le_refl n, hp, hf⟩ + +theorem chainLeadsUpTo_mono {M N : Nat} (hle : M ≤ N) {s : SegState} {P : SegState → Prop} + (h : ChainLeadsUpTo N s P) : ChainLeadsUpTo M s P := by + intro n hn hf + exact h n (Nat.le_trans hn hle) hf + +theorem chainLeadsUpTo_imp {N : Nat} {s : SegState} {P Q : SegState → Prop} + (h : ChainLeadsUpTo N s P) (himp : ∀ s', P s' → Q s') : ChainLeadsUpTo N s Q := by + intro n hn hf + obtain ⟨m, s', hm, hp, hfm⟩ := h n hn hf + exact ⟨m, s', hm, himp s' hp, hfm⟩ + +theorem chainLeadsUpTo_trans {N : Nat} {s : SegState} {P Q : SegState → Prop} + (h1 : ChainLeadsUpTo N s P) + (h2 : ∀ m s', m ≤ N → P s' → ChainLeadsUpTo m s' Q) : + ChainLeadsUpTo N s Q := by + intro n hn hf + obtain ⟨m, s', hm, hp, hfm⟩ := h1 n hn hf + obtain ⟨k, s'', hk, hq, hfk⟩ := h2 m s' (Nat.le_trans hm hn) hp m (Nat.le_refl m) hfm + exact ⟨k, s'', Nat.le_trans hk hm, hq, hfk⟩ + +theorem chainLeadsUpTo_step {N : Nat} {s : SegState} {P : SegState → Prop} + (hg : stepGuards s = true) + (hnext : ∀ m, m < N → ChainLeadsUpTo m (stepSegs s) P) : + ChainLeadsUpTo N s P := by + intro n hn hf + cases n with + | zero => exact False.elim (not_failsIn_zero s hf) + | succ m => + have h_eq := checkChainAux_eq_of_guards m s hg + dsimp only [FailsIn] at hf + rw [h_eq] at hf + obtain ⟨k, s', hk, hp, hfk⟩ := hnext m (by omega) m (Nat.le_refl m) hf + exact ⟨k, s', by omega, hp, hfk⟩ + +theorem chainLeadsUpTo_step1 {N : Nat} {s : SegState} {P : SegState → Prop} + (hg : stepGuards s = true) + (hnext : ChainLeadsUpTo N (stepSegs s) P) : + ChainLeadsUpTo N s P := + chainLeadsUpTo_step hg (fun m hm => chainLeadsUpTo_mono (by omega) hnext) + +theorem checkChainAux_true_of_advances {P : SegState → Prop} + (hadv : ∀ s, P s → ChainAdvances s P) : + ∀ fuel s, P s → checkChainAux fuel s.b (encSegs s.segs s.zl) s.cp1 s.kb s.mrg s.ds = true := by + intro fuel + induction fuel using Nat.strong_induction_on with + | h n ih => + intro s hp + cases n with + | zero => rfl + | succ m => + obtain ⟨hg, hleads⟩ := hadv s hp + cases hval : checkChainAux (m + 1) s.b (encSegs s.segs s.zl) s.cp1 s.kb s.mrg s.ds with + | true => rfl + | false => + have h_eq := checkChainAux_eq_of_guards m s hg + rw [h_eq] at hval + obtain ⟨k, s', hk, hps', hfk⟩ := hleads m m (Nat.le_refl m) hval + have htr := ih k (by omega) s' hps' + dsimp only [FailsIn] at hfk + rw [htr] at hfk + cases hfk + +-- ============================================================================ +-- Segment Validity, SafeStack, and Standalone Arithmetic Lemmas +-- ============================================================================ + +def ValidSegs40 (segs : List (Nat × Nat)) (zl : Nat) : Prop := + (∀ p ∈ segs, 40 ≤ p.1) ∧ 230 ≤ zl + +def ValidTail40 (segs : List (Nat × Nat)) (zl : Nat) : Prop := + match segs with + | [] => 230 ≤ zl + | _ :: rest => ValidSegs40 rest zl + +def fzOf (segs : List (Nat × Nat)) (zl : Nat) : Nat := + match segs with + | [] => zl + | (z, _) :: _ => z + +theorem fzOf_ge_40 {segs : List (Nat × Nat)} {zl : Nat} (hv : ValidSegs40 segs zl) : + 40 ≤ fzOf segs zl := by + rcases segs with _ | ⟨⟨z, m⟩, rest⟩ + · exact Nat.le_trans (by decide) hv.2 + · exact hv.1 (z, m) List.mem_cons_self + +theorem validTail40_of_validSegs40 {segs : List (Nat × Nat)} {zl : Nat} + (hv : ValidSegs40 segs zl) : ValidTail40 segs zl := by + rcases segs with _ | ⟨p, rest⟩ + · exact hv.2 + · exact ⟨fun q hq => hv.1 q (List.mem_cons_of_mem _ hq), hv.2⟩ + +theorem validSegs40_tail {p : Nat × Nat} {rest : List (Nat × Nat)} {zl : Nat} + (hv : ValidSegs40 (p :: rest) zl) : ValidSegs40 rest zl := + ⟨fun q hq => hv.1 q (List.mem_cons_of_mem _ hq), hv.2⟩ + +theorem normSeg_fst_ge (z m : Nat) : z ≤ (normSeg z m).1 := by + dsimp [normSeg] + rcases dec_or (m = 0) with hm | hm + · rw [if_pos hm]; omega + · rw [if_neg hm] + +theorem validSegs40_pushSeg (hp : Bool) {z m : Nat} {rest : List (Nat × Nat)} {zl : Nat} + (hz : 40 ≤ z) (hv : hp = true → ValidSegs40 rest zl) (hzl : hp = false → 230 ≤ z) : + ValidSegs40 (pushSeg hp z m rest zl).1 (pushSeg hp z m rest zl).2 := by + cases hp with + | false => + exact ⟨(by intro _ h; cases h), hzl rfl⟩ + | true => + have hvr := hv rfl + refine ⟨?_, hvr.2⟩ + intro q hq + rcases List.mem_cons.mp hq with rfl | hq' + · exact Nat.le_trans hz (normSeg_fst_ge z m) + · exact hvr.1 q hq' + +theorem validTail40_pushSeg (hp : Bool) {z m : Nat} {rest : List (Nat × Nat)} {zl : Nat} + (hv : hp = true → ValidSegs40 rest zl) (hzl : hp = false → 230 ≤ z) : + ValidTail40 (pushSeg hp z m rest zl).1 (pushSeg hp z m rest zl).2 := by + cases hp with + | false => exact hzl rfl + | true => exact hv rfl + +theorem fzOf_pushSeg_ge (hp : Bool) (z m : Nat) (rest : List (Nat × Nat)) (zl : Nat) : + z ≤ fzOf (pushSeg hp z m rest zl).1 (pushSeg hp z m rest zl).2 := by + cases hp with + | false => exact Nat.le_refl z + | true => exact normSeg_fst_ge z m + +theorem goodPhiW_of_ge35 {phiW : Nat} {ds : List Nat} (hne2 : ds ≠ [2]) (h35 : 35 ≤ phiW) : + GoodPhiW phiW ds false = true := by + dsimp only [GoodPhiW] + rw [if_neg hne2] + rcases dec_or (ds = [0]) with h0 | h0 + · rw [if_pos h0]; exact decide_eq_true (by omega) + · rw [if_neg h0] + rcases dec_or (ds = [1]) with h1 | h1 + · rw [if_pos h1]; exact decide_eq_true (by omega) + · rw [if_neg h1] + rcases dec_or (ds = []) with hn | hn + · rw [if_pos hn, Bool.false_or]; exact decide_eq_true (by omega) + · rw [if_neg hn] + have hd35 : decide (phiW ≥ 35) = true := decide_eq_true (by omega) + have hd17 : decide (phiW ≥ 17) = true := decide_eq_true (by omega) + have hd15 : decide (phiW ≥ 15) = true := decide_eq_true (by omega) + rcases ds with _ | ⟨d, _ | ⟨d2, _ | ⟨d3, ds3⟩⟩⟩ + · exact False.elim (hn rfl) + · dsimp only; rw [if_neg Bool.false_ne_true] + cases isOddDrainDs [d] <;> simp only [ite_true, Bool.false_eq_true, ite_false, hd17, hd15] + · cases d2 with + | zero => + cases isOddDrainDs [d, 0] <;> simp only [ite_true, Bool.false_eq_true, ite_false, hd17, + hd15] + | succ d2' => + cases d2' with + | zero => + cases hd25 : decide (d ≥ 25) <;> + simp only [hd25, ite_true, Bool.false_eq_true, ite_false, isOddDrainDs, hd35, hd15] + | succ _ => + simp only [Bool.false_eq_true, ite_false, isOddDrainDs, hd15] + · simp only [Bool.false_eq_true, ite_false, isOddDrainDs, hd15] + +def SafeStack (m : Nat) (S : List Nat) : Prop := + S ≠ [2] ∧ GoodDs S = true ∧ ∀ u, m ≤ u → GoodDs (u :: S) = true + +theorem safeStack_mono {m1 m2 : Nat} {S : List Nat} (hle : m1 ≤ m2) (hs : SafeStack m1 S) : + SafeStack m2 S := + ⟨hs.1, hs.2.1, fun u hu => hs.2.2 u (Nat.le_trans hle hu)⟩ + +theorem isOddDrain1_eq_false_of_ge18 {x : Nat} (hx : 18 ≤ x) : isOddDrain1 x = false := by + dsimp only [isOddDrain1] + exact decide_eq_false (by omega) + +theorem safeStack_cons {m x : Nat} {S : List Nat} + (hs : SafeStack m S) (hx18 : 18 ≤ x) (hxm : m + 2 ≤ x) : + SafeStack 39 (x :: S) := by + refine ⟨(by intro h; injection h with h1; omega), hs.2.2 x (by omega), ?_⟩ + intro u hu + rcases S with _ | ⟨d3, ds3⟩ + · dsimp only [GoodDs, GoodDsAux, GoodDs2] + rw [if_neg (by omega), if_neg (by omega), if_neg (by omega)] + have hod : isOddDrain1 x = false := isOddDrain1_eq_false_of_ge18 hx18 + have hu17 : decide (u < 17) = false := decide_eq_false (by omega) + have hg0 : GoodDs1 x = true := by dsimp only [GoodDs1]; exact decide_eq_true (by omega) + have hg1 : GoodDs1 (x - 1) = true := by dsimp only [GoodDs1]; exact decide_eq_true (by omega) + have hg2 : GoodDs1 (x - 2) = true := by dsimp only [GoodDs1]; exact decide_eq_true (by omega) + rw [hod, hu17, hg0, hg1, hg2] + simp only [Bool.false_and, Bool.not_true, Bool.or_false, Bool.and_false, + Bool.false_eq_true, ite_false] + · dsimp only [GoodDs, GoodDsAux] + rw [if_neg (by omega)] + have h31 : decide (x = 3 ∧ d3 = 1 ∧ ds3 = [] ∧ u < 19) = false := decide_eq_false (by omega) + have hod : isOddDrainDs (x :: d3 :: ds3) = false := by + cases d3 with + | zero => + rcases ds3 with _ | ⟨d4, ds4⟩ + · dsimp only [isOddDrainDs]; exact isOddDrain1_eq_false_of_ge18 hx18 + · rfl + | succ _ => rfl + have hd25 : decide (x ≥ 25 ∧ d3 = 1 ∧ ds3 = [] ∧ u < 39) = false := + decide_eq_false (by omega) + have hu17 : decide (u < 17) = false := decide_eq_false (by omega) + have hg0 : GoodDsAux x (d3 :: ds3) = true := hs.2.2 x (by omega) + have hg1 : GoodDsAux (x - 1) (d3 :: ds3) = true := hs.2.2 (x - 1) (by omega) + have hg2 : GoodDsAux (x - 2) (d3 :: ds3) = true := hs.2.2 (x - 2) (by omega) + rw [h31, hod, hd25, hu17, hg0, hg1, hg2] + simp only [Bool.false_and, Bool.not_true, Bool.or_false, Bool.and_false, + Bool.false_eq_true, ite_false] + +theorem safeStack_cons_ne1 {m x : Nat} {S : List Nat} + (hne1 : S ≠ [1]) (hs : SafeStack m S) (hx18 : 18 ≤ x) (hxm : m + 2 ≤ x) : + SafeStack 19 (x :: S) := by + refine ⟨(by intro h; injection h with h1; omega), hs.2.2 x (by omega), ?_⟩ + intro u hu + rcases S with _ | ⟨d3, ds3⟩ + · dsimp only [GoodDs, GoodDsAux, GoodDs2] + rw [if_neg (by omega), if_neg (by omega), if_neg (by omega)] + have hod : isOddDrain1 x = false := isOddDrain1_eq_false_of_ge18 hx18 + have hu17 : decide (u < 17) = false := decide_eq_false (by omega) + have hg0 : GoodDs1 x = true := by dsimp only [GoodDs1]; exact decide_eq_true (by omega) + have hg1 : GoodDs1 (x - 1) = true := by dsimp only [GoodDs1]; exact decide_eq_true (by omega) + have hg2 : GoodDs1 (x - 2) = true := by dsimp only [GoodDs1]; exact decide_eq_true (by omega) + rw [hod, hu17, hg0, hg1, hg2] + simp only [Bool.false_and, Bool.not_true, Bool.or_false, Bool.and_false, + Bool.false_eq_true, ite_false] + · dsimp only [GoodDs, GoodDsAux] + rw [if_neg (by omega)] + have h31 : decide (x = 3 ∧ d3 = 1 ∧ ds3 = [] ∧ u < 19) = false := decide_eq_false (by omega) + have hod : isOddDrainDs (x :: d3 :: ds3) = false := by + cases d3 with + | zero => + rcases ds3 with _ | ⟨d4, ds4⟩ + · dsimp only [isOddDrainDs]; exact isOddDrain1_eq_false_of_ge18 hx18 + · rfl + | succ _ => rfl + have hd25 : decide (x ≥ 25 ∧ d3 = 1 ∧ ds3 = [] ∧ u < 39) = false := by + apply decide_eq_false + rintro ⟨_, rfl, rfl, _⟩ + exact hne1 rfl + have hu17 : decide (u < 17) = false := decide_eq_false (by omega) + have hg0 : GoodDsAux x (d3 :: ds3) = true := hs.2.2 x (by omega) + have hg1 : GoodDsAux (x - 1) (d3 :: ds3) = true := hs.2.2 (x - 1) (by omega) + have hg2 : GoodDsAux (x - 2) (d3 :: ds3) = true := hs.2.2 (x - 2) (by omega) + rw [h31, hod, hd25, hu17, hg0, hg1, hg2] + simp only [Bool.false_and, Bool.not_true, Bool.or_false, Bool.and_false, + Bool.false_eq_true, ite_false] + +def ox (kz cz : Nat) : Nat := cz - (3 * cz - kz) / 30 - 2 +def odw (kz cz : Nat) : Nat := ox kz cz - 1 +def oxw (kz cz : Nat) : Nat := cz + kz / 20 + 36 + +theorem ox_spec_lt {kz cz : Nat} (hlt : kz < 3 * cz) : + ∃ q r, r < 30 ∧ 3 * cz = kz + 30 * q + r ∧ ox kz cz = cz - q - 2 := by + set d := 3 * cz - kz + refine ⟨d / 30, d % 30, Nat.mod_lt d (by decide), ?_, rfl⟩ + have hdiv := Nat.div_add_mod d 30 + omega + +theorem div20_spec (kz : Nat) : ∃ q r, r < 20 ∧ kz = 20 * q + r ∧ kz / 20 = q := + ⟨kz / 20, kz % 20, Nat.mod_lt kz (by decide), (Nat.div_add_mod kz 20).symm, rfl⟩ + +theorem div10_spec (kz : Nat) : ∃ q r, r < 10 ∧ kz = 10 * q + r ∧ kz / 10 = q := + ⟨kz / 10, kz % 10, Nat.mod_lt kz (by decide), (Nat.div_add_mod kz 10).symm, rfl⟩ + +theorem ox_bounds_relaxed {c k fz : Nat} + (_hc : 1 ≤ c) (_hk1 : 1 ≤ k) (hkc : k ≤ 2 * c + 3) + (_hfz : 35 ≤ fz) (hcz : 42 ≤ c + fz) (hkz : 73 ≤ k + 2 * fz) : + 39 ≤ ox (k + 2 * fz) (c + fz) ∧ ox (k + 2 * fz) (c + fz) + 3 ≤ c + fz := by + obtain ⟨q, r, hr, heq, hox⟩ := ox_spec_lt (kz := k + 2 * fz) (cz := c + fz) (by omega) + omega + +theorem ox_ge41_of_c5 {c k fz : Nat} + (_hc : 5 ≤ c) (_hk1 : 1 ≤ k) (hkc : k ≤ 2 * c + 3) (_hfz : 40 ≤ fz) : + 41 ≤ ox (k + 2 * fz) (c + fz) := by + obtain ⟨q, r, hr, heq, hox⟩ := ox_spec_lt (kz := k + 2 * fz) (cz := c + fz) (by omega) + omega + +theorem arith_fb_t0 {c k z0 z1 fz2 : Nat} + (_hc : 1 ≤ c) (_hk1 : 1 ≤ k) (hkc : k ≤ 2 * c + 3) + (_hfz0 : 35 ≤ z0) (_hcz : 42 ≤ c + z0) (_hkz : 73 ≤ k + 2 * z0) + (_hz1 : 40 ≤ z1) (_hfz2 : 40 ≤ fz2) : + ox (k + 2 * z0) (c + z0) ≤ + ox (k + 2 * z0 + 3 + 2 * z1 + 3 + 2 * fz2) (c + z0 + 3 + z1 + 1 + fz2) ∧ + odw (k + 2 * z0) (c + z0) ≤ + odw (k + 2 * z0 + 3 + 2 * z1 + 3 + 2 * fz2) (c + z0 + 3 + z1 + 1 + fz2) ∧ + oxw (k + 2 * z0) (c + z0) ≤ + oxw (k + 2 * z0 + 3 + 2 * z1 + 3 + 2 * fz2) (c + z0 + 3 + z1 + 1 + fz2) := by + obtain ⟨q1, r1, hr1, heq1, hox1⟩ := ox_spec_lt (kz := k + 2 * z0) (cz := c + z0) (by omega) + obtain ⟨q2, r2, hr2, heq2, hox2⟩ := + ox_spec_lt (kz := k + 2 * z0 + 3 + 2 * z1 + 3 + 2 * fz2) (cz := + c + z0 + 3 + z1 + 1 + fz2) (by omega) + obtain ⟨qw1, rw1, hrw1, hkw1, hdw1⟩ := div20_spec (k + 2 * z0) + obtain ⟨qw2, rw2, hrw2, hkw2, hdw2⟩ := div20_spec (k + 2 * z0 + 3 + 2 * z1 + 3 + 2 * fz2) + dsimp only [odw, oxw] + rw [hdw1, hdw2, hox1, hox2] + omega + +theorem arith_fb_to {c k z0 z1 m1' fz2 : Nat} + (_hc : 1 ≤ c) (_hk1 : 1 ≤ k) (hkc : k ≤ 2 * c + 3) + (_hfz0 : 35 ≤ z0) (_hcz : 42 ≤ c + z0) (_hkz : 73 ≤ k + 2 * z0) + (_hz1 : 40 ≤ z1) (_hfz2 : 40 ≤ fz2) : + ox (k + 2 * z0) (c + z0) ≤ c + z0 + 3 + z1 ∧ + 30 * ox (k + 2 * z0) (c + z0) ≤ + (k + 2 * z0 + 3 + m1' + 2 * z1 + 4 + fz2) + 27 * (c + z0 + 3 + z1) + 900 ∧ + 60 * ox (k + 2 * z0) (c + z0) + 120 ≤ + 2 * (k + 2 * z0 + 3 + m1' + 2 * z1 + 4 + fz2) + 55 * (c + z0 + 3 + z1) ∧ + 10 * oxw (k + 2 * z0) (c + z0) + 40 ≤ + 9 * (k + 2 * z0 + 3 + m1' + 2 * z1 + 4 + fz2) + 10 * (c + z0 + 3 + z1) ∧ + 20 * oxw (k + 2 * z0) (c + z0) ≤ + (k + 2 * z0 + 3 + m1' + 2 * z1 + 4 + fz2) + 20 * (c + z0 + 3 + z1) + 800 := by + obtain ⟨q1, r1, hr1, heq1, hox1⟩ := ox_spec_lt (kz := k + 2 * z0) (cz := c + z0) (by omega) + obtain ⟨qw1, rw1, hrw1, hkw1, hdw1⟩ := div20_spec (k + 2 * z0) + dsimp only [oxw] + rw [hdw1, hox1] + omega + +theorem arith_fb_te {c k z0 z1 m1' fz2 : Nat} + (_hc : 1 ≤ c) (_hk1 : 1 ≤ k) (hkc : k ≤ 2 * c + 3) + (_hfz0 : 35 ≤ z0) (_hcz : 42 ≤ c + z0) (_hkz : 73 ≤ k + 2 * z0) + (_hz1 : 40 ≤ z1) (_hfz2 : 40 ≤ fz2) + (_hmrg : 2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + (m1' + 1)) : + ox (k + 2 * z0) (c + z0) ≤ + ox ((k + 2 * z0 + 3) + (m1' + 1) + 2 * z1 + 5 + 2 * fz2) (c + z0 + 3 + z1 + 2 + fz2) ∧ + odw (k + 2 * z0) (c + z0) ≤ + odw ((k + 2 * z0 + 3) + (m1' + 1) + 2 * z1 + 5 + 2 * fz2) (c + z0 + 3 + z1 + 2 + fz2) ∧ + oxw (k + 2 * z0) (c + z0) ≤ + oxw ((k + 2 * z0 + 3) + (m1' + 1) + 2 * z1 + 5 + 2 * fz2) (c + z0 + 3 + z1 + 2 + fz2) := by + obtain ⟨q1, r1, hr1, heq1, hox1⟩ := ox_spec_lt (kz := k + 2 * z0) (cz := c + z0) (by omega) + obtain ⟨q2, r2, hr2, heq2, hox2⟩ := + ox_spec_lt (kz := (k + 2 * z0 + 3) + (m1' + 1) + 2 * z1 + 5 + 2 * fz2) (cz := + c + z0 + 3 + z1 + 2 + fz2) (by omega) + obtain ⟨qw1, rw1, hrw1, hkw1, hdw1⟩ := div20_spec (k + 2 * z0) + obtain ⟨qw2, rw2, hrw2, hkw2, hdw2⟩ := + div20_spec ((k + 2 * z0 + 3) + (m1' + 1) + 2 * z1 + 5 + 2 * fz2) + dsimp only [odw, oxw] + rw [hdw1, hdw2, hox1, hox2] + omega + +theorem arith_fb_m1_ev {c k z0 fz1 dx : Nat} + (_hc : 1 ≤ c) (_hk1 : 1 ≤ k) (hkc : k ≤ 2 * c + 3) + (_hfz0 : 35 ≤ z0) (_hcz : 42 ≤ c + z0) (_hkz : 73 ≤ k + 2 * z0) + (_hfz1 : 40 ≤ fz1) (_hdx : dx ≤ 1) : + ox (k + 2 * z0) (c + z0) ≤ c + z0 + dx ∧ + 30 * ox (k + 2 * z0) (c + z0) ≤ (k + 2 * z0 + 4 + fz1) + 27 * (c + z0 + dx) + 900 ∧ + 60 * ox (k + 2 * z0) (c + z0) + 120 ≤ 2 * (k + 2 * z0 + 4 + fz1) + 55 * (c + z0 + dx) ∧ + 10 * oxw (k + 2 * z0) (c + z0) + 40 ≤ 9 * (k + 2 * z0 + 4 + fz1) + 10 * (c + z0 + dx) ∧ + 20 * oxw (k + 2 * z0) (c + z0) ≤ (k + 2 * z0 + 4 + fz1) + 20 * (c + z0 + dx) + 800 := by + obtain ⟨q1, r1, hr1, heq1, hox1⟩ := ox_spec_lt (kz := k + 2 * z0) (cz := c + z0) (by omega) + obtain ⟨qw1, rw1, hrw1, hkw1, hdw1⟩ := div20_spec (k + 2 * z0) + dsimp only [oxw] + rw [hdw1, hox1] + omega + +theorem arith_fb_os_r10 {c k z0 y1 phi1 fz4 : Nat} + (_hc : 1 ≤ c) (_hk1 : 1 ≤ k) (hkc : k ≤ 2 * c + 3) + (_hfz0 : 35 ≤ z0) (_hcz : 42 ≤ c + z0) (_hkz : 73 ≤ k + 2 * z0) + (_hy1_lo : 9 * ((k + 2 * z0) / 10) - 2 ≤ y1) + (_hy1_hi : y1 ≤ 2 * (c + z0) + 3) + (_hphi1 : 38 ≤ phi1) + (_hyw : k + 2 * z0 + 35 ≤ y1 + phi1) + (_hfz4 : phi1 + 2 ≤ fz4) : + ox (k + 2 * z0) (c + z0) ≤ ox (y1 + 2 + 2 * fz4) (c + z0 + 1 + fz4) ∧ + odw (k + 2 * z0) (c + z0) ≤ odw (y1 + 2 + 2 * fz4) (c + z0 + 1 + fz4) ∧ + oxw (k + 2 * z0) (c + z0) ≤ oxw (y1 + 2 + 2 * fz4) (c + z0 + 1 + fz4) := by + obtain ⟨q1, r1, hr1, heq1, hox1⟩ := ox_spec_lt (kz := k + 2 * z0) (cz := c + z0) (by omega) + obtain ⟨q4, r4, hr4, heq4, hox4⟩ := ox_spec_lt (kz := y1 + 2 + 2 * fz4) (cz := + c + z0 + 1 + fz4) (by omega) + obtain ⟨q10, r10, hr10, hkz10, hdw10⟩ := div10_spec (k + 2 * z0) + obtain ⟨qw1, rw1, hrw1, hkw1, hdw1⟩ := div20_spec (k + 2 * z0) + obtain ⟨qw4, rw4, hrw4, hkw4, hdw4⟩ := div20_spec (y1 + 2 + 2 * fz4) + rw [hdw10] at _hy1_lo + dsimp only [odw, oxw] + rw [hdw1, hdw4, hox1, hox4] + omega + +theorem arith_fb_os_r11 {c k z0 y1 phi1 fz4 : Nat} + (_hc : 1 ≤ c) (_hk1 : 1 ≤ k) (hkc : k ≤ 2 * c + 3) + (_hfz0 : 35 ≤ z0) (_hcz : 42 ≤ c + z0) (_hkz : 73 ≤ k + 2 * z0) + (_hyw : k + 2 * z0 + 35 ≤ y1 + phi1) + (_hfz4 : phi1 + 2 ≤ fz4) : + ox (k + 2 * z0) (c + z0) ≤ c + z0 - 1 ∧ + 30 * ox (k + 2 * z0) (c + z0) ≤ (y1 + fz4) + 27 * (c + z0 - 1) + 900 ∧ + 60 * ox (k + 2 * z0) (c + z0) + 120 ≤ 2 * (y1 + fz4) + 55 * (c + z0 - 1) ∧ + 10 * oxw (k + 2 * z0) (c + z0) + 40 ≤ 9 * (y1 + fz4) + 10 * (c + z0 - 1) ∧ + 20 * oxw (k + 2 * z0) (c + z0) ≤ (y1 + fz4) + 20 * (c + z0 - 1) + 800 := by + obtain ⟨q1, r1, hr1, heq1, hox1⟩ := ox_spec_lt (kz := k + 2 * z0) (cz := c + z0) (by omega) + obtain ⟨qw1, rw1, hrw1, hkw1, hdw1⟩ := div20_spec (k + 2 * z0) + dsimp only [oxw] + rw [hdw1, hox1] + omega + +theorem arith_lb_r10 {c k fz x tx txw y phi fz3 : Nat} + (_hc : 2 ≤ c) (_hk1 : 1 ≤ k) (hkc : k ≤ 2 * c + 3) (_hfz : 40 ≤ fz) + (_htx21 : 21 ≤ tx) (_htx_x : tx ≤ x) + (_hi1 : 30 * tx ≤ (c + fz) + 27 * x + 900) + (_hi2 : 60 * tx + 120 ≤ 2 * (c + fz) + 55 * x) + (_hi3 : 10 * txw + 40 ≤ 9 * (c + fz) + 10 * x) + (_hi4 : 20 * txw ≤ (c + fz) + 20 * x + 800) + (_hy_lo : ox (k + 2 * fz) (c + fz) ≤ y) + (_hy_hi : y ≤ 2 * x + 3) + (_hphi38 : 38 ≤ phi) + (_hyw : oxw (k + 2 * fz) (c + fz) ≤ y + phi) + (_hfz3 : phi + 2 ≤ fz3) : + tx ≤ ox (y + 2 + 2 * fz3) (x + 1 + fz3) ∧ + tx - 1 ≤ odw (y + 2 + 2 * fz3) (x + 1 + fz3) ∧ + txw ≤ oxw (y + 2 + 2 * fz3) (x + 1 + fz3) := by + obtain ⟨q2, r2, hr2, heq2, hox2⟩ := ox_spec_lt (kz := k + 2 * fz) (cz := c + fz) (by omega) + obtain ⟨q3, r3, hr3, heq3, hox3⟩ := ox_spec_lt (kz := y + 2 + 2 * fz3) (cz := + x + 1 + fz3) (by omega) + obtain ⟨qw2, rw2, hrw2, hkw2, hdw2⟩ := div20_spec (k + 2 * fz) + obtain ⟨qw3, rw3, hrw3, hkw3, hdw3⟩ := div20_spec (y + 2 + 2 * fz3) + dsimp only [oxw] at _hyw + rw [hdw2] at _hyw + rw [hox2] at _hy_lo + dsimp only [odw, oxw] + rw [hdw3, hox3] + omega + +theorem arith_lb_r11 {c k fz x tx txw y phi fz3 : Nat} + (_hc : 2 ≤ c) (_hk1 : 1 ≤ k) (hkc : k ≤ 2 * c + 3) (_hfz : 40 ≤ fz) + (_htx21 : 21 ≤ tx) (_htx_x : tx ≤ x) + (_hi1 : 30 * tx ≤ (c + fz) + 27 * x + 900) + (_hi2 : 60 * tx + 120 ≤ 2 * (c + fz) + 55 * x) + (_hi3 : 10 * txw + 40 ≤ 9 * (c + fz) + 10 * x) + (_hi4 : 20 * txw ≤ (c + fz) + 20 * x + 800) + (_hy_lo : ox (k + 2 * fz) (c + fz) ≤ y) + (_hy_hi : y ≤ 2 * x + 4) + (_hphi38 : 38 ≤ phi) + (_hyw : oxw (k + 2 * fz) (c + fz) ≤ y + phi) + (_hfz3 : phi + 2 ≤ fz3) : + 5 ≤ y ∧ + tx ≤ x - 1 ∧ + 30 * tx ≤ (y + fz3) + 27 * (x - 1) + 900 ∧ + 60 * tx + 120 ≤ 2 * (y + fz3) + 55 * (x - 1) ∧ + 10 * txw + 40 ≤ 9 * (y + fz3) + 10 * (x - 1) ∧ + 20 * txw ≤ (y + fz3) + 20 * (x - 1) + 800 := by + obtain ⟨q2, r2, hr2, heq2, hox2⟩ := ox_spec_lt (kz := k + 2 * fz) (cz := c + fz) (by omega) + obtain ⟨qw2, rw2, hrw2, hkw2, hdw2⟩ := div20_spec (k + 2 * fz) + dsimp only [oxw] at _hyw + rw [hdw2] at _hyw + rw [hox2] at _hy_lo + omega + +-- ============================================================================ +-- Pre-Pop Bounce Predicate & R9/R10/R11 Pop Dispatcher +-- ============================================================================ + +inductive IsBounce : Nat → List Nat → SegState → Prop where + | nil {zl cp1 kb mrg : Nat} {ds : List Nat} + (hphi : 230 ≤ cp1 + zl) : + IsBounce (cp1 + zl) ds ⟨true, [], zl, cp1, kb, mrg, ds⟩ + | cons {z0 m zl cp1 kb mrg : Nat} {rest : List (Nat × Nat)} {ds : List Nat} + (hv : ValidSegs40 rest zl) + (hphi : 16 ≤ cp1 + z0) + (hnm : if (m + 1) % 2 = 1 then mrg < kb + m else mrg < kb + (m + 1)) : + IsBounce (cp1 + z0) ds ⟨true, (z0, m + 1) :: rest, zl, cp1, kb, mrg, ds⟩ + +theorem isBounce_step {phi : Nat} {ds : List Nat} {s : SegState} + (hb : IsBounce phi ds s) (hg_pop : drainPopGuards phi ds = true) : + stepGuards s = true ∧ 16 ≤ phi ∧ + ∃ hp m_rem rest zl, + (hp = true → ValidSegs40 rest zl) ∧ + (hp = false → 230 ≤ phi) ∧ + stepSegs s = drainPopStep hp phi m_rem rest zl ds := by + cases hb with + | @nil zl cp1 kb mrg ds hphi => + refine ⟨hg_pop, by omega, false, 0, [], zl, ?_, ?_, rfl⟩ + · intro h; cases h + · intro _; exact hphi + | @cons z0 m zl cp1 kb mrg rest ds hv hphi hnm => + refine ⟨?_, hphi, true, kb + (m + 1) - (mrg + 2), rest, zl, ?_, ?_, ?_⟩ + · dsimp only [stepGuards] + rcases dec_or ((m + 1) % 2 = 1) with hod | hev + · rw [if_pos hod] at hnm ⊢ + rw [decide_eq_false (by omega)]; exact hg_pop + · rw [if_neg hev] at hnm ⊢ + rw [decide_eq_false (by omega)]; exact hg_pop + · intro _; exact hv + · intro h; cases h + · dsimp only [stepSegs] + rcases dec_or ((m + 1) % 2 = 1) with hod | hev + · rw [if_pos hod] at hnm ⊢ + rw [decide_eq_false (by omega)]; rfl + · rw [if_neg hev] at hnm ⊢ + rw [decide_eq_false (by omega)]; rfl + +def Exit (tx tdw txw : Nat) (S : List Nat) (s : SegState) : Prop := + (∃ phi, tdw ≤ phi ∧ IsBounce phi S s) ∨ + (∃ y phi, tx ≤ y ∧ 38 ≤ phi ∧ txw ≤ y + phi ∧ IsBounce phi (y :: S) s) + +theorem exit_mono {tx1 tdw1 txw1 tx2 tdw2 txw2 : Nat} {S : List Nat} {s : SegState} + (he : Exit tx2 tdw2 txw2 S s) + (h1 : tx1 ≤ tx2) (h2 : tdw1 ≤ tdw2) (h3 : txw1 ≤ txw2) : + Exit tx1 tdw1 txw1 S s := by + rcases he with ⟨phi, hp, hb⟩ | ⟨y, phi, hy, hp38, hyw, hb⟩ + · exact Or.inl ⟨phi, Nat.le_trans h2 hp, hb⟩ + · exact Or.inr ⟨y, phi, Nat.le_trans h1 hy, hp38, Nat.le_trans h3 hyw, hb⟩ + +theorem drainPop_two (hp : Bool) (phi m_rem zl y x : Nat) (rest : List (Nat × Nat)) (S : List Nat) + (hy : 19 ≤ y) (hx : 19 ≤ x) (hphi : 16 ≤ phi) + (hg1 : GoodDs ((x - 1) :: S) = true) + (hg2 : y % 2 = 0 ∧ y + 14 ≤ 2 * x → GoodDs ((x - 2) :: S) = true) : + drainPopGuards phi (y :: x :: S) = true ∧ + drainPopStep hp phi m_rem rest zl (y :: x :: S) = + let p := pushSeg hp (phi + 2) m_rem rest zl + ⟨true, (0, y - 3) :: p.1, p.2, x - 1, 0, 2 * x, S⟩ := by + have hnrst : isDrainRstDs (y :: x :: S) = false := by + cases x with + | zero => omega + | succ _ => rfl + have hnr0 : isRank0 (y :: x :: S) = false := by + rcases y with _ | _ | _ | _ <;> try omega + rfl + refine ⟨?_, ?_⟩ + · dsimp only [drainPopGuards] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true] + have hc1 : decide (y ≥ 3 ∧ x ≥ 1) = true := decide_eq_true (by omega) + have hc2 : (!decide (y % 2 = 0 ∧ y ≤ 2 * x + 4) || GoodDs ((x - 1) :: S)) = true := by + rw [hg1, Bool.or_true] + have hc3 : (!decide (y % 2 = 0 ∧ y + 14 ≤ 2 * x) || GoodDs ((x - 2) :: S)) = true := by + rcases dec_or (y % 2 = 0 ∧ y + 14 ≤ 2 * x) with h | h + · rw [hg2 h, Bool.or_true] + · rw [decide_eq_false h]; rfl + have hc4 : decide (phi ≥ 16) = true := decide_eq_true (by omega) + rw [hc1, hc2, hc3, hc4]; rfl + · dsimp only [drainPopStep] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true] + rw [if_neg (by omega)] + have hnorm : normSeg 0 (y - 3) = (0, y - 3) := by + dsimp only [normSeg]; rw [if_neg (by omega)] + rw [hnorm] + +theorem amega_pop_step {N x y phi : Nat} {S : List Nat} {sb : SegState} {P : SegState → Prop} + (hb : IsBounce phi (y :: x :: S) sb) + (hphi38 : 38 ≤ phi) (hy : 19 ≤ y) (hx : 19 ≤ x) + (hg1 : GoodDs ((x - 1) :: S) = true) + (hg2 : y % 2 = 0 ∧ y + 14 ≤ 2 * x → GoodDs ((x - 2) :: S) = true) + (hr9 : 2 * x + 5 ≤ y → ∀ m, m < N → ∀ p1 p2, ValidSegs40 p1 p2 → phi + 2 ≤ fzOf p1 p2 → + ChainLeadsUpTo m ⟨true, (0, y - 3) :: p1, p2, x - 1, 0, 2 * x, S⟩ P) + (hr10 : y ≤ 2 * x + 3 → y % 2 = 1 → ∀ m, m < N → ∀ p1 p2, ValidSegs40 p1 p2 → + phi + 2 ≤ fzOf p1 p2 → + ChainLeadsUpTo m ⟨false, p1, p2, x + 1, y + 2, 0, S⟩ P) + (hr11 : y ≤ 2 * x + 4 → y % 2 = 0 → ∀ m, m < N → ∀ p1 p2, ValidSegs40 p1 p2 → + phi + 2 ≤ fzOf p1 p2 → + ChainLeadsUpTo m ⟨false, p1, p2, y, 1, 0, (x - 1) :: S⟩ P) : + ChainLeadsUpTo N sb P := by + have hg_pop : drainPopGuards phi (y :: x :: S) = true := + (drainPop_two false phi 0 0 y x [] S hy hx (by omega) hg1 hg2).1 + obtain ⟨hg_sb, _, hp, m_rem, rest, zl, hv_rest, hzl_false, hstep_sb⟩ := isBounce_step hb hg_pop + have hdp_eq := (drainPop_two hp phi m_rem zl y x rest S hy hx (by omega) hg1 hg2).2 + rw [hdp_eq] at hstep_sb + set p := pushSeg hp (phi + 2) m_rem rest zl + have hvp : ValidSegs40 p.1 p.2 := + validSegs40_pushSeg hp (by omega) hv_rest (fun hf => by have := hzl_false hf; omega) + have hfzp : phi + 2 ≤ fzOf p.1 p.2 := fzOf_pushSeg_ge hp (phi + 2) m_rem rest zl + apply chainLeadsUpTo_step hg_sb + intro m hm + rw [hstep_sb] + rcases dec_or (2 * x + 5 ≤ y) with hbig | hsmall + · exact hr9 hbig m hm p.1 p.2 hvp hfzp + · have hy_sub : y - 3 = (y - 4) + 1 := by omega + rcases dec_or (y % 2 = 1) with hy_odd | hy_even + · have hm_ev : ¬(((y - 4) + 1) % 2 = 1) := by omega + have hmrg : decide (2 * x ≥ 0 + ((y - 4) + 1)) = true := decide_eq_true (by omega) + have hg_mid : stepGuards ⟨true, (0, y - 3) :: p.1, p.2, x - 1, 0, 2 * x, S⟩ = true := by + rw [hy_sub] + dsimp only [stepGuards] + rw [if_neg hm_ev, hmrg, if_pos rfl] + have hs_mid : stepSegs ⟨true, (0, y - 3) :: p.1, p.2, x - 1, 0, 2 * x, S⟩ = + ⟨false, p.1, p.2, x + 1, y + 2, 0, S⟩ := by + rw [hy_sub] + dsimp only [stepSegs] + rw [if_neg hm_ev, hmrg, if_pos rfl] + have hc : x - 1 + 0 + 2 = x + 1 := by omega + have hk : 0 + (y - 4 + 1) + 2 * 0 + 5 = y + 2 := by omega + rw [hc, hk] + apply chainLeadsUpTo_step1 hg_mid + rw [hs_mid] + exact hr10 (by omega) hy_odd m hm p.1 p.2 hvp hfzp + · have hm_od : ((y - 4) + 1) % 2 = 1 := by omega + have hmrg : decide (2 * x ≥ 0 + (y - 4)) = true := decide_eq_true (by omega) + have hg_mid : stepGuards ⟨true, (0, y - 3) :: p.1, p.2, x - 1, 0, 2 * x, S⟩ = true := by + rw [hy_sub] + dsimp only [stepGuards] + rw [if_pos hm_od, hmrg, if_pos rfl] + simpa only [Nat.add_zero] using hg1 + have hs_mid : stepSegs ⟨true, (0, y - 3) :: p.1, p.2, x - 1, 0, 2 * x, S⟩ = + ⟨false, p.1, p.2, y, 1, 0, (x - 1) :: S⟩ := by + rw [hy_sub] + dsimp only [stepSegs] + rw [if_pos hm_od, hmrg, if_pos rfl] + have hc : 0 + (y - 4) + 2 * 0 + 4 = y := by omega + have hx0 : x - 1 + 0 = x - 1 := by omega + rw [hc, hx0] + apply chainLeadsUpTo_step1 hg_mid + rw [hs_mid] + exact hr11 (by omega) (by omega) m hm p.1 p.2 hvp hfzp + +theorem isBounce_r9 {x y : Nat} {p1 : List (Nat × Nat)} {p2 : Nat} {S : List Nat} + (hx : 19 ≤ x) (hbig : 2 * x + 5 ≤ y) (hvp : ValidSegs40 p1 p2) : + IsBounce (x - 1) S ⟨true, (0, y - 3) :: p1, p2, x - 1, 0, 2 * x, S⟩ := by + have hy_sub : y - 3 = (y - 4) + 1 := by omega + rw [hy_sub] + have h := IsBounce.cons (z0 := 0) (m := y - 4) (zl := p2) (cp1 := x - 1) (kb := 0) + (mrg := 2 * x) (rest := p1) (ds := S) hvp (by omega) + (by split_ifs <;> omega) + simpa only [Nat.add_zero] using h + +-- ============================================================================ +-- Main Fuel-Indexed Excursion Bundle (`FBound N ∧ LoopBound N`) +-- ============================================================================ + +def FBound (N : Nat) : Prop := + ∀ ms S segs zl c k, + 19 ≤ ms → SafeStack ms S → + ValidTail40 segs zl → + 1 ≤ c → 1 ≤ k → k ≤ 2 * c + 3 → + 35 ≤ fzOf segs zl → + 42 ≤ c + fzOf segs zl → + 73 ≤ k + 2 * fzOf segs zl → + ms + 2 ≤ ox (k + 2 * fzOf segs zl) (c + fzOf segs zl) → + ChainLeadsUpTo N ⟨false, segs, zl, c, k, 0, S⟩ + (Exit (ox (k + 2 * fzOf segs zl) (c + fzOf segs zl)) + (odw (k + 2 * fzOf segs zl) (c + fzOf segs zl)) + (oxw (k + 2 * fzOf segs zl) (c + fzOf segs zl)) S) + +def LoopBound (N : Nat) : Prop := + ∀ ms S segs zl c k x tx txw, + 19 ≤ ms → SafeStack ms S → + (S ≠ [1] ∨ 5 ≤ c) → + ValidSegs40 segs zl → + 2 ≤ c → 1 ≤ k → k ≤ 2 * c + 3 → + ms + 2 ≤ tx → tx ≤ x → + 30 * tx ≤ (c + fzOf segs zl) + 27 * x + 900 → + 60 * tx + 120 ≤ 2 * (c + fzOf segs zl) + 55 * x → + 10 * txw + 40 ≤ 9 * (c + fzOf segs zl) + 10 * x → + 20 * txw ≤ (c + fzOf segs zl) + 20 * x + 800 → + ChainLeadsUpTo N ⟨false, segs, zl, c, k, 0, x :: S⟩ + (Exit tx (tx - 1) txw S) + +theorem excursion_bundle (N : Nat) : FBound N ∧ LoopBound N := by + induction N using Nat.strong_induction_on with + | h N ih => + have hFB : FBound N := by + intro ms S segs zl c k hms19 hS hvt hc hk1 hkc hfz35 hcz42 hkz73 hms_ox + obtain ⟨hox39, hox_cz3⟩ := ox_bounds_relaxed hc hk1 hkc hfz35 hcz42 hkz73 + rcases segs with _ | ⟨⟨z0, m0⟩, rest⟩ + · dsimp only [fzOf, ValidTail40] at hvt hfz35 hcz42 hkz73 hms_ox hox39 hox_cz3 ⊢ + have hg : stepGuards ⟨false, [], zl, c, k, 0, S⟩ = true := by + dsimp only [stepGuards] + rw [goodPhiW_of_ge35 hS.1 (by omega), Bool.true_and] + dsimp only [GoodPsi] + have hcz : c + zl - 1 + 1 = c + zl := by omega + rw [hcz]; exact hS.2.2 (c + zl) (by omega) + apply chainLeadsUpTo_step1 hg + dsimp only [stepSegs] + apply chainLeadsUpTo_here + obtain ⟨qw, rw_, hrw, hkw, hdw⟩ := div20_spec (k + 2 * zl) + refine Or.inr ⟨c + zl, k + 2 * zl + 2, by omega, by omega, ?_, ?_⟩ + · dsimp only [oxw]; rw [hdw]; omega + · simpa only [Nat.add_zero] using IsBounce.nil (zl := 0) (cp1 := k + 2 * zl + 2) (kb := 0) + (mrg := 2 * (k + 2 * zl) + 6) (ds := (c + zl) :: S) (by omega) + · dsimp only [fzOf, ValidTail40] at hvt hfz35 hcz42 hkz73 hms_ox hox39 hox_cz3 ⊢ + have hv_rest : ValidSegs40 rest zl := hvt + cases m0 with + | zero => + have hg1 : stepGuards ⟨false, (z0, 0) :: rest, zl, c, k, 0, S⟩ = true := rfl + apply chainLeadsUpTo_step hg1 + intro m1 hm1 + dsimp only [stepSegs] + rcases rest with _ | ⟨⟨z1, m1_seg⟩, rest2⟩ + · have hzl230 : 230 ≤ zl := hv_rest.2 + exact chainLeadsUpTo_here (Or.inl ⟨c + z0 + 3 + zl, by dsimp only [odw]; omega, + IsBounce.nil (by omega)⟩) + · have hz1_40 : 40 ≤ z1 := fzOf_ge_40 hv_rest + have hv_rest2 : ValidSegs40 rest2 zl := validSegs40_tail hv_rest + have hfz2_40 : 40 ≤ fzOf rest2 zl := fzOf_ge_40 hv_rest2 + cases m1_seg with + | zero => + have hg2 : stepGuards ⟨true, (z1, 0) :: rest2, zl, c + z0 + 3, k + 2 * z0 + + 3, 2 * (c + z0) + 8, S⟩ = true := by + dsimp only [stepGuards]; exact decide_eq_true (by omega) + apply chainLeadsUpTo_step hg2 + intro m2 hm2 + dsimp only [stepSegs] + have hmono := arith_fb_t0 hc hk1 hkc hfz35 hcz42 hkz73 hz1_40 hfz2_40 + exact chainLeadsUpTo_imp + ((ih m2 (by omega)).1 ms S rest2 zl (c + z0 + 3 + z1 + 1) (k + 2 * z0 + 3 + 2 * z1 + + 3) + hms19 hS (validTail40_of_validSegs40 hv_rest2) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) + (Nat.le_trans hms_ox hmono.1)) + (fun s' he => exit_mono he hmono.1 hmono.2.1 hmono.2.2) + | succ m1' => + rcases dec_or ((m1' + 1) % 2 = 1) with hm1_odd | hm1_even + · cases hd_mrg : decide (2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + m1') with + | true => + have hg2 : stepGuards ⟨true, (z1, m1' + 1) :: rest2, zl, c + z0 + 3, k + 2 * z0 + + 3, 2 * (c + z0) + 8, S⟩ = true := by + dsimp only [stepGuards] + rw [if_pos hm1_odd, hd_mrg, if_pos rfl] + exact hS.2.2 (c + z0 + 3 + z1) (by omega) + apply chainLeadsUpTo_step hg2 + intro m2 hm2 + dsimp only [stepSegs] + rw [if_pos hm1_odd, hd_mrg, if_pos rfl] + have hi := arith_fb_to (m1' := m1') hc hk1 hkc hfz35 hcz42 hkz73 hz1_40 hfz2_40 + exact (ih m2 (by omega)).2 ms S rest2 zl + ((k + 2 * z0 + 3) + m1' + 2 * z1 + 4) 1 (c + z0 + 3 + z1) + (ox (k + 2 * z0) (c + z0)) (oxw (k + 2 * z0) (c + z0)) + hms19 hS (Or.inr (by omega)) hv_rest2 + (by omega) (by omega) (by omega) hms_ox hi.1 + hi.2.1 hi.2.2.1 hi.2.2.2.1 hi.2.2.2.2 + | false => + have h_nm : ¬(2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + m1') := + of_decide_eq_false hd_mrg + exact chainLeadsUpTo_here (Or.inl ⟨c + z0 + 3 + z1, by dsimp only [odw]; omega, + IsBounce.cons hv_rest2 (by omega) (by rw [if_pos hm1_odd]; omega)⟩) + · cases hd_mrg : decide (2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + (m1' + 1)) with + | true => + have h_mrg : 2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + (m1' + 1) := + of_decide_eq_true hd_mrg + have hg2 : stepGuards ⟨true, (z1, m1' + 1) :: rest2, zl, c + z0 + 3, k + 2 * z0 + + 3, 2 * (c + z0) + 8, S⟩ = true := by + dsimp only [stepGuards] + rw [if_neg hm1_even, hd_mrg, if_pos rfl] + apply chainLeadsUpTo_step hg2 + intro m2 hm2 + dsimp only [stepSegs] + rw [if_neg hm1_even, hd_mrg, if_pos rfl] + have hmono := arith_fb_te hc hk1 hkc hfz35 hcz42 hkz73 hz1_40 hfz2_40 h_mrg + exact chainLeadsUpTo_imp + ((ih m2 (by omega)).1 ms S rest2 zl (c + z0 + 3 + z1 + 2) ((k + 2 * z0 + 3) + + (m1' + 1) + 2 * z1 + 5) + hms19 hS (validTail40_of_validSegs40 hv_rest2) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) + (Nat.le_trans hms_ox hmono.1)) + (fun s' he => exit_mono he hmono.1 hmono.2.1 hmono.2.2) + | false => + have h_nm : ¬(2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + (m1' + 1)) := + of_decide_eq_false hd_mrg + exact chainLeadsUpTo_here (Or.inl ⟨c + z0 + 3 + z1, by dsimp only [odw]; omega, + IsBounce.cons hv_rest2 (by omega) (by rw [if_neg hm1_even]; omega)⟩) + | succ m' => + have hfz1_40 : 40 ≤ fzOf rest zl := fzOf_ge_40 hv_rest + have hphiw : GoodPhiW (c + z0 - 1) S false = true := goodPhiW_of_ge35 hS.1 (by omega) + rcases dec_or (m' + 1 = 1) with hm1 | hm_gt1 + · have hm0_eq : m' = 0 := by omega + subst hm0_eq + have hg : stepGuards ⟨false, (z0, 1) :: rest, zl, c, k, 0, S⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) S false && if 1 = 1 then GoodPsi (c + z0) S else _) = + true + rw [hphiw, Bool.true_and, if_pos rfl] + exact hS.2.2 (c + z0 + 1) (by omega) + apply chainLeadsUpTo_step hg + intro m1 hm1 + dsimp only [stepSegs] + change ChainLeadsUpTo m1 (if 1 = 1 then _ else _) _ + rw [if_pos rfl] + have hi := arith_fb_m1_ev (dx := 1) hc hk1 hkc hfz35 hcz42 hkz73 hfz1_40 (by decide) + exact (ih m1 hm1).2 ms S rest zl (k + 2 * z0 + 4) 1 (c + z0 + 1) + (ox (k + 2 * z0) (c + z0)) (oxw (k + 2 * z0) (c + z0)) + hms19 hS (Or.inr (by omega)) hv_rest + (by omega) (by omega) (by omega) hms_ox hi.1 + hi.2.1 hi.2.2.1 hi.2.2.2.1 hi.2.2.2.2 + · have hpsi_cz : GoodPsi (c + z0 - 1) S = true := by + dsimp only [GoodPsi] + have hcz_eq : c + z0 - 1 + 1 = c + z0 := by omega + rw [hcz_eq]; exact hS.2.2 (c + z0) (by omega) + rcases dec_or ((m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10) with hev_sm | hnot_ev + · have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, S⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) S false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) S && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else _) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, if_pos hev_sm] + apply chainLeadsUpTo_step hg + intro m1 hm1 + dsimp only [stepSegs] + change ChainLeadsUpTo m1 (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else _) _ + rw [if_neg hm_gt1, if_pos hev_sm] + have hi := arith_fb_m1_ev (dx := 0) hc hk1 hkc hfz35 hcz42 hkz73 hfz1_40 (by decide) + have hcz0 : c + z0 + 0 = c + z0 := by omega + rw [hcz0] at hi + exact (ih m1 hm1).2 ms S rest zl (k + 2 * z0 + 4) (m' + 2) (c + z0) + (ox (k + 2 * z0) (c + z0)) (oxw (k + 2 * z0) (c + z0)) + hms19 hS (Or.inr (by omega)) hv_rest + (by omega) (by omega) (by omega) hms_ox hi.1 + hi.2.1 hi.2.2.1 hi.2.2.2.1 hi.2.2.2.2 + · rcases dec_or ((m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11) with hod_sm | hbig_m + · have hS_cz : SafeStack 39 ((c + z0) :: S) := safeStack_cons hS (by omega) (by omega) + have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, S⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) S false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) S && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then + GoodDs ((k + 2 * z0 + 2) :: (c + z0) :: S) else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_pos hod_sm] + exact hS_cz.2.2 (k + 2 * z0 + 2) (by omega) + apply chainLeadsUpTo_step hg + intro m1 hm1 + dsimp only [stepSegs] + change ChainLeadsUpTo m1 (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_pos hod_sm] + obtain ⟨q10, r10, hr10, hkz10, hdw10⟩ := div10_spec (k + 2 * z0) + have hos_in : 39 + 2 ≤ 9 * q10 - 2 ∧ 9 * q10 - 2 ≤ k + 2 * z0 + 2 ∧ + 30 * (9 * q10 - 2) ≤ (m' + fzOf rest zl) + 27 * (k + 2 * z0 + 2) + 900 ∧ + 60 * (9 * q10 - 2) + 120 ≤ 2 * (m' + fzOf rest zl) + 55 * (k + 2 * z0 + 2) ∧ + 10 * (k + 2 * z0 + 35) + 40 ≤ 9 * (m' + fzOf rest zl) + 10 * (k + 2 * z0 + 2) ∧ + 20 * (k + 2 * z0 + 35) ≤ (m' + fzOf rest zl) + 20 * (k + 2 * z0 + 2) + 800 := by + omega + have hm_sub : m' + 1 - 1 = m' := by omega + rw [hm_sub] + have hne1_cz : ((c + z0) :: S) ≠ [1] := by intro h; injection h with h1; omega + have h_loop1 := (ih m1 hm1).2 39 ((c + z0) :: S) rest zl m' 1 + (k + 2 * z0 + 2) (9 * q10 - 2) (k + 2 * z0 + 35) + (by decide) hS_cz (Or.inl hne1_cz) hv_rest + (by omega) (by omega) (by omega) hos_in.1 hos_in.2.1 + hos_in.2.2.1 hos_in.2.2.2.1 hos_in.2.2.2.2.1 hos_in.2.2.2.2.2 + refine chainLeadsUpTo_trans h_loop1 ?_ + intro m2 s_mid hm2 hexit1 + rcases hexit1 with ⟨phi1, hphi1, hb1⟩ | ⟨y1, phi1, hy1_tx1, hphi1_38, hyw1, hb1⟩ + · apply chainLeadsUpTo_here + obtain ⟨qw, rw_, hrw, hkw, hdw⟩ := div20_spec (k + 2 * z0) + refine Or.inr ⟨c + z0, phi1, by omega, by omega, ?_, hb1⟩ + dsimp only [oxw]; rw [hdw]; omega + · exact amega_pop_step hb1 hphi1_38 (by omega) (by omega) + (hS.2.2 (c + z0 - 1) (by omega)) + (fun _ => hS.2.2 (c + z0 - 2) (by omega)) + (fun hbig _ _ p1 p2 hvp _ => + chainLeadsUpTo_here (Or.inl ⟨c + z0 - 1, by dsimp only [odw]; omega, + isBounce_r9 (by omega) hbig hvp⟩)) + (fun hy1_le _ m3 hm3 p1 p2 hvp hfzp => by + have hy1_lo : 9 * ((k + 2 * z0) / 10) - 2 ≤ y1 := by rw [hdw10]; exact hy1_tx1 + have hmono := + arith_fb_os_r10 hc hk1 hkc hfz35 hcz42 hkz73 hy1_lo hy1_le hphi1_38 hyw1 + hfzp + exact chainLeadsUpTo_imp + ((ih m3 (by omega)).1 ms S p1 p2 (c + z0 + 1) (y1 + 2) hms19 hS + (validTail40_of_validSegs40 hvp) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) + (Nat.le_trans hms_ox hmono.1)) + (fun s' he => exit_mono he hmono.1 hmono.2.1 hmono.2.2)) + (fun hy1_le _ m3 hm3 p1 p2 hvp hfzp => by + have hi := arith_fb_os_r11 hc hk1 hkc hfz35 hcz42 hkz73 hyw1 hfzp + exact (ih m3 (by omega)).2 ms S p1 p2 y1 1 (c + z0 - 1) + (ox (k + 2 * z0) (c + z0)) (oxw (k + 2 * z0) (c + z0)) + hms19 hS (Or.inr (by omega)) hvp + (by omega) (by omega) (by omega) hms_ox hi.1 + hi.2.1 hi.2.2.1 hi.2.2.2.1 hi.2.2.2.2) + · have hm0_big : 2 * (k + 2 * z0) + 12 ≤ m' + 1 := by omega + have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, S⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) S false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) S && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_neg hbig_m] + apply chainLeadsUpTo_step1 hg + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_neg hbig_m] + have hnorm : normSeg 0 (m' + 1 - 4) = (0, (m' - 4) + 1) := by + dsimp only [normSeg]; rw [if_neg (by omega)]; congr 1; omega + rw [hnorm] + apply chainLeadsUpTo_here + obtain ⟨qw, rw_, hrw, hkw, hdw⟩ := div20_spec (k + 2 * z0) + refine Or.inr ⟨c + z0, k + 2 * z0 + 2, by omega, by omega, ?_, ?_⟩ + · dsimp only [oxw]; rw [hdw]; omega + · have hbc := IsBounce.cons (z0 := 0) (m := m' - 4) (zl := zl) + (cp1 := k + 2 * z0 + 2) (kb := 0) (mrg := 2 * (k + 2 * z0) + 6) + (rest := rest) (ds := (c + z0) :: S) hv_rest (by omega) + (by split_ifs <;> omega) + simpa only [Nat.add_zero] using hbc + have hLB : LoopBound N := by + intro ms S segs zl c k x tx txw hms19 hS hSc5 hv hc hk1 hkc hms_tx htx_x hi1 hi2 hi3 hi4 + have hfz40 : 40 ≤ fzOf segs zl := fzOf_ge_40 hv + have hox39 : 39 ≤ ox (k + 2 * fzOf segs zl) (c + fzOf segs zl) := + (ox_bounds_relaxed (by omega) hk1 hkc (by omega) (by omega) (by omega)).1 + have hfb : ChainLeadsUpTo N ⟨false, segs, zl, c, k, 0, x :: S⟩ + (Exit (ox (k + 2 * fzOf segs zl) (c + fzOf segs zl)) + (odw (k + 2 * fzOf segs zl) (c + fzOf segs zl)) + (oxw (k + 2 * fzOf segs zl) (c + fzOf segs zl)) (x :: S)) := by + rcases hSc5 with hne1 | hc5 + · exact hFB 19 (x :: S) segs zl c k (by decide) + (safeStack_cons_ne1 hne1 hS (by omega) (by omega)) + (validTail40_of_validSegs40 hv) + (by omega) hk1 hkc (by omega) (by omega) (by omega) (by omega) + · have hox41 := ox_ge41_of_c5 hc5 hk1 hkc hfz40 + exact hFB 39 (x :: S) segs zl c k (by decide) + (safeStack_cons hS (by omega) (by omega)) + (validTail40_of_validSegs40 hv) + (by omega) hk1 hkc (by omega) (by omega) (by omega) hox41 + refine chainLeadsUpTo_trans hfb ?_ + intro m1 s_mid hm1 hexit + rcases hexit with ⟨phi, hphi_odw, hb⟩ | ⟨y, phi, hy_ox, hphi38, hyw, hb⟩ + · apply chainLeadsUpTo_here + obtain ⟨q, r, hr, heq, hox⟩ := + ox_spec_lt (kz := k + 2 * fzOf segs zl) (cz := c + fzOf segs zl) (by omega) + dsimp only [odw] at hphi_odw + rw [hox] at hphi_odw hox39 + exact Or.inr ⟨x, phi, htx_x, by omega, by omega, hb⟩ + · exact amega_pop_step hb hphi38 (by omega) (by omega) + (hS.2.2 (x - 1) (by omega)) (fun _ => hS.2.2 (x - 2) (by omega)) + (fun hbig _ _ p1 p2 hvp _ => + chainLeadsUpTo_here (Or.inl ⟨x - 1, by omega, isBounce_r9 (by omega) hbig hvp⟩)) + (fun hy_le _ m2 hm2 p1 p2 hvp hfzp => by + have hmono := arith_lb_r10 hc hk1 hkc hfz40 (by omega) htx_x + hi1 hi2 hi3 hi4 hy_ox hy_le hphi38 hyw hfzp + exact chainLeadsUpTo_imp + ((ih m2 (by omega)).1 ms S p1 p2 (x + 1) (y + 2) hms19 hS + (validTail40_of_validSegs40 hvp) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) + (Nat.le_trans hms_tx hmono.1)) + (fun s' he => exit_mono he hmono.1 hmono.2.1 hmono.2.2)) + (fun hy_le _ m2 hm2 p1 p2 hvp hfzp => by + have hr11 := arith_lb_r11 hc hk1 hkc hfz40 (by omega) htx_x + hi1 hi2 hi3 hi4 hy_ox hy_le hphi38 hyw hfzp + exact (ih m2 (by omega)).2 ms S p1 p2 y 1 (x - 1) tx txw + hms19 hS (Or.inr hr11.1) hvp + (by omega) (by omega) (by omega) hms_tx hr11.2.1 + hr11.2.2.1 hr11.2.2.2.1 hr11.2.2.2.2.1 hr11.2.2.2.2.2) + exact ⟨hFB, hLB⟩ + + +-- ============================================================================ +-- Section 5g.3a: SafeStack Bases & High-Excursion Bundle (`FHigh`, `LoopHigh`, `LoopOS`) +-- ============================================================================ + +theorem safeStack_nil : SafeStack 19 [] := by + refine ⟨(by intro h; cases h), rfl, ?_⟩ + intro u hu + dsimp only [GoodDs, GoodDsAux, GoodDs1] + exact decide_eq_true (by omega) + +theorem safeStack_zero : SafeStack 19 [0] := by + refine ⟨(by intro h; injection h with h1; omega), rfl, ?_⟩ + intro u hu + dsimp only [GoodDs, GoodDsAux, GoodDs2] + rw [if_pos rfl] + exact decide_eq_true (by omega) + +theorem safeStack_one : SafeStack 25 [1] := by + refine ⟨(by intro h; injection h with h1; omega), rfl, ?_⟩ + intro u hu + dsimp only [GoodDs, GoodDsAux, GoodDs2] + rw [if_neg (by decide), if_pos rfl] + exact decide_eq_true (by omega) + +theorem safeStack_31 : SafeStack 19 [3, 1] := by + refine ⟨(by intro h; injection h with _ h2; cases h2), rfl, ?_⟩ + intro u hu + dsimp only [GoodDs] + rw [GoodDsAux.eq_3, if_neg (by decide)] + have h1 : decide (3 = 3 ∧ 1 = 1 ∧ ([] : List Nat) = [] ∧ u < 19) = false := + decide_eq_false (by omega) + have h2 : isOddDrainDs [3, 1] = false := rfl + have h3 : decide (3 ≥ 25 ∧ 1 = 1 ∧ ([] : List Nat) = [] ∧ u < 39) = false := rfl + have h4 : decide (u < 17) = false := decide_eq_false (by omega) + have h5 : GoodDsAux 3 [1] = true := rfl + have h6 : decide (u % 2 = 0 ∧ u ≤ 2 * 3 + 4) = false := decide_eq_false (by omega) + have h7 : decide (u % 2 = 0 ∧ u + 14 ≤ 2 * 3) = false := decide_eq_false (by omega) + rw [h1, h2, h3, h4, h5, h6, h7] + simp only [Bool.false_and, Bool.not_true, Bool.or_false, + Bool.false_eq_true, ite_false] + +theorem safeStack_x_31 {x : Nat} (hx20 : 20 ≤ x) (hx22 : x ≤ 22) : + SafeStack 39 [x, 3, 1] := by + have hgx : GoodDs [x, 3, 1] = true := safeStack_31.2.2 x (by omega) + have hgx1 : GoodDs [x - 1, 3, 1] = true := safeStack_31.2.2 (x - 1) (by omega) + refine ⟨(by intro h; injection h with _ h2; cases h2), hgx, ?_⟩ + intro u hu + dsimp only [GoodDs] + rw [GoodDsAux.eq_3, if_neg (by omega)] + have h1 : decide (x = 3 ∧ 3 = 1 ∧ [1] = [] ∧ u < 19) = false := decide_eq_false (by omega) + have h2 : isOddDrainDs [x, 3, 1] = false := rfl + have h3 : decide (x ≥ 25 ∧ 3 = 1 ∧ [1] = [] ∧ u < 39) = false := decide_eq_false (by omega) + have h4 : decide (u < 17) = false := decide_eq_false (by omega) + have h7 : decide (u % 2 = 0 ∧ u + 14 ≤ 2 * x) = false := decide_eq_false (by omega) + have hgx' : GoodDsAux x [3, 1] = true := hgx + have hgx1' : GoodDsAux (x - 1) [3, 1] = true := hgx1 + rw [h1, h2, h3, h4, hgx', hgx1', h7] + simp only [Bool.false_and, Bool.not_true, Bool.or_false, Bool.and_false, + Bool.false_eq_true, ite_false] + +theorem safeStack_d {d : Nat} (hd8 : 8 ≤ d) : SafeStack 21 [d] := by + refine ⟨(by intro h; injection h with h1; omega), ?_, ?_⟩ + · dsimp only [GoodDs, GoodDsAux, GoodDs1]; exact decide_eq_true (by omega) + · intro u hu + dsimp only [GoodDs, GoodDsAux, GoodDs2] + rw [if_neg (by omega), if_neg (by omega), if_neg (by omega)] + have hu19 : decide (u < 19) = false := decide_eq_false (by omega) + have hu17 : decide (u < 17) = false := decide_eq_false (by omega) + have hgd : GoodDs1 d = true := by dsimp only [GoodDs1]; exact decide_eq_true (by omega) + have hc1 : (decide (u % 2 = 0 ∧ u ≤ 2 * d + 4) && !GoodDs1 (d - 1)) = false := by + rcases dec_or (d = 8) with rfl | hd9 + · rw [decide_eq_false (by omega), Bool.false_and] + · have hg1 : GoodDs1 (d - 1) = true := by + dsimp only [GoodDs1]; exact decide_eq_true (by omega) + rw [hg1, Bool.not_true, Bool.and_false] + have hc2 : (decide (u % 2 = 0 ∧ u + 14 ≤ 2 * d) && !GoodDs1 (d - 2)) = false := by + rcases dec_or (d ≤ 9) with hd9 | hd10 + · rw [decide_eq_false (by omega), Bool.false_and] + · have hg2 : GoodDs1 (d - 2) = true := by + dsimp only [GoodDs1]; exact decide_eq_true (by omega) + rw [hg2, Bool.not_true, Bool.and_false] + rw [hu19, hu17, hgd, hc1, hc2] + simp only [Bool.and_false, Bool.not_true, Bool.or_false, Bool.false_eq_true, ite_false] + +theorem safeStack_d0 {d : Nat} (hd8 : 8 ≤ d) : SafeStack 21 [d, 0] := by + refine ⟨(by intro h; injection h with _ h2; cases h2), ?_, ?_⟩ + · dsimp only [GoodDs, GoodDsAux, GoodDs2]; rw [if_pos rfl]; exact decide_eq_true (by omega) + · intro u hu + dsimp only [GoodDs] + rw [GoodDsAux.eq_3, if_neg (by omega)] + have h1 : decide (d = 3 ∧ 0 = 1 ∧ ([] : List Nat) = [] ∧ u < 19) = false := + decide_eq_false (by omega) + have hu19 : decide (u < 19) = false := decide_eq_false (by omega) + have h3 : decide (d ≥ 25 ∧ 0 = 1 ∧ ([] : List Nat) = [] ∧ u < 39) = false := + decide_eq_false (by omega) + have hu17 : decide (u < 17) = false := decide_eq_false (by omega) + have hgd : GoodDsAux d [0] = true := by + dsimp only [GoodDsAux, GoodDs2]; rw [if_pos rfl]; exact decide_eq_true (by omega) + have hc1 : (decide (u % 2 = 0 ∧ u ≤ 2 * d + 4) && !GoodDsAux (d - 1) [0]) = false := by + rcases dec_or (d = 8) with rfl | hd9 + · rw [decide_eq_false (by omega), Bool.false_and] + · have hg1 : GoodDsAux (d - 1) [0] = true := by + dsimp only [GoodDsAux, GoodDs2]; rw [if_pos rfl]; exact decide_eq_true (by omega) + rw [hg1, Bool.not_true, Bool.and_false] + have hc2 : (decide (u % 2 = 0 ∧ u + 14 ≤ 2 * d) && !GoodDsAux (d - 2) [0]) = false := by + rcases dec_or (d ≤ 9) with hd9 | hd10 + · rw [decide_eq_false (by omega), Bool.false_and] + · have hg2 : GoodDsAux (d - 2) [0] = true := by + dsimp only [GoodDsAux, GoodDs2]; rw [if_pos rfl]; exact decide_eq_true (by omega) + rw [hg2, Bool.not_true, Bool.and_false] + rw [h1, hu19, h3, hu17, hgd, hc1, hc2] + simp only [Bool.and_false, Bool.not_true, Bool.or_false, Bool.false_eq_true, ite_false] + +theorem safeStack_d1 {d : Nat} (hd26 : 26 ≤ d) : SafeStack 39 [d, 1] := by + refine ⟨(by intro h; injection h with _ h2; cases h2), safeStack_one.2.2 d (by omega), ?_⟩ + intro u hu + dsimp only [GoodDs] + rw [GoodDsAux.eq_3, if_neg (by omega)] + have h1 : decide (d = 3 ∧ 1 = 1 ∧ ([] : List Nat) = [] ∧ u < 19) = false := + decide_eq_false (by omega) + have h2 : isOddDrainDs [d, 1] = false := rfl + have h3 : decide (d ≥ 25 ∧ 1 = 1 ∧ ([] : List Nat) = [] ∧ u < 39) = false := + decide_eq_false (by omega) + have hu17 : decide (u < 17) = false := decide_eq_false (by omega) + have hgd : GoodDsAux d [1] = true := safeStack_one.2.2 d (by omega) + have hg1 : GoodDsAux (d - 1) [1] = true := safeStack_one.2.2 (d - 1) (by omega) + have hc2 : (decide (u % 2 = 0 ∧ u + 14 ≤ 2 * d) && !GoodDsAux (d - 2) [1]) = false := by + rcases dec_or (d = 26) with rfl | hd27 + · rw [decide_eq_false (by omega), Bool.false_and] + · have hg2 : GoodDsAux (d - 2) [1] = true := safeStack_one.2.2 (d - 2) (by omega) + rw [hg2, Bool.not_true, Bool.and_false] + rw [h1, h2, h3, hu17, hgd, hg1, hc2] + simp only [Bool.false_and, Bool.not_true, Bool.or_false, Bool.and_false, + Bool.false_eq_true, ite_false] + +theorem safeStack_of_gt2d2 {m d2 d3 : Nat} {ds3 : List Nat} + (_hm39 : 39 ≤ m) (hm_gt : 2 * d2 + 5 ≤ m) (hd2 : 17 ≤ d2) + (hg : GoodDs (d2 :: d3 :: ds3) = true) : + SafeStack m (d2 :: d3 :: ds3) := by + refine ⟨(by intro h; injection h with _ h2; cases h2), hg, ?_⟩ + intro u hu + dsimp only [GoodDs] + rw [GoodDsAux.eq_3, if_neg (by omega)] + have h1 : decide (d2 = 3 ∧ d3 = 1 ∧ ds3 = [] ∧ u < 19) = false := decide_eq_false (by omega) + have hu19 : decide (u < 19) = false := decide_eq_false (by omega) + have h3 : decide (d2 ≥ 25 ∧ d3 = 1 ∧ ds3 = [] ∧ u < 39) = false := decide_eq_false (by omega) + have hu17 : decide (u < 17) = false := decide_eq_false (by omega) + have hg0 : GoodDsAux d2 (d3 :: ds3) = true := hg + have hc1 : decide (u % 2 = 0 ∧ u ≤ 2 * d2 + 4) = false := decide_eq_false (by omega) + have hc2 : decide (u % 2 = 0 ∧ u + 14 ≤ 2 * d2) = false := decide_eq_false (by omega) + rw [h1, hu19, h3, hu17, hg0, hc1, hc2] + simp only [Bool.and_false, Bool.false_and, Bool.not_true, Bool.or_false, + Bool.false_eq_true, ite_false] + +theorem safeStack_25_1 : SafeStack 55 [25, 1] := + safeStack_of_gt2d2 (by decide) (by decide) (by decide) rfl + +theorem safeStack_17_8_0 : SafeStack 39 [17, 8, 0] := + safeStack_of_gt2d2 (by decide) (by decide) (by decide) rfl + +theorem safeStack_20_3_1 : SafeStack 27 [20, 3, 1] := by + refine ⟨(by intro h; injection h with _ h2; cases h2), rfl, ?_⟩ + intro u hu + dsimp only [GoodDs] + rw [GoodDsAux.eq_3, if_neg (by decide)] + have h1 : decide (20 = 3 ∧ 3 = 1 ∧ [1] = [] ∧ u < 19) = false := rfl + have h2 : isOddDrainDs [20, 3, 1] = false := rfl + have h3 : decide (20 ≥ 25 ∧ 3 = 1 ∧ [1] = [] ∧ u < 39) = false := rfl + have hu17 : decide (u < 17) = false := decide_eq_false (by omega) + have hg0 : GoodDsAux 20 [3, 1] = true := rfl + have hg1 : GoodDsAux 19 [3, 1] = true := rfl + have hc2 : decide (u % 2 = 0 ∧ u + 14 ≤ 2 * 20) = false := decide_eq_false (by omega) + rw [h1, h2, h3, hu17, hg0, hg1, hc2] + simp only [Bool.false_and, Bool.not_true, Bool.or_false, Bool.and_false, + Bool.false_eq_true, ite_false] + +theorem safeStack_19_9 : SafeStack 43 [19, 9] := + safeStack_of_gt2d2 (by decide) (by decide) (by decide) rfl + +theorem safeStack_19_9_0 : SafeStack 43 [19, 9, 0] := + safeStack_of_gt2d2 (by decide) (by decide) (by decide) rfl + +theorem safeStack_47_25_1 : SafeStack 99 [47, 25, 1] := + safeStack_of_gt2d2 (by decide) (by decide) (by decide) rfl + +-- ============================================================================ +-- High-Excursion Arithmetic Lemmas & Bundle (`FHigh`, `LoopHigh`, `LoopOS`) +-- ============================================================================ + +def ExitHigh (S : List Nat) (s : SegState) : Prop := + (∃ phi, 48 ≤ phi ∧ IsBounce phi S s) ∨ + (∃ y phi, 49 ≤ y ∧ ((53 ≤ y ∧ 90 ≤ phi) ∨ 100 ≤ phi) ∧ IsBounce phi (y :: S) s) + +theorem arith_lh_bounds {c k fz : Nat} + (_hc : 2 ≤ c) (_hk1 : 1 ≤ k) (hkc : k ≤ 2 * c + 3) (_hfz : 40 ≤ fz) (_hcz : 131 ≤ c + fz) : + 119 ≤ ox (k + 2 * fz) (c + fz) ∧ 118 ≤ odw (k + 2 * fz) (c + fz) := by + obtain ⟨q, r, hr, heq, hox⟩ := ox_spec_lt (kz := k + 2 * fz) (cz := c + fz) (by omega) + dsimp only [odw] + omega + +theorem arith_los_r11 {c k fz x y phi fz3 : Nat} + (_hc : 2 ≤ c) (_hk1 : 1 ≤ k) (hkc : k ≤ 2 * c + 3) (_hfz : 40 ≤ fz) + (_hx : 91 ≤ x) (_hpot : 2220 ≤ (c + fz) + 22 * x) + (_hy_lo : ox (k + 2 * fz) (c + fz) ≤ y) (_hy_hi : y ≤ 2 * x + 4) + (_hphi38 : 38 ≤ phi) (_hyw : oxw (k + 2 * fz) (c + fz) ≤ y + phi) + (_hfz3 : phi + 2 ≤ fz3) : + 39 ≤ y ∧ 91 ≤ x - 1 ∧ 2220 ≤ (y + fz3) + 22 * (x - 1) := by + obtain ⟨q, r, hr, heq, hox⟩ := ox_spec_lt (kz := k + 2 * fz) (cz := c + fz) (by omega) + obtain ⟨qw, rw_, hrw, hkw, hdw⟩ := div20_spec (k + 2 * fz) + dsimp only [oxw] at _hyw + rw [hdw] at _hyw + rw [hox] at _hy_lo + omega + +def FHigh (N : Nat) : Prop := + ∀ S segs zl c k, + S ≠ [1] → SafeStack 43 S → + ValidSegs40 segs zl → + 2 ≤ c → 1 ≤ k → k ≤ 2 * c + 3 → + 53 ≤ c + fzOf segs zl → + 97 ≤ k + 2 * fzOf segs zl → + ChainLeadsUpTo N ⟨false, segs, zl, c, k, 0, S⟩ (ExitHigh S) + +def LoopHigh (N : Nat) : Prop := + ∀ S segs zl c k x, + S ≠ [1] → SafeStack 43 S → + ValidSegs40 segs zl → + 2 ≤ c → 1 ≤ k → k ≤ 2 * c + 3 → + 49 ≤ x → + 131 ≤ c + fzOf segs zl → + ChainLeadsUpTo N ⟨false, segs, zl, c, k, 0, x :: S⟩ (ExitHigh S) + +def LoopOS (N : Nat) : Prop := + ∀ S segs zl c k x cz_out, + S ≠ [1] → SafeStack 43 S → + ValidSegs40 segs zl → + 2 ≤ c → 1 ≤ k → k ≤ 2 * c + 3 → + 53 ≤ cz_out → + 91 ≤ x → + 2220 ≤ (c + fzOf segs zl) + 22 * x → + ChainLeadsUpTo N ⟨false, segs, zl, c, k, 0, x :: cz_out :: S⟩ (ExitHigh S) + +theorem fhigh_bundle (N : Nat) : FHigh N ∧ LoopHigh N ∧ LoopOS N := by + induction N using Nat.strong_induction_on with + | h N ih => + have hFH : FHigh N := by + intro S segs zl c k hne1 hS hv hc hk1 hkc hcz53 hkz99 + rcases segs with _ | ⟨⟨z0, m0⟩, rest⟩ + · dsimp only [fzOf] at hcz53 hkz99 + have hzl230 : 230 ≤ zl := hv.2 + have hg : stepGuards ⟨false, [], zl, c, k, 0, S⟩ = true := by + dsimp only [stepGuards] + rw [goodPhiW_of_ge35 hS.1 (by omega), Bool.true_and] + dsimp only [GoodPsi] + have hcz : c + zl - 1 + 1 = c + zl := by omega + rw [hcz]; exact hS.2.2 (c + zl) (by omega) + apply chainLeadsUpTo_step1 hg + dsimp only [stepSegs] + apply chainLeadsUpTo_here + refine Or.inr ⟨c + zl, k + 2 * zl + 2, by omega, Or.inr (by omega), ?_⟩ + simpa only [Nat.add_zero] using IsBounce.nil (zl := 0) (cp1 := k + 2 * zl + 2) (kb := 0) + (mrg := 2 * (k + 2 * zl) + 6) (ds := (c + zl) :: S) (by omega) + · have hz0_40 : 40 ≤ z0 := fzOf_ge_40 hv + have hv_rest : ValidSegs40 rest zl := validSegs40_tail hv + dsimp only [fzOf] at hcz53 hkz99 + cases m0 with + | zero => + have hg1 : stepGuards ⟨false, (z0, 0) :: rest, zl, c, k, 0, S⟩ = true := rfl + apply chainLeadsUpTo_step hg1 + intro m1 hm1 + dsimp only [stepSegs] + rcases rest with _ | ⟨⟨z1, m1_seg⟩, rest2⟩ + · have hzl230 : 230 ≤ zl := hv_rest.2 + exact chainLeadsUpTo_here (Or.inl ⟨c + z0 + 3 + zl, by omega, IsBounce.nil (by omega)⟩) + · have hz1_40 : 40 ≤ z1 := fzOf_ge_40 hv_rest + have hv_rest2 : ValidSegs40 rest2 zl := validSegs40_tail hv_rest + have hfz2_40 : 40 ≤ fzOf rest2 zl := fzOf_ge_40 hv_rest2 + cases m1_seg with + | zero => + have hg2 : stepGuards ⟨true, (z1, 0) :: rest2, zl, c + z0 + 3, k + 2 * z0 + + 3, 2 * (c + z0) + 8, S⟩ = true := by + dsimp only [stepGuards]; exact decide_eq_true (by omega) + apply chainLeadsUpTo_step hg2 + intro m2 hm2 + dsimp only [stepSegs] + exact (ih m2 (by omega)).1 S rest2 zl (c + z0 + 3 + z1 + 1) (k + 2 * z0 + 3 + 2 * z1 + + 3) + hne1 hS hv_rest2 (by omega) (by omega) (by omega) (by omega) (by omega) + | succ m1' => + rcases dec_or ((m1' + 1) % 2 = 1) with hm1_odd | hm1_even + · cases hd_mrg : decide (2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + m1') with + | true => + have hg2 : stepGuards ⟨true, (z1, m1' + 1) :: rest2, zl, c + z0 + 3, k + 2 * z0 + + 3, 2 * (c + z0) + 8, S⟩ = true := by + dsimp only [stepGuards] + rw [if_pos hm1_odd, hd_mrg, if_pos rfl] + exact hS.2.2 (c + z0 + 3 + z1) (by omega) + apply chainLeadsUpTo_step hg2 + intro m2 hm2 + dsimp only [stepSegs] + rw [if_pos hm1_odd, hd_mrg, if_pos rfl] + exact (ih m2 (by omega)).2.1 S rest2 zl ((k + 2 * z0 + 3) + m1' + 2 * z1 + 4) 1 + (c + z0 + 3 + z1) hne1 hS hv_rest2 + (by omega) (by omega) (by omega) (by omega) (by omega) + | false => + have h_nm : ¬(2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + m1') := + of_decide_eq_false hd_mrg + exact chainLeadsUpTo_here (Or.inl ⟨c + z0 + 3 + z1, by omega, + IsBounce.cons hv_rest2 (by omega) (by rw [if_pos hm1_odd]; omega)⟩) + · cases hd_mrg : decide (2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + (m1' + 1)) with + | true => + have h_mrg : 2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + (m1' + 1) := + of_decide_eq_true hd_mrg + have hg2 : stepGuards ⟨true, (z1, m1' + 1) :: rest2, zl, c + z0 + 3, k + 2 * z0 + + 3, 2 * (c + z0) + 8, S⟩ = true := by + dsimp only [stepGuards] + rw [if_neg hm1_even, hd_mrg, if_pos rfl] + apply chainLeadsUpTo_step hg2 + intro m2 hm2 + dsimp only [stepSegs] + rw [if_neg hm1_even, hd_mrg, if_pos rfl] + exact (ih m2 (by omega)).1 S rest2 zl (c + z0 + 3 + z1 + 2) + ((k + 2 * z0 + 3) + (m1' + 1) + 2 * z1 + 5) + hne1 hS hv_rest2 (by omega) (by omega) (by omega) (by omega) (by omega) + | false => + have h_nm : ¬(2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + (m1' + 1)) := + of_decide_eq_false hd_mrg + exact chainLeadsUpTo_here (Or.inl ⟨c + z0 + 3 + z1, by omega, + IsBounce.cons hv_rest2 (by omega) (by rw [if_neg hm1_even]; omega)⟩) + | succ m' => + have hfz1_40 : 40 ≤ fzOf rest zl := fzOf_ge_40 hv_rest + have hphiw : GoodPhiW (c + z0 - 1) S false = true := goodPhiW_of_ge35 hS.1 (by omega) + rcases dec_or (m' + 1 = 1) with hm1 | hm_gt1 + · have hm0_eq : m' = 0 := by omega + subst hm0_eq + have hg : stepGuards ⟨false, (z0, 1) :: rest, zl, c, k, 0, S⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) S false && if 1 = 1 then GoodPsi (c + z0) S else _) = + true + rw [hphiw, Bool.true_and, if_pos rfl] + exact hS.2.2 (c + z0 + 1) (by omega) + apply chainLeadsUpTo_step hg + intro m1 hm1 + dsimp only [stepSegs] + change ChainLeadsUpTo m1 (if 1 = 1 then _ else _) _ + rw [if_pos rfl] + exact (ih m1 hm1).2.1 S rest zl (k + 2 * z0 + 4) 1 (c + z0 + 1) + hne1 hS hv_rest (by omega) (by omega) (by omega) (by omega) (by omega) + · have hpsi_cz : GoodPsi (c + z0 - 1) S = true := by + dsimp only [GoodPsi] + have hcz_eq : c + z0 - 1 + 1 = c + z0 := by omega + rw [hcz_eq]; exact hS.2.2 (c + z0) (by omega) + rcases dec_or ((m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10) with hev_sm | hnot_ev + · have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, S⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) S false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) S && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else _) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, if_pos hev_sm] + apply chainLeadsUpTo_step hg + intro m1 hm1 + dsimp only [stepSegs] + change ChainLeadsUpTo m1 (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else _) _ + rw [if_neg hm_gt1, if_pos hev_sm] + exact (ih m1 hm1).2.1 S rest zl (k + 2 * z0 + 4) (m' + 2) (c + z0) + hne1 hS hv_rest (by omega) (by omega) (by omega) (by omega) (by omega) + · rcases dec_or ((m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11) with hod_sm | hbig_m + · have hS_cz : SafeStack 19 ((c + z0) :: S) := + safeStack_cons_ne1 hne1 hS (by omega) (by omega) + have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, S⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) S false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) S && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then + GoodDs ((k + 2 * z0 + 2) :: (c + z0) :: S) else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_pos hod_sm] + exact hS_cz.2.2 (k + 2 * z0 + 2) (by omega) + apply chainLeadsUpTo_step hg + intro m1 hm1 + dsimp only [stepSegs] + change ChainLeadsUpTo m1 (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_pos hod_sm] + have hm_sub : m' + 1 - 1 = m' := by omega + rw [hm_sub] + exact (ih m1 hm1).2.2 S rest zl m' 1 (k + 2 * z0 + 2) (c + z0) + hne1 hS hv_rest (by omega) (by omega) (by omega) hcz53 (by omega) (by omega) + · have hm0_big : 2 * (k + 2 * z0) + 12 ≤ m' + 1 := by omega + have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, S⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) S false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) S && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_neg hbig_m] + apply chainLeadsUpTo_step1 hg + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_neg hbig_m] + have hnorm : normSeg 0 (m' + 1 - 4) = (0, (m' - 4) + 1) := by + dsimp only [normSeg]; rw [if_neg (by omega)]; congr 1; omega + rw [hnorm] + apply chainLeadsUpTo_here + refine Or.inr ⟨c + z0, k + 2 * z0 + 2, by omega, Or.inl ⟨hcz53, by omega⟩, ?_⟩ + have hbc := IsBounce.cons (z0 := 0) (m := m' - 4) (zl := zl) + (cp1 := k + 2 * z0 + 2) (kb := 0) (mrg := 2 * (k + 2 * z0) + 6) + (rest := rest) (ds := (c + z0) :: S) hv_rest (by omega) + (by split_ifs <;> omega) + simpa only [Nat.add_zero] using hbc + have hLH : LoopHigh N := by + intro S segs zl c k x hne1 hS hv hc hk1 hkc hx49 hcz135 + have hfz40 : 40 ≤ fzOf segs zl := fzOf_ge_40 hv + obtain ⟨hox101, hodw100⟩ := arith_lh_bounds hc hk1 hkc hfz40 hcz135 + have hSx : SafeStack 19 (x :: S) := safeStack_cons_ne1 hne1 hS (by omega) (by omega) + have hfb := (excursion_bundle N).1 19 (x :: S) segs zl c k (by decide) hSx + (validTail40_of_validSegs40 hv) (by omega) hk1 hkc (by omega) (by omega) (by omega) + (by omega) + refine chainLeadsUpTo_trans hfb ?_ + intro m1 s_mid hm1 hexit + rcases hexit with ⟨phi, hphi_odw, hb⟩ | ⟨y, phi, hy_ox, hphi38, _, hb⟩ + · exact chainLeadsUpTo_here (Or.inr ⟨x, phi, hx49, Or.inr (by omega), hb⟩) + · exact amega_pop_step hb hphi38 (by omega) (by omega) + (hS.2.2 (x - 1) (by omega)) (fun _ => hS.2.2 (x - 2) (by omega)) + (fun hbig _ _ p1 p2 hvp _ => + chainLeadsUpTo_here (Or.inl ⟨x - 1, by omega, isBounce_r9 (by omega) hbig hvp⟩)) + (fun _ _ m2 hm2 p1 p2 hvp _ => by + have hfp40 : 40 ≤ fzOf p1 p2 := fzOf_ge_40 hvp + exact (ih m2 (by omega)).1 S p1 p2 (x + 1) (y + 2) hne1 hS hvp + (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun hy_le _ m2 hm2 p1 p2 hvp _ => by + have hfp40 : 40 ≤ fzOf p1 p2 := fzOf_ge_40 hvp + exact (ih m2 (by omega)).2.1 S p1 p2 y 1 (x - 1) hne1 hS hvp + (by omega) (by omega) (by omega) (by omega) (by omega)) + have hLOS : LoopOS N := by + intro S segs zl c k x cz_out hne1 hS hv hc hk1 hkc hcz_out hx96 hpot + have hfz40 : 40 ≤ fzOf segs zl := fzOf_ge_40 hv + have hox39 : 39 ≤ ox (k + 2 * fzOf segs zl) (c + fzOf segs zl) := + (ox_bounds_relaxed (by omega) hk1 hkc (by omega) (by omega) (by omega)).1 + have hS_cz : SafeStack 19 (cz_out :: S) := safeStack_cons_ne1 hne1 hS (by omega) (by omega) + have hne1_cz : (cz_out :: S) ≠ [1] := by intro h; injection h with h1; omega + have hS_xcz : SafeStack 19 (x :: cz_out :: S) := + safeStack_cons_ne1 hne1_cz hS_cz (by omega) (by omega) + have hfb := (excursion_bundle N).1 19 (x :: cz_out :: S) segs zl c k (by decide) hS_xcz + (validTail40_of_validSegs40 hv) (by omega) hk1 hkc (by omega) (by omega) (by omega) + (by omega) + refine chainLeadsUpTo_trans hfb ?_ + intro m1 s_mid hm1 hexit + rcases hexit with ⟨phi, hphi_odw, hb⟩ | ⟨y, phi, hy_ox, hphi38, hyw, hb⟩ + · have hphi38 : 38 ≤ phi := by + obtain ⟨q, r, hr, heq, hox⟩ := + ox_spec_lt (kz := k + 2 * fzOf segs zl) (cz := c + fzOf segs zl) (by omega) + dsimp only [odw] at hphi_odw; rw [hox] at hphi_odw hox39; omega + exact amega_pop_step hb hphi38 (by omega) (by omega) + (hS.2.2 (cz_out - 1) (by omega)) (fun _ => hS.2.2 (cz_out - 2) (by omega)) + (fun hbig _ _ p1 p2 hvp _ => + chainLeadsUpTo_here (Or.inl ⟨cz_out - 1, by omega, isBounce_r9 (by omega) hbig hvp⟩)) + (fun _ _ m2 hm2 p1 p2 hvp _ => by + have hfp40 : 40 ≤ fzOf p1 p2 := fzOf_ge_40 hvp + exact (ih m2 (by omega)).1 S p1 p2 (cz_out + 1) (x + 2) hne1 hS hvp + (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ _ m2 hm2 p1 p2 hvp _ => by + have hfp40 : 40 ≤ fzOf p1 p2 := fzOf_ge_40 hvp + exact (ih m2 (by omega)).2.1 S p1 p2 x 1 (cz_out - 1) hne1 hS hvp + (by omega) (by omega) (by omega) (by omega) (by omega)) + · exact amega_pop_step hb hphi38 (by omega) (by omega) + (hS_cz.2.2 (x - 1) (by omega)) (fun _ => hS_cz.2.2 (x - 2) (by omega)) + (fun hbig _ _ p1 p2 hvp _ => + chainLeadsUpTo_here (Or.inr ⟨cz_out, x - 1, by omega, + Or.inl ⟨hcz_out, by omega⟩, isBounce_r9 (by omega) hbig hvp⟩)) + (fun _ _ m2 hm2 p1 p2 hvp _ => by + have hfp40 : 40 ≤ fzOf p1 p2 := fzOf_ge_40 hvp + exact (ih m2 (by omega)).2.1 S p1 p2 (x + 1) (y + 2) cz_out hne1 hS hvp + (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun hy_le _ m2 hm2 p1 p2 hvp hfzp => by + have hlos := arith_los_r11 hc hk1 hkc hfz40 hx96 hpot hy_ox hy_le hphi38 hyw hfzp + exact (ih m2 (by omega)).2.2 S p1 p2 y 1 (x - 1) cz_out hne1 hS hvp + (by omega) (by omega) (by omega) hcz_out hlos.2.1 hlos.2.2) + exact ⟨hFH, hLH, hLOS⟩ + + +-- ============================================================================ +-- Section 5g.3b: Excursion Helpers, Root Invariant, and Drain-Pop Closures +-- ============================================================================ + +theorem chainLeads_trans {s : SegState} {P Q : SegState → Prop} + (h1 : ChainLeads s P) (h2 : ∀ s', P s' → ChainLeads s' Q) : + ChainLeads s Q := + fun N => chainLeadsUpTo_trans (h1 N) (fun m s' _ hp => h2 s' hp m) + +-- ============================================================================ +-- Generic Forced-R9 & k=1 Boost Helpers (`fbound_force_r9`, `fbound_k1_boost`) +-- ============================================================================ + +theorem fbound_force_r9 {N x d3 : Nat} {ds3 : List Nat} {segs : List (Nat × Nat)} {zl c k : Nat} + {P : SegState → Prop} + (hx19 : 19 ≤ x) + (hgx : GoodDs (x :: d3 :: ds3) = true) + (hg_pop1 : GoodDs ((x - 1) :: d3 :: ds3) = true) + (hv : ValidSegs40 segs zl) + (hc : 1 ≤ c) (hk1 : 1 ≤ k) (hkc : k ≤ 2 * c + 3) + (hcz42 : 42 ≤ c + fzOf segs zl) + (hox : 2 * x + 7 ≤ ox (k + 2 * fzOf segs zl) (c + fzOf segs zl)) + (hcont1 : ∀ m phi, m ≤ N → 2 * x + 6 ≤ phi → ∀ s', + IsBounce phi (x :: d3 :: ds3) s' → ChainLeadsUpTo m s' P) + (hcont2 : ∀ m, m < N → ∀ s', + IsBounce (x - 1) (d3 :: ds3) s' → ChainLeadsUpTo m s' P) : + ChainLeadsUpTo N ⟨false, segs, zl, c, k, 0, x :: d3 :: ds3⟩ P := by + have hfz40 : 40 ≤ fzOf segs zl := fzOf_ge_40 hv + have hS : SafeStack (2 * x + 5) (x :: d3 :: ds3) := + safeStack_of_gt2d2 (by omega) (Nat.le_refl _) (by omega) hgx + have hfb := (excursion_bundle N).1 (2 * x + 5) (x :: d3 :: ds3) segs zl c k + (by omega) hS (validTail40_of_validSegs40 hv) hc hk1 hkc + (by omega) hcz42 (by omega) hox + refine chainLeadsUpTo_trans hfb ?_ + intro m1 s_mid hm1 hexit + rcases hexit with ⟨phi, hphi_odw, hb⟩ | ⟨y, phi, hy_ox, hphi38, _, hb⟩ + · have hphi_ge : 2 * x + 6 ≤ phi := by dsimp only [odw] at hphi_odw; omega + exact hcont1 m1 phi hm1 hphi_ge s_mid hb + · exact amega_pop_step hb hphi38 (by omega) hx19 hg_pop1 + (by rintro ⟨_, h⟩; omega) + (fun hbig m2 hm2 p1 p2 hvp _ => + hcont2 m2 (Nat.lt_of_lt_of_le hm2 hm1) _ (isBounce_r9 hx19 hbig hvp)) + (fun hle => False.elim (by omega)) + (fun hle => False.elim (by omega)) + +theorem arith_boost_c85 {c k fz : Nat} + (_hc : 85 ≤ c) (_hk1 : 1 ≤ k) (hkc : k ≤ 2 * c + 3) (_hfz : 40 ≤ fz) : + 114 ≤ ox (k + 2 * fz) (c + fz) ∧ 113 ≤ odw (k + 2 * fz) (c + fz) ∧ + 165 ≤ oxw (k + 2 * fz) (c + fz) := by + obtain ⟨q, r, hr, heq, hox⟩ := ox_spec_lt (kz := k + 2 * fz) (cz := c + fz) (by omega) + obtain ⟨qw, rw_, hrw, hkw, hdw⟩ := div20_spec (k + 2 * fz) + dsimp only [odw, oxw]; rw [hdw, hox]; omega + +theorem arith_boost_r10 {c k fz : Nat} + (_hc : 43 ≤ c) (_hk : 72 ≤ k) (hkc : k ≤ 2 * c + 3) (_hfz : 40 ≤ fz) : + 73 ≤ ox (k + 2 * fz) (c + fz) ∧ 72 ≤ odw (k + 2 * fz) (c + fz) ∧ + 126 ≤ oxw (k + 2 * fz) (c + fz) := by + obtain ⟨q, r, hr, heq, hox⟩ := ox_spec_lt (kz := k + 2 * fz) (cz := c + fz) (by omega) + obtain ⟨qw, rw_, hrw, hkw, hdw⟩ := div20_spec (k + 2 * fz) + dsimp only [odw, oxw]; rw [hdw, hox]; omega + +theorem arith_boost_cz {c fz cz_lo ox_lo : Nat} + (_hc : 2 ≤ c) (_hfz : 40 ≤ fz) (_hcz : cz_lo ≤ c + fz) + (_h : (cz_lo = 109 ∧ ox_lo = 99) ∨ (cz_lo = 118 ∧ ox_lo = 107) ∨ + (cz_lo = 148 ∧ ox_lo = 134) ∨ (cz_lo = 154 ∧ ox_lo = 140)) : + ox_lo ≤ ox (1 + 2 * fz) (c + fz) := by + obtain ⟨q, r, hr, heq, hox⟩ := ox_spec_lt (kz := 1 + 2 * fz) (cz := c + fz) (by omega) + omega + +theorem fbound_k1_boost {N d2 : Nat} {ds2 : List Nat} {segs : List (Nat × Nat)} {zl c1 : Nat} + (hne1 : (d2 :: ds2) ≠ [1]) (hS1 : SafeStack 19 (d2 :: ds2)) + (hv : ValidSegs40 segs zl) (hc1 : 2 ≤ c1) : + ChainLeadsUpTo N ⟨false, segs, zl, c1, 1, 0, d2 :: ds2⟩ (Exit 39 38 107 (d2 :: ds2)) := by + rcases segs with _ | ⟨⟨z1, m1⟩, rest1⟩ + · have hzl230 : 230 ≤ zl := hv.2 + have hg : stepGuards ⟨false, [], zl, c1, 1, 0, d2 :: ds2⟩ = true := by + dsimp only [stepGuards] + rw [goodPhiW_of_ge35 hS1.1 (by omega), Bool.true_and] + dsimp only [GoodPsi] + have hcz : c1 + zl - 1 + 1 = c1 + zl := by omega + rw [hcz]; exact hS1.2.2 (c1 + zl) (by omega) + apply chainLeadsUpTo_step1 hg + dsimp only [stepSegs] + apply chainLeadsUpTo_here + refine Or.inr ⟨c1 + zl, 1 + 2 * zl + 2, by omega, by omega, by omega, ?_⟩ + simpa only [Nat.add_zero] using IsBounce.nil (zl := 0) (cp1 := 1 + 2 * zl + 2) (kb := 0) + (mrg := 2 * (1 + 2 * zl) + 6) (ds := (c1 + zl) :: d2 :: ds2) (by omega) + · have hz1_40 : 40 ≤ z1 := fzOf_ge_40 hv + have hv_r1 : ValidSegs40 rest1 zl := validSegs40_tail hv + cases m1 with + | zero => + have hg1 : stepGuards ⟨false, (z1, 0) :: rest1, zl, c1, 1, 0, d2 :: ds2⟩ = true := rfl + apply chainLeadsUpTo_step hg1 + intro m_a hm_a + dsimp only [stepSegs] + rcases rest1 with _ | ⟨⟨z2, m2⟩, rest2⟩ + · have hzl230 : 230 ≤ zl := hv_r1.2 + exact chainLeadsUpTo_here (Or.inl ⟨c1 + z1 + 3 + zl, by omega, IsBounce.nil (by omega)⟩) + · have hz2_40 : 40 ≤ z2 := fzOf_ge_40 hv_r1 + have hv_r2 : ValidSegs40 rest2 zl := validSegs40_tail hv_r1 + have hfz3_40 : 40 ≤ fzOf rest2 zl := fzOf_ge_40 hv_r2 + cases m2 with + | zero => + have hg2 : stepGuards ⟨true, (z2, 0) :: rest2, zl, c1 + z1 + 3, 1 + 2 * z1 + 3, + 2 * (c1 + z1) + 8, d2 :: ds2⟩ = true := by + dsimp only [stepGuards]; exact decide_eq_true (by omega) + apply chainLeadsUpTo_step hg2 + intro m_b hm_b + dsimp only [stepSegs] + have hb := arith_boost_c85 (c := c1 + z1 + 3 + z2 + 1) (k := 1 + 2 * z1 + 3 + 2 * z2 + 3) + (fz := fzOf rest2 zl) (by omega) (by omega) (by omega) hfz3_40 + exact chainLeadsUpTo_imp + ((excursion_bundle m_b).1 19 (d2 :: ds2) rest2 zl + (c1 + z1 + 3 + z2 + 1) (1 + 2 * z1 + 3 + 2 * z2 + 3) (by decide) hS1 + (validTail40_of_validSegs40 hv_r2) (by omega) (by omega) (by omega) + (by omega) (by omega) (by omega) (by omega)) + (fun _ he => exit_mono he (by omega) (by omega) (by omega)) + | succ m2' => + rcases dec_or ((m2' + 1) % 2 = 1) with hm2_od | hm2_ev + · cases hd_mrg : decide (2 * (c1 + z1) + 8 ≥ (1 + 2 * z1 + 3) + m2') with + | true => + have hg2 : stepGuards ⟨true, (z2, m2' + 1) :: rest2, zl, c1 + z1 + 3, + 1 + 2 * z1 + 3, 2 * (c1 + z1) + 8, d2 :: ds2⟩ = true := by + dsimp only [stepGuards]; rw [if_pos hm2_od, hd_mrg, if_pos rfl] + exact hS1.2.2 (c1 + z1 + 3 + z2) (by omega) + apply chainLeadsUpTo_step hg2 + intro m_b hm_b + dsimp only [stepSegs]; rw [if_pos hm2_od, hd_mrg, if_pos rfl] + exact (excursion_bundle m_b).2 19 (d2 :: ds2) rest2 zl + ((1 + 2 * z1 + 3) + m2' + 2 * z2 + 4) 1 (c1 + z1 + 3 + z2) 39 107 + (by decide) hS1 (Or.inl hne1) hv_r2 + (by omega) (by omega) (by omega) (by decide) (by omega) + (by omega) (by omega) (by omega) (by omega) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact chainLeadsUpTo_here (Or.inl ⟨c1 + z1 + 3 + z2, by omega, + IsBounce.cons hv_r2 (by omega) (by rw [if_pos hm2_od]; omega)⟩) + · cases hd_mrg : decide (2 * (c1 + z1) + 8 ≥ (1 + 2 * z1 + 3) + (m2' + 1)) with + | true => + have h_mrg := of_decide_eq_true hd_mrg + have hg2 : stepGuards ⟨true, (z2, m2' + 1) :: rest2, zl, c1 + z1 + 3, + 1 + 2 * z1 + 3, 2 * (c1 + z1) + 8, d2 :: ds2⟩ = true := by + dsimp only [stepGuards]; rw [if_neg hm2_ev, hd_mrg, if_pos rfl] + apply chainLeadsUpTo_step hg2 + intro m_b hm_b + dsimp only [stepSegs]; rw [if_neg hm2_ev, hd_mrg, if_pos rfl] + have hb := arith_boost_c85 (c := c1 + z1 + 3 + z2 + 2) + (k := (1 + 2 * z1 + 3) + (m2' + 1) + 2 * z2 + 5) + (fz := fzOf rest2 zl) (by omega) (by omega) (by omega) hfz3_40 + exact chainLeadsUpTo_imp + ((excursion_bundle m_b).1 19 (d2 :: ds2) rest2 zl + (c1 + z1 + 3 + z2 + 2) ((1 + 2 * z1 + 3) + (m2' + 1) + 2 * z2 + 5) + (by decide) hS1 (validTail40_of_validSegs40 hv_r2) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ he => exit_mono he (by omega) (by omega) (by omega)) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact chainLeadsUpTo_here (Or.inl ⟨c1 + z1 + 3 + z2, by omega, + IsBounce.cons hv_r2 (by omega) (by rw [if_neg hm2_ev]; omega)⟩) + | succ m' => + have hfz2_40 : 40 ≤ fzOf rest1 zl := fzOf_ge_40 hv_r1 + have hphiw : GoodPhiW (c1 + z1 - 1) (d2 :: ds2) false = true := + goodPhiW_of_ge35 hS1.1 (by omega) + -- Helper for x0 >= 42 pushed onto (d2 :: ds2) with c' >= 85: + have h_push85 : ∀ m_b x0 k', 42 ≤ x0 → 1 ≤ k' → k' ≤ 2 * (1 + 2 * z1 + 4) + 3 → + ChainLeadsUpTo m_b ⟨false, rest1, zl, 1 + 2 * z1 + 4, k', 0, x0 :: d2 :: ds2⟩ + (Exit 39 38 107 (d2 :: ds2)) := by + intro m_b x0 k' hx0 hk'1 hk'c + rcases dec_or (67 ≤ x0) with hx67 | hx66 + · exact (excursion_bundle m_b).2 19 (d2 :: ds2) rest1 zl (1 + 2 * z1 + 4) k' x0 39 107 + (by decide) hS1 (Or.inl hne1) hv_r1 (by omega) hk'1 hk'c (by decide) (by omega) + (by omega) (by omega) (by omega) (by omega) + · have hb85 := arith_boost_c85 (c := 1 + 2 * z1 + 4) (k := k') (fz := fzOf rest1 zl) + (by omega) hk'1 hk'c hfz2_40 + have hSx0 : SafeStack 19 (x0 :: d2 :: ds2) := + safeStack_cons_ne1 hne1 hS1 (by omega) (by omega) + have hfb1 := (excursion_bundle m_b).1 19 (x0 :: d2 :: ds2) rest1 zl + (1 + 2 * z1 + 4) k' (by decide) hSx0 (validTail40_of_validSegs40 hv_r1) + (by omega) hk'1 hk'c (by omega) (by omega) (by omega) (by omega) + refine chainLeadsUpTo_trans hfb1 ?_ + intro m_c s_mid hm_c hex1 + rcases hex1 with ⟨phi, hphi, hb⟩ | ⟨y, phi, hy_ox, hphi38, hyw, hb⟩ + · exact chainLeadsUpTo_here (Or.inr ⟨x0, phi, by omega, by omega, by omega, hb⟩) + · exact amega_pop_step hb hphi38 (by omega) (by omega) + (hS1.2.2 (x0 - 1) (by omega)) (fun _ => hS1.2.2 (x0 - 2) (by omega)) + (fun hbig _ _ p1 p2 hvp _ => + chainLeadsUpTo_here (Or.inl ⟨x0 - 1, by omega, isBounce_r9 (by omega) hbig hvp⟩)) + (fun _ _ m_d hm_d p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + have hr10 := arith_boost_r10 (c := x0 + 1) (k := y + 2) (fz := fzOf p1 p2) + (by omega) (by omega) (by omega) hfp + exact chainLeadsUpTo_imp + ((excursion_bundle m_d).1 19 (d2 :: ds2) p1 p2 (x0 + 1) (y + 2) + (by decide) hS1 (validTail40_of_validSegs40 hvp) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ he => exit_mono he (by omega) (by omega) (by omega))) + (fun hy_le _ m_d hm_d p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + have hox140 := arith_boost_cz (c := y) (fz := fzOf p1 p2) (cz_lo := 154) (ox_lo := + 140) + (by omega) hfp (by omega) (Or.inr (Or.inr (Or.inr ⟨rfl, rfl⟩))) + exact fbound_force_r9 (x := x0 - 1) (d3 := d2) (ds3 := ds2) (by omega) + (hS1.2.2 (x0 - 1) (by omega)) (hS1.2.2 (x0 - 2) (by omega)) hvp + (by omega) (by omega) (by omega) (by omega) (by omega) + (fun _ phi2 _ hphi2 _ hb2 => + chainLeadsUpTo_here (Or.inr ⟨x0 - 1, phi2, by omega, by omega, by omega, hb2⟩)) + (fun _ _ _ hb2 => chainLeadsUpTo_here (Or.inl ⟨x0 - 2, by omega, hb2⟩))) + rcases dec_or (m' + 1 = 1) with hm_eq1 | hm_gt1 + · have hm0_eq : m' = 0 := by omega + subst hm0_eq + have hg : stepGuards ⟨false, (z1, 1) :: rest1, zl, c1, 1, 0, d2 :: ds2⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c1 + z1 - 1) (d2 :: ds2) false && + if 1 = 1 then GoodPsi (c1 + z1) (d2 :: ds2) else _) = true + rw [hphiw, Bool.true_and, if_pos rfl] + exact hS1.2.2 (c1 + z1 + 1) (by omega) + apply chainLeadsUpTo_step hg + intro m_b hm_b + dsimp only [stepSegs] + change ChainLeadsUpTo m_b (if 1 = 1 then _ else _) _ + rw [if_pos rfl] + exact h_push85 m_b (c1 + z1 + 1) 1 (by omega) (by omega) (by omega) + · have hpsi_cz : GoodPsi (c1 + z1 - 1) (d2 :: ds2) = true := by + dsimp only [GoodPsi] + have hcz_eq : c1 + z1 - 1 + 1 = c1 + z1 := by omega + rw [hcz_eq]; exact hS1.2.2 (c1 + z1) (by omega) + rcases dec_or ((m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 10) with hev_sm | hnot_ev + · have hg : stepGuards ⟨false, (z1, m' + 1) :: rest1, zl, c1, 1, 0, d2 :: ds2⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c1 + z1 - 1) (d2 :: ds2) false && + if m' + 1 = 1 then _ else GoodPsi (c1 + z1 - 1) (d2 :: ds2) && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 10 then true else _) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, if_pos hev_sm] + apply chainLeadsUpTo_step hg + intro m_b hm_b + dsimp only [stepSegs] + change ChainLeadsUpTo m_b (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 10 then _ else _) _ + rw [if_neg hm_gt1, if_pos hev_sm] + exact h_push85 m_b (c1 + z1) (m' + 2) (by omega) (by omega) (by omega) + · rcases dec_or ((m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 11) with hod_sm | hbig_m + · have hS_cz : SafeStack 19 ((c1 + z1) :: d2 :: ds2) := + safeStack_cons_ne1 hne1 hS1 (by omega) (by omega) + have hg : stepGuards ⟨false, (z1, m' + 1) :: rest1, zl, c1, 1, 0, d2 :: ds2⟩ = true := + by + dsimp only [stepGuards] + change (GoodPhiW (c1 + z1 - 1) (d2 :: ds2) false && + if m' + 1 = 1 then _ else GoodPsi (c1 + z1 - 1) (d2 :: ds2) && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 11 then + GoodDs ((1 + 2 * z1 + 2) :: (c1 + z1) :: d2 :: ds2) else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_pos hod_sm] + exact hS_cz.2.2 (1 + 2 * z1 + 2) (by omega) + apply chainLeadsUpTo_step hg + intro m_b hm_b + dsimp only [stepSegs] + change ChainLeadsUpTo m_b (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_pos hod_sm] + obtain ⟨q10, r10, hr10, hkz10, _⟩ := div10_spec (1 + 2 * z1) + have hm_sub : m' + 1 - 1 = m' := by omega + rw [hm_sub] + have hne1_cz : ((c1 + z1) :: d2 :: ds2) ≠ [1] := by intro h; injection h with h1; omega + have hl1 := (excursion_bundle m_b).2 19 ((c1 + z1) :: d2 :: ds2) rest1 zl + m' 1 (1 + 2 * z1 + 2) (9 * q10 - 2) (1 + 2 * z1 + 35) + (by decide) hS_cz (Or.inl hne1_cz) hv_r1 + (by omega) (by omega) (by omega) (by omega) (by omega) + (by omega) (by omega) (by omega) (by omega) + refine chainLeadsUpTo_trans hl1 ?_ + intro m_c s_mid hm_c hex1 + rcases hex1 with ⟨phi0, hphi0, hb0⟩ | ⟨y0, phi0, hy0, hphi0_38, hyw0, hb0⟩ + · exact chainLeadsUpTo_here (Or.inr ⟨c1 + z1, phi0, by omega, by omega, by omega, hb0⟩) + · exact amega_pop_step hb0 hphi0_38 (by omega) (by omega) + (hS1.2.2 (c1 + z1 - 1) (by omega)) (fun _ => hS1.2.2 (c1 + z1 - 2) (by omega)) + (fun hbig _ _ p1 p2 hvp _ => + chainLeadsUpTo_here (Or.inl ⟨c1 + z1 - 1, + by omega, isBounce_r9 (by omega) hbig hvp⟩)) + (fun _ _ m_d hm_d p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + have hr10 := arith_boost_r10 (c := c1 + z1 + 1) (k := y0 + 2) (fz := fzOf p1 p2) + (by omega) (by omega) (by omega) hfp + exact chainLeadsUpTo_imp + ((excursion_bundle m_d).1 19 (d2 :: ds2) p1 p2 (c1 + z1 + 1) (y0 + 2) + (by decide) hS1 (validTail40_of_validSegs40 hvp) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ he => exit_mono he (by omega) (by omega) (by omega))) + (fun hy0_le _ m_d hm_d p1 p2 hvp hfzp => by + have hfp := fzOf_ge_40 hvp + rcases dec_or (62 ≤ c1 + z1 - 1) with hx62 | hx61 + · exact (excursion_bundle m_d).2 19 (d2 :: ds2) p1 p2 y0 1 (c1 + z1 - 1) 39 107 + (by decide) hS1 (Or.inl hne1) hvp (by omega) (by omega) (by omega) + (by decide) (by omega) (by omega) (by omega) (by omega) (by omega) + · obtain ⟨x0, hx0⟩ : ∃ x0, c1 + z1 - 1 = x0 + 2 := ⟨c1 + z1 - 3, by omega⟩ + rw [hx0] at hx61 ⊢ + have hx0_lo : 39 ≤ x0 := by omega + have hx0_hi : x0 ≤ 59 := by omega + have hox107 := arith_boost_cz (c := y0) (fz := fzOf p1 p2) + (cz_lo := 118) (ox_lo := 107) (by omega) hfp (by omega) + (Or.inr (Or.inl ⟨rfl, rfl⟩)) + have hSx' : SafeStack 19 ((x0 + 2) :: d2 :: ds2) := + safeStack_cons_ne1 hne1 hS1 (by omega) (by omega) + have hfb2 := (excursion_bundle m_d).1 19 ((x0 + 2) :: d2 :: ds2) + p1 p2 y0 1 (by decide) hSx' (validTail40_of_validSegs40 hvp) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) + refine chainLeadsUpTo_trans hfb2 ?_ + intro m_e s_m2 hm_e hex2 + rcases hex2 with ⟨phi2, hphi2, hb2⟩ | ⟨y2, phi2, hy2_ox, hphi2_38, _, hb2⟩ + · have hphi2_106 : 106 ≤ phi2 := by dsimp only [odw] at hphi2; omega + exact chainLeadsUpTo_here (Or.inr ⟨x0 + 2, phi2, + by omega, by omega, by omega, hb2⟩) + · exact amega_pop_step hb2 hphi2_38 (by omega) (by omega) + (hS1.2.2 (x0 + 1) (by omega)) (fun _ => hS1.2.2 x0 (by omega)) + (fun hbig _ _ q1 q2 hvq _ => + chainLeadsUpTo_here (Or.inl ⟨x0 + 1, + by omega, isBounce_r9 (by omega) hbig hvq⟩)) + (fun _ _ m_f hm_f q1 q2 hvq _ => by + have hfq := fzOf_ge_40 hvq + have hr10 := arith_boost_r10 (c := x0 + 3) (k := y2 + 2) (fz := + fzOf q1 q2) + (by omega) (by omega) (by omega) hfq + exact chainLeadsUpTo_imp + ((excursion_bundle m_f).1 19 (d2 :: ds2) q1 q2 (x0 + 3) (y2 + 2) + (by decide) hS1 (validTail40_of_validSegs40 hvq) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) + (by omega)) + (fun _ he => exit_mono he (by omega) (by omega) (by omega))) + (fun hy2_le _ m_f hm_f q1 q2 hvq _ => by + have hfq := fzOf_ge_40 hvq + have hox134 := arith_boost_cz (c := y2) (fz := fzOf q1 q2) + (cz_lo := 148) (ox_lo := 134) (by omega) hfq (by omega) + (Or.inr (Or.inr (Or.inl ⟨rfl, rfl⟩))) + exact fbound_force_r9 (x := x0 + 1) (d3 := d2) (ds3 := ds2) (by omega) + (hS1.2.2 (x0 + 1) (by omega)) (hS1.2.2 x0 (by omega)) hvq + (by omega) (by omega) (by omega) (by omega) (by omega) + (fun _ phi3 _ hphi3 _ hb3 => + chainLeadsUpTo_here (Or.inr ⟨x0 + 1, phi3, + by omega, by omega, by omega, hb3⟩)) + (fun _ _ _ hb3 => chainLeadsUpTo_here (Or.inl ⟨x0, by omega, hb3⟩)))) + · have hm1_big : 2 * (1 + 2 * z1) + 12 ≤ m' + 1 := by omega + have hg : stepGuards ⟨false, (z1, m' + 1) :: rest1, zl, c1, 1, 0, d2 :: ds2⟩ = true := + by + dsimp only [stepGuards] + change (GoodPhiW (c1 + z1 - 1) (d2 :: ds2) false && + if m' + 1 = 1 then _ else GoodPsi (c1 + z1 - 1) (d2 :: ds2) && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 11 then _ else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_neg hbig_m] + apply chainLeadsUpTo_step1 hg + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_neg hbig_m] + have hnorm : normSeg 0 (m' + 1 - 4) = (0, (m' - 4) + 1) := by + dsimp only [normSeg]; rw [if_neg (by omega)]; congr 1; omega + rw [hnorm] + apply chainLeadsUpTo_here + refine Or.inr ⟨c1 + z1, 1 + 2 * z1 + 2, by omega, by omega, by omega, ?_⟩ + have hbc := IsBounce.cons (z0 := 0) (m := m' - 4) (zl := zl) + (cp1 := 1 + 2 * z1 + 2) (kb := 0) (mrg := 2 * (1 + 2 * z1) + 6) + (rest := rest1) (ds := (c1 + z1) :: d2 :: ds2) hv_r1 (by omega) + (by split_ifs <;> omega) + simpa only [Nat.add_zero] using hbc + +theorem loop_k1_le47 {N x1 d3 : Nat} {ds3 : List Nat} {segs : List (Nat × Nat)} {zl c1 : Nat} + {P : SegState → Prop} + (hne1_0 : (d3 :: ds3) ≠ [1]) + (hS0 : SafeStack 21 (d3 :: ds3)) + (hx_lo : 23 ≤ x1 ∨ (x1 = 21 ∧ SafeStack 19 (d3 :: ds3))) + (hx_hi : x1 ≤ 47) + (hv : ValidSegs40 segs zl) (hc1 : 2 ≤ c1) + (h_top : ∀ m z phi, m ≤ N → (z = x1 ∨ z = x1 - 1) → 38 ≤ phi → ∀ s', + IsBounce phi (z :: d3 :: ds3) s' → ChainLeadsUpTo m s' P) + (h_b1 : ∀ m, m < N → ∀ s', IsBounce (x1 - 1) (d3 :: ds3) s' → ChainLeadsUpTo m s' P) + (h_b2 : ∀ m, m < N → ∀ s', IsBounce (x1 - 2) (d3 :: ds3) s' → ChainLeadsUpTo m s' P) + (h_r10 : ∀ m c' k' p1 p2, m < N → c' = x1 + 1 → 41 ≤ k' → k' ≤ 2 * c' + 3 → + ValidSegs40 p1 p2 → ChainLeadsUpTo m ⟨false, p1, p2, c', k', 0, d3 :: ds3⟩ P) : + ChainLeadsUpTo N ⟨false, segs, zl, c1, 1, 0, x1 :: d3 :: ds3⟩ P := by + have hx21 : 21 ≤ x1 := by rcases hx_lo with h | ⟨rfl, _⟩ <;> omega + have hS1 : SafeStack 19 (x1 :: d3 :: ds3) := by + rcases hx_lo with h23 | ⟨rfl, h19⟩ + · exact safeStack_cons_ne1 hne1_0 hS0 (by omega) (by omega) + · exact safeStack_cons_ne1 hne1_0 h19 (by omega) (by omega) + have hg_x1_1 : GoodDs ((x1 - 1) :: d3 :: ds3) = true := by + rcases hx_lo with h23 | ⟨rfl, h19⟩ + · exact hS0.2.2 (x1 - 1) (by omega) + · exact h19.2.2 20 (by decide) + have hg_x1_2 : GoodDs ((x1 - 2) :: d3 :: ds3) = true := by + rcases hx_lo with h23 | ⟨rfl, h19⟩ + · exact hS0.2.2 (x1 - 2) (by omega) + · exact h19.2.2 19 (by decide) + have hne1_1 : (x1 :: d3 :: ds3) ≠ [1] := by intro h; injection h with _ h2; cases h2 + have hb := fbound_k1_boost hne1_1 hS1 hv hc1 (N := N) + refine chainLeadsUpTo_trans hb ?_ + intro m1 s_mid hm1 hex + rcases hex with ⟨phi, hphi38, hsb⟩ | ⟨y1, phi1, hy1_39, hphi1_38, hyw1, hsb⟩ + · exact h_top m1 x1 phi hm1 (Or.inl rfl) hphi38 s_mid hsb + · exact amega_pop_step hsb hphi1_38 (by omega) (by omega) hg_x1_1 (fun _ => hg_x1_2) + (fun hbig m2 hm2 p1 p2 hvp _ => + h_b1 m2 (Nat.lt_of_lt_of_le hm2 hm1) _ (isBounce_r9 (by omega) hbig hvp)) + (fun _ _ m2 hm2 p1 p2 hvp _ => + h_r10 m2 (x1 + 1) (y1 + 2) p1 p2 (Nat.lt_of_lt_of_le hm2 hm1) + rfl (by omega) (by omega) hvp) + (fun hy1_le _ m2 hm2 p1 p2 hvp hfzp => by + have hfp := fzOf_ge_40 hvp + have hox99 := arith_boost_cz (c := y1) (fz := fzOf p1 p2) (cz_lo := 109) (ox_lo := 99) + (by omega) hfp (by omega) (Or.inl ⟨rfl, rfl⟩) + exact fbound_force_r9 (x := x1 - 1) (d3 := d3) (ds3 := ds3) (by omega) + hg_x1_1 hg_x1_2 hvp (by omega) (by omega) (by omega) (by omega) (by omega) + (fun m3 phi2 hm3 hphi2 s' hb2 => + h_top m3 (x1 - 1) phi2 (Nat.le_trans hm3 (Nat.le_of_lt (Nat.lt_of_lt_of_le hm2 hm1))) + (Or.inr rfl) (by omega) s' hb2) + (fun m3 hm3 s' hb2 => + h_b2 m3 (Nat.lt_trans hm3 (Nat.lt_of_lt_of_le hm2 hm1)) s' hb2)) + +-- ============================================================================ +-- Odd-cz53 High Excursion Extension (`ExitHighOdd`, `loopOS_odd`, `fhigh_ext`) +-- ============================================================================ + +def ExitHighExt (S : List Nat) (s : SegState) : Prop := + ExitHigh S s ∨ (∃ y phi, 53 ≤ y ∧ y % 2 = 1 ∧ 88 ≤ phi ∧ IsBounce phi (y :: S) s) + +theorem arith_los_odd_r11 {c k fz x y phi fz3 : Nat} + (_hc : 2 ≤ c) (_hk1 : 1 ≤ k) (hkc : k ≤ 2 * c + 3) (_hfz : 40 ≤ fz) + (_hx : 89 ≤ x) (_hpot : 2079 ≤ (c + fz) + 21 * x) + (_hy_lo : ox (k + 2 * fz) (c + fz) ≤ y) (_hy_hi : y ≤ 2 * x + 4) + (_hphi38 : 38 ≤ phi) (_hyw : oxw (k + 2 * fz) (c + fz) ≤ y + phi) + (_hfz3 : phi + 2 ≤ fz3) : + 39 ≤ y ∧ 89 ≤ x - 1 ∧ 2079 ≤ (y + fz3) + 21 * (x - 1) := by + obtain ⟨q, r, hr, heq, hox⟩ := ox_spec_lt (kz := k + 2 * fz) (cz := c + fz) (by omega) + obtain ⟨qw, rw_, hrw, hkw, hdw⟩ := div20_spec (k + 2 * fz) + dsimp only [oxw] at _hyw + rw [hdw] at _hyw + rw [hox] at _hy_lo + omega + +theorem loopOS_odd (N : Nat) : + ∀ S segs zl c k x cz_out, + S ≠ [1] → SafeStack 43 S → ValidSegs40 segs zl → + 2 ≤ c → 1 ≤ k → k ≤ 2 * c + 3 → + 53 ≤ cz_out → cz_out % 2 = 1 → + 89 ≤ x → 2079 ≤ (c + fzOf segs zl) + 21 * x → + ChainLeadsUpTo N ⟨false, segs, zl, c, k, 0, x :: cz_out :: S⟩ (ExitHighExt S) := by + induction N using Nat.strong_induction_on with + | h N ih => + intro S segs zl c k x cz_out hne1 hS hv hc hk1 hkc hcz_out hcz_odd hx89 hpot + have hfz40 : 40 ≤ fzOf segs zl := fzOf_ge_40 hv + have hox39 : 39 ≤ ox (k + 2 * fzOf segs zl) (c + fzOf segs zl) := + (ox_bounds_relaxed (by omega) hk1 hkc (by omega) (by omega) (by omega)).1 + have hS_cz : SafeStack 19 (cz_out :: S) := safeStack_cons_ne1 hne1 hS (by omega) (by omega) + have hne1_cz : (cz_out :: S) ≠ [1] := by intro h; injection h with h1; omega + have hS_xcz : SafeStack 19 (x :: cz_out :: S) := + safeStack_cons_ne1 hne1_cz hS_cz (by omega) (by omega) + have hfb := (excursion_bundle N).1 19 (x :: cz_out :: S) segs zl c k (by decide) hS_xcz + (validTail40_of_validSegs40 hv) (by omega) hk1 hkc (by omega) (by omega) (by omega) (by omega) + refine chainLeadsUpTo_trans hfb ?_ + intro m1 s_mid hm1 hexit + rcases hexit with ⟨phi, hphi_odw, hb⟩ | ⟨y, phi, hy_ox, hphi38, hyw, hb⟩ + · obtain ⟨q0, r0, hr0, heq0, hox0⟩ := + ox_spec_lt (kz := k + 2 * fzOf segs zl) (cz := c + fzOf segs zl) (by omega) + dsimp only [odw] at hphi_odw + rw [hox0] at hphi_odw hox39 + have hphi38 : 38 ≤ phi := by omega + exact amega_pop_step hb hphi38 (by omega) (by omega) + (hS.2.2 (cz_out - 1) (by omega)) (fun _ => hS.2.2 (cz_out - 2) (by omega)) + (fun hbig _ _ p1 p2 hvp _ => + chainLeadsUpTo_here (Or.inl (Or.inl ⟨cz_out - 1, + by omega, isBounce_r9 (by omega) hbig hvp⟩))) + (fun _ _ m2 hm2 p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + exact chainLeadsUpTo_imp + ((fhigh_bundle m2).1 S p1 p2 (cz_out + 1) (x + 2) hne1 hS hvp + (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ he => Or.inl he)) + (fun _ _ m2 hm2 p1 p2 hvp hfzp => by + have hfp := fzOf_ge_40 hvp + exact chainLeadsUpTo_imp + ((fhigh_bundle m2).2.1 S p1 p2 x 1 (cz_out - 1) hne1 hS hvp + (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ he => Or.inl he)) + · exact amega_pop_step hb hphi38 (by omega) (by omega) + (hS_cz.2.2 (x - 1) (by omega)) (fun _ => hS_cz.2.2 (x - 2) (by omega)) + (fun hbig _ _ p1 p2 hvp _ => + chainLeadsUpTo_here (Or.inr ⟨cz_out, x - 1, hcz_out, hcz_odd, by omega, + isBounce_r9 (by omega) hbig hvp⟩)) + (fun hy_hi _ m2 hm2 p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + obtain ⟨q0, r0, hr0, heq0, hox0⟩ := + ox_spec_lt (kz := k + 2 * fzOf segs zl) (cz := c + fzOf segs zl) (by omega) + rw [hox0] at hy_ox + exact chainLeadsUpTo_imp + ((fhigh_bundle m2).2.1 S p1 p2 (x + 1) (y + 2) cz_out hne1 hS hvp + (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ he => Or.inl he)) + (fun hy_le _ m2 hm2 p1 p2 hvp hfzp => by + have hlos := arith_los_odd_r11 hc hk1 hkc hfz40 hx89 hpot hy_ox hy_le hphi38 hyw hfzp + exact ih m2 (by omega) S p1 p2 y 1 (x - 1) cz_out hne1 hS hvp + (by omega) (by omega) (by omega) hcz_out hcz_odd hlos.2.1 hlos.2.2) + +theorem fhigh_ext {N : Nat} {S : List Nat} {segs : List (Nat × Nat)} {zl c : Nat} + (hne1 : S ≠ [1]) (hS : SafeStack 43 S) (hv : ValidSegs40 segs zl) + (hc : 2 ≤ c) (hcz53 : 53 ≤ c + fzOf segs zl) + (hkz95 : 95 ≤ 1 + 2 * fzOf segs zl) + (hodd : 1 + 2 * fzOf segs zl < 97 → (c + fzOf segs zl) % 2 = 1) : + ChainLeadsUpTo N ⟨false, segs, zl, c, 1, 0, S⟩ (ExitHighExt S) := by + rcases dec_or (97 ≤ 1 + 2 * fzOf segs zl) with h97 | hlt97 + · exact chainLeadsUpTo_imp + ((fhigh_bundle N).1 S segs zl c 1 hne1 hS hv hc (by decide) (by omega) hcz53 h97) + (fun _ he => Or.inl he) + · have hcz_odd : (c + fzOf segs zl) % 2 = 1 := hodd (by omega) + rcases segs with _ | ⟨⟨z0, m0⟩, rest⟩ + · dsimp only [fzOf] at hlt97; have := hv.2; omega + · dsimp only [fzOf] at hcz53 hkz95 hlt97 hcz_odd + have hz0_eq : z0 = 47 := by omega + subst hz0_eq + have hv_rest : ValidSegs40 rest zl := validSegs40_tail hv + cases m0 with + | zero => + have hg1 : stepGuards ⟨false, (47, 0) :: rest, zl, c, 1, 0, S⟩ = true := rfl + apply chainLeadsUpTo_step hg1 + intro m1 hm1 + dsimp only [stepSegs] + rcases rest with _ | ⟨⟨z1, m1_seg⟩, rest2⟩ + · have := hv_rest.2 + exact chainLeadsUpTo_here (Or.inl (Or.inl ⟨c + 47 + 3 + zl, + by omega, IsBounce.nil (by omega)⟩)) + · have hz1_40 : 40 ≤ z1 := fzOf_ge_40 hv_rest + have hv_r2 : ValidSegs40 rest2 zl := validSegs40_tail hv_rest + have hfz2_40 : 40 ≤ fzOf rest2 zl := fzOf_ge_40 hv_r2 + cases m1_seg with + | zero => + have hg2 : stepGuards ⟨true, (z1, 0) :: rest2, zl, c + 50, 98, 2 * (c + 47) + 8, S⟩ = + true := by + dsimp only [stepGuards]; exact decide_eq_true (by omega) + apply chainLeadsUpTo_step hg2 + intro m2 _ + dsimp only [stepSegs] + exact chainLeadsUpTo_imp + ((fhigh_bundle m2).1 S rest2 zl (c + 50 + z1 + 1) (98 + 2 * z1 + 3) + hne1 hS hv_r2 (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ he => Or.inl he) + | succ m1' => + rcases dec_or ((m1' + 1) % 2 = 1) with hm1_od | hm1_ev + · cases hd_mrg : decide (2 * (c + 47) + 8 ≥ 98 + m1') with + | true => + have hg2 : stepGuards ⟨true, (z1, m1' + 1) :: rest2, zl, c + 50, 98, + 2 * (c + 47) + 8, S⟩ = true := by + dsimp only [stepGuards]; rw [if_pos hm1_od, hd_mrg, if_pos rfl] + exact hS.2.2 (c + 50 + z1) (by omega) + apply chainLeadsUpTo_step hg2 + intro m2 _ + dsimp only [stepSegs]; rw [if_pos hm1_od, hd_mrg, if_pos rfl] + exact chainLeadsUpTo_imp + ((fhigh_bundle m2).2.1 S rest2 zl (98 + m1' + 2 * z1 + 4) 1 (c + 50 + z1) + hne1 hS hv_r2 (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ he => Or.inl he) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact chainLeadsUpTo_here (Or.inl (Or.inl ⟨c + 50 + z1, by omega, + IsBounce.cons hv_r2 (by omega) (by rw [if_pos hm1_od]; omega)⟩)) + · cases hd_mrg : decide (2 * (c + 47) + 8 ≥ 98 + (m1' + 1)) with + | true => + have h_mrg := of_decide_eq_true hd_mrg + have hg2 : stepGuards ⟨true, (z1, m1' + 1) :: rest2, zl, c + 50, 98, + 2 * (c + 47) + 8, S⟩ = true := by + dsimp only [stepGuards]; rw [if_neg hm1_ev, hd_mrg, if_pos rfl] + apply chainLeadsUpTo_step hg2 + intro m2 _ + dsimp only [stepSegs]; rw [if_neg hm1_ev, hd_mrg, if_pos rfl] + exact chainLeadsUpTo_imp + ((fhigh_bundle m2).1 S rest2 zl (c + 50 + z1 + 2) (98 + (m1' + 1) + 2 * z1 + 5) + hne1 hS hv_r2 (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ he => Or.inl he) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact chainLeadsUpTo_here (Or.inl (Or.inl ⟨c + 50 + z1, by omega, + IsBounce.cons hv_r2 (by omega) (by rw [if_neg hm1_ev]; omega)⟩)) + | succ m' => + have hfz1_40 : 40 ≤ fzOf rest zl := fzOf_ge_40 hv_rest + have hphiw : GoodPhiW (c + 47 - 1) S false = true := goodPhiW_of_ge35 hS.1 (by omega) + rcases dec_or (m' + 1 = 1) with hm1 | hm_gt1 + · have hm0_eq : m' = 0 := by omega + subst hm0_eq + have hg : stepGuards ⟨false, (47, 1) :: rest, zl, c, 1, 0, S⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + 47 - 1) S false && if 1 = 1 then GoodPsi (c + 47) S else _) = true + rw [hphiw, Bool.true_and, if_pos rfl] + exact hS.2.2 (c + 48) (by omega) + apply chainLeadsUpTo_step hg + intro m1 _ + dsimp only [stepSegs] + change ChainLeadsUpTo m1 (if 1 = 1 then _ else _) _ + rw [if_pos rfl] + exact chainLeadsUpTo_imp + ((fhigh_bundle m1).2.1 S rest zl 99 1 (c + 48) + hne1 hS hv_rest (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ he => Or.inl he) + · have hpsi_cz : GoodPsi (c + 47 - 1) S = true := by + dsimp only [GoodPsi] + have hcz_eq : c + 47 - 1 + 1 = c + 47 := by omega + rw [hcz_eq]; exact hS.2.2 (c + 47) (by omega) + rcases dec_or ((m' + 1) % 2 = 0 ∧ m' + 1 ≤ 200) with hev_sm | hnot_ev + · have hg : stepGuards ⟨false, (47, m' + 1) :: rest, zl, c, 1, 0, S⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + 47 - 1) S false && + if m' + 1 = 1 then _ else GoodPsi (c + 47 - 1) S && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 200 then true else _) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, if_pos hev_sm] + apply chainLeadsUpTo_step hg + intro m1 _ + dsimp only [stepSegs] + change ChainLeadsUpTo m1 (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 200 then _ else _) _ + rw [if_neg hm_gt1, if_pos hev_sm] + exact chainLeadsUpTo_imp + ((fhigh_bundle m1).2.1 S rest zl 99 (m' + 2) (c + 47) + hne1 hS hv_rest (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ he => Or.inl he) + · rcases dec_or ((m' + 1) % 2 = 1 ∧ m' + 1 ≤ 201) with hod_sm | hbig_m + · have hS_cz : SafeStack 19 ((c + 47) :: S) := + safeStack_cons_ne1 hne1 hS (by omega) (by omega) + have hg : stepGuards ⟨false, (47, m' + 1) :: rest, zl, c, 1, 0, S⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + 47 - 1) S false && + if m' + 1 = 1 then _ else GoodPsi (c + 47 - 1) S && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 200 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 201 then + GoodDs (97 :: (c + 47) :: S) else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_pos hod_sm] + exact hS_cz.2.2 97 (by decide) + apply chainLeadsUpTo_step hg + intro m1 _ + dsimp only [stepSegs] + change ChainLeadsUpTo m1 (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 200 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 201 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_pos hod_sm] + have hm_sub : m' + 1 - 1 = m' := by omega + rw [hm_sub] + exact loopOS_odd m1 S rest zl m' 1 97 (c + 47) hne1 hS hv_rest + (by omega) (by decide) (by omega) hcz53 hcz_odd (by decide) (by omega) + · have hg : stepGuards ⟨false, (47, m' + 1) :: rest, zl, c, 1, 0, S⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + 47 - 1) S false && + if m' + 1 = 1 then _ else GoodPsi (c + 47 - 1) S && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 200 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 201 then _ else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_neg hbig_m] + apply chainLeadsUpTo_step1 hg + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 200 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 201 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_neg hbig_m] + have hnorm : normSeg 0 (m' + 1 - 4) = (0, (m' - 4) + 1) := by + dsimp only [normSeg]; rw [if_neg (by omega)]; congr 1; omega + rw [hnorm] + apply chainLeadsUpTo_here + refine Or.inl (Or.inr ⟨c + 47, 97, by omega, Or.inl ⟨hcz53, by decide⟩, ?_⟩) + have hbc := IsBounce.cons (z0 := 0) (m := m' - 4) (zl := zl) + (cp1 := 97) (kb := 0) (mrg := 196) + (rest := rest) (ds := (c + 47) :: S) hv_rest (by omega) + (by split_ifs <;> omega) + simpa only [Nat.add_zero] using hbc + +-- ============================================================================ +-- Root Invariant (`Root0`, `Root1`, `Root31`, `RootD`, `RootD1`, `RootInv`) +-- ============================================================================ + +def Root0A (s : SegState) : Prop := + s.ds = [] ∧ s.cp1 = 1 ∧ s.kb = 1 ∧ + ∃ z1 m0 m1 rest, + s.segs = (8, m0) :: (z1, m1) :: rest ∧ + (m0 = 1 ∨ m0 = 2) ∧ 36 ≤ z1 ∧ ValidSegs40 rest s.zl + +def Root0B (s : SegState) : Prop := + (s.ds = [] ∨ s.ds = [0]) ∧ + ValidTail40 s.segs s.zl ∧ + 1 ≤ s.cp1 ∧ 1 ≤ s.kb ∧ s.kb ≤ 2 * s.cp1 + 3 ∧ + 7 ≤ fzOf s.segs s.zl ∧ 8 ≤ s.cp1 + fzOf s.segs s.zl ∧ + (s.cp1 + fzOf s.segs s.zl = 8 → ∃ m0 rest, + s.segs = (7, m0) :: rest ∧ s.cp1 = 1 ∧ s.kb = 1 ∧ s.ds = [0] ∧ 44 ≤ fzOf rest s.zl) ∧ + (fzOf s.segs s.zl < 39 → + (s.cp1 = 1 ∧ s.kb = 1) ∨ (s.cp1 = 2 ∧ s.kb = 5 ∧ 20 ≤ fzOf s.segs s.zl)) ∧ + (∀ z0 m0 rest, s.segs = (z0, m0) :: rest → s.cp1 + fzOf s.segs s.zl = 9 → + 3 ≤ m0 → m0 % 2 = 1 → + 53 ≤ (m0 - 1) + fzOf rest s.zl ∧ 95 ≤ 1 + 2 * fzOf rest s.zl ∧ + (1 + 2 * fzOf rest s.zl < 97 → ((m0 - 1) + fzOf rest s.zl) % 2 = 1)) + +def Root0 (s : SegState) : Prop := + Root0A s ∨ Root0B s + +def Root1 (s : SegState) : Prop := + s.ds = [1] ∧ + ValidTail40 s.segs s.zl ∧ + 5 ≤ s.cp1 ∧ 1 ≤ s.kb ∧ s.kb ≤ 2 * s.cp1 + 3 ∧ + 20 ≤ fzOf s.segs s.zl ∧ 45 ≤ s.kb + 2 * fzOf s.segs s.zl ∧ + (s.cp1 + fzOf s.segs s.zl = 25 → ∃ m0 rest, + s.segs = (20, m0) :: rest ∧ s.cp1 = 5 ∧ s.kb = 5 ∧ 6 ≤ m0 ∧ + (m0 % 2 = 1 → 102 ≤ (m0 - 1) + fzOf rest s.zl ∧ 185 ≤ 1 + 2 * fzOf rest s.zl)) ∧ + (26 ≤ s.cp1 + fzOf s.segs s.zl → 47 ≤ s.kb + 2 * fzOf s.segs s.zl) + +def Root31A (s : SegState) : Prop := + s.ds = [3, 1] ∧ ValidTail40 s.segs s.zl ∧ + s.cp1 = 2 ∧ s.kb = 1 ∧ + (fzOf s.segs s.zl = 18 ∨ fzOf s.segs s.zl = 19 ∨ ∃ rest, s.segs = (20, 0) :: rest) + +def Root31B (s : SegState) : Prop := + s.ds = [3, 1] ∧ + ValidTail40 s.segs s.zl ∧ + 2 ≤ s.cp1 ∧ 1 ≤ s.kb ∧ s.kb ≤ 2 * s.cp1 + 3 ∧ + 21 ≤ fzOf s.segs s.zl ∧ 25 ≤ s.cp1 + fzOf s.segs s.zl ∧ 43 ≤ s.kb + 2 * fzOf s.segs s.zl ∧ + (∀ z0 m0 rest, s.segs = (z0, m0) :: rest → (s.cp1 + z0) % 2 = 0 → 3 ≤ m0 → m0 % 2 = 1 → + (s.cp1 = 4 ∧ s.kb = 1 ∧ z0 = 22) ∨ 47 ≤ s.kb + 2 * z0) + +def Root31 (s : SegState) : Prop := + Root31A s ∨ Root31B s + +def RootD (s : SegState) : Prop := + (∃ d, 8 ≤ d ∧ (s.ds = [d] ∨ s.ds = [d, 0])) ∧ + ValidTail40 s.segs s.zl ∧ + 1 ≤ s.cp1 ∧ 1 ≤ s.kb ∧ s.kb ≤ 2 * s.cp1 + 3 ∧ + 35 ≤ fzOf s.segs s.zl ∧ 42 ≤ s.cp1 + fzOf s.segs s.zl ∧ 73 ≤ s.kb + 2 * fzOf s.segs s.zl + +def RootD1 (s : SegState) : Prop := + (∃ d, 25 ≤ d ∧ s.ds = [d, 1]) ∧ + ValidTail40 s.segs s.zl ∧ + 2 ≤ s.cp1 ∧ 1 ≤ s.kb ∧ s.kb ≤ 2 * s.cp1 + 3 ∧ + 40 ≤ fzOf s.segs s.zl ∧ 62 ≤ s.cp1 + fzOf s.segs s.zl ∧ 81 ≤ s.kb + 2 * fzOf s.segs s.zl + +def RootInv (s : SegState) : Prop := + s.b = false ∧ s.mrg = 0 ∧ (Root0 s ∨ Root1 s ∨ Root31 s ∨ RootD s ∨ RootD1 s) + +theorem rootInv_of_0A {z1 m0 m1 zl : Nat} {rest : List (Nat × Nat)} + (hm0 : m0 = 1 ∨ m0 = 2) (hz1 : 36 ≤ z1) (hv : ValidSegs40 rest zl) : + RootInv ⟨false, (8, m0) :: (z1, m1) :: rest, zl, 1, 1, 0, []⟩ := + ⟨rfl, rfl, Or.inl (Or.inl ⟨rfl, rfl, rfl, z1, m0, m1, rest, rfl, hm0, hz1, hv⟩)⟩ + +theorem rootInv_of_0B {segs : List (Nat × Nat)} {zl c k : Nat} {ds : List Nat} + (hds : ds = [] ∨ ds = [0]) (hvt : ValidTail40 segs zl) + (hc : 1 ≤ c) (hk : 1 ≤ k) (hkc : k ≤ 2 * c + 3) + (hfz : 7 ≤ fzOf segs zl) (hcz : 8 ≤ c + fzOf segs zl) + (h8 : c + fzOf segs zl = 8 → ∃ m0 rest, + segs = (7, m0) :: rest ∧ c = 1 ∧ k = 1 ∧ ds = [0] ∧ 44 ≤ fzOf rest zl) + (h39 : fzOf segs zl < 39 → (c = 1 ∧ k = 1) ∨ (c = 2 ∧ k = 5 ∧ 20 ≤ fzOf segs zl)) + (h9 : ∀ z0 m0 rest, segs = (z0, m0) :: rest → c + fzOf segs zl = 9 → + 3 ≤ m0 → m0 % 2 = 1 → + 53 ≤ (m0 - 1) + fzOf rest zl ∧ 95 ≤ 1 + 2 * fzOf rest zl ∧ + (1 + 2 * fzOf rest zl < 97 → ((m0 - 1) + fzOf rest zl) % 2 = 1)) : + RootInv ⟨false, segs, zl, c, k, 0, ds⟩ := + ⟨rfl, rfl, Or.inl (Or.inr ⟨hds, hvt, hc, hk, hkc, hfz, hcz, h8, h39, h9⟩)⟩ + +theorem rootInv_of_1 {segs : List (Nat × Nat)} {zl c k : Nat} + (hvt : ValidTail40 segs zl) + (hc : 5 ≤ c) (hk : 1 ≤ k) (hkc : k ≤ 2 * c + 3) + (hfz : 20 ≤ fzOf segs zl) (hkz : 45 ≤ k + 2 * fzOf segs zl) + (h25 : c + fzOf segs zl = 25 → ∃ m0 rest, + segs = (20, m0) :: rest ∧ c = 5 ∧ k = 5 ∧ 6 ≤ m0 ∧ + (m0 % 2 = 1 → 102 ≤ (m0 - 1) + fzOf rest zl ∧ 185 ≤ 1 + 2 * fzOf rest zl)) + (h26 : 26 ≤ c + fzOf segs zl → 47 ≤ k + 2 * fzOf segs zl) : + RootInv ⟨false, segs, zl, c, k, 0, [1]⟩ := + ⟨rfl, rfl, Or.inr (Or.inl ⟨rfl, hvt, hc, hk, hkc, hfz, hkz, h25, h26⟩)⟩ + +theorem rootInv_of_31A {segs : List (Nat × Nat)} {zl : Nat} + (hvt : ValidTail40 segs zl) + (hfz : fzOf segs zl = 18 ∨ fzOf segs zl = 19 ∨ ∃ rest, segs = (20, 0) :: rest) : + RootInv ⟨false, segs, zl, 2, 1, 0, [3, 1]⟩ := + ⟨rfl, rfl, Or.inr (Or.inr (Or.inl (Or.inl ⟨rfl, hvt, rfl, rfl, hfz⟩)))⟩ + +theorem rootInv_of_31B {segs : List (Nat × Nat)} {zl c k : Nat} {ds : List Nat} + (hds : ds = [3, 1]) (hvt : ValidTail40 segs zl) + (hc : 2 ≤ c) (hk : 1 ≤ k) (hkc : k ≤ 2 * c + 3) + (hfz : 21 ≤ fzOf segs zl) (hcz : 25 ≤ c + fzOf segs zl) (hkz : 43 ≤ k + 2 * fzOf segs zl) + (hod : ∀ z0 m0 rest, segs = (z0, m0) :: rest → (c + z0) % 2 = 0 → 3 ≤ m0 → m0 % 2 = 1 → + (c = 4 ∧ k = 1 ∧ z0 = 22) ∨ 47 ≤ k + 2 * z0) : + RootInv ⟨false, segs, zl, c, k, 0, ds⟩ := + ⟨rfl, rfl, Or.inr (Or.inr (Or.inl (Or.inr ⟨hds, hvt, hc, hk, hkc, hfz, hcz, hkz, hod⟩)))⟩ + +theorem rootInv_of_D {segs : List (Nat × Nat)} {zl c k d : Nat} {ds : List Nat} + (hd : 8 ≤ d) (hds : ds = [d] ∨ ds = [d, 0]) (hvt : ValidTail40 segs zl) + (hc : 1 ≤ c) (hk : 1 ≤ k) (hkc : k ≤ 2 * c + 3) + (hfz : 35 ≤ fzOf segs zl) (hcz : 42 ≤ c + fzOf segs zl) (hkz : 73 ≤ k + 2 * fzOf segs zl) : + RootInv ⟨false, segs, zl, c, k, 0, ds⟩ := + ⟨rfl, rfl, Or.inr (Or.inr (Or.inr (Or.inl ⟨⟨d, hd, hds⟩, hvt, hc, hk, hkc, hfz, hcz, hkz⟩)))⟩ + +theorem rootInv_of_D1 {segs : List (Nat × Nat)} {zl c k d : Nat} + (hd : 25 ≤ d) (hvt : ValidTail40 segs zl) + (hc : 2 ≤ c) (hk : 1 ≤ k) (hkc : k ≤ 2 * c + 3) + (hfz : 40 ≤ fzOf segs zl) (hcz : 62 ≤ c + fzOf segs zl) (hkz : 81 ≤ k + 2 * fzOf segs zl) : + RootInv ⟨false, segs, zl, c, k, 0, [d, 1]⟩ := + ⟨rfl, rfl, Or.inr (Or.inr (Or.inr (Or.inr ⟨⟨d, hd, rfl⟩, hvt, hc, hk, hkc, hfz, hcz, hkz⟩)))⟩ + +-- ============================================================================ +-- Drain-Pop Closure Lemmas (`IsBounce phi ds s -> ChainLeadsUpTo N s RootInv`) +-- ============================================================================ + +theorem bounce_nil_leads {N phi : Nat} {s : SegState} + (hb : IsBounce phi [] s) (hphi : 9 ≤ phi) : + ChainLeadsUpTo N s RootInv := by + have hg_pop : drainPopGuards phi [] = true := by + change decide (phi ≥ 2) = true + exact decide_eq_true (by omega) + obtain ⟨hg_s, _, hp, m_rem, rest, zl, hv_rest, hzl_false, hstep⟩ := isBounce_step hb hg_pop + apply chainLeadsUpTo_step1 hg_s + rw [hstep] + set p := pushSeg hp (phi + 1) m_rem rest zl + have hdp : drainPopStep hp phi m_rem rest zl [] = ⟨false, p.1, p.2, 1, 1, 0, []⟩ := rfl + rw [hdp] + have hvt : ValidTail40 p.1 p.2 := + validTail40_pushSeg hp hv_rest (fun hf => by have := hzl_false hf; omega) + have hfzp : phi + 1 ≤ fzOf p.1 p.2 := fzOf_pushSeg_ge hp (phi + 1) m_rem rest zl + exact chainLeadsUpTo_here (rootInv_of_0B (Or.inl rfl) hvt (by decide) (by decide) (by decide) + (by omega) (by omega) (by intro h; omega) (fun _ => Or.inl ⟨rfl, rfl⟩) + (by intro _ _ _ _ hcz9; omega)) + +theorem bounce_zero_leads {N phi : Nat} {s : SegState} + (hb : IsBounce phi [0] s) (hphi : 38 ≤ phi) : + ChainLeadsUpTo N s RootInv := by + have hg_pop : drainPopGuards phi [0] = true := by + change decide (phi ≥ 2) = true + exact decide_eq_true (by omega) + obtain ⟨hg_s, _, hp, m_rem, rest, zl, hv_rest, hzl_false, hstep⟩ := isBounce_step hb hg_pop + apply chainLeadsUpTo_step hg_s + intro m1 _ + rw [hstep] + set p := pushSeg hp (phi + 2) m_rem rest zl + have hdp : drainPopStep hp phi m_rem rest zl [0] = ⟨true, p.1, p.2, 2, 2, 6, []⟩ := rfl + rw [hdp] + have hvp : ValidSegs40 p.1 p.2 := + validSegs40_pushSeg hp (by omega) hv_rest (fun hf => by have := hzl_false hf; omega) + rcases h_p1 : p.1 with _ | ⟨⟨z1, m1_seg⟩, r2⟩ + · have hzl230 : 230 ≤ p.2 := by rw [h_p1] at hvp; exact hvp.2 + exact bounce_nil_leads (IsBounce.nil (by omega)) (by omega) + · rw [h_p1] at hvp + have hz1_40 : 40 ≤ z1 := fzOf_ge_40 hvp + have hv_r2 : ValidSegs40 r2 p.2 := validSegs40_tail hvp + have hfz2_40 : 40 ≤ fzOf r2 p.2 := fzOf_ge_40 hv_r2 + cases m1_seg with + | zero => + have hg2 : stepGuards ⟨true, (z1, 0) :: r2, p.2, 2, 2, 6, []⟩ = true := rfl + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs] + exact chainLeadsUpTo_here (rootInv_of_0B (Or.inl rfl) (validTail40_of_validSegs40 hv_r2) + (by omega) (by omega) (by omega) (by omega) (by omega) + (by intro h; omega) (by intro h; omega) (by intro _ _ _ _ hcz9; omega)) + | succ m1' => + rcases dec_or ((m1' + 1) % 2 = 1) with hod | hev + · cases hd_mrg : decide (6 ≥ 2 + m1') with + | true => + have hg2 : stepGuards ⟨true, (z1, m1' + 1) :: r2, p.2, 2, 2, 6, []⟩ = true := by + dsimp only [stepGuards]; rw [if_pos hod, hd_mrg, if_pos rfl] + exact safeStack_nil.2.2 (2 + z1) (by omega) + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs]; rw [if_pos hod, hd_mrg, if_pos rfl] + exact chainLeadsUpTo_here (rootInv_of_D (d := 2 + z1) (by omega) (Or.inl rfl) + (validTail40_of_validSegs40 hv_r2) (by omega) (by omega) (by omega) + (by omega) (by omega) (by omega)) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact bounce_nil_leads + (IsBounce.cons hv_r2 (by omega) (by rw [if_pos hod]; omega)) (by omega) + · cases hd_mrg : decide (6 ≥ 2 + (m1' + 1)) with + | true => + have h_mrg := of_decide_eq_true hd_mrg + have hg2 : stepGuards ⟨true, (z1, m1' + 1) :: r2, p.2, 2, 2, 6, []⟩ = true := by + dsimp only [stepGuards]; rw [if_neg hev, hd_mrg, if_pos rfl] + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs]; rw [if_neg hev, hd_mrg, if_pos rfl] + exact chainLeadsUpTo_here (rootInv_of_0B (Or.inl rfl) (validTail40_of_validSegs40 hv_r2) + (by omega) (by omega) (by omega) (by omega) (by omega) + (by intro h; omega) (by intro h; omega) (by intro _ _ _ _ hcz9; omega)) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact bounce_nil_leads (IsBounce.cons hv_r2 (by omega) (by rw [if_neg hev]; omega)) + (by omega) + +theorem bounce_one_leads {N phi : Nat} {s : SegState} + (hb : IsBounce phi [1] s) (hphi : 24 ≤ phi) : + ChainLeadsUpTo N s RootInv := by + have hg_pop : drainPopGuards phi [1] = true := by + change decide (phi ≥ 2) = true + exact decide_eq_true (by omega) + obtain ⟨hg_s, _, hp, m_rem, rest, zl, hv_rest, hzl_false, hstep⟩ := isBounce_step hb hg_pop + apply chainLeadsUpTo_step hg_s + intro m1 _ + rw [hstep] + have hdp : drainPopStep hp phi m_rem rest zl [1] = + ⟨true, (pushSeg hp (phi + 3) m_rem rest zl).1, (pushSeg hp (phi + 3) m_rem rest zl).2, + 2, 0, 6, []⟩ := rfl + rw [hdp] + cases hp with + | false => + have hzl230 : 230 ≤ phi := hzl_false rfl + change ChainLeadsUpTo m1 ⟨true, [], phi + 3, 2, 0, 6, []⟩ RootInv + exact bounce_nil_leads (IsBounce.nil (by omega)) (by omega) + | true => + have hv_r : ValidSegs40 rest zl := hv_rest rfl + have hfz_r : 40 ≤ fzOf rest zl := fzOf_ge_40 hv_r + dsimp only [pushSeg, ite_true] + cases m_rem with + | zero => + dsimp only [normSeg, ite_true] + have hg2 : stepGuards ⟨true, (phi + 3 + 1, 0) :: rest, zl, 2, 0, 6, []⟩ = true := rfl + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs] + exact chainLeadsUpTo_here (rootInv_of_0B (Or.inl rfl) (validTail40_of_validSegs40 hv_r) + (by omega) (by omega) (by omega) (by omega) (by omega) + (by intro h; omega) (by intro h; omega) (by intro _ _ _ _ hcz9; omega)) + | succ mr' => + have hnorm : normSeg (phi + 3) (mr' + 1) = (phi + 3, mr' + 1) := rfl + rw [hnorm] + rcases dec_or ((mr' + 1) % 2 = 1) with hod | hev + · cases hd_mrg : decide (6 ≥ 0 + mr') with + | true => + have hg2 : stepGuards ⟨true, (phi + 3, mr' + 1) :: rest, zl, 2, 0, 6, []⟩ = true := by + dsimp only [stepGuards]; rw [if_pos hod, hd_mrg, if_pos rfl] + exact safeStack_nil.2.2 (2 + (phi + 3)) (by omega) + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs]; rw [if_pos hod, hd_mrg, if_pos rfl] + exact chainLeadsUpTo_here (rootInv_of_D (d := 2 + (phi + 3)) (by omega) (Or.inl rfl) + (validTail40_of_validSegs40 hv_r) (by omega) (by omega) (by omega) + (by omega) (by omega) (by omega)) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact bounce_nil_leads (IsBounce.cons hv_r (by omega) (by rw [if_pos hod]; omega)) + (by omega) + · cases hd_mrg : decide (6 ≥ 0 + (mr' + 1)) with + | true => + have h_mrg := of_decide_eq_true hd_mrg + have hg2 : stepGuards ⟨true, (phi + 3, mr' + 1) :: rest, zl, 2, 0, 6, []⟩ = true := by + dsimp only [stepGuards]; rw [if_neg hev, hd_mrg, if_pos rfl] + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs]; rw [if_neg hev, hd_mrg, if_pos rfl] + exact chainLeadsUpTo_here (rootInv_of_0B (Or.inl rfl) (validTail40_of_validSegs40 hv_r) + (by omega) (by omega) (by omega) (by omega) (by omega) + (by intro h; omega) (by intro h; omega) (by intro _ _ _ _ hcz9; omega)) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact bounce_nil_leads (IsBounce.cons hv_r (by omega) (by rw [if_neg hev]; omega)) + (by omega) + +theorem bounce_31_leads {N phi : Nat} {s : SegState} + (hb : IsBounce phi [3, 1] s) (hphi : 18 ≤ phi) : + ChainLeadsUpTo N s RootInv := by + have hg_pop : drainPopGuards phi [3, 1] = true := by + change (true && true && true && decide (phi ≥ 16)) = true + rw [Bool.true_and, Bool.true_and, Bool.true_and] + exact decide_eq_true (by omega) + obtain ⟨hg_s, _, hp, m_rem, rest, zl, hv_rest, hzl_false, hstep⟩ := isBounce_step hb hg_pop + apply chainLeadsUpTo_step hg_s + intro m1 _ + rw [hstep] + set p := pushSeg hp (phi + 2) m_rem rest zl + have hdp : drainPopStep hp phi m_rem rest zl [3, 1] = ⟨true, (1, 0) :: p.1, p.2, 0, 0, 2, []⟩ := + rfl + rw [hdp] + have hvt : ValidTail40 p.1 p.2 := + validTail40_pushSeg hp hv_rest (fun hf => by have := hzl_false hf; omega) + have hfzp : phi + 2 ≤ fzOf p.1 p.2 := fzOf_pushSeg_ge hp (phi + 2) m_rem rest zl + have hg2 : stepGuards ⟨true, (1, 0) :: p.1, p.2, 0, 0, 2, []⟩ = true := rfl + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs] + exact chainLeadsUpTo_here (rootInv_of_0B (Or.inl rfl) hvt + (by decide) (by decide) (by decide) (by omega) (by omega) + (by intro h; omega) (fun _ => Or.inr ⟨rfl, rfl, by omega⟩) + (by intro _ _ _ _ hcz9; omega)) + +theorem bounce_cz_31_leads {N cz phi : Nat} {s : SegState} + (hb : IsBounce phi [cz, 3, 1] s) + (hcases : ((cz = 20 ∨ cz = 21) ∧ 34 ≤ phi) ∨ + (22 ≤ cz ∧ cz % 2 = 1 ∧ 38 ≤ phi) ∨ + (26 ≤ cz ∧ cz % 2 = 0 ∧ (46 ≤ phi ∨ (cz = 26 ∧ phi = 45)))) : + ChainLeadsUpTo N s RootInv := by + have hcz20 : 20 ≤ cz := by rcases hcases with ⟨h, _⟩ | ⟨h, _⟩ | ⟨h, _⟩ <;> omega + have hphi34 : 34 ≤ phi := by + rcases hcases with ⟨_, h⟩ | ⟨_, _, h⟩ | ⟨_, _, h | ⟨_, rfl⟩⟩ <;> omega + have hnrst : isDrainRstDs [cz, 3, 1] = false := rfl + have hnr0 : isRank0 [cz, 3, 1] = false := by + rcases cz with _ | _ | _ | _ <;> try omega + rfl + have hg_pop' : drainPopGuards phi [cz, 3, 1] = true := by + dsimp only [drainPopGuards] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true] + have hc1 : decide (cz ≥ 3 ∧ 3 ≥ 1) = true := decide_eq_true (by omega) + have hc2 : decide (cz % 2 = 0 ∧ cz ≤ 2 * 3 + 4) = false := decide_eq_false (by omega) + have hc3 : decide (cz % 2 = 0 ∧ cz + 14 ≤ 2 * 3) = false := decide_eq_false (by omega) + have hc4 : decide (phi ≥ 16) = true := decide_eq_true (by omega) + rw [hc1, hc2, hc3, hc4]; rfl + obtain ⟨hg_s, _, hp, m_rem, rest, zl, hv_rest, hzl_false, hstep⟩ := isBounce_step hb hg_pop' + set p := pushSeg hp (phi + 2) m_rem rest zl + have hdp : drainPopStep hp phi m_rem rest zl [cz, 3, 1] = + ⟨true, (0, cz - 3) :: p.1, p.2, 2, 0, 6, [1]⟩ := by + dsimp only [drainPopStep] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true, + if_neg (by rintro ⟨h31, _, _⟩; cases h31)] + have hnorm : normSeg 0 (cz - 3) = (0, cz - 3) := by + dsimp only [normSeg]; rw [if_neg (by omega)] + rw [hnorm] + rw [hdp] at hstep + have hfzp : phi + 2 ≤ fzOf p.1 p.2 := fzOf_pushSeg_ge hp (phi + 2) m_rem rest zl + apply chainLeadsUpTo_step hg_s + intro m1 _ + rw [hstep] + -- Step 1: bounces on [1] with phi' = 2, m_rem' = cz + -- - 11 + have hg_b1 : stepGuards ⟨true, (0, cz - 3) :: p.1, p.2, 2, 0, 6, [1]⟩ = true := by + have hsub : cz - 3 = (cz - 4) + 1 := by omega + rw [hsub]; dsimp only [stepGuards] + rcases dec_or (((cz - 4) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega)]; rfl + · rw [if_neg hev, decide_eq_false (by omega)]; rfl + have hs_b1 : stepSegs ⟨true, (0, cz - 3) :: p.1, p.2, 2, 0, 6, [1]⟩ = + ⟨true, (5, cz - 11) :: p.1, p.2, 2, 0, 6, []⟩ := by + have hsub : cz - 3 = (cz - 4) + 1 := by omega + have hm_eq : 0 + ((cz - 4) + 1) - (6 + 2) = (cz - 12) + 1 := by omega + have h11 : cz - 11 = (cz - 12) + 1 := by omega + rw [hsub, h11]; dsimp only [stepSegs] + rcases dec_or (((cz - 4) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega), hm_eq]; rfl + · rw [if_neg hev, decide_eq_false (by omega), hm_eq]; rfl + apply chainLeadsUpTo_step hg_b1 + intro m2 _ + rw [hs_b1] + -- Step 2: bounces on [] with phi'' = 7, m_rem'' = + -- cz - 19 + have hg_b2 : stepGuards ⟨true, (5, cz - 11) :: p.1, p.2, 2, 0, 6, []⟩ = true := by + have hsub : cz - 11 = (cz - 12) + 1 := by omega + rw [hsub]; dsimp only [stepGuards] + rcases dec_or (((cz - 12) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega)]; rfl + · rw [if_neg hev, decide_eq_false (by omega)]; rfl + have hs_b2 : stepSegs ⟨true, (5, cz - 11) :: p.1, p.2, 2, 0, 6, []⟩ = + ⟨false, (8, cz - 19) :: p.1, p.2, 1, 1, 0, []⟩ := by + have hsub : cz - 11 = (cz - 12) + 1 := by omega + have hm_eq : 0 + ((cz - 12) + 1) - (6 + 2) = (cz - 20) + 1 := by omega + have h19 : cz - 19 = (cz - 20) + 1 := by omega + rw [hsub, h19]; dsimp only [stepSegs] + rcases dec_or (((cz - 12) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega), hm_eq]; rfl + · rw [if_neg hev, decide_eq_false (by omega), hm_eq]; rfl + apply chainLeadsUpTo_step1 hg_b2 + rw [hs_b2] + apply chainLeadsUpTo_here + rcases hcases with ⟨hcz2021, _⟩ | ⟨hcz22, hcz_od, hphi38⟩ | ⟨hcz26, hcz_ev, hphi_ev⟩ + · -- Root0A (`cz = 20` or `cz = 21`, `34 <= phi => 36 <= fzOf p.1 p.2`): + cases hp with + | false => + have := hzl_false rfl + have hvp : ValidSegs40 p.1 p.2 := + validSegs40_pushSeg false (by omega) hv_rest (fun _ => by omega) + exact rootInv_of_0B (Or.inl rfl) hvp + (by decide) (by decide) (by decide) (by dsimp only [fzOf]; omega) + (by dsimp only [fzOf]; omega) + (by intro h; cases h) (fun _ => Or.inl ⟨rfl, rfl⟩) + (by intro z0 m0 r hseg _; injection hseg with hhd _; injection hhd with _ hm0; omega) + | true => + have hvr := hv_rest rfl + dsimp only [p, pushSeg, ite_true] at hfzp ⊢ + exact rootInv_of_0A (by omega) (Nat.le_trans (by omega) (normSeg_fst_ge (phi + 2) m_rem)) hvr + · -- `cz >= 22` odd => `cz - 19` is EVEN (`m0 % 2 = 1` vacuous!): + have hvp : ValidSegs40 p.1 p.2 := + validSegs40_pushSeg hp (by omega) hv_rest (fun hf => by have := hzl_false hf; omega) + exact rootInv_of_0B (Or.inl rfl) hvp + (by decide) (by decide) (by decide) (by dsimp only [fzOf]; omega) + (by dsimp only [fzOf]; omega) + (by intro h; cases h) (fun _ => Or.inl ⟨rfl, rfl⟩) + (by intro z0 m0 r hseg _ _ hm0_od; injection hseg with hhd _; injection hhd with _ hm0; omega) + · -- `cz >= 26` even => `cz - 19 >= 7` odd: + have hphi45 : 45 ≤ phi := by rcases hphi_ev with h | ⟨_, rfl⟩ <;> omega + have hvp : ValidSegs40 p.1 p.2 := + validSegs40_pushSeg hp (by omega) hv_rest (fun hf => by have := hzl_false hf; omega) + refine rootInv_of_0B (Or.inl rfl) hvp + (by decide) (by decide) (by decide) (by dsimp only [fzOf]; omega) + (by dsimp only [fzOf]; omega) + (by intro h; cases h) (fun _ => Or.inl ⟨rfl, rfl⟩) ?_ + intro z0 m0 r hseg _ _ _ + injection hseg with hhd htl + injection hhd with hz0 hm0 + subst hz0 hm0 htl + rcases hphi_ev with hphi46 | ⟨rfl, rfl⟩ + · exact ⟨by omega, by omega, fun hlt => False.elim (by omega)⟩ + · exact ⟨by omega, by omega, fun _ => by omega⟩ + +theorem bounce_d1_leads {N d phi : Nat} {s : SegState} + (hb : IsBounce phi [d, 1] s) (hd25 : 25 ≤ d) (hphi42 : 42 ≤ phi) : + ChainLeadsUpTo N s RootInv := by + have hnrst : isDrainRstDs [d, 1] = false := rfl + have hnr0 : isRank0 [d, 1] = false := by + rcases d with _ | _ | _ | _ <;> try omega + rfl + have hg_pop : drainPopGuards phi [d, 1] = true := by + dsimp only [drainPopGuards] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true] + have hc1 : decide (d ≥ 3 ∧ 1 ≥ 1) = true := decide_eq_true (by omega) + have hc2 : decide (d % 2 = 0 ∧ d ≤ 2 * 1 + 4) = false := decide_eq_false (by omega) + have hc3 : decide (d % 2 = 0 ∧ d + 14 ≤ 2 * 1) = false := decide_eq_false (by omega) + have hc4 : decide (phi ≥ 16) = true := decide_eq_true (by omega) + rw [hc1, hc2, hc3, hc4]; rfl + obtain ⟨hg_s, _, hp, m_rem, rest, zl, hv_rest, hzl_false, hstep⟩ := isBounce_step hb hg_pop + apply chainLeadsUpTo_step hg_s + intro m1 _ + rw [hstep] + set p := pushSeg hp (phi + 2) m_rem rest zl + have hdp : drainPopStep hp phi m_rem rest zl [d, 1] = + ⟨true, normSeg 0 (d - 11) :: p.1, p.2, 5, 0, 12, [2]⟩ := by + dsimp only [drainPopStep] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true, if_pos ⟨rfl, rfl, hd25⟩] + rw [hdp] + have hvp : ValidSegs40 p.1 p.2 := + validSegs40_pushSeg hp (by omega) hv_rest (fun hf => by have := hzl_false hf; omega) + have hfzp : phi + 2 ≤ fzOf p.1 p.2 := fzOf_pushSeg_ge hp (phi + 2) m_rem rest zl + have hnorm0 : normSeg 0 (d - 11) = (0, (d - 12) + 1) := by + dsimp only [normSeg]; rw [if_neg (by omega)]; congr 1; omega + rw [hnorm0] + -- bounces on [2] with phi' = 5, m_rem' = d - 25 + have hg2 : stepGuards ⟨true, (0, (d - 12) + 1) :: p.1, p.2, 5, 0, 12, [2]⟩ = true := by + dsimp only [stepGuards] + rcases dec_or (((d - 12) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega)]; rfl + · rw [if_neg hev, decide_eq_false (by omega)]; rfl + have hs2 : stepSegs ⟨true, (0, (d - 12) + 1) :: p.1, p.2, 5, 0, 12, [2]⟩ = + ⟨false, normSeg 7 (d - 25) :: p.1, p.2, 1, 1, 0, [0]⟩ := by + have hm_eq : 0 + ((d - 12) + 1) - (12 + 2) = d - 25 := by omega + dsimp only [stepSegs] + rcases dec_or (((d - 12) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega), hm_eq]; rfl + · rw [if_neg hev, decide_eq_false (by omega), hm_eq]; rfl + apply chainLeadsUpTo_step1 hg2 + rw [hs2] + apply chainLeadsUpTo_here + rcases dec_or (d = 25) with rfl | hd26 + · have hnorm8 : normSeg 7 (25 - 25) = (8, 0) := rfl + rw [hnorm8] + exact rootInv_of_0B (Or.inr rfl) hvp + (by decide) (by decide) (by decide) (by dsimp only [fzOf]; omega) + (by dsimp only [fzOf]; omega) + (by intro h; cases h) (fun _ => Or.inl ⟨rfl, rfl⟩) + (by intro z0 m0 r hseg _ h3; injection hseg with hhd _; injection hhd with _ hm0; omega) + · have hnorm7 : normSeg 7 (d - 25) = (7, d - 25) := by + dsimp only [normSeg]; rw [if_neg (by omega)] + rw [hnorm7] + exact rootInv_of_0B (Or.inr rfl) hvp + (by decide) (by decide) (by decide) (by dsimp only [fzOf]; omega) + (by dsimp only [fzOf]; omega) + (fun _ => ⟨d - 25, p.1, rfl, rfl, rfl, rfl, by omega⟩) + (fun _ => Or.inl ⟨rfl, rfl⟩) + (by intro _ _ _ _ hcz9; cases hcz9) + +theorem bounce_d_leads {N d phi : Nat} {ds : List Nat} {s : SegState} + (hb : IsBounce phi ds s) + (hds : ds = [d] ∨ ds = [d, 0]) + (hcases : (d = 8 ∧ (phi = 16 ∨ phi = 17 ∨ 38 ≤ phi)) ∨ + (d = 9 ∧ 19 ≤ phi) ∨ + (10 ≤ d ∧ d ≤ 18 ∧ 19 ≤ phi ∧ (12 ≤ d → d % 2 = 0 → 23 ≤ phi)) ∨ + (d = 19 ∧ 37 ≤ phi) ∨ + (20 ≤ d ∧ 38 ≤ phi)) : + ChainLeadsUpTo N s RootInv := by + have hd8 : 8 ≤ d := by + rcases hcases with ⟨rfl, _⟩ | ⟨rfl, _⟩ | ⟨h, _⟩ | ⟨rfl, _⟩ | ⟨h, _⟩ <;> omega + have hrst : isDrainRstDs ds = true := by + rcases hds with rfl | rfl <;> (dsimp only [isDrainRstDs]; exact decide_eq_true hd8) + have hhd_ds : headNat ds = d := by rcases hds with rfl | rfl <;> rfl + have hg_pop : drainPopGuards phi ds = true := by + dsimp only [drainPopGuards]; rw [hrst, if_pos rfl] + apply decide_eq_true + rcases hcases with ⟨rfl, h16⟩ | ⟨_, h19⟩ | ⟨_, _, h19, _⟩ | ⟨_, h19⟩ | ⟨_, h19⟩ + · rcases hds with rfl | rfl <;> (change 16 ≤ phi; omega) + all_goals (cases isOddDrainDs ds <;> simp only [Bool.false_eq_true, ite_false, + ite_true] <;> omega) + obtain ⟨hg_s, _, hp, m_rem, rest, zl, hv_rest, hzl_false, hstep⟩ := isBounce_step hb hg_pop + apply chainLeadsUpTo_step hg_s + intro m1 _ + rw [hstep] + dsimp only [drainPopStep] + rw [hrst, if_pos rfl, hhd_ds] + set p := pushSeg hp (phi + 2) m_rem rest zl + have hvt : ValidTail40 p.1 p.2 := + validTail40_pushSeg hp hv_rest (fun hf => by have := hzl_false hf; omega) + have hfzp : phi + 2 ≤ fzOf p.1 p.2 := fzOf_pushSeg_ge hp (phi + 2) m_rem rest zl + rcases hcases with ⟨rfl, hphi_d8⟩ | ⟨rfl, hphi19⟩ | ⟨hd10, hd18, hphi19, hd_ev23⟩ | + ⟨rfl, hphi37⟩ | ⟨hd20, hphi38⟩ + · -- d = 8 (`d - 7 = 1` -> `[3, 1]` with `c = 2, k = 1`): + rw [if_pos rfl] + apply chainLeadsUpTo_here + rcases hphi_d8 with rfl | rfl | hphi38 + · refine rootInv_of_31A hvt ?_ + cases hp with + | false => have := hzl_false rfl; omega + | true => + cases m_rem with + | zero => exact Or.inr (Or.inl rfl) + | succ _ => exact Or.inl rfl + · refine rootInv_of_31A hvt ?_ + cases hp with + | false => have := hzl_false rfl; omega + | true => + cases m_rem with + | zero => exact Or.inr (Or.inr ⟨rest, rfl⟩) + | succ _ => exact Or.inr (Or.inl rfl) + · refine rootInv_of_31B rfl hvt (by decide) (by decide) (by decide) + (by omega) (by omega) (by omega) ?_ + intro z0 m0 r hseg _ _ _ + have hz0 : fzOf p.1 p.2 = z0 := by rw [hseg]; rfl + exact Or.inr (by omega) + · -- d = 9 (`9 - 7 = 2`, `normSeg 0 0 = (1, 0)` on `[1]`, steps to `c = 5, k = 5, fz >= 21`): + rw [if_neg (by decide)] + dsimp only [Nat.reduceSub, normSeg, ite_true] + have hg2 : stepGuards ⟨true, (1, 0) :: p.1, p.2, 3, 0, 8, [1]⟩ = true := rfl + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs] + exact chainLeadsUpTo_here (rootInv_of_1 hvt + (by decide) (by decide) (by decide) (by omega) (by omega) + (by intro h; omega) (fun _ => by omega)) + · -- 10 <= d <= 18 (`1 <= d - 9 <= 9`): + rw [if_neg (by omega)] + have hnorm : normSeg 0 (d - 7 - 2) = (0, (d - 10) + 1) := by + dsimp only [normSeg]; rw [if_neg (by omega)]; congr 1; omega + rw [hnorm] + rcases dec_or (((d - 10) + 1) % 2 = 1) with hod | hev + · -- d even in {10, 12, 14, 16, 18} -> `[3, 1]` with `c = d - 6, k = 1`: + have hmrg : decide (8 ≥ 0 + (d - 10)) = true := decide_eq_true (by omega) + have hg2 : stepGuards ⟨true, (0, (d - 10) + 1) :: p.1, p.2, 3, 0, 8, [1]⟩ = true := by + dsimp only [stepGuards]; rw [if_pos hod, hmrg, if_pos rfl]; rfl + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs]; rw [if_pos hod, hmrg, if_pos rfl] + apply chainLeadsUpTo_here + refine rootInv_of_31B rfl hvt (by omega) (by decide) (by omega) + (by omega) (by omega) (by omega) ?_ + intro z0 m0 r hseg hpar _ _ + have hz0 : fzOf p.1 p.2 = z0 := by rw [hseg]; rfl + rcases dec_or (d = 10) with rfl | hd12 + · omega + · have h23 := hd_ev23 (by omega) (by omega) + exact Or.inr (by omega) + · -- d odd in {11, 13, 15, 17} -> `[1]` with `c = 5, k = d - 4 >= 7, fz >= 21`: + have hmrg : decide (8 ≥ 0 + ((d - 10) + 1)) = true := decide_eq_true (by omega) + have hg2 : stepGuards ⟨true, (0, (d - 10) + 1) :: p.1, p.2, 3, 0, 8, [1]⟩ = true := by + dsimp only [stepGuards]; rw [if_neg hev, hmrg, if_pos rfl] + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs]; rw [if_neg hev, hmrg, if_pos rfl] + exact chainLeadsUpTo_here (rootInv_of_1 hvt + (by decide) (by omega) (by omega) (by omega) (by omega) + (by intro h; omega) (fun _ => by omega)) + · -- d = 19 (`19 - 9 = 10`, bounces on `[1]` with `m_rem' = 0`): + rw [if_neg (by decide)] + have hnorm : normSeg 0 (19 - 7 - 2) = (0, 10) := rfl + rw [hnorm] + have hg2 : stepGuards ⟨true, (0, 10) :: p.1, p.2, 3, 0, 8, [1]⟩ = true := rfl + have hs2 : stepSegs ⟨true, (0, 10) :: p.1, p.2, 3, 0, 8, [1]⟩ = + ⟨true, (7, 0) :: p.1, p.2, 2, 0, 6, []⟩ := rfl + apply chainLeadsUpTo_step hg2 + intro m2 _ + rw [hs2] + have hg3 : stepGuards ⟨true, (7, 0) :: p.1, p.2, 2, 0, 6, []⟩ = true := rfl + apply chainLeadsUpTo_step1 hg3 + dsimp only [stepSegs] + exact chainLeadsUpTo_here (rootInv_of_0B (Or.inl rfl) hvt + (by decide) (by decide) (by decide) (by omega) (by omega) + (by intro h; omega) (by intro h; omega) (by intro _ _ _ _ hcz9; omega)) + · -- d >= 20 (`38 <= phi` => `ValidSegs40 p.1 p.2`, bounces on `[1]` with `m_rem' = d - 19 >= 1`): + rw [if_neg (by omega)] + have hvp : ValidSegs40 p.1 p.2 := + validSegs40_pushSeg hp (by omega) hv_rest (fun hf => by have := hzl_false hf; omega) + have hfzp40 : 40 ≤ fzOf p.1 p.2 := fzOf_ge_40 hvp + have hnorm : normSeg 0 (d - 7 - 2) = (0, (d - 10) + 1) := by + dsimp only [normSeg]; rw [if_neg (by omega)]; congr 1; omega + rw [hnorm] + have hg2 : stepGuards ⟨true, (0, (d - 10) + 1) :: p.1, p.2, 3, 0, 8, [1]⟩ = true := by + dsimp only [stepGuards] + rcases dec_or (((d - 10) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega)]; rfl + · rw [if_neg hev, decide_eq_false (by omega)]; rfl + have hs2 : stepSegs ⟨true, (0, (d - 10) + 1) :: p.1, p.2, 3, 0, 8, [1]⟩ = + ⟨true, (6, (d - 20) + 1) :: p.1, p.2, 2, 0, 6, []⟩ := by + have hm_eq : 0 + ((d - 10) + 1) - (8 + 2) = (d - 20) + 1 := by omega + dsimp only [stepSegs] + rcases dec_or (((d - 10) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega), hm_eq]; rfl + · rw [if_neg hev, decide_eq_false (by omega), hm_eq]; rfl + apply chainLeadsUpTo_step hg2 + intro m2 _ + rw [hs2] + rcases dec_or (((d - 20) + 1) % 2 = 1) with hod2 | hev2 + · cases hd_mrg2 : decide (6 ≥ 0 + (d - 20)) with + | true => + have hg3 : stepGuards ⟨true, (6, (d - 20) + 1) :: p.1, p.2, 2, 0, 6, []⟩ = true := by + dsimp only [stepGuards]; rw [if_pos hod2, hd_mrg2, if_pos rfl]; rfl + apply chainLeadsUpTo_step1 hg3 + dsimp only [stepSegs]; rw [if_pos hod2, hd_mrg2, if_pos rfl] + exact chainLeadsUpTo_here (rootInv_of_D (d := 8) (by decide) (Or.inl rfl) + (validTail40_of_validSegs40 hvp) (by omega) (by decide) (by omega) + (by omega) (by omega) (by omega)) + | false => + have hg3 : stepGuards ⟨true, (6, (d - 20) + 1) :: p.1, p.2, 2, 0, 6, []⟩ = true := by + dsimp only [stepGuards]; rw [if_pos hod2, hd_mrg2, if_neg Bool.false_ne_true]; rfl + apply chainLeadsUpTo_step1 hg3 + dsimp only [stepSegs]; rw [if_pos hod2, hd_mrg2, if_neg Bool.false_ne_true] + set q := pushSeg true 9 (0 + ((d - 20) + 1) - (6 + 2)) p.1 p.2 + have hdp3 : drainPopStep true (2 + 6) (0 + ((d - 20) + 1) - (6 + 2)) p.1 p.2 [] = + ⟨false, q.1, q.2, 1, 1, 0, []⟩ := rfl + rw [hdp3] + have hvtq : ValidTail40 q.1 q.2 := + validTail40_pushSeg true (fun _ => hvp) (by intro hf; cases hf) + have hfzq : 9 ≤ fzOf q.1 q.2 := + fzOf_pushSeg_ge true 9 (0 + ((d - 20) + 1) - (6 + 2)) p.1 p.2 + exact chainLeadsUpTo_here (rootInv_of_0B (Or.inl rfl) hvtq + (by decide) (by decide) (by decide) (by omega) (by omega) + (by intro h; omega) (fun _ => Or.inl ⟨rfl, rfl⟩) (by intro _ _ _ _ hcz9; omega)) + · cases hd_mrg2 : decide (6 ≥ 0 + ((d - 20) + 1)) with + | true => + have h_mrg2 := of_decide_eq_true hd_mrg2 + have hg3 : stepGuards ⟨true, (6, (d - 20) + 1) :: p.1, p.2, 2, 0, 6, []⟩ = true := by + dsimp only [stepGuards]; rw [if_neg hev2, hd_mrg2, if_pos rfl] + apply chainLeadsUpTo_step1 hg3 + dsimp only [stepSegs]; rw [if_neg hev2, hd_mrg2, if_pos rfl] + exact chainLeadsUpTo_here (rootInv_of_0B (Or.inl rfl) (validTail40_of_validSegs40 hvp) + (by omega) (by omega) (by omega) (by omega) (by omega) + (by intro h; omega) (by intro h; omega) (by intro _ _ _ _ hcz9; omega)) + | false => + have hg3 : stepGuards ⟨true, (6, (d - 20) + 1) :: p.1, p.2, 2, 0, 6, []⟩ = true := by + dsimp only [stepGuards]; rw [if_neg hev2, hd_mrg2, if_neg Bool.false_ne_true]; rfl + apply chainLeadsUpTo_step1 hg3 + dsimp only [stepSegs]; rw [if_neg hev2, hd_mrg2, if_neg Bool.false_ne_true] + set q := pushSeg true 9 (0 + ((d - 20) + 1) - (6 + 2)) p.1 p.2 + have hdp3 : drainPopStep true (2 + 6) (0 + ((d - 20) + 1) - (6 + 2)) p.1 p.2 [] = + ⟨false, q.1, q.2, 1, 1, 0, []⟩ := rfl + rw [hdp3] + have hvtq : ValidTail40 q.1 q.2 := + validTail40_pushSeg true (fun _ => hvp) (by intro hf; cases hf) + have hfzq : 9 ≤ fzOf q.1 q.2 := + fzOf_pushSeg_ge true 9 (0 + ((d - 20) + 1) - (6 + 2)) p.1 p.2 + exact chainLeadsUpTo_here (rootInv_of_0B (Or.inl rfl) hvtq + (by decide) (by decide) (by decide) (by omega) (by omega) + (by intro h; omega) (fun _ => Or.inl ⟨rfl, rfl⟩) (by intro _ _ _ _ hcz9; omega)) + + +-- ============================================================================ +-- Section 5g.3c: RootD, RootD1, and Root1 Advancement Closures +-- ============================================================================ + +theorem chainAdvances_trans {s : SegState} {P Q : SegState → Prop} + (h1 : ChainAdvances s P) (h2 : ∀ s', P s' → ChainLeads s' Q) : + ChainAdvances s Q := + ⟨h1.1, chainLeads_trans h1.2 h2⟩ + +theorem fbound_advances {ms : Nat} {S : List Nat} {segs : List (Nat × Nat)} {zl c k : Nat} + (hms19 : 19 ≤ ms) (hS : SafeStack ms S) + (hvt : ValidTail40 segs zl) + (hc : 1 ≤ c) (hk1 : 1 ≤ k) (hkc : k ≤ 2 * c + 3) + (hfz35 : 35 ≤ fzOf segs zl) (hcz42 : 42 ≤ c + fzOf segs zl) + (hkz73 : 73 ≤ k + 2 * fzOf segs zl) + (hms_ox : ms + 2 ≤ ox (k + 2 * fzOf segs zl) (c + fzOf segs zl)) : + ChainAdvances ⟨false, segs, zl, c, k, 0, S⟩ + (Exit (ox (k + 2 * fzOf segs zl) (c + fzOf segs zl)) + (odw (k + 2 * fzOf segs zl) (c + fzOf segs zl)) + (oxw (k + 2 * fzOf segs zl) (c + fzOf segs zl)) S) := by + obtain ⟨hox39, hox_cz3⟩ := ox_bounds_relaxed hc hk1 hkc hfz35 hcz42 hkz73 + rcases segs with _ | ⟨⟨z0, m0⟩, rest⟩ + · dsimp only [fzOf, ValidTail40] at hvt hfz35 hcz42 hkz73 hms_ox hox39 hox_cz3 ⊢ + have hg : stepGuards ⟨false, [], zl, c, k, 0, S⟩ = true := by + dsimp only [stepGuards] + rw [goodPhiW_of_ge35 hS.1 (by omega), Bool.true_and] + dsimp only [GoodPsi] + have hcz : c + zl - 1 + 1 = c + zl := by omega + rw [hcz]; exact hS.2.2 (c + zl) (by omega) + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + apply chainLeadsUpTo_here + obtain ⟨qw, rw_, hrw, hkw, hdw⟩ := div20_spec (k + 2 * zl) + refine Or.inr ⟨c + zl, k + 2 * zl + 2, by omega, by omega, ?_, ?_⟩ + · dsimp only [oxw]; rw [hdw]; omega + · simpa only [Nat.add_zero] using IsBounce.nil (zl := 0) (cp1 := k + 2 * zl + 2) (kb := 0) + (mrg := 2 * (k + 2 * zl) + 6) (ds := (c + zl) :: S) (by omega) + · dsimp only [fzOf, ValidTail40] at hvt hfz35 hcz42 hkz73 hms_ox hox39 hox_cz3 ⊢ + have hv_rest : ValidSegs40 rest zl := hvt + cases m0 with + | zero => + refine ⟨rfl, fun N => ?_⟩ + dsimp only [stepSegs] + rcases rest with _ | ⟨⟨z1, m1_seg⟩, rest2⟩ + · have hzl230 : 230 ≤ zl := hv_rest.2 + exact chainLeadsUpTo_here (Or.inl ⟨c + z0 + 3 + zl, by dsimp only [odw]; omega, + IsBounce.nil (by omega)⟩) + · have hz1_40 : 40 ≤ z1 := fzOf_ge_40 hv_rest + have hv_rest2 : ValidSegs40 rest2 zl := validSegs40_tail hv_rest + have hfz2_40 : 40 ≤ fzOf rest2 zl := fzOf_ge_40 hv_rest2 + cases m1_seg with + | zero => + have hg2 : stepGuards ⟨true, (z1, 0) :: rest2, zl, c + z0 + 3, k + 2 * z0 + 3, + 2 * (c + z0) + 8, S⟩ = true := by + dsimp only [stepGuards]; exact decide_eq_true (by omega) + apply chainLeadsUpTo_step hg2 + intro m2 _ + dsimp only [stepSegs] + have hmono := arith_fb_t0 hc hk1 hkc hfz35 hcz42 hkz73 hz1_40 hfz2_40 + exact chainLeadsUpTo_imp + ((excursion_bundle m2).1 ms S rest2 zl (c + z0 + 3 + z1 + 1) + (k + 2 * z0 + 3 + 2 * z1 + 3) hms19 hS (validTail40_of_validSegs40 hv_rest2) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) + (Nat.le_trans hms_ox hmono.1)) + (fun _ he => exit_mono he hmono.1 hmono.2.1 hmono.2.2) + | succ m1' => + rcases dec_or ((m1' + 1) % 2 = 1) with hm1_odd | hm1_even + · cases hd_mrg : decide (2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + m1') with + | true => + have hg2 : stepGuards ⟨true, (z1, m1' + 1) :: rest2, zl, c + z0 + 3, + k + 2 * z0 + 3, 2 * (c + z0) + 8, S⟩ = true := by + dsimp only [stepGuards]; rw [if_pos hm1_odd, hd_mrg, if_pos rfl] + exact hS.2.2 (c + z0 + 3 + z1) (by omega) + apply chainLeadsUpTo_step hg2 + intro m2 _ + dsimp only [stepSegs]; rw [if_pos hm1_odd, hd_mrg, if_pos rfl] + have hi := arith_fb_to (m1' := m1') hc hk1 hkc hfz35 hcz42 hkz73 hz1_40 hfz2_40 + exact (excursion_bundle m2).2 ms S rest2 zl + ((k + 2 * z0 + 3) + m1' + 2 * z1 + 4) 1 (c + z0 + 3 + z1) + (ox (k + 2 * z0) (c + z0)) (oxw (k + 2 * z0) (c + z0)) + hms19 hS (Or.inr (by omega)) hv_rest2 + (by omega) (by omega) (by omega) hms_ox hi.1 + hi.2.1 hi.2.2.1 hi.2.2.2.1 hi.2.2.2.2 + | false => + have h_nm := of_decide_eq_false hd_mrg + exact chainLeadsUpTo_here (Or.inl ⟨c + z0 + 3 + z1, by dsimp only [odw]; omega, + IsBounce.cons hv_rest2 (by omega) (by rw [if_pos hm1_odd]; omega)⟩) + · cases hd_mrg : decide (2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + (m1' + 1)) with + | true => + have h_mrg := of_decide_eq_true hd_mrg + have hg2 : stepGuards ⟨true, (z1, m1' + 1) :: rest2, zl, c + z0 + 3, + k + 2 * z0 + 3, 2 * (c + z0) + 8, S⟩ = true := by + dsimp only [stepGuards]; rw [if_neg hm1_even, hd_mrg, if_pos rfl] + apply chainLeadsUpTo_step hg2 + intro m2 _ + dsimp only [stepSegs]; rw [if_neg hm1_even, hd_mrg, if_pos rfl] + have hmono := arith_fb_te hc hk1 hkc hfz35 hcz42 hkz73 hz1_40 hfz2_40 h_mrg + exact chainLeadsUpTo_imp + ((excursion_bundle m2).1 ms S rest2 zl (c + z0 + 3 + z1 + 2) + ((k + 2 * z0 + 3) + (m1' + 1) + 2 * z1 + 5) + hms19 hS (validTail40_of_validSegs40 hv_rest2) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) + (Nat.le_trans hms_ox hmono.1)) + (fun _ he => exit_mono he hmono.1 hmono.2.1 hmono.2.2) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact chainLeadsUpTo_here (Or.inl ⟨c + z0 + 3 + z1, by dsimp only [odw]; omega, + IsBounce.cons hv_rest2 (by omega) (by rw [if_neg hm1_even]; omega)⟩) + | succ m' => + have hfz1_40 : 40 ≤ fzOf rest zl := fzOf_ge_40 hv_rest + have hphiw : GoodPhiW (c + z0 - 1) S false = true := goodPhiW_of_ge35 hS.1 (by omega) + rcases dec_or (m' + 1 = 1) with hm1 | hm_gt1 + · have hm0_eq : m' = 0 := by omega + subst hm0_eq + have hg : stepGuards ⟨false, (z0, 1) :: rest, zl, c, k, 0, S⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) S false && if 1 = 1 then GoodPsi (c + z0) S else _) = true + rw [hphiw, Bool.true_and, if_pos rfl] + exact hS.2.2 (c + z0 + 1) (by omega) + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if 1 = 1 then _ else _) _ + rw [if_pos rfl] + have hi := arith_fb_m1_ev (dx := 1) hc hk1 hkc hfz35 hcz42 hkz73 hfz1_40 (by decide) + exact (excursion_bundle N).2 ms S rest zl (k + 2 * z0 + 4) 1 (c + z0 + 1) + (ox (k + 2 * z0) (c + z0)) (oxw (k + 2 * z0) (c + z0)) + hms19 hS (Or.inr (by omega)) hv_rest + (by omega) (by omega) (by omega) hms_ox hi.1 + hi.2.1 hi.2.2.1 hi.2.2.2.1 hi.2.2.2.2 + · have hpsi_cz : GoodPsi (c + z0 - 1) S = true := by + dsimp only [GoodPsi] + have hcz_eq : c + z0 - 1 + 1 = c + z0 := by omega + rw [hcz_eq]; exact hS.2.2 (c + z0) (by omega) + rcases dec_or ((m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10) with hev_sm | hnot_ev + · have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, S⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) S false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) S && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else _) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, if_pos hev_sm] + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else _) _ + rw [if_neg hm_gt1, if_pos hev_sm] + have hi := arith_fb_m1_ev (dx := 0) hc hk1 hkc hfz35 hcz42 hkz73 hfz1_40 (by decide) + have hcz0 : c + z0 + 0 = c + z0 := by omega + rw [hcz0] at hi + exact (excursion_bundle N).2 ms S rest zl (k + 2 * z0 + 4) (m' + 2) (c + z0) + (ox (k + 2 * z0) (c + z0)) (oxw (k + 2 * z0) (c + z0)) + hms19 hS (Or.inr (by omega)) hv_rest + (by omega) (by omega) (by omega) hms_ox hi.1 + hi.2.1 hi.2.2.1 hi.2.2.2.1 hi.2.2.2.2 + · rcases dec_or ((m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11) with hod_sm | hbig_m + · have hS_cz : SafeStack 39 ((c + z0) :: S) := safeStack_cons hS (by omega) (by omega) + have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, S⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) S false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) S && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then + GoodDs ((k + 2 * z0 + 2) :: (c + z0) :: S) else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_pos hod_sm] + exact hS_cz.2.2 (k + 2 * z0 + 2) (by omega) + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_pos hod_sm] + obtain ⟨q10, r10, hr10, hkz10, hdw10⟩ := div10_spec (k + 2 * z0) + have hos_in : 39 + 2 ≤ 9 * q10 - 2 ∧ 9 * q10 - 2 ≤ k + 2 * z0 + 2 ∧ + 30 * (9 * q10 - 2) ≤ (m' + fzOf rest zl) + 27 * (k + 2 * z0 + 2) + 900 ∧ + 60 * (9 * q10 - 2) + 120 ≤ 2 * (m' + fzOf rest zl) + 55 * (k + 2 * z0 + 2) ∧ + 10 * (k + 2 * z0 + 35) + 40 ≤ 9 * (m' + fzOf rest zl) + 10 * (k + 2 * z0 + 2) ∧ + 20 * (k + 2 * z0 + 35) ≤ (m' + fzOf rest zl) + 20 * (k + 2 * z0 + 2) + 800 := by + omega + have hm_sub : m' + 1 - 1 = m' := by omega + rw [hm_sub] + have hne1_cz : ((c + z0) :: S) ≠ [1] := by intro h; injection h with h1; omega + have h_loop1 := (excursion_bundle N).2 39 ((c + z0) :: S) rest zl m' 1 + (k + 2 * z0 + 2) (9 * q10 - 2) (k + 2 * z0 + 35) + (by decide) hS_cz (Or.inl hne1_cz) hv_rest + (by omega) (by omega) (by omega) hos_in.1 hos_in.2.1 + hos_in.2.2.1 hos_in.2.2.2.1 hos_in.2.2.2.2.1 hos_in.2.2.2.2.2 + refine chainLeadsUpTo_trans h_loop1 ?_ + intro m2 s_mid hm2 hexit1 + rcases hexit1 with ⟨phi1, hphi1, hb1⟩ | ⟨y1, phi1, hy1_tx1, hphi1_38, hyw1, hb1⟩ + · apply chainLeadsUpTo_here + obtain ⟨qw, rw_, hrw, hkw, hdw⟩ := div20_spec (k + 2 * z0) + refine Or.inr ⟨c + z0, phi1, by omega, by omega, ?_, hb1⟩ + dsimp only [oxw]; rw [hdw]; omega + · exact amega_pop_step hb1 hphi1_38 (by omega) (by omega) + (hS.2.2 (c + z0 - 1) (by omega)) + (fun _ => hS.2.2 (c + z0 - 2) (by omega)) + (fun hbig _ _ p1 p2 hvp _ => + chainLeadsUpTo_here (Or.inl ⟨c + z0 - 1, by dsimp only [odw]; omega, + isBounce_r9 (by omega) hbig hvp⟩)) + (fun hy1_le _ m3 _ p1 p2 hvp hfzp => by + have hy1_lo : 9 * ((k + 2 * z0) / 10) - 2 ≤ y1 := by rw [hdw10]; exact hy1_tx1 + have hmono := + arith_fb_os_r10 hc hk1 hkc hfz35 hcz42 hkz73 hy1_lo hy1_le hphi1_38 hyw1 hfzp + exact chainLeadsUpTo_imp + ((excursion_bundle m3).1 ms S p1 p2 (c + z0 + 1) (y1 + 2) hms19 hS + (validTail40_of_validSegs40 hvp) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) + (Nat.le_trans hms_ox hmono.1)) + (fun _ he => exit_mono he hmono.1 hmono.2.1 hmono.2.2)) + (fun _ _ m3 _ p1 p2 hvp hfzp => by + have hi := arith_fb_os_r11 hc hk1 hkc hfz35 hcz42 hkz73 hyw1 hfzp + exact (excursion_bundle m3).2 ms S p1 p2 y1 1 (c + z0 - 1) + (ox (k + 2 * z0) (c + z0)) (oxw (k + 2 * z0) (c + z0)) + hms19 hS (Or.inr (by omega)) hvp + (by omega) (by omega) (by omega) hms_ox hi.1 + hi.2.1 hi.2.2.1 hi.2.2.2.1 hi.2.2.2.2) + · have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, S⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) S false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) S && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_neg hbig_m] + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_neg hbig_m] + have hnorm : normSeg 0 (m' + 1 - 4) = (0, (m' - 4) + 1) := by + dsimp only [normSeg]; rw [if_neg (by omega)]; congr 1; omega + rw [hnorm] + apply chainLeadsUpTo_here + obtain ⟨qw, rw_, hrw, hkw, hdw⟩ := div20_spec (k + 2 * z0) + refine Or.inr ⟨c + z0, k + 2 * z0 + 2, by omega, by omega, ?_, ?_⟩ + · dsimp only [oxw]; rw [hdw]; omega + · have hbc := IsBounce.cons (z0 := 0) (m := m' - 4) (zl := zl) + (cp1 := k + 2 * z0 + 2) (kb := 0) (mrg := 2 * (k + 2 * z0) + 6) + (rest := rest) (ds := (c + z0) :: S) hv_rest (by omega) + (by split_ifs <;> omega) + simpa only [Nat.add_zero] using hbc + +theorem ox_ge_of_c {c k fz : Nat} + (_hc : 2 ≤ c) (_hk1 : 1 ≤ k) (_hkc : k ≤ 2 * c + 3) (_hfz : 40 ≤ fz) : + c + 38 - (c + 13) / 10 ≤ ox (k + 2 * fz) (c + fz) ∧ + c + 37 - (c + 13) / 10 ≤ odw (k + 2 * fz) (c + fz) := by + obtain ⟨q, r, hr, heq, hox⟩ := ox_spec_lt (kz := k + 2 * fz) (cz := c + fz) (by omega) + dsimp only [odw]; omega + +theorem ox_ge57_of_cz62 {c k fz : Nat} + (_hc : 2 ≤ c) (_hk1 : 1 ≤ k) (_hkc : k ≤ 2 * c + 3) (_hfz : 40 ≤ fz) + (_hcz : 62 ≤ c + fz) (_hkz : 81 ≤ k + 2 * fz) : + 57 ≤ ox (k + 2 * fz) (c + fz) ∧ 56 ≤ odw (k + 2 * fz) (c + fz) := by + obtain ⟨q, r, hr, heq, hox⟩ := ox_spec_lt (kz := k + 2 * fz) (cz := c + fz) (by omega) + dsimp only [odw]; omega + +theorem r9_pop_step {N x y phi : Nat} {S : List Nat} {sb : SegState} {P : SegState → Prop} + (hb : IsBounce phi (y :: x :: S) sb) + (hphi38 : 38 ≤ phi) (hx19 : 19 ≤ x) (hbig : 2 * x + 5 ≤ y) + (hcont : ∀ m, m < N → ∀ p1 p2, ValidSegs40 p1 p2 → phi + 2 ≤ fzOf p1 p2 → + ChainLeadsUpTo m ⟨true, (0, y - 3) :: p1, p2, x - 1, 0, 2 * x, S⟩ P) : + ChainLeadsUpTo N sb P := by + have hnrst : isDrainRstDs (y :: x :: S) = false := by + cases x with | zero => omega | succ _ => rfl + have hnr0 : isRank0 (y :: x :: S) = false := by + rcases y with _ | _ | _ | _ <;> try omega + rfl + have hg_pop : drainPopGuards phi (y :: x :: S) = true := by + dsimp only [drainPopGuards] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true] + have hc1 : decide (y ≥ 3 ∧ x ≥ 1) = true := decide_eq_true (by omega) + have hc2 : decide (y % 2 = 0 ∧ y ≤ 2 * x + 4) = false := decide_eq_false (by omega) + have hc3 : decide (y % 2 = 0 ∧ y + 14 ≤ 2 * x) = false := decide_eq_false (by omega) + have hc4 : decide (phi ≥ 16) = true := decide_eq_true (by omega) + rw [hc1, hc2, hc3, hc4]; rfl + obtain ⟨hg_sb, _, hp, m_rem, rest, zl, hv_rest, hzl_false, hstep⟩ := isBounce_step hb hg_pop + set p := pushSeg hp (phi + 2) m_rem rest zl + have hdp : drainPopStep hp phi m_rem rest zl (y :: x :: S) = + ⟨true, (0, y - 3) :: p.1, p.2, x - 1, 0, 2 * x, S⟩ := by + dsimp only [drainPopStep] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true, if_neg (by omega)] + have hnorm : normSeg 0 (y - 3) = (0, y - 3) := by + dsimp only [normSeg]; rw [if_neg (by omega)] + rw [hnorm] + have hvp : ValidSegs40 p.1 p.2 := + validSegs40_pushSeg hp (by omega) hv_rest (fun hf => by have := hzl_false hf; omega) + have hfzp : phi + 2 ≤ fzOf p.1 p.2 := fzOf_pushSeg_ge hp (phi + 2) m_rem rest zl + apply chainLeadsUpTo_step hg_sb + intro m hm + rw [hstep, hdp] + exact hcont m hm p.1 p.2 hvp hfzp + +-- ============================================================================ +-- Auxiliary Bounce & Drain-Pop Lemmas for RootD / RootD1 / Root1 +-- ============================================================================ + +theorem bounce_r9_zero_leads {N d y : Nat} {p1 : List (Nat × Nat)} {p2 : Nat} + (hd8 : 8 ≤ d) (hbig : 2 * d + 5 ≤ y) (hvp : ValidSegs40 p1 p2) : + ChainLeadsUpTo N ⟨true, (0, y - 3) :: p1, p2, d - 1, 0, 2 * d, [0]⟩ RootInv := by + have hy_sub : y - 3 = (y - 4) + 1 := by omega + have hpop0 : drainPopGuards (d - 1 + 0) [0] = true := by + change decide (d - 1 + 0 ≥ 2) = true; exact decide_eq_true (by omega) + have hg1 : stepGuards ⟨true, (0, y - 3) :: p1, p2, d - 1, 0, 2 * d, [0]⟩ = true := by + rw [hy_sub]; dsimp only [stepGuards] + rcases dec_or (((y - 4) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega)]; exact hpop0 + · rw [if_neg hev, decide_eq_false (by omega)]; exact hpop0 + have hs1 : stepSegs ⟨true, (0, y - 3) :: p1, p2, d - 1, 0, 2 * d, [0]⟩ = + ⟨true, normSeg (d + 1) (y - 2 * d - 5) :: p1, p2, 2, 2, 6, []⟩ := by + have hm_eq : 0 + ((y - 4) + 1) - (2 * d + 2) = y - 2 * d - 5 := by omega + have hd_eq : d - 1 + 0 + 2 = d + 1 := by omega + rw [hy_sub]; dsimp only [stepSegs] + rcases dec_or (((y - 4) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega), hm_eq] + dsimp only [drainPopStep, isDrainRstDs, isRank0, pushSeg, ite_true, ite_false] + rw [hd_eq]; rfl + · rw [if_neg hev, decide_eq_false (by omega), hm_eq] + dsimp only [drainPopStep, isDrainRstDs, isRank0, pushSeg, ite_true, ite_false] + rw [hd_eq]; rfl + apply chainLeadsUpTo_step hg1 + intro m1 _ + rw [hs1] + have hfp40 : 40 ≤ fzOf p1 p2 := fzOf_ge_40 hvp + rcases hmr : y - 2 * d - 5 with _ | mr' + · dsimp only [normSeg, ite_true] + have hg2 : stepGuards ⟨true, (d + 1 + 1, 0) :: p1, p2, 2, 2, 6, []⟩ = true := rfl + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs] + exact chainLeadsUpTo_here (rootInv_of_0B (Or.inl rfl) (validTail40_of_validSegs40 hvp) + (by omega) (by omega) (by omega) (by omega) (by omega) + (by intro h; omega) (by intro h; omega) (by intro _ _ _ _ hcz9; omega)) + · have hn : normSeg (d + 1) (mr' + 1) = (d + 1, mr' + 1) := rfl + rw [hn] + rcases dec_or ((mr' + 1) % 2 = 1) with hod | hev + · cases hd_mrg : decide (6 ≥ 2 + mr') with + | true => + have hg2 : stepGuards ⟨true, (d + 1, mr' + 1) :: p1, p2, 2, 2, 6, []⟩ = true := by + dsimp only [stepGuards]; rw [if_pos hod, hd_mrg, if_pos rfl] + exact (safeStack_d (by omega)).2.1 + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs]; rw [if_pos hod, hd_mrg, if_pos rfl] + exact chainLeadsUpTo_here (rootInv_of_D (d := 2 + (d + 1)) (by omega) (Or.inl rfl) + (validTail40_of_validSegs40 hvp) (by omega) (by omega) (by omega) + (by omega) (by omega) (by omega)) + | false => + have hg2 : stepGuards ⟨true, (d + 1, mr' + 1) :: p1, p2, 2, 2, 6, []⟩ = true := by + dsimp only [stepGuards]; rw [if_pos hod, hd_mrg, if_neg Bool.false_ne_true] + change decide (2 + (d + 1) ≥ 2) = true; exact decide_eq_true (by omega) + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs]; rw [if_pos hod, hd_mrg, if_neg Bool.false_ne_true] + set q := pushSeg true (2 + (d + 1) + 1) (2 + (mr' + 1) - (6 + 2)) p1 p2 + have hdp : drainPopStep true (2 + (d + 1)) (2 + (mr' + 1) - (6 + 2)) p1 p2 [] = + ⟨false, q.1, q.2, 1, 1, 0, []⟩ := rfl + rw [hdp] + have hvtq : ValidTail40 q.1 q.2 := + validTail40_pushSeg true (fun _ => hvp) (by intro hf; cases hf) + have hfzq : 2 + (d + 1) + 1 ≤ fzOf q.1 q.2 := + fzOf_pushSeg_ge true (2 + (d + 1) + 1) (2 + (mr' + 1) - (6 + 2)) p1 p2 + exact chainLeadsUpTo_here (rootInv_of_0B (Or.inl rfl) hvtq + (by decide) (by decide) (by decide) (by omega) (by omega) + (by intro h; omega) (fun _ => Or.inl ⟨rfl, rfl⟩) (by intro _ _ _ _ hcz9; omega)) + · cases hd_mrg : decide (6 ≥ 2 + (mr' + 1)) with + | true => + have h_mrg := of_decide_eq_true hd_mrg + have hg2 : stepGuards ⟨true, (d + 1, mr' + 1) :: p1, p2, 2, 2, 6, []⟩ = true := by + dsimp only [stepGuards]; rw [if_neg hev, hd_mrg, if_pos rfl] + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs]; rw [if_neg hev, hd_mrg, if_pos rfl] + exact chainLeadsUpTo_here (rootInv_of_0B (Or.inl rfl) (validTail40_of_validSegs40 hvp) + (by omega) (by omega) (by omega) (by omega) (by omega) + (by intro h; omega) (by intro h; omega) (by intro _ _ _ _ hcz9; omega)) + | false => + have hg2 : stepGuards ⟨true, (d + 1, mr' + 1) :: p1, p2, 2, 2, 6, []⟩ = true := by + dsimp only [stepGuards]; rw [if_neg hev, hd_mrg, if_neg Bool.false_ne_true] + change decide (2 + (d + 1) ≥ 2) = true; exact decide_eq_true (by omega) + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs]; rw [if_neg hev, hd_mrg, if_neg Bool.false_ne_true] + set q := pushSeg true (2 + (d + 1) + 1) (2 + (mr' + 1) - (6 + 2)) p1 p2 + have hdp : drainPopStep true (2 + (d + 1)) (2 + (mr' + 1) - (6 + 2)) p1 p2 [] = + ⟨false, q.1, q.2, 1, 1, 0, []⟩ := rfl + rw [hdp] + have hvtq : ValidTail40 q.1 q.2 := + validTail40_pushSeg true (fun _ => hvp) (by intro hf; cases hf) + have hfzq : 2 + (d + 1) + 1 ≤ fzOf q.1 q.2 := + fzOf_pushSeg_ge true (2 + (d + 1) + 1) (2 + (mr' + 1) - (6 + 2)) p1 p2 + exact chainLeadsUpTo_here (rootInv_of_0B (Or.inl rfl) hvtq + (by decide) (by decide) (by decide) (by omega) (by omega) + (by intro h; omega) (fun _ => Or.inl ⟨rfl, rfl⟩) (by intro _ _ _ _ hcz9; omega)) + +theorem bounce_y_8_ge46_leads {N y phi : Nat} {s : SegState} + (hb : IsBounce phi [y, 8] s) (hy28 : 28 ≤ y) (hphi46 : 46 ≤ phi) : + ChainLeadsUpTo N s RootInv := by + have hnrst : isDrainRstDs [y, 8] = false := rfl + have hnr0 : isRank0 [y, 8] = false := by + rcases y with _ | _ | _ | _ <;> try omega + rfl + have hg_pop : drainPopGuards phi [y, 8] = true := by + dsimp only [drainPopGuards] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true] + have hc1 : decide (y ≥ 3 ∧ 8 ≥ 1) = true := decide_eq_true (by omega) + have hc2 : decide (y % 2 = 0 ∧ y ≤ 2 * 8 + 4) = false := decide_eq_false (by omega) + have hc3 : decide (y % 2 = 0 ∧ y + 14 ≤ 2 * 8) = false := decide_eq_false (by omega) + have hc4 : decide (phi ≥ 16) = true := decide_eq_true (by omega) + rw [hc1, hc2, hc3, hc4]; rfl + obtain ⟨hg_s, _, hp, m_rem, rest, zl, hv_rest, hzl_false, hstep⟩ := isBounce_step hb hg_pop + set p := pushSeg hp (phi + 2) m_rem rest zl + have hdp : drainPopStep hp phi m_rem rest zl [y, 8] = + ⟨true, (0, (y - 4) + 1) :: p.1, p.2, 7, 0, 16, []⟩ := by + dsimp only [drainPopStep] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true, + if_neg (by rintro ⟨h81, _, _⟩; cases h81)] + have hnorm : normSeg 0 (y - 3) = (0, (y - 4) + 1) := by + dsimp only [normSeg]; rw [if_neg (by omega)]; congr 1; omega + rw [hnorm] + rw [hdp] at hstep + have hvp : ValidSegs40 p.1 p.2 := + validSegs40_pushSeg hp (by omega) hv_rest (fun hf => by have := hzl_false hf; omega) + have hfzp : phi + 2 ≤ fzOf p.1 p.2 := fzOf_pushSeg_ge hp (phi + 2) m_rem rest zl + apply chainLeadsUpTo_step hg_s + intro m1 _ + rw [hstep] + have hg2 : stepGuards ⟨true, (0, (y - 4) + 1) :: p.1, p.2, 7, 0, 16, []⟩ = true := by + dsimp only [stepGuards] + rcases dec_or (((y - 4) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega)]; rfl + · rw [if_neg hev, decide_eq_false (by omega)]; rfl + have hs2 : stepSegs ⟨true, (0, (y - 4) + 1) :: p.1, p.2, 7, 0, 16, []⟩ = + ⟨false, (8, y - 21) :: p.1, p.2, 1, 1, 0, []⟩ := by + have hm_eq : 0 + ((y - 4) + 1) - (16 + 2) = y - 21 := by omega + have hn8 : normSeg 8 (y - 21) = (8, y - 21) := by + dsimp only [normSeg]; rw [if_neg (by omega)] + have hdp2 : drainPopStep true (7 + 0) (y - 21) p.1 p.2 [] = + ⟨false, normSeg 8 (y - 21) :: p.1, p.2, 1, 1, 0, []⟩ := rfl + dsimp only [stepSegs] + rcases dec_or (((y - 4) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega), if_neg Bool.false_ne_true, hm_eq, hdp2, hn8] + · rw [if_neg hev, decide_eq_false (by omega), if_neg Bool.false_ne_true, hm_eq, hdp2, hn8] + apply chainLeadsUpTo_step1 hg2 + rw [hs2] + apply chainLeadsUpTo_here + refine rootInv_of_0B (Or.inl rfl) hvp + (by decide) (by decide) (by decide) (by dsimp only [fzOf]; omega) (by dsimp only [fzOf]; omega) + (by intro h; cases h) (fun _ => Or.inl ⟨rfl, rfl⟩) ?_ + intro z0 m0 r hseg _ _ _ + injection hseg with hhd htl + injection hhd with hz0 hm0 + subst hz0 hm0 htl + exact ⟨by omega, by omega, fun hlt => False.elim (by omega)⟩ + +theorem bounce_y_d_small_leads {N d y phi : Nat} {tl : List Nat} {s : SegState} + (hb : IsBounce phi (y :: d :: tl) s) + (hd_lo : 8 ≤ d) (hd_hi : d ≤ 18) + (htl : tl = [] ∨ tl = [0]) + (h8_tl : d = 8 → tl = [0]) + (hy39 : 39 ≤ y) (hphi38 : 38 ≤ phi) : + ChainLeadsUpTo N s RootInv := by + have hg1 : 9 ≤ d → GoodDs ((d - 1) :: tl) = true := by + intro hd9 + rcases htl with rfl | rfl + · exact (safeStack_d (by omega)).2.1 + · exact (safeStack_d0 (by omega)).2.1 + have hnrst : isDrainRstDs (y :: d :: tl) = false := by + cases d with | zero => omega | succ _ => rfl + have hnr0 : isRank0 (y :: d :: tl) = false := by + rcases y with _ | _ | _ | _ <;> try omega + rfl + have hg_pop : drainPopGuards phi (y :: d :: tl) = true := by + dsimp only [drainPopGuards] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true] + have hc1 : decide (y ≥ 3 ∧ d ≥ 1) = true := decide_eq_true (by omega) + have hc2 : (!decide (y % 2 = 0 ∧ y ≤ 2 * d + 4) || GoodDs ((d - 1) :: tl)) = true := by + rcases dec_or (d = 8) with rfl | hd9 + · rw [decide_eq_false (by omega)]; rfl + · rw [hg1 (by omega), Bool.or_true] + have hc3 : decide (y % 2 = 0 ∧ y + 14 ≤ 2 * d) = false := decide_eq_false (by omega) + have hc4 : decide (phi ≥ 16) = true := decide_eq_true (by omega) + rw [hc1, hc2, hc3, hc4]; rfl + obtain ⟨hg_s, _, hp, m_rem, rest, zl, hv_rest, hzl_false, hstep⟩ := isBounce_step hb hg_pop + set p := pushSeg hp (phi + 2) m_rem rest zl + have hdp : drainPopStep hp phi m_rem rest zl (y :: d :: tl) = + ⟨true, (0, y - 3) :: p.1, p.2, d - 1, 0, 2 * d, tl⟩ := by + dsimp only [drainPopStep] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true, if_neg (by omega)] + have hnorm : normSeg 0 (y - 3) = (0, y - 3) := by + dsimp only [normSeg]; rw [if_neg (by omega)] + rw [hnorm] + rw [hdp] at hstep + have hvp : ValidSegs40 p.1 p.2 := + validSegs40_pushSeg hp (by omega) hv_rest (fun hf => by have := hzl_false hf; omega) + have hfzp40 : 40 ≤ fzOf p.1 p.2 := fzOf_ge_40 hvp + apply chainLeadsUpTo_step hg_s + intro m1 _ + rw [hstep] + rcases dec_or (2 * d + 5 ≤ y) with hbig | hsm + · rcases htl with rfl | rfl + · have hd9 : 9 ≤ d := by + rcases dec_or (d = 8) with rfl | h9 + · cases h8_tl rfl + · omega + have hy_sub : y - 3 = (y - 4) + 1 := by omega + have hpop_nil : drainPopGuards (d - 1 + 0) [] = true := by + change decide (d - 1 + 0 ≥ 2) = true; exact decide_eq_true (by omega) + have hg2 : stepGuards ⟨true, (0, y - 3) :: p.1, p.2, d - 1, 0, 2 * d, []⟩ = true := by + rw [hy_sub]; dsimp only [stepGuards] + rcases dec_or (((y - 4) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega)]; exact hpop_nil + · rw [if_neg hev, decide_eq_false (by omega)]; exact hpop_nil + apply chainLeadsUpTo_step1 hg2 + rw [hy_sub]; dsimp only [stepSegs] + set q := pushSeg true (d - 1 + 0 + 1) (0 + ((y - 4) + 1) - (2 * d + 2)) p.1 p.2 + have hvtq : ValidTail40 q.1 q.2 := + validTail40_pushSeg true (fun _ => hvp) (by intro hf; cases hf) + have hfzq : d - 1 + 0 + 1 ≤ fzOf q.1 q.2 := + fzOf_pushSeg_ge true (d - 1 + 0 + 1) (0 + ((y - 4) + 1) - (2 * d + 2)) p.1 p.2 + rcases dec_or (((y - 4) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega)] + change ChainLeadsUpTo m1 ⟨false, q.1, q.2, 1, 1, 0, []⟩ RootInv + exact chainLeadsUpTo_here (rootInv_of_0B (Or.inl rfl) hvtq + (by decide) (by decide) (by decide) (by omega) (by omega) + (by intro h; omega) (fun _ => Or.inl ⟨rfl, rfl⟩) (by intro _ _ _ _ hcz9; omega)) + · rw [if_neg hev, decide_eq_false (by omega)] + change ChainLeadsUpTo m1 ⟨false, q.1, q.2, 1, 1, 0, []⟩ RootInv + exact chainLeadsUpTo_here (rootInv_of_0B (Or.inl rfl) hvtq + (by decide) (by decide) (by decide) (by omega) (by omega) + (by intro h; omega) (fun _ => Or.inl ⟨rfl, rfl⟩) (by intro _ _ _ _ hcz9; omega)) + · exact bounce_r9_zero_leads hd_lo hbig hvp + · -- Only possible when `d = 18` and `y = 39` or `y = 40`: + have hd18 : d = 18 := by omega + subst hd18 + rcases dec_or (y = 39) with rfl | hy40 + · have hg2 : stepGuards ⟨true, (0, 39 - 3) :: p.1, p.2, 18 - 1, 0, 2 * 18, tl⟩ = true := rfl + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs] + exact chainLeadsUpTo_here (rootInv_of_0B htl (validTail40_of_validSegs40 hvp) + (by decide) (by decide) (by decide) (by omega) (by omega) + (by intro h; omega) (by intro h; omega) (by intro _ _ _ _ hcz9; omega)) + · have hy_eq : y = 40 := by omega + subst hy_eq + have hg2 : stepGuards ⟨true, (0, 40 - 3) :: p.1, p.2, 18 - 1, 0, 2 * 18, tl⟩ = true := by + change stepGuards ⟨true, (0, 36 + 1) :: p.1, p.2, 17, 0, 36, tl⟩ = true + dsimp only [stepGuards] + rw [if_pos (by decide), decide_eq_true (by decide), if_pos rfl] + exact hg1 (by decide) + apply chainLeadsUpTo_step1 hg2 + change ChainLeadsUpTo m1 (stepSegs ⟨true, (0, 36 + 1) :: p.1, p.2, 17, 0, 36, tl⟩) RootInv + dsimp only [stepSegs] + rw [if_pos (by decide), decide_eq_true (by decide), if_pos rfl] + have hds17 : (17 :: tl) = [17] ∨ (17 :: tl) = [17, 0] := by + rcases htl with rfl | rfl <;> [exact Or.inl rfl; exact Or.inr rfl] + exact chainLeadsUpTo_here (rootInv_of_D (d := 17) (by decide) hds17 + (validTail40_of_validSegs40 hvp) (by decide) (by decide) (by decide) + (by omega) (by omega) (by omega)) + +-- ============================================================================ +-- 1. `rootD_advances` (`RootD s -> ChainAdvances s RootInv`) +-- ============================================================================ + +theorem x_8_high_leads {N x zl c k : Nat} {segs : List (Nat × Nat)} + (hx41 : 41 ≤ x) (hv : ValidSegs40 segs zl) + (hc : (66 ≤ c ∧ k = 1) ∨ (77 ≤ c ∧ 1 ≤ k ∧ k ≤ 2 * c + 3)) : + ChainLeadsUpTo N ⟨false, segs, zl, c, k, 0, [x, 8]⟩ RootInv := by + have hc2 : 2 ≤ c := by rcases hc with ⟨h, _⟩ | ⟨h, _⟩ <;> omega + have hk1 : 1 ≤ k := by rcases hc with ⟨_, h⟩ | ⟨_, h, _⟩ <;> omega + have hkc : k ≤ 2 * c + 3 := by rcases hc with ⟨_, rfl⟩ | ⟨_, _, h⟩ <;> omega + have hfz40 : 40 ≤ fzOf segs zl := fzOf_ge_40 hv + have hox97 : 97 ≤ ox (k + 2 * fzOf segs zl) (c + fzOf segs zl) ∧ + 96 ≤ odw (k + 2 * fzOf segs zl) (c + fzOf segs zl) := by + have h := ox_ge_of_c hc2 hk1 hkc hfz40 + have hc66 : 66 ≤ c := by rcases hc with ⟨h1, _⟩ | ⟨h1, _⟩ <;> omega + omega + have hS8_21 : SafeStack 21 [8] := safeStack_d (by decide) + have hS8 : SafeStack 43 [8] := safeStack_mono (by decide) hS8_21 + have hSx8 : SafeStack 19 [x, 8] := + safeStack_cons_ne1 (by decide) hS8_21 (by omega) (by omega) + have hfb := (excursion_bundle N).1 19 [x, 8] segs zl c k (by decide) hSx8 + (validTail40_of_validSegs40 hv) (by omega) hk1 hkc (by omega) (by omega) (by omega) (by omega) + refine chainLeadsUpTo_trans hfb ?_ + intro m1 s_mid hm1 hex + rcases hex with ⟨phi, hphi, hb⟩ | ⟨y, phi, hy, hphi38, _, hb⟩ + · exact bounce_y_8_ge46_leads hb (by omega) (by omega) + · exact amega_pop_step hb hphi38 (by omega) (by omega) + (hS8_21.2.2 (x - 1) (by omega)) + (fun _ => hS8_21.2.2 (x - 2) (by omega)) + (fun hbig _ _ p1 p2 hvp _ => + bounce_d_leads (isBounce_r9 (by omega) hbig hvp) (Or.inl rfl) + (Or.inl ⟨rfl, Or.inr (Or.inr (by omega))⟩)) + (fun _ _ _ _ p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + exact chainLeadsUpTo_here (rootInv_of_D (d := 8) (by decide) (Or.inl rfl) + (validTail40_of_validSegs40 hvp) (by omega) (by omega) (by omega) + (by omega) (by omega) (by omega))) + (fun hy_le _ m2 _ p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + have hox124 : 124 ≤ ox (1 + 2 * fzOf p1 p2) (y + fzOf p1 p2) ∧ + 123 ≤ odw (1 + 2 * fzOf p1 p2) (y + fzOf p1 p2) := by + have h := ox_ge_of_c (c := y) (k := 1) (fz := fzOf p1 p2) + (by omega) (by decide) (by omega) hfp + omega + have hSx1 : SafeStack 19 [x - 1, 8] := + safeStack_cons_ne1 (by decide) hS8_21 (by omega) (by omega) + have hfb2 := (excursion_bundle m2).1 19 [x - 1, 8] p1 p2 y 1 (by decide) hSx1 + (validTail40_of_validSegs40 hvp) (by omega) (by decide) (by omega) + (by omega) (by omega) (by omega) (by omega) + refine chainLeadsUpTo_trans hfb2 ?_ + intro m3 s_m2 _ hex2 + rcases hex2 with ⟨phi2, hphi2, hb2⟩ | ⟨y2, phi2, hy2, hphi2_38, _, hb2⟩ + · exact bounce_y_8_ge46_leads hb2 (by omega) (by omega) + · exact amega_pop_step hb2 hphi2_38 (by omega) (by omega) + (hS8_21.2.2 (x - 1 - 1) (by omega)) + (fun _ => hS8_21.2.2 (x - 1 - 2) (by omega)) + (fun hbig _ _ q1 q2 hvq _ => + bounce_d_leads (isBounce_r9 (by omega) hbig hvq) (Or.inl rfl) + (Or.inl ⟨rfl, Or.inr (Or.inr (by omega))⟩)) + (fun _ _ _ _ q1 q2 hvq _ => by + have hfq := fzOf_ge_40 hvq + exact chainLeadsUpTo_here (rootInv_of_D (d := 8) (by decide) (Or.inl rfl) + (validTail40_of_validSegs40 hvq) (by omega) (by omega) (by omega) + (by omega) (by omega) (by omega))) + (fun hy2_le _ m4 _ q1 q2 hvq _ => by + have hfq := fzOf_ge_40 hvq + have hx2_49 : 49 ≤ x - 1 - 1 := by omega + have hlh := (fhigh_bundle m4).2.1 [8] q1 q2 y2 1 (x - 1 - 1) + (by decide) hS8 hvq (by omega) (by decide) (by omega) hx2_49 (by omega) + refine chainLeadsUpTo_trans hlh ?_ + intro m5 s_eh _ heh + rcases heh with ⟨phi3, hphi3, hb3⟩ | ⟨y3, phi3, hy3, hphi3, hb3⟩ + · exact bounce_d_leads hb3 (Or.inl rfl) (Or.inl ⟨rfl, Or.inr (Or.inr (by omega))⟩) + · exact bounce_y_8_ge46_leads hb3 (by omega) (by omega))) + +theorem exitHigh_8_leads {N : Nat} {s : SegState} (heh : ExitHigh [8] s) : + ChainLeadsUpTo N s RootInv := by + rcases heh with ⟨phi, hphi, hb⟩ | ⟨y, phi, hy, hphi, hb⟩ + · exact bounce_d_leads hb (Or.inl rfl) (Or.inl ⟨rfl, Or.inr (Or.inr (by omega))⟩) + · exact bounce_y_8_ge46_leads hb (by omega) (by omega) + +theorem rootD_advances {s : SegState} (hb0 : s.b = false) (hm0_z : s.mrg = 0) (hr : RootD s) : + ChainAdvances s RootInv := by + rcases s with ⟨b, segs, zl, c, k, mrg, ds⟩ + dsimp only at hb0 hm0_z + subst hb0 hm0_z + obtain ⟨⟨d, hd8, hds⟩, hvt, hc, hk1, hkc, hfz35, hcz42, hkz73⟩ := hr + dsimp only at hds hvt hc hk1 hkc hfz35 hcz42 hkz73 + rcases dec_or (ds = [8]) with rfl | hnot8 + · -- Dedicated 1-step unrolling for `ds = [8]` (ensures `46 <= phi` on all `[y, 8]` exits): + have hS8_21 : SafeStack 21 [8] := safeStack_d (by decide) + have hS8_43 : SafeStack 43 [8] := safeStack_mono (by decide) hS8_21 + rcases segs with _ | ⟨⟨z0, m0⟩, rest⟩ + · dsimp only [fzOf, ValidTail40] at hvt hfz35 hcz42 hkz73 + have hg : stepGuards ⟨false, [], zl, c, k, 0, [8]⟩ = true := by + dsimp only [stepGuards] + rw [goodPhiW_of_ge35 hS8_21.1 (by omega), Bool.true_and] + dsimp only [GoodPsi] + have hcz : c + zl - 1 + 1 = c + zl := by omega + rw [hcz]; exact hS8_21.2.2 (c + zl) (by omega) + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + have hbc : IsBounce (k + 2 * zl + 2) [c + zl, 8] + ⟨true, [], 0, k + 2 * zl + 2, 0, 2 * (k + 2 * zl) + 6, [c + zl, 8]⟩ := by + simpa only [Nat.add_zero] using IsBounce.nil (zl := 0) (cp1 := k + 2 * zl + 2) (kb := 0) + (mrg := 2 * (k + 2 * zl) + 6) (ds := [c + zl, 8]) (by omega) + exact bounce_y_8_ge46_leads hbc (by omega) (by omega) + · dsimp only [fzOf, ValidTail40] at hvt hfz35 hcz42 hkz73 + have hv_rest : ValidSegs40 rest zl := hvt + cases m0 with + | zero => + refine ⟨rfl, fun N => ?_⟩ + dsimp only [stepSegs] + rcases rest with _ | ⟨⟨z1, m1_seg⟩, rest2⟩ + · have := hv_rest.2 + exact bounce_d_leads (IsBounce.nil (by omega)) (Or.inl rfl) + (Or.inl ⟨rfl, Or.inr (Or.inr (by omega))⟩) + · have hz1_40 : 40 ≤ z1 := fzOf_ge_40 hv_rest + have hv_r2 : ValidSegs40 rest2 zl := validSegs40_tail hv_rest + have hfz2_40 : 40 ≤ fzOf rest2 zl := fzOf_ge_40 hv_r2 + cases m1_seg with + | zero => + have hg2 : stepGuards ⟨true, (z1, 0) :: rest2, zl, c + z0 + 3, k + 2 * z0 + 3, + 2 * (c + z0) + 8, [8]⟩ = true := by + dsimp only [stepGuards]; exact decide_eq_true (by omega) + apply chainLeadsUpTo_step hg2 + intro m2 _ + dsimp only [stepSegs] + exact chainLeadsUpTo_trans + ((fhigh_bundle m2).1 [8] rest2 zl (c + z0 + 3 + z1 + 1) (k + 2 * z0 + 3 + 2 * z1 + 3) + (by decide) hS8_43 hv_r2 (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ _ _ heh => exitHigh_8_leads heh) + | succ m1' => + rcases dec_or ((m1' + 1) % 2 = 1) with hm1_od | hm1_ev + · cases hd_mrg : decide (2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + m1') with + | true => + have hg2 : stepGuards ⟨true, (z1, m1' + 1) :: rest2, zl, c + z0 + 3, + k + 2 * z0 + 3, 2 * (c + z0) + 8, [8]⟩ = true := by + dsimp only [stepGuards]; rw [if_pos hm1_od, hd_mrg, if_pos rfl] + exact hS8_21.2.2 (c + z0 + 3 + z1) (by omega) + apply chainLeadsUpTo_step hg2 + intro m2 _ + dsimp only [stepSegs]; rw [if_pos hm1_od, hd_mrg, if_pos rfl] + exact chainLeadsUpTo_trans + ((fhigh_bundle m2).2.1 [8] rest2 zl ((k + 2 * z0 + 3) + m1' + 2 * z1 + 4) 1 + (c + z0 + 3 + z1) (by decide) hS8_43 hv_r2 + (by omega) (by decide) (by omega) (by omega) (by omega)) + (fun _ _ _ heh => exitHigh_8_leads heh) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact bounce_d_leads (IsBounce.cons hv_r2 (by omega) (by rw [if_pos hm1_od]; omega)) + (Or.inl rfl) (Or.inl ⟨rfl, Or.inr (Or.inr (by omega))⟩) + · cases hd_mrg : decide (2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + (m1' + 1)) with + | true => + have h_mrg := of_decide_eq_true hd_mrg + have hg2 : stepGuards ⟨true, (z1, m1' + 1) :: rest2, zl, c + z0 + 3, + k + 2 * z0 + 3, 2 * (c + z0) + 8, [8]⟩ = true := by + dsimp only [stepGuards]; rw [if_neg hm1_ev, hd_mrg, if_pos rfl] + apply chainLeadsUpTo_step hg2 + intro m2 _ + dsimp only [stepSegs]; rw [if_neg hm1_ev, hd_mrg, if_pos rfl] + exact chainLeadsUpTo_trans + ((fhigh_bundle m2).1 [8] rest2 zl (c + z0 + 3 + z1 + 2) + ((k + 2 * z0 + 3) + (m1' + 1) + 2 * z1 + 5) + (by decide) hS8_43 hv_r2 (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ _ _ heh => exitHigh_8_leads heh) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact bounce_d_leads (IsBounce.cons hv_r2 (by omega) (by rw [if_neg hm1_ev]; omega)) + (Or.inl rfl) (Or.inl ⟨rfl, Or.inr (Or.inr (by omega))⟩) + | succ m' => + have hfz1_40 : 40 ≤ fzOf rest zl := fzOf_ge_40 hv_rest + have hphiw : GoodPhiW (c + z0 - 1) [8] false = true := goodPhiW_of_ge35 hS8_21.1 (by omega) + rcases dec_or (m' + 1 = 1) with hm1 | hm_gt1 + · have hm0_eq : m' = 0 := by omega + subst hm0_eq + have hg : stepGuards ⟨false, (z0, 1) :: rest, zl, c, k, 0, [8]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) [8] false && if 1 = 1 then GoodPsi (c + z0) [8] else _) = + true + rw [hphiw, Bool.true_and, if_pos rfl] + exact hS8_21.2.2 (c + z0 + 1) (by omega) + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if 1 = 1 then _ else _) _ + rw [if_pos rfl] + exact x_8_high_leads (by omega) hv_rest (Or.inr ⟨by omega, by decide, by omega⟩) + · have hpsi_cz : GoodPsi (c + z0 - 1) [8] = true := by + dsimp only [GoodPsi] + have hcz_eq : c + z0 - 1 + 1 = c + z0 := by omega + rw [hcz_eq]; exact hS8_21.2.2 (c + z0) (by omega) + rcases dec_or ((m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10) with hev_sm | hnot_ev + · have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, [8]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) [8] false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) [8] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else _) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, if_pos hev_sm] + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else _) _ + rw [if_neg hm_gt1, if_pos hev_sm] + exact x_8_high_leads (by omega) hv_rest (Or.inr ⟨by omega, by omega, by omega⟩) + · rcases dec_or ((m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11) with hod_sm | hbig_m + · have hS_cz : SafeStack 19 [c + z0, 8] := + safeStack_cons_ne1 (by decide) hS8_21 (by omega) (by omega) + have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, [8]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) [8] false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) [8] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then + GoodDs ((k + 2 * z0 + 2) :: (c + z0) :: [8]) else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_pos hod_sm] + exact hS_cz.2.2 (k + 2 * z0 + 2) (by omega) + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_pos hod_sm] + have hm_sub : m' + 1 - 1 = m' := by omega + rw [hm_sub] + have hne1_cz : ([c + z0, 8] : List Nat) ≠ [1] := by + intro h; injection h with _ h2; cases h2 + have hlb := (excursion_bundle N).2 19 [c + z0, 8] rest zl m' 1 + (k + 2 * z0 + 2) 65 0 (by decide) hS_cz (Or.inl hne1_cz) hv_rest + (by omega) (by decide) (by omega) (by decide) (by omega) + (by omega) (by omega) (by omega) (by omega) + refine chainLeadsUpTo_trans hlb ?_ + intro m1 s_mid _ hex + rcases hex with ⟨phi, hphi, hb⟩ | ⟨y, phi, hy, hphi38, _, hb⟩ + · exact bounce_y_8_ge46_leads hb (by omega) (by omega) + · exact amega_pop_step hb hphi38 (by omega) (by omega) + (hS8_21.2.2 (c + z0 - 1) (by omega)) + (fun _ => hS8_21.2.2 (c + z0 - 2) (by omega)) + (fun hbig _ _ p1 p2 hvp _ => + bounce_d_leads (isBounce_r9 (by omega) hbig hvp) (Or.inl rfl) + (Or.inl ⟨rfl, Or.inr (Or.inr (by omega))⟩)) + (fun _ _ _ _ p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + exact chainLeadsUpTo_here (rootInv_of_D (d := 8) (by decide) (Or.inl rfl) + (validTail40_of_validSegs40 hvp) (by omega) (by omega) (by omega) + (by omega) (by omega) (by omega))) + (fun _ _ m2 _ p1 p2 hvp _ => + x_8_high_leads (by omega) hvp (Or.inl ⟨by omega, rfl⟩)) + · have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, [8]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) [8] false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) [8] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_neg hbig_m] + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_neg hbig_m] + have hnorm : normSeg 0 (m' + 1 - 4) = (0, (m' - 4) + 1) := by + dsimp only [normSeg]; rw [if_neg (by omega)]; congr 1; omega + rw [hnorm] + have hbc : IsBounce (k + 2 * z0 + 2) [c + z0, 8] + ⟨true, (0, (m' - 4) + 1) :: rest, zl, k + 2 * z0 + 2, 0, + 2 * (k + 2 * z0) + 6, [c + z0, 8]⟩ := by + have h := IsBounce.cons (z0 := 0) (m := m' - 4) (zl := zl) + (cp1 := k + 2 * z0 + 2) (kb := 0) (mrg := 2 * (k + 2 * z0) + 6) + (rest := rest) (ds := [c + z0, 8]) hv_rest (by omega) + (by split_ifs <;> omega) + simpa only [Nat.add_zero] using h + exact bounce_y_8_ge46_leads hbc (by omega) (by omega) + · -- General `RootD` (`9 <= d` or `ds = [8, 0]`): + have hS : SafeStack 21 ds := by + rcases hds with rfl | rfl + · exact safeStack_d hd8 + · exact safeStack_d0 hd8 + obtain ⟨hox39, _⟩ := ox_bounds_relaxed hc hk1 hkc hfz35 hcz42 hkz73 + have hadv := fbound_advances (ms := + 21) (by decide) hS hvt hc hk1 hkc hfz35 hcz42 hkz73 (by omega) + refine chainAdvances_trans hadv ?_ + intro s' hex N + rcases hex with ⟨phi, hphi, hb⟩ | ⟨y, phi, hy, hphi38, _, hb⟩ + · have hphi38 : 38 ≤ phi := by dsimp only [odw] at hphi; omega + refine bounce_d_leads hb hds ?_ + rcases dec_or (d = 8) with rfl | hd9 + · exact Or.inl ⟨rfl, Or.inr (Or.inr hphi38)⟩ + · rcases dec_or (d = 9) with rfl | hd10 + · exact Or.inr (Or.inl ⟨rfl, by omega⟩) + · rcases dec_or (d ≤ 18) with hd18 | hd19 + · exact Or.inr (Or.inr (Or.inl ⟨by omega, hd18, by omega, fun _ _ => by omega⟩)) + · rcases dec_or (d = 19) with rfl | hd20 + · exact Or.inr (Or.inr (Or.inr (Or.inl ⟨rfl, by omega⟩))) + · exact Or.inr (Or.inr (Or.inr (Or.inr ⟨by omega, hphi38⟩))) + · obtain ⟨tl, hds_eq, htl, h8_tl⟩ : + ∃ tl, ds = d :: tl ∧ (tl = [] ∨ tl = [0]) ∧ (d = 8 → tl = [0]) := by + rcases hds with rfl | rfl + · exact ⟨[], rfl, Or.inl rfl, fun hd => False.elim (hnot8 (by rw [hd]))⟩ + · exact ⟨[0], rfl, Or.inr rfl, fun _ => rfl⟩ + rw [hds_eq] at hb + rcases dec_or (d ≤ 18) with hd18 | hd19 + · exact bounce_y_d_small_leads hb hd8 hd18 htl h8_tl (by omega) hphi38 + · have hg1 : GoodDs ((d - 1) :: tl) = true := by + rcases htl with rfl | rfl + · exact (safeStack_d (by omega)).2.1 + · exact (safeStack_d0 (by omega)).2.1 + have hg2 : GoodDs ((d - 2) :: tl) = true := by + rcases htl with rfl | rfl + · exact (safeStack_d (by omega)).2.1 + · exact (safeStack_d0 (by omega)).2.1 + exact amega_pop_step hb hphi38 (by omega) (by omega) hg1 (fun _ => hg2) + (fun hbig _ _ p1 p2 hvp _ => by + rcases htl with rfl | rfl + · exact bounce_nil_leads (isBounce_r9 (by omega) hbig hvp) (by omega) + · exact bounce_r9_zero_leads (by omega) hbig hvp) + (fun _ _ _ _ p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + exact chainLeadsUpTo_here (rootInv_of_0B htl (validTail40_of_validSegs40 hvp) + (by omega) (by omega) (by omega) (by omega) (by omega) + (by intro h; omega) (by intro h; omega) (by intro _ _ _ _ hcz9; omega))) + (fun _ _ _ _ p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + have hds_d1 : ((d - 1) :: tl) = [d - 1] ∨ ((d - 1) :: tl) = [d - 1, 0] := by + rcases htl with rfl | rfl <;> [exact Or.inl rfl; exact Or.inr rfl] + exact chainLeadsUpTo_here (rootInv_of_D (d := d - 1) (by omega) hds_d1 + (validTail40_of_validSegs40 hvp) (by omega) (by decide) (by omega) + (by omega) (by omega) (by omega))) + +-- ============================================================================ +-- 2. `rootD1_advances` (`RootD1 s -> ChainAdvances s RootInv`) +-- ============================================================================ + +theorem exit_d1_leads {N d tx tdw txw : Nat} {s : SegState} + (hd25 : 25 ≤ d) (htx : 43 ≤ tx) (htdw : 42 ≤ tdw) + (h25_tx : d = 25 → 57 ≤ tx) + (hex : Exit tx tdw txw [d, 1] s) : + ChainLeadsUpTo N s RootInv := by + rcases hex with ⟨phi, hphi, hb⟩ | ⟨y, phi, hy, hphi38, _, hb⟩ + · exact bounce_d1_leads hb hd25 (by omega) + · rcases dec_or (d = 25) with rfl | hd26 + · have h57 : 57 ≤ tx := h25_tx rfl + exact r9_pop_step hb hphi38 (by decide) (by omega) + (fun _ _ p1 p2 hvp _ => + bounce_one_leads (isBounce_r9 (by decide) (by omega) hvp) (by decide)) + · exact amega_pop_step hb hphi38 (by omega) (by omega) + (safeStack_one.2.2 (d - 1) (by omega)) + (fun _ => safeStack_one.2.2 (d - 2) (by omega)) + (fun hbig _ _ p1 p2 hvp _ => + bounce_one_leads (isBounce_r9 (by omega) hbig hvp) (by omega)) + (fun _ _ _ _ p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + exact chainLeadsUpTo_here (rootInv_of_1 (validTail40_of_validSegs40 hvp) + (by omega) (by omega) (by omega) (by omega) (by omega) + (by intro h; omega) (fun _ => by omega))) + (fun _ _ _ _ p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + exact chainLeadsUpTo_here (rootInv_of_D1 (by omega) (validTail40_of_validSegs40 hvp) + (by omega) (by decide) (by omega) (by omega) (by omega) (by omega))) + +theorem rootD1_advances {s : SegState} (hb0 : s.b = false) (hm0_z : s.mrg = 0) (hr : RootD1 s) : + ChainAdvances s RootInv := by + rcases s with ⟨b, segs, zl, c, k, mrg, ds⟩ + dsimp only at hb0 hm0_z + subst hb0 hm0_z + obtain ⟨⟨d, hd25, hds⟩, hvt, hc, hk1, hkc, hfz40, hcz62, hkz81⟩ := hr + dsimp only at hds hvt hc hk1 hkc hfz40 hcz62 hkz81 + subst hds + rcases dec_or (d = 25) with rfl | hd26 + · -- Dedicated 1-step unrolling for `d = 25` (`SafeStack 55 [25, 1]`): + have hS55 : SafeStack 55 [25, 1] := safeStack_25_1 + have hne1 : ([25, 1] : List Nat) ≠ [1] := by intro h; cases h + rcases segs with _ | ⟨⟨z0, m0⟩, rest⟩ + · dsimp only [fzOf, ValidTail40] at hvt hfz40 hcz62 hkz81 + have hg : stepGuards ⟨false, [], zl, c, k, 0, [25, 1]⟩ = true := by + dsimp only [stepGuards] + rw [goodPhiW_of_ge35 hS55.1 (by omega), Bool.true_and] + dsimp only [GoodPsi] + have hcz : c + zl - 1 + 1 = c + zl := by omega + rw [hcz]; exact hS55.2.2 (c + zl) (by omega) + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + have hbc : IsBounce (k + 2 * zl + 2) [c + zl, 25, 1] + ⟨true, [], 0, k + 2 * zl + 2, 0, 2 * (k + 2 * zl) + 6, [c + zl, 25, 1]⟩ := by + simpa only [Nat.add_zero] using IsBounce.nil (zl := 0) (cp1 := k + 2 * zl + 2) (kb := 0) + (mrg := 2 * (k + 2 * zl) + 6) (ds := [c + zl, 25, 1]) (by omega) + exact exit_d1_leads (tx := 57) (tdw := 42) (txw := 0) (by decide) (by decide) (by decide) + (fun _ => by decide) (Or.inr ⟨c + zl, k + 2 * zl + 2, by omega, by omega, by omega, hbc⟩) + · dsimp only [fzOf, ValidTail40] at hvt hfz40 hcz62 hkz81 + have hv_rest : ValidSegs40 rest zl := hvt + cases m0 with + | zero => + refine ⟨rfl, fun N => ?_⟩ + dsimp only [stepSegs] + rcases rest with _ | ⟨⟨z1, m1_seg⟩, rest2⟩ + · have := hv_rest.2 + exact bounce_d1_leads (IsBounce.nil (by omega)) (by decide) (by omega) + · have hz1_40 : 40 ≤ z1 := fzOf_ge_40 hv_rest + have hv_r2 : ValidSegs40 rest2 zl := validSegs40_tail hv_rest + have hfz2_40 : 40 ≤ fzOf rest2 zl := fzOf_ge_40 hv_r2 + cases m1_seg with + | zero => + have hg2 : stepGuards ⟨true, (z1, 0) :: rest2, zl, c + z0 + 3, k + 2 * z0 + 3, + 2 * (c + z0) + 8, [25, 1]⟩ = true := by + dsimp only [stepGuards]; exact decide_eq_true (by omega) + apply chainLeadsUpTo_step hg2 + intro m2 _ + dsimp only [stepSegs] + have hox := ox_ge_of_c (c := c + z0 + 3 + z1 + 1) (k := k + 2 * z0 + 3 + 2 * z1 + 3) + (fz := fzOf rest2 zl) (by omega) (by omega) (by omega) hfz2_40 + exact chainLeadsUpTo_trans + ((excursion_bundle m2).1 55 [25, 1] rest2 zl (c + z0 + 3 + z1 + 1) + (k + 2 * z0 + 3 + 2 * z1 + 3) (by decide) hS55 (validTail40_of_validSegs40 hv_r2) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ _ _ hex => exit_d1_leads (by decide) (by omega) (by omega) + (fun _ => by omega) hex) + | succ m1' => + rcases dec_or ((m1' + 1) % 2 = 1) with hm1_od | hm1_ev + · cases hd_mrg : decide (2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + m1') with + | true => + have hg2 : stepGuards ⟨true, (z1, m1' + 1) :: rest2, zl, c + z0 + 3, + k + 2 * z0 + 3, 2 * (c + z0) + 8, [25, 1]⟩ = true := by + dsimp only [stepGuards]; rw [if_pos hm1_od, hd_mrg, if_pos rfl] + exact hS55.2.2 (c + z0 + 3 + z1) (by omega) + apply chainLeadsUpTo_step hg2 + intro m2 _ + dsimp only [stepSegs]; rw [if_pos hm1_od, hd_mrg, if_pos rfl] + exact chainLeadsUpTo_trans + ((excursion_bundle m2).2 55 [25, 1] rest2 zl + ((k + 2 * z0 + 3) + m1' + 2 * z1 + 4) 1 (c + z0 + 3 + z1) 57 0 + (by decide) hS55 (Or.inl hne1) hv_r2 + (by omega) (by decide) (by omega) (by decide) (by omega) + (by omega) (by omega) (by omega) (by omega)) + (fun _ _ _ hex => exit_d1_leads (by decide) (by decide) (by decide) + (fun _ => by decide) hex) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact bounce_d1_leads + (IsBounce.cons hv_r2 (by omega) (by rw [if_pos hm1_od]; omega)) + (by decide) (by omega) + · cases hd_mrg : decide (2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + (m1' + 1)) with + | true => + have h_mrg := of_decide_eq_true hd_mrg + have hg2 : stepGuards ⟨true, (z1, m1' + 1) :: rest2, zl, c + z0 + 3, + k + 2 * z0 + 3, 2 * (c + z0) + 8, [25, 1]⟩ = true := by + dsimp only [stepGuards]; rw [if_neg hm1_ev, hd_mrg, if_pos rfl] + apply chainLeadsUpTo_step hg2 + intro m2 _ + dsimp only [stepSegs]; rw [if_neg hm1_ev, hd_mrg, if_pos rfl] + have hox := ox_ge_of_c (c := c + z0 + 3 + z1 + 2) + (k := (k + 2 * z0 + 3) + (m1' + 1) + 2 * z1 + 5) + (fz := fzOf rest2 zl) (by omega) (by omega) (by omega) hfz2_40 + exact chainLeadsUpTo_trans + ((excursion_bundle m2).1 55 [25, 1] rest2 zl (c + z0 + 3 + z1 + 2) + ((k + 2 * z0 + 3) + (m1' + 1) + 2 * z1 + 5) + (by decide) hS55 (validTail40_of_validSegs40 hv_r2) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ _ _ hex => exit_d1_leads (by decide) (by omega) (by omega) + (fun _ => by omega) hex) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact bounce_d1_leads + (IsBounce.cons hv_r2 (by omega) (by rw [if_neg hm1_ev]; omega)) + (by decide) (by omega) + | succ m' => + have hfz1_40 : 40 ≤ fzOf rest zl := fzOf_ge_40 hv_rest + have hphiw : GoodPhiW (c + z0 - 1) [25, 1] false = true := + goodPhiW_of_ge35 hS55.1 (by omega) + rcases dec_or (m' + 1 = 1) with hm1 | hm_gt1 + · have hm0_eq : m' = 0 := by omega + subst hm0_eq + have hg : stepGuards ⟨false, (z0, 1) :: rest, zl, c, k, 0, [25, 1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) [25, 1] false && + if 1 = 1 then GoodPsi (c + z0) [25, 1] else _) = true + rw [hphiw, Bool.true_and, if_pos rfl] + exact hS55.2.2 (c + z0 + 1) (by omega) + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if 1 = 1 then _ else _) _ + rw [if_pos rfl] + exact chainLeadsUpTo_trans + ((excursion_bundle N).2 55 [25, 1] rest zl (k + 2 * z0 + 4) 1 (c + z0 + 1) 57 0 + (by decide) hS55 (Or.inl hne1) hv_rest + (by omega) (by decide) (by omega) (by decide) (by omega) + (by omega) (by omega) (by omega) (by omega)) + (fun _ _ _ hex => exit_d1_leads (by decide) (by decide) (by decide) + (fun _ => by decide) hex) + · have hpsi_cz : GoodPsi (c + z0 - 1) [25, 1] = true := by + dsimp only [GoodPsi] + have hcz_eq : c + z0 - 1 + 1 = c + z0 := by omega + rw [hcz_eq]; exact hS55.2.2 (c + z0) (by omega) + rcases dec_or ((m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10) with hev_sm | hnot_ev + · have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, [25, 1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) [25, 1] false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) [25, 1] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else _) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, if_pos hev_sm] + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else _) _ + rw [if_neg hm_gt1, if_pos hev_sm] + exact chainLeadsUpTo_trans + ((excursion_bundle N).2 55 [25, 1] rest zl (k + 2 * z0 + 4) (m' + 2) (c + z0) 57 0 + (by decide) hS55 (Or.inl hne1) hv_rest + (by omega) (by omega) (by omega) (by decide) (by omega) + (by omega) (by omega) (by omega) (by omega)) + (fun _ _ _ hex => exit_d1_leads (by decide) (by decide) (by decide) + (fun _ => by decide) hex) + · rcases dec_or ((m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11) with hod_sm | hbig_m + · have hS_cz : SafeStack 19 [c + z0, 25, 1] := + safeStack_cons_ne1 hne1 hS55 (by omega) (by omega) + have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, [25, 1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) [25, 1] false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) [25, 1] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then + GoodDs ((k + 2 * z0 + 2) :: (c + z0) :: [25, 1]) else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_pos hod_sm] + exact hS_cz.2.2 (k + 2 * z0 + 2) (by omega) + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_pos hod_sm] + have hm_sub : m' + 1 - 1 = m' := by omega + rw [hm_sub] + have hne1_cz : ([c + z0, 25, 1] : List Nat) ≠ [1] := by + intro h; injection h with _ h2; cases h2 + have hlb := (excursion_bundle N).2 19 [c + z0, 25, 1] rest zl m' 1 + (k + 2 * z0 + 2) 65 0 (by decide) hS_cz (Or.inl hne1_cz) hv_rest + (by omega) (by decide) (by omega) (by decide) (by omega) + (by omega) (by omega) (by omega) (by omega) + refine chainLeadsUpTo_trans hlb ?_ + intro m1 s_mid _ hex + rcases hex with ⟨phi, hphi, hb⟩ | ⟨y, phi, hy, hphi38, _, hb⟩ + · exact exit_d1_leads (tx := 57) (tdw := 42) (txw := 0) + (by decide) (by decide) (by decide) (fun _ => by decide) + (Or.inr ⟨c + z0, phi, by omega, by omega, by omega, hb⟩) + · exact amega_pop_step hb hphi38 (by omega) (by omega) + (hS55.2.2 (c + z0 - 1) (by omega)) + (fun _ => hS55.2.2 (c + z0 - 2) (by omega)) + (fun hbig _ _ p1 p2 hvp _ => + bounce_d1_leads (isBounce_r9 (by omega) hbig hvp) (by decide) (by omega)) + (fun _ _ m2 _ p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + have hox := ox_ge_of_c (c := c + z0 + 1) (k := y + 2) (fz := fzOf p1 p2) + (by omega) (by omega) (by omega) hfp + exact chainLeadsUpTo_trans + ((excursion_bundle m2).1 55 [25, 1] p1 p2 (c + z0 + 1) (y + 2) + (by decide) hS55 (validTail40_of_validSegs40 hvp) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) + (by omega)) + (fun _ _ _ hex2 => exit_d1_leads (by decide) (by omega) (by omega) + (fun _ => by omega) hex2)) + (fun _ _ m2 _ p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + exact chainLeadsUpTo_trans + ((excursion_bundle m2).2 55 [25, 1] p1 p2 y 1 (c + z0 - 1) 57 0 + (by decide) hS55 (Or.inl hne1) hvp + (by omega) (by decide) (by omega) (by decide) (by omega) + (by omega) (by omega) (by omega) (by omega)) + (fun _ _ _ hex2 => exit_d1_leads (by decide) (by decide) (by decide) + (fun _ => by decide) hex2)) + · have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, [25, 1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) [25, 1] false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) [25, 1] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_neg hbig_m] + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_neg hbig_m] + have hnorm : normSeg 0 (m' + 1 - 4) = (0, (m' - 4) + 1) := by + dsimp only [normSeg]; rw [if_neg (by omega)]; congr 1; omega + rw [hnorm] + have hbc : IsBounce (k + 2 * z0 + 2) [c + z0, 25, 1] + ⟨true, (0, (m' - 4) + 1) :: rest, zl, k + 2 * z0 + 2, 0, + 2 * (k + 2 * z0) + 6, [c + z0, 25, 1]⟩ := by + have h := IsBounce.cons (z0 := 0) (m := m' - 4) (zl := zl) + (cp1 := k + 2 * z0 + 2) (kb := 0) (mrg := 2 * (k + 2 * z0) + 6) + (rest := rest) (ds := [c + z0, 25, 1]) hv_rest (by omega) + (by split_ifs <;> omega) + simpa only [Nat.add_zero] using h + exact exit_d1_leads (tx := 57) (tdw := 42) (txw := 0) + (by decide) (by decide) (by decide) (fun _ => by decide) + (Or.inr ⟨c + z0, k + 2 * z0 + 2, by omega, by omega, by omega, hbc⟩) + · -- General `26 <= d` (`SafeStack 39 [d, 1]`): + have hS : SafeStack 39 [d, 1] := safeStack_d1 (by omega) + have hox57 := ox_ge57_of_cz62 hc hk1 hkc hfz40 hcz62 hkz81 + have hadv := fbound_advances (ms := 39) (by decide) hS hvt (by omega) hk1 hkc + (by omega) (by omega) (by omega) (by omega) + exact chainAdvances_trans hadv + (fun _ hex _ => exit_d1_leads hd25 (by omega) (by omega) (fun h25 => False.elim (hd26 h25)) + hex) + +-- ============================================================================ +-- 3. `root1_advances` (`Root1 s -> ChainAdvances s RootInv`) +-- ============================================================================ + +theorem pop_47_25_1_leads {N phi : Nat} {s : SegState} + (hb : IsBounce phi [47, 25, 1] s) (hphi38 : 38 ≤ phi) : + ChainLeadsUpTo N s RootInv := by + have hg_pop : drainPopGuards phi [47, 25, 1] = true := by + change (true && true && true && decide (phi ≥ 16)) = true + rw [Bool.true_and, Bool.true_and, Bool.true_and] + exact decide_eq_true (by omega) + obtain ⟨hg_s, _, hp, m_rem, rest, zl, hv_rest, hzl_false, hstep⟩ := isBounce_step hb hg_pop + set p := pushSeg hp (phi + 2) m_rem rest zl + have hdp : drainPopStep hp phi m_rem rest zl [47, 25, 1] = + ⟨true, (0, 44) :: p.1, p.2, 24, 0, 50, [1]⟩ := rfl + have hvp : ValidSegs40 p.1 p.2 := + validSegs40_pushSeg hp (by omega) hv_rest (fun hf => by have := hzl_false hf; omega) + have hfp := fzOf_ge_40 hvp + apply chainLeadsUpTo_step hg_s + intro m1 _ + rw [hstep, hdp] + have hg2 : stepGuards ⟨true, (0, 44) :: p.1, p.2, 24, 0, 50, [1]⟩ = true := rfl + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs] + exact chainLeadsUpTo_here (rootInv_of_1 (validTail40_of_validSegs40 hvp) + (by decide) (by decide) (by decide) (by omega) (by omega) + (by intro h; omega) (fun _ => by omega)) + +theorem exit_47_25_1_leads {N tx tdw txw : Nat} {s : SegState} + (htx99 : 99 ≤ tx) (htdw38 : 38 ≤ tdw) + (hex : Exit tx tdw txw [47, 25, 1] s) : + ChainLeadsUpTo N s RootInv := by + rcases hex with ⟨phi, hphi, hb⟩ | ⟨y, phi, hy, hphi38, _, hb⟩ + · exact pop_47_25_1_leads hb (by omega) + · exact r9_pop_step hb hphi38 (by decide) (by omega) + (fun _ _ p1 p2 hvp _ => + bounce_d1_leads (isBounce_r9 (by decide) (by omega) hvp) (by decide) (by decide)) + +theorem x_47_25_1_high_leads {N x zl c k : Nat} {segs : List (Nat × Nat)} + (hx101 : 101 ≤ x) (hv : ValidSegs40 segs zl) + (hc : (170 ≤ c ∧ k = 1) ∨ (189 ≤ c ∧ 1 ≤ k ∧ k ≤ 2 * c + 3)) : + ChainLeadsUpTo N ⟨false, segs, zl, c, k, 0, [x, 47, 25, 1]⟩ RootInv := by + have hc170 : 170 ≤ c := by rcases hc with ⟨h, _⟩ | ⟨h, _⟩ <;> omega + have hk1 : 1 ≤ k := by rcases hc with ⟨_, h⟩ | ⟨_, h, _⟩ <;> omega + have hkc : k ≤ 2 * c + 3 := by rcases hc with ⟨_, rfl⟩ | ⟨_, _, h⟩ <;> omega + have hfz40 : 40 ≤ fzOf segs zl := fzOf_ge_40 hv + have hS47 : SafeStack 99 [47, 25, 1] := safeStack_47_25_1 + have hne1 : ([47, 25, 1] : List Nat) ≠ [1] := by intro h; cases h + rcases dec_or (105 ≤ x) with hx105 | hx104 + · exact chainLeadsUpTo_trans + ((excursion_bundle N).2 99 [47, 25, 1] segs zl c k x 101 0 + (by decide) hS47 (Or.inl hne1) hv + (by omega) hk1 hkc (by decide) (by omega) + (by omega) (by omega) (by omega) (by omega)) + (fun _ _ _ hex => exit_47_25_1_leads (by decide) (by decide) hex) + · have hox190 := ox_ge_of_c (by omega) hk1 hkc hfz40 + have hSx : SafeStack 19 [x, 47, 25, 1] := + safeStack_cons_ne1 hne1 hS47 (by omega) (by omega) + have hfb := (excursion_bundle N).1 19 [x, 47, 25, 1] segs zl c k (by decide) hSx + (validTail40_of_validSegs40 hv) (by omega) hk1 hkc (by omega) (by omega) (by omega) (by omega) + refine chainLeadsUpTo_trans hfb ?_ + intro m1 s_mid _ hex + rcases hex with ⟨phi, hphi, hb⟩ | ⟨y, phi, hy, hphi38, _, hb⟩ + · exact exit_47_25_1_leads (tx := 99) (tdw := 38) (txw := 0) (by decide) (by decide) + (Or.inr ⟨x, phi, by omega, by omega, by omega, hb⟩) + · exact amega_pop_step hb hphi38 (by omega) (by omega) + (hS47.2.2 (x - 1) (by omega)) (fun _ => hS47.2.2 (x - 2) (by omega)) + (fun hbig _ _ p1 p2 hvp _ => + pop_47_25_1_leads (isBounce_r9 (by omega) hbig hvp) (by omega)) + (fun _ _ m2 _ p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + have hox129 := ox_ge_of_c (c := x + 1) (k := y + 2) (fz := fzOf p1 p2) + (by omega) (by omega) (by omega) hfp + exact chainLeadsUpTo_trans + ((excursion_bundle m2).1 99 [47, 25, 1] p1 p2 (x + 1) (y + 2) + (by decide) hS47 (validTail40_of_validSegs40 hvp) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ _ _ hex2 => exit_47_25_1_leads (by omega) (by omega) hex2)) + (fun _ _ m2 _ p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + have hox208 := ox_ge_of_c (c := y) (k := 1) (fz := fzOf p1 p2) + (by omega) (by decide) (by omega) hfp + rcases dec_or (x = 101) with rfl | hx102 + · exact fbound_force_r9 (x := 100) (d3 := 47) (ds3 := [25, 1]) (by decide) + (hS47.2.2 100 (by decide)) (hS47.2.2 99 (by decide)) hvp + (by omega) (by decide) (by omega) (by omega) (by omega) + (fun _ phi2 _ hphi2 _ hb2 => + exit_47_25_1_leads (tx := 99) (tdw := 38) (txw := 0) (by decide) (by decide) + (Or.inr ⟨100, phi2, by decide, by omega, by omega, hb2⟩)) + (fun _ _ _ hb2 => pop_47_25_1_leads hb2 (by decide)) + · have hSx1 : SafeStack 19 [x - 1, 47, 25, 1] := + safeStack_cons_ne1 hne1 hS47 (by omega) (by omega) + have hfb2 := (excursion_bundle m2).1 19 [x - 1, 47, 25, 1] p1 p2 y 1 + (by decide) hSx1 (validTail40_of_validSegs40 hvp) + (by omega) (by decide) (by omega) (by omega) (by omega) (by omega) (by omega) + refine chainLeadsUpTo_trans hfb2 ?_ + intro m3 s_m2 _ hex2 + rcases hex2 with ⟨phi2, hphi2, hb2⟩ | ⟨y2, phi2, hy2, hphi2_38, _, hb2⟩ + · exact exit_47_25_1_leads (tx := 99) (tdw := 38) (txw := 0) (by decide) (by decide) + (Or.inr ⟨x - 1, phi2, by omega, by omega, by omega, hb2⟩) + · exact amega_pop_step hb2 hphi2_38 (by omega) (by omega) + (hS47.2.2 (x - 1 - 1) (by omega)) (fun _ => hS47.2.2 (x - 1 - 2) (by omega)) + (fun hbig _ _ q1 q2 hvq _ => + pop_47_25_1_leads (isBounce_r9 (by omega) hbig hvq) (by omega)) + (fun _ _ m4 _ q1 q2 hvq _ => by + have hfq := fzOf_ge_40 hvq + have hox129 := ox_ge_of_c (c := x - 1 + 1) (k := y2 + 2) (fz := fzOf q1 q2) + (by omega) (by omega) (by omega) hfq + exact chainLeadsUpTo_trans + ((excursion_bundle m4).1 99 [47, 25, 1] q1 q2 (x - 1 + 1) (y2 + 2) + (by decide) hS47 (validTail40_of_validSegs40 hvq) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ _ _ hex3 => exit_47_25_1_leads (by omega) (by omega) hex3)) + (fun _ _ _ _ q1 q2 hvq _ => by + have hfq := fzOf_ge_40 hvq + have hox224 := ox_ge_of_c (c := y2) (k := 1) (fz := fzOf q1 q2) + (by omega) (by decide) (by omega) hfq + exact fbound_force_r9 (x := x - 1 - 1) (d3 := 47) (ds3 := [25, 1]) (by omega) + (hS47.2.2 (x - 1 - 1) (by omega)) (hS47.2.2 (x - 1 - 1 - 1) (by omega)) hvq + (by omega) (by decide) (by omega) (by omega) (by omega) + (fun _ phi3 _ hphi3 _ hb3 => + exit_47_25_1_leads (tx := 99) (tdw := 38) (txw := 0) (by decide) (by decide) + (Or.inr ⟨x - 1 - 1, phi3, by omega, by omega, by omega, hb3⟩)) + (fun _ _ _ hb3 => pop_47_25_1_leads hb3 (by omega)))) + +theorem stack_47_25_1_leads {N zl c1 : Nat} {segs : List (Nat × Nat)} + (hv : ValidSegs40 segs zl) (hc1 : 6 ≤ c1) + (hcz102 : 102 ≤ c1 + fzOf segs zl) (hkz185 : 185 ≤ 1 + 2 * fzOf segs zl) : + ChainLeadsUpTo N ⟨false, segs, zl, c1, 1, 0, [47, 25, 1]⟩ RootInv := by + have hS47 : SafeStack 99 [47, 25, 1] := safeStack_47_25_1 + have hne1 : ([47, 25, 1] : List Nat) ≠ [1] := by intro h; cases h + rcases segs with _ | ⟨⟨z1, m1⟩, rest⟩ + · have := hv.2 + have hg : stepGuards ⟨false, [], zl, c1, 1, 0, [47, 25, 1]⟩ = true := by + dsimp only [stepGuards] + rw [goodPhiW_of_ge35 hS47.1 (by omega), Bool.true_and] + dsimp only [GoodPsi] + have hcz : c1 + zl - 1 + 1 = c1 + zl := by omega + rw [hcz]; exact hS47.2.2 (c1 + zl) (by omega) + apply chainLeadsUpTo_step1 hg + dsimp only [stepSegs] + have hbc : IsBounce (1 + 2 * zl + 2) [c1 + zl, 47, 25, 1] + ⟨true, [], 0, 1 + 2 * zl + 2, 0, 2 * (1 + 2 * zl) + 6, [c1 + zl, 47, 25, 1]⟩ := by + simpa only [Nat.add_zero] using IsBounce.nil (zl := 0) (cp1 := 1 + 2 * zl + 2) (kb := 0) + (mrg := 2 * (1 + 2 * zl) + 6) (ds := [c1 + zl, 47, 25, 1]) (by omega) + exact exit_47_25_1_leads (tx := 99) (tdw := 38) (txw := 0) (by decide) (by decide) + (Or.inr ⟨c1 + zl, 1 + 2 * zl + 2, by omega, by omega, by omega, hbc⟩) + · dsimp only [fzOf] at hcz102 hkz185 + have hv_rest : ValidSegs40 rest zl := validSegs40_tail hv + cases m1 with + | zero => + have hg1 : stepGuards ⟨false, (z1, 0) :: rest, zl, c1, 1, 0, [47, 25, 1]⟩ = true := rfl + apply chainLeadsUpTo_step hg1 + intro m_a _ + dsimp only [stepSegs] + rcases rest with _ | ⟨⟨z2, m2⟩, rest2⟩ + · have := hv_rest.2 + exact pop_47_25_1_leads (IsBounce.nil (by omega)) (by omega) + · have hz2_40 : 40 ≤ z2 := fzOf_ge_40 hv_rest + have hv_r2 : ValidSegs40 rest2 zl := validSegs40_tail hv_rest + have hfz2_40 : 40 ≤ fzOf rest2 zl := fzOf_ge_40 hv_r2 + cases m2 with + | zero => + have hg2 : stepGuards ⟨true, (z2, 0) :: rest2, zl, c1 + z1 + 3, 1 + 2 * z1 + 3, + 2 * (c1 + z1) + 8, [47, 25, 1]⟩ = true := by + dsimp only [stepGuards]; exact decide_eq_true (by omega) + apply chainLeadsUpTo_step hg2 + intro m_b _ + dsimp only [stepSegs] + have hox := ox_ge_of_c (c := c1 + z1 + 3 + z2 + 1) (k := 1 + 2 * z1 + 3 + 2 * z2 + 3) + (fz := fzOf rest2 zl) (by omega) (by omega) (by omega) hfz2_40 + exact chainLeadsUpTo_trans + ((excursion_bundle m_b).1 99 [47, 25, 1] rest2 zl (c1 + z1 + 3 + z2 + 1) + (1 + 2 * z1 + 3 + 2 * z2 + 3) (by decide) hS47 (validTail40_of_validSegs40 hv_r2) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ _ _ hex => exit_47_25_1_leads (by omega) (by omega) hex) + | succ m2' => + rcases dec_or ((m2' + 1) % 2 = 1) with hm2_od | hm2_ev + · cases hd_mrg : decide (2 * (c1 + z1) + 8 ≥ (1 + 2 * z1 + 3) + m2') with + | true => + have hg2 : stepGuards ⟨true, (z2, m2' + 1) :: rest2, zl, c1 + z1 + 3, + 1 + 2 * z1 + 3, 2 * (c1 + z1) + 8, [47, 25, 1]⟩ = true := by + dsimp only [stepGuards]; rw [if_pos hm2_od, hd_mrg, if_pos rfl] + exact hS47.2.2 (c1 + z1 + 3 + z2) (by omega) + apply chainLeadsUpTo_step hg2 + intro m_b _ + dsimp only [stepSegs]; rw [if_pos hm2_od, hd_mrg, if_pos rfl] + exact x_47_25_1_high_leads (by omega) hv_r2 (Or.inl ⟨by omega, rfl⟩) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact pop_47_25_1_leads + (IsBounce.cons hv_r2 (by omega) (by rw [if_pos hm2_od]; omega)) (by omega) + · cases hd_mrg : decide (2 * (c1 + z1) + 8 ≥ (1 + 2 * z1 + 3) + (m2' + 1)) with + | true => + have h_mrg := of_decide_eq_true hd_mrg + have hg2 : stepGuards ⟨true, (z2, m2' + 1) :: rest2, zl, c1 + z1 + 3, + 1 + 2 * z1 + 3, 2 * (c1 + z1) + 8, [47, 25, 1]⟩ = true := by + dsimp only [stepGuards]; rw [if_neg hm2_ev, hd_mrg, if_pos rfl] + apply chainLeadsUpTo_step hg2 + intro m_b _ + dsimp only [stepSegs]; rw [if_neg hm2_ev, hd_mrg, if_pos rfl] + have hox := ox_ge_of_c (c := c1 + z1 + 3 + z2 + 2) + (k := (1 + 2 * z1 + 3) + (m2' + 1) + 2 * z2 + 5) + (fz := fzOf rest2 zl) (by omega) (by omega) (by omega) hfz2_40 + exact chainLeadsUpTo_trans + ((excursion_bundle m_b).1 99 [47, 25, 1] rest2 zl (c1 + z1 + 3 + z2 + 2) + ((1 + 2 * z1 + 3) + (m2' + 1) + 2 * z2 + 5) + (by decide) hS47 (validTail40_of_validSegs40 hv_r2) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ _ _ hex => exit_47_25_1_leads (by omega) (by omega) hex) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact pop_47_25_1_leads + (IsBounce.cons hv_r2 (by omega) (by rw [if_neg hm2_ev]; omega)) (by omega) + | succ m' => + have hfz1_40 : 40 ≤ fzOf rest zl := fzOf_ge_40 hv_rest + have hphiw : GoodPhiW (c1 + z1 - 1) [47, 25, 1] false = true := + goodPhiW_of_ge35 hS47.1 (by omega) + rcases dec_or (m' + 1 = 1) with hm1 | hm_gt1 + · have hm0_eq : m' = 0 := by omega + subst hm0_eq + have hg : stepGuards ⟨false, (z1, 1) :: rest, zl, c1, 1, 0, [47, 25, 1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c1 + z1 - 1) [47, 25, 1] false && + if 1 = 1 then GoodPsi (c1 + z1) [47, 25, 1] else _) = true + rw [hphiw, Bool.true_and, if_pos rfl] + exact hS47.2.2 (c1 + z1 + 1) (by omega) + apply chainLeadsUpTo_step hg + intro m_a _ + dsimp only [stepSegs] + change ChainLeadsUpTo m_a (if 1 = 1 then _ else _) _ + rw [if_pos rfl] + exact x_47_25_1_high_leads (by omega) hv_rest (Or.inl ⟨by omega, rfl⟩) + · have hpsi_cz : GoodPsi (c1 + z1 - 1) [47, 25, 1] = true := by + dsimp only [GoodPsi] + have hcz_eq : c1 + z1 - 1 + 1 = c1 + z1 := by omega + rw [hcz_eq]; exact hS47.2.2 (c1 + z1) (by omega) + rcases dec_or ((m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 10) with hev_sm | hnot_ev + · have hg : stepGuards ⟨false, (z1, m' + 1) :: rest, zl, c1, 1, 0, [47, 25, 1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c1 + z1 - 1) [47, 25, 1] false && + if m' + 1 = 1 then _ else GoodPsi (c1 + z1 - 1) [47, 25, 1] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 10 then true else _) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, if_pos hev_sm] + apply chainLeadsUpTo_step hg + intro m_a _ + dsimp only [stepSegs] + change ChainLeadsUpTo m_a (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 10 then _ else _) _ + rw [if_neg hm_gt1, if_pos hev_sm] + exact x_47_25_1_high_leads (by omega) hv_rest (Or.inr ⟨by omega, by omega, by omega⟩) + · rcases dec_or ((m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 11) with hod_sm | hbig_m + · have hS_cz : SafeStack 19 [c1 + z1, 47, 25, 1] := + safeStack_cons_ne1 hne1 hS47 (by omega) (by omega) + have hg : stepGuards ⟨false, (z1, m' + 1) :: rest, zl, c1, 1, 0, [47, 25, 1]⟩ = true := + by + dsimp only [stepGuards] + change (GoodPhiW (c1 + z1 - 1) [47, 25, 1] false && + if m' + 1 = 1 then _ else GoodPsi (c1 + z1 - 1) [47, 25, 1] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 11 then + GoodDs ((1 + 2 * z1 + 2) :: (c1 + z1) :: [47, 25, 1]) else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_pos hod_sm] + exact hS_cz.2.2 (1 + 2 * z1 + 2) (by omega) + apply chainLeadsUpTo_step hg + intro m_a _ + dsimp only [stepSegs] + change ChainLeadsUpTo m_a (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_pos hod_sm] + have hm_sub : m' + 1 - 1 = m' := by omega + rw [hm_sub] + have hne1_cz : ([c1 + z1, 47, 25, 1] : List Nat) ≠ [1] := by + intro h; injection h with _ h2; cases h2 + have hlb := (excursion_bundle m_a).2 19 [c1 + z1, 47, 25, 1] rest zl m' 1 + (1 + 2 * z1 + 2) 170 0 (by decide) hS_cz (Or.inl hne1_cz) hv_rest + (by omega) (by decide) (by omega) (by decide) (by omega) + (by omega) (by omega) (by omega) (by omega) + refine chainLeadsUpTo_trans hlb ?_ + intro m_b s_mid _ hex + rcases hex with ⟨phi, hphi, hb⟩ | ⟨y, phi, hy, hphi38, _, hb⟩ + · exact exit_47_25_1_leads (tx := 99) (tdw := 38) (txw := 0) (by decide) (by decide) + (Or.inr ⟨c1 + z1, phi, by omega, by omega, by omega, hb⟩) + · exact amega_pop_step hb hphi38 (by omega) (by omega) + (hS47.2.2 (c1 + z1 - 1) (by omega)) + (fun _ => hS47.2.2 (c1 + z1 - 2) (by omega)) + (fun hbig _ _ p1 p2 hvp _ => + pop_47_25_1_leads (isBounce_r9 (by omega) hbig hvp) (by omega)) + (fun _ _ m_c _ p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + have hox := ox_ge_of_c (c := c1 + z1 + 1) (k := y + 2) (fz := fzOf p1 p2) + (by omega) (by omega) (by omega) hfp + exact chainLeadsUpTo_trans + ((excursion_bundle m_c).1 99 [47, 25, 1] p1 p2 (c1 + z1 + 1) (y + 2) + (by decide) hS47 (validTail40_of_validSegs40 hvp) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ _ _ hex2 => exit_47_25_1_leads (by omega) (by omega) hex2)) + (fun _ _ _ _ p1 p2 hvp _ => + x_47_25_1_high_leads (by omega) hvp (Or.inl ⟨by omega, rfl⟩)) + · have hg : stepGuards ⟨false, (z1, m' + 1) :: rest, zl, c1, 1, 0, [47, 25, 1]⟩ = true := + by + dsimp only [stepGuards] + change (GoodPhiW (c1 + z1 - 1) [47, 25, 1] false && + if m' + 1 = 1 then _ else GoodPsi (c1 + z1 - 1) [47, 25, 1] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 11 then _ else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_neg hbig_m] + apply chainLeadsUpTo_step1 hg + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (1 + 2 * z1) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_neg hbig_m] + have hnorm : normSeg 0 (m' + 1 - 4) = (0, (m' - 4) + 1) := by + dsimp only [normSeg]; rw [if_neg (by omega)]; congr 1; omega + rw [hnorm] + have hbc : IsBounce (1 + 2 * z1 + 2) [c1 + z1, 47, 25, 1] + ⟨true, (0, (m' - 4) + 1) :: rest, zl, 1 + 2 * z1 + 2, 0, + 2 * (1 + 2 * z1) + 6, [c1 + z1, 47, 25, 1]⟩ := by + have h := IsBounce.cons (z0 := 0) (m := m' - 4) (zl := zl) + (cp1 := 1 + 2 * z1 + 2) (kb := 0) (mrg := 2 * (1 + 2 * z1) + 6) + (rest := rest) (ds := [c1 + z1, 47, 25, 1]) hv_rest (by omega) + (by split_ifs <;> omega) + simpa only [Nat.add_zero] using h + exact exit_47_25_1_leads (tx := 99) (tdw := 38) (txw := 0) (by decide) (by decide) + (Or.inr ⟨c1 + z1, 1 + 2 * z1 + 2, by omega, by omega, by omega, hbc⟩) + +theorem root1_advances {s : SegState} (hb0 : s.b = false) (hm0_z : s.mrg = 0) (hr : Root1 s) : + ChainAdvances s RootInv := by + rcases s with ⟨b, segs, zl, c, k, mrg, ds⟩ + dsimp only at hb0 hm0_z + subst hb0 hm0_z + obtain ⟨hds, hvt, hc5, hk1, hkc, hfz20, hkz45, h25, h26⟩ := hr + dsimp only at hds hvt hc5 hk1 hkc hfz20 hkz45 h25 h26 + subst hds + have hS1 : SafeStack 25 [1] := safeStack_one + rcases dec_or (c + fzOf segs zl = 25) with hcz25 | hcz_ne25 + · obtain ⟨m0, rest, hseg, rfl, rfl, hm0_6, hm0_odd⟩ := h25 hcz25 + subst hseg + dsimp only [ValidTail40] at hvt + obtain ⟨m', rfl⟩ : ∃ m', m0 = m' + 1 := ⟨m0 - 1, by omega⟩ + have hm_gt1 : ¬(m' + 1 = 1) := by omega + have hphiw : GoodPhiW (5 + 20 - 1) [1] false = true := rfl + have hpsi_cz : GoodPsi (5 + 20 - 1) [1] = true := rfl + rcases dec_or ((m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (5 + 2 * 20) + 10) with hev_sm | hnot_ev + · have hg : stepGuards ⟨false, (20, m' + 1) :: rest, zl, 5, 5, 0, [1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (5 + 20 - 1) [1] false && + if m' + 1 = 1 then _ else GoodPsi (5 + 20 - 1) [1] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (5 + 2 * 20) + 10 then true else _) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, if_pos hev_sm] + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (5 + 2 * 20) + 10 then _ else _) _ + rw [if_neg hm_gt1, if_pos hev_sm] + have hfz1_40 : 40 ≤ fzOf rest zl := fzOf_ge_40 hvt + have hox := ox_ge_of_c (c := 5 + 2 * 20 + 4) (k := m' + 2) (fz := fzOf rest zl) + (by decide) (by omega) (by omega) hfz1_40 + exact chainLeadsUpTo_trans + ((excursion_bundle N).1 55 [25, 1] rest zl (5 + 2 * 20 + 4) (m' + 2) + (by decide) safeStack_25_1 (validTail40_of_validSegs40 hvt) + (by decide) (by omega) (by omega) (by omega) (by omega) (by omega) (by omega)) + (fun _ _ _ hex => exit_d1_leads (by decide) (by omega) (by omega) (fun _ => by omega) hex) + · rcases dec_or ((m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (5 + 2 * 20) + 11) with hod_sm | hbig_m + · have hg : stepGuards ⟨false, (20, m' + 1) :: rest, zl, 5, 5, 0, [1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (5 + 20 - 1) [1] false && + if m' + 1 = 1 then _ else GoodPsi (5 + 20 - 1) [1] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (5 + 2 * 20) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (5 + 2 * 20) + 11 then + GoodDs [47, 25, 1] else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_pos hod_sm] + rfl + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (5 + 2 * 20) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (5 + 2 * 20) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_pos hod_sm] + have hm_sub : m' + 1 - 1 = m' := by omega + rw [hm_sub] + obtain ⟨h102, h185⟩ := hm0_odd hod_sm.1 + rw [hm_sub] at h102 + exact stack_47_25_1_leads hvt (by omega) h102 h185 + · have hg : stepGuards ⟨false, (20, m' + 1) :: rest, zl, 5, 5, 0, [1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (5 + 20 - 1) [1] false && + if m' + 1 = 1 then _ else GoodPsi (5 + 20 - 1) [1] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (5 + 2 * 20) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (5 + 2 * 20) + 11 then _ else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_neg hbig_m] + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (5 + 2 * 20) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (5 + 2 * 20) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_neg hbig_m] + have hnorm : normSeg 0 (m' + 1 - 4) = (0, (m' - 4) + 1) := by + dsimp only [normSeg]; rw [if_neg (by omega)]; congr 1; omega + rw [hnorm] + have hbc : IsBounce 47 [25, 1] + ⟨true, (0, (m' - 4) + 1) :: rest, zl, 47, 0, 96, [25, 1]⟩ := by + have h := IsBounce.cons (z0 := 0) (m := m' - 4) (zl := zl) + (cp1 := 47) (kb := 0) (mrg := 96) + (rest := rest) (ds := [25, 1]) hvt (by decide) + (by split_ifs <;> omega) + simpa only [Nat.add_zero] using h + exact bounce_d1_leads hbc (by decide) (by decide) + · -- `26 <= c + fz`: + have hcz26 : 26 ≤ c + fzOf segs zl := by omega + have hkz47 : 47 ≤ k + 2 * fzOf segs zl := h26 hcz26 + rcases segs with _ | ⟨⟨z0, m0⟩, rest⟩ + · dsimp only [fzOf, ValidTail40] at hvt hfz20 hcz26 hkz47 + have hg : stepGuards ⟨false, [], zl, c, k, 0, [1]⟩ = true := by + dsimp only [stepGuards] + have hpw : GoodPhiW (c + zl - 1) [1] false = true := by + dsimp only [GoodPhiW]; rw [if_neg (by decide), if_neg (by decide), if_pos rfl] + exact decide_eq_true (by omega) + rw [hpw, Bool.true_and] + dsimp only [GoodPsi] + have hcz : c + zl - 1 + 1 = c + zl := by omega + rw [hcz]; exact hS1.2.2 (c + zl) (by omega) + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + have hbc : IsBounce (k + 2 * zl + 2) [c + zl, 1] + ⟨true, [], 0, k + 2 * zl + 2, 0, 2 * (k + 2 * zl) + 6, [c + zl, 1]⟩ := by + simpa only [Nat.add_zero] using IsBounce.nil (zl := 0) (cp1 := k + 2 * zl + 2) (kb := 0) + (mrg := 2 * (k + 2 * zl) + 6) (ds := [c + zl, 1]) (by omega) + exact bounce_d1_leads hbc (by omega) (by omega) + · dsimp only [fzOf, ValidTail40] at hvt hfz20 hcz26 hkz47 + have hv_rest : ValidSegs40 rest zl := hvt + cases m0 with + | zero => + refine ⟨rfl, fun N => ?_⟩ + dsimp only [stepSegs] + rcases rest with _ | ⟨⟨z1, m1_seg⟩, rest2⟩ + · have := hv_rest.2 + exact bounce_one_leads (IsBounce.nil (by omega)) (by omega) + · have hz1_40 : 40 ≤ z1 := fzOf_ge_40 hv_rest + have hv_r2 : ValidSegs40 rest2 zl := validSegs40_tail hv_rest + have hfz2_40 : 40 ≤ fzOf rest2 zl := fzOf_ge_40 hv_r2 + cases m1_seg with + | zero => + have hg2 : stepGuards ⟨true, (z1, 0) :: rest2, zl, c + z0 + 3, k + 2 * z0 + 3, + 2 * (c + z0) + 8, [1]⟩ = true := by + dsimp only [stepGuards]; exact decide_eq_true (by omega) + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs] + exact chainLeadsUpTo_here (rootInv_of_1 (validTail40_of_validSegs40 hv_r2) + (by omega) (by omega) (by omega) (by omega) (by omega) + (by intro h; omega) (fun _ => by omega)) + | succ m1' => + rcases dec_or ((m1' + 1) % 2 = 1) with hm1_od | hm1_ev + · cases hd_mrg : decide (2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + m1') with + | true => + have hg2 : stepGuards ⟨true, (z1, m1' + 1) :: rest2, zl, c + z0 + 3, + k + 2 * z0 + 3, 2 * (c + z0) + 8, [1]⟩ = true := by + dsimp only [stepGuards]; rw [if_pos hm1_od, hd_mrg, if_pos rfl] + exact hS1.2.2 (c + z0 + 3 + z1) (by omega) + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs]; rw [if_pos hm1_od, hd_mrg, if_pos rfl] + exact chainLeadsUpTo_here (rootInv_of_D1 (by omega) + (validTail40_of_validSegs40 hv_r2) + (by omega) (by decide) (by omega) (by omega) (by omega) (by omega)) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact bounce_one_leads + (IsBounce.cons hv_r2 (by omega) (by rw [if_pos hm1_od]; omega)) (by omega) + · cases hd_mrg : decide (2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + (m1' + 1)) with + | true => + have h_mrg := of_decide_eq_true hd_mrg + have hg2 : stepGuards ⟨true, (z1, m1' + 1) :: rest2, zl, c + z0 + 3, + k + 2 * z0 + 3, 2 * (c + z0) + 8, [1]⟩ = true := by + dsimp only [stepGuards]; rw [if_neg hm1_ev, hd_mrg, if_pos rfl] + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs]; rw [if_neg hm1_ev, hd_mrg, if_pos rfl] + exact chainLeadsUpTo_here (rootInv_of_1 (validTail40_of_validSegs40 hv_r2) + (by omega) (by omega) (by omega) (by omega) (by omega) + (by intro h; omega) (fun _ => by omega)) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact bounce_one_leads + (IsBounce.cons hv_r2 (by omega) (by rw [if_neg hm1_ev]; omega)) (by omega) + | succ m' => + have hfz1_40 : 40 ≤ fzOf rest zl := fzOf_ge_40 hv_rest + have hphiw : GoodPhiW (c + z0 - 1) [1] false = true := by + dsimp only [GoodPhiW]; rw [if_neg (by decide), if_neg (by decide), if_pos rfl] + exact decide_eq_true (by omega) + rcases dec_or (m' + 1 = 1) with hm1 | hm_gt1 + · have hm0_eq : m' = 0 := by omega + subst hm0_eq + have hg : stepGuards ⟨false, (z0, 1) :: rest, zl, c, k, 0, [1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) [1] false && + if 1 = 1 then GoodPsi (c + z0) [1] else _) = true + rw [hphiw, Bool.true_and, if_pos rfl] + exact hS1.2.2 (c + z0 + 1) (by omega) + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if 1 = 1 then _ else _) _ + rw [if_pos rfl] + exact chainLeadsUpTo_here (rootInv_of_D1 (by omega) + (validTail40_of_validSegs40 hv_rest) + (by omega) (by decide) (by omega) (by omega) (by omega) (by omega)) + · have hpsi_cz : GoodPsi (c + z0 - 1) [1] = true := by + dsimp only [GoodPsi] + have hcz_eq : c + z0 - 1 + 1 = c + z0 := by omega + rw [hcz_eq]; exact hS1.2.2 (c + z0) (by omega) + rcases dec_or ((m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10) with hev_sm | hnot_ev + · have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, [1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) [1] false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) [1] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else _) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, if_pos hev_sm] + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else _) _ + rw [if_neg hm_gt1, if_pos hev_sm] + exact chainLeadsUpTo_here (rootInv_of_D1 (by omega) + (validTail40_of_validSegs40 hv_rest) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega)) + · rcases dec_or ((m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11) with hod_sm | hbig_m + · have hS_cz : SafeStack 39 [c + z0, 1] := safeStack_d1 hcz26 + have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, [1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) [1] false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) [1] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then + GoodDs ((k + 2 * z0 + 2) :: (c + z0) :: [1]) else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_pos hod_sm] + exact hS_cz.2.2 (k + 2 * z0 + 2) (by omega) + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_pos hod_sm] + have hm_sub : m' + 1 - 1 = m' := by omega + rw [hm_sub] + have hne1_cz : ([c + z0, 1] : List Nat) ≠ [1] := by + intro h; injection h with _ h2; cases h2 + exact chainLeadsUpTo_trans + ((excursion_bundle N).2 39 [c + z0, 1] rest zl m' 1 + (k + 2 * z0 + 2) 43 0 (by decide) hS_cz (Or.inl hne1_cz) hv_rest + (by omega) (by decide) (by omega) (by decide) (by omega) + (by omega) (by omega) (by omega) (by omega)) + (fun _ _ _ hex => exit_d1_leads (by omega) (by decide) (by decide) + (fun h25 => False.elim (by omega)) hex) + · have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, [1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) [1] false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) [1] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_neg hbig_m] + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_neg hbig_m] + have hnorm : normSeg 0 (m' + 1 - 4) = (0, (m' - 4) + 1) := by + dsimp only [normSeg]; rw [if_neg (by omega)]; congr 1; omega + rw [hnorm] + have hbc : IsBounce (k + 2 * z0 + 2) [c + z0, 1] + ⟨true, (0, (m' - 4) + 1) :: rest, zl, k + 2 * z0 + 2, 0, + 2 * (k + 2 * z0) + 6, [c + z0, 1]⟩ := by + have h := IsBounce.cons (z0 := 0) (m := m' - 4) (zl := zl) + (cp1 := k + 2 * z0 + 2) (kb := 0) (mrg := 2 * (k + 2 * z0) + 6) + (rest := rest) (ds := [c + z0, 1]) hv_rest (by omega) + (by split_ifs <;> omega) + simpa only [Nat.add_zero] using h + exact bounce_d1_leads hbc (by omega) (by omega) + + +-- ============================================================================ +-- Section 5g.3d: Root31, Root0, Global Root Advancement, and `inv_s0` +-- ============================================================================ + +theorem goodPhiW_31 {w : Nat} (hw : 15 ≤ w) : GoodPhiW w [3, 1] false = true := by + dsimp only [GoodPhiW] + rw [if_neg (by intro h; injection h with _ h2; cases h2), + if_neg (by intro h; injection h with _ h2; cases h2), + if_neg (by intro h; injection h with _ h2; cases h2), + if_neg (by intro h; cases h)] + change (if decide (3 ≥ 25) = true then _ else if false = true then _ else decide (w ≥ 15)) = true + rw [if_neg (by decide), if_neg Bool.false_ne_true] + exact decide_eq_true hw + +theorem bounce_19_31_leads {N phi : Nat} {s : SegState} + (hb : IsBounce phi [19, 3, 1] s) (hphi38 : 38 ≤ phi) : + ChainLeadsUpTo N s RootInv := by + have hg_pop : drainPopGuards phi [19, 3, 1] = true := by + have hnrst : isDrainRstDs [19, 3, 1] = false := rfl + have hnr0 : isRank0 [19, 3, 1] = false := rfl + dsimp only [drainPopGuards] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true] + have hc4 : decide (phi ≥ 16) = true := decide_eq_true (by omega) + rw [hc4]; rfl + obtain ⟨hg_s, _, hp, m_rem, rest, zl, hv_rest, hzl_false, hstep⟩ := isBounce_step hb hg_pop + set p := pushSeg hp (phi + 2) m_rem rest zl + have hdp : drainPopStep hp phi m_rem rest zl [19, 3, 1] = + ⟨true, (0, 16) :: p.1, p.2, 2, 0, 6, [1]⟩ := rfl + rw [hdp] at hstep + have hvp : ValidSegs40 p.1 p.2 := + validSegs40_pushSeg hp (by omega) hv_rest (fun hf => by have := hzl_false hf; omega) + apply chainLeadsUpTo_step hg_s + intro m1 _ + rw [hstep] + have hg_b1 : stepGuards ⟨true, (0, 16) :: p.1, p.2, 2, 0, 6, [1]⟩ = true := rfl + have hs_b1 : stepSegs ⟨true, (0, 16) :: p.1, p.2, 2, 0, 6, [1]⟩ = + ⟨true, (5, 8) :: p.1, p.2, 2, 0, 6, []⟩ := rfl + apply chainLeadsUpTo_step hg_b1 + intro m2 _ + rw [hs_b1] + have hg_b2 : stepGuards ⟨true, (5, 8) :: p.1, p.2, 2, 0, 6, []⟩ = true := rfl + have hs_b2 : stepSegs ⟨true, (5, 8) :: p.1, p.2, 2, 0, 6, []⟩ = + ⟨false, (9, 0) :: p.1, p.2, 1, 1, 0, []⟩ := rfl + apply chainLeadsUpTo_step1 hg_b2 + rw [hs_b2] + exact chainLeadsUpTo_here (rootInv_of_0B (Or.inl rfl) hvp + (by decide) (by decide) (by decide) (by dsimp only [fzOf]; omega) (by dsimp only [fzOf]; omega) + (by intro h; dsimp only [fzOf] at h; omega) (fun _ => Or.inl ⟨rfl, rfl⟩) + (by intro _ _ _ _ hcz9; dsimp only [fzOf] at hcz9; omega)) + +theorem bounce_cz_31_even_extra {N cz phi : Nat} {s : SegState} + (hb : IsBounce phi [cz, 3, 1] s) + (hcases : (22 ≤ cz ∧ cz % 2 = 0 ∧ 49 ≤ phi) ∨ + (26 ≤ cz ∧ cz % 2 = 0 ∧ 45 ≤ phi)) : + ChainLeadsUpTo N s RootInv := by + have hcz22 : 22 ≤ cz := by rcases hcases with ⟨h, _⟩ | ⟨h, _⟩ <;> omega + have hphi45 : 45 ≤ phi := by rcases hcases with ⟨_, _, h⟩ | ⟨_, _, h⟩ <;> omega + have hnrst : isDrainRstDs [cz, 3, 1] = false := rfl + have hnr0 : isRank0 [cz, 3, 1] = false := by + rcases cz with _ | _ | _ | _ <;> try omega + rfl + have hg_pop : drainPopGuards phi [cz, 3, 1] = true := by + dsimp only [drainPopGuards] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true] + have hc1 : decide (cz ≥ 3 ∧ 3 ≥ 1) = true := decide_eq_true (by omega) + have hc2 : decide (cz % 2 = 0 ∧ cz ≤ 2 * 3 + 4) = false := decide_eq_false (by omega) + have hc3 : decide (cz % 2 = 0 ∧ cz + 14 ≤ 2 * 3) = false := decide_eq_false (by omega) + have hc4 : decide (phi ≥ 16) = true := decide_eq_true (by omega) + rw [hc1, hc2, hc3, hc4]; rfl + obtain ⟨hg_s, _, hp, m_rem, rest, zl, hv_rest, hzl_false, hstep⟩ := isBounce_step hb hg_pop + set p := pushSeg hp (phi + 2) m_rem rest zl + have hdp : drainPopStep hp phi m_rem rest zl [cz, 3, 1] = + ⟨true, (0, cz - 3) :: p.1, p.2, 2, 0, 6, [1]⟩ := by + dsimp only [drainPopStep] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true, + if_neg (by rintro ⟨h31, _, _⟩; cases h31)] + have hnorm : normSeg 0 (cz - 3) = (0, cz - 3) := by + dsimp only [normSeg]; rw [if_neg (by omega)] + rw [hnorm] + rw [hdp] at hstep + have hvp : ValidSegs40 p.1 p.2 := + validSegs40_pushSeg hp (by omega) hv_rest (fun hf => by have := hzl_false hf; omega) + have hfzp : phi + 2 ≤ fzOf p.1 p.2 := fzOf_pushSeg_ge hp (phi + 2) m_rem rest zl + apply chainLeadsUpTo_step hg_s + intro m1 _ + rw [hstep] + have hg_b1 : stepGuards ⟨true, (0, cz - 3) :: p.1, p.2, 2, 0, 6, [1]⟩ = true := by + have hsub : cz - 3 = (cz - 4) + 1 := by omega + rw [hsub]; dsimp only [stepGuards] + rcases dec_or (((cz - 4) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega)]; rfl + · rw [if_neg hev, decide_eq_false (by omega)]; rfl + have hs_b1 : stepSegs ⟨true, (0, cz - 3) :: p.1, p.2, 2, 0, 6, [1]⟩ = + ⟨true, (5, cz - 11) :: p.1, p.2, 2, 0, 6, []⟩ := by + have hsub : cz - 3 = (cz - 4) + 1 := by omega + have hm_eq : 0 + ((cz - 4) + 1) - (6 + 2) = (cz - 12) + 1 := by omega + have h11 : cz - 11 = (cz - 12) + 1 := by omega + rw [hsub, h11]; dsimp only [stepSegs] + rcases dec_or (((cz - 4) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega), hm_eq]; rfl + · rw [if_neg hev, decide_eq_false (by omega), hm_eq]; rfl + apply chainLeadsUpTo_step hg_b1 + intro m2 _ + rw [hs_b1] + have hg_b2 : stepGuards ⟨true, (5, cz - 11) :: p.1, p.2, 2, 0, 6, []⟩ = true := by + have hsub : cz - 11 = (cz - 12) + 1 := by omega + rw [hsub]; dsimp only [stepGuards] + rcases dec_or (((cz - 12) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega)]; rfl + · rw [if_neg hev, decide_eq_false (by omega)]; rfl + have hs_b2 : stepSegs ⟨true, (5, cz - 11) :: p.1, p.2, 2, 0, 6, []⟩ = + ⟨false, (8, cz - 19) :: p.1, p.2, 1, 1, 0, []⟩ := by + have hsub : cz - 11 = (cz - 12) + 1 := by omega + have hm_eq : 0 + ((cz - 12) + 1) - (6 + 2) = (cz - 20) + 1 := by omega + have h19 : cz - 19 = (cz - 20) + 1 := by omega + rw [hsub, h19]; dsimp only [stepSegs] + rcases dec_or (((cz - 12) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega), hm_eq]; rfl + · rw [if_neg hev, decide_eq_false (by omega), hm_eq]; rfl + apply chainLeadsUpTo_step1 hg_b2 + rw [hs_b2] + apply chainLeadsUpTo_here + refine rootInv_of_0B (Or.inl rfl) hvp + (by decide) (by decide) (by decide) (by dsimp only [fzOf]; omega) (by dsimp only [fzOf]; omega) + (by intro h; cases h) (fun _ => Or.inl ⟨rfl, rfl⟩) ?_ + intro z0 m0 r hseg _ _ _ + injection hseg with hhd htl + injection hhd with hz0 hm0 + subst hz0 hm0 htl + rcases hcases with ⟨_, _, hphi49⟩ | ⟨hcz26, hcz_ev, _⟩ + · exact ⟨by omega, by omega, fun hlt => False.elim (by omega)⟩ + · exact ⟨by omega, by omega, fun hlt => by omega⟩ + +theorem bounce_cz_31_ge25_leads {N cz phi : Nat} {s : SegState} + (hb : IsBounce phi [cz, 3, 1] s) (hcz25 : 25 ≤ cz) (hphi45 : 45 ≤ phi) : + ChainLeadsUpTo N s RootInv := by + rcases dec_or (cz % 2 = 1) with hod | hev + · exact bounce_cz_31_leads hb (Or.inr (Or.inl ⟨by omega, hod, by omega⟩)) + · exact bounce_cz_31_even_extra hb (Or.inr ⟨by omega, by omega, hphi45⟩) + +theorem x_31_high_aux (d : Nat) : + ∀ N x segs zl c k, + 23 ≤ x → x - 23 ≤ d → + ValidSegs40 segs zl → + 40 ≤ c → 1 ≤ k → k ≤ 2 * c + 3 → + ChainLeadsUpTo N ⟨false, segs, zl, c, k, 0, [x, 3, 1]⟩ RootInv := by + induction d with + | zero => + intro N x segs zl c k hx23 hxd hv hc40 hk1 hkc + have hx_eq : x = 23 := by omega + subst hx_eq + have hfz40 : 40 ≤ fzOf segs zl := fzOf_ge_40 hv + obtain ⟨hox, hodw⟩ := ox_ge_of_c (by omega) hk1 hkc hfz40 + have hS : SafeStack 19 [23, 3, 1] := + safeStack_cons_ne1 (by decide) safeStack_31 (by decide) (by decide) + have hfb := (excursion_bundle N).1 19 [23, 3, 1] segs zl c k (by decide) hS + (validTail40_of_validSegs40 hv) (by omega) hk1 hkc + (by omega) (by omega) (by omega) (by omega) + refine chainLeadsUpTo_trans hfb ?_ + intro m1 s_mid hm1 hex + rcases hex with ⟨phi, hphi, hb⟩ | ⟨y, phi, hy, hphi38, _, hb⟩ + · exact bounce_cz_31_leads hb (Or.inr (Or.inl ⟨by decide, by decide, by omega⟩)) + · exact r9_pop_step hb hphi38 (by decide) (by omega) + (fun m2 _ p1 p2 hvp _ => bounce_31_leads (isBounce_r9 (by decide) (by omega) hvp) (by + decide)) + | succ d ih => + intro N x segs zl c k hx23 hxd hv hc40 hk1 hkc + have hfz40 : 40 ≤ fzOf segs zl := fzOf_ge_40 hv + obtain ⟨hox, hodw⟩ := ox_ge_of_c (by omega) hk1 hkc hfz40 + have hS : SafeStack 19 [x, 3, 1] := + safeStack_cons_ne1 (by decide) safeStack_31 (by omega) (by omega) + have hfb := (excursion_bundle N).1 19 [x, 3, 1] segs zl c k (by decide) hS + (validTail40_of_validSegs40 hv) (by omega) hk1 hkc + (by omega) (by omega) (by omega) (by omega) + refine chainLeadsUpTo_trans hfb ?_ + intro m1 s_mid hm1 hex + rcases hex with ⟨phi, hphi, hb⟩ | ⟨y, phi, hy, hphi38, _, hb⟩ + · rcases dec_or (x % 2 = 1) with hod | hev + · exact bounce_cz_31_leads hb (Or.inr (Or.inl ⟨by omega, hod, by omega⟩)) + · exact bounce_cz_31_even_extra hb (Or.inl ⟨by omega, by omega, by omega⟩) + · exact amega_pop_step hb hphi38 (by omega) (by omega) + (safeStack_31.2.2 (x - 1) (by omega)) + (fun _ => safeStack_31.2.2 (x - 2) (by omega)) + (fun hbig _ _ p1 p2 hvp _ => + bounce_31_leads (isBounce_r9 (by omega) hbig hvp) (by omega)) + (fun hy_le _ _ _ p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + refine chainLeadsUpTo_here (rootInv_of_31B rfl (validTail40_of_validSegs40 hvp) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) ?_) + intro z0 m0 r hseg _ _ _ + have hz0 : fzOf p1 p2 = z0 := by rw [hseg]; rfl + exact Or.inr (by omega)) + (fun hy_le _ m2 _ p1 p2 hvp _ => + ih m2 (x - 1) p1 p2 y 1 (by omega) (by omega) hvp (by omega) (by decide) (by omega)) + +theorem x_31_high_leads {N x : Nat} {segs : List (Nat × Nat)} {zl c k : Nat} + (hx20 : 20 ≤ x) (hv : ValidSegs40 segs zl) + (hc40 : 40 ≤ c) (hk1 : 1 ≤ k) (hkc : k ≤ 2 * c + 3) : + ChainLeadsUpTo N ⟨false, segs, zl, c, k, 0, [x, 3, 1]⟩ RootInv := by + rcases dec_or (x ≤ 22) with hx22 | hx23 + · have hfz40 : 40 ≤ fzOf segs zl := fzOf_ge_40 hv + obtain ⟨hox, hodw⟩ := ox_ge_of_c (by omega) hk1 hkc hfz40 + have hS : SafeStack 39 [x, 3, 1] := safeStack_x_31 hx20 hx22 + have hfb := (excursion_bundle N).1 39 [x, 3, 1] segs zl c k (by decide) hS + (validTail40_of_validSegs40 hv) (by omega) hk1 hkc + (by omega) (by omega) (by omega) (by omega) + refine chainLeadsUpTo_trans hfb ?_ + intro m1 s_mid hm1 hex + rcases hex with ⟨phi, hphi, hb⟩ | ⟨y, phi, hy, hphi38, _, hb⟩ + · rcases dec_or (x = 22) with rfl | hx2021 + · exact bounce_cz_31_even_extra hb (Or.inl ⟨by decide, by decide, by omega⟩) + · exact bounce_cz_31_leads hb (Or.inl ⟨by omega, by omega⟩) + · exact r9_pop_step hb hphi38 (by omega) (by omega) + (fun _ _ p1 p2 hvp _ => bounce_31_leads (isBounce_r9 (by omega) (by omega) hvp) (by omega)) + · exact x_31_high_aux (x - 23) N x segs zl c k (by omega) (Nat.le_refl _) hv hc40 hk1 hkc + +theorem pop_z_cz_31_leads {N z cz phi : Nat} {s : SegState} + (hb : IsBounce phi [z, cz, 3, 1] s) + (hz44 : 44 ≤ z) (hcz25 : 25 ≤ cz) (hphi38 : 38 ≤ phi) : + ChainLeadsUpTo N s RootInv := by + exact amega_pop_step hb hphi38 (by omega) (by omega) + (safeStack_31.2.2 (cz - 1) (by omega)) + (fun _ => safeStack_31.2.2 (cz - 2) (by omega)) + (fun hbig _ _ p1 p2 hvp _ => + bounce_31_leads (isBounce_r9 (by omega) hbig hvp) (by omega)) + (fun _ _ _ _ p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + refine chainLeadsUpTo_here (rootInv_of_31B rfl (validTail40_of_validSegs40 hvp) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) ?_) + intro z0 m0 r hseg _ _ _ + have hz0 : fzOf p1 p2 = z0 := by rw [hseg]; rfl + exact Or.inr (by omega)) + (fun _ _ m2 _ p1 p2 hvp _ => + x_31_high_leads (by omega) hvp (by omega) (by decide) (by omega)) + +theorem loop_k1_gen {N x1 d3 : Nat} {ds3 : List Nat} {segs : List (Nat × Nat)} {zl c1 : Nat} + {P : SegState → Prop} + (hx_lo : 21 ≤ x1) (hx_hi : x1 ≤ 47) + (hS1 : SafeStack 19 (x1 :: d3 :: ds3)) + (hg_x1_1 : GoodDs ((x1 - 1) :: d3 :: ds3) = true) + (hg_x1_2 : GoodDs ((x1 - 2) :: d3 :: ds3) = true) + (hv : ValidSegs40 segs zl) (hc1 : 2 ≤ c1) + (h_top : ∀ m z phi, m ≤ N → (z = x1 ∨ z = x1 - 1) → 38 ≤ phi → ∀ s', + IsBounce phi (z :: d3 :: ds3) s' → ChainLeadsUpTo m s' P) + (h_b1 : ∀ m, m < N → ∀ s', IsBounce (x1 - 1) (d3 :: ds3) s' → ChainLeadsUpTo m s' P) + (h_b2 : ∀ m, m < N → ∀ s', IsBounce (x1 - 2) (d3 :: ds3) s' → ChainLeadsUpTo m s' P) + (h_r10 : ∀ m c' k' p1 p2, m < N → c' = x1 + 1 → 41 ≤ k' → k' ≤ 2 * c' + 3 → + ValidSegs40 p1 p2 → ChainLeadsUpTo m ⟨false, p1, p2, c', k', 0, d3 :: ds3⟩ P) : + ChainLeadsUpTo N ⟨false, segs, zl, c1, 1, 0, x1 :: d3 :: ds3⟩ P := by + have hne1_1 : (x1 :: d3 :: ds3) ≠ [1] := by intro h; injection h with _ h2; cases h2 + have hb := fbound_k1_boost hne1_1 hS1 hv hc1 (N := N) + refine chainLeadsUpTo_trans hb ?_ + intro m1 s_mid hm1 hex + rcases hex with ⟨phi, hphi38, hsb⟩ | ⟨y1, phi1, hy1_39, hphi1_38, hyw1, hsb⟩ + · exact h_top m1 x1 phi hm1 (Or.inl rfl) hphi38 s_mid hsb + · exact amega_pop_step hsb hphi1_38 (by omega) (by omega) hg_x1_1 (fun _ => hg_x1_2) + (fun hbig m2 hm2 p1 p2 hvp _ => + h_b1 m2 (Nat.lt_of_lt_of_le hm2 hm1) _ (isBounce_r9 (by omega) hbig hvp)) + (fun _ _ m2 hm2 p1 p2 hvp _ => + h_r10 m2 (x1 + 1) (y1 + 2) p1 p2 (Nat.lt_of_lt_of_le hm2 hm1) + rfl (by omega) (by omega) hvp) + (fun hy1_le _ m2 hm2 p1 p2 hvp hfzp => by + have hfp := fzOf_ge_40 hvp + have hox99 := arith_boost_cz (c := y1) (fz := fzOf p1 p2) (cz_lo := 109) (ox_lo := 99) + (by omega) hfp (by omega) (Or.inl ⟨rfl, rfl⟩) + exact fbound_force_r9 (x := x1 - 1) (d3 := d3) (ds3 := ds3) (by omega) + hg_x1_1 hg_x1_2 hvp (by omega) (by omega) (by omega) (by omega) (by omega) + (fun m3 phi2 hm3 hphi2 s' hb2 => + h_top m3 (x1 - 1) phi2 (Nat.le_trans hm3 (Nat.le_of_lt (Nat.lt_of_lt_of_le hm2 hm1))) + (Or.inr rfl) (by omega) s' hb2) + (fun m3 hm3 s' hb2 => + h_b2 m3 (Nat.lt_trans hm3 (Nat.lt_of_lt_of_le hm2 hm1)) s' hb2)) + +theorem step_m0_zero_31_advances {z0 zl c k : Nat} {rest : List (Nat × Nat)} + (hv_rest : ValidSegs40 rest zl) + (_hc : 2 ≤ c) (hk1 : 1 ≤ k) (hkc : k ≤ 2 * c + 3) (hcz20 : 20 ≤ c + z0) : + ChainAdvances ⟨false, (z0, 0) :: rest, zl, c, k, 0, [3, 1]⟩ RootInv := by + refine ⟨rfl, fun N => ?_⟩ + dsimp only [stepSegs] + rcases rest with _ | ⟨⟨z1, m1_seg⟩, r2⟩ + · have hzl230 : 230 ≤ zl := hv_rest.2 + exact bounce_31_leads (IsBounce.nil (by omega)) (by omega) + · have hz1_40 : 40 ≤ z1 := fzOf_ge_40 hv_rest + have hv_r2 : ValidSegs40 r2 zl := validSegs40_tail hv_rest + have hfz2_40 : 40 ≤ fzOf r2 zl := fzOf_ge_40 hv_r2 + cases m1_seg with + | zero => + have hg2 : stepGuards ⟨true, (z1, 0) :: r2, zl, c + z0 + 3, k + 2 * z0 + 3, + 2 * (c + z0) + 8, [3, 1]⟩ = true := by + dsimp only [stepGuards]; exact decide_eq_true (by omega) + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs] + refine chainLeadsUpTo_here (rootInv_of_31B rfl (validTail40_of_validSegs40 hv_r2) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) ?_) + intro z2 m2 r3 hseg _ _ _ + have hz2 : fzOf r2 zl = z2 := by rw [hseg]; rfl + exact Or.inr (by omega) + | succ m1' => + rcases dec_or ((m1' + 1) % 2 = 1) with hm1_od | hm1_ev + · cases hd_mrg : decide (2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + m1') with + | true => + have hg2 : stepGuards ⟨true, (z1, m1' + 1) :: r2, zl, c + z0 + 3, k + 2 * z0 + 3, + 2 * (c + z0) + 8, [3, 1]⟩ = true := by + dsimp only [stepGuards]; rw [if_pos hm1_od, hd_mrg, if_pos rfl] + exact safeStack_31.2.2 (c + z0 + 3 + z1) (by omega) + apply chainLeadsUpTo_step hg2 + intro m2 _ + dsimp only [stepSegs]; rw [if_pos hm1_od, hd_mrg, if_pos rfl] + exact x_31_high_leads (by omega) hv_r2 (by omega) (by decide) (by omega) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact bounce_31_leads + (IsBounce.cons hv_r2 (by omega) (by rw [if_pos hm1_od]; omega)) (by omega) + · cases hd_mrg : decide (2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + (m1' + 1)) with + | true => + have h_mrg := of_decide_eq_true hd_mrg + have hg2 : stepGuards ⟨true, (z1, m1' + 1) :: r2, zl, c + z0 + 3, k + 2 * z0 + 3, + 2 * (c + z0) + 8, [3, 1]⟩ = true := by + dsimp only [stepGuards]; rw [if_neg hm1_ev, hd_mrg, if_pos rfl] + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs]; rw [if_neg hm1_ev, hd_mrg, if_pos rfl] + refine chainLeadsUpTo_here (rootInv_of_31B rfl (validTail40_of_validSegs40 hv_r2) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) ?_) + intro z2 m2 r3 hseg _ _ _ + have hz2 : fzOf r2 zl = z2 := by rw [hseg]; rfl + exact Or.inr (by omega) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact bounce_31_leads + (IsBounce.cons hv_r2 (by omega) (by rw [if_neg hm1_ev]; omega)) (by omega) + +theorem root31A_advances {s : SegState} + (hb : s.b = false) (hmrg : s.mrg = 0) (hr : Root31A s) : + ChainAdvances s RootInv := by + obtain ⟨hds, hvt, hc, hk, hcases⟩ := hr + rcases s with ⟨b, segs, zl, cp1, kb, mrg, ds⟩ + dsimp only at hb hmrg hds hvt hc hk hcases + subst hb hmrg hds hc hk + rcases hcases with hfz | hfz | ⟨rest, rfl⟩ + all_goals (try exact step_m0_zero_31_advances hvt (by decide) (by decide) (by decide) (by decide)) + all_goals + rcases segs with _ | ⟨⟨z0, m0⟩, rest⟩ + · dsimp only [fzOf, ValidTail40] at hvt hfz; omega + · dsimp only [fzOf, ValidTail40] at hvt hfz + have hv_rest : ValidSegs40 rest zl := hvt + cases m0 with + | zero => + exact step_m0_zero_31_advances hv_rest (by decide) (by decide) (by decide) (by omega) + | succ m' => + have hphiw : GoodPhiW (2 + z0 - 1) [3, 1] false = true := goodPhiW_31 (by omega) + rcases dec_or (m' + 1 = 1) with hm1 | hm_gt1 + · have hm0_eq : m' = 0 := by omega + subst hm0_eq + have hg : stepGuards ⟨false, (z0, 1) :: rest, zl, 2, 1, 0, [3, 1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (2 + z0 - 1) [3, 1] false && + if 1 = 1 then GoodPsi (2 + z0) [3, 1] else _) = true + rw [hphiw, Bool.true_and, if_pos rfl] + exact safeStack_31.2.2 (2 + z0 + 1) (by omega) + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if 1 = 1 then _ else _) _ + rw [if_pos rfl] + exact x_31_high_leads (by omega) hv_rest (by omega) (by decide) (by omega) + · have hpsi_cz : GoodPsi (2 + z0 - 1) [3, 1] = true := by + dsimp only [GoodPsi] + have hcz_eq : 2 + z0 - 1 + 1 = 2 + z0 := by omega + rw [hcz_eq]; exact safeStack_31.2.2 (2 + z0) (by omega) + rcases dec_or ((m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z0) + 10) with hev_sm | hnot_ev + · have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, 2, 1, 0, [3, 1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (2 + z0 - 1) [3, 1] false && + if m' + 1 = 1 then _ else GoodPsi (2 + z0 - 1) [3, 1] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z0) + 10 then true else _) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, if_pos hev_sm] + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z0) + 10 then _ else _) _ + rw [if_neg hm_gt1, if_pos hev_sm] + exact x_31_high_leads (by omega) hv_rest (by omega) (by omega) (by omega) + · rcases dec_or ((m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (1 + 2 * z0) + 11) with hod_sm | hbig_m + · have hS_cz : SafeStack 27 [2 + z0, 3, 1] := by + rcases dec_or (z0 = 18) with rfl | hz19 + · exact safeStack_20_3_1 + · have hz_eq : z0 = 19 := by omega + subst hz_eq + exact safeStack_mono (by decide) + (safeStack_cons_ne1 (by decide) safeStack_31 (by decide) (by decide)) + have hne1_cz : ([2 + z0, 3, 1] : List Nat) ≠ [1] := by + intro h; injection h with _ h2; cases h2 + have hS1 : SafeStack 19 [1 + 2 * z0 + 2, 2 + z0, 3, 1] := + safeStack_cons_ne1 hne1_cz hS_cz (by omega) (by omega) + have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, 2, 1, 0, [3, 1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (2 + z0 - 1) [3, 1] false && + if m' + 1 = 1 then _ else GoodPsi (2 + z0 - 1) [3, 1] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z0) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (1 + 2 * z0) + 11 then + GoodDs ((1 + 2 * z0 + 2) :: (2 + z0) :: [3, 1]) else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_pos hod_sm] + exact hS_cz.2.2 (1 + 2 * z0 + 2) (by omega) + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z0) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (1 + 2 * z0) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_pos hod_sm] + have hm_sub : m' + 1 - 1 = m' := by omega + rw [hm_sub] + refine loop_k1_gen (by omega) (by omega) hS1 + (hS_cz.2.2 (1 + 2 * z0 + 2 - 1) (by omega)) + (hS_cz.2.2 (1 + 2 * z0 + 2 - 2) (by omega)) + hv_rest (by omega) ?_ ?_ ?_ ?_ + · intro m1 z phi _ hz hphi38 s' hbz + refine amega_pop_step hbz hphi38 (by omega) (by omega) + (safeStack_31.2.2 (2 + z0 - 1) (by omega)) + (by intro hbad; omega) + (fun hbig => False.elim (by omega)) + (fun _ _ _ _ p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + refine chainLeadsUpTo_here (rootInv_of_31B rfl (validTail40_of_validSegs40 hvp) + (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) ?_) + intro z2 m2 r3 hseg _ _ _ + have hz2 : fzOf p1 p2 = z2 := by rw [hseg]; rfl + exact Or.inr (by omega)) + (fun _ _ m2 _ p1 p2 hvp _ => by + have hfp := fzOf_ge_40 hvp + obtain ⟨hox, hodw⟩ := ox_ge_of_c (c := z) (k := 1) (fz := fzOf p1 p2) + (by omega) (by decide) (by omega) hfp + have hS45 : SafeStack 45 [2 + z0 - 1, 3, 1] := + safeStack_of_gt2d2 (by decide) (by omega) (by omega) + (safeStack_31.2.2 (2 + z0 - 1) (by omega)) + have hfb := (excursion_bundle m2).1 45 [2 + z0 - 1, 3, 1] p1 p2 z 1 + (by decide) hS45 (validTail40_of_validSegs40 hvp) + (by omega) (by decide) (by omega) (by omega) (by omega) (by omega) (by omega) + refine chainLeadsUpTo_trans hfb ?_ + intro m3 s_m3 _ hex2 + rcases hex2 with ⟨phi2, hphi2, hb2⟩ | ⟨y2, phi2, hy2, hphi2_38, _, hb2⟩ + · rcases dec_or (2 + z0 - 1 = 19) with h19 | h20 + · rw [h19] at hb2; exact bounce_19_31_leads hb2 (by omega) + · exact bounce_cz_31_leads hb2 (Or.inl ⟨by omega, by omega⟩) + · exact r9_pop_step hb2 hphi2_38 (by omega) (by omega) + (fun _ _ q1 q2 hvq _ => + bounce_31_leads (isBounce_r9 (by omega) (by omega) hvq) (by omega))) + · intro m1 _ s' hb1 + exact bounce_cz_31_leads hb1 (Or.inl ⟨by omega, by omega⟩) + · intro m1 _ s' hb2 + exact bounce_cz_31_leads hb2 (Or.inl ⟨by omega, by omega⟩) + · intro m1 c' k' p1 p2 _ hc' hk'41 hk'c hvp + subst hc' + exact x_31_high_leads (by omega) hvp (by omega) (by omega) hk'c + · have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, 2, 1, 0, [3, 1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (2 + z0 - 1) [3, 1] false && + if m' + 1 = 1 then _ else GoodPsi (2 + z0 - 1) [3, 1] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z0) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (1 + 2 * z0) + 11 then _ else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_neg hbig_m] + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (1 + 2 * z0) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (1 + 2 * z0) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_neg hbig_m] + have hnorm : normSeg 0 (m' + 1 - 4) = (0, (m' - 4) + 1) := by + dsimp only [normSeg]; rw [if_neg (by omega)]; congr 1; omega + rw [hnorm] + have hbc : IsBounce (1 + 2 * z0 + 2) [2 + z0, 3, 1] + ⟨true, (0, (m' - 4) + 1) :: rest, zl, 1 + 2 * z0 + 2, 0, + 2 * (1 + 2 * z0) + 6, [2 + z0, 3, 1]⟩ := by + have h := IsBounce.cons (z0 := 0) (m := m' - 4) (zl := zl) + (cp1 := 1 + 2 * z0 + 2) (kb := 0) (mrg := 2 * (1 + 2 * z0) + 6) + (rest := rest) (ds := [2 + z0, 3, 1]) hv_rest (by omega) + (by split_ifs <;> omega) + simpa only [Nat.add_zero] using h + exact bounce_cz_31_leads hbc (Or.inl ⟨by omega, by omega⟩) + +theorem root31B_advances {s : SegState} + (hb : s.b = false) (hmrg : s.mrg = 0) (hr : Root31B s) : + ChainAdvances s RootInv := by + obtain ⟨hds, hvt, hc, hk1, hkc, hfz21, hcz25, hkz43, hod_inv⟩ := hr + rcases s with ⟨b, segs, zl, c, k, mrg, ds⟩ + dsimp only at hb hmrg hds hvt hc hk1 hkc hfz21 hcz25 hkz43 hod_inv + subst hb hmrg hds + rcases segs with _ | ⟨⟨z0, m0⟩, rest⟩ + · dsimp only [fzOf, ValidTail40] at hvt hfz21 hcz25 hkz43 + have hg : stepGuards ⟨false, [], zl, c, k, 0, [3, 1]⟩ = true := by + dsimp only [stepGuards] + rw [goodPhiW_31 (by omega), Bool.true_and] + dsimp only [GoodPsi] + have hcz : c + zl - 1 + 1 = c + zl := by omega + rw [hcz]; exact safeStack_31.2.2 (c + zl) (by omega) + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + have hbc : IsBounce (k + 2 * zl + 2) [c + zl, 3, 1] + ⟨true, [], 0, k + 2 * zl + 2, 0, 2 * (k + 2 * zl) + 6, [c + zl, 3, 1]⟩ := by + simpa only [Nat.add_zero] using IsBounce.nil (zl := 0) (cp1 := k + 2 * zl + 2) + (kb := 0) (mrg := 2 * (k + 2 * zl) + 6) (ds := [c + zl, 3, 1]) (by omega) + exact bounce_cz_31_ge25_leads hbc (by omega) (by omega) + · dsimp only [fzOf, ValidTail40] at hvt hfz21 hcz25 hkz43 + have hv_rest : ValidSegs40 rest zl := hvt + cases m0 with + | zero => + exact step_m0_zero_31_advances hv_rest hc hk1 hkc (by omega) + | succ m' => + have hphiw : GoodPhiW (c + z0 - 1) [3, 1] false = true := goodPhiW_31 (by omega) + rcases dec_or (m' + 1 = 1) with hm1 | hm_gt1 + · have hm0_eq : m' = 0 := by omega + subst hm0_eq + have hg : stepGuards ⟨false, (z0, 1) :: rest, zl, c, k, 0, [3, 1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) [3, 1] false && + if 1 = 1 then GoodPsi (c + z0) [3, 1] else _) = true + rw [hphiw, Bool.true_and, if_pos rfl] + exact safeStack_31.2.2 (c + z0 + 1) (by omega) + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if 1 = 1 then _ else _) _ + rw [if_pos rfl] + exact x_31_high_leads (by omega) hv_rest (by omega) (by decide) (by omega) + · have hpsi_cz : GoodPsi (c + z0 - 1) [3, 1] = true := by + dsimp only [GoodPsi] + have hcz_eq : c + z0 - 1 + 1 = c + z0 := by omega + rw [hcz_eq]; exact safeStack_31.2.2 (c + z0) (by omega) + rcases dec_or ((m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10) with hev_sm | hnot_ev + · have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, [3, 1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) [3, 1] false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) [3, 1] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else _) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, if_pos hev_sm] + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else _) _ + rw [if_neg hm_gt1, if_pos hev_sm] + exact x_31_high_leads (by omega) hv_rest (by omega) (by omega) (by omega) + · rcases dec_or ((m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11) with hod_sm | hbig_m + · have hS_cz : SafeStack 19 [c + z0, 3, 1] := + safeStack_cons_ne1 (by decide) safeStack_31 (by omega) (by omega) + have hne1_cz : ([c + z0, 3, 1] : List Nat) ≠ [1] := by + intro h; injection h with _ h2; cases h2 + have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, [3, 1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) [3, 1] false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) [3, 1] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then + GoodDs ((k + 2 * z0 + 2) :: (c + z0) :: [3, 1]) else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_pos hod_sm] + exact hS_cz.2.2 (k + 2 * z0 + 2) (by omega) + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_pos hod_sm] + have hm_sub : m' + 1 - 1 = m' := by omega + rw [hm_sub] + set x1 := k + 2 * z0 + 2 + rcases dec_or (x1 ≤ 47) with hx47 | hx48 + · refine loop_k1_le47 hne1_cz (safeStack_mono (by decide) hS_cz) + (Or.inl (by omega)) hx47 hv_rest (by omega) + (fun m1 z phi _ hz hphi38 _ hbz => + pop_z_cz_31_leads hbz (by omega) hcz25 hphi38) + ?_ ?_ + (fun m1 c' k' p1 p2 _ hc' hk'41 hk'c hvp => by + subst hc' + exact x_31_high_leads (by omega) hvp (by omega) (by omega) hk'c) + · intro m1 _ s' hb1 + rcases dec_or ((c + z0) % 2 = 1) with hcz_od | hcz_ev + · exact bounce_cz_31_leads hb1 (Or.inr (Or.inl ⟨by omega, hcz_od, by omega⟩)) + · have h_ev := hod_inv z0 (m' + 1) rest rfl (by omega) (by omega) hod_sm.1 + rcases h_ev with ⟨rfl, rfl, rfl⟩ | h47 + · exact bounce_cz_31_even_extra hb1 (Or.inr ⟨by decide, by decide, by omega⟩) + · omega + · intro m1 _ s' hb2 + rcases dec_or ((c + z0) % 2 = 1) with hcz_od | hcz_ev + · exact bounce_cz_31_leads hb2 (Or.inr (Or.inl ⟨by omega, hcz_od, by omega⟩)) + · have h_ev := hod_inv z0 (m' + 1) rest rfl (by omega) (by omega) hod_sm.1 + rcases h_ev with ⟨rfl, rfl, rfl⟩ | h47 + · exact bounce_cz_31_even_extra hb2 (Or.inr ⟨by decide, by decide, by omega⟩) + · omega + · rcases dec_or (x1 ≤ 50) with hx50 | hx51 + · have hS_x1 : SafeStack 19 [x1, c + z0, 3, 1] := + safeStack_cons_ne1 hne1_cz hS_cz (by omega) (by omega) + have hne1_x1 : ([x1, c + z0, 3, 1] : List Nat) ≠ [1] := by + intro h; injection h with _ h2; cases h2 + refine chainLeadsUpTo_trans (fbound_k1_boost hne1_x1 hS_x1 hv_rest (by omega)) ?_ + intro m1 s_m1 hm1 hex1 + rcases hex1 with ⟨phi1, hphi1, hb1⟩ | ⟨y1, phi1, hy1, hphi1_38, hyw1, hb1⟩ + · exact pop_z_cz_31_leads hb1 (by omega) hcz25 hphi1 + · exact amega_pop_step hb1 hphi1_38 (by omega) (by omega) + (hS_cz.2.2 (x1 - 1) (by omega)) (fun _ => hS_cz.2.2 (x1 - 2) (by omega)) + (fun hbig _ _ p1 p2 hvp _ => + bounce_cz_31_ge25_leads (isBounce_r9 (by omega) hbig hvp) hcz25 (by omega)) + (fun _ _ _ _ p1 p2 hvp _ => + x_31_high_leads (by omega) hvp (by omega) (by omega) (by omega)) + (fun hy1_le _ m2 _ p1 p2 hvp hfzp => by + have hfp := fzOf_ge_40 hvp + have hox99 := arith_boost_cz (c := y1) (fz := fzOf p1 p2) + (cz_lo := 109) (ox_lo := 99) (by omega) hfp (by omega) (Or.inl ⟨rfl, rfl⟩) + have hS_x1' : SafeStack 19 [x1 - 1, c + z0, 3, 1] := + safeStack_cons_ne1 hne1_cz hS_cz (by omega) (by omega) + have hfb2 := (excursion_bundle m2).1 19 [x1 - 1, c + z0, 3, 1] p1 p2 y1 1 + (by decide) hS_x1' (validTail40_of_validSegs40 hvp) + (by omega) (by decide) (by omega) (by omega) (by omega) (by omega) + (by omega) + refine chainLeadsUpTo_trans hfb2 ?_ + intro m3 s_m3 _ hex2 + rcases hex2 with ⟨phi2, hphi2, hb2⟩ | ⟨y2, phi2, hy2, hphi2_38, _, hb2⟩ + · have hp2 : 38 ≤ phi2 := by dsimp only [odw] at hphi2; omega + exact pop_z_cz_31_leads hb2 (by omega) hcz25 hp2 + · exact amega_pop_step hb2 hphi2_38 (by omega) (by omega) + (hS_cz.2.2 (x1 - 2) (by omega)) (fun _ => hS_cz.2.2 (x1 - 3) (by omega)) + (fun hbig _ _ q1 q2 hvq _ => + bounce_cz_31_ge25_leads (isBounce_r9 (by omega) hbig hvq) hcz25 (by + omega)) + (fun _ _ _ _ q1 q2 hvq _ => + x_31_high_leads (by omega) hvq (by omega) (by omega) (by omega)) + (fun hy2_le _ m4 _ q1 q2 hvq _ => by + have hfq := fzOf_ge_40 hvq + obtain ⟨hox_q, _⟩ := ox_ge_of_c (c := y2) (k := 1) (fz := fzOf q1 q2) + (by omega) (by decide) (by omega) hfq + exact fbound_force_r9 (x := x1 - 2) (d3 := c + z0) (ds3 := [3, 1]) + (by omega) (hS_cz.2.2 (x1 - 2) (by omega)) + (hS_cz.2.2 (x1 - 3) (by omega)) hvq + (by omega) (by decide) (by omega) (by omega) (by omega) + (fun _ phi3 _ hphi3 _ hb3 => + pop_z_cz_31_leads hb3 (by omega) hcz25 (by omega)) + (fun _ _ _ hb3 => + bounce_cz_31_ge25_leads hb3 hcz25 (by omega)))) + · have hfz_r : 40 ≤ fzOf rest zl := fzOf_ge_40 hv_rest + exact chainLeadsUpTo_trans + ((excursion_bundle N).2 19 [c + z0, 3, 1] rest zl m' 1 x1 46 0 + (by decide) hS_cz (Or.inl hne1_cz) hv_rest + (by omega) (by decide) (by omega) (by decide) (by omega) + (by omega) (by omega) (by omega) (by omega)) + (fun _ _ _ hex => by + rcases hex with ⟨phi, hphi, hb⟩ | ⟨z, phi, hz, hphi38, _, hb⟩ + · exact bounce_cz_31_ge25_leads hb hcz25 hphi + · exact pop_z_cz_31_leads hb (by omega) hcz25 hphi38) + · have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, [3, 1]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) [3, 1] false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) [3, 1] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_neg hbig_m] + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_neg hbig_m] + have hnorm : normSeg 0 (m' + 1 - 4) = (0, (m' - 4) + 1) := by + dsimp only [normSeg]; rw [if_neg (by omega)]; congr 1; omega + rw [hnorm] + have hbc : IsBounce (k + 2 * z0 + 2) [c + z0, 3, 1] + ⟨true, (0, (m' - 4) + 1) :: rest, zl, k + 2 * z0 + 2, 0, + 2 * (k + 2 * z0) + 6, [c + z0, 3, 1]⟩ := by + have h := IsBounce.cons (z0 := 0) (m := m' - 4) (zl := zl) + (cp1 := k + 2 * z0 + 2) (kb := 0) (mrg := 2 * (k + 2 * z0) + 6) + (rest := rest) (ds := [c + z0, 3, 1]) hv_rest (by omega) + (by split_ifs <;> omega) + simpa only [Nat.add_zero] using h + exact bounce_cz_31_ge25_leads hbc hcz25 (by omega) + +theorem root31_advances {s : SegState} + (hb : s.b = false) (hmrg : s.mrg = 0) (hr : Root31 s) : + ChainAdvances s RootInv := by + rcases hr with ha | hb31 + · exact root31A_advances hb hmrg ha + · exact root31B_advances hb hmrg hb31 + +-- ============================================================================ +-- Helpers & Advancement Closure for `Root0` (`Root0A` and `Root0B`) +-- ============================================================================ + +theorem goodPhiW_0 {w : Nat} {ds : List Nat} (hds : ds = [] ∨ ds = [0]) (hw : 6 ≤ w) : + GoodPhiW w ds false = true := by + rcases hds with rfl | rfl + · dsimp only [GoodPhiW] + rw [if_neg (by decide), if_neg (by decide), if_neg (by decide), if_pos rfl, Bool.false_or] + exact decide_eq_true hw + · dsimp only [GoodPhiW] + rw [if_neg (by decide), if_pos rfl] + exact decide_eq_true hw + +theorem goodPsi_0 {w : Nat} {ds : List Nat} (hds : ds = [] ∨ ds = [0]) (hw : 7 ≤ w) : + GoodPsi w ds = true := by + rcases hds with rfl | rfl + · dsimp only [GoodPsi, GoodDs, GoodDsAux, GoodDs1] + exact decide_eq_true (by omega) + · dsimp only [GoodPsi, GoodDs, GoodDsAux, GoodDs2] + rw [if_pos rfl] + exact decide_eq_true (by omega) + +theorem safeStack_0 {ds : List Nat} (hds : ds = [] ∨ ds = [0]) : SafeStack 19 ds := by + rcases hds with rfl | rfl + · exact safeStack_nil + · exact safeStack_zero + +theorem safeStack19_d_ds {d : Nat} {ds : List Nat} (hd10 : 10 ≤ d) (hds : ds = [] ∨ ds = [0]) : + SafeStack 19 (d :: ds) := by + rcases hds with rfl | rfl + · refine ⟨(by intro h; injection h with h1; omega), (safeStack_d (by omega)).2.1, ?_⟩ + intro u hu + dsimp only [GoodDs, GoodDsAux, GoodDs2] + rw [if_neg (by omega), if_neg (by omega), if_neg (by omega)] + have hu19 : decide (u < 19) = false := decide_eq_false (by omega) + have hu17 : decide (u < 17) = false := decide_eq_false (by omega) + have hgd : GoodDs1 d = true := by dsimp only [GoodDs1]; exact decide_eq_true (by omega) + have hg1 : GoodDs1 (d - 1) = true := by dsimp only [GoodDs1]; exact decide_eq_true (by omega) + have hg2 : GoodDs1 (d - 2) = true := by dsimp only [GoodDs1]; exact decide_eq_true (by omega) + rw [hu19, hu17, hgd, hg1, hg2] + simp only [Bool.and_false, Bool.not_true, Bool.or_false, Bool.false_eq_true, ite_false] + · refine ⟨(by intro h; injection h with _ h2; cases h2), (safeStack_d0 (by omega)).2.1, ?_⟩ + intro u hu + dsimp only [GoodDs] + rw [GoodDsAux.eq_3, if_neg (by omega)] + have h1 : decide (d = 3 ∧ 0 = 1 ∧ ([] : List Nat) = [] ∧ u < 19) = false := + decide_eq_false (by omega) + have hu19 : decide (u < 19) = false := decide_eq_false (by omega) + have h3 : decide (d ≥ 25 ∧ 0 = 1 ∧ ([] : List Nat) = [] ∧ u < 39) = false := + decide_eq_false (by omega) + have hu17 : decide (u < 17) = false := decide_eq_false (by omega) + have hgd : GoodDsAux d [0] = true := (safeStack_d0 (by omega)).2.1 + have hg1 : GoodDsAux (d - 1) [0] = true := (safeStack_d0 (by omega)).2.1 + have hg2 : GoodDsAux (d - 2) [0] = true := (safeStack_d0 (by omega)).2.1 + rw [h1, hu19, h3, hu17, hgd, hg1, hg2] + simp only [Bool.and_false, Bool.not_true, Bool.or_false, Bool.false_eq_true, ite_false] + +theorem bounce_0_leads {N phi : Nat} {ds : List Nat} {s : SegState} + (hb : IsBounce phi ds s) (hds : ds = [] ∨ ds = [0]) (hphi : 38 ≤ phi) : + ChainLeadsUpTo N s RootInv := by + rcases hds with rfl | rfl + · exact bounce_nil_leads hb (by omega) + · exact bounce_zero_leads hb hphi + +theorem step_m0_zero_0_advances {z0 zl c k : Nat} {rest : List (Nat × Nat)} {ds : List Nat} + (hds : ds = [] ∨ ds = [0]) (hv_rest : ValidSegs40 rest zl) + (_hc : 1 ≤ c) (hk1 : 1 ≤ k) (hkc : k ≤ 2 * c + 3) (hcz8 : 8 ≤ c + z0) : + ChainAdvances ⟨false, (z0, 0) :: rest, zl, c, k, 0, ds⟩ RootInv := by + refine ⟨rfl, fun N => ?_⟩ + dsimp only [stepSegs] + rcases rest with _ | ⟨⟨z1, m1_seg⟩, r2⟩ + · have hzl230 : 230 ≤ zl := hv_rest.2 + exact bounce_0_leads (IsBounce.nil (by omega)) hds (by omega) + · have hz1_40 : 40 ≤ z1 := fzOf_ge_40 hv_rest + have hv_r2 : ValidSegs40 r2 zl := validSegs40_tail hv_rest + have hfz2_40 : 40 ≤ fzOf r2 zl := fzOf_ge_40 hv_r2 + cases m1_seg with + | zero => + have hg2 : stepGuards ⟨true, (z1, 0) :: r2, zl, c + z0 + 3, k + 2 * z0 + 3, + 2 * (c + z0) + 8, ds⟩ = true := by + dsimp only [stepGuards]; exact decide_eq_true (by omega) + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs] + exact chainLeadsUpTo_here (rootInv_of_0B hds (validTail40_of_validSegs40 hv_r2) + (by omega) (by omega) (by omega) (by omega) (by omega) + (by intro h; omega) (by intro h; omega) (by intro _ _ _ _ hcz9; omega)) + | succ m1' => + rcases dec_or ((m1' + 1) % 2 = 1) with hm1_od | hm1_ev + · cases hd_mrg : decide (2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + m1') with + | true => + have hg2 : stepGuards ⟨true, (z1, m1' + 1) :: r2, zl, c + z0 + 3, k + 2 * z0 + 3, + 2 * (c + z0) + 8, ds⟩ = true := by + dsimp only [stepGuards]; rw [if_pos hm1_od, hd_mrg, if_pos rfl] + exact (safeStack_0 hds).2.2 (c + z0 + 3 + z1) (by omega) + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs]; rw [if_pos hm1_od, hd_mrg, if_pos rfl] + have hds_d : ((c + z0 + 3 + z1) :: ds) = [c + z0 + 3 + z1] ∨ + ((c + z0 + 3 + z1) :: ds) = [c + z0 + 3 + z1, 0] := by + rcases hds with rfl | rfl <;> [exact Or.inl rfl; exact Or.inr rfl] + exact chainLeadsUpTo_here (rootInv_of_D (d := c + z0 + 3 + z1) (by omega) hds_d + (validTail40_of_validSegs40 hv_r2) (by omega) (by decide) (by omega) + (by omega) (by omega) (by omega)) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact bounce_0_leads + (IsBounce.cons hv_r2 (by omega) (by rw [if_pos hm1_od]; omega)) hds (by omega) + · cases hd_mrg : decide (2 * (c + z0) + 8 ≥ (k + 2 * z0 + 3) + (m1' + 1)) with + | true => + have h_mrg := of_decide_eq_true hd_mrg + have hg2 : stepGuards ⟨true, (z1, m1' + 1) :: r2, zl, c + z0 + 3, k + 2 * z0 + 3, + 2 * (c + z0) + 8, ds⟩ = true := by + dsimp only [stepGuards]; rw [if_neg hm1_ev, hd_mrg, if_pos rfl] + apply chainLeadsUpTo_step1 hg2 + dsimp only [stepSegs]; rw [if_neg hm1_ev, hd_mrg, if_pos rfl] + exact chainLeadsUpTo_here (rootInv_of_0B hds (validTail40_of_validSegs40 hv_r2) + (by omega) (by omega) (by omega) (by omega) (by omega) + (by intro h; omega) (by intro h; omega) (by intro _ _ _ _ hcz9; omega)) + | false => + have h_nm := of_decide_eq_false hd_mrg + exact bounce_0_leads + (IsBounce.cons hv_r2 (by omega) (by rw [if_neg hm1_ev]; omega)) hds (by omega) + +theorem pop_17_8_0_leads {N phi : Nat} {s : SegState} + (hb : IsBounce phi [17, 8, 0] s) (hphi38 : 38 ≤ phi) : + ChainLeadsUpTo N s RootInv := by + have hg_pop : drainPopGuards phi [17, 8, 0] = true := by + have hnrst : isDrainRstDs [17, 8, 0] = false := rfl + have hnr0 : isRank0 [17, 8, 0] = false := rfl + dsimp only [drainPopGuards] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true] + have hc4 : decide (phi ≥ 16) = true := decide_eq_true (by omega) + rw [hc4]; rfl + obtain ⟨hg_s, _, hp, m_rem, rest, zl, hv_rest, hzl_false, hstep⟩ := isBounce_step hb hg_pop + set p := pushSeg hp (phi + 2) m_rem rest zl + have hdp : drainPopStep hp phi m_rem rest zl [17, 8, 0] = + ⟨true, (0, 14) :: p.1, p.2, 7, 0, 16, [0]⟩ := rfl + rw [hdp] at hstep + have hvp : ValidSegs40 p.1 p.2 := + validSegs40_pushSeg hp (by omega) hv_rest (fun hf => by have := hzl_false hf; omega) + have hfp40 : 40 ≤ fzOf p.1 p.2 := fzOf_ge_40 hvp + apply chainLeadsUpTo_step hg_s + intro m1 _ + rw [hstep] + have hg2 : stepGuards ⟨true, (0, 14) :: p.1, p.2, 7, 0, 16, [0]⟩ = true := rfl + have hs2 : stepSegs ⟨true, (0, 14) :: p.1, p.2, 7, 0, 16, [0]⟩ = + ⟨false, p.1, p.2, 9, 19, 0, [0]⟩ := rfl + apply chainLeadsUpTo_step1 hg2 + rw [hs2] + exact chainLeadsUpTo_here (rootInv_of_0B (Or.inr rfl) (validTail40_of_validSegs40 hvp) + (by decide) (by decide) (by decide) (by omega) (by omega) + (by intro h; omega) (by intro h; omega) (by intro _ _ _ _ hcz9; omega)) + +theorem pop_y_17_8_0_leads {N y phi : Nat} {s : SegState} + (hb : IsBounce phi [y, 17, 8, 0] s) (hy43 : 43 ≤ y) (hphi38 : 38 ≤ phi) : + ChainLeadsUpTo N s RootInv := by + have hnrst : isDrainRstDs [y, 17, 8, 0] = false := rfl + have hnr0 : isRank0 [y, 17, 8, 0] = false := by + rcases y with _ | _ | _ | _ <;> try omega + rfl + have hg_pop : drainPopGuards phi [y, 17, 8, 0] = true := by + dsimp only [drainPopGuards] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true] + have hc1 : decide (y ≥ 3 ∧ 17 ≥ 1) = true := decide_eq_true (by omega) + have hc2 : decide (y % 2 = 0 ∧ y ≤ 2 * 17 + 4) = false := decide_eq_false (by omega) + have hc3 : decide (y % 2 = 0 ∧ y + 14 ≤ 2 * 17) = false := decide_eq_false (by omega) + have hc4 : decide (phi ≥ 16) = true := decide_eq_true (by omega) + rw [hc1, hc2, hc3, hc4]; rfl + obtain ⟨hg_s, _, hp, m_rem, rest, zl, hv_rest, hzl_false, hstep⟩ := isBounce_step hb hg_pop + set p := pushSeg hp (phi + 2) m_rem rest zl + have hdp : drainPopStep hp phi m_rem rest zl [y, 17, 8, 0] = + ⟨true, (0, (y - 4) + 1) :: p.1, p.2, 16, 0, 34, [8, 0]⟩ := by + dsimp only [drainPopStep] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true, + if_neg (by rintro ⟨h17, _, _⟩; cases h17)] + have hnorm : normSeg 0 (y - 3) = (0, (y - 4) + 1) := by + dsimp only [normSeg]; rw [if_neg (by omega)]; congr 1; omega + rw [hnorm] + rw [hdp] at hstep + have hvp : ValidSegs40 p.1 p.2 := + validSegs40_pushSeg hp (by omega) hv_rest (fun hf => by have := hzl_false hf; omega) + apply chainLeadsUpTo_step hg_s + intro m1 _ + rw [hstep] + have hbc : IsBounce 16 [8, 0] ⟨true, (0, (y - 4) + 1) :: p.1, p.2, 16, 0, 34, [8, 0]⟩ := by + have h := IsBounce.cons (z0 := 0) (m := y - 4) (zl := p.2) (cp1 := 16) (kb := 0) (mrg := 34) + (rest := p.1) (ds := [8, 0]) hvp (by omega) + (by split_ifs <;> omega) + simpa only [Nat.add_zero] using h + exact bounce_d_leads hbc (Or.inr rfl) (Or.inl ⟨rfl, Or.inl rfl⟩) + +theorem pop_19_9_leads {N phi : Nat} {ds : List Nat} {s : SegState} + (hb : IsBounce phi (19 :: 9 :: ds) s) (hds : ds = [] ∨ ds = [0]) (hphi38 : 38 ≤ phi) : + ChainLeadsUpTo N s RootInv := by + have hg_pop : drainPopGuards phi (19 :: 9 :: ds) = true := by + have hnrst : isDrainRstDs (19 :: 9 :: ds) = false := rfl + have hnr0 : isRank0 (19 :: 9 :: ds) = false := rfl + dsimp only [drainPopGuards] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true] + have hc4 : decide (phi ≥ 16) = true := decide_eq_true (by omega) + rcases hds with rfl | rfl <;> (rw [hc4]; rfl) + obtain ⟨hg_s, _, hp, m_rem, rest, zl, hv_rest, hzl_false, hstep⟩ := isBounce_step hb hg_pop + set p := pushSeg hp (phi + 2) m_rem rest zl + have hdp : drainPopStep hp phi m_rem rest zl (19 :: 9 :: ds) = + ⟨true, (0, 16) :: p.1, p.2, 8, 0, 18, ds⟩ := by + rcases hds with rfl | rfl <;> rfl + rw [hdp] at hstep + have hvp : ValidSegs40 p.1 p.2 := + validSegs40_pushSeg hp (by omega) hv_rest (fun hf => by have := hzl_false hf; omega) + have hfp40 : 40 ≤ fzOf p.1 p.2 := fzOf_ge_40 hvp + apply chainLeadsUpTo_step hg_s + intro m1 _ + rw [hstep] + have hg2 : stepGuards ⟨true, (0, 16) :: p.1, p.2, 8, 0, 18, ds⟩ = true := rfl + have hs2 : stepSegs ⟨true, (0, 16) :: p.1, p.2, 8, 0, 18, ds⟩ = + ⟨false, p.1, p.2, 10, 21, 0, ds⟩ := rfl + apply chainLeadsUpTo_step1 hg2 + rw [hs2] + exact chainLeadsUpTo_here (rootInv_of_0B hds (validTail40_of_validSegs40 hvp) + (by decide) (by decide) (by decide) (by omega) (by omega) + (by intro h; omega) (by intro h; omega) (by intro _ _ _ _ hcz9; omega)) + +theorem pop_y_19_9_leads {N y phi : Nat} {ds : List Nat} {s : SegState} + (hb : IsBounce phi (y :: 19 :: 9 :: ds) s) + (hds : ds = [] ∨ ds = [0]) + (hy49 : 49 ≤ y) + (hphi_cases : (53 ≤ y ∧ 90 ≤ phi) ∨ 100 ≤ phi ∨ (53 ≤ y ∧ y % 2 = 1 ∧ 88 ≤ phi)) : + ChainLeadsUpTo N s RootInv := by + have hphi88 : 88 ≤ phi := by + rcases hphi_cases with ⟨_, h⟩ | h | ⟨_, _, h⟩ <;> omega + refine r9_pop_step hb (by omega) (by decide) (by omega) ?_ + intro m1 _ p0_1 p0_2 hvp0 hfzp0 + have hy_sub : y - 3 = (y - 4) + 1 := by omega + have hg_pop9 : drainPopGuards (18 + 0) (9 :: ds) = true := by + rcases hds with rfl | rfl <;> rfl + have hg2 : stepGuards ⟨true, (0, y - 3) :: p0_1, p0_2, 18, 0, 38, 9 :: ds⟩ = true := by + rw [hy_sub]; dsimp only [stepGuards] + rcases dec_or (((y - 4) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega)]; exact hg_pop9 + · rw [if_neg hev, decide_eq_false (by omega)]; exact hg_pop9 + have hs2 : stepSegs ⟨true, (0, y - 3) :: p0_1, p0_2, 18, 0, 38, 9 :: ds⟩ = + ⟨true, (1, 0) :: (20, y - 43) :: p0_1, p0_2, 3, 0, 8, [1]⟩ := by + have hm_eq : 0 + ((y - 4) + 1) - (38 + 2) = y - 43 := by omega + have hn20 : normSeg 20 (y - 43) = (20, y - 43) := by + dsimp only [normSeg]; rw [if_neg (by omega)] + have hdp9 : drainPopStep true (18 + 0) (y - 43) p0_1 p0_2 (9 :: ds) = + ⟨true, (1, 0) :: normSeg 20 (y - 43) :: p0_1, p0_2, 3, 0, 8, [1]⟩ := by + rcases hds with rfl | rfl <;> rfl + rw [hy_sub]; dsimp only [stepSegs] + rcases dec_or (((y - 4) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega), if_neg Bool.false_ne_true, hm_eq, hdp9, hn20] + · rw [if_neg hev, decide_eq_false (by omega), if_neg Bool.false_ne_true, hm_eq, hdp9, hn20] + apply chainLeadsUpTo_step hg2 + intro m2 _ + rw [hs2] + have hg3 : stepGuards ⟨true, (1, 0) :: (20, y - 43) :: p0_1, p0_2, 3, 0, 8, [1]⟩ = true := rfl + have hs3 : stepSegs ⟨true, (1, 0) :: (20, y - 43) :: p0_1, p0_2, 3, 0, 8, [1]⟩ = + ⟨false, (20, y - 43) :: p0_1, p0_2, 5, 5, 0, [1]⟩ := rfl + apply chainLeadsUpTo_step1 hg3 + rw [hs3] + apply chainLeadsUpTo_here + refine rootInv_of_1 hvp0 (by decide) (by decide) (by decide) + (by dsimp only [fzOf]; omega) (by dsimp only [fzOf]; omega) + (fun _ => ⟨y - 43, p0_1, rfl, rfl, rfl, by omega, ?_⟩) + (by intro h; dsimp only [fzOf] at h; omega) + intro hm0_od + rcases hphi_cases with ⟨hy53, hphi90⟩ | hphi100 | ⟨_, hy_od, _⟩ <;> omega + +theorem pop_y_d_leads {N d y phi : Nat} {ds : List Nat} {s : SegState} + (hb : IsBounce phi (y :: d :: ds) s) + (hd10 : 10 ≤ d) (hds : ds = [] ∨ ds = [0]) + (hy20 : 20 ≤ y) (hphi38 : 38 ≤ phi) : + ChainLeadsUpTo N s RootInv := by + have hSd : SafeStack 19 (d :: ds) := safeStack19_d_ds hd10 hds + have hg1 : GoodDs ((d - 1) :: ds) = true := by + rcases hds with rfl | rfl + · exact (safeStack_d (by omega)).2.1 + · exact (safeStack_d0 (by omega)).2.1 + have hg2 : GoodDs ((d - 2) :: ds) = true := by + rcases hds with rfl | rfl + · exact (safeStack_d (by omega)).2.1 + · exact (safeStack_d0 (by omega)).2.1 + have hnrst : isDrainRstDs (y :: d :: ds) = false := by + cases d with | zero => omega | succ _ => rfl + have hnr0 : isRank0 (y :: d :: ds) = false := by + rcases y with _ | _ | _ | _ <;> try omega + rfl + have hg_pop : drainPopGuards phi (y :: d :: ds) = true := by + dsimp only [drainPopGuards] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true] + have hc1 : decide (y ≥ 3 ∧ d ≥ 1) = true := decide_eq_true (by omega) + have hc2 : (!decide (y % 2 = 0 ∧ y ≤ 2 * d + 4) || GoodDs ((d - 1) :: ds)) = true := by + rw [hg1, Bool.or_true] + have hc3 : (!decide (y % 2 = 0 ∧ y + 14 ≤ 2 * d) || GoodDs ((d - 2) :: ds)) = true := by + rw [hg2, Bool.or_true] + have hc4 : decide (phi ≥ 16) = true := decide_eq_true (by omega) + rw [hc1, hc2, hc3, hc4]; rfl + obtain ⟨hg_s, _, hp, m_rem, rest, zl, hv_rest, hzl_false, hstep⟩ := isBounce_step hb hg_pop + set p := pushSeg hp (phi + 2) m_rem rest zl + have hdp : drainPopStep hp phi m_rem rest zl (y :: d :: ds) = + ⟨true, (0, y - 3) :: p.1, p.2, d - 1, 0, 2 * d, ds⟩ := by + dsimp only [drainPopStep] + rw [hnrst, hnr0, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true, if_neg (by omega)] + have hnorm : normSeg 0 (y - 3) = (0, y - 3) := by + dsimp only [normSeg]; rw [if_neg (by omega)] + rw [hnorm] + rw [hdp] at hstep + have hvp : ValidSegs40 p.1 p.2 := + validSegs40_pushSeg hp (by omega) hv_rest (fun hf => by have := hzl_false hf; omega) + have hfzp40 : 40 ≤ fzOf p.1 p.2 := fzOf_ge_40 hvp + apply chainLeadsUpTo_step hg_s + intro m1 _ + rw [hstep] + rcases dec_or (2 * d + 5 ≤ y) with hbig | hsm + · rcases hds with rfl | rfl + · have hy_sub : y - 3 = (y - 4) + 1 := by omega + have hpop_nil : drainPopGuards (d - 1 + 0) [] = true := by + change decide (d - 1 + 0 ≥ 2) = true; exact decide_eq_true (by omega) + have hg_s2 : stepGuards ⟨true, (0, y - 3) :: p.1, p.2, d - 1, 0, 2 * d, []⟩ = true := by + rw [hy_sub]; dsimp only [stepGuards] + rcases dec_or (((y - 4) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega)]; exact hpop_nil + · rw [if_neg hev, decide_eq_false (by omega)]; exact hpop_nil + apply chainLeadsUpTo_step1 hg_s2 + rw [hy_sub]; dsimp only [stepSegs] + set q := pushSeg true (d - 1 + 0 + 1) (0 + ((y - 4) + 1) - (2 * d + 2)) p.1 p.2 + have hvtq : ValidTail40 q.1 q.2 := + validTail40_pushSeg true (fun _ => hvp) (by intro hf; cases hf) + have hfzq : d - 1 + 0 + 1 ≤ fzOf q.1 q.2 := + fzOf_pushSeg_ge true (d - 1 + 0 + 1) (0 + ((y - 4) + 1) - (2 * d + 2)) p.1 p.2 + rcases dec_or (((y - 4) + 1) % 2 = 1) with hod | hev + · rw [if_pos hod, decide_eq_false (by omega)] + change ChainLeadsUpTo m1 ⟨false, q.1, q.2, 1, 1, 0, []⟩ RootInv + exact chainLeadsUpTo_here (rootInv_of_0B (Or.inl rfl) hvtq + (by decide) (by decide) (by decide) (by omega) (by omega) + (by intro h; omega) (fun _ => Or.inl ⟨rfl, rfl⟩) (by intro _ _ _ _ hcz9; omega)) + · rw [if_neg hev, decide_eq_false (by omega)] + change ChainLeadsUpTo m1 ⟨false, q.1, q.2, 1, 1, 0, []⟩ RootInv + exact chainLeadsUpTo_here (rootInv_of_0B (Or.inl rfl) hvtq + (by decide) (by decide) (by decide) (by omega) (by omega) + (by intro h; omega) (fun _ => Or.inl ⟨rfl, rfl⟩) (by intro _ _ _ _ hcz9; omega)) + · exact bounce_r9_zero_leads (by omega) hbig hvp + · have hy_sub : y - 3 = (y - 4) + 1 := by omega + rcases dec_or (y % 2 = 1) with hy_od | hy_ev + · have hm_ev : ¬(((y - 4) + 1) % 2 = 1) := by omega + have hmrg : decide (2 * d ≥ 0 + ((y - 4) + 1)) = true := decide_eq_true (by omega) + have hg_mid : stepGuards ⟨true, (0, y - 3) :: p.1, p.2, d - 1, 0, 2 * d, ds⟩ = true := by + rw [hy_sub]; dsimp only [stepGuards]; rw [if_neg hm_ev, hmrg, if_pos rfl] + have hs_mid : stepSegs ⟨true, (0, y - 3) :: p.1, p.2, d - 1, 0, 2 * d, ds⟩ = + ⟨false, p.1, p.2, d + 1, y + 2, 0, ds⟩ := by + rw [hy_sub]; dsimp only [stepSegs]; rw [if_neg hm_ev, hmrg, if_pos rfl] + have hc_eq : d - 1 + 0 + 2 = d + 1 := by omega + have hk_eq : 0 + (y - 4 + 1) + 2 * 0 + 5 = y + 2 := by omega + rw [hc_eq, hk_eq] + apply chainLeadsUpTo_step1 hg_mid + rw [hs_mid] + exact chainLeadsUpTo_here (rootInv_of_0B hds (validTail40_of_validSegs40 hvp) + (by omega) (by omega) (by omega) (by omega) (by omega) + (by intro h; omega) (by intro h; omega) (by intro _ _ _ _ hcz9; omega)) + · have hm_od : ((y - 4) + 1) % 2 = 1 := by omega + have hmrg : decide (2 * d ≥ 0 + (y - 4)) = true := decide_eq_true (by omega) + have hg_mid : stepGuards ⟨true, (0, y - 3) :: p.1, p.2, d - 1, 0, 2 * d, ds⟩ = true := by + rw [hy_sub]; dsimp only [stepGuards]; rw [if_pos hm_od, hmrg, if_pos rfl] + simpa only [Nat.add_zero] using hg1 + have hs_mid : stepSegs ⟨true, (0, y - 3) :: p.1, p.2, d - 1, 0, 2 * d, ds⟩ = + ⟨false, p.1, p.2, y, 1, 0, (d - 1) :: ds⟩ := by + rw [hy_sub]; dsimp only [stepSegs]; rw [if_pos hm_od, hmrg, if_pos rfl] + have hc_eq : 0 + (y - 4) + 2 * 0 + 4 = y := by omega + have hd_eq : d - 1 + 0 = d - 1 := by omega + rw [hc_eq, hd_eq] + apply chainLeadsUpTo_step1 hg_mid + rw [hs_mid] + have hds_d1 : ((d - 1) :: ds) = [d - 1] ∨ ((d - 1) :: ds) = [d - 1, 0] := by + rcases hds with rfl | rfl <;> [exact Or.inl rfl; exact Or.inr rfl] + exact chainLeadsUpTo_here (rootInv_of_D (d := d - 1) (by omega) hds_d1 + (validTail40_of_validSegs40 hvp) (by omega) (by decide) (by omega) + (by omega) (by omega) (by omega)) + +theorem root0A_advances {s : SegState} + (hb : s.b = false) (hmrg : s.mrg = 0) (hr : Root0A s) : + ChainAdvances s RootInv := by + obtain ⟨hds, hc, hk, z1, m0, m1, rest, hsegs, hm0, hz1, hv⟩ := hr + rcases s with ⟨b, segs, zl, cp1, kb, mrg, ds⟩ + dsimp only at hb hmrg hds hc hk hsegs hm0 hz1 hv + subst hb hmrg hds hc hk hsegs + rcases hm0 with rfl | rfl + · refine ⟨rfl, fun _ => ?_⟩ + dsimp only [stepSegs] + exact chainLeadsUpTo_here (rootInv_of_D (d := 10) (by decide) (Or.inl rfl) hv + (by decide) (by decide) (by decide) + (by dsimp only [fzOf]; omega) (by dsimp only [fzOf]; omega) (by dsimp only [fzOf]; omega)) + · refine ⟨rfl, fun _ => ?_⟩ + dsimp only [stepSegs] + exact chainLeadsUpTo_here (rootInv_of_D (d := 9) (by decide) (Or.inl rfl) hv + (by decide) (by decide) (by decide) + (by dsimp only [fzOf]; omega) (by dsimp only [fzOf]; omega) (by dsimp only [fzOf]; omega)) + +theorem root0B_advances {s : SegState} + (hb : s.b = false) (hmrg : s.mrg = 0) (hr : Root0B s) : + ChainAdvances s RootInv := by + obtain ⟨hds, hvt, hc, hk1, hkc, hfz7, hcz8, h8, h39, h9⟩ := hr + rcases s with ⟨b, segs, zl, c, k, mrg, ds⟩ + dsimp only at hb hmrg hds hvt hc hk1 hkc hfz7 hcz8 h8 h39 h9 + subst hb hmrg + rcases dec_or (39 ≤ fzOf segs zl ∧ 42 ≤ c + fzOf segs zl) with ⟨hfz39, hcz42⟩ | hlow + · have hS0 : SafeStack 19 ds := safeStack_0 hds + obtain ⟨hox39, _⟩ := ox_bounds_relaxed hc hk1 hkc (by omega) hcz42 (by omega) + refine chainAdvances_trans + (fbound_advances (by decide) hS0 hvt hc hk1 hkc (by omega) hcz42 (by omega) (by omega)) ?_ + intro s' hex N + rcases hex with ⟨phi, hphi, hb⟩ | ⟨y, phi, hy, hphi38, _, hb⟩ + · exact bounce_0_leads hb hds (by dsimp only [odw] at hphi; omega) + · have hds_y : (y :: ds) = [y] ∨ (y :: ds) = [y, 0] := by + rcases hds with rfl | rfl <;> [exact Or.inl rfl; exact Or.inr rfl] + exact bounce_d_leads hb hds_y (Or.inr (Or.inr (Or.inr (Or.inr ⟨by omega, hphi38⟩)))) + · rcases segs with _ | ⟨⟨z0, m0⟩, rest⟩ + · dsimp only [fzOf, ValidTail40] at hvt hlow; omega + · dsimp only [fzOf, ValidTail40] at hvt hfz7 hcz8 h39 hlow + have hv_rest : ValidSegs40 rest zl := hvt + cases m0 with + | zero => + exact step_m0_zero_0_advances hds hv_rest hc hk1 hkc hcz8 + | succ m' => + have hphiw : GoodPhiW (c + z0 - 1) ds false = true := goodPhiW_0 hds (by omega) + have hds_cz : ((c + z0) :: ds) = [c + z0] ∨ ((c + z0) :: ds) = [c + z0, 0] := by + rcases hds with rfl | rfl <;> [exact Or.inl rfl; exact Or.inr rfl] + have hds_cz1 : ((c + z0 + 1) :: ds) = [c + z0 + 1] ∨ + ((c + z0 + 1) :: ds) = [c + z0 + 1, 0] := by + rcases hds with rfl | rfl <;> [exact Or.inl rfl; exact Or.inr rfl] + have hfz_r : 40 ≤ fzOf rest zl := fzOf_ge_40 hv_rest + rcases dec_or (m' + 1 = 1) with hm1 | hm_gt1 + · have hm0_eq : m' = 0 := by omega + subst hm0_eq + have hg : stepGuards ⟨false, (z0, 1) :: rest, zl, c, k, 0, ds⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) ds false && if 1 = 1 then GoodPsi (c + z0) ds else _) = + true + rw [hphiw, Bool.true_and, if_pos rfl] + exact goodPsi_0 hds (by omega) + refine ⟨hg, fun _ => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo _ (if 1 = 1 then _ else _) _ + rw [if_pos rfl] + exact chainLeadsUpTo_here (rootInv_of_D (d := c + z0 + 1) (by omega) hds_cz1 + (validTail40_of_validSegs40 hv_rest) (by omega) (by decide) (by omega) + (by omega) (by omega) (by omega)) + · have hpsi_cz : GoodPsi (c + z0 - 1) ds = true := goodPsi_0 hds (by omega) + rcases dec_or ((m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10) with hev_sm | hnot_ev + · have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, ds⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) ds false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) ds && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else _) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, if_pos hev_sm] + refine ⟨hg, fun _ => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo _ (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else _) _ + rw [if_neg hm_gt1, if_pos hev_sm] + exact chainLeadsUpTo_here (rootInv_of_D (d := c + z0) (by omega) hds_cz + (validTail40_of_validSegs40 hv_rest) (by omega) (by omega) (by omega) + (by omega) (by omega) (by omega)) + · -- Helper for `bounce_d_leads` at `phi >= k + 2 * z0` when `10 <= c + z0`: + have h_bounce_cz : 10 ≤ c + z0 → ∀ phi, k + 2 * z0 ≤ phi → + (c + z0 = 8 ∧ (phi = 16 ∨ phi = 17 ∨ 38 ≤ phi)) ∨ + (c + z0 = 9 ∧ 19 ≤ phi) ∨ + (10 ≤ c + z0 ∧ c + z0 ≤ 18 ∧ 19 ≤ phi ∧ + (12 ≤ c + z0 → (c + z0) % 2 = 0 → 23 ≤ phi)) ∨ + (c + z0 = 19 ∧ 37 ≤ phi) ∨ + (20 ≤ c + z0 ∧ 38 ≤ phi) := by + intro hd10 phi hphi_kz + rcases dec_or (39 ≤ z0) with hz39 | hz_lt39 + · rcases dec_or (c + z0 ≤ 18) with h18 | h19 + · omega + · rcases dec_or (c + z0 = 19) with h_eq19 | h20 + · omega + · exact Or.inr (Or.inr (Or.inr (Or.inr ⟨by omega, by omega⟩))) + · rcases h39 (by omega) with ⟨rfl, rfl⟩ | ⟨rfl, rfl, hz20⟩ + · rcases dec_or (1 + z0 ≤ 18) with h_le18 | h_ge19 + · exact Or.inr (Or.inr (Or.inl ⟨by omega, h_le18, by omega, + fun _ _ => by omega⟩)) + · rcases dec_or (1 + z0 = 19) with h_eq19 | h_ge20 + · exact Or.inr (Or.inr (Or.inr (Or.inl ⟨h_eq19, by omega⟩))) + · exact Or.inr (Or.inr (Or.inr (Or.inr ⟨by omega, by omega⟩))) + · exact Or.inr (Or.inr (Or.inr (Or.inr ⟨by omega, by omega⟩))) + rcases dec_or ((m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11) with hod_sm | hbig_m + · rcases dec_or (c + z0 = 8) with hcz_eq8 | hcz_ge9 + · obtain ⟨m0_, rest_, hseg_eq, rfl, rfl, rfl, hfz44⟩ := h8 hcz_eq8 + injection hseg_eq with hhd htl + injection hhd with hz0_eq _ + subst hz0_eq htl + clear h8 h9 h39 + have hg : stepGuards ⟨false, (7, m' + 1) :: rest, zl, 1, 1, 0, [0]⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW 7 [0] false && + if m' + 1 = 1 then _ else GoodPsi 7 [0] && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 40 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 41 then + GoodDs [17, 8, 0] else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_pos hod_sm] + rfl + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 40 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 41 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_pos hod_sm] + have hm_sub : m' + 1 - 1 = m' := by omega + rw [hm_sub] + have hox43 : 43 ≤ ox (1 + 2 * fzOf rest zl) (m' + fzOf rest zl) ∧ + 42 ≤ odw (1 + 2 * fzOf rest zl) (m' + fzOf rest zl) := by + obtain ⟨q, r, hr_lt, heq, hox_eq⟩ := + ox_spec_lt (kz := 1 + 2 * fzOf rest zl) (cz := m' + fzOf rest zl) (by omega) + dsimp only [odw] + rw [hox_eq] + omega + have hfb := (excursion_bundle N).1 39 [17, 8, 0] rest zl m' 1 + (by decide) safeStack_17_8_0 (validTail40_of_validSegs40 hv_rest) + (by omega) (by decide) (by omega) (by omega) (by omega) (by omega) (by omega) + refine chainLeadsUpTo_trans hfb ?_ + intro m1 s_mid _ hex + rcases hex with ⟨phi, hphi, hb⟩ | ⟨y, phi, hy, hphi38, _, hb⟩ + · exact pop_17_8_0_leads hb (by omega) + · exact pop_y_17_8_0_leads hb (by omega) hphi38 + · clear h8 + rcases dec_or (c + z0 = 9) with hcz_eq9 | hcz_ge10 + · have hck1 : c = 1 ∧ k = 1 := by + rcases h39 (by clear h9; omega) with h | ⟨_, _, hz20⟩ + · exact h + · clear h9 h39; omega + rcases hck1 with ⟨rfl, rfl⟩ + clear h39 + have hz8 : z0 = 8 := by clear h9; omega + subst hz8 + have hm'2 : 2 ≤ m' := by clear h9; have := hod_sm.1; omega + have hm'3 : 3 ≤ m' + 1 := Nat.succ_le_succ hm'2 + have h9_props := h9 8 (m' + 1) rest rfl hcz_eq9 hm'3 hod_sm.1 + clear h9 + have hm_sub : m' + 1 - 1 = m' := by omega + rw [hm_sub] at h9_props + have hS_19 : SafeStack 43 (19 :: 9 :: ds) := by + rcases hds with rfl | rfl + · exact safeStack_19_9 + · exact safeStack_19_9_0 + have hg : stepGuards ⟨false, (8, m' + 1) :: rest, zl, 1, 1, 0, ds⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW 8 ds false && + if m' + 1 = 1 then _ else GoodPsi 8 ds && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 44 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 45 then + GoodDs (19 :: 9 :: ds) else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_pos hod_sm] + exact hS_19.2.1 + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 44 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 45 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_pos hod_sm, hm_sub] + have hne1_19 : (19 :: 9 :: ds) ≠ [1] := by + intro h; injection h with h1; omega + refine chainLeadsUpTo_trans + (fhigh_ext hne1_19 hS_19 hv_rest hm'2 + h9_props.1 h9_props.2.1 h9_props.2.2) ?_ + intro m1 s_mid _ hex + rcases hex with (⟨phi, hphi, hb⟩ | ⟨y, phi, hy49, hpc, hb⟩) | + ⟨y, phi, hy53, hy_od, hphi88, hb⟩ + · exact pop_19_9_leads hb hds (by omega) + · exact pop_y_19_9_leads hb hds hy49 + (hpc.imp id Or.inl) + · exact pop_y_19_9_leads hb hds (by omega) (Or.inr (Or.inr ⟨hy53, hy_od, hphi88⟩)) + · -- `10 <= c + z0`: + have hd10 : 10 ≤ c + z0 := by omega + have hS_d : SafeStack 19 ((c + z0) :: ds) := safeStack19_d_ds hd10 hds + have hne1_d : ((c + z0) :: ds) ≠ [1] := by + intro h; injection h with h1; omega + have hx1_21 : 21 ≤ k + 2 * z0 + 2 := by + rcases dec_or (39 ≤ z0) with hz39 | hz_lt39 + · omega + · rcases h39 (by omega) with ⟨rfl, rfl⟩ | ⟨rfl, rfl, _⟩ <;> omega + have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, ds⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) ds false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) ds && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then + GoodDs ((k + 2 * z0 + 2) :: (c + z0) :: ds) else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_pos hod_sm] + exact hS_d.2.2 (k + 2 * z0 + 2) (by omega) + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_pos hod_sm] + have hm_sub : m' + 1 - 1 = m' := by omega + rw [hm_sub] + set x1 := k + 2 * z0 + 2 + rcases dec_or (x1 ≤ 47) with hx47 | hx48 + · have hx_lo : 23 ≤ x1 ∨ (x1 = 21 ∧ SafeStack 19 ((c + z0) :: ds)) := by + rcases dec_or (x1 = 21) with h21 | hne21 + · exact Or.inr ⟨h21, hS_d⟩ + · rcases dec_or (39 ≤ z0) with hz39 | hz_lt39 + · omega + · rcases h39 (by omega) with ⟨rfl, rfl⟩ | ⟨rfl, rfl, _⟩ <;> omega + exact loop_k1_le47 hne1_d (safeStack_mono (by decide) hS_d) + hx_lo hx47 hv_rest (by omega) + (fun _ z phi _ hz hphi38 _ hbz => + pop_y_d_leads hbz hd10 hds (by omega) hphi38) + (fun _ _ _ hb1 => + bounce_d_leads hb1 hds_cz (h_bounce_cz hd10 (x1 - 1) (by omega))) + (fun _ _ _ hb2 => + bounce_d_leads hb2 hds_cz (h_bounce_cz hd10 (x1 - 2) (by omega))) + (fun _ c' k' p1 p2 _ hc' hk'41 hk'c hvp => by + subst hc' + have hfp := fzOf_ge_40 hvp + exact chainLeadsUpTo_here (rootInv_of_D (d := c + z0) (by omega) hds_cz + (validTail40_of_validSegs40 hvp) (by omega) (by omega) hk'c + (by omega) (by omega) (by omega))) + · exact chainLeadsUpTo_trans + ((excursion_bundle N).2 19 ((c + z0) :: ds) rest zl m' 1 x1 39 0 + (by decide) hS_d (Or.inl hne1_d) hv_rest + (by omega) (by decide) (by omega) (by decide) (by omega) + (by omega) (by omega) (by omega) (by omega)) + (fun _ _ _ hex => by + rcases hex with ⟨phi, hphi, hb⟩ | ⟨y, phi, hy, hphi38, _, hb⟩ + · have hb_cases : + (c + z0 = 8 ∧ (phi = 16 ∨ phi = 17 ∨ 38 ≤ phi)) ∨ + (c + z0 = 9 ∧ 19 ≤ phi) ∨ + (10 ≤ c + z0 ∧ c + z0 ≤ 18 ∧ 19 ≤ phi ∧ + (12 ≤ c + z0 → (c + z0) % 2 = 0 → 23 ≤ phi)) ∨ + (c + z0 = 19 ∧ 37 ≤ phi) ∨ + (20 ≤ c + z0 ∧ 38 ≤ phi) := by + rcases dec_or (c + z0 ≤ 18) with h_le18 | h_ge19 + · exact Or.inr (Or.inr (Or.inl ⟨hd10, h_le18, by omega, + fun _ _ => by omega⟩)) + · rcases dec_or (c + z0 = 19) with h_eq19 | h_ge20 + · exact Or.inr (Or.inr (Or.inr (Or.inl ⟨h_eq19, by omega⟩))) + · exact Or.inr (Or.inr (Or.inr (Or.inr ⟨by omega, hphi⟩))) + exact bounce_d_leads hb hds_cz hb_cases + · exact pop_y_d_leads hb hd10 hds (by omega) hphi38) + · -- `m0 >= 2 * kz + 12`: + have hg : stepGuards ⟨false, (z0, m' + 1) :: rest, zl, c, k, 0, ds⟩ = true := by + dsimp only [stepGuards] + change (GoodPhiW (c + z0 - 1) ds false && + if m' + 1 = 1 then _ else GoodPsi (c + z0 - 1) ds && + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then true else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else true) = true + rw [hphiw, Bool.true_and, if_neg hm_gt1, hpsi_cz, Bool.true_and, + if_neg hnot_ev, if_neg hbig_m] + refine ⟨hg, fun N => ?_⟩ + dsimp only [stepSegs] + change ChainLeadsUpTo N (if m' + 1 = 1 then _ else + if (m' + 1) % 2 = 0 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 10 then _ else + if (m' + 1) % 2 = 1 ∧ m' + 1 ≤ 2 * (k + 2 * z0) + 11 then _ else _) _ + rw [if_neg hm_gt1, if_neg hnot_ev, if_neg hbig_m] + have hnorm : normSeg 0 (m' + 1 - 4) = (0, (m' - 4) + 1) := by + dsimp only [normSeg]; rw [if_neg (by omega)]; congr 1; omega + rw [hnorm] + have hbc : IsBounce (k + 2 * z0 + 2) ((c + z0) :: ds) + ⟨true, (0, (m' - 4) + 1) :: rest, zl, k + 2 * z0 + 2, 0, + 2 * (k + 2 * z0) + 6, (c + z0) :: ds⟩ := by + have h := IsBounce.cons (z0 := 0) (m := m' - 4) (zl := zl) + (cp1 := k + 2 * z0 + 2) (kb := 0) (mrg := 2 * (k + 2 * z0) + 6) + (rest := rest) (ds := (c + z0) :: ds) hv_rest (by omega) + (by split_ifs <;> omega) + simpa only [Nat.add_zero] using h + rcases dec_or (c + z0 = 8) with h_eq8 | h_ge9 + · obtain ⟨m0_, rest_, hseg_eq, rfl, rfl, _, _⟩ := h8 h_eq8 + injection hseg_eq with hhd _ + injection hhd with hz0_eq _ + subst hz0_eq + exact bounce_d_leads hbc hds_cz (Or.inl ⟨rfl, Or.inr (Or.inl rfl)⟩) + · rcases dec_or (c + z0 = 9) with h_eq9 | h_ge10 + · have hck1 : c = 1 ∧ k = 1 := by + rcases h39 (by omega) with h | ⟨_, _, hz20⟩ + · exact h + · omega + rcases hck1 with ⟨rfl, rfl⟩ + exact bounce_d_leads hbc hds_cz (Or.inr (Or.inl ⟨h_eq9, by omega⟩)) + · exact bounce_d_leads hbc hds_cz (h_bounce_cz (by omega) (k + 2 * z0 + 2) + (by omega)) + +theorem root0_advances {s : SegState} + (hb : s.b = false) (hmrg : s.mrg = 0) (hr : Root0 s) : + ChainAdvances s RootInv := by + rcases hr with ha | hb0 + · exact root0A_advances hb hmrg ha + · exact root0B_advances hb hmrg hb0 + +-- ============================================================================ +-- Master Root Advancement & Unconditional `inv_s0` +-- ============================================================================ + +theorem root_advances : ∀ s, RootInv s → ChainAdvances s RootInv := by + intro s ⟨hb, hmrg, hroot⟩ + rcases hroot with h0 | h1 | h31 | hD | hD1 + · exact root0_advances hb hmrg h0 + · exact root1_advances hb hmrg h1 + · exact root31_advances hb hmrg h31 + · exact rootD_advances hb hmrg hD + · exact rootD1_advances hb hmrg hD1 + +def iterGuards : Nat → SegState → Bool + | 0, _ => true + | n + 1, s => stepGuards s && iterGuards n (stepSegs s) + +def iterStep : Nat → SegState → SegState + | 0, s => s + | n + 1, s => iterStep n (stepSegs s) + +theorem checkChainAux_of_iter (k : Nat) : + ∀ fuel s, iterGuards k s = true → + (∀ f, checkChainAux f (iterStep k s).b (encSegs (iterStep k s).segs (iterStep k s).zl) + (iterStep k s).cp1 (iterStep k s).kb (iterStep k s).mrg (iterStep k s).ds = true) → + checkChainAux fuel s.b (encSegs s.segs s.zl) s.cp1 s.kb s.mrg s.ds = true := by + induction k with + | zero => + intro fuel s _ h + exact h fuel + | succ k ih => + intro fuel s hg h + cases fuel with + | zero => rfl + | succ f => + dsimp only [iterGuards] at hg + have hg1 : stepGuards s = true := by + cases hgs : stepGuards s <;> simp_all + have hg2 : iterGuards k (stepSegs s) = true := by + cases hgs : stepGuards s <;> simp_all + rw [checkChainAux_eq_of_guards f s hg1] + exact ih f (stepSegs s) hg2 h + +theorem inv_s0 : Inv (.ModeB_ge3 [] 1 1 []) := by + refine ⟨rfl, fun fuel => ?_⟩ + change checkChainAux fuel true (encSegs [] 0) 3 0 8 [1] = true + have hg28 : iterGuards 28 ⟨true, [], 0, 3, 0, 8, [1]⟩ = true := rfl + have hs28 : iterStep 28 ⟨true, [], 0, 3, 0, 8, [1]⟩ = + ⟨false, [(56, 223)], 489, 10, 21, 0, []⟩ := rfl + refine checkChainAux_of_iter 28 fuel ⟨true, [], 0, 3, 0, 8, [1]⟩ hg28 (fun f => ?_) + rw [hs28] + exact checkChainAux_true_of_advances root_advances f + ⟨false, [(56, 223)], 489, 10, 21, 0, []⟩ + (rootInv_of_0B (Or.inl rfl) ⟨(fun _ h => nomatch h), + by decide⟩ (by decide) (by decide) (by decide) + (by decide) (by decide) (fun h => absurd h (by decide)) (fun h => absurd h (by decide)) + (fun _ _ _ _ hcz9 => absurd hcz9 (by decide))) + + +end ChainClosure + +theorem is_does_not_halt : IsNotHalt target_tm := by + exact nonhalt_of_Inv_s0 ChainClosure.inv_s0 + +end + +public section + +theorem is_not_halt : IsNotHalt target := by + rw [target_eq] + exact is_does_not_halt + +end + +end BusyBeaver.M_1RB0RA_0RC0LE_1LD1RF_1LB1RD_1LD1LE_HHH1RA diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RA_0RC0RE_0LDHHH_1LE1LD_1LF0LD_1RA0RD.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RA_0RC0RE_0LDHHH_1LE1LD_1LF0LD_1RA0RD.lean new file mode 100644 index 00000000..19495f90 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RA_0RC0RE_0LDHHH_1LE1LD_1LF0LD_1RA0RD.lean @@ -0,0 +1,1542 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RA_0RC0RE_0LDHHH_1LE1LD_1LF0LD_1RA0RD + +@[expose] public section + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_0RC0RE_0LDHHH_1LE1LD_1LF0LD_1RA0RD" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +end + +namespace Solution + +open Counter WordCalculus WordCalculus.Word + +@[expose] public section + +variable {Γ₀ Λ₀ α : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 + +abbrev HalfTape := ListBlank (Fin 2) +abbrev BitWord := List (Fin 2) +abbrev WordList := List Word + +@[simp] theorem multiStep_zero (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : + multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : + multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] +@[simp] theorem cons_zero_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : HalfTape).head = 0 := rfl +@[simp] theorem default_tail : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append, append_cons, ih] + +theorem step_one {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] + +theorem step_plus {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1, by decide +kernel, step_one tm c_1 c_2 h⟩ + +theorem multiStep_add {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n + m} c_3 := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem plus_to_star {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem plus_trans {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, by omega, multiStep_trans tm c_1 c_2 c_3 n m hn hm⟩ + +theorem plus_star_trans {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), + multiStep_trans tm c_1 c_2 c_3 n m hn hm⟩ + +theorem step_star_trans {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + plus_star_trans (step_plus tm c_1 c_2 h₁) h₂ + +theorem eq_state_head {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c1 c2 : Cfg Γ Λ} + (hq : c1.q = c2.q) (hh : c1.tape.head = c2.tape.head) (h : c1 = c2) : c1 [tm]⊢* c2 := + h ▸ ⟨0, rfl⟩ + +theorem step_R {Λ : Type*} [Inhabited Λ] + {tm : Machine (Fin 2) Λ} {q q' : Λ} {h w : Fin 2} {l r : HalfTape} {c_3 : Cfg (Fin 2) Λ} + (hm : tm q h = some (some q', Stmt.write w Dir.right)) + (h₂ : (⟨some q', ⟨r.head, w >> l, r.tail⟩⟩ : Cfg (Fin 2) Λ) [tm]⊢* c_3) : + (⟨some q, ⟨h, l, r⟩⟩ : Cfg (Fin 2) Λ) [tm]⊢⁺ c_3 := + step_star_trans (by simp [step, hm, Turing.Tape.write, Turing.Tape.move]) h₂ + +theorem step_L {Λ : Type*} [Inhabited Λ] + {tm : Machine (Fin 2) Λ} {q q' : Λ} {h w : Fin 2} {l r : HalfTape} {c_3 : Cfg (Fin 2) Λ} + (hm : tm q h = some (some q', Stmt.write w Dir.left)) + (h₂ : (⟨some q', ⟨l.head, l.tail, w >> r⟩⟩ : Cfg (Fin 2) Λ) [tm]⊢* c_3) : + (⟨some q, ⟨h, l, r⟩⟩ : Cfg (Fin 2) Λ) [tm]⊢⁺ c_3 := + step_star_trans (by simp [step, hm, Turing.Tape.write, Turing.Tape.move]) h₂ + +macro "finish" : tactic => + `(tactic| refine eq_state_head (by with_reducible rfl) rfl rfl) + +macro "step" : tactic => + `(tactic| (try refine plus_to_star ?_) <;> + (first | refine step_R (by + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, + Turing.ListBlank.head_cons, default_head] + rfl) ?_ + | refine step_L (by + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, + Turing.ListBlank.head_cons, default_head] + rfl) ?_) <;> + (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons, cons_zero_default, default_head, default_tail])) + +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) + +abbrev t : BitWord := [1, 1, 0, 0] +abbrev d0 : BitWord := [0, 0] +abbrev d1 : BitWord := [1, 0] +abbrev one : BitWord := [1] +abbrev lh : HalfTape := [1, 0, 1] +> default +abbrev w_pre : BitWord := t ++ t ++ one + +@[simp] theorem d0_append_default : d0 +> (default : HalfTape) = default := by + simp [d0] + +inductive Call where + | ch + | cj + | cp + | ca + +def CallStep (tm : Machine (Fin 2) (Fin 6)) + (cfgR : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6)) + (cfgL : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6)) + (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l, (cfgR l c r1) [tm]⊢⁺ (cfgL l r2) + +@[simp] theorem pow_zero_list {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list {α : Type*} (l : List α) (n : Nat) : + l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem pow_one_add_list {α : Type*} (l : List α) (n : Nat) : + l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem pow_one_list {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l + +theorem pow_add_list {α : Type*} (l : List α) (m n : Nat) : + l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm, pow_succ_list, pow_succ_list, ih, List.append_assoc] + +theorem seg4 {tm : Machine (Fin 2) (Fin 6)} + {cfgR : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6)} + {cfgL : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6)} + {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r, (cfgR l c (w1 +> r)) [tm]⊢⁺ (cfgL l (w2 +> r))) : + Seg (CallStep tm cfgR cfgL) [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) + +theorem seg2 {tm : Machine (Fin 2) (Fin 6)} + {cfgR : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6)} + {cfgL : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6)} + {c_in c_out : Call} {w1 w2 : BitWord} (mid : BitWord) + (h1 : ∀ l r, (cfgR l c_in (w1 +> r)) [tm]⊢⁺ (cfgR (mid +> l) c_out r)) + (h2 : ∀ l r, (cfgL (mid +> l) r) [tm]⊢⁺ (cfgL l (w2 +> r))) : + Seg (CallStep tm cfgR cfgL) [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1, hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact plus_trans (h1 l r1) (plus_trans (hc1 (mid +> l)) (h2 l r2)) + +theorem seg5 {tm : Machine (Fin 2) (Fin 6)} + {cfgR : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6)} + {cfgL : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6)} + {c_in c1 c2 : Call} {w1 w2 : BitWord} (mid1 mid2 : BitWord) + (h1 : ∀ l r, (cfgR l c_in (w1 +> r)) [tm]⊢⁺ (cfgR (mid1 +> l) c1 r)) + (h2 : ∀ l r, (cfgL (mid1 +> l) r) [tm]⊢⁺ (cfgR (mid2 +> l) c2 r)) + (h3 : ∀ l r, (cfgL (mid2 +> l) r) [tm]⊢⁺ (cfgL l (w2 +> r))) : + Seg (CallStep tm cfgR cfgL) [c_in] [c1, c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1, hrest⟩ + rcases hrest with _ | ⟨hc2, hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact plus_trans (h1 l r1) + (plus_trans (hc1 (mid1 +> l)) + (plus_trans (h2 l _) + (plus_trans (hc2 (mid2 +> l)) (h3 l r3)))) + +structure BaseRules (stepRel : Call → HalfTape → HalfTape → Prop) : Prop where + seg_cp_t : Seg stepRel [.cp] [.ch] t (t ++ [0]) + seg_cj_t : Seg stepRel [.cj] [.ch] t (t ++ one) + seg_ch_t0 : Seg stepRel [.ch] [.cj] (t ++ [0]) t + seg_ch_t1 : Seg stepRel [.ch] [.cj, .ch] (t ++ one) t + seg_ch_t : Seg stepRel [.ch] [.ch, .ch] t t + seg_cp_d10 : Seg stepRel [.cp] [] (d1 ++ d0) (t ++ one) + seg_cj_d10 : Seg stepRel [.cj] [.cj] (d1 ++ d0) t + seg_cp_d11 : Seg stepRel [.cp] [.cp] (d1 ++ d1) t + seg_cj_d11 : Seg stepRel [.cj] [.cp, .ch] (d1 ++ d1) t + seg_cj_d0 : Seg stepRel [.cj] [] d0 (d0 ++ one) + seg_ch_d01 : Seg stepRel [.ch] [] (d0 ++ one) (d1 ++ one) + seg_ch_d11 : Seg stepRel [.ch] [.cj] (d1 ++ one) d0 + seg_cj_d1 : Seg stepRel [.cj] [.cp] d1 d0 + seg_ch_d0 : Seg stepRel [.ch] [] d0 d1 + seg_ch_d1 : Seg stepRel [.ch] [.ch] d1 d0 + side_ch_blank : Side stepRel [.ch] default (d1 +> default) + +variable {stepRel : Call → HalfTape → HalfTape → Prop} + +theorem seg_ch_pow_t (hb : BaseRules stepRel) (n : Nat) : + Seg stepRel ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact Seg_nil t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [pow_succ_list, h_eq, pow_add_list] + exact Seg_par hb.seg_ch_t ih + +theorem seg_ch_pair_pow {w2 : BitWord} + (hw : Seg stepRel [.ch, .ch] [.ch] w2 w2) (n : Nat) : + Seg stepRel ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact Seg_nil w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq, pow_add_list, pow_succ_list] + exact Seg_par hw ih + +theorem seg_ch2_d0 (hb : BaseRules stepRel) : Seg stepRel [.ch, .ch] [.ch] d0 d0 := + Seg_par hb.seg_ch_d0 hb.seg_ch_d1 + +theorem seg_ch2_d1 (hb : BaseRules stepRel) : Seg stepRel [.ch, .ch] [.ch] d1 d1 := + Seg_par hb.seg_ch_d1 hb.seg_ch_d0 + +theorem seg_ch_even_d0 (hb : BaseRules stepRel) (n : Nat) : + Seg stepRel ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d0 d0 := + seg_ch_pair_pow (seg_ch2_d0 hb) n + +theorem seg_ch_odd_d0 (hb : BaseRules stepRel) (n : Nat) : + Seg stepRel ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ n) d0 d1 := by + simpa only [pow_one_add_list, List.cons_append, List.nil_append] using + Seg_par hb.seg_ch_d0 (seg_ch_pair_pow (seg_ch2_d1 hb) n) + +theorem seg_ch_even_d1 (hb : BaseRules stepRel) (n : Nat) : + Seg stepRel ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d1 d1 := + seg_ch_pair_pow (seg_ch2_d1 hb) n + +theorem seg_ch_odd_d1 (hb : BaseRules stepRel) (n : Nat) : + Seg stepRel ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ (1 + n)) d1 d0 := by + simpa only [pow_one_add_list, List.cons_append, List.nil_append] using + Seg_par hb.seg_ch_d1 (seg_ch_pair_pow (seg_ch2_d0 hb) n) + +theorem seg_cp_ch_t (hb : BaseRules stepRel) (n : Nat) : + Seg stepRel ([.cp] ++ [.ch] ^ (1 + n)) ([.ch, .cj] ++ [.ch] ^ (n * 2)) t t := by + simpa only [pow_one_add_list, List.cons_append, List.nil_append] using + Seg_par (Seg_par hb.seg_cp_t hb.seg_ch_t0) (seg_ch_pow_t hb n) + +theorem seg_cj_ch_t (hb : BaseRules stepRel) (n : Nat) : + Seg stepRel ([.cj] ++ [.ch] ^ (1 + n)) ([.ch, .cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [pow_one_add_list, List.cons_append, List.nil_append] using + Seg_par (Seg_par hb.seg_cj_t hb.seg_ch_t1) (seg_ch_pow_t hb n) + +theorem seg_cp_ch_d10 (hb : BaseRules stepRel) (n : Nat) : + Seg stepRel ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [pow_one_add_list, List.cons_append, List.nil_append] using + Seg_par (Seg_par hb.seg_cp_d10 hb.seg_ch_t1) (seg_ch_pow_t hb n) + +theorem seg_cj_ch_d10 (hb : BaseRules stepRel) (n : Nat) : + Seg stepRel ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + Seg_par hb.seg_cj_d10 (seg_ch_pow_t hb n) + +theorem seg_cp_ch_d11 (hb : BaseRules stepRel) (n : Nat) : + Seg stepRel ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + Seg_par hb.seg_cp_d11 (seg_ch_pow_t hb n) + +theorem seg_cj_ch_d11 (hb : BaseRules stepRel) (n : Nat) : + Seg stepRel ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [pow_one_add_list, List.cons_append, List.nil_append] using + Seg_par hb.seg_cj_d11 (seg_ch_pow_t hb n) + +theorem seg_cj_ch_even_d0 (hb : BaseRules stepRel) (n : Nat) : + Seg stepRel ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg stepRel [.cj, .ch, .ch] [.cj] d0 d0 := + Seg_par hb.seg_cj_d0 (Seg_par hb.seg_ch_d01 hb.seg_ch_d11) + have h1 := Seg_par h0 (seg_ch_pair_pow (seg_ch2_d0 hb) n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq, pow_one_add_list, List.cons_append, List.nil_append] using h1 + +theorem seg_cj_ch_even_d10 (hb : BaseRules stepRel) (n : Nat) : + Seg stepRel ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + Seg_par hb.seg_cj_d1 (seg_ch_pair_pow (seg_ch2_d0 hb) n) + +theorem seg_cj_ch_base_d01 (hb : BaseRules stepRel) : + Seg stepRel [.cj, .ch] [] d0 (d1 ++ one) := + Seg_par hb.seg_cj_d0 hb.seg_ch_d01 + +theorem seg_cj_ch_odd_d01 (hb : BaseRules stepRel) (n : Nat) : + Seg stepRel ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg stepRel [.cj, .ch, .ch, .ch] [.cj] d0 d1 := + Seg_par hb.seg_cj_d0 (Seg_par hb.seg_ch_d01 (Seg_par hb.seg_ch_d11 hb.seg_ch_d0)) + have h1 := Seg_par h0 (seg_ch_pair_pow (seg_ch2_d1 hb) n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq, pow_one_add_list, List.cons_append, List.nil_append] using h1 + +theorem seg_cj_ch_odd_d11 (hb : BaseRules stepRel) (n : Nat) : + Seg stepRel ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg stepRel [.cj, .ch] [.cp] d1 d1 := Seg_par hb.seg_cj_d1 hb.seg_ch_d0 + have h1 := Seg_par h0 (seg_ch_pair_pow (seg_ch2_d1 hb) n) + simpa only [pow_one_add_list, List.cons_append, List.nil_append] using h1 + +inductive Num : Nat → BitWord → List Call → Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) + +theorem exists_num {k : Nat} (hK : 0 < k) : ∃ hs, Num k [] hs := by + rcases even_or_odd_mul_two k with ⟨a, rfl⟩ | ⟨a, rfl⟩ + · cases a with + | zero => omega + | succ a => + have heq : (a + 1) * 2 = 2 + a * 2 := by omega + rw [heq]; exact ⟨[.cj] ++ [.ch] ^ a, Num.even a⟩ + · exact ⟨[.cp] ++ [.ch] ^ a, Num.odd a⟩ + +theorem num_unique {k : Nat} {hs hs' : List Call} + (h1 : Num k [] hs) (h2 : Num k [] hs') : hs = hs' := by + cases h1 with + | @odd n => + generalize hk : 1 + n * 2 = k0 at h2 + cases h2 with + | @odd m => + have hnm : n = m := by omega + subst hnm; rfl + | even _ => omega + | @even n => + generalize hk : 2 + n * 2 = k0 at h2 + cases h2 with + | odd _ => omega + | @even m => + have hnm : n = m := by omega + subst hnm; rfl + +def NumRun (stepRel : Call → HalfTape → HalfTape → Prop) + (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs, Num k w hs → Side stepRel hs (w +> r) r' + +theorem numRun_zero {r r' : HalfTape} (h : NumRun stepRel 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl + +theorem numRun_d0_d0 (hb : BaseRules stepRel) {n : Nat} {r r' : HalfTape} + (hI : NumRun stepRel (n * 2) r r') : + NumRun stepRel (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := numRun_zero hI + subst hr' + rw [← append_assoc d0 one r] + exact Seg_apply hb.seg_cj_d0 (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine Seg_apply (seg_cj_ch_even_d0 hb n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using hI [] _ hN2 + +theorem numRun_d0_d1 (hb : BaseRules stepRel) {n : Nat} {r r' : HalfTape} + (hI : NumRun stepRel (n * 2) r r') : + NumRun stepRel (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := numRun_zero hI + subst hr' + rw [← append_assoc d1 one r] + exact Seg_apply (seg_cj_ch_base_d01 hb) (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine Seg_apply (seg_cj_ch_odd_d01 hb n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using hI [] _ hN2 + +theorem evalWords_eq_default_of_zero {A_val H : Nat} {da : WordList} + (hD : DigitVal A_val H da) (hZ : A_val = 0) : + evalWords da default = default := by + induction hD with + | nil => rfl + | @zero A_val H u _ ih => + have hA0 : A_val = 0 := by omega + dsimp only [evalWords] + rw [ih hA0, d0_append_default] + | one _ => omega + +theorem numRun_of_digitVal (hb : BaseRules stepRel) {A_val H : Nat} {da : WordList} + (hD : DigitVal A_val H da) (hPos : 0 < A_val) : + NumRun stepRel ((A_val - 1) * 2) default (evalWords da default) := by + induction hD with + | nil => omega + | @zero A_val H u _ ih => + have hA_pos : 0 < A_val := by omega + have hIH := ih hA_pos + have hs := numRun_d0_d0 hb hIH + rw [d0_append_default] at hs + have heq : (A_val * 2 - 1) * 2 = 2 + (A_val - 1) * 4 := by omega + dsimp [evalWords] + rwa [heq] + | @one A_val H u hDu ih => + cases A_val with + | zero => + change NumRun stepRel 0 default (d1 +> evalWords u default) + rw [evalWords_eq_default_of_zero hDu rfl] + intro w hs hN + generalize hk : 0 = k0 at hN + cases hN with + | zero => + have hd : d1 +> (default : HalfTape) = one +> default := by simp [d1, one] + rw [hd]; exact Side.nil (one +> default) + | odd _ => omega + | even _ => omega + | succ A_val => + have hA_pos : 0 < A_val + 1 := by omega + have hIH := ih hA_pos + have heq_in : (A_val + 1 - 1) * 2 = A_val * 2 := by omega + rw [heq_in] at hIH + have hs := numRun_d0_d1 hb hIH + rw [d0_append_default] at hs + have heq : (1 + (A_val + 1) * 2 - 1) * 2 = 4 + A_val * 4 := by omega + dsimp [evalWords] + rwa [heq] + +theorem seg_of_wordEffect (hb : BaseRules stepRel) {n : Nat} {u : WordList} + {b : Nat} {v : WordList} (hI : WordEffect n u b v) : + ∀ {A_val H : Nat}, DigitVal A_val H v → + Seg stepRel ([Call.ch] ^ n) ([Call.ch] ^ b) (wordsToBits u) (wordsToBits v) := by + induction hI with + | nil n => + intro A_val H _ + exact Seg_refl ([Call.ch] ^ n) + | T _ _ => + intro A_val H hD + exact False.elim (digitVal_not_cons_V hD) + | d00 _ ih => + intro A_val H hD + rcases digitVal_cons_K_inv hD with ⟨A', H', hD', _, _⟩ + exact Seg_seq (seg_ch_even_d0 hb _) (ih hD') + | d01 _ ih => + intro A_val H hD + rcases digitVal_cons_Q_inv hD with ⟨A', H', hD', _, _⟩ + exact Seg_seq (seg_ch_odd_d0 hb _) (ih hD') + | d10 _ ih => + intro A_val H hD + rcases digitVal_cons_Q_inv hD with ⟨A', H', hD', _, _⟩ + exact Seg_seq (seg_ch_even_d1 hb _) (ih hD') + | d11 _ ih => + intro A_val H hD + rcases digitVal_cons_K_inv hD with ⟨A', H', hD', _, _⟩ + exact Seg_seq (seg_ch_odd_d1 hb _) (ih hD') + +theorem num_seg_t (hb : BaseRules stepRel) {n : Nat} {hs hs' : List Call} + (hI : Num (3 + n) [] hs) (hJ : Num (2 + n * 2) [] hs') : + Seg stepRel hs ([Call.ch] ++ hs') t t := by + generalize hk1 : 3 + n = k1 at hI + generalize hk2 : 2 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = m * 2 := by omega + subst hq; rw [h1m]; exact seg_cp_ch_t hb m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq; rw [h1m]; exact seg_cj_ch_t hb m + +theorem num_seg_d10 (hb : BaseRules stepRel) {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (n * 2) [] hs') : + Seg stepRel hs hs' (d1 ++ d0) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq; rw [h1m]; exact seg_cp_ch_d10 hb m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + have hq : q = m * 2 := by omega + subst hq; exact seg_cj_ch_d10 hb m + +theorem num_seg_d11 (hb : BaseRules stepRel) {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg stepRel hs hs' (d1 ++ d1) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | @odd q => + have hq : q = m * 2 := by omega + subst hq; exact seg_cp_ch_d11 hb m + | even _ => omega + | @even m => + cases hJ with + | @odd q => + have hq : q = 1 + m * 2 := by omega + subst hq; exact seg_cj_ch_d11 hb m + | even _ => omega + +theorem num_seg_short00 (hb : BaseRules stepRel) {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg stepRel hs hs' d0 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 2 + q * 2 := by omega + subst hm; exact seg_cj_ch_even_d0 hb q + +theorem num_seg_short01 (hb : BaseRules stepRel) {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg stepRel hs hs' d1 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = q * 2 := by omega + subst hm; exact seg_cj_ch_even_d10 hb q + | even _ => omega + +theorem num_seg_short10 (hb : BaseRules stepRel) {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg stepRel hs hs' d0 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 3 + q * 2 := by omega + subst hm; exact seg_cj_ch_odd_d01 hb q + +theorem num_seg_short11 (hb : BaseRules stepRel) {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg stepRel hs hs' d1 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = 1 + q * 2 := by omega + subst hm; exact seg_cj_ch_odd_d11 hb q + | even _ => omega + +theorem seg_of_phaseScan (hb : BaseRules stepRel) + {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) : + ∀ {u : WordList} {n n' : Nat} {hs hs' : List Call}, + WordEffect n u n' v → Num k [] hs → Num k' [] hs' → + Seg stepRel (([Call.ch] ^ n) ++ hs) (([Call.ch] ^ n') ++ hs') + (wordsToBits u) (wordsToBits w) := by + induction hI with + | nil k => + intro u n n' hs hs' hE hN hN' + cases hE + rw [num_unique hN hN'] + exact Seg_refl (([Call.ch] ^ n) ++ hs') + | @T m _ _ _ _ _ _ ih => + intro u0 n0 n1 hs hs' hE hN hN' + cases hE with + | T hSub => + rcases exists_num (by omega : 0 < 2 + m * 2) with ⟨hs0, hN0⟩ + have hIH := ih hSub hN0 hN' + have hStep := Seg_par (seg_ch_pow_t hb n0) (num_seg_t hb hN hN0) + have heq : ([Call.ch] ^ (n0 * 2)) ++ ([Call.ch] ++ hs0) = + ([Call.ch] ^ (1 + n0 * 2)) ++ hs0 := by + have h1 : 1 + n0 * 2 = n0 * 2 + 1 := by omega + rw [h1, pow_add_list, pow_one_list, List.append_assoc] + rw [heq] at hStep + exact Seg_seq hStep hIH + | @pair0 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q, K] ++ u) at hE + rcases wordEffect_split_output [Q, K] hE with ⟨u1, u2, q, rfl, hL, hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases exists_num hPos with ⟨hs0, hN0⟩ + have hD10 : DigitVal 1 2 [Q, K] := DigitVal.one (DigitVal.zero DigitVal.nil) + have hStep := Seg_par (seg_of_wordEffect hb hL hD10) (num_seg_d10 hb hN hN0) + rw [wordsToBits_append] + exact Seg_seq hStep (ih hR hN0 hN') + | @pair1 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q, Q] ++ u) at hE + rcases wordEffect_split_output [Q, Q] hE with ⟨u1, u2, q, rfl, hL, hR⟩ + rcases exists_num (by omega : 0 < 1 + m * 2) with ⟨hs0, hN0⟩ + have hD11 : DigitVal 3 2 [Q, Q] := DigitVal.one (DigitVal.one DigitVal.nil) + have hStep := Seg_par (seg_of_wordEffect hb hL hD11) (num_seg_d11 hb hN hN0) + rw [wordsToBits_append] + exact Seg_seq hStep (ih hR hN0 hN') + | @short00 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1, u2, q, rfl, hL, hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases exists_num hPos with ⟨hs0, hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := Seg_par (seg_of_wordEffect hb hL hD0) (num_seg_short00 hb hN hN0) + rw [wordsToBits_append] + exact Seg_seq hStep (ih hR hN0 hN') + | @short01 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1, u2, q, rfl, hL, hR⟩ + rcases exists_num (by omega : 0 < 1 + m * 2) with ⟨hs0, hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := Seg_par (seg_of_wordEffect hb hL hD1) (num_seg_short01 hb hN hN0) + rw [wordsToBits_append] + exact Seg_seq hStep (ih hR hN0 hN') + | @short10 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1, u2, q, rfl, hL, hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases exists_num hPos with ⟨hs0, hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := Seg_par (seg_of_wordEffect hb hL hD0) (num_seg_short10 hb hN hN0) + rw [wordsToBits_append] + exact Seg_seq hStep (ih hR hN0 hN') + | @short11 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1, u2, q, rfl, hL, hR⟩ + rcases exists_num (by omega : 0 < 1 + m * 2) with ⟨hs0, hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := Seg_par (seg_of_wordEffect hb hL hD1) (num_seg_short11 hb hN hN0) + rw [wordsToBits_append] + exact Seg_seq hStep (ih hR hN0 hN') + +theorem numRun_d10_t (hb : BaseRules stepRel) {n : Nat} {r r' : HalfTape} + (hI : NumRun stepRel (n * 2) r r') : + NumRun stepRel (1 + n) (d1 +> (d0 +> r)) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil, ← append_assoc d1 d0 r] + cases m with + | zero => + have hn0 : n * 2 = 0 := by omega + rw [hn0] at hI + have hr' := numRun_zero hI + subst hr' + rw [← append_assoc t one r] + exact Seg_apply hb.seg_cp_d10 (Side.nil r) + | succ m => + have h1m : m + 1 = 1 + m := by omega + rw [h1m] + refine Seg_apply (seg_cp_ch_d10 hb m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : n * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil, ← append_assoc d1 d0 r] + refine Seg_apply (seg_cj_ch_d10 hb m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (m * 2)) := by + have hm : n * 2 = 2 + (m * 2) * 2 := by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 + +theorem numRun_of_phaseScan (hb : BaseRules stepRel) + {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) {u : WordList} {r' : HalfTape} + (hE : WordEffect 0 u 1 v) (hK : 0 < k') (hC : NumRun stepRel k' (d1 +> default) r') : + NumRun stepRel k (evalWords u default) (evalWords w r') := by + intro w0 hs hN + have hPosK : 0 < k := phaseScan_pos_of_out_pos hI hK + have hw0 : w0 = [] := by cases hN <;> first | rfl | omega + subst hw0 + rcases exists_num hK with ⟨hs', hN'⟩ + have hSeg := seg_of_phaseScan hb hI hE hN hN' + dsimp at hSeg + have hSide := Seg_apply hSeg (Side_append hb.side_ch_blank (hC [] hs' hN')) + rwa [wordsToBits_append_tape, wordsToBits_append_tape] at hSide + +theorem numRun_of_step (hb : BaseRules stepRel) {orig out : WordList} (hS : Step orig out) : + ∃ r, NumRun stepRel 12 (evalWords orig default) r ∧ evalWords out default = t +> r := by + cases hS with + | intro eff k v a b J A_val da hE hI hDA hSum => + have hposJ := pow_two_pos J + have hPosK : 0 < k := by omega + have hDFull : DigitVal k (J + 1) (da ++ [Q]) := by + have h := digitVal_append hDA (DigitVal.one DigitVal.nil) + have heq : A_val + 1 * 2 ^ J = k := by omega + rwa [heq] at h + have hC0 : NumRun stepRel ((k - 1) * 2) default (evalWords (da ++ [Q]) default) := + numRun_of_digitVal hb hDFull hPosK + have hC1 : NumRun stepRel k (d1 +> default) (evalWords (V :: (da ++ [Q])) default) := by + have h := numRun_d10_t hb hC0 + have hk : 1 + (k - 1) = k := by omega + rwa [hk, d0_append_default] at h + have hRun := numRun_of_phaseScan hb hI hE hPosK hC1 + rw [← evalWords_append] at hRun + exact ⟨evalWords (v ++ V :: (da ++ [Q])) default, hRun, rfl⟩ + +theorem cycle_ca_ch {tm : Machine (Fin 2) (Fin 6)} + {cfgR : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6)} + {cfgL : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6)} + (hb : BaseRules (CallStep tm cfgR cfgL)) + (hP : Seg (CallStep tm cfgR cfgL) [.ca] [.ch, .ch] t [1, 1, 0, 0, 0, 1, 1, 0, 0]) + (hQ : Seg (CallStep tm cfgR cfgL) [.ch] [.ch] [1, 1, 0, 0, 0, 1, 1, 0, 0] (t ++ t ++ one)) + (hS : ∀ r, (cfgL lh r) [tm]⊢⁺ (cfgR ([1] +> default) .ca r)) + (hT : ∀ r, (cfgL ([1] +> default) r) [tm]⊢⁺ (cfgR lh .ch r)) + {r r' : HalfTape} (hI : NumRun (CallStep tm cfgR cfgL) 12 r r') : + (cfgL lh (w_pre +> r)) [tm]⊢⁺ (cfgL lh (w_pre +> (t +> r'))) := by + have h1 : Seg (CallStep tm cfgR cfgL) [.ca, .ch] [.ch, .ch, .ch] t (t ++ t ++ one) := + Seg_par hP hQ + have h2 : Seg (CallStep tm cfgR cfgL) [.ch, .ch, .ch] ([.cj] ++ [.ch] ^ 5) (t ++ one) t := + Seg_par hb.seg_ch_t1 (seg_ch_pow_t hb 2) + have hR : Seg (CallStep tm cfgR cfgL) [.ca, .ch] ([.cj] ++ [.ch] ^ 5) w_pre (w_pre ++ t) := by + simpa only [w_pre, List.append_assoc, List.cons_append, List.nil_append] using Seg_seq h1 h2 + have h_num : Num 12 [] ([.cj] ++ [.ch] ^ 5) := Num.even 5 + have hC := hI [] ([.cj] ++ [.ch] ^ 5) h_num + have hSide := Seg_apply hR hC + rcases hSide with _ | ⟨hca, hrest⟩ + rcases hrest with _ | ⟨hch, hnil⟩ + cases hnil + have hs1 := plus_trans (hS (w_pre +> r)) (hca ([1] +> default)) + have hs2 := plus_trans (hT _) (hch lh) + have hs3 := plus_trans hs1 hs2 + rwa [append_assoc] at hs3 + +theorem cycle_ch_ca {tm : Machine (Fin 2) (Fin 6)} + {cfgR : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6)} + {cfgL : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6)} + (hb : BaseRules (CallStep tm cfgR cfgL)) + (hP : Seg (CallStep tm cfgR cfgL) [.ca] [.ch] t (t ++ t ++ one)) + (hR_step : ∀ r, (cfgL lh r) [tm]⊢⁺ (cfgR ([1, 1, 0, 1, 0, 1] +> default) .ch r)) + (hS_step : ∀ r, (cfgL ([1, 1, 0, 1, 0, 1] +> default) r) [tm]⊢⁺ (cfgR lh .ca r)) + {r r' : HalfTape} (hI : NumRun (CallStep tm cfgR cfgL) 12 r r') : + (cfgL lh (w_pre +> r)) [tm]⊢⁺ (cfgL lh (w_pre +> (t +> r'))) := by + have h1 : Seg (CallStep tm cfgR cfgL) [.ch, .ca] [.ch, .ch, .ch] t (t ++ t ++ one) := + Seg_par hb.seg_ch_t hP + have h2 : Seg (CallStep tm cfgR cfgL) [.ch, .ch, .ch] ([.cj] ++ [.ch] ^ 5) (t ++ one) t := + Seg_par hb.seg_ch_t1 (seg_ch_pow_t hb 2) + have hQ : Seg (CallStep tm cfgR cfgL) [.ch, .ca] ([.cj] ++ [.ch] ^ 5) w_pre (w_pre ++ t) := by + simpa only [w_pre, List.append_assoc, List.cons_append, List.nil_append] using Seg_seq h1 h2 + have h_num : Num 12 [] ([.cj] ++ [.ch] ^ 5) := Num.even 5 + have hC := hI [] ([.cj] ++ [.ch] ^ 5) h_num + have hSide := Seg_apply hQ hC + rcases hSide with _ | ⟨hch, hrest⟩ + rcases hrest with _ | ⟨hca, hnil⟩ + cases hnil + have hs1 := plus_trans (hR_step (w_pre +> r)) (hch ([1, 1, 0, 1, 0, 1] +> default)) + have hs2 := plus_trans (hS_step _) (hca lh) + have hs3 := plus_trans hs1 hs2 + rwa [append_assoc] at hs3 + +theorem step_sim {tm : Machine (Fin 2) (Fin 6)} + {cfgAt : HalfTape → Cfg (Fin 2) (Fin 6)} + (hb : BaseRules stepRel) + (h_cycle : ∀ {r r' : HalfTape}, NumRun stepRel 12 r r' → (cfgAt r) [tm]⊢⁺ (cfgAt (t +> r'))) + {orig out : WordList} (hS : Step orig out) : + (cfgAt (evalWords orig default)) [tm]⊢⁺ (cfgAt (evalWords out default)) := by + rcases numRun_of_step hb hS with ⟨r, hC, hEq⟩ + rw [hEq] + exact h_cycle hC + +theorem rounds_sim {tm : Machine (Fin 2) (Fin 6)} + {cfgAt : HalfTape → Cfg (Fin 2) (Fin 6)} + (hb : BaseRules stepRel) + (h_cycle : ∀ {r r' : HalfTape}, NumRun stepRel 12 r r' → (cfgAt r) [tm]⊢⁺ (cfgAt (t +> r'))) + {u v : WordList} (hR : Rounds u v) : + (cfgAt (evalWords u default)) [tm]⊢* (cfgAt (evalWords v default)) := by + induction hR with + | refl u => exact ⟨0, rfl⟩ + | next hS _ ih => + rcases step_sim hb h_cycle hS with ⟨n1, _, hn1⟩ + rcases ih with ⟨n2, hn2⟩ + exact ⟨n1 + n2, multiStep_trans tm _ _ _ n1 n2 hn1 hn2⟩ + +theorem is_not_halt_of_aggState {tm : Machine (Fin 2) (Fin 6)} + {cfgAt : HalfTape → Cfg (Fin 2) (Fin 6)} + (hb : BaseRules stepRel) + (h_cycle : ∀ {r r' : HalfTape}, NumRun stepRel 12 r r' → (cfgAt r) [tm]⊢⁺ (cfgAt (t +> r'))) + {c_init : Cfg (Fin 2) (Fin 6)} {u0 pref pref_next : WordList} {p0 q0 : Nat} + (h_safe : isSafePrefix pref_next = true) + (h_copy : ∀ q, 5 ≤ q → + CopyTwelve (List.replicate q V ++ pref) (List.replicate q V ++ pref_next)) + (h_stem : c_init [tm]⊢* cfgAt (evalWords u0 default)) + (h_entry : ∃ v, Rounds u0 v ∧ AggState pref p0 q0 v) : + ∀ (cfg : Cfg (Fin 2) (Fin 6)), (c_init [tm]⊢* cfg) → (step tm cfg).isSome := by + refine Counter.does_not_halt_of_invariant + (fun c => ∃ p q w, c = cfgAt (evalWords w default) ∧ AggState pref p q w) ?_ ?_ + · rcases h_entry with ⟨v0, hRounds, hGood0⟩ + exact ⟨cfgAt (evalWords v0 default), + Counter.stepStar_trans h_stem (rounds_sim hb h_cycle hRounds), + p0, q0, v0, rfl, hGood0⟩ + · rintro _ ⟨p, q, w, rfl, h_good⟩ + rcases aggState_step_of_copyTwelve pref pref_next h_safe h_copy p q w h_good + with ⟨w', hStep, h_good'⟩ + exact ⟨cfgAt (evalWords w' default), step_sim hb h_cycle hStep, 1 + p, 1 + q, w', rfl, h_good'⟩ + +def pref_A : WordList := + [Q,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V] +def pref_next_A : WordList := + [K,V,K,V,V,V,V,V,V,K,V,V,V,K,V] +theorem copy_base_A (n : Nat) : + Copy (31 + 32 * n) (260 + 256 * n) pref_A pref_next_A (4617 + 4096 * n) + (30684 + 32768 * n) := by + unfold pref_A pref_next_A + refine copy_step_d11 (n' := 16 + 16 * n) (k' := 128 + 128 * n) (m := 64 + 64 * n) + (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 33 + 32 * n) (k' := 252 + 256 * n) (m := 125 + 128 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 17 + 16 * n) (k' := 124 + 128 * n) (m := 62 + 64 * n) + (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 35 + 32 * n) (k' := 244 + 256 * n) (m := 121 + 128 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 71 + 64 * n) (k' := 484 + 512 * n) (m := 241 + 256 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 143 + 128 * n) (k' := 964 + 1024 * n) (m := 481 + 512 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 287 + 256 * n) (k' := 1924 + 2048 * n) (m := 961 + 1024 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 575 + 512 * n) (k' := 3844 + 4096 * n) (m := 1921 + 2048 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 1151 + 1024 * n) (k' := 7684 + 8192 * n) (m := 3841 + 4096 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 576 + 512 * n) (k' := 3840 + 4096 * n) (m := 1920 + 2048 * n) + (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 1153 + 1024 * n) (k' := 7676 + 8192 * n) (m := 3837 + 4096 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 2307 + 2048 * n) (k' := 15348 + 16384 * n) (m := 7673 + 8192 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 4615 + 4096 * n) (k' := 30692 + 32768 * n) (m := 15345 + 16384 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 2308 + 2048 * n) (k' := 15344 + 16384 * n) (m := 7672 + 8192 * n) + (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 4617 + 4096 * n) (k' := 30684 + 32768 * n) (m := 15341 + 16384 * n) + (by omega) (by omega) (by omega) ?_ + exact Copy.nil _ _ +theorem copyTwelve_A (q : Nat) (hQ : 5 <= q) : + CopyTwelve (List.replicate q V ++ pref_A) (List.replicate q V ++ pref_next_A) := by + have hPow : 2 ^ q = 32 * 2 ^ (q - 5) := by + have heq : q = 5 + (q - 5) := by omega + conv_lhs => rw [heq,Nat.pow_add] + have hPos := pow_two_pos (q - 5) + have hTs := copy_replicate_V q 0 8 + have hBase := copy_base_A (2 ^ (q - 5) - 1) + have h1 : (1 + 0) * 2 ^ q - 1 = 31 + 32 * (2 ^ (q - 5) - 1) := by omega + have h2 : 4 + 8 * 2 ^ q = 260 + 256 * (2 ^ (q - 5) - 1) := by omega + rw [h1,h2] at hTs + exact ⟨_,_,copy_append hTs hBase⟩ +theorem safe_pref_A : isSafePrefix pref_next_A = true := by decide +kernel +def tail_A : WordList := + [K,Q,K,Q,Q,Q,Q,Q,K] ++ List.replicate 15 Q +def u0_A : WordList := + [V,V,Q,V,Q,V,K,K,V,Q,K] +def u5_A : WordList := [ + V, V, V, V, V, V, V, Q, V, Q, V, V, V, V, V, V, Q, V, V, V, Q, V, V, V, V, V, Q, V, + Q, V, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, V, K, K, Q, Q, Q, K, Q, Q, Q, Q, K, + Q, K, K, Q, Q, K, Q, Q, K, Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, Q + ] +def u10_A : WordList := [ + V, V, V, V, V, V, V, V, V, V, V, V, Q, V, Q, V, V, V, V, V, V, Q, V, V, V, Q, V, V, + V, V, V, Q, V, Q, V, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, V, Q, V, Q, V, Q, V, + V, V, Q, V, Q, V, V, V, V, V, Q, V, V, V, Q, V, V, Q, V, V, V, V, Q, V, V, V, Q, V, + Q, V, V, V, V, V, V, V, V, V, V, V, Q, V, Q, Q, V, V, V, V, V, V, V, Q, V, V, V, V, + V, Q, V, V, V, V, V, V, V, Q, V, V, V, V, Q, V, Q, V, V, K, V, Q, Q, V, V, Q, V, K, + V, V, V, V, V, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, Q, V, V, Q, V, Q, V, K, V, + V, Q, V, V, V, V, Q, K, V, V, V, V, V, Q, V, Q, V, K, V, V, Q, K, Q, V, V, V, V, V, + V, K, V, V, V, V, V, Q, V, V, V, V, V, K, K, K, K, K, Q, K, K, Q, K, Q, Q, Q, Q, K, + K, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, K, K, Q, Q, Q, K, Q, K, Q, K, K, K, Q, K, + Q, Q, Q, Q, Q, K, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, K, K, Q, + Q, K, K, Q, K, Q, Q, Q, Q, K, K, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, K, Q, Q, K, + Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q + ] +def u12_p1_A : WordList := [ + V, V, V, V, V, V, V, V, V, V, V, V, V, V, Q, V, Q, V, V, V, V, V, V, Q, V, V, V, Q, + V, V, V, V, V, Q, V, Q, V, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, V, Q, V, Q, V, + Q, V, V, V, Q, V, Q, V, V, V, V, V, Q, V, V, V, Q, V, V, Q, V, V, V, V, Q, V, V, V, + Q, V, Q, V, V, V, V, V, V, V, V, V, V, V, Q, V, Q, Q, V, V, V, V, V, V, V, Q, V, V, + V, V, V, Q, V, V, V, V, V, V, V, Q, V, V, V, V, Q, V, Q, V, V, Q, V, V, V, V, Q, V, + Q, V, V, V, V, V, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, Q, V, V, Q, V, Q, V, Q, + V, V, Q, V, V, V, V, Q, Q, V, V, V, V, V, Q, V, Q, V, Q, V, V, Q, Q, K, V, V, V, V, + V, V, Q, V, V, V, V, V, Q, V, V, V, V, V, Q, V, V, V, Q, V, Q, V, V, Q, V, Q, V, Q, + V, V, K, K, Q, V, V, V, V, Q, V, V, V, V, V, V, V, Q, V, V, V, Q, V, V, V, V, Q, Q, + V, Q, V, Q, V, V, Q, K, K, V, V, V, V, V, V, Q, V, V, V, V, V, V, V + ] +def u12_p2_A : WordList := [ + V, V, V, V, V, V, V, Q, V, Q, V, K, V, V, Q, V, Q, V, Q, K, V, V, K, V, V, V, K, V, + V, V, V, V, V, V, V, V, V, V, V, Q, V, V, V, V, V, Q, V, V, V, Q, V, V, V, V, Q, K, + V, Q, V, K, V, V, Q, K, Q, V, V, V, V, V, V, K, V, V, V, V, V, Q, V, V, V, V, V, V, + K, K, K, K, K, K, Q, K, K, Q, K, Q, Q, Q, Q, K, Q, K, Q, K, Q, K, Q, K, Q, K, Q, Q, + Q, K, K, K, Q, K, Q, K, K, K, K, K, K, K, K, K, K, K, K, K, Q, K, Q, Q, Q, K, K, Q, + Q, K, K, Q, Q, K, K, Q, Q, Q, K, Q, Q, Q, K, Q, Q, K, Q, Q, Q, K, Q, Q, Q, Q, K, Q, + K, K, Q, K, K, Q, K, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, K, Q, Q, K, Q, K, Q, + K, Q, Q, Q, Q, Q, K, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, K, K, + Q, Q, K, K, Q, K, Q, Q, Q, Q, K, K, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, K, Q, Q, + K, Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q + ] +def u14_p1_A : WordList := [ + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, Q, V, Q, V, V, V, V, V, V, Q, V, V, + V, Q, V, V, V, V, V, Q, V, Q, V, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, V, Q, V, + Q, V, Q, V, V, V, Q, V, Q, V, V, V, V, V, Q, V, V, V, Q, V, V, Q, V, V, V, V, Q, V, + V, V, Q, V, Q, V, V, V, V, V, V, V, V, V, V, V, Q, V, Q, Q, V, V, V, V, V, V, V, Q, + V, V, V, V, V, Q, V, V, V, V, V, V, V, Q, V, V, V, V, Q, V, Q, V, V, Q, V, V, V, V, + Q, V, Q, V, V, V, V, V, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, Q, V, V, Q, V, Q, + V, Q, V, V, Q, V, V, V, V, Q, Q, V, V, V, V, V, Q, V, Q, V, Q, V, V, Q, V, V, V, V, + V, V, V, Q, V, V, V, V, V, Q, V, V, V, V, V, Q, V, V, V, Q, V, Q, V, V, Q, V, Q, V, + Q, V, V, Q, V, V, V, V, V, Q, V, V, V, V, V, V, V, Q, V, V, V, Q, V, V, V, V, Q, Q, + V, K, V, K, V, V, Q, V, V, V, V, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, Q, V, Q, V, Q, V, V, Q, V, Q, V, Q, Q, V, V, Q, V, V, V, Q, V, V, V, V, V, V, V, + V, V, V, V, V, Q, V, V, V, V, V, Q, V, V, V, Q, V, V, V, V, Q, Q, V, K, V, Q, V, V, + Q, Q, K, V, V, V, V, V, V, Q, V, V, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, Q, V, + Q, V, V, Q, V, Q, V, Q, K, V, V, V, Q, Q, V, V, V, V, V, V, Q, V, K, V, V, V, Q, V, + Q, V, V, Q, V, K, V, V, Q, V, V, V, Q, V, V, V, V, Q, Q, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, Q, V, V, V, Q, V, V, V, V, Q, Q, V, Q, V, Q, V, V, Q, K, K, + V, V + ] +def u14_p2_A : WordList := [ + V, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, Q, V, V, V, Q, V, Q, V, K, V, V, + Q, V, Q, V, Q, K, K, V, V, V, V, Q, Q, V, V, K, K, V, Q, V, Q, V, V, Q, V, K, V, V, + V, V, V, V, V, V, V, V, K, V, V, V, V, V, V, V, Q, V, K, V, V, V, V, K, K, V, K, Q, + V, V, V, V, V, V, Q, V, Q, V, K, V, K, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, Q, V, V, V, Q, V, V, V, V, Q, K, V, Q, V, K, V, V, Q, K, Q, V, V, V, V, V, V, + K, V, V, V, V, V, Q, V, V, V, V, V, V, V, K, K, K, K, K, K, K, Q, K, K, Q, K, Q, Q, + Q, Q, K, Q, K, Q, K, Q, K, K, K, K, Q, Q, Q, K, Q, Q, Q, K, K, K, Q, Q, K, K, K, Q, + Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, K, Q, K, Q, Q, K, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, + K, K, Q, Q, Q, K, K, Q, Q, K, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, K, Q, + K, Q, K, K, Q, Q, K, K, K, Q, Q, K, Q, Q, K, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, K, Q, Q, + K, K, Q, Q, K, K, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, K, K, Q, Q, + Q, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, K, K, K, Q, K, K, Q, K, Q, Q, Q, Q, Q, K, Q, Q, + Q, K, K, K, K, K, Q, Q, Q, K, Q, Q, Q, K, Q, Q, Q, Q, Q, K, K, K, K, Q, K, Q, K, K, + Q, K, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, K, Q, K, Q, K, Q, K, Q, Q, Q, Q, + Q, K, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, K, K, Q, Q, K, K, Q, + K, Q, Q, Q, Q, K, K, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, K, Q, Q, K, Q, K, Q, Q, + Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q + ] +def u15_p1_A : WordList := [ + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, Q, V, Q, V, V, V, V, V, V, Q, V, V, + V, Q, V, V, V, V, V, Q, V, Q, V, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, V, Q, V, + Q, V, Q, V, V, V, Q, V, Q, V, V, V, V, V, Q, V, V, V, Q, V, V, Q, V, V, V, V, Q, V, + V, V, Q, V, Q, V, V, V, V, V, V, V, V, V, V, V, Q, V, Q, Q, V, V, V, V, V, V, V, Q, + V, V, V, V, V, Q, V, V, V, V, V, V, V, Q, V, V, V, V, Q, V, Q, V, V, Q, V, V, V, V, + Q, V, Q, V, V, V, V, V, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, Q, V, V, Q, V, Q, + V, Q, V, V, Q, V, V, V, V, Q, Q, V, V, V, V, V, Q, V, Q, V, Q, V, V, Q, V, V, V, V, + V, V, V, Q, V, V, V, V, V, Q, V, V, V, V, V, Q, V, V, V, Q, V, Q, V, V, Q, V, Q, V, + Q, V, V, Q, V, V, V, V, V, Q, V, V, V, V, V, V, V, Q, V, V, V, Q, V, V, V, V, Q, Q, + V, K, V, K, V, V, Q, V, V, V, V, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, Q, V, Q, V, Q, V, V, Q, V, Q, V, Q, Q, V, V, Q, V, V, V, Q, V, V, V, V, V, V, V, + V, V, V, V, V, Q, V, V, V, V, V, Q, V, V, V, Q, V, V, V, V, Q, Q, V, K, V, K, V, V, + Q, V, V, V, V, V, V, V, Q, V, V, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, Q, V, Q, + V, V, Q, V, Q, V, Q, Q, V, V, V, Q, Q, V, V, V, V, V, V, Q, V, Q, V, V, V, Q, V, Q, + V, V, Q, V, Q, V, V, Q, V, V, V, Q, V, V, V, V, Q, Q, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, Q, V, V, V, Q, V, V, V, V, Q, Q, V, K, V, Q, V, V, Q, Q, K, V, V + ] +def u15_p2_A : WordList := [ + V, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, Q, V, V, V, Q, V, Q, V, Q, V, V, + Q, V, Q, V, Q, K, Q, V, V, V, V, Q, Q, V, V, V, V, K, V, Q, V, V, Q, V, Q, V, V, V, + V, V, V, V, V, V, V, Q, V, V, V, V, V, V, V, Q, V, Q, V, V, V, V, V, V, V, V, V, V, + V, V, V, Q, V, Q, V, Q, V, K, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, Q, + V, V, V, Q, V, V, V, V, Q, Q, V, Q, V, Q, V, V, Q, K, K, V, V, V, V, V, V, Q, V, V, + V, V, V, Q, V, V, V, V, V, V, V, Q, V, V, V, V, Q, V, K, V, V, Q, V, Q, V, Q, K, Q, + V, V, V, V, Q, Q, Q, K, V, V, K, Q, V, V, V, V, V, V, K, V, K, Q, K, Q, Q, Q, K, K, + K, Q, Q, V, V, V, Q, V, K, Q, V, V, V, V, V, V, V, V, Q, V, K, V, K, V, Q, V, K, V, + Q, V, V, V, V, V, V, V, Q, V, K, V, V, Q, V, V, V, V, V, V, V, K, Q, V, V, V, V, V, + Q, V, V, Q, V, V, Q, V, V, V, V, V, Q, Q, Q, Q, V, V, V, V, V, V, V, Q, K, V, K, V, + K, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, Q, V, V, V, Q, V, V, V, V, Q, + K, V, Q, V, K, V, V, Q, K, Q, V, V, V, V, V, V, K, V, V, V, V, V, V, V, V, V, V, V, V + ] +def u15_p3_A : WordList := [ + K, K, K, K, K, K, K, Q, Q, Q, K, K, Q, K, Q, Q, Q, Q, K, Q, K, Q, K, Q, K, K, K, K, + Q, Q, Q, K, Q, Q, Q, K, K, Q, Q, Q, K, K, K, Q, Q, Q, K, Q, Q, Q, K, Q, Q, Q, Q, Q, + Q, Q, K, Q, Q, Q, K, K, Q, Q, Q, Q, K, K, K, Q, Q, K, Q, K, K, Q, Q, Q, K, K, Q, Q, + K, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, K, K, Q, Q, K, Q, Q, K, K, K, Q, + K, K, Q, Q, Q, K, K, Q, Q, Q, Q, Q, Q, Q, K, K, K, K, K, Q, Q, K, K, Q, K, Q, Q, Q, + Q, Q, Q, Q, Q, Q, K, Q, Q, K, K, Q, Q, K, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, + K, Q, K, Q, K, K, Q, Q, Q, K, Q, K, Q, K, Q, Q, K, Q, K, Q, Q, Q, Q, Q, Q, K, Q, Q, + Q, K, Q, Q, Q, K, K, K, Q, K, K, Q, K, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, + K, K, K, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, K, K, Q, K, K, Q, K, Q, + Q, Q, Q, Q, K, Q, Q, Q, K, K, K, K, K, Q, Q, Q, K, Q, Q, Q, K, Q, Q, Q, Q, Q, K, K, + K, K, Q, K, Q, K, K, Q, K, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, K, Q, K, Q, + K, Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, + K, K, Q, Q, K, K, Q, K, Q, Q, Q, Q, K, K, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, K, + Q, Q, K, Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q + ] +def u16_p1_A : WordList := [ + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, Q, V, Q, V, V, V, V, V, V, Q, V, + V, V, Q, V, V, V, V, V, Q, V, Q, V, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, V, Q, + V, Q, V, Q, V, V, V, Q, V, Q, V, V, V, V, V, Q, V, V, V, Q, V, V, Q, V, V, V, V, Q, + V, V, V, Q, V, Q, V, V, V, V, V, V, V, V, V, V, V, Q, V, Q, Q, V, V, V, V, V, V, V, + Q, V, V, V, V, V, Q, V, V, V, V, V, V, V, Q, V, V, V, V, Q, V, Q, V, V, Q, V, V, V, + V, Q, V, Q, V, V, V, V, V, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, Q, V, V, Q, V, + Q, V, Q, V, V, Q, V, V, V, V, Q, Q, V, V, V, V, V, Q, V, Q, V, Q, V, V, Q, V, V, V, + V, V, V, V, Q, V, V, V, V, V, Q, V, V, V, V, V, Q, V, V, V, Q, V, Q, V, V, Q, V, Q, + V, Q, V, V, Q, V, V, V, V, V, Q, V, V, V, V, V, V, V, Q, V, V, V, Q, V, V, V, V, Q, + Q, V, K, V, K, V, V, Q, V, V, V, V, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, Q, V, Q, V, Q, V, V, Q, V, Q, V, Q, Q, V, V, Q, V, V, V, Q, V, V, V, V, V, V, + V, V, V, V, V, V, Q, V, V, V, V, V, Q, V, V, V, Q, V, V, V, V, Q, Q, V, K, V, K, V, + V, Q, V, V, V, V, V, V, V, Q, V, V, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, Q, V, + Q, V, V, Q, V, Q, V, Q, Q, V, V, V, Q, Q, V, V, V, V, V, V, Q, V, Q, V, V, V, Q, V, + Q, V, V, Q, V, Q, V, V, Q, V, V, V, Q, V, V, V, V, Q, Q, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, Q, V, V, V, Q, V, V, V, V, Q, Q, V, K, V, K, V, V, Q, V, V, V + ] +def u16_p2_A : WordList := [ + V, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, Q, V, V, V, Q, V, Q, V, Q, V, V, + Q, V, Q, V, Q, Q, K, V, V, V, V, Q, Q, V, V, V, V, Q, V, K, V, V, Q, V, Q, V, V, V, + V, V, V, V, V, V, V, Q, V, V, V, V, V, V, V, Q, V, Q, V, V, V, V, V, V, V, V, V, V, + V, V, V, Q, V, Q, V, Q, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, Q, + V, V, V, Q, V, V, V, V, Q, Q, V, K, V, Q, V, V, Q, Q, K, V, V, V, V, V, V, Q, V, V, + V, V, V, Q, V, V, V, V, V, V, V, Q, V, V, V, V, Q, V, Q, V, V, Q, V, Q, V, Q, K, Q, + V, V, V, V, Q, Q, V, V, V, V, V, V, V, V, V, V, Q, V, V, K, V, V, Q, Q, Q, K, V, V, + V, Q, V, V, V, V, V, V, V, V, V, V, Q, V, Q, V, K, V, K, V, Q, V, K, V, V, V, V, V, + V, V, Q, V, Q, V, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, V, Q, V, V, Q, V, V, Q, + V, V, V, V, V, Q, Q, V, V, V, V, V, V, V, V, Q, Q, V, Q, V, K, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, Q, V, V, V, Q, V, V, V, V, Q, Q, V, Q, V, Q, V, V, Q, + K, K, V, V, V, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, V + ] +def u16_p3_A : WordList := [ + V, V, V, V, Q, V, Q, V, K, V, V, Q, V, Q, V, Q, K, K, V, V, V, V, Q, Q, Q, K, V, V, + V, V, V, Q, V, V, V, K, V, V, Q, Q, V, V, V, Q, V, Q, V, Q, V, V, Q, V, K, Q, V, V, + V, V, V, V, V, Q, K, V, V, Q, V, Q, K, V, K, V, V, Q, V, V, V, V, Q, K, V, K, Q, Q, + V, V, V, V, V, V, V, V, Q, V, K, K, V, V, V, V, V, V, V, Q, V, V, V, Q, V, Q, V, Q, + Q, V, K, V, V, V, V, V, Q, V, V, Q, V, V, Q, V, V, Q, V, V, V, V, V, V, V, Q, Q, V, + V, V, V, V, V, V, V, V, V, Q, V, V, V, V, V, Q, Q, Q, Q, V, V, V, V, V, V, V, Q, K, + V, K, V, K, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, Q, V, V, V, Q, V, V, + V, V, Q, K, V, Q, V, K, V, V, Q, K, Q, V, V, V, V, V, V, K, V, V, V, V, V, Q, V, V, + V, V, V, V, V + ] +def u16_p4_A : WordList := [ + K, K, K, K, K, K, K, K, Q, K, K, Q, K, Q, Q, Q, Q, K, Q, K, Q, K, Q, K, K, K, K, Q, + Q, Q, K, Q, Q, Q, K, K, Q, Q, Q, K, K, K, Q, K, Q, K, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, + Q, Q, Q, K, K, Q, Q, K, K, K, Q, Q, Q, Q, Q, K, Q, Q, K, K, K, K, Q, K, Q, Q, K, Q, + Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, K, Q, Q, Q, K, K, Q, + Q, K, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, K, Q, K, Q, K, K, K, Q, Q, Q, K, + K, K, Q, Q, K, K, K, K, K, K, K, K, Q, Q, Q, K, Q, Q, Q, K, Q, Q, K, Q, Q, K, Q, K, + K, Q, Q, Q, K, Q, K, K, K, K, K, K, K, Q, K, K, Q, Q, Q, Q, Q, K, Q, Q, Q, K, Q, Q, + K, K, Q, Q, K, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, K, K, K, Q, Q, Q, Q, Q, + Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, K, Q, K, K, Q, + K, Q + ] +def u16_p5_A : WordList := [ + Q, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, K, K, K, Q, K, K, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, + Q, Q, Q, Q, Q, K, Q, K, Q, K, Q, K, Q, K, K, Q, K, Q, K, K, K, Q, Q, K, Q, Q, Q, Q, + Q, Q, K, Q, Q, Q, K, Q, Q, Q, Q, K, K, Q, K, K, Q, K, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, + Q, Q, Q, Q, K, K, K, K, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, K, K, Q, + K, K, Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, K, K, K, K, K, Q, Q, Q, K, Q, Q, Q, K, Q, Q, + Q, Q, Q, K, K, K, K, Q, K, Q, K, K, Q, K, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, + Q, K, Q, K, Q, K, Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, + Q, Q, Q, Q, Q, K, K, Q, Q, K, K, Q, K, Q, Q, Q, Q, K, K, K, Q, Q, Q, Q, Q, Q, Q, Q, + Q, Q, K, Q, K, Q, Q, K, Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, + Q, Q + ] +theorem entrySpec_A : EntrySpec 18 pref_A tail_A 11000 := + entrySpec_of_checkEntrySpec (by decide +kernel) +-- Justification: WordCalculus symbolic round evaluation requires elevated recursion depth. +set_option maxRecDepth 4000000 in +theorem rounds_0_5_A : evalRounds 5 u0_A = some u5_A := by decide +kernel +-- Justification: WordCalculus symbolic round evaluation requires elevated recursion depth. +set_option maxRecDepth 4000000 in +theorem rounds_5_10_A : evalRounds 5 u5_A = some u10_A := by decide +kernel +-- Justification: WordCalculus symbolic round evaluation requires elevated recursion depth. +set_option maxRecDepth 4000000 in +theorem rounds_10_12_A : evalRounds 2 u10_A = some (u12_p1_A ++ u12_p2_A) := by decide +kernel +-- Justification: WordCalculus symbolic round evaluation requires elevated recursion depth. +set_option maxRecDepth 4000000 in +theorem rounds_12_14_A : + evalRounds 2 (u12_p1_A ++ u12_p2_A) = some (u14_p1_A ++ u14_p2_A) := by + decide +kernel +-- Justification: WordCalculus symbolic round evaluation requires elevated recursion depth. +set_option maxRecDepth 4000000 in +theorem step_14_15_A : + checkStepTwoPieces u14_p1_A u14_p2_A + 110434817290149211768284085870454066060546939462225549259006050933145647 + 7067168235385531200914694256602959202955917586119058258266247915060068152 + (12608249447398561729463940017754846819701602849629166142431 * 10^59 + + 43022817523291247800206387780525642753349635545663353377664) + u15_p1_A u15_p2_A u15_p3_A = true := by + decide +kernel +-- Justification: WordCalculus symbolic round evaluation requires elevated recursion depth. +set_option maxRecDepth 4000000 in +theorem step_15_16_A : + checkStepThreePieces (V :: u15_p1_A) (u15_p2_A ++ [V]) (u15_p3_A ++ [Q]) + 1766902070710385858937921437335091786398117464135613873040684957281812527 + (63045172591469524831973228231685135810857921777046899566448 * 10^58 + + 3969260760571151030486379468182403867732674229876057702399) + 113076451955992548153983074076597066130126825388972272726165497219966302796 + (676910774998025375822660775135045812617818152164822448708937095 * 10^63 + + 293664528614370053480259847094293709720004454266978684988792836) + (16759499027875054834400200871060218370496769749035807992084659312172062036053 * 10^77 + + 25682553129796896712940054963540497648261454412042999479128922952102697101568) + u16_p1_A u16_p2_A u16_p3_A u16_p4_A u16_p5_A = true := by + decide +kernel +-- Justification: WordCalculus symbolic round evaluation requires elevated recursion depth. +set_option maxRecDepth 4000000 in +theorem check_entry_A : + checkEntryThreePieces 18 pref_A tail_A 11000 + (V :: u16_p1_A) u16_p2_A (u16_p3_A ++ [V]) u16_p4_A u16_p5_A + 244 416 508 + 28269993083910161508169751504624082417804810888089862649298329268595458391 + (169232962271100938707715443929017058497083679336597570160963934 * 10^63 + + 441725064445424265138458712223603740228005634717572939333509119) + (83800103984907189572674308122271855628514314969710333018531300610894322517282 * 10^76 + + 3266912222700929127475495397164689088385716467769609144035444689331281199359) + 28948472917924005384365825540735060395832126349404019352881489171041749393536 + 47079 4103 = true := by + decide +kernel +theorem entry_A : ∃ v,Rounds u0_A v /\ AggState pref_A 16 18 v := by + have h0_5 := evalRounds_sound 5 u0_A u5_A rounds_0_5_A + have h5_10 := evalRounds_sound 5 u5_A u10_A rounds_5_10_A + have h10_12 := evalRounds_sound 2 u10_A (u12_p1_A ++ u12_p2_A) rounds_10_12_A + have h12_14 := evalRounds_sound 2 (u12_p1_A ++ u12_p2_A) (u14_p1_A ++ u14_p2_A) rounds_12_14_A + have h14_15 := step_of_checkStepTwoPieces _ _ _ _ _ _ _ _ step_14_15_A + have h15_16 := step_of_checkStepThreePieces _ _ _ _ _ _ _ _ _ _ _ _ _ step_15_16_A + have hEq15 : V :: ((u15_p1_A ++ u15_p2_A) ++ V :: (u15_p3_A ++ [Q])) = + (V :: u15_p1_A) ++ (u15_p2_A ++ [V]) ++ (u15_p3_A ++ [Q]) := by + simp [List.append_assoc] + rw [hEq15] at h14_15 + have hEq16 : V :: ((u16_p1_A ++ u16_p2_A ++ u16_p3_A) ++ V :: ((u16_p4_A ++ u16_p5_A) ++ [Q])) = + ((V :: u16_p1_A) ++ u16_p2_A ++ (u16_p3_A ++ [V])) ++ (u16_p4_A ++ u16_p5_A) ++ [Q] := by + simp [List.append_assoc] + rw [hEq16] at h15_16 + have hGood := good_of_checkEntryThreePieces _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + entrySpec_A check_entry_A + refine ⟨_,?_,hGood⟩ + exact rounds_trans h0_5 (rounds_trans h5_10 (rounds_trans h10_12 (rounds_trans h12_14 + (Rounds.next h14_15 (Rounds.next h15_16 (Rounds.refl _)))))) + +def pref_B : WordList := + [Q,V,V,Q,Q,V,K,V,K,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,Q,Q,V] +def pref_next_B : WordList := + [K,V,V,K,Q,V,Q,V,Q,V,V,V,K,V,V,V,V,V,V,K,V,V,V,K,V,K,V,K,Q,V] +theorem copy_base_B (n : Nat) : + Copy (31 + 32 * n) (260 + 256 * n) pref_B pref_next_B (9351 + 8192 * n) + (58338 + 65536 * n) := by + unfold pref_B pref_next_B + refine copy_step_d11 (n' := 16 + 16 * n) (k' := 128 + 128 * n) (m := 64 + 64 * n) + (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 33 + 32 * n) (k' := 252 + 256 * n) (m := 125 + 128 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 67 + 64 * n) (k' := 500 + 512 * n) (m := 249 + 256 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 34 + 32 * n) (k' := 248 + 256 * n) (m := 124 + 128 * n) + (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_d10 (n' := 17 + 16 * n) (k' := 123 + 128 * n) (m := 61 + 64 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 35 + 32 * n) (k' := 242 + 256 * n) (m := 120 + 128 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_d01 (n' := 17 + 16 * n) (k' := 121 + 128 * n) (m := 60 + 64 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 35 + 32 * n) (k' := 238 + 256 * n) (m := 118 + 128 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_d01 (n' := 17 + 16 * n) (k' := 119 + 128 * n) (m := 59 + 64 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 35 + 32 * n) (k' := 234 + 256 * n) (m := 116 + 128 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 71 + 64 * n) (k' := 464 + 512 * n) (m := 231 + 256 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 143 + 128 * n) (k' := 924 + 1024 * n) (m := 461 + 512 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 72 + 64 * n) (k' := 460 + 512 * n) (m := 230 + 256 * n) + (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 145 + 128 * n) (k' := 916 + 1024 * n) (m := 457 + 512 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 291 + 256 * n) (k' := 1828 + 2048 * n) (m := 913 + 1024 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 583 + 512 * n) (k' := 3652 + 4096 * n) (m := 1825 + 2048 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 1167 + 1024 * n) (k' := 7300 + 8192 * n) (m := 3649 + 4096 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 2335 + 2048 * n) (k' := 14596 + 16384 * n) (m := 7297 + 8192 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 4671 + 4096 * n) (k' := 29188 + 32768 * n) (m := 14593 + 16384 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 2336 + 2048 * n) (k' := 14592 + 16384 * n) (m := 7296 + 8192 * n) + (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 4673 + 4096 * n) (k' := 29180 + 32768 * n) (m := 14589 + 16384 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 9347 + 8192 * n) (k' := 58356 + 65536 * n) (m := 29177 + 32768 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 18695 + 16384 * n) (k' := 116708 + 131072 * n) (m := 58353 + 65536 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 9348 + 8192 * n) (k' := 58352 + 65536 * n) (m := 29176 + 32768 * n) + (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 18697 + 16384 * n) (k' := 116700 + 131072 * n) (m := 58349 + 65536 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 9349 + 8192 * n) (k' := 58348 + 65536 * n) (m := 29174 + 32768 * n) + (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 18699 + 16384 * n) (k' := 116692 + 131072 * n) (m := 58345 + 65536 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 9350 + 8192 * n) (k' := 58344 + 65536 * n) (m := 29172 + 32768 * n) + (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_d10 (n' := 4675 + 4096 * n) (k' := 29171 + 32768 * n) (m := 14585 + 16384 * n) + (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 9351 + 8192 * n) (k' := 58338 + 65536 * n) (m := 29168 + 32768 * n) + (by omega) (by omega) (by omega) ?_ + exact Copy.nil _ _ +theorem copyTwelve_B (q : Nat) (hQ : 5 <= q) : + CopyTwelve (List.replicate q V ++ pref_B) (List.replicate q V ++ pref_next_B) := by + have hPow : 2 ^ q = 32 * 2 ^ (q - 5) := by + have heq : q = 5 + (q - 5) := by omega + conv_lhs => rw [heq,Nat.pow_add] + have hPos := pow_two_pos (q - 5) + have hTs := copy_replicate_V q 0 8 + have hBase := copy_base_B (2 ^ (q - 5) - 1) + have h1 : (1 + 0) * 2 ^ q - 1 = 31 + 32 * (2 ^ (q - 5) - 1) := by omega + have h2 : 4 + 8 * 2 ^ q = 260 + 256 * (2 ^ (q - 5) - 1) := by omega + rw [h1,h2] at hTs + exact ⟨_,_,copy_append hTs hBase⟩ +theorem safe_pref_B : isSafePrefix pref_next_B = true := by decide +kernel +def tail_B : WordList := + [K,Q,Q,Q,K,K,Q,Q,K] ++ List.replicate 15 Q +def u0_B : WordList := + List.replicate 4 V ++ [Q,V,V,Q,Q,V,K,V,Q,K,K,Q,Q] +def u5_B : WordList := [ + V, V, V, V, V, V, V, V, V, Q, V, V, Q, Q, V, K, V, K, V, V, V, Q, V, V, V, V, V, V, + Q, V, V, V, Q, V, Q, V, Q, Q, V, V, V, V, Q, V, V, V, V, V, Q, K, V, Q, V, V, V, K, + K, K, Q, Q, K, Q, Q, K, K, K, K, Q, Q, Q, Q, Q, K, K, K, Q, Q, Q, Q, Q, Q + ] +def u10_B : WordList := [ + V, V, V, V, V, V, V, V, V, V, V, V, V, V, Q, V, V, Q, Q, V, K, V, K, V, V, V, Q, V, + V, V, V, V, V, Q, V, V, V, Q, V, Q, V, Q, Q, V, V, V, V, Q, V, V, V, V, V, Q, Q, V, + K, V, V, V, V, V, Q, V, Q, V, V, V, V, Q, Q, V, V, V, V, V, V, V, Q, V, V, Q, V, V, + Q, V, V, V, Q, Q, V, K, V, V, V, V, Q, V, V, V, Q, V, V, V, V, V, V, Q, V, V, Q, V, + V, V, Q, Q, V, V, V, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, Q, + V, V, V, Q, Q, V, K, V, V, V, V, V, V, V, V, Q, V, V, V, K, V, V, K, K, V, Q, K, Q, + K, V, Q, V, K, V, V, V, K, V, V, V, V, Q, Q, V, V, V, V, V, K, V, V, V, Q, Q, V, V, + V, V, V, V, V, K, K, K, K, K, Q, Q, Q, K, Q, Q, K, Q, K, K, Q, K, Q, Q, Q, Q, Q, K, + K, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, K, Q, K, K, K, Q, Q, Q, Q, + K, Q, K, K, K, K, K, K, K, Q, Q, Q, K, Q, K, Q, Q, K, K, K, K, Q, Q, K, K, Q, Q, Q, + K, Q, Q, Q, Q, K, K, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q + ] +def u15_B : WordList := [ + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, Q, V, V, Q, Q, V, K, V, K, + V, V, V, Q, V, V, V, V, V, V, Q, V, V, V, Q, V, Q, V, Q, Q, V, V, V, V, Q, V, V, V, + V, V, Q, Q, V, K, V, V, V, V, V, Q, V, Q, V, V, V, V, Q, Q, V, V, V, V, V, V, V, Q, + V, V, Q, V, V, Q, V, V, V, Q, Q, V, K, V, V, V, V, Q, V, V, V, Q, V, V, V, V, V, V, + Q, V, V, Q, V, V, V, Q, Q, V, V, V, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, Q, V, V, V, Q, Q, V, K, V, V, V, V, V, V, V, V, Q, V, V, V, Q, V, V, V, + V, V, V, V, Q, V, Q, V, V, V, Q, V, V, V, V, Q, Q, V, V, V, V, V, Q, V, V, V, Q, Q, + V, V, V, V, V, V, V, V, V, V, V, V, V, Q, V, V, V, Q, V, V, Q, V, V, V, V, V, V, V, + V, V, Q, Q, V, V, V, V, V, Q, V, V, V, V, Q, Q, V, V, V, V, V, Q, V, V, V, Q, Q, V, + K, V, V, V, V, V, V, Q, V, V, V, V, V, Q, Q, V, V, V, V, V, V, V, V, Q, V, V, V, V, + V, V, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, Q, Q, V, V, V, V, V, Q, V, V, V, V, + Q, Q, V, V, V, V, V, Q, V, V, V, Q, Q, V, V, V, V, V, V, V, V, Q, V, V, V, V, V, V, + Q, Q, V, V, V, V, Q, V, Q, V, V, Q, V, Q, V, V, V, Q, V, V, Q, V, V, V, V, V, V, V, + V, V, V, V, V, Q, V, V, Q, V, V, V, V, V, V, V, V, V, Q, V, V, V, V, V, V, V, V, V, + V, Q, Q, V, V, V, V, V, Q, V, V, V, V, Q, Q, V, V, V, V, V, Q, V, V, V, Q, Q, V, K, + V, V, V, V, V, V, V, V, V, V, V, V, V, Q, Q, V, V, V, V, Q, V, Q, V, V, Q, V, V, V, + V, V, V, V, Q, V, K, V, V, K, Q, V, V, V, V, Q, V, Q, V, Q, V, V, Q, K, V, V, V, Q, + V, V, Q, V, K, V, K, Q, V, V, V, Q, V, Q, V, V, V, V, V, Q, Q, K, V, Q, V, V, V, V, + V, V, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, Q, Q, V, V, V, V, V, Q, V, V, V, V, + Q, Q, V, V, V, V, V, Q, V, V, V, Q, Q, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, Q, Q, V, V, V, V, Q, V, Q, K, V, Q, V, V, Q, Q, V, Q, V, Q, Q, V, V, K, K, Q, K, + Q, K, Q, K, V, Q, K, K, V, Q, Q, V, V, V, V, V, V, V, V, Q, V, V, V, V, V, V, V, V, + Q, K, Q, V, Q, V, K, V, Q, V, V, V, V, V, V, V, Q, K, V, V, V, Q, K, V, V, V, Q, V, + V, K, V, K, V, Q, K, V, V, V, Q, V, K, V, V, V, V, V, Q, K, K, V, Q, V, K, V, Q, V, + V, V, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, Q, Q, Q, Q, V, V, V, V, K, V, V, V, + V, Q, Q, V, V, V, V, V, K, V, V, V, Q, Q, V, Q, V, V, V, V, V, V, V, V, K, K, K, K, + K, K, K, K, Q, K, Q, Q, K, Q, K, Q, K, Q, Q, K, Q, Q, K, Q, K, K, K, Q, Q, Q, Q, K, + K, Q, Q, Q, K, K, Q, Q, K, Q, K, K, Q, K, K, Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, K, K, + Q, K, Q, K, Q, Q, Q, K, K, K, K, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, K, Q, K, Q, Q, + K, Q, K, K, K, Q, K, K, Q, K, Q, K, K, K, Q, Q, Q, K, K, Q, Q, Q, Q, Q, Q, Q, Q, K, + K, K, K, Q, K, Q, K, Q, K, Q, K, Q, K, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, K, + Q, K, Q, Q, Q, Q, Q, Q, K, K, K, K, Q, K, K, K, Q, Q, K, K, Q, Q, Q, K, Q, Q, Q, Q, + K, Q, K, K, Q, K, Q, K, Q, K, Q, K, Q, K, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, + Q, K, Q, Q, Q, Q, K, Q, K, Q, Q, K, Q, Q, K, K, K, K, Q, K, Q, K, Q, K, Q, K, Q, K, + Q, Q, Q, Q, Q, Q, K, K, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, K, K, Q, K, Q, K, Q, + K, Q, Q, K, Q, Q, Q, Q, K, Q, K, Q, Q, Q, Q, K, K, K, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, + Q, Q, Q, Q, Q, K, Q, Q, K, Q, K, K, K, Q, Q, Q, Q, K, Q, K, K, K, K, K, K, K, Q, Q, + Q, K, Q, K, Q, Q, K, K, K, K, Q, Q, K, K, Q, Q, Q, K, Q, Q, Q, Q, K, K, K, Q, Q, Q, + Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q + ] +theorem entrySpec_B : EntrySpec 19 pref_B tail_B 12000 := + entrySpec_of_checkEntrySpec (by decide +kernel) +-- Justification: WordCalculus symbolic round evaluation requires elevated recursion depth. +set_option maxRecDepth 4000000 in +theorem rounds_0_5_B : evalRounds 5 u0_B = some u5_B := by decide +kernel +-- Justification: WordCalculus symbolic round evaluation requires elevated recursion depth. +set_option maxRecDepth 4000000 in +theorem rounds_5_10_B : evalRounds 5 u5_B = some u10_B := by decide +kernel +-- Justification: WordCalculus symbolic round evaluation requires elevated recursion depth. +set_option maxRecDepth 4000000 in +theorem rounds_10_15_B : evalRounds 5 u10_B = some u15_B := by decide +kernel +-- Justification: WordCalculus symbolic round evaluation requires elevated recursion depth. +set_option maxRecDepth 4000000 in +theorem check_entry_B : + checkEntryTwo 19 pref_B tail_B 12000 u15_B + 118572124402667226942787183035401251327472713866885815623334278971049653593343273 + (91740737713243040051863840645548241264047970202147880 * 10^53 + + 52537224621593528352222997552707606800391029695717887) = true := by + decide +kernel +theorem entry_B : ∃ v,Rounds u0_B v /\ AggState pref_B 16 19 v := by + refine ⟨u15_B,?_,good_of_checkEntryTwo _ _ _ _ _ _ _ entrySpec_B check_entry_B⟩ + exact rounds_trans (evalRounds_sound 5 u0_B u5_B rounds_0_5_B) + (rounds_trans (evalRounds_sound 5 u5_B u10_B rounds_5_10_B) + (evalRounds_sound 5 u10_B u15_B rounds_10_15_B)) + +end + +def callState_1RA0RD : Call → Fin 6 + | .ch => F + | .cj => E + | .cp => E + | .ca => F + +def callWord_1RA0RD : Call → BitWord + | .ch => [1] + | .cj => [1, 1] + | .cp => [1, 0] + | .ca => [1, 1, 1, 0, 1, 0] + +def cfgR_1RA0RD (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (r <{{callState_1RA0RD c}} (l <+ callWord_1RA0RD c)) + +def cfgL_1RA0RD (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> r) {{A}}> l) + +def cfgAt_1RA0RD (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + cfgL_1RA0RD lh (w_pre +> r) + +abbrev Step_1RA0RD := CallStep target cfgR_1RA0RD cfgL_1RA0RD + +syntax "run_1RA0RD" : tactic +macro_rules + | `(tactic| run_1RA0RD) => + `(tactic| ( + intro l r + dsimp [cfgR_1RA0RD, cfgL_1RA0RD, callWord_1RA0RD, callState_1RA0RD, t, d0, d1, one, lh] + try simp only [List.cons_append, List.nil_append, append_cons, append_nil, cons_zero_default] + execute)) + +theorem baseRules_1RA0RD : BaseRules Step_1RA0RD where + seg_cp_t := seg2 [1, 1, 0, 1, 0] (by run_1RA0RD) (by run_1RA0RD) + seg_cj_t := seg2 [1, 1, 0, 1, 1] (by run_1RA0RD) (by run_1RA0RD) + seg_ch_t0 := seg2 [1, 0, 1, 0] (by run_1RA0RD) (by run_1RA0RD) + seg_ch_t1 := seg5 [1, 0, 1, 1] [1, 0, 1, 0] (by run_1RA0RD) (by run_1RA0RD) (by run_1RA0RD) + seg_ch_t := seg5 [1, 0, 1, 1] [1, 0, 1, 0] (by run_1RA0RD) (by run_1RA0RD) (by run_1RA0RD) + seg_cp_d10 := seg4 (by run_1RA0RD) + seg_cj_d10 := seg2 [1, 0, 1, 0] (by run_1RA0RD) (by run_1RA0RD) + seg_cp_d11 := seg2 [1, 0, 1, 0] (by run_1RA0RD) (by run_1RA0RD) + seg_cj_d11 := seg5 [1, 0, 1, 1] [1, 0, 1, 0] (by run_1RA0RD) (by run_1RA0RD) (by run_1RA0RD) + seg_cj_d0 := seg4 (by run_1RA0RD) + seg_ch_d01 := seg4 (by run_1RA0RD) + seg_ch_d11 := seg2 [1, 1] (by run_1RA0RD) (by run_1RA0RD) + seg_cj_d1 := seg2 [1, 1] (by run_1RA0RD) (by run_1RA0RD) + seg_ch_d0 := seg4 (by run_1RA0RD) + seg_ch_d1 := seg2 [1, 1] (by run_1RA0RD) (by run_1RA0RD) + side_ch_blank := by + refine Side.cons (fun l => ?_) (Side.nil _) + simp only [cfgR_1RA0RD, cfgL_1RA0RD, callWord_1RA0RD, callState_1RA0RD, d1, + List.cons_append, List.nil_append, append_cons, append_nil, cons_zero_default] + execute + +theorem seg_ca_t_1RA0RD : Seg Step_1RA0RD [.ca] [.ch, .ch] t [1, 1, 0, 0, 0, 1, 1, 0, 0] := + seg5 [1, 0, 1, 1, 1, 1, 0, 1, 0] [1, 0, 1, 0, 1, 1, 0, 1, 0] + (by run_1RA0RD) (by run_1RA0RD) (by run_1RA0RD) + +theorem seg_ch_mid_1RA0RD : + Seg Step_1RA0RD [.ch] [.ch] [1, 1, 0, 0, 0, 1, 1, 0, 0] (t ++ t ++ one) := + seg2 [1, 1, 0, 1, 1, 1, 0, 1, 0] (by run_1RA0RD) (by run_1RA0RD) + +theorem step_ca_1RA0RD (r : HalfTape) : + (cfgL_1RA0RD lh r) [target]⊢⁺ (cfgR_1RA0RD ([1] +> default) .ca r) := by + simp only [cfgR_1RA0RD, cfgL_1RA0RD, callWord_1RA0RD, callState_1RA0RD, lh, + List.cons_append, List.nil_append, append_cons, append_nil, cons_zero_default]; execute + +theorem step_ch_1RA0RD (r : HalfTape) : + (cfgL_1RA0RD ([1] +> default) r) [target]⊢⁺ (cfgR_1RA0RD lh .ch r) := by + simp only [cfgR_1RA0RD, cfgL_1RA0RD, callWord_1RA0RD, callState_1RA0RD, lh, + List.cons_append, List.nil_append, append_cons, append_nil, cons_zero_default]; execute + +theorem cycle_1RA0RD {r r' : HalfTape} (hI : NumRun Step_1RA0RD 12 r r') : + (cfgAt_1RA0RD r) [target]⊢⁺ (cfgAt_1RA0RD (t +> r')) := + cycle_ca_ch baseRules_1RA0RD seg_ca_t_1RA0RD seg_ch_mid_1RA0RD step_ca_1RA0RD step_ch_1RA0RD hI + +def c_end_1RA0RD : Counter.CCfg (Fin 2) (Fin 6) := + ⟨0, 1, + [0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, + 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1], + [0, 1]⟩ + +-- Justification: Bounded window simulation over 1107 steps. +set_option maxRecDepth 4000000 in +theorem stem_1RA0RD : (init []) [target]⊢* cfgAt_1RA0RD (evalWords u0_A default) := by + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = evalBCfg ⟨0, 0, [], []⟩ := rfl + have h1 : evalBCfg c_end_1RA0RD = cfgAt_1RA0RD (evalWords u0_A default) := by + unfold evalBCfg evalWindow c_end_1RA0RD cfgAt_1RA0RD cfgL_1RA0RD lh w_pre u0_A + simp only [List.replicate, List.cons_append, List.nil_append, evalWords, wordsToBits, + t, d1, d0, one, append_cons, append_nil, cons_zero_default] + rfl + rw [h0, ← h1] + exact ⟨1107, Counter.bmultiStep_sound (tm := target) 1107 ⟨0, 0, [], []⟩ c_end_1RA0RD (by decide)⟩ + +def c_end_1LA0LE : Counter.CCfg (Fin 2) (Fin 6) := + ⟨0, 1, + [0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, + 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, + 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1], + [0, 1]⟩ + +-- Justification: Bounded window simulation over 5370 steps for conjugate twin 1LA0LE. +set_option maxRecDepth 4000000 in +theorem stem_1LA0LE : + (((default : ListBlank (Fin 2)) {{5}}> default) : Cfg (Fin 2) (Fin 6)) [target]⊢* + cfgAt_1RA0RD (evalWords u0_B default) := by + have h0 : (((default : ListBlank (Fin 2)) {{5}}> default) : Cfg (Fin 2) (Fin 6)) = + evalBCfg ⟨5, 0, [], []⟩ := rfl + have h1 : evalBCfg c_end_1LA0LE = cfgAt_1RA0RD (evalWords u0_B default) := by + unfold evalBCfg evalWindow c_end_1LA0LE cfgAt_1RA0RD cfgL_1RA0RD lh w_pre u0_B + simp only [List.replicate, List.cons_append, List.nil_append, evalWords, wordsToBits, + t, d1, d0, one, append_cons, append_nil, cons_zero_default] + rfl + rw [h0, ← h1] + exact ⟨5370, Counter.bmultiStep_sound (tm := target) 5370 ⟨5, 0, [], []⟩ c_end_1LA0LE (by decide)⟩ + +end Solution + +@[expose] public section + +open Solution in +theorem is_not_halt_from_1LA0LE : + ∀ cfg : Cfg (Fin 2) (Fin 6), + ((((default : ListBlank (Fin 2)) {{5}}> default) : Cfg (Fin 2) (Fin 6)) [target]⊢* cfg) → + (step target cfg).isSome := + is_not_halt_of_aggState baseRules_1RA0RD cycle_1RA0RD + safe_pref_B copyTwelve_B stem_1LA0LE entry_B + +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := + is_not_halt_of_aggState baseRules_1RA0RD cycle_1RA0RD + safe_pref_A copyTwelve_A stem_1RA0RD entry_A + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RA_0RC0RE_0LDHHH_1LE1LD_1LF0LD_1RA0RD diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA.lean new file mode 100644 index 00000000..37a3c456 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA.lean @@ -0,0 +1,2033 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge + +open Mathlib Relation Nat Turing BusyBeaver SixState + +@[expose] public section + +namespace BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA + +end + +namespace BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +namespace Solution + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : + multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : + multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : + (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, _, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +local macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +local macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, + BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, + default_head, default_tail]) +local macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> + (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> + (any_goals (first | finish | step))) +local macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5) + +theorem multiStep_step_isSome {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₀ cfg cfg' : Cfg Γ Λ) (n m : Nat) + (hn : multiStep M c₀ n = some cfg) + (hnm : multiStep M c₀ (n + (1 + m)) = some cfg') : + (step M cfg).isSome := by + rw [multiStep_add M c₀ n (1 + m), hn] at hnm + dsimp [Option.bind] at hnm + rw [multiStep_add M cfg 1 m, multiStep_one] at hnm + cases hs : step M cfg with + | none => rw [hs] at hnm; nomatch hnm + | some _ => rfl + +theorem inv_reaches_beyond {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) {c_init : Cfg Γ Λ} (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, (c_init [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') + (N : Nat) : + ∃ (m : Nat) (cfg' : Cfg Γ Λ), multiStep M c_init (N + m) = some cfg' ∧ Inv cfg' := by + induction N with + | zero => + obtain ⟨cfg₀, ⟨n₀, hn₀⟩, h_inv₀⟩ := h_init + refine ⟨n₀, cfg₀, ?_, h_inv₀⟩ + rwa [Nat.zero_add] + | succ N ih => + obtain ⟨m, cfg₁, hm, h_inv₁⟩ := ih + cases m with + | zero => + obtain ⟨cfg₂, ⟨k, hk_pos, hk⟩, h_inv₂⟩ := h_step cfg₁ h_inv₁ + cases k with + | zero => omega + | succ k' => + refine ⟨k', cfg₂, ?_, h_inv₂⟩ + have h_trans := multiStep_trans M c_init cfg₁ cfg₂ N (k' + 1) hm hk + have h_eq : (N + 1) + k' = N + (k' + 1) := by omega + rwa [h_eq] + | succ m' => + refine ⟨m', cfg₁, ?_, h_inv₁⟩ + have h_eq : (N + 1) + m' = N + (m' + 1) := by omega + rwa [h_eq] + +theorem closed_inv_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) {c_init : Cfg Γ Λ} (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, (c_init [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') : + ∀ cfg : Cfg Γ Λ, (c_init [M]⊢* cfg) → (step M cfg).isSome := by + intro cfg ⟨n, hn⟩ + obtain ⟨m, cfg', hnm, _⟩ := inv_reaches_beyond M Inv h_init h_step (n + 1) + have h_eq : (n + 1) + m = n + (1 + m) := by omega + rw [h_eq] at hnm + exact multiStep_step_isSome M c_init cfg cfg' n m hn hnm + +-- ============================================================================ +-- Section 2: Macro Rules, Round, Sweeps, EraRound +-- ============================================================================ + +def B : Fin 6 := 1 +def E : Fin 6 := 0 + +theorem rule_B_000 (l r : ListBlank (Fin 2)) : + (([0, 0, 0] +> r) <{{B}} l) [target_tm]⊢⁺ (([0, 0, 1] +> r) {{E}}> l) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_0011 (l r : ListBlank (Fin 2)) : + (([0, 0, 1, 1] +> r) <{{B}} l) [target_tm]⊢⁺ (([0, 1, 0, 0] +> r) {{E}}> l) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_00100 (l r : ListBlank (Fin 2)) : + (([0, 0, 1, 0, 0] +> r) <{{B}} l) [target_tm]⊢⁺ (r <{{B}} (l <+ [0, 1, 1, 1, 1])) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_001010 (l r : ListBlank (Fin 2)) : + (([0, 0, 1, 0, 1, 0] +> r) <{{B}} l) [target_tm]⊢⁺ (r <{{B}} (l <+ [0, 1, 1, 1, 1, 1])) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_0010110 (l r : ListBlank (Fin 2)) : + (([0, 0, 1, 0, 1, 1, 0] +> r) <{{B}} l) [target_tm]⊢⁺ (r <{{B}} (l <+ [0, 1, 1, 1, 1, 1, 1])) := + by + dsimp [ListBlank.append]; execute + +theorem rule_B_010 (l r : ListBlank (Fin 2)) : + (([0, 1, 0] +> r) <{{B}} l) [target_tm]⊢⁺ (r <{{B}} (l <+ [0, 1, 1])) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_0110 (l r : ListBlank (Fin 2)) : + (([0, 1, 1, 0] +> r) <{{B}} l) [target_tm]⊢⁺ (r <{{B}} (l <+ [0, 1, 1, 1])) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_10 (l r : ListBlank (Fin 2)) : + (([1, 0] +> r) <{{B}} l) [target_tm]⊢⁺ (r <{{B}} (l <+ [0, 0])) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_01111 (l r : ListBlank (Fin 2)) : + (r {{E}}> (l <+ [0, 1, 1, 1, 1])) [target_tm]⊢⁺ (([0, 0, 0, 1, 0] +> r) {{E}}> l) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_011111 (l r : ListBlank (Fin 2)) : + (r {{E}}> (l <+ [0, 1, 1, 1, 1, 1])) [target_tm]⊢⁺ (([0, 0, 0, 0, 1, 0] +> r) {{E}}> l) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_0111111 (l r : ListBlank (Fin 2)) : + (r {{E}}> (l <+ [0, 1, 1, 1, 1, 1, 1])) [target_tm]⊢⁺ (([0, 0, 0, 0, 0, 1, 0] +> r) {{E}}> l) := + by + dsimp [ListBlank.append]; execute + +theorem rule_E_011 (l r : ListBlank (Fin 2)) : + (r {{E}}> (l <+ [0, 1, 1])) [target_tm]⊢⁺ (([0, 1, 0] +> r) {{E}}> l) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_0111 (l r : ListBlank (Fin 2)) : + (r {{E}}> (l <+ [0, 1, 1, 1])) [target_tm]⊢⁺ (([0, 0, 1, 0] +> r) {{E}}> l) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_00 (l r : ListBlank (Fin 2)) : + (((0 : Fin 2) >> r) {{E}}> (l <+ [0, 0])) [target_tm]⊢⁺ (r <{{B}} (l <+ [0, 1, 1])) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_nil (r : ListBlank (Fin 2)) : + (((0 : Fin 2) >> r) {{E}}> default) [target_tm]⊢⁺ (r <{{B}} (default <+ [0, 1, 1])) := by + dsimp [ListBlank.append]; execute + +def Round (r r' : ListBlank (Fin 2)) : Prop := + ∀ l : ListBlank (Fin 2), (r <{{B}} l) [target_tm]⊢⁺ (r' {{E}}> l) + +inductive Sweeps : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) → Prop + | zero (r : ListBlank (Fin 2)) : Sweeps 0 r r + | succ {n : Nat} {r r₁ r₂ : ListBlank (Fin 2)} : + Round r r₁ → Sweeps n r₁ r₂ → Sweeps (n + 1) r r₂ + +theorem Sweeps.trans {a b : Nat} {r₁ r₂ r₃ : ListBlank (Fin 2)} + (h₁ : Sweeps a r₁ r₂) (h₂ : Sweeps b r₂ r₃) : Sweeps (a + b) r₁ r₃ := by + induction h₁ with + | zero _ => simpa using h₂ + | succ hr _ ih => + rw [Nat.succ_add] + exact Sweeps.succ hr (ih h₂) + +theorem round_000 (r : ListBlank (Fin 2)) : + Round ([0, 0, 0] +> r) ([0, 0, 1] +> r) := + fun l => rule_B_000 l r + +theorem round_0011 (r : ListBlank (Fin 2)) : + Round ([0, 0, 1, 1] +> r) ([0, 1, 0, 0] +> r) := + fun l => rule_B_0011 l r + +theorem round_00100 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 0, 1, 0, 0] +> r) ([0, 0, 0, 1, 0] +> r') := + fun l => stepPlus_trans (rule_B_00100 l r) + (stepPlus_trans (h (l <+ [0, 1, 1, 1, 1])) (rule_E_01111 l r')) + +theorem round_001010 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 0, 1, 0, 1, 0] +> r) ([0, 0, 0, 0, 1, 0] +> r') := + fun l => stepPlus_trans (rule_B_001010 l r) + (stepPlus_trans (h (l <+ [0, 1, 1, 1, 1, 1])) (rule_E_011111 l r')) + +theorem round_0010110 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 0, 1, 0, 1, 1, 0] +> r) ([0, 0, 0, 0, 0, 1, 0] +> r') := + fun l => stepPlus_trans (rule_B_0010110 l r) + (stepPlus_trans (h (l <+ [0, 1, 1, 1, 1, 1, 1])) (rule_E_0111111 l r')) + +theorem round_010 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 1, 0] +> r) ([0, 1, 0] +> r') := + fun l => stepPlus_trans (rule_B_010 l r) + (stepPlus_trans (h (l <+ [0, 1, 1])) (rule_E_011 l r')) + +theorem round_0110 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 1, 1, 0] +> r) ([0, 0, 1, 0] +> r') := + fun l => stepPlus_trans (rule_B_0110 l r) + (stepPlus_trans (h (l <+ [0, 1, 1, 1])) (rule_E_0111 l r')) + +theorem round_10 {r₁ r r₂ : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Round r r₂) : + Round ([1, 0] +> r₁) ([0, 1, 0] +> r₂) := + fun l => stepPlus_trans (rule_B_10 l r₁) + (stepPlus_trans (h₁ (l <+ [0, 0])) + (stepPlus_trans (rule_E_00 l r) + (stepPlus_trans (h₂ (l <+ [0, 1, 1])) (rule_E_011 l r₂)))) + +-- ============================================================================ +-- Section 3: Fueled Bool-List Round Runner (for Base Cases & Era 0 -> Era 5) +-- ============================================================================ + +theorem opt_map_some {α β : Type*} {f : α → β} {x : Option α} {y : β} + (h : x.map f = some y) : ∃ a, x = some a ∧ f a = y := by + cases x with + | none => nomatch h + | some a => injection h with h; exact ⟨a, rfl, h⟩ + +def b2f (b : Bool) : Fin 2 := if b then 1 else 0 + +def toTape : List Bool → ListBlank (Fin 2) + | [] => default + | b :: bs => b2f b >> toTape bs + +def pad7B (bs : List Bool) : List Bool := + bs ++ [false, false, false, false, false, false, false] + +theorem toTape_pad7B (bs : List Bool) : toTape (pad7B bs) = toTape bs := by + induction bs with + | nil => simp [pad7B, toTape, b2f] + | cons b bs ih => + simp only [pad7B, List.cons_append, toTape] + rw [← pad7B, ih] + +def dropTrailingFalse : List Bool → List Bool + | [] => [] + | b :: bs => + match dropTrailingFalse bs with + | [] => if b then [true] else [] + | rest => b :: rest + +theorem toTape_dropTrailingFalse : ∀ (bs : List Bool), + toTape (dropTrailingFalse bs) = toTape bs + | [] => rfl + | b :: bs => by + have ih := toTape_dropTrailingFalse bs + unfold dropTrailingFalse + cases hrest : dropTrailingFalse bs with + | nil => + rw [hrest] at ih + have hbs : toTape bs = default := ih.symm + cases b <;> simp [toTape, b2f, hbs] + | cons r rs => + rw [hrest] at ih + change b2f b >> toTape (r :: rs) = b2f b >> toTape bs + rw [ih] + +def roundBool : Nat → List Bool → Option (List Bool) + | 0, _ => none + | fuel + 1, bs => + match pad7B bs with + | false :: false :: false :: rest => + some (false :: false :: true :: rest) + | false :: false :: true :: true :: rest => + some (false :: true :: false :: false :: rest) + | false :: false :: true :: false :: false :: rest => + (roundBool fuel rest).map (fun r' => false :: false :: false :: true :: false :: r') + | false :: false :: true :: false :: true :: false :: rest => + (roundBool fuel rest).map (fun r' => false :: false :: false :: false :: true :: false :: r') + | false :: false :: true :: false :: true :: true :: false :: rest => + (roundBool fuel rest).map (fun r' => + false :: false :: false :: false :: false :: true :: false :: r') + | false :: true :: false :: rest => + (roundBool fuel rest).map (fun r' => false :: true :: false :: r') + | false :: true :: true :: false :: rest => + (roundBool fuel rest).map (fun r' => false :: false :: true :: false :: r') + | true :: false :: rest => + match roundBool fuel rest with + | some (false :: r1) => (roundBool fuel r1).map (fun r2 => false :: true :: false :: r2) + | _ => none + | _ => none + +theorem roundBool_sound : ∀ (fuel : Nat) (bs ys : List Bool), + roundBool fuel bs = some ys → Round (toTape bs) (toTape ys) + | 0, _, _, h => by nomatch h + | fuel + 1, bs, ys, h => by + rw [← toTape_pad7B bs] + unfold roundBool at h + generalize pad7B bs = pbs at h ⊢ + split at h + · injection h with h; subst h; exact round_000 _ + · injection h with h; subst h; exact round_0011 _ + · obtain ⟨r', hr', rfl⟩ := opt_map_some h + exact round_00100 (roundBool_sound fuel _ r' hr') + · obtain ⟨r', hr', rfl⟩ := opt_map_some h + exact round_001010 (roundBool_sound fuel _ r' hr') + · obtain ⟨r', hr', rfl⟩ := opt_map_some h + exact round_0010110 (roundBool_sound fuel _ r' hr') + · obtain ⟨r', hr', rfl⟩ := opt_map_some h + exact round_010 (roundBool_sound fuel _ r' hr') + · obtain ⟨r', hr', rfl⟩ := opt_map_some h + exact round_0110 (roundBool_sound fuel _ r' hr') + · next rest => + cases hr1 : roundBool fuel rest with + | none => rw [hr1] at h; nomatch h + | some p1 => + rw [hr1] at h + cases p1 with + | nil => nomatch h + | cons b0 r1 => + cases b0 with + | true => nomatch h + | false => + obtain ⟨r2, hr2, rfl⟩ := opt_map_some h + exact round_10 (roundBool_sound fuel rest (false :: r1) hr1) (roundBool_sound fuel r1 r2 + hr2) + · nomatch h + +def sweepsBool (fuel : Nat) : Nat → List Bool → Option (List Bool) + | 0, bs => some bs + | n + 1, bs => + match roundBool fuel bs with + | some bs1 => sweepsBool fuel n bs1 + | none => none + +theorem sweepsBool_sound (fuel : Nat) : ∀ (n : Nat) (bs ys : List Bool), + sweepsBool fuel n bs = some ys → Sweeps n (toTape bs) (toTape ys) + | 0, bs, ys, h => by injection h with h; subst h; exact Sweeps.zero _ + | n + 1, bs, ys, h => by + unfold sweepsBool at h + cases hr : roundBool fuel bs with + | none => rw [hr] at h; nomatch h + | some bs1 => + rw [hr] at h + exact Sweeps.succ (roundBool_sound fuel bs bs1 hr) (sweepsBool_sound fuel n bs1 ys h) + +def roundBoolTrim (fuel : Nat) (bs : List Bool) : Option (List Bool) := + (roundBool fuel bs).map dropTrailingFalse + +theorem roundBoolTrim_sound (fuel : Nat) (bs ys : List Bool) + (h : roundBoolTrim fuel bs = some ys) : Round (toTape bs) (toTape ys) := by + obtain ⟨raw, hraw, rfl⟩ := opt_map_some h + rw [toTape_dropTrailingFalse] + exact roundBool_sound fuel bs raw hraw + +def sweepsBoolTrim (fuel n : Nat) (bs : List Bool) : Option (List Bool) := + (sweepsBool fuel n bs).map dropTrailingFalse + +theorem sweepsBoolTrim_sound (fuel n : Nat) (bs ys : List Bool) + (h : sweepsBoolTrim fuel n bs = some ys) : Sweeps n (toTape bs) (toTape ys) := by + obtain ⟨raw, hraw, rfl⟩ := opt_map_some h + rw [toTape_dropTrailingFalse] + exact sweepsBool_sound fuel n bs raw hraw + +-- ============================================================================ +-- Section 4: rep010, EraRound, pDiv0, pDiv1, pB & Parameterized Lemmas +-- ============================================================================ + +def rep010 : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, r => r + | k + 1, r => [0, 1, 0] +> rep010 k r + +theorem rep010_add (a b : Nat) (r : ListBlank (Fin 2)) : + rep010 (a + b) r = rep010 a (rep010 b r) := by + induction a with + | zero => simp [rep010] + | succ a ih => simp [rep010, Nat.succ_add, ih] + +def EraRound (u r' : ListBlank (Fin 2)) : Prop := + ∃ v : ListBlank (Fin 2), u = (0 : Fin 2) >> v ∧ Round v r' + +theorem eraRound_tm_step {u r' : ListBlank (Fin 2)} (h : EraRound u r') : + (u {{E}}> default) [target_tm]⊢⁺ (([0, 1, 0] +> r') {{E}}> default) := by + obtain ⟨v, rfl, hv⟩ := h + exact stepPlus_trans (rule_E_nil v) + (stepPlus_trans (hv (default <+ [0, 1, 1])) (rule_E_011 default r')) + +theorem round_rep010 (k : Nat) {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round (rep010 k r) (rep010 k r') := by + induction k with + | zero => exact h + | succ k ih => exact round_010 ih + +theorem sweeps_rep010 (k : Nat) {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps n r r') : + Sweeps n (rep010 k r) (rep010 k r') := by + induction h with + | zero _ => exact Sweeps.zero _ + | succ hr _ ih => exact Sweeps.succ (round_rep010 k hr) ih + +theorem sweeps_010 {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps n r r') : + Sweeps n ([0, 1, 0] +> r) ([0, 1, 0] +> r') := + sweeps_rep010 1 h + +theorem eraRound_010 {s s₁ r' : ListBlank (Fin 2)} + (hR : Round s s₁) (hE : EraRound s₁ r') : + EraRound ([0, 1, 0] +> s) ([0, 1, 0] +> r') := by + obtain ⟨v₁, rfl, hv₁⟩ := hE + exact ⟨[1, 0] +> s, rfl, round_10 hR hv₁⟩ + +theorem eraRound_rep010 {N : Nat} {rem u r' : ListBlank (Fin 2)} + (hS : Sweeps N rem u) (hE : EraRound u r') : + EraRound (rep010 N rem) (rep010 N r') := by + induction hS with + | zero _ => exact hE + | @succ n _ _ _ hr _ ih => + exact eraRound_010 (round_rep010 n hr) (ih hE) + +def pDiv0 (r : ListBlank (Fin 2)) : ListBlank (Fin 2) := [0, 0, 0, 0, 1, 0] +> r +def pDiv1 (r : ListBlank (Fin 2)) : ListBlank (Fin 2) := [0, 0, 1, 0, 1, 0] +> r +def pB (r : ListBlank (Fin 2)) : ListBlank (Fin 2) := [0, 0, 1, 1, 0] +> r + +theorem round_pDiv0 (r : ListBlank (Fin 2)) : Round (pDiv0 r) (pDiv1 r) := + round_000 ([0, 1, 0] +> r) + +theorem round_pDiv1 {r r' : ListBlank (Fin 2)} (h : Round r r') : Round (pDiv1 r) (pDiv0 r') := + round_001010 h + +theorem sweeps_pDiv0_even {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k) (pDiv0 r) (pDiv0 r') := by + induction h with + | zero _ => exact Sweeps.zero _ + | @succ m r₀ r₁ r₂ hr _ ih => + have h2 : Sweeps 2 (pDiv0 r₀) (pDiv0 r₁) := + Sweeps.succ (round_pDiv0 r₀) (Sweeps.succ (round_pDiv1 hr) (Sweeps.zero _)) + have htr := Sweeps.trans h2 ih + rw [show 2 + 2 * m = 2 * (m + 1) by omega] at htr + exact htr + +theorem sweeps_pDiv0_odd {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k + 1) (pDiv0 r) (pDiv1 r') := + Sweeps.trans (sweeps_pDiv0_even h) (Sweeps.succ (round_pDiv0 r') (Sweeps.zero _)) + +theorem sweeps_pDiv1_even {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k) (pDiv1 r) (pDiv1 r') := by + induction h with + | zero _ => exact Sweeps.zero _ + | @succ m r₀ r₁ r₂ hr _ ih => + have h2 : Sweeps 2 (pDiv1 r₀) (pDiv1 r₁) := + Sweeps.succ (round_pDiv1 hr) (Sweeps.succ (round_pDiv0 r₁) (Sweeps.zero _)) + have htr := Sweeps.trans h2 ih + rw [show 2 + 2 * m = 2 * (m + 1) by omega] at htr + exact htr + +theorem sweeps_pDiv1_odd {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps (k + 1) r r') : + Sweeps (2 * k + 1) (pDiv1 r) (pDiv0 r') := by + cases h with + | succ hr hs => + exact Sweeps.succ (round_pDiv1 hr) (sweeps_pDiv0_even hs) + +def StartsZero (u : ListBlank (Fin 2)) : Prop := + ∃ v : ListBlank (Fin 2), u = (0 : Fin 2) >> v + +theorem rep010_startsZero (k : Nat) {u : ListBlank (Fin 2)} (hu : StartsZero u) : + StartsZero (rep010 k u) := by + cases k with + | zero => exact hu + | succ k => exact ⟨[1, 0] +> rep010 k u, rfl⟩ + +theorem sweeps_pB_010_startsZero {u : ListBlank (Fin 2)} (hu : StartsZero u) : + Sweeps 2 (pB ([0, 1, 0] +> u)) ([0, 1, 0] +> pB u) := by + obtain ⟨v, rfl⟩ := hu + refine Sweeps.succ (round_0011 ([0, 0, 1, 0, 0] +> v)) ?_ + refine Sweeps.succ (round_010 (round_000 ([1, 0, 0] +> v))) ?_ + exact Sweeps.zero _ + +theorem sweeps_pB_rep010 (k : Nat) {u : ListBlank (Fin 2)} (hu : StartsZero u) : + Sweeps (2 * k) (pB (rep010 k u)) (rep010 k (pB u)) := by + induction k with + | zero => exact Sweeps.zero _ + | succ k ih => + have h2 := sweeps_pB_010_startsZero (rep010_startsZero k hu) + have htr := Sweeps.trans h2 (sweeps_010 ih) + rw [show 2 + 2 * k = 2 * (k + 1) by omega] at htr + exact htr + +theorem sweeps_pB_pDiv0 {u u₁ : ListBlank (Fin 2)} (h1 : Round u u₁) : + Sweeps 6 (pB (pDiv0 u)) (rep010 2 (pB u₁)) := by + refine Sweeps.succ (round_0011 ([0, 0, 0, 0, 0, 1, 0] +> u)) ?_ + refine Sweeps.succ (round_010 (round_000 ([0, 0, 0, 1, 0] +> u))) ?_ + refine Sweeps.succ (round_010 (round_00100 (round_010 h1))) ?_ + refine Sweeps.succ (round_010 (round_000 ([1, 0, 0, 1, 0] +> u₁))) ?_ + refine Sweeps.succ (round_010 (round_0011 ([0, 0, 1, 0] +> u₁))) ?_ + refine Sweeps.succ (round_010 (round_010 (round_000 ([1, 0] +> u₁)))) ?_ + exact Sweeps.zero _ + +theorem sweeps_pB_pDiv1 {u u₁ r₁' : ListBlank (Fin 2)} + (h1 : Round u u₁) (hE : EraRound u₁ r₁') : + Sweeps 3 (pB (pDiv1 u)) ([0, 1, 0] +> pDiv0 ([0, 1, 0] +> r₁')) := by + obtain ⟨v₁, rfl, hv₁⟩ := hE + refine Sweeps.succ (round_0011 ([0, 0, 0, 1, 0, 1, 0] +> u)) ?_ + refine Sweeps.succ (round_010 (round_000 ([0, 1, 0, 1, 0] +> u))) ?_ + refine Sweeps.succ (round_010 (round_001010 (round_10 h1 hv₁))) ?_ + exact Sweeps.zero _ + +theorem eraRound_pDiv0 (u : ListBlank (Fin 2)) : + EraRound (pDiv0 u) (pB u) := + ⟨[0, 0, 0, 1, 0] +> u, rfl, round_000 ([1, 0] +> u)⟩ + +theorem eraRound_pDiv1 {u u₁ r₁' : ListBlank (Fin 2)} + (h1 : Round u u₁) (hE : EraRound u₁ r₁') : + EraRound (pDiv1 u) (rep010 2 r₁') := by + obtain ⟨v₁, rfl, hv₁⟩ := hE + exact ⟨[0, 1, 0, 1, 0] +> u, rfl, round_010 (round_10 h1 hv₁)⟩ + +-- ============================================================================ +-- Section 5: CoreTree, UTree, stepDefaultAux, stepCore, stepU & Soundness +-- ============================================================================ + +inductive CoreTree : Type where + | sw0 : CoreTree + | sw1 : CoreTree + | sw2 : CoreTree + | sw3 : CoreTree + | div0 : Nat → CoreTree → CoreTree + | div1 : Nat → CoreTree → CoreTree + deriving DecidableEq + +abbrev UTree := Nat × CoreTree + +def evalCore : CoreTree → ListBlank (Fin 2) + | .sw0 => default + | .sw1 => [0, 0, 1] +> default + | .sw2 => [0, 0, 0, 1, 0, 0, 0, 1, 0] +> default + | .sw3 => [0, 0, 1, 1, 0, 0, 0, 1, 0] +> default + | .div0 k ch => pDiv0 (rep010 k (evalCore ch)) + | .div1 k ch => pDiv1 (rep010 k (evalCore ch)) + +def evalU (u : UTree) : ListBlank (Fin 2) := + rep010 u.1 (evalCore u.2) + +theorem evalCore_startsZero (w : CoreTree) : StartsZero (evalCore w) := by + cases w with + | sw0 => exact ⟨default, zero_cons_default.symm⟩ + | sw1 => exact ⟨[0, 1] +> default, rfl⟩ + | sw2 => exact ⟨[0, 0, 1, 0, 0, 0, 1, 0] +> default, rfl⟩ + | sw3 => exact ⟨[0, 1, 1, 0, 0, 0, 1, 0] +> default, rfl⟩ + | div0 k ch => exact ⟨[0, 0, 0, 1, 0] +> rep010 k (evalCore ch), rfl⟩ + | div1 k ch => exact ⟨[0, 1, 0, 1, 0] +> rep010 k (evalCore ch), rfl⟩ + +def levelCore : CoreTree → Nat + | .sw0 => 1 + | .sw1 => 2 + | .sw2 => 3 + | .sw3 => 4 + | .div0 k ch => 2 * (3 * k + levelCore ch) + | .div1 k ch => 2 * (3 * k + levelCore ch) + 1 + +def levelU (u : UTree) : Nat := + 3 * u.1 + levelCore u.2 + +theorem levelCore_pos (w : CoreTree) : 1 ≤ levelCore w := by + induction w with + | sw0 | sw1 | sw2 | sw3 => decide + | div0 k ch ih => dsimp [levelCore]; omega + | div1 k ch ih => dsimp [levelCore]; omega + +def mkSw : Nat → CoreTree + | 0 => .sw0 + | 1 => .sw1 + | 2 => .sw2 + | _ => .sw3 + +def coreTagIdx : CoreTree → Option Nat + | .sw0 => some 0 + | .sw1 => some 1 + | .sw2 => some 2 + | .sw3 => some 3 + | .div0 _ _ => none + | .div1 _ _ => none + +def stepDefaultAux : Nat → Nat → UTree + | 0, s => (0, mkSw s) + | fuel + 1, s => + if s ≤ 3 then (0, mkSw s) + else + let m := s - 4 + let sub := stepDefaultAux fuel (m / 2) + if m % 2 = 0 then (1, .div0 sub.1 sub.2) else (1, .div1 sub.1 sub.2) + +theorem stepDefaultAux_le3 (fuel s : Nat) (hs : s ≤ 3) : + stepDefaultAux fuel s = (0, mkSw s) := by + cases fuel with + | zero => rfl + | succ fuel => simp [stepDefaultAux, hs] + +theorem stepDefaultAux_add4 (fuel m : Nat) : + stepDefaultAux (fuel + 1) (m + 4) = + (let sub := stepDefaultAux fuel (m / 2) + if m % 2 = 0 then (1, .div0 sub.1 sub.2) else (1, .div1 sub.1 sub.2)) := by + have h : ¬(m + 4 ≤ 3) := by omega + have hm : m + 4 - 4 = m := by omega + simp [stepDefaultAux, hm] + +def stepDefault (s : Nat) : UTree := + stepDefaultAux s s + +def stepCore (s : Nat) : CoreTree → UTree + | .sw0 => stepDefault s + | .sw1 => stepDefault (s + 1) + | .sw2 => stepDefault (s + 2) + | .sw3 => stepDefault (s + 3) + | .div0 k ch => + let sub := stepCore (s / 2) ch + if s % 2 = 0 then (0, .div0 (k + sub.1) sub.2) else (0, .div1 (k + sub.1) sub.2) + | .div1 k ch => + let sub := stepCore ((s + 1) / 2) ch + if s % 2 = 0 then (0, .div1 (k + sub.1) sub.2) else (0, .div0 (k + sub.1) sub.2) + +def stepU (s : Nat) (u : UTree) : UTree := + let sub := stepCore s u.2 + (u.1 + sub.1, sub.2) + +def stepDiv0Sw0 (s : Nat) : CoreTree := + let sub := stepDefault (s / 2) + if s % 2 = 0 then .div0 sub.1 sub.2 else .div1 sub.1 sub.2 + +def stepDivCore (s : Nat) : CoreTree → CoreTree + | .div0 k ch => + let sub := stepCore (s / 2) ch + if s % 2 = 0 then .div0 (k + sub.1) sub.2 else .div1 (k + sub.1) sub.2 + | .div1 k ch => + let sub := stepCore ((s + 1) / 2) ch + if s % 2 = 0 then .div1 (k + sub.1) sub.2 else .div0 (k + sub.1) sub.2 + | w => w + +theorem levelU_stepDefaultAux : ∀ (fuel s : Nat), s ≤ fuel → + levelU (stepDefaultAux fuel s) = s + 1 + | 0, s, hs => by + have hs0 : s = 0 := by omega + subst hs0; rfl + | fuel + 1, s, hs => by + rcases (by omega : s ≤ 3 ∨ 4 ≤ s) with hle | hge + · rw [stepDefaultAux_le3 (fuel + 1) s hle] + rcases (by omega : s = 0 ∨ s = 1 ∨ s = 2 ∨ s = 3) with rfl | rfl | rfl | rfl <;> rfl + · obtain ⟨m, rfl⟩ : ∃ m, s = m + 4 := ⟨s - 4, by omega⟩ + rw [stepDefaultAux_add4] + have ih := levelU_stepDefaultAux fuel (m / 2) (by omega) + rcases (by omega : m % 2 = 0 ∨ ¬(m % 2 = 0)) with hev | hod + · simp only [hev, ↓reduceIte, levelU, levelCore] + unfold levelU at ih; omega + · simp only [hod, ↓reduceIte, levelU, levelCore] + unfold levelU at ih; omega + +theorem levelU_stepDefault (s : Nat) : levelU (stepDefault s) = s + 1 := + levelU_stepDefaultAux s s (le_refl s) + +theorem levelU_stepCore (s : Nat) (w : CoreTree) : + levelU (stepCore s w) = levelCore w + s := by + induction w generalizing s with + | sw0 => simp [stepCore, levelU_stepDefault, levelCore]; omega + | sw1 => simp [stepCore, levelU_stepDefault, levelCore]; omega + | sw2 => simp [stepCore, levelU_stepDefault, levelCore]; omega + | sw3 => simp [stepCore, levelU_stepDefault, levelCore]; omega + | div0 k ch ih => + have hsub := ih (s / 2) + rcases (by omega : s % 2 = 0 ∨ ¬(s % 2 = 0)) with hev | hod + · simp only [stepCore, hev, ↓reduceIte, levelU, levelCore] + unfold levelU at hsub; omega + · simp only [stepCore, hod, ↓reduceIte, levelU, levelCore] + unfold levelU at hsub; omega + | div1 k ch ih => + have hsub := ih ((s + 1) / 2) + rcases (by omega : s % 2 = 0 ∨ ¬(s % 2 = 0)) with hev | hod + · simp only [stepCore, hev, ↓reduceIte, levelU, levelCore] + unfold levelU at hsub; omega + · simp only [stepCore, hod, ↓reduceIte, levelU, levelCore] + unfold levelU at hsub; omega + +theorem levelU_stepU (s : Nat) (u : UTree) : levelU (stepU s u) = levelU u + s := by + rcases u with ⟨k, w⟩ + have hsub := levelU_stepCore s w + unfold stepU levelU at * + dsimp only at * + omega + +theorem levelCore_stepDiv0Sw0 (s : Nat) : levelCore (stepDiv0Sw0 s) = s + 2 := by + have hsub := levelU_stepDefault (s / 2) + rcases (by omega : s % 2 = 0 ∨ ¬(s % 2 = 0)) with hev | hod + · simp only [stepDiv0Sw0, hev, ↓reduceIte, levelCore] + unfold levelU at hsub; omega + · simp only [stepDiv0Sw0, hod, ↓reduceIte, levelCore] + unfold levelU at hsub; omega + +theorem levelCore_stepDivCore (s : Nat) (w : CoreTree) (hw : coreTagIdx w = none) : + levelCore (stepDivCore s w) = levelCore w + s := by + cases w with + | sw0 | sw1 | sw2 | sw3 => nomatch hw + | div0 k ch => + have hsub := levelU_stepCore (s / 2) ch + rcases (by omega : s % 2 = 0 ∨ ¬(s % 2 = 0)) with hev | hod + · simp only [stepDivCore, hev, ↓reduceIte, levelCore] + unfold levelU at hsub; omega + · simp only [stepDivCore, hod, ↓reduceIte, levelCore] + unfold levelU at hsub; omega + | div1 k ch => + have hsub := levelU_stepCore ((s + 1) / 2) ch + rcases (by omega : s % 2 = 0 ∨ ¬(s % 2 = 0)) with hev | hod + · simp only [stepDivCore, hev, ↓reduceIte, levelCore] + unfold levelU at hsub; omega + · simp only [stepDivCore, hod, ↓reduceIte, levelCore] + unfold levelU at hsub; omega + +theorem round_sw0_sw1 : Round (evalCore .sw0) (evalCore .sw1) := + roundBoolTrim_sound 5 [] [false, false, true] rfl + +theorem round_sw1_sw2 : Round (evalCore .sw1) (evalCore .sw2) := by + have h := roundBoolTrim_sound 10 [false, false, true] + [false, false, false, true, false, false, false, true] rfl + simpa [toTape, b2f, evalCore, zero_cons_default] using h + +theorem round_sw2_sw3 : Round (evalCore .sw2) (evalCore .sw3) := by + have h := roundBoolTrim_sound 10 [false, false, false, true, false, false, false, true] + [false, false, true, true, false, false, false, true] rfl + simpa [toTape, b2f, evalCore, zero_cons_default] using h + +theorem round_sw3_div0 : Round (evalCore .sw3) (evalU (1, .div0 0 .sw0)) := by + have h := roundBoolTrim_sound 10 [false, false, true, true, false, false, false, true] + [false, true, false, false, false, false, false, true] rfl + simpa [toTape, b2f, evalCore, evalU, rep010, pDiv0, zero_cons_default] using h + +theorem stepDefaultAux_eq (fuel₁ fuel₂ s : Nat) (h1 : s ≤ fuel₁) (h2 : s ≤ fuel₂) : + stepDefaultAux fuel₁ s = stepDefaultAux fuel₂ s := by + induction fuel₁ generalizing fuel₂ s with + | zero => + have hs0 : s = 0 := by omega + subst hs0 + exact (stepDefaultAux_le3 fuel₂ 0 (by omega)).symm + | succ fuel₁ ih => + rcases (by omega : s ≤ 3 ∨ 4 ≤ s) with hle | hge + · rw [stepDefaultAux_le3 _ s hle, stepDefaultAux_le3 _ s hle] + · obtain ⟨m, rfl⟩ : ∃ m, s = m + 4 := ⟨s - 4, by omega⟩ + cases fuel₂ with + | zero => omega + | succ fuel₂ => + rw [stepDefaultAux_add4, stepDefaultAux_add4] + have heq := ih fuel₂ (m / 2) (by omega) (by omega) + simp only [heq] + +theorem stepDefault_add4_eq (m : Nat) : + stepDefault (m + 4) = (1, stepDiv0Sw0 m) := by + change stepDefaultAux ((m + 3) + 1) (m + 4) = (1, stepDiv0Sw0 m) + rw [stepDefaultAux_add4] + have h := stepDefaultAux_eq (m + 3) (m / 2) (m / 2) (by omega) (le_refl _) + unfold stepDiv0Sw0 stepDefault + rw [h] + rcases (by omega : m % 2 = 0 ∨ ¬(m % 2 = 0)) with hev | hod + · simp only [hev, ↓reduceIte] + · simp only [hod, ↓reduceIte] + +theorem stepDefault_one_more : ∀ (q : Nat), + Round (evalU (stepDefault q)) (evalU (stepDefault (q + 1))) := by + intro q + induction q using Nat.strongRecOn with + | ind q ih => + rcases (by omega : q = 0 ∨ q = 1 ∨ q = 2 ∨ q = 3 ∨ 4 ≤ q) with rfl | rfl | rfl | rfl | hq4 + · exact round_sw0_sw1 + · exact round_sw1_sw2 + · exact round_sw2_sw3 + · exact round_sw3_div0 + · obtain ⟨m, rfl⟩ : ∃ m, q = m + 4 := ⟨q - 4, by omega⟩ + have h1 := stepDefault_add4_eq m + have h2 := stepDefault_add4_eq (m + 1) + have h_add : m + 4 + 1 = m + 1 + 4 := by omega + rw [h1, h_add, h2] + refine round_010 ?_ + unfold stepDiv0Sw0 + rcases (by omega : m % 2 = 0 ∨ m % 2 = 1) with hev | hod + · have hev1 : (m + 1) % 2 = 1 := by omega + have hdiv : (m + 1) / 2 = m / 2 := by omega + simp only [hev, hev1, hdiv, evalCore, ↓reduceIte] + exact round_pDiv0 _ + · have hod1 : (m + 1) % 2 = 0 := by omega + have hdiv : (m + 1) / 2 = m / 2 + 1 := by omega + have hev' : ¬(m % 2 = 0) := by omega + simp only [hev', hod1, hdiv, evalCore, ↓reduceIte] + exact round_pDiv1 (ih (m / 2) (by omega)) + +theorem round_stepDiv0Sw0 (m : Nat) : + Round (evalCore (stepDiv0Sw0 m)) (evalCore (stepDiv0Sw0 (m + 1))) := by + unfold stepDiv0Sw0 + rcases (by omega : m % 2 = 0 ∨ m % 2 = 1) with hev | hod + · have hev1 : (m + 1) % 2 = 1 := by omega + have hdiv : (m + 1) / 2 = m / 2 := by omega + simp only [hev, hev1, hdiv, evalCore, ↓reduceIte] + exact round_pDiv0 _ + · have hod1 : (m + 1) % 2 = 0 := by omega + have hdiv : (m + 1) / 2 = m / 2 + 1 := by omega + have hev' : ¬(m % 2 = 0) := by omega + simp only [hev', hod1, hdiv, evalCore, ↓reduceIte] + exact round_pDiv1 (stepDefault_one_more (m / 2)) + +theorem stepDefault_from (t s : Nat) : + Sweeps s (evalU (stepDefault t)) (evalU (stepDefault (s + t))) := by + induction s with + | zero => simpa using Sweeps.zero _ + | succ s ih => + have h1 := Sweeps.succ (stepDefault_one_more (s + t)) (Sweeps.zero _) + have htr := Sweeps.trans ih h1 + rw [show s + t + 1 = (s + 1) + t by omega] at htr + exact htr + +theorem stepDefault_sound (s : Nat) : Sweeps s (evalCore .sw0) (evalU (stepDefault s)) := by + have h := stepDefault_from 0 s + rw [Nat.add_zero] at h + exact h + +theorem stepCore_sound (s : Nat) (w : CoreTree) : + Sweeps s (evalCore w) (evalU (stepCore s w)) := by + induction w generalizing s with + | sw0 => exact stepDefault_sound s + | sw1 => exact stepDefault_from 1 s + | sw2 => exact stepDefault_from 2 s + | sw3 => exact stepDefault_from 3 s + | div0 k ch ih => + have hsub := sweeps_rep010 k (ih (s / 2)) + rw [evalU, ← rep010_add] at hsub + rcases (by omega : s % 2 = 0 ∨ ¬(s % 2 = 0)) with hev | hod + · simp only [stepCore, hev, ↓reduceIte, evalU, rep010, evalCore] + have h := sweeps_pDiv0_even hsub + rwa [show 2 * (s / 2) = s by omega] at h + · simp only [stepCore, hod, ↓reduceIte, evalU, rep010, evalCore] + have h := sweeps_pDiv0_odd hsub + rwa [show 2 * (s / 2) + 1 = s by omega] at h + | div1 k ch ih => + rcases (by omega : s % 2 = 0 ∨ ¬(s % 2 = 0)) with hev | hod + · simp only [stepCore, hev, ↓reduceIte, evalU, rep010, evalCore] + have h_eq : (s + 1) / 2 = s / 2 := by omega + have hsub := sweeps_rep010 k (ih ((s + 1) / 2)) + rw [evalU, ← rep010_add] at hsub + have hsub' : Sweeps (s / 2) (rep010 k (evalCore ch)) (rep010 (k + (stepCore ((s + 1) / 2) + ch).1) (evalCore (stepCore ((s + 1) / 2) ch).2)) := by + rwa [← h_eq] + have h := sweeps_pDiv1_even hsub' + rwa [show 2 * (s / 2) = s by omega] at h + · simp only [stepCore, hod, ↓reduceIte, evalU, rep010, evalCore] + have h_eq : (s + 1) / 2 = s / 2 + 1 := by omega + have hsub := sweeps_rep010 k (ih ((s + 1) / 2)) + rw [evalU, ← rep010_add] at hsub + have hsub' : Sweeps (s / 2 + 1) (rep010 k (evalCore ch)) (rep010 (k + (stepCore ((s + 1) / 2) + ch).1) (evalCore (stepCore ((s + 1) / 2) ch).2)) := by + rwa [← h_eq] + have h := sweeps_pDiv1_odd hsub' + rwa [show 2 * (s / 2) + 1 = s by omega] at h + +theorem stepU_sound (s : Nat) (u : UTree) : + Sweeps s (evalU u) (evalU (stepU s u)) := by + have h := sweeps_rep010 u.1 (stepCore_sound s u.2) + unfold stepU evalU at * + rwa [← rep010_add] at h + +theorem stepDivCore_sound (s : Nat) (w : CoreTree) (hw : coreTagIdx w = none) : + Sweeps s (evalCore w) (evalCore (stepDivCore s w)) := by + cases w with + | sw0 | sw1 | sw2 | sw3 => nomatch hw + | div0 k ch => + have h := stepCore_sound s (.div0 k ch) + rcases (by omega : s % 2 = 0 ∨ ¬(s % 2 = 0)) with hev | hod + · simpa [stepCore, stepDivCore, hev, evalU, rep010] using h + · simpa [stepCore, stepDivCore, hod, evalU, rep010] using h + | div1 k ch => + have h := stepCore_sound s (.div1 k ch) + rcases (by omega : s % 2 = 0 ∨ ¬(s % 2 = 0)) with hev | hod + · simpa [stepCore, stepDivCore, hev, evalU, rep010] using h + · simpa [stepCore, stepDivCore, hod, evalU, rep010] using h + +theorem round_of_sweeps_one {r r' : ListBlank (Fin 2)} (h : Sweeps 1 r r') : Round r r' := by + cases h with + | succ hr h0 => + cases h0 with + | zero _ => exact hr + +-- ============================================================================ +-- Section 6: Fueled 2-Function opsAux & Soundness +-- ============================================================================ + +structure ResB where + c : Nat + u : UTree + +structure ResP where + p : Nat + c : Nat + u : UTree + +structure Ops where + bCore : CoreTree → ResB + aCore : CoreTree → ResP + +def bUFrom (bCoreFn : CoreTree → ResB) : UTree → ResB + | (k, w) => + let sub := bCoreFn w + ⟨2 * k + sub.c, (k + sub.u.1, sub.u.2)⟩ + +def aPullSucc (aCoreFn : CoreTree → ResP) (k : Nat) (w : CoreTree) : ResP := + match coreTagIdx w with + | some t => + if k + t ≤ 3 then + let sub := aCoreFn (mkSw (k + t)) + ⟨k + sub.p, sub.c, sub.u⟩ + else + let sub := aCoreFn (stepDiv0Sw0 (k + t - 3)) + ⟨k + 1 + sub.p, sub.c, sub.u⟩ + | none => + let sub := aCoreFn (stepDivCore k w) + ⟨k + sub.p, sub.c, sub.u⟩ + +def aPullFrom (aCoreFn : CoreTree → ResP) : UTree → ResP + | (0, w) => aCoreFn w + | (k' + 1, w) => aPullSucc aCoreFn (k' + 1) w + +def opsAux : Nat → Ops + | 0 => { + bCore := fun _ => ⟨0, (0, .sw0)⟩ + aCore := fun _ => ⟨0, 0, (0, .sw0)⟩ + } + | fuel + 1 => + let prev := opsAux fuel + { + bCore := fun w => + match w with + | .sw0 => ⟨1, (1, .sw0)⟩ + | .sw1 => ⟨0, (0, .sw3)⟩ + | .sw2 => ⟨15, (6, .div0 0 .sw2)⟩ + | .sw3 => ⟨9, (3, .div0 0 .sw2)⟩ + | .div0 k ch => + if k = 0 ∧ ch = .sw0 then + ⟨6, (2, .sw3)⟩ + else + let u1 := stepU 1 (k, ch) + let sub := bUFrom prev.bCore u1 + ⟨6 + sub.c, (2 + sub.u.1, sub.u.2)⟩ + | .div1 k ch => + if k = 0 ∧ ch = .sw0 then + ⟨3, (1, .div0 2 .sw1)⟩ + else + let u1 := stepU 1 (k, ch) + let sub := aPullFrom prev.aCore u1 + ⟨3 + 2 * sub.c, (1, .div0 (1 + sub.p + sub.u.1) sub.u.2)⟩ + aCore := fun w => + match w with + | .sw0 => ⟨0, 0, (0, .sw1)⟩ + | .sw1 => ⟨1, 0, (0, .sw1)⟩ + | .sw2 => ⟨0, 2, (1, .sw2)⟩ + | .sw3 => ⟨0, 11, (4, .div0 0 .sw2)⟩ + | .div0 k ch => + if k = 0 ∧ ch = .sw0 then + ⟨0, 1, (1, .sw0)⟩ + else + let sub := bUFrom prev.bCore (k, ch) + ⟨0, sub.c, sub.u⟩ + | .div1 k ch => + if k = 0 ∧ ch = .sw0 then + ⟨3, 0, (0, .sw1)⟩ + else + let u1 := stepU 1 (k, ch) + let sub := aPullFrom prev.aCore u1 + ⟨2 + sub.p, sub.c, sub.u⟩ + } + +theorem bCore_sw0_sound : Sweeps 1 (pB (evalCore .sw0)) (evalU (1, .sw0)) := by + have h := sweepsBoolTrim_sound 10 1 [false, false, true, true, false] + [false, true] rfl + simpa [toTape, b2f, pB, evalCore, evalU, rep010, zero_cons_default] using h + +theorem bCore_sw1_sound : Sweeps 0 (pB (evalCore .sw1)) (evalU (0, .sw3)) := by + have heq : pB (evalCore .sw1) = evalU (0, .sw3) := by + simp [pB, evalCore, evalU, rep010] + rw [heq]; exact Sweeps.zero _ + +set_option maxRecDepth 2000000 in +theorem bCore_sw2_sound : Sweeps 15 (pB (evalCore .sw2)) (evalU (6, .div0 0 .sw2)) := by + have h := sweepsBoolTrim_sound 20 15 + [false, false, true, true, false, false, false, false, true, false, false, false, true] + [false, true, false, false, true, false, false, true, false, false, true, false, false, true, + false, false, true, false, + false, false, false, false, true, false, false, false, false, true, false, false, false, + true] rfl + simpa [toTape, b2f, pB, evalCore, evalU, rep010, pDiv0, zero_cons_default] using h + +set_option maxRecDepth 2000000 in +theorem bCore_sw3_sound : Sweeps 9 (pB (evalCore .sw3)) (evalU (3, .div0 0 .sw2)) := by + have h := sweepsBoolTrim_sound 20 9 + [false, false, true, true, false, false, false, true, true, false, false, false, true] + [false, true, false, false, true, false, false, true, false, + false, false, false, false, true, false, false, false, false, true, false, false, false, + true] rfl + simpa [toTape, b2f, pB, evalCore, evalU, rep010, pDiv0, zero_cons_default] using h + +theorem bCore_div0_sw0_sound : Sweeps 6 (pB (evalCore (.div0 0 .sw0))) (evalU (2, .sw3)) := by + have h := sweepsBoolTrim_sound 20 6 + [false, false, true, true, false, false, false, false, false, true] + [false, true, false, false, true, false, false, false, true, true, false, false, false, + true] rfl + simpa [toTape, b2f, pB, evalCore, evalU, rep010, pDiv0, zero_cons_default] using h + +theorem bCore_div1_sw0_sound : Sweeps 3 (pB (evalCore (.div1 0 .sw0))) (evalU (1, .div0 2 .sw1)) := + by + have h := sweepsBoolTrim_sound 20 3 + [false, false, true, true, false, false, false, true, false, true] + [false, true, false, false, false, false, false, true, false, + false, true, false, false, true, false, false, false, true] rfl + simpa [toTape, b2f, pB, evalCore, evalU, rep010, pDiv0, pDiv1, zero_cons_default] using h + +theorem aCore_sw0_sound : EraRound (evalCore .sw0) (rep010 0 (evalCore .sw1)) := + ⟨default, zero_cons_default.symm, round_sw0_sw1⟩ + +theorem aCore_sw1_sound : EraRound (evalCore .sw1) (rep010 1 (evalCore .sw1)) := by + refine ⟨[0, 1] +> default, rfl, ?_⟩ + have h := roundBoolTrim_sound 10 [false, true] [false, true, false, false, false, true] rfl + simpa [toTape, b2f, evalCore, rep010, zero_cons_default] using h + +theorem aCore_sw2_sound : + ∃ r', EraRound (evalCore .sw2) (rep010 0 r') ∧ Sweeps 2 r' (evalU (1, .sw2)) := by + refine ⟨[0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1] +> default, ?_, ?_⟩ + · refine ⟨[0, 0, 1, 0, 0, 0, 1, 0] +> default, rfl, ?_⟩ + have h := roundBoolTrim_sound 10 [false, false, true, false, false, false, true] + [false, false, false, true, false, false, true, false, false, false, true] rfl + simpa [toTape, b2f, rep010, zero_cons_default] using h + · have h := sweepsBoolTrim_sound 15 2 + [false, false, false, true, false, false, true, false, false, false, true] + [false, true, false, false, false, false, true, false, false, false, true] rfl + simpa [toTape, b2f, evalU, evalCore, rep010, zero_cons_default] using h + +set_option maxRecDepth 2000000 in +theorem aCore_sw3_sound : + ∃ r', EraRound (evalCore .sw3) (rep010 0 r') ∧ Sweeps 11 r' (evalU (4, .div0 0 .sw2)) := by + refine ⟨[0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1] +> default, ?_, ?_⟩ + · refine ⟨[0, 1, 1, 0, 0, 0, 1, 0] +> default, rfl, ?_⟩ + have h := roundBoolTrim_sound 10 [false, true, true, false, false, false, true] + [false, false, true, false, false, false, false, true, false, false, false, true] rfl + simpa [toTape, b2f, rep010, zero_cons_default] using h + · have h := sweepsBoolTrim_sound 20 11 + [false, false, true, false, false, false, false, true, false, false, false, true] + [false, true, false, false, true, false, false, true, false, false, true, false, + false, false, false, false, true, false, false, false, false, true, false, false, false, + true] rfl + simpa [toTape, b2f, evalU, evalCore, rep010, pDiv0, zero_cons_default] using h + +theorem aCore_div0_sw0_sound : + ∃ r', EraRound (evalCore (.div0 0 .sw0)) (rep010 0 r') ∧ Sweeps 1 r' (evalU (1, .sw0)) := + ⟨pB (evalCore .sw0), eraRound_pDiv0 (evalCore .sw0), bCore_sw0_sound⟩ + +theorem aCore_div1_sw0_sound : + EraRound (evalCore (.div1 0 .sw0)) (rep010 3 (evalCore .sw1)) := by + have h := eraRound_pDiv1 round_sw0_sw1 aCore_sw1_sound + simpa [evalCore, rep010] using h + +theorem levelU_gt_one_of_ne_sw0 {k : Nat} {ch : CoreTree} (h : ¬(k = 0 ∧ ch = .sw0)) : + 2 ≤ levelU (k, ch) := by + cases k with + | zero => + cases ch with + | sw0 => exact absurd ⟨rfl, rfl⟩ h + | sw1 | sw2 | sw3 => decide + | div0 k' ch' => have := levelCore_pos ch'; simp [levelU, levelCore]; omega + | div1 k' ch' => have := levelCore_pos ch'; simp [levelU, levelCore]; omega + | succ k => + have := levelCore_pos ch + unfold levelU; dsimp only; omega + +theorem bUFrom_sound {bCoreFn : CoreTree → ResB} {fuel : Nat} + (hb : ∀ w : CoreTree, levelCore w ≤ fuel → + Sweeps (bCoreFn w).c (pB (evalCore w)) (evalU (bCoreFn w).u)) + (u : UTree) (hu : levelU u ≤ fuel) : + let res := bUFrom bCoreFn u + Sweeps res.c (pB (evalU u)) (evalU res.u) := by + rcases u with ⟨k, w⟩ + have hcw : levelCore w ≤ fuel := by unfold levelU at hu; dsimp only at hu; omega + have hsub := hb w hcw + have h1 := sweeps_pB_rep010 k (evalCore_startsZero w) + have h2 := sweeps_rep010 k hsub + have htr := Sweeps.trans h1 h2 + unfold bUFrom evalU at * + dsimp only at * + rwa [← rep010_add] at htr + +theorem stepCore_eq_stepDefault {w : CoreTree} {t k : Nat} (ht : coreTagIdx w = some t) : + stepCore k w = stepDefault (k + t) := by + cases w <;> simp only [coreTagIdx, Option.some.injEq, reduceCtorEq] at ht <;> + subst ht <;> simp [stepCore] + +theorem aPullSucc_sound {aCoreFn : CoreTree → ResP} {fuel k : Nat} {w : CoreTree} + (hk : 1 ≤ k) + (ha : ∀ w' : CoreTree, levelCore w' ≤ fuel → + let res := aCoreFn w' + ∃ r', EraRound (evalCore w') (rep010 res.p r') ∧ Sweeps res.c r' (evalU res.u)) + (hu : 3 * k + levelCore w ≤ fuel) : + let res := aPullSucc aCoreFn k w + ∃ r', EraRound (rep010 k (evalCore w)) (rep010 res.p r') ∧ Sweeps res.c r' (evalU res.u) := by + dsimp only + cases htag : coreTagIdx w with + | some t => + have ht_le : t ≤ 3 ∧ levelCore w = t + 1 := by + cases w <;> simp only [coreTagIdx, Option.some.injEq, reduceCtorEq] at htag <;> + subst htag <;> simp [levelCore] + rcases (by omega : k + t ≤ 3 ∨ ¬(k + t ≤ 3)) with hs_le | hs_gt + · simp only [aPullSucc, htag, hs_le, ↓reduceIte] + have h_mk : levelCore (mkSw (k + t)) = k + t + 1 := by + rcases (by omega : k + t = 1 ∨ k + t = 2 ∨ k + t = 3) with h1 | h2 | h3 + · rw [h1]; rfl + · rw [h2]; rfl + · rw [h3]; rfl + have h_lvl : levelCore (mkSw (k + t)) ≤ fuel := by omega + obtain ⟨r', hE, hS⟩ := ha (mkSw (k + t)) h_lvl + refine ⟨r', ?_, hS⟩ + have h_sw : Sweeps k (evalCore w) (evalCore (mkSw (k + t))) := by + have h_step := stepCore_sound k w + rw [stepCore_eq_stepDefault htag] at h_step + have h_eq : stepDefault (k + t) = (0, mkSw (k + t)) := by + rcases (by omega : k + t = 1 ∨ k + t = 2 ∨ k + t = 3) with h1 | h2 | h3 + · rw [h1]; rfl + · rw [h2]; rfl + · rw [h3]; rfl + simpa [h_eq, evalU, rep010] using h_step + have hE_rep := eraRound_rep010 h_sw hE + rwa [← rep010_add] at hE_rep + · simp only [aPullSucc, htag, hs_gt, ↓reduceIte] + have hs4 : 4 ≤ k + t := by omega + have h_lvl : levelCore (stepDiv0Sw0 (k + t - 3)) ≤ fuel := by + rw [levelCore_stepDiv0Sw0]; omega + obtain ⟨r', hE, hS⟩ := ha (stepDiv0Sw0 (k + t - 3)) h_lvl + refine ⟨r', ?_, hS⟩ + have h_step := stepCore_sound k w + rw [stepCore_eq_stepDefault htag, show k + t = (k + t - 4) + 4 by omega, + stepDefault_add4_eq] at h_step + change Sweeps k (evalCore w) ([0, 1, 0] +> evalCore (stepDiv0Sw0 (k + t - 4))) at h_step + have h1 : Round (evalCore (stepDiv0Sw0 (k + t - 4))) (evalCore (stepDiv0Sw0 (k + t - 3))) := + by + have := round_stepDiv0Sw0 (k + t - 4) + rwa [show k + t - 4 + 1 = k + t - 3 by omega] at this + have hE1 := eraRound_010 h1 hE + have hE_rep := eraRound_rep010 h_step hE1 + have h_eq_r : rep010 k ([0, 1, 0] +> rep010 (aCoreFn (stepDiv0Sw0 (k + t - 3))).p r') = + rep010 (k + 1 + (aCoreFn (stepDiv0Sw0 (k + t - 3))).p) r' := by + change rep010 k (rep010 1 (rep010 (aCoreFn (stepDiv0Sw0 (k + t - 3))).p r')) = _ + rw [← rep010_add, ← rep010_add] + rwa [h_eq_r] at hE_rep + | none => + simp only [aPullSucc, htag] + have h_lvl : levelCore (stepDivCore k w) ≤ fuel := by + rw [levelCore_stepDivCore k w htag]; omega + obtain ⟨r', hE, hS⟩ := ha (stepDivCore k w) h_lvl + refine ⟨r', ?_, hS⟩ + have h_sw := stepDivCore_sound k w htag + have hE_rep := eraRound_rep010 h_sw hE + rwa [← rep010_add] at hE_rep + +theorem aPullFrom_sound {aCoreFn : CoreTree → ResP} {fuel : Nat} + (ha : ∀ w : CoreTree, levelCore w ≤ fuel → + let res := aCoreFn w + ∃ r', EraRound (evalCore w) (rep010 res.p r') ∧ Sweeps res.c r' (evalU res.u)) + (u : UTree) (hu : levelU u ≤ fuel) : + let res := aPullFrom aCoreFn u + ∃ r', EraRound (evalU u) (rep010 res.p r') ∧ Sweeps res.c r' (evalU res.u) := by + rcases u with ⟨_ | k', w⟩ + · have hcw : levelCore w ≤ fuel := by unfold levelU at hu; dsimp only at hu; omega + exact ha w hcw + · have hlu : levelU (k' + 1, w) = 3 * (k' + 1) + levelCore w := rfl + rw [hlu] at hu + exact aPullSucc_sound (by omega : 1 ≤ k' + 1) ha hu + +theorem opsAux_sound : ∀ (fuel : Nat), + (∀ w : CoreTree, levelCore w ≤ fuel → + let res := (opsAux fuel).bCore w + Sweeps res.c (pB (evalCore w)) (evalU res.u)) ∧ + (∀ w : CoreTree, levelCore w ≤ fuel → + let res := (opsAux fuel).aCore w + ∃ r', EraRound (evalCore w) (rep010 res.p r') ∧ Sweeps res.c r' (evalU res.u)) + | 0 => ⟨fun w hw => by have := levelCore_pos w; omega, + fun w hw => by have := levelCore_pos w; omega⟩ + | fuel + 1 => by + obtain ⟨ihB, ihA⟩ := opsAux_sound fuel + refine ⟨?_, ?_⟩ + · intro w hw + cases w with + | sw0 => exact bCore_sw0_sound + | sw1 => exact bCore_sw1_sound + | sw2 => exact bCore_sw2_sound + | sw3 => exact bCore_sw3_sound + | div0 k ch => + unfold opsAux + dsimp only + split + · next h0 => obtain ⟨rfl, rfl⟩ := h0; exact bCore_div0_sw0_sound + · next hne => + have hm2 := levelU_gt_one_of_ne_sw0 hne + have h_u1_lvl : levelU (stepU 1 (k, ch)) ≤ fuel := by + rw [levelU_stepU]; simp [levelCore] at hw; unfold levelU at hm2 ⊢; dsimp only at *; + omega + have h1 := round_of_sweeps_one (stepU_sound 1 (k, ch)) + have h6 := sweeps_pB_pDiv0 h1 + have hsub := bUFrom_sound ihB (stepU 1 (k, ch)) h_u1_lvl + have hsub' := sweeps_rep010 2 hsub + have htr := Sweeps.trans h6 hsub' + simpa [evalU, evalCore, rep010_add] using htr + | div1 k ch => + unfold opsAux + dsimp only + split + · next h0 => obtain ⟨rfl, rfl⟩ := h0; exact bCore_div1_sw0_sound + · next hne => + have hm2 := levelU_gt_one_of_ne_sw0 hne + have h_u1_lvl : levelU (stepU 1 (k, ch)) ≤ fuel := by + rw [levelU_stepU]; simp [levelCore] at hw; unfold levelU at hm2 ⊢; dsimp only at *; + omega + have h1 := round_of_sweeps_one (stepU_sound 1 (k, ch)) + obtain ⟨r', hE, hS⟩ := aPullFrom_sound ihA (stepU 1 (k, ch)) h_u1_lvl + have h3 := sweeps_pB_pDiv1 h1 hE + have hS_rep := sweeps_rep010 (aPullFrom (opsAux fuel).aCore (stepU 1 (k, ch))).p hS + have h2c := sweeps_010 (sweeps_pDiv0_even (sweeps_010 hS_rep)) + have htr := Sweeps.trans h3 h2c + simpa [evalU, evalCore, rep010, rep010_add, Nat.add_assoc] using htr + · intro w hw + cases w with + | sw0 => exact ⟨evalCore .sw1, aCore_sw0_sound, Sweeps.zero _⟩ + | sw1 => exact ⟨evalCore .sw1, aCore_sw1_sound, Sweeps.zero _⟩ + | sw2 => exact aCore_sw2_sound + | sw3 => exact aCore_sw3_sound + | div0 k ch => + unfold opsAux + dsimp only + split + · next h0 => obtain ⟨rfl, rfl⟩ := h0; exact aCore_div0_sw0_sound + · next hne => + have hm2 := levelU_gt_one_of_ne_sw0 hne + have h_u_lvl : levelU (k, ch) ≤ fuel := by + simp [levelCore] at hw; unfold levelU at hm2 ⊢; dsimp only at *; omega + have hsub := bUFrom_sound ihB (k, ch) h_u_lvl + exact ⟨pB (evalU (k, ch)), eraRound_pDiv0 (evalU (k, ch)), hsub⟩ + | div1 k ch => + unfold opsAux + dsimp only + split + · next h0 => + obtain ⟨rfl, rfl⟩ := h0; exact ⟨evalCore .sw1, aCore_div1_sw0_sound, Sweeps.zero _⟩ + · next hne => + have hm2 := levelU_gt_one_of_ne_sw0 hne + have h_u1_lvl : levelU (stepU 1 (k, ch)) ≤ fuel := by + rw [levelU_stepU]; simp [levelCore] at hw; unfold levelU at hm2 ⊢; dsimp only at *; + omega + have h1 := round_of_sweeps_one (stepU_sound 1 (k, ch)) + obtain ⟨r', hE, hS⟩ := aPullFrom_sound ihA (stepU 1 (k, ch)) h_u1_lvl + have hE' := eraRound_pDiv1 h1 hE + refine ⟨r', ?_, hS⟩ + simpa [evalU, evalCore, rep010_add] using hE' + +-- ============================================================================ +-- Section 7: 4-Piecewise Linear Arithmetic Bounds (CB4, CA4, DB4, DAC4, DAU4) +-- ============================================================================ + +def min4 (a b c d : Nat) : Nat := min (min a b) (min c d) + +def CB4 (x : Nat) : Nat := min4 (6 * x - 3) (3 * x + 10) ((3 * x) / 2 + 25) ((11 * x) / 16 + 67) +def CA4 (x : Nat) : Nat := min4 (3 * x) ((3 * x) / 2 + 10) ((3 * x) / 4 + 25) ((3 * x) / 8 + 64) +def DB4 (x : Nat) : Nat := min4 (6 * x - 2) (3 * x + 31) ((3 * x) / 2 + 70) ((5 * x) / 4 + 150) +def DAC4 (x : Nat) : Nat := + min4 (4 * x - 1) ((3 * x) / 2 + 31) ((3 * x) / 4 + 70) ((21 * x) / 32 + 130) +def DAU4 (x : Nat) : Nat := + min4 (4 * x - 1) ((9 * x) / 4 + 21) ((3 * x) / 2 + 31) ((5 * x) / 4 + 71) + +def CAP (x : Nat) : Nat := max 11 (CB4 (x / 2)) +def DAP (x : Nat) : Nat := max 7 (DB4 (x / 2)) + +theorem le_min4 {x a b c d : Nat} (ha : x ≤ a) (hb : x ≤ b) (hc : x ≤ c) (hd : x ≤ d) : + x ≤ min4 a b c d := by + unfold min4; exact le_min (le_min ha hb) (le_min hc hd) + +theorem le_of_min4_1 {y a b c d : Nat} (h : y ≤ min4 a b c d) : y ≤ a := + le_trans h (le_trans (min_le_left _ _) (min_le_left _ _)) +theorem le_of_min4_2 {y a b c d : Nat} (h : y ≤ min4 a b c d) : y ≤ b := + le_trans h (le_trans (min_le_left _ _) (min_le_right _ _)) +theorem le_of_min4_3 {y a b c d : Nat} (h : y ≤ min4 a b c d) : y ≤ c := + le_trans h (le_trans (min_le_right _ _) (min_le_left _ _)) +theorem le_of_min4_4 {y a b c d : Nat} (h : y ≤ min4 a b c d) : y ≤ d := + le_trans h (le_trans (min_le_right _ _) (min_le_right _ _)) + +theorem CB4_le (x : Nat) : + CB4 x ≤ 6 * x - 3 ∧ CB4 x ≤ 3 * x + 10 ∧ CB4 x ≤ (3 * x) / 2 + 25 ∧ + CB4 x ≤ (11 * x) / 16 + 67 := by + have hd : CB4 x ≤ min4 (6 * x - 3) (3 * x + 10) ((3 * x) / 2 + 25) ((11 * x) / 16 + 67) := + le_refl _ + exact ⟨le_of_min4_1 hd, le_of_min4_2 hd, le_of_min4_3 hd, le_of_min4_4 hd⟩ + +theorem CA4_le (x : Nat) : + CA4 x ≤ 3 * x ∧ CA4 x ≤ (3 * x) / 2 + 10 ∧ CA4 x ≤ (3 * x) / 4 + 25 ∧ + CA4 x ≤ (3 * x) / 8 + 64 := by + have hd : CA4 x ≤ min4 (3 * x) ((3 * x) / 2 + 10) ((3 * x) / 4 + 25) ((3 * x) / 8 + 64) := + le_refl _ + exact ⟨le_of_min4_1 hd, le_of_min4_2 hd, le_of_min4_3 hd, le_of_min4_4 hd⟩ + +theorem DB4_le (x : Nat) : + DB4 x ≤ 6 * x - 2 ∧ DB4 x ≤ 3 * x + 31 ∧ DB4 x ≤ (3 * x) / 2 + 70 ∧ DB4 x ≤ (5 * x) / 4 + 150 := + by + have hd : DB4 x ≤ min4 (6 * x - 2) (3 * x + 31) ((3 * x) / 2 + 70) ((5 * x) / 4 + 150) := + le_refl _ + exact ⟨le_of_min4_1 hd, le_of_min4_2 hd, le_of_min4_3 hd, le_of_min4_4 hd⟩ + +theorem DAC4_le (x : Nat) : + DAC4 x ≤ 4 * x - 1 ∧ DAC4 x ≤ (3 * x) / 2 + 31 ∧ DAC4 x ≤ (3 * x) / 4 + 70 ∧ + DAC4 x ≤ (21 * x) / 32 + 130 := by + have hd : DAC4 x ≤ min4 (4 * x - 1) ((3 * x) / 2 + 31) ((3 * x) / 4 + 70) ((21 * x) / 32 + 130) := + le_refl _ + exact ⟨le_of_min4_1 hd, le_of_min4_2 hd, le_of_min4_3 hd, le_of_min4_4 hd⟩ + +theorem DAU4_le (x : Nat) : + DAU4 x ≤ 4 * x - 1 ∧ DAU4 x ≤ (9 * x) / 4 + 21 ∧ DAU4 x ≤ (3 * x) / 2 + 31 ∧ + DAU4 x ≤ (5 * x) / 4 + 71 := by + have hd : DAU4 x ≤ min4 (4 * x - 1) ((9 * x) / 4 + 21) ((3 * x) / 2 + 31) ((5 * x) / 4 + 71) := + le_refl _ + exact ⟨le_of_min4_1 hd, le_of_min4_2 hd, le_of_min4_3 hd, le_of_min4_4 hd⟩ + +theorem CB4_mono {x y : Nat} (h : x ≤ y) : CB4 x ≤ CB4 y := by + obtain ⟨h1, h2, h3, h4⟩ := CB4_le x + conv_rhs => unfold CB4 + refine le_min4 (by omega) (by omega) (by omega) (by omega) + +theorem CA4_mono {x y : Nat} (h : x ≤ y) : CA4 x ≤ CA4 y := by + obtain ⟨h1, h2, h3, h4⟩ := CA4_le x + conv_rhs => unfold CA4 + refine le_min4 (by omega) (by omega) (by omega) (by omega) + +theorem DB4_mono {x y : Nat} (h : x ≤ y) : DB4 x ≤ DB4 y := by + obtain ⟨h1, h2, h3, h4⟩ := DB4_le x + conv_rhs => unfold DB4 + refine le_min4 (by omega) (by omega) (by omega) (by omega) + +theorem CAP_mono {x y : Nat} (h : x ≤ y) : CAP x ≤ CAP y := by + have hcb := CB4_mono (by omega : x / 2 ≤ y / 2) + unfold CAP; omega + +theorem DAP_mono {x y : Nat} (h : x ≤ y) : DAP x ≤ DAP y := by + have hdb := DB4_mono (by omega : x / 2 ≤ y / 2) + unfold DAP; omega + +theorem bound_bCore_div0 {m c1 lu1 : Nat} (hm : 2 ≤ m) + (hc : c1 ≤ CB4 (m + 1)) (hd : lu1 ≤ c1 + DB4 (m + 1)) : + 6 + c1 ≤ CB4 (2 * m) ∧ 6 + lu1 ≤ (6 + c1) + DB4 (2 * m) := by + obtain ⟨h1, h2, h3, h4⟩ := CB4_le (m + 1) + have hd_m := DB4_mono (by omega : m + 1 ≤ 2 * m) + refine ⟨?_, by omega⟩ + unfold CB4; refine le_min4 (by omega) (by omega) (by omega) (by omega) + +theorem bound_bCore_div1 {m c1 p1 lu1 : Nat} (hm : 2 ≤ m) + (hc : c1 ≤ CA4 (m + 1)) (hd : 3 * p1 + lu1 ≤ c1 + DAU4 (m + 1)) : + 3 + 2 * c1 ≤ CB4 (2 * m + 1) ∧ + 9 + 2 * (3 * p1 + lu1) ≤ (3 + 2 * c1) + DB4 (2 * m + 1) := by + obtain ⟨hc1, hc2, hc3, hc4⟩ := CA4_le (m + 1) + obtain ⟨hd1, hd2, hd3, hd4⟩ := DAU4_le (m + 1) + refine ⟨?_, ?_⟩ + · unfold CB4; refine le_min4 (by omega) (by omega) (by omega) (by omega) + · have h_db : 6 + 2 * DAU4 (m + 1) ≤ DB4 (2 * m + 1) := by + unfold DB4; refine le_min4 (by omega) (by omega) (by omega) (by omega) + omega + +theorem bound_bUFrom (k : Nat) {mc c0 lu0 : Nat} (hmc : 1 ≤ mc) + (hc : c0 ≤ CB4 mc) (hd : lu0 ≤ c0 + DB4 mc) : + 2 * k + c0 ≤ CB4 (3 * k + mc) ∧ 3 * k + lu0 ≤ (2 * k + c0) + DB4 (3 * k + mc) := by + obtain ⟨hc1, hc2, hc3, hc4⟩ := CB4_le mc + obtain ⟨hd1, hd2, hd3, hd4⟩ := DB4_le mc + refine ⟨?_, ?_⟩ + · conv_rhs => unfold CB4 + refine le_min4 (by omega) (by omega) (by omega) (by omega) + · have h_db : k + DB4 mc ≤ DB4 (3 * k + mc) := by + conv_rhs => unfold DB4 + refine le_min4 (by omega) (by omega) (by omega) (by omega) + omega + +theorem bound_aCore_div0 {m c0 lu0 : Nat} (hm : 2 ≤ m) + (hc : c0 ≤ CB4 m) (hd : lu0 ≤ c0 + DB4 m) : + c0 ≤ CA4 (2 * m) ∧ c0 ≤ CAP (2 * m) ∧ + lu0 ≤ c0 + DAC4 (2 * m) ∧ lu0 ≤ c0 + DAP (2 * m) := by + obtain ⟨hc1, hc2, hc3, hc4⟩ := CB4_le m + obtain ⟨hd1, hd2, hd3, hd4⟩ := DB4_le m + refine ⟨?_, ?_, ?_, ?_⟩ + · unfold CA4; refine le_min4 (by omega) (by omega) (by omega) (by omega) + · unfold CAP; have hdiv : (2 * m) / 2 = m := by omega + rw [hdiv]; exact le_trans hc (le_max_right _ _) + · have h_da : DB4 m ≤ DAC4 (2 * m) := by + unfold DAC4; refine le_min4 (by omega) (by omega) (by omega) (by omega) + omega + · unfold DAP; have hdiv : (2 * m) / 2 = m := by omega + rw [hdiv]; have : DB4 m ≤ max 7 (DB4 m) := le_max_right _ _ + omega + +theorem bound_aCore_div1 {m c1 p1 lu1 : Nat} (hm : 2 ≤ m) + (hc : c1 ≤ CA4 (m + 1)) (hcap : c1 ≤ CAP (m + 1)) + (hd : 3 * p1 + lu1 ≤ c1 + DAU4 (m + 1)) (hdap : lu1 ≤ c1 + DAP (m + 1)) : + c1 ≤ CA4 (2 * m + 1) ∧ c1 ≤ CAP (2 * m + 1) ∧ + 3 * (2 + p1) + lu1 ≤ c1 + DAC4 (2 * m + 1) ∧ lu1 ≤ c1 + DAP (2 * m + 1) := by + obtain ⟨hd1, hd2, hd3, hd4⟩ := DAU4_le (m + 1) + refine ⟨le_trans hc (CA4_mono (by omega)), le_trans hcap (CAP_mono (by omega)), ?_, ?_⟩ + · have h_da : 6 + DAU4 (m + 1) ≤ DAC4 (2 * m + 1) := by + unfold DAC4; refine le_min4 (by omega) (by omega) (by omega) (by omega) + omega + · exact le_trans hdap (Nat.add_le_add_left (DAP_mono (by omega)) c1) + +theorem bound_aPull_sw_le {k t c0 p0 lu0 : Nat} (hk : 1 ≤ k) (hs : k + t ≤ 3) + (hc : c0 ≤ CA4 (k + t + 1)) (hcap : c0 ≤ CAP (k + t + 1)) + (hd : 3 * p0 + lu0 ≤ c0 + DAC4 (k + t + 1)) (hdap : lu0 ≤ c0 + DAP (k + t + 1)) : + c0 ≤ CA4 (3 * k + (t + 1)) ∧ c0 ≤ CAP (3 * k + (t + 1)) ∧ + 3 * (k + p0) + lu0 ≤ c0 + DAU4 (3 * k + (t + 1)) ∧ + lu0 ≤ c0 + DAP (3 * k + (t + 1)) := by + obtain ⟨hd1, hd2, hd3, hd4⟩ := DAC4_le (k + t + 1) + refine ⟨le_trans hc (CA4_mono (by omega)), le_trans hcap (CAP_mono (by omega)), ?_, ?_⟩ + · have h_da : 3 * k + DAC4 (k + t + 1) ≤ DAU4 (3 * k + (t + 1)) := by + unfold DAU4; refine le_min4 (by omega) (by omega) (by omega) (by omega) + omega + · exact le_trans hdap (Nat.add_le_add_left (DAP_mono (by omega)) c0) + +theorem bound_aPull_sw_gt {k t c0 p0 lu0 : Nat} (hk : 1 ≤ k) (ht : t ≤ 3) (hs : 4 ≤ k + t) + (hc : c0 ≤ CA4 (k + t - 1)) (hcap : c0 ≤ CAP (k + t - 1)) + (hd : 3 * p0 + lu0 ≤ c0 + DAC4 (k + t - 1)) (hdap : lu0 ≤ c0 + DAP (k + t - 1)) : + c0 ≤ CA4 (3 * k + (t + 1)) ∧ c0 ≤ CAP (3 * k + (t + 1)) ∧ + 3 * (k + 1 + p0) + lu0 ≤ c0 + DAU4 (3 * k + (t + 1)) ∧ + lu0 ≤ c0 + DAP (3 * k + (t + 1)) := by + obtain ⟨hd1, hd2, hd3, hd4⟩ := DAC4_le (k + t - 1) + refine ⟨le_trans hc (CA4_mono (by omega)), le_trans hcap (CAP_mono (by omega)), ?_, ?_⟩ + · have h_da : 3 * (k + 1) + DAC4 (k + t - 1) ≤ DAU4 (3 * k + (t + 1)) := by + unfold DAU4; refine le_min4 (by omega) (by omega) (by omega) (by omega) + omega + · exact le_trans hdap (Nat.add_le_add_left (DAP_mono (by omega)) c0) + +theorem bound_aPull_div {k mc c0 p0 lu0 : Nat} (hk : 1 ≤ k) (hmc : 2 ≤ mc) + (hc : c0 ≤ CA4 (mc + k)) (hcap : c0 ≤ CAP (mc + k)) + (hd : 3 * p0 + lu0 ≤ c0 + DAC4 (mc + k)) (hdap : lu0 ≤ c0 + DAP (mc + k)) : + c0 ≤ CA4 (3 * k + mc) ∧ c0 ≤ CAP (3 * k + mc) ∧ + 3 * (k + p0) + lu0 ≤ c0 + DAU4 (3 * k + mc) ∧ + lu0 ≤ c0 + DAP (3 * k + mc) := by + obtain ⟨hd1, hd2, hd3, hd4⟩ := DAC4_le (mc + k) + refine ⟨le_trans hc (CA4_mono (by omega)), le_trans hcap (CAP_mono (by omega)), ?_, ?_⟩ + · have h_da : 3 * k + DAC4 (mc + k) ≤ DAU4 (3 * k + mc) := by + unfold DAU4; refine le_min4 (by omega) (by omega) (by omega) (by omega) + omega + · exact le_trans hdap (Nat.add_le_add_left (DAP_mono (by omega)) c0) + +theorem bUFrom_bounds {bCoreFn : CoreTree → ResB} {fuel : Nat} + (hb : ∀ w : CoreTree, levelCore w ≤ fuel → + let res := bCoreFn w + res.c ≤ CB4 (levelCore w) ∧ levelU res.u ≤ res.c + DB4 (levelCore w)) + (u : UTree) (hu : levelU u ≤ fuel) : + let res := bUFrom bCoreFn u + res.c ≤ CB4 (levelU u) ∧ levelU res.u ≤ res.c + DB4 (levelU u) := by + rcases u with ⟨k, w⟩ + have hcw : levelCore w ≤ fuel := by unfold levelU at hu; dsimp only at hu; omega + obtain ⟨hc, hd⟩ := hb w hcw + have hres := bound_bUFrom k (levelCore_pos w) hc hd + unfold bUFrom levelU at * + dsimp only at * + simpa [Nat.mul_add, Nat.add_assoc] using hres + +theorem levelCore_ge_two_of_none {w : CoreTree} (hw : coreTagIdx w = none) : + 2 ≤ levelCore w := by + cases w with + | sw0 | sw1 | sw2 | sw3 => nomatch hw + | div0 k ch => have := levelCore_pos ch; simp [levelCore]; omega + | div1 k ch => have := levelCore_pos ch; simp [levelCore]; omega + +theorem DAC4_le_DAU4 (x : Nat) : DAC4 x ≤ DAU4 x := by + obtain ⟨h1, h2, h3, h4⟩ := DAC4_le x + conv_rhs => unfold DAU4 + rcases (by omega : x ≤ 12 ∨ x = 13 ∨ x = 14 ∨ 15 ≤ x) with hx | rfl | rfl | hx + · refine le_min4 (by omega) (by omega) (by omega) (by omega) + · decide + · decide + · refine le_min4 (by omega) (by omega) (by omega) (by omega) + +theorem aPullSucc_bounds {aCoreFn : CoreTree → ResP} {fuel k : Nat} {w : CoreTree} + (hk : 1 ≤ k) + (ha : ∀ w' : CoreTree, levelCore w' ≤ fuel → + let res := aCoreFn w' + res.c ≤ CA4 (levelCore w') ∧ res.c ≤ CAP (levelCore w') ∧ + 3 * res.p + levelU res.u ≤ res.c + DAC4 (levelCore w') ∧ + levelU res.u ≤ res.c + DAP (levelCore w')) + (hu : 3 * k + levelCore w ≤ fuel) : + let res := aPullSucc aCoreFn k w + res.c ≤ CA4 (3 * k + levelCore w) ∧ res.c ≤ CAP (3 * k + levelCore w) ∧ + 3 * res.p + levelU res.u ≤ res.c + DAU4 (3 * k + levelCore w) ∧ + levelU res.u ≤ res.c + DAP (3 * k + levelCore w) := by + dsimp only + cases htag : coreTagIdx w with + | some t => + have ht_le : t ≤ 3 ∧ levelCore w = t + 1 := by + cases w <;> simp only [coreTagIdx, Option.some.injEq, reduceCtorEq] at htag <;> + subst htag <;> simp [levelCore] + rcases (by omega : k + t ≤ 3 ∨ ¬(k + t ≤ 3)) with hs_le | hs_gt + · simp only [aPullSucc, htag, hs_le, ↓reduceIte] + have h_mk : levelCore (mkSw (k + t)) = k + t + 1 := by + rcases (by omega : k + t = 1 ∨ k + t = 2 ∨ k + t = 3) with h1 | h2 | h3 + · rw [h1]; rfl + · rw [h2]; rfl + · rw [h3]; rfl + have h_lvl : levelCore (mkSw (k + t)) ≤ fuel := by omega + obtain ⟨hc, hcap, hd, hdap⟩ := ha (mkSw (k + t)) h_lvl + rw [h_mk] at hc hcap hd hdap + rw [ht_le.2] + exact bound_aPull_sw_le hk hs_le hc hcap hd hdap + · simp only [aPullSucc, htag, hs_gt, ↓reduceIte] + have hs4 : 4 ≤ k + t := by omega + have h_mk : levelCore (stepDiv0Sw0 (k + t - 3)) = k + t - 1 := by + rw [levelCore_stepDiv0Sw0]; omega + have h_lvl : levelCore (stepDiv0Sw0 (k + t - 3)) ≤ fuel := by omega + obtain ⟨hc, hcap, hd, hdap⟩ := ha (stepDiv0Sw0 (k + t - 3)) h_lvl + rw [h_mk] at hc hcap hd hdap + rw [ht_le.2] + exact bound_aPull_sw_gt hk ht_le.1 hs4 hc hcap hd hdap + | none => + simp only [aPullSucc, htag] + have hmc2 := levelCore_ge_two_of_none htag + have h_mk := levelCore_stepDivCore k w htag + have h_lvl : levelCore (stepDivCore k w) ≤ fuel := by omega + obtain ⟨hc, hcap, hd, hdap⟩ := ha (stepDivCore k w) h_lvl + rw [h_mk] at hc hcap hd hdap + exact bound_aPull_div hk hmc2 hc hcap hd hdap + +theorem aPullFrom_bounds {aCoreFn : CoreTree → ResP} {fuel : Nat} + (ha : ∀ w : CoreTree, levelCore w ≤ fuel → + let res := aCoreFn w + res.c ≤ CA4 (levelCore w) ∧ res.c ≤ CAP (levelCore w) ∧ + 3 * res.p + levelU res.u ≤ res.c + DAC4 (levelCore w) ∧ + levelU res.u ≤ res.c + DAP (levelCore w)) + (u : UTree) (hu : levelU u ≤ fuel) : + let res := aPullFrom aCoreFn u + res.c ≤ CA4 (levelU u) ∧ res.c ≤ CAP (levelU u) ∧ + 3 * res.p + levelU res.u ≤ res.c + DAU4 (levelU u) ∧ + levelU res.u ≤ res.c + DAP (levelU u) := by + rcases u with ⟨_ | k', w⟩ + · have hlu0 : levelU (0, w) = levelCore w := by simp [levelU] + have hcw : levelCore w ≤ fuel := by rw [← hlu0]; exact hu + obtain ⟨hc, hcap, hd, hdap⟩ := ha w hcw + have hd_u := DAC4_le_DAU4 (levelCore w) + dsimp only [aPullFrom] + rw [hlu0] + exact ⟨hc, hcap, by omega, hdap⟩ + · have hlu : levelU (k' + 1, w) = 3 * (k' + 1) + levelCore w := rfl + rw [hlu] at hu ⊢ + dsimp only [aPullFrom] + exact aPullSucc_bounds (by omega : 1 ≤ k' + 1) ha hu + +theorem opsAux_bounds : ∀ (fuel : Nat), + (∀ w : CoreTree, levelCore w ≤ fuel → + let res := (opsAux fuel).bCore w + res.c ≤ CB4 (levelCore w) ∧ levelU res.u ≤ res.c + DB4 (levelCore w)) ∧ + (∀ w : CoreTree, levelCore w ≤ fuel → + let res := (opsAux fuel).aCore w + res.c ≤ CA4 (levelCore w) ∧ res.c ≤ CAP (levelCore w) ∧ + 3 * res.p + levelU res.u ≤ res.c + DAC4 (levelCore w) ∧ + levelU res.u ≤ res.c + DAP (levelCore w)) + | 0 => ⟨fun w hw => by have := levelCore_pos w; omega, + fun w hw => by have := levelCore_pos w; omega⟩ + | fuel + 1 => by + obtain ⟨ihB, ihA⟩ := opsAux_bounds fuel + refine ⟨?_, ?_⟩ + · intro w hw + cases w with + | sw0 => unfold opsAux; dsimp only; decide + | sw1 => unfold opsAux; dsimp only; decide + | sw2 => unfold opsAux; dsimp only; decide + | sw3 => unfold opsAux; dsimp only; decide + | div0 k ch => + unfold opsAux + dsimp only + split + · next h0 => obtain ⟨rfl, rfl⟩ := h0; decide + · next hne => + have hm2 := levelU_gt_one_of_ne_sw0 hne + have h_u1_lvl : levelU (stepU 1 (k, ch)) ≤ fuel := by + rw [levelU_stepU]; simp [levelCore] at hw; unfold levelU at hm2 ⊢; dsimp only at *; + omega + obtain ⟨hc, hd⟩ := bUFrom_bounds ihB (stepU 1 (k, ch)) h_u1_lvl + rw [levelU_stepU] at hc hd + have hres := bound_bCore_div0 hm2 hc hd + simpa [levelCore, levelU, Nat.mul_add, Nat.add_assoc] using hres + | div1 k ch => + unfold opsAux + dsimp only + split + · next h0 => obtain ⟨rfl, rfl⟩ := h0; decide + · next hne => + have hm2 := levelU_gt_one_of_ne_sw0 hne + have h_u1_lvl : levelU (stepU 1 (k, ch)) ≤ fuel := by + rw [levelU_stepU]; simp [levelCore] at hw; unfold levelU at hm2 ⊢; dsimp only at *; + omega + obtain ⟨hc, _, hd, _⟩ := aPullFrom_bounds ihA (stepU 1 (k, ch)) h_u1_lvl + rw [levelU_stepU] at hc hd + have hres := bound_bCore_div1 hm2 hc hd + refine ⟨hres.1, ?_⟩ + have h_lu : levelU (1, .div0 (1 + (aPullFrom (opsAux fuel).aCore (stepU 1 (k, + ch))).p + (aPullFrom (opsAux fuel).aCore (stepU 1 (k, + ch))).u.1) (aPullFrom (opsAux fuel).aCore (stepU 1 (k, ch))).u.2) = + 9 + 2 * (3 * (aPullFrom (opsAux fuel).aCore (stepU 1 (k, + ch))).p + levelU (aPullFrom (opsAux fuel).aCore (stepU 1 (k, ch))).u) := by + simp [levelU, levelCore]; omega + rw [h_lu]; exact hres.2 + · intro w hw + cases w with + | sw0 => unfold opsAux; dsimp only; decide + | sw1 => unfold opsAux; dsimp only; decide + | sw2 => unfold opsAux; dsimp only; decide + | sw3 => unfold opsAux; dsimp only; decide + | div0 k ch => + unfold opsAux + dsimp only + split + · next h0 => obtain ⟨rfl, rfl⟩ := h0; decide + · next hne => + have hm2 := levelU_gt_one_of_ne_sw0 hne + have h_u_lvl : levelU (k, ch) ≤ fuel := by + simp [levelCore] at hw; unfold levelU at hm2 ⊢; dsimp only at *; omega + obtain ⟨hc, hd⟩ := bUFrom_bounds ihB (k, ch) h_u_lvl + have hres := bound_aCore_div0 hm2 hc hd + simpa [levelCore, levelU] using hres + | div1 k ch => + unfold opsAux + dsimp only + split + · next h0 => obtain ⟨rfl, rfl⟩ := h0; decide + · next hne => + have hm2 := levelU_gt_one_of_ne_sw0 hne + have h_u1_lvl : levelU (stepU 1 (k, ch)) ≤ fuel := by + rw [levelU_stepU]; simp [levelCore] at hw; unfold levelU at hm2 ⊢; dsimp only at *; + omega + obtain ⟨hc, hcap, hd, hdap⟩ := aPullFrom_bounds ihA (stepU 1 (k, ch)) h_u1_lvl + rw [levelU_stepU] at hc hcap hd hdap + have hres := bound_aCore_div1 hm2 hc hcap hd hdap + simpa [levelCore, levelU] using hres + +-- ============================================================================ +-- Section 8: Finite Bridge (init -> Era 5 -> Era 131) & Infinite Invariant +-- ============================================================================ + +def eraStepBool (fuel : Nat) (bs : List Bool) : Option (List Bool) := + match pad7B bs with + | false :: v => (roundBool fuel v).map (fun r' => false :: true :: false :: r') + | _ => none + +theorem eraStepBool_sound (fuel : Nat) (bs ys : List Bool) + (h : eraStepBool fuel bs = some ys) : + ((toTape bs) {{E}}> default) [target_tm]⊢⁺ ((toTape ys) {{E}}> default) := by + rw [← toTape_pad7B bs] + unfold eraStepBool at h + generalize pad7B bs = pbs at h ⊢ + split at h + · obtain ⟨r', hr', rfl⟩ := opt_map_some h + rename_i v + exact eraRound_tm_step ⟨toTape v, rfl, roundBool_sound fuel v r' hr'⟩ + · nomatch h + +def eraStepsBool (fuel : Nat) : Nat → List Bool → Option (List Bool) + | 0, bs => some bs + | m + 1, bs => + match eraStepBool fuel bs with + | some bs1 => eraStepsBool fuel m bs1 + | none => none + +theorem eraStepsBool_sound (fuel : Nat) : ∀ (m : Nat) (bs ys : List Bool), + eraStepsBool fuel m bs = some ys → + ((toTape bs) {{E}}> default) [target_tm]⊢* ((toTape ys) {{E}}> default) + | 0, bs, ys, h => by injection h with h; subst h; exact ⟨0, rfl⟩ + | m + 1, bs, ys, h => by + unfold eraStepsBool at h + cases hs : eraStepBool fuel bs with + | none => rw [hs] at h; nomatch h + | some bs1 => + rw [hs] at h + exact stepStar_trans (stepPlus_stepStar (eraStepBool_sound fuel bs bs1 hs)) + (eraStepsBool_sound fuel m bs1 ys h) + +def rep010Bool : Nat → List Bool → List Bool + | 0, bs => bs + | k + 1, bs => false :: true :: false :: rep010Bool k bs + +theorem toTape_rep010Bool (k : Nat) (bs : List Bool) : + toTape (rep010Bool k bs) = rep010 k (toTape bs) := by + induction k with + | zero => rfl + | succ k ih => simp [rep010Bool, rep010, toTape, b2f, ih] + +set_option maxRecDepth 2000000 in +theorem init_reaches_era5 : + (init []) [target_tm]⊢* ((rep010 17 (evalCore .sw1)) {{E}}> default) := by + have h5 : (eraStepsBool 20 5 []).map dropTrailingFalse = + some (rep010Bool 17 [false, false, true]) := rfl + obtain ⟨ys, hys, hdrop⟩ := opt_map_some h5 + have hstar := eraStepsBool_sound 20 5 [] ys hys + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = ((toTape []) {{E}}> default) := rfl + have h_ys : toTape ys = rep010 17 (evalCore .sw1) := by + rw [← toTape_dropTrailingFalse ys, hdrop, toTape_rep010Bool] + simp [toTape, b2f, evalCore] + rwa [← h_init, h_ys] at hstar + +def stepEraU (N : Nat) (u : UTree) : Option (Nat × UTree) := + let res := aPullFrom (opsAux (levelU u)).aCore u + let N' := N + 1 + res.p + if res.c ≤ N' then + some (N', stepU (N' - res.c) res.u) + else + none + +theorem stepEraU_sound {N N' : Nat} {rem : ListBlank (Fin 2)} {u u' : UTree} + (hS : Sweeps N rem (evalU u)) (hstep : stepEraU N u = some (N', u')) : + ∃ rem', (((rep010 N rem) {{E}}> default) [target_tm]⊢⁺ ((rep010 N' rem') {{E}}> default)) ∧ + Sweeps N' rem' (evalU u') := by + unfold stepEraU at hstep + dsimp only at hstep + split at hstep + · next hle => + injection hstep with h1; injection h1 with hN' hu' + subst hN' hu' + have ha := (opsAux_sound (levelU u)).2 + obtain ⟨r', hE, hSr⟩ := aPullFrom_sound ha u (le_refl _) + have hE_rep := eraRound_rep010 hS hE + have htm := eraRound_tm_step hE_rep + rw [← rep010_add] at htm + have h_eq : [0, 1, 0] +> rep010 (N + (aPullFrom (opsAux (levelU u)).aCore u).p) r' = + rep010 (N + 1 + (aPullFrom (opsAux (levelU u)).aCore u).p) r' := by + rw [show N + 1 + (aPullFrom (opsAux (levelU u)).aCore u).p = + (N + (aPullFrom (opsAux (levelU u)).aCore u).p) + 1 by omega] + rfl + rw [h_eq] at htm + have hSu := + stepU_sound ((N + 1 + (aPullFrom (opsAux (levelU u)).aCore u).p) - (aPullFrom (opsAux + (levelU u)).aCore u).c) (aPullFrom (opsAux (levelU u)).aCore u).u + have htr := Sweeps.trans hSr hSu + rw [show (aPullFrom (opsAux (levelU u)).aCore u).c + ((N + 1 + (aPullFrom (opsAux (levelU + u)).aCore u).p) - (aPullFrom (opsAux (levelU u)).aCore u).c) = + N + 1 + (aPullFrom (opsAux (levelU u)).aCore u).p by omega] at htr + exact ⟨r', htm, htr⟩ + · nomatch hstep + +def runEras : Nat → Nat → UTree → Option (Nat × UTree) + | 0, N, u => some (N, u) + | m + 1, N, u => + match stepEraU N u with + | some (N', u') => runEras m N' u' + | none => none + +theorem runEras_sound : ∀ (m N N_m : Nat) (rem : ListBlank (Fin 2)) (u u_m : UTree), + Sweeps N rem (evalU u) → runEras m N u = some (N_m, u_m) → + ∃ rem_m, (((rep010 N rem) {{E}}> default) [target_tm]⊢* ((rep010 N_m rem_m) {{E}}> default)) ∧ + Sweeps N_m rem_m (evalU u_m) + | 0, N, N_m, rem, u, u_m, hS, hrun => by + injection hrun with h1; injection h1 with hN hu; subst hN hu + exact ⟨rem, ⟨0, rfl⟩, hS⟩ + | m + 1, N, N_m, rem, u, u_m, hS, hrun => by + unfold runEras at hrun + cases hs : stepEraU N u with + | none => rw [hs] at hrun; nomatch hrun + | some pair => + rcases pair with ⟨N', u'⟩ + rw [hs] at hrun + obtain ⟨rem', htm1, hS1⟩ := stepEraU_sound hS hs + obtain ⟨rem_m, htm_m, hS_m⟩ := runEras_sound m N' N_m rem' u' u_m hS1 hrun + exact ⟨rem_m, stepStar_trans (stepPlus_stepStar htm1) htm_m, hS_m⟩ + +def checkBridge : Bool := + match runEras 126 17 (stepU 17 (0, .sw1)) with + | some (N, u) => decide (2440 ≤ N ∧ 3 * levelU u ≤ 8 * N + 1200) + | none => false + +set_option maxRecDepth 2000000 in +set_option maxHeartbeats 20000000 in +-- Evaluating 126 symbolic era steps requires higher recursion depth and heartbeats. +theorem checkBridge_eq_true : checkBridge = true := rfl + +theorem era_inv_cap_le {N n : Nat} (hN : 2440 ≤ N) (hn : 3 * n ≤ 8 * N + 1200) : + CAP n ≤ N + 1 := by + obtain ⟨_, _, _, h4⟩ := CB4_le (n / 2) + unfold CAP; omega + +theorem era_inv_dap_le {N N' n c lu : Nat} (hN : 2440 ≤ N) (hN' : N + 1 ≤ N') + (hn : 3 * n ≤ 8 * N + 1200) (hc : c ≤ N') (hd : lu ≤ c + DAP n) : + 2440 ≤ N' ∧ 3 * (lu + (N' - c)) ≤ 8 * N' + 1200 := by + obtain ⟨_, _, _, h4⟩ := DB4_le (n / 2) + unfold DAP at hd; omega + +def EraInv (cfg : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ (N : Nat) (rem : ListBlank (Fin 2)) (u : UTree), + 2440 ≤ N ∧ 3 * levelU u ≤ 8 * N + 1200 ∧ + Sweeps N rem (evalU u) ∧ + cfg = ((rep010 N rem) {{E}}> default) + +set_option maxRecDepth 2000000 in +set_option maxHeartbeats 20000000 in +-- Unfolding 126 symbolic era steps in the initial bridge requires higher heartbeats. +theorem era_inv_init : ∃ cfg₀, ((init []) [target_tm]⊢* cfg₀) ∧ EraInv cfg₀ := by + have hb := checkBridge_eq_true + unfold checkBridge at hb + cases hrun : runEras 126 17 (stepU 17 (0, .sw1)) with + | none => rw [hrun] at hb; nomatch hb + | some pair => + rcases pair with ⟨N_131, u_131⟩ + rw [hrun, decide_eq_true_iff] at hb + have hS5 : Sweeps 17 (evalCore .sw1) (evalU (stepU 17 (0, .sw1))) := + stepU_sound 17 (0, .sw1) + obtain ⟨rem_131, hstar_bridge, hS_131⟩ := + runEras_sound 126 17 N_131 (evalCore .sw1) (stepU 17 (0, .sw1)) u_131 hS5 hrun + exact ⟨((rep010 N_131 rem_131) {{E}}> default), + stepStar_trans init_reaches_era5 hstar_bridge, + ⟨N_131, rem_131, u_131, hb.1, hb.2, hS_131, rfl⟩⟩ + +theorem era_inv_step (cfg : Cfg (Fin 2) (Fin 6)) (hinv : EraInv cfg) : + ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ EraInv cfg' := by + obtain ⟨N, rem, u, hN, hn, hS, rfl⟩ := hinv + have ha_b := (opsAux_bounds (levelU u)).2 + obtain ⟨_, hcap, _, hdap⟩ := aPullFrom_bounds ha_b u (le_refl (levelU u)) + have hc_le : (aPullFrom (opsAux (levelU u)).aCore u).c ≤ + N + 1 + (aPullFrom (opsAux (levelU u)).aCore u).p := by + have := era_inv_cap_le hN hn + omega + have hstep : stepEraU N u = + some (N + 1 + (aPullFrom (opsAux (levelU u)).aCore u).p, + stepU (N + 1 + (aPullFrom (opsAux (levelU u)).aCore u).p - (aPullFrom (opsAux (levelU + u)).aCore u).c) + (aPullFrom (opsAux (levelU u)).aCore u).u) := by + unfold stepEraU + dsimp only + rw [ite_eq_left hc_le] + obtain ⟨rem', htm, hS'⟩ := stepEraU_sound hS hstep + have h_inv' := + era_inv_dap_le hN (by omega : N + 1 ≤ N + 1 + (aPullFrom (opsAux (levelU u)).aCore u).p) hn + hc_le hdap + refine ⟨_, htm, ⟨_, rem', _, h_inv'.1, ?_, hS', rfl⟩⟩ + rw [levelU_stepU] + exact h_inv'.2 + + + + +theorem init_1_reaches_era0 : + (((default : ListBlank (Fin 2)) {{1}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢⁺ + ((toTape [false, false, true]) {{E}}> default) := by + dsimp [toTape, b2f]; execute + +set_option maxRecDepth 2000000 in +theorem init_1_reaches_era1 : + (((default : ListBlank (Fin 2)) {{1}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢* + ((rep010 16 (evalCore .sw1)) {{E}}> default) := by + have h1 : (eraStepsBool 20 4 [false, false, true]).map dropTrailingFalse = + some (rep010Bool 16 [false, false, true]) := rfl + obtain ⟨ys, hys, hdrop⟩ := opt_map_some h1 + have hstar := eraStepsBool_sound 20 4 [false, false, true] ys hys + have h_ys : toTape ys = rep010 16 (evalCore .sw1) := by + rw [← toTape_dropTrailingFalse ys, hdrop, toTape_rep010Bool] + simp [toTape, b2f, evalCore] + rw [h_ys] at hstar + exact stepStar_trans (stepPlus_stepStar init_1_reaches_era0) hstar + +def checkBridge_0471 : Bool := + match runEras 129 16 (stepU 16 (0, .sw1)) with + | some (N, u) => decide (2440 ≤ N ∧ 3 * levelU u ≤ 8 * N + 1200) + | none => false + +set_option maxRecDepth 2000000 in +set_option maxHeartbeats 20000000 in +-- Evaluating 129 symbolic era steps requires higher recursion depth and heartbeats. +theorem checkBridge_0471_eq_true : checkBridge_0471 = true := rfl + +set_option maxRecDepth 2000000 in +set_option maxHeartbeats 20000000 in +-- Unfolding 129 symbolic era steps in the initial bridge requires higher heartbeats. +theorem era_inv_init_0471 : + ∃ cfg₀, + ((((default : ListBlank (Fin 2)) {{1}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢* cfg₀) + ∧ + EraInv cfg₀ := by + have hb := checkBridge_0471_eq_true + unfold checkBridge_0471 at hb + cases hrun : runEras 129 16 (stepU 16 (0, .sw1)) with + | none => rw [hrun] at hb; nomatch hb + | some pair => + rcases pair with ⟨N_133, u_133⟩ + rw [hrun, decide_eq_true_iff] at hb + have hS1 : Sweeps 16 (evalCore .sw1) (evalU (stepU 16 (0, .sw1))) := + stepU_sound 16 (0, .sw1) + obtain ⟨rem_133, hstar_bridge, hS_133⟩ := + runEras_sound 129 16 N_133 (evalCore .sw1) (stepU 16 (0, .sw1)) u_133 hS1 hrun + exact ⟨((rep010 N_133 rem_133) {{E}}> default), + stepStar_trans init_1_reaches_era1 hstar_bridge, + ⟨N_133, rem_133, u_133, hb.1, hb.2, hS_133, rfl⟩⟩ + +theorem init_2_reaches_era0 : + (((default : ListBlank (Fin 2)) {{2}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢⁺ + ((toTape [false, true]) {{E}}> default) := by + dsimp [toTape, b2f]; execute + +theorem init_2_reaches_era1 : + (((default : ListBlank (Fin 2)) {{2}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢* + ((rep010 3 (evalCore .sw1)) {{E}}> default) := by + have h1 : (eraStepsBool 20 1 [false, true]).map dropTrailingFalse = + some (rep010Bool 3 [false, false, true]) := rfl + obtain ⟨ys, hys, hdrop⟩ := opt_map_some h1 + have hstar := eraStepsBool_sound 20 1 [false, true] ys hys + have h_ys : toTape ys = rep010 3 (evalCore .sw1) := by + rw [← toTape_dropTrailingFalse ys, hdrop, toTape_rep010Bool] + simp [toTape, b2f, evalCore] + rw [h_ys] at hstar + exact stepStar_trans (stepPlus_stepStar init_2_reaches_era0) hstar + +def checkBridge_0689 : Bool := + match runEras 132 3 (stepU 3 (0, .sw1)) with + | some (N, u) => decide (2440 ≤ N ∧ 3 * levelU u ≤ 8 * N + 1200) + | none => false + +set_option maxRecDepth 2000000 in +set_option maxHeartbeats 20000000 in +-- Evaluating 132 symbolic era steps requires higher recursion depth and heartbeats. +theorem checkBridge_0689_eq_true : checkBridge_0689 = true := rfl + +set_option maxRecDepth 2000000 in +set_option maxHeartbeats 20000000 in +-- Unfolding 132 symbolic era steps in the initial bridge requires higher heartbeats. +theorem era_inv_init_0689 : + ∃ cfg₀, + ((((default : ListBlank (Fin 2)) {{2}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢* cfg₀) + ∧ + EraInv cfg₀ := by + have hb := checkBridge_0689_eq_true + unfold checkBridge_0689 at hb + cases hrun : runEras 132 3 (stepU 3 (0, .sw1)) with + | none => rw [hrun] at hb; nomatch hb + | some pair => + rcases pair with ⟨N_133, u_133⟩ + rw [hrun, decide_eq_true_iff] at hb + have hS1 : Sweeps 3 (evalCore .sw1) (evalU (stepU 3 (0, .sw1))) := + stepU_sound 3 (0, .sw1) + obtain ⟨rem_133, hstar_bridge, hS_133⟩ := + runEras_sound 132 3 N_133 (evalCore .sw1) (stepU 3 (0, .sw1)) u_133 hS1 hrun + exact ⟨((rep010 N_133 rem_133) {{E}}> default), + stepStar_trans init_2_reaches_era1 hstar_bridge, + ⟨N_133, rem_133, u_133, hb.1, hb.2, hS_133, rfl⟩⟩ + +theorem is_does_not_halt : IsNotHalt target_tm := + closed_inv_does_not_halt target_tm EraInv era_inv_init era_inv_step + +end Solution + +public section + +open Solution in +theorem is_not_halt_from_0471 : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{1}}> default) [target]⊢* cfg) → + (step target cfg).isSome := + closed_inv_does_not_halt target_tm EraInv era_inv_init_0471 era_inv_step + +open Solution in +theorem is_not_halt_from_0689 : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{2}}> default) [target]⊢* cfg) → + (step target cfg).isSome := + closed_inv_does_not_halt target_tm EraInv era_inv_init_0689 era_inv_step + +open Solution in +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF1LB_HHH0RA.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF1LB_HHH0RA.lean new file mode 100644 index 00000000..9788a0b5 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF1LB_HHH0RA.lean @@ -0,0 +1,523 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF1LB_HHH0RA + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF1LB_HHH0RA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +set_option maxRecDepth 2000000 +set_option maxHeartbeats 20000000 + +theorem _jb_zero_cons_default : ((0 : Fin 2) >> (default : ListBlank (Fin 2))) = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +theorem _jb_default_head_zero : (default : ListBlank (Fin 2)).head = (0 : Fin 2) := rfl +theorem _jb_default_tail_eq : (default : ListBlank (Fin 2)).tail = default := rfl +theorem _jb_init_nil_cfg : (init [] : Cfg (Fin 2) (Fin 6)) = ⟨some 0, ⟨0, default, default⟩⟩ := by + ext <;> rfl +theorem _jb_mk_nil : (Turing.ListBlank.mk ([] : List (Fin 2))) = default := rfl +theorem _jb_mk_cons (a : Fin 2) (l : List (Fin 2)) : Turing.ListBlank.mk (a :: l) = a >> Turing.ListBlank.mk l := rfl +theorem _jb_head_append_cons (a : Fin 2) (l : List (Fin 2)) (s : ListBlank (Fin 2)) : ((a :: l) +> s).head = a := by + simp [Turing.ListBlank.head_cons] +theorem _jb_tail_append_cons (a : Fin 2) (l : List (Fin 2)) (s : ListBlank (Fin 2)) : ((a :: l) +> s).tail = l +> s := by + simp [Turing.ListBlank.tail_cons] + +-- ============================================================================ +-- Unconditional IsNotHalt proof for holdout_0696 (1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF1LB_---0RA) +-- Exact S_6 x Z_2 twin (mir=1, perm=DABECF, diffs=0) of verified_answers/holdout_0228/answer.lean +-- ============================================================================ + +set_option maxHeartbeats 20000000 +set_option maxRecDepth 2000000 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem pow_zero_list (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +omit [Inhabited Γ] in +@[simp] +theorem list_pow_append_one (u : List (Fin 2)) (k : Nat) : + u^k ++ u = u^(k + 1) := by + have h := list_pow_add_comm u k 1 + dsimp [HPow.hPow] at h ⊢ + rw [List.append_nil] at h + exact h + +theorem pow_add_append_right (u : List (Fin 2)) (m n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (m + n)) +> r = (u ^ m) +> ((u ^ n) +> r) := by + rw [list_pow_add, ← listblank_append_append] + +theorem pow_succ_append_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (n + 1)) +> r = u +> ((u ^ n) +> r) := by + rw [pow_succ_list, ← listblank_append_append] + +theorem pow_succ_append_right' (u : List (Fin 2)) (k : Nat) (r : ListBlank (Fin 2)) : + (u ^ k) +> (u +> r) = (u ^ (k + 1)) +> r := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (m n : Nat) : + s <+ (u ^ (m + n)) = (s <+ (u ^ m)) <+ (u ^ n) := by + rw [listblank_append_append, ← list_pow_add, add_comm] + +theorem pow_succ_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k : Nat) : + (s <+ u) <+ (u ^ k) = s <+ (u ^ (k + 1)) := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add3_append_right (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) (r : ListBlank (Fin 2)) : + (u ^ (k₁ + k₂ + k₃)) +> r = (u ^ k₁) +> ((u ^ k₂) +> ((u ^ k₃) +> r)) := by + rw [pow_add_append_right u (k₁ + k₂) k₃ r, pow_add_append_right u k₁ k₂ ((u ^ k₃) +> r)] + +theorem pow_add3_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) : + s <+ (u ^ (k₁ + k₂ + k₃)) = ((s <+ (u ^ k₁)) <+ (u ^ k₂)) <+ (u ^ k₃) := by + rw [pow_add_append_left s u (k₁ + k₂) k₃, pow_add_append_left s u k₁ k₂] + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, _, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +theorem step_some {c c' : Cfg (Fin 2) (Fin 6)} (h : step target_tm c = some c') : + c [target_tm]⊢⁺ c' := ⟨1, Nat.zero_lt_one, h⟩ + +theorem stepPlus_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := step_stepStar_stepPlus h1 (stepPlus_stepStar h2) + +theorem stepStar_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢* c₃ := stepStar_trans (step_stepStar target_tm c₁ c₂ h1) h2 + +theorem stepPlus_stepStar_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢⁺ c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepPlus_stepStar_stepPlus h1 h2 + +theorem stepStar_stepPlus_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢* c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepStar_stepPlus_stepPlus h1 h2 + +theorem stepPlus_of_step {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢ c₂) : + c₁ [target_tm]⊢⁺ c₂ := step_stepPlus target_tm c₁ c₂ h + +theorem stepStar_of_stepPlus {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢⁺ c₂) : + c₁ [target_tm]⊢* c₂ := stepPlus_stepStar h + +local macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +local macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail]) +local macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step))) +local macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +theorem multiStep_step_isSome {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₀ cfg cfg' : Cfg Γ Λ) (n m : Nat) + (hn : multiStep M c₀ n = some cfg) + (hnm : multiStep M c₀ (n + (1 + m)) = some cfg') : + (step M cfg).isSome := by + rw [multiStep_add M c₀ n (1 + m), hn] at hnm + dsimp [Option.bind] at hnm + rw [multiStep_add M cfg 1 m, multiStep_one] at hnm + cases hs : step M cfg with + | none => + rw [hs] at hnm + nomatch hnm + | some c₁ => rfl + +theorem inv_reaches_beyond {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') + (N : Nat) : + ∃ (m : Nat) (cfg' : Cfg Γ Λ), multiStep M (init []) (N + m) = some cfg' ∧ Inv cfg' := by + induction N with + | zero => + obtain ⟨cfg₀, ⟨n₀, hn₀⟩, h_inv₀⟩ := h_init + refine ⟨n₀, cfg₀, ?_, h_inv₀⟩ + rwa [Nat.zero_add] + | succ N ih => + obtain ⟨m, cfg₁, hm, h_inv₁⟩ := ih + cases m with + | zero => + obtain ⟨cfg₂, ⟨k, hk_pos, hk⟩, h_inv₂⟩ := h_step cfg₁ h_inv₁ + cases k with + | zero => omega + | succ k' => + refine ⟨k', cfg₂, ?_, h_inv₂⟩ + have h_trans := multiStep_trans M (init []) cfg₁ cfg₂ N (k' + 1) hm hk + have h_eq : (N + 1) + k' = N + (k' + 1) := by omega + rwa [h_eq] + | succ m' => + refine ⟨m', cfg₁, ?_, h_inv₁⟩ + have h_eq : (N + 1) + m' = N + (m' + 1) := by omega + rwa [h_eq] + +theorem closed_inv_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') : + IsDoesNotHalt M := by + intro cfg ⟨n, hn⟩ + obtain ⟨m, cfg', hnm, _⟩ := inv_reaches_beyond M Inv h_init h_step (n + 1) + have h_eq : (n + 1) + m = n + (1 + m) := by omega + rw [h_eq] at hnm + exact multiStep_step_isSome M (init []) cfg cfg' n m hn hnm + +theorem closed_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) + (n₀ : Nat) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, ∃ n', (hub n) [M]⊢⁺ (hub n')) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hcfg⟩ + subst hcfg + obtain ⟨n', hn'⟩ := h_step n + exact ⟨hub n', hn', ⟨n', rfl⟩⟩ + +theorem closed_guarded_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) (P : Nat → Prop) + (n₀ : Nat) (h_P₀ : P n₀) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, P n → ∃ n', P n' ∧ ((hub n) [M]⊢⁺ (hub n'))) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, P n ∧ cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, h_P₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hPn, hcfg⟩ + subst hcfg + obtain ⟨n', hPn', hn'⟩ := h_step n hPn + exact ⟨hub n', hn', ⟨n', hPn', rfl⟩⟩ + + +def QINIT : Fin 6 := 0 +def B : Fin 6 := 1 +def E : Fin 6 := 0 +abbrev holdout_0696_tm : Machine (Fin 2) (Fin 6) := target_tm +abbrev M : Machine (Fin 2) (Fin 6) := target_tm + +theorem rule_B_000 (l r : ListBlank (Fin 2)) : + (([0, 0, 0] +> r) <{{B}} l) [target_tm]⊢⁺ (([0, 0, 1] +> r) {{E}}> l) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_001 (l r : ListBlank (Fin 2)) : + (([0, 0, 1] +> r) <{{B}} l) [target_tm]⊢⁺ (r <{{B}} (l <+ [1, 1, 1])) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_010 (l r : ListBlank (Fin 2)) : + (([0, 1, 0] +> r) <{{B}} l) [target_tm]⊢⁺ (r <{{B}} (l <+ [0, 1, 1])) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_10 (l r : ListBlank (Fin 2)) : + (([1, 0] +> r) <{{B}} l) [target_tm]⊢⁺ (r <{{B}} (l <+ [0, 0])) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_111 (l r : ListBlank (Fin 2)) : + (r {{E}}> (l <+ [1, 1, 1])) [target_tm]⊢⁺ (([0, 0, 0] +> r) {{E}}> l) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_011 (l r : ListBlank (Fin 2)) : + (r {{E}}> (l <+ [0, 1, 1])) [target_tm]⊢⁺ (([0, 1, 0] +> r) {{E}}> l) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_00 (l r : ListBlank (Fin 2)) : + (((0 : Fin 2) >> r) {{E}}> (l <+ [0, 0])) [target_tm]⊢⁺ (r <{{B}} (l <+ [0, 1, 1])) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_nil (r : ListBlank (Fin 2)) : + (((0 : Fin 2) >> r) {{E}}> default) [target_tm]⊢⁺ (r <{{B}} (default <+ [0, 1, 1])) := by + dsimp [ListBlank.append]; execute + +def Round (r r' : ListBlank (Fin 2)) : Prop := + ∀ l : ListBlank (Fin 2), (r <{{B}} l) [target_tm]⊢⁺ (r' {{E}}> l) + +inductive Sweeps : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) → Prop + | zero (r : ListBlank (Fin 2)) : Sweeps 0 r r + | succ {n : Nat} {r r₁ r₂ : ListBlank (Fin 2)} : + Round r r₁ → Sweeps n r₁ r₂ → Sweeps (n + 1) r r₂ + +theorem Sweeps.trans {a b : Nat} {r₁ r₂ r₃ : ListBlank (Fin 2)} + (h₁ : Sweeps a r₁ r₂) (h₂ : Sweeps b r₂ r₃) : Sweeps (a + b) r₁ r₃ := by + induction h₁ with + | zero _ => simpa using h₂ + | succ hr _ ih => + rw [Nat.succ_add] + exact Sweeps.succ hr (ih h₂) + +theorem sweeps_split_last {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps (n + 1) r r') : + ∃ r₁ : ListBlank (Fin 2), Sweeps n r r₁ ∧ Round r₁ r' := by + induction n generalizing r with + | zero => + cases h with + | succ hr h0 => + cases h0 with + | zero _ => exact ⟨r, Sweeps.zero r, hr⟩ + | succ m ih => + cases h with + | succ hr hs => + obtain ⟨r₁, hs₁, hr₁⟩ := ih hs + exact ⟨r₁, Sweeps.succ hr hs₁, hr₁⟩ + +theorem round_000 (r : ListBlank (Fin 2)) : + Round ([0, 0, 0] +> r) ([0, 0, 1] +> r) := + fun l => rule_B_000 l r + +theorem round_001 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 0, 1] +> r) ([0, 0, 0] +> r') := + fun l => stepPlus_trans (rule_B_001 l r) (stepPlus_trans (h (l <+ [1, 1, 1])) (rule_E_111 l r')) + +theorem round_010 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 1, 0] +> r) ([0, 1, 0] +> r') := + fun l => stepPlus_trans (rule_B_010 l r) (stepPlus_trans (h (l <+ [0, 1, 1])) (rule_E_011 l r')) + +theorem round_10 {r₁ r r₂ : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Round r r₂) : + Round ([1, 0] +> r₁) ([0, 1, 0] +> r₂) := + fun l => stepPlus_trans (rule_B_10 l r₁) + (stepPlus_trans (h₁ (l <+ [0, 0])) + (stepPlus_trans (rule_E_00 l r) + (stepPlus_trans (h₂ (l <+ [0, 1, 1])) (rule_E_011 l r₂)))) + +theorem sweeps_010 {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps n r r') : + Sweeps n ([0, 1, 0] +> r) ([0, 1, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | succ hr _ ih => exact Sweeps.succ (round_010 hr) ih + +theorem sweeps_10 {n : Nat} {r₁ r r' : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Sweeps (n + 1) r r') : + Sweeps (n + 1) ([1, 0] +> r₁) ([0, 1, 0] +> r') := by + cases h₂ with + | succ hr₂ hs => + exact Sweeps.succ (round_10 h₁ hr₂) (sweeps_010 hs) + +theorem sweeps_000_even {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k) ([0, 0, 0] +> r) ([0, 0, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | @succ m r₀ r₁ r₂ hr _ ih => + have h2 : Sweeps 2 ([0, 0, 0] +> r₀) ([0, 0, 0] +> r₁) := + Sweeps.succ (round_000 r₀) (Sweeps.succ (round_001 hr) (Sweeps.zero _)) + have htr := Sweeps.trans h2 ih + rw [show 2 + 2 * m = 2 * (m + 1) by omega] at htr + exact htr + +theorem sweeps_000_odd {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k + 1) ([0, 0, 0] +> r) ([0, 0, 1] +> r') := by + have he := sweeps_000_even h + have h1 : Sweeps 1 ([0, 0, 0] +> r') ([0, 0, 1] +> r') := + Sweeps.succ (round_000 r') (Sweeps.zero _) + exact Sweeps.trans he h1 + +theorem default_eq_b000 : + (default : ListBlank (Fin 2)) = [0, 0, 0] +> default := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b000_cons_zero (r : ListBlank (Fin 2)) : + [0, 0, 0] +> ((0 : Fin 2) >> r) = (0 : Fin 2) >> ([0, 0, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +theorem b001_cons_zero (r : ListBlank (Fin 2)) : + [0, 0, 1] +> ((0 : Fin 2) >> r) = (0 : Fin 2) >> ([0, 1, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +theorem b001_default_eq : + ([0, 0, 1] +> default : ListBlank (Fin 2)) = (0 : Fin 2) >> ([0, 1, 0] +> default) := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b010_eq_zero_cons_b10 (r : ListBlank (Fin 2)) : + [0, 1, 0] +> r = (0 : Fin 2) >> ([1, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +inductive Valid : Nat → ListBlank (Fin 2) → Prop + | nil {n : Nat} (hn : n ≥ 1) : + Valid n default + | t0 {n : Nat} {r : ListBlank (Fin 2)} (hn : n ≥ 2) (hr : Valid (n / 2) r) : + Valid n ([0, 0, 0] +> r) + | t1 {n : Nat} {r : ListBlank (Fin 2)} (hn : n ≥ 1) (hr : Valid (n + 1) r) : + Valid n ([0, 1, 0] +> r) + | t2 {n : Nat} {r₁ r : ListBlank (Fin 2)} (hn : n ≥ 1) + (hround : Round r₁ ((0 : Fin 2) >> r)) (hr : Valid (n + 1) r) : + Valid n ([1, 0] +> r₁) + +theorem Valid.mono {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) {n' : Nat} (hle : n ≤ n') : + Valid n' r := by + induction h generalizing n' with + | nil hn => exact Valid.nil (by omega) + | t0 hn _ ih => exact Valid.t0 (by omega) (ih (by omega)) + | t1 hn _ ih => exact Valid.t1 (by omega) (ih (by omega)) + | t2 hn hround _ ih => exact Valid.t2 (by omega) hround (ih (by omega)) + +theorem valid_sweeps_nil : ∀ n : Nat, n ≥ 1 → + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ Sweeps n default ((0 : Fin 2) >> r') := by + intro n + induction n using Nat.strongRecOn with + | ind n ih => + intro hn + rcases ( by omega : n = 1 ∨ (n ≥ 2 ∧ n % 2 = 0) ∨ (n ≥ 2 ∧ n % 2 = 1) ) with rfl | ⟨hn2, hev⟩ | ⟨hn2, hod⟩ + · refine ⟨[0, 1, 0] +> default, Valid.t1 (by omega) (Valid.nil (by omega)), ?_⟩ + have h1 : Sweeps 1 ([0, 0, 0] +> default) ([0, 0, 1] +> default) := + Sweeps.succ (round_000 default) (Sweeps.zero _) + rw [b001_default_eq, ← default_eq_b000] at h1 + exact h1 + · obtain ⟨r', hr', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨[0, 0, 0] +> r', Valid.t0 hn2 hr', ?_⟩ + have he := sweeps_000_even hs' + rw [← default_eq_b000, b000_cons_zero, show 2 * (n / 2) = n by omega] at he + exact he + · obtain ⟨r', hr', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨[0, 1, 0] +> r', Valid.t1 (by omega) (hr'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [← default_eq_b000, b001_cons_zero, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + +theorem valid_sweeps {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) : + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ Sweeps n r ((0 : Fin 2) >> r') := by + induction h with + | @nil n hn => exact valid_sweeps_nil n hn + | @t0 n r hn hr ih => + obtain ⟨r', hr', hs'⟩ := ih + rcases ( by omega : n % 2 = 0 ∨ n % 2 = 1 ) with hev | hod + · refine ⟨[0, 0, 0] +> r', Valid.t0 hn hr', ?_⟩ + have he := sweeps_000_even hs' + rw [b000_cons_zero, show 2 * (n / 2) = n by omega] at he + exact he + · refine ⟨[0, 1, 0] +> r', Valid.t1 (by omega) (hr'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [b001_cons_zero, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + | @t1 n r hn hr ih => + obtain ⟨r', hr', hs'⟩ := ih + obtain ⟨r₁, hs₁, hr₁⟩ := sweeps_split_last hs' + refine ⟨[1, 0] +> r₁, Valid.t2 hn hr₁ hr', ?_⟩ + rw [← b010_eq_zero_cons_b10] + exact sweeps_010 hs₁ + | @t2 n r₁ r hn hround hr ih => + obtain ⟨r', hr', hs'⟩ := ih + obtain ⟨r₂, hs₂, hr₂⟩ := sweeps_split_last hs' + refine ⟨[1, 0] +> r₂, Valid.t2 hn hr₂ hr', ?_⟩ + rw [← b010_eq_zero_cons_b10] + rw [show n = (n - 1) + 1 by omega] at hs₂ ⊢ + exact sweeps_10 hround hs₂ + +theorem era_step {r : ListBlank (Fin 2)} (h : Valid 1 r) : + ∃ r' : ListBlank (Fin 2), Valid 1 r' ∧ + ((((0 : Fin 2) >> r) {{E}}> default) [target_tm]⊢⁺ (((0 : Fin 2) >> r') {{E}}> default)) := by + obtain ⟨r', hr', hs'⟩ := valid_sweeps (h.mono (by omega : 1 ≤ 2)) + obtain ⟨r₁, hs₁, hr₂⟩ := sweeps_split_last hs' + obtain ⟨r₀, hs₀, hr₁⟩ := sweeps_split_last hs₁ + cases hs₀ with + | zero _ => + refine ⟨[1, 0] +> r₁, Valid.t2 (by omega) hr₂ hr', ?_⟩ + have s1 := rule_E_nil r + have s2 := hr₁ (default <+ [0, 1, 1]) + have s3 := rule_E_011 default r₁ + rw [← b010_eq_zero_cons_b10] + exact stepPlus_trans s1 (stepPlus_trans s2 s3) + +def era0_r : ListBlank (Fin 2) := + default + +theorem init_reaches_era0 : + (init []) [target_tm]⊢* (((0 : Fin 2) >> era0_r) {{E}}> default) := by + refine ⟨0, ?_⟩ + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{E}}> default) := rfl + rw [h_init, multiStep_zero, era0_r, zero_cons_default] + +theorem valid_era0 : Valid 1 era0_r := + Valid.nil (by omega) + +private theorem holdout_0696_nonhalt : IsDoesNotHalt holdout_0696_tm := by + refine closed_inv_does_not_halt target_tm + (fun cfg => ∃ r : ListBlank (Fin 2), Valid 1 r ∧ cfg = (((0 : Fin 2) >> r) {{E}}> default)) + ⟨((0 : Fin 2) >> era0_r) {{E}}> default, init_reaches_era0, ⟨era0_r, valid_era0, rfl⟩⟩ ?_ + intro cfg ⟨r, hr, hcfg⟩ + subst hcfg + obtain ⟨r', hr', hstep⟩ := era_step hr + exact ⟨((0 : Fin 2) >> r') {{E}}> default, hstep, ⟨r', hr', rfl⟩⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := + holdout_0696_nonhalt + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF1LB_HHH0RA diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0LD_1LE1LD_0LB0RF_1RA1LB_1RAHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0LD_1LE1LD_0LB0RF_1RA1LB_1RAHHH.lean new file mode 100644 index 00000000..cef08d5d --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0LD_1LE1LD_0LB0RF_1RA1LB_1RAHHH.lean @@ -0,0 +1,524 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RF_1RA1LB_1RAHHH + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0LD_1LE1LD_0LB0RF_1RA1LB_1RAHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +set_option maxRecDepth 2000000 +set_option maxHeartbeats 20000000 + +theorem _jb_zero_cons_default : ((0 : Fin 2) >> (default : ListBlank (Fin 2))) = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +theorem _jb_default_head_zero : (default : ListBlank (Fin 2)).head = (0 : Fin 2) := rfl +theorem _jb_default_tail_eq : (default : ListBlank (Fin 2)).tail = default := rfl +theorem _jb_init_nil_cfg : (init [] : Cfg (Fin 2) (Fin 6)) = ⟨some 0, ⟨0, default, default⟩⟩ := by + ext <;> rfl +theorem _jb_mk_nil : (Turing.ListBlank.mk ([] : List (Fin 2))) = default := rfl +theorem _jb_mk_cons (a : Fin 2) (l : List (Fin 2)) : Turing.ListBlank.mk (a :: l) = a >> Turing.ListBlank.mk l := rfl +theorem _jb_head_append_cons (a : Fin 2) (l : List (Fin 2)) (s : ListBlank (Fin 2)) : ((a :: l) +> s).head = a := by + simp [Turing.ListBlank.head_cons] +theorem _jb_tail_append_cons (a : Fin 2) (l : List (Fin 2)) (s : ListBlank (Fin 2)) : ((a :: l) +> s).tail = l +> s := by + simp [Turing.ListBlank.tail_cons] + +-- ============================================================================ +-- Unconditional IsNotHalt proof for holdout_0682 (1RB0RA_1LC0LD_1LE1LD_0LB0RF_1RA1LB_1RA---) +-- Exact S6 x Z2 twin of holdout_0228 under tape reflection (mir = -1) and perm = BCEADF (B = 1, E = 0) +-- ============================================================================ + +set_option maxHeartbeats 20000000 +set_option maxRecDepth 2000000 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem pow_zero_list (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +omit [Inhabited Γ] in +@[simp] +theorem list_pow_append_one (u : List (Fin 2)) (k : Nat) : + u^k ++ u = u^(k + 1) := by + have h := list_pow_add_comm u k 1 + dsimp [HPow.hPow] at h ⊢ + rw [List.append_nil] at h + exact h + +theorem pow_add_append_right (u : List (Fin 2)) (m n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (m + n)) +> r = (u ^ m) +> ((u ^ n) +> r) := by + rw [list_pow_add, ← listblank_append_append] + +theorem pow_succ_append_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (n + 1)) +> r = u +> ((u ^ n) +> r) := by + rw [pow_succ_list, ← listblank_append_append] + +theorem pow_succ_append_right' (u : List (Fin 2)) (k : Nat) (r : ListBlank (Fin 2)) : + (u ^ k) +> (u +> r) = (u ^ (k + 1)) +> r := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (m n : Nat) : + s <+ (u ^ (m + n)) = (s <+ (u ^ m)) <+ (u ^ n) := by + rw [listblank_append_append, ← list_pow_add, add_comm] + +theorem pow_succ_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k : Nat) : + (s <+ u) <+ (u ^ k) = s <+ (u ^ (k + 1)) := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add3_append_right (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) (r : ListBlank (Fin 2)) : + (u ^ (k₁ + k₂ + k₃)) +> r = (u ^ k₁) +> ((u ^ k₂) +> ((u ^ k₃) +> r)) := by + rw [pow_add_append_right u (k₁ + k₂) k₃ r, pow_add_append_right u k₁ k₂ ((u ^ k₃) +> r)] + +theorem pow_add3_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) : + s <+ (u ^ (k₁ + k₂ + k₃)) = ((s <+ (u ^ k₁)) <+ (u ^ k₂)) <+ (u ^ k₃) := by + rw [pow_add_append_left s u (k₁ + k₂) k₃, pow_add_append_left s u k₁ k₂] + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, _, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +theorem step_some {c c' : Cfg (Fin 2) (Fin 6)} (h : step target_tm c = some c') : + c [target_tm]⊢⁺ c' := ⟨1, Nat.zero_lt_one, h⟩ + +theorem stepPlus_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := step_stepStar_stepPlus h1 (stepPlus_stepStar h2) + +theorem stepStar_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢* c₃ := stepStar_trans (step_stepStar target_tm c₁ c₂ h1) h2 + +theorem stepPlus_stepStar_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢⁺ c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepPlus_stepStar_stepPlus h1 h2 + +theorem stepStar_stepPlus_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢* c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepStar_stepPlus_stepPlus h1 h2 + +theorem stepPlus_of_step {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢ c₂) : + c₁ [target_tm]⊢⁺ c₂ := step_stepPlus target_tm c₁ c₂ h + +theorem stepStar_of_stepPlus {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢⁺ c₂) : + c₁ [target_tm]⊢* c₂ := stepPlus_stepStar h + +local macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +local macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail]) +local macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step))) +local macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +theorem multiStep_step_isSome {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₀ cfg cfg' : Cfg Γ Λ) (n m : Nat) + (hn : multiStep M c₀ n = some cfg) + (hnm : multiStep M c₀ (n + (1 + m)) = some cfg') : + (step M cfg).isSome := by + rw [multiStep_add M c₀ n (1 + m), hn] at hnm + dsimp [Option.bind] at hnm + rw [multiStep_add M cfg 1 m, multiStep_one] at hnm + cases hs : step M cfg with + | none => + rw [hs] at hnm + nomatch hnm + | some c₁ => rfl + +theorem inv_reaches_beyond {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') + (N : Nat) : + ∃ (m : Nat) (cfg' : Cfg Γ Λ), multiStep M (init []) (N + m) = some cfg' ∧ Inv cfg' := by + induction N with + | zero => + obtain ⟨cfg₀, ⟨n₀, hn₀⟩, h_inv₀⟩ := h_init + refine ⟨n₀, cfg₀, ?_, h_inv₀⟩ + rwa [Nat.zero_add] + | succ N ih => + obtain ⟨m, cfg₁, hm, h_inv₁⟩ := ih + cases m with + | zero => + obtain ⟨cfg₂, ⟨k, hk_pos, hk⟩, h_inv₂⟩ := h_step cfg₁ h_inv₁ + cases k with + | zero => omega + | succ k' => + refine ⟨k', cfg₂, ?_, h_inv₂⟩ + have h_trans := multiStep_trans M (init []) cfg₁ cfg₂ N (k' + 1) hm hk + have h_eq : (N + 1) + k' = N + (k' + 1) := by omega + rwa [h_eq] + | succ m' => + refine ⟨m', cfg₁, ?_, h_inv₁⟩ + have h_eq : (N + 1) + m' = N + (m' + 1) := by omega + rwa [h_eq] + +theorem closed_inv_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') : + IsDoesNotHalt M := by + intro cfg ⟨n, hn⟩ + obtain ⟨m, cfg', hnm, _⟩ := inv_reaches_beyond M Inv h_init h_step (n + 1) + have h_eq : (n + 1) + m = n + (1 + m) := by omega + rw [h_eq] at hnm + exact multiStep_step_isSome M (init []) cfg cfg' n m hn hnm + +theorem closed_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) + (n₀ : Nat) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, ∃ n', (hub n) [M]⊢⁺ (hub n')) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hcfg⟩ + subst hcfg + obtain ⟨n', hn'⟩ := h_step n + exact ⟨hub n', hn', ⟨n', rfl⟩⟩ + +theorem closed_guarded_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) (P : Nat → Prop) + (n₀ : Nat) (h_P₀ : P n₀) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, P n → ∃ n', P n' ∧ ((hub n) [M]⊢⁺ (hub n'))) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, P n ∧ cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, h_P₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hPn, hcfg⟩ + subst hcfg + obtain ⟨n', hPn', hn'⟩ := h_step n hPn + exact ⟨hub n', hn', ⟨n', hPn', rfl⟩⟩ + + +def QINIT : Fin 6 := 0 +def B : Fin 6 := 1 +def E : Fin 6 := 0 +abbrev holdout_0682_tm : Machine (Fin 2) (Fin 6) := target_tm +abbrev M : Machine (Fin 2) (Fin 6) := target_tm + +theorem rule_B_000 (l r : ListBlank (Fin 2)) : + (([0, 0, 0] +> r) <{{B}} l) [target_tm]⊢⁺ (([0, 0, 1] +> r) {{E}}> l) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_001 (l r : ListBlank (Fin 2)) : + (([0, 0, 1] +> r) <{{B}} l) [target_tm]⊢⁺ (r <{{B}} (l <+ [1, 1, 1])) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_010 (l r : ListBlank (Fin 2)) : + (([0, 1, 0] +> r) <{{B}} l) [target_tm]⊢⁺ (r <{{B}} (l <+ [0, 1, 1])) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_10 (l r : ListBlank (Fin 2)) : + (([1, 0] +> r) <{{B}} l) [target_tm]⊢⁺ (r <{{B}} (l <+ [0, 0])) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_111 (l r : ListBlank (Fin 2)) : + (r {{E}}> (l <+ [1, 1, 1])) [target_tm]⊢⁺ (([0, 0, 0] +> r) {{E}}> l) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_011 (l r : ListBlank (Fin 2)) : + (r {{E}}> (l <+ [0, 1, 1])) [target_tm]⊢⁺ (([0, 1, 0] +> r) {{E}}> l) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_00 (l r : ListBlank (Fin 2)) : + (((0 : Fin 2) >> r) {{E}}> (l <+ [0, 0])) [target_tm]⊢⁺ (r <{{B}} (l <+ [0, 1, 1])) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_nil (r : ListBlank (Fin 2)) : + (((0 : Fin 2) >> r) {{E}}> default) [target_tm]⊢⁺ (r <{{B}} (default <+ [0, 1, 1])) := by + dsimp [ListBlank.append]; execute + +def Round (r r' : ListBlank (Fin 2)) : Prop := + ∀ l : ListBlank (Fin 2), (r <{{B}} l) [target_tm]⊢⁺ (r' {{E}}> l) + +inductive Sweeps : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) → Prop + | zero (r : ListBlank (Fin 2)) : Sweeps 0 r r + | succ {n : Nat} {r r₁ r₂ : ListBlank (Fin 2)} : + Round r r₁ → Sweeps n r₁ r₂ → Sweeps (n + 1) r r₂ + +theorem Sweeps.trans {a b : Nat} {r₁ r₂ r₃ : ListBlank (Fin 2)} + (h₁ : Sweeps a r₁ r₂) (h₂ : Sweeps b r₂ r₃) : Sweeps (a + b) r₁ r₃ := by + induction h₁ with + | zero _ => simpa using h₂ + | succ hr _ ih => + rw [Nat.succ_add] + exact Sweeps.succ hr (ih h₂) + +theorem sweeps_split_last {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps (n + 1) r r') : + ∃ r₁ : ListBlank (Fin 2), Sweeps n r r₁ ∧ Round r₁ r' := by + induction n generalizing r with + | zero => + cases h with + | succ hr h0 => + cases h0 with + | zero _ => exact ⟨r, Sweeps.zero r, hr⟩ + | succ m ih => + cases h with + | succ hr hs => + obtain ⟨r₁, hs₁, hr₁⟩ := ih hs + exact ⟨r₁, Sweeps.succ hr hs₁, hr₁⟩ + +theorem round_000 (r : ListBlank (Fin 2)) : + Round ([0, 0, 0] +> r) ([0, 0, 1] +> r) := + fun l => rule_B_000 l r + +theorem round_001 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 0, 1] +> r) ([0, 0, 0] +> r') := + fun l => stepPlus_trans (rule_B_001 l r) (stepPlus_trans (h (l <+ [1, 1, 1])) (rule_E_111 l r')) + +theorem round_010 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 1, 0] +> r) ([0, 1, 0] +> r') := + fun l => stepPlus_trans (rule_B_010 l r) (stepPlus_trans (h (l <+ [0, 1, 1])) (rule_E_011 l r')) + +theorem round_10 {r₁ r r₂ : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Round r r₂) : + Round ([1, 0] +> r₁) ([0, 1, 0] +> r₂) := + fun l => stepPlus_trans (rule_B_10 l r₁) + (stepPlus_trans (h₁ (l <+ [0, 0])) + (stepPlus_trans (rule_E_00 l r) + (stepPlus_trans (h₂ (l <+ [0, 1, 1])) (rule_E_011 l r₂)))) + +theorem sweeps_010 {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps n r r') : + Sweeps n ([0, 1, 0] +> r) ([0, 1, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | succ hr _ ih => exact Sweeps.succ (round_010 hr) ih + +theorem sweeps_10 {n : Nat} {r₁ r r' : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Sweeps (n + 1) r r') : + Sweeps (n + 1) ([1, 0] +> r₁) ([0, 1, 0] +> r') := by + cases h₂ with + | succ hr₂ hs => + exact Sweeps.succ (round_10 h₁ hr₂) (sweeps_010 hs) + +theorem sweeps_000_even {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k) ([0, 0, 0] +> r) ([0, 0, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | @succ m r₀ r₁ r₂ hr _ ih => + have h2 : Sweeps 2 ([0, 0, 0] +> r₀) ([0, 0, 0] +> r₁) := + Sweeps.succ (round_000 r₀) (Sweeps.succ (round_001 hr) (Sweeps.zero _)) + have htr := Sweeps.trans h2 ih + rw [show 2 + 2 * m = 2 * (m + 1) by omega] at htr + exact htr + +theorem sweeps_000_odd {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k + 1) ([0, 0, 0] +> r) ([0, 0, 1] +> r') := by + have he := sweeps_000_even h + have h1 : Sweeps 1 ([0, 0, 0] +> r') ([0, 0, 1] +> r') := + Sweeps.succ (round_000 r') (Sweeps.zero _) + exact Sweeps.trans he h1 + +theorem default_eq_b000 : + (default : ListBlank (Fin 2)) = [0, 0, 0] +> default := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b000_cons_zero (r : ListBlank (Fin 2)) : + [0, 0, 0] +> ((0 : Fin 2) >> r) = (0 : Fin 2) >> ([0, 0, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +theorem b001_cons_zero (r : ListBlank (Fin 2)) : + [0, 0, 1] +> ((0 : Fin 2) >> r) = (0 : Fin 2) >> ([0, 1, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +theorem b001_default_eq : + ([0, 0, 1] +> default : ListBlank (Fin 2)) = (0 : Fin 2) >> ([0, 1, 0] +> default) := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b010_eq_zero_cons_b10 (r : ListBlank (Fin 2)) : + [0, 1, 0] +> r = (0 : Fin 2) >> ([1, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +inductive Valid : Nat → ListBlank (Fin 2) → Prop + | nil {n : Nat} (hn : n ≥ 1) : + Valid n default + | t0 {n : Nat} {r : ListBlank (Fin 2)} (hn : n ≥ 2) (hr : Valid (n / 2) r) : + Valid n ([0, 0, 0] +> r) + | t1 {n : Nat} {r : ListBlank (Fin 2)} (hn : n ≥ 1) (hr : Valid (n + 1) r) : + Valid n ([0, 1, 0] +> r) + | t2 {n : Nat} {r₁ r : ListBlank (Fin 2)} (hn : n ≥ 1) + (hround : Round r₁ ((0 : Fin 2) >> r)) (hr : Valid (n + 1) r) : + Valid n ([1, 0] +> r₁) + +theorem Valid.mono {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) {n' : Nat} (hle : n ≤ n') : + Valid n' r := by + induction h generalizing n' with + | nil hn => exact Valid.nil (by omega) + | t0 hn _ ih => exact Valid.t0 (by omega) (ih (by omega)) + | t1 hn _ ih => exact Valid.t1 (by omega) (ih (by omega)) + | t2 hn hround _ ih => exact Valid.t2 (by omega) hround (ih (by omega)) + +theorem valid_sweeps_nil : ∀ n : Nat, n ≥ 1 → + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ Sweeps n default ((0 : Fin 2) >> r') := by + intro n + induction n using Nat.strongRecOn with + | ind n ih => + intro hn + rcases ( by omega : n = 1 ∨ (n ≥ 2 ∧ n % 2 = 0) ∨ (n ≥ 2 ∧ n % 2 = 1) ) with rfl | ⟨hn2, hev⟩ | ⟨hn2, hod⟩ + · refine ⟨[0, 1, 0] +> default, Valid.t1 (by omega) (Valid.nil (by omega)), ?_⟩ + have h1 : Sweeps 1 ([0, 0, 0] +> default) ([0, 0, 1] +> default) := + Sweeps.succ (round_000 default) (Sweeps.zero _) + rw [b001_default_eq, ← default_eq_b000] at h1 + exact h1 + · obtain ⟨r', hr', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨[0, 0, 0] +> r', Valid.t0 hn2 hr', ?_⟩ + have he := sweeps_000_even hs' + rw [← default_eq_b000, b000_cons_zero, show 2 * (n / 2) = n by omega] at he + exact he + · obtain ⟨r', hr', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨[0, 1, 0] +> r', Valid.t1 (by omega) (hr'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [← default_eq_b000, b001_cons_zero, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + +theorem valid_sweeps {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) : + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ Sweeps n r ((0 : Fin 2) >> r') := by + induction h with + | @nil n hn => exact valid_sweeps_nil n hn + | @t0 n r hn hr ih => + obtain ⟨r', hr', hs'⟩ := ih + rcases ( by omega : n % 2 = 0 ∨ n % 2 = 1 ) with hev | hod + · refine ⟨[0, 0, 0] +> r', Valid.t0 hn hr', ?_⟩ + have he := sweeps_000_even hs' + rw [b000_cons_zero, show 2 * (n / 2) = n by omega] at he + exact he + · refine ⟨[0, 1, 0] +> r', Valid.t1 (by omega) (hr'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [b001_cons_zero, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + | @t1 n r hn hr ih => + obtain ⟨r', hr', hs'⟩ := ih + obtain ⟨r₁, hs₁, hr₁⟩ := sweeps_split_last hs' + refine ⟨[1, 0] +> r₁, Valid.t2 hn hr₁ hr', ?_⟩ + rw [← b010_eq_zero_cons_b10] + exact sweeps_010 hs₁ + | @t2 n r₁ r hn hround hr ih => + obtain ⟨r', hr', hs'⟩ := ih + obtain ⟨r₂, hs₂, hr₂⟩ := sweeps_split_last hs' + refine ⟨[1, 0] +> r₂, Valid.t2 hn hr₂ hr', ?_⟩ + rw [← b010_eq_zero_cons_b10] + rw [show n = (n - 1) + 1 by omega] at hs₂ ⊢ + exact sweeps_10 hround hs₂ + +theorem era_step {r : ListBlank (Fin 2)} (h : Valid 1 r) : + ∃ r' : ListBlank (Fin 2), Valid 1 r' ∧ + ((((0 : Fin 2) >> r) {{E}}> default) [target_tm]⊢⁺ (((0 : Fin 2) >> r') {{E}}> default)) := by + obtain ⟨r', hr', hs'⟩ := valid_sweeps (h.mono (by omega : 1 ≤ 2)) + obtain ⟨r₁, hs₁, hr₂⟩ := sweeps_split_last hs' + obtain ⟨r₀, hs₀, hr₁⟩ := sweeps_split_last hs₁ + cases hs₀ with + | zero _ => + refine ⟨[1, 0] +> r₁, Valid.t2 (by omega) hr₂ hr', ?_⟩ + have s1 := rule_E_nil r + have s2 := hr₁ (default <+ [0, 1, 1]) + have s3 := rule_E_011 default r₁ + rw [← b010_eq_zero_cons_b10] + exact stepPlus_trans s1 (stepPlus_trans s2 s3) + +def era0_r : ListBlank (Fin 2) := + default + +theorem init_reaches_era0 : + (init []) [target_tm]⊢* (((0 : Fin 2) >> era0_r) {{E}}> default) := by + refine ⟨0, ?_⟩ + dsimp [init, Tape.mk₁, E, era0_r] + rw [zero_cons_default] + rfl + +theorem valid_era0 : Valid 1 era0_r := + Valid.nil (by omega) + +private theorem holdout_0682_nonhalt : IsDoesNotHalt holdout_0682_tm := by + refine closed_inv_does_not_halt target_tm + (fun cfg => ∃ r : ListBlank (Fin 2), Valid 1 r ∧ cfg = (((0 : Fin 2) >> r) {{E}}> default)) + ⟨(((0 : Fin 2) >> era0_r) {{E}}> default), init_reaches_era0, ⟨era0_r, valid_era0, rfl⟩⟩ ?_ + intro cfg ⟨r, hr, hcfg⟩ + subst hcfg + obtain ⟨r', hr', hstep⟩ := era_step hr + exact ⟨(((0 : Fin 2) >> r') {{E}}> default), hstep, ⟨r', hr', rfl⟩⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := + holdout_0682_nonhalt + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RF_1RA1LB_1RAHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LB0RC.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LB0RC.lean new file mode 100644 index 00000000..64cad3b5 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LB0RC.lean @@ -0,0 +1,590 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LB0RC + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LB0RC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +-- ============================================================================ +-- Wave 25 Standalone verified Canonical Proof Library for holdout_0756 (1RB---_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC) +-- Cluster: Untouched 12/12 & 11/12 Septet IV (0220..0766) | Donor: holdout_0220 (1RB0RA_1LC0LF_1LE0LD_1LB---_1RA1LB_0LB0RC) +-- S_6 x Z_2 Isomorphism: 11/12 match | perm = (E,B,C,A,D,F) | mirror = 1 +-- Differing transition(s): D.F0=0LB vs M.F0=0RA +-- ============================================================================ + +set_option maxHeartbeats 2000000 +set_option maxRecDepth 2000 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem pow_zero_list (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +omit [Inhabited Γ] in +@[simp] +theorem list_pow_append_one (u : List (Fin 2)) (k : Nat) : + u^k ++ u = u^(k + 1) := by + have h := list_pow_add_comm u k 1 + dsimp [HPow.hPow] at h ⊢ + rw [List.append_nil] at h + exact h + +theorem pow_add_append_right (u : List (Fin 2)) (m n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (m + n)) +> r = (u ^ m) +> ((u ^ n) +> r) := by + rw [list_pow_add, ← listblank_append_append] + +theorem pow_succ_append_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (n + 1)) +> r = u +> ((u ^ n) +> r) := by + rw [pow_succ_list, ← listblank_append_append] + +theorem pow_succ_append_right' (u : List (Fin 2)) (k : Nat) (r : ListBlank (Fin 2)) : + (u ^ k) +> (u +> r) = (u ^ (k + 1)) +> r := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (m n : Nat) : + s <+ (u ^ (m + n)) = (s <+ (u ^ m)) <+ (u ^ n) := by + rw [listblank_append_append, ← list_pow_add, add_comm] + +theorem pow_succ_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k : Nat) : + (s <+ u) <+ (u ^ k) = s <+ (u ^ (k + 1)) := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add3_append_right (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) (r : ListBlank (Fin 2)) : + (u ^ (k₁ + k₂ + k₃)) +> r = (u ^ k₁) +> ((u ^ k₂) +> ((u ^ k₃) +> r)) := by + rw [pow_add_append_right u (k₁ + k₂) k₃ r, pow_add_append_right u k₁ k₂ ((u ^ k₃) +> r)] + +theorem pow_add3_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) : + s <+ (u ^ (k₁ + k₂ + k₃)) = ((s <+ (u ^ k₁)) <+ (u ^ k₂)) <+ (u ^ k₃) := by + rw [pow_add_append_left s u (k₁ + k₂) k₃, pow_add_append_left s u k₁ k₂] + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, _, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +theorem step_some {c c' : Cfg (Fin 2) (Fin 6)} (h : step target_tm c = some c') : + c [target_tm]⊢⁺ c' := ⟨1, Nat.zero_lt_one, h⟩ + +theorem stepPlus_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := step_stepStar_stepPlus h1 (stepPlus_stepStar h2) + +theorem stepStar_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢* c₃ := stepStar_trans (step_stepStar target_tm c₁ c₂ h1) h2 + +theorem stepPlus_stepStar_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢⁺ c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepPlus_stepStar_stepPlus h1 h2 + +theorem stepStar_stepPlus_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢* c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepStar_stepPlus_stepPlus h1 h2 + +theorem stepPlus_of_step {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢ c₂) : + c₁ [target_tm]⊢⁺ c₂ := step_stepPlus target_tm c₁ c₂ h + +theorem stepStar_of_stepPlus {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢⁺ c₂) : + c₁ [target_tm]⊢* c₂ := stepPlus_stepStar h + +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail]) +macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step))) +macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +theorem multiStep_step_isSome {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₀ cfg cfg' : Cfg Γ Λ) (n m : Nat) + (hn : multiStep M c₀ n = some cfg) + (hnm : multiStep M c₀ (n + (1 + m)) = some cfg') : + (step M cfg).isSome := by + rw [multiStep_add M c₀ n (1 + m), hn] at hnm + dsimp [Option.bind] at hnm + rw [multiStep_add M cfg 1 m, multiStep_one] at hnm + cases hs : step M cfg with + | none => + rw [hs] at hnm + nomatch hnm + | some c₁ => rfl + +theorem inv_reaches_beyond {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') + (N : Nat) : + ∃ (m : Nat) (cfg' : Cfg Γ Λ), multiStep M (init []) (N + m) = some cfg' ∧ Inv cfg' := by + induction N with + | zero => + obtain ⟨cfg₀, ⟨n₀, hn₀⟩, h_inv₀⟩ := h_init + refine ⟨n₀, cfg₀, ?_, h_inv₀⟩ + rwa [Nat.zero_add] + | succ N ih => + obtain ⟨m, cfg₁, hm, h_inv₁⟩ := ih + cases m with + | zero => + obtain ⟨cfg₂, ⟨k, hk_pos, hk⟩, h_inv₂⟩ := h_step cfg₁ h_inv₁ + cases k with + | zero => omega + | succ k' => + refine ⟨k', cfg₂, ?_, h_inv₂⟩ + have h_trans := multiStep_trans M (init []) cfg₁ cfg₂ N (k' + 1) hm hk + have h_eq : (N + 1) + k' = N + (k' + 1) := by omega + rwa [h_eq] + | succ m' => + refine ⟨m', cfg₁, ?_, h_inv₁⟩ + have h_eq : (N + 1) + m' = N + (m' + 1) := by omega + rwa [h_eq] + +theorem closed_inv_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') : + IsDoesNotHalt M := by + intro cfg ⟨n, hn⟩ + obtain ⟨m, cfg', hnm, _⟩ := inv_reaches_beyond M Inv h_init h_step (n + 1) + have h_eq : (n + 1) + m = n + (1 + m) := by omega + rw [h_eq] at hnm + exact multiStep_step_isSome M (init []) cfg cfg' n m hn hnm + +theorem closed_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) + (n₀ : Nat) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, ∃ n', (hub n) [M]⊢⁺ (hub n')) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hcfg⟩ + subst hcfg + obtain ⟨n', hn'⟩ := h_step n + exact ⟨hub n', hn', ⟨n', rfl⟩⟩ + +theorem closed_guarded_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) (P : Nat → Prop) + (n₀ : Nat) (h_P₀ : P n₀) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, P n → ∃ n', P n' ∧ ((hub n) [M]⊢⁺ (hub n'))) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, P n ∧ cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, h_P₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hPn, hcfg⟩ + subst hcfg + obtain ⟨n', hPn', hn'⟩ := h_step n hPn + exact ⟨hub n', hn', ⟨n', hPn', rfl⟩⟩ + +def holdout_0673_tm : Machine (Fin 2) (Fin 6) +| 0, 0 => some (some 1, Stmt.write 1 Dir.right) +| 0, 1 => none +| 1, 0 => some (some 2, Stmt.write 1 Dir.right) +| 1, 1 => some (some 5, Stmt.write 0 Dir.right) +| 2, 0 => some (some 3, Stmt.write 1 Dir.right) +| 2, 1 => some (some 0, Stmt.write 0 Dir.right) +| 3, 0 => some (some 4, Stmt.write 1 Dir.left) +| 3, 1 => some (some 1, Stmt.write 1 Dir.right) +| 4, 0 => some (some 1, Stmt.write 1 Dir.left) +| 4, 1 => some (some 4, Stmt.write 0 Dir.left) +| 5, 0 => some (some 1, Stmt.write 0 Dir.right) +| 5, 1 => some (some 2, Stmt.write 0 Dir.left) + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +abbrev sA : Fin 6 := 0 +abbrev sB : Fin 6 := 1 +abbrev sC : Fin 6 := 2 +abbrev sD : Fin 6 := 3 +abbrev sE : Fin 6 := 4 +abbrev sF : Fin 6 := 5 +abbrev holdout_0220_tm : Machine (Fin 2) (Fin 6) := target_tm +abbrev M : Machine (Fin 2) (Fin 6) := holdout_0673_tm +@[simp] theorem init_nil : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + + + +-- ============================================================================ +-- ============================================================================ +-- Sweeps Transducer & Valid Tape Closure for Holdout 0673 +-- ============================================================================ + +theorem rule_B_000 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 0, 0] +> r)) [holdout_0673_tm]⊢⁺ (l <{{E}} ([0, 0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_001 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 0, 1] +> r)) [holdout_0673_tm]⊢⁺ ((l <+ [1, 1, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_010 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 1, 0] +> r)) [holdout_0673_tm]⊢⁺ ((l <+ [1, 0, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_10 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([1, 0] +> r)) [holdout_0673_tm]⊢⁺ ((l <+ [0, 0]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_111 (l r : ListBlank (Fin 2)) : + ((l <+ [1, 1, 1]) <{{E}} r) [holdout_0673_tm]⊢⁺ (l <{{E}} ([0, 0, 0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_101 (l r : ListBlank (Fin 2)) : + ((l <+ [1, 0, 1]) <{{E}} r) [holdout_0673_tm]⊢⁺ (l <{{E}} ([0, 1, 0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_00 (l r : ListBlank (Fin 2)) : + ((l <+ [0, 0]) <{{E}} ((0 : Fin 2) >> r)) [holdout_0673_tm]⊢⁺ (l {{B}}> ([0, 1, 0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_nil (r : ListBlank (Fin 2)) : + (default <{{E}} ((0 : Fin 2) >> r)) [holdout_0673_tm]⊢⁺ ((default <+ [1, 0, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +abbrev Round (r r' : ListBlank (Fin 2)) : Prop := + ∀ l : ListBlank (Fin 2), (l {{B}}> r) [holdout_0673_tm]⊢⁺ (l <{{E}} r') + +inductive Sweeps : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) → Prop + | zero (r : ListBlank (Fin 2)) : Sweeps 0 r r + | succ {n : Nat} {r r₁ r₂ : ListBlank (Fin 2)} : + Round r r₁ → Sweeps n r₁ r₂ → Sweeps (n + 1) r r₂ + +theorem Sweeps.trans {a b : Nat} {r₁ r₂ r₃ : ListBlank (Fin 2)} + (h₁ : Sweeps a r₁ r₂) (h₂ : Sweeps b r₂ r₃) : Sweeps (a + b) r₁ r₃ := by + induction h₁ with + | zero _ => simpa using h₂ + | succ hr _ ih => + rw [Nat.succ_add] + exact Sweeps.succ hr (ih h₂) + +theorem sweeps_split_last {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps (n + 1) r r') : + ∃ r₁ : ListBlank (Fin 2), Sweeps n r r₁ ∧ Round r₁ r' := by + induction n generalizing r with + | zero => + cases h with + | succ hr h0 => + cases h0 with + | zero _ => exact ⟨r, Sweeps.zero r, hr⟩ + | succ m ih => + cases h with + | succ hr hs => + obtain ⟨r₁, hs₁, hr₁⟩ := ih hs + exact ⟨r₁, Sweeps.succ hr hs₁, hr₁⟩ + +theorem round_000 (r : ListBlank (Fin 2)) : + Round ([0, 0, 0] +> r) ([0, 0, 1] +> r) := + fun l => rule_B_000 l r + +theorem round_001 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 0, 1] +> r) ([0, 0, 0] +> r') := + fun l => stepPlus_trans (rule_B_001 l r) (stepPlus_trans (h (l <+ [1, 1, 1])) (rule_E_111 l r')) + +theorem round_010 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 1, 0] +> r) ([0, 1, 0] +> r') := + fun l => stepPlus_trans (rule_B_010 l r) (stepPlus_trans (h (l <+ [1, 0, 1])) (rule_E_101 l r')) + +theorem round_10 {r₁ r r₂ : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Round r r₂) : + Round ([1, 0] +> r₁) ([0, 1, 0] +> r₂) := + fun l => stepPlus_trans (rule_B_10 l r₁) + (stepPlus_trans (h₁ (l <+ [0, 0])) + (stepPlus_trans (rule_E_00 l r) (round_010 h₂ l))) + +theorem sweeps_010 {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps n r r') : + Sweeps n ([0, 1, 0] +> r) ([0, 1, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | succ hr _ ih => exact Sweeps.succ (round_010 hr) ih + +theorem sweeps_10 {n : Nat} {r₁ r r' : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Sweeps (n + 1) r r') : + Sweeps (n + 1) ([1, 0] +> r₁) ([0, 1, 0] +> r') := by + cases h₂ with + | succ hr₂ hs => + exact Sweeps.succ (round_10 h₁ hr₂) (sweeps_010 hs) + +theorem sweeps_000_even {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k) ([0, 0, 0] +> r) ([0, 0, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | @succ m r₀ r₁ r₂ hr _ ih => + have h2 : Sweeps 2 ([0, 0, 0] +> r₀) ([0, 0, 0] +> r₁) := + Sweeps.succ (round_000 r₀) (Sweeps.succ (round_001 hr) (Sweeps.zero _)) + have htr := Sweeps.trans h2 ih + rw [show 2 + 2 * m = 2 * (m + 1) by omega] at htr + exact htr + +theorem sweeps_000_odd {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k + 1) ([0, 0, 0] +> r) ([0, 0, 1] +> r') := by + have he := sweeps_000_even h + have h1 : Sweeps 1 ([0, 0, 0] +> r') ([0, 0, 1] +> r') := + Sweeps.succ (round_000 r') (Sweeps.zero _) + exact Sweeps.trans he h1 + +theorem default_eq_b000 : + (default : ListBlank (Fin 2)) = [0, 0, 0] +> default := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b000_cons_zero (r : ListBlank (Fin 2)) : + [0, 0, 0] +> ((0 : Fin 2) >> r) = (0 : Fin 2) >> ([0, 0, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +theorem b001_cons_zero (r : ListBlank (Fin 2)) : + [0, 0, 1] +> ((0 : Fin 2) >> r) = (0 : Fin 2) >> ([0, 1, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +theorem b001_default_eq : + ([0, 0, 1] +> default : ListBlank (Fin 2)) = (0 : Fin 2) >> ([0, 1, 0] +> default) := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b010_eq_zero_cons_b10 (r : ListBlank (Fin 2)) : + [0, 1, 0] +> r = (0 : Fin 2) >> ([1, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +inductive Valid : Nat → ListBlank (Fin 2) → Prop + | nil {n : Nat} (hn : n ≥ 1) : + Valid n default + | t0 {n : Nat} {r : ListBlank (Fin 2)} (hn : n ≥ 2) (hr : Valid (n / 2) r) : + Valid n ([0, 0, 0] +> r) + | t1 {n : Nat} {r : ListBlank (Fin 2)} (hn : n ≥ 1) (hr : Valid (n + 1) r) : + Valid n ([0, 1, 0] +> r) + | t2 {n : Nat} {r₁ r : ListBlank (Fin 2)} (hn : n ≥ 1) + (hround : Round r₁ ((0 : Fin 2) >> r)) (hr : Valid (n + 1) r) : + Valid n ([1, 0] +> r₁) + +theorem Valid.mono {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) {n' : Nat} (hle : n ≤ n') : + Valid n' r := by + induction h generalizing n' with + | nil hn => exact Valid.nil (by omega) + | t0 hn _ ih => exact Valid.t0 (by omega) (ih (by omega)) + | t1 hn _ ih => exact Valid.t1 (by omega) (ih (by omega)) + | t2 hn hround _ ih => exact Valid.t2 (by omega) hround (ih (by omega)) + +theorem valid_sweeps_nil : ∀ n : Nat, n ≥ 1 → + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ Sweeps n default ((0 : Fin 2) >> r') := by + intro n + induction n using Nat.strongRecOn with + | ind n ih => + intro hn + rcases ( by omega : n = 1 ∨ (n ≥ 2 ∧ n % 2 = 0) ∨ (n ≥ 2 ∧ n % 2 = 1) ) with rfl | ⟨hn2, hev⟩ | ⟨hn2, hod⟩ + · refine ⟨[0, 1, 0] +> default, Valid.t1 (by omega) (Valid.nil (by omega)), ?_⟩ + have h1 : Sweeps 1 ([0, 0, 0] +> default) ([0, 0, 1] +> default) := + Sweeps.succ (round_000 default) (Sweeps.zero _) + rw [b001_default_eq, ← default_eq_b000] at h1 + exact h1 + · obtain ⟨r', hr', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨[0, 0, 0] +> r', Valid.t0 hn2 hr', ?_⟩ + have he := sweeps_000_even hs' + rw [← default_eq_b000, b000_cons_zero, show 2 * (n / 2) = n by omega] at he + exact he + · obtain ⟨r', hr', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨[0, 1, 0] +> r', Valid.t1 (by omega) (hr'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [← default_eq_b000, b001_cons_zero, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + +theorem valid_sweeps {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) : + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ Sweeps n r ((0 : Fin 2) >> r') := by + induction h with + | @nil n hn => exact valid_sweeps_nil n hn + | @t0 n r hn hr ih => + obtain ⟨r', hr', hs'⟩ := ih + rcases ( by omega : n % 2 = 0 ∨ n % 2 = 1 ) with hev | hod + · refine ⟨[0, 0, 0] +> r', Valid.t0 hn hr', ?_⟩ + have he := sweeps_000_even hs' + rw [b000_cons_zero, show 2 * (n / 2) = n by omega] at he + exact he + · refine ⟨[0, 1, 0] +> r', Valid.t1 (by omega) (hr'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [b001_cons_zero, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + | @t1 n r hn hr ih => + obtain ⟨r', hr', hs'⟩ := ih + obtain ⟨r₁, hs₁, hr₁⟩ := sweeps_split_last hs' + refine ⟨[1, 0] +> r₁, Valid.t2 hn hr₁ hr', ?_⟩ + rw [← b010_eq_zero_cons_b10] + exact sweeps_010 hs₁ + | @t2 n r₁ r hn hround hr ih => + obtain ⟨r', hr', hs'⟩ := ih + obtain ⟨r₂, hs₂, hr₂⟩ := sweeps_split_last hs' + refine ⟨[1, 0] +> r₂, Valid.t2 hn hr₂ hr', ?_⟩ + rw [← b010_eq_zero_cons_b10] + rw [show n = (n - 1) + 1 by omega] at hs₂ ⊢ + exact sweeps_10 hround hs₂ + +theorem era_step {r : ListBlank (Fin 2)} (h : Valid 1 r) : + ∃ r' : ListBlank (Fin 2), Valid 1 r' ∧ + ((default <{{E}} ((0 : Fin 2) >> r)) [holdout_0673_tm]⊢⁺ (default <{{E}} ((0 : Fin 2) >> r'))) := by + obtain ⟨r', hr', hs'⟩ := valid_sweeps (h.mono (by omega : 1 ≤ 2)) + obtain ⟨r₁, hs₁, hr₂⟩ := sweeps_split_last hs' + obtain ⟨r₀, hs₀, hr₁⟩ := sweeps_split_last hs₁ + cases hs₀ with + | zero _ => + refine ⟨[1, 0] +> r₁, Valid.t2 (by omega) hr₂ hr', ?_⟩ + have s1 := rule_E_nil r + have s2 := hr₁ (default <+ [1, 0, 1]) + have s3 := rule_E_101 default r₁ + rw [← b010_eq_zero_cons_b10] + exact stepPlus_trans s1 (stepPlus_trans s2 s3) + +def permState : Fin 6 → Fin 6 + | 0 => 3 + | 1 => 1 + | 2 => 2 + | 3 => 4 + | 4 => 0 + | 5 => 5 + +def mirrorTape (T : Tape (Fin 2)) : Tape (Fin 2) := + ⟨T.1, T.right, T.left⟩ + +def mirrorCfg (c : Cfg (Fin 2) (Fin 6)) : Cfg (Fin 2) (Fin 6) := + ⟨c.q.map permState, mirrorTape c.tape⟩ + +theorem step_mirror (c : Cfg (Fin 2) (Fin 6)) : + step target_tm (mirrorCfg c) = (step holdout_0673_tm c).map mirrorCfg := by + rcases c with ⟨none | ⟨_ | _ | _ | _ | _ | _ | q, hq⟩, ⟨⟨_ | _ | s, hs⟩, l, r⟩⟩ <;> + first | rfl | omega + +theorem multiStep_mirror (c : Cfg (Fin 2) (Fin 6)) (n : Nat) : + multiStep target_tm (mirrorCfg c) n = (multiStep holdout_0673_tm c n).map mirrorCfg := by + induction n with + | zero => rfl + | succ n ih => + rw [multiStep_succ, multiStep_succ, ih] + cases multiStep holdout_0673_tm c n with + | none => rfl + | some c' => exact step_mirror c' + +theorem stepPlus_mirror {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [holdout_0673_tm]⊢⁺ c₂) : + (mirrorCfg c₁) [target_tm]⊢⁺ (mirrorCfg c₂) := by + obtain ⟨n, hn, hstep⟩ := h + refine ⟨n, hn, ?_⟩ + rw [multiStep_mirror, hstep] + rfl + +def era0_r1 : ListBlank (Fin 2) := + [0, 0, 1] +> default + +def era0_r : ListBlank (Fin 2) := + [1, 0] +> era0_r1 + +theorem init_reaches_era0 : + (init []) [target_tm]⊢* mirrorCfg (default <{{E}} ((0 : Fin 2) >> era0_r)) := by + apply stepPlus_stepStar + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + (try unfold mirrorCfg); (try unfold mirrorTape); (try unfold permState); (try unfold E) + dsimp [era0_r, era0_r1, ListBlank.append] + execute + +theorem valid_era0 : Valid 1 era0_r := by + have hround : Round era0_r1 ((0 : Fin 2) >> ([0, 0, 0] +> ([0, 1, 0] +> default))) := by + have h0 := round_001 (round_000 default) + have heq1 : ([0, 0, 1] +> ([0, 0, 0] +> default) : ListBlank (Fin 2)) = era0_r1 := by + rw [← default_eq_b000]; rfl + have heq2 : ([0, 0, 0] +> ([0, 0, 1] +> default) : ListBlank (Fin 2)) = + (0 : Fin 2) >> ([0, 0, 0] +> ([0, 1, 0] +> default)) := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + rw [heq1, heq2] at h0 + exact h0 + exact Valid.t2 (by omega) hround + (Valid.t0 (by omega) (Valid.t1 (by omega) (Valid.nil (by omega)))) + +theorem holdout_0220_nonhalt : IsDoesNotHalt holdout_0220_tm := by + refine closed_inv_does_not_halt target_tm + (fun cfg => ∃ r : ListBlank (Fin 2), Valid 1 r ∧ cfg = mirrorCfg (default <{{E}} ((0 : Fin 2) >> r))) + ⟨mirrorCfg (default <{{E}} ((0 : Fin 2) >> era0_r)), init_reaches_era0, ⟨era0_r, valid_era0, rfl⟩⟩ ?_ + intro cfg ⟨r, hr, hcfg⟩ + subst hcfg + obtain ⟨r', hr', hstep⟩ := era_step hr + exact ⟨mirrorCfg (default <{{E}} ((0 : Fin 2) >> r')), stepPlus_mirror hstep, ⟨r', hr', rfl⟩⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := + holdout_0220_nonhalt + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LB0RC diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC.lean new file mode 100644 index 00000000..a11ce25a --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC.lean @@ -0,0 +1,553 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge + +open Mathlib Relation Nat Turing BusyBeaver SixState + +@[expose] public section + +namespace BusyBeaver.M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end BusyBeaver.M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC + +end + +namespace BusyBeaver.M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = + some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = + step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem pow_zero_list (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ + ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x + :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +omit [Inhabited Γ] in +@[simp] +theorem list_pow_append_one (u : List (Fin 2)) (k : Nat) : + u^k ++ u = u^(k + 1) := by + have h := list_pow_add_comm u k 1 + dsimp [HPow.hPow] at h ⊢ + rw [List.append_nil] at h + exact h + +theorem pow_add_append_right (u : List (Fin 2)) (m n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (m + n)) +> r = (u ^ m) +> ((u ^ n) +> r) := by + rw [list_pow_add, ← listblank_append_append] + +theorem pow_succ_append_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (n + 1)) +> r = u +> ((u ^ n) +> r) := by + rw [pow_succ_list, ← listblank_append_append] + +theorem pow_succ_append_right' (u : List (Fin 2)) (k : Nat) (r : ListBlank (Fin 2)) : + (u ^ k) +> (u +> r) = (u ^ (k + 1)) +> r := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (m n : Nat) : + s <+ (u ^ (m + n)) = (s <+ (u ^ m)) <+ (u ^ n) := by + rw [listblank_append_append, ← list_pow_add, add_comm] + +theorem pow_succ_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k : Nat) : + (s <+ u) <+ (u ^ k) = s <+ (u ^ (k + 1)) := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add3_append_right (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) (r : ListBlank (Fin 2)) : + (u ^ (k₁ + k₂ + k₃)) +> r = (u ^ k₁) +> ((u ^ k₂) +> ((u ^ k₃) +> r)) := by + rw [pow_add_append_right u (k₁ + k₂) k₃ r, pow_add_append_right u k₁ k₂ ((u ^ k₃) +> r)] + +theorem pow_add3_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) : + s <+ (u ^ (k₁ + k₂ + k₃)) = ((s <+ (u ^ k₁)) <+ (u ^ k₂)) <+ (u ^ k₃) := by + rw [pow_add_append_left s u (k₁ + k₂) k₃, pow_add_append_left s u k₁ k₂] + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, _, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +theorem step_some {c c' : Cfg (Fin 2) (Fin 6)} (h : step target_tm c = some c') : + c [target_tm]⊢⁺ c' := ⟨1, Nat.zero_lt_one, h⟩ + +theorem stepPlus_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := step_stepStar_stepPlus h1 (stepPlus_stepStar h2) + +theorem stepStar_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢* c₃ := stepStar_trans (step_stepStar target_tm c₁ c₂ h1) h2 + +theorem stepPlus_stepStar_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢⁺ c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepPlus_stepStar_stepPlus h1 h2 + +theorem stepStar_stepPlus_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢* c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepStar_stepPlus_stepPlus h1 h2 + +theorem stepPlus_of_step {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢ c₂) : + c₁ [target_tm]⊢⁺ c₂ := step_stepPlus target_tm c₁ c₂ h + +theorem stepStar_of_stepPlus {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢⁺ c₂) : + c₁ [target_tm]⊢* c₂ := stepPlus_stepStar h + +local macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +local macro "gstep" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, + BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, + default_head, default_tail]) +local macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | gstep)) <;> (any_goals (first | finish | gstep)) <;> + (any_goals (first | finish | gstep)) <;> (any_goals (first | finish | gstep)) <;> + (any_goals (first | finish | gstep))) +local macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +theorem multiStep_step_isSome {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₀ cfg cfg' : Cfg Γ Λ) (n m : Nat) + (hn : multiStep M c₀ n = some cfg) + (hnm : multiStep M c₀ (n + (1 + m)) = some cfg') : + (step M cfg).isSome := by + rw [multiStep_add M c₀ n (1 + m), hn] at hnm + dsimp [Option.bind] at hnm + rw [multiStep_add M cfg 1 m, multiStep_one] at hnm + cases hs : step M cfg with + | none => + rw [hs] at hnm + nomatch hnm + | some c₁ => rfl + +theorem inv_reaches_beyond {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) {c_init : Cfg Γ Λ} (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, (c_init [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') + (N : Nat) : + ∃ (m : Nat) (cfg' : Cfg Γ Λ), multiStep M c_init (N + m) = some cfg' ∧ Inv cfg' := by + induction N with + | zero => + obtain ⟨cfg₀, ⟨n₀, hn₀⟩, h_inv₀⟩ := h_init + refine ⟨n₀, cfg₀, ?_, h_inv₀⟩ + rwa [Nat.zero_add] + | succ N ih => + obtain ⟨m, cfg₁, hm, h_inv₁⟩ := ih + cases m with + | zero => + obtain ⟨cfg₂, ⟨k, hk_pos, hk⟩, h_inv₂⟩ := h_step cfg₁ h_inv₁ + cases k with + | zero => omega + | succ k' => + refine ⟨k', cfg₂, ?_, h_inv₂⟩ + have h_trans := multiStep_trans M c_init cfg₁ cfg₂ N (k' + 1) hm hk + have h_eq : (N + 1) + k' = N + (k' + 1) := by omega + rwa [h_eq] + | succ m' => + refine ⟨m', cfg₁, ?_, h_inv₁⟩ + have h_eq : (N + 1) + m' = N + (m' + 1) := by omega + rwa [h_eq] + +theorem closed_inv_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) {c_init : Cfg Γ Λ} (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, (c_init [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') : + ∀ cfg : Cfg Γ Λ, (c_init [M]⊢* cfg) → (step M cfg).isSome := by + intro cfg ⟨n, hn⟩ + obtain ⟨m, cfg', hnm, _⟩ := inv_reaches_beyond M Inv h_init h_step (n + 1) + have h_eq : (n + 1) + m = n + (1 + m) := by omega + rw [h_eq] at hnm + exact multiStep_step_isSome M c_init cfg cfg' n m hn hnm + +theorem closed_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) + (n₀ : Nat) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, ∃ n', (hub n) [M]⊢⁺ (hub n')) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hcfg⟩ + subst hcfg + obtain ⟨n', hn'⟩ := h_step n + exact ⟨hub n', hn', ⟨n', rfl⟩⟩ + +theorem closed_guarded_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) (P : Nat → Prop) + (n₀ : Nat) (h_P₀ : P n₀) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, P n → ∃ n', P n' ∧ ((hub n) [M]⊢⁺ (hub n'))) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => + ∃ n, P n ∧ cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, h_P₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hPn, hcfg⟩ + subst hcfg + obtain ⟨n', hPn', hn'⟩ := h_step n hPn + exact ⟨hub n', hn', ⟨n', hPn', rfl⟩⟩ + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +abbrev sA : Fin 6 := 0 +abbrev sB : Fin 6 := 1 +abbrev sC : Fin 6 := 2 +abbrev sD : Fin 6 := 3 +abbrev sE : Fin 6 := 4 +abbrev sF : Fin 6 := 5 +abbrev holdout_0756_tm : Machine (Fin 2) (Fin 6) := target_tm +abbrev M : Machine (Fin 2) (Fin 6) := target_tm +@[simp] theorem init_nil : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = + (default {{A}}> default) := rfl + +-- ============================================================================ +-- ============================================================================ +-- Sweeps Transducer & Valid Token-List Closure for Holdout 0766 +-- (Exact Left-Right Mirror of Holdout 0756 with B = 1, A = 0) +-- ============================================================================ + +theorem rule_B_000 (r l : ListBlank (Fin 2)) : + (([0, 0, 0] +> l) <{{B}} r) [target_tm]⊢⁺ (([0, 0, 1] +> l) {{A}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_001 (r l : ListBlank (Fin 2)) : + (([0, 0, 1] +> l) <{{B}} r) [target_tm]⊢⁺ (l <{{B}} (r <+ [1, 1, 1])) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_010 (r l : ListBlank (Fin 2)) : + (([0, 1, 0] +> l) <{{B}} r) [target_tm]⊢⁺ (l <{{B}} (r <+ [1, 0, 1])) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_100 (r l : ListBlank (Fin 2)) : + (([1, 0, 0] +> l) <{{B}} r) [target_tm]⊢⁺ (l <{{B}} (r <+ [1, 0, 0])) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_111 (r l : ListBlank (Fin 2)) : + (l {{A}}> (r <+ [1, 1, 1])) [target_tm]⊢⁺ (([0, 0, 0] +> l) {{A}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_101 (r l : ListBlank (Fin 2)) : + (l {{A}}> (r <+ [1, 0, 1])) [target_tm]⊢⁺ (([0, 1, 0] +> l) {{A}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_100 (r l : ListBlank (Fin 2)) : + (l {{A}}> (r <+ [1, 0, 0])) [target_tm]⊢⁺ (([0, 1, 0] +> l) <{{B}} r) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_nil (l : ListBlank (Fin 2)) : + (((0 : Fin 2) >> l) {{A}}> default) [target_tm]⊢⁺ (l <{{B}} (default <+ [1, 0, 1])) := by + dsimp [ListBlank.append]; execute + +abbrev Round (l l' : ListBlank (Fin 2)) : Prop := + ∀ r : ListBlank (Fin 2), (l <{{B}} r) [target_tm]⊢⁺ (l' {{A}}> r) + +inductive Sweeps : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) → Prop + | zero (r : ListBlank (Fin 2)) : Sweeps 0 r r + | succ {n : Nat} {r r₁ r₂ : ListBlank (Fin 2)} : + Round r r₁ → Sweeps n r₁ r₂ → Sweeps (n + 1) r r₂ + +theorem Sweeps.trans {a b : Nat} {r₁ r₂ r₃ : ListBlank (Fin 2)} + (h₁ : Sweeps a r₁ r₂) (h₂ : Sweeps b r₂ r₃) : Sweeps (a + b) r₁ r₃ := by + induction h₁ with + | zero _ => simpa using h₂ + | succ hr _ ih => + rw [Nat.succ_add] + exact Sweeps.succ hr (ih h₂) + +theorem round_000 (r : ListBlank (Fin 2)) : + Round ([0, 0, 0] +> r) ([0, 0, 1] +> r) := + fun l => rule_B_000 l r + +theorem round_001 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 0, 1] +> r) ([0, 0, 0] +> r') := + fun l => stepPlus_trans (rule_B_001 l r) (stepPlus_trans (h (l <+ [1, 1, 1])) (rule_E_111 l r')) + +theorem round_010 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 1, 0] +> r) ([0, 1, 0] +> r') := + fun l => stepPlus_trans (rule_B_010 l r) (stepPlus_trans (h (l <+ [1, 0, 1])) (rule_E_101 l r')) + +theorem round_100 {r r₁ r₂ : ListBlank (Fin 2)} (h₁ : Round r r₁) (h₂ : Round r₁ r₂) : + Round ([1, 0, 0] +> r) ([0, 1, 0] +> r₂) := + fun l => stepPlus_trans (rule_B_100 l r) + (stepPlus_trans (h₁ (l <+ [1, 0, 0])) + (stepPlus_trans (rule_E_100 l r₁) (round_010 h₂ l))) + +theorem sweeps_010 {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps n r r') : + Sweeps n ([0, 1, 0] +> r) ([0, 1, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | succ hr _ ih => exact Sweeps.succ (round_010 hr) ih + +theorem sweeps_100 {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps (n + 2) r r') : + Sweeps (n + 1) ([1, 0, 0] +> r) ([0, 1, 0] +> r') := by + cases h with + | succ hr₁ hrest => + cases hrest with + | succ hr₂ hs => + exact Sweeps.succ (round_100 hr₁ hr₂) (sweeps_010 hs) + +theorem sweeps_000_even {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k) ([0, 0, 0] +> r) ([0, 0, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | @succ m r₀ r₁ r₂ hr _ ih => + have h2 : Sweeps 2 ([0, 0, 0] +> r₀) ([0, 0, 0] +> r₁) := + Sweeps.succ (round_000 r₀) (Sweeps.succ (round_001 hr) (Sweeps.zero _)) + have htr := Sweeps.trans h2 ih + rw [show 2 + 2 * m = 2 * (m + 1) by omega] at htr + exact htr + +theorem sweeps_000_odd {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k + 1) ([0, 0, 0] +> r) ([0, 0, 1] +> r') := by + have he := sweeps_000_even h + have h1 : Sweeps 1 ([0, 0, 0] +> r') ([0, 0, 1] +> r') := + Sweeps.succ (round_000 r') (Sweeps.zero _) + exact Sweeps.trans he h1 + +inductive Tok + | t0 + | t1 + | t2 + +def enc : List Tok → ListBlank (Fin 2) + | [] => default + | .t0 :: t => [0, 0, 0] +> enc t + | .t1 :: t => [0, 0, 1] +> enc t + | .t2 :: t => [0, 1, 0] +> enc t + +def rest_of : List Tok → ListBlank (Fin 2) + | [] => default + | .t0 :: t => [0, 0, 0] +> rest_of t + | .t1 :: t => [0, 1, 0] +> rest_of t + | .t2 :: t => [1, 0, 0] +> rest_of t + +theorem enc_eq_zero_cons_rest (t : List Tok) : + enc t = (0 : Fin 2) >> rest_of t := by + induction t with + | nil => exact zero_cons_default.symm + | cons x t ih => + cases x <;> + · simp only [enc, rest_of, listblank_append_cons, listblank_append_nil] + rw [ih] + +theorem rest_of_nil_eq : + rest_of [] = [0, 0, 0] +> rest_of [] := by + simp only [rest_of, listblank_append_cons, listblank_append_nil, zero_cons_default] + +inductive Valid : Nat → List Tok → Prop + | nil {n : Nat} (hn : n ≥ 1) : Valid n [] + | t0 {n : Nat} {t : List Tok} (hn : n ≥ 2) (ht : Valid (n / 2) t) : Valid n (.t0 :: t) + | t1 {n : Nat} {t : List Tok} (hn : n ≥ 1) (ht : Valid n t) : Valid n (.t1 :: t) + | t2 {n : Nat} {t : List Tok} (hn : n ≥ 1) (ht : Valid (n + 1) t) : Valid n (.t2 :: t) + +theorem Valid.mono {n : Nat} {t : List Tok} (h : Valid n t) {n' : Nat} (hle : n ≤ n') : + Valid n' t := by + induction h generalizing n' with + | nil hn => exact Valid.nil (by omega) + | t0 hn _ ih => exact Valid.t0 (by omega) (ih (by omega)) + | t1 hn _ ih => exact Valid.t1 (by omega) (ih (by omega)) + | t2 hn _ ih => exact Valid.t2 (by omega) (ih (by omega)) + +theorem valid_sweeps_nil : ∀ n : Nat, n ≥ 1 → + ∃ t' : List Tok, Valid n t' ∧ Sweeps n (rest_of []) (enc t') := by + intro n + induction n using Nat.strongRecOn with + | ind n ih => + intro hn + rcases ( by omega : n = 1 ∨ (n ≥ 2 ∧ n % 2 = 0) ∨ (n ≥ 2 ∧ n % 2 = 1) ) with rfl | ⟨hn2, + hev⟩ | ⟨hn2, hod⟩ + · refine ⟨[.t1], Valid.t1 (by omega) (Valid.nil (by omega)), ?_⟩ + rw [rest_of_nil_eq] + exact Sweeps.succ (round_000 (enc [])) (Sweeps.zero _) + · obtain ⟨t', ht', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨.t0 :: t', Valid.t0 hn2 ht', ?_⟩ + have he := sweeps_000_even hs' + rw [← rest_of_nil_eq, show 2 * (n / 2) = n by omega] at he + exact he + · obtain ⟨t', ht', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨.t1 :: t', Valid.t1 (by omega) (ht'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [← rest_of_nil_eq, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + +theorem valid_sweeps {n : Nat} {t : List Tok} (h : Valid n t) : + ∃ t' : List Tok, Valid n t' ∧ Sweeps n (rest_of t) (enc t') := by + induction h with + | @nil n hn => exact valid_sweeps_nil n hn + | @t0 n t hn ht ih => + obtain ⟨t', ht', hs'⟩ := ih + rcases ( by omega : n % 2 = 0 ∨ n % 2 = 1 ) with hev | hod + · refine ⟨.t0 :: t', Valid.t0 hn ht', ?_⟩ + have he := sweeps_000_even hs' + rw [show 2 * (n / 2) = n by omega] at he + exact he + · refine ⟨.t1 :: t', Valid.t1 (by omega) (ht'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + | @t1 n t hn ht ih => + obtain ⟨t', ht', hs'⟩ := ih + exact ⟨.t2 :: t', Valid.t2 hn (ht'.mono (by omega)), sweeps_010 hs'⟩ + | @t2 n t hn ht ih => + obtain ⟨t', ht', hs'⟩ := ih + refine ⟨.t2 :: t', Valid.t2 hn ht', ?_⟩ + rw [show n + 1 = (n - 1) + 2 by omega] at hs' + have h100 := sweeps_100 hs' + rw [show (n - 1) + 1 = n by omega] at h100 + exact h100 + +theorem sweeps_one_round {r r' : ListBlank (Fin 2)} (h : Sweeps 1 r r') : + Round r r' := by + cases h with + | succ hr h0 => + cases h0 with + | zero _ => exact hr + + +theorem era_step {t : List Tok} (h : Valid 1 t) : + ∃ t' : List Tok, Valid 1 t' ∧ + (((enc t) {{A}}> default) [target_tm]⊢⁺ ((enc t') {{A}}> default)) := by + obtain ⟨t₁, ht₁, hs₁⟩ := valid_sweeps h + refine ⟨.t2 :: t₁, Valid.t2 (by omega) (ht₁.mono (by omega)), ?_⟩ + rw [enc_eq_zero_cons_rest t] + have s1 := rule_E_nil (rest_of t) + have s2 := sweeps_one_round hs₁ (default <+ [1, 0, 1]) + have s3 := rule_E_101 default (enc t₁) + exact stepPlus_trans s1 (stepPlus_trans s2 s3) + +theorem init_reaches_era0 : + (init []) [target_tm]⊢* ((enc []) {{A}}> default) := + ⟨0, rfl⟩ + +theorem valid_era0 : Valid 1 [] := + Valid.nil (by omega) + + + +theorem init_B_reaches_era0 : + ((default : ListBlank (Fin 2)) {{B}}> default) [target_tm]⊢* ((enc [.t1]) {{A}}> default) := by + apply stepPlus_stepStar + dsimp [enc, ListBlank.append] + execute + +theorem valid_era0_0446 : Valid 1 [.t1] := + Valid.t1 (by omega) (Valid.nil (by omega)) + +theorem init_D_reaches_era0 : + ((default : ListBlank (Fin 2)) {{D}}> default) [target_tm]⊢* + ((enc [.t2, .t0, .t1]) {{A}}> default) := by + apply stepPlus_stepStar + dsimp [enc, ListBlank.append] + execute + +theorem valid_era0_0756 : Valid 1 [.t2, .t0, .t1] := + Valid.t2 (by omega) (Valid.t0 (by omega) (Valid.t1 (by omega) (Valid.nil (by omega)))) + +public section + +theorem is_not_halt_from_0446 : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{1}}> default) [target]⊢* cfg) → (step target cfg).isSome := + by + refine closed_inv_does_not_halt target_tm + (fun cfg => ∃ t : List Tok, Valid 1 t ∧ cfg = ((enc t) {{A}}> default)) + ⟨(enc [.t1]) {{A}}> default, init_B_reaches_era0, ⟨[.t1], valid_era0_0446, rfl⟩⟩ ?_ + intro cfg ⟨t, ht, hcfg⟩ + subst hcfg + obtain ⟨t', ht', hstep⟩ := era_step ht + exact ⟨(enc t') {{A}}> default, hstep, ⟨t', ht', rfl⟩⟩ + +theorem is_not_halt_from_0756 : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{3}}> default) [target]⊢* cfg) → (step target cfg).isSome := + by + refine closed_inv_does_not_halt target_tm + (fun cfg => ∃ t : List Tok, Valid 1 t ∧ cfg = ((enc t) {{A}}> default)) + ⟨(enc [.t2, .t0, .t1]) {{A}}> default, init_D_reaches_era0, + ⟨[.t2, .t0, .t1], valid_era0_0756, rfl⟩⟩ ?_ + intro cfg ⟨t, ht, hcfg⟩ + subst hcfg + obtain ⟨t', ht', hstep⟩ := era_step ht + exact ⟨(enc t') {{A}}> default, hstep, ⟨t', ht', rfl⟩⟩ + +theorem is_not_halt : IsNotHalt target := by + refine closed_inv_does_not_halt target_tm + (fun cfg => ∃ t : List Tok, Valid 1 t ∧ cfg = ((enc t) {{A}}> default)) + ⟨(enc []) {{A}}> default, init_reaches_era0, ⟨[], valid_era0, rfl⟩⟩ ?_ + intro cfg ⟨t, ht, hcfg⟩ + subst hcfg + obtain ⟨t', ht', hstep⟩ := era_step ht + exact ⟨(enc t') {{A}}> default, hstep, ⟨t', ht', rfl⟩⟩ + +end + +end BusyBeaver.M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_0LCHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_0LCHHH.lean new file mode 100644 index 00000000..fa113755 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_0LCHHH.lean @@ -0,0 +1,321 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusF +public import BusyBeaver.Calculi.WordCalculusG +public import BusyBeaver.Calculi.WordCalculusH + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_0LCHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_0LCHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +@[reducible] def tm : Machine (Fin 2) (Fin 6) := target_tm +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 2000000 + +open WordVKQ Word WordVKQ.Traj114 + +abbrev evalCCfgVKQ (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev z0b (c : CCfg) : Option CCfg := Counter.bstep tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (evalCCfgVKQ c1) [tm]⊢⁺ (evalCCfgVKQ c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ + +abbrev pref24 : BitWord := [1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0] + + +def zCs : Call -> Fin 6 + | .ch => E + | .ca => C + +def zCR (w : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (w <{{zCs c}} ([1] +> r)) + +def zCL (w : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> w) {{A}}> r) + +def zCf (w : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> pref24 +> w) {{A}}> default) + +abbrev callStep (c : Call) (w1 w2 : HalfTape) : Prop := + ∀ r, (zCR w1 c r) [tm]⊢⁺ (zCL w2 r) + +abbrev Side := SideP callStep +abbrev Seg := SegP callStep + +theorem seg_ch_V : Seg [.ch] [.ch, .ch] V_u V_u := + segP_of_step_two (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (fun u r => by + unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + (fun u r => by + unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + (fun u r => by + unfold zCL V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + +theorem seg_ca_V : Seg [.ca] [.ch] V_u Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by + unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + (fun u r => by + unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + +theorem seg_ca_Vp : Seg [.ca] [.ca, .ca] Vp Vp := + segP_of_step_two (mid1 := [0, 1, 1, 1]) (mid2 := [0, 1, 0, 1]) + (fun u r => by + unfold zCR zCs Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + (fun u r => by + unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + (fun u r => by + unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + +theorem seg_ch_K : Seg [.ch] [] K_u Q_u := + segP_of_step_nil (fun u r => by + unfold zCR zCL zCs K_u Q_u + simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + +theorem seg_ch_Q : Seg [.ch] [.ch] Q_u K_u := + segP_of_step_one (mid := [1, 1]) + (fun u r => by + unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + (fun u r => by + unfold zCL K_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + +theorem seg_ca_VpQ : Seg [.ca] [.ca] (Vp ++ Q_u) (Kp ++ Vp) := + segP_of_step_one (mid := [0, 1, 0, 1, 1, 1]) + (fun u r => by + unfold zCR zCs Vp Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + (fun u r => by + unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + +theorem seg_ca_KpVp : Seg [.ca] [] (Kp ++ Vp) (Qp ++ Vp) := + segP_of_step_nil (fun u r => by + unfold zCR zCL zCs Kp Vp Qp + simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + +theorem seg_ca_QpVp : Seg [.ca] [.ca, .ca] (Qp ++ Vp) (Kp ++ Vp) := + segP_of_step_two (mid1 := [0, 1, 1, 1, 1, 1]) (mid2 := [0, 1, 0, 1, 1, 1]) + (fun u r => by + unfold zCR zCs Qp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + (fun u r => by + unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + (fun u r => by + unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + +theorem seg_ca_Kp : Seg [.ca] [] Kp Qp := + segP_of_step_nil (fun u r => by + unfold zCR zCL zCs Kp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + +theorem seg_ca_Qp : Seg [.ca] [.ca] Qp Kp := + segP_of_step_one (mid := [1, 1]) + (fun u r => by + unfold zCR zCs Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + (fun u r => by + unfold zCL Kp; simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + +theorem seg_ca_KQ : Seg [.ca] [] (K_u ++ Q_u) Vp := + segP_of_step_nil (fun u r => by + unfold zCR zCL zCs K_u Q_u Vp + simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + +theorem seg_ca_QQ : Seg [.ca] [.ca] (Q_u ++ Q_u) Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by + unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + (fun u r => by + unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute) + +-- Turnaround zP0..zP6 +abbrev tr1 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1] +abbrev tr2 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1] +abbrev tr3 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1] +abbrev tr4 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1] +abbrev tr5 : BitWord := [0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1] +abbrev tr6 : BitWord := [0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1] + +theorem zP0 (w : HalfTape) : (zCf w) [tm]⊢⁺ (zCR w .ca (tr1 +> default)) := by + unfold zCf zCR zCs pref24 tr1 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP1 (w : HalfTape) : (zCL w (tr1 +> default)) [tm]⊢⁺ (zCR w .ca (tr2 +> default)) := by + unfold zCL zCR zCs tr1 tr2 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP2 (w : HalfTape) : (zCL w (tr2 +> default)) [tm]⊢⁺ (zCR w .ca (tr3 +> default)) := by + unfold zCL zCR zCs tr2 tr3 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP3 (w : HalfTape) : (zCL w (tr3 +> default)) [tm]⊢⁺ (zCR w .ca (tr4 +> default)) := by + unfold zCL zCR zCs tr3 tr4 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP4 (w : HalfTape) : (zCL w (tr4 +> default)) [tm]⊢⁺ (zCR w .ca (tr5 +> default)) := by + unfold zCL zCR zCs tr4 tr5 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP5 (w : HalfTape) : (zCL w (tr5 +> default)) [tm]⊢⁺ (zCR w .ca (tr6 +> default)) := by + unfold zCL zCR zCs tr5 tr6 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP6 (w : HalfTape) : (zCL w (tr6 +> default)) [tm]⊢⁺ (zCf ([1, 1, 0] +> w)) := by + unfold zCL zCf tr6 pref24 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +-- Section 2: Words, Shift Identity, DigitVal, Parse, Scan, Step +theorem segSpec : SegSpec callStep := + ⟨seg_ch_V, seg_ca_V, seg_ca_Vp, seg_ch_K, seg_ch_Q, + seg_ca_VpQ, seg_ca_KpVp, seg_ca_QpVp, seg_ca_Kp, seg_ca_Qp, + seg_ca_KQ, seg_ca_QQ⟩ + +theorem Side_turnaround {w w' : HalfTape} (h : Side ([Call.ca] ^ 6) w w') : + (zCf w) [tm]⊢⁺ (zCf ([1, 1, 0] +> w')) := by + rcases h with _ | ⟨hc1, h⟩ + rcases h with _ | ⟨hc2, h⟩ + rcases h with _ | ⟨hc3, h⟩ + rcases h with _ | ⟨hc4, h⟩ + rcases h with _ | ⟨hc5, h⟩ + rcases h with _ | ⟨hc6, h⟩ + cases h + exact stepPlus_trans_vkq (zP0 w) + (stepPlus_trans_vkq (hc1 (tr1 +> default)) + (stepPlus_trans_vkq (zP1 _) + (stepPlus_trans_vkq (hc2 (tr2 +> default)) + (stepPlus_trans_vkq (zP2 _) + (stepPlus_trans_vkq (hc3 (tr3 +> default)) + (stepPlus_trans_vkq (zP3 _) + (stepPlus_trans_vkq (hc4 (tr4 +> default)) + (stepPlus_trans_vkq (zP4 _) + (stepPlus_trans_vkq (hc5 (tr5 +> default)) + (stepPlus_trans_vkq (zP5 _) + (stepPlus_trans_vkq (hc6 (tr6 +> default)) (zP6 w')))))))))))) + +theorem Step_exec {u u' : List Word} (h : Step u u') : + (zCf (evalWords u default)) [tm]⊢⁺ (zCf (evalWords u' default)) := by + rcases h with ⟨n, b', v, da, H, g, hScan, hDg, rfl⟩ + have hSeg := Seg_of_Scan segSpec hScan + dsimp at hSeg + have hSide0 := sideP_of_segP hSeg (Side_ca_default segSpec hDg) + rw [wordsToBits_append_tape, evalWords_append, evalWords_replicate_K, + wordsToBitsShifted_append_tape, <- evalWordsShifted_append] at hSide0 + have hTurn := Side_turnaround hSide0 + rwa [evalWords_V_shift] at hTurn + +theorem Rounds_exec {u v : List Word} (h : Rounds u v) : + (zCf (evalWords u default)) [tm]⊢* (zCf (evalWords v default)) := by + induction h with + | refl _ => exact ⟨0, rfl⟩ + | next hS _ ih => exact stepStar_of_stepPlus_vkq (stepPlus_stepStar_trans_vkq (Step_exec hS) ih) + +-- Section 3: Universal Parse_V_start, Scan_of_Parse, and Trace Evaluators + +def zInitCCfg : CCfg := ⟨0, 0, [], []⟩ +def zHit5CCfg : CCfg := + ⟨0, 0, [0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, + 0, 0, 1, 0, 1], []⟩ + +set_option maxRecDepth 200000 in +theorem zCm_init_441 : zCm zInitCCfg 441 = some zHit5CCfg := by decide + +theorem init_to_u0 : (init []) [tm]⊢* zCf (evalWords u_0 default) := by + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = evalCCfgVKQ zInitCCfg := rfl + have h1 : evalCCfgVKQ zHit5CCfg = zCf (evalWords u_0 default) := by + dsimp [evalCCfgVKQ, zHit5CCfg, zCf, pref24, u_0, evalWords, V_u, K_u, Q_u] + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + have hPlus := zTc (by decide : 0 < 441) zCm_init_441 + rw [<- h0, h1] at hPlus + exact stepStar_of_stepPlus_vkq hPlus + +-- 14 finite rounds u_0 -> u_14 +theorem reach_N (m : Nat) : + ∃ N, m <= N ∧ ∃ u, + multiStep tm (init []) N = some (zCf (evalWords u default)) ∧ + Good u := by + induction m with + | zero => + rcases init_to_u0 with ⟨k1, hk1⟩ + rcases Rounds_exec rounds_0_14 with ⟨k2, hk2⟩ + exact ⟨k1 + k2, Nat.zero_le _, u_14, multiStep_trans_vkq tm _ _ _ k1 k2 hk1 hk2, good_u14⟩ + | succ m ih => + rcases ih with ⟨N, hN, u, h_ms, hG⟩ + rcases Good_step hG with ⟨u', hStep, hG'⟩ + rcases Step_exec hStep with ⟨k, hk_pos, h_step_k⟩ + exact ⟨N + k, Nat.add_le_add hN hk_pos, u', multiStep_trans_vkq tm _ _ _ N k h_ms h_step_k, hG'⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n, hn⟩ + rcases reach_N (n + 1) with ⟨N, hN, _, h_N, _⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := multiStep_add_intermediate_vkq h_N + rw [multiStep_succ_vkq, hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_0LCHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH.lean new file mode 100644 index 00000000..2d14c77c --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH.lean @@ -0,0 +1,1769 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +-- A..F inherited directly from SixState +abbrev HalfTape := ListBlank (Fin 2) +abbrev BitWord := List (Fin 2) + +@[simp] theorem multiStep_zero_eq (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : + multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one_eq (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : + multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ_eq (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] +@[simp] theorem zero_shift_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head_zero : (default : HalfTape).head = 0 := rfl +@[simp] theorem default_tail_default : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append, append_cons, ih] + +theorem step_to_multiStep_one {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem step_to_stepPlus {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1, by decide, step_to_multiStep_one tm c_1 c_2 h⟩ +theorem multiStep_add_bind {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ_eq, ih, Option.bind_assoc] + simp_rw [multiStep_succ_eq] +theorem multiStep_trans_add {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [multiStep_add_bind, h₁]; simp [h₂] +theorem stepPlus_to_stepStar {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ +theorem stepPlus_trans {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, by omega, multiStep_trans_add tm c_1 c_2 c_3 n m hn hm⟩ +theorem stepPlus_stepStar_trans {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), + multiStep_trans_add tm c_1 c_2 c_3 n m hn hm⟩ +theorem step_stepStar_trans {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + stepPlus_stepStar_trans (step_to_stepPlus tm c_1 c_2 h₁) h₂ + +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine stepPlus_to_stepStar ?_) <;> + refine step_stepStar_trans (by + (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, + Turing.ListBlank.head_cons, default_head_zero]); + rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, + zero_shift_default, default_head_zero, default_tail_default]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) + +abbrev t : BitWord := [1, 1, 0, 0] +abbrev d0 : BitWord := [0, 0] +abbrev d1 : BitWord := [1, 0] +abbrev one : BitWord := [1] +abbrev lh : HalfTape := (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default + +@[simp] theorem d0_append_default : d0 +> (default : HalfTape) = default := by + simp + +inductive Call where + | ch + | cj + | cp + | ca + +def callState (st_ch st_c : Fin 6) : Call → Fin 6 + | .ch => st_ch + | .cj => st_c + | .cp => st_c + | .ca => st_c + +def callWord : Call → BitWord + | .ch => [1] + | .cj => [1, 1] + | .cp => [1, 0] + | .ca => [1, 1, 1, 0, 1, 0] + +def cfgCR (mir : Bool) (st_ch st_c : Fin 6) (l : HalfTape) (c : Call) (r : HalfTape) : + Cfg (Fin 2) (Fin 6) := + if mir then ((l <+ callWord c) {{callState st_ch st_c c}}> r) + else (r <{{callState st_ch st_c c}} (l <+ callWord c)) + +def cfgCL (mir : Bool) (st_ret : Fin 6) (l : HalfTape) (r : HalfTape) : + Cfg (Fin 2) (Fin 6) := + if mir then (l <{{st_ret}} ([0] +> r)) + else (([0] +> r) {{st_ret}}> l) + +def cfgCf (mir : Bool) (st_ret : Fin 6) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + cfgCL mir st_ret lh r + +def callStep (tm : Machine (Fin 2) (Fin 6)) + (fCR : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6)) + (fCL : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6)) + (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l, (fCR l c r1) [tm]⊢⁺ (fCL l r2) + +inductive Side (cs : Call → HalfTape → HalfTape → Prop) : + List Call → HalfTape → HalfTape → Prop where + | nil (r : HalfTape) : Side cs [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + cs c r1 r2 → Side cs ls r2 r3 → Side cs (c :: ls) r1 r3 + +def Seg (cs : Call → HalfTape → HalfTape → Prop) + (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2, Side cs ls_out r1 r2 → Side cs ls_in (w1 +> r1) (w2 +> r2) + +structure SegRules (cs : Call → HalfTape → HalfTape → Prop) : Prop where + r0b : Seg cs [.cp] [.cj] t t + r0c : Seg cs [.cj] [.cj, .ch] t t + r0d : Seg cs [.ch] [.ch, .ch] t t + r0e : Seg cs [.cp] [] (d1 ++ d0) (t ++ one) + rH2 : Seg cs [.ch] [.cj, .ch] (t ++ one) t + r0f : Seg cs [.cj] [.cj] (d1 ++ d0) t + r0g : Seg cs [.cp] [.cp] (d1 ++ d1) t + r0h : Seg cs [.cj] [.cp, .ch] (d1 ++ d1) t + r0i : Seg cs [.cj] [] d0 (d0 ++ one) + rH1 : Seg cs [.ch] [] (d0 ++ one) (d1 ++ one) + rH3 : Seg cs [.ch] [.cj] (d1 ++ one) d0 + r0j : Seg cs [.cj] [.cp] d1 d0 + rH0 : Seg cs [.ch] [] d0 d1 + rH4 : Seg cs [.ch] [.ch] d1 d0 + r0k : Seg cs [.ca] [.cj] [] t + +inductive InitKind where + | kindA + | kindB + | kindC + | kindD + +def initTape : InitKind → HalfTape + | .kindA => d1 +> default + | .kindB => t +> (d1 +> (d1 +> default)) + | .kindC => d0 +> (d1 +> default) + | .kindD => t +> default + +theorem seg_of_step4 {tm : Machine (Fin 2) (Fin 6)} + {fCR : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6)} + {fCL : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6)} + {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r, (fCR l c (w1 +> r)) [tm]⊢⁺ (fCL l (w2 +> r))) : + Seg (callStep tm fCR fCL) [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) + +theorem seg_of_step2 {tm : Machine (Fin 2) (Fin 6)} + {fCR : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6)} + {fCL : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6)} + {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r, (fCR l c_in (w1 +> r)) [tm]⊢⁺ (fCR (mid +> l) c_out r)) + (h2 : ∀ l r, (fCL (mid +> l) r) [tm]⊢⁺ (fCL l (w2 +> r))) : + Seg (callStep tm fCR fCL) [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1, hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact stepPlus_trans (h1 l r1) (stepPlus_trans (hc1 (mid +> l)) (h2 l r2)) + +theorem seg_of_step5 {tm : Machine (Fin 2) (Fin 6)} + {fCR : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6)} + {fCL : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6)} + {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r, (fCR l c_in (w1 +> r)) [tm]⊢⁺ (fCR (mid1 +> l) c1 r)) + (h2 : ∀ l r, (fCL (mid1 +> l) r) [tm]⊢⁺ (fCR (mid2 +> l) c2 r)) + (h3 : ∀ l r, (fCL (mid2 +> l) r) [tm]⊢⁺ (fCL l (w2 +> r))) : + Seg (callStep tm fCR fCL) [c_in] [c1, c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1, hrest⟩ + rcases hrest with _ | ⟨hc2, hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact stepPlus_trans (h1 l r1) + (stepPlus_trans (hc1 (mid1 +> l)) + (stepPlus_trans (h2 l _) + (stepPlus_trans (hc2 (mid2 +> l)) (h3 l r3)))) + +theorem seg_ca_cj {tm : Machine (Fin 2) (Fin 6)} + {mir : Bool} {st_ch st_c st_ret : Fin 6} + (h2 : ∀ l r, (cfgCL mir st_ret ([1, 0, 1, 0] +> l) r) [tm]⊢⁺ (cfgCL mir st_ret l (t +> r))) : + Seg (callStep tm (cfgCR mir st_ch st_c) (cfgCL mir st_ret)) [.ca] [.cj] [] t := by + intro r1 r2 h + rcases h with _ | ⟨hc1, hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + have h1 : cfgCR mir st_ch st_c l .ca ([] +> r1) = + cfgCR mir st_ch st_c ([1, 0, 1, 0] +> l) .cj r1 := by + cases mir <;> + (unfold cfgCR callWord callState + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil]) + rw [h1] + exact stepPlus_trans (hc1 ([1, 0, 1, 0] +> l)) (h2 l r2) + +syntax "seg_exec" : tactic +macro_rules + | `(tactic| seg_exec) => `(tactic| ( + intro l r + dsimp [cfgCf, cfgCL, cfgCR, callState, callWord, lh, d1, d0, t, one] + try simp only [↓reduceIte, Bool.false_eq_true, List.cons_append, List.nil_append, + append_cons, append_nil] + execute)) + +syntax "prove_seg_rules" : tactic +macro_rules + | `(tactic| prove_seg_rules) => `(tactic| + refine + { r0b := seg_of_step2 (mid := [1, 0, 1, 0]) (by seg_exec) (by seg_exec) + r0c := seg_of_step5 (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (by seg_exec) (by seg_exec) (by seg_exec) + r0d := seg_of_step5 (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (by seg_exec) (by seg_exec) (by seg_exec) + r0e := seg_of_step4 (by seg_exec) + rH2 := seg_of_step5 (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (by seg_exec) (by seg_exec) (by seg_exec) + r0f := seg_of_step2 (mid := [1, 0, 1, 0]) (by seg_exec) (by seg_exec) + r0g := seg_of_step2 (mid := [1, 0, 1, 0]) (by seg_exec) (by seg_exec) + r0h := seg_of_step5 (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (by seg_exec) (by seg_exec) (by seg_exec) + r0i := seg_of_step4 (by seg_exec) + rH1 := seg_of_step4 (by seg_exec) + rH3 := seg_of_step2 (mid := [1, 1]) (by seg_exec) (by seg_exec) + r0j := seg_of_step2 (mid := [1, 1]) (by seg_exec) (by seg_exec) + rH0 := seg_of_step4 (by seg_exec) + rH4 := seg_of_step2 (mid := [1, 1]) (by seg_exec) (by seg_exec) + r0k := seg_ca_cj (by seg_exec) }) + +end + +section + +@[simp] theorem pow_zero_nil {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_append {α : Type*} (l : List α) (n : Nat) : + l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem pow_one_add_append {α : Type*} (l : List α) (n : Nat) : + l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem pow_one_self {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem pow_add_append {α : Type*} (l : List α) (m n : Nat) : + l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm, pow_succ_append, pow_succ_append, ih, List.append_assoc] + +variable {cs : Call → HalfTape → HalfTape → Prop} (R : SegRules cs) + +theorem side_append {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side cs ls1 r1 r2) (h2 : Side cs ls2 r2 r3) : Side cs (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) + +theorem side_split {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side cs (ls1 ++ ls2) r1 r3) : ∃ r2, Side cs ls1 r1 r2 ∧ Side cs ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1, Side.nil r1, h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc, hrest⟩ + rcases ih hrest with ⟨r2, h1, h2⟩ + exact ⟨r2, Side.cons hc h1, h2⟩ + +theorem seg_nil (w : BitWord) : Seg cs [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) + +theorem seg_apply {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg cs ls1 ls2 w1 w2) (h2 : Side cs ls2 r1 r2) : + Side cs ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 + +theorem seg_comp {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg cs ls1 ls2 w1 w2) (h2 : Seg cs ls3 ls4 w2 w3) : + Seg cs (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases side_split h with ⟨r2, ha, hb⟩ + exact side_append (h1 r1 r2 ha) (h2 r2 r3 hb) + +include R in +theorem seg_ch_pow (n : Nat) : Seg cs ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact seg_nil t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [pow_succ_append, h_eq, pow_add_append] + exact seg_comp R.r0d ih + +theorem seg_ch_halve {w2 : BitWord} (hw : Seg cs [.ch, .ch] [.ch] w2 w2) (n : Nat) : + Seg cs ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact seg_nil w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq, pow_add_append, pow_succ_append] + exact seg_comp hw ih + +include R in +theorem seg_ch2_d0 : Seg cs [.ch, .ch] [.ch] d0 d0 := + seg_comp R.rH0 R.rH4 + +include R in +theorem seg_ch2_d1 : Seg cs [.ch, .ch] [.ch] d1 d1 := + seg_comp R.rH4 R.rH0 + +include R in +theorem seg_cp_t (n : Nat) : Seg cs ([.cp] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) t t := + seg_comp R.r0b (seg_ch_pow R n) + +include R in +theorem seg_cj_t (n : Nat) : Seg cs ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [pow_one_add_append, List.cons_append, List.nil_append] using + seg_comp R.r0c (seg_ch_pow R n) + +include R in +theorem seg_cp_d1d0 (n : Nat) : + Seg cs ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [pow_one_add_append, List.cons_append, List.nil_append] using + seg_comp (seg_comp R.r0e R.rH2) (seg_ch_pow R n) + +include R in +theorem seg_cj_d1d0 (n : Nat) : + Seg cs ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + seg_comp R.r0f (seg_ch_pow R n) + +include R in +theorem seg_cp_d1d1 (n : Nat) : + Seg cs ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + seg_comp R.r0g (seg_ch_pow R n) + +include R in +theorem seg_cj_d1d1 (n : Nat) : + Seg cs ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [pow_one_add_append, List.cons_append, List.nil_append] using + seg_comp R.r0h (seg_ch_pow R n) + +include R in +theorem seg_cj_d0d0 (n : Nat) : + Seg cs ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg cs [.cj, .ch, .ch] [.cj] d0 d0 := + seg_comp R.r0i (seg_comp R.rH1 R.rH3) + have h1 := seg_comp h0 (seg_ch_halve (seg_ch2_d0 R) n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq, pow_one_add_append, List.cons_append, List.nil_append] using h1 + +include R in +theorem seg_cj_d1d0_short (n : Nat) : + Seg cs ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + seg_comp R.r0j (seg_ch_halve (seg_ch2_d0 R) n) + +include R in +theorem seg_cj_ch_d0 : Seg cs [.cj, .ch] [] d0 (d1 ++ one) := + seg_comp R.r0i R.rH1 + +include R in +theorem seg_cj_d0d1 (n : Nat) : + Seg cs ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg cs [.cj, .ch, .ch, .ch] [.cj] d0 d1 := + seg_comp R.r0i (seg_comp R.rH1 (seg_comp R.rH3 R.rH0)) + have h1 := seg_comp h0 (seg_ch_halve (seg_ch2_d1 R) n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq, pow_one_add_append, List.cons_append, List.nil_append] using h1 + +include R in +theorem seg_cj_d1d1_short (n : Nat) : + Seg cs ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg cs [.cj, .ch] [.cp] d1 d1 := seg_comp R.r0j R.rH0 + have h1 := seg_comp h0 (seg_ch_halve (seg_ch2_d1 R) n) + simpa only [pow_one_add_append, List.cons_append, List.nil_append] using h1 + +include R in +theorem seg_ca_ch : Seg cs [.ca, .ch] ([.cj] ++ [.ch] ^ 2) [] t := + seg_comp R.r0k R.r0d + +inductive RIncs : Nat -> HalfTape -> HalfTape -> Prop where + | zero (r : HalfTape) : RIncs 0 r (one +> r) + | T {n : Nat} {r r' : HalfTape} : + RIncs ((1 + n) * 2) r r' -> RIncs (1 + n) (t +> r) (t +> r') + | pair0 {n : Nat} {r r' : HalfTape} : + RIncs (n * 2) r r' -> RIncs (1 + n) (d1 +> (d0 +> r)) (t +> r') + | pair1 {n : Nat} {r r' : HalfTape} : + RIncs (1 + n * 2) r r' -> RIncs (1 + n) (d1 +> (d1 +> r)) (t +> r') + | short00 {n : Nat} {r r' : HalfTape} : + RIncs (n * 2) r r' -> RIncs (2 + n * 4) (d0 +> r) (d0 +> r') + | short01 {n : Nat} {r r' : HalfTape} : + RIncs (1 + n * 2) r r' -> RIncs (2 + n * 4) (d1 +> r) (d0 +> r') + | short10 {n : Nat} {r r' : HalfTape} : + RIncs (n * 2) r r' -> RIncs (4 + n * 4) (d0 +> r) (d1 +> r') + | short11 {n : Nat} {r r' : HalfTape} : + RIncs (1 + n * 2) r r' -> RIncs (4 + n * 4) (d1 +> r) (d1 +> r') +inductive Binary : Nat -> Nat -> HalfTape -> Prop where + | one : Binary 1 1 (d1 +> default) + | zero {n H : Nat} {r : HalfTape} : + Binary (1 + n) H r -> Binary (2 + n * 2) (1 + H) (d0 +> r) + | two {n H : Nat} {r : HalfTape} : + Binary (1 + n) H r -> Binary (3 + n * 2) (1 + H) (d1 +> r) + +open WordCalculus Word +local notation "WordList" => List Word + +theorem eight_pow_pos (n : Nat) : 0 < 8 ^ n := by + induction n with + | zero => decide + | succ n ih => rw [Nat.pow_succ]; omega + +theorem binary_bounds {A H : Nat} {r : HalfTape} (h : Binary A H r) : + 0 < A /\ 0 < H /\ 2 ^ H <= A * 2 /\ A < 2 ^ H := by + induction h with + | one => decide + | @zero n H r _ ih => + rw [pow_two_one_add H]; omega + | @two n H r _ ih => + rw [pow_two_one_add H]; omega + +theorem exists_binary (n : Nat) : ∃ H r,Binary (1 + n) H r := by + induction n using Nat.strong_induction_on with + | h n ih => + cases n with + | zero => exact ⟨1,d1 +> default,Binary.one⟩ + | succ m => + rcases even_or_odd_mul_two m with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · rcases ih a (by omega) with ⟨H0,r,hI⟩ + refine ⟨1 + H0,d0 +> r,?_⟩ + have heq : 1 + (a * 2 + 1) = 2 + a * 2 := by omega + rw [heq]; exact Binary.zero hI + · rcases ih a (by omega) with ⟨H0,r,hI⟩ + refine ⟨1 + H0,d1 +> r,?_⟩ + have heq : 1 + ((1 + a * 2) + 1) = 3 + a * 2 := by omega + rw [heq]; exact Binary.two hI + +theorem binary_rincs {A H : Nat} {r : HalfTape} (h : Binary A H r) : + RIncs ((A - 1) * 2) default r := by + induction h with + | one => + have h0 := RIncs.zero (default : HalfTape) + have hd : d1 +> (default : HalfTape) = one +> default := by simp + rw [hd]; exact h0 + | @zero n H r _ ih => + have ih' : RIncs (n * 2) default r := by + have heq : ((1 + n) - 1) * 2 = n * 2 := by omega + rwa [heq] at ih + have hs := RIncs.short00 ih' + rw [d0_append_default] at hs + have heq : ((2 + n * 2) - 1) * 2 = 2 + n * 4 := by omega + rwa [heq] + | @two n H r _ ih => + have ih' : RIncs (n * 2) default r := by + have heq : ((1 + n) - 1) * 2 = n * 2 := by omega + rwa [heq] at ih + have hs := RIncs.short10 ih' + rw [d0_append_default] at hs + have heq : ((3 + n * 2) - 1) * 2 = 4 + n * 4 := by omega + rwa [heq] + +theorem digitVal_binary_append {A H : Nat} {u : WordList} (h1 : DigitVal A H u) : + ∀ {B J : Nat} {r : HalfTape},Binary B J r -> Binary (A + B * 2 ^ H) (H + J) (evalWords u r) := + by + induction h1 with + | nil => + intro B J r h2 + simpa [evalWords] using h2 + | @zero A H u _ ih => + intro B J r h2 + have hI := ih h2 + have hB := binary_bounds hI + have hI' : Binary (1 + (A + B * 2 ^ H - 1)) (H + J) (evalWords u r) := by + have heq : 1 + (A + B * 2 ^ H - 1) = A + B * 2 ^ H := by omega + rwa [heq] + have h3 := Binary.zero hI' + have heq1 : 2 + (A + B * 2 ^ H - 1) * 2 = A * 2 + B * 2 ^ (1 + H) := by + rw [pow_two_one_add H,Nat.mul_add]; omega + have heq2 : 1 + (H + J) = (1 + H) + J := by omega + simpa [evalWords,heq1,heq2] using h3 + | @one A H u _ ih => + intro B J r h2 + have hI := ih h2 + have hB := binary_bounds hI + have hI' : Binary (1 + (A + B * 2 ^ H - 1)) (H + J) (evalWords u r) := by + have heq : 1 + (A + B * 2 ^ H - 1) = A + B * 2 ^ H := by omega + rwa [heq] + have h3 := Binary.two hI' + have heq1 : 3 + (A + B * 2 ^ H - 1) * 2 = (1 + A * 2) + B * 2 ^ (1 + H) := by + rw [pow_two_one_add H,Nat.mul_add]; omega + have heq2 : 1 + (H + J) = (1 + H) + J := by omega + simpa [evalWords,heq1,heq2] using h3 + +theorem binary_191_8 : Binary 191 8 (evalWords (List.replicate 6 Q ++ [K,Q]) default) := by + dsimp [List.replicate,evalWords] + exact Binary.two (n := 94) (Binary.two (n := 46) (Binary.two (n := 22) + (Binary.two (n := 10) (Binary.two (n := 4) (Binary.two (n := 1) + (Binary.zero (n := 0) Binary.one)))))) + +def HasKKPrefix (ds : WordList) : Prop := ∃ v,ds = K :: K :: v + +def HasQ6Suffix (ds : WordList) : Prop := ∃ v,ds = v ++ List.replicate 6 Q + +theorem exists_digitVal_window (r k : Nat) (hL : 191 * 2 ^ r <= k * 2) (hU : k * 2 < 192 * 2 ^ r) : + ∃ ds,DigitVal (k * 8 - 512 * 2 ^ r) (8 + r) ds /\ HasKKPrefix ds /\ HasQ6Suffix ds /\ + Binary (k * 8) (10 + r) (evalWords ds (d0 +> (d1 +> default))) := by + let a := k * 2 - 191 * 2 ^ r + have hA : a + 191 * 2 ^ r = k * 2 := by omega + have ha_lt : a < 2 ^ r := by omega + rcases exists_digitVal_of_lt_pow r a ha_lt with ⟨v,hD⟩ + refine ⟨K :: K :: (v ++ List.replicate 6 Q),?_,⟨_,rfl⟩,⟨K :: K :: v,rfl⟩,?_⟩ + · have hApp := digitVal_append hD (digitVal_replicate_Q 6) + have hZ1 := DigitVal.zero hApp + have hZ2 := DigitVal.zero hZ1 + have hpos := pow_two_pos r + have heq1 : ((a + (2 ^ 6 - 1) * 2 ^ r) * 2) * 2 = k * 8 - 512 * 2 ^ r := by + change ((a + 63 * 2 ^ r) * 2) * 2 = k * 8 - 512 * 2 ^ r + (try omega) + have heq2 : 1 + (1 + (r + 6)) = 8 + r := by omega + rwa [heq1,heq2] at hZ2 + · have hB := digitVal_binary_append hD binary_191_8 + rw [evalWords_append] at hB + dsimp [evalWords] at hB ⊢ + rw [evalWords_append] + have hpos := pow_two_pos r + have hB' : Binary (1 + (a + 191 * 2 ^ r - 1)) (r + 8) + (evalWords v (evalWords (List.replicate 6 Q) (d0 +> (d1 +> default)))) := by + have heq : 1 + (a + 191 * 2 ^ r - 1) = a + 191 * 2 ^ r := by omega + rwa [heq] + have hB1 := Binary.zero hB' + have hB1' : Binary (1 + (2 * (a + 191 * 2 ^ r) - 1)) (1 + (r + 8)) + (d0 +> evalWords v (evalWords (List.replicate 6 Q) (d0 +> (d1 +> default)))) := by + have heq : 1 + (2 * (a + 191 * 2 ^ r) - 1) = 2 + (a + 191 * 2 ^ r - 1) * 2 := by omega + rwa [heq] + have hB2 := Binary.zero hB1' + have heq1 : 2 + (2 * (a + 191 * 2 ^ r) - 1) * 2 = k * 8 := by omega + have heq2 : 1 + (1 + (r + 8)) = 10 + r := by omega + rwa [heq1,heq2] at hB2 + +theorem two_pow_three_mul (n : Nat) : 2 ^ (3 * n) = 8 ^ n := by + induction n with + | zero => rfl + | succ n ih => + have heq : 3 * (n + 1) = 3 * n + 3 := by omega + rw [heq,Nat.pow_add,ih,Nat.pow_succ]; ring + +theorem eight_pow_bounds (n : Nat) : + 2 ^ (10 + 3 * n) = 256 * 2 ^ (2 + 3 * n) /\ 8 ^ (3 + n) = 128 * 2 ^ (2 + 3 * n) := by + constructor + · have heq : 10 + 3 * n = (2 + 3 * n) + 8 := by omega + rw [heq,Nat.pow_add]; ring + · rw [Nat.pow_add 8 3 n,Nat.pow_add 2 2 (3 * n),two_pow_three_mul]; ring + +theorem rincs_evalWords_step {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) : + ∀ {r r' : HalfTape},RIncs b r r' -> RIncs a (evalWords u r) (evalWords v r') := by + induction h with + | nil _ => intro r r' hR; exact hR + | T _ ih => intro r r' hR; exact RIncs.T (ih hR) + | pair0 _ ih => intro r r' hR; exact RIncs.pair0 (ih hR) + | pair1 _ ih => intro r r' hR; exact RIncs.pair1 (ih hR) + | short00 _ ih => intro r r' hR; exact RIncs.short00 (ih hR) + | short01 _ ih => intro r r' hR; exact RIncs.short01 (ih hR) + | short10 _ ih => intro r r' hR; exact RIncs.short10 (ih hR) + | short11 _ ih => intro r r' hR; exact RIncs.short11 (ih hR) + +theorem wordScale_append_k {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) : + (a : Rat) = (b : Rat) * wordScale v + (wordMassQ v + l) * 2 := by + induction h with + | nil k => simp [wordMassQ,wordScale] + | T _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | pair0 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | pair1 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | short00 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | short01 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | short10 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | short11 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + +theorem wordMass_append_k {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) : wordScale v <= wordScale u := by + induction h with + | nil _ => simp [wordScale] + | T _ ih => dsimp [wordScale]; linarith + | @pair0 _ u _ _ _ _ _ => have hp := wordScale_pos u; dsimp [wordScale]; linarith + | @pair1 _ u _ _ _ _ _ => have hp := wordScale_pos u; dsimp [wordScale]; linarith + | short00 _ ih => dsimp [wordScale]; linarith + | short01 _ ih => dsimp [wordScale]; linarith + | short10 _ ih => dsimp [wordScale]; linarith + | short11 _ ih => dsimp [wordScale]; linarith + +theorem scan_wordScale_mul_eight_le {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) (he : hasQKSubword u = true) : wordScale v * 8 <= wordScale u := by + induction h with + | nil _ => contradiction + | T _ ih => dsimp [hasQKSubword,wordScale] at he ⊢; have := ih he; linarith + | pair0 hS _ => have := wordMass_append_k hS; dsimp [wordScale]; linarith + | pair1 hS _ => have := wordMass_append_k hS; dsimp [wordScale]; linarith + | short00 _ ih => dsimp [hasQKSubword,wordScale] at he ⊢; have := ih he; linarith + | @short01 n u k v l hS ih => + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => dsimp [hasQKSubword,wordScale] at he ih ⊢; have := ih he; linarith + | K => exact False.elim (not_scan_odd_cons_K n u' k v l hS) + | Q => dsimp [hasQKSubword,wordScale] at he ih ⊢; have := ih he; linarith + | short10 _ ih => dsimp [hasQKSubword,wordScale] at he ⊢; have := ih he; linarith + | @short11 n u k v l hS ih => + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => dsimp [hasQKSubword,wordScale] at he ih ⊢; have := ih he; linarith + | K => exact False.elim (not_scan_odd_cons_K n u' k v l hS) + | Q => dsimp [hasQKSubword,wordScale] at he ih ⊢; have := ih he; linarith + +theorem wordMass_lt_scale {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) (he : hasQKSubword u = true) : 0 < l := by + induction h with + | nil _ => contradiction + | T _ ih => dsimp [hasQKSubword] at he; have := ih he; linarith + | pair0 hI _ => have := scan_mass_bounds hI; linarith + | pair1 hI _ => have := scan_mass_bounds hI; linarith + | short00 hI _ => have := scan_mass_bounds hI; linarith + | @short01 n u k v l hI ih => + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => dsimp [hasQKSubword] at he; have := ih he; linarith + | K => exact False.elim (not_scan_odd_cons_K n u' k v l hI) + | Q => dsimp [hasQKSubword] at he; have := ih he; linarith + | short10 hI _ => have := scan_mass_bounds hI; linarith + | @short11 n u k v l hI ih => + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => dsimp [hasQKSubword] at he; have := ih he; linarith + | K => exact False.elim (not_scan_odd_cons_K n u' k v l hI) + | Q => dsimp [hasQKSubword] at he; have := ih he; linarith + +theorem isDigitWord_append (r : Nat) : + List.replicate (3 + r) V = List.replicate r V ++ [V,V,V] := by + have heq : 3 + r = r + 3 := by omega + rw [heq,List.replicate_add]; rfl + +theorem exists_digitVal_of_isDigitWord (n a b : Nat) (v : WordList) (l : Rat) + (hI : Scan a (List.replicate (6 + n) Q ++ [K]) b v l) : + ∃ w k,v = w ++ [V,V,V] /\ b = k * 8 := by + rcases even_or_odd_mul_two n with ⟨a0,rfl⟩ | ⟨a0,rfl⟩ + · have heq : 6 + a0 * 2 = 2 + (2 + a0) * 2 := by omega + rw [heq] at hI + rcases scan_even_Q_K_inv (2 + a0) a b v l hI with ⟨d,k,rfl,rfl,_⟩ + refine ⟨d :: List.replicate a0 V,k * 2 ^ (1 + a0),?_,?_⟩ + · have heq2 : 1 + (2 + a0) = 3 + a0 := by omega + rw [heq2,isDigitWord_append]; rfl + · have heq2 : 2 + (2 + a0) = (1 + a0) + 3 := by omega + rw [heq2,Nat.pow_add]; ring + · have heq : 6 + (1 + a0 * 2) = 1 + (3 + a0) * 2 := by omega + rw [heq] at hI + rcases scan_odd_Q_K_inv (3 + a0) a b v l hI with ⟨rfl,rfl,_⟩ + refine ⟨List.replicate (1 + a0) V,(a - 1) * 2 ^ (1 + a0),?_,?_⟩ + · have heq2 : 1 + (3 + a0) = 3 + (1 + a0) := by omega + rw [heq2,isDigitWord_append] + · have heq2 : 1 + (3 + a0) = (1 + a0) + 3 := by omega + rw [heq2,Nat.pow_add]; ring + +theorem digitVal_append (n : Nat) : + ∀ (a b : Nat) (v : WordList) (l : Rat), + Scan a (List.replicate n V) b v l -> + v = List.replicate n V /\ b = a * 2 ^ n /\ l = 0 := by + induction n with + | zero => + intro a b v l hI + cases hI + exact ⟨rfl,by simp,rfl⟩ + | succ n ih => + intro a b v l hI + cases hI with + | @T m _ _ v0 l0 hJ => + rcases ih ((1 + m) * 2) b v0 l0 hJ with ⟨rfl,rfl,rfl⟩ + refine ⟨rfl,?_,by ring⟩ + rw [Nat.pow_succ]; ring + +theorem digitVal_to_binary {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (hI : Scan a (u ++ [V, V, V]) b v l) : + ∃ w k, v = w ++ [V, V, V] /\ b = k * 8 := by + rcases scan_split_of_splitCond hI u [V, V, V] rfl (Or.inr ⟨[V, V], rfl⟩) with + ⟨c, x, y, s, t0, _, hK, rfl, _⟩ + rcases digitVal_append 3 c b y t0 hK with ⟨rfl, rfl, _⟩ + exact ⟨x, c, rfl, rfl⟩ + +theorem rincs_of_stepWord {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (hI : Scan a (u ++ List.replicate 6 Q ++ [K]) b v l) : + ∃ w k, v = w ++ [V, V, V] /\ b = k * 8 := by + rcases split_trailing_Q u with ⟨p, n, rfl, hP⟩ + have hE : (p ++ List.replicate n Q) ++ List.replicate 6 Q ++ [K] = + p ++ (List.replicate (6 + n) Q ++ [K]) := by + have heq : 6 + n = n + 6 := by omega + rw [heq, List.replicate_add]; simp [List.append_assoc] + rw [hE] at hI + rcases scan_split_of_splitCond hI p (List.replicate (6 + n) Q ++ + [K]) rfl (Or.inl hP) with ⟨c, x, y, s, t0, _, hK, rfl, _⟩ + rcases exists_digitVal_of_isDigitWord n c b y t0 hK with ⟨w, k, rfl, rfl⟩ + exact ⟨x ++ w, k, by rw [List.append_assoc], rfl⟩ + +theorem rincs_of_stepWords {n : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (hI : Scan (n * 8) (K :: K :: u) b v l) : hasQKSubword v = true := by + generalize ha : n * 8 = a at hI + cases hI with + | short00 hJ => omega + | @short10 m _ _ _ _ hJ => + generalize hb : m * 2 = a2 at hJ + cases hJ with + | short00 _ => rfl + | short10 _ => omega + +theorem scan_tailDefect_wordScale_bounds {a : Nat} {u : WordList} {b : Nat} {v : WordList} + {l : Rat} {c : Nat} {ds w : WordList} {m z : Rat} + (hI : Scan a u b v l) (hE : hasQKSubword u = true) + (hJ : Scan b ds c w m) (hD : TailDefect ds z) (hZ : 3 <= z) : + wordScale v * wordMass w <= (7 / 24) * (wordScale u * z) /\ + wordScale v * m <= (7 / 24) * (wordScale u * z) := by + have hg := scan_wordScale_mul_eight_le hI hE + rcases scan_tailDefect_bound hJ hD with ⟨hM, hL, _⟩ + have hp := wordScale_pos v + have h1 : wordScale v * (1 + z * 2) <= (7 / 24) * (wordScale u * z) := by nlinarith + constructor <;> nlinarith + +theorem wordMass_append_tailDefect_bounds {a : Nat} {u : WordList} {b : Nat} + {v : WordList} {l : Rat} {c : Nat} {ds w : WordList} {m z : Rat} + (hI : Scan a u b v l) (hE : hasQKSubword u = true) + (hJ : Scan b ds c w m) (hD : TailDefect ds z) (hZ : 3 <= z) : + wordMass (v ++ w) <= wordMass u + (7 / 24) * (wordScale u * z) /\ + wordMass (v ++ + w) + l + wordScale v * m <= wordMass u + wordMassK u + (7 / 12) * (wordScale u * z) := by + have hb := scan_mass_bounds hI + have hd := scan_tailDefect_wordScale_bounds hI hE hJ hD hZ + rw [wordMass_append] + constructor <;> linarith + +theorem hasQKSubword_stepWords {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (hI : Scan a u b v l) (hB : 0 < b) : + ∃ H r, Binary b H r /\ RIncs a (evalWords u (d1 +> default)) (evalWords v (t +> r)) := by + cases b with + | zero => omega + | succ n => + have h1n : n + 1 = 1 + n := by omega + rw [h1n] at hI ⊢ + rcases exists_binary n with ⟨H, r, hD⟩ + refine ⟨H, r, hD, ?_⟩ + refine rincs_evalWords_step hI ?_ + have hR := binary_rincs hD + have heq : ((1 + n) - 1) * 2 = n * 2 := by omega + rw [heq] at hR + have hp := RIncs.pair0 hR + rwa [d0_append_default] at hp + +theorem hasVPrefix_stepWords {u : WordList} {A H : Nat} {ds : WordList} (hD : DigitVal A H ds) + (hE : wordScale u * ((2 ^ H : Nat) : Rat) = 1 / 2) + (hF : wordMass u * 2 + wordMassK u + wordScale u * wordMassK ds <= 1 / 64) : + ∃ b v l J r, + Scan 6 (u ++ ds ++ [K]) b v l /\ Binary b J r /\ + RIncs 6 (evalWords (u ++ ds) (d0 +> (d1 +> default))) (evalWords v (t +> r)) := by + rcases digitVal_scale_and_mass hD with ⟨hS, hM, _⟩ + have hU := (wordMass_nonneg u).1 + have hP := wordScale_pos u + have hEx : (wordMass (u ++ ds ++ [K]) + wordMassK (u ++ ds ++ [K])) * 2 < + ((3 * 2 : Nat) : Rat) := by + rw [wordMass_append, wordMass_append, wordMassK_append, wordMassK_append, wordScale_append] + dsimp [wordMass, wordMassK, wordScale] + rw [hS] + have hM' : wordMass ds = ((2 ^ H : Nat) : Rat) - 1 := by linarith + rw [hM'] + nlinarith + rcases exists_scan_of_mass_lt (u ++ ds ++ [K]) 3 hEx with ⟨b, v, l, hI, hB⟩ + rcases hasQKSubword_stepWords hI hB with ⟨J, r, hR, hK⟩ + refine ⟨b, v, l, J, r, hI, hR, ?_⟩ + simpa [evalWords_append, evalWords] using hK + +def HasV15Prefix (u : WordList) : Prop := ∃ p, u = p ++ [V, V, V] + +theorem hasQKSubword_append_left (u v : WordList) (h : hasQKSubword u = true) : + hasQKSubword (u ++ v) = true := by + induction u with + | nil => contradiction + | cons w u ih => + cases w with + | V => exact ih h + | K => exact ih h + | Q => + cases u with + | nil => contradiction + | cons w2 u' => + cases w2 with + | V => exact ih h + | K => rfl + | Q => exact ih h + +theorem rincs_evalWords_round {u : WordList} {A H : Nat} {ds : WordList} (hD : DigitVal A H ds) + (hHs : wordScale u * ((2 ^ H : Nat) : Rat) = 1 / 2) + (hF : wordMass u * 2 + wordMassK u + wordScale u * wordMassK ds <= 1 / 64) + (hU : HasV15Prefix u) (hW : hasQKSubword u = + true) (hLo : HasKKPrefix ds) (hHi : HasQ6Suffix ds) : + ∃ k v l g, + Scan 6 (u ++ ds ++ [K]) (k * 8) v l /\ + HasV15Prefix v /\ hasQKSubword v = true /\ + wordScale v * ((8 ^ g : Nat) : Rat) = 1 /\ + wordMass v <= wordMass u + (7 / 24) * (wordScale u * wordMassK ds) /\ + wordMass v + l <= wordMass u + wordMassK u + (7 / 12) * (wordScale u * wordMassK ds) /\ + 0 < wordMassQ v + l /\ wordMassQ v + l <= 1 / 64 := by + rcases hU with ⟨p, hU⟩ + rcases hasVPrefix_stepWords hD hHs hF with ⟨b, v, l, _, _, hI, _, _⟩ + have hCu : SplitCond u (ds ++ [K]) := by + left + rw [hU] + have heq : p ++ [V, V, V] = (p ++ [V, V]) ++ [V] := by simp [List.append_assoc] + rw [heq, notEndsWithQ_append_singleton]; rfl + have hI_assoc : Scan 6 (u ++ (ds ++ [K])) b v l := by + simpa [List.append_assoc] using hI + rcases scan_split_of_splitCond hI_assoc u (ds ++ [K]) rfl hCu with + ⟨c, x, y, s, t0, hI1, hI2, hV, hL⟩ + have hHv : hasQKSubword v = true := by + have hJ1 := hI1 + rw [hU] at hJ1 + rcases digitVal_to_binary hJ1 with ⟨z, k, _, rfl⟩ + rcases hLo with ⟨w, rfl⟩ + have hLow := rincs_of_stepWords hI2 + rw [hV] + exact hasQKSubword_append_right x y hLow + have hBv : ∃ p' k, v = p' ++ [V, V, V] /\ b = k * 8 := by + rcases hHi with ⟨w, rfl⟩ + have hI' : Scan 6 ((u ++ w) ++ List.replicate 6 Q ++ [K]) b v l := by + simpa [List.append_assoc] using hI + exact rincs_of_stepWord hI' + rcases hBv with ⟨z, k, hZ, rfl⟩ + rcases scan_scale_pow_eight hI with ⟨g, hG⟩ + have hS : wordScale v * ((8 ^ g : Nat) : Rat) = 1 := by + have hDs := (digitVal_scale_and_mass hD).1 + rw [wordScale_append, wordScale_append] at hG + dsimp [wordScale] at hG + rw [hDs] at hG + nlinarith + have hZd : 3 <= wordMassK ds := by + rcases hLo with ⟨w, rfl⟩ + have hw := (wordMass_nonneg w).2.1 + dsimp [wordMassK]; linarith + rcases wordMass_append_tailDefect_bounds hI1 hW hI2 (tailDefect_append_K_of_digitVal hD) hZd with + ⟨hM, hB⟩ + rw [<- hV] at hM hB + have hB' : wordMass v + l <= wordMass u + wordMassK u + + (7 / 12) * (wordScale u * wordMassK ds) := by linarith + refine ⟨k, v, l, g, hI, ⟨z, hZ⟩, hHv, hS, hM, hB', ?_, ?_⟩ + · have hwv := wordMass_nonneg v + have hloss := wordMass_lt_scale hI + (hasQKSubword_append_left (u ++ ds) [K] (hasQKSubword_append_left u ds hW)) + linarith + · have hwv := wordMass_nonneg v + have hwu := wordMass_nonneg u + have hwds := wordMass_nonneg ds + have hsu := wordScale_pos u + have hms := wordMass_eq_add v + nlinarith + +theorem good_next_round_aux {g k : Nat} {s delta : Rat} + (hS : s * ((8 ^ g : Nat) : Rat) = 1) + (hB : (6 : Rat) = ((k * 8 : Nat) : Rat) * s + delta * 2) + (hD : 0 < delta) (hU : delta <= 1 / 64) : + ∃ n,g = 3 + n /\ 191 * 2 ^ (2 + 3 * n) <= k * 2 /\ k * 2 < 192 * 2 ^ (2 + 3 * n) := by + have hP_nat := eight_pow_pos g + have hP : (0 : Rat) < ((8 ^ g : Nat) : Rat) := Nat.cast_pos.mpr hP_nat + have hE : ((k * 8 : Nat) : Rat) = (6 - delta * 2) * ((8 ^ g : Nat) : Rat) := by + have hT : ((k * 8 : Nat) : Rat) * s = 6 - delta * 2 := by linarith + calc ((k * 8 : Nat) : Rat) + _ = (((k * 8 : Nat) : Rat) * s) * ((8 ^ g : Nat) : Rat) := by + rw [mul_assoc,hS,mul_one] + _ = (6 - delta * 2) * ((8 ^ g : Nat) : Rat) := by rw [hT] + have hL_q : ((191 * 8 ^ g : Nat) : Rat) <= ((256 * k : Nat) : Rat) := by + push_cast at hP hE ⊢; nlinarith + have hL : 191 * 8 ^ g <= 256 * k := Nat.cast_le.mp hL_q + have hR_q : ((k * 8 : Nat) : Rat) < ((6 * 8 ^ g : Nat) : Rat) := by + push_cast at hP hE ⊢; nlinarith + have hR : k * 8 < 6 * 8 ^ g := Nat.cast_lt.mp hR_q + rcases g with _ | _ | _ | n + · omega + · omega + · omega + · have hp := (eight_pow_bounds n).2 + have h3n : n + 1 + 1 + 1 = 3 + n := by omega + rw [h3n,hp] at hL hR + exact ⟨n,by omega,by omega,by omega⟩ + +theorem good_next_round_main {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + {H : Nat} {r : HalfTape} + (hI : Scan a u b v l) (hB : Binary b H r) : + RIncs a (evalWords u (d1 +> default)) (evalWords v (t +> r)) := by + have hb := (binary_bounds hB).1 + cases b with + | zero => omega + | succ b => + have h1b : b + 1 = 1 + b := by omega + rw [h1b] at hI hB + refine rincs_evalWords_step hI ?_ + have hR := binary_rincs hB + have heq : ((1 + b) - 1) * 2 = b * 2 := by omega + rw [heq] at hR + have hp := RIncs.pair0 hR + rwa [d0_append_default] at hp + +inductive Good : HalfTape -> Prop where + | intro (u : WordList) (A H : Nat) (ds : WordList) : + DigitVal A H ds -> + wordScale u * ((2 ^ H : Nat) : Rat) = 1 / 2 -> + wordMass u * 2 + wordMassK u + wordScale u * wordMassK ds <= 1 / 64 -> + HasV15Prefix u -> hasQKSubword u = true -> HasKKPrefix ds -> HasQ6Suffix ds -> + Good (evalWords (u ++ ds) (d0 +> (d1 +> default))) + +theorem good_next_round {r : HalfTape} (hG : Good r) : + ∃ r',RIncs 6 r r' /\ Good (t +> r') := by + rcases hG with ⟨u,A,H,ds,hD,hHs,hF,hU,hW,hLo,hHi⟩ + rcases rincs_evalWords_round hD hHs hF hU hW hLo hHi with + ⟨k,v,l,g,hI,hTv,hV,hS,hM,hL,hPos,hBound⟩ + have hB := wordScale_append_k hI + rcases good_next_round_aux hS hB hPos hBound with ⟨n,rfl,hKl,hKu⟩ + rcases exists_digitVal_window (2 + 3 * n) k hKl hKu with ⟨ds',hD',hLo',hHi',hBin⟩ + refine ⟨evalWords v (t +> evalWords ds' (d0 +> (d1 +> default))),?_,?_⟩ + · have hR := good_next_round_main hI hBin + simpa [evalWords_append,evalWords] using hR + · have hOut : t +> evalWords v (t +> evalWords ds' (d0 +> (d1 +> default))) = + evalWords ((V :: (v ++ [V])) ++ ds') (d0 +> (d1 +> default)) := by + simp [evalWords_append,evalWords] + rw [hOut] + have hp1 := (eight_pow_bounds n).1 + have hp2 := (eight_pow_bounds n).2 + have h82 : 8 + (2 + 3 * n) = 10 + 3 * n := by omega + refine Good.intro (V :: (v ++ [V])) _ (8 + (2 + 3 * n)) ds' hD' ?_ ?_ ?_ ?_ hLo' hHi' + · rw [hp2] at hS + rw [h82,hp1] + dsimp [wordScale]; rw [wordScale_append]; dsimp [wordScale] + push_cast at hS ⊢ + nlinarith + · have hZ := digitVal_wordMassK_eq hD' + rw [h82,hp1] at hZ + have hAeq : (k * 8 - 512 * 2 ^ (2 + 3 * n)) + 512 * 2 ^ (2 + 3 * n) = k * 8 := by omega + have hAE : (((k * 8 - 512 * 2 ^ (2 + 3 * n) : Nat) : Rat)) + ((512 * 2 ^ (2 + 3 * n) : Nat) : + Rat) = ((k * 8 : Nat) : Rat) := by + exact_mod_cast hAeq + rw [hp2] at hS + push_cast at hZ hAE hS hB + dsimp [wordMass,wordMassK,wordScale] + rw [wordMass_append,wordMassK_append,wordScale_append] + dsimp [wordMass,wordMassK,wordScale] + have hms := wordMass_eq_add v + have hwu := wordMass_nonneg u + have hwds := wordMass_nonneg ds + have hsu := wordScale_pos u + have hsv := wordScale_pos v + nlinarith + · rcases hTv with ⟨w,rfl⟩ + refine ⟨V :: (w ++ [V]),?_⟩ + simp [List.append_assoc] + · dsimp [hasQKSubword] + exact hasQKSubword_append_left v [V] hV + +def pow_four_eq : Nat -> Nat -> Option (WordList) + | 0,_ => none + | _ + 1,0 => none + | _ + 1,1 => some [Q] + | fuel + 1,m + 2 => + match pow_four_eq fuel ((m + 2) / 2) with + | none => none + | some ws => some ((if (m + 2) % 2 == 0 then K else Q) :: ws) + +theorem execCodeE (fuel : Nat) : + ∀ (m : Nat) (ws : WordList),pow_four_eq fuel m = some ws -> + ∃ H,Binary m H (evalWords ws default) := by + induction fuel with + | zero => intro m ws h; contradiction + | succ fuel ih => + intro m ws h + rcases m with _ | _ | m + · contradiction + · injection h with h; subst h + exact ⟨1,Binary.one⟩ + · dsimp [pow_four_eq] at h + cases hrec : pow_four_eq fuel ((m + 2) / 2) with + | none => rw [hrec] at h; contradiction + | some ws' => + rw [hrec] at h + injection h with h; subst h + rcases ih ((m + 2) / 2) ws' hrec with ⟨H,hB⟩ + have hq : (m + 2) / 2 = 1 + ((m + 2) / 2 - 1) := by omega + rw [hq] at hB + rcases Nat.mod_two_eq_zero_or_one (m + 2) with hmod | hmod + · have hcond : ((m + 2) % 2 == 0) = true := beq_iff_eq.mpr hmod + rw [hcond]; dsimp [evalWords] + refine ⟨1 + H,?_⟩ + have heq : m + 2 = 2 + ((m + 2) / 2 - 1) * 2 := by omega + rw [heq]; exact Binary.zero hB + · have hcond : ((m + 2) % 2 == 0) = false := beq_false_of_ne (by omega) + rw [hcond]; dsimp [evalWords] + refine ⟨1 + H,?_⟩ + have heq : m + 2 = 3 + ((m + 2) / 2 - 1) * 2 := by omega + rw [heq]; exact Binary.two hB + +open ChoiceE +def execCodeE_sound : ChoiceE -> Nat -> Nat + | CT,n | CP0,n | CP1,n => 1 + n + | CS00,n | CS01,n => 2 + n * 4 + | CS10,n | CS11,n => 4 + n * 4 + +def execCodeE_complete : ChoiceE -> Nat -> Nat + | CT,n => (1 + n) * 2 + | CP0,n | CS00,n | CS10,n => n * 2 + | CP1,n | CS01,n | CS11,n => 1 + n * 2 + +def checkRoundE : CodeE -> Nat -> WordList -> Option (WordList) + | .Stop n,k,u => + if k == n * 2 then + if u.all isWordK then pow_four_eq 64 (1 + n) else none + else none + | .More ch n c,k,u => + if k == execCodeE_sound ch n then + match stripWordPrefix (choiceInWordsE ch) u with + | none => none + | some w => + match checkRoundE c (execCodeE_complete ch n) w with + | none => none + | some v => some (choiceOutWordE ch :: v) + else none + +theorem checkRoundE_sound (c : CodeE) : + ∀ (k : Nat) (u v : WordList),checkRoundE c k u = some v -> + RIncs k (evalWords u default) (evalWords v default) := by + induction c with + | Stop n => + intro k u v hE + dsimp [checkRoundE] at hE + cases hk : (k == n * 2) with + | false => rw [hk] at hE; contradiction + | true => + rw [hk] at hE + have rfl_k : k = n * 2 := beq_iff_eq.mp hk + subst rfl_k + cases hu : u.all isWordK with + | false => rw [hu] at hE; contradiction + | true => + rw [hu] at hE + dsimp at hE + rw [evalWords_default_of_all_K u hu] + rcases execCodeE 64 (1 + n) v hE with ⟨H,hB⟩ + have hR := binary_rincs hB + have heq : ((1 + n) - 1) * 2 = n * 2 := by omega + rwa [heq] at hR + | More ch n c ih => + intro k u v hE + dsimp [checkRoundE] at hE + cases hk : (k == execCodeE_sound ch n) with + | false => rw [hk] at hE; contradiction + | true => + rw [hk] at hE + dsimp at hE + have rfl_k : k = execCodeE_sound ch n := beq_iff_eq.mp hk + subst rfl_k + cases hU : stripWordPrefix (choiceInWordsE ch) u with + | none => rw [hU] at hE; contradiction + | some w => + rw [hU] at hE + dsimp at hE + cases hC : checkRoundE c (execCodeE_complete ch n) w with + | none => rw [hC] at hE; contradiction + | some x => + rw [hC] at hE + injection hE with hE; subst hE + have rfl_u := stripWordPrefix_sound (choiceInWordsE ch) u w hU + subst rfl_u + have hIH := ih (execCodeE_complete ch n) w x hC + cases ch + · exact RIncs.T hIH + · exact RIncs.pair0 hIH + · exact RIncs.pair1 hIH + · exact RIncs.short00 hIH + · exact RIncs.short01 hIH + · exact RIncs.short10 hIH + · exact RIncs.short11 hIH + +def roundStepE (c : CodeE) (u : WordList) : Option (WordList) := + match checkRoundE c 6 (u ++ [K]) with + | some v => some (V :: v) + | none => none + +theorem roundStepE_trans (c : CodeE) (u v : WordList) (h : roundStepE c u = some v) : + ∃ r,RIncs 6 (evalWords u default) r /\ evalWords v default = t +> r := by + dsimp [roundStepE] at h + cases hE : checkRoundE c 6 (u ++ [K]) with + | none => rw [hE] at h; contradiction + | some w => + rw [hE] at h + injection h with h; subst h + refine ⟨evalWords w default,?_,rfl⟩ + have hR := checkRoundE_sound c 6 (u ++ [K]) w hE + simpa [evalWords_append,evalWords] using hR + +inductive Rounds : HalfTape -> HalfTape -> Prop where + | refl (r : HalfTape) : Rounds r r + | next {r s t0 : HalfTape} : + RIncs 6 r s -> Rounds (t +> s) t0 -> Rounds r t0 + +def checkRoundsE : List CodeE -> WordList -> Option (WordList) + | [],u => some u + | c :: cs,u => + match roundStepE c u with + | none => none + | some v => checkRoundsE cs v + +theorem checkRoundsE_sound (cs : List CodeE) : + ∀ (u v : WordList),checkRoundsE cs u = some v -> + Rounds (evalWords u default) (evalWords v default) := by + induction cs with + | nil => + intro u v h + injection h with h; subst h + exact Rounds.refl _ + | cons c cs ih => + intro u v h + dsimp [checkRoundsE] at h + cases hW : roundStepE c u with + | none => rw [hW] at h; contradiction + | some w => + rw [hW] at h + rcases roundStepE_trans c u w hW with ⟨r,hR,hEq⟩ + refine Rounds.next hR ?_ + rw [<- hEq] + exact ih w v h + +theorem good_of_checks (u ds : WordList) + (hD : ds.all isDigitWord = true) + (hS : wordScale u * wordScale ds = 1 / 2) + (hF : wordMass u * 2 + wordMassK u + wordScale u * wordMassK ds <= 1 / 64) + (hU : HasV15Prefix u) (hW : hasQKSubword u = + true) (hLo : HasKKPrefix ds) (hHi : HasQ6Suffix ds) : + Good (evalWords (u ++ ds) (d0 +> (d1 +> default))) := by + rcases exists_digitVal_of_all_isDigitWord ds hD with ⟨A,hI⟩ + refine Good.intro u A ds.length ds hI ?_ hF hU hW hLo hHi + rw [<- (digitVal_scale_and_mass hI).1] + exact hS + + +def initWords_A : WordList := [Q] + +def initCodes_A : List CodeE := [ + .More CP0 5 (.Stop 5), + .More CT 5 (.More CT 11 (.More CS10 5 (.More CS01 2 (.More CP0 4 (.Stop 4))))), + .More CT 5 (.More CT 11 (.More CT 23 (.More CP0 47 (.More CT 93 (.More CP0 187 (.More CP0 373 + (.Stop 373))))))), + .More CT 5 (.More CT 11 (.More CT 23 (.More CT 47 (.More CT 95 (.More CT 191 (.More CT 383 (.More + CT 767 (.More CS10 383 (.More CS01 191 (.More CP0 382 (.More CP1 763 (.More CP0 1526 (.More + CP0 3051 (.Stop 3051)))))))))))))), + .More CT 5 (.More CT 11 (.More CT 23 (.More CT 47 (.More CT 95 (.More CT 191 (.More CT 383 (.More + CT 767 (.More CT 1535 (.More CP0 3071 (.More CT 6141 (.More CT 12283 (.More CT 24567 (.More CT + 49135 (.More CS10 24567 (.More CS00 12283 (.More CS01 6141 (.More CP0 12282 (.More CP1 24563 + (.More CP1 49126 (.More CP0 98252 (.More CP0 196503 (.Stop 196503)))))))))))))))))))))) +] + +def goodPrefix_A : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,K,K,V,V,V,V,V] + +def goodSuffix_A : WordList := [K,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q] + +theorem init_rounds_A : + Rounds (evalWords initWords_A default) (evalWords (goodPrefix_A ++ goodSuffix_A) (d0 +> (d1 +> + default))) := by + have h1 : Rounds (evalWords initWords_A default) (evalWords (goodPrefix_A ++ goodSuffix_A ++ + [K,Q]) default) := by + apply checkRoundsE_sound initCodes_A + decide + simpa [evalWords_append,evalWords] using h1 + +theorem init_good_A : + Good (evalWords (goodPrefix_A ++ goodSuffix_A) (d0 +> (d1 +> default))) := by + apply good_of_checks + · decide + · norm_num [goodPrefix_A,goodSuffix_A,wordScale] + · norm_num [goodPrefix_A,goodSuffix_A,wordMass,wordMassK,wordScale] + · exact ⟨goodPrefix_A.take 20,by decide⟩ + · decide + · exact ⟨goodSuffix_A.drop 2,by decide⟩ + · exact ⟨goodSuffix_A.take 10,by decide⟩ + + +def initWords_B : WordList := [V,Q,Q] + +def initCodes_B : List CodeE := [ + (.More CT 5 (.More CS11 2 (.More CP0 4 (.Stop 4)))), + (.More CT 5 (.More CT 11 (.More CS11 5 (.More CT 10 (.More CP0 21 (.More CP0 41 (.Stop 41))))))), + (.More CT 5 (.More CT 11 (.More CT 23 (.More CS11 11 (.More CT 22 (.More CT 45 (.More CT 91 (.More + CS10 45 (.More CP0 89 (.More CP0 177 (.More CP0 353 (.Stop 353)))))))))))), + (.More CT 5 (.More CT 11 (.More CT 23 (.More CT 47 (.More CS11 23 (.More CT 46 (.More CT 93 (.More + CT 187 (.More CS11 93 (.More CT 186 (.More CT 373 (.More CT 747 (.More CS10 373 (.More CP0 745 + (.More CS00 372 (.More CS10 185 (.More CS01 92 (.More CP0 184 (.More CP0 367 (.Stop + 367)))))))))))))))))))), + (.More CT 5 (.More CT 11 (.More CT 23 (.More CT 47 (.More CT 95 (.More CS11 47 (.More CT 94 (.More + CT 189 (.More CT 379 (.More CS11 189 (.More CT 378 (.More CT 757 (.More CT 1515 (.More CS11 + 757 (.More CT 1514 (.More CS00 757 (.More CP0 1513 (.More CT 3025 (.More CT 6051 (.More CS10 + 3025 (.More CS00 1512 (.More CS10 755 (.More CS00 377 (.More CP1 753 (.More CP0 1506 (.More + CP0 3011 (.Stop 3011))))))))))))))))))))))))))), + (.More CT 5 (.More CT 11 (.More CT 23 (.More CT 47 (.More CT 95 (.More CT 191 (.More CS11 95 + (.More CT 190 (.More CT 381 (.More CT 763 (.More CS11 381 (.More CT 762 (.More CT 1525 (.More + CT 3051 (.More CS11 1525 (.More CT 3050 (.More CS00 1525 (.More CT 3049 (.More CT 6099 (.More + CT 12199 (.More CP0 24399 (.More CP0 48797 (.More CT 97593 (.More CT 195187 (.More CT 390375 + (.More CS10 195187 (.More CS00 97593 (.More CP0 195185 (.More CS00 97592 (.More CS10 48795 + (.More CS01 24397 (.More CP1 48794 (.More CP0 97588 (.More CP0 195175 (.Stop + 195175))))))))))))))))))))))))))))))))))), + (.More CT 5 (.More CT 11 (.More CT 23 (.More CT 47 (.More CT 95 (.More CT 191 (.More CT 383 (.More + CS11 191 (.More CT 382 (.More CT 765 (.More CT 1531 (.More CS11 765 (.More CT 1530 (.More CT + 3061 (.More CT 6123 (.More CS11 3061 (.More CT 6122 (.More CS00 3061 (.More CT 6121 (.More CT + 12243 (.More CT 24487 (.More CT 48975 (.More CT 97951 (.More CT 195903 (.More CT 391807 (.More + CT 783615 (.More CP0 1567231 (.More CT 3134461 (.More CS10 1567230 (.More CP0 3134459 (.More + CT 6268917 (.More CT 12537835 (.More CT 25075671 (.More CS10 12537835 (.More CS00 6268917 + (.More CS00 3134458 (.More CP0 6268915 (.More CS01 3134457 (.More CP0 6268914 (.More CS10 + 3134456 (.More CP0 6268911 (.More CP1 12537821 (.More CP1 25075642 (.More CP0 50151284 (.More + CP0 100302567 (.Stop 100302567)))))))))))))))))))))))))))))))))))))))))))))), + (.More CT 5 (.More CT 11 (.More CT 23 (.More CT 47 (.More CT 95 (.More CT 191 (.More CT 383 (.More + CT 767 (.More CS11 383 (.More CT 766 (.More CT 1533 (.More CT 3067 (.More CS11 1533 (.More CT + 3066 (.More CT 6133 (.More CT 12267 (.More CS11 6133 (.More CT 12266 (.More CS00 6133 (.More + CT 12265 (.More CT 24531 (.More CT 49063 (.More CT 98127 (.More CT 196255 (.More CT 392511 + (.More CT 785023 (.More CT 1570047 (.More CT 3140095 (.More CT 6280191 (.More CS11 3140095 + (.More CT 6280190 (.More CT 12560381 (.More CT 25120763 (.More CT 50241527 (.More CP0 + 100483055 (.More CS00 50241527 (.More CT 100483053 (.More CS10 50241526 (.More CT 100483051 + (.More CS11 50241525 (.More CT 100483050 (.More CT 200966101 (.More CT 401932203 (.More CT + 803864407 (.More CT 1607728815 (.More CS10 803864407 (.More CS00 401932203 (.More CS00 + 200966101 (.More CP0 401932201 (.More CP1 803864401 (.More CP0 1607728802 (.More CS11 + 803864400 (.More CP1 1607728800 (.More CP1 3215457600 (.More CP0 6430915200 (.More CS10 + 3215457599 (.More CP0 6430915197 (.More CS01 3215457598 (.More CP1 6430915196 (.More CP1 + 12861830392 (.More CP0 25723660784 (.More CP0 51447321567 (.Stop + 51447321567))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +] + +def goodPrefix_B : WordList := + [V, V, V, V, V, V, V, V, V, Q, V, V, V, Q, V, V, V, Q, V, K, V, V, V, V, V, V, V, V, V, V, + Q, V, V, V, V, V, K, V, Q, V, Q, V, V, V, V, V, Q, K, K, V, V, V, Q, V, V, V, Q, V, K, V, + V, V, V] + +def goodSuffix_B : WordList := + [K, K, K, K, K, Q, Q, Q, Q, Q, K, K, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, K, Q, K, Q, Q, Q, + Q, Q, Q, Q] + +theorem init_rounds_B : + Rounds (evalWords initWords_B default) (evalWords (goodPrefix_B ++ goodSuffix_B) (d0 +> (d1 +> + default))) := by + have h1 : Rounds (evalWords initWords_B default) (evalWords (goodPrefix_B ++ goodSuffix_B ++ + [K,Q]) default) := by + apply checkRoundsE_sound initCodes_B + decide + simpa [evalWords_append,evalWords] using h1 + +theorem init_good_B : + Good (evalWords (goodPrefix_B ++ goodSuffix_B) (d0 +> (d1 +> default))) := by + apply good_of_checks + · decide + · norm_num [goodPrefix_B,goodSuffix_B,wordScale] + · norm_num [goodPrefix_B,goodSuffix_B,wordMass,wordMassK,wordScale] + · exact ⟨goodPrefix_B.take (goodPrefix_B.length - 3),by decide⟩ + · decide + · exact ⟨goodSuffix_B.drop 2,by decide⟩ + · exact ⟨goodSuffix_B.take (goodSuffix_B.length - 6),by decide⟩ + + +def initWords_C : WordList := [K,Q] + +def initCodes_C : List CodeE := [ + .More CS00 1 (.More CP0 1 (.Stop 1)), + .More CT 5 (.More CS10 2 (.More CT 3 (.More CS10 1 (.More CP0 1 (.Stop 1))))), + .More CT 5 (.More CT 11 (.More CS11 5 (.More CT 10 (.More CS01 5 (.More CT 10 (.More CS00 5 (.More + CP0 9 (.Stop 9)))))))), + .More CT 5 (.More CT 11 (.More CT 23 (.More CS11 11 (.More CT 22 (.More CS00 11 (.More CT 21 + (.More CS10 10 (.More CT 19 (.More CS10 9 (.More CP0 17 (.More CP0 33 (.Stop 33)))))))))))), + .More CT 5 (.More CT 11 (.More CT 23 (.More CT 47 (.More CS11 23 (.More CT 46 (.More CS00 23 + (.More CT 45 (.More CS11 22 (.More CT 44 (.More CS01 22 (.More CT 44 (.More CT 89 (.More CS10 + 44 (.More CP0 87 (.More CS00 43 (.More CS00 21 (.More CP0 41 (.Stop 41)))))))))))))))))), + .More CT 5 (.More CT 11 (.More CT 23 (.More CT 47 (.More CT 95 (.More CS11 47 (.More CT 94 (.More + CS00 47 (.More CT 93 (.More CS11 46 (.More CT 92 (.More CS00 46 (.More CT 91 (.More CT 183 + (.More CS11 91 (.More CT 182 (.More CS00 91 (.More CS00 45 (.More CT 89 (.More CS10 44 (.More + CP0 87 (.More CP0 173 (.More CP0 345 (.Stop 345))))))))))))))))))))))), + .More CT 5 (.More CT 11 (.More CT 23 (.More CT 47 (.More CT 95 (.More CT 191 (.More CS11 95 (.More + CT 190 (.More CS00 95 (.More CT 189 (.More CS11 94 (.More CT 188 (.More CS00 94 (.More CT 187 + (.More CT 375 (.More CS11 187 (.More CT 374 (.More CS00 187 (.More CS00 93 (.More CT 185 + (.More CS11 92 (.More CT 184 (.More CT 369 (.More CT 739 (.More CS10 369 (.More CP0 737 (.More + CS01 368 (.More CP0 736 (.More CP0 1471 (.More CP0 2941 (.Stop + 2941)))))))))))))))))))))))))))))), + .More CT 5 (.More CT 11 (.More CT 23 (.More CT 47 (.More CT 95 (.More CT 191 (.More CT 383 (.More + CS11 191 (.More CT 382 (.More CS00 191 (.More CT 381 (.More CS11 190 (.More CT 380 (.More CS00 + 190 (.More CT 379 (.More CT 759 (.More CS11 379 (.More CT 758 (.More CS00 379 (.More CS00 189 + (.More CT 377 (.More CS11 188 (.More CT 376 (.More CT 753 (.More CT 1507 (.More CS11 753 + (.More CT 1506 (.More CS00 753 (.More CT 1505 (.More CT 3011 (.More CT 6023 (.More CS10 3011 + (.More CS01 1505 (.More CP1 3010 (.More CP1 6020 (.More CP0 12040 (.More CS11 6019 (.More CP0 + 12038 (.More CP0 24075 (.Stop 24075))))))))))))))))))))))))))))))))))))))), + .More CT 5 (.More CT 11 (.More CT 23 (.More CT 47 (.More CT 95 (.More CT 191 (.More CT 383 (.More + CT 767 (.More CS11 383 (.More CT 766 (.More CS00 383 (.More CT 765 (.More CS11 382 (.More CT + 764 (.More CS00 382 (.More CT 763 (.More CT 1527 (.More CS11 763 (.More CT 1526 (.More CS00 + 763 (.More CS00 381 (.More CT 761 (.More CS11 380 (.More CT 760 (.More CT 1521 (.More CT 3043 + (.More CS11 1521 (.More CT 3042 (.More CS00 1521 (.More CT 3041 (.More CT 6083 (.More CT 12167 + (.More CP0 24335 (.More CT 48669 (.More CT 97339 (.More CT 194679 (.More CS11 97339 (.More CT + 194678 (.More CT 389357 (.More CS10 194678 (.More CS10 97338 (.More CS11 48668 (.More CP0 + 97336 (.More CS10 48667 (.More CS00 24333 (.More CS00 12166 (.More CS10 6082 (.More CS11 3040 + (.More CP1 6080 (.More CP0 12160 (.More CP0 24319 (.Stop + 24319))))))))))))))))))))))))))))))))))))))))))))))))))), + .More CT 5 (.More CT 11 (.More CT 23 (.More CT 47 (.More CT 95 (.More CT 191 (.More CT 383 (.More + CT 767 (.More CT 1535 (.More CS11 767 (.More CT 1534 (.More CS00 767 (.More CT 1533 (.More + CS11 766 (.More CT 1532 (.More CS00 766 (.More CT 1531 (.More CT 3063 (.More CS11 1531 (.More + CT 3062 (.More CS00 1531 (.More CS00 765 (.More CT 1529 (.More CS11 764 (.More CT 1528 (.More + CT 3057 (.More CT 6115 (.More CS11 3057 (.More CT 6114 (.More CS00 3057 (.More CT 6113 (.More + CT 12227 (.More CT 24455 (.More CT 48911 (.More CT 97823 (.More CT 195647 (.More CT 391295 + (.More CS11 195647 (.More CT 391294 (.More CT 782589 (.More CS11 391294 (.More CP1 782588 + (.More CT 1565176 (.More CP0 3130353 (.More CS00 1565176 (.More CP1 3130351 (.More CT 6260702 + (.More CT 12521405 (.More CT 25042811 (.More CS10 12521405 (.More CS00 6260702 (.More CS10 + 3130350 (.More CS10 1565174 (.More CS10 782586 (.More CS10 391292 (.More CS10 195645 (.More + CS00 97822 (.More CP1 195643 (.More CP1 391286 (.More CP0 782572 (.More CP0 1565143 (.Stop + 1565143))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))), + .More CT 5 (.More CT 11 (.More CT 23 (.More CT 47 (.More CT 95 (.More CT 191 (.More CT 383 (.More + CT 767 (.More CT 1535 (.More CT 3071 (.More CS11 1535 (.More CT 3070 (.More CS00 1535 (.More + CT 3069 (.More CS11 1534 (.More CT 3068 (.More CS00 1534 (.More CT 3067 (.More CT 6135 (.More + CS11 3067 (.More CT 6134 (.More CS00 3067 (.More CS00 1533 (.More CT 3065 (.More CS11 1532 + (.More CT 3064 (.More CT 6129 (.More CT 12259 (.More CS11 6129 (.More CT 12258 (.More CS00 + 6129 (.More CT 12257 (.More CT 24515 (.More CT 49031 (.More CT 98063 (.More CT 196127 (.More + CT 392255 (.More CT 784511 (.More CS11 392255 (.More CT 784510 (.More CT 1569021 (.More CS11 + 784510 (.More CT 1569020 (.More CT 3138041 (.More CT 6276083 (.More CS10 3138041 (.More CT + 6276081 (.More CT 12552163 (.More CT 25104327 (.More CT 50208655 (.More CP0 100417311 (.More + CP1 200834621 (.More CP1 401669242 (.More CP0 803338484 (.More CT 1606676967 (.More CT + 3213353935 (.More CT 6426707871 (.More CT 12853415743 (.More CS10 6426707871 (.More CS00 + 3213353935 (.More CS00 1606676967 (.More CS01 803338483 (.More CP0 1606676966 (.More CP1 + 3213353931 (.More CP0 6426707862 (.More CS10 3213353930 (.More CS10 1606676964 (.More CS10 + 803338481 (.More CS01 401669240 (.More CP1 803338480 (.More CP1 1606676960 (.More CP0 + 3213353920 (.More CP0 6426707839 (.Stop + 6426707839))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +] + +def goodPrefix_C : WordList := + [V, V, V, V, V, V, V, V, V, V, V, Q, V, K, V, Q, V, K, V, V, Q, V, K, K, V, Q, V, V, V, Q, + V, K, V, V, V, V, V, V, V, Q, V, V, Q, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, Q, + K, K, K, V, V, V, Q, Q, Q, K, V, V, V, V] + +def goodSuffix_C : WordList := + [K, K, K, K, K, K, K, Q, Q, Q, Q, K, K, K, Q, Q, Q, Q, Q, Q, K, K, K, K, Q, Q, Q, Q, Q, Q, + Q] + +set_option maxHeartbeats 2000000 in +-- Justification: Finite decision procedure over the 12-round CodeE trace for kind C. +theorem init_rounds_C : + Rounds (evalWords initWords_C default) (evalWords (goodPrefix_C ++ goodSuffix_C) (d0 +> (d1 +> + default))) := by + have h1 : Rounds (evalWords initWords_C default) (evalWords (goodPrefix_C ++ goodSuffix_C ++ + [K,Q]) default) := by + apply checkRoundsE_sound initCodes_C + decide + simpa [evalWords_append,evalWords] using h1 + +set_option maxHeartbeats 2000000 in +-- Justification: Arithmetic and prefix/suffix verification for the kind-C initial Good word. +theorem init_good_C : + Good (evalWords (goodPrefix_C ++ goodSuffix_C) (d0 +> (d1 +> default))) := by + apply good_of_checks + · decide + · norm_num [goodPrefix_C,goodSuffix_C,wordScale] + · norm_num [goodPrefix_C,goodSuffix_C,wordMass,wordMassK,wordScale] + · exact ⟨goodPrefix_C.take 71,by decide⟩ + · decide + · exact ⟨goodSuffix_C.drop 2,by decide⟩ + · exact ⟨goodSuffix_C.take 25,by decide⟩ + + +def initWords_D : WordList := [V] + +def initCodes_D : List CodeE := [ + .More CT 5 (.Stop 6), + .More CT 5 (.More CT 11 (.More CP1 23 (.More CP0 46 (.Stop 46)))), + .More CT 5 (.More CT 11 (.More CT 23 (.More CT 47 (.More CT 95 (.More CS11 47 (.More CP1 94 (.More + CP0 188 (.More CP0 375 (.Stop 375))))))))), + .More CT 5 (.More CT 11 (.More CT 23 (.More CT 47 (.More CT 95 (.More CT 191 (.More CS11 95 (.More + CT 190 (.More CT 381 (.More CT 763 (.More CS10 381 (.More CS00 190 (.More CS10 94 (.More CS11 + 46 (.More CP1 92 (.More CP0 184 (.More CP0 367 (.Stop 367))))))))))))))))), + .More CT 5 (.More CT 11 (.More CT 23 (.More CT 47 (.More CT 95 (.More CT 191 (.More CT 383 (.More + CS11 191 (.More CT 382 (.More CT 765 (.More CT 1531 (.More CP0 3063 (.More CP1 6125 (.More CT + 12250 (.More CT 24501 (.More CT 49003 (.More CS10 24501 (.More CS00 12250 (.More CS10 6124 + (.More CS10 3061 (.More CP1 6121 (.More CP0 12242 (.More CP0 24483 (.Stop + 24483))))))))))))))))))))))) +] + +def goodPrefix_D : WordList := [V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,K,Q,Q,V,V,V] + +def goodSuffix_D : WordList := [K,K,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q] + +theorem init_rounds_D : + Rounds (evalWords initWords_D default) (evalWords (goodPrefix_D ++ goodSuffix_D) (d0 +> (d1 +> + default))) := by + have h1 : Rounds (evalWords initWords_D default) (evalWords (goodPrefix_D ++ goodSuffix_D ++ + [K,Q]) default) := by + apply checkRoundsE_sound initCodes_D + decide + simpa [evalWords_append,evalWords] using h1 + +theorem init_good_D : + Good (evalWords (goodPrefix_D ++ goodSuffix_D) (d0 +> (d1 +> default))) := by + apply good_of_checks + · decide + · norm_num [goodPrefix_D,goodSuffix_D,wordScale] + · norm_num [goodPrefix_D,goodSuffix_D,wordMass,wordMassK,wordScale] + · exact ⟨goodPrefix_D.take 21,by decide⟩ + · decide + · exact ⟨goodSuffix_D.drop 2,by decide⟩ + · exact ⟨goodSuffix_D.take 7,by decide⟩ + + + +theorem initKind_good (kind : InitKind) : + ∃ r₁, Rounds (initTape kind) r₁ ∧ Good r₁ := by + cases kind + · exact ⟨_, init_rounds_A, init_good_A⟩ + · exact ⟨_, init_rounds_B, init_good_B⟩ + · exact ⟨_, init_rounds_C, init_good_C⟩ + · exact ⟨_, init_rounds_D, init_good_D⟩ + +inductive Num : Nat → BitWord → List Call → Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) + +def NumSide (cs : Call → HalfTape → HalfTape → Prop) (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs, Num k w hs → Side cs hs (w +> r) r' + +theorem numSide_zero {r r' : HalfTape} (h : NumSide cs 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl + +include R in +theorem numSide_T {n : Nat} {r r' : HalfTape} + (hI : NumSide cs ((1 + n) * 2) r r') : NumSide cs (1 + n) (t +> r) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil] + refine seg_apply (seg_cp_t R m) ?_ + have hN2 : Num ((1 + n) * 2) [] ([.cj] ++ [.ch] ^ (m * 2)) := by + have hm : (1 + n) * 2 = 2 + (m * 2) * 2 := by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil] + refine seg_apply (seg_cj_t R m) ?_ + have hN2 : Num ((1 + n) * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : (1 + n) * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + +include R in +theorem numSide_pair0 {n : Nat} {r r' : HalfTape} + (hI : NumSide cs (n * 2) r r') : NumSide cs (1 + n) (d1 +> (d0 +> r)) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil, ← append_assoc d1 d0 r] + cases m with + | zero => + have hn0 : n * 2 = 0 := by omega + rw [hn0] at hI + have hr' := numSide_zero hI + subst hr' + rw [← append_assoc t one r] + exact seg_apply R.r0e (Side.nil r) + | succ m => + have h1m : m + 1 = 1 + m := by omega + rw [h1m] + refine seg_apply (seg_cp_d1d0 R m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : n * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil, ← append_assoc d1 d0 r] + refine seg_apply (seg_cj_d1d0 R m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (m * 2)) := by + have hm : n * 2 = 2 + (m * 2) * 2 := by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 + +include R in +theorem numSide_pair1 {n : Nat} {r r' : HalfTape} + (hI : NumSide cs (1 + n * 2) r r') : NumSide cs (1 + n) (d1 +> (d1 +> r)) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil, ← append_assoc d1 d1 r] + refine seg_apply (seg_cp_d1d1 R m) ?_ + have hN1 : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ (m * 2)) := by + have hm : 1 + n * 2 = 1 + (m * 2) * 2 := by omega + rw [hm]; exact Num.odd (m * 2) + simpa using hI [] _ hN1 + | @even m => + simp only [append_nil, ← append_assoc d1 d1 r] + refine seg_apply (seg_cj_d1d1 R m) ?_ + have hN1 : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ (1 + m * 2)) := by + have hm : 1 + n * 2 = 1 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.odd (1 + m * 2) + simpa using hI [] _ hN1 + +include R in +theorem numSide_short00 {n : Nat} {r r' : HalfTape} + (hI : NumSide cs (n * 2) r r') : NumSide cs (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := numSide_zero hI + subst hr' + rw [← append_assoc d0 one r] + exact seg_apply R.r0i (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine seg_apply (seg_cj_d0d0 R n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using hI [] _ hN2 + +include R in +theorem numSide_short01 {n : Nat} {r r' : HalfTape} + (hI : NumSide cs (1 + n * 2) r r') : NumSide cs (2 + n * 4) (d1 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + refine seg_apply (seg_cj_d1d0_short R n) ?_ + simpa using hI [] _ (Num.odd n) + +include R in +theorem numSide_short10 {n : Nat} {r r' : HalfTape} + (hI : NumSide cs (n * 2) r r') : NumSide cs (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := numSide_zero hI + subst hr' + rw [← append_assoc d1 one r] + exact seg_apply (seg_cj_ch_d0 R) (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine seg_apply (seg_cj_d0d1 R n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using hI [] _ hN2 + +include R in +theorem numSide_short11 {n : Nat} {r r' : HalfTape} + (hI : NumSide cs (1 + n * 2) r r') : NumSide cs (4 + n * 4) (d1 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + refine seg_apply (seg_cj_d1d1_short R n) ?_ + simpa using hI [] _ (Num.odd n) + +include R in +theorem rincs_to_numSide {k : Nat} {r r' : HalfTape} (hI : RIncs k r r') : + NumSide cs k r r' := by + induction hI with + | zero r => + intro w hs hN + generalize hk : 0 = k0 at hN + cases hN with + | zero => exact Side.nil (one +> r) + | odd _ => omega + | even _ => omega + | T _ ih => exact numSide_T R ih + | pair0 _ ih => exact numSide_pair0 R ih + | pair1 _ ih => exact numSide_pair1 R ih + | short00 _ ih => exact numSide_short00 R ih + | short01 _ ih => exact numSide_short01 R ih + | short10 _ ih => exact numSide_short10 R ih + | short11 _ ih => exact numSide_short11 R ih + +theorem step_round_of_rincs6 {tm : Machine (Fin 2) (Fin 6)} + {fCR : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6)} + {fCL : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6)} + (R : SegRules (callStep tm fCR fCL)) + (h0z : ∀ r, (fCL lh r) [tm]⊢⁺ (fCR ([1] +> default) .ca r)) + (h0A : ∀ r, (fCL ([1] +> default) r) [tm]⊢⁺ (fCR lh .ch r)) + {r r' : HalfTape} (hI : RIncs 6 r r') : + (fCL lh r) [tm]⊢⁺ fCL lh (t +> r') := by + have hC := rincs_to_numSide R hI [] ([.cj] ++ [.ch] ^ 2) (Num.even 2) + have hS := seg_apply (seg_ca_ch R) hC + dsimp at hS + rcases hS with _ | ⟨hca, hrest⟩ + rcases hrest with _ | ⟨hch, hnil⟩ + cases hnil + exact stepPlus_trans (h0z r) + (stepPlus_trans (hca ([1] +> default)) + (stepPlus_trans (h0A _) (hch lh))) + +theorem stepStar_of_rounds {tm : Machine (Fin 2) (Fin 6)} + {fCR : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6)} + {fCL : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6)} + (R : SegRules (callStep tm fCR fCL)) + (h0z : ∀ r, (fCL lh r) [tm]⊢⁺ (fCR ([1] +> default) .ca r)) + (h0A : ∀ r, (fCL ([1] +> default) r) [tm]⊢⁺ (fCR lh .ch r)) + {r r' : HalfTape} (h : Rounds r r') : + (fCL lh r) [tm]⊢* fCL lh r' := by + induction h with + | refl _ => exact ⟨0, rfl⟩ + | next hR _ ih => + rcases step_round_of_rincs6 R h0z h0A hR with ⟨n, _, hn⟩ + rcases ih with ⟨m, hm⟩ + exact ⟨n + m, multiStep_trans_add tm _ _ _ n m hn hm⟩ + +theorem isSome_of_multiStep_add {tm : Machine (Fin 2) (Fin 6)} + {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep tm c (j + d) = some c') : + (multiStep tm c j).isSome := by + rw [multiStep_add_bind] at h + cases h_j : multiStep tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl + +theorem reach_good_arbitrarily_far {tm : Machine (Fin 2) (Fin 6)} + {fCR : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6)} + {fCL : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6)} + (R : SegRules (callStep tm fCR fCL)) + (h0z : ∀ r, (fCL lh r) [tm]⊢⁺ (fCR ([1] +> default) .ca r)) + (h0A : ∀ r, (fCL ([1] +> default) r) [tm]⊢⁺ (fCR lh .ch r)) + (kind : InitKind) + (h0B : (init []) [tm]⊢⁺ fCL lh (initTape kind)) + (m : Nat) : + ∃ N ≥ m, ∃ r, multiStep tm (init []) N = some (fCL lh r) ∧ Good r := by + induction m with + | zero => + rcases h0B with ⟨k1, _, hk1⟩ + rcases initKind_good kind with ⟨r₁, h_rnd, h_gd⟩ + rcases stepStar_of_rounds R h0z h0A h_rnd with ⟨k2, hk2⟩ + exact ⟨k1 + k2, Nat.zero_le _, _, multiStep_trans_add tm _ _ _ k1 k2 hk1 hk2, h_gd⟩ + | succ m ih => + rcases ih with ⟨N, hN, r, h_ms, h_good⟩ + rcases good_next_round h_good with ⟨r', hR, h_good'⟩ + rcases step_round_of_rincs6 R h0z h0A hR with ⟨k, hk_pos, h_step_k⟩ + exact ⟨N + k, Nat.add_le_add hN hk_pos, t +> r', + multiStep_trans_add tm _ _ _ N k h_ms h_step_k, h_good'⟩ + +end + +@[expose] public section + +theorem does_not_halt_of_seg_rules {tm : Machine (Fin 2) (Fin 6)} + {fCR : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6)} + {fCL : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6)} + (R : SegRules (callStep tm fCR fCL)) + (h0z : ∀ r, (fCL lh r) [tm]⊢⁺ (fCR ([1] +> default) .ca r)) + (h0A : ∀ r, (fCL ([1] +> default) r) [tm]⊢⁺ (fCR lh .ch r)) + (kind : InitKind) + (h0B : (init []) [tm]⊢⁺ fCL lh (initTape kind)) : + IsNotHalt tm := by + intro cfg h_reach + rcases h_reach with ⟨n, hn⟩ + rcases reach_good_arbitrarily_far R h0z h0A kind h0B (n + 1) with ⟨N, hN, _, h_N, _⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [← h_eq] at h_N + have h_some := isSome_of_multiStep_add h_N + rw [multiStep_succ_eq, hn] at h_some + exact h_some + +set_option maxHeartbeats 2000000 in +-- Justification: Finite symbolic execution of the 15 elementary SegRules and 3 stem steps. +theorem is_not_halt : IsNotHalt target := by + refine does_not_halt_of_seg_rules + (fCR := cfgCR false E C) (fCL := cfgCL false A) + (by prove_seg_rules) + (fun r => by + dsimp [cfgCL, cfgCR, callState, callWord, lh] + try simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute) + (fun r => by + dsimp [cfgCL, cfgCR, callState, callWord, lh] + try simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute) + .kindA + (by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + dsimp [initTape, cfgCL, lh, d1] + try simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute) + +end + +end BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LCHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LCHHH.lean new file mode 100644 index 00000000..a135953e --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LCHHH.lean @@ -0,0 +1,999 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LCHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LCHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +@[reducible] def holdout_0001_tm : Machine (Fin 2) (Fin 6) := target_tm +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 2000000 +@[simp] theorem zMz (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : HalfTape).head = 0 := rfl +@[simp] theorem zDt : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem zPs {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem zPt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,by omega,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ +local macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +local macro "gstep" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt]) +local macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | gstep))) +abbrev CCfg := Counter.CCfg (Fin 2) (Fin 6) +abbrev z04 (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev z0b (c : CCfg) : Option CCfg := Counter.bstep holdout_0001_tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep holdout_0001_tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (z04 c1) [holdout_0001_tm]⊢⁺ (z04 c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ +abbrev t : BitWord := [1,1,0,0] +abbrev d0 : BitWord := [0,0] +abbrev d1 : BitWord := [1,0] +abbrev one : BitWord := [1] +abbrev lh : HalfTape := [1,0,1] +> default +abbrev w_pre : BitWord := t ++ t ++ one +@[simp] theorem zDd : d0 +> (default : HalfTape) = default := by + simp [d0] +inductive Call where + | ch + | cj + | cp + | ca +def zCs : Call -> Fin 6 + | .ch => E + | .cj => C + | .cp => C + | .ca => E +def zCw : Call -> BitWord + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] + | .ca => [1,1,1,0,1,0] +def zCR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (r <{{zCs c}} (l <+ zCw c)) +def zCL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> r) {{A}}> l) +def zCf (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + zCL lh (w_pre +> r) +def z0f (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l,(zCR l c r1) [holdout_0001_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + z0f c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem z0g {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z0h {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem z0i {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z0j {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z0k {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0l (w : BitWord) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem z0m (ls : List Call) : Seg ls ls [] [] := by + intro r1 r2 h; exact h +theorem zSc {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases z0k h with ⟨r2,ha,hb⟩ + exact z0j (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS0 {ls1 ls2 ls3 : List Call} {w1 w2 v1 v2 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls2 ls3 v1 v2) : + Seg ls1 ls3 (w1 ++ v1) (w2 ++ v2) := by + intro r1 r2 h + rw [append_assoc,append_assoc] + exact h1 (v1 +> r1) (v2 +> r2) (h2 r1 r2 h) +theorem zS4 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [holdout_0001_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [holdout_0001_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [holdout_0001_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc1 (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [holdout_0001_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [holdout_0001_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [holdout_0001_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem z0n : Seg [.cp] [.ch] t (t ++ [0]) := + zS2 (mid := [1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0o : Seg [.cj] [.ch] t (t ++ one) := + zS2 (mid := [1,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0p : Seg [.ch] [.cj] (t ++ [0]) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0q : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0r : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0s : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1 d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0t : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0u : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0v : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0w : Seg [.cj] [.cp] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons,append_nil]; execute) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem H_T (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact z0l t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [zLp,h_eq,z0i] + exact zSg z0q ih +theorem zSa {w2 : BitWord} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact z0l w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq,z0i,zLp] + exact zSg hw ih +theorem z0x : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0y : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem z0z (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d0 d0 := + zSa z0x n +theorem z0A (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ n) d0 d1 := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg zH0 (zSa z0y n) +theorem z0B (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d1 d1 := + zSa z0y n +theorem z0C (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ (1 + n)) d1 d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg zH4 (zSa z0x n) +theorem z0D (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0n z0p) (H_T n) +theorem z0E (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0o zH2) (H_T n) +theorem z0F (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0r zH2) (H_T n) +theorem z0G (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0s (H_T n) +theorem z0H (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0t (H_T n) +theorem z0I (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [zLp',List.cons_append,List.nil_append] using zSg z0u (H_T n) +theorem z0J (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0v (zSg zH1 zH3) + have h1 := zSg h0 (zSa z0x n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0K (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0w (zSa z0x n) +theorem z0L : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0v zH1 +theorem z0M (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0v (zSg zH1 (zSg zH3 zH0)) + have h1 := zSg h0 (zSa z0y n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0N (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg [.cj,.ch] [.cp] d1 d1 := zSg z0w zH0 + have h1 := zSg h0 (zSa z0y n) + simpa only [zLp',List.cons_append,List.nil_append] using h1 +theorem z0O : Side [.ch] default (d1 +> default) := by + refine Side.cons (fun l => ?_) (Side.nil _) + unfold zCR zCL zCw zCs d1 + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute +theorem z0P : Seg [.ca] [.ch,.ch] t [1,1,0,0,0,1,1,0,0] := + zS5 + (mid1 := [1,0,1,1,1,1,0,1,0]) + (mid2 := [1,0,1,0,1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0Q : Seg [.ch] [.ch] [1,1,0,0,0,1,1,0,0] (t ++ t ++ one) := + zS2 + (mid := [1,1,0,1,1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0R : Seg [.ca,.ch] ([.cj] ++ [.ch] ^ 5) w_pre (w_pre ++ t) := by + have h1 : Seg [.ca,.ch] [.ch,.ch,.ch] t (t ++ t ++ one) := + zSg z0P z0Q + have h2 : Seg [.ch,.ch,.ch] ([.cj] ++ [.ch] ^ 5) (t ++ one) t := + zSg zH2 (H_T 2) + have h3 := zS0 h1 h2 + simpa only [w_pre,List.append_assoc,List.cons_append,List.nil_append] using h3 +theorem z0S (r : HalfTape) : + (zCL lh r) [holdout_0001_tm]⊢⁺ (zCR ([1] +> default) .ca r) := by + unfold zCL zCR lh zCw zCs + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute +theorem z0T (r : HalfTape) : + (zCL ([1] +> default) r) [holdout_0001_tm]⊢⁺ (zCR lh .ch r) := by + unfold zCL zCR lh zCw zCs + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute +open WordCalculus +open WordCalculus.Word +local notation "WordList" => List Word +def z3p : WordList := + [Q,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V] +def z3q : WordList := + [K,V,K,V,V,V,V,V,V,K,V,V,V,K,V] +theorem z3w (n : Nat) : + Copy (31 + 32 * n) (260 + 256 * n) z3p z3q (4617 + 4096 * n) (30684 + 32768 * n) := by + unfold z3p z3q + refine copy_step_d11 (n' := 16 + 16 * n) (k' := 128 + 128 * n) (m := 64 + 64 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 33 + 32 * n) (k' := 252 + 256 * n) (m := 125 + 128 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 17 + 16 * n) (k' := 124 + 128 * n) (m := 62 + 64 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 35 + 32 * n) (k' := 244 + 256 * n) (m := 121 + 128 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 71 + 64 * n) (k' := 484 + 512 * n) (m := 241 + 256 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 143 + 128 * n) (k' := 964 + 1024 * n) (m := 481 + 512 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 287 + 256 * n) (k' := 1924 + 2048 * n) (m := 961 + 1024 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 575 + 512 * n) (k' := 3844 + 4096 * n) (m := 1921 + 2048 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 1151 + 1024 * n) (k' := 7684 + 8192 * n) (m := 3841 + 4096 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 576 + 512 * n) (k' := 3840 + 4096 * n) (m := 1920 + 2048 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 1153 + 1024 * n) (k' := 7676 + 8192 * n) (m := 3837 + 4096 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 2307 + 2048 * n) (k' := 15348 + 16384 * n) (m := 7673 + 8192 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 4615 + 4096 * n) (k' := 30692 + 32768 * n) (m := 15345 + 16384 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 2308 + 2048 * n) (k' := 15344 + 16384 * n) (m := 7672 + 8192 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 4617 + 4096 * n) (k' := 30684 + 32768 * n) (m := 15341 + 16384 * n) (by omega) (by omega) (by omega) ?_ + exact Copy.nil _ _ +theorem z3x (q : Nat) (hQ : 5 <= q) : + CopyTwelve (List.replicate q V ++ z3p) (List.replicate q V ++ z3q) := by + have hPow : 2 ^ q = 32 * 2 ^ (q - 5) := by + have heq : q = 5 + (q - 5) := by omega + conv_lhs => rw [heq,Nat.pow_add] + have hPos := pow_two_pos (q - 5) + have hTs := copy_replicate_V q 0 8 + have hBase := z3w (2 ^ (q - 5) - 1) + have h1 : (1 + 0) * 2 ^ q - 1 = 31 + 32 * (2 ^ (q - 5) - 1) := by omega + have h2 : 4 + 8 * 2 ^ q = 260 + 256 * (2 ^ (q - 5) - 1) := by omega + rw [h1,h2] at hTs + exact ⟨_,_,copy_append hTs hBase⟩ +theorem z3y : isSafePrefix z3q = true := by decide +kernel +def z3K : WordList := + [K,Q,K,Q,Q,Q,Q,Q,K] ++ List.replicate 15 Q +def z3L : WordList := + [V,V,Q,V,Q,V,K,K,V,Q,K] +def u_5 : WordList := [V,V,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,K,K,Q,Q,Q,K,Q,Q,Q,Q,K,Q,K,K,Q,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,Q] +def z3M : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,Q,V,V,V,Q,V,V,Q,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,K,V,Q,Q,V,V,Q,V,K,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,Q,V,K,V,V,Q,V,V,V,V,Q,K,V,V,V,V,V,Q,V,Q,V,K,V,V,Q,K,Q,V,V,V,V,V,V,K,V,V,V,V,V,Q,V,V,V,V,V,K,K,K,K,K,Q,K,K,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,K,K,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,K,K,Q,K,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def z3N : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,Q,V,V,V,Q,V,V,Q,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,Q,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,Q,V,Q,V,V,Q,Q,K,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,Q,V,Q,V,Q,V,V,K,K,Q,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,Q,V,Q,V,V,Q,K,K,V,V,V,V,V,V,Q,V,V,V,V,V,V,V] +def z3O : WordList := [V,V,V,V,V,V,V,Q,V,Q,V,K,V,V,Q,V,Q,V,Q,K,V,V,K,V,V,V,K,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,K,V,Q,V,K,V,V,Q,K,Q,V,V,V,V,V,V,K,V,V,V,V,V,Q,V,V,V,V,V,V,K,K,K,K,K,K,Q,K,K,Q,K,Q,Q,Q,Q,K,Q,K,Q,K,Q,K,Q,K,Q,K,Q,Q,Q,K,K,K,Q,K,Q,K,K,K,K,K,K,K,K,K,K,K,K,K,Q,K,Q,Q,Q,K,K,Q,Q,K,K,Q,Q,K,K,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,Q,Q,Q,Q,K,Q,K,K,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,K,K,Q,K,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def z3P : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,Q,V,V,V,Q,V,V,Q,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,Q,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,Q,V,Q,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,Q,V,Q,V,Q,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,K,V,K,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,Q,V,Q,V,Q,Q,V,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,K,V,Q,V,V,Q,Q,K,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,Q,V,Q,V,Q,K,V,V,V,Q,Q,V,V,V,V,V,V,Q,V,K,V,V,V,Q,V,Q,V,V,Q,V,K,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,Q,V,Q,V,V,Q,K,K,V,V] +def z3Q : WordList := [V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,K,V,V,Q,V,Q,V,Q,K,K,V,V,V,V,Q,Q,V,V,K,K,V,Q,V,Q,V,V,Q,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,V,V,V,V,V,Q,V,K,V,V,V,V,K,K,V,K,Q,V,V,V,V,V,V,Q,V,Q,V,K,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,K,V,Q,V,K,V,V,Q,K,Q,V,V,V,V,V,V,K,V,V,V,V,V,Q,V,V,V,V,V,V,V,K,K,K,K,K,K,K,Q,K,K,Q,K,Q,Q,Q,Q,K,Q,K,Q,K,Q,K,K,K,K,Q,Q,Q,K,Q,Q,Q,K,K,K,Q,Q,K,K,K,Q,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,Q,K,K,Q,Q,K,K,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q,Q,K,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,K,Q,K,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,K,K,K,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,K,K,K,K,Q,K,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,K,K,Q,K,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def z3R : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,Q,V,V,V,Q,V,V,Q,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,Q,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,Q,V,Q,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,Q,V,Q,V,Q,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,K,V,K,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,Q,V,Q,V,Q,Q,V,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,K,V,K,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,Q,V,Q,V,Q,Q,V,V,V,Q,Q,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,Q,V,V,Q,V,Q,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,K,V,Q,V,V,Q,Q,K,V,V] +def z3S : WordList := [V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,Q,V,V,Q,V,Q,V,Q,K,Q,V,V,V,V,Q,Q,V,V,V,V,K,V,Q,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,Q,V,Q,V,V,Q,K,K,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,K,V,V,Q,V,Q,V,Q,K,Q,V,V,V,V,Q,Q,Q,K,V,V,K,Q,V,V,V,V,V,V,K,V,K,Q,K,Q,Q,Q,K,K,K,Q,Q,V,V,V,Q,V,K,Q,V,V,V,V,V,V,V,V,Q,V,K,V,K,V,Q,V,K,V,Q,V,V,V,V,V,V,V,Q,V,K,V,V,Q,V,V,V,V,V,V,V,K,Q,V,V,V,V,V,Q,V,V,Q,V,V,Q,V,V,V,V,V,Q,Q,Q,Q,V,V,V,V,V,V,V,Q,K,V,K,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,K,V,Q,V,K,V,V,Q,K,Q,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,V,V,V] +def z3T : WordList := [K,K,K,K,K,K,K,Q,Q,Q,K,K,Q,K,Q,Q,Q,Q,K,Q,K,Q,K,Q,K,K,K,K,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,K,K,K,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,Q,K,K,K,Q,Q,K,Q,K,K,Q,Q,Q,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,K,Q,Q,K,K,K,Q,K,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,K,K,K,K,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,K,K,Q,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,K,K,K,Q,K,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,K,Q,K,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,K,K,K,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,K,K,K,K,Q,K,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,K,K,Q,K,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def z3U : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,Q,V,V,V,Q,V,V,Q,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,Q,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,Q,V,Q,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,Q,V,Q,V,Q,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,K,V,K,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,Q,V,Q,V,Q,Q,V,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,K,V,K,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,Q,V,Q,V,Q,Q,V,V,V,Q,Q,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,Q,V,V,Q,V,Q,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,K,V,K,V,V,Q,V,V,V] +def z3V : WordList := [V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,Q,V,V,Q,V,Q,V,Q,Q,K,V,V,V,V,Q,Q,V,V,V,V,Q,V,K,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,K,V,Q,V,V,Q,Q,K,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,Q,V,Q,V,Q,K,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,K,V,V,Q,Q,Q,K,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,K,V,K,V,Q,V,K,V,V,V,V,V,V,V,Q,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,Q,V,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,Q,Q,V,Q,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,Q,V,Q,V,V,Q,K,K,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V] +def z3W : WordList := [V,V,V,V,Q,V,Q,V,K,V,V,Q,V,Q,V,Q,K,K,V,V,V,V,Q,Q,Q,K,V,V,V,V,V,Q,V,V,V,K,V,V,Q,Q,V,V,V,Q,V,Q,V,Q,V,V,Q,V,K,Q,V,V,V,V,V,V,V,Q,K,V,V,Q,V,Q,K,V,K,V,V,Q,V,V,V,V,Q,K,V,K,Q,Q,V,V,V,V,V,V,V,V,Q,V,K,K,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,Q,Q,V,K,V,V,V,V,V,Q,V,V,Q,V,V,Q,V,V,Q,V,V,V,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,Q,Q,Q,Q,V,V,V,V,V,V,V,Q,K,V,K,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,K,V,Q,V,K,V,V,Q,K,Q,V,V,V,V,V,V,K,V,V,V,V,V,Q,V,V,V,V,V,V,V] +def z3X : WordList := [K,K,K,K,K,K,K,K,Q,K,K,Q,K,Q,Q,Q,Q,K,Q,K,Q,K,Q,K,K,K,K,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,K,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,K,Q,Q,K,K,K,Q,Q,Q,Q,Q,K,Q,Q,K,K,K,K,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,Q,K,K,K,Q,Q,Q,K,K,K,Q,Q,K,K,K,K,K,K,K,K,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,Q,Q,K,Q,K,K,Q,Q,Q,K,Q,K,K,K,K,K,K,K,Q,K,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,K,Q,K,Q] +def z3Y : WordList := [Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,K,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,K,Q,K,K,Q,K,Q,K,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,Q,K,K,Q,K,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,K,Q,K,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,K,K,K,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,K,K,K,K,Q,K,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,K,K,Q,K,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +theorem z45 : EntrySpec 18 z3p z3K 11000 := entrySpec_of_checkEntrySpec (by decide +kernel) +set_option maxRecDepth 500000 in +theorem z46 : evalRounds 5 z3L = some u_5 := by decide +kernel +set_option maxRecDepth 500000 in +theorem z47 : evalRounds 5 u_5 = some z3M := by decide +kernel +set_option maxRecDepth 500000 in +theorem z48 : evalRounds 2 z3M = some (z3N ++ z3O) := by decide +kernel +set_option maxRecDepth 500000 in +theorem z49 : evalRounds 2 (z3N ++ z3O) = some (z3P ++ z3Q) := by decide +kernel +set_option maxRecDepth 500000 in +theorem z4a : + checkStepTwoPieces z3P z3Q 110434817290149211768284085870454066060546939462225549259006050933145647 7067168235385531200914694256602959202955917586119058258266247915060068152 1260824944739856172946394001775484681970160284962916614243143022817523291247800206387780525642753349635545663353377664 z3R z3S z3T = true := by decide +kernel +set_option maxRecDepth 500000 in +theorem z4b : + checkStepThreePieces (V :: z3R) (z3S ++ [V]) (z3T ++ [Q]) + 1766902070710385858937921437335091786398117464135613873040684957281812527 630451725914695248319732282316851358108579217770468995664483969260760571151030486379468182403867732674229876057702399 113076451955992548153983074076597066130126825388972272726165497219966302796 676910774998025375822660775135045812617818152164822448708937095293664528614370053480259847094293709720004454266978684988792836 1675949902787505483440020087106021837049676974903580799208465931217206203605325682553129796896712940054963540497648261454412042999479128922952102697101568 z3U z3V z3W z3X z3Y = true := by decide +kernel +set_option maxRecDepth 500000 in +theorem z4c : + checkEntryThreePieces 18 z3p z3K 11000 + (V :: z3U) z3V (z3W ++ [V]) z3X z3Y + 244 416 508 28269993083910161508169751504624082417804810888089862649298329268595458391 169232962271100938707715443929017058497083679336597570160963934441725064445424265138458712223603740228005634717572939333509119 838001039849071895726743081222718556285143149697103330185313006108943225172823266912222700929127475495397164689088385716467769609144035444689331281199359 28948472917924005384365825540735060395832126349404019352881489171041749393536 47079 4103 = true := by decide +kernel +theorem z4d : ∃ v,Rounds z3L v /\ AggState z3p 16 18 v := by + have h0_5 := evalRounds_sound 5 z3L u_5 z46 + have h5_10 := evalRounds_sound 5 u_5 z3M z47 + have h10_12 := evalRounds_sound 2 z3M (z3N ++ z3O) z48 + have h12_14 := evalRounds_sound 2 (z3N ++ z3O) (z3P ++ z3Q) z49 + have h14_15 := step_of_checkStepTwoPieces z3P z3Q 110434817290149211768284085870454066060546939462225549259006050933145647 7067168235385531200914694256602959202955917586119058258266247915060068152 1260824944739856172946394001775484681970160284962916614243143022817523291247800206387780525642753349635545663353377664 z3R z3S z3T z4a + have h15_16 := step_of_checkStepThreePieces (V :: z3R) (z3S ++ [V]) (z3T ++ [Q]) + 1766902070710385858937921437335091786398117464135613873040684957281812527 630451725914695248319732282316851358108579217770468995664483969260760571151030486379468182403867732674229876057702399 113076451955992548153983074076597066130126825388972272726165497219966302796 676910774998025375822660775135045812617818152164822448708937095293664528614370053480259847094293709720004454266978684988792836 1675949902787505483440020087106021837049676974903580799208465931217206203605325682553129796896712940054963540497648261454412042999479128922952102697101568 z3U z3V z3W z3X z3Y z4b + have hEq15 : V :: ((z3R ++ z3S) ++ V :: (z3T ++ [Q])) = + (V :: z3R) ++ (z3S ++ [V]) ++ (z3T ++ [Q]) := by + simp [List.append_assoc] + rw [hEq15] at h14_15 + have hEq16 : V :: ((z3U ++ z3V ++ z3W) ++ V :: ((z3X ++ z3Y) ++ [Q])) = + ((V :: z3U) ++ z3V ++ (z3W ++ [V])) ++ (z3X ++ z3Y) ++ [Q] := by + simp [List.append_assoc] + rw [hEq16] at h15_16 + have hGood := good_of_checkEntryThreePieces 18 z3p z3K 11000 + (V :: z3U) z3V (z3W ++ [V]) z3X z3Y + 244 416 508 28269993083910161508169751504624082417804810888089862649298329268595458391 169232962271100938707715443929017058497083679336597570160963934441725064445424265138458712223603740228005634717572939333509119 838001039849071895726743081222718556285143149697103330185313006108943225172823266912222700929127475495397164689088385716467769609144035444689331281199359 28948472917924005384365825540735060395832126349404019352881489171041749393536 47079 4103 + z45 z4c + refine ⟨_,?_,hGood⟩ + exact rounds_trans h0_5 (rounds_trans h5_10 (rounds_trans h10_12 (rounds_trans h12_14 + (Rounds.next h14_15 (Rounds.next h15_16 (Rounds.refl _)))))) +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) +theorem z4e {k : Nat} (hK : 0 < k) : ∃ hs,Num k [] hs := by + rcases even_or_odd_mul_two k with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · cases a with + | zero => omega + | succ a => + have heq : (a + 1) * 2 = 2 + a * 2 := by omega + rw [heq]; exact ⟨[.cj] ++ [.ch] ^ a,Num.even a⟩ + · exact ⟨[.cp] ++ [.ch] ^ a,Num.odd a⟩ +theorem z4f {k : Nat} {hs hs' : List Call} (h1 : Num k [] hs) (h2 : Num k [] hs') : + hs = hs' := by + cases h1 with + | @odd n => + generalize hk : 1 + n * 2 = k0 at h2 + cases h2 with + | @odd m => + have hnm : n = m := by omega + subst hnm; rfl + | even _ => omega + | @even n => + generalize hk : 2 + n * 2 = k0 at h2 + cases h2 with + | odd _ => omega + | @even m => + have hnm : n = m := by omega + subst hnm; rfl +def z4g (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs,Num k w hs -> Side hs (w +> r) r' +theorem z4h {r r' : HalfTape} (h : z4g 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl +theorem z4i {n : Nat} {r r' : HalfTape} + (hI : z4g (n * 2) r r') : z4g (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := z4h hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0v (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine zSc (z0J n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using hI [] _ hN2 +theorem z4j {n : Nat} {r r' : HalfTape} + (hI : z4g (n * 2) r r') : z4g (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := z4h hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0L (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine zSc (z0M n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using hI [] _ hN2 +theorem z4k {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hZ : A = 0) : + evalWords da default = default := by + induction hD with + | nil => rfl + | @zero A H u _ ih => + have hA0 : A = 0 := by omega + dsimp only [evalWords] + rw [ih hA0,zDd] + | one _ => omega +theorem z4l {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hPos : 0 < A) : + z4g ((A - 1) * 2) default (evalWords da default) := by + induction hD with + | nil => omega + | @zero A H u _ ih => + have hA_pos : 0 < A := by omega + have hIH := ih hA_pos + have hs := z4i hIH + rw [zDd] at hs + have heq : (A * 2 - 1) * 2 = 2 + (A - 1) * 4 := by omega + dsimp [evalWords] + rwa [heq] + | @one A H u hDu ih => + cases A with + | zero => + change z4g 0 default (d1 +> evalWords u default) + rw [z4k hDu rfl] + intro w hs hN + generalize hk : 0 = k0 at hN + cases hN with + | zero => + have hd : d1 +> (default : HalfTape) = one +> default := by simp [d1,one] + rw [hd]; exact Side.nil (one +> default) + | odd _ => omega + | even _ => omega + | succ A => + have hA_pos : 0 < A + 1 := by omega + have hIH := ih hA_pos + have heq_in : (A + 1 - 1) * 2 = A * 2 := by omega + rw [heq_in] at hIH + have hs := z4j hIH + rw [zDd] at hs + have heq : (1 + (A + 1) * 2 - 1) * 2 = 4 + A * 4 := by omega + dsimp [evalWords] + rwa [heq] +theorem zEd {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ∀ {A H : Nat},DigitVal A H v -> Seg ([Call.ch] ^ n) ([Call.ch] ^ b) (wordsToBits u) (wordsToBits v) := by + induction hI with + | nil n => + intro A H _ + exact z0m ([Call.ch] ^ n) + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | d00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0z _) (ih hD') + | d01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0A _) (ih hD') + | d10 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0B _) (ih hD') + | d11 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0C _) (ih hD') +theorem z4m {n : Nat} {hs hs' : List Call} + (hI : Num (3 + n) [] hs) (hJ : Num (2 + n * 2) [] hs') : + Seg hs ([Call.ch] ++ hs') t t := by + generalize hk1 : 3 + n = k1 at hI + generalize hk2 : 2 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = m * 2 := by omega + subst hq + rw [h1m] + exact z0D m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0E m +theorem z4n {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' (d1 ++ d0) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0F m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + have hq : q = m * 2 := by omega + subst hq + exact z0G m +theorem z4o {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' (d1 ++ d1) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | @odd q => + have hq : q = m * 2 := by omega + subst hq + exact z0H m + | even _ => omega + | @even m => + cases hJ with + | @odd q => + have hq : q = 1 + m * 2 := by omega + subst hq + exact z0I m + | even _ => omega +theorem z4p {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 2 + q * 2 := by omega + subst hm + exact z0J q +theorem z4q {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = q * 2 := by omega + subst hm + exact z0K q + | even _ => omega +theorem z4r {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 3 + q * 2 := by omega + subst hm + exact z0M q +theorem z4s {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = 1 + q * 2 := by omega + subst hm + exact z0N q + | even _ => omega +theorem z4t {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) : + ∀ {u : WordList} {n n' : Nat} {hs hs' : List Call}, + WordEffect n u n' v -> Num k [] hs -> Num k' [] hs' -> + Seg (([Call.ch] ^ n) ++ hs) (([Call.ch] ^ n') ++ hs') (wordsToBits u) (wordsToBits w) := by + induction hI with + | nil k => + intro u n n' hs hs' hE hN hN' + cases hE + rw [z4f hN hN'] + exact z0m (([Call.ch] ^ n) ++ hs') + | @T m _ _ _ _ _ _ ih => + intro u0 n0 n1 hs hs' hE hN hN' + cases hE with + | T hSub => + rcases z4e (by omega : 0 < 2 + m * 2) with ⟨hs0,hN0⟩ + have hIH := ih hSub hN0 hN' + have hStep := zSg (H_T n0) (z4m hN hN0) + have heq : ([Call.ch] ^ (n0 * 2)) ++ ([Call.ch] ++ hs0) = ([Call.ch] ^ (1 + n0 * 2)) ++ hs0 := by + have h1 : 1 + n0 * 2 = n0 * 2 + 1 := by omega + rw [h1,z0i,z0h,List.append_assoc] + rw [heq] at hStep + exact zS0 hStep hIH + | @pair0 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,K] ++ u) at hE + rcases wordEffect_split_output [Q,K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z4e hPos with ⟨hs0,hN0⟩ + have hD10 : DigitVal 1 2 [Q,K] := DigitVal.one (DigitVal.zero DigitVal.nil) + have hStep := zSg (zEd hL hD10) (z4n hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @pair1 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,Q] ++ u) at hE + rcases wordEffect_split_output [Q,Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z4e (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD11 : DigitVal 3 2 [Q,Q] := DigitVal.one (DigitVal.one DigitVal.nil) + have hStep := zSg (zEd hL hD11) (z4o hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short00 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z4e hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (z4p hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short01 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z4e (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (z4q hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short10 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z4e hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (z4r hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short11 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z4e (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (z4s hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') +theorem z4u {n : Nat} {r r' : HalfTape} + (hI : z4g (n * 2) r r') : z4g (1 + n) (d1 +> (d0 +> r)) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil,<- append_assoc d1 d0 r] + cases m with + | zero => + have hn0 : n * 2 = 0 := by omega + rw [hn0] at hI + have hr' := z4h hI + subst hr' + rw [<- append_assoc t one r] + exact zSc z0r (Side.nil r) + | succ m => + have h1m : m + 1 = 1 + m := by omega + rw [h1m] + refine zSc (z0F m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : n * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil,<- append_assoc d1 d0 r] + refine zSc (z0G m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (m * 2)) := by + have hm : n * 2 = 2 + (m * 2) * 2 := by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 +theorem z4v {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) {u : WordList} {r' : HalfTape} + (hE : WordEffect 0 u 1 v) (hK : 0 < k') (hC : z4g k' (d1 +> default) r') : + z4g k (evalWords u default) (evalWords w r') := by + intro w0 hs hN + have hPosK : 0 < k := phaseScan_pos_of_out_pos hI hK + have hw0 : w0 = [] := by cases hN <;> first | rfl | omega + subst hw0 + rcases z4e hK with ⟨hs',hN'⟩ + have hSeg := z4t hI hE hN hN' + dsimp at hSeg + have hSide := zSc hSeg (z0j z0O (hC [] hs' hN')) + rwa [wordsToBits_append_tape,wordsToBits_append_tape] at hSide +theorem z4w {orig out : WordList} (hS : Step orig out) : + ∃ r,z4g 12 (evalWords orig default) r /\ evalWords out default = t +> r := by + cases hS with + | intro eff k v a b J A da hE hI hDA hSum => + have hposJ := pow_two_pos J + have hPosK : 0 < k := by omega + have hDFull : DigitVal k (J + 1) (da ++ [Q]) := by + have h := digitVal_append hDA (DigitVal.one DigitVal.nil) + have heq : A + 1 * 2 ^ J = k := by omega + rwa [heq] at h + have hC0 : z4g ((k - 1) * 2) default (evalWords (da ++ [Q]) default) := + z4l hDFull hPosK + have hC1 : z4g k (d1 +> default) (evalWords (V :: (da ++ [Q])) default) := by + have h := z4u hC0 + have hk : 1 + (k - 1) = k := by omega + rwa [hk,zDd] at h + have hRun := z4v hI hE hPosK hC1 + rw [<- evalWords_append] at hRun + exact ⟨evalWords (v ++ V :: (da ++ [Q])) default,hRun,rfl⟩ +theorem z4x {r r' : HalfTape} (hI : z4g 12 r r') : + (zCf r) [holdout_0001_tm]⊢⁺ zCf (t +> r') := by + have h_num : Num 12 [] ([.cj] ++ [.ch] ^ 5) := Num.even 5 + have hC := hI [] ([.cj] ++ [.ch] ^ 5) h_num + have hS := zSc z0R hC + rcases hS with _ | ⟨hca,hrest⟩ + rcases hrest with _ | ⟨hch,hnil⟩ + cases hnil + have h1 := zPt (z0S (w_pre +> r)) (hca ([1] +> default)) + have h2 := zPt (z0T _) (hch lh) + have h3 := zPt h1 h2 + rwa [append_assoc] at h3 +theorem z4y {orig out : WordList} (hS : Step orig out) : + (zCf (evalWords orig default)) [holdout_0001_tm]⊢⁺ zCf (evalWords out default) := by + rcases z4w hS with ⟨r,hC,hEq⟩ + rw [hEq] + exact z4x hC +theorem z4z {u v : WordList} (hR : Rounds u v) : + (zCf (evalWords u default)) [holdout_0001_tm]⊢* zCf (evalWords v default) := by + induction hR with + | refl u => exact ⟨0,rfl⟩ + | next hS _ ih => + rcases z4y hS with ⟨n1,_,hn1⟩ + rcases ih with ⟨n2,hn2⟩ + exact ⟨n1 + n2,zMt holdout_0001_tm _ _ _ n1 n2 hn1 hn2⟩ +def z4A : CCfg := ⟨0,0,[],[]⟩ +def z4B : CCfg := ⟨0,1,[0,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,1,1,0,0,1],[0,1]⟩ +set_option maxRecDepth 500000 in +theorem z4C : zCm z4A 969 = some z4B := by decide +theorem z4D : + (init []) [holdout_0001_tm]⊢* zCf (evalWords z3L default) := by + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = z04 z4A := rfl + have h2 : z04 z4B = zCf (evalWords z3L default) := by + unfold z04 z4B zCf zCL lh w_pre z3L + simp only [List.replicate,List.cons_append,List.nil_append,evalWords,wordsToBits,t,d1,d0,one,append_cons,append_nil,z00] + rfl + have hPlus : (z04 z4A) [holdout_0001_tm]⊢⁺ (z04 z4B) := + zTc (by decide) z4C + rw [<- h0,h2] at hPlus + rcases hPlus with ⟨n,_,hn⟩ + exact ⟨n,hn⟩ +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep holdout_0001_tm c (j + d) = some c') : + (multiStep holdout_0001_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep holdout_0001_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +theorem z4E (m : Nat) : + ∃ N ≥ m,∃ p q w, + multiStep holdout_0001_tm (init []) N = some (zCf (evalWords w default)) /\ + AggState z3p p q w := by + induction m with + | zero => + rcases z4d with ⟨v0,hRounds,hGood0⟩ + rcases z4D with ⟨k1,hk1⟩ + rcases z4z hRounds with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,16,18,v0, + zMt holdout_0001_tm _ _ _ k1 k2 hk1 hk2,hGood0⟩ + | succ m ih => + rcases ih with ⟨N,hN,p,q,w,h_ms,h_good⟩ + rcases aggState_step_of_copyTwelve z3p z3q z3y z3x p q w h_good + with ⟨w',hStep,h_good'⟩ + rcases z4y hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,1 + p,1 + q,w', + zMt holdout_0001_tm _ _ _ N k h_ms h_step_k,h_good'⟩ +theorem holdout_0001_nonhalt : + IsDoesNotHalt holdout_0001_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases z4E (n + 1) with ⟨N,hN,_,_,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := zIm h_N + rw [zMs,hn] at h_some + exact h_some + + + +theorem is_does_not_halt : IsNotHalt target_tm := holdout_0001_nonhalt + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LCHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LDHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LDHHH.lean new file mode 100644 index 00000000..4173d0a5 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LDHHH.lean @@ -0,0 +1,72 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH + +open Mathlib Relation Nat Turing BusyBeaver SixState +open BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH + +namespace BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LDHHH + + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LDHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +section + +abbrev fCR_1ldhhh : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6) := + cfgCR false E C -- CR config for 1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LDHHH + +abbrev fCL_1ldhhh : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6) := + cfgCL false A -- CL config for 1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LDHHH + +set_option maxHeartbeats 2000000 in +-- Justification: Symbolic execution of the 15 elementary SegRules for +-- 1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LDHHH. +theorem segRules_1ldhhh : SegRules (callStep target fCR_1ldhhh fCL_1ldhhh) := by + unfold fCR_1ldhhh fCL_1ldhhh + prove_seg_rules + +theorem step_ca_1ldhhh (r : HalfTape) : + (fCL_1ldhhh lh r) [target]⊢⁺ (fCR_1ldhhh ([1] +> default) .ca r) := by + unfold fCL_1ldhhh fCR_1ldhhh cfgCL cfgCR callState callWord lh + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_ca for 1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LDHHH + +theorem step_ch_1ldhhh (r : HalfTape) : + (fCL_1ldhhh ([1] +> default) r) [target]⊢⁺ (fCR_1ldhhh lh .ch r) := by + unfold fCL_1ldhhh fCR_1ldhhh cfgCL cfgCR callState callWord lh + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_ch for 1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LDHHH + +theorem step_init_1ldhhh : + (init []) [target]⊢⁺ fCL_1ldhhh lh (initTape .kindA) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + unfold fCL_1ldhhh initTape cfgCL lh t d1 d0 + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_init for 1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LDHHH + +end + +public section + +theorem is_not_halt : IsNotHalt target := + does_not_halt_of_seg_rules segRules_1ldhhh step_ca_1ldhhh step_ch_1ldhhh .kindA step_init_1ldhhh + +end + +end BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LDHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH.lean new file mode 100644 index 00000000..2769737c --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH.lean @@ -0,0 +1,1244 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RA_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +private def A : Fin 6 := 0 +private def B : Fin 6 := 1 +private def C : Fin 6 := 2 +private def D : Fin 6 := 3 +private def E : Fin 6 := 4 +private def F : Fin 6 := 5 + +local notation "zB" => ListBlank (Fin 2) +local notation "zF" => List (Fin 2) + +set_option linter.unusedSectionVars false +set_option maxHeartbeats 2000000 + +@[simp] private theorem zMz (M : Machine (Fin 2) (Fin 6)) (config : Cfg (Fin 2) (Fin 6)) : + multiStep M config 0 = some config := rfl +@[simp] private theorem zMo (M : Machine (Fin 2) (Fin 6)) (config : Cfg (Fin 2) (Fin 6)) : + multiStep M config 1 = step M config := rfl +@[simp] private theorem zMs (M : Machine (Fin 2) (Fin 6)) (config : Cfg (Fin 2) (Fin 6)) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] +@[simp] private theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] private theorem zDh : (default : zB).head = 0 := rfl +@[simp] private theorem zDt : (default : zB).tail = default := rfl +@[simp] private theorem append_nil (s : zB) : ([] : zF) +> s = s := rfl +@[simp] private theorem append_cons (a : Fin 2) (l : zF) (s : zB) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] private theorem append_assoc (l1 l2 : zF) (s : zB) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append, append_cons, ih] + +private theorem zSm (tm : Machine (Fin 2) (Fin 6)) (c_1 c_2 : Cfg (Fin 2) (Fin 6)) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +private theorem z01 (tm : Machine (Fin 2) (Fin 6)) (c_1 c_2 : Cfg (Fin 2) (Fin 6)) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1, by decide, zSm tm c_1 c_2 h⟩ +private theorem zMa (tm : Machine (Fin 2) (Fin 6)) (c_1 : Cfg (Fin 2) (Fin 6)) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, zMs, ih, Option.bind_assoc] + simp_rw [zMs] +private theorem zMt (tm : Machine (Fin 2) (Fin 6)) (c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa, h₁]; simp [h₂] +private theorem zPs {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 : Cfg (Fin 2) (Fin 6)} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ +private theorem zPt {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, by omega, zMt tm c_1 c_2 c_3 n m hn hm⟩ +private theorem z02 {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), zMt tm c_1 c_2 c_3 n m hn hm⟩ +private theorem z03 {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ + +local macro "finish" : tactic => + `(tactic| exact ⟨0, rfl⟩) +local macro "gstep" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, z00, zDh, zDt]) +local macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | gstep))) + +private abbrev ld : zF := [1, 1, 0] +private abbrev d0 : zF := [0, 0, 0] +private abbrev d1 : zF := [1, 0, 0] +private abbrev w1ld : zF := [1, 1, 1, 0] +private abbrev w1d0 : zF := [1, 0, 0, 0] +private abbrev w1d1 : zF := [1, 1, 0, 0] +private abbrev lh : zB := [1] +> default + +@[simp] private theorem zDd : d0 +> (default : zB) = default := by simp [d0] + +private theorem z1_eq : [1] +> (d1 +> (default : zB)) = ld +> default := by simp [d1, ld] +private theorem z0_eq : [1] +> (d0 +> (default : zB)) = d1 +> default := by simp [d0, d1] + +private inductive Call where + | ch + | ch' + +private def zCs : Call -> Fin 6 + | .ch => B + | .ch' => D + +private def zCw : Call -> zF + | .ch => [] + | .ch' => [1] + +private def zCR (l : zB) (c : Call) (r : zB) : Cfg (Fin 2) (Fin 6) := + ((zCw c +> l) {{zCs c}}> r) + +private def zCL (l : zB) (r : zB) : Cfg (Fin 2) (Fin 6) := + (l <{{C}} r) + +private def z04 (c : Call) (r1 r2 : zB) : Prop := + ∀ l, (zCR l c r1) [target_tm]⊢⁺ (zCL l r2) + +private inductive Side : List Call -> zB -> zB -> Prop where + | nil (r : zB) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : zB} : + z04 c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 + +private def Seg (ls_in ls_out : List Call) (w1 w2 : zF) : Prop := + ∀ r1 r2, Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) + +@[simp] private theorem z05 {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] private theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] private theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] private theorem z06 {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l + +private theorem z07 {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm, zLp, zLp, ih, List.append_assoc] + +private theorem z08 {ls1 ls2 : List Call} {r1 r2 r3 : zB} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) + +private theorem z09 {ls1 ls2 : List Call} {r1 r3 : zB} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2, Side ls1 r1 r2 ∧ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1, Side.nil r1, h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc, hrest⟩ + rcases ih hrest with ⟨r2, h1, h2⟩ + exact ⟨r2, Side.cons hc h1, h2⟩ + +private theorem z0a (w : zF) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) + +private theorem zSc {ls1 ls2 : List Call} {w1 w2 : zF} {r1 r2 : zB} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 + +private theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : zF} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases z09 h with ⟨r2, ha, hb⟩ + exact z08 (h1 r1 r2 ha) (h2 r2 r3 hb) + +private theorem zS4 {c : Call} {w1 w2 : zF} + (h1 : ∀ l r, (zCR l c (w1 +> r)) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) + +private theorem zS2 {c_in c_out : Call} {w1 w2 mid : zF} + (h1 : ∀ l r, (zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r, (zCL (mid +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc, hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc (mid +> l)) (h2 l r2)) + +private theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : zF} + (h1 : ∀ l r, (zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r, (zCL (mid1 +> l) r) [target_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r, (zCL (mid2 +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1, c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1, hrest⟩ + rcases hrest with _ | ⟨hc2, hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) + +private theorem seg_ch_d0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons, append_nil]; execute) + +private theorem seg_ch_d1 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid := [0, 0, 0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons, append_nil]; execute) + +private theorem seg_ch_ld : Seg [.ch] [.ch] ld ld := + zS2 (mid := [1, 1, 0]) + (fun l r => by unfold zCR zCw zCs ld; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold zCL ld; simp only [append_cons, append_nil]; execute) + +private theorem seg_ch'_ld_atom : Seg [.ch'] [.ch, .ch'] ld ld := + zS5 (mid1 := [1, 0, 1, 0]) (mid2 := [1, 1, 0]) + (fun l r => by unfold zCR zCw zCs ld; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold zCL ld; simp only [append_cons, append_nil]; execute) + +private theorem seg_ch_w1ld_atom : Seg [.ch] [.ch, .ch'] w1ld ld := + zS5 (mid1 := [1, 0, 1, 0]) (mid2 := [1, 1, 0]) + (fun l r => by unfold zCR zCw zCs w1ld; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold zCL ld; simp only [append_cons, append_nil]; execute) + +private theorem seg_ch'_d1 : Seg [.ch'] [] d1 (ld ++ [1]) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 ld; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +private theorem seg_ch'_d0_atom : Seg [.ch'] [.ch', .ch] d0 ld := + zS5 (mid1 := [1, 1, 1]) (mid2 := [1, 1, 0]) + (fun l r => by unfold zCR zCw zCs d0; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold zCL ld; simp only [append_cons, append_nil]; execute) + +private theorem seg_ch_1d1 : Seg [.ch] [] ([1] ++ d1) (ld ++ [1]) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 ld; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +private theorem seg_ch_1d0 : Seg [.ch] [] ([1] ++ d0) (d0 ++ [1]) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +private theorem seg_wall_ld (k : Nat) : Seg ([.ch] ^ k) ([.ch] ^ k) ld ld := by + induction k with + | zero => exact z0a ld + | succ k ih => + rw [zLp] + exact zSg seg_ch_ld ih + +private theorem zSa {w2 : zF} (hw : Seg [.ch, .ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact z0a w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq, z07, zLp] + exact zSg hw ih + +private theorem seg_ch2_d0 : Seg [.ch, .ch] [.ch] d0 d0 := zSg seg_ch_d0 seg_ch_d1 +private theorem seg_ch2_d1 : Seg [.ch, .ch] [.ch] d1 d1 := zSg seg_ch_d1 seg_ch_d0 + +private theorem seg_d0_even (k : Nat) : Seg ([.ch] ^ (k * 2)) ([.ch] ^ k) d0 d0 := + zSa seg_ch2_d0 k + +private theorem seg_d1_even (k : Nat) : Seg ([.ch] ^ (k * 2)) ([.ch] ^ k) d1 d1 := + zSa seg_ch2_d1 k + +private theorem seg_d0_odd (k : Nat) : Seg ([.ch] ^ (1 + k * 2)) ([.ch] ^ k) d0 d1 := by + simpa only [zLp', List.cons_append, List.nil_append] using zSg seg_ch_d0 (seg_d1_even k) + +private theorem seg_hx_ld (k : Nat) : Seg ([.ch'] ++ [.ch] ^ k) ([.ch] ++ ([.ch'] ++ [.ch] ^ k)) ld ld := by + simpa only [List.cons_append, List.nil_append] using zSg seg_ch'_ld_atom (seg_wall_ld k) + +private theorem seg_h1_ld (k : Nat) : Seg ([.ch] ^ (1 + k)) ([.ch] ++ ([.ch'] ++ [.ch] ^ k)) w1ld ld := by + simpa only [zLp', List.cons_append, List.nil_append] using zSg seg_ch_w1ld_atom (seg_wall_ld k) + +private theorem seg_hx_d0 (k : Nat) : Seg ([.ch'] ++ [.ch] ^ k) ([.ch'] ++ [.ch] ^ (1 + k)) d0 ld := by + simpa only [zLp', List.cons_append, List.nil_append] using zSg seg_ch'_d0_atom (seg_wall_ld k) + +private inductive RD where + | LD + | D0 + | D1 + | W1LD + | W1D0 + | W1D1 +deriving DecidableEq + +private inductive H where + | hi + | hx + | h1 +deriving DecidableEq + + +private def toRC : List RD -> zB + | [] => default + | RD.LD :: ls => ld +> toRC ls + | RD.D0 :: ls => d0 +> toRC ls + | RD.D1 :: ls => d1 +> toRC ls + | RD.W1LD :: ls => w1ld +> toRC ls + | RD.W1D0 :: ls => w1d0 +> toRC ls + | RD.W1D1 :: ls => w1d1 +> toRC ls + +private def toH' : H -> zF + | H.hi => [] + | H.hx => [] + | H.h1 => [1] + +private def toH : H -> List Call + | H.hi => [.ch] + | H.hx => [.ch'] + | H.h1 => [] + +private inductive RIncs : H -> Nat -> List RD -> List RD -> Prop where + | hi_nil : RIncs H.hi 0 [] [RD.D1] + | hi_d0 (r : List RD) : RIncs H.hi 0 (RD.D0 :: r) (RD.D1 :: r) + | hi_d1 {r r' : List RD} : RIncs H.hi 0 r r' -> RIncs H.hi 0 (RD.D1 :: r) (RD.D0 :: r') + | hi_ld {r r' : List RD} : RIncs H.hi 0 r r' -> RIncs H.hi 0 (RD.LD :: r) (RD.LD :: r') + | hi_w1d0 {r r' : List RD} : RIncs H.h1 0 r r' -> RIncs H.hi 0 (RD.W1D0 :: r) (RD.D0 :: r') + | hi_w1d1 {r r' : List RD} : RIncs H.h1 0 r r' -> RIncs H.hi 0 (RD.W1D1 :: r) (RD.LD :: r') + | hi_w1ld {r r1 r' : List RD} : + RIncs H.hi 0 r r1 -> RIncs H.hx 0 r1 r' -> RIncs H.hi 0 (RD.W1LD :: r) (RD.LD :: r') + | hx_ld {k : Nat} {r r1 r' : List RD} : + RIncs H.hi 0 r r1 -> RIncs H.hx k r1 r' -> RIncs H.hx k (RD.LD :: r) (RD.LD :: r') + | hx_d1 {k : Nat} {r r' : List RD} : + RIncs H.h1 k r r' -> RIncs H.hx k (RD.D1 :: r) (RD.LD :: r') + | hx_d0 {k : Nat} {r r' : List RD} : + RIncs H.hx (1 + k) r r' -> RIncs H.hx k (RD.D0 :: r) (RD.LD :: r') + | h1_ld {k : Nat} {r r1 r' : List RD} : + RIncs H.hi 0 r r1 -> RIncs H.hx k r1 r' -> RIncs H.h1 (1 + k) (RD.LD :: r) (RD.LD :: r') + | h1_d1 {k : Nat} {r r' : List RD} : + RIncs H.h1 k r r' -> RIncs H.h1 (1 + k) (RD.D1 :: r) (RD.LD :: r') + | h1_d0_0 {k : Nat} {r r' : List RD} : + RIncs H.h1 k r r' -> RIncs H.h1 (1 + k * 2) (RD.D0 :: r) (RD.D0 :: r') + | h1_d0_1 {k : Nat} {r r' : List RD} : + RIncs H.h1 k r r' -> RIncs H.h1 (2 + k * 2) (RD.D0 :: r) (RD.D1 :: r') + | h1_rh_0 : + RIncs H.h1 0 [] [RD.D1] + | h1_rh_1 {k : Nat} {r' : List RD} : + RIncs H.h1 k [] r' -> RIncs H.h1 (1 + k * 2) [] (RD.D0 :: r') + | h1_rh_2 {k : Nat} {r' : List RD} : + RIncs H.h1 k [] r' -> RIncs H.h1 (2 + k * 2) [] (RD.D1 :: r') + | h1_z1 : + RIncs H.h1 0 [RD.D1] [RD.LD] + | h1_z0 : + RIncs H.h1 0 [RD.D0] [RD.D1] + | h1_z_ld {r r1 r2 : List RD} : + RIncs H.hi 0 r r1 -> RIncs H.hx 0 r1 r2 -> RIncs H.h1 0 (RD.LD :: r) (RD.W1LD :: r) + | h1_z_d1 {r r1 : List RD} : + r ≠ [] -> RIncs H.h1 0 r r1 -> RIncs H.h1 0 (RD.D1 :: r) (RD.W1D1 :: r) + | h1_z_d0 {r r1 : List RD} : + r ≠ [] -> RIncs H.h1 0 r r1 -> RIncs H.h1 0 (RD.D0 :: r) (RD.W1D0 :: r) + +private theorem side_nil_eq {r1 r2 : zB} (h : Side [] r1 r2) : r1 = r2 := by + cases h; rfl + +private theorem RIncs_spec {tp : H} {k : Nat} {r r' : List RD} (h : RIncs tp k r r') : + Side (toH tp ++ [.ch] ^ k) (toH' tp +> toRC r) (toRC r') := by + induction h with + | hi_nil => + simp only [toH, toH', toRC, z05, List.append_nil, append_nil] + simpa only [zDd] using zSc seg_ch_d0 (Side.nil default) + | hi_d0 r => + simp only [toH, toH', toRC, z05, List.append_nil, append_nil] + exact zSc seg_ch_d0 (Side.nil (toRC r)) + | hi_d1 _ ih => + simp only [toH, toH', toRC, z05, List.append_nil, append_nil] at ih ⊢ + exact zSc seg_ch_d1 ih + | hi_ld _ ih => + simp only [toH, toH', toRC, z05, List.append_nil, append_nil] at ih ⊢ + exact zSc seg_ch_ld ih + | hi_w1d0 _ ih => + simp only [toH, toH', toRC, z05, List.append_nil, append_nil] at ih ⊢ + have heq := side_nil_eq ih + have hw : w1d0 = [1] ++ d0 := rfl + rw [hw, <- heq, <- append_assoc d0 [1] (toRC _)] + exact zSc seg_ch_1d0 (Side.nil _) + | hi_w1d1 _ ih => + simp only [toH, toH', toRC, z05, List.append_nil, append_nil] at ih ⊢ + have heq := side_nil_eq ih + have hw : w1d1 = [1] ++ d1 := rfl + rw [hw, <- heq, <- append_assoc ld [1] (toRC _)] + exact zSc seg_ch_1d1 (Side.nil _) + | hi_w1ld _ _ ih1 ih2 => + simp only [toH, toH', toRC, z05, List.append_nil, append_nil] at ih1 ih2 ⊢ + exact zSc seg_ch_w1ld_atom (z08 ih1 ih2) + | @hx_ld k r r1 r' _ _ ih1 ih2 => + simp only [toH, toH', toRC, z05, List.append_nil, append_nil] at ih1 ih2 ⊢ + exact zSc (seg_hx_ld k) (z08 ih1 ih2) + | @hx_d1 k r r' _ ih => + simp only [toH, toH', toRC, append_nil, List.nil_append] at ih ⊢ + have H.h1 := zSc seg_ch'_d1 (Side.nil (toRC r)) + rw [append_assoc] at H.h1 + have h2 := zSc (seg_wall_ld k) ih + exact z08 H.h1 h2 + | @hx_d0 k r r' _ ih => + simp only [toH, toH', toRC, append_nil] at ih ⊢ + exact zSc (seg_hx_d0 k) ih + | @h1_ld k r r1 r' _ _ ih1 ih2 => + simp only [toH, toH', toRC, z05, List.append_nil, append_nil, List.nil_append] at ih1 ih2 ⊢ + have hw : [1] +> (ld +> toRC r) = w1ld +> toRC r := rfl + rw [hw] + exact zSc (seg_h1_ld k) (z08 ih1 ih2) + | @h1_d1 k r r' _ ih => + simp only [toH, toH', toRC, List.nil_append] at ih ⊢ + rw [zLp', <- append_assoc [1] d1 (toRC r)] + have H.h1 := zSc seg_ch_1d1 (Side.nil (toRC r)) + rw [append_assoc] at H.h1 + have h2 := zSc (seg_wall_ld k) ih + exact z08 H.h1 h2 + | @h1_d0_0 k r r' _ ih => + simp only [toH, toH', toRC, List.nil_append] at ih ⊢ + rw [zLp', <- append_assoc [1] d0 (toRC r)] + have H.h1 := zSc seg_ch_1d0 (Side.nil (toRC r)) + rw [append_assoc] at H.h1 + have h2 := zSc (seg_d0_even k) ih + exact z08 H.h1 h2 + | @h1_d0_1 k r r' _ ih => + simp only [toH, toH', toRC, List.nil_append] at ih ⊢ + have hk : 2 + k * 2 = 1 + (1 + k * 2) := by omega + rw [hk, zLp', <- append_assoc [1] d0 (toRC r)] + have H.h1 := zSc seg_ch_1d0 (Side.nil (toRC r)) + rw [append_assoc] at H.h1 + have h2 := zSc (seg_d0_odd k) ih + exact z08 H.h1 h2 + | h1_rh_0 => + simp only [toH, toH', toRC, z05, List.append_nil, <- z0_eq, zDd] + exact Side.nil ([1] +> default) + | @h1_rh_1 k r' _ ih => + simp only [toH, toH', toRC, List.nil_append] at ih ⊢ + have h_in : [1] +> (default : zB) = ([1] ++ d0) +> default := by + rw [append_assoc, zDd] + rw [zLp', h_in] + have H.h1 := zSc seg_ch_1d0 (Side.nil default) + rw [append_assoc] at H.h1 + have h2 := zSc (seg_d0_even k) ih + exact z08 H.h1 h2 + | @h1_rh_2 k r' _ ih => + simp only [toH, toH', toRC, List.nil_append] at ih ⊢ + have hk : 2 + k * 2 = 1 + (1 + k * 2) := by omega + have h_in : [1] +> (default : zB) = ([1] ++ d0) +> default := by + rw [append_assoc, zDd] + rw [hk, zLp', h_in] + have H.h1 := zSc seg_ch_1d0 (Side.nil default) + rw [append_assoc] at H.h1 + have h2 := zSc (seg_d0_odd k) ih + exact z08 H.h1 h2 + | h1_z1 => + simp only [toH, toH', toRC, z05, List.append_nil, z1_eq] + exact Side.nil (ld +> default) + | h1_z0 => + simp only [toH, toH', toRC, z05, List.append_nil, z0_eq] + exact Side.nil (d1 +> default) + | h1_z_ld _ _ _ _ => + simp only [toH, toH', toRC, z05, List.append_nil] + exact Side.nil _ + | h1_z_d1 _ _ _ => + simp only [toH, toH', toRC, z05, List.append_nil] + exact Side.nil _ + | h1_z_d0 _ _ _ => + simp only [toH, toH', toRC, z05, List.append_nil] + exact Side.nil _ + +private theorem RIncs_eqk {tp : H} {k k' : Nat} {r r' : List RD} + (h : RIncs tp k r r') (hk : k = k') : RIncs tp k' r r' := by + subst hk; exact h + +private theorem RIncs_fun {tp : H} {k : Nat} {r r1 r2 : List RD} + (h1 : RIncs tp k r r1) (h2 : RIncs tp k r r2) : r1 = r2 := by + induction h1 generalizing r2 with + | hi_nil => cases h2; rfl + | hi_d0 _ => cases h2; rfl + | hi_d1 _ ih => cases h2 with | hi_d1 h2' => rw [ih h2'] + | hi_ld _ ih => cases h2 with | hi_ld h2' => rw [ih h2'] + | hi_w1d0 _ ih => cases h2 with | hi_w1d0 h2' => rw [ih h2'] + | hi_w1d1 _ ih => cases h2 with | hi_w1d1 h2' => rw [ih h2'] + | hi_w1ld _ _ ih1 ih2 => + cases h2 with | hi_w1ld h2a h2b => rw [← ih1 h2a] at h2b; rw [ih2 h2b] + | hx_ld _ _ ih1 ih2 => + cases h2 with | hx_ld h2a h2b => rw [← ih1 h2a] at h2b; rw [ih2 h2b] + | hx_d1 _ ih => cases h2 with | hx_d1 h2' => rw [ih h2'] + | hx_d0 _ ih => cases h2 with | hx_d0 h2' => rw [ih h2'] + | @h1_ld k0 r r1_a r'_a h1a h1b ih1 ih2 => + generalize hk : 1 + k0 = K at h2 + cases h2 with + | @h1_ld k2 _ _ _ h2a h2b => + have hk' : k2 = k0 := by omega + subst hk'; rw [← ih1 h2a] at h2b; rw [ih2 h2b] + | h1_z_ld _ _ => omega + | @h1_d1 k0 r r'_a h1a ih => + generalize hk : 1 + k0 = K at h2 + cases h2 with + | @h1_d1 k2 _ _ h2a => + have hk' : k2 = k0 := by omega + subst hk'; rw [ih h2a] + | h1_z1 => omega + | h1_z_d1 _ _ => omega + | @h1_d0_0 k0 r r'_a h1a ih => + generalize hk : 1 + k0 * 2 = K at h2 + cases h2 with + | @h1_d0_0 k2 _ _ h2a => + have hk' : k2 = k0 := by omega + subst hk'; rw [ih h2a] + | @h1_d0_1 k2 _ _ _ => omega + | h1_z0 => omega + | h1_z_d0 _ _ => omega + | @h1_d0_1 k0 r r'_a h1a ih => + generalize hk : 2 + k0 * 2 = K at h2 + cases h2 with + | @h1_d0_0 k2 _ _ _ => omega + | @h1_d0_1 k2 _ _ h2a => + have hk' : k2 = k0 := by omega + subst hk'; rw [ih h2a] + | h1_z0 => omega + | h1_z_d0 _ _ => omega + | h1_rh_0 => + generalize hk : (0 : Nat) = K at h2 + cases h2 with + | h1_rh_0 => rfl + | h1_rh_1 _ => omega + | h1_rh_2 _ => omega + | @h1_rh_1 k0 r'_a h1a ih => + generalize hk : 1 + k0 * 2 = K at h2 + cases h2 with + | h1_rh_0 => omega + | @h1_rh_1 k2 _ h2a => + have hk' : k2 = k0 := by omega + subst hk'; rw [ih h2a] + | @h1_rh_2 k2 _ _ => omega + | @h1_rh_2 k0 r'_a h1a ih => + generalize hk : 2 + k0 * 2 = K at h2 + cases h2 with + | h1_rh_0 => omega + | @h1_rh_1 k2 _ _ => omega + | @h1_rh_2 k2 _ h2a => + have hk' : k2 = k0 := by omega + subst hk'; rw [ih h2a] + | h1_z1 => + generalize hk : (0 : Nat) = K at h2 + cases h2 with + | h1_d1 _ => omega + | h1_z1 => rfl + | h1_z_d1 hne _ => exact False.elim (hne rfl) + | h1_z0 => + generalize hk : (0 : Nat) = K at h2 + cases h2 with + | h1_d0_0 _ => omega + | h1_d0_1 _ => omega + | h1_z0 => rfl + | h1_z_d0 hne _ => exact False.elim (hne rfl) + | h1_z_ld _ _ _ _ => + generalize hk : (0 : Nat) = K at h2 + cases h2 with + | h1_ld _ _ => omega + | h1_z_ld _ _ => rfl + | h1_z_d1 hne _ _ => + generalize hk : (0 : Nat) = K at h2 + cases h2 with + | h1_d1 _ => omega + | h1_z1 => exact False.elim (hne rfl) + | h1_z_d1 _ _ => rfl + | h1_z_d0 hne _ _ => + generalize hk : (0 : Nat) = K at h2 + cases h2 with + | h1_d0_0 _ => omega + | h1_d0_1 _ => omega + | h1_z0 => exact False.elim (hne rfl) + | h1_z_d0 _ _ => rfl + +private theorem RIncs_step {tp : H} {k : Nat} {r r' : List RD} + (h : RIncs tp k r r') (htp : tp ≠ H.hi) : + ∃ r'', RIncs H.hi 0 r' r'' ∧ RIncs tp (1 + k) r r'' := by + induction h with + | hi_nil => exact absurd rfl htp + | hi_d0 _ => exact absurd rfl htp + | hi_d1 _ _ => exact absurd rfl htp + | hi_ld _ _ => exact absurd rfl htp + | hi_w1d0 _ _ => exact absurd rfl htp + | hi_w1d1 _ _ => exact absurd rfl htp + | hi_w1ld _ _ _ _ => exact absurd rfl htp + | hx_ld h_inc _ _ ih => + rcases ih (by decide) with ⟨r'', hJ, h_ri'⟩ + exact ⟨RD.LD :: r'', RIncs.hi_ld hJ, RIncs.hx_ld h_inc h_ri'⟩ + | hx_d1 _ ih => + rcases ih (by decide) with ⟨r'', hJ, h_ri'⟩ + exact ⟨RD.LD :: r'', RIncs.hi_ld hJ, RIncs.hx_d1 h_ri'⟩ + | hx_d0 _ ih => + rcases ih (by decide) with ⟨r'', hJ, h_ri'⟩ + exact ⟨RD.LD :: r'', RIncs.hi_ld hJ, RIncs.hx_d0 h_ri'⟩ + | h1_ld h_inc _ _ ih => + rcases ih (by decide) with ⟨r'', hJ, h_ri'⟩ + exact ⟨RD.LD :: r'', RIncs.hi_ld hJ, RIncs.h1_ld h_inc h_ri'⟩ + | h1_d1 _ ih => + rcases ih (by decide) with ⟨r'', hJ, h_ri'⟩ + exact ⟨RD.LD :: r'', RIncs.hi_ld hJ, RIncs.h1_d1 h_ri'⟩ + | @h1_d0_0 k r r' h_ri _ => + exact ⟨RD.D1 :: r', RIncs.hi_d0 r', RIncs_eqk (RIncs.h1_d0_1 h_ri) (by omega)⟩ + | @h1_d0_1 k r r' _ ih => + rcases ih (by decide) with ⟨r'', hJ, h_ri'⟩ + exact ⟨RD.D0 :: r'', RIncs.hi_d1 hJ, RIncs_eqk (RIncs.h1_d0_0 h_ri') (by omega)⟩ + | h1_rh_0 => + exact ⟨[RD.D0, RD.D1], RIncs.hi_d1 RIncs.hi_nil, RIncs.h1_rh_1 RIncs.h1_rh_0⟩ + | @h1_rh_1 k r' h_ri _ => + exact ⟨RD.D1 :: r', RIncs.hi_d0 r', RIncs_eqk (RIncs.h1_rh_2 h_ri) (by omega)⟩ + | @h1_rh_2 k r' _ ih => + rcases ih (by decide) with ⟨r'', hJ, h_ri'⟩ + exact ⟨RD.D0 :: r'', RIncs.hi_d1 hJ, RIncs_eqk (RIncs.h1_rh_1 h_ri') (by omega)⟩ + | h1_z1 => + exact ⟨[RD.LD, RD.D1], RIncs.hi_ld RIncs.hi_nil, RIncs.h1_d1 RIncs.h1_rh_0⟩ + | h1_z0 => + exact ⟨[RD.D0, RD.D1], RIncs.hi_d1 RIncs.hi_nil, RIncs.h1_d0_0 RIncs.h1_rh_0⟩ + | h1_z_ld h_inc h_ri _ _ => + exact ⟨RD.LD :: _, RIncs.hi_w1ld h_inc h_ri, RIncs.h1_ld h_inc h_ri⟩ + | h1_z_d1 _ h_ri _ => + exact ⟨RD.LD :: _, RIncs.hi_w1d1 h_ri, RIncs.h1_d1 h_ri⟩ + | h1_z_d0 _ h_ri _ => + exact ⟨RD.D0 :: _, RIncs.hi_w1d0 h_ri, RIncs.h1_d0_0 h_ri⟩ + +private theorem mod2 (n : Nat) : (∃ b, n = b * 2) ∨ (∃ b, n = 1 + b * 2) := by + rcases Nat.mod_two_eq_zero_or_one n with h | h + · left; exact ⟨n / 2, by omega⟩ + · right; exact ⟨n / 2, by omega⟩ + +private inductive Good : H -> Nat -> List RD -> Prop where + | hx_ld {k : Nat} {r r1 : List RD} : + RIncs H.hi 0 r r1 -> Good H.hx (1 + k) r1 -> Good H.hx k (RD.LD :: r) + | hx_d1 {k : Nat} {r : List RD} : + Good H.h1 (1 + k) r -> Good H.hx k (RD.D1 :: r) + | hx_d0 {k : Nat} {r : List RD} : + Good H.hx (1 + k) r -> Good H.hx k (RD.D0 :: r) + | h1_ld {k : Nat} {r r1 : List RD} : + RIncs H.hi 0 r r1 -> Good H.hx (1 + k) r1 -> Good H.h1 (1 + k) (RD.LD :: r) + | h1_d1 {k : Nat} {r : List RD} : + Good H.h1 (1 + k) r -> Good H.h1 (1 + k) (RD.D1 :: r) + | h1_d0_0 {a : Nat} {r : List RD} : + Good H.h1 a r -> Good H.h1 (1 + a * 2) (RD.D0 :: r) + | h1_d0_1 {a : Nat} {r : List RD} : + Good H.h1 a r -> Good H.h1 (2 + a * 2) (RD.D0 :: r) + | h1_z1 : + Good H.h1 0 [RD.D1] + | h1_nil {k : Nat} : + Good H.h1 k [] + +private theorem RIncs_nxt_1 (k : Nat) : ∃ r, RIncs H.h1 k [] r := by + induction k using Nat.strong_induction_on with + | h k ih => + cases k with + | zero => exact ⟨[RD.D1], RIncs.h1_rh_0⟩ + | succ m => + rcases mod2 m with ⟨b, rfl⟩ | ⟨b, rfl⟩ + · rcases ih b (by omega) with ⟨r, hI⟩ + exact ⟨RD.D0 :: r, RIncs_eqk (RIncs.h1_rh_1 hI) (by omega)⟩ + · rcases ih b (by omega) with ⟨r, hI⟩ + exact ⟨RD.D1 :: r, RIncs_eqk (RIncs.h1_rh_2 hI) (by omega)⟩ + +private theorem rK_nonnil {k : Nat} {r rK : List RD} (h : RIncs H.h1 k r rK) : rK ≠ [] := by + cases h <;> simp + +private theorem inv_hx_ld {k : Nat} {r rK : List RD} (h : RIncs H.hx k (RD.LD :: r) rK) : + ∃ r1 rK', RIncs H.hi 0 r r1 ∧ RIncs H.hx k r1 rK' ∧ rK = RD.LD :: rK' := by + cases h with + | hx_ld h_inc h_ri => exact ⟨_, _, h_inc, h_ri, rfl⟩ + +private theorem inv_hx_d1 {k : Nat} {r rK : List RD} (h : RIncs H.hx k (RD.D1 :: r) rK) : + ∃ rK', RIncs H.h1 k r rK' ∧ rK = RD.LD :: rK' := by + cases h with + | hx_d1 h_ri => exact ⟨_, h_ri, rfl⟩ + +private theorem inv_hx_d0 {k : Nat} {r rK : List RD} (h : RIncs H.hx k (RD.D0 :: r) rK) : + ∃ rK', RIncs H.hx (1 + k) r rK' ∧ rK = RD.LD :: rK' := by + cases h with + | hx_d0 h_ri => exact ⟨_, h_ri, rfl⟩ + +private theorem inv_h1_ld {k : Nat} {r rK : List RD} (h : RIncs H.h1 (1 + k) (RD.LD :: r) rK) : + ∃ r1 rK', RIncs H.hi 0 r r1 ∧ RIncs H.hx k r1 rK' ∧ rK = RD.LD :: rK' := by + generalize hk : 1 + k = K at h + cases h with + | @h1_ld k0 _ r1 rK' h_inc h_ri => + have hk0 : k0 = k := by omega + subst hk0 + exact ⟨r1, rK', h_inc, h_ri, rfl⟩ + | h1_z_ld _ _ => omega + +private theorem inv_h1_d1 {k : Nat} {r rK : List RD} (h : RIncs H.h1 (1 + k) (RD.D1 :: r) rK) : + ∃ rK', RIncs H.h1 k r rK' ∧ rK = RD.LD :: rK' := by + generalize hk : 1 + k = K at h + cases h with + | @h1_d1 k0 _ rK' h_ri => + have hk0 : k0 = k := by omega + subst hk0 + exact ⟨rK', h_ri, rfl⟩ + | h1_z1 => omega + | h1_z_d1 _ _ => omega + +private theorem inv_h1_d0 {K : Nat} {r rK : List RD} (h : RIncs H.h1 K (RD.D0 :: r) rK) (hK : 1 ≤ K) : + (∃ A rK', K = 1 + A * 2 ∧ RIncs H.h1 A r rK' ∧ rK = RD.D0 :: rK') ∨ + (∃ A rK', K = 2 + A * 2 ∧ RIncs H.h1 A r rK' ∧ rK = RD.D1 :: rK') := by + generalize hd : RD.D0 :: r = r0 at h + cases h with + | h1_ld _ _ => cases hd + | h1_d1 _ => cases hd + | @h1_d0_0 A r_in rK' h_ri => + injection hd with _ hr; subst hr + left; exact ⟨A, rK', rfl, h_ri, rfl⟩ + | @h1_d0_1 A r_in rK' h_ri => + injection hd with _ hr; subst hr + right; exact ⟨A, rK', rfl, h_ri, rfl⟩ + | h1_rh_0 => cases hd + | h1_rh_1 _ => cases hd + | h1_rh_2 _ => cases hd + | h1_z1 => cases hd + | h1_z0 => omega + | h1_z_ld _ _ => cases hd + | h1_z_d1 _ _ => cases hd + | h1_z_d0 _ _ => omega + +private theorem inv_z1 {K : Nat} {rK : List RD} (h : RIncs H.h1 K [RD.D1] rK) : + (K = 0 ∧ rK = [RD.LD]) ∨ + (∃ K0 rK', K = 1 + K0 ∧ RIncs H.h1 K0 [] rK' ∧ rK = RD.LD :: rK') := by + generalize hd : ([RD.D1] : List RD) = r0 at h + cases h with + | h1_ld _ _ => cases hd + | @h1_d1 K0 _ rK' h_ri => + injection hd with _ hr; subst hr + right; exact ⟨K0, rK', rfl, h_ri, rfl⟩ + | h1_d0_0 _ => cases hd + | h1_d0_1 _ => cases hd + | h1_rh_0 => cases hd + | h1_rh_1 _ => cases hd + | h1_rh_2 _ => cases hd + | h1_z1 => left; exact ⟨rfl, rfl⟩ + | h1_z0 => cases hd + | h1_z_ld _ _ => cases hd + | h1_z_d1 hne _ => injection hd with _ hr; subst hr; exact False.elim (hne rfl) + | h1_z_d0 _ _ => cases hd + +private theorem End_step {tp : H} {m : Nat} {e w : List RD} (h : RIncs tp m e w) + (htp : tp = H.h1) (he : e = []) : + ∀ tq q, (tq = H.hx ∨ tq = H.h1) -> ∃ w', RIncs tq q w w' := by + induction h with + | hi_nil => cases htp + | hi_d0 _ => cases htp + | hi_d1 _ _ => cases htp + | hi_ld _ _ => cases htp + | hi_w1d0 _ _ => cases htp + | hi_w1d1 _ _ => cases htp + | hi_w1ld _ _ _ _ => cases htp + | hx_ld _ _ _ _ => cases htp + | hx_d1 _ _ => cases htp + | hx_d0 _ _ => cases htp + | h1_ld _ _ _ _ => cases he + | h1_d1 _ _ => cases he + | h1_d0_0 _ _ => cases he + | h1_d0_1 _ _ => cases he + | h1_rh_0 => + intro tq q htq + rcases htq with rfl | rfl + · rcases RIncs_nxt_1 q with ⟨w', hI⟩ + exact ⟨RD.LD :: w', RIncs.hx_d1 hI⟩ + · cases q with + | zero => exact ⟨[RD.LD], RIncs.h1_z1⟩ + | succ q0 => + rcases RIncs_nxt_1 q0 with ⟨w', hI⟩ + exact ⟨RD.LD :: w', RIncs_eqk (RIncs.h1_d1 hI) (by omega)⟩ + | @h1_rh_1 k r' h_ri ih => + intro tq q htq + have ih' := ih rfl rfl + rcases htq with rfl | rfl + · rcases ih' H.hx (1 + q) (Or.inl rfl) with ⟨w', hI2⟩ + exact ⟨RD.LD :: w', RIncs.hx_d0 hI2⟩ + · cases q with + | zero => + rcases ih' H.h1 0 (Or.inr rfl) with ⟨w', hI2⟩ + exact ⟨RD.W1D0 :: r', RIncs.h1_z_d0 (rK_nonnil h_ri) hI2⟩ + | succ m0 => + rcases mod2 m0 with ⟨b, rfl⟩ | ⟨b, rfl⟩ + · rcases ih' H.h1 b (Or.inr rfl) with ⟨w', hI2⟩ + exact ⟨RD.D0 :: w', RIncs_eqk (RIncs.h1_d0_0 hI2) (by omega)⟩ + · rcases ih' H.h1 b (Or.inr rfl) with ⟨w', hI2⟩ + exact ⟨RD.D1 :: w', RIncs_eqk (RIncs.h1_d0_1 hI2) (by omega)⟩ + | @h1_rh_2 k r' h_ri ih => + intro tq q htq + have ih' := ih rfl rfl + rcases htq with rfl | rfl + · rcases ih' H.h1 q (Or.inr rfl) with ⟨w', hI2⟩ + exact ⟨RD.LD :: w', RIncs.hx_d1 hI2⟩ + · cases q with + | zero => + rcases ih' H.h1 0 (Or.inr rfl) with ⟨w', hI2⟩ + exact ⟨RD.W1D1 :: r', RIncs.h1_z_d1 (rK_nonnil h_ri) hI2⟩ + | succ q0 => + rcases ih' H.h1 q0 (Or.inr rfl) with ⟨w', hI2⟩ + exact ⟨RD.LD :: w', RIncs_eqk (RIncs.h1_d1 hI2) (by omega)⟩ + | h1_z1 => cases he + | h1_z0 => cases he + | h1_z_ld _ _ _ _ => cases he + | h1_z_d1 _ _ _ => cases he + | h1_z_d0 _ _ _ => cases he + +private theorem Good_eqk {tp : H} {k k' : Nat} {r : List RD} + (h : Good tp k r) (hk : k = k') : Good tp k' r := by + subst hk; exact h + +private theorem Good_step {tp : H} {k : Nat} {r : List RD} (hG : Good tp k r) : + ∀ j rK tq q, RIncs tp (k + j) r rK -> + (tq = H.hx ∨ (tq = H.h1 ∧ tp = H.h1)) -> ∃ r2, RIncs tq q rK r2 := by + induction hG with + | @hx_ld k r r1 Hi _ ih => + intro j rK tq q E htq + have h_hx : tq = H.hx := by rcases htq with rfl | ⟨_, h⟩; rfl; cases h + subst h_hx + rcases inv_hx_ld E with ⟨r1', rK', Hi', E', rfl⟩ + rw [RIncs_fun Hi' Hi] at E' + rcases RIncs_step E' (by decide) with ⟨rK'', J, E''⟩ + rcases ih j rK'' H.hx q (RIncs_eqk E'' (by omega)) (Or.inl rfl) with ⟨r2, I2⟩ + exact ⟨RD.LD :: r2, RIncs.hx_ld J I2⟩ + | @hx_d1 k r _ ih => + intro j rK tq q E htq + have h_hx : tq = H.hx := by rcases htq with rfl | ⟨_, h⟩; rfl; cases h + subst h_hx + rcases inv_hx_d1 E with ⟨rK', E', rfl⟩ + rcases RIncs_step E' (by decide) with ⟨rK'', J, E''⟩ + rcases ih j rK'' H.hx q (RIncs_eqk E'' (by omega)) (Or.inl rfl) with ⟨r2, I2⟩ + exact ⟨RD.LD :: r2, RIncs.hx_ld J I2⟩ + | @hx_d0 k r _ ih => + intro j rK tq q E htq + have h_hx : tq = H.hx := by rcases htq with rfl | ⟨_, h⟩; rfl; cases h + subst h_hx + rcases inv_hx_d0 E with ⟨rK', E', rfl⟩ + rcases RIncs_step E' (by decide) with ⟨rK'', J, E''⟩ + rcases ih (1 + j) rK'' H.hx q (RIncs_eqk E'' (by omega)) (Or.inl rfl) with ⟨r2, I2⟩ + exact ⟨RD.LD :: r2, RIncs.hx_ld J I2⟩ + | @h1_ld k r r1 Hi _ ih => + intro j rK tq q E htq + have E0 : RIncs H.h1 (1 + (k + j)) (RD.LD :: r) rK := RIncs_eqk E (by omega) + rcases inv_h1_ld E0 with ⟨r1', rK', Hi', E', rfl⟩ + rw [RIncs_fun Hi' Hi] at E' + rcases RIncs_step E' (by decide) with ⟨rK'', J, E''⟩ + have E3 : RIncs H.hx ((1 + k) + j) r1 rK'' := RIncs_eqk E'' (by omega) + rcases htq with rfl | ⟨rfl, _⟩ + · rcases ih j rK'' H.hx q E3 (Or.inl rfl) with ⟨r2, I2⟩ + exact ⟨RD.LD :: r2, RIncs.hx_ld J I2⟩ + · cases q with + | zero => + rcases ih j rK'' H.hx 0 E3 (Or.inl rfl) with ⟨r2, I2⟩ + exact ⟨RD.W1LD :: rK', RIncs.h1_z_ld J I2⟩ + | succ q0 => + rcases ih j rK'' H.hx q0 E3 (Or.inl rfl) with ⟨r2, I2⟩ + exact ⟨RD.LD :: r2, RIncs_eqk (RIncs.h1_ld J I2) (by omega)⟩ + | @h1_d1 k r _ ih => + intro j rK tq q E htq + have E0 : RIncs H.h1 (1 + (k + j)) (RD.D1 :: r) rK := RIncs_eqk E (by omega) + rcases inv_h1_d1 E0 with ⟨rK', E', rfl⟩ + rcases RIncs_step E' (by decide) with ⟨rK'', J, E''⟩ + have E3 : RIncs H.h1 ((1 + k) + j) r rK'' := RIncs_eqk E'' (by omega) + rcases htq with rfl | ⟨rfl, _⟩ + · rcases ih j rK'' H.hx q E3 (Or.inl rfl) with ⟨r2, I2⟩ + exact ⟨RD.LD :: r2, RIncs.hx_ld J I2⟩ + · cases q with + | zero => + rcases ih j rK'' H.hx 0 E3 (Or.inl rfl) with ⟨r2, I2⟩ + exact ⟨RD.W1LD :: rK', RIncs.h1_z_ld J I2⟩ + | succ q0 => + rcases ih j rK'' H.hx q0 E3 (Or.inl rfl) with ⟨r2, I2⟩ + exact ⟨RD.LD :: r2, RIncs_eqk (RIncs.h1_ld J I2) (by omega)⟩ + | @h1_d0_0 a r _ ih => + intro j rK tq q E htq + rcases inv_h1_d0 E (by omega) with ⟨A, rK', hKA, E', rfl⟩ | ⟨A, rK', hKA, E', rfl⟩ + · have hE' : RIncs H.h1 (a + (A - a)) r rK' := RIncs_eqk E' (by omega) + rcases htq with rfl | ⟨rfl, _⟩ + · rcases ih (A - a) rK' H.hx (1 + q) hE' (Or.inl rfl) with ⟨r2, I2⟩ + exact ⟨RD.LD :: r2, RIncs.hx_d0 I2⟩ + · cases q with + | zero => + rcases ih (A - a) rK' H.h1 0 hE' (Or.inr ⟨rfl, rfl⟩) with ⟨r2, I2⟩ + exact ⟨RD.W1D0 :: rK', RIncs.h1_z_d0 (rK_nonnil E') I2⟩ + | succ m0 => + rcases mod2 m0 with ⟨b, rfl⟩ | ⟨b, rfl⟩ + · rcases ih (A - a) rK' H.h1 b hE' (Or.inr ⟨rfl, rfl⟩) with ⟨r2, I2⟩ + exact ⟨RD.D0 :: r2, RIncs_eqk (RIncs.h1_d0_0 I2) (by omega)⟩ + · rcases ih (A - a) rK' H.h1 b hE' (Or.inr ⟨rfl, rfl⟩) with ⟨r2, I2⟩ + exact ⟨RD.D1 :: r2, RIncs_eqk (RIncs.h1_d0_1 I2) (by omega)⟩ + · have hE' : RIncs H.h1 (a + (A - a)) r rK' := RIncs_eqk E' (by omega) + rcases htq with rfl | ⟨rfl, _⟩ + · rcases ih (A - a) rK' H.h1 q hE' (Or.inr ⟨rfl, rfl⟩) with ⟨r2, I2⟩ + exact ⟨RD.LD :: r2, RIncs.hx_d1 I2⟩ + · cases q with + | zero => + rcases ih (A - a) rK' H.h1 0 hE' (Or.inr ⟨rfl, rfl⟩) with ⟨r2, I2⟩ + exact ⟨RD.W1D1 :: rK', RIncs.h1_z_d1 (rK_nonnil E') I2⟩ + | succ q0 => + rcases ih (A - a) rK' H.h1 q0 hE' (Or.inr ⟨rfl, rfl⟩) with ⟨r2, I2⟩ + exact ⟨RD.LD :: r2, RIncs_eqk (RIncs.h1_d1 I2) (by omega)⟩ + | @h1_d0_1 a r _ ih => + intro j rK tq q E htq + rcases inv_h1_d0 E (by omega) with ⟨A, rK', hKA, E', rfl⟩ | ⟨A, rK', hKA, E', rfl⟩ + · have hE' : RIncs H.h1 (a + (A - a)) r rK' := RIncs_eqk E' (by omega) + rcases htq with rfl | ⟨rfl, _⟩ + · rcases ih (A - a) rK' H.hx (1 + q) hE' (Or.inl rfl) with ⟨r2, I2⟩ + exact ⟨RD.LD :: r2, RIncs.hx_d0 I2⟩ + · cases q with + | zero => + rcases ih (A - a) rK' H.h1 0 hE' (Or.inr ⟨rfl, rfl⟩) with ⟨r2, I2⟩ + exact ⟨RD.W1D0 :: rK', RIncs.h1_z_d0 (rK_nonnil E') I2⟩ + | succ m0 => + rcases mod2 m0 with ⟨b, rfl⟩ | ⟨b, rfl⟩ + · rcases ih (A - a) rK' H.h1 b hE' (Or.inr ⟨rfl, rfl⟩) with ⟨r2, I2⟩ + exact ⟨RD.D0 :: r2, RIncs_eqk (RIncs.h1_d0_0 I2) (by omega)⟩ + · rcases ih (A - a) rK' H.h1 b hE' (Or.inr ⟨rfl, rfl⟩) with ⟨r2, I2⟩ + exact ⟨RD.D1 :: r2, RIncs_eqk (RIncs.h1_d0_1 I2) (by omega)⟩ + · have hE' : RIncs H.h1 (a + (A - a)) r rK' := RIncs_eqk E' (by omega) + rcases htq with rfl | ⟨rfl, _⟩ + · rcases ih (A - a) rK' H.h1 q hE' (Or.inr ⟨rfl, rfl⟩) with ⟨r2, I2⟩ + exact ⟨RD.LD :: r2, RIncs.hx_d1 I2⟩ + · cases q with + | zero => + rcases ih (A - a) rK' H.h1 0 hE' (Or.inr ⟨rfl, rfl⟩) with ⟨r2, I2⟩ + exact ⟨RD.W1D1 :: rK', RIncs.h1_z_d1 (rK_nonnil E') I2⟩ + | succ q0 => + rcases ih (A - a) rK' H.h1 q0 hE' (Or.inr ⟨rfl, rfl⟩) with ⟨r2, I2⟩ + exact ⟨RD.LD :: r2, RIncs_eqk (RIncs.h1_d1 I2) (by omega)⟩ + | h1_z1 => + intro j rK tq q E htq + rcases inv_z1 E with ⟨_, rfl⟩ | ⟨K0, rK', _, E', rfl⟩ + · rcases htq with rfl | ⟨rfl, _⟩ + · rcases RIncs_nxt_1 q with ⟨w, hI⟩ + exact ⟨RD.LD :: RD.LD :: w, RIncs.hx_ld RIncs.hi_nil (RIncs.hx_d1 hI)⟩ + · cases q with + | zero => + exact ⟨[RD.W1LD], RIncs.h1_z_ld RIncs.hi_nil (RIncs.hx_d1 RIncs.h1_rh_0)⟩ + | succ q0 => + rcases RIncs_nxt_1 q0 with ⟨w, hI⟩ + exact ⟨RD.LD :: RD.LD :: w, RIncs_eqk (RIncs.h1_ld RIncs.hi_nil (RIncs.hx_d1 hI)) (by omega)⟩ + · rcases RIncs_step E' (by decide) with ⟨rK'', J, E''⟩ + rcases htq with rfl | ⟨rfl, _⟩ + · rcases End_step E'' rfl rfl H.hx q (Or.inl rfl) with ⟨r2, I2⟩ + exact ⟨RD.LD :: r2, RIncs.hx_ld J I2⟩ + · cases q with + | zero => + rcases End_step E'' rfl rfl H.hx 0 (Or.inl rfl) with ⟨r2, I2⟩ + exact ⟨RD.W1LD :: rK', RIncs.h1_z_ld J I2⟩ + | succ q0 => + rcases End_step E'' rfl rfl H.hx q0 (Or.inl rfl) with ⟨r2, I2⟩ + exact ⟨RD.LD :: r2, RIncs_eqk (RIncs.h1_ld J I2) (by omega)⟩ + | h1_nil => + intro j rK tq q E htq + rcases htq with rfl | ⟨rfl, _⟩ + · exact End_step E rfl rfl H.hx q (Or.inl rfl) + · exact End_step E rfl rfl H.h1 q (Or.inr rfl) + +private theorem End_good_1 {tp : H} {m : Nat} {e w : List RD} (h : RIncs tp m e w) + (htp : tp = H.h1) (he : e = []) : + ∀ q, m ≤ q -> Good H.h1 q w := by + induction h with + | hi_nil => cases htp + | hi_d0 _ => cases htp + | hi_d1 _ => cases htp + | hi_ld _ => cases htp + | hi_w1d0 _ => cases htp + | hi_w1d1 _ => cases htp + | hi_w1ld _ _ => cases htp + | hx_ld _ _ _ _ => cases htp + | hx_d1 _ _ => cases htp + | hx_d0 _ _ => cases htp + | h1_ld _ _ _ _ => cases he + | h1_d1 _ _ => cases he + | h1_d0_0 _ _ => cases he + | h1_d0_1 _ _ => cases he + | h1_rh_0 => + intro q _ + cases q with + | zero => exact Good.h1_z1 + | succ q0 => exact Good_eqk (Good.h1_d1 (@Good.h1_nil (1 + q0))) (by omega) + | @h1_rh_1 b r' _ ih => + intro q hq + have ih' := ih rfl rfl + rcases mod2 q with ⟨c, rfl⟩ | ⟨c, rfl⟩ + · cases c with + | zero => omega + | succ c => exact Good_eqk (Good.h1_d0_1 (ih' c (by omega))) (by omega) + · exact Good.h1_d0_0 (ih' c (by omega)) + | @h1_rh_2 b r' _ ih => + intro q hq + have ih' := ih rfl rfl + cases q with + | zero => omega + | succ q0 => exact Good_eqk (Good.h1_d1 (ih' (1 + q0) (by omega))) (by omega) + | h1_z1 => cases he + | h1_z0 => cases he + | h1_z_ld _ _ _ _ => cases he + | h1_z_d1 _ _ _ => cases he + | h1_z_d0 _ _ _ => cases he + +private theorem End_good_x {tp : H} {m : Nat} {e w : List RD} (h : RIncs tp m e w) + (htp : tp = H.h1) (he : e = []) : + ∀ q, m ≤ 2 * q + 2 -> Good H.hx q w := by + induction h with + | hi_nil => cases htp + | hi_d0 _ => cases htp + | hi_d1 _ => cases htp + | hi_ld _ => cases htp + | hi_w1d0 _ => cases htp + | hi_w1d1 _ => cases htp + | hi_w1ld _ _ => cases htp + | hx_ld _ _ _ _ => cases htp + | hx_d1 _ _ => cases htp + | hx_d0 _ _ => cases htp + | h1_ld _ _ _ _ => cases he + | h1_d1 _ _ => cases he + | h1_d0_0 _ _ => cases he + | h1_d0_1 _ _ => cases he + | h1_rh_0 => + intro q _ + exact Good.hx_d1 Good.h1_nil + | @h1_rh_1 b r' _ ih => + intro q hq + exact Good.hx_d0 (ih rfl rfl (1 + q) (by omega)) + | @h1_rh_2 b r' h_ri _ => + intro q hq + exact Good.hx_d1 (End_good_1 h_ri rfl rfl (1 + q) (by omega)) + | h1_z1 => cases he + | h1_z0 => cases he + | h1_z_ld _ _ _ _ => cases he + | h1_z_d1 _ _ _ => cases he + | h1_z_d0 _ _ _ => cases he + +private def Inv (tp : H) (k j : Nat) (tq : H) (q : Nat) : Prop := + match tp, tq with + | H.hx, H.hx => k ≤ q ∧ j ≤ q + | H.h1, H.hx => k ≤ q ∧ j ≤ q + | H.h1, H.h1 => (j = 0 ∧ 2 * k + 1 ≤ q) ∨ (1 ≤ j ∧ k + j ≤ q ∧ 1 ≤ q) + | _, _ => False + +private theorem Good_pres {tp : H} {k : Nat} {r : List RD} (hG : Good tp k r) : + ∀ j rK tq q, RIncs tp (k + j) r rK -> + Inv tp k j tq q -> Good tq q rK := by + induction hG with + | @hx_ld k r r1 Hi _ ih => + intro j rK tq q E HI + cases tq with + | hi => cases HI + | h1 => cases HI + | hx => + rcases inv_hx_ld E with ⟨r1', rK', Hi', E', rfl⟩ + rw [RIncs_fun Hi' Hi] at E' + rcases RIncs_step E' (by decide) with ⟨rK'', J, E''⟩ + exact Good.hx_ld J (ih j rK'' H.hx (1 + q) (RIncs_eqk E'' (by omega)) (by dsimp [Inv] at HI ⊢; omega)) + | @hx_d1 k r _ ih => + intro j rK tq q E HI + cases tq with + | hi => cases HI + | h1 => cases HI + | hx => + rcases inv_hx_d1 E with ⟨rK', E', rfl⟩ + rcases RIncs_step E' (by decide) with ⟨rK'', J, E''⟩ + exact Good.hx_ld J (ih j rK'' H.hx (1 + q) (RIncs_eqk E'' (by omega)) (by dsimp [Inv] at HI ⊢; omega)) + | @hx_d0 k r _ ih => + intro j rK tq q E HI + cases tq with + | hi => cases HI + | h1 => cases HI + | hx => + rcases inv_hx_d0 E with ⟨rK', E', rfl⟩ + rcases RIncs_step E' (by decide) with ⟨rK'', J, E''⟩ + exact Good.hx_ld J (ih (1 + j) rK'' H.hx (1 + q) (RIncs_eqk E'' (by omega)) (by dsimp [Inv] at HI ⊢; omega)) + | @h1_ld k r r1 Hi _ ih => + intro j rK tq q E HI + have E0 : RIncs H.h1 (1 + (k + j)) (RD.LD :: r) rK := RIncs_eqk E (by omega) + rcases inv_h1_ld E0 with ⟨r1', rK', Hi', E', rfl⟩ + rw [RIncs_fun Hi' Hi] at E' + rcases RIncs_step E' (by decide) with ⟨rK'', J, E''⟩ + have E3 : RIncs H.hx ((1 + k) + j) r1 rK'' := RIncs_eqk E'' (by omega) + cases tq with + | hi => cases HI + | hx => exact Good.hx_ld J (ih j rK'' H.hx (1 + q) E3 (by dsimp [Inv] at HI ⊢; omega)) + | h1 => + cases q with + | zero => dsimp [Inv] at HI; omega + | succ q0 => + exact Good_eqk (Good.h1_ld J (ih j rK'' H.hx (1 + q0) E3 (by dsimp [Inv] at HI ⊢; omega))) (by omega) + | @h1_d1 k r _ ih => + intro j rK tq q E HI + have E0 : RIncs H.h1 (1 + (k + j)) (RD.D1 :: r) rK := RIncs_eqk E (by omega) + rcases inv_h1_d1 E0 with ⟨rK', E', rfl⟩ + rcases RIncs_step E' (by decide) with ⟨rK'', J, E''⟩ + have E3 : RIncs H.h1 ((1 + k) + j) r rK'' := RIncs_eqk E'' (by omega) + cases tq with + | hi => cases HI + | hx => exact Good.hx_ld J (ih j rK'' H.hx (1 + q) E3 (by dsimp [Inv] at HI ⊢; omega)) + | h1 => + cases q with + | zero => dsimp [Inv] at HI; omega + | succ q0 => + exact Good_eqk (Good.h1_ld J (ih j rK'' H.hx (1 + q0) E3 (by dsimp [Inv] at HI ⊢; omega))) (by omega) + | @h1_d0_0 a r _ ih => + intro j rK tq q E HI + rcases inv_h1_d0 E (by omega) with ⟨A, rK', hKA, E', rfl⟩ | ⟨A, rK', hKA, E', rfl⟩ + · have hE' : RIncs H.h1 (a + (A - a)) r rK' := RIncs_eqk E' (by omega) + cases tq with + | hi => cases HI + | hx => exact Good.hx_d0 (ih (A - a) rK' H.hx (1 + q) hE' (by dsimp [Inv] at HI ⊢; omega)) + | h1 => + rcases mod2 q with ⟨b, rfl⟩ | ⟨b, rfl⟩ + · cases b with + | zero => dsimp [Inv] at HI; omega + | succ b0 => + exact Good_eqk (Good.h1_d0_1 (ih (A - a) rK' H.h1 b0 hE' (by dsimp [Inv] at HI ⊢; omega))) (by omega) + · exact Good.h1_d0_0 (ih (A - a) rK' H.h1 b hE' (by dsimp [Inv] at HI ⊢; omega)) + · have hE' : RIncs H.h1 (a + (A - a)) r rK' := RIncs_eqk E' (by omega) + cases tq with + | hi => cases HI + | hx => exact Good.hx_d1 (ih (A - a) rK' H.h1 (1 + q) hE' (by dsimp [Inv] at HI ⊢; omega)) + | h1 => + cases q with + | zero => dsimp [Inv] at HI; omega + | succ q0 => + exact Good_eqk (Good.h1_d1 (ih (A - a) rK' H.h1 (1 + q0) hE' (by dsimp [Inv] at HI ⊢; omega))) (by omega) + | @h1_d0_1 a r _ ih => + intro j rK tq q E HI + rcases inv_h1_d0 E (by omega) with ⟨A, rK', hKA, E', rfl⟩ | ⟨A, rK', hKA, E', rfl⟩ + · have hE' : RIncs H.h1 (a + (A - a)) r rK' := RIncs_eqk E' (by omega) + cases tq with + | hi => cases HI + | hx => exact Good.hx_d0 (ih (A - a) rK' H.hx (1 + q) hE' (by dsimp [Inv] at HI ⊢; omega)) + | h1 => + rcases mod2 q with ⟨b, rfl⟩ | ⟨b, rfl⟩ + · cases b with + | zero => dsimp [Inv] at HI; omega + | succ b0 => + exact Good_eqk (Good.h1_d0_1 (ih (A - a) rK' H.h1 b0 hE' (by dsimp [Inv] at HI ⊢; omega))) (by omega) + · exact Good.h1_d0_0 (ih (A - a) rK' H.h1 b hE' (by dsimp [Inv] at HI ⊢; omega)) + · have hE' : RIncs H.h1 (a + (A - a)) r rK' := RIncs_eqk E' (by omega) + cases tq with + | hi => cases HI + | hx => exact Good.hx_d1 (ih (A - a) rK' H.h1 (1 + q) hE' (by dsimp [Inv] at HI ⊢; omega)) + | h1 => + cases q with + | zero => dsimp [Inv] at HI; omega + | succ q0 => + exact Good_eqk (Good.h1_d1 (ih (A - a) rK' H.h1 (1 + q0) hE' (by dsimp [Inv] at HI ⊢; omega))) (by omega) + | h1_z1 => + intro j rK tq q E HI + rcases inv_z1 E with ⟨_, rfl⟩ | ⟨K0, rK', _, E', rfl⟩ + · cases tq with + | hi => cases HI + | hx => exact Good.hx_ld RIncs.hi_nil (Good.hx_d1 Good.h1_nil) + | h1 => + cases q with + | zero => dsimp [Inv] at HI; omega + | succ q0 => exact Good_eqk (Good.h1_ld RIncs.hi_nil (Good.hx_d1 (@Good.h1_nil (1 + (1 + q0))))) (by omega) + · rcases RIncs_step E' (by decide) with ⟨rK'', J, E''⟩ + cases tq with + | hi => cases HI + | hx => + exact Good.hx_ld J (End_good_x E'' rfl rfl (1 + q) (by dsimp [Inv] at HI; omega)) + | h1 => + cases q with + | zero => dsimp [Inv] at HI; omega + | succ q0 => + exact Good_eqk (Good.h1_ld J (End_good_x E'' rfl rfl (1 + q0) (by dsimp [Inv] at HI; omega))) (by omega) + | @h1_nil k => + intro j rK tq q E HI + cases tq with + | hi => cases HI + | hx => exact End_good_x E rfl rfl q (by dsimp [Inv] at HI; omega) + | h1 => exact End_good_1 E rfl rfl q (by dsimp [Inv] at HI; omega) + +private theorem domain {r r1 : List RD} (hG : Good H.hx 0 r) (hE : RIncs H.hx 0 r r1) : + ∃ r2, RIncs H.hx 0 r1 r2 ∧ Good H.hx 0 r1 := by + have hE0 : RIncs H.hx (0 + 0) r r1 := hE + rcases Good_step hG 0 r1 H.hx 0 hE0 (Or.inl rfl) with ⟨r2, hR2⟩ + exact ⟨r2, hR2, Good_pres hG 0 r1 H.hx 0 hE0 (by simp [Inv])⟩ + +private theorem turn_lh (r : zB) : (zCL lh r) [target_tm]⊢⁺ (zCR lh .ch' r) := by + unfold zCL zCR zCw zCs lh + simp only [append_cons, append_nil] + execute + +private theorem big_step {r r' : List RD} (h : RIncs H.hx 0 r r') : + (zCR lh .ch' (toRC r)) [target_tm]⊢⁺ (zCR lh .ch' (toRC r')) := by + have hs := RIncs_spec h + simp only [toH, toH', z05, List.append_nil, append_nil] at hs + rcases hs with _ | ⟨hc, hnil⟩ + cases hnil + exact zPt (hc lh) (turn_lh (toRC r')) + +private theorem start_step : (init []) [target_tm]⊢⁺ (zCR lh .ch' (toRC [RD.D1])) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + unfold zCR lh zCw zCs + dsimp [toRC, d1] + execute + +private theorem arb_steps (N : Nat) : + ∃ m r r1, N ≤ m ∧ ((init []) [target_tm]⊢^{m} (zCR lh .ch' (toRC r))) ∧ + RIncs H.hx 0 r r1 ∧ Good H.hx 0 r := by + induction N with + | zero => + obtain ⟨m, _, hm⟩ := start_step + exact ⟨m, [RD.D1], [RD.LD, RD.D1], Nat.zero_le _, hm, + RIncs.hx_d1 RIncs.h1_rh_0, Good.hx_d1 Good.h1_nil⟩ + | succ N ih => + obtain ⟨m, r, r1, _, hm, hE, hG⟩ := ih + obtain ⟨r2, hE2, hG2⟩ := domain hG hE + obtain ⟨k, _, hk⟩ := big_step hE + exact ⟨m + k, r1, r2, by omega, zMt target_tm _ _ _ m k hm hk, hE2, hG2⟩ + +private theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d) = some c') : + (multiStep target_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg ⟨n, hn⟩ + rcases arb_steps (n + 1) with ⟨m, _, _, hnm, hm, _, _⟩ + have h_eq : (n + 1) + (m - (n + 1)) = m := Nat.add_sub_of_le hnm + rw [← h_eq] at hm + have h_some := zIm hm + rw [zMs, hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RA_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RA_1RC0LC_0LD1RF_1RA1LE_1LD0LB_0REHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1RC0LC_0LD1RF_1RA1LE_1LD0LB_0REHHH.lean new file mode 100644 index 00000000..40c09875 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1RC0LC_0LD1RF_1RA1LE_1LD0LB_0REHHH.lean @@ -0,0 +1,2313 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.WordCalculusF +public import BusyBeaver.Calculi.WordCalculusG + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RA_1RC0LC_0LD1RF_1RA1LE_1LD0LB_0REHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1RC0LC_0LD1RF_1RA1LE_1LD0LB_0REHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +@[reducible] def tm : Machine (Fin 2) (Fin 6) := target_tm +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 2000000 +set_option maxRecDepth 200000 +set_option exponentiation.threshold 2048 + +open WordVKQ Word + +local macro "finish" : tactic => + `(tactic| exact ⟨0, rfl⟩) +local macro "gstep" : tactic => + `(tactic| (try refine stepStar_of_stepPlus_vkq ?_) <;> + refine stepStar_stepPlus_trans_vkq (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head_vkq]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default_vkq, default_head_vkq, default_tail_vkq]) +local macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | gstep))) + +inductive Call where + | ch + | cb + | cf + | ck + +def zInQ : Call -> Fin 6 + | .ch | .cb => 4 + | .cf | .ck => 2 + +def zInB : Call -> Fin 2 + | .ch | .cb => 1 + | .cf | .ck => 0 + +def zExQ : Call -> Fin 6 + | .ch => 0 + | .cb => 1 + | .cf => 5 + | .ck => 1 + +def zExB : Call -> Fin 2 + | .ch | .cb => 1 + | .cf | .ck => 0 + +def zCR (w : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (w <{{zInQ c}} ([zInB c] +> r)) + +def zCL (w : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (w {{zExQ c}}> ([zExB c] +> r)) + +def zCf (w : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> w) {{0}}> default) + +abbrev callStep (c : Call) (w1 w2 : HalfTape) : Prop := + ∀ r, (zCR w1 c r) [tm]⊢⁺ (zCL w2 c r) + +abbrev Side := SideP callStep +abbrev Seg := SegP callStep +abbrev zLp1 := @list_pow_one_add_vkq + +theorem zSC0 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ u r, (zCR (w1 +> u) c r) [tm]⊢⁺ (zCL (w2 +> u) c r)) : + Seg [c] [] w1 w2 := by + intro u1 u2 h; cases h + exact SideP.cons (fun r => h1 u1 r) (SideP.nil _) + +theorem zSC1 {c_in c1 : Call} {w1 w2 mid1 : BitWord} + (h1 : ∀ u r, (zCR (w1 +> u) c_in r) [tm]⊢⁺ (zCR u c1 (mid1 +> r))) + (h2 : ∀ u r, (zCL u c1 (mid1 +> r)) [tm]⊢⁺ (zCL (w2 +> u) c_in r)) : + Seg [c_in] [c1] w1 w2 := by + intro u1 u2 h + rcases h with _ | ⟨hc1, hnil⟩ + cases hnil + refine SideP.cons (fun r => ?_) (SideP.nil _) + exact stepPlus_trans_vkq (h1 u1 r) (stepPlus_trans_vkq (hc1 (mid1 +> r)) (h2 u2 r)) + +theorem zSC2 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ u r, (zCR (w1 +> u) c_in r) [tm]⊢⁺ (zCR u c1 (mid1 +> r))) + (h2 : ∀ u r, (zCL u c1 (mid1 +> r)) [tm]⊢⁺ (zCR u c2 (mid2 +> r))) + (h3 : ∀ u r, (zCL u c2 (mid2 +> r)) [tm]⊢⁺ (zCL (w2 +> u) c_in r)) : + Seg [c_in] [c1, c2] w1 w2 := by + intro u1 u3 h + rcases h with _ | ⟨hc1, _ | ⟨hc2, hnil⟩⟩ + cases hnil + refine SideP.cons (fun r => ?_) (SideP.nil _) + exact stepPlus_trans_vkq (h1 u1 r) (stepPlus_trans_vkq (hc1 (mid1 +> r)) (stepPlus_trans_vkq (h2 _ r) (stepPlus_trans_vkq (hc2 (mid2 +> r)) (h3 u3 r)))) + +theorem zSC3 {c_in c1 c2 c3 : Call} {w1 w2 mid1 mid2 mid3 : BitWord} + (h1 : ∀ u r, (zCR (w1 +> u) c_in r) [tm]⊢⁺ (zCR u c1 (mid1 +> r))) + (h2 : ∀ u r, (zCL u c1 (mid1 +> r)) [tm]⊢⁺ (zCR u c2 (mid2 +> r))) + (h3 : ∀ u r, (zCL u c2 (mid2 +> r)) [tm]⊢⁺ (zCR u c3 (mid3 +> r))) + (h4 : ∀ u r, (zCL u c3 (mid3 +> r)) [tm]⊢⁺ (zCL (w2 +> u) c_in r)) : + Seg [c_in] [c1, c2, c3] w1 w2 := by + intro u1 u4 h + rcases h with _ | ⟨hc1, _ | ⟨hc2, _ | ⟨hc3, hnil⟩⟩⟩ + cases hnil + refine SideP.cons (fun r => ?_) (SideP.nil _) + exact stepPlus_trans_vkq (h1 u1 r) (stepPlus_trans_vkq (hc1 (mid1 +> r)) (stepPlus_trans_vkq (h2 _ r) (stepPlus_trans_vkq (hc2 (mid2 +> r)) + (stepPlus_trans_vkq (h3 _ r) (stepPlus_trans_vkq (hc3 (mid3 +> r)) (h4 u4 r)))))) + +theorem zSC4 {c_in c1 c2 c3 c4 : Call} {w1 w2 mid1 mid2 mid3 mid4 : BitWord} + (h1 : ∀ u r, (zCR (w1 +> u) c_in r) [tm]⊢⁺ (zCR u c1 (mid1 +> r))) + (h2 : ∀ u r, (zCL u c1 (mid1 +> r)) [tm]⊢⁺ (zCR u c2 (mid2 +> r))) + (h3 : ∀ u r, (zCL u c2 (mid2 +> r)) [tm]⊢⁺ (zCR u c3 (mid3 +> r))) + (h4 : ∀ u r, (zCL u c3 (mid3 +> r)) [tm]⊢⁺ (zCR u c4 (mid4 +> r))) + (h5 : ∀ u r, (zCL u c4 (mid4 +> r)) [tm]⊢⁺ (zCL (w2 +> u) c_in r)) : + Seg [c_in] [c1, c2, c3, c4] w1 w2 := by + intro u1 u5 h + rcases h with _ | ⟨hc1, _ | ⟨hc2, _ | ⟨hc3, _ | ⟨hc4, hnil⟩⟩⟩⟩ + cases hnil + refine SideP.cons (fun r => ?_) (SideP.nil _) + exact stepPlus_trans_vkq (h1 u1 r) (stepPlus_trans_vkq (hc1 (mid1 +> r)) (stepPlus_trans_vkq (h2 _ r) (stepPlus_trans_vkq (hc2 (mid2 +> r)) + (stepPlus_trans_vkq (h3 _ r) (stepPlus_trans_vkq (hc3 (mid3 +> r)) (stepPlus_trans_vkq (h4 _ r) (stepPlus_trans_vkq (hc4 (mid4 +> r)) (h5 u5 r)))))))) + +theorem seg_cf_1 : Seg [.cf] [] [1] [1] := + zSC0 + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_cb_Q_ch : Seg [.cb] [.ch] [1, 0] [1, 0] := + zSC1 (mid1 := [0, 1]) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_cb_Vj_nil : Seg [.cb] [] [1, 0, 0, 0] [1, 0, 0, 1] := + zSC0 + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_cb_Va_dbl : Seg [.cb] [.cb, .cf, .cb, .cf] [1, 0, 0, 1] [1, 0, 0, 1] := + zSC4 (mid1 := [1, 1, 0, 1]) (mid2 := [1, 1, 0, 1]) (mid3 := [0, 1, 0, 1]) (mid4 := [0, 1, 0, 1]) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_cb_Va_ch : Seg [.cb] [.ch] [1, 0, 0, 1] [1, 0, 0, 0] := + zSC1 (mid1 := [1, 1, 0, 1]) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_cb_11_ckch : Seg [.cb] [.ck, .ch] [1, 1] [1, 0] := + zSC2 (mid1 := [0, 1]) (mid2 := [0, 1]) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_cb_V_cf : Seg [.cb] [.cf] [1, 1, 0, 0] [1, 0, 0, 1] := + zSC1 (mid1 := [0, 1, 0, 1]) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_cb_V_ck : Seg [.cb] [.ck, .cb, .cf] [1, 1, 0, 0] [1, 0, 0, 1] := + zSC3 (mid1 := [0, 1, 0, 1]) (mid2 := [0, 1, 0, 1]) (mid3 := [0, 1, 0, 1]) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_K : Seg [.ch] [] [0, 0] [0, 1] := + zSC0 + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_Qp_dbl : Seg [.ch] [.cb, .cf, .cb, .cf] [0, 1] [0, 1] := + zSC4 (mid1 := [1, 1]) (mid2 := [1, 1]) (mid3 := [0, 1]) (mid4 := [0, 1]) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_Qp_ch : Seg [.ch] [.ch] [0, 1] [0, 0] := + zSC1 (mid1 := [1, 1]) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_Vp_ch : Seg [.ch] [.ch, .ch] [0, 1, 1, 0] [0, 1, 1, 0] := + zSC2 (mid1 := [0, 1, 1, 1]) (mid2 := [0, 1, 0, 1]) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_Q_cbcf : Seg [.ch] [.cb, .cf] [1, 0] [0, 1] := + zSC2 (mid1 := [0, 1]) (mid2 := [0, 1]) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_11_cf : Seg [.ch] [.cf] [1, 1] [0, 1] := + zSC1 (mid1 := [0, 1]) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_11_ck : Seg [.ch] [.ck, .cb, .cf] [1, 1] [0, 1] := + zSC3 (mid1 := [0, 1]) (mid2 := [0, 1]) (mid3 := [0, 1]) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_V_ckch : Seg [.ch] [.ck, .ch] [1, 1, 0, 0] [0, 1, 1, 0] := + zSC2 (mid1 := [0, 1, 0, 1]) (mid2 := [0, 1, 0, 1]) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ck_K : Seg [.ck] [] [0, 0] [1, 1] := + zSC0 + (fun u r => by dsimp only [zCR, zCL, zInQ, zInB, zExQ, zExB]; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +abbrev pairA : List Call := [.cb, .cf] + +theorem seg_cf_keep (w : BitWord) : Seg [.cf] [] (1 :: w) (1 :: w) := + segP_comp_words seg_cf_1 (segP_nil w) + +theorem seg_pairA_Va_dbl : Seg pairA (pairA ^ 2) [1, 0, 0, 1] [1, 0, 0, 1] := by + simpa using segP_append_calls seg_cb_Va_dbl (seg_cf_keep [0, 0, 1]) + +theorem seg_pairA_Va_pow (n : Nat) : Seg (pairA ^ n) (pairA ^ (n * 2)) [1, 0, 0, 1] [1, 0, 0, 1] := by + induction n with + | zero => exact segP_nil [1, 0, 0, 1] + | succ n ih => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [list_pow_succ_vkq, heq, list_pow_add_vkq] + exact segP_append_calls seg_pairA_Va_dbl ih + +theorem seg_pairA_Va_half1 : Seg pairA [.ch] [1, 0, 0, 1] [1, 0, 0, 0] := by + simpa using segP_append_calls seg_cb_Va_ch (seg_cf_keep [0, 0, 0]) + +theorem seg_pairA_Vj_restore : Seg pairA [] [1, 0, 0, 0] [1, 0, 0, 1] := by + simpa using segP_append_calls seg_cb_Vj_nil (seg_cf_keep [0, 0, 1]) + +theorem seg_pairA_even_Va (q : Nat) : Seg (pairA ^ (q * 2)) ([.ch] ^ q) [1, 0, 0, 1] [1, 0, 0, 1] := by + induction q with + | zero => exact segP_nil [1, 0, 0, 1] + | succ q ih => + have heq : (q + 1) * 2 = 2 + q * 2 := by omega + rw [heq, list_pow_add_vkq, list_pow_succ_vkq] + have h2 : Seg (pairA ^ 2) [.ch] [1, 0, 0, 1] [1, 0, 0, 1] := by + simpa using segP_append_calls seg_pairA_Va_half1 seg_pairA_Vj_restore + exact segP_append_calls h2 ih + +theorem seg_pairA_odd_Va (q : Nat) : Seg (pairA ^ (1 + q * 2)) ([.ch] ^ (1 + q)) [1, 0, 0, 1] [1, 0, 0, 0] := by + have heq1 : 1 + q * 2 = q * 2 + 1 := by omega + have heq2 : 1 + q = q + 1 := by omega + rw [heq1, list_pow_add_vkq, list_pow_one_vkq, heq2, list_pow_add_vkq, list_pow_one_vkq] + exact segP_append_calls (seg_pairA_even_Va q) seg_pairA_Va_half1 + +theorem seg_pairA_V_cf : Seg pairA [.cf] V_u [1, 0, 0, 1] := by + simpa using segP_append_calls seg_cb_V_cf (seg_cf_keep [0, 0, 1]) + +theorem seg_pairA_V_ck : Seg pairA ([.ck] ++ pairA) V_u [1, 0, 0, 1] := by + simpa using segP_append_calls seg_cb_V_ck (seg_cf_keep [0, 0, 1]) + +theorem seg_ch_Vp_pow (n : Nat) : Seg ([.ch] ^ n) ([.ch] ^ (n * 2)) Vp Vp := by + induction n with + | zero => exact segP_nil Vp + | succ n ih => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [list_pow_succ_vkq, heq, list_pow_add_vkq] + exact segP_append_calls seg_ch_Vp_ch ih + +theorem seg_pairA_Q_pow (n : Nat) : Seg (pairA ^ n) ([.ch] ^ n) Q_u Q_u := by + induction n with + | zero => exact segP_nil Q_u + | succ n ih => + rw [list_pow_succ_vkq, list_pow_succ_vkq] + have h1 : Seg pairA [.ch] Q_u Q_u := by simpa using segP_append_calls seg_cb_Q_ch (seg_cf_keep [0]) + exact segP_append_calls h1 ih + +theorem seg_ch_Qp_dbl_pow (n : Nat) : Seg ([.ch] ^ n) (pairA ^ (n * 2)) Qp Qp := by + induction n with + | zero => exact segP_nil Qp + | succ n ih => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [list_pow_succ_vkq, heq, list_pow_add_vkq] + have h1 : Seg [.ch] (pairA ^ 2) Qp Qp := by simpa using seg_ch_Qp_dbl + exact segP_append_calls h1 ih + +theorem seg_ch_K_even (q : Nat) : Seg ([.ch] ^ (q * 2)) ([.ch] ^ q) K_u K_u := by + induction q with + | zero => exact segP_nil K_u + | succ q ih => + have heq : (q + 1) * 2 = 2 + q * 2 := by omega + rw [heq, list_pow_add_vkq, list_pow_succ_vkq] + have h2 : Seg ([.ch] ^ 2) [.ch] K_u K_u := by simpa using segP_append_calls seg_ch_K seg_ch_Qp_ch + exact segP_append_calls h2 ih + +theorem seg_ch_K_odd (q : Nat) : Seg ([.ch] ^ (1 + q * 2)) ([.ch] ^ q) K_u Qp := by + have heq : 1 + q * 2 = q * 2 + 1 := by omega + rw [heq, list_pow_add_vkq, list_pow_one_vkq] + simpa using segP_append_calls (seg_ch_K_even q) seg_ch_K + +theorem seg_ch_Qp_even (q : Nat) : Seg ([.ch] ^ (q * 2)) ([.ch] ^ q) Qp Qp := by + induction q with + | zero => exact segP_nil Qp + | succ q ih => + have heq : (q + 1) * 2 = 2 + q * 2 := by omega + rw [heq, list_pow_add_vkq, list_pow_succ_vkq] + have h2 : Seg ([.ch] ^ 2) [.ch] Qp Qp := by simpa using segP_append_calls seg_ch_Qp_ch seg_ch_K + exact segP_append_calls h2 ih + +theorem seg_ch_Qp_odd (q : Nat) : Seg ([.ch] ^ (1 + q * 2)) ([.ch] ^ (1 + q)) Qp K_u := by + rw [zLp1, zLp1] + exact segP_append_calls seg_ch_Qp_ch (seg_ch_K_even q) + +theorem raw_PureA_V_dbl2 {n1 n2 : Nat} (hn : 2 <= n1) (h2 : n2 = 2 * n1 - 2) : + Seg (pairA ^ n1) ([.cf] ++ pairA ^ n2) V_u [1, 0, 0, 1] := by + have h1 : n1 = 1 + (n1 - 1) := by omega + have h_out : n2 = (n1 - 1) * 2 := by omega + rw [h1, zLp1] + rw [h_out] + exact segP_append_calls seg_pairA_V_cf (seg_pairA_Va_pow (n1 - 1)) + +theorem raw_PureA_V_dbl1 {n1 n2 : Nat} (hn : 2 <= n1) (h2 : n2 = 2 * n1 - 1) : + Seg (pairA ^ n1) ([.ck] ++ pairA ^ n2) V_u [1, 0, 0, 1] := by + have h1 : n1 = 1 + (n1 - 1) := by omega + have h_out : n2 = 1 + (n1 - 1) * 2 := by omega + rw [h1, zLp1] + rw [h_out, zLp1, <- List.append_assoc] + exact segP_append_calls seg_pairA_V_ck (seg_pairA_Va_pow (n1 - 1)) + +theorem raw_PureA_V_half0 {n1 n2 : Nat} (hn : 2 <= n1) (hp : n1 % 2 = 0) (h2 : n2 = n1 / 2) : + Seg (pairA ^ n1) ([.cf] ++ [.ch] ^ n2) V_u [1, 0, 0, 0] := by + let q := n2 - 1 + have h1 : n1 = 1 + (1 + q * 2) := by omega + have h_out : n2 = 1 + q := by omega + rw [h1, h_out, zLp1] + exact segP_append_calls seg_pairA_V_cf (seg_pairA_odd_Va q) + +theorem raw_PureA_V_half1 {n1 n2 : Nat} (hn : 2 <= n1) (hp : n1 % 2 = 1) (h2 : n2 = n1 / 2) : + Seg (pairA ^ n1) ([.cf] ++ [.ch] ^ n2) V_u [1, 0, 0, 1] := by + have h1 : n1 = 1 + n2 * 2 := by omega + rw [h1, zLp1] + exact segP_append_calls seg_pairA_V_cf (seg_pairA_even_Va n2) + +theorem raw_CfA_V_dbl2 {n1 n2 : Nat} (hn : 2 <= n1) (h2 : n2 = 2 * n1 - 2) : + Seg ([.cf] ++ pairA ^ n1) ([.cf] ++ pairA ^ n2) V_u [1, 0, 0, 1] := by + simpa using segP_append_calls (seg_cf_keep [1, 0, 0]) (raw_PureA_V_dbl2 hn h2) + +theorem raw_CfA_V_dbl1 {n1 n2 : Nat} (hn : 2 <= n1) (h2 : n2 = 2 * n1 - 1) : + Seg ([.cf] ++ pairA ^ n1) ([.ck] ++ pairA ^ n2) V_u [1, 0, 0, 1] := by + simpa using segP_append_calls (seg_cf_keep [1, 0, 0]) (raw_PureA_V_dbl1 hn h2) + +theorem raw_CfA_V_half0 {n1 n2 : Nat} (hn : 2 <= n1) (hp : n1 % 2 = 0) (h2 : n2 = n1 / 2) : + Seg ([.cf] ++ pairA ^ n1) ([.cf] ++ [.ch] ^ n2) V_u [1, 0, 0, 0] := by + simpa using segP_append_calls (seg_cf_keep [1, 0, 0]) (raw_PureA_V_half0 hn hp h2) + +theorem raw_CfA_V_half1 {n1 n2 : Nat} (hn : 2 <= n1) (hp : n1 % 2 = 1) (h2 : n2 = n1 / 2) : + Seg ([.cf] ++ pairA ^ n1) ([.cf] ++ [.ch] ^ n2) V_u [1, 0, 0, 1] := by + simpa using segP_append_calls (seg_cf_keep [1, 0, 0]) (raw_PureA_V_half1 hn hp h2) + +theorem raw_PureH_V_dbl1 {n1 n2 : Nat} (hn : 2 <= n1) (h2 : n2 = 2 * n1 - 1) : + Seg ([.ch] ^ n1) ([.ck] ++ [.ch] ^ n2) V_u [0, 1, 1, 0] := by + have h1 : n1 = 1 + (n1 - 1) := by omega + have h_out : n2 = 1 + (n1 - 1) * 2 := by omega + rw [h1, zLp1] + rw [h_out, zLp1] + simpa using segP_append_calls seg_ch_V_ckch (seg_ch_Vp_pow (n1 - 1)) + +theorem raw_CfH_V_dbl1 {n1 n2 : Nat} (hn : 2 <= n1) (h2 : n2 = 2 * n1 - 1) : + Seg ([.cf] ++ [.ch] ^ n1) ([.ck] ++ [.ch] ^ n2) V_u [0, 1, 1, 0] := by + simpa using segP_append_calls (seg_cf_keep [1, 0, 0]) (raw_PureH_V_dbl1 hn h2) + +theorem raw_CkA_K_keep {n1 n2 : Nat} (hn : 2 <= n1) (h2 : n2 = n1) : + Seg ([.ck] ++ pairA ^ n1) ([.ck] ++ [.ch] ^ n2) K_u [1, 0] := by + let q := n1 - 1 + have h1 : n1 = 1 + q := by omega + have h_out : n2 = 1 + q := by omega + rw [h1, h_out, zLp1, zLp1] + have hp1 : Seg pairA [.ck, .ch] [1, 1] Q_u := by simpa using segP_append_calls seg_cb_11_ckch (seg_cf_keep [0]) + have hp_all : Seg (pairA ++ pairA ^ q) ([.ck, .ch] ++ [.ch] ^ q) [1, 1] Q_u := + segP_append_calls hp1 (seg_pairA_Q_pow q) + simpa using segP_append_calls seg_ck_K hp_all + +theorem raw_CkH_K_dbl2 {n1 n2 : Nat} (hn : 2 <= n1) (h2 : n2 = 2 * n1 - 2) : + Seg ([.ck] ++ [.ch] ^ n1) ([.cf] ++ pairA ^ n2) K_u [0, 1] := by + have h1 : n1 = 1 + (n1 - 1) := by omega + have h_out : n2 = (n1 - 1) * 2 := by omega + rw [h1, zLp1] + rw [h_out] + have hh : Seg ([.ch] ++ [.ch] ^ (n1 - 1)) ([.cf] ++ pairA ^ ((n1 - 1) * 2)) [1, 1] Qp := + segP_append_calls seg_ch_11_cf (seg_ch_Qp_dbl_pow (n1 - 1)) + simpa using segP_append_calls seg_ck_K hh + +theorem raw_CkH_K_dbl1 {n1 n2 : Nat} (hn : 2 <= n1) (h2 : n2 = 2 * n1 - 1) : + Seg ([.ck] ++ [.ch] ^ n1) ([.ck] ++ pairA ^ n2) K_u [0, 1] := by + have h1 : n1 = 1 + (n1 - 1) := by omega + have h_out : n2 = 1 + (n1 - 1) * 2 := by omega + rw [h1, zLp1] + rw [h_out, zLp1] + have hh : Seg ([.ch] ++ [.ch] ^ (n1 - 1)) ([.ck] ++ (pairA ++ pairA ^ ((n1 - 1) * 2))) [1, 1] Qp := by + simpa [List.append_assoc] using segP_append_calls seg_ch_11_ck (seg_ch_Qp_dbl_pow (n1 - 1)) + simpa using segP_append_calls seg_ck_K hh + +theorem raw_CkH_K_half0 {n1 n2 : Nat} (hn : 2 <= n1) (hp : n1 % 2 = 0) (h2 : n2 = n1 / 2) : + Seg ([.ck] ++ [.ch] ^ n1) ([.cf] ++ [.ch] ^ n2) K_u [0, 0] := by + let q := n2 - 1 + have h1 : n1 = 1 + (1 + q * 2) := by omega + have h_out : n2 = 1 + q := by omega + rw [h1, h_out, zLp1] + have hh : Seg ([.ch] ++ [.ch] ^ (1 + q * 2)) ([.cf] ++ [.ch] ^ (1 + q)) [1, 1] K_u := + segP_append_calls seg_ch_11_cf (seg_ch_Qp_odd q) + simpa using segP_append_calls seg_ck_K hh + +theorem raw_CkH_K_half1 {n1 n2 : Nat} (hn : 2 <= n1) (hp : n1 % 2 = 1) (h2 : n2 = n1 / 2) : + Seg ([.ck] ++ [.ch] ^ n1) ([.cf] ++ [.ch] ^ n2) K_u [0, 1] := by + have h1 : n1 = 1 + n2 * 2 := by omega + rw [h1, zLp1] + have hh : Seg ([.ch] ++ [.ch] ^ (n2 * 2)) ([.cf] ++ [.ch] ^ n2) [1, 1] Qp := + segP_append_calls seg_ch_11_cf (seg_ch_Qp_even n2) + simpa using segP_append_calls seg_ck_K hh + +theorem raw_PureH_K_half0 {n1 n2 : Nat} (hn : 2 <= n1) (hp : n1 % 2 = 0) (h2 : n2 = n1 / 2) : + Seg ([.ch] ^ n1) ([.ch] ^ n2) K_u [0, 0] := by + have h1 : n1 = n2 * 2 := by omega + rw [h1]; exact seg_ch_K_even n2 + +theorem raw_PureH_K_half1 {n1 n2 : Nat} (hn : 2 <= n1) (hp : n1 % 2 = 1) (h2 : n2 = n1 / 2) : + Seg ([.ch] ^ n1) ([.ch] ^ n2) K_u [0, 1] := by + have h1 : n1 = 1 + n2 * 2 := by omega + rw [h1]; exact seg_ch_K_odd n2 + +theorem raw_PureH_K_dbl2 {n1 n2 : Nat} (hn : 2 <= n1) (h2 : n2 = 2 * n1 - 2) : + Seg ([.ch] ^ n1) (pairA ^ n2) K_u [0, 1] := by + have h1 : n1 = 1 + (n1 - 1) := by omega + have h_out : n2 = (n1 - 1) * 2 := by omega + rw [h1, zLp1] + rw [h_out] + simpa using segP_append_calls seg_ch_K (seg_ch_Qp_dbl_pow (n1 - 1)) + +theorem raw_PureA_Q_keep {n1 n2 : Nat} (hn : 2 <= n1) (h2 : n2 = n1) : + Seg (pairA ^ n1) ([.ch] ^ n2) Q_u [1, 0] := by + subst h2; exact seg_pairA_Q_pow _ + +theorem raw_CfA_Q_keep {n1 n2 : Nat} (hn : 2 <= n1) (h2 : n2 = n1) : + Seg ([.cf] ++ pairA ^ n1) ([.ch] ^ n2) Q_u [1, 0] := by + simpa using segP_append_calls (seg_cf_keep [0]) (raw_PureA_Q_keep hn h2) + +theorem raw_PureH_Q_dbl1 {n1 n2 : Nat} (hn : 2 <= n1) (h2 : n2 = 2 * n1 - 1) : + Seg ([.ch] ^ n1) (pairA ^ n2) Q_u [0, 1] := by + have h1 : n1 = 1 + (n1 - 1) := by omega + have h_out : n2 = 1 + (n1 - 1) * 2 := by omega + rw [h1, zLp1] + rw [h_out, zLp1] + simpa using segP_append_calls seg_ch_Q_cbcf (seg_ch_Qp_dbl_pow (n1 - 1)) + +theorem raw_CfH_Q_dbl1 {n1 n2 : Nat} (hn : 2 <= n1) (h2 : n2 = 2 * n1 - 1) : + Seg ([.cf] ++ [.ch] ^ n1) (pairA ^ n2) Q_u [0, 1] := by + simpa using segP_append_calls (seg_cf_keep [0]) (raw_PureH_Q_dbl1 hn h2) + +-- 7-leg Hub Turnaround (`pairA ^ 3` = 6 subcalls) +theorem zP0 (w : HalfTape) : (zCf w) [tm]⊢⁺ (zCR w .cb ([0, 1] +> default)) := by + unfold zCf zCR zInQ zInB; simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq]; execute +theorem zP1 (w : HalfTape) : (zCL w .cb ([0, 1] +> default)) [tm]⊢⁺ (zCR w .cf ([0, 1] +> default)) := by + unfold zCL zCR zInQ zInB zExQ zExB; simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq]; execute +theorem zP2 (w : HalfTape) : (zCL w .cf ([0, 1] +> default)) [tm]⊢⁺ (zCR w .cb ([1, 1, 0, 1] +> default)) := by + unfold zCL zCR zInQ zInB zExQ zExB; simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq]; execute +theorem zP3 (w : HalfTape) : (zCL w .cb ([1, 1, 0, 1] +> default)) [tm]⊢⁺ (zCR w .cf ([1, 1, 0, 1] +> default)) := by + unfold zCL zCR zInQ zInB zExQ zExB; simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq]; execute +theorem zP4 (w : HalfTape) : (zCL w .cf ([1, 1, 0, 1] +> default)) [tm]⊢⁺ (zCR w .cb ([0, 1, 0, 1] +> default)) := by + unfold zCL zCR zInQ zInB zExQ zExB; simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq]; execute +theorem zP5 (w : HalfTape) : (zCL w .cb ([0, 1, 0, 1] +> default)) [tm]⊢⁺ (zCR w .cf ([0, 1, 0, 1] +> default)) := by + unfold zCL zCR zInQ zInB zExQ zExB; simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq]; execute +theorem zP6 (w : HalfTape) : (zCL w .cf ([0, 1, 0, 1] +> default)) [tm]⊢⁺ (zCf ([1, 1, 0, 0, 1] +> w)) := by + unfold zCL zCf zExQ zExB; simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq]; execute + +theorem Side_turnaround {w w' : HalfTape} (h : Side (pairA ^ 3) w w') : + (zCf w) [tm]⊢⁺ (zCf ([1, 1, 0, 0, 1] +> w')) := by + rcases h with _ | ⟨hc1, _ | ⟨hc2, _ | ⟨hc3, _ | ⟨hc4, _ | ⟨hc5, _ | ⟨hc6, hnil⟩⟩⟩⟩⟩⟩ + cases hnil + exact stepPlus_trans_vkq (zP0 w) (stepPlus_trans_vkq (hc1 ([0, 1] +> default)) + (stepPlus_trans_vkq (zP1 _) (stepPlus_trans_vkq (hc2 ([0, 1] +> default)) + (stepPlus_trans_vkq (zP2 _) (stepPlus_trans_vkq (hc3 ([1, 1, 0, 1] +> default)) + (stepPlus_trans_vkq (zP3 _) (stepPlus_trans_vkq (hc4 ([1, 1, 0, 1] +> default)) + (stepPlus_trans_vkq (zP4 _) (stepPlus_trans_vkq (hc5 ([0, 1, 0, 1] +> default)) + (stepPlus_trans_vkq (zP5 _) (stepPlus_trans_vkq (hc6 ([0, 1, 0, 1] +> default)) (zP6 w')))))))))))) + +abbrev zWt_zTs_aux := wordsToBitsShifted_append_tape + +theorem Side_ch_default {b' H : Nat} {da : List Word} (h : DigitVal b' H da) : + Side ([.ch] ^ b') default (evalWordsShifted da default) := by + induction h with + | nil => exact SideP.nil default + | @zero A H u _ ih => + have hS := sideP_of_segP (seg_ch_K_even A) ih + simpa [evalWordsShifted, K_u, Kp] using hS + | @one A H u _ ih => + have hS := sideP_of_segP (seg_ch_K_odd A) ih + simpa [evalWordsShifted, K_u, Kp] using hS + +inductive Mode where + | PA1 | FA1 | KA1 | KHV | PHV | FH0 | FH1 | PH0 | PH1 +deriving DecidableEq, Repr + +inductive DState where + | S2 | S3 | S4 | S5 +deriving DecidableEq, Repr + +def modeCalls : Mode -> Nat -> List Call + | .PA1, n => pairA ^ n + | .FA1, n => [.cf] ++ pairA ^ n + | .KA1, n => [.ck] ++ pairA ^ n + | .KHV, n => [.ck] ++ [.ch] ^ n + | .PHV, n => [.ch] ^ n + | .FH0, n => [.cf] ++ [.ch] ^ n + | .FH1, n => [.cf] ++ [.ch] ^ n + | .PH0, n => [.ch] ^ n + | .PH1, n => [.ch] ^ n + +def modeRem : Mode -> BitWord + | .PA1 | .FA1 | .KA1 => [1] + | .KHV | .PHV => [1, 1, 0] + | .FH0 | .PH0 => [0] + | .FH1 | .PH1 => [1] + +def modeMatches : Mode -> DState -> Bool + | .PA1, .S2 | .FA1, .S2 => true + | .KHV, .S3 | .PHV, .S3 | .PH0, .S3 | .PH1, .S3 => true + | .PHV, .S4 | .FH0, .S4 | .PH0, .S4 | .FH1, .S4 | .PH1, .S4 => true + | .KA1, .S5 | .PHV, .S5 | .PH0, .S5 | .PH1, .S5 => true + | _, _ => false + +def dfaStep : Word -> DState -> DState + | V, .S3 => .S4 + | V, _ => .S2 + | K, .S3 => .S5 + | K, _ => .S3 + | Q, .S2 => .S4 + | Q, _ => .S2 + +def dfaRun : List Word -> DState -> DState + | [], s => s + | w :: u, s => dfaStep w (dfaRun u s) + +theorem dfaStep_VV (s : DState) : dfaStep V (dfaStep V s) = .S2 := by + cases s <;> rfl + +inductive NKinds where + | dbl2 | dbl1 | keep | half0 | half1 +deriving DecidableEq, Repr + +def validKind : NKinds -> Nat -> Nat -> Prop + | .dbl2, n1, n2 => 2 <= n1 ∧ n2 = 2 * n1 - 2 + | .dbl1, n1, n2 => 2 <= n1 ∧ n2 = 2 * n1 - 1 + | .keep, n1, n2 => 2 <= n1 ∧ n2 = n1 + | .half0, n1, n2 => 2 <= n1 ∧ n1 % 2 = 0 ∧ n2 = n1 / 2 + | .half1, n1, n2 => 2 <= n1 ∧ n1 % 2 = 1 ∧ n2 = n1 / 2 + +inductive StepRule where + | R00 | R01 | R02 | R03 | R04 | R05 | R06 | R07 | R08 | R09 | R10 | R11 | R12 | R13 | R14 | R15 | R16 | R17 | R18 | R19 | R20 | R21 | R22 | R23 | R24 | R25 | R26 | R27 | R28 | R29 | R30 | R31 | R32 | R33 +deriving DecidableEq, Repr + +def rInMode : StepRule -> Mode + | .R00 => .PA1 + | .R01 => .PA1 + | .R02 => .PA1 + | .R03 => .PA1 + | .R04 => .PA1 + | .R05 => .FA1 + | .R06 => .FA1 + | .R07 => .FA1 + | .R08 => .FA1 + | .R09 => .FA1 + | .R10 => .KA1 + | .R11 => .KHV + | .R12 => .KHV + | .R13 => .KHV + | .R14 => .KHV + | .R15 => .PHV + | .R16 => .PHV + | .R17 => .PHV + | .R18 => .PHV + | .R19 => .PHV + | .R20 => .FH0 + | .R21 => .FH0 + | .R22 => .FH1 + | .R23 => .FH1 + | .R24 => .PH0 + | .R25 => .PH0 + | .R26 => .PH0 + | .R27 => .PH0 + | .R28 => .PH0 + | .R29 => .PH1 + | .R30 => .PH1 + | .R31 => .PH1 + | .R32 => .PH1 + | .R33 => .PH1 + +def rWord : StepRule -> Word + | .R00 => V + | .R01 => V + | .R02 => V + | .R03 => V + | .R04 => Q + | .R05 => V + | .R06 => V + | .R07 => V + | .R08 => V + | .R09 => Q + | .R10 => K + | .R11 => K + | .R12 => K + | .R13 => K + | .R14 => K + | .R15 => V + | .R16 => K + | .R17 => K + | .R18 => K + | .R19 => Q + | .R20 => V + | .R21 => Q + | .R22 => V + | .R23 => Q + | .R24 => V + | .R25 => K + | .R26 => K + | .R27 => K + | .R28 => Q + | .R29 => V + | .R30 => K + | .R31 => K + | .R32 => K + | .R33 => Q + +def rKind : StepRule -> NKinds + | .R00 => .dbl2 + | .R01 => .dbl1 + | .R02 => .half0 + | .R03 => .half1 + | .R04 => .keep + | .R05 => .dbl2 + | .R06 => .dbl1 + | .R07 => .half0 + | .R08 => .half1 + | .R09 => .keep + | .R10 => .keep + | .R11 => .dbl2 + | .R12 => .dbl1 + | .R13 => .half0 + | .R14 => .half1 + | .R15 => .dbl1 + | .R16 => .half0 + | .R17 => .half1 + | .R18 => .dbl2 + | .R19 => .dbl1 + | .R20 => .dbl1 + | .R21 => .dbl1 + | .R22 => .dbl1 + | .R23 => .dbl1 + | .R24 => .dbl1 + | .R25 => .half0 + | .R26 => .half1 + | .R27 => .dbl2 + | .R28 => .dbl1 + | .R29 => .dbl1 + | .R30 => .half0 + | .R31 => .half1 + | .R32 => .dbl2 + | .R33 => .dbl1 + +def rOutMode : StepRule -> Mode + | .R00 => .FA1 + | .R01 => .KA1 + | .R02 => .FH0 + | .R03 => .FH1 + | .R04 => .PHV + | .R05 => .FA1 + | .R06 => .KA1 + | .R07 => .FH0 + | .R08 => .FH1 + | .R09 => .PHV + | .R10 => .KHV + | .R11 => .FA1 + | .R12 => .KA1 + | .R13 => .FH0 + | .R14 => .FH1 + | .R15 => .KHV + | .R16 => .PH0 + | .R17 => .PH1 + | .R18 => .PA1 + | .R19 => .PA1 + | .R20 => .KHV + | .R21 => .PA1 + | .R22 => .KHV + | .R23 => .PA1 + | .R24 => .KHV + | .R25 => .PH0 + | .R26 => .PH1 + | .R27 => .PA1 + | .R28 => .PA1 + | .R29 => .KHV + | .R30 => .PH0 + | .R31 => .PH1 + | .R32 => .PA1 + | .R33 => .PA1 + +def rOb : StepRule -> BitWord + | .R00 => [1, 0, 0, 1] + | .R01 => [1, 0, 0, 1] + | .R02 => [1, 0, 0, 0] + | .R03 => [1, 0, 0, 1] + | .R04 => [1, 0] + | .R05 => [1, 0, 0, 1] + | .R06 => [1, 0, 0, 1] + | .R07 => [1, 0, 0, 0] + | .R08 => [1, 0, 0, 1] + | .R09 => [1, 0] + | .R10 => [1, 0] + | .R11 => [0, 1] + | .R12 => [0, 1] + | .R13 => [0, 0] + | .R14 => [0, 1] + | .R15 => [0, 1, 1, 0] + | .R16 => [0, 0] + | .R17 => [0, 1] + | .R18 => [0, 1] + | .R19 => [0, 1] + | .R20 => [0, 1, 1, 0] + | .R21 => [0, 1] + | .R22 => [0, 1, 1, 0] + | .R23 => [0, 1] + | .R24 => [0, 1, 1, 0] + | .R25 => [0, 0] + | .R26 => [0, 1] + | .R27 => [0, 1] + | .R28 => [0, 1] + | .R29 => [0, 1, 1, 0] + | .R30 => [0, 0] + | .R31 => [0, 1] + | .R32 => [0, 1] + | .R33 => [0, 1] + +def rEmit : StepRule -> List Word + | .R00 => [V] + | .R01 => [V] + | .R02 => [V] + | .R03 => [V] + | .R04 => [] + | .R05 => [V] + | .R06 => [V] + | .R07 => [V] + | .R08 => [V] + | .R09 => [] + | .R10 => [] + | .R11 => [V] + | .R12 => [V] + | .R13 => [V] + | .R14 => [V] + | .R15 => [V] + | .R16 => [V] + | .R17 => [V] + | .R18 => [V] + | .R19 => [V] + | .R20 => [K] + | .R21 => [K] + | .R22 => [Q] + | .R23 => [Q] + | .R24 => [K] + | .R25 => [K] + | .R26 => [K] + | .R27 => [K] + | .R28 => [K] + | .R29 => [Q] + | .R30 => [Q] + | .R31 => [Q] + | .R32 => [Q] + | .R33 => [Q] + +def rG : StepRule -> Nat + | .R00 => 0 + | .R01 => 2 + | .R02 => 0 + | .R03 => 0 + | .R04 => 3 + | .R05 => 0 + | .R06 => 2 + | .R07 => 0 + | .R08 => 0 + | .R09 => 3 + | .R10 => 1 + | .R11 => 0 + | .R12 => 2 + | .R13 => 0 + | .R14 => 0 + | .R15 => 0 + | .R16 => 0 + | .R17 => 0 + | .R18 => 0 + | .R19 => 0 + | .R20 => 0 + | .R21 => 0 + | .R22 => 0 + | .R23 => 0 + | .R24 => 0 + | .R25 => 0 + | .R26 => 0 + | .R27 => 0 + | .R28 => 0 + | .R29 => 0 + | .R30 => 0 + | .R31 => 0 + | .R32 => 0 + | .R33 => 0 + +theorem stepRule_rem (r : StepRule) : + modeRem (rInMode r) ++ rOb r = wordsToBits (rEmit r) ++ modeRem (rOutMode r) := by + cases r <;> rfl + +theorem stepRule_seg : ∀ (r : StepRule) (n1 n2 : Nat), validKind (rKind r) n1 n2 -> + Seg (modeCalls (rInMode r) n1) (modeCalls (rOutMode r) n2) (wordsToBits [rWord r]) (rOb r) + | .R00, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_PureA_V_dbl2 hn h2 + | .R01, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_PureA_V_dbl1 hn h2 + | .R02, _, _, h => by rcases h with ⟨hn, hp, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_PureA_V_half0 hn hp h2 + | .R03, _, _, h => by rcases h with ⟨hn, hp, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_PureA_V_half1 hn hp h2 + | .R04, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_PureA_Q_keep hn h2 + | .R05, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_CfA_V_dbl2 hn h2 + | .R06, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_CfA_V_dbl1 hn h2 + | .R07, _, _, h => by rcases h with ⟨hn, hp, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_CfA_V_half0 hn hp h2 + | .R08, _, _, h => by rcases h with ⟨hn, hp, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_CfA_V_half1 hn hp h2 + | .R09, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_CfA_Q_keep hn h2 + | .R10, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_CkA_K_keep hn h2 + | .R11, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_CkH_K_dbl2 hn h2 + | .R12, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_CkH_K_dbl1 hn h2 + | .R13, _, _, h => by rcases h with ⟨hn, hp, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_CkH_K_half0 hn hp h2 + | .R14, _, _, h => by rcases h with ⟨hn, hp, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_CkH_K_half1 hn hp h2 + | .R15, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_PureH_V_dbl1 hn h2 + | .R16, _, _, h => by rcases h with ⟨hn, hp, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_PureH_K_half0 hn hp h2 + | .R17, _, _, h => by rcases h with ⟨hn, hp, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_PureH_K_half1 hn hp h2 + | .R18, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_PureH_K_dbl2 hn h2 + | .R19, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_PureH_Q_dbl1 hn h2 + | .R20, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_CfH_V_dbl1 hn h2 + | .R21, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_CfH_Q_dbl1 hn h2 + | .R22, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_CfH_V_dbl1 hn h2 + | .R23, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_CfH_Q_dbl1 hn h2 + | .R24, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_PureH_V_dbl1 hn h2 + | .R25, _, _, h => by rcases h with ⟨hn, hp, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_PureH_K_half0 hn hp h2 + | .R26, _, _, h => by rcases h with ⟨hn, hp, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_PureH_K_half1 hn hp h2 + | .R27, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_PureH_K_dbl2 hn h2 + | .R28, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_PureH_Q_dbl1 hn h2 + | .R29, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_PureH_V_dbl1 hn h2 + | .R30, _, _, h => by rcases h with ⟨hn, hp, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_PureH_K_half0 hn hp h2 + | .R31, _, _, h => by rcases h with ⟨hn, hp, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_PureH_K_half1 hn hp h2 + | .R32, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_PureH_K_dbl2 hn h2 + | .R33, _, _, h => by rcases h with ⟨hn, h2⟩; simpa [rInMode, rOutMode, rWord, rOb, modeCalls, wordsToBits] using raw_PureH_Q_dbl1 hn h2 + +inductive Scan : Mode -> DState -> Nat -> List Word -> Mode -> DState -> Nat -> List Word -> Nat -> Prop where + | nil (m : Mode) (s : DState) (n : Nat) (hm : modeMatches m s = true) (hn : 2 <= n) : + Scan m s n [] m s n [] 0 + | step {r : StepRule} {s1 s2 s3 : DState} {n1 n2 n3 g : Nat} {u v : List Word} {m3 : Mode} + (hs : s1 = dfaStep (rWord r) s2) + (hm1 : modeMatches (rInMode r) s1 = true) + (hv : validKind (rKind r) n1 n2) + (hrest : Scan (rOutMode r) s2 n2 u m3 s3 n3 v g) : + Scan (rInMode r) s1 n1 (rWord r :: u) m3 s3 n3 (rEmit r ++ v) (rG r + g) + +theorem Scan_match_in {m1 : Mode} {s1 : DState} {n1 : Nat} {u : List Word} + {m2 : Mode} {s2 : DState} {n2 : Nat} {v : List Word} {g : Nat} + (h : Scan m1 s1 n1 u m2 s2 n2 v g) : modeMatches m1 s1 = true := by + cases h with + | nil _ _ _ hm _ => exact hm + | step _ hm1 _ _ => exact hm1 + +theorem Scan_exit_ge2 {m1 : Mode} {s1 : DState} {n1 : Nat} {u : List Word} + {m2 : Mode} {s2 : DState} {n2 : Nat} {v : List Word} {g : Nat} + (h : Scan m1 s1 n1 u m2 s2 n2 v g) : 2 <= n2 ∧ modeMatches m2 s2 = true := by + induction h with + | nil _ _ _ hm hn => exact ⟨hn, hm⟩ + | step _ _ _ _ ih => exact ih + +theorem Scan_append {m1 : Mode} {s1 : DState} {n1 : Nat} {u1 : List Word} + {m2 : Mode} {s2 : DState} {n2 : Nat} {v1 : List Word} {g1 : Nat} + (h1 : Scan m1 s1 n1 u1 m2 s2 n2 v1 g1) : + ∀ {m3 : Mode} {s3 : DState} {n3 : Nat} {u2 v2 : List Word} {g2 : Nat}, + Scan m2 s2 n2 u2 m3 s3 n3 v2 g2 -> + Scan m1 s1 n1 (u1 ++ u2) m3 s3 n3 (v1 ++ v2) (g1 + g2) := by + induction h1 with + | nil _ _ _ _ _ => intro _ _ _ _ _ _ h2; simpa using h2 + | @step r s1 s2 _ n1 n2 _ g1 u1 v1 _ hs hm1 hv _ ih => + intro _ _ _ _ v2 g2 h2 + have hI := ih h2 + have h_v : rEmit r ++ (v1 ++ v2) = (rEmit r ++ v1) ++ v2 := by simp [List.append_assoc] + have h_g : rG r + (g1 + g2) = rG r + g1 + g2 := by omega + rw [<- h_v, <- h_g] + exact Scan.step hs hm1 hv hI + +theorem Side_of_Scan {m1 : Mode} {s1 : DState} {n1 : Nat} {u : List Word} + {m2 : Mode} {s2 : DState} {n2 : Nat} {v : List Word} {g : Nat} + (h : Scan m1 s1 n1 u m2 s2 n2 v g) : + ∀ (u_tail w_tail : HalfTape), + Side (modeCalls m2 n2) u_tail w_tail -> + ∃ w_out, + Side (modeCalls m1 n1) (evalWords u u_tail) w_out ∧ + modeRem m1 +> w_out = evalWords v (modeRem m2 +> w_tail) := by + induction h with + | nil _ _ _ _ _ => + intro u_tail w_tail hSide + exact ⟨w_tail, hSide, rfl⟩ + | @step r _ _ _ n1 n2 _ _ u v m3 _ _ hv _ ih => + intro u_tail w_tail hSide + rcases ih u_tail w_tail hSide with ⟨w_mid, hSide_mid, hEq_mid⟩ + have hSeg1 := stepRule_seg r n1 n2 hv + have hSide1 := sideP_of_segP hSeg1 hSide_mid + have h_in_eq : wordsToBits [rWord r] +> evalWords u u_tail = evalWords (rWord r :: u) u_tail := by + cases hw : rWord r <;> simp [wordsToBits, evalWords] + rw [h_in_eq] at hSide1 + refine ⟨rOb r +> w_mid, hSide1, ?_⟩ + rw [<- append_assoc, stepRule_rem r, append_assoc, hEq_mid, wordsToBits_append_tape, <- evalWords_append] + +def Step (u u' : List Word) : Prop := + ∃ body m_end n_end v_body da H g, + u = body ++ [Q] ∧ + (m_end = .PA1 ∨ m_end = .FA1) ∧ + Scan .PA1 .S2 3 body m_end .S2 n_end v_body g ∧ + DigitVal n_end H da ∧ + u' = V :: (v_body ++ V :: da) + +inductive Rounds : List Word -> List Word -> Prop where + | refl (u : List Word) : Rounds u u + | next {u v w : List Word} : Step u v -> Rounds v w -> Rounds u w + +theorem Step_exec {u u' : List Word} (h : Step u u') : + (zCf (evalWords u default)) [tm]⊢⁺ (zCf (evalWords u' default)) := by + rcases h with ⟨body, m_end, n_end, v_body, da, H, g, rfl, hm_end, hScan, hDg, rfl⟩ + have hn_end : 2 <= n_end := (Scan_exit_ge2 hScan).1 + have hSide_da := Side_ch_default hDg + have hSegQ : Seg (modeCalls m_end n_end) (modeCalls .PHV n_end) Q_u [1, 0] := by + rcases hm_end with rfl | rfl + · exact raw_PureA_Q_keep hn_end rfl + · exact raw_CfA_Q_keep hn_end rfl + have hSideQ := sideP_of_segP hSegQ hSide_da + rcases Side_of_Scan hScan (Q_u +> default) ([1, 0] +> evalWordsShifted da default) hSideQ with ⟨w_out, hSide0, hEq0⟩ + have h_u_eq : evalWords body (Q_u +> default) = evalWords (body ++ [Q]) default := by + rw [evalWords_append]; rfl + rw [h_u_eq] at hSide0 + have h_rem_end : modeRem m_end = [1] := by rcases hm_end with rfl | rfl <;> rfl + rw [h_rem_end] at hEq0 + dsimp [modeRem] at hEq0 + have h_mid : (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> evalWordsShifted da default = evalWords (V :: da) default := + evalWords_V_shift da + rw [h_mid, <- evalWords_append] at hEq0 + have hTurn := Side_turnaround hSide0 + have h_top : [1, 1, 0, 0, 1] +> w_out = evalWords (V :: (v_body ++ V :: da)) default := by + change V_u +> ((1 : Fin 2) >> w_out) = V_u +> evalWords (v_body ++ V :: da) default + rw [hEq0] + rwa [h_top] at hTurn + +theorem Rounds_exec {u v : List Word} (h : Rounds u v) : + (zCf (evalWords u default)) [tm]⊢* (zCf (evalWords v default)) := by + induction h with + | refl _ => exact ⟨0, rfl⟩ + | next hS _ ih => exact stepStar_of_stepPlus_vkq (stepPlus_stepStar_trans_vkq (Step_exec hS) ih) + +-- Section 3: Affine Evaluator for Concrete Rounds and Symbolic `head_w`, `s_full`, `top_body` +def evalAffineScan : List StepRule -> Mode -> DState -> Nat -> Nat -> List Word -> + Option (Mode × Nat × Nat × List Word × Nat) + | [], m, s, mb, cb, [] => + if modeMatches m s && 2 <= cb then some (m, mb, cb, [], 0) else none + | r :: rs, m, s, mb, cb, w :: u => + if m == rInMode r && w == rWord r && modeMatches m (dfaStep w (dfaRun u s)) && 2 <= cb then + match rKind r with + | .dbl2 => + match evalAffineScan rs (rOutMode r) s (2 * mb) (2 * cb - 2) u with + | none => none + | some (m_end, mb_end, cb_end, v, g) => + some (m_end, mb_end, cb_end, rEmit r ++ v, rG r + g) + | .dbl1 => + match evalAffineScan rs (rOutMode r) s (2 * mb) (2 * cb - 1) u with + | none => none + | some (m_end, mb_end, cb_end, v, g) => + some (m_end, mb_end, cb_end, rEmit r ++ v, rG r + g) + | .keep => + match evalAffineScan rs (rOutMode r) s mb cb u with + | none => none + | some (m_end, mb_end, cb_end, v, g) => + some (m_end, mb_end, cb_end, rEmit r ++ v, rG r + g) + | .half0 => + if mb % 2 == 0 && cb % 2 == 0 then + match evalAffineScan rs (rOutMode r) s (mb / 2) (cb / 2) u with + | none => none + | some (m_end, mb_end, cb_end, v, g) => + some (m_end, mb_end, cb_end, rEmit r ++ v, rG r + g) + else none + | .half1 => + if mb % 2 == 0 && cb % 2 == 1 then + match evalAffineScan rs (rOutMode r) s (mb / 2) (cb / 2) u with + | none => none + | some (m_end, mb_end, cb_end, v, g) => + some (m_end, mb_end, cb_end, rEmit r ++ v, rG r + g) + else none + else none + | _, _, _, _, _, _ => none + +theorem evalAffineScan_sound : + ∀ rs m s mb cb u m_end mb_end cb_end v g q, + evalAffineScan rs m s mb cb u = some (m_end, mb_end, cb_end, v, g) -> + Scan m (dfaRun u s) (mb * q + cb) u m_end s (mb_end * q + cb_end) v g := by + intro rs + induction rs with + | nil => + intro m s mb cb u m_end mb_end cb_end v g q h + cases u with + | nil => + simp only [evalAffineScan] at h + split_ifs at h with hc + simp only [Bool.and_eq_true, decide_eq_true_eq] at hc + simp at h; rcases h with ⟨rfl, rfl, rfl, rfl, rfl⟩ + exact Scan.nil m s _ hc.1 (by omega) + | cons _ _ => unfold evalAffineScan at h; contradiction + | cons r rs ih => + intro m s mb cb u m_end mb_end cb_end v g q h + cases u with + | nil => unfold evalAffineScan at h; contradiction + | cons w u => + change evalAffineScan (r :: rs) m s mb cb (w :: u) = _ at h + unfold evalAffineScan at h + cases hcond : (m == rInMode r && w == rWord r && modeMatches m (dfaStep w (dfaRun u s)) && 2 <= cb) + · rw [hcond] at h; simp at h + · rw [hcond, if_pos rfl] at h + simp only [Bool.and_eq_true, beq_iff_eq, decide_eq_true_eq] at hcond + rcases hcond with ⟨⟨⟨rfl, rfl⟩, hm1⟩, hcb⟩ + cases hk : rKind r <;> simp only [hk] at h + · -- dbl2 + cases hrec : evalAffineScan rs (rOutMode r) s (2 * mb) (2 * cb - 2) u with + | none => rw [hrec] at h; contradiction + | some val => + rw [hrec] at h; rcases val with ⟨me, mbe, cbe, v1, g1⟩ + simp at h; rcases h with ⟨rfl, rfl, rfl, rfl, rfl⟩ + have hI := ih _ _ _ _ _ _ _ _ _ _ q hrec + have hm_eq : 2 * mb * q = 2 * (mb * q) := by ring + have h_eq : 2 * mb * q + (2 * cb - 2) = 2 * (mb * q + cb) - 2 := by omega + rw [h_eq] at hI + exact Scan.step rfl hm1 (by rw [hk]; exact ⟨by omega, rfl⟩) hI + · -- dbl1 + cases hrec : evalAffineScan rs (rOutMode r) s (2 * mb) (2 * cb - 1) u with + | none => rw [hrec] at h; contradiction + | some val => + rw [hrec] at h; rcases val with ⟨me, mbe, cbe, v1, g1⟩ + simp at h; rcases h with ⟨rfl, rfl, rfl, rfl, rfl⟩ + have hI := ih _ _ _ _ _ _ _ _ _ _ q hrec + have hm_eq : 2 * mb * q = 2 * (mb * q) := by ring + have h_eq : 2 * mb * q + (2 * cb - 1) = 2 * (mb * q + cb) - 1 := by omega + rw [h_eq] at hI + exact Scan.step rfl hm1 (by rw [hk]; exact ⟨by omega, rfl⟩) hI + · -- keep + cases hrec : evalAffineScan rs (rOutMode r) s mb cb u with + | none => rw [hrec] at h; contradiction + | some val => + rw [hrec] at h; rcases val with ⟨me, mbe, cbe, v1, g1⟩ + simp at h; rcases h with ⟨rfl, rfl, rfl, rfl, rfl⟩ + have hI := ih _ _ _ _ _ _ _ _ _ _ q hrec + exact Scan.step rfl hm1 (by rw [hk]; exact ⟨by omega, rfl⟩) hI + · -- half0 + cases hp0 : (mb % 2 == 0 && cb % 2 == 0) + · rw [hp0] at h; simp at h + · rw [hp0, if_pos rfl] at h + simp only [Bool.and_eq_true, beq_iff_eq] at hp0 + cases hrec : evalAffineScan rs (rOutMode r) s (mb / 2) (cb / 2) u with + | none => rw [hrec] at h; contradiction + | some val => + rw [hrec] at h; rcases val with ⟨me, mbe, cbe, v1, g1⟩ + simp at h; rcases h with ⟨rfl, rfl, rfl, rfl, rfl⟩ + have hI := ih _ _ _ _ _ _ _ _ _ _ q hrec + have hm2 : 2 * (mb / 2) = mb := by omega + have hm_eq : 2 * (mb / 2 * q) = mb * q := by + calc 2 * (mb / 2 * q) = (2 * (mb / 2)) * q := by ring + _ = mb * q := by rw [hm2] + have h_eq : mb / 2 * q + cb / 2 = (mb * q + cb) / 2 := by omega + rw [h_eq] at hI + exact Scan.step rfl hm1 (by rw [hk]; exact ⟨by omega, by omega, rfl⟩) hI + · -- half1 + cases hp1 : (mb % 2 == 0 && cb % 2 == 1) + · rw [hp1] at h; simp at h + · rw [hp1, if_pos rfl] at h + simp only [Bool.and_eq_true, beq_iff_eq] at hp1 + cases hrec : evalAffineScan rs (rOutMode r) s (mb / 2) (cb / 2) u with + | none => rw [hrec] at h; contradiction + | some val => + rw [hrec] at h; rcases val with ⟨me, mbe, cbe, v1, g1⟩ + simp at h; rcases h with ⟨rfl, rfl, rfl, rfl, rfl⟩ + have hI := ih _ _ _ _ _ _ _ _ _ _ q hrec + have hm2 : 2 * (mb / 2) = mb := by omega + have hm_eq : 2 * (mb / 2 * q) = mb * q := by + calc 2 * (mb / 2 * q) = (2 * (mb / 2)) * q := by ring + _ = mb * q := by rw [hm2] + have h_eq : mb / 2 * q + cb / 2 = (mb * q + cb) / 2 := by omega + rw [h_eq] at hI + exact Scan.step rfl hm1 (by rw [hk]; exact ⟨by omega, by omega, rfl⟩) hI + +def checkStep (rs : List StepRule) (body da u' : List Word) : Bool := + (dfaRun body .S2 == .S2) && + match evalAffineScan rs .PA1 .S2 0 3 body with + | some (m_end, 0, n_end, v_body, _) => + (m_end == .PA1 || m_end == .FA1) && checkDg n_end da && (u' == V :: (v_body ++ V :: da)) + | _ => false + +theorem checkStep_sound (rs : List StepRule) (body da u' : List Word) + (h : checkStep rs body da u' = true) : Step (body ++ [Q]) u' := by + unfold checkStep at h + simp only [Bool.and_eq_true] at h + rcases h with ⟨hdfa, hrest⟩ + rw [beq_iff_eq] at hdfa + cases hrec : evalAffineScan rs .PA1 .S2 0 3 body with + | none => rw [hrec] at hrest; contradiction + | some val => + rw [hrec] at hrest + rcases val with ⟨m_end, mb_end, n_end, v_body, g⟩ + rcases mb_end with _ | mb_end + · simp only [Bool.and_eq_true, Bool.or_eq_true, beq_iff_eq] at hrest + rcases hrest with ⟨⟨hm_end, hdg⟩, hu'⟩ + have hScan := evalAffineScan_sound rs .PA1 .S2 0 3 body m_end 0 n_end v_body g 0 hrec + rw [hdfa] at hScan + simp only [Nat.zero_mul, Nat.zero_add] at hScan + exact ⟨body, m_end, n_end, v_body, da, da.length, g, rfl, hm_end, hScan, checkDg_sound n_end da hdg, hu'⟩ + · contradiction + +-- Section 4: Algebraic Identities & Potential Bounds Across All 34 `StepRule`s +def wordPot : List Word -> Rat + | [] => 0 + | V :: u => 1 / 8 + (1 / 2) * wordPot u + | K :: u => 1 + 2 * wordPot u + | Q :: u => 1 / 4 + 2 * wordPot u + +theorem wordPot_nonneg (u : List Word) : 0 <= wordPot u := by + induction u with + | nil => simp [wordPot] + | cons a u ih => cases a <;> (dsimp [wordPot]; linarith) + +theorem zW_append (u t : List Word) : wordPot (u ++ t) = wordPot u + wordScale u * wordPot t := by + induction u with + | nil => simp [wordPot, wordScale] + | cons a u ih => cases a <;> (dsimp [wordPot, wordScale]; rw [ih]; ring) + +def psi : Mode -> Rat + | .KA1 | .KHV | .PHV => 1 + | _ => 4 + +def phi : Mode -> Rat + | .FH0 | .FH1 | .PH0 | .PH1 => 4 + | _ => 1 + +def alpha : Mode -> Rat + | .PA1 | .FA1 => 96 + | _ => 24 + +def addW : Word -> Rat + | V => 1 / 8 + | K => 1 + | Q => 1 / 4 + +def mulW : Word -> Rat + | V => 1 / 2 + | K => 2 + | Q => 2 + +theorem zW_cons (w : Word) (u : List Word) : wordPot (w :: u) = addW w + mulW w * wordPot u := by + cases w <;> rfl + +def multZW : Mode -> Rat + | .KHV => 15 / 32 + | .PHV => 15 / 4 + | _ => 15 / 8 + +def cSt : Mode -> Nat -> Rat + | .PA1, 0 | .FA1, 0 => 35 / 128 + | .PA1, 1 | .FA1, 1 => 7 / 256 + | .FH0, _ | .PH0, _ => 49 / 64 + | .FH1, _ | .PH1, _ => 1 / 64 + | .KA1, 0 | .KHV, 0 => 1 + | .KA1, 1 | .KHV, 1 => 0 + | _, _ => 0 + +def kqA : Mode -> DState -> Rat + | .PA1, .S2 | .FA1, .S2 => 1 / 8 + | .KA1, .S5 => 1 / 64 + | .KHV, .S3 => 1 / 32 + | .PHV, .S4 => 1 / 32 + | .PHV, .S3 | .PHV, .S5 => 1 / 4 + | .FH0, .S4 | .PH0, .S4 | .FH1, .S4 | .PH1, .S4 => 1 / 8 + | .PH0, .S3 | .PH0, .S5 | .PH1, .S3 | .PH1, .S5 => 1 + | _, _ => 0 + +def kqC : Mode -> DState -> Rat + | .PA1, .S2 | .FA1, .S2 => -1 / 8 + | .KA1, .S5 => 1 / 2 + | .KHV, .S3 => 1 / 2 + | .PHV, .S4 => 1 / 16 + | .PHV, .S3 | .PHV, .S5 => -3 / 8 + | .FH0, .S4 | .PH0, .S4 => 3 / 4 + | .FH1, .S4 | .PH1, .S4 => 0 + | .PH0, .S3 | .PH0, .S5 => -1 + | .PH1, .S3 | .PH1, .S5 => -7 / 4 + | _, _ => 0 + +theorem stepRule_z13 (r : StepRule) : + psi (rOutMode r) * wordScale (rEmit r) * ((2 ^ (rG r) : Nat) : Rat) = psi (rInMode r) * wordScale [rWord r] := by + cases r <;> norm_num [rInMode, rOutMode, rEmit, rG, rWord, psi, wordScale] + +theorem Scan_z13 {m1 : Mode} {s1 : DState} {n1 : Nat} {u : List Word} + {m2 : Mode} {s2 : DState} {n2 : Nat} {v : List Word} {g : Nat} + (h : Scan m1 s1 n1 u m2 s2 n2 v g) : + psi m2 * wordScale v * ((2 ^ g : Nat) : Rat) = psi m1 * wordScale u := by + induction h with + | nil _ _ _ _ _ => simp [wordScale] + | @step r _ _ _ _ _ _ g u v m3 _ _ _ _ ih => + have hr := stepRule_z13 r + have hu : wordScale (rWord r :: u) = wordScale [rWord r] * wordScale u := by + cases rWord r <;> (dsimp [wordScale]; ring) + rw [wordScale_append, Nat.pow_add, Nat.cast_mul, hu] + calc psi m3 * (wordScale (rEmit r) * wordScale v) * (((2 ^ rG r : Nat) : Rat) * ((2 ^ g : Nat) : Rat)) + _ = (psi m3 * wordScale v * ((2 ^ g : Nat) : Rat)) * (wordScale (rEmit r) * ((2 ^ rG r : Nat) : Rat)) := by ring + _ = (psi (rOutMode r) * wordScale u) * (wordScale (rEmit r) * ((2 ^ rG r : Nat) : Rat)) := by rw [ih] + _ = (psi (rOutMode r) * wordScale (rEmit r) * ((2 ^ rG r : Nat) : Rat)) * wordScale u := by ring + _ = (psi (rInMode r) * wordScale [rWord r]) * wordScale u := by rw [hr] + _ = psi (rInMode r) * (wordScale [rWord r] * wordScale u) := by ring + +def n2Slope : NKinds -> Rat + | .dbl2 | .dbl1 => 2 + | .keep => 1 + | .half0 | .half1 => 1 / 2 + +def n2Const : NKinds -> Rat + | .dbl2 => -2 + | .dbl1 => -1 + | .keep | .half0 => 0 + | .half1 => -1 / 2 + +theorem validKind_rat {k : NKinds} {n1 n2 : Nat} (hv : validKind k n1 n2) : + (n2 : Rat) = n2Slope k * (n1 : Rat) + n2Const k := by + cases k with + | dbl2 => + rcases hv with ⟨hn, rfl⟩ + have h1 : (2 * n1 - 2 : Nat) + 2 = 2 * n1 := by omega + have hr : ((2 * n1 - 2 : Nat) : Rat) + 2 = 2 * (n1 : Rat) := by exact_mod_cast h1 + dsimp [n2Slope, n2Const]; linarith + | dbl1 => + rcases hv with ⟨hn, rfl⟩ + have h1 : (2 * n1 - 1 : Nat) + 1 = 2 * n1 := by omega + have hr : ((2 * n1 - 1 : Nat) : Rat) + 1 = 2 * (n1 : Rat) := by exact_mod_cast h1 + dsimp [n2Slope, n2Const]; linarith + | keep => rcases hv with ⟨_, rfl⟩; dsimp [n2Slope, n2Const]; ring + | half0 => + rcases hv with ⟨_, hp, rfl⟩ + have h1 : (n1 / 2) * 2 = n1 := by omega + have hr : ((n1 / 2 : Nat) : Rat) * 2 = (n1 : Rat) := by exact_mod_cast h1 + dsimp [n2Slope, n2Const]; linarith + | half1 => + rcases hv with ⟨_, hp, rfl⟩ + have h1 : 1 + (n1 / 2) * 2 = n1 := by omega + have hr : 1 + ((n1 / 2 : Nat) : Rat) * 2 = (n1 : Rat) := by exact_mod_cast h1 + dsimp [n2Slope, n2Const]; linarith + +theorem delta_step_le (pIn pOut slope cst z13e zWe x : Rat) + (hc : pIn = pOut * slope * z13e ∧ 0 <= -pOut * cst * z13e ∧ -pOut * cst * z13e <= 16 * zWe) : + 0 <= pIn * x - pOut * (slope * x + cst) * z13e ∧ + pIn * x - pOut * (slope * x + cst) * z13e <= 16 * zWe := by + rcases hc with ⟨hs, hb1, hb2⟩ + have h_eq : pIn * x - pOut * (slope * x + cst) * z13e = -pOut * cst * z13e := by + rw [hs]; ring + rw [h_eq]; exact ⟨hb1, hb2⟩ + +theorem stepRule_delta (r : StepRule) (n1 n2 : Nat) (hv : validKind (rKind r) n1 n2) : + 0 <= phi (rInMode r) * (n1 : Rat) - phi (rOutMode r) * (n2 : Rat) * wordScale (rEmit r) ∧ + phi (rInMode r) * (n1 : Rat) - phi (rOutMode r) * (n2 : Rat) * wordScale (rEmit r) <= 16 * wordPot (rEmit r) := by + rw [validKind_rat hv] + cases r <;> refine delta_step_le _ _ _ _ _ _ _ ?_ <;> + norm_num [rInMode, rOutMode, rKind, rEmit, phi, n2Slope, n2Const, wordScale, wordPot] + +theorem Scan_delta {m1 : Mode} {s1 : DState} {n1 : Nat} {u : List Word} + {m2 : Mode} {s2 : DState} {n2 : Nat} {v : List Word} {g : Nat} + (h : Scan m1 s1 n1 u m2 s2 n2 v g) : + 0 <= phi m1 * (n1 : Rat) - phi m2 * (n2 : Rat) * wordScale v ∧ + phi m1 * (n1 : Rat) - phi m2 * (n2 : Rat) * wordScale v <= 16 * wordPot v := by + induction h with + | nil _ _ _ _ _ => simp [wordScale, wordPot] + | @step r _ _ _ n1 n2 n3 _ _ v m3 _ _ hv _ ih => + rcases stepRule_delta r n1 n2 hv with ⟨hs_lo, hs_hi⟩ + rcases ih with ⟨ih_lo, ih_hi⟩ + have hz_em : 0 <= wordScale (rEmit r) := le_of_lt (wordScale_pos (rEmit r)) + have hm_lo := mul_le_mul_of_nonneg_left ih_lo hz_em + have hm_hi := mul_le_mul_of_nonneg_left ih_hi hz_em + rw [wordScale_append, zW_append] + constructor <;> linarith + +theorem survive_step_le (a1 aW muW slope cst a2 zw : Rat) {n1 n2 : Nat} + (hz : 0 <= zw) + (hq : (n2 : Rat) = slope * (n1 : Rat) + cst) + (hb : a1 * (aW + muW * zw) <= (n1 : Rat) - 2) + (hc : 0 <= slope ∧ 0 <= a2 ∧ 2 <= slope * (2 + a1 * aW) + cst ∧ a2 <= slope * a1 * muW) : + 2 <= n2 ∧ a2 * zw <= (n2 : Rat) - 2 := by + rcases hc with ⟨hs_pos, ha2_pos, hb_n2, hs_ok⟩ + have h_lb : 2 + a1 * (aW + muW * zw) <= (n1 : Rat) := by linarith + have hm1 : slope * (2 + a1 * (aW + muW * zw)) <= slope * (n1 : Rat) := + mul_le_mul_of_nonneg_left h_lb hs_pos + have hm2 : 0 <= (slope * a1 * muW - a2) * zw := mul_nonneg (by linarith) hz + have hm3 : 0 <= a2 * zw := mul_nonneg ha2_pos hz + have h_lin : slope * (2 + a1 * (aW + muW * zw)) + cst = + (slope * (2 + a1 * aW) + cst) + slope * a1 * muW * zw := by ring + have hn2_rat : (2 : Rat) <= (n2 : Rat) := by linarith + exact ⟨by exact_mod_cast hn2_rat, by linarith⟩ + +def pickRule : Mode -> Word -> DState -> Nat -> StepRule + | .PA1, V, .S2, 0 => .R00 + | .PA1, V, .S2, 1 => .R00 + | .PA1, V, .S4, 0 => .R02 + | .PA1, V, .S4, 1 => .R03 + | .PA1, V, .S5, 0 => .R01 + | .PA1, V, .S5, 1 => .R01 + | .PA1, Q, .S3, 0 => .R04 + | .PA1, Q, .S3, 1 => .R04 + | .PA1, Q, .S4, 0 => .R04 + | .PA1, Q, .S4, 1 => .R04 + | .PA1, Q, .S5, 0 => .R04 + | .PA1, Q, .S5, 1 => .R04 + | .FA1, V, .S2, 0 => .R05 + | .FA1, V, .S2, 1 => .R05 + | .FA1, V, .S4, 0 => .R07 + | .FA1, V, .S4, 1 => .R08 + | .FA1, V, .S5, 0 => .R06 + | .FA1, V, .S5, 1 => .R06 + | .FA1, Q, .S3, 0 => .R09 + | .FA1, Q, .S3, 1 => .R09 + | .FA1, Q, .S4, 0 => .R09 + | .FA1, Q, .S4, 1 => .R09 + | .FA1, Q, .S5, 0 => .R09 + | .FA1, Q, .S5, 1 => .R09 + | .KA1, K, .S3, 0 => .R10 + | .KA1, K, .S3, 1 => .R10 + | .KHV, K, .S2, 0 => .R11 + | .KHV, K, .S2, 1 => .R11 + | .KHV, K, .S4, 0 => .R13 + | .KHV, K, .S4, 1 => .R14 + | .KHV, K, .S5, 0 => .R12 + | .KHV, K, .S5, 1 => .R12 + | .PHV, V, .S3, 0 => .R15 + | .PHV, V, .S3, 1 => .R15 + | .PHV, K, .S2, 0 => .R18 + | .PHV, K, .S2, 1 => .R18 + | .PHV, K, .S3, 0 => .R16 + | .PHV, K, .S3, 1 => .R17 + | .PHV, K, .S4, 0 => .R16 + | .PHV, K, .S4, 1 => .R17 + | .PHV, K, .S5, 0 => .R16 + | .PHV, K, .S5, 1 => .R17 + | .PHV, Q, .S2, 0 => .R19 + | .PHV, Q, .S2, 1 => .R19 + | .FH0, V, .S3, 0 => .R20 + | .FH0, V, .S3, 1 => .R20 + | .FH0, Q, .S2, 0 => .R21 + | .FH0, Q, .S2, 1 => .R21 + | .FH1, V, .S3, 0 => .R22 + | .FH1, V, .S3, 1 => .R22 + | .FH1, Q, .S2, 0 => .R23 + | .FH1, Q, .S2, 1 => .R23 + | .PH0, V, .S3, 0 => .R24 + | .PH0, V, .S3, 1 => .R24 + | .PH0, K, .S2, 0 => .R27 + | .PH0, K, .S2, 1 => .R27 + | .PH0, K, .S3, 0 => .R25 + | .PH0, K, .S3, 1 => .R26 + | .PH0, K, .S4, 0 => .R25 + | .PH0, K, .S4, 1 => .R26 + | .PH0, K, .S5, 0 => .R25 + | .PH0, K, .S5, 1 => .R26 + | .PH0, Q, .S2, 0 => .R28 + | .PH0, Q, .S2, 1 => .R28 + | .PH1, V, .S3, 0 => .R29 + | .PH1, V, .S3, 1 => .R29 + | .PH1, K, .S2, 0 => .R32 + | .PH1, K, .S2, 1 => .R32 + | .PH1, K, .S3, 0 => .R30 + | .PH1, K, .S3, 1 => .R31 + | .PH1, K, .S4, 0 => .R30 + | .PH1, K, .S4, 1 => .R31 + | .PH1, K, .S5, 0 => .R30 + | .PH1, K, .S5, 1 => .R31 + | .PH1, Q, .S2, 0 => .R33 + | .PH1, Q, .S2, 1 => .R33 + | _, _, _, _ => .R00 + +def evalKind : NKinds -> Nat -> Nat + | .dbl2, n1 => 2 * n1 - 2 + | .dbl1, n1 => 2 * n1 - 1 + | .keep, n1 => n1 + | .half0, n1 | .half1, n1 => n1 / 2 + +def kindParOk : NKinds -> Nat -> Bool + | .half0, p => p == 0 + | .half1, p => p == 1 + | _, _ => true + +theorem validKind_eval {k : NKinds} {n1 : Nat} (hn1 : 2 <= n1) + (hok : kindParOk k (n1 % 2) = true) : validKind k n1 (evalKind k n1) := by + cases k with + | dbl2 | dbl1 | keep => exact ⟨hn1, rfl⟩ + | half0 | half1 => + dsimp [kindParOk] at hok + rw [beq_iff_eq] at hok + exact ⟨hn1, hok, rfl⟩ + +def checkPickRule (m1 : Mode) (w : Word) (s2 : DState) (par : Nat) : Bool := + let r := pickRule m1 w s2 par + if modeMatches m1 (dfaStep w s2) then + (rInMode r == m1) && (rWord r == w) && modeMatches (rOutMode r) s2 && kindParOk (rKind r) par + else + true + +theorem checkPickRule_all (m1 : Mode) (w : Word) (s2 : DState) (par : Nat) + (hp : par = 0 ∨ par = 1) : checkPickRule m1 w s2 par = true := by + rcases hp with rfl | rfl <;> cases m1 <;> cases w <;> cases s2 <;> decide + +theorem stepRule_survive (r : StepRule) (n1 n2 : Nat) (zw : Rat) + (hz : 0 <= zw) (hv : validKind (rKind r) n1 n2) + (hb : alpha (rInMode r) * (addW (rWord r) + mulW (rWord r) * zw) <= (n1 : Rat) - 2) : + 2 <= n2 ∧ alpha (rOutMode r) * zw <= (n2 : Rat) - 2 := by + cases r <;> refine survive_step_le _ _ _ _ _ _ zw hz (validKind_rat hv) hb ?_ <;> + norm_num [rInMode, rWord, rKind, rOutMode, alpha, addW, mulW, n2Slope, n2Const] + +theorem step_survive (m1 : Mode) (w : Word) (s2 : DState) (n1 : Nat) (zw : Rat) + (hz : 0 <= zw) (hn1 : 2 <= n1) (hm1 : modeMatches m1 (dfaStep w s2) = true) + (hb : alpha m1 * (addW w + mulW w * zw) <= (n1 : Rat) - 2) : + ∃ (r : StepRule) (n2 : Nat), + rInMode r = m1 ∧ rWord r = w ∧ dfaStep (rWord r) s2 = dfaStep w s2 ∧ + modeMatches (rOutMode r) s2 = true ∧ validKind (rKind r) n1 n2 ∧ + 2 <= n2 ∧ alpha (rOutMode r) * zw <= (n2 : Rat) - 2 := by + let r := pickRule m1 w s2 (n1 % 2) + have hc := checkPickRule_all m1 w s2 (n1 % 2) (Nat.mod_two_eq_zero_or_one n1) + unfold checkPickRule at hc + rw [hm1] at hc + simp only [ite_true, Bool.and_eq_true, beq_iff_eq] at hc + rcases hc with ⟨⟨⟨hin, hword⟩, hm2⟩, hpar⟩ + have hv : validKind (rKind r) n1 (evalKind (rKind r) n1) := validKind_eval hn1 hpar + have hb' : alpha (rInMode r) * (addW (rWord r) + mulW (rWord r) * zw) <= (n1 : Rat) - 2 := by + rw [hin, hword]; exact hb + rcases stepRule_survive r n1 (evalKind (rKind r) n1) zw hz hv hb' with ⟨hn2, hb2⟩ + exact ⟨r, evalKind (rKind r) n1, hin, hword, by rw [hword], hm2, hv, hn2, hb2⟩ + +theorem Scan_survive (u : List Word) (s_end : DState) : + ∀ (m1 : Mode) (n1 : Nat), + 2 <= n1 -> + modeMatches m1 (dfaRun u s_end) = true -> + alpha m1 * wordPot u <= (n1 : Rat) - 2 -> + ∃ m2 n2 v g, Scan m1 (dfaRun u s_end) n1 u m2 s_end n2 v g := by + induction u with + | nil => + intro m1 n1 hn1 hm1 _ + exact ⟨m1, n1, [], 0, Scan.nil m1 s_end n1 hm1 hn1⟩ + | cons w u ih => + intro m1 n1 hn1 hm1 hb + have hzw : 0 <= wordPot u := wordPot_nonneg u + rw [zW_cons] at hb + rcases step_survive m1 w (dfaRun u s_end) n1 (wordPot u) hzw hn1 hm1 hb + with ⟨r, n2, rfl, rfl, _, hm2, hv, hn2, hb2⟩ + rcases ih (rOutMode r) n2 hn2 hm2 hb2 with ⟨m_end, n_end, v, g, hS⟩ + exact ⟨m_end, n_end, rEmit r ++ v, rG r + g, Scan.step rfl hm1 hv hS⟩ + +theorem zw_step_le (zWe z13e mOut cOut mIn aW muW cIn zw_u : Rat) + (hc : z13e * mOut <= mIn * muW ∧ zWe + z13e * cOut <= mIn * aW + cIn) + (hz : 0 <= zw_u) : + zWe + z13e * (mOut * zw_u + cOut) <= mIn * (aW + muW * zw_u) + cIn := by + rcases hc with ⟨hs, hb⟩ + have hm : 0 <= (mIn * muW - z13e * mOut) * zw_u := mul_nonneg (by linarith) hz + linarith + +def validParProp (k : NKinds) (n1 n2 : Nat) : Prop := + match k with + | .dbl2 => n2 % 2 = 0 + | .dbl1 => n2 % 2 = 1 + | .keep => n2 % 2 = n1 % 2 + | .half0 => n1 % 2 = 0 + | .half1 => n1 % 2 = 1 + +theorem validKind_par {k : NKinds} {n1 n2 : Nat} (hv : validKind k n1 n2) : + validParProp k n1 n2 := by + cases k with + | dbl2 | dbl1 => rcases hv with ⟨hn1, rfl⟩; dsimp [validParProp]; omega + | keep => rcases hv with ⟨_, rfl⟩; rfl + | half0 | half1 => exact hv.2.1 + +theorem stepRule_zW_contract (r : StepRule) (n1 n2 : Nat) (zw_u : Rat) + (hzw : 0 <= zw_u) (hv : validKind (rKind r) n1 n2) : + wordPot (rEmit r) + wordScale (rEmit r) * (multZW (rOutMode r) * zw_u + cSt (rOutMode r) (n2 % 2)) <= + multZW (rInMode r) * (addW (rWord r) + mulW (rWord r) * zw_u) + cSt (rInMode r) (n1 % 2) := by + have hpar := validKind_par hv + cases r <;> dsimp [rKind, validParProp] at hpar <;> rw [hpar] <;> + (try (rcases Nat.mod_two_eq_zero_or_one n1 with hp | hp <;> rw [hp])) <;> + (try (rcases Nat.mod_two_eq_zero_or_one n2 with hp | hp <;> rw [hp])) <;> + (refine zw_step_le _ _ _ _ _ _ _ _ zw_u ?_ hzw; + dsimp [rEmit, rOutMode, rInMode, rWord, cSt]; norm_num [wordPot, wordScale, multZW, addW, mulW]) + +theorem cSt_nonneg (m : Mode) (p : Nat) : 0 <= cSt m (p % 2) := by + rcases Nat.mod_two_eq_zero_or_one p with hp | hp <;> (rw [hp]; cases m <;> norm_num [cSt]) + +theorem scan_wordPot_contract {m1 : Mode} {s1 : DState} {n1 : Nat} {u : List Word} + {m2 : Mode} {s2 : DState} {n2 : Nat} {v : List Word} {g : Nat} + (h : Scan m1 s1 n1 u m2 s2 n2 v g) : + wordPot v <= multZW m1 * wordPot u + cSt m1 (n1 % 2) := by + induction h with + | nil m _ n _ _ => + have hc := cSt_nonneg m n + simp [wordPot]; linarith + | @step r _ _ _ n1 n2 _ _ u v _ _ _ hv _ ih => + have hstep := stepRule_zW_contract r n1 n2 (wordPot u) (wordPot_nonneg u) hv + have hm_ih := mul_le_mul_of_nonneg_left ih (le_of_lt (wordScale_pos (rEmit r))) + rw [<- zW_cons (rWord r) u] at hstep + rw [zW_append] + linarith + +def minPowS : DState -> Nat + | .S2 => 1 + | .S3 | .S4 => 2 + | .S5 => 4 + +theorem minPowS_step2 (w1 w2 : Word) (s : DState) : + minPowS (dfaStep w1 (dfaStep w2 s)) <= 4 := by + cases w1 <;> cases w2 <;> cases s <;> decide + +theorem dfaRun_KQ_min {A H : Nat} {ds : List Word} (h : DigitVal A H ds) : + minPowS (dfaRun ds .S2) <= 2 ^ H := by + cases h with + | nil => decide + | @zero _ H1 _ h1 => + cases h1 with + | nil => decide + | @zero _ H2 u2 _ => + have hp : 1 <= 2 ^ H2 := pow_two_pos H2 + have hm := minPowS_step2 K K (dfaRun u2 .S2) + dsimp [dfaRun]; rw [pow_two_one_add, pow_two_one_add]; omega + | @one _ H2 u2 _ => + have hp : 1 <= 2 ^ H2 := pow_two_pos H2 + have hm := minPowS_step2 K Q (dfaRun u2 .S2) + dsimp [dfaRun]; rw [pow_two_one_add, pow_two_one_add]; omega + | @one _ H1 _ h1 => + cases h1 with + | nil => decide + | @zero _ H2 u2 _ => + have hp : 1 <= 2 ^ H2 := pow_two_pos H2 + have hm := minPowS_step2 Q K (dfaRun u2 .S2) + dsimp [dfaRun]; rw [pow_two_one_add, pow_two_one_add]; omega + | @one _ H2 u2 _ => + have hp : 1 <= 2 ^ H2 := pow_two_pos H2 + have hm := minPowS_step2 Q Q (dfaRun u2 .S2) + dsimp [dfaRun]; rw [pow_two_one_add, pow_two_one_add]; omega + +theorem zDg_z13_zW {A H : Nat} {ds : List Word} (h : DigitVal A H ds) : + wordScale ds = ((2 ^ H : Nat) : Rat) ∧ wordPot ds <= ((2 ^ H : Nat) : Rat) - 1 := by + induction h with + | nil => simp [wordScale, wordPot] + | @zero A H u _ ih => + rw [pow_two_one_add H, Nat.cast_add]; dsimp [wordScale, wordPot]; constructor <;> linarith + | @one A H u _ ih => + rw [pow_two_one_add H, Nat.cast_add]; dsimp [wordScale, wordPot]; constructor <;> linarith + +theorem kq_step_le (zWe z13e aOut cOut aIn cIn P0 P : Rat) + (hc : z13e * aOut <= 2 * aIn ∧ zWe + z13e * (aOut * P0 + cOut) <= aIn * (2 * P0) + cIn) + (hP : P0 <= P) : + zWe + z13e * (aOut * P + cOut) <= aIn * (2 * P) + cIn := by + rcases hc with ⟨hs, hb⟩ + have hm : 0 <= (2 * aIn - z13e * aOut) * (P - P0) := mul_nonneg (by linarith) (by linarith) + linarith + +theorem stepRule_KQ_zW (r : StepRule) (s2 : DState) (P : Rat) + (hw : rWord r ≠ V) + (hm1 : modeMatches (rInMode r) (dfaStep (rWord r) s2) = true) + (hm2 : modeMatches (rOutMode r) s2 = true) + (hP : (minPowS s2 : Rat) <= P) : + wordPot (rEmit r) + wordScale (rEmit r) * (kqA (rOutMode r) s2 * P + kqC (rOutMode r) s2) <= + kqA (rInMode r) (dfaStep (rWord r) s2) * (2 * P) + kqC (rInMode r) (dfaStep (rWord r) s2) := by + cases r <;> (try exact False.elim (hw rfl)) <;> + cases s2 <;> (try contradiction) <;> + (refine kq_step_le _ _ _ _ _ _ _ P ?_ hP; + norm_num [rEmit, rOutMode, rInMode, rWord, dfaStep, wordPot, wordScale, kqA, kqC, minPowS]) + +theorem Scan_dfaRun {m1 : Mode} {s1 : DState} {n1 : Nat} {u : List Word} + {m2 : Mode} {s2 : DState} {n2 : Nat} {v : List Word} {g : Nat} + (h : Scan m1 s1 n1 u m2 s2 n2 v g) : s1 = dfaRun u s2 := by + induction h with + | nil _ _ _ _ _ => rfl + | step hs _ _ _ ih => subst hs; subst ih; rfl + +theorem Scan_KQ_zW {m1 : Mode} {s1 : DState} {n1 : Nat} {ds : List Word} + {m2 : Mode} {n2 : Nat} {v : List Word} {g : Nat} + (hS : Scan m1 s1 n1 ds m2 .S2 n2 v g) : + ∀ {A H : Nat}, DigitVal A H ds -> + wordPot v <= kqA m1 s1 * ((2 ^ H : Nat) : Rat) + kqC m1 s1 := by + generalize hs_end : DState.S2 = s_end at hS + induction hS with + | nil m s _ hm _ => + intro A H hD + subst hs_end + cases hD + cases m <;> simp [modeMatches] at hm <;> norm_num [wordPot, kqA, kqC] + | @step r s1 s2 s3 _ _ _ _ ds' v _ hs hm1 _ hrest ih => + intro A H hD + subst hs_end + subst hs + have hw_ne : rWord r ≠ V := by intro hv; rw [hv] at hD; cases hD + have hD_tail : ∃ A' H', DigitVal A' H' ds' ∧ H = 1 + H' := by + generalize hw_eq : rWord r = w0 at hD + cases hD with + | zero h' => exact ⟨_, _, h', rfl⟩ + | one h' => exact ⟨_, _, h', rfl⟩ + rcases hD_tail with ⟨A', H', hD', rfl⟩ + have hs2_eq : s2 = dfaRun ds' .S2 := Scan_dfaRun hrest + have hm2 : modeMatches (rOutMode r) s2 = true := Scan_match_in hrest + have hP : (minPowS s2 : Rat) <= ((2 ^ H' : Nat) : Rat) := by + rw [hs2_eq]; exact_mod_cast (dfaRun_KQ_min hD') + have hstep := stepRule_KQ_zW r s2 ((2 ^ H' : Nat) : Rat) hw_ne hm1 hm2 hP + have ih' := ih rfl hD' + have hm_ih := mul_le_mul_of_nonneg_left ih' (le_of_lt (wordScale_pos (rEmit r))) + have hpow : ((2 ^ (1 + H') : Nat) : Rat) = 2 * ((2 ^ H' : Nat) : Rat) := by + rw [pow_two_one_add H', Nat.cast_add]; ring + rw [zW_append, hpow] + linarith + +def zDen : List Word -> Nat + | [] => 1 + | _ :: u => 8 * zDen u + +def z13Num : List Word -> Nat + | [] => 1 + | V :: u => 4 * z13Num u + | K :: u => 16 * z13Num u + | Q :: u => 16 * z13Num u + +def zWNum : List Word -> Nat + | [] => 0 + | V :: u => zDen u + 4 * zWNum u + | K :: u => 8 * zDen u + 16 * zWNum u + | Q :: u => 2 * zDen u + 16 * zWNum u + +theorem zDen_pos (u : List Word) : 0 < zDen u := by + induction u with + | nil => decide + | cons _ _ ih => unfold zDen; omega + +theorem z13Num_eq (u : List Word) : (z13Num u : Rat) = wordScale u * (zDen u : Rat) := by + induction u with + | nil => simp [z13Num, wordScale, zDen] + | cons a u ih => + cases a <;> (dsimp [z13Num, wordScale, zDen]; push_cast; rw [ih]; ring) + +theorem zWNum_eq (u : List Word) : (zWNum u : Rat) = wordPot u * (zDen u : Rat) := by + induction u with + | nil => simp [zWNum, wordPot, zDen] + | cons a u ih => + cases a <;> (dsimp [zWNum, wordPot, zDen]; push_cast; rw [ih]; ring) + +def checkWordPotLe (u : List Word) (p q : Nat) : Bool := + q * zWNum u <= p * zDen u + +theorem checkWordPotLe_sound (u : List Word) (p q : Nat) + (h : checkWordPotLe u p q = true) : (q : Rat) * wordPot u <= (p : Rat) := by + unfold checkWordPotLe at h + rw [decide_eq_true_eq] at h + have hr : (q : Rat) * (zWNum u : Rat) <= (p : Rat) * (zDen u : Rat) := by exact_mod_cast h + rw [zWNum_eq] at hr + have hd : (0 : Rat) < (zDen u : Rat) := by exact_mod_cast (zDen_pos u) + rcases le_or_gt ((q : Rat) * wordPot u) (p : Rat) with hle | hgt + · exact hle + · have hmul := mul_lt_mul_of_pos_right hgt hd + linarith + +def checkZ13Pow2 (u : List Word) (e p q : Nat) : Bool := + q * z13Num u * (2 ^ e) == p * zDen u + +theorem checkZ13Pow2_sound (u : List Word) (e p q : Nat) + (h : checkZ13Pow2 u e p q = true) : + (q : Rat) * wordScale u * ((2 ^ e : Nat) : Rat) = (p : Rat) := by + unfold checkZ13Pow2 at h + rw [beq_iff_eq] at h + have hr : (q : Rat) * (z13Num u : Rat) * ((2 ^ e : Nat) : Rat) = (p : Rat) * (zDen u : Rat) := by + exact_mod_cast h + rw [z13Num_eq] at hr + have hd : (0 : Rat) < (zDen u : Rat) := by exact_mod_cast (zDen_pos u) + rcases lt_trichotomy ((q : Rat) * wordScale u * ((2 ^ e : Nat) : Rat)) (p : Rat) with h1 | h1 | h1 + · have hmul := mul_lt_mul_of_pos_right h1 hd + linarith + · exact h1 + · have hmul := mul_lt_mul_of_pos_right h1 hd + linarith + +def kqA4096 : Mode -> DState -> Nat + | .PA1, .S2 | .FA1, .S2 => 512 + | .KA1, .S5 => 64 + | .KHV, .S3 => 128 + | .PHV, .S4 => 128 + | .PHV, .S3 | .PHV, .S5 => 1024 + | .FH0, .S4 | .PH0, .S4 | .FH1, .S4 | .PH1, .S4 => 512 + | .PH0, .S3 | .PH0, .S5 | .PH1, .S3 | .PH1, .S5 => 4096 + | _, _ => 0 + +theorem kqA4096_eq (m : Mode) (s : DState) : + 4096 * kqA m s = (kqA4096 m s : Rat) := by + cases m <;> cases s <;> norm_num [kqA, kqA4096] + +def kqCPos4096 : Mode -> DState -> Nat + | .KA1, .S5 => 2048 + | .KHV, .S3 => 2048 + | .PHV, .S4 => 256 + | .FH0, .S4 | .PH0, .S4 => 3072 + | _, _ => 0 + +theorem kqCPos4096_ge (m : Mode) (s : DState) : + 4096 * kqC m s <= (kqCPos4096 m s : Rat) := by + cases m <;> cases s <;> norm_num [kqC, kqCPos4096] + +-- Section 5: Fixed Segments (`head_w`, `s_full`, `top_base`) and Concrete Orbit `init -> u_0 -> u_10` +def head_w : List Word := [V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,V,K] +def v_head : List Word := [V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,V,K,V] +abbrev b_head : Nat := 266862588 + +theorem Scan_head : Scan .PA1 .S2 3 head_w .FA1 .S2 b_head v_head 0 := by + have h := evalAffineScan_sound [.R00,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R07,.R20,.R11,.R07,.R20,.R11,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R07,.R20,.R11,.R07,.R20,.R11] .PA1 .S2 0 3 head_w .FA1 0 b_head v_head 0 0 (by decide) + have hd : dfaRun head_w .S2 = .S2 := by decide + rw [hd] at h + simpa using h + +def top_base : List Word := [Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def top_body : List Word := [Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q] +def v_top : List Word := [V,V,V,V,Q,V,V,V] +abbrev A_top : Nat := 65151 + +theorem zDg_top : DigitVal A_top 16 top_base := + checkDg_sound A_top top_base (by decide) + +theorem Scan_top {m_top : Mode} (hm : m_top = .PA1 ∨ m_top = .FA1) (b_top : Nat) (hb : 2 <= b_top) : + Scan m_top .S2 b_top top_body .PA1 .S2 (64 * (b_top - 2) + 41) v_top 21 := by + have h_in : 1 * (b_top - 2) + 2 = b_top := by omega + have hd : dfaRun top_body .S2 = .S2 := by decide + rcases hm with rfl | rfl + · have h := evalAffineScan_sound [.R04,.R19,.R04,.R19,.R04,.R19,.R04,.R17,.R32,.R04,.R19,.R04,.R19,.R04,.R19] .PA1 .S2 1 2 top_body .PA1 64 41 v_top 21 (b_top - 2) (by decide) + rw [hd, h_in] at h; exact h + · have h := evalAffineScan_sound [.R09,.R19,.R04,.R19,.R04,.R19,.R04,.R17,.R32,.R04,.R19,.R04,.R19,.R04,.R19] .FA1 .S2 1 2 top_body .PA1 64 41 v_top 21 (b_top - 2) (by decide) + rw [hd, h_in] at h; exact h + +def bot_w : List Word := [Q,K,K,Q,K,Q] +abbrev A_bot : Nat := 41 + +theorem zDg_bot : DigitVal A_bot 6 bot_w := + checkDg_sound A_bot bot_w (by decide) + +def s_base : List Word := [V,V,V,V,Q,V,V,V,V] +def s_full : List Word := s_base ++ bot_w + +def sRuleTable : Mode -> DState -> Nat -> List StepRule + | .PA1, .S2, 0 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .PA1, .S2, 1 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .PA1, .S2, 2 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .PA1, .S2, 3 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .PA1, .S2, 4 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .PA1, .S2, 5 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .PA1, .S2, 6 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .PA1, .S2, 7 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .PA1, .S2, 8 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .PA1, .S2, 9 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .PA1, .S2, 10 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .PA1, .S2, 11 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .PA1, .S2, 12 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .PA1, .S2, 13 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .PA1, .S2, 14 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .PA1, .S2, 15 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .PA1, .S3, 0 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S3, 1 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S3, 2 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S3, 3 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S3, 4 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S3, 5 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S3, 6 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S3, 7 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S3, 8 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S3, 9 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S3, 10 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S3, 11 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S3, 12 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S3, 13 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S3, 14 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S3, 15 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S4, 0 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S4, 1 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S4, 2 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S4, 3 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S4, 4 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S4, 5 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S4, 6 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S4, 7 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S4, 8 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S4, 9 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S4, 10 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S4, 11 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S4, 12 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S4, 13 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S4, 14 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S4, 15 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S5, 0 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S5, 1 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S5, 2 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S5, 3 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S5, 4 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S5, 5 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S5, 6 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S5, 7 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S5, 8 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S5, 9 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S5, 10 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S5, 11 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S5, 12 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S5, 13 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S5, 14 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .PA1, .S5, 15 => [.R00,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S2, 0 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .FA1, .S2, 1 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .FA1, .S2, 2 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .FA1, .S2, 3 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .FA1, .S2, 4 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .FA1, .S2, 5 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .FA1, .S2, 6 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .FA1, .S2, 7 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .FA1, .S2, 8 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .FA1, .S2, 9 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .FA1, .S2, 10 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .FA1, .S2, 11 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .FA1, .S2, 12 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .FA1, .S2, 13 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .FA1, .S2, 14 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .FA1, .S2, 15 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28] + | .FA1, .S3, 0 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S3, 1 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S3, 2 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S3, 3 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S3, 4 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S3, 5 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S3, 6 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S3, 7 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S3, 8 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S3, 9 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S3, 10 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S3, 11 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S3, 12 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S3, 13 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S3, 14 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S3, 15 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S4, 0 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S4, 1 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S4, 2 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S4, 3 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S4, 4 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S4, 5 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S4, 6 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S4, 7 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S4, 8 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S4, 9 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S4, 10 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S4, 11 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S4, 12 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S4, 13 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S4, 14 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S4, 15 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S5, 0 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S5, 1 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S5, 2 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S5, 3 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S5, 4 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S5, 5 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S5, 6 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S5, 7 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S5, 8 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S5, 9 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S5, 10 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S5, 11 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S5, 12 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S5, 13 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S5, 14 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | .FA1, .S5, 15 => [.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04] + | _, _, _ => [] + +def checkOneS (m_in : Mode) (s_ds : DState) (r16 : Nat) : Bool := + match evalAffineScan (sRuleTable m_in s_ds r16) m_in s_ds 16 (64 + r16) s_full with + | some (m_ds, mb_s, cb_s, v_s, g_s) => + (6 <= g_s) && (2048 <= mb_s) && (7919 <= cb_s) && + checkWordPotLe v_s 43 128 && + (z13Num v_s * kqA4096 m_ds s_ds <= 4 * zDen v_s) && + (z13Num v_s * kqCPos4096 m_ds s_ds <= zDen v_s) + | none => false + +theorem checkOneS_all (m_in : Mode) (s_ds : DState) (r16 : Nat) + (hm : m_in = .PA1 ∨ m_in = .FA1) (hr : r16 < 16) : + checkOneS m_in s_ds r16 = true := by + rcases hm with rfl | rfl <;> cases s_ds <;> + (match r16 with + | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 => decide + | _ + 16 => omega) + +theorem Scan_s_all {m_p : Mode} (hm_p : m_p = .PA1 ∨ m_p = .FA1) (s_ds : DState) + {bp : Nat} (hbp : 64 <= bp) : + ∃ m_ds b_ds v_s g_s, + Scan m_p .S2 bp s_full m_ds s_ds b_ds v_s g_s ∧ + 6 <= g_s ∧ + 128 * bp <= b_ds + 2200 ∧ + wordPot v_s <= 43 / 128 ∧ + wordScale v_s * kqA m_ds s_ds <= 1 / 1024 ∧ + wordScale v_s * kqC m_ds s_ds <= 1 / 4096 := by + let q := (bp - 64) / 16 + let r16 := (bp - 64) % 16 + have hr16_lt : r16 < 16 := Nat.mod_lt _ (by decide) + have hc := checkOneS_all m_p s_ds r16 hm_p hr16_lt + unfold checkOneS at hc + cases hrec : evalAffineScan (sRuleTable m_p s_ds r16) m_p s_ds 16 (64 + r16) s_full with + | none => rw [hrec] at hc; contradiction + | some val => + rw [hrec] at hc + rcases val with ⟨m_ds, mb_s, cb_s, v_s, g_s⟩ + simp only [Bool.and_eq_true, decide_eq_true_eq] at hc + rcases hc with ⟨⟨⟨⟨⟨hg_s, hmb_s⟩, hcb_s⟩, hzw_b⟩, hA_b⟩, hC_b⟩ + have hScan := evalAffineScan_sound (sRuleTable m_p s_ds r16) m_p s_ds 16 (64 + r16) s_full + m_ds mb_s cb_s v_s g_s q hrec + have hd_s : dfaRun s_full s_ds = .S2 := by + change dfaStep V (dfaStep V _) = .S2 + exact dfaStep_VV _ + have hbp_eq : 16 * q + (64 + r16) = bp := by omega + rw [hd_s, hbp_eq] at hScan + have hb_ds : 128 * bp <= (mb_s * q + cb_s) + 2200 := by + have hmq : 2048 * q <= mb_s * q := Nat.mul_le_mul_right q hmb_s + omega + have hzw_r : wordPot v_s <= 43 / 128 := by + have h128 := checkWordPotLe_sound v_s 43 128 hzw_b + norm_num at h128; linarith + have hd_pos : (0 : Rat) < (zDen v_s : Rat) := by exact_mod_cast (zDen_pos v_s) + have hA_r : wordScale v_s * kqA m_ds s_ds <= 1 / 1024 := by + have hr : (z13Num v_s : Rat) * (kqA4096 m_ds s_ds : Rat) <= 4 * (zDen v_s : Rat) := by + exact_mod_cast hA_b + rw [z13Num_eq, <- kqA4096_eq] at hr + rcases le_or_gt (wordScale v_s * kqA m_ds s_ds) (1 / 1024) with hle | hgt + · exact hle + · have hgt' : (4 : Rat) < 4096 * (wordScale v_s * kqA m_ds s_ds) := by linarith + have hm := mul_lt_mul_of_pos_right hgt' hd_pos + linarith + have hC_r : wordScale v_s * kqC m_ds s_ds <= 1 / 4096 := by + have hr : (z13Num v_s : Rat) * (kqCPos4096 m_ds s_ds : Rat) <= (zDen v_s : Rat) := by + exact_mod_cast hC_b + rw [z13Num_eq] at hr + have hc_le := kqCPos4096_ge m_ds s_ds + have hmul_c := mul_le_mul_of_nonneg_left hc_le (le_of_lt (wordScale_pos v_s)) + rcases le_or_gt (wordScale v_s * kqC m_ds s_ds) (1 / 4096) with hle | hgt + · exact hle + · have hgt' : (1 : Rat) < (wordScale v_s * (kqCPos4096 m_ds s_ds : Rat)) := by linarith + have hm := mul_lt_mul_of_pos_right hgt' hd_pos + linarith + exact ⟨m_ds, mb_s * q + cb_s, v_s, g_s, hScan, hg_s, hb_ds, hzw_r, hA_r, hC_r⟩ + +def u_0 : List Word := [V, Q] + +theorem init_to_u0 : (init []) [tm]⊢⁺ (zCf (evalWords u_0 default)) := by + dsimp only [init, u_0, zCf, evalWords, V_u, Q_u] + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +def u_1 : List Word := [V,V,V,K,K,Q] +theorem step_0 : Step u_0 u_1 := checkStep_sound [.R00] [V] [K,K,Q] u_1 (by decide) +def u_2 : List Word := [V,V,V,V,V,V,K,K,Q,K,Q] +theorem step_1 : Step u_1 u_2 := checkStep_sound [.R00,.R05,.R06,.R10,.R11] [V,V,V,K,K] [K,K,Q,K,Q] u_2 (by decide) +def u_3 : List Word := [V,V,V,V,V,V,V,V,V,V,K,Q,Q,K,K,K,K,K,Q] +theorem step_2 : Step u_2 u_3 := checkStep_sound [.R00,.R05,.R05,.R05,.R05,.R06,.R10,.R11,.R09,.R18] [V,V,V,V,V,V,K,K,Q,K] [K,Q,Q,K,K,K,K,K,Q] u_3 (by decide) +def u_4 : List Word := [V,V,V,V,V,V,V,V,V,V,K,V,Q,V,Q,Q,Q,Q,V,K,K,Q,Q,Q] +theorem step_3 : Step u_3 u_4 := checkStep_sound [.R00,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R07,.R20,.R14,.R23,.R04,.R17,.R31,.R31,.R31,.R32] [V,V,V,V,V,V,V,V,V,V,K,Q,Q,K,K,K,K,K] [K,K,Q,Q,Q] u_4 (by decide) +def u_5 : List Word := [V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q] +theorem step_4 : Step u_4 u_5 := checkStep_sound [.R00,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R07,.R20,.R11,.R07,.R21,.R00,.R09,.R19,.R04,.R19,.R01,.R10,.R11,.R09,.R19] [V,V,V,V,V,V,V,V,V,V,K,V,Q,V,Q,Q,Q,Q,V,K,K,Q,Q] [Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q] u_5 (by decide) +def u_6 : List Word := [V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,K,K,Q,K,Q,Q,K,K,K,K,K,K,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q] +theorem step_5 : Step u_5 u_6 := checkStep_sound [.R00,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R07,.R20,.R11,.R07,.R20,.R11,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R09,.R19,.R04,.R19,.R04,.R18,.R04,.R18,.R04,.R19,.R04,.R19,.R04,.R19] [V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q] [Q,K,K,Q,K,Q,Q,K,K,K,K,K,K,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q] u_6 (by decide) +def u_7 : List Word := [V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,K,V,Q,Q,Q,Q,Q,Q,Q,V,V,V,V,V,Q,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +theorem step_6 : Step u_6 u_7 := checkStep_sound [.R00,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R07,.R20,.R11,.R07,.R20,.R11,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R16,.R28,.R04,.R17,.R31,.R31,.R31,.R31,.R31,.R31,.R32,.R04,.R18,.R04,.R19,.R04,.R19,.R04,.R19] [V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,K,K,Q,K,Q,Q,K,K,K,K,K,K,K,K,Q,K,Q,Q,Q,Q,Q,Q] [Q,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] u_7 (by decide) +def u_8 : List Word := [V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,Q,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,Q,V,V,V,V,Q,K,K,Q,K,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +theorem step_7 : Step u_7 u_8 := checkStep_sound [.R00,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R07,.R20,.R11,.R07,.R20,.R11,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R07,.R20,.R14,.R22,.R11,.R07,.R21,.R04,.R19,.R04,.R19,.R04,.R19,.R00,.R05,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04,.R16,.R28,.R04,.R19,.R04,.R19,.R04,.R19,.R04,.R17,.R32,.R04,.R19,.R04,.R19,.R04,.R19] [V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,K,V,Q,Q,Q,Q,Q,Q,Q,V,V,V,V,V,Q,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q] [Q,K,K,Q,K,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] u_8 (by decide) +def u_9 : List Word := [V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,Q,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,K,K,Q,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,K,K,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +theorem step_8 : Step u_8 u_9 := checkStep_sound [.R00,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R07,.R20,.R11,.R07,.R20,.R11,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R07,.R20,.R11,.R07,.R21,.R03,.R22,.R11,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R07,.R20,.R11,.R07,.R20,.R11,.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04,.R19,.R04,.R18,.R04,.R19,.R04,.R18,.R04,.R19,.R04,.R17,.R32,.R04,.R19,.R04,.R19,.R04,.R19,.R04,.R19,.R04,.R19,.R04,.R19,.R04,.R19,.R04,.R17,.R32,.R04,.R19,.R04,.R19,.R04,.R19] [V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,Q,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,Q,V,V,V,V,Q,K,K,Q,K,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q] [Q,K,K,Q,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,K,K,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] u_9 (by decide) +def u_10 : List Word := [V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,K,V,K,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,K,K,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,K,Q,K,K,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +theorem step_9 : Step u_9 u_10 := checkStep_sound [.R00,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R07,.R20,.R11,.R07,.R20,.R11,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R05,.R07,.R20,.R11,.R07,.R20,.R11,.R07,.R21,.R00,.R05,.R05,.R05,.R05,.R05,.R05,.R07,.R20,.R11,.R07,.R20,.R11,.R05,.R05,.R05,.R07,.R20,.R11,.R05,.R05,.R05,.R07,.R20,.R11,.R05,.R05,.R05,.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R05,.R05,.R05,.R07,.R21,.R00,.R05,.R05,.R05,.R09,.R16,.R27,.R04,.R18,.R04,.R19,.R04,.R19,.R04,.R18,.R04,.R16,.R27,.R04,.R16,.R27,.R04,.R19,.R04,.R18,.R04,.R19,.R04,.R17,.R32,.R04,.R19,.R04,.R19,.R04,.R19,.R04,.R18,.R04,.R18,.R04,.R19,.R04,.R19,.R04,.R19,.R04,.R19,.R04,.R19,.R04,.R19,.R04,.R19,.R04,.R17,.R32,.R04,.R19,.R04,.R19,.R04,.R19] [V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,Q,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,K,K,Q,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,K,K,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q] [Q,K,K,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,K,Q,K,K,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] u_10 (by decide) + +theorem rounds_0_10 : Rounds u_0 u_10 := Rounds.next step_0 (Rounds.next step_1 (Rounds.next step_2 (Rounds.next step_3 (Rounds.next step_4 (Rounds.next step_5 (Rounds.next step_6 (Rounds.next step_7 (Rounds.next step_8 (Rounds.next step_9 (Rounds.refl u_10)))))))))) + +-- Section 6: 5-Piece Invariant `Good u`, Unconditional Closure `Good_step`, and `is_does_not_halt` +def Good (u : List Word) : Prop := + ∃ p_w ds_core A_core m, + u = head_w ++ p_w ++ s_full ++ ds_core ++ top_base ∧ + (∃ p_tail, p_w = V :: V :: p_tail) ∧ + 8 <= m ∧ + DigitVal A_core m ds_core ∧ + wordScale p_w * ((2 ^ m : Nat) : Rat) = 2048 ∧ + wordPot p_w <= 43 + +def p_init : List Word := [V,V,K,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,K,V,K,V,V,V,V,Q,V,V,V,V,V,V,V,V,V] +def ds_core_init : List Word := [Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,K,Q,K,K,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q] + +theorem good_u10 : Good u_10 := by + refine ⟨p_init, ds_core_init, 4603791232746792399, 62, by decide, ⟨p_init.drop 2, by decide⟩, + by decide, checkDg_sound 4603791232746792399 ds_core_init (by decide), ?_, ?_⟩ + · have h := checkZ13Pow2_sound p_init 62 2048 1 (by decide) + norm_num at h; exact h + · have h := checkWordPotLe_sound p_init 43 1 (by decide) + norm_num at h; exact h + +theorem bound_b_end_digitVal {mid_all v_mid : List Word} {m_top : Mode} {b_top g_mid : Nat} + (hm_top : m_top = .PA1 ∨ m_top = .FA1) + (hb_top : 2 <= b_top) + (hg_mid : 6 <= g_mid) + (hS_mid : Scan .FA1 .S2 b_head mid_all m_top .S2 b_top v_mid g_mid) + (hz13_vmid : wordScale v_mid * ((2 ^ g_mid : Nat) : Rat) = 1024) + (hzW_vmid : wordPot v_mid <= 43821 / 512) : + ∃ A_core' ds_core', + DigitVal A_core' (g_mid + 2) ds_core' ∧ + DigitVal (64 * (b_top - 2) + 41) (22 + g_mid + 2) + (bot_w ++ ds_core' ++ top_base) := by + rcases Scan_delta hS_mid with ⟨hd_lo, hd_hi⟩ + have hphi_top : phi m_top = 1 := by rcases hm_top with rfl | rfl <;> rfl + rw [hphi_top] at hd_lo hd_hi + dsimp [phi] at hd_lo hd_hi + have h_pow_ge64 : 64 <= 2 ^ g_mid := by + have hsub : g_mid = 6 + (g_mid - 6) := by omega + have hp : 1 <= 2 ^ (g_mid - 6) := pow_two_pos (g_mid - 6) + rw [hsub, Nat.pow_add] + have h64 : 2 ^ 6 = 64 := by decide + omega + have h_pow_r : (64 : Rat) <= ((2 ^ g_mid : Nat) : Rat) := by exact_mod_cast h_pow_ge64 + have h_pow_pos : (0 : Rat) <= ((2 ^ g_mid : Nat) : Rat) := by linarith + have hbt_lo : (266861218 : Rat) <= (b_top : Rat) * wordScale v_mid := by + norm_num [b_head] at hd_hi; linarith + have hbt_hi : (b_top : Rat) * wordScale v_mid <= (266862588 : Rat) := by + norm_num [b_head] at hd_lo; linarith + have hm1 := mul_le_mul_of_nonneg_right hbt_lo h_pow_pos + have hm2 := mul_le_mul_of_nonneg_right hbt_hi h_pow_pos + have h_assoc : ((b_top : Rat) * wordScale v_mid) * ((2 ^ g_mid : Nat) : Rat) = + 1024 * (b_top : Rat) := by + calc ((b_top : Rat) * wordScale v_mid) * ((2 ^ g_mid : Nat) : Rat) + _ = (b_top : Rat) * (wordScale v_mid * ((2 ^ g_mid : Nat) : Rat)) := by ring + _ = 1024 * (b_top : Rat) := by rw [hz13_vmid]; ring + rw [h_assoc] at hm1 hm2 + let n_end := 64 * (b_top - 2) + 41 + have hn_end_r : 16 * (n_end : Rat) = 1024 * (b_top : Rat) - 1392 := by + dsimp [n_end] + rw [Nat.cast_add, Nat.cast_mul, Nat.cast_sub hb_top] + push_cast; ring + have h_shift_r : ((2 ^ (8 + g_mid) : Nat) : Rat) = 256 * ((2 ^ g_mid : Nat) : Rat) := by + have h8 : ((2 ^ 8 : Nat) : Rat) = 256 := by norm_num + rw [Nat.pow_add, Nat.cast_mul, h8] + have h_nend_lo_r : (A_top : Rat) * ((2 ^ (8 + g_mid) : Nat) : Rat) < (n_end : Rat) := by + rw [h_shift_r]; dsimp [A_top]; linarith + have h_nend_hi_r : (n_end : Rat) < ((A_top : Rat) + 1) * ((2 ^ (8 + g_mid) : Nat) : Rat) := by + rw [h_shift_r]; dsimp [A_top]; linarith + have h_nend_lo : A_top * 2 ^ (8 + g_mid) < n_end := by exact_mod_cast h_nend_lo_r + have h_nend_hi : n_end < (A_top + 1) * 2 ^ (8 + g_mid) := by exact_mod_cast h_nend_hi_r + let A_core' := (b_top - 2) % (2 ^ (g_mid + 2)) + have h_Acore'_lt : A_core' < 2 ^ (g_mid + 2) := Nat.mod_lt _ (pow_two_pos (g_mid + 2)) + rcases exists_digitVal_of_lt_pow (g_mid + 2) A_core' h_Acore'_lt with ⟨ds_core', hD_core'⟩ + have h_bot_mid := digitVal_append zDg_bot hD_core' + have h_all := digitVal_append h_bot_mid zDg_top + have h_pow_eq : 2 ^ (8 + g_mid) = 64 * 2 ^ (g_mid + 2) := by + have h_e : 8 + g_mid = 6 + (g_mid + 2) := by omega + have h6 : 2 ^ 6 = 64 := by decide + rw [h_e, Nat.pow_add, h6] + have h_div_top : n_end / (2 ^ (8 + g_mid)) = A_top := by + have hp_pos : 0 < 2 ^ (8 + g_mid) := pow_two_pos (8 + g_mid) + have h1 := (Nat.le_div_iff_mul_le hp_pos).mpr (le_of_lt h_nend_lo) + have h2 := (Nat.div_lt_iff_lt_mul hp_pos).mpr h_nend_hi + omega + have h_div_bt : (b_top - 2) / (2 ^ (g_mid + 2)) = A_top := by + have h_ndiv64 : n_end / 64 = b_top - 2 := by dsimp [n_end]; omega + rw [<- h_ndiv64, Nat.div_div_eq_div_mul, <- h_pow_eq, h_div_top] + have h_val_all : A_bot + A_core' * 2 ^ 6 + A_top * 2 ^ (6 + (g_mid + 2)) = n_end := by + have h6 : 2 ^ 6 = 64 := by decide + have h6g : 2 ^ (6 + (g_mid + 2)) = 64 * 2 ^ (g_mid + 2) := by rw [Nat.pow_add, h6] + rw [h6, h6g] + have h_assoc_top : A_top * (64 * 2 ^ (g_mid + 2)) = 64 * (A_top * 2 ^ (g_mid + 2)) := by ring + rw [h_assoc_top] + have hmod := Nat.div_add_mod (b_top - 2) (2 ^ (g_mid + 2)) + rw [h_div_bt, Nat.mul_comm (2 ^ (g_mid + 2)) A_top] at hmod + dsimp [A_core', A_bot, n_end] at hmod ⊢ + omega + have h_len_all : (6 + (g_mid + 2)) + 16 = 22 + g_mid + 2 := by omega + rw [h_val_all, h_len_all] at h_all + exact ⟨A_core', ds_core', hD_core', by simpa [List.append_assoc] using h_all⟩ + +theorem Scan_FA1_V_emit {m0 m2 : Mode} {s0 s2 : DState} {n1 n2 g : Nat} {u0 v : List Word} + (h : Scan m0 s0 n1 u0 m2 s2 n2 v g) + (hm0 : m0 = .FA1) (hu0 : ∃ p_rest, u0 = V :: p_rest) : + ∃ v_tail, v = V :: v_tail := by + rcases hu0 with ⟨p_rest, hu_eq⟩ + cases h with + | nil _ _ _ _ _ => simp at hu_eq + | @step r _ _ _ _ _ _ _ _ v_rest _ _ _ _ _ => + have hw : rWord r = V := (List.cons.inj hu_eq).1 + cases r <;> simp [rInMode] at hm0 <;> simp [rWord] at hw <;> exact ⟨v_rest, rfl⟩ + +theorem Good_step {u : List Word} (hG : Good u) : + ∃ u', Step u u' ∧ Good u' := by + rcases hG with ⟨p_w, ds_core, A_core, m, rfl, ⟨p_tail, hp_start⟩, hm, hD_core, hz13, hzW⟩ + have hdfa_p : dfaRun p_w .S2 = .S2 := by + rw [hp_start]; exact dfaStep_VV _ + have hb_head_ok : alpha .FA1 * wordPot p_w <= (b_head : Rat) - 2 := by + norm_num [alpha, b_head]; linarith + have hm_fa1 : modeMatches .FA1 (dfaRun p_w .S2) = true := by rw [hdfa_p]; rfl + rcases Scan_survive p_w .S2 .FA1 b_head (by decide) hm_fa1 hb_head_ok + with ⟨m_p, bp, v_p, gp, hS_p⟩ + rw [hdfa_p] at hS_p + have hm_p_match : modeMatches m_p .S2 = true := (Scan_exit_ge2 hS_p).2 + have hm_p : m_p = .PA1 ∨ m_p = .FA1 := by + cases m_p <;> simp [modeMatches] at hm_p_match + · left; rfl + · right; rfl + -- Bounds on `v_p` and `bp` + have hz13_vp_eq : wordScale v_p * ((2 ^ gp : Nat) : Rat) = wordScale p_w := by + have h := Scan_z13 hS_p + have hpsi_p : psi m_p = 4 := by rcases hm_p with rfl | rfl <;> rfl + rw [hpsi_p] at h; dsimp [psi] at h; linarith + have h_pow_gp_ge1 : (1 : Rat) <= ((2 ^ gp : Nat) : Rat) := by exact_mod_cast (pow_two_pos gp) + have hz13_vp_le_pw : wordScale v_p <= wordScale p_w := by + have hm1 := mul_le_mul_of_nonneg_left h_pow_gp_ge1 (le_of_lt (wordScale_pos v_p)) + linarith + have h_pow_m_ge256 : 256 <= 2 ^ m := by + have hsub : m = 8 + (m - 8) := by omega + have hp : 1 <= 2 ^ (m - 8) := pow_two_pos (m - 8) + rw [hsub, Nat.pow_add] + have h8 : 2 ^ 8 = 256 := by decide + omega + have h_pow_m_r : (256 : Rat) <= ((2 ^ m : Nat) : Rat) := by exact_mod_cast h_pow_m_ge256 + have hz13_pw_le8 : wordScale p_w <= 8 := by + have hm1 := mul_le_mul_of_nonneg_left h_pow_m_r (le_of_lt (wordScale_pos p_w)) + linarith + have hz13_vp_le8 : wordScale v_p <= 8 := by linarith + have hz13_vp_powm : wordScale v_p * ((2 ^ m : Nat) : Rat) <= 2048 := by + have hm1 := mul_le_mul_of_nonneg_right hz13_vp_le_pw (by linarith : (0 : Rat) <= ((2 ^ m : Nat) : Rat)) + linarith + have hzw_vp : wordPot v_p <= 10355 / 128 := by + have hc := scan_wordPot_contract hS_p + have hmod : b_head % 2 = 0 := by decide + rw [hmod] at hc + norm_num [multZW, cSt] at hc + linarith + have hbp_lb : 130303 * 2 ^ m <= bp := by + rcases Scan_delta hS_p with ⟨_, hd_hi⟩ + have hphi_p : phi m_p = 1 := by rcases hm_p with rfl | rfl <;> rfl + rw [hphi_p] at hd_hi; dsimp [phi] at hd_hi + have h1 : (266861293 : Rat) <= (bp : Rat) * wordScale v_p := by + norm_num [b_head] at hd_hi; linarith + have hm1 := mul_le_mul_of_nonneg_right h1 (by linarith : (0 : Rat) <= ((2 ^ m : Nat) : Rat)) + have hm2 := mul_le_mul_of_nonneg_left hz13_vp_powm (Nat.cast_nonneg bp) + have h_assoc : ((bp : Rat) * wordScale v_p) * ((2 ^ m : Nat) : Rat) = + (bp : Rat) * (wordScale v_p * ((2 ^ m : Nat) : Rat)) := by ring + rw [h_assoc] at hm1 + have h_rat : (130303 : Rat) * ((2 ^ m : Nat) : Rat) <= (bp : Rat) := by linarith + exact_mod_cast h_rat + have hbp_ge64 : 64 <= bp := by omega + -- Scan `s_full` into `s_ds := dfaRun ds_core .S2` + let s_ds := dfaRun ds_core .S2 + rcases Scan_s_all hm_p s_ds hbp_ge64 + with ⟨m_ds, b_ds, v_s, g_s, hS_s, hg_s, hb_ds, hzw_vs, hkqA_vs, hkqC_vs⟩ + -- Survive `ds_core` + rcases zDg_z13_zW hD_core with ⟨hz13_ds, hzW_ds⟩ + have hb_ds_ge2 : 2 <= b_ds := by omega + have hm_ds_match : modeMatches m_ds (dfaRun ds_core .S2) = true := (Scan_exit_ge2 hS_s).2 + have hb_ds_ok : alpha m_ds * wordPot ds_core <= (b_ds : Rat) - 2 := by + have ha_hi : alpha m_ds <= 96 := by cases m_ds <;> norm_num [alpha] + have hzw_nn : 0 <= wordPot ds_core := wordPot_nonneg ds_core + have hm1 := mul_le_mul_of_nonneg_right ha_hi hzw_nn + have hm2 := mul_le_mul_of_nonneg_left hzW_ds (by norm_num : (0 : Rat) <= 96) + have hbp_r : (130303 : Rat) * ((2 ^ m : Nat) : Rat) <= (bp : Rat) := by exact_mod_cast hbp_lb + have hbds_r : (128 : Rat) * (bp : Rat) <= (b_ds : Rat) + 2200 := by exact_mod_cast hb_ds + linarith + rcases Scan_survive ds_core .S2 m_ds b_ds hb_ds_ge2 hm_ds_match hb_ds_ok + with ⟨m_top, b_top, v_ds, g_ds, hS_ds⟩ + rcases Scan_exit_ge2 hS_ds with ⟨hb_top, hm_top_match⟩ + have hm_top : m_top = .PA1 ∨ m_top = .FA1 := by + cases m_top <;> simp [modeMatches] at hm_top_match + · left; rfl + · right; rfl + -- Combine `mid_all := p_w ++ s_full ++ ds_core` + let mid_all := p_w ++ s_full ++ ds_core + let v_mid := v_p ++ v_s ++ v_ds + let g_mid := gp + g_s + g_ds + have hg_mid : 6 <= g_mid := by dsimp [g_mid]; omega + have hS_mid : Scan .FA1 .S2 b_head mid_all m_top .S2 b_top v_mid g_mid := by + have h12 := Scan_append hS_p hS_s + have h123 := Scan_append h12 hS_ds + simpa [mid_all, v_mid, g_mid, List.append_assoc, Nat.add_assoc] using h123 + -- Bound `wordPot v_mid <= 43821 / 512` + have hzW_vds : wordPot v_ds <= kqA m_ds s_ds * ((2 ^ m : Nat) : Rat) + kqC m_ds s_ds := + Scan_KQ_zW hS_ds hD_core + have hzW_vmid : wordPot v_mid <= 43821 / 512 := by + have hm_vds := mul_le_mul_of_nonneg_left hzW_vds (le_of_lt (wordScale_pos v_s)) + have hm_A := mul_le_mul_of_nonneg_right hkqA_vs (by linarith : (0 : Rat) <= ((2 ^ m : Nat) : Rat)) + have h_tail : wordPot (v_s ++ v_ds) <= 1377 / 4096 + (1 / 1024) * ((2 ^ m : Nat) : Rat) := by + rw [zW_append] + have h_lin : wordScale v_s * (kqA m_ds s_ds * ((2 ^ m : Nat) : Rat) + kqC m_ds s_ds) = + (wordScale v_s * kqA m_ds s_ds) * ((2 ^ m : Nat) : Rat) + wordScale v_s * kqC m_ds s_ds := by ring + rw [h_lin] at hm_vds + linarith + have hm_tail := mul_le_mul_of_nonneg_left h_tail (le_of_lt (wordScale_pos v_p)) + have h_dist : wordScale v_p * (1377 / 4096 + (1 / 1024) * ((2 ^ m : Nat) : Rat)) = + (1377 / 4096) * wordScale v_p + (1 / 1024) * (wordScale v_p * ((2 ^ m : Nat) : Rat)) := by ring + rw [h_dist] at hm_tail + have h_vmid_eq : v_mid = v_p ++ (v_s ++ v_ds) := by simp [v_mid, List.append_assoc] + rw [h_vmid_eq, zW_append] + linarith + -- Exact `wordScale v_mid * 2^g_mid = 1024` + have hz13_vmid : wordScale v_mid * ((2 ^ g_mid : Nat) : Rat) = 1024 := by + have h := Scan_z13 hS_mid + have hpsi_top : psi m_top = 4 := by rcases hm_top with rfl | rfl <;> rfl + rw [hpsi_top] at h; dsimp [psi] at h + have hs_z13 : wordScale s_full = 1 / 2 := by + have hs := checkZ13Pow2_sound s_full 0 1 2 (by decide) + norm_num at hs; linarith + have hmid_z13 : wordScale mid_all = 1024 := by + dsimp [mid_all] + rw [wordScale_append, wordScale_append, hs_z13, hz13_ds] + linarith + rw [hmid_z13] at h + linarith + -- Scan `top_body` and decompose `n_end := 64 * (b_top - 2) + 41` + have hS_top := Scan_top hm_top b_top hb_top + rcases bound_b_end_digitVal hm_top hb_top hg_mid hS_mid hz13_vmid hzW_vmid + with ⟨A_core', ds_core', hD_core', hD_end⟩ + let body := head_w ++ mid_all ++ top_body + let v_body := v_head ++ v_mid ++ v_top + let da := bot_w ++ ds_core' ++ top_base + let u' := V :: (v_body ++ V :: da) + have h_u_eq : head_w ++ p_w ++ s_full ++ ds_core ++ top_base = body ++ [Q] := by + have ht : top_body ++ [Q] = top_base := by decide + dsimp only [body, mid_all] + simp only [List.append_assoc] + rw [ht] + have hS_body : Scan .PA1 .S2 3 body .PA1 .S2 (64 * (b_top - 2) + 41) v_body (0 + g_mid + 21) := + Scan_append (Scan_append Scan_head hS_mid) hS_top + refine ⟨u', ⟨body, .PA1, 64 * (b_top - 2) + 41, v_body, da, 22 + g_mid + 2, 0 + g_mid + 21, + h_u_eq, Or.inl rfl, hS_body, hD_end, rfl⟩, ?_⟩ + have hvp_start : ∃ vp_tail, v_p = V :: vp_tail := + Scan_FA1_V_emit hS_p rfl ⟨V :: p_tail, hp_start⟩ + rcases hvp_start with ⟨vp_tail, hvp_eq⟩ + let p_w' := V :: v_mid + let m' := g_mid + 2 + refine ⟨p_w', ds_core', A_core', m', ?_, ⟨vp_tail ++ v_s ++ v_ds, by simp [p_w', v_mid, hvp_eq]⟩, by omega, hD_core', ?_, ?_⟩ + · have hv_h : V :: v_head = head_w ++ [V] := by decide + have hs_eq : v_top ++ [V] ++ bot_w = s_full := by decide + calc V :: ((v_head ++ v_mid ++ v_top) ++ V :: (bot_w ++ ds_core' ++ top_base)) + _ = (V :: v_head) ++ v_mid ++ (v_top ++ [V] ++ bot_w) ++ ds_core' ++ top_base := by + simp only [List.cons_append, List.nil_append, List.append_assoc] + _ = head_w ++ (V :: v_mid) ++ s_full ++ ds_core' ++ top_base := by + rw [hv_h, hs_eq] + simp only [List.cons_append, List.nil_append, List.append_assoc] + · dsimp only [p_w', m', wordScale] + have h4 : ((2 ^ 2 : Nat) : Rat) = 4 := by norm_num + rw [Nat.pow_add, Nat.cast_mul, h4] + linarith + · dsimp only [p_w', wordPot] + linarith + +theorem reach_N (m : Nat) : + ∃ N, m <= N ∧ ∃ u, + multiStep tm (init []) N = some (zCf (evalWords u default)) ∧ + Good u := by + induction m with + | zero => + rcases init_to_u0 with ⟨k1, _, hk1⟩ + rcases Rounds_exec rounds_0_10 with ⟨k2, hk2⟩ + exact ⟨k1 + k2, Nat.zero_le _, u_10, multiStep_trans_vkq tm _ _ _ k1 k2 hk1 hk2, good_u10⟩ + | succ m ih => + rcases ih with ⟨N, hN, u, h_ms, hG⟩ + rcases Good_step hG with ⟨u', hStep, hG'⟩ + rcases Step_exec hStep with ⟨k, hk_pos, h_step_k⟩ + exact ⟨N + k, Nat.add_le_add hN hk_pos, u', multiStep_trans_vkq tm _ _ _ N k h_ms h_step_k, hG'⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n, hn⟩ + rcases reach_N (n + 1) with ⟨N, hN, _, h_N, _⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := multiStep_add_intermediate_vkq h_N + rw [multiStep_succ_vkq, hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RA_1RC0LC_0LD1RF_1RA1LE_1LD0LB_0REHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RA_1RC0LE_1LD0RA_HHH1LE_0RE0LF_1LB1LC.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1RC0LE_1LD0RA_HHH1LE_0RE0LF_1LB1LC.lean new file mode 100644 index 00000000..7ca44bfa --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1RC0LE_1LD0RA_HHH1LE_0RE0LF_1LB1LC.lean @@ -0,0 +1,3406 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RA_1RC0LE_1LD0RA_HHH1LE_0RE0LF_1LB1LC + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1RC0LE_1LD0RA_HHH1LE_0RE0LF_1LB1LC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +def target_tm : Machine (Fin 2) (Fin 6) + | 0, 0 => some (some 1, Stmt.write 1 Dir.right) + | 0, 1 => some (some 0, Stmt.write 0 Dir.right) + | 1, 0 => some (some 2, Stmt.write 1 Dir.right) + | 1, 1 => some (some 4, Stmt.write 0 Dir.left) + | 2, 0 => some (some 3, Stmt.write 1 Dir.left) + | 2, 1 => some (some 0, Stmt.write 0 Dir.right) + | 3, 0 => none + | 3, 1 => some (some 4, Stmt.write 1 Dir.left) + | 4, 0 => some (some 4, Stmt.write 0 Dir.right) + | 4, 1 => some (some 5, Stmt.write 0 Dir.left) + | 5, 0 => some (some 1, Stmt.write 1 Dir.left) + | 5, 1 => some (some 2, Stmt.write 1 Dir.left) + +theorem target_eq : target = target_tm := by + funext q s + fin_cases q <;> fin_cases s <;> rfl +set_option maxRecDepth 200000 +set_option maxHeartbeats 4000000 +namespace M23 +open List +inductive St | A | B | C | D | E | F | H + deriving DecidableEq, Repr +structure Cfg where + st : St + L : List Bool + h : Bool + R : List Bool + deriving DecidableEq, Repr +def mR (s : St) (w : Bool) (c : Cfg) : Cfg := ⟨s, w :: c.L, c.R.headD false, c.R.tail⟩ +def mL (s : St) (w : Bool) (c : Cfg) : Cfg := ⟨s, c.L.tail, c.L.headD false, w :: c.R⟩ +def step (c : Cfg) : Cfg := + match c.st, c.h with + | .A, false => mR .B true c + | .A, true => mR .C true c + | .B, false => mL .C true c + | .B, true => mR .F false c + | .C, false => mR .E true c + | .C, true => mL .D false c + | .D, false => mL .B true c + | .D, true => mL .D false c + | .E, false => { c with st := .H } + | .E, true => mR .F true c + | .F, false => mL .F false c + | .F, true => mR .A false c + | .H, _ => c +def run : Nat → Cfg → Cfg + | 0, c => c + | n + 1, c => run n (step c) +theorem run_add (m n : Nat) (c : Cfg) : run (m + n) c = run n (run m c) := by + induction m generalizing c with + | zero => simp [run] + | succ m ih => + rw [Nat.succ_add] + simp only [run] + exact ih (step c) +def pw : Nat → List Bool → List Bool + | 0, _ => [] + | k + 1, u => u ++ pw k u +@[simp] theorem pw_zero (u : List Bool) : pw 0 u = [] := rfl +@[simp] theorem pw_succ (k : Nat) (u : List Bool) : pw (k + 1) u = u ++ pw k u := rfl +theorem pw_comm (k : Nat) (u : List Bool) : u ++ pw k u = pw k u ++ u := by + induction k with + | zero => simp + | succ k ih => rw [pw_succ, List.append_assoc, ← ih] +theorem pw_succ' (k : Nat) (u : List Bool) : pw (k + 1) u = pw k u ++ u := by + rw [pw_succ, pw_comm] +theorem pw_add (a b : Nat) (u : List Bool) : pw (a + b) u = pw a u ++ pw b u := by + induction a with + | zero => simp + | succ a ih => rw [Nat.succ_add, pw_succ, pw_succ, ih, List.append_assoc] +abbrev U : List Bool := [true, true, false] +def ckpt (n : Nat) (W : List Bool) : Cfg := ⟨.C, [], false, pw n U ++ W⟩ +def mvDir : St → Bool → Option Bool + | .A, _ => some true + | .B, false => some false + | .B, true => some true + | .C, false => some true + | .C, true => some false + | .D, _ => some false + | .E, false => none + | .E, true => some true + | .F, false => some false + | .F, true => some true + | .H, _ => none +def stepB (c : Cfg) : Option Cfg := + match mvDir c.st c.h with + | some true => if c.R.isEmpty then none else some (step c) + | some false => if c.L.isEmpty then none else some (step c) + | none => some (step c) +def runB : Nat → Cfg → Option Cfg + | 0, c => some c + | n + 1, c => (stepB c).bind (runB n) +theorem runB_add (m n : Nat) : ∀ {c c1 c2 : Cfg}, + runB m c = some c1 → runB n c1 = some c2 → runB (m + n) c = some c2 := by + induction m with + | zero => + intro c c1 c2 h1 h2 + simp only [runB, Option.some.injEq] at h1 + subst h1 + simpa using h2 + | succ m ih => + intro c c1 c2 h1 h2 + simp only [runB, Option.bind_eq_some_iff] at h1 + obtain ⟨c', hc', hm⟩ := h1 + rw [Nat.succ_add] + simp only [runB, hc', Option.bind_some] + exact ih hm h2 +def ext (c : Cfg) (Lt Rt : List Bool) : Cfg := ⟨c.st, c.L ++ Lt, c.h, c.R ++ Rt⟩ +theorem stepB_frame {c c' : Cfg} (Lt Rt : List Bool) (h : stepB c = some c') : + step (ext c Lt Rt) = ext c' Lt Rt := by + obtain ⟨s, L, x, R⟩ := c + cases s <;> cases x <;> simp only [stepB, mvDir] at h <;> + first + | (cases R with + | nil => simp at h + | cons r rs => simp at h; subst h; simp [ext, step, mR]) + | (cases L with + | nil => simp at h + | cons l ls => simp at h; subst h; simp [ext, step, mL]) + | (simp at h; subst h; simp [ext, step]) +theorem runB_frame (n : Nat) (Lt Rt : List Bool) : + ∀ {c c' : Cfg}, runB n c = some c' → run n (ext c Lt Rt) = ext c' Lt Rt := by + induction n with + | zero => intro c c' h; simp [runB] at h; subst h; rfl + | succ n ih => + intro c c' h + simp only [runB, Option.bind_eq_some_iff] at h + obtain ⟨c1, h1, h2⟩ := h + show run n (step (ext c Lt Rt)) = _ + rw [stepB_frame Lt Rt h1] + exact ih h2 +abbrev X : List Bool := [false, false, true] +abbrev Y : List Bool := [true, false, false] +abbrev Z : List Bool := [true, false, true] +theorem rot (x : Bool) (l : List Bool) (k : Nat) (T : List Bool) : + x :: (pw k (l ++ [x]) ++ T) = pw k (x :: l) ++ x :: T := by + induction k with + | zero => simp + | succ k ih => simp [ih] +theorem rotX (k : Nat) (T : List Bool) : true :: (pw k X ++ T) = pw k Y ++ true :: T := + rot true [false, false] k T +theorem rotZ (k : Nat) (T : List Bool) : true :: (pw k Z ++ T) = pw k U ++ true :: T := + rot true [true, false] k T +theorem splitZ (k : Nat) (T : List Bool) : + pw (k + 1) Z ++ T = true :: false :: (pw k U ++ true :: T) := by + rw [pw_succ, ← rotZ]; simp +theorem rsweep (k : Nat) (L R : List Bool) : + run (3 * k) ⟨.A, L, false, pw k U ++ R⟩ = ⟨.A, pw k X ++ L, false, R⟩ := by + induction k generalizing L with + | zero => rfl + | succ k ih => + rw [show 3 * (k + 1) = 3 + 3 * k by omega, run_add] + have h3 : run 3 ⟨.A, L, false, pw (k + 1) U ++ R⟩ = ⟨.A, X ++ L, false, pw k U ++ R⟩ := by + simp [run, step, mR] + rw [h3, ih, pw_succ', append_assoc] +theorem lsweep (k : Nat) (L R : List Bool) : + run (3 * k) ⟨.B, pw k Y ++ L, false, R⟩ = ⟨.B, L, false, pw k Z ++ R⟩ := by + induction k generalizing R with + | zero => rfl + | succ k ih => + rw [show 3 * (k + 1) = 3 + 3 * k by omega, run_add] + have h3 : run 3 ⟨.B, pw (k + 1) Y ++ L, false, R⟩ = ⟨.B, pw k Y ++ L, false, Z ++ R⟩ := by + simp [run, step, mL] + rw [h3, ih, pw_succ', append_assoc] +theorem start (R : List Bool) : + run 3 ⟨.C, [], false, U ++ R⟩ = ⟨.A, [false, true, true], false, R⟩ := by + simp [run, step, mR] +theorem bounce1 (L W' : List Bool) : + run 4 ⟨.A, X ++ L, false, false :: W'⟩ = ⟨.B, true :: L, false, Z ++ W'⟩ := by + simp [run, step, mR, mL] +theorem leftEnd1 (R : List Bool) : + run 5 ⟨.B, [true, false, true, true], false, true :: false :: R⟩ + = ⟨.A, [false, false, true], false, U ++ R⟩ := by + simp [run, step, mR, mL] +theorem leftEnd2 (R : List Bool) : + run 4 ⟨.B, [true], false, R⟩ = ⟨.C, [], false, U ++ true :: R⟩ := by + simp [run, step, mR, mL] +def wordHyp (W' : List Bool) (a J J' : Nat) (V : List Bool) : Prop := + runB a ⟨.A, pw J X, false, true :: W'⟩ = some ⟨.B, true :: pw J' X, false, V⟩ +def evSteps (k a m : Nat) : Nat := 3 + 3 * (k + 1) + 4 + 3 * k + 5 + 3 * (k + 1) + a + 3 * m + 4 +theorem event (k J J' a : Nat) (W' V : List Bool) (hJ : J ≤ k + 2) + (hw : wordHyp W' a J J' V) : + run (evSteps k a (J' + (k + 2 - J))) (ckpt (k + 2) (false :: W')) + = ckpt (J' + (k + 2 - J) + 1) (true :: V) := by + have e1 : run 3 (ckpt (k + 2) (false :: W')) + = ⟨.A, [false, true, true], false, pw (k + 1) U ++ false :: W'⟩ := by + rw [ckpt, pw_succ, append_assoc, start] + have e2 := rsweep (k + 1) [false, true, true] (false :: W') + have e3 : run 4 ⟨.A, pw (k + 1) X ++ [false, true, true], false, false :: W'⟩ + = ⟨.B, pw k Y ++ [true, false, true, true], false, Z ++ W'⟩ := by + rw [pw_succ, append_assoc, bounce1, rotX] + have e4 := lsweep k [true, false, true, true] (Z ++ W') + have e5 : run 5 ⟨.B, [true, false, true, true], false, pw k Z ++ (Z ++ W')⟩ + = ⟨.A, [false, false, true], false, pw (k + 1) U ++ true :: W'⟩ := by + rw [← append_assoc, ← pw_succ', splitZ, leftEnd1, pw_succ, append_assoc] + have e6 := rsweep (k + 1) [false, false, true] (true :: W') + have e7 : run a ⟨.A, pw (k + 1) X ++ [false, false, true], false, true :: W'⟩ + = ⟨.B, pw (J' + (k + 2 - J)) Y ++ [true], false, V⟩ := by + have hsplit : pw (k + 1) X ++ [false, false, true] = pw J X ++ pw (k + 2 - J) X := by + rw [← pw_succ', ← pw_add]; congr 1; omega + have hf := runB_frame a (pw (k + 2 - J) X) [] hw + simp only [ext, append_nil] at hf + rw [hsplit, hf, ← rotX, pw_add, append_nil, cons_append] + have e8 := lsweep (J' + (k + 2 - J)) [true] V + have e9 : run 4 ⟨.B, [true], false, pw (J' + (k + 2 - J)) Z ++ V⟩ + = ckpt (J' + (k + 2 - J) + 1) (true :: V) := by + rw [leftEnd2, rotZ, ckpt, pw_succ, append_assoc] + simp only [evSteps, run_add] + rw [e1, e2, e3, e4, e5, e6, e7, e8, e9] +def isRetFast : List Bool → Option Nat + | [true] => some 0 + | [true, false, false, true, false, false, true] => some 2 + | _ => none +theorem isRetFast_sound {L : List Bool} {j : Nat} (h : isRetFast L = some j) : + L = true :: pw j X := by + unfold isRetFast at h + split at h + · simp only [Option.some.injEq] at h; subst h; rfl + · simp only [Option.some.injEq] at h; subst h; rfl + · cases h +def stepB1 (c : Cfg) : Option Cfg := + match c.st, c.h with + | .A, false => match c.R with | r :: rs => some ⟨.B, true :: c.L, r, rs⟩ | [] => none + | .A, true => match c.R with | r :: rs => some ⟨.C, true :: c.L, r, rs⟩ | [] => none + | .B, false => match c.L with | l :: ls => some ⟨.C, ls, l, true :: c.R⟩ | [] => none + | .B, true => match c.R with | r :: rs => some ⟨.F, false :: c.L, r, rs⟩ | [] => none + | .C, false => match c.R with | r :: rs => some ⟨.E, true :: c.L, r, rs⟩ | [] => none + | .C, true => match c.L with | l :: ls => some ⟨.D, ls, l, false :: c.R⟩ | [] => none + | .D, false => match c.L with | l :: ls => some ⟨.B, ls, l, true :: c.R⟩ | [] => none + | .D, true => match c.L with | l :: ls => some ⟨.D, ls, l, false :: c.R⟩ | [] => none + | .E, false => some ⟨.H, c.L, false, c.R⟩ + | .E, true => match c.R with | r :: rs => some ⟨.F, true :: c.L, r, rs⟩ | [] => none + | .F, false => match c.L with | l :: ls => some ⟨.F, ls, l, false :: c.R⟩ | [] => none + | .F, true => match c.R with | r :: rs => some ⟨.A, false :: c.L, r, rs⟩ | [] => none + | .H, h => some ⟨.H, c.L, h, c.R⟩ +theorem stepB1_eq (c : Cfg) : stepB1 c = stepB c := by + obtain ⟨st, L, h, R⟩ := c + cases st <;> cases h <;> first + | (cases R <;> rfl) + | (cases L <;> rfl) + | rfl +def stepFastA (L R : List Bool) : Option Cfg := + match R with + | true :: true :: false :: true :: true :: false :: R' => + some ⟨.A, false :: false :: true :: false :: false :: true :: L, false, R'⟩ + | true :: true :: false :: R' => + some ⟨.A, false :: false :: true :: L, false, R'⟩ + | true :: true :: true :: false :: R' => + some ⟨.C, true :: false :: false :: true :: L, false, R'⟩ + | false :: R' => + some ⟨.B, true :: L, false, R'⟩ + | _ => stepB1 ⟨.A, L, false, R⟩ +theorem stepFastA_sound (L R : List Bool) {c' : Cfg} (h : stepFastA L R = some c') : + ∃ k, runB k ⟨.A, L, false, R⟩ = some c' := by + unfold stepFastA at h + split at h + · simp only [Option.some.injEq] at h; subst h; exact ⟨6, rfl⟩ + · simp only [Option.some.injEq] at h; subst h; exact ⟨3, rfl⟩ + · simp only [Option.some.injEq] at h; subst h; exact ⟨4, rfl⟩ + · simp only [Option.some.injEq] at h; subst h; exact ⟨1, rfl⟩ + · rw [stepB1_eq] at h; exact ⟨1, by simp [runB, h]⟩ +def stepFastC (L R : List Bool) : Option Cfg := + match R with + | true :: true :: false :: true :: true :: false :: R' => + some ⟨.A, false :: false :: true :: false :: true :: true :: L, false, R'⟩ + | true :: true :: false :: R' => + some ⟨.A, false :: true :: true :: L, false, R'⟩ + | true :: true :: true :: false :: R' => + some ⟨.C, true :: false :: true :: true :: L, false, R'⟩ + | true :: false :: false :: R' => + some ⟨.B, true :: false :: true :: L, false, R'⟩ + | _ => stepB1 ⟨.C, L, false, R⟩ +theorem stepFastC_sound (L R : List Bool) {c' : Cfg} (h : stepFastC L R = some c') : + ∃ k, runB k ⟨.C, L, false, R⟩ = some c' := by + unfold stepFastC at h + split at h + · simp only [Option.some.injEq] at h; subst h; exact ⟨6, rfl⟩ + · simp only [Option.some.injEq] at h; subst h; exact ⟨3, rfl⟩ + · simp only [Option.some.injEq] at h; subst h; exact ⟨4, rfl⟩ + · simp only [Option.some.injEq] at h; subst h; exact ⟨5, rfl⟩ + · rw [stepB1_eq] at h; exact ⟨1, by simp [runB, h]⟩ +def stepFastB (L R : List Bool) : Option Cfg := + match L with + | true :: false :: false :: true :: false :: false :: L' => + some ⟨.B, L', false, true :: false :: true :: true :: false :: true :: R⟩ + | true :: false :: false :: L' => + some ⟨.B, L', false, true :: false :: true :: R⟩ + | true :: true :: false :: false :: L' => + some ⟨.B, L', false, true :: false :: false :: true :: R⟩ + | true :: true :: true :: false :: false :: L' => + some ⟨.B, L', false, true :: false :: false :: false :: true :: R⟩ + | _ => stepB1 ⟨.B, L, false, R⟩ +theorem stepFastB_sound (L R : List Bool) {c' : Cfg} (h : stepFastB L R = some c') : + ∃ k, runB k ⟨.B, L, false, R⟩ = some c' := by + unfold stepFastB at h + split at h + · simp only [Option.some.injEq] at h; subst h; exact ⟨6, rfl⟩ + · simp only [Option.some.injEq] at h; subst h; exact ⟨3, rfl⟩ + · simp only [Option.some.injEq] at h; subst h; exact ⟨4, rfl⟩ + · simp only [Option.some.injEq] at h; subst h; exact ⟨5, rfl⟩ + · rw [stepB1_eq] at h; exact ⟨1, by simp [runB, h]⟩ +def stepFast (c : Cfg) : Option Cfg := + match c.st, c.h with + | .A, false => stepFastA c.L c.R + | .C, false => stepFastC c.L c.R + | .B, false => stepFastB c.L c.R + | _, _ => stepB1 c +theorem stepFast_sound (c : Cfg) {c' : Cfg} (h : stepFast c = some c') : + ∃ k, runB k c = some c' := by + obtain ⟨st, L, x, R⟩ := c + cases st <;> cases x <;> simp only [stepFast] at h + · exact stepFastA_sound L R h + · rw [stepB1_eq] at h; exact ⟨1, by simp [runB, h]⟩ + · exact stepFastB_sound L R h + · rw [stepB1_eq] at h; exact ⟨1, by simp [runB, h]⟩ + · exact stepFastC_sound L R h + all_goals (rw [stepB1_eq] at h; exact ⟨1, by simp [runB, h]⟩) +def seekFast : Nat → Cfg → Option (Nat × List Bool) + | 0, _ => none + | f + 1, c => + match c.st, c.h, isRetFast c.L with + | .B, false, some j => some (j, c.R) + | _, _, _ => + match stepFast c with + | some c' => seekFast f c' + | none => none +theorem seekFast_sound (f : Nat) : ∀ {c : Cfg} {j : Nat} {V : List Bool}, + seekFast f c = some (j, V) → ∃ a, runB a c = some ⟨.B, true :: pw j X, false, V⟩ := by + induction f with + | zero => intro c j V h; simp [seekFast] at h + | succ f ih => + intro c j V h + obtain ⟨s, L, x, R⟩ := c + simp only [seekFast] at h + split at h + · rename_i jj hj + simp only [Option.some.injEq, Prod.mk.injEq] at h + obtain ⟨rfl, rfl⟩ := h + rw [isRetFast_sound hj] + try exact ⟨0, rfl⟩ + · split at h + · rename_i c' hc' + obtain ⟨k, hk⟩ := stepFast_sound _ hc' + obtain ⟨a, ha⟩ := ih h + exact ⟨k + a, runB_add k a hk ha⟩ + · cases h +def win (W' : List Bool) : Cfg := ⟨.A, pw 2 X, false, true :: W'⟩ +def wordMapFast (fuel : Nat) (W' : List Bool) : Option (Nat × List Bool) := + seekFast fuel (win W') +theorem event_map_fast (k fuel J' : Nat) (W' V : List Bool) + (h : wordMapFast fuel W' = some (J', V)) : + ∃ a, run (evSteps k a (J' + k)) (ckpt (k + 2) (false :: W')) = ckpt (J' + k + 1) (true :: V) := by + obtain ⟨a, ha⟩ := seekFast_sound fuel h + refine ⟨a, ?_⟩ + have := event k 2 J' a W' V (by omega) ha + simpa using this +theorem stepB_ext {c c' : Cfg} (Lt Rt : List Bool) (h : stepB c = some c') : + stepB (ext c Lt Rt) = some (ext c' Lt Rt) := by + obtain ⟨s, L, x, R⟩ := c + cases s <;> cases x <;> simp only [stepB, mvDir, ext] at h ⊢ <;> + first + | (cases R with + | nil => simp at h + | cons r rs => simp at h; subst h; simp [step, mR]) + | (cases L with + | nil => simp at h + | cons l ls => simp at h; subst h; simp [step, mL]) + | (simp at h; subst h; simp [step]) +theorem runB_ext (n : Nat) (Lt Rt : List Bool) : + ∀ {c c' : Cfg}, runB n c = some c' → runB n (ext c Lt Rt) = some (ext c' Lt Rt) := by + induction n with + | zero => intro c c' h; simp [runB] at h ⊢; subst h; rfl + | succ n ih => + intro c c' h + simp only [runB, Option.bind_eq_some_iff] at h ⊢ + obtain ⟨c1, h1, h2⟩ := h + exact ⟨ext c1 Lt Rt, stepB_ext Lt Rt h1, ih h2⟩ +def seekToC : Nat → Cfg → Option (List Bool) + | 0, _ => none + | f + 1, c => + match c.st, c.h, c.R with + | .C, false, [] => some c.L + | _, _, _ => + match stepFast c with + | some c' => seekToC f c' + | none => none +theorem seekToC_sound (f : Nat) : ∀ {c : Cfg} {L_P : List Bool}, + seekToC f c = some L_P → ∃ a, runB a c = some ⟨.C, L_P, false, []⟩ := by + induction f with + | zero => intro c L_P h; simp [seekToC] at h + | succ f ih => + intro c L_P h + obtain ⟨s, L, x, R⟩ := c + simp only [seekToC] at h + split at h + · simp only [Option.some.injEq] at h; subst h; try exact ⟨0, rfl⟩ + · split at h + · rename_i c' hc' + obtain ⟨k, hk⟩ := stepFast_sound _ hc' + obtain ⟨a, ha⟩ := ih h + exact ⟨k + a, runB_add k a hk ha⟩ + · cases h +def seekToB0 : Nat → Cfg → Option (List Bool) + | 0, _ => none + | f + 1, c => + match c.st, c.h, c.L with + | .B, false, [true] => some c.R + | _, _, _ => + match stepFast c with + | some c' => seekToB0 f c' + | none => none +theorem seekToB0_sound (f : Nat) : ∀ {c : Cfg} {V : List Bool}, + seekToB0 f c = some V → ∃ a, runB a c = some ⟨.B, [true], false, V⟩ := by + induction f with + | zero => intro c V h; simp [seekToB0] at h + | succ f ih => + intro c V h + obtain ⟨s, L, x, R⟩ := c + simp only [seekToB0] at h + split at h + · simp only [Option.some.injEq] at h; subst h; try exact ⟨0, rfl⟩ + · split at h + · rename_i c' hc' + obtain ⟨k, hk⟩ := stepFast_sound _ hc' + obtain ⟨a, ha⟩ := ih h + exact ⟨k + a, runB_add k a hk ha⟩ + · cases h +def ValidCPrefix (P : List Bool) : Prop := + ∃ a1 a3 L_P R_back, + runB a1 ⟨.A, [], false, true :: P⟩ = some ⟨.C, L_P, false, []⟩ ∧ + runB a3 ⟨.B, true :: L_P, false, []⟩ = some ⟨.B, [true], false, R_back⟩ ∧ + R_back ++ [true, false] = [true, false, false] ++ P +theorem validCPrefix_base : ValidCPrefix [true, true, false] := + ⟨4, 4, [true, false, false, true], [true, false, false, true], rfl, rfl, rfl⟩ +def ValidCSeg (B : List Bool) : Prop := + ∃ b1 b3 L_B R_B, + runB b1 ⟨.C, [], false, B⟩ = some ⟨.C, L_B, false, []⟩ ∧ + runB b3 ⟨.B, true :: L_B, false, []⟩ = some ⟨.B, [true], false, R_B⟩ ∧ + R_B ++ [true, false] = [true, false] ++ B +def checkCSeg (B : List Bool) : Bool := + match seekToC 400 ⟨.C, [], false, B⟩ with + | some L_B => + match seekToB0 400 ⟨.B, true :: L_B, false, []⟩ with + | some R_B => decide (R_B ++ [true, false] = [true, false] ++ B) + | none => false + | none => false +theorem checkCSeg_sound {B : List Bool} (h : checkCSeg B = true) : ValidCSeg B := by + unfold checkCSeg at h + split at h + · rename_i L_B h1 + split at h + · rename_i R_B h2 + simp only [decide_eq_true_eq] at h + obtain ⟨b1, hb1⟩ := seekToC_sound 400 h1 + obtain ⟨b3, hb3⟩ := seekToB0_sound 400 h2 + exact ⟨b1, b3, L_B, R_B, hb1, hb3, h⟩ + · cases h + · cases h +theorem validCPrefix_append {P B : List Bool} (hP : ValidCPrefix P) (hB : ValidCSeg B) : + ValidCPrefix (P ++ B) := by + obtain ⟨a1, a3, L_P, R_back, ha1, ha3, heqP⟩ := hP + obtain ⟨b1, b3, L_B, R_B, hb1, hb3, heqB⟩ := hB + refine ⟨a1 + b1, b3 + a3, L_B ++ L_P, R_back ++ R_B, ?_, ?_, ?_⟩ + · have e1 := runB_ext a1 [] B ha1 + simp only [ext, append_nil] at e1 + have e2 := runB_ext b1 L_P [] hb1 + simp only [ext, append_nil] at e2 + exact runB_add a1 b1 e1 e2 + · have e1 := runB_ext b3 L_P [] hb3 + simp only [ext, append_nil, cons_append] at e1 + have e2 := runB_ext a3 [] R_B ha3 + simp only [ext, append_nil] at e2 + exact runB_add b3 a3 e1 e2 + · rw [append_assoc, heqB, ← append_assoc, heqP, append_assoc] +theorem wordHyp_prefix {P S S_raw : List Bool} {a2 : Nat} (hP : ValidCPrefix P) + (hS : runB a2 ⟨.C, [], false, S⟩ = some ⟨.B, [true], false, true :: false :: S_raw⟩) : + ∃ a V, wordHyp (P ++ S) a 2 2 V ∧ true :: V = U ++ (false :: P ++ S_raw) := by + obtain ⟨a1, a3, L_P, R_back, ha1, ha3, heqP⟩ := hP + refine ⟨(a1 + a2) + a3, R_back ++ (true :: false :: S_raw), ?_, ?_⟩ + · unfold wordHyp + have e1 := runB_ext a1 (pw 2 X) S ha1 + simp only [ext, nil_append] at e1 + have e2 := runB_ext a2 (L_P ++ pw 2 X) [] hS + simp only [ext, nil_append, append_nil, cons_append] at e2 + have e3 := runB_ext a3 (pw 2 X) (true :: false :: S_raw) ha3 + simp only [ext, nil_append, cons_append] at e3 + exact runB_add (a1 + a2) a3 (runB_add a1 a2 e1 e2) e3 + · have h1 : R_back ++ (true :: false :: S_raw) = (R_back ++ [true, false]) ++ S_raw := by simp + rw [h1, heqP] + simp [U] +end M23 +namespace Cert +abbrev Machine := Nat → Bool → Option (Bool × Bool × Nat) +structure Cfg where + q : Nat + L : List Bool + h : Bool + R : List Bool + deriving DecidableEq, Repr +abbrev halted (M : Machine) (c : Cfg) : Prop := M c.q c.h = none +def step (M : Machine) (c : Cfg) : Cfg := + match M c.q c.h with + | none => c + | some (w, true, s) => ⟨s, w :: c.L, c.R.headD false, c.R.tail⟩ + | some (w, false, s) => ⟨s, c.L.tail, c.L.headD false, w :: c.R⟩ +def run (M : Machine) : Nat → Cfg → Cfg + | 0, c => c + | n + 1, c => run M n (step M c) +def blank (q : Nat) : Cfg := ⟨q, [], false, []⟩ +theorem run_add (M : Machine) (m n : Nat) (c : Cfg) : + run M (m + n) c = run M n (run M m c) := by + induction m generalizing c with + | zero => simp [run] + | succ m ih => rw [Nat.succ_add]; simp only [run]; exact ih _ +theorem step_of_halted {M : Machine} {c : Cfg} (h : halted M c) : step M c = c := by + unfold halted at h; simp [step, h] +theorem run_of_halted {M : Machine} {c : Cfg} (h : halted M c) : ∀ n, run M n c = c := by + intro n; induction n with + | zero => rfl + | succ n ih => simp only [run, step_of_halted h, ih] +theorem halted_mono {M : Machine} {c : Cfg} {n n' : Nat} (hn : n ≤ n') + (h : halted M (run M n c)) : halted M (run M n' c) := by + obtain ⟨d, rfl⟩ := Nat.exists_eq_add_of_le hn + rw [run_add, run_of_halted h]; exact h +def strip : List Bool → List Bool + | [] => [] + | true :: xs => true :: strip xs + | false :: xs => + match strip xs with + | [] => [] + | y :: ys => false :: y :: ys +abbrev eqv (x y : List Bool) : Prop := strip x = strip y +theorem strip_headD (x : List Bool) : (strip x).headD false = x.headD false := by + cases x with + | nil => rfl + | cons b xs => + cases b + · simp only [strip]; split <;> rfl + · rfl +theorem strip_tail (x : List Bool) : (strip x).tail = strip x.tail := by + cases x with + | nil => rfl + | cons b xs => + cases b + · simp only [strip, List.tail_cons]; split + · rename_i h; simp [h] + · rename_i y ys h; simp [h] + · rfl +theorem eqv_headD {x y : List Bool} (h : eqv x y) : x.headD false = y.headD false := by + rw [← strip_headD x, h, strip_headD] +theorem eqv_tail {x y : List Bool} (h : eqv x y) : eqv x.tail y.tail := by + unfold eqv; rw [← strip_tail, ← strip_tail, h] +theorem eqv_cons {x y : List Bool} (w : Bool) (h : eqv x y) : eqv (w :: x) (w :: y) := by + unfold eqv at *; cases w <;> simp only [strip, h] +theorem strip_strip (x : List Bool) : strip (strip x) = strip x := by + induction x with + | nil => rfl + | cons b ys ih => + cases b + · dsimp only [strip] + cases h : strip ys with + | nil => rfl + | cons y ys' => + have ih' : strip (y :: ys') = y :: ys' := by rw [← h, ih] + simp only [strip, ih'] + · simp only [strip, ih] +theorem strip_append (x y : List Bool) : strip (x ++ y) = strip (x ++ strip y) := by + induction x with + | nil => simp [strip_strip] + | cons b xs ih => cases b <;> simp only [List.cons_append, strip, ih] +theorem strip_replicate (k : Nat) : strip (List.replicate k false) = [] := by + induction k with + | zero => rfl + | succ k ih => simp [List.replicate_succ, strip, ih] +theorem eqv_pad (x : List Bool) (k : Nat) : eqv (x ++ List.replicate k false) x := by + unfold eqv; rw [strip_append, strip_replicate, List.append_nil] +theorem eqv_append {x y y' : List Bool} (h : eqv y y') : eqv (x ++ y) (x ++ y') := by + unfold eqv at *; rw [strip_append, h, ← strip_append] +theorem eqv_strip (x : List Bool) : eqv (strip x) x := strip_strip x +abbrev eqvC (c d : Cfg) : Prop := c.q = d.q ∧ c.h = d.h ∧ eqv c.L d.L ∧ eqv c.R d.R +theorem eqvC_refl (c : Cfg) : eqvC c c := ⟨rfl, rfl, rfl, rfl⟩ +theorem eqvC_trans {c d e : Cfg} (h1 : eqvC c d) (h2 : eqvC d e) : eqvC c e := by + obtain ⟨a1, b1, c1, d1⟩ := h1; obtain ⟨a2, b2, c2, d2⟩ := h2 + exact ⟨a1.trans a2, b1.trans b2, Eq.trans c1 c2, Eq.trans d1 d2⟩ +theorem step_eqvC (M : Machine) {c d : Cfg} (h : eqvC c d) : eqvC (step M c) (step M d) := by + obtain ⟨q, L, x, R⟩ := c + obtain ⟨q', L', x', R'⟩ := d + obtain ⟨hq, hh, hL, hR⟩ := h + simp only at hq hh; subst hq; subst hh + unfold step + cases M q x with + | none => exact ⟨rfl, rfl, hL, hR⟩ + | some t => + obtain ⟨w, d, s⟩ := t + cases d + · exact ⟨rfl, eqv_headD hL, eqv_tail hL, eqv_cons _ hR⟩ + · exact ⟨rfl, eqv_headD hR, eqv_cons _ hL, eqv_tail hR⟩ +theorem run_eqvC (M : Machine) (n : Nat) : ∀ {c d : Cfg}, eqvC c d → eqvC (run M n c) (run M n d) := by + induction n with + | zero => intro c d h; exact h + | succ n ih => intro c d h; exact ih (step_eqvC M h) +def M : Machine + | 0, false => some (true, true, 1) + | 0, true => some (true, true, 2) + | 1, false => some (true, false, 2) + | 1, true => some (false, true, 5) + | 2, false => some (true, true, 4) + | 2, true => some (false, false, 3) + | 3, false => some (true, false, 1) + | 3, true => some (false, false, 3) + | 4, false => none + | 4, true => some (true, true, 5) + | 5, false => some (false, false, 5) + | 5, true => some (false, true, 0) + | _, _ => none +def stIdx : M23.St → Nat + | .A => 0 | .B => 1 | .C => 2 | .D => 3 | .E => 4 | .F => 5 | .H => 4 +def fC (c : M23.Cfg) : Cfg := ⟨stIdx c.st, c.L, c.h, c.R⟩ +def goodC (c : M23.Cfg) : Prop := c.st = .H → c.h = false +theorem step_f (c : M23.Cfg) (hg : goodC c) : + fC (M23.step c) = step M (fC c) ∧ goodC (M23.step c) := by + obtain ⟨s, L, x, R⟩ := c + unfold goodC at * + cases s <;> cases x <;> simp_all [M23.step, M23.mR, M23.mL, step, M, fC, stIdx] +theorem run_f (n : Nat) : ∀ (c : M23.Cfg), goodC c → fC (M23.run n c) = run M n (fC c) := by + induction n with + | zero => intro c _; rfl + | succ n ih => + intro c hg + obtain ⟨h1, h2⟩ := step_f c hg + simp only [M23.run, run]; rw [ih _ h2, h1] +def ck (n : Nat) (W : List Bool) : Cfg := ⟨2, [], false, M23.pw n M23.U ++ W⟩ +theorem ck_f (n : Nat) (W : List Bool) : fC (M23.ckpt n W) = ck n W := rfl +def units : List Bool → Nat × List Bool + | true :: true :: false :: r => + match units r with + | (u, rest) => (u + 1, rest) + | l => (0, l) +theorem units_spec (l : List Bool) : M23.pw (units l).1 M23.U ++ (units l).2 = l := by + induction l using units.induct with + | case1 r u rest h_eq ih => + unfold units + rw [h_eq] + simp only [M23.pw_succ, List.append_assoc] + have h1 : (units r).1 = u := by rw [h_eq] + have h2 : (units r).2 = rest := by rw [h_eq] + rw [← h1, ← h2, ih] + rfl + | case2 l h => + unfold units; split + · rename_i r; exact absurd rfl (h r) + · rfl +def PAD : Nat := 12 +def evStep (p : Nat × List Bool) : Option (Nat × List Bool) := + match p.2 with + | false :: W' => + if 2 ≤ p.1 then + match M23.wordMapFast 450 (W' ++ List.replicate PAD false) with + | some (J', V) => some (J' + (p.1 - 2) + 1 + (units (true :: V)).1, + strip (units (true :: V)).2) + | none => none + else none + | _ => none +theorem evStep_sound {p p' : Nat × List Bool} (h : evStep p = some p') : + ∃ m, eqvC (run M m (ck p.1 p.2)) (ck p'.1 p'.2) := by + obtain ⟨n, W⟩ := p + rcases W with _ | ⟨b, W'⟩ + · simp [evStep] at h + cases b + case true => simp [evStep] at h + by_cases hn : 2 ≤ n + case neg => simp [evStep, hn] at h + cases hw : M23.wordMapFast 450 (W' ++ List.replicate PAD false) with + | none => simp [evStep, hn, hw] at h + | some r => + obtain ⟨J', V⟩ := r + simp only [evStep, hn, if_true, hw, Option.some.injEq] at h + subst h + obtain ⟨k, rfl⟩ : ∃ k, n = k + 2 := ⟨n - 2, by omega⟩ + obtain ⟨a, ev⟩ := M23.event_map_fast k 450 J' (W' ++ List.replicate PAD false) V hw + have hr := run_f (M23.evSteps k a (J' + k)) (M23.ckpt (k + 2) (false :: (W' ++ List.replicate PAD false))) (by unfold goodC M23.ckpt; intro h; cases h) + rw [ev, ck_f, ck_f] at hr + refine ⟨M23.evSteps k a (J' + k), ?_⟩ + have e1 : eqvC (ck (k + 2) (false :: W')) + (ck (k + 2) (false :: (W' ++ List.replicate PAD false))) := by + refine ⟨rfl, rfl, rfl, ?_⟩ + show eqv _ _ + apply eqv_append + show strip _ = strip _ + rw [← List.cons_append]; exact (eqv_pad _ _).symm + have e2 := run_eqvC M (M23.evSteps k a (J' + k)) e1 + rw [← hr] at e2 + refine eqvC_trans e2 ⟨rfl, rfl, rfl, ?_⟩ + show eqv _ _ + have hu := units_spec (true :: V) + simp only [ck] + rw [show k + 2 - 2 = k by omega] + have e3 : M23.pw (J' + k + 1) M23.U ++ (true :: V) + = M23.pw (J' + k + 1 + (units (true :: V)).1) M23.U ++ (units (true :: V)).2 := by + rw [M23.pw_add (J' + k + 1), List.append_assoc, hu] + rw [e3] + exact eqv_append (eqv_strip _).symm +inductive NatTree where + | leaf (v : Nat) + | node (sz : Nat) (l r : NatTree) +inductive ListTree where + | leaf (dir : Nat) (data : Nat) + | node (sz : Nat) (l r : ListTree) +local notation "zN" => NatTree.node +local notation "zL" => NatTree.leaf +local notation "zLN" => ListTree.node +local notation "zLL" => ListTree.leaf +local notation "zT" => true +local notation "zF" => false +def unpackListAcc : Nat → Nat → List Nat → List Nat + | 0, _, acc => acc + | len + 1, v, acc => unpackListAcc len (v >>> 12) ((v &&& 4095) :: acc) +def NatTree.get0 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 16)) &&& 65535 + | .node _ _ _ => 0 +def NatTree.get1 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 16)) &&& 65535 + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get0 l i + | false => NatTree.get0 r (i - sz) +def NatTree.get2 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 16)) &&& 65535 + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get1 l i + | false => NatTree.get1 r (i - sz) +def NatTree.get3 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 16)) &&& 65535 + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get2 l i + | false => NatTree.get2 r (i - sz) +def NatTree.get4 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 16)) &&& 65535 + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get3 l i + | false => NatTree.get3 r (i - sz) +def NatTree.getRow0 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 224)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node _ _ _ => 0 +def NatTree.getRow1 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 224)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRow0 l i + | false => NatTree.getRow0 r (i - sz) +def NatTree.getRow2 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 224)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRow1 l i + | false => NatTree.getRow1 r (i - sz) +def NatTree.getRow3 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 224)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRow2 l i + | false => NatTree.getRow2 r (i - sz) +def NatTree.getRow4 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 224)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRow3 l i + | false => NatTree.getRow3 r (i - sz) +def NatTree.getRow5 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 224)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRow4 l i + | false => NatTree.getRow4 r (i - sz) +def NatTree.getRow6 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 224)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRow5 l i + | false => NatTree.getRow5 r (i - sz) +def NatTree.getRow7 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 224)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRow6 l i + | false => NatTree.getRow6 r (i - sz) +def NatTree.get96_0 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 96)) &&& 0xffffffffffffffffffffffff + | .node _ _ _ => 0 +def NatTree.get96_1 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 96)) &&& 0xffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get96_0 l i + | false => NatTree.get96_0 r (i - sz) +def NatTree.get96_2 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 96)) &&& 0xffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get96_1 l i + | false => NatTree.get96_1 r (i - sz) +def NatTree.get96_3 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 96)) &&& 0xffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get96_2 l i + | false => NatTree.get96_2 r (i - sz) +def NatTree.get96_4 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 96)) &&& 0xffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get96_3 l i + | false => NatTree.get96_3 r (i - sz) +def NatTree.get96_5 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 96)) &&& 0xffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get96_4 l i + | false => NatTree.get96_4 r (i - sz) +def NatTree.get96_6 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 96)) &&& 0xffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get96_5 l i + | false => NatTree.get96_5 r (i - sz) +def NatTree.get96_7 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 96)) &&& 0xffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get96_6 l i + | false => NatTree.get96_6 r (i - sz) +def unpack0 (_ : Nat) (acc : List Nat) : List Nat := acc +def unpack1 (s : Nat) (acc : List Nat) : List Nat := + match s == 0 with + | true => acc + | false => unpack0 (s >>> 12) (((s &&& 4095) - 1) :: acc) +def unpack2 (s : Nat) (acc : List Nat) : List Nat := + match s == 0 with + | true => acc + | false => unpack1 (s >>> 12) (((s &&& 4095) - 1) :: acc) +def unpack3 (s : Nat) (acc : List Nat) : List Nat := + match s == 0 with + | true => acc + | false => unpack2 (s >>> 12) (((s &&& 4095) - 1) :: acc) +def unpack4 (s : Nat) (acc : List Nat) : List Nat := + match s == 0 with + | true => acc + | false => unpack3 (s >>> 12) (((s &&& 4095) - 1) :: acc) +def unpack5 (s : Nat) (acc : List Nat) : List Nat := + match s == 0 with + | true => acc + | false => unpack4 (s >>> 12) (((s &&& 4095) - 1) :: acc) +def unpack6 (s : Nat) (acc : List Nat) : List Nat := + match s == 0 with + | true => acc + | false => unpack5 (s >>> 12) (((s &&& 4095) - 1) :: acc) +def unpack7 (s : Nat) (acc : List Nat) : List Nat := + match s == 0 with + | true => acc + | false => unpack6 (s >>> 12) (((s &&& 4095) - 1) :: acc) +def NatTree.getRPre0 (t : NatTree) (i : Nat) : List Nat := + match t with + | .leaf v => unpack7 ((v >>> (i * 84)) &&& 0xFFFFFFFFFFFFFFFFFFFFF) [] + | .node _ _ _ => [] +def NatTree.getRPre1 (t : NatTree) (i : Nat) : List Nat := + match t with + | .leaf v => unpack7 ((v >>> (i * 84)) &&& 0xFFFFFFFFFFFFFFFFFFFFF) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRPre0 l i + | false => NatTree.getRPre0 r (i - sz) +def NatTree.getRPre2 (t : NatTree) (i : Nat) : List Nat := + match t with + | .leaf v => unpack7 ((v >>> (i * 84)) &&& 0xFFFFFFFFFFFFFFFFFFFFF) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRPre1 l i + | false => NatTree.getRPre1 r (i - sz) +def NatTree.getRPre3 (t : NatTree) (i : Nat) : List Nat := + match t with + | .leaf v => unpack7 ((v >>> (i * 84)) &&& 0xFFFFFFFFFFFFFFFFFFFFF) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRPre2 l i + | false => NatTree.getRPre2 r (i - sz) +def NatTree.getRPre4 (t : NatTree) (i : Nat) : List Nat := + match t with + | .leaf v => unpack7 ((v >>> (i * 84)) &&& 0xFFFFFFFFFFFFFFFFFFFFF) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRPre3 l i + | false => NatTree.getRPre3 r (i - sz) +def NatTree.getRPre5 (t : NatTree) (i : Nat) : List Nat := + match t with + | .leaf v => unpack7 ((v >>> (i * 84)) &&& 0xFFFFFFFFFFFFFFFFFFFFF) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRPre4 l i + | false => NatTree.getRPre4 r (i - sz) +def NatTree.getRPre6 (t : NatTree) (i : Nat) : List Nat := + match t with + | .leaf v => unpack7 ((v >>> (i * 84)) &&& 0xFFFFFFFFFFFFFFFFFFFFF) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRPre5 l i + | false => NatTree.getRPre5 r (i - sz) +def NatTree.get202_0 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 202)) &&& 0x3ffffffffffffffffffffffffffffffffffffffffffffffffff + | .node _ _ _ => 0 +def NatTree.get202_1 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 202)) &&& 0x3ffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get202_0 l i + | false => NatTree.get202_0 r (i - sz) +def NatTree.get202_2 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 202)) &&& 0x3ffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get202_1 l i + | false => NatTree.get202_1 r (i - sz) +def NatTree.get202_3 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 202)) &&& 0x3ffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get202_2 l i + | false => NatTree.get202_2 r (i - sz) +def NatTree.get202_4 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 202)) &&& 0x3ffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get202_3 l i + | false => NatTree.get202_3 r (i - sz) +def NatTree.get202_5 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 202)) &&& 0x3ffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get202_4 l i + | false => NatTree.get202_4 r (i - sz) +def NatTree.get202_6 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 202)) &&& 0x3ffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get202_5 l i + | false => NatTree.get202_5 r (i - sz) +def NatTree.get202_7 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 202)) &&& 0x3ffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get202_6 l i + | false => NatTree.get202_6 r (i - sz) +def NatTree.get202_8 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 202)) &&& 0x3ffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get202_7 l i + | false => NatTree.get202_7 r (i - sz) +def NatTree.get96_8 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 96)) &&& 0xffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get96_7 l i + | false => NatTree.get96_7 r (i - sz) +def ListTree.get0 (t : ListTree) (i : Nat) : List Nat := + match t with + | .leaf dir data => + let info := (dir >>> (i * 24)) &&& 0xFFFFFF + unpackListAcc (info >>> 12) (data >>> ((info &&& 0xFFF) * 12)) [] + | .node _ _ _ => [] +def ListTree.get1 (t : ListTree) (i : Nat) : List Nat := + match t with + | .leaf dir data => + let info := (dir >>> (i * 24)) &&& 0xFFFFFF + unpackListAcc (info >>> 12) (data >>> ((info &&& 0xFFF) * 12)) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => ListTree.get0 l i + | false => ListTree.get0 r (i - sz) +def ListTree.get2 (t : ListTree) (i : Nat) : List Nat := + match t with + | .leaf dir data => + let info := (dir >>> (i * 24)) &&& 0xFFFFFF + unpackListAcc (info >>> 12) (data >>> ((info &&& 0xFFF) * 12)) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => ListTree.get1 l i + | false => ListTree.get1 r (i - sz) +def ListTree.get3 (t : ListTree) (i : Nat) : List Nat := + match t with + | .leaf dir data => + let info := (dir >>> (i * 24)) &&& 0xFFFFFF + unpackListAcc (info >>> 12) (data >>> ((info &&& 0xFFF) * 12)) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => ListTree.get2 l i + | false => ListTree.get2 r (i - sz) +def ListTree.get4 (t : ListTree) (i : Nat) : List Nat := + match t with + | .leaf dir data => + let info := (dir >>> (i * 24)) &&& 0xFFFFFF + unpackListAcc (info >>> 12) (data >>> ((info &&& 0xFFF) * 12)) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => ListTree.get3 l i + | false => ListTree.get3 r (i - sz) +def ListTree.get5 (t : ListTree) (i : Nat) : List Nat := + match t with + | .leaf dir data => + let info := (dir >>> (i * 24)) &&& 0xFFFFFF + unpackListAcc (info >>> 12) (data >>> ((info &&& 0xFFF) * 12)) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => ListTree.get4 l i + | false => ListTree.get4 r (i - sz) +def ListTree.get6 (t : ListTree) (i : Nat) : List Nat := + match t with + | .leaf dir data => + let info := (dir >>> (i * 24)) &&& 0xFFFFFF + unpackListAcc (info >>> 12) (data >>> ((info &&& 0xFFF) * 12)) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => ListTree.get5 l i + | false => ListTree.get5 r (i - sz) +def left_row_tree : NatTree := (zN 704 (zN 352 (zN 176 (zN 80 (zN 32 (zN 16 (zL 1590305798731167614546397482340835641142718260522787702374488180487342602789995763700579261605975032744667012776805741886272231161925012939400557968649895321117095963466942776932051321232764899497855585485346118295537591415767117316045221114117149355702694723711124907106098127251056745671324329937142042692189531429018309908012707632369272882415095614905956869431877475013125449311296316171360357928744231655802615411873669064025682359304705689287946993242623453937241180265905306590121218454682431421295472673468079545245896776434490185037352664253938424758861618349445720279052223191071720920512401956313331578211865383724173500691553130208201189746955506500447729155772113673181304352273175281149941589125637259154799338161100191820184668738153942507406772196926914462683753575270885962687849643603507033812975452030713651505329575909785253866268297952545138689123755113781104952797537537823942000997944939708745771093280941795868856260841595038395628305680060778968705911734381964867542470025044153301907442828087594147881480532972816359276140186780470531380612970739466240) + (zL 1320163184848380174385447977117643380724673468625534928469175525795949287653491659449467171727135794577889047479117835192929436127965076224673033596718271809694150097292538810035960764332386216412050838564516842898850278130573561931541369967300124541548000797487593430996275867054116304023065074940142147581388909192871191794871061288962218271304324621969351405304370737836594364458385277582065783450092171567774243256620538164234145865504476699120179180385948402466886777326876600390669844071676738518015769995765770349621557490773958399131296078559712834082991576662751018385339398875393708763924848040419225533671079500006818103366948455487514315157012328365486173702993284191519322972768408413352273969772713429156103724283565913587880449289197770864255587830899813622826054987040249813331054587626477574962112432427612360759737094244186701259328649959470753416967072432096081723647772483208939918869121526837658033855226591987269257926391244022825234306959765590711353683304996107091320037368405164577357116813745742793774081030323510784098322)) + (zN 16 (zL 2019379336373378855191336236873363922133023879532862142159515828610644488265987416496676488542821542172349968289102786612796793669212131640304886522973011185405726638323559882912340035680287297563295940724121639499645766369231425181191376998857052599791418292770318413682161265356573941744955521710670768917901883941223863252705673378884711434531070969943719226272956913677268541511701954400986898524393881823631054848104380488152591602955279832371825432951122531248991023466261290279261680050445270723678450298910039123914790474096532996419540526586272001835476739070911724309054359907213199603006903696984686050323743024466362328716174247628795663527303333213935931858430513708668181160329431108700605642105607789880340710350105000299629729378754128359218434187225459094833241800748172159900230258722278206852469123727479544499917518310567336483746962011647860379158074235787362612398050982840111120511513378558831580479822740785435384578833446264269094657251906250196117212821821505806599003949728656908221973763383398133958120566491699711279172887941554000835495876008149015) + (zN 16 (zL 108317794563642480804227079537259937939291774831166764864406724454018089997699676852216378622901500345489128823269762813004776806967155479992801527023686618086207080542862257856943214117558120312137770292643154415013136402258085719325400902147800848881587359740052237018418563399779948806645964578314652546124787453445868810638378033285882700988229065731983472704667622071503936004498045066667672100761233351336519101567824438128899925199343409149454733947751179979943677213751490267885915793757542469235655822758832865191992682362745729680682206188688088079363750973380804681829766573028839623183549744588869990620085766277934253047153238113937598500414793389647309009648545721208516519929854848199374926291657930797684898208336715508773028985213282390377910431987539832891961482489359692928092292830894986057088517800989978895007078573844590229331423575243290534194249037994936075600103074450850754628315502964733871476911316359474155036981575130889193811661347809441219102301911043000552089247567304795296698217354540882162948158849076) + (zL 1815224379166522739779988433956337853097891027152727183705706428839140829636191626065233965598849127160233476594553942069008781643008842801313917708825237242289254061231053883351688493568713480099969041873641144452790690677751281522804355708699290576716155103672991633268073849391579138244072732205144760362742755207934038042411240565000266765696530446643358921571751772586077664929698459794257260002621098322004767804282941057108047231486451298594385055850457949884933720715058776164358921631735744360435542655376525490725394885085037654780176956830576964656453615264377301249544647560403164204738586179738340782346393943885898159284482817110349080449897810470843186926747976386310611611793085438514069343084746529385730452290157218723294917300738010336355830806526413941759572977876912064818741797800957419876332790565838540093026970277340784415422818323486343888834700927359421739478961149203631631857816769884831102467524749500782558149260653055049887675033516564625748537035788670154728674590096239677529291791536924823659949410223211724210246)))) + (zN 48 (zN 16 (zL 1010283952856122924039190914413398212539919949991127556745539648265464378777540430361775198599013815627707983257534612783366823441651015810171313851000206500865272283424957110648494996691876378122744203578765003276513590055299833206708983699885667045989695487643060957993386967670725343351278735199446855175231098939951142549633733083032891874696487840878776308319042266345255514073038005932829614514743948964584591654083625215817309798833842003916897003649362737965331909566940790220753665935010271291463664530984008545409294094879983121558740687047919625316179953171208168115797398309878919387390539121907739680382414278031325824490141695924250767190298559675037487594123857950375572139396393519532875122464909076289223907955689155840948758471997643242680389077063523977864660014658074905184916200163976298206542420258152892463915646553842955590429145886525765146683290890730942069708162693846192926399955642067377024369880277373708507247043100558352778975611875923206001976126888198864573083456417701227946605565544787713182430654647381475590422644911452816208039438248968197) + (zN 16 (zL 513461961922170709698723946744168401265089242438864568480708768728166866626734130362164003108450689562446681127264537871943364579234205055172202910871485981432230036210993349749840045109952164310074576806801994109694654809191019508377452181686069490733672136348725541892609057322664881715070736999914849993539729523735953284231032917867067621089568730283662513709253007277678721899795771303583922644022658402990290379224548589798858914391572366769664605179499363984839692774840516786720023491451161981999328962489981353779308207296962823980581823377740407572811031089310295086708285826963207721246944208993328337284610282070603387246447359288296254369021520647894378241743626465778330058306076067647279973692720218674570495742750744387728086878866505963430094883920408029845739704294929169097272813552971774614778528089457660149037180143233741247052863958074347687158834318579619301691512242585033369665306560741518307831543492758598402140232022832837583377253499607439935229648038384930908912544574333302594709280170376588344104203727274933724696292860919813189525541139251307) + (zL 2829236138656709130681901788920575361807255545360472884508438502530254949662686407594225954587461272249363082025307539810094773723073159029870681890732172778446346686253714424843607846864136294336534941245027771129534772362385819167854581615095339755192178349155989184074300495990707973348336880914776371096781676035583206287004013462844711521430564081520758596936632090112724016061497468321325787967350940801937827450492592784573057260011806454036917677225080464971102340402024900335402452051593220129565006543065327038506573919163739491549008741787159314070246739199645045708584686230718016365442167046265166976200243440556385706057291967524649005451177900973853709306438979462800796477242065100205792399662622638095681058329370000222316917798766343712601493348561348001008345967518582186271758106440004642173503271457236630332509993976568133502050317168824321500867925106422313586978534212873324562064079043787006504270464693679270416927154251994748341304985899464757555406453434423034186086664213448463232987343172282538533821416960187005964326561744984834140224684163))) + (zN 16 (zL 43749649806128885994221198625190765881094242541718842744864224923258022697515918733210058370693037303799546874504572482788589471443249137401802803673066183478506765217279400008635833039099290136966171499619682835810508993352008810049265279713377634773850784033237811718144178500122907191496616228316493134940332705108307001565837148488397587899224036609426465777931266209222044451436977092536503318368560741360236448047188283577210424973565388931129020683403712607674073792905910167923570261248045075153392085572453594279326077306253535313878456892468139243058038558483022964670070563571644235691503576920013273352828488525623423082737375781506021415191148327903040355241606764328793591510060443229509948699835951621685955580549257141394467149449584201211363759911565869859724632850055327278512015316215189953843411453420218724290379575443681653544507810229478994311715055297282662784523821478942771494411057635930706114944495526958761429574189703896154359243829130802707658069030785868811435334483883949572877277024985234182049887717122905633331836478619794) + (zN 16 (zL 11275682935436667781970418321598832519152945940358487228368013440818159990196417935952381749027409686681450418396514985863556155078466714039881366988288900481556112093925566457413364559839351360224335860853934010032551377353095673680334665524003594121517009599016467357522957142660695998934198240635095407483945045403686464474167049134208909863351172984224843536905260938876246671683938502781944512154046502413804003147150420814456130260943255427110378156080059813414104309863408280022242156528377056900234198288859169528280407245168448980081116842629512235963480052951195002936665947860455635889719465198795262315741736136116797577766756841641049185981733235919890596187816428982018993255525672293555404805132123342819236439227039740885480722423176421090301841100645658344103598549171560741428743192024568818028523692796350575338917196667175307317857598748640010750419836252103529429391411166885705112311258590586184986201898517300481192680342830752256487102837352768247103979197012063253403058110530461589467160443258699236933979642117539174098679430971397) + (zL 1540385885766512128887989948693560130275943316423172407289762392704359149706362454332227690661698323477507976397463345412736659689546944930234248259195722673662356063161061918333145020951492701252234208163591833736006139250182871010613126580707654464856131560821118229014956668555533157839909705223319307555572088623189125376857972590379089551227343051473154707876724510559417535221920596006742464805712707473300125936255515694610102602223824067301330489118913609742755976371345465176948706019028553473935165516570860870879326423715565711378258785963758451065980632095605111365735580617555340283338256607035145511902570741929737099847568724179131099380214695342172690246786360139662738503602041653829388718933549120788717456522648659287864627627265693196169658450479182192569885285848379329105866353659789019474307798774113195370005900193833866867216164598775734935889243764911708154440743322766912243665055224732545615946666591655600358141099599090607790512470990057230989710300303954865135266061525008337168278930594066759812003013557604934938571158832399700427441678478016517))))) + (zN 80 (zN 32 (zN 16 (zL 1102992362647625968833375626589107364280354377258176012396427545806125781594862864109638726485978600359128007460266564469501563719563022839999740495031077455831586076804891477564424483250325015673304941083322064576496349533257047243372020709564950298897976752304228720295312683992803689768809102160258488405175563389007095271696069277076393576706699924966367470691185629440741676061300627321635262490370400115470378450764179709943564242449271839917629801609357050443145531508730427045068854853747905944637898570161121416930913868740997611896452410358625717702330832276781469051088161667930942181747289263373765814087544205747749345541025638456019622515371512102804716690054998257183796041809369440296422834537525533245439118080388278562074926145377696254386402475189609254705326659710333596904283061139115157882032993469406967726746619330315916138728539936380486630184061621023564806035789662459696651194325980278704288283824500876176503164399180988373196617281295098457004218167663686494204932484355945063056500526384011492894506732336167657932543486541148574065833424288219331) + (zL 368456501043409342121979708824061566247167878332357832715524171750918399813091480625615122999426507131470722216560839355093812628809847175669155090337657052103956654856506883128592095192897270344832237031260969443781199179559444970344615832383012976955363589773543955513536329741135249930980243318720318783202140137906744729527554944423247418147180515112292852113116004843637748687031882344567171961593019983127590609250344621609766495989244345823775876112528343695034460363004992086466770118732803320667830785051952693313185566440466049763279279999621404063591802836579298324364532619701369515387659021717130623077572243923077769864702017390868921423352150779877767296336538307478544764353277996146278690650413977635647604649424907789756137322572970527356582940371224236041843556253185855228790295157363744736487321398594039221818257855460271131272252183114068122060765744903216213118237960556718616411547515284875616575002107489659559581047532651960107298906263797438615250703956092431615572513375476238956273594445825382042358414952252274381789483947342902493232924375449816)) + (zN 16 (zL 808227162284898339231353224881593476269430349934865646213065267649582552410561729311156111265559063168655263069337315574088936970101135718326830029886344613219773362791251313243377031870687641846243786739816431304905396899637647121868380649570346870028904817818015864875605889094562812536421173374537987771683994541288181185023039360566644740811601592745831588808522299564028903114746674874872763426765156709138001822798978201443697388005380670116653037906163013315875428549281275207169747341970922896794005697707618258613600339369882056096799097323806099215795566436768868936774081645120471922420086145412427094158335408542194810630354652953446769849341476323402340576730514583060020649318837503241061821017425569467484370123540578948143485780425707827679719041705274078807227679705156200677385052579936508456437843644948249521345630340778586106917034370222535037132174730527483436434720592992223865345428662886809965228148625977464183528707344551523716917270830545338859229661315439241159918831618395761462641356469826682217797733809173291094515832598896542559447414374465770) + (zN 16 (zL 3990623284246345822907635046271870193691708832188269927921102463584904463429175145568039364564255964364824784105869853059170164347538564861973577404720061197791266993687307735434632897067893130746477532552699827898335138516384620932187318004983810378025965217674204293006580613950108961290036782727143053891670598935538874313357410098932466507016630540055285628205410703129616972145786700450979671086540184748674722942816028119938511192391378993317770929765315003401632862892448014961467207198326739092140989431865977821650718734865892584745236577836406485612738410527666770907501042446383751608738520903346869102449733934672665546333490401146301172976765460965841512384225924652790089178840439935254446539628572446439801163378808794789102132589397605661736051384460621068739585059259853271762976531054742379605327220525842366239501740639053518476443111865022907598355603526163873721829646907177175244305693355215411198905315828744591868981742795944343214049676371498988128415138025213390788999893625935645607952719807417649850206022649154850062586) + (zL 3030374583401963582112048789527581041251426474644539649273143500868572641987234073206673468324641540973074621913321802559183738062348806709770762221425230970467899356589425309323483150182776913847301330934095131181275367488983021052313431519116289857099375075652494359043174519145389492810092189300301713353943984918622751280015886223555821661302971122339689485561609196326574889061788144858238165646401180403006491693351498190575525125542712710274861401972462729441807083388348123859689568508024080401132204919751759830188706302192915162429967524603028358580664850091123921283573162862840413176778331258133094776197101769432121240475882530832706035564635656504580368156894816634163596410875411495662556781039163759155996042499715701396996930501748797792949411864067199224236891635317552011489876526981552821747621206838168315704882597329653608025058109797717496422979205425740517973827195491846194450130898933679979916768616741784801270478369662239884812590943277627102321893772048153104581787663621462545188489796612462963895324508791732244381701)))) + (zN 48 (zN 16 (zL 1278900627380221489724905489167193665140170510565358138581449089183415809490775562748073555326242506919900501254602497308129294178581040879860755544080192300260992111356743353691888563345937342194642675148141641093239399656967391553845426971136283911546212339527148962142155410237201239993303050606488146849151262869379480756788782286078408059724943887933710017748914026126174437455673385971602243356570516450007885749120843187408239974975513689202274592700864983465644133644743625712216475137177810481462959811366089047119352848730326195371137907434644869662365823644755627601030789511557631937923107630358261228270716605092207811807466925384973504899953580320610455047764150582728275612656232756695128597865972556391687482874431253031628918859230142593586555120291116836600645919838720079264539032566006576979659270438340373487919648007131705826639311407392770712549263118966817299890827803601602304688817092869990831067050957010466026160141803191192138613505366313268039755339324172922709981074078586256039773451532107932662193077270794494727506065942614072401549064445165848) + (zN 16 (zL 10051465934293162459182330731709554383328365327444437447039208828719993022963317330128145017779392190620187069759348515240010757514152774423644832634862368681282583848662426906909018391920297261438485208382482514336495927576329837411905621584485369040549066997045111387796707657085201589107837991555223838173823599461192304764190986577056661537496312901388780440697146534600644929300108145553313264694737018598561796783265881813941080083337118068239236964804319786408221708463330120463649786000106294188338993699030791010407214195076356077855502125254362012043520800720624188483954541332385446876893584078158596418792458213123485373910132999683205869985885142101452696202004784726685187324828677462505423298403669314027696069012418670622498523985559434632742816988248314155833157151956240601295035665745705422866557233311827018781184831261969494420038553282223773068078059127951233511303544760940712587445914449612796024809040117892571797256070081098320253693767524808976479161349943845838734895419998933731632162778574893497446027097091467263058309563089191) + (zL 1970651746926312810745552714160482491908381523966203689995249896945933214463463884014654410237710410419993450199537428882250261780876451596697286264247738338074641049775598914030587946281582938678157250662074242029389231890081165273658027324769491030874947703731406832281415284299109678119492748709190570867331370492263821920925399685184852247118749514681211120604572653174904583979973762873968310352751845567879196059463590679227266821696527081062859104284556507525060920683929587791905869004531368005789063571013616982927359878868297188908717553880383714665467986965191687708495927907825378063731897106334132545734169198106956169527164822936610206484465970770413963413169414092097334930986582192137296130321797587262375808409224043013857832037935793611005453165785735944854930482624160373431800055550280709236243507480383095689982051271650691714378991952973515762131646259980449555088621898281546482101676053387070855643364692775379315223600709436354586031414911253753226311122441944929958530265848923849076539308309210095212640388892540082860570050780120687911667672907317556))) + (zN 16 (zL 19974066913995024701150891737716876252515520924015147641241763950065668975538813599015254363157296733619570950839817270196673885055168623981439965436087332207645355433858013595761628309540664371505567110558442641887485853316135590074451477710359043176352201681972403472291637184904142950567543878298437560701537361673406009548816917639466929962384023109325549329960224805301052053546940618702618131583442617098015688637171863219835018444363896364112356388682013319316990026080382713477530931083771059876613555024698145101560713700136348831840179982232525183497387653044101208056234575726362828870523009913186602895295623848788351334559896618389975465728028894860543653099961397058169807099817425903813087790220051641386287516031590553310871099374652798737779257332927174625887964593598682021146344323295247322317460657054484074367190536585636572619619080496868327575129850671945895636239320691832619845243101828466287175681880471695152139493093308723967706622355927970195691827674832359704182485411828516292167538642003646391950494452080855397683507075743749) + (zN 16 (zL 43363054944711191193266377308572246745878262450606103736798508498965489776624761435959335483080975857768842697521728494636527512458273289260542352713532245349669984094925614475910101037443782955784443295218547115773166011993230671472022724276166777340613352716092671593763473441404586521081481822735735641191549409979899581220724392043638217345171507274540839429378873836305377244583142164904358009788149013854509096516479564915680916306916425659803266569699507381880883813327058559089669162018016598159056672465421866499134397356634669662767686288748795815075430119250902636578468762349399363609195191022468374555013510242082779061648278303535043599596383447973875856043354034501504287597507754892795934218099677842597756643438936262287522722402487900983562681973010996031851384013531855857363376990910800091420841764052586224385454642312127181570437455437140796896865664357923233639465434089855840424477725320778717795979516536439362806456495441629224873582235733472040600900505678466064432005762417540404253199621657361909139736235858141606574645453324293) + (zL 5622200019125511734047368939521648819543300843543621463149197392863382023260535578559424145908450650879189473793577904736247373843658718830265893185938257521986805116983887045833675437799181638467407046352475741367848743476978597416069646181265045223807607326659084940468193112263295852771502430418879068644760912471249322513691313259776632211088671442701338197363745601096529606709913217993216170383365129914426296040423167574429409842454974959999026940464101351498030485199765428493028805181262041967484854319763545654329677660916465383403075496593597670419480188448057018805011855643260957655474719970864583977076983573815118690135965044203946585205566464374570707417420705016662154565436778566056147910844207586378341766324026697212930556593821506045996904183476249675342400593669231722248940951041950431184763022027973332598336477332343149603349128899364703054967321793460393647676843023960119876416360864151981557453441271530829889851825405642044290854749500080812396018746706331928469653148353716365192691693631837238624214191409519880466964299675796160699175338342)))))) + (zN 176 (zN 80 (zN 32 (zN 16 (zL 36275482837310287633676483287602177429536514714684284217895200938102378457844222677189129339656607867821666413490895503297324677547612065278400941014731482444319927225285075785551337700751882416343351556043736459569863434699904581797838160233596437238827246307417497195071981709888454535254044691697232555066614082356048372097070998404953748057786575505863167188312253554449754149674467854409461674209094871354062135931845933489656946605003026229051678437126725014002447363237556945921650534224752073497579982782055162251103206409088386856692460694479909076078991933688920651795987226065273695495599159893771443268580644743377755333394856900073587646951774315493202875223289737291761437191586011237899913005962370607161223107467446563980412939411825469954611875908063287302557321512467965760891656276358705586585310201721151796353481271362314792299184480550896920792027504976132725143964392958297380482377894160064743451284560612852035184490767426039294388337496925212795623547417985224477648623480925096458372568949400754651063777509896657561915154927780216) + (zL 3346212888359074844106002516988956724144551220975204311481465683240597278797302029215119851719242195756591397562523626844432805406062247900382539061958145784839232751977503260430843360674199596000175606468547833441957123202455794917939157481095934332500070289686558158177615502999753885573025464776997050054356018128424710401879876019482966344750007594748663391823052573381864390616539955746991454106127920768844707095914622091002769484806675360088835822502551979372026059775344279100393432484271460659569518152242727856606134880918282468086222774284460074720750962706661952517259920294378443927951543369171021145567839931310667210448735651445722739433325559382449060300798888875602631420010957332832823088034868536432244845195941545812100401401495318305333360859437024301639133798590644955176030151967532049172499462704533960270580759928158701577404681519742221454985632450337178133286942338053394038120342805243457724545596109183322265960683513078336661133895691460641417454657930404123733969605178141726554268284555788958153512877097353)) + (zN 16 (zL 20038499389887603118240456957017501458770387361398880053841638686572015250045235582844428437066518221846238033134171107214465223713601739262855061501485518012875704904584288562684033489746919646389319606576288871916077713367943933257762847324611466817411670709389108645229099809162952277314439073504589592225157209877215872180171567364735671918193152251966301823826850648065202817714607854966491937480304293241669849754367397361887650958454395847239216146863847897949278394432829966215710732438858271297069151005558497165558656014868009103096315412103975038477311570905144413414710413012377541770072436830972636516810330805959939012878483286446878835477254601003054672182728749438617981214119412142950006655310552576291668734158336263276588335981102204959921217145538080240363577039531987470879569743898977028262598709128216291625195893822425039458663252245809621334787831822727859436168624740110698467759489031546565321188196035034496928014919923023518614802631944518778554653345617573861810844050414323428187884557802366529218051935374381620793606117064955) + (zN 16 (zL 231350767861098150913538800317675770407962390509733437032408737162151467775759706684718458455972741336814328126384399839065133895433881872395802191527208456071195931651287693548567455895538964838948502866560806934550051795857901202229466155033265482651753601238375363262401364020245956791908453884217310546225732715523460826177644662543172227650636169155792172515814522934560691519345212682392527270093994805674020508440495826391525051316471077134073637135345672320754009966637884485223208319123310165612022869433088290981572045386291922094261495546691171466229830026428827335258689102801456151758793459525612039766458344374897565005244400533902087256815069637264031196846361994225924381565452025115037241494778542340599821671684231167646658484818285281179970801819935806594419048334887541543445325956895113671382113275060161045852180120046011283590379391342562421641755459694786334549847296960678443356218103014985248224940842908365570113905226163407937253493067033726474719560146256498123741832219817178040889157105161261498906311336632842681746544322455927760683013) + (zL 1803070921636884152255121360450953696338084134543016839920383970943432380748131810392930810810667684519514231824567193148507301907909404395209918317347895093725222636659134018106454618843681894353405224173866755653252561491377807575578854701193335683624595374510710769392543414096323283996763038714857898939700419111320777712656165798952149870604340144716292414977953913355929447625663225396393440110107314373330203280090706389988807845399112793753993671857292369144572685386740413911453274624180959692643420394120544959289354041060891302084429270825144409598559678700843794275872330059156501751657416016519121239608323520088330743332877423277915872471577269079293650626719069144879539866712358866884209355869250102830282531887102421037176199875215691018909778405350808018127924318384235222710216716092815326243882897481278767055036812509699075577007166111745530251092861911870348147968141078118185071749922112065735344825990467082165808016627408081743653324407131021705522576007044906392344366593985401605177447154044718475090216695253555229246580030027202675832456556270846389)))) + (zN 48 (zN 16 (zL 9407141211174544131684819964632484737380354058409293375313101179536746567893879111764991305294371708229779290256591527189069668513591813224429369384230001602179550139714575249076018260196374004521719118439929601394371850167252518698857668511982228413780511143866537801285315342505448956609685524608634105060266369094419209824649606466465066183048213579924803952602247554358862575347231084298815527138538035266219376403455620506846606021271681506840928718027586298360631138781446863501961352375913970070626042809537812173990769779095468007663823834175528756908117786776975558287849556578628936521170289898891634026785185426823212414681474669137322566554762286338862226719125448281528657073157051666871229779384134881469143527072174948419958493105692785749002386523878277448342587237585396239362904426054962549821111389857963571483867962545776340064603826678080888244654677769530562966312867446656049602976560678835822430108842106424273565221549704634235112884601963712654945417794672531653641383638164185641939667631570100387542053318095849214361511626342691) + (zN 16 (zL 9407141202398317630496255493403828431728463255638220238196157814652549601522103391197319343947691900081316952373436838702086156985530211054625688329380784804258203454549148069780180049942591872696849770320078664286065006115725099907899200046333682553229151707273954394931813266425519558617185208896708930446456707101720462284399415865176778320717733520553867938300722527206120861817171714766627622814355731145731217373969813200204863133871625823179109925025093403428020895521735262568879056367289846549567856150552861331087672258278033189963633043121642606309789249879824381555994918523910953432355463639102846209820273745352286822840935806010645885622229902420285909163751390844677421793877551002615476650617744883756776255467547721818928698136284324813584494584292671528750333215317939364421769584860755868219854350624893975343292913866304924241879060120707782128966463031277598974573282103263766562874331709286692530163829708801090136016600674457325040732720572228640325477600657555867981811200966591171156384887148768941038235202507779320420740423876613) + (zL 2157253381686897773095449412692738301561160239016190542552943034641673854375030886542586634367288229048656331270519739701740720110005110326490706155173055941680991067566777900086282586873537830142545025066830542068040802400578963291981515475730065563194206214437655963355292053080417037068004021785079387379740442115633237888643862445183734043300172093762227481982141070066096615880888624362888273585552073648855787585698389647616832352467046613229460613330174072517023681785960455080890916711602792763169452515789106821165258518789681130991107759750497297220326655957276089443710881437285387545537024823910550190804216100993959953396725374735704044132412179581719385614963223735192765525887248544664642919316707651059325269175524934563997198373644344423417577837029992110623611412965646178419060950620221859651308077810444965861409150945046496653923637094496902181463768016330018686161934197756840238596012583711255898930881713957928821668372119632854431298691979509509256222905598520227499452982356107923737446279574588387507672430829074900960005919859608995367849828537336287))) + (zN 16 (zL 584776123300249974855626031271742144409094502443613309943341322901605299047233509080523803550830578884233991035473255486395350148749255295284006105947651368299523690599084034925107212571875318757221135080967491972425833968857625438447588372361134402660982015975725641651341642201846225280055558143103694830302746004008082180664580527061891847450153001843514744459607215715540539652167967460141513736928919999244239334063896620995642217677091677508522796293640725067931038733613271850903076909090131499270448633785806721622726700365089955149895965273526307314180185273601901641552713080470444624962599324468864518216915832379277324582006644081490896132363835636117722256598512264251348433549452782016872692351443971534334862679870619432026770707093931995930915838089194763666452048654679435671222595702531543629052067049681138314805817026806829559232540746950680674574421954075236930890388510362420321412261241308669376616721961198259569151408136173530246001572216714850610708187856973946469139576968496013227176287112566689539168692868026582904087043695447536029513859882877424) + (zN 16 (zL 5386430340904119306490543790444936586526252653963874712795583555037445998328351152479373754218323213396395330064236929515863616830827056531633441573983601132543874709027319622021814506343308816243113481721954663293256277741930552381241612934939214003033028662651104270277774805056420758808908206767309082460698519647465797225287225608243018332084056102742367249892335725346938935027740747348160320828638265394997726740587962470858241696527189205566679854153159443691693450823102989190089588266293239986715586018107452278367761946796931463807690483708574850906499083137665051710154070045068458526345003108870589193075766403117710104849908590256833352235803044793994628615190398356061554102098214022778885508604747566832814014604841167066396340728503428137707882552153561575338030227039193503503623158982336523717879353600398251649686023553473885357503594581929811504812509005716467938719792773240310531992621780173991007111516439344939394381084703070541085212720709940079927756956654332626163412737902954396701678635852144413413268642109296060786473617798904608511011913733) + (zL 2225008327730288710328820364597995852208774047745155077019679457170339379143771396928531887918769051650738717415917264612135472443541897835251743120183783496509873526478562290331948632406378427138534837461617957506260083173727387930112374603116471970921812847561980712545252819097448418403244105349837490044521651053809213381054708445720812680480641103936998784387262559089313698079209675999549845304654334045665214139356433755786740674316437777474920041425874612854464907601460830606339054903791701829600587797701007138105319498947168998257665676770801227808305028796961031838074195128249292553539908592781365990319067920143074489537141270252529710765902947618164433907233507797955483401196746422797311786288630456360316280564918269742587988554650527482554120985976693206927844741739102174457674245247617054407853511616835311594912335784432991089068295916017360571699627116792454689403968868038528552649676979391416994374689021457158152890549669971464955669044496275222646972091718030288073689579028963852474000026741145705719762828150462449892918829731596101402895992024793619))))) + (zN 80 (zN 32 (zN 16 (zL 4320534059503789661625098917094773587462943256842973292813294767499364955505390240696387084499836112909884046699005584254387630615004428675607020819081801284906666178461763111879769856365146970165048877501956692838684600795010557639472116193434211961368265669182704448089124793104757006314590818013243422356555847630861358035081586411620018364950023910411978450213241381035438009406465260440620102999355470025229635693899915549578613376394499356238266079200863970951124899801115518376671590847609028816748376420230276309004972280938568812523937503344848058276903525526558766267359463192429209186957993949577268915667489193730231172773110559897870592639629936288259469840059613556669765745353258209884573898961221182864948417569351682266358947879739400910289409018475677925570621572858024624252644447213327185752745116752688687209924930374200668009049012790646526669198414074582316498369954857840822818524266118770708968805411688528064738877373857687247802379646867560271480302202776879240739753675696382843280854091918451910330457103915164692185634) + (zL 1962328007253481114810240407887918959524631627607350026492825449082473595376127345063115592878177751586528500523646383069381990106061811888896334958222679409352488876607168592852018727391127742754358003119509037397075425135976769384117215359887518364011453706122846429425292143448315422472158420179757116977239162997810709996529143030653427898889419983388106886985700551133567431976819347090730935850869711440930744019073140551456962062562365971229924045040216569957560464575529345679151678343011458014565353969828142965010927021477574483063746830620665662387832098928767779916682184910028610018736977010058583554811051500511356484848339735003279713164330749541279603374391733479874560072772264686718765974212997540245349464503195825388214145371751974939516006607380328312264081019203674700014091317517583106363115504321139217813630304817283927839335059944206202517037104912200402395918691663274863985814317070821805354566374815054217379729276110729959092307326760230766512062120673917530641324567223737696715067556872533126002829167042902583072110977845803017666624774183452677)) + (zN 16 (zL 2745425812480557254684159155163746770125173888822625193383905463147469833065215990713539232818585972763073977530992231552607105076087713455298814282798893993464103538252571251969370191159491722547669646728106649496400273110943794549821670986575120385491584853869222149136998136081759311252442412477635568293841303416404839450770935949386437904293319066304361250728700037933548807224067087735205151497230469454797755820363132387236562649784989712995063589491553526956441436930545023446854974537619412067976960897411832340419405935733420201303370800239392339766017959141770356711277005341955484854868951710108449810338295190890294019565339719891951129268985561910366221062401980777381133884858059369715967652585702954349353248603053587329766104851433542815936311457353343829396586979054947161621169696305048682247916651040794929581697735016671561728300960421344007088878959059367033302553053523575464114118189626144137272305460175305882564783451841993109985517869755978232857035131989825229408024109576416371900842572900905443040465701175873) + (zN 16 (zL 3688553448023463850134609565495932221875241631102676409364324312369271844155953775115331845173143669467264183252620028329138294779081978747049776372048402323867191216621802219958861567274177474075996326894477153156514033177844530923806316349097497177312099890771429638127485097453996173308237821780463757746591317789626100172431175162173642294436781566722847851695320171680420355514743123105896641031697652253279063303736312081533024064880585802664083944066561990331981081967429698641682310910490886770182723829216114801914923506590394731266696604453662129562500440448508263468673732382433540729644458035425134941428555866180609960951533124729656718324391822952740229744070956014031864396560247874720241416714850167174121728271251458953858474266159317178038160991883284532732497810683390893950848635464766306234653398290632496501370646768570387831478229599717375479767694519580551451880128682755426761557385275143389490264570688763193630848371650274543873644753600546033705405298980638513862610732115292320985628615117107895839284180157009) + (zL 2374775828887507379300887092780231645772371509670628551072528889879266499331938026040419312580372627001938851173806745319843234960996072331335508025530795927814358934918724598455682237769707097077905558833490581013701526470929702032650960477675630988224078948004252361117555628987512217231301961689766424264175174729912930335787149422823254595855201906452985197871704937949428066909935564024073873257972266385957522491422442198534637987663187480551437839644997077149806226249151793003210206196655098986259225415663191379386419876813003834444243854837598185837079951317681172996692141646556234839115265973565828484877111949012211801182999244120836625375736686305058994531639267704373025441051873406615006123483141353382979673659463577758375877548721592459387880009041133579667273325738356974002357029139528342893006637582306643606446605895951015561765229681408234197229282821118700198100754559778717344867291412883669069341265845145297104552362746543651024337954335187535030312921206372609504687370910950120214227624347331963461696078701711211210712431742062001274023239320142436)))) + (zN 48 (zN 16 (zL 356570806890396326131479422501322069261093827753469371669838596661011558161385604901066066974890753874713307826088616083020473980632724696420352867837130154132990606127117464990833408195603229980774410643465672485286654665260744393812665887707989812426810200927726377313131261473509441841805429933259892498874627934261113223074996179054099810239497441426233289143148342972091894626224430805197935442503267536738534141201082481589837048341996652889831365824058276712984428832823132312908557078675458254878518516819757878087687917413337198479557023449033212893006544698229690053063083990333906858291492155700713308193525814588493431555960351450139869866971968046324899408254488588840336226419507399499607197477292429057650667193670930771708431015181943595800458956944828603868252334866735699561537252248678497390008327521697013802048503240673161917921277909170192969681185770362235227678210494021782997784563592502589215558542094997581605425897265153071456376408565685456348936506533242972124986777768949811258014561444762100352467701766945452087765246804484077229769385565291089) + (zN 16 (zL 2327228792645117456799729760149413605199065240281089338052345232456898394097035269090927429338396269380074514613811450082945767609672993283660120641044652812550341568554739416258787614445315318606791679351741783209200219470654095958242344754743676709283267376981148575841733195313452612967917785770346835607451077680476318082880350257816643398670563159824506928381217902081810591715943356477680823705553370733539553754597923384547402696621226569938355392740140355705473498788555955588119805253548792168438959089007728913307070284206058767321467326787931429978883416887176928961239287650302533136217330012071084953872083064061422528355106499501147994166080316536274790257992461935579805853410139606145673417308301536481740488042089086743215725415012830572757007852214224202375128721962056635338668294203516832660062516305786285926267281687108067101337921941012412441134987946856564425279625240864932192959795763709517580221192920138629385107664914230807095649133201653431188993688454185909276399219718687923843799483784400419594634787373785038419412630498329362448752275166986664) + (zL 356570806890396326131479422503137293640260350493249354730581126213511687498498764763020210180338708223844964905428335844924862117679201527152727366180152468830978168795135868354251565830943150100084635799994502440013211252545669881315177381124487571749146469111896838908695326299491280030914322496249594487326978849126834220928865513973243528543906780361057214318476259012001898077199804135473817803324061993421180773339278385767663865677538293568431677749169859333650332708292119874075115702546950796750992424313006037819565117733845884540740904593442481935736037045767157346641904812203682442656196186485683499110822763726570410469248271457674588825777190365969807536752675461442082917731636554440486089961356216694777653038711965511607452352642377031905393704020511370922334959785601955960423034948457930761323349417850909439442826382126637304382073929510744113461889104099329472814084136782401729154806054939142219244966662130991314879659702574060878991765086067832282399594846543733629647781815437106326654231435482313108834146310260613044518304013063048563839684466508431))) + (zN 16 (zL 836752826836130045380762701758698005517466317527697204523180150341449156526285945004001078698270047845631453238996532423874460928863231533369915905995528900922272119750982355812778409080965993512554702400149220533470804050659814338173586784455675555539387840273928962894677209311340944106691904243244768681776063245665033470941825437939611375878305696900550162237838823200804418297119241169928549071956597537224190866167894979815554699249375434349281762731827267613890889578701187724810949359999940629278504529059319011629592862394108552857247724648420477340232190825396040272946730800337563360666721809242433925094032273764457844483494442656452114668610023995515969024423640874682649874389765117205335882013945012496618105702931091967143527473636500658421944132432637012923193532951124254338591762854904022809904567934840568646874278147614182842168446404313996866801398430986670757407060939895504685481791571794366333574701218241245995464808568082221780544708038422498345880518207080683025148955841713811292878033199742282191004686709967567263890014227694287596575814454674078) + (zN 16 (zL 482559158658336361364602139769535091728853859377451045819323160689072866270210330490510084767511506345959672141222535496335653856429966594661961224530358570105542251697534261409907208698746518798282542706142455892305944779388978442553212955401530571724213546156102745540954102638505407222545415485792766833106046020941486865848386741563745281898483995328759710756885236035311383916232105088636542081782610108766861152748696206294360782554017504000432017002867480461521761829815657138634776611254349020317270877851366733209879905303714071870041380461002538938861801369328394750803103595504545361750943444540969921442668869432086719770674654125210988605680526091412468315156334011177520289776753884834123464721401283409566572652424174705146666866961354177321300312313923016723992674989242181616982774677297327208751321454996510151592708434963783625749499860990807871737597532429434962408080269769583354043374088018415408870773894621943152071929531151041944502763650751116440106969367567091712407553424546385663729102637585071407073037492102165051620331673016540174957141098300079) + (zL 6668030699548530381234720003927414503211304818836297556205357986974038806362464593121553871306739401850250525557461103247051566961749466078175571170163481579347883712022972360088972763880473285409368322645366144180760612613247351784167437771323096259394716591423351471498747870544619652400986562721448160883783660732705509569648694515595671319598065436541131967173035658404562272075773670704432650747584593742935561289830225065591453063794004973307811009698362557813408106614332108011885700288052127836799591002131689578101009485552664101378966472202721399163596164297945955153364335469686033824672614068504844159692515872874677287769969319570158246659848549896185513523135244758311052698216496656113758787374283488173383500339198539285043908330325879737776950433647582672503902304156328403043061228284137923810658481846131074985955250441650740544142603821578253480423134781222574346455751354199777063116978931103095827161983579888700377916260876335722218882825130408273829978918109295308290479596065898864770675777630295033147017303884456))))))) + (zN 352 (zN 176 (zN 80 (zN 32 (zN 16 (zL 12286518731713901850246368551412763710981847057542762308069156913610817601246051128417816784719414865970428135674366830403955670939876749734834981852720826076945621502779651303385960512508292549814732774409417299828352355416471359166241696308384635571366083095943911561860310028681770860918801681207745711791848657562812066927848334711662635553169028648219829164895073736277347812427310990469873336841157139278342714975700815247262852200319862650563866002507023956701977426540746922913534273218495655669319210290896016747036368992965933889792820242548675954095027792079585945190781897377574696304204302598687388883007212393852414050809595300948725517277136757423685874463413523198475904336561677034072541516788678768654712247096104705424020395188033479747028290683405531618259304830673487413875507898545525940073037069738969235556026465739108867295306329478498346365415126028992951227527484806291303529347064576671534662144174694821491053594776857026383289253882132669095841371725881111413674358320304490576896308314161819672137429362251239499563726) + (zL 1120820902992145785139949401080507158134836709808810069473280942007112460168519883339721082413702287690401210939525680141888356467160783223686779799176228826705464097774636846698961007150274117373446682062900716470229721806297092981660638857980407476964872230309005759291139431943254169295039827692831235225621102372705502229201490482455010312920194347173690331507498272212387806221927273791071028634426313054899496515279193502033393118873058921395888084882534302452182645104549759741424424619283471218020790717378097052222697332827577232238028162596486783166053118234394649572123140631168226215135465262379879475852910764857213223220932272791192211412675205092985670357153130203994428477254913913982593743388064040370803362749969247624101010122095724081162872033836897145623270894288750329370415462328807000264851918889102523862422306762101808108337888164351814025596580864795329000531111615070347484030436992068372822144982903094761360259239820792153889269843419195273798118608916531210003873083043581356071476074339018021784635538191555698865605666752959393617134948653531141)) + (zN 16 (zL 19727438500859317378600707138686330637036079203609622373255612035718377228578374042211896208648686957993829513474934114528878796448619454495496246020404587823677224846654853661009986843396479338321663244755742563951263609595661175338927153049979767344395400777747385270606800764995820226833666558483935505411988765249943056014998981367088932993573480796413957488346039494743142485838884570818145826074087084664926671053405232613291496607109924644926371990326616777973217337421659631377496293002720346335796858339187018953667868314846144351316967932034298382733101964175415944578778157899527555487036575626223322806113065141369395329603507665962709298573616907153032035083600887344870676813038748068753887579229205946170870063697084279244617969493212356730435383411090110818988907380334388055215302247099570361191091146503388941608124619383018616043940845577301258005263033827247526173622945513758637495496284130179838981238072436702017239583789230857176554269124737507101924728633904239726209733550834022176194750392631520951494901240381640964702957) + (zN 16 (zL 24273000375962262751768777282637499813016238384215592496404060665942574103773882449258258703412144031140973795284886025300412212305205545481804704678571208510700459277064433450914420859452609078874824320795060288418674263817317078096492566073286476135427273869829923621623240614980552584432211773339237170069978079466259664625358000257052620294405156116090564409354811536262785420180397135708662087968569454603702390877866847690987599261190614731554828644873255807793771209465316890619041878583330008429645729553923836869835406180194147161349320921670840423752343302202719884178746609912217800852135944724974574966369381372339164073182970838636218216419894081202271209665768753937818861845131668352433584520823250859693111382073541867704635018702199305360268446922696538621934172287850674369388315685739303997103591825949181932920337294116453828589980371152946387674957325432315266479673692591658170734676298369431011383084944919149249482397750002906012591405779612649195241093718573814228588745451277198986418035481053685478492180125988423813038847) + (zL 10917949714559864722246826134167846526762637812898135983546829335533189160159886634860741439015944002619522853725730964609569939631221034582402533691659538263828877334290413843387716217102537309656059185981077316101176749070042568678665575494340403093735421900236381593767586240218600118198408391979241510718964524935368593655382415010530555183636542306538132944936359199305514802443241474026611439996712789792212279494357025599908147980984363656472623956757848073686126454799909558629930136263499809393166235409011075835833391222522967537140524523753284739505840908614087162906774795605922933295841142491955600257080163029513839747106279649474959033331448655652864471334946303168373006206068366570873579144587368676003838160628652676202732375683180320155941950086445741221714182943050179103116863958192054225214207844281142982126757391560969135020045539338703241175454741805633369391114702179851326294928780726628398966166684074257467218412639827813241719496103273422215315395086871283000665337998910015341776931177682489544273839647235895914957402882291917671899869807378)))) + (zN 48 (zN 16 (zL 44973866796966227464904185779792940404357272899194504645220511621316971737423130175868910829701185461381440304981060883532587281701073287364763751609353059465993799519180741047172814092147310571235937250461586388844724554431724071476952530473033507436794487431132873011853526079401481729396034410430505298488879302922332636264257674884352193605359022913728639477749454858424831763989173280598825556503234772235043325765599430239381488716563036772371149791648143484705699169600990703447567765077118390420069675966334266839666748909809907306624644917962173664779156630423534848680729013044057341391464199662337114808794543692578851009056908377989581956182890174610912349599336723573970104239088415409457613516993740541926081982205257840272841011054918746505072700325505486995800499253262581425741482371228045133342312875162636760553418001675186637693458946393920422797785529681879495110861278172356498003815599965991731732260080645847123384966393653522008566103670783010764785301587941794710734729542910581290606107741837023109726590903724962364842380466914081) + (zN 16 (zL 428386350058588442122198639822960260929584528010774724936872620029461565112843163214907597427914687133776294070535898694581414758327826630620945264319755231655754861667047297390992903046162743889030130100810913298277251986058125249129937760361876526164665400689634065816993612279840022375698044595439715089807026676217139694783441135449908647377436860342767419058366509974534313950506436261956956223820839487117561194441971935600287433777052907780861041608829296638228563744861485978727299049599279508930332864735580918180134729509886067877957324665209668166376345994636507680689008965079678085645686995811093405051689203840910272412746361861442255099253411599628666097407280212865210324919937004419992505576731337832387834308220389439709144063955920344308654148504786193126373701894056013119982118081114703883993714828063424707092179427427154053225339182498999403459907906233524290316925840031286144467776592851465229615036785885652196696091132823659593414461503204806458892813026081363161695090203821731163981081348222234360562079784734226141274132651308612315316991) + (zL 1838716794198143721751328018066936816437540348384326417939734255901745096042646215180041385460251448899632655078522459225734454950075083961046430735353342623783370376717562652509322912322761402405449787523835804215633294564998492860450536443679916761686678790879977352127182285922883265357355338359761705855332709951002640457541437742467623911577177376859037187854349840546603378253732183695187492327280460441084302482992436741312248094902730411859910043262190789031224538454196083882235696624471765706680649217393602527312082157250448640581320888233738699786419430054178744347506467511160572901191531328694466636019184118690716875920844659747890639769289684671973974338671604754506396988164972817156166523815253188306293946884197077561725131806922966075915673692967687945946035574984369728214935679664556245279365724673000068711027138964808191638495373099863856138201537926014310988067195680749213647017136731914695383311596387103338224851651994307273269780992268020003707093508652900628013906929215306371514572402436143318803652647475216281791581781637436587410591578016777024))) + (zN 16 (zL 2488879901710503532017525888052669714436066256077018990668269189507823702517456482616300945700178031420482243840671127025339670766639888271688367867088757390946283964566864333572609812732487605004350925275431051881419066852890220557688236256459910773732995061131650382874609678469290739122086082970989161148828361174047784051299799110606527770952387106513461359863084256554144094726154857500257140973821862815453605847382854496428220687025470863259020940823023082821789148825137943673860375725259609491702542618480247489279674992015798212991499006094400000231756822835123048912507846893147765841844552031506276383378084996801440308832848937568297764371680373349077294242426721716485825324456322121761714410549789616385975942882909602724303345783397638761767986549201370233014501001630514400322951573803994550072277251399718648714484059175530995574806366631302592364510796419773294783318126423763769989094395273360803441498324646987192111301002007925092675436179837592433958696723493874102209325684569514354803170345514170999483844703324462119260869431559712571815362389946467155) + (zN 16 (zL 116493912836914094281237927147754216060846149736621655209042415344880960747698300404351088128739346652236179098478001318376050952397535753555104575634681508459131830019042256125292591079486173179447031269856552749863067606079044963778290865297125602466798481178754966884869789838551178928314799618047174504999128466461352655959832824557571626456308014523662390592227836829012813342325348913281708251793465814501951685233950239506521113017828842476974401490931711522154905440640581027421837085519106939853590131852431409940163273321978187718357276493519741110637539376879284962009153353672056069153723552639559988373888472672947502563229835095621863265896529972529656633382141630868827898562786166204539497332573327025558150665315276180954266163101073450934916610180229245595629626640770820147045771382787868270102686610199229903931611380448860089162939728729962297467121976875868821736500277543293032756035681285798653508512247067483852196029417771952222473026457112725337971428636108073213229427882499487640163636875131512247251099994006980233325800830862178) + (zL 12731562623955191088068576802916754925551469773538417149976522799459568806405801089576937195959187042112189903171636859125326177138105467421931721832663805935041561100264143356735105657508828576821718691769964442165412984523033851219412689473671646682435327237236654783714965172726488265523276454865958591165237853880708404702255931477191648034072133583855078579185960093326359604080708912506742644737498077834833502182784732084437359963053851390994827978996026793909949361899305000256384196345367319699296136249247021078383231415487388822060853254633432913104631300850114784148343843994314457828958631122057742555902645392304096661538356514483231248831780765791002267247366303658552677903330978393350308948010100707337063179792629955685643638509558801084462729517050193014471218691182128018379134701330254347070945579219639168765443881739595675809030043094022883268295218121151897754758786903396808727005268970884533979011424443797529882215430364849295480024976400719365051543190154005956604183513195944626490639986361586728325106769394840494156285535781394401340542746629))))) + (zN 80 (zN 32 (zN 16 (zL 713141613780792652262958894106293821210167566342811806551094965952476588245397212629708480620007499097709358521082574604022520624013777575765308834481999177275380200750247180478955011976259929213071345182107982533945182377058299771960236230137135226876428896099865276030068441034965577264574358349515990852015630985705022063797403031466212649342790333176194728269234832341015133666119814013731336224717886244027956988290419505478547410625617994019767206001400958109874680564977473595411239752867586114485129881127788170046036271250661965953949807397856244748096690408711279580598140608023673414356160595977414545365080180144449851159751524846842483918330540278452565269418897818727533138048337716894365848590649071690100745726266243284285037957184149624030604849665385194256609107458546009422357280253700204579430798963902115809937815415211835606478138041244855119172385929132276608987519630735779381095254694907461611205710614366859484754131987303736752902860969106745726641031617268128389409610742226709644196236505071706581207453163792994326309975438982899232547752541684508) + (zL 541987626473402415719848714121673538143533601022534394054369339629702460833326807693175687864530364290244135257984032289541900553161895773383868168246013739272762525586206694823157669490025941001075607948156729817775694453634779424379806128343352531338370571776109525511331418084761527101401396035394288722977507556301960875337264513403837561171778875512987890496106900485159632238571419248518032741548299075409818021373401559237792925966910748308400180900711314644198590482604233757088235686293902257880446744072732895012589692047159264975548221285714963956192187462697523733554984048669610382148482766141399980599819052775653875859609037786010324169095395608425517968873469092990214918991218205423031526063234437935174036704452526146759136489025522718104264219168762963032973184561838862693365455589388960317347151237383019737081034919884348319571197742613538520589821332709235220486804837202137884863200520946006005641456868899643016690378901832222800582380487095851590124958185443956600581922826331820478586088274284575435312599780905795354092224687225112753220771499017102)) + (zN 16 (zL 3632638937902339590680148360921379760167377663887551799912018252184096110657683660785562090243955768595327239480593711950056390749227170332631596308490884855910897567377407044040186831894921962138687225135578123676953619194373970682892914746533049620540135299215076182137962342456052254730431125560346286493797991358431197360259715028495227594336729246735358524398549102402772468400288342447789204150807104114007033995326920883867192444357634827704703454039867245079078560542060503888676668933980249243598859546228304572078046789257539036877824165481965511359430584690726722487038044230242787750434283558032253686338234893664384211258820893772748382680813656071430146999528713613485429750931906807721930043930363836512496089651374033884548346963871590488553689497021677819060424660728513857526078116897079357692962978248015323941787019393816546450152897731793682738209573543850270504915714242962487883917813034723080907851255963339095567906117569569935853169855625128749402198953610173329928783918023616981408605043818612521561862500058017) + (zN 16 (zL 873598476881470999022124603741635364233131730870376178810328835005590519200542520333512864392267509089551658431927209633431662904274444850360131761901355335041174432723904853836313850180460839490113917618605929005659370055003630774271020693035198646321194142424521169280386704734150049109816746314228075155140725700172663145738979556979485555172545368325568997103482980086791978201436366435926483863004080515268638903602817855893795456858613172457342060522193489620167628679228939541176652456123055510807971918181436193757621197227094954389694738300340202171049538830780169022860030025454880196731546339711109026244330900391269688059929333998499125162874704714786291343767459100933710608181208074069066418622767391694146575972129036224566994172453319946187415252156492707240814546256013128098307102100750281925018729721000005227791965737447190717499443348727342829459774181707821615149818204909725795871054731306004780238094837892347375167688629733558337351726687155930737964918936446213718577315790250501126940946775705849763326774052069832350600750615468294551996014331757489) + (zL 13501668935949342692578427169700009861732777138549095444059583359939799131569913847337025104337074064288283380261637822377251971099957838963096970993689613903968920022492239947971035708352905697930213798790598118884734111659816342895929181181043969219751542808755577916699554075155851446263114766006066948218079123487215499901937450768314691198358858386970564527639441155651353248773137283308634887666157941551523204074396381377702498564629990280523834833015491436660715234100498619173633943551966523224386095385902566082186763147598709578328448339036492660331429880882495520084055619472143230797211793806451787392091014948705500989840271329140451531662231215389594852971211108614969544542590742855027356896201703155129304347488410214479621731714054052659521185479305898966555146997232940759827886920190428823069520319068584807054755533027938002891895136780132707874245817758985074881005573981973124595636998563646044535733616014304122784141866979553105399949641235016549668305991053836311369372905865432388207460986754621257818331089793211814970304)))) + (zN 48 (zN 16 (zL 47914266622143720694398724462064851728928569575764015218140296820033318254642302250022851161721635000199624553079310965387714328201963018176809588164300927929568705645388038723160388225850211504670958220724372095651694526993847784417731307790504428215489381044480363013829553553179390401739733595289581067911206566831981863988756984033603851116695967396669859957009420081008152234667510822587570805550991911795643412379080132559591720176781647029947632558768589405474072221479192014471564209176296832438090202674840966301805812478845967341921811855475498563495241920021012650952648500089255417831702762927495727674579090325681537976838550916682646450729053059031529682557688709057286209359823172022769467402636485628964384702839339021394889977794374390680573908464042730595605331692806330433209451421232753078838330281597414012787778581178279939905341207360873144585122962514084033592900994538007659577294603863942064701138008816334325928017768895412433796196064624126696815861690028689184970940030365465495230641394787428628761149445) + (zN 16 (zL 20162961546590430327733951458712629266897223551863276132151793938599295099080354958920979128346208091373707170431045561447239612111079404183671792930449281936289785229618080235506125093844373476326566388336970541785742406726734374768677999959023457801877350265489912112132706532581786483539516961580423503498484392170919975124730437197717389016983327154278583173606531005274540289060950608425800380987042906123961135507300486406291403025153614671753234894685692388812866212616069885341133893664320671835607644283401457006804743923692924593988425799949918676586624166396187969536329227717805311115114011362798027047562177882813734286377712830639019077308272139323680262403235958480855186364740906610761396298435604117370049590696670969588226495261225915868972177538652840688026482154363685637695440431503277948221473037679969733998581580241776285333280330139260308546156488537549399782934077271663326953443918902804909702223787052922865662885334131592411838772911436791439640058425529442908772437129154108475546818492770772834563902864100798045945861) + (zL 764250096710290533801000031235231093898657245864713426594562974943603207898972865937744941344768857507222351162297014481358060976922598538978978574898462403190144348400594858339898881501797495552081455545323988523589143112619593715116658639321424513878642337042308133397405680299779249381373860792793495869494620614535208612864808067980536948835211578916329298432199536703200408789238531775199928036694161321201944639614905081045347009237303400047408795143794871279506724027068690884292995027087788629377111926371677475419061128966391989954094546221372001023557126552869658134461232506116600079717851272897341056062273887370902188517747857642965122104291211170339411950926046742823670897983191886489340412619075414871020427329214636938148157097835321931422508384560004234982278592123445249071268461458380277691878913021056843340066717673552690614068804615691568152780940993175288489740057672908368254333186464269189418553442881730064806476962199898551187277729590229419453024397062901997183115795373064166934452658377036132207236969521501595040593832766155651639024611242607600))) + (zN 16 (zL 25966286994975948251903104810127163522837673898940784283296902325652590278851010944684339002259746297270565796556883562962537760906299124096696639527372725534508559211351031252139587226161922725347683032714577994767798815585830245764283685468580606406866796247720896067426318764450205891193422507810570349188953127758438438461615560224064891877307578957640694503150216568909196654762781696670063526300494061237863541113611980227962547713750209264887885224433736086030502856144853121063960072464704654482239614642921534981381746540930037528722510537578703358775390361687174446614592384812984605402485706657108210209973731384950126432828688489454535926398840465716246224290473020916377278646677653777528096074403436510399923948482037019788746384945581504517494441203590727871934268430214927695803985926234252254797701163395485983276723374560660437059611032575501270597147106128263724226627508916839398564228802639123893621357529795020993744596944467036678463292645887587976960379862889245501418187064998563469419585248409051878305747613010481002803570267127813) + (zN 16 (zL 822489994560514192276611946183085601401102630310798003543800159496886609947381061100891231246930213341389159577506408261977801212073639842374548268672050030103475938906873776281485054889731411938868927190921388814983679548755758719812308093968886604080277802200605982915201192358511578430857370781654560086501423809353308550035176878008670639706762102422608001846894501995006571603470334875680710499900379442785877893616609978639562416063659602570798864275995025812993357296033334635258949207353034889488998629820883736162873732805829586413668359045935204200786951903952639971434145219777912502599153960091228678902415925255707517412724787308456319697550616349558379560746996399609829895767298180177432576338031105923051978595076254702721934956349141705273639224373788953015576639583616811393377223187502515132251824528496160206780764146746852940628132431996613071301933195341434739898242452154715035706144767615253976139559188263787684410518132663362204549303204917886974558152838504802843047522128591780350634566277191799934853991923964415668567757059207013086217901993886458) + (zL 23162863152339761241490096730908990018663544927869734397682070564104505016425863610612555899885785869504221095719233567151989676903115716523409740594793290494815041633917287742344295537812120057498618257251049169655605778597790217988239061764352978421063415072697330240779509137048336231929982158560157227724259593915092580162569101857148087143320571395151586887917375743758898766166061361572505117000787039860056048130267761558136599124836017298666158677529808080740850061825402276337684095206088027405128429835514846827129051470224312599376542938201270635978434671496364793829629164399102128974126343778587259308645595660705219645952968132030914730787567170988035876820037506536089518521047278094541531230537348794067338646880706288228822673037646194302700165611862274418221606692130154274661386629336290341793475257517063341521735215635604383851408263966505926822044642585627110744791914583188798922786823130606682142625340758472736742968863788617548941266607018788751020177719336728748738597908359084381836950509722174933771180755921274436518946)))))) + (zN 176 (zN 80 (zN 32 (zN 16 (zL 41430080728639327981100545322395650697803632006993456904092052427024070588481168673144141333109561300451108629608635233509400479550237038639702878655936069614836533269014587887322587062505642467964835749910580050544722783246306258852724502553600935180555162395755352435995095846497345785606737940550934161291363314939131439425087108508741826575880537464110874901553040294164082891940230668360618613346024440003516050924541887334664494852217018127556233888464411841189575117319714877645669072033896292063403010179372288253905024128622061835361231996555761272095794129756423305846625666348255861122644102158125132586629268579203008978050481556305734711728390738899090048426249085678465104320613141293499754235354433569340995526014040305106628545006361849820788351893444656671859066613936918404035760111267768227629902751646881831007783062279296423323579273933286334216810509679659034190618245616139043096221188356047947293153615677887021091974373072992484519431059030205026517544302951056886355457564495953568408275135538285131751067460412936420532015841215537) + (zL 1832773947416637116315802934333598429472366172973685617691797753590002263599442633012205159301694036026943960800084812045170427942788967257106421078987349897484185941718204531421914475017367465237920040666921342370214567717175203936314831828569417863040840880295361754482295823319904677539585322278583578945005972781109733651217972069036893447819789723210376078029923722668385483675051053708197642168599930032991940008361373082433992916974844756292314420026741921025373148890929534544427651255444240586376623186522567915874070345958979879511968242405662998261082041156068303169603129394704979390519510388480196703553019142082330436269784402683121316281169718921058230367047479383850517843607007341553049008601965269020502469922998869602861310526875701270423844741014069546071853303940065543350390327775384906854974248260301382736832939499496231604547323339761568731314254185590915917870657492506608972127277989774119539080405114180623142337980621292550841932290114146392641216902558556506498158095102511601312935980142717486165725126286026943510769840821833087371338765910213697)) + (zN 16 (zL 701255920217779441391909712750629838985653662675552523522901238407120737644859069512105308338132735380939899065444572822531941552648619935091243047762698553586428174487650777771684329337778189989886656212272053784786444313647023057069102643688715600026540032474809425846062310962390370050325126505971159606332936703281835743962493073199681959421164814922540062371198514715026760024778154788501572229314557935790486956263922619573266248197195959621918743852562585934807068393695705249856513393022633595109315536906813879753441662996453650789813731605392603217774865887719103011800501983136737082280630205579486472083613656694047131066440786597462749059030779203490673706611529055725497688027707430957873647132143411474743713524383437876732894373690840476116221663421394885868189440055060847217572213441598452800205750263510737197845526738532651062769908529330750257698960020693139963923526186260522380884939127616786061910795600316532690240114871135065671616973759498833037951916609523410739960319702392547441990645629968601348297851607606291745516271836689434085584832782730319) + (zN 16 (zL 2367630157752231605513022839828481367535495433717427018509137081047486517936890247366922142950820201253404366820725903633009772860368437798942928434739976572678617084573473930108641251945837074009538905466793690857685342546529263650708730926020679001939670733038755035278574174131707618358656801647090257724956261297131190775862799389287722690181795747853982231752307577855827732795585792331562203875069910586340840611553489923249253644885541293773423675720061949947676290640696016747625274517573727199597389404224748825859359826886721836757644920958038534397892048725960574195861354054634600627328201175600872360816996104395846763792542869138275743707727543135248617273197406549683049523190093482411812703271876880950071626610780144072782196504439478009479849678635862527355798681016889418437092018591620442709946584299153537206716408262797822128956040645263448904890254762759268508383796999609702515811647250549605822535342850954323077044361651674016250548912551126812856406208263281536686063687983074093289472371599129306786236865286692476807843423942324407198525193607053317) + (zL 93942546986008557443419292613025656624753817847289752068111769327569212640642405638669508481652318428456251126280766484065790000662021105890276768990341835910803190937172779675550484692340327183574035298050974265933401560092817191114481263224548985085691041531319810737560910853515073211752370185483855235175244912411218836833057574768774502912770695350142258347867304389391880933318673386850496272246673798501986694388855354723594670596027926017794886729512909938713969055699784717697840724526449441777503800841876875579143326599001115392641255325311416115161887340682887750879500638698899414421725191776137286027994382735126311277217365196116420672157842308395527410422759732267149958447734748786716620528201112891863028557409995964259344099403848110780463009665605499823705416424819092384520759709047373651625521282126449960271441146393359161454154529822200456018046170708845005791632451535243225192399896270758910867207099941080644119303373428379766896825417943232932250696959686775755151729618300177813431738396997691767809591658882696388162283217683574)))) + (zN 48 (zN 16 (zL 14581447791538423981206724604436788280907127378318267187759859275158602006834935548662310701038478644921224358575254818140065784845693939387992700859649854801292944359121326199363403628006602767934288287237005423491414649895421557035038867419568107507375832887300729502731049383668628546583261361994981689262207991714989561128303485557768768352811223361012467746113539530480656288643931764678898105921170226309880901485178954079220393997150064611227127524666729656309685399533630074332108685776840051019407088987381212806649269900568053917464327609009867816293768716481910633397083135339088010045258670205928901801027678768069775318974983962386004271571198478559458959012953413937682920657148381756181621301948703950800645571649073669610654655094161690046669079217089513797586315989841771054806269988026552151857523694052988872966828782562149498653339027567135973309488450382469911876595733206664632643037563719238653825745562377607650447013845474649425370890412089183731569161283228967950699118464149201931319333249172619699055233024458067702256415067733274759258268042371) + (zN 16 (zL 761872957389146816834261065917205253997219823767640881371228320509199048685985840446853884954202432234014498706564003191105647522232322114632343802661807606835396013402134200459050369778319544893709700322538442999289821906735396029326242914050774335345323861924684286144644945702271453142105580276062870282937770485058746855142759988517095214075946332832172877102694736765888938144822776964613702154654534606595125257414568626161192534663487161483267556446592468882952355528546941140263535311495210957453000144982167712727341244232059689565316449113756510757582143006322522767289255325294248712782250748073368316067941775969969975248922378068864580674156710636646573180423708532622338327500632759791404079691698176967620439526827215090986971257398635455502797310668049548573575092722488509554410359590973085729387578177475689441290782123256955902807399824269636473255811818897079669223230254630979160934297195535825855616121289222653904332478014005523164251040421320474694924267620505896860766611579640905222632674910560741082884383408221117489787581828884756286013025871529102) + (zL 6675825196108286109108237289444572675048648535243042683868714676459009768086761390479598355191365814673515361983914557308540892966361249060259963477560931063727404461219330940272408783376604267445416815159912262398179553939608901299485360452873818324411548532073750065962945891931766039091967459494970058654383808911014082480290726734387499706045026703856360490864943713327662251225762446841517668624195272005833119599258742802970792652180660147494902429081742814001437667659033295292146770084877711103782090029929121304064993813918616722373354087353592479120506647241660552336654094479240357864102655040738428567601064364641422361401105849534572685284906075195056655045658397350677559614018709456233823041694643633296078027034779164339807689163490563411897670617141548257319967088381190633018612000733375057508738405848981918436483278294186354212038169498069311284569897899627698726822741276228834000885486594596593518496443566906038292598493665671645625138618971240343373681871025619763668683721184712720427237979588137564287857678087547726922913))) + (zN 16 (zL 622810342701892249642984013894394039371954023491572959234857405600910344636364840434061853584699341012638445839958793725766964316580373022271618991860828758599477192011624979651832593079673872775039625033583554567956709516403236829404138885482040307870324732554552590460197960498850683011452045205489063192410305802034589561489893610002233953033663365193192867489217259186429841858636424378926860909885011410123996193272428658899642456170715113798806071098685636383416655127848529939265172598575900758339878719913220325747760919553799298241838581279724344666644571839112977063219483121437936414262020923209321186464862755798925633652181608347069673357809465926594860424292780184462208582798657133615666323406114990682251560955047383853761098249928574630757850623278148817265031756977757271737860850060406151978277307504732179007999936650293007345966030947500437316998429581932180302141274391252342434990402721850884982322585145161089229687855835952385610444788004616294353706789439956020189208717600397113918130780222737322602631808262508700597700628262799058391575696099115013) + (zN 16 (zL 6943974877025005627168900831578377573295451387658602183162478826884970418097626310272237677733079554165197296839343019228756304506497266015237670811768261951776079776300324989463742643534313097406430034748980429590737820791840138590459307571505646267274685473030772559253006720712681821277358380364555030796842390222384195604155422756281658347406191836252103792121673816745193475598434550308363835934223949724882830693970007530803039207201371803071027058931010098566168185154555848878038389900098370387438668604715813377817651024977706270219518132956728304505044467798985302422969226332360946845076326547036319212558667684134969754905319589266786986740670821466789363328264950128519425910838745878261174330691097331446108538192397328100887270108994867916485454778844705308763279182846265464342037828293775607446822413297836565664622559959394905852987049735719363794042112761725874230099110824865760762059606615559744472014021363136430893740482241162265025375742865383226655328314499437566456111677080625695399119765209599503561511711868071) + (zL 2403297793668403918925619219599760469765142599930360830443868011164739955762613614340644839799570598889979568208385044285486895485282691243555947075751803062407411895726069432742874891548076832647500731367323186116588381426232088853882064419709839331629156181928364506401521577237131420642330692866861251757101647443780116181126088342960755366551209238573288412110047546453520470689920314624477173210699911558665988122797950271804540248317597104677832988307292249595151718627720109003841172312727366661616807557903879388392399893386012341861790712432030723534791697081294975141172173990118784595433809681884401514755927650651518792789220780711423288028546594112547241673222170870944198062933851547336137100755517855859831739083159383518875036646838881301918292201902876528863931933151669097984845434418102928523715307629050446459414027800468712626010916717001595348005990499962097658065420710666001265058461341599226665284931762523651348496462111176176531413933778278587417466578127852878686259195098387235876173652594238064548715864862505119267030738201500208932932968140571855))))) + (zN 96 (zN 48 (zN 16 (zL 80282862505410328540234358807363300465251892510466860499058365071740595328750472395425244231350340875526044434707613725525111169742036496679985853952608717846272934681869866765335756906659143633028799597291794107550571298653818633152002223953379456066576721743648205126695997050594073869899575939389465720786560201163223779866802030806353748495265357827801830924881357905683667962484225411495850907149690151055655533455432108895630551503547673851620843743222959042357235368837684436038942802035921170208772936089027863633023785440007516594589400144155944293651698821673108866873205712578719941693420059737495483605359631022789469704438379444985226794715059125409120403150336733279378503849153098185663187546120559566685640351220470930295709722684233770701904728027205293203953881268997749139318335758731654024863847455054349841592608425198283638934493031465949348716908537311138166138802931328094982026448159674468409656856458584587959434229848921100558641244144333770041878291895117589771395271323567652718263618710699631740857000665697174011231346448729311) + (zN 16 (zL 14262832275615853045259162741438342035100808027925744646671122250246177276281748304774846602559685893339719730830140956940173530195496625318747631380603651000824272707395615680952449753436437062498780252960882732563010943162228924788750006003968001885605282492544008548148406421123651570175978105418406900606285593063973484413881399154737991555925039392970605479334387892404587884808961832110700223276957769571478920083636433251583774948842699349400898650785807906024341510768390497217551623816431324136018735058530833659865868848446131273671689381782937561175029364371023457557363172565905177000680370108601718552190164746031759070423235991050577718289545423041365766893790750776634891189409958811548457251199737531321052082184818608105554785786696482358773227912197406380494669834689617020368874056399017734496306448243914497906704542120907869878485920695372981811270365924883119995447714350416411515256786283601463030633654459683131993375904329197580933270342241222818128564718119129355712532008215063597066099665450936622231595411059470842083256942248649705014379615159264) + (zL 9508554850410568696839451659240843427579679343587355738750167579420057078762729983006261138080881764644265389723669405167898723410324688858885131419143554744825474984692615328172930823181042462309890615998330484456691977824208204008502124043789524953249757092646335909319608033552448889230664091684282655966370074019157629431254209642267795846106268937501443930308899273563644944284597401703699932997030794816914998589251215990515952622025512467075640466763106696052691934456120818305040654048204879393462658341180584513265156654869020139668536061706526832093817868591363766729052703950375688917080708962163615860172179584059459066811243380180671681360784033199617809926219427638543759941815868028073340044609824742097671441268944146680414783254151741965572269045952218187861875248987201038766128599309630722247435694176711293191092974354923885200186022422492610354256195769747380525174033436305292374166463777518142674454458233751214384165771949754241789263546475127325379838437717115889165516882707185920144764299355600105166948856202267031237880383810051316956760903845120))) + (zN 16 (zL 2675469621034273767073199732618962135437845582637021712681650953301059089981121490886312860511534405479092736005103388329415914658339472366278073211647390948228563759941669411510243130263465858849314175865204399950882654917514479186211513661772274651468108445353552719108252661497470991453200160167101205084688515915255598407565384038170083637321381005254820553536163874302834272873279717519734314660787608950941524434498497893536048279423263848504338294126583834427707988607467785200660941919838833613952058341749502209404978446119680738739023543557502853927827579749849772055388730200706679827116560703756707057856267584107124126336888408897627756012796955353815109936337562039157278523291560283718437128601878858053210229428871449341343399598637849886785815050413101721883801039211014368083969956443747321006065711468800394000822636459267660703639054227148576756794650729360431763364770804470505444702158269279314910607340724481495829550616127806973219252175068719730729716843718475745084411267911270527383518550106223452993825054747074549801370777908110421758551604664272149) + (zN 16 (zL 12459520687545892133195298262746362116006737480750760124553929553560666735605375706572054539090139010172563190292090739494765504087270049946830091286238035217281348216311073290660787562775345621150487945674895971412632046992770524556809104823280173507698163065748127595679455049539541522032012226762142080056290271110200278975539038566007071132561109278932512618715722759539229208481719581140042756823824763045426713805738401986089455754286707294237174053479470463901690380549222252146483965049291878007766875559925645556659243560187481140360356390640494016205972713968313957716664437466171356597731317279777985672142456341840050569105401554933947458372071288081592614182022791862483894161652887643260318031254843985686112046563247759462946473262255819528440875161358512871471370192910035221892245630482992077087863311750426510887996202369326038370599833636237994247419387649332240481811080922870314903010068522075067712371960634648535336190589070521090957875720666077584981581167155102532256395372482756016266871970030786889814772620250525545732959394902109251314391580677) + (zL 2121609504099838538458244165005557736295675002274572288490153525268798251762656488032179606354276667980861347186452502495636581782408156999925454475928751669389075349305972517246358096433373925561369744063114154122133073308823710500445344765863666741682792200095599982746478549814854869659158893170562915400921663185420652018370937221106846899848521262701169270711850056916489705969633714950669845271125857905248612668991803527328011802810956453415922893088073449579612473640271305409018540577114247992013455790927563504637024341337133558106777957269193828049180576760343306069878518733496555840259215140778467680316600066904739831418235558184743619001243774533266125650044148243067480017810034363894095898541167237337559462868373844981375410168705878155720924130238519275548091414932474465287170955649720265280421593978683182018048906669631374329097921212859714343351440844554121613307112838824765698187693429589820369455035301833816494943017418153510441902946817305887597473233436052857950949139026644854077406759484458034506690511847193863532472987870900495344794722085699589)))) + (zN 48 (zN 16 (zL 3115763760067317594245303895764125365726475332454622705390387438481112280891367735479937679094517442063399547126780373199491719268039833480013859403418938115120715470418757178463531858011569078015227551596496845464095623310876776302096854519812881187588724334051806380758814025706844881199513410099748394577508254561298767922480946566363477030127592566393611631953401872794570305692773604613942035086049099980525518633841035545891326538884989619381941127373596253777082187722529168399962084277053855879992268432666606983241118337170636908459297496649482876399915913277684254736975264087105796661075212291088568984293321049024344227529538715237441895360771364869410582731571079544449698023238640143821174180201636286401374341417232117119242116991513274562571561933666727628380073051349052784350095646171916781284785543263697672819440353940930683532672956419214591237759286987429320426862546178431079134654727926474669116497444821055663602980241877840486435919567210944539135376625578209343809739393963402881730913151680265889539036853634366) + (zN 16 (zL 29252343166017707853933477005509820129315046434395466046374822895855105992299321214079023463660396031795014583977785470951616238746788759999642708126479793222016244423731592972366112605342147485140972769494600673460750224118344022377108600494800565327212693890202763362679204035374680299069903532883366025293891370062121315409293674324748453843183125563319624197123132006249113460597414443420958947996667170747726038286832071534451625162092937435157824894336620837550417158601408486938965513387453261062525039267088011819432715071369895187152429725686333813664690699158421270261807220568548217527207771930032060271626719692558618073329400770064204497317322884561068790650588986198448607523027763828946100296184774793437331969021152630902361094004743670029584297436410686519708113464453848506501692357639885829508925028905917024954792925087821774820230607488206537255447570726871996206954873714451675432174307908630325017969053894112173411620325999241208466096992651081546121389373899752995396759110782820612703139925687210103036937566087270839188371576390986) + (zL 10876344420625859391243736258111159282823209893122276484768476372917907762299118792849189393473440011329618865387030323627712635527376948499919506555677184642742511695988113062878170190741800902095030962288931839794973727149845898628628791039447324969051772138874031588194372421658860960254938418371691725753912023069813754263847152723738515364549298188520120114119922110280711874626395174406976753950028301660709123593948518337777610345117760718818567579405013550632741672325206662826990742486923734464690181063254935217025267450576507009216457895302376749206914720181833511164511029594684228815720250283464799178550158078429071762872104280493622665945607785763513207161283145599823663697095342138670939695935416547032756138440880625128270596448584116982871334403081065445691115119343958633238192437337421746523365211111796056717188941783451777752365883769468090942990097897214612785454991092334101313681534503057148356005487258710075400356705331027982461338230491799119155301515109438481498143624749033276696778848369572529511051093242339737142260))) + (zN 16 (zL 764250096727171391264549058998467164893704980466291730486766677670229621088099455448194963399531059486324929304751830539319154732146785231086209477297719278973729833871518840818682482235849975698468830308603048918871065214778951516499849366737705345217072224284188741231249937096826139000289412393951091812978926250003456423956906819824496771539179513459593411925725672724763874001656248435823319176093965763476052860679635774873800784736770816705179857468684602253254979902139298659151705123281380693413963257548335197388540141498208058209512721830741388553258800213389687112132118533736075522512164442663078194561329558185257950496284432056279389878131768852466123911893613402510974093612017142435614136000712930880873499886824704989326464337948832903791340603083356083890545846325775355676443621244420965130617293353447322861281987383131372634506726595211422591160397576653149081360705157710369053623400871239574169807260913046268607184794875975786795144806409949365546783934447340973526854256141299753632718617306744421371608293492342876235074431038661399765254188594169193) + (zN 16 (zL 72099938336529959766629256432497596511126237690044976295518503446064905876392401895041178861640192888811661556979039267304554968393476784669631758749257820362975425707855115058236471045422439605069188040637453345945096503978235581498444187637680520586651406916644559252150101145025953714110450394629148318967862460232891713075510097837164390477857698902606673982827970076555848342669576592145926972026247361501172368438961469516612315764008026969135007769569429079732832337150429465962300317314146947447522483714875491348483650316734515778212671562953834548513259857563505462337721365206750144518446765585976047869673809212864328191394771851579700465805959837987718270442071633580255192382091503705554686679502389263914276224342870933500706584464695679407566945765811987284775451537598627536678463618094185236587273512777912874615257769545062582344438121119996618054816091701687072009471458106127412776789270986924677349902299154220625534489561918950983686524398209850220405429735436998614703204789339883556823144682493303778948696286340174842309190382257524) + (zL 0x20900000287072b06a808310000000004e60544)))))))) +def right_tree : NatTree := (zN 1536 (zN 768 (zN 256 (zL 0x8d0003008c0003008b0003008a00890003008800030087008600030085000300840003000300830082000300810003007a00800003007f0003007e0078007d007c0003007b0003007a000300030079007800770076000300750003000300740073007200710070006f0003006e0003006d0003006c006b006a0003000300690068006700660003006000030003000300030065004e006400030063006200030003006100600003005f0003005e0003005d0003005c0003005b005a005900030058000300570003005600030055000300030054004e00530003005200510003005000030003004f004e004d0003004c004b004a0049000300480003000300470046004500440043004200030003004100400003003f0003003e0003002d00030003003d003c000300030003003b0003003a00030039000300380003003700030036000300350003000300340003003300030032000300310030002f0003002e00030003002d0003002c0003002b0003002a0029002800030027000300260003002500030024000300230003002200030003000300210003000300200003001f0003001e001d001c001b00030003001a00190018001700160003001500140013001200030011000300100003000f0003000e0003000d00030003000c0003000b0003000a00090008000700060005000300030003000400030003000200010000) + (zN 256 (zL 0x10d0003010c0003010b000301050003010a000301090003010801070106000301050104010301020101000301000003000300ff00fc00fe000300fd00fc00fb00fa000300f9000300030003000300f800f700f600f50003000300f400f300f200f100f0000300ef00ee000300ed000300ec00eb000300ea00e9000300e8000300e7000300e60003000300e5000300e400e3000300e2000300e1000300e0000300df000300de000300dd000300dc000300db000300da0003000300d9000300d800c700b9000300d7000300d600d5000300d40003000300d3000300d20003000300d1000300d0000300ab00cf00ab000300ce000300cd0003000300cc00af00cb0091000300ca000300ab00a900c9000300c8000300c7000300c6000300c5000300c4000300a9000300c3000300c2000300c100c000bf000300af00b700be000300bd000300bc00030003000300bb0003000300ba000300b9000300b900b800b700b60003000300b500af00b400b3000300910003000300b200a900b1000300b000af00ae00ad0003000300ac00ab00aa00a900a8000300a700a600a500a4000300a3000300a2000300a1000300a0009f00030080008e007f0003009e00910003009d009c009b0003009a0003009900030091000300030098007800970096000300950003009400030093009200910003009000030003007f008f0003008e0003) + (zL 0x17e000301940003019300030185019200030191018e01900003018f018e018d018c0003016d018b018a0003000301890003018801870186018501840183000300030182018101800003017f017e016a016f0003017d0003017c0003017b017a0179017801770003017601490003014700030175017400030173017200030149015e01470171000300030170016f0003015d0003016e0003016d016c016b00030003016a013200030169000301680003015d00030003014701670003015d000300030166016501640163012b01620003016100030160015f015e0003015d0003015c0003015b0003015a0003015900030003015801570003015600030003015501540003015300030152000301510003014a000301500003014f014e014d00030003014c014b0003014a014901480147000301460003014501440003014300030142000300030141014000030003013f013b013e013d00030003013c013b013a010e000301390003013800030137000300030136013501340133000301320131013000030003012f012e0003012d0003012c012b0003012a01290128012700030126000300030125012400fe0123012201210003012000030003011f011e0003011d00030003011c011b0003011a0003011900030111000300030118000301170116011501140003000301130112000301110003011000030003010f010e0003))) + (zN 256 (zL 0x2100003020f020e0003020d0208020c020b000301e6019b020a000300030209020802070003020602050003020402030202020100030200000301ff01fd01fe01fd01fc01fb000301b301fa000301f901f801f701f60003000301f501f4000301f3000301f1000301f2000301f1000301e601d401f0000301e9000301ef000301e90003000301ee01ed000301ec000301c2000301eb000301ea000301e9000301e8000301e7000301e6000301e5000301e4000301c301e301e2000301e1000301e0000301df000301de000301dd019901dc000301db000301da0003000301d901d80003000301d701b2019b000301d6000301d5000301d4000301d301d2000301c20003000301d1000301d0000301cf000301ce01cd000301ac019d01ab019b018501cc000301cb000301ca000301c90003019d01c80003000301c701c6000301b301c501b3000301c4000301c301c201c1000301c0019501bf000301be000301bd000301bc000301bb0003000301ba01b901b801b7000301b6017a01b5000301b4000301b3018501b2000301b1000301b0000301af000301ae00030185000301ad000301ac000301ab0003018101aa000301a9018e019901a8000301a7000301a60003019e000301a5000301a401a301a2016a01a1000301a00003019f0003019e019d019c019b0003019b019a019900030003019800030003019701960195) + (zN 256 (zL 0x29500030003029402930003027e0003029200030291000302900003028f0003027e000300030267028e0003028d028c0003028b028a00030289000302880003027e00030003028702860285028402830282000302810280027f0003027e0003027d0003027c0003027b00030003027a0003027902780003026a00030277000302760003027500030274000302730003000302720003027102700003026f0267026e026d026c0003026b0003026a026902680267000302660003026502640003026300030003026202610260025f00030003025e025d0003025c0003025b0003025a024a00030259025402580257000302560003022000030003025502540253025200030251024d02500003024f0003022a0003024e024d0003024c024b024a00030249000302120248000302470003024602450244000302250212000302430213024202410240023f0003023e00030003023d0003023c023b0003023a000302390003023800030237000302020236000302350234000302330003022b000300030232020f02310230022f022e00030003022d022c0003022b0003022a000300030229022800030227000302260003021b0003022500030224000302230003021b0222022002120221000302200215021f021e021d0003021c0003021b021a0219021502180003021700030003021602130215000302140213021202110003) + (zL 0x3100003030f0003030e0003030d0003030c0003030b0003030a0003030900030308000302e60307000303060305000303040003030300030302000302c80003030100030003030002ff0003000302fe02d702c0000302fd000302fc000302fb000302fa000302f9000302f8000302f702f6000302e5000302f50003000302f4000302f302f2000302ce02c202cd02c0000302f102b902f0000302ef000302c202ee0003000302ed02ec000302d802eb02d8000302ea000302e9000302e8000302e7000302e602e502e4000302e302b502e2000302e1000302e0000302df0003000302de02dd02dc02db02da02d9000302d802aa02d7000302d6000302d5000302d4000302d3000302aa000302d2000302b902be02d1000302c3000302d0000302cf000302ce000302cd000302b202cc000302cb000302ca02c9000302c802c002c702c602c5000302c4000302c302c202c102c0000302c002bf02be0003000302bd0003000302bc02aa02bb000302ba02b902b8000302b702b602b5029f000302b4000302b3000302b202a1000302b102ac02b002af000302ae0003026f0003000302ad02ac02ab02aa02a902a80003000302a702a602a30293000302a5000302a402a302a202a1000302a0029f028b029e0003025a0003029d0003029c029b029a0003027402690003026700030299026102980297029600030269027f0267)))) + (zN 768 (zN 256 (zL 0x3039700030396039500030394000300030393038f03920391000300030390038f038e0003038d038c038b038a03860389000303880003038703860003038503810384038300030003038203810380037f0003037e037a037d0003037c000303570003037b037a00030379037803770376037503740003000303730003034c03720003037100030370036f036e0003036d036c036b0003036a0003000303690003036803670003036600030365000303640003036300030362000303610003033703600003035f035e000303500003035d0003035800030003035c035b00030003035a0359000303580003035700030003035603550003035400030353000303470003034a0003034a034c03520003034703510350034c034f0003034e00030003034d033f034c034b0003034a034103490327034800030347034603450341034400030343000300030342033f034100030340033f033e033b033d0003033c033b033a03390003033800030337033600030335033103340333000300030332033103300003032f032e0003032d032c032b032a03230329032803270003032600030325032400030323032203210003000302f40320031f031e00030003031d031c0003031b0003031a00030310000303190003031700030318000303170003030a02f803160003031500030310000300030314031300030312000303110003) + (zN 256 (zL 0x4140003041300030403000304020003041200030411000300030410040f0003040e03db040d0003040c0003040b0003040a00030409000303db00030408000303eb03f204070003040600030405000303f7000303fa000304040003040303f6040203f403e5040100030400000303ff000303fe03fd03fc03fb000303fa03f403f903d003f8000303f703f603f503f4000303f403f303f20003000303f10003000303f003db03ef000303ee03eb03ed000303ec03eb03ea000303e903e803e703ce000303e6000303e503e203e4000303e303e2000303e103dd03e003df0003000303de03dd03dc03db03da03d90003000303d803d703d403c3000303d6000303d503d403d303d203d103d0000303cf03ce03b903cd000303cc0003038a000303cb000303ca03c903c8000303c703c60003039a03b1039803c50003000303c403c3000303b0000303c2000303c1000303c0000303bf000303b000030003039803be000303bd000303bc03bb03ba0003000303b903b8000303b7000303a5000303b6000303b00003000303b503b4000303b303b203b1000303b0000303af000303ae000303ad0003000303ac000303ab03aa000303a9000303a8000303a70003039b0003039e000303a6000303a5039a00030398000303a403a30003000303a2000303a103a00003039f0003039e0398039d0375039c0003039b039a03990398) + (zL 0x4900003048f00030466048e0003048d048c0003047e0003048b00030003048a04890003000304880487000304860003048500030003048404830003048200030481000304760003047900030479047a048000030476047f047e047a047d0003047c00030003047b046e047a0479047004780457047700030476047504740470047300030472000300030471046e04700003046f046e046d046a046c0003046b046a0469046800030467000304660465046104640463000300030462046104600003045f045e0003045d045c045b045a0451045904580457000304560003045504540003045104530452000304510450044f00030003044e044d0003044c0003044b000304420003044a0003044800030449000304480003043c042b044700030446000304420003000304450444000304430003044200030441000304400003043f0003043e0003043d0003043c0003043b0003043a000304190439000304380003042d04370003043600030435000304340003000304330432000300030431040d03f4000304300003042f0003042e000304260003042d0003042c0003042b0003042a0429000304280003041800030427000300030426000304250424000300030423000303f6042200030003042104200003040e041f040e0003041e0003041d0003041c0003041b0003041a00030419041804170003041603fc04150003))) + (zN 512 (zN 256 (zL 0x50400030003051c051b051a0003051905180517051600030515000305140003051305100512000305110510050f050e0003050d050c050b050a0003050905080507000300030506050505010504000305030003050205010003050004ff000304fe04fd04fc04fb000304fa04f904f804f7000304f6000304b6000304f5000304f404c604f304f2000304c604f104c404f00003000304ef04ee000304e9000304ed000304ec000304eb000304ea000304e90003000304e804e7000304e6000304e504e404e30003000304e204e1000304e0000304cf000304df04b704de000304dd04dc04db000304da000304d9000304d8000304d70003000304d6000304d504d4000304d3000304d2000304d1000304c7000304c5000304d0000304cf04c6000304c4000304ce04cd0003000304cc000304cb04ca000304c1000304a304c904c8000304c704c604c504c4000304c3000304c204c1000304c00003000304bf04bb04be04bd0003000304bc04bb04ba000304b904b804b704b604b204b5000304b4000304b304b204b1000304b00003000304af04ae04ad04ac000304ab04a704aa000304a900030485000304a804a7000304a604a504a404a304a204a10003000304a00003047a049f0003049e00030003049d049c0003049b049a049900030498000300030497000304960495000304940003049300030492000304910003) + (zL 0x3058f042200030003058e058d0003058c000304420003058b0003058a000305890003054e05880587056300030586058500030584000305830003058200030442000305810003057e052805800003057f0003057e0003057d0003057c0003057b0003057a000305790003057800030577000305760003054e0575057400030003057300030572000305650571000300030570056f00030003056e0545056d0003056c056b05280003056a056900030003056800030567000305660003055c000305650003056400030563056203fc0561000305600003055f0003055e0003055d00030003055c0003052a00030528055b00030003055a0559000305580003055700030545055605550003000305540553000305090003055200030551000305500003054f0003054e054d0513054c054b03fc0003054a0549000305480003054700030535000304f90003054600030545054405430003054200030541000305400524053f0003053e0003053d0003053c0003053b0003053a0003051b052405390003053800030003000305370003052b000305290003053600030535052a0402052805340003051305330532000300030531000305300003052f052e03fc0003052d04f904e2052c0003052b052a0529052805090527000305260525052400030003052300030003052200030521050905200003051f051b051e051d0003)) + (zN 256 (zL 0x60b000306030003060a04c606090003000306080003060706060003060505c006040003060304c606020003060100030600000305fe04be05ff0003000305e105fe04ba05fd04b704b605f705fc000305fb000305fa0003000305f905ab05f804b305f7000305c005f604ad04ab05f205f5000305f4000305f3000304a805f2000305f105cf000305f0000304a505ef04a305ee05ed0003000305ec05eb000305ea05c005e9000305e8000305e7000305ab05e6049b05e505e40003000305e3000305e2000305e105e0000305df000305de000305dd05b805dc000305db000305da000305d90003000305d805ab05d705d6000305d5000305d4000305c6000305d3000305d2000305d1000305d0000305cf000305ce000305cd000305cc0003000305cb05a305ca05c9000305bc000305bc05c005c80003047605c705c605c005c5000305c40003000305c3000305c2000305c1046e05c005bf000305be0003047605bd05bc05b805bb000305ba05b8000305b9046e05b805b7000305b60003000305b5046e05b405b105b3000305b205b105b005af000305ae000305ad000305ac000305ab05aa000305a9000305a805a705a6000305a505a305a405a305a205a1000305a00003059f059e0594059d059c059b0003059a00030599059805630448000305970003059600030595000305940593059200030591000305900003) + (zL 0x63e0003000305c2063e05630003058e0003064805ad000306470003054e0646057f0003064500030644000306430563064200030641000306400528063f0003063e0528054e063d0003063c063b03fc0545063a000306390545063806370003063600030513063506340003063300030632000306100003063103fc06300003062f0003062e0524062d0003062c0524062b00030513062a000306290628000305090627000306260509062500030624061f000306230003062200030003062106200003061f0003061e0003061d0003061c0003061b04f8061a00030619000300030607061804c40617000306160003061500030003061404e5061300030612061100030605000305fb000306100003060a000304dd060f0003060e0003060d0003060c))))) +def rpre_tree : NatTree := (zN 1600 (zN 768 (zN 384 (zN 192 (zN 64 (zL 1452638086532114967527917534955600443768870276792451180181243188907492566060796215535765410252849893610363103411511924722272606583507794783602111840978030393363160830611055393897735171284494784551582604490300988790758155376350261842513085887315416227357414893239995955514914316516682796844662062911074747039473980794780878928524525346371415101831149753795872112796186877337580813955820482588936411528821846438537809597551395561953788307461108342821141604394412300872836068459555015809207567088542149001858817342628682594567274472989183785345263654516293546066983941999908825606116100898176896142600712510343483593603288634318355644340147673115284839278747019439803641095230877071895428779165493894848131021910894886458746673843945667946982138714740162429213397555702878485663761682339426334125702106834505525777563434489444999530151105102017495620248100421112328864120243671883697296229162401596177507224052391821644678343331998419163862356656657550623684105312768778135205703532028910358351451691902998999430060555165867983455734360029908626441763225612237164736963424415521843135037051505240616529144183745225890269333747293416509418161241809178574596572161081631419400799209117353011369067215592874134389742552967957518435121073685150992855296765981014710025993398766436958514439346214095466128205419095261122342540820839663905491998511336649070522406296509728923792034950579205567609512730000579607576320655243206155714317261081885853707519021665965756360210992348384464173439396335949204456811326542121654297382562686624575739073615820210233672353183031530029580289) + (zN 64 (zL 66311532590394597508081585976669923495587885781405245805722976121293890708445194973398847194829125475770724260626582038493754852094041345478079205907679174340612743513839796911192967825685956215769524858992424309042475454649483456275315062388440503864773057415980798437659296359999370491378197889684475386441360593083078176632362764529288703742626691494791466818117923182270969806730620915672956636237299991019739808843279589982274433141107310278289037237228333820372849677119119857273130601213261402087016905439762466599236742350587063944954544633782727823557090312561902543066946252984290103928434552993523056902867333258537026795216213752261574504875183978390224613635515725203914594704120703569612451897541095936318361320052065235237514056862548049243497957186491236472841542906330118804773391364759392046500096699194693592658380995857781198220206368082974801808067791039210149377351367447265819439064609653722916420199403673697752384876369240562737390076115481167363441612599176966003632356372275655565066753770230585271785379781991524267371936601259033166872575605287340311647367990185997559578593371289459514499906015657380236458485427366761824196837341534671198001419822194159163703718523600916277808168719696376579517017334132877307891573634207062858153942840908690923419459507382038307162296408734313170725133928420554732581033240759953981531004257595127771924243274298917709285705120005218259696308632527603437928348621227697635045506784436959352326638908328060344938642331243388690390598467444732367891406996316049479799125005210558891595459400090433582592947380856196161220609310746) + (zL 96657488182609074333813837186332430857975562325438156277962290632661762634449277330831415546819475065903579611488105865263860247054134199500326055599507458403694901761165325083682650691041846272145000744432115450526555584522179866496706039017729868230028288030033816122362107123091649203921260905424954178138204163342514007591851395222747573778477530272343924165534437005418203141738073100994652303245455240463844013992842862078722787032770359389795548518261569473953274861599629545946450888488777795049715930153508830269422738842212542245468866419846637453899227736097144038130874420816483907214438235733173809789964023889718036964987927228032450202955122967276525188853275370504487217949277100096701516652346454976794992178493013169076434900982647768109473321314458257871023285572842783734735634904495794436591948696472321507803569745125087681939520684315278055816236486378558129573275028985581334109997566818232392710334167895827131114212557434639818054210696716158251252257512967457139876840995364363954952384845326718249555609657909604032649761082373872997434310200881677247623492467143700632162631990497595219090264638195841796066668450207858234338856211552785606099661604730719573328884979737445080232630740530336032551160946907874349071983213903965332899212161782748917057740790222076140938160696158268047112891479440921360681714113145116076673104563812840382654766088692574962793829688547535552147768640847414384496173502092514772017901536211242679751971036084771583093814464481677435086718610361455701559208582356916659112878316475706963962268082461026560443359640472239719049387311104))) + (zN 64 (zL 143333975643238744725208789086719549488571071723501747764410368769481935786972844071437548805643284161467153654427194277530975865884712946836531433680829409074097972127107802479550461877518156770046841159250581858510450646138147708639578561957456523642039225630721638408407301094735681481459257987611712761750758414079492416089763602521138917741841427489246469543579679901982300719408933805538496111831166454478074612002000168264195389459381722925831001607462722934485031479035950927876638904854594759157793977101760804122453905275354510148240108555026441255495017645989438889339485081906891334223603048090403273496192699787570701547099255464881235739565423738809395788560385089757935254481254948424678295011019362475424915706920574392600393944526370668233502307045425200795736160820877348483796609385589362163402036608815665869018747744996829871777571425634398642043542402717329442455130257687227771436949737238766278934211509725842876939690071312406603135559829002398924841176632380664769678335969867159610737407177781561706101759781737294277396752937533153914880315029892314744348439682466413089377294869646048922540157665550851662174561461863781189888632084751354477373269299363684580832768824042312494541138726274533442823652531206880173186254648637252772313437521736007614931955047156807523700874565391244808253085591718080079731461148005991237796794330333644437492424125197040216859943202334380521147135155595367927425679839833013419785968933500061098979062383404680097375662543159760240331443869968841810312655505132358502408399290098105295216023239454736171152762208256) + (zN 64 (zL 8657722995731405206466388508335378644862466849683009493575291409405240439645624274443942402561121266742408367677671536971426259521090959801238320559587012535721495389176686319646942438522811712156607409669347995528529772517036582381848139808118849086784568063361589189847867873244496150980714894335294694123507499927102830515850908663645125030643594613483964214922484869714449348821584384910858285809842490461369901110486144248225575259105323109086313453780361385893739647039855059431808492695204198943011478841568942169902707824428318409536347541727662755570252623078625170582781072858403176699554859612379663729179847383259502039148225548464519055544224856475522661867724154833121841713049148836773001373316881670654733213019216387788594177449386951636705650870189436705307977979969655893585047193058429355342973267887611238424083112138912394597436992668860009903724987804026325329830834745004703000684952724333381249763274437078186772021926349314121123402176213774987873860535750204263745059623239601864944236316456742789730647993955090465646343186621607446703890001476254546091878685724763063369130841921932210195407810029031542085240132775435415937541840734722414714927890155925863319212122806727460274779042411651320111092517995113271710228200484583256129959050670392846009011880023748011220028939624735878857692229770225594772936951794187928421395469802634294128527374831470423168996328965591876782566329841922245827602560034622855209487082166475540554303146245542635625757732859766086141029461278641235335452089304930322298219649801247609014100047818810127368308) + (zL 201182446333570050066891591352947733995088670421551511567245885027530010583047761198774978444154966692101352546124703231450402562069665353926055064132078228200273345866421419421940644303324050257199342546676585576072935722970381636142185586392482814826082609215867445871216251229583500120290261726669500774279089583054024232824543567176334178856464904692997436708723889094912021855520089585997754952660990025625218720524097658723771889599113950272519406172158303281283953606643401096470120643494237802609337841332002601049609840866439853084167193348817640355878394128678537246377200863133953609063414749227730864583509567878371866754732981573374533940407960117220070497081936586339902936806985550800068900528044956562961428057076203641774608931358361649381792114601424246641709934667096205863158103872642828878993895001464434809337509558963613505383504691352615610795517492002725684333417258439724848353979117296610761624199840281842987522014279883285914893760320590228907961280606358500062942035856971210916181214369875155222583183783591482886532657110351894747208499610134914228142096543359436355560613102031978572281129283851844795523131440286768961742465367406618382698164964870766672728200966499926049211023058742675641943667381322489482309110515753497888410813648339520966571737800390732900979493672344176019997561102439367602935727613433236611408530798526728491451798193503512534026233884188975751047655305204907986051437727689601515251935589054303287409147119950957243708736150328385174851697730513950397245668481488144416659458936979480480337990942825250782954761736806108707886886551552)))) + (zN 192 (zN 64 (zL 242767644737715814605858009677300058899101412352263280773929360502210775611505970162914152056402639756932346624709406737191173201966251925386292588945735437741203635134916742128639718022614664579540493221946558842225381463721594135002671676295485710556153816019130368528343100342485265913031935064386094986526173879253996967071346414213593735874363890207067949295218650499354393399095922240913804612447137903692702686379718146540204859428905662546641656123545129918444801225776834731896563508744825439903251864042991304246100239471991610783179847906072533010155596777962877025021848973906070908145520190148169440336863503276345508203158114987630081982273812926394106687100382441960166941795924107721679416658682789305492121753864535658411362670961375476224780969255175854280106116925983047898372014978315338782839281935508391176277271257217690412923638616024948367451112290591105336961876530782736525347620230958981132318244648989540927996509467267125092569755600709495051656395571160603478331758253182206120829623332603888184709869154171179946174755905162618907060369317790050879556299645497191610150340122209923517530510119954586301952724481370210472838604373150425495604738294734443136473670090523898927901416109492626815138348096236482365849003099897805530917260723360523750746075827713231628871847168036409873526756124126387265552357726335383733271491751906066537639528996997911934807356153795172855568512520602164157336892370503344154408056327182344042914603822778314597279858135970249221024551212616210325796428788077821684447614477572919014291114977248411149115666835401738315715835855028) + (zN 64 (zL 14177747724553442083072475141166660331184173901671165849807223606053495079057579103453459610445217277828739010812580947764424387562850719441322750723786579001974112726577340796506222268161784927304765273174733262517530864321875646331751587173087545858498522785405175840141468519874600465829049126012805467986507021723273854143566057122931409014367517268053037018737628595074462089868394295611090658493454388503647125775640499383384735104372904513332640332676184385493876191900999063208835478119762875990325223477041409164056193663580248027642433908232447674770002401856315395672857015893653287728496139746382397491973000889133076723949814680155001376553025588410849402895456463507138180661432370257531571148804749429606243074119050920619931419290141688586449938072495325782490828035390811458180264276293413142639111317898793940263425943634891821453297436640056916534074716672849921135892256828464234519344959613950686611406923920431959124745546575160489038166888697437424482035448025122719165035334163734647734546965842345748403385012010481729974619733223492462219995020590174624584243620699865951845073503247659338264757674970852609978292443577607296030889105463322748190131158050210935980440538051986947306586911282180967093176692703372252076877052169532296617167180396579384388974621766503793429283530605294342529336569840278485495603600601318766813367242747606357367670927780524375306628324660999552065566697346320308278941533669960060151146801137598857108706875266160892002700834737061749453762255410093181392211698907696483222821768484944383806384817160604962783232) + (zL 15920913428391980044105977003201328339430708778097010098202249834301320168944866411558149142206448911934196562774950523562860600937377965106778057245840913181012398175402619775602882419813612026219120304482949423834158964597517135674319881011808898442005982628303586117302736453829212969401362794233158749995677961920922615604236000054114974389643446094928413522680792450632616337346319275994338598694280293835412362882573258845045445175297728244244281146366652248549461798930047096806752235697869596017718437347047482078996778437453301691314694695081084485108491725105512333781555907595008940621443054256878111408385842550296904939556044053010489442660297832411064014053299783699637630252498637265138505452123411136492757154690996571796497242833513780186343229813304264463266029590429187143485858670158367676012745198489963517178326283198363040838752135966032359589395463510587812626554268890039467459097103619643440052587234679703478077415320682579647760640949305788314653213249882307569834002865788109609046149444313423787049192011108691253185928261469127046208038996889427757694531895973364077553874128910937918411639653217749536062310759115085708451985146248427564817146768935615697734171271295562583446211940233057773494523893781133264695635685983937444901605535258060413009613381922074476902157052169322406586328385849188810687043782551831132103900880730798779178164882568888724304454127503615015755138624868516150772353808380661908015496313157112340360067347119485996455854028346524366522221261516315003567267105668916649282150807850544282939739518479919407431680))) + (zN 64 (zL 17489762561846664209036127120865429342977198132581113923920581953508067115302023476264854840866958650214163838314152194869937619197977696779141191074283416477736583839969082516364006251853732444993059847145742187178670688301453090400304255104691303721648375349280956089925341826057712781929992738888060601323483058013875785722009139231276874794201226080269089798403396500519931238288195664638077740528392912420138992303151820230050024026796511346368120873985803022386203025850395727825057765272926032099077579670100333749352452147515896545299127665444053138387082861660510627646496622195346033679824253626888841123712244826052513102327737763874467395296970726487402441215206383157433729213043835503738284892066714960000853775822589107610894612891303261603137501148866768012121388724694857828317311796495337223615663805446786061574643865955786416800013625973230081698208973629388285609967629448375786884504454222150365184895117779486750803814961369276969079090352533207690295059964178633328879037897858460924392288850365057861777785824348696242971172119302291252145828828145371568082783148619486137878914742954597467029538584476635446078049548198735275856691185115536000983733710946925991676947785310057633375306581896840818693102472476906274070964956653576114067488096940714587262338982307530342981722891666780080121403169031201041614921781756516098739450520502200542006976750643455168145552022817262822376765043132891562701539180818896594905152536196077024508147191261193082840490352709101764721088015046592892575756478432125238405185831063355937918948061202974980964352) + (zN 64 (zL 19232928265685202170073960275892697809157277431393360717591300562274655858118725189228777838572068650531967667434707330627432071840673835882798002217395825065696705132133368159333532761837545409540952379370288304113995668793457661441701869979974572404184468545301555042122839749537612398749880434171190123645436549696812182521055371185758482239143147262177344814056009179572540273192237108606088920891185080380770411288148133778970955195854522562910416303241353081673131429956389055250752241888454909679398156016442829913876667809335623898224705264560382920048652514334706244513207438845127760530055006655865296181262439198130185963656651388228422697052074527312076620492120733846571061145066393853107471697672358386362047046407085126922319097821383983010749046110691467638066637549871939431491094649099226422059140281368288564881598772821005614980116312801617494956485567037211395947844483851866616633396535249405116111257788996487461797665901647618189015367810247797219155473557708745257729066292014870338366325473377580885171801741479510569767294105273621324114536188294554130177666270706615133648204095246661299489179080745487365346152152246197211465595096986420934174993103254791108185707577865083415507127400317506823735918950329209347148150582364751906996548618671618635176316299718128565068614393253761524436725181801101537733533860037350617551829006418849860441421947937585944826286927613897912306370883210546328419819757734173553948338850084107027050441386455282213763140779171639761318845018114444497145066290865154863264089416407701062170008204228155548893184) + (zL 21266621586830163124613438668312332202346214542127362089792828452774051739294989431846065516512923207369989445043437209508107670661872525411910510579726602764978881591646977010575876612346123389382922846092953363171994085098338383692787152544556450102952638399719974165323817710782415016841886800455854185022256215065331448074183403928963951728325990789866014722256820936729435054175311675477017489847133311659693257857857374232640089526703523395280145778608981379373785041346201936135785650617982693867679126923394121822033396485795406011858968676297475122480135465346518979833417491007185718809612885313165005960630486581279959948671762535823870043870640536383975431228028979062330933172159613990880380810806604833283084217508127527304949811074480073464934924049571881375422083275166467802818438759066346429265624789785763471958855052179476111983354730534034060098518588812156144346892356644833225479832112647885163452744201499382952754220611774156731497594365074475904704901477407389597550593013120514725841961825641141050492162342176523706764683253711136410717826945239949585599418017259282209096900513775972262448227826275703836435407147296364538833960774041997812324819630274318120476663734333312175679628259727161432470255101585392475683835334760318527679701928900851609391124224453332106723320417888045401679266832395437542513510519686453794170317925516756063493809986376648276746249574553137116667794390164333902223404000199207587035612402307022101038048199646655253032503358045301503125831141188213147003034491139068535268007816154967361968224968690878975574016))))) + (zN 384 (zN 192 (zN 64 (zL 441702242508899607130102767607309829385865069701388452158773043021345309879865141731890940750051583634420598987287897577373289872384986448557735684949812729848616300943787277761403034629542036472807047404033206111584297591148901674203396498156350291703346955053928476794099215205751986223631673853648597072785349853193728655592494632613398982852012654024987388488637667882191637971221858379019605132956109214965245987634303306702358273060926514899876043289359234568137145419564200662273243287824712118835133469829126822374876284881283511804341809093431937654001707949250602190601285106443877096741999561678172379276185613063652620910406599210047893674877201527295531649532884539953123275911757002281939947082723747918028830519820561130448202193831670838227394155529772974659780708981197209976124654303147967668949990094655870400641924809372967098248066524234055670271506667982960122603334603493453984766884362869484854364811929517785559947382656584168395315692576300257352850137255096812705782687730169921473477197788774025927806721262608730834500317607366028619980945194682493832173669399596959366622165571039535103514241306712305073267213980782081846207434219451286636746719862982260171730492787034161577961780342202997016867208823537239866230998236022859869365584826345733883408534810093735028144620529921834146910497434105967377373042124420610395439180123767757307293121618283532226392645690527714842872366003972441468704590690671902547577242141921424915814675534159927124406523081155118926870493444843140089185018209207220245010040711906653009488816889743740794148918209281757092416113869167) + (zN 64 (zL 478791743788272856583775519085786227273227785472519251113568473368405335035982166276278572571883136565517277953759200453381447975285826713355930835120411404363333127507899800432031903712078447999179365685623736628815792499351417184127693090359552840467502763501068886980501282825611542167047130008622669010389907433230332639588801369804851355711825346771594349524495580545958765964998632094909139702585865959011501798288030736403641344692628659751022374421286751248302071463139419860625958712295679368083767762335225558599615361414919498569118245194313368239117039832842445738270079803485885229556851570586438412876296949417251215426582011256114009892335464842051844304450542763617765479299547507140104539128616719303856870703756187760618551020147573899319635690778103996564464346197533084605889955768285799714440648631146208626490989109707993953342426492195645384721053115953055839682842133251947113523945389459886364423342803946083457587783944276965765797960253067050799850367003543149707111919553098088232223485814158701106896178171991503503020067575734211540041628183946811157734656914809750212949268083362882795865602789131020378476832311716429853904216646004387161367351848289477566724092498444742088992691172568647073152869261829965422505574970194279212742706460871874315152813183812440878503985804768331377536658375101913976814691686028280650907428125487485678565883831711691237412242623310176499741028285634175153925908177606924381797618317708023185855532173719354406825056405725247914241907254782629964176223362630434945405368236470286853459142136301982072763557091801956179216150036480) + (zL 520376942192418621122741937410138552177240527403231017316266793254353900267913686543871351424610652669887003949829878393853067816299275604569629002303568598482470228545044434514058145952603019363591928929224001286453150634200481245164006387123221810975768726407662946360975861686865187408249712672078590061798427930490293963238219776789723826105994050138679396755448995844181247254478596063081116032835242633585192084704674074574825784043903891458155823012613548794001413714752034776542070004835197124600574594378766690433979173758399212785633431118753818423237889855346113230904710325525941070389097358490505654698697108710562370188924629562155665755066083071970326540345222330525403366024893689661730976380431949625016279743290823571521528106064655101114296348031603147654510118556522927659801858594994044025316194979671651945879678408059233505177087320620461363226045645318745283880896677176897756791922572032130846193122596516572192144130009035414941958306645237395730987555868534864587086156040169790740005768815605243550455441558299749979008566693037223569488332912609699830096359336349901733738850909899446276183321771185015941624936201478923659062099207527868566764530192642601508612266247642698961326410849010214137824588439867687589340281023243153172763635368174426369234703983161051296300255301150063284710233921411885447441132222656575796755952133867662078045511022402590309903373363645879025035911286472727336648472936687592969650662543245774487419948241686856519981156140944740370512298280905551292100067081196475091558465866367246382966363924969636431375660302734264845777137303552))) + (zN 64 (zL 28936550683719730153156117296315560839875895913705630447531631723893259835271723083568759422827287392330688343840456178348783499667259373106033866828752807973326333557649727427458540667278464746446754492248810842915839949982562579232610977042750199335441416697629639478297599359896612176081718141711209371647948385372901208539721311067978184801281372323391565305376542265684907340681643867003585974453075591135482935481525182595058962145780572083543225940434868408663179957815073755465794308007605338516381880937250125750057538366567053364141377959559121929582841717777229168289676188077739730662963141347291588644649881433335293046708786498630532567520374318061953793408178154824390219147162856491534748944400384705292068573297034128383049931701141707795389062172929898719471843792136833956973089041898913481649535704895698072026061304235011034559105648689454620081153065340199985401018714667020301953676340228094884030722517997425531936659806860889747704804704716737158072057309730007379726671310790718472877717782245998113320665900029075232115835735387289287757976607837616702483964902180490064888594143476003721454799019406104908805527641177327969437987793141326109918022798314331821451911274650140031105451543235383593910612711611894755828539185628437042879644739358465101488664614102775917296342716144001280901693869228403845077071639093127415715242685224113679240405360126077303625900901031724100422688516586759584335957702159256685323234290727014280373516626815449284506039384250268553888082519434531762581458362276493096739887677570482295688851133449437431463936) + (zN 64 (zL 588936323345199476173470356809746439181153426261970466187830353132355635850694247955790204186013542879309581109692934110641343296396318493292595702821975239132811536495936178141367581684526034230463843680573136132757658932297564161282061609020583124752854971589289661219611764608347264863888781933083076096767997769766701142093228484808930067531209896847884481590629205852741472331565193123742899346513591146418472765555769724191136583610406306715075816311218946863147576869280862027957363117309008225118506668134037952999360674328854934015959241126914875186977752369487869055608969989761090334237166676092607658832388850413928573295674199662806667128144001500474232810274248596548514276576613271916087696197618230565645256154671522807279070367516081704036025431415898326968321575774098706632820370980923729614665113256725845809802253976906003751696715312200113350991782954860634941694780476314200411249647942555974166090107839076640377017050354367518172922507329797862248643164071046284165477321889788081938256488789780635817773522125265150338146212535040537092804135976489773836052750809813584187165880244282842113122795156597782579834494764977473990096675677293639294731495801230037505345121762165247805248876878844473735173682541792757209631383195739010775853890162620617008922280010243273397502336819085817333641558631811793005311516583756011733677774712795831778720465976600505715979466463944934749495409630936921377783978469813015917092209577867479101547803036921856355239135813559574124386704250492207742667507517811531020810933045179973459647915410247330055858844655317513398318757052915) + (zL 627149748905765854398466524999691818822678648576680146755627344312870486674224346690393351181613734555020855369371116006797197885432445361004438473524498200092816282431295552885567960682161108383184485543755929806692116408344582449042847582742095039166295959731435209376955898982336902721995714243303328641585695211114636280367716491223630544100897820613940890232001757588562143989835623609824579381482955596800720492687255057430997566958473540556249229819763534380843273313983057676188008963212070559141569795689765397256554073765793934016763909433739900814627065648664673827175199698304272775902637591710109551539557223367502794943557396006897680829302527414786320431433621087787993651642323701959982405820740520013870151606865683591796591481784399424576746594085141827336740701974902469175213491907920762818848737565929035948484850016369603146957194223485440038822504534342301847568699063527057979045876193075082321173482643049827129710354903497453018302594527392898863038066839561779075961086591953409811439822940004394872229793445516119188120584977973710017525640156169408828138048095134409978522256837535387680704926479148988780098419211906678063520531118203089951870232108681396174937747888655821369154438499313112773950092918471985184310299424246997321844320883491326247477742043099748507143717419190039298389905273257941447725068206949320362259189276892703493233470336735291878507933225609635627955979862622342544006602252839806841088925150040626437824661327616916167534713303812577570620795357354383488452299401471702153006249398660644284567452072186324801491579157190270473065268772864)))) + (zN 192 (zN 64 (zL 661991401622752846309492443055230253201716351275382833176778774799537155564997768449440313430584023838020679286342817528849573102563525990326459784305042958103317727590560670227641048940891757495686833772675612718730627250829599100850977123498619404722923375046990082892348024863136002111025884298793218589167876396175106898646627096518352148794607606747061999860393501667347684694492298416587273848066051850786672762586720831431430489273007622398889495647485880982106687236215778004946932162675266348512517436220336778848288067477259027826271103082611459044398164244109602064387476059033015905390325550108789822311617551111666545224209661598986502989037732364486025827818723967302412515253156930275979639723437606657639406134328020626897922481376916139844181294009599162994975350636654229361436931876132162288926048274496679512310131863495259454627822292818952675804991410435571233725931291082501683307069649313095547678141517294103446135629107531671669634590757481681480315458610923230529704399939716793095297214854865293336206071184114603290985697060092651185877849689808509784181055402545346823008841069345512103179800414820515235625978151817899124802458646731958313907831832388325044328107313391247172220619998432578776860136487808436361681088898445279366342447491559592049117226750107894130698855691634669719302066290901153029925094628862839363083655203902529310624352892915676470248978810009143764826650777912016308259673587827895763278711570182623333509930275628877895812893429424634298871460918100158422090281385377042462097129608960194160982557680065440341516359312717631427972245226031) + (zN 64 (zL 2951598246752459895326076090491112309620883328078041482368059301593800814501543995137925337559319079997292896759809381498813779842088014182402104466756682072312332241437202142407095885319345439047153951326850179132015676849898193441679007483017383370170553525197762249223208028562045546213824871235481683384830933248147969641569149631225127413725369704978039751005633012648355268258656430261937878973863441101699733803651117744728704739637624111122177146424332936300934922359376093022597101708065771765971552366833974758789778542551378420146166320221416322332409725048414680707793663246949336255772586178139733505342849372494842980039971698708493472121082329803222608112166943422959619566351140062555493116240709749628662134070012719493467711240133766207505851837474251326489900522925289011636071966678022467050468664410855437634715974383479759157938992792247088774892290603551226538670288770471022731948378299274695942814778192302195393604704811697265021497323414982327320175302265830105668397192613246813202913782140326780262253050264856957167476626347505742457683809712181965515333018185237814757512812220003673674657384130025291117022329918407161392333309737276270799545870787418923005865821346369163373635800461086290412787458467174960101349873049623204027335217028620727015625822076700832829827423556652151577814232439393314471662444877175620395221012297699749445369705993920898230461173858633138661589541449116820188310992663839540458823274415043700560444784335856427825301239091137591898546317691120795052450499124149352677002866976024036582141355041697331679964393420900672558019307930387022) + (zL 3098952587486847429147975285281676100463866941313944562209596999512693151635840536862564504901205689527137075991523298655534115675534564235066986120502353413297308688777733219766471488641328668080592499916516311867967852143245965382785258066637538491960335941853635682322033466395913686381652556283773762055202343476887446665050382832622180102730011667225376519828107716656176760168531529638323416625936084186708581614852021178663134824224212240433325495124980523108084654878737485761667839902761075276339611713605044654375258543793649747406904844142075957789679837179752520777360225376161117884688481078673873681622639332839824811206678430670326331162863500650204941763073311811191291601636845138376073122277007923177243368217361656117772045251611678871176773797772772944020119772467852615810624480865909171445195293228136746054558808286160876046754803563276554715859527503308126119907973408907514232768884154947551091253988806897274653406747029064834673261204115997265740442349958228016077957115776954176644823935383079660220121689415970929659775668105833553037919325297676906692474765550926489777451163832439974904964608732017864935478318776172262451656258862074845236580026452061508934672970794483053967965554661810904137144397930703403667053233652919414159428700639862345635824440092397893304185615022981999325981858005925970529901853901208716153353179346941467377937098692831453501896985369188114889822031244061702338052939129344343908560825682224192453948790616274773810462905732604809111786187338791251508659011907775063240875807489960223399085857907427136643808434429015772199636896267108971))) + (zN 128 (zN 64 (zL 766516359773713822042570197221845556338829459371495912099428055031043022678438510633153086270469528663824043905843557642032743520760954697717859932248075431924383395546210723107605669614533385089574402773016752058302731936005377047224803481979929710812973871399091651655867921277240411454735620074772719817695929988099477653159274793456446642465919102351214971710000443056098879293735362387529272008235405999862355451075368998672961498623788156089584836860160006915947131518460358184221591834250393947598532676215538501093848585994014135241771981339553844535541510272051787866733596177211411515523257602989249727633154773532928452473272596590909281375021757647735752921972377646108414330715240857376748184977816973887676196720394858136943488566316923892295084140826180523350449840224161562972292388196992889691758412910570862427866460582682113453429750286385400445260221734003602865241527229696711565439640921502195648313592782513439825085557068260516158200474363056420098986547526923695349494291506017922339850208055193333966253728826218331447236645816425570190809711526550838966482119240331257417210513028702600484411884018447997860240922272803372541242257511446650922710865410854484503878053461044261474105471201130401920205838954687181066806848199298544717540995599372083150629643667620296589423226920481762776738358159846808655931220058524496387126240019333856340863766752758310696471379837417315872361977879831190325373605518807800852575985250043731952289178863308958404090596057009432634934088055172451337155724935997850706723613925493840961541537447826213345747768444388266190433492664974) + (zL 801358012490700813953596115277383990717867162070200271740311148441544977789207857660352499153991808794195075558948919873265004418309014170584902523292501232563966676645130482037605946586662072492872226149104469080569257107399051173875856947147056333296650476590666486866413430711505301105063263060978734357454779727772140358921022423792419150049941230565908318235234328699849516087395696158871692462601473587305752189288713715926098214084242224176135150486376358390473316547664859656463619746756928794002415570990553426121120796839353055422859571485991135646512598673528497761334731720470949135894689759964359185516474577550250484339149556872483320144192791762559118749642324542884614406656418791135148186843881468496003938578057576677773729219264511256545225276945254807967955321437538364901108869155591088302439703438193558276060917982498441370462295457482694085548840694032982980414284290245808343850736208742336137417823271718742766131057655377970309947316658665061169538154799718171858873382107793642779107504578530250909388279616769821584149323957800755500624317262622815784053839438963009161458543250343128081705498944887522164082146297917119604211731726908980298610153675714689248373319470641931118193272809550535504631480991679939664125738393992174205361931413847645395712051042620453455711688290043769302116090276049285146821375234074269980430455561313009753993330136848805802303134982152164099163566362939663478266953811960664588459488593603999684765175848260091843009161499604485067441600311884699728677999652154892580898492668051513018173814834752852464820420264878355514774377906859)) + (zN 64 (zL 842943210894846578492562533601736315621879904000911926795558711544402150549657642344253715861782841396080171589742664378362660510300857691688684719105706795166391337078184772592229717676017752685501799795230024381734338701928772355307575645095614270210772050484913599174632399504334146927256780119104645385550003415995372547437530615955812094956447357473064960597301997010951085347904088646668784083405236223843749295759152729481725598887390959244939857915524141005317781130541333087649890741100012572297507403968050424042782291290789125833238221243804264312654785855035758002386668887594041503372224343227032804573043003375347764945573631054443056808598926527637838778726862934761538868797750808255364462288357468912776762628924194099888614030057182294375848064809611641582353471814824902468802757672116138033322577637520241049382746069048819315940683277263232742926088433753377758693190959737130388007571680295978922264792113972926567878728351695788380639178061406107352457563082917137274341648594222674844255445589236147409358279490402263700214544895699629068890403331033161934474291313607215366737098870852603924866254981111348339928544346294441904365067171494177349763180409389648982832779320586940441103705006827263557388911157573346177868958305276008884489942995836548993905367244852320120314742182230142775499232818035000626026590680148518455903039621965177102080989719811190186905957926971640997168369887900048740733352863672180476082784941092029109305641193847663163004560710538655015892509096884339138573086528447103472331190546695712899019387071007440267272104384926895504572125544448) + (zL 45729046964030979177778846361534634262587545353496223133527368321557565012695633829858186601384199651017717372571300403480184488736294908622528711809110354030623609185664095225140895244321246313844039214686468161741345364874002965238026922710688821511964818188610203016718549580933122604840869114471393898656310383371964430694583402455629331866847430930874983956486882647116535839880619372331918673597362427193288041289672147320273486402407843064591950941713587142532453036272402177989863853030623552555178134784027540728384090186379020477350962450079529194315552523950350387587402869503911404861250206496049404219886835571773410101732351054190177821080274617879256755083467128217800950194914496219804669699034285112781706592283922900952598728306747413319494560003383087518247165440230667733960636100049082443187501168134333863376904279035319995482937065000748837956068454220916791324456003438344686959610057205328839031893831107980025665153741628953764191471788170107199877725459141057390074614602463702672765716501680098024340747428063792577868272678617307335995211323219589562793807154342292384271981924660937288541526354971160078485696046600426413761365625936139026783408356581732694773775241086028094099182224565673827750754847988968177885210188785584669029477943718571800152203379570500351560141208556656407517618345560029446493939150257126861845435367620310086163413698935367818394278331255846430967679964546995979589119184833207989835900823008374684302050331621519336781290078281963856661805222469880099373903834210912518944608994670877664557426820722337895154415)))))) + (zN 832 (zN 384 (zN 192 (zN 64 (zL 15522495349848920713135250030129444249173100252796413880526369012296143742846269382105519309512056238838708694764774629976860466615056514495458233030632477213313739138035377342933648894506493338539318876205088892197596389471720592211708117151249545401497377328728319707381523757187727191075564138203106710662281541868294845356203299928501926444793128459957433321161873052410966599297261942822941159319143518549293774256985051834991772197521583867341086906499552765033512101741155886855066629625667657360127830897821665272511190587870582802581157115045688674277063396698996163705800743567829466768095042625353213855524000413093204667587475364512615606443699517790118544157262427419351408429899804721819009856045703290651235880130629331342329433500192512032334044541321753481696194990834448681619892645975663854296835015429226285699041486177279744623819837642100326776276959065433619255566875438540173509071419947164866141400315262207530850088408636516483554105692482359249505400050692046991736233812605138550685288254200434056849070645222349023627638619877589165460244731920041461308447174321160361976455371751520978421812361615382408538444338812328079615360654491838096905864140199429811646203168342372481200850120409633667839564607875265257910848595081783644823977851529601723247043132532916436120668715246472277294380326452323978232273029621439181536602956130479064348753770277787266447377225600561115166578258171173385131829275499582512485321169975190434963118675671073091511506850615206965472487592983221394854960554104017811039063298414165348571798437855535412814443568311743163359467622825249996800) + (zN 64 (zL 49215378371708055099845848625667184662956766005589698342337323700184026397936673568816574438366785781079455836333212744275201887362430323146633316863006359874170889653226902466024307128827792768273273544536142803156940010284778292583869699042157440108595873075278824201158621408606859661606748453057816070270620121051953402478204319646240906972419682857623146050077509162020698570422949104252559575501368210421302759411666209788568907953064021629206232577643990020382750537304857541631673741826994425529299791974934086061943386079978302026511516978559654249412669548388642197984396941816263555433226035879392550701873057341055787892506117162845651358433972883143832146637091706845322941840737371865977812424925472514534551127734340276556351409398349466428840704755825366747830915847468255959688339900113365055590441474676127631946312416960975277999081463685810436506883546188693221580988207359460388826679199350488144568103383082330901151901409865520375914812801748630765577505375127385083293681048650070982798521376721124593602450983297696818781053443336555205729416902459662261767576339556986707823072079671821682964850192749723691319742229257689678676537119224724791947184271342341788012267542343307199448481307924774038352785741998872475063432469856148853532138266185631820420919206625523786954222582636768919975254610106090302445915756004993126417390223612280042392535439950079690623288587468561187157565068042203233170369678922372419384635698460743509615615286330325433821088482908984704582737156812864213407918478949416366544455563451970538016607471898708429243180) + (zL 984557670325180803679313039246828016646355727873067758984223715224536533802716872233488045105055629726770702230294472702360608203827772687576584219780431332839324896878577782510729444475215126755548378107731761453285827531030128043975683196711294357621768056900664481754485497575150414521617342808430599586828417210527162610741109748711443433817271168871538558625783720896159908428916940475507314345505882816875077421112233654101893910023941008856306568361884000110035699730707122887232040905176827313710900468305716641640745604917446273996907623268369770735836463337170171077129852497023278775579883034386018019632885811908189318859025576906723147185735531398259923637067140492297948168626604457881393336512118271562713091966581516972410649448665154628219950585538827628568881879885200354841977531182470990807404363167974246295326638733203808357971355627374346150633003023285607929091824570655513274352493705088225767219807290018724724567031032332074410017345312429858299677346442448328169727864492767479937393905606341996076256821489989781268090037320932252636548891711006439425213352219275076015076373926097617087786089188193576186163531795689590566457254971683966083704494373965895550430398554532874393823749404710797899774285557372116961106787602009144414557000844840071670904762062989141643279744572438679923125355529711643614265582503112820240500125588587335763835797197549839277921330342067806142378239527076964667779362540391547264716815562280334451825584440577543797048068154373014179541479146161338808982501693007162687234139297198274613907545137739242375081145687973287473942225748816))) + (zN 64 (zL 1013779701636202151733721873745021542254580897889642022316149637497770284689825071023908372453783287666873651072118377576835699508678807406932954803959744539654895769639436531472669647339418502808694235633050682733773726762962323521759438817996261524321614253937309799635618277106128840388292142334598835402341998740341091403354417651434052846359188387275463929242948677508721619709988424773543169101014269013969763640530977760501624393107238034066248195609427571972535864441270737012407152323316105343651094811020240311494273508034047645742594071352037736562939400685742175232395055800041763222340185493134938161806544150728182122336134289023622071466055680775009428681859271849769856825164561590513536267878660179918827829263516844775850497487789910260628057242061237240459055839401578866618076232439190882191164533666365072732854377454835836802010638673820746084427309520670736625519332281565041347178371444944489671746451179576148764787812529073602237758741236651409101477667127785635826445392199677412235818865668301060649868313503065411923214304554597087008835501614818711161765012229491796787768440051811783743886558832129148136171147662840312022172508298456804282895255360200307904437385533793810265791241214898564051823771682317995330317164247357542141564233518136118269560027530042083627880927751906446828685004601577236060817374545053407996470154791378448494310480792613697427754907477673766027983220199242873384648399359529078801002523312910960993869875948449271970589912049353072535496998805050647002637200469277055728048242667443210358860420112968685784295607855124753895378816861037) + (zN 64 (zL 1055364900040347916272688292069373867158593639809144544078145137906930502037006353674404581740659464848423645463981359686679389038057369763474396978371834091982377368127771322752401437224522175865582864930154281052760505514539946897797343469597044811342839637250814497089900991635296723387824663451852379663069718018162809472877013717492186578604081026365081618532732414342378251261304330178508985825379024524124612360678624019875809340957495008341168372546025343276440673436280455494890462012905478865248624069778526471774070918807481014584304984623635103960974038620252808812192632354673122658448788212013508175939250387489498481142325400069032734991178348653513377589272203284768943647607777681767301072953044709495519617320535641143323938944391912416663560913526426992102527228225235764375808964268332085421090522169256772948081885193141571575809097329033459749404146643329396084701214062415516475566058048652138563626709682146409824614241293830516024381059156418762710938077543570392945165840892429544641624935397002681807843871073834358820032104399402630967874849824335404675275426766095403769357809090614584748302881054317142527740341773806238619501209200456470164600490419944106068680176623562892927266892054561132382660096916761161791736653217516098963606942619438803020544419140125356779360742495822392909238522185689625409004812196877226282959956878539183971798995291452860931005931497850059744968949604878003556810622904031106066756535766980494593881336276427200187420111556291990857240520969798612583753235324861396085773210169425153655209706590425478341681477359117449546718865522688) + (zL 1089082628476141779412390793413443319783468835969178209419861855315367578510157719257074430970059525764970730970484954761388991817426855979279068722152699850706327095408262696642800350218167411084941193496820697966390093946278915920584112472771018734518249726245350757354224249542687520489289055312314831834948654048990412844068562732859440945571265853373784772672728424413024539527535325171825020734889352014476078935362596735726284082582743971379728156381609152414788785495445559959235038497646728372445464631233714307740617588435194885416470390647161428602321195057271462791387366790333501046570597781863078786290683147437131662876134479653586015154341269670119711457189521048472631694542902400559892125176608452372591231259157641403675307024782264239908662725463748993175672053430522839456435541725691948238577831201824000379919748126258186160361214083575653351583044701017265061848385116814299312132085764370720644220343729846642967192079784801981067239345597091649987532750010062855023245894377768412471334445259053283329674095566802045612584442671115563294037315963816011097608154429936744488109335074449545530490375908590492042672453387187713378800380932055616889437152581893486573816625522863044072010963465477231830586225914666808352781286646041153050493956162766462620164247209942193430382543106334432585872708376292615774354044301857136323178329767544811213140424481023859477170843756698412173817433006806937328697095246333626381972212627558121315003933618904986496820647088404870535791444218100395470470102968478379711385523716231976459340747899948731632772956354851707196532487880704)))) + (zN 192 (zN 64 (zL 57931206890900744905013351294029345697502546638482959103785001446848646413388596568538210796328624210345487430677332006546658085799320993015242447688020563324411385494809138688479607224525078467994633971688767740920642170539120561668099860739010392712420940415266869897695906144166384244545512211292705412446905094193977312371358856019989486104843148776467757014660376477743711529348542079341779591606354315327331809172462261848709754439038713373489382680433394220715584236110604473024365063068372013154131748317966614468521949049060984392851869441090180564831873547945055445842078116996639685359891940281096750513818537779302424448751018974673423382523122666962905778938995707756493050513439569372041555935662012649787678005621277860126194657236134549848529743006268148059086925681272953918718285644640437535996587795111193566135471360341500301662552826620680191489239749540566413716572679906447133099590575193471353716030336545960859672994467957632164243544621469171492638463222560006173571801322931681395060494901805921562509381436512384687108390342865110443842681734717492828076035461876521850428609222775141377708233958027488150506519547341840998487462209525853095100891890737006810125032504760804715997237247450624875410810104707881890850024759934178917469893013593814628636626856053065388413977227255497307686523888027646446896909365804071190754190270665017972665404389730306685187099118656872735464759131547471584695242073847924058134321283540386198922068895993403100066245017178551622986557436801207099726824912609979484887583804831190490453678054636139956929482) + (zN 64 (zL 60139216782429559655655789050278524095191591849019393974578637491787418581378421472797096587222246355381696887072739385809236782468526093081732253456947839135030817432325670043340211855291199681358301674912348510922995680696819854181071793721888073983638371913182740889615392119479527050948704093376607389936773324635804943382281381521277303315895307100538458965571712052214658656961725477802777365702689634480985354101250175000081409318845254451997790269337402867036191164403312239666729710211716401124562900845890331208773136920426541763789894519876851745125590239327493205463169329127248930889368299937212429680194620057064921642826846459545320072609765917105492007806254830240205656811160801513110983764943093144409589310353829235798047171195872185910493187069049857336753940623611520784470427192383612904818148668596408553346988091420293984603103203325918051443766515737257599229405869518482942665297666267268817624949609853222004204506486953376484372964011653636308104584299955972729229760306846070467048612372673729113900797735236895747170875038757257270055340155547852053986348983483151672778114655925726894592106929442211386690796966814702926679775828322354459105060785332108547390883314907787414875834797361520919300002841234866793297763208734355122038864186262794547897702358200487444048214224341834817919265105545181091418501741187219689385074354067354648762540925743496154521241844839016928962226095091644108706345474804675217098841767094436831600584124812719497610309597230563571619166176232462188639283197557088787819298293515191669285741564319343856059366) + (zL 1204846829439034042858702714694748440462207009451973331301220220566318122598894655272628170919504093414783304804074280170804864658926042489681579916305234580106226723996392827866152518845318075091412673655886640252140359291496303847008487064881756549065612083443770380787072311476372722589950292365856132421118555969855410664886494991594373378312550152566308840021946841244273711638398710326431913457316634397025443322766609345031547011984069401908960888597153136512028070450614637785315925099480473304413497082009733340320052446325013711528765752068426917671746246185329421293313331531504574659360927238746516212186044777546392655123742177840938113370598127767460481299510394187280409978885554317215333748726774463648505317077079203618881657383121648362494250827268372912906189106433215383746882115853586833115331104831466448994373907130056146054017332106399718742301498048379437978734937729342626251229115151211043716018274089105270987269088456216906383388162504415849981319285563236335398204650919956225918400620543010927763390434581895928063716758268651275274520978759376659217625701536351796568160479649871610355890038732778223882227436340200749600763666856585653333540735319404725806269976283728470259855007221024490509039998397772404757393520189469169676983581204969252956539923119199034065601520002885144917373657125462705374670096673767142461418905257688739854360816475215053358174037659075827010531043755778604273055263380698710772499928389951209989860011507890101879679375062508072298041659802844863758383293562559391739702442541922252238898040930586620217269530439974757025614181433344))) + (zN 128 (zN 64 (zL 64148497901258196966032841657034942211204927798723417153406632571967369331358839543406786488569504461506467618546000961580371149297849630783163416268952778653706527368442276941707731560880621477615179655200485909845055425932446128320352274278295700395323142218989704353418238222209041118166271105718143432595886845259134375972715876744032638738620285290233199102271569813985854280851044402890774674125926845641146799727568923788484499840593193617159253493110555391964286821963168006823530498587333831573124007540022602479860799596578364165317872100630355052574007683388578030888453948174419208379067423370627549451252709120935403589028637465043060658789786683981376497336298227152824501450750484674882937915339370781759533057286834632391539416484503959849127471877444843358281081112921424057568787401803115580220886781726078710816021603657061940786857766466463258516427562115842177243130904518812497640526257314880478721222341520176504734878051852424115692304789365592877171595979103921231483034132429191166328631344197509415177261779587279028157624492979673230186980921733411995477593697374972880834887256161154381485248225182685300035574015709645800129496441511078971682207030188446985283381753185137052612567965119274148896889565073773481443815668404615708035749277321811492086486522492520004498609408096749346295807820910644456359278507672026468850326218732268182124011224109770245341494513052519083167298666859312358751925739323480286847922368923308640236769968892340380129982723625690702782614407091991744147089333984006873314085947751099593711373170569645674987520) + (zL 65717347034712881130977105734601883181183727551759966506346888931112934743602703225781688087976252513805304072175311855452957985856943638032444150857443807486719814714042038157033472779058036360221399946041223351435894510718692200069586980266334348251374195674788567066410664602595362969678360358543103455358189449643828369391300522045086165752549229397704926860763607257527390760606807826462166152821144142224963961934193726623829940909411699144406474638076512304403416640478204373435611254077447417756870100120181503992164689634335652543637340671979173006819187476698463942451063643879945611352360889957888486172540123920341566265286759333343925539715710605058686430034905279311325612706960473456227160016606089804670223073244343972268598752810762638199005287962897909695994065525468331977508453783777869327340092359387817701265459570895917181693212687517083111158739880439996286672633162981205852589885561846008168072482970726225910933000338987429951201582709811958200834774039147669074575378493672605640603900270886481205652244471307746527790275620469207463389248661544888047102153429491919501462763748685121067910616545254310639504582631845658975334916736883209076568595224648835370356550739644967266574354355433176214028077427848020715930271396827154609157629164346509843188975826294676800698052693932941004923318698361368382440037448175044360344675083341899122485892219182170215480811974878279129257325507705452933061242503867561558774794016679471002656953120801010920171608271269730384282906068070252420708916895148455328538354454754542733823764304105760960283729)) + (zN 64 (zL 1310495711871188147363103885572832725353482624086754575167534871087376639674612571628134149626433458643566105297460648376994579376449232725444575832459910842690291913927872252933183587194290441071906127088693253244584387647043242608299183617782279178246050049699580386137155181509335136318649064262626130875441227552814783525899969011744221780384168738209979171421295510790941059387049346672840776024793582656034297165642942297801506100497165279401999911607388895424142476981676025351066983903684350811185190313917971990666335950369264533511891201509873804534992615389075571898946015014466108860735868119618286667410560713409766579477668682907744013600047089845591597112266424203212651639319834237039659729630525870944273415664643922960008929677742561459568556091770593733781865492782701102604169350222494485208791576029219587004039036618886656858928552961038882908659678135517160895689906107318948429615506251301579007421059104953320921935800030411282003766550042421878453646849752122925640001300958602734638073524370923203566198190548013438974158653533766213587459272382787660029032764757557116948011217956125058718652654172487564321270695194717134694969439161442606697556433629122296164424194223530055598661551237562213455706311356256201872135890653541789783088166409626255561593879806901560399127801589259553647434474401929476127008137131611540752996380824189394863382595703225569563880495044017383454610080463723358099723967486680705114545987037075606868722331147815259781922097530029499981196031010246968562951175831288711296553799598799814743146684873316679467667517337038013204222934253568) + (zL 69319889489312526250432224768081253176650489609504586201718257539324172126853996496581462086101264973390906983054993861924585551827819787302054012839365287416365022925404768161254667029893717867143918658227449248561130149343253801882499662812152094092667080776893892318861969366648785376150881427444330388539483584747079892720046271586546289630097798188968356101048405628883510919547388936550583694290386191948768231586448743624939141020899430462463854273306782006634222788137710640149119118787090292141508904529877097173508397956951030218971992076285074700292999580659201256781427058998938423917296852092564328010351031918067170418866744108474964566129025754840420247215869161764445238620306916707842810109530312916994101671029550304292574181641981465889435138957126608044552571541708184204679238906661813411227793044549553548132244440234333629391279343887675844374821301019429713969503542229514238377236677699567447659807560981229430235932313908671714010781922186197134666852471151448182242610643737818638268151990951700265217583997387261805178962002052540358372332300480793733720068579901815130133455732614138342929883307182340595453395686171803046428249024936380592352116710749070386716076324526652748216394489553178087010659842122488436578418272849025143706139979972295078209499767913219017380744581096656106806940919393499530462086837281025292770114833280161190685839121281742065539963499271670543810194442045320841543937858299297739997281829527398437369073064213313272007095938956465166796523688599511034013454785387438252713264350578633727746705082372829481010320))))) + (zN 384 (zN 192 (zN 64 (zL 1377931168742775873642508888260971630603233016406827709550288903334860799510177199089095412630856508386382588977646817904772431239307535774524785574943965633592528910676954009413640849094227155517143534261747241258624293303388383387222708726339372472241192211192765089342734001005986189515874397414337345136208011523379999772634188796570968462528079447667558136823538467662852644261092372553095240455489365055697524837417721267123535891191095898732143282716428559786287689320203281269933728140763869591596437523915161880011631586111010953897465839312301018925731676442446347544908792517058597911203381936424240145620078204630357907981440261101481381803216508474867667321339777039369206591820244041920728093264545501411261086315051782445418350603346740328993830264730922442433842928936421157824207703324624299233540440335194282709974420506954399706789151685976994245892966025875767125528946377060504144591566089859775834160136402870312265995191710420661497233873311648039180435971246268434260604531344987781052588332409278183138067308862662628688325080101065869230143300157566395574215624652755347479224759298414093365773606935284815726765906367571064833505239698555170599512441532423347366410293420836851402358532071299721743733844069128695086845496716691829816641642984670111054245658967081040272766358637206889443002309566228694016082063425236131843971152561370798903640398673699142649955893716812471655073898363954659854657166470371535260575456202933778095786164644490692304103569147250641672556379849353059033044209345112471669236680116165222386486627356388004058828806240982402063611329511424) + (zN 64 (zL 1412772821459762865553534806316510064982270719105532162314711819996060948758552256610592065183141673926555608164987206675823463777657950483254527135527986023694252879821497016867896254886349690620225717472602172936019717762786898242310240437653464973395188717688391706515685363808165460377756746986391930141263431568587555571956284003473447666658172482931331389335277065838458494466974148215860810413087012554815150299891971363969739517604192411186860820761184481519905701194085512315850665650035877476424094225276288921019781875858112711412512372969674718396133973914084484820331396976074464723343471029727036712294528533850737101212579733229182514383487735855003002132478247303112290718041988716263808172860317277733632941151011174820141323911807683274394704359798674909135765990126910699426742589752626168331636879037103771702161674428408375246960411531825868385757095968083782996901033338917191895142438612351723069646443875141574799903727439824889853936516917189465959591082061756304475520885361514441667822045298140676620214693977212343653363636148844870783380623187246874332910120232447391063820655598753246081240740714994300782454518692298783343288727061067389520632944198344263244351832643462237588760316066308800614440906003549879895389065587811759323491964542430643931166251687885039574538529261245936383017250618999368308895317596505821338586847246193651004334501191101559308575632392229773069748985639628588207622865498943354362104236080330159893504904896063969763387500115680769383482940045096425769443645130567218333682986086764430356559082324115621204983105599064041233504383533056) + (zL 74549386600828140133532727893921414774218422604988602381717794514514459170935665396685020858486722414652324424090937503873586323500185826342979509215971423427416789046562148892867633737820132187169030326798387012056435974110399050386819902708939753331598393229679598326171612874096834574978407155943189997236081583046828739947200369184799999933154726548698264400913783563759239237287962596473226161332670259276777067508046238438800765568544254901092232138590128202693419644388628527309619251699549050312334992749503713845459983544362498899949404421834482601682661858662960330254024255152718282540510103052178454205128486551049938455159988492581499516082608929289442816963840701282371731757542047113503489849367147820150823587039106883579906070484507810369158043991677257098119255864822484673022075788035819524619155269181654185149173479841273215560558952485257089783758592361127008848671551921998918616695803978801880090323641968473181439514038439463049674048478041744920485221916246593606789298243615243291291272117758289044809168327307436251524568641047404086575617889958434685826546579794424326101097587860284974478759841782613420677675926610668148741337313610680802019102909799780465933923772031096110510766963741055964864927140569460763949202724474876023497655977927267288580047655502964028352224885428157920972761481133915907793278280285821258444896220483278977366208142072409125988662801191512012370465298380941731236986276547585672300709609646361622185061571008911900509012081259403858550730339132695653688121360339306791803082628420722397088294461141667444425962))) + (zN 64 (zL 1482456126893736849375586642427586933740346124502941067843557653318461247255302371653585370287712106327737962129194751827466759273259066168864916329567962062427912349836822995979313912382036346064596094781165259311793111808005855197787903198736752588138482747835128074396334743107064429513133994583757844787356773771070701937322601202447473785393053773189689867048767797619088016855896259822282334844663267909081985470061716375781612896088582074982027609061998861884095338048658321012244712020476613867064612724246787966109800439039834569762697382039943441538686818078904768077337250655295087348731959573388296375933918737758070563144524417733929391700280197781846729308786554388087656366294984789274381363822737474866920316906029910579088730753618450977951569622299946121068481597034023627938038592264794011267046964527635650909774505289401909399413007246056979602965280754659507384019058525915808196775674948215755735709024022639815994955312647922622872051152351566661183113118094867428992973652320032455643049933944700885791850437516128269314363552524866788524171134905231420759651233564500725578464642088948716154221846606944976180790309713790274662785342210256503906446658205920441428917996611054303388877089121194048073071695155553275515580423242337396165127568273586521945726492906510432559060754578513356291909631790696569240723770621535501758773821458851230757384344853563262991708397068172021232252273715687321307928852926272598446783834501825485737129114373368032445446830547881534578754063304892573693263823089338786754387069339721574048996045098551287454868823622391695828483615753476) + (zN 64 (zL 1521793476735496356371906227329001295136033853356317062900164172129493673826048404339146107040292189129168784017369717446831805068812328633526522703930379065104444266609198091985986516452891096106753323077889800598603850008893234666457769839594287952026214910883822296013560888826719727680127501858716698891614864054654520499262550785894925210912700651662229419499860447582134405815793370879983430374959509502247919998028351096240365578432491629956916036327633919719128693016742160406680890859000583026831395942701003245621367881507281299528301623992657918701593550436134310684385128125796349701904369692302395267216228859214226531567449274129431628069359705209281928623071703943212365591344087022999947985142801668500747567230917609894539261708695583322692780738855890196194264124157340616570201949689507753974142444793728889469712736755113492135594168613394558744388152779065721923605175322325783737140092385563126396567926154850985204083433004553545847814118464083601625866284474723661099028121820494607189510342506997691862786682305264842714261598147656818353529442000482674172581961747688258361456902288174781694839178239825456471159521318471526993149043008509612868508491501674352879077950097240616703769719431135293491244981711824653316115808520708716910453647914870402037097766711403229181194476968865665345240391505037673399446283249155705213110349154155186184141641624096364353786969847191208866570850829758997935027569681581446934228612933067446018410942937181574510681767950702300036864053715973101244525563281698320642345424023059832778721948895770401379412495730945112254638909816832) + (zL 7371913769985351833927081377528814720019230037671906979780998867181698417634809922941429917523101414963772959053878270695608820366155391156313914584284783900458122937190789273776362981301848766048097261471186977113352251869215139765646026952180497733218650577730205402233632044178704540762046903757422854666609774545997509741777633689284222448183023145582501154157245069926145729609848657560547030884535963822309749015766734604619932076842858821131831681537528741223261477103199729196855769972683122432023784996977457475509537774629120878192928986040187886477192487603486770138494465081784580801155364969844305109244278824704961895526572230994917383066820738786262209663122820723996157909984175074045451436228732227749014056556769666931711499607723190432134008554045224468914339735425784037924173686645790801003369033132316954766844962174262284531556292465016591955840290341235606815145561976605381912992459543145399119865228010730541284317472807560946387062239305749033575542640526098589205511110750054678935697500505768407929356305101387243587358943818596395459039912498568132374219897125984143328921172894834882456361492539963366089022452855640689426646849839567203990058942418791805696281023247535455123902654378877991728808826715442018436054629542370595308001859511702771796303376485228133545623801452665344599558199903550400086306954346420487726367364120238563380923495729209835295610440768387294919837810230157331990191027202824294986185415050669983442781919314309971036213031057957683348825223077724046175180231030810405753302409742268754783020191796872747156290412704904738729203501782532096)))) + (zN 192 (zN 64 (zL 1598220327856629112821898563708892054419084297985729013204379317088186477442151184338041355634563469405356964476949481494709828486257751161239616021878225695351082047524031794976130782053367839397807506165708138311427585127542834419093144283043201388212314281150671210038979783595142462174439474899548487178710610508056131431942963046564247253731512596393915987074387119801192147752993916862683709324515588540444390337705080042282528306048299444064587793012319511093711942794275856561972023003402673799413633096870650477043201818828614242791391497101613946651419562572988198913057566941640262272614832392939139968528022169366726238225199703808600740242067673754023401671695083912148898457543290464546993867336795564506781434213819001266442141629555477628097714085567792610613938749664771837952102846770869597378184439146559340850163477710786101191198632730562993739935503497708531751060633170495256154461661902987990223481631694012282268747509776808748151777233649376277210880082978159788883124092204430663651533352190167495527333347735447085692459087784429634415154919924891709015829498875038781308427514746477077973714241247759943856542502383523800251824211447404673293666111570112720399518146064626198059013873729473081129091019598933229409977202851903435293944823244953264973940626160933360168639166170501792858768166209771364129516988138053803662680107479160527030882181722633404894509016758092236749418277945767875282833702168481674884060127845082228708108497035273908301861967086801313270208546812971165342501472894253216650947382045196105507484323289231376004632186139239071442460748021760) + (zN 64 (zL 1629690207730036718418954231630023543535634481068434077912570623725468329562951808276684127847368987658610268092818258892020987836068916296992272098621646347929068627989909795389555333929855729297428113222860525581095716279100823031105338446629583349929575496551459911666492894694990988492407031576794072155493943524487308807628446719333441504986814558555792096079642690822673181395295837459235155869333465938285955482400328061102265135401507823007501551879145430179973661341373528104720030910415465564286162303500935038514874447869644730581519659146444477404344791208186712668261451384477391310757687546317981649306671041982003057678582397121438673362893570195406055981482034308600297844992709671963386291042867246729321799027394969837544917063332753530763299674874975931357411175018867479242796693314075472429242999543763282075569870234787349210989920905025766720819387612939378469831404949593531229220265280532619237614721525769847802392735595696280751145371918016346404201007343088915336333271653890978694747675143128558174557385732419863615823033755032891078910681800627333589212683077967839490497769831333289308073398346940476592935691102040290797443090104743572400547777933994201883464783522046362714591666065233088047253321427170999361315775081408798622075119161716506673723960603016010301017886725516217684565901949720815050333166156050285417487120400498468476481338376695954928783407567160455673235091629432224276038365705042469963593114480337582106634081242895239178852714832642919796752299393961060386314260557331839804838060164913918862291522224593648914842407701540701546013058400256) + (zL 1669027557571796225415273816531437904931322209921810072969177142536500756133697840962244864599949070471667003084538874479312405046454539572688535133686991636043500424760228651590566782974660098672501108252452933181193151007598953417572443935568348509877981027691388835206930040204906805902632581963826485270742560840207124729475186678219167709847178211733653632022416131515685846443887915299354488922788809362529013937160321637793054418530143075705044426571606575210287710819751365768741243052953890616622810865025570709369764950132880753878513666552289681742713854827959834645114298900816865617769204224530710646741172329367732563825281919950948305811200033629602529584728050519068162661660600786893664514763886360113218479800469960834787397226091325727844133104724589174348250244570232329701233372826029934103745381325180787806578551968848481426533313156394945616520756869746901203537436633610039358168410565194392089788688167072993245321701298934056447465575132921848086535327817829243311165304343495421620603194904897537840695455436691679166948982863296113023113319919497574071298795199573170471606278820045320887558234052592075163903130534299599775898179139781913613899116602098571617523023958180587397282521819887094193267663018676632324325207059913718934850923711685363204487856579292597751069839853882479950773484854174269002226769932008458104615633608791684835959324723411756840019696629447100080254249771120258163791791573862580594967835594130330370358312787223683592727251884575315976459152674467862061048156461031428894546396774249249483553924335362756409549646303127186415638550353323))) + (zN 128 (zN 64 (zL 1710612755975941989954240234855790229835334951871261320397365180752345412730742977825451245412468384695585810782805295107244297284218105249380048491700497280080384370020165567323209139744218745073806570331647667409775914317964358965703819463802233004074357046249390639340002455986473357509482353834236223228308870317051600809077536465699064356077574277410871690774333053615906161005995813358813554877063949523249108843620349934577911612492845939330982791806281935002073988777466254886704875980329509656924806782421419519203984747634266860591498065221089519092386046787899703948735669427367253816794105791063932506564147537423084574469939663088377867880564881163457625321613701513047184866364907130469870270469491723587735790407939297133391076409625078760904359270048173749813374596890262713214190079624412319559613849541589859494792676318622950930211715888938054586925441454545525410697850412295539972144004928234493811807032464481157578400963557449015761054720884674336974244095512049061120131965801413274701026223015848296076975449777875015602693475746453441735919954219689791797650837997862134913140007581059084454181558816774943752508179576563296036890227648508303060183508836222447008817689084723062163743339745544492905681545308839778200301185183594264158265568157362460460814690918983347719602993870935045951508950619564485875763922803004117153954388542988635531389339798285211500721207077729990526916370771552476693465892491243641962603310104308035794774119697862771300704069033782510797499134712860650023893192983751604198283369705251957622252417669369492375622208331071188271967942737920) + (zL 7206377706154103055971483270596817211339159424630729460986897319803363778007517162398265679201405951507633096951128863200702196484459447577632387125545925129370648081343316709648388255042283224760154483189470817874817739605327690974753176307486295865235453230567864570298209395169946168142078814201972876467239194291096666179171599715774922289205922136181292838656691769286535964600525930518520166280235241880728730607006308834083983432693582972677978777148535975631244855668815128179483396065158422906165702974799503584231962332356244182155059404113524565202800317309577711694334247052661226209953336114140214103951395994160796881569892481309665920703559754637576881392121903843396121362628980611697877873848801878594538040224710655891473707849687100603682777462658269444501248417843513148512562391878946121400290024917977826780516778293846598875630517829932932358770027466139810735088704065915734011351077859261457267175421561190336311843196621518178401538312172708270768380116975384721461034533146243323867063084280287667784084183664732893503151526089193121909133307753363419750864942132362312886686226073435046685132439397570383166938927747584814468219117224755135758281795474929829258139976365212523443287248295945801227298749933034971422537463441410837675996252480291171589607192840631685499923339777524570149646555262523060917560380558897333562196196945764531067914664993664589795656003874133177049726249962839271106944728678717221723868317063964540845837549947403893683368474573878544123669085786724942758821528957713102375453322264232546211909486957895494208803105931219270071807788382683136)) + (zN 64 (zL 1791535304221847261489526238081556916135035503747581723923407213559297644885555074126813702374779350432224280173227050588702611798934732916559300680540498018015116533784253648525785874601502017281434971828912552621661981130180314100140779971245640299526275854380062553376145626642642721476111921443835798994729414446230662039818150482333750689001983597068018332666786015315166294850224490946664395207769039426848381422214511439868747576566711827825206369518366425885689556827461379387502800233183561206787644726565320892219007544176340433730179807057232240309056073170475604890136670067202824281844347867556562069144431744307643252996918129070568279978684171410982213456804792724629663549720088115893364271958304610425837891439613567089218667648301952884571531393491728635715810161922598410366448172052592767839777744823682246064190799475165134853479058398722486360548515391132455714868027487160249891685355203940371082939461110729622593651455251224095261280693886026977305225748994751100366046943373917473548576068606494969622326687920579203462278794265339942633532920899833650515586641326987385527944832876813498859479846758535196416874004483701507251861732936733464644786125612773007637476205388078256987863108592705383304284470910431669208143908445959979643632037591478132732649431063062811722530755597822353240755143788710348137127865427365683057547682682996000327377940682967992792726331984145162462611023158213717652392723411673979535451779680320337865549012222943649974722300283757010926867580270329125311686283283816427222412694315010775383270636758591116441654758444423743860043212128256) + (zL 616295801516103287019937150045174167637479706730186814852314515328705336803578026999600672427231713654355446657718420198592979563044722779032207383967610339484657812654583706053443918181591310543378729084736188298155624681072743885012690891236699793858497879365286950566523927685554706955380350773196886726635355649407970149394537651385311208926515722287228821466941141142603211567410230542409572905207726080))))))) +def basetg_tree : NatTree := (zN 1120 (zN 544 (zN 256 (zN 128 (zN 64 (zN 32 (zL 5233266650104339378273358920860609259093243572810670905324399665743005392642693097326980309529678276948122494298942803817770663225134833552517980801480971890551456136920849799729489795695436870272667570004856975066056995251980245901949057920159163378825745311573661920542023649769771399130356121935085830165729033085396503619714152460849022925137643373675184758255757353500801882289907817953569908718044099579325973815357816327835277386728962251064589307039254302841933580455255201711071923923047054711528961308998429792823482518985997360575631279242305044311187954292700260384824440046309869944308732602927621486556864645440401820624931324097548186957144203994320335799846082572455614330056678700299507773924840474130145291514474120333634586530764160578901225809347788319087423338631874005711463125104375230580428142846040225772006592361339414802593964979468007340072912082619060542222664620047879715381287341685951430656) + (zL 5321914203205040520714347425039378263513750243960801512777057234701085192876677503447279973777778782663540862730376505084315432566627221187706369088974282680335178187591381212635363568151157465006152100033144208239356955752371742953587100060370534694561514311903793414921887948765408904772094706905581242080774128376751174740427976677101726891168249051226445084736393284641587624964409881602183111170310441252069312573118912843421345438991751493164704301104525666574906798456358286193657977986421153103843261690394166187370218100537078862845333120811212928815035525166446471571113982494580777807880138063565264714979194845958821795207938263031370812542009581487801280714160492154549799972730849236010355738459073480930064620097460708863944830735532464138691228047900326028898494472592681537703003284081223244741452732694623679009398963762680913743800416340739140761466795984585336691554137545029028070556508608542996955136)) + (zN 32 (zL 30549119096311116844099385783156413958462297379833730158405625240831191549192631435404355029146822527640469810684275464420611194808277889201407986400994791855925785734237416704493049400175063386453222192371970599250746597471715657619912227948561363712353412526837841571305729055835536524502378534018195071476205141053421824455790231516389261215721470014258654517441547937985007760304551893130721632053515247271576009393041239740941639294570155428881893150087895426853174983002697915962675562455994096661619565712065681721882621941005292615447269491710316794782618184416533633764786402886271007614067289458391224769091275630077284798560889376822880962784547383226952669026966546769463818402392348965753326285988460955534431044082578067467933982061635806530342472464881683467396884833161278284914332987288067236599382575145862065932453021875423501960610014529187246587467581525733734389306584948063538748850208) + (zL 37254959372187015802964787688979109210967187343222238884378329564867194070887530363790977934766418126926250979260105669650914208819161025881124185756646840800214762631209730873380650862176587882085882912458090944617618796730916262704756717174085765099455495438553900924655685385059251892112953411054475348489175826848538927426155393670447644180082608579031062198540712427162548277287307608177918198104725093643346419778565630272660354468533998917791335361125155049255392190270834054044168381615505016346671360984382635802423619708083738496448004993056333604741736496759566707748225048024784326704013647853592902836662416113358211824673883184573540662966477217066099679779303156844140769518619860461921732398806990901705532010452658537383733951170147212214666107717734812745776238130306142994410533079244129089108317917681518144413984033244676989348536299224700067500565725918904992321772104777531392340404075495497))) + (zN 64 (zN 32 (zL 200609622139594119085813611447927319286104306022941024484138677103585271965708252331523443153598242857397516444491532311261635971517045426250445990762017155123223534926080441502071349223834543720881867731953423109571725202769087343026034227033301066791560327264293929116547791893008069198584081379461003392212859575367266179001185655812458528299182979905879836993359541282140522513067857895203232394669238120931474992041820371585982824375875039054289101761314833487099871564003860952265256379234182986194641182094881087822990236166367844699459237502819870536123950414658111035150607515907757123531438409850150550372509406488650306973985473144330382022718186699386709672657391706132452320370881458835306335407374791757210884803326376840434493229484707477058910144482343549702932756758060153953485464234171828500107157292976739409556964057493859573903607811223527612195428543325936718256978321408481316121170580870807441899615) + (zL 60468359447451745328388084470451050078831807877981572003986277347787200446499364731739518982670478035965497115203288137388328903327263004800452874441392721386134074568427816399948245898321160108666310026497144136453349418880854263714414746603769753644812327710364756369705247841926524876512573321319804248555063574497296200944241002742365636388589063273567756452663507128949340648929198813716796190476617181086765977265896186628233276360226273179783084864081896055887994662576083796367612589520405520512393043744351967833520529648761753037618629603903951835042456099275616147973587024659405333905872866011563037559360581074785320009710490970356869525687288233103208374662038413692920285472165503339298194785983948989870220860814106589058124403030944008749231627559349897962726015266765341721468916136790169850539365864941904701327745215168406448030579862225642554896134787163847212036312058315014145409286203)) + (zN 32 (zL 57004026349144130031441844003936289948205710072847313789685518528754795454208032538790303809197368810037036636499085222520883762377503093380548212515430959838265933994006899979913011192017835487263855677796254625271084864464367652933434679694769618576694607295385429223908802479403276655950397655432663547793310984516990192993661116401695917195867312319289912940420318569770378213725637769208837356583475723665652607840257090665249605981695221742493853493434017007687715729206725326529359594226977848789958425726344830633790330115103556723370636153014142516624491929855338139640763480425521002329507564797392824766487325290593497278445385086670157703482142582937484600688649684674898163700330558606246734045307517169101925737132265574971979691781539936393037500400989854162153206449080213181695497081674195021445210118709916234852795400725175315852453145456605441472572276531348090434472221082013004055183490) + (zL 200609753351250750288977377617212523710840317803293527247414264133308757244557615455621428609913014136137279579348913089225821217117347159337868224565387765298448986134450062972205812661764806140560791414868863309839711155656830184854442456209622770981309949800286149008445429987223830244145257107994248414075616141785581088879309814351177375496069204239214104029902716460187047363000616793625378000210535124945297647994143479882878845361238901157142299210037129114731116443147631603992295728368658028386872772740376181361197792077653350473185719876810899301791686607496635988687735212670778019878787018733249420983133727661266389339923631623642612222998407996078879137586974598148588639146505531386660032055260254092529899864464005928579835914758798156413977943131747834426572432664141463438099702012478381804689995730763906516087667759723385183222099532361458709988428554746667003376167942260126520584721257171180469616640)))) + (zN 128 (zN 64 (zN 32 (zL 29783327631383405787396686495145065048154240984074007652923855211841545339007066107534076646897659075589104572711086552232206786051616945856427837793004685320043025962641652661436826872584569487066223447015792649942916350045581599032860618167753023730811231972326644790706255942428114776843288465199496991336087327110648951674211069275116275155590003503200932679252093900920589166877085254666667634880161016903211261528105926843225823852256177358478590885947611300079384593305207808617065291677069083205655147145337127790639651065180465108617102702700889022754802986616844930473314391609975536149675450224374320754340813351190481979358412535952216937036846656555876492361072232794629260208758963926786455591866474255354694024473900197395898844962635779378536404620827087724599003872662995011261517355542615688856047644729863084086415446404617981990282651201621223271936312955968504215062309763404346573478368116913) + (zL 6646037073972753080207721496798240071193148291385959902432653276913175215770654025876073969205144473374509839474413770334541042880219718408317049176734631798983483078184455500475913013084851992781024960546768602659032051127029143341341282694822336995139882973232889559404126095828581660484188873790330808054024610390882493524344324535385465473612122056269214183158415296333799437124084955597031240401329809507816027487517658837326667485339611519079841089930128429072539880998621272221976722111109744170792127650250083399930456461425192940459130196364460383692089275991950947615820420238037426845560671423140633281054669213636820396389355072799895972282334473336308421803567460347130114393306632293938173629911070987688374012197355835539257641090813039626438104332142792657682242713263293012391022484939861989389602317837096390037559676145856099557900137333342531791794464913392775072124798932172203961248626245780)) + (zN 32 (zL 200609884561814100956560422121969999802188102264645689292049682895879240025755285361503822867312773409473074889540970269336390107110107565245186350198393070495260794128341008950872191418935659317156852578168133047075871182357060670363388467432441064178411491955525805683949000213761613706683403604531395204865540965026413294589018818047497226736678623459493193637801878923476029870765425975847720701296327554998162836394355100743246838955633234519802665432211408430782235581789611726896347325333345273642569701245670670553943307106882491790967225769403278124510414645955425583036806872808848367732010059608016745269523256710542624635985091517122923331213105385850463933587228207253273510249152941907750669452791585097104388790777244678801390428822069621465016677397539159149057562087414145516475518733133729700378638413674131518020015952965293458000427997250506208938656481106229994880912113331819826142321459601474690744487) + (zL 7925708808510917355044482879730631139058451327919091154019299563614157131427990947550027169744649181622108542581001559918928601511645506217539582967852540852673893954512477245625046062572886009115698712920630152083697691401684820642850794484721917456939104259842627344242727159671103744064218116018008536102216901025283702258992520905522158129708833014850039266462897471406825276493669773253471481130272391628393122545232608025752343864056635923540137441967888713568358510616502220340643404559824701058375610527533729720506639933915888282316990946022089464017751138140822136797284290428309857436803170863043870645500735854897884297760527545486342091395569191475223368354171662794923493714129417554114215510090579770060516201673433391400100929823397468577086385041572706472034005174523948235457201861217156852415868862346621649705046373137620225301395573479421176531918616189206309646916034281090934069190228705482))) + (zN 64 (zN 32 (zL 84039249932576445179011390116673741519563545037715290414148409443677859712964119081556256689141613138605233588741835901787647818960901838338763672102296091244890707637121961071670118093422086948654874249581042929799346186228211360031794186305851634260613591550708964424680369275983688008332823267852968885160648113675469853818946724936052704539044829881357743347742072113356517119611271753996832754488233299690716621485720566036665565792728943292731481956532730743901725759288341018861777512031107608920708516930099981309715486093896893587340336745126757711160543598241285658798359037227995664132388212586560164311293321116975280998594852828977209558135293252893806341098956241110255111113817904429985493434596292583453113850108733347622396765120510821762286039305806627580420036742482912192008412501302261280311774874683836893748976152846693037411948028377775481393145783624808897239022112702284454289437514454736966058097) + (zL 200610280882239256461230475384625332725151761449240828462722826860338851730098044697696157601895433264385273608897540902099879056322722040010685771702804822800853127477659521778353925758971952912054385674444922202581867522287864933786579762824436233612337035660096848525805759966736533799823322965746059871203946411901080669048796379582662432995757554736444803477950983650941351126370206432788160343858181762389095649784995488678869195462497742172801521431591687701543352679706084857774138999648701869478142783083695579327540214439522789427128156040049876496462895078506314585681321080189046224354181142194041755566899666031005203834959408773147824792857829776573385638527203535165284665176891740604832611105493194408149449132493602532871213272508022172025182565932244377508321934723659472796243157304986161552141322192703109724567317483143229137891125370461955921187494487653711275502437086669622790960135206959012595040569)) + (zN 32 (zL 42287943560830620087660536206400913424772630441356724663118235843576171734482195739295791052413062592612157567427878028697466569523546851416994179645194459469709054132384195443000594456707843125514639725810532985098102664053183247425987117291121357018600654210299367439899615856929940979535566162118241273108200711357320805377553514656156566889648152750010808587254066452190622286428698581356669272685903107330914936827177758941873551217551058546616221256110895557797371415253465527204497634348281429760631910261493398567011208528105357672031230905854808639501459206849974085428189594242193239946783871000672226514031431142189490119453925123078080952435095350097011501640250983952752244604433196836878330914235921644882706451390136625394893611594794004031805464394835095134343199863431513123546925351123379070582620777930162133101334802654421789019293348940416541999885963216091128278105459788591342238005468781099284955533) + (zN 32 (zL 34716255769539388451525042472215921400707081827601197558130492168150413846909710890499671252800187554985273089664576542386004637637148267472866457876425039337567983855858553019194225147737621064410694127748586883144769383585193037081170356142179842636879069458674533632985894880227404034916502708071130904928176340916807621449271724372545993139365148950085404982440992887881989360127592505739189156758291866915731624257503029401034796184023693749544971389428538671849424404175752082257815224827489175267612708055962389618076100264008395078976200932034133819069281215313536479993100739454200811423384008183555323238607906992062060880434539848048035318863738832124380392101100053194505937419811695316000664123165129036888963318277134206771153085866018715388707051817053948842400682600782895932805438811624384751632055960944770203109223355684258504686286777027756375760849516316805146891078012877853579593830460621107) + (zL 200612629101337665271571673712404619640541322715937251276235954148384551935845395385762773008942281706604680005980290150282928226061232776920552939048882028580392680796015564162879109000824779260923101350167860031306189516095222004968524392865068148767234302433408895025305404319409378234753680359620315703940144319553870765426370123547400140917014111915890140908798577621587797059286688587486787651315572416529403706108137883683456612014316691884184446180861295749378277207289333032740386358916794199475059058334700234097237088690591362692863390952951715888565032864708390289277218750067323239849701559757315961719528218123081594232050287072922405978602818977668108534230955652415059186986034324639795616637111724427606974348766489413589801420282239906563830317399148516933585115346858658835637535811680449896306177467139704951065045738227208513882493460174064643700406562611017289612571209543095915277874239145859267625173)))))) + (zN 288 (zN 128 (zN 64 (zN 32 (zL 88296023275635777855293112614405385346529841620127333961144838557093534857107588833234656928327179855264457956511680164403922996892390677055138601048269700736698047358590549576306065572595717262704586874043014122580972090274503549679068119580991487470528438462287898489069051258218949691895790326358901043341728177182392630914679386344398468569041081372146551339335538619177637071882063523308852777924212756912681730706308049376706125049712453089658569424963958743758080828904568564412431343642348312671755993369572079183630431277425238541789815333061304601545136553629835505278830923242556545550990261652626600493789483703598585482219469029272276423436747373758838565945590186035415431241450645920832108576607852441931877187112254374033248837636864522258881487232455262943623142034242410667931707052507728740193823416553206272329836071374392003939250512858912855459797786010965495769963373215959549011222021842842857505180) + (zL 393990106001859809043728637446630846114190304447079769428356364884164567943522464994566299085658190195282376870472639237664022776871347395482698583831265853616274019529748527442584282213978998089029563186260257512745230799253733761239145267356791855519834408643514535884224226968208773446833162346238119202663177332249120307055618870643709696028241503699476874031068321184030460139864244460712596185562597266202850780617856254563301825380187539992335034191870068910084420512623021043386142689977071236620898173860926942610136042581819707462375797843333212684163109558956675607011828527445971115199799995269572953424502162038344911919460921120224258784168398575419616157427090386583581959647285601841715481625588408920683948422162406365528781531768081480615765909662418367390501859332258061564183295918566168387164675262999758786901271418668870257512690339417308534798778941594564187164342430329210359136977227)) + (zN 32 (zL 67995733775719941870096153062064316375118046044990228503262554379701633969431011605114468588979394464712906751551788748967007322104592768450960258967429898151557127043055353032214662280569195972021708999070425057767496619241219881149082651569804412210560537314477174204331798969315727236303452883159953044161763424993724985608812797190826577212321963920445535022187432817497205125478108501041441822819370588917799946109760173617417128744056756699434345124504315833265427219712460032205215617411587855772215144645444862155175908822645612906174550065600121967003677124066153215746112045723780174107072563068561418382980187845625416056284210345785773217249807298357925094305339197743147950479172087863631951317351549324457369312972470694438795601827171656408740719789654626458418248743118490313513307353820786689113370477166451705169735153476762854607456010672527930314822363637784650931891900172598319547026717823698508710308) + (zL 81647456835126600617296827023315891518220146814242703218538625187848988223700144534058485141702225013202829010714148616775779868211655577203052398575921679715676552756162803608876096367852105300751044331136609414851575357769180623046389607316029215439611399753480218585115340599155475669180805844690271603192792742615841845156642504359505484926682899711495619101839602536963895958054181166076364425735667606962243988079362223657206352563765483096704460509689394026328093439697784415528143364606781424474138017300629788767306522430224963599799265917777103381195204713697932916258119184443209580245636234957176853474719487815254543555190745918896938971122917021153953005580405547328670866925777057004663357536752369536423873958003681387047713805237277765083239484642980998921814969877647625294771716630098697909612126837323956731622917689211431361347327285421967453864205004755360729549123554546990963802340668087612854436439))) + (zN 64 (zN 32 (zL 200610359361926814164522964891505876144363050733189332598085384541401441839870118994898849204899693574046166104303160427274770349983766674234063120035822002279766361445793388234257195569243487629781203574377619497767624581414548237624344234622626693140046634792791765637432936937793490880172090119409118434203720043576079813801586816990324756216807571806618651311782941460169082390871610688899666894818196485320541573152697481352887812011224764479904869429772325547560418099352123796351299681356533926486290639609826685662095086445124269026275521980831510692197200513146475386113592744811511308022550736019457133934085946773473335943734502303927101140647764319698712090510626426022153639062761030990798988489588639560746572242291783137681479191925813479040508799268315414404297313016793534138108619433334131385387109336997992408617572448487610799221436021139858289348977435990342996296831988406148103396011467226849215316279) + (zL 200610403986123326803566792358458577132289575106202008454209511109286714180268938114291126936672975409563467392849937326243118610240168150686951396349684721690457682857610570211004130174063554989826183416418139970234106523287394852600053624018360864008740892937533196586766373485825510565227557510635310291342412733029726052426336918522734578796325875168509463146847767720376108751427334186592580023339739546785676113645435235833419219713648623262742263703378138005101780445505186995386817448410262273830057853226937482358553025364893535230442150955867916230762621319346434003700236563526805324949210433792311634193134172890643525639256769327399202066176711808661057314126210822256876202136074375532718382237811300842231048998202102644687935432827907517956282793304663487497622526814001520165251023275246909639712186546792735500802654952213302872847197955838321453636870085877135213854494780351322880382097546783491977380332)) + (zN 32 (zL 200610447271907266213631590494036305495545167188415428164262820052452962573694983292787190570056590161129681391895444080118010963338319473457573827231722956019292372395089571474322114853748932038556156208720685997457755430954562793158489592631334058920683305762259663441206542009030689999990054863165350836459409367155332583658252046168028829276921859839136652266045945989906614240737835698715099789674480817037847272825893665641085786924146630317840536920515870687720576005243599774832252001737652556372492565668147751806710770811228541496131312669064613454497567512952925024772385804371129182666205957859441926938504473735797475285114539820405290565922650273994004812449752031114894797308955403200217024986330913112169050217284629818595907751456730728761014211302278161447640926067425917953046942504045992077749395137524036557823386296804167388312193000545583485239482421343233824471842909939308742810930337616474131858017) + (zN 32 (zL 106911031305647478486166085365353053607250224610474452085671022726915422461121113481977615828088473731183804400674411174049255385690484179722247213624000998323226275881640955290103365669924905265643172551786947043235291102044618833682599594493309841461818413495705245339302497521124279852650721027071307910470175096413886933578121699119893453977534197299487056507205160215770238376185241941591672827816279398247062915609495140465658516204262166259564671037189052768013886000247643221817388106600738734986000212943552458115728001219708995193451974013273978609827458210868130869630882568755220484905690021210224916729516135721367538133622295793847740981866396247920764298291261060426792443123034885046060705511695636461656674696297090428888739291595516202270232301938017213427351154671948747523286575865919446275142759729713748227765239326294431652591508916857454757864000817039767072865287342018988132424034652427729345381084) + (zL 73580529564944316319995626168159591990057391224335240069439604804424547003802276930425716572854275083660305096227531744097282814698669585332094990339552554130282123011393694410827372834912303187422600732399601587036295179773486973885218292594976684055844346145364841313190488191911764636012770617146551397429234462770795276402132800761980096893029619311533363775204813964920956198391339359112282028252741647043650966569160041995281846542569408896231848574443732004171098792805645139856709294772660952279525351575026263337564732020135178704841689694752114558513608799820949646114169328157258215436927622556331213535566960803633751172293631930214673791932063056542722762634051401275151576173440670769570299266021508489923837223748102748473863403023399629379194088355077706673295530895105489851257190196184514963450599347172404900314971420886111767561904378617758592966641310096697396124626808994719925352810048997212072968192))))) + (zN 128 (zN 64 (zN 32 (zL 76417251242371053655318592018633281818200255944728361932130650868930168268159132464720868347807875689809174077206969052539287611647287775480643194917624149840752444778424727582219151342653073622130806392483149449125862935579680979723882181211547422298334343517330026533317300130621023907955116560788382880995230257627106585235810631905086097900864616751494761456688189189268266180374610511142896283024211812840602089398913355230356332081595187700593379085574075784486516598378270827732965641772186211423038306703742069466398845400326686245568754625256040516656638422313272144138006002327213319759564926651804786083385222163660325823726913542992300770329093726221410147956315257144929699047387335335640092784940046383735426575757347485810561925746079447147365378228961238333773682099935542173548765234555936326368681096621111566969242512834736159236762340497028374507414911070487831605414232767475987092105922426210840216113) + (zL 200612184085357759958670111180774888800926127158123521478918389411885453215912736252324010818886302667254498053863459705183088888287285129952478262907642073969538774651704308502748359417375782962763392808087119939323335869297986259842471198774761677166076123923882504799641514588912441721672453945721622777191570127036953320426843996774417932904282458045757878304747487356049789932802076624144786233810696688554756525169200564280162909865162175193187964438978367171087632061175850625449268673792554043214933576424646759347492233113116174648905637818861590435795795438899912685809681156317281355055341527414165114575014566877493188900202034439078681535791966398256188660890961023643512985026371852038004455197583374430586273756538900098403177530090231961912011728305186624623235849826933573882401339133800481018258238651964517172989887806127173183552271420040682242378522877963725215218414716854339857891989271547322140721938)) + (zN 32 (zL 44591260892957263689207555191114419402965617078367922868473448729335255042377676443369397347733495059603394877617703841700165992251730887664154592849218933505547817591741783745950826199471347434478326959305353196418944353796196202938886224287528430540883291791036626121264705158991172905041513083501083993865547764205438478941938811851924669773899480633307210060917215560724038930317035885845604156662625910814492123233564094924210617919828460885424646581730312812131138443931662317490232905364609067637792048932423486392981426480362144543589519724713944835402141861209165870783157526816232527932949050500334126805143016457414219140266456981578831873652466049515331402736751485864018102574359908645066384497507973790007413124049580229757525583644737931527594357269345505579402989077193595002186554186491121265569327835213415866118592489384136935930684764876165624464307592141060954456948501883320651107776548898750535435055) + (zL 84927416274651503442055942871311173760056198172473210471010032036640629610109052951048819600632668942522978379816528741389720488054799427974469930751155748774992676872253653523216537806544473579468234798291451927035015745613205505935588084329110633042085809381412423702917483098252552649796738432276430749267266023339075915893046256037178801942153203478048291709307715771157657377790835464377627809178195899878314510706384825533545855076232324582573514771455798082511744919756926269405528876964231856872068879090665338086015380885372231480626093376231129942154919562502048626484990943170436959821005708059422169206287502106100532964797677990535970219433543607585856796530813525112896613516492400485945862649251029046294473641957358407869891143842623032351122103749449180911559029774232016750336556150741975348251328582513586118790091386555894829537001746373288409598521647296721120991328948132173291158534066170850183217908))) + (zN 64 (zN 32 (zL 27747932407252199573205043844183699854439382224261154856731563415179993080401255331250560544723322047770539673471282268930086711312756666577430088831749532952670497868361500143442337584275172405733063927923096629843356663150043021888339406526736446387316061052475146715207352545389041365895925680157152375634388617959715796271015550797216916371860251262638745899490825258721425346423033130027808139417708296202253012944138981052645433567218294988561841866193735592138696146933088762342007746540640827468502765910331847050344240964021198740358944284233340667883123972901743213165434672898029937228421341833427549283820336094439562547014116248597274387764023658039503053264210208184798878555514420747852983608881675035668906219819105987015732667603358747278963006302200410801241768535014459793668366987087753119567182973279483855469793266662177630222055584117654788940724269923968657903742730632933409120773556157902688354807) + (zL 125792172726214423433633679492456443558592145093726000542125821798182968174336357363439712243533070871793136880861146474382143015698454982610581570158290508275677756243390632300183855710330620042027936154481918110896951171708138161159076183670372158742436177744784349944672038052121165141228089572903360348762416455237935014683643731827743112545580722588274578700775871897423568889471741279834651369691861036766338906903043764207597615538026164508108467552661279121866624123053846879209289881762103310608324589791590498164943001954680786202953637310330935913175733300768138815564925757345043021813276571059306362066749077422698099230902152858910982310907502002094526733742864992479349868028087462585255523354747694151379376244035399939915209505689300104322700482308584922369686858290695277293736870384785066036517920679332301101343339500272453916304944824611712603973680153501306636824196557354402268815175531431587028665072)) + (zN 32 (zL 130403610665899064604801772250935936589620551656626651741323729050713267370485996406661342644203630231245343100211968917908410273039711111876927390779603188632454095197202602522286270228599545061101307155277110917156584025096152177718222177119925742381665627261099813861381808055199747582863480426871943612446531749353730690429776642447280711164544666161432266389290504161105186796067295692809048492913914278497462585998046106315257987696312750738350610734695098544954047216020597935805964229490261375421783247984274475372164872108582638012358387901390966237990459195884781306802113306829184262070809113586044506342712859193940920181859611769314755639966308877134762676459715086409116066151704849975311928681581255350300755951443187743215399553123920739206617015323470416499428768763633984614981209194095393042005490101345084160908589142326355417414330098314354991238523544244891504040161317639227888657945994776079202124530) + (zN 32 (zL 126680413486732230771987093963892450632491443301922440254226789949548321434672382943238825595710207037195566883509214330555924055425133812068820471837193468181266548394228652231088741820536985281516441789918123378204013565971119651730889796119912839345503422292145431215718975768240003694748055033876933302272274129646299414504665876173559412256348039499092883412705580331482832939858122911056000284476478960093838120203624914780296822658608894726216464775715651849930396078629609703308422295599183748803238232399312472113680330554305199297280592597757229058942450870537822798837223646750212217702173598257049616275460266740632811469464980729645027092028413454597129487789331834626325626132836292183906350794850122447561634460299824046551389467839932023270146609778557523238879311330214802456100343837580573840019360474702222153664001218745575717127296556365521760681080770319599797735103563733310333114213843795897735054151) + (zL 167812196049195275834425892997016303039284694386221527721089837906626157764301592177960475846738255931810592261631990530840103030528414985544744258661070281592207564971195070866164787959280325631751693836759300050135275048285649949040298167159516719114137824661428412052070682139895729536344495672315883954029485597677633501408425561369857587519294596357544218282384645847756160477935046056768318957337992963181010229317424967367292223683337093494447397455596970107225703597045159894645557288556954233706705454828500790311080169292791220830816745311453674456183162678603207707391769838646124510616639840243023837142809490328643090027623708654782404947083801697282128245680709942078081260595909972191521237236240100096353203962298862245907271388905436741268854664556891645101731715124831120272928934275045004680919630282511654993529476898333884925071413414246723466436983663545141417257875248085525713845560785544809243739159))))))) + (zN 576 (zN 288 (zN 128 (zN 64 (zN 32 (zL 413832954035095140845379739228446037264101813571136726522490731912173329483333883991008318031079017830813694775696657512098151944581862428297221110011110773656751477258477131228467639584163084653710285298332159554889700212362156735743455594494425616201737334712343651191797632075861547166787392223904733295154813052163866648542108430880178952132169366482760671646743060174544637379849624336401064562091487464691589032913273434245200485441212365002118499468477635059308694725874480600379769953759015575643345057333289281704941998722865356613281778752338045827184620714995976123426051902569536615175556282497177213604427824855722668098784332070955540258374719729573624464683320198551864505247932592566903602610378637524249117192016679969825894937976796972381511976295191130241481579400597155085770262000327771257516039521772732244692121186906532997202641810020938818681562325184664827770386310419106911263851582) + (zL 137229472202206735283785226123099805375841453788143593553398862692440064908057874876929955778215817513834807708320003006961372072015196841881794557173667961166991500263926835134121816103703978816291460880757786606785638313573226423504884065098490156269799096797803327520641541377945392939033775959225735554377685544455800109021400426132812738695891102693077029901702443525598890663432809314854583444601084883271163702464103653161232409189001351826518523513896355404818887790762957062124248030765980458161677551497087156799883134438230123016231616456544838746015323924986432636028540715514791252380160486820114578493063105188746163074645003262695376434053957131017270112115114995389440195018833599758323157902374455734323885426844891813620294829059602178880734225488683119688701519820159497530554601811016210073974969354460861658734927003149409953104821067366073060923460063805798043529310904340671089344577676514809364349876)) + (zN 32 (zL 200611229109624338656021694734463476836599914016705691069842323584948139118023062738674948917092524564168186592662237730573889704510700236037413155752818032519591853005129060951512413577595661816190425298815063497899712697882616342053727419695530003752337975773471222768376383185411874858433192321769430143390360395564078208685223065981142169541326174947363965280651208749336803096417227973745000120468450833072170804695712062872274443647492275629393169880486412755197096862099345871577896529409904136738036367472579640456258778590266493918505445607645151008835796716643268041656082812693544874359711149822695796849825018552820636619204211670439751809714694354799674692264756902354388496584785419523690055096265123765915734815950668518616544047417421885857071280813298253882675512195751563224339665293211786313173797579119833517608496985002458030358066982124550574042578715133018327586837507534922918558994600102358597698593) + (zL 161784844239170862227816606107058529880579556901382971096663772463606714460344782375347226747722374649996845005048249102590462002566069955260458147228120898038122565288180393320442437520577267488502715076685050277813211805870714632015394862533094048629073713747295629405962197823947451914975267127105305395439247128551763069953206310666653244193389943929581225780575481456221710326432087099041178533467590713141922630462397544160549131038963695816376441021285015321535232522986887191305059642817159023851032201257445132383767650013262332322132170652087140311433439025958645973916183400065981534648573488741431280456365004575321248124185859812936633287646222622634975701010123008506729878572618049565846272555818632020686905318273879466531643903498317694161307218541673398803153129052661497110043678622396434570949364512495769728039723957109194096158765826996938624991796806915088152020507791373479121782421557831671976101019))) + (zN 64 (zN 32 (zL 23199210159435992023676528449401528619271944314903846521641017926500369074693083608918457129273324143139848490124173774046331710291574780698323242515596334657640252506516216181748233666306758364950888530048826751985721507637582276423900114510736012476074452313260466319809732833340891388400413302484309697217580969867203709509563254857951631885994486925006006801769385838069278517917431703314686955418656642276507963710084843830332866686184349122338319869087539559659035746461646920023279104971903696183744835540779238866646036251274025364971513077135426500853836069893217229497405695624509254637091613712739446854274146049142746204095523939503204942627553859127170422148721632700827247794505869660450454820191644861153317413704604698943711334359216245666571054508067886608655664551070312932823401140740530623083995391243038006145335207027178788636762305066249618164099051507572897910529465179296116334332222964773) + (zL 200611898656785808019532906698397463699667906575575452801984105088788588720079706795590164629693889875320819142438915642341983764789352144539515964368270833822686846254824331190485158519366804463499718215122129022490819831139012060279117846453624909511115538891408488034925252973557172577906662772245780538401308254351591971831388337579911328262851796060163989383301261687335224574358506144169719510469193856292023592506944472297401108220331869528340543696296684151578524195803677353695927891813326211032341077489512916606218665516393318118919356243737366056845253798868241741585540765297080425470703177777319551646055259800546955596672329835144775778461162541796270252604538917684837365147952848655549243766408792111436536753208499340917170909148122511676750506597245305752685133401559111498028384898142831592969252710671968279176616477067541509050885223662789858807284525814993133420696094538639527492407247067190547580011)) + (zN 32 (zL 170738247044550050885414227609606609399717164554667069943449157613879353843125030810728459435776234065045893141167749934624441172002982682547582303424086089262631873646183358051431172199556868038256308189334616561279240103690975014464754319510587712739936775145048215758916334523932660236695212276538468752186778858675735354030127990358784488535598590587407290621812905430336332531540209795919040497459304597120359494265272406210293014212415690596518760267360766569623310460516257527825040223626312112885468914372205352336784912542585673978510249313756378486700701260721414351322506049181798722427232413991050551666262175017544171493113355013989409653448509953524152059040545257877853007579022211891341624307604512843737507279602115624444486213307148121230557711216869888140433421249460774000707799089262623759812486403125662521288069506353779919806714441380030687181848832662899697070090731644916162879097437383256653759658) + (zN 32 (zL 161430254012753980592424331711036423150633488874459885401201354957027846448674354512172122105608910329994992839835381221368839641228447635401854741736469747107523730361460687320562063445278963282425771952209814723764164330634660990404871100408652159199815700314478411234021401758914170918978878046628789260515307173898818207426234285920096667923676323300134771076159354514145862367235574801690528635798104184762351932524056772145209423086569204413657774316918673822498104621899944700781091104516423427575886288119660532645316520350411768051204840757952350044969322144431684857121315093100404882183666495220054594149939494864066941464202342989149575118224058713398871568244691107955389096484342359448212064865968721855215609681023849734068005703843575307109583882216438180573313143878428332331941390534876183779115572314297321424410568119200761567670871183910919780927259836487393141499645090205015297170045717521059478766818) + (zL 41073334713034788944090370721432812465754805275380358187965413230390859161985305905719022253119078994833993615754669649871540738570221434835030112709152365544773075292692067799993668926426936972188105078343774812969054984575240242682298411208848123506160997888567089716453943919182692987413671122523408336314733940303522427329310109514906516927884271006548005872563559831933772693970212368377413849891631273877009246527026723005443234427341185001091115459860688929265274220340647518114882482584493780572189427729738490298925819775578694420993330323393976705797436651438726159283565964025248606061530173252920896506142103818681666197125298947324846635827742258581842193757114604339846584892687752572167870560741173671891591701323967825420745098353514889483899586819390495756084998986566744953899491562377594545985354300958787135750272102809517495658749557886708348569242194975423704626688519601732710750791814219010))))) + (zN 128 (zN 64 (zN 32 (zL 214618785486156133369873776354358316462932615302757639364048966565681225493011115909381947202270764187239493578768718489541485355091862088113930359145078700302432922794211942932087363639767203381462132625212703276373628168308762712099081494414979820353280308709400397963893209960232864314444283918751622172216662645934667481321209677107545537365157449925228712005536580090782224753978856512252752100146166134053061070646608281397263289241904948471001553995991014237468261138377277004571848742062092311179284702045494409403739197779137958061310795830977743290208159645237034985462561499453108477530386713582193873715374576855373340970367908260517666396202372786787229858037959558080751172825639147363522950885256260863974752956650060414892078955077228946617930395190080506785354350942520644985370574931507999196802635500332612723006715258483228924123063323644891841944597134991932804312918126787549366485565944904729454052550) + (zL 130314963140723687060505397092590311207799792281362369478274137993963015724640391573514801538656411266892616683224036090313025649030228640921515269864365745721331027781203458504154796749575604574736396313800930805541565404191256283807697842352436725173693166747182202942660804057484265273491742696956623879687645593888226157930095585878882942291336522977264645860746167581162123655810396559687380983368324980105447922303052291933084156071602796384831570394965144603407175441850307164621513306839377266511467678170148818502570579758043269909147710464076327610131062496090301089227666144324064777891612421116502143597206246357662418553463621512573689072614872959411105253731435610787168324471793897310923364285691456379050972313431643631115893885104777771006031806731292996563232017942475269324938942590627633290652058830557127153281604215261932989427520073186894736964062813997707004891224364696543280298816818888846113047753)) + (zN 32 (zL 28235337634944703522512185163402526262266105386871540532725506917257802194407949453802110590846629093799958413625748454775214770821641560627747032548928072369917290531644988754367687398539189307183301337956729521377128008757792825244015731040901609077803834161306146225864874862407605834333402285584414701994179745842304129775549358511113646083439974564611278048016200583483894523996494957905967280303381660059548634829502089607006005441739874120056483463528141646949853375417802712370843433324065847634132885385011519953087967672333278598054251273598291887851169115364159462503554386156479455170141664528853531161420814399967299740094068356454004345695533627370855131653593692529207992062126870017570727751868520533140994552681604577819969924060930310272988772671750601480523163760668786925098685519189737818456033283829507343037740515608117148858840731204247228792865361930027190606258763799630137102571910071717) + (zL 89447172658313654122708298361063707823136960205291554241361098962700474892738511084795778771850005366360602084068719293053902402201566044195484579872943398419826509400709962159810030124874324951314973911180250252087317491589781338328062250579371999996213693333816362179142479934598602964946469008572040897148148969351703728888613818385466800155973748088304604500548112483068670221336626789927256339265135092704360563023524052152958365829990329536347022615355123136863787661898401829833532569727736159298104026895403799430856522809511981872106833695830776149371948985459856209344564527244318641103188170793632960461953780191019697440069741006262681081775462343920251830829469609221299168423865359923059934101307314829448018862258874511252524429857507449937292794043783823001240105504720917407203214152232167043646205141603171657971711531614327501901655628790233697704293046558360111834220190881234833433517546733575222068681))) + (zN 64 (zN 32 (zL 200611774240226687994210342924206685092010993019819958203979110756873235246290768839071324247999034777688544409381152221817888635894591628246300892543525616534378848418191101355202044551506532037791578370606319661312106159897513898612395460574665978771837474920634804890074302793047280941553176029414381127561078482429635519231816911849053788369717321183900999377278490896367487443240813703438656754980905321483273556905336695129313304561175109870026871692807919258989834700301047913809221154304878986900500558820067509338947720441284405312986558135656309904596814011783948539911337159360351942277691262501141725548552260114276592771643492363610519908645304185624232803512695262774677961907166956210505438594603581146105248756095291217921508037067229214728408211895802764504495651254970011190594493320168793728292929554777497966311470336223910795327481399193006769409214646230986493797745079574384272092250063611583670584586) + (zL 200612109670857119289457351835553287943413757807666853237638536632045291825230476994857352905509428188792999527327873040039045745950779289745831517240246131334129224175456963084161078433158906164057431525443524809341780056020030902740402245415862391100608369741283515946455941623558848808555589114208469828329917361767541273890466019224138431592087302301056514464337014753673284482240750388323747696002395836942344796674012398844211050099114874117612909815780302567492373949710266367624301120387425980943191220924930915048528881879499704875760006797396568474493215436344800786859716758783699454658023199354364384197924028804296671170519376718992384466445581784816960577394385860858484549809203827066890938592284481132158426636422616051195743917710066535499728502281696856941689129382758346875186684599038641704742920063766351831977751083848826226963893486875488551429953918783103725979511769854446334218795296209016085349881)) + (zN 32 (zL 144498571525896586401693840980812223927001399420108268334975887598500150282623063490318848079491137268972495715762725305134649018169175377155198834201709985638400967448804041546610896086639422259954981534641154012347135811254226076940911069356270501352046371443766465980374069808187481723582079006416576747033876238599070576634937646930335266470703803860447297434706971984899903310789789410013978591141904028631522021065930261532622295115951623271481655872143932723897470338998470861432474056959877692827886249038279099771378110576195657598241843445136499249310086738572914958526706403143723517473215370407388802666918465718317135987076918659561231072398771160930194530844484962324941207771508485800458210670130383048089604116749985345739559682794210896015722659901605359531262203777775518507326255185285173631299421910984644602430660708136395085140700977609014814580827705465123419994916966947165302041680227650577638491608) + (zN 32 (zL 114977263311517610206732795760256586507106326046263313880478502874880938587680168394233834808158950615740174567215723651723599994455363007945309103128243527331036483987485701870406678947820015358241860417298093978740723032171881776220610671707006623529180530862064892301128541642824392958757736009236420006015817234081892994184129730850852520762547946015070532865576994232618778546409522856954189507187432128219329786475820553441815115633829173878159721850983380140562900200234745740463873207610883666698353302044837601577306998867765067581351480268345632561481213912379960205883013747322831749132686899784927243563742693897929440129360768821853422524975100107716349465479850418110196871299157886119817199006308132144688312242873522448541379379736890866381181515508558377835782265359473250371561809543627638780618505078243651758821356150077002989248802765651253141702972959272399514083945943115109546814073534827995695482413) + (zL 152296979333713962019167378833595194098001951942444605035853979398198304125681562444256095121574965251604165299246193871519080207875035089645344131577618736162978605995953772694668285850760995625406345372006247645836222955592830306624203162741579592428828809240551619099162169333653719778357849184397591586107912263471210100863916965923772613334875571833405213721789207390946464839617416787164517613105432039031458143588519854817738059070081792152789128764576600211222188204573458308417912628675631840897116235316553239163739589879994339196832981365734084524867883202711990854282411386430246467532485611148683719483646562253541077661826575809925541202751368351455501563960972421387235067308491514234665659810430629645955326912853514740512276497499919069560739448808462023527244281475708000982386805454714265594372094139678759146359766469423638271314567822136778918546706610357395346315038346228677151249025162725241130714204)))))) + (zN 288 (zN 128 (zN 64 (zN 32 (zL 158236819840004399451735386465427722180570147038089726102734610356167610875091416977555012958754144118123501560478747732727645828656727367940183709906828772367573152375994538789674489364386594469780755862708953517344908724800913042791672089263797218209345931683432953482098114550142542822649043457308872815608034638016816891651078945267410770667410337661089235789735912162638047453995995152742384206983156255364636239985098667587795253596837426674433435027145918625527680136818404265816660305387538602006400909337170674341986943192797560812040682112388130544225729907604487267436768740806825078119805368064731073250546596216949021239899435549725510284438826948559285093083117576019266304421511287307540926677061990641726996109597267099959499606840061940752444295770527315523786589872953656369934806380431197971091266736038570070835966971273295429211231181240908797126474844798494567131075355106661002574110670978045166683532) + (zL 191302205395083360379311375917922423774774572591285329220504746927447987590026890671359212953530223170471239947591722524329996887209744014654846197120272418261988640652924816929146417008756816646857606062352201917491378134140405327016988074620185184639631063465423148275788337817538586949663541977402803394020967206759183011178369478874283358781491563711787708247404587924475529784650150102497790320656248657820910753040594822417940771791496563144447363418523551192413036490322744916869278969292433933948913690719073537832517646356936193126658921727739981743372236760533522363371395976510167533291936954906529194724046262004602702754552323397126444449091326958918660900346126524704058837099056934620149751054677092962067212443643873490204720527600849088427594561650341701909202964191621693592258501680915686246719715883325958878070244090465424890402411854340326128014894616446229616473613707346930294736772430043049311733330)) + (zN 32 (zL 184124027432167486863327969088352671207893067795757248193453801571251765562201380570607577202426756973103507356322169688510368037121618157574429793323183139937916292722832148888249274601468815433711216718194960693273434834769613616882635435312847616955420277875089028461812830588227818539993998147871855856037514115406346211733568838134603510941070333599664394503273427528696975476685782715995761171690475266700888690386053340094612011442502079640815663784922602825185219252393609519607764071990014089966819476342722189470303723147563203336344095655916607551031563653746755812260142622889339098952197615362335107717721873784400112530060119405648484264338735945152535406728573499956353961070660888338865024062204463968663714842551210847926467253675471212407482015657144150989207401122568187008921328114329806256151892695387169193943825417396571973132600741433117804610061943223684427948276157920321622819384922915258294863524) + (zL 161430254012753588180403193065855690623893647982292744925192206160765202647263947242984198616562204192611489089924591426326979042646464779628788885528217238900205449749523931212389806965405116302726533685848667177347560251484652190393161168919130169283176267774736361574097171714334149181364321861454600291531465101356300804946548693787415420638021601673096574921782293482072783347603175381943911578121176898008518311378300770633008504062986524840189566510262627793772822204472025811147901224836663771481803226951336645143584835368753754045003839344898156304789469344422972000123596605074375898631196853647735155339632762970186579702924213022216416044451789886450731556340403510214570319019697801132114694293692335894374655943082135962293654533085865362342928760894660888574444515027522802200895123787255922259623529815254671261780784254921816802509218879544910483000873445275306946749249803176929664478627805709673379989212))) + (zN 64 (zN 32 (zL 200612073149190930802280578141661975962116000261032263984904022295654301330707391687183253671271097700781101082139626783339350278429869036799613840980626753203613530702710346711772533944840988979124874346038530624730457049610516571624186318525781682286435725571221302030806708206810298113104249636589770330443874267959537125043612958038822873568247712720997727360299509679543417953515259716704851612622801905332861744567951840518851737987912072049059318481241251445647468191546911062115985152584604518592184990121674404536930647000096216996640201523587292325511248693797856626197164635426959051044432308425315289900493914883120460675497289105233608449230939404731956357820016553101025384002338852784188867116478145173063771421897135604639037604747307777741036149237094176497137241306129509128983899529850686587755656326095937651814845702057473306886212143391172070544403837874027614636355159347015610072051134745970667489005) + (zL 186604952332277358620662145382547098235222189576267428112781120186393981156046764372123255960680111653146984812449614957398770239372853867076089278713676794172464148815973564622306314141589755227936879053797982849122462435727500465995642980061375640852443945957413997342102803106043833492333773627243275824526890927157481937516672075220673677291074493590856556331336625837849934237244696167020931698874389998364069808976160868765304223108794657538832801733549873395751634260919744407578994274061012684905349559495904203025667268434041433838686108215623045937695411296234156923486666520305077352652981972844355613382483425177862575506110994424908737882586325613336917711146065273655769936093672253683897649008959710221937495426767351126032302303338255475626527251682630123181065073340186702845870493053611046905227576065532881577911141500103291199480628975163196473224222056330345741031370875325053189054547735201812606945038)) + (zN 32 (zL 167812196049194895390639149520094325879570493307147386032579422474336469213803151946303835690627351862889808463241447927697004674125401496697600266008255028234085178495518176665692796223814481446257780526948519563956043213538530674965877950489356665472988700819612056302464239830449102910517849778396802218029154914871876582148124937747793489082391705122537229542079958557832159163353165644769682936417718135386352047926864624766494384250724421793633163111144830869449496447714560626419807582387126911128690270004914243506190164944510255161448840212296467430211147934414599560675630618345579883613193173072400301479412305115823255088110254592373310302314105632643574380850305166281934111957111553716691733491833365438950511954105999542966946229039930363278889998311662034934073943831894477427278149579451917186274231450244185850087491264244530241446884805482698875099076001653903111534228406109693226597866651512669502899980) + (zN 32 (zL 641850578040997115485763502958528448836526863965038488438819378137059396166554990053186488283547530231813361077801392912062509877936041948193422952165706191257478231476542760429316191633868622188020063635380682538834550178488179191236054064307595360041257698990016306915691333942768987359220154960337533790635075430001692960286354732950347078991622518045933963648197733172357760601583335210572452476958905023209168362850055633560055187608252301151332872961961415152274266398015360279947568376045699516608118740593052805087999437886992990613058364656334375713177658482472581557367294443888789099535303774751706835798404766619961934172718255130415338478767197046107047334895865630178175809353459552351795640340571231208897472378029057735019012155189935579376471600634340707569466295889054574322462618021995789214556923003463339168230367769293101605824744719188479868818588397837883355052092541186993960153974614) + (zL 147866269508865197903556419151689164289206790622689347143078401872973295077629254428648402789719746125172889264542427751864012367847088643406167217319850002647268338073028361846674191114592259525824431194504661493213870977457948234638938889862645552070929894841196625619319762961255409343173861257042372599980705478987917962218523149067290719335837446115260272296331985965056082700090972866827284934227384476355094697553242258352020686847909831761129671461705468305896864174387051061160911180440627592530942883814523419695257796150772144190393060914263667618192765212893832426201851294567929064317739630527352490366920769001674888152128013320823290478342319555490688412221182196291935072568896371911453991903542833750220183637497636340513840144774478173586040674097681827104828031406176105084074796203909643963790630238516838418523716438336905905622709911249227044490867635647467441702982668029861636346195249119111631931207))))) + (zN 128 (zN 64 (zN 32 (zL 200612326137155614913366189671758729273267830991845212207855533762355471553665491943576840823296194531757753459973114958629178421110061880549841611053989196369828203389005548989909541114888412030016980013499644087125565694932786798296350577747028183687391749928672974693373270975244249601106242526675990702954202192340245165803901228624479469594498768562241600798482198628301702521503523739955069146916307217870640673990784010237200814745867624611057324897339183316737956939163192114996028397002517759292144230383145845742617445815156303869901291603768039897424922268638775872714518207370928665462793953497821279784734801586926065309514832838909461628903023547077419163312561371673686365460016812712211497097729405445840911972387750443066022199747077407456775527264301173956637392719118931478203061667422296205016952831986735521376024497254962807631008085249882056523586219214196018915608464298426766412756184586368997066586) + (zL 184299048725122848695148915875384964178501603548621263883960551097343979497923428324506475805984155596841859181085736548348449570707779952219755459947788028416585035733225645080605892693878495797734806947385450595382998407629548607757201573999299964133713423223816622949845380696424283407791179482089809030240238417308087057013557888864620424578516660845559431329914267771435300157611913202606209522583792677912014725065656134141236971277070214799620360147891242910269801059225952045813682273925436482333263293382560005327306309462329179492924748979853540057457810802473643608273779109959707888654679669485851348000298850963547290393766246413666770859893186834348858431720916071656267598473633321828911907923325483842860449333678424613157089781914753635345035866304505841489633195542117342174467496617624691496821541868050829251386058745524445412131746472027664201953139849422265668531666232762792285826658171239448333453198)) + (zN 32 (zL 149285025322635123566700719971583768754547902135635775757736216369828796634500725939429725256810386249513493006210535536806804553671759494689162041412056990849234739415078813086973160722641213278052355780132554703479262559344390965843367964581260227576150834615129171671518432788649906492717543775884984216106128382364958286395615023307307559064970146090878653427000315808053687284569874743243170404971447167065456988382332810105622052179647946144292246352320215345576410591508664594238337309719255664849375785489858319459028598839302628496326765685002541395646602417145182706363449988841008945786421403512134829023997100616369543823461726635377251000886813305097339733800944941995699988870562355560092061660297587841259072887353221000985143884621660616196402582973315660659111333720719412087285552114422593062633277783133219293799795770269405576976470721114115747295854766243408507804679505970591262624064672390086619826166) + (zL 36880276486756598933504571663176032658109511550609658441046574508100823059368681013969617789616157316951199890184053738331504178341375158642343005669579927931708409608089271884328183155217730125373849198245106402582667054880382079200086621263841033926935752542153041370966218134012132918448462082797283259743254213977974960423049951234499924129807008950054033413046102615844896108171874934663308888299082491112094716360694066732503782743430183514942782382331162286543931313568452797695382371662052087922521579750809844457678385779834248968191459449701171128435774231451712980154187642500756850418541654414101315774897180497877164754758174416521672103351571463244634722642647250939633155057990547386874205266209895353216464401759208875601276765795541079233557894827515614993425962561165572379555336443942056048977721870183339022706971037275200381793801103951733698911814673218924932069935295650248583924123573157923032401943))) + (zN 64 (zN 32 (zL 140685790709792703474390042228652865681500413997945844380646569326836905710774904916024238467779952589498817886154545124888090140905959056388212638373275464889243303818326892231873524421997538560461345408489185484506553223271424546593722915112203749965968633253840564750084536505600483351548793448814874904130850017815328566606204763000160384255689012922065423765064028585312706720869082567987945061727077024491257053166178929785174518105082173510794217817409264677511773400580402265919943965220593351412983765698547174777438605603076427814075771154066080731986668065543592332462521843211592896147027405361812070508236987890864253994428751275600548862474375687243833068385353521826794633427222788602984873064034109468467847412019507187703834825726468840937674802994496305386982162373318888395507092593836155387691775943987178754107479080885050513787290678290742118930243754794705473888851333135498231354278519417715630933489) + (zL 194050374177078487694976964324305827737172549484454090303162017414790821411498113825499503438798491823248627045959459372035987744326336469889494041585772065655984513776079954900549073385255654952295504980656592967567098795108593225986629481966849302288098385113987215584925765564599839174416723434211013687528957939021262524669963704382032406303516317927935407401732900878947296476174812152257071732290560175349851596875000366751222643161663302532762122735957232475907017288903662065166316981265251385689755341756771966912353373323319919239439132724346961874416065157887661643761527839264258885414738986363143345474692999218769065318677814133941835694500190429067015820401764678161110755700675909986161680084707758652112071768865947106046615893814404260264824476887401858457008982772013862653185527460803276876277113944463240559538585413920609490551249519087279436749217968134068818349250946816484073314172305725731956131918)) + (zN 32 (zL 196354646483143245120073889484192037156150462733288625875045960195068465821340682361798516977229024463057866807881652777704252830303855112172666375753378070737748673121274967579298062706680088212958567288496446222876917817130077203867748623734650224915822817607118391125074784572506097661472050280901821587182816215046561097900033949286257123983862561481519042666968389766233443756323950843208134514349398253758334350902303546442928708572611996176781490306104151061692843013572999471515191646038320040746668486950816645684280636891829114348228544195055023806605527334054753509231485038939978917206785234963603293138861684029243006797642712938318637441141894761004696816503638429526508584256542065434658689352774121642900133028341055362604951756163893175152288848455559835599435822448003616941786626904869021554074865750662689886802274052324450725446461157887895065672549685068343476583406871375001917061453651309432620255305) + (zN 32 (zL 198307408573378222944109953234452222434988272007754021541811009000599090099308635068128750518858266706108471722208725295754321828648788864862318370117563795112853416155723929330370849921485416625731687301341214615473056441266126566008171500407484860502471935713216212517110606876423611252015049077760291990289959623459056496617863461000630951192636018110038060504245511941533300311761110333095019472376396105013954894187106517883814314498207058329622480509231494748870903229225981984274278691095638932127673770553258194766259099430373661954095982906819763162431709167084449372101966309399992134070460696337617096439710848346271204584786258587471141366107434427113037864593634418544610267804601630251565443623850939372024774933039867312254089421404823048803850520793466890073153641819875295286989808633508341709705032624652398991586949332203056145633555708225889996665036796001014120676447813824035176269054380485781324499098) + (zL 1464473609155663647131233775137993328352044625214321977129402408764906292585379697198686805338840728490501052304716785730518623002800254049660260001998200938032857802382599666556658941709673661430114966354425088886678857379743842362676792730201923089765746689480139100576903364277510175129165955827416673365863583418699643215617473054630530598410354454969307523070464948970871390864303167138833650163215022992990391610945406710244530565799025162301875367570700257539413007939644328957152525089306572838799623331955446468801667194214857908197568973843332340231441136393450824438588671802787736118007227452247403722454882081029269545769247305325750120592593135208634)))))))) +def delta_tree : ListTree := (zLN 1152 (zLN 576 (zLN 256 (zLN 128 (zLN 64 (zLL 1188259999914470156573060210473172667226947056892786236310810462620918322305921607746302434724585128200830407425396069492173879508792131734101203964963506880825978295690987142806491789666416333926765666282228270726232680721762097333121241347595250443554790810802394156929741403570886764055227654141798378978794540390112719632361295572112684221273025546976696396793305758588401237564455302443537952789901358211229720730489193947886012148309584108506271233081344 0x52c53653850d51c50d51950b51a50b5174f34fe4f34fc4f24fd4f24fb4de4e74de4e64c84d14c84d04c76034d34af4bc4af4b94ad4ba4ad4b749b4a549b4a335634332e31d31056f55a5425294c548447245e44e44202902301d01b01601501201101000f00e00d00c00b00a009008007006005004002001000) + (zLL 0x209800209600209400209200209000208e00208c00208a00208800208600408200208000207e00407a00407600407200406e00306b00406700306400306100305e00305b00405700405300404f00404b00404700404300403f00103e00103d00103c00303900303600103500203300103200203000202e00102d00102c00202a00302700202500302200301f00301c00201a00301700201500201300201100300e00100d00200b003008001007001006001005001004001003002001001000 0x10f1181011090f50fa0ea0ef0e20e651f5225025054ea4ed4d44d74bf4c24ae4bb5f65fe4dc60f4a84ab49a4a45e55ef4894925d25dc4774815be5c946246f5a85b54aa4b15f545145b59459f49749d5e348648b5d043357058f42255b57f3d85065216263c54f050a6203c34ee50461f3b14db4f161837d4aa4b15f536949749d5e335848648b5d027a26a26454459360f52b58360351e5075f55014ef5e34da5d05bc4be4d660e4744795bc4c160245045359344444658343443757143243642342655c42142540c4113f53fa3ac4d660e39b39939e3954c16022292172051f51e954654f551)) + (zLN 64 (zLL 0x109f00109e00109d00109c00109b00109a00109900509400508f00208d00308a00208800208600208400507f00207d00507800507300506e00506900506400206200505d00505800205600205400504f00104e00504900104800304500304200303f00303c00303900303600303300303000502b00102a00302700302400302100301e00201c00201a00201800201600201400201200201000200e00200c00100b00100a001009001008002006001005001004001003001002001001001000 0xa208505204904203d03752b53e55863263450c51b5715f65fe50251155c5e55ef4ea4f54d44e04bf4cb4aa4b14bd5f55ff4a84b349a4a24c95e55ee49749d4a65e35f14894914b05d25db48648b4935d05df47748049c5be5c84825cc46246b48a5a85b245145847859459c43e57a42e56640f41241b54655041c3f83fb40552c5374063de3e13ec3dc3e03ea3dc3e03e73c73ca3d33c63c93d23c63c93d03b43b63be39c39f3a739a3b24c64dc60f3a938238539038038438e38038438b36d37037834534a31f3223123153013052ff3042ef2f42ed2f32d62df2c12c82a729529327f26826f25023d22b15814a143) + (zLL 0x309000108f00308c00108b00308800308500308200208000207e00207c00207a00207800207600207400207200207000206e00206c00106b00106a00106900106800106700106600106500006500006500006500006500605f00605900605300404f00204d00604700404300204100203f00203d00603700203500203300203100202f00402b00402700402300401f00401b00401700301400401000200e00400a001009001008001007001006001005001004001003001002001001001000 0x36c36f37737935b35d36436534834b35333233534032032332b2692802192201f71fc1eb1ef1da1e01d81df1c91cf1c71ce1b11bb19c1a51481500a709b09a09608e08807b50c51b52554062c62e50751d52353a62b62d4ef5005065216246265465505d25dc5d25db4da4e94ee50461d61f52c5375be5c95be5c85a85b55a85b24ac4c14d260060260b59459f59459c4a75f256f57a40f41241a4353f83fb4044243de3e13e94103c73ca3d13f93b43b63bd3df39c39f3a63c83a84d260b38238538d3b538138f36d37037639d3002ee18217116f15e13011f1110b2))) + (zLN 128 (zLN 64 (zLL 0xa300509e00209c00409800109700409300408f00108e00108d00308a00108900108800108700308400108300308000107f00307c00307900307600307300307000306d00306a00306700106600106500306200206000305d00305a00305700105600105500105400105300105200105100105000104f00104e00104d00104c00704500504000303d00303a00203800203600702f00702800402400402000401c00401800401400301100200f00100e00100d007006004002001001001000 0x42d42f4455655673d93f13e65155346233c43e45125326223ce4f951661b3b03b236c36f37535430c2fb2d92e03132e82c42c93022d02ad2b12f12ab2b02f02ab2b02dc29729c2db29629b2da29629b2c62822882c526b2702ae2772762552592992542612532582982532582852412462841d91c81070f90ee0ed0e50e40dc0d40a35b65f060061061d63364554455656d63863a5a65b35b45a65b05b34995f34885e146046446c46d5a65b35b446046446946c5a65b05b345945a59d59e45745959b59d44b44c58c58d43f44057b57c42f43056756844858a5ad3f740a3ed3d43af3c14d94ec4ff61761c3984c44e8614392391) + (zLL 1786484528471025000227530326941979358932102183971605492391486166306196576117812893382535067528405713267627890193072453977840074717481376336898724318854695879134092100457555032975230877832743721680844021985448752302374393286113571082915661362654754718274274089939562790980743281705365550038089035188210541086861348908410408110522836466366310528567914585953395710028918658085228430713444162486477949716821233981011412505580336443433812690357794161269748304707584 0x57157b57c55c5675684705b854655041d41e55255340740853953b3ee3f03dd3eb3f33d53d73bf3c23aa3ad39339637f37b37e35b35d36338334834b35236e33233533c35c3203233283492d92e03032c42c92f22c32d42ad2b12de29729c2c72822882af27d29126b27029a26725525928725f24124626e24c23914915f10310a04303e03903503202e0280225a05dd5f360561562b62d63f58e5ca5e160760c6246266395085205276256275934965e24944985e05e45834834875cd5d15714765ce5f04714755b95bd55c45d4615a35a744a44b46358b58c43d43f45257957b)) + (zLN 64 (zLL 0x108400108300108200307f00707800007800207600007600207400207200207000007000206e00106d00406900006900006900506400006400006400306100106000105f00305c00105b00305800105700205500105400105300105200105100105000304d00304a00304700304400304100203f00203d00203b00203900203700203500203300203100202f00202d00102c00202a00202800202600202400202200202000201e00101d00101c00501700501200700b005006003003003000 0x7203402d57d5ce61f4c34c44d64e860c60e61459b59d58b58c4855cf57957b56556755a54655055255340d54356b57e6403894b55fc37a36b3734a05ec35a36148f5d93172a82bd2b42942b329f27e24024528322e23326c21c22125620920d2431f81fd2301b41bc19f1a618818f1861b818618d1731791721a317217816116714b15115213613c13513b13416413413a1231290d90ef0d10e606e5f84f050350a61e6204db4eb4f16166184d84d94ec4ff61561761c4c64d54dc60d60f59359d59e58358c58d) + (zLN 64 (zLL 0x306f00406b00406700406300206100405d00005d00005d00405900005900405500005500405100404d00004d00404900104800304500404100403d00203b00203900203700203500203300103200103100103000302d00102c00102b00102a00202800102700202500102400202200202000201e00201c00201a00101900101800201600101500201300101200101100101000100f00100e00100d00100c00100b00100a001009001008001007001006001005001004001003002001001000 0x50652162649449e5e05e748348c5cd5d447147b5b95c155a56645d4665a35ab44d5905915b64415805815a043156c56e58e3cc4f651461a3b94e24f861234735047e5c633033433d33e33033433a33d32932a32732931a31b30d30e2fc2fd2b82a326024024526d2271e11d01b41de1bd19f1cd1a71881ba1731a416118c15c16b14b17715314713616613d12314f12a11a0dd0d50cc0cb0c10c00b30aa0a409c09809708a082080092078) + (zLL 0x407d00707600307300207100007100306e00006e00406a00006a00406600705f00405b00205900305600305300305000704900304600903d00303a00003a00303700103600103500303200302f00302c00302900302600202400202200202000201e00201c00101b00101a00101900101800101700101600101500101400101300101200101100101000100f00100e00100d00100c00100b00100a001009000009001008000008000008000008000008000008000008003005003002002000 0x4734955bb5de46146a46e5a75b15ba5dd45f5a55cb55255d44f5925b741d42755255d4074135395473f641f52a55656a56d63a3ee3fe51f52f3db41f3d33d53e33be3bf3cb3a73aa3b73bb3cf4e44fa50e52d6133903933a138138c3b34ae4b84dd4df5f65fd37837b3872ac2b92bf28025222e23325721c22124420920d2321f81fd21f19e1af1ed12212811411910610b0f80fd0ec0f10c80bb0ac09d08f08d08107f07507406906806002b02401e01c0180170135695ba6175545a460e4b25f7))))) + (zLN 256 (zLN 128 (zLN 64 (zLL 13648253333911384930179495527889267620065210937436040464617959135428172520323627522598581088128176423944350824359905764980392150830860488944912213902672132885768825026359844054424022170661099515087803916853520852538053820997855397762265730635209612151228838055488961086916397126880428606883314743542951600201740247890721527809981141060416817607406641734920841981639482672173699202733452322262250984483926435339697368397863531346376466987191335857545380102144 0x53c59160258358c58d5905915b64db4f14f951661861b4ee50461f3da3f25085245276273db50953c63336836636a35535934234632d33131931a33330b30d3212fa2fc31425c23f24922d2371f11831981db1941b71701ca1931b517e1a215d1b512214e0da0de0d20d60c90cd0bc0c20bf08908408b07c06f06505b02702101a0145e85fa4f050a515534620623) + (zLL 1191995346419323811390284439662894364199196868725308142460240228007083695546852729285653114587135345547534013758088100150086857856066333306960450717669756649720093190338729480364459439772490987215071941347618539496081395605113548702175154898209709479742253216327334229797365172190725539551732099473258229705983825519177942580599499929360974278188121640652567340862041355425610847095637924413771785022835756823191897201685640025077077382362738555072448097681408 0x1fe22f1fe21e1f021d1e220a1d11f915f0ad0b609e09105f05504c0445d55ea61c5235815f550656e5e351053354c62a6354ae4b84c04dd4df5f65fd60145c4604645a25a45a65ca48f5d942055755957d64540b53f54156963f3f45265285546393da3ef34a3543412e92ea2d72d12d22ba2bc2a42a628f29229e27827b28b26226524e25124d21b19017a13e11413910612610c0f81170ec1080bd0c5067030)) + (zLN 64 (zLL 0x8900008900008900308600508100507c00607600007600007600207400207200207000206e00106d00006d00b06200006200006200006200206000205e00005e00105d00005d00005d00005d00205b00305800005800405400205200105100204f00204d00204b00204900004900004900004900004900004900004900004900f03a00303700203500802d00202b00202900202700402300202100002100501c00301900401500001500401100400d004009000009001008004004004000 0x4ee5595d04f751553462362f4e34f951661b62857157b57c5805815a04d260b45459644758543857343a3dd3e840a40e50c51853e5455555586343c53d63b13c035728c2a025428128618718e19a1dd1331740d10ae0b409f0a507707d05605d5a15d65de5f460661161662862c62e63163b63e6406435c25d76144a15ed4c64dc4e44fa50e52d60f6134905da47f5c746a5b152c53753953b52c53743c5785875986433ae3af3c135d36436636a31531a31b31c30530d30e30f2f42fc2fd2fe22520720c20e24220720c20e231) + (zLL 1785909865172757137280101884470169235971641799070380324256428982876772068953646780867884263030227834773313384231536183890322089874799967292798479194820532966000858578425305083116835879621562760832994031198081113447193926454794388110114668656710982703746779808330176077195246932230477873662792422538456882707712106084712245238157640558291743287108238584315461904972555553313469719184495902877077857872586928600885296281311393381351595126593639258755373996179456 0x27527829a25e26228724b24e26e23c23a23e22822c21621a2042081be1ec1b21a81dc1911cb17b1b61681a117d1a015418a16a18913f17512c1631051370af0b806405a05104a04804102d58f5c35cb5e25f960860d62162562762a63563863a63d64664857f5ad5b75cf5e95fb60161961e62062362f63263463764164460b4d94ec4ff61761c4c44e861440153354c62a3ab4d560d3973983ac36f37737a39b4c76033753862c22eb2aa2eb1f020b1e21fb1d11ee14216212b12116212f14c11314c11e1370f61150f60fb0eb0eb0f00e30e70db0df0d30d7092))) + (zLN 128 (zLN 64 (zLL 0x208a00208800008800108700108600008600008600008600408200108100108000207e00007e00107d00707600007600007600007600207400207200207000506b00406700506200505d00205b00505600005600205400105300005300105200105100105000204e00004e00204c00004c00004c00004c00004c00004c00104b00404700404300703c00703500203300303000302d00602700002700302400402000301d00301a00301700301400301100300e00300b005006003003003000 0x7907e06c07106a0615ac5c460b6475ff5f14b45fb42a3a53bc4cf4e54f450f60a34436732f35631e3432e02e92ea2ec3132d730430a30c2c92d12d22d53022b12ba2bc2c02f12a92be29b2a32a92bb2da2202272150e30db0d307608206b0705df4d95415bc61c4c45285a66144ce4e44fa50e52d61362159359d59e5a25a45a65ca5395474435825a151c51f52f42c43956457558863d36436637134b35335535935335535e34034234d33133b33f32b32d3372e72e93032cf2d12f22b72ba2de29c2a42a62aa2db2a22a42c728e28f2af) + (zLL 1192426343893022095972797125210121312021791712024460858014473478368020902516557538509568883280833046660068425671816940527069332552513284573173932271011496967566895982133057240671575075232895742649469311375393373972798323941756166980506261707760507333658961419903045627880077879222398349440383144014525510688196348725635325248399244451269891963635805442723268646685669878429881386927833591133456776175965315467293505225220155391905899305487453821306308747329536 0x42855f4155494005313a33bb4cd4e450e60961323323a23e26c16c17f18b05703c03602f5cc4b14bd54356b57857a57e5875985ff64064355c56756856c56e58e47d5c45d35e84685ae5bf5d54565995a95c23e55133f152353a62d33433d33e34134c47a5c032232932a32c33033426f27727c2642761ef1f01f421d1e01e21e820a1cf1d11d71f91351601651101240ca0ce0c70de0be0c30b00b50a00a609409908608c)) + (zLN 64 (zLL 611011102537958209265848532682447858008925498089792242798187281234118222355355167260055553990009108277524864712688490457771328557416608716952776815675934195407404821310628876267546466675183335898560428149206197420506016386978775100517628856781966949325311238905495348510070436407037119187024298823441342162729875756742019501255900860702676846565779862853029104563754506729476940660024470310286701681301196488856789781571607969954373006806087220157527734878208 0x4173f33f53fa40640952552953853d54062e3d03e24012ac2d42d82dd2a92b02b82be2cc2f025826026629825426126a24a26d17917b1851b611c14e0e70e80df0e00d70d80730935865995f163c5b35b45b849f5eb60648d5d85f947c5c55e941942954e56157663733534034234630828828f2922a52c527027827b2902ae22a1be1de1a81cd19d1c51911ba1851c51fa17b1a416818c15417713f16612c14f11b14d10d1380ff1250fe0f311602603856b5985bb5eb61861b5975ae5ff64249d4a652a55656456656a56d5755885f163a63d4a94ae4bb5f45f65fe4ae4b84cf4dd4df4e54f450f5f65fd60a) + (zLN 64 (zLL 0x107f00107e00007e00007e00007e00007e00007e00007e00007e00007e00007e00407a00507500207300207100206f00206d00306a00306700306400605e00005e00005e00005e00005e00505900005900305600305300005300305000304d00304a00404600404200403e00403a00203800003800203600003600003600003600103500103400103300103200103100103000102f00102e00202c00202a00202800202600202400002400601e00601800701100f002000002000002002000 0x3a03345746559b5aa38138c39439b3b336a37435936234635133133b3244545963164475853064385732c22eb2f32f92fb30725926226527929923823a25722622824421421623220820f21320220421f1bc1be1c61ec1b21df1e11e61a61a81b01dc18f19119b1cb18419910a10c0ca0be0b00a009408607906c06206605805e04f05404d05304604b5565885a55d860f61353e5765925c560360a4b64cf4e54f450f60a61948b49350c51853e54554e5555585615765d05df63463747e5c6) + (zLL 0x6c00206a00006a00206800206600306300006300206100006100305e00005e00505900505400504f00004f00604900604300304000004000004000004000004000004000203e00203c00203a00003a00303700203500003500003500003500003500802d00302a00802200801a00001a00001a00001a00401600001600001600201400301100400d00000d00000d00000d00000d005008002006000006000006000006000006003003002001000001000001000001000001000001001000 0xce0d00c30c60b50b90a80b40b70200315745896364495895955ac64743b57758459764242b56357258663c3b63be3bf3c23c53d639f3a73aa3ad3b13c03894b55fc21823b2062291f621711911b14d0a60a954655055255355755957d64551253262252c53753953b53f54156963f50d51c51f52252652855463932332b32d33127428d24524d28322122822c25617817a1841921cc1431520ba0cf0d60a90cf03f)))))) + (zLN 576 (zLN 256 (zLN 128 (zLN 64 (zLL 0x306500206300106200006200106100106000105f00105e00005e00305b00d04e00004e00504900504400004400004400b03900003900303600003600003600003600003600003600103500003500303200203000202e00202c00202a00202800202600002600002600002600002600002600202400102300002300002300002300002300302000002000501b00001b00001b00701400001400001400001400001400001400201200101100101000400c00200a006004000004000004004000 0xa50a80b10820a206602c02602501f56057763046446c46d47050851e52452753354c5b862762a3bd3cb3cd3df3e63a63b73ba3c83ce38c3a03a54b84ca4cf4df4f45fd60460a2fa3063261e412214a14e13114e11b13910e13910d1260ff1170f310806306705d45559a5c33c93d23d43da3ef38539039339639a3ab3b231132e2f72bd20c20e2152422122311fc1fe20320720c22f15015315b1a0) + (zLL 1785191430851622815984892198045313134470402426640031773549122970565308981587963101881487640922856912049726701493665114473987920462120816181620686438006873596619415630037906904363825315851092927837394242902819989470164708093585993850300310677869273640745386751473713555216099151792567486098619229381758658564947151655724466450313063228460381401141112310918640024989815471792641202366679159782567102810149894956534745462393944891620082087913054881723142069288960 0x10b10d1380f00f21150670784f651461a4e24f861249149e4a14b05db5e75ed3ca3d33d53d73db48550953c5cf63338c3a04b84ca4df5fd6043573882ea2ec2f52d22d52e12bc2c02ca2ac2d42d82dd2df2e62e82f61871af1b31b918418d1901991aa1cc13a13e1461890f70fc12406205804f0465255625825af5f65fd5fe6044f34fe50250550953c63344644b44c44d58358c58d5905915b63e13ec3ee3f03f44965265285545e263939e3a93ae3af3c13734a05ec34f3392a62aa2b22952b427328c16716817c1a11b715115416918a1a2)) + (zLN 64 (zLL 0x209500009500209300109200009200908900408500508000407c01506700f05800005800005800605200005200005200005200304f00204d00004d00204b00004b00204900204700704000004000004000503b00303800003800003800203600203400003400103300003300203100003100003100003100003100003100e02300d01600001600a00c00000c00000c00000c00000c00000c00000c00000c00000c004008000008000008002006002004002002000002000002000002002000 0x8c09505905f04a50854c57059a5e55ee5ef5f25f75145c65fc61a49749d4a65e35f146947a5b05c03dd3e840a40e41141941c42950c51853e54254554e5515555585615766346373da3e03ea3ed3f240148850852452753354c5e162762a38d3a13a43b53bb3cf2a12c62cc23e24722c23421a22220820f19d1c51ce1d01d51e31fa13c13f15517518b15916d1760fb0fe10211510708b0904ae4b84bb4c74ca4cf4df4f45f65fd5fe60360460a45345945a45c46046459359d59e5a25a45a65ca43743f44044157157b57c5805815a020d21621a2431f320b1e71fb1d61ee12812b) + (zLL 0x8a00008a00008a00208800008800108700008700008700008700008700008700208500008500b07a01406600306300206100b05600305300604d00304a00304700304400004400004400004400004400004400004400004400004400004400004400004400004400104300104200104100104000004000004000a03600e02800002800602200102100002100601b00001b00001b00101a00001a00701300500e00000e00000e00000e00300b00000b003008000008003005003002002000 0x7d08307001902a4f053455b58a5d25db5dc5e05e45e75ed4794824f24fb52552953553853d54054b5615625765bc5cc62e6316376414675af5d64a05ec40341642953554b56156257663163764145045359338438e3923973983ac34436737232f35635f31e34334e05e04e04503f42642f43043155c56756856c56e58e40d43643c43e54356b56f57857a57e58759864064336c36f37537c38138f41731531a31b31c31f3222e42bf2c12c32c82d02d32d424624e2512632841001261270f41171180e91081090ab0c50cd0990a1))) + (zLN 128 (zLN 64 (zLL 0x105200105100005100204f00204d00204b00004b00004b00204900004900004900004900004900004900804100004100004100004100403d00403900003900503400003400003400003400003400203200003200203000202e00102d00202b00002b00002b00002b00002b00002b00002b00002b00102a00002a00002a00002a00002a00002a00002a00002a00902100002100901800001800900f00100e00000e00000e00000e00300b00000b003008003005000005000005004001001000 0x2242111c41de1ad1cd1971ba07e0874f854a5635b05c05ec6126294145485606303ff53054a62932733633d33e34122b2391ea2051d62001d31811a40534a24b25655735995a95c25ee5f74c14cd4d24e450e60260960b6133e83fd41651852e54b56263163b4022e72f53182cf2e13092b72ca2f81fd204208230198) + (zLL 2368761975170093846782712507354094846476900310446758061513143672972699792035316314228084356003958002073829538839082356375716116205587412140835138472735126502042144088105823490594315701434571151066586176433629679465833730001126515938650552515629424150674489341222496548619220475244468370558578245574915339472912375129652049728000676468820874018984482157956578257967850877466483048490383877392253607943672647593137819886429649485098494185327852885717535986548736 0x25425d26128622a25b1871af1b31b91bb1bd1c31d21ed0b64964ae4b84bb4ca4cc4df5e25f65fd5fe60460837638738a39d3a53bc30031d32528e29d2af2b427528929a29f4b84ca4cf4df4e14f45fd60460a6113fc32733636045746548e59b5aa5d75e65f81711941b715716c17418b1201391121260fd0ff1251041170f710805005504704c04004402037037837b37e38138c39439b3b325226427625d274286)) + (zLN 64 (zLL 1187828967374679182303707749525171972573270441936940282623644726843797542808434684321167208664101094593443628933234317151197548646923455452588314416409932674609340736750845102476461246948896186693603047857790799213492290585870431540300938008523889277944726390824580178350897451691111802196087090092763174456770744496958107920259277649510531027770223112627352169431162473712733465145241375342164708539720997911190194542782240473411710242049366886268127986843648 0x1971d417219a19e1a31ae1af1ed12912c1401631760f10f31160e10fa10709b05411111a4b55fc3f641f42542c42e43952a55655a56456656a56d57558863a63d41843954d55e57457558863663d6461801a31aa4db5165435785be5c85c95cd5d15d45da51852e54b56263163b33c34d351375386) + (zLN 64 (zLL 14942227605804289849422635321174080326313761509660377119017266912098193067742050290291127651191050851107685346345193122871822996142255674507125445569064844047553060346599857721595885859676990515014288171903132445399355062096636194477571018668491246245064419346468874185057976705844991222742236692190602313277332886608629372475424955706749765065424381321291781185427317304032913477670612643142536276391625916689862389095558601084656023739840928037627427291136 0x3c63c93d03f33fa4034064094164294994f24fb52552953553853d54054b5615625765f362e6316376413f145045352353a59362d31f32232932a32c33033421823b2482062292351f62172231ef1f01f41f71fc21d4b84ca4df5fd6042ab2b02dc2eb25e27128c2a023323a23e24f26c1c14c64fa52a5645a85b25b55b95bd5c15c741241b41d41e42054655055255355755957d6451c41f21ad1e5) + (zLL 0x7000007000007000007000007000007000007000007000007000007000406c00506700006700506200006200006200006200206000006000006000006000006000006000006000105f00005f00205d00005d00d05000005000704900604300004300004300004300004300403f00003f00003f00003f00003f00003f00003f00003f00003f00603900403500003500b02a00102900902000002000002000002000002000002000401c00001c00001c00001c00101b00101a00d00d00d000 0x28e29d2b42e227528929f2a72cb20120e21521e24212012e04b03b04346b47b47f51952f5315635725865b25c15c763c32833733b3633713743832ac2b62b92bf2dd2e312812b13317445045352353a59362d4565995a95c235d36436636a36c36f37537c38138f39b4022bf2c32c82ce2d02d32d42e32f614415916517604a01949149e4a154f55d55f5895955ac5db5e75ed64748048c4905365475495775845975c85d45da642))))) + (zLN 256 (zLN 128 (zLN 64 (zLL 0x406200006200006200006200006200305f00105e00005e00005e00005e00005e00005e01204c00004c00804400004400004400404000004000004000004000e03200003200003200003200003200003200003200003200003200003200003200103100902800302500002500502000301d00001d00001d00001d00001d00001d00001d00001d00001d00c01100001100001100101000001000001000001000001000001000300d00300a004006000006000006000006000006004002002000 0x24b25a27428d0e70e81070784ae4b84dd4df4e550c51854554e59459c59f5a35a75ab5b15f65fd30130530b30d30e30f3163391f71fc1fe21e38d3a13a43bb3cf42d4384454565655735995a95c20133e83fd41651852e54b56263163b31132e33820120e21e2312361d91f51ff45746546946c48e59b5aa5b05b35d75e65f82cd16e18c19415a17717e13513b14416509c0b80c20c407107a) + (zLL 8763615298616784007559485466910161244738038352898197349766611314658631239591852227159686407594425822267689436875658340367366859757695765877760329141185960849014124742724425568683540274294589919047006133195119712614577255244032764493412599368766611410171778142664428754265684106233465965936944292762531721401639883599704430466530452189724370576157597747872723800637784658865167370011489818435626826026142692288442917597971895903016125393825042752323207561216 0x4495895955ac6473fb40540740840b52c53753953b53f54156963f14516c17f0f62a22ab2b02b22dc2e52eb3071861b81c51fa11911b12d14d1650f60fb0fe08f08121422224a26d1801a31aa11211d10410f0f71010700762b53fc)) + (zLN 64 (zLL 12642767892433767066142349215388600538050390844036838921628333670975166682351554723420430795659304908029788312495527335410301684473723206627392249089516848180364103165711266923559690930497378008142445652731799128924870792116324691369829966539695499741555705757622542038800505179071701390472871857901127863668552813243035351174660267213384161020002859944810392664486636583553458882997496469935614540872357175476530575199048477597086439603215278340117681405952 0x42b56357258663c30b31632133943d4474524685795855ae5bf5d518718e19619a1b91c01dd16e1941bf1db15a17e1821a91ca04504a05a34834b35235335535935e36236836e3a217219a1a31a51a71ac1ae1c01d21dd0a00a60a705c0520491f31fe20320720b20c22f36337137438338c3a03a53b83e73fc5170eb1070430d90ea0ef) + (zLL 1191276947164284269884535857384656457403944979342973286161826747933896455549775180312280461518791431382088879425487989023394016407461765377149454687560422407204722058764886638027689424004300446377889071835959237028224195452544013827162257607272771198622921287505177489321409742161320697710075845078952415260147031127304699827697861754952175637469144521609436644058990461366718898325006952441265739121872980799876554919968574370558364547251722608974463229755392 0xaf0b81ea20521010413114e37638738a3a53bc4a34b34b64cf4e54f450f60a6191ab42342d4384564b94cb4ce4e44fa50e52d5655735995a95c261362131932432732934f35235e36236e20220f2382472574e453254d57558859b5aa5b05b35d75d95e65f860961362263d64645846646a4fc50b51151351754454d55655e56d57457558859c5ab5b163663863a63d64606606d07303403d))) + (zLN 128 (zLN 64 (zLL 0x2c00002c00002c00002c00002c00202a00002a00002a00002a00002a00002a00002a00002a00002a00002a00002a00002a00002a00002a00002a00f01b00001b00001b00001b00001b00001b00001b00001b00001b00001b00001b00001b00001b00201900001900001900001900001900001900001900001900001900001900001900001900001900001900501400001400700d00000d00000d007006000006000006000006000006000006000006000006000006003003000003003000 0x3f05135235e36236e37248048c49049c49f5c85d45da5eb6061951b843b5775845976421da1e01e21e71e820a21117317917b1811b61c21e313215916d0e30e70e8) + (zLL 19825883790313380213823098269403315602850014785700235999379095628133464817373098229028001428196440517747442473842016217783119098037988960003954652048193921606528547238123638028882701073070535757163574802144249272585123040542087576572188025133116994096866933211415210624904779170248298536900087674286577280130783771567858591344696582206226717299458226215796241619274759168521585214483548426232207676950987071680723234148444287315989694383733478212654512209920 0x4221c22122622822c23423c25627240f41a4274284494a34b34b64cf4e54f450f54f55d55f5895955ac60a6196470db0df0e03a63b73ba3ce3d83ff45f48448d4d04e04e34f950651652153054a5a55cb5d85f961b62662862923824725d27428628a49a4a24c94cf4f24fb53556157658b59359659b59d5c45d35e55e85ee60a6376410f71201394b84ca51852e54b5625795855ae5bf5d55fd60463163b3c73d13dc3e03e33e53e741841f4394b44fc50b51151351754454d55655e56d5745755885fb63663863a63d6460eb0f5)) + (zLN 64 (zLL 0x7500007500007500507000007000007000007000007000007000007000007000007000007000007000007000007000007000007000007000007000007000007000007001705900005900005900005900005901404500004500004500004500004501303200003200003200003200003200003200003200003200003200103101301e00001e00001e007017000017000017000017000017000017000017000017000017001016000016000016000016000016000016000016000016016000 0x12014415615917644444a45445745947d4e64f54f751553454856058b59659b59d5c45d35e862362f63034834b35235335535935e36236836c36f37537737a38138638c38f3a03a23b43bd3cb3cd3e641449f4e64f54f75155345485605eb60662362f63003a36337137438c3a03a53b840441341542443b5365475495775845976421f31fe21e22422623424405f43443d4474684d04e04e34f950651652153054a5795855ae5bf5d561b626628629) + (zLN 64 (zLL 9769276070589201844492541176227720731839124721254799958900085780413346471881216140193576921992090545249286970876893711237213348851883770107132422346412838878485304119917535826578412794809057620500160985853464247387343635645093991674891126872473612558181981887279619898534166480353880497379928041191138188940024843843079055653085728501231919721770047155042224550672109978396997115557270134656647594645112865661032218050638820114919517492120839965028317659136 0x3f840441341543b49149e4a14b04b84ca4cf4df4e14f45365475495775845975db5e75ed5fd60460a61164205805e0780553de3e13e93ec3ee3f03f43fe40042b50d51951c51f52252652852f53155456357258663963c10610b10d11211c1381410eb112126) + (zLL 0 0))))))) +def chunk202_tree : NatTree := (zN 2048 (zN 1024 (zN 512 (zN 256 (zN 128 (zN 64 (zN 32 (zN 16 (zL 86569875409751505596332289774784063856109606867475736687503555479691022265833455095118400876367883065840680122873946611501200647753307160050913385447002503770409907765480852601924764739726696109987299660500686485405531136833619933452803251658037109321261014802035265567730150019643799892739168249494615597984751906661172912936631179823430100054371620163166886602339788777036889777799753294042878804761350506274378435936022518269508778996497958732053213631097750378092132159859138043077317744036049304773448185779763271739534909081697839170400829383955264678447859316379805238406723663845229828884805712468192206159726559855851603325660620220062699843660459310155272620082144606609459339881155660066086709089973131148442781379077668478645865878674528136684119861201585198771085213411758662495101915626848230575247117495740739097552401940044840793394670235075517031716275798534067008755106840889290077087766619940192257) + (zL 482643183345352537513238876913565268631687178375433063700748464394130598871613541651866219877465934611495310228431234472976616040830519550286072720437851225298302249599433452115020111025476591519758747737528203826924147436783209951154178986508105089353868917173622247653422608316664138886017587012283412245124976493671947407490437287017408966567036248533779545725077368521812618854621301974908578417965189328530540255035960107330130097865523132711110868520058808295776903437396915154831424509722580035119520678532599336541596076109989746605039842071966448269263799733143937434434413080481281149336837882461299651388433160903027648332151858149164006303921437881818153775277912428524609035491194267711456485596305181932387423706570873426497440004421307944147877948296543030425780441342993691460652961534866729189129875801896723984222408019083433184810934178429607906833590456121167920821568706775389472956185720703296618148874204020995316038793436927426673377280)) + (zN 16 (zL 2775646630325157648182404040904014047386514270188440807543082747988472821146268891797647149457454107697090995806257077951490335262370199099750160044964472765886611925719347241782468747796261367425381983512519698032877465107757632982991756649503777027552087591297378186598439434712176288392299058042064868362811367273918303618538092310258541730411749565039182371065861434524525760180506506456864287256879372474670268573532584830035516065494016659943619817568988098176130771445624816893178390846611337060726921845209080417567672142040484979059193570397859469888465360535599327498515481302766057251064622529409590692562573814154853744400374042366371450227522239859129485826452792843481635828770852998309901082199436983751835840942357106244546772131370617357334559281741541801203321854667043826481448688379906066315022440714796341279862350844351812756533379731877332999878935349514363372961048486143394943478105169702420480) + (zL 209313115167340341134082289158825843710390661792545886075283943962417786606745162527600286903819954450316617225376633128734210254602207292468607576048770762802806024330801397104541966728073896292536746479826289494891535814618059445066714404891214400481261451505590200452003537654038669862343504747469745659680166216675368059970210766771605991676238016551358812437296234100299715844129889029472147979931919059341561650592341796430235237692887895905135283163192145771530280306216277732896702047815569569918851874446752020492401724406776141602944662090167948425710851938648604360895727987261133577636001984435344163017365767092453512982363488947866124777924316563134239937620817801314051599516584714579693091952717079973956890487797113373789320501824685473844198388627163735966611590511145119684097225171130970587556556569512788443356149645735643150207195395962453937868500227393341440053066433104932794620308767507888557049387434988925643390976))) + (zN 32 (zN 16 (zL 877221131932951076983819064884182342045715058284305489937567912967443329406124384232786784950862299313285050977302325739225237822076135828908362868450527716479287792655277301638628340327778291446804555817808555119117684108382361343042949420776428297892538175370840324512160376504664066023502397548688662387728755611844307558761762413889865018391982634672702198802418828185942372855662842930572951794523523487009728002310965641867644980842735544410833354455902023380936671294848695193379505702314166317550439952188018450906631728988138102871889164130634351395539478113386220128876532447668533272339314622690529585477088012123069241191178497745872317690275825137764202291018213646588161142113069457074789443259648134270880994856783686986064215875759813402195588578070537363755611893070063085289553980401959399020716943212404604174880255777217479497317724430563772343874767047162922838999456899216574851161759848144918630926500092706816) + (zL 1061343584310077963371506764839706589639394312558405975815283908622076585725009536562532292000010480322492168172285394603452139175310173719652459001802433308517377292958488959741042566313082798493623739536001067792049427731486301094233383939967534671318414667306507859955105348035260784625198169675193697815510341619199339982689104593337874244760055866568640111328875836076962470657890448519999713162175718731069686625733602150211157182437414269426676591661905028158327041642591671502849641513311482343948976646800563409421208787769674037828168873621676243093559229713499500824411196314501256940512025202682569589662741910778149757510929073318067571546324535236240156465113917046014829555237149864006565315196014035584913837855381105154233390567651437671912444151280244825446880056716349040551645099949905260661996644059780882237547525215264928460476493803165738564216178306599346422962960528767348098326250993751445792043202099326792138559970458245242191151160287425462272)) + (zN 16 (zL 126522014654884095593870492149629653780185003688049525050769005450138491432362424713938470371108011736118811435079901460374078274580869129292080000981366861571563559089872942769397359484677025395699275194288543398794345946323045196953333275087912178793633010525768867935808825403021569398097944947404168523145730586128255484433891664695370324854806404982686461165141176991829548869411852553435263148402977985105621576186518284867212898803348633184100108697722926371271536957999939881687361183324335048941991936304649376639792282611905124145730493488963618403801525236773073636982952662066447656422797268256837374685612680485925564766149950227900763459330606797760167621643242017245843516190149888085714593504199395611792086269930843023950576145125278543416372730999670770600857559298191560768607431093725181893071266194256494709634984485658332528838162838200220098383978041732229704807015538555726519283628986459146127578630163419651925031525188203587942953326223360) + (zL 102303477786313938933579610055826420690432327896799176377740827667493945677194459561912092843473375356289363127675697988640774803003882273469944500550841295051931873805045033704969533537099859570057506239475901671492509757060322415141137389012772790885440914661769227052177025069396018562619881731517655051872854871374630243886288355347914647729337336389833150703557513007410230734212868624051580318007421952727610162913589800359749666794409077321203583570925175961159005504111867908268835925396972487977992557773904489835184561931541757227293816972846417451184584556395050107347576928341885427683511708854562844218311706856100646659559896309550030483518514352482890778257293221649872452102126667233047177766542885486660588388267818378264646171941735432561892944231443861057911901922379461867815201301378600467192277249179320853125781020862456495861200914461176323748193706909986914226415358835093021740436225858673600715047895798699261952)))) + (zN 64 (zN 32 (zN 16 (zL 3511691344795345048720183526992079486311465577276489520596430989055997075938692675425740092705362460891911189469312415878909187864649389005173502309399537106506337074098432682612243808772199405398575334853043809145717717894292102341325875813427848996237261982554566816304708856621422216619134341995487933840303454677553255379696778241353344181130421664010546330508718036310365749667868690279299021913909954076091224780659086499046346482050475372105927804788835318207172894502182469746265678372475327830409518340992685136966016543699235409018691709913569795118592243578326384280638576458089905641127971857064628764717150720835266039908330709796443613096287179102786286273510469150462589926241596376951915805612928550397545571340124353025729281234043914504458519706160590599746043108031140356737323631870529454378341706838017926573203718502719468597669077394965939893228682899232873274697887294413504280728328755871128939965235991920033947986568413184) + (zL 18219170110303309765517350869546670144346640531079131607310736784860114523972359427951328207872113662860775712753752272570165684389290843583402724305427331928932109204902087886105141714042702850469856554627746939379459237729738163708388731316554644679681335942388968097171178654272076571429168954731153491549475919807750578556052391929955493917568006434447173638430019714057090515400036599442328139503487888828469235225105720857980036932139602842411503556428943395817034815031478434379733104270871014531181251384209477102677651983679131628514467173592656533491141395074950529342921746757194957268987612228126586167707047878145964437845033967217595388658742696109379520745655204217004633848755211129307359743514159728455087456507061045691291562613693369284037995063379997216099105261111591881651894790602157563830575180041061753944343758422862011332907608107223539501033840859939967008662788561084175505455085248381741290632745047815827288602431783975455017493719941120)) + (zN 16 (zL 33201400997676064829361119067937215226381027927803204165722599984552114190559882261347579466911861279907915347473417047164862666839904606322827480843074036228780418524141784039087681470776052422663215689537185753633211708573180790470932209795077746686970753565971975695462021713779638428153565220932589022183865299035232168736747186825310216299620406939698637298639624362544672520657628621317137245306462305137088341630392758440994254296926119721282301277517825587289080864870259935746429904264446539201303666839474065994933744242621068955173307398775697104766033597607539214850485689277876569914640739987986578658133690042105107902925308116060455202562994138848257648442055466790872796413959807471478818058166490016451673449779636372267595988318233378498602924282579718807673030027707850795745720568675814524321051535367041182790250947788113627444302323662189334902070369859645768863350215077757290070816231427327791100505127573962095712479605469473550365287552850591744) + (zL 29517535645442651988397697516866032090508969155659841771331383064234139645267892454247074926202183919183072211217727356307805810241986651862202958204359218394507471631692963026540951007797435404239479555452283706885844860800750165920892941553541722124752549086855705935270656676181974987121086856970037751124094740806038504570421182261681846113345207335537246813427015032132241200240305790274904470377328010572006951911390255932498623080515240632083675993301610479338388202190977576579760573956368324356789883727477142854893202910846075586938055268250227935321579349968719412300711251052943120714733614640474418446390266903203279543302916825971071912086108589553525279625386999198721824108083297870920441885074516899886529210523163341166947095396210133800405658476117201621903794424173585943048580500157559135226896662249997870364822418987701429349508755157319617537917635293205448662662431179658333273209105307572868662911249114936589376816041169380179968))) + (zN 32 (zN 16 (zL 190479574463968234420873192604388850612707490603407028791979664683984957565118714504061090419892096782769540823242072449752460276263454806499884450538166826981931804679851115949143556343262702433961108490450522131286609935455653218006943590873612735336884940878684083294700274402724154351592855421263760705470505791481232245379280036377639674736331140074655984342374118575306297422996699484297192640340813762032927196750470549335296070197937892541827234810821161562910191581178538775181062809165788910169734224607704741781825145029088721017354238852045790296220844864451271659025313078736637795698210208142247184980747311113078294762518951384306208580852552418343324183382216454685598816072450886992631700564521256970819533463400777268820347173095497265681529685697848824179735366942675996221121537736326377910106397341356197402545763966711153774228714506118691479154246094442586526032359845213804872328559012108095160399809216512) + (zL 32389635751650328472030845990305191367727360944140678412996865395272697155890830172554262402514958941901359214458425325797902378561366786359785248244456165809739707555102948222986821316284978013218549804144787179177012832417008500198392591842771284544573880987067092653546087986542345677932029926469897115799945750324887966177072347149796297637868890013443976549681450971495245857301942249547106460642946260485850451884748512228356655681458764927736541849414144660048586903943956081305857898653395995874143675321368276022555394251543538308392777777610141136768245706676321373922199572072897589534411391138491370828916771019698815455044281367054475634007519420452901962220418813729281036856320713250278130649501275405503307503534676394302135220824736051268162399766537897182421965105643846061880319577436575049319047171508225626030023437683033525348044807649004180134628199246404292733936391799216750342677958258055975765308765926275386662305803865554889964144570662912)) + (zN 16 (zL 2073948864222860094974725107316729284764792580454507815308532688977276861991797013532009398484935203120425187528054295572908837905802465549361373652398706657725724821042617112215033951083778125619690829851101169981711103165792067480338867085435684349147286426758364737326979114074026096245990588953897612275832149422613345233439167767638126964000326559469413193112502339384491474689745893530437665548408734461517451036654996015901060458025540053095419452688668540944172097674113976825823302498697365422816895621933633291004809616895779160219660491619883760003772998585232743596131936069862632052414819585061027553632309581790331079818649328981687565045132223808511535991648822528519178978563005504774833072720499928135312840692309654511729630200729998976317547960719606648803246854568239864766852578571564234165234768805832427959738276042504581081626002921943888584080204620810952028030865753528537524227951677799805230949012152961139948936769426074294902903996185313280) + (zL 7191943927777354018342234455496192640791843848876960353677557272135821776200304858038292417464582220119086749712352923856734669903617729759326370750688392220456720101450450241063320497166663245442222387013644851604606018769258570104425719088511908899316622664756724711942337452845463243795664610162088499630051759908189458473678941246436584004741444466327170498128842898162704174711085625765739170660397737590154487840617515070848422616433288079791535725130854109835458379430211751298774787277769822843022881973649294087756092751401628088178993164065536952214257500705918701761206477515951004696371200850388143641133051958554068140125023545463993743303820577130580293505030873210272657140461973854545396401929937032544024812836955865466521849437553825044297791240281577275816221751200986147304891858703202379248400297669662593058721973059654335233346754635001566774875921751120005105903250281286230691504009150420564735743035622907726235676953976766464))))) + (zN 128 (zN 64 (zN 32 (zN 16 (zL 27629331202088925029698862168965011369771567356616056961937480602530335834612600669401585082747584104259544976865061486688773173343209045453821053056565933732451197945789378889949989238562401094258259989777115666140938711030625925349716712142886781486471200373974290230249129992167027482717923395683071672667329860503533113925147893043737476695188969128953044649906741612214995939689757800131347954484943988435745235703364883430235535440948833161701339119969206935069449210579311535417392678714771065376604754001704751352342619295667675460434396758022675565259191733349030359678363959022209057792671209024892117627900736028468635298738021356899331804365915939178466897078156566012501336969301709329729100012963116564950314048883720214542630943967317592781163682749770929667833451942487785074443035020739756605358094942465101183839585288931093216917942276005436634099016634332125469860812975264862874415970200272732865424507672039587070630428672) + (zL 15082657015093259924221993135035820882970528051284301338652694965405411038780879647639953669886582011589422222144150503501023746041685302097124372354401884043628344196985177940188527618594500233549434598518318295047484383373465263513080273041030943177229930283099385895690153516338062962364254651567235534873502415262394076847437119694576932850349174251966974064644154719291780294328951616117052020946988664709100696902362670971493077421616563300058933105642759641485348725987250051941699947365105353618702857793605998281406444092464756139083172076997699947128100221341190239953195595750433581479154280878496297037040600575576242071568936790357273029861419809415318253332568901913835419758147463672424177097285183159449161513531938957306026744760545438790778332534348707878557918553321361280556212117886864681217341527439231056751251658465141685539783109136502035514017775896663633856981542449728649263425773602159647846374678968774585255552806248503268343808)) + (zN 16 (zL 33253653391770797087191140809738928535017019026794240648314129128471592712887805452772645793291348939030639347478820549137074839918258462889904146103461347143960946264018962187844093000635387788521928189276761088048997548384448311222016844345836175610265452666076459516227619092673302713694045574486088547647235259683380632295270182559599537677075609857351269891167459589999400779702771366493653030374583595009474363970562907396287887923615566394754487364089282208859845011916855129936146073272168005840812007829806033100442761485726043853425631283394740606197162703772054332388695887335427650937556706142087200635945971772729119453652304769586042614489129202708306481327476542752105120095331124578201383850373736427600490346733837623454383513374333115666752021721832208702698979989689559881678323437694440838873724530938052562268612805085672942667813014969860821014917766612613973616551231816839542868172162747548565504) + (zL 209313115947092458407816579811109456940774965833181493439111046129144763071121174406964643886360132035071759229514994462903894677755464653237360111528234892936002901214648547214672154724227593313452950406856521911635872691571990629651495383167164201112802327330060603305387306706754092477660627125123015173118704940403980530580181350160631086575235499943644852415744690415460895230360614240080351491385394609727594978948821715031148868595268415904949278265442816301959085178282481641419100185683563091626444535774539101754350529648173769261982805939124239135814918013041212800155714340108198100958800051814484407683366554114189215099159321504771358817068828629777039542894109800298932465030217103202403219686024147912983662357889551062680253104937601356667093519309064819996597061271632485854971386757105434694234542043027463768581624758752843467800004237732116278317646794126860482635875312244104536048517561657850499691584241506899424444416))) + (zN 32 (zN 16 (zL 112374123033457628904932601371033974053931468759448199948696810002474566855212123544926410575869594815872852310089466308977331198588512564449188418112551995876315362547275560249600061102006085296169984276325406645179233237681377506193549119764211709078071623033787951371509348136769020322287762305318125821066403363438735118160395436773012125190031649206237084695010753250287021867450961302175678735452641014531340498420207494209772784834474473731640720646404908400097350421311110183894141918302037237740606574479809788416045429820201906471625299539805108418518448612474588669316487029587908666638578319604375117727460627589829352628052404411138635605692649409090121601568084075116124102553146291470545134528257710254443712771917553710535320963149659338954245714830068908796123514474048494590183709395876118889909623339662287205015878110910056684905820242761425766613777117763603149370063764982124032540893522826086720746787687991531657035525113511936) + (zL 518234172086735653470662603034037921497833433685211751904878979286341596747425447188105180743006794606442970293158587507346824099556451265955908670769903176801901761506715918224433138053004012391518648848728790118830878038948540229557588690053219728594364502435358184812566693130734828765712082725182974736645710004091454406494788783404995799500773755075963029345627041555408550847655987329170024695007545194122925912825751067561466983662391863595398080767169541706423006139244574674462719022330731615903155877752320471920862102471600418848276611090675916658874551451732333717896764212883516851132785147405490482439882302835587941220137582480431556280879670920179395195668326699325674916256670639266636160625310458055899934334929244495197230427396902430258272197511388946873107407947313305094510854329620675427801594543240239574372001193000417539462963166452427460878573570435050496771130197020896442990303613039102334189813015259820857379839306135270293282080247775232)) + (zN 16 (zL 126811340932253182025877377601915455931265385120195864170219273536465320245802720843037890275437863348749360304536445108583327455478249910933276660387279004316419563367604604741002419854840879895160737526250646375725796571984507151807212870901985243848034962122304324322921179506004457798309272150407607470459178556307482768686479167261268354664445214855925806574339290990275783356624369855026048877670299065094654876378970803208927892131436075842907088977111427851876018251561917711160792268229426222693831865905430212280153147671935630462513948707326972078962186134174211597963344175297089115464530992071546996634996406315110603948880771605692243705356754797591206874091992865310811166721453392745637409476050549903535928780849358026225253074790415512405450413746546859812991065839145662930406833170382132128363775421969361908297637227417297438208439678855315414048457951760131269008545299974277172235807456493568) + (zL 27901701585948702995803883638962383788497115869364552592634042465981261793944765332088917017364587188076491829306885744989203865446673834172106203187059256264914529542593604047841463781555388981562135764666051978775616770569731627504841714023701190179794136807778701893964311800419045212727802056141384779984764685308907945558349109278044001034876368272668047446001714918709387399948976478571628631146909933379608390321269902547531865098442222595699103058333423501831260871139621983313199230774163471377598491416821567716894048968267553368174520652790485989680019756794862216349493904581818914884063853794851127807759470507550231085174208949593759486532650384240874170493963553839756523632483654600505050505689656716135923558082870476974576896022949460666678244354806020903092765747387737356474946949733756495132006816494464411564726406178644035056401529558673723855054890256300047028008530924040698986920723040505681066352054363529225961472)))) + (zN 64 (zN 32 (zN 16 (zL 942662692219637741732627799563552892789351144198314648235853662691360884181377136964056156426553781644425150683796972140754282277442346212004588277539952996445944246635812684283239602069073995528138064329070005770579466470962797055111082661677207023668809918429011717243604737796276543007027422063006849006321711244838233568952604587455287772286222914838417118932826362948268135143272846780983168781573222042000363159462667400205732985738925044456603484182390061334878882076014985576365880650565532309059527272181229622559744103279016486216963634409484787896925441467621165755909640420530454064991591565516654582722032435613379536738239056685462789506135073929011446143589076588763311235373512183103076130533756004927403204809444204782587783243175534657114345636855012472466871706220933532548531849167011815772866088773431441159883592704800370646995485724922843519488923234742386080064001664141431622187412052690012805678132065917587692212829272346273513472) + (zL 116583078309947834998294879864914448450027551563787881526254359243977471390974929657632593455865723132397774873578885578237843782134870980858123469881994445871205567138732554881537645160835920288822771382232450467989153262676437126672194811745408740431573220699583993745656723324273085919293506807203671040903900099151799887977436032443662723714673638571611389380004174561820689330580420059124480981985030212588276909665292123332768554196575824780053731793375663247859659225280239743253946560870172235477953446231805515114027977847933287448652436694534748588941329562791108525045108962569875618191348480076315049216592375404804769924353377378224336448628522938863511765464833548472067254405007637121575578686354297305014295659070814182023260444710824350154985655953548946202233453658700738738397132694434442738514307026992214705355312333803822977189918471492079234153649187937089012356176385334375948643205043626890486731170837446344572928)) + (zN 16 (zL 133473420883893776336634670861616435202134175821151679392373130793886770769641387380781296379928653233989321262610555208116379279019744898055045959811179054648628445273332003108167286106543458877235750822308850592296412790802502243082840571254487752354005070415909039450888615949122301447654817450054863335558427479185208457929282084228733578617543276426531073153769010058630715948458907396767646539746230845938735216449249603712918624436545277938545420942497194794383024895893377197768039368324855416559543456790660816230511648482850071098752975511682187983786435809092493550342000988384501671126436049551307935510716479437239037223286428597068458627798410932205059307330074915325302465286872631036208987657083343952455040141907577542452188854158514315745651181085861006467306994469373967603747123131048982431988456750973578951445057517887981163843255679954488162337757161508379180221139219022268680420479479286458175183794098646708512994795102142464) + (zL 1012178530455019158309567426368124833737137117919595490231511946458165644121651734171111050476376013454774080006620807183001442346999008009871596103064205903683214088260130922500037828972891709888491418240926418987341651326553344397869075481997761316060266590576133056276343340744096716170545274005290978580564689975120600825632170325115557469068343538081537729397905335174938604704040745552814074290584858330072977888976861348262321002680338341118382567102504729394943727666440793751006091427602158863194204062695654717310903004283734827620077166818532283999615149912816237814375784422206330449944723273031138742951003715972536540000320205003207508900521620006157064763531205533397841974222337581050991163227246265566036069718235894109783166268606545955656842189075406821362166974704591663661020646785224265227491197274963496191071417622847848667289928504253333591679357953119055432295750035449614617957436721489885056978957954206137219971928838560394189494561013760))) + (zN 32 (zN 16 (zL 267408832765625111865086664495959659931957091954825440977702131103611811229992940325836000132115710010263854849646993532951963090425672340231982332913656429641625871383793316670884751674070116656351296720820852001023359346769601668191479369952510886943005811332729687723167149878322703984810112958986814459957302101770415039117661076209465460380594813993106817930652674621592605758138049090950959329805134778867193912443695100615926352894144353478601176829424141487724096047077304238502538369557530826154501849214966269929040476741894627801503993185785336069986695954543836574028226987385051318905585359112768172120413254006847880973193575016711892462968669831048731980194358150063247258521839078465859568981805562368580388733262427613329433347154851375922127250745363424244046449309393254064244740100653659686169861942387319391643814878368853118763993326864198238923111668112087423341562711473079291697621932060769597892491720153345206303886859080751971498746771033554944) + (zL 3236647692140511035980296208149393840163511401689821044164518910747437493548765536460226488638560225477069936125615155690176846452573852814407033896220390278672762622405719009678657191468349983964714244322866412112911266177893267473566237839713123372897517288755271251220763998198381675024481107846293959324164148599352891682136253982811931949039894899737098304919697234862113908776589407654457974915003703316852003359615608739815398339519890216758876592359673366459483241406193755346800020921555217246597986146111953457334075011277006878452693860385842929327691912786294329179445771998123702932874876797189432197832910243375869249786045480519069931669293610760162012076901331707640983011645644837101905859350503541565696692551467036880609484359330032751798254344162355854169517609915729641455140383147318237122128688679055701445163176901826309191298499944457966833272646780452393912853149582584196446476478060142267488928876726272)) + (zN 16 (zL 28767775503313814603262469457604454598694854141775359241728611742547529643243206132905164140733199070937853242950378872108105305151643681825281412580867077244143878972889146203106650270569719607329454964035991643745771763195946796759208739258379076110595046161824818303376034015504291396956129624003840205139879274991515188249482786854611986103614968555068252377272574261613484386847753708941498037616232168764279298567191011441850488543456850968614034451282442975256014233615455584722947251038095032075490457452728222659011146177662425706028895280143215906438163521197565556925008085686655281910262452047659326396462151318609576433844854791190381844951871784340894752298623743968077347478644680440198071797088900817105373788098349573252874454109032552319933262152850249504962784107823319585370814619798901869527168978014983142128842296080357057901421676196537891582103696669778625966344991865256255128275593809850047252069147205497046806925417434316800) + (zL 16583493504844968177679793147036257980276408803400027347454395082359937233062695294066301798915142308856698773574179433225363289914977393041591243053528825747797971891473539482356379685731090032007163276201649584337725998496556867583768247752099444686536077205407015759499101540356170103605565390400783914005441605560317911999779083272845407125399316352982397054987317853164352135541030680422751575372559710960302464639222502524425684291636990310247508836799349354444578972460400782262429818294524475505814087164163513359614188327631264462627159695967596592722198570684501638189987241280088452806551450313283088054768129824908790402256177234602500201347263371423441370231177975579099784668144882137587665833727015163475010525509621178580965107565302945731968449423339120740871811398843963542115959972810663689243458504605675816800568825950439016785985628789964582244932315719776926921442328396053445715922214051704119650124852441990634451668186468683101644884521022128128)))))) + (zN 256 (zN 128 (zN 64 (zN 32 (zN 16 (zL 1600051344645702764418485974348748591891384266310573213646123755703000401883983601944532348277170705416862458451821467417095908488784027896121563205029929228623317112067393987790878692717547681510174062680246326596526620263215424625604840024765883617623335309651473416954439623076719504061675165185896036820626709905386474707001169641759531763919711635208859787130817744248517336353832626441435104918748067352939989806840687426619539246394570374261657882064427701734477900664468723332689808645113179805747847891283911169746895498637058446445153576212483988049465965986498970368891830222467860738148850549611964009403875243325592033464085371999311477340306166108310883102294466936917182684047915824066280238579092177711315287278341607742887146018223350960540806707849671516501750519177524444819711584067416135213352449637237425259604370762376875571299935307114833093655046552381086490972586987966560393349581185810927429182625269407547392) + (zL 249910553586231840154056898040338169445023712160106586244435995956832511807336276412904126915914024844022417317411795911810407254232642881698172629044014749773570596820284718315143192336866477344375911530654863596710403908299813356813792821508361961564530001638651430481750119262472939135875371719734792378558654388037229303641953265821903657885259615801277478014923592256881554510430321806109318527116810782757754375708414013470086886026079034181614280002870571067844891941494945092086623085288730802187445584492805937635211052792508344234846501593143064708361206663913326446609879758432457356472409831719509494566357825621379905619834768464397615306708247403712427810994985363147972578479817832132186932028085376431590258042757481207721027123909787238027719299468673192564487440691750272854186288050121838280086708355873969067087045170300230268676358252333359056064156636305519584322704248388654828406959750818361962579062197495791616)) + (zN 16 (zL 58923596167694892701372229826132836060960872394736699864939096618066589994859156834389398588107770599366723021409210329868663796927065002955179060183263253112264413644970708242930295491324388774663569577044089182896911887263152217375233533293590431881525443469013566246845169328650196512864739097398818746484834134514160630897604088520358496088025441183485667379612242258649699451221914249359269037280627334798832822885677532597651120435768344838891089662357690628831329571533480092922391814732470361044974681364163561403709409309769217698667908817242803792765168489614834751580870903965626970457167729510803152089540079673286692770424829602578150642787014528812455534595670058604460112440564842610977167062015784974437254764619547318020495706259076318694564346985765929617492978922586273731986811701645505078599818913775298511934333657823862462190374075554730310471490509907143740231111738745854120899324261220262829531594016659044113171449495192673976320) + (zL 1934343383251295716754762513095239104967143913945668232510230599956942623054751387201599839899239537398547556966835842440015012519766290447127857679724517698465555409255165085146612515876711557732895981666141113123697461478437535104267037201858683757485791161613080702516045096795833514676751096373538505057025789034743493183444939495971040789358651856092723159339817706672968239624961999174273484002130517200525672719521170546008707290010964997768853398901565726239715929277745800929301739320948906347783263293280197016493744388793934619798492443952811243104839457872442681011476162443770961124186791185882597210007453892614416179365871732757931824593920225049245584216987673094974704564492759691937588826743252644539693166409364988069533548633555719821347009794566172064634245426327373929264004699450860897430112771227370382169795348452252597882701300296937075841192098940725259688432341482146791660713028335279568115116905740339121443741881385043017288646912))) + (zN 32 (zN 16 (zL 64779580395011643699706006341713959603632216869930428029309918958626367481766046527531557060475289699152615217071632461034098651566857909472320080469263260405822906709757926358921873895649160336870309639140262162130697499289234847332662207345973637841851250106383596656416274098373684719570031630791895174872240464135530403821150479631673890842422149609655264268709562421576763599157193133889033307075435652694922286246971527102464171393656547072373416298957248652430351094873950678149913990568502082823180998576915660952264768669737622335967789071267187774781289326130771153941282372981673294865259581600500052020054728946749210692246847756538400644185356720864683107558803319163694931125790648532724701429151046112107410976498810233965435701964279884503120476750129371716214294531704695669881895740544212998200498072526249389185788074074534407300272445683968812886813238301961650874246970298416280913713121694368724627329783780982510762059224515690306212008902524928) + (zL 219480709049709065545011470437004967894466598579780595037276953888897387393974529956735820387234413918312726710910698279391087244976930850116302113116694010696296008400654892517391484771717045569843847426662874816056017231072293943516090254000918533503477067786954179846833248815830395024529737805788055553660716553303399038937558018240984967314967775938953572310990028365963776547343804109870449492811803725929309831739228134031745038698502556625093832687662367237503067265119767921903382365536794051614622475438325142596448769920705919261430270073375573635795780276176143669103881298523694337288829290965177169779228373270086598772176971550016760149619412722231481890654053037647313934791783764890717379872721340549903126618795823822714633728170192756828309030509413644826891311719961305700664348451683678381961274157058628951381406023331413920547370914143754342455984294021806550996516193623088295357378385009265917522807989685939953881336250624)) + (zN 16 (zL 126522014658681441959416869745992931915996726888095510483963473734368712939036062317505451410410456047804892014498258928529847355348341323247734385060944636921309203858044079128538953608413131490790585210417939271345469185910669118478475577053663033958667032365774082792100546095186033031358172664260392741299260380969944085841333414464799788603063956729125667473909579296419393274664418962306620348998810634373606316466272072643355679433663166448262926445626161569983925505923488747768446542156755079201724856861550618078994899202340241349103092579503095648432195770933697240270512551472081863133671751255485774605732571640106152689768516508963671069761311994679661123228805257524355095136752738623916221629167289773136595339954535072783788487546439898330815057508806432349976961369324707211976101713255033575701095049870418300355077748257726183521890519601603559695689800143880607500130452720458442947338247698685865755474148998781599603783150207803621536306298880) + (zL 679996110379084908523933588431964763871910147501525437772059441974403976640730948940275208440982942256288121918318729200688103062417770748941323761085650298785590627344630502518280292785926026485365708745700675064574362051897314983098541212063457910162396804985276314177814182984184818979213719934409174184780709349489546185480267986021168890759821333260383022041073681839757837223089599591153359748501804178530398302021222396919946534860803774478483878136445329005803294176682808398070460492867679064861094975308897838858213454242714720664837859077303845692258265630962211235633514181566925231898618054564912443444156528387503041637311072846043559634900681741639628097539381124883229332743760280346872152870945904606134698691744727843821655247029213473646876543990641856371908277814822262698672244190976179943327792323904748700470952652659314046630807627387766981155914380348181971760209636259970635257979195822265531741359570175940546095279461532067983510068653369327616)))) + (zN 64 (zN 32 (zN 16 (zL 29517565498248468827732315787566815748762805426468289224301379931354998758993034548693467113518842716659293047480415662240129087136509699674363509392777115699741776972173262892473980925451628126308946755074466922931417459548203364146385896845305543329099306529232572484775533129122002845319841071397449495373379174318131615692321151201563893818220549448449922117766871705200679713135939059363530411176119444153571179297065581928930700716229986313868323154855507185309573782340215653615282829732621800424484656365326277384612408099893669651264694989662303569932057006610114864381372914363612396124115221718304136221446696618091237770055071706966836810695465362639633770246792569583609331498391802624185192430308232176546091008951663812428568479523647311641173014161498981966666895311980919965624528347742852581222470530338914266579803509600226697155806283585886134871479595915564339800636644972140865422620066404479942324935026055989900569190379756309188608) + (zL 2122687168620155926743013522820641021475380326835929701223583815340241643273914037660189499452127548370792894126584090599967762001042842921062462048586948126004728350722460775658048031005495484942671319614839298205962508089019083803707842744697707120365787225685239763076262481926197808082178937100763023917176047764196906945561530068808188750636413219131177794341575393098770665226190924439457751055891266445410782227397823618266177492439788032293993695957813125906844357355100870757016434589240969181891871214297095967164347850075305994490548271331773334701055566343765285034045534902454343104220069093362569525363625887776980050338424741880753051829082297410537337115132986238514363399792477459837413848463712993265236028136105317825880114915842330719566579377260378506778750506574980897102862373923052083785179785765416341209402630427327475211750434745328120884814742171992086978413534230646081216004376011558996506252231897408636204623702871692207562590412023554637824)) + (zN 16 (zL 4245374337302090180954232170442976619195697008055262959780380573238154674478345673738512827889584964631080892097280411951373493662617338480562003581814223717907900728309600815463954938960260945028519962881096482478584950762590960784586952046669385665557632798556859398782682086538363330220879360891258045505735004540956046361716577542144528022218899849933243120104950956093576280266189972952209077379695734111604526895179286332920233396451357301803272121704520126035349766449615194450995727615257971506890636330137474960461436829461380084139443696165284169109652271122520177053810381839506706031571897881289762903639984277150711467849495645180649346693716892718052158847489197132926375261492550204072237400980361567191325853890660158894529092896515048121349287587039007875941937277579227245840461468990226669100899440104138886699166847739237242889565158078991912671224042354897055241127273495499276213410007617695640215105905219478152466595214221952557824413228103561641984) + (zL 801776688351247893946648200692515385390482440330840544668201059109007354773354275118602449412337214672518199360283528437166619456361150815279504798373649175886441544815684503103487497024476396754889345100997362921598110621050136820810921384464373899281459266895659654634424808806599168824271133180209912611535007763975470379728754824210322541624935655913968418232439705747491342412189251305948110985156857657691862968729638200125256830571454270582210568302973278289501616007010210746095626905983413560839418016070935623176358581867911841395160138365426906639212817458935866800358801569161737608663850777903403828394285519228242090028061652296574000271044456131926165452450845416096981066698573971963153618728226600600029511904148378921608792797704713232050750455863392318081983760208311456273096432026770769134974119409011823461301939349153813018856169989884161689984412292806909990554335536497177549700030653412534340030562304))) + (zN 32 (zN 16 (zL 1635258715302651199125781811095186300826050277917908848789179669833185263311951403302594527504734739843221785075222280417572255788944267439703690966211406734270465967753882319335255347652741858748995496694719333975242543141475534672320093567218618340933426927776217712781913298148318645570827144998561926204538974974903652476069760248713897457313869425633372292517860224214541219849975377793239584876965501267682946378830899525357429652092385158836766993214173285727081887501504160618085516398490532550607219487852860936009435353829255594608140632044951821919112624226189917258269285445170923059710577537201201644610803232753211310526941403805304304079363765204298060455872505856477932979681025585290975782835713733928417830434011704548004444892953754471137411860005276165958911093839259949143101285895486951928623629376238434882152165803158381382315185766056451970212091904580226843848350962774414587917683424529865361721575743588172562432) + (zL 3429386078926656216893563722879075698974412900538372136893094605020350031652628853328488178495984098265371552171741762237082404098075146215907106081778775717545446486373194685648449917843711372917724963482280553295109101918762703097976417556078756976493374730228236845639608173573240238646934892995740313894745822794769852735579261995360282462242517313289940156300255401530270197895056112897501491885744182958762249302409246500572833615834172957188153458824657998738762914988741307350165566752135954694168829255312350596957226908512239489892542238006138648127007263997810363940429393188714319689414919861598864003337985692366289951312744761399099947914272589648174356336099941701977330727236081584294610976055373511442237008222378938728736647770663048115522358350580883121485583434891214562546910625528403467430386595374677861898179171118160552828666391775073599676986220221622329770769556656133638949427939147120033447323429231153143898265616384)) + (zN 16 (zL 31757921464124200480062462896257643396148543329182981902974826238428612956430980268937330720388196530901668627345053635964759522742619057670236940337346672187163266215926407565725766340815044138740031694820147258234858646638029003823010629962265409295932982949294815378459992191712957175657184537681329786934414146734475404884475543883495746056077748720385227885665601976104874907849099205561250117903791171435723209277292600840799330134223144008013117142723346012683756640761813752510637300544795408560174546965656106782278660753610643447165169981749913364075541934116525946515212010622994938406989187395306060705496826311724020080152998382864134198845365370190212725420957195836252871412869925449980217850883559330153568523166797769923178663414577552133096213081108867468119469558902474860420846968299944547753311167126937654330284931582812996880547132842080140499104600208053393366085364897835738743117579389308816722732974346656472321207985705391677104510205952) + (zL 371814783718810136040923708519914126784206984987102433621699790407352884824000406501988271853223862162950575896371437608474542926116473017303097568404208206511722545209390640550774282492310510019662395575106137155905417163882651855984208174076769786395617450451066587365022779108694422081966832043374138255327332960298416657055562544340200102899032169475961295489063835345411538882845775663966471061246145815433536284397055571041176589883734926926757030903615302285257530627005509641602223263298604156418873158120233134944626850679378686915160390727713629574210908038114397325136890510622126245368424101063516840647979166888039106955827441695821640376823199972248670196844370861468998813997620582635770641389859898347514690130507863458592358600291064795760836252748055950200950971769934615984147017486140552962257938666019577606956817510838420978797199575356248833876218838338916408082609106935165557597525456640850239686705152))))) + (zN 128 (zN 64 (zN 32 (zN 16 (zL 64779580396896968634648791365880768771466648577094897278865662036007546567501191144314965595552824587362156059526590635036855442523955918884856237142609917159919982224496785003637585341775059974905755822873751336323247535156420216207287277682868509172917868712678303235172144504414089085582309497123293744120756783206296842990439953526138536716667042838578798446832484587544113173294602996780943126787007103056420246344571341967310549487793453295659817186207410140275360293762220271242745394747734187082122698536237858044741847680630554060030083084032511720730874048211179896855319180470547043887593921687966637555316790407466363551595626513174418059661849723429956761836825884511216764847172106597617186880386089083312280014730666616171922630946846934358397691994328837618939839097065556733480745877476474084456383399041329494743323064590913468356443286273177696098781567821624109267844404846528173190027503888147399858320638388920683848854426898289010257735905705984) + (zL 60330397918169201986801027381375348927955115580772482454179752448888006819695069386217787901468711651371819118601071755271678275722808357539466691022654572817093221707328267776486719156375515369533176445705487406787265065555781840690392361549153693952882554178526820365377823531730833795011280462762973692799748806401215418198880711714515199049289755975085915570661577877963590674848140480963700184680694046037529207494140220571756458783698388194467472878187766840123957642226918396793848771735881205993939622655944678792721495767633173838706310977872259854893138624316483643400670782714180064171846255241996576857783204514527484621569689516018082471884868456791084972448625322884773238438333362052316144496323408556744675971383476085606144561311732269648835111216773314781022209408206245698421879397760953531988183660713641462880309132913225867049975852335017552201830626116983077133166556660339764084740627555360068329989549838601879138658838445896625029184)) + (zN 16 (zL 1061343584310077963371801750342055477525190957115477536070336695101764533466499178049911793031909004981096376002351007204877337167367115565211807598016048757851148023826612475117566531804536341138707528551568714776799010165873499814144530670831688914899068245179361179356322059069526157633535837418527343160394823045987681839131321371251632536086206243314907522502120814315194071934400578920237319516454764953526774941749586522890393101629064304157663429690279294179632624177548202020930399387585830819184056665162077183364809947937460181936611417760514060909312632730084303095383362570824739024009416495575221225793842942501528445940224008374953835019149091085341464551558135975805618508330160342863594076781111632973597142631811931243025145806332852386273929717418916432892074996828128646394695321033820499783316504521602216191726206713352660201716564667703337342206182357541009856091006298861748760466585549017704308264332850217146776267042022632504379412775610099957760) + (zL 30224115363301495574254338849689817237311638289481918340716754460744918374287125115618623967359814539773804996915761264323948442384247771824418803601816320040942177410185041134144390555248753665870076039667856104387933752461367104477995054887799810811488972541627783068207912559837639713506335373484094208953996835608436896109019871129838596256088172300166926575326011041631761541529517329475267275355213065569081477399136166401435026446654978922797647102372376991929121072046174699510628050703043304326483140470422657362156384984844092324113966212309585918886113991152387557373684837893375011669707427176667188806373652407825481985775804819465014561075874845272960169464557241991239678360642892476654342967481686935845101578857981455458162107930691591349555082334229719237202911350539315637251642551503211020145215016956847160016693620697388013035488377413382277419007309708967750047603622830203386991740429158146536545113192501571622157328364658263054090240))) + (zN 32 (zN 16 (zL 105098839928208096694986157850626439097036231020078108566298631948549835978913346721101661503513739666475268453426713919885457893484207302411113881896061509900019819658384922539844068947215176921274255519480814346572049462120851346515577912532588346894185792818874091184963582748119116145251448644395593628619975167413711860226286489244313641276638808580888749276481140401355351055165220833607891317769273162171077658876392470237117357595125556382717244228743311438203474346635363974957055980313432040402006183323177602786796787192475426053532588358324437028577295566890254945138402180132876016334924438500579312283955325268280390973831664719146399215496503640767568416639893650177933773932165122409593457108870501406476723583134764958297477747231212460750020145740009525049972917645694499312564627832028976500085290250713098542155927730342659786263076789746429577211956346954359853897948318238646870817912739252395594876614564904960) + (zL 4656856318533746582685765916957867982235290013024888197091838943673374278540641139825115734346127147185098587489645158528926413656672353578778089690985663256125556177329724004877777920873801583946319578287443677964322395157729195106627267352187647722536949127699222166492921176924015440590197224966149981388190572126603370526904199549516148049764521818211356081886605402099980099111664162442512538028715094414518836412375264456443487246671844135479257290547947167338597465079285008846126659300597665129537303983664028122961786331526908274769248611539788286315720322240868180943836333054754083882778554722876263447615114993744788936412145875286497591616115353553388334626952723153088746632147625630983283045402979296394720942747135757703588013629915082272932045940675158854250608469347176779164659378189380454988564939532944363065048989215739584325375406688970321297395973632721088811098502392333108712070426975335408780086821584238016372294152778588223723254704653713014784)) + (zN 16 (zL 389876058636867145371054801526992960106447151218429588903596880591000117220090648481723300640015891722291469198210179293643306365972129095070058869206370091133382981988167480720073807461882776115470643443598835098901958740586354939623412276163289706495184640894741452910518220279252772666777737257987920543482546856301370924196400352907337410170292959625378361878770725391576887518856668562006877128435728726615570480065312749299967951851834598441880714833465918393325139059914849154819917504070100115210872084900899523655350335039298258385037131451617218900493373215489520862706926563584913402005155096107804157243920719484882931326763134539257595588350448646428360211867714676809887328958809608619284993674224399147494446015009529366192111088525631830431568024554418572315783422231381194132398604668078753080060253951715426766969284298854944196832828764384148745645972320085578805222789318730073724753221768828495627845662651973632) + (zL 235886069241319095379620079774692405900186352451168275415123100649668733932929100281506109217040151924123987068690609830161736218405035867263837459340951579919550915635737508562719080326095293254607391323852735291541611935254069361963846136023082214835681009672971857578310593357149933116121284364720784610641266054234404110295794140414725016606262301093246280656255422828140973156909812143624288954551968259046658046638825436958511051634907401180702633783759055800344624312209234344714924263889924014474287638720872918953648991630876533103314316825509728060720657222714899745695693716799704322025073181441180440699157835997984524822733400971211562648777568704565984890478390638757182218528033679571917565916908328229986329038477698666843685831730062924149103240858850153571906969974700588039064198539214050370214731977281351344997192612985339612384780652359478868182589956137506214993543248335335746026959575512965291771623876777250660810752)))) + (zN 64 (zN 32 (zN 16 (zL 7191954276172387865451569459897438400982237193334645358171919515414680031838646210146435931647842613800550435370318151741361578924239905007432319738942927155139355692120679524651142938599409028806307653714204777035005456465157087219344752764796131911101878976916103856090219281775528490600728071435475971644941093057557550299686756240233848301777459938771835706707132356081292406197618807717960436427700125536833323145062712949831830789969709257409699167526971484624054283092238905651045570848593304816331492211189681191999675144434136510931887773553349716170179616503933866111319993931974618370929116756663461455650419623876158405432557127656000827003939323578788839103784104051707895373228164125845117671648926209416524968528181545669964842702196708337398972958036641500099519061198685328857309607687625081924341268578693661318894196757003940030736194647549638600554114509540586443982437864565511338684324115353607982123100966109076235176301360578560) + (zL 1674504921338722729072658313270606749683125294340367088602271551890146791908121594311422090939303341795875795515338162326536531567881400056944395975877614671959037515995511267903220679530707887957050045605711368534785191287966930662364381740788516179045873922262777040476082293041927118923847181328571578713543787331347606080363858611574489296442794306457368047126808410480261977741111110506655825721607617607274365721513278668693693038478465622202668565492943716602888892933209934276490242557553961098038591508440798136978674466460884061102272860153638005172022519989487764127042174389428273424216337470666965374204631640113828478655467387541312000752704923352435590104541931270257730525120193357165713330115815880996277703503532255248042420396031577532166638045047818641668350931101944298726128720917963784163236222174075821509997290256444457280990137525940701713107859806727494464828004506126579140189133514321654597540815093483008767819776)) + (zN 16 (zL 33166987009697952783679458669686171953623463779428272985066471759669594938255837579546881538196077175025116170573398020654030833640828788330562612381765153503913449587036669915059713410097891246328938963566120473105699992303203038913475448298164522893028786157167974979669956176199418477679311183101868689744214863874570947293818673437272228241163519577091402749418912583478314000336949772182440828833575415722964273108895499022171962628460190654792748499717274526628297862348135095552357469237954928806411711695715947651705303323620622990440301734499747826863206229246846628900741982487718542797198951905982709063660782663883249677189783059013603752570480126438920044417798067018815094236387201057298135820963911502305577376755454545463151920607588134487276313873751258142197588686056449241535626080495456613908535981312916315410452811608786724614297935240285603919072996319897478037495553348270478671217077180620051302543240177875036885090061046678325199964873361981440) + (zL 1559528094650352555916012662474523986452333861814569519505192930567424065070175968239768621019012172392334242925007543819622291520430596819594793661947986641744879756797256785539279749586937038818943027529484676893050915703068822805921549687690759463397299092026943853686501019766407958262446007261961250875136731833096798176922851453192054866149051418521248452543396562236336447051089410927273513208176591937672805794295526508696095794011544082329643767836627349723599507180622515940056557201956043157667688097693591841800930867030479569010568929182530506617700981829068260861182526161860378374872161363310183864117579481970003715783339217690137860513878638185679687243733423282887573476691709671799187806919481996923392070629143392220285082925866389388073155163238034563865465584490299427999500925040403716020103383310084007658700869278689228242434801112962869414464396081053929443203751921603567517070876397991461581834506777657344))) + (zN 32 (zN 16 (zL 506088066160836122147044040502763731981592697147808748886335713839638506567722984334853345140196126590753799014745707861889369590746797617358661023906107017976603478834472763680038690365906387389039085784796649253391498132141583428187574763793418552482589336379763800813308901747474674400165677000119333419733409084111953131520629954310369435472303405890529601419341688526475743855667649520004546846955389035653618982766767148916346546688395439710695731584566071304318816719882105157863444928361513872287617254761479809106172354702614609349766636328081654649462841659579505167349102366536134207503495073764648349436016557223755189466762554025421336545654778289702438443727181582991755619115579285464131641072447319913423114879568492956756450574611276911977715519299324098590634190185721516307143175801379852531979491041303718691406705978605797606918447011870367785163999323798208404130957587866132523507892074438812020869130286686854174891722346831942025062773686272) + (zL 28093530771444880774653769037646195934213682689272283855778786023503369476943120834393239789860515127180393195940963117435023236740834817539319079593512363743249531472696473831008451871328519877343110660048263808439982018968894070635586670780497936791957835772429411010322353198166435206123260223821782031245036756781386453509387063423271902068142269333752228344802442407671353208632661604033075516162380350781665205046986262930559079035337674452366512937526483079156821536605272956491301187671420854631284716113952328808997271149429492940834923208935061812887750448298561404379845134889688424863249894600825896012405814217825256169240612851297673904304845227593773566883702523387594075660479723574595034078388673834758136074852825200410158688553760841331081307836938942713839144367113403774467091027997230781187534252220505988479487661821272382113898936485018289522684124232967980101124713568430878813799244935347130991658348380719047370339933749504)) + (zN 16 (zL 7249015717265948820228937127201851236023689519974199111034777584063117463874260008178169287891740471443176604821311941303564585071570424940461973569634894519797846995452473068012371375009061599312094445147727935515076074117887021709721312423612418527102823370135350371329110243571713260608007914911687990834395870581624708768103434975339405635588947338734520484046892237204150450753288211417341707004574048702742783190394323859637996765438377814199897884660360423492952214088782412135881044680845710403555597705953041161417819484962733312117191999752774028971757689967402678227449509923777154096430384502015336400115911309610124338255855214987611606832984245935373777953290477651628151459684854014156818174953940977622128610694096311935846921570005656245310411402898396145217290530376841920524447610793010420942782665389690940550612110548254407013221387208169156521219566642464070063290682165199158615183013029320549235896491440780581708823016222228480) + (zL 4175226483611175154597726240937778574746105121705634326675377179873938072884563602097126745842729691963865304974923097469714155152628239884858655118980464917245838159176888788084317653464605489376649460870621752373758519988917986757143515050178793976308420105234007727612521072147217395737624073021232764347247963221597535947760304453865312274160205707191091636500643976740361303172322713465165514046567252688511703506785514839590899956905939895018125060983005079551256076006281037436645502382605699708734075562932348427627446243544268946177434703908077247915912630258238151677032661837106816585715441150359632496283614866046560771624919174417322512475148392958490269837467315095242996559859215102836216893842050487289880042989939990591841931467819933621361772249253686157549272835021990468712771880210703019944253481417015599645109007133821926423143643220249251399241968848080732691155071702320692750423832727645957512409824711767332954727064717085219515775506710544))))))) + (zN 512 (zN 256 (zN 128 (zN 64 (zN 32 (zN 16 (zL 4048704468966419128011380003443162802276117974464055699496031304001616401426044928640049728899324239360255654116691636610142106857915435970401984566851686223434551857987602192561603512494746175455310663723089259601382267656038362340780191298814860704444241655314868200479720349381064605078105708560050634719129693570344885550503968976818030403004310878725253779771953333296642037430432413396802418094508344982558037116350785976199172066034647238841173864864628988736645269112291462592181470469116457433510839499262840656272098441983221735652895191919606510841812129176760147398288527491878122560292607994798239172890072819354931466123253143222221101386410747975117691595373673049318372971720698986191565850848437625417505817888244004349608267925327574609986573324395676775402577646671453101135651636518582613993959463262689928504010014283800846908498127985039222583902749248736546150327244539365320867569751675821101048899173601280872539559667875499671865492078854144) + (zL 1522953399438502022424892629567047279262558896885827202768100830014540865253286791868115773653141579112754826541122767035165979288151703361719672337191848114358199022747890977359547028146514220057492268466885379604146586286596029113759811184937248291597081801962891407520178825811884969388197813468304413384934608901106528153183714374234017025926966681436903064942738227831840990687990168586331325512887247675204231021639654918868449002959072067688686325472559319382866990030184157480867507815894268227340596360691389654773914882748537514504888561737028584712125824368950538484736341062589043917813682410417740838228166452651605847313718986589888007917377115559317382074396128489277161428819023681213919089389458820017590962049869936108811767841362928660508466694501217701554538637663331284854497140605394744275866612363808863938212329097331365936335383926847216931468278174436546423966456765871412490106496231525725901971844497408)) + (zN 16 (zL 1522953354050262286440883863351693472569941456899546302288921814622244467835029314120017373027341505685476839846971040330810637759471794269466809189321362694186084421574348669534261803496224059786868373100852408023954184557331450540902245443911006022693117722477949690989508161738735755518051977583995082857230256283983356556458712853929587994671654914251784283980456806397922957114286952522004978375032376469262488975694228005416095251744389468032131859817230940384547614826594468885981208831600852319287910276088010636356418230796817515630340345922523256818265974041365550641350194887180796134602798404557755815258083428274628078380420921086471991017414322024633556454477643227499702943266146399450816097348106996773085464771765501940932780534576584589220599486270666436001852792127707897481336771459564422017801004496040433667180459056159990580110249362509563679871582987615962685021314504065831409733841966732742916740468441088) + (zL 2802683278999240835266947111252605785347290474336728938246222011865971129919161141973042889341517182166239693547296965655328823024987659793988863497439628792990912912436610048950798847805732671014278688615225460040830836638221070970051144200402801557220134230399459561477552614706411570735618116451235927266051075983602912746081127725218932757844218249870680567627104033053365687349593270133383683223783353774234505407011426989182460122562181109755382457908120240824275068610017220157173048111022541265274268505923961571039089340017704651344193715633581552925658112826555329285828933908569726597352238097078868294649893181922978866905159822190699879927469581206409978195701322932804937013708484622773803923095068106540608716937785913749426290632607806523782869522859585151290456184164567692954769493837393172350443399274523069124218661034994862802373214908386087345221549912780089288804087862497471058324584277414871408450981643872491751966381270154981851573528971815419904))) + (zN 32 (zN 16 (zL 2028306047436110657489236327273750387163590840374043948470140618622457456722402871879877373504587356024937428280325353963127693406639682999213753151456300249879342964881727205277356722799871303144225202878625318305587704778741461724362213242292270432103491311565276498897438251286142127213280112167904842054465818906982148053999888852114582242530866426387981577801608715990791050111724576984894985932293704267466096357957289003797414290566147301765721852843036206406625591070678678948327993920448294637552380534741048809728018708056899086049477780734281767884446008897493030169635107894946524506059419368011494737414838584462940818157972742955154097650678693503264530169932357369505665727228519779527996410206089691073497874743761714781359934948235432408670938522245380964432788312174448757313382650905063475064171058656382444446262497308609666609455755840417769524611888937326226226181653190964518315004097361757954702796630608398541878477498290239369941647089487876) + (zL 15815251832379230901156221526540262471662179506088229834696790501351836672405297340974913650614259741170355969288901324482636680990594524857006175340345919208187522325608691666700046250243158084915850828882868958765821665995928687758060866954483961102859931030261027148585778205961032992547198830494117591151700257027999208495554277989015893820067141664048826041090219524704905581897506113448935705110776668254692017252373817391507647173693952920761555304714978512347578719592443618801240991811584343457103404361693502755752028625172802740390015050475455694617167080670478303197853293623407036819663424833905325212091565824249686952653875488609733363276991646429596437497001710010809928468250052958268125837341754252145417218554086571383504039905588335070548734851194537952270746934505726935973605122398353229733559633146477849227170563767410156904610763294791463965740192334124690833028988396192194436880166576262653959709108853843919200579135458103479488837844992)) + (zN 16 (zL 129558604921732933392999340078538856073600449656390252824565407307520440061647254768775605927842589464946159044290939519744577087921961568229964257844462266867999577671024603910307561892530617529699098833329262152305979767252622459191251819792779253223068680855332810312665553805856739088619706591254108550270189748550401455166960991545131888978288375845366518658548975586446445031716762856934046058235492312080429106730587603330299490753517108135650501484484676051842571809842176079675790398544277829288050427318831667505513000904565712204644406669565757983771091316532808609070524683038063112532583488325316189031308560865783603980338580927322566716355190498650749190285171003115655941496336287659906392237831489157752928773349757569410372715937616385527459002761387220925963407390391738544307418656767338613164613521814279259220963052246251955742081258899563293304728566848871041257414391530581049410793477753484070549192486771020831380021879133711155845214481940480) + (zL 32463703278656814598661274671687270409245618674463712147752174596047402985520085527774454388563412762274196270400821863065361559659887953396122632796839990691643284547678858876550903115578088432248504634736003964087056214900279207756919149511546579976916196316317879333206698817387209647997782169993437471882584220969845351729347479471364027714099415898484043177750275354893580414060365326762917383569454460051846711294033013133265416684266065175191498630943733637115719900471906837859351790119545209868730543293107462902144317003678246180876017222228322366261529254933012033345399603276795670339629406964172584774081130859598909942006096184481403294984901071074187168931917729137200814347286073686628740352241094433326717860764555343536452467584708165678438552065883426467686871872496204622020601175123780354564297175417214443308423873218569082687399182892165241497721643902236595435307065169944826102514349735149568)))) + (zN 64 (zN 32 (zN 16 (zL 7189704397322468556141834182370869318205486005608281663769179635078631116304825395930695805903747678760785694929246947069196994605785617830240988437741080691181250724514205865355914902258885836794624228799820118629216002690572694145220432341438802303715383628687332362243098935472119515845917328685634823640619709483805186850730348457733154741497151727981421592944543684890455533129795415177436872914969776673005444664579555675343098990286057240689929189744000415437035716596404635111903210096672231972864633146502056467770158179373238743231587793098322611134019041397954928494695932560521033046697530599599578560748712093469706880462930376243910657625379721750358645568909760528509823467754691426791238437271027873409800631447879907098005491335019734753077713524247360451011326370094766219310058153640333219717540588251699185765757183569719999959132041195599266337545554697696670583380252844799970256168838634878735666804138077216309248) + (zL 3876228066242362566903199730212071063698237651327696792846636104665325428412050573233741093529672670217993962457840139747088391807124435128200183047386789488456856407146613087529473627771890516799597596712032996019765034039813590304332804792359514553721603172618532999796248779000676073152105583560095821109637333118276899020555530880528859380665774782542245682676509754923907499874621993028887192796132150339171468821258902371659221797691275665993186600059219636564588813603639615487383174653735138774052583617216550422202450999445062447685616011353714726486598589745815497703607196473591995203764428198122389032525982076007730587268306375813557836118721395802462445959249216614652421143764525801416203824540919909110297825174653118101855638612728417333041412253223655499545874746098730364285721298568243811212455480652512409101804242710966681539504392059165203821811843783355134622459671094392914253108663291162771151398790955171261332459293051391376111960064)) + (zN 16 (zL 30889163762870337897410754761583920645547094567891242085896903875123275142374197507275950713506884577549874178692988038821745247834449620706790335409807433251480840875314901655800081946873262622097907344438702692957247634028050092634106911948001844809096523642222318766173220465894145306375722744182548528449452526082420755207020030875485126283173970883011833409534964783718712661823476636985617883654521593869037755308568658643184211094217031177789044847042768581080706644830431498123409858065407346007526477661960231656226851884695846281079779049225532888483119600079026523215827727645437323000403381665277312807504859968152337316195586348276482182110559754218953703807873183775430634978511447526280406876569921819947222176981737404680261831158032854168934171189002125646958245485974080897587956941217347513537965214631115993018984219066082636420054402347085136011394727107998719755885975573269050421031423328812197972090042255346527019601362174811597908738048) + (zL 120661716405162653133101829370404728377894937663271672637897739240944293429091265546210811272765124863474313666865200619130445636922687529277580300853756742772454040428197726644823344326560471102247414605889149130371810066573232516078003064642273656441299713102706083776548522280438421901734937915846086849221142835880712025800927249582919914530594865653240244677048906936294666069503194311387339959134636698074361303973661681092752904463230689598888384327888132434825830576842762632569043182228027852994136465495177928443868277540380297995685188547659581837199195669314489067741548299973068243108144698457606992380480779864576680021043450505013748774257521588500973280934806059253019839052805824443102973316773804864422542215742454151612670666130571008896861699944990907970097351414504484703734277373042176995096311875865290235942422701852171961630000282999903830691533024316548687288799674992761890516300117381906856119886449137367844439341195580972109660160))) + (zN 32 (zN 16 (zL 3270629814654710945799265696489658840096202548565914751437511864676772562016804645481128688724401356739157216949389363836161657387897457973692574370127485315525391227704969242123654764408873485712387548982742002334348723727063436046469824577008450400363017746302916910317244554537460780511777084762028665885333171174356579972632626688211811806618065435978212466184282482009228224254809048297241839960104518759435482288628027359482224493493761752197462868024621401979700137317058019330626657386760382765212187888158319903465968148769701161059394171915755750274118595939884876582643421214045319520157481421077732550381765400197443399881875969389543985261320734576049752285738664707662360214206725391313107925431853580440091383452549093126103835378676770889816063591236343681417574686833504949048896847998259984735728561995184666102609663919017072430314362778237888210798341449943514373295003594458638299137737823910268585993229758102931243008) + (zL 1674517896413954164011254767269930903277944530516873622685251606481449148938535345137490437981230115941410763997438488340085048039253519558865998382425971549648694315968864623217964571018589049786230115240340190340879816984727310120537010407493475261757535044976672405325971775844338974665029405244484781929206834733490814997179831579839131658116692629011619356022384014661744212537541507983996406196884171927041533772657888276042249117128111801764700604575292328714155638590060351184423450979662627395729179223751224039064160085562328078329461637148470759345904319276765731273751123028082688852422456721031592554334819236416269691272113107724906922098431975830569608372342768742886255497647347203105384646797022005745493470635240532707471231024489956009925035301225167856943136303113986943623999605638431509494321592333047691402886756626652670911221000377840312770411508214225950421269221295296069601207524639132545404282592769788889798803456)) + (zN 16 (zL 408814678062706130593256747578477003784782305750673816978907504535243938847640890987619223542971271882379633797152918834422828611888211213925916877353050165367381953966057909966162958154592523180230822928337494736852985229554918298666519618561130314007454949995045113965428322374335465248206977119700078890297062964324638269067349396949661494008118816862251166566369966391447729690975917994405570562278268142658522112466003739242400531464799049834286190159265576365355876122046030617481388740502504239783201415400662617885344224922061963893676925917990632077416322822507260517048421213545911607652377579391290319262548180880356822048304598197319691443479124799202284493458110451440894392368686167953106237342946505666404610322254986796808326120614461124748253662580586511640927501484729545111923293916659863155957618995500689755038715646511360825772427657352737000372181888750859416225624427000601480546620642386393055490157674572923535360) + (zL 1012176117239360442505929571863428387726763961325240208717281830798479353050628883051318536775232209118645181138759273145800219709745002792341501826962913324866954073084717295863285175563124324179639306472521773098273436607135745493084940615871133050770997306819507282682867010760656261198594533924106808417739793626397401646180554591919781382063345373068553247948120762078824223389637562715742053588467181317198468809944446615073939382666755638655724203741507988552434425381973703570743814007318293672987800162907930630842244988001921689371510128644129684973035570130558182294300743538557384042360679416641945851598929945634239167602632693315876283255618059079009248921598246552986850012264379488474539910302711082420034393833960636743226655284658910779015590555747428949733133590252366917446956387527051679811365836147286730439949212797037508845567047794744517845726625803233248195005972936725050173910980195808768086550161830827128991713482849458837354890722803712))))) + (zN 128 (zN 64 (zN 32 (zN 16 (zL 41458733762120436872519355243204300943761668181128286658793674460806432193466454697286538788807344803128243765487713718066712715034865101217119930253727757470059049895875195463637151606039634968037016328499897674015669713792635434689400059747038109383859440383671371749699408654950305039828071933501163890478116408904818975712630185233101256461772984769655443387068950607445523058063263662135396947176359961464308058161567676942930846991799025632369776837626135743841388304089512219200349308669711857212251719454889608177835319252410550403413638670116763470504670814280538578790233620012799910942795613397674420344052570643903209088819878159126852298268675106713944704901087749542030100713803978571031566927527392309967129759186847621559457283445670933900387225185733734382907312351709824579411087288451146496206539862803655429868539981319672253880142506023053827232267296234195577423066633845331422769885667430294617850145646104248068471874450012234687725125088026038272) + (zL 12476035363695671572777958743370625712552542717319053377611896180982707250260036188475288328167725103703236001826783634853529136343417301635913942517633795940850815789815643114376350351464741376006798031256236065786220141637464997547345103103356303259798570785728844326687727071779315748659582670501034088213322763274675298849583196300418681012112972259834556735890249153016933831288657082825953851252083936502996861390266378386110223173583148671760823773777375331138580958360156873573662998256984232245550572957817512399879915782656221646963853960845727843320209601191330007981321187029316617765978594730392379316211769548138306777840352802416941917969099668158004873323745861447900055820829237683504037526459372339575122481122100325044038608307087102817763734534772363231404802975769772660209346720141725913847939433474686452938912556799536824364246844769861252601250584494685461841848998970133887998587144470054223352311216873668608)) + (zN 16 (zL 4045468429204241513408559617373941008795983707962450345081737637829738994387065265253102244108399042735833153988255561372406374929291590907991430379761837405484677033005348077352256265569747054648773391963768815632033402047042993465297971598318299150862897563619292569535275314245352015582423463513658192162378778653983384498950417214057307522841894659083925392638235831681381446856432987265369900922639281441053339915828436370730531017274190115621418763233001943289580631838945857385680074098032390528792423906586979019418674405551125278632295578021720345674196769838328673074387615357431664638658617107477523517434798058475681763569590205164397193480689991796412235077963227612982032097240798117039662603623053470284237129987917653860325812802983970846209784918995879738156694132870696944959284031277632156543306846033802777805396161176986052684021763926749231147324952707906354888635453743608003325454217139263579617471419190815799096370570031267840) + (zL 34750309200865382915306181656255657126932841120509377815249365481911139453502927026888995317535882356386224260104446298466544474181006299123293231303465365364392278395579735637182298541466869804104202382081946056603548658240180180072603312839962002039284448811899591755421290340214499374777746353561724228545519362170747890887949183162470994593402881428186306932674496889796440976564035596009387815665170552364918667135820755052918328300046405409951187273583086904555608339160566325743202057683926561730293297841516172804604514014141777041149873777728120807472051882680922002719075936086246865356265443241000524740462003426682370906730958731461863632496584176780642464310059347063849149049631051643241392167890543673013643132254208597809099793867725911849354165714487123233267078215900447800207367827225107013244091460735644564583421435513849233151889476815046309058753463806739485660265850961287154656159410273551215733892838178154219247745955915525237688500224))) + (zN 32 (zN 16 (zL 920568829624980564915623194626012385143372721844587750240877552920026042883195186067180871363929299795591710455643893425798955253434052316662982608952148372347208369452387309025597497945744629814074840126837223630661316112807262483516618147778926616429464205492732226726469083324438737620181659300386578356938667515368883505921993785781287499334083338244549221204129823274037288098361310611675054383458410047110267689302283974312180229470434962214899568175395870780148946816282266999549343549857220667974076593438770673433780761729532799502008655747333466909255458336088003594545524596980027068277438877564115280233898467356795348547262144920658081853809099303615907417780449862274655121037729611826064629961243846895493635046608609374908979362105911685833708560847067995575883018693538834046971771885696189572074801734658731454095636208769047287562836875751024379422484323706948066965314108732672538488075394767492975973093368614392687170547842738552832) + (zL 7191943887772792099730036791240665373905427905627439244182355062423823178432421851282195133016595887774118880161322360459998683428304969489734368036857180884396180071853899470290321092844854340624542813184174533453542959127228561391933824495280852060818908602828996318096800926343488868706584464208202904948286920963837510477310665842657279191229483909219350531528631654450576727615509447989547844211637708486161071036741562969478451741648362163246468166755940606766737060465093662525995639852978739530229986772577980487950367089513441192453881706547518290806709723153153445024582133640016306008211626796644707510053856185900216086207242142214274353327269897755881490220031811713637165422198863546750215933837390270951452397335480822294922971210303914345992571595752525119397004798914018000505617333300547792974659740754582301623522760042404916955135348841609996511141344837021533069695836570986135705255414681143890574779794923040773128888691420376288)) + (zN 16 (zL 125494901778103106772910785313225219761984285917775429649211077637836490270972323555641910966735003413991157564175389470473587036584150850395348085966160344719543623923641907956347877212567645400678181012595061595954973567015412690424980402085496670410816535006192238284991304698648210475261388277161479937837198389926617833286156244334361331670285589415951073266666647576725732737951154666455607516163829000195794418975310611559171705120080460066375867173927999555708584820149721879319861794731481160483992558720993448122244432752678652427464567149139083119767741314129356369603799282167098714010034096549653682847905769435057747854664507915193052786431060522019125865922292631356704101185887921224698828327960088605112539193210663818138191880153008084222017185364276866360341268820661640168816925582037202424250686970819919770411127355069109668599458116165291392173598658131085679449782146565446674925394209493825886512429047987589783227785171003339547200192512) + (zL 45389018526709763181138923381550861813390429682566468253630067984445129718777573337859231525569354703049843596448234216211941419602345214424962613437205009252704953920607575530842720725142002308831036600855285869052984466267939437882554887365951513320578729612742627119018131125251352771932550147592032522994938519946709031966622890719800471407382596434313685288426187640035597029782431843838206942031511368490576146926958149370676191932269058825138407108873499680734227486395616762236192453920422494128689297203373465636586959799155312635433854883065522848770939942965522770994156457729425690864337264531551963773157398316569533504369647359833759265901000907756797978016740533185319250353773452765224714620634023784653324748766925968747808795926494622716184490531222500752068937011690557672509195927991338625092181290971030563829228594285561930717451458250954593004864021377620358785354269128119912057244143930016920502272)))) + (zN 64 (zN 32 (zN 16 (zL 1166026887061370795433324441475244114904368593254446067817148460277515950372342433539876746619289024907267733514524092712566448609158709573295181429366264591038664586853056774991314296204161932014830748649197027189771459076310411943875599362970785536577858339256175396787240867764193066737299238569449197173859139066260273169847204385813739662525933443606488074343087249766946576041447638403028960495228638700648011838665034304965936523616951492832065731981413489631920472241722368107365356520342572703221860683349834143048420859133050039840029061837076334763190546895433465608254585542304545641338725601805642270041465922773910680904850184281359778131979126034948425328690247094342350511878480258665559913054737629835422339473397472044473793913181244333894013767182089041182744533181541896557712320178041132448295823551503539751164912445496483336367494930810639774576193297239620124842691984707873786245851078243333568748859248405095392632186846730072539394718428561489) + (zL 3349010641143613546449230254479633447279777926291596117763495722508717725010010091070538212758812418621107301536956632290305143292881156126910995110791147045985053998176042787136287896442252423918436170111002004970791694319244856787378140230779149675824705174466068945481417599348598428104468754684671829131072560372306981711074776078162741223045968599519121457607790582039854562882875028912547365627693879176337260364662635335691789269396166485125860235740569594028172929662330998817738412848484968656264152236742417618597294095050045806535725883654524571793477306411722856224537580073183069895353677286915052856700594977902611632191791049251658910975255699986567389599615301845789004989391607355170461090012786169002632512060173379599688891865353776491351030907205957504255836969569750085003410556298340160055910023382515790449135922028922287876056281453930768785672534808098935990357555616916034568525551931204199323792064310726151809007616)) + (zN 16 (zL 30889635068933326505702088066287716632942892380148872165508501299565813542723432866632541564845462057835645135162205700053038815438405830626775583641047595184360463441298144316711205245054521063326923765900241615172360272862742134948083802744965206890413539158182721746796127561440559850451350680293895921803868017104981276343105806791904983541136621389374053677284451292681629059794514453814997555004249705584746959152581109064419266101064087096850590874456047346843688802353842923696184375042657204742614371860875994776989220639950812324864611414721861953133069097293530105222899217827114937570284926847043656271023710462900718786412511443107979974209983677837859937302468942234745557862992955280080431727893040464465061951380607225158453304949307654596189820175671027875825671121059376624132289847251116786685763469718660688972969684532259855217886201584126896189204047881925183763634438296347661118658105092415488489312416187587765177512028797735131334836224) + (zL 13633305289297828539974492998136515032102461007218257226573293519312634776849037685908673815097158119320418801853124733630951849805015165429943813560029538291476926192794310005113326065171750187280391574768108641089047604143455169953228255906050824883585597620027768968601980350200765199360589994003504215921870046838615395592411248799937906223132690940578210175816902497794196428197386138902719294936253302738895625042419809844606642184062963541643603300116854543962604066825955954107156050289951456818977545813054408980790382246603713191658780900356752722189340736556675751901311919561723328631356228827283500766562382347724114974374237427086792374762220768717314870884375324884289825954479362315185499459968823668487135346902653539753125585289356926267276739205460459481166048006156950275357323956496224489235530295096068190954051949646690456630041513501367580914669802809097019579528193330889832426275048221725681643624400718204920909529088))) + (zN 32 (zN 16 (zL 438974814177615817799383847409255910880124418197315322444337098530224001368386024695645685144533702979235610023021587823568910175824083485621775335679252086055037773044912087739121246416924612486291908379028869097630152372856596790896729168325277982149312428903068342330489085035414269855175681081348200515802815239123260790503072768318894883132473837432588559996645640554161380038150886240244373415225541900203449608271524448528091248888867680096999989848957494758208586785352089708942418189172359306842760555465549100467333439934786794561009969121838327668282362662323111939454568519823426071230385894798517138976966125238838238758494457153399757031530326703646323506806765312646087278168873596645708414522458382035623013296467701311549445749284493768513742352051572879623502418758181608925650103072860531925204364241389244019246023655040113477937071911194176321572755803978454741699014203040821583355521499174070322706509394616205088603919876096) + (zL 253044059475082670870752970074450652225535234328625738027953367146229052708572371012337571454090887120941419868758899850472731033912233777320621520608112687030623492437386518788413499906902002564240815157009093451502703875733198189098804006432717560249268538535796306401354969723634464120186396817483636206207256264791616537383709712856944318670732749002493906563834945819592018095086671994836176992585867288359599444263345132638353876472702048229202709129748668999347033441699069163261369192961820085764555183619407101793869125687927614270002934674802165292358861351981978165859489756569594759007335413715121718277596447326826530326188215524853793931103003942673268963011339188518289061611190670314927324380754320851777399429622101196870130417192242520393136190414143929192125311821473253521593840497732960427129660585799675611992260703524819689591777218579305582238935064515459497106057074216384718512296475036646505331902588862800009792809076418053874071766040576)) + (zN 16 (zL 68954497986911832098659418221548161310201012921633925507468515508596995001129870673896952112767087071355334232865958379780966857821448830485775983769826156026024362839796634228087251674896523422489773526747779856673622192174538035026401256783130404587032454895276454971261689167068783358779113312020400409383025240573010184657247739115793400777824098197073485494269106172568516387949448896206954457056093235373562726620627122790880117190416203925699357929595066830329358482017058027655188735022421861236780309958084774551831522316671217706219369766026778334001327172801509908011055340587175962300800926883881109013494386769598549009181832663393918781306834710738552392491334616248554380890042286907741174026541520868310697898851842133341410483007706510407219346069593089252156891091003274907710298125137753732457043681708512453171426386660514808801904259027000815036830398991376228589048729619769967470511630389063207591360642780775845933407811473655014333161614082048) + (zL 65103484165853828008513622269272166898009059896720917043138643167197460528032133984888543850343068961309458717142908473718730084286298234768214915165051405985319414382344748922359569479723999894401116287926379581845509785761433175794902285860733613313744201045991077410960816694483091703300673616277426902104992096819505188211789300295634603948705447227612650886226192175231539887163715266589147822331661887898771598800213709378230115909180538324185240569338635351199637074748633022459363468457552968937860973234737245198468593084553451555844238310143462905139004214605017760854134539574583710162795389743209818318239671496940307820842431956167770584837411498915676304634007903715345320209603025949424570554892978188109799069505244524330625052903045543597474470985229912255369976964838499255451605913690264727504509514898707955658221257833038821436601134053917311680266352160868359930058880055945173110512786785161676758604567107792801333999167558744144699121723244544)))))) + (zN 256 (zN 128 (zN 64 (zN 32 (zN 16 (zL 115205453329973959172182799081494462638625876145151509930409595639699151374986293935230260344931122555301030461203206927457571641715287282980355802709035179592772842669139880307648773121246338406442048841577986191209130354629985045543897489341039027739672566527435682842155205469915617125243502659612894284169152704005089194049237364176666250258710839158740996032534191247291703275319955773441368660843018947124079366951686793432417806199156423506078331986007801648735922232912686425750110382705160317450666245557724798185372366683236620468709396294939266055119531666786605295729580108262426854188154454195063155184513927281119661481869114391949218866864239855773184562219519254492553170170686444573284269731542819526302697124260289607007256570043424570296031652986615752585482501606930629252283162011968303353489667208577354363410128413078363189527839517626899137274057084959595325046476950406211217514891288211546768847450372266857959870757498116898816) + (zL 49907181414053943886581830573593893654831377591783627229293119342681553619695983596613726484052208733545763542426594968775772422177831880379367385125586846300921037859951540684072301712939585996879252263823787054712434783724914437518509058882350312090524551604399608872049677817675213895420296731836870326769303882300406739997116797479356590331672183315536195127044953080237146011160815497106382529456806841025561056830007731151035764417667523026577266656984810503794498675926103902726597316380772788812938825395208957203687312240820054208362913221552933560579102652750612073696533249768341439244658301041359187197665974052583769084130363035317463649948495398083037470788454471231250387088168036877786149991132768582616623309524581126021957752979366654422583816594334566323729255636630715097867739507707088317188242830022721861065174752492836914130431688391913083025120162683407621460476724224383415324456191546506618037953596919644164)) + (zN 16 (zL 54883574145181480194538210265820154501436499651638159896436632930272922652364464390192434928563065409946514398689890287043721542862103148168420189377967849836366070359370776179020625044164541304332985637578864851743375465372156821420185481274381565653004108785475238202750820029046502196616622086165344542259805176466561872316341819379724605650122947995736235171922997480496080204466044071488226314255944871486115464584724567311440773209518156616625160560617277752998281418025587675182484721730211931070094854553492391806749064228662345820783096241613605101843501670243498021445533063040786734668750318720254460643736637924932732284218244926584443822281982980724423153462579792843414298083094798652232128068617025235697661818607091772244099770446947789798130725659530319050770293422823258568513403298894267307148140608867805613188194903321508798286324633237078256399479750609639767809512080228416972194990603858638567478927850156199224316654518272) + (zL 3937029795394267329929769862167002625859846680634758184660499925034942809504308197649180151054430763558795882174899303415534281359938997582661335062303592471386261543449943399033380062607377019220157370558735371388107137913690175415026110003475241233714250924747997586342632928065272639845404944111476021575453999567932452850851038825113053409525858431460593799467112813556782922580289806911065427240125430020899780491416115871559153008362723358157760055252899568069099025867119325611869159114989636721762510537230074475175337861530020507987501324010698794820936200827581856107974327586847254472300191222778934156041470940686667071446660388797819500674268235370267479239570160662196768319911532974677822853457812634888546376040175468570773431259211980446478595946451105669071235552102419530506637842573579651361636008194968821832294514117310718105429983413468984417498014964375278978530924636394322027754881916530966581110063229255943058846303074237987233464320))) + (zN 32 (zN 16 (zL 221047732484878763374545539462278844593601022603170707447932908923576123099815279204133448908775011298395861435843719811205703978541123557685610319246959221838196932524251668870955575745883617637589334562070205149359965367337106471128818234507366770365865829987143324638124418929606716874803374619005138378932958884221875094084586065559926417176444982915939787363021919795558638815076362037631982001607746770731582940719259440417063479906431958735643958788339021480294204340227019548449786322819750207256944755164146984045797539490706246179742038004913908014537935544778776091143660950828726399840636301909862997211493743780979092111050519966770287381792036025368886474270963088478099690794429105921343429941115948519329928123373274215148831160628781122456463460858720698605134342359052514430878065988645581507539970006251999460213327335780440614433344873356881552695521522842084150144113546901782624959330258635602726933462993847228125285449728) + (zL 30890115631025968189394909823303297450829239428239829499358868113620918385452231673385457736443779945581453983029858977568823065575415599350853279228949457516178106239744391989273739895444240837380454792819274233908383728489632672656891507976980778656378288580161155977568785218212206663584212867243486952959985547674002814541958671236660730715760581044557689309720947611288562180634546991930603667013782372278605572008202417360405477600309945687466086928978500198844837837538184000540524433770128859726624577480987033420258408837251590726048988093248186263481501224016563367395296370291259429397934657938185611024013197006529916433111724226804645689915383409774303311219146820659174642615090795128581593569878686751241560348085803467104838049742731383731395444785215840142606019169382090875491818750002415938649002331895053815715668739586881871632273874026095438555956919383177574585500709874687179218451594237287864455612824925638756538916419449496044977520640)) + (zN 16 (zL 90775139671922816254443440184928351744371481284351634652597882107484050877170540215486129560650360263439083716738667798974210926809486631504224340637122877229740136610324302075649902982207412945485695663809866103118582577310504846476099220334947524906675497265703378369205763917260205623323451988641835118077482668700491685912702367195129062462358565785801486779758617978426724502149558234489730818783989500355070115737931954093592386679853188223461914393781845039911089621299804848270573910745644354572230341843404836509296547238074831028700991552613594813775153344149771224969582142755266284181675825214989713802727474641704284214782334893097272152291692418020761827176002314794870406499703924249479149503894138129382837273094275980535472089331681363963403469654558462471342383448313304881746367031345723357134764369827355394748256595716270414065401506325842074968761991425726702499688109968978806402182989577181844209664) + (zL 1759275085049528302487986813259408561645646019036743317495377120467886244701097285091707791123738361346270212413228150931544559777835327634879720960627413775636389502636915616229957950028798669046230876859922077474860978632681042074440029813705016346605918789042777156752829294380000472872621830092487552868814902536639643884607779215624469773339374233827576018808418956563138709296570082969635752761410694988944709059039813166645124632260314253795804106556634139823915711483690495574318912370372645890128696046526499257520556337627170246917945461974569059710791079628542680680010373098680338602708996529689500506452609494607678530079874481629896465707310322869536256585983393118668252138922747074991294369425067261510791286929457616830596939150198961234749393862042966333614582142150931270079601019829544378443069890636151781036707792061959052140594887480506527116870687109277526283778949836928923740103796147407812800021229251319953920762329432064)))) + (zN 64 (zN 32 (zN 16 (zL 52661904559723365072743778653010820027045495045958074778889638059795047066693786894667603723474877311850822671927761500617651455762478153553782861238569417840617541690587481385197807885546334517375370460921253951334888683191307269524021676889369654320867796417887714832531717065930050167015702871927415821040050248728551090962254271239783397214303654124393264474937398505912722763636736287616768863494937329607870798748644389132453087036627291735264600569675609511943162043890735535938603513260041046744851471061399622251348608668878263174435962553499720649011197751194252187841635182902462546347021885836124977054004093188564200203991865730653987195433593304427505023885278816871767787408197386819236688861059222652260786704368761816106974457396471498218441581920192053855401908038232105533741490577488614009695938967095608158418172833311129893881046641231107729013730029752729942665213359370882904331063786924408832000) + (zL 129558543006601313888123437545378248310036774101628738311403451440946428525057918546441112864410615532191434771103575483513656639213576989441910432969850117899891983217281987489166573994713085346314084795895116602223318798233449552339902519107772078946829917985457623470903679525961916897829090833059000007735640773597631434984215197692247307665598814359660836121948143012897513141060042676875192709101038692877479681504198583558559218401400640908929194178740630094130000039725804677740083708544132205024540019968865400941803756938639910182394707165744008622473040342511951193401764538300395708793832826605923393906726490106175684096062843312809152844158070592896951327903005324826968331268234224019003983175310663600827355363349393266653194971101145640495051852219504274494641013480129553629679120400367903654862441510793653920154796573486147204569963675482821458737984872463030569655320984126418798904336787189935323415087244743233572707545669519345707440968323571712)) + (zN 16 (zL 930466872168637253822976847464071378213097965503972996742241925582355262270758369755167077582560416207086677071680591642009030473272852276422714331310282049008708476919482258514611210891498724540719671151753545844843979343390857910842362351499886074605743731065948872881525552568691613148670174704842044813243242467182723341545362533793769660046292606150195081456664079728740142743738446959906733786838450908174967008154260280683390220031330304655083890438309983803744105716065416238898398305225720965290483715243522834201417588637007154961526439305630515607395029986940603247308326776134561619272983942623170890517335838539069932217624681399171042424008667459441240598254934330982113232331563963374590921659692515837401866442109900930751615424981116663520651714911806603483663928533273343382588937213224646281599604422073675027352386153181800074425089301997873050186906543429971663710442156003568759756282156303971669508096) + (zL 3270717041427418789755081336289127222905129662760245862876895826769546682416214536622308291129412704123912247717245658138478994137560168001678875494517693587709615105080275922539659859820825015111278243580236711305745004361836483456134916311475953274519250839328775375055958441256124798401905665111625442859781213961406548449669717626850401265792490050235420482988674119023391481509345838910722413726220352101467524049016825015570816964108475095063005172271024397737144580861512378161260329483325115231667974322291520928164663203639676951352982073584502578390644262505332517347969491998340693850635291815744944383679410692667461666088178713351411612412885550413284483753744609256941417764281557906938448914210045177300303467467173503587184177660246432146793011751634778094675415269881718362834249508500055237619648723698715525984301873516276127497722401207684771006944892283541736096237081902138097099473165703431685183568455755027131138048))) + (zN 32 (zN 16 (zL 123556699130906261852159405732946839777689821126936142005336232723078329591982369766916702423323302245307393396869839777225153691011547993628700142202314489658586538702138582591992326452751446813446990782199792696347456333599389360523085864497570542620256212091769514985706267364178073720278232438382738555041591972961625882214662663337502979748029992633870885459017917149145102524646858859914718757204756054447003790903662269910586672858054610908185590374966257847766582853123232704308178447912746884421681921407407993480542134549394307173274917126593256365833453828540468691426179055958747883043907473718504123616957907037323302059211089264222239917872895523948305039461408331778633347859565196683605954685595252996364383633543618248290513889713582105175733492358720097501212174584036587089378373060330269681706590658493095012017056703703012314007676312216355365161856334736185852398780844276830026719302488206091304388370018100781649240201636352204858917388288) + (zL 1131856280254004035083361861919162725824324131797379196211946286513730656308503676867619478690643746336814312771315056772378339694066275970025615826135025903529099705216755111723977975251215033998487750480994700771792852267580745749372281577396263627343282547368555159212476741011369682685430354826563821341787786116226374939268432311635174025052133984543193840913969433879027456572448738563219850192498859338031270767010013689340458647427975557093964586677361414066858014507595499961254417654024851700513652169511633505322615322150496765013884948634457417778952757637811722378202974921485605970056543018560680236398936812267377283973503259278312705979126513803710598000296387828286886640673718299381011141542123535009155516828393421783590052278148959233103772028569674751226069061988810879334836208402282621640533705372865698493400132068580728100838749053898301854374806863554104666880250918718890155551745255823268688515368335336811175893301730905594396552915258554974208)) + (zN 16 (zL 4929202546399263891497307783539474789776365044563636082735122274045114287775252047819389794660639745876803398933452401600903787744284674516973655522396329180728710972853468859408620545042824030215335881127995370375870133448533621121656341214578319122704905383188838192811213840639641798420713775493731876182083051562338458859426735210686398508738529354548445977517501958187250963262810922917841889229008954861788082970484642489252383314658651357392678392657625373712997312687521859874614891321516612614554636699434486992102595237715077157665887915565400536875553871719131858787059104868760782819341585056037321353646754850706712578570635060805713318961075553258794491099925938408405873163034489196971239488523906236421849379428047217971539341232325322665755022902138556915246500452557660701432365274520950746693115778881053858554979452622538991065311354177077390947897754232209945774109216226485075192916855115281522663272262139165970793415770049118656158569313454952284160) + (zL 149251441543604713599146231854097766703262428184222520464416671314024384026239782770955242645442291331518621720897430326231662575181157701184155668730228034593734498803561836120163625571259006799628137829828079442358129399343849724466718736003723365327762975239030530075243303024693878322597944869536453573646614970449499786090298874611521916699495316603371250357539003577441303606464236546874070092392302617268109460540893607984769100361759910733971152755451861543731280190782910499591305262949902284894076049558359300619419283748820369328815503159459692804855530117505902479899113232953277643196280915380632656188260392312189678144244053147634768198478846576577294458175481300750709753973862757277253003276080773385598162304952480200355720999556885116088496552710290528330936710955495600802074216887604623723707643513894650192892127265543336350587205089442361480848891714167617532073976910130029709086249195916858104757336872343409471063170607410319885848608483693299714))))) + (zN 128 (zN 64 (zN 32 (zN 16 (zL 3349036291869263383212455552001374274001843647040535958219848599159343291187330199321591148449307319386894792091368403528670133430274147607204452624319713747435787563978160435104687159402866507251296722379287840561116924399663581001401374396086325225689682932046100928058789353199477821507491096741020899018168997288883514121651006951549532556672396002743166097853089784877109848540048860169538876335036118181452107721029947620166005530535300291542857639179684931595566484690299762594073906110559051826099902976502053676763412690100927155987053324906644443061316390862071313909677264458032420553271483221023559674954148168114265909587840965401191198110836781693851170714930572920372948049168697386006837434038690655828912002706800466823680562869878779653503307245814922005001180789103970467370279617942958131582634919987128332823609496077742877214260495380251033479238241692982225346673806377717273404732964301027670644535646246794578942239744) + (zL 1649955480153048607780494944439478304357527985169515575925799020738351006887224298377082236113181240949200357335381867440241670014942923900152193021727885516771209094786067589023426011242358361648407382998962414690060733151340020978509575019733679069021158376249798596347692030733667773759445798804660240331099171492526033985056828447684631285908453530214013754902776357340655909005100020050397256898553507688566470568731431300804544413158554836770490424485897962321977738089590271544383585590270931468656549895675236997675363901718603768566828720499017040486069491850647087660043642283625428765404504733690403040772026880364893568924198173666310154946799190715185195272011824642133740591915957989932472864454860137261421793816141581980658588904247375230806272121719439852491047017292045465728006991664337005661951331438601043742869198807929355906629414396320369520269110211057467604232620958633501271431425486961966336782871770276298752)) + (zN 16 (zL 4145873376211242044491066895291229737299932901887951899053439964870318175702490761610604168015133298933842527587894399942508306297396429526905862312443208529452310824509131044869318217464931132007205887012394664459851896408057588088302398616597432537768778447775068766370478484971643313079406193327547377117129000264510346868613937508684627945927243641283436823090571760138080958622800294872204599007320366444469173375728960183311083902342791563134167944040940769710704703988968764305270176218518878604026787775277264664299949609300206251664218445570292212804516020779489068443731883584604215662066921225056240586291827484591958959414614591155860453047574256658839064311117373527947460039888309267192093906151480227834686095480829072583349972212083918626851894483449212791235962217875781832832812088313961236452413205750891019006133254624583979282511433218044466181551332249992602735607902716956366964150227262737505945127293597923820083708696773288927055676406300147712) + (zL 8551126891519332700728254031972699213904124543189220349812149028474397508781835259344349751416394080808584597521611241632211642583379984896789747187204179652960609428023312696789525191761963887390819933723803460073990177949868124378007187920714642078443956595591516254304803794101703032902634725976882184689492581775793933013033223139219640878193796453270782820560202485467812157186499748179571495184067355161335016859082429542338821657468778156628102719044536869105264323546475205856834052593138653829774951800024538960729476338644526236422968551054687251020004552083629808609762610821313296041066407055807541935902982790143518542291843205167246099784828724520312704793218784421773230315174341064593039800611855341867603796600427352385608426488538426099992931470336585253703200493278124426353616513175936820530320337666285712196426244360807204962487798397613601960076790468597432546227458158403668498503743974241392887702229672943232557401372365523601136622008956616704))) + (zN 32 (zN 16 (zL 7363145712816204554523741842275236051501370684835444032023505030165494680235512853060943154857446447817736656269352467297718798083238702690251993289429892445788085608911578116198813878429281266085955026570410015682530198187289032800238415698475519947470028632790676259604745333675408532998574752614661795133223282517419766455866902051390375755823868459546001311316920471879064331710086749000222374178615537400376871663827316888091669744273924760552907264607362417373113844392460536349293244159111370174104818779588973246175506361399441060953376594899103459202434399594617586581281072940272369471531958731861697621151026440527129731026178359590645063035855222260218015243138069786924956731836915589148235593969278827190457317061666825158115749920329454253396152875582881051992617544362419949185533349548014404306859863608194172025351345172937170517824963318372111943355274445121782740535044611304946361281075360173100526921223707319675425023225864704008) + (zL 8551126891549497899687338565567276643711222372478700798460618755257028165059361493978457878712503346466733134863797537995162514069946186817216220500527351202357862603604796683723689371718342839480282525526988636915435150166533496974528040326101274012433745988337499879054783149883410877599145832370886546548667851472370627090022517698970315555253250756071972100976399559875723876769466759974316588608236221099052756526838476968242766424948656265479033284985418626333239928212199109943665374908018233190274694073512009979830238474895929126024066356408314104450754759199058697557987821968825791400799364967868581125743325604649128835736216286930694665496363349289359642402104591974059552385392349138282654644443336094162465949581662839154672289595103382518216285845238573015045044348801876054308260311987774891121873829864501693304360559693720698495042359099690403171576155291997131045375217181585142631413458146480289255902271822541138417824172763452963306490315883448323)) + (zN 16 (zL 4245374368871092667337038060381552720108157134021748503459726830297486759452711633719820475376005660032495795882353400687583924555160291633330445196389515041222130026828261304816007422834764617927123174953021597989374489451011426998713858150487326270692034269262126825441478915688734326389959328645291337164967484956615881483598725284230978982215166226579361374936422901470727534805846847180118388068997226292702654989411383741333015042340029117097867708930934836846186067122578822316146407096627720345590505989186708425135215917672974782111205614962041487472496104719524512450830677525628549648303749012641928891624147153421808717673106209488699597397489102234914820363461550194322834631470458495155557867624949051346794102177465882348539447801149132159417685748559202215021936672293313866644010487253781913107835488266353956455856607007029508510248411334183208787212015846388599934872199014792529741320622419128188730957679589183915806678302318395030486270131044906174609) + (zL 597653558889451860965913170213111391117305270857188328724289681099696312439971367280739670399817714156874822361083448070035088098796004188848015342143941536603950287771346906463241979805854094970802909128954994708394363414036389881263975806765959426903889277743376827581190706995878786325466909849711817313633795441948548665006714914739669614924464658638499947563694519586432447430129751328448404659537079421627931340205165037351940437393545507614121647231839829500993525139675181279593545389667089916203012479101600783291796771499532951214430599219618943789025512317087942604915003786021834303050279855262712427954613467814514744554388413211611579245091513858228838748385570598638488109890888366950751367024888831209908973601858931679504616996266376387868809450483241858992140652177009749776354945390210576329292494590795691517982151227519190040536211377179636339581663378405955111019164523926162569688981487371104667379103874715636183500563688498808066224462080759562240)))) + (zN 64 (zN 32 (zN 16 (zL 8296428561198879762055532657759914304634897378923452327913422818876957899599666008820745020074657944574171352066633351652620695913147716417063217838520071006629072205288305194754052715098163453959939193860595375206604790121567794154866663654110682770166128869229439374344695158030332031801279314331110687818851697219815864449756827974028497693490367264995600924288290789069499305953859992661599236049044801155583154128679070554523320402361560712400041169328605367386813049556274466135988353261963535075478296875916592699761671970617414896029442854588269064465242489183908463658803936922956962444070644150040221112427451086528693062716368669117679226144738549699674713290217945693953902689364229264315691725824326591504931339954537790578706466629951647415341582851716049823468701115245998238699955724927984744962736487540046718401349712777838587421929870718567053273116305284445302571256659610659744487325944328252095973358249388712491716465658164854941893745308078178304) + (zL 9109585115486022753946268382324392708512269268118251430360840123270835840357636729977941114891857386898437401343399445670089621840431801745091967054654284252366411293373075888336096565649234522842783623004146390065414619550347926419549217901730133171286213316668601935532089776648419107677277177943621023330105574203015782834824103088804380315571969371681590310064856946542999786899910150224975259104860995210217964284513463797536033296380674909387553703799356517476729369674611981668699257668132630356743176940663144112539939630174223189398217082612001612716387538214252452682830884297140389234532665299652980245569142228887052470904174016612919521545404711867509562971764223441289926366804453917214348035431836038664344340730958596704975631836572280640175397378663765686079808407041748753414597065834029111824657894921559313393375691032559380742820634649047467582920579728384413040822540679924942740352153564856275308016752401216403259150881737356195164815245181184)) + (zN 16 (zL 3270629814654710957146888980623752897954782670923553310299180839975134809445421619832194583915652396606074342772009541119897157207475135978021299306154940965190739332051535838231531247426686140158002708684041639291760305056566823302564064083805456628461986720329755830497726896101402961582250851098988000932388932573103682714795711521443749480135839397585840441272296794793136995266327512851951035004690744044618315299715113806598057649347713868448306978706950847527234757044625979175088084097597775536883103905996524625493502659918485259861817785109185140312905281549512884430519248728827616765585225559053593201552123835441714998854988743641032132178700594090636598366421917385169444730864164447569147004705483868969649178217294767246985453064826414931422946691937620839807151110421798563159005581560314283250246204630644793958729190302944733923633118311011162473243497299454787695410651965648535503266016670340699320250546747215190163456) + (zL 45387557661388335098522621701875763603071102148209651900118387682344126478886390651048827917118641131100793627917494924159443244164160993125504919479500769641996714895246616662756168699848703961157888353819593625824108264079409492909363966922826106971730872147120594692246877059869719250694640879652535763746252011681074788224374893084384525115730847295335842359532345745718880840432900811837289914268773193323184362411076955909430585015827982848908799684004728790170830711725853291107850205872442106530474098016796915403357159289401465086701988774410386113586169779781672531799955250524417237833120572719306324085773000747187266705321354429803563385685244539284564620435376110922392140364482363554109405581305480768810336274877690768565509835614648719627158947608211835597675998577238341916489693909441253422823979677157237396842456967170208415015065287641584746700503251200910926087877115065539449299339496688650628890624))) + (zN 32 (zN 16 (zL 1061343584310079848696441923674379221536118652043402779770089708773039643745258481944424278020090390463407026841530584889677710635149260025900211166265225284469801466069155194529889917445285929551928467283154403139182920756680184123994694252373936286566255066262273354588220524054381497771302506840592756298846680095518563164440097094452774563386744558949112459226264705640564331511650278801475237452505827818709038885051451665947684753716328580017165880237002014959828523927836409487592755484601346984104941004573685075971515116049199588419434532790884085222350651021958911558286546681185581178319972786050341245943940756391423012471093174655180014695011876088865790240830142480159947985151290407041858590399703144215777129914437920557021573340276541151237335598230064787886488353103852271430333130854508481331836332379038938603246632847156941485150455844683041147492537654270421553524887812678611618235706339962149016644028650590425424942695189371538148318306649195414016) + (zL 16840279771785704761367395525037192920770814579228410314187622119312873373735079164247953712385812896373208554111220512282524480035603861475093922870547234817680280926620360493121552213526476830798068011968662055939838576561653640200521858536050232291898259427968071860879897209334043182644272929203681766582787256127866049988688016574221948989258032822716023923861663944657115738260233478178860434128749575768438650367703180916929130820979941266478576420206221341699244737300478464016889865790792111878768157868019659858324719585896055800810434785350985308224830359830694274697813490329269732900493073508088078947442452570478256972302725386442882923644910260244673832379266097318792441366923161709893574823201093420415580808634363224304193046613230906886813240408133760744862277519285207399265058013572054186614091280738086877641140030863778943075260556976058996392444118651287729444661379087987123877839764566164942736561304877688522194560491415702912714700950077440)) + (zN 16 (zL 6637639898292664567543813588205423547553917045857604696449093687955675701404542339823454246018040978885465191491823279344733352963474485226664171898779042488972680964310259618903131902013531729459368331425857640942289239914911652716243524055647399021749295137827937138468879482989730185930901068059210998906271912281683799510052090432957860617222480473080829376353672880198566999958739127367574290723439022917595008042853125843277856102019249493980758093912808129123416177399006854009335410406812794121361598257141854829590898751049572065234015344254916081859356742206733801963957741186237757073851483687644179909837397910807926168609593784053513941657899977888566996626369761250629502106483529443804783418850797278894064010239701350952164092275193827483718112423069827399478114116643135555473495097875828708067363980519949742445570084308713283012607128612314195568470146113500809961197954748986820363811195311970711693349483034760970496) + (zL 1714712675337340938364584174639406434013916624468070976140971636288896717950930220393710493196626882605208230027240528638257432388599384879255416503431545728360889982579238663270407565219535906212237178435393474236025042965246009488718589389354353116382362420241350434466850830332625507127520668166975436101029501946928921728868828656924347719240277906939204710164946623454205181593143858591447764329981536527524929502408070242993024525467492536613878876896336354005583164988425455860183599302559830884368584941108547548095761220102388837819517816038815276158451080208377481203338454689110272967870574888460711105758924522033014949465235740533651324406976744779113197906472730648494568262566175947980166143322271988082756139742963286097711430862764379158251572042502193442005671405697757970290488303594911309417317547791426663721938066333880431914635645422695094239853774841139773680009143988332171144189424585666384750454635683138373649946378241)))))))) + (zN 1024 (zN 512 (zN 256 (zN 128 (zN 64 (zN 32 (zN 16 (zL 45387557682519693889879182091289494620410915817801843593433691326536447526005134856510452910603268360640051903383742120677900507834203358898567762805710068432338263148876707426961443347990557774485727132661291906005536050069194103467779694092428695426521435093208879094082140264180545124006642156442743835822722552047133688368224159487592687393442011754196731542130580750119055143590235689620567204335318492525361972142896824214550967704236781939350953840901243313220985085183209959739575453906106636606308065005972964538732252108274203939111806838488903881911935784623115139961157943359423552676413895550954887019407996508242731989857331770650715039714092429001946120324566775664065770014196338309360455366179668045676660727706855266760614571047502924221814593956764081667030717521646255466424624401428656502274911370138258018490071966948942075508681369805518188909146289276999819535182448414785168888563250509027347529728) + (zL 8291746752422484318982978469029061735314337012677793484915932070649852033399147982811249502010088364581533000343998059257024900097378174479778871811652529532875353035311329430362878275631320970639408945222861478090031608756206091564649533701611311566316451890720003369421733564793648644254209381703430347224187178798853080041280419712425325056092940274859317367367935138076738071717024029000737937577922365147639127791241972066522605270681544538692792238119547751806460979596680732891002121387223837172337450304054944132961974124505864033547920857534590278366605227018142533546420710490081353231402915650817492919899314402020907308414821885281481105972069143846500519824312904951632712480773917790168820003447488074543368895641754380486044275206703664407524882538282846451184361814058992006639846945085251814419386079696225957214129311920589307609683649210686499802820224138337927280486064379532792978169019744966507338734897200999076413666275723287543159537779754401792)) + (zN 16 (zL 1012180054283597260072534361886126657892102876309263809858018550735978370480989651435322198084015697519655156116571144828367066749078944624994753635124291631812192178766619515540902234617584345648453355901390163478801913772235574842001263923846425828593202842471709318975177866132524514346767118368004110384297281516371473715528276935569729764590482583860403679346076772222731670852799918109445870678212289174864368940496652182266459178688955599802005850133010920874745111410379829163604753054286149349429594123992657648853563455128051994843289333690934641344367325679588899149906840431942210283713239685779237274009730551709453578542768374369553727985260725484784373426791435574678596063490813999793217251266864156485186943714721575368901808345564297566813376622449744933030097468634744925639661407464376405651989224221162037621150364311548293609244972840095233668840294679103879406951489017216549899367396255436911390301621522852597650230891360578212039712338608128) + (zL 120676449116345336850786851582854579127440371228411047276637258495889675019821241967541989961682920099769787539479139622115750799956988864551175514208054084217959586455020626522725812862288666901570674072339168773344228633061084559466625570553708234781486602525899593670012086544625267016095406702567090924401659469322584820101558609584349698445507553027471271466042664999814854428375320632048131918061891329255933476437428239801907669589985159985381876258438281007711221210253332654463395939913479056290916359411563570097326801856880809399730543325464705381905399419638117813874500546453475456811791069327699488569110968372124891308491582296697996692467239155953209142621833754335147903301946514173251853389185456572959334503065908765204922315885374036494309264723119747130579742517393252283200634055743276643095203698595157571186781168914788598239493487873116704180459267022172867144483774613894266266879029503088232175898118137830968028005449449844831682560))) + (zN 32 (zN 16 (zL 247114261769743904995325926680580537797825095340433842037215618620884753810468358208152900226289402263984143400908861040973951640213602870182795544551371926825673715297118811738107668501934590481372663109794689461861103508629843444978916440517038255183798938842180937024291907884514499719692146731970326976631266979886731994176563676483635817895057665865129418211021967167821147125100688837749226912293595055719310592428635571780110731535283344514313789957733148066112631216350207304905915192984821676088027699218240989841335473404247206125938205983692134465706673444020112836060949175910660231444765783493565142467835915094452401567805169343278063049561727162038528063248955067744586466244572014268830800661992202484079575085532660301806980691462077090422067173763522416815943305318226741318055693298332388858645815448540295003708325342548402577141767385595150245842254690753778065606464458382800539985165767432690345290182802355770445336516767911388090240078080) + (zL 3119008480759536711031568977261101720082126824620769992194599372961166719189593998117595105919646290164356734478755067330109963099031445978047408201751124810940406430578685440909568453375098132994146330019610464610411286819590324066019035135906873419001585238804622236019392912652286160072098782253139463063455534619315572668428034353456653481847449517674210320338381462398952764841676551349590176798361977005783927487031704157616955197497551612535739284722150874899806322230553864248060835755253382942872203472124118218591256904850865677500182283496146246525254668615925487263965851293768492149778163723554145671654587027142942416156711538169745441031582460826268220833151549459041609516281973743519875015846386479195616162254085243478525370745379037281019844020817553877530250875968774301444068507746394386419649857962446195915205248041946998738663908921815042592353544603963969113564561259711014454383041653181383627661553864540160)) + (zN 16 (zL 6241639901442282956985597097374883697794176110328696209226851426960048572055912499011916862918754400217501128768574329414543195565208913347225225737793126869363327428527205639477024466281382247186383780695456886623522850891721890905176930621933796616800317704834739944928399356676529964167939012563387467810013077718446484809985672889953348257973851488406828950911822949065486387094146455020607748863221271975512619740915417854986338353505663286273602791102532358321363358229834074558451764158853876435289314682077091265261319860732351516107206887415667855450581513977962410260710442904234466679560598234111559087638751159546330981400840843410126156092123890117843880036169933462750272729283986802139105917641120122167751082975513304786668025099742303769328259808809596681270604022740349335423880169207752780234301428201798775743322788847001179507723012631663911783272489494199606648501958839942228545989140216341604174402599950910784) + (zL 1559909577344633278266149249733542864394594161456135125603387795000548269616932871329764189076623071564709843828880546831245415507935505049828235817467899279058959311875475707436259701605388114349198944315518054339953276621297201778494847487109485970930230224315495995186430629015683204714158520432626148236495037368343492890346217676034135776044853819614392063969224844659049805952940698975181699140818003024858580937774368112309314082093272668403567151759663488516323799181399453294081909730987437058580540481993254425962667359545053138084602821470645964824279781657270143415492635208604184391988340228378312300791871424952908913953407585592395516931589585857986525408322184808819339448403373753245363359601769820653913527969493052836517816130204321161592997910923976815241067514884229796316131290472386490440405344119436771222532846198674050444081313806831050841277273298156951645706682247397508340526059775392296862143586594979840)))) + (zN 64 (zN 32 (zN 16 (zL 472251858793948381989576936209147113197293610315983074194971342029967235117798681887344207873578316489301827185926548761820905900135376356595886142217884805563747787258277981604841683814484012971544708552775060350713275128032273076139092905278710147581219749827271892708627824681175429709130690493176069703470267259162344974715535907388682837812660893760296193896129078882446553880256697572350719836033342620978941588690829658155890998433750189590078389493256323800663530350801210625160717090306730116798085419122305980544584887437646409282406893084226765111308317466306724533420260614278978780218182765174946684849212507806521526762900477294478575936461786585791045140540911614428226398990982315571123005235032173042311809912550517133049438837539708739178907258100371519597661504579780667207833801705869127394554060965074959371574724945850051709554331852418074438863656958614172074834931951522859479495874564038700538002374024747422810820348867734012952576) + (zL 432239689105894294255087977875014272794917497190982487974625037988867818769925030599731441418104226278643845938861872884656829606857195346558527298424629453609389307943595758041887316482843803908978676176455384263055083281344252859389879830479037278238804260781895578669893079269924197060533325980482440035060265707945999360839832229307135246374176245899962829605300511284291193833601491312200921719652953045252885790636536220820300734117099550141083576409266020094390727293624080953342316351057383198215243692550665954673261134332405689136909784298495044479086657276232491132713461685459109412416588606015352064562522936982657084077117831755383343198274495318064439762972146911621595212548739322996176366137496893770373849542215043499414978287910374109079290232714582720902060665463869490663306755673439534454061857562848097653388912239080577760703522288183068654895880387533236315326444927045230904241403713276214143118155652360497677355915086969842388016276122588151808)) + (zN 16 (zL 298502883087209430880680101444910739743233432579298097644507015060165343740510443397924261031907340641752713030962027672915458204576088980909131937850161949201809008548457111957380779791702191799270700862334535258389485076022409515588905367736088748948889816530674965665476484398331865826418001257125959300642967483657023936766952637638604747791311499097267130436880506994373353867509965840838032591689059036408574787856028529875920825719468840036805495092602836417038349187006729406733813551562759615426493203406641869899396193520494826530161453398027749057101341360015506618539044402030379450285979622519796092073402933932077984206971114854486905505550060079428226156680333539953569064884213421541635531219426584185442014187169963558329122873429461001383828341624006205673373355396444055956291470650554739693088056278219996835355083749300170056434493945809528062876184163901510703562999664864477500856901294330010555152113181540606150887472606922635653662644870745948160) + (zL 66334988327844861002210518819166573431904462168417922558627701761241963178438643015052665488139510069153226280947461832983401978793334664743265136177269133521740271030197195235806084246243670711185675143496983885268126405905631759624342577044141809041655328683339731422434006114976051186023939307481279660711739450974565249496547914008199512706066375842967392110900582589014624052646874679429990466012701819130370629964907586268887311964470155236197656367904501757910279806674562946603441428411656674239547029388328052209892053245163101898142426831397181505364795809786835730627394258790727196212759820037105393515713261248811465411486194875428752765352145141339087649578341313107671806573964599926990841116807034691566985795258295167679206216454234254634274856062166785625639827687951683201459492661594450993912277457221451411166104813129428661063250075001044703045216688807570796405534919873668537621469155476394399650573202002741198699149161300368889225589471572656704))) + (zN 32 (zN 16 (zL 3212752056437487518119351054789463894065768115412556418645288041952967201125103168424450327352993053056488248973669840221381327081819386943687724467357675472973436118953207175695818913408005708830921367034920045023939892822751470433371096544106499484816933240465071946782293710358885801325058955301913123003727804146393280666860734268685223724284398050630098327655950776686503136124898184633334177659314727075208045816424989791294788064783881312912820240842165445339005732587635412044255475810938880850892702666352910243005895202601076120728384374953879782386574899411291186063510143295687151847586818483683389662421488056403723640674591119644948741245124581201417909312994200933905050448641972106054189297399275418534348612234039257896089264733320589924020066765747959157348437321273687623544340530964119631208087969438900942578213623021083903661738401583362898704546240656912558457802223980618458436888413332837322270846438608183904086097047166567930009420300288) + (zL 1638478515858725814831792117672516404303990598637925948208683452679757244256823394746663890359276462028849784375142711718434439955359824635416778227915297129538599574669796645918152787195495643424837862442617063559095091262589858368760112250728572763336026437426453375491035973549220858991647846760348843834220827139836371501833762604346572905189167519739115385861735302210769985461849792205021657595699532761139158392988141556555322190877311946414965883389977760652237366519541657763360093093306433403024228489729378034153157972794547044656718431856811889826166646935298271066141330229611978870941738447249296066811403382953959899742784182719068446150147639048778408358863361383748835860206051802024136052021241919393606122374034045996265059365141983261984116736750091139598553363293217798686447753544855379785275088083343421681640809158112638329804643770519393196402062882722037378934977027827835733637882150819510607370480566737207074816)) + (zN 16 (zL 4145873378141822142408072618576205137133210210580114950729523490548371632665140125623587953996551332681869437818065318354593050061817587938777758927365919317088162067813684086861794727917669133287570682926536837433445228721072042644375015777739768280774608249650982379804214315973332847952893395934231583777175298970340736335433608668373292977165915899149114558556128618998135834161529104396060680566214534411008529341545734826260046896761624603590299017815386678121142270613103772463206788121002586208978385379311990880943074581680838334670110023342982592019845557982374043619622174968831572938236817353149431459270429312275122103836198520159732773984582783508397690465950486449272075188928829392496211150358446354954302678552425529814487703784242057236715986728560125303984055567287348892363043468137538761008958747110965769270185301144144709311821754863178762212896943035112700315571113359013536164103114139783808366203648240023214040402225137451798576926298596179968) + (zL 126645578983928817290493349979435224738872461225253799420289583206879846961731199417892145087883894011702744306366859510791845341046800188899685157731360140473490676592267750248500459706632334940912943773313494532418660521382519510359921808929906701108745908553446501976913864696640017806204205550158011511988752293369321135312653770710086645761485938589941667163398736852943744031221772859943817677283359000662949291286737470874207619097896087683694693951491339242989789086417365807512547288213215884506883022156182390249085975983328097908904276060905396278481480917636924065375227074890138170344950156555112405995594024902599984688839962111624454512578630474554424423552659470914146859226489424641667264113614855357918418390680334207816177117199706367589195557046914948761967611017158583090723611599694059497647744808529083954995163503872741731841577386884077720148990580823215066958060940854304774078954053935349303428019696205503913332984554006790789474461679616))))) + (zN 128 (zN 64 (zN 32 (zN 16 (zL 4286906209130686039607886475133423508471490910174499792138641214709758007055779626608058294441886851765748903266518357256912805360002782903626266435362453250352094034660293351232887428754110348994664195376544536715145727292569825563026106338812825023934869460080590373780234947689580661242543171396301035238922448589593614357470750942463078231755688271238927330106835795899652971721575791200513356907037709398963119456827072177450635239262456049663896167245734593299304110744615849742817826633933672245752753814395649617335443890183193239269282251112135650853527992550429897842037809647764682226359661206580342656422729685192866888194410658208950159077361260758732598511697223020337517130650071018063359256665035722175042223519674395767294286802687766425142514031641057883061874544290575710543988424222108088008805845008202308279883652248138585531449164342818992342733950743147781697112782240227785168961009699479033942870144078226685670587692305058892047565232155918344192) + (zL 281919389582364459020556483931640290629097884930397274280810105840072055136549048014016779866931201221557382437177980072958779633764689298607110585240287772545480565250558560932388695043138136969454388553640780271056778377602748239020703370877425063694799939305681674605389390802737109080617979916301730138055350335577543013827374135903875682268836999674757776306432383605160170284501274600789241766522168067583320400584470659798742541390899772985462121124256544863031289449680663181110327298234189314935833642171674957889994961122330493410923857229096660760559826081522236775773444404435610701536649259196110272732148994941906880061543693790873172242713771631192727930546137590256962221087342362620746139170879605962553644994960741355092351718599155286510966972451337742744285725772375918956182777566476383353081713399890027031065388540377750094063082943192928935675799013213328464412912943149160532279342216575332040609637696164408272125373689950817873609882665527312392)) + (zN 16 (zL 8291746752482814716902961816251601764190607847041079469684454672969163588640012239239171347584016150865035847485389637176462355617272638384248583628439748037122975779637188777217478173690396151238354817720318147792888890645324040309972689510334001437800810416351014473726940028449397877203828454863803714385446732674716546862667246153655110306189397311077727952392381038542669101317054007948479177471147810484419774564012806002597635455509031089629944503550051422136765064613206799860515406727604195418614412889290309018663582526009962795544175311801836668297435001339630144971721708567473826472160370908029565278461850732107948888656925854361122953745087819695964260775194866644395834132070100539494033863049005120086044704473392312604785441872883837990327164258079696895046683101707263667424410663433096793280811440452105572148692855350676958549115606124004379562950779983076034918309886766119804415102293923062113046624618740832479982831186931465679301250738391351296) + (zL 1061343584340967128946861085573332369880068378177045219816250137535149461939932289959865696584733891680582297446261732422072808155898612263132133946785652150831328054358287529185342094562308564145615959828271362222057782328863412447999858786249216318623593042367150090914235503757378432095810989077078813802932960097968737525061710151138061154512386096559372736095777226239737084890232361405533871319308712010831654637098153273274379029378308785161054076930199526984512056159146392061598964438599893454093831357097774185288072464431492781743761372659562792029516052738045502411173258228564055428327525526223582286641556402555244581782238931302917931918740365935232741352640268665056636165098207359835549725475859709016717649401633334327296254367306013731370545356882927633113039413362489821978223789607796175127854812863300175370719080536118936254830257461458622826627338215670645391893736835292861297401789598382058632640062324390067646900384302115552449801562936204853248))) + (zN 32 (zN 16 (zL 793863369405309749085737230106071281439803837920743793941290395142793238091872681928521743608433414553708877006096229888011248981510804708536080739797577808162646736850617051506284468523364667935735159131197948742482091022148487172667020405806874482143176592756927996514577669342723566036902344180250027598501842823854739750508610578669938796895016165372061799383985999788457678428924518568002841065505886510940282779606565427486495076905481868985043023567459808594419265552567835746692411176758756869658315298736450417761640710288737750613910208945482968316801405453340100574303681864585987109758118845916581363085751559816977131543562737100854235838760673633044079891852022082847402991370426111135058918460548319048078276723522541185106544841602176351822074372549309092019983382067105027992989098723220658172042983631669672429684933736296617822054533941954187277212262041796527216220495335147074805578907754448062607465512409348318234858868207000900178494310538357984) + (zL 7923132728249710918614833572736825111354484597415074292241109305923793056347355673334480766244542395353580134387241364516165137662761815762656892607104576242737752489246022395299747066554932215220752964144695529733203067843183578537000562740425167341020836777358079738474284473898321054464282218080099438222252759995258766151234032508572169209141306964756280719870555430872584593608047847612455056013923730313782792099105346077523864540374977670447899237229021438065361947755874045864682501298203892461972174235774793136675875882100612658085138121325708280116778312946522760763514072194346569907391440047457926765727081619289972421322916890962598447015117308878148270522695360465753745382544380992296021227498551262605766080973633072390666479585092070514503932718624247980923098684300678503098527821403787427356805943302254375795108535172166286171808361212808714271826930860097864766931224748181174392920027146494523084221698067777711803534188851602197707147444224)) + (zN 16 (zL 14413792872801289470355605341031240807339490401819283836176326953963641938231876950926674196547560600538359111005792239326282840257654504300234979676962255004029152077190788122685559996168286224082423247529814269184168101586348455299439543546970008766662380131132424067435506839379034365518087142215703689600131944351424419712871381039984751448597567642470077637138300782381816063609158981622743150012076168364533300227790757535416403777028454030671060877782859865199096570828265743577473714644112903283115008367361893792472175881626551301121728313193280931514435053839837332219262928893699813205585180066325020560823929983862021967157812088730380329785042008352390618711249468799403163925938225578891654796580573498406374282439181366160660118549062441678373194675306092099499471706576891663813418516607341501064655811546264498408403311011742093985536226417139329387167609878558556090338268425825890498451175660680667548396447420567052619411635090509828) + (zL 2122824983465958688862600643874549920564903827406034582272050969358528393143678558624180657319879034648379236689701523652254966471116186438933654413440420113900285549921823118466574462285572411674671188143383774062765142835742353989259588904217632338142425207090560184344005340248130957282134793013850447923232224873384527935195909877438636530303599466244223698337073177037044973414948656973012592795842324241988358378751113128710001366170561553133425111447758640053437238198772756143073186476726114458889181287017728848126957504288331736471131271678915691812819436030918953970985540360883391159948570708332697422374483899409510309286468605464713868181927789659738464753282559140749931851657465861686996809205051354666188797687131319837144324736723797827832394982986663623323320778513276234522437684859994849818322869573506023131544320211476638066340149656709561578012778395762893608162503611010124879404346055936270728794037853110990278624401622205573625891825482729521152)))) + (zN 64 (zN 32 (zN 16 (zL 278003425503846467399522257485766331548991776494580093361385484766485864901490693507004989803224962116493253884042021384932336638304901461351092798258495900324811255505436957393701527492951255889062094916153786135507718478894954409477955931069911730716157706137414497694691731085499263123217558173843187074335715004754037723712190215337100143641286554394548013654818695429955380680238704522533619704863706603404683986215816538153929446538272801734488829470361854510764456614435368503162088093673830333109356394477960783684658206615417547757937004118916133064775953623382298866598290672332304737041503162798971963525768148097587606417579624572832487350855115131560768815012195671487003925632661256040877755522557483018744005516859603239187470448757166817475200309733041717669707937410419695924888758317877353274212290651526196723606582020481309289722982548614221234982790819272194373685415342493461472135190820851290781510734720186136161609470497142385250484092928) + (zL 29149781670664485267696835917414722298483845123877110278388616339580831073600311451614341347924708155038702683368502157139771336803960299160043429929043100715128094875409272068407771173405189792095289730216605921633172903526948326961099567126806244705689498991276471508802861357925173803520878496210221680096621524875202581452246166891879431556357636139292125804192739002102380311574970927419881426984583696812750056003943648755806753973323394158236792513671719752773075685560285695642566378460666690052614318906546417980499104077995071157887531831301713209496292374916851277136501130693187950989001706666411232817494417759482059392689625856633642381181555265931155379123381680785368137434140271011719562529225156584466458445524886263955278459005535111093082091631030145174548647413798697644434756002764570621426720046234154013347008464473979552827844085036991414194885858978465748470741042239937241048011428112317261772669398730963855214364327936)) + (zN 16 (zL 52343057433713774369531305021028016401312147614802838133888351965003753832829121759351289669898169116173672544215390245109741191232945524599033848117970824969887399786078556546764494505511097461882783396536672719357643853523790619035897702091770411511148023355970329567146848732343152151801857638506136413492809007422301300751209671392665736018424287115501374115099098661516317953797425514423708452238962180290625501581592881653467907387747439428310601252363801070556801794922200749998019683905659475499105440499486146154275980930277459023259169634386248632906857747339738089278527342219110996085970105603518980679666861277216198324687259012997370053688446053430253829398345358635134685081505297848291318623163006569579197498952202792826256160091722877397390397555669073846315737378114450180136539182405080384704264755564282816537709882305541703007642784664446002629118863935713305682237034268268559457150366662674251398627015042520557027328) + (zL 120660797634327585883762768728609177085717228087035386370463148894705755165368314031276128425697572604874559730121165275610233441282961591005815776293744004896555044189814020306805720387708615106079298938123238532910391390503607511492258812252175912748795056345479037406838031385364089169260429412595629978495620450075209050096284410870890008100213531576866874955163097186033234117606957573399415919943849472612281518130432314683154458871776357726027085117784715629929694266245214231023376754835187695706086573738267199799761816156479692061000117526900603997420860017437149701368311906003485447057144479427352693726627188235200748300190302320171740644004323044576912342987187309505628356913506018805213296237041892176692616320027254092014533396512529681605724773101501781764677992085286965400495919363740886435265484807307730033420065230767016331979666926648566444674422528050430169434204701867846101758963942472549765428911983256008441918792955044382168317952))) + (zN 32 (zN 16 (zL 471772138482638190759240159549384811800372702555855376036870451804249227460843342596109191782029960586192481582782680963443733375080936947717581597754215795604755820995142418555930553310246082663530245088801795262257886227545427599623783561070335460317594349205468692465172112372353848983851704224023830792495882188432181985375297286670327266135706241638086240496615252137074745786763473162095622800889667617241652345527627982720417062802071824554378560293038460295558300487025777348111001870484678542999288211819202096649922321615578175867109969223120411201613929377252754134323782245332809215717011219141056324370122418731687178016192996887600941292511902452847658327486749018322352590733723039087647467182095069547857783580665914763154607876512015973789146478708721649085833663349430932500182070563301116511291141631924082601057793787466864754171386117124852339465174911798381621592364592675676535667555874326057450039981183140723253313536) + (zL 30889163737699590809864672793946980729360244248138739906657231037393553584000545637150760495363786334868447349074076894903009813904925230417776949952519542715832601751971480594395747150295022307578936194395421697932667969380146497516923960210110529954847034602962314862120164145764424576340586810033343139353391695445271313571795261892898342014157645266885789609917599747432092934202234030337037984821441746570537507293595838617688728792762310587854727414996298781412171353154694624129421084919648749509332581669457529229332613974402040697896252969878858317043135219847773817778603498634113482137992342671562692747832904910948028855090716563765712988410014612525139668664286963966806206290471183736220390042752676471994327187380014569913557193135167376981164863221154731547574241920814489463332646690840808835565019301491378763168717812223837467191932560077369685889932807201255312062982262322028742031124054477536182734950450862872078794620884006916068885921792)) + (zN 16 (zL 3045906710228065830930535866197510735348383758329863784000990052330864258200373825830404731386513099270444986433643383473668155108476041736388359033951726496189034689986363819930089698557700227996110041864323518985807230855339394574136595156402529327763019581728949492013253179819709016746275565506866719183504151895648379820654973437935557022912423289467828684756483124393429820346969260156753894055422089010577198253771115854310249202210873189977348897290717277354905077863522722859511079497899197382584255959851487145285670502129776100557113562692260574388352812182329139037659772590938359433271067227859049635382102073643505584567042773976526351619219245271913668267083551269046951894112444661011263944763161129924979227061672243021637855035563649993962048181012011642740549642952911742346744757005547264634219855780100539528352602597983982099425561089870314591299437765219890686978441879397150827933479747905570734509094076416) + (zL 14822292058641938640516883528941902493610356933022953137264439984897591030579200)))))) + (zN 256 (zN 128 (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0)))) + (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))))) + (zN 128 (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0)))) + (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))))))) + (zN 512 (zN 256 (zN 128 (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0)))) + (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))))) + (zN 128 (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0)))) + (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0)))))) + (zN 256 (zN 128 (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0)))) + (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))))) + (zN 128 (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0)))) + (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))))))))) +def rmask_idx_tree : NatTree := (zN 2048 (zN 1024 (zN 512 (zN 256 (zN 128 (zN 64 (zN 32 (zN 16 (zL 456336298311931111786067023954753124403529698364393441162187984379967947058680811637009901441665898206160857455123288724521016502192672144770139173764711296782954263333618951163888100103621122413017224349773168324312142239928624353299902270677799061431733046326224922102942609887443402070372616773579236656933483004756577315606943166445436727650674223808074755458440852459626477421824433613006929701958120146832096488420600322740715520) + (zL 4309974480130134681308478008575631688019630676832336709210865514987073215018328298093215164902148091894752419715032031347185293118988796339782694894462134661485483846469415175128235641506983025295502298666419344584278149774265784731261871089685516144382366828167839067865705039125246644186106944518029222691858055931274352492560640945715439248230586846204199723887238331692879175830484199242410040062706421149525865676125792877771493518619286388620161712144)) + (zN 16 (zL 145209101137196920415178214155581788385624923331230417787898608426989989004676374884751896863231131046243468586800988308205930764828483588121132822603531607043678189335017658683416353084400169438751802658783187585623596048464628988180917316689781849412545147369913209486187050694146740015569092810891616201604023886626686951515740422950777174856018251223132533767488168187846606747371191266870986345081197310367621975349047945162594647150069923302969704448) + (zL 8619948960260269362616956017225609394793859556303413751272578497072675531367534758048263568627325878426058967867711817784829738509494505201735592850903281984994336410793505984523027982257783890097223065758719021030804900972548283801410517167808065783590678751594440628446210502858027493775463089741979567509274967003609857845277569117579457428154978453081408281330625977153988137979199206225619790062076059201033717476409291446913041559544461336230469042176))) + (zN 32 (zN 16 (zL 4743742826449872438500388389005578056681532954400922766049691030794545262557615508804652407429441089675562265461250660732722775095226206120521944706598115114367036264960857427663323859846336613458285637000986451011085151945754541891189856082281950045148669702895823846584893480005714795622150127941798018350915677929609961582148921449278004233408607522713005996478749667838224861716467313696028190650769072208064596424307410667205999202787502520746817617920) + (zL 40015670729393133814518953318864988798666611818626872054263868440190175068155648435543294552037370615122250924921259939698701070091101276525232014038219247905724753845937150856502106643529758808492072782111701880801185600811980182934093717485903028448060403411023794276777333762739314231576590984035044218414591500733270583481191052140956229405593841714877158447403785050182751290302350125593383174501283981547715885167515057478352502296289293309874245363302400)) + (zN 16 (zL 72968446926050637089230139774201780465069394640380898692401605424053388003766197659010869345427306110660265255914346191166212506483810230041426653114124476944903166361281442115615892528621850607749832995353049023126692867899590044778536074856356969446481870629422524971349036144582340980106700404812163145486223443077836141479342516768897783581403827184331490404799499888457721645885615829579176691245576549087144385715985868158820192149166074527267801272418304) + (zL 1017490600934115575133059797800129011064120339015041316445788576529106784024587849095017510631055524738117984880301036349074457911948299093145686709275579256538336689198356926040916639881477280930519692505463473547460054418900902116795625552109093035772358180642805710605684598131789616989434774101273908323603584040222227167418428585510890804830481689099809823193721452637946294166767398566700342061528359308033249164297773889797587130469079227142504448)))) + (zN 64 (zN 32 (zN 16 (zL 4743742826780189257062453640005813071703922853034290954603754989497722087637224343260443832543402535126049820659978398816931106943223582467229344525367615041542892054855674297036566450889443417117517788670907439815159999534128292518934627427580606335195945219802515513617449036559786891115063230309236696704334780640654659055284932877993570847721247092008791877864972886858512139401091731711984671646866604425471381908296547970509054402522302011274133307392) + (zL 7901621378789817877472960211792894430692454619517903852839722901790256941697349080365078131008343658852002969254170647783198663518685268532479931432383270506345240601606133763374179891547233954160562122775105578274640445820991926073464748316778450988830602337276281395579989048431515504215238145920912241369402050747040410304926409407120063768147386651815682490936462240273873335414270068089229390100554020536537286933447750909983256701133128382028510658560)) + (zN 16 (zL 119458276758504650229098519442101543340277310584942599491177425870377967619092764379913255570204436301090185695732580743120820622960212773009591852612112513450855455852961379932485635038136673607924028874042183166813157747119549015389569204880840287958058888402684647238829755898890093268296258003792805950018137628522914135249288707965313838985066871720684229807265226198598379949937650742392400503794220931511897798801009169128133870950810317583874639704096768) + (zL 40015670729393133814536903823961319491252437216496939528023596919281966399294643436144464105127677779980091363655988363348642608565086307243816743394538337881427178114414017819107729721413956991975356243755677979376046120997294279305563545397698287441416265869733075945904848632917244671430563759624174649092523244948560253321836343557874981210310367695231800981759796077017325338625903839479479639408884711496026022957413563538125834372075746844478475383865344))) + (zN 32 (zN 16 (zL 7039626987989636770217193836149317768367442319853737638961912117311459697498305274479698559637885698690096368440506415479214255523730938268384868240043639380386952378965736600221498547447771433186624804635764279304315176472107632124379162042884873068679206722809470609014113098846568045260309426627775712794466318995851604269326482893821429718551043646232584907264072106947639368684307615950161985887417268523465246765625059481955707284513029060235065102372) + (zL 75358323461099357186628924872534924639327420721379808366735320220572718710286834455989187541435115436523138021859255146456494784518286887131144958272961183354863627237286116391235047436208217152588679864853595886931713987530525965479606595890804076832385978304988125141044832305535006224508755020464030015667274719263429765438767381382747572379911568866548751266804061490449053127395986704050584877309834711091045156415057042733846806263692455178144039441530880)) + (zN 16 (zL 4312570005448396424565099687553861699317777360164765639626206234155067570573480637329584673596196060309990589155509167397829567943934512655002741427581541381397372653775707057642905565072673498427976424854197015811192164561911723355011361794188453909578213640264829582885620440981589618505064775317718491692884270639674293712924083148954983943177548148418759295170405168956474168443328386227934336098776329237145280137614256781461907767970662718905339871232) + (zL 70614626409498347144613164375683353740102305843095259904147357072525974035992998598495496057034955287529567341308540568577435133666467644276866993157282530674031959776293334954584405969859622647726944159739270859172739931602288973038087738249263530198765168321173411294764579661214627526501000739528447694320309497973445597803509892074681471700315800203489833485592884330068631638302577681753852565390518676453361618104746460795997337570169269611138159543844864))))) + (zN 128 (zN 64 (zN 32 (zN 16 (zL 182421117367738585888726407557488029552169814233790054041180263020124699844716777818653423466777200143297478486023641545026592629412348284638962747234864823564966920279918010061737391852856354670041209197653044648237533210228199018589669409106288245268190485096436903904925160964114786007963778474653929562482342784751067545210390778914490818026942370462355974213111342423565348188885637717432013002514370847321652541841100534962298993812470068088727718177275904) + (zL 5312909610317694473813888964103841411419563167921820843608628928380129371346209525721481446099791484709257615445157363148353611817953174024606798858077128495700168200872287267574998497276845568221735107770853434390516152650463693974635516452223192399332412951068704424875111544841211549663673869702401838375491827718701308786593351366795597106313634435656298463421247756425069978780152596775045303720737597546252095727623473528985566173887079823333797419548672)) + (zN 16 (zL 8482526434820306529769194925627565505487798850602511269828921422389138842781388625709033746411034317810044839575005204293437127396665951907929579172065080438956165249993982557555737067177392848158783308926764862078591069037688277282191621695037979226294491138542016477504179028986688638564419210336718717249697046044732108573391841652519316211107564018143232033146461455533846178076368918802267435997644693165399128327120547292439706308610895732152878497792) + (zL 112406158460245657195165077060818343266963078310382978286789360968189090885146011392804249070888477940960753160100594727930007476613249039686796950149125332417808496696701985456848588062203871055914067724980851425519327208779543190388837780450888487874932887072582099354198376946825539481922141665049536296599039283013990192219602943160727174310306604582083725030782630852910334781784487618382754907894924146523528425728626547806217752932774102391936486064783360))) + (zN 32 (zN 16 (zL 218372478409123249840773510305112380039058847323159050829154494745277150438741072516561207723200802302395776395862177602424455564437873100194805759437098517595532771602077608810869227046308971845595581735268072006413433758122913573733335042925470484053806665594411754165847548569558329540894340172556432620473625583734467494109849741779772578229502683036573727105118518738016674208935876363311503650808985062529244115260525251195462781875268817994971089364582400) + (zL 118279498670445979508209541161478468440369766793754127002654136119753875617303594067216321165938174774710469207928240866706040256370480640682651581470999516176443342139387309048523941828630905631486367195257672691925700160553109871128461738090635850909376176323962361614710318861117579940818226624468692248675060390471850361248517793113859145235990963871588915995317775790537763965730100125483856667156970606006990549615342770923404770420849180376547058666962944)) + (zN 16 (zL 117102588236736581729043512529733199754517377212595477416528141576134026497998323627934905888153361077714763585055915561114882687202444480210734165449634716222792694122565493224262474414081341019148458858531745143596851004634396670485473082897781571505201174101111634662333947693825127698326754557325692717534000928071567791437867792002789436422677390800484731358495401417560262981823641260442645103873925389633773693852983392712403563829252808148132985879658496) + (zL 74207995656685388044442535544942223857419081353832157205066183439602070512251565484836277376311260309163869397220981288914160922844896876482579002645553447942429363803860259402908503647411425752884825838202578831445082009525818161651664008189654687546125826022077419459114968577513992924709561901831092262110996657957935607452528773945432010576451389541991168136444303476450155549374273470584609094138553840701856164636732020452881044701521895421426313057009664)))) + (zN 64 (zN 32 (zN 16 (zL 136554789111541325794992090251466201880948552236917922739268918178757297412394957924355864007808774969080320263298133430006078223150858154189240767263715172253034708974573234481166286609785252974889218525119594380829577199496849635628835603730332614594860326726237029788551968931266071249376603302681871623423030674274786525831854032279816382557394065643438703316418293356869685073995904309930185047417080610428467831930442379814066135669890754348828827494383616) + (zL 146560969531438203548781330197540277269221298364730821104662409862786537150432402904937158100569487897162816676460261024514946029655545839056947304107997119445819851637096453191122215515244016721913127739428461352321041185211388040765729412067427961559303133387201502294636278443505199239337681417314666546463389586899854158256516139334249575295029301313476834813360412278102990376940483961139879154049678301809135562149933900711887129687705328537133462182469632)) + (zN 16 (zL 111244337706223300021068213856212913540527039463698548307442852327712192527746811254873463441790796202302767020341328996340483843942398094380557886079352617550248814886519835468129532951033057794525381745871934109885922560600093253541460773847768217837351332106381140425231223193035153495148066791310679053478208528718583652733889606596734283020373946772181078288361530791062580184275970514140470194807355121654012832165620177217254792199515384301683977463267328) + (zL 1439466180639657891211637391881249445774918237610615541113428670751934877515984720476079626062933979716975449754446305947658774392584150447523719910751198847285199771725522438633306983349563059940169874966184313268718902231623774231981144098964449358621624305939072436328541192762738952900314709953011343913756656550357334754312093607324744522219325908078669230234582818796003789760133790124694054510283191216238186412743761094050542679049290748935536640))) + (zN 32 (zN 16 (zL 0xb70b60001561d220f0000000b40b30001541d100b00000003a0000b115200020e0000000380000b015100020d0000000360000ae14f0001ce2000000340000ad14e0001cc1460000320000ab14c0001cb0210000370000af15013d09420c0000300000aa14b0001ca20b0000330000ac14d00f1cd20a00000102c0a61481471c820900000002a0a51451431c50920000000280a31421411c42080e80e70000e61490001c92070680a90000a81120001902060850000840e41141461c7205) + (zL 8915663437372857232816970217295999262528419414527990119234773451497162112271113368361160245795511564762586471974777856782386388626627889670341311427628748017707733406716254742397472003600519182172036222386563687861592167681869535359795347823038117862091704176469732545524249277502209560646109875146868866322993431422493450276385566993038764492944344262103939523087393466194449112400876588267478991096811755548185786086831858080947596405678930616720361062400)) + (zN 16 (zL 222436072157658615292572233040073870903333681559702268185659142418717982300458445192733042555699091939689487764536241521288951719620662768052447956957920087561782012963088362860887141718280518928623373282655752808562914493935960633388341155447623699320178398692923144305213836159242253277431727766196935673622099138689051432036983020738633924962109632756446450760432744710799575327341905055544450054132088024298446185126824993149940600992731683114545520236822528) + (zL 345439439782615055400184570335992648580113342669742593642586300985135048078890242951622776489991889057263561517466307207005220516768298203109681564838565403437632102996786123024078791058002990253431624274035752939996480056842537917728504511974274661261437011470889879195689290240551519478322013780704600365912107112056226281992813709197753094175404798534872772529188945052671211018593063139769684717137917052288995155286376670508251104427191029973025486853373952)))))) + (zN 256 (zN 128 (zN 64 (zN 32 (zN 16 (zL 25866125246009621463540210929845234211979343586720619132186269312311192385566982385529020170684264029228880066024914690343024617932771933824878566843219132400588002660430152378061395563733036732884792106111687575223577600238649998832265913423340631796630393659963619628852706669165282414186926830404333659093044782682536179592845083392911572795513932202897282544815152844441582059631311910194948707955984724516097171340270288010214312987645265562489128484864) + (zL 0x7c00007b1150001d42690000790000781141131d326800000003e0ef00019b21e00026700003c0ee00019a21c0002660000390ed0ec19814221a2650000350070eb19701009306d0000310000ea19600021926409d12100012019500021826300002f0000e919400021726211f11e00011d1930002152610cd00206711b00209421326000000002b0e501814721425f0c90000c811900019221125e0000000270e301014121225d0c50000c411700019121025c0000b70b60001561d220f25b)) + (zN 16 (zL 373760124927409727441385133464291154121580399561541483233302303372788701128892498504022600068677789915387270975632896640308376962604498235626239285723059246161754032863501588727894582299677181455848020797638221284634900754461473150591477489580066180185741347722327570788931993550708932755870913394316233903529452061242130105673632457735662656093835232171600771819118411469859585346117838844931017321421671133106516863818691492536153804233165082807360587792031744) + (zL 387791988250260597345845748720360722460670852015660358636373211400555959161619840938725613057178123704589265740976475938761041794336272157900585825370185987370206713075164894014722354406293511799001750696829046897825762051295812206968563349785120932515181925862138001200128521654366353960331589583881572805754266074830157294076166402530778079789749938857177942641095826086238077829185611820837308833509634022832105101431540680952954571050949808654428839736246272))) + (zN 32 (zN 16 (zL 74145357363288052673543951858606069565957557870295008704929975541991120090948199826069373456529864924384518038458255902636654470458520459497582330757088256612088038553099271453778746579057874681601558450226972653598548592680558626302499923099299353960618371362535856616813339370161450034943131387656522005895808625459593070410257121732541135672697809785404788071821228301227359297802069243505332393515767516862145209351840188725608472142534137328168589770883072) + (zL 0x1661650001641dd2b20df0000fd0fc0001631dc0562b10001621610001601db0962b000015f15e00015d1da00e2af0000f90f800015c1d90962ae0000cb00d0ca15a00f1d72ad0000000bb0ba0001582202ac0000000b90b800015721f2ab00000003d0b500015521d1142aa00003b0b200015321b0002a909d1210001201950002182a807800008111a1d81d726c06800002d0000a714a0002162a711f11e00011d1930002152a608000007f11800e1d626b0440cd00206711b0020942132a5)) + (zN 16 (zL 227143713898344836990222945496395909292023012269201565065162274993659024901010806758439504549865144996760620958737117282775034920732024280173801102993470435944219284433596547130411376303434036336129079388644369064505326363864189694878198333611821522894394593622812773789330991487744893688510835394419375955494295059080913011673985390740856368524813526880744313045886174997753518557013600605951086798009642112778474726970358504895534443342028385476911096482443264) + (zL 8482526434820581637283068753166469915446504615695121638016926000387998553010371565736743215995892407322479730314166499126792459464115713185029558498585713033863760633121002090066215606548667614809377240169421346997096671426358154571146385306916492779887187941895442542744879135586598721984289788308663093831511894407534996783701571238151366494895669126290897937893592383562293724169228481288412135132847242622291765505189045314701477454471849097431265312768)))) + (zN 64 (zN 32 (zN 16 (zL 0x5f0001232240002e300000005c0001222230002e200000000302a11c2221432e10000c70000c619f0002712e00000c30000c219e0002702df0000c10000c01590002212de0000bf0000be19d00026f2dd0000bd0000bc19c11326e2dc0000d50d412400019926d0002db1661650001641dd2b20df06a1621610001601db0962b006f15f15e00015d1da00e2af0910cb00d0ca15a00f1d72ad2da0000bb0ba0001582202ac0630000b90b800015721f2ab01800003d0b500015521d1142d9) + (zL 294816351234665870721770292154340524412079206930710322352317203739741358692827171285834130749982509752461414308942037354226632407120655722488982125885322020328739567326268700859055214745599101977812952640671262735248903934955452652460716428444980652306623085066681662284552266922094489964576891448297634787299261154106382749984793482519823259498657901812315244090682210228690157900784805968856815028426507351706240651091670158376351337618319678275470626754920448)) + (zN 16 (zL 119458276761467531704315184135568144046177686211454465317313229615985200670759079111088509031685260979433139896107280295052870030018481537436838383688280696315733416678421077533578943425431803275462448591932848644098868761295710708624409230702569766734204372985558909938945881338667455709716190802688967450303460629061378486817228033633331318359045937533009450517063354446505713463154845239949521015827323599605329565167550108715887479358396639996482877730586624) + (zL 0x13000012f2290a132000000012e00012d00222831f00000012c05312b00022731e00000000012a12900022631d00000000012812700022531c00000006808302915b26814331b0000ff0fe0001671de2b42b331a0fd0fc0001631dc0562b13190f90f800015c1d90962ae3180c70000c619f0002712e03170c30000c219e0002702df03f0bf0000be19d00026f2dd3160bd0000bc19c11326e2dc3150d50d412400019926d0003141661650001641dd2b20df31315f15e00015d1da00e2af312))) + (zN 32 (zN 16 (zL 482533278256237800338958109543347838673475055691537490555610185626362987134146625597900118289836133725452698111638995945139558542473603886571070929206881840618744250466279303971171708987871453417403416073792269533846872245916844653356849133399072947886528811177035427498858235123867470679325859261280941520091295391377990226991680932870971790415967006166804974369366411881372298198066712315092763068236068382941871053990879855207327483132273618299605511756054528) + (zL 13648255013434378478486889534694118109657238686177192300386979754715746781851904429244466066313608753084277279869657750014554068103845822933692146307982402680773523561279372846780308556447390323617843248110400361329340207608424775322089597541546868494959158514491067046860195061380824555747152452699460828727446179514873313723316356031375794487503490107049277164445990853693889436083888690122648534066139267566251934302007600375363942542720358694798141423616)) + (zN 16 (zL 502556982907114217625314954912027578278347831642072607931642227931134645872784579389464904426210625077546676504869080790428886553756977550522350943383818851158380721161037645425049405172078744250230976835406734477988434645780023718735822518446121288269234259311234836956979911241342203093049925714768886340092255140759492855275644628983770166959763838074807611550074089459035160447084660698134148818872463363253545572814398479836101635032139076327941859771183104) + (zL 13648255013434378478488228121169166440918477816114127386958990891992051436785467446335941520531762282002044978521603762331848383501490694966353922660891806112296810937950601103523547386495110367477428924082617994650905149748086754788559944862625328281371145060322359348954697062754155927037232139101180121944116355660172617136671337112174152668248183568212060355656669021896657991685925510629012148787825211313085142550685101565871098854789699296293872992256))))) + (zN 128 (zN 64 (zN 32 (zN 16 (zL 0x1691680002bb3820000001eb0021ea1e90022ba3810000f20000f11e81d82e53800001380021371e70022b937f0001e60001e51e40002b837e0001360001351e30002b737d0001e20001e11e00002b637c00013200013122a00032137b00013400013322b00032237a00012e00012d00222831f37900013000012f2290a132037800012c05312b00022731e37700000012a12900022631d37600000012812700022531c37500006808302915b26814331b3740c10000c01590002212de373) + (zL 541504906351918112683951756437017625439467486340440773276564500205912719286753859711175395732661174612461374401825132874350823151362172005769521057875489595548799533089071954221559812135391195241687044866852893476785253387806053218435022251132702523781787215058623567185283234863506222349964978307650923320960839116970171974042071295953567014586667520463252983349192008764863315274065780966679979201078946251006813558799025488673287637837143623580209129633873920)) + (zN 16 (zL 330792409010392814649165989322743305363969725871343582704141637953569578831288333711175851864680284220221133790913958771834973703513335683554217795917585289585091831542337849249185361728496555230583623418929784767192462347408637990212234464174144195821282828940291934606003550438408593602153761416697572253202114617515457855314269319822898175067123441275841935292812568914323148791403291347221431584868493025074784728927518274039525596225978901387528463055847424) + (zL 29738829361047366476050121665245792294247447049793768805864593004673030212644337745407357402659649662783084897198836058968379948976696490613831404803925186911351622293191882590076909640851626945328602333417350393036585532151219370686355323036629355325930308468850925584835307828864618662869032958915706514859909905142392874804945629863743392990376141565411765929835563005420888800334456259198806962984232158641231005539115304228033378988880149452761987702784))) + (zN 32 (zN 16 (zL 570940773011135816417033776390204132063055362956295779010719792121450342991968113190444936019837473059596104476298642400636227708814573176893625698486547409150686452650840492683128835551376107801202628911989528276950776794692578056089826530716463126753148828182529950869273080818006950647791186268042367432512357124549772214340386926388500887464850246999585369326240201109488859817406480080226381805439084345670974883691185036461143372572519892857678708728659968) + (zL 52450790020055391198099291497614613819539784885665075914437406487329665389759948186751969251796484155637187166767826875244813889350760664191593251185509239422578539192775641780796780146203879198341978361578512224243696418867949803171602199307783517354879754968257600154209342941990878604100661137832901553462627752437197192554946514344616958757029597623646315039057934000890526919388072913157587272356611504262791101723179704725100792075799100989886890508288)) + (zN 16 (zL 388968898693706296389449562075452945330917274520442169960206089028969569100427307881655768422440370356073357486495862873844654260668086933739055782619147496329558430819614776338430659105259409742778824780657527502333691711149511365617611699237600931109919516862484716942005760857854933464689843599150569820140358376342761226338632399301977564447292790199651548199747789200664177644873405816961752267754426644756242384331593754174043777419311116802808942421721088) + (zL 19252766210664290100917652762340205981008698428902650923346012717755915424234875072147386351429147661154451327750913403431202420678701444761619484434265966485077288825310891486809686555291027132769975662170374680777171744426515102684515121015239474452451589561026178818638033143271888531542334394729903792508102492915238417705433438348779796583501406910713015147547831766835512466535599584374596748737950452554625303847369156159840719761890319114365355163648)))) + (zN 64 (zN 32 (zN 16 (zL 0x1f50021f432800240900000023f05323e00034f40800000004823c23b00034e40700000000823923800034d40600000027727627527434b14640500022e00022d22c0003234040000e81ec0720e62e813f4030000001ab1aa0002f13ad0220000f31ef1ee0002f03ac4020530001a91a80002ef3ab00040100008a0001a72ee0983aa4000000890001a52ed1893a93ff0000880001a42ec00d3a80642372360002352eb00c3a72a80000870001a32ea0003a63fe2322310002302e90003a52a6) + (zL 621532549502742979954398454842960993376073474746333656586817874277792712618091516060876799746745196757122192492231141418353658675250412141541770992532402681607193912024191177499336273357446067919585371699434044500901812001194798997349360385312196834964276793295457620230696485171488032665165213583375665629221089182882551353034908156905531401662304312740107798196091620279216023092918439201391932186125717842377754962837148832649875769456269630362299363315679232)) + (zN 16 (zL 373760124927411491918701788094766287723558997949135424356102997927351137047404377497678805219551891453129936610732411363744332062455583660016185923327992670050620332623998963206705252354444142805610186061596752702238421362204856252008252113984342676860562002903605989672712883044741676221210977616585581748220824354375965007856766918151867469162450415783668040988826143407986705509894424941173571548388501333018519892946018533301278861279326818898071972434935808) + (zL 21930337888185170886351647025695159722519507712286576363671703998876533525622479465897491905532878559353344502407540138828114753473406214400172584487125616548642150312492025117898403471354088667549897214280078380765895760702210820905145048384053181940979037776071319593717937096411556182667251746045647005841206045984525676511886203372968871712617069933834248710333444421898864042663745978135701151325591233747268752488640540594239378333316974880710324788396032))) + (zN 32 (zN 16 (zL 7160602147918621065976617332780089737122229752762515721682941798358686972688547399829758172687565547525656971676865996031114795554860154573571273836178470776188378239800058595538491010251582686598994568108834821740973506164330894553790740842627647340153704289571806164588312933517359224495611308638534810126995499588919258163755780469099990011226321999302848148776028004865903193528133909831203460097745722523473882983004500875397131873156468530233737216) + (zL 667470950168398997018478299776447863124162540289842978835430694323406127129619971228751534550000430737828207829585035077987844626222992323218338823617976306365554700454637965040992235240327310952286500653953677260282489220657691012912180230628461962597591523350364168282079657730622666042120434012427836244454181364224557219815208336568418539997998912557966998299795571344410026016696632715604147357061485127723995732833160863325883906079968746985106460195024896)) + (zN 16 (zL 227143713898345824242438725263953375933366441059983934055418961284713175612715475622504721457016647821341937823510337448806873884545815632363132339370753254796039261968879028972501544413922601903858523948732962779887452307814344318399864775192216787058357234495983161669759805367344775053083087207545932013915135593064184980790909695637286121111051080376387714282940469218419331937798107235939312276386031385456247141745622157671684105933748578164839099582644224) + (zL 669236787958338962537422414117788305677855243461742946754052256185602566408917261687766463670235771343844924461218105798749509251320770678372772334495115593467177778234917760313799971850604110697908357245772700159419584014425442759325968727038394561027367671762870005879603361339912931680774122196670496635045778910140175675160032749233279813735943685460788234505184408443601433423676844343290915764271091757278276551458402210219816243693492366163188834233761792))))))) + (zN 512 (zN 256 (zN 128 (zN 64 (zN 32 (zN 16 (zL 29738829361047366615650088251240761045911545327353312706909631480309946810852439473933627884237207104981316177493508934318426035162568944980071199571803039775642038608859857267363893172037291030520176464199777581952868978940347205330499105564555156995953890147131173431440205070354644479666325915726738394125766057398506457120453077365946732687731059854672161081308641670630157069270345523111556159322820016059718783489999336331112683637342672871500810289152) + (zL 0x2430002423bd1134c00000000252fc2fb0004104bf00000032d32c32b00040f4be0000002b32fa2f900040e4bd0000000212f80031a740d4bc4bb0002c72c60012c53e10054ba00024f2c40002c33df1894b90001f50021f43280024094b800023f05323e00034f4364b700004823c23b00034e4354b600000823923800034d4344b50000002892880003bc4664b40000002862850003bb46500b21a0002822812803ba1424b30700000d200727e3b80103a94b20000d000027d3b70004614b1)) + (zN 16 (zL 481356367831905626856076789698527203303084340066237900000228558005665793890525383814531948203025720496645226644870708603684489414111994740535097204788471430443129223538747709329748362779180408399126759527556902292589445348029864945964347003017742043526399521776975571969424074727915684601983863647256451441776727974563858712521288978471659852327490665413856439968658075781979172065384311848632509923996602987530511687183481134069634148037709991626795618555396096) + (zL 42450970003859591471824388571745494912607975966961432668750222813492207391962281800067095793618579191674205606271869689558818896123514420001568730741997701823515128419711891923217776192563968030242820857336311972702148328804727340487736296636571489058874779029028182786505098665133079794530064249483474622914671165621836470021138457693713894385411270485059950302828706531244131977513313398078527488382435542582847796792441996667169006282798152036336546925772800))) + (zN 32 (zN 16 (zL 0x2b32fa2f900040e4ee0000000212f80031a740d4bc3aa0001851840002f740c4ed4ec0002f62f50292f440a1434eb0001f50021f43280024094ea00023f05323e00034f4364e900004823c23b00034e4354e800000823923800034d4344e70000752842830003864644e60f313a13920227f3854634e54e418000017f2c100e3b145d4e317d00017c2c00003b045c4e21780001772bf0003af45b4e11b10001b02f20003dd45a4e01750001742be1133ae4594df23f05323e00034f4364b74de) + (zL 184819912693342484173774183960921962507449856630989363190338315247410624570078602115430425764258584542582913960389672293730284388741457088029041579069432470232990024108373691021503452315142709251779146419406309425262606939065559312671511351391689119096790436474273828157682287422057817789824015862518902236156667624099737622948780399724738830835485869471648748327432685594164828790997390649115447893828367188500146142073788365245123906716744452958814375839268864)) + (zN 16 (zL 766944175538169712494207701440805886883568810143839878708256099623817937185211341623986750953440509635608003400343195494597981184657447474224873611240797393611820006502296433091491984872424527694262243931179602866152321145670038959314479174843341212631986728131799437077264004989799287521581010153972641190275072993245042303446126872912249791737429605206475437357269805223745447482515994575957825352044862053001317876233737487101774440452481173998709803093546247) + (zL 297759916035850475888147991353873783798315234558828771003562184306947391153690697426868126353911439782777267678370778696324322587858977487956277359251168737882055861371959435556619971797581057884656604713117244456251628243538664798555610728420488484668501114097193670498241936002691267751556670724005984421188165515553548963445720155052048061212034409180123540547412349198603618769596414399996247604253571231765545827327462930154881759673385193334221197979680768)))) + (zN 64 (zN 32 (zN 16 (zL 766944175534307731876091062897447121176235775912832531119015941572633796138588765446803452989465809605019288634467111601308337573904409912241669583257521852585180681380908638710860855673274881765192908858004088783344045152171370682983430554907988168232249304571401610724611721417842407204203726888323192829382413819902626667662948769906292884445555261649881840550878857626258953460264929853621226216719625307079454457117327825044923192093000764004228765758722048) + (zL 340715570864181720787097137186659492371082441125391319093439699784408103875286198192840392060313297727357042200012830731699178576801972111567105483872968913542499482975630837193393293260273381599211945820510222653225551739652220502874225608484588749680368899139089749275101835986846388059568893603791003717792966389823350345871505828728197777327334721213350150725598538635352209571699671020742922970014954312887205263641147299763915515566574769839941686835281920)) + (zN 16 (zL 816975106219169262161753280451753260142305187592093507403990705875096371373086964256005339775526475245402178867410162061952873420858256611763951263051935090218819729070413365456041424818834166987697346492763681744489434684421932314744051348938454465753197924913986039021695713215232416720019391582202434160879098675061228953566774966170010903212417488631377745704791119467797883813721283162682803599374127477118032837778313041814760056287811836640639768323276800) + (zL 228964808278726924178662244478001287014333923130343629727076513314689898394424743869881237899273121974311438777183852735505741195742382564727991333453078861118944377656544965097578335445393228408202856910509975503156393425856068232001721205341843807995824756226212027496274939371594279698024505580453928289351636278069385994098581249223846930944765325182699260421173859673869476035004849977501778030032719304121225090135579535035480836739001481475303798055370752))) + (zN 32 (zN 16 (zL 838164644585667179356750293704139587237945500163149625280474418611762276343068554025204945141793912098836638136703372654825411852079288479595382820221555535833024269202164401256887827001007979436302098287242479712639385258064247350228719461115991494174971730609299877693727632105035833861608275898681516742265084866633183528122263300903098331965440086067207558196315032226578813970831126435809368204737846430820496083587245213483782808361335850332752706515187032) + (zL 386615077823607235934950661316224900729857568318767427071095585043903104444906476940891205414091812985469084097890132008540398258414508502746735651936448734605486049534230345099313258781222534993397161879714015186963273672346216393078020436673559329404875587013035627673414050110127910337178990245284223375736669688832961783947344350651539055518851696177669092932509907011252751152205494990033349869898243270116373006679525700527703287760763601246978502410895360)) + (zN 16 (zL 862777064125270994650899936666098513553892674575184305247024182308902379021515569316802861818414462307739197497260335314317789039773284293902377070309442365091062634020161131246963671090017981804472855775193200238307114138950795952975770841485393578842267055058811004440382311219078603201715378104392494674379343058273358696333595503659812354031134164052994472923696090441974118898444702900150811207478931581097569437876841119144949223499832301184073724474322944) + (zL 388968898693706874060243403373114683170079138075933400843746667270507849205302576787770577024490029947325536316756161086384834994252630238914843902730004086506055650281911767057423424674565730054967863943464069399494296553603065758580548469666544682045731678481124493612551513378390145801868483391640491278684620598012035366683791066570573553913697356852364784314872092010841776145359752039831520966646674997413718178616852142414560199212403827673903368796897280))))) + (zN 128 (zN 64 (zN 32 (zN 16 (zL 885841175559769948602615774765197466006042907151066060410231584859755881492700818745313277627782140196919120378831029923986402968274977224075793590444299941228979386744959282229438409870472239564822663195200088436712682547958683039596111314437142635319480284241864646739505760118817601371416328758285040954707448951330922356608701982383271142018760312112886872242072358873460364353128042830417475801927946411815970990794120251004793163124796992127308544039763968) + (zL 614935702186565878653236738635641945003768682971791945881458454251976311736208106551693260805955801550677851860662258567643611728304630793464906426210533867546372733581198961658149914196608981662767778705585698695765487634953277763213986334599013722202526093626870419501904241497184404677274136202193889539974045044715630854861087495408721602733108671751324172442342804718695669735379288668155247210569330942169957777116555734806843081831637489566670264945606656)) + (zN 16 (zL 0x5144fa5131e946a00000000030b30a00f4946030000000003390003384d000e60200000049335949249148d1910000003360003354cf0006010000003060003054901d86000000003340003334ce0005ff0000003320003314cd1135fe0000003c63c53c40004f55fd00000035607128e48f09950e0e000035406b28b48e4c750d0de0001b91b802c3914c61475fc0003f03ef2753ee4f41465fb0001fd0831fc3c34f35115fa0002950002943eb1145105f900030400030343b0005665f8000) + (zL 261926343777013668943050580602596478388467929038717497444853527042545562864830711804627861123280146132038574518511694696863510201014717006308839344870264130454842891142347239633393261565838746187034489700678786077702057159282773534843420338736990551929584330444841046611287958743943280965391104014600650573682235297599872684950094810814727973348869592379517683650549824297468396358749584159877910609513734695434958737371805484545014719073676952008925412954472448))) + (zN 32 (zN 16 (zL 0x54854754639134d0000000005432f854254140d00000000047147049835762900000000053d2c653c53b3e10000000004974964950ac6280000000003093083074d16276260000003c63c53c40004f56250000001b91b802c3914c61476240003ed2843ec1193865ce2110002930002923e900050f62300030400030343b00056662200028f00028e3e800050e6210003020003014120a156562000028c00028b3e73e650d61f00035a35935835748d5ac61e61d1bf1be00035348b5845a961c) + (zL 263103541473361779016424949412841804695238059614898397485755084208111003594488032563395081072996154840497027196192072967262653643889995695010190113759927338116811002876645788863929205666591908136320961409160953480681834229965613126420674230526306890011024950429025155694324143379862132476850874759079667249445443708420726925858691803322223057208769895806052136494573089100067659496922355627477437451235012389993618226187074823791238158546255964977967759185936384)) + (zN 16 (zL 951138729507401837577462270923840975972800329504091969047676241669289663563498362706808865070755648210322078534519719208538296535946685173540088091950700090308395726755013081500811392276096924778749835508210461782557931720529384700688369592893386862956424599459735469775249118717048538550678317846033112107193488542831846969212441932932077526555457030727474393328986070722742668398218903127815655639132003280835339165004354692824472911009797397515509835179468076) + (zL 539156433322010204183479347242992306854802502210011458670801366833486539778672427354333949030999515778117356670670615352508965176849038359306005865749445176961082170851888105899641038352688156142343305559586854939302023933893536764965954697043690689567863572920917361133742164171203761006727890609358422570832860089305685955277177709132738800572235581548238478579013428235210008819210583102751808800043526184379022628738932374086965713958298783941358476412846080)))) + (zN 64 (zN 32 (zN 16 (zL 974483707682013196496131191962602143443242160239548920985171992956661964468909937634304627943489404296043424058899919106726482208473401298150049118733805427459541407047178079905472644079418473951755549652841904189419578028674781485071308126227614482960379173306812395233469582747238957365529174183517779345470379892603018871825892791742022692940624456216772271741840434166172119816006961803003845887273909054162484729884750835147209181157150773281703767397904384) + (zL 618028646921421731566477432396927155734428518883635998848388293915249166408150174961010139006496221966227412046366095006224580964424776844683255178722780007445442131091838657799844664401744872488971171233223348219266220710378571778438358025216542006674207065862199327883569018259501933428659916812294218409021187633813312037820669659967118373593006937540984175180436954734892629721929036230388937323503328803215586045011480059005198268380014687158808521409036288)) + (zN 16 (zL 994143370063883984703163633757765450268483852242513685941281204952602115154137314243868998403582138199131717384080947817917299908730095897368843016034476080888049000328688474098925873484975633243815290091687418361538189981299306552787964392770330752532809728552506894143007106305604295771353169149506239993666598143133231297640825209761081860021696226234856616838563638212223459782831851961945913915412262191769274850308272789276062377999633224495895326910599168) + (zL 623774454713925871713101379339630971725688414527038095533112427918834767747383342569902746290057862994128249952915491804118149344183334210359478492110691172594610614803675142024342092191431085412465375342781094440623733068013916129489044971242234713610167977857407461025272461100555638527254090986230428791520304616800789003690328360512069770173765082394245361258742921382384280991500666825506305155720714232851268938985442424364271395139614263216671036731817984))) + (zN 32 (zN 16 (zL 568586377478160733527413690618937321803344597620378228937408577010092696570183607853457240486538868903508739174369715772209474899427713534735160343352128006872058233019660223154829843384680776403887381463913250701529551836856046659730652472475595687564423055781499362337793873270454903135571545212102058911567247864395190698503731771419663572979574928127823155012614633136272441636858310539389858983042422108648529545932116626598835354624901397944279378778128384) + (zL 591490014268412244485550408317180148660505361188042661938986084507653268555320892090819332803765532974621646336572939578966397154764153040054510203416870400210955690277053831910842573096761020643466827722294521715008138297196301410103732023212004142493402942760554715830777398628999319984423506784473000119251320367341278088784699523549591359441357780709444570397255409872484484009193035347768972808330825607501602964448048776250280297399552900680291433723981824)) + (zN 16 (zL 699843928456763732989495394840172042697264248466345205998739604448092160374638625911683584523766731795421758553933216798702736653020810077573610213387996613286437570858883290330793364336071467598619609261325437546410541437843185807765793314793477049515052556562113721519020002401323804076617535124661335434182973306301719656612033024732397353735334597010651281412221680082560714605772474813523728583264927222327130748961515815792234844916437245984561064942650666) + (zL 860531423579894775585431499835577466606649501919437927373178185798481091791262620056344762784389026441455083510498546501195972909080909205939076910330361527621304716911657517047758944356437059890493136605732213608133135300162071446283003760949534794729905168587238254407726173054779889070533494792417576179566528004247766507639916234376714430872390671065713034558332089643047633837437613629635759429980664469605465861830945833501650072147355498111013993045819392)))))) + (zN 256 (zN 128 (zN 64 (zN 32 (zN 16 (zL 669236786520280934025371962663798172717315281628425407842354066630133616284207237547745919824899338907417805954905081395921389406148295716562778468259655193126415936602822162126509623037701814160961657555221769086076958153305842149379645353125740540514782970199384035074902691304620305504822837463217669490693752536206186387986527930384761994573109576315147683298624438256566650422205570563673947345939038954165071761201573699291101258812558263361619745252048896) + (zL 568586377478160733527413738166150426794628765323836801152284213031357707881076465116154098638122606185120053243667551617668853169779161735656898746112101085529445238445372888777165506247794780010120530478565279432868446716108661877414309389096226929419357170368375635958399527434010699213151044588628652654293153703390272886367117387021030656927091316431855676082283506903469872472538076544206832992418991953310103125212740998397600311321507846717158620384985088)) + (zN 16 (zL 481356367831905627639251030755558896645852476697456700201885270133891362769286747572863021598612825071024154629842505156844663119292028482242126793502006836660449890190471336631644597697855539141025533305817178358974851793870711417338643898709594578944907582762575322917324598626638420280618055580496664939272542893006324480252327453889120345202281033259176346780938636185711650742638335995284237953352290266305439754002009844897606437836684390600085819149518237) + (zL 0x51f51e51d44068d7263aa00053d2c653c53b3e17254ba0004974964950ac6287241cd0003093083074d162764172300041715e2905121da6a57220003650003644f666568a7210003f30003f253a0a16ac7200003ca3c93c800653968971f00046e46d00046c5ad6c66d971e3060003054901d86006d871d4240534235894cc6ab4e95094223604210114cb6aa4e850842035e41f0005886a94e75073c63c53f10005386876a46ea41a4190004185676635a971c43e43d02943c5851436c471b))) + (zN 32 (zN 16 (zL 689204181187945147701370421625964741052131054447849648621528394609232546767298205631748413724644340741909000522290753096386769492592923050310897432343634834736146685024944374909087329829079274467453155680570881477879030186466117569662234894468215673348143066331768495620163003874967516439466898522924048762552279318961486380357821462641569588603209697910804274446205735330281724429968299482607848650685305048649278265585595434516855217749240063115356068986396672) + (zL 0x60a6090006087440000000006076060006057430000000003cf3ce02b60474214700000044f38a44e63074174000000062c46d17962b5ad2e40000005d64965d55d462822100000051a51923e3536df43600000051751623b3526dd43500000052444852300068f73f00000052252152000068e73e00000051f51e51d44068d73d3aa00047147049835762973c02c00054039353f53e4c873b4ba0003093083074d162764173a0003650003644f666568a73900047147046f3575d36fb61e61d)) + (zN 16 (zL 765174812875664451859532121293968866240206902768320405850770493065597227775712438508155725986646270129647979638825510485753307256815375408301667704433779084119246267936524185789398628457157985462541453630799990146690388852970767459693785726510097096541385652534913171611358593347740335681813596572852349227206098358572770258855902430524346648733606598777452907171860186543772729458966143990075838964108302461223596902206163282327150535589530612683483920593846272) + (zL 1123961389515954677536581406459149792874592155164443059437309778153544515020215360364523282770977992969111214352383069771493286353050491202875555300858028336254144111170610511086754535037693784684063324250078050791157810152664526588678838245337456142421875998600369838353147132513636389397724103043353900733602604205932016901560146561112063367938930613070102922024733781373998164992755189985351075686839113486701619524055646490760918699636552269559523173631787008)))) + (zN 64 (zN 32 (zN 16 (zL 1137172898708799804245763510411834880495020708196150085074288687777500229435703418545904926348121484310061514638513078574408932562209202968090777052796273473140505709932255578158144613464876492131205502327941525159995472492385945333208254119515693999238106551720715990114650442425953780751114157302581182031977872222564236704050406821586665721193868644409923785812243276495511143497850790315999080901767339930855195972208421639855772464667584017368599075678584832) + (zL 949998453822028354158223439501037339525029026423923555831035092579127789212006904612337330400557642908616630561301828158201373368945629799433024993732346444284907091713698945647829206912873288555399181319524505356570428281200172368125765776868553688111366562816585975978313033155939072853686687104003116159768276048812909046364095899210431168425570699454004008135865236304847014945190908165461313775927472830911614049955945474705945184534901342488566621729193984)) + (zN 16 (zL 791015266421873308608710867247552763032463998948492921974825753019311144567578290707919510944789008817734705275784198963569389015930776197233994671984024108902259344420854732648303779851686803260094519232705884867550589562053423362293698820917598724886846374324990020783213822762930930495718823185119655116586186084901934243512949923587961071358387150182962303518062844543481173154947549686318367041333941982474835850520955596071276753844704822848929732768038912) + (zL 816975106219172837982118762596684231396080391246057052714873667887010262780596888791863583281533704964910004885125015998013372667064769225414451904349698815043956350647256839829151841319092471486646859294944250293470081699113645519840977467604945847910998671474911270651510350064120918277385827672341025632332398853890041641971942996870749334487293180380263573772154315068672479580917447998619705639270507202840719012713209714979494687104205008481362914221658112))) + (zN 32 (zN 16 (zL 0x7b47b37b27c700000000000064e64d66e0ac7c60000000006956941896087c500000000069369200d6057c400000000066d66c66b72b7c31460000006496486473907c214300000058d3c558c1e45387c100000036d36c0005716de7c07bf00036b36a0005706dc00e7be0005b65b55b45b36ef6ee7bd00052444852300068f73f58126752252152000068e73e00b7bc51f51e51d44068d73d4b37bb53d2c653c53b3e172578052c4974964950ac6287241cd7ba3093083074d162764173a7b9) + (zL 691603544077720978809687553242185411625222599002105697848641851752304945295250516222787969037925463863515577853126668863326143188769391669078949553345837185905001935644154012134942173216156436935737079925988416684466311357904565807747477394426876799936083706371121177049134378227802973312858367959602141257656201778691977556158213815799974568112196255825281771853071250183017595888534508018106027284600200767571677995965769748493352155073649019303552946035228672)) + (zN 16 (zL 0x69127a4d27af7e50000000005510535506f16f07e400000058b2c41f758a6fd7827e300054039353f53e4c873b7a86623093083074d162764173a7e27e17e07df7de00000000000051a51923e3536df7dd5a900051751623b3526dd7dc5a800056f56e56d43c6db7156c40005432f85425416c77277a95583093083074d162764173a7db53d2c653c53b3e17257807da52444852300068f73f5815f252252152000068e73e00b5f151f51e51d44068d73d4b35f047147049835762973c61e7a1) + (zL 699843928456767990515777881148154169750124466225686929575776088658763594091404520575981279936730883539788145802599847376731363734639702631573122958071302171517613846292332972082410908089390708669936220819965923789799511784185450279589503887120073690169721574233726411980526024914886686137835491125141858614912942528278014607742485745615808132710835926473909641235960115201800961977722239629288931442487548585435811542121009985462541617229502708337830793431744512))))) + (zN 128 (zN 64 (zN 32 (zN 16 (zL 883486727975971744006559749346711237531368475076371398370054025519826575887578590959425422715386379748202868426924986370842773552170600862228325229010158904607889085705366762285482797463853686255547205967956428636593423274756207072113907467951897916630511156232530372555882928288943527078260534856931602763129880128459157077065987265755084256732576377691947552254258928605724644728325680904808804345914831811389192753301432062969345450318300274412617567811141632) + (zL 0x36d36c0005716de7c07bf80c4f84f73c864268c6897fb26336b36a0005706dc00e7be80b3672f53665446b06c87aa80a54039353f53e4c873b7a880978f78e78d5b34ca00000000076d44876c4d05b10000000007684467674cf5b00000000007664427657645af0000000006b46b36b24d18086410000004a54a44a36e38077f30000006e24192926e156750f00000052600d5257011c380600000063363263138779a8050000005d64965d55d46288041cd00054a18430166a70080350c000)) + (zN 16 (zL 0x6cb0006ca6c92287d281d00059058f32b32a6ff7f081c0533672f53665446b06c87aa81b5432f85425416c77277a981a36d36c0005716de7c07bf81936b36a0005706dc00e7be8188175e08168151130000000007047037025de81400000000052600d5257011c38130000005b716147671774575d0000005e15e05df5de74681281100060a6090006087448107bf00060760600060574300e80f00044f38a44e63074176080e0004d30004d26902287ab80d00058b2c41f758a6fd7827e352b) + (zL 836333501447315674161207119221759726014804664296200829431992720350831640489722660161760361862934965066326752989526813890538363480775859131311059394152984712349681673343564247407866564704241675885600630551924508151570218037385848546900826138417282027933369407098485935974005411234208272661519444754272468314647805136786628337733508050096333347494953855695958654807247902535205725979216873847744989499568650773669887010908343393073355021233700649333879418701078528))) + (zN 32 (zN 16 (zL 0x5b71614767177458402b000054a18430166a70080383f0005510535506f16f07e483e00056f56e56d43c6db7157f957e4750534742c043a7847fc83d51a51923e3536df7dd7fd83c51751623b3526dd7dc7fa83b74d74c74b74a79b0000000006496486473907c283a00000062f47062e62d62983902c0003cf3ce02b6047611478380005da5d95d85d772a7f283700062c46d17962b5ad7f18360005d64965d55d462880483500054f54e54d0116e07d18340005485475463916fe783833000) + (zL 672604313499349452888030190190447152058940924989117019223892690988978258408575608817853866340538339259744967359721301577968408928231989478889173973593590195490431368354766903146694238059470431063282117085284005221254420999402724425635711522752771186328714322645540555043140182176489914000447011717094227196611599671222996554048978698224267016863044547965658693650383489079739868047391128528381003862800460568196140564533330554145325989529912186178525968075849728)) + (zN 16 (zL 0x4d30004d26902287ab80d85a5510535506f16f07e483e65a47b00047a64500075f80085947900047864400075e7ff8584770004766433e675d7fe8576e86e76e685600000000000078864d7877867c600000000074d74c74b74a8552b900000064e64d64c0ac79b8541cd0005e15e05df5de74681285385260a6090006087448107bf6f759058f32b32a6ff7f081c85160760600060574300e80f85058b2c41f758a6fd7827e384f47b00047a64500075f80084e47900047864400075e7ff84d) + (zL 0x5e15e05df5de74681285386c86b86a86944000000000000076f76e6518687d40000000008678664218654cb0000000007e17e07df60458800000000075074f74e5698646ad00000076b67176a7697ae2b700000074941c7487477f65fe00000067267167066f7ae86386200064e64d64c0ac79b8611cd0006956941896087c586085f00069369200d6057c485e85d00062f47062e62d62983985c0005da5d95d85d772a7f285b75b54a18430166a70080383f57f5485475463916fe7838336a3)))) + (zN 64 (zN 32 (zN 16 (zL 0x76d44876c4d08766020000007684467674cf5b06010000007664427657645af5ff00000067267167066f7ae8638750006e24192926e15678745a90006956941896087c58607bf00069369200d6057c485e80f00063363263138779a80587300062c46d17962b5ad7f18367373cf3ce02b6047611478386bd44f38a44e63074176081e8725510535506f16f07e483e87154f54e54d0116e07d18348705485475463916fe78383386f59058f32b32a6ff7f081c86e58d3c558c1e45387c183286d) + (zL 881720983377002802584822169823512209691739978635608514360318506452002068652656551981977616552099453916607119297961427468480617094853738362043943124614276106956744842096150905079917036036809209342520188297875575053583885052455437611091620640107513727350456315202455786520355690265418890664665195097191678976300739701336533498573550708715600342296410483426961672057299833105037026553914922367272850159836191216970439933222488967274181062142954626044110200222253056)) + (zN 16 (zL 934106283980688293121952925389832164169029943115107799106265259668320418774958016907361774321299790661130038593186998581086361986834192113594687471369794973549916451916413158650069727019814687031272134673972507376990202823436342989302764905347298462444038067396210650776071493239642540033390853151963547776804379984202963879611754760107340206383004021555111895814320112165129474932496052026099458720342524183065519366650175375745952642459766035934228172515364864) + (zL 0x67267167066f7ae8638758a364e64d64c0ac79b8611cd7ba6956941896087c58607bf6f769369200d6057c485e80f85062f47062e62d6298398988a263363263138779a8058738a15d64965d55d46288048358a052600d5257011c381389f00066d66c66b72b7c382089e0005da5d95d85d772a7f285b89d3cf3ce02b60476114783889c8938928916e300000000000078c78b78a63089b7600000006523c96517d57d489a00000052600d5257011c381389900062f47062e62d62983989875b))) + (zN 32 (zN 16 (zL 0x8175e08168158b00000000006743606737e74cb8af00000075074f74e5698648ae00000074941c7487477f68ad6850007047037025de8218ac8110006cd6cc54d7d37f57d13a50004a54a44a36e38077f38ab0006496486473907c283a8aa0f367267167066f7ae8638758a964e64d64c0ac79b8611cd8a85b71614767177458408a506f6956941896087c58607bf71369369200d6057c485e80f8a74a54a44a36e38077f38a60005b71614767177458408a50005be0535bd7637628488a4000) + (zL 1114690777530020691058198967144976187383093419273248558603615893331947138667408272321223514810336043323654338297729121201861200175011152911400738948929558507668219787767678415063514299083162840137831906112286123784260982340729184684306883188142376774713297226159407472297897251984141559361633671024455297140037606630989248552154337641516559103828124210892110820882165285181309016535006868957048612905517063998774421550675445062029969982758802667494895253991718912)) + (zN 16 (zL 968245019216846416449503313408778536518611609742921776471011471697071820117207449900900315552162667140348094086055379732876758913655905854713283785227738099263024185656094249828273273053947607472103714353963039394693808646928105102709714363213857959975681454893453894590865415913678903750121995067189991614270776274742771605643025474110434926180187968626790129814444667300817253913136774946145874418969484841037364430257635581634663207492364618198680434062131200) + (zL 949998455014566956925129698649478240025571467242906393207978565113264323856940873113890579542085092518800127622614778272240726498550276839128224887044935015563736067658981985035482219849765961559400889147148509441793901070729608828587625265434048569679732881971377932236608294226684846968808708538294463782079160031613869249096113968457224015355377567298976593154675979313200211496691973751941617071628831563344910892031259422792551918114502610048791821819705142)))))))) + (zN 1024 (zN 512 (zN 256 (zN 128 (zN 64 (zN 32 (zN 16 (zL 866206080036429753479974552223096991408539902907482335214041871926178235578226011854280360989044188420799719405431030205164731175432680007687756710562914869264221708675839111642284054824783281613539345414903461224676545993526564267815201947885756372667200742536384871208498193773367975109727871618589347505842659862039683358055292396035872451279732684370122578309460482928599159282532963185072638228612836999558267108464666543645936478196168619845244770379802852) + (zL 971201665216885635732852000344123856713255116833320941681000500200699431417165926607280110936757624740841213018974143065268465312585103090395434886478565247135271585372987473691900877738608201830389944087625275292913308791080363516691001215537284349567982042147085837730345193375449446618932639717862345220677570457526572265423989365541248485597921672328730956259231468322374111432679120618278009191688439872322696588073248917400139412818189767290755053689708544)) + (zN 16 (zL 0x74d74c74b74a8558e89080006743606737e74cb8c190700076d44876c4d08768c09060007684467674cf5b08bf6c25597664427657645af8be8f255869127a4d27af7e57ab8f92066b46b36b24d18088478db9057047037025de8218bc8539044a54a44a36e38077f38ab9039028239019000000000000006d36d26d18448fc8ff00000075074f74e5698648ae78100074941c7487477f68ad8e752b6cd6cc54d7d37f57d18f02a66b46b36b24d18088478db7b97047037025de8218bc8538fe) + (zL 1321297461834968828184266836141273901989699662444200590918115522728569409572130264084448483331296949368188496110900913387722533503783716864790431147025042837823006303824555578768111367229021534163408557169462522439458228766899109672872383226269553986427965039634782012008158692928382326105110829356551168156891674276419340863377576708527775725951974139563622519108508971666827665448200172045875347409764333728870265099851047365312827375619931057491174239024185344))) + (zN 32 (zN 16 (zL 1138938695354513001704291572894405439500211421964843100628007380033553742296482927803977108993464396587572950015982817558915899196048149497515496409976747690458214966344015001455058996488893983922437909579455935715311047324537625893132845172667914141200663363014749925647127882933262979883247038940266087010235604681023074163305969275396653093572312573440870108114031479279942837732028292220179305411358053941437882505977954064671502709341448564168945631546572800) + (zL 972252146439044987287199336627504236047590127856228387987519436831475096947842898041854323422907055230556662732258462699286664143682070062616046843819902897450099548807336806791667217011244100747319211180627184661607721439841315497873692126326881779011663855104409129632296779373577913237400288574828848634156110919211856620228142627227530911742607715309390472848944521668938718825556823041109716238362220093670251642496275463899791697817645112807325388242579456)) + (zN 16 (zL 1138938695354513001704291645147852808090940830484587154196524084526097253464338580984117562367177607047899297104727950229143254452029627325192300216600949637027865577654969291934437143462158968094021740153620317572178857804242513712631634644670320717157741041159129876608689746848821751980028355347091530810124077775478177806121989172100516791626095800852812079194343521734456458709086462632467684888568808794957202472819304760898614935861036733724525367921826103) + (zL 0x6d36d26d18448fc8ff95300076f76e65186888d92694d2a878864d7877867c690e92f9526d36d26d18448fc8ff9510008175e08168158b09439500007b47b37b27c78c290f94f75b8c55dc8c48c39177d20000008678664218658e294e80f00076f76e65186888d92694d0007c966c7c888f8ca9305fb00078864d7877867c690e92f8a878c78b78a63089b8c981e94c8938928916e394b7f300000078c78b78a63089b8c981e94a74d74c74b74a8558e89089497b47b37b27c78c290f948000)))) + (zN 64 (zN 32 (zN 16 (zL 0x7e17e07df6048e992095d0008175e08168158b094395c8526e86e76e685691191695b00078864d7877867c690e92f95a93b93a93993e68d0000000008d87038d78d69596ed0000008de8dd5508dc9327e40000008436d08428417f79588750006e86e76e685691191695700071905371888e6f09319560008678664218658e294e95500071905371888e6f093195400092b92a92984468e0000000008d06948cf8ce7c575f0000008cd6928cc8cb7c475e0000007e17e07df6048e9920838000) + (zL 1266076015839688511152867805757929701434420641276664984506231710061957515192818361829416437434634869065412222168534046964479055894191019721114449823589063287292892697940968759354193233669897760914551224495863800554594813593227512713762827984090809766091606169266279303351349946506383263054483539693119500048044394838183017315116045741855113034101940637904169402335489158057494381863114965420321034976774448707811933699343859121322673305250575006777806613779578880)) + (zN 16 (zL 1327796903736919843759044631117804838012811779144665082025288248687173078794973481142166786159102533273634165230344546911294095424026812362476240943015429309636479379048992777393116638687957200150678820693332291442561298048065693319349668967532899108139272417973753765404335051776811967753507068940931308958711587818758914686702017019579370859469189731156102444243155940516341721816579001437847444006514482691971866526061355901895907760414822135248243479947864427) + (zL 0x8d87038d78d695997e98800093b93a93993e9879160000008d06948cf8ce7c597a9860008cd6928cc8cb7c49799850008938928916e394b95e9840008c55dc8c48c391796f98073792b92a9298449838ff0000008de8dd5508dc93297b9820008938928916e394b95e8ab0008436d08428417f79589679818c55dc8c48c391796f9800008436d08428417f795896797f8d87038d78d695997e8110007c966c7c888f8ca93096097d6e86e76e685691191695b97c8de8dd5508dc93297b7bf000))) + (zN 32 (zN 16 (zL 0x92b92a92984498398c9530008d87038d78d695997e98d9938d87038d78d695997e98d9928d06948cf8ce7c597a9869918cd6928cc8cb7c497998599093b93a93993e98798f3aa0008938928916e394b95e98498e8d87038d78d695997e98d8ef8d06948cf8ce7c597a9867138cd6928cc8cb7c49799858a78938928916e394b95e9847cf92b92a92984498398c0000008de8dd5508dc93297b98298b8c55dc8c48c391796f98098a8de8dd5508dc93297b9826f78c55dc8c48c391796f980989) + (zL 19772726256677014539616194277271732147659923903892767694149243985434481701616758583346582159744575181841879076748687599889307414813672285410623777422818379581512228966439363967300181108496203139653327722123099522067098718748303641602335107603147291230079757470378376971651908746752884550535717044800938148199912345732694952805155741395874489600020342307109013047531015302177444201927764333897476278718556527686875350790493074360751440941955476523283695009349632)) + (zN 16 (zL 342481002799382888982516548299413746169569709371189157475165719590184325342770262455485143332467995371934286489743126458189315665747429413011110644619903638720567937598126028249306133865334708965562265735805398286940145805254865652536206408577173654746229526032359888452160917550297356175686719800545111318862070698757025581496612054671521806627372229974678280382109221165758703401038063335123869879160122219402356741115081145547936074793884207280048206235303936) + (zL 88268280650160465003361018560431038457326141913297800669008468109661736872425511914905449040877592658595595832678166731212788170334749398111361661474253742658204179694071878640274550960105391802957130344498231165671105378289003467486292474744273361936788496865773143885872043202045143405661033492854176177289325900676802358359886751115739014431888975166829474266584025515259089833383350711356477352196682812770312906020446702589398781283263507208738268946366464))))) + (zN 128 (zN 64 (zN 32 (zN 16 (zL 418746058221924999287688192986329660648852279369941386561755411647938292650639964602084904250850117342526955913362230330026992286011611095961209463731354319540355450443259329135894237247653509566265195357323444041513347114933894059722886103862929984114949852639195259252032619042760642335860239580660707284828565001732223996426243032547741975521061259356819943462403630906144420230018789344226070472577523798642385650725993867418827861921622046985048429019791360) + (zL 8238400297011053647821965175816155890333400843414316510382490795438686935070710114003639119210018261653382016989626188229017173543075445730121710343754180895101730616876353400270198104802921902991650806849042569919356758102939104856491191907904195337317541454180843849686676323122660802291704631078832875120966149635512752584991708824926879997044216762385650260948360124205861500191554652147727231994647390342457752583467592890097011918780316532145312249931327)) + (zN 16 (zL 800899515378384140296233253135266982641624089424245628812688526378621827018835092569756418335038915693020853937180055083446324615684345913726960430374778957400402578573945741229978511263773091235656350358165653181758340046226845032577234460784189187780931052452150827791076509432993705267381578706488687585003107537157975012057915284612915463247623532934202206671627265646727445772463817082917696315293137490431329041712104575009879824566705762833309240957513728) + (zL 7160602147918794772641329165537716828387821866792530417059852894463433384902220303094402966320182206623677593970529509208688478601794795815051291425610162601975786092702257584865669945771694637794342757634864094210423984121267285160805591976290185895890178247617997839200712504306916860698480331851120038496512629513668358325592838244551334903484684940547513922823199849756735154846599240879064556581788840594222929511681879904138702643814820177086775296))) + (zN 32 (zN 16 (zL 691603544077720979163907527846695722027643113140054899537091847374802992496732159847699642650106178348780963060072007315735861062049652528844381403386059920779525048978604177438934471167416109977863279258540197761268582102753370892487122754398802587461580592617356985055635766483381492967981836500334815245040978904269204771761412964047749479165072656838383128926427830903181661134096622645570482683324543243359419985984447498839607485266972594014828069782360064) + (zL 885841175559773842617223959122880597627218149851278583775577515077618337263689559135992561575090942297794159428905413800130014932945524424929488645079143936143864958150881307933672624578425912807449748138354975971100886797648221693456482527659348716868006089458928106578531360609801505861095318982575175990660973658451017806836772975098804779701585380206335062632127852926021685504043984345749083399952828612753949191627737360537103761279137533682949649781354496)) + (zN 16 (zL 19575654962745851143022281752091682897900549429496023452068207905582656875231882529506588196095493046478483024105742217073561021267112830481342858964706223584584572272204284767110236073386660033057414002653383173268730377325982276425615283731181037321156303152312364450719836133591644549502985965815050575425893468244815698859496261010630052946449434358656322048862674511154357708696282308782716122562878711410695536771817747030055897162110987391424856734736384) + (zL 0x60760600060574300e85d0003000532ff00043a5649f20001b10001b02f20003dd45a9f13000532ff00043a5649f00001b10001b02f20003dd04d0002b34464450005b06a7000579)))) + (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0)))))) + (zN 256 (zN 128 (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0)))) + (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))))) + (zN 128 (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0)))) + (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))))))) + (zN 512 (zN 256 (zN 128 (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0)))) + (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))))) + (zN 128 (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0)))) + (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0)))))) + (zN 256 (zN 128 (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0)))) + (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))))) + (zN 128 (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0)))) + (zN 64 (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))) + (zN 32 (zN 16 (zL 0) + (zL 0)) + (zN 16 (zL 0) + (zL 0))))))))) +def listToMask : List Nat → Nat + | [] => 0 + | x :: xs => (2 ^ x) ||| listToMask xs +def getLeftRowAux : Nat → Nat + | 0 => 0 + | qL + 1 => + match Nat.ble (qL + 1) 1409 with + | true => left_row_tree.getRow7 qL + | false => 0x50005 +def getLeftRow (qL : Nat) : Nat := getLeftRowAux (qL + 1) +def lstepFromRow (row : Nat) (b : Bool) : Nat := + match b with + | false => row &&& 65535 + | true => (row >>> 16) &&& 65535 +def getMidFromRow (row s : Nat) (h : Bool) : Nat := + (row >>> ((2 + s * 2 + h.toNat) * 16)) &&& 65535 +def lstep (q : Nat) (b : Bool) : Nat := + lstepFromRow (getLeftRow q) b +def getMid (qL s : Nat) (h : Bool) : Nat := + match Nat.ble (s + 1) 6 with + | true => getMidFromRow (getLeftRow qL) s h + | false => 0 +def rstepAux : Nat → Nat + | 0 => 3 + | idx + 1 => + match Nat.ble (idx + 1) 3218 with + | true => right_tree.get4 idx + | false => 3 +def rstep (q : Nat) (b : Bool) : Nat := rstepAux (2 * q + b.toNat + 1) +def rpreAux : Nat → List Nat + | 0 => [] + | idx + 1 => + match Nat.ble (idx + 1) 3218 with + | true => rpre_tree.getRPre6 idx + | false => [] +def rpre (qR : Nat) (b : Bool) : List Nat := rpreAux (2 * qR + b.toNat + 1) +def getBaseTarget96Aux : Nat → Nat + | 0 => 0 + | k + 1 => + match Nat.ble (k + 1) 2263 with + | true => basetg_tree.get96_7 k + | false => 0 +def getBaseTarget96 (k : Nat) : Nat := getBaseTarget96Aux (k + 1) +def j1From96 (btg : Nat) : Nat := btg &&& 65535 +def j2From96 (btg : Nat) : Nat := (btg >>> 16) &&& 65535 +def stepTargetFrom96 (btg : Nat) (w : Bool) : Nat := + match w with + | false => (btg >>> 32) &&& 65535 + | true => (btg >>> 48) &&& 65535 +def preTargetFrom96 (btg : Nat) (b : Bool) : Nat := + match b with + | false => (btg >>> 64) &&& 65535 + | true => (btg >>> 80) &&& 65535 +def getJ1 (k : Nat) : Nat := j1From96 (getBaseTarget96 k) +def getJ2 (k : Nat) : Nat := j2From96 (getBaseTarget96 k) +def getStepTarget (k : Nat) (w : Bool) : Nat := stepTargetFrom96 (getBaseTarget96 k) w +def getPreTarget (k : Nat) (b : Bool) : Nat := preTargetFrom96 (getBaseTarget96 k) b +def getDeltaAux : Nat → List Nat + | 0 => [] + | k + 1 => + match Nat.ble (k + 1) 2263 with + | true => delta_tree.get6 k + | false => [] +def getDelta (k : Nat) : List Nat := getDeltaAux (k + 1) +def getChunk202 : Nat → Nat + | 0 => 0 + | idx + 1 => chunk202_tree.get202_8 idx +def getRMaskAux : Nat → Nat + | 0 => 0 + | k + 1 => + match Nat.ble (k + 1) 2422 with + | true => + let idx96 := rmask_idx_tree.get96_8 k + (getChunk202 (idx96 &&& 4095)) ||| + ((getChunk202 ((idx96 >>> 12) &&& 4095)) <<< 202) ||| + ((getChunk202 ((idx96 >>> 24) &&& 4095)) <<< 404) ||| + ((getChunk202 ((idx96 >>> 36) &&& 4095)) <<< 606) ||| + ((getChunk202 ((idx96 >>> 48) &&& 4095)) <<< 808) ||| + ((getChunk202 ((idx96 >>> 60) &&& 4095)) <<< 1010) ||| + ((getChunk202 ((idx96 >>> 72) &&& 4095)) <<< 1212) ||| + ((getChunk202 ((idx96 >>> 84) &&& 4095)) <<< 1414) + | false => 0 +def getRMask (k : Nat) : Nat := getRMaskAux (k + 1) +def allUpTo (f : Nat → Bool) : Nat → Bool + | 0 => true + | n + 1 => f n && allUpTo f n +def subMask (j_sub t_sub t_sup mask_sup : Nat) : Bool := + (j_sub == 0) || (t_sub == t_sup) || + ((t_sub != 0) && ((getRMask t_sub ||| mask_sup) == mask_sup)) +def allBitsIn (m : Nat) : List Nat → Bool + | [] => true + | x :: xs => Nat.testBit m x && allBitsIn m xs +def deltaStep (w : Bool) (mtk : Nat) : List Nat → Bool + | [] => true + | qR :: rest => Nat.testBit mtk (rstep qR w) && deltaStep w mtk rest +def deltaPre (b : Bool) (mtk : Nat) : List Nat → Bool + | [] => true + | qR :: rest => (qR != 3) && allBitsIn mtk (rpre qR b) && deltaPre b mtk rest +def checkStep (w : Bool) (j1 j2 t1 t2 tk : Nat) (delta : List Nat) : Bool := + (tk == 0) || + (let mtk := getRMask tk + (((j1 == 0 || t1 == tk) && (j2 == 0 || t2 == tk)) || + (subMask j1 t1 tk mtk && subMask j2 t2 tk mtk)) && + deltaStep w mtk delta) +def checkPre (b : Bool) (j1 j2 t1 t2 tk : Nat) (delta : List Nat) : Bool := + (tk == 0) || + (let mtk := getRMask tk + (((j1 == 0 || t1 == tk) && (j2 == 0 || t2 == tk)) || + (subMask j1 t1 tk mtk && subMask j2 t2 tk mtk)) && + deltaPre b mtk delta) +def decompStepPreAt (k : Nat) : Bool := + (k == 0 && getRMask 0 == 0 && getBaseTarget96 0 == 0) || + ((k != 0) && + (let btg := getBaseTarget96 k + let j1 := j1From96 btg + let j2 := j2From96 btg + let btg1 := getBaseTarget96 j1 + let btg2 := getBaseTarget96 j2 + let delta := getDelta k + Nat.ble (j1 + 1) k && Nat.ble (j2 + 1) k && + (getRMask k == (getRMask j1 ||| (getRMask j2 ||| listToMask delta))) && + checkStep false j1 j2 (stepTargetFrom96 btg1 false) (stepTargetFrom96 btg2 false) (stepTargetFrom96 btg false) delta && + checkStep true j1 j2 (stepTargetFrom96 btg1 true) (stepTargetFrom96 btg2 true) (stepTargetFrom96 btg true) delta && + checkPre false j1 j2 (preTargetFrom96 btg1 false) (preTargetFrom96 btg2 false) (preTargetFrom96 btg false) delta && + checkPre true j1 j2 (preTargetFrom96 btg1 true) (preTargetFrom96 btg2 true) (preTargetFrom96 btg true) delta)) +def subMaskIdx (t_sub t_sup : Nat) : Bool := + (t_sub == t_sup) || + (let m_sup := getRMask t_sup + (getRMask t_sub ||| m_sup) == m_sup) +def rightMoveStep (row row' : Nat) (s : Nat) (h : Bool) (s' : Nat) : Bool := + let k := getMidFromRow row s h + (k == 0) || + (let btg := getBaseTarget96 k + let tpF := preTargetFrom96 btg false + let tpT := preTargetFrom96 btg true + Nat.ble (k + 1) 2263 && + (tpF != 0) && (tpT != 0) && + subMaskIdx tpF (getMidFromRow row' s' false) && + subMaskIdx tpT (getMidFromRow row' s' true)) +def leftMoveStep (row_qL row_qL' : Nat) (s : Nat) (h w : Bool) (s' : Nat) (b : Bool) : Bool := + let k := getMidFromRow row_qL s h + (k == 0) || + (let ts := getStepTarget k w + Nat.ble (k + 1) 2263 && + (ts != 0) && + subMaskIdx ts (getMidFromRow row_qL' s' b)) +def transOKAt (q : Nat) : Bool := + let row := getLeftRow q + let rowF := getLeftRow (lstepFromRow row false) + let rowT := getLeftRow (lstepFromRow row true) + (getMidFromRow row 4 false == 0) && + rightMoveStep row rowT 0 false 1 && + rightMoveStep row rowT 0 true 2 && + rightMoveStep row rowF 1 true 5 && + rightMoveStep row rowT 2 false 4 && + rightMoveStep row rowT 4 true 5 && + rightMoveStep row rowF 5 true 0 && + leftMoveStep rowF row 1 false true 2 false && + leftMoveStep rowF row 2 true false 3 false && + leftMoveStep rowF row 3 false true 1 false && + leftMoveStep rowF row 3 true false 3 false && + leftMoveStep rowF row 5 false false 5 false && + leftMoveStep rowT row 1 false true 2 true && + leftMoveStep rowT row 2 true false 3 true && + leftMoveStep rowT row 3 false true 1 true && + leftMoveStep rowT row 3 true false 3 true && + leftMoveStep rowT row 5 false false 5 true +def lrun : List Bool → Nat + | [] => 0 + | b :: xs => lstep (lrun xs) b +def rrun : List Bool → Nat + | [] => 0 + | b :: xs => rstep (rrun xs) b +theorem lstep_zero : lstep 0 false = 0 := by decide +kernel +theorem rstep_zero : rstep 0 false = 0 := by decide +kernel +theorem rmask_zero : getRMask 0 = 0 := by decide +kernel +theorem lstep_bound_ok : + allUpTo (fun q => decide (lstep q false < 1409) && decide (lstep q true < 1409)) 1409 = true := by decide +kernel +theorem rstep_bound_ok : + allUpTo (fun q => decide (rstep q false < 1609) && decide (rstep q true < 1609)) 1609 = true := by decide +kernel +theorem rpre_ok : + allUpTo (fun qR' => + (rstep qR' false == 3 || (rpre (rstep qR' false) false).elem qR') && + (rstep qR' true == 3 || (rpre (rstep qR' true) true).elem qR')) 1609 = true := by decide +kernel +theorem transOK_true : allUpTo transOKAt 1409 = true := by decide +kernel +theorem decompStepPre_ok : allUpTo decompStepPreAt 2263 = true := by decide +kernel +section Soundness + +theorem lrun_headD_tail (L : List Bool) : lstep (lrun L.tail) (L.headD false) = lrun L := by + cases L with + | nil => exact lstep_zero + | cons b xs => rfl +theorem rrun_headD_tail (R : List Bool) : rstep (rrun R.tail) (R.headD false) = rrun R := by + cases R with + | nil => exact rstep_zero + | cons b xs => rfl +theorem allUpTo_sound {f : Nat → Bool} : + ∀ (n i : Nat), i < n → allUpTo f n = true → f i = true + | 0, i, hi, _ => by omega + | n + 1, i, hi, h => by + simp only [allUpTo, Bool.and_eq_true] at h + rcases Nat.eq_or_lt_of_le (Nat.le_of_lt_succ hi) with rfl | hlt + · exact h.1 + · exact allUpTo_sound n i hlt h.2 +theorem lstep_lt {q : Nat} (hq : q < 1409) (b : Bool) : lstep q b < 1409 := by + have h := allUpTo_sound 1409 q hq lstep_bound_ok + simp only [Bool.and_eq_true, decide_eq_true_eq] at h + cases b + · exact h.1 + · exact h.2 +theorem rstep_lt {q : Nat} (hq : q < 1609) (b : Bool) : rstep q b < 1609 := by + have h := allUpTo_sound 1609 q hq rstep_bound_ok + simp only [Bool.and_eq_true, decide_eq_true_eq] at h + cases b + · exact h.1 + · exact h.2 +theorem lrun_lt (L : List Bool) : lrun L < 1409 := by + induction L with + | nil => decide + | cons b xs ih => exact lstep_lt ih b +theorem rrun_lt (R : List Bool) : rrun R < 1609 := by + induction R with + | nil => decide + | cons b xs ih => exact rstep_lt ih b +theorem elem_rpre {qR' : Nat} (hq : qR' < 1609) (b : Bool) (hne : rstep qR' b ≠ 3) : + (rpre (rstep qR' b) b).elem qR' = true := by + have h := allUpTo_sound 1609 qR' hq rpre_ok + simp only [Bool.and_eq_true, Bool.or_eq_true, beq_iff_eq] at h + cases b + · rcases h.1 with h3 | he + · exact False.elim (hne h3) + · exact he + · rcases h.2 with h3 | he + · exact False.elim (hne h3) + · exact he +theorem allBitsIn_of_elem {m : Nat} : + ∀ (l : List Nat) (x : Nat), allBitsIn m l = true → l.elem x = true → Nat.testBit m x = true + | [], _, _, he => by cases he + | a :: as, x, hall, he => by + simp only [allBitsIn, Bool.and_eq_true] at hall + simp only [List.elem] at he + split at he + · next h => + rw [beq_iff_eq] at h + subst h + exact hall.1 + · exact allBitsIn_of_elem as x hall.2 he +theorem deltaStep_of_testBit {w : Bool} {mtk : Nat} : + ∀ (l : List Nat) (qR : Nat), + deltaStep w mtk l = true → Nat.testBit (listToMask l) qR = true → + Nat.testBit mtk (rstep qR w) = true + | [], qR, _, hbit => by simp [listToMask] at hbit + | x :: xs, qR, hds, hbit => by + simp only [deltaStep, Bool.and_eq_true] at hds + simp only [listToMask, Nat.testBit_or, Bool.or_eq_true] at hbit + rcases hbit with hbit | hbit + · rw [Nat.testBit_two_pow, decide_eq_true_eq] at hbit + subst hbit + exact hds.1 + · exact deltaStep_of_testBit xs qR hds.2 hbit +theorem deltaPre_of_testBit {b : Bool} {mtk : Nat} : + ∀ (l : List Nat) (qR : Nat), + deltaPre b mtk l = true → Nat.testBit (listToMask l) qR = true → + qR ≠ 3 ∧ allBitsIn mtk (rpre qR b) = true + | [], qR, _, hbit => by simp [listToMask] at hbit + | x :: xs, qR, hdp, hbit => by + simp only [deltaPre, Bool.and_eq_true, bne_iff_ne] at hdp + simp only [listToMask, Nat.testBit_or, Bool.or_eq_true] at hbit + rcases hbit with hbit | hbit + · rw [Nat.testBit_two_pow, decide_eq_true_eq] at hbit + subst hbit + exact ⟨hdp.1.1, hdp.1.2⟩ + · exact deltaPre_of_testBit xs qR hdp.2 hbit +theorem testBit_of_or_eq {A B i : Nat} (hor : (A ||| B) = B) (ha : Nat.testBit A i = true) : + Nat.testBit B i = true := by + rw [← hor, Nat.testBit_or, ha, Bool.true_or] +theorem subMask_sound {j_sub t_sub t_sup : Nat} + (h : subMask j_sub t_sub t_sup (getRMask t_sup) = true) + (hj : j_sub ≠ 0) (ht_sup : t_sup ≠ 0) : + t_sub ≠ 0 ∧ ∀ x, Nat.testBit (getRMask t_sub) x = true → Nat.testBit (getRMask t_sup) x = true := by + unfold subMask at h + have hjf : (j_sub == 0) = false := beq_false_of_ne hj + rw [hjf, Bool.false_or] at h + simp only [Bool.or_eq_true, Bool.and_eq_true, beq_iff_eq, bne_iff_ne] at h + rcases h with rfl | ⟨hne, hor⟩ + · exact ⟨ht_sup, fun _ hx => hx⟩ + · exact ⟨hne, fun _ hx => testBit_of_or_eq hor hx⟩ +theorem subMask_of_fast {j_sub t_sub t_sup mask_sup : Nat} + (h : (j_sub == 0 || t_sub == t_sup) = true) : + subMask j_sub t_sub t_sup mask_sup = true := by + unfold subMask + rw [h, Bool.true_or] +theorem subMaskIdx_sound {t_sub t_sup : Nat} + (h : subMaskIdx t_sub t_sup = true) + {x : Nat} (hx : Nat.testBit (getRMask t_sub) x = true) : + Nat.testBit (getRMask t_sup) x = true := by + dsimp only [subMaskIdx] at h + simp only [Bool.or_eq_true, beq_iff_eq] at h + rcases h with rfl | hor + · exact hx + · exact testBit_of_or_eq hor hx +theorem checkStep_sound {w : Bool} {j1 j2 t1 t2 tk : Nat} {delta : List Nat} + (hc : checkStep w j1 j2 t1 t2 tk delta = true) (htk : tk ≠ 0) : + subMask j1 t1 tk (getRMask tk) = true ∧ + subMask j2 t2 tk (getRMask tk) = true ∧ + deltaStep w (getRMask tk) delta = true := by + dsimp only [checkStep] at hc + have htkf : (tk == 0) = false := beq_false_of_ne htk + rw [htkf, Bool.false_or, Bool.and_eq_true, Bool.or_eq_true] at hc + rcases hc with ⟨hfast | hsub, hds⟩ + · rw [Bool.and_eq_true] at hfast + exact ⟨subMask_of_fast hfast.1, subMask_of_fast hfast.2, hds⟩ + · rw [Bool.and_eq_true] at hsub + exact ⟨hsub.1, hsub.2, hds⟩ +theorem checkPre_sound {b : Bool} {j1 j2 t1 t2 tk : Nat} {delta : List Nat} + (hc : checkPre b j1 j2 t1 t2 tk delta = true) (htk : tk ≠ 0) : + subMask j1 t1 tk (getRMask tk) = true ∧ + subMask j2 t2 tk (getRMask tk) = true ∧ + deltaPre b (getRMask tk) delta = true := by + dsimp only [checkPre] at hc + have htkf : (tk == 0) = false := beq_false_of_ne htk + rw [htkf, Bool.false_or, Bool.and_eq_true, Bool.or_eq_true] at hc + rcases hc with ⟨hfast | hsub, hdp⟩ + · rw [Bool.and_eq_true] at hfast + exact ⟨subMask_of_fast hfast.1, subMask_of_fast hfast.2, hdp⟩ + · rw [Bool.and_eq_true] at hsub + exact ⟨hsub.1, hsub.2, hdp⟩ +theorem decomp_unpack {k : Nat} (hk : k < 2263) (hk0 : k ≠ 0) : + getJ1 k < k ∧ + getJ2 k < k ∧ + getRMask k = (getRMask (getJ1 k) ||| (getRMask (getJ2 k) ||| listToMask (getDelta k))) ∧ + (∀ w, checkStep w (getJ1 k) (getJ2 k) (getStepTarget (getJ1 k) w) (getStepTarget (getJ2 k) w) (getStepTarget k w) (getDelta k) = true) ∧ + (∀ b, checkPre b (getJ1 k) (getJ2 k) (getPreTarget (getJ1 k) b) (getPreTarget (getJ2 k) b) (getPreTarget k b) (getDelta k) = true) := by + have hd := allUpTo_sound 2263 k hk decompStepPre_ok + dsimp only [decompStepPreAt] at hd + have hkf : (k == 0) = false := beq_false_of_ne hk0 + have hkt : (k != 0) = true := bne_iff_ne.mpr hk0 + simp only [hkf, Bool.false_and, Bool.false_or, hkt, Bool.true_and, Bool.and_eq_true, Nat.ble_eq, beq_iff_eq] at hd + obtain ⟨⟨⟨⟨⟨⟨hj1, hj2⟩, hrm⟩, hsF⟩, hsT⟩, hpF⟩, hpT⟩ := hd + refine ⟨hj1, hj2, hrm, ?_, ?_⟩ + · intro w; cases w + · exact hsF + · exact hsT + · intro b; cases b + · exact hpF + · exact hpT +theorem ne_zero_of_testBit_rmask {j x : Nat} (h : Nat.testBit (getRMask j) x = true) : j ≠ 0 := by + intro rfl + rw [rmask_zero, Nat.zero_testBit] at h + cases h +theorem stepTarget_sound (w : Bool) (k : Nat) : + k < 2263 → getStepTarget k w ≠ 0 → + ∀ (qR : Nat), Nat.testBit (getRMask k) qR = true → + Nat.testBit (getRMask (getStepTarget k w)) (rstep qR w) = true := by + induction k using Nat.strong_induction_on with + | h k ih => + intro hk htk qR hbit + have hk0 : k ≠ 0 := ne_zero_of_testBit_rmask hbit + obtain ⟨hj1, hj2, hrm, hcs_all, _⟩ := decomp_unpack hk hk0 + have ⟨hsub1, hsub2, hds⟩ := checkStep_sound (hcs_all w) htk + rw [hrm, Nat.testBit_or, Nat.testBit_or, Bool.or_eq_true, Bool.or_eq_true] at hbit + rcases hbit with hbit1 | hbit2 | hbitd + · have hj1_ne : getJ1 k ≠ 0 := ne_zero_of_testBit_rmask hbit1 + obtain ⟨ht1, himp1⟩ := subMask_sound hsub1 hj1_ne htk + exact himp1 _ (ih (getJ1 k) hj1 (Nat.lt_trans hj1 hk) ht1 qR hbit1) + · have hj2_ne : getJ2 k ≠ 0 := ne_zero_of_testBit_rmask hbit2 + obtain ⟨ht2, himp2⟩ := subMask_sound hsub2 hj2_ne htk + exact himp2 _ (ih (getJ2 k) hj2 (Nat.lt_trans hj2 hk) ht2 qR hbit2) + · exact deltaStep_of_testBit (getDelta k) qR hds hbitd +theorem preTarget_sound (b : Bool) (k : Nat) : + k < 2263 → getPreTarget k b ≠ 0 → + ∀ (qR' : Nat), qR' < 1609 → Nat.testBit (getRMask k) (rstep qR' b) = true → + Nat.testBit (getRMask (getPreTarget k b)) qR' = true := by + induction k using Nat.strong_induction_on with + | h k ih => + intro hk htk qR' hqR' hbit + have hk0 : k ≠ 0 := ne_zero_of_testBit_rmask hbit + obtain ⟨hj1, hj2, hrm, _, hcp_all⟩ := decomp_unpack hk hk0 + have ⟨hsub1, hsub2, hdp⟩ := checkPre_sound (hcp_all b) htk + rw [hrm, Nat.testBit_or, Nat.testBit_or, Bool.or_eq_true, Bool.or_eq_true] at hbit + rcases hbit with hbit1 | hbit2 | hbitd + · have hj1_ne : getJ1 k ≠ 0 := ne_zero_of_testBit_rmask hbit1 + obtain ⟨ht1, himp1⟩ := subMask_sound hsub1 hj1_ne htk + exact himp1 _ (ih (getJ1 k) hj1 (Nat.lt_trans hj1 hk) ht1 qR' hqR' hbit1) + · have hj2_ne : getJ2 k ≠ 0 := ne_zero_of_testBit_rmask hbit2 + obtain ⟨ht2, himp2⟩ := subMask_sound hsub2 hj2_ne htk + exact himp2 _ (ih (getJ2 k) hj2 (Nat.lt_trans hj2 hk) ht2 qR' hqR' hbit2) + · obtain ⟨hne3, hall⟩ := deltaPre_of_testBit (getDelta k) (rstep qR' b) hdp hbitd + exact allBitsIn_of_elem _ qR' hall (elem_rpre hqR' b hne3) +def inMid (qL s : Nat) (h : Bool) (qR : Nat) : Bool := + Nat.testBit (getRMask (getMid qL s h)) qR +def Inv (c : Cfg) : Prop := + inMid (lrun c.L) c.q c.h (rrun c.R) = true +theorem getMid_ne_zero {qL s : Nat} {h : Bool} {qR : Nat} + (hm : inMid qL s h qR = true) : getMid qL s h ≠ 0 := + ne_zero_of_testBit_rmask hm +theorem getMid_eq_row {qL s : Nat} (hs : s < 6) (h : Bool) : + getMid qL s h = getMidFromRow (getLeftRow qL) s h := by + unfold getMid + have hb : Nat.ble (s + 1) 6 = true := Nat.ble_eq.mpr hs + rw [hb] +theorem s_lt_of_inMid {qL s : Nat} {h : Bool} {qR : Nat} + (hm : inMid qL s h qR = true) : s < 6 := by + have hne := getMid_ne_zero hm + unfold getMid at hne + cases hb : Nat.ble (s + 1) 6 + · rw [hb] at hne; exact False.elim (hne rfl) + · exact Nat.ble_eq.mp hb +theorem not_halted_of_Inv {c : Cfg} (hi : Inv c) : ¬ halted M c := by + rcases c with ⟨q, L, h, R⟩ + have hs := s_lt_of_inMid hi + have hqL : lrun L < 1409 := lrun_lt L + have htr := allUpTo_sound 1409 (lrun L) hqL transOK_true + dsimp only [transOKAt] at htr + simp only [Bool.and_eq_true, beq_iff_eq] at htr + have h4f : getMidFromRow (getLeftRow (lrun L)) 4 false = 0 := htr.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1 + intro hh + match q, h with + | 0, false | 0, true | 1, false | 1, true | 2, false | 2, true + | 3, false | 3, true | 4, true | 5, false | 5, true => + cases hh + | 4, false => + have hne := getMid_ne_zero hi + change getMid (lrun L) 4 false ≠ 0 at hne + rw [getMid_eq_row (by decide)] at hne + exact hne h4f + | q + 6, _ => + change q + 6 < 6 at hs; omega +theorem rightMoveStep_sound (qL : Nat) (R : List Bool) (w : Bool) {s s' : Nat} {h : Bool} + (hs : s < 6) (hs' : s' < 6) + (hrs : rightMoveStep (getLeftRow qL) (getLeftRow (lstep qL w)) s h s' = true) + (hm : inMid qL s h (rrun R) = true) : + inMid (lstep qL w) s' (R.headD false) (rrun R.tail) = true := by + have hne := getMid_ne_zero hm + rw [getMid_eq_row hs] at hne + dsimp only [rightMoveStep] at hrs + have hkf : (getMidFromRow (getLeftRow qL) s h == 0) = false := beq_false_of_ne hne + rw [hkf, Bool.false_or] at hrs + simp only [Bool.and_eq_true, Nat.ble_eq, bne_iff_ne] at hrs + obtain ⟨⟨⟨⟨hk, htpF⟩, htpT⟩, hsubF⟩, hsubT⟩ := hrs + rw [← getMid_eq_row hs] at hk htpF htpT hsubF hsubT + have hbit : Nat.testBit (getRMask (getMid qL s h)) (rstep (rrun R.tail) (R.headD false)) = true := by + rw [rrun_headD_tail R]; exact hm + have hqR' : rrun R.tail < 1609 := rrun_lt R.tail + unfold inMid + rw [getMid_eq_row hs'] + cases hrb : R.headD false <;> rw [hrb] at hbit + · have hpre := preTarget_sound false (getMid qL s h) hk htpF (rrun R.tail) hqR' hbit + exact subMaskIdx_sound hsubF hpre + · have hpre := preTarget_sound true (getMid qL s h) hk htpT (rrun R.tail) hqR' hbit + exact subMaskIdx_sound hsubT hpre +theorem leftMoveStep_sound (qL' qR : Nat) (w b : Bool) {s s' : Nat} {h : Bool} + (hs : s < 6) (hs' : s' < 6) + (hls : leftMoveStep (getLeftRow (lstep qL' b)) (getLeftRow qL') s h w s' b = true) + (hm : inMid (lstep qL' b) s h qR = true) : + inMid qL' s' b (rstep qR w) = true := by + have hne := getMid_ne_zero hm + rw [getMid_eq_row hs] at hne + dsimp only [leftMoveStep] at hls + have hkf : (getMidFromRow (getLeftRow (lstep qL' b)) s h == 0) = false := beq_false_of_ne hne + rw [hkf, Bool.false_or] at hls + simp only [Bool.and_eq_true, Nat.ble_eq, bne_iff_ne] at hls + obtain ⟨⟨hk, hts⟩, hsub⟩ := hls + rw [← getMid_eq_row hs] at hk hts hsub + have hstep := stepTarget_sound w (getMid (lstep qL' b) s h) hk hts qR hm + unfold inMid + rw [getMid_eq_row hs'] + exact subMaskIdx_sound hsub hstep + +theorem Inv_step {c : Cfg} (hi : Inv c) : Inv (step M c) := by + rcases c with ⟨q, L, h, R⟩ + have hs := s_lt_of_inMid hi + have hnh := not_halted_of_Inv hi + unfold Inv at hi + have htr := allUpTo_sound 1409 (lrun L) (lrun_lt L) transOK_true + dsimp only [transOKAt] at htr + simp only [Bool.and_eq_true] at htr + obtain ⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨_, hr0F⟩, hr0T⟩, hr1T⟩, hr2F⟩, hr4T⟩, hr5T⟩, + hl1F_F⟩, hl2T_F⟩, hl3F_F⟩, hl3T_F⟩, hl5F_F⟩, + hl1F_T⟩, hl2T_T⟩, hl3F_T⟩, hl3T_T⟩, hl5F_T⟩ := htr + have htr' := allUpTo_sound 1409 (lrun L.tail) (lrun_lt L.tail) transOK_true + dsimp only [transOKAt] at htr' + simp only [Bool.and_eq_true] at htr' + obtain ⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨_, _⟩, _⟩, _⟩, _⟩, _⟩, _⟩, + hl1F_F'⟩, hl2T_F'⟩, hl3F_F'⟩, hl3T_F'⟩, hl5F_F'⟩, + hl1F_T'⟩, hl2T_T'⟩, hl3F_T'⟩, hl3T_T'⟩, hl5F_T'⟩ := htr' + have hmL : inMid (lstep (lrun L.tail) (L.headD false)) q h (rrun R) = true := by + rw [lrun_headD_tail L]; exact hi + match q, h with + | 0, false => + change inMid (lstep (lrun L) true) 1 (R.headD false) (rrun R.tail) = true + exact rightMoveStep_sound (lrun L) R true (by decide) (by decide) hr0F hi + | 0, true => + change inMid (lstep (lrun L) true) 2 (R.headD false) (rrun R.tail) = true + exact rightMoveStep_sound (lrun L) R true (by decide) (by decide) hr0T hi + | 1, false => + change inMid (lrun L.tail) 2 (L.headD false) (rstep (rrun R) true) = true + cases hb : L.headD false <;> rw [hb] at hmL + · exact leftMoveStep_sound (lrun L.tail) (rrun R) true false (by decide) (by decide) hl1F_F' hmL + · exact leftMoveStep_sound (lrun L.tail) (rrun R) true true (by decide) (by decide) hl1F_T' hmL + | 1, true => + change inMid (lstep (lrun L) false) 5 (R.headD false) (rrun R.tail) = true + exact rightMoveStep_sound (lrun L) R false (by decide) (by decide) hr1T hi + | 2, false => + change inMid (lstep (lrun L) true) 4 (R.headD false) (rrun R.tail) = true + exact rightMoveStep_sound (lrun L) R true (by decide) (by decide) hr2F hi + | 2, true => + change inMid (lrun L.tail) 3 (L.headD false) (rstep (rrun R) false) = true + cases hb : L.headD false <;> rw [hb] at hmL + · exact leftMoveStep_sound (lrun L.tail) (rrun R) false false (by decide) (by decide) hl2T_F' hmL + · exact leftMoveStep_sound (lrun L.tail) (rrun R) false true (by decide) (by decide) hl2T_T' hmL + | 3, false => + change inMid (lrun L.tail) 1 (L.headD false) (rstep (rrun R) true) = true + cases hb : L.headD false <;> rw [hb] at hmL + · exact leftMoveStep_sound (lrun L.tail) (rrun R) true false (by decide) (by decide) hl3F_F' hmL + · exact leftMoveStep_sound (lrun L.tail) (rrun R) true true (by decide) (by decide) hl3F_T' hmL + | 3, true => + change inMid (lrun L.tail) 3 (L.headD false) (rstep (rrun R) false) = true + cases hb : L.headD false <;> rw [hb] at hmL + · exact leftMoveStep_sound (lrun L.tail) (rrun R) false false (by decide) (by decide) hl3T_F' hmL + · exact leftMoveStep_sound (lrun L.tail) (rrun R) false true (by decide) (by decide) hl3T_T' hmL + | 4, false => + exfalso; exact hnh rfl + | 4, true => + change inMid (lstep (lrun L) true) 5 (R.headD false) (rrun R.tail) = true + exact rightMoveStep_sound (lrun L) R true (by decide) (by decide) hr4T hi + | 5, false => + change inMid (lrun L.tail) 5 (L.headD false) (rstep (rrun R) false) = true + cases hb : L.headD false <;> rw [hb] at hmL + · exact leftMoveStep_sound (lrun L.tail) (rrun R) false false (by decide) (by decide) hl5F_F' hmL + · exact leftMoveStep_sound (lrun L.tail) (rrun R) false true (by decide) (by decide) hl5F_T' hmL + | 5, true => + change inMid (lstep (lrun L) false) 0 (R.headD false) (rrun R.tail) = true + exact rightMoveStep_sound (lrun L) R false (by decide) (by decide) hr5T hi + | q + 6, _ => + change q + 6 < 6 at hs; omega +theorem lrun_strip (L : List Bool) : lrun (strip L) = lrun L := by + induction L with + | nil => rfl + | cons b xs ih => + cases b + · dsimp only [strip] + cases h : strip xs with + | nil => + change 0 = lstep (lrun xs) false + rw [← ih, h] + exact lstep_zero.symm + | cons y ys => + change lstep (lrun (y :: ys)) false = lstep (lrun xs) false + rw [← h, ih] + · simp only [strip, lrun, ih] +theorem rrun_strip (R : List Bool) : rrun (strip R) = rrun R := by + induction R with + | nil => rfl + | cons b xs ih => + cases b + · dsimp only [strip] + cases h : strip xs with + | nil => + change 0 = rstep (rrun xs) false + rw [← ih, h] + exact rstep_zero.symm + | cons y ys => + change rstep (rrun (y :: ys)) false = rstep (rrun xs) false + rw [← h, ih] + · simp only [strip, rrun, ih] +theorem lrun_eqv {x y : List Bool} (h : eqv x y) : lrun x = lrun y := by + rw [← lrun_strip x, ← lrun_strip y, h] +theorem rrun_eqv {x y : List Bool} (h : eqv x y) : rrun x = rrun y := by + rw [← rrun_strip x, ← rrun_strip y, h] +theorem Inv_of_eqvC {c d : Cfg} (he : eqvC c d) (hi : Inv c) : Inv d := by + obtain ⟨hq, hh, hL, hR⟩ := he + unfold Inv at hi ⊢ + rw [← hq, ← hh, ← lrun_eqv hL, ← rrun_eqv hR] + exact hi +theorem Inv_run (n : Nat) : ∀ {c : Cfg}, Inv c → Inv (run M n c) := by + induction n with + | zero => intro c hi; exact hi + | succ n ih => intro c hi; exact ih (Inv_step hi) +theorem nonhalt_of_start {q : Nat} (h : ∃ m, Inv (run M m (blank q))) : + ∀ n, ¬ halted M (run M n (blank q)) := by + obtain ⟨m, hm⟩ := h + intro n hn + by_cases hnm : m ≤ n + · have : n = m + (n - m) := by omega + rw [this, run_add] at hn + exact not_halted_of_Inv (Inv_run (n - m) hm) hn + · have := halted_mono (show n ≤ m + 0 by omega) hn + rw [run_add] at this + exact not_halted_of_Inv hm this +end Soundness +theorem evStep_shift (d : Nat) {n n' : Nat} {W W' : List Bool} + (h : evStep (n, W) = some (n', W')) : + evStep (n + d, W) = some (n' + d, W') := by + rcases W with _ | ⟨b, Ws⟩ + · simp [evStep] at h + cases b + case true => simp [evStep] at h + by_cases hn : 2 ≤ n + case neg => simp [evStep, hn] at h + have hnd : 2 ≤ n + d := by omega + cases hw : M23.wordMapFast 450 (Ws ++ List.replicate PAD false) with + | none => simp [evStep, hn, hw] at h + | some r => + obtain ⟨J', V⟩ := r + simp only [evStep, hn, hnd, if_true, hw, Option.some.injEq, Prod.mk.injEq] at h ⊢ + obtain ⟨rfl, rfl⟩ := h + refine ⟨?_, rfl⟩ + omega +def suffixStep (S : List Bool) : Option (List Bool) := + match M23.seekToB0 450 ⟨.C, [], false, S ++ List.replicate PAD false⟩ with + | some (true :: false :: S_raw) => some (strip S_raw) + | _ => none +theorem suffixStep_sound {P S S' : List Bool} (n : Nat) (hn : 2 ≤ n) + (hP : M23.ValidCPrefix P) (hS : suffixStep S = some S') : + ∃ m, eqvC (run M m (ck n (false :: (P ++ S)))) (ck (n + 2) (false :: (P ++ S'))) := by + unfold suffixStep at hS + split at hS + · rename_i S_raw hseek + simp only [Option.some.injEq] at hS + subst hS + obtain ⟨a2, ha2⟩ := M23.seekToB0_sound 450 hseek + obtain ⟨a, V, hw, hV⟩ := M23.wordHyp_prefix hP ha2 + obtain ⟨k, rfl⟩ : ∃ k, n = k + 2 := ⟨n - 2, by omega⟩ + have hw' : M23.wordHyp ((P ++ S) ++ List.replicate PAD false) a 2 2 V := by + simpa [List.append_assoc] using hw + have ev := M23.event k 2 2 a ((P ++ S) ++ List.replicate PAD false) V (by omega) hw' + have hsub : 2 + (k + 2 - 2) = k + 2 := by omega + rw [hsub] at ev + have hr := run_f (M23.evSteps k a (k + 2)) + (M23.ckpt (k + 2) (false :: ((P ++ S) ++ List.replicate PAD false))) + (by unfold goodC M23.ckpt; intro h; cases h) + rw [ev, ck_f, ck_f] at hr + refine ⟨M23.evSteps k a (k + 2), ?_⟩ + have e1 : eqvC (ck (k + 2) (false :: (P ++ S))) + (ck (k + 2) (false :: ((P ++ S) ++ List.replicate PAD false))) := by + refine ⟨rfl, rfl, rfl, ?_⟩ + show eqv _ _ + apply eqv_append + show strip _ = strip _ + rw [← List.cons_append]; exact (eqv_pad _ _).symm + have e2 := run_eqvC M (M23.evSteps k a (k + 2)) e1 + rw [← hr] at e2 + refine eqvC_trans e2 ⟨rfl, rfl, rfl, ?_⟩ + show eqv _ _ + simp only [ck, hV] + have e3 : M23.pw (k + 2 + 1) M23.U ++ (M23.U ++ (false :: P ++ S_raw)) + = M23.pw (k + 2 + 2) M23.U ++ (false :: (P ++ S_raw)) := by + rw [M23.pw_succ' (k + 2 + 1), List.append_assoc] + simp + rw [e3] + apply eqv_append + exact eqv_cons false (eqv_append (eqv_strip S_raw).symm) + · cases hS +def suffixIter : Nat → List Bool → Option (List Bool) + | 0, S => some S + | k + 1, S => (suffixStep S).bind (suffixIter k) +theorem suffixIter_sound (k : Nat) {P : List Bool} (hP : M23.ValidCPrefix P) : + ∀ {S S' : List Bool} (n : Nat), 2 ≤ n → suffixIter k S = some S' → + ∃ m, eqvC (run M m (ck n (false :: (P ++ S)))) (ck (n + 2 * k) (false :: (P ++ S'))) := by + induction k with + | zero => + intro S S' n _ h + simp only [suffixIter, Option.some.injEq] at h + subst h + exact ⟨0, eqvC_refl _⟩ + | succ k ih => + intro S S' n hn h + simp only [suffixIter, Option.bind_eq_some_iff] at h + obtain ⟨S1, h1, h2⟩ := h + obtain ⟨m1, e1⟩ := suffixStep_sound n hn hP h1 + obtain ⟨m2, e2⟩ := ih (n + 2) (by omega) h2 + refine ⟨m1 + m2, ?_⟩ + rw [run_add] + have e3 := eqvC_trans (run_eqvC M m2 e1) e2 + have h_add : n + 2 + 2 * k = n + 2 * (k + 1) := by omega + rw [h_add] at e3 + exact e3 +inductive TArr (α : Type) where + | leaf (v : α) + | node (sz : Nat) (l r : TArr α) +local notation "zTN" => TArr.node +local notation "zTL" => TArr.leaf +def TArr.get {α : Type} : TArr α → Nat → α → α + | .leaf v, 0, _ => v + | .leaf _, _, d => d + | .node sz l r, i, d => + if i < sz then l.get i d else r.get (i - sz) d +def sNat {α : Type} (n : Nat) (f : Nat → α) : α := + match n + 1 with + | 0 => f 0 + | m + 1 => f m +theorem sNat_eq {α : Type} (n : Nat) (f : Nat → α) : sNat n f = f n := by + unfold sNat + split + · omega + · rename_i m hm + have : m = n := by omega + subst this; rfl +def eqLB : List Bool → List Bool → Bool + | [], [] => true + | x :: xs, y :: ys => (x == y) && eqLB xs ys + | _, _ => false +theorem eqLB_iff {xs ys : List Bool} : eqLB xs ys = true ↔ xs = ys := by + induction xs generalizing ys with + | nil => cases ys <;> simp [eqLB] + | cons x xs ih => + cases ys with + | nil => simp [eqLB] + | cons y ys => + simp only [eqLB, Bool.and_eq_true, beq_iff_eq, ih, List.cons.injEq] +def eqOptLB : Option (List Bool) → List Bool → Bool + | some xs, ys => eqLB xs ys + | none, _ => false +theorem eqOptLB_iff {o : Option (List Bool)} {ys : List Bool} : + eqOptLB o ys = true ↔ o = some ys := by + cases o with + | none => simp [eqOptLB] + | some xs => simp only [eqOptLB, eqLB_iff, Option.some.injEq] +def eqOptPair : Option (Nat × List Bool) → Nat → List Bool → Bool + | some (n, xs), m, ys => (n == m) && eqLB xs ys + | none, _, _ => false +theorem eqOptPair_iff {o : Option (Nat × List Bool)} {m : Nat} {ys : List Bool} : + eqOptPair o m ys = true ↔ o = some (m, ys) := by + cases o with + | none => simp [eqOptPair] + | some p => + obtain ⟨n, xs⟩ := p + simp only [eqOptPair, Bool.and_eq_true, beq_iff_eq, eqLB_iff, Option.some.injEq, Prod.mk.injEq] +def segTable : TArr (List Bool) := (zTN 7 (zTN 3 (zTN 1 (zTL [zT,zT,zF,zT,zT,zT,zF]) (zTN 1 (zTL [zT,zT,zT,zF]) (zTL [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF]))) (zTN 2 (zTN 1 (zTL [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF]) (zTL [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF])) (zTN 1 (zTL [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF]) (zTL [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF])))) (zTN 3 (zTN 1 (zTL [zT,zT,zF,zT,zT,zF,zT,zT,zT,zF]) (zTN 1 (zTL [zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF]) (zTL [zT,zT,zF,zF,zT,zT,zF]))) (zTN 2 (zTN 1 (zTL [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF]) (zTL [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF])) (zTN 1 (zTL [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF]) (zTL [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF]))))) +def segBits (i : Nat) : List Bool := segTable.get i [] +def stateTable : TArr (List Bool) := (zTN 79 (zTN 39 (zTN 19 (zTN 9 (zTN 4 (zTN 2 (zTN 1 + (zTL [zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) (zTL + [zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT])) (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) (zTL + [zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]))) (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL [zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]))))) + (zTN 5 (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT])))) + (zTN 2 (zTN 1 (zTL + [zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])))))) + (zTN 10 (zTN 5 (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) (zTN + 1 (zTL [zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT])))) + (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]))))) + (zTN 5 (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])))) + (zTN 2 (zTN 1 (zTL + [zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]))))))) + (zTN 20 (zTN 10 (zTN 5 (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])))) + (zTN 2 (zTN 1 (zTL + [zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]))))) + (zTN 5 (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])))) + (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT])))))) + (zTN 10 (zTN 5 (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT])))) + (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]))))) + (zTN 5 (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT])))) + (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT])))))))) + (zTN 40 (zTN 20 (zTN 10 (zTN 5 (zTN 2 (zTN 1 (zTL + [zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT])))) + (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]))))) + (zTN 5 (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT])))) + (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT])))))) + (zTN 10 (zTN 5 (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])))) + (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]))))) + (zTN 5 (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT])))) + (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT]))))))) + (zTN 20 (zTN 10 (zTN 5 (zTN 2 (zTN 1 (zTL + [zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])))) + (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]))))) + (zTN 5 (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])))) + (zTN 2 (zTN 1 (zTL + [zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT])))))) + (zTN 10 (zTN 5 (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT])))) + (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]))))) + (zTN 5 (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])))) + (zTN 2 (zTN 1 (zTL + [zT,zT,zF,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTN 1 (zTL + [zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT]))))))))) + +def stateBits (i : Nat) : List Bool := stateTable.get i [] +def fbTable : TArr (List Bool) := (zTN 13 (zTN 6 (zTN 3 (zTN 1 (zTL + [zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) (zTN 1 (zTL + [zF,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) (zTL + [zF,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]))) (zTN 1 (zTL + [zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) (zTN 1 + (zTL [zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) (zTL + [zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT])))) + (zTN 3 (zTN 1 (zTL + [zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) (zTN + 1 (zTL + [zF,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zF,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]))) + (zTN 2 (zTN 1 (zTL + [zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]))))) + (zTN 7 (zTN 3 (zTN 1 (zTL + [zF,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTN 1 (zTL + [zF,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]))) + (zTN 2 (zTN 1 (zTL + [zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT])) + (zTN 1 (zTL + [zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT]) + (zTL + [zF,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT])))) + (zTN 3 (zTN 1 (zTL + [zF,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTN 1 (zTL + [zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]))) + (zTN 2 (zTN 1 (zTL + [zF,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT])) + (zTN 1 (zTL + [zF,zT,zT,zF,zT,zT,zF,zF,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zF,zT,zT,zF,zT]) + (zTL + [zF,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zF,zT,zT,zT,zF,zT,zT,zF,zT,zF,zT,zT,zF,zT])))))) + +def fbBits (i : Nat) : List Bool := fbTable.get i [] +inductive CAct where + | push (seg : Nat) (s_rem : Nat) + | mac (k : Nat) (s_end : Nat) + | popExit (pops : List (Nat × Nat)) (w_exit : Option Nat) + | none +inductive FbAct where + | fb (dn : Nat) (is_c : Bool) (out_id : Nat) + | none +def cActTable : TArr CAct := (zTN 79 (zTN 39 (zTN 19 (zTN 9 (zTN 4 (zTN 2 (zTN 1 (zTL + (.mac 2 1)) (zTL (.popExit [] (some 1)))) (zTN 1 (zTL (.mac 2 3)) (zTL + (.popExit [] (some 3))))) (zTN 2 (zTN 1 (zTL (.mac 12 5)) (zTL + (.popExit [(3,25),(6,39)] (some 5)))) (zTN 1 (zTL (.mac 32 7)) (zTN 1 (zTL + (.popExit [(0,11),(1,17),(4,27),(5,48),(7,41),(10,68),(12,84)] (some 7))) (zTL + (.mac 2 9)))))) (zTN 5 (zTN 2 (zTN 1 (zTL (.push 0 10)) (zTL (.mac 29 7))) (zTN 1 (zTL + (.mac 1 12)) (zTN 1 (zTL (.popExit [(0,29),(1,43),(8,50),(11,70),(13,86)] (some 9))) + (zTL (.push 0 14))))) (zTN 2 (zTN 1 (zTL (.mac 14 15)) (zTL (.push 1 16))) (zTN 1 (zTL + (.mac 17 7)) (zTN 1 (zTL (.mac 1 18)) (zTL (.popExit [(0,19),(1,35)] none))))))) (zTN + 10 (zTN 5 (zTN 2 (zTN 1 (zTL (.mac 5 20)) (zTL (.push 2 21))) (zTN 1 (zTL (.mac 6 22)) + (zTN 1 (zTL (.popExit [(2,23),(5,37)] none)) (zTL (.mac 8 24))))) (zTN 2 (zTN 1 (zTL + (.push 3 4)) (zTL (.mac 2 26))) (zTN 1 (zTL (.push 4 6)) (zTN 1 (zTL (.mac 2 28)) (zTL + (.push 0 8)))))) (zTN 5 (zTN 2 (zTN 1 (zTL (.mac 1 30)) (zTL + (.popExit [(3,72),(6,88),(9,52)] (some 11)))) (zTN 1 (zTL (.push 0 32)) (zTN 1 (zTL + (.mac 2 33)) (zTL (.push 1 34))))) (zTN 2 (zTN 1 (zTL (.mac 12 15)) (zTL (.mac 5 36))) + (zTN 1 (zTL (.push 5 21)) (zTN 1 (zTL (.mac 8 38)) (zTL (.push 6 4)))))))) (zTN 20 + (zTN 10 (zTN 5 (zTN 2 (zTN 1 (zTL (.mac 2 40)) (zTL (.push 7 6))) (zTN 1 (zTL + (.mac 2 42)) (zTN 1 (zTL (.push 1 8)) (zTL (.mac 1 44))))) (zTN 2 (zTN 1 (zTL + (.popExit [(0,45),(2,65),(5,82)] none)) (zTL (.mac 1 46))) (zTN 1 (zTL (.push 5 47)) + (zTN 1 (zTL (.mac 30 7)) (zTL (.mac 2 49)))))) (zTN 5 (zTN 2 (zTN 1 (zTL (.push 8 8)) + (zTL (.mac 2 51))) (zTN 1 (zTL (.push 9 13)) (zTN 1 (zTL (.mac 1 53)) (zTL + (.popExit [(0,57),(1,61),(4,74),(5,97),(7,90),(10,123),(12,139)] (some 13)))))) (zTN 2 + (zTN 1 (zTL (.push 0 55)) (zTL (.push 0 56))) (zTN 1 (zTL (.mac 1 33)) (zTN 1 (zTL + (.mac 1 58)) (zTL (.popExit [(0,76),(1,92),(8,99),(11,125),(13,141)] (some 15)))))))) + (zTN 10 (zTN 5 (zTN 2 (zTN 1 (zTL (.push 0 60)) (zTL (.push 1 55))) (zTN 1 (zTL + (.mac 1 62)) (zTN 1 (zTL (.popExit [(0,63),(1,80)] none)) (zTL (.mac 1 64))))) (zTN 2 + (zTN 1 (zTL (.push 2 33)) (zTL (.mac 1 66))) (zTN 1 (zTL (.push 10 67)) (zTN 1 (zTL + (.mac 31 7)) (zTL (.mac 2 69)))))) (zTN 5 (zTN 2 (zTN 1 (zTL (.push 11 8)) (zTL + (.mac 2 71))) (zTN 1 (zTL (.push 3 13)) (zTN 1 (zTL (.mac 2 73)) (zTL (.push 4 31))))) + (zTN 2 (zTN 1 (zTL (.mac 2 75)) (zTL (.push 0 54))) (zTN 1 (zTL (.mac 1 77)) (zTN 1 + (zTL (.popExit [(3,127),(6,143),(9,101)] (some 17))) (zTL (.push 0 79))))))))) (zTN 40 + (zTN 20 (zTN 10 (zTN 5 (zTN 2 (zTN 1 (zTL (.push 1 60)) (zTL (.mac 1 81))) (zTN 1 (zTL + (.push 5 33)) (zTN 1 (zTL (.mac 1 83)) (zTL (.push 12 67))))) (zTN 2 (zTN 1 (zTL + (.mac 2 85)) (zTL (.push 13 8))) (zTN 1 (zTL (.mac 2 87)) (zTN 1 (zTL (.push 6 13)) + (zTL (.mac 2 89)))))) (zTN 5 (zTN 2 (zTN 1 (zTL (.push 7 31)) (zTL (.mac 2 91))) (zTN + 1 (zTL (.push 1 54)) (zTN 1 (zTL (.mac 1 93)) (zTL + (.popExit [(0,94),(2,121),(5,137)] none))))) (zTN 2 (zTN 1 (zTL (.mac 1 95)) (zTL + (.push 5 96))) (zTN 1 (zTL (.push 0 33)) (zTN 1 (zTL (.mac 2 98)) (zTL + (.push 8 54))))))) (zTN 10 (zTN 5 (zTN 2 (zTN 1 (zTL (.mac 2 100)) (zTL (.push 9 59))) + (zTN 1 (zTL (.mac 1 102)) (zTN 1 (zTL + (.popExit [(0,107),(1,111),(4,129),(5,152),(7,145)] (some 19))) (zTL (.push 0 104))))) + (zTN 2 (zTN 1 (zTL (.push 0 105)) (zTL (.push 1 106))) (zTN 1 (zTL (.push 1 96)) (zTN + 1 (zTL (.mac 1 108)) (zTL (.popExit [(0,131),(1,147),(8,154)] (some 21))))))) (zTN 5 + (zTN 2 (zTN 1 (zTL (.push 0 110)) (zTL (.push 1 104))) (zTN 1 (zTL (.mac 1 112)) (zTN + 1 (zTL (.popExit [(0,113),(1,135)] none)) (zTL (.mac 1 114))))) (zTN 2 (zTN 1 (zTL + (.push 2 115)) (zTL (.push 1 116))) (zTN 1 (zTL (.push 1 117)) (zTN 1 (zTL + (.push 0 118)) (zTL (.mac 2 119)))))))) (zTN 20 (zTN 10 (zTN 5 (zTN 2 (zTN 1 (zTL + (.push 1 120)) (zTL (.mac 9 15))) (zTN 1 (zTL (.mac 1 122)) (zTN 1 (zTL (.push 10 55)) + (zTL (.mac 2 124))))) (zTN 2 (zTN 1 (zTL (.push 11 54)) (zTL (.mac 2 126))) (zTN 1 + (zTL (.push 3 59)) (zTN 1 (zTL (.mac 2 128)) (zTL (.push 4 78)))))) (zTN 5 (zTN 2 (zTN + 1 (zTL (.mac 2 130)) (zTL (.push 0 103))) (zTN 1 (zTL (.mac 1 132)) (zTN 1 (zTL + (.popExit [(9,156)] (some 23))) (zTL (.push 0 134))))) (zTN 2 (zTN 1 (zTL + (.push 1 110)) (zTL (.mac 1 136))) (zTN 1 (zTL (.push 5 115)) (zTN 1 (zTL + (.mac 1 138)) (zTL (.push 12 55))))))) (zTN 10 (zTN 5 (zTN 2 (zTN 1 (zTL (.mac 2 140)) + (zTL (.push 13 54))) (zTN 1 (zTL (.mac 2 142)) (zTN 1 (zTL (.push 6 59)) (zTL + (.mac 2 144))))) (zTN 2 (zTN 1 (zTL (.push 7 78)) (zTL (.mac 2 146))) (zTN 1 (zTL + (.push 1 103)) (zTN 1 (zTL (.mac 1 148)) (zTL (.popExit [(0,149)] none)))))) (zTN 5 + (zTN 2 (zTN 1 (zTL (.mac 1 150)) (zTL (.push 5 151))) (zTN 1 (zTL (.push 0 115)) (zTN + 1 (zTL (.mac 2 153)) (zTL (.push 8 103))))) (zTN 2 (zTN 1 (zTL (.mac 2 155)) (zTL + (.push 9 109))) (zTN 1 (zTL (.mac 1 157)) (zTN 1 (zTL (.popExit [] (some 25))) (zTL + (.popExit [] none)))))))))) + +def fbActTable : TArr FbAct := (.node 13 (.node 6 (.node 3 (.node 1 (.leaf (.fb 0 true 0)) (.node 1 (.leaf (.fb 2 false 2)) (.leaf (.fb 0 true 2)))) (.node 1 (.leaf (.fb 2 false 4)) (.node 1 (.leaf (.fb 0 true 4)) (.leaf (.fb 2 false 6))))) (.node 3 (.node 1 (.leaf (.fb 0 true 6)) (.node 1 (.leaf (.fb 2 false 8)) (.leaf (.fb 0 true 8)))) (.node 2 (.node 1 (.leaf (.fb 2 false 10)) (.leaf (.fb 0 true 13))) (.node 1 (.leaf (.fb 2 false 12)) (.leaf (.fb 0 true 31)))))) (.node 7 (.node 3 (.node 1 (.leaf (.fb 2 false 14)) (.node 1 (.leaf (.fb 0 true 54)) (.leaf (.fb 2 false 16)))) (.node 2 (.node 1 (.leaf (.fb 0 true 59)) (.leaf (.fb 2 false 18))) (.node 1 (.leaf (.fb 0 true 78)) (.leaf (.fb 2 false 20))))) (.node 3 (.node 1 (.leaf (.fb 0 true 103)) (.node 1 (.leaf (.fb 2 false 22)) (.leaf (.fb 0 true 109)))) (.node 2 (.node 1 (.leaf (.fb 2 false 24)) (.leaf (.fb 0 true 133))) (.node 1 (.leaf (.fb 2 false 26)) (.leaf (.fb 0 true 158))))))) +def lookupPop : List (Nat × Nat) → Nat → Option Nat + | [], _ => none + | (seg, s_comb) :: rest, target => + if seg == target then some s_comb else lookupPop rest target +def checkPopList (s : Nat) : List (Nat × Nat) → Bool + | [] => true + | (seg, s_comb) :: rest => + eqLB (segBits seg ++ stateBits s) (stateBits s_comb) && + checkPopList s rest +theorem lookupPop_sound {s seg s_comb : Nat} {pops : List (Nat × Nat)} + (hc : checkPopList s pops = true) (hl : lookupPop pops seg = some s_comb) : + segBits seg ++ stateBits s = stateBits s_comb := by + induction pops with + | nil => simp [lookupPop] at hl + | cons hd tl ih => + obtain ⟨seg', s_comb'⟩ := hd + simp only [checkPopList, Bool.and_eq_true, eqLB_iff] at hc + simp only [lookupPop] at hl + split at hl + · rename_i heq + simp only [beq_iff_eq] at heq + simp only [Option.some.injEq] at hl + subst heq; subst hl + exact hc.1 + · exact ih hc.2 hl +def checkCAct (s : Nat) : CAct → Bool + | .push seg s_rem => + decide (seg < 14) && eqLB (stateBits s) (segBits seg ++ stateBits s_rem) + | .mac k s_end => + eqOptLB (suffixIter k (stateBits s)) (stateBits s_end) + | .popExit pops w_exit => + checkPopList s pops && + match w_exit with + | some w => eqLB (false :: ([true, true, false] ++ stateBits s)) (fbBits w) + | none => true + | .none => true +def validCAct (s : Nat) : Bool := checkCAct s (cActTable.get s .none) +def checkFbAct (w : Nat) : FbAct → Bool + | .fb dn true s_out => + eqOptPair (evStep (2, fbBits w)) (2 + dn) (false :: ([true, true, false] ++ stateBits s_out)) + | .fb dn false w_out => + eqOptPair (evStep (2, fbBits w)) (2 + dn) (fbBits w_out) + | .none => true +def validFbAct (w : Nat) : Bool := checkFbAct w (fbActTable.get w .none) +theorem validCSeg_all : (List.range 14).all (fun i => M23.checkCSeg (segBits i)) = true := by decide +kernel +theorem validCSeg_of_lt {i : Nat} (h : i < 14) : M23.ValidCSeg (segBits i) := by + have hall := validCSeg_all + rw [List.all_eq_true] at hall + exact M23.checkCSeg_sound (hall i (List.mem_range.mpr h)) +theorem validCAct_0 : (List.range 53).all validCAct = true := by decide +kernel +theorem validCAct_1 : (List.range 53).all (fun i => validCAct (i + 53)) = true := by decide +kernel +theorem validCAct_2 : (List.range 53).all (fun i => validCAct (i + 106)) = true := by decide +kernel +theorem validCAct_of_lt {s : Nat} (h : s < 159) : validCAct s = true := by + by_cases h1 : s < 53 + · have hall := validCAct_0; rw [List.all_eq_true] at hall + exact hall s (List.mem_range.mpr h1) + · by_cases h2 : s < 106 + · have hall := validCAct_1; rw [List.all_eq_true] at hall + have := hall (s - 53) (List.mem_range.mpr (by omega)) + rwa [Nat.sub_add_cancel (by omega)] at this + · have hall := validCAct_2; rw [List.all_eq_true] at hall + have := hall (s - 106) (List.mem_range.mpr (by omega)) + rwa [Nat.sub_add_cancel (by omega)] at this +theorem validFbAct_all : (List.range 27).all validFbAct = true := by decide +kernel +theorem validFbAct_of_lt {w : Nat} (h : w < 27) : validFbAct w = true := by + have hall := validFbAct_all + rw [List.all_eq_true] at hall + exact hall w (List.mem_range.mpr h) +inductive PdaCfg where + | cmode (n : Nat) (segs : List Nat) (s : Nat) + | fmode (n : Nat) (w : Nat) + deriving DecidableEq, Repr +def evalSegs : List Nat → List Bool + | [] => [true, true, false] + | seg :: rest => evalSegs rest ++ segBits seg +def wfSegs : List Nat → Prop + | [] => True + | seg :: rest => seg < 14 ∧ wfSegs rest +theorem wfSegs_valid {segs : List Nat} (h : wfSegs segs) : M23.ValidCPrefix (evalSegs segs) := by + induction segs with + | nil => exact M23.validCPrefix_base + | cons seg rest ih => + exact M23.validCPrefix_append (ih h.2) (validCSeg_of_lt h.1) +def wfCfg : PdaCfg → Prop + | .cmode _ segs _ => wfSegs segs + | .fmode _ _ => True +def toPair : PdaCfg → Nat × List Bool + | .cmode n segs s => (n, false :: (evalSegs segs ++ stateBits s)) + | .fmode n w => (n, fbBits w) +def applyCAct (n : Nat) (segs : List Nat) : CAct → Option PdaCfg + | .push seg s_rem => some (.cmode n (seg :: segs) s_rem) + | .mac k s_end => + if 2 ≤ n then sNat (n + 2 * k) fun n' => some (.cmode n' segs s_end) + else none + | .popExit pops w_exit => + match segs with + | [] => + match w_exit with + | some w => some (.fmode n w) + | none => none + | seg :: rest => + match lookupPop pops seg with + | some s_comb => some (.cmode n rest s_comb) + | none => none + | .none => none +def applyFbAct (n : Nat) : FbAct → Option PdaCfg + | .fb dn true s_out => + if 2 ≤ n then sNat (n + dn) fun n' => some (.cmode n' [] s_out) + else none + | .fb dn false w_out => + if 2 ≤ n then sNat (n + dn) fun n' => some (.fmode n' w_out) + else none + | .none => none +def pdaStep : PdaCfg → Option PdaCfg + | .cmode n segs s => + if s < 159 then applyCAct n segs (cActTable.get s .none) else none + | .fmode n w => + if w < 27 then applyFbAct n (fbActTable.get w .none) else none +theorem pdaStep_sound {c c' : PdaCfg} (hwf : wfCfg c) (h : pdaStep c = some c') : + wfCfg c' ∧ ∃ m, eqvC (run M m (ck (toPair c).1 (toPair c).2)) (ck (toPair c').1 (toPair c').2) := by + cases c with + | cmode n segs s => + simp only [pdaStep] at h + split at h + · rename_i hs + have hv := validCAct_of_lt hs + unfold validCAct at hv + generalize cActTable.get s .none = act at h hv + cases act with + | push seg s_rem => + simp only [applyCAct, checkCAct, Bool.and_eq_true, decide_eq_true_eq, eqLB_iff, Option.some.injEq] at hv h + subst h + refine ⟨⟨hv.1, hwf⟩, 0, ?_⟩ + simp only [toPair, evalSegs, List.append_assoc, ← hv.2, run] + exact eqvC_refl _ + | mac k s_end => + simp only [applyCAct, checkCAct, eqOptLB_iff] at hv h + split at h + · rename_i hn + rw [sNat_eq] at h + simp only [Option.some.injEq] at h + subst h + refine ⟨hwf, ?_⟩ + exact suffixIter_sound k (wfSegs_valid hwf) n hn hv + · cases h + | popExit pops w_exit => + simp only [applyCAct, checkCAct, Bool.and_eq_true] at hv h + cases segs with + | nil => + cases w_exit with + | none => cases h + | some w => + simp only [eqLB_iff, Option.some.injEq] at hv h + subst h + refine ⟨trivial, 0, ?_⟩ + simp only [toPair, evalSegs, hv.2, run] + exact eqvC_refl _ + | cons seg rest => + simp only at h + split at h + · rename_i s_comb hl + simp only [Option.some.injEq] at h + subst h + have heq := lookupPop_sound hv.1 hl + refine ⟨hwf.2, 0, ?_⟩ + simp only [toPair, evalSegs, List.append_assoc, heq, run] + exact eqvC_refl _ + · cases h + | none => cases h + · cases h + | fmode n w => + simp only [pdaStep] at h + split at h + · rename_i hw + have hv := validFbAct_of_lt hw + unfold validFbAct at hv + generalize fbActTable.get w .none = act at h hv + cases act with + | fb dn is_c out_id => + cases is_c + · simp only [applyFbAct, checkFbAct, eqOptPair_iff] at hv h + split at h + · rename_i hn + rw [sNat_eq] at h + simp only [Option.some.injEq] at h + subst h + refine ⟨trivial, ?_⟩ + have hsh := evStep_shift (n - 2) hv + rw [show 2 + (n - 2) = n by omega, show 2 + dn + (n - 2) = n + dn by omega] at hsh + exact evStep_sound hsh + · cases h + · simp only [applyFbAct, checkFbAct, eqOptPair_iff] at hv h + split at h + · rename_i hn + rw [sNat_eq] at h + simp only [Option.some.injEq] at h + subst h + refine ⟨trivial, ?_⟩ + have hsh := evStep_shift (n - 2) hv + rw [show 2 + (n - 2) = n by omega, show 2 + dn + (n - 2) = n + dn by omega] at hsh + exact evStep_sound hsh + · cases h + | none => cases h + · cases h +def pdaIter : Nat → PdaCfg → Option PdaCfg + | 0, c => some c + | k + 1, c => (pdaStep c).bind (pdaIter k) +theorem pdaIter_sound (k : Nat) : ∀ {c c' : PdaCfg}, wfCfg c → pdaIter k c = some c' → + ∃ m, eqvC (run M m (ck (toPair c).1 (toPair c).2)) (ck (toPair c').1 (toPair c').2) := by + induction k with + | zero => + intro c c' _ h + simp only [pdaIter, Option.some.injEq] at h + subst h + exact ⟨0, eqvC_refl _⟩ + | succ k ih => + intro c c' hwf h + simp only [pdaIter, Option.bind_eq_some_iff] at h + obtain ⟨c1, h1, h2⟩ := h + obtain ⟨hwf1, m1, e1⟩ := pdaStep_sound hwf h1 + obtain ⟨m2, e2⟩ := ih hwf1 h2 + exact ⟨m1 + m2, by rw [run_add]; exact eqvC_trans (run_eqvC M m2 e1) e2⟩ +def cp_0 : Nat × List Bool := (3, [false, false, true, true, false, true, true, true, false, true]) +def cp_15 : Nat × List Bool := (111101, [false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true]) +theorem pda_D_all : pdaIter 13274 (.fmode 3 0) = some (.cmode 111101 [] 158) := by + decide +kernel +theorem toPair_start_D : toPair (.fmode 3 0) = cp_0 := by decide +kernel +theorem toPair_end_D : toPair (.cmode 111101 [] 158) = cp_15 := by decide +kernel +theorem reach_D_all : ∃ m, eqvC (run M m (ck cp_0.1 cp_0.2)) (ck cp_15.1 cp_15.2) := by + have hwf : wfCfg (.fmode 3 0) := trivial + have h := pdaIter_sound 13274 hwf pda_D_all + rwa [toPair_start_D, toPair_end_D] at h +theorem rrun_U_1552 : rstep (rstep (rstep 1552 false) true) true = 1552 := by + decide +kernel +theorem rrun_pw_U (k : Nat) (R : List Bool) (hR : rrun R = 1552) : + rrun (M23.pw k M23.U ++ R) = 1552 := by + induction k with + | zero => exact hR + | succ k ih => + rw [M23.pw_succ] + change rstep (rstep (rstep (rrun (M23.pw k M23.U ++ R)) false) true) true = 1552 + rw [ih] + exact rrun_U_1552 +theorem rrun_base_8 : rrun (M23.pw 8 M23.U ++ cp_15.2) = 1552 := by + decide +kernel +theorem inMid_seed : inMid 0 2 false 1552 = true := by + decide +kernel +theorem Inv_ck_cp15 (k : Nat) : Inv (ck (k + 8) cp_15.2) := by + unfold Inv ck + simp only [lrun] + rw [M23.pw_add k 8 M23.U, List.append_assoc, rrun_pw_U k _ rrun_base_8] + exact inMid_seed +def mir (π : Nat → Nat) (c : Cfg) : Cfg := ⟨π c.q, c.R, c.h, c.L⟩ +def IsMirror (π : Nat → Nat) (M N : Machine) : Prop := + ∀ q h, N (π q) h = (M q h).map (fun t => (t.1, !t.2.1, π t.2.2)) +theorem step_mir {π : Nat → Nat} {M N : Machine} (hm : IsMirror π M N) (c : Cfg) : + step N (mir π c) = mir π (step M c) := by + obtain ⟨q, L, x, R⟩ := c + unfold step mir; simp only [hm q x] + cases hM : M q x with + | none => rfl + | some t => + obtain ⟨w, d, s⟩ := t + cases d <;> rfl +theorem run_mir {π : Nat → Nat} {M N : Machine} (hm : IsMirror π M N) (n : Nat) (c : Cfg) : + run N n (mir π c) = mir π (run M n c) := by + induction n generalizing c with + | zero => rfl + | succ n ih => simp only [run, step_mir hm, ih] +theorem halted_mir {π : Nat → Nat} {M N : Machine} (hm : IsMirror π M N) (c : Cfg) : + halted N (mir π c) ↔ halted M c := by + unfold halted mir; simp only [hm c.q c.h]; cases M c.q c.h <;> simp +def N : Machine + | 0, false => some (true, true, 1) + | 0, true => some (false, true, 0) + | 1, false => some (true, true, 2) + | 1, true => some (false, false, 4) + | 2, false => some (true, false, 3) + | 2, true => some (false, true, 0) + | 3, false => none + | 3, true => some (true, false, 4) + | 4, false => some (false, true, 4) + | 4, true => some (false, false, 5) + | 5, false => some (true, false, 1) + | 5, true => some (true, false, 2) + | _, _ => none +def piMN : Nat → Nat + | 0 => 5 | 1 => 1 | 2 => 2 | 3 => 0 | 4 => 3 | 5 => 4 | n => n +theorem N_mirror_M : IsMirror piMN M N := by + intro q h + rcases q with _ | _ | _ | _ | _ | _ | q <;> cases h <;> rfl +theorem N_run (n : Nat) : run N n (blank 0) = mir piMN (run M n (blank 3)) := + run_mir N_mirror_M n (blank 3) +theorem N_halted (c : Cfg) : halted N (mir piMN c) ↔ halted M c := halted_mir N_mirror_M c +theorem init_D_eqv : eqvC (run M 159 (blank 3)) (ck cp_0.1 cp_0.2) := by + exact ⟨by decide +kernel, by decide +kernel, by unfold eqv; decide +kernel, by unfold eqv; decide +kernel⟩ +theorem eqvC_symm {c d : Cfg} (h : eqvC c d) : eqvC d c := + ⟨h.1.symm, h.2.1.symm, h.2.2.1.symm, h.2.2.2.symm⟩ +theorem startD_inv : ∃ m, Inv (run M m (blank 3)) := by + obtain ⟨m, hm⟩ := reach_D_all + refine ⟨159 + m, ?_⟩ + rw [run_add] + have he := eqvC_trans (run_eqvC M m init_D_eqv) hm + exact Inv_of_eqvC (eqvC_symm he) (Inv_ck_cp15 111093) +theorem nonhalt_D : ∀ n, ¬ halted M (run M n (blank 3)) := + nonhalt_of_start startD_inv +theorem nonhalt_N : ∀ n, ¬ halted N (run N n (blank 0)) := by + intro n; rw [N_run, N_halted]; exact nonhalt_D n +end Cert + + +@[simp] private theorem _jb_lb_mk_nil : (ListBlank.mk ([] : List (Fin 2))) = default := rfl +@[simp] private theorem _jb_lb_mk_cons (x : Fin 2) (xs : List (Fin 2)) : ListBlank.mk (x :: xs) = x >> ListBlank.mk xs := rfl + +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +@[reducible] def M : Machine (Fin 2) (Fin 6) := target_tm +@[reducible] def holdout_0441_tm : Machine (Fin 2) (Fin 6) := target_tm +set_option maxRecDepth 200000 +set_option maxHeartbeats 4000000 +def b2f : Bool → Fin 2 + | false => 0 + | true => 1 +def toLB : List Bool → ListBlank (Fin 2) + | [] => default + | b :: xs => ListBlank.cons (b2f b) (toLB xs) +theorem toLB_head (L : List Bool) : (toLB L).head = b2f (L.headD false) := by + cases L with + | nil => rfl + | cons b xs => simp [toLB] +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl +theorem toLB_tail (L : List Bool) : (toLB L).tail = toLB L.tail := by + cases L with + | nil => rfl + | cons b xs => simp [toLB] +def toBBCfg (c : Cert.Cfg) (hq : c.q < 6) : Cfg (Fin 2) (Fin 6) := + ⟨some ⟨c.q, hq⟩, ⟨b2f c.h, toLB c.L, toLB c.R⟩⟩ +theorem step_bridge (c : Cert.Cfg) (hq : c.q < 6) (hnh : ¬ Cert.halted Cert.N c) : + ∃ (hq' : (Cert.step Cert.N c).q < 6), + step holdout_0441_tm (toBBCfg c hq) = some (toBBCfg (Cert.step Cert.N c) hq') := by + obtain ⟨q, L, h, R⟩ := c + rcases q with _ | _ | _ | _ | _ | _ | q + · cases h <;> exact ⟨by simp [Cert.step, Cert.N]; try decide, by simp [toBBCfg, Cert.step, Cert.N, step, holdout_0441_tm, target_tm, Tape.write, Tape.move, toLB, toLB_head, toLB_tail, b2f]⟩ + · cases h <;> exact ⟨by simp [Cert.step, Cert.N]; try decide, by simp [toBBCfg, Cert.step, Cert.N, step, holdout_0441_tm, target_tm, Tape.write, Tape.move, toLB, toLB_head, toLB_tail, b2f]⟩ + · cases h <;> exact ⟨by simp [Cert.step, Cert.N]; try decide, by simp [toBBCfg, Cert.step, Cert.N, step, holdout_0441_tm, target_tm, Tape.write, Tape.move, toLB, toLB_head, toLB_tail, b2f]⟩ + · cases h + · exact False.elim (hnh rfl) + · exact ⟨by simp [Cert.step, Cert.N]; try decide, by simp [toBBCfg, Cert.step, Cert.N, step, holdout_0441_tm, target_tm, Tape.write, Tape.move, toLB, toLB_head, toLB_tail, b2f]⟩ + · cases h <;> exact ⟨by simp [Cert.step, Cert.N]; try decide, by simp [toBBCfg, Cert.step, Cert.N, step, holdout_0441_tm, target_tm, Tape.write, Tape.move, toLB, toLB_head, toLB_tail, b2f]⟩ + · cases h <;> exact ⟨by simp [Cert.step, Cert.N]; try decide, by simp [toBBCfg, Cert.step, Cert.N, step, holdout_0441_tm, target_tm, Tape.write, Tape.move, toLB, toLB_head, toLB_tail, b2f]⟩ + · change q + 6 < 6 at hq; omega +theorem multiStep_bridge (n : Nat) : + ∃ (hq : (Cert.run Cert.N n (Cert.blank 0)).q < 6), + multiStep holdout_0441_tm (init []) n = some (toBBCfg (Cert.run Cert.N n (Cert.blank 0)) hq) := by + induction n with + | zero => exact ⟨by decide, rfl⟩ + | succ n ih => + obtain ⟨hq, hn⟩ := ih + obtain ⟨hq', hst⟩ := step_bridge (Cert.run Cert.N n (Cert.blank 0)) hq (Cert.nonhalt_N n) + rw [show Cert.run Cert.N (n + 1) (Cert.blank 0) = Cert.step Cert.N (Cert.run Cert.N n (Cert.blank 0)) from by rw [Cert.run_add]; rfl] + refine ⟨hq', ?_⟩ + rw [multiStep_succ', hn, Option.bind_some, hst] + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg ⟨n, hn⟩ + obtain ⟨hq, hms⟩ := multiStep_bridge n + rw [hms, Option.some.injEq] at hn + subst hn + obtain ⟨hq', hst⟩ := step_bridge (Cert.run Cert.N n (Cert.blank 0)) hq (Cert.nonhalt_N n) + rw [hst] + rfl + +public section + +theorem is_not_halt : IsNotHalt target := by rw [target_eq]; exact is_does_not_halt + +end + +end BusyBeaver.M_1RB0RA_1RC0LE_1LD0RA_HHH1LE_0RE0LF_1LB1LC diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RA_1RC0RC_1LD0LE_1RA1LC_1LC1LF_0LCHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1RC0RC_1LD0LE_1RA1LC_1LC1LF_0LCHHH.lean new file mode 100644 index 00000000..14764f66 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1RC0RC_1LD0LE_1RA1LC_1LC1LF_0LCHHH.lean @@ -0,0 +1,1597 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusF +public import BusyBeaver.Calculi.WordCalculusG +public import BusyBeaver.Calculi.WordCalculusH + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RA_1RC0RC_1LD0LE_1RA1LC_1LC1LF_0LCHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1RC0RC_1LD0LE_1RA1LC_1LC1LF_0LCHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 4 +abbrev E : Fin 6 := 3 +abbrev F : Fin 6 := 5 +@[reducible] def tm : Machine (Fin 2) (Fin 6) := target_tm +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 8000000 + +open WordVKQ Word + +abbrev evalCCfgVKQ (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev z0b (c : CCfg) : Option CCfg := Counter.bstep tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (evalCCfgVKQ c1) [tm]⊢⁺ (evalCCfgVKQ c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ + +set_option maxRecDepth 200000 +set_option exponentiation.threshold 2048 +abbrev pref_cap : BitWord := [1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0] + + +def zCs : Call -> Fin 6 + | .ch => E + | .ca => C + +def zCR (w : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (w <{{zCs c}} ([1] +> r)) + +def zCL (w : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> w) {{A}}> r) + +def zCf (w : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> pref_cap +> w) {{A}}> default) +abbrev callStep (c : Call) (w1 w2 : HalfTape) : Prop := + ∀ r, (zCR w1 c r) [tm]⊢⁺ (zCL w2 r) + +abbrev Side := SideP callStep +abbrev Seg := SegP callStep + +theorem seg_ch_V : Seg [.ch] [.ch, .ch] V_u V_u := + segP_of_step_two (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (fun u r => by unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_V : Seg [.ca] [.ch] V_u Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Vp : Seg [.ca] [.ca, .ca] Vp Vp := + segP_of_step_two (mid1 := [0, 1, 1, 1]) (mid2 := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_K : Seg [.ch] [] K_u Q_u := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs K_u Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_Q : Seg [.ch] [.ch] Q_u K_u := + segP_of_step_one (mid := [1, 1]) + (fun u r => by unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL K_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_VpQ : Seg [.ca] [.ca] (Vp ++ Q_u) (Kp ++ Vp) := + segP_of_step_one (mid := [0, 1, 0, 1, 1, 1]) + (fun u r => by unfold zCR zCs Vp Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_KpVp : Seg [.ca] [] (Kp ++ Vp) (Qp ++ Vp) := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs Kp Vp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_QpVp : Seg [.ca] [.ca, .ca] (Qp ++ Vp) (Kp ++ Vp) := + segP_of_step_two (mid1 := [0, 1, 1, 1, 1, 1]) (mid2 := [0, 1, 0, 1, 1, 1]) + (fun u r => by unfold zCR zCs Qp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Kp : Seg [.ca] [] Kp Qp := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs Kp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Qp : Seg [.ca] [.ca] Qp Kp := + segP_of_step_one (mid := [1, 1]) + (fun u r => by unfold zCR zCs Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_KQ : Seg [.ca] [] (K_u ++ Q_u) Vp := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs K_u Q_u Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_QQ : Seg [.ca] [.ca] (Q_u ++ Q_u) Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + + +-- Turnaround zP0..zP126 +abbrev tr1 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr2 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr3 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr4 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr5 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr6 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr7 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr8 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr9 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr10 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr11 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr12 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr13 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr14 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr15 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr16 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr17 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr18 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr19 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr20 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr21 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr22 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr23 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr24 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr25 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr26 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr27 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr28 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr29 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr30 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr31 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr32 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1] +abbrev tr33 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr34 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr35 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr36 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr37 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr38 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr39 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr40 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr41 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr42 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr43 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr44 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr45 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr46 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr47 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr48 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr49 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr50 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr51 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr52 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr53 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr54 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr55 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr56 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr57 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr58 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr59 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr60 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr61 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr62 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr63 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr64 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr65 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr66 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr67 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr68 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr69 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr70 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr71 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr72 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr73 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr74 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr75 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr76 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr77 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr78 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr79 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr80 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr81 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,1,0,1] +abbrev tr82 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,1,0,1] +abbrev tr83 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,1,0,1] +abbrev tr84 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,1,0,1] +abbrev tr85 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,1,0,1] +abbrev tr86 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,1,0,1] +abbrev tr87 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,1,0,1] +abbrev tr88 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,1,0,1] +abbrev tr89 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,1,0,1] +abbrev tr90 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,1,0,1] +abbrev tr91 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,1,0,1] +abbrev tr92 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,1,0,1] +abbrev tr93 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,1,0,1] +abbrev tr94 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,1,0,1] +abbrev tr95 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,1,0,1] +abbrev tr96 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,1,0,1] +abbrev tr97 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1] +abbrev tr98 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1] +abbrev tr99 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1] +abbrev tr100 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1] +abbrev tr101 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1] +abbrev tr102 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1] +abbrev tr103 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1] +abbrev tr104 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1] +abbrev tr105 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,1,0,1,0,1,0,1] +abbrev tr106 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,1,0,1,0,1,0,1] +abbrev tr107 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,1,0,1,0,1,0,1] +abbrev tr108 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,1,0,1,0,1,0,1] +abbrev tr109 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,1,0,1,0,1,0,1] +abbrev tr110 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,1,0,1,0,1,0,1] +abbrev tr111 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,1,0,1,0,1,0,1] +abbrev tr112 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,1,0,1,0,1,0,1] +abbrev tr113 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1] +abbrev tr114 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1] +abbrev tr115 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1] +abbrev tr116 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1] +abbrev tr117 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1] +abbrev tr118 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1] +abbrev tr119 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1] +abbrev tr120 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1] +abbrev tr121 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1] +abbrev tr122 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1] +abbrev tr123 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1] +abbrev tr124 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1] +abbrev tr125 : BitWord := [0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1] +abbrev tr126 : BitWord := [0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1] + +theorem zP0 (w : HalfTape) : (zCf w) [tm]⊢⁺ (zCR w .ca (tr1 +> default)) := by + unfold zCf zCR zCs pref_cap tr1 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP1 (w : HalfTape) : (zCL w (tr1 +> default)) [tm]⊢⁺ (zCR w .ca (tr2 +> default)) := by + unfold zCL zCR zCs tr1 tr2 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP2 (w : HalfTape) : (zCL w (tr2 +> default)) [tm]⊢⁺ (zCR w .ca (tr3 +> default)) := by + unfold zCL zCR zCs tr2 tr3 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP3 (w : HalfTape) : (zCL w (tr3 +> default)) [tm]⊢⁺ (zCR w .ca (tr4 +> default)) := by + unfold zCL zCR zCs tr3 tr4 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP4 (w : HalfTape) : (zCL w (tr4 +> default)) [tm]⊢⁺ (zCR w .ca (tr5 +> default)) := by + unfold zCL zCR zCs tr4 tr5 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP5 (w : HalfTape) : (zCL w (tr5 +> default)) [tm]⊢⁺ (zCR w .ca (tr6 +> default)) := by + unfold zCL zCR zCs tr5 tr6 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP6 (w : HalfTape) : (zCL w (tr6 +> default)) [tm]⊢⁺ (zCR w .ca (tr7 +> default)) := by + unfold zCL zCR zCs tr6 tr7 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP7 (w : HalfTape) : (zCL w (tr7 +> default)) [tm]⊢⁺ (zCR w .ca (tr8 +> default)) := by + unfold zCL zCR zCs tr7 tr8 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP8 (w : HalfTape) : (zCL w (tr8 +> default)) [tm]⊢⁺ (zCR w .ca (tr9 +> default)) := by + unfold zCL zCR zCs tr8 tr9 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP9 (w : HalfTape) : (zCL w (tr9 +> default)) [tm]⊢⁺ (zCR w .ca (tr10 +> default)) := by + unfold zCL zCR zCs tr9 tr10 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP10 (w : HalfTape) : (zCL w (tr10 +> default)) [tm]⊢⁺ (zCR w .ca (tr11 +> default)) := by + unfold zCL zCR zCs tr10 tr11 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP11 (w : HalfTape) : (zCL w (tr11 +> default)) [tm]⊢⁺ (zCR w .ca (tr12 +> default)) := by + unfold zCL zCR zCs tr11 tr12 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP12 (w : HalfTape) : (zCL w (tr12 +> default)) [tm]⊢⁺ (zCR w .ca (tr13 +> default)) := by + unfold zCL zCR zCs tr12 tr13 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP13 (w : HalfTape) : (zCL w (tr13 +> default)) [tm]⊢⁺ (zCR w .ca (tr14 +> default)) := by + unfold zCL zCR zCs tr13 tr14 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP14 (w : HalfTape) : (zCL w (tr14 +> default)) [tm]⊢⁺ (zCR w .ca (tr15 +> default)) := by + unfold zCL zCR zCs tr14 tr15 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP15 (w : HalfTape) : (zCL w (tr15 +> default)) [tm]⊢⁺ (zCR w .ca (tr16 +> default)) := by + unfold zCL zCR zCs tr15 tr16 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP16 (w : HalfTape) : (zCL w (tr16 +> default)) [tm]⊢⁺ (zCR w .ca (tr17 +> default)) := by + unfold zCL zCR zCs tr16 tr17 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP17 (w : HalfTape) : (zCL w (tr17 +> default)) [tm]⊢⁺ (zCR w .ca (tr18 +> default)) := by + unfold zCL zCR zCs tr17 tr18 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP18 (w : HalfTape) : (zCL w (tr18 +> default)) [tm]⊢⁺ (zCR w .ca (tr19 +> default)) := by + unfold zCL zCR zCs tr18 tr19 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP19 (w : HalfTape) : (zCL w (tr19 +> default)) [tm]⊢⁺ (zCR w .ca (tr20 +> default)) := by + unfold zCL zCR zCs tr19 tr20 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP20 (w : HalfTape) : (zCL w (tr20 +> default)) [tm]⊢⁺ (zCR w .ca (tr21 +> default)) := by + unfold zCL zCR zCs tr20 tr21 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP21 (w : HalfTape) : (zCL w (tr21 +> default)) [tm]⊢⁺ (zCR w .ca (tr22 +> default)) := by + unfold zCL zCR zCs tr21 tr22 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP22 (w : HalfTape) : (zCL w (tr22 +> default)) [tm]⊢⁺ (zCR w .ca (tr23 +> default)) := by + unfold zCL zCR zCs tr22 tr23 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP23 (w : HalfTape) : (zCL w (tr23 +> default)) [tm]⊢⁺ (zCR w .ca (tr24 +> default)) := by + unfold zCL zCR zCs tr23 tr24 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP24 (w : HalfTape) : (zCL w (tr24 +> default)) [tm]⊢⁺ (zCR w .ca (tr25 +> default)) := by + unfold zCL zCR zCs tr24 tr25 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP25 (w : HalfTape) : (zCL w (tr25 +> default)) [tm]⊢⁺ (zCR w .ca (tr26 +> default)) := by + unfold zCL zCR zCs tr25 tr26 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP26 (w : HalfTape) : (zCL w (tr26 +> default)) [tm]⊢⁺ (zCR w .ca (tr27 +> default)) := by + unfold zCL zCR zCs tr26 tr27 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP27 (w : HalfTape) : (zCL w (tr27 +> default)) [tm]⊢⁺ (zCR w .ca (tr28 +> default)) := by + unfold zCL zCR zCs tr27 tr28 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP28 (w : HalfTape) : (zCL w (tr28 +> default)) [tm]⊢⁺ (zCR w .ca (tr29 +> default)) := by + unfold zCL zCR zCs tr28 tr29 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP29 (w : HalfTape) : (zCL w (tr29 +> default)) [tm]⊢⁺ (zCR w .ca (tr30 +> default)) := by + unfold zCL zCR zCs tr29 tr30 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP30 (w : HalfTape) : (zCL w (tr30 +> default)) [tm]⊢⁺ (zCR w .ca (tr31 +> default)) := by + unfold zCL zCR zCs tr30 tr31 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP31 (w : HalfTape) : (zCL w (tr31 +> default)) [tm]⊢⁺ (zCR w .ca (tr32 +> default)) := by + unfold zCL zCR zCs tr31 tr32 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP32 (w : HalfTape) : (zCL w (tr32 +> default)) [tm]⊢⁺ (zCR w .ca (tr33 +> default)) := by + unfold zCL zCR zCs tr32 tr33 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP33 (w : HalfTape) : (zCL w (tr33 +> default)) [tm]⊢⁺ (zCR w .ca (tr34 +> default)) := by + unfold zCL zCR zCs tr33 tr34 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP34 (w : HalfTape) : (zCL w (tr34 +> default)) [tm]⊢⁺ (zCR w .ca (tr35 +> default)) := by + unfold zCL zCR zCs tr34 tr35 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP35 (w : HalfTape) : (zCL w (tr35 +> default)) [tm]⊢⁺ (zCR w .ca (tr36 +> default)) := by + unfold zCL zCR zCs tr35 tr36 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP36 (w : HalfTape) : (zCL w (tr36 +> default)) [tm]⊢⁺ (zCR w .ca (tr37 +> default)) := by + unfold zCL zCR zCs tr36 tr37 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP37 (w : HalfTape) : (zCL w (tr37 +> default)) [tm]⊢⁺ (zCR w .ca (tr38 +> default)) := by + unfold zCL zCR zCs tr37 tr38 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP38 (w : HalfTape) : (zCL w (tr38 +> default)) [tm]⊢⁺ (zCR w .ca (tr39 +> default)) := by + unfold zCL zCR zCs tr38 tr39 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP39 (w : HalfTape) : (zCL w (tr39 +> default)) [tm]⊢⁺ (zCR w .ca (tr40 +> default)) := by + unfold zCL zCR zCs tr39 tr40 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP40 (w : HalfTape) : (zCL w (tr40 +> default)) [tm]⊢⁺ (zCR w .ca (tr41 +> default)) := by + unfold zCL zCR zCs tr40 tr41 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP41 (w : HalfTape) : (zCL w (tr41 +> default)) [tm]⊢⁺ (zCR w .ca (tr42 +> default)) := by + unfold zCL zCR zCs tr41 tr42 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP42 (w : HalfTape) : (zCL w (tr42 +> default)) [tm]⊢⁺ (zCR w .ca (tr43 +> default)) := by + unfold zCL zCR zCs tr42 tr43 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP43 (w : HalfTape) : (zCL w (tr43 +> default)) [tm]⊢⁺ (zCR w .ca (tr44 +> default)) := by + unfold zCL zCR zCs tr43 tr44 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP44 (w : HalfTape) : (zCL w (tr44 +> default)) [tm]⊢⁺ (zCR w .ca (tr45 +> default)) := by + unfold zCL zCR zCs tr44 tr45 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP45 (w : HalfTape) : (zCL w (tr45 +> default)) [tm]⊢⁺ (zCR w .ca (tr46 +> default)) := by + unfold zCL zCR zCs tr45 tr46 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP46 (w : HalfTape) : (zCL w (tr46 +> default)) [tm]⊢⁺ (zCR w .ca (tr47 +> default)) := by + unfold zCL zCR zCs tr46 tr47 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP47 (w : HalfTape) : (zCL w (tr47 +> default)) [tm]⊢⁺ (zCR w .ca (tr48 +> default)) := by + unfold zCL zCR zCs tr47 tr48 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP48 (w : HalfTape) : (zCL w (tr48 +> default)) [tm]⊢⁺ (zCR w .ca (tr49 +> default)) := by + unfold zCL zCR zCs tr48 tr49 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP49 (w : HalfTape) : (zCL w (tr49 +> default)) [tm]⊢⁺ (zCR w .ca (tr50 +> default)) := by + unfold zCL zCR zCs tr49 tr50 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP50 (w : HalfTape) : (zCL w (tr50 +> default)) [tm]⊢⁺ (zCR w .ca (tr51 +> default)) := by + unfold zCL zCR zCs tr50 tr51 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP51 (w : HalfTape) : (zCL w (tr51 +> default)) [tm]⊢⁺ (zCR w .ca (tr52 +> default)) := by + unfold zCL zCR zCs tr51 tr52 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP52 (w : HalfTape) : (zCL w (tr52 +> default)) [tm]⊢⁺ (zCR w .ca (tr53 +> default)) := by + unfold zCL zCR zCs tr52 tr53 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP53 (w : HalfTape) : (zCL w (tr53 +> default)) [tm]⊢⁺ (zCR w .ca (tr54 +> default)) := by + unfold zCL zCR zCs tr53 tr54 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP54 (w : HalfTape) : (zCL w (tr54 +> default)) [tm]⊢⁺ (zCR w .ca (tr55 +> default)) := by + unfold zCL zCR zCs tr54 tr55 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP55 (w : HalfTape) : (zCL w (tr55 +> default)) [tm]⊢⁺ (zCR w .ca (tr56 +> default)) := by + unfold zCL zCR zCs tr55 tr56 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP56 (w : HalfTape) : (zCL w (tr56 +> default)) [tm]⊢⁺ (zCR w .ca (tr57 +> default)) := by + unfold zCL zCR zCs tr56 tr57 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP57 (w : HalfTape) : (zCL w (tr57 +> default)) [tm]⊢⁺ (zCR w .ca (tr58 +> default)) := by + unfold zCL zCR zCs tr57 tr58 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP58 (w : HalfTape) : (zCL w (tr58 +> default)) [tm]⊢⁺ (zCR w .ca (tr59 +> default)) := by + unfold zCL zCR zCs tr58 tr59 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP59 (w : HalfTape) : (zCL w (tr59 +> default)) [tm]⊢⁺ (zCR w .ca (tr60 +> default)) := by + unfold zCL zCR zCs tr59 tr60 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP60 (w : HalfTape) : (zCL w (tr60 +> default)) [tm]⊢⁺ (zCR w .ca (tr61 +> default)) := by + unfold zCL zCR zCs tr60 tr61 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP61 (w : HalfTape) : (zCL w (tr61 +> default)) [tm]⊢⁺ (zCR w .ca (tr62 +> default)) := by + unfold zCL zCR zCs tr61 tr62 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP62 (w : HalfTape) : (zCL w (tr62 +> default)) [tm]⊢⁺ (zCR w .ca (tr63 +> default)) := by + unfold zCL zCR zCs tr62 tr63 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP63 (w : HalfTape) : (zCL w (tr63 +> default)) [tm]⊢⁺ (zCR w .ca (tr64 +> default)) := by + unfold zCL zCR zCs tr63 tr64 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP64 (w : HalfTape) : (zCL w (tr64 +> default)) [tm]⊢⁺ (zCR w .ca (tr65 +> default)) := by + unfold zCL zCR zCs tr64 tr65 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP65 (w : HalfTape) : (zCL w (tr65 +> default)) [tm]⊢⁺ (zCR w .ca (tr66 +> default)) := by + unfold zCL zCR zCs tr65 tr66 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP66 (w : HalfTape) : (zCL w (tr66 +> default)) [tm]⊢⁺ (zCR w .ca (tr67 +> default)) := by + unfold zCL zCR zCs tr66 tr67 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP67 (w : HalfTape) : (zCL w (tr67 +> default)) [tm]⊢⁺ (zCR w .ca (tr68 +> default)) := by + unfold zCL zCR zCs tr67 tr68 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP68 (w : HalfTape) : (zCL w (tr68 +> default)) [tm]⊢⁺ (zCR w .ca (tr69 +> default)) := by + unfold zCL zCR zCs tr68 tr69 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP69 (w : HalfTape) : (zCL w (tr69 +> default)) [tm]⊢⁺ (zCR w .ca (tr70 +> default)) := by + unfold zCL zCR zCs tr69 tr70 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP70 (w : HalfTape) : (zCL w (tr70 +> default)) [tm]⊢⁺ (zCR w .ca (tr71 +> default)) := by + unfold zCL zCR zCs tr70 tr71 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP71 (w : HalfTape) : (zCL w (tr71 +> default)) [tm]⊢⁺ (zCR w .ca (tr72 +> default)) := by + unfold zCL zCR zCs tr71 tr72 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP72 (w : HalfTape) : (zCL w (tr72 +> default)) [tm]⊢⁺ (zCR w .ca (tr73 +> default)) := by + unfold zCL zCR zCs tr72 tr73 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP73 (w : HalfTape) : (zCL w (tr73 +> default)) [tm]⊢⁺ (zCR w .ca (tr74 +> default)) := by + unfold zCL zCR zCs tr73 tr74 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP74 (w : HalfTape) : (zCL w (tr74 +> default)) [tm]⊢⁺ (zCR w .ca (tr75 +> default)) := by + unfold zCL zCR zCs tr74 tr75 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP75 (w : HalfTape) : (zCL w (tr75 +> default)) [tm]⊢⁺ (zCR w .ca (tr76 +> default)) := by + unfold zCL zCR zCs tr75 tr76 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP76 (w : HalfTape) : (zCL w (tr76 +> default)) [tm]⊢⁺ (zCR w .ca (tr77 +> default)) := by + unfold zCL zCR zCs tr76 tr77 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP77 (w : HalfTape) : (zCL w (tr77 +> default)) [tm]⊢⁺ (zCR w .ca (tr78 +> default)) := by + unfold zCL zCR zCs tr77 tr78 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP78 (w : HalfTape) : (zCL w (tr78 +> default)) [tm]⊢⁺ (zCR w .ca (tr79 +> default)) := by + unfold zCL zCR zCs tr78 tr79 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP79 (w : HalfTape) : (zCL w (tr79 +> default)) [tm]⊢⁺ (zCR w .ca (tr80 +> default)) := by + unfold zCL zCR zCs tr79 tr80 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP80 (w : HalfTape) : (zCL w (tr80 +> default)) [tm]⊢⁺ (zCR w .ca (tr81 +> default)) := by + unfold zCL zCR zCs tr80 tr81 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP81 (w : HalfTape) : (zCL w (tr81 +> default)) [tm]⊢⁺ (zCR w .ca (tr82 +> default)) := by + unfold zCL zCR zCs tr81 tr82 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP82 (w : HalfTape) : (zCL w (tr82 +> default)) [tm]⊢⁺ (zCR w .ca (tr83 +> default)) := by + unfold zCL zCR zCs tr82 tr83 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP83 (w : HalfTape) : (zCL w (tr83 +> default)) [tm]⊢⁺ (zCR w .ca (tr84 +> default)) := by + unfold zCL zCR zCs tr83 tr84 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP84 (w : HalfTape) : (zCL w (tr84 +> default)) [tm]⊢⁺ (zCR w .ca (tr85 +> default)) := by + unfold zCL zCR zCs tr84 tr85 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP85 (w : HalfTape) : (zCL w (tr85 +> default)) [tm]⊢⁺ (zCR w .ca (tr86 +> default)) := by + unfold zCL zCR zCs tr85 tr86 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP86 (w : HalfTape) : (zCL w (tr86 +> default)) [tm]⊢⁺ (zCR w .ca (tr87 +> default)) := by + unfold zCL zCR zCs tr86 tr87 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP87 (w : HalfTape) : (zCL w (tr87 +> default)) [tm]⊢⁺ (zCR w .ca (tr88 +> default)) := by + unfold zCL zCR zCs tr87 tr88 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP88 (w : HalfTape) : (zCL w (tr88 +> default)) [tm]⊢⁺ (zCR w .ca (tr89 +> default)) := by + unfold zCL zCR zCs tr88 tr89 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP89 (w : HalfTape) : (zCL w (tr89 +> default)) [tm]⊢⁺ (zCR w .ca (tr90 +> default)) := by + unfold zCL zCR zCs tr89 tr90 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP90 (w : HalfTape) : (zCL w (tr90 +> default)) [tm]⊢⁺ (zCR w .ca (tr91 +> default)) := by + unfold zCL zCR zCs tr90 tr91 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP91 (w : HalfTape) : (zCL w (tr91 +> default)) [tm]⊢⁺ (zCR w .ca (tr92 +> default)) := by + unfold zCL zCR zCs tr91 tr92 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP92 (w : HalfTape) : (zCL w (tr92 +> default)) [tm]⊢⁺ (zCR w .ca (tr93 +> default)) := by + unfold zCL zCR zCs tr92 tr93 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP93 (w : HalfTape) : (zCL w (tr93 +> default)) [tm]⊢⁺ (zCR w .ca (tr94 +> default)) := by + unfold zCL zCR zCs tr93 tr94 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP94 (w : HalfTape) : (zCL w (tr94 +> default)) [tm]⊢⁺ (zCR w .ca (tr95 +> default)) := by + unfold zCL zCR zCs tr94 tr95 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP95 (w : HalfTape) : (zCL w (tr95 +> default)) [tm]⊢⁺ (zCR w .ca (tr96 +> default)) := by + unfold zCL zCR zCs tr95 tr96 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP96 (w : HalfTape) : (zCL w (tr96 +> default)) [tm]⊢⁺ (zCR w .ca (tr97 +> default)) := by + unfold zCL zCR zCs tr96 tr97 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP97 (w : HalfTape) : (zCL w (tr97 +> default)) [tm]⊢⁺ (zCR w .ca (tr98 +> default)) := by + unfold zCL zCR zCs tr97 tr98 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP98 (w : HalfTape) : (zCL w (tr98 +> default)) [tm]⊢⁺ (zCR w .ca (tr99 +> default)) := by + unfold zCL zCR zCs tr98 tr99 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP99 (w : HalfTape) : (zCL w (tr99 +> default)) [tm]⊢⁺ (zCR w .ca (tr100 +> default)) := by + unfold zCL zCR zCs tr99 tr100 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP100 (w : HalfTape) : (zCL w (tr100 +> default)) [tm]⊢⁺ (zCR w .ca (tr101 +> default)) := by + unfold zCL zCR zCs tr100 tr101 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP101 (w : HalfTape) : (zCL w (tr101 +> default)) [tm]⊢⁺ (zCR w .ca (tr102 +> default)) := by + unfold zCL zCR zCs tr101 tr102 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP102 (w : HalfTape) : (zCL w (tr102 +> default)) [tm]⊢⁺ (zCR w .ca (tr103 +> default)) := by + unfold zCL zCR zCs tr102 tr103 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP103 (w : HalfTape) : (zCL w (tr103 +> default)) [tm]⊢⁺ (zCR w .ca (tr104 +> default)) := by + unfold zCL zCR zCs tr103 tr104 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP104 (w : HalfTape) : (zCL w (tr104 +> default)) [tm]⊢⁺ (zCR w .ca (tr105 +> default)) := by + unfold zCL zCR zCs tr104 tr105 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP105 (w : HalfTape) : (zCL w (tr105 +> default)) [tm]⊢⁺ (zCR w .ca (tr106 +> default)) := by + unfold zCL zCR zCs tr105 tr106 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP106 (w : HalfTape) : (zCL w (tr106 +> default)) [tm]⊢⁺ (zCR w .ca (tr107 +> default)) := by + unfold zCL zCR zCs tr106 tr107 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP107 (w : HalfTape) : (zCL w (tr107 +> default)) [tm]⊢⁺ (zCR w .ca (tr108 +> default)) := by + unfold zCL zCR zCs tr107 tr108 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP108 (w : HalfTape) : (zCL w (tr108 +> default)) [tm]⊢⁺ (zCR w .ca (tr109 +> default)) := by + unfold zCL zCR zCs tr108 tr109 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP109 (w : HalfTape) : (zCL w (tr109 +> default)) [tm]⊢⁺ (zCR w .ca (tr110 +> default)) := by + unfold zCL zCR zCs tr109 tr110 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP110 (w : HalfTape) : (zCL w (tr110 +> default)) [tm]⊢⁺ (zCR w .ca (tr111 +> default)) := by + unfold zCL zCR zCs tr110 tr111 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP111 (w : HalfTape) : (zCL w (tr111 +> default)) [tm]⊢⁺ (zCR w .ca (tr112 +> default)) := by + unfold zCL zCR zCs tr111 tr112 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP112 (w : HalfTape) : (zCL w (tr112 +> default)) [tm]⊢⁺ (zCR w .ca (tr113 +> default)) := by + unfold zCL zCR zCs tr112 tr113 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP113 (w : HalfTape) : (zCL w (tr113 +> default)) [tm]⊢⁺ (zCR w .ca (tr114 +> default)) := by + unfold zCL zCR zCs tr113 tr114 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP114 (w : HalfTape) : (zCL w (tr114 +> default)) [tm]⊢⁺ (zCR w .ca (tr115 +> default)) := by + unfold zCL zCR zCs tr114 tr115 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP115 (w : HalfTape) : (zCL w (tr115 +> default)) [tm]⊢⁺ (zCR w .ca (tr116 +> default)) := by + unfold zCL zCR zCs tr115 tr116 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP116 (w : HalfTape) : (zCL w (tr116 +> default)) [tm]⊢⁺ (zCR w .ca (tr117 +> default)) := by + unfold zCL zCR zCs tr116 tr117 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP117 (w : HalfTape) : (zCL w (tr117 +> default)) [tm]⊢⁺ (zCR w .ca (tr118 +> default)) := by + unfold zCL zCR zCs tr117 tr118 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP118 (w : HalfTape) : (zCL w (tr118 +> default)) [tm]⊢⁺ (zCR w .ca (tr119 +> default)) := by + unfold zCL zCR zCs tr118 tr119 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP119 (w : HalfTape) : (zCL w (tr119 +> default)) [tm]⊢⁺ (zCR w .ca (tr120 +> default)) := by + unfold zCL zCR zCs tr119 tr120 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP120 (w : HalfTape) : (zCL w (tr120 +> default)) [tm]⊢⁺ (zCR w .ca (tr121 +> default)) := by + unfold zCL zCR zCs tr120 tr121 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP121 (w : HalfTape) : (zCL w (tr121 +> default)) [tm]⊢⁺ (zCR w .ca (tr122 +> default)) := by + unfold zCL zCR zCs tr121 tr122 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP122 (w : HalfTape) : (zCL w (tr122 +> default)) [tm]⊢⁺ (zCR w .ca (tr123 +> default)) := by + unfold zCL zCR zCs tr122 tr123 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP123 (w : HalfTape) : (zCL w (tr123 +> default)) [tm]⊢⁺ (zCR w .ca (tr124 +> default)) := by + unfold zCL zCR zCs tr123 tr124 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP124 (w : HalfTape) : (zCL w (tr124 +> default)) [tm]⊢⁺ (zCR w .ca (tr125 +> default)) := by + unfold zCL zCR zCs tr124 tr125 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP125 (w : HalfTape) : (zCL w (tr125 +> default)) [tm]⊢⁺ (zCR w .ca (tr126 +> default)) := by + unfold zCL zCR zCs tr125 tr126 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP126 (w : HalfTape) : (zCL w (tr126 +> default)) [tm]⊢⁺ (zCf ([1, 1, 0] +> w)) := by + unfold zCL zCf tr126 pref_cap + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +-- Section 2: Words, Shift Identity, DigitVal, Parse, Scan, Step +theorem segSpec : SegSpec callStep := + ⟨seg_ch_V, seg_ca_V, seg_ca_Vp, seg_ch_K, seg_ch_Q, + seg_ca_VpQ, seg_ca_KpVp, seg_ca_QpVp, seg_ca_Kp, seg_ca_Qp, + seg_ca_KQ, seg_ca_QQ⟩ + +abbrev Step := StepB 126 +abbrev Rounds := RoundsB 126 +abbrev Rounds.refl := @RoundsB.refl 126 +abbrev Rounds.next := @RoundsB.next 126 +abbrev checkStep := checkStepB 126 +abbrev checkStep_sound := checkStepB_sound 126 + +theorem Side_turnaround {w w' : HalfTape} (h : Side ([Call.ca] ^ 126) w w') : + (zCf w) [tm]⊢⁺ (zCf ([1, 1, 0] +> w')) := by + rcases h with _ | ⟨hc1, h⟩ + rcases h with _ | ⟨hc2, h⟩ + rcases h with _ | ⟨hc3, h⟩ + rcases h with _ | ⟨hc4, h⟩ + rcases h with _ | ⟨hc5, h⟩ + rcases h with _ | ⟨hc6, h⟩ + rcases h with _ | ⟨hc7, h⟩ + rcases h with _ | ⟨hc8, h⟩ + rcases h with _ | ⟨hc9, h⟩ + rcases h with _ | ⟨hc10, h⟩ + rcases h with _ | ⟨hc11, h⟩ + rcases h with _ | ⟨hc12, h⟩ + rcases h with _ | ⟨hc13, h⟩ + rcases h with _ | ⟨hc14, h⟩ + rcases h with _ | ⟨hc15, h⟩ + rcases h with _ | ⟨hc16, h⟩ + rcases h with _ | ⟨hc17, h⟩ + rcases h with _ | ⟨hc18, h⟩ + rcases h with _ | ⟨hc19, h⟩ + rcases h with _ | ⟨hc20, h⟩ + rcases h with _ | ⟨hc21, h⟩ + rcases h with _ | ⟨hc22, h⟩ + rcases h with _ | ⟨hc23, h⟩ + rcases h with _ | ⟨hc24, h⟩ + rcases h with _ | ⟨hc25, h⟩ + rcases h with _ | ⟨hc26, h⟩ + rcases h with _ | ⟨hc27, h⟩ + rcases h with _ | ⟨hc28, h⟩ + rcases h with _ | ⟨hc29, h⟩ + rcases h with _ | ⟨hc30, h⟩ + rcases h with _ | ⟨hc31, h⟩ + rcases h with _ | ⟨hc32, h⟩ + rcases h with _ | ⟨hc33, h⟩ + rcases h with _ | ⟨hc34, h⟩ + rcases h with _ | ⟨hc35, h⟩ + rcases h with _ | ⟨hc36, h⟩ + rcases h with _ | ⟨hc37, h⟩ + rcases h with _ | ⟨hc38, h⟩ + rcases h with _ | ⟨hc39, h⟩ + rcases h with _ | ⟨hc40, h⟩ + rcases h with _ | ⟨hc41, h⟩ + rcases h with _ | ⟨hc42, h⟩ + rcases h with _ | ⟨hc43, h⟩ + rcases h with _ | ⟨hc44, h⟩ + rcases h with _ | ⟨hc45, h⟩ + rcases h with _ | ⟨hc46, h⟩ + rcases h with _ | ⟨hc47, h⟩ + rcases h with _ | ⟨hc48, h⟩ + rcases h with _ | ⟨hc49, h⟩ + rcases h with _ | ⟨hc50, h⟩ + rcases h with _ | ⟨hc51, h⟩ + rcases h with _ | ⟨hc52, h⟩ + rcases h with _ | ⟨hc53, h⟩ + rcases h with _ | ⟨hc54, h⟩ + rcases h with _ | ⟨hc55, h⟩ + rcases h with _ | ⟨hc56, h⟩ + rcases h with _ | ⟨hc57, h⟩ + rcases h with _ | ⟨hc58, h⟩ + rcases h with _ | ⟨hc59, h⟩ + rcases h with _ | ⟨hc60, h⟩ + rcases h with _ | ⟨hc61, h⟩ + rcases h with _ | ⟨hc62, h⟩ + rcases h with _ | ⟨hc63, h⟩ + rcases h with _ | ⟨hc64, h⟩ + rcases h with _ | ⟨hc65, h⟩ + rcases h with _ | ⟨hc66, h⟩ + rcases h with _ | ⟨hc67, h⟩ + rcases h with _ | ⟨hc68, h⟩ + rcases h with _ | ⟨hc69, h⟩ + rcases h with _ | ⟨hc70, h⟩ + rcases h with _ | ⟨hc71, h⟩ + rcases h with _ | ⟨hc72, h⟩ + rcases h with _ | ⟨hc73, h⟩ + rcases h with _ | ⟨hc74, h⟩ + rcases h with _ | ⟨hc75, h⟩ + rcases h with _ | ⟨hc76, h⟩ + rcases h with _ | ⟨hc77, h⟩ + rcases h with _ | ⟨hc78, h⟩ + rcases h with _ | ⟨hc79, h⟩ + rcases h with _ | ⟨hc80, h⟩ + rcases h with _ | ⟨hc81, h⟩ + rcases h with _ | ⟨hc82, h⟩ + rcases h with _ | ⟨hc83, h⟩ + rcases h with _ | ⟨hc84, h⟩ + rcases h with _ | ⟨hc85, h⟩ + rcases h with _ | ⟨hc86, h⟩ + rcases h with _ | ⟨hc87, h⟩ + rcases h with _ | ⟨hc88, h⟩ + rcases h with _ | ⟨hc89, h⟩ + rcases h with _ | ⟨hc90, h⟩ + rcases h with _ | ⟨hc91, h⟩ + rcases h with _ | ⟨hc92, h⟩ + rcases h with _ | ⟨hc93, h⟩ + rcases h with _ | ⟨hc94, h⟩ + rcases h with _ | ⟨hc95, h⟩ + rcases h with _ | ⟨hc96, h⟩ + rcases h with _ | ⟨hc97, h⟩ + rcases h with _ | ⟨hc98, h⟩ + rcases h with _ | ⟨hc99, h⟩ + rcases h with _ | ⟨hc100, h⟩ + rcases h with _ | ⟨hc101, h⟩ + rcases h with _ | ⟨hc102, h⟩ + rcases h with _ | ⟨hc103, h⟩ + rcases h with _ | ⟨hc104, h⟩ + rcases h with _ | ⟨hc105, h⟩ + rcases h with _ | ⟨hc106, h⟩ + rcases h with _ | ⟨hc107, h⟩ + rcases h with _ | ⟨hc108, h⟩ + rcases h with _ | ⟨hc109, h⟩ + rcases h with _ | ⟨hc110, h⟩ + rcases h with _ | ⟨hc111, h⟩ + rcases h with _ | ⟨hc112, h⟩ + rcases h with _ | ⟨hc113, h⟩ + rcases h with _ | ⟨hc114, h⟩ + rcases h with _ | ⟨hc115, h⟩ + rcases h with _ | ⟨hc116, h⟩ + rcases h with _ | ⟨hc117, h⟩ + rcases h with _ | ⟨hc118, h⟩ + rcases h with _ | ⟨hc119, h⟩ + rcases h with _ | ⟨hc120, h⟩ + rcases h with _ | ⟨hc121, h⟩ + rcases h with _ | ⟨hc122, h⟩ + rcases h with _ | ⟨hc123, h⟩ + rcases h with _ | ⟨hc124, h⟩ + rcases h with _ | ⟨hc125, h⟩ + rcases h with _ | ⟨hc126, h⟩ + cases h + exact stepPlus_trans_vkq (zP0 w) (stepPlus_trans_vkq (hc1 (tr1 +> default)) (stepPlus_trans_vkq (zP1 _) (stepPlus_trans_vkq (hc2 (tr2 +> default)) (stepPlus_trans_vkq (zP2 _) (stepPlus_trans_vkq (hc3 (tr3 +> default)) (stepPlus_trans_vkq (zP3 _) (stepPlus_trans_vkq (hc4 (tr4 +> default)) (stepPlus_trans_vkq (zP4 _) (stepPlus_trans_vkq (hc5 (tr5 +> default)) (stepPlus_trans_vkq (zP5 _) (stepPlus_trans_vkq (hc6 (tr6 +> default)) (stepPlus_trans_vkq (zP6 _) (stepPlus_trans_vkq (hc7 (tr7 +> default)) (stepPlus_trans_vkq (zP7 _) (stepPlus_trans_vkq (hc8 (tr8 +> default)) (stepPlus_trans_vkq (zP8 _) (stepPlus_trans_vkq (hc9 (tr9 +> default)) (stepPlus_trans_vkq (zP9 _) (stepPlus_trans_vkq (hc10 (tr10 +> default)) (stepPlus_trans_vkq (zP10 _) (stepPlus_trans_vkq (hc11 (tr11 +> default)) (stepPlus_trans_vkq (zP11 _) (stepPlus_trans_vkq (hc12 (tr12 +> default)) (stepPlus_trans_vkq (zP12 _) (stepPlus_trans_vkq (hc13 (tr13 +> default)) (stepPlus_trans_vkq (zP13 _) (stepPlus_trans_vkq (hc14 (tr14 +> default)) (stepPlus_trans_vkq (zP14 _) (stepPlus_trans_vkq (hc15 (tr15 +> default)) (stepPlus_trans_vkq (zP15 _) (stepPlus_trans_vkq (hc16 (tr16 +> default)) (stepPlus_trans_vkq (zP16 _) (stepPlus_trans_vkq (hc17 (tr17 +> default)) (stepPlus_trans_vkq (zP17 _) (stepPlus_trans_vkq (hc18 (tr18 +> default)) (stepPlus_trans_vkq (zP18 _) (stepPlus_trans_vkq (hc19 (tr19 +> default)) (stepPlus_trans_vkq (zP19 _) (stepPlus_trans_vkq (hc20 (tr20 +> default)) (stepPlus_trans_vkq (zP20 _) (stepPlus_trans_vkq (hc21 (tr21 +> default)) (stepPlus_trans_vkq (zP21 _) (stepPlus_trans_vkq (hc22 (tr22 +> default)) (stepPlus_trans_vkq (zP22 _) (stepPlus_trans_vkq (hc23 (tr23 +> default)) (stepPlus_trans_vkq (zP23 _) (stepPlus_trans_vkq (hc24 (tr24 +> default)) (stepPlus_trans_vkq (zP24 _) (stepPlus_trans_vkq (hc25 (tr25 +> default)) (stepPlus_trans_vkq (zP25 _) (stepPlus_trans_vkq (hc26 (tr26 +> default)) (stepPlus_trans_vkq (zP26 _) (stepPlus_trans_vkq (hc27 (tr27 +> default)) (stepPlus_trans_vkq (zP27 _) (stepPlus_trans_vkq (hc28 (tr28 +> default)) (stepPlus_trans_vkq (zP28 _) (stepPlus_trans_vkq (hc29 (tr29 +> default)) (stepPlus_trans_vkq (zP29 _) (stepPlus_trans_vkq (hc30 (tr30 +> default)) (stepPlus_trans_vkq (zP30 _) (stepPlus_trans_vkq (hc31 (tr31 +> default)) (stepPlus_trans_vkq (zP31 _) (stepPlus_trans_vkq (hc32 (tr32 +> default)) (stepPlus_trans_vkq (zP32 _) (stepPlus_trans_vkq (hc33 (tr33 +> default)) (stepPlus_trans_vkq (zP33 _) (stepPlus_trans_vkq (hc34 (tr34 +> default)) (stepPlus_trans_vkq (zP34 _) (stepPlus_trans_vkq (hc35 (tr35 +> default)) (stepPlus_trans_vkq (zP35 _) (stepPlus_trans_vkq (hc36 (tr36 +> default)) (stepPlus_trans_vkq (zP36 _) (stepPlus_trans_vkq (hc37 (tr37 +> default)) (stepPlus_trans_vkq (zP37 _) (stepPlus_trans_vkq (hc38 (tr38 +> default)) (stepPlus_trans_vkq (zP38 _) (stepPlus_trans_vkq (hc39 (tr39 +> default)) (stepPlus_trans_vkq (zP39 _) (stepPlus_trans_vkq (hc40 (tr40 +> default)) (stepPlus_trans_vkq (zP40 _) (stepPlus_trans_vkq (hc41 (tr41 +> default)) (stepPlus_trans_vkq (zP41 _) (stepPlus_trans_vkq (hc42 (tr42 +> default)) (stepPlus_trans_vkq (zP42 _) (stepPlus_trans_vkq (hc43 (tr43 +> default)) (stepPlus_trans_vkq (zP43 _) (stepPlus_trans_vkq (hc44 (tr44 +> default)) (stepPlus_trans_vkq (zP44 _) (stepPlus_trans_vkq (hc45 (tr45 +> default)) (stepPlus_trans_vkq (zP45 _) (stepPlus_trans_vkq (hc46 (tr46 +> default)) (stepPlus_trans_vkq (zP46 _) (stepPlus_trans_vkq (hc47 (tr47 +> default)) (stepPlus_trans_vkq (zP47 _) (stepPlus_trans_vkq (hc48 (tr48 +> default)) (stepPlus_trans_vkq (zP48 _) (stepPlus_trans_vkq (hc49 (tr49 +> default)) (stepPlus_trans_vkq (zP49 _) (stepPlus_trans_vkq (hc50 (tr50 +> default)) (stepPlus_trans_vkq (zP50 _) (stepPlus_trans_vkq (hc51 (tr51 +> default)) (stepPlus_trans_vkq (zP51 _) (stepPlus_trans_vkq (hc52 (tr52 +> default)) (stepPlus_trans_vkq (zP52 _) (stepPlus_trans_vkq (hc53 (tr53 +> default)) (stepPlus_trans_vkq (zP53 _) (stepPlus_trans_vkq (hc54 (tr54 +> default)) (stepPlus_trans_vkq (zP54 _) (stepPlus_trans_vkq (hc55 (tr55 +> default)) (stepPlus_trans_vkq (zP55 _) (stepPlus_trans_vkq (hc56 (tr56 +> default)) (stepPlus_trans_vkq (zP56 _) (stepPlus_trans_vkq (hc57 (tr57 +> default)) (stepPlus_trans_vkq (zP57 _) (stepPlus_trans_vkq (hc58 (tr58 +> default)) (stepPlus_trans_vkq (zP58 _) (stepPlus_trans_vkq (hc59 (tr59 +> default)) (stepPlus_trans_vkq (zP59 _) (stepPlus_trans_vkq (hc60 (tr60 +> default)) (stepPlus_trans_vkq (zP60 _) (stepPlus_trans_vkq (hc61 (tr61 +> default)) (stepPlus_trans_vkq (zP61 _) (stepPlus_trans_vkq (hc62 (tr62 +> default)) (stepPlus_trans_vkq (zP62 _) (stepPlus_trans_vkq (hc63 (tr63 +> default)) (stepPlus_trans_vkq (zP63 _) (stepPlus_trans_vkq (hc64 (tr64 +> default)) (stepPlus_trans_vkq (zP64 _) (stepPlus_trans_vkq (hc65 (tr65 +> default)) (stepPlus_trans_vkq (zP65 _) (stepPlus_trans_vkq (hc66 (tr66 +> default)) (stepPlus_trans_vkq (zP66 _) (stepPlus_trans_vkq (hc67 (tr67 +> default)) (stepPlus_trans_vkq (zP67 _) (stepPlus_trans_vkq (hc68 (tr68 +> default)) (stepPlus_trans_vkq (zP68 _) (stepPlus_trans_vkq (hc69 (tr69 +> default)) (stepPlus_trans_vkq (zP69 _) (stepPlus_trans_vkq (hc70 (tr70 +> default)) (stepPlus_trans_vkq (zP70 _) (stepPlus_trans_vkq (hc71 (tr71 +> default)) (stepPlus_trans_vkq (zP71 _) (stepPlus_trans_vkq (hc72 (tr72 +> default)) (stepPlus_trans_vkq (zP72 _) (stepPlus_trans_vkq (hc73 (tr73 +> default)) (stepPlus_trans_vkq (zP73 _) (stepPlus_trans_vkq (hc74 (tr74 +> default)) (stepPlus_trans_vkq (zP74 _) (stepPlus_trans_vkq (hc75 (tr75 +> default)) (stepPlus_trans_vkq (zP75 _) (stepPlus_trans_vkq (hc76 (tr76 +> default)) (stepPlus_trans_vkq (zP76 _) (stepPlus_trans_vkq (hc77 (tr77 +> default)) (stepPlus_trans_vkq (zP77 _) (stepPlus_trans_vkq (hc78 (tr78 +> default)) (stepPlus_trans_vkq (zP78 _) (stepPlus_trans_vkq (hc79 (tr79 +> default)) (stepPlus_trans_vkq (zP79 _) (stepPlus_trans_vkq (hc80 (tr80 +> default)) (stepPlus_trans_vkq (zP80 _) (stepPlus_trans_vkq (hc81 (tr81 +> default)) (stepPlus_trans_vkq (zP81 _) (stepPlus_trans_vkq (hc82 (tr82 +> default)) (stepPlus_trans_vkq (zP82 _) (stepPlus_trans_vkq (hc83 (tr83 +> default)) (stepPlus_trans_vkq (zP83 _) (stepPlus_trans_vkq (hc84 (tr84 +> default)) (stepPlus_trans_vkq (zP84 _) (stepPlus_trans_vkq (hc85 (tr85 +> default)) (stepPlus_trans_vkq (zP85 _) (stepPlus_trans_vkq (hc86 (tr86 +> default)) (stepPlus_trans_vkq (zP86 _) (stepPlus_trans_vkq (hc87 (tr87 +> default)) (stepPlus_trans_vkq (zP87 _) (stepPlus_trans_vkq (hc88 (tr88 +> default)) (stepPlus_trans_vkq (zP88 _) (stepPlus_trans_vkq (hc89 (tr89 +> default)) (stepPlus_trans_vkq (zP89 _) (stepPlus_trans_vkq (hc90 (tr90 +> default)) (stepPlus_trans_vkq (zP90 _) (stepPlus_trans_vkq (hc91 (tr91 +> default)) (stepPlus_trans_vkq (zP91 _) (stepPlus_trans_vkq (hc92 (tr92 +> default)) (stepPlus_trans_vkq (zP92 _) (stepPlus_trans_vkq (hc93 (tr93 +> default)) (stepPlus_trans_vkq (zP93 _) (stepPlus_trans_vkq (hc94 (tr94 +> default)) (stepPlus_trans_vkq (zP94 _) (stepPlus_trans_vkq (hc95 (tr95 +> default)) (stepPlus_trans_vkq (zP95 _) (stepPlus_trans_vkq (hc96 (tr96 +> default)) (stepPlus_trans_vkq (zP96 _) (stepPlus_trans_vkq (hc97 (tr97 +> default)) (stepPlus_trans_vkq (zP97 _) (stepPlus_trans_vkq (hc98 (tr98 +> default)) (stepPlus_trans_vkq (zP98 _) (stepPlus_trans_vkq (hc99 (tr99 +> default)) (stepPlus_trans_vkq (zP99 _) (stepPlus_trans_vkq (hc100 (tr100 +> default)) (stepPlus_trans_vkq (zP100 _) (stepPlus_trans_vkq (hc101 (tr101 +> default)) (stepPlus_trans_vkq (zP101 _) (stepPlus_trans_vkq (hc102 (tr102 +> default)) (stepPlus_trans_vkq (zP102 _) (stepPlus_trans_vkq (hc103 (tr103 +> default)) (stepPlus_trans_vkq (zP103 _) (stepPlus_trans_vkq (hc104 (tr104 +> default)) (stepPlus_trans_vkq (zP104 _) (stepPlus_trans_vkq (hc105 (tr105 +> default)) (stepPlus_trans_vkq (zP105 _) (stepPlus_trans_vkq (hc106 (tr106 +> default)) (stepPlus_trans_vkq (zP106 _) (stepPlus_trans_vkq (hc107 (tr107 +> default)) (stepPlus_trans_vkq (zP107 _) (stepPlus_trans_vkq (hc108 (tr108 +> default)) (stepPlus_trans_vkq (zP108 _) (stepPlus_trans_vkq (hc109 (tr109 +> default)) (stepPlus_trans_vkq (zP109 _) (stepPlus_trans_vkq (hc110 (tr110 +> default)) (stepPlus_trans_vkq (zP110 _) (stepPlus_trans_vkq (hc111 (tr111 +> default)) (stepPlus_trans_vkq (zP111 _) (stepPlus_trans_vkq (hc112 (tr112 +> default)) (stepPlus_trans_vkq (zP112 _) (stepPlus_trans_vkq (hc113 (tr113 +> default)) (stepPlus_trans_vkq (zP113 _) (stepPlus_trans_vkq (hc114 (tr114 +> default)) (stepPlus_trans_vkq (zP114 _) (stepPlus_trans_vkq (hc115 (tr115 +> default)) (stepPlus_trans_vkq (zP115 _) (stepPlus_trans_vkq (hc116 (tr116 +> default)) (stepPlus_trans_vkq (zP116 _) (stepPlus_trans_vkq (hc117 (tr117 +> default)) (stepPlus_trans_vkq (zP117 _) (stepPlus_trans_vkq (hc118 (tr118 +> default)) (stepPlus_trans_vkq (zP118 _) (stepPlus_trans_vkq (hc119 (tr119 +> default)) (stepPlus_trans_vkq (zP119 _) (stepPlus_trans_vkq (hc120 (tr120 +> default)) (stepPlus_trans_vkq (zP120 _) (stepPlus_trans_vkq (hc121 (tr121 +> default)) (stepPlus_trans_vkq (zP121 _) (stepPlus_trans_vkq (hc122 (tr122 +> default)) (stepPlus_trans_vkq (zP122 _) (stepPlus_trans_vkq (hc123 (tr123 +> default)) (stepPlus_trans_vkq (zP123 _) (stepPlus_trans_vkq (hc124 (tr124 +> default)) (stepPlus_trans_vkq (zP124 _) (stepPlus_trans_vkq (hc125 (tr125 +> default)) (stepPlus_trans_vkq (zP125 _) (stepPlus_trans_vkq (hc126 (tr126 +> default)) (zP126 w')))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + +theorem Step_exec {u u' : List Word} (h : Step u u') : + (zCf (evalWords u default)) [tm]⊢⁺ (zCf (evalWords u' default)) := by + rcases h with ⟨n, b', v, da, H, g, hScan, hDg, rfl⟩ + have hSeg := Seg_of_Scan segSpec hScan + dsimp at hSeg + have hSide0 := sideP_of_segP hSeg (Side_ca_default segSpec hDg) + rw [wordsToBits_append_tape, evalWords_append, evalWords_replicate_K, wordsToBitsShifted_append_tape, <- evalWordsShifted_append] at hSide0 + have hTurn := Side_turnaround hSide0 + rwa [evalWords_V_shift] at hTurn + +theorem Rounds_exec {u v : List Word} (h : Rounds u v) : + (zCf (evalWords u default)) [tm]⊢* (zCf (evalWords v default)) := by + induction h with + | refl _ => exact ⟨0, rfl⟩ + | next hS _ ih => exact stepStar_of_stepPlus_vkq (stepPlus_stepStar_trans_vkq (Step_exec hS) ih) + +-- Section 3: Universal Parse_V_start, Scan_of_Parse, and Trace Evaluators + +def u_0 : List Word := [K,K,K,K,V,K,Q,Q] +def tags_0 : List Nat := [3,3,3,3,2,5] +def da_0 : List Word := [Q,K,K,Q] +def n_0 : Nat := 0 +def u_1 : List Word := [V,K,Q,Q,Q,Q,V,V,Q,K,K,Q] +def tags_1 : List Nat := [1,5,5,0,0,3,3,5] +def da_1 : List Word := [Q,K,Q,Q,Q,K,Q,Q,Q,Q] +def n_1 : Nat := 0 +def u_2 : List Word := [V,K,V,V,V,V,V,K,Q,V,Q,K,Q,Q,Q,K,Q,Q,Q,Q] +def tags_2 : List Nat := [1,0,0,0,0,1,3,0,4,5,4,5,5] +def da_2 : List Word := [Q,K,Q,Q,K,K,K,Q,Q,K,Q,K,Q,Q,Q,Q] +def n_2 : Nat := 0 +def u_3 : List Word := [V,K,V,V,V,V,V,K,V,Q,V,V,V,V,V,V,Q,K,Q,Q,K,K,K,Q,Q,K,Q,K,Q,Q,Q,Q] +def tags_3 : List Nat := [1,0,0,0,0,1,0,3,0,0,0,0,0,0,3,3,5,3,4,5,3,4,5,5] +def da_3 : List Word := [Q,K,Q,Q,K,K,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q] +def n_3 : Nat := 0 +def u_4 : List Word := [V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,K,Q,V,Q,V,V,Q,V,V,V,Q,K,Q,Q,K,K,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q] +def tags_4 : List Nat := [1,0,0,0,0,1,0,1,0,0,0,0,0,1,3,0,3,0,0,3,0,0,0,3,4,4,5,5,3,5,3,4,5,5] +def da_4 : List Word := [Q,K,Q,Q,Q,Q,K,Q,K,K,K,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q] +def n_4 : Nat := 0 +def u_5 : List Word := [V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,K,V,Q,V,K,V,V,K,V,V,V,K,V,V,V,V,Q,V,Q,V,V,V,Q,K,Q,Q,Q,Q,K,Q,K,K,K,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q] +def tags_5 : List Nat := [1,0,0,0,0,1,0,1,0,0,0,0,0,1,0,3,1,0,1,0,0,1,0,0,0,0,3,0,3,0,0,0,3,3,5,3,3,5,4,3,5,3,4,5,3,4,5,5] +def da_5 : List Word := [Q,K,Q,Q,K,K,Q,K,K,Q,K,K,K,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q] +def n_5 : Nat := 0 +def u_6 : List Word := [V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,K,V,V,K,K,V,V,K,V,V,V,K,V,V,V,V,V,K,V,K,V,V,V,K,Q,V,Q,Q,V,V,K,V,Q,V,V,Q,V,V,V,Q,K,Q,Q,K,K,Q,K,K,Q,K,K,K,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q] +def tags_6 : List Nat := [1,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,5,0,1,0,0,1,0,0,0,0,1,2,0,0,1,3,0,3,3,0,1,0,3,0,0,3,0,0,0,3,4,3,4,4,4,3,3,4,5,3,4,5,3,4,5,5] +def da_6 : List Word := [Q,K,Q,Q,K,Q,K,K,K,Q,K,K,K,Q,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q] +def n_6 : Nat := 0 +def u_7 : List Word := [V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,K,V,V,V,K,V,V,V,V,V,K,V,Q,V,V,V,K,V,Q,V,K,Q,V,K,V,V,K,V,V,K,V,V,V,K,V,K,V,V,V,K,Q,V,V,Q,V,V,Q,V,V,V,Q,K,Q,Q,K,Q,K,K,K,Q,K,K,K,Q,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q] +def tags_7 : List Nat := [1,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0,3,0,0,1,0,3,0,5,2,0,1,0,1,0,0,1,2,0,0,1,3,0,0,3,0,0,3,0,0,0,3,4,3,3,5,3,4,5,4,4,3,3,3,4,5,5,3,4,5,3,4,5,5] +def da_7 : List Word := [Q,K,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q] +def n_7 : Nat := 0 +def u_8 : List Word := [V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,K,V,V,V,K,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,Q,V,V,K,V,V,K,V,V,V,K,V,Q,V,V,V,K,V,Q,V,V,K,V,V,K,V,V,V,K,V,K,K,V,Q,V,V,V,V,K,Q,Q,V,V,V,Q,V,V,Q,V,V,V,Q,K,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q] +def tags_8 : List Nat := [1,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0,1,0,1,0,1,0,0,3,0,1,0,1,0,0,1,0,3,0,0,1,0,3,0,1,0,1,0,0,1,0,5,0,3,0,0,0,1,4,0,0,0,3,0,0,3,0,0,0,3,4,4,3,5,5,5,3,3,3,3,3,3,5,3,5,4,4,5,3,5,5,3,4,5,3,4,5,5] +def da_8 : List Word := [Q,K,Q,Q,Q,K,Q,K,Q,K,K,Q,K,Q,Q,Q,Q,K,Q,K,K,Q,K,Q,K,K,K,K,K,K,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q] +def n_8 : Nat := 0 +def u_9 : List Word := [V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,K,V,V,V,K,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,K,V,K,V,V,K,V,V,V,K,V,V,K,V,V,K,V,V,K,V,K,V,V,K,V,V,V,K,V,V,V,V,K,V,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,Q,K,K,K,Q,Q,V,Q,V,V,V,V,Q,V,V,Q,V,V,Q,V,V,V,Q,K,Q,Q,Q,K,Q,K,Q,K,K,Q,K,Q,Q,Q,Q,K,Q,K,K,Q,K,Q,K,K,K,K,K,K,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q] +def tags_9 : List Nat := [1,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0,1,0,1,0,1,0,0,1,2,0,1,0,0,1,0,1,0,1,0,1,2,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,0,1,0,1,0,0,1,0,1,0,0,0,3,3,3,3,5,0,3,0,0,0,0,3,0,0,3,0,0,3,0,0,0,3,4,4,3,4,5,4,3,5,5,4,3,4,4,3,3,3,3,3,3,3,4,5,4,4,5,3,5,5,3,4,5,3,4,5,5] +def da_9 : List Word := [Q,K,Q,Q,Q,K,Q,K,K,K,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,K,Q,K,K,Q,Q,Q,K,K,K,K,K,K,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q] +def n_9 : Nat := 0 +def u_10 : List Word := [V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,K,V,V,V,K,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,K,V,Q,V,V,K,V,V,V,K,V,V,K,V,V,K,V,V,K,V,Q,V,V,K,V,V,V,K,V,V,V,V,K,V,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,K,Q,K,Q,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,K,V,V,V,K,V,V,K,Q,K,Q,K,K,Q,V,V,V,V,V,Q,V,V,Q,V,V,Q,V,V,V,Q,K,Q,Q,Q,K,Q,K,K,K,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,K,Q,K,K,Q,Q,Q,K,K,K,K,K,K,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q] +def tags_10 : List Nat := [1,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0,1,0,1,0,1,0,0,1,0,3,0,1,0,0,1,0,1,0,1,0,1,0,3,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,0,1,0,1,0,0,1,0,1,0,0,0,1,3,4,0,1,0,0,0,1,0,1,0,1,0,0,1,0,1,0,0,1,0,0,1,0,1,3,4,3,4,0,0,0,0,0,3,0,0,3,0,0,3,0,0,0,3,4,4,3,4,4,3,3,3,4,5,3,3,3,4,5,4,3,5,4,3,3,3,3,4,3,4,3,3,3,4,5,4,4,5,3,5,5,3,4,5,3,4,5,5] +def da_10 : List Word := [Q,K,Q,Q,Q,K,Q,K,K,Q,K,K,Q,Q,Q,Q,Q,Q,K,K,K,Q,K,K,K,Q,Q,K,Q,Q,K,K,K,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,K,K,Q,K,K,K,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q] +def n_10 : Nat := 0 +def u_11 : List Word := [V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,K,V,V,V,K,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,K,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,K,V,V,V,K,V,V,V,V,K,V,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,K,V,Q,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,K,V,V,V,K,V,V,K,V,Q,V,K,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,K,Q,Q,V,V,Q,Q,K,V,V,V,K,V,V,K,K,Q,K,V,K,V,K,K,K,V,V,V,V,V,Q,V,V,Q,V,V,Q,V,V,V,Q,K,Q,Q,Q,K,Q,K,K,Q,K,K,Q,Q,Q,Q,Q,Q,K,K,K,Q,K,K,K,Q,Q,K,Q,Q,K,K,K,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,K,K,Q,K,K,K,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q] +def tags_11 : List Nat := [1,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0,1,0,1,0,1,0,0,1,0,1,2,0,0,1,0,1,0,1,0,1,0,1,2,0,0,1,0,0,0,1,0,0,1,0,0,0,0,1,0,1,0,0,1,0,1,0,0,0,1,0,3,0,1,0,0,0,1,0,1,0,1,0,0,1,0,1,0,0,1,0,0,1,0,1,0,3,1,0,0,0,0,0,1,0,1,0,1,0,0,1,0,1,0,1,4,0,0,3,5,0,0,1,0,0,5,3,3,1,0,5,3,0,0,0,0,0,3,0,0,3,0,0,3,0,0,0,3,4,4,3,4,3,4,4,5,3,3,4,3,4,3,3,3,5,4,4,3,4,3,4,5,4,3,5,4,3,5,5,3,4,3,3,3,3,4,5,4,4,5,3,5,5,3,4,5,3,4,5,5] +def da_11 : List Word := [Q,K,Q,Q,Q,K,Q,K,K,K,Q,Q,K,Q,Q,Q,Q,K,Q,Q,K,K,Q,K,K,Q,Q,K,K,K,Q,K,K,K,Q,Q,Q,Q,K,Q,K,K,Q,K,K,Q,K,K,K,Q,Q,K,Q,K,Q,K,K,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,K,K,Q,K,K,K,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q] +def n_11 : Nat := 0 +def u_12 : List Word := [V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,K,V,V,V,K,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,Q,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,Q,V,V,V,K,V,V,V,V,K,V,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,K,V,V,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,K,V,V,V,K,V,V,K,V,V,K,K,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,K,V,V,V,V,K,V,V,V,K,V,V,V,V,Q,Q,K,V,V,V,Q,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,K,V,V,V,Q,Q,V,K,V,K,K,Q,V,V,V,K,V,K,V,V,V,K,V,V,K,V,V,Q,V,K,Q,K,K,V,V,V,V,V,Q,V,V,Q,V,V,Q,V,V,V,Q,K,Q,Q,Q,K,Q,K,K,K,Q,Q,K,Q,Q,Q,Q,K,Q,Q,K,K,Q,K,K,Q,Q,K,K,K,Q,K,K,K,Q,Q,Q,Q,K,Q,K,K,Q,K,K,Q,K,K,K,Q,Q,K,Q,K,Q,K,K,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,K,K,Q,K,K,K,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q] +def tags_12 : List Nat := [1,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0,1,0,1,0,1,0,0,1,0,1,0,3,0,0,1,0,1,0,1,0,1,0,1,0,3,0,0,1,0,0,0,1,0,0,1,0,0,0,0,1,0,1,0,0,1,0,1,0,0,0,1,0,1,2,0,0,0,1,0,1,0,1,0,0,1,0,1,0,0,1,0,0,1,0,1,0,0,5,0,0,0,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,0,0,1,0,0,1,0,0,0,0,4,3,0,0,0,3,0,0,0,0,1,0,1,0,1,0,0,1,0,1,2,0,0,0,4,1,2,4,0,0,1,2,0,0,1,0,1,0,0,3,0,5,3,3,0,0,0,0,0,3,0,0,3,0,0,3,0,0,0,3,4,4,3,4,3,5,5,5,5,4,5,3,4,3,5,3,3,4,3,3,3,5,5,4,3,4,3,4,3,3,3,5,4,4,3,4,3,4,5,4,3,5,4,3,3,3,3,4,3,4,3,3,3,4,5,4,4,5,3,5,5,3,4,5,3,4,5,5] +def da_12 : List Word := [Q,K,Q,Q,Q,K,Q,K,K,K,K,Q,Q,K,K,K,K,Q,Q,Q,K,Q,Q,K,K,K,Q,K,K,Q,Q,K,Q,K,K,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,K,Q,K,Q,Q,K,K,K,Q,K,K,K,Q,Q,Q,Q,K,K,K,Q,K,Q,K,Q,K,K,Q,K,K,K,Q,Q,K,Q,K,Q,K,K,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,K,K,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q] +def n_12 : Nat := 0 +def u_13 : List Word := [V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,K,V,V,V,K,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,V,K,V,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,Q,V,V,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,K,V,V,V,V,K,V,V,V,K,V,V,V,V,V,V,K,V,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,Q,V,V,V,V,V,K,V,Q,V,V,V,V,K,V,Q,V,V,V,K,V,V,K,V,V,V,K,V,V,Q,Q,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,K,V,V,V,V,V,V,Q,V,K,V,Q,Q,V,K,Q,K,V,V,V,K,V,K,V,K,K,Q,V,V,V,K,V,K,V,V,V,K,V,V,K,K,Q,K,V,K,V,K,K,Q,V,V,V,V,V,Q,V,V,Q,V,V,Q,V,V,V,Q,K,Q,Q,Q,K,Q,K,K,K,K,Q,Q,K,K,K,K,Q,Q,Q,K,Q,Q,K,K,K,Q,K,K,Q,Q,K,Q,K,K,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,K,Q,K,Q,Q,K,K,K,Q,K,K,K,Q,Q,Q,Q,K,K,K,Q,K,Q,K,Q,K,K,Q,K,K,K,Q,Q,K,Q,K,Q,K,K,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,K,K,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q] + +def head_w : List Word := [V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,K,V,V,V,K,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,K,V,V,K,V] +def tags_head : List Nat := [1,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0] +def v_head : List Word := [K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,K,V,V,V,K,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V] +def a_head : Nat := 536870911 +def b_head : Nat := 65984224292 +def A_top : Nat := 128875438 + +def s_base : List Word := [V,V,V,V,V,Q,V,V,Q,V,V,Q,V,V,V] +def s_full : List Word := s_base ++ [Q,K,Q,Q,Q,K,Q,K] +def tags_s : List Nat := [0,0,0,0,0,3,0,0,3,0,0,3,0,0,0,3,4,4,3,4] +def v_s : List Word := [V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V] + +def top_base : List Word := [K,Q,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q] +def top_full : List Word := top_base ++ [] +def tags_top : List Nat := [4,5,4,4,5,3,5,5,3,4,5,3,4,5,5] + +def p_init : List Word := [V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,V,K,V,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,Q,V,V,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,K,V,V,V,V,K,V,V,V,K,V,V,V,V,V,V,K,V,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,Q,V,V,V,V,V,K,V,Q,V,V,V,V,K,V,Q,V,V,V,K,V,V,K,V,V,V,K,V,V,Q,Q,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,K,V,V,V,V,V,V,Q,V,K,V,Q,Q,V,K,Q,K,V,V,V,K,V,K,V,K,K,Q,V,V,V,K,V,K,V,V,V,K,V,V,K,K,Q,K,V,K,V,K,K,Q] +def ds_core_init : List Word := [K,K,Q,Q,K,K,K,K,Q,Q,Q,K,Q,Q,K,K,K,Q,K,K,Q,Q,K,Q,K,K,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,K,Q,K,Q,Q,K,K,K,Q,K,K,K,Q,Q,Q,Q,K,K,K,Q,K,Q,K,Q,K,K,Q,K,K,K,Q,Q,K,Q,K,Q,K,K,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,K,K,K] +def A_core_init : Nat := 69234923593231798136558728972 + +def zInitCCfg : CCfg := ⟨0, 0, [], []⟩ +def zMidCCfg_1 : CCfg := ⟨2, 1, [0,0,1,0,0,0,1,0,1,0,1], [1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1]⟩ +def zMidCCfg_2 : CCfg := ⟨3, 0, [0,0,0,0,0,0,1], [1,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1]⟩ +def zMidCCfg_3 : CCfg := ⟨4, 0, [0,1,1,0,0,0,0,1,1,0,0,1,0,1,0,1,0,1,0,1,1], [0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1]⟩ +def zMidCCfg_4 : CCfg := ⟨0, 0, [0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,1], [1,0,1,0,1,1,1,0,1,0,1,0,1]⟩ +def zHitCCfg : CCfg := ⟨0, 0, [0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,1], []⟩ + +set_option maxRecDepth 200000 in +theorem zCm_init_0 : zCm zInitCCfg 1000 = some zMidCCfg_1 := by decide +set_option maxRecDepth 200000 in +theorem zCm_init_1 : zCm zMidCCfg_1 1000 = some zMidCCfg_2 := by decide +set_option maxRecDepth 200000 in +theorem zCm_init_2 : zCm zMidCCfg_2 1000 = some zMidCCfg_3 := by decide +set_option maxRecDepth 200000 in +theorem zCm_init_3 : zCm zMidCCfg_3 1000 = some zMidCCfg_4 := by decide +set_option maxRecDepth 200000 in +theorem zCm_init_4 : zCm zMidCCfg_4 347 = some zHitCCfg := by decide + +theorem init_to_u0 : (init []) [tm]⊢* zCf (evalWords u_0 default) := by + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = evalCCfgVKQ zInitCCfg := rfl + have h1 : evalCCfgVKQ zHitCCfg = zCf (evalWords u_0 default) := by + dsimp [evalCCfgVKQ, zHitCCfg, zCf, pref_cap, u_0, evalWords, V_u, K_u, Q_u] + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq, default_head_vkq, default_tail_vkq] + have hPlus := stepPlus_trans_vkq (zTc (by decide : 0 < 1000) zCm_init_0) (stepPlus_trans_vkq (zTc (by decide : 0 < 1000) zCm_init_1) (stepPlus_trans_vkq (zTc (by decide : 0 < 1000) zCm_init_2) (stepPlus_trans_vkq (zTc (by decide : 0 < 1000) zCm_init_3) (zTc (by decide : 0 < 347) zCm_init_4)))) + rw [<- h0, h1] at hPlus + exact stepStar_of_stepPlus_vkq hPlus + +set_option maxRecDepth 200000 in +theorem step_0 : Step u_0 u_1 := checkStep_sound n_0 tags_0 u_0 da_0 u_1 (by decide) +set_option maxRecDepth 200000 in +theorem step_1 : Step u_1 u_2 := checkStep_sound n_1 tags_1 u_1 da_1 u_2 (by decide) +set_option maxRecDepth 200000 in +theorem step_2 : Step u_2 u_3 := checkStep_sound n_2 tags_2 u_2 da_2 u_3 (by decide) +set_option maxRecDepth 200000 in +theorem step_3 : Step u_3 u_4 := checkStep_sound n_3 tags_3 u_3 da_3 u_4 (by decide) +set_option maxRecDepth 200000 in +theorem step_4 : Step u_4 u_5 := checkStep_sound n_4 tags_4 u_4 da_4 u_5 (by decide) +set_option maxRecDepth 200000 in +theorem step_5 : Step u_5 u_6 := checkStep_sound n_5 tags_5 u_5 da_5 u_6 (by decide) +set_option maxRecDepth 200000 in +theorem step_6 : Step u_6 u_7 := checkStep_sound n_6 tags_6 u_6 da_6 u_7 (by decide) +set_option maxRecDepth 200000 in +theorem step_7 : Step u_7 u_8 := checkStep_sound n_7 tags_7 u_7 da_7 u_8 (by decide) +set_option maxRecDepth 200000 in +theorem step_8 : Step u_8 u_9 := checkStep_sound n_8 tags_8 u_8 da_8 u_9 (by decide) +set_option maxRecDepth 200000 in +theorem step_9 : Step u_9 u_10 := checkStep_sound n_9 tags_9 u_9 da_9 u_10 (by decide) +set_option maxRecDepth 200000 in +theorem step_10 : Step u_10 u_11 := checkStep_sound n_10 tags_10 u_10 da_10 u_11 (by decide) +set_option maxRecDepth 200000 in +theorem step_11 : Step u_11 u_12 := checkStep_sound n_11 tags_11 u_11 da_11 u_12 (by decide) +set_option maxRecDepth 200000 in +theorem step_12 : Step u_12 u_13 := checkStep_sound n_12 tags_12 u_12 da_12 u_13 (by decide) + +theorem rounds_0_13 : Rounds u_0 u_13 := + Rounds.next step_0 (Rounds.next step_1 (Rounds.next step_2 (Rounds.next step_3 (Rounds.next step_4 (Rounds.next step_5 (Rounds.next step_6 (Rounds.next step_7 (Rounds.next step_8 (Rounds.next step_9 (Rounds.next step_10 (Rounds.next step_11 (Rounds.next step_12 (Rounds.refl u_13))))))))))))) + +abbrev Good (u : List Word) : Prop := + ∃ p_w ds_core A_core m, + u = head_w ++ p_w ++ s_base ++ [Q,K,Q,Q,Q,K,Q,K,K] ++ ds_core ++ top_base ∧ + (∃ p_tail, p_w = V :: p_tail) ∧ + m = 1 + ds_core.length ∧ + 11 <= m ∧ + DigitVal A_core (m - 1) ds_core ∧ + A_core * 512 <= 35 * 2 ^ (m - 1) ∧ + wordScale p_w * ((2 ^ m : Nat) : Rat) = 512 ∧ + wordPot p_w <= 29 / 4 + +set_option maxRecDepth 200000 in +theorem good_u13 : Good u_13 := by + refine ⟨p_init, ds_core_init, A_core_init, 101, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · decide + · exact ⟨p_init.tail, rfl⟩ + · decide + · decide + · exact checkDg_sound A_core_init ds_core_init (by decide) + · decide + · have h := checkScalePow_sound p_init 101 9 (by decide) + norm_num at h + exact h + · have h := checkWordPotLe_sound p_init 29 4 (by decide) + norm_num at h + linarith + +set_option maxRecDepth 200000 in +theorem Scan_head : Scan 0 126 head_w a_head b_head v_head 0 := by + have h := checkAffineScan_sound tags_head 0 0 0 126 head_w 0 a_head 0 b_head v_head 0 0 0 (by decide) + simpa using h + +theorem v_head_eq : V :: v_head = head_w ++ [V] := rfl + +theorem Scan_s (ap bp : Nat) (hbp : 3 <= bp) : + Scan ap bp s_full (2 * ap + 2) (1024 * (bp - 3) + 908) v_s 3 := by + have h := checkAffineScan_sound tags_s 1 0 1 3 s_full 2 2 1024 908 v_s 3 ap (bp - 3) (by decide) + have h_bp : 1 * (bp - 3) + 3 = bp := by omega + have h_ap : 1 * ap + 0 = ap := by omega + rwa [h_ap, h_bp] at h + +theorem Scan_top (b_top : Nat) (hb : 2 <= b_top) : + Scan (2 ^ 21) b_top top_full 0 (512 * (b_top - 2) + 93) s_base 12 := by + have h := checkAffineScan_sound tags_top 0 (2 ^ 21) 1 2 top_full 0 0 512 93 s_base 12 0 (b_top - 2) (by decide) + have h_in : 1 * (b_top - 2) + 2 = b_top := by omega + dsimp at h + rwa [h_in] at h + +theorem Parse_s_split {ap a_end g_all : Nat} {rest : List Word} + (h : Parse ap (s_full ++ K :: rest) a_end g_all) : + ∃ g_mid, Parse (2 * (ap + 1)) (K :: rest) a_end g_mid := by + change Parse ap ([V,V,V,V,V,Q,V,V,Q,V,V,Q,V,V,V,Q,K,Q,Q,Q,K,Q,K,K] ++ rest) a_end g_all at h + simp only [List.cons_append, List.nil_append] at h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + cases h with + | @D _ q1_1 _ _ _ _ _ hq1_1 h => + have hq1_1_eq : q1_1 = 16 + ap * 16 := by dsimp [dVal] at hq1_1; omega + subst hq1_1_eq + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + cases h with + | @D _ q1_2 _ _ _ _ _ hq1_2 h => + have hq1_2_eq : q1_2 = 34 + ap * 32 := by dsimp [dVal] at hq1_2; omega + subst hq1_2_eq + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + cases h with + | @D _ q1_3 _ _ _ _ _ hq1_3 h => + have hq1_3_eq : q1_3 = 70 + ap * 64 := by dsimp [dVal] at hq1_3; omega + subst hq1_3_eq + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + cases h with + | @D _ q1_4 _ _ _ _ _ hq1_4 h => + have hq1_4_eq : q1_4 = 284 + ap * 256 := by dsimp [dVal] at hq1_4; omega + subst hq1_4_eq + cases h with + | @D _ q1_5 _ _ _ _ _ hq1_5 h => + have hq1_5_eq : q1_5 = 142 + ap * 128 := by dsimp [dVal] at hq1_5; omega + subst hq1_5_eq + cases h with + | D _ hq1_6 _ => dsimp [dVal] at hq1_6; omega + | P _ _ hq2_6 _ => dsimp [dVal] at hq2_6; omega + | @P _ q2_5 _ _ _ _ _ _ _ hq2_5 h => + have hq2_5_eq : q2_5 = 71 + ap * 64 := by dsimp [dVal] at hq2_5; omega + subst hq2_5_eq + cases h with + | @D _ q1_7 _ _ _ _ _ hq1_7 h => + have hq1_7_eq : q1_7 = 36 + ap * 32 := by dsimp [dVal] at hq1_7; omega + subst hq1_7_eq + cases h with + | D _ hq1_8 _ => dsimp [dVal] at hq1_8; omega + | P _ _ hq2_8 _ => dsimp [dVal] at hq2_8; omega + | @P _ q2_7 _ _ _ _ _ _ _ hq2_7 h => + have hq2_7_eq : q2_7 = 18 + ap * 16 := by dsimp [dVal] at hq2_7; omega + subst hq2_7_eq + cases h with + | @D _ q1_9 _ _ _ _ _ hq1_9 h => + have hq1_9_eq : q1_9 = 9 + ap * 8 := by dsimp [dVal] at hq1_9; omega + subst hq1_9_eq + cases h with + | @D _ q1_10 _ _ _ _ _ hq1_10 h => + have hq1_10_eq : q1_10 = 5 + ap * 4 := by dsimp [dVal] at hq1_10; omega + subst hq1_10_eq + cases h with + | D _ hq1_11 _ => dsimp [dVal] at hq1_11; omega + | P _ _ hq2_11 _ => dsimp [dVal] at hq2_11; omega + | @P _ q2_10 _ _ _ _ _ _ _ hq2_10 h => + have hq2_10_eq : q2_10 = 2 + ap * 2 := by dsimp [dVal] at hq2_10; omega + subst hq2_10_eq + have h_end : 2 + ap * 2 = 2 * (ap + 1) := by omega + rw [h_end] at h + exact ⟨_, h⟩ + | P _ _ hq2_9 _ => dsimp [dVal] at hq2_9; omega + | P _ _ hq2_4 _ => dsimp [dVal] at hq2_4; omega + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + +-- Section 6: Main Invariant Closure and Goal Proof +theorem zDg_top : DigitVal A_top 27 top_base := + checkDg_sound A_top top_base (by decide) + +theorem zDg_bot : DigitVal 93 9 [Q,K,Q,Q,Q,K,Q,K,K] := + checkDg_sound 93 [Q,K,Q,Q,Q,K,Q,K,K] (by decide) + +theorem digitVal_mid {A_core m : Nat} {ds_core : List Word} + (hm : 11 <= m) (hD : DigitVal A_core (m - 1) ds_core) + (hA_core : A_core * 512 <= 35 * 2 ^ (m - 1)) : + ∃ A_mid, + DigitVal A_mid m ([K] ++ ds_core) ∧ + A_mid <= 0 + 35 * 2 ^ (m - 9) := by + have h_bs : DigitVal 0 1 [K] := checkDg_sound 0 [K] (by decide) + have h1 := digitVal_append h_bs hD + have hlen1 : 1 + (m - 1) = m := by omega + rw [hlen1] at h1 + have h_pow1 : 2 ^ (m - 1) = 256 * 2 ^ (m - 9) := by + have heq : m - 1 = 8 + (m - 9) := by omega + rw [heq, Nat.pow_add] + exact ⟨0 + A_core * 2, h1, by omega⟩ + +theorem force_a_top {p_w ds_mid : List Word} {ap gp m A_mid a_top g_mid : Nat} + (hm : 11 <= m) + (hP_p : Parse a_head p_w ap gp) + (hz13 : wordScale p_w * ((2 ^ m : Nat) : Rat) = 512) + (hzW : wordPot p_w <= 29 / 4) + (hD_mid : DigitVal A_mid m ds_mid) + (hA_hi : A_mid <= 0 + 35 * 2 ^ (m - 9)) + (hP_mid : Parse (2 * (ap + 1)) ds_mid a_top g_mid) : + a_top = 2 ^ 21 := by + rcases Parse_la hP_p with ⟨hla_lo, hla_hi⟩ + have hz12 := wordValQ_nonneg p_w + have hz10_le := two_wordVal_add_wordValQ_le p_w + have h_diff_hi : ((ap : Rat) + 1) * wordScale p_w - ((a_head : Rat) + 1) < 15 := by linarith + have h_powm_pos : (0 : Rat) < ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + have h_mul_lo : ((a_head : Rat) + 1) * ((2 ^ m : Nat) : Rat) <= ((ap : Rat) + 1) * (wordScale p_w * ((2 ^ m : Nat) : Rat)) := by + nlinarith + have h_mul_hi : ((ap : Rat) + 1) * (wordScale p_w * ((2 ^ m : Nat) : Rat)) < (((a_head : Rat) + 1) + 15) * ((2 ^ m : Nat) : Rat) := by + nlinarith + rw [hz13] at h_mul_lo h_mul_hi + have ha_val : a_head + 1 = 2 ^ 29 := by decide + have ha_r : (a_head : Rat) + 1 = ((2 ^ 29 : Nat) : Rat) := by exact_mod_cast ha_val + rw [ha_r] at h_mul_lo h_mul_hi + have h_nat_lo : 2 ^ 29 * 2 ^ m <= (ap + 1) * 512 := by exact_mod_cast h_mul_lo + have h_nat_hi : (ap + 1) * 512 < (2 ^ 29 + 15) * 2 ^ m := by exact_mod_cast h_mul_hi + have h_ep : (ap + 1) * 512 = (2 * (ap + 1)) * 256 := by ring + rw [h_ep] at h_nat_lo h_nat_hi + have h_split1 : 2 ^ 29 * 2 ^ m = (2 ^ 21 * 2 ^ m) * 256 := by + have : (2 ^ 29 : Nat) = 2 ^ 21 * 256 := by decide + rw [this]; ring + have h_split2 : (2 ^ 29 + 15) * 2 ^ m = (2 ^ 21 * 2 ^ m + 15 * 2 ^ (m - 8)) * 256 := by + have h_eh : (2 ^ 29 : Nat) = 2 ^ 21 * 256 := by decide + have hm_de : 2 ^ m = 2 ^ (m - 8) * 256 := by + have h_de : (256 : Nat) = 2 ^ 8 := rfl + rw [h_de, <- Nat.pow_add, Nat.sub_add_cancel (by omega : 8 <= m)] + calc (2 ^ 29 + 15) * 2 ^ m + _ = 2 ^ 29 * 2 ^ m + 15 * 2 ^ m := by ring + _ = (2 ^ 21 * 256) * 2 ^ m + 15 * (2 ^ (m - 8) * 256) := by rw [h_eh, hm_de] + _ = (2 ^ 21 * 2 ^ m + 15 * 2 ^ (m - 8)) * 256 := by ring + rw [h_split1] at h_nat_lo + rw [h_split2] at h_nat_hi + have h_pos_de : 0 < 256 := by decide + have hap_lo : 2 ^ 21 * 2 ^ m <= 2 * (ap + 1) := Nat.le_of_mul_le_mul_right h_nat_lo h_pos_de + have hap_hi : 2 * (ap + 1) < 2 ^ 21 * 2 ^ m + 15 * 2 ^ (m - 8) := Nat.lt_of_mul_lt_mul_right h_nat_hi + have h_pow_mde : 2 ^ (m - 8) = 2 * 2 ^ (m - 9) := by + have heq : m - 8 = 1 + (m - 9) := by omega + rw [heq, Nat.pow_add] + have h_pow_m : 2 ^ m = 512 * 2 ^ (m - 9) := by + have h_dg : (512 : Nat) = 2 ^ 9 := rfl + rw [h_dg, <- Nat.pow_add, Nat.add_sub_of_le (by omega : 9 <= m)] + have h_pow_mdg_ge : 4 <= 2 ^ (m - 9) := by + have h_le_m : 2 <= m - 9 := by omega + have hle := Nat.pow_le_pow_right (by decide : 1 <= 2) h_le_m + simpa using hle + rcases parse_digitVal_a hP_mid hD_mid with ⟨h_atop_lo, h_atop_hi⟩ + have h_sum_lo : 2 ^ 21 * 2 ^ m <= 2 * (ap + 1) + A_mid := by omega + have h_sum_hi : 2 * (ap + 1) + A_mid < (2 ^ 21 + 1) * 2 ^ m := by + have : (2 ^ 21 + 1) * 2 ^ m = 2 ^ 21 * 2 ^ m + 512 * 2 ^ (m - 9) := by + rw [Nat.add_mul, Nat.one_mul, h_pow_m] + omega + have h_pos_m : 0 < 2 ^ m := pow_two_pos m + have h_lt1 : a_top < 2 ^ 21 + 1 := Nat.lt_of_mul_lt_mul_right (lt_of_le_of_lt h_atop_lo h_sum_hi) + have h_lt2 : 2 ^ 21 < a_top + 1 := Nat.lt_of_mul_lt_mul_right (lt_of_le_of_lt h_sum_lo h_atop_hi) + omega + +theorem bound_b_mid0 {p_w v_p ds_mid : List Word} + {ap bp gp m A_mid b_mid0 : Nat} + (hm : 11 <= m) + (hS_p : Scan a_head b_head p_w ap bp v_p gp) + (hbp : 3 <= bp) + (hz13 : wordScale p_w * ((2 ^ m : Nat) : Rat) = 512) + (hzW : wordPot p_w <= 29 / 4) + (hb_mid0 : b_mid0 = 1024 * (bp - 3) + 908) + (hD_mid : DigitVal A_mid m ds_mid) : + 2 + 4 * wordVal ds_mid < (b_mid0 : Rat) := by + have h_delta_p := (Scan_delta hS_p).2 + have h_4wv_p := two_wordVal_add_wordValQ_le_four_wordPotV v_p + have h_cw_p := scan_wordPot_contract7 hS_p + have hc_bh := (cPar77_bounds b_head).2 + have h_wv_p_lt : wordPotV v_p < 7 := by linarith + have h_z13_p := scan_wordScale_eq hS_p + have h_pow_gp_ge1 : (1 : Rat) <= ((2 ^ (3 * gp) : Nat) : Rat) := by exact_mod_cast (pow_two_pos (3 * gp)) + have h_z13_vp_pos := wordScale_pos v_p + have h_z13_vp_le : wordScale v_p <= wordScale p_w := by nlinarith + have h_bh_big : ((2 ^ 30 : Nat) : Rat) + 30 < (b_head : Rat) := by norm_num [b_head] + have h_bp2_pos : (0 : Rat) <= (bp : Rat) - 2 := by + have : (2 : Rat) <= (bp : Rat) := by exact_mod_cast (by omega : 2 <= bp) + linarith + have h_prod_p : ((2 ^ 30 : Nat) : Rat) < ((bp : Rat) - 2) * wordScale p_w := by nlinarith + have h_powm_pos : (0 : Rat) < ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + have h_mul_m : ((2 ^ 30 : Nat) : Rat) * ((2 ^ m : Nat) : Rat) < ((bp : Rat) - 2) * (wordScale p_w * ((2 ^ m : Nat) : Rat)) := by + nlinarith + rw [hz13] at h_mul_m + have h_pow_ebh : ((2 ^ 30 : Nat) : Rat) = ((2 ^ 21 : Nat) : Rat) * 512 := by norm_num + rw [h_pow_ebh] at h_mul_m + have h_bp2_gt : ((2 ^ 21 : Nat) : Rat) * ((2 ^ m : Nat) : Rat) < (bp : Rat) - 2 := by linarith + have h_bmid0_r : (b_mid0 : Rat) = 1024 * ((bp : Rat) - 3) + 908 := by + rw [hb_mid0, Nat.cast_add, Nat.cast_mul, Nat.cast_sub hbp]; push_cast; ring + have h_z10_mid := (digitVal_scale_and_val hD_mid).2 + have h_pow_val : ((2 ^ 21 : Nat) : Rat) = 2097152 := by norm_num + have h_powm_ge1 : (1 : Rat) <= ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + rw [h_z10_mid, h_bmid0_r] + rw [h_pow_val] at h_bp2_gt + linarith + +theorem bound_zW_p' {p_w v_p ds_mid v_mid : List Word} + {ap bp gp m A_mid b_mid0 b_top g_mid : Nat} + (hm : 11 <= m) + (hS_p : Scan a_head b_head p_w ap bp v_p gp) + (hz13 : wordScale p_w * ((2 ^ m : Nat) : Rat) = 512) + (hzW : wordPot p_w <= 29 / 4) + (hD_mid : DigitVal A_mid m ds_mid) + (hS_mid : Scan (2 * (ap + 1)) b_mid0 ds_mid (2 ^ 21) b_top v_mid g_mid) : + wordPotV (v_p ++ v_s ++ v_mid) <= 29 / 4 := by + have h_cw_p := scan_wordPot_contract7 hS_p + have hc_bh : cPar7 b_head = 2 / 7 := by + unfold cPar7 + have hmod : b_head % 2 = 0 := by decide + rw [hmod]; rfl + rw [hc_bh] at h_cw_p + have hA : wordPotV v_p <= 13 / 2 := by linarith + have h_z13_p := scan_wordScale_eq hS_p + have h_z13_vs : wordScale v_s = 1 / 1024 := by + have h := checkScalePow_sound v_s 10 0 (by decide) + norm_num at h + linarith + have h_wv_vs : wordPotV v_s <= 9 / 8 := by + have h := checkWordPotVLe_sound v_s 9 8 (by decide) + norm_num at h + linarith + have h_powm_ge : (2 ^ 11 : Nat) <= 2 ^ m := Nat.pow_le_pow_right (by decide) hm + have h_powm_r : ((2 ^ 11 : Nat) : Rat) <= ((2 ^ m : Nat) : Rat) := by exact_mod_cast h_powm_ge + have h_z13_p_le : wordScale p_w <= 1 / 4 := by + have h_pos_p := wordScale_pos p_w + have h_mul := mul_le_mul_of_nonneg_left h_powm_r (le_of_lt h_pos_p) + rw [hz13] at h_mul + norm_num at h_mul + linarith + have h_pow_gp_ge1 : (1 : Rat) <= ((2 ^ (3 * gp) : Nat) : Rat) := by exact_mod_cast (pow_two_pos (3 * gp)) + have h_z13_vp_pos := wordScale_pos v_p + have h_z13_vp_le : wordScale v_p <= 1 / 4 := by nlinarith + have hB : wordScale v_p * wordPotV v_s <= 9 / 32 := by + have h_wv_nn := wordPotV_nonneg v_s + nlinarith + have h_dc_eq := digitVal_scan_dCount hS_mid hD_mid + have h_wv_mid_dc := dCount_bound_WV v_mid + have h_vp_m : wordScale v_p * ((2 ^ m : Nat) : Rat) <= 512 := by + have h_eq : wordScale v_p * ((2 ^ m : Nat) : Rat) * ((2 ^ (3 * gp) : Nat) : Rat) = 512 := by + calc wordScale v_p * ((2 ^ m : Nat) : Rat) * ((2 ^ (3 * gp) : Nat) : Rat) + _ = (wordScale v_p * ((2 ^ (3 * gp) : Nat) : Rat)) * ((2 ^ m : Nat) : Rat) := by ring + _ = wordScale p_w * ((2 ^ m : Nat) : Rat) := by rw [h_z13_p] + _ = 512 := hz13 + have h_pos_m : (0 : Rat) < ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + have h_nn : 0 <= wordScale v_p * ((2 ^ m : Nat) : Rat) := mul_nonneg (le_of_lt h_z13_vp_pos) (le_of_lt h_pos_m) + nlinarith + have h_prod_ps : wordScale v_p * wordScale v_s * ((2 ^ m : Nat) : Rat) <= 1 / 2 := by + rw [h_z13_vs] + linarith + have hC : wordScale (v_p ++ v_s) * wordPotV v_mid <= 7 / 16 := by + rw [wordScale_append] + have h_wv_mid_le : wordPotV v_mid <= (7 / 8) * ((2 ^ m : Nat) : Rat) := by + have h_dc_le_m : 2 ^ (dCount v_mid) <= 2 ^ m := Nat.pow_le_pow_right (by decide) (by omega) + have h_dc_r : ((2 ^ (dCount v_mid) : Nat) : Rat) <= ((2 ^ m : Nat) : Rat) := by exact_mod_cast h_dc_le_m + have hm_256 : (256 : Rat) <= ((2 ^ m : Nat) : Rat) := by + have : (2048 : Rat) <= ((2 ^ 11 : Nat) : Rat) := by norm_num + linarith + linarith + have h_wv_mid_nn := wordPotV_nonneg v_mid + have h_z13_ps_pos : 0 < wordScale v_p * wordScale v_s := mul_pos h_z13_vp_pos (wordScale_pos v_s) + nlinarith + have h_app1 := wordPotV_append_le v_p v_s + have h_app2 := wordPotV_append_le (v_p ++ v_s) v_mid + linarith + +theorem bound_b_end_digitVal {w_all v_w : List Word} {b_top g_w k : Nat} + (hk : 1 <= k) + (hb_top : 2 <= b_top) + (hS_w : Scan a_head b_head w_all (2 ^ 21) b_top v_w g_w) + (hz13_vw : wordScale v_w * ((2 ^ k : Nat) : Rat) = 1) + (hWV_vw : wordPotV v_w <= 29 / 4) : + ∃ A_core' ds_core', + DigitVal A_core' (k + 9) ds_core' ∧ + ds_core'.length = k + 9 ∧ + A_core' * 512 <= 35 * 2 ^ (k + 9) ∧ + DigitVal (512 * (b_top - 2) + 93) (k + 45) + ([Q,K,Q,Q,Q,K,Q,K,K] ++ ds_core' ++ top_base) := by + rcases Scan_delta hS_w with ⟨hd_lo, hd_hi⟩ + have h_4wv := two_wordVal_add_wordValQ_le_four_wordPotV v_w + have hd_hi' : ((b_head : Rat) - 2) - ((b_top : Rat) - 2) * wordScale v_w <= 29 := by linarith + have h_powk_pos : (0 : Rat) < ((2 ^ k : Nat) : Rat) := by exact_mod_cast (pow_two_pos k) + have h_mul_lo : (((b_head : Rat) - 2) - 29) * ((2 ^ k : Nat) : Rat) <= ((b_top : Rat) - 2) * (wordScale v_w * ((2 ^ k : Nat) : Rat)) := by + nlinarith + have h_mul_hi : ((b_top : Rat) - 2) * (wordScale v_w * ((2 ^ k : Nat) : Rat)) <= ((b_head : Rat) - 1) * ((2 ^ k : Nat) : Rat) := by + nlinarith + rw [hz13_vw, mul_one] at h_mul_lo h_mul_hi + have hbh_r : (b_head : Rat) - 2 = (A_top : Rat) * 512 + 34 := by norm_num [b_head, A_top] + have hbh_1_r : (b_head : Rat) - 1 = (A_top : Rat) * 512 + 35 := by norm_num [b_head, A_top] + rw [hbh_r] at h_mul_lo + rw [hbh_1_r] at h_mul_hi + let b_end := 512 * (b_top - 2) + 93 + have hb_end_r : (b_end : Rat) = 512 * ((b_top : Rat) - 2) + 93 := by + dsimp [b_end] + rw [Nat.cast_add, Nat.cast_mul, Nat.cast_sub hb_top] + push_cast; ring + have h_pow_ksh : ((2 ^ (k + 18) : Nat) : Rat) = 262144 * ((2 ^ k : Nat) : Rat) := by + have h_sh : ((2 ^ 18 : Nat) : Rat) = 262144 := by norm_num + rw [Nat.pow_add, Nat.cast_mul, h_sh]; ring + have h_powk_ge1 : (1 : Rat) <= ((2 ^ k : Nat) : Rat) := by exact_mod_cast (pow_two_pos k) + have h_bend_lo_r : (A_top : Rat) * ((2 ^ (k + 18) : Nat) : Rat) < (b_end : Rat) := by + rw [hb_end_r, h_pow_ksh]; linarith + have h_bend_mid_r : (b_end : Rat) <= (A_top : Rat) * ((2 ^ (k + 18) : Nat) : Rat) + 512 * 35 * ((2 ^ k : Nat) : Rat) + 93 := by + rw [hb_end_r, h_pow_ksh]; linarith + have h_bend_hi_r : (b_end : Rat) < ((A_top : Rat) + 1) * ((2 ^ (k + 18) : Nat) : Rat) := by + rw [hb_end_r, h_pow_ksh]; linarith + have h_bend_lo : A_top * 2 ^ (k + 18) < b_end := by exact_mod_cast h_bend_lo_r + have h_bend_mid : b_end <= A_top * 2 ^ (k + 18) + 512 * 35 * 2 ^ k + 93 := by exact_mod_cast h_bend_mid_r + have h_bend_hi : b_end < (A_top + 1) * 2 ^ (k + 18) := by exact_mod_cast h_bend_hi_r + let A_core' := (b_end / 512) % (2 ^ (k + 9)) + have h_Acore'_lt : A_core' < 2 ^ (k + 9) := Nat.mod_lt _ (pow_two_pos (k + 9)) + rcases exists_digitVal_of_lt_pow (k + 9) A_core' h_Acore'_lt with ⟨ds_core', hD_core'⟩ + have h_len_core' := length_of_digitVal hD_core' + have h_bot_mid := digitVal_append zDg_bot hD_core' + have h_all := digitVal_append h_bot_mid zDg_top + have h_len_all : (9 + (k + 9)) + 27 = k + 45 := by omega + have h_pow_ksh_eq : 2 ^ (k + 18) = 512 * 2 ^ (k + 9) := by + have : k + 18 = 9 + (k + 9) := by omega + rw [this, Nat.pow_add] + have h_div_top : b_end / (2 ^ (k + 18)) = A_top := by + have h_pos_ksh : 0 < 2 ^ (k + 18) := pow_two_pos (k + 18) + have h1 := (Nat.le_div_iff_mul_le h_pos_ksh).mpr (le_of_lt h_bend_lo) + have h2 := (Nat.div_lt_iff_lt_mul h_pos_ksh).mpr h_bend_hi + omega + have h_val_all : 93 + A_core' * 2 ^ 9 + A_top * 2 ^ (9 + (k + 9)) = b_end := by + have h1 : 2 ^ 9 = 512 := by decide + have h2 : 2 ^ (9 + (k + 9)) = 512 * 2 ^ (k + 9) := by rw [Nat.pow_add] + rw [h1, h2] + have h_assoc : A_top * (512 * 2 ^ (k + 9)) = 512 * (A_top * 2 ^ (k + 9)) := by ring + rw [h_assoc] + dsimp [A_core'] + have h_div_mb : (b_end / 512) / (2 ^ (k + 9)) = A_top := by + rw [Nat.div_div_eq_div_mul, <- h_pow_ksh_eq, h_div_top] + have h_mod_div := Nat.div_add_mod (b_end / 512) (2 ^ (k + 9)) + rw [h_div_mb, Nat.mul_comm (2 ^ (k + 9)) A_top] at h_mod_div + have h_mod_mb := Nat.div_add_mod b_end 512 + omega + have h_Acore'_le_k : A_core' <= 35 * 2 ^ k := by + have h_eq_db : 2 ^ 9 = 512 := by decide + have h_eq_ksh : 2 ^ (9 + (k + 9)) = 2 ^ (k + 18) := by + have : 9 + (k + 9) = k + 18 := by omega + rw [this] + rw [h_eq_db, h_eq_ksh] at h_val_all + omega + have h_Acore'_dg : A_core' * 512 <= 35 * 2 ^ (k + 9) := by + have h_pow_kdg : 2 ^ (k + 9) = 512 * 2 ^ k := by + have : k + 9 = 9 + k := by omega + rw [this, Nat.pow_add] + omega + rw [h_len_all, h_val_all] at h_all + exact ⟨A_core', ds_core', hD_core', h_len_core', h_Acore'_dg, by simpa [List.append_assoc] using h_all⟩ + +theorem Good_step {u : List Word} (hG : Good u) : + ∃ u', Step u u' ∧ Good u' := by + rcases hG with ⟨p_w, ds_core, A_core, m, rfl, ⟨p_tail, hp_start⟩, hm_def, hm, hD_core, hA_core, hz13, hzW⟩ + have hP_p_ex : ∃ ap gp, Parse a_head p_w ap gp := by + rw [hp_start]; exact Parse_V_start a_head p_tail + rcases hP_p_ex with ⟨ap, gp, hP_p⟩ + have hb_head_ok : 2 + 4 * wordVal p_w < (b_head : Rat) := by + have hz12 := wordValQ_nonneg p_w + have hz10_le := two_wordVal_add_wordValQ_le p_w + have hbh_gt : (31 : Rat) < (b_head : Rat) := by norm_num [b_head] + linarith + rcases Scan_of_Parse hP_p b_head hb_head_ok with ⟨bp, v_p, hS_p, hbp⟩ + have hS_s := Scan_s ap bp hbp + let b_mid0 := 1024 * (bp - 3) + 908 + let ds_mid := [K] ++ ds_core + rcases digitVal_mid hm hD_core hA_core with ⟨A_mid, hD_mid, hA_hi⟩ + have hP_s_all : ∃ a_top g_all, Parse ap (s_full ++ ds_mid) a_top g_all := by + change ∃ a_top g_all, Parse ap (V :: (s_full.tail ++ ds_mid)) a_top g_all + exact Parse_V_start ap _ + rcases hP_s_all with ⟨a_top, g_all, hP_all⟩ + have hP_mid_ex : ∃ g_mid, Parse (2 * (ap + 1)) ds_mid a_top g_mid := by + dsimp [ds_mid] at hP_all ⊢ + exact Parse_s_split hP_all + rcases hP_mid_ex with ⟨g_mid, hP_mid⟩ + have hatop_eq := force_a_top hm hP_p hz13 hzW hD_mid hA_hi hP_mid + subst hatop_eq + have hb_mid0_ok := bound_b_mid0 hm hS_p hbp hz13 hzW rfl hD_mid + rcases Scan_of_Parse hP_mid b_mid0 hb_mid0_ok with ⟨b_top, v_mid, hS_mid, hb_top_ge3⟩ + have hb_top : 2 <= b_top := by omega + have hS_top := Scan_top b_top hb_top + let w_all := p_w ++ s_full ++ ds_mid + let v_w := v_p ++ v_s ++ v_mid + let g_w := gp + 3 + g_mid + have h_ap_eq : 2 * ap + 2 = 2 * (ap + 1) := by omega + rw [h_ap_eq] at hS_s + have hS_w : Scan a_head b_head w_all (2 ^ 21) b_top v_w g_w := by + have h23 := Scan_append hS_p hS_s + have h234 := Scan_append h23 hS_mid + simpa [w_all, v_w, g_w, List.append_assoc, Nat.add_assoc] using h234 + have h_u_rep1 : + (head_w ++ p_w ++ s_base ++ [Q,K,Q,Q,Q,K,Q,K,K] ++ ds_core ++ top_base) ++ List.replicate 0 K = + head_w ++ w_all ++ top_full := by + dsimp [w_all, s_full, ds_mid, top_full, List.replicate] + simp only [List.append_assoc, List.cons_append, List.nil_append] + have hS_full : + Scan 0 126 ((head_w ++ p_w ++ s_base ++ [Q,K,Q,Q,Q,K,Q,K,K] ++ ds_core ++ top_base) ++ List.replicate 0 K) + 0 (512 * (b_top - 2) + 93) (v_head ++ v_w ++ s_base) (0 + g_w + 12) := by + rw [h_u_rep1] + exact Scan_append (Scan_append Scan_head hS_w) hS_top + let k := 1 + 3 * gp + 3 * g_mid + have hk : 1 <= k := by omega + have hWV_vw : wordPotV v_w <= 29 / 4 := + bound_zW_p' hm hS_p hz13 hzW hD_mid hS_mid + have hz13_vw : wordScale v_w * ((2 ^ k : Nat) : Rat) = 1 := by + have h_z13_w := scan_wordScale_eq hS_w + have h_w_eq : wordScale w_all = 256 := by + dsimp only [w_all] + rw [wordScale_append, wordScale_append] + have h_s : wordScale s_full = 1 / 2 := by + have h := checkScalePow_sound s_full 1 0 (by decide) + norm_num at h + linarith + have h_mid := (digitVal_scale_and_val hD_mid).1 + rw [h_s, h_mid] + linarith + rw [h_w_eq] at h_z13_w + have h_3gw : 3 * g_w = k + 8 := by dsimp [g_w, k]; omega + have h_ew : ((2 ^ 8 : Nat) : Rat) = 256 := by norm_num + rw [h_3gw, Nat.pow_add, Nat.cast_mul, h_ew] at h_z13_w + linarith + rcases bound_b_end_digitVal hk hb_top hS_w hz13_vw hWV_vw + with ⟨A_core', ds_core', hD_core', hlen_core', hA_core', hD_bend⟩ + let da := [Q,K,Q,Q,Q,K,Q,K,K] ++ ds_core' ++ top_base + let u' := V :: (v_head ++ v_w ++ s_base ++ da) + refine ⟨u', ⟨0, 512 * (b_top - 2) + 93, v_head ++ v_w ++ s_base, da, k + 45, 0 + g_w + 12, hS_full, hD_bend, rfl⟩, ?_⟩ + let p_w' := V :: v_w + let m' := k + 10 + refine ⟨p_w', ds_core', A_core', m', ?_, ⟨v_w, rfl⟩, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · dsimp only [u', p_w', da, v_head, head_w] + simp only [List.cons_append, List.nil_append, List.append_assoc] + · dsimp [m']; omega + · dsimp [m']; omega + · have h_m'_sub : m' - 1 = k + 9 := by omega + rw [h_m'_sub]; exact hD_core' + · have h_m'_sub : m' - 1 = k + 9 := by omega + rw [h_m'_sub]; exact hA_core' + · dsimp only [p_w', m', wordScale] + have h_m'_split : k + 10 = k + 1 + 9 := by omega + have h1 : ((2 ^ 1 : Nat) : Rat) = 2 := by norm_num + have h_ep : ((2 ^ 9 : Nat) : Rat) = 512 := by norm_num + rw [h_m'_split, Nat.pow_add, Nat.pow_add, Nat.cast_mul, Nat.cast_mul, h1, h_ep] + linarith + · dsimp only [p_w'] + rw [wordPot_cons_V] + exact hWV_vw + +theorem reach_N (m : Nat) : + ∃ N, m <= N ∧ ∃ u, + multiStep tm (init []) N = some (zCf (evalWords u default)) ∧ + Good u := by + induction m with + | zero => + rcases init_to_u0 with ⟨k1, hk1⟩ + rcases Rounds_exec rounds_0_13 with ⟨k2, hk2⟩ + exact ⟨k1 + k2, Nat.zero_le _, u_13, multiStep_trans_vkq tm _ _ _ k1 k2 hk1 hk2, good_u13⟩ + | succ m ih => + rcases ih with ⟨N, hN, u, h_ms, hG⟩ + rcases Good_step hG with ⟨u', hStep, hG'⟩ + rcases Step_exec hStep with ⟨k, hk_pos, h_step_k⟩ + exact ⟨N + k, Nat.add_le_add hN hk_pos, u', multiStep_trans_vkq tm _ _ _ N k h_ms h_step_k, hG'⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n, hn⟩ + rcases reach_N (n + 1) with ⟨N, hN, _, h_N, _⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := multiStep_add_intermediate_vkq h_N + rw [multiStep_succ_vkq, hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RA_1RC0RC_1LD0LE_1RA1LC_1LC1LF_0LCHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RA_1RC0RD_1LD1LE_1LF0LC_0LDHHH_1RA1LD.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1RC0RD_1LD1LE_1LF0LC_0LDHHH_1RA1LD.lean new file mode 100644 index 00000000..ed0ce99e --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1RC0RD_1LD1LE_1LF0LC_0LDHHH_1RA1LD.lean @@ -0,0 +1,269 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusF +public import BusyBeaver.Calculi.WordCalculusG +public import BusyBeaver.Calculi.WordCalculusH + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RA_1RC0RD_1LD1LE_1LF0LC_0LDHHH_1RA1LD + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1RC0RD_1LD1LE_1LF0LC_0LDHHH_1RA1LD" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 3 +abbrev D : Fin 6 := 2 +abbrev E : Fin 6 := 5 +abbrev F : Fin 6 := 4 +@[reducible] def tm : Machine (Fin 2) (Fin 6) := target_tm +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 2000000 + +open WordVKQ Word WordVKQ.Traj114 + +abbrev evalCCfgVKQ (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev z0b (c : CCfg) : Option CCfg := Counter.bstep tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (evalCCfgVKQ c1) [tm]⊢⁺ (evalCCfgVKQ c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ + +abbrev pref24 : BitWord := [0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0] + + +def zCs : Call -> Fin 6 + | .ch => E + | .ca => C + +def zCR (w : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (w <{{zCs c}} ([1] +> r)) + +def zCL (w : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> w) {{A}}> r) + +def zCf (w : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> pref24 +> w) {{A}}> default) + +abbrev callStep (c : Call) (w1 w2 : HalfTape) : Prop := + ∀ r, (zCR w1 c r) [tm]⊢⁺ (zCL w2 r) + +abbrev Side := SideP callStep +abbrev Seg := SegP callStep + +theorem seg_ch_V : Seg [.ch] [.ch, .ch] V_u V_u := + segP_of_step_two (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (fun u r => by unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_V : Seg [.ca] [.ch] V_u Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Vp : Seg [.ca] [.ca, .ca] Vp Vp := + segP_of_step_two (mid1 := [0, 1, 1, 1]) (mid2 := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_K : Seg [.ch] [] K_u Q_u := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs K_u Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_Q : Seg [.ch] [.ch] Q_u K_u := + segP_of_step_one (mid := [1, 1]) + (fun u r => by unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL K_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_VpQ : Seg [.ca] [.ca] (Vp ++ Q_u) (Kp ++ Vp) := + segP_of_step_one (mid := [0, 1, 0, 1, 1, 1]) + (fun u r => by unfold zCR zCs Vp Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_KpVp : Seg [.ca] [] (Kp ++ Vp) (Qp ++ Vp) := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs Kp Vp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_QpVp : Seg [.ca] [.ca, .ca] (Qp ++ Vp) (Kp ++ Vp) := + segP_of_step_two (mid1 := [0, 1, 1, 1, 1, 1]) (mid2 := [0, 1, 0, 1, 1, 1]) + (fun u r => by unfold zCR zCs Qp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Kp : Seg [.ca] [] Kp Qp := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs Kp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Qp : Seg [.ca] [.ca] Qp Kp := + segP_of_step_one (mid := [1, 1]) + (fun u r => by unfold zCR zCs Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_KQ : Seg [.ca] [] (K_u ++ Q_u) Vp := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs K_u Q_u Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_QQ : Seg [.ca] [.ca] (Q_u ++ Q_u) Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +-- Turnaround zP0..zP6 +abbrev tr1 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1] +abbrev tr2 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1] +abbrev tr3 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1] +abbrev tr4 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1] +abbrev tr5 : BitWord := [0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1] +abbrev tr6 : BitWord := [0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1] + +theorem zP0 (w : HalfTape) : (zCf w) [tm]⊢⁺ (zCR w .ca (tr1 +> default)) := by + unfold zCf zCR zCs pref24 tr1 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP1 (w : HalfTape) : (zCL w (tr1 +> default)) [tm]⊢⁺ (zCR w .ca (tr2 +> default)) := by + unfold zCL zCR zCs tr1 tr2 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP2 (w : HalfTape) : (zCL w (tr2 +> default)) [tm]⊢⁺ (zCR w .ca (tr3 +> default)) := by + unfold zCL zCR zCs tr2 tr3 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP3 (w : HalfTape) : (zCL w (tr3 +> default)) [tm]⊢⁺ (zCR w .ca (tr4 +> default)) := by + unfold zCL zCR zCs tr3 tr4 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP4 (w : HalfTape) : (zCL w (tr4 +> default)) [tm]⊢⁺ (zCR w .ca (tr5 +> default)) := by + unfold zCL zCR zCs tr4 tr5 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP5 (w : HalfTape) : (zCL w (tr5 +> default)) [tm]⊢⁺ (zCR w .ca (tr6 +> default)) := by + unfold zCL zCR zCs tr5 tr6 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP6 (w : HalfTape) : (zCL w (tr6 +> default)) [tm]⊢⁺ (zCf ([1, 1, 0] +> w)) := by + unfold zCL zCf tr6 pref24 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +-- Section 2: Words, Shift Identity, DigitVal, Parse, Scan, Step +theorem segSpec : SegSpec callStep := + ⟨seg_ch_V, seg_ca_V, seg_ca_Vp, seg_ch_K, seg_ch_Q, + seg_ca_VpQ, seg_ca_KpVp, seg_ca_QpVp, seg_ca_Kp, seg_ca_Qp, + seg_ca_KQ, seg_ca_QQ⟩ + +theorem Side_turnaround {w w' : HalfTape} (h : Side ([Call.ca] ^ 6) w w') : + (zCf w) [tm]⊢⁺ (zCf ([1, 1, 0] +> w')) := by + rcases h with _ | ⟨hc1, h⟩ + rcases h with _ | ⟨hc2, h⟩ + rcases h with _ | ⟨hc3, h⟩ + rcases h with _ | ⟨hc4, h⟩ + rcases h with _ | ⟨hc5, h⟩ + rcases h with _ | ⟨hc6, h⟩ + cases h + exact stepPlus_trans_vkq (zP0 w) + (stepPlus_trans_vkq (hc1 (tr1 +> default)) + (stepPlus_trans_vkq (zP1 _) + (stepPlus_trans_vkq (hc2 (tr2 +> default)) + (stepPlus_trans_vkq (zP2 _) + (stepPlus_trans_vkq (hc3 (tr3 +> default)) + (stepPlus_trans_vkq (zP3 _) + (stepPlus_trans_vkq (hc4 (tr4 +> default)) + (stepPlus_trans_vkq (zP4 _) + (stepPlus_trans_vkq (hc5 (tr5 +> default)) + (stepPlus_trans_vkq (zP5 _) + (stepPlus_trans_vkq (hc6 (tr6 +> default)) (zP6 w')))))))))))) + +theorem Step_exec {u u' : List Word} (h : Step u u') : + (zCf (evalWords u default)) [tm]⊢⁺ (zCf (evalWords u' default)) := by + rcases h with ⟨n, b', v, da, H, g, hScan, hDg, rfl⟩ + have hSeg := Seg_of_Scan segSpec hScan + dsimp at hSeg + have hSide0 := sideP_of_segP hSeg (Side_ca_default segSpec hDg) + rw [wordsToBits_append_tape, evalWords_append, evalWords_replicate_K, wordsToBitsShifted_append_tape, <- evalWordsShifted_append] at hSide0 + have hTurn := Side_turnaround hSide0 + rwa [evalWords_V_shift] at hTurn + +theorem Rounds_exec {u v : List Word} (h : Rounds u v) : + (zCf (evalWords u default)) [tm]⊢* (zCf (evalWords v default)) := by + induction h with + | refl _ => exact ⟨0, rfl⟩ + | next hS _ ih => exact stepStar_of_stepPlus_vkq (stepPlus_stepStar_trans_vkq (Step_exec hS) ih) + +-- Section 3: Universal Parse_V_start, Scan_of_Parse, and Trace Evaluators + +def zInitCCfg : CCfg := ⟨0, 0, [], []⟩ +def zHit5CCfg : CCfg := ⟨0, 0, [0,0,1,1,0,1,1,0,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,0,1,0,1], []⟩ + +set_option maxRecDepth 200000 in +theorem zCm_init_1071 : zCm zInitCCfg 1071 = some zHit5CCfg := by decide + +theorem init_to_u0 : (init []) [tm]⊢* zCf (evalWords u_0 default) := by + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = evalCCfgVKQ zInitCCfg := rfl + have h1 : evalCCfgVKQ zHit5CCfg = zCf (evalWords u_0 default) := by + dsimp [evalCCfgVKQ, zHit5CCfg, zCf, pref24, u_0, evalWords, V_u, K_u, Q_u] + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + have hPlus := zTc (by decide : 0 < 1071) zCm_init_1071 + rw [<- h0, h1] at hPlus + exact stepStar_of_stepPlus_vkq hPlus + +-- 14 finite rounds u_0 -> u_14 +theorem reach_N (m : Nat) : + ∃ N, m <= N ∧ ∃ u, + multiStep tm (init []) N = some (zCf (evalWords u default)) ∧ + Good u := by + induction m with + | zero => + rcases init_to_u0 with ⟨k1, hk1⟩ + rcases Rounds_exec rounds_0_14 with ⟨k2, hk2⟩ + exact ⟨k1 + k2, Nat.zero_le _, u_14, multiStep_trans_vkq tm _ _ _ k1 k2 hk1 hk2, good_u14⟩ + | succ m ih => + rcases ih with ⟨N, hN, u, h_ms, hG⟩ + rcases Good_step hG with ⟨u', hStep, hG'⟩ + rcases Step_exec hStep with ⟨k, hk_pos, h_step_k⟩ + exact ⟨N + k, Nat.add_le_add hN hk_pos, u', multiStep_trans_vkq tm _ _ _ N k h_ms h_step_k, hG'⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n, hn⟩ + rcases reach_N (n + 1) with ⟨N, hN, _, h_N, _⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := multiStep_add_intermediate_vkq h_N + rw [multiStep_succ_vkq, hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RA_1RC0RD_1LD1LE_1LF0LC_0LDHHH_1RA1LD diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RA_1RC0RE_1RDHHH_1LE1LD_1LF0LD_1RA1LE.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1RC0RE_1RDHHH_1LE1LD_1LF0LD_1RA1LE.lean new file mode 100644 index 00000000..19eaf357 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RA_1RC0RE_1RDHHH_1LE1LD_1LF0LD_1RA1LE.lean @@ -0,0 +1,999 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RA_1RC0RE_1RDHHH_1LE1LD_1LF0LD_1RA1LE + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1RC0RE_1RDHHH_1LE1LD_1LF0LD_1RA1LE" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +set_option maxRecDepth 2000000 +@[simp] theorem _vault_listblank_mk_empty {Γ : Type*} [Inhabited Γ] : + Turing.ListBlank.mk ([] : List Γ) = default := by + ext n; cases n <;> rfl +@[simp] theorem _vault_listblank_mk_cons {Γ : Type*} [Inhabited Γ] (x : Γ) (xs : List Γ) : + Turing.ListBlank.mk (x :: xs) = Turing.ListBlank.cons x (Turing.ListBlank.mk xs) := by + ext n; cases n <;> rfl + + +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +abbrev holdout_0549_tm : Machine (Fin 2) (Fin 6) := target_tm +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 2000000 +set_option maxRecDepth 2000000 +@[simp] theorem zMz (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : HalfTape).head = 0 := rfl +@[simp] theorem zDt : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem zPs {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem zPt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,by omega,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ +local macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +local macro "gstep" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt]) +local macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | gstep))) +abbrev t : BitWord := [1,1,0,0] +abbrev d0 : BitWord := [0,0] +abbrev d1 : BitWord := [1,0] +abbrev one : BitWord := [1] +abbrev lh : HalfTape := [1,0,1] +> default +abbrev w_word : BitWord := t ++ one +abbrev w_pre : BitWord := w_word +@[simp] theorem zDd : d0 +> (default : HalfTape) = default := by + simp [d0] +inductive Call where + | ch + | cj + | cp + | ca +def zCs : Call -> Fin 6 + | .ch => F + | .cj => E + | .cp => E + | .ca => F +def zCw : Call -> BitWord + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] + | .ca => [1,1,1,0,1,1] +def zCR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (r <{{zCs c}} (l <+ zCw c)) +def zCL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> r) {{A}}> l) +def zCf (q : Nat) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + zCL lh ((w_pre ++ (t ^ (2 + q) ++ (d1 ++ one))) +> r) +def z04 (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l,(zCR l c r1) [holdout_0549_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + z04 c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem z05 {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z06 {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem z07 {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z08 {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z09 {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0a (w : BitWord) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem z0b (ls : List Call) : Seg ls ls [] [] := by + intro r1 r2 h; simpa using! h +theorem zSc {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases z09 h with ⟨r2,ha,hb⟩ + exact z08 (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS0 {ls1 ls2 ls3 : List Call} {u1 u2 v1 v2 : BitWord} + (h1 : Seg ls1 ls2 u1 u2) (h2 : Seg ls2 ls3 v1 v2) : + Seg ls1 ls3 (u1 ++ v1) (u2 ++ v2) := by + intro r1 r2 h + rw [append_assoc u1 v1 r1,append_assoc u2 v2 r2] + exact h1 (v1 +> r1) (v2 +> r2) (h2 r1 r2 h) +theorem zS4 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [holdout_0549_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [holdout_0549_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [holdout_0549_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc1 (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [holdout_0549_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [holdout_0549_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [holdout_0549_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem z0c : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons,append_nil]; execute) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0d : Seg [.cp] [.ch] t (t ++ [0]) := + zS2 (mid := [1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0e : Seg [.ch] [.cj] (t ++ [0]) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0f : Seg [.cj] [.ch] t (t ++ one) := + zS2 (mid := [1,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0g : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0h : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1 d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0i : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0j : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0k : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0l : Seg [.cj] [.cp] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0m : Seg [.ca] [.cj,.ch] w_word (w_word ++ t) := + zS5 (mid1 := [1,0,1,1,1,1,0,1,1]) (mid2 := [1,0,1,0,1,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs w_word t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL w_word t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0n (r : HalfTape) : + (zCL lh r) [holdout_0549_tm]⊢⁺ (zCR lh .ca r) := by + unfold zCL zCR lh zCw zCs + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute +theorem H_T (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact z0a t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [zLp,h_eq,z07] + exact zSg z0c ih +theorem zSa {w2 : BitWord} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact z0a w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq,z07,zLp] + exact zSg hw ih +theorem z0o : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0p : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem z0q (n : Nat) : Seg ([.ch] ^ (n * 2)) ([.ch] ^ n) d0 d0 := + zSa z0o n +theorem z0r (n : Nat) : Seg ([.ch] ^ (1 + n * 2)) ([.ch] ^ n) d0 d1 := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg zH0 (zSa z0p n) +theorem z0s (n : Nat) : Seg ([.ch] ^ (n * 2)) ([.ch] ^ n) d1 d1 := + zSa z0p n +theorem z0t (n : Nat) : Seg ([.ch] ^ (1 + n * 2)) ([.ch] ^ (1 + n)) d1 d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg zH4 (z0q n) +theorem z0u (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0d z0e) (H_T n) +theorem z0v (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0f zH2) (H_T n) +theorem z0w (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0g zH2) (H_T n) +theorem z0x (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0h (H_T n) +theorem z0y (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0i (H_T n) +theorem z0z (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [zLp',List.cons_append,List.nil_append] using! zSg z0j (H_T n) +theorem z0A (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0k (zSg zH1 zH3) + have h1 := zSg h0 (z0q n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using! h1 +theorem z0B (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0l (z0q n) +theorem z0C : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0k zH1 +theorem z0D (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0k (zSg zH1 (zSg zH3 zH0)) + have h1 := zSg h0 (z0s n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using! h1 +theorem z0E (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg [.cj,.ch] [.cp] d1 d1 := zSg z0l zH0 + have h1 := zSg h0 (z0s n) + simpa only [zLp',List.cons_append,List.nil_append] using! h1 +theorem z0F (n : Nat) : Seg ([.ch] ^ n ++ [.cj,.ch]) ([.ch] ^ (1 + n * 2) ++ [.cj,.ch]) t t := by + have h1 := zSg (H_T n) (z0v 0) + have heq : 1 + n * 2 = n * 2 + 1 := by omega + rw [heq,z07] + simpa only [z06,List.append_assoc,List.cons_append,List.nil_append] using! h1 +theorem z0G (n : Nat) : Seg ([.ch] ^ (1 + n * 2)) ([.cj] ++ [.ch] ^ n) (d1 ++ one) d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg zH3 (z0q n) +theorem z0H (n : Nat) : Seg ([.ch] ^ (1 + n * 2) ++ [.cj,.ch]) ([.cj] ++ [.ch] ^ n) + (d1 ++ one) (d1 ++ one) := by + simpa only [List.append_nil] using! zSg (z0G n) z0C +theorem z0I (q : Nat) : ∀ n,Seg ([.ch] ^ n ++ [.cj,.ch]) + ([.ch] ^ ((1 + n) * 2 ^ q - 1) ++ [.cj,.ch]) (t ^ q) (t ^ q) := by + induction q with + | zero => + intro n + have heq : (1 + n) * 2 ^ 0 - 1 = n := by omega + rw [heq]; exact z0b _ + | succ q ih => + intro n + have heq : (1 + n) * 2 ^ (q + 1) - 1 = (1 + (1 + n * 2)) * 2 ^ q - 1 := by + rw [Nat.pow_succ]; ring_nf + rw [zLp,heq] + exact zS0 (z0F n) (ih (1 + n * 2)) +open WordCalculus Word ChoiceE +local notation "WordList" => List Word +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) +theorem loc_z2t {k : Nat} (hK : 0 < k) : ∃ hs,Num k [] hs := by + rcases even_or_odd_mul_two k with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · cases a with + | zero => omega + | succ a => + have heq : (a + 1) * 2 = 2 + a * 2 := by omega + rw [heq]; exact ⟨[.cj] ++ [.ch] ^ a,Num.even a⟩ + · exact ⟨[.cp] ++ [.ch] ^ a,Num.odd a⟩ +theorem loc_z2u {k : Nat} {hs hs' : List Call} (h1 : Num k [] hs) (h2 : Num k [] hs') : + hs = hs' := by + cases h1 with + | @odd n => + generalize hk : 1 + n * 2 = k0 at h2 + cases h2 with + | @odd m => + have hnm : n = m := by omega + subst hnm; rfl + | even _ => omega + | @even n => + generalize hk : 2 + n * 2 = k0 at h2 + cases h2 with + | odd _ => omega + | @even m => + have hnm : n = m := by omega + subst hnm; rfl +def loc_z2v (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs,Num k w hs -> Side hs (w +> r) r' +theorem loc_z2w {r r' : HalfTape} (h : loc_z2v 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl +theorem loc_z2x {n : Nat} {r r' : HalfTape} + (hI : loc_z2v (n * 2) r r') : loc_z2v (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2w hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0k (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine zSc (z0A n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using! hI [] _ hN2 +theorem loc_z2y {n : Nat} {r r' : HalfTape} + (hI : loc_z2v (n * 2) r r') : loc_z2v (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2w hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0C (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine zSc (z0D n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using! hI [] _ hN2 +theorem loc_z2z {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hZ : A = 0) : + evalWords da default = default := by + induction hD with + | nil => rfl + | @zero A H u _ ih => + have hA0 : A = 0 := by omega + rw [evalWords,ih hA0,zDd] + | one _ => omega +theorem loc_z2A {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hPos : 0 < A) : + loc_z2v ((A - 1) * 2) default (evalWords da default) := by + induction hD with + | nil => omega + | @zero A H u _ ih => + have hA_pos : 0 < A := by omega + have hIH := ih hA_pos + have hs := loc_z2x hIH + rw [zDd] at hs + have heq : (A * 2 - 1) * 2 = 2 + (A - 1) * 4 := by omega + rw [evalWords] + rwa [heq] + | @one A H u hDu ih => + cases A with + | zero => + have h_side : evalWords (Q :: u) default = one +> default := by + rw [evalWords,loc_z2z hDu rfl] + simp [d1,one] + rw [h_side] + intro w hs hN + have hk0 : (1 + 0 * 2 - 1) * 2 = 0 := rfl + rw [hk0] at hN + generalize hk : (0 : Nat) = k0 at hN + cases hN with + | zero => exact Side.nil (one +> default) + | odd _ => omega + | even _ => omega + | succ A => + have hA_pos : 0 < A + 1 := by omega + have hIH := ih hA_pos + have heq_in : (A + 1 - 1) * 2 = A * 2 := by omega + rw [heq_in] at hIH + have hs := loc_z2y hIH + rw [zDd] at hs + have heq : (1 + (A + 1) * 2 - 1) * 2 = 4 + A * 4 := by omega + rw [evalWords] + rwa [heq] +theorem zEd {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ∀ {A H : Nat},DigitVal A H v -> Seg ([Call.ch] ^ n) ([Call.ch] ^ b) (wordsToBits u) (wordsToBits v) := by + induction hI with + | nil n => + intro A H _ + exact z0b _ + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | d00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0q _) (ih hD') + | d01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0r _) (ih hD') + | d10 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0s _) (ih hD') + | d11 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0t _) (ih hD') +theorem loc_z2B {n : Nat} {hs hs' : List Call} + (hI : Num (3 + n) [] hs) (hJ : Num (2 + n * 2) [] hs') : + Seg hs ([Call.ch] ++ hs') t t := by + generalize hk1 : 3 + n = k1 at hI + generalize hk2 : 2 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = m * 2 := by omega + subst hq + rw [h1m] + exact z0u m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0v m +theorem loc_z2C {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' (d1 ++ d0) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0w m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + have hq : q = m * 2 := by omega + subst hq + exact z0x m +theorem loc_z2D {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' (d1 ++ d1) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | @odd q => + have hq : q = m * 2 := by omega + subst hq + exact z0y m + | even _ => omega + | @even m => + cases hJ with + | @odd q => + have hq : q = 1 + m * 2 := by omega + subst hq + exact z0z m + | even _ => omega +theorem loc_z2E {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 2 + q * 2 := by omega + subst hm + exact z0A q +theorem loc_z2F {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = q * 2 := by omega + subst hm + exact z0B q + | even _ => omega +theorem loc_z2G {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 3 + q * 2 := by omega + subst hm + exact z0D q +theorem loc_z2H {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = 1 + q * 2 := by omega + subst hm + exact z0E q + | even _ => omega +theorem loc_z2I {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) : + ∀ {u : WordList} {n n' : Nat} {hs hs' : List Call}, + WordEffect n u n' v -> Num k [] hs -> Num k' [] hs' -> + Seg (([Call.ch] ^ n) ++ hs) (([Call.ch] ^ n') ++ hs') (wordsToBits u) (wordsToBits w) := by + induction hI with + | nil k => + intro u n n' hs hs' hE hN hN' + cases hE + rw [loc_z2u hN hN'] + exact z0b _ + | @T m _ _ _ _ _ _ ih => + intro u0 n0 n1 hs hs' hE hN hN' + cases hE with + | T hSub => + rcases loc_z2t (by omega : 0 < 2 + m * 2) with ⟨hs0,hN0⟩ + have hIH := ih hSub hN0 hN' + have hStep := zSg (H_T n0) (loc_z2B hN hN0) + have heq : ([Call.ch] ^ (n0 * 2)) ++ ([Call.ch] ++ hs0) = ([Call.ch] ^ (1 + n0 * 2)) ++ hs0 := by + have h1 : 1 + n0 * 2 = n0 * 2 + 1 := by omega + rw [h1,z07,z06,List.append_assoc] + rw [heq] at hStep + exact zS0 hStep hIH + | @pair0 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,K] ++ u) at hE + rcases wordEffect_split_output [Q,K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD10 : DigitVal 1 2 [Q,K] := DigitVal.one (DigitVal.zero DigitVal.nil) + have hStep := zSg (zEd hL hD10) (loc_z2C hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @pair1 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,Q] ++ u) at hE + rcases wordEffect_split_output [Q,Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD11 : DigitVal 3 2 [Q,Q] := DigitVal.one (DigitVal.one DigitVal.nil) + have hStep := zSg (zEd hL hD11) (loc_z2D hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short00 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (loc_z2E hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short01 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (loc_z2F hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short10 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (loc_z2G hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short11 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (loc_z2H hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') +theorem loc_z2J {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) {u : WordList} {r r' : HalfTape} + (hE : WordEffect 0 u 0 v) (hK : 0 < k') (hC : loc_z2v k' r r') : + loc_z2v k (evalWords u r) (evalWords w r') := by + intro w0 hs hN + have hPosK : 0 < k := phaseScan_pos_of_out_pos hI hK + have hw0 : w0 = [] := by + cases hN with + | zero => omega + | odd _ => rfl + | even _ => rfl + subst hw0 + rcases loc_z2t hK with ⟨hs',hN'⟩ + have hSeg := loc_z2I hI hE hN hN' + dsimp at hSeg + have hSide := zSc hSeg (hC [] hs' hN') + rwa [wordsToBits_append_tape,wordsToBits_append_tape] at hSide +theorem loc_z2K {q : Nat} {orig out : WordList} (hS : EStep q orig out) : + loc_z2v (4 * 2 ^ q) (evalWords orig default) (evalWords out default) := by + rcases hS with ⟨eff,n,v,a0,b0,J,da,hE,hI,hPos,hDA⟩ + have hBlank : evalWords [K] default = default := by simp [evalWords,d0] + have hC : loc_z2v (n * 2) default (evalWords da default) := by + have heq : n * 2 = ((1 + n) - 1) * 2 := by omega + rw [heq] + exact loc_z2A hDA (by omega) + have hRun := loc_z2J hI hE (by omega : 0 < n * 2) hC + rwa [evalWords_append,hBlank,<- evalWords_append] at hRun +theorem loc_z2L (q : Nat) : + Seg [.cj,.ch] ([.cj] ++ [.ch] ^ (2 ^ q - 1)) (t ^ (1 + q) ++ (d1 ++ one)) (t ^ (1 + q) ++ (d1 ++ one)) := by + have hpos := pow_two_pos q + have hT := z0I (1 + q) 0 + have heq : (1 + 0) * 2 ^ (1 + q) - 1 = 1 + (2 ^ q - 1) * 2 := by + rw [pow_two_one_add]; omega + rw [heq] at hT + dsimp at hT + exact zS0 hT (z0H (2 ^ q - 1)) +theorem loc_z2M (q : Nat) : + Seg [.ca] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) + (w_pre ++ (t ^ (2 + q) ++ (d1 ++ one))) + (w_pre ++ (t ^ (2 + (q + 1)) ++ (d1 ++ one))) := by + have h1 := zS0 z0m (loc_z2L (1 + q)) + have heq1 : 1 + (1 + q) = 2 + q := by omega + have heq2 : (w_pre ++ t) ++ (t ^ (2 + q) ++ (d1 ++ one)) = w_pre ++ (t ^ (2 + (q + 1)) ++ (d1 ++ one)) := by + have h3 : 2 + (q + 1) = 1 + (2 + q) := by omega + rw [h3,zLp'] + simp only [List.append_assoc] + rw [heq1] at h1 + rwa [heq2] at h1 +theorem loc_z2N (q : Nat) {r r' : HalfTape} (hI : loc_z2v (4 * 2 ^ q) r r') : + (zCf q r) [holdout_0549_tm]⊢⁺ zCf (q + 1) r' := by + have hpos := pow_two_pos q + have h_num : Num (4 * 2 ^ q) [] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) := by + have heq : 4 * 2 ^ q = 2 + (2 ^ (1 + q) - 1) * 2 := by rw [pow_two_one_add]; omega + rw [heq]; exact Num.even (2 ^ (1 + q) - 1) + have hC := hI [] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) h_num + have hS := zSc (loc_z2M q) hC + rcases hS with _ | ⟨hca,hnil⟩ + cases hnil + exact zPt (z0n _) (hca lh) +theorem loc_z2O {q : Nat} {orig out : WordList} (hS : EStep q orig out) : + (zCf q (evalWords orig default)) [holdout_0549_tm]⊢⁺ zCf (q + 1) (evalWords out default) := + loc_z2N q (loc_z2K hS) +theorem loc_z2P {h : Nat} {u : WordList} {j : Nat} {v : WordList} (hR : ERounds h u j v) : + (zCf h (evalWords u default)) [holdout_0549_tm]⊢* zCf j (evalWords v default) := by + induction hR with + | refl _ _ => exact ⟨0,rfl⟩ + | next hS _ ih => + rcases loc_z2O hS with ⟨n,_,hn⟩ + rcases ih with ⟨m,hm⟩ + exact ⟨n + m,zMt holdout_0549_tm _ _ _ n m hn hm⟩ +def loc_z2Q : WordList := [V,Q,Q,V,V,Q,V,Q,V,V,V,K,V,V,K,K,Q,K,K,K,Q,K,Q] +abbrev CCfg := Counter.CCfg (Fin 2) (Fin 6) +abbrev CCfg.head (c : CCfg) : Fin 2 := c.cur +abbrev CCfg.left (c : CCfg) : List (Fin 2) := c.l +abbrev CCfg.right (c : CCfg) : List (Fin 2) := c.r +abbrev loc_z2R (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev loc_z2Y (c : CCfg) : Option CCfg := Counter.bstep holdout_0549_tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep holdout_0549_tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (loc_z2R c1) [holdout_0549_tm]⊢⁺ (loc_z2R c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ +def loc_z31 : CCfg := + ⟨A,0,[],[]⟩ +def loc_z32 : CCfg := + ⟨E,0,[0,0,0,1,1,0,0,1,1],[1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def loc_z33 : CCfg := + ⟨F,1,[1,0,0,1,0,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,0,0,1],[1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def loc_z34 : CCfg := + ⟨B,1,[1,0,0,1,0,1],[1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z35 : CCfg := + ⟨A,0,[0,0,1,1,1,0,0,1,0,1,1,0,0,1,0,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,0,0,1,0,1,0,0,0,1],[1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z36 : CCfg := + ⟨A,1,[1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,1,0,1,1,0,0,1,1,1,0,0,1,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,1],[1,0,1,1,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def loc_z37 : CCfg := + ⟨E,0,[0,1,0,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,1],[1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def loc_z38 : CCfg := + ⟨E,0,[1,0,1,0,1],[1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def loc_z39 : CCfg := + ⟨A,1,[1,0,0,0,0,0,1,0,1,0,1],[1,0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def loc_z3a : CCfg := + ⟨A,1,[0,0,1,1,0,0,1,1,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1],[1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3b : CCfg := + ⟨E,0,[0,1,0,0,0,0,1,0,1,0,1,0,0,0,1,0,1],[1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3c : CCfg := + ⟨A,0,[0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1],[1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3d : CCfg := + ⟨A,1,[0,0,1,1,0,0,1,0,1,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1],[1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3e : CCfg := + ⟨E,1,[0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,1],[1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3f : CCfg := + ⟨E,0,[0,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,1,0,1,0,1,0,0,0,1,0,1],[1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3g : CCfg := + ⟨E,0,[0,1,0,0,0,0,1,0,1,0,0,0,1,0,1,0,1,0,1],[1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3h : CCfg := + ⟨E,1,[0,0,1,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1],[1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3i : CCfg := + ⟨E,0,[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,1],[1,0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3j : CCfg := + ⟨A,1,[0,1,1,0,0,1,0,1,1,1,0,0,1,0,1,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1],[0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3k : CCfg := + ⟨A,1,[0,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,1,0,0,1,0,1,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1],[0,1]⟩ +set_option maxRecDepth 500000 in +theorem loc_z3l : zCm loc_z31 1000 = some loc_z32 := by decide +set_option maxRecDepth 500000 in +theorem loc_z3m : zCm loc_z32 1000 = some loc_z33 := by decide +set_option maxRecDepth 500000 in +theorem loc_z3n : zCm loc_z33 1000 = some loc_z34 := by decide +set_option maxRecDepth 500000 in +theorem loc_z3o : zCm loc_z34 1000 = some loc_z35 := by decide +set_option maxRecDepth 500000 in +theorem z3p : zCm loc_z35 1000 = some loc_z36 := by decide +set_option maxRecDepth 500000 in +theorem z3q : zCm loc_z36 1000 = some loc_z37 := by decide +set_option maxRecDepth 500000 in +theorem z3r : zCm loc_z37 1000 = some loc_z38 := by decide +set_option maxRecDepth 500000 in +theorem z3s : zCm loc_z38 1000 = some loc_z39 := by decide +set_option maxRecDepth 500000 in +theorem z3t : zCm loc_z39 1000 = some loc_z3a := by decide +set_option maxRecDepth 500000 in +theorem z3u : zCm loc_z3a 1000 = some loc_z3b := by decide +set_option maxRecDepth 500000 in +theorem z3v : zCm loc_z3b 1000 = some loc_z3c := by decide +set_option maxRecDepth 500000 in +theorem z3w : zCm loc_z3c 1000 = some loc_z3d := by decide +set_option maxRecDepth 500000 in +theorem z3x : zCm loc_z3d 1000 = some loc_z3e := by decide +set_option maxRecDepth 500000 in +theorem z3y : zCm loc_z3e 1000 = some loc_z3f := by decide +set_option maxRecDepth 500000 in +theorem loc_z3z : zCm loc_z3f 1000 = some loc_z3g := by decide +set_option maxRecDepth 500000 in +theorem loc_z3A : zCm loc_z3g 1000 = some loc_z3h := by decide +set_option maxRecDepth 500000 in +theorem loc_z3B : zCm loc_z3h 1000 = some loc_z3i := by decide +set_option maxRecDepth 500000 in +theorem loc_z3C : zCm loc_z3i 1000 = some loc_z3j := by decide +set_option maxRecDepth 500000 in +theorem loc_z3D : zCm loc_z3j 53 = some loc_z3k := by decide +theorem loc_z3E : + (init []) [holdout_0549_tm]⊢⁺ zCf 5 (evalWords loc_z2Q default) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = loc_z2R loc_z31 := rfl + have h_end : loc_z2R loc_z3k = zCf 5 (evalWords loc_z2Q default) := by + simp [loc_z2R,loc_z3k,zCf,zCL,lh,w_pre,w_word,t,d0,d1,one,loc_z2Q,evalWords] + rw [h_init,<- h_end] + exact zPt (zTc (by decide) loc_z3l) (zPt (zTc (by decide) loc_z3m) (zPt (zTc (by decide) loc_z3n) (zPt (zTc (by decide) loc_z3o) (zPt (zTc (by decide) z3p) (zPt (zTc (by decide) z3q) (zPt (zTc (by decide) z3r) (zPt (zTc (by decide) z3s) (zPt (zTc (by decide) z3t) (zPt (zTc (by decide) z3u) (zPt (zTc (by decide) z3v) (zPt (zTc (by decide) z3w) (zPt (zTc (by decide) z3x) (zPt (zTc (by decide) z3y) (zPt (zTc (by decide) loc_z3z) (zPt (zTc (by decide) loc_z3A) (zPt (zTc (by decide) loc_z3B) (zPt (zTc (by decide) loc_z3C) ((zTc (by decide) loc_z3D))))))))))))))))))) +def loc_z3F : List CodeE := [ + (.More CT 125 (.More CS10 62 (.More CS10 30 (.More CT 57 (.More CT 113 (.More CS10 56 (.More CT 109 (.More CS10 54 (.More CT 105 (.More CT 209 (.More CT 417 (.More CS11 208 (.More CT 414 (.More CT 827 (.More CS11 413 (.More CP0 826 (.More CS10 412 (.More CS10 205 (.More CP0 409 (.More CS01 204 (.More CP0 408 (.Stop 408)))))))))))))))))))))), + (.More CT 253 (.More CS10 126 (.More CS10 62 (.More CT 121 (.More CT 241 (.More CS10 120 (.More CT 237 (.More CS10 118 (.More CT 233 (.More CT 465 (.More CT 929 (.More CS10 464 (.More CT 925 (.More CT 1849 (.More CS10 924 (.More CT 1845 (.More CS10 922 (.More CS10 460 (.More CT 917 (.More CS11 458 (.More CT 914 (.More CS00 457 (.More CP1 913 (.More CP0 1826 (.More CS10 912 (.More CP1 1823 (.More CP0 3646 (.Stop 3646)))))))))))))))))))))))))))), + (.More CT 509 (.More CS10 254 (.More CS10 126 (.More CT 249 (.More CT 497 (.More CS10 248 (.More CT 493 (.More CS10 246 (.More CT 489 (.More CT 977 (.More CT 1953 (.More CS10 976 (.More CT 1949 (.More CT 3897 (.More CS10 1948 (.More CT 3893 (.More CS10 1946 (.More CS10 972 (.More CT 1941 (.More CS10 970 (.More CT 1937 (.More CS11 968 (.More CT 1934 (.More CT 3867 (.More CS10 1933 (.More CT 3863 (.More CT 7725 (.More CS10 3862 (.More CP0 7723 (.More CS00 3861 (.More CS00 1930 (.More CP0 3859 (.More CS00 1929 (.More CS01 964 (.More CP1 1928 (.More CP0 3856 (.Stop 3856))))))))))))))))))))))))))))))))))))), + (.More CT 1021 (.More CS10 510 (.More CS10 254 (.More CT 505 (.More CT 1009 (.More CS10 504 (.More CT 1005 (.More CS10 502 (.More CT 1001 (.More CT 2001 (.More CT 4001 (.More CS10 2000 (.More CT 3997 (.More CT 7993 (.More CS10 3996 (.More CT 7989 (.More CS10 3994 (.More CS10 1996 (.More CT 3989 (.More CS10 1994 (.More CT 3985 (.More CS10 1992 (.More CT 3981 (.More CT 7961 (.More CS10 3980 (.More CT 7957 (.More CT 15913 (.More CS10 7956 (.More CT 15909 (.More CP0 31819 (.More CT 63635 (.More CP1 127271 (.More CT 254540 (.More CT 509079 (.More CS10 254539 (.More CS00 127269 (.More CS00 63634 (.More CP0 127267 (.More CS00 63633 (.More CS00 31816 (.More CP1 63631 (.More CP1 127262 (.More CP0 254524 (.Stop 254524)))))))))))))))))))))))))))))))))))))))))))), + (.More CT 2045 (.More CS10 1022 (.More CS10 510 (.More CT 1017 (.More CT 2033 (.More CS10 1016 (.More CT 2029 (.More CS10 1014 (.More CT 2025 (.More CT 4049 (.More CT 8097 (.More CS10 4048 (.More CT 8093 (.More CT 16185 (.More CS10 8092 (.More CT 16181 (.More CS10 8090 (.More CS10 4044 (.More CT 8085 (.More CS10 4042 (.More CT 8081 (.More CS10 4040 (.More CT 8077 (.More CT 16153 (.More CS10 8076 (.More CT 16149 (.More CT 32297 (.More CS10 16148 (.More CT 32293 (.More CT 64585 (.More CT 129169 (.More CT 258337 (.More CT 516673 (.More CT 1033345 (.More CS10 516672 (.More CS10 258335 (.More CS00 129167 (.More CT 258331 (.More CP0 516663 (.More CT 1033323 (.More CT 2066645 (.More CT 4133289 (.More CS10 2066644 (.More CS10 1033321 (.More CP0 2066641 (.More CS00 1033320 (.More CP0 2066639 (.More CS00 1033319 (.More CP0 2066637 (.More CS00 1033318 (.More CS10 516658 (.More CS11 258328 (.More CP1 516656 (.More CP1 1033312 (.More CP0 2066624 (.Stop 2066624)))))))))))))))))))))))))))))))))))))))))))))))))))))))), + (.More CT 4093 (.More CS10 2046 (.More CS10 1022 (.More CT 2041 (.More CT 4081 (.More CS10 2040 (.More CT 4077 (.More CS10 2038 (.More CT 4073 (.More CT 8145 (.More CT 16289 (.More CS10 8144 (.More CT 16285 (.More CT 32569 (.More CS10 16284 (.More CT 32565 (.More CS10 16282 (.More CS10 8140 (.More CT 16277 (.More CS10 8138 (.More CT 16273 (.More CS10 8136 (.More CT 16269 (.More CT 32537 (.More CS10 16268 (.More CT 32533 (.More CT 65065 (.More CS10 32532 (.More CT 65061 (.More CT 130121 (.More CT 260241 (.More CT 520481 (.More CT 1040961 (.More CT 2081921 (.More CS10 1040960 (.More CP0 2081919 (.More CT 4163835 (.More CT 8327669 (.More CT 16655337 (.More CT 33310673 (.More CT 66621345 (.More CS10 33310672 (.More CS11 16655335 (.More CT 33310668 (.More CS01 16655334 (.More CT 33310666 (.More CS01 16655333 (.More CT 33310664 (.More CS01 16655332 (.More CP1 33310664 (.More CT 66621326 (.More CT 133242651 (.More CT 266485301 (.More CS10 133242650 (.More CS10 66621324 (.More CS10 33310661 (.More CS01 16655330 (.More CP0 33310660 (.More CP0 66621319 (.More CS00 33310659 (.More CS00 16655329 (.More CP0 33310657 (.More CS00 16655328 (.More CS10 8327663 (.More CP1 16655325 (.More CP1 33310650 (.More CP1 66621300 (.More CP0 133242600 (.Stop 133242600))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))), + (.More CT 8189 (.More CS10 4094 (.More CS10 2046 (.More CT 4089 (.More CT 8177 (.More CS10 4088 (.More CT 8173 (.More CS10 4086 (.More CT 8169 (.More CT 16337 (.More CT 32673 (.More CS10 16336 (.More CT 32669 (.More CT 65337 (.More CS10 32668 (.More CT 65333 (.More CS10 32666 (.More CS10 16332 (.More CT 32661 (.More CS10 16330 (.More CT 32657 (.More CS10 16328 (.More CT 32653 (.More CT 65305 (.More CS10 32652 (.More CT 65301 (.More CT 130601 (.More CS10 65300 (.More CT 130597 (.More CT 261193 (.More CT 522385 (.More CT 1044769 (.More CT 2089537 (.More CT 4179073 (.More CS10 2089536 (.More CT 4179069 (.More CT 8358137 (.More CT 16716273 (.More CT 33432545 (.More CT 66865089 (.More CT 133730177 (.More CS10 66865088 (.More CS11 33432543 (.More CT 66865084 (.More CS01 33432542 (.More CT 66865082 (.More CS01 33432541 (.More CT 66865080 (.More CS01 33432540 (.More CT 66865078 (.More CT 133730155 (.More CT 267460309 (.More CT 534920617 (.More CS10 267460308 (.More CS11 133730153 (.More CP0 267460306 (.More CT 534920609 (.More CT 1069841217 (.More CP1 2139682435 (.More CT 4279364868 (.More CP0 8558729737 (.More CT 17117459471 (.More CT 34234918941 (.More CT 68469837881 (.More CT 136939675761 (.More CS10 68469837880 (.More CS10 34234918939 (.More CS00 17117459469 (.More CP0 34234918937 (.More CS00 17117459468 (.More CS10 8558729733 (.More CP1 17117459465 (.More CP1 34234918930 (.More CP0 68469837860 (.More CS10 34234918929 (.More CS00 17117459464 (.More CP0 34234918927 (.More CS00 17117459463 (.More CS00 8558729731 (.More CS01 4279364865 (.More CP1 8558729730 (.More CP1 17117459460 (.More CP1 34234918920 (.More CP0 68469837840 (.Stop 68469837840))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))), + (.More CT 16381 (.More CS10 8190 (.More CS10 4094 (.More CT 8185 (.More CT 16369 (.More CS10 8184 (.More CT 16365 (.More CS10 8182 (.More CT 16361 (.More CT 32721 (.More CT 65441 (.More CS10 32720 (.More CT 65437 (.More CT 130873 (.More CS10 65436 (.More CT 130869 (.More CS10 65434 (.More CS10 32716 (.More CT 65429 (.More CS10 32714 (.More CT 65425 (.More CS10 32712 (.More CT 65421 (.More CT 130841 (.More CS10 65420 (.More CT 130837 (.More CT 261673 (.More CS10 130836 (.More CT 261669 (.More CT 523337 (.More CT 1046673 (.More CT 2093345 (.More CT 4186689 (.More CT 8373377 (.More CS10 4186688 (.More CT 8373373 (.More CT 16746745 (.More CT 33493489 (.More CT 66986977 (.More CT 133973953 (.More CT 267947905 (.More CS10 133973952 (.More CS11 66986975 (.More CT 133973948 (.More CS01 66986974 (.More CT 133973946 (.More CS01 66986973 (.More CT 133973944 (.More CS01 66986972 (.More CT 133973942 (.More CT 267947883 (.More CT 535895765 (.More CT 1071791529 (.More CS10 535895764 (.More CS11 267947881 (.More CT 535895760 (.More CT 1071791519 (.More CT 2143583037 (.More CT 4287166073 (.More CT 8574332145 (.More CT 17148664289 (.More CT 34297328577 (.More CT 68594657153 (.More CT 137189314305 (.More CT 274378628609 (.More CS10 137189314304 (.More CP0 274378628607 (.More CT 548757257211 (.More CP1 1097514514423 (.More CT 2195029028844 (.More CT 4390058057687 (.More CT 8780116115373 (.More CS10 4390058057686 (.More CS10 2195029028842 (.More CT 4390058057681 (.More CP0 8780116115363 (.More CS01 4390058057681 (.More CT 8780116115360 (.More CT 17560232230719 (.More CT 35120464461437 (.More CT 70240928922873 (.More CS10 35120464461436 (.More CS10 17560232230717 (.More CS00 8780116115358 (.More CS10 4390058057678 (.More CS10 2195029028838 (.More CP0 4390058057675 (.More CS00 2195029028837 (.More CS00 1097514514418 (.More CP0 2195029028835 (.More CS01 1097514514417 (.More CP0 2195029028834 (.More CP0 4390058057667 (.More CS01 2195029028833 (.More CP1 4390058057666 (.More CP0 8780116115332 (.More CS10 4390058057665 (.More CS00 2195029028832 (.More CP0 4390058057663 (.More CS00 2195029028831 (.More CS00 1097514514415 (.More CP1 2195029028829 (.More CP1 4390058057658 (.More CP1 8780116115316 (.More CP1 17560232230632 (.More CP0 35120464461264 (.Stop 35120464461264))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +] +def loc_z3G : WordList := [V,Q,Q,V,V,Q,V,Q,V,V,V,Q,V,V,Q,V,Q,Q,V,Q,V,Q,V,V,Q,V,V,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,Q,Q,V,K,V,K,V,K,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,Q,Q,V,V,K,V,V,V,V,Q,Q,K,Q,Q,V,K,K,V,K,V,V,K,V,V,Q,K,V,K,K,V,V,V,V,V] +def loc_z3H : WordList := [Q,K,K,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,K,K,K,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def loc_z3I : WordList := [K,K,K,K,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,K,Q,K,Q,Q,Q,Q,K,K,K,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +set_option maxRecDepth 500000 in +theorem loc_z3J : + ERounds 5 loc_z2Q 13 (loc_z3G ++ loc_z3H) := by + have h1 : ERounds 5 loc_z2Q (5 + loc_z3F.length) (loc_z3G ++ loc_z3H) := by + apply evalERounds_sound loc_z3F + decide + simpa using! h1 +set_option maxRecDepth 500000 in +theorem z3K : + EGood 13 (loc_z3G ++ loc_z3H) := by + apply eGood_of_check 13 loc_z3G loc_z3H loc_z3I + · decide + · exact EGuard.T 2 _ + · decide + · decide + · decide + · decide + · decide + · decide + · decide + · norm_num [loc_z3G,loc_z3I,wordMass,wordMassK,wordScale] +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep holdout_0549_tm c (j + d) = some c') : + (multiStep holdout_0549_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep holdout_0549_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +theorem z3L (m : Nat) : + ∃ N ≥ m,∃ h w,multiStep holdout_0549_tm (init []) N = some (zCf h (evalWords w default)) /\ EGood h w := by + induction m with + | zero => + rcases loc_z3E with ⟨k1,_,hk1⟩ + rcases loc_z2P loc_z3J with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,13,loc_z3G ++ loc_z3H, + zMt holdout_0549_tm _ _ _ k1 k2 hk1 hk2,z3K⟩ + | succ m ih => + rcases ih with ⟨N,hN,h,w,h_ms,h_good⟩ + rcases eGood_progress h_good with ⟨w',hStep,h_good'⟩ + rcases loc_z2O hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,h + 1,w', + zMt holdout_0549_tm _ _ _ N k h_ms h_step_k,h_good'⟩ +theorem holdout_0549_nonhalt : + IsDoesNotHalt holdout_0549_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases z3L (n + 1) with ⟨N,hN,_,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := zIm h_N + rw [zMs,hn] at h_some + exact h_some + + + +theorem is_does_not_halt : IsNotHalt target_tm := holdout_0549_nonhalt + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RA_1RC0RE_1RDHHH_1LE1LD_1LF0LD_1RA1LE diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LAHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LAHHH.lean new file mode 100644 index 00000000..d3980acc --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LAHHH.lean @@ -0,0 +1,1684 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LAHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LAHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 8000000 +@[simp] theorem zMz (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : HalfTape).head = 0 := rfl +@[simp] theorem zDt : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem zPs {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem zPt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,by omega,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) +abbrev t : BitWord := [1,1,0,0] +abbrev d0 : BitWord := [0,0] +abbrev d1 : BitWord := [1,0] +abbrev one : BitWord := [1] +abbrev lh : HalfTape := (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default +@[simp] theorem zDd : d0 +> (default : HalfTape) = default := by + simp [d0] +inductive Call where + | ch + | cj + | cp + | ca +def zCs : Call -> Fin 6 + | .ch => C + | .cj => B + | .cp => B + | .ca => B +def zCw : Call -> BitWord + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] + | .ca => [1,1,1,0,1,0] +def zCR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (r <{{zCs c}} (l <+ zCw c)) +def zCL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> r) {{D}}> l) +def zCf (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + zCL lh r +def z04 (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l,(zCR l c r1) [target_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + z04 c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem z05 {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z06 {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem z07 {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z08 {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z09 {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0a (w : BitWord) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem zSc {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases z09 h with ⟨r2,ha,hb⟩ + exact z08 (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS4 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc1 (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [target_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem z0b : Seg [.cp] [.cj] t t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0c : Seg [.cj] [.cj,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0d : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0e : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0f : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1 d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0g : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0h : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0i : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0j : Seg [.cj] [.cp] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons,append_nil]; execute) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0k : Seg [.ca] [.cj] [] t := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + have h1 : zCR l .ca ([] +> r1) = zCR ([1,0,1,0] +> l) .cj r1 := by + unfold zCR zCw zCs; simp only [append_cons,append_nil] + have h2 : (zCL ([1,0,1,0] +> l) r2) [target_tm]⊢⁺ (zCL l (t +> r2)) := by + unfold zCL t; simp only [append_cons,append_nil]; execute + rw [h1] + exact zPt (hc1 ([1,0,1,0] +> l)) h2 +theorem zS3 (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact z0a t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [zLp,h_eq,z07] + exact zSg z0d ih +theorem zSa {w2 : BitWord} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact z0a w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq,z07,zLp] + exact zSg hw ih +theorem z0l : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0m : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem z0n (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) t t := + zSg z0b (zS3 n) +theorem z0o (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using zSg z0c (zS3 n) +theorem z0p (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0e zH2) (zS3 n) +theorem z0q (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0f (zS3 n) +theorem z0r (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0g (zS3 n) +theorem z0s (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [zLp',List.cons_append,List.nil_append] using zSg z0h (zS3 n) +theorem z0t (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0i (zSg zH1 zH3) + have h1 := zSg h0 (zSa z0l n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0u (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0j (zSa z0l n) +theorem z0v : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0i zH1 +theorem z0w (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0i (zSg zH1 (zSg zH3 zH0)) + have h1 := zSg h0 (zSa z0m n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0x (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg [.cj,.ch] [.cp] d1 d1 := zSg z0j zH0 + have h1 := zSg h0 (zSa z0m n) + simpa only [zLp',List.cons_append,List.nil_append] using h1 +theorem z0y : Seg [.ca] [.cj] [] t := + z0k +theorem z0z (r : HalfTape) : + (zCf r) [target_tm]⊢⁺ (zCR ([1,1] +> default) .ca r) := by + unfold zCf zCL zCR lh zCw zCs + simp only [append_cons,append_nil] + execute +theorem z0A (r : HalfTape) : + (zCL ([1,1] +> default) r) [target_tm]⊢⁺ (zCR lh .cj r) := by + unfold zCL zCR lh zCw zCs + simp only [append_cons,append_nil] + execute +def z0B : Cfg (Fin 2) (Fin 6) := + (([1,0,1,1,0,0,1,1,0,0,0,0,1] +> default) {{C}}> ([1,1] +> default)) +def z0C : Cfg (Fin 2) (Fin 6) := + (([1,1,1,0,0,1,1,0,0,1,0,1,1] +> default) {{B}}> ([0,1,0,1] +> default)) +def z0D : Cfg (Fin 2) (Fin 6) := + (([0,0,1,0,1,1,0,0,0,0,1] +> default) {{B}}> ([1,1,1,1,0,1,0,1,0,1] +> default)) +def z0E : Cfg (Fin 2) (Fin 6) := + (([0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,1] +> default) {{D}}> ([0,1] +> default)) +def z0F : Cfg (Fin 2) (Fin 6) := + (([0,1,0,1,1,0,0,0,0,1,0,0,1] +> default) {{D}}> ([1,0,1,0,1,0,1,1,1,0,1,0,1,1] +> default)) +def z0G : Cfg (Fin 2) (Fin 6) := + (([0,1,1,0,0,0,0,0,0,1,1] +> default) {{C}}> ([0,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1] +> default)) +def z0H : Cfg (Fin 2) (Fin 6) := + (([1,0,0,0,0,0,0,1,1] +> default) {{B}}> ([1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1] +> default)) +def z0I : Cfg (Fin 2) (Fin 6) := + (([0,0,1,0,1,0,0,1,1] +> default) {{B}}> ([1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1] +> default)) +def z0J : Cfg (Fin 2) (Fin 6) := + (([1,1,0,0,0,0,0,0,1,1,1] +> default) {{B}}> ([0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1] +> default)) +def z0K : Cfg (Fin 2) (Fin 6) := + (([0,0,0,0,1,0,1,1,1] +> default) {{B}}> ([1,1,1,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1] +> default)) +def z0L : Cfg (Fin 2) (Fin 6) := + (([0,1,0,0,0,0,1,1,0,0,0,0,0,0,1,1,0,0,1,0,1] +> default) {{B}}> ([1,1,0,1,0,1,0,1,0,1,0,1] +> default)) +theorem z0M : (init []) [target_tm]⊢⁺ z0B := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init]; unfold z0B; simp only [append_cons,append_nil]; execute +theorem z0N : z0B [target_tm]⊢⁺ z0C := by + unfold z0B z0C; simp only [append_cons,append_nil]; execute +theorem z0O : z0C [target_tm]⊢⁺ z0D := by + unfold z0C z0D; simp only [append_cons,append_nil]; execute +theorem z0P : z0D [target_tm]⊢⁺ z0E := by + unfold z0D z0E; simp only [append_cons,append_nil]; execute +theorem z0Q : z0E [target_tm]⊢⁺ z0F := by + unfold z0E z0F; simp only [append_cons,append_nil]; execute +theorem z0R : z0F [target_tm]⊢⁺ z0G := by + unfold z0F z0G; simp only [append_cons,append_nil]; execute +theorem z0S : z0G [target_tm]⊢⁺ z0H := by + unfold z0G z0H; simp only [append_cons,append_nil]; execute +theorem z0T : z0H [target_tm]⊢⁺ z0I := by + unfold z0H z0I; simp only [append_cons,append_nil]; execute +theorem pre_z0U : z0I [target_tm]⊢⁺ z0J := by + unfold z0I z0J; simp only [append_cons,append_nil]; execute +theorem pre_z0V : z0J [target_tm]⊢⁺ z0K := by + unfold z0J z0K; simp only [append_cons,append_nil]; execute +theorem pre_z0W : z0K [target_tm]⊢⁺ z0L := by + unfold z0K z0L; simp only [append_cons,append_nil]; execute +theorem pre_z0X : z0L [target_tm]⊢⁺ + zCf (([1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,1,1,0,0,1,0,1,0] : BitWord) +> default) := by + unfold z0L zCf zCL lh + simp only [append_cons,append_nil,z00] + execute +theorem pre_z0Y : + (init []) [target_tm]⊢⁺ + zCf (([1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,1,1,0,0,1,0,1,0] : BitWord) +> default) := + zPt z0M + (zPt z0N + (zPt z0O + (zPt z0P + (zPt z0Q + (zPt z0R + (zPt z0S + (zPt z0T + (zPt pre_z0U + (zPt pre_z0V + (zPt pre_z0W pre_z0X)))))))))) +inductive RIncs : Nat -> HalfTape -> HalfTape -> Prop where + | zero (r : HalfTape) : RIncs 0 r (one +> r) + | T {n : Nat} {r r' : HalfTape} : + RIncs ((1 + n) * 2) r r' -> RIncs (1 + n) (t +> r) (t +> r') + | pair0 {n : Nat} {r r' : HalfTape} : + RIncs (n * 2) r r' -> RIncs (1 + n) (d1 +> (d0 +> r)) (t +> r') + | pair1 {n : Nat} {r r' : HalfTape} : + RIncs (1 + n * 2) r r' -> RIncs (1 + n) (d1 +> (d1 +> r)) (t +> r') + | short00 {n : Nat} {r r' : HalfTape} : + RIncs (n * 2) r r' -> RIncs (2 + n * 4) (d0 +> r) (d0 +> r') + | short01 {n : Nat} {r r' : HalfTape} : + RIncs (1 + n * 2) r r' -> RIncs (2 + n * 4) (d1 +> r) (d0 +> r') + | short10 {n : Nat} {r r' : HalfTape} : + RIncs (n * 2) r r' -> RIncs (4 + n * 4) (d0 +> r) (d1 +> r') + | short11 {n : Nat} {r r' : HalfTape} : + RIncs (1 + n * 2) r r' -> RIncs (4 + n * 4) (d1 +> r) (d1 +> r') +inductive Binary : Nat -> Nat -> HalfTape -> Prop where + | one : Binary 1 1 (d1 +> default) + | zero {n H : Nat} {r : HalfTape} : + Binary (1 + n) H r -> Binary (2 + n * 2) (1 + H) (d0 +> r) + | two {n H : Nat} {r : HalfTape} : + Binary (1 + n) H r -> Binary (3 + n * 2) (1 + H) (d1 +> r) + +open WordCalculus Word +local notation "WordList" => List Word + +theorem loc_z0Z (n : Nat) : 0 < 8 ^ n := by + induction n with + | zero => decide + | succ n ih => rw [Nat.pow_succ]; omega + +theorem loc_z11 {A H : Nat} {r : HalfTape} (h : Binary A H r) : + 0 < A /\ 0 < H /\ 2 ^ H <= A * 2 /\ A < 2 ^ H := by + induction h with + | one => decide + | @zero n H r _ ih => + rw [pow_two_one_add H]; omega + | @two n H r _ ih => + rw [pow_two_one_add H]; omega + +theorem loc_z12 (n : Nat) : ∃ H r,Binary (1 + n) H r := by + induction n using Nat.strong_induction_on with + | h n ih => + cases n with + | zero => exact ⟨1,d1 +> default,Binary.one⟩ + | succ m => + rcases even_or_odd_mul_two m with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · rcases ih a (by omega) with ⟨H0,r,hI⟩ + refine ⟨1 + H0,d0 +> r,?_⟩ + have heq : 1 + (a * 2 + 1) = 2 + a * 2 := by omega + rw [heq]; exact Binary.zero hI + · rcases ih a (by omega) with ⟨H0,r,hI⟩ + refine ⟨1 + H0,d1 +> r,?_⟩ + have heq : 1 + ((1 + a * 2) + 1) = 3 + a * 2 := by omega + rw [heq]; exact Binary.two hI + +theorem loc_z13 {A H : Nat} {r : HalfTape} (h : Binary A H r) : + RIncs ((A - 1) * 2) default r := by + induction h with + | one => + have h0 := RIncs.zero (default : HalfTape) + have hd : d1 +> (default : HalfTape) = one +> default := by simp [d1,one] + rw [hd]; exact h0 + | @zero n H r _ ih => + have ih' : RIncs (n * 2) default r := by + have heq : ((1 + n) - 1) * 2 = n * 2 := by omega + rwa [heq] at ih + have hs := RIncs.short00 ih' + rw [zDd] at hs + have heq : ((2 + n * 2) - 1) * 2 = 2 + n * 4 := by omega + rwa [heq] + | @two n H r _ ih => + have ih' : RIncs (n * 2) default r := by + have heq : ((1 + n) - 1) * 2 = n * 2 := by omega + rwa [heq] at ih + have hs := RIncs.short10 ih' + rw [zDd] at hs + have heq : ((3 + n * 2) - 1) * 2 = 4 + n * 4 := by omega + rwa [heq] + +theorem loc_z1f {A H : Nat} {u : WordList} (h1 : DigitVal A H u) : + ∀ {B J : Nat} {r : HalfTape},Binary B J r -> Binary (A + B * 2 ^ H) (H + J) (evalWords u r) := by + induction h1 with + | nil => + intro B J r h2 + simpa [evalWords] using h2 + | @zero A H u _ ih => + intro B J r h2 + have hI := ih h2 + have hB := loc_z11 hI + have hI' : Binary (1 + (A + B * 2 ^ H - 1)) (H + J) (evalWords u r) := by + have heq : 1 + (A + B * 2 ^ H - 1) = A + B * 2 ^ H := by omega + rwa [heq] + have h3 := Binary.zero hI' + have heq1 : 2 + (A + B * 2 ^ H - 1) * 2 = A * 2 + B * 2 ^ (1 + H) := by + rw [pow_two_one_add H,Nat.mul_add]; omega + have heq2 : 1 + (H + J) = (1 + H) + J := by omega + simpa [evalWords,heq1,heq2] using h3 + | @one A H u _ ih => + intro B J r h2 + have hI := ih h2 + have hB := loc_z11 hI + have hI' : Binary (1 + (A + B * 2 ^ H - 1)) (H + J) (evalWords u r) := by + have heq : 1 + (A + B * 2 ^ H - 1) = A + B * 2 ^ H := by omega + rwa [heq] + have h3 := Binary.two hI' + have heq1 : 3 + (A + B * 2 ^ H - 1) * 2 = (1 + A * 2) + B * 2 ^ (1 + H) := by + rw [pow_two_one_add H,Nat.mul_add]; omega + have heq2 : 1 + (H + J) = (1 + H) + J := by omega + simpa [evalWords,heq1,heq2] using h3 + +def loc_z1h (ds : WordList) : Prop := ∃ w,ds = Q :: (List.replicate 1 K ++ w) + +def loc_z1i (ds : WordList) : Prop := ∃ w,ds = w ++ List.replicate 5 Q + +theorem loc_z1j (n : Nat) : DigitVal 0 n (List.replicate n K) := by + induction n with + | zero => exact DigitVal.nil + | succ n ih => + have h0 := DigitVal.zero ih + have heq : 1 + n = n + 1 := by omega + simpa [List.replicate,heq] using h0 + +theorem loc_z1k (n : Nat) : + Binary (2 ^ (n + 1) - 1) (n + 1) (evalWords (List.replicate (n + 1) Q) default) := by + rw [replicate_succ_append,evalWords_append] + dsimp [evalWords] + have hpos := pow_two_pos n + have hB := loc_z1f (digitVal_replicate_Q n) Binary.one + have heq : (2 ^ n - 1) + 1 * 2 ^ n = 2 ^ (n + 1) - 1 := by + rw [Nat.pow_succ]; omega + rwa [heq] at hB + +theorem loc_z1l (r k : Nat) (hL : 31 * 2 ^ r <= k) (hU : k < 32 * 2 ^ r) : + ∃ ds,DigitVal (1 + k * 4) (7 + r) ds /\ loc_z1h ds /\ loc_z1i ds /\ + Binary (1 + k * 4) (7 + r) (evalWords ds default) := by + let a := k - 31 * 2 ^ r + have hA : a + 31 * 2 ^ r = k := by omega + have ha_lt : a < 2 ^ r := by omega + rcases exists_digitVal_of_lt_pow r a ha_lt with ⟨v,hD⟩ + have hLow : DigitVal 1 2 (Q :: List.replicate 1 K) := by + have h1 := DigitVal.one (loc_z1j 1) + simpa using h1 + have hHigh : DigitVal k (r + 5) (v ++ List.replicate 5 Q) := by + have hApp := digitVal_append hD (digitVal_replicate_Q 5) + have heq : a + (2 ^ 5 - 1) * 2 ^ r = k := by + change a + 31 * 2 ^ r = k + exact hA + rwa [heq] at hApp + have hHighB : Binary k (r + 5) (evalWords (v ++ List.replicate 5 Q) default) := by + rw [evalWords_append] + have hB := loc_z1f hD (loc_z1k 4) + have heq : a + (2 ^ 5 - 1) * 2 ^ r = k := by + change a + 31 * 2 ^ r = k + exact hA + rwa [heq] at hB + refine ⟨(Q :: List.replicate 1 K) ++ (v ++ List.replicate 5 Q),?_,⟨v ++ List.replicate 5 Q,rfl⟩, + ⟨(Q :: List.replicate 1 K) ++ v,by rw [List.append_assoc]⟩,?_⟩ + · have hApp := digitVal_append hLow hHigh + have heq1 : 1 + k * 2 ^ 2 = 1 + k * 4 := by ring + have heq2 : 2 + (r + 5) = 7 + r := by omega + rwa [heq1,heq2] at hApp + · rw [evalWords_append] + have hB := loc_z1f hLow hHighB + have heq1 : 1 + k * 2 ^ 2 = 1 + k * 4 := by ring + have heq2 : 2 + (r + 5) = 7 + r := by omega + rwa [heq1,heq2] at hB + +theorem loc_z1m (n : Nat) : 2 ^ (3 * n) = 8 ^ n := by + induction n with + | zero => rfl + | succ n ih => + have heq : 3 * (n + 1) = 3 * n + 3 := by omega + rw [heq,Nat.pow_add,ih,Nat.pow_succ]; ring + +theorem loc_z1v {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) : + ∀ {r r' : HalfTape},RIncs b r r' -> RIncs a (evalWords u r) (evalWords v r') := by + induction h with + | nil _ => intro r r' hR; exact hR + | T _ ih => intro r r' hR; exact RIncs.T (ih hR) + | pair0 _ ih => intro r r' hR; exact RIncs.pair0 (ih hR) + | pair1 _ ih => intro r r' hR; exact RIncs.pair1 (ih hR) + | short00 _ ih => intro r r' hR; exact RIncs.short00 (ih hR) + | short01 _ ih => intro r r' hR; exact RIncs.short01 (ih hR) + | short10 _ ih => intro r r' hR; exact RIncs.short10 (ih hR) + | short11 _ ih => intro r r' hR; exact RIncs.short11 (ih hR) + +theorem loc_z1x {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) : + (a : Rat) = (b : Rat) * wordScale v + (wordMassQ v + l) * 2 := by + induction h with + | nil k => simp [wordMassQ,wordScale] + | T _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | pair0 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | pair1 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | short00 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | short01 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | short10 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | short11 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + +theorem loc_z1B {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) : wordScale v <= wordScale u := by + induction h with + | nil _ => simp [wordScale] + | T _ ih => dsimp [wordScale]; linarith + | @pair0 _ u _ _ _ _ _ => have hp := wordScale_pos u; dsimp [wordScale]; linarith + | @pair1 _ u _ _ _ _ _ => have hp := wordScale_pos u; dsimp [wordScale]; linarith + | short00 _ ih => dsimp [wordScale]; linarith + | short01 _ ih => dsimp [wordScale]; linarith + | short10 _ ih => dsimp [wordScale]; linarith + | short11 _ ih => dsimp [wordScale]; linarith + +theorem loc_z1C {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) (he : hasQKSubword u = true) : wordScale v * 8 <= wordScale u := by + induction h with + | nil _ => contradiction + | T _ ih => dsimp [hasQKSubword,wordScale] at he ⊢; have := ih he; linarith + | pair0 hS _ => have := loc_z1B hS; dsimp [wordScale]; linarith + | pair1 hS _ => have := loc_z1B hS; dsimp [wordScale]; linarith + | short00 _ ih => dsimp [hasQKSubword,wordScale] at he ⊢; have := ih he; linarith + | @short01 n u k v l hS ih => + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => dsimp [hasQKSubword,wordScale] at he ih ⊢; have := ih he; linarith + | K => exact False.elim (not_scan_odd_cons_K n u' k v l hS) + | Q => dsimp [hasQKSubword,wordScale] at he ih ⊢; have := ih he; linarith + | short10 _ ih => dsimp [hasQKSubword,wordScale] at he ⊢; have := ih he; linarith + | @short11 n u k v l hS ih => + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => dsimp [hasQKSubword,wordScale] at he ih ⊢; have := ih he; linarith + | K => exact False.elim (not_scan_odd_cons_K n u' k v l hS) + | Q => dsimp [hasQKSubword,wordScale] at he ih ⊢; have := ih he; linarith + +theorem loc_z1G {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) (he : hasQKSubword u = true) : 0 < l := by + induction h with + | nil _ => contradiction + | T _ ih => dsimp [hasQKSubword] at he; have := ih he; linarith + | pair0 hI _ => have := scan_mass_bounds hI; linarith + | pair1 hI _ => have := scan_mass_bounds hI; linarith + | short00 hI _ => have := scan_mass_bounds hI; linarith + | @short01 n u k v l hI ih => + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => dsimp [hasQKSubword] at he; have := ih he; linarith + | K => exact False.elim (not_scan_odd_cons_K n u' k v l hI) + | Q => dsimp [hasQKSubword] at he; have := ih he; linarith + | short10 hI _ => have := scan_mass_bounds hI; linarith + | @short11 n u k v l hI ih => + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => dsimp [hasQKSubword] at he; have := ih he; linarith + | K => exact False.elim (not_scan_odd_cons_K n u' k v l hI) + | Q => dsimp [hasQKSubword] at he; have := ih he; linarith + +theorem loc_z1I (n : Nat) : + ∀ (a b : Nat) (v : WordList) (l : Rat), + Scan a (List.replicate n V) b v l -> + v = List.replicate n V /\ b = a * 2 ^ n /\ l = 0 := by + induction n with + | zero => + intro a b v l hI + cases hI + exact ⟨rfl,by simp,rfl⟩ + | succ n ih => + intro a b v l hI + cases hI with + | @T m _ _ v0 l0 hJ => + rcases ih ((1 + m) * 2) b v0 l0 hJ with ⟨rfl,rfl,rfl⟩ + refine ⟨rfl,?_,by ring⟩ + rw [Nat.pow_succ]; ring + +theorem loc_z1O {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (hI : Scan a (Q :: K :: u) b v l) : + ∃ n w s,a = 1 + n /\ Scan (n * 2) u b w s /\ v = V :: w /\ l = (1 + s) * (1 / 2) := by + cases hI with + | @pair0 n _ _ w s hJ => + exact ⟨n,w,s,rfl,hJ,rfl,rfl⟩ + | @short01 n _ _ _ _ hJ => + exact False.elim (not_scan_odd_cons_K n u b _ _ hJ) + | @short11 n _ _ _ _ hJ => + exact False.elim (not_scan_odd_cons_K n u b _ _ hJ) + +theorem loc_z1P {a : Nat} {ds : WordList} {b : Nat} {v : WordList} {l : Rat} + (hI : Scan a (ds ++ [K]) b v l) + (hw : ∃ w,ds = Q :: K :: w) + (hD : ∃ A H,DigitVal A H ds) + (hZ : 2 <= wordMassK ds) : + wordMass v <= wordMassK ds * (1 / 4) /\ wordMass v + l <= wordMassK ds * (3 / 4) := by + rcases hw with ⟨w,rfl⟩ + rcases hD with ⟨A,H,hD⟩ + cases hD with + | one hJ => + cases hJ with + | zero hK => + rcases loc_z1O hI with ⟨n,x,s,_,hJ',rfl,rfl⟩ + have hB := scan_tailDefect_bound hJ' (tailDefect_append_K_of_digitVal hK) + rcases hB with ⟨hM,hL,_⟩ + have hZw := (wordMass_nonneg w).2.1 + dsimp [wordMassK,wordMass] at hZ ⊢ + constructor <;> linarith + +theorem loc_z1Q {m : Nat} {u : WordList} {A H : Nat} {ds : WordList} + (hD : DigitVal A H ds) + (hS : wordScale u * ((2 ^ H : Nat) : Rat) = 1) + (hM : 1 <= m) + (hF : wordMass u + wordMassK u < 1 / 2) + (hW : ∃ w,ds = Q :: K :: w) : + ∃ b x l c y s, + Scan (m * 2) u b x l /\ Scan b (ds ++ [K]) c y s /\ 0 < c := by + rcases hW with ⟨w,rfl⟩ + have hm_q : (1 : Rat) <= (m : Rat) := by exact_mod_cast hM + have hEx1 : (wordMass u + wordMassK u) * 2 < ((m * 2 : Nat) : Rat) := by + push_cast; linarith + rcases exists_scan_of_mass_lt u m hEx1 with ⟨b,x,l,hI,hB_pos⟩ + have hBounds := scan_mass_bounds hI + have hSplit_x := wordMass_eq_add x + have hPos_x := wordMass_nonneg x + have hDelt : wordMassQ x + l < 1 / 2 := by linarith + have hBudget_eq := loc_z1x hI + have hBudget : 1 < (b : Rat) * wordScale x := by + push_cast at hBudget_eq; linarith + have hRest : (wordMass (w ++ [K]) + wordMassK (w ++ [K]) + 2) * wordScale x <= 1 := by + rw [<- (digitVal_scale_and_mass hD).1] at hS + cases hD with + | one hJ => + cases hJ with + | zero hK => + have hDw := digitVal_scale_and_mass hK + have hSc := loc_z1B hI + have hPos_w := wordMass_nonneg w + have hSplit_w := wordMass_eq_add w + have hSc_x := wordScale_pos x + have hSc_u := wordScale_pos u + have hSc_w := wordScale_pos w + dsimp [wordScale] at hS + rw [wordMass_append,wordMassK_append] + dsimp [wordMass,wordMassK] + nlinarith + cases b with + | zero => omega + | succ b => + have hSc_x := wordScale_pos x + have hEx2 : (wordMass (w ++ [K]) + wordMassK (w ++ [K])) * 2 < ((b * 2 : Nat) : Rat) := by + push_cast at hBudget ⊢ + nlinarith + rcases exists_scan_of_mass_lt (w ++ [K]) b hEx2 with ⟨c,y,s,hJ,hC_pos⟩ + refine ⟨1 + b,x,l,c,V :: y,(1 + s) * (1 / 2),?_,?_,hC_pos⟩ + · have heq : 1 + b = b + 1 := by omega + rwa [heq] + · exact Scan.pair0 hJ + +theorem loc_z1S (r a : Nat) (u : WordList) (b : Nat) (v : WordList) (l : Rat) + (hI : Scan a (u ++ List.replicate (1 + r * 2) Q ++ [K]) b v l) : + ∃ w k,v = w ++ List.replicate (1 + r) V /\ b = k * 2 ^ (1 + r) := by + rcases split_trailing_Q u with ⟨p,n,rfl,hP⟩ + have hE : (p ++ List.replicate n Q) ++ List.replicate (1 + r * 2) Q ++ [K] = + p ++ (List.replicate (1 + r * 2 + n) Q ++ [K]) := by + have heq : 1 + r * 2 + n = n + (1 + r * 2) := by omega + rw [heq,List.replicate_add n (1 + r * 2)] + simp only [List.append_assoc] + rw [hE] at hI + rcases scan_split_of_splitCond hI p (List.replicate (1 + r * 2 + n) Q ++ [K]) rfl (Or.inl hP) with ⟨c,x,y,s,t0,_,hK,rfl,_⟩ + rcases scan_add_Q_K_inv n r c b y t0 hK with ⟨w,k,rfl,rfl⟩ + exact ⟨x ++ w,k,by rw [List.append_assoc],rfl⟩ + +theorem loc_z1T {ds : WordList} (h : loc_z1h ds) : ∃ w,ds = Q :: K :: w := by + rcases h with ⟨w,rfl⟩ + exact ⟨w,rfl⟩ + +theorem loc_z1U {ds : WordList} (h : loc_z1h ds) : 2 <= wordMassK ds := by + rcases h with ⟨w,rfl⟩ + have hw := (wordMass_nonneg w).2.1 + dsimp [List.replicate,wordMassK] + linarith + +theorem loc_z1V {m : Nat} {u : WordList} {A H : Nat} {ds : WordList} + (hD : DigitVal A H ds) + (hS : wordScale u * ((2 ^ H : Nat) : Rat) = 1) + (hM : 1 <= m) + (hF : (5 / 2) * wordMass u + wordMassK u + wordScale u * wordMassK ds <= 1 / 32) + (hLo : loc_z1h ds) + (hHi : loc_z1i ds) : + ∃ k v l g, + Scan (m * 2) (u ++ ds ++ [K]) (k * 8) v l /\ + (∃ w,v = w ++ List.replicate 3 V) /\ + wordScale v * ((8 ^ g : Nat) : Rat) = 2 /\ + wordMass v <= wordMass u + (1 / 4) * (wordScale u * wordMassK ds) /\ + wordMass v + l <= wordMass u + wordMassK u + (3 / 4) * (wordScale u * wordMassK ds) /\ + 0 < wordMassQ v + l /\ wordMassQ v + l <= 1 / 32 := by + rcases hHi with ⟨w,hHi_eq⟩ + have hU := wordMass_nonneg u + have hDs := wordMass_nonneg ds + have hSu := wordScale_pos u + have hSmall : wordMass u + wordMassK u < 1 / 2 := by nlinarith + rcases loc_z1Q hD hS hM hSmall (loc_z1T hLo) with ⟨b,x,s,c,y,t0,hI1,hI2,_⟩ + rcases scan_append hI1 hI2 with ⟨l,hI,rfl⟩ + have hI_assoc : Scan (m * 2) (u ++ ds ++ [K]) c (x ++ y) (s + wordScale x * t0) := by + simpa [List.append_assoc] using hI + have hEnd : ∃ p k,x ++ y = p ++ List.replicate 3 V /\ c = k * 8 := by + have hI_hi : Scan (m * 2) ((u ++ w) ++ List.replicate (1 + 2 * 2) Q ++ [K]) c (x ++ y) (s + wordScale x * t0) := by + have heq_list : u ++ ds ++ [K] = (u ++ w) ++ List.replicate (1 + 2 * 2) Q ++ [K] := by + rw [hHi_eq]; simp [List.append_assoc] + rwa [<- heq_list] + rcases loc_z1S 2 (m * 2) (u ++ w) c (x ++ y) (s + wordScale x * t0) hI_hi with ⟨p,k,hE,hC⟩ + exact ⟨p,k,hE,hC⟩ + rcases hEnd with ⟨p,k,hE,rfl⟩ + rcases scan_scale_pow_eight hI_assoc with ⟨g,hG⟩ + refine ⟨k,x ++ y,s + wordScale x * t0,g,hI_assoc,⟨p,hE⟩,?_,?_,?_,?_⟩ + · rw [wordScale_append,wordScale_append] at hG + dsimp [wordScale] at hG + rw [(digitVal_scale_and_mass hD).1] at hG + nlinarith + · have hB1 := scan_mass_bounds hI1 + have hS1 := loc_z1B hI1 + have hB2 := loc_z1P hI2 (loc_z1T hLo) ⟨A,H,hD⟩ (loc_z1U hLo) + have hSx := wordScale_pos x + rw [wordMass_append]; nlinarith + · have hB1 := scan_mass_bounds hI1 + have hS1 := loc_z1B hI1 + have hB2 := loc_z1P hI2 (loc_z1T hLo) ⟨A,H,hD⟩ (loc_z1U hLo) + have hSx := wordScale_pos x + rw [wordMass_append]; nlinarith + · have hW : hasQKSubword (u ++ ds ++ [K]) = true := by + rw [List.append_assoc] + apply hasQKSubword_append_right + rcases loc_z1T hLo with ⟨z,rfl⟩ + rfl + have hLoss := loc_z1G hI_assoc hW + have hB1 := scan_mass_bounds hI1 + have hS1 := loc_z1B hI1 + have hB2 := loc_z1P hI2 (loc_z1T hLo) ⟨A,H,hD⟩ (loc_z1U hLo) + have hSx := wordScale_pos x + have hMv : wordMass (x ++ y) + (s + wordScale x * t0) <= wordMass u + wordMassK u + (3 / 4) * (wordScale u * wordMassK ds) := by + rw [wordMass_append]; nlinarith + have hSuz : 0 <= wordScale u * wordMassK ds := by nlinarith + have hPos_xy := wordMass_nonneg (x ++ y) + have hSplit_xy := wordMass_eq_add (x ++ y) + constructor <;> linarith + +theorem loc_z1W {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} {H : Nat} {r : HalfTape} + (hI : Scan a u (b * 2) v l) (hB : Binary (1 + b) H r) : + RIncs a (evalWords u default) (evalWords v r) := by + apply loc_z1v hI + have hR := loc_z13 hB + have heq : ((1 + b) - 1) * 2 = b * 2 := by omega + rwa [heq] at hR + +theorem loc_z1X (m g k : Nat) (s delta : Rat) + (hM : m = 1 \/ m = 2) + (hS : s * ((8 ^ g : Nat) : Rat) = 2) + (hB : ((m * 2 : Nat) : Rat) = ((k * 8 : Nat) : Rat) * s + delta * 2) + (hPos : 0 < delta) + (hSmall : delta <= 1 / 32) : + ∃ n,g = 3 + n /\ 31 * 2 ^ (m + 3 * n) <= k /\ k < 32 * 2 ^ (m + 3 * n) := by + have hMq : (1 : Rat) <= (m : Rat) /\ (m : Rat) <= 2 := by + rcases hM with rfl | rfl <;> norm_num + have hPow : (0 : Rat) < ((8 ^ g : Nat) : Rat) := by exact_mod_cast loc_z0Z g + have hEq : ((k * 8 : Nat) : Rat) = ((m : Rat) - delta) * ((8 ^ g : Nat) : Rat) := by + push_cast at hB ⊢ + have hE : (k : Rat) * 8 * s = ((m : Rat) - delta) * 2 := by linarith + have hE' : (k : Rat) * 8 * (s * ((8 ^ g : Nat) : Rat)) = ((m : Rat) - delta) * 2 * ((8 ^ g : Nat) : Rat) := by + calc (k : Rat) * 8 * (s * ((8 ^ g : Nat) : Rat)) + _ = ((k : Rat) * 8 * s) * ((8 ^ g : Nat) : Rat) := by ring + _ = ((m : Rat) - delta) * 2 * ((8 ^ g : Nat) : Rat) := by rw [hE] + rw [hS] at hE' + push_cast at hE' + linarith + have hK : 0 < k := by + by_contra hk0 + have hk_eq : k = 0 := by omega + subst hk_eq + push_cast at hPow hEq + nlinarith + have hR_q : ((k * 8 : Nat) : Rat) < ((m * 8 ^ g : Nat) : Rat) := by + push_cast at hPow hEq ⊢ + nlinarith + have hR : k * 8 < m * 8 ^ g := by exact_mod_cast hR_q + have hg1 : 1 <= g := by + by_contra hg_lt + have hg_eq : g = 0 := by omega + subst hg_eq + rcases hM with rfl | rfl <;> omega + let n1 := g - 1 + have hg_eq : g = 1 + n1 := by omega + rw [hg_eq] at hR hEq + have hpow_1n : 8 ^ (1 + n1) = 8 * 8 ^ n1 := by + rw [Nat.pow_add] + rw [hpow_1n] at hR hEq + have hRn : k + 1 <= m * 8 ^ n1 := by + rcases hM with rfl | rfl <;> omega + have hRn_q : ((k + 1 : Nat) : Rat) <= ((m * 8 ^ n1 : Nat) : Rat) := by exact_mod_cast hRn + have hPow_n1 : (0 : Rat) <= ((8 ^ n1 : Nat) : Rat) := by positivity + have hP : (32 : Rat) <= ((8 ^ n1 : Nat) : Rat) := by + push_cast at hEq hRn_q ⊢ + nlinarith + have hP_nat : 32 <= 8 ^ n1 := by exact_mod_cast hP + have hN : 2 <= n1 := by + by_contra hn2 + have hn1 : n1 <= 1 := by omega + have hle1 : 8 ^ n1 <= 8 ^ 1 := Nat.pow_le_pow_right (by decide) hn1 + (try omega) + let j := n1 - 2 + have hNJ : n1 = 2 + j := by omega + refine ⟨j,by omega,?_,?_⟩ + · rw [hNJ,Nat.pow_add 8 2 j] at hEq + have hPow_j : (0 : Rat) < ((8 ^ j : Nat) : Rat) := by exact_mod_cast loc_z0Z j + have h_le_q : ((31 * 2 ^ (m + 3 * j) : Nat) : Rat) <= (k : Rat) := by + rw [Nat.pow_add 2 m (3 * j),loc_z1m] + rcases hM with rfl | rfl <;> (push_cast at hPow_j hEq ⊢; nlinarith) + exact_mod_cast h_le_q + · rw [hNJ,Nat.pow_add 8 2 j] at hEq + have hPow_j : (0 : Rat) < ((8 ^ j : Nat) : Rat) := by exact_mod_cast loc_z0Z j + have h_lt_q : (k : Rat) < ((32 * 2 ^ (m + 3 * j) : Nat) : Rat) := by + rw [Nat.pow_add 2 m (3 * j),loc_z1m] + rcases hM with rfl | rfl <;> (push_cast at hPow_j hEq ⊢; nlinarith) + exact_mod_cast h_lt_q + +theorem loc_z1Y {m : Nat} {a : WordList} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + {H : Nat} {ds : WordList} {z : Rat} + (hI : Scan (m * 2) a (b * 2) v l) + (hD : DigitVal (1 + b) H ds) + (hS : wordScale v * wordScale ds = (m : Rat)) + (hM : wordMass v <= wordMass u + (1 / 4) * z) + (hB : wordMass v + l <= wordMass u + wordMassK u + (3 / 4) * z) + (hZ : 0 <= z) : + (5 / 2) * wordMass v + wordMassK (v ++ ds) <= + (7 / 5) * ((5 / 2) * wordMass u + wordMassK u + z) := by + have hE := loc_z1x hI + have hDt := digitVal_wordMassK_eq hD + have hDs := (digitVal_scale_and_mass hD).1 + have hSplit_v := wordMass_eq_add v + have hPos_u := wordMass_nonneg u + have hSv := wordScale_pos v + push_cast at hE hDt hDs + rw [wordMassK_append] + nlinarith + +theorem loc_z1Z (m n : Nat) (s : Rat) + (hM : m = 1 \/ m = 2) + (hS : s * ((8 ^ (3 + n) : Nat) : Rat) = 2) : + s * ((2 ^ (7 + (m + 3 * n)) : Nat) : Rat) = (m : Rat) := by + have h8 : 8 ^ (3 + n) = 512 * 8 ^ n := by + rw [Nat.pow_add 8 3 n] + rw [h8] at hS + have h2 : 2 ^ (7 + (m + 3 * n)) = 128 * 2 ^ m * 8 ^ n := by + rw [Nat.pow_add 2 7 _,Nat.pow_add 2 m (3 * n),loc_z1m]; ring + rw [h2] + rcases hM with rfl | rfl <;> (push_cast at hS ⊢; linarith) + +inductive C24Good (bound : Rat) : HalfTape -> Prop where + | intro (u : WordList) (A H : Nat) (ds : WordList) : + DigitVal A H ds -> + wordScale u * ((2 ^ H : Nat) : Rat) = 1 -> + (5 / 2) * wordMass u + wordMassK u + wordScale u * wordMassK ds <= bound -> + loc_z1h ds -> + loc_z1i ds -> + C24Good bound (evalWords (u ++ ds) default) + +theorem loc_z20 (m : Nat) (bound bound' : Rat) (r : HalfTape) + (hM : m = 1 \/ m = 2) + (hLimit : bound <= 1 / 32) + (hG : C24Good bound r) + (hRate : (7 / 5) * bound <= (m : Rat) * bound') : + ∃ r',RIncs (m * 2) r r' /\ C24Good bound' (evalWords (List.replicate (m - 1) V) r') := by + rcases hG with ⟨u,A,H,ds,hD,hS,hF,hLo,hHi⟩ + have hPos_m : 1 <= m := by rcases hM with rfl | rfl <;> omega + have hSmall : (5 / 2) * wordMass u + wordMassK u + wordScale u * wordMassK ds <= 1 / 32 := by linarith + rcases loc_z1V hD hS hPos_m hSmall hLo hHi with ⟨k,v,l,g,hI,hEnd,hScale,hMv,hBv,hPos,hUpper⟩ + have hBudget := loc_z1x hI + rcases loc_z1X m g k (wordScale v) (wordMassQ v + l) hM hScale hBudget hPos hUpper with ⟨n,rfl,hKl,hKu⟩ + rcases loc_z1l (m + 3 * n) k hKl hKu with ⟨ds',hD',hLo',hHi',hBin⟩ + have hScale' : wordScale v * wordScale ds' = (m : Rat) := by + rw [(digitVal_scale_and_mass hD').1] + exact loc_z1Z m n (wordScale v) hM hScale + have hI' : Scan (m * 2) (u ++ ds ++ [K]) ((k * 4) * 2) v l := by + have heq : k * 8 = (k * 4) * 2 := by omega + rwa [<- heq] + have hR := loc_z1W hI' hBin + have hd0_side : evalWords [K] default = default := zDd + have hR' : RIncs (m * 2) (evalWords (u ++ ds) default) (evalWords (v ++ ds') default) := by + rw [evalWords_append (u ++ ds) [K],hd0_side,<- evalWords_append v ds'] at hR + exact hR + have hZ : 0 <= wordScale u * wordMassK ds := by + have hSu := wordScale_pos u + have hPos_ds := (wordMass_nonneg ds).2.1 + nlinarith + have hWeight := loc_z1Y hI' hD' hScale' hMv hBv hZ + refine ⟨evalWords (v ++ ds') default,hR',?_⟩ + rw [<- evalWords_append,<- List.append_assoc] + refine C24Good.intro (List.replicate (m - 1) V ++ v) (1 + k * 4) (7 + (m + 3 * n)) ds' hD' ?_ ?_ hLo' hHi' + · rw [<- (digitVal_scale_and_mass hD').1,wordScale_append] + rcases hM with rfl | rfl <;> (dsimp [List.replicate,wordScale]; push_cast at hScale'; nlinarith) + · rw [wordMass_append,wordMassK_append,wordScale_append] + rw [wordMassK_append] at hWeight + rcases hM with rfl | rfl <;> (dsimp [List.replicate,wordMass,wordMassK,wordScale]; push_cast at hRate; nlinarith) + +theorem loc_z21 {r : HalfTape} (hG : C24Good (1 / 64) r) : + ∃ s r',RIncs 2 r s /\ RIncs 4 s r' /\ C24Good (1 / 64) (t +> r') := by + rcases loc_z20 1 (1 / 64) ((7 / 5) * (1 / 64)) r (Or.inl rfl) (by norm_num) hG (by norm_num) with ⟨s,hR,hH⟩ + dsimp [List.replicate,evalWords] at hH + rcases loc_z20 2 ((7 / 5) * (1 / 64)) (1 / 64) s (Or.inr rfl) (by norm_num) hH (by norm_num) with ⟨r',hS,hI⟩ + dsimp [List.replicate,evalWords] at hI + exact ⟨s,r',hR,hS,hI⟩ + +theorem ne_of_beq_eq_false {a b : Nat} (h : (a == b) = false) : a ≠ b := by + intro heq; subst heq; exact Bool.noConfusion (h.symm.trans (beq_self_eq_true a)) + +def loc_zPf : Nat -> Nat -> Option (WordList) + | 0,_ => none + | fuel + 1,k => + if k == 0 then none + else if k == 1 then some [Q] + else match loc_zPf fuel (k / 2) with + | none => none + | some ws => some ((if k % 2 == 0 then K else Q) :: ws) + +theorem loc_z22 (fuel : Nat) : + ∀ (k : Nat) (ws : WordList),loc_zPf fuel k = some ws -> + ∃ H,Binary k H (evalWords ws default) := by + induction fuel with + | zero => intro k ws h; contradiction + | succ fuel ih => + intro k ws h + dsimp [loc_zPf] at h + cases hk0 : (k == 0) with + | true => rw [hk0] at h; contradiction + | false => + rw [hk0] at h; dsimp at h + have hk0' : k ≠ 0 := ne_of_beq_eq_false hk0 + cases hk1 : (k == 1) with + | true => + rw [hk1] at h; dsimp at h + injection h with h; subst h + have rfl_k : k = 1 := beq_iff_eq.mp hk1 + subst rfl_k + exact ⟨1,Binary.one⟩ + | false => + rw [hk1] at h; dsimp at h + have hk1' : k ≠ 1 := ne_of_beq_eq_false hk1 + cases hrec : loc_zPf fuel (k / 2) with + | none => rw [hrec] at h; contradiction + | some ws' => + rw [hrec] at h; dsimp at h + injection h with h; subst h + rcases ih (k / 2) ws' hrec with ⟨H,hB⟩ + have hq : k / 2 = 1 + (k / 2 - 1) := by omega + rw [hq] at hB + rcases Nat.mod_two_eq_zero_or_one k with hmod | hmod + · have hcond : (k % 2 == 0) = true := beq_iff_eq.mpr hmod + rw [hcond]; dsimp [evalWords] + refine ⟨1 + H,?_⟩ + have heq : k = 2 + (k / 2 - 1) * 2 := by omega + rw [heq]; exact Binary.zero hB + · have hcond : (k % 2 == 0) = false := beq_false_of_ne (by omega) + rw [hcond]; dsimp [evalWords] + refine ⟨1 + H,?_⟩ + have heq : k = 3 + (k / 2 - 1) * 2 := by omega + rw [heq]; exact Binary.two hB + +def loc_z29 (e : Bool) : Word := if e then Q else K + +def loc_z2a (e : Bool) (k : Nat) : Option (Word × Nat) := + if k == 0 then none + else if k % 2 == 0 then + if k % 4 == 2 then + some (K,bitStepNat e (k / 4)) + else + some (Q,bitStepNat e (k / 4 - 1)) + else none + +theorem loc_z2b (e : Bool) (k : Nat) (d : Word) (k' : Nat) (r r' : HalfTape) + (hS : loc_z2a e k = some (d,k')) (hI : RIncs k' r r') : + RIncs k (evalWords [loc_z29 e] r) (evalWords [d] r') := by + dsimp [loc_z2a] at hS + cases hk0 : (k == 0) with + | true => rw [hk0] at hS; contradiction + | false => + rw [hk0] at hS; dsimp at hS + have hk0' : k ≠ 0 := ne_of_beq_eq_false hk0 + cases hk2 : (k % 2 == 0) with + | false => rw [hk2] at hS; contradiction + | true => + rw [hk2] at hS; dsimp at hS + have hk2' : k % 2 = 0 := beq_iff_eq.mp hk2 + cases hk4 : (k % 4 == 2) with + | true => + rw [hk4] at hS; dsimp at hS + injection hS with hS1; injection hS1 with hS1 hS2; subst hS1; subst hS2 + have hk4' : k % 4 = 2 := beq_iff_eq.mp hk4 + have hk_eq : k = 2 + (k / 4) * 4 := by omega + rw [hk_eq] + cases e + · exact RIncs.short00 hI + · exact RIncs.short01 hI + | false => + rw [hk4] at hS; dsimp at hS + injection hS with hS1; injection hS1 with hS1 hS2; subst hS1; subst hS2 + have hk4' : k % 4 ≠ 2 := ne_of_beq_eq_false hk4 + have hk_eq : k = 4 + (k / 4 - 1) * 4 := by omega + rw [hk_eq] + cases e + · exact RIncs.short10 hI + · exact RIncs.short11 hI + +def loc_z2d : Nat -> WordList -> Nat -> WordList -> Option (WordList) + | 0,_,_,_ => none + | fuel + 1,u,k,acc => + if k == 0 then + if u.all isWordK then some (acc.reverseAux [Q]) else none + else + match u with + | [] => + if k % 2 == 0 then + match loc_zPf 512 (1 + k / 2) with + | some ws => some (acc.reverseAux ws) + | none => none + else none + | V :: u' => loc_z2d fuel u' (k * 2) (V :: acc) + | K :: u' => + match loc_z2a false k with + | some (d,k') => loc_z2d fuel u' k' (d :: acc) + | none => none + | Q :: u' => + if (k % 2 == 0) && startsWithKOrNil (Q :: u') then + match loc_z2a true k with + | some (d,k') => loc_z2d fuel u' k' (d :: acc) + | none => none + else + match u' with + | K :: v => loc_z2d fuel v ((k - 1) * 2) (V :: acc) + | Q :: v => loc_z2d fuel v (1 + (k - 1) * 2) (V :: acc) + | _ => none + +theorem loc_z2e (fuel : Nat) : + ∀ (u : WordList) (k : Nat) (acc v : WordList),loc_z2d fuel u k acc = some v -> + ∃ w,v = acc.reverseAux w /\ RIncs k (evalWords u default) (evalWords w default) := by + induction fuel with + | zero => intro u k acc v hE; contradiction + | succ fuel ih => + intro u k acc v hE + dsimp [loc_z2d] at hE + cases hk0 : (k == 0) with + | true => + rw [hk0] at hE; dsimp at hE + have rfl_k : k = 0 := beq_iff_eq.mp hk0; subst rfl_k + cases hu : u.all isWordK with + | false => rw [hu] at hE; contradiction + | true => + rw [hu] at hE; dsimp at hE + injection hE with hE; subst hE + refine ⟨[Q],rfl,?_⟩ + rw [evalWords_default_of_all_K u hu] + have h0 := RIncs.zero (default : HalfTape) + simpa [evalWords,d1,one] using h0 + | false => + rw [hk0] at hE; dsimp at hE + have hk0' : k ≠ 0 := ne_of_beq_eq_false hk0 + cases u with + | nil => + cases hk2 : (k % 2 == 0) with + | false => rw [hk2] at hE; contradiction + | true => + rw [hk2] at hE; dsimp at hE + have hk2' : k % 2 = 0 := beq_iff_eq.mp hk2 + cases hp : loc_zPf 512 (1 + k / 2) with + | none => rw [hp] at hE; contradiction + | some ws => + rw [hp] at hE; dsimp at hE + injection hE with hE; subst hE + rcases loc_z22 512 (1 + k / 2) ws hp with ⟨H,hB⟩ + have hR := loc_z13 hB + have heq : ((1 + k / 2) - 1) * 2 = k := by omega + rw [heq] at hR + exact ⟨ws,rfl,hR⟩ + | cons x u' => + cases x + · dsimp at hE + rcases ih u' (k * 2) (V :: acc) v hE with ⟨w,rfl,hR⟩ + refine ⟨V :: w,rfl,?_⟩ + have hk_eq : k = 1 + (k - 1) := by omega + have hk2_eq : k * 2 = (1 + (k - 1)) * 2 := by omega + rw [hk2_eq] at hR + rw [hk_eq] + exact RIncs.T hR + · dsimp at hE + cases hS : loc_z2a false k with + | none => rw [hS] at hE; contradiction + | some dk => + rcases dk with ⟨d,k'⟩ + rw [hS] at hE; dsimp at hE + rcases ih u' k' (d :: acc) v hE with ⟨w,rfl,hR⟩ + have hsub := loc_z2b false k d k' _ _ hS hR + rw [<- evalWords_append [d] w default] at hsub + exact ⟨d :: w,rfl,hsub⟩ + · dsimp at hE + cases hcond : ((k % 2 == 0) && startsWithKOrNil (Q :: u')) with + | true => + rw [hcond] at hE; dsimp at hE + cases hS : loc_z2a true k with + | none => rw [hS] at hE; contradiction + | some dk => + rcases dk with ⟨d,k'⟩ + rw [hS] at hE; dsimp at hE + rcases ih u' k' (d :: acc) v hE with ⟨w,rfl,hR⟩ + have hsub := loc_z2b true k d k' _ _ hS hR + rw [<- evalWords_append [d] w default] at hsub + exact ⟨d :: w,rfl,hsub⟩ + | false => + rw [hcond] at hE; dsimp at hE + cases u' with + | nil => contradiction + | cons x2 u'' => + cases x2 + · contradiction + · dsimp at hE + rcases ih u'' ((k - 1) * 2) (V :: acc) v hE with ⟨w,rfl,hR⟩ + refine ⟨V :: w,rfl,?_⟩ + have hk_eq : k = 1 + (k - 1) := by omega + rw [hk_eq] + exact RIncs.pair0 hR + · dsimp at hE + rcases ih u'' (1 + (k - 1) * 2) (V :: acc) v hE with ⟨w,rfl,hR⟩ + refine ⟨V :: w,rfl,?_⟩ + have hk_eq : k = 1 + (k - 1) := by omega + rw [hk_eq] + exact RIncs.pair1 hR + +def loc_z2f (k : Nat) (u : WordList) : Option (WordList) := + loc_z2d 1024 (u ++ [K]) k [] + +theorem loc_z2g (k : Nat) (u v : WordList) (hE : loc_z2f k u = some v) : + RIncs k (evalWords u default) (evalWords v default) := by + rcases loc_z2e 1024 (u ++ [K]) k [] v hE with ⟨w,rfl,hR⟩ + have hd0_side : evalWords [K] default = default := zDd + rw [evalWords_append u [K],hd0_side] at hR + exact hR + +def loc_z2k (c0 c1 : Nat) : WordList -> Nat -> Nat + | [],n => n + | V :: u,n => loc_z2k c0 c1 u (halfCeil n) + | K :: u,n => loc_z2k c0 c1 u (n * 2 + c0) + | Q :: u,n => loc_z2k c0 c1 u (n * 2 + c1) + +theorem loc_z2m (c0 c1 : Nat) (u : WordList) : + ∀ (n : Nat), + (c0 : Rat) * wordMassK u.reverse + (c1 : Rat) * wordMassQ u.reverse + wordScale u.reverse * (n : Rat) <= + ((loc_z2k c0 c1 u n : Nat) : Rat) := by + induction u with + | nil => + intro n + simp [wordMassK,wordMassQ,wordScale,loc_z2k] + | cons w u ih => + intro n + have hsp := wordScale_pos u.reverse + cases w + · dsimp [loc_z2k] + rw [List.reverse_cons,wordMassK_append,wordMassQ_append,wordScale_append] + dsimp [wordMassK,wordMassQ,wordScale] + have hhu := rat_le_two_mul_halfCeil n + have hih := ih (halfCeil n) + nlinarith + · dsimp [loc_z2k] + rw [List.reverse_cons,wordMassK_append,wordMassQ_append,wordScale_append] + dsimp [wordMassK,wordMassQ,wordScale] + have hih := ih (n * 2 + c0) + push_cast at hih + nlinarith + · dsimp [loc_z2k] + rw [List.reverse_cons,wordMassK_append,wordMassQ_append,wordScale_append] + dsimp [wordMassK,wordMassQ,wordScale] + have hih := ih (n * 2 + c1) + push_cast at hih + nlinarith + +theorem loc_z2n (c0 c1 : Nat) (u : WordList) (n : Nat) : + (c0 : Rat) * wordMassK u + (c1 : Rat) * wordMassQ u + wordScale u * (n : Rat) <= + ((loc_z2k c0 c1 u.reverse n : Nat) : Rat) := by + have h := loc_z2m c0 c1 u.reverse n + simpa [List.reverse_reverse] using h + +def loc_z2t (u ds : WordList) : Bool := + decide (loc_z2k (7 * 65536) (5 * 65536) u.reverse + (loc_z2k (2 * 65536) 0 ds.reverse 0) <= 2048) + +theorem loc_z2u (u ds : WordList) (hE : loc_z2t u ds = true) : + (5 / 2) * wordMass u + wordMassK u + wordScale u * wordMassK ds <= 1 / 64 := by + unfold loc_z2t at hE + have hle : loc_z2k (7 * 65536) (5 * 65536) u.reverse (loc_z2k (2 * 65536) 0 ds.reverse 0) <= 2048 := + of_decide_eq_true hE + have hle_q : ((loc_z2k (7 * 65536) (5 * 65536) u.reverse (loc_z2k (2 * 65536) 0 ds.reverse 0) : Nat) : Rat) <= 2048 := by + exact_mod_cast hle + have hD := loc_z2n (2 * 65536) 0 ds 0 + have hU := loc_z2n (7 * 65536) (5 * 65536) u (loc_z2k (2 * 65536) 0 ds.reverse 0) + have hSu := wordScale_pos u + have hSplit := wordMass_eq_add u + push_cast at hD hU + nlinarith + +def loc_z2w : WordList := Q :: List.replicate 1 K + +def loc_z2x : WordList := List.replicate 5 Q + +def loc_z2y (u : WordList) : Bool := + match splitPrefixDigits u with + | none => false + | some (p,ds) => + match heightShift p 0 with + | none => false + | some H => + if H == ds.length then + match stripWordPrefix loc_z2w ds, + stripWordPrefix loc_z2x ds.reverse with + | some _,some _ => loc_z2t p ds + | _,_ => false + else false + +theorem loc_z2z (u : WordList) (hE : loc_z2y u = true) : + C24Good (1 / 64) (evalWords u default) := by + unfold loc_z2y at hE + cases hC : splitPrefixDigits u with + | none => rw [hC] at hE; contradiction + | some pds => + rcases pds with ⟨p,ds⟩ + rw [hC] at hE; dsimp at hE + cases hU : heightShift p 0 with + | none => rw [hU] at hE; contradiction + | some H => + rw [hU] at hE; dsimp at hE + cases hL : (H == ds.length) with + | false => rw [hL] at hE; contradiction + | true => + rw [hL] at hE; dsimp at hE + have rfl_H : H = ds.length := beq_iff_eq.mp hL + subst rfl_H + cases hLo : stripWordPrefix loc_z2w ds with + | none => rw [hLo] at hE; contradiction + | some lo => + rw [hLo] at hE + cases hHi : stripWordPrefix loc_z2x ds.reverse with + | none => rw [hHi] at hE; contradiction + | some hi => + rw [hHi] at hE; dsimp at hE + rcases splitPrefixDigits_sound u p ds hC with ⟨rfl,hD⟩ + rcases exists_digitVal_of_all_isDigitWord ds hD with ⟨A,hDA⟩ + refine C24Good.intro p A ds.length ds hDA ?_ ?_ ?_ ?_ + · have hsp := heightShift_sound p 0 ds.length hU + simpa using hsp + · exact loc_z2u p ds hE + · exact ⟨lo,stripWordPrefix_sound loc_z2w ds lo hLo⟩ + · have hHi_eq := stripWordPrefix_sound loc_z2x ds.reverse hi hHi + have hRev := congrArg List.reverse hHi_eq + rw [List.reverse_reverse,List.reverse_append] at hRev + change ds = hi.reverse ++ (List.replicate 5 Q).reverse at hRev + rw [replicate_reverse] at hRev + exact ⟨hi.reverse,hRev⟩ + +def loc_z2A (u : WordList) : Option (WordList) := + match loc_z2f 2 u with + | none => none + | some v => + match loc_z2f 4 v with + | none => none + | some w => some (V :: w) + +inductive C24Rounds : HalfTape -> HalfTape -> Prop where + | refl (r : HalfTape) : C24Rounds r r + | next {r s v w : HalfTape} : + RIncs 2 r s -> RIncs 4 s v -> C24Rounds (t +> v) w -> C24Rounds r w + +def loc_z2B : Nat -> WordList -> Bool + | 0,u => loc_z2y u + | n + 1,u => + match loc_z2A u with + | none => false + | some v => loc_z2B n v + +theorem loc_z2C (n : Nat) : + ∀ (u : WordList),loc_z2B n u = true -> + ∃ r,C24Rounds (evalWords u default) r /\ C24Good (1 / 64) r := by + induction n with + | zero => + intro u hE + exact ⟨evalWords u default,C24Rounds.refl _,loc_z2z u hE⟩ + | succ n ih => + intro u hE + dsimp [loc_z2B,loc_z2A] at hE + cases hV : loc_z2f 2 u with + | none => rw [hV] at hE; contradiction + | some v => + rw [hV] at hE; dsimp at hE + cases hW : loc_z2f 4 v with + | none => rw [hW] at hE; contradiction + | some w => + rw [hW] at hE; dsimp at hE + rcases ih (V :: w) hE with ⟨r,hR,hG⟩ + exact ⟨r,C24Rounds.next (loc_z2g 2 u v hV) (loc_z2g 4 v w hW) hR,hG⟩ + +def loc_z2D : WordList := + List.replicate 3 V ++ [Q,V,K,K,V,Q,Q] + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +theorem loc_z2E : loc_z2B 8 loc_z2D = true := by + decide + +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) + +def loc_z2F (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs,Num k w hs -> Side hs (w +> r) r' + +theorem loc_z2G {r r' : HalfTape} (h : loc_z2F 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl + +theorem loc_z2H {n : Nat} {r r' : HalfTape} + (hI : loc_z2F ((1 + n) * 2) r r') : loc_z2F (1 + n) (t +> r) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil] + refine zSc (z0n m) ?_ + have hN2 : Num ((1 + n) * 2) [] ([.cj] ++ [.ch] ^ (m * 2)) := by + have hm : (1 + n) * 2 = 2 + (m * 2) * 2 := by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil] + refine zSc (z0o m) ?_ + have hN2 : Num ((1 + n) * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : (1 + n) * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + +theorem loc_z2I {n : Nat} {r r' : HalfTape} + (hI : loc_z2F (n * 2) r r') : loc_z2F (1 + n) (d1 +> (d0 +> r)) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil,<- append_assoc d1 d0 r] + cases m with + | zero => + have hn0 : n * 2 = 0 := by omega + rw [hn0] at hI + have hr' := loc_z2G hI + subst hr' + rw [<- append_assoc t one r] + exact zSc z0e (Side.nil r) + | succ m => + have h1m : m + 1 = 1 + m := by omega + rw [h1m] + refine zSc (z0p m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : n * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil,<- append_assoc d1 d0 r] + refine zSc (z0q m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (m * 2)) := by + have hm : n * 2 = 2 + (m * 2) * 2 := by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 + +theorem loc_z2J {n : Nat} {r r' : HalfTape} + (hI : loc_z2F (1 + n * 2) r r') : loc_z2F (1 + n) (d1 +> (d1 +> r)) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil,<- append_assoc d1 d1 r] + refine zSc (z0r m) ?_ + have hN1 : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ (m * 2)) := by + have hm : 1 + n * 2 = 1 + (m * 2) * 2 := by omega + rw [hm]; exact Num.odd (m * 2) + simpa using hI [] _ hN1 + | @even m => + simp only [append_nil,<- append_assoc d1 d1 r] + refine zSc (z0s m) ?_ + have hN1 : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ (1 + m * 2)) := by + have hm : 1 + n * 2 = 1 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.odd (1 + m * 2) + simpa using hI [] _ hN1 + +theorem loc_z2K {n : Nat} {r r' : HalfTape} + (hI : loc_z2F (n * 2) r r') : loc_z2F (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2G hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0i (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine zSc (z0t n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using hI [] _ hN2 + +theorem loc_z2L {n : Nat} {r r' : HalfTape} + (hI : loc_z2F (1 + n * 2) r r') : loc_z2F (2 + n * 4) (d1 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + refine zSc (z0u n) ?_ + simpa using hI [] _ (Num.odd n) + +theorem loc_z2M {n : Nat} {r r' : HalfTape} + (hI : loc_z2F (n * 2) r r') : loc_z2F (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2G hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0v (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine zSc (z0w n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using hI [] _ hN2 + +theorem loc_z2N {n : Nat} {r r' : HalfTape} + (hI : loc_z2F (1 + n * 2) r r') : loc_z2F (4 + n * 4) (d1 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + refine zSc (z0x n) ?_ + simpa using hI [] _ (Num.odd n) + +theorem loc_z2O {k : Nat} {r r' : HalfTape} (hI : RIncs k r r') : + loc_z2F k r r' := by + induction hI with + | zero r => + intro w hs hN + generalize hk : 0 = k0 at hN + cases hN with + | zero => exact Side.nil (one +> r) + | odd _ => omega + | even _ => omega + | T _ ih => exact loc_z2H ih + | pair0 _ ih => exact loc_z2I ih + | pair1 _ ih => exact loc_z2J ih + | short00 _ ih => exact loc_z2K ih + | short01 _ ih => exact loc_z2L ih + | short10 _ ih => exact loc_z2M ih + | short11 _ ih => exact loc_z2N ih + +theorem loc_z2P {r s r' : HalfTape} (hI : RIncs 2 r s) (hJ : RIncs 4 s r') : + (zCf r) [target_tm]⊢⁺ zCf (t +> r') := by + have hC1 := loc_z2O hI [] ([.cj] ++ [.ch] ^ 0) (Num.even 0) + have hS1 := zSc z0y hC1 + dsimp at hS1 + rcases hS1 with _ | ⟨hca,hnil1⟩ + cases hnil1 + have hC2 := loc_z2O hJ [] ([.cj] ++ [.ch] ^ 1) (Num.even 1) + have hS2 := zSc (z0o 0) hC2 + dsimp at hS2 + rcases hS2 with _ | ⟨hcj,hnil2⟩ + cases hnil2 + exact zPt (z0z r) + (zPt (hca ([1,1] +> default)) + (zPt (z0A (t +> s)) (hcj lh))) + +theorem loc_z2Q {r r' : HalfTape} (h : C24Rounds r r') : + (zCf r) [target_tm]⊢* zCf r' := by + induction h with + | refl _ => exact ⟨0,rfl⟩ + | next hR1 hR2 _ ih => + rcases loc_z2P hR1 hR2 with ⟨n,_,hn⟩ + rcases ih with ⟨m,hm⟩ + exact ⟨n + m,zMt target_tm _ _ _ n m hn hm⟩ + +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d) = some c') : + (multiStep target_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl + +theorem loc_z2R : + (init []) [target_tm]⊢⁺ zCf (evalWords loc_z2D default) := by + have h := pre_z0Y + have heq : evalWords loc_z2D default = + (([1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,1,1,0,0,1,0,1,0] : BitWord) +> default) := by + simp [loc_z2D,List.replicate,evalWords,t,d0,d1,append_cons,append_nil] + rwa [heq] + +theorem loc_z2S (m : Nat) : + ∃ N ≥ m,∃ r,multiStep target_tm (init []) N = some (zCf r) /\ C24Good (1 / 64) r := by + induction m with + | zero => + rcases loc_z2R with ⟨k1,_,hk1⟩ + rcases loc_z2C 8 loc_z2D loc_z2E with ⟨r0,hR0,hG0⟩ + rcases loc_z2Q hR0 with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,r0,zMt target_tm _ _ _ k1 k2 hk1 hk2,hG0⟩ + | succ m ih => + rcases ih with ⟨N,hN,r,h_ms,h_good⟩ + rcases loc_z21 h_good with ⟨s,r',hR1,hR2,h_good'⟩ + rcases loc_z2P hR1 hR2 with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,t +> r',zMt target_tm _ _ _ N k h_ms h_step_k,h_good'⟩ + +end Solution + + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases loc_z2S (n + 1) with ⟨N,hN,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := zIm h_N + rw [zMs,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LAHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LBHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LBHHH.lean new file mode 100644 index 00000000..ea00a478 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LBHHH.lean @@ -0,0 +1,269 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusF +public import BusyBeaver.Calculi.WordCalculusG +public import BusyBeaver.Calculi.WordCalculusH + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LBHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +abbrev A : Fin 6 := 3 +abbrev B : Fin 6 := 0 +abbrev C : Fin 6 := 1 +abbrev D : Fin 6 := 4 +abbrev E : Fin 6 := 2 +abbrev F : Fin 6 := 5 +@[reducible] def tm : Machine (Fin 2) (Fin 6) := target_tm +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 2000000 + +open WordVKQ Word WordVKQ.Traj114 + +abbrev evalCCfgVKQ (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev z0b (c : CCfg) : Option CCfg := Counter.bstep tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (evalCCfgVKQ c1) [tm]⊢⁺ (evalCCfgVKQ c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ + +abbrev pref24 : BitWord := [1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0] + + +def zCs : Call -> Fin 6 + | .ch => E + | .ca => C + +def zCR (w : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (w <{{zCs c}} ([1] +> r)) + +def zCL (w : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> w) {{A}}> r) + +def zCf (w : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> pref24 +> w) {{A}}> default) + +abbrev callStep (c : Call) (w1 w2 : HalfTape) : Prop := + ∀ r, (zCR w1 c r) [tm]⊢⁺ (zCL w2 r) + +abbrev Side := SideP callStep +abbrev Seg := SegP callStep + +theorem seg_ch_V : Seg [.ch] [.ch, .ch] V_u V_u := + segP_of_step_two (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (fun u r => by unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_V : Seg [.ca] [.ch] V_u Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Vp : Seg [.ca] [.ca, .ca] Vp Vp := + segP_of_step_two (mid1 := [0, 1, 1, 1]) (mid2 := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_K : Seg [.ch] [] K_u Q_u := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs K_u Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_Q : Seg [.ch] [.ch] Q_u K_u := + segP_of_step_one (mid := [1, 1]) + (fun u r => by unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL K_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_VpQ : Seg [.ca] [.ca] (Vp ++ Q_u) (Kp ++ Vp) := + segP_of_step_one (mid := [0, 1, 0, 1, 1, 1]) + (fun u r => by unfold zCR zCs Vp Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_KpVp : Seg [.ca] [] (Kp ++ Vp) (Qp ++ Vp) := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs Kp Vp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_QpVp : Seg [.ca] [.ca, .ca] (Qp ++ Vp) (Kp ++ Vp) := + segP_of_step_two (mid1 := [0, 1, 1, 1, 1, 1]) (mid2 := [0, 1, 0, 1, 1, 1]) + (fun u r => by unfold zCR zCs Qp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Kp : Seg [.ca] [] Kp Qp := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs Kp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Qp : Seg [.ca] [.ca] Qp Kp := + segP_of_step_one (mid := [1, 1]) + (fun u r => by unfold zCR zCs Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_KQ : Seg [.ca] [] (K_u ++ Q_u) Vp := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs K_u Q_u Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_QQ : Seg [.ca] [.ca] (Q_u ++ Q_u) Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +-- Turnaround zP0..zP6 +abbrev tr1 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr2 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr3 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr4 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr5 : BitWord := [0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1] +abbrev tr6 : BitWord := [0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1] + +theorem zP0 (w : HalfTape) : (zCf w) [tm]⊢⁺ (zCR w .ca (tr1 +> default)) := by + unfold zCf zCR zCs pref24 tr1 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP1 (w : HalfTape) : (zCL w (tr1 +> default)) [tm]⊢⁺ (zCR w .ca (tr2 +> default)) := by + unfold zCL zCR zCs tr1 tr2 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP2 (w : HalfTape) : (zCL w (tr2 +> default)) [tm]⊢⁺ (zCR w .ca (tr3 +> default)) := by + unfold zCL zCR zCs tr2 tr3 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP3 (w : HalfTape) : (zCL w (tr3 +> default)) [tm]⊢⁺ (zCR w .ca (tr4 +> default)) := by + unfold zCL zCR zCs tr3 tr4 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP4 (w : HalfTape) : (zCL w (tr4 +> default)) [tm]⊢⁺ (zCR w .ca (tr5 +> default)) := by + unfold zCL zCR zCs tr4 tr5 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP5 (w : HalfTape) : (zCL w (tr5 +> default)) [tm]⊢⁺ (zCR w .ca (tr6 +> default)) := by + unfold zCL zCR zCs tr5 tr6 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP6 (w : HalfTape) : (zCL w (tr6 +> default)) [tm]⊢⁺ (zCf ([1, 1, 0] +> w)) := by + unfold zCL zCf tr6 pref24 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +-- Section 2: Words, Shift Identity, DigitVal, Parse, Scan, Step +theorem segSpec : SegSpec callStep := + ⟨seg_ch_V, seg_ca_V, seg_ca_Vp, seg_ch_K, seg_ch_Q, + seg_ca_VpQ, seg_ca_KpVp, seg_ca_QpVp, seg_ca_Kp, seg_ca_Qp, + seg_ca_KQ, seg_ca_QQ⟩ + +theorem Side_turnaround {w w' : HalfTape} (h : Side ([Call.ca] ^ 6) w w') : + (zCf w) [tm]⊢⁺ (zCf ([1, 1, 0] +> w')) := by + rcases h with _ | ⟨hc1, h⟩ + rcases h with _ | ⟨hc2, h⟩ + rcases h with _ | ⟨hc3, h⟩ + rcases h with _ | ⟨hc4, h⟩ + rcases h with _ | ⟨hc5, h⟩ + rcases h with _ | ⟨hc6, h⟩ + cases h + exact stepPlus_trans_vkq (zP0 w) + (stepPlus_trans_vkq (hc1 (tr1 +> default)) + (stepPlus_trans_vkq (zP1 _) + (stepPlus_trans_vkq (hc2 (tr2 +> default)) + (stepPlus_trans_vkq (zP2 _) + (stepPlus_trans_vkq (hc3 (tr3 +> default)) + (stepPlus_trans_vkq (zP3 _) + (stepPlus_trans_vkq (hc4 (tr4 +> default)) + (stepPlus_trans_vkq (zP4 _) + (stepPlus_trans_vkq (hc5 (tr5 +> default)) + (stepPlus_trans_vkq (zP5 _) + (stepPlus_trans_vkq (hc6 (tr6 +> default)) (zP6 w')))))))))))) + +theorem Step_exec {u u' : List Word} (h : Step u u') : + (zCf (evalWords u default)) [tm]⊢⁺ (zCf (evalWords u' default)) := by + rcases h with ⟨n, b', v, da, H, g, hScan, hDg, rfl⟩ + have hSeg := Seg_of_Scan segSpec hScan + dsimp at hSeg + have hSide0 := sideP_of_segP hSeg (Side_ca_default segSpec hDg) + rw [wordsToBits_append_tape, evalWords_append, evalWords_replicate_K, wordsToBitsShifted_append_tape, <- evalWordsShifted_append] at hSide0 + have hTurn := Side_turnaround hSide0 + rwa [evalWords_V_shift] at hTurn + +theorem Rounds_exec {u v : List Word} (h : Rounds u v) : + (zCf (evalWords u default)) [tm]⊢* (zCf (evalWords v default)) := by + induction h with + | refl _ => exact ⟨0, rfl⟩ + | next hS _ ih => exact stepStar_of_stepPlus_vkq (stepPlus_stepStar_trans_vkq (Step_exec hS) ih) + +-- Section 3: Universal Parse_V_start, Scan_of_Parse, and Trace Evaluators + +def zInitCCfg : CCfg := ⟨0, 0, [], []⟩ +def zHit5CCfg : CCfg := ⟨3, 0, [0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,0,1,0,1], []⟩ + +set_option maxRecDepth 200000 in +theorem zCm_init_363 : zCm zInitCCfg 363 = some zHit5CCfg := by decide + +theorem init_to_u0 : (init []) [tm]⊢* zCf (evalWords u_0 default) := by + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = evalCCfgVKQ zInitCCfg := rfl + have h1 : evalCCfgVKQ zHit5CCfg = zCf (evalWords u_0 default) := by + dsimp [evalCCfgVKQ, zHit5CCfg, zCf, pref24, u_0, evalWords, V_u, K_u, Q_u] + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + have hPlus := zTc (by decide : 0 < 363) zCm_init_363 + rw [<- h0, h1] at hPlus + exact stepStar_of_stepPlus_vkq hPlus + +-- 14 finite rounds u_0 -> u_14 +theorem reach_N (m : Nat) : + ∃ N, m <= N ∧ ∃ u, + multiStep tm (init []) N = some (zCf (evalWords u default)) ∧ + Good u := by + induction m with + | zero => + rcases init_to_u0 with ⟨k1, hk1⟩ + rcases Rounds_exec rounds_0_14 with ⟨k2, hk2⟩ + exact ⟨k1 + k2, Nat.zero_le _, u_14, multiStep_trans_vkq tm _ _ _ k1 k2 hk1 hk2, good_u14⟩ + | succ m ih => + rcases ih with ⟨N, hN, u, h_ms, hG⟩ + rcases Good_step hG with ⟨u', hStep, hG'⟩ + rcases Step_exec hStep with ⟨k, hk_pos, h_step_k⟩ + exact ⟨N + k, Nat.add_le_add hN hk_pos, u', multiStep_trans_vkq tm _ _ _ N k h_ms h_step_k, hG'⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n, hn⟩ + rcases reach_N (n + 1) with ⟨N, hN, _, h_N, _⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := multiStep_add_intermediate_vkq h_N + rw [multiStep_succ_vkq, hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LBHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_1LEHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_1LEHHH.lean new file mode 100644 index 00000000..2a40194a --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_1LEHHH.lean @@ -0,0 +1,1678 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_1LEHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_1LEHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 8000000 +@[simp] theorem zMz (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : HalfTape).head = 0 := rfl +@[simp] theorem zDt : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem zPs {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem zPt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,by omega,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) +abbrev t : BitWord := [1,1,0,0] +abbrev d0 : BitWord := [0,0] +abbrev d1 : BitWord := [1,0] +abbrev one : BitWord := [1] +abbrev lh : HalfTape := (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default +@[simp] theorem zDd : d0 +> (default : HalfTape) = default := by + simp [d0] +inductive Call where + | ch + | cj + | cp + | ca +def zCs : Call -> Fin 6 + | .ch => C + | .cj => B + | .cp => B + | .ca => B +def zCw : Call -> BitWord + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] + | .ca => [1,1,1,0,1,0] +def zCR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (r <{{zCs c}} (l <+ zCw c)) +def zCL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> r) {{D}}> l) +def zCf (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + zCL lh r +def z04 (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l,(zCR l c r1) [target_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + z04 c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem z05 {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z06 {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem z07 {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z08 {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z09 {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0a (w : BitWord) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem zSc {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases z09 h with ⟨r2,ha,hb⟩ + exact z08 (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS4 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc1 (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [target_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem z0b : Seg [.cp] [.cj] t t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0c : Seg [.cj] [.cj,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0d : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0e : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0f : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1 d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0g : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0h : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0i : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0j : Seg [.cj] [.cp] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons,append_nil]; execute) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0k : Seg [.ca] [.cj] [] t := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + have h1 : zCR l .ca ([] +> r1) = zCR ([1,0,1,0] +> l) .cj r1 := by + unfold zCR zCw zCs; simp only [append_cons,append_nil] + have h2 : (zCL ([1,0,1,0] +> l) r2) [target_tm]⊢⁺ (zCL l (t +> r2)) := by + unfold zCL t; simp only [append_cons,append_nil]; execute + rw [h1] + exact zPt (hc1 ([1,0,1,0] +> l)) h2 +theorem zS3 (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact z0a t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [zLp,h_eq,z07] + exact zSg z0d ih +theorem zSa {w2 : BitWord} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact z0a w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq,z07,zLp] + exact zSg hw ih +theorem z0l : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0m : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem z0n (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) t t := + zSg z0b (zS3 n) +theorem z0o (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using zSg z0c (zS3 n) +theorem z0p (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0e zH2) (zS3 n) +theorem z0q (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0f (zS3 n) +theorem z0r (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0g (zS3 n) +theorem z0s (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [zLp',List.cons_append,List.nil_append] using zSg z0h (zS3 n) +theorem z0t (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0i (zSg zH1 zH3) + have h1 := zSg h0 (zSa z0l n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0u (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0j (zSa z0l n) +theorem z0v : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0i zH1 +theorem z0w (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0i (zSg zH1 (zSg zH3 zH0)) + have h1 := zSg h0 (zSa z0m n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0x (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg [.cj,.ch] [.cp] d1 d1 := zSg z0j zH0 + have h1 := zSg h0 (zSa z0m n) + simpa only [zLp',List.cons_append,List.nil_append] using h1 +theorem z0y : Seg [.ca] [.cj] [] t := + z0k +theorem z0z (r : HalfTape) : + (zCf r) [target_tm]⊢⁺ (zCR ([1,1] +> default) .ca r) := by + unfold zCf zCL zCR lh zCw zCs + simp only [append_cons,append_nil] + execute +theorem z0A (r : HalfTape) : + (zCL ([1,1] +> default) r) [target_tm]⊢⁺ (zCR lh .cj r) := by + unfold zCL zCR lh zCw zCs + simp only [append_cons,append_nil] + execute +def z0B : Cfg (Fin 2) (Fin 6) := + (([1,0,1,1,0,0,1,1,0,0,0,0,1] +> default) {{C}}> ([1,1] +> default)) +def z0C : Cfg (Fin 2) (Fin 6) := + (([0,1,1,0,0,1,0,1,1] +> default) {{F}}> ([0,1,0,1,1,1,0,1] +> default)) +def z0D : Cfg (Fin 2) (Fin 6) := + (([1,0,1] +> default) {{D}}> ([1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,0,1] +> default)) +def z0E : Cfg (Fin 2) (Fin 6) := + (([1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,1] +> default) {{E}}> ([0,0,1,1] +> default)) +def z0F : Cfg (Fin 2) (Fin 6) := + (([0,1,1,0,0,0,0,1,0,0,1] +> default) {{C}}> ([1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1] +> default)) +def z0G : Cfg (Fin 2) (Fin 6) := + (([1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,1,1] +> default) {{C}}> ([0,1,1,1] +> default)) +def z0H : Cfg (Fin 2) (Fin 6) := + (([0,0,1,1,0,0,0,0,1,0,0,1,1] +> default) {{B}}> ([0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1] +> default)) +def z0I : Cfg (Fin 2) (Fin 6) := + (([0,0,0,0,1,1,0,0,0,0,0,0,1,1,1] +> default) {{B}}> ([1,1,0,1,0,1,0,1,0,1,1,1,0,1] +> default)) +def z0J : Cfg (Fin 2) (Fin 6) := + (([1,1,0,0,0,0,1,0,1,1,1] +> default) {{D}}> ([1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1] +> default)) +def z0K : Cfg (Fin 2) (Fin 6) := + (([0,0,1] +> default) {{D}}> ([1,1,0,1,1,1,1,1,1,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1] +> default)) +theorem z0L : (init []) [target_tm]⊢⁺ z0B := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init]; unfold z0B; simp only [append_cons,append_nil]; execute +theorem z0M : z0B [target_tm]⊢⁺ z0C := by + unfold z0B z0C; simp only [append_cons,append_nil]; execute +theorem z0N : z0C [target_tm]⊢⁺ z0D := by + unfold z0C z0D; simp only [append_cons,append_nil]; execute +theorem z0O : z0D [target_tm]⊢⁺ z0E := by + unfold z0D z0E; simp only [append_cons,append_nil]; execute +theorem z0P : z0E [target_tm]⊢⁺ z0F := by + unfold z0E z0F; simp only [append_cons,append_nil]; execute +theorem z0Q : z0F [target_tm]⊢⁺ z0G := by + unfold z0F z0G; simp only [append_cons,append_nil]; execute +theorem z0R : z0G [target_tm]⊢⁺ z0H := by + unfold z0G z0H; simp only [append_cons,append_nil]; execute +theorem z0S : z0H [target_tm]⊢⁺ z0I := by + unfold z0H z0I; simp only [append_cons,append_nil]; execute +theorem z0T : z0I [target_tm]⊢⁺ z0J := by + unfold z0I z0J; simp only [append_cons,append_nil]; execute +theorem pre_z0U : z0J [target_tm]⊢⁺ z0K := by + unfold z0J z0K; simp only [append_cons,append_nil]; execute +theorem pre_z0V : z0K [target_tm]⊢⁺ + zCf (([1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,1,1,0,0,1,0,1,0] : BitWord) +> default) := by + unfold z0K zCf zCL lh + simp only [append_cons,append_nil,z00] + execute +theorem pre_z0W : + (init []) [target_tm]⊢⁺ + zCf (([1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,1,1,0,0,1,0,1,0] : BitWord) +> default) := + zPt z0L + (zPt z0M + (zPt z0N + (zPt z0O + (zPt z0P + (zPt z0Q + (zPt z0R + (zPt z0S + (zPt z0T + (zPt pre_z0U pre_z0V))))))))) +inductive RIncs : Nat -> HalfTape -> HalfTape -> Prop where + | zero (r : HalfTape) : RIncs 0 r (one +> r) + | T {n : Nat} {r r' : HalfTape} : + RIncs ((1 + n) * 2) r r' -> RIncs (1 + n) (t +> r) (t +> r') + | pair0 {n : Nat} {r r' : HalfTape} : + RIncs (n * 2) r r' -> RIncs (1 + n) (d1 +> (d0 +> r)) (t +> r') + | pair1 {n : Nat} {r r' : HalfTape} : + RIncs (1 + n * 2) r r' -> RIncs (1 + n) (d1 +> (d1 +> r)) (t +> r') + | short00 {n : Nat} {r r' : HalfTape} : + RIncs (n * 2) r r' -> RIncs (2 + n * 4) (d0 +> r) (d0 +> r') + | short01 {n : Nat} {r r' : HalfTape} : + RIncs (1 + n * 2) r r' -> RIncs (2 + n * 4) (d1 +> r) (d0 +> r') + | short10 {n : Nat} {r r' : HalfTape} : + RIncs (n * 2) r r' -> RIncs (4 + n * 4) (d0 +> r) (d1 +> r') + | short11 {n : Nat} {r r' : HalfTape} : + RIncs (1 + n * 2) r r' -> RIncs (4 + n * 4) (d1 +> r) (d1 +> r') +inductive Binary : Nat -> Nat -> HalfTape -> Prop where + | one : Binary 1 1 (d1 +> default) + | zero {n H : Nat} {r : HalfTape} : + Binary (1 + n) H r -> Binary (2 + n * 2) (1 + H) (d0 +> r) + | two {n H : Nat} {r : HalfTape} : + Binary (1 + n) H r -> Binary (3 + n * 2) (1 + H) (d1 +> r) + +open WordCalculus Word +local notation "WordList" => List Word + +theorem loc_z0X (n : Nat) : 0 < 8 ^ n := by + induction n with + | zero => decide + | succ n ih => rw [Nat.pow_succ]; omega + +theorem loc_z0Z {A H : Nat} {r : HalfTape} (h : Binary A H r) : + 0 < A /\ 0 < H /\ 2 ^ H <= A * 2 /\ A < 2 ^ H := by + induction h with + | one => decide + | @zero n H r _ ih => + rw [pow_two_one_add H]; omega + | @two n H r _ ih => + rw [pow_two_one_add H]; omega + +theorem loc_z10 (n : Nat) : ∃ H r,Binary (1 + n) H r := by + induction n using Nat.strong_induction_on with + | h n ih => + cases n with + | zero => exact ⟨1,d1 +> default,Binary.one⟩ + | succ m => + rcases even_or_odd_mul_two m with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · rcases ih a (by omega) with ⟨H0,r,hI⟩ + refine ⟨1 + H0,d0 +> r,?_⟩ + have heq : 1 + (a * 2 + 1) = 2 + a * 2 := by omega + rw [heq]; exact Binary.zero hI + · rcases ih a (by omega) with ⟨H0,r,hI⟩ + refine ⟨1 + H0,d1 +> r,?_⟩ + have heq : 1 + ((1 + a * 2) + 1) = 3 + a * 2 := by omega + rw [heq]; exact Binary.two hI + +theorem loc_z11 {A H : Nat} {r : HalfTape} (h : Binary A H r) : + RIncs ((A - 1) * 2) default r := by + induction h with + | one => + have h0 := RIncs.zero (default : HalfTape) + have hd : d1 +> (default : HalfTape) = one +> default := by simp [d1,one] + rw [hd]; exact h0 + | @zero n H r _ ih => + have ih' : RIncs (n * 2) default r := by + have heq : ((1 + n) - 1) * 2 = n * 2 := by omega + rwa [heq] at ih + have hs := RIncs.short00 ih' + rw [zDd] at hs + have heq : ((2 + n * 2) - 1) * 2 = 2 + n * 4 := by omega + rwa [heq] + | @two n H r _ ih => + have ih' : RIncs (n * 2) default r := by + have heq : ((1 + n) - 1) * 2 = n * 2 := by omega + rwa [heq] at ih + have hs := RIncs.short10 ih' + rw [zDd] at hs + have heq : ((3 + n * 2) - 1) * 2 = 4 + n * 4 := by omega + rwa [heq] + +theorem loc_z1d {A H : Nat} {u : WordList} (h1 : DigitVal A H u) : + ∀ {B J : Nat} {r : HalfTape},Binary B J r -> Binary (A + B * 2 ^ H) (H + J) (evalWords u r) := by + induction h1 with + | nil => + intro B J r h2 + simpa [evalWords] using h2 + | @zero A H u _ ih => + intro B J r h2 + have hI := ih h2 + have hB := loc_z0Z hI + have hI' : Binary (1 + (A + B * 2 ^ H - 1)) (H + J) (evalWords u r) := by + have heq : 1 + (A + B * 2 ^ H - 1) = A + B * 2 ^ H := by omega + rwa [heq] + have h3 := Binary.zero hI' + have heq1 : 2 + (A + B * 2 ^ H - 1) * 2 = A * 2 + B * 2 ^ (1 + H) := by + rw [pow_two_one_add H,Nat.mul_add]; omega + have heq2 : 1 + (H + J) = (1 + H) + J := by omega + simpa [evalWords,heq1,heq2] using h3 + | @one A H u _ ih => + intro B J r h2 + have hI := ih h2 + have hB := loc_z0Z hI + have hI' : Binary (1 + (A + B * 2 ^ H - 1)) (H + J) (evalWords u r) := by + have heq : 1 + (A + B * 2 ^ H - 1) = A + B * 2 ^ H := by omega + rwa [heq] + have h3 := Binary.two hI' + have heq1 : 3 + (A + B * 2 ^ H - 1) * 2 = (1 + A * 2) + B * 2 ^ (1 + H) := by + rw [pow_two_one_add H,Nat.mul_add]; omega + have heq2 : 1 + (H + J) = (1 + H) + J := by omega + simpa [evalWords,heq1,heq2] using h3 + +def loc_z1f (ds : WordList) : Prop := ∃ w,ds = Q :: (List.replicate 1 K ++ w) + +def loc_z1g (ds : WordList) : Prop := ∃ w,ds = w ++ List.replicate 5 Q + +theorem loc_z1h (n : Nat) : DigitVal 0 n (List.replicate n K) := by + induction n with + | zero => exact DigitVal.nil + | succ n ih => + have h0 := DigitVal.zero ih + have heq : 1 + n = n + 1 := by omega + simpa [List.replicate,heq] using h0 + +theorem loc_z1i (n : Nat) : + Binary (2 ^ (n + 1) - 1) (n + 1) (evalWords (List.replicate (n + 1) Q) default) := by + rw [replicate_succ_append,evalWords_append] + dsimp [evalWords] + have hpos := pow_two_pos n + have hB := loc_z1d (digitVal_replicate_Q n) Binary.one + have heq : (2 ^ n - 1) + 1 * 2 ^ n = 2 ^ (n + 1) - 1 := by + rw [Nat.pow_succ]; omega + rwa [heq] at hB + +theorem loc_z1j (r k : Nat) (hL : 31 * 2 ^ r <= k) (hU : k < 32 * 2 ^ r) : + ∃ ds,DigitVal (1 + k * 4) (7 + r) ds /\ loc_z1f ds /\ loc_z1g ds /\ + Binary (1 + k * 4) (7 + r) (evalWords ds default) := by + let a := k - 31 * 2 ^ r + have hA : a + 31 * 2 ^ r = k := by omega + have ha_lt : a < 2 ^ r := by omega + rcases exists_digitVal_of_lt_pow r a ha_lt with ⟨v,hD⟩ + have hLow : DigitVal 1 2 (Q :: List.replicate 1 K) := by + have h1 := DigitVal.one (loc_z1h 1) + simpa using h1 + have hHigh : DigitVal k (r + 5) (v ++ List.replicate 5 Q) := by + have hApp := digitVal_append hD (digitVal_replicate_Q 5) + have heq : a + (2 ^ 5 - 1) * 2 ^ r = k := by + change a + 31 * 2 ^ r = k + exact hA + rwa [heq] at hApp + have hHighB : Binary k (r + 5) (evalWords (v ++ List.replicate 5 Q) default) := by + rw [evalWords_append] + have hB := loc_z1d hD (loc_z1i 4) + have heq : a + (2 ^ 5 - 1) * 2 ^ r = k := by + change a + 31 * 2 ^ r = k + exact hA + rwa [heq] at hB + refine ⟨(Q :: List.replicate 1 K) ++ (v ++ List.replicate 5 Q),?_,⟨v ++ List.replicate 5 Q,rfl⟩, + ⟨(Q :: List.replicate 1 K) ++ v,by rw [List.append_assoc]⟩,?_⟩ + · have hApp := digitVal_append hLow hHigh + have heq1 : 1 + k * 2 ^ 2 = 1 + k * 4 := by ring + have heq2 : 2 + (r + 5) = 7 + r := by omega + rwa [heq1,heq2] at hApp + · rw [evalWords_append] + have hB := loc_z1d hLow hHighB + have heq1 : 1 + k * 2 ^ 2 = 1 + k * 4 := by ring + have heq2 : 2 + (r + 5) = 7 + r := by omega + rwa [heq1,heq2] at hB + +theorem loc_z1k (n : Nat) : 2 ^ (3 * n) = 8 ^ n := by + induction n with + | zero => rfl + | succ n ih => + have heq : 3 * (n + 1) = 3 * n + 3 := by omega + rw [heq,Nat.pow_add,ih,Nat.pow_succ]; ring + +theorem loc_z1t {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) : + ∀ {r r' : HalfTape},RIncs b r r' -> RIncs a (evalWords u r) (evalWords v r') := by + induction h with + | nil _ => intro r r' hR; exact hR + | T _ ih => intro r r' hR; exact RIncs.T (ih hR) + | pair0 _ ih => intro r r' hR; exact RIncs.pair0 (ih hR) + | pair1 _ ih => intro r r' hR; exact RIncs.pair1 (ih hR) + | short00 _ ih => intro r r' hR; exact RIncs.short00 (ih hR) + | short01 _ ih => intro r r' hR; exact RIncs.short01 (ih hR) + | short10 _ ih => intro r r' hR; exact RIncs.short10 (ih hR) + | short11 _ ih => intro r r' hR; exact RIncs.short11 (ih hR) + +theorem loc_z1v {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) : + (a : Rat) = (b : Rat) * wordScale v + (wordMassQ v + l) * 2 := by + induction h with + | nil k => simp [wordMassQ,wordScale] + | T _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | pair0 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | pair1 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | short00 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | short01 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | short10 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | short11 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + +theorem loc_z1z {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) : wordScale v <= wordScale u := by + induction h with + | nil _ => simp [wordScale] + | T _ ih => dsimp [wordScale]; linarith + | @pair0 _ u _ _ _ _ _ => have hp := wordScale_pos u; dsimp [wordScale]; linarith + | @pair1 _ u _ _ _ _ _ => have hp := wordScale_pos u; dsimp [wordScale]; linarith + | short00 _ ih => dsimp [wordScale]; linarith + | short01 _ ih => dsimp [wordScale]; linarith + | short10 _ ih => dsimp [wordScale]; linarith + | short11 _ ih => dsimp [wordScale]; linarith + +theorem loc_z1A {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) (he : hasQKSubword u = true) : wordScale v * 8 <= wordScale u := by + induction h with + | nil _ => contradiction + | T _ ih => dsimp [hasQKSubword,wordScale] at he ⊢; have := ih he; linarith + | pair0 hS _ => have := loc_z1z hS; dsimp [wordScale]; linarith + | pair1 hS _ => have := loc_z1z hS; dsimp [wordScale]; linarith + | short00 _ ih => dsimp [hasQKSubword,wordScale] at he ⊢; have := ih he; linarith + | @short01 n u k v l hS ih => + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => dsimp [hasQKSubword,wordScale] at he ih ⊢; have := ih he; linarith + | K => exact False.elim (not_scan_odd_cons_K n u' k v l hS) + | Q => dsimp [hasQKSubword,wordScale] at he ih ⊢; have := ih he; linarith + | short10 _ ih => dsimp [hasQKSubword,wordScale] at he ⊢; have := ih he; linarith + | @short11 n u k v l hS ih => + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => dsimp [hasQKSubword,wordScale] at he ih ⊢; have := ih he; linarith + | K => exact False.elim (not_scan_odd_cons_K n u' k v l hS) + | Q => dsimp [hasQKSubword,wordScale] at he ih ⊢; have := ih he; linarith + +theorem loc_z1E {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) (he : hasQKSubword u = true) : 0 < l := by + induction h with + | nil _ => contradiction + | T _ ih => dsimp [hasQKSubword] at he; have := ih he; linarith + | pair0 hI _ => have := scan_mass_bounds hI; linarith + | pair1 hI _ => have := scan_mass_bounds hI; linarith + | short00 hI _ => have := scan_mass_bounds hI; linarith + | @short01 n u k v l hI ih => + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => dsimp [hasQKSubword] at he; have := ih he; linarith + | K => exact False.elim (not_scan_odd_cons_K n u' k v l hI) + | Q => dsimp [hasQKSubword] at he; have := ih he; linarith + | short10 hI _ => have := scan_mass_bounds hI; linarith + | @short11 n u k v l hI ih => + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => dsimp [hasQKSubword] at he; have := ih he; linarith + | K => exact False.elim (not_scan_odd_cons_K n u' k v l hI) + | Q => dsimp [hasQKSubword] at he; have := ih he; linarith + +theorem loc_z1G (n : Nat) : + ∀ (a b : Nat) (v : WordList) (l : Rat), + Scan a (List.replicate n V) b v l -> + v = List.replicate n V /\ b = a * 2 ^ n /\ l = 0 := by + induction n with + | zero => + intro a b v l hI + cases hI + exact ⟨rfl,by simp,rfl⟩ + | succ n ih => + intro a b v l hI + cases hI with + | @T m _ _ v0 l0 hJ => + rcases ih ((1 + m) * 2) b v0 l0 hJ with ⟨rfl,rfl,rfl⟩ + refine ⟨rfl,?_,by ring⟩ + rw [Nat.pow_succ]; ring + +theorem loc_z1M {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (hI : Scan a (Q :: K :: u) b v l) : + ∃ n w s,a = 1 + n /\ Scan (n * 2) u b w s /\ v = V :: w /\ l = (1 + s) * (1 / 2) := by + cases hI with + | @pair0 n _ _ w s hJ => + exact ⟨n,w,s,rfl,hJ,rfl,rfl⟩ + | @short01 n _ _ _ _ hJ => + exact False.elim (not_scan_odd_cons_K n u b _ _ hJ) + | @short11 n _ _ _ _ hJ => + exact False.elim (not_scan_odd_cons_K n u b _ _ hJ) + +theorem loc_z1N {a : Nat} {ds : WordList} {b : Nat} {v : WordList} {l : Rat} + (hI : Scan a (ds ++ [K]) b v l) + (hw : ∃ w,ds = Q :: K :: w) + (hD : ∃ A H,DigitVal A H ds) + (hZ : 2 <= wordMassK ds) : + wordMass v <= wordMassK ds * (1 / 4) /\ wordMass v + l <= wordMassK ds * (3 / 4) := by + rcases hw with ⟨w,rfl⟩ + rcases hD with ⟨A,H,hD⟩ + cases hD with + | one hJ => + cases hJ with + | zero hK => + rcases loc_z1M hI with ⟨n,x,s,_,hJ',rfl,rfl⟩ + have hB := scan_tailDefect_bound hJ' (tailDefect_append_K_of_digitVal hK) + rcases hB with ⟨hM,hL,_⟩ + have hZw := (wordMass_nonneg w).2.1 + dsimp [wordMassK,wordMass] at hZ ⊢ + constructor <;> linarith + +theorem loc_z1O {m : Nat} {u : WordList} {A H : Nat} {ds : WordList} + (hD : DigitVal A H ds) + (hS : wordScale u * ((2 ^ H : Nat) : Rat) = 1) + (hM : 1 <= m) + (hF : wordMass u + wordMassK u < 1 / 2) + (hW : ∃ w,ds = Q :: K :: w) : + ∃ b x l c y s, + Scan (m * 2) u b x l /\ Scan b (ds ++ [K]) c y s /\ 0 < c := by + rcases hW with ⟨w,rfl⟩ + have hm_q : (1 : Rat) <= (m : Rat) := by exact_mod_cast hM + have hEx1 : (wordMass u + wordMassK u) * 2 < ((m * 2 : Nat) : Rat) := by + push_cast; linarith + rcases exists_scan_of_mass_lt u m hEx1 with ⟨b,x,l,hI,hB_pos⟩ + have hBounds := scan_mass_bounds hI + have hSplit_x := wordMass_eq_add x + have hPos_x := wordMass_nonneg x + have hDelt : wordMassQ x + l < 1 / 2 := by linarith + have hBudget_eq := loc_z1v hI + have hBudget : 1 < (b : Rat) * wordScale x := by + push_cast at hBudget_eq; linarith + have hRest : (wordMass (w ++ [K]) + wordMassK (w ++ [K]) + 2) * wordScale x <= 1 := by + rw [<- (digitVal_scale_and_mass hD).1] at hS + cases hD with + | one hJ => + cases hJ with + | zero hK => + have hDw := digitVal_scale_and_mass hK + have hSc := loc_z1z hI + have hPos_w := wordMass_nonneg w + have hSplit_w := wordMass_eq_add w + have hSc_x := wordScale_pos x + have hSc_u := wordScale_pos u + have hSc_w := wordScale_pos w + dsimp [wordScale] at hS + rw [wordMass_append,wordMassK_append] + dsimp [wordMass,wordMassK] + nlinarith + cases b with + | zero => omega + | succ b => + have hSc_x := wordScale_pos x + have hEx2 : (wordMass (w ++ [K]) + wordMassK (w ++ [K])) * 2 < ((b * 2 : Nat) : Rat) := by + push_cast at hBudget ⊢ + nlinarith + rcases exists_scan_of_mass_lt (w ++ [K]) b hEx2 with ⟨c,y,s,hJ,hC_pos⟩ + refine ⟨1 + b,x,l,c,V :: y,(1 + s) * (1 / 2),?_,?_,hC_pos⟩ + · have heq : 1 + b = b + 1 := by omega + rwa [heq] + · exact Scan.pair0 hJ + +theorem loc_z1Q (r a : Nat) (u : WordList) (b : Nat) (v : WordList) (l : Rat) + (hI : Scan a (u ++ List.replicate (1 + r * 2) Q ++ [K]) b v l) : + ∃ w k,v = w ++ List.replicate (1 + r) V /\ b = k * 2 ^ (1 + r) := by + rcases split_trailing_Q u with ⟨p,n,rfl,hP⟩ + have hE : (p ++ List.replicate n Q) ++ List.replicate (1 + r * 2) Q ++ [K] = + p ++ (List.replicate (1 + r * 2 + n) Q ++ [K]) := by + have heq : 1 + r * 2 + n = n + (1 + r * 2) := by omega + rw [heq,List.replicate_add n (1 + r * 2)] + simp only [List.append_assoc] + rw [hE] at hI + rcases scan_split_of_splitCond hI p (List.replicate (1 + r * 2 + n) Q ++ [K]) rfl (Or.inl hP) with ⟨c,x,y,s,t0,_,hK,rfl,_⟩ + rcases scan_add_Q_K_inv n r c b y t0 hK with ⟨w,k,rfl,rfl⟩ + exact ⟨x ++ w,k,by rw [List.append_assoc],rfl⟩ + +theorem loc_z1R {ds : WordList} (h : loc_z1f ds) : ∃ w,ds = Q :: K :: w := by + rcases h with ⟨w,rfl⟩ + exact ⟨w,rfl⟩ + +theorem loc_z1S {ds : WordList} (h : loc_z1f ds) : 2 <= wordMassK ds := by + rcases h with ⟨w,rfl⟩ + have hw := (wordMass_nonneg w).2.1 + dsimp [List.replicate,wordMassK] + linarith + +theorem loc_z1T {m : Nat} {u : WordList} {A H : Nat} {ds : WordList} + (hD : DigitVal A H ds) + (hS : wordScale u * ((2 ^ H : Nat) : Rat) = 1) + (hM : 1 <= m) + (hF : (5 / 2) * wordMass u + wordMassK u + wordScale u * wordMassK ds <= 1 / 32) + (hLo : loc_z1f ds) + (hHi : loc_z1g ds) : + ∃ k v l g, + Scan (m * 2) (u ++ ds ++ [K]) (k * 8) v l /\ + (∃ w,v = w ++ List.replicate 3 V) /\ + wordScale v * ((8 ^ g : Nat) : Rat) = 2 /\ + wordMass v <= wordMass u + (1 / 4) * (wordScale u * wordMassK ds) /\ + wordMass v + l <= wordMass u + wordMassK u + (3 / 4) * (wordScale u * wordMassK ds) /\ + 0 < wordMassQ v + l /\ wordMassQ v + l <= 1 / 32 := by + rcases hHi with ⟨w,hHi_eq⟩ + have hU := wordMass_nonneg u + have hDs := wordMass_nonneg ds + have hSu := wordScale_pos u + have hSmall : wordMass u + wordMassK u < 1 / 2 := by nlinarith + rcases loc_z1O hD hS hM hSmall (loc_z1R hLo) with ⟨b,x,s,c,y,t0,hI1,hI2,_⟩ + rcases scan_append hI1 hI2 with ⟨l,hI,rfl⟩ + have hI_assoc : Scan (m * 2) (u ++ ds ++ [K]) c (x ++ y) (s + wordScale x * t0) := by + simpa [List.append_assoc] using hI + have hEnd : ∃ p k,x ++ y = p ++ List.replicate 3 V /\ c = k * 8 := by + have hI_hi : Scan (m * 2) ((u ++ w) ++ List.replicate (1 + 2 * 2) Q ++ [K]) c (x ++ y) (s + wordScale x * t0) := by + have heq_list : u ++ ds ++ [K] = (u ++ w) ++ List.replicate (1 + 2 * 2) Q ++ [K] := by + rw [hHi_eq]; simp [List.append_assoc] + rwa [<- heq_list] + rcases loc_z1Q 2 (m * 2) (u ++ w) c (x ++ y) (s + wordScale x * t0) hI_hi with ⟨p,k,hE,hC⟩ + exact ⟨p,k,hE,hC⟩ + rcases hEnd with ⟨p,k,hE,rfl⟩ + rcases scan_scale_pow_eight hI_assoc with ⟨g,hG⟩ + refine ⟨k,x ++ y,s + wordScale x * t0,g,hI_assoc,⟨p,hE⟩,?_,?_,?_,?_⟩ + · rw [wordScale_append,wordScale_append] at hG + dsimp [wordScale] at hG + rw [(digitVal_scale_and_mass hD).1] at hG + nlinarith + · have hB1 := scan_mass_bounds hI1 + have hS1 := loc_z1z hI1 + have hB2 := loc_z1N hI2 (loc_z1R hLo) ⟨A,H,hD⟩ (loc_z1S hLo) + have hSx := wordScale_pos x + rw [wordMass_append]; nlinarith + · have hB1 := scan_mass_bounds hI1 + have hS1 := loc_z1z hI1 + have hB2 := loc_z1N hI2 (loc_z1R hLo) ⟨A,H,hD⟩ (loc_z1S hLo) + have hSx := wordScale_pos x + rw [wordMass_append]; nlinarith + · have hW : hasQKSubword (u ++ ds ++ [K]) = true := by + rw [List.append_assoc] + apply hasQKSubword_append_right + rcases loc_z1R hLo with ⟨z,rfl⟩ + rfl + have hLoss := loc_z1E hI_assoc hW + have hB1 := scan_mass_bounds hI1 + have hS1 := loc_z1z hI1 + have hB2 := loc_z1N hI2 (loc_z1R hLo) ⟨A,H,hD⟩ (loc_z1S hLo) + have hSx := wordScale_pos x + have hMv : wordMass (x ++ y) + (s + wordScale x * t0) <= wordMass u + wordMassK u + (3 / 4) * (wordScale u * wordMassK ds) := by + rw [wordMass_append]; nlinarith + have hSuz : 0 <= wordScale u * wordMassK ds := by nlinarith + have hPos_xy := wordMass_nonneg (x ++ y) + have hSplit_xy := wordMass_eq_add (x ++ y) + constructor <;> linarith + +theorem loc_z1U {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} {H : Nat} {r : HalfTape} + (hI : Scan a u (b * 2) v l) (hB : Binary (1 + b) H r) : + RIncs a (evalWords u default) (evalWords v r) := by + apply loc_z1t hI + have hR := loc_z11 hB + have heq : ((1 + b) - 1) * 2 = b * 2 := by omega + rwa [heq] at hR + +theorem loc_z1V (m g k : Nat) (s delta : Rat) + (hM : m = 1 \/ m = 2) + (hS : s * ((8 ^ g : Nat) : Rat) = 2) + (hB : ((m * 2 : Nat) : Rat) = ((k * 8 : Nat) : Rat) * s + delta * 2) + (hPos : 0 < delta) + (hSmall : delta <= 1 / 32) : + ∃ n,g = 3 + n /\ 31 * 2 ^ (m + 3 * n) <= k /\ k < 32 * 2 ^ (m + 3 * n) := by + have hMq : (1 : Rat) <= (m : Rat) /\ (m : Rat) <= 2 := by + rcases hM with rfl | rfl <;> norm_num + have hPow : (0 : Rat) < ((8 ^ g : Nat) : Rat) := by exact_mod_cast loc_z0X g + have hEq : ((k * 8 : Nat) : Rat) = ((m : Rat) - delta) * ((8 ^ g : Nat) : Rat) := by + push_cast at hB ⊢ + have hE : (k : Rat) * 8 * s = ((m : Rat) - delta) * 2 := by linarith + have hE' : (k : Rat) * 8 * (s * ((8 ^ g : Nat) : Rat)) = ((m : Rat) - delta) * 2 * ((8 ^ g : Nat) : Rat) := by + calc (k : Rat) * 8 * (s * ((8 ^ g : Nat) : Rat)) + _ = ((k : Rat) * 8 * s) * ((8 ^ g : Nat) : Rat) := by ring + _ = ((m : Rat) - delta) * 2 * ((8 ^ g : Nat) : Rat) := by rw [hE] + rw [hS] at hE' + push_cast at hE' + linarith + have hK : 0 < k := by + by_contra hk0 + have hk_eq : k = 0 := by omega + subst hk_eq + push_cast at hPow hEq + nlinarith + have hR_q : ((k * 8 : Nat) : Rat) < ((m * 8 ^ g : Nat) : Rat) := by + push_cast at hPow hEq ⊢ + nlinarith + have hR : k * 8 < m * 8 ^ g := by exact_mod_cast hR_q + have hg1 : 1 <= g := by + by_contra hg_lt + have hg_eq : g = 0 := by omega + subst hg_eq + rcases hM with rfl | rfl <;> omega + let n1 := g - 1 + have hg_eq : g = 1 + n1 := by omega + rw [hg_eq] at hR hEq + have hpow_1n : 8 ^ (1 + n1) = 8 * 8 ^ n1 := by + rw [Nat.pow_add] + rw [hpow_1n] at hR hEq + have hRn : k + 1 <= m * 8 ^ n1 := by + rcases hM with rfl | rfl <;> omega + have hRn_q : ((k + 1 : Nat) : Rat) <= ((m * 8 ^ n1 : Nat) : Rat) := by exact_mod_cast hRn + have hPow_n1 : (0 : Rat) <= ((8 ^ n1 : Nat) : Rat) := by positivity + have hP : (32 : Rat) <= ((8 ^ n1 : Nat) : Rat) := by + push_cast at hEq hRn_q ⊢ + nlinarith + have hP_nat : 32 <= 8 ^ n1 := by exact_mod_cast hP + have hN : 2 <= n1 := by + by_contra hn2 + have hn1 : n1 <= 1 := by omega + have hle1 : 8 ^ n1 <= 8 ^ 1 := Nat.pow_le_pow_right (by decide) hn1 + (try omega) + let j := n1 - 2 + have hNJ : n1 = 2 + j := by omega + refine ⟨j,by omega,?_,?_⟩ + · rw [hNJ,Nat.pow_add 8 2 j] at hEq + have hPow_j : (0 : Rat) < ((8 ^ j : Nat) : Rat) := by exact_mod_cast loc_z0X j + have h_le_q : ((31 * 2 ^ (m + 3 * j) : Nat) : Rat) <= (k : Rat) := by + rw [Nat.pow_add 2 m (3 * j),loc_z1k] + rcases hM with rfl | rfl <;> (push_cast at hPow_j hEq ⊢; nlinarith) + exact_mod_cast h_le_q + · rw [hNJ,Nat.pow_add 8 2 j] at hEq + have hPow_j : (0 : Rat) < ((8 ^ j : Nat) : Rat) := by exact_mod_cast loc_z0X j + have h_lt_q : (k : Rat) < ((32 * 2 ^ (m + 3 * j) : Nat) : Rat) := by + rw [Nat.pow_add 2 m (3 * j),loc_z1k] + rcases hM with rfl | rfl <;> (push_cast at hPow_j hEq ⊢; nlinarith) + exact_mod_cast h_lt_q + +theorem loc_z1W {m : Nat} {a : WordList} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + {H : Nat} {ds : WordList} {z : Rat} + (hI : Scan (m * 2) a (b * 2) v l) + (hD : DigitVal (1 + b) H ds) + (hS : wordScale v * wordScale ds = (m : Rat)) + (hM : wordMass v <= wordMass u + (1 / 4) * z) + (hB : wordMass v + l <= wordMass u + wordMassK u + (3 / 4) * z) + (hZ : 0 <= z) : + (5 / 2) * wordMass v + wordMassK (v ++ ds) <= + (7 / 5) * ((5 / 2) * wordMass u + wordMassK u + z) := by + have hE := loc_z1v hI + have hDt := digitVal_wordMassK_eq hD + have hDs := (digitVal_scale_and_mass hD).1 + have hSplit_v := wordMass_eq_add v + have hPos_u := wordMass_nonneg u + have hSv := wordScale_pos v + push_cast at hE hDt hDs + rw [wordMassK_append] + nlinarith + +theorem loc_z1X (m n : Nat) (s : Rat) + (hM : m = 1 \/ m = 2) + (hS : s * ((8 ^ (3 + n) : Nat) : Rat) = 2) : + s * ((2 ^ (7 + (m + 3 * n)) : Nat) : Rat) = (m : Rat) := by + have h8 : 8 ^ (3 + n) = 512 * 8 ^ n := by + rw [Nat.pow_add 8 3 n] + rw [h8] at hS + have h2 : 2 ^ (7 + (m + 3 * n)) = 128 * 2 ^ m * 8 ^ n := by + rw [Nat.pow_add 2 7 _,Nat.pow_add 2 m (3 * n),loc_z1k]; ring + rw [h2] + rcases hM with rfl | rfl <;> (push_cast at hS ⊢; linarith) + +inductive C24Good (bound : Rat) : HalfTape -> Prop where + | intro (u : WordList) (A H : Nat) (ds : WordList) : + DigitVal A H ds -> + wordScale u * ((2 ^ H : Nat) : Rat) = 1 -> + (5 / 2) * wordMass u + wordMassK u + wordScale u * wordMassK ds <= bound -> + loc_z1f ds -> + loc_z1g ds -> + C24Good bound (evalWords (u ++ ds) default) + +theorem loc_z1Y (m : Nat) (bound bound' : Rat) (r : HalfTape) + (hM : m = 1 \/ m = 2) + (hLimit : bound <= 1 / 32) + (hG : C24Good bound r) + (hRate : (7 / 5) * bound <= (m : Rat) * bound') : + ∃ r',RIncs (m * 2) r r' /\ C24Good bound' (evalWords (List.replicate (m - 1) V) r') := by + rcases hG with ⟨u,A,H,ds,hD,hS,hF,hLo,hHi⟩ + have hPos_m : 1 <= m := by rcases hM with rfl | rfl <;> omega + have hSmall : (5 / 2) * wordMass u + wordMassK u + wordScale u * wordMassK ds <= 1 / 32 := by linarith + rcases loc_z1T hD hS hPos_m hSmall hLo hHi with ⟨k,v,l,g,hI,hEnd,hScale,hMv,hBv,hPos,hUpper⟩ + have hBudget := loc_z1v hI + rcases loc_z1V m g k (wordScale v) (wordMassQ v + l) hM hScale hBudget hPos hUpper with ⟨n,rfl,hKl,hKu⟩ + rcases loc_z1j (m + 3 * n) k hKl hKu with ⟨ds',hD',hLo',hHi',hBin⟩ + have hScale' : wordScale v * wordScale ds' = (m : Rat) := by + rw [(digitVal_scale_and_mass hD').1] + exact loc_z1X m n (wordScale v) hM hScale + have hI' : Scan (m * 2) (u ++ ds ++ [K]) ((k * 4) * 2) v l := by + have heq : k * 8 = (k * 4) * 2 := by omega + rwa [<- heq] + have hR := loc_z1U hI' hBin + have hd0_side : evalWords [K] default = default := zDd + have hR' : RIncs (m * 2) (evalWords (u ++ ds) default) (evalWords (v ++ ds') default) := by + rw [evalWords_append (u ++ ds) [K],hd0_side,<- evalWords_append v ds'] at hR + exact hR + have hZ : 0 <= wordScale u * wordMassK ds := by + have hSu := wordScale_pos u + have hPos_ds := (wordMass_nonneg ds).2.1 + nlinarith + have hWeight := loc_z1W hI' hD' hScale' hMv hBv hZ + refine ⟨evalWords (v ++ ds') default,hR',?_⟩ + rw [<- evalWords_append,<- List.append_assoc] + refine C24Good.intro (List.replicate (m - 1) V ++ v) (1 + k * 4) (7 + (m + 3 * n)) ds' hD' ?_ ?_ hLo' hHi' + · rw [<- (digitVal_scale_and_mass hD').1,wordScale_append] + rcases hM with rfl | rfl <;> (dsimp [List.replicate,wordScale]; push_cast at hScale'; nlinarith) + · rw [wordMass_append,wordMassK_append,wordScale_append] + rw [wordMassK_append] at hWeight + rcases hM with rfl | rfl <;> (dsimp [List.replicate,wordMass,wordMassK,wordScale]; push_cast at hRate; nlinarith) + +theorem loc_z1Z {r : HalfTape} (hG : C24Good (1 / 64) r) : + ∃ s r',RIncs 2 r s /\ RIncs 4 s r' /\ C24Good (1 / 64) (t +> r') := by + rcases loc_z1Y 1 (1 / 64) ((7 / 5) * (1 / 64)) r (Or.inl rfl) (by norm_num) hG (by norm_num) with ⟨s,hR,hH⟩ + dsimp [List.replicate,evalWords] at hH + rcases loc_z1Y 2 ((7 / 5) * (1 / 64)) (1 / 64) s (Or.inr rfl) (by norm_num) hH (by norm_num) with ⟨r',hS,hI⟩ + dsimp [List.replicate,evalWords] at hI + exact ⟨s,r',hR,hS,hI⟩ + +theorem ne_of_beq_eq_false {a b : Nat} (h : (a == b) = false) : a ≠ b := by + intro heq; subst heq; exact Bool.noConfusion (h.symm.trans (beq_self_eq_true a)) + +def loc_zPf : Nat -> Nat -> Option (WordList) + | 0,_ => none + | fuel + 1,k => + if k == 0 then none + else if k == 1 then some [Q] + else match loc_zPf fuel (k / 2) with + | none => none + | some ws => some ((if k % 2 == 0 then K else Q) :: ws) + +theorem loc_z20 (fuel : Nat) : + ∀ (k : Nat) (ws : WordList),loc_zPf fuel k = some ws -> + ∃ H,Binary k H (evalWords ws default) := by + induction fuel with + | zero => intro k ws h; contradiction + | succ fuel ih => + intro k ws h + dsimp [loc_zPf] at h + cases hk0 : (k == 0) with + | true => rw [hk0] at h; contradiction + | false => + rw [hk0] at h; dsimp at h + have hk0' : k ≠ 0 := ne_of_beq_eq_false hk0 + cases hk1 : (k == 1) with + | true => + rw [hk1] at h; dsimp at h + injection h with h; subst h + have rfl_k : k = 1 := beq_iff_eq.mp hk1 + subst rfl_k + exact ⟨1,Binary.one⟩ + | false => + rw [hk1] at h; dsimp at h + have hk1' : k ≠ 1 := ne_of_beq_eq_false hk1 + cases hrec : loc_zPf fuel (k / 2) with + | none => rw [hrec] at h; contradiction + | some ws' => + rw [hrec] at h; dsimp at h + injection h with h; subst h + rcases ih (k / 2) ws' hrec with ⟨H,hB⟩ + have hq : k / 2 = 1 + (k / 2 - 1) := by omega + rw [hq] at hB + rcases Nat.mod_two_eq_zero_or_one k with hmod | hmod + · have hcond : (k % 2 == 0) = true := beq_iff_eq.mpr hmod + rw [hcond]; dsimp [evalWords] + refine ⟨1 + H,?_⟩ + have heq : k = 2 + (k / 2 - 1) * 2 := by omega + rw [heq]; exact Binary.zero hB + · have hcond : (k % 2 == 0) = false := beq_false_of_ne (by omega) + rw [hcond]; dsimp [evalWords] + refine ⟨1 + H,?_⟩ + have heq : k = 3 + (k / 2 - 1) * 2 := by omega + rw [heq]; exact Binary.two hB + +def loc_z27 (e : Bool) : Word := if e then Q else K + +def loc_z28 (e : Bool) (k : Nat) : Option (Word × Nat) := + if k == 0 then none + else if k % 2 == 0 then + if k % 4 == 2 then + some (K,bitStepNat e (k / 4)) + else + some (Q,bitStepNat e (k / 4 - 1)) + else none + +theorem loc_z29 (e : Bool) (k : Nat) (d : Word) (k' : Nat) (r r' : HalfTape) + (hS : loc_z28 e k = some (d,k')) (hI : RIncs k' r r') : + RIncs k (evalWords [loc_z27 e] r) (evalWords [d] r') := by + dsimp [loc_z28] at hS + cases hk0 : (k == 0) with + | true => rw [hk0] at hS; contradiction + | false => + rw [hk0] at hS; dsimp at hS + have hk0' : k ≠ 0 := ne_of_beq_eq_false hk0 + cases hk2 : (k % 2 == 0) with + | false => rw [hk2] at hS; contradiction + | true => + rw [hk2] at hS; dsimp at hS + have hk2' : k % 2 = 0 := beq_iff_eq.mp hk2 + cases hk4 : (k % 4 == 2) with + | true => + rw [hk4] at hS; dsimp at hS + injection hS with hS1; injection hS1 with hS1 hS2; subst hS1; subst hS2 + have hk4' : k % 4 = 2 := beq_iff_eq.mp hk4 + have hk_eq : k = 2 + (k / 4) * 4 := by omega + rw [hk_eq] + cases e + · exact RIncs.short00 hI + · exact RIncs.short01 hI + | false => + rw [hk4] at hS; dsimp at hS + injection hS with hS1; injection hS1 with hS1 hS2; subst hS1; subst hS2 + have hk4' : k % 4 ≠ 2 := ne_of_beq_eq_false hk4 + have hk_eq : k = 4 + (k / 4 - 1) * 4 := by omega + rw [hk_eq] + cases e + · exact RIncs.short10 hI + · exact RIncs.short11 hI + +def loc_z2b : Nat -> WordList -> Nat -> WordList -> Option (WordList) + | 0,_,_,_ => none + | fuel + 1,u,k,acc => + if k == 0 then + if u.all isWordK then some (acc.reverseAux [Q]) else none + else + match u with + | [] => + if k % 2 == 0 then + match loc_zPf 512 (1 + k / 2) with + | some ws => some (acc.reverseAux ws) + | none => none + else none + | V :: u' => loc_z2b fuel u' (k * 2) (V :: acc) + | K :: u' => + match loc_z28 false k with + | some (d,k') => loc_z2b fuel u' k' (d :: acc) + | none => none + | Q :: u' => + if (k % 2 == 0) && startsWithKOrNil (Q :: u') then + match loc_z28 true k with + | some (d,k') => loc_z2b fuel u' k' (d :: acc) + | none => none + else + match u' with + | K :: v => loc_z2b fuel v ((k - 1) * 2) (V :: acc) + | Q :: v => loc_z2b fuel v (1 + (k - 1) * 2) (V :: acc) + | _ => none + +theorem loc_z2c (fuel : Nat) : + ∀ (u : WordList) (k : Nat) (acc v : WordList),loc_z2b fuel u k acc = some v -> + ∃ w,v = acc.reverseAux w /\ RIncs k (evalWords u default) (evalWords w default) := by + induction fuel with + | zero => intro u k acc v hE; contradiction + | succ fuel ih => + intro u k acc v hE + dsimp [loc_z2b] at hE + cases hk0 : (k == 0) with + | true => + rw [hk0] at hE; dsimp at hE + have rfl_k : k = 0 := beq_iff_eq.mp hk0; subst rfl_k + cases hu : u.all isWordK with + | false => rw [hu] at hE; contradiction + | true => + rw [hu] at hE; dsimp at hE + injection hE with hE; subst hE + refine ⟨[Q],rfl,?_⟩ + rw [evalWords_default_of_all_K u hu] + have h0 := RIncs.zero (default : HalfTape) + simpa [evalWords,d1,one] using h0 + | false => + rw [hk0] at hE; dsimp at hE + have hk0' : k ≠ 0 := ne_of_beq_eq_false hk0 + cases u with + | nil => + cases hk2 : (k % 2 == 0) with + | false => rw [hk2] at hE; contradiction + | true => + rw [hk2] at hE; dsimp at hE + have hk2' : k % 2 = 0 := beq_iff_eq.mp hk2 + cases hp : loc_zPf 512 (1 + k / 2) with + | none => rw [hp] at hE; contradiction + | some ws => + rw [hp] at hE; dsimp at hE + injection hE with hE; subst hE + rcases loc_z20 512 (1 + k / 2) ws hp with ⟨H,hB⟩ + have hR := loc_z11 hB + have heq : ((1 + k / 2) - 1) * 2 = k := by omega + rw [heq] at hR + exact ⟨ws,rfl,hR⟩ + | cons x u' => + cases x + · dsimp at hE + rcases ih u' (k * 2) (V :: acc) v hE with ⟨w,rfl,hR⟩ + refine ⟨V :: w,rfl,?_⟩ + have hk_eq : k = 1 + (k - 1) := by omega + have hk2_eq : k * 2 = (1 + (k - 1)) * 2 := by omega + rw [hk2_eq] at hR + rw [hk_eq] + exact RIncs.T hR + · dsimp at hE + cases hS : loc_z28 false k with + | none => rw [hS] at hE; contradiction + | some dk => + rcases dk with ⟨d,k'⟩ + rw [hS] at hE; dsimp at hE + rcases ih u' k' (d :: acc) v hE with ⟨w,rfl,hR⟩ + have hsub := loc_z29 false k d k' _ _ hS hR + rw [<- evalWords_append [d] w default] at hsub + exact ⟨d :: w,rfl,hsub⟩ + · dsimp at hE + cases hcond : ((k % 2 == 0) && startsWithKOrNil (Q :: u')) with + | true => + rw [hcond] at hE; dsimp at hE + cases hS : loc_z28 true k with + | none => rw [hS] at hE; contradiction + | some dk => + rcases dk with ⟨d,k'⟩ + rw [hS] at hE; dsimp at hE + rcases ih u' k' (d :: acc) v hE with ⟨w,rfl,hR⟩ + have hsub := loc_z29 true k d k' _ _ hS hR + rw [<- evalWords_append [d] w default] at hsub + exact ⟨d :: w,rfl,hsub⟩ + | false => + rw [hcond] at hE; dsimp at hE + cases u' with + | nil => contradiction + | cons x2 u'' => + cases x2 + · contradiction + · dsimp at hE + rcases ih u'' ((k - 1) * 2) (V :: acc) v hE with ⟨w,rfl,hR⟩ + refine ⟨V :: w,rfl,?_⟩ + have hk_eq : k = 1 + (k - 1) := by omega + rw [hk_eq] + exact RIncs.pair0 hR + · dsimp at hE + rcases ih u'' (1 + (k - 1) * 2) (V :: acc) v hE with ⟨w,rfl,hR⟩ + refine ⟨V :: w,rfl,?_⟩ + have hk_eq : k = 1 + (k - 1) := by omega + rw [hk_eq] + exact RIncs.pair1 hR + +def loc_z2d (k : Nat) (u : WordList) : Option (WordList) := + loc_z2b 1024 (u ++ [K]) k [] + +theorem loc_z2e (k : Nat) (u v : WordList) (hE : loc_z2d k u = some v) : + RIncs k (evalWords u default) (evalWords v default) := by + rcases loc_z2c 1024 (u ++ [K]) k [] v hE with ⟨w,rfl,hR⟩ + have hd0_side : evalWords [K] default = default := zDd + rw [evalWords_append u [K],hd0_side] at hR + exact hR + +def loc_z2i (c0 c1 : Nat) : WordList -> Nat -> Nat + | [],n => n + | V :: u,n => loc_z2i c0 c1 u (halfCeil n) + | K :: u,n => loc_z2i c0 c1 u (n * 2 + c0) + | Q :: u,n => loc_z2i c0 c1 u (n * 2 + c1) + +theorem loc_z2k (c0 c1 : Nat) (u : WordList) : + ∀ (n : Nat), + (c0 : Rat) * wordMassK u.reverse + (c1 : Rat) * wordMassQ u.reverse + wordScale u.reverse * (n : Rat) <= + ((loc_z2i c0 c1 u n : Nat) : Rat) := by + induction u with + | nil => + intro n + simp [wordMassK,wordMassQ,wordScale,loc_z2i] + | cons w u ih => + intro n + have hsp := wordScale_pos u.reverse + cases w + · dsimp [loc_z2i] + rw [List.reverse_cons,wordMassK_append,wordMassQ_append,wordScale_append] + dsimp [wordMassK,wordMassQ,wordScale] + have hhu := rat_le_two_mul_halfCeil n + have hih := ih (halfCeil n) + nlinarith + · dsimp [loc_z2i] + rw [List.reverse_cons,wordMassK_append,wordMassQ_append,wordScale_append] + dsimp [wordMassK,wordMassQ,wordScale] + have hih := ih (n * 2 + c0) + push_cast at hih + nlinarith + · dsimp [loc_z2i] + rw [List.reverse_cons,wordMassK_append,wordMassQ_append,wordScale_append] + dsimp [wordMassK,wordMassQ,wordScale] + have hih := ih (n * 2 + c1) + push_cast at hih + nlinarith + +theorem loc_z2l (c0 c1 : Nat) (u : WordList) (n : Nat) : + (c0 : Rat) * wordMassK u + (c1 : Rat) * wordMassQ u + wordScale u * (n : Rat) <= + ((loc_z2i c0 c1 u.reverse n : Nat) : Rat) := by + have h := loc_z2k c0 c1 u.reverse n + simpa [List.reverse_reverse] using h + +def loc_z2r (u ds : WordList) : Bool := + decide (loc_z2i (7 * 65536) (5 * 65536) u.reverse + (loc_z2i (2 * 65536) 0 ds.reverse 0) <= 2048) + +theorem loc_z2s (u ds : WordList) (hE : loc_z2r u ds = true) : + (5 / 2) * wordMass u + wordMassK u + wordScale u * wordMassK ds <= 1 / 64 := by + unfold loc_z2r at hE + have hle : loc_z2i (7 * 65536) (5 * 65536) u.reverse (loc_z2i (2 * 65536) 0 ds.reverse 0) <= 2048 := + of_decide_eq_true hE + have hle_q : ((loc_z2i (7 * 65536) (5 * 65536) u.reverse (loc_z2i (2 * 65536) 0 ds.reverse 0) : Nat) : Rat) <= 2048 := by + exact_mod_cast hle + have hD := loc_z2l (2 * 65536) 0 ds 0 + have hU := loc_z2l (7 * 65536) (5 * 65536) u (loc_z2i (2 * 65536) 0 ds.reverse 0) + have hSu := wordScale_pos u + have hSplit := wordMass_eq_add u + push_cast at hD hU + nlinarith + +def loc_z2u : WordList := Q :: List.replicate 1 K + +def loc_z2v : WordList := List.replicate 5 Q + +def loc_z2w (u : WordList) : Bool := + match splitPrefixDigits u with + | none => false + | some (p,ds) => + match heightShift p 0 with + | none => false + | some H => + if H == ds.length then + match stripWordPrefix loc_z2u ds, + stripWordPrefix loc_z2v ds.reverse with + | some _,some _ => loc_z2r p ds + | _,_ => false + else false + +theorem loc_z2x (u : WordList) (hE : loc_z2w u = true) : + C24Good (1 / 64) (evalWords u default) := by + unfold loc_z2w at hE + cases hC : splitPrefixDigits u with + | none => rw [hC] at hE; contradiction + | some pds => + rcases pds with ⟨p,ds⟩ + rw [hC] at hE; dsimp at hE + cases hU : heightShift p 0 with + | none => rw [hU] at hE; contradiction + | some H => + rw [hU] at hE; dsimp at hE + cases hL : (H == ds.length) with + | false => rw [hL] at hE; contradiction + | true => + rw [hL] at hE; dsimp at hE + have rfl_H : H = ds.length := beq_iff_eq.mp hL + subst rfl_H + cases hLo : stripWordPrefix loc_z2u ds with + | none => rw [hLo] at hE; contradiction + | some lo => + rw [hLo] at hE + cases hHi : stripWordPrefix loc_z2v ds.reverse with + | none => rw [hHi] at hE; contradiction + | some hi => + rw [hHi] at hE; dsimp at hE + rcases splitPrefixDigits_sound u p ds hC with ⟨rfl,hD⟩ + rcases exists_digitVal_of_all_isDigitWord ds hD with ⟨A,hDA⟩ + refine C24Good.intro p A ds.length ds hDA ?_ ?_ ?_ ?_ + · have hsp := heightShift_sound p 0 ds.length hU + simpa using hsp + · exact loc_z2s p ds hE + · exact ⟨lo,stripWordPrefix_sound loc_z2u ds lo hLo⟩ + · have hHi_eq := stripWordPrefix_sound loc_z2v ds.reverse hi hHi + have hRev := congrArg List.reverse hHi_eq + rw [List.reverse_reverse,List.reverse_append] at hRev + change ds = hi.reverse ++ (List.replicate 5 Q).reverse at hRev + rw [replicate_reverse] at hRev + exact ⟨hi.reverse,hRev⟩ + +def loc_z2y (u : WordList) : Option (WordList) := + match loc_z2d 2 u with + | none => none + | some v => + match loc_z2d 4 v with + | none => none + | some w => some (V :: w) + +inductive C24Rounds : HalfTape -> HalfTape -> Prop where + | refl (r : HalfTape) : C24Rounds r r + | next {r s v w : HalfTape} : + RIncs 2 r s -> RIncs 4 s v -> C24Rounds (t +> v) w -> C24Rounds r w + +def loc_z2z : Nat -> WordList -> Bool + | 0,u => loc_z2w u + | n + 1,u => + match loc_z2y u with + | none => false + | some v => loc_z2z n v + +theorem loc_z2A (n : Nat) : + ∀ (u : WordList),loc_z2z n u = true -> + ∃ r,C24Rounds (evalWords u default) r /\ C24Good (1 / 64) r := by + induction n with + | zero => + intro u hE + exact ⟨evalWords u default,C24Rounds.refl _,loc_z2x u hE⟩ + | succ n ih => + intro u hE + dsimp [loc_z2z,loc_z2y] at hE + cases hV : loc_z2d 2 u with + | none => rw [hV] at hE; contradiction + | some v => + rw [hV] at hE; dsimp at hE + cases hW : loc_z2d 4 v with + | none => rw [hW] at hE; contradiction + | some w => + rw [hW] at hE; dsimp at hE + rcases ih (V :: w) hE with ⟨r,hR,hG⟩ + exact ⟨r,C24Rounds.next (loc_z2e 2 u v hV) (loc_z2e 4 v w hW) hR,hG⟩ + +def loc_z2B : WordList := + List.replicate 3 V ++ [Q,V,K,K,V,Q,Q] + +set_option maxRecDepth 4000000 in +theorem loc_z2C : loc_z2z 8 loc_z2B = true := by + decide + +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) + +def loc_z2D (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs,Num k w hs -> Side hs (w +> r) r' + +theorem loc_z2E {r r' : HalfTape} (h : loc_z2D 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl + +theorem loc_z2F {n : Nat} {r r' : HalfTape} + (hI : loc_z2D ((1 + n) * 2) r r') : loc_z2D (1 + n) (t +> r) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil] + refine zSc (z0n m) ?_ + have hN2 : Num ((1 + n) * 2) [] ([.cj] ++ [.ch] ^ (m * 2)) := by + have hm : (1 + n) * 2 = 2 + (m * 2) * 2 := by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil] + refine zSc (z0o m) ?_ + have hN2 : Num ((1 + n) * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : (1 + n) * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + +theorem loc_z2G {n : Nat} {r r' : HalfTape} + (hI : loc_z2D (n * 2) r r') : loc_z2D (1 + n) (d1 +> (d0 +> r)) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil,<- append_assoc d1 d0 r] + cases m with + | zero => + have hn0 : n * 2 = 0 := by omega + rw [hn0] at hI + have hr' := loc_z2E hI + subst hr' + rw [<- append_assoc t one r] + exact zSc z0e (Side.nil r) + | succ m => + have h1m : m + 1 = 1 + m := by omega + rw [h1m] + refine zSc (z0p m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : n * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil,<- append_assoc d1 d0 r] + refine zSc (z0q m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (m * 2)) := by + have hm : n * 2 = 2 + (m * 2) * 2 := by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 + +theorem loc_z2H {n : Nat} {r r' : HalfTape} + (hI : loc_z2D (1 + n * 2) r r') : loc_z2D (1 + n) (d1 +> (d1 +> r)) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil,<- append_assoc d1 d1 r] + refine zSc (z0r m) ?_ + have hN1 : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ (m * 2)) := by + have hm : 1 + n * 2 = 1 + (m * 2) * 2 := by omega + rw [hm]; exact Num.odd (m * 2) + simpa using hI [] _ hN1 + | @even m => + simp only [append_nil,<- append_assoc d1 d1 r] + refine zSc (z0s m) ?_ + have hN1 : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ (1 + m * 2)) := by + have hm : 1 + n * 2 = 1 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.odd (1 + m * 2) + simpa using hI [] _ hN1 + +theorem loc_z2I {n : Nat} {r r' : HalfTape} + (hI : loc_z2D (n * 2) r r') : loc_z2D (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2E hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0i (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine zSc (z0t n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using hI [] _ hN2 + +theorem loc_z2J {n : Nat} {r r' : HalfTape} + (hI : loc_z2D (1 + n * 2) r r') : loc_z2D (2 + n * 4) (d1 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + refine zSc (z0u n) ?_ + simpa using hI [] _ (Num.odd n) + +theorem loc_z2K {n : Nat} {r r' : HalfTape} + (hI : loc_z2D (n * 2) r r') : loc_z2D (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2E hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0v (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine zSc (z0w n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using hI [] _ hN2 + +theorem loc_z2L {n : Nat} {r r' : HalfTape} + (hI : loc_z2D (1 + n * 2) r r') : loc_z2D (4 + n * 4) (d1 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + refine zSc (z0x n) ?_ + simpa using hI [] _ (Num.odd n) + +theorem loc_z2M {k : Nat} {r r' : HalfTape} (hI : RIncs k r r') : + loc_z2D k r r' := by + induction hI with + | zero r => + intro w hs hN + generalize hk : 0 = k0 at hN + cases hN with + | zero => exact Side.nil (one +> r) + | odd _ => omega + | even _ => omega + | T _ ih => exact loc_z2F ih + | pair0 _ ih => exact loc_z2G ih + | pair1 _ ih => exact loc_z2H ih + | short00 _ ih => exact loc_z2I ih + | short01 _ ih => exact loc_z2J ih + | short10 _ ih => exact loc_z2K ih + | short11 _ ih => exact loc_z2L ih + +theorem loc_z2N {r s r' : HalfTape} (hI : RIncs 2 r s) (hJ : RIncs 4 s r') : + (zCf r) [target_tm]⊢⁺ zCf (t +> r') := by + have hC1 := loc_z2M hI [] ([.cj] ++ [.ch] ^ 0) (Num.even 0) + have hS1 := zSc z0y hC1 + dsimp at hS1 + rcases hS1 with _ | ⟨hca,hnil1⟩ + cases hnil1 + have hC2 := loc_z2M hJ [] ([.cj] ++ [.ch] ^ 1) (Num.even 1) + have hS2 := zSc (z0o 0) hC2 + dsimp at hS2 + rcases hS2 with _ | ⟨hcj,hnil2⟩ + cases hnil2 + exact zPt (z0z r) + (zPt (hca ([1,1] +> default)) + (zPt (z0A (t +> s)) (hcj lh))) + +theorem loc_z2O {r r' : HalfTape} (h : C24Rounds r r') : + (zCf r) [target_tm]⊢* zCf r' := by + induction h with + | refl _ => exact ⟨0,rfl⟩ + | next hR1 hR2 _ ih => + rcases loc_z2N hR1 hR2 with ⟨n,_,hn⟩ + rcases ih with ⟨m,hm⟩ + exact ⟨n + m,zMt target_tm _ _ _ n m hn hm⟩ + +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d) = some c') : + (multiStep target_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl + +theorem loc_z2P : + (init []) [target_tm]⊢⁺ zCf (evalWords loc_z2B default) := by + have h := pre_z0W + have heq : evalWords loc_z2B default = + (([1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,1,1,0,0,1,0,1,0] : BitWord) +> default) := by + simp [loc_z2B,List.replicate,evalWords,t,d0,d1,append_cons,append_nil] + rwa [heq] + +theorem loc_z2Q (m : Nat) : + ∃ N ≥ m,∃ r,multiStep target_tm (init []) N = some (zCf r) /\ C24Good (1 / 64) r := by + induction m with + | zero => + rcases loc_z2P with ⟨k1,_,hk1⟩ + rcases loc_z2A 8 loc_z2B loc_z2C with ⟨r0,hR0,hG0⟩ + rcases loc_z2O hR0 with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,r0,zMt target_tm _ _ _ k1 k2 hk1 hk2,hG0⟩ + | succ m ih => + rcases ih with ⟨N,hN,r,h_ms,h_good⟩ + rcases loc_z1Z h_good with ⟨s,r',hR1,hR2,h_good'⟩ + rcases loc_z2N hR1 hR2 with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,t +> r',zMt target_tm _ _ _ N k h_ms h_step_k,h_good'⟩ + +end Solution + + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases loc_z2Q (n + 1) with ⟨N,hN,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := zIm h_N + rw [zMs,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_1LEHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RB_1LC0RA_1LE0LD_1LC1LF_1RA0LD_1LCHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RB_1LC0RA_1LE0LD_1LC1LF_1RA0LD_1LCHHH.lean new file mode 100644 index 00000000..645f243e --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RB_1LC0RA_1LE0LD_1LC1LF_1RA0LD_1LCHHH.lean @@ -0,0 +1,49 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.BB6.NonHalt.M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RB0RB_1LC0RA_1LE0LD_1LC1LF_1RA0LD_1LCHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RB_1LC0RA_1LE0LD_1LC1LF_1RA0LD_1LCHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +def stateMap_m0457 : Fin 6 → Fin 6 + | 0 => 1 -- m0457 state A + | 1 => 2 -- m0457 state B + | 2 => 4 -- m0457 state C + | 3 => 0 -- m0457 state D + | 4 => 3 -- m0457 state E + | 5 => 5 -- m0457 state F + +public section + +theorem is_not_halt : IsNotHalt target := by + exact Counter.does_not_halt_of_conj_stem + (M_tgt := target) + (M_src := BusyBeaver.M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH.target) + (σ := stateMap_m0457) (f := true) + (c₁ := (default : ListBlank (Fin 2)) {{3}}> default) + (by decide) (Counter.init_reaches_conjCfg_default rfl) + BusyBeaver.M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH.is_not_halt_from_0457 + +end + +end BusyBeaver.M_1RB0RB_1LC0RA_1LE0LD_1LC1LF_1RA0LD_1LCHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RB_1RC1LC_0LD1RA_1LF1LE_0LA1LC_1LBHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RB_1RC1LC_0LD1RA_1LF1LE_0LA1LC_1LBHHH.lean new file mode 100644 index 00000000..7a446899 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RB_1RC1LC_0LD1RA_1LF1LE_0LA1LC_1LBHHH.lean @@ -0,0 +1,671 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RB_1RC1LC_0LD1RA_1LF1LE_0LA1LC_1LBHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RB_1RC1LC_0LD1RA_1LF1LE_0LA1LC_1LBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +-- Holdout #117: 1RB0RB_1RC1LC_0LD1RA_1LF1LE_0LA1LC_1LB--- + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + +set_option maxHeartbeats 8000000 +set_option maxRecDepth 4000 + +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl +@[simp] theorem init_nil : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = ⟨some A, ⟨0, default, default⟩⟩ := rfl + +def encRight : List Bool → ListBlank (Fin 2) + | [] => default + | false :: R => (1 : Fin 2) >> (0 : Fin 2) >> encRight R + | true :: R => (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> encRight R + +@[simp] theorem encRight_nil : encRight [] = default := rfl +@[simp] theorem encRight_false (R : List Bool) : + encRight (false :: R) = (1 : Fin 2) >> (0 : Fin 2) >> encRight R := rfl +@[simp] theorem encRight_true (R : List Bool) : + encRight (true :: R) = (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> encRight R := rfl + +macro "finish" : tactic => `(tactic| ( + refine ⟨0, ?_⟩ + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, zero_cons_default, encRight_nil, encRight_false, encRight_true, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, multiStep_zero] + try rfl)) + +macro "step" : tactic => `(tactic| ( + try refine stepPlus_stepStar ?_ + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, encRight_nil, encRight_false, encRight_true, + Turing.ListBlank.head_cons, default_head] + apply step_stepStar_stepPlus (by rfl) + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, encRight_nil, encRight_false, encRight_true, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, + zero_cons_default, default_head, default_tail])) + +macro "execute" n:num : tactic => `(tactic| ( + iterate $n step + finish)) + +abbrev LB := ListBlank (Fin 2) + +def cfg_B (tl : LB) (R : List Bool) : Cfg (Fin 2) (Fin 6) := + ⟨some B, ⟨0, (0 : Fin 2) >> tl, encRight R⟩⟩ + +def cfg_C (tl : LB) (R : List Bool) : Cfg (Fin 2) (Fin 6) := + ⟨some C, ⟨0, tl, encRight R⟩⟩ + +def T2 (tl : LB) : LB := (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> tl +def T3 (tl : LB) : LB := (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> tl +def T4 (tl : LB) : LB := (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> tl +def T6 (tl : LB) : LB := (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> tl +def T12 (tl : LB) : LB := (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> tl +def T322 (tl : LB) : LB := (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> tl + +theorem rule_B_nil (tl : LB) : + (cfg_B tl []) [target_tm]⊢⁺ cfg_C ((1 : Fin 2) >> (0 : Fin 2) >> tl) [] := by + unfold cfg_B cfg_C; rw [encRight_nil]; execute 1 + +theorem rule_B_true (tl : LB) (R : List Bool) : + (cfg_B tl (true :: R)) [target_tm]⊢⁺ cfg_B (T2 tl) R := by + unfold cfg_B T2; rw [encRight_true]; execute 3 + +theorem rule_B_false_nil (tl : LB) : + (cfg_B tl [false]) [target_tm]⊢⁺ cfg_C (T4 tl) [] := by + unfold cfg_B cfg_C T4; rw [encRight_false, encRight_nil]; execute 4 + +theorem rule_B_false_false (tl : LB) (R : List Bool) : + (cfg_B tl (false :: false :: R)) [target_tm]⊢⁺ cfg_B (T3 tl) R := by + unfold cfg_B T3; rw [encRight_false, encRight_false]; execute 6 + +theorem rule_B_false_true (tl : LB) (R : List Bool) : + (cfg_B tl (false :: true :: R)) [target_tm]⊢⁺ cfg_C (T3 tl) (false :: R) := by + unfold cfg_B cfg_C T3; rw [encRight_false, encRight_true, encRight_false]; execute 7 + +theorem rule_C_110 (tl : LB) (R : List Bool) : + (cfg_C (T2 tl) R) [target_tm]⊢⁺ cfg_C tl (true :: R) := by + unfold cfg_C T2; rw [encRight_true]; execute 3 + +theorem rule_C_111 (tl : LB) (R : List Bool) : + (cfg_C ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> tl) R) [target_tm]⊢⁺ cfg_C ((1 : Fin 2) >> tl) (false :: R) := by + unfold cfg_C; rw [encRight_false]; execute 6 + +theorem rule_C_101 (tl : LB) (R : List Bool) : + (cfg_C ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> tl) R) [target_tm]⊢⁺ cfg_B tl (false :: R) := by + unfold cfg_C cfg_B; rw [encRight_false]; execute 4 + +theorem rule_C_100_false (tl : LB) (R : List Bool) : + (cfg_C ((1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> tl) (false :: R)) [target_tm]⊢⁺ + cfg_B ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> tl) R := by + unfold cfg_C cfg_B; rw [encRight_false]; execute 10 + +theorem rule_C_41 (tl : LB) (R : List Bool) : + (cfg_C (T4 tl) R) [target_tm]⊢⁺ cfg_C (T2 tl) (false :: R) := + rule_C_111 ((1 : Fin 2) >> (0 : Fin 2) >> tl) R + +theorem rule_C_61 (tl : LB) (R : List Bool) : + (cfg_C (T6 tl) R) [target_tm]⊢⁺ cfg_C (T4 tl) (false :: R) := + rule_C_111 ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> tl) R + +theorem rule_C_32 (tl : LB) (R : List Bool) : + (cfg_C ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> tl) R) [target_tm]⊢⁺ + cfg_B ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> tl) R := + stepPlus_trans (rule_C_111 ((0 : Fin 2) >> (0 : Fin 2) >> tl) R) (rule_C_100_false tl R) + +theorem rule_C_31_1 (tl : LB) (R : List Bool) : + (cfg_C (T3 ((1 : Fin 2) >> tl)) R) [target_tm]⊢⁺ cfg_B (T3 tl) R := + stepPlus_trans (rule_C_111 ((0 : Fin 2) >> (1 : Fin 2) >> tl) R) + (stepPlus_trans (rule_C_101 tl (false :: R)) (rule_B_false_false tl R)) + +theorem rule_B_nil_1 (tl : LB) : + (cfg_B ((1 : Fin 2) >> tl) []) [target_tm]⊢⁺ cfg_C (T4 tl) [] := + stepPlus_trans (rule_B_nil ((1 : Fin 2) >> tl)) + (stepPlus_trans (rule_C_101 tl []) (rule_B_false_nil tl)) + +theorem rule_B_carry_true (tl : LB) (R : List Bool) : + (cfg_B ((1 : Fin 2) >> tl) (false :: true :: R)) [target_tm]⊢⁺ cfg_B (T3 tl) (false :: R) := + stepPlus_trans (rule_B_false_true ((1 : Fin 2) >> tl) R) (rule_C_31_1 tl (false :: R)) + +theorem rule_C_3_22 (tl : LB) (R : List Bool) : + (cfg_C (T3 (T2 (T2 tl))) R) [target_tm]⊢⁺ cfg_B (T3 (T12 tl)) R := + rule_C_31_1 ((1 : Fin 2) >> (0 : Fin 2) >> T2 tl) R + +theorem rule_C_3_12 (tl : LB) (R : List Bool) : + (cfg_C (T3 (T12 tl)) R) [target_tm]⊢⁺ cfg_B (T322 tl) R := + rule_C_31_1 ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> tl) R + +theorem rule_C_322 (tl : LB) (R : List Bool) : + (cfg_C (T322 tl) R) [target_tm]⊢⁺ cfg_B (T6 tl) R := + rule_C_32 ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> tl) R + +theorem rule_C_6 (tl : LB) (R : List Bool) : + (cfg_C (T6 tl) R) [target_tm]⊢⁺ cfg_C tl (true :: false :: false :: R) := + stepPlus_trans (rule_C_61 tl R) + (stepPlus_trans (rule_C_41 tl (false :: R)) (rule_C_110 tl (false :: false :: R))) + +theorem rule_C_default (R : List Bool) : + (cfg_C default R) [target_tm]⊢⁺ cfg_B default (true :: R) := by + unfold cfg_C cfg_B; rw [encRight_true]; execute 3 + +theorem rule_B_norm_exit (tl : LB) : + (cfg_B (T2 (T2 tl)) [false]) [target_tm]⊢⁺ cfg_C tl [true, true, true, false] := + stepPlus_trans (rule_B_false_nil (T2 (T2 tl))) + (stepPlus_trans (rule_C_41 (T2 (T2 tl)) []) + (stepPlus_trans (rule_C_110 (T2 (T2 tl)) [false]) + (stepPlus_trans (rule_C_110 (T2 tl) [true, false]) + (rule_C_110 tl [true, true, false])))) + +theorem rule_B_carry_exit (tl : LB) : + (cfg_B (T3 (T2 (T2 tl))) [false, false]) [target_tm]⊢⁺ + cfg_C (T3 (T12 tl)) [true, true, true, false] := + stepPlus_trans (rule_B_false_false (T3 (T2 (T2 tl))) []) + (stepPlus_trans (rule_B_nil_1 (T2 (T3 (T2 (T2 tl))))) + (stepPlus_trans (rule_C_41 (T2 (T3 (T2 (T2 tl)))) []) + (stepPlus_trans (rule_C_110 (T2 (T3 (T2 (T2 tl)))) [false]) + (stepPlus_trans (rule_C_110 (T3 (T2 (T2 tl))) [true, false]) + (stepPlus_trans (rule_C_3_22 tl [true, true, false]) + (stepPlus_trans (rule_B_true (T3 (T12 tl)) [true, false]) + (stepPlus_trans (rule_B_true (T2 (T3 (T12 tl))) [false]) + (stepPlus_trans (rule_B_false_nil (T2 (T2 (T3 (T12 tl))))) + (stepPlus_trans (rule_C_41 (T2 (T2 (T3 (T12 tl)))) []) + (stepPlus_trans (rule_C_110 (T2 (T2 (T3 (T12 tl)))) [false]) + (stepPlus_trans (rule_C_110 (T2 (T3 (T12 tl))) [true, false]) + (rule_C_110 (T3 (T12 tl)) [true, true, false])))))))))))) + +theorem rule_C_3_0 (R : List Bool) : + (cfg_C (T3 default) R) [target_tm]⊢⁺ cfg_B (T4 default) R := by + have h := rule_C_32 default R + unfold T3 T4 + simpa only [zero_cons_default] using h + +theorem rule_C_6_3 (R : List Bool) : + (cfg_C (T6 (T2 (T2 (T2 (T3 default))))) R) [target_tm]⊢⁺ + cfg_B (T3 (T2 (T2 (T2 (T2 (T4 default)))))) R := + stepPlus_trans (rule_C_6 (T2 (T2 (T2 (T3 default)))) R) + (stepPlus_trans (rule_C_110 (T2 (T2 (T3 default))) (true :: false :: false :: R)) + (stepPlus_trans (rule_C_110 (T2 (T3 default)) (true :: true :: false :: false :: R)) + (stepPlus_trans (rule_C_110 (T3 default) (true :: true :: true :: false :: false :: R)) + (stepPlus_trans (rule_C_3_0 (true :: true :: true :: true :: false :: false :: R)) + (stepPlus_trans (rule_B_true (T4 default) (true :: true :: true :: false :: false :: R)) + (stepPlus_trans (rule_B_true (T2 (T4 default)) (true :: true :: false :: false :: R)) + (stepPlus_trans (rule_B_true (T2 (T2 (T4 default))) (true :: false :: false :: R)) + (stepPlus_trans (rule_B_true (T2 (T2 (T2 (T4 default)))) (false :: false :: R)) + (rule_B_false_false (T2 (T2 (T2 (T2 (T4 default))))) R))))))))) + +theorem rule_B_carry_3_true (x : LB) (R : List Bool) : + (cfg_B (T3 x) (false :: true :: R)) [target_tm]⊢⁺ cfg_B (T3 (T2 x)) (false :: R) := + rule_B_carry_true (T2 x) R + +theorem rule_C_6_4 (R : List Bool) : + (cfg_C (T6 (T2 (T2 (T4 default)))) R) [target_tm]⊢⁺ + cfg_B (T3 (T3 (T2 (T2 (T12 default))))) (false :: R) := + stepPlus_trans (rule_C_6 (T2 (T2 (T4 default))) R) + (stepPlus_trans (rule_C_110 (T2 (T4 default)) (true :: false :: false :: R)) + (stepPlus_trans (rule_C_110 (T4 default) (true :: true :: false :: false :: R)) + (stepPlus_trans (rule_C_41 default (true :: true :: true :: false :: false :: R)) + (stepPlus_trans (rule_C_110 default (false :: true :: true :: true :: false :: false :: R)) + (stepPlus_trans (rule_C_default (true :: false :: true :: true :: true :: false :: false :: R)) + (stepPlus_trans (rule_B_true default (true :: false :: true :: true :: true :: false :: false :: R)) + (stepPlus_trans (rule_B_true (T2 default) (false :: true :: true :: true :: false :: false :: R)) + (stepPlus_trans (rule_B_false_true (T2 (T2 default)) (true :: true :: false :: false :: R)) + (stepPlus_trans (rule_C_3_22 default (false :: true :: true :: false :: false :: R)) + (stepPlus_trans (rule_B_carry_3_true (T12 default) (true :: false :: false :: R)) + (stepPlus_trans (rule_B_carry_3_true (T2 (T12 default)) (false :: false :: R)) + (rule_B_false_false (T3 (T2 (T2 (T12 default)))) (false :: R))))))))))))) + +theorem rule_C_12_0 (R : List Bool) : + (cfg_C (T12 default) R) [target_tm]⊢⁺ cfg_B ((1 : Fin 2) >> default) (false :: R) := by + have h := rule_C_101 ((1 : Fin 2) >> (0 : Fin 2) >> default) R + unfold T12 + simpa only [zero_cons_default] using h + +theorem rule_B_carry_1_0 (R : List Bool) : + (cfg_B ((1 : Fin 2) >> default) (false :: true :: R)) [target_tm]⊢⁺ cfg_B (T3 default) (false :: R) := + rule_B_carry_true default R + +theorem rule_C_6_12 (R : List Bool) : + (cfg_C (T6 (T12 default)) R) [target_tm]⊢⁺ + cfg_B (T3 (T3 default)) (false :: R) := + stepPlus_trans (rule_C_6 (T12 default) R) + (stepPlus_trans (rule_C_12_0 (true :: false :: false :: R)) + (stepPlus_trans (rule_B_carry_1_0 (false :: false :: R)) + (rule_B_false_false (T3 default) (false :: R)))) + +def powT2 : Nat → LB → LB + | 0, x => x + | n + 1, x => T2 (powT2 n x) + +def powTrue : Nat → List Bool → List Bool + | 0, R => R + | n + 1, R => true :: powTrue n R + +theorem powT2_comm (n : Nat) (x : LB) : powT2 n (T2 x) = T2 (powT2 n x) := by + induction n with + | zero => rfl + | succ n ih => simp [powT2, ih] + +theorem powTrue_comm (n : Nat) (R : List Bool) : powTrue n (true :: R) = true :: powTrue n R := by + induction n with + | zero => rfl + | succ n ih => simp [powTrue, ih] + +theorem c_pop_T2 (n : Nat) (x : LB) (R : List Bool) : + (cfg_C (powT2 n x) R) [target_tm]⊢* cfg_C x (powTrue n R) := by + induction n generalizing R with + | zero => finish + | succ n ih => + simp only [powT2, powTrue, ← powTrue_comm] + exact stepPlus_stepStar (stepPlus_stepStar_stepPlus (rule_C_110 (powT2 n x) R) (ih (true :: R))) + +theorem b_push_T2 (n : Nat) (x : LB) (R : List Bool) : + (cfg_B x (powTrue n R)) [target_tm]⊢* cfg_B (powT2 n x) R := by + induction n generalizing x with + | zero => finish + | succ n ih => + simp only [powTrue, powT2, ← powT2_comm] + exact stepPlus_stepStar (stepPlus_stepStar_stepPlus (rule_B_true x (powTrue n R)) (ih (T2 x))) + +theorem b_carry_push_T2 (n : Nat) (x : LB) (R : List Bool) : + (cfg_B (T3 x) (false :: powTrue n R)) [target_tm]⊢* cfg_B (T3 (powT2 n x)) (false :: R) := by + induction n generalizing x with + | zero => finish + | succ n ih => + simp only [powTrue, powT2, ← powT2_comm] + exact stepPlus_stepStar (stepPlus_stepStar_stepPlus (rule_B_carry_3_true x (powTrue n R)) (ih (T2 x))) + +theorem c_pop_T6 (b : Nat) (tl : LB) (R : List Bool) : + (cfg_C (T6 (powT2 b tl)) R) [target_tm]⊢⁺ cfg_C tl (powTrue (b + 1) (false :: false :: R)) := by + refine stepPlus_stepStar_stepPlus (rule_C_6 (powT2 b tl) R) ?_ + have h := c_pop_T2 b tl (true :: false :: false :: R) + rw [powTrue_comm] at h + exact h + +theorem b_norm_block (m : Nat) (x : LB) (R : List Bool) : + (cfg_B x (powTrue m (false :: false :: R))) [target_tm]⊢⁺ cfg_B (T3 (powT2 m x)) R := + stepStar_stepPlus_stepPlus (b_push_T2 m x (false :: false :: R)) (rule_B_false_false (powT2 m x) R) + +theorem b_carry_block (m : Nat) (x : LB) (R : List Bool) : + (cfg_B (T3 x) (false :: powTrue m (false :: false :: R))) [target_tm]⊢⁺ + cfg_B (T3 (T3 (powT2 m x))) (false :: R) := + stepStar_stepPlus_stepPlus (b_carry_push_T2 m x (false :: false :: R)) + (rule_B_false_false (T3 (powT2 m x)) (false :: R)) + +theorem b_norm_end (a : Nat) (x : LB) : + (cfg_B x (powTrue a [true, true, true, false])) [target_tm]⊢⁺ + cfg_C (powT2 (a + 1) x) [true, true, true, false] := + stepStar_stepPlus_stepPlus (b_push_T2 a x [true, true, true, false]) + (stepPlus_trans (rule_B_true (powT2 a x) [true, true, false]) + (stepPlus_trans (rule_B_true (T2 (powT2 a x)) [true, false]) + (stepPlus_trans (rule_B_true (T2 (T2 (powT2 a x))) [false]) + (rule_B_norm_exit (T2 (powT2 a x)))))) + +theorem b_carry_end (a : Nat) (x : LB) : + (cfg_B (T3 x) (false :: powTrue a [true, true, true, false])) [target_tm]⊢⁺ + cfg_C (T3 (T12 (powT2 (a + 1) x))) [true, true, true, false] := + stepStar_stepPlus_stepPlus (b_carry_push_T2 a x [true, true, true, false]) + (stepPlus_trans (rule_B_carry_3_true (powT2 a x) [true, true, false]) + (stepPlus_trans (rule_B_carry_3_true (T2 (powT2 a x)) [true, false]) + (stepPlus_trans (rule_B_carry_3_true (T2 (T2 (powT2 a x))) [false]) + (rule_B_carry_exit (T2 (powT2 a x)))))) + +def StepNorm (s₁ s₂ : LB) : Prop := + ∀ R : List Bool, (cfg_C s₁ R) [target_tm]⊢⁺ cfg_B s₂ R + +def StepCarry (s₁ s₂ : LB) : Prop := + ∀ R : List Bool, (cfg_C s₁ R) [target_tm]⊢⁺ cfg_B (T3 s₂) (false :: R) + +abbrev NormSteps : Nat → LB → LB → Prop := Counter.IterRel StepNorm + +theorem NormSteps.zero (s : LB) : NormSteps 0 s s := Counter.IterRel.zero s +theorem NormSteps.succ {n : Nat} {s₁ s₂ s₃ : LB} (h1 : StepNorm s₁ s₂) (h2 : NormSteps n s₂ s₃) : + NormSteps (n + 1) s₁ s₃ := Counter.IterRel.succ h1 h2 + +def CarryRun (n : Nat) (s₁ s₂ : LB) : Prop := + ∃ mid : LB, NormSteps n s₁ mid ∧ StepCarry mid s₂ + +theorem NormSteps_trans {m n : Nat} {s₁ s₂ s₃ : LB} + (h₁ : NormSteps m s₁ s₂) (h₂ : NormSteps n s₂ s₃) : NormSteps (m + n) s₁ s₃ := + Counter.IterRel_trans h₁ h₂ + +theorem CarryRun_prepend {m n : Nat} {s₁ s₂ s₃ : LB} + (h₁ : NormSteps m s₁ s₂) (h₂ : CarryRun n s₂ s₃) : CarryRun (m + n) s₁ s₃ := by + obtain ⟨mid, hm, hc⟩ := h₂ + exact ⟨mid, NormSteps_trans h₁ hm, hc⟩ + +theorem stepNorm_3_22 (b : Nat) (s : LB) : + StepNorm (T3 (powT2 (b + 2) s)) (T3 (T12 (powT2 b s))) := + fun R => rule_C_3_22 (powT2 b s) R + +theorem stepNorm_3_12 (s : LB) : StepNorm (T3 (T12 s)) (T322 s) := + fun R => rule_C_3_12 s R + +theorem stepNorm_322 (s : LB) : StepNorm (T322 s) (T6 s) := + fun R => rule_C_322 s R + +theorem stepNorm_T6 {s₁ s₂ : LB} (b : Nat) (h : StepNorm s₁ s₂) : + StepNorm (T6 (powT2 b s₁)) (T3 (powT2 (b + 1) s₂)) := + fun R => stepPlus_trans (c_pop_T6 b s₁ R) + (stepPlus_trans (h (powTrue (b + 1) (false :: false :: R))) (b_norm_block (b + 1) s₂ R)) + +theorem stepCarry_T6 {s₁ s₂ : LB} (b : Nat) (h : StepCarry s₁ s₂) : + StepCarry (T6 (powT2 b s₁)) (T3 (powT2 (b + 1) s₂)) := + fun R => stepPlus_trans (c_pop_T6 b s₁ R) + (stepPlus_trans (h (powTrue (b + 1) (false :: false :: R))) (b_carry_block (b + 1) s₂ R)) + +theorem normSteps_cycle_T3_12 {s₁ s₂ : LB} (b : Nat) (h : StepNorm s₁ s₂) : + NormSteps 3 (T3 (T12 (powT2 b s₁))) (T3 (powT2 (b + 1) s₂)) := + NormSteps.succ (stepNorm_3_12 _) + (NormSteps.succ (stepNorm_322 _) + (NormSteps.succ (stepNorm_T6 b h) (NormSteps.zero _))) + +theorem normSteps_cycle_T3 {s₁ s₂ : LB} (b : Nat) (h : StepNorm s₁ s₂) : + NormSteps 4 (T3 (powT2 (b + 2) s₁)) (T3 (powT2 (b + 1) s₂)) := + NormSteps.succ (stepNorm_3_22 b s₁) (normSteps_cycle_T3_12 b h) + +theorem carryRun_cycle_T3_12 {s₁ s₂ : LB} (b : Nat) (h : StepCarry s₁ s₂) : + CarryRun 2 (T3 (T12 (powT2 b s₁))) (T3 (powT2 (b + 1) s₂)) := + ⟨T6 (powT2 b s₁), + NormSteps.succ (stepNorm_3_12 _) (NormSteps.succ (stepNorm_322 _) (NormSteps.zero _)), + stepCarry_T6 b h⟩ + +theorem carryRun_cycle_T3 {s₁ s₂ : LB} (b : Nat) (h : StepCarry s₁ s₂) : + CarryRun 3 (T3 (powT2 (b + 2) s₁)) (T3 (powT2 (b + 1) s₂)) := by + obtain ⟨mid, hm, hc⟩ := carryRun_cycle_T3_12 b h + exact ⟨mid, NormSteps.succ (stepNorm_3_22 b s₁) hm, hc⟩ + +theorem lift_NormSteps {n : Nat} {s₁ s₂ : LB} (h : NormSteps n s₁ s₂) (b : Nat) : + NormSteps (4 * n) (T3 (powT2 (b + n + 1) s₁)) (T3 (powT2 (b + 1) s₂)) := by + induction h generalizing b with + | zero s => + simpa only [Nat.mul_zero, Nat.add_zero] using NormSteps.zero (T3 (powT2 (b + 1) s)) + | @succ m s₁ s₂ s₃ hstep hrest ih => + have h1 : NormSteps 4 (T3 (powT2 (b + (m + 1) + 1) s₁)) (T3 (powT2 (b + m + 1) s₂)) := by + have : b + (m + 1) + 1 = (b + m) + 2 := by omega + rw [this] + exact normSteps_cycle_T3 (b + m) hstep + have h2 := NormSteps_trans h1 (ih b) + have : 4 + 4 * m = 4 * (m + 1) := by omega + rwa [this] at h2 + +theorem lift_NormSteps_T3_12 {n : Nat} {s₁ s₂ s₃ : LB} + (h₁ : StepNorm s₁ s₂) (h₂ : NormSteps n s₂ s₃) (b : Nat) : + NormSteps (4 * n + 3) (T3 (T12 (powT2 (b + n) s₁))) (T3 (powT2 (b + 1) s₃)) := by + have h1 := normSteps_cycle_T3_12 (b + n) h₁ + have h2 := lift_NormSteps h₂ b + have h3 := NormSteps_trans h1 h2 + have : 3 + 4 * n = 4 * n + 3 := by omega + rwa [this] at h3 + +theorem lift_CarryRun {n : Nat} {s₁ s₂ : LB} (h : CarryRun n s₁ s₂) (b : Nat) : + CarryRun (4 * n + 3) (T3 (powT2 (b + n + 2) s₁)) (T3 (powT2 (b + 1) s₂)) := by + obtain ⟨mid, hm, hc⟩ := h + have h1 : NormSteps (4 * n) (T3 (powT2 (b + n + 2) s₁)) (T3 (powT2 (b + 2) mid)) := by + have : b + n + 2 = (b + 1) + n + 1 := by omega + rw [this] + exact lift_NormSteps hm (b + 1) + exact CarryRun_prepend h1 (carryRun_cycle_T3 b hc) + +theorem lift_CarryRun_T3_12 {n : Nat} {s₁ s₂ : LB} (h : CarryRun n s₁ s₂) (b : Nat) : + CarryRun (4 * n + 2) (T3 (T12 (powT2 (b + n) s₁))) (T3 (powT2 (b + 1) s₂)) := by + obtain ⟨mid, hm, hc⟩ := h + cases hm with + | zero => + simpa only [Nat.mul_zero, Nat.add_zero] using carryRun_cycle_T3_12 b hc + | @succ m s₁ s_next _ hstep hrest => + have h1 : NormSteps 3 (T3 (T12 (powT2 (b + (m + 1)) s₁))) (T3 (powT2 (b + m + 2) s_next)) := by + have : b + (m + 1) = (b + m) + 1 := by omega + rw [this] + exact normSteps_cycle_T3_12 (b + m + 1) hstep + have h2 := lift_CarryRun ⟨mid, hrest, hc⟩ b + have h3 := CarryRun_prepend h1 h2 + have : 3 + (4 * m + 3) = 4 * (m + 1) + 2 := by omega + rwa [this] at h3 + +theorem run_StepNorm {s₁ s₂ : LB} (h : StepNorm s₁ s₂) (a : Nat) : + (cfg_C (powT2 a s₁) [true, true, true, false]) [target_tm]⊢⁺ + cfg_C (powT2 (a + 1) s₂) [true, true, true, false] := + stepStar_stepPlus_stepPlus (c_pop_T2 a s₁ [true, true, true, false]) + (stepPlus_trans (h (powTrue a [true, true, true, false])) (b_norm_end a s₂)) + +theorem run_NormSteps {n : Nat} {s₁ s₂ : LB} (h : NormSteps n s₁ s₂) (a : Nat) : + (cfg_C (powT2 a s₁) [true, true, true, false]) [target_tm]⊢* + cfg_C (powT2 (a + n) s₂) [true, true, true, false] := + Counter.IterRel_lift_rc (fun s a => cfg_C (powT2 a s) [true, true, true, false]) + (fun h a => stepPlus_stepStar (run_StepNorm h a)) h a + +theorem run_StepCarry {s₁ s₂ : LB} (h : StepCarry s₁ s₂) (a : Nat) : + (cfg_C (powT2 a s₁) [true, true, true, false]) [target_tm]⊢⁺ + cfg_C (T3 (T12 (powT2 (a + 1) s₂))) [true, true, true, false] := + stepStar_stepPlus_stepPlus (c_pop_T2 a s₁ [true, true, true, false]) + (stepPlus_trans (h (powTrue a [true, true, true, false])) (b_carry_end a s₂)) + +theorem run_CarryRun {n : Nat} {s₁ s₂ : LB} (h : CarryRun n s₁ s₂) (a : Nat) : + (cfg_C (powT2 a s₁) [true, true, true, false]) [target_tm]⊢⁺ + cfg_C (T3 (T12 (powT2 (a + n + 1) s₂))) [true, true, true, false] := by + obtain ⟨mid, hm, hc⟩ := h + exact stepStar_stepPlus_stepPlus (run_NormSteps hm a) (run_StepCarry hc (a + n)) + +def N : Nat → Nat + | 0 => 0 + | k + 1 => 4 * N k + 3 + +def ChainA : Nat → LB + | 0 => T3 (powT2 2 (T12 default)) + | k + 1 => T3 (powT2 (2 * N (k + 1) + 3) (ChainA k)) + +def ChainB : Nat → LB + | 0 => T3 default + | k + 1 => T3 (powT2 (N (k + 1) + 2) (ChainB k)) + +def ChainC : Nat → LB + | 0 => T3 (powT2 4 (T4 default)) + | k + 1 => T3 (powT2 (3 * N (k + 1) + 4) (ChainC k)) + +def TopA (k : Nat) : LB := T3 (T12 (powT2 (2 * N (k + 1) + 1) (ChainA k))) +def TopB (k : Nat) : LB := T3 (T12 (powT2 (N (k + 2)) (ChainB (k + 1)))) +def State (k : Nat) : Cfg (Fin 2) (Fin 6) := + cfg_C (powT2 (N (k + 1)) (ChainC k)) [true, true, true, false] + +theorem carryRun_base12 : CarryRun 2 (T3 (T12 (T12 default))) (T3 default) := + ⟨T6 (T12 default), + NormSteps.succ (stepNorm_3_12 _) (NormSteps.succ (stepNorm_322 _) (NormSteps.zero _)), + fun R => rule_C_6_12 R⟩ + +theorem normSteps_base3 : NormSteps 3 (T3 (T12 (powT2 3 (T3 default)))) (ChainC 0) := + NormSteps.succ (stepNorm_3_12 _) + (NormSteps.succ (stepNorm_322 _) + (NormSteps.succ (fun R => rule_C_6_3 R) (NormSteps.zero _))) + +theorem carryRun_base4 : CarryRun 3 (ChainC 0) (ChainA 0) := + ⟨T6 (powT2 2 (T4 default)), + NormSteps.succ (stepNorm_3_22 2 (T4 default)) + (NormSteps.succ (stepNorm_3_12 _) + (NormSteps.succ (stepNorm_322 _) (NormSteps.zero _))), + fun R => rule_C_6_4 R⟩ + +theorem phase1_chain (k : Nat) : CarryRun (N (k + 1)) (ChainA k) (ChainB k) := by + induction k with + | zero => + obtain ⟨mid, hm, hc⟩ := carryRun_base12 + exact ⟨mid, NormSteps.succ (stepNorm_3_22 0 (T12 default)) hm, hc⟩ + | succ k ih => + have h := lift_CarryRun ih (N (k + 1) + 1) + have heq1 : 4 * N (k + 1) + 3 = N (k + 2) := rfl + have heq2 : (N (k + 1) + 1) + N (k + 1) + 2 = 2 * N (k + 1) + 3 := by omega + have heq3 : (N (k + 1) + 1) + 1 = N (k + 1) + 2 := by omega + rw [heq1, heq2, heq3] at h + exact h + +theorem phase1_top (k : Nat) : CarryRun (4 * N (k + 1) + 2) (TopA k) (ChainB (k + 1)) := by + have h := lift_CarryRun_T3_12 (phase1_chain k) (N (k + 1) + 1) + have heq1 : (N (k + 1) + 1) + N (k + 1) = 2 * N (k + 1) + 1 := by omega + have heq2 : (N (k + 1) + 1) + 1 = N (k + 1) + 2 := by omega + rw [heq1, heq2] at h + exact h + +theorem phase2_chain (k : Nat) : NormSteps (N (k + 1) + 1) (ChainB (k + 1)) (ChainC k) := by + induction k with + | zero => + exact NormSteps.succ (stepNorm_3_22 3 (T3 default)) normSteps_base3 + | succ k ih => + have h := lift_NormSteps ih (3 * N (k + 1) + 3) + have heq1 : 4 * (N (k + 1) + 1) = N (k + 2) + 1 := by simp [N]; omega + have heq2 : (3 * N (k + 1) + 3) + (N (k + 1) + 1) + 1 = N (k + 2) + 2 := by simp [N]; omega + have heq3 : (3 * N (k + 1) + 3) + 1 = 3 * N (k + 1) + 4 := by omega + rw [heq1, heq2, heq3] at h + exact h + +theorem phase2_top (k : Nat) : NormSteps (N (k + 2)) (TopB k) (ChainC (k + 1)) := by + have hchain := phase2_chain k + cases hchain with + | @succ m _ s_mid _ hstep hrest => + have h := lift_NormSteps_T3_12 hstep hrest (3 * N (k + 1) + 3) + have heq1 : 4 * N (k + 1) + 3 = N (k + 2) := rfl + have heq2 : (3 * N (k + 1) + 3) + N (k + 1) = N (k + 2) := by simp [N]; omega + have heq3 : (3 * N (k + 1) + 3) + 1 = 3 * N (k + 1) + 4 := by omega + rw [heq1, heq2, heq3] at h + exact h + +theorem phase3_chain (k : Nat) : CarryRun (N (k + 1)) (ChainC k) (ChainA k) := by + induction k with + | zero => exact carryRun_base4 + | succ k ih => + have h := lift_CarryRun ih (2 * N (k + 1) + 2) + have heq1 : 4 * N (k + 1) + 3 = N (k + 2) := rfl + have heq2 : (2 * N (k + 1) + 2) + N (k + 1) + 2 = 3 * N (k + 1) + 4 := by omega + have heq3 : (2 * N (k + 1) + 2) + 1 = 2 * N (k + 1) + 3 := by omega + rw [heq1, heq2, heq3] at h + exact h + +theorem state_step (k : Nat) : (State k) [target_tm]⊢⁺ State (k + 1) := by + have h3 := run_CarryRun (phase3_chain k) (N (k + 1)) + have heq3 : N (k + 1) + N (k + 1) + 1 = 2 * N (k + 1) + 1 := by omega + rw [heq3] at h3 + have h1 := run_CarryRun (phase1_top k) 0 + have heq1 : 0 + (4 * N (k + 1) + 2) + 1 = N (k + 2) := by simp [N] + rw [heq1] at h1 + have h2 := run_NormSteps (phase2_top k) 0 + have heq2 : 0 + N (k + 2) = N (k + 2) := Nat.zero_add _ + rw [heq2] at h2 + exact stepPlus_trans h3 (stepPlus_stepStar_stepPlus h1 h2) + +theorem init_step5 : (init []) [target_tm]⊢⁺ cfg_C default [true] := by + unfold cfg_C; rw [init_nil, encRight_true, encRight_nil]; execute 5 + +theorem start_to_step127 : + (cfg_C default [true]) [target_tm]⊢⁺ cfg_C (T4 default) [true, true, true, false] := + stepPlus_trans (rule_C_default [true]) + (stepPlus_trans (rule_B_true default [true]) + (stepPlus_trans (rule_B_true (T2 default) []) + (stepPlus_trans (rule_B_nil_1 ((1 : Fin 2) >> (0 : Fin 2) >> T2 default)) + (stepPlus_trans (rule_C_41 (T12 default) []) + (stepPlus_trans (rule_C_110 (T12 default) [false]) + (stepPlus_trans (rule_C_12_0 [true, false]) + (stepPlus_trans (rule_B_carry_1_0 [false]) + (stepPlus_trans (rule_B_false_false (T3 default) []) + (stepPlus_trans (rule_B_nil_1 ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> T3 default)) + (stepPlus_trans (rule_C_41 (T2 (T3 default)) []) + (stepPlus_trans (rule_C_110 (T2 (T3 default)) [false]) + (stepPlus_trans (rule_C_110 (T3 default) [true, false]) + (stepPlus_trans (rule_C_3_0 [true, true, false]) + (stepPlus_trans (rule_B_true (T4 default) [true, false]) + (stepPlus_trans (rule_B_true (T2 (T4 default)) [false]) + (rule_B_norm_exit (T4 default))))))))))))))))) + +theorem step127_to_start : + (cfg_C (T4 default) [true, true, true, false]) [target_tm]⊢⁺ + cfg_C (T3 (T12 (T12 default))) [true, true, true, false] := + stepPlus_trans (rule_C_41 default [true, true, true, false]) + (stepPlus_trans (rule_C_110 default [false, true, true, true, false]) + (stepPlus_trans (rule_C_default [true, false, true, true, true, false]) + (stepPlus_trans (rule_B_true default [true, false, true, true, true, false]) + (stepPlus_trans (rule_B_true (T2 default) [false, true, true, true, false]) + (stepPlus_trans (rule_B_false_true (T2 (T2 default)) [true, true, false]) + (stepPlus_trans (rule_C_3_22 default [false, true, true, false]) + (stepPlus_trans (rule_B_carry_3_true (T12 default) [true, false]) + (stepPlus_trans (rule_B_carry_3_true (T2 (T12 default)) [false]) + (rule_B_carry_exit (T12 default)))))))))) + +theorem init_to_start : + (init []) [target_tm]⊢⁺ cfg_C (T3 (T12 (T12 default))) [true, true, true, false] := + stepPlus_trans init_step5 (stepPlus_trans start_to_step127 step127_to_start) + +theorem init_to_state0 : (init []) [target_tm]⊢⁺ State 0 := by + have h0 := init_to_start + have h1 := run_CarryRun carryRun_base12 0 + have h2 := run_NormSteps normSteps_base3 0 + exact stepPlus_trans h0 (stepPlus_stepStar_stepPlus h1 h2) + +theorem inv_arb_long (Inv : Cfg (Fin 2) (Fin 6) → Prop) + (h_init : ∃ c₀, Inv c₀ ∧ ((init []) [target_tm]⊢⁺ c₀)) + (h_step : ∀ c, Inv c → ∃ c', Inv c' ∧ (c [target_tm]⊢⁺ c')) (m : ℕ) : + ∃ n c, m ≤ n ∧ Inv c ∧ ((init []) [target_tm]⊢^{n} c) := by + induction m with + | zero => + obtain ⟨c₀, hc₀, n, _, hn⟩ := h_init + exact ⟨n, c₀, Nat.zero_le n, hc₀, hn⟩ + | succ m ih => + obtain ⟨n, c, hmn, hc, hn⟩ := ih + obtain ⟨c', hc', k, hk_pos, hk⟩ := h_step c hc + exact ⟨n + k, c', by omega, hc', multiStep_trans hn hk⟩ + +theorem not_halt_of_inv (Inv : Cfg (Fin 2) (Fin 6) → Prop) + (h_init : ∃ c₀, Inv c₀ ∧ ((init []) [target_tm]⊢⁺ c₀)) + (h_step : ∀ c, Inv c → ∃ c', Inv c' ∧ (c [target_tm]⊢⁺ c')) : + IsNotHalt target_tm := by + intro c ⟨m, hm⟩ + obtain ⟨n, c', hmn, _, hn⟩ := inv_arb_long Inv h_init h_step (m + 1) + have h_add := multiStep_add target_tm (init []) (m + 1) (n - (m + 1)) + rw [Nat.add_sub_of_le hmn, multiStep_succ', hm] at h_add + change multiStep target_tm (init []) n = + (step target_tm c).bind (fun c₂ => multiStep target_tm c₂ (n - (m + 1))) at h_add + cases h_step_c : step target_tm c with + | none => + change multiStep target_tm (init []) n = some c' at hn + rw [h_step_c, hn] at h_add + cases h_add + | some c₁ => rfl + +def Valid (c : Cfg (Fin 2) (Fin 6)) : Prop := ∃ k : Nat, c = State k + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + apply not_halt_of_inv Valid + · exact ⟨State 0, ⟨0, rfl⟩, init_to_state0⟩ + · intro c ⟨k, hk⟩ + subst hk + exact ⟨State (k + 1), ⟨k + 1, rfl⟩, state_step k⟩ + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RB_1RC1LC_0LD1RA_1LF1LE_0LA1LC_1LBHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RC_1LC0LD_1RA1RC_1RA1LE_0LB1RE_HHH1RA.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RC_1LC0LD_1RA1RC_1RA1LE_0LB1RE_HHH1RA.lean new file mode 100644 index 00000000..c298a5c4 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RC_1LC0LD_1RA1RC_1RA1LE_0LB1RE_HHH1RA.lean @@ -0,0 +1,46 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.CtlCertificate + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.M_1RB0RC_1LC0LD_1RA1RC_1RA1LE_0LB1RE_HHH1RA + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RC_1LC0LD_1RA1RC_1RA1LE_0LB1RE_HHH1RA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +def ctlLeftDfaTable : List (Fin 1) := [0, 0] + +def ctlLeftDfa (p : Fin 1) (a : Fin 2) : Fin 1 := + ctlLeftDfaTable.getD (2 * p.val + a.val) 0 + +def ctlRightDfaTable : List (Fin 3) := [0, 1, 2, 2, 2, 2] + +def ctlRightDfa (p : Fin 3) (a : Fin 2) : Fin 3 := + ctlRightDfaTable.getD (2 * p.val + a.val) 0 + +def ctlAcc : List (Fin 1 × Fin 6 × Fin 2 × Fin 3) := [ + (0, 0, 0, 0), (0, 0, 1, 0), (0, 1, 0, 0), (0, 2, 0, 0), + (0, 2, 0, 1), (0, 2, 1, 0), (0, 2, 1, 1) +] + +public section + +theorem is_not_halt : IsNotHalt target := + CtlCert.ctl_certificate_implies_is_does_not_halt + target ctlLeftDfa ctlRightDfa ctlAcc (by decide +kernel) + +end + +end BusyBeaver.M_1RB0RC_1LC0LD_1RA1RC_1RA1LE_0LB1RE_HHH1RA diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RC_1LC1LF_1LD0LB_1RE1LC_1RA0RE_0LCHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RC_1LC1LF_1LD0LB_1RE1LC_1RA0RE_0LCHHH.lean new file mode 100644 index 00000000..ac7578bd --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RC_1LC1LF_1LD0LB_1RE1LC_1RA0RE_0LCHHH.lean @@ -0,0 +1,269 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusF +public import BusyBeaver.Calculi.WordCalculusG +public import BusyBeaver.Calculi.WordCalculusH + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RC_1LC1LF_1LD0LB_1RE1LC_1RA0RE_0LCHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RC_1LC1LF_1LD0LB_1RE1LC_1RA0RE_0LCHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +abbrev A : Fin 6 := 2 +abbrev B : Fin 6 := 3 +abbrev C : Fin 6 := 4 +abbrev D : Fin 6 := 0 +abbrev E : Fin 6 := 1 +abbrev F : Fin 6 := 5 +@[reducible] def tm : Machine (Fin 2) (Fin 6) := target_tm +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 2000000 + +open WordVKQ Word WordVKQ.Traj103 + +abbrev evalCCfgVKQ (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev z0b (c : CCfg) : Option CCfg := Counter.bstep tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (evalCCfgVKQ c1) [tm]⊢⁺ (evalCCfgVKQ c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ + +abbrev pref24 : BitWord := [0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0] + + +def zCs : Call -> Fin 6 + | .ch => B + | .ca => A + +def zCR (w : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (w <{{zCs c}} ([1] +> r)) + +def zCL (w : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> w) {{C}}> r) + +def zCf (w : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> pref24 +> w) {{C}}> default) + +abbrev callStep (c : Call) (w1 w2 : HalfTape) : Prop := + ∀ r, (zCR w1 c r) [tm]⊢⁺ (zCL w2 r) + +abbrev Side := SideP callStep +abbrev Seg := SegP callStep + +theorem seg_ch_V : Seg [.ch] [.ch, .ch] V_u V_u := + segP_of_step_two (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (fun u r => by unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_V : Seg [.ca] [.ch] V_u Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Vp : Seg [.ca] [.ca, .ca] Vp Vp := + segP_of_step_two (mid1 := [0, 1, 1, 1]) (mid2 := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_K : Seg [.ch] [] K_u Q_u := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs K_u Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_Q : Seg [.ch] [.ch] Q_u K_u := + segP_of_step_one (mid := [1, 1]) + (fun u r => by unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL K_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_VpQ : Seg [.ca] [.ca] (Vp ++ Q_u) (Kp ++ Vp) := + segP_of_step_one (mid := [0, 1, 0, 1, 1, 1]) + (fun u r => by unfold zCR zCs Vp Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_KpVp : Seg [.ca] [] (Kp ++ Vp) (Qp ++ Vp) := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs Kp Vp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_QpVp : Seg [.ca] [.ca, .ca] (Qp ++ Vp) (Kp ++ Vp) := + segP_of_step_two (mid1 := [0, 1, 1, 1, 1, 1]) (mid2 := [0, 1, 0, 1, 1, 1]) + (fun u r => by unfold zCR zCs Qp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Kp : Seg [.ca] [] Kp Qp := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs Kp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Qp : Seg [.ca] [.ca] Qp Kp := + segP_of_step_one (mid := [1, 1]) + (fun u r => by unfold zCR zCs Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_KQ : Seg [.ca] [] (K_u ++ Q_u) Vp := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs K_u Q_u Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_QQ : Seg [.ca] [.ca] (Q_u ++ Q_u) Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +-- Turnaround zP0..zP6 +abbrev tr1 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1] +abbrev tr2 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1] +abbrev tr3 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1] +abbrev tr4 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1] +abbrev tr5 : BitWord := [0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1] +abbrev tr6 : BitWord := [0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1] + +theorem zP0 (w : HalfTape) : (zCf w) [tm]⊢⁺ (zCR w .ca (tr1 +> default)) := by + unfold zCf zCR zCs pref24 tr1 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP1 (w : HalfTape) : (zCL w (tr1 +> default)) [tm]⊢⁺ (zCR w .ca (tr2 +> default)) := by + unfold zCL zCR zCs tr1 tr2 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP2 (w : HalfTape) : (zCL w (tr2 +> default)) [tm]⊢⁺ (zCR w .ca (tr3 +> default)) := by + unfold zCL zCR zCs tr2 tr3 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP3 (w : HalfTape) : (zCL w (tr3 +> default)) [tm]⊢⁺ (zCR w .ca (tr4 +> default)) := by + unfold zCL zCR zCs tr3 tr4 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP4 (w : HalfTape) : (zCL w (tr4 +> default)) [tm]⊢⁺ (zCR w .ca (tr5 +> default)) := by + unfold zCL zCR zCs tr4 tr5 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP5 (w : HalfTape) : (zCL w (tr5 +> default)) [tm]⊢⁺ (zCR w .ca (tr6 +> default)) := by + unfold zCL zCR zCs tr5 tr6 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP6 (w : HalfTape) : (zCL w (tr6 +> default)) [tm]⊢⁺ (zCf ([1, 1, 0] +> w)) := by + unfold zCL zCf tr6 pref24 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +-- Section 2: Words, Shift Identity, DigitVal, Parse, Scan, Step +theorem segSpec : SegSpec callStep := + ⟨seg_ch_V, seg_ca_V, seg_ca_Vp, seg_ch_K, seg_ch_Q, + seg_ca_VpQ, seg_ca_KpVp, seg_ca_QpVp, seg_ca_Kp, seg_ca_Qp, + seg_ca_KQ, seg_ca_QQ⟩ + +theorem Side_turnaround {w w' : HalfTape} (h : Side ([Call.ca] ^ 6) w w') : + (zCf w) [tm]⊢⁺ (zCf ([1, 1, 0] +> w')) := by + rcases h with _ | ⟨hc1, h⟩ + rcases h with _ | ⟨hc2, h⟩ + rcases h with _ | ⟨hc3, h⟩ + rcases h with _ | ⟨hc4, h⟩ + rcases h with _ | ⟨hc5, h⟩ + rcases h with _ | ⟨hc6, h⟩ + cases h + exact stepPlus_trans_vkq (zP0 w) + (stepPlus_trans_vkq (hc1 (tr1 +> default)) + (stepPlus_trans_vkq (zP1 _) + (stepPlus_trans_vkq (hc2 (tr2 +> default)) + (stepPlus_trans_vkq (zP2 _) + (stepPlus_trans_vkq (hc3 (tr3 +> default)) + (stepPlus_trans_vkq (zP3 _) + (stepPlus_trans_vkq (hc4 (tr4 +> default)) + (stepPlus_trans_vkq (zP4 _) + (stepPlus_trans_vkq (hc5 (tr5 +> default)) + (stepPlus_trans_vkq (zP5 _) + (stepPlus_trans_vkq (hc6 (tr6 +> default)) (zP6 w')))))))))))) + +theorem Step_exec {u u' : List Word} (h : Step u u') : + (zCf (evalWords u default)) [tm]⊢⁺ (zCf (evalWords u' default)) := by + rcases h with ⟨n, b', v, da, H, g, hScan, hDg, rfl⟩ + have hSeg := Seg_of_Scan segSpec hScan + dsimp at hSeg + have hSide0 := sideP_of_segP hSeg (Side_ca_default segSpec hDg) + rw [wordsToBits_append_tape, evalWords_append, evalWords_replicate_K, wordsToBitsShifted_append_tape, <- evalWordsShifted_append] at hSide0 + have hTurn := Side_turnaround hSide0 + rwa [evalWords_V_shift] at hTurn + +theorem Rounds_exec {u v : List Word} (h : Rounds u v) : + (zCf (evalWords u default)) [tm]⊢* (zCf (evalWords v default)) := by + induction h with + | refl _ => exact ⟨0, rfl⟩ + | next hS _ ih => exact stepStar_of_stepPlus_vkq (stepPlus_stepStar_trans_vkq (Step_exec hS) ih) + +-- Section 3: Universal Parse_V_start, Scan_of_Parse, and Trace Evaluators + +def zInitCCfg : CCfg := ⟨0, 0, [], []⟩ +def zHit6CCfg : CCfg := ⟨4, 0, [0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1], []⟩ + +set_option maxRecDepth 200000 in +theorem zCm_init_274 : zCm zInitCCfg 274 = some zHit6CCfg := by decide + +theorem init_to_u0 : (init []) [tm]⊢* zCf (evalWords u_0 default) := by + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = evalCCfgVKQ zInitCCfg := rfl + have h1 : evalCCfgVKQ zHit6CCfg = zCf (evalWords u_0 default) := by + dsimp [evalCCfgVKQ, zHit6CCfg, zCf, pref24, u_0, evalWords, V_u, K_u, Q_u] + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq, default_head_vkq, default_tail_vkq] + have hPlus := zTc (by decide : 0 < 274) zCm_init_274 + rw [<- h0, h1] at hPlus + exact stepStar_of_stepPlus_vkq hPlus + +-- 17 finite rounds u_0 -> u_17 +theorem reach_N (m : Nat) : + ∃ N, m <= N ∧ ∃ u, + multiStep tm (init []) N = some (zCf (evalWords u default)) ∧ + Good u := by + induction m with + | zero => + rcases init_to_u0 with ⟨k1, hk1⟩ + rcases Rounds_exec rounds_0_17 with ⟨k2, hk2⟩ + exact ⟨k1 + k2, Nat.zero_le _, u_17, multiStep_trans_vkq tm _ _ _ k1 k2 hk1 hk2, good_u17⟩ + | succ m ih => + rcases ih with ⟨N, hN, u, h_ms, hG⟩ + rcases Good_step hG with ⟨u', hStep, hG'⟩ + rcases Step_exec hStep with ⟨k, hk_pos, h_step_k⟩ + exact ⟨N + k, Nat.add_le_add hN hk_pos, u', multiStep_trans_vkq tm _ _ _ N k h_ms h_step_k, hG'⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n, hn⟩ + rcases reach_N (n + 1) with ⟨N, hN, _, h_N, _⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := multiStep_add_intermediate_vkq h_N + rw [multiStep_succ_vkq, hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RC_1LC1LF_1LD0LB_1RE1LC_1RA0RE_0LCHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RC_1LC1RA_0RF0LD_1LE0RB_1LB0LD_HHH1RD.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RC_1LC1RA_0RF0LD_1LE0RB_1LB0LD_HHH1RD.lean new file mode 100644 index 00000000..a8fd6d11 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RC_1LC1RA_0RF0LD_1LE0RB_1LB0LD_HHH1RD.lean @@ -0,0 +1,48 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.BB6.NonHalt.M_1RB0RE_1RC1LF_0LD0RE_HHH1LE_1RA0LB_1LB0LC + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RB0RC_1LC1RA_0RF0LD_1LE0RB_1LB0LD_HHH1RD + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RC_1LC1RA_0RF0LD_1LE0RB_1LB0LD_HHH1RD" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +def stateMap_m0426 : Fin 6 → Fin 6 + | 0 => 4 -- m0426 state A + | 1 => 1 -- m0426 state B + | 2 => 2 -- m0426 state C + | 3 => 5 -- m0426 state D + | 4 => 3 -- m0426 state E + | 5 => 0 -- m0426 state F + +public section + +theorem is_not_halt : IsNotHalt target := by + exact Counter.does_not_halt_of_conj_stem + (M_src := BusyBeaver.M_1RB0RE_1RC1LF_0LD0RE_HHH1LE_1RA0LB_1LB0LC.target) + (σ := stateMap_m0426) (f := true) + (c₁ := (default : ListBlank (Fin 2)) {{5}}> default) + (by decide) ⟨0, rfl⟩ + BusyBeaver.M_1RB0RE_1RC1LF_0LD0RE_HHH1LE_1RA0LB_1LB0LC.is_not_halt_from_0426 + +end + +end BusyBeaver.M_1RB0RC_1LC1RA_0RF0LD_1LE0RB_1LB0LD_HHH1RD diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RC_1LC1RD_1RA1LE_1LA0RD_0LE1RF_1LBHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RC_1LC1RD_1RA1LE_1LA0RD_0LE1RF_1LBHHH.lean new file mode 100644 index 00000000..18befec5 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RC_1LC1RD_1RA1LE_1LA0RD_0LE1RF_1LBHHH.lean @@ -0,0 +1,45 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.CtlCertificate + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.M_1RB0RC_1LC1RD_1RA1LE_1LA0RD_0LE1RF_1LBHHH + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RC_1LC1RD_1RA1LE_1LA0RD_0LE1RF_1LBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +def ctlLeftDfaTable : List (Fin 3) := [0, 1, 2, 2, 2, 2] + +def ctlLeftDfa (p : Fin 3) (a : Fin 2) : Fin 3 := + ctlLeftDfaTable.getD (2 * p.val + a.val) 0 + +def ctlRightDfaTable : List (Fin 2) := [0, 1, 1, 1] + +def ctlRightDfa (p : Fin 2) (a : Fin 2) : Fin 2 := + ctlRightDfaTable.getD (2 * p.val + a.val) 0 + +def ctlAcc : List (Fin 3 × Fin 6 × Fin 2 × Fin 2) := [ + (0, 0, 0, 0), (0, 2, 1, 1), (0, 4, 0, 1), (1, 1, 0, 0) +] + +public section + +theorem is_not_halt : IsNotHalt target := + CtlCert.ctl_certificate_implies_is_does_not_halt + target ctlLeftDfa ctlRightDfa ctlAcc (by decide +kernel) + +end + +end BusyBeaver.M_1RB0RC_1LC1RD_1RA1LE_1LA0RD_0LE1RF_1LBHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RD_0LC0RA_1LA1LC_1RE0LF_0RA1RF_1LBHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RD_0LC0RA_1LA1LC_1RE0LF_0RA1RF_1LBHHH.lean new file mode 100644 index 00000000..860726a2 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RD_0LC0RA_1LA1LC_1RE0LF_0RA1RF_1LBHHH.lean @@ -0,0 +1,378 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter + +open Mathlib Relation Nat Turing BusyBeaver SixState + +@[expose] public section + +namespace BusyBeaver.M_1RB0RD_0LC0RA_1LA1LC_1RE0LF_0RA1RF_1LBHHH + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RD_0LC0RA_1LA1LC_1RE0LF_0RA1RF_1LBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end BusyBeaver.M_1RB0RD_0LC0RA_1LA1LC_1RE0LF_0RA1RF_1LBHHH + +end + +namespace BusyBeaver.M_1RB0RD_0LC0RA_1LA1LC_1RE0LF_0RA1RF_1LBHHH + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + +local infixr:67 (priority := + high) " >> " => (ListBlank.cons : Fin 2 → ListBlank (Fin 2) → ListBlank (Fin 2)) +local notation3 (priority := high) l " {{" q "}}> " r => + (⟨some q, ⟨ListBlank.head r, l, ListBlank.tail r⟩⟩ : Cfg (Fin 2) (Fin 6)) +local notation3 (priority := high) l " <{{" q "}} " r => + (⟨some q, ⟨ListBlank.head l, ListBlank.tail l, r⟩⟩ : Cfg (Fin 2) (Fin 6)) + + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = + some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = + step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = (0 : Fin 2) := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +theorem step_multiStep_one {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢^{1} c₂ := by simp [h] +theorem step_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢⁺ c₂ := ⟨1, by decide, step_multiStep_one tm c₁ c₂ h⟩ +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c3 : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c3) : + c₁ [tm]⊢^{n+m} c3 := by + rw [multiStep_add, h₁]; simp [h₂] +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c3) : c₁ [tm]⊢⁺ c3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c3 n m hn hm⟩ +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c3) : c₁ [tm]⊢⁺ c3 := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, + BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, + default_head, default_tail]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) + +/-- General invariant theorem for `IsNotHalt`. -/ +theorem isNotHalt_of_invariant {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ c₀, ((init []) [M]⊢⁺ c₀) ∧ Inv c₀) + (h_step : ∀ c, Inv c → ∃ c', (c [M]⊢⁺ c') ∧ Inv c') : + IsNotHalt M := by + rcases h_init with ⟨c₀, ⟨n₀, _, hn₀⟩, hinv₀⟩ + exact BusyBeaver.Counter.does_not_halt_of_invariant Inv ⟨c₀, ⟨n₀, hn₀⟩, hinv₀⟩ h_step + +-- Composite mode transitions for #303 (mirror of #559) +theorem tr_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [target_tm]⊢⁺ c₂) (h₂ : c₂ [target_tm]⊢⁺ c₃) : c₁ [target_tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus h₁ (stepPlus_stepStar h₂) + +theorem tr_init_18 : + (init []) [target_tm]⊢⁺ (default {{A}}> (1 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> default)) := by + change (default {{A}}> default) [target_tm]⊢⁺ _ + execute + +theorem tr_L0_A (X B_r : ListBlank (Fin 2)) : + ((0 >> 1 >> B_r) {{A}}> (0 >> 0 >> 1 >> 0 >> X)) [target_tm]⊢⁺ + (B_r {{A}}> (1 >> 1 >> 1 >> 0 >> 1 >> 0 >> X)) := by execute + +theorem tr_L0_B (X B_r : ListBlank (Fin 2)) : + ((0 >> 1 >> B_r) {{A}}> (0 >> 1 >> 0 >> 1 >> 0 >> X)) [target_tm]⊢⁺ + ((0 >> 1 >> 0 >> 1 >> 0 >> 1 >> B_r) {{A}}> (0 >> X)) := by execute + +theorem tr_L10_A (X B_r : ListBlank (Fin 2)) : + ((0 >> 1 >> B_r) {{A}}> (1 >> 0 >> 0 >> 1 >> 0 >> X)) [target_tm]⊢⁺ + ((0 >> 1 >> 0 >> 0 >> 1 >> B_r) {{A}}> (1 >> 0 >> X)) := by execute + +theorem tr_L10_B (X B_r : ListBlank (Fin 2)) : + ((0 >> 1 >> B_r) {{A}}> (1 >> 0 >> 1 >> 0 >> 1 >> 0 >> X)) [target_tm]⊢⁺ + ((0 >> 1 >> 0 >> 0 >> 1 >> 1 >> B_r) {{A}}> (1 >> 0 >> X)) := by execute + +theorem tr_L10_bot10 (B_r : ListBlank (Fin 2)) : + ((0 >> 1 >> B_r) {{A}}> (1 >> 0 >> 1 >> 0 >> default)) [target_tm]⊢⁺ + ((0 >> 0 >> 1 >> 0 >> 0 >> 1 >> B_r) {{A}}> (1 >> 1 >> 1 >> 0 >> default)) := by execute + +theorem tr_L1010_A (X B_r : ListBlank (Fin 2)) : + ((0 >> 1 >> B_r) {{A}}> (1 >> 0 >> 1 >> 0 >> 0 >> 1 >> 0 >> X)) [target_tm]⊢⁺ + ((0 >> 1 >> 0 >> 0 >> 1 >> B_r) {{A}}> (1 >> 0 >> 1 >> 0 >> X)) := by execute + +theorem tr_L1010_B (X B_r : ListBlank (Fin 2)) : + ((0 >> 1 >> B_r) {{A}}> (1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> X)) [target_tm]⊢⁺ + ((0 >> 1 >> 0 >> 0 >> 1 >> 1 >> B_r) {{A}}> (1 >> 0 >> 1 >> 0 >> X)) := by execute + +theorem tr_L1010_bot10 (B_r : ListBlank (Fin 2)) : + ((0 >> 1 >> B_r) {{A}}> (1 >> 0 >> 1 >> 0 >> 1 >> 0 >> default)) [target_tm]⊢⁺ + ((0 >> 0 >> 1 >> 0 >> 0 >> 1 >> 1 >> B_r) {{A}}> (1 >> 1 >> 1 >> 0 >> default)) := by execute + +theorem tr_R11_emp (X : ListBlank (Fin 2)) : + (default {{A}}> (1 >> 1 >> X)) [target_tm]⊢⁺ + ((0 >> 1 >> 0 >> 1 >> default) {{A}}> (0 >> X)) := by execute + +theorem tr_R11_01 (X : ListBlank (Fin 2)) : + ((0 >> 1 >> default) {{A}}> (1 >> 1 >> X)) [target_tm]⊢⁺ + ((0 >> 1 >> default) {{A}}> (1 >> 0 >> 1 >> 0 >> X)) := by execute + +theorem tr_R11_0101 (X B_r : ListBlank (Fin 2)) : + ((0 >> 1 >> 0 >> 1 >> B_r) {{A}}> (1 >> 1 >> X)) [target_tm]⊢⁺ + (B_r {{A}}> (1 >> 1 >> 1 >> 0 >> 1 >> 0 >> X)) := by execute + +theorem tr_R11_001 (X B_r : ListBlank (Fin 2)) : + ((0 >> 0 >> 1 >> B_r) {{A}}> (1 >> 1 >> X)) [target_tm]⊢⁺ + (B_r {{A}}> (1 >> 1 >> 0 >> 1 >> 0 >> X)) := by execute + +theorem tr_R11_0011 (X B_r : ListBlank (Fin 2)) : + ((0 >> 0 >> 1 >> 1 >> B_r) {{A}}> (1 >> 1 >> X)) [target_tm]⊢⁺ + ((0 >> 1 >> 0 >> 0 >> B_r) {{A}}> (1 >> 0 >> X)) := by execute + +theorem tr_R11_00001 (X B_r : ListBlank (Fin 2)) : + ((0 >> 0 >> 0 >> 0 >> 1 >> B_r) {{A}}> (1 >> 1 >> X)) [target_tm]⊢⁺ + ((0 >> 1 >> 0 >> 1 >> 0 >> 1 >> B_r) {{A}}> (0 >> X)) := by execute + +theorem tr_R11_1_B (X B_r : ListBlank (Fin 2)) : + ((1 >> B_r) {{A}}> (1 >> 1 >> 1 >> 0 >> 1 >> 0 >> X)) [target_tm]⊢⁺ + ((0 >> 1 >> 0 >> 0 >> 1 >> B_r) {{A}}> (1 >> 0 >> X)) := by execute + +theorem tr_L0_BB (X B_r : ListBlank (Fin 2)) : + ((0 >> 1 >> B_r) {{A}}> (0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> X)) [target_tm]⊢⁺ + ((0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> B_r) {{A}}> (0 >> X)) := + tr_trans (tr_L0_B (1 >> 0 >> 1 >> 0 >> X) B_r) (tr_L0_B X (0 >> 1 >> 0 >> 1 >> B_r)) + +theorem tr_L10_BB (X B_r : ListBlank (Fin 2)) : + ((0 >> 1 >> B_r) {{A}}> (1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> X)) [target_tm]⊢⁺ + ((0 >> 1 >> 0 >> 0 >> 1 >> 1 >> 0 >> 0 >> 1 >> 1 >> B_r) {{A}}> (1 >> 0 >> X)) := + tr_trans (tr_L10_B (1 >> 0 >> 1 >> 0 >> X) B_r) (tr_L10_B X (0 >> 0 >> 1 >> 1 >> B_r)) + +theorem tr_L1010_BB (X B_r : ListBlank (Fin 2)) : + ((0 >> 1 >> B_r) {{A}}> (1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> + X)) [target_tm]⊢⁺ + ((0 >> 1 >> 0 >> 0 >> 1 >> 1 >> 0 >> 0 >> 1 >> 1 >> B_r) {{A}}> (1 >> 0 >> 1 >> 0 >> X)) := + tr_trans (tr_L1010_B (1 >> 0 >> 1 >> 0 >> X) B_r) (tr_L1010_B X (0 >> 0 >> 1 >> 1 >> B_r)) + +theorem tr_R11_0011_emp (X : ListBlank (Fin 2)) : + ((0 >> 0 >> 1 >> 1 >> default) {{A}}> (1 >> 1 >> X)) [target_tm]⊢⁺ + ((0 >> 1 >> default) {{A}}> (1 >> 0 >> X)) := by + simpa only [zero_cons_default] using tr_R11_0011 X default + +theorem tr_R11_0101_pair (X B_r : ListBlank (Fin 2)) : + ((0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> B_r) {{A}}> (1 >> 1 >> X)) [target_tm]⊢⁺ + (B_r {{A}}> (1 >> 1 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> X)) := + tr_trans (tr_R11_0101 X (0 >> 1 >> 0 >> 1 >> B_r)) (tr_R11_0101 (1 >> 0 >> 1 >> 0 >> X) B_r) + +theorem tr_R11_01_B (X : ListBlank (Fin 2)) : + ((0 >> 1 >> default) {{A}}> (1 >> 1 >> 1 >> 0 >> 1 >> 0 >> X)) [target_tm]⊢⁺ + ((0 >> 1 >> 0 >> 0 >> 1 >> 1 >> default) {{A}}> (1 >> 0 >> 1 >> 0 >> X)) := + tr_trans (tr_R11_01 (1 >> 0 >> 1 >> 0 >> X)) (tr_L1010_B X default) + +theorem tr_R11_01011_B (X B_r : ListBlank (Fin 2)) : + ((0 >> 1 >> 0 >> 1 >> 1 >> B_r) {{A}}> (1 >> 1 >> 1 >> 0 >> 1 >> 0 >> X)) [target_tm]⊢⁺ + ((0 >> 1 >> 0 >> 0 >> 1 >> 1 >> 0 >> 0 >> 1 >> B_r) {{A}}> (1 >> 0 >> X)) := + tr_trans (tr_R11_0101 (1 >> 0 >> 1 >> 0 >> X) (1 >> B_r)) + (tr_trans (tr_R11_1_B (1 >> 0 >> 1 >> 0 >> X) B_r) (tr_L10_B X (0 >> 0 >> 1 >> B_r))) + +-- Closed two-stack grammar and inductive invariant for #303 +inductive StackL : Nat → ListBlank (Fin 2) → Prop + | bot10 : StackL 0 (1 >> 0 >> default) + | pushA {a X} : StackL a X → StackL (a + 1) (0 >> 1 >> 0 >> X) + | pushBB {a X} : StackL a X → StackL a (1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> X) + +inductive StackR : Nat → ListBlank (Fin 2) → Prop + | emp {a} : StackR (a + 1) default + | c0011_emp {a} : StackR a (0 >> 0 >> 1 >> 1 >> default) + | c001 {a B} : StackR (a + 1) B → StackR a (0 >> 0 >> 1 >> B) + | c0011_001 {a B} : StackR (a + 1) B → StackR a (0 >> 0 >> 1 >> 1 >> 0 >> 0 >> 1 >> B) + | c0011_0011 {a B} : StackR a B → StackR a (0 >> 0 >> 1 >> 1 >> 0 >> 0 >> 1 >> 1 >> B) + | c00001 {a B} : StackR a B → StackR (a + 1) (0 >> 0 >> 0 >> 0 >> 1 >> B) + | c000011 {a B} : StackR a B → StackR (a + 1) (0 >> 0 >> 0 >> 0 >> 1 >> 1 >> B) + +theorem StackR.weaken {a B} (h : StackR a B) : StackR (a + 1) B := by + induction h with + | emp => exact StackR.emp + | c0011_emp => exact StackR.c0011_emp + | c001 _ ih => exact StackR.c001 ih + | c0011_001 _ ih => exact StackR.c0011_001 ih + | c0011_0011 _ ih => exact StackR.c0011_0011 ih + | c00001 _ ih => exact StackR.c00001 ih + | c000011 _ ih => exact StackR.c000011 ih + +inductive StackR1010 : Nat → ListBlank (Fin 2) → Prop + | emp {a} : StackR1010 (a + 1) default + | c0011_emp {a} : StackR1010 (a + 1) (0 >> 0 >> 1 >> 1 >> default) + | c001 {a B} : StackR1010 (a + 1) B → StackR1010 a (0 >> 0 >> 1 >> B) + | c0011_0011 {a B} : StackR1010 a B → StackR1010 a (0 >> 0 >> 1 >> 1 >> 0 >> 0 >> 1 >> 1 >> B) + +theorem StackR1010.toStackR {a B} (h : StackR1010 a B) : StackR a B := by + induction h with + | emp => exact StackR.emp + | c0011_emp => exact StackR.c0011_emp + | c001 _ ih => exact StackR.c001 ih + | c0011_0011 _ ih => exact StackR.c0011_0011 ih + +theorem StackR1010.push0011 {a B} (h : StackR1010 a B) : StackR a (0 >> 0 >> 1 >> 1 >> B) := by + induction h with + | emp => exact StackR.c0011_emp + | c0011_emp => exact StackR.c0011_0011 StackR.emp + | c001 h' _ => exact StackR.c0011_001 h'.toStackR + | c0011_0011 _ ih => exact StackR.c0011_0011 ih + +inductive PopTarget : Nat → ListBlank (Fin 2) → Prop + | emp {a} : PopTarget a (0 >> 1 >> default) + | c0101 {a B_0} : StackR a B_0 → PopTarget a (0 >> 1 >> 0 >> 1 >> B_0) + | c01011 {a B_0} : StackR a B_0 → PopTarget a (0 >> 1 >> 0 >> 1 >> 1 >> B_0) + +inductive R0101 : Nat → ListBlank (Fin 2) → Prop + | base {a B} : PopTarget a B → R0101 a B + | step {a B} : R0101 a B → R0101 a (0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> B) + +inductive Inv : Cfg (Fin 2) (Fin 6) → Prop + | Mode_L0 {a X B} : StackL (a + 1) X → R0101 a B → Inv ((0 >> 1 >> B) {{A}}> (0 >> X)) + | Mode_L10 {a X B} : StackL a X → StackR (a + 2) B → Inv ((0 >> 1 >> B) {{A}}> (1 >> 0 >> X)) + | Mode_L1010 {a X B} : StackL a X → StackR1010 (a + 1) B → Inv ((0 >> 1 >> B) {{A}}> (1 >> 0 >> + 1 >> 0 >> X)) + | Mode_R11 {a X B} : StackL a X → StackR a B → Inv (B {{A}}> (1 >> 1 >> X)) + | Mode_R11_pop {a X B} : StackL a X → R0101 a B → Inv (B {{A}}> (1 >> 1 >> 1 >> 0 >> 1 >> 0 >> X)) + +theorem step_Inv : ∀ c, Inv c → ∃ c', (c [target_tm]⊢⁺ c') ∧ Inv c' := by + intro c hc + cases hc with + | Mode_L0 hX hB => + cases hX with + | pushA hX' => + exact ⟨_, tr_L0_A _ _, Inv.Mode_R11_pop hX' hB⟩ + | pushBB hX' => + exact ⟨_, tr_L0_BB _ _, Inv.Mode_L0 hX' (R0101.step hB)⟩ + | Mode_L10 hX hB => + cases hX with + | bot10 => + exact ⟨_, tr_L10_bot10 _, Inv.Mode_R11 StackL.bot10 (StackR.c001 (StackR.c001 hB))⟩ + | pushA hX' => + exact ⟨_, tr_L10_A _ _, Inv.Mode_L10 hX' (StackR.c001 hB)⟩ + | pushBB hX' => + exact ⟨_, tr_L10_BB _ _, Inv.Mode_L10 hX' (StackR.c0011_0011 hB)⟩ + | Mode_L1010 hX hB => + cases hX with + | bot10 => + exact ⟨_, tr_L1010_bot10 _, Inv.Mode_R11 StackL.bot10 (StackR.c001 hB.push0011)⟩ + | pushA hX' => + exact ⟨_, tr_L1010_A _ _, Inv.Mode_L1010 hX' (StackR1010.c001 hB)⟩ + | pushBB hX' => + exact ⟨_, tr_L1010_BB _ _, Inv.Mode_L1010 hX' (StackR1010.c0011_0011 hB)⟩ + | Mode_R11 hX hB => + cases hB with + | emp => + exact ⟨_, tr_R11_emp _, Inv.Mode_L0 hX (R0101.base PopTarget.emp)⟩ + | c0011_emp => + exact ⟨_, tr_R11_0011_emp _, Inv.Mode_L10 hX StackR.emp⟩ + | c001 hB' => + exact ⟨_, tr_R11_001 _ _, Inv.Mode_R11 (StackL.pushA hX) hB'⟩ + | c0011_001 hB' => + exact ⟨_, tr_R11_0011 _ _, Inv.Mode_L10 hX (StackR.c00001 hB')⟩ + | c0011_0011 hB' => + exact ⟨_, tr_R11_0011 _ _, Inv.Mode_L10 hX (StackR.c000011 hB'.weaken)⟩ + | c00001 hB' => + exact ⟨_, tr_R11_00001 _ _, Inv.Mode_L0 hX (R0101.base (PopTarget.c0101 hB'))⟩ + | c000011 hB' => + exact ⟨_, tr_R11_00001 _ _, Inv.Mode_L0 hX (R0101.base (PopTarget.c01011 hB'))⟩ + | Mode_R11_pop hX hB => + cases hB with + | step hB' => + exact ⟨_, tr_R11_0101_pair _ _, Inv.Mode_R11_pop (StackL.pushBB hX) hB'⟩ + | base hT => + cases hT with + | emp => + exact ⟨_, tr_R11_01_B _, Inv.Mode_L1010 hX StackR1010.c0011_emp⟩ + | c0101 hB' => + exact ⟨_, tr_R11_0101 _ _, Inv.Mode_R11 (StackL.pushBB hX) hB'⟩ + | c01011 hB' => + exact ⟨_, tr_R11_01011_B _ _, Inv.Mode_L10 hX (StackR.c0011_001 hB'.weaken.weaken.weaken)⟩ + + + +theorem tr_init_F_19 : + ((default : ListBlank (Fin 2)) {{F}}> default) [target_tm]⊢⁺ + ((0 >> 1 >> default) {{A}}> (1 >> 0 >> 1 >> 0 >> 1 >> 0 >> default)) := by + execute + +theorem inv_reaches_from {c : Cfg (Fin 2) (Fin 6)} (hc : Inv c) (m : ℕ) : + ∃ k ≥ m, ∃ c', multiStep target_tm c k = some c' ∧ Inv c' := by + induction m with + | zero => exact ⟨0, Nat.zero_le 0, c, rfl, hc⟩ + | succ m ih => + rcases ih with ⟨k, hk, c₁, hk₁, hc₁⟩ + rcases step_Inv c₁ hc₁ with ⟨c₂, ⟨d, hd_pos, hd⟩, hc₂⟩ + exact ⟨k + d, by omega, c₂, multiStep_trans target_tm c c₁ c₂ k d hk₁ hd, hc₂⟩ + +theorem does_not_halt_of_inv_from {c_init c₀ : Cfg (Fin 2) (Fin 6)} + (h_init : c_init [target_tm]⊢⁺ c₀) (h₀ : Inv c₀) : + ∀ cfg : Cfg (Fin 2) (Fin 6), (c_init [target_tm]⊢* cfg) → (step target_tm cfg).isSome := by + rcases h_init with ⟨k₀, _, hk₀⟩ + intro cfg ⟨n, hn⟩ + rcases inv_reaches_from h₀ (n + 1) with ⟨k, hk, c', hk', _⟩ + have h_tot := multiStep_trans target_tm c_init c₀ c' k₀ k hk₀ hk' + have h_split : k₀ + k = (n + 1) + (k₀ + k - (n + 1)) := by omega + rw [h_split, multiStep_add, multiStep_succ, hn] at h_tot + cases hst : step target_tm cfg with + | none => + change Option.bind (step target_tm cfg) _ = some c' at h_tot + rw [hst] at h_tot; cases h_tot + | some _ => rfl + +public section + +theorem is_not_halt_from_0559 : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{5}}> default) [target]⊢* cfg) → (step target cfg).isSome := + does_not_halt_of_inv_from tr_init_F_19 (Inv.Mode_L1010 StackL.bot10 StackR1010.emp) + +theorem is_not_halt : IsNotHalt target := + does_not_halt_of_inv_from tr_init_18 (Inv.Mode_R11 (StackL.pushA StackL.bot10) StackR.emp) + +end + +end BusyBeaver.M_1RB0RD_0LC0RA_1LA1LC_1RE0LF_0RA1RF_1LBHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RD_0LC1RA_0RA1LB_1RE1LB_1LF1LB_HHH1LE.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RD_0LC1RA_0RA1LB_1RE1LB_1LF1LB_HHH1LE.lean new file mode 100644 index 00000000..f22d6862 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RD_0LC1RA_0RA1LB_1RE1LB_1LF1LB_HHH1LE.lean @@ -0,0 +1,515 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RD_0LC1RA_0RA1LB_1RE1LB_1LF1LB_HHH1LE + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RD_0LC1RA_0RA1LB_1RE1LB_1LF1LB_HHH1LE" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +def target_tm : Machine (Fin 2) (Fin 6) + | 0, 0 => some (some 1, Stmt.write 1 Dir.right) + | 0, 1 => some (some 3, Stmt.write 0 Dir.right) + | 1, 0 => some (some 2, Stmt.write 0 Dir.left) + | 1, 1 => some (some 0, Stmt.write 1 Dir.right) + | 2, 0 => some (some 0, Stmt.write 0 Dir.right) + | 2, 1 => some (some 1, Stmt.write 1 Dir.left) + | 3, 0 => some (some 4, Stmt.write 1 Dir.right) + | 3, 1 => some (some 1, Stmt.write 1 Dir.left) + | 4, 0 => some (some 5, Stmt.write 1 Dir.left) + | 4, 1 => some (some 1, Stmt.write 1 Dir.left) + | 5, 0 => none + | 5, 1 => some (some 4, Stmt.write 1 Dir.left) + +theorem target_eq_target_tm : target = target_tm := by + funext q a + fin_cases q <;> fin_cases a <;> simp [target, machine, ConjectureMachines.Machine.toBB, ConjectureMachines.Machine.ofRows, target_tm] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 + +local infixr:67 (priority := high) " >> " => + (ListBlank.cons : Fin 2 → ListBlank (Fin 2) → ListBlank (Fin 2)) + +/-- Explicit configuration constructor with head symbol `s`, left stream `l`, and right stream `r`. -/ +def mkCfg (q : Fin 6) (s : Fin 2) (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some q, ⟨s, l, r⟩⟩ + +@[simp] theorem zMs (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem zZcd : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : ListBlank (Fin 2)).head = (0 : Fin 2) := rfl +@[simp] theorem zDt : (default : ListBlank (Fin 2)).tail = default := rfl + +theorem zMa {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp [multiStep] + | succ m' ih => + rw [Nat.add_succ, zMs, ih, Option.bind_assoc] + simp_rw [zMs] + +theorem zMt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [zMa, h₁]; simp [h₂] + +theorem zPs {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem q7 {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), zMt tm c₁ c₂ c₃ n m hn hm⟩ + +theorem q8 {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, by omega, zMt tm c₁ c₂ c₃ n m hn hm⟩ + +/-- General invariant theorem for `IsNotHalt`. -/ +theorem isNotHalt_of_invariant {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ c₀, ((init []) [M]⊢⁺ c₀) ∧ Inv c₀) + (h_step : ∀ c, Inv c → ∃ c', (c [M]⊢⁺ c') ∧ Inv c') : + IsNotHalt M := by + have h_reach : ∀ k, ∃ m ≥ k, ∃ c, multiStep M (init []) m = some c ∧ Inv c := by + intro k + induction k with + | zero => + rcases h_init with ⟨c₀, ⟨m, _, hm⟩, hinv⟩ + exact ⟨m, Nat.zero_le m, c₀, hm, hinv⟩ + | succ k ih => + rcases ih with ⟨m, hm_ge, c, hm, hinv⟩ + rcases h_step c hinv with ⟨c', ⟨d, hd_pos, hd⟩, hinv'⟩ + refine ⟨m + d, by omega, c', zMt M (init []) c c' m d hm hd, hinv'⟩ + intro cfg ⟨n, hn⟩ + rcases h_reach (n + 1) with ⟨m, hm_ge, c_end, hm, _⟩ + have h_split : m = n + 1 + (m - (n + 1)) := by omega + rw [h_split, zMa M (init []) (n + 1) (m - (n + 1)), zMs M (init []) n, hn] at hm + simp only [Option.bind] at hm + cases h_st : step M cfg with + | none => simp [h_st] at hm + | some _ => rfl + +/-- Prepend `n` ones onto a `ListBlank (Fin 2)` stream. -/ +def rep1 : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, s => s + | n + 1, s => 1 >> rep1 n s + +/-- Prepend `m` alternating `0, 1` pairs (`0` nearest head). -/ +def rep01 : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, s => s + | m + 1, s => 0 >> 1 >> rep01 m s + +theorem rep1_add (a b : Nat) (s : ListBlank (Fin 2)) : + rep1 a (rep1 b s) = rep1 (a + b) s := by + induction a generalizing b s with + | zero => simp [rep1] + | succ a ih => simp [rep1, Nat.succ_add, ih] + +theorem rep01_snoc (m : Nat) (s : ListBlank (Fin 2)) : + rep01 m (0 >> 1 >> s) = rep01 (m + 1) s := by + induction m generalizing s with + | zero => rfl + | succ m ih => show 0 >> 1 >> rep01 m (0 >> 1 >> s) = 0 >> 1 >> rep01 (m + 1) s; rw [ih s] + +/-- Canonical 2-parameter family: `0^∞ 1^a mkCfg B 0 default (rep1 (c + 1) default) + | k + 1, c => mkCfg B 1 (rep1 k default) (rep1 (c + 1) default) + +/-- Intermediate peeling configuration: `mkCfg B 1 (rep01 k (rep1 a default)) (rep1 (r + 1) default)`. -/ +def peelState (k a r : Nat) : Cfg (Fin 2) (Fin 6) := + mkCfg B 1 (rep01 k (rep1 a default)) (rep1 (r + 1) default) + +theorem peelState_zero (a r : Nat) : peelState 0 a r = cfgB (a + 1) r := rfl + +theorem step_C_left_one (L R : ListBlank (Fin 2)) : + (mkCfg C 1 (0 >> 1 >> L) R) [target_tm]⊢⁺ (mkCfg C 1 L (0 >> 1 >> R)) := + ⟨2, by decide, by + simp only [multiStep, Function.iterate_succ', Function.iterate_zero, id_eq, Function.comp_apply, + Option.bind, Option.map, step, Tape.mk₂, Tape.mk', target_tm, mkCfg, Tape.write, Tape.move, ListBlank.head_cons, + ListBlank.tail_cons, A, B, C, D, E, F]⟩ + +/-- Sweep left across `rep01 m L` in state `C` (`2m` steps). -/ +theorem sweep_C_left (m : Nat) (L R : ListBlank (Fin 2)) : + (mkCfg C 1 (rep01 m L) R) [target_tm]⊢* (mkCfg C 1 L (rep01 m R)) := by + induction m generalizing L R with + | zero => exact ⟨0, rfl⟩ + | succ m ih => + have h1 := step_C_left_one (rep01 m L) R + have h2 := ih L (0 >> 1 >> R) + rw [rep01_snoc] at h2 + exact zPs (q7 h1 h2) + +theorem step_A_right_one (L R : ListBlank (Fin 2)) : + (mkCfg A 1 (1 >> L) (0 >> 1 >> R)) [target_tm]⊢⁺ (mkCfg A 1 (1 >> (0 >> 1 >> L)) R) := + ⟨4, by decide, by + simp only [multiStep, Function.iterate_succ', Function.iterate_zero, id_eq, Function.comp_apply, + Option.bind, Option.map, step, Tape.mk₂, Tape.mk', target_tm, mkCfg, Tape.write, Tape.move, ListBlank.head_cons, + ListBlank.tail_cons, A, B, C, D, E, F]⟩ + +/-- Sweep right across `rep01 m R` in state `A` (`4m` steps). -/ +theorem sweep_A_right (m : Nat) (L R : ListBlank (Fin 2)) : + (mkCfg A 1 (1 >> L) (rep01 m R)) [target_tm]⊢* (mkCfg A 1 (1 >> rep01 m L) R) := by + induction m generalizing L R with + | zero => exact ⟨0, rfl⟩ + | succ m ih => + have h1 := step_A_right_one L (rep01 m R) + have h2 := ih (0 >> 1 >> L) R + rw [rep01_snoc] at h2 + exact zPs (q7 h1 h2) + +theorem step_AB_right_one (L R : ListBlank (Fin 2)) : + (mkCfg A 0 L (1 >> 0 >> 1 >> R)) [target_tm]⊢⁺ (mkCfg A 0 (1 >> 1 >> L) (1 >> R)) := + ⟨2, by decide, by + simp only [multiStep, Function.iterate_succ', Function.iterate_zero, id_eq, Function.comp_apply, + Option.bind, Option.map, step, Tape.mk₂, Tape.mk', target_tm, mkCfg, Tape.write, Tape.move, ListBlank.head_cons, + ListBlank.tail_cons, A, B, C, D, E, F]⟩ + +/-- Sweep right across `1 >> rep01 m R` in state `A` (`2m` steps). -/ +theorem sweep_AB_right (m : Nat) (L R : ListBlank (Fin 2)) : + (mkCfg A 0 L (1 >> rep01 m R)) [target_tm]⊢* (mkCfg A 0 (rep1 (2 * m) L) (1 >> R)) := by + induction m generalizing L R with + | zero => exact ⟨0, rfl⟩ + | succ m ih => + have h1 := step_AB_right_one L (rep01 m R) + have h2 := ih (1 >> 1 >> L) R + have heq : rep1 (2 * m) (1 >> 1 >> L) = rep1 (2 * (m + 1)) L := by + calc + rep1 (2 * m) (1 >> 1 >> L) = rep1 (2 * m) (rep1 2 L) := rfl + _ = rep1 (2 * m + 2) L := rep1_add (2 * m) 2 L + _ = rep1 (2 * (m + 1)) L := rfl + rw [heq] at h2 + exact zPs (q7 h1 h2) + +theorem step_FE_left_one (L R : ListBlank (Fin 2)) : + (mkCfg F 1 (0 >> 1 >> L) R) [target_tm]⊢⁺ (mkCfg F 1 L (1 >> 1 >> R)) := + ⟨2, by decide, by + simp only [multiStep, Function.iterate_succ', Function.iterate_zero, id_eq, Function.comp_apply, + Option.bind, Option.map, step, Tape.mk₂, Tape.mk', target_tm, mkCfg, Tape.write, Tape.move, ListBlank.head_cons, + ListBlank.tail_cons, A, B, C, D, E, F]⟩ + +/-- Sweep left across `rep01 m L` in state `F` (`2m` steps). -/ +theorem sweep_FE_left (m : Nat) (L R : ListBlank (Fin 2)) : + (mkCfg F 1 (rep01 m L) R) [target_tm]⊢* (mkCfg F 1 L (rep1 (2 * m) R)) := by + induction m generalizing L R with + | zero => exact ⟨0, rfl⟩ + | succ m ih => + have h1 := step_FE_left_one (rep01 m L) R + have h2 := ih L (1 >> 1 >> R) + have heq : rep1 (2 * m) (1 >> 1 >> R) = rep1 (2 * (m + 1)) R := by + calc + rep1 (2 * m) (1 >> 1 >> R) = rep1 (2 * m) (rep1 2 R) := rfl + _ = rep1 (2 * m + 2) R := rep1_add (2 * m) 2 R + _ = rep1 (2 * (m + 1)) R := rfl + rw [heq] at h2 + exact zPs (q7 h1 h2) + +theorem peel_entry (L R : ListBlank (Fin 2)) : + (mkCfg B 1 L (1 >> 1 >> R)) [target_tm]⊢⁺ (mkCfg C 1 L (0 >> 1 >> R)) := + ⟨4, by decide, by + simp only [multiStep, Function.iterate_succ', Function.iterate_zero, id_eq, Function.comp_apply, + Option.bind, Option.map, step, Tape.mk₂, Tape.mk', target_tm, mkCfg, Tape.write, Tape.move, ListBlank.head_cons, + ListBlank.tail_cons, A, B, C, D, E, F]⟩ + +theorem peel_mid (L R : ListBlank (Fin 2)) : + (mkCfg C 1 (1 >> L) R) [target_tm]⊢⁺ (mkCfg A 1 (1 >> L) R) := + ⟨2, by decide, by + simp only [multiStep, Function.iterate_succ', Function.iterate_zero, id_eq, Function.comp_apply, + Option.bind, Option.map, step, Tape.mk₂, Tape.mk', target_tm, mkCfg, Tape.write, Tape.move, ListBlank.head_cons, + ListBlank.tail_cons, A, B, C, D, E, F]⟩ + +theorem peel_end (L R : ListBlank (Fin 2)) : + (mkCfg A 1 (1 >> L) (0 >> 1 >> R)) [target_tm]⊢⁺ (mkCfg B 1 (0 >> 1 >> L) (1 >> R)) := + ⟨3, by decide, by + simp only [multiStep, Function.iterate_succ', Function.iterate_zero, id_eq, Function.comp_apply, + Option.bind, Option.map, step, Tape.mk₂, Tape.mk', target_tm, mkCfg, Tape.write, Tape.move, ListBlank.head_cons, + ListBlank.tail_cons, A, B, C, D, E, F]⟩ + +theorem left_turn (R : ListBlank (Fin 2)) : + (mkCfg C 1 default R) [target_tm]⊢⁺ (mkCfg A 0 default (1 >> R)) := + ⟨3, by decide, by + simp only [multiStep, Function.iterate_succ', Function.iterate_zero, id_eq, Function.comp_apply, + Option.bind, Option.map, step, Tape.mk₂, Tape.mk', target_tm, mkCfg, Tape.write, Tape.move, ListBlank.head_cons, + ListBlank.tail_cons, zDh, zDt, zZcd, A, B, C, D, E, F]⟩ + +theorem right_entry (L : ListBlank (Fin 2)) : + (mkCfg B 1 L (1 >> default)) [target_tm]⊢⁺ (mkCfg F 1 (0 >> 1 >> L) (1 >> default)) := + ⟨4, by decide, by + simp only [multiStep, Function.iterate_succ', Function.iterate_zero, id_eq, Function.comp_apply, + Option.bind, Option.map, step, Tape.mk₂, Tape.mk', target_tm, mkCfg, Tape.write, Tape.move, ListBlank.head_cons, + ListBlank.tail_cons, zDh, zDt, zZcd, A, B, C, D, E, F]⟩ + +/-- Single peel step: `(peelState k (a + 1) (r + 1)) ⊢⁺ (peelState (k + 1) a r)`. -/ +theorem peelState_step (k a r : Nat) : + (peelState k (a + 1) (r + 1)) [target_tm]⊢⁺ (peelState (k + 1) a r) := by + unfold peelState + have h1 := peel_entry (rep01 k (1 >> rep1 a default)) (rep1 r default) + have h2 := sweep_C_left k (1 >> rep1 a default) (0 >> 1 >> rep1 r default) + have h3 := peel_mid (rep1 a default) (rep01 k (0 >> 1 >> rep1 r default)) + have h4 := sweep_A_right k (rep1 a default) (0 >> 1 >> rep1 r default) + have h5 := peel_end (rep01 k (rep1 a default)) (rep1 r default) + exact q7 (q8 (zPs (q7 h1 h2)) (q7 h3 h4)) (zPs h5) + +/-- Iterated peel lemma across `n` steps. -/ +theorem peelState_many (n k a r : Nat) : + (peelState k (n + a) (n + r)) [target_tm]⊢* (peelState (k + n) a r) := by + induction n generalizing k a r with + | zero => + have ha : 0 + a = a := Nat.zero_add a + have hr : 0 + r = r := Nat.zero_add r + rw [ha, hr, Nat.add_zero] + | succ n ih => + have ha : (n + 1) + a = n + a + 1 := by omega + have hr : (n + 1) + r = n + r + 1 := by omega + rw [ha, hr] + have h1 := peelState_step k (n + a) (n + r) + have h2 := ih (k + 1) a r + have hk : k + 1 + n = k + (n + 1) := by omega + rw [hk] at h2 + exact zPs (q7 h1 h2) + +/-- Rule 1 (`a ≤ c - 1`): `(cfgB a (a + d + 1)) ⊢⁺ (cfgB (2a + 2) d)`. -/ +theorem rule_lt (a d : Nat) : + (cfgB a (a + d + 1)) [target_tm]⊢⁺ (cfgB (2 * a + 2) d) := by + cases a with + | zero => + have hd : 0 + d + 1 = d + 1 := by omega + rw [hd] + show (mkCfg B 0 default (1 >> 1 >> rep1 d default)) [target_tm]⊢⁺ + (mkCfg B 1 (1 >> default) (1 >> rep1 d default)) + exact ⟨3, by decide, by + simp only [multiStep, Function.iterate_succ', Function.iterate_zero, id_eq, Function.comp_apply, + Option.bind, Option.map, step, Tape.mk₂, Tape.mk', target_tm, mkCfg, Tape.write, Tape.move, ListBlank.head_cons, + ListBlank.tail_cons, zDh, zDt, zZcd, A, B, C, D, E, F]⟩ + | succ k => + have h0 : cfgB (k + 1) (k + 1 + d + 1) = peelState 0 (k + 0) (k + (d + 2)) := by + rw [peelState_zero]; congr 1; omega + rw [h0] + refine q8 (peelState_many k 0 0 (d + 2)) ?_ + rw [Nat.zero_add] + unfold peelState rep1 + have h1 := peel_entry (rep01 k default) (1 >> rep1 d default) + have h2 := sweep_C_left k default (0 >> 1 >> 1 >> rep1 d default) + rw [rep01_snoc] at h2 + have h3 := left_turn (rep01 (k + 1) (1 >> rep1 d default)) + have h4 := sweep_AB_right (k + 1) default (1 >> rep1 d default) + have h5 : (mkCfg A 0 (rep1 (2 * (k + 1)) default) (1 >> 1 >> rep1 d default)) [target_tm]⊢⁺ + (cfgB (2 * (k + 1) + 2) d) := by + show (mkCfg A 0 (rep1 (2 * (k + 1)) default) (1 >> 1 >> rep1 d default)) [target_tm]⊢⁺ + (mkCfg B 1 (1 >> rep1 (2 * (k + 1)) default) (1 >> rep1 d default)) + exact ⟨1, by decide, by + simp only [multiStep, Function.iterate_succ', Function.iterate_zero, id_eq, Function.comp_apply, + Option.bind, Option.map, step, Tape.mk₂, Tape.mk', target_tm, mkCfg, Tape.write, Tape.move, ListBlank.head_cons, + ListBlank.tail_cons, A, B, C, D, E, F]⟩ + exact q7 (q8 (zPs (q7 h1 h2)) (q7 h3 h4)) (zPs h5) + +/-- Rule 2 (`a = c`): `(cfgB a a) ⊢⁺ (cfgB (2a + 2) 0)`. -/ +theorem rule_eq (a : Nat) : + (cfgB a a) [target_tm]⊢⁺ (cfgB (2 * a + 2) 0) := by + cases a with + | zero => + show (mkCfg B 0 default (1 >> default)) [target_tm]⊢⁺ + (mkCfg B 1 (1 >> default) (1 >> default)) + exact ⟨7, by decide, by + simp only [multiStep, Function.iterate_succ', Function.iterate_zero, id_eq, Function.comp_apply, + Option.bind, Option.map, step, Tape.mk₂, Tape.mk', target_tm, mkCfg, Tape.write, Tape.move, ListBlank.head_cons, + ListBlank.tail_cons, zDh, zDt, zZcd, A, B, C, D, E, F]⟩ + | succ k => + have h0 : cfgB (k + 1) (k + 1) = peelState 0 (k + 0) (k + 1) := rfl + rw [h0] + refine q8 (peelState_many k 0 0 1) ?_ + rw [Nat.zero_add] + unfold peelState rep1 + have h1 := peel_entry (rep01 k default) default + have h2 := sweep_C_left k default (0 >> 1 >> default) + rw [rep01_snoc] at h2 + have h3 := left_turn (rep01 (k + 1) default) + have h4 := sweep_AB_right (k + 1) default default + have h5 : (mkCfg A 0 (rep1 (2 * (k + 1)) default) (1 >> default)) [target_tm]⊢⁺ + (cfgB (2 * (k + 1) + 2) 0) := by + show (mkCfg A 0 (rep1 (2 * (k + 1)) default) (1 >> default)) [target_tm]⊢⁺ + (mkCfg B 1 (1 >> rep1 (2 * (k + 1)) default) (1 >> default)) + exact ⟨5, by decide, by + simp only [multiStep, Function.iterate_succ', Function.iterate_zero, id_eq, Function.comp_apply, + Option.bind, Option.map, step, Tape.mk₂, Tape.mk', target_tm, mkCfg, Tape.write, Tape.move, ListBlank.head_cons, + ListBlank.tail_cons, zDh, zDt, zZcd, A, B, C, D, E, F]⟩ + exact q7 (q8 (zPs (q7 h1 h2)) (q7 h3 h4)) (zPs h5) + +/-- Rule 3 (`a ≥ c + 2`): `(cfgB (c + d + 2) c) ⊢⁺ (cfgB d (2c + 4))`. -/ +theorem rule_ge (d c : Nat) : + (cfgB (c + d + 2) c) [target_tm]⊢⁺ (cfgB d (2 * c + 4)) := by + have h0 : cfgB (c + d + 2) c = peelState 0 (c + (d + 1)) (c + 0) := rfl + rw [h0] + refine q8 (peelState_many c 0 (d + 1) 0) ?_ + rw [Nat.zero_add] + unfold peelState + have h1 := right_entry (rep01 c (rep1 (d + 1) default)) + have h2 := sweep_FE_left (c + 1) (rep1 (d + 1) default) (1 >> default) + have heq : rep1 (2 * (c + 1)) (1 >> default) = rep1 (2 * c + 3) default := by + calc + rep1 (2 * (c + 1)) (1 >> default) + = rep1 (2 * (c + 1)) (rep1 1 default) := rfl + _ = rep1 (2 * (c + 1) + 1) default := rep1_add (2 * (c + 1)) 1 default + _ = rep1 (2 * c + 3) default := rfl + rw [heq] at h2 + have h3 : (mkCfg F 1 (rep1 (d + 1) default) (rep1 (2 * c + 3) default)) [target_tm]⊢⁺ + (cfgB d (2 * c + 4)) := by + cases d with + | zero => + show (mkCfg F 1 (1 >> default) (rep1 (2 * c + 3) default)) [target_tm]⊢⁺ + (mkCfg B 0 default (1 >> 1 >> rep1 (2 * c + 3) default)) + exact ⟨2, by decide, by + simp only [multiStep, Function.iterate_succ', Function.iterate_zero, id_eq, Function.comp_apply, + Option.bind, Option.map, step, Tape.mk₂, Tape.mk', target_tm, mkCfg, Tape.write, Tape.move, ListBlank.head_cons, + ListBlank.tail_cons, zDh, zDt, zZcd, A, B, C, D, E, F]⟩ + | succ d' => + show (mkCfg F 1 (1 >> 1 >> rep1 d' default) (rep1 (2 * c + 3) default)) [target_tm]⊢⁺ + (mkCfg B 1 (rep1 d' default) (1 >> 1 >> rep1 (2 * c + 3) default)) + exact ⟨2, by decide, by + simp only [multiStep, Function.iterate_succ', Function.iterate_zero, id_eq, Function.comp_apply, + Option.bind, Option.map, step, Tape.mk₂, Tape.mk', target_tm, mkCfg, Tape.write, Tape.move, ListBlank.head_cons, + ListBlank.tail_cons, A, B, C, D, E, F]⟩ + exact q7 (q7 h1 h2) (zPs h3) + +@[simp] theorem zEmpty : (ListBlank.mk ([] : List (Fin 2)) : ListBlank (Fin 2)) = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl + +/-- Blank-tape entry (`3` micro-steps): `(init []) ⊢⁺ (cfgB 0 0)`. -/ +theorem init_to_cfgB : (init []) [target_tm]⊢⁺ (cfgB 0 0) := + ⟨3, by decide, by + simp only [init, Tape.mk₁, Tape.mk₂, Tape.mk', zEmpty, multiStep, Function.iterate_succ', + Function.iterate_zero, id_eq, Function.comp_apply, Option.bind, Option.map, step, target_tm, + cfgB, rep1, mkCfg, Tape.write, Tape.move, ListBlank.head_cons, ListBlank.tail_cons, + zDh, zDt, zZcd, A, B, C, D, E, F, Fin.default_eq_zero]⟩ + +/-- Computable macro-stepper for `cfgB a c`. -/ +def stepB : Nat × Nat → Option (Nat × Nat) + | (a, c) => + if a < c then some (2 * a + 2, c - a - 1) + else if a == c then some (2 * a + 2, 0) + else if a == c + 1 then none + else some (a - c - 2, 2 * c + 4) + +theorem stepB_sound (p p' : Nat × Nat) (h : stepB p = some p') : + (cfgB p.1 p.2) [target_tm]⊢⁺ (cfgB p'.1 p'.2) := by + rcases p with ⟨a, c⟩ + dsimp only + dsimp only [stepB] at h + by_cases h1 : a < c + · rw [if_pos h1] at h; simp at h; rcases h with ⟨rfl, rfl⟩ + dsimp only + have hc : c = a + (c - a - 1) + 1 := by omega + nth_rw 1 [hc] + exact rule_lt a (c - a - 1) + · rw [if_neg h1] at h + by_cases h2 : a = c + · subst h2; simp at h; rcases h with ⟨rfl, rfl⟩ + exact rule_eq a + · have h2b : (a == c) = false := beq_false_of_ne h2 + rw [h2b] at h; simp only [Bool.false_eq_true, ↓reduceIte] at h + have h3 : a ≠ c + 1 := by + intro heq; subst heq; simp at h + have h3b : (a == c + 1) = false := beq_false_of_ne h3 + rw [h3b] at h; simp at h; rcases h with ⟨rfl, rfl⟩ + dsimp only + have ha : a = c + (a - c - 2) + 2 := by omega + nth_rw 1 [ha] + exact rule_ge (a - c - 2) c + +/-- Tail-recursive multi-step evaluator for `stepB`. -/ +def runStepB : Nat → Nat × Nat → Option (Nat × Nat) + | 0, p => some p + | n + 1, p => + match stepB p with + | none => none + | some p' => runStepB n p' + +theorem runStepB_sound (n : Nat) (p p' : Nat × Nat) (h : runStepB n p = some p') : + (cfgB p.1 p.2) [target_tm]⊢* (cfgB p'.1 p'.2) := by + induction n generalizing p with + | zero => + simp [runStepB] at h; subst h; exact ⟨0, rfl⟩ + | succ n ih => + simp only [runStepB] at h + cases hst : stepB p with + | none => rw [hst] at h; simp at h + | some pm => + rw [hst] at h + exact zPs (q7 (stepB_sound p pm hst) (ih pm h)) + +/-- Kernel-checked 303-macro-step trajectory from `(0, 0)` to `(150, 300)` (`5,056,008` steps). -/ +theorem bootstrap_303 : runStepB 303 (0, 0) = some (150, 300) := by + decide + +theorem reach_150_300 : (init []) [target_tm]⊢⁺ (cfgB 150 300) := + q7 init_to_cfgB (runStepB_sound 303 (0, 0) (150, 300) bootstrap_303) + +/-- Closed infinite loop invariant: `{ cfgB (n + 1) (2 * (n + 1)) | n : ℕ }`. -/ +def Inv (cfg : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ n : Nat, cfg = cfgB (n + 1) (2 * (n + 1)) + +theorem loop_step (n : Nat) : + (cfgB (n + 1) (2 * (n + 1))) [target_tm]⊢⁺ (cfgB (n + 2) (2 * (n + 2))) := by + have h1 : (cfgB (n + 1) (2 * (n + 1))) [target_tm]⊢⁺ (cfgB (2 * n + 4) n) := by + have heq1 : 2 * (n + 1) = (n + 1) + n + 1 := by omega + rw [heq1] + have hlt := rule_lt (n + 1) n + have heq2 : 2 * (n + 1) + 2 = 2 * n + 4 := by omega + rwa [heq2] at hlt + have h2 : (cfgB (2 * n + 4) n) [target_tm]⊢⁺ (cfgB (n + 2) (2 * (n + 2))) := by + have heq3 : 2 * n + 4 = n + (n + 2) + 2 := by omega + rw [heq3] + have hge := rule_ge (n + 2) n + have heq4 : 2 * n + 4 = 2 * (n + 2) := by omega + rwa [heq4] at hge + exact q7 h1 (zPs h2) + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + refine isNotHalt_of_invariant target_tm Inv ?_ ?_ + · exact ⟨cfgB 150 300, reach_150_300, ⟨149, rfl⟩⟩ + · intro c hc + rcases hc with ⟨n, rfl⟩ + exact ⟨cfgB (n + 2) (2 * (n + 2)), loop_step n, ⟨n + 1, rfl⟩⟩ + +public section + +theorem is_not_halt : IsNotHalt target := by + rw [target_eq_target_tm] + exact is_does_not_halt + +end + +end BusyBeaver.M_1RB0RD_0LC1RA_0RA1LB_1RE1LB_1LF1LB_HHH1LE diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RD_0RC0LB_0RD1RD_1LE1RA_1RC1LF_HHH1LA.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RD_0RC0LB_0RD1RD_1LE1RA_1RC1LF_HHH1LA.lean new file mode 100644 index 00000000..309c7f11 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RD_0RC0LB_0RD1RD_1LE1RA_1RC1LF_HHH1LA.lean @@ -0,0 +1,1287 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.Longitudinal + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RD_0RC0LB_0RD1RD_1LE1RA_1RC1LF_HHH1LA + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RD_0RC0LB_0RD1RD_1LE1RA_1RC1LF_HHH1LA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +local notation "zB" => ListBlank (Fin 2) +local notation "zF" => List (Fin 2) + +set_option linter.unusedSectionVars false +set_option maxHeartbeats 0 +set_option maxRecDepth 200000 + +@[simp] theorem zMz (M : Machine (Fin 2) (Fin 6)) (config : Cfg (Fin 2) (Fin 6)) : + multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine (Fin 2) (Fin 6)) (config : Cfg (Fin 2) (Fin 6)) : + multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine (Fin 2) (Fin 6)) (config : Cfg (Fin 2) (Fin 6)) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] +@[simp] theorem z00 : Turing.ListBlank.cons (0 : Fin 2) default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : zB).head = 0 := rfl +@[simp] theorem zDt : (default : zB).tail = default := rfl +@[simp] theorem append_nil (s : zB) : ([] : zF) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : zF) (s : zB) : + (a :: l) +> s = Turing.ListBlank.cons a (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : zF) (s : zB) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append, append_cons, ih] + +theorem zSm (tm : Machine (Fin 2) (Fin 6)) (c_1 c_2 : Cfg (Fin 2) (Fin 6)) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 (tm : Machine (Fin 2) (Fin 6)) (c_1 c_2 : Cfg (Fin 2) (Fin 6)) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1, by decide, zSm tm c_1 c_2 h⟩ +theorem zMa (tm : Machine (Fin 2) (Fin 6)) (c_1 : Cfg (Fin 2) (Fin 6)) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, zMs, ih, Option.bind_assoc] + simp_rw [zMs] +theorem zMt (tm : Machine (Fin 2) (Fin 6)) (c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa, h₁]; simp [h₂] +theorem zPs {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 : Cfg (Fin 2) (Fin 6)} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ +theorem zPt {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, by omega, zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem zSp {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢* c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, by omega, zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem zSt {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢* c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢* c_3 := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ + +macro "finish" : tactic => + `(tactic| (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, z00, zDh, zDt]) <;> exact ⟨0, rfl⟩) +macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, z00, zDh, zDt]) +macro "execute" : tactic => + `(tactic| focus (repeat (first | finish | step))) + +@[simp] theorem z05 {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z06 {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l + +theorem zLp_add {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := + BusyBeaver.Longitudinal.pow_add_list l m n + +theorem zLp_shift {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ^ n ++ l := by + rw [Nat.add_comm 1 n, BusyBeaver.Longitudinal.pow_succ_list'] + +theorem z07 (l : zF) (n : Nat) (s : zB) : (l ^ (1 + n)) +> s = l +> ((l ^ n) +> s) := by + rw [zLp', append_assoc] + +theorem z09 (l : zF) (n : Nat) (s : zB) : (l ^ n) +> (l +> s) = (l ^ (1 + n)) +> s := by + rw [zLp_shift, append_assoc] + +-- State aliases mapping TM1 (A..F) to #687 (TM2) +abbrev qA : Fin 6 := 4 +abbrev qB : Fin 6 := 2 +abbrev qC : Fin 6 := 3 +abbrev qD : Fin 6 := 5 +abbrev qE : Fin 6 := 0 +abbrev qF : Fin 6 := 1 + +abbrev Z : zF := [0, 0] +abbrev U : zF := [0, 1] +abbrev V : zF := [1, 0] +abbrev O : zF := [1, 1] + +inductive DState where + | AL | BR | CR | DL | EL | ER | FL | FR + deriving DecidableEq, Repr + +def dstateToCfg (q : DState) (l r : zB) : Cfg (Fin 2) (Fin 6) := + match q with + | .AL => l <{{qA}} r + | .BR => l {{qB}}> r + | .CR => l {{qC}}> r + | .DL => l <{{qD}} r + | .EL => l <{{qE}} r + | .ER => l {{qE}}> r + | .FL => l <{{qF}} r + | .FR => l {{qF}}> r + +def bitToSym (b : Bool) : Fin 2 := if b then 1 else 0 + +@[simp] theorem bitToSym_false : bitToSym false = 0 := rfl +@[simp] theorem bitToSym_true : bitToSym true = 1 := rfl + +def evalBoolList : List Bool → zB → zB + | [], tail => tail + | b :: bs, tail => Turing.ListBlank.cons (bitToSym b) (evalBoolList bs tail) + +@[simp] theorem evalBoolList_nil (tail : zB) : evalBoolList [] tail = tail := rfl +@[simp] theorem evalBoolList_cons (b : Bool) (bs : List Bool) (tail : zB) : + evalBoolList (b :: bs) tail = Turing.ListBlank.cons (bitToSym b) (evalBoolList bs tail) := rfl + +def pushBool (w : Bool) (xs : List Bool) : List Bool := + match w, xs with + | false, [] => [] + | _, _ => w :: xs + +@[simp] theorem eval_pushBool (w : Bool) (xs : List Bool) : + evalBoolList (pushBool w xs) default = Turing.ListBlank.cons (bitToSym w) (evalBoolList xs default) := by + cases w <;> cases xs <;> simp [pushBool] + +-- 1. Direct-matching Raw step evaluator on List Bool (no intermediate tuple projections!) +def rawSteps (r_def : Bool) : Nat → DState → List Bool → List Bool → DState × List Bool × List Bool + | 0, q, l, r => (q, l, r) + | n + 1, q, l, r => + match q with + | .AL => + match l with + | [] => rawSteps r_def n .BR [true] r + | false :: l' => rawSteps r_def n .BR (true :: l') r + | true :: l' => rawSteps r_def n .DL l' (true :: r) + | .BR => + match r with + | [] => if r_def then rawSteps r_def n .CR (pushBool false l) [] else (q, l, r) + | false :: r' => rawSteps r_def n .CR (pushBool false l) r' + | true :: r' => rawSteps r_def n .CR (true :: l) r' + | .CR => + match r with + | [] => if r_def then rawSteps r_def n .AL l [true] else (q, l, r) + | false :: r' => rawSteps r_def n .AL l (true :: r') + | true :: r' => rawSteps r_def n .ER (true :: l) r' + | .DL => + match l with + | true :: l' => rawSteps r_def n .EL l' (true :: r) + | _ => (q, l, r) + | .EL => + match l with + | [] => rawSteps r_def n .FR [true] r + | false :: l' => rawSteps r_def n .FR (true :: l') r + | true :: l' => rawSteps r_def n .CR (pushBool false l') r + | .ER => + match r with + | [] => if r_def then rawSteps r_def n .FR (true :: l) [] else (q, l, r) + | false :: r' => rawSteps r_def n .FR (true :: l) r' + | true :: r' => rawSteps r_def n .CR (pushBool false l) r' + | .FL => + match l with + | [] => rawSteps r_def n .BR [] r + | false :: l' => rawSteps r_def n .BR (false :: l') r + | true :: l' => rawSteps r_def n .FL l' (if r_def then pushBool false r else false :: r) + | .FR => + match r with + | [] => if r_def then rawSteps r_def n .BR (pushBool false l) [] else (q, l, r) + | false :: r' => rawSteps r_def n .BR (pushBool false l) r' + | true :: r' => rawSteps r_def n .FL l (if r_def then pushBool false r' else false :: r') + +theorem rawSteps_false_sound (n : Nat) (q : DState) (l r : List Bool) (r_tail : zB) : + (dstateToCfg q (evalBoolList l default) (evalBoolList r r_tail)) [target_tm]⊢* + (dstateToCfg (rawSteps false n q l r).1 (evalBoolList (rawSteps false n q l r).2.1 default) + (evalBoolList (rawSteps false n q l r).2.2 r_tail)) := by + induction n generalizing q l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + cases q with + | AL => + cases l with + | nil => exact zSt (by dsimp [dstateToCfg]; execute) (ih .BR [true] r) + | cons b l' => + cases b + · exact zSt (by dsimp [dstateToCfg]; execute) (ih .BR (true :: l') r) + · exact zSt (by dsimp [dstateToCfg]; execute) (ih .DL l' (true :: r)) + | BR => + cases r with + | nil => exact ⟨0, rfl⟩ + | cons b r' => + cases b + · exact zSt (by dsimp [dstateToCfg]; rw [eval_pushBool]; execute) (ih .CR (pushBool false l) r') + · exact zSt (by dsimp [dstateToCfg]; execute) (ih .CR (true :: l) r') + | CR => + cases r with + | nil => exact ⟨0, rfl⟩ + | cons b r' => + cases b + · exact zSt (by dsimp [dstateToCfg]; execute) (ih .AL l (true :: r')) + · exact zSt (by dsimp [dstateToCfg]; execute) (ih .ER (true :: l) r') + | DL => + cases l with + | nil => exact ⟨0, rfl⟩ + | cons b l' => + cases b + · exact ⟨0, rfl⟩ + · exact zSt (by dsimp [dstateToCfg]; execute) (ih .EL l' (true :: r)) + | EL => + cases l with + | nil => exact zSt (by dsimp [dstateToCfg]; execute) (ih .FR [true] r) + | cons b l' => + cases b + · exact zSt (by dsimp [dstateToCfg]; execute) (ih .FR (true :: l') r) + · exact zSt (by dsimp [dstateToCfg]; rw [eval_pushBool]; execute) (ih .CR (pushBool false l') r) + | ER => + cases r with + | nil => exact ⟨0, rfl⟩ + | cons b r' => + cases b + · exact zSt (by dsimp [dstateToCfg]; execute) (ih .FR (true :: l) r') + · exact zSt (by dsimp [dstateToCfg]; rw [eval_pushBool]; execute) (ih .CR (pushBool false l) r') + | FL => + cases l with + | nil => exact zSt (by dsimp [dstateToCfg]; execute) (ih .BR [] r) + | cons b l' => + cases b + · exact zSt (by dsimp [dstateToCfg]; execute) (ih .BR (false :: l') r) + · exact zSt (by dsimp [dstateToCfg]; execute) (ih .FL l' (false :: r)) + | FR => + cases r with + | nil => exact ⟨0, rfl⟩ + | cons b r' => + cases b + · exact zSt (by dsimp [dstateToCfg]; rw [eval_pushBool]; execute) (ih .BR (pushBool false l) r') + · exact zSt (by dsimp [dstateToCfg]; execute) (ih .FL l (false :: r')) + +theorem rawSteps_true_sound (n : Nat) (q : DState) (l r : List Bool) : + (dstateToCfg q (evalBoolList l default) (evalBoolList r default)) [target_tm]⊢* + (dstateToCfg (rawSteps true n q l r).1 (evalBoolList (rawSteps true n q l r).2.1 default) + (evalBoolList (rawSteps true n q l r).2.2 default)) := by + induction n generalizing q l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + cases q with + | AL => + cases l with + | nil => exact zSt (by dsimp [dstateToCfg]; execute) (ih .BR [true] r) + | cons b l' => + cases b + · exact zSt (by dsimp [dstateToCfg]; execute) (ih .BR (true :: l') r) + · exact zSt (by dsimp [dstateToCfg]; execute) (ih .DL l' (true :: r)) + | BR => + cases r with + | nil => exact zSt (by dsimp [dstateToCfg]; rw [eval_pushBool]; execute) (ih .CR (pushBool false l) []) + | cons b r' => + cases b + · exact zSt (by dsimp [dstateToCfg]; rw [eval_pushBool]; execute) (ih .CR (pushBool false l) r') + · exact zSt (by dsimp [dstateToCfg]; execute) (ih .CR (true :: l) r') + | CR => + cases r with + | nil => exact zSt (by dsimp [dstateToCfg]; execute) (ih .AL l [true]) + | cons b r' => + cases b + · exact zSt (by dsimp [dstateToCfg]; execute) (ih .AL l (true :: r')) + · exact zSt (by dsimp [dstateToCfg]; execute) (ih .ER (true :: l) r') + | DL => + cases l with + | nil => exact ⟨0, rfl⟩ + | cons b l' => + cases b + · exact ⟨0, rfl⟩ + · exact zSt (by dsimp [dstateToCfg]; execute) (ih .EL l' (true :: r)) + | EL => + cases l with + | nil => exact zSt (by dsimp [dstateToCfg]; execute) (ih .FR [true] r) + | cons b l' => + cases b + · exact zSt (by dsimp [dstateToCfg]; execute) (ih .FR (true :: l') r) + · exact zSt (by dsimp [dstateToCfg]; rw [eval_pushBool]; execute) (ih .CR (pushBool false l') r) + | ER => + cases r with + | nil => exact zSt (by dsimp [dstateToCfg]; execute) (ih .FR (true :: l) []) + | cons b r' => + cases b + · exact zSt (by dsimp [dstateToCfg]; execute) (ih .FR (true :: l) r') + · exact zSt (by dsimp [dstateToCfg]; rw [eval_pushBool]; execute) (ih .CR (pushBool false l) r') + | FL => + cases l with + | nil => exact zSt (by dsimp [dstateToCfg]; execute) (ih .BR [] r) + | cons b l' => + cases b + · exact zSt (by dsimp [dstateToCfg]; execute) (ih .BR (false :: l') r) + · exact zSt (by dsimp [dstateToCfg]; rw [eval_pushBool]; execute) (ih .FL l' (pushBool false r)) + | FR => + cases r with + | nil => exact zSt (by dsimp [dstateToCfg]; rw [eval_pushBool]; execute) (ih .BR (pushBool false l) []) + | cons b r' => + cases b + · exact zSt (by dsimp [dstateToCfg]; rw [eval_pushBool]; execute) (ih .BR (pushBool false l) r') + · exact zSt (by dsimp [dstateToCfg]; rw [eval_pushBool]; execute) (ih .FL l (pushBool false r')) + +-- 2. Symbolic & Concrete Macro Evaluator (parameterized over abstract `l_tail : zB`) +inductive SymElem where + | bit (b : Bool) + | blk (b1 b2 : Bool) (v : Nat) + deriving DecidableEq, Repr + +def pairWord (b1 b2 : Bool) : zF := [bitToSym b1, bitToSym b2] + +def evalSideWith (vars : Nat → Nat) (tail : zB) : List SymElem → zB + | [] => tail + | .bit b :: xs => Turing.ListBlank.cons (bitToSym b) (evalSideWith vars tail xs) + | .blk b1 b2 v :: xs => (pairWord b1 b2 ^ (vars v)) +> evalSideWith vars tail xs + +@[simp] theorem evalSideWith_nil (vars : Nat → Nat) (tail : zB) : + evalSideWith vars tail [] = tail := rfl +@[simp] theorem evalSideWith_bit (vars : Nat → Nat) (tail : zB) (b : Bool) (xs : List SymElem) : + evalSideWith vars tail (.bit b :: xs) = Turing.ListBlank.cons (bitToSym b) (evalSideWith vars tail xs) := rfl +@[simp] theorem evalSideWith_blk (vars : Nat → Nat) (tail : zB) (b1 b2 : Bool) (v : Nat) (xs : List SymElem) : + evalSideWith vars tail (.blk b1 b2 v :: xs) = (pairWord b1 b2 ^ (vars v)) +> evalSideWith vars tail xs := rfl + +def push (w : Bool) (xs : List SymElem) : List SymElem := + match w, xs with + | false, [] => [] + | _, _ => .bit w :: xs + +@[simp] theorem eval_push_false (vars : Nat → Nat) (xs : List SymElem) : + evalSideWith vars default (push false xs) = Turing.ListBlank.cons 0 (evalSideWith vars default xs) := by + cases xs <;> simp [push] + +def push_sym (b1 b2 : Bool) (v : Nat) : List SymElem → List SymElem + | .bit b :: xs => + if b == b1 then .bit b1 :: push_sym b2 b1 v xs + else .blk b1 b2 v :: .bit b :: xs + | xs => .blk b1 b2 v :: xs + +theorem rot_pair (b1 b2 : Bool) (k : Nat) (r : zB) : + ([bitToSym b1] : zF) +> ((pairWord b2 b1 ^ k) +> r) = + (pairWord b1 b2 ^ k) +> ([bitToSym b1] +> r) := by + induction k with + | zero => rfl + | succ k ih => + have hk : k + 1 = 1 + k := by omega + rw [hk, z07 (pairWord b2 b1) k r, z07 (pairWord b1 b2) k ([bitToSym b1] +> r)] + simp only [pairWord, append_cons, append_nil] at ih ⊢ + rw [ih] + +theorem eval_push_sym (vars : Nat → Nat) (tail : zB) (b1 b2 : Bool) (v : Nat) (xs : List SymElem) : + evalSideWith vars tail (push_sym b1 b2 v xs) = + (pairWord b1 b2 ^ (vars v)) +> evalSideWith vars tail xs := by + induction xs generalizing b1 b2 with + | nil => rfl + | cons x xs ih => + cases x with + | bit b => + dsimp [push_sym] + split_ifs with h + · have hb : b = b1 := by simpa using h + subst hb + simp only [evalSideWith_bit, ih b2 b] + exact rot_pair b b2 (vars v) (evalSideWith vars tail xs) + · rfl + | blk c1 c2 w => rfl + +-- Shift rules SR1..SR4 +theorem shiftR_E_O_step (l r : zB) : + (l {{qE}}> (O +> r)) [target_tm]⊢* ((V +> l) {{qE}}> r) := by + simp only [O, V, append_cons, append_nil] + execute + +theorem shiftR_E_O (k : Nat) (l r : zB) : + (l {{qE}}> ((O ^ k) +> r)) [target_tm]⊢* (((V ^ k) +> l) {{qE}}> r) := by + induction k generalizing l with + | zero => simp only [z05, append_nil]; finish + | succ k ih => + have hk : k + 1 = 1 + k := by omega + rw [hk, z07 O k r] + refine zSt (shiftR_E_O_step l ((O ^ k) +> r)) ?_ + simpa only [z09 V k l] using ih (V +> l) + +theorem shiftR_C_O_step (l r : zB) : + (l {{qC}}> (O +> r)) [target_tm]⊢* ((U +> l) {{qC}}> r) := by + simp only [O, U, append_cons, append_nil] + execute + +theorem shiftR_C_O (k : Nat) (l r : zB) : + (l {{qC}}> ((O ^ k) +> r)) [target_tm]⊢* (((U ^ k) +> l) {{qC}}> r) := by + induction k generalizing l with + | zero => simp only [z05, append_nil]; finish + | succ k ih => + have hk : k + 1 = 1 + k := by omega + rw [hk, z07 O k r] + refine zSt (shiftR_C_O_step l ((O ^ k) +> r)) ?_ + simpa only [z09 U k l] using ih (U +> l) + +theorem shiftL_F_V_step (l r : zB) : + ((V +> l) <{{qF}} (Z +> r)) [target_tm]⊢* (l <{{qF}} (Z +> (O +> r))) := by + simp only [V, Z, O, append_cons, append_nil] + execute + +theorem shiftL_F_V (k : Nat) (l r : zB) : + (((V ^ k) +> l) <{{qF}} (Z +> r)) [target_tm]⊢* (l <{{qF}} (Z +> ((O ^ k) +> r))) := by + induction k generalizing r with + | zero => simp only [z05, append_nil]; finish + | succ k ih => + have hk : k + 1 = 1 + k := by omega + rw [hk, z07 V k l] + refine zSt (shiftL_F_V_step ((V ^ k) +> l) r) ?_ + simpa only [z09 O k r] using ih (O +> r) + +theorem shiftL_F_U_step (l r : zB) : + ((U +> l) <{{qF}} ([0, 0, 0] +> r)) [target_tm]⊢* (l <{{qF}} ([0, 0, 0] +> (O +> r))) := by + simp only [U, O, append_cons, append_nil] + execute + +theorem shiftL_F_U (k : Nat) (l r : zB) : + (((U ^ k) +> l) <{{qF}} ([0, 0, 0] +> r)) [target_tm]⊢* (l <{{qF}} ([0, 0, 0] +> ((O ^ k) +> r))) := by + induction k generalizing r with + | zero => simp only [z05, append_nil]; finish + | succ k ih => + have hk : k + 1 = 1 + k := by omega + rw [hk, z07 U k l] + refine zSt (shiftL_F_U_step ((U ^ k) +> l) r) ?_ + simpa only [z09 O k r] using ih (O +> r) + +-- Fuel-bounded helper loops (k = 200 exceeds max list length < 150) +def f_shift_loop : Nat → List SymElem → List SymElem → List SymElem × List SymElem + | k + 1, .bit true :: .bit false :: l, r => f_shift_loop k l (.bit true :: .bit true :: r) + | _, l, r => (l, r) + +theorem f_shift_loop_sound (k : Nat) (vars : Nat → Nat) (l_tail : zB) (l r : List SymElem) : + ((evalSideWith vars l_tail l) <{{qF}} (Z +> evalSideWith vars default r)) [target_tm]⊢* + ((evalSideWith vars l_tail (f_shift_loop k l r).1) <{{qF}} + (Z +> evalSideWith vars default (f_shift_loop k l r).2)) := by + induction k generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ k ih => + rcases l with _ | ⟨⟨_ | _⟩ | ⟨_, _, _⟩, _ | ⟨⟨_ | _⟩ | ⟨_, _, _⟩, l2⟩⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · dsimp [f_shift_loop] + exact zSt (shiftL_F_V_step (evalSideWith vars l_tail l2) (evalSideWith vars default r)) + (ih l2 (.bit true :: .bit true :: r)) + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + +def e_shift_m : Nat → Nat → List SymElem → Nat × List SymElem + | k + 1, m, .bit true :: .bit true :: r => e_shift_m k (m + 1) r + | _, m, r => (m, r) + +theorem e_shift_m_sound (k : Nat) (l_tail : zB) (vars : Nat → Nat) (n_off m : Nat) (r : List SymElem) : + (((V ^ (n_off + m)) +> l_tail) {{qE}}> (evalSideWith vars default r)) [target_tm]⊢* + (((V ^ (n_off + (e_shift_m k m r).1)) +> l_tail) {{qE}}> + (evalSideWith vars default (e_shift_m k m r).2)) := by + induction k generalizing m r with + | zero => exact ⟨0, rfl⟩ + | succ k ih => + rcases r with _ | ⟨⟨_ | _⟩ | ⟨_, _, _⟩, _ | ⟨⟨_ | _⟩ | ⟨_, _, _⟩, r2⟩⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · dsimp [e_shift_m] + have h1 := shiftR_E_O_step ((V ^ (n_off + m)) +> l_tail) (evalSideWith vars default r2) + have h_eq : V +> ((V ^ (n_off + m)) +> l_tail) = (V ^ (n_off + (m + 1))) +> l_tail := by + rw [← z07 V (n_off + m) l_tail, show 1 + (n_off + m) = n_off + (m + 1) by omega] + rw [h_eq] at h1 + exact zSt h1 (ih (m + 1) r2) + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + +def c_ones_loop : Nat → List SymElem → List SymElem → List SymElem × List SymElem + | k + 1, l, .bit true :: .bit true :: r => c_ones_loop k (.bit false :: .bit true :: l) r + | _, l, r => (l, r) + +theorem c_ones_loop_sound (k : Nat) (vars : Nat → Nat) (l_tail : zB) (l r : List SymElem) : + ((evalSideWith vars l_tail l) {{qC}}> (evalSideWith vars default r)) [target_tm]⊢* + ((evalSideWith vars l_tail (c_ones_loop k l r).1) {{qC}}> + (evalSideWith vars default (c_ones_loop k l r).2)) := by + induction k generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ k ih => + rcases r with _ | ⟨⟨_ | _⟩ | ⟨_, _, _⟩, _ | ⟨⟨_ | _⟩ | ⟨_, _, _⟩, r2⟩⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · dsimp [c_ones_loop] + exact zSt (shiftR_C_O_step (evalSideWith vars l_tail l) (evalSideWith vars default r2)) + (ih (.bit false :: .bit true :: l) r2) + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + +def c_zeros_loop : Nat → List SymElem → List SymElem → List SymElem × List SymElem + | k + 1, .bit false :: l, .bit false :: r => c_zeros_loop k (.bit true :: .bit true :: l) r + | _, l, r => (l, r) + +theorem c_zeros_step (l r : zB) : + ((Turing.ListBlank.cons 0 l) {{qC}}> (Turing.ListBlank.cons 0 r)) [target_tm]⊢* + ((Turing.ListBlank.cons 1 (Turing.ListBlank.cons 1 l)) {{qC}}> r) := by + execute + +theorem c_zeros_loop_sound (k : Nat) (vars : Nat → Nat) (l_tail : zB) (l r : List SymElem) : + ((evalSideWith vars l_tail l) {{qC}}> (evalSideWith vars default r)) [target_tm]⊢* + ((evalSideWith vars l_tail (c_zeros_loop k l r).1) {{qC}}> + (evalSideWith vars default (c_zeros_loop k l r).2)) := by + induction k generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ k ih => + rcases l with _ | ⟨⟨_ | _⟩ | ⟨_, _, _⟩, l2⟩ + · exact ⟨0, rfl⟩ + · rcases r with _ | ⟨⟨_ | _⟩ | ⟨_, _, _⟩, r2⟩ + · exact ⟨0, rfl⟩ + · dsimp [c_zeros_loop] + exact zSt (c_zeros_step (evalSideWith vars l_tail l2) (evalSideWith vars default r2)) + (ih (.bit true :: .bit true :: l2) r2) + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + +def toSymCfg (l_tail : zB) (vars : Nat → Nat) (n_off : Nat) (q : DState) (m : Nat) (l r : List SymElem) : Cfg (Fin 2) (Fin 6) := + dstateToCfg q (evalSideWith vars ((V ^ (n_off + m)) +> l_tail) l) (evalSideWith vars default r) + +def symMacroSteps : Nat → DState → Nat → List SymElem → List SymElem → DState × Nat × List SymElem × List SymElem + | 0, q, m, l, r => (q, m, l, r) + | n + 1, q, m, l, r => + match q with + | .FL => + match r with + | .bit false :: .bit false :: r_tail => + match l with + | [] => + let (m', r') := e_shift_m 200 (m + 2) r_tail + symMacroSteps n .ER m' [] r' + | .bit true :: .bit false :: l2 => + let (l', r') := f_shift_loop 200 l2 (.bit true :: .bit true :: r_tail) + symMacroSteps n .FL m l' (.bit false :: .bit false :: r') + | .blk true false v :: l_rest => + symMacroSteps n .FL m l_rest (.bit false :: .bit false :: push_sym true true v r_tail) + | .blk false true v :: l_rest => + match r_tail with + | .bit false :: r_tail2 => + symMacroSteps n .FL m l_rest (.bit false :: .bit false :: .bit false :: push_sym true true v r_tail2) + | _ => (q, m, l, r) + | .bit false :: l_rest => + symMacroSteps n .BR m (.bit false :: l_rest) (.bit false :: .bit false :: r_tail) + | .bit true :: l_rest => + symMacroSteps n .FL m l_rest (.bit false :: .bit false :: .bit false :: r_tail) + | _ => (q, m, l, r) + | _ => + match l with + | .bit true :: l_rest => symMacroSteps n .FL m l_rest (push false r) + | _ => (q, m, l, r) + | .ER => + match r with + | [] => symMacroSteps n .FR m (.bit true :: l) [] + | .bit false :: r_rest => symMacroSteps n .FR m (.bit true :: l) r_rest + | .blk true true v :: r_rest => + symMacroSteps n .ER m (push_sym true false v l) r_rest + | .bit true :: r_rest => symMacroSteps n .CR m (.bit false :: l) r_rest + | _ => (q, m, l, r) + | .CR => + match r with + | [] => symMacroSteps n .AL m l [.bit true] + | .bit false :: r_rest => + match l with + | .bit false :: l_rest => + let (l', r') := c_zeros_loop 200 (.bit true :: .bit true :: l_rest) r_rest + symMacroSteps n .CR m l' r' + | _ => symMacroSteps n .AL m l (.bit true :: r_rest) + | .bit true :: .bit true :: r_rest => + let (l', r') := c_ones_loop 200 (.bit false :: .bit true :: l) r_rest + symMacroSteps n .CR m l' r' + | .blk true true v :: r_rest => + symMacroSteps n .CR m (push_sym false true v l) r_rest + | .bit true :: r_rest => symMacroSteps n .ER m (.bit true :: l) r_rest + | _ => (q, m, l, r) + | .BR => + match r with + | [] => symMacroSteps n .CR m (.bit false :: l) [] + | .bit false :: r_rest => symMacroSteps n .CR m (.bit false :: l) r_rest + | .bit true :: r_rest => symMacroSteps n .CR m (.bit true :: l) r_rest + | _ => (q, m, l, r) + | .AL => + match l with + | .bit false :: l_rest => symMacroSteps n .BR m (.bit true :: l_rest) r + | .bit true :: l_rest => symMacroSteps n .DL m l_rest (.bit true :: r) + | _ => (q, m, l, r) + | .FR => + match r with + | [] => symMacroSteps n .BR m (.bit false :: l) [] + | .bit false :: r_rest => symMacroSteps n .BR m (.bit false :: l) r_rest + | .bit true :: r_rest => symMacroSteps n .FL m l (push false r_rest) + | _ => (q, m, l, r) + | .EL => + match l, m with + | [], m' + 1 => symMacroSteps n .CR m' [.bit false, .bit false] r + | .bit false :: l_rest, _ => symMacroSteps n .FR m (.bit true :: l_rest) r + | .bit true :: l_rest, _ => symMacroSteps n .CR m (.bit false :: l_rest) r + | _, _ => (q, m, l, r) + | .DL => + match l with + | .bit true :: l_rest => symMacroSteps n .EL m l_rest (.bit true :: r) + | _ => (q, m, l, r) + +theorem bounce_empty_sound (l_tail : zB) + (h_bounce : ∀ r_t : zB, (l_tail <{{qF}} (Turing.ListBlank.cons 0 (Turing.ListBlank.cons 0 r_t))) [target_tm]⊢* + (((V ^ 2) +> l_tail) {{qE}}> r_t)) + (vars : Nat → Nat) (n_off m : Nat) (r_tail : List SymElem) : + (toSymCfg l_tail vars n_off .FL m [] (.bit false :: .bit false :: r_tail)) [target_tm]⊢* + (toSymCfg l_tail vars n_off .ER (e_shift_m 200 (m + 2) r_tail).1 [] (e_shift_m 200 (m + 2) r_tail).2) := by + dsimp [toSymCfg, dstateToCfg] + have h1 := shiftL_F_V (n_off + m) l_tail (evalSideWith vars default r_tail) + have h2 := h_bounce ((O ^ (n_off + m)) +> evalSideWith vars default r_tail) + have h3 := shiftR_E_O (n_off + m) ((V ^ 2) +> l_tail) (evalSideWith vars default r_tail) + have h_eq : (V ^ (n_off + m)) +> ((V ^ 2) +> l_tail) = (V ^ (n_off + (m + 2))) +> l_tail := by + rw [← append_assoc, ← zLp_add V (n_off + m) 2, Nat.add_assoc] + rw [h_eq] at h3 + have h4 := e_shift_m_sound 200 l_tail vars n_off (m + 2) r_tail + exact zSt h1 (zSt h2 (zSt h3 h4)) + +theorem fl_push_false_step (l_tail : zB) (vars : Nat → Nat) (n_off m : Nat) (l_rest r : List SymElem) : + (toSymCfg l_tail vars n_off .FL m (.bit true :: l_rest) r) [target_tm]⊢* + (toSymCfg l_tail vars n_off .FL m l_rest (push false r)) := by + dsimp [toSymCfg, dstateToCfg] + rw [eval_push_false] + execute + +theorem symMacroSteps_sound (l_tail : zB) + (h_bounce : ∀ r_t : zB, (l_tail <{{qF}} (Turing.ListBlank.cons 0 (Turing.ListBlank.cons 0 r_t))) [target_tm]⊢* + (((V ^ 2) +> l_tail) {{qE}}> r_t)) + (vars : Nat → Nat) (n_off k : Nat) (q : DState) (m : Nat) (l r : List SymElem) : + (toSymCfg l_tail vars n_off q m l r) [target_tm]⊢* + (toSymCfg l_tail vars n_off (symMacroSteps k q m l r).1 (symMacroSteps k q m l r).2.1 + (symMacroSteps k q m l r).2.2.1 (symMacroSteps k q m l r).2.2.2) := by + induction k generalizing q m l r with + | zero => exact ⟨0, rfl⟩ + | succ k ih => + cases q with + | FL => + rcases r with _ | ⟨⟨_ | _⟩ | ⟨c1, c2, w⟩, _ | ⟨⟨_ | _⟩ | ⟨c3, c4, w2⟩, r_tail⟩⟩ + · rcases l with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, l_rest⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact zSt (fl_push_false_step l_tail vars n_off m l_rest []) (ih .FL m l_rest (push false [])) + · exact ⟨0, rfl⟩ + · rcases l with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, l_rest⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact zSt (fl_push_false_step l_tail vars n_off m l_rest [.bit false]) (ih .FL m l_rest (push false [.bit false])) + · exact ⟨0, rfl⟩ + · rcases l with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, l_rest⟩ + · exact zSt (bounce_empty_sound l_tail h_bounce vars n_off m r_tail) (ih .ER (e_shift_m 200 (m + 2) r_tail).1 [] (e_shift_m 200 (m + 2) r_tail).2) + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) + (ih .BR m (.bit false :: l_rest) (.bit false :: .bit false :: r_tail)) + · rcases l_rest with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, l2⟩ + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) + (ih .FL m [] (.bit false :: .bit false :: .bit false :: r_tail)) + · exact zSt (zSt (shiftL_F_V_step (evalSideWith vars ((V ^ (n_off + m)) +> l_tail) l2) + (evalSideWith vars default r_tail)) + (f_shift_loop_sound 200 vars ((V ^ (n_off + m)) +> l_tail) l2 (.bit true :: .bit true :: r_tail))) + (ih .FL m (f_shift_loop 200 l2 (.bit true :: .bit true :: r_tail)).1 + (.bit false :: .bit false :: (f_shift_loop 200 l2 (.bit true :: .bit true :: r_tail)).2)) + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) + (ih .FL m (.bit true :: l2) (.bit false :: .bit false :: .bit false :: r_tail)) + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) + (ih .FL m (.blk b1 b2 v :: l2) (.bit false :: .bit false :: .bit false :: r_tail)) + · cases b1 <;> cases b2 + · exact ⟨0, rfl⟩ + · rcases r_tail with _ | ⟨⟨_ | _⟩ | ⟨c5, c6, w3⟩, r_tail2⟩ + · exact ⟨0, rfl⟩ + · refine zSt ?_ (ih .FL m l_rest (.bit false :: .bit false :: .bit false :: push_sym true true v r_tail2)) + dsimp [toSymCfg, dstateToCfg] + rw [eval_push_sym] + exact shiftL_F_U (vars v) (evalSideWith vars ((V ^ (n_off + m)) +> l_tail) l_rest) + (evalSideWith vars default r_tail2) + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · refine zSt ?_ (ih .FL m l_rest (.bit false :: .bit false :: push_sym true true v r_tail)) + dsimp [toSymCfg, dstateToCfg] + rw [eval_push_sym] + exact shiftL_F_V (vars v) (evalSideWith vars ((V ^ (n_off + m)) +> l_tail) l_rest) + (evalSideWith vars default r_tail) + · exact ⟨0, rfl⟩ + · rcases l with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, l_rest⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact zSt (fl_push_false_step l_tail vars n_off m l_rest (.bit false :: .bit true :: r_tail)) + (ih .FL m l_rest (push false (.bit false :: .bit true :: r_tail))) + · exact ⟨0, rfl⟩ + · rcases l with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, l_rest⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact zSt (fl_push_false_step l_tail vars n_off m l_rest (.bit false :: .blk c3 c4 w2 :: r_tail)) + (ih .FL m l_rest (push false (.bit false :: .blk c3 c4 w2 :: r_tail))) + · exact ⟨0, rfl⟩ + · rcases l with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, l_rest⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact zSt (fl_push_false_step l_tail vars n_off m l_rest [.bit true]) + (ih .FL m l_rest (push false [.bit true])) + · exact ⟨0, rfl⟩ + · rcases l with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, l_rest⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact zSt (fl_push_false_step l_tail vars n_off m l_rest (.bit true :: .bit false :: r_tail)) + (ih .FL m l_rest (push false (.bit true :: .bit false :: r_tail))) + · exact ⟨0, rfl⟩ + · rcases l with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, l_rest⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact zSt (fl_push_false_step l_tail vars n_off m l_rest (.bit true :: .bit true :: r_tail)) + (ih .FL m l_rest (push false (.bit true :: .bit true :: r_tail))) + · exact ⟨0, rfl⟩ + · rcases l with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, l_rest⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact zSt (fl_push_false_step l_tail vars n_off m l_rest (.bit true :: .blk c3 c4 w2 :: r_tail)) + (ih .FL m l_rest (push false (.bit true :: .blk c3 c4 w2 :: r_tail))) + · exact ⟨0, rfl⟩ + · rcases l with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, l_rest⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact zSt (fl_push_false_step l_tail vars n_off m l_rest [.blk c1 c2 w]) + (ih .FL m l_rest (push false [.blk c1 c2 w])) + · exact ⟨0, rfl⟩ + · rcases l with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, l_rest⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact zSt (fl_push_false_step l_tail vars n_off m l_rest (.blk c1 c2 w :: .bit false :: r_tail)) + (ih .FL m l_rest (push false (.blk c1 c2 w :: .bit false :: r_tail))) + · exact ⟨0, rfl⟩ + · rcases l with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, l_rest⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact zSt (fl_push_false_step l_tail vars n_off m l_rest (.blk c1 c2 w :: .bit true :: r_tail)) + (ih .FL m l_rest (push false (.blk c1 c2 w :: .bit true :: r_tail))) + · exact ⟨0, rfl⟩ + · rcases l with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, l_rest⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact zSt (fl_push_false_step l_tail vars n_off m l_rest (.blk c1 c2 w :: .blk c3 c4 w2 :: r_tail)) + (ih .FL m l_rest (push false (.blk c1 c2 w :: .blk c3 c4 w2 :: r_tail))) + · exact ⟨0, rfl⟩ + | ER => + rcases r with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, r_rest⟩ + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) (ih .FR m (.bit true :: l) []) + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) (ih .FR m (.bit true :: l) r_rest) + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) (ih .CR m (.bit false :: l) r_rest) + · cases b1 <;> cases b2 + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · refine zSt ?_ (ih .ER m (push_sym true false v l) r_rest) + dsimp [toSymCfg, dstateToCfg] + rw [eval_push_sym] + exact shiftR_E_O (vars v) (evalSideWith vars ((V ^ (n_off + m)) +> l_tail) l) + (evalSideWith vars default r_rest) + | CR => + rcases r with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, r_rest⟩ + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) (ih .AL m l [.bit true]) + · rcases l with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, l_rest⟩ + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) (ih .AL m [] (.bit true :: r_rest)) + · exact zSt (zSt (c_zeros_step (evalSideWith vars ((V ^ (n_off + m)) +> l_tail) l_rest) + (evalSideWith vars default r_rest)) + (c_zeros_loop_sound 200 vars ((V ^ (n_off + m)) +> l_tail) (.bit true :: .bit true :: l_rest) r_rest)) + (ih .CR m (c_zeros_loop 200 (.bit true :: .bit true :: l_rest) r_rest).1 + (c_zeros_loop 200 (.bit true :: .bit true :: l_rest) r_rest).2) + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) (ih .AL m (.bit true :: l_rest) (.bit true :: r_rest)) + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) (ih .AL m (.blk b1 b2 v :: l_rest) (.bit true :: r_rest)) + · rcases r_rest with _ | ⟨⟨_ | _⟩ | ⟨c1, c2, w⟩, r2⟩ + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) (ih .ER m (.bit true :: l) []) + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) (ih .ER m (.bit true :: l) (.bit false :: r2)) + · exact zSt (zSt (shiftR_C_O_step (evalSideWith vars ((V ^ (n_off + m)) +> l_tail) l) + (evalSideWith vars default r2)) + (c_ones_loop_sound 200 vars ((V ^ (n_off + m)) +> l_tail) (.bit false :: .bit true :: l) r2)) + (ih .CR m (c_ones_loop 200 (.bit false :: .bit true :: l) r2).1 + (c_ones_loop 200 (.bit false :: .bit true :: l) r2).2) + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) (ih .ER m (.bit true :: l) (.blk c1 c2 w :: r2)) + · cases b1 <;> cases b2 + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · refine zSt ?_ (ih .CR m (push_sym false true v l) r_rest) + dsimp [toSymCfg, dstateToCfg] + rw [eval_push_sym] + exact shiftR_C_O (vars v) (evalSideWith vars ((V ^ (n_off + m)) +> l_tail) l) + (evalSideWith vars default r_rest) + | BR => + rcases r with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, r_rest⟩ + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) (ih .CR m (.bit false :: l) []) + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) (ih .CR m (.bit false :: l) r_rest) + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) (ih .CR m (.bit true :: l) r_rest) + · exact ⟨0, rfl⟩ + | AL => + rcases l with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, l_rest⟩ + · exact ⟨0, rfl⟩ + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) (ih .BR m (.bit true :: l_rest) r) + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) (ih .DL m l_rest (.bit true :: r)) + · exact ⟨0, rfl⟩ + | FR => + rcases r with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, r_rest⟩ + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) (ih .BR m (.bit false :: l) []) + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) (ih .BR m (.bit false :: l) r_rest) + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; rw [eval_push_false]; execute) (ih .FL m l (push false r_rest)) + · exact ⟨0, rfl⟩ + | EL => + rcases l with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, l_rest⟩ + · cases m with + | zero => exact ⟨0, rfl⟩ + | succ m' => + refine zSt ?_ (ih .CR m' [.bit false, .bit false] r) + dsimp [toSymCfg, dstateToCfg] + have h_eq : n_off + (m' + 1) = 1 + (n_off + m') := by omega + rw [h_eq, z07 V (n_off + m') l_tail] + simp only [V, append_cons, append_nil] + execute + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) (ih .FR m (.bit true :: l_rest) r) + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) (ih .CR m (.bit false :: l_rest) r) + · exact ⟨0, rfl⟩ + | DL => + rcases l with _ | ⟨⟨_ | _⟩ | ⟨b1, b2, v⟩, l_rest⟩ + · exact ⟨0, rfl⟩ + · exact ⟨0, rfl⟩ + · exact zSt (by dsimp [toSymCfg, dstateToCfg]; execute) (ih .EL m l_rest (.bit true :: r)) + · exact ⟨0, rfl⟩ + +-- 3. Canonical Configurations `Kr`, `Ev`, and Symbolic Transitions +def l_G_core_bool : List Bool := [true, true, true, false, true, true, true, true, true, true, true, false, true, true, true, false, true, true, false, true, false, false, true, true, true, false, true, true, false, true, false, false, false, true, true, false, true, false, true, true] +def r_init_bool : List Bool := [false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, true, true, true, true, false, false, false, false, false, false, true, true, false, true, true] +def l_G_tail : zB := evalBoolList l_G_core_bool default + +theorem raw_G_bounce_eq : + rawSteps false 765 .FL l_G_core_bool [false, false] = + (.ER, true :: false :: true :: false :: l_G_core_bool, []) := rfl + +theorem G_bounce (r_t : zB) : + (l_G_tail <{{qF}} (Turing.ListBlank.cons 0 (Turing.ListBlank.cons 0 r_t))) [target_tm]⊢* + (((V ^ 2) +> l_G_tail) {{qE}}> r_t) := by + have h := rawSteps_false_sound 765 .FL l_G_core_bool [false, false] r_t + rw [raw_G_bounce_eq] at h + exact h + +theorem raw_init_eq : + rawSteps true 6736 .ER [] [] = + (.ER, true :: false :: true :: false :: l_G_core_bool, r_init_bool) := rfl + +theorem symMacroSteps_sound_eq (vars : Nat → Nat) (n_off k : Nat) + (q : DState) (m : Nat) (l r : List SymElem) + (q' : DState) (m' : Nat) (l' r' : List SymElem) + (heq : symMacroSteps k q m l r = (q', m', l', r')) : + (toSymCfg l_G_tail vars n_off q m l r) [target_tm]⊢* + (toSymCfg l_G_tail vars n_off q' m' l' r') := by + have h := symMacroSteps_sound l_G_tail G_bounce vars n_off k q m l r + rw [heq] at h + exact h + +theorem symMacroSteps_ER_plus (k : Nat) (vars : Nat → Nat) (n_off m : Nat) (r_rest : List SymElem) + (q' : DState) (m' : Nat) (l' r' : List SymElem) + (heq : symMacroSteps (k + 1) .ER m [] (.bit true :: .bit false :: r_rest) = (q', m', l', r')) : + (toSymCfg l_G_tail vars n_off .ER m [] (.bit true :: .bit false :: r_rest)) [target_tm]⊢⁺ + (toSymCfg l_G_tail vars n_off q' m' l' r') := by + have h : (toSymCfg l_G_tail vars n_off .ER m [] (.bit true :: .bit false :: r_rest)) [target_tm]⊢⁺ + (toSymCfg l_G_tail vars n_off + (symMacroSteps (k + 1) .ER m [] (.bit true :: .bit false :: r_rest)).1 + (symMacroSteps (k + 1) .ER m [] (.bit true :: .bit false :: r_rest)).2.1 + (symMacroSteps (k + 1) .ER m [] (.bit true :: .bit false :: r_rest)).2.2.1 + (symMacroSteps (k + 1) .ER m [] (.bit true :: .bit false :: r_rest)).2.2.2) := by + refine z02 ?_ (symMacroSteps_sound l_G_tail G_bounce vars n_off k .CR m [.bit false] (.bit false :: r_rest)) + dsimp [toSymCfg, dstateToCfg, evalSideWith, bitToSym] + refine z03 (by simp only [Turing.ListBlank.head_cons, zDh]; rfl) ?_ + simp only [Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, z00, zDh, zDt] + exact ⟨0, rfl⟩ + rw [heq] at h + exact h + +def repO : Nat → List SymElem → List SymElem + | 0, xs => xs + | k + 1, xs => .bit true :: .bit true :: repO k xs + +def addVars : List Nat → List SymElem → List SymElem + | [], xs => xs + | v :: vs, xs => .blk true true v :: addVars vs xs + +def addBits : List Bool → List SymElem → List SymElem + | [], xs => xs + | b :: bs, xs => .bit b :: addBits bs xs + +def evalVarSum (vars : Nat → Nat) : List Nat → Nat + | [] => 0 + | v :: vs => vars v + evalVarSum vars vs + +theorem eval_repO (vars : Nat → Nat) (tail : zB) (k : Nat) (xs : List SymElem) : + evalSideWith vars tail (repO k xs) = (O ^ k) +> evalSideWith vars tail xs := by + induction k with + | zero => rfl + | succ k ih => + rw [zLp O k, append_assoc] + dsimp [repO, evalSideWith, O] + rw [ih] + +theorem eval_addVars (vars : Nat → Nat) (tail : zB) (vs : List Nat) (xs : List SymElem) : + evalSideWith vars tail (addVars vs xs) = + (O ^ (evalVarSum vars vs)) +> evalSideWith vars tail xs := by + induction vs with + | nil => rfl + | cons v vs ih => + change ((O ^ (vars v)) +> evalSideWith vars tail (addVars vs xs)) = + (O ^ (vars v + evalVarSum vars vs)) +> evalSideWith vars tail xs + rw [ih, ← append_assoc, ← zLp_add O (vars v) (evalVarSum vars vs)] + +theorem eval_repO_addVars (vars : Nat → Nat) (tail : zB) (c : Nat) (vs : List Nat) (xs : List SymElem) : + evalSideWith vars tail (repO c (addVars vs xs)) = + (O ^ (c + evalVarSum vars vs)) +> evalSideWith vars tail xs := by + rw [eval_repO, eval_addVars, ← append_assoc, ← zLp_add O c (evalVarSum vars vs)] + +theorem eval_addBits (vars : Nat → Nat) (tail : zB) (bs : List Bool) (xs : List SymElem) : + evalSideWith vars tail (addBits bs xs) = evalBoolList bs (evalSideWith vars tail xs) := by + induction bs with + | nil => rfl + | cons b bs ih => dsimp [addBits, evalSideWith, evalBoolList]; rw [ih] + +def seg0 : List Bool := [true, false] +def seg1 : List Bool := [false, true, true, false] +def seg2 : List Bool := [false, false, false, false, false, false, true] +def seg3 : List Bool := [false, true, true, false, true, true, true, true, false, false, false, false, false, false] +def seg4 : List Bool := [false, true, true, false, false, true, true, false, true, true, true] + +def mkSymRTail (ca : Nat) (va : List Nat) (cb : Nat) (vb : List Nat) + (cc : Nat) (vc : List Nat) (cd : Nat) (vd : List Nat) : List SymElem := + repO ca (addVars va + (addBits seg1 (repO cb (addVars vb + (addBits seg2 (repO cc (addVars vc + (addBits seg3 (repO cd (addVars vd + (addBits seg4 []))))))))))) + +def mkSymR (ca : Nat) (va : List Nat) (cb : Nat) (vb : List Nat) + (cc : Nat) (vc : List Nat) (cd : Nat) (vd : List Nat) : List SymElem := + .bit true :: .bit false :: mkSymRTail ca va cb vb cc vc cd vd + +def r_kr_tail (a b c d : Nat) : zB := + evalBoolList seg0 ((O ^ a) +> evalBoolList seg1 ((O ^ b) +> evalBoolList seg2 + ((O ^ c) +> evalBoolList seg3 ((O ^ d) +> evalBoolList seg4 default)))) + +theorem eval_mkSymR (vars : Nat → Nat) (ca : Nat) (va : List Nat) (cb : Nat) (vb : List Nat) + (cc : Nat) (vc : List Nat) (cd : Nat) (vd : List Nat) : + evalSideWith vars default (mkSymR ca va cb vb cc vc cd vd) = + r_kr_tail (ca + evalVarSum vars va) (cb + evalVarSum vars vb) + (cc + evalVarSum vars vc) (cd + evalVarSum vars vd) := by + change evalSideWith vars default (addBits seg0 (mkSymRTail ca va cb vb cc vc cd vd)) = _ + dsimp [mkSymRTail, r_kr_tail] + simp only [eval_addBits, eval_repO_addVars, evalSideWith_nil] + +def Kr (n a b c d : Nat) : Cfg (Fin 2) (Fin 6) := + (((V ^ (n + 2)) +> l_G_tail) {{qE}}> r_kr_tail a b c d) + +def Ev (N X : Nat) : Cfg (Fin 2) (Fin 6) := + Kr N (4 * X + 26) (2 * X + 32) 17 9 + +theorem toSymCfg_mkSymR (vars : Nat → Nat) (n k : Nat) + (ca : Nat) (va : List Nat) (cb : Nat) (vb : List Nat) + (cc : Nat) (vc : List Nat) (cd : Nat) (vd : List Nat) : + toSymCfg l_G_tail vars n .ER (k + 2) [] (mkSymR ca va cb vb cc vc cd vd) = + Kr (n + k) (ca + evalVarSum vars va) (cb + evalVarSum vars vb) + (cc + evalVarSum vars vc) (cd + evalVarSum vars vd) := by + unfold toSymCfg dstateToCfg Kr + dsimp only [evalSideWith] + rw [eval_mkSymR, Nat.add_assoc] + +theorem symMacroSteps_mkSymR_plus (k : Nat) (vars : Nat → Nat) (n k_m : Nat) + (ca : Nat) (va : List Nat) (cb : Nat) (vb : List Nat) + (cc : Nat) (vc : List Nat) (cd : Nat) (vd : List Nat) + (k_m' : Nat) + (ca' : Nat) (va' : List Nat) (cb' : Nat) (vb' : List Nat) + (cc' : Nat) (vc' : List Nat) (cd' : Nat) (vd' : List Nat) + (n1 a1 b1 c1 d1 n2 a2 b2 c2 d2 : Nat) + (heq : symMacroSteps (k + 1) .ER (k_m + 2) [] (mkSymR ca va cb vb cc vc cd vd) = + (.ER, k_m' + 2, [], mkSymR ca' va' cb' vb' cc' vc' cd' vd')) + (hn1 : n + k_m = n1) (ha1 : ca + evalVarSum vars va = a1) + (hb1 : cb + evalVarSum vars vb = b1) (hc1 : cc + evalVarSum vars vc = c1) + (hd1 : cd + evalVarSum vars vd = d1) + (hn2 : n + k_m' = n2) (ha2 : ca' + evalVarSum vars va' = a2) + (hb2 : cb' + evalVarSum vars vb' = b2) (hc2 : cc' + evalVarSum vars vc' = c2) + (hd2 : cd' + evalVarSum vars vd' = d2) : + (Kr n1 a1 b1 c1 d1) [target_tm]⊢⁺ (Kr n2 a2 b2 c2 d2) := by + subst hn1 ha1 hb1 hc1 hd1 hn2 ha2 hb2 hc2 hd2 + rw [← toSymCfg_mkSymR vars n k_m ca va cb vb cc vc cd vd] + rw [← toSymCfg_mkSymR vars n k_m' ca' va' cb' vb' cc' vc' cd' vd'] + exact symMacroSteps_ER_plus k vars n (k_m + 2) (mkSymRTail ca va cb vb cc vc cd vd) + .ER (k_m' + 2) [] (mkSymR ca' va' cb' vb' cc' vc' cd' vd') heq + +def mkVars (a b c d : Nat) : Nat → Nat + | 0 => a + | 1 => b + | 2 => c + | _ => d + +theorem sym_S_step_eq : + symMacroSteps 1067 .ER 2 [] (mkSymR 5 [0] 3 [1] 3 [2] 1 [3]) = + (.ER, 26, [], mkSymR 1 [0] 5 [1] 3 [2] 3 [3]) := rfl + +theorem S_step (n a b c d : Nat) : + (Kr n (5 + a) (3 + b) (3 + c) (1 + d)) [target_tm]⊢⁺ + (Kr (24 + n) (1 + a) (5 + b) (3 + c) (3 + d)) := + symMacroSteps_mkSymR_plus 1066 (mkVars a b c d) n 0 + 5 [0] 3 [1] 3 [2] 1 [3] 24 1 [0] 5 [1] 3 [2] 3 [3] + _ _ _ _ _ _ _ _ _ _ sym_S_step_eq + (by omega) (by simp only [evalVarSum, mkVars]; try omega) + (by simp only [evalVarSum, mkVars]; try omega) (by simp only [evalVarSum, mkVars]; try omega) + (by simp only [evalVarSum, mkVars]; try omega) + (by omega) (by simp only [evalVarSum, mkVars]; try omega) + (by simp only [evalVarSum, mkVars]; try omega) (by simp only [evalVarSum, mkVars]; try omega) + (by simp only [evalVarSum, mkVars]; try omega) + +theorem sym_TE_eq : + symMacroSteps 11957 .ER 2 [] (mkSymR 2 [] 44 [1] 17 [] 10 [3]) = + (.ER, 280, [], mkSymR 1 [1] 41 [] 35 [3] 9 []) := rfl + +theorem TE (n b d : Nat) : + (Kr n 2 (44 + b) 17 (10 + d)) [target_tm]⊢⁺ + (Kr (278 + n) (1 + b) 41 (35 + d) 9) := + symMacroSteps_mkSymR_plus 11956 (mkVars 0 b 0 d) n 0 + 2 [] 44 [1] 17 [] 10 [3] 278 1 [1] 41 [] 35 [3] 9 [] + _ _ _ _ _ _ _ _ _ _ sym_TE_eq + (by omega) (by simp only [evalVarSum, mkVars]; try omega) + (by simp only [evalVarSum, mkVars]; try omega) (by simp only [evalVarSum, mkVars]; try omega) + (by simp only [evalVarSum, mkVars]; try omega) + (by omega) (by simp only [evalVarSum, mkVars]; try omega) + (by simp only [evalVarSum, mkVars]; try omega) (by simp only [evalVarSum, mkVars]; try omega) + (by simp only [evalVarSum, mkVars]; try omega) + +theorem sym_TO_eq : + symMacroSteps 11792 .ER 2 [] (mkSymR 1 [] 41 [1] 18 [2] 9 [3]) = + (.ER, 296, [], mkSymR 14 [1, 2] 40 [3] 17 [] 9 []) := rfl + +theorem TO (n b c d : Nat) : + (Kr n 1 (41 + b) (18 + c) (9 + d)) [target_tm]⊢⁺ + (Kr (294 + n) (14 + b + c) (40 + d) 17 9) := + symMacroSteps_mkSymR_plus 11791 (mkVars 0 b c d) n 0 + 1 [] 41 [1] 18 [2] 9 [3] 294 14 [1, 2] 40 [3] 17 [] 9 [] + _ _ _ _ _ _ _ _ _ _ sym_TO_eq + (by omega) (by simp only [evalVarSum, mkVars]; try omega) + (by simp only [evalVarSum, mkVars]; try omega) (by simp only [evalVarSum, mkVars]; try omega) + (by simp only [evalVarSum, mkVars]; try omega) + (by omega) (by simp only [evalVarSum, mkVars]; try omega) + (by simp only [evalVarSum, mkVars]; try omega) (by simp only [evalVarSum, mkVars]; try omega) + (by simp only [evalVarSum, mkVars]; try omega) + +theorem sym_T6_eq : + symMacroSteps 11927 .ER 2 [] (mkSymR 3 [] 41 [1] 17 [2] 9 [3]) = + (.ER, 298, [], mkSymR 13 [1, 2] 40 [3] 17 [] 9 []) := rfl + +theorem T6 (n b c d : Nat) : + (Kr n 3 (41 + b) (17 + c) (9 + d)) [target_tm]⊢⁺ + (Kr (296 + n) (13 + b + c) (40 + d) 17 9) := + symMacroSteps_mkSymR_plus 11926 (mkVars 0 b c d) n 0 + 3 [] 41 [1] 17 [2] 9 [3] 296 13 [1, 2] 40 [3] 17 [] 9 [] + _ _ _ _ _ _ _ _ _ _ sym_T6_eq + (by omega) (by simp only [evalVarSum, mkVars]; try omega) + (by simp only [evalVarSum, mkVars]; try omega) (by simp only [evalVarSum, mkVars]; try omega) + (by simp only [evalVarSum, mkVars]; try omega) + (by omega) (by simp only [evalVarSum, mkVars]; try omega) + (by simp only [evalVarSum, mkVars]; try omega) (by simp only [evalVarSum, mkVars]; try omega) + (by simp only [evalVarSum, mkVars]; try omega) + +theorem sym_T8_eq : + symMacroSteps 11689 .ER 2 [] (mkSymR 4 [] 44 [1] 17 [] 10 [3]) = + (.ER, 272, [], mkSymR 7 [1] 43 [] 33 [3] 9 []) := rfl + +theorem T8 (n b d : Nat) : + (Kr n 4 (44 + b) 17 (10 + d)) [target_tm]⊢⁺ + (Kr (270 + n) (7 + b) 43 (33 + d) 9) := + symMacroSteps_mkSymR_plus 11688 (mkVars 0 b 0 d) n 0 + 4 [] 44 [1] 17 [] 10 [3] 270 7 [1] 43 [] 33 [3] 9 [] + _ _ _ _ _ _ _ _ _ _ sym_T8_eq + (by omega) (by simp only [evalVarSum, mkVars]; try omega) + (by simp only [evalVarSum, mkVars]; try omega) (by simp only [evalVarSum, mkVars]; try omega) + (by simp only [evalVarSum, mkVars]; try omega) + (by omega) (by simp only [evalVarSum, mkVars]; try omega) + (by simp only [evalVarSum, mkVars]; try omega) (by simp only [evalVarSum, mkVars]; try omega) + (by simp only [evalVarSum, mkVars]; try omega) + +theorem follow_Kr_plus {n1 a1 b1 c1 d1 n2 a2 b2 c2 d2 n1' a1' b1' c1' d1' : Nat} {c3 : Cfg (Fin 2) (Fin 6)} + (h1 : (Kr n1 a1 b1 c1 d1) [target_tm]⊢⁺ (Kr n2 a2 b2 c2 d2)) + (hn : n1 = n1') (ha : a1 = a1') (hb : b1 = b1') (hc : c1 = c1') (hd : d1 = d1') + (h2 : (Kr n2 a2 b2 c2 d2) [target_tm]⊢* c3) : + (Kr n1' a1' b1' c1' d1') [target_tm]⊢* c3 := by + subst hn ha hb hc hd + exact zPs (z02 h1 h2) + +theorem follow_Kr_star {n1 a1 b1 c1 d1 n2 a2 b2 c2 d2 n1' a1' b1' c1' d1' : Nat} {c3 : Cfg (Fin 2) (Fin 6)} + (h1 : (Kr n1 a1 b1 c1 d1) [target_tm]⊢* (Kr n2 a2 b2 c2 d2)) + (hn : n1 = n1') (ha : a1 = a1') (hb : b1 = b1') (hc : c1 = c1') (hd : d1 = d1') + (h2 : (Kr n2 a2 b2 c2 d2) [target_tm]⊢* c3) : + (Kr n1' a1' b1' c1' d1') [target_tm]⊢* c3 := by + subst hn ha hb hc hd + exact zSt h1 h2 + +theorem finish_Kr {n1 a1 b1 c1 d1 n2 a2 b2 c2 d2 : Nat} + (hn : n1 = n2) (ha : a1 = a2) (hb : b1 = b2) (hc : c1 = c2) (hd : d1 = d2) : + (Kr n1 a1 b1 c1 d1) [target_tm]⊢* (Kr n2 a2 b2 c2 d2) := by + subst hn ha hb hc hd + exact ⟨0, rfl⟩ + +theorem follow_Kr_star_plus {n1 a1 b1 c1 d1 n2 a2 b2 c2 d2 n1' a1' b1' c1' d1' : Nat} {c3 : Cfg (Fin 2) (Fin 6)} + (h1 : (Kr n1 a1 b1 c1 d1) [target_tm]⊢* (Kr n2 a2 b2 c2 d2)) + (hn : n1 = n1') (ha : a1 = a1') (hb : b1 = b1') (hc : c1 = c1') (hd : d1 = d1') + (h2 : (Kr n2 a2 b2 c2 d2) [target_tm]⊢⁺ c3) : + (Kr n1' a1' b1' c1' d1') [target_tm]⊢⁺ c3 := by + subst hn ha hb hc hd + exact zSp h1 h2 + +theorem follow_Kr_plus_plus {n1 a1 b1 c1 d1 n2 a2 b2 c2 d2 n1' a1' b1' c1' d1' : Nat} {c3 : Cfg (Fin 2) (Fin 6)} + (h1 : (Kr n1 a1 b1 c1 d1) [target_tm]⊢⁺ (Kr n2 a2 b2 c2 d2)) + (hn : n1 = n1') (ha : a1 = a1') (hb : b1 = b1') (hc : c1 = c1') (hd : d1 = d1') + (h2 : (Kr n2 a2 b2 c2 d2) [target_tm]⊢⁺ c3) : + (Kr n1' a1' b1' c1' d1') [target_tm]⊢⁺ c3 := by + subst hn ha hb hc hd + exact zPt h1 h2 + +theorem finish_Kr_plus {n1 a1 b1 c1 d1 n2 a2 b2 c2 d2 n1' a1' b1' c1' d1' n2' a2' b2' c2' d2' : Nat} + (h1 : (Kr n1 a1 b1 c1 d1) [target_tm]⊢⁺ (Kr n2 a2 b2 c2 d2)) + (hn1 : n1 = n1') (ha1 : a1 = a1') (hb1 : b1 = b1') (hc1 : c1 = c1') (hd1 : d1 = d1') + (hn2 : n2 = n2') (ha2 : a2 = a2') (hb2 : b2 = b2') (hc2 : c2 = c2') (hd2 : d2 = d2') : + (Kr n1' a1' b1' c1' d1') [target_tm]⊢⁺ (Kr n2' a2' b2' c2' d2') := by + subst hn1 ha1 hb1 hc1 hd1 hn2 ha2 hb2 hc2 hd2 + exact h1 + +theorem S_iter (k : Nat) : ∀ n a b c d : Nat, + (Kr n (4 * k + 1 + a) (3 + b) (3 + c) (1 + d)) [target_tm]⊢* + (Kr (24 * k + n) (1 + a) (2 * k + 3 + b) (3 + c) (2 * k + 1 + d)) := by + induction k with + | zero => + intro n a b c d + exact finish_Kr (by omega) (by omega) (by omega) (by omega) (by omega) + | succ k ih => + intro n a b c d + refine follow_Kr_plus (S_step n (4 * k + a) b c d) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + refine follow_Kr_star (ih (24 + n) a (2 + b) c (2 + d)) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + exact finish_Kr (by omega) (by omega) (by omega) (by omega) (by omega) + +theorem DC (N X : Nat) : + (Ev N X) [target_tm]⊢⁺ (Ev (48 * X + 716 + N) (4 + X)) := by + unfold Ev + refine follow_Kr_star_plus (S_iter (X + 6) N 1 (2 * X + 29) 14 8) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + refine follow_Kr_plus_plus (TE (24 * (X + 6) + N) (4 * X) (2 * X + 11)) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + refine follow_Kr_star_plus (S_iter X (278 + (24 * (X + 6) + N)) 0 38 (2 * X + 43) 8) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + exact finish_Kr_plus (TO (24 * X + (278 + (24 * (X + 6) + N))) (2 * X) (2 * X + 28) (2 * X)) + (by omega) (by omega) (by omega) (by omega) (by omega) + (by omega) (by omega) (by omega) (by omega) (by omega) + +theorem rawSteps_true_sound_eq (n : Nat) (q : DState) (l r : List Bool) + (q' : DState) (l' r' : List Bool) + (heq : rawSteps true n q l r = (q', l', r')) : + (dstateToCfg q (evalBoolList l default) (evalBoolList r default)) [target_tm]⊢* + (dstateToCfg q' (evalBoolList l' default) (evalBoolList r' default)) := by + have h := rawSteps_true_sound n q l r + rw [heq] at h + exact h + +theorem sym_init_eq : + symMacroSteps 42693 .ER 2 [] (addBits r_init_bool []) = + (.ER, 1293, [], mkSymR 35 [] 38 [] 21 [] 9 []) := rfl + +theorem init_to_Kr : (init []) [target_tm]⊢* (Kr 1291 35 38 21 9) := by + have h1 := rawSteps_true_sound_eq 6736 .ER [] [] + .ER (true :: false :: true :: false :: l_G_core_bool) r_init_bool raw_init_eq + have h2 := symMacroSteps_sound_eq (mkVars 0 0 0 0) 0 42693 + .ER 2 [] (addBits r_init_bool []) + .ER 1293 [] (mkSymR 35 [] 38 [] 21 [] 9 []) sym_init_eq + have h12 : (dstateToCfg .ER (evalBoolList [] default) (evalBoolList [] default)) [target_tm]⊢* + (toSymCfg l_G_tail (mkVars 0 0 0 0) 0 .ER 1293 [] (mkSymR 35 [] 38 [] 21 [] 9 [])) := by + refine zSt h1 ?_ + have heq : dstateToCfg .ER (evalBoolList (true :: false :: true :: false :: l_G_core_bool) default) (evalBoolList r_init_bool default) = + toSymCfg l_G_tail (mkVars 0 0 0 0) 0 .ER 2 [] (addBits r_init_bool []) := by + unfold toSymCfg dstateToCfg + rw [eval_addBits] + rfl + rw [heq] + exact h2 + have h3 := toSymCfg_mkSymR (mkVars 0 0 0 0) 0 1291 35 [] 38 [] 21 [] 9 [] + dsimp [evalVarSum] at h3 + rw [h3] at h12 + exact h12 + +theorem opening : (Kr 1291 35 38 21 9) [target_tm]⊢* (Ev 6649 21) := by + unfold Ev + refine follow_Kr_star (S_iter 8 1291 2 35 18 8) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + refine follow_Kr_plus (T6 1483 13 4 16) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + refine follow_Kr_star (S_iter 7 1779 1 53 14 8) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + refine follow_Kr_plus (TE 1947 26 13) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + refine follow_Kr_star (S_iter 6 2225 2 38 45 8) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + refine follow_Kr_plus (T6 2369 12 31 12) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + refine follow_Kr_star (S_iter 13 2665 3 49 14 8) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + refine follow_Kr_plus (T8 2977 34 25) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + refine follow_Kr_star (S_iter 10 3247 0 40 55 8) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + refine follow_Kr_plus (TO 3487 22 40 20) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + refine follow_Kr_star (S_iter 18 3781 3 57 14 8) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + refine follow_Kr_plus (T8 4213 52 35) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + refine follow_Kr_star (S_iter 14 4483 2 40 65 8) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + refine follow_Kr_plus (T6 4819 30 51 28) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + refine follow_Kr_star (S_iter 23 5115 1 65 14 8) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + refine follow_Kr_plus (TE 5667 70 45) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + refine follow_Kr_star (S_iter 17 5945 2 38 77 8) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + refine follow_Kr_plus (T6 6353 34 63 34) (by omega) (by omega) (by omega) (by omega) (by omega) ?_ + exact finish_Kr (by omega) (by omega) (by omega) (by omega) (by omega) + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + refine Counter.does_not_halt_of_invariant + (Inv := fun c => ∃ N X, c = Ev N X) + ⟨Ev 6649 21, zSt init_to_Kr opening, 6649, 21, rfl⟩ ?_ + rintro _ ⟨N, X, rfl⟩ + exact ⟨Ev (48 * X + 716 + N) (4 + X), DC N X, 48 * X + 716 + N, 4 + X, rfl⟩ + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RD_0RC0LB_0RD1RD_1LE1RA_1RC1LF_HHH1LA diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RD_1RC1RF_1LD0LE_1RA0LC_1RE1LC_0RAHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RD_1RC1RF_1LD0LE_1RA0LC_1RE1LC_0RAHHH.lean new file mode 100644 index 00000000..4dea8883 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RD_1RC1RF_1LD0LE_1RA0LC_1RE1LC_0RAHHH.lean @@ -0,0 +1,4472 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter + +open Mathlib Relation Nat Turing BusyBeaver SixState + +@[expose] public section + +namespace BusyBeaver.M_1RB0RD_1RC1RF_1LD0LE_1RA0LC_1RE1LC_0RAHHH + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RD_1RC1RF_1LD0LE_1RA0LC_1RE1LC_0RAHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end BusyBeaver.M_1RB0RD_1RC1RF_1LD0LE_1RA0LC_1RE1LC_0RAHHH + +end + +namespace BusyBeaver.M_1RB0RD_1RC1RF_1LD0LE_1RA0LC_1RE1LC_0RAHHH + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +namespace Solution +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = + some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = + step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl + +theorem pow_add_append_right (u : List (Fin 2)) (m n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (m + n)) +> r = (u ^ m) +> ((u ^ n) +> r) := by + rw [list_pow_add, ← listblank_append_append] + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +theorem stepStar_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢* c₃ := stepStar_trans (step_stepStar target_tm c₁ c₂ h1) h2 + +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +theorem append_nil_lb (s : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> s = s := rfl +theorem append_cons_lb (a : Fin 2) (l : List (Fin 2)) (s : ListBlank (Fin 2)) : + (a :: l) +> s = a >> (l +> s) := rfl +theorem pow_zero_lb (u : List (Fin 2)) (s : ListBlank (Fin 2)) : + (u ^ 0) +> s = s := rfl +theorem pow_succ_lb (u : List (Fin 2)) (k : Nat) (s : ListBlank (Fin 2)) : + (u ^ (k + 1)) +> s = u +> ((u ^ k) +> s) := by + change (u ++ (u ^ k)) +> s = u +> ((u ^ k) +> s) + exact (listblank_append_append s (u ^ k) u).symm + +theorem step_RR (q q' : Fin 6) (a b : Fin 2) (l r : ListBlank (Fin 2)) + (h : target_tm q a = some (some q', Stmt.write b Dir.right)) : + (l {{q}}> (a >> r)) [target_tm]⊢ ((b >> l) {{q'}}> r) := by + simp only [step, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, h, Option.map]; rfl + +theorem step_RL (q q' : Fin 6) (a b : Fin 2) (l r : ListBlank (Fin 2)) + (h : target_tm q a = some (some q', Stmt.write b Dir.left)) : + (l {{q}}> (a >> r)) [target_tm]⊢ (l <{{q'}} (b >> r)) := by + simp only [step, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, h, Option.map]; rfl + +theorem step_LR (q q' : Fin 6) (a b : Fin 2) (l r : ListBlank (Fin 2)) + (h : target_tm q a = some (some q', Stmt.write b Dir.right)) : + ((a >> l) <{{q}} r) [target_tm]⊢ ((b >> l) {{q'}}> r) := by + simp only [step, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, h, Option.map]; rfl + +theorem step_LL (q q' : Fin 6) (a b : Fin 2) (l r : ListBlank (Fin 2)) + (h : target_tm q a = some (some q', Stmt.write b Dir.left)) : + ((a >> l) <{{q}} r) [target_tm]⊢ (l <{{q'}} (b >> r)) := by + simp only [step, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, h, Option.map]; rfl + +theorem stepStar_RR {q q' : Fin 6} {a b : Fin 2} {l r : ListBlank (Fin 2)} {c₃ : Cfg (Fin 2) (Fin + 6)} + (h : target_tm q a = some (some q', Stmt.write b Dir.right)) + (h2 : ((b >> l) {{q'}}> r) [target_tm]⊢* c₃) : + (l {{q}}> (a >> r)) [target_tm]⊢* c₃ := + stepStar_step_left (step_RR q q' a b l r h) h2 + +theorem stepStar_RL {q q' : Fin 6} {a b : Fin 2} {l r : ListBlank (Fin 2)} {c₃ : Cfg (Fin 2) (Fin + 6)} + (h : target_tm q a = some (some q', Stmt.write b Dir.left)) + (h2 : (l <{{q'}} (b >> r)) [target_tm]⊢* c₃) : + (l {{q}}> (a >> r)) [target_tm]⊢* c₃ := + stepStar_step_left (step_RL q q' a b l r h) h2 + +theorem stepStar_LR {q q' : Fin 6} {a b : Fin 2} {l r : ListBlank (Fin 2)} {c₃ : Cfg (Fin 2) (Fin + 6)} + (h : target_tm q a = some (some q', Stmt.write b Dir.right)) + (h2 : ((b >> l) {{q'}}> r) [target_tm]⊢* c₃) : + ((a >> l) <{{q}} r) [target_tm]⊢* c₃ := + stepStar_step_left (step_LR q q' a b l r h) h2 + +theorem stepStar_LL {q q' : Fin 6} {a b : Fin 2} {l r : ListBlank (Fin 2)} {c₃ : Cfg (Fin 2) (Fin + 6)} + (h : target_tm q a = some (some q', Stmt.write b Dir.left)) + (h2 : (l <{{q'}} (b >> r)) [target_tm]⊢* c₃) : + ((a >> l) <{{q}} r) [target_tm]⊢* c₃ := + stepStar_step_left (step_LL q q' a b l r h) h2 + +theorem stepStar_R0R {q q' : Fin 6} {b : Fin 2} {l : ListBlank (Fin 2)} {c₃ : Cfg (Fin 2) (Fin 6)} + (h : target_tm q 0 = some (some q', Stmt.write b Dir.right)) + (h2 : ((b >> l) {{q'}}> default) [target_tm]⊢* c₃) : + (l {{q}}> default) [target_tm]⊢* c₃ := by + rw [← zero_cons_default]; exact stepStar_RR h h2 + +theorem stepStar_R0L {q q' : Fin 6} {b : Fin 2} {l : ListBlank (Fin 2)} {c₃ : Cfg (Fin 2) (Fin 6)} + (h : target_tm q 0 = some (some q', Stmt.write b Dir.left)) + (h2 : (l <{{q'}} (b >> default)) [target_tm]⊢* c₃) : + (l {{q}}> default) [target_tm]⊢* c₃ := by + rw [← zero_cons_default]; exact stepStar_RL h h2 + +theorem stepStar_L0R {q q' : Fin 6} {b : Fin 2} {r : ListBlank (Fin 2)} {c₃ : Cfg (Fin 2) (Fin 6)} + (h : target_tm q 0 = some (some q', Stmt.write b Dir.right)) + (h2 : ((b >> default) {{q'}}> r) [target_tm]⊢* c₃) : + (default <{{q}} r) [target_tm]⊢* c₃ := by + rw [← zero_cons_default]; exact stepStar_LR h h2 + +theorem stepStar_L0L {q q' : Fin 6} {b : Fin 2} {r : ListBlank (Fin 2)} {c₃ : Cfg (Fin 2) (Fin 6)} + (h : target_tm q 0 = some (some q', Stmt.write b Dir.left)) + (h2 : (default <{{q'}} (b >> r)) [target_tm]⊢* c₃) : + (default <{{q}} r) [target_tm]⊢* c₃ := by + rw [← zero_cons_default]; exact stepStar_LL h h2 + +theorem stepPlus_RR {q q' : Fin 6} {a b : Fin 2} {l r : ListBlank (Fin 2)} {c₃ : Cfg (Fin 2) (Fin + 6)} + (h : target_tm q a = some (some q', Stmt.write b Dir.right)) + (h2 : ((b >> l) {{q'}}> r) [target_tm]⊢* c₃) : + (l {{q}}> (a >> r)) [target_tm]⊢⁺ c₃ := + step_stepStar_stepPlus (step_RR q q' a b l r h) h2 + +theorem stepPlus_RL {q q' : Fin 6} {a b : Fin 2} {l r : ListBlank (Fin 2)} {c₃ : Cfg (Fin 2) (Fin + 6)} + (h : target_tm q a = some (some q', Stmt.write b Dir.left)) + (h2 : (l <{{q'}} (b >> r)) [target_tm]⊢* c₃) : + (l {{q}}> (a >> r)) [target_tm]⊢⁺ c₃ := + step_stepStar_stepPlus (step_RL q q' a b l r h) h2 + +theorem stepPlus_LR {q q' : Fin 6} {a b : Fin 2} {l r : ListBlank (Fin 2)} {c₃ : Cfg (Fin 2) (Fin + 6)} + (h : target_tm q a = some (some q', Stmt.write b Dir.right)) + (h2 : ((b >> l) {{q'}}> r) [target_tm]⊢* c₃) : + ((a >> l) <{{q}} r) [target_tm]⊢⁺ c₃ := + step_stepStar_stepPlus (step_LR q q' a b l r h) h2 + +theorem stepPlus_LL {q q' : Fin 6} {a b : Fin 2} {l r : ListBlank (Fin 2)} {c₃ : Cfg (Fin 2) (Fin + 6)} + (h : target_tm q a = some (some q', Stmt.write b Dir.left)) + (h2 : (l <{{q'}} (b >> r)) [target_tm]⊢* c₃) : + ((a >> l) <{{q}} r) [target_tm]⊢⁺ c₃ := + step_stepStar_stepPlus (step_LL q q' a b l r h) h2 + +theorem stepPlus_R0R {q q' : Fin 6} {b : Fin 2} {l : ListBlank (Fin 2)} {c₃ : Cfg (Fin 2) (Fin 6)} + (h : target_tm q 0 = some (some q', Stmt.write b Dir.right)) + (h2 : ((b >> l) {{q'}}> default) [target_tm]⊢* c₃) : + (l {{q}}> default) [target_tm]⊢⁺ c₃ := by + rw [← zero_cons_default]; exact stepPlus_RR h h2 + +theorem stepPlus_R0L {q q' : Fin 6} {b : Fin 2} {l : ListBlank (Fin 2)} {c₃ : Cfg (Fin 2) (Fin 6)} + (h : target_tm q 0 = some (some q', Stmt.write b Dir.left)) + (h2 : (l <{{q'}} (b >> default)) [target_tm]⊢* c₃) : + (l {{q}}> default) [target_tm]⊢⁺ c₃ := by + rw [← zero_cons_default]; exact stepPlus_RL h h2 + +theorem stepPlus_L0R {q q' : Fin 6} {b : Fin 2} {r : ListBlank (Fin 2)} {c₃ : Cfg (Fin 2) (Fin 6)} + (h : target_tm q 0 = some (some q', Stmt.write b Dir.right)) + (h2 : ((b >> default) {{q'}}> r) [target_tm]⊢* c₃) : + (default <{{q}} r) [target_tm]⊢⁺ c₃ := by + rw [← zero_cons_default]; exact stepPlus_LR h h2 + +theorem stepPlus_L0L {q q' : Fin 6} {b : Fin 2} {r : ListBlank (Fin 2)} {c₃ : Cfg (Fin 2) (Fin 6)} + (h : target_tm q 0 = some (some q', Stmt.write b Dir.left)) + (h2 : (default <{{q'}} (b >> r)) [target_tm]⊢* c₃) : + (default <{{q}} r) [target_tm]⊢⁺ c₃ := by + rw [← zero_cons_default]; exact stepPlus_LL h h2 + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + +theorem pow_01_cons_0 (k : Nat) (s : ListBlank (Fin 2)) : + (([0, 1] : List (Fin 2)) ^ k) +> ((0 : Fin 2) >> s) = + (0 : Fin 2) >> ((([1, 0] : List (Fin 2)) ^ k) +> s) := by + induction k generalizing s with + | zero => rfl + | succ k ih => + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + rw [ih s] + +theorem pow_10_cons_1 (k : Nat) (s : ListBlank (Fin 2)) : + (([1, 0] : List (Fin 2)) ^ k) +> ((1 : Fin 2) >> s) = + (1 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ k) +> s) := by + induction k generalizing s with + | zero => rfl + | succ k ih => + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + rw [ih s] + +theorem pow_01_default (k : Nat) : + (([0, 1] : List (Fin 2)) ^ k) +> (default : ListBlank (Fin 2)) = + (0 : Fin 2) >> ((([1, 0] : List (Fin 2)) ^ k) +> default) := by + have h := pow_01_cons_0 k default + rwa [zero_cons_default] at h + +theorem pow_10_append_snoc (k : Nat) (s : ListBlank (Fin 2)) : + (([1, 0] : List (Fin 2)) ^ k) +> ((1 : Fin 2) >> ((0 : Fin 2) >> s)) = + (([1, 0] : List (Fin 2)) ^ (k + 1)) +> s := by + rw [pow_10_cons_1, pow_01_cons_0] + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + +theorem pow_01_append_snoc (k : Nat) (s : ListBlank (Fin 2)) : + (([0, 1] : List (Fin 2)) ^ k) +> ((0 : Fin 2) >> ((1 : Fin 2) >> s)) = + (([0, 1] : List (Fin 2)) ^ (k + 1)) +> s := by + rw [pow_01_cons_0, pow_10_cons_1] + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + +theorem shift_A_right_10 (k : Nat) (l r : ListBlank (Fin 2)) : + (l {{A}}> ((([1, 0] : List (Fin 2)) ^ k) +> r)) [target_tm]⊢* + ((((([1, 0] : List (Fin 2)) ^ k) +> l)) {{A}}> r) := by + induction k generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ k ih => + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + refine stepStar_RR rfl (stepStar_RR rfl ?_) + have h2 := ih ((1 : Fin 2) >> ((0 : Fin 2) >> l)) r + rw [pow_10_append_snoc] at h2 + simpa only [pow_succ_lb, append_cons_lb, append_nil_lb] using! h2 + +theorem shift_D_right_01 (k : Nat) (l r : ListBlank (Fin 2)) : + (l {{D}}> ((([0, 1] : List (Fin 2)) ^ k) +> r)) [target_tm]⊢* + ((((([0, 1] : List (Fin 2)) ^ k) +> l)) {{D}}> r) := by + induction k generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ k ih => + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + refine stepStar_RR rfl (stepStar_RR rfl ?_) + have h2 := ih ((0 : Fin 2) >> ((1 : Fin 2) >> l)) r + rw [pow_01_append_snoc] at h2 + simpa only [pow_succ_lb, append_cons_lb, append_nil_lb] using! h2 + +theorem shift_C_left_01 (k : Nat) (l r : ListBlank (Fin 2)) : + ((((([0, 1] : List (Fin 2)) ^ k) +> l)) <{{C}} r) [target_tm]⊢* + (l <{{C}} ((([0, 1] : List (Fin 2)) ^ k) +> r)) := by + induction k generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ k ih => + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + refine stepStar_LL rfl (stepStar_LL rfl ?_) + have h2 := ih l ((0 : Fin 2) >> ((1 : Fin 2) >> r)) + rw [pow_01_append_snoc] at h2 + simpa only [pow_succ_lb, append_cons_lb, append_nil_lb] using! h2 + +theorem shift_D_left_10 (k : Nat) (l r : ListBlank (Fin 2)) : + ((((([1, 0] : List (Fin 2)) ^ k) +> l)) <{{D}} r) [target_tm]⊢* + (l <{{D}} ((([1, 0] : List (Fin 2)) ^ k) +> r)) := by + induction k generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ k ih => + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + refine stepStar_LL rfl (stepStar_LL rfl ?_) + have h2 := ih l ((1 : Fin 2) >> ((0 : Fin 2) >> r)) + rw [pow_10_append_snoc] at h2 + simpa only [pow_succ_lb, append_cons_lb, append_nil_lb] using! h2 + +theorem shift_E_left_10_ctx (k : Nat) (l r : ListBlank (Fin 2)) : + (((1 : Fin 2) >> ((([1, 0] : List (Fin 2)) ^ k) +> l)) <{{E}} r) [target_tm]⊢* + (((1 : Fin 2) >> l) <{{E}} ((([0, 1] : List (Fin 2)) ^ k) +> r)) := by + induction k generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ k ih => + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + refine stepStar_LL rfl (stepStar_LL rfl (stepStar_LR rfl ?_)) + refine stepStar_RR rfl (stepStar_RL rfl (stepStar_LL rfl ?_)) + have h2 := ih l ((0 : Fin 2) >> ((1 : Fin 2) >> r)) + rw [pow_01_append_snoc] at h2 + simpa only [pow_succ_lb, append_cons_lb, append_nil_lb] using! h2 + +theorem Start (h : Nat) (r : ListBlank (Fin 2)) : + (default <{{D}} ((([1, 0] : List (Fin 2)) ^ h) +> ([1, 1, 0, 0, 1] +> r))) [target_tm]⊢⁺ + ((((default <+ (([0, 1] : List (Fin 2)) ^ (h + 4))) <+ [1, 1, 1]) <+ [0]) {{A}}> r) := by + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + refine stepPlus_L0R rfl ?_ + refine stepStar_trans (shift_A_right_10 h _ _) ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_D_left_10 h _ _) ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_trans (shift_A_right_10 h _ _) ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_D_left_10 h _ _) ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_trans (shift_A_right_10 h _ _) ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_D_left_10 h _ _) ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_trans (shift_A_right_10 h _ _) ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + try simp only [pow_01_cons_0, pow_10_cons_1] + exact ⟨0, rfl⟩ + +theorem PassR (l : ListBlank (Fin 2)) (p q : Nat) (r : ListBlank (Fin 2)) : + ((l <+ [0]) {{A}}> ((([1, 0] : List (Fin 2)) ^ p) +> ((([0, + 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> r)))) [target_tm]⊢* + (((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, + 0] : List (Fin 2)) ^ q)) <+ [1, 1]) <+ [0]) {{A}}> r) := by + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + refine stepStar_trans (shift_A_right_10 p _ _) ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + rw [pow_01_cons_0 q] + refine stepStar_RR rfl ?_ + refine stepStar_trans (shift_A_right_10 q _ _) ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + try simp only [pow_succ_lb, pow_zero_lb, append_cons_lb, append_nil_lb, pow_01_cons_0, + pow_10_cons_1, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem Borrow (l : ListBlank (Fin 2)) (p q : Nat) (r : ListBlank (Fin 2)) : + (l {{A}}> ((([1, 0] : List (Fin 2)) ^ p) +> ((([0, 1] : List (Fin 2)) ^ (q + 2)) +> ([0, 0, 0, + 1] +> r)))) [target_tm]⊢* + (l <{{C}} ((([1, 0] : List (Fin 2)) ^ (p + 1)) +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, + 0, 1, 0] +> r)))) := by + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + refine stepStar_trans (shift_A_right_10 p _ _) ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_trans (shift_D_right_01 q _ _) ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_C_left_01 q _ _) ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_trans (shift_D_right_01 q _ _) ?_ + refine stepStar_RL rfl ?_ + refine stepStar_trans (shift_C_left_01 q _ _) ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_E_left_10_ctx p _ _) ?_ + refine stepStar_LL rfl ?_ + try simp only [pow_01_cons_0] + exact ⟨0, rfl⟩ + +theorem PassL (l : ListBlank (Fin 2)) (p q : Nat) (r : ListBlank (Fin 2)) : + (((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, + 0] : List (Fin 2)) ^ (q + 1))) <+ [1, 1]) <+ [0]) <{{C}} r) [target_tm]⊢* + ((l <+ [0]) <{{C}} ((([1, 0] : List (Fin 2)) ^ (p + 1)) +> ((([0, + 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 0, 1] +> r)))) := by + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_D_left_10 q _ _) ?_ + refine stepStar_LR rfl ?_ + refine stepStar_trans (shift_A_right_10 q _ _) ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_D_left_10 q _ _) ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_E_left_10_ctx p _ _) ?_ + refine stepStar_LL rfl ?_ + try simp only [pow_01_cons_0, pow_10_cons_1] + exact ⟨0, rfl⟩ + +theorem EndPh (h : Nat) (r : ListBlank (Fin 2)) : + ((((default <+ (([0, 1] : List (Fin 2)) ^ (h + 4))) <+ [1, 1, + 1]) <+ [0]) <{{C}} r) [target_tm]⊢* + (default <{{D}} ((([1, 0] : List (Fin 2)) ^ (h + 4)) +> ([1, 1, 0, 0, 1] +> r))) := by + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_C_left_01 h _ _) ?_ + refine stepStar_L0L rfl ?_ + try simp only [pow_01_cons_0, pow_10_cons_1] + exact ⟨0, rfl⟩ + +theorem EndT (l : ListBlank (Fin 2)) (p q : Nat) : + ((((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, + 0] : List (Fin 2)) ^ (q + 1))) <+ [1, 1]) <+ [0]) {{A}}> default) [target_tm]⊢* + (l <{{C}} ((([1, 0] : List (Fin 2)) ^ (p + 1)) +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, + 0, 1, 0] +> ([1, 0, 1] +> default))))) := by + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + refine stepStar_R0R rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0L rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_D_left_10 q _ _) ?_ + refine stepStar_LR rfl ?_ + refine stepStar_trans (shift_A_right_10 q _ _) ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_D_left_10 q _ _) ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_E_left_10_ctx p _ _) ?_ + refine stepStar_LL rfl ?_ + try simp only [pow_01_cons_0, pow_10_cons_1] + exact ⟨0, rfl⟩ + +theorem EndLastT (l : ListBlank (Fin 2)) (p : Nat) : + (((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ [1, + 1]) <+ [0]) {{A}}> default) [target_tm]⊢* + (l <{{C}} ((([1, 0] : List (Fin 2)) ^ (p + 4)) +> ([1] +> default))) := by + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + refine stepStar_R0R rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0L rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_E_left_10_ctx p _ _) ?_ + refine stepStar_LL rfl ?_ + try simp only [pow_01_cons_0, pow_10_cons_1] + exact ⟨0, rfl⟩ + +theorem MergeB (l : ListBlank (Fin 2)) (p p' : Nat) (r : ListBlank (Fin 2)) : + (l {{A}}> ((([1, 0] : List (Fin 2)) ^ p) +> ([0, 1] +> ([0, 0, 0, 1] +> ((([1, + 0] : List (Fin 2)) ^ p') +> r))))) [target_tm]⊢* + (l <{{C}} ((([1, 0] : List (Fin 2)) ^ (p + p' + 3)) +> r)) := by + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + refine stepStar_trans (shift_A_right_10 p _ _) ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_E_left_10_ctx p _ _) ?_ + refine stepStar_LL rfl ?_ + simp only [pow_01_cons_0, pow_10_cons_1]; rw [← pow_add_append_right ([1, + 0] : List (Fin 2)) p p' r] + try simp only [pow_succ_lb, pow_zero_lb, append_cons_lb, append_nil_lb, pow_01_cons_0, + pow_10_cons_1, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem MergeE (l : ListBlank (Fin 2)) (p : Nat) : + (l {{A}}> ((([1, 0] : List (Fin 2)) ^ p) +> ([0, 1] +> ([0, 0, 0, + 1] +> default)))) [target_tm]⊢* + (l <{{C}} ((([1, 0] : List (Fin 2)) ^ (p + 2)) +> ([1] +> default))) := by + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + refine stepStar_trans (shift_A_right_10 p _ _) ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + rw [zero_cons_default] + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_E_left_10_ctx p _ _) ?_ + refine stepStar_LL rfl ?_ + try simp only [pow_01_cons_0, pow_10_cons_1] + exact ⟨0, rfl⟩ + +theorem OvT (l : ListBlank (Fin 2)) (t : Nat) : + ((l <+ [0]) {{A}}> ((([1, 0] : List (Fin 2)) ^ t) +> ([1] +> default))) [target_tm]⊢* + (l <{{C}} ((([0, 1] : List (Fin 2)) ^ (t + 1)) +> ([0, 0, 0, 1] +> default))) := by + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + refine stepStar_trans (shift_A_right_10 t _ _) ?_ + refine stepStar_RR rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0L rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_D_left_10 t _ _) ?_ + refine stepStar_LR rfl ?_ + refine stepStar_trans (shift_A_right_10 t _ _) ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_D_left_10 t _ _) ?_ + refine stepStar_LL rfl ?_ + try simp only [pow_01_cons_0, pow_10_cons_1] + exact ⟨0, rfl⟩ + +theorem OvL (l : ListBlank (Fin 2)) (p q : Nat) (r : ListBlank (Fin 2)) : + ((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ (p + 1))) <+ [0, 1, 1]) <+ (([1, + 0] : List (Fin 2)) ^ q)) <+ [1, 1]) <{{C}} r) [target_tm]⊢* + (l <{{C}} ((([0, 1] : List (Fin 2)) ^ (p + 1)) +> ([0, 0, 0, 1] +> ((([1, + 0] : List (Fin 2)) ^ (q + 1)) +> r)))) := by + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_E_left_10_ctx q _ _) ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_D_left_10 p _ _) ?_ + refine stepStar_LR rfl ?_ + refine stepStar_trans (shift_A_right_10 p _ _) ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_D_left_10 p _ _) ?_ + refine stepStar_LL rfl ?_ + try simp only [pow_01_cons_0, pow_10_cons_1] + exact ⟨0, rfl⟩ + +theorem OvEnd (h p : Nat) (r : ListBlank (Fin 2)) : + (((default <+ (([0, 1] : List (Fin 2)) ^ (h + 4))) <+ [1, 1, 1]) <{{C}} ((([0, + 1] : List (Fin 2)) ^ (p + 2)) +> ([0, 0, 0, 1] +> r))) [target_tm]⊢* + (default <{{D}} ((([1, 0] : List (Fin 2)) ^ 2) +> ([1, 1, 0, 0, 1] +> ((([1, + 0] : List (Fin 2)) ^ (h + 5)) +> ((([0, 1] : List (Fin 2)) ^ (p + 1)) +> ([0, 0, 1, + 0] +> r)))))) := by + simp only [pow_succ_lb, pow_zero_lb, append_cons_lb, append_nil_lb] + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + rw [pow_01_default h] + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_E_left_10_ctx h _ _) ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + rw [pow_01_cons_0 h] + refine stepStar_RR rfl ?_ + rw [pow_10_cons_1 h] + refine stepStar_RR rfl ?_ + rw [pow_01_cons_0 h] + refine stepStar_RR rfl ?_ + refine stepStar_trans (shift_A_right_10 h _ _) ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_trans (shift_D_right_01 p _ _) ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_C_left_01 p _ _) ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_trans (shift_D_right_01 p _ _) ?_ + refine stepStar_RL rfl ?_ + refine stepStar_trans (shift_C_left_01 p _ _) ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_E_left_10_ctx h _ _) ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + try simp only [pow_01_cons_0, pow_10_cons_1] + exact ⟨0, rfl⟩ + +theorem X1Sw (l : ListBlank (Fin 2)) (p : Nat) (r : ListBlank (Fin 2)) : + ((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ (p + 1))) <+ [0, 1, 1]) <+ [1, + 1]) <+ [0]) <{{C}} r) [target_tm]⊢* + (l <{{C}} ((([0, 1] : List (Fin 2)) ^ (p + 1)) +> ([0, 0, 1, 0, 1, 0, 1] +> r))) := by + simp only [pow_succ_lb, append_cons_lb, append_nil_lb] + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_D_left_10 p _ _) ?_ + refine stepStar_LR rfl ?_ + refine stepStar_trans (shift_A_right_10 p _ _) ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_D_left_10 p _ _) ?_ + refine stepStar_LL rfl ?_ + try simp only [pow_01_cons_0, pow_10_cons_1] + exact ⟨0, rfl⟩ + +theorem X2T (l : ListBlank (Fin 2)) (p q k : Nat) : + ((((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, + 0] : List (Fin 2)) ^ (q + 1))) <+ [1, 1]) <+ [0]) {{A}}> ([1, 0, 1, 1, 0, 1] +> ((([0, + 1] : List (Fin 2)) ^ (k + 1)) +> default))) [target_tm]⊢* + (l <{{C}} ((([1, 0] : List (Fin 2)) ^ (p + 1)) +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, + 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ 3) +> ((([0, 1] : List (Fin 2)) ^ (k + 1)) +> ([0, + 0, 0, 1] +> default))))))) := by + simp only [pow_succ_lb, pow_zero_lb, append_cons_lb, append_nil_lb] + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_trans (shift_D_right_01 k _ _) ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0L rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_C_left_01 k _ _) ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_trans (shift_D_right_01 k _ _) ?_ + refine stepStar_RL rfl ?_ + refine stepStar_trans (shift_C_left_01 k _ _) ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_D_left_10 q _ _) ?_ + refine stepStar_LR rfl ?_ + refine stepStar_trans (shift_A_right_10 q _ _) ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_D_left_10 q _ _) ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_trans (shift_E_left_10_ctx p _ _) ?_ + refine stepStar_LL rfl ?_ + try simp only [pow_01_cons_0, pow_10_cons_1] + exact ⟨0, rfl⟩ + +def sd (d : Bool) : List (Fin 2) := if d then [0, 0, 0, 1] else [0, 0, 1, 0] + +def RP : List (Nat × Nat × Bool) → ListBlank (Fin 2) → ListBlank (Fin 2) + | [], r => r + | (p, q, d) :: P', r => + (([1, 0] : List (Fin 2)) ^ p) +> ((([0, 1] : List (Fin 2)) ^ q) +> (sd d +> RP P' r)) + +inductive Tl where + | TN + | TA (t : Nat) + | TB (k : Nat) + +def RT : Tl → ListBlank (Fin 2) + | .TN => default + | .TA t => (([1, 0] : List (Fin 2)) ^ t) +> ([1] +> default) + | .TB k => [1, 0, 1, 1, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> default) + +def K (h : Nat) (P : List (Nat × Nat × Bool)) (T : Tl) : Cfg (Fin 2) (Fin 6) := + default <{{D}} ((([1, 0] : List (Fin 2)) ^ h) +> ([1, 1, 0, 0, 1] +> RP P (RT T))) + +def reg (p q : Nat) (l : ListBlank (Fin 2)) : ListBlank (Fin 2) := + ((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, + 0] : List (Fin 2)) ^ (q - 1))) <+ [1, 1] + +def LP : List (Nat × Nat × Bool) → ListBlank (Fin 2) → ListBlank (Fin 2) + | [], l => l + | (p, q, _) :: Z', l => LP Z' (reg p q l) + +def OvR : List (Nat × Nat × Bool) → ListBlank (Fin 2) → ListBlank (Fin 2) + | [], r => r + | (p, q, _) :: Z', r => + (([0, 1] : List (Fin 2)) ^ p) +> ([0, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ q) +> OvR Z' r)) + +def touch (x : Nat × Nat × Bool) : Nat × Nat × Bool := + (x.1 + 1, x.2.1 - 1, !x.2.2) + +abbrev okR (x : Nat × Nat × Bool) : Prop := x.2.2 = false ∧ 1 ≤ x.2.1 + +abbrev okL (x : Nat × Nat × Bool) : Prop := x.2.2 = false ∧ 2 ≤ x.2.1 + +abbrev okO (x : Nat × Nat × Bool) : Prop := 1 ≤ x.1 ∧ 1 ≤ x.2.1 + +theorem RP_app (Z W : List (Nat × Nat × Bool)) (r : ListBlank (Fin 2)) : + RP (Z ++ W) r = RP Z (RP W r) := by + induction Z with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + dsimp [RP] + rw [ih] + +theorem LP_app (Z W : List (Nat × Nat × Bool)) (l : ListBlank (Fin 2)) : + LP (Z ++ W) l = LP W (LP Z l) := by + induction Z generalizing l with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + dsimp [LP] + exact ih (reg p q l) + +theorem PassesR (Z : List (Nat × Nat × Bool)) (hZ : ∀ x ∈ Z, okR x) (l r : ListBlank (Fin 2)) : + ((l <+ [0]) {{A}}> RP Z r) [target_tm]⊢* ((LP Z l <+ [0]) {{A}}> r) := by + induction Z generalizing l r with + | nil => exact ⟨0, rfl⟩ + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + have hx := hZ (p, q, d) (List.Mem.head _) + have hZ' : ∀ y ∈ Z, okR y := fun y hy => hZ y (List.Mem.tail _ hy) + dsimp [okR] at hx + rcases hx with ⟨rfl, hq⟩ + obtain ⟨q', rfl⟩ : ∃ q', q = q' + 1 := ⟨q - 1, by omega⟩ + dsimp [RP, LP, sd, reg] + refine stepStar_trans (PassR l p q' (RP Z r)) ?_ + exact ih hZ' _ r + +theorem PassesL (Z : List (Nat × Nat × Bool)) (hZ : ∀ x ∈ Z, okL x) (l r : ListBlank (Fin 2)) : + ((LP Z l <+ [0]) <{{C}} r) [target_tm]⊢* ((l <+ [0]) <{{C}} RP (Z.map touch) r) := by + induction Z generalizing l r with + | nil => exact ⟨0, rfl⟩ + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + have hx := hZ (p, q, d) (List.Mem.head _) + have hZ' : ∀ y ∈ Z, okL y := fun y hy => hZ y (List.Mem.tail _ hy) + dsimp [okL] at hx + rcases hx with ⟨rfl, hq⟩ + obtain ⟨q', rfl⟩ : ∃ q', q = q' + 2 := ⟨q - 2, by omega⟩ + dsimp [RP, LP, List.map, touch, sd, reg] + refine stepStar_trans (ih hZ' (reg p (q' + 2) l) r) ?_ + exact PassL l p q' (RP (Z.map touch) r) + +theorem OvPasses (Z : List (Nat × Nat × Bool)) (hZ : ∀ x ∈ Z, okO x) (l r : ListBlank (Fin 2)) : + (LP Z l <{{C}} r) [target_tm]⊢* (l <{{C}} OvR Z r) := by + induction Z generalizing l r with + | nil => exact ⟨0, rfl⟩ + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + have hx := hZ (p, q, d) (List.Mem.head _) + have hZ' : ∀ y ∈ Z, okO y := fun y hy => hZ y (List.Mem.tail _ hy) + dsimp [okO] at hx + rcases hx with ⟨hp, hq⟩ + obtain ⟨p', rfl⟩ : ∃ p', p = p' + 1 := ⟨p - 1, by omega⟩ + obtain ⟨q', rfl⟩ : ∃ q', q = q' + 1 := ⟨q - 1, by omega⟩ + dsimp [OvR, LP, reg] + refine stepStar_trans (ih hZ' (reg (p' + 1) (q' + 1) l) r) ?_ + exact OvL l p' q' (OvR Z r) + +theorem okL_R {Z : List (Nat × Nat × Bool)} (hZ : ∀ x ∈ Z, okL x) : ∀ x ∈ Z, okR x := by + intro x hx + obtain ⟨h1, h2⟩ := hZ x hx + exact ⟨h1, by omega⟩ + +theorem Dec (h : Nat) (Z : List (Nat × Nat × Bool)) (p q : Nat) (R : List (Nat × Nat × Bool)) (T : + Tl) + (hZ : ∀ x ∈ Z, okL x) : + (K h (Z ++ (p, q + 2, true) :: R) T) [target_tm]⊢⁺ + (K (h + 4) (Z.map touch ++ (p + 1, q + 1, false) :: R) T) := by + unfold K + rw [RP_app, RP_app] + dsimp [RP, sd] + refine stepPlus_stepStar_stepPlus (Start h _) ?_ + refine stepStar_trans (PassesR Z (okL_R hZ) _ _) ?_ + refine stepStar_trans (Borrow _ p q _) ?_ + refine stepStar_trans (PassesL Z hZ _ _) ?_ + exact EndPh h _ + +theorem DecMerge (h : Nat) (Z : List (Nat × Nat × Bool)) (p p' q' : Nat) (d' : Bool) (R : List (Nat + × Nat × Bool)) (T : Tl) + (hZ : ∀ x ∈ Z, okL x) : + (K h (Z ++ (p, 1, true) :: (p', q', d') :: R) T) [target_tm]⊢⁺ + (K (h + 4) (Z.map touch ++ (p + p' + 3, q', d') :: R) T) := by + unfold K + rw [RP_app, RP_app] + dsimp [RP, sd] + refine stepPlus_stepStar_stepPlus (Start h _) ?_ + refine stepStar_trans (PassesR Z (okL_R hZ) _ _) ?_ + refine stepStar_trans (MergeB _ p p' _) ?_ + refine stepStar_trans (PassesL Z hZ _ _) ?_ + exact EndPh h _ + +theorem DecMergeTail (h : Nat) (Z : List (Nat × Nat × Bool)) (p t : Nat) + (hZ : ∀ x ∈ Z, okL x) : + (K h (Z ++ [(p, 1, true)]) (.TA t)) [target_tm]⊢⁺ + (K (h + 4) (Z.map touch) (.TA (p + t + 3))) := by + unfold K + rw [RP_app] + dsimp [RP, sd, RT] + refine stepPlus_stepStar_stepPlus (Start h _) ?_ + refine stepStar_trans (PassesR Z (okL_R hZ) _ _) ?_ + refine stepStar_trans (MergeB _ p t _) ?_ + refine stepStar_trans (PassesL Z hZ _ _) ?_ + exact EndPh h _ + +theorem DecMergeEmpty (h : Nat) (Z : List (Nat × Nat × Bool)) (p : Nat) + (hZ : ∀ x ∈ Z, okL x) : + (K h (Z ++ [(p, 1, true)]) .TN) [target_tm]⊢⁺ + (K (h + 4) (Z.map touch) (.TA (p + 2))) := by + unfold K + rw [RP_app] + dsimp [RP, sd, RT] + refine stepPlus_stepStar_stepPlus (Start h _) ?_ + refine stepStar_trans (PassesR Z (okL_R hZ) _ _) ?_ + refine stepStar_trans (MergeE _ p) ?_ + refine stepStar_trans (PassesL Z hZ _ _) ?_ + exact EndPh h _ + +theorem forall_snoc {α : Type*} {P : α → Prop} {Z : List α} {x : α} + (hZ : ∀ y ∈ Z, P y) (hx : P x) : ∀ y ∈ Z ++ [x], P y := by + intro y hy + rcases List.mem_append.mp hy with hyZ | hyx + · exact hZ y hyZ + · rcases List.mem_singleton.mp hyx with rfl + exact hx + +theorem EndR (h : Nat) (Z : List (Nat × Nat × Bool)) (p q : Nat) + (hZ : ∀ x ∈ Z, okL x) : + (K h (Z ++ [(p, q + 2, false)]) .TN) [target_tm]⊢⁺ + (K (h + 4) (Z.map touch ++ [(p + 1, q + 1, false)]) (.TA 1)) := by + unfold K + refine stepPlus_stepStar_stepPlus (Start h _) ?_ + have hZR : ∀ x ∈ Z ++ [(p, q + 2, false)], okR x := forall_snoc (okL_R hZ) ⟨rfl, by dsimp; omega⟩ + refine stepStar_trans (PassesR (Z ++ [(p, q + 2, false)]) hZR _ _) ?_ + rw [LP_app] + dsimp [LP, RT, reg] + refine stepStar_trans (EndT _ p q) ?_ + refine stepStar_trans (PassesL Z hZ _ _) ?_ + rw [RP_app] + exact EndPh h _ + +theorem EndLast (h : Nat) (Z : List (Nat × Nat × Bool)) (p : Nat) + (hZ : ∀ x ∈ Z, okL x) : + (K h (Z ++ [(p, 1, false)]) .TN) [target_tm]⊢⁺ + (K (h + 4) (Z.map touch) (.TA (p + 4))) := by + unfold K + refine stepPlus_stepStar_stepPlus (Start h _) ?_ + have hZR : ∀ x ∈ Z ++ [(p, 1, false)], okR x := forall_snoc (okL_R hZ) ⟨rfl, by dsimp; omega⟩ + refine stepStar_trans (PassesR (Z ++ [(p, 1, false)]) hZR _ _) ?_ + rw [LP_app] + dsimp [LP, RT, reg] + refine stepStar_trans (EndLastT _ p) ?_ + refine stepStar_trans (PassesL Z hZ _ _) ?_ + exact EndPh h _ + +theorem X2 (h : Nat) (Z : List (Nat × Nat × Bool)) (p q k : Nat) + (hZ : ∀ x ∈ Z, okL x) : + (K h (Z ++ [(p, q + 2, false)]) (.TB (k + 1))) [target_tm]⊢⁺ + (K (h + 4) (Z.map touch ++ [(p + 1, q + 1, false), (3, k + 1, true)]) .TN) := by + unfold K + refine stepPlus_stepStar_stepPlus (Start h _) ?_ + have hZR : ∀ x ∈ Z ++ [(p, q + 2, false)], okR x := forall_snoc (okL_R hZ) ⟨rfl, by dsimp; omega⟩ + refine stepStar_trans (PassesR (Z ++ [(p, q + 2, false)]) hZR _ _) ?_ + rw [LP_app] + dsimp [LP, RT, reg] + refine stepStar_trans (X2T _ p q k) ?_ + refine stepStar_trans (PassesL Z hZ _ _) ?_ + rw [RP_app] + exact EndPh h _ + +def ovp (q : Nat) : List (Nat × Nat × Bool) → Nat → List (Nat × Nat × Bool) + | [], t => [(q, t + 1, true)] + | (p', q', _) :: Z', t => (q, p', true) :: ovp q' Z' t + +theorem ovp_eq (Z : List (Nat × Nat × Bool)) (q t : Nat) : + RP (ovp q Z t) default = (([1, 0] : List (Fin 2)) ^ q) +> OvR Z ((([0, + 1] : List (Fin 2)) ^ (t + 1)) +> ([0, 0, 0, 1] +> default)) := by + induction Z generalizing q t with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p, q', d⟩ + unfold ovp RP OvR + rw [ih] + rfl + +theorem Ov (h p1 q1 : Nat) (Z : List (Nat × Nat × Bool)) (t : Nat) + (hq1 : 1 ≤ q1) (hR : ∀ x ∈ Z, okR x) (hO : ∀ x ∈ Z, okO x) : + (K h ((p1 + 2, q1, false) :: Z) (.TA t)) [target_tm]⊢⁺ + (K 2 ((h + 5, p1 + 1, false) :: ovp q1 Z t) .TN) := by + unfold K + refine stepPlus_stepStar_stepPlus (Start h _) ?_ + have hZR : ∀ x ∈ (p1 + 2, q1, false) :: Z, okR x := by + intro x hx; rcases List.mem_cons.mp hx with rfl | hxZ + · exact ⟨rfl, hq1⟩ + · exact hR x hxZ + refine stepStar_trans (PassesR ((p1 + 2, q1, false) :: Z) hZR _ _) ?_ + dsimp [RT, LP] + refine stepStar_trans (OvT _ t) ?_ + refine stepStar_trans (OvPasses Z hO _ _) ?_ + obtain ⟨q1', rfl⟩ : ∃ q1', q1 = q1' + 1 := ⟨q1 - 1, by omega⟩ + dsimp [reg] + refine stepStar_trans (OvL _ (p1 + 1) q1' _) ?_ + have hEnd := + OvEnd h p1 ((([1, 0] : List (Fin 2)) ^ (q1' + 1)) +> OvR Z ((([0, + 1] : List (Fin 2)) ^ (t + 1)) +> ([0, 0, 0, 1] +> default))) + dsimp [RP, sd, RT] + rw [ovp_eq] + exact hEnd + +def ovpX (q : Nat) : List (Nat × Nat × Bool) → Nat → List (Nat × Nat × Bool) + | [], pa => [(q, pa, false)] + | (p', q', _) :: Z', pa => (q, p', true) :: ovpX q' Z' pa + +theorem ovpX_eq (Z : List (Nat × Nat × Bool)) (q pa : Nat) (r : ListBlank (Fin 2)) : + RP (ovpX q Z pa) r = (([1, 0] : List (Fin 2)) ^ q) +> OvR Z ((([0, + 1] : List (Fin 2)) ^ pa) +> ([0, 0, 1, 0] +> r)) := by + induction Z generalizing q pa r with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p, q', d⟩ + unfold ovpX RP OvR + rw [ih] + rfl + +theorem tailB_eq (n : Nat) : + [0, 0, 1, 0, 1, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (n + 1)) +> ([1] +> default)) = + [0, 0, 1, 0] +> RT (.TB n) := by + dsimp [RT] + rw [pow_10_cons_1] + rfl + +theorem X1 (h p1 q1 : Nat) (Z : List (Nat × Nat × Bool)) (pa pb : Nat) + (hq1 : 1 ≤ q1) (hR : ∀ x ∈ Z, okR x) (hO : ∀ x ∈ Z, okO x) : + (K h ((p1 + 2, q1, false) :: Z ++ [(pa + 1, 1, false), (pb, 1, false)]) .TN) [target_tm]⊢⁺ + (K 2 ((h + 5, p1 + 1, false) :: ovpX q1 Z (pa + 1)) (.TB (pb + 3))) := by + unfold K + refine stepPlus_stepStar_stepPlus (Start h _) ?_ + have hZR : ∀ x ∈ (p1 + 2, q1, false) :: Z ++ [(pa + 1, 1, false), (pb, 1, false)], okR x := by + intro x hx; rcases List.mem_cons.mp hx with rfl | hx' + · exact ⟨rfl, hq1⟩ + · rcases List.mem_append.mp hx' with hxZ | hx2 + · exact hR x hxZ + · rcases List.mem_cons.mp hx2 with rfl | hx1 + · exact ⟨rfl, by dsimp; omega⟩ + · rcases List.mem_singleton.mp hx1 with rfl + exact ⟨rfl, by dsimp; omega⟩ + refine stepStar_trans (PassesR _ hZR _ _) ?_ + dsimp [LP] + rw [LP_app] + dsimp [LP, RT, reg] + refine stepStar_trans (EndLastT _ pb) ?_ + dsimp [reg] + refine stepStar_trans (X1Sw _ pa _) ?_ + refine stepStar_trans (OvPasses Z hO _ _) ?_ + obtain ⟨q1', rfl⟩ : ∃ q1', q1 = q1' + 1 := ⟨q1 - 1, by omega⟩ + dsimp [reg] + refine stepStar_trans (OvL _ (p1 + 1) q1' _) ?_ + refine stepStar_trans (OvEnd h p1 _) ?_ + rw [pow_10_cons_1 (pb + 4)] + dsimp [RP, sd, RT] + rw [ovpX_eq] + exact ⟨0, rfl⟩ + +theorem init0_chunk0 : + (default {{A}}> default) [target_tm]⊢* + (([1, 1, 0, 1] +> default) {{E}}> ([0, 1, 0, 0, 1, 0, 0, 0, 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_R0R rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0L rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0L rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_chunk1 : + (([1, 1, 0, 1] +> default) {{E}}> ([0, 1, 0, 0, 1, 0, 0, 0, 1] +> default)) [target_tm]⊢* + (([1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1] +> default) <{{C}} ([1, 0, 1, 0, 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + try simp only [zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_chunk2 : + (([1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1] +> default) <{{C}} ([1, 0, 1, 0, + 1] +> default)) [target_tm]⊢* + (([0, 1, 0, 1, 0, 1, 0, 1] +> default) <{{C}} ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_chunk3 : + (([0, 1, 0, 1, 0, 1, 0, 1] +> default) <{{C}} ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1] +> default)) [target_tm]⊢* + (([0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] +> default) {{D}}> ([0, 1, 0, 1, 0, + 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_chunk4 : + (([0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] +> default) {{D}}> ([0, 1, 0, 1, 0, + 1] +> default)) [target_tm]⊢* + (([1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] +> default) <{{E}} ([0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 0, 0, 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0L rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_chunk5 : + (([1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] +> default) <{{E}} ([0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 0, 0, 1] +> default)) [target_tm]⊢* + (([1, 1, 0, 1, 0, 1] +> default) {{B}}> ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 0, 0, 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_chunk6 : + (([1, 1, 0, 1, 0, 1] +> default) {{B}}> ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 0, 0, 1] +> default)) [target_tm]⊢* + (([1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, + 1] +> default) <{{D}} ([1, 0, 1, 0, 0, 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + try simp only [zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_chunk7 : + (([1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, + 1] +> default) <{{D}} ([1, 0, 1, 0, 0, 1] +> default)) [target_tm]⊢* + (default <{{D}} ([1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 0, 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0 : (init []) [target_tm]⊢* (K 2 [(7, 4, false)] .TN) := by + change (default {{A}}> default) [target_tm]⊢* _ + refine stepStar_trans init0_chunk0 ?_ + refine stepStar_trans init0_chunk1 ?_ + refine stepStar_trans init0_chunk2 ?_ + refine stepStar_trans init0_chunk3 ?_ + refine stepStar_trans init0_chunk4 ?_ + refine stepStar_trans init0_chunk5 ?_ + refine stepStar_trans init0_chunk6 ?_ + refine stepStar_trans init0_chunk7 ?_ + simp only [K, RP, RT, sd, pow_succ_lb, pow_zero_lb, append_cons_lb, append_nil_lb, + zero_cons_default, Bool.false_eq_true, ↓reduceIte] + exact ⟨0, rfl⟩ + +def base_0666 : List (Nat × Nat × Bool) := [(47, 32, false), (40, 33, true), (13, 34, true)] + +theorem init_to_base : (K 2 [(7, 4, false)] .TN) [target_tm]⊢* (K 2 base_0666 .TN) := by + refine stepStar_trans (stepPlus_stepStar (EndR 2 [] 7 2 (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Ov 6 6 3 [] 1 (by decide) (by decide) (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 2 [(11, 7, false)] 3 0 [] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 6 [] 12 4 [(4, 1, false)] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (EndLast 10 [(13, 5, false)] 4 (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 14 [] 14 2 [] (.TA 8) (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Ov 18 13 3 [] 8 (by decide) (by decide) (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 2 [(23, 14, false)] 3 7 [] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 6 [] 24 11 [(4, 8, false)] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (EndR 10 [(25, 12, false)] 4 6 (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 14 [] 26 9 [(5, 7, false)] (.TA 1) (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Ov 18 25 10 [(5, 7, + false)] 1 (by decide) (by decide) (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 2 [(23, 26, false)] 10 3 [(7, 2, + true)] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 6 [] 24 23 [(11, 4, false), (7, 2, + true)] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 10 [(25, 24, false), (11, 4, + false)] 7 0 [] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 14 [] 26 21 [(12, 3, true), (8, 1, + false)] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 18 [(27, 22, false)] 12 1 [(8, 1, + false)] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 22 [] 28 19 [(13, 2, false), (8, 1, + false)] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (EndLast 26 [(29, 20, false), (13, 2, + false)] 8 (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 30 [] 30 17 [(14, 1, + true)] (.TA 12) (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (DecMergeTail 34 [(31, 18, false)] 14 12 (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 38 [] 32 15 [] (.TA 29) (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Ov 42 31 16 [] 29 (by decide) (by decide) (by decide))) + ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 2 [(47, 32, false)] 16 28 [] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 6 [] 48 29 [(17, 29, false)] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (EndR 10 [(49, 30, false)] 17 27 (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 14 [] 50 27 [(18, 28, + false)] (.TA 1) (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Ov 18 49 28 [(18, 28, + false)] 1 (by decide) (by decide) (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 2 [(23, 50, false)] 28 16 [(28, 2, + true)] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 6 [] 24 47 [(29, 17, false), (28, 2, + true)] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 10 [(25, 48, false), (29, 17, + false)] 28 0 [] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 14 [] 26 45 [(30, 16, true), (29, 1, + false)] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 18 [(27, 46, false)] 30 14 [(29, 1, + false)] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 22 [] 28 43 [(31, 15, false), (29, 1, + false)] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (EndLast 26 [(29, 44, false), (31, 15, + false)] 29 (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 30 [] 30 41 [(32, 14, + true)] (.TA 33) (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 34 [(31, 42, + false)] 32 12 [] (.TA 33) (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 38 [] 32 39 [(33, 13, + false)] (.TA 33) (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Ov 42 31 40 [(33, 13, + false)] 33 (by decide) (by decide) (by decide))) ?_ + exact ⟨0, rfl⟩ +-- ============================================================================ +-- PART 2: Arithmetic Invariant J, Step Preservation Jstep, and Non-Halting +-- ============================================================================ + +abbrev Tri := Nat × Nat × Bool + +def bv (d : Bool) : Nat := if d then 1 else 0 + +def dv : List Tri → Nat + | [] => 0 + | (_, _, d) :: P' => bv d + 2 * dv P' + +def dig (x : Tri) : Bool := x.2.2 + +def All0 : List Tri → Prop + | [] => True + | (_, _, d) :: Z => d = false ∧ All0 Z + +theorem pow2_pos (n : Nat) : 1 ≤ 2 ^ n := Nat.one_le_pow n 2 (by decide) + +theorem pow2_succ (n : Nat) : 2 ^ (n + 1) = 2 * 2 ^ n := by + rw [Nat.pow_succ, Nat.mul_comm] + +theorem dv_lt (P : List Tri) : dv P < 2 ^ P.length := by + induction P with + | nil => decide + | cons x P ih => + rcases x with ⟨p, q, d⟩ + dsimp [dv, List.length] + rw [pow2_succ] + cases d <;> dsimp [bv] <;> omega + +theorem dv_zeros (Z R : List Tri) (hZ : All0 Z) : dv (Z ++ R) = 2 ^ Z.length * dv R := by + induction Z with + | nil => dsimp [dv, List.length]; omega + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + rcases hZ with ⟨rfl, hZ'⟩ + dsimp [dv, bv, List.length] + rw [ih hZ', pow2_succ] + ring + +theorem dv_zero (Z : List Tri) (hZ : All0 Z) : dv Z = 0 := by + have h := dv_zeros Z [] hZ + rw [List.append_nil] at h + dsimp [dv] at h + omega + +theorem dv_tz (Z R : List Tri) (hZ : All0 Z) : + dv (Z.map touch ++ R) + 1 = 2 ^ Z.length + 2 ^ Z.length * dv R := by + induction Z with + | nil => dsimp [dv, List.length, List.map]; omega + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + rcases hZ with ⟨rfl, hZ'⟩ + dsimp [List.map, touch, dv, bv, List.length] + have ih' := ih hZ' + rw [pow2_succ, Nat.mul_assoc] + omega + +theorem dv_tz' (Z R : List Tri) (hZ : All0 Z) : + dv (Z.map touch ++ R) = 2 ^ Z.length - 1 + 2 ^ Z.length * dv R := by + have h := dv_tz Z R hZ + have hp := pow2_pos Z.length + omega + +def AllI (Pr : Nat → Tri → List Tri → Prop) : Nat → List Tri → Prop + | _, [] => True + | i, x :: Y => Pr i x Y ∧ AllI Pr (i + 1) Y + +theorem AllI_app (Pr : Nat → Tri → List Tri → Prop) (Z : List Tri) : + ∀ (i : Nat) (R : List Tri), AllI Pr i (Z ++ R) → AllI Pr (i + Z.length) R := by + induction Z with + | nil => intro i R h; exact h + | cons x Z ih => + intro i R h + rcases h with ⟨_, h2⟩ + dsimp [List.length] + have heq : i + (Z.length + 1) = (i + 1) + Z.length := by omega + rw [heq] + exact ih (i + 1) R h2 + +theorem AllI_mono (Pr Pr' : Nat → Tri → List Tri → Prop) (P : List Tri) : + ∀ (i : Nat), (∀ j x Y, i ≤ j → Pr j x Y → Pr' j x Y) → AllI Pr i P → AllI Pr' i P := by + induction P with + | nil => intro _ _ _; trivial + | cons x P ih => + intro i hm h + rcases h with ⟨h1, h2⟩ + refine ⟨hm i x P (Nat.le_refl i) h1, ih (i + 1) ?_ h2⟩ + intro j y Y hj + exact hm j y Y (by omega) + +theorem AllI_shift (Pr Pr' : Nat → Tri → List Tri → Prop) (P : List Tri) : + ∀ (i : Nat), (∀ j x Y, i ≤ j → Pr (j + 1) x Y → Pr' j x Y) → AllI Pr (i + 1) P → AllI Pr' i P := + by + induction P with + | nil => intro _ _ _; trivial + | cons x P ih => + intro i hm h + rcases h with ⟨h1, h2⟩ + refine ⟨hm i x P (Nat.le_refl i) h1, ih (i + 1) ?_ h2⟩ + intro j y Y hj + exact hm j y Y (by omega) + +theorem AllI_touchZ (Pr Pr' : Nat → Tri → List Tri → Prop) (R R' : List Tri) : + ∀ (Z : List Tri) (i : Nat), + All0 Z → + (∀ j p q Zr, All0 Zr → j + (Zr.length + 1) = i + Z.length → + Pr j (p, q, false) (Zr ++ R) → Pr' j (p + 1, q - 1, true) (Zr.map touch ++ R')) → + AllI Pr i (Z ++ R) → + AllI Pr' (i + Z.length) R' → + AllI Pr' i (Z.map touch ++ R') := by + intro Z + induction Z with + | nil => + intro i _ _ _ hR' + exact hR' + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + intro i hZ hob hA hR' + rcases hZ with ⟨rfl, hZ'⟩ + rcases hA with ⟨h1, h2⟩ + dsimp [List.map, touch, AllI, List.length] at * + refine ⟨hob i p q Z hZ' (by omega) h1, ?_⟩ + apply ih (i + 1) hZ' + · intro j p' q' Zr hZr hj + exact hob j p' q' Zr hZr (by omega) + · exact h2 + · have heq : (i + 1) + Z.length = i + (Z.length + 1) := by omega + rw [heq] + exact hR' + +inductive Phase where + | E1 | E2 | E1t | E2t | T0 | L1 | L2 | LX + deriving DecidableEq + +def PN (ph : Phase) (c4 : Bool) (p q n tv : Nat) : Prop := + match ph with + | .E1 => match n with + | 0 => q ≥ tv + 2 ^ n + 1 ∧ p + tv + 2 ^ n ≥ 3 + | _ + 1 => q ≥ tv + 3 * 2 ^ n + 1 ∧ (p + tv) % 2 = 1 ∧ p + tv + 2 ^ n ≥ 3 * 2 ^ n + | .E2 => match n with + | 0 => q ≥ tv + 1 ∧ p + tv ≥ 3 + | _ + 1 => q ≥ tv + 2 * 2 ^ n + 1 ∧ (p + tv) % 2 = 1 ∧ p + tv ≥ 3 * 2 ^ n + | .E1t => match n with + | 0 => q ≥ tv + 2 ^ n + 1 ∧ p + tv + 2 ^ n = 5 + | _ + 1 => q ≥ tv + 2 * 2 ^ n + 1 ∧ (p + tv) % 2 = 1 ∧ p + tv + 2 ^ n ≥ 3 * 2 ^ n + | .E2t => match n with + | 0 => q ≥ tv + 1 ∧ p + tv = 5 + | _ + 1 => q ≥ tv + 2 ^ n + 1 ∧ (p + tv) % 2 = 1 ∧ p + tv ≥ 3 * 2 ^ n + | .T0 => q ≥ tv + 7 * 2 ^ n + 1 ∧ p + tv + 5 * 2 ^ n ≥ 6 * 2 ^ n ∧ + match n with + | 0 => tv = 0 ∧ p % 2 = 0 + | _ + 1 => (p + tv) % 2 = 1 + | .L1 => q + 2 ^ n ≥ tv + 2 ∧ + match n with + | 0 => q = tv + 2 ^ n + | 1 => p + tv + 2 ^ n ≥ (if c4 then 4 else 5) * 2 ^ n ∧ + (q ≥ tv + 2 ^ n + 1 ∨ (q + tv) % 2 = 0) ∧ (if c4 then q = tv + 2 ^ n else True) + | _ + 2 => p + tv + 2 ^ n ≥ (if c4 then 4 else 5) * 2 ^ n ∧ (q + tv) % 2 = 0 + | .LX => match n with + | 0 => q = tv + 1 + | 1 => p + tv ≥ 4 * 2 ^ n ∧ q = tv + 1 + | _ + 2 => p + tv ≥ 4 * 2 ^ n ∧ (q + tv) % 2 = 0 + | .L2 => p + tv ≥ (if c4 then 4 else 5) * (2 * 2 ^ n) ∧ + match n with + | 0 => (q ≥ tv + 1 ∨ (q + tv) % 2 = 0) ∧ (if c4 then q = tv else True) + | _ + 1 => (q + tv) % 2 = 0 + +def PI (ph : Phase) (h i p q n tv : Nat) : Prop := + match i with + | 1 => h % 2 = 0 ∧ + match ph with + | .E1 | .E1t => + 2 ≤ n ∧ p + tv + 2 ^ n + 3 ≥ 11 * 2 ^ n ∧ h + 4 * (tv + 2 ^ n) + 6 ≥ 12 * 2 ^ n + | .E2 | .E2t => 2 ≤ n ∧ p + tv + 3 ≥ 11 * 2 ^ n ∧ h + 4 * tv + 6 ≥ 12 * 2 ^ n + | .T0 => + 2 ≤ n ∧ p + tv + 5 * 2 ^ n + 3 ≥ 22 * 2 ^ n ∧ h + 4 * (tv + 5 * 2 ^ n) + 6 ≥ 24 * 2 ^ n + | .L1 => 2 ≤ n ∧ q ≥ tv + 3 * 2 ^ n ∧ h + 4 * (tv + 2 ^ n) + 6 ≥ 8 * 2 ^ n + | .LX => 3 ≤ n ∧ q ≥ tv + 2 * 2 ^ n ∧ h + 4 * tv + 6 ≥ 8 * 2 ^ n + | .L2 => 1 ≤ n ∧ q ≥ tv + 4 * 2 ^ n ∧ h + 4 * tv + 6 ≥ 16 * 2 ^ n + | 2 => match ph with + | .E1 | .E1t => p + tv + 2 ^ n + 1 ≥ 7 * 2 ^ n + | .E2 | .E2t => p + tv + 1 ≥ 7 * 2 ^ n + | .T0 => p + tv + 5 * 2 ^ n + 1 ≥ 14 * 2 ^ n + | .L1 => q ≥ tv + 2 ^ n + 1 + | .LX | .L2 => q ≥ tv + 1 + | _ => True + +def PC (ph : Phase) (c4 : Bool) (h i p q n tv : Nat) : Prop := + 1 ≤ p ∧ 1 ≤ q ∧ PN ph c4 p q n tv ∧ PI ph h i p q n tv + +def PCx (ph : Phase) (c4 : Bool) (h : Nat) (i : Nat) (x : Tri) (Y : List Tri) : Prop := + PC ph c4 h i x.1 x.2.1 Y.length (dv (x :: Y)) + +theorem ob_touch (ph : Phase) (c4 : Bool) (h i p q n tv : Nat) + (ht : 1 ≤ tv) (hq : 2 ≤ q) (hPC : PC ph c4 h i p q n tv) : + PC ph c4 (h + 4) i (p + 1) (q - 1) n (tv - 1) := by + rcases hPC with ⟨hp1, hq1, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · cases ph <;> cases c4 <;> + (rcases n with _ | _ | n <;> + (try simp only [PN, pow2_succ, Nat.pow_zero, Nat.zero_add, Bool.false_eq_true, + ↓reduceIte, and_true] at *; + (try have := pow2_pos n); omega)) + · rcases i with _ | _ | _ | i + · trivial + · cases ph <;> + (try simp only [PI, Nat.zero_add] at *; + (try have := pow2_pos n); omega) + · cases ph <;> + (try simp only [PI, Nat.zero_add] at *; + (try have := pow2_pos n); omega) + · trivial + +theorem ob_merge (ph : Phase) (c4 : Bool) (h i p q n u U : Nat) + (hph : ph = .L1 ∨ ph = .L2 ∨ ph = .LX) + (hn : 1 ≤ n) (hu : 2 ≤ u) (hu2 : u % 2 = 0) (hU2 : U % 2 = 0) (hUu : U + u ≤ 2 * 2 ^ n) + (hL1 : ph = .L1 → U + u ≤ 2 ^ n) (hLX : ph = .LX → 2 ≤ n) (hc4 : ph = .L1 → c4 = true → 2 ≤ n) + (hi1 : i = 1 → 2 ≤ n) (hiX : ph = .LX → i = 1 → 3 ≤ n) (hq : 2 ≤ q) + (hPC : PC ph c4 h i p q (n + 1) (u + 2 * U)) : + PC ph c4 (h + 4) i (p + 1) (q - 1) n (u - 1 + U) := by + rcases hPC with ⟨hp1, hq1, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases hph with rfl | rfl | rfl + · cases c4 <;> + (rcases n with _ | _ | n <;> + (try simp only [PN, pow2_succ, Nat.pow_zero, Nat.zero_add, Bool.false_eq_true, + ↓reduceIte, and_true, true_implies] at *; + (try have := pow2_pos n); omega)) + · cases c4 <;> + (rcases n with _ | _ | n <;> + (try simp only [PN, pow2_succ, Nat.pow_zero, Nat.zero_add, Bool.false_eq_true, + ↓reduceIte, and_true, true_implies] at *; + (try have := pow2_pos n); omega)) + · rcases n with _ | _ | n <;> + (try simp only [PN, pow2_succ, Nat.pow_zero, Nat.zero_add, true_implies] at *; + (try have := pow2_pos n); omega) + · rcases i with _ | _ | _ | i + · trivial + · rcases hph with rfl | rfl | rfl <;> + (try simp only [PI, pow2_succ, Nat.zero_add, true_implies] at *; + have := pow2_pos n; omega) + · rcases hph with rfl | rfl | rfl <;> + (try simp only [PI, pow2_succ, Nat.zero_add, true_implies] at *; + have := pow2_pos n; omega) + · trivial + +theorem ob_mt (c4 : Bool) (h i p q n : Nat) (hq : 2 ≤ q) (hi1 : i = 1 → 1 ≤ n) + (hPC : PC .L2 c4 h i p q (n + 1) (2 * 2 ^ n)) : + PC .L2 false (h + 4) i (p + 1) (q - 1) n (2 * 2 ^ n - 1) := by + rcases hPC with ⟨hp1, hq1, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · cases c4 <;> + (rcases n with _ | n <;> + (try simp only [PN, pow2_succ, Nat.pow_zero, Nat.zero_add, Bool.false_eq_true, + ↓reduceIte, and_true] at *; + (try have := pow2_pos n); omega)) + · rcases i with _ | _ | _ | i + · trivial + · try simp only [PI, pow2_succ, Nat.zero_add, true_implies] at * + have := pow2_pos n; omega + · try simp only [PI, Nat.zero_add] at * + have := pow2_pos n; omega + · trivial + +theorem ob_fuse (ph : Phase) (c4 : Bool) (h h' k p p' q' n tv : Nat) + (hph : ph = .L1 ∨ ph = .L2 ∨ ph = .LX) (hk : 3 ≤ k) + (hPC : PC ph c4 h (k + 1) p' q' n tv) : + PC ph c4 h' k (p + p' + 3) q' n tv := by + rcases hPC with ⟨hp1, hq1, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases hph with rfl | rfl | rfl <;> cases c4 <;> + (rcases n with _ | _ | n <;> + (try simp only [PN, pow2_succ, Nat.pow_zero, Nat.zero_add, Bool.false_eq_true, + ↓reduceIte, and_true] at *; + (try have := pow2_pos n); omega)) + · rcases k with _ | _ | _ | k <;> (try omega); trivial + +theorem ob_far (ph : Phase) (c4 : Bool) (h h' i j p q n tv : Nat) (_hi : 3 ≤ i) (hj : 3 ≤ j) + (hPC : PC ph c4 h i p q n tv) : + PC ph c4 h' j p q n tv := by + rcases hPC with ⟨hp1, hq1, hN, _⟩ + refine ⟨hp1, hq1, hN, ?_⟩ + rcases j with _ | _ | _ | j <;> (try omega); trivial + +theorem ob_far2 (ph : Phase) (c4 : Bool) (h h' i p q n tv : Nat) (hi : 2 ≤ i) + (hPC : PC ph c4 h i p q n tv) : + PC ph c4 h' i p q n tv := by + rcases hPC with ⟨hp1, hq1, hN, hI⟩ + refine ⟨hp1, hq1, hN, ?_⟩ + rcases i with _ | _ | _ | i + · omega + · omega + · exact hI + · trivial + +def endtr (ph ph' : Phase) : Prop := + (ph = .E1 ∧ ph' = .E2) ∨ (ph = .E1t ∧ ph' = .E2t) + +theorem ob_end (ph ph' : Phase) (h i p q n : Nat) (htr : endtr ph ph') (hn : 1 ≤ n) (hq : 2 ≤ q) + (hPC : PC ph false h i p q n 0) : + PC ph' false (h + 4) i (p + 1) (q - 1) n (2 ^ n - 1) := by + rcases hPC with ⟨hp1, hq1, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases htr with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ <;> + (rcases n with _ | n <;> + (try simp only [PN, pow2_succ, Nat.pow_zero, Nat.add_zero, Nat.zero_add] at *; + (try have := pow2_pos n); omega)) + · rcases i with _ | _ | _ | i + · trivial + · rcases htr with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ <;> + (try simp only [PI, Nat.add_zero, Nat.zero_add] at *; + have := pow2_pos n; omega) + · rcases htr with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ <;> + (try simp only [PI, Nat.add_zero, Nat.zero_add] at *; + have := pow2_pos n; omega) + · trivial + +theorem ob_end_top (ph ph' : Phase) (h i p q : Nat) (htr : endtr ph ph') (_hi : 3 ≤ i) + (hPC : PC ph false h i p (q + 2) 0 0) : + PC ph' false (h + 4) i (p + 1) (q + 1) 0 0 := by + rcases hPC with ⟨hp1, hq1, hN, _⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases htr with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ <;> + (try simp only [PN, Nat.pow_zero, Nat.add_zero, Nat.zero_add] at *; + omega) + · rcases i with _ | _ | _ | i <;> (try omega); trivial + +theorem ob_endlast (c4 : Bool) (h i p q n : Nat) (hq : 2 ≤ q) + (hPC : PC .L1 c4 h i p q (n + 1) 0) : + PC .L2 c4 (h + 4) i (p + 1) (q - 1) n (2 * 2 ^ n - 1) := by + rcases hPC with ⟨hp1, hq1, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · cases c4 <;> + (rcases n with _ | n <;> + (try simp only [PN, pow2_succ, Nat.pow_zero, Nat.add_zero, Nat.zero_add, + Bool.false_eq_true, ↓reduceIte, and_true] at *; + (try have := pow2_pos n); omega)) + · rcases i with _ | _ | _ | i + · trivial + · try simp only [PI, pow2_succ, Nat.zero_add] at * + have := pow2_pos n; omega + · try simp only [PI, pow2_succ, Nat.zero_add] at * + have := pow2_pos n; omega + · trivial + +theorem ob_x2 (h i p q n : Nat) (hn : 1 ≤ n) (hq : 2 ≤ q) + (hPC : PC .T0 false h i p q n 0) : + PC .E1t false (h + 4) i (p + 1) (q - 1) (n + 1) (3 * 2 ^ n - 1) := by + rcases hPC with ⟨hp1, hq1, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases n with _ | n <;> + (try simp only [PN, pow2_succ, Nat.pow_zero, Nat.add_zero, Nat.zero_add, true_and] at *; + (try have := pow2_pos n); omega) + · rcases i with _ | _ | _ | i + · trivial + · try simp only [PI, pow2_succ, Nat.add_zero, Nat.zero_add] at * + have := pow2_pos n; omega + · try simp only [PI, pow2_succ, Nat.add_zero, Nat.zero_add] at * + have := pow2_pos n; omega + · trivial + +theorem ob_x2_top (h i p q : Nat) (_hi : 3 ≤ i) + (hPC : PC .T0 false h i p (q + 2) 0 0) : + PC .E1t false (h + 4) i (p + 1) (q + 1) 1 2 := by + rcases hPC with ⟨hp1, hq1, hN, _⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · try simp only [PN, pow2_succ, Nat.pow_zero, Nat.add_zero, Nat.zero_add, true_and] at * + omega + · rcases i with _ | _ | _ | i <;> (try omega); trivial + +theorem ob_x2_new (h i k : Nat) (_hi : 3 ≤ i) (hk : 3 ≤ k) : + PC .E1t false h i 3 k 0 1 := by + refine ⟨by omega, by omega, ?_, ?_⟩ + · try simp only [PN, Nat.pow_zero, and_true] + trivial + · rcases i with _ | _ | _ | i <;> (try omega); trivial + +def ovtr (ph ph' : Phase) (c4' : Bool) (Xp : Nat → Prop) : Prop := + (ph = .E2 ∧ ph' = .L1 ∧ c4' = false ∧ Xp = (fun x => x ≠ 4)) ∨ + (ph = .E2 ∧ ph' = .LX ∧ c4' = false ∧ Xp = (fun x => x = 4)) ∨ + (ph = .E2t ∧ ph' = .L1 ∧ c4' = true ∧ Xp = (fun _ => True)) ∨ + (ph = .L2 ∧ ph' = .E1 ∧ c4' = false ∧ Xp = (fun _ => True)) + +theorem ob_ov_head (ph ph' : Phase) (c4' : Bool) (Xp : Nat → Prop) (h p1 q1 n : Nat) + (htr : ovtr ph ph' c4' Xp) + (hPC : PC ph false h 1 (p1 + 2) q1 n 0) : + PC ph' c4' 2 1 (h + 5) (p1 + 1) (n + 1) (2 * (2 * 2 ^ n) - 2) := by + rcases hPC with ⟨hp1, hq1, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases htr with ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, + _⟩ <;> + (rcases n with _ | _ | n <;> + (try simp only [PN, PI, pow2_succ, Nat.pow_zero, Nat.add_zero, Nat.zero_add, + Bool.false_eq_true, ↓reduceIte, and_true] at *; + (try have := pow2_pos n); omega)) + · rcases htr with ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, + _⟩ <;> + (rcases n with _ | _ | n <;> + (try simp only [PN, PI, pow2_succ, Nat.pow_zero, Nat.add_zero, Nat.zero_add, + Bool.false_eq_true, ↓reduceIte, and_true, true_and] at *; + (try have := pow2_pos n); omega)) + +theorem ob_ov_step (ph ph' : Phase) (c4' : Bool) (Xp : Nat → Prop) (h i pp q p' q' m : Nat) + (htr : ovtr ph ph' c4' Xp) (hi : 1 ≤ i) + (hPC : PC ph false h i pp q (m + 1) 0) + (hPC' : PC ph false h (i + 1) p' q' m 0) + (hX : m = 0 → Xp p') : + PC ph' c4' 2 (i + 1) q p' (m + 1) (2 * (2 * 2 ^ m) - 1) := by + rcases hPC with ⟨hp, hq, hN, hI⟩ + rcases hPC' with ⟨hp', hq', hN', hI'⟩ + refine ⟨hq, hp', ?_, ?_⟩ + · rcases htr with ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, + rfl, rfl⟩ <;> + (rcases m with _ | _ | m <;> + (try simp only [PN, PI, pow2_succ, Nat.pow_zero, Nat.add_zero, Nat.zero_add, + Bool.false_eq_true, ↓reduceIte, and_true, true_implies] at *; + (try have := pow2_pos m); omega)) + · rcases i with _ | _ | i + · omega + · rcases htr with ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, + rfl, rfl, rfl⟩ <;> + (rcases m with _ | _ | m <;> + (try simp only [PN, PI, pow2_succ, Nat.pow_zero, Nat.add_zero, Nat.zero_add, + Bool.false_eq_true, ↓reduceIte, and_true, true_implies] at *; + (try have := pow2_pos m); omega)) + · trivial + +theorem ob_ov_base (ph ph' : Phase) (c4' : Bool) (Xp : Nat → Prop) (h i pp q t : Nat) + (htr : ovtr ph ph' c4' Xp) (hi : 1 ≤ i) + (ht1 : ph = .L2 → 2 ≤ t) (ht2 : ph ≠ .L2 → t = 1) + (hPC : PC ph false h i pp q 0 0) : + PC ph' c4' 2 (i + 1) q (t + 1) 0 1 := by + rcases hPC with ⟨hp, hq, hN, hI⟩ + refine ⟨hq, by omega, ?_, ?_⟩ + · rcases htr with ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, + _⟩ <;> + (try simp only [PN, PI, Nat.pow_zero, Nat.add_zero, Nat.zero_add, Bool.false_eq_true, + ↓reduceIte, and_true, true_implies] at *; + (try (have := ht2 (by decide); omega)) <;> (try omega)) + · rcases i with _ | _ | i + · omega + · rcases htr with ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, + _⟩ <;> + (try simp only [PN, PI, Nat.pow_zero, Nat.add_zero, Nat.zero_add, Bool.false_eq_true, + ↓reduceIte, and_true, true_implies] at *; + (try (have := ht2 (by decide); omega)) <;> (try omega)) + · trivial + +theorem ob_x1_head (h p1 q1 n : Nat) + (hPC : PC .LX false h 1 (p1 + 2) q1 (n + 2) 0) : + PC .T0 false 2 1 (h + 5) (p1 + 1) (n + 1) (2 * 2 ^ n - 2) := by + rcases hPC with ⟨hp1, hq1, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases n with _ | _ | n <;> + (try simp only [PN, PI, pow2_succ, Nat.pow_zero, Nat.add_zero, Nat.zero_add] at *; + (try have := pow2_pos n); omega) + · rcases n with _ | _ | n <;> + (try simp only [PN, PI, pow2_succ, Nat.pow_zero, Nat.add_zero, Nat.zero_add, true_and] at *; + (try have := pow2_pos n); omega) + +theorem ob_x1_step (h i pp q p' q' m : Nat) (hi : 1 ≤ i) + (hPC : PC .LX false h i pp q (m + 3) 0) + (hPC' : PC .LX false h (i + 1) p' q' (m + 2) 0) : + PC .T0 false 2 (i + 1) q p' (m + 1) (2 * 2 ^ m - 1) := by + rcases hPC with ⟨hp, hq, hN, hI⟩ + rcases hPC' with ⟨hp', hq', hN', hI'⟩ + refine ⟨hq, hp', ?_, ?_⟩ + · rcases m with _ | m <;> + (try simp only [PN, PI, pow2_succ, Nat.pow_zero, Nat.add_zero, Nat.zero_add] at *; + (try have := pow2_pos m); omega) + · rcases i with _ | _ | i + · omega + · rcases m with _ | m <;> + (try simp only [PN, PI, pow2_succ, Nat.pow_zero, Nat.add_zero, Nat.zero_add] at *; + (try have := pow2_pos m); omega) + · trivial + +theorem ob_x1_base (h i pp q pa : Nat) (hi : 1 ≤ i) + (hPC : PC .LX false h i pp q 2 0) + (hPC' : PC .LX false h (i + 1) (pa + 1) 1 1 0) : + PC .T0 false 2 (i + 1) q (pa + 1) 0 0 := by + rcases hPC with ⟨hp, hq, hN, hI⟩ + rcases hPC' with ⟨hp', hq', hN', hI'⟩ + refine ⟨hq, by omega, ?_, ?_⟩ + · try simp only [PN, pow2_succ, Nat.pow_zero, Nat.add_zero, Nat.zero_add, and_true, true_and] at * + omega + · rcases i with _ | _ | i + · omega + · try simp only [PN, PI, pow2_succ, Nat.pow_zero, Nat.add_zero, Nat.zero_add, and_true] at * + omega + · trivial + +theorem ovp_len (q : Nat) (Z : List Tri) (t : Nat) : (ovp q Z t).length = Z.length + 1 := by + induction Z generalizing q with + | nil => rfl + | cons x Z ih => rcases x with ⟨p, q', d⟩; dsimp [ovp, List.length]; rw [ih] + +theorem ovp_dv (q : Nat) (Z : List Tri) (t : Nat) : dv (ovp q Z t) + 1 = 2 ^ (Z.length + 1) := by + induction Z generalizing q with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p, q', d⟩ + dsimp [ovp, dv, bv, List.length] + have ih' := ih q' + rw [pow2_succ (Z.length + 1)] + omega + +theorem ovpX_len (q : Nat) (Z : List Tri) (pa : Nat) : (ovpX q Z pa).length = Z.length + 1 := by + induction Z generalizing q with + | nil => rfl + | cons x Z ih => rcases x with ⟨p, q', d⟩; dsimp [ovpX, List.length]; rw [ih] + +theorem ovpX_dv (q : Nat) (Z : List Tri) (pa : Nat) : dv (ovpX q Z pa) + 1 = 2 ^ Z.length := by + induction Z generalizing q with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p, q', d⟩ + dsimp [ovpX, dv, bv, List.length] + have ih' := ih q' + rw [pow2_succ Z.length] + omega + +def lastOK (Xp : Nat → Prop) : List Tri → Prop + | [] => True + | [(p, _, _)] => Xp p + | _ :: Z' => lastOK Xp Z' + +theorem lastOK_cons (Xp : Nat → Prop) (p q : Nat) (d : Bool) (Z : List Tri) + (h : lastOK Xp ((p, q, d) :: Z)) : (Z = [] → Xp p) ∧ lastOK Xp Z := by + cases Z with + | nil => exact ⟨fun _ => h, trivial⟩ + | cons z Z' => exact ⟨(fun h' => by nomatch h'), h⟩ + +theorem lastOK_dec (Z : List Tri) : lastOK (fun x => x = 4) Z ∨ lastOK (fun x => x ≠ 4) Z := by + induction Z with + | nil => exact Or.inl trivial + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + cases Z with + | nil => + dsimp [lastOK] + if h : p = 4 then exact Or.inl h else exact Or.inr h + | cons z Z' => exact ih + +theorem lastOK_True (Z : List Tri) : lastOK (fun _ => True) Z := by + induction Z with + | nil => trivial + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + cases Z with + | nil => trivial + | cons z Z' => exact ih + +theorem All0_app (Z R : List Tri) : All0 (Z ++ R) ↔ All0 Z ∧ All0 R := by + induction Z with + | nil => dsimp [All0]; exact ⟨fun h => ⟨trivial, h⟩, fun h => h.2⟩ + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + dsimp [All0] + rw [ih] + exact ⟨fun ⟨h1, h2, h3⟩ => ⟨⟨h1, h2⟩, h3⟩, fun ⟨⟨h1, h2⟩, h3⟩ => ⟨h1, h2, h3⟩⟩ + +theorem AllI_ovp (ph ph' : Phase) (c4' : Bool) (Xp : Nat → Prop) (h t : Nat) + (htr : ovtr ph ph' c4' Xp) (ht1 : ph = .L2 → 2 ≤ t) (ht2 : ph ≠ .L2 → t = 1) : + ∀ (Z : List Tri) (i pp q : Nat), + 1 ≤ i → All0 Z → lastOK Xp Z → PC ph false h i pp q Z.length 0 → + AllI (PCx ph false h) (i + 1) Z → AllI (PCx ph' c4' 2) (i + 1) (ovp q Z t) := by + intro Z + induction Z with + | nil => + intro i pp q hi _ _ hPC _ + dsimp [ovp, AllI, PCx, List.length, dv, bv] + exact ⟨ob_ov_base ph ph' c4' Xp h i pp q t htr hi ht1 ht2 hPC, trivial⟩ + | cons x Z ih => + rcases x with ⟨p', q', d'⟩ + intro i pp q hi hZ hX hPC hA + rcases hZ with ⟨rfl, hZ'⟩ + rcases hA with ⟨hH, hA'⟩ + have ⟨hX1, hX2⟩ := lastOK_cons Xp p' q' false Z hX + dsimp [PCx] at hH + rw [dv_zero ((p', q', false) :: Z) ⟨rfl, hZ'⟩] at hH + dsimp [ovp, AllI] + refine ⟨?_, ih (i + 1) p' q' (by omega) hZ' hX2 hH hA'⟩ + dsimp [PCx] + rw [ovp_len] + have hdv : dv ((q, p', true) :: ovp q' Z t) = 2 * (2 * 2 ^ Z.length) - 1 := by + dsimp [dv, bv] + have E := ovp_dv q' Z t + rw [pow2_succ] at E + omega + rw [hdv] + apply ob_ov_step ph ph' c4' Xp h i pp q p' q' Z.length htr hi hPC hH + intro hm + apply hX1 + cases Z with + | nil => rfl + | cons _ _ => dsimp [List.length] at hm; omega + +theorem AllI_ovpX (h pa pb : Nat) : + ∀ (Z : List Tri) (i pp q : Nat), + 1 ≤ i → All0 Z → + PC .LX false h i pp q (Z.length + 2) 0 → + AllI (PCx .LX false h) (i + 1) (Z ++ [(pa + 1, 1, false), (pb, 1, false)]) → + AllI (PCx .T0 false 2) (i + 1) (ovpX q Z (pa + 1)) := by + intro Z + induction Z with + | nil => + intro i pp q hi _ hPC hA + dsimp [ovpX, AllI, List.append] at hA ⊢ + rcases hA with ⟨hHa, _⟩ + dsimp [PCx, List.length, dv, bv] at hHa ⊢ + exact ⟨ob_x1_base h i pp q pa hi hPC hHa, trivial⟩ + | cons x Z ih => + rcases x with ⟨p', q', d'⟩ + intro i pp q hi hZ hPC hA + rcases hZ with ⟨rfl, hZ'⟩ + dsimp [List.append, AllI] at hA + rcases hA with ⟨hH, hA'⟩ + dsimp [PCx] at hH + have hZall : All0 ((p', q', false) :: (Z ++ [(pa + 1, 1, false), (pb, 1, false)])) := by + refine ⟨rfl, (All0_app Z _).mpr ⟨hZ', rfl, rfl, trivial⟩⟩ + rw [dv_zero _ hZall, List.length_append] at hH + dsimp [List.length] at hH + dsimp [ovpX, AllI] + refine ⟨?_, ih (i + 1) p' q' (by omega) hZ' hH hA'⟩ + dsimp [PCx] + rw [ovpX_len] + have hdv : dv ((q, p', true) :: ovpX q' Z (pa + 1)) = 2 * 2 ^ Z.length - 1 := by + dsimp [dv, bv] + have E := ovpX_dv q' Z (pa + 1) + omega + rw [hdv] + exact ob_x1_step h i pp q p' q' Z.length hi hPC hH + +theorem passq (ph : Phase) (c4 : Bool) (h i p q n tv : Nat) + (hPC : PC ph c4 h i p q n tv) (ht : 2 ≤ tv) (ht2 : tv % 2 = 0) : 2 ≤ q := by + rcases hPC with ⟨_, _, hN, _⟩ + cases ph <;> cases c4 <;> + (rcases n with _ | _ | n <;> + (simp only [PN, pow2_succ, Bool.false_eq_true, ↓reduceIte] at *; + (try have := pow2_pos n); omega)) + +theorem Z_okL (ph : Phase) (c4 : Bool) (h : Nat) : + ∀ (Z : List Tri) (i : Nat) (x : Tri) (R : List Tri), + All0 Z → dig x = true → AllI (PCx ph c4 h) i (Z ++ x :: R) → ∀ y ∈ Z, okL y := by + intro Z + induction Z with + | nil => intro _ _ _ _ _ _ y hy; nomatch hy + | cons z Z ih => + rcases z with ⟨p, q, d⟩ + intro i x R hZ hx hA + rcases hZ with ⟨rfl, hZ'⟩ + rcases hA with ⟨hH, hA'⟩ + intro y hy + rcases List.mem_cons.mp hy with rfl | hyZ + · refine ⟨rfl, ?_⟩ + dsimp [PCx] at hH + apply passq ph c4 h i p q (Z ++ x :: R).length (dv ((p, q, false) :: (Z ++ x :: R))) hH + · dsimp [dv, bv] + rw [dv_zeros Z (x :: R) hZ'] + rcases x with ⟨px, qx, dx⟩ + dsimp [dig] at hx; subst hx + dsimp [dv, bv] + have hp := pow2_pos Z.length + have hpos : 2 ^ Z.length * (1 + 2 * dv R) ≥ 1 := Nat.mul_pos hp (by omega) + omega + · dsimp [dv, bv]; omega + · exact ih (i + 1) x R hZ' hx hA' y hyZ + +theorem borrow1 (ph : Phase) (c4 : Bool) (h k p n tv : Nat) + (hk : 1 ≤ k) (ht : tv % 2 = 1) (hPC : PC ph c4 h k p 1 n tv) : + (ph = .L1 ∨ ph = .L2 ∨ ph = .LX) ∧ 3 ≤ k ∧ + (ph = .L1 → 1 ≤ n ∧ tv + 1 ≤ 2 ^ n ∧ (c4 = true → 2 ≤ n)) ∧ (ph = .LX → 2 ≤ n) := by + rcases hPC with ⟨hp, hq, hN, hI⟩ + have hph : ph = .L1 ∨ ph = .L2 ∨ ph = .LX := by + cases ph <;> (try exact Or.inl rfl) <;> (try exact Or.inr (Or.inl rfl)) <;> + (try exact Or.inr (Or.inr rfl)) + all_goals (exfalso; rcases n with _ | n <;> + (simp only [PN, pow2_succ] at *; + (try have := pow2_pos n); omega)) + refine ⟨hph, ?_, ?_, ?_⟩ + · rcases k with _ | _ | _ | k + · omega + · rcases hph with rfl | rfl | rfl <;> + (simp only [PI] at hI; have := pow2_pos n; omega) + · rcases hph with rfl | rfl | rfl <;> + (simp only [PI] at hI; have := pow2_pos n; omega) + · omega + · intro hL1; subst hL1 + cases c4 <;> + (rcases n with _ | _ | n <;> + (simp only [PN, pow2_succ, Bool.false_eq_true, ↓reduceIte] at *; + (try have := pow2_pos n); + refine ⟨by omega, by omega, fun hc => by cases hc <;> omega⟩)) + · intro hLX; subst hLX + rcases n with _ | _ | n <;> + (simp only [PN, pow2_succ] at *; + (try have := pow2_pos n); omega) + +theorem inv_Dec (ph : Phase) (c4 : Bool) (h : Nat) (Z : List Tri) (p q : Nat) (R : List Tri) + (hZ : All0 Z) + (hA : AllI (PCx ph c4 h) 1 (Z ++ (p, q + 2, true) :: R)) : + AllI (PCx ph c4 (h + 4)) 1 (Z.map touch ++ (p + 1, q + 1, false) :: R) := by + have hB := AllI_app (PCx ph c4 h) Z 1 ((p, q + 2, true) :: R) hA + dsimp [AllI] at hB + rcases hB with ⟨hx, hR⟩ + apply AllI_touchZ (PCx ph c4 h) (PCx ph c4 (h + 4)) ((p, q + 2, true) :: R) ((p + 1, q + 1, + false) :: R) Z 1 hZ _ hA + · refine ⟨?_, ?_⟩ + · dsimp [PCx, dv, bv] at hx ⊢ + have heq : 0 + 2 * dv R = (1 + 2 * dv R) - 1 := by omega + rw [heq] + exact ob_touch ph c4 h (1 + Z.length) p (q + 2) R.length (1 + 2 * dv R) (by omega) (by omega) + hx + · apply AllI_mono _ _ R ((1 + Z.length) + 1) _ hR + intro j y Y hj hy + rcases y with ⟨py, qy, dy⟩ + dsimp [PCx] at hy ⊢ + exact ob_far2 ph c4 h (h + 4) j py qy Y.length (dv ((py, qy, dy) :: Y)) (by omega) hy + · intro j p0 q0 Zr hZr hj h0 + dsimp [PCx] at h0 ⊢ + rw [List.length_append, List.length_cons] at h0 + rw [List.length_append, List.length_map, List.length_cons] + dsimp [dv, bv] at h0 ⊢ + rw [dv_zeros Zr ((p, q + 2, true) :: R) hZr] at h0 + rw [dv_tz' Zr ((p + 1, q + 1, false) :: R) hZr] + dsimp [dv, bv] at h0 ⊢ + simp only [Nat.zero_add] at h0 ⊢ + have hp := pow2_pos Zr.length + have hmul : 2 ^ Zr.length * (1 + 2 * dv R) = 2 ^ Zr.length + 2 ^ Zr.length * (2 * dv R) := by + ring + have heq2 : 1 + 2 * (2 ^ Zr.length - 1 + 2 ^ Zr.length * (2 * dv R)) = + 2 * (2 ^ Zr.length * (1 + 2 * dv R)) - 1 := by omega + rw [heq2] + apply ob_touch ph c4 h j p0 q0 (Zr.length + (R.length + 1)) (2 * (2 ^ Zr.length * (1 + 2 * dv + R))) + · omega + · apply passq ph c4 h j p0 q0 (Zr.length + (R.length + 1)) (2 * (2 ^ Zr.length * (1 + 2 * dv + R))) h0 + · omega + · omega + · exact h0 + +def minlen : Phase → Nat + | .LX => 3 + | .L2 => 1 + | _ => 2 + +theorem head_len (ph : Phase) (c4 : Bool) (h : Nat) (x : Tri) (Y : List Tri) + (hPCx : PCx ph c4 h 1 x Y) : minlen ph ≤ Y.length := by + rcases x with ⟨p, q, d⟩ + rcases hPCx with ⟨_, _, _, hI⟩ + cases ph <;> (simp only [PI, minlen] at hI ⊢; omega) + +theorem AllI_len (ph : Phase) (c4 : Bool) (h : Nat) (P : List Tri) (hP : P ≠ []) + (hA : AllI (PCx ph c4 h) 1 P) : minlen ph + 1 ≤ P.length := by + cases P with + | nil => exact absurd rfl hP + | cons x Y => + rcases hA with ⟨h1, _⟩ + have := head_len ph c4 h x Y h1 + dsimp [List.length] + omega + +theorem q2_V0 (ph : Phase) (c4 : Bool) (h i p q n : Nat) + (hPC : PC ph c4 h i p q n 0) (hn : 1 ≤ n) (hX : ph = .LX → 2 ≤ n) : 2 ≤ q := by + rcases hPC with ⟨_, _, hN, _⟩ + cases ph <;> cases c4 <;> + (rcases n with _ | _ | n <;> + (try simp only [PN, pow2_succ, Nat.pow_zero, Nat.add_zero, Nat.zero_add, Bool.false_eq_true, + ↓reduceIte, and_true, true_and, true_implies] at *; + (try have := pow2_pos n); omega)) + +theorem p1_V0 (ph : Phase) (c4 : Bool) (h p q n : Nat) + (hPC : PC ph c4 h 1 p q n 0) (hph : ph = .E2 ∨ ph = .E2t ∨ ph = .L2 ∨ ph = .LX) : 2 ≤ p := by + rcases hPC with ⟨_, _, hN, hI⟩ + rcases hph with rfl | rfl | rfl | rfl <;> cases c4 <;> + (rcases n with _ | _ | n <;> + (try simp only [PN, PI, pow2_succ, Nat.pow_zero, Nat.add_zero, Nat.zero_add, + Bool.false_eq_true, ↓reduceIte, and_true] at *; + (try have := pow2_pos n); omega)) + +theorem L2_c4_V0 (h i p q : Nat) (hPC : PC .L2 true h i p q 0 0) : False := by + rcases hPC with ⟨_, _, hN, _⟩ + simp only [PN, ↓reduceIte] at hN + omega + +theorem AllI_okRO (ph : Phase) (c4 : Bool) (h : Nat) : + ∀ (Z : List Tri) (i : Nat), All0 Z → AllI (PCx ph c4 h) i Z → (∀ x ∈ Z, okR x) ∧ (∀ x ∈ Z, + okO x) := by + intro Z + induction Z with + | nil => intro _ _ _; exact ⟨(fun _ h => by nomatch h), (fun _ h => by nomatch h)⟩ + | cons z Z ih => + rcases z with ⟨p, q, d⟩ + intro i hZ hA + rcases hZ with ⟨rfl, hZ'⟩ + rcases hA with ⟨hH, hA'⟩ + rcases hH with ⟨hp, hq, _⟩ + have ⟨hR, hO⟩ := ih (i + 1) hZ' hA' + refine ⟨?_, ?_⟩ + · intro x hx + rcases List.mem_cons.mp hx with rfl | hxZ + · exact ⟨rfl, hq⟩ + · exact hR x hxZ + · intro x hx + rcases List.mem_cons.mp hx with rfl | hxZ + · exact ⟨hp, hq⟩ + · exact hO x hxZ + +theorem inv_Merge (ph : Phase) (c4 : Bool) (h : Nat) (Z : List Tri) (p p' q' : Nat) (d' : Bool) + (R0 : List Tri) + (hZ : All0 Z) + (hA : AllI (PCx ph c4 h) 1 (Z ++ (p, 1, true) :: (p', q', d') :: R0)) : + AllI (PCx ph c4 (h + 4)) 1 (Z.map touch ++ (p + p' + 3, q', d') :: R0) := by + have hB := AllI_app (PCx ph c4 h) Z 1 ((p, 1, true) :: (p', q', d') :: R0) hA + dsimp [AllI] at hB + rcases hB with ⟨hx, hy, hR⟩ + have hlt := dv_lt ((p', q', d') :: R0) + dsimp [List.length] at hlt + rw [pow2_succ] at hlt + set Hd := dv ((p', q', d') :: R0) + have hx' : PC ph c4 h (1 + Z.length) p 1 (R0.length + 1) (1 + 2 * Hd) := hx + have ⟨hph, hk, hL1, hLX⟩ := + borrow1 ph c4 h (1 + Z.length) p (R0.length + 1) (1 + 2 * Hd) (by omega) (by omega) hx' + apply AllI_touchZ (PCx ph c4 h) (PCx ph c4 (h + 4)) ((p, 1, true) :: (p', q', + d') :: R0) ((p + p' + 3, q', d') :: R0) Z 1 hZ _ hA + · refine ⟨?_, ?_⟩ + · dsimp [PCx] at hy ⊢ + have hdv : dv ((p + p' + 3, q', d') :: R0) = dv ((p', q', d') :: R0) := rfl + rw [hdv] + exact ob_fuse ph c4 h (h + 4) (1 + Z.length) p p' q' R0.length Hd hph hk hy + · apply AllI_shift _ _ R0 ((1 + Z.length) + 1) _ hR + intro j y Y hj hy0 + rcases y with ⟨py, qy, dy⟩ + dsimp [PCx] at hy0 ⊢ + exact ob_far ph c4 h (h + 4) (j + 1) j py qy Y.length (dv ((py, qy, + dy) :: Y)) (by omega) (by omega) hy0 + · intro j p0 q0 Zr hZr hj h0 + dsimp [PCx] at h0 ⊢ + rw [List.length_append, List.length_cons, List.length_cons] at h0 + rw [List.length_append, List.length_map, List.length_cons] + dsimp [dv, bv] at h0 ⊢ + rw [dv_zeros Zr ((p, 1, true) :: (p', q', d') :: R0) hZr] at h0 + rw [dv_tz' Zr ((p + p' + 3, q', d') :: R0) hZr] + dsimp [dv, bv] at h0 ⊢ + have hHd : (if d' = true then 1 else 0) + 2 * dv R0 = Hd := rfl + rw [hHd] at h0 ⊢ + set A := 2 ^ Zr.length + set B := 2 ^ R0.length + have hA1 : 1 ≤ A := pow2_pos Zr.length + have hB1 : 1 ≤ B := pow2_pos R0.length + have hpow_sum : 2 ^ (Zr.length + (R0.length + 1)) = A * (2 * B) := by + rw [Nat.pow_add, pow2_succ] + have hlen_eq : Zr.length + (R0.length + 1 + 1) = (Zr.length + (R0.length + 1)) + 1 := by omega + rw [hlen_eq] at h0 + have htv_in : 0 + 2 * (A * (1 + 2 * Hd)) = 2 * A + 2 * (2 * A * Hd) := by ring + rw [htv_in] at h0 + have htv_out : 1 + 2 * (A - 1 + A * Hd) = (2 * A - 1) + 2 * (A * Hd) := by omega + rw [show 2 * (A * Hd) = 2 * A * Hd by ring] at htv_out + rw [htv_out] + have hq2 : 2 ≤ q0 := by + apply passq ph c4 h j p0 q0 ((Zr.length + (R0.length + 1)) + 1) (2 * A + 2 * (2 * A * Hd)) h0 + · omega + · omega + have hUu_bound : 2 * A * Hd + 2 * A ≤ 2 * 2 ^ (Zr.length + (R0.length + 1)) := by + rw [hpow_sum, show 2 * A * Hd + 2 * A = (2 * A) * (Hd + 1) by ring, + show 2 * (A * (2 * B)) = (2 * A) * (2 * B) by ring] + exact Nat.mul_le_mul_left (2 * A) (by omega) + apply ob_merge ph c4 h j p0 q0 (Zr.length + (R0.length + 1)) (2 * A) (2 * A * Hd) hph + (by omega) (by omega) (by omega) (by omega) hUu_bound + · intro hph1 + have ⟨_, hb, _⟩ := hL1 hph1 + rw [pow2_succ] at hb + rw [hpow_sum, show 2 * A * Hd + 2 * A = (2 * A) * (Hd + 1) by ring, + show A * (2 * B) = (2 * A) * B by ring] + exact Nat.mul_le_mul_left (2 * A) (by omega) + · intro hphX; have := hLX hphX; omega + · intro hph1 hc4; have ⟨_, _, hc2⟩ := hL1 hph1; have := hc2 hc4; omega + · intro hj1; omega + · intro hphX hj1; have := hLX hphX; omega + · exact hq2 + · exact h0 + +theorem inv_MT (c4 : Bool) (h : Nat) (Z : List Tri) (p : Nat) + (hZ : All0 Z) (hA : AllI (PCx .L2 c4 h) 1 (Z ++ [(p, 1, true)])) : + AllI (PCx .L2 false (h + 4)) 1 (Z.map touch) ∧ 2 ≤ Z.length := by + have hB := AllI_app (PCx .L2 c4 h) Z 1 [(p, 1, true)] hA + dsimp [AllI] at hB + rcases hB with ⟨hx, _⟩ + have ⟨_, hk, _⟩ := borrow1 .L2 c4 h (1 + Z.length) p 0 1 (by omega) (by decide) hx + refine ⟨?_, by omega⟩ + rw [← List.append_nil (Z.map touch)] + apply AllI_touchZ (PCx .L2 c4 h) (PCx .L2 false (h + 4)) [(p, 1, true)] [] Z 1 hZ _ hA trivial + intro j p0 q0 Zr hZr hj h0 + dsimp [PCx] at h0 ⊢ + rw [List.length_append, List.length_singleton] at h0 + rw [List.length_append, List.length_map, List.length_nil, Nat.add_zero] + dsimp [dv, bv] at h0 ⊢ + rw [dv_zeros Zr [(p, 1, true)] hZr] at h0 + rw [dv_tz' Zr [] hZr] + dsimp [dv, bv] at h0 ⊢ + have hp := pow2_pos Zr.length + have hin : 0 + 2 * (2 ^ Zr.length * 1) = 2 * 2 ^ Zr.length := by ring + rw [hin] at h0 + have hout : 1 + 2 * (2 ^ Zr.length - 1) = 2 * 2 ^ Zr.length - 1 := by omega + rw [hout] + apply ob_mt c4 h j p0 q0 Zr.length _ (by omega) h0 + exact passq .L2 c4 h j p0 q0 (Zr.length + 1) (2 * 2 ^ Zr.length) h0 (by omega) (by omega) + +theorem snoc_nn {α : Type*} (Z : List α) (y : α) : Z ++ [y] ≠ [] := by + cases Z <;> intro h <;> nomatch h + +theorem inv_End (ph ph' : Phase) (h : Nat) (Z : List Tri) (p q : Nat) + (htr : endtr ph ph') (hZ : All0 Z) + (hA : AllI (PCx ph false h) 1 (Z ++ [(p, q + 2, false)])) : + AllI (PCx ph' false (h + 4)) 1 (Z.map touch ++ [(p + 1, q + 1, false)]) := by + have hlen := AllI_len ph false h (Z ++ [(p, q + 2, false)]) (snoc_nn Z _) hA + rw [List.length_append, List.length_singleton] at hlen + have hm : minlen ph = 2 := by rcases htr with ⟨rfl, _⟩ | ⟨rfl, _⟩ <;> rfl + have hB := AllI_app (PCx ph false h) Z 1 [(p, q + 2, false)] hA + dsimp [AllI] at hB + rcases hB with ⟨hx, _⟩ + apply AllI_touchZ (PCx ph false h) (PCx ph' false (h + 4)) [(p, q + 2, false)] [(p + 1, q + 1, + false)] Z 1 hZ _ hA + · dsimp [AllI, PCx, List.length, dv, bv] at hx ⊢ + exact ⟨ob_end_top ph ph' h (1 + Z.length) p q htr (by omega) hx, trivial⟩ + · intro j p0 q0 Zr hZr hj h0 + dsimp [PCx] at h0 ⊢ + rw [List.length_append, List.length_singleton] at h0 + rw [List.length_append, List.length_map, List.length_singleton] + dsimp [dv, bv] at h0 ⊢ + rw [dv_zeros Zr [(p, q + 2, false)] hZr] at h0 + rw [dv_tz' Zr [(p + 1, q + 1, false)] hZr] + dsimp [dv, bv] at h0 ⊢ + have hp := pow2_pos Zr.length + have hout : 1 + 2 * (2 ^ Zr.length - 1) = 2 ^ (Zr.length + 1) - 1 := by + rw [pow2_succ]; omega + rw [hout] + apply ob_end ph ph' h j p0 q0 (Zr.length + 1) htr (by omega) _ h0 + apply q2_V0 ph false h j p0 q0 (Zr.length + 1) h0 (by omega) + intro hLX; rcases htr with ⟨rfl, _⟩ | ⟨rfl, _⟩ <;> nomatch hLX + +theorem inv_X2 (h : Nat) (Z : List Tri) (p q k : Nat) (hZ : All0 Z) (hk : 3 ≤ k) + (hA : AllI (PCx .T0 false h) 1 (Z ++ [(p, q + 2, false)])) : + AllI (PCx .E1t false (h + 4)) 1 (Z.map touch ++ [(p + 1, q + 1, false), (3, k, true)]) := by + have hlen := AllI_len .T0 false h (Z ++ [(p, q + 2, false)]) (snoc_nn Z _) hA + rw [List.length_append, List.length_singleton] at hlen + dsimp [minlen] at hlen + have hB := AllI_app (PCx .T0 false h) Z 1 [(p, q + 2, false)] hA + dsimp [AllI] at hB + rcases hB with ⟨hx, _⟩ + apply AllI_touchZ (PCx .T0 false h) (PCx .E1t false (h + 4)) [(p, q + 2, false)] [(p + 1, q + 1, + false), (3, k, true)] Z 1 hZ _ hA + · dsimp [AllI, PCx, List.length, dv, bv] at hx ⊢ + refine ⟨ob_x2_top h (1 + Z.length) p q (by omega) hx, + ob_x2_new (h + 4) ((1 + Z.length) + 1) k (by omega) hk, trivial⟩ + · intro j p0 q0 Zr hZr hj h0 + dsimp [PCx] at h0 ⊢ + rw [List.length_append, List.length_singleton] at h0 + rw [List.length_append, List.length_map] + dsimp [List.length, dv, bv] at h0 ⊢ + rw [dv_zeros Zr [(p, q + 2, false)] hZr] at h0 + rw [dv_tz' Zr [(p + 1, q + 1, false), (3, k, true)] hZr] + dsimp [dv, bv] at h0 ⊢ + have hp := pow2_pos Zr.length + have hout : 1 + 2 * (2 ^ Zr.length - 1 + 2 ^ Zr.length * 2) = 3 * 2 ^ (Zr.length + 1) - 1 := by + rw [pow2_succ]; omega + rw [hout] + have hlen_eq : Zr.length + 2 = (Zr.length + 1) + 1 := rfl + rw [hlen_eq] + apply ob_x2 h j p0 q0 (Zr.length + 1) (by omega) _ h0 + exact q2_V0 .T0 false h j p0 q0 (Zr.length + 1) h0 (by omega) (fun h => by nomatch h) + +theorem inv_EndLast (c4 : Bool) (h : Nat) (Z : List Tri) (p : Nat) + (hZ : All0 Z) (hA : AllI (PCx .L1 c4 h) 1 (Z ++ [(p, 1, false)])) : + AllI (PCx .L2 c4 (h + 4)) 1 (Z.map touch) ∧ 2 ≤ Z.length := by + have hlen := AllI_len .L1 c4 h (Z ++ [(p, 1, false)]) (snoc_nn Z _) hA + rw [List.length_append, List.length_singleton] at hlen + dsimp [minlen] at hlen + refine ⟨?_, by omega⟩ + rw [← List.append_nil (Z.map touch)] + apply AllI_touchZ (PCx .L1 c4 h) (PCx .L2 c4 (h + 4)) [(p, 1, false)] [] Z 1 hZ _ hA trivial + intro j p0 q0 Zr hZr hj h0 + dsimp [PCx] at h0 ⊢ + rw [List.length_append, List.length_singleton] at h0 + rw [List.length_append, List.length_map, List.length_nil, Nat.add_zero] + dsimp [dv, bv] at h0 ⊢ + rw [dv_zeros Zr [(p, 1, false)] hZr] at h0 + rw [dv_tz' Zr [] hZr] + dsimp [dv, bv] at h0 ⊢ + have hp := pow2_pos Zr.length + have hout : 1 + 2 * (2 ^ Zr.length - 1) = 2 * 2 ^ Zr.length - 1 := by omega + rw [hout] + apply ob_endlast c4 h j p0 q0 Zr.length _ h0 + exact q2_V0 .L1 c4 h j p0 q0 (Zr.length + 1) h0 (by omega) (fun h => by nomatch h) + +theorem inv_Ov (ph ph' : Phase) (c4' : Bool) (Xp : Nat → + Prop) (h p1 q1 : Nat) (Z : List Tri) (t : Nat) + (htr : ovtr ph ph' c4' Xp) (ht1 : ph = .L2 → 2 ≤ t) (ht2 : ph ≠ .L2 → t = 1) + (hZ : All0 Z) (hX : lastOK Xp Z) + (hA : AllI (PCx ph false h) 1 ((p1 + 2, q1, false) :: Z)) : + AllI (PCx ph' c4' 2) 1 ((h + 5, p1 + 1, false) :: ovp q1 Z t) := by + dsimp [AllI] at hA ⊢ + rcases hA with ⟨hH, hA'⟩ + have hH' := hH + dsimp [PCx] at hH' + rw [dv_zero ((p1 + 2, q1, false) :: Z) ⟨rfl, hZ⟩] at hH' + refine ⟨?_, AllI_ovp ph ph' c4' Xp h t htr ht1 ht2 Z 1 (p1 + 2) q1 (by omega) hZ hX hH' hA'⟩ + dsimp [PCx] + rw [ovp_len] + have hdv : dv ((h + 5, p1 + 1, false) :: ovp q1 Z t) = 2 * (2 * 2 ^ Z.length) - 2 := by + dsimp [dv, bv] + have E := ovp_dv q1 Z t + rw [pow2_succ] at E + omega + rw [hdv] + exact ob_ov_head ph ph' c4' Xp h p1 q1 Z.length htr hH' + +theorem inv_X1 (h p1 q1 : Nat) (Z : List Tri) (pa pb : Nat) (hZ : All0 Z) + (hA : AllI (PCx .LX false h) 1 ((p1 + 2, q1, false) :: Z ++ [(pa + 1, 1, false), (pb, 1, + false)])) : + AllI (PCx .T0 false 2) 1 ((h + 5, p1 + 1, false) :: ovpX q1 Z (pa + 1)) := by + dsimp [List.cons_append, AllI] at hA ⊢ + rcases hA with ⟨hH, hA'⟩ + have hH' := hH + dsimp [PCx] at hH' + have hZall : All0 ((p1 + 2, q1, false) :: (Z ++ [(pa + 1, 1, false), (pb, 1, false)])) := + ⟨rfl, (All0_app Z _).mpr ⟨hZ, rfl, rfl, trivial⟩⟩ + rw [dv_zero _ hZall, List.length_append] at hH' + dsimp [List.length] at hH' + refine ⟨?_, AllI_ovpX h pa pb Z 1 (p1 + 2) q1 (by omega) hZ hH' hA'⟩ + dsimp [PCx] + rw [ovpX_len] + have hdv : dv ((h + 5, p1 + 1, false) :: ovpX q1 Z (pa + 1)) = 2 * 2 ^ Z.length - 2 := by + dsimp [dv, bv] + have E := ovpX_dv q1 Z (pa + 1) + omega + rw [hdv] + exact ob_x1_head h p1 q1 Z.length hH' + +structure St where + sh : Nat + sP : List Tri + sT : Tl + sph : Phase + sc4 : Bool + +def Cf (s : St) : Cfg (Fin 2) (Fin 6) := K s.sh s.sP s.sT + +def TC (ph : Phase) (c4 : Bool) (T : Tl) : Prop := + match ph with + | .E1 | .E1t | .LX => T = .TN ∧ c4 = false + | .L1 => T = .TN + | .E2 | .E2t => T = .TA 1 ∧ c4 = false + | .T0 => (∃ k, T = .TB k ∧ 3 ≤ k) ∧ c4 = false + | .L2 => ∃ t, T = .TA t ∧ 2 ≤ t + +def J (s : St) : Prop := + s.sP ≠ [] ∧ TC s.sph s.sc4 s.sT ∧ AllI (PCx s.sph s.sc4 s.sh) 1 s.sP + +theorem split1 (P : List Tri) : + (∃ Z x R, P = Z ++ x :: R ∧ All0 Z ∧ dig x = true) ∨ All0 P := by + induction P with + | nil => exact Or.inr trivial + | cons x P ih => + rcases x with ⟨p, q, d⟩ + cases d + · rcases ih with ⟨Z, x', R, rfl, hZ, hx'⟩ | h0 + · exact Or.inl ⟨(p, q, false) :: Z, x', R, rfl, ⟨rfl, hZ⟩, hx'⟩ + · exact Or.inr ⟨rfl, h0⟩ + · exact Or.inl ⟨[], (p, q, true), P, rfl, trivial, rfl⟩ + +theorem exists_last {α : Type*} : ∀ (l : List α), l ≠ [] → ∃ Z y, l = Z ++ [y] + | [], h => absurd rfl h + | [x], _ => ⟨[], x, rfl⟩ + | x :: y :: rest, _ => + let ⟨Z, z, hZ⟩ := exists_last (y :: rest) (by intro h; nomatch h) + ⟨x :: Z, z, by rw [hZ]; rfl⟩ + +theorem Z_okL_V0 (ph : Phase) (c4 : Bool) (h : Nat) (y : Tri) (hph : ph ≠ .LX) : + ∀ (Z : List Tri) (i : Nat), All0 (Z ++ [y]) → AllI (PCx ph c4 h) i (Z ++ [y]) → ∀ x ∈ Z, + okL x := by + intro Z + induction Z with + | nil => intro _ _ _ x hx; nomatch hx + | cons z Z ih => + rcases z with ⟨p, q, d⟩ + intro i hZ hA + rcases hZ with ⟨rfl, hZ'⟩ + rcases hA with ⟨hH, hA'⟩ + intro x hx + rcases List.mem_cons.mp hx with rfl | hxZ + · refine ⟨rfl, ?_⟩ + dsimp [PCx] at hH + rw [dv_zero ((p, q, false) :: (Z ++ [y])) ⟨rfl, hZ'⟩, List.length_append, + List.length_singleton] at hH + exact q2_V0 ph c4 h i p q (Z.length + 1) hH (by omega) (fun h => absurd h hph) + · exact ih (i + 1) hZ' hA' x hxZ + +theorem last_pc (ph : Phase) (c4 : Bool) (h : Nat) (Z : List Tri) (p q : Nat) (d : Bool) + (hZ : All0 (Z ++ [(p, q, d)])) (hA : AllI (PCx ph c4 h) 1 (Z ++ [(p, q, d)])) : + d = false ∧ PC ph c4 h (1 + Z.length) p q 0 0 := by + have ⟨_, hd, _⟩ := (All0_app Z [(p, q, d)]).mp hZ + subst hd + have hB := AllI_app (PCx ph c4 h) Z 1 [(p, q, false)] hA + dsimp [AllI, PCx, List.length, dv, bv] at hB + exact ⟨rfl, hB.1⟩ + +theorem first_pc (ph : Phase) (c4 : Bool) (h p q : Nat) (d : Bool) (Z : List Tri) + (hZ : All0 ((p, q, d) :: Z)) (hA : AllI (PCx ph c4 h) 1 ((p, q, d) :: Z)) : + d = false ∧ PC ph c4 h 1 p q Z.length 0 ∧ All0 Z ∧ AllI (PCx ph c4 h) 2 Z := by + rcases hZ with ⟨rfl, hZ'⟩ + rcases hA with ⟨hH, hA'⟩ + dsimp [PCx] at hH + rw [dv_zero ((p, q, false) :: Z) ⟨rfl, hZ'⟩] at hH + exact ⟨rfl, hH, hZ', hA'⟩ + +theorem Jstep (s : St) (hJ : J s) : ∃ s', ((Cf s) [target_tm]⊢⁺ (Cf s')) ∧ J s' := by + rcases s with ⟨h, P, T, ph, c4⟩ + rcases hJ with ⟨hP, hT, hA⟩ + dsimp [Cf] at * + rcases split1 P with ⟨Z, ⟨p, q, d⟩, R, rfl, hZ, hd⟩ | h0 + · dsimp [dig] at hd; subst hd + have hZL : ∀ x ∈ Z, okL x := Z_okL ph c4 h Z 1 (p, q, true) R hZ rfl hA + have hB := AllI_app (PCx ph c4 h) Z 1 ((p, q, true) :: R) hA + dsimp [AllI] at hB + rcases hB with ⟨hx, hR⟩ + have hx' : PC ph c4 h (1 + Z.length) p q R.length (dv ((p, q, true) :: R)) := hx + rcases q with _ | _ | q + · exfalso; rcases hx' with ⟨_, hq, _⟩; omega + · have ⟨hph, hk, hL1, hLX⟩ := + borrow1 ph c4 h (1 + Z.length) p R.length (dv ((p, 1, true) :: R)) (by omega) + (by dsimp [dv, bv]; omega) hx' + cases R with + | nil => + cases T with + | TN => + exfalso + rcases hph with rfl | rfl | rfl + · have ⟨hn, _⟩ := hL1 rfl; dsimp [List.length] at hn; omega + · rcases hT with ⟨t, ht, _⟩; nomatch ht + · have hn := hLX rfl; dsimp [List.length] at hn; omega + | TA t => + have hphL2 : ph = .L2 := by + rcases hph with rfl | rfl | rfl + · dsimp [TC] at hT; nomatch hT + · rfl + · dsimp [TC] at hT; nomatch hT.1 + subst hphL2 + rcases hT with ⟨t', ht, ht2⟩ + cases ht + have ⟨hA', hlen⟩ := inv_MT c4 h Z p hZ hA + refine ⟨⟨h + 4, Z.map touch, .TA (p + t + 3), .L2, false⟩, DecMergeTail h Z p t hZL, ?_⟩ + refine ⟨?_, ⟨p + t + 3, rfl, by omega⟩, hA'⟩ + cases Z with + | nil => dsimp [List.length] at hlen; omega + | cons _ _ => intro hc; nomatch hc + | TB k => + exfalso + rcases hph with rfl | rfl | rfl + · dsimp [TC] at hT; nomatch hT + · rcases hT with ⟨t, ht, _⟩; nomatch ht + · dsimp [TC] at hT; nomatch hT.1 + | cons x' R0 => + rcases x' with ⟨p', q', d'⟩ + refine ⟨⟨h + 4, Z.map touch ++ (p + p' + 3, q', d') :: R0, T, ph, c4⟩, + DecMerge h Z p p' q' d' R0 T hZL, ?_⟩ + refine ⟨(by cases Z <;> intro hc <;> nomatch hc), hT, + inv_Merge ph c4 h Z p p' q' d' R0 hZ hA⟩ + · refine ⟨⟨h + 4, Z.map touch ++ (p + 1, q + 1, false) :: R, T, ph, c4⟩, Dec h Z p q R T hZL, + ?_⟩ + refine ⟨(by cases Z <;> intro hc <;> nomatch hc), hT, inv_Dec ph c4 h Z p q R hZ hA⟩ + · cases ph + · -- E1: EndR + rcases hT with ⟨rfl, rfl⟩ + obtain ⟨Z, ⟨p, q, d⟩, rfl⟩ := exists_last P hP + obtain ⟨rfl, hy⟩ := last_pc .E1 false h Z p q d h0 hA + have hq : 2 ≤ q := by rcases hy with ⟨_, _, hN, _⟩; simp only [PN] at hN; omega + rcases q with _ | _ | q + · omega + · omega + · have hZL : ∀ x ∈ Z, okL x := Z_okL_V0 .E1 false h (p, q + 2, false) (by decide) Z 1 h0 hA + have ⟨hZ, _⟩ := (All0_app Z [(p, q + 2, false)]).mp h0 + refine ⟨⟨h + 4, Z.map touch ++ [(p + 1, q + 1, false)], .TA 1, .E2, false⟩, + EndR h Z p q hZL, ?_⟩ + exact ⟨snoc_nn _ _, ⟨rfl, rfl⟩, inv_End .E1 .E2 h Z p q (Or.inl ⟨rfl, rfl⟩) hZ hA⟩ + · -- E2: Ov + rcases hT with ⟨rfl, rfl⟩ + cases P with + | nil => exact absurd rfl hP + | cons x1 Z => + rcases x1 with ⟨p1, q1, d1⟩ + obtain ⟨rfl, hH, hZ, hA2⟩ := first_pc .E2 false h p1 q1 d1 Z h0 hA + have hp1 := p1_V0 .E2 false h p1 q1 Z.length hH (Or.inl rfl) + rcases p1 with _ | _ | p1 + · omega + · omega + · have ⟨hR, hO⟩ := AllI_okRO .E2 false h Z 2 hZ hA2 + have hq1 : 1 ≤ q1 := hH.2.1 + rcases lastOK_dec Z with hX | hX + · refine ⟨⟨2, (h + 5, p1 + 1, false) :: ovp q1 Z 1, .TN, .LX, false⟩, + Ov h p1 q1 Z 1 hq1 hR hO, ?_⟩ + refine ⟨(by intro hc; nomatch hc), ⟨rfl, rfl⟩, ?_⟩ + exact inv_Ov .E2 .LX false (fun x => + x = 4) h p1 q1 Z 1 (Or.inr (Or.inl ⟨rfl, rfl, rfl, rfl⟩)) (fun hc => + by nomatch hc) (fun _ => rfl) hZ hX hA + · refine ⟨⟨2, (h + 5, p1 + 1, false) :: ovp q1 Z 1, .TN, .L1, false⟩, + Ov h p1 q1 Z 1 hq1 hR hO, ?_⟩ + refine ⟨(by intro hc; nomatch hc), rfl, ?_⟩ + exact inv_Ov .E2 .L1 false (fun x => + x ≠ 4) h p1 q1 Z 1 (Or.inl ⟨rfl, rfl, rfl, rfl⟩) (fun hc => by nomatch hc) (fun _ => + rfl) hZ hX hA + · -- E1t: EndR + rcases hT with ⟨rfl, rfl⟩ + obtain ⟨Z, ⟨p, q, d⟩, rfl⟩ := exists_last P hP + obtain ⟨rfl, hy⟩ := last_pc .E1t false h Z p q d h0 hA + have hq : 2 ≤ q := by rcases hy with ⟨_, _, hN, _⟩; simp only [PN] at hN; omega + rcases q with _ | _ | q + · omega + · omega + · have hZL : ∀ x ∈ Z, okL x := Z_okL_V0 .E1t false h (p, q + 2, false) (by decide) Z 1 h0 hA + have ⟨hZ, _⟩ := (All0_app Z [(p, q + 2, false)]).mp h0 + refine ⟨⟨h + 4, Z.map touch ++ [(p + 1, q + 1, false)], .TA 1, .E2t, false⟩, + EndR h Z p q hZL, ?_⟩ + exact ⟨snoc_nn _ _, ⟨rfl, rfl⟩, inv_End .E1t .E2t h Z p q (Or.inr ⟨rfl, rfl⟩) hZ hA⟩ + · -- E2t: Ov + rcases hT with ⟨rfl, rfl⟩ + cases P with + | nil => exact absurd rfl hP + | cons x1 Z => + rcases x1 with ⟨p1, q1, d1⟩ + obtain ⟨rfl, hH, hZ, hA2⟩ := first_pc .E2t false h p1 q1 d1 Z h0 hA + have hp1 := p1_V0 .E2t false h p1 q1 Z.length hH (Or.inr (Or.inl rfl)) + rcases p1 with _ | _ | p1 + · omega + · omega + · have ⟨hR, hO⟩ := AllI_okRO .E2t false h Z 2 hZ hA2 + have hq1 : 1 ≤ q1 := hH.2.1 + refine ⟨⟨2, (h + 5, p1 + 1, false) :: ovp q1 Z 1, .TN, .L1, true⟩, + Ov h p1 q1 Z 1 hq1 hR hO, ?_⟩ + refine ⟨(by intro hc; nomatch hc), rfl, ?_⟩ + exact inv_Ov .E2t .L1 true (fun _ => + True) h p1 q1 Z 1 (Or.inr (Or.inr (Or.inl ⟨rfl, rfl, rfl, rfl⟩))) (fun hc => + by nomatch hc) (fun _ => rfl) hZ (lastOK_True Z) hA + · -- T0: X2 + rcases hT with ⟨⟨k, rfl, hk⟩, rfl⟩ + obtain ⟨Z, ⟨p, q, d⟩, rfl⟩ := exists_last P hP + obtain ⟨rfl, hy⟩ := last_pc .T0 false h Z p q d h0 hA + have hq : 2 ≤ q := by rcases hy with ⟨_, _, hN, _⟩; simp only [PN] at hN; omega + rcases q with _ | _ | q + · omega + · omega + · rcases k with _ | k + · omega + · have hZL : ∀ x ∈ Z, okL x := Z_okL_V0 .T0 false h (p, q + 2, false) (by decide) Z 1 h0 hA + have ⟨hZ, _⟩ := (All0_app Z [(p, q + 2, false)]).mp h0 + refine ⟨⟨h + 4, Z.map touch ++ [(p + 1, q + 1, false), (3, k + 1, true)], .TN, .E1t, + false⟩, X2 h Z p q k hZL, ?_⟩ + exact ⟨(by cases Z <;> intro hc <;> nomatch hc), ⟨rfl, rfl⟩, + inv_X2 h Z p q (k + 1) hZ hk hA⟩ + · -- L1: EndLast + dsimp [TC] at hT; subst hT + obtain ⟨Z, ⟨p, q, d⟩, rfl⟩ := exists_last P hP + obtain ⟨rfl, hy⟩ := last_pc .L1 c4 h Z p q d h0 hA + have hq : q = 1 := by rcases hy with ⟨_, _, hN, _⟩; simp only [PN] at hN; omega + subst hq + have hZL : ∀ x ∈ Z, okL x := Z_okL_V0 .L1 c4 h (p, 1, false) (by decide) Z 1 h0 hA + have ⟨hZ, _⟩ := (All0_app Z [(p, 1, false)]).mp h0 + have ⟨hA', hlen⟩ := inv_EndLast c4 h Z p hZ hA + refine ⟨⟨h + 4, Z.map touch, .TA (p + 4), .L2, c4⟩, EndLast h Z p hZL, ?_⟩ + refine ⟨?_, ⟨p + 4, rfl, by omega⟩, hA'⟩ + cases Z with + | nil => dsimp [List.length] at hlen; omega + | cons _ _ => intro hc; nomatch hc + · -- L2: Ov + rcases hT with ⟨t, rfl, ht⟩ + cases c4 + · cases P with + | nil => exact absurd rfl hP + | cons x1 Z => + rcases x1 with ⟨p1, q1, d1⟩ + obtain ⟨rfl, hH, hZ, hA2⟩ := first_pc .L2 false h p1 q1 d1 Z h0 hA + have hp1 := p1_V0 .L2 false h p1 q1 Z.length hH (Or.inr (Or.inr (Or.inl rfl))) + rcases p1 with _ | _ | p1 + · omega + · omega + · have ⟨hR, hO⟩ := AllI_okRO .L2 false h Z 2 hZ hA2 + have hq1 : 1 ≤ q1 := hH.2.1 + refine ⟨⟨2, (h + 5, p1 + 1, false) :: ovp q1 Z t, .TN, .E1, false⟩, + Ov h p1 q1 Z t hq1 hR hO, ?_⟩ + refine ⟨(by intro hc; nomatch hc), ⟨rfl, rfl⟩, ?_⟩ + exact inv_Ov .L2 .E1 false (fun _ => + True) h p1 q1 Z t (Or.inr (Or.inr (Or.inr ⟨rfl, rfl, rfl, rfl⟩))) (fun _ => + ht) (fun hc => absurd rfl hc) hZ (lastOK_True Z) hA + · exfalso + obtain ⟨Z, ⟨p, q, d⟩, rfl⟩ := exists_last P hP + obtain ⟨rfl, hy⟩ := last_pc .L2 true h Z p q d h0 hA + exact L2_c4_V0 h (1 + Z.length) p q hy + · -- LX: X1 + rcases hT with ⟨rfl, rfl⟩ + have hlen := AllI_len .LX false h P hP hA + dsimp [minlen] at hlen + obtain ⟨P1, ⟨pb, qb, db⟩, rfl⟩ := exists_last P hP + have hP1 : P1 ≠ [] := by + cases P1 with + | nil => dsimp [List.length] at hlen; omega + | cons _ _ => intro hc; nomatch hc + obtain ⟨P2, ⟨pa, qa, da⟩, rfl⟩ := exists_last P1 hP1 + cases P2 with + | nil => dsimp [List.length] at hlen; omega + | cons x1 Z => + rcases x1 with ⟨p1, q1, d1⟩ + have happ : ((p1, q1, d1) :: Z ++ [(pa, qa, da)]) ++ [(pb, qb, db)] = + (p1, q1, d1) :: (Z ++ [(pa, qa, da), (pb, qb, db)]) := by simp [List.append_assoc] + rw [happ] at h0 hA ⊢ + obtain ⟨rfl, hH, hZab, hA2⟩ := + first_pc .LX false h p1 q1 d1 (Z ++ [(pa, qa, da), (pb, qb, db)]) h0 hA + have ⟨hZ, hda, hdb, _⟩ := (All0_app Z [(pa, qa, da), (pb, qb, db)]).mp hZab + subst hda; subst hdb + have hB := AllI_app (PCx .LX false h) Z 2 [(pa, qa, false), (pb, qb, false)] hA2 + dsimp [AllI, PCx, List.length, dv, bv] at hB + rcases hB with ⟨ha, hb, _⟩ + have hqa : qa = 1 := by rcases ha with ⟨_, _, hN, _⟩; simp only [PN] at hN; omega + have hqb : qb = 1 := by rcases hb with ⟨_, _, hN, _⟩; simp only [PN] at hN; omega + subst hqa; subst hqb + have hpa : 1 ≤ pa := ha.1 + rcases pa with _ | pa + · omega + · have hp1 := + p1_V0 .LX false h p1 q1 (Z ++ [(pa + 1, 1, false), (pb, 1, + false)]).length hH (Or.inr (Or.inr (Or.inr rfl))) + rcases p1 with _ | _ | p1 + · omega + · omega + · have ⟨hR, hO⟩ := + AllI_okRO .LX false h (Z ++ [(pa + 1, 1, false), (pb, 1, false)]) 2 hZab hA2 + have hRZ : ∀ x ∈ Z, okR x := fun x hx => hR x (List.mem_append_left _ hx) + have hOZ : ∀ x ∈ Z, okO x := fun x hx => hO x (List.mem_append_left _ hx) + have hq1 : 1 ≤ q1 := hH.2.1 + refine ⟨⟨2, (h + 5, p1 + 1, false) :: ovpX q1 Z (pa + 1), .TB (pb + 3), .T0, false⟩, + X1 h p1 q1 Z pa pb hq1 hRZ hOZ, ?_⟩ + refine ⟨(by intro hc; nomatch hc), ⟨⟨pb + 3, rfl, by omega⟩, rfl⟩, ?_⟩ + exact inv_X1 h p1 q1 Z pa pb hZ hA + +def s_base_0666 : St := ⟨2, base_0666, .TN, .E1, false⟩ + +theorem J_base_0666 : J s_base_0666 := by + dsimp [J, s_base_0666, base_0666, TC, AllI, PCx, PC, PN, PI, List.length, dv, bv] + refine ⟨(by intro hc; nomatch hc), ⟨rfl, rfl⟩, by simp only []; decide⟩ + +theorem isSome_of_multiStep_add {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d) = some c') : + (multiStep target_tm c j).isSome := by + rw [multiStep_add] at h + cases hj : multiStep target_tm c j with + | none => rw [hj] at h; nomatch h + | some _ => rfl + +theorem reach_unbounded (m : Nat) : + ∃ N ≥ m, ∃ s : St, multiStep target_tm (init []) N = some (Cf s) ∧ J s := by + induction m with + | zero => + obtain ⟨k1, hk1⟩ := stepStar_trans init0 init_to_base + exact ⟨k1, Nat.zero_le k1, s_base_0666, hk1, J_base_0666⟩ + | succ m ih => + obtain ⟨N, hN, s, hms, hJ⟩ := ih + obtain ⟨s', ⟨k, hk_pos, hstep⟩, hJ'⟩ := Jstep s hJ + exact ⟨N + k, by omega, s', multiStep_trans target_tm _ _ _ N k hms hstep, hJ'⟩ + + + +theorem init0_0685_chunk0 : + (default {{C}}> default) [target_tm]⊢* + (([1, 0, 1, 0, 1, 0, 1] +> default) {{A}}> ([1, 1, 0, 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_R0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0L rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + try simp only [zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685_chunk1 : + (([1, 0, 1, 0, 1, 0, 1] +> default) {{A}}> ([1, 1, 0, 1] +> default)) [target_tm]⊢* + (default <{{C}} ([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0L rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685_chunk2 : + (default <{{C}} ([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1] +> default)) [target_tm]⊢* + (([1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1] +> default) {{B}}> default) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0R rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685_chunk3 : + (([1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1] +> default) {{B}}> default) [target_tm]⊢* + (([0, 1, 0, 1] +> default) <{{E}} ([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, + 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_R0R rfl ?_ + refine stepStar_R0L rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685_chunk4 : + (([0, 1, 0, 1] +> default) <{{E}} ([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, + 1] +> default)) [target_tm]⊢* + (([0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, + 1] +> default) {{D}}> ([0, 0, 0, 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685_chunk5 : + (([0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, + 1] +> default) {{D}}> ([0, 0, 0, 1] +> default)) [target_tm]⊢* + (([1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1] +> default) <{{E}} ([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 0, 1, 0, 0, 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + try simp only [zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685_chunk6 : + (([1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1] +> default) <{{E}} ([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 0, 1, 0, 0, 1] +> default)) [target_tm]⊢* + (([1, 0, 1] +> default) <{{D}} ([1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 0, 1, 0, 0, 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685_chunk7 : + (([1, 0, 1] +> default) <{{D}} ([1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 0, 1, 0, 0, 1] +> default)) [target_tm]⊢* + (([1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1] +> default) {{A}}> ([1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685_chunk8 : + (([1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1] +> default) {{A}}> ([1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1] +> default)) [target_tm]⊢* + (([1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1] +> default) {{E}}> ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0L rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685_chunk9 : + (([1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1] +> default) {{E}}> ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] +> default)) [target_tm]⊢* + (default <{{D}} ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685_chunk10 : + (default <{{D}} ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] +> default)) [target_tm]⊢* + (([1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] +> default) <{{E}} ([0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685_chunk11 : + (([1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] +> default) <{{E}} ([0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] +> default)) [target_tm]⊢* + (([1, 0, 1, 0, 1, 0, 1] +> default) <{{D}} ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685_chunk12 : + (([1, 0, 1, 0, 1, 0, 1] +> default) <{{D}} ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1] +> default)) [target_tm]⊢* + (([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] +> default) {{A}}> ([1, 0, 1, 0, 1, 0, 1] +> default)) := + by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685_chunk13 : + (([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] +> default) {{A}}> ([1, 0, 1, 0, 1, 0, + 1] +> default)) [target_tm]⊢* + (([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1] +> default) {{A}}> ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, + 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0R rfl ?_ + refine stepStar_R0L rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685_chunk14 : + (([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1] +> default) {{A}}> ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, + 1] +> default)) [target_tm]⊢* + (([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] +> default) <{{C}} ([1, 0, 1, 0, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, + 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685_chunk15 : + (([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] +> default) <{{C}} ([1, 0, 1, 0, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, + 1] +> default)) [target_tm]⊢* + (([1, 1] +> default) {{E}}> ([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, + 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685_chunk16 : + (([1, 1] +> default) {{E}}> ([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, + 1] +> default)) [target_tm]⊢* + (([1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, + 0, 1] +> default) {{A}}> ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 0, 0, 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + refine stepStar_L0R rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685_chunk17 : + (([1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, + 0, 1] +> default) {{A}}> ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 0, 0, 1] +> default)) [target_tm]⊢* + (([0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, + 1] +> default) <{{C}} ([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, + 0, 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + try simp only [zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685_chunk18 : + (([0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, + 1] +> default) <{{C}} ([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, + 0, 1] +> default)) [target_tm]⊢* + (([1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, + 1] +> default) <{{C}} ([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 0, 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685_chunk19 : + (([1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, + 1] +> default) <{{C}} ([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 0, 1] +> default)) [target_tm]⊢* + (([1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1] +> default) <{{C}} ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 0, 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685_chunk20 : + (([1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1] +> default) <{{C}} ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 0, 1] +> default)) [target_tm]⊢* + (default <{{D}} ([1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, + 1] +> default)) := by + simp only [append_cons_lb, append_nil_lb] + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LR rfl ?_ + refine stepStar_RR rfl ?_ + refine stepStar_RL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_LL rfl ?_ + refine stepStar_L0L rfl ?_ + try simp only [append_cons_lb, append_nil_lb, zero_cons_default] + exact ⟨0, rfl⟩ + +theorem init0_0685 : + (((default : ListBlank (Fin 2)) {{2}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢* + (K 2 [(11, 12, false)] .TN) := by + refine stepStar_trans init0_0685_chunk0 ?_ + refine stepStar_trans init0_0685_chunk1 ?_ + refine stepStar_trans init0_0685_chunk2 ?_ + refine stepStar_trans init0_0685_chunk3 ?_ + refine stepStar_trans init0_0685_chunk4 ?_ + refine stepStar_trans init0_0685_chunk5 ?_ + refine stepStar_trans init0_0685_chunk6 ?_ + refine stepStar_trans init0_0685_chunk7 ?_ + refine stepStar_trans init0_0685_chunk8 ?_ + refine stepStar_trans init0_0685_chunk9 ?_ + refine stepStar_trans init0_0685_chunk10 ?_ + refine stepStar_trans init0_0685_chunk11 ?_ + refine stepStar_trans init0_0685_chunk12 ?_ + refine stepStar_trans init0_0685_chunk13 ?_ + refine stepStar_trans init0_0685_chunk14 ?_ + refine stepStar_trans init0_0685_chunk15 ?_ + refine stepStar_trans init0_0685_chunk16 ?_ + refine stepStar_trans init0_0685_chunk17 ?_ + refine stepStar_trans init0_0685_chunk18 ?_ + refine stepStar_trans init0_0685_chunk19 ?_ + refine stepStar_trans init0_0685_chunk20 ?_ + simp only [K, RP, RT, sd, pow_succ_lb, pow_zero_lb, append_cons_lb, append_nil_lb, + zero_cons_default, Bool.false_eq_true, ↓reduceIte] + exact ⟨0, rfl⟩ + +def base_0685 : List (Nat × Nat × Bool) := [(47, 32, false), (16, 15, true), (4, 21, true)] + +theorem init_to_base_0685 : (K 2 [(11, 12, false)] .TN) [target_tm]⊢* (K 2 base_0685 .TN) := by + refine stepStar_trans (stepPlus_stepStar (EndR 2 [] 11 10 (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Ov 6 10 11 [] 1 (by decide) (by decide) (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 2 [(11, 11, false)] 11 0 [] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 6 [] 12 8 [(12, 1, false)] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (EndLast 10 [(13, 9, false)] 12 (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 14 [] 14 6 [] (.TA 16) (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Ov 18 13 7 [] 16 (by decide) (by decide) (by decide))) + ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 2 [(23, 14, false)] 7 15 [] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 6 [] 24 11 [(8, 16, false)] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (EndR 10 [(25, 12, false)] 8 14 (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 14 [] 26 9 [(9, 15, false)] (.TA 1) (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Ov 18 25 10 [(9, 15, + false)] 1 (by decide) (by decide) (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 2 [(23, 26, false)] 10 7 [(15, 2, + true)] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 6 [] 24 23 [(11, 8, false), (15, 2, + true)] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 10 [(25, 24, false), (11, 8, + false)] 15 0 [] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 14 [] 26 21 [(12, 7, true), (16, 1, + false)] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 18 [(27, 22, false)] 12 5 [(16, 1, + false)] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 22 [] 28 19 [(13, 6, false), (16, 1, + false)] .TN (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (EndLast 26 [(29, 20, false), (13, 6, + false)] 16 (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 30 [] 30 17 [(14, 5, + true)] (.TA 20) (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 34 [(31, 18, + false)] 14 3 [] (.TA 20) (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Dec 38 [] 32 15 [(15, 4, + false)] (.TA 20) (by decide))) ?_ + refine stepStar_trans (stepPlus_stepStar (Ov 42 31 16 [(15, 4, + false)] 20 (by decide) (by decide) (by decide))) ?_ + exact ⟨0, rfl⟩ + + +def s_base_0685 : St := ⟨2, base_0685, .TN, .E1, false⟩ + +theorem J_base_0685 : J s_base_0685 := by + dsimp [J, s_base_0685, base_0685, TC, AllI, PCx, PC, PN, PI, List.length, dv, bv] + refine ⟨(by intro hc; nomatch hc), ⟨rfl, rfl⟩, by simp only []; decide⟩ + +theorem reach_unbounded_0685 (m : Nat) : + ∃ N ≥ m, ∃ s : St, + multiStep target_tm ((default : ListBlank (Fin 2)) {{2}}> default) N = some (Cf s) ∧ J s := by + induction m with + | zero => + obtain ⟨k1, hk1⟩ := stepStar_trans init0_0685 init_to_base_0685 + exact ⟨k1, Nat.zero_le k1, s_base_0685, hk1, J_base_0685⟩ + | succ m ih => + obtain ⟨N, hN, s, hms, hJ⟩ := ih + obtain ⟨s', ⟨k, hk_pos, hstep⟩, hJ'⟩ := Jstep s hJ + exact ⟨N + k, by omega, s', multiStep_trans target_tm _ _ _ N k hms hstep, hJ'⟩ + +theorem is_not_halt_from_0685_tm : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{2}}> default) [target_tm]⊢* cfg) → + (step target_tm cfg).isSome := by + intro cfg ⟨n, hn⟩ + obtain ⟨N, hN, _, hN_ms, _⟩ := reach_unbounded_0685 (n + 1) + have heq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [← heq] at hN_ms + have hsome := isSome_of_multiStep_add hN_ms + rwa [multiStep_succ, hn] at hsome + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg ⟨n, hn⟩ + obtain ⟨N, hN, _, hN_ms, _⟩ := reach_unbounded (n + 1) + have heq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [← heq] at hN_ms + have hsome := isSome_of_multiStep_add hN_ms + rwa [multiStep_succ, hn] at hsome + +end Solution + +public section + +theorem is_not_halt_from_0685 : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{2}}> default) [target]⊢* cfg) → + (step target cfg).isSome := + Solution.is_not_halt_from_0685_tm + +theorem is_not_halt : IsNotHalt target := Solution.is_does_not_halt + +end + +end BusyBeaver.M_1RB0RD_1RC1RF_1LD0LE_1RA0LC_1RE1LC_0RAHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RD_1RCHHH_1LD1LC_1LE0LC_1RF0RC_1RA0RF.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RD_1RCHHH_1LD1LC_1LE0LC_1RF0RC_1RA0RF.lean new file mode 100644 index 00000000..cd117a18 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RD_1RCHHH_1LD1LC_1LE0LC_1RF0RC_1RA0RF.lean @@ -0,0 +1,945 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RD_1RCHHH_1LD1LC_1LE0LC_1RF0RC_1RA0RF + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RD_1RCHHH_1LD1LC_1LE0LC_1RF0RC_1RA0RF" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 8000000 +set_option maxRecDepth 4000000 +@[simp] theorem zMz (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : HalfTape).head = 0 := rfl +@[simp] theorem zDt : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem zPs {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem zPt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,by omega,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) +abbrev t : BitWord := [1,1,0,0] +abbrev d0 : BitWord := [0,0] +abbrev d1 : BitWord := [1,0] +abbrev one : BitWord := [1] +abbrev lh : HalfTape := default +abbrev w_word : BitWord := t ++ t ++ one +abbrev w_pre : BitWord := w_word +@[simp] theorem zDd : d0 +> (default : HalfTape) = default := by + simp [d0] +inductive Call where + | ch + | cj + | cp + | ca +def zCs : Call -> Fin 6 + | .ch => E + | .cj => D + | .cp => D + | .ca => D +def zCw : Call -> BitWord + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] + | .ca => [1,1,1,0,1,0] +def zCR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (r <{{zCs c}} (l <+ zCw c)) +def zCL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> r) {{F}}> l) +def zCf (q : Nat) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + zCL lh ((w_pre ++ (t ^ (2 + q) ++ (d1 ++ one))) +> r) +def z04 (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l,(zCR l c r1) [target_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + z04 c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem z05 {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z06 {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem z07 {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z08 {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z09 {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0a (w : BitWord) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem z0b (ls : List Call) : Seg ls ls [] [] := by + intro r1 r2 h; simpa using! h +theorem zSc {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases z09 h with ⟨r2,ha,hb⟩ + exact z08 (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS0 {ls1 ls2 ls3 : List Call} {u1 u2 v1 v2 : BitWord} + (h1 : Seg ls1 ls2 u1 u2) (h2 : Seg ls2 ls3 v1 v2) : + Seg ls1 ls3 (u1 ++ v1) (u2 ++ v2) := by + intro r1 r2 h + rw [append_assoc u1 v1 r1,append_assoc u2 v2 r2] + exact h1 (v1 +> r1) (v2 +> r2) (h2 r1 r2 h) +theorem zS4 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc1 (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [target_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem z0c : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons,append_nil]; execute) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0d : Seg [.cp] [.ch] t (t ++ [0]) := + zS2 (mid := [1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0e : Seg [.ch] [.cj] (t ++ [0]) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0f : Seg [.cj] [.ch] t (t ++ one) := + zS2 (mid := [1,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0g : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0h : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1 d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0i : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0j : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0k : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0l : Seg [.cj] [.cp] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0m : Seg [.ca] [.cj,.ch] w_word (w_word ++ t) := + zS5 (mid1 := [1,0,1,1,1,1,0,1,1,1,0,1,0]) (mid2 := [1,0,1,0,1,1,0,1,1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs w_word t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL w_word t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0n (r : HalfTape) : + (zCL lh r) [target_tm]⊢⁺ (zCR lh .ca r) := by + unfold zCL zCR lh zCw zCs + simp only [append_cons,append_nil,z00] + execute +theorem H_T (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact z0a t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [zLp,h_eq,z07] + exact zSg z0c ih +theorem zSa {w2 : BitWord} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact z0a w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq,z07,zLp] + exact zSg hw ih +theorem z0o : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0p : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem z0q (n : Nat) : Seg ([.ch] ^ (n * 2)) ([.ch] ^ n) d0 d0 := + zSa z0o n +theorem z0r (n : Nat) : Seg ([.ch] ^ (1 + n * 2)) ([.ch] ^ n) d0 d1 := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg zH0 (zSa z0p n) +theorem z0s (n : Nat) : Seg ([.ch] ^ (n * 2)) ([.ch] ^ n) d1 d1 := + zSa z0p n +theorem z0t (n : Nat) : Seg ([.ch] ^ (1 + n * 2)) ([.ch] ^ (1 + n)) d1 d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg zH4 (z0q n) +theorem z0u (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0d z0e) (H_T n) +theorem z0v (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0f zH2) (H_T n) +theorem z0w (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0g zH2) (H_T n) +theorem z0x (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0h (H_T n) +theorem z0y (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0i (H_T n) +theorem z0z (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [zLp',List.cons_append,List.nil_append] using! zSg z0j (H_T n) +theorem z0A (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0k (zSg zH1 zH3) + have h1 := zSg h0 (z0q n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using! h1 +theorem z0B (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0l (z0q n) +theorem z0C : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0k zH1 +theorem z0D (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0k (zSg zH1 (zSg zH3 zH0)) + have h1 := zSg h0 (z0s n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using! h1 +theorem z0E (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg [.cj,.ch] [.cp] d1 d1 := zSg z0l zH0 + have h1 := zSg h0 (z0s n) + simpa only [zLp',List.cons_append,List.nil_append] using! h1 +theorem z0F (n : Nat) : Seg ([.ch] ^ n ++ [.cj,.ch]) ([.ch] ^ (1 + n * 2) ++ [.cj,.ch]) t t := by + have h1 := zSg (H_T n) (z0v 0) + have heq : 1 + n * 2 = n * 2 + 1 := by omega + rw [heq,z07] + simpa only [z06,List.append_assoc,List.cons_append,List.nil_append] using! h1 +theorem z0G (n : Nat) : Seg ([.ch] ^ (1 + n * 2)) ([.cj] ++ [.ch] ^ n) (d1 ++ one) d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg zH3 (z0q n) +theorem z0H (n : Nat) : Seg ([.ch] ^ (1 + n * 2) ++ [.cj,.ch]) ([.cj] ++ [.ch] ^ n) + (d1 ++ one) (d1 ++ one) := by + simpa only [List.append_nil] using! zSg (z0G n) z0C +theorem z0I (q : Nat) : ∀ n,Seg ([.ch] ^ n ++ [.cj,.ch]) + ([.ch] ^ ((1 + n) * 2 ^ q - 1) ++ [.cj,.ch]) (t ^ q) (t ^ q) := by + induction q with + | zero => + intro n + have heq : (1 + n) * 2 ^ 0 - 1 = n := by omega + rw [heq]; exact z0b _ + | succ q ih => + intro n + have heq : (1 + n) * 2 ^ (q + 1) - 1 = (1 + (1 + n * 2)) * 2 ^ q - 1 := by + rw [Nat.pow_succ]; ring_nf + rw [zLp,heq] + exact zS0 (z0F n) (ih (1 + n * 2)) +open WordCalculus Word ChoiceE +local notation "WordList" => List Word +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) +theorem loc_z2t {k : Nat} (hK : 0 < k) : ∃ hs,Num k [] hs := by + rcases even_or_odd_mul_two k with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · cases a with + | zero => omega + | succ a => + have heq : (a + 1) * 2 = 2 + a * 2 := by omega + rw [heq]; exact ⟨[.cj] ++ [.ch] ^ a,Num.even a⟩ + · exact ⟨[.cp] ++ [.ch] ^ a,Num.odd a⟩ +theorem loc_z2u {k : Nat} {hs hs' : List Call} (h1 : Num k [] hs) (h2 : Num k [] hs') : + hs = hs' := by + cases h1 with + | @odd n => + generalize hk : 1 + n * 2 = k0 at h2 + cases h2 with + | @odd m => + have hnm : n = m := by omega + subst hnm; rfl + | even _ => omega + | @even n => + generalize hk : 2 + n * 2 = k0 at h2 + cases h2 with + | odd _ => omega + | @even m => + have hnm : n = m := by omega + subst hnm; rfl +def loc_z2v (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs,Num k w hs -> Side hs (w +> r) r' +theorem loc_z2w {r r' : HalfTape} (h : loc_z2v 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl +theorem loc_z2x {n : Nat} {r r' : HalfTape} + (hI : loc_z2v (n * 2) r r') : loc_z2v (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2w hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0k (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine zSc (z0A n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using! hI [] _ hN2 +theorem loc_z2y {n : Nat} {r r' : HalfTape} + (hI : loc_z2v (n * 2) r r') : loc_z2v (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2w hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0C (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine zSc (z0D n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using! hI [] _ hN2 +theorem loc_z2z {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hZ : A = 0) : + evalWords da default = default := by + induction hD with + | nil => rfl + | @zero A H u _ ih => + have hA0 : A = 0 := by omega + rw [evalWords,ih hA0,zDd] + | one _ => omega +theorem loc_z2A {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hPos : 0 < A) : + loc_z2v ((A - 1) * 2) default (evalWords da default) := by + induction hD with + | nil => omega + | @zero A H u _ ih => + have hA_pos : 0 < A := by omega + have hIH := ih hA_pos + have hs := loc_z2x hIH + rw [zDd] at hs + have heq : (A * 2 - 1) * 2 = 2 + (A - 1) * 4 := by omega + rw [evalWords] + rwa [heq] + | @one A H u hDu ih => + cases A with + | zero => + have h_side : evalWords (Q :: u) default = one +> default := by + rw [evalWords,loc_z2z hDu rfl] + simp [d1,one] + rw [h_side] + intro w hs hN + have hk0 : (1 + 0 * 2 - 1) * 2 = 0 := rfl + rw [hk0] at hN + generalize hk : (0 : Nat) = k0 at hN + cases hN with + | zero => exact Side.nil (one +> default) + | odd _ => omega + | even _ => omega + | succ A => + have hA_pos : 0 < A + 1 := by omega + have hIH := ih hA_pos + have heq_in : (A + 1 - 1) * 2 = A * 2 := by omega + rw [heq_in] at hIH + have hs := loc_z2y hIH + rw [zDd] at hs + have heq : (1 + (A + 1) * 2 - 1) * 2 = 4 + A * 4 := by omega + rw [evalWords] + rwa [heq] +theorem zEd {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ∀ {A H : Nat},DigitVal A H v -> Seg ([Call.ch] ^ n) ([Call.ch] ^ b) (wordsToBits u) (wordsToBits v) := by + induction hI with + | nil n => + intro A H _ + exact z0b _ + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | d00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0q _) (ih hD') + | d01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0r _) (ih hD') + | d10 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0s _) (ih hD') + | d11 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0t _) (ih hD') +theorem loc_z2B {n : Nat} {hs hs' : List Call} + (hI : Num (3 + n) [] hs) (hJ : Num (2 + n * 2) [] hs') : + Seg hs ([Call.ch] ++ hs') t t := by + generalize hk1 : 3 + n = k1 at hI + generalize hk2 : 2 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = m * 2 := by omega + subst hq + rw [h1m] + exact z0u m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0v m +theorem loc_z2C {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' (d1 ++ d0) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0w m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + have hq : q = m * 2 := by omega + subst hq + exact z0x m +theorem loc_z2D {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' (d1 ++ d1) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | @odd q => + have hq : q = m * 2 := by omega + subst hq + exact z0y m + | even _ => omega + | @even m => + cases hJ with + | @odd q => + have hq : q = 1 + m * 2 := by omega + subst hq + exact z0z m + | even _ => omega +theorem loc_z2E {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 2 + q * 2 := by omega + subst hm + exact z0A q +theorem loc_z2F {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = q * 2 := by omega + subst hm + exact z0B q + | even _ => omega +theorem loc_z2G {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 3 + q * 2 := by omega + subst hm + exact z0D q +theorem loc_z2H {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = 1 + q * 2 := by omega + subst hm + exact z0E q + | even _ => omega +theorem loc_z2I {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) : + ∀ {u : WordList} {n n' : Nat} {hs hs' : List Call}, + WordEffect n u n' v -> Num k [] hs -> Num k' [] hs' -> + Seg (([Call.ch] ^ n) ++ hs) (([Call.ch] ^ n') ++ hs') (wordsToBits u) (wordsToBits w) := by + induction hI with + | nil k => + intro u n n' hs hs' hE hN hN' + cases hE + rw [loc_z2u hN hN'] + exact z0b _ + | @T m _ _ _ _ _ _ ih => + intro u0 n0 n1 hs hs' hE hN hN' + cases hE with + | T hSub => + rcases loc_z2t (by omega : 0 < 2 + m * 2) with ⟨hs0,hN0⟩ + have hIH := ih hSub hN0 hN' + have hStep := zSg (H_T n0) (loc_z2B hN hN0) + have heq : ([Call.ch] ^ (n0 * 2)) ++ ([Call.ch] ++ hs0) = ([Call.ch] ^ (1 + n0 * 2)) ++ hs0 := by + have h1 : 1 + n0 * 2 = n0 * 2 + 1 := by omega + rw [h1,z07,z06,List.append_assoc] + rw [heq] at hStep + exact zS0 hStep hIH + | @pair0 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,K] ++ u) at hE + rcases wordEffect_split_output [Q,K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD10 : DigitVal 1 2 [Q,K] := DigitVal.one (DigitVal.zero DigitVal.nil) + have hStep := zSg (zEd hL hD10) (loc_z2C hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @pair1 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,Q] ++ u) at hE + rcases wordEffect_split_output [Q,Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD11 : DigitVal 3 2 [Q,Q] := DigitVal.one (DigitVal.one DigitVal.nil) + have hStep := zSg (zEd hL hD11) (loc_z2D hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short00 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (loc_z2E hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short01 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (loc_z2F hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short10 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (loc_z2G hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short11 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (loc_z2H hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') +theorem loc_z2J {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) {u : WordList} {r r' : HalfTape} + (hE : WordEffect 0 u 0 v) (hK : 0 < k') (hC : loc_z2v k' r r') : + loc_z2v k (evalWords u r) (evalWords w r') := by + intro w0 hs hN + have hPosK : 0 < k := phaseScan_pos_of_out_pos hI hK + have hw0 : w0 = [] := by + cases hN with + | zero => omega + | odd _ => rfl + | even _ => rfl + subst hw0 + rcases loc_z2t hK with ⟨hs',hN'⟩ + have hSeg := loc_z2I hI hE hN hN' + dsimp at hSeg + have hSide := zSc hSeg (hC [] hs' hN') + rwa [wordsToBits_append_tape,wordsToBits_append_tape] at hSide +theorem loc_z2K {q : Nat} {orig out : WordList} (hS : EStep q orig out) : + loc_z2v (4 * 2 ^ q) (evalWords orig default) (evalWords out default) := by + rcases hS with ⟨eff,n,v,a0,b0,J,da,hE,hI,hPos,hDA⟩ + have hBlank : evalWords [K] default = default := by simp [evalWords,d0] + have hC : loc_z2v (n * 2) default (evalWords da default) := by + have heq : n * 2 = ((1 + n) - 1) * 2 := by omega + rw [heq] + exact loc_z2A hDA (by omega) + have hRun := loc_z2J hI hE (by omega : 0 < n * 2) hC + rwa [evalWords_append,hBlank,<- evalWords_append] at hRun +theorem loc_z2L (q : Nat) : + Seg [.cj,.ch] ([.cj] ++ [.ch] ^ (2 ^ q - 1)) (t ^ (1 + q) ++ (d1 ++ one)) (t ^ (1 + q) ++ (d1 ++ one)) := by + have hpos := pow_two_pos q + have hT := z0I (1 + q) 0 + have heq : (1 + 0) * 2 ^ (1 + q) - 1 = 1 + (2 ^ q - 1) * 2 := by + rw [pow_two_one_add]; omega + rw [heq] at hT + dsimp at hT + exact zS0 hT (z0H (2 ^ q - 1)) +theorem loc_z2M (q : Nat) : + Seg [.ca] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) + (w_pre ++ (t ^ (2 + q) ++ (d1 ++ one))) + (w_pre ++ (t ^ (2 + (q + 1)) ++ (d1 ++ one))) := by + have h1 := zS0 z0m (loc_z2L (1 + q)) + have heq1 : 1 + (1 + q) = 2 + q := by omega + have heq2 : (w_pre ++ t) ++ (t ^ (2 + q) ++ (d1 ++ one)) = w_pre ++ (t ^ (2 + (q + 1)) ++ (d1 ++ one)) := by + have h3 : 2 + (q + 1) = 1 + (2 + q) := by omega + rw [h3,zLp'] + simp only [List.append_assoc] + rw [heq1] at h1 + rwa [heq2] at h1 +theorem loc_z2N (q : Nat) {r r' : HalfTape} (hI : loc_z2v (4 * 2 ^ q) r r') : + (zCf q r) [target_tm]⊢⁺ zCf (q + 1) r' := by + have hpos := pow_two_pos q + have h_num : Num (4 * 2 ^ q) [] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) := by + have heq : 4 * 2 ^ q = 2 + (2 ^ (1 + q) - 1) * 2 := by rw [pow_two_one_add]; omega + rw [heq]; exact Num.even (2 ^ (1 + q) - 1) + have hC := hI [] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) h_num + have hS := zSc (loc_z2M q) hC + rcases hS with _ | ⟨hca,hnil⟩ + cases hnil + exact zPt (z0n _) (hca lh) +theorem loc_z2O {q : Nat} {orig out : WordList} (hS : EStep q orig out) : + (zCf q (evalWords orig default)) [target_tm]⊢⁺ zCf (q + 1) (evalWords out default) := + loc_z2N q (loc_z2K hS) +theorem loc_z2P {h : Nat} {u : WordList} {j : Nat} {v : WordList} (hR : ERounds h u j v) : + (zCf h (evalWords u default)) [target_tm]⊢* zCf j (evalWords v default) := by + induction hR with + | refl _ _ => exact ⟨0,rfl⟩ + | next hS _ ih => + rcases loc_z2O hS with ⟨n,_,hn⟩ + rcases ih with ⟨m,hm⟩ + exact ⟨n + m,zMt target_tm _ _ _ n m hn hm⟩ +def loc_z2Q : WordList := [V,V,Q,V,Q,K,V,K,Q,K,Q,Q] +def loc_z2R : WordList := [V,V,Q,V,Q,Q,V,V,V,V,Q,V,V,Q,V,V,Q,V,V,Q,V,V,Q,Q,V,V,Q,V,V,V,Q,V,V,V,Q,Q,V,K,Q,V,V,V,Q,Q,V,V,V,V,Q,V,V,V,V,Q,V,V,Q,V,V,Q,V,V,V,V,V,V,V,Q,Q,K,Q,Q,V,Q,Q,Q,K,K,V,V,V,V,K,V,V,V,V,V] +def loc_z2S : WordList := [Q,K,K,K,Q,K,K,K,Q,Q,K,Q,K,K,K,Q,K,Q,Q,K,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def loc_z2T : WordList := [K,K,K,K,Q,K,K,K,K,Q,Q,K,Q,K,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def loc_z2U : List CodeE := [ + (.More CT 61 (.More CT 121 (.More CS10 60 (.More CT 117 (.More CS10 58 (.More CS11 28 (.More CT 54 (.More CP0 109 (.More CP1 217 (.More CP0 434 (.Stop 434))))))))))), + (.More CT 125 (.More CT 249 (.More CS10 124 (.More CT 245 (.More CS10 122 (.More CS10 60 (.More CT 117 (.More CT 233 (.More CT 465 (.More CT 929 (.More CS10 464 (.More CP0 927 (.More CS00 463 (.More CS00 231 (.More CS01 115 (.More CP1 230 (.More CP0 460 (.Stop 460)))))))))))))))))), + (.More CT 253 (.More CT 505 (.More CS10 252 (.More CT 501 (.More CS10 250 (.More CS10 124 (.More CT 245 (.More CT 489 (.More CT 977 (.More CT 1953 (.More CS10 976 (.More CT 1949 (.More CP0 3899 (.More CS00 1949 (.More CT 3895 (.More CT 7789 (.More CS10 3894 (.More CS10 1946 (.More CS10 972 (.More CP0 1943 (.More CS01 971 (.More CP1 1942 (.More CP0 3884 (.Stop 3884)))))))))))))))))))))))), + (.More CT 509 (.More CT 1017 (.More CS10 508 (.More CT 1013 (.More CS10 506 (.More CS10 252 (.More CT 501 (.More CT 1001 (.More CT 2001 (.More CT 4001 (.More CS10 2000 (.More CT 3997 (.More CT 7993 (.More CS11 3996 (.More CT 7990 (.More CT 15979 (.More CS10 7989 (.More CP1 15977 (.More CT 31952 (.More CS01 15976 (.More CT 31950 (.More CT 63899 (.More CS10 31949 (.More CS00 15974 (.More CP0 31947 (.More CP0 63893 (.More CS00 31946 (.More CP1 63891 (.More CP1 127782 (.More CP0 255564 (.Stop 255564))))))))))))))))))))))))))))))), + (.More CT 1021 (.More CT 2041 (.More CS10 1020 (.More CT 2037 (.More CS10 1018 (.More CS10 508 (.More CT 1013 (.More CT 2025 (.More CT 4049 (.More CT 8097 (.More CS10 4048 (.More CT 8093 (.More CT 16185 (.More CS10 8092 (.More CT 16181 (.More CT 32361 (.More CS10 16180 (.More CT 32357 (.More CT 64713 (.More CS11 32356 (.More CT 64710 (.More CT 129419 (.More CS10 64709 (.More CS00 32354 (.More CT 64705 (.More CT 129409 (.More CS11 64704 (.More CT 129406 (.More CT 258811 (.More CT 517621 (.More CS10 258810 (.More CS10 129404 (.More CS11 64701 (.More CP1 129402 (.More CP0 258804 (.More CS10 129401 (.More CS01 64700 (.More CP0 129400 (.More CS10 64699 (.More CS01 32349 (.More CP1 64698 (.More CP1 129396 (.More CP0 258792 (.Stop 258792)))))))))))))))))))))))))))))))))))))))))))), + (.More CT 2045 (.More CT 4089 (.More CS10 2044 (.More CT 4085 (.More CS10 2042 (.More CS10 1020 (.More CT 2037 (.More CT 4073 (.More CT 8145 (.More CT 16289 (.More CS10 8144 (.More CT 16285 (.More CT 32569 (.More CS10 16284 (.More CT 32565 (.More CT 65129 (.More CS10 32564 (.More CT 65125 (.More CT 130249 (.More CS10 65124 (.More CT 130245 (.More CT 260489 (.More CS10 130244 (.More CS10 65121 (.More CT 130239 (.More CT 260477 (.More CS10 130238 (.More CT 260473 (.More CT 520945 (.More CT 1041889 (.More CS10 520944 (.More CP1 1041887 (.More CT 2083772 (.More CT 4167543 (.More CS10 2083771 (.More CS00 1041885 (.More CT 2083767 (.More CS10 1041883 (.More CS01 520941 (.More CT 1041880 (.More CT 2083759 (.More CT 4167517 (.More CS10 2083758 (.More CS10 1041878 (.More CS10 520938 (.More CS11 260468 (.More CP1 520936 (.More CP0 1041872 (.More CP0 2083743 (.More CS00 1041871 (.More CP1 2083741 (.More CP1 4167482 (.More CP1 8334964 (.More CP0 16669928 (.Stop 16669928))))))))))))))))))))))))))))))))))))))))))))))))))))))), + (.More CT 4093 (.More CT 8185 (.More CS10 4092 (.More CT 8181 (.More CS10 4090 (.More CS10 2044 (.More CT 4085 (.More CT 8169 (.More CT 16337 (.More CT 32673 (.More CS10 16336 (.More CT 32669 (.More CT 65337 (.More CS10 32668 (.More CT 65333 (.More CT 130665 (.More CS10 65332 (.More CT 130661 (.More CT 261321 (.More CS10 130660 (.More CT 261317 (.More CT 522633 (.More CS10 261316 (.More CS11 130657 (.More CT 261312 (.More CT 522623 (.More CS10 261311 (.More CT 522619 (.More CT 1045237 (.More CT 2090473 (.More CS10 1045236 (.More CT 2090469 (.More CT 4180937 (.More CT 8361873 (.More CS10 4180936 (.More CS10 2090467 (.More CT 4180931 (.More CS10 2090465 (.More CS01 1045232 (.More CT 2090462 (.More CT 4180923 (.More CT 8361845 (.More CS10 4180922 (.More CS11 2090460 (.More CP1 4180920 (.More CT 8361838 (.More CT 16723675 (.More CT 33447349 (.More CS11 16723674 (.More CT 33447346 (.More CT 66894691 (.More CT 133789381 (.More CT 267578761 (.More CS10 133789380 (.More CS10 66894689 (.More CS00 33447344 (.More CP0 66894687 (.More CS01 33447343 (.More CP1 66894686 (.More CP0 133789372 (.More CS11 66894685 (.More CP0 133789370 (.More CP0 267578739 (.More CS00 133789369 (.More CS01 66894684 (.More CP1 133789368 (.More CP1 267578736 (.More CP1 535157472 (.More CP0 1070314944 (.Stop 1070314944)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))), + (.More CT 8189 (.More CT 16377 (.More CS10 8188 (.More CT 16373 (.More CS10 8186 (.More CS10 4092 (.More CT 8181 (.More CT 16361 (.More CT 32721 (.More CT 65441 (.More CS10 32720 (.More CT 65437 (.More CT 130873 (.More CS10 65436 (.More CT 130869 (.More CT 261737 (.More CS10 130868 (.More CT 261733 (.More CT 523465 (.More CS10 261732 (.More CT 523461 (.More CT 1046921 (.More CS10 523460 (.More CS11 261729 (.More CT 523456 (.More CT 1046911 (.More CS10 523455 (.More CT 1046907 (.More CT 2093813 (.More CT 4187625 (.More CS10 2093812 (.More CT 4187621 (.More CT 8375241 (.More CT 16750481 (.More CS10 8375240 (.More CS11 4187619 (.More CT 8375236 (.More CS00 4187618 (.More CS11 2093808 (.More CT 4187614 (.More CT 8375227 (.More CT 16750453 (.More CS10 8375226 (.More CS11 4187612 (.More CT 8375222 (.More CT 16750443 (.More CT 33500885 (.More CT 67001769 (.More CS10 33500884 (.More CT 67001765 (.More CT 134003529 (.More CT 268007057 (.More CT 536014113 (.More CS10 268007056 (.More CP0 536014111 (.More CT 1072028219 (.More CS11 536014109 (.More CT 1072028216 (.More CT 2144056431 (.More CS10 1072028215 (.More CT 2144056427 (.More CT 4288112853 (.More CP1 8576225707 (.More CT 17152451412 (.More CT 34304902823 (.More CT 68609805645 (.More CT 137219611289 (.More CS10 68609805644 (.More CS10 34304902821 (.More CS00 17152451410 (.More CS10 8576225704 (.More CS11 4288112851 (.More CP0 8576225702 (.More CS10 4288112850 (.More CS10 2144056424 (.More CS10 1072028211 (.More CS00 536014105 (.More CS00 268007052 (.More CP0 536014103 (.More CP1 1072028205 (.More CP0 2144056410 (.More CP0 4288112819 (.More CS00 2144056409 (.More CP1 4288112817 (.More CP1 8576225634 (.More CP1 17152451268 (.More CP1 34304902536 (.More CP0 68609805072 (.Stop 68609805072))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +] +theorem loc_z2V : + ERounds 4 loc_z2Q 12 (loc_z2R ++ loc_z2S) := by + have h1 : ERounds 4 loc_z2Q (4 + loc_z2U.length) (loc_z2R ++ loc_z2S) := by + apply evalERounds_sound loc_z2U + decide + exact h1 +theorem loc_z2W : + EGood 12 (loc_z2R ++ loc_z2S) := by + apply eGood_of_check 12 loc_z2R loc_z2S loc_z2T + · decide + · exact EGuard.T 0 _ + · decide + · decide + · decide + · decide + · decide + · decide + · decide + · norm_num [loc_z2R,loc_z2T,wordMass,wordMassK,wordScale] +abbrev CCfg := Counter.CCfg (Fin 2) (Fin 6) +abbrev loc_z2X (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev loc_z34 (c : CCfg) : Option CCfg := Counter.bstep target_tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep target_tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (loc_z2X c1) [target_tm]⊢⁺ (loc_z2X c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ +def loc_z37 : CCfg := + ⟨A,0,[],[]⟩ +def loc_z38 : CCfg := + ⟨C,0,[1,0,0,1,0,0,0,1,0,1],[0,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def loc_z39 : CCfg := + ⟨D,0,[0,0,0,0,0,1],[1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def loc_z3a : CCfg := + ⟨D,0,[1,1,0,0,1,0,1,0,1,1,0,0,0,0,1,0,1],[1,1,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def loc_z3b : CCfg := + ⟨F,0,[0,0,0,0,1,1,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1],[1,1,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3c : CCfg := + ⟨C,1,[0,0,1,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,1],[0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3d : CCfg := + ⟨F,0,[0,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,0,0,1,1,0,0,0,0,1,0,0,0,1,0,1],[]⟩ +set_option maxRecDepth 4000000 in +theorem loc_z3e : zCm loc_z37 1000 = some loc_z38 := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3f : zCm loc_z38 1000 = some loc_z39 := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3g : zCm loc_z39 1000 = some loc_z3a := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3h : zCm loc_z3a 1000 = some loc_z3b := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3i : zCm loc_z3b 1000 = some loc_z3c := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3j : zCm loc_z3c 287 = some loc_z3d := by decide +theorem loc_z3k : + (init []) [target_tm]⊢⁺ zCf 4 (evalWords loc_z2Q default) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = loc_z2X loc_z37 := rfl + have h_end : loc_z2X loc_z3d = zCf 4 (evalWords loc_z2Q default) := by + simp [loc_z2X,loc_z3d,zCf,zCL,lh,w_pre,w_word,t,d0,d1,one,loc_z2Q,evalWords] + rw [h_init,<- h_end] + exact zPt (zTc (by decide) loc_z3e) (zPt (zTc (by decide) loc_z3f) (zPt (zTc (by decide) loc_z3g) (zPt (zTc (by decide) loc_z3h) (zPt (zTc (by decide) loc_z3i) ((zTc (by decide) loc_z3j)))))) +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d) = some c') : + (multiStep target_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +theorem loc_z3l (m : Nat) : + ∃ N ≥ m,∃ h w,multiStep target_tm (init []) N = some (zCf h (evalWords w default)) /\ EGood h w := by + induction m with + | zero => + rcases loc_z3k with ⟨k1,_,hk1⟩ + rcases loc_z2P loc_z2V with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,12,loc_z2R ++ loc_z2S, + zMt target_tm _ _ _ k1 k2 hk1 hk2,loc_z2W⟩ + | succ m ih => + rcases ih with ⟨N,hN,h,w,h_ms,h_good⟩ + rcases eGood_progress h_good with ⟨w',hStep,h_good'⟩ + rcases loc_z2O hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,h + 1,w', + zMt target_tm _ _ _ N k h_ms h_step_k,h_good'⟩ + +end Solution + + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases loc_z3l (n + 1) with ⟨N,hN,_,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := zIm h_N + rw [zMs,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RD_1RCHHH_1LD1LC_1LE0LC_1RF0RC_1RA0RF diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RD_1RCHHH_1LD1LE_1LE0LC_1RF1LD_1RA0RF.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RD_1RCHHH_1LD1LE_1LE0LC_1RF1LD_1RA0RF.lean new file mode 100644 index 00000000..c8aa2e57 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RD_1RCHHH_1LD1LE_1LE0LC_1RF1LD_1RA0RF.lean @@ -0,0 +1,1041 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusH +public import BusyBeaver.Calculi.WordCalculusI + + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.M_1RB0RD_1RCHHH_1LD1LE_1LE0LC_1RF1LD_1RA0RF + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RD_1RCHHH_1LD1LE_1LE0LC_1RF1LD_1RA0RF" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +open WordCalculus Word WordCanonBR WordCanonBR.BRIncs WordCanonBR.Choice +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +open WordCalculus Word WordCanonBR WordCanonBR.BRIncs WordCanonBR.Choice +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +local notation "WordList" => List Word + +def z29_0108 : WordList := ([K, V, V, V, V, V, K, V, V, V, V, K, Q, V, V, V, V, V, V, V, Q, Q, + Q, K, Q, Q, Q, Q, Q, K, Q, K] ++ [Q, Q, Q, Q]) + +def z2a_0108 : List (List Choice) := [ + [CS10, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, + CT, CT, CP1, CP0, CP1, CP1, CP0, CP0, CS01, CP1, CP0], + ([CT, (COC1 0), CSP1, (COC1 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, + CT] ++ [CP0, CS11, CP0, CS11, CP0, CS10, CS10, CS00, CS00, CS10, CS10, CS10, CS10, CS10, + CS11, CP0, CP0, CP1, CP0]), + (([CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, (COC1 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CT, CT, + CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + CT] ++ [(COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP1, (COC1 0), CSP1, (COC1 0), CSP1, CP0, + CS10, CP1, CP1, CP1, CT, CT, CT, (COC0 0), CSP1, CP0, CS11, CP0, CP1, CP0, CP1, CP0, CP0, + CS00, CS00, CS11]) ++ [CP1, CP0]), + (([CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), (CSC0 0), CSP1, CT, CT, CT, (COC0 0), + CSP0, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + CT] ++ [CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP1, CT, + (COC0 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, CT, + CT, (COC0 0), CSP0, CS10]) ++ [CS01, CT, CT, CP0, CS10, CS10, CP0, CS01, CP0, CP0, CS00, + CP1, CP0, CS11, CP1, CP1, CP1, CP1, CP1, CP1, CP0, CP0, CP0, CS00, CS11, CP1, CP0]), + (([CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CS10, CT, + CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, CT, + CT] ++ [CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CS11, CT, + (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), + CSP1, CT, CT]) ++ ([CT, CT, CT, (COC0 0), CSP0, CT, CP0, CT, CT, CT, CP1, (COC1 0), CSP0, + CT, (COC1 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, + CS11, CT, CT] ++ [CP0, CS10, CS11, CP1, CP1, CP1, CP0, CS10, CS00, CP0, CP0, CP1, CP0, + CS10, CS10, CS01, CP0, CS11, CP1, CP1, CP1, CP1, CP0, CP1, CP0, CP0, CS01, CP0, CS10, + CS11, CP1, CP0])), + ((([CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, (COC1 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, CT, CT, CT, CT] ++ [CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, + CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP0, CT, (COC1 0), CSP0, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, (COC1 0), CSP1, CT]) ++ ([CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, + CT, CT, CT, (COC0 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, + CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT] ++ [CT, CT, CP1, CT, CT, CT, CT, CP0, CT, CT, + CT, (COC0 0), CSP1, (COC1 1), CSP1, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CP1, + CT, CT, CP0, CP0, CP1, CP1])) ++ ([CP0, CS10, CS00, CP0, CP1, CP1, CP0, CP0, CS00, CP0, + CS00, CP0, CS01, CP1, CP0, CP0, CS01, CP0, CS10, CS10, CP1, CP0, CS11, CP1, CP1, CP1, CP1, + CP1, CP1, CP0, CP0, CP0] ++ [CP0, CS00, CS11, CP1, CP0])), + ((([CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, (COC1 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CT, CT, + CT, (COC0 0), CSP0, CS11, CT] ++ [CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, CT, (COC0 0), CSP1, + CT, CT, CT, CT, CT, (COC0 0)]) ++ ([CSP0, CT, (COC1 0), CSP1, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, (COC1 0), + CSP0, CT, CT, CT, CT, CT, CT, CT] ++ [CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, CT, + CT, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT])) ++ (([CT, CT, CT, CT, CT, CT, CT, CT, CP0, CT, CT, CT, CT, + (COC0 0), (CSC1 0), (CSC1 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CP1, CT, (COC0 0), CSP1, + CT, CT, CT, CT, CT, CT] ++ [CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CP0, CP0, CP1, CP1, + CP1, CP0, CS11, CP1, CP0, CP0, CS00, CS00, CS01, CP0, CS11, CP1, CP1, CP0, CP0, CS00, + CS00, CS00, CS00, CS10]) ++ ([CS00, CP0, CS00, CS10, CS11, CP0, CP1, CP1, CP0, CS10, CS00, + CS11, CP1, CP0, CS10, CS01, CP1, CP0, CP0, CS01, CP0, CS10, CS11, CP0, CP0, CS01, CP1, + CP1, CP1, CP1, CP0, CP1] ++ [CP0, CP0, CS00, CS00, CS11, CP0, CS10, CS01, CP1, CP0]))), + (((([CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), (CSC0 0), CSP1, CT, CT, CT, (COC0 0), + CSP0, CT, CT, CT, (COC0 0), (CSC1 0)] ++ [CSP1, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP0, CT, + (COC1 0), CSP0, CT, CT, CT, CT, CT, (COC0 0)]) ++ ([CSP0, CT, (COC1 0), CSP1, CT, CT, CT, + CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, + (COC0 0), CSP1, CT, CT, CT, CT, CT, CT, CT] ++ [CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, + CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, CT, CT, CT, + CT, (COC0 0), CSP0, CT, CT])) ++ (([CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CS11, (COC0 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), + CSP0, CT, CT, CT, CT] ++ [CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, + CT, CT, CT, (COC0 0), CSP1, CT, CT, (COC0 0), CSP0, CS10, (CEC 0), CSP1, CT, CT, CT, + (COC0 0), CSP0, CS10, CS00, (CEC 1)]) ++ ([CSP0, CP1, CT, CT, CT, CT, CP0, CS11, CT, CT, + CP0, CT, CT, (COC0 0), CSP0, CT, CP1, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CS10, CS01, CT] ++ [CP0, CT, CT, CP0, CS10, CP1, CP0, CS11, CP0, CS10, + CS01, CP0, CS11, CP1, CP1, CP0, CS10, CP0, CS00, CS10, CP1, CP1, CP1, CP1, CP1, CP1, CP0, + CS10, CP1, CP1, CP1, CP0]))) ++ ([CP0, CP1, CP1, CP1, CP1, CP1, CP0, CS11, CP1, CP0, CS10, + CP0, CS00, CP1, CP0, CS10, CS11, CP1, CP0, CP0, CP1, CP0, CS10, CP1, CP0, CS11, CP1, CP1, + CP1, CP1, CP1, CP1] ++ [CP0, CP0, CP0, CS00, CS11, CP0, CS10, CS01, CP1, CP0])), + (((([CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CS10, CT, CT, + CT, CT, (COC0 0), CSP0, CT] ++ [CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, CT, CT, + CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CS11, CT, (COC0 0), + CSP1, CT, (COC0 0), CSP1]) ++ ([CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, + CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), + CSP1, CT, (COC0 0), CSP0, CT] ++ [CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, + CT, CT])) ++ (([CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + CT, CT, CT, (COC0 0), CSP0, CT, CP0, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, + (COC0 0)] ++ [CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, + CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), (CSC0 0), CSP1, CT, CT, CT, + CT]) ++ ([(COC0 0), CSP0, CT, CP0, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, CT, CT, + CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, + CT] ++ [(COC0 0), CSP0, CT, CP0, CT, CT, CT, CT, (COC0 0), CSP1, CT, (COC0 0), CSP1, CT, + (COC0 1), CSP1, CT, CT, (COC0 0), CSP1, (COC1 0), CSP0, CS11, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP1, CT]))) ++ ((([CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, CT, + (COC0 0), CSP1, (COC1 0), CSP0, CT, CT, CP1, CT, CT, CT, CT, (COC0 0), CSP1, CT, (COC0 0), + CSP1, CT, CT, CT, CT] ++ [CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CP0, CT, CT, CP0, + CS10, CS11, CP1, CP1, CP0, CP0, CS01, CP0, CS10, CS11, CP0, CS10, CP1, CP0, CS10, CS11, + CP1, CP0, CS11, CP0]) ++ ([CP1, CP0, CS11, CP0, CS10, CS00, CP0, CS00, CS00, CS00, CS00, + CP1, CP1, CP0, CP0, CS00, CP1, CP0, CS10, CP1, CP1, CP0, CP0, CP1, CP1, CP0, CS10, CP0, + CS00, CS11, CP0, CS10] ++ [CP1, CP1, CP1, CP1, CP1, CP0, CS10, CP1, CP1, CP1, CP1, CP0, + CP1, CP1, CP1, CP1, CP0, CP0, CP1, CP1, CP0, CS10, CP0, CP1, CP0, CS10, CS11, CP1, CP0, + CP0, CS01, CP0])) ++ [CS10, CS11, CP0, CP0, CS01, CP1, CP1, CP1, CP1, CP0, CP1, CP0, CP0, + CS01, CP0, CS10, CS11, CP0, CS10, CS11, CP1, CP0])), + ((((([CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, (COC1 0), + CSP1, (COC1 0), CSP1, CT, CT, CT] ++ [(COC0 0), CSP0, CT, CT, CT, (COC0 0), (CSC1 0), + CSP1, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, + (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP0, CT, (COC1 0)]) ++ ([CSP0, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, + CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, (COC0 0), CSP0] ++ [CT, CT, CT, CT, CT, + CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, CT])) ++ (([CT, CT, CT, (COC0 0), CSP0, CT, CT, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT] ++ [(COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), + CSP0, CS10, CT, CT, CT, CT]) ++ ([CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, + CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CT, CT, + CT, CT, CT, CT] ++ [CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, + (COC1 0), CSP0, CT, (COC1 0), CSP0, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP1, + CT, CT, CT, CT, CT, (COC0 0), CSP0]))) ++ ((([CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, (COC1 0), (CSC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, + CT, (COC1 0), CSP0, CT, CT, CT, CT] ++ [CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, + CT, CT, CT, CP1, CT, CT, CT, (COC0 0), CSP0, CT, CP1, (COC1 0), CSP1, CT, CT, CP1, CT, + (COC0 0), CSP1, CT, CT, (COC0 0), CSP1]) ++ ([CT, (COC0 1), CSP0, CS10, CS00, CS10, CT, + CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, + (COC1 0), CSP0, CS11, (COC1 0), CSP1, CT, CT, CT, CT, CT] ++ [(COC0 0), CSP1, CT, CT, CT, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, CT, CT, CT, CP1, CT, CT, (COC0 0), + CSP0, CT, CP1, CT, (COC0 0), CSP0, CT, CT])) ++ (([CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, + CP1, CT, CP1, CT, CT, CP0, CP0, CP1, CP0, CS11, CP0, CS11, CP0, CP1, CP0, CS11, CP1, CP0, + CS10, CP1, CP0, CP0, CS00, CP0] ++ [CS01, CP0, CS10, CS01, CP0, CS11, CP0, CP1, CP1, CP0, + CS10, CP1, CP0, CS10, CP0, CP0, CS01, CP1, CP1, CP1, CP0, CP1, CP1, CP0, CP0, CS00, CS00, + CS01, CP0, CS10, CP0, CP1]) ++ ([CP1, CP0, CS10, CP0, CS00, CP1, CP0, CS11, CP1, CP1, CP0, + CS10, CP0, CP1, CP0, CS11, CP0, CP1, CP1, CP1, CP0, CP1, CP1, CP0, CS10, CP0, CS00, CP0, + CS00, CP0, CP1, CP1] ++ [CP1, CP1, CP1, CP1, CP0, CS10, CP1, CP1, CP1, CP0, CP0, CP1, CP1, + CP1, CP1, CP1, CP0, CS11, CP1, CP0, CS10, CS00, CP0, CP1, CP0, CS10, CS11, CP1, CP0, CP0, + CP1, CP0])))) ++ [CS10, CP1, CP0, CS11, CP1, CP1, CP1, CP1, CP1, CP1, CP0, CP0, CP0, CP0, + CS00, CS11, CP0, CS10, CS11, CP1, CP0]), + ((((([CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, (COC1 0), + CSP1, CT, (COC0 0), CSP1, (COC1 0), CSP1] ++ [CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, + (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, + CT, CT, CT, (COC0 0), CSP0, CS11]) ++ ([CT, (COC0 0), CSP1, CT, (COC0 0), CSP1, CT, CT, + CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, + CT, CT, CT, CT, CT, (COC0 0), CSP0, CT] ++ [(COC1 0), CSP1, CT, (COC0 0), CSP0, CT, CT, + CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + CT, CT, (COC0 0), (CSC1 0), CSP1])) ++ (([CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, + CT, CT] ++ [(COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, + CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, + (COC0 0)]) ++ ([(CSC0 0), CSP1, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, + CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), + CSP0, CT] ++ [CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), + CSP0, CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CS11, CT, + (COC0 0), CSP1, CT]))) ++ ((([CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, + CT, CT, CT, (COC0 0), CSP0, CT, CT, CP1, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, + CT] ++ [(COC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, + CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP1, CT, CT, CT]) ++ ([CT, + (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, CT, CP0, CS11, CT, CT, + (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, + CP1] ++ [CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT])) ++ (([CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, + CT, CT, CT, (COC0 0), CSP1, (COC1 0), CSP1, CT, CT, (COC0 0), CSP1, CT, + (COC0 0)] ++ [CSP1, CT, CT, (COC0 0), (CSC1 0), CSP0, CT, (COC1 1), CSP1, CT, CT, CT, + (COC0 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CS10, (CEC 0), CSP1]) ++ ([CT, CT, CT, (COC0 0), CSP1, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, CT, (COC0 0), CSP1, CT, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, CT, + CT, (COC0 0), CSP1, (COC1 0), (CSC0 0), CSP0, CT, CT] ++ [CT, CT, CT, CT, CT, (COC0 0), + CSP1, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, CT, CT, CP0, CT, CT, CT, + CP1, CT, CT, CT, CT, (COC0 0), CSP1])))) ++ ((([CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, + CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CP1, CT, CT, CP0, CP0, CS01, CP1, CP1, CP0, CP0, + CP0, CS00, CS10, CS11, CP0, CS10] ++ [CP1, CP0, CS10, CS11, CP1, CP0, CS10, CS00, CP0, + CS01, CP0, CS11, CP1, CP0, CP0, CS01, CP1, CP0, CP1, CP0, CS11, CP0, CP0, CS00, CS00, + CS00, CP0, CS00, CS00, CP0, CS01, CP0]) ++ ([CP1, CP1, CP0, CS10, CS00, CP0, CP0, CS00, + CS10, CS10, CP1, CP1, CP1, CP1, CP1, CP1, CP0, CS11, CP1, CP0, CP0, CS01, CP0, CP0, CS00, + CS00, CS11, CP1, CP0, CS10, CS00, CS01] ++ [CP0, CS10, CS10, CS00, CS10, CS10, CS11, CP0, + CS11, CP1, CP0, CS10, CP0, CP1, CP1, CP0, CS11, CP0, CS11, CP1, CP1, CP0, CS10, CS01, CP1, + CP0, CS10, CS01, CP0, CS10, CS00, CP1])) ++ (([CP0, CS10, CP1, CP1, CP0, CS10, CP0, CS00, + CS11, CP0, CS10, CS11, CP1, CP1, CP1, CP0, CS10, CP1, CP0, CS10, CP0, CP1, CP1, CP0, CP0, + CP1, CP1, CP0, CS10, CP0, CS00, CP1] ++ [CP0, CS10, CP1, CP1, CP1, CP1, CP1, CP1, CP0, + CS10, CP1, CP1, CP1, CP1, CP0, CP1, CP1, CP1, CP1, CP0, CP0, CS01, CP1, CP0, CS10, CS00, + CP0, CP1, CP0, CS10, CS11, CP1]) ++ [CP0, CP0, CS01, CP0, CS10, CS11, CP0, CP0, CS01, CP1, + CP1, CP1, CP1, CP0, CP1, CP0, CP0, CS00, CS00, CS11, CP0, CS10, CS01, CP0, CS10, CS01, + CP1, CP0]))), + ((((([CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, (COC1 0), + CSP1, CT, (COC0 0), CSP1, CT, (COC0 0)] ++ [(CSC0 0), CSP1, CT, CT, CT, (COC0 0), CSP0, + CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, (COC0 0), (CSC1 0)]) ++ ([CSP1, (COC1 0), CSP0, CT, (COC1 0), + CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT] ++ [(COC1 0), CSP1, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, + CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT])) ++ (([CT, CT, CT, CT, CT, CT, + CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT] ++ [(COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CT, + CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, (COC0 0), CSP0]) ++ ([CS10, CT, CT, CT, CT, CT, (COC0 0), CSP0, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, + CT, CT, CT, (COC0 0), CSP0, CT] ++ [CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, + CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, (COC1 0), CSP0, CT, CT]))) ++ ((([CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, + CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, (COC1 0)] ++ [CSP1, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), + CSP0, CT, CT, CT, CT, (COC0 0)]) ++ ([CSP0, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, + CT, CT, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, CT, CT, + CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT] ++ [CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), + CSP0, CT, CT, CT])) ++ (([(COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, + CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, (COC0 0), CSP0, CT, + (COC1 0), CSP0, CT] ++ [CT, (COC0 0), CSP0, CS11, CT, CT, (COC0 0), CSP1, CT, CT, CT, CT, + (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, (COC1 0), CSP0, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), (CSC1 0), CSP1, CT, CT]) ++ ([CT, CT, (COC0 0), (CSC1 0), CSP1, CT, (COC0 0), + CSP1, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CP0, CT, CT, CT, CT, CT] ++ [CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, + CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, (COC1 0)])))) ++ (((([CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), + CSP0, CP1, (COC0 0), CSP1, CT, CT, CP1] ++ [CT, CT, (COC0 1), (CSC1 0), CSP1, CT, CT, + (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CS10, (CEC 0), CSP0, + (CEC 0), CSP0, CT, CT, CT, CT, CP0, CT, (COC1 0), CSP0, CP1, CT]) ++ ([CT, CT, CT, CT, CT, + (COC0 0), CSP1, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CS10, CS01, CT, CT, CP0, + (CEC 0), CSP1, CP0, CS11, CP1, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, CT, + CT] ++ [(COC0 0), CSP1, (COC1 0), CSP1, CT, CT, CT, CP0, CT, CT, CP0, CT, CP0, CT, + (COC1 0), CSP1, CT, CT, (COC0 0), CSP1, (COC1 0), CSP0, CS11, CT, CP1, CT, CT, CT, + (COC0 0), CSP1, CT, (COC0 0)])) ++ (([CSP1, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, + (COC1 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, CT, CT, CT, + CT, CT, CT, CT, CT, CT] ++ [CT, (COC0 0), CSP0, CT, CT, CP0, CT, CT, CT, CP1, CT, CT, + (COC0 0), CSP0, CT, CP1, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, + CS10, CS01, CT, CP0]) ++ ([CT, CP0, CT, CT, CP0, CS10, CS11, CP0, CS11, CP1, CP0, CP0, + CS01, CP1, CP0, CS10, CS01, CP1, CP0, CP0, CS01, CP0, CP0, CS00, CS01, CP0, CP0, CS01, + CP0, CP0, CS00, CS00] ++ [CS10, CS10, CS01, CP0, CS11, CP0, CS10, CS10, CP1, CP1, CP1, + CP0, CS10, CP1, CP0, CS10, CS10, CP0, CS00, CS10, CS01, CP1, CP1, CP1, CP1, CP0, CP1, CP1, + CP0, CS10, CP0, CS01]))) ++ ((([CP1, CP0, CP0, CP0, CS01, CP0, CS10, CS00, CS10, CS10, + CP1, CP0, CS10, CS10, CS10, CS01, CP0, CS11, CP0, CS11, CP0, CS10, CS10, CP1, CP1, CP1, + CP0, CS10, CP1, CP1, CP0, CS10] ++ [CP0, CS00, CS11, CP1, CP0, CS10, CP1, CP1, CP1, CP1, + CP1, CP0, CS10, CS01, CP1, CP0, CS10, CS01, CP0, CP1, CP0, CP0, CS00, CS00, CS10, CP1, + CP0, CS11, CP0, CS10, CS00, CS11]) ++ ([CP1, CP1, CP1, CP1, CP0, CP1, CP1, CP0, CP0, CS01, + CP1, CP1, CP0, CS10, CP0, CS01, CP1, CP1, CP1, CP0, CS10, CS01, CP1, CP0, CP0, CS00, CS00, + CP0, CP1, CP0, CS10, CP1] ++ [CP1, CP0, CS10, CP0, CS00, CS11, CP0, CS10, CS11, CP1, CP1, + CP1, CP0, CS10, CP1, CP0, CS11, CP0, CP1, CP1, CP1, CP0, CP1, CP1, CP0, CS10, CP0, CS00, + CP1, CP0, CS10, CP1])) ++ ([CP1, CP1, CP1, CP1, CP1, CP0, CS10, CP1, CP1, CP1, CP0, CP0, + CP1, CP1, CP1, CP1, CP1, CP0, CS11, CP1, CP0, CS10, CS00, CP0, CP1, CP0, CS10, CS11, CP1, + CP0, CP0, CP1] ++ [CP0, CS10, CP1, CP0, CS11, CP1, CP1, CP1, CP1, CP1, CP1, CP0, CP0, CP0, + CS00, CS11, CP0, CS10, CS01, CP0, CS10, CS01, CP1, CP0])))) +] + +def z2b_0108 : WordList := ((((([V, V, K, K, V, V, V, V, V, K, V, V, V, V, K, Q, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, K, V] ++ [V, V, V, K, Q, V, V, Q, V, V, Q, V, V, V, V, V, V, K, + V, V, Q, V, V, V, V, V, V, K, V, V, V, V]) ++ ([V, V, V, K, V, V, Q, V, V, K, V, V, V, V, V, + V, V, V, V, K, Q, V, V, V, V, V, V, V, V, V, V, V] ++ [V, V, V, K, V, Q, V, V, V, V, V, V, + V, V, V, K, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V])) ++ (([K, V, V, V, V, V, V, K, + V, V, V, V, K, V, V, V, V, V, V, V, V, V, V, K, Q, V, V, V, V, V, V, V] ++ [V, V, K, V, V, + V, K, V, Q, V, V, V, V, V, K, V, V, V, V, V, V, V, V, V, V, V, K, V, V, V, V, V]) ++ ([K, V, + V, V, V, K, V, V, V, V, V, V, V, V, K, V, V, V, V, V, V, V, K, V, V, Q, V, V, K, V, V, + V] ++ [V, K, Q, V, V, Q, V, V, V, V, V, V, K, V, V, V, V, V, V, V, V, V, V, V, K, V, V, V, + V, V, V, V]))) ++ ((([V, V, V, V, V, K, V, V, Q, V, V, V, V, V, V, V, V, V, K, Q, V, V, V, + V, V, V, V, V, V, V, V, K] ++ [V, V, V, K, V, V, V, V, V, K, V, V, V, K, V, V, Q, V, V, V, + V, K, V, V, K, V, V, Q, V, V, V, V]) ++ ([V, V, V, K, V, Q, V, V, V, V, V, V, V, V, K, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, K, V, V] ++ [V, V, V, V, V, K, V, V, V, V, K, V, V, V, + V, V, V, V, V, K, V, V, V, V, V, V, V, V, V, V, V, K])) ++ (([Q, V, V, V, V, K, V, V, Q, V, + V, V, K, V, Q, V, V, K, V, V, V, V, V, K, V, V, Q, V, V, Q, V, V] ++ [V, V, V, V, V, V, K, + Q, V, V, V, V, V, V, K, Q, V, V, V, K, V, V, V, K, V, V, V, K, V, V, V, V]) ++ ([V, V, V, V, + K, V, V, V, V, V, V, V, V, V, V, V, K, V, V, V, V, V, V, V, V, V, V, V, K, V, V, V] ++ [V, + V, V, V, V, V, V, V, V, K, V, V, Q, V, V, V, V, V, V, V, V, V, V, K, Q, V, V, V, V, V, V, + V])))) ++ (((([K, V, V, V, V, V, K, V, V, K, V, V, V, V, V, V, K, V, Q, V, V, V, V, K, V, V, + V, V, K, V, V, K] ++ [V, Q, V, V, V, V, V, V, V, V, V, V, Q, V, V, V, V, V, V, V, V, K, V, + V, V, K, V, V, Q, V, Q, K]) ++ ([V, V, V, V, V, V, Q, V, Q, V, V, K, V, V, V, V, K, V, Q, V, + V, V, V, V, V, V, V, V, V, V, Q, V] ++ [V, V, K, V, Q, V, Q, V, V, V, V, V, K, V, V, K, V, + V, V, V, V, V, V, V, K, V, Q, V, V, Q, V, V])) ++ (([V, V, V, V, V, K, V, V, V, V, V, V, V, + V, V, V, V, K, V, V, V, V, V, V, V, V, V, V, K, V, V, V] ++ [V, K, V, V, V, V, V, V, V, V, + K, V, Q, K, V, V, V, V, V, V, V, Q, Q, V, Q, V, V, V, K, V, V, Q]) ++ ([K, V, V, V, K, V, V, + K, K, V, V, K, V, V, K, K, Q, Q, K, V, Q, V, Q, Q, V, V, V, V, Q, V, V, Q] ++ [Q, V, K, Q, + K, V, V, V, V, V, V, V, V, Q, V, K, V, V, V, V, K, V, Q, K, Q, Q, V, V, Q, Q, Q, + K]))) ++ ((([V, Q, V, Q, V, Q, Q, V, V, V, V, Q, V, V, V, Q, V, K, Q, V, V, Q, V, V, V, V, + V, V, Q, K, V, V] ++ [Q, K, V, V, V, V, K, K, Q, V, V, Q, V, Q, K, Q, V, V, V, V, V, V, V, + V, V, K, V, V, V, Q, V, K]) ++ ([V, V, V, V, Q, K, V, V, V, K, K, V, V, V, Q, V, V, V, Q, V, + K, Q, V, Q, Q, V, V, V, V, Q, V, V] ++ [Q, V, V, V, V, V, V, V, V, Q, V, K, V, V, Q, V, V, + V, V, V, V, V, Q, V, V, V, V, V, V, V, V, V])) ++ ([V, V, Q, V, V, Q, K, V, V, V, Q, Q, V, + V, V, V, V, Q, V, V, Q, V, V, V, V, V, V, V, V, V, K, Q] ++ [V, Q, K, V, Q, K, V, V])))) + +def z2c_low_0108 : WordList := (((([Q, K, K, Q, Q, Q, Q, Q, K, Q, K, Q, K, K, K, Q, Q, K, K, Q, + Q, Q, K, K, Q, Q, Q, Q, K, Q, K, Q] ++ [K, Q, Q, K, Q, Q, Q, K, Q, K, K, Q, Q, K, Q, K, K, + Q, K, Q, Q, Q, Q, Q, K, Q, K, K, K, K, Q, K]) ++ ([K, Q, Q, K, Q, K, K, K, K, K, K, K, K, Q, + Q, Q, K, K, K, Q, K, Q, K, K, K, Q, K, K, Q, K, Q, Q] ++ [Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, + Q, Q, K, Q, Q, K, Q, Q, Q, Q, K, K, Q, Q, K, K, Q, Q, K, K, K])) ++ (([K, Q, K, K, K, K, Q, + K, Q, K, K, Q, Q, K, Q, Q, K, Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, K, K, K] ++ [Q, Q, K, Q, + Q, Q, K, K, Q, K, K, K, K, Q, K, Q, Q, K, K, Q, Q, Q, Q, K, Q, K, Q, Q, Q, Q, Q, K]) ++ ([K, + Q, K, Q, Q, Q, Q, Q, Q, Q, Q, K, K, Q, Q, Q, Q, Q, Q, Q, Q, K, K, Q, Q, Q, Q, Q, Q, K, K, + Q] ++ [K, Q, Q, Q, Q, Q, K, K, K, K, Q, K, K, Q, K, Q, K, Q, K, Q, Q, Q, K, K, Q, K, K, Q, + Q, K, Q, K]))) ++ ((([Q, K, K, K, Q, K, Q, Q, Q, Q, Q, Q, K, K, Q, Q, Q, Q, Q, K, K, Q, K, + K, Q, Q, Q, Q, K, K, Q, Q] ++ [Q, Q, Q, Q, Q, Q, Q, Q, Q, K, K, Q, Q, Q, Q, Q, Q, Q, Q, K, + Q, Q, Q, K, Q, Q, K, Q, K, Q, Q, Q]) ++ ([K, Q, K, K, K, K, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, K, + Q, Q, Q, Q, Q, K, Q, K, Q, Q, Q, Q, Q, Q, Q] ++ [Q, K, K, Q, Q, Q, Q, Q, Q, Q, Q, K, K, Q, + Q, Q, K, K, K, Q, Q, Q, K, K, Q, Q, Q, K, K, Q, Q, Q])) ++ (([Q, Q, K, K, Q, K, K, Q, Q, K, + K, Q, Q, Q, Q, Q, Q, Q, Q, K, K, Q, Q, Q, K, K, Q, K, Q, Q, Q, Q] ++ [Q, K, Q, K, Q, Q, Q, + Q, Q, K, K, Q, K, K, Q, Q, Q, K, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q]) ++ ([K, K, Q, Q, + Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, K, Q, Q, Q, Q, K, K, K, Q] ++ [K, + Q, Q, Q, K, K, Q, Q, Q, Q, K, Q, K, Q, Q, K, K, Q, Q, K, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, + Q])))) + +def z2c_top_0108 : WordList := [Q,K,Q,Q,Q,K,Q,K,Q,Q,K,K,Q,Q,K,K] + +def z2c_0108 : WordList := z2c_low_0108 ++ z2c_top_0108 + +theorem z2d_0108 : + CanonRounds (evalWords z29_0108 default) + (evalWords (prefix33Words ++ (z2b_0108 ++ (z2c_0108 ++ tail8Words))) default) := + evalCanonRounds_sound z2a_0108 z29_0108 + (prefix33Words ++ (z2b_0108 ++ (z2c_0108 ++ tail8Words))) + (by decide +kernel) + +theorem z2e_0108 : + BGood (z2b_0108 ++ (z2c_0108 ++ tail8Words)) := by + apply bGood_of_check z2b_0108 z2c_low_0108 z2c_top_0108 <;> decide +kernel + +def zTail_0108 : WordList := [Q,Q,V,V,V,K,V,V,V,V,K,V,Q,Q,K,Q,Q,Q,K,Q,Q,Q] + +def zCh_0108 : List Choice := [CP1, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), (CSC1 0), + CSP1, CP0, CP1, CP0, CP1, CP0] + +def zBrOut_0108 : WordList := ([V, V, V, K, V, V, V, V, K, Q, V, V, V, V, V, V, V, Q, Q, Q, K, + Q, Q, Q, Q, Q, K, Q, K, Q, Q, Q] ++ [Q]) + +def zCk0_0108 : CCfg := ⟨D,0,[],[]⟩ + +def zCk1_0108 : CCfg := ⟨B, 0, (([1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1] ++ [1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1]) ++ [0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, + 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), [0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1]⟩ + +def zCk2_0108 : CCfg := ⟨B, 0, (([1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1] ++ [1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, + 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1]) ++ [1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), + [1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1]⟩ + +def zCk3_0108 : CCfg := ⟨B, 0, (([1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1] ++ [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, + 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1]) ++ [1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, + 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), [0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, + 1]⟩ + +def zCk4_0108 : CCfg := ⟨C, 1, (([1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] ++ [0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1]) ++ [0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, + 1, 1, 0, 1, 0, 0, 1]), [0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, + 1]⟩ + +def zCk5_0108 : CCfg := ⟨C, 1, [0, 1], (([0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, + 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0] ++ [0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, + 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1]) ++ ([0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, + 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0] ++ [1, 0, 0, 0, 1, 0, 1, 0, 1, + 0, 0, 0, 1, 0, 1, 0, 1]))⟩ + +def zCkK0_0108 : CCfg := zCk0_0108 + +def zCkK1_0108 : CCfg := ⟨2,0, + [1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1], + [0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1]⟩ + +theorem zStK_1 : (c_to_cfg zCkK0_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK1_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK0_0108 800 = some zCkK1_0108) + +def zCkK2_0108 : CCfg := ⟨0, 0, ([1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, + 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0] ++ [1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, + 0, 1, 1, 1, 0, 1, 0, 0, 1]), [1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1]⟩ + +theorem zStK_2 : (c_to_cfg zCkK1_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK2_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK1_0108 800 = some zCkK2_0108) + +def zCkK3_0108 : CCfg := ⟨0, 0, ([1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, + 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0] ++ [1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, + 0, 1, 1, 1, 0, 1, 0, 0, 1]), [0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]⟩ + +theorem zStK_3 : (c_to_cfg zCkK2_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK3_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK2_0108 800 = some zCkK3_0108) + +def zCkK4_0108 : CCfg := ⟨2, 0, [1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 0, 0, 1], ([0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, + 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0] ++ [1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1])⟩ + +theorem zStK_4 : (c_to_cfg zCkK3_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK4_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK3_0108 800 = some zCkK4_0108) + +def zCkK5_0108 : CCfg := ⟨1, 0, (([1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, + 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1] ++ [1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1]) ++ [1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, + 1]), [1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1]⟩ + +theorem zStK_5 : (c_to_cfg zCkK4_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK5_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK4_0108 800 = some zCkK5_0108) + +def zCkK6_0108 : CCfg := ⟨3, 1, (([1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1] ++ [1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1]) ++ [1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, + 1]), [1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1]⟩ + +theorem zStK_6 : (c_to_cfg zCkK5_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK6_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK5_0108 800 = some zCkK6_0108) + +def zCkK7_0108 : CCfg := ⟨1, 1, (([1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, + 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1] ++ [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, + 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1]) ++ [0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), [0, 0, 0, 1, 0, 1, 0, 0, 0, 1]⟩ + +theorem zStK_7 : (c_to_cfg zCkK6_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK7_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK6_0108 800 = some zCkK7_0108) + +def zCkK8_0108 : CCfg := ⟨4, 0, (([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, + 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1] ++ [1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1]) ++ [1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 1]), [1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]⟩ + +theorem zStK_8 : (c_to_cfg zCkK7_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK8_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK7_0108 800 = some zCkK8_0108) + +def zCkK9_0108 : CCfg := ⟨1, 1, (([1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] ++ [1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1]) ++ [0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), [1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1]⟩ + +theorem zStK_9 : (c_to_cfg zCkK8_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK9_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK8_0108 800 = some zCkK9_0108) + +def zCkK10_0108 : CCfg := ⟨1, 0, (([1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, + 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1] ++ [0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1]) ++ [0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), [0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1]⟩ + +theorem zStK_10 : (c_to_cfg zCkK9_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK10_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK9_0108 800 = some zCkK10_0108) + +def zCkK11_0108 : CCfg := ⟨1, 1, (([1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1] ++ [1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1]) ++ [0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]⟩ + +theorem zStK_11 : (c_to_cfg zCkK10_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK11_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK10_0108 800 = some zCkK11_0108) + +def zCkK12_0108 : CCfg := ⟨1, 0, (([1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, + 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1] ++ [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1]) ++ ([1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, + 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0] ++ [0, 1])), [0, 1, 0, 0, 0, 0, 0, 1]⟩ + +theorem zStK_12 : (c_to_cfg zCkK11_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK12_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK11_0108 800 = some zCkK12_0108) + +def zCkK13_0108 : CCfg := ⟨2, 1, (([0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] ++ [0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1]) ++ [1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 0, 0, 1]), [0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1]⟩ + +theorem zStK_13 : (c_to_cfg zCkK12_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK13_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK12_0108 800 = some zCkK13_0108) + +def zCkK14_0108 : CCfg := ⟨1, 1, (([1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, + 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1] ++ [1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, + 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1]) ++ [0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1]⟩ + +theorem zStK_14 : (c_to_cfg zCkK13_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK14_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK13_0108 800 = some zCkK14_0108) + +def zCkK15_0108 : CCfg := ⟨1, 1, (([1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, + 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] ++ [1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, + 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1]) ++ [0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), [1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1]⟩ + +theorem zStK_15 : (c_to_cfg zCkK14_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK15_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK14_0108 800 = some zCkK15_0108) + +def zCkK16_0108 : CCfg := ⟨4, 0, ([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, + 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1] ++ [1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, + 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), ([0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, + 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1] ++ [0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1])⟩ + +theorem zStK_16 : (c_to_cfg zCkK15_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK16_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK15_0108 800 = some zCkK16_0108) + +def zCkK17_0108 : CCfg := ⟨1, 1, (([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, + 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1] ++ [0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1]) ++ ([0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, + 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1] ++ [1, 0, 1, 1, 1, 0, 1, 0, 0, 1])), + []⟩ + +theorem zStK_17 : (c_to_cfg zCkK16_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK17_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK16_0108 800 = some zCkK17_0108) + +def zCkK18_0108 : CCfg := ⟨1, 0, (([1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1] ++ [0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1]) ++ [1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), [0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 1]⟩ + +theorem zStK_18 : (c_to_cfg zCkK17_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK18_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK17_0108 800 = some zCkK18_0108) + +def zCkK19_0108 : CCfg := ⟨1, 0, (([1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, + 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1] ++ [1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, + 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0]) ++ [1, 0, 0, 1]), ([0, 1, 1, 0, 0, 1, 1, 0, 0, + 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0] ++ [0, 1, 0, 0, 0, 0, + 0, 1])⟩ + +theorem zStK_19 : (c_to_cfg zCkK18_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK19_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK18_0108 800 = some zCkK19_0108) + +def zCkK20_0108 : CCfg := ⟨2, 1, (([0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, + 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1] ++ [0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0]) ++ [1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, + 0, 1]), [0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, + 1]⟩ + +theorem zStK_20 : (c_to_cfg zCkK19_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK20_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK19_0108 800 = some zCkK20_0108) + +def zCkK21_0108 : CCfg := ⟨2, 1, (([0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, + 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1] ++ [0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1]) ++ [0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), [0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, + 1]⟩ + +theorem zStK_21 : (c_to_cfg zCkK20_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK21_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK20_0108 800 = some zCkK21_0108) + +def zCkK22_0108 : CCfg := ⟨2, 1, (([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, + 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1] ++ [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1]) ++ [1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 0, 0, 1]), [0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, + 1]⟩ + +theorem zStK_22 : (c_to_cfg zCkK21_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK22_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK21_0108 800 = some zCkK22_0108) + +def zCkK23_0108 : CCfg := ⟨1, 1, (([1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, + 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1] ++ [1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1]) ++ [1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, + 1]), [1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, + 1]⟩ + +theorem zStK_23 : (c_to_cfg zCkK22_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK23_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK22_0108 800 = some zCkK23_0108) + +def zCkK24_0108 : CCfg := ⟨3, 1, (([0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1] ++ [1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1]) ++ [1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 1]), [1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, + 1]⟩ + +theorem zStK_24 : (c_to_cfg zCkK23_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK24_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK23_0108 800 = some zCkK24_0108) + +def zCkK25_0108 : CCfg := ⟨1, 0, (([1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1] ++ [1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1]) ++ [1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, + 1]), [1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, + 1]⟩ + +theorem zStK_25 : (c_to_cfg zCkK24_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK25_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK24_0108 800 = some zCkK25_0108) + +def zCkK26_0108 : CCfg := ⟨4, 0, (([0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, + 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1] ++ [1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, + 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1]) ++ [0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), [1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, + 1]⟩ + +theorem zStK_26 : (c_to_cfg zCkK25_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK26_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK25_0108 800 = some zCkK26_0108) + +def zCkK27_0108 : CCfg := ⟨1, 0, (([1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, + 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] ++ [1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, + 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1]) ++ [0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), [1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, + 1]⟩ + +theorem zStK_27 : (c_to_cfg zCkK26_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK27_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK26_0108 800 = some zCkK27_0108) + +def zCkK28_0108 : CCfg := ⟨2, 1, (([1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1] ++ [1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, + 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1]) ++ [0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), [0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, + 1]⟩ + +theorem zStK_28 : (c_to_cfg zCkK27_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK28_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK27_0108 800 = some zCkK28_0108) + +def zCkK29_0108 : CCfg := ⟨2, 1, (([0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, + 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1] ++ [0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, + 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1]) ++ [1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 0, 0, 1]), [0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1]⟩ + +theorem zStK_29 : (c_to_cfg zCkK28_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK29_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK28_0108 800 = some zCkK29_0108) + +def zCkK30_0108 : CCfg := ⟨2, 1, (([1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1] ++ [0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, + 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1]) ++ [0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 0, 0, 1]), [0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1]⟩ + +theorem zStK_30 : (c_to_cfg zCkK29_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK30_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK29_0108 800 = some zCkK30_0108) + +def zCkK31_0108 : CCfg := ⟨2, 1, (([0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1] ++ [0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, + 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1]) ++ [1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, + 0, 1]⟩ + +theorem zStK_31 : (c_to_cfg zCkK30_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK31_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK30_0108 800 = some zCkK31_0108) + +def zCkK32_0108 : CCfg := ⟨1, 1, (([1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, + 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1] ++ [0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1]) ++ [1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), ([1, 0, 0, + 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, + 0] ++ [0, 0, 0, 1])⟩ + +theorem zStK_32 : (c_to_cfg zCkK31_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK32_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK31_0108 800 = some zCkK32_0108) + +def zCkK33_0108 : CCfg := ⟨4, 0, (([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1] ++ [0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0]) ++ [1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, + 0, 1]), [0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 1]⟩ + +theorem zStK_33 : (c_to_cfg zCkK32_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK33_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK32_0108 800 = some zCkK33_0108) + +def zCkK34_0108 : CCfg := ⟨3, 1, (([1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, + 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1] ++ [0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1]) ++ [1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), ([1, 0, 0, + 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, + 0] ++ [0, 0, 0, 1])⟩ + +theorem zStK_34 : (c_to_cfg zCkK33_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK34_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK33_0108 800 = some zCkK34_0108) + +def zCkK35_0108 : CCfg := ⟨2, 1, (([0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, + 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1] ++ [0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1]) ++ [1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 0, 0, 1]), [0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, + 0, 1]⟩ + +theorem zStK_35 : (c_to_cfg zCkK34_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK35_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK34_0108 800 = some zCkK35_0108) + +def zCkK36_0108 : CCfg := ⟨3, 1, (([1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1] ++ [1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1]) ++ [1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 1]), [1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, + 0, 1]⟩ + +theorem zStK_36 : (c_to_cfg zCkK35_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK36_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK35_0108 800 = some zCkK36_0108) + +def zCkK37_0108 : CCfg := ⟨1, 1, (([1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, + 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1] ++ [1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1]) ++ [1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 1]), [1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, + 0, 1]⟩ + +theorem zStK_37 : (c_to_cfg zCkK36_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK37_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK36_0108 800 = some zCkK37_0108) + +def zCkK38_0108 : CCfg := ⟨4, 0, [0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, + 0, 1, 0, 0, 1], (([1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, + 0, 1, 1, 0, 0, 1, 1, 0] ++ [0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, + 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0]) ++ [0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, + 0, 1])⟩ + +theorem zStK_38 : (c_to_cfg zCkK37_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK38_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK37_0108 800 = some zCkK38_0108) + +def zCkK39_0108 : CCfg := ⟨1, 1, (([1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1] ++ [1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1]) ++ [1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 1]), [1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, + 0, 1]⟩ + +theorem zStK_39 : (c_to_cfg zCkK38_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK39_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK38_0108 800 = some zCkK39_0108) + +def zCkK40_0108 : CCfg := ⟨1, 0, (([1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, + 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1] ++ [1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1]) ++ [1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 1]), [1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, + 0, 1]⟩ + +theorem zStK_40 : (c_to_cfg zCkK39_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK40_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK39_0108 800 = some zCkK40_0108) + +def zCkK41_0108 : CCfg := ⟨2, 1, (([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, + 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1] ++ [1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, + 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0]) ++ [0, 1]), ([0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, + 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1] ++ [0, 1, 0, 1, 0, 1, 0, 1, + 0, 0, 0, 1])⟩ + +theorem zStK_41 : (c_to_cfg zCkK40_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK41_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK40_0108 800 = some zCkK41_0108) + +def zCkK42_0108 : CCfg := ⟨2, 1, (([0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1] ++ [0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, + 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1]) ++ [1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 0, 0, 1]), [0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 0, 1]⟩ + +theorem zStK_42 : (c_to_cfg zCkK41_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK42_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK41_0108 800 = some zCkK42_0108) + +def zCkK43_0108 : CCfg := ⟨4, 0, (([0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1] ++ [1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1]) ++ [1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, + 1]), [1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 1, 0, 1]⟩ + +theorem zStK_43 : (c_to_cfg zCkK42_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK43_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK42_0108 800 = some zCkK43_0108) + +def zCkK44_0108 : CCfg := ⟨2, 1, ([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, + 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1] ++ [1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, + 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), ([0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, + 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1] ++ [0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, + 1, 0, 1])⟩ + +theorem zStK_44 : (c_to_cfg zCkK43_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK44_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK43_0108 800 = some zCkK44_0108) + +def zCkK45_0108 : CCfg := ⟨4, 0, (([0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, + 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] ++ [1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1]) ++ [0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), [1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, + 0, 1]⟩ + +theorem zStK_45 : (c_to_cfg zCkK44_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK45_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK44_0108 800 = some zCkK45_0108) + +def zCkK46_0108 : CCfg := ⟨1, 1, (([1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, + 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1] ++ [0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1]) ++ [0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 0, 0, 1]), [0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, + 0, 1]⟩ + +theorem zStK_46 : (c_to_cfg zCkK45_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK46_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK45_0108 800 = some zCkK46_0108) + +def zCkK47_0108 : CCfg := ⟨4, 0, (([0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1] ++ [0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1]) ++ [0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), [0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, + 0, 1]⟩ + +theorem zStK_47 : (c_to_cfg zCkK46_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK47_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK46_0108 800 = some zCkK47_0108) + +def zCkK48_0108 : CCfg := ⟨1, 0, (([1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, + 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] ++ [1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1]) ++ [0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), [1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, + 0, 1]⟩ + +theorem zStK_48 : (c_to_cfg zCkK47_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK48_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK47_0108 800 = some zCkK48_0108) + +def zCkK49_0108 : CCfg := ⟨1, 0, (([1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, + 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1] ++ [0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1]) ++ [0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1]), [0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, + 0, 1]⟩ + +theorem zStK_49 : (c_to_cfg zCkK48_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK49_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK48_0108 800 = some zCkK49_0108) + +def zCkK50_0108 : CCfg := ⟨2, 1, (([1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] ++ [0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1]) ++ [0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 0, 0, 1]), [0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, + 0, 1]⟩ + +theorem zStK_50 : (c_to_cfg zCkK49_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK50_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK49_0108 800 = some zCkK50_0108) + +def zCkK51_0108 : CCfg := ⟨2, 1, [0, 1], (([0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, + 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0] ++ [0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, + 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1]) ++ ([0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, + 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0] ++ [1, 0, 0, 0, 1, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 1, 0, 1]))⟩ + +theorem zStK_51 : (c_to_cfg zCkK50_0108) [canon_tm]⊢⁺ (c_to_cfg zCkK51_0108) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCkK50_0108 537 = some zCkK51_0108) + +private theorem zBr0_0108 : + BRIncs false 64 (evalWords (zTail_0108 ++ [K]) default) (evalWords zBrOut_0108 default) := + evalChoiceList_sound zCh_0108 false 64 (zTail_0108 ++ [K]) zBrOut_0108 (by decide +kernel) + +theorem z0E_0108 : (c_to_cfg zCk0_0108) [canon_tm]⊢⁺ (cfgCanon (evalWords z29_0108 default)) := by + have h_all : (c_to_cfg zCk0_0108) [canon_tm]⊢⁺ (c_to_cfg zCk5_0108) := + (stepPlus_trans_canon + (stepPlus_trans_canon + (stepPlus_trans_canon + (stepPlus_trans_canon + (stepPlus_trans_canon + (stepPlus_trans_canon zStK_1 zStK_2) + (stepPlus_trans_canon zStK_3 zStK_4)) + (stepPlus_trans_canon + (stepPlus_trans_canon zStK_5 zStK_6) + (stepPlus_trans_canon zStK_7 zStK_8))) + (stepPlus_trans_canon + (stepPlus_trans_canon + (stepPlus_trans_canon zStK_9 zStK_10) + (stepPlus_trans_canon zStK_11 zStK_12)) + (stepPlus_trans_canon + (stepPlus_trans_canon zStK_13 zStK_14) + (stepPlus_trans_canon zStK_15 zStK_16)))) + (stepPlus_trans_canon + (stepPlus_trans_canon + (stepPlus_trans_canon + (stepPlus_trans_canon zStK_17 zStK_18) + (stepPlus_trans_canon zStK_19 zStK_20)) + (stepPlus_trans_canon + (stepPlus_trans_canon zStK_21 zStK_22) + (stepPlus_trans_canon zStK_23 zStK_24))) + (stepPlus_trans_canon + (stepPlus_trans_canon + (stepPlus_trans_canon zStK_25 zStK_26) + (stepPlus_trans_canon zStK_27 zStK_28)) + (stepPlus_trans_canon + (stepPlus_trans_canon zStK_29 zStK_30) + (stepPlus_trans_canon zStK_31 zStK_32))))) + (stepPlus_trans_canon + (stepPlus_trans_canon + (stepPlus_trans_canon + (stepPlus_trans_canon + (stepPlus_trans_canon zStK_33 zStK_34) + (stepPlus_trans_canon zStK_35 zStK_36)) + (stepPlus_trans_canon + (stepPlus_trans_canon zStK_37 zStK_38) + (stepPlus_trans_canon zStK_39 zStK_40))) + (stepPlus_trans_canon + (stepPlus_trans_canon + (stepPlus_trans_canon zStK_41 zStK_42) + (stepPlus_trans_canon zStK_43 zStK_44)) + (stepPlus_trans_canon + (stepPlus_trans_canon zStK_45 zStK_46) + (stepPlus_trans_canon zStK_47 zStK_48)))) + (stepPlus_trans_canon + (stepPlus_trans_canon zStK_49 zStK_50) zStK_51))) + have heq : c_to_cfg zCk5_0108 = + cfgLeft lh (w_pre +> ((d0 ++ t ++ (t ++ one)) +> evalWords zTail_0108 default)) := by + simp only [c_to_cfg, C, WordCanonBR.C, zCk5_0108, zCL, cfgLeft, lh, w_pre, w_pre_rest, + w_pre5_rest, w_pre3_rest, w_word, + zTail_0108, evalWords, t, d0, d1, one, List.cons_append, List.nil_append, append_cons, + append_nil, z00, zero_cons_default_canon, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] + rw [heq] at h_all + have h_br0 := zBr0_0108 + have h_br : BRIncs false 64 (evalWords zTail_0108 default) (evalWords zBrOut_0108 default) := by + simpa only [evalWords_append,evalWords,d0_append_default] using! h_br0 + have h_side31 : + Side ([.cj] ++ [.ch] ^ 31) (evalWords zTail_0108 default) + (evalWords zBrOut_0108 default) := by + simpa only [append_nil] using! numSide_of_brIncs h_br [] ([.cj] ++ [.ch] ^ 31) (Num.even 31) + have h_side16 := side_of_seg seg_ch_16_to_31 h_side31 + have h_turn := stepPlus_word_pre_full h_side16 + have h_out : (d0 ++ t ++ t) +> evalWords zBrOut_0108 default = evalWords z29_0108 default := by + simp only [zBrOut_0108, z29_0108, evalWords, t, d0, d1, List.cons_append, List.nil_append, + append_cons, append_nil] + rw [h_out] at h_turn + exact stepPlus_trans_canon h_all h_turn + +theorem z2s_0108 (m : Nat) : + ∃ N ≥ m,∃ w,multiStep canon_tm (c_to_cfg zCk0_0108) N = + some (cfgCanon (evalWords (prefix33Words ++ w) default)) /\ BGood w := by + induction m with + | zero => + rcases z0E_0108 with ⟨k1,_,hk1⟩ + rcases stepStar_of_canonRounds z2d_0108 with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,z2b_0108 ++ (z2c_0108 ++ tail8Words), + multiStep_trans_canon canon_tm _ _ _ k1 k2 hk1 hk2,z2e_0108⟩ + | succ m ih => + rcases ih with ⟨N,hN,w,h_ms,h_good⟩ + rcases bGood_progress h_good with ⟨w',hStep,h_good'⟩ + rcases stepPlus_of_bStep hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,w', + multiStep_trans_canon canon_tm _ _ _ N k h_ms h_step_k,h_good'⟩ + +def zStMap_0108 : Fin 6 -> Fin 6 + | 0 => 3 + | 1 => 4 + | 2 => 5 + | 3 => 0 + | 4 => 2 + | 5 => 1 + +def zCfgMap_0108 (c : Cfg (Fin 2) (Fin 6)) : Cfg (Fin 2) (Fin 6) := + ⟨c.q.map zStMap_0108,⟨c.tape.head,c.tape.right,c.tape.left⟩⟩ + +theorem zStepMap_0108 (c : Cfg (Fin 2) (Fin 6)) : + step target_tm (zCfgMap_0108 c) = (step canon_tm c).map zCfgMap_0108 := by + rcases c with ⟨_ | ⟨_ | _ | _ | _ | _ | _ | q,hq⟩,⟨h,l,r⟩⟩ <;> + rcases h with ⟨_ | _ | a,ha⟩ <;> + first | omega | rfl + +theorem zMultiStepMap_0108 (c : Cfg (Fin 2) (Fin 6)) (n : Nat) : + multiStep target_tm (zCfgMap_0108 c) n = (multiStep canon_tm c n).map zCfgMap_0108 := by + induction n with + | zero => rfl + | succ n ih => + rw [multiStep_succ_canon,multiStep_succ_canon,ih] + cases multiStep canon_tm c n with + | none => rfl + | some c' => exact zStepMap_0108 c' + +end Solution +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + + + +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases z2s_0108 (n + 1) with ⟨N,hN,_,h_N,_⟩ + have h_init : zCfgMap_0108 (c_to_cfg zCk0_0108) = init [] := rfl + have h_map := zMultiStepMap_0108 (c_to_cfg zCk0_0108) N + rw [h_init,h_N] at h_map + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_map + have h_some := multiStep_add_Intermediate h_map + rw [multiStep_succ_canon,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RD_1RCHHH_1LD1LE_1LE0LC_1RF1LD_1RA0RF diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC0LE_1LD0LC_1RA0LA_1RA1RF_1RAHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC0LE_1LD0LC_1RA0LA_1RA1RF_1RAHHH.lean new file mode 100644 index 00000000..f3643468 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC0LE_1LD0LC_1RA0LA_1RA1RF_1RAHHH.lean @@ -0,0 +1,1147 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RE_1LC0LE_1LD0LC_1RA0LA_1RA1RF_1RAHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC0LE_1LD0LC_1RA0LA_1RA1RF_1RAHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +abbrev holdout_0193_tm : Machine (Fin 2) (Fin 6) := target_tm +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 2000000 +@[simp] theorem zMz (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : HalfTape).head = 0 := rfl +@[simp] theorem zDt : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem zPs {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem zPt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,by omega,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ +local macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +local macro "gstep" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt]) +local macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | gstep))) +abbrev CCfg := Counter.CCfg (Fin 2) (Fin 6) +abbrev z04 (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev z0b (c : CCfg) : Option CCfg := Counter.bstep holdout_0193_tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep holdout_0193_tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (z04 c1) [holdout_0193_tm]⊢⁺ (z04 c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ +abbrev t : BitWord := [1,1,0,0] +abbrev d0 : BitWord := [0,0] +abbrev d1 : BitWord := [1,0] +abbrev one : BitWord := [1] +abbrev lh : HalfTape := [1,0,1] +> default +abbrev w_pre : BitWord := t ++ t ++ one +@[simp] theorem zDd : d0 +> (default : HalfTape) = default := by + simp [d0] +inductive Call where + | ch + | cj + | cp + | ca +def zCs : Call -> Fin 6 + | .ch => B + | .cj => A + | .cp => A + | .ca => B +def zCw : Call -> BitWord + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] + | .ca => [1,1,1,0,1,0] +def zCR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + ((l <+ zCw c) {{zCs c}}> r) +def zCL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (l <{{C}} ([0] +> r)) +def zCf (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + zCL lh (w_pre +> r) +def z0f (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l,(zCR l c r1) [holdout_0193_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + z0f c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem z0g {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z0h {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem z0i {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z0j {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z0k {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0l (w : BitWord) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem z0m (ls : List Call) : Seg ls ls [] [] := by + intro r1 r2 h; exact h +theorem zSc {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases z0k h with ⟨r2,ha,hb⟩ + exact z0j (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS0 {ls1 ls2 ls3 : List Call} {w1 w2 v1 v2 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls2 ls3 v1 v2) : + Seg ls1 ls3 (w1 ++ v1) (w2 ++ v2) := by + intro r1 r2 h + rw [append_assoc,append_assoc] + exact h1 (v1 +> r1) (v2 +> r2) (h2 r1 r2 h) +theorem zS4 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [holdout_0193_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [holdout_0193_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [holdout_0193_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc1 (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [holdout_0193_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [holdout_0193_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [holdout_0193_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem z0n : Seg [.cp] [.ch] t (t ++ [0]) := + zS2 (mid := [1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0o : Seg [.cj] [.ch] t (t ++ one) := + zS2 (mid := [1,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0p : Seg [.ch] [.cj] (t ++ [0]) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0q : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0r : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0s : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1 d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0t : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0u : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0v : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0w : Seg [.cj] [.cp] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons,append_nil]; execute) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem H_T (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact z0l t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [zLp,h_eq,z0i] + exact zSg z0q ih +theorem zSa {w2 : BitWord} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact z0l w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq,z0i,zLp] + exact zSg hw ih +theorem z0x : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0y : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem z0z (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d0 d0 := + zSa z0x n +theorem z0A (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ n) d0 d1 := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg zH0 (zSa z0y n) +theorem z0B (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d1 d1 := + zSa z0y n +theorem z0C (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ (1 + n)) d1 d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg zH4 (zSa z0x n) +theorem z0D (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0n z0p) (H_T n) +theorem z0E (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0o zH2) (H_T n) +theorem z0F (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0r zH2) (H_T n) +theorem z0G (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0s (H_T n) +theorem z0H (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0t (H_T n) +theorem z0I (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [zLp',List.cons_append,List.nil_append] using zSg z0u (H_T n) +theorem z0J (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0v (zSg zH1 zH3) + have h1 := zSg h0 (zSa z0x n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0K (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0w (zSa z0x n) +theorem z0L : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0v zH1 +theorem z0M (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0v (zSg zH1 (zSg zH3 zH0)) + have h1 := zSg h0 (zSa z0y n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0N (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg [.cj,.ch] [.cp] d1 d1 := zSg z0w zH0 + have h1 := zSg h0 (zSa z0y n) + simpa only [zLp',List.cons_append,List.nil_append] using h1 +theorem z0O : Side [.ch] default (d1 +> default) := by + refine Side.cons (fun l => ?_) (Side.nil _) + unfold zCR zCL zCw zCs d1 + simp only [append_cons,append_nil,z00] + execute +theorem z0P : Seg [.ca] [.ch,.ch] t [1,1,0,0,0,1,1,0,0] := + zS5 + (mid1 := [1,0,1,1,1,1,0,1,0]) + (mid2 := [1,0,1,0,1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0Q : Seg [.ch] [.ch] [1,1,0,0,0,1,1,0,0] (t ++ t ++ one) := + zS2 + (mid := [1,1,0,1,1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0R : Seg [.ca,.ch] ([.cj] ++ [.ch] ^ 5) w_pre (w_pre ++ t) := by + have h1 : Seg [.ca,.ch] [.ch,.ch,.ch] t (t ++ t ++ one) := + zSg z0P z0Q + have h2 : Seg [.ch,.ch,.ch] ([.cj] ++ [.ch] ^ 5) (t ++ one) t := + zSg zH2 (H_T 2) + have h3 := zS0 h1 h2 + simpa only [w_pre,List.append_assoc,List.cons_append,List.nil_append] using h3 +theorem z0S (r : HalfTape) : + (zCL lh r) [holdout_0193_tm]⊢⁺ (zCR ([1] +> default) .ca r) := by + unfold zCL zCR lh zCw zCs + simp only [append_cons,append_nil,z00] + execute +theorem z0T (r : HalfTape) : + (zCL ([1] +> default) r) [holdout_0193_tm]⊢⁺ (zCR lh .ch r) := by + unfold zCL zCR lh zCw zCs + simp only [append_cons,append_nil,z00] + execute +open WordCalculus +open WordCalculus.Word +local notation "WordList" => List Word +def z3p : WordList := + [Q,Q,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,Q,Q,V] +def z3q : WordList := + [K,Q,V,V,V,V,K,V,K,K,K,V,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,K,K,V] +theorem z3w (n : Nat) : + Copy (31 + 32 * n) (260 + 256 * n) z3p z3q (10373 + 8192 * n) (55788 + 65536 * n) := by + unfold z3p z3q + refine copy_step_d11 (n' := 16 + 16 * n) (k' := 128 + 128 * n) (m := 64 + 64 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_d10 (n' := 8 + 8 * n) (k' := 63 + 64 * n) (m := 31 + 32 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 17 + 16 * n) (k' := 122 + 128 * n) (m := 60 + 64 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 35 + 32 * n) (k' := 240 + 256 * n) (m := 119 + 128 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 71 + 64 * n) (k' := 476 + 512 * n) (m := 237 + 256 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 143 + 128 * n) (k' := 948 + 1024 * n) (m := 473 + 512 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 72 + 64 * n) (k' := 472 + 512 * n) (m := 236 + 256 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 145 + 128 * n) (k' := 940 + 1024 * n) (m := 469 + 512 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 73 + 64 * n) (k' := 468 + 512 * n) (m := 234 + 256 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 37 + 32 * n) (k' := 232 + 256 * n) (m := 116 + 128 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 19 + 16 * n) (k' := 114 + 128 * n) (m := 57 + 64 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 39 + 32 * n) (k' := 224 + 256 * n) (m := 111 + 128 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 79 + 64 * n) (k' := 444 + 512 * n) (m := 221 + 256 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 159 + 128 * n) (k' := 884 + 1024 * n) (m := 441 + 512 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 80 + 64 * n) (k' := 440 + 512 * n) (m := 220 + 256 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 161 + 128 * n) (k' := 876 + 1024 * n) (m := 437 + 512 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 323 + 256 * n) (k' := 1748 + 2048 * n) (m := 873 + 1024 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 647 + 512 * n) (k' := 3492 + 4096 * n) (m := 1745 + 2048 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 1295 + 1024 * n) (k' := 6980 + 8192 * n) (m := 3489 + 4096 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 2591 + 2048 * n) (k' := 13956 + 16384 * n) (m := 6977 + 8192 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 5183 + 4096 * n) (k' := 27908 + 32768 * n) (m := 13953 + 16384 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 10367 + 8192 * n) (k' := 55812 + 65536 * n) (m := 27905 + 32768 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 5184 + 4096 * n) (k' := 27904 + 32768 * n) (m := 13952 + 16384 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 10369 + 8192 * n) (k' := 55804 + 65536 * n) (m := 27901 + 32768 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 20739 + 16384 * n) (k' := 111604 + 131072 * n) (m := 55801 + 65536 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 10370 + 8192 * n) (k' := 55800 + 65536 * n) (m := 27900 + 32768 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 20741 + 16384 * n) (k' := 111596 + 131072 * n) (m := 55797 + 65536 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 10371 + 8192 * n) (k' := 55796 + 65536 * n) (m := 27898 + 32768 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 5186 + 4096 * n) (k' := 27896 + 32768 * n) (m := 13948 + 16384 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 10373 + 8192 * n) (k' := 55788 + 65536 * n) (m := 27893 + 32768 * n) (by omega) (by omega) (by omega) ?_ + exact Copy.nil _ _ +theorem z3x (q : Nat) (hQ : 5 <= q) : + CopyTwelve (List.replicate q V ++ z3p) (List.replicate q V ++ z3q) := by + have hPow : 2 ^ q = 32 * 2 ^ (q - 5) := by + have heq : q = 5 + (q - 5) := by omega + conv_lhs => rw [heq,Nat.pow_add] + have hPos := pow_two_pos (q - 5) + have hTs := copy_replicate_V q 0 8 + have hBase := z3w (2 ^ (q - 5) - 1) + have h1 : (1 + 0) * 2 ^ q - 1 = 31 + 32 * (2 ^ (q - 5) - 1) := by omega + have h2 : 4 + 8 * 2 ^ q = 260 + 256 * (2 ^ (q - 5) - 1) := by omega + rw [h1,h2] at hTs + exact ⟨_,_,copy_append hTs hBase⟩ +theorem z3y : isSafePrefix z3q = true := by decide +kernel +def z3K : WordList := + [Q,Q,Q,Q,K,Q,K,Q,K] ++ List.replicate 15 Q +def z3L : WordList := + List.replicate 4 V ++ [Q,Q] ++ List.replicate 4 V ++ [Q,V] ++ List.replicate 5 Q ++ [K,Q] +def u_1 : WordList := [V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,Q,Q,K,Q,V,V,K,K,Q,K,Q] +def u_2 : WordList := [V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,K,Q,Q,Q,K,Q,Q,Q,K,Q,Q] +def u_3 : WordList := [V,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,K,K,K,K,K,Q,K,K,K,Q,K,Q,Q,K,Q,Q,Q] +def u_4 : WordList := [V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,Q,K,V,K,Q,V,V,V,V,V,K,K,Q,K,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q] +def u_5 : WordList := [V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,Q,Q,V,V,V,V,V,V,V,Q,V,Q,V,K,V,V,V,V,K,V,V,V,K,K,K,K,Q,Q,Q,K,Q,Q,K,Q,K,Q,K,Q,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q] +def u_6 : WordList := [V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,Q,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,K,K,K,Q,K,K,Q,Q,Q,Q,K,Q,Q,K,K,Q,K,K,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q] +def u_7 : WordList := [V,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,Q,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,Q,V,V,V,V,K,V,V,Q,K,V,V,V,V,K,V,V,V,V,K,K,K,K,K,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q] +def u_8 : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,Q,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,Q,V,V,V,V,Q,V,V,Q,K,V,V,V,V,Q,V,V,V,V,V,V,V,V,K,V,K,Q,Q,K,Q,K,K,Q,K,V,V,V,K,V,Q,Q,V,V,Q,K,V,V,V,V,V,V,V,V,V,K,K,K,K,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q] +def u_9 : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,Q,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,Q,V,V,V,V,Q,V,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,K,V,V,V,V,Q,V,K,K,V,V,Q,K,V,V,V,V,V,V,V,V,V,Q,V,V,Q,K,K,V,V,V,V,V,V,V,V,V,Q,V,V,K,V,Q,Q,V,V,Q,K,V,V,V,V,K,V,V,V,V,V,K,K,K,K,K,K,Q,Q,Q,Q,Q,K,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def z3M : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,Q,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,Q,V,V,V,V,Q,V,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,Q,V,V,Q,Q,K,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,K,K,V,V,Q,K,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,K,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,K,V,Q,Q,V,V,Q,K,V,V,V,V,V,V,V,V,V,V,K,K,K,K,K,Q,K,K,Q,Q,Q,Q,Q,K,K,Q,K,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,K,K,K,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,K,Q,K,K,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,K,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def u_11 : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,Q,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,Q,V,V,V,V,Q,V,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,Q,V,K,K,V,V,Q,K,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,K,Q,V,V,V,V,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,K,V,Q,Q,V,V,Q,K,V,V,V,V,K,V,V,V,V,V,V,K,K,K,K,K,K,K,Q,Q,Q,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,K,Q,K,Q,Q,Q,K,K,K,K,K,K,K,K,Q,Q,Q,Q,K,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,K,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def u_12 : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,Q,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,Q,V,V,V,V,Q,V,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,Q,K,V,V,V,V,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,K,K,V,V,Q,K,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,K,Q,V,V,Q,Q,K,V,Q,V,V,V,Q,K,V,K,K,Q,Q,K,K,Q,K,K,K,K,Q,V,V,V,K,V,V,Q,K,Q,Q,K,K,Q,V,V,Q,V,V,K,K,V,V,V,Q,V,Q,V,V,V,Q,V,K,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,K,V,Q,Q,V,V,Q,K,V,V,V,V,V,V,V,V,V,V,V,K,K,K,K,K,K,Q,K,K,Q,Q,Q,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,K,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def u_13 : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,Q,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,Q,V,V,V,V,Q,V,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,K,V,V,V,Q,Q,V,V,V,V,V,K,Q,K,K,V,V,V,Q,V,V,Q,K,Q,V,V,V,V,Q,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,Q,V,K,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,K,K,V,V,Q,K,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,K,K,V,V,V,K,Q,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,K,Q,V,V,V,V,Q,K,V,V,V,Q,V,K,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,K,V,Q,Q,V,V,Q,K,V,V,V,V,K,V,V,V,V,V,V,V,K,K,K,K,K,K,K,K,Q,Q,Q,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,K,K,Q,Q,K,K,Q,Q,Q,K,K,K,Q,K,Q,K,K,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,K,K,K,K,K,K,K,Q,K,K,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,K,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def u_14 : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,Q,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,Q,V,V,V,V,Q,V,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,K,K,V,V,V,Q,V,V,Q,Q,K,V,V,V,V,Q,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,Q,V,Q,V,K,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,K,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,Q,Q,V,V,V,Q,V,Q,V,K,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,K,K,V,V,Q,K,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,K,Q,V,V,Q,V,V,Q,V,V,Q,K,V,Q,V,V,V,V,V,Q,K,V,K,K,Q,K,K,K,Q,Q,K,Q,Q,Q,Q,Q,V,V,V,V,V,V,K,K,K,V,K,Q,V,Q,K,Q,Q,K,K,K,Q,Q,K,K,K,Q,Q,Q,V,V,V,K,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,Q,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,K,Q,V,V,V,V,Q,K,V,V,V,Q,V,K,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,K,V,Q,Q,V,V,Q,K,V,V,V,V,V,V,V,V,V,V,V,V,K,K,K,K,K,K,K,Q,K,K,Q,Q,Q,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,K,K,Q,Q,K,Q,K,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,K,K,K,Q,K,Q,Q,K,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,K,Q,K,Q,Q,Q,K,Q,K,K,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,K,K,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,K,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def z3N : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,Q,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,Q,V,V,V,V,Q,V,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,Q,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,Q,Q,V,V,V,Q,V,Q,V,Q,V,K,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,Q,Q,V,Q,V,V,V,V,V,Q,Q,V,V,V,V,V,V,V,Q,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,K,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,Q,Q,V,V,V,Q,V,Q,V,K,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,K,K,V,V,Q,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,K,K,V,V,V,K,Q,V,V,Q,V,V,Q,V,V,Q,K,V,Q,V,V,V,V,V,V,V,Q,K,K,V,V,V,Q,K,Q,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,K,K,V,K,V,V,V,V,V,K,V,V,V,V,V,V,Q,V,V,Q,V,Q,K,V,V,K,Q,V,V,V,V,V,V,V,V,K,V,K,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,Q,V,V,V,V,V,Q,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,K,Q,V,V,V,V,Q,K,V,V,V,Q,V,K,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,K,V,Q,Q,V,V,Q,K,V,V,V,V,K,V,V,V,V,V,V,V,V,K,K,K,K,K,K,K,K,K,Q,Q,Q,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,K,K,Q,Q,K,Q,K,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,K,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,K,K,K,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,K,Q,K,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,K,K,K,Q,K,Q,Q,Q,K,K,Q,K,Q,Q,K,K,K,K,K,K,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,K,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +theorem z3O : EntrySpec 19 z3p z3K 4000 := entrySpec_of_checkEntrySpec (by decide +kernel) +set_option maxRecDepth 200000 in +theorem z3P_1 : optionWordListBEq (evalStep z3L) (some u_1) = true := by decide +kernel +set_option maxRecDepth 200000 in +theorem z3P_2 : optionWordListBEq (evalStep u_1) (some u_2) = true := by decide +kernel +set_option maxRecDepth 200000 in +theorem z3P_3 : optionWordListBEq (evalStep u_2) (some u_3) = true := by decide +kernel +set_option maxRecDepth 200000 in +theorem z3P_4 : optionWordListBEq (evalStep u_3) (some u_4) = true := by decide +kernel +set_option maxRecDepth 200000 in +theorem z3P_5 : optionWordListBEq (evalStep u_4) (some u_5) = true := by decide +kernel +set_option maxRecDepth 200000 in +theorem z3P_6 : optionWordListBEq (evalStep u_5) (some u_6) = true := by decide +kernel +set_option maxRecDepth 200000 in +theorem z3P_7 : optionWordListBEq (evalStep u_6) (some u_7) = true := by decide +kernel +set_option maxRecDepth 200000 in +theorem z3P_8 : optionWordListBEq (evalStep u_7) (some u_8) = true := by decide +kernel +set_option maxRecDepth 200000 in +theorem z3P_9 : optionWordListBEq (evalStep u_8) (some u_9) = true := by decide +kernel +set_option maxRecDepth 200000 in +theorem z3P_10 : optionWordListBEq (evalStep u_9) (some z3M) = true := by decide +kernel +set_option maxRecDepth 200000 in +theorem z3P_11 : optionWordListBEq (evalStep z3M) (some u_11) = true := by decide +kernel +set_option maxRecDepth 200000 in +theorem z3P_12 : optionWordListBEq (evalStep u_11) (some u_12) = true := by decide +kernel +set_option maxRecDepth 200000 in +theorem z3P_13 : optionWordListBEq (evalStep u_12) (some u_13) = true := by decide +kernel +set_option maxRecDepth 200000 in +theorem z3P_14 : optionWordListBEq (evalStep u_13) (some u_14) = true := by decide +kernel +set_option maxRecDepth 200000 in +theorem z3P_15 : optionWordListBEq (evalStep u_14) (some z3N) = true := by decide +kernel +set_option maxRecDepth 200000 in +theorem z3S : checkEntryOne 19 z3p z3K 4000 z3N = true := by decide +kernel +theorem z3T : ∃ v,Rounds z3L v /\ AggState z3p 16 19 v := + ⟨z3N, + rounds_cons_of_evalStep z3P_1 (rounds_cons_of_evalStep z3P_2 (rounds_cons_of_evalStep z3P_3 (rounds_cons_of_evalStep z3P_4 (rounds_cons_of_evalStep z3P_5 + (rounds_cons_of_evalStep z3P_6 (rounds_cons_of_evalStep z3P_7 (rounds_cons_of_evalStep z3P_8 (rounds_cons_of_evalStep z3P_9 (rounds_cons_of_evalStep z3P_10 + (rounds_cons_of_evalStep z3P_11 (rounds_cons_of_evalStep z3P_12 (rounds_cons_of_evalStep z3P_13 (rounds_cons_of_evalStep z3P_14 (rounds_cons_of_evalStep z3P_15 + (Rounds.refl z3N))))))))))))))), + good_of_checkEntryOne 19 z3p z3K 4000 z3N z3O z3S⟩ +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) +theorem z3U {k : Nat} (hK : 0 < k) : ∃ hs,Num k [] hs := by + rcases even_or_odd_mul_two k with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · cases a with + | zero => omega + | succ a => + have heq : (a + 1) * 2 = 2 + a * 2 := by omega + rw [heq]; exact ⟨[.cj] ++ [.ch] ^ a,Num.even a⟩ + · exact ⟨[.cp] ++ [.ch] ^ a,Num.odd a⟩ +theorem z3V {k : Nat} {hs hs' : List Call} (h1 : Num k [] hs) (h2 : Num k [] hs') : + hs = hs' := by + cases h1 with + | @odd n => + generalize hk : 1 + n * 2 = k0 at h2 + cases h2 with + | @odd m => + have hnm : n = m := by omega + subst hnm; rfl + | even _ => omega + | @even n => + generalize hk : 2 + n * 2 = k0 at h2 + cases h2 with + | odd _ => omega + | @even m => + have hnm : n = m := by omega + subst hnm; rfl +def z3W (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs,Num k w hs -> Side hs (w +> r) r' +theorem z3X {r r' : HalfTape} (h : z3W 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl +theorem z3Y {n : Nat} {r r' : HalfTape} + (hI : z3W (n * 2) r r') : z3W (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := z3X hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0v (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine zSc (z0J n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using hI [] _ hN2 +theorem z3Z {n : Nat} {r r' : HalfTape} + (hI : z3W (n * 2) r r') : z3W (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := z3X hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0L (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine zSc (z0M n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using hI [] _ hN2 +theorem z40 {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hZ : A = 0) : + evalWords da default = default := by + induction hD with + | nil => rfl + | @zero A H u _ ih => + have hA0 : A = 0 := by omega + dsimp only [evalWords] + rw [ih hA0,zDd] + | one _ => omega +theorem z41 {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hPos : 0 < A) : + z3W ((A - 1) * 2) default (evalWords da default) := by + induction hD with + | nil => omega + | @zero A H u _ ih => + have hA_pos : 0 < A := by omega + have hIH := ih hA_pos + have hs := z3Y hIH + rw [zDd] at hs + have heq : (A * 2 - 1) * 2 = 2 + (A - 1) * 4 := by omega + dsimp [evalWords] + rwa [heq] + | @one A H u hDu ih => + cases A with + | zero => + change z3W 0 default (d1 +> evalWords u default) + rw [z40 hDu rfl] + intro w hs hN + generalize hk : 0 = k0 at hN + cases hN with + | zero => + have hd : d1 +> (default : HalfTape) = one +> default := by simp [d1,one] + rw [hd]; exact Side.nil (one +> default) + | odd _ => omega + | even _ => omega + | succ A => + have hA_pos : 0 < A + 1 := by omega + have hIH := ih hA_pos + have heq_in : (A + 1 - 1) * 2 = A * 2 := by omega + rw [heq_in] at hIH + have hs := z3Z hIH + rw [zDd] at hs + have heq : (1 + (A + 1) * 2 - 1) * 2 = 4 + A * 4 := by omega + dsimp [evalWords] + rwa [heq] +theorem zEd {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ∀ {A H : Nat},DigitVal A H v -> Seg ([Call.ch] ^ n) ([Call.ch] ^ b) (wordsToBits u) (wordsToBits v) := by + induction hI with + | nil n => + intro A H _ + exact z0m ([Call.ch] ^ n) + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | d00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0z _) (ih hD') + | d01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0A _) (ih hD') + | d10 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0B _) (ih hD') + | d11 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0C _) (ih hD') +theorem z42 {n : Nat} {hs hs' : List Call} + (hI : Num (3 + n) [] hs) (hJ : Num (2 + n * 2) [] hs') : + Seg hs ([Call.ch] ++ hs') t t := by + generalize hk1 : 3 + n = k1 at hI + generalize hk2 : 2 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = m * 2 := by omega + subst hq + rw [h1m] + exact z0D m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0E m +theorem z43 {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' (d1 ++ d0) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0F m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + have hq : q = m * 2 := by omega + subst hq + exact z0G m +theorem z44 {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' (d1 ++ d1) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | @odd q => + have hq : q = m * 2 := by omega + subst hq + exact z0H m + | even _ => omega + | @even m => + cases hJ with + | @odd q => + have hq : q = 1 + m * 2 := by omega + subst hq + exact z0I m + | even _ => omega +theorem z45 {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 2 + q * 2 := by omega + subst hm + exact z0J q +theorem z46 {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = q * 2 := by omega + subst hm + exact z0K q + | even _ => omega +theorem z47 {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 3 + q * 2 := by omega + subst hm + exact z0M q +theorem z48 {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = 1 + q * 2 := by omega + subst hm + exact z0N q + | even _ => omega +theorem z49 {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) : + ∀ {u : WordList} {n n' : Nat} {hs hs' : List Call}, + WordEffect n u n' v -> Num k [] hs -> Num k' [] hs' -> + Seg (([Call.ch] ^ n) ++ hs) (([Call.ch] ^ n') ++ hs') (wordsToBits u) (wordsToBits w) := by + induction hI with + | nil k => + intro u n n' hs hs' hE hN hN' + cases hE + rw [z3V hN hN'] + exact z0m (([Call.ch] ^ n) ++ hs') + | @T m _ _ _ _ _ _ ih => + intro u0 n0 n1 hs hs' hE hN hN' + cases hE with + | T hSub => + rcases z3U (by omega : 0 < 2 + m * 2) with ⟨hs0,hN0⟩ + have hIH := ih hSub hN0 hN' + have hStep := zSg (H_T n0) (z42 hN hN0) + have heq : ([Call.ch] ^ (n0 * 2)) ++ ([Call.ch] ++ hs0) = ([Call.ch] ^ (1 + n0 * 2)) ++ hs0 := by + have h1 : 1 + n0 * 2 = n0 * 2 + 1 := by omega + rw [h1,z0i,z0h,List.append_assoc] + rw [heq] at hStep + exact zS0 hStep hIH + | @pair0 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,K] ++ u) at hE + rcases wordEffect_split_output [Q,K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z3U hPos with ⟨hs0,hN0⟩ + have hD10 : DigitVal 1 2 [Q,K] := DigitVal.one (DigitVal.zero DigitVal.nil) + have hStep := zSg (zEd hL hD10) (z43 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @pair1 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,Q] ++ u) at hE + rcases wordEffect_split_output [Q,Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z3U (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD11 : DigitVal 3 2 [Q,Q] := DigitVal.one (DigitVal.one DigitVal.nil) + have hStep := zSg (zEd hL hD11) (z44 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short00 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z3U hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (z45 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short01 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z3U (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (z46 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short10 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z3U hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (z47 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short11 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z3U (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (z48 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') +theorem z4a {n : Nat} {r r' : HalfTape} + (hI : z3W (n * 2) r r') : z3W (1 + n) (d1 +> (d0 +> r)) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil,<- append_assoc d1 d0 r] + cases m with + | zero => + have hn0 : n * 2 = 0 := by omega + rw [hn0] at hI + have hr' := z3X hI + subst hr' + rw [<- append_assoc t one r] + exact zSc z0r (Side.nil r) + | succ m => + have h1m : m + 1 = 1 + m := by omega + rw [h1m] + refine zSc (z0F m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : n * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil,<- append_assoc d1 d0 r] + refine zSc (z0G m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (m * 2)) := by + have hm : n * 2 = 2 + (m * 2) * 2 := by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 +theorem z4b {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) {u : WordList} {r' : HalfTape} + (hE : WordEffect 0 u 1 v) (hK : 0 < k') (hC : z3W k' (d1 +> default) r') : + z3W k (evalWords u default) (evalWords w r') := by + intro w0 hs hN + have hPosK : 0 < k := phaseScan_pos_of_out_pos hI hK + have hw0 : w0 = [] := by cases hN <;> first | rfl | omega + subst hw0 + rcases z3U hK with ⟨hs',hN'⟩ + have hSeg := z49 hI hE hN hN' + dsimp at hSeg + have hSide := zSc hSeg (z0j z0O (hC [] hs' hN')) + rwa [wordsToBits_append_tape,wordsToBits_append_tape] at hSide +theorem z4c {orig out : WordList} (hS : Step orig out) : + ∃ r,z3W 12 (evalWords orig default) r /\ evalWords out default = t +> r := by + cases hS with + | intro eff k v a b J A da hE hI hDA hSum => + have hposJ := pow_two_pos J + have hPosK : 0 < k := by omega + have hDFull : DigitVal k (J + 1) (da ++ [Q]) := by + have h := digitVal_append hDA (DigitVal.one DigitVal.nil) + have heq : A + 1 * 2 ^ J = k := by omega + rwa [heq] at h + have hC0 : z3W ((k - 1) * 2) default (evalWords (da ++ [Q]) default) := + z41 hDFull hPosK + have hC1 : z3W k (d1 +> default) (evalWords (V :: (da ++ [Q])) default) := by + have h := z4a hC0 + have hk : 1 + (k - 1) = k := by omega + rwa [hk,zDd] at h + have hRun := z4b hI hE hPosK hC1 + rw [<- evalWords_append] at hRun + exact ⟨evalWords (v ++ V :: (da ++ [Q])) default,hRun,rfl⟩ +theorem z4d {r r' : HalfTape} (hI : z3W 12 r r') : + (zCf r) [holdout_0193_tm]⊢⁺ zCf (t +> r') := by + have h_num : Num 12 [] ([.cj] ++ [.ch] ^ 5) := Num.even 5 + have hC := hI [] ([.cj] ++ [.ch] ^ 5) h_num + have hS := zSc z0R hC + rcases hS with _ | ⟨hca,hrest⟩ + rcases hrest with _ | ⟨hch,hnil⟩ + cases hnil + have h1 := zPt (z0S (w_pre +> r)) (hca ([1] +> default)) + have h2 := zPt (z0T _) (hch lh) + have h3 := zPt h1 h2 + rwa [append_assoc] at h3 +theorem z4e {orig out : WordList} (hS : Step orig out) : + (zCf (evalWords orig default)) [holdout_0193_tm]⊢⁺ zCf (evalWords out default) := by + rcases z4c hS with ⟨r,hC,hEq⟩ + rw [hEq] + exact z4d hC +theorem z4f {u v : WordList} (hR : Rounds u v) : + (zCf (evalWords u default)) [holdout_0193_tm]⊢* zCf (evalWords v default) := by + induction hR with + | refl u => exact ⟨0,rfl⟩ + | next hS _ ih => + rcases z4e hS with ⟨n1,_,hn1⟩ + rcases ih with ⟨n2,hn2⟩ + exact ⟨n1 + n2,zMt holdout_0193_tm _ _ _ n1 n2 hn1 hn2⟩ +def z4g : CCfg := ⟨0,0,[],[]⟩ +def z4c_1 : CCfg := ⟨0,0,[1,1,1,0,1,1,1,0,1,1,1,1,0,1,0,1],[0,1,0,1]⟩ +def z4c_2 : CCfg := ⟨4,1,[0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,0,1],[0,0,1,0,1,0,1,1,0,0,1]⟩ +def z4c_3 : CCfg := ⟨2,1,[0,1,0,1,1,0,1,0,1],[0,1,1,0,0,1,1,0,0,1,0,1,0,1,1,1,0,0,1,0,1]⟩ +def z4c_4 : CCfg := ⟨0,0,[1,1,0,1,0,1],[1,1,0,0,1,1,0,0,1,1,1,0,0,1,1,0,0,1,0,1,0,1,1,0,0,1,0,0,0,0,1]⟩ +def z4c_5 : CCfg := ⟨0,1,[1,1,0,1,0,1],[0,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,1,1,0,0,1,0,1,0,0,1]⟩ +def z4c_6 : CCfg := ⟨2,0,[1,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1],[0,0,1,1,0,0,1,0,0,0,1,1,0,0,0,0,1,0,0,1,1]⟩ +def z4c_7 : CCfg := ⟨0,1,[1,0,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,1,0,1,0,1],[0,0,0,0,1,0,1,1,0,0,0,0,0,0,1,1,1]⟩ +def z4c_8 : CCfg := ⟨0,0,[1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,0,1],[1,1,0,0,1,1,0,0,1,0,1,0,1,1,0,0,0,0,1,0,1,1,1]⟩ +def z4c_9 : CCfg := ⟨0,1,[1,1,1,1,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,0,1,0,1],[0,0,0,0,0,0,1,1,0,0,1,1]⟩ +def z4c_10 : CCfg := ⟨5,0,[1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,0,1],[0,1,1,0,1,1,0,0,0,0,1,0,1,1,0,0,1,1]⟩ +def z4c_11 : CCfg := ⟨1,1,[1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,1,0,1,0,1],[1,1,0,0,0,0,1]⟩ +def z4c_12 : CCfg := ⟨2,1,[0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1],[0,1,0,1,1,0,0,1]⟩ +def z4c_13 : CCfg := ⟨3,1,[0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1],[1,0,0,1,0,1,0,1]⟩ +def z4c_14 : CCfg := ⟨4,0,[0,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1],[1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,1,0,0,0,1]⟩ +def z4c_15 : CCfg := ⟨2,1,[0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1],[0,0,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,1,0,1,0,1]⟩ +def z4c_16 : CCfg := ⟨4,0,[0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1],[0,0,0,1,1,0,0,1,0,1,0,0,0,0,0,1]⟩ +def z4c_17 : CCfg := ⟨5,0,[1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1],[0,1,1,0,0,1,0,1,0,1,0,0,0,1]⟩ +def z4c_18 : CCfg := ⟨4,0,[0,1,0,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1],[1,0,0,0,0,1,1,0,0,1,0,0,0,1,0,1,0,1]⟩ +def z4c_19 : CCfg := ⟨2,0,[1,1,1,0,1],[0,0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,1,0,1,0,1,0,1]⟩ +def z4c_20 : CCfg := ⟨4,0,[0,1,0,1,0,1,0,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,0,1,0,1],[1,0,0,0,0,1,1,0,0,1,0,1,0,0,0,0,0,0,0,1]⟩ +def z4c_21 : CCfg := ⟨1,1,[1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,0,1,0,1],[0,1,1,0,0,1,0,1,0,1,0,0,0,0,0,1]⟩ +def z4c_22 : CCfg := ⟨3,1,[1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,0,1,0,1],[1,0,0,0,0,1,1,0,0,1,0,0,0,1,0,1,0,0,0,1]⟩ +def z4c_23 : CCfg := ⟨4,0,[0,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,1,0,1,0,1],[0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,1,0,1,0,1,0,0,0,1]⟩ +def z4c_24 : CCfg := ⟨2,1,[0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,1,0,1,0,1],[0,0,0,0,0,1,0,0,0,1,0,1]⟩ +def z4c_25 : CCfg := ⟨1,0,[1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,1,0,1,0,1],[1,0,0,1,0,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1]⟩ +def z4c_26 : CCfg := ⟨2,1,[1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,1,0,1,0,1],[0,1,1,0,0,1,0,1,0,1,0,1,0,1,0,1]⟩ +def z4c_27 : CCfg := ⟨2,1,[1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,0,1,0,1],[0,1]⟩ +def z4c_28 : CCfg := ⟨4,0,[0,1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,0,1,0,1],[1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1]⟩ +def z4c_29 : CCfg := ⟨4,0,[0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,0,1,0,1],[1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1]⟩ +def z4c_30 : CCfg := ⟨2,1,[1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,0,1,0,1],[0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,1,0,1,0,1,0,0,0,0,0,1]⟩ +def z4c_31 : CCfg := ⟨5,0,[1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,0,1,0,1],[0,1,1,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1]⟩ +def z4c_32 : CCfg := ⟨2,1,[0,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,0,1,0,1],[0,1,1,0,0,1,0,1,1,0,0,1,0,1,0,1,0,0,0,1,0,0,0,1]⟩ +def z4c_33 : CCfg := ⟨5,0,[1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,0,1,0,1],[1,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1]⟩ +def z4c_34 : CCfg := ⟨2,1,[0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,0,1,0,1],[0,1,1,0,0,1,1,0,0,1,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,1,0,1,0,1,0,1,0,0,0,1]⟩ +def z4n : CCfg := ⟨2,1,[0,1],[0,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,1,0,1,0,1,0,1,0,0,0,1]⟩ +set_option maxRecDepth 100000 in +theorem z4s_1 : zCm z4g 200 = some z4c_1 := by decide +set_option maxRecDepth 100000 in +theorem z4s_2 : zCm z4c_1 200 = some z4c_2 := by decide +set_option maxRecDepth 100000 in +theorem z4s_3 : zCm z4c_2 200 = some z4c_3 := by decide +set_option maxRecDepth 100000 in +theorem z4s_4 : zCm z4c_3 200 = some z4c_4 := by decide +set_option maxRecDepth 100000 in +theorem z4s_5 : zCm z4c_4 200 = some z4c_5 := by decide +set_option maxRecDepth 100000 in +theorem z4s_6 : zCm z4c_5 200 = some z4c_6 := by decide +set_option maxRecDepth 100000 in +theorem z4s_7 : zCm z4c_6 200 = some z4c_7 := by decide +set_option maxRecDepth 100000 in +theorem z4s_8 : zCm z4c_7 200 = some z4c_8 := by decide +set_option maxRecDepth 100000 in +theorem z4s_9 : zCm z4c_8 200 = some z4c_9 := by decide +set_option maxRecDepth 100000 in +theorem z4s_10 : zCm z4c_9 200 = some z4c_10 := by decide +set_option maxRecDepth 100000 in +theorem z4s_11 : zCm z4c_10 200 = some z4c_11 := by decide +set_option maxRecDepth 100000 in +theorem z4s_12 : zCm z4c_11 200 = some z4c_12 := by decide +set_option maxRecDepth 100000 in +theorem z4s_13 : zCm z4c_12 200 = some z4c_13 := by decide +set_option maxRecDepth 100000 in +theorem z4s_14 : zCm z4c_13 200 = some z4c_14 := by decide +set_option maxRecDepth 100000 in +theorem z4s_15 : zCm z4c_14 200 = some z4c_15 := by decide +set_option maxRecDepth 100000 in +theorem z4s_16 : zCm z4c_15 200 = some z4c_16 := by decide +set_option maxRecDepth 100000 in +theorem z4s_17 : zCm z4c_16 200 = some z4c_17 := by decide +set_option maxRecDepth 100000 in +theorem z4s_18 : zCm z4c_17 200 = some z4c_18 := by decide +set_option maxRecDepth 100000 in +theorem z4s_19 : zCm z4c_18 200 = some z4c_19 := by decide +set_option maxRecDepth 100000 in +theorem z4s_20 : zCm z4c_19 200 = some z4c_20 := by decide +set_option maxRecDepth 100000 in +theorem z4s_21 : zCm z4c_20 200 = some z4c_21 := by decide +set_option maxRecDepth 100000 in +theorem z4s_22 : zCm z4c_21 200 = some z4c_22 := by decide +set_option maxRecDepth 100000 in +theorem z4s_23 : zCm z4c_22 200 = some z4c_23 := by decide +set_option maxRecDepth 100000 in +theorem z4s_24 : zCm z4c_23 200 = some z4c_24 := by decide +set_option maxRecDepth 100000 in +theorem z4s_25 : zCm z4c_24 200 = some z4c_25 := by decide +set_option maxRecDepth 100000 in +theorem z4s_26 : zCm z4c_25 200 = some z4c_26 := by decide +set_option maxRecDepth 100000 in +theorem z4s_27 : zCm z4c_26 200 = some z4c_27 := by decide +set_option maxRecDepth 100000 in +theorem z4s_28 : zCm z4c_27 200 = some z4c_28 := by decide +set_option maxRecDepth 100000 in +theorem z4s_29 : zCm z4c_28 200 = some z4c_29 := by decide +set_option maxRecDepth 100000 in +theorem z4s_30 : zCm z4c_29 200 = some z4c_30 := by decide +set_option maxRecDepth 100000 in +theorem z4s_31 : zCm z4c_30 200 = some z4c_31 := by decide +set_option maxRecDepth 100000 in +theorem z4s_32 : zCm z4c_31 200 = some z4c_32 := by decide +set_option maxRecDepth 100000 in +theorem z4s_33 : zCm z4c_32 200 = some z4c_33 := by decide +set_option maxRecDepth 100000 in +theorem z4s_34 : zCm z4c_33 200 = some z4c_34 := by decide +set_option maxRecDepth 100000 in +theorem z4s_35 : zCm z4c_34 35 = some z4n := by decide +theorem z4v : + (init []) [holdout_0193_tm]⊢* zCf (evalWords z3L default) := by + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = z04 z4g := rfl + have h2 : z04 z4n = zCf (evalWords z3L default) := by + unfold z04 z4n zCf zCL lh w_pre z3L + simp only [List.replicate,List.cons_append,List.nil_append,evalWords,wordsToBits,t,d1,d0,one,append_cons,append_nil,z00] + rfl + have hPlus : (z04 z4g) [holdout_0193_tm]⊢⁺ (z04 z4n) := + (zPt (zTc (by decide) z4s_1) + (zPt (zTc (by decide) z4s_2) + (zPt (zTc (by decide) z4s_3) + (zPt (zTc (by decide) z4s_4) + (zPt (zTc (by decide) z4s_5) + (zPt (zTc (by decide) z4s_6) + (zPt (zTc (by decide) z4s_7) + (zPt (zTc (by decide) z4s_8) + (zPt (zTc (by decide) z4s_9) + (zPt (zTc (by decide) z4s_10) + (zPt (zTc (by decide) z4s_11) + (zPt (zTc (by decide) z4s_12) + (zPt (zTc (by decide) z4s_13) + (zPt (zTc (by decide) z4s_14) + (zPt (zTc (by decide) z4s_15) + (zPt (zTc (by decide) z4s_16) + (zPt (zTc (by decide) z4s_17) + (zPt (zTc (by decide) z4s_18) + (zPt (zTc (by decide) z4s_19) + (zPt (zTc (by decide) z4s_20) + (zPt (zTc (by decide) z4s_21) + (zPt (zTc (by decide) z4s_22) + (zPt (zTc (by decide) z4s_23) + (zPt (zTc (by decide) z4s_24) + (zPt (zTc (by decide) z4s_25) + (zPt (zTc (by decide) z4s_26) + (zPt (zTc (by decide) z4s_27) + (zPt (zTc (by decide) z4s_28) + (zPt (zTc (by decide) z4s_29) + (zPt (zTc (by decide) z4s_30) + (zPt (zTc (by decide) z4s_31) + (zPt (zTc (by decide) z4s_32) + (zPt (zTc (by decide) z4s_33) + (zPt (zTc (by decide) z4s_34) + (zTc (by decide) z4s_35))))))))))))))))))))))))))))))))))) + rw [<- h0,h2] at hPlus + rcases hPlus with ⟨n,_,hn⟩ + exact ⟨n,hn⟩ +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep holdout_0193_tm c (j + d) = some c') : + (multiStep holdout_0193_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep holdout_0193_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +theorem z4w (m : Nat) : + ∃ N ≥ m,∃ p q w, + multiStep holdout_0193_tm (init []) N = some (zCf (evalWords w default)) /\ + AggState z3p p q w := by + induction m with + | zero => + rcases z3T with ⟨v0,hRounds,hGood0⟩ + rcases z4v with ⟨k1,hk1⟩ + rcases z4f hRounds with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,16,19,v0, + zMt holdout_0193_tm _ _ _ k1 k2 hk1 hk2,hGood0⟩ + | succ m ih => + rcases ih with ⟨N,hN,p,q,w,h_ms,h_good⟩ + rcases aggState_step_of_copyTwelve z3p z3q z3y z3x p q w h_good + with ⟨w',hStep,h_good'⟩ + rcases z4e hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,1 + p,1 + q,w', + zMt holdout_0193_tm _ _ _ N k h_ms h_step_k,h_good'⟩ +theorem holdout_0193_nonhalt : + IsDoesNotHalt holdout_0193_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases z4w (n + 1) with ⟨N,hN,_,_,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := zIm h_N + rw [zMs,hn] at h_some + exact h_some + + + +theorem is_does_not_halt : IsNotHalt target_tm := holdout_0193_nonhalt + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RE_1LC0LE_1LD0LC_1RA0LA_1RA1RF_1RAHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC0RA_0RA0LD_1LEHHH_1RF0LF_0LC0RA.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC0RA_0RA0LD_1LEHHH_1RF0LF_0LC0RA.lean new file mode 100644 index 00000000..22cad896 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC0RA_0RA0LD_1LEHHH_1RF0LF_0LC0RA.lean @@ -0,0 +1,926 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RE_1LC0RA_0RA0LD_1LEHHH_1RF0LF_0LC0RA + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC0RA_0RA0LD_1LEHHH_1RF0LF_0LC0RA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {zG_ zL_ α β γ : Type*} [Inhabited zG_] [Inhabited zL_] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +-- ============================================================================ +-- Section 2: Turing Machine Infrastructure & Notations +-- ============================================================================ + + +/- A Turing machine statement writing a symbol and moving in direction `dir`. -/ +-- ============================================================================ +-- Section 5: Specific Turing Machine: holdout_0504 +-- ============================================================================ +/- Transition function for holdout_0504: `1RB0RE_1LC0RA_0RA0LD_1LE---_1RF0LF_0LC0RA` -/ + +set_option maxHeartbeats 8000000 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem pow_zero_list (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_refl {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} (c : Cfg Γ Λ) : c [tm]⊢* c := ⟨0, rfl⟩ + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus h₁ (stepPlus_stepStar h₂) + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) + +/-- Universal non-halting principle from a state invariant with `⊢⁺` progress. -/ +theorem nonhalt_of_inv {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (P : Cfg Γ Λ → Prop) + (h0 : ∃ c₀, P c₀ ∧ (init []) [M]⊢* c₀) + (hstep : ∀ c, P c → ∃ c', P c' ∧ (c [M]⊢⁺ c')) : + IsDoesNotHalt M := by + have hreach : ∀ k, ∃ c, P c ∧ ∃ m ≥ k, multiStep M (init []) m = some c := by + intro k + induction k with + | zero => + obtain ⟨c₀, hc₀, m, hm⟩ := h0 + exact ⟨c₀, hc₀, m, Nat.zero_le m, hm⟩ + | succ k ih => + obtain ⟨c, hc, m, hge, hm⟩ := ih + obtain ⟨c', hc', d, hd_pos, hd⟩ := hstep c hc + exact ⟨c', hc', m + d, by omega, multiStep_trans M (init []) c c' m d hm hd⟩ + intro cfg ⟨n, hn⟩ + rw [Option.isSome_iff_ne_none] + intro hnone + obtain ⟨c, _, m, hge, hm⟩ := hreach (n + 1) + have hm_eq : m = n + (1 + (m - n - 1)) := by omega + rw [hm_eq, multiStep_add M (init []) n (1 + (m - n - 1)), hn] at hm + simp only [Option.bind] at hm + rw [multiStep_add M cfg 1 (m - n - 1), multiStep_one, hnone] at hm + simp only [Option.bind] at hm + cases hm + +-- ============================================================================ +-- Section 6: Mode Configurations & 16 Micro-Step Transition Lemmas for TM31 +-- ============================================================================ + +def cfg_h01B (w s : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + w <{{E}} ((1 : Fin 2) >> (0 : Fin 2) >> s) + +def cfg_modeB (w s : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ((1 : Fin 2) >> (0 : Fin 2) >> w) {{B}}> s + +def cfg_modeF (w s : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ((1 : Fin 2) >> (0 : Fin 2) >> w) {{F}}> s + +theorem step_init_to_h01B : + (init []) [target_tm]⊢⁺ cfg_h01B default ((1 : Fin 2) >> default) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + unfold cfg_h01B A E + execute + +-- h01B rules (8) +theorem step_h01B_nil (s : ListBlank (Fin 2)) : + (cfg_h01B default s) [target_tm]⊢⁺ + cfg_modeB ((1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> default) s := by + unfold cfg_h01B cfg_modeB E B; simp only [zero_cons_default]; execute + +theorem step_h01B_010 (w s : ListBlank (Fin 2)) : + (cfg_h01B ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> w) s) [target_tm]⊢⁺ + cfg_modeB ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> w) s := by + unfold cfg_h01B cfg_modeB E B; execute + +theorem step_h01B_0010 (w s : ListBlank (Fin 2)) : + (cfg_h01B ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> w) s) [target_tm]⊢⁺ + cfg_modeB ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> w) s := by + unfold cfg_h01B cfg_modeB E B; execute + +theorem step_h01B_0110 (w s : ListBlank (Fin 2)) : + (cfg_h01B ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> w) s) [target_tm]⊢⁺ + cfg_modeB ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> w) s := by + unfold cfg_h01B cfg_modeB E B; execute + +theorem step_h01B_110 (w s : ListBlank (Fin 2)) : + (cfg_h01B ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> w) s) [target_tm]⊢⁺ + cfg_modeB ((1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> w) s := by + unfold cfg_h01B cfg_modeB E B; execute + +theorem step_h01B_1110 (w s : ListBlank (Fin 2)) : + (cfg_h01B ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> w) s) [target_tm]⊢⁺ + cfg_modeB ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> w) s := by + unfold cfg_h01B cfg_modeB E B; execute + +theorem step_h01B_100 (w s : ListBlank (Fin 2)) : + (cfg_h01B ((1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> w) s) [target_tm]⊢⁺ + cfg_h01B w ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> s) := by + unfold cfg_h01B E; execute + +theorem step_h01B_1010 (w s : ListBlank (Fin 2)) : + (cfg_h01B ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> w) s) [target_tm]⊢⁺ + cfg_h01B w ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> s) := by + unfold cfg_h01B E; execute + +-- modeB rules (4) +theorem step_modeB_base (w : ListBlank (Fin 2)) : + (cfg_modeB w ((1 : Fin 2) >> default)) [target_tm]⊢⁺ + cfg_h01B ((1 : Fin 2) >> (0 : Fin 2) >> w) ((1 : Fin 2) >> default) := by + unfold cfg_modeB cfg_h01B B E; execute + +theorem step_modeB_0100 (w s : ListBlank (Fin 2)) : + (cfg_modeB w ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> s)) [target_tm]⊢⁺ + cfg_h01B w ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> s) := by + unfold cfg_modeB cfg_h01B B E; execute + +theorem step_modeB_0101 (w s : ListBlank (Fin 2)) : + (cfg_modeB w ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> s)) [target_tm]⊢⁺ + cfg_modeB ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> w) s := by + unfold cfg_modeB B; execute + +theorem step_modeB_011 (w s : ListBlank (Fin 2)) : + (cfg_modeB w ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> s)) [target_tm]⊢⁺ + cfg_modeF ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> w) s := by + unfold cfg_modeB cfg_modeF B F; execute + +-- modeF rules (3) +theorem step_modeF_0100 (w s : ListBlank (Fin 2)) : + (cfg_modeF w ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> s)) [target_tm]⊢⁺ + cfg_h01B w ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> s) := by + unfold cfg_modeF cfg_h01B F E; execute + +theorem step_modeF_0101 (w s : ListBlank (Fin 2)) : + (cfg_modeF w ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> s)) [target_tm]⊢⁺ + cfg_modeB ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> w) s := by + unfold cfg_modeF cfg_modeB F B; execute + +theorem step_modeF_011 (w s : ListBlank (Fin 2)) : + (cfg_modeF w ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> s)) [target_tm]⊢⁺ + cfg_modeF ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> w) s := by + unfold cfg_modeF F; execute + +-- ============================================================================ +-- Section 7: Symbolic Token Lists (`WTok`, `STok`) & Shift Algebra +-- ============================================================================ + +inductive WTok + | W010 + | W0010 + | W0110 + | W100 + | W110 + | W1010 + | W1110 +deriving DecidableEq, Repr + +inductive STok + | T0100 + | T0101 + | T011 +deriving DecidableEq, Repr + +def evalW : List WTok → ListBlank (Fin 2) + | [] => default + | .W010 :: L => (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> evalW L + | .W0010 :: L => (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> evalW L + | .W0110 :: L => (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> evalW L + | .W100 :: L => (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> evalW L + | .W110 :: L => (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> evalW L + | .W1010 :: L => (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> evalW L + | .W1110 :: L => (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> evalW L + +def evalS : List STok → ListBlank (Fin 2) + | [] => (1 : Fin 2) >> default + | .T0100 :: S => (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> evalS S + | .T0101 :: S => (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> evalS S + | .T011 :: S => (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> evalS S + +-- Symbolic transitions on `(evalW L)` and `(evalS S)` +theorem sym_h01B_nil (S : List STok) : + (cfg_h01B (evalW []) (evalS S)) [target_tm]⊢⁺ + cfg_modeB (evalW [.W100]) (evalS S) := + step_h01B_nil (evalS S) + +theorem sym_h01B_010 (L : List WTok) (S : List STok) : + (cfg_h01B (evalW (.W010 :: L)) (evalS S)) [target_tm]⊢⁺ + cfg_modeB (evalW (.W110 :: L)) (evalS S) := + step_h01B_010 (evalW L) (evalS S) + +theorem sym_h01B_0010 (L : List WTok) (S : List STok) : + (cfg_h01B (evalW (.W0010 :: L)) (evalS S)) [target_tm]⊢⁺ + cfg_modeB (evalW (.W1010 :: L)) (evalS S) := + step_h01B_0010 (evalW L) (evalS S) + +theorem sym_h01B_0110 (L : List WTok) (S : List STok) : + (cfg_h01B (evalW (.W0110 :: L)) (evalS S)) [target_tm]⊢⁺ + cfg_modeB (evalW (.W1110 :: L)) (evalS S) := + step_h01B_0110 (evalW L) (evalS S) + +theorem sym_h01B_110 (L : List WTok) (S : List STok) : + (cfg_h01B (evalW (.W110 :: L)) (evalS S)) [target_tm]⊢⁺ + cfg_modeB (evalW (.W100 :: L)) (evalS S) := + step_h01B_110 (evalW L) (evalS S) + +theorem sym_h01B_1110 (L : List WTok) (S : List STok) : + (cfg_h01B (evalW (.W1110 :: L)) (evalS S)) [target_tm]⊢⁺ + cfg_modeB (evalW (.W1010 :: L)) (evalS S) := + step_h01B_1110 (evalW L) (evalS S) + +theorem sym_h01B_100 (L : List WTok) (S : List STok) : + (cfg_h01B (evalW (.W100 :: L)) (evalS S)) [target_tm]⊢⁺ + cfg_h01B (evalW L) (evalS (.T011 :: S)) := + step_h01B_100 (evalW L) (evalS S) + +theorem sym_h01B_1010 (L : List WTok) (S : List STok) : + (cfg_h01B (evalW (.W1010 :: L)) (evalS S)) [target_tm]⊢⁺ + cfg_h01B (evalW L) (evalS (.T0100 :: S)) := + step_h01B_1010 (evalW L) (evalS S) + +theorem sym_modeB_0100 (L : List WTok) (S : List STok) : + (cfg_modeB (evalW L) (evalS (.T0100 :: S))) [target_tm]⊢⁺ + cfg_h01B (evalW L) (evalS (.T0101 :: S)) := + step_modeB_0100 (evalW L) (evalS S) + +theorem sym_modeB_0101 (L : List WTok) (S : List STok) : + (cfg_modeB (evalW L) (evalS (.T0101 :: S))) [target_tm]⊢⁺ + cfg_modeB (evalW (.W1010 :: L)) (evalS S) := + step_modeB_0101 (evalW L) (evalS S) + +theorem sym_modeB_011 (L : List WTok) (S : List STok) : + (cfg_modeB (evalW L) (evalS (.T011 :: S))) [target_tm]⊢⁺ + cfg_modeF (evalW (.W010 :: L)) (evalS S) := + step_modeB_011 (evalW L) (evalS S) + +theorem sym_modeF_0100 (L : List WTok) (S : List STok) : + (cfg_modeF (evalW L) (evalS (.T0100 :: S))) [target_tm]⊢⁺ + cfg_h01B (evalW L) (evalS (.T0100 :: S)) := + step_modeF_0100 (evalW L) (evalS S) + +theorem sym_modeF_0101 (L : List WTok) (S : List STok) : + (cfg_modeF (evalW L) (evalS (.T0101 :: S))) [target_tm]⊢⁺ + cfg_modeB (evalW (.W1010 :: L)) (evalS S) := + step_modeF_0101 (evalW L) (evalS S) + +theorem sym_modeF_011 (L : List WTok) (S : List STok) : + (cfg_modeF (evalW L) (evalS (.T011 :: S))) [target_tm]⊢⁺ + cfg_modeF (evalW (.W010 :: L)) (evalS S) := + step_modeF_011 (evalW L) (evalS S) + +-- ============================================================================ +-- Section 8: Shift Algebra, Demand/Potential Bounds & Non-Halting Theorem +-- ============================================================================ + +def shift : Bool → List WTok → List WTok + | true, [] => [.W100] + | true, .W0010 :: m => .W100 :: .W010 :: m + | true, .W0110 :: m => .W100 :: .W110 :: m + | true, .W010 :: m => .W100 :: shift true m + | true, .W1010 :: m => .W1010 :: shift true m + | true, .W100 :: m => .W1010 :: shift false m + | true, .W110 :: m => .W110 :: m + | true, .W1110 :: m => .W1110 :: m + | false, [] => [] + | false, .W010 :: m => .W0010 :: m + | false, .W110 :: m => .W0110 :: m + | false, .W100 :: m => .W010 :: shift false m + | false, .W1010 :: m => .W010 :: shift true m + | false, .W0010 :: m => .W0010 :: m + | false, .W0110 :: m => .W0110 :: m + | false, .W1110 :: m => .W1110 :: m + +def isHigh : List WTok → Bool + | .W1010 :: _ | .W0010 :: _ | .W1110 :: _ | .W0110 :: _ => true + | _ => false + +def dem : Bool → List WTok → Nat + | false, [] => 0 + | true, [] => 3 + | _, .W1010 :: m => (dem true m + 1) / 2 + | _, .W0010 :: m | _, .W1110 :: m => (dem true m + 1) / 2 + 1 + | _, .W0110 :: m => (dem true m + 1) / 2 + 2 + | true, .W100 :: m => 2 * dem false m + | true, .W010 :: m => 2 * dem false m + 1 + | true, .W110 :: m => max 3 (2 * dem false m + 2) + | false, .W010 :: m => 3 * dem false m + | false, .W110 :: m => 3 * dem false m - 1 + | false, .W100 :: m => 3 * dem false m - 2 + +def potF : Bool → List WTok → Nat + | false, [] => 2 + | true, [] => 4 + | _, .W1010 :: m | _, .W0010 :: m | _, .W1110 :: m | _, .W0110 :: m => + (potF true m + 4) / 2 + | true, .W010 :: m => 2 * potF false m + 1 + | true, .W100 :: m => 2 * potF false m + 2 + | true, .W110 :: m => 2 * potF false m + 3 + | false, .W010 :: m => max 3 (3 * potF false m - 5) + | false, .W110 :: m => max 3 (3 * potF false m - 4) + | false, .W100 :: m => 3 * potF false m - 3 + +theorem evalW_shift : ∀ (b : Bool) (u : List WTok), + dem b u = 0 → + evalW (shift b u) = + (if b then (1 : Fin 2) >> (0 : Fin 2) >> evalW u else (0 : Fin 2) >> evalW u) + | true, [], h => nomatch h + | false, [], _ => by simp only [shift, evalW, zero_cons_default]; rfl + | true, .W0010 :: m, _ => rfl + | true, .W0110 :: m, _ => rfl + | true, .W010 :: m, h => by simp only [dem] at h; omega + | true, .W110 :: m, h => by simp only [dem] at h; omega + | true, .W1110 :: m, h => by simp only [dem] at h; omega + | true, .W1010 :: m, h => by + have hm : dem true m = 0 := by simp only [dem] at h; omega + change (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> evalW (shift true m) = _ + rw [evalW_shift true m hm]; rfl + | true, .W100 :: m, h => by + have hm : dem false m = 0 := by simp only [dem] at h; omega + change (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> evalW (shift false m) = _ + rw [evalW_shift false m hm]; rfl + | false, .W010 :: m, _ => rfl + | false, .W110 :: m, _ => rfl + | false, .W0010 :: m, h => by simp only [dem] at h; omega + | false, .W0110 :: m, h => by simp only [dem] at h; omega + | false, .W1110 :: m, h => by simp only [dem] at h; omega + | false, .W1010 :: m, h => by + have hm : dem true m = 0 := by simp only [dem] at h; omega + change (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> evalW (shift true m) = _ + rw [evalW_shift true m hm]; rfl + | false, .W100 :: m, h => by + have hm : dem false m = 0 := by simp only [dem] at h; omega + change (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> evalW (shift false m) = _ + rw [evalW_shift false m hm]; rfl + +theorem potF_ge : ∀ (u : List WTok), potF false u ≥ 2 ∧ potF true u ≥ 4 + | [] => ⟨by decide, by decide⟩ + | t :: m => by + have ⟨ihF, ihT⟩ := potF_ge m + cases t <;> simp only [potF] <;> exact ⟨by omega, by omega⟩ + +theorem potF_true_le : ∀ (u : List WTok), potF true u ≤ 2 * potF false u + 3 + | [] => by decide + | t :: m => by + have ⟨hpF, hpT⟩ := potF_ge m + cases t <;> simp only [potF] <;> omega + +theorem dem_true_of_dem_false_zero : ∀ {u : List WTok}, dem false u = 0 → dem true u ≤ 3 + | [], _ => by decide + | t :: m, h => by + cases t <;> simp only [dem] at h ⊢ <;> omega + +theorem isHigh_shift_true : ∀ {u : List WTok}, dem true u = 0 → isHigh (shift true u) = true + | [], h => nomatch h + | t :: m, h => by + cases t <;> simp only [dem, shift, isHigh] at h ⊢ <;> omega + +theorem shift_false_true_le {m : List WTok} (hm : dem false m = 0) + (ihF2 : potF false (shift false m) ≤ 3 * potF false m - 4) : + 3 * dem true (shift false m) ≤ 2 * dem false (shift false m) + 9 ∧ + potF true (shift false m) ≤ 2 * potF false m + 2 := by + cases m with + | nil => decide + | cons t n => + have ⟨hpF, hpT⟩ := potF_ge n + have hptle := potF_true_le n + cases t with + | W010 | W110 => + have hn : dem false n = 0 := by simp only [dem] at hm; omega + have hdt := dem_true_of_dem_false_zero hn + simp only [shift, dem, potF] + exact ⟨by omega, by omega⟩ + | W0010 | W0110 | W1110 => + simp only [dem] at hm; omega + | W100 => + simp only [shift] at ihF2 ⊢ + generalize shift false n = s at ihF2 ⊢ + simp only [dem, potF] at ihF2 ⊢ + exact ⟨by omega, by omega⟩ + | W1010 => + simp only [shift] at ihF2 ⊢ + generalize shift true n = s at ihF2 ⊢ + simp only [dem, potF] at ihF2 ⊢ + exact ⟨by omega, by omega⟩ + +theorem shift_true_false_eq {m : List WTok} (h : dem true m = 0) : + dem false (shift true m) = dem true (shift true m) ∧ + potF false (shift true m) = potF true (shift true m) := by + cases m with + | nil => nomatch h + | cons t n => + cases t with + | W010 | W110 | W0010 | W0110 | W1110 => + simp only [dem] at h; omega + | W100 | W1010 => + exact ⟨rfl, rfl⟩ + +theorem shift_bounds : ∀ (u : List WTok), + (dem false u = 0 → + 2 * dem false (shift false u) ≤ 6 * potF false u - 9 ∧ + potF false (shift false u) ≤ 3 * potF false u - 4) ∧ + (dem true u = 0 → + 2 * dem true (shift true u) ≤ potF true u - 2 ∧ + potF true (shift true u) ≤ (potF true u + 4) / 2) + | [] => ⟨fun _ => by decide, fun h => nomatch h⟩ + | t :: m => by + have ⟨ihF, ihT⟩ := shift_bounds m + have ⟨hpF, hpT⟩ := potF_ge m + have hptle := potF_true_le m + cases t with + | W010 => + refine ⟨fun h => ?_, fun h => by simp only [dem] at h; omega⟩ + have hm : dem false m = 0 := by simp only [dem] at h; omega + have hdt := dem_true_of_dem_false_zero hm + simp only [shift, dem, potF] + exact ⟨by omega, by omega⟩ + | W110 => + refine ⟨fun h => ?_, fun h => by simp only [dem] at h; omega⟩ + have hm : dem false m = 0 := by simp only [dem] at h; omega + have hdt := dem_true_of_dem_false_zero hm + simp only [shift, dem, potF] + exact ⟨by omega, by omega⟩ + | W0010 => + exact ⟨fun h => by simp only [dem] at h; omega, fun h => by simp only [dem] at h; omega⟩ + | W0110 => + exact ⟨fun h => by simp only [dem] at h; omega, fun h => by simp only [dem] at h; omega⟩ + | W1110 => + exact ⟨fun h => by simp only [dem] at h; omega, fun h => by simp only [dem] at h; omega⟩ + | W100 => + refine ⟨fun h => ?_, fun h => ?_⟩ + · have hm : dem false m = 0 := by simp only [dem] at h; omega + have ⟨ihF1, ihF2⟩ := ihF hm + simp only [shift, dem, potF] + exact ⟨by omega, by omega⟩ + · have hm : dem false m = 0 := by simp only [dem] at h; omega + have ⟨ihF1, ihF2⟩ := ihF hm + have ⟨hsf1, hsf2⟩ := shift_false_true_le hm ihF2 + simp only [shift, dem, potF] + exact ⟨by omega, by omega⟩ + | W1010 => + refine ⟨fun h => ?_, fun h => ?_⟩ + · have hm : dem true m = 0 := by simp only [dem] at h; omega + have ⟨ihT1, ihT2⟩ := ihT hm + have ⟨hst1, hst2⟩ := shift_true_false_eq hm + simp only [shift, dem, potF] + exact ⟨by omega, by omega⟩ + · have hm : dem true m = 0 := by simp only [dem] at h; omega + have ⟨ihT1, ihT2⟩ := ihT hm + simp only [shift, dem, potF] + exact ⟨by omega, by omega⟩ + +-- ============================================================================ +-- Section 9: Fuel-Indexed Multi-Pass Transducer (`TreeW`) with `StepOK` +-- ============================================================================ + +def ExitAt (S : List STok) (isB : Bool) (L' : List WTok) : Cfg (Fin 2) (Fin 6) := + if isB then cfg_modeB (evalW L') (evalS S) else cfg_modeF (evalW (.W010 :: L')) (evalS S) + +def StepOK (L : List WTok) (isB : Bool) (next : List WTok) : Prop := + match L with + | [] => isB = true ∧ next = [.W100] + | .W010 :: R => isB = true ∧ next = .W110 :: R + | .W110 :: R => isB = true ∧ next = .W100 :: R + | .W100 :: R => + isB = false ∧ + dem false next ≤ dem false R - 1 ∧ + potF false next ≤ potF false R + 1 + | _ => + isB = true ∧ + isHigh next = true ∧ + dem false next ≤ dem false L - 1 ∧ + potF false next ≤ potF false L + 1 + +theorem stepOK_of_isHigh {w next : List WTok} {isB : Bool} + (hw : isHigh w = true) (hok : StepOK w isB next) : + isB = true ∧ isHigh next = true ∧ + dem false next ≤ dem false w - 1 ∧ + potF false next ≤ potF false w + 1 := by + cases w with + | nil => nomatch hw + | cons t R => + cases t with + | W010 | W110 | W100 => nomatch hw + | W0010 | W0110 | W1010 | W1110 => exact hok + +theorem dem_potF_of_isHigh {w : List WTok} (hw : isHigh w = true) : + dem true w = dem false w ∧ potF true w = potF false w := by + cases w with + | nil => nomatch hw + | cons t R => + cases t with + | W010 | W110 | W100 => nomatch hw + | W0010 | W0110 | W1010 | W1110 => exact ⟨rfl, rfl⟩ + +theorem stepOK_W100_true {M next : List WTok} (hok : StepOK M true next) : + StepOK (.W100 :: M) false next := by + cases M with + | nil => + rcases hok with ⟨_, rfl⟩ + exact ⟨rfl, by decide, by decide⟩ + | cons t R => + cases t with + | W010 => + rcases hok with ⟨_, rfl⟩ + dsimp only [StepOK, dem, potF] + exact ⟨rfl, by omega, by omega⟩ + | W110 => + rcases hok with ⟨_, rfl⟩ + dsimp only [StepOK, dem, potF] + exact ⟨rfl, by omega, by omega⟩ + | W100 => nomatch hok.1 + | W0010 | W0110 | W1010 | W1110 => + rcases hok with ⟨_, _, hd1, hp⟩ + exact ⟨rfl, hd1, hp⟩ + +theorem stepOK_W100_false {M K : List WTok} (hok : StepOK M false K) : + StepOK (.W100 :: M) false (.W010 :: K) := by + cases M with + | nil => nomatch hok.1 + | cons t R => + cases t with + | W010 | W110 | W0010 | W0110 | W1010 | W1110 => nomatch hok.1 + | W100 => + rcases hok with ⟨_, hd1, hp⟩ + have ⟨hpR, _⟩ := potF_ge R + dsimp only [StepOK, dem, potF] + exact ⟨rfl, by omega, by omega⟩ + +theorem stepOK_W1010_TT {M M₁ M₂ : List WTok} + (hok₁ : StepOK M true M₁) (hok₂ : StepOK M₁ true M₂) : + StepOK (.W1010 :: M) true (.W1010 :: M₂) := by + cases M with + | nil => + rcases hok₁ with ⟨_, rfl⟩ + nomatch hok₂.1 + | cons t R => + cases t with + | W100 => nomatch hok₁.1 + | W110 => + rcases hok₁ with ⟨_, rfl⟩ + nomatch hok₂.1 + | W010 => + rcases hok₁ with ⟨_, rfl⟩ + rcases hok₂ with ⟨_, rfl⟩ + dsimp only [StepOK, isHigh, dem, potF] + exact ⟨rfl, rfl, by omega, by omega⟩ + | W0010 | W0110 | W1010 | W1110 => + rcases hok₁ with ⟨_, hm1, hd1, hp1⟩ + rcases stepOK_of_isHigh hm1 hok₂ with ⟨_, hm2, hd2, hp2⟩ + have ⟨hdt2, hpt2⟩ := dem_potF_of_isHigh hm2 + dsimp only [StepOK, isHigh, dem, potF] at hd1 hp1 ⊢ + exact ⟨rfl, rfl, by omega, by omega⟩ + +theorem stepOK_W1010_TF {M M₁ M₂ : List WTok} + (hok₁ : StepOK M true M₁) (hok₂ : StepOK M₁ false M₂) : + StepOK (.W1010 :: M) true (.W1010 :: .W010 :: M₂) := by + cases M with + | nil => + rcases hok₁ with ⟨_, rfl⟩ + rcases hok₂ with ⟨_, hd2, hp2⟩ + dsimp only [StepOK, isHigh, dem, potF] at hd2 hp2 ⊢ + exact ⟨rfl, rfl, by omega, by omega⟩ + | cons t R => + cases t with + | W100 => nomatch hok₁.1 + | W010 => + rcases hok₁ with ⟨_, rfl⟩ + nomatch hok₂.1 + | W110 => + rcases hok₁ with ⟨_, rfl⟩ + rcases hok₂ with ⟨_, hd2, hp2⟩ + dsimp only [StepOK, isHigh, dem, potF] at hd2 hp2 ⊢ + exact ⟨rfl, rfl, by omega, by omega⟩ + | W0010 | W0110 | W1010 | W1110 => + rcases hok₁ with ⟨_, hm1, _, _⟩ + nomatch (stepOK_of_isHigh hm1 hok₂).1 + +theorem stepOK_W1010_F {M M₁ : List WTok} + (hok₁ : StepOK M false M₁) : + StepOK (.W1010 :: M) true (.W1010 :: .W100 :: M₁) := by + cases M with + | nil => nomatch hok₁.1 + | cons t R => + cases t with + | W010 | W110 | W0010 | W0110 | W1010 | W1110 => nomatch hok₁.1 + | W100 => + rcases hok₁ with ⟨_, hd1, hp1⟩ + dsimp only [StepOK, isHigh, dem, potF] at hd1 hp1 ⊢ + exact ⟨rfl, rfl, by omega, by omega⟩ + +-- Symbolic pass combinators +theorem pass_W100_B {M M' : List WTok} + (h : ∀ S : List STok, (cfg_h01B (evalW M) (evalS S)) [target_tm]⊢⁺ cfg_modeB (evalW M') (evalS S)) + (S : List STok) : + (cfg_h01B (evalW (.W100 :: M)) (evalS S)) [target_tm]⊢⁺ cfg_modeF (evalW (.W010 :: M')) (evalS S) := + stepPlus_trans (sym_h01B_100 M S) (stepPlus_trans (h (.T011 :: S)) (sym_modeB_011 M' S)) + +theorem pass_W100_F {M M' : List WTok} + (h : ∀ S : List STok, (cfg_h01B (evalW M) (evalS S)) [target_tm]⊢⁺ cfg_modeF (evalW M') (evalS S)) + (S : List STok) : + (cfg_h01B (evalW (.W100 :: M)) (evalS S)) [target_tm]⊢⁺ cfg_modeF (evalW (.W010 :: M')) (evalS S) := + stepPlus_trans (sym_h01B_100 M S) (stepPlus_trans (h (.T011 :: S)) (sym_modeF_011 M' S)) + +theorem pass_W1010_BB {M M₁ M₂ : List WTok} + (h₁ : ∀ S : List STok, (cfg_h01B (evalW M) (evalS S)) [target_tm]⊢⁺ cfg_modeB (evalW M₁) (evalS S)) + (h₂ : ∀ S : List STok, (cfg_h01B (evalW M₁) (evalS S)) [target_tm]⊢⁺ cfg_modeB (evalW M₂) (evalS S)) + (S : List STok) : + (cfg_h01B (evalW (.W1010 :: M)) (evalS S)) [target_tm]⊢⁺ cfg_modeB (evalW (.W1010 :: M₂)) (evalS S) := + stepPlus_trans (sym_h01B_1010 M S) + (stepPlus_trans (h₁ (.T0100 :: S)) + (stepPlus_trans (sym_modeB_0100 M₁ S) + (stepPlus_trans (h₂ (.T0101 :: S)) + (sym_modeB_0101 M₂ S)))) + +theorem pass_W1010_BF {M M₁ M₂ : List WTok} + (h₁ : ∀ S : List STok, (cfg_h01B (evalW M) (evalS S)) [target_tm]⊢⁺ cfg_modeB (evalW M₁) (evalS S)) + (h₂ : ∀ S : List STok, (cfg_h01B (evalW M₁) (evalS S)) [target_tm]⊢⁺ cfg_modeF (evalW M₂) (evalS S)) + (S : List STok) : + (cfg_h01B (evalW (.W1010 :: M)) (evalS S)) [target_tm]⊢⁺ cfg_modeB (evalW (.W1010 :: M₂)) (evalS S) := + stepPlus_trans (sym_h01B_1010 M S) + (stepPlus_trans (h₁ (.T0100 :: S)) + (stepPlus_trans (sym_modeB_0100 M₁ S) + (stepPlus_trans (h₂ (.T0101 :: S)) + (sym_modeF_0101 M₂ S)))) + +theorem pass_W1010_F {M M₁ : List WTok} + (h₁ : ∀ S : List STok, (cfg_h01B (evalW M) (evalS S)) [target_tm]⊢⁺ cfg_modeF (evalW (.W010 :: M₁)) (evalS S)) + (S : List STok) : + (cfg_h01B (evalW (.W1010 :: M)) (evalS S)) [target_tm]⊢⁺ cfg_modeB (evalW (.W1010 :: .W100 :: M₁)) (evalS S) := + stepPlus_trans (sym_h01B_1010 M S) + (stepPlus_trans (h₁ (.T0100 :: S)) + (stepPlus_trans (sym_modeF_0100 (.W010 :: M₁) S) + (stepPlus_trans (sym_h01B_010 M₁ (.T0100 :: S)) + (stepPlus_trans (sym_modeB_0100 (.W110 :: M₁) S) + (stepPlus_trans (sym_h01B_110 M₁ (.T0101 :: S)) + (sym_modeB_0101 (.W100 :: M₁) S)))))) + +def TreeW : Nat → List WTok → Prop + | 0, _ => True + | n + 1, L => + ∃ (isB : Bool) (next : List WTok), + StepOK L isB next ∧ + (∀ S : List STok, (cfg_h01B (evalW L) (evalS S)) [target_tm]⊢⁺ ExitAt S isB next) ∧ + TreeW n next + +theorem treeW_succ : ∀ {n : Nat} {L : List WTok}, TreeW (n + 1) L → TreeW n L + | 0, _, _ => trivial + | _ + 1, _, ⟨isB, next, hok, hstep, sub⟩ => ⟨isB, next, hok, hstep, treeW_succ sub⟩ + +theorem treeW_triple : ∀ (n : Nat), + (∀ {M : List WTok}, TreeW n M → TreeW n (.W100 :: M)) ∧ + (∀ {M : List WTok}, TreeW n M → TreeW n (.W110 :: M)) ∧ + (∀ {M : List WTok}, TreeW n M → TreeW n (.W010 :: M)) + | 0 => ⟨fun _ => trivial, fun _ => trivial, fun _ => trivial⟩ + | n + 1 => + let ⟨ih100, ih110, ih010⟩ := treeW_triple n + ⟨fun {M} h => match h with + | ⟨true, next, hok, hstep, sub⟩ => + ⟨false, next, stepOK_W100_true hok, pass_W100_B hstep, sub⟩ + | ⟨false, K, hok, hstep, sub⟩ => + ⟨false, .W010 :: K, stepOK_W100_false hok, pass_W100_F hstep, ih010 sub⟩, + fun {M} t => ⟨true, .W100 :: M, ⟨rfl, rfl⟩, sym_h01B_110 M, ih100 (treeW_succ t)⟩, + fun {M} t => ⟨true, .W110 :: M, ⟨rfl, rfl⟩, sym_h01B_010 M, ih110 (treeW_succ t)⟩⟩ + +theorem treeW_W100 {n : Nat} {M : List WTok} (h : TreeW n M) : TreeW n (.W100 :: M) := + (treeW_triple n).1 h + +theorem treeW_W110 {n : Nat} {M : List WTok} (h : TreeW n M) : TreeW n (.W110 :: M) := + (treeW_triple n).2.1 h + +theorem treeW_W010 {n : Nat} {M : List WTok} (h : TreeW n M) : TreeW n (.W010 :: M) := + (treeW_triple n).2.2 h + +theorem treeW_nil : ∀ (n : Nat), TreeW n [] + | 0 => trivial + | n + 1 => ⟨true, [.W100], ⟨rfl, rfl⟩, sym_h01B_nil, treeW_W100 (treeW_nil n)⟩ + +theorem treeW_W1010_step {n : Nat} {M : List WTok} (t : TreeW (n + 2) M) : + ∃ (next : List WTok), + StepOK (.W1010 :: M) true (.W1010 :: next) ∧ + (∀ S : List STok, (cfg_h01B (evalW (.W1010 :: M)) (evalS S)) [target_tm]⊢⁺ cfg_modeB (evalW (.W1010 :: next)) (evalS S)) ∧ + TreeW n next := by + obtain ⟨isB₁, M₁, hok₁, hstep₁, sub₁⟩ := t + cases isB₁ with + | true => + obtain ⟨isB₂, M₂, hok₂, hstep₂, sub₂⟩ := sub₁ + cases isB₂ with + | true => + exact ⟨M₂, stepOK_W1010_TT hok₁ hok₂, pass_W1010_BB hstep₁ hstep₂, sub₂⟩ + | false => + exact ⟨.W010 :: M₂, stepOK_W1010_TF hok₁ hok₂, pass_W1010_BF hstep₁ hstep₂, treeW_W010 sub₂⟩ + | false => + exact ⟨.W100 :: M₁, stepOK_W1010_F hok₁, pass_W1010_F hstep₁, treeW_W100 (treeW_succ sub₁)⟩ + +theorem treeW_W1010 : ∀ (n : Nat) {M : List WTok}, TreeW (2 * n) M → TreeW n (.W1010 :: M) + | 0, _, _ => trivial + | n + 1, M, t => by + have heq : 2 * (n + 1) = 2 * n + 2 := rfl + rw [heq] at t + obtain ⟨next, hok, hstep, sub⟩ := treeW_W1010_step t + exact ⟨true, .W1010 :: next, hok, hstep, treeW_W1010 n sub⟩ + +theorem treeW_W0010 : ∀ {n : Nat} {M : List WTok}, TreeW (2 * n) M → TreeW n (.W0010 :: M) + | 0, _, _ => trivial + | n + 1, M, t => by + have heq : 2 * (n + 1) = 2 * n + 2 := rfl + rw [heq] at t + exact ⟨true, .W1010 :: M, + ⟨rfl, rfl, by simp only [dem]; omega, by simp only [potF]; omega⟩, + sym_h01B_0010 M, treeW_W1010 n (treeW_succ (treeW_succ t))⟩ + +theorem treeW_W1110 : ∀ {n : Nat} {M : List WTok}, TreeW (2 * n) M → TreeW n (.W1110 :: M) + | 0, _, _ => trivial + | n + 1, M, t => by + have heq : 2 * (n + 1) = 2 * n + 2 := rfl + rw [heq] at t + exact ⟨true, .W1010 :: M, + ⟨rfl, rfl, by simp only [dem]; omega, by simp only [potF]; omega⟩, + sym_h01B_1110 M, treeW_W1010 n (treeW_succ (treeW_succ t))⟩ + +theorem treeW_W0110 : ∀ {n : Nat} {M : List WTok}, TreeW (2 * n) M → TreeW n (.W0110 :: M) + | 0, _, _ => trivial + | n + 1, M, t => by + have heq : 2 * (n + 1) = 2 * n + 2 := rfl + rw [heq] at t + exact ⟨true, .W1110 :: M, + ⟨rfl, rfl, by simp only [dem]; omega, by simp only [potF]; omega⟩, + sym_h01B_0110 M, treeW_W1110 (treeW_succ (treeW_succ t))⟩ + +theorem buildTreeW : ∀ (L : List WTok) (n : Nat), TreeW n L + | [], n => treeW_nil n + | .W010 :: M, n => treeW_W010 (buildTreeW M n) + | .W0010 :: M, n => treeW_W0010 (buildTreeW M (2 * n)) + | .W0110 :: M, n => treeW_W0110 (buildTreeW M (2 * n)) + | .W100 :: M, n => treeW_W100 (buildTreeW M n) + | .W110 :: M, n => treeW_W110 (buildTreeW M n) + | .W1010 :: M, n => treeW_W1010 n (buildTreeW M (2 * n)) + | .W1110 :: M, n => treeW_W1110 (buildTreeW M (2 * n)) + +-- ============================================================================ +-- Section 10: Initial Reachability (`step_init_to_w4`) & `holdout_0504_nonhalt` +-- ============================================================================ + +theorem step_modeB_reparse {u w : List WTok} + (heq : (1 : Fin 2) >> (0 : Fin 2) >> evalW u = evalW w) : + (cfg_modeB (evalW u) (evalS [])) [target_tm]⊢⁺ + cfg_h01B (evalW w) (evalS []) := by + rw [← heq] + exact step_modeB_base (evalW u) + +theorem step_init_to_w4 : + (init []) [target_tm]⊢⁺ + cfg_h01B (evalW [.W1010, .W1010, .W1010, .W0010, .W1010, .W010, .W100]) (evalS []) := by + have h_w1 := pass_W1010_BF sym_h01B_nil (pass_W100_B sym_h01B_nil) + have h_w2 := pass_W1010_F (pass_W100_B h_w1) + have h_w3_a := pass_W1010_BB (sym_h01B_010 [.W100, .W1010]) (sym_h01B_110 [.W100, .W1010]) + have h_w3_b := pass_W1010_F (pass_W100_F (pass_W100_B h_w1)) + have h_w3 := pass_W1010_BB h_w3_a h_w3_b + have hp0 : (init []) [target_tm]⊢⁺ cfg_h01B (evalW [.W1010]) (evalS []) := + stepPlus_trans step_init_to_h01B + (stepPlus_trans (sym_h01B_nil []) + (step_modeB_reparse (by simp only [evalW, zero_cons_default]))) + have hp1 : (cfg_h01B (evalW [.W1010]) (evalS [])) [target_tm]⊢⁺ + cfg_h01B (evalW [.W1010, .W100, .W1010]) (evalS []) := + stepPlus_trans (h_w1 []) (step_modeB_reparse (by simp only [evalW, zero_cons_default])) + have hp2 : (cfg_h01B (evalW [.W1010, .W100, .W1010]) (evalS [])) [target_tm]⊢⁺ + cfg_h01B (evalW [.W1010, .W1010, .W010, .W100, .W1010]) (evalS []) := + stepPlus_trans (h_w2 []) (step_modeB_reparse (by simp only [evalW, zero_cons_default])) + have hp3 : (cfg_h01B (evalW [.W1010, .W1010, .W010, .W100, .W1010]) (evalS [])) [target_tm]⊢⁺ + cfg_h01B (evalW [.W1010, .W1010, .W1010, .W0010, .W1010, .W010, .W100]) (evalS []) := + stepPlus_trans (h_w3 []) (step_modeB_reparse (by simp only [evalW, zero_cons_default])) + exact stepPlus_trans hp0 (stepPlus_trans hp1 (stepPlus_trans hp2 hp3)) + +def Inv0504 (c : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ w : List WTok, + isHigh w = true ∧ + dem false w ≤ 1 ∧ + potF false w ≤ 4 ∧ + c = cfg_h01B (evalW w) (evalS []) + +end Solution + + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + refine nonhalt_of_inv target_tm Inv0504 ?_ ?_ + · refine ⟨_, ⟨[.W1010, .W1010, .W1010, .W0010, .W1010, .W010, .W100], rfl, by decide, by decide, rfl⟩, ?_⟩ + exact stepPlus_stepStar step_init_to_w4 + · rintro _ ⟨w, hw, hd, hp, rfl⟩ + obtain ⟨isB, u, hok, hstep, _⟩ := buildTreeW w 1 + obtain ⟨rfl, hu_high, hu_dem1, hu_pot⟩ := stepOK_of_isHigh hw hok + have ⟨hdu_eq, hpu_eq⟩ := dem_potF_of_isHigh hu_high + have hdu : dem true u = 0 := by omega + have hpu : potF true u ≤ 5 := by omega + have hw'_high : isHigh (shift true u) = true := isHigh_shift_true hdu + have ⟨hdw'_eq, hpw'_eq⟩ := dem_potF_of_isHigh hw'_high + have ⟨hb_dem, hb_pot⟩ := (shift_bounds u).2 hdu + refine ⟨cfg_h01B (evalW (shift true u)) (evalS []), + ⟨shift true u, hw'_high, by omega, by omega, rfl⟩, ?_⟩ + exact stepPlus_trans (hstep []) (step_modeB_reparse (evalW_shift true u hdu).symm) + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RE_1LC0RA_0RA0LD_1LEHHH_1RF0LF_0LC0RA diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC0RA_1LD0LB_1LA1LF_1LE1RA_0LCHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC0RA_1LD0LB_1LA1LF_1LE1RA_0LCHHH.lean new file mode 100644 index 00000000..830cf001 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC0RA_1LD0LB_1LA1LF_1LE1RA_0LCHHH.lean @@ -0,0 +1,48 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.BB6.NonHalt.M_1RB0RD_1RC1RF_1LD0LE_1RA0LC_1RE1LC_0RAHHH + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RB0RE_1LC0RA_1LD0LB_1LA1LF_1LE1RA_0LCHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC0RA_1LD0LB_1LA1LF_1LE1RA_0LCHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +def stateMap_m0685 : Fin 6 → Fin 6 + | 0 => 2 -- m0685 state A + | 1 => 3 -- m0685 state B + | 2 => 0 -- m0685 state C + | 3 => 1 -- m0685 state D + | 4 => 4 -- m0685 state E + | 5 => 5 -- m0685 state F + +public section + +theorem is_not_halt : IsNotHalt target := by + exact Counter.does_not_halt_of_conj_stem + (M_src := BusyBeaver.M_1RB0RD_1RC1RF_1LD0LE_1RA0LC_1RE1LC_0RAHHH.target) + (σ := stateMap_m0685) (f := true) + (c₁ := (default : ListBlank (Fin 2)) {{2}}> default) + (by decide) ⟨0, rfl⟩ + BusyBeaver.M_1RB0RD_1RC1RF_1LD0LE_1RA0LC_1RE1LC_0RAHHH.is_not_halt_from_0685 + +end + +end BusyBeaver.M_1RB0RE_1LC0RA_1LD0LB_1LA1LF_1LE1RA_0LCHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC0RE_1LD0LD_1RA0LC_1RA1RF_1RAHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC0RE_1LD0LD_1RA0LC_1RA1RF_1RAHHH.lean new file mode 100644 index 00000000..516a2e86 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC0RE_1LD0LD_1RA0LC_1RA1RF_1RAHHH.lean @@ -0,0 +1,49 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.BB6.NonHalt.M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RB0RE_1LC0RE_1LD0LD_1RA0LC_1RA1RF_1RAHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC0RE_1LD0LD_1RA0LC_1RA1RF_1RAHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +def stateMap_m0465 : Fin 6 → Fin 6 + | 0 => 3 -- m0465 state A + | 1 => 0 -- m0465 state B + | 2 => 1 -- m0465 state C + | 3 => 2 -- m0465 state D + | 4 => 4 -- m0465 state E + | 5 => 5 -- m0465 state F + +public section + +theorem is_not_halt : IsNotHalt target := by + exact Counter.does_not_halt_of_conj_stem + (M_tgt := target) + (M_src := BusyBeaver.M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH.target) + (σ := stateMap_m0465) (f := false) + (c₁ := (default : ListBlank (Fin 2)) {{1}}> default) + (by decide) (Counter.init_reaches_conjCfg_default rfl) + BusyBeaver.M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH.is_not_halt_from_0465 + +end + +end BusyBeaver.M_1RB0RE_1LC0RE_1LD0LD_1RA0LC_1RA1RF_1RAHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RAHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RAHHH.lean new file mode 100644 index 00000000..0c5b118f --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RAHHH.lean @@ -0,0 +1,269 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusF +public import BusyBeaver.Calculi.WordCalculusG +public import BusyBeaver.Calculi.WordCalculusH + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RAHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RAHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +abbrev A : Fin 6 := 2 +abbrev B : Fin 6 := 3 +abbrev C : Fin 6 := 0 +abbrev D : Fin 6 := 4 +abbrev E : Fin 6 := 1 +abbrev F : Fin 6 := 5 +@[reducible] def tm : Machine (Fin 2) (Fin 6) := target_tm +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 2000000 + +open WordVKQ Word WordVKQ.Traj114 + +abbrev evalCCfgVKQ (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev z0b (c : CCfg) : Option CCfg := Counter.bstep tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (evalCCfgVKQ c1) [tm]⊢⁺ (evalCCfgVKQ c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ + +abbrev pref24 : BitWord := [1,1,0,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0] + + +def zCs : Call -> Fin 6 + | .ch => E + | .ca => C + +def zCR (w : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([1] +> r) {{zCs c}}> w) + +def zCL (w : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (r <{{A}} ([0] +> w)) + +def zCf (w : HalfTape) : Cfg (Fin 2) (Fin 6) := + (default <{{A}} ([0] +> pref24 +> w)) + +abbrev callStep (c : Call) (w1 w2 : HalfTape) : Prop := + ∀ r, (zCR w1 c r) [tm]⊢⁺ (zCL w2 r) + +abbrev Side := SideP callStep +abbrev Seg := SegP callStep + +theorem seg_ch_V : Seg [.ch] [.ch, .ch] V_u V_u := + segP_of_step_two (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (fun u r => by unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_V : Seg [.ca] [.ch] V_u Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Vp : Seg [.ca] [.ca, .ca] Vp Vp := + segP_of_step_two (mid1 := [0, 1, 1, 1]) (mid2 := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_K : Seg [.ch] [] K_u Q_u := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs K_u Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_Q : Seg [.ch] [.ch] Q_u K_u := + segP_of_step_one (mid := [1, 1]) + (fun u r => by unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL K_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_VpQ : Seg [.ca] [.ca] (Vp ++ Q_u) (Kp ++ Vp) := + segP_of_step_one (mid := [0, 1, 0, 1, 1, 1]) + (fun u r => by unfold zCR zCs Vp Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_KpVp : Seg [.ca] [] (Kp ++ Vp) (Qp ++ Vp) := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs Kp Vp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_QpVp : Seg [.ca] [.ca, .ca] (Qp ++ Vp) (Kp ++ Vp) := + segP_of_step_two (mid1 := [0, 1, 1, 1, 1, 1]) (mid2 := [0, 1, 0, 1, 1, 1]) + (fun u r => by unfold zCR zCs Qp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Kp : Seg [.ca] [] Kp Qp := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs Kp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Qp : Seg [.ca] [.ca] Qp Kp := + segP_of_step_one (mid := [1, 1]) + (fun u r => by unfold zCR zCs Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_KQ : Seg [.ca] [] (K_u ++ Q_u) Vp := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs K_u Q_u Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_QQ : Seg [.ca] [.ca] (Q_u ++ Q_u) Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +-- Turnaround zP0..zP6 +abbrev tr1 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr2 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr3 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr4 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr5 : BitWord := [0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1] +abbrev tr6 : BitWord := [0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1] + +theorem zP0 (w : HalfTape) : (zCf w) [tm]⊢⁺ (zCR w .ca (tr1 +> default)) := by + unfold zCf zCR zCs pref24 tr1 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP1 (w : HalfTape) : (zCL w (tr1 +> default)) [tm]⊢⁺ (zCR w .ca (tr2 +> default)) := by + unfold zCL zCR zCs tr1 tr2 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP2 (w : HalfTape) : (zCL w (tr2 +> default)) [tm]⊢⁺ (zCR w .ca (tr3 +> default)) := by + unfold zCL zCR zCs tr2 tr3 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP3 (w : HalfTape) : (zCL w (tr3 +> default)) [tm]⊢⁺ (zCR w .ca (tr4 +> default)) := by + unfold zCL zCR zCs tr3 tr4 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP4 (w : HalfTape) : (zCL w (tr4 +> default)) [tm]⊢⁺ (zCR w .ca (tr5 +> default)) := by + unfold zCL zCR zCs tr4 tr5 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP5 (w : HalfTape) : (zCL w (tr5 +> default)) [tm]⊢⁺ (zCR w .ca (tr6 +> default)) := by + unfold zCL zCR zCs tr5 tr6 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP6 (w : HalfTape) : (zCL w (tr6 +> default)) [tm]⊢⁺ (zCf ([1, 1, 0] +> w)) := by + unfold zCL zCf tr6 pref24 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +-- Section 2: Words, Shift Identity, DigitVal, Parse, Scan, Step +theorem segSpec : SegSpec callStep := + ⟨seg_ch_V, seg_ca_V, seg_ca_Vp, seg_ch_K, seg_ch_Q, + seg_ca_VpQ, seg_ca_KpVp, seg_ca_QpVp, seg_ca_Kp, seg_ca_Qp, + seg_ca_KQ, seg_ca_QQ⟩ + +theorem Side_turnaround {w w' : HalfTape} (h : Side ([Call.ca] ^ 6) w w') : + (zCf w) [tm]⊢⁺ (zCf ([1, 1, 0] +> w')) := by + rcases h with _ | ⟨hc1, h⟩ + rcases h with _ | ⟨hc2, h⟩ + rcases h with _ | ⟨hc3, h⟩ + rcases h with _ | ⟨hc4, h⟩ + rcases h with _ | ⟨hc5, h⟩ + rcases h with _ | ⟨hc6, h⟩ + cases h + exact stepPlus_trans_vkq (zP0 w) + (stepPlus_trans_vkq (hc1 (tr1 +> default)) + (stepPlus_trans_vkq (zP1 _) + (stepPlus_trans_vkq (hc2 (tr2 +> default)) + (stepPlus_trans_vkq (zP2 _) + (stepPlus_trans_vkq (hc3 (tr3 +> default)) + (stepPlus_trans_vkq (zP3 _) + (stepPlus_trans_vkq (hc4 (tr4 +> default)) + (stepPlus_trans_vkq (zP4 _) + (stepPlus_trans_vkq (hc5 (tr5 +> default)) + (stepPlus_trans_vkq (zP5 _) + (stepPlus_trans_vkq (hc6 (tr6 +> default)) (zP6 w')))))))))))) + +theorem Step_exec {u u' : List Word} (h : Step u u') : + (zCf (evalWords u default)) [tm]⊢⁺ (zCf (evalWords u' default)) := by + rcases h with ⟨n, b', v, da, H, g, hScan, hDg, rfl⟩ + have hSeg := Seg_of_Scan segSpec hScan + dsimp at hSeg + have hSide0 := sideP_of_segP hSeg (Side_ca_default segSpec hDg) + rw [wordsToBits_append_tape, evalWords_append, evalWords_replicate_K, wordsToBitsShifted_append_tape, <- evalWordsShifted_append] at hSide0 + have hTurn := Side_turnaround hSide0 + rwa [evalWords_V_shift] at hTurn + +theorem Rounds_exec {u v : List Word} (h : Rounds u v) : + (zCf (evalWords u default)) [tm]⊢* (zCf (evalWords v default)) := by + induction h with + | refl _ => exact ⟨0, rfl⟩ + | next hS _ ih => exact stepStar_of_stepPlus_vkq (stepPlus_stepStar_trans_vkq (Step_exec hS) ih) + +-- Section 3: Universal Parse_V_start, Scan_of_Parse, and Trace Evaluators + +def zInitCCfg : CCfg := ⟨0, 0, [], []⟩ +def zHit5CCfg : CCfg := ⟨2, 0, [], [0,1,1,0,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,0,1,0,1]⟩ + +set_option maxRecDepth 200000 in +theorem zCm_init_979 : zCm zInitCCfg 979 = some zHit5CCfg := by decide + +theorem init_to_u0 : (init []) [tm]⊢* zCf (evalWords u_0 default) := by + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = evalCCfgVKQ zInitCCfg := rfl + have h1 : evalCCfgVKQ zHit5CCfg = zCf (evalWords u_0 default) := by + dsimp [evalCCfgVKQ, zHit5CCfg, zCf, pref24, u_0, evalWords, V_u, K_u, Q_u] + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + have hPlus := zTc (by decide : 0 < 979) zCm_init_979 + rw [<- h0, h1] at hPlus + exact stepStar_of_stepPlus_vkq hPlus + +-- 14 finite rounds u_0 -> u_14 +theorem reach_N (m : Nat) : + ∃ N, m <= N ∧ ∃ u, + multiStep tm (init []) N = some (zCf (evalWords u default)) ∧ + Good u := by + induction m with + | zero => + rcases init_to_u0 with ⟨k1, hk1⟩ + rcases Rounds_exec rounds_0_14 with ⟨k2, hk2⟩ + exact ⟨k1 + k2, Nat.zero_le _, u_14, multiStep_trans_vkq tm _ _ _ k1 k2 hk1 hk2, good_u14⟩ + | succ m ih => + rcases ih with ⟨N, hN, u, h_ms, hG⟩ + rcases Good_step hG with ⟨u', hStep, hG'⟩ + rcases Step_exec hStep with ⟨k, hk_pos, h_step_k⟩ + exact ⟨N + k, Nat.add_le_add hN hk_pos, u', multiStep_trans_vkq tm _ _ _ N k h_ms h_step_k, hG'⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n, hn⟩ + rcases reach_N (n + 1) with ⟨N, hN, _, h_N, _⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := multiStep_add_intermediate_vkq h_N + rw [multiStep_succ_vkq, hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RAHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RDHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RDHHH.lean new file mode 100644 index 00000000..b02d4f3d --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RDHHH.lean @@ -0,0 +1,1701 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RDHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RDHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 8000000 +@[simp] theorem zMz (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : HalfTape).head = 0 := rfl +@[simp] theorem zDt : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem zPs {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem zPt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,by omega,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) +abbrev t : BitWord := [1,1,0,0] +abbrev d0 : BitWord := [0,0] +abbrev d1 : BitWord := [1,0] +abbrev one : BitWord := [1] +abbrev lh : HalfTape := (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default +@[simp] theorem zDd : d0 +> (default : HalfTape) = default := by + simp [d0] +inductive Call where + | ch + | cj + | cp + | ca +def zCs : Call -> Fin 6 + | .ch => B + | .cj => A + | .cp => A + | .ca => A +def zCw : Call -> BitWord + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] + | .ca => [1,1,1,0,1,0] +def zCR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + ((l <+ zCw c) {{zCs c}}> r) +def zCL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (l <{{C}} ([0] +> r)) +def zCf (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + zCL lh r +def z04 (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l,(zCR l c r1) [target_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + z04 c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem z05 {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z06 {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem z07 {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z08 {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z09 {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0a (w : BitWord) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem zSc {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases z09 h with ⟨r2,ha,hb⟩ + exact z08 (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS4 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc1 (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [target_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem z0b : Seg [.cp] [.cj] t t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0c : Seg [.cj] [.cj,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0d : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0e : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0f : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1 d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0g : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0h : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0i : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0j : Seg [.cj] [.cp] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons,append_nil]; execute) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0k : Seg [.ca] [.cj] [] t := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + have h1 : zCR l .ca ([] +> r1) = zCR ([1,0,1,0] +> l) .cj r1 := by + unfold zCR zCw zCs; simp only [append_cons,append_nil] + have h2 : (zCL ([1,0,1,0] +> l) r2) [target_tm]⊢⁺ (zCL l (t +> r2)) := by + unfold zCL t; simp only [append_cons,append_nil]; execute + rw [h1] + exact zPt (hc1 ([1,0,1,0] +> l)) h2 +theorem zS3 (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact z0a t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [zLp,h_eq,z07] + exact zSg z0d ih +theorem zSa {w2 : BitWord} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact z0a w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq,z07,zLp] + exact zSg hw ih +theorem z0l : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0m : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem z0n (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) t t := + zSg z0b (zS3 n) +theorem z0o (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using zSg z0c (zS3 n) +theorem z0p (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0e zH2) (zS3 n) +theorem z0q (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0f (zS3 n) +theorem z0r (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0g (zS3 n) +theorem z0s (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [zLp',List.cons_append,List.nil_append] using zSg z0h (zS3 n) +theorem z0t (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0i (zSg zH1 zH3) + have h1 := zSg h0 (zSa z0l n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0u (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0j (zSa z0l n) +theorem z0v : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0i zH1 +theorem z0w (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0i (zSg zH1 (zSg zH3 zH0)) + have h1 := zSg h0 (zSa z0m n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0x (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg [.cj,.ch] [.cp] d1 d1 := zSg z0j zH0 + have h1 := zSg h0 (zSa z0m n) + simpa only [zLp',List.cons_append,List.nil_append] using h1 +theorem z0y : Seg [.ca] [.cj] [] t := + z0k +theorem z0z (r : HalfTape) : + (zCf r) [target_tm]⊢⁺ (zCR ([1,1] +> default) .ca r) := by + unfold zCf zCL zCR lh zCw zCs + simp only [append_cons,append_nil] + execute +theorem z0A (r : HalfTape) : + (zCL ([1,1] +> default) r) [target_tm]⊢⁺ (zCR lh .cj r) := by + unfold zCL zCR lh zCw zCs + simp only [append_cons,append_nil] + execute +def z0B : Cfg (Fin 2) (Fin 6) := + (([1,1,1,0,1,0,1,0,1,1,1,0,1] +> default) {{A}}> ([] +> default)) +def z0C : Cfg (Fin 2) (Fin 6) := + (([] +> default) {{C}}> ([1,1,1,0,0,1,1,0,0,1,1,0,0,0,0,0,0,1] +> default)) +def z0D : Cfg (Fin 2) (Fin 6) := + (([1,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1] +> default) {{B}}> ([1,0,0,1] +> default)) +def z0E : Cfg (Fin 2) (Fin 6) := + (([1,0,1,1,1,0,1] +> default) {{A}}> ([0,1,1,1,0,0,1,1,0,0,1,0,0,0,1,1] +> default)) +def z0F : Cfg (Fin 2) (Fin 6) := + (([1,0,1,1,1,0,1,1,1,0,1,1,1,0,1] +> default) {{C}}> ([1,1,1,0,0,1,1,0,0,1,0,1] +> default)) +def z0G : Cfg (Fin 2) (Fin 6) := + (([1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1] +> default) {{C}}> ([1,0,0,1,0,1] +> default)) +def z0H : Cfg (Fin 2) (Fin 6) := + (([1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1] +> default) {{C}}> ([1,0,0,0,0,1] +> default)) +def z0I : Cfg (Fin 2) (Fin 6) := + (([1,1,1,0,1,0,1,0,1,1,1,0,1] +> default) {{C}}> ([0,0,0,1,1,0,0,1,1,0,0,1,0,1,0,0,0,1] +> default)) +def z0J : Cfg (Fin 2) (Fin 6) := + (([1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1] +> default) {{C}}> ([0,0,0,0,0,1,0,1,0,1] +> default)) +def z0K : Cfg (Fin 2) (Fin 6) := + (([1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1] +> default) {{A}}> ([0,1,0,1] +> default)) +def z0L : Cfg (Fin 2) (Fin 6) := + (([1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1] +> default) {{C}}> ([0,0,0,1,0,1,0,0,0,0,0,1] +> default)) +def z0M : Cfg (Fin 2) (Fin 6) := + (([1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1] +> default) {{A}}> ([0,1,1,0,0,1,0,0,0,1,0,0,0,1] +> default)) +def z0N : Cfg (Fin 2) (Fin 6) := + (([1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1] +> default) {{A}}> ([0,1,0,1,0,0,0,1] +> default)) +def z0O : Cfg (Fin 2) (Fin 6) := + (([1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1] +> default) {{A}}> ([0,0,1,0,0,1,0,1,0,0,0,1,0,1] +> default)) +def z0P : Cfg (Fin 2) (Fin 6) := + (([1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1] +> default) {{A}}> ([1,0,0,1,0,0,0,1,0,1,0,1] +> default)) +theorem z0Q : (init []) [target_tm]⊢⁺ z0B := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init]; unfold z0B; simp only [append_cons,append_nil]; execute +theorem z0R : z0B [target_tm]⊢⁺ z0C := by + unfold z0B z0C; simp only [append_cons,append_nil]; execute +theorem z0S : z0C [target_tm]⊢⁺ z0D := by + unfold z0C z0D; simp only [append_cons,append_nil]; execute +theorem z0T : z0D [target_tm]⊢⁺ z0E := by + unfold z0D z0E; simp only [append_cons,append_nil]; execute +theorem pre_z0U : z0E [target_tm]⊢⁺ z0F := by + unfold z0E z0F; simp only [append_cons,append_nil]; execute +theorem pre_z0V : z0F [target_tm]⊢⁺ z0G := by + unfold z0F z0G; simp only [append_cons,append_nil]; execute +theorem pre_z0W : z0G [target_tm]⊢⁺ z0H := by + unfold z0G z0H; simp only [append_cons,append_nil]; execute +theorem pre_z0X : z0H [target_tm]⊢⁺ z0I := by + unfold z0H z0I; simp only [append_cons,append_nil]; execute +theorem pre_z0Y : z0I [target_tm]⊢⁺ z0J := by + unfold z0I z0J; simp only [append_cons,append_nil]; execute +theorem pre_z0Z : z0J [target_tm]⊢⁺ z0K := by + unfold z0J z0K; simp only [append_cons,append_nil]; execute +theorem pre_z10 : z0K [target_tm]⊢⁺ z0L := by + unfold z0K z0L; simp only [append_cons,append_nil]; execute +theorem pre_z11 : z0L [target_tm]⊢⁺ z0M := by + unfold z0L z0M; simp only [append_cons,append_nil]; execute +theorem pre_z12 : z0M [target_tm]⊢⁺ z0N := by + unfold z0M z0N; simp only [append_cons,append_nil]; execute +theorem pre_z13 : z0N [target_tm]⊢⁺ z0O := by + unfold z0N z0O; simp only [append_cons,append_nil]; execute +theorem pre_z14 : z0O [target_tm]⊢⁺ z0P := by + unfold z0O z0P; simp only [append_cons,append_nil]; execute +theorem pre_z15 : z0P [target_tm]⊢⁺ + zCf (([1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,0,1,0,1,0,1,0] : BitWord) +> default) := by + unfold z0P zCf zCL lh + simp only [append_cons,append_nil,z00] + execute +theorem pre_z16 : + (init []) [target_tm]⊢⁺ + zCf (([1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,0,1,0,1,0,1,0] : BitWord) +> default) := + zPt z0Q + (zPt z0R + (zPt z0S + (zPt z0T + (zPt pre_z0U + (zPt pre_z0V + (zPt pre_z0W + (zPt pre_z0X + (zPt pre_z0Y + (zPt pre_z0Z + (zPt pre_z10 + (zPt pre_z11 + (zPt pre_z12 + (zPt pre_z13 + (zPt pre_z14 pre_z15)))))))))))))) +inductive RIncs : Nat -> HalfTape -> HalfTape -> Prop where + | zero (r : HalfTape) : RIncs 0 r (one +> r) + | T {n : Nat} {r r' : HalfTape} : + RIncs ((1 + n) * 2) r r' -> RIncs (1 + n) (t +> r) (t +> r') + | pair0 {n : Nat} {r r' : HalfTape} : + RIncs (n * 2) r r' -> RIncs (1 + n) (d1 +> (d0 +> r)) (t +> r') + | pair1 {n : Nat} {r r' : HalfTape} : + RIncs (1 + n * 2) r r' -> RIncs (1 + n) (d1 +> (d1 +> r)) (t +> r') + | short00 {n : Nat} {r r' : HalfTape} : + RIncs (n * 2) r r' -> RIncs (2 + n * 4) (d0 +> r) (d0 +> r') + | short01 {n : Nat} {r r' : HalfTape} : + RIncs (1 + n * 2) r r' -> RIncs (2 + n * 4) (d1 +> r) (d0 +> r') + | short10 {n : Nat} {r r' : HalfTape} : + RIncs (n * 2) r r' -> RIncs (4 + n * 4) (d0 +> r) (d1 +> r') + | short11 {n : Nat} {r r' : HalfTape} : + RIncs (1 + n * 2) r r' -> RIncs (4 + n * 4) (d1 +> r) (d1 +> r') +inductive Binary : Nat -> Nat -> HalfTape -> Prop where + | one : Binary 1 1 (d1 +> default) + | zero {n H : Nat} {r : HalfTape} : + Binary (1 + n) H r -> Binary (2 + n * 2) (1 + H) (d0 +> r) + | two {n H : Nat} {r : HalfTape} : + Binary (1 + n) H r -> Binary (3 + n * 2) (1 + H) (d1 +> r) + +open WordCalculus Word +local notation "WordList" => List Word + +theorem loc_z17 (n : Nat) : 0 < 8 ^ n := by + induction n with + | zero => decide + | succ n ih => rw [Nat.pow_succ]; omega + +theorem loc_z19 {A H : Nat} {r : HalfTape} (h : Binary A H r) : + 0 < A /\ 0 < H /\ 2 ^ H <= A * 2 /\ A < 2 ^ H := by + induction h with + | one => decide + | @zero n H r _ ih => + rw [pow_two_one_add H]; omega + | @two n H r _ ih => + rw [pow_two_one_add H]; omega + +theorem loc_z1a (n : Nat) : ∃ H r,Binary (1 + n) H r := by + induction n using Nat.strong_induction_on with + | h n ih => + cases n with + | zero => exact ⟨1,d1 +> default,Binary.one⟩ + | succ m => + rcases even_or_odd_mul_two m with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · rcases ih a (by omega) with ⟨H0,r,hI⟩ + refine ⟨1 + H0,d0 +> r,?_⟩ + have heq : 1 + (a * 2 + 1) = 2 + a * 2 := by omega + rw [heq]; exact Binary.zero hI + · rcases ih a (by omega) with ⟨H0,r,hI⟩ + refine ⟨1 + H0,d1 +> r,?_⟩ + have heq : 1 + ((1 + a * 2) + 1) = 3 + a * 2 := by omega + rw [heq]; exact Binary.two hI + +theorem loc_z1b {A H : Nat} {r : HalfTape} (h : Binary A H r) : + RIncs ((A - 1) * 2) default r := by + induction h with + | one => + have h0 := RIncs.zero (default : HalfTape) + have hd : d1 +> (default : HalfTape) = one +> default := by simp [d1,one] + rw [hd]; exact h0 + | @zero n H r _ ih => + have ih' : RIncs (n * 2) default r := by + have heq : ((1 + n) - 1) * 2 = n * 2 := by omega + rwa [heq] at ih + have hs := RIncs.short00 ih' + rw [zDd] at hs + have heq : ((2 + n * 2) - 1) * 2 = 2 + n * 4 := by omega + rwa [heq] + | @two n H r _ ih => + have ih' : RIncs (n * 2) default r := by + have heq : ((1 + n) - 1) * 2 = n * 2 := by omega + rwa [heq] at ih + have hs := RIncs.short10 ih' + rw [zDd] at hs + have heq : ((3 + n * 2) - 1) * 2 = 4 + n * 4 := by omega + rwa [heq] + +theorem loc_z1n {A H : Nat} {u : WordList} (h1 : DigitVal A H u) : + ∀ {B J : Nat} {r : HalfTape},Binary B J r -> Binary (A + B * 2 ^ H) (H + J) (evalWords u r) := by + induction h1 with + | nil => + intro B J r h2 + simpa [evalWords] using h2 + | @zero A H u _ ih => + intro B J r h2 + have hI := ih h2 + have hB := loc_z19 hI + have hI' : Binary (1 + (A + B * 2 ^ H - 1)) (H + J) (evalWords u r) := by + have heq : 1 + (A + B * 2 ^ H - 1) = A + B * 2 ^ H := by omega + rwa [heq] + have h3 := Binary.zero hI' + have heq1 : 2 + (A + B * 2 ^ H - 1) * 2 = A * 2 + B * 2 ^ (1 + H) := by + rw [pow_two_one_add H,Nat.mul_add]; omega + have heq2 : 1 + (H + J) = (1 + H) + J := by omega + simpa [evalWords,heq1,heq2] using h3 + | @one A H u _ ih => + intro B J r h2 + have hI := ih h2 + have hB := loc_z19 hI + have hI' : Binary (1 + (A + B * 2 ^ H - 1)) (H + J) (evalWords u r) := by + have heq : 1 + (A + B * 2 ^ H - 1) = A + B * 2 ^ H := by omega + rwa [heq] + have h3 := Binary.two hI' + have heq1 : 3 + (A + B * 2 ^ H - 1) * 2 = (1 + A * 2) + B * 2 ^ (1 + H) := by + rw [pow_two_one_add H,Nat.mul_add]; omega + have heq2 : 1 + (H + J) = (1 + H) + J := by omega + simpa [evalWords,heq1,heq2] using h3 + +def loc_z1p (ds : WordList) : Prop := ∃ w,ds = Q :: (List.replicate 1 K ++ w) + +def loc_z1q (ds : WordList) : Prop := ∃ w,ds = w ++ List.replicate 5 Q + +theorem loc_z1r (n : Nat) : DigitVal 0 n (List.replicate n K) := by + induction n with + | zero => exact DigitVal.nil + | succ n ih => + have h0 := DigitVal.zero ih + have heq : 1 + n = n + 1 := by omega + simpa [List.replicate,heq] using h0 + +theorem loc_z1s (n : Nat) : + Binary (2 ^ (n + 1) - 1) (n + 1) (evalWords (List.replicate (n + 1) Q) default) := by + rw [replicate_succ_append,evalWords_append] + dsimp [evalWords] + have hpos := pow_two_pos n + have hB := loc_z1n (digitVal_replicate_Q n) Binary.one + have heq : (2 ^ n - 1) + 1 * 2 ^ n = 2 ^ (n + 1) - 1 := by + rw [Nat.pow_succ]; omega + rwa [heq] at hB + +theorem loc_z1t (r k : Nat) (hL : 31 * 2 ^ r <= k) (hU : k < 32 * 2 ^ r) : + ∃ ds,DigitVal (1 + k * 4) (7 + r) ds /\ loc_z1p ds /\ loc_z1q ds /\ + Binary (1 + k * 4) (7 + r) (evalWords ds default) := by + let a := k - 31 * 2 ^ r + have hA : a + 31 * 2 ^ r = k := by omega + have ha_lt : a < 2 ^ r := by omega + rcases exists_digitVal_of_lt_pow r a ha_lt with ⟨v,hD⟩ + have hLow : DigitVal 1 2 (Q :: List.replicate 1 K) := by + have h1 := DigitVal.one (loc_z1r 1) + simpa using h1 + have hHigh : DigitVal k (r + 5) (v ++ List.replicate 5 Q) := by + have hApp := digitVal_append hD (digitVal_replicate_Q 5) + have heq : a + (2 ^ 5 - 1) * 2 ^ r = k := by + change a + 31 * 2 ^ r = k + exact hA + rwa [heq] at hApp + have hHighB : Binary k (r + 5) (evalWords (v ++ List.replicate 5 Q) default) := by + rw [evalWords_append] + have hB := loc_z1n hD (loc_z1s 4) + have heq : a + (2 ^ 5 - 1) * 2 ^ r = k := by + change a + 31 * 2 ^ r = k + exact hA + rwa [heq] at hB + refine ⟨(Q :: List.replicate 1 K) ++ (v ++ List.replicate 5 Q),?_,⟨v ++ List.replicate 5 Q,rfl⟩, + ⟨(Q :: List.replicate 1 K) ++ v,by rw [List.append_assoc]⟩,?_⟩ + · have hApp := digitVal_append hLow hHigh + have heq1 : 1 + k * 2 ^ 2 = 1 + k * 4 := by ring + have heq2 : 2 + (r + 5) = 7 + r := by omega + rwa [heq1,heq2] at hApp + · rw [evalWords_append] + have hB := loc_z1n hLow hHighB + have heq1 : 1 + k * 2 ^ 2 = 1 + k * 4 := by ring + have heq2 : 2 + (r + 5) = 7 + r := by omega + rwa [heq1,heq2] at hB + +theorem loc_z1u (n : Nat) : 2 ^ (3 * n) = 8 ^ n := by + induction n with + | zero => rfl + | succ n ih => + have heq : 3 * (n + 1) = 3 * n + 3 := by omega + rw [heq,Nat.pow_add,ih,Nat.pow_succ]; ring + +theorem loc_z1D {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) : + ∀ {r r' : HalfTape},RIncs b r r' -> RIncs a (evalWords u r) (evalWords v r') := by + induction h with + | nil _ => intro r r' hR; exact hR + | T _ ih => intro r r' hR; exact RIncs.T (ih hR) + | pair0 _ ih => intro r r' hR; exact RIncs.pair0 (ih hR) + | pair1 _ ih => intro r r' hR; exact RIncs.pair1 (ih hR) + | short00 _ ih => intro r r' hR; exact RIncs.short00 (ih hR) + | short01 _ ih => intro r r' hR; exact RIncs.short01 (ih hR) + | short10 _ ih => intro r r' hR; exact RIncs.short10 (ih hR) + | short11 _ ih => intro r r' hR; exact RIncs.short11 (ih hR) + +theorem loc_z1F {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) : + (a : Rat) = (b : Rat) * wordScale v + (wordMassQ v + l) * 2 := by + induction h with + | nil k => simp [wordMassQ,wordScale] + | T _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | pair0 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | pair1 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | short00 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | short01 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | short10 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | short11 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + +theorem loc_z1J {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) : wordScale v <= wordScale u := by + induction h with + | nil _ => simp [wordScale] + | T _ ih => dsimp [wordScale]; linarith + | @pair0 _ u _ _ _ _ _ => have hp := wordScale_pos u; dsimp [wordScale]; linarith + | @pair1 _ u _ _ _ _ _ => have hp := wordScale_pos u; dsimp [wordScale]; linarith + | short00 _ ih => dsimp [wordScale]; linarith + | short01 _ ih => dsimp [wordScale]; linarith + | short10 _ ih => dsimp [wordScale]; linarith + | short11 _ ih => dsimp [wordScale]; linarith + +theorem loc_z1K {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) (he : hasQKSubword u = true) : wordScale v * 8 <= wordScale u := by + induction h with + | nil _ => contradiction + | T _ ih => dsimp [hasQKSubword,wordScale] at he ⊢; have := ih he; linarith + | pair0 hS _ => have := loc_z1J hS; dsimp [wordScale]; linarith + | pair1 hS _ => have := loc_z1J hS; dsimp [wordScale]; linarith + | short00 _ ih => dsimp [hasQKSubword,wordScale] at he ⊢; have := ih he; linarith + | @short01 n u k v l hS ih => + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => dsimp [hasQKSubword,wordScale] at he ih ⊢; have := ih he; linarith + | K => exact False.elim (not_scan_odd_cons_K n u' k v l hS) + | Q => dsimp [hasQKSubword,wordScale] at he ih ⊢; have := ih he; linarith + | short10 _ ih => dsimp [hasQKSubword,wordScale] at he ⊢; have := ih he; linarith + | @short11 n u k v l hS ih => + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => dsimp [hasQKSubword,wordScale] at he ih ⊢; have := ih he; linarith + | K => exact False.elim (not_scan_odd_cons_K n u' k v l hS) + | Q => dsimp [hasQKSubword,wordScale] at he ih ⊢; have := ih he; linarith + +theorem loc_z1O {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) (he : hasQKSubword u = true) : 0 < l := by + induction h with + | nil _ => contradiction + | T _ ih => dsimp [hasQKSubword] at he; have := ih he; linarith + | pair0 hI _ => have := scan_mass_bounds hI; linarith + | pair1 hI _ => have := scan_mass_bounds hI; linarith + | short00 hI _ => have := scan_mass_bounds hI; linarith + | @short01 n u k v l hI ih => + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => dsimp [hasQKSubword] at he; have := ih he; linarith + | K => exact False.elim (not_scan_odd_cons_K n u' k v l hI) + | Q => dsimp [hasQKSubword] at he; have := ih he; linarith + | short10 hI _ => have := scan_mass_bounds hI; linarith + | @short11 n u k v l hI ih => + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => dsimp [hasQKSubword] at he; have := ih he; linarith + | K => exact False.elim (not_scan_odd_cons_K n u' k v l hI) + | Q => dsimp [hasQKSubword] at he; have := ih he; linarith + +theorem loc_z1Q (n : Nat) : + ∀ (a b : Nat) (v : WordList) (l : Rat), + Scan a (List.replicate n V) b v l -> + v = List.replicate n V /\ b = a * 2 ^ n /\ l = 0 := by + induction n with + | zero => + intro a b v l hI + cases hI + exact ⟨rfl,by simp,rfl⟩ + | succ n ih => + intro a b v l hI + cases hI with + | @T m _ _ v0 l0 hJ => + rcases ih ((1 + m) * 2) b v0 l0 hJ with ⟨rfl,rfl,rfl⟩ + refine ⟨rfl,?_,by ring⟩ + rw [Nat.pow_succ]; ring + +theorem loc_z1W {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (hI : Scan a (Q :: K :: u) b v l) : + ∃ n w s,a = 1 + n /\ Scan (n * 2) u b w s /\ v = V :: w /\ l = (1 + s) * (1 / 2) := by + cases hI with + | @pair0 n _ _ w s hJ => + exact ⟨n,w,s,rfl,hJ,rfl,rfl⟩ + | @short01 n _ _ _ _ hJ => + exact False.elim (not_scan_odd_cons_K n u b _ _ hJ) + | @short11 n _ _ _ _ hJ => + exact False.elim (not_scan_odd_cons_K n u b _ _ hJ) + +theorem loc_z1X {a : Nat} {ds : WordList} {b : Nat} {v : WordList} {l : Rat} + (hI : Scan a (ds ++ [K]) b v l) + (hw : ∃ w,ds = Q :: K :: w) + (hD : ∃ A H,DigitVal A H ds) + (hZ : 2 <= wordMassK ds) : + wordMass v <= wordMassK ds * (1 / 4) /\ wordMass v + l <= wordMassK ds * (3 / 4) := by + rcases hw with ⟨w,rfl⟩ + rcases hD with ⟨A,H,hD⟩ + cases hD with + | one hJ => + cases hJ with + | zero hK => + rcases loc_z1W hI with ⟨n,x,s,_,hJ',rfl,rfl⟩ + have hB := scan_tailDefect_bound hJ' (tailDefect_append_K_of_digitVal hK) + rcases hB with ⟨hM,hL,_⟩ + have hZw := (wordMass_nonneg w).2.1 + dsimp [wordMassK,wordMass] at hZ ⊢ + constructor <;> linarith + +theorem loc_z1Y {m : Nat} {u : WordList} {A H : Nat} {ds : WordList} + (hD : DigitVal A H ds) + (hS : wordScale u * ((2 ^ H : Nat) : Rat) = 1) + (hM : 1 <= m) + (hF : wordMass u + wordMassK u < 1 / 2) + (hW : ∃ w,ds = Q :: K :: w) : + ∃ b x l c y s, + Scan (m * 2) u b x l /\ Scan b (ds ++ [K]) c y s /\ 0 < c := by + rcases hW with ⟨w,rfl⟩ + have hm_q : (1 : Rat) <= (m : Rat) := by exact_mod_cast hM + have hEx1 : (wordMass u + wordMassK u) * 2 < ((m * 2 : Nat) : Rat) := by + push_cast; linarith + rcases exists_scan_of_mass_lt u m hEx1 with ⟨b,x,l,hI,hB_pos⟩ + have hBounds := scan_mass_bounds hI + have hSplit_x := wordMass_eq_add x + have hPos_x := wordMass_nonneg x + have hDelt : wordMassQ x + l < 1 / 2 := by linarith + have hBudget_eq := loc_z1F hI + have hBudget : 1 < (b : Rat) * wordScale x := by + push_cast at hBudget_eq; linarith + have hRest : (wordMass (w ++ [K]) + wordMassK (w ++ [K]) + 2) * wordScale x <= 1 := by + rw [<- (digitVal_scale_and_mass hD).1] at hS + cases hD with + | one hJ => + cases hJ with + | zero hK => + have hDw := digitVal_scale_and_mass hK + have hSc := loc_z1J hI + have hPos_w := wordMass_nonneg w + have hSplit_w := wordMass_eq_add w + have hSc_x := wordScale_pos x + have hSc_u := wordScale_pos u + have hSc_w := wordScale_pos w + dsimp [wordScale] at hS + rw [wordMass_append,wordMassK_append] + dsimp [wordMass,wordMassK] + nlinarith + cases b with + | zero => omega + | succ b => + have hSc_x := wordScale_pos x + have hEx2 : (wordMass (w ++ [K]) + wordMassK (w ++ [K])) * 2 < ((b * 2 : Nat) : Rat) := by + push_cast at hBudget ⊢ + nlinarith + rcases exists_scan_of_mass_lt (w ++ [K]) b hEx2 with ⟨c,y,s,hJ,hC_pos⟩ + refine ⟨1 + b,x,l,c,V :: y,(1 + s) * (1 / 2),?_,?_,hC_pos⟩ + · have heq : 1 + b = b + 1 := by omega + rwa [heq] + · exact Scan.pair0 hJ + +theorem loc_z20 (r a : Nat) (u : WordList) (b : Nat) (v : WordList) (l : Rat) + (hI : Scan a (u ++ List.replicate (1 + r * 2) Q ++ [K]) b v l) : + ∃ w k,v = w ++ List.replicate (1 + r) V /\ b = k * 2 ^ (1 + r) := by + rcases split_trailing_Q u with ⟨p,n,rfl,hP⟩ + have hE : (p ++ List.replicate n Q) ++ List.replicate (1 + r * 2) Q ++ [K] = + p ++ (List.replicate (1 + r * 2 + n) Q ++ [K]) := by + have heq : 1 + r * 2 + n = n + (1 + r * 2) := by omega + rw [heq,List.replicate_add n (1 + r * 2)] + simp only [List.append_assoc] + rw [hE] at hI + rcases scan_split_of_splitCond hI p (List.replicate (1 + r * 2 + n) Q ++ [K]) rfl (Or.inl hP) with ⟨c,x,y,s,t0,_,hK,rfl,_⟩ + rcases scan_add_Q_K_inv n r c b y t0 hK with ⟨w,k,rfl,rfl⟩ + exact ⟨x ++ w,k,by rw [List.append_assoc],rfl⟩ + +theorem loc_z21 {ds : WordList} (h : loc_z1p ds) : ∃ w,ds = Q :: K :: w := by + rcases h with ⟨w,rfl⟩ + exact ⟨w,rfl⟩ + +theorem loc_z22 {ds : WordList} (h : loc_z1p ds) : 2 <= wordMassK ds := by + rcases h with ⟨w,rfl⟩ + have hw := (wordMass_nonneg w).2.1 + dsimp [List.replicate,wordMassK] + linarith + +theorem loc_z23 {m : Nat} {u : WordList} {A H : Nat} {ds : WordList} + (hD : DigitVal A H ds) + (hS : wordScale u * ((2 ^ H : Nat) : Rat) = 1) + (hM : 1 <= m) + (hF : (5 / 2) * wordMass u + wordMassK u + wordScale u * wordMassK ds <= 1 / 32) + (hLo : loc_z1p ds) + (hHi : loc_z1q ds) : + ∃ k v l g, + Scan (m * 2) (u ++ ds ++ [K]) (k * 8) v l /\ + (∃ w,v = w ++ List.replicate 3 V) /\ + wordScale v * ((8 ^ g : Nat) : Rat) = 2 /\ + wordMass v <= wordMass u + (1 / 4) * (wordScale u * wordMassK ds) /\ + wordMass v + l <= wordMass u + wordMassK u + (3 / 4) * (wordScale u * wordMassK ds) /\ + 0 < wordMassQ v + l /\ wordMassQ v + l <= 1 / 32 := by + rcases hHi with ⟨w,hHi_eq⟩ + have hU := wordMass_nonneg u + have hDs := wordMass_nonneg ds + have hSu := wordScale_pos u + have hSmall : wordMass u + wordMassK u < 1 / 2 := by nlinarith + rcases loc_z1Y hD hS hM hSmall (loc_z21 hLo) with ⟨b,x,s,c,y,t0,hI1,hI2,_⟩ + rcases scan_append hI1 hI2 with ⟨l,hI,rfl⟩ + have hI_assoc : Scan (m * 2) (u ++ ds ++ [K]) c (x ++ y) (s + wordScale x * t0) := by + simpa [List.append_assoc] using hI + have hEnd : ∃ p k,x ++ y = p ++ List.replicate 3 V /\ c = k * 8 := by + have hI_hi : Scan (m * 2) ((u ++ w) ++ List.replicate (1 + 2 * 2) Q ++ [K]) c (x ++ y) (s + wordScale x * t0) := by + have heq_list : u ++ ds ++ [K] = (u ++ w) ++ List.replicate (1 + 2 * 2) Q ++ [K] := by + rw [hHi_eq]; simp [List.append_assoc] + rwa [<- heq_list] + rcases loc_z20 2 (m * 2) (u ++ w) c (x ++ y) (s + wordScale x * t0) hI_hi with ⟨p,k,hE,hC⟩ + exact ⟨p,k,hE,hC⟩ + rcases hEnd with ⟨p,k,hE,rfl⟩ + rcases scan_scale_pow_eight hI_assoc with ⟨g,hG⟩ + refine ⟨k,x ++ y,s + wordScale x * t0,g,hI_assoc,⟨p,hE⟩,?_,?_,?_,?_⟩ + · rw [wordScale_append,wordScale_append] at hG + dsimp [wordScale] at hG + rw [(digitVal_scale_and_mass hD).1] at hG + nlinarith + · have hB1 := scan_mass_bounds hI1 + have hS1 := loc_z1J hI1 + have hB2 := loc_z1X hI2 (loc_z21 hLo) ⟨A,H,hD⟩ (loc_z22 hLo) + have hSx := wordScale_pos x + rw [wordMass_append]; nlinarith + · have hB1 := scan_mass_bounds hI1 + have hS1 := loc_z1J hI1 + have hB2 := loc_z1X hI2 (loc_z21 hLo) ⟨A,H,hD⟩ (loc_z22 hLo) + have hSx := wordScale_pos x + rw [wordMass_append]; nlinarith + · have hW : hasQKSubword (u ++ ds ++ [K]) = true := by + rw [List.append_assoc] + apply hasQKSubword_append_right + rcases loc_z21 hLo with ⟨z,rfl⟩ + rfl + have hLoss := loc_z1O hI_assoc hW + have hB1 := scan_mass_bounds hI1 + have hS1 := loc_z1J hI1 + have hB2 := loc_z1X hI2 (loc_z21 hLo) ⟨A,H,hD⟩ (loc_z22 hLo) + have hSx := wordScale_pos x + have hMv : wordMass (x ++ y) + (s + wordScale x * t0) <= wordMass u + wordMassK u + (3 / 4) * (wordScale u * wordMassK ds) := by + rw [wordMass_append]; nlinarith + have hSuz : 0 <= wordScale u * wordMassK ds := by nlinarith + have hPos_xy := wordMass_nonneg (x ++ y) + have hSplit_xy := wordMass_eq_add (x ++ y) + constructor <;> linarith + +theorem loc_z24 {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} {H : Nat} {r : HalfTape} + (hI : Scan a u (b * 2) v l) (hB : Binary (1 + b) H r) : + RIncs a (evalWords u default) (evalWords v r) := by + apply loc_z1D hI + have hR := loc_z1b hB + have heq : ((1 + b) - 1) * 2 = b * 2 := by omega + rwa [heq] at hR + +theorem loc_z25 (m g k : Nat) (s delta : Rat) + (hM : m = 1 \/ m = 2) + (hS : s * ((8 ^ g : Nat) : Rat) = 2) + (hB : ((m * 2 : Nat) : Rat) = ((k * 8 : Nat) : Rat) * s + delta * 2) + (hPos : 0 < delta) + (hSmall : delta <= 1 / 32) : + ∃ n,g = 3 + n /\ 31 * 2 ^ (m + 3 * n) <= k /\ k < 32 * 2 ^ (m + 3 * n) := by + have hMq : (1 : Rat) <= (m : Rat) /\ (m : Rat) <= 2 := by + rcases hM with rfl | rfl <;> norm_num + have hPow : (0 : Rat) < ((8 ^ g : Nat) : Rat) := by exact_mod_cast loc_z17 g + have hEq : ((k * 8 : Nat) : Rat) = ((m : Rat) - delta) * ((8 ^ g : Nat) : Rat) := by + push_cast at hB ⊢ + have hE : (k : Rat) * 8 * s = ((m : Rat) - delta) * 2 := by linarith + have hE' : (k : Rat) * 8 * (s * ((8 ^ g : Nat) : Rat)) = ((m : Rat) - delta) * 2 * ((8 ^ g : Nat) : Rat) := by + calc (k : Rat) * 8 * (s * ((8 ^ g : Nat) : Rat)) + _ = ((k : Rat) * 8 * s) * ((8 ^ g : Nat) : Rat) := by ring + _ = ((m : Rat) - delta) * 2 * ((8 ^ g : Nat) : Rat) := by rw [hE] + rw [hS] at hE' + push_cast at hE' + linarith + have hK : 0 < k := by + by_contra hk0 + have hk_eq : k = 0 := by omega + subst hk_eq + push_cast at hPow hEq + nlinarith + have hR_q : ((k * 8 : Nat) : Rat) < ((m * 8 ^ g : Nat) : Rat) := by + push_cast at hPow hEq ⊢ + nlinarith + have hR : k * 8 < m * 8 ^ g := by exact_mod_cast hR_q + have hg1 : 1 <= g := by + by_contra hg_lt + have hg_eq : g = 0 := by omega + subst hg_eq + rcases hM with rfl | rfl <;> omega + let n1 := g - 1 + have hg_eq : g = 1 + n1 := by omega + rw [hg_eq] at hR hEq + have hpow_1n : 8 ^ (1 + n1) = 8 * 8 ^ n1 := by + rw [Nat.pow_add] + rw [hpow_1n] at hR hEq + have hRn : k + 1 <= m * 8 ^ n1 := by + rcases hM with rfl | rfl <;> omega + have hRn_q : ((k + 1 : Nat) : Rat) <= ((m * 8 ^ n1 : Nat) : Rat) := by exact_mod_cast hRn + have hPow_n1 : (0 : Rat) <= ((8 ^ n1 : Nat) : Rat) := by positivity + have hP : (32 : Rat) <= ((8 ^ n1 : Nat) : Rat) := by + rcases hM with rfl | rfl <;> (push_cast at hEq hRn_q ⊢; nlinarith) + have hP_nat : 32 <= 8 ^ n1 := by exact_mod_cast hP + have hN : 2 <= n1 := by + by_contra hn2 + have hn1 : n1 <= 1 := by omega + have hle1 : 8 ^ n1 <= 8 ^ 1 := Nat.pow_le_pow_right (by decide) hn1 + (try omega) + let j := n1 - 2 + have hNJ : n1 = 2 + j := by omega + refine ⟨j,by omega,?_,?_⟩ + · rw [hNJ,Nat.pow_add 8 2 j] at hEq + have hPow_j : (0 : Rat) < ((8 ^ j : Nat) : Rat) := by exact_mod_cast loc_z17 j + have h_le_q : ((31 * 2 ^ (m + 3 * j) : Nat) : Rat) <= (k : Rat) := by + rw [Nat.pow_add 2 m (3 * j),loc_z1u] + rcases hM with rfl | rfl <;> (push_cast at hPow_j hEq ⊢; nlinarith) + exact_mod_cast h_le_q + · rw [hNJ,Nat.pow_add 8 2 j] at hEq + have hPow_j : (0 : Rat) < ((8 ^ j : Nat) : Rat) := by exact_mod_cast loc_z17 j + have h_lt_q : (k : Rat) < ((32 * 2 ^ (m + 3 * j) : Nat) : Rat) := by + rw [Nat.pow_add 2 m (3 * j),loc_z1u] + rcases hM with rfl | rfl <;> (push_cast at hPow_j hEq ⊢; nlinarith) + exact_mod_cast h_lt_q + +theorem loc_z26 {m : Nat} {a : WordList} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + {H : Nat} {ds : WordList} {z : Rat} + (hI : Scan (m * 2) a (b * 2) v l) + (hD : DigitVal (1 + b) H ds) + (hS : wordScale v * wordScale ds = (m : Rat)) + (hM : wordMass v <= wordMass u + (1 / 4) * z) + (hB : wordMass v + l <= wordMass u + wordMassK u + (3 / 4) * z) + (hZ : 0 <= z) : + (5 / 2) * wordMass v + wordMassK (v ++ ds) <= + (7 / 5) * ((5 / 2) * wordMass u + wordMassK u + z) := by + have hE := loc_z1F hI + have hDt := digitVal_wordMassK_eq hD + have hDs := (digitVal_scale_and_mass hD).1 + have hSplit_v := wordMass_eq_add v + have hPos_u := wordMass_nonneg u + have hSv := wordScale_pos v + push_cast at hE hDt hDs + rw [wordMassK_append] + nlinarith + +theorem loc_z27 (m n : Nat) (s : Rat) + (hM : m = 1 \/ m = 2) + (hS : s * ((8 ^ (3 + n) : Nat) : Rat) = 2) : + s * ((2 ^ (7 + (m + 3 * n)) : Nat) : Rat) = (m : Rat) := by + have h8 : 8 ^ (3 + n) = 512 * 8 ^ n := by + rw [Nat.pow_add 8 3 n] + rw [h8] at hS + have h2 : 2 ^ (7 + (m + 3 * n)) = 128 * 2 ^ m * 8 ^ n := by + rw [Nat.pow_add 2 7 _,Nat.pow_add 2 m (3 * n),loc_z1u]; ring + rw [h2] + rcases hM with rfl | rfl <;> (push_cast at hS ⊢; linarith) + +inductive C24Good (bound : Rat) : HalfTape -> Prop where + | intro (u : WordList) (A H : Nat) (ds : WordList) : + DigitVal A H ds -> + wordScale u * ((2 ^ H : Nat) : Rat) = 1 -> + (5 / 2) * wordMass u + wordMassK u + wordScale u * wordMassK ds <= bound -> + loc_z1p ds -> + loc_z1q ds -> + C24Good bound (evalWords (u ++ ds) default) + +theorem loc_z28 (m : Nat) (bound bound' : Rat) (r : HalfTape) + (hM : m = 1 \/ m = 2) + (hLimit : bound <= 1 / 32) + (hG : C24Good bound r) + (hRate : (7 / 5) * bound <= (m : Rat) * bound') : + ∃ r',RIncs (m * 2) r r' /\ C24Good bound' (evalWords (List.replicate (m - 1) V) r') := by + rcases hG with ⟨u,A,H,ds,hD,hS,hF,hLo,hHi⟩ + have hPos_m : 1 <= m := by rcases hM with rfl | rfl <;> omega + have hSmall : (5 / 2) * wordMass u + wordMassK u + wordScale u * wordMassK ds <= 1 / 32 := by linarith + rcases loc_z23 hD hS hPos_m hSmall hLo hHi with ⟨k,v,l,g,hI,hEnd,hScale,hMv,hBv,hPos,hUpper⟩ + have hBudget := loc_z1F hI + rcases loc_z25 m g k (wordScale v) (wordMassQ v + l) hM hScale hBudget hPos hUpper with ⟨n,rfl,hKl,hKu⟩ + rcases loc_z1t (m + 3 * n) k hKl hKu with ⟨ds',hD',hLo',hHi',hBin⟩ + have hScale' : wordScale v * wordScale ds' = (m : Rat) := by + rw [(digitVal_scale_and_mass hD').1] + exact loc_z27 m n (wordScale v) hM hScale + have hI' : Scan (m * 2) (u ++ ds ++ [K]) ((k * 4) * 2) v l := by + have heq : k * 8 = (k * 4) * 2 := by omega + rwa [<- heq] + have hR := loc_z24 hI' hBin + have hd0_side : evalWords [K] default = default := zDd + have hR' : RIncs (m * 2) (evalWords (u ++ ds) default) (evalWords (v ++ ds') default) := by + rw [evalWords_append (u ++ ds) [K],hd0_side,<- evalWords_append v ds'] at hR + exact hR + have hZ : 0 <= wordScale u * wordMassK ds := by + have hSu := wordScale_pos u + have hPos_ds := (wordMass_nonneg ds).2.1 + nlinarith + have hWeight := loc_z26 hI' hD' hScale' hMv hBv hZ + refine ⟨evalWords (v ++ ds') default,hR',?_⟩ + rw [<- evalWords_append,<- List.append_assoc] + refine C24Good.intro (List.replicate (m - 1) V ++ v) (1 + k * 4) (7 + (m + 3 * n)) ds' hD' ?_ ?_ hLo' hHi' + · rw [<- (digitVal_scale_and_mass hD').1,wordScale_append] + rcases hM with rfl | rfl <;> (dsimp [List.replicate,wordScale]; push_cast at hScale'; nlinarith) + · rw [wordMass_append,wordMassK_append,wordScale_append] + rw [wordMassK_append] at hWeight + rcases hM with rfl | rfl <;> (dsimp [List.replicate,wordMass,wordMassK,wordScale]; push_cast at hRate; nlinarith) + +theorem loc_z29 {r : HalfTape} (hG : C24Good (1 / 64) r) : + ∃ s r',RIncs 2 r s /\ RIncs 4 s r' /\ C24Good (1 / 64) (t +> r') := by + rcases loc_z28 1 (1 / 64) ((7 / 5) * (1 / 64)) r (Or.inl rfl) (by norm_num) hG (by norm_num) with ⟨s,hR,hH⟩ + dsimp [List.replicate,evalWords] at hH + rcases loc_z28 2 ((7 / 5) * (1 / 64)) (1 / 64) s (Or.inr rfl) (by norm_num) hH (by norm_num) with ⟨r',hS,hI⟩ + dsimp [List.replicate,evalWords] at hI + exact ⟨s,r',hR,hS,hI⟩ + +theorem ne_of_beq_eq_false {a b : Nat} (h : (a == b) = false) : a ≠ b := by + intro heq; subst heq; rw [beq_self_eq_true] at h; contradiction + +def loc_zPf : Nat -> Nat -> Option (WordList) + | 0,_ => none + | fuel + 1,k => + if k == 0 then none + else if k == 1 then some [Q] + else match loc_zPf fuel (k / 2) with + | none => none + | some ws => some ((if k % 2 == 0 then K else Q) :: ws) + +theorem loc_z2a (fuel : Nat) : + ∀ (k : Nat) (ws : WordList),loc_zPf fuel k = some ws -> + ∃ H,Binary k H (evalWords ws default) := by + induction fuel with + | zero => intro k ws h; contradiction + | succ fuel ih => + intro k ws h + dsimp [loc_zPf] at h + cases hk0 : (k == 0) with + | true => rw [hk0] at h; contradiction + | false => + rw [hk0] at h; dsimp at h + have hk0' : k ≠ 0 := ne_of_beq_eq_false hk0 + cases hk1 : (k == 1) with + | true => + rw [hk1] at h; dsimp at h + injection h with h; subst h + have rfl_k : k = 1 := beq_iff_eq.mp hk1 + subst rfl_k + exact ⟨1,Binary.one⟩ + | false => + rw [hk1] at h; dsimp at h + have hk1' : k ≠ 1 := ne_of_beq_eq_false hk1 + cases hrec : loc_zPf fuel (k / 2) with + | none => rw [hrec] at h; contradiction + | some ws' => + rw [hrec] at h; dsimp at h + injection h with h; subst h + rcases ih (k / 2) ws' hrec with ⟨H,hB⟩ + have hq : k / 2 = 1 + (k / 2 - 1) := by omega + rw [hq] at hB + rcases Nat.mod_two_eq_zero_or_one k with hmod | hmod + · have hcond : (k % 2 == 0) = true := beq_iff_eq.mpr hmod + rw [hcond]; dsimp [evalWords] + refine ⟨1 + H,?_⟩ + have heq : k = 2 + (k / 2 - 1) * 2 := by omega + rw [heq]; exact Binary.zero hB + · have hcond : (k % 2 == 0) = false := beq_false_of_ne (by omega) + rw [hcond]; dsimp [evalWords] + refine ⟨1 + H,?_⟩ + have heq : k = 3 + (k / 2 - 1) * 2 := by omega + rw [heq]; exact Binary.two hB + +def loc_z2h (e : Bool) : Word := if e then Q else K + +def loc_z2i (e : Bool) (k : Nat) : Option (Word × Nat) := + if k == 0 then none + else if k % 2 == 0 then + if k % 4 == 2 then + some (K,bitStepNat e (k / 4)) + else + some (Q,bitStepNat e (k / 4 - 1)) + else none + +theorem loc_z2j (e : Bool) (k : Nat) (d : Word) (k' : Nat) (r r' : HalfTape) + (hS : loc_z2i e k = some (d,k')) (hI : RIncs k' r r') : + RIncs k (evalWords [loc_z2h e] r) (evalWords [d] r') := by + dsimp [loc_z2i] at hS + cases hk0 : (k == 0) with + | true => rw [hk0] at hS; contradiction + | false => + rw [hk0] at hS; dsimp at hS + have hk0' : k ≠ 0 := ne_of_beq_eq_false hk0 + cases hk2 : (k % 2 == 0) with + | false => rw [hk2] at hS; contradiction + | true => + rw [hk2] at hS; dsimp at hS + have hk2' : k % 2 = 0 := beq_iff_eq.mp hk2 + cases hk4 : (k % 4 == 2) with + | true => + rw [hk4] at hS; dsimp at hS + injection hS with hS1; injection hS1 with hS1 hS2; subst hS1; subst hS2 + have hk4' : k % 4 = 2 := beq_iff_eq.mp hk4 + have hk_eq : k = 2 + (k / 4) * 4 := by omega + rw [hk_eq] + cases e + · exact RIncs.short00 hI + · exact RIncs.short01 hI + | false => + rw [hk4] at hS; dsimp at hS + injection hS with hS1; injection hS1 with hS1 hS2; subst hS1; subst hS2 + have hk4' : k % 4 ≠ 2 := ne_of_beq_eq_false hk4 + have hk_eq : k = 4 + (k / 4 - 1) * 4 := by omega + rw [hk_eq] + cases e + · exact RIncs.short10 hI + · exact RIncs.short11 hI + +def loc_z2l : Nat -> WordList -> Nat -> WordList -> Option (WordList) + | 0,_,_,_ => none + | fuel + 1,u,k,acc => + if k == 0 then + if u.all isWordK then some (acc.reverseAux [Q]) else none + else + match u with + | [] => + if k % 2 == 0 then + match loc_zPf 64 (1 + k / 2) with + | some ws => some (acc.reverseAux ws) + | none => none + else none + | V :: u' => loc_z2l fuel u' (k * 2) (V :: acc) + | K :: u' => + match loc_z2i false k with + | some (d,k') => loc_z2l fuel u' k' (d :: acc) + | none => none + | Q :: u' => + if (k % 2 == 0) && startsWithKOrNil (Q :: u') then + match loc_z2i true k with + | some (d,k') => loc_z2l fuel u' k' (d :: acc) + | none => none + else + match u' with + | K :: v => loc_z2l fuel v ((k - 1) * 2) (V :: acc) + | Q :: v => loc_z2l fuel v (1 + (k - 1) * 2) (V :: acc) + | _ => none + +theorem loc_z2m (fuel : Nat) : + ∀ (u : WordList) (k : Nat) (acc v : WordList),loc_z2l fuel u k acc = some v -> + ∃ w,v = acc.reverseAux w /\ RIncs k (evalWords u default) (evalWords w default) := by + induction fuel with + | zero => intro u k acc v hE; contradiction + | succ fuel ih => + intro u k acc v hE + dsimp [loc_z2l] at hE + cases hk0 : (k == 0) with + | true => + rw [hk0] at hE; dsimp at hE + have rfl_k : k = 0 := beq_iff_eq.mp hk0; subst rfl_k + cases hu : u.all isWordK with + | false => rw [hu] at hE; contradiction + | true => + rw [hu] at hE; dsimp at hE + injection hE with hE; subst hE + refine ⟨[Q],rfl,?_⟩ + rw [evalWords_default_of_all_K u hu] + have h0 := RIncs.zero (default : HalfTape) + simpa [evalWords,d1,one] using h0 + | false => + rw [hk0] at hE; dsimp at hE + have hk0' : k ≠ 0 := ne_of_beq_eq_false hk0 + cases u with + | nil => + cases hk2 : (k % 2 == 0) with + | false => rw [hk2] at hE; contradiction + | true => + rw [hk2] at hE; dsimp at hE + have hk2' : k % 2 = 0 := beq_iff_eq.mp hk2 + cases hp : loc_zPf 64 (1 + k / 2) with + | none => rw [hp] at hE; contradiction + | some ws => + rw [hp] at hE; dsimp at hE + injection hE with hE; subst hE + rcases loc_z2a 64 (1 + k / 2) ws hp with ⟨H,hB⟩ + have hR := loc_z1b hB + have heq : ((1 + k / 2) - 1) * 2 = k := by omega + rw [heq] at hR + exact ⟨ws,rfl,hR⟩ + | cons x u' => + cases x + · dsimp at hE + rcases ih u' (k * 2) (V :: acc) v hE with ⟨w,rfl,hR⟩ + refine ⟨V :: w,rfl,?_⟩ + have hk_eq : k = 1 + (k - 1) := by omega + have hk2_eq : k * 2 = (1 + (k - 1)) * 2 := by omega + rw [hk2_eq] at hR + rw [hk_eq] + exact RIncs.T hR + · dsimp at hE + cases hS : loc_z2i false k with + | none => rw [hS] at hE; contradiction + | some dk => + rcases dk with ⟨d,k'⟩ + rw [hS] at hE; dsimp at hE + rcases ih u' k' (d :: acc) v hE with ⟨w,rfl,hR⟩ + have h_sn := loc_z2j false k d k' (evalWords u' default) (evalWords w default) hS hR + rw [<- evalWords_append [d] w default] at h_sn + exact ⟨d :: w,rfl,h_sn⟩ + · dsimp at hE + cases hcond : ((k % 2 == 0) && startsWithKOrNil (Q :: u')) with + | true => + rw [hcond] at hE; dsimp at hE + cases hS : loc_z2i true k with + | none => rw [hS] at hE; contradiction + | some dk => + rcases dk with ⟨d,k'⟩ + rw [hS] at hE; dsimp at hE + rcases ih u' k' (d :: acc) v hE with ⟨w,rfl,hR⟩ + have h_sn := loc_z2j true k d k' (evalWords u' default) (evalWords w default) hS hR + rw [<- evalWords_append [d] w default] at h_sn + exact ⟨d :: w,rfl,h_sn⟩ + | false => + rw [hcond] at hE; dsimp at hE + cases u' with + | nil => contradiction + | cons x2 u'' => + cases x2 + · contradiction + · dsimp at hE + rcases ih u'' ((k - 1) * 2) (V :: acc) v hE with ⟨w,rfl,hR⟩ + refine ⟨V :: w,rfl,?_⟩ + have hk_eq : k = 1 + (k - 1) := by omega + rw [hk_eq] + exact RIncs.pair0 hR + · dsimp at hE + rcases ih u'' (1 + (k - 1) * 2) (V :: acc) v hE with ⟨w,rfl,hR⟩ + refine ⟨V :: w,rfl,?_⟩ + have hk_eq : k = 1 + (k - 1) := by omega + rw [hk_eq] + exact RIncs.pair1 hR + +def loc_z2n (k : Nat) (u : WordList) : Option (WordList) := + loc_z2l 64 (u ++ [K]) k [] + +theorem loc_z2o (k : Nat) (u v : WordList) (hE : loc_z2n k u = some v) : + RIncs k (evalWords u default) (evalWords v default) := by + rcases loc_z2m 64 (u ++ [K]) k [] v hE with ⟨w,rfl,hR⟩ + have hd0_side : evalWords [K] default = default := zDd + rw [evalWords_append u [K],hd0_side] at hR + exact hR + +def loc_z2s (c0 c1 : Nat) : WordList -> Nat -> Nat + | [],n => n + | V :: u,n => loc_z2s c0 c1 u (halfCeil n) + | K :: u,n => loc_z2s c0 c1 u (n * 2 + c0) + | Q :: u,n => loc_z2s c0 c1 u (n * 2 + c1) + +theorem loc_z2u (c0 c1 : Nat) (u : WordList) : + ∀ (n : Nat), + (c0 : Rat) * wordMassK u.reverse + (c1 : Rat) * wordMassQ u.reverse + wordScale u.reverse * (n : Rat) <= + ((loc_z2s c0 c1 u n : Nat) : Rat) := by + induction u with + | nil => + intro n + simp [wordMassK,wordMassQ,wordScale,loc_z2s] + | cons w u ih => + intro n + have hsp := wordScale_pos u.reverse + cases w + · dsimp [loc_z2s] + rw [List.reverse_cons,wordMassK_append,wordMassQ_append,wordScale_append] + dsimp [wordMassK,wordMassQ,wordScale] + have hhu := rat_le_two_mul_halfCeil n + have hih := ih (halfCeil n) + nlinarith + · dsimp [loc_z2s] + rw [List.reverse_cons,wordMassK_append,wordMassQ_append,wordScale_append] + dsimp [wordMassK,wordMassQ,wordScale] + have hih := ih (n * 2 + c0) + push_cast at hih + nlinarith + · dsimp [loc_z2s] + rw [List.reverse_cons,wordMassK_append,wordMassQ_append,wordScale_append] + dsimp [wordMassK,wordMassQ,wordScale] + have hih := ih (n * 2 + c1) + push_cast at hih + nlinarith + +theorem loc_z2v (c0 c1 : Nat) (u : WordList) (n : Nat) : + (c0 : Rat) * wordMassK u + (c1 : Rat) * wordMassQ u + wordScale u * (n : Rat) <= + ((loc_z2s c0 c1 u.reverse n : Nat) : Rat) := by + have h := loc_z2u c0 c1 u.reverse n + simpa [List.reverse_reverse] using h + +def loc_z2B (u ds : WordList) : Bool := + decide (loc_z2s (7 * 65536) (5 * 65536) u.reverse + (loc_z2s (2 * 65536) 0 ds.reverse 0) <= 2048) + +theorem loc_z2C (u ds : WordList) (hE : loc_z2B u ds = true) : + (5 / 2) * wordMass u + wordMassK u + wordScale u * wordMassK ds <= 1 / 64 := by + unfold loc_z2B at hE + have hle : loc_z2s (7 * 65536) (5 * 65536) u.reverse (loc_z2s (2 * 65536) 0 ds.reverse 0) <= 2048 := + of_decide_eq_true hE + have hle_q : ((loc_z2s (7 * 65536) (5 * 65536) u.reverse (loc_z2s (2 * 65536) 0 ds.reverse 0) : Nat) : Rat) <= 2048 := by + exact_mod_cast hle + have hD := loc_z2v (2 * 65536) 0 ds 0 + have hU := loc_z2v (7 * 65536) (5 * 65536) u (loc_z2s (2 * 65536) 0 ds.reverse 0) + have hSu := wordScale_pos u + have hSplit := wordMass_eq_add u + push_cast at hD hU + nlinarith + +def loc_z2E : WordList := Q :: List.replicate 1 K + +def loc_z2F : WordList := List.replicate 5 Q + +def loc_z2G (u : WordList) : Bool := + match splitPrefixDigits u with + | none => false + | some (p,ds) => + match heightShift p 0 with + | none => false + | some H => + if H == ds.length then + match stripWordPrefix loc_z2E ds, + stripWordPrefix loc_z2F ds.reverse with + | some _,some _ => loc_z2B p ds + | _,_ => false + else false + +theorem loc_z2H (u : WordList) (hE : loc_z2G u = true) : + C24Good (1 / 64) (evalWords u default) := by + unfold loc_z2G at hE + cases hC : splitPrefixDigits u with + | none => rw [hC] at hE; contradiction + | some pds => + rcases pds with ⟨p,ds⟩ + rw [hC] at hE; dsimp only [] at hE + cases hU : heightShift p 0 with + | none => rw [hU] at hE; contradiction + | some H => + rw [hU] at hE; dsimp only [] at hE + cases hL : (H == ds.length) with + | false => rw [hL] at hE; contradiction + | true => + rw [hL] at hE; rw [if_pos rfl] at hE + have rfl_H : H = ds.length := beq_iff_eq.mp hL + subst rfl_H + cases hLo : stripWordPrefix loc_z2E ds with + | none => rw [hLo] at hE; contradiction + | some lo => + rw [hLo] at hE + cases hHi : stripWordPrefix loc_z2F ds.reverse with + | none => rw [hHi] at hE; contradiction + | some hi => + rw [hHi] at hE; dsimp only [] at hE + rcases splitPrefixDigits_sound u p ds hC with ⟨rfl,hD⟩ + rcases exists_digitVal_of_all_isDigitWord ds hD with ⟨A,hDA⟩ + refine C24Good.intro p A ds.length ds hDA ?_ ?_ ?_ ?_ + · have hsp := heightShift_sound p 0 ds.length hU + simpa using hsp + · exact loc_z2C p ds hE + · exact ⟨lo,stripWordPrefix_sound loc_z2E ds lo hLo⟩ + · have hHi_eq := stripWordPrefix_sound loc_z2F ds.reverse hi hHi + have hRev := congrArg List.reverse hHi_eq + rw [List.reverse_reverse,List.reverse_append] at hRev + change ds = hi.reverse ++ (List.replicate 5 Q).reverse at hRev + rw [replicate_reverse] at hRev + exact ⟨hi.reverse,hRev⟩ + +def loc_z2I (u : WordList) : Option (WordList) := + match loc_z2n 2 u with + | none => none + | some v => + match loc_z2n 4 v with + | none => none + | some w => some (V :: w) + +inductive C24Rounds : HalfTape -> HalfTape -> Prop where + | refl (r : HalfTape) : C24Rounds r r + | next {r s v w : HalfTape} : + RIncs 2 r s -> RIncs 4 s v -> C24Rounds (t +> v) w -> C24Rounds r w + +def loc_z2J : Nat -> WordList -> Bool + | 0,u => loc_z2G u + | n + 1,u => + match loc_z2I u with + | none => false + | some v => loc_z2J n v + +theorem loc_z2K (n : Nat) : + ∀ (u : WordList),loc_z2J n u = true -> + ∃ r,C24Rounds (evalWords u default) r /\ C24Good (1 / 64) r := by + induction n with + | zero => + intro u hE + exact ⟨evalWords u default,C24Rounds.refl _,loc_z2H u hE⟩ + | succ n ih => + intro u hE + dsimp [loc_z2J,loc_z2I] at hE + cases hV : loc_z2n 2 u with + | none => rw [hV] at hE; contradiction + | some v => + rw [hV] at hE; dsimp at hE + cases hW : loc_z2n 4 v with + | none => rw [hW] at hE; contradiction + | some w => + rw [hW] at hE; dsimp at hE + rcases ih (V :: w) hE with ⟨r,hR,hG⟩ + exact ⟨r,C24Rounds.next (loc_z2o 2 u v hV) (loc_z2o 4 v w hW) hR,hG⟩ + +def loc_z2L : WordList := + List.replicate 5 V ++ List.replicate 5 Q + +theorem loc_z2M : loc_z2J 1 loc_z2L = true := by + decide + +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) + +def loc_z2N (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs,Num k w hs -> Side hs (w +> r) r' + +theorem loc_z2O {r r' : HalfTape} (h : loc_z2N 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl + +theorem loc_z2P {n : Nat} {r r' : HalfTape} + (hI : loc_z2N ((1 + n) * 2) r r') : loc_z2N (1 + n) (t +> r) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil] + refine zSc (z0n m) ?_ + have hN2 : Num ((1 + n) * 2) [] ([.cj] ++ [.ch] ^ (m * 2)) := by + have hm : (1 + n) * 2 = 2 + (m * 2) * 2 := by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil] + refine zSc (z0o m) ?_ + have hN2 : Num ((1 + n) * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : (1 + n) * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + +theorem loc_z2Q {n : Nat} {r r' : HalfTape} + (hI : loc_z2N (n * 2) r r') : loc_z2N (1 + n) (d1 +> (d0 +> r)) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil,<- append_assoc d1 d0 r] + cases m with + | zero => + have hn0 : n * 2 = 0 := by omega + rw [hn0] at hI + have hr' := loc_z2O hI + subst hr' + rw [<- append_assoc t one r] + exact zSc z0e (Side.nil r) + | succ m => + have h1m : m + 1 = 1 + m := by omega + rw [h1m] + refine zSc (z0p m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : n * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil,<- append_assoc d1 d0 r] + refine zSc (z0q m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (m * 2)) := by + have hm : n * 2 = 2 + (m * 2) * 2 := by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 + +theorem loc_z2R {n : Nat} {r r' : HalfTape} + (hI : loc_z2N (1 + n * 2) r r') : loc_z2N (1 + n) (d1 +> (d1 +> r)) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil,<- append_assoc d1 d1 r] + refine zSc (z0r m) ?_ + have hN1 : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ (m * 2)) := by + have hm : 1 + n * 2 = 1 + (m * 2) * 2 := by omega + rw [hm]; exact Num.odd (m * 2) + simpa using hI [] _ hN1 + | @even m => + simp only [append_nil,<- append_assoc d1 d1 r] + refine zSc (z0s m) ?_ + have hN1 : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ (1 + m * 2)) := by + have hm : 1 + n * 2 = 1 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.odd (1 + m * 2) + simpa using hI [] _ hN1 + +theorem loc_z2S {n : Nat} {r r' : HalfTape} + (hI : loc_z2N (n * 2) r r') : loc_z2N (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2O hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0i (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine zSc (z0t n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using hI [] _ hN2 + +theorem loc_z2T {n : Nat} {r r' : HalfTape} + (hI : loc_z2N (1 + n * 2) r r') : loc_z2N (2 + n * 4) (d1 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + refine zSc (z0u n) ?_ + simpa using hI [] _ (Num.odd n) + +theorem loc_z2U {n : Nat} {r r' : HalfTape} + (hI : loc_z2N (n * 2) r r') : loc_z2N (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2O hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0v (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine zSc (z0w n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using hI [] _ hN2 + +theorem loc_z2V {n : Nat} {r r' : HalfTape} + (hI : loc_z2N (1 + n * 2) r r') : loc_z2N (4 + n * 4) (d1 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + refine zSc (z0x n) ?_ + simpa using hI [] _ (Num.odd n) + +theorem loc_z2W {k : Nat} {r r' : HalfTape} (hI : RIncs k r r') : + loc_z2N k r r' := by + induction hI with + | zero r => + intro w hs hN + generalize hk : 0 = k0 at hN + cases hN with + | zero => exact Side.nil (one +> r) + | odd _ => omega + | even _ => omega + | T _ ih => exact loc_z2P ih + | pair0 _ ih => exact loc_z2Q ih + | pair1 _ ih => exact loc_z2R ih + | short00 _ ih => exact loc_z2S ih + | short01 _ ih => exact loc_z2T ih + | short10 _ ih => exact loc_z2U ih + | short11 _ ih => exact loc_z2V ih + +theorem loc_z2X {r s r' : HalfTape} (hI : RIncs 2 r s) (hJ : RIncs 4 s r') : + (zCf r) [target_tm]⊢⁺ zCf (t +> r') := by + have hC1 := loc_z2W hI [] ([.cj] ++ [.ch] ^ 0) (Num.even 0) + have hS1 := zSc z0y hC1 + dsimp at hS1 + rcases hS1 with _ | ⟨hca,hnil1⟩ + cases hnil1 + have hC2 := loc_z2W hJ [] ([.cj] ++ [.ch] ^ 1) (Num.even 1) + have hS2 := zSc (z0o 0) hC2 + dsimp at hS2 + rcases hS2 with _ | ⟨hcj,hnil2⟩ + cases hnil2 + exact zPt (z0z r) + (zPt (hca ([1,1] +> default)) + (zPt (z0A (t +> s)) (hcj lh))) + +theorem loc_z2Y {r r' : HalfTape} (h : C24Rounds r r') : + (zCf r) [target_tm]⊢* zCf r' := by + induction h with + | refl _ => exact ⟨0,rfl⟩ + | next hR1 hR2 _ ih => + rcases loc_z2X hR1 hR2 with ⟨n,_,hn⟩ + rcases ih with ⟨m,hm⟩ + exact ⟨n + m,zMt target_tm _ _ _ n m hn hm⟩ + +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d) = some c') : + (multiStep target_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl + +theorem loc_z2Z : + (init []) [target_tm]⊢⁺ zCf (evalWords loc_z2L default) := by + have h := pre_z16 + have heq : evalWords loc_z2L default = + (([1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,0,1,0,1,0,1,0] : BitWord) +> default) := by + simp [loc_z2L,List.replicate,evalWords,t,d1,append_cons,append_nil] + rwa [heq] + +theorem loc_z30 (m : Nat) : + ∃ N ≥ m,∃ r,multiStep target_tm (init []) N = some (zCf r) /\ C24Good (1 / 64) r := by + induction m with + | zero => + rcases loc_z2Z with ⟨k1,_,hk1⟩ + rcases loc_z2K 1 loc_z2L loc_z2M with ⟨r0,hR0,hG0⟩ + rcases loc_z2Y hR0 with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,r0,zMt target_tm _ _ _ k1 k2 hk1 hk2,hG0⟩ + | succ m ih => + rcases ih with ⟨N,hN,r,h_ms,h_good⟩ + rcases loc_z29 h_good with ⟨s,r',hR1,hR2,h_good'⟩ + rcases loc_z2X hR1 hR2 with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,t +> r',zMt target_tm _ _ _ N k h_ms h_step_k,h_good'⟩ + +end Solution + + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases loc_z30 (n + 1) with ⟨N,hN,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := zIm h_N + rw [zMs,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RDHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0LBHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0LBHHH.lean new file mode 100644 index 00000000..102687ee --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0LBHHH.lean @@ -0,0 +1,2172 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + +open Mathlib Relation Nat Turing BusyBeaver SixState WordCalculus Word ChoiceE + +namespace BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0LBHHH + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0LBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +namespace Solution + +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +-- A..F inherited directly from SixState +abbrev HalfTape := ListBlank (Fin 2) +abbrev BitWord := List (Fin 2) +abbrev WordList := List Word + +@[simp] theorem multiStep_zero (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : + multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : + multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] +@[simp] theorem cons_zero_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : HalfTape).head = 0 := rfl +@[simp] theorem default_tail : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append, append_cons, ih] +theorem step_to_multiStep_one {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem step_to_stepPlus {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1, by decide, step_to_multiStep_one tm c_1 c_2 h⟩ +theorem multiStep_add {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] +theorem multiStep_trans {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [multiStep_add, h₁]; simp [h₂] +theorem stepPlus_to_stepStar {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ +theorem stepPlus_trans {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, by omega, multiStep_trans tm c_1 c_2 c_3 n m hn hm⟩ +theorem stepPlus_stepStar_trans {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), + multiStep_trans tm c_1 c_2 c_3 n m hn hm⟩ +theorem step_stepStar_trans {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + stepPlus_stepStar_trans (step_to_stepPlus tm c_1 c_2 h₁) h₂ +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine stepPlus_to_stepStar ?_) <;> + refine step_stepStar_trans (by (try simp only [BusyBeaver.Cfg.headRight, + BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, cons_zero_default, + default_head, default_tail]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) + +abbrev t : BitWord := [1, 1, 0, 0] +abbrev d0 : BitWord := [0, 0] +abbrev d1 : BitWord := [1, 0] +abbrev one : BitWord := [1] +abbrev lh : HalfTape := (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default +@[simp] theorem append_d0_default : d0 +> (default : HalfTape) = default := by + simp [d0] + +inductive Call where + | ch + | cj + | cp + | ca + +def callWord : Call -> BitWord + | .ch => [1] + | .cj => [1, 1] + | .cp => [1, 0] + | .ca => [1, 1, 1, 0, 1, 1] + +def CallStep (tm : Machine (Fin 2) (Fin 6)) + (cR : HalfTape -> Call -> HalfTape -> Cfg (Fin 2) (Fin 6)) + (cL : HalfTape -> HalfTape -> Cfg (Fin 2) (Fin 6)) + (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l, (cR l c r1) [tm]⊢⁺ (cL l r2) + +inductive Side (stepRel : Call -> HalfTape -> HalfTape -> Prop) : + List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side stepRel [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + stepRel c r1 r2 -> Side stepRel ls r2 r3 -> Side stepRel (c :: ls) r1 r3 + +def Seg (stepRel : Call -> HalfTape -> HalfTape -> Prop) + (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2, Side stepRel ls_out r1 r2 -> Side stepRel ls_in (w1 +> r1) (w2 +> r2) + +@[simp] theorem list_pow_zero {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem list_pow_succ {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem list_pow_one_add {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem list_pow_one {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem list_pow_add {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm, list_pow_succ, list_pow_succ, ih, List.append_assoc] + +theorem side_append {stepRel : Call -> HalfTape -> HalfTape -> Prop} + {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side stepRel ls1 r1 r2) (h2 : Side stepRel ls2 r2 r3) : + Side stepRel (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) + +theorem side_append_inv {stepRel : Call -> HalfTape -> HalfTape -> Prop} + {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side stepRel (ls1 ++ ls2) r1 r3) : + ∃ r2, Side stepRel ls1 r1 r2 /\ Side stepRel ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1, Side.nil r1, h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc, hrest⟩ + rcases ih hrest with ⟨r2, h1, h2⟩ + exact ⟨r2, Side.cons hc h1, h2⟩ + +theorem seg_nil {stepRel : Call -> HalfTape -> HalfTape -> Prop} (w : BitWord) : + Seg stepRel [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) + +theorem seg_apply {stepRel : Call -> HalfTape -> HalfTape -> Prop} + {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg stepRel ls1 ls2 w1 w2) (h2 : Side stepRel ls2 r1 r2) : + Side stepRel ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 + +theorem seg_append {stepRel : Call -> HalfTape -> HalfTape -> Prop} + {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg stepRel ls1 ls2 w1 w2) (h2 : Seg stepRel ls3 ls4 w2 w3) : + Seg stepRel (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases side_append_inv h with ⟨r2, ha, hb⟩ + exact side_append (h1 r1 r2 ha) (h2 r2 r3 hb) + +theorem seg_step1 {tm : Machine (Fin 2) (Fin 6)} + {cR : HalfTape -> Call -> HalfTape -> Cfg (Fin 2) (Fin 6)} + {cL : HalfTape -> HalfTape -> Cfg (Fin 2) (Fin 6)} + {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r, (cR l c (w1 +> r)) [tm]⊢⁺ (cL l (w2 +> r))) : + Seg (CallStep tm cR cL) [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) + +theorem seg_step2 {tm : Machine (Fin 2) (Fin 6)} + {cR : HalfTape -> Call -> HalfTape -> Cfg (Fin 2) (Fin 6)} + {cL : HalfTape -> HalfTape -> Cfg (Fin 2) (Fin 6)} + {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r, (cR l c_in (w1 +> r)) [tm]⊢⁺ (cR (mid +> l) c_out r)) + (h2 : ∀ l r, (cL (mid +> l) r) [tm]⊢⁺ (cL l (w2 +> r))) : + Seg (CallStep tm cR cL) [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1, hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact stepPlus_trans (h1 l r1) (stepPlus_trans (hc1 (mid +> l)) (h2 l r2)) + +theorem seg_step3 {tm : Machine (Fin 2) (Fin 6)} + {cR : HalfTape -> Call -> HalfTape -> Cfg (Fin 2) (Fin 6)} + {cL : HalfTape -> HalfTape -> Cfg (Fin 2) (Fin 6)} + {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r, (cR l c_in (w1 +> r)) [tm]⊢⁺ (cR (mid1 +> l) c1 r)) + (h2 : ∀ l r, (cL (mid1 +> l) r) [tm]⊢⁺ (cR (mid2 +> l) c2 r)) + (h3 : ∀ l r, (cL (mid2 +> l) r) [tm]⊢⁺ (cL l (w2 +> r))) : + Seg (CallStep tm cR cL) [c_in] [c1, c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1, hrest⟩ + rcases hrest with _ | ⟨hc2, hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact stepPlus_trans (h1 l r1) + (stepPlus_trans (hc1 (mid1 +> l)) + (stepPlus_trans (h2 l _) + (stepPlus_trans (hc2 (mid2 +> l)) (h3 l r3)))) + +theorem seg_step3_eq {tm : Machine (Fin 2) (Fin 6)} + {cR : HalfTape -> Call -> HalfTape -> Cfg (Fin 2) (Fin 6)} + {cL : HalfTape -> HalfTape -> Cfg (Fin 2) (Fin 6)} + {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r, cR l c_in (w1 +> r) = cR (mid1 +> l) c1 r) + (h2 : ∀ l r, (cL (mid1 +> l) r) [tm]⊢⁺ (cR (mid2 +> l) c2 r)) + (h3 : ∀ l r, (cL (mid2 +> l) r) [tm]⊢⁺ (cL l (w2 +> r))) : + Seg (CallStep tm cR cL) [c_in] [c1, c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1, hrest⟩ + rcases hrest with _ | ⟨hc2, hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + rw [h1 l r1] + exact stepPlus_trans (hc1 (mid1 +> l)) + (stepPlus_trans (h2 l _) + (stepPlus_trans (hc2 (mid2 +> l)) (h3 l r3))) + +structure SegRules (stepRel : Call -> HalfTape -> HalfTape -> Prop) : Prop where + cp_t : Seg stepRel [.cp] [] t (t ++ one) + cj_t : Seg stepRel [.cj] [.cj] t t + ch_t : Seg stepRel [.ch] [.ch, .ch] t t + cp_d1_d0 : Seg stepRel [.cp] [] (d1 ++ d0) (t ++ one) + ch_t_one : Seg stepRel [.ch] [.cj, .ch] (t ++ one) t + cj_d1_d0 : Seg stepRel [.cj] [.cj] (d1 ++ d0) t + cp_d1_d1 : Seg stepRel [.cp] [.cp] (d1 ++ d1) t + cj_d1_d1 : Seg stepRel [.cj] [.cp, .ch] (d1 ++ d1) t + cj_d0 : Seg stepRel [.cj] [] d0 (d0 ++ one) + ch_d0_one : Seg stepRel [.ch] [] (d0 ++ one) (d1 ++ one) + ch_d1_one : Seg stepRel [.ch] [.cj] (d1 ++ one) d0 + cj_d1 : Seg stepRel [.cj] [.cp] d1 d0 + ch_d0 : Seg stepRel [.ch] [] d0 d1 + ch_d1 : Seg stepRel [.ch] [.ch] d1 d0 + ca_nil : Seg stepRel [.ca] [.cj, .ch] [] t + +theorem seg_ch_pow_t {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) (n : Nat) : + Seg stepRel ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact seg_nil t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [list_pow_succ, h_eq, list_pow_add] + exact seg_append rules.ch_t ih + +theorem seg_ch_pow_half {stepRel : Call -> HalfTape -> HalfTape -> Prop} + {w2 : BitWord} (hw : Seg stepRel [.ch, .ch] [.ch] w2 w2) (n : Nat) : + Seg stepRel ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact seg_nil w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq, list_pow_add, list_pow_succ] + exact seg_append hw ih + +theorem seg_ch2_d0 {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) : Seg stepRel [.ch, .ch] [.ch] d0 d0 := + seg_append rules.ch_d0 rules.ch_d1 + +theorem seg_ch2_d1 {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) : Seg stepRel [.ch, .ch] [.ch] d1 d1 := + seg_append rules.ch_d1 rules.ch_d0 + +theorem seg_cp_ch_t {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) (n : Nat) : + Seg stepRel ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [list_pow_one_add, List.cons_append, List.nil_append] using + seg_append (seg_append rules.cp_t rules.ch_t_one) (seg_ch_pow_t rules n) + +theorem seg_cj_ch_t {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) (n : Nat) : + Seg stepRel ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) t t := + seg_append rules.cj_t (seg_ch_pow_t rules n) + +theorem seg_cp_ch_d1_d0 {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) (n : Nat) : + Seg stepRel ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [list_pow_one_add, List.cons_append, List.nil_append] using + seg_append (seg_append rules.cp_d1_d0 rules.ch_t_one) (seg_ch_pow_t rules n) + +theorem seg_cj_ch_d1_d0 {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) (n : Nat) : + Seg stepRel ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + seg_append rules.cj_d1_d0 (seg_ch_pow_t rules n) + +theorem seg_cp_ch_d1_d1 {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) (n : Nat) : + Seg stepRel ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + seg_append rules.cp_d1_d1 (seg_ch_pow_t rules n) + +theorem seg_cj_ch_d1_d1 {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) (n : Nat) : + Seg stepRel ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [list_pow_one_add, List.cons_append, List.nil_append] using + seg_append rules.cj_d1_d1 (seg_ch_pow_t rules n) + +theorem seg_cj_ch_d0_d0 {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) (n : Nat) : + Seg stepRel ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg stepRel [.cj, .ch, .ch] [.cj] d0 d0 := + seg_append rules.cj_d0 (seg_append rules.ch_d0_one rules.ch_d1_one) + have h1 := seg_append h0 (seg_ch_pow_half (seg_ch2_d0 rules) n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq, list_pow_one_add, List.cons_append, List.nil_append] using h1 + +theorem seg_cj_ch_d1_d0_half {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) (n : Nat) : + Seg stepRel ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + seg_append rules.cj_d1 (seg_ch_pow_half (seg_ch2_d0 rules) n) + +theorem seg_cj_ch_d0_one {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) : + Seg stepRel [.cj, .ch] [] d0 (d1 ++ one) := + seg_append rules.cj_d0 rules.ch_d0_one + +theorem seg_cj_ch_d0_d1 {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) (n : Nat) : + Seg stepRel ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg stepRel [.cj, .ch, .ch, .ch] [.cj] d0 d1 := + seg_append rules.cj_d0 (seg_append rules.ch_d0_one (seg_append rules.ch_d1_one rules.ch_d0)) + have h1 := seg_append h0 (seg_ch_pow_half (seg_ch2_d1 rules) n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq, list_pow_one_add, List.cons_append, List.nil_append] using h1 + +theorem seg_cj_ch_d1_d1_half {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) (n : Nat) : + Seg stepRel ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg stepRel [.cj, .ch] [.cp] d1 d1 := seg_append rules.cj_d1 rules.ch_d0 + have h1 := seg_append h0 (seg_ch_pow_half (seg_ch2_d1 rules) n) + simpa only [list_pow_one_add, List.cons_append, List.nil_append] using h1 + +inductive BRIncs : Nat -> HalfTape -> HalfTape -> Prop where + | zero (r : HalfTape) : BRIncs 0 r (one +> r) + | T {n : Nat} {r r' : HalfTape} : + BRIncs (n * 2) r r' -> BRIncs (1 + n) (t +> r) (t +> r') + | pair0 {n : Nat} {r r' : HalfTape} : + BRIncs (n * 2) r r' -> BRIncs (1 + n) (d1 +> (d0 +> r)) (t +> r') + | pair1 {n : Nat} {r r' : HalfTape} : + BRIncs (1 + n * 2) r r' -> BRIncs (1 + n) (d1 +> (d1 +> r)) (t +> r') + | short00 {n : Nat} {r r' : HalfTape} : + BRIncs (n * 2) r r' -> BRIncs (2 + n * 4) (d0 +> r) (d0 +> r') + | short01 {n : Nat} {r r' : HalfTape} : + BRIncs (1 + n * 2) r r' -> BRIncs (2 + n * 4) (d1 +> r) (d0 +> r') + | short10 {n : Nat} {r r' : HalfTape} : + BRIncs (n * 2) r r' -> BRIncs (4 + n * 4) (d0 +> r) (d1 +> r') + | short11 {n : Nat} {r r' : HalfTape} : + BRIncs (1 + n * 2) r r' -> BRIncs (4 + n * 4) (d1 +> r) (d1 +> r') +inductive Binary : Nat -> Nat -> HalfTape -> Prop where + | one : Binary 1 1 (d1 +> default) + | zero {n H : Nat} {r : HalfTape} : + Binary (1 + n) H r -> Binary (2 + n * 2) (1 + H) (d0 +> r) + | two {n H : Nat} {r : HalfTape} : + Binary (1 + n) H r -> Binary (3 + n * 2) (1 + H) (d1 +> r) + + +theorem binary_bounds {A H : Nat} {r : HalfTape} (h : Binary A H r) : + 0 < A /\ 0 < H /\ 2 ^ H <= A * 2 /\ A < 2 ^ H := by + induction h with + | one => decide + | @zero n H r _ ih => + rw [pow_two_one_add H]; omega + | @two n H r _ ih => + rw [pow_two_one_add H]; omega + +theorem brIncs_of_binary {A H : Nat} {r : HalfTape} (h : Binary A H r) : + BRIncs ((A - 1) * 2) default r := by + induction h with + | one => + have h0 := BRIncs.zero (default : HalfTape) + have hd : d1 +> (default : HalfTape) = one +> default := by simp [d1,one] + rw [hd]; exact h0 + | @zero n H r _ ih => + have ih' : BRIncs (n * 2) default r := by + have heq : ((1 + n) - 1) * 2 = n * 2 := by omega + rwa [heq] at ih + have hs := BRIncs.short00 ih' + rw [append_d0_default] at hs + have heq : ((2 + n * 2) - 1) * 2 = 2 + n * 4 := by omega + rwa [heq] + | @two n H r _ ih => + have ih' : BRIncs (n * 2) default r := by + have heq : ((1 + n) - 1) * 2 = n * 2 := by omega + rwa [heq] at ih + have hs := BRIncs.short10 ih' + rw [append_d0_default] at hs + have heq : ((3 + n * 2) - 1) * 2 = 4 + n * 4 := by omega + rwa [heq] + +theorem digitVal_unique {A H : Nat} {u : WordList} (h1 : DigitVal A H u) : + ∀ {v : WordList},DigitVal A H v -> u = v := by + induction h1 with + | nil => + intro v h2 + cases v with + | nil => rfl + | cons w v' => + cases w with + | V => exact False.elim (digitVal_not_cons_V h2) + | K => + rcases digitVal_cons_K_inv h2 with ⟨_,_,_,_,h⟩ + (try omega) + | Q => + rcases digitVal_cons_Q_inv h2 with ⟨_,_,_,_,h⟩ + (try omega) + | @zero A H u _ ih => + intro v h2 + generalize hA_eq : A * 2 = A0 at h2 + generalize hH_eq : 1 + H = H0 at h2 + cases h2 with + | nil => omega + | @zero A' H' v' hD => + have hA : A = A' := by omega + have hH : H = H' := by omega + subst hA hH + rw [ih hD] + | one _ => omega + | @one A H u _ ih => + intro v h2 + generalize hA_eq : 1 + A * 2 = A0 at h2 + generalize hH_eq : 1 + H = H0 at h2 + cases h2 with + | nil => omega + | zero _ => omega + | @one A' H' v' hD => + have hA : A = A' := by omega + have hH : H = H' := by omega + subst hA hH + rw [ih hD] + +theorem scan_cons_Q_K_inv {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (hI : Scan a (Q :: K :: u) b v l) : + ∃ n w s,a = 1 + n /\ Scan (n * 2) u b w s /\ v = V :: w /\ l = (1 + s) * (1 / 2) := by + cases hI with + | @pair0 n _ _ w s hJ => + exact ⟨n,w,s,rfl,hJ,rfl,rfl⟩ + | @short01 n _ _ _ _ hJ => + exact False.elim (not_scan_odd_cons_K n u b _ _ hJ) + | @short11 n _ _ _ _ hJ => + exact False.elim (not_scan_odd_cons_K n u b _ _ hJ) + +inductive BScan : Nat -> WordList -> Nat -> WordList -> Rat -> Rat -> Prop where + | nil (k : Nat) : BScan k [] k [] 0 0 + | T {n : Nat} {u : WordList} {k : Nat} {v : WordList} {a b : Rat} : + BScan (n * 2) u k v a b -> BScan (1 + n) (V :: u) k (V :: v) (a * (1 / 2)) (b * (1 / 2)) + | pair0 {n : Nat} {u : WordList} {k : Nat} {v : WordList} {a b : Rat} : + BScan (n * 2) u k v a b -> BScan (1 + n) (Q :: K :: u) k (V :: v) (a * (1 / 2)) (b * (1 / 2)) + | pair1 {n : Nat} {u : WordList} {k : Nat} {v : WordList} {a b : Rat} : + BScan (1 + n * 2) u k v a b -> BScan (1 + n) (Q :: Q :: u) k (V :: v) (a * (1 / 2)) ((1 / 4) + + b * (1 / 2)) + | short00 {n : Nat} {u : WordList} {k : Nat} {v : WordList} {a b : Rat} : + BScan (n * 2) u k v a b -> BScan (2 + n * 4) (K :: u) k (K :: v) (2 + a * 2) (b * 2) + | short01 {n : Nat} {u : WordList} {k : Nat} {v : WordList} {a b : Rat} : + BScan (1 + n * 2) u k v a b -> BScan (2 + n * 4) (Q :: u) k (K :: v) (1 + a * 2) (b * 2) + | short10 {n : Nat} {u : WordList} {k : Nat} {v : WordList} {a b : Rat} : + BScan (n * 2) u k v a b -> BScan (4 + n * 4) (K :: u) k (Q :: v) (3 + a * 2) (b * 2) + | short11 {n : Nat} {u : WordList} {k : Nat} {v : WordList} {a b : Rat} : + BScan (1 + n * 2) u k v a b -> BScan (4 + n * 4) (Q :: u) k (Q :: v) (2 + a * 2) (b * 2) + +theorem bscan_scale_eq {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (h : BScan k u k' v a b) : + (k : Rat) - 2 = ((k' : Rat) - 2) * wordScale v + 2 * (a - b) := by + induction h with + | nil k => simp [wordScale] + | T _ ih => dsimp [wordScale]; push_cast at ih ⊢; linarith + | pair0 _ ih => dsimp [wordScale]; push_cast at ih ⊢; linarith + | pair1 _ ih => dsimp [wordScale]; push_cast at ih ⊢; linarith + | short00 _ ih => dsimp [wordScale]; push_cast at ih ⊢; linarith + | short01 _ ih => dsimp [wordScale]; push_cast at ih ⊢; linarith + | short10 _ ih => dsimp [wordScale]; push_cast at ih ⊢; linarith + | short11 _ ih => dsimp [wordScale]; push_cast at ih ⊢; linarith + +theorem bscan_mass_bounds {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (h : BScan k u k' v a b) : + wordMass v <= wordMass u /\ 0 <= a /\ a <= 2 * wordMass u + wordMassK u /\ 0 <= b /\ + wordMass v + a - b - wordMassQ v <= 2 * wordMass u + wordMassK u := by + induction h with + | nil _ => simp [wordMass,wordMassK,wordMassQ] + | @T n u k v a b _ ih => + have hw := wordMass_nonneg u; have hm := wordMass_eq_add u + dsimp [wordMass,wordMassK,wordMassQ]; refine ⟨by linarith,by linarith,by linarith,by linarith,by + linarith⟩ + | @pair0 n u k v a b _ ih => + have hw := wordMass_nonneg u; have hm := wordMass_eq_add u + dsimp [wordMass,wordMassK,wordMassQ]; refine ⟨by linarith,by linarith,by linarith,by linarith,by + linarith⟩ + | @pair1 n u k v a b _ ih => + have hw := wordMass_nonneg u; have hm := wordMass_eq_add u + dsimp [wordMass,wordMassK,wordMassQ]; refine ⟨by linarith,by linarith,by linarith,by linarith,by + linarith⟩ + | @short00 n u k v a b _ ih => + have hw := wordMass_nonneg u; have hm := wordMass_eq_add u + dsimp [wordMass,wordMassK,wordMassQ]; refine ⟨by linarith,by linarith,by linarith,by linarith,by + linarith⟩ + | @short01 n u k v a b _ ih => + have hw := wordMass_nonneg u; have hm := wordMass_eq_add u + dsimp [wordMass,wordMassK,wordMassQ]; refine ⟨by linarith,by linarith,by linarith,by linarith,by + linarith⟩ + | @short10 n u k v a b _ ih => + have hw := wordMass_nonneg u; have hm := wordMass_eq_add u + dsimp [wordMass,wordMassK,wordMassQ]; refine ⟨by linarith,by linarith,by linarith,by linarith,by + linarith⟩ + | @short11 n u k v a b _ ih => + have hw := wordMass_nonneg u; have hm := wordMass_eq_add u + dsimp [wordMass,wordMassK,wordMassQ]; refine ⟨by linarith,by linarith,by linarith,by linarith,by + linarith⟩ + +theorem bscan_append {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (h1 : BScan k u k' v a b) : + ∀ {w : WordList} {k'' : Nat} {x : WordList} {c d : Rat}, + BScan k' w k'' x c d -> + ∃ a' b',BScan k (u ++ w) k'' (v ++ x) a' b' /\ + a' = a + wordScale v * c /\ b' = b + wordScale v * d := by + induction h1 with + | nil _ => + intro w k'' x c d h2 + exact ⟨c,d,h2,by simp [wordScale],by simp [wordScale]⟩ + | T _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a', b', hK, hA, hB⟩ + refine ⟨a' * (1 / 2), b' * (1 / 2), BScan.T hK, ?_, ?_⟩ + · dsimp [wordScale]; linarith + · dsimp [wordScale]; linarith + | pair0 _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a', b', hK, hA, hB⟩ + refine ⟨a' * (1 / 2), b' * (1 / 2), BScan.pair0 hK, ?_, ?_⟩ + · dsimp [wordScale]; linarith + · dsimp [wordScale]; linarith + | pair1 _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a', b', hK, hA, hB⟩ + refine ⟨a' * (1 / 2), (1 / 4) + b' * (1 / 2), BScan.pair1 hK, ?_, ?_⟩ + · dsimp [wordScale]; linarith + · dsimp [wordScale]; linarith + | short00 _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a', b', hK, hA, hB⟩ + refine ⟨2 + a' * 2, b' * 2, BScan.short00 hK, ?_, ?_⟩ + · dsimp [wordScale]; linarith + · dsimp [wordScale]; linarith + | short01 _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a', b', hK, hA, hB⟩ + refine ⟨1 + a' * 2, b' * 2, BScan.short01 hK, ?_, ?_⟩ + · dsimp [wordScale]; linarith + · dsimp [wordScale]; linarith + | short10 _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a', b', hK, hA, hB⟩ + refine ⟨3 + a' * 2, b' * 2, BScan.short10 hK, ?_, ?_⟩ + · dsimp [wordScale]; linarith + · dsimp [wordScale]; linarith + | short11 _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a', b', hK, hA, hB⟩ + refine ⟨2 + a' * 2, b' * 2, BScan.short11 hK, ?_, ?_⟩ + · dsimp [wordScale]; linarith + · dsimp [wordScale]; linarith + +theorem exists_bscan_of_wordPrefix {e : Bool} {u : WordList} (hI : WordPrefix e u) : + ∀ (k : Nat),(e = true -> ∃ n,k = n * 2) -> + 6 * wordMass u < (k : Rat) - 2 -> + ∃ b v lp lm,BScan k u b v lp lm /\ 2 < b := by + induction hI with + | nil e => + intro k _ hk + dsimp [wordMass] at hk + have hk_gt : (2 : Rat) < (k : Rat) := by linarith + have hk_nat : 2 < k := by exact_mod_cast hk_gt + exact ⟨k,[],0,0,BScan.nil k,hk_nat⟩ + | @T e u _ ih => + intro k _ hk + have hw := wordMass_nonneg u + dsimp [wordMass] at hk + cases k with + | zero => push_cast at hk; linarith + | succ k => + have h1k : k + 1 = 1 + k := by omega + rw [h1k] at hk ⊢ + rcases ih (k * 2) (fun _ => ⟨k,rfl⟩) (by push_cast at hk ⊢; linarith) with ⟨b,v,lp,lm,hS,hB⟩ + exact ⟨b,V :: v,lp * (1 / 2),lm * (1 / 2),BScan.T hS,hB⟩ + | @short0 u _ ih => + intro k hEk hk + have hw := wordMass_nonneg u + dsimp [wordMass] at hk + rcases hEk rfl with ⟨n,rfl⟩ + rcases even_or_odd_mul_two n with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · cases a with + | zero => push_cast at hk; linarith + | succ a => + rcases ih (a * 2) (fun _ => ⟨a,rfl⟩) (by push_cast at hk ⊢; linarith) with ⟨b,v,lp,lm,hS,hB⟩ + refine ⟨b,Q :: v,3 + lp * 2,lm * 2,?_,hB⟩ + have heq : (a + 1) * 2 * 2 = 4 + a * 4 := by omega + rw [heq]; exact BScan.short10 hS + · rcases ih (a * 2) (fun _ => ⟨a,rfl⟩) (by push_cast at hk ⊢; linarith) with ⟨b,v,lp,lm,hS,hB⟩ + refine ⟨b,K :: v,2 + lp * 2,lm * 2,?_,hB⟩ + have heq : (1 + a * 2) * 2 = 2 + a * 4 := by omega + rw [heq]; exact BScan.short00 hS + | @short1 u _ ih => + intro k hEk hk + have hw := wordMass_nonneg u + dsimp [wordMass] at hk + rcases hEk rfl with ⟨n,rfl⟩ + rcases even_or_odd_mul_two n with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · cases a with + | zero => push_cast at hk; linarith + | succ a => + rcases ih (1 + a * 2) (fun h => + by contradiction) (by push_cast at hk ⊢; linarith) with ⟨b,v,lp,lm,hS,hB⟩ + refine ⟨b,Q :: v,2 + lp * 2,lm * 2,?_,hB⟩ + have heq : (a + 1) * 2 * 2 = 4 + a * 4 := by omega + rw [heq]; exact BScan.short11 hS + · rcases ih (1 + a * 2) (fun h => + by contradiction) (by push_cast at hk ⊢; linarith) with ⟨b,v,lp,lm,hS,hB⟩ + refine ⟨b,K :: v,1 + lp * 2,lm * 2,?_,hB⟩ + have heq : (1 + a * 2) * 2 = 2 + a * 4 := by omega + rw [heq]; exact BScan.short01 hS + | @pair0 e u _ ih => + intro k _ hk + have hw := wordMass_nonneg u + dsimp [wordMass] at hk + cases k with + | zero => push_cast at hk; linarith + | succ k => + have h1k : k + 1 = 1 + k := by omega + rw [h1k] at hk ⊢ + rcases ih (k * 2) (fun _ => ⟨k,rfl⟩) (by push_cast at hk ⊢; linarith) with ⟨b,v,lp,lm,hS,hB⟩ + exact ⟨b,V :: v,lp * (1 / 2),lm * (1 / 2),BScan.pair0 hS,hB⟩ + | @pair1 e u _ ih => + intro k _ hk + have hw := wordMass_nonneg u + dsimp [wordMass] at hk + cases k with + | zero => push_cast at hk; linarith + | succ k => + have h1k : k + 1 = 1 + k := by omega + rw [h1k] at hk ⊢ + rcases ih (1 + k * 2) (fun h => + by contradiction) (by push_cast at hk ⊢; linarith) with ⟨b,v,lp,lm,hS,hB⟩ + exact ⟨b,V :: v,lp * (1 / 2),(1 / 4) + lm * (1 / 2),BScan.pair1 hS,hB⟩ + +theorem exists_bscan_even (u : WordList) (k : Nat) (h : 6 * wordMass u < ((k * 2 : Nat) : Rat) - 2) + : + ∃ b v lp lm,BScan (k * 2) u b v lp lm /\ 2 < b := + exists_bscan_of_wordPrefix (wordPrefix_true_and_cases u).1 (k * 2) (fun _ => ⟨k,rfl⟩) h + +theorem bscan_of_scan_digitVal {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {l : Rat} + (hI : Scan k u k' v l) : + ∀ {A H : Nat},DigitVal A H u -> + ∃ a b,BScan k u k' v a b /\ a <= 2 * wordMass v + l /\ b <= l := by + induction hI with + | nil k => + intro A H _ + exact ⟨0,0,BScan.nil k,by simp [wordMass],by linarith⟩ + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | pair0 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1,H1,hD1,_,_⟩ + rcases digitVal_cons_K_inv hD1 with ⟨A2,H2,hD2,_,_⟩ + rcases ih hD2 with ⟨a,b,hJ,hP,hM⟩ + exact ⟨a * (1 / 2),b * (1 / 2),BScan.pair0 hJ,by dsimp [wordMass]; linarith,by linarith⟩ + | pair1 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1,H1,hD1,_,_⟩ + rcases digitVal_cons_Q_inv hD1 with ⟨A2,H2,hD2,_,_⟩ + rcases ih hD2 with ⟨a,b,hJ,hP,hM⟩ + exact ⟨a * (1 / 2),(1 / 4) + b * (1 / 2),BScan.pair1 hJ,by dsimp [wordMass]; linarith,by + linarith⟩ + | short00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A1,H1,hD1,_,_⟩ + rcases ih hD1 with ⟨a,b,hJ,hP,hM⟩ + exact ⟨2 + a * 2,b * 2,BScan.short00 hJ,by dsimp [wordMass]; linarith,by linarith⟩ + | short01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1,H1,hD1,_,_⟩ + rcases ih hD1 with ⟨a,b,hJ,hP,hM⟩ + exact ⟨1 + a * 2,b * 2,BScan.short01 hJ,by dsimp [wordMass]; linarith,by linarith⟩ + | short10 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A1,H1,hD1,_,_⟩ + rcases ih hD1 with ⟨a,b,hJ,hP,hM⟩ + exact ⟨3 + a * 2,b * 2,BScan.short10 hJ,by dsimp [wordMass]; linarith,by linarith⟩ + | short11 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1,H1,hD1,_,_⟩ + rcases ih hD1 with ⟨a,b,hJ,hP,hM⟩ + exact ⟨2 + a * 2,b * 2,BScan.short11 hJ,by dsimp [wordMass]; linarith,by linarith⟩ + +theorem scan_of_bscan_digitVal {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (hI : BScan k u k' v a b) : + ∀ {A H : Nat},DigitVal A H u -> + ∃ l,Scan k u k' v l /\ a <= 2 * wordMass v + l /\ b <= l := by + induction hI with + | nil k => + intro A H _ + exact ⟨0,Scan.nil k,by simp [wordMass],by linarith⟩ + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | pair0 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1,H1,hD1,_,_⟩ + rcases digitVal_cons_K_inv hD1 with ⟨A2,H2,hD2,_,_⟩ + rcases ih hD2 with ⟨l,hJ,hP,hM⟩ + exact ⟨(1 + l) * (1 / 2),Scan.pair0 hJ,by dsimp [wordMass]; linarith,by linarith⟩ + | pair1 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1,H1,hD1,_,_⟩ + rcases digitVal_cons_Q_inv hD1 with ⟨A2,H2,hD2,_,_⟩ + rcases ih hD2 with ⟨l,hJ,hP,hM⟩ + exact ⟨(1 / 4) + l * (1 / 2),Scan.pair1 hJ,by dsimp [wordMass]; linarith,by linarith⟩ + | short00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A1,H1,hD1,_,_⟩ + rcases ih hD1 with ⟨l,hJ,hP,hM⟩ + exact ⟨1 + l * 2,Scan.short00 hJ,by dsimp [wordMass]; linarith,by linarith⟩ + | short01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1,H1,hD1,_,_⟩ + rcases ih hD1 with ⟨l,hJ,hP,hM⟩ + exact ⟨l * 2,Scan.short01 hJ,by dsimp [wordMass]; linarith,by linarith⟩ + | short10 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A1,H1,hD1,_,_⟩ + rcases ih hD1 with ⟨l,hJ,hP,hM⟩ + exact ⟨1 + l * 2,Scan.short10 hJ,by dsimp [wordMass]; linarith,by linarith⟩ + | short11 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1,H1,hD1,_,_⟩ + rcases ih hD1 with ⟨l,hJ,hP,hM⟩ + exact ⟨l * 2,Scan.short11 hJ,by dsimp [wordMass]; linarith,by linarith⟩ + +theorem bscan_scale_le {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (h : BScan k u k' v a b) : wordScale v <= wordScale u := by + induction h with + | nil _ => simp [wordScale] + | T _ ih => dsimp [wordScale]; linarith + | @pair0 _ u _ _ _ _ _ _ => have hp := wordScale_pos u; dsimp [wordScale]; linarith + | @pair1 _ u _ _ _ _ _ _ => have hp := wordScale_pos u; dsimp [wordScale]; linarith + | short00 _ ih => dsimp [wordScale]; linarith + | short01 _ ih => dsimp [wordScale]; linarith + | short10 _ ih => dsimp [wordScale]; linarith + | short11 _ ih => dsimp [wordScale]; linarith + +set_option maxHeartbeats 800000 in +-- Justification: induction over all 8 BScan constructors with rational ring arithmetic. +theorem bscan_split {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (h : BScan k u k' v a b) : + ∀ (p q : WordList),u = p ++ q -> SplitCond p q -> + ∃ m x y a1 b1 a2 b2,BScan k p m x a1 b1 /\ BScan m q k' y a2 b2 /\ + v = x ++ y /\ a = a1 + wordScale x * a2 /\ b = b1 + wordScale x * b2 := by + induction h with + | nil k => + intro p q hE _ + cases p with + | nil => + simp at hE; subst hE + exact ⟨k,[],[],0,0,0,0,BScan.nil k,BScan.nil k,rfl,by simp [wordScale],by simp [wordScale]⟩ + | cons s p => simp at hE + | T hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,0,_,_,BScan.nil _,BScan.T hI,rfl,by simp [wordScale],by simp [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + rcases ih p q hE (splitCond_of_cons V p q hP) with ⟨m,x,y,a1,b1,a2,b2,hJ,hK,rfl,hA,hB⟩ + exact ⟨m,V :: x,y,a1 * (1 / 2),b1 * (1 / 2),a2,b2,BScan.T hJ,hK,rfl, + by dsimp [wordScale]; rw [hA]; ring,by dsimp [wordScale]; rw [hB]; ring⟩ + | pair0 hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,0,_,_,BScan.nil _,BScan.pair0 hI,rfl,by simp [wordScale],by simp [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + cases p with + | nil => + simp at hE; subst hE + rcases hP with hP | ⟨r,hP⟩ <;> nomatch hP + | cons s2 p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + have hP' := splitCond_of_cons K p q (splitCond_of_cons Q (K :: p) q hP) + rcases ih p q hE hP' with ⟨m,x,y,a1,b1,a2,b2,hJ,hK,rfl,hA,hB⟩ + exact ⟨m,V :: x,y,a1 * (1 / 2),b1 * (1 / 2),a2,b2,BScan.pair0 hJ,hK,rfl, + by dsimp [wordScale]; rw [hA]; ring,by dsimp [wordScale]; rw [hB]; ring⟩ + | pair1 hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,0,_,_,BScan.nil _,BScan.pair1 hI,rfl,by simp [wordScale],by simp [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + cases p with + | nil => + simp at hE; subst hE + rcases hP with hP | ⟨r,hP⟩ <;> nomatch hP + | cons s2 p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + have hP' := splitCond_of_cons Q p q (splitCond_of_cons Q (Q :: p) q hP) + rcases ih p q hE hP' with ⟨m,x,y,a1,b1,a2,b2,hJ,hK,rfl,hA,hB⟩ + exact ⟨m,V :: x,y,a1 * (1 / 2),(1 / 4) + b1 * (1 / 2),a2,b2,BScan.pair1 hJ,hK,rfl, + by dsimp [wordScale]; rw [hA]; ring,by dsimp [wordScale]; rw [hB]; ring⟩ + | short00 hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,0,_,_,BScan.nil _,BScan.short00 hI,rfl,by simp [wordScale],by simp + [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + rcases ih p q hE (splitCond_of_cons K p q hP) with ⟨m,x,y,a1,b1,a2,b2,hJ,hK,rfl,hA,hB⟩ + exact ⟨m,K :: x,y,2 + a1 * 2,b1 * 2,a2,b2,BScan.short00 hJ,hK,rfl, + by dsimp [wordScale]; rw [hA]; ring,by dsimp [wordScale]; rw [hB]; ring⟩ + | short01 hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,0,_,_,BScan.nil _,BScan.short01 hI,rfl,by simp [wordScale],by simp + [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + rcases ih p q hE (splitCond_of_cons Q p q hP) with ⟨m,x,y,a1,b1,a2,b2,hJ,hK,rfl,hA,hB⟩ + exact ⟨m,K :: x,y,1 + a1 * 2,b1 * 2,a2,b2,BScan.short01 hJ,hK,rfl, + by dsimp [wordScale]; rw [hA]; ring,by dsimp [wordScale]; rw [hB]; ring⟩ + | short10 hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,0,_,_,BScan.nil _,BScan.short10 hI,rfl,by simp [wordScale],by simp + [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + rcases ih p q hE (splitCond_of_cons K p q hP) with ⟨m,x,y,a1,b1,a2,b2,hJ,hK,rfl,hA,hB⟩ + exact ⟨m,Q :: x,y,3 + a1 * 2,b1 * 2,a2,b2,BScan.short10 hJ,hK,rfl, + by dsimp [wordScale]; rw [hA]; ring,by dsimp [wordScale]; rw [hB]; ring⟩ + | short11 hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,0,_,_,BScan.nil _,BScan.short11 hI,rfl,by simp [wordScale],by simp + [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + rcases ih p q hE (splitCond_of_cons Q p q hP) with ⟨m,x,y,a1,b1,a2,b2,hJ,hK,rfl,hA,hB⟩ + exact ⟨m,Q :: x,y,2 + a1 * 2,b1 * 2,a2,b2,BScan.short11 hJ,hK,rfl, + by dsimp [wordScale]; rw [hA]; ring,by dsimp [wordScale]; rw [hB]; ring⟩ + +theorem bscan_replicate_Q_K (r k : Nat) (u : WordList) (k' : Nat) (v : WordList) (a b : Rat) + (hI : BScan k (u ++ List.replicate (1 + r * 2) Q ++ [K]) k' v a b) : + ∃ w n,v = w ++ List.replicate (1 + r) V /\ k' = n * 2 ^ (1 + r) := by + rcases split_trailing_Q u with ⟨p,n,rfl,hP⟩ + have hE : (p ++ List.replicate n Q) ++ List.replicate (1 + r * 2) Q ++ [K] = + p ++ (List.replicate (1 + r * 2 + n) Q ++ [K]) := by + have heq : 1 + r * 2 + n = n + (1 + r * 2) := by omega + rw [heq,List.replicate_add n (1 + r * 2)]; simp only [List.append_assoc] + rw [hE] at hI + rcases bscan_split hI p (List.replicate (1 + r * 2 + n) Q ++ [K]) rfl (Or.inl hP) + with ⟨m,x,y,_,_,_,_,_,hK,rfl,_,_⟩ + have hD : DigitVal ((2 ^ (1 + r * 2 + n) - 1) + 0 * 2 ^ (1 + r * 2 + n)) ((1 + r * 2 + n) + 1) + (List.replicate (1 + r * 2 + n) Q ++ [K]) := + digitVal_append (digitVal_replicate_Q (1 + r * 2 + n)) (DigitVal.zero DigitVal.nil) + rcases scan_of_bscan_digitVal hK hD with ⟨l,hL,_,_⟩ + rcases scan_add_Q_K_inv n r m k' y l hL with ⟨w,q,rfl,rfl⟩ + exact ⟨x ++ w,q,by rw [List.append_assoc],rfl⟩ + +theorem scan_defect_of_bscan_digitVal {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (hI : BScan k u k' v a b) : + ∀ {A H : Nat},DigitVal A H u -> + ∃ l,Scan k u k' v l /\ a - b - wordMassQ v <= wordMass v + l := by + induction hI with + | nil k => + intro A H _ + exact ⟨0,Scan.nil k,by simp [wordMass,wordMassQ]⟩ + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | pair0 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1,H1,hD1,_,_⟩ + rcases digitVal_cons_K_inv hD1 with ⟨A2,H2,hD2,_,_⟩ + rcases ih hD2 with ⟨l,hJ,hL⟩ + exact ⟨(1 + l) * (1 / 2),Scan.pair0 hJ,by dsimp [wordMass,wordMassQ]; linarith⟩ + | pair1 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1,H1,hD1,_,_⟩ + rcases digitVal_cons_Q_inv hD1 with ⟨A2,H2,hD2,_,_⟩ + rcases ih hD2 with ⟨l,hJ,hL⟩ + exact ⟨(1 / 4) + l * (1 / 2),Scan.pair1 hJ,by dsimp [wordMass,wordMassQ]; linarith⟩ + | short00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A1,H1,hD1,_,_⟩ + rcases ih hD1 with ⟨l,hJ,hL⟩ + exact ⟨1 + l * 2,Scan.short00 hJ,by dsimp [wordMass,wordMassQ]; linarith⟩ + | short01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1,H1,hD1,_,_⟩ + rcases ih hD1 with ⟨l,hJ,hL⟩ + exact ⟨l * 2,Scan.short01 hJ,by dsimp [wordMass,wordMassQ]; linarith⟩ + | short10 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A1,H1,hD1,_,_⟩ + rcases ih hD1 with ⟨l,hJ,hL⟩ + exact ⟨1 + l * 2,Scan.short10 hJ,by dsimp [wordMass,wordMassQ]; linarith⟩ + | short11 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1,H1,hD1,_,_⟩ + rcases ih hD1 with ⟨l,hJ,hL⟩ + exact ⟨l * 2,Scan.short11 hJ,by dsimp [wordMass,wordMassQ]; linarith⟩ + +theorem scan_append_K_bounds {k : Nat} {ds : WordList} {k' : Nat} {v : WordList} {l : Rat} + (hI : Scan k (ds ++ [K]) k' v l) + (hLow : ∃ w, ds = Q :: K :: w) + (hDig : ∃ A H, DigitVal A H ds) : + wordMass v <= wordMassK ds * (1 / 4) /\ wordMass v + l <= wordMassK ds * (1 / 2) + (1 / 2) := by + rcases hLow with ⟨w,rfl⟩ + rcases hDig with ⟨A,H,hD⟩ + rcases digitVal_cons_Q_inv hD with ⟨A1,H1,hD1,_,_⟩ + rcases digitVal_cons_K_inv hD1 with ⟨A2,H2,hK,_,_⟩ + change Scan k (Q :: K :: (w ++ [K])) k' v l at hI + rcases scan_cons_Q_K_inv hI with ⟨n,x,s,_,hJ,rfl,hL⟩ + rcases scan_tailDefect_bound hJ (tailDefect_append_K_of_digitVal hK) with ⟨hM,hS,_⟩ + dsimp [wordMassK,wordMass] + constructor <;> linarith + +theorem bscan_append_K_bounds {k : Nat} {ds : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (hI : BScan k (ds ++ [K]) k' v a b) + (hLow : ∃ w, ds = Q :: K :: w) + (hDig : ∃ A H, DigitVal A H ds) : + wordMass v <= wordMassK ds * (1 / 4) /\ a <= wordMassK ds /\ + wordMass v + a - b - wordMassQ v <= wordMassK ds := by + rcases hDig with ⟨A,H,hD⟩ + have hFull := digitVal_append hD (DigitVal.zero DigitVal.nil) + rcases scan_of_bscan_digitVal hI hFull with ⟨l,hJ,hP,_⟩ + rcases scan_defect_of_bscan_digitVal hI hFull with ⟨l',hJ',hE⟩ + rcases scan_append_K_bounds hJ hLow ⟨A,H,hD⟩ with ⟨hM1,hL1⟩ + rcases scan_append_K_bounds hJ' hLow ⟨A,H,hD⟩ with ⟨_,hL2⟩ + rcases hLow with ⟨w,rfl⟩ + have hw := wordMass_nonneg w + dsimp [wordMassK] at hM1 hL1 hL2 ⊢ + refine ⟨by linarith,by linarith,by linarith⟩ + +set_option maxHeartbeats 800000 in +-- Justification: non-linear rational arithmetic for BScan split bounds. +theorem bscan_four_split {u : WordList} {A H : Nat} {ds : WordList} (hDig : DigitVal A H ds) + (hHeight : wordScale u * ((2 ^ H : Nat) : Rat) = 1 / 2) + (hPhi : 3 * wordMass u + wordMassK u + wordScale u * wordMassK ds <= 1 / 64) + (hLow : ∃ w,ds = Q :: K :: w) : + ∃ k v a b,BScan 4 (u ++ ds ++ [K]) k v a b /\ 2 < k /\ + a <= 2 * wordMass u + wordMassK u + wordScale u * wordMassK ds /\ + wordMass v <= wordMass u + wordScale u * wordMassK ds * (1 / 4) /\ + wordMass v + a - b - wordMassQ v <= 2 * wordMass u + wordMassK u + wordScale u * wordMassK + ds := by + have hWu := wordMass_nonneg u + have hWd := wordMass_nonneg ds + have hSu := wordScale_pos u + have hSmall : 6 * wordMass u < ((2 * 2 : Nat) : Rat) - 2 := by + push_cast; nlinarith + rcases exists_bscan_even u 2 hSmall with ⟨m,x,a1,b1,hI,hPos⟩ + have hBudget := bscan_scale_eq hI + have hBounds := bscan_mass_bounds hI + have hGain := bscan_scale_le hI + have hSx := wordScale_pos x + have hCarry : 1 < (m : Rat) * wordScale x := by + push_cast at hBudget; nlinarith + rcases hLow with ⟨w,hEq⟩ + have hRest : (wordMass (w ++ [K]) + wordMassK (w ++ [K]) + 2) * wordScale x <= 1 := by + have hDs := (digitVal_scale_and_mass hDig).1 + rw [<- hDs] at hHeight + rw [hEq] at hDig hHeight + dsimp [wordScale] at hHeight + rcases digitVal_cons_Q_inv hDig with ⟨A1,H1,hD1,_,_⟩ + rcases digitVal_cons_K_inv hD1 with ⟨A2,H2,hJw,_,_⟩ + rcases digitVal_scale_and_mass hJw with ⟨hDw,hMw,_⟩ + have hWw := wordMass_nonneg w + have hMsw := wordMass_eq_add w + have hSw := wordScale_pos w + rw [wordMass_append,wordMassK_append] + dsimp [wordMass,wordMassK] + nlinarith + cases m with + | zero => omega + | succ m => + have hEx_w : (wordMass (w ++ [K]) + wordMassK (w ++ [K])) * 2 < ((m * 2 : Nat) : Rat) := by + push_cast at hCarry ⊢; nlinarith + rcases exists_scan_of_mass_lt (w ++ [K]) m hEx_w with ⟨k,y,l,hJ,_⟩ + have hCore : Scan (m + 1) (ds ++ [K]) k (V :: y) ((1 + l) * (1 / 2)) := by + rw [hEq] + have h1m : m + 1 = 1 + m := by omega + rw [h1m] + exact Scan.pair0 hJ + have hFull := digitVal_append hDig (DigitVal.zero DigitVal.nil) + rcases bscan_of_scan_digitVal hCore hFull with ⟨a2,b2,hJ',_,_⟩ + rcases bscan_append hI hJ' with ⟨a,b,hIJ,hAp,hBp⟩ + rcases bscan_append_K_bounds hJ' ⟨w,hEq⟩ ⟨A,H,hDig⟩ with ⟨hMt,hAt,hEt⟩ + have hIJ' : BScan 4 (u ++ ds ++ [K]) k (x ++ V :: y) a b := by + simpa [List.append_assoc] using hIJ + have hAfull : a <= 2 * wordMass u + wordMassK u + wordScale u * wordMassK ds := by + nlinarith + have hPositive : 2 < k := by + have hB := bscan_scale_eq hIJ + have hF := bscan_mass_bounds hIJ + have hS := wordScale_pos (x ++ V :: y) + have hk_gt : (2 : Rat) < (k : Rat) := by + push_cast at hB; nlinarith + exact_mod_cast hk_gt + refine ⟨k,x ++ V :: y,a,b,hIJ',hPositive,hAfull,?_,?_⟩ + · rw [wordMass_append]; nlinarith + · rw [wordMass_append,wordMassQ_append]; nlinarith + +theorem bscan_replicate_V (p : Nat) : + ∀ (k k' : Nat) (v : WordList) (a b : Rat), + BScan k (List.replicate p V) k' v a b -> + v = List.replicate p V /\ k' + 2 * 2 ^ p = k * 2 ^ p + 2 /\ a = 0 /\ b = 0 := by + induction p with + | zero => + intro k k' v a b hI + cases hI + exact ⟨rfl,by simp,rfl,rfl⟩ + | succ p ih => + intro k k' v a b hI + cases hI with + | @T n _ _ v0 a0 b0 hJ => + rcases ih (n * 2) k' v0 a0 b0 hJ with ⟨rfl,hEq,rfl,rfl⟩ + refine ⟨rfl,?_,by ring,by ring⟩ + calc k' + 2 * 2 ^ (p + 1) + _ = (k' + 2 * 2 ^ p) + 2 * 2 ^ p := by rw [Nat.pow_succ]; ring + _ = (n * 2 * 2 ^ p + 2) + 2 * 2 ^ p := by rw [hEq] + _ = (1 + n) * 2 ^ (p + 1) + 2 := by rw [Nat.pow_succ]; ring + +theorem heightShift_append (u : WordList) : + ∀ (v : WordList) (h H : Nat),heightShift (u ++ v) h = some H -> + ∃ j,heightShift u h = some j /\ heightShift v j = some H := by + induction u with + | nil => + intro v h H hE + exact ⟨h,rfl,hE⟩ + | cons w u ih => + intro v h H hE + cases w with + | V => exact ih v (h + 1) H hE + | K => + cases h with + | zero => contradiction + | succ h => exact ih v h H hE + | Q => + cases h with + | zero => contradiction + | succ h => exact ih v h H hE + +theorem heightShift_replicate_V (n : Nat) : + ∀ (h : Nat),heightShift (List.replicate n V) h = some (h + n) := by + induction n with + | zero => intro h; simp [heightShift] + | succ n ih => + intro h + dsimp [List.replicate,heightShift] + rw [ih (h + 1)] + congr 1; omega + +theorem le_of_heightShift_replicate_V (u : WordList) (n h H : Nat) + (hE : heightShift (u ++ List.replicate n V) h = some H) : n <= H := by + rcases heightShift_append u (List.replicate n V) h H hE with ⟨j,_,hJ⟩ + rw [heightShift_replicate_V] at hJ + injection hJ with hJ + (try omega) + +theorem exists_heightShift_of_mass_lt (u : WordList) : + ∀ (h : Nat),wordMass u < ((2 ^ h : Nat) : Rat) -> ∃ H,heightShift u h = some H := by + induction u with + | nil => intro h _; exact ⟨h,rfl⟩ + | cons w u ih => + intro h hM + cases w with + | V => + dsimp [wordMass,heightShift] at hM ⊢ + apply ih (h + 1) + rw [Nat.pow_succ]; push_cast at hM ⊢; linarith + | K => + cases h with + | zero => + have hw := (wordMass_nonneg u).1 + dsimp [wordMass] at hM; linarith + | succ h => + dsimp [wordMass,heightShift] at hM ⊢ + apply ih h + rw [Nat.pow_succ] at hM; push_cast at hM ⊢; linarith + | Q => + cases h with + | zero => + have hw := (wordMass_nonneg u).1 + dsimp [wordMass] at hM; linarith + | succ h => + dsimp [wordMass,heightShift] at hM ⊢ + apply ih h + rw [Nat.pow_succ] at hM; push_cast at hM ⊢; linarith + +theorem bscan_bound_lt {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (hI : BScan k u k' v a b) : + ∀ (h H : Nat),heightShift v h = some H -> k < 2 ^ (1 + h) -> k' < 2 ^ (1 + H) := by + induction hI with + | nil k => + intro h H hHeight hBound + injection hHeight with hEq; subst hEq; exact hBound + | T _ ih => + intro h H hHeight hBound + apply ih (h + 1) H hHeight + have heq : 1 + (h + 1) = 1 + (1 + h) := by omega + rw [heq,pow_two_one_add (1 + h)]; omega + | pair0 _ ih => + intro h H hHeight hBound + apply ih (h + 1) H hHeight + have heq : 1 + (h + 1) = 1 + (1 + h) := by omega + rw [heq,pow_two_one_add (1 + h)]; omega + | pair1 _ ih => + intro h H hHeight hBound + apply ih (h + 1) H hHeight + have heq : 1 + (h + 1) = 1 + (1 + h) := by omega + rw [heq,pow_two_one_add (1 + h)]; omega + | short00 _ ih => + intro h H hHeight hBound + cases h with + | zero => contradiction + | succ h => + apply ih h H hHeight + have heq : 1 + (h + 1) = 1 + (1 + h) := by omega + rw [heq,pow_two_one_add (1 + h),pow_two_one_add h] at hBound + rw [pow_two_one_add h]; omega + | short01 _ ih => + intro h H hHeight hBound + cases h with + | zero => contradiction + | succ h => + apply ih h H hHeight + have heq : 1 + (h + 1) = 1 + (1 + h) := by omega + rw [heq,pow_two_one_add (1 + h),pow_two_one_add h] at hBound + rw [pow_two_one_add h]; omega + | short10 _ ih => + intro h H hHeight hBound + cases h with + | zero => contradiction + | succ h => + apply ih h H hHeight + have heq : 1 + (h + 1) = 1 + (1 + h) := by omega + rw [heq,pow_two_one_add (1 + h),pow_two_one_add h] at hBound + rw [pow_two_one_add h]; omega + | short11 _ ih => + intro h H hHeight hBound + cases h with + | zero => contradiction + | succ h => + apply ih h H hHeight + have heq : 1 + (h + 1) = 1 + (1 + h) := by omega + rw [heq,pow_two_one_add (1 + h),pow_two_one_add h] at hBound + rw [pow_two_one_add h]; omega + +theorem bscan_bound_lt_of_ne_nil {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (hI : BScan k u k' v a b) : + ∀ (h H : Nat),heightShift v h = some H -> u ≠ [] -> k <= 2 ^ (1 + h) -> k' < 2 ^ (1 + H) := by + cases hI with + | nil _ => intro _ _ _ hNe _; exact False.elim (hNe rfl) + | T hSub => + intro h H hHeight _ hBound + apply bscan_bound_lt hSub (h + 1) H hHeight + have heq : 1 + (h + 1) = 1 + (1 + h) := by omega + rw [heq,pow_two_one_add (1 + h)]; omega + | pair0 hSub => + intro h H hHeight _ hBound + apply bscan_bound_lt hSub (h + 1) H hHeight + have heq : 1 + (h + 1) = 1 + (1 + h) := by omega + rw [heq,pow_two_one_add (1 + h)]; omega + | pair1 hSub => + intro h H hHeight _ hBound + apply bscan_bound_lt hSub (h + 1) H hHeight + have heq : 1 + (h + 1) = 1 + (1 + h) := by omega + rw [heq,pow_two_one_add (1 + h)]; omega + | short00 hSub => + intro h H hHeight _ hBound + cases h with + | zero => contradiction + | succ h => + apply bscan_bound_lt hSub h H hHeight + have heq : 1 + (h + 1) = 1 + (1 + h) := by omega + rw [heq,pow_two_one_add (1 + h),pow_two_one_add h] at hBound + rw [pow_two_one_add h]; omega + | short01 hSub => + intro h H hHeight _ hBound + cases h with + | zero => contradiction + | succ h => + apply bscan_bound_lt hSub h H hHeight + have heq : 1 + (h + 1) = 1 + (1 + h) := by omega + rw [heq,pow_two_one_add (1 + h),pow_two_one_add h] at hBound + rw [pow_two_one_add h]; omega + | short10 hSub => + intro h H hHeight _ hBound + cases h with + | zero => contradiction + | succ h => + apply bscan_bound_lt hSub h H hHeight + have heq : 1 + (h + 1) = 1 + (1 + h) := by omega + rw [heq,pow_two_one_add (1 + h),pow_two_one_add h] at hBound + rw [pow_two_one_add h]; omega + | short11 hSub => + intro h H hHeight _ hBound + cases h with + | zero => contradiction + | succ h => + apply bscan_bound_lt hSub h H hHeight + have heq : 1 + (h + 1) = 1 + (1 + h) := by omega + rw [heq,pow_two_one_add (1 + h),pow_two_one_add h] at hBound + rw [pow_two_one_add h]; omega + +def HasVPrefixK (u : WordList) : Prop := + ∃ p w,u = List.replicate (1 + p) V ++ K :: w + +theorem hasVPrefixK_append (u v : WordList) (h : HasVPrefixK u) : HasVPrefixK (u ++ v) := by + rcases h with ⟨p,w,rfl⟩ + exact ⟨p,w ++ v,by simp [List.append_assoc]⟩ + +theorem bscan_four_vPrefixK (p : Nat) (u : WordList) (k : Nat) (v : WordList) (a b : Rat) + (hI : BScan 4 (List.replicate (1 + p) V ++ K :: u) k v a b) : + ∃ w a' b',v = List.replicate (1 + p) V ++ K :: w /\ BScan (2 ^ (1 + p)) u k w a' b' := by + rcases bscan_split hI (List.replicate (1 + p) V) (K :: u) rfl (Or.inl (notEndsWithQ_replicate_V (1 + + p))) + with ⟨m,x,y,_,_,_,_,hJ,hK,rfl,_,_⟩ + rcases bscan_replicate_V (1 + p) 4 m x _ _ hJ with ⟨rfl,hEq,_,_⟩ + have hm : m = 2 + 2 ^ (1 + p) * 2 := by + rw [pow_two_one_add p] at hEq ⊢; omega + cases hK with + | @short00 n _ _ w0 a0 b0 hSub => + have hn : n * 2 = 2 ^ (1 + p) := by + rw [pow_two_one_add p] at hm ⊢; omega + rw [hn] at hSub + exact ⟨w0,a0,b0,rfl,hSub⟩ + | @short10 n _ _ _ _ _ _ => + rw [pow_two_one_add p] at hm; omega + +theorem hasQKSubword_replicate_V_append (p : Nat) (u : WordList) : hasQKSubword (List.replicate p V + ++ u) = hasQKSubword u := by + induction p with + | zero => rfl + | succ p ih => exact ih + +theorem bscan_four_preserves_vPrefixK {orig : WordList} {k : Nat} {v : WordList} {a b : Rat} {J : + Nat} + (hI : BScan 4 orig k v a b) (hGu : HasVPrefixK orig) (hPair : hasQKSubword orig = true) + (hHeight : heightShift v 0 = some J) : + HasVPrefixK (V :: v) /\ k < 2 ^ (1 + J) := by + rcases hGu with ⟨p,u,rfl⟩ + rcases bscan_four_vPrefixK p u k v a b hI with ⟨w,a',b',rfl,hS⟩ + refine ⟨⟨1 + p,w,?_⟩,?_⟩ + · have hrep : List.replicate (1 + (1 + p)) V = V :: List.replicate (1 + p) V := by + rw [Nat.add_comm 1 (1 + p),List.replicate_succ] + rw [hrep,List.cons_append] + · have hH : heightShift w p = some J := by + rcases heightShift_append (List.replicate (1 + p) V) (K :: w) 0 J hHeight with ⟨j,h1,h2⟩ + rw [heightShift_replicate_V] at h1 + injection h1 with h1; subst h1 + have hp : 0 + (1 + p) = p + 1 := by omega + rw [hp] at h2 + exact h2 + have hNe : u ≠ [] := by + intro hEmpty + subst hEmpty + rw [hasQKSubword_replicate_V_append] at hPair + contradiction + exact bscan_bound_lt_of_ne_nil hS p J hH hNe (by omega) + +theorem digitVal_mod_four_one {n H : Nat} {ds : WordList} (hD : DigitVal (1 + n * 4) H ds) (hH : 2 + <= H) : + ∃ w,ds = Q :: K :: w := by + generalize hA_eq : 1 + n * 4 = A at hD + cases hD with + | nil => omega + | zero _ => omega + | @one A1 H1 u1 hD1 => + have hA1 : A1 = n * 2 := by omega + subst hA1 + generalize hA1_eq : n * 2 = A1' at hD1 + cases hD1 with + | nil => omega + | @zero A2 H2 w _ => exact ⟨w,rfl⟩ + | one _ => omega + +theorem digitVal_suffix_six_Q {B H : Nat} {ds : WordList} {unit : Rat} + (hD : DigitVal B H ds) (hU : 0 < unit) + (hHeight : unit * ((2 ^ H : Nat) : Rat) = 1) + (hZ : 2 <= wordMassK ds) + (hSmall : unit * (1 + wordMassK ds) <= 1 / 64) : + ∃ rest,ds = rest ++ List.replicate 6 Q := by + have hH6 : 6 <= H := by + by_contra hlt + have hle : H <= 5 := by omega + have hpow_le : 2 ^ H <= 32 := by + calc 2 ^ H <= 2 ^ 5 := Nat.pow_le_pow_right (by decide) hle + _ = 32 := by decide + have hpow_q : ((2 ^ H : Nat) : Rat) <= 32 := by exact_mod_cast hpow_le + nlinarith + have hShift : unit * ((2 ^ (H - 6) : Nat) : Rat) = 1 / 64 := by + have heq : H = (H - 6) + 6 := by omega + have hpow : 2 ^ H = 2 ^ (H - 6) * 64 := by + rw [heq,Nat.pow_add]; rfl + have hpow_q : ((2 ^ H : Nat) : Rat) = ((2 ^ (H - 6) : Nat) : Rat) * 64 := by + exact_mod_cast hpow + rw [hpow_q] at hHeight + linarith + have hEq := digitVal_wordMassK_eq hD + have hH_split : (H - 6) + 6 = H := by omega + have hD' : DigitVal B ((H - 6) + 6) ds := by rwa [hH_split] + apply digitVal_high_ones_suffix (H - 6) 6 B ds hD' + have hL_q : ((2 ^ ((H - 6) + 6) : Nat) : Rat) <= ((B + 2 ^ (H - 6) : Nat) : Rat) := by + rw [hH_split] + push_cast at hEq hShift ⊢ + nlinarith + exact_mod_cast hL_q + +inductive BGood : WordList -> Prop where + | intro (H : Nat) (u : WordList) (A : Nat) (ds : WordList) : + DigitVal A H ds -> + wordScale u * ((2 ^ H : Nat) : Rat) = 1 / 2 -> + HasVPrefixK u -> + (∃ w,u = w ++ [V]) -> + (∃ w,ds = Q :: K :: w) -> + (∃ w,ds = w ++ List.replicate 6 Q) -> + 3 * wordMass u + wordMassK u + wordScale u * wordMassK ds <= 1 / 64 -> + BGood (u ++ ds) + +inductive BStep : WordList -> WordList -> Prop where + | intro (orig : WordList) (n : Nat) (v : WordList) (a b : Rat) (J : Nat) (ds : WordList) : + BScan 4 (orig ++ [K]) (n * 2) v a b -> + DigitVal (1 + n) J ds -> + BStep orig (V :: (v ++ ds)) + +set_option maxHeartbeats 800000 in +-- Justification: non-linear rational potential bound across BStep transition. +theorem bstep_of_bgood {orig : WordList} (hG : BGood orig) : + ∃ out,BStep orig out /\ BGood out := by + rcases hG with ⟨H,u,A,ds,hDig,hHeight,hGu,_,hLow,hHigh,hPhi⟩ + have hWu := wordMass_nonneg u + have hWd := wordMass_nonneg ds + have hSu := wordScale_pos u + rcases bscan_four_split hDig hHeight hPhi hLow with ⟨k,v,a,b,hI,_,hAp,hMass,hEnergy⟩ + have hMassSmall : wordMass v < 1 := by nlinarith + have hMassSmall0 : wordMass v < ((2 ^ 0 : Nat) : Rat) := by push_cast; exact hMassSmall + rcases exists_heightShift_of_mass_lt v 0 hMassSmall0 with ⟨J,hHv⟩ + have hUnit := heightShift_sound v 0 J hHv + have hUnit1 : wordScale v * ((2 ^ J : Nat) : Rat) = 1 := by + have h20 : ((2 ^ 0 : Nat) : Rat) = 1 := rfl + rwa [h20] at hUnit + rcases hHigh with ⟨hi,hHi⟩ + have hIH : BScan 4 ((u ++ hi ++ [Q]) ++ List.replicate (1 + 2 * 2) Q ++ [K]) k v a b := by + have h6 : List.replicate 6 Q = [Q] ++ List.replicate (1 + 2 * 2) Q := rfl + rw [hHi,h6] at hI + simpa [List.append_assoc] using hI + rcases bscan_replicate_Q_K 2 4 (u ++ hi ++ [Q]) k v a b hIH with ⟨last,n,hV,rfl⟩ + have hJ3 : 3 <= J := by + apply le_of_heightShift_replicate_V last 3 0 J + rw [<- hV]; exact hHv + have hPair : hasQKSubword (u ++ ds ++ [K]) = true := by + rcases hLow with ⟨w,rfl⟩ + have h10 : hasQKSubword (Q :: K :: w ++ [K]) = true := rfl + have heq : u ++ (Q :: K :: w) ++ [K] = u ++ (Q :: K :: w ++ [K]) := by simp [List.append_assoc] + rw [heq] + exact hasQKSubword_append_right u _ h10 + rcases bscan_four_preserves_vPrefixK hI (hasVPrefixK_append (u ++ + ds) [K] (hasVPrefixK_append u ds hGu)) hPair hHv with ⟨hGuardV,hUpper⟩ + have hPow : 2 ^ J = 8 * 2 ^ (J - 3) := by + have heq : J = 3 + (J - 3) := by omega + conv_lhs => rw [heq,Nat.pow_add] + have hPow1 : 2 ^ (1 + J) = 16 * 2 ^ (J - 3) := by + have heq : 1 + J = 4 + (J - 3) := by omega + conv_lhs => rw [heq,Nat.pow_add] + have hBound : 1 + n * 4 < 2 ^ J := by + rw [hPow1] at hUpper + rw [hPow] + have : n * (2 ^ (1 + 2)) = n * 8 := rfl + (try omega) + rcases exists_digitVal_of_lt_pow J (1 + n * 4) hBound with ⟨ds',hD'⟩ + have hLow' : ∃ w,ds' = Q :: K :: w := digitVal_mod_four_one hD' (by omega) + have hDef := digitVal_wordMassK_eq hD' + have hBudget := bscan_scale_eq hI + have hDeficit : wordScale v * wordMassK ds' = a - b - 3 * wordScale v := by + have h1n4 : ((1 + n * 4 : Nat) : Rat) = 1 + (n : Rat) * 4 := by push_cast; ring + have hn8 : ((n * 2 ^ (1 + 2) : Nat) : Rat) = (n : Rat) * 8 := by push_cast; ring + have h4 : ((4 : Nat) : Rat) = 4 := rfl + rw [h1n4] at hDef + rw [hn8,h4] at hBudget + have hSv_def : wordScale v * (wordMassK ds' + (1 + (n : Rat) * 4) + 1) = 1 := by + rw [hDef]; exact hUnit1 + nlinarith + have hPhiNew : 3 * wordMass (V :: v) + wordMassK (V :: v) + wordScale (V :: v) * wordMassK ds' <= + (7 / 8) * (3 * wordMass u + wordMassK u + wordScale u * wordMassK ds) := by + have hSv := wordScale_pos v + have hSplit := wordMass_eq_add v + dsimp [wordMass,wordMassK,wordScale] + nlinarith + have hHigh' : ∃ w,ds' = w ++ List.replicate 6 Q := by + refine digitVal_suffix_six_Q hD' (wordScale_pos v) hUnit1 ?_ ?_ + · rcases hLow' with ⟨w,rfl⟩ + have hw := wordMass_nonneg w + dsimp [wordMassK]; linarith + · have hBnd := bscan_mass_bounds hI + have hSv := wordScale_pos v + nlinarith + refine ⟨V :: (v ++ ds'),?_,?_⟩ + · refine BStep.intro (u ++ ds) (n * 4) v a b J ds' ?_ hD' + have heq : (n * 4) * 2 = n * 2 ^ (1 + 2) := by ring + rw [heq] + simpa [List.append_assoc] using hI + · have hOut_eq : V :: (v ++ ds') = (V :: v) ++ ds' := rfl + rw [hOut_eq] + refine BGood.intro J (V :: v) (1 + n * 4) ds' hD' ?_ hGuardV ?_ hLow' hHigh' (by linarith) + · dsimp [wordScale]; linarith + · refine ⟨V :: (last ++ [V, V]),?_⟩ + rw [hV]; simp [List.replicate,List.append_assoc] + +theorem brIncs_of_bscan {a : Nat} {u : WordList} {b : Nat} {v : WordList} {lp lm : Rat} + (h : BScan a u b v lp lm) : + ∀ {r r' : HalfTape},BRIncs b r r' -> BRIncs a (evalWords u r) (evalWords v r') := by + induction h with + | nil _ => intro r r' hR; exact hR + | T _ ih => intro r r' hR; exact BRIncs.T (ih hR) + | pair0 _ ih => intro r r' hR; exact BRIncs.pair0 (ih hR) + | pair1 _ ih => intro r r' hR; exact BRIncs.pair1 (ih hR) + | short00 _ ih => intro r r' hR; exact BRIncs.short00 (ih hR) + | short01 _ ih => intro r r' hR; exact BRIncs.short01 (ih hR) + | short10 _ ih => intro r r' hR; exact BRIncs.short10 (ih hR) + | short11 _ ih => intro r r' hR; exact BRIncs.short11 (ih hR) + +theorem evalWords_zero_digitVal {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hZ : A = 0) : + evalWords da default = default := by + induction hD with + | nil => rfl + | @zero A H u _ ih => + have hA0 : A = 0 := by omega + change d0 +> evalWords u default = default + rw [ih hA0,append_d0_default] + | one _ => omega + +theorem brIncs_of_digitVal_pos {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hPos : 0 < A) : + BRIncs ((A - 1) * 2) default (evalWords da default) := by + induction hD with + | nil => omega + | @zero A H u _ ih => + have hA_pos : 0 < A := by omega + have hIH := ih hA_pos + have hs := BRIncs.short00 hIH + rw [append_d0_default] at hs + have heq : (A * 2 - 1) * 2 = 2 + (A - 1) * 4 := by omega + dsimp [evalWords] + rwa [heq] + | @one A H u hDu ih => + cases A with + | zero => + change BRIncs 0 default (d1 +> evalWords u default) + rw [evalWords_zero_digitVal hDu rfl] + have h0 := BRIncs.zero (default : HalfTape) + have hd : d1 +> (default : HalfTape) = one +> default := by simp + rw [hd]; exact h0 + | succ A => + have hA_pos : 0 < A + 1 := by omega + have hIH := ih hA_pos + have heq_in : (A + 1 - 1) * 2 = A * 2 := by omega + rw [heq_in] at hIH + have hs := BRIncs.short10 hIH + rw [append_d0_default] at hs + have heq : (1 + (A + 1) * 2 - 1) * 2 = 4 + A * 4 := by omega + dsimp [evalWords] + rwa [heq] + +theorem brIncs_of_bstep {orig out : WordList} (hS : BStep orig out) : + ∃ r,BRIncs 4 (evalWords orig default) r /\ evalWords out default = t +> r := by + rcases hS with ⟨n,v,a,b,J,ds,hI,hD⟩ + refine ⟨evalWords v (evalWords ds default),?_,?_⟩ + · have hB : BRIncs (n * 2) default (evalWords ds default) := by + have heq : n * 2 = ((1 + n) - 1) * 2 := by omega + rw [heq] + exact brIncs_of_digitVal_pos hD (by omega) + have hR := brIncs_of_bscan hI hB + simpa [evalWords_append,evalWords] using hR + · simp [evalWords_append,evalWords] + +def buildPrefix : Nat -> Nat -> Option (WordList) + | 0,_ => none + | _ + 1,0 => none + | _ + 1,1 => some [Q] + | fuel + 1,m + 2 => + match buildPrefix fuel ((m + 2) / 2) with + | none => none + | some ws => some ((if (m + 2) % 2 == 0 then K else Q) :: ws) + +theorem binary_of_buildPrefix (fuel : Nat) : + ∀ (m : Nat) (ws : WordList),buildPrefix fuel m = some ws -> + ∃ H,Binary m H (evalWords ws default) := by + induction fuel with + | zero => intro m ws h; contradiction + | succ fuel ih => + intro m ws h + rcases m with _ | _ | m + · contradiction + · injection h with h; subst h + exact ⟨1,Binary.one⟩ + · dsimp [buildPrefix] at h + cases hrec : buildPrefix fuel ((m + 2) / 2) with + | none => rw [hrec] at h; contradiction + | some ws' => + rw [hrec] at h + injection h with h; subst h + rcases ih ((m + 2) / 2) ws' hrec with ⟨H,hB⟩ + have hq : (m + 2) / 2 = 1 + ((m + 2) / 2 - 1) := by omega + rw [hq] at hB + rcases Nat.mod_two_eq_zero_or_one (m + 2) with hmod | hmod + · have hcond : ((m + 2) % 2 == 0) = true := beq_iff_eq.mpr hmod + rw [hcond]; dsimp [evalWords] + refine ⟨1 + H,?_⟩ + have heq : m + 2 = 2 + ((m + 2) / 2 - 1) * 2 := by omega + rw [heq]; exact Binary.zero hB + · have hcond : ((m + 2) % 2 == 0) = false := beq_false_of_ne (by omega) + rw [hcond]; dsimp [evalWords] + refine ⟨1 + H,?_⟩ + have heq : m + 2 = 3 + ((m + 2) / 2 - 1) * 2 := by omega + rw [heq]; exact Binary.two hB + +def choiceNextA : ChoiceE -> Nat -> Nat + | CT,n | CP0,n | CP1,n => 1 + n + | CS00,n | CS01,n => 2 + n * 4 + | CS10,n | CS11,n => 4 + n * 4 + +def choiceNextB : ChoiceE -> Nat -> Nat + | CT,n | CP0,n | CS00,n | CS10,n => n * 2 + | CP1,n | CS01,n | CS11,n => 1 + n * 2 + +def evalCodeAux : CodeE -> Nat -> WordList -> Option (WordList) + | .Stop n,k,u => + if k == n * 2 then + if u.all isWordK then buildPrefix 64 (1 + n) else none + else none + | .More ch n c,k,u => + if k == choiceNextA ch n then + match stripWordPrefix (choiceInWordsE ch) u with + | none => none + | some w => + match evalCodeAux c (choiceNextB ch n) w with + | none => none + | some v => some (choiceOutWordE ch :: v) + else none + +theorem brIncs_of_evalCodeAux (c : CodeE) : + ∀ (k : Nat) (u v : WordList),evalCodeAux c k u = some v -> + BRIncs k (evalWords u default) (evalWords v default) := by + induction c with + | Stop n => + intro k u v hE + dsimp [evalCodeAux] at hE + cases hk : (k == n * 2) with + | false => rw [hk] at hE; contradiction + | true => + rw [hk] at hE + have rfl_k : k = n * 2 := beq_iff_eq.mp hk + subst rfl_k + cases hu : u.all isWordK with + | false => rw [hu] at hE; contradiction + | true => + rw [hu] at hE + dsimp at hE + rw [evalWords_default_of_all_K u hu] + rcases binary_of_buildPrefix 64 (1 + n) v hE with ⟨H,hB⟩ + have hR := brIncs_of_binary hB + have heq : ((1 + n) - 1) * 2 = n * 2 := by omega + rwa [heq] at hR + | More ch n c ih => + intro k u v hE + dsimp [evalCodeAux] at hE + cases hk : (k == choiceNextA ch n) with + | false => rw [hk] at hE; contradiction + | true => + rw [hk] at hE + dsimp at hE + have rfl_k : k = choiceNextA ch n := beq_iff_eq.mp hk + subst rfl_k + cases hU : stripWordPrefix (choiceInWordsE ch) u with + | none => rw [hU] at hE; contradiction + | some w => + rw [hU] at hE + dsimp at hE + cases hC : evalCodeAux c (choiceNextB ch n) w with + | none => rw [hC] at hE; contradiction + | some x => + rw [hC] at hE + injection hE with hE; subst hE + have rfl_u := stripWordPrefix_sound (choiceInWordsE ch) u w hU + subst rfl_u + have hIH := ih (choiceNextB ch n) w x hC + cases ch + · exact BRIncs.T hIH + · exact BRIncs.pair0 hIH + · exact BRIncs.pair1 hIH + · exact BRIncs.short00 hIH + · exact BRIncs.short01 hIH + · exact BRIncs.short10 hIH + · exact BRIncs.short11 hIH + +def evalCodeStep (c : CodeE) (u : WordList) : Option (WordList) := + match evalCodeAux c 4 (u ++ [K]) with + | some v => some (V :: v) + | none => none + +theorem brIncs_of_evalCodeStep (c : CodeE) (u v : WordList) (h : evalCodeStep c u = some v) : + ∃ r,BRIncs 4 (evalWords u default) r /\ evalWords v default = t +> r := by + dsimp [evalCodeStep] at h + cases hE : evalCodeAux c 4 (u ++ [K]) with + | none => rw [hE] at h; contradiction + | some w => + rw [hE] at h + injection h with h; subst h + refine ⟨evalWords w default,?_,rfl⟩ + have hR := brIncs_of_evalCodeAux c 4 (u ++ [K]) w hE + simpa [evalWords_append,evalWords] using hR + +inductive Rounds : HalfTape -> HalfTape -> Prop where + | refl (r : HalfTape) : Rounds r r + | next {r s t0 : HalfTape} : + BRIncs 4 r s -> Rounds (t +> s) t0 -> Rounds r t0 + +def evalCodeList : List CodeE -> WordList -> Option (WordList) + | [],u => some u + | c :: cs,u => + match evalCodeStep c u with + | none => none + | some v => evalCodeList cs v + +theorem rounds_of_evalCodeList (cs : List CodeE) : + ∀ (u v : WordList),evalCodeList cs u = some v -> + Rounds (evalWords u default) (evalWords v default) := by + induction cs with + | nil => + intro u v h + injection h with h; subst h + exact Rounds.refl _ + | cons c cs ih => + intro u v h + dsimp [evalCodeList] at h + cases hW : evalCodeStep c u with + | none => rw [hW] at h; contradiction + | some w => + rw [hW] at h + rcases brIncs_of_evalCodeStep c u w hW with ⟨r,hR,hEq⟩ + refine Rounds.next hR ?_ + rw [<- hEq] + exact ih w v h + +theorem bgood_of_checks (u ds : WordList) (p : Nat) + (hD : ds.all isDigitWord = true) + (hS : wordScale u * wordScale ds = 1 / 2) + (hGu : u = List.replicate (1 + p) V ++ K :: u.drop (2 + p)) + (hEnd : u = u.take (u.length - 1) ++ [V]) + (hLo : ds = Q :: K :: ds.drop 2) + (hHi : ds = ds.take (ds.length - 6) ++ List.replicate 6 Q) + (hF : 3 * wordMass u + wordMassK u + wordScale u * wordMassK ds <= 1 / 64) : + BGood (u ++ ds) := by + rcases exists_digitVal_of_all_isDigitWord ds hD with ⟨A,hI⟩ + refine BGood.intro ds.length u A ds hI ?_ ⟨p,u.drop (2 + p),hGu⟩ + ⟨u.take (u.length - 1),hEnd⟩ ⟨ds.drop 2,hLo⟩ ⟨ds.take (ds.length - 6),hHi⟩ hF + rw [<- (digitVal_scale_and_mass hI).1] + exact hS + + +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) + +def NumRel (stepRel : Call -> HalfTape -> HalfTape -> Prop) (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs, Num k w hs -> Side stepRel hs (w +> r) r' + +theorem numRel_zero_inv {stepRel : Call -> HalfTape -> HalfTape -> Prop} + {r r' : HalfTape} (h : NumRel stepRel 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl + +theorem numRel_T {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) {n : Nat} {r r' : HalfTape} + (hI : NumRel stepRel (n * 2) r r') : NumRel stepRel (1 + n) (t +> r) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil] + cases m with + | zero => + have hn0 : n * 2 = 0 := by omega + rw [hn0] at hI + have hr' := numRel_zero_inv hI + subst hr' + rw [<- append_assoc t one r] + exact seg_apply rules.cp_t (Side.nil r) + | succ m => + have h1m : m + 1 = 1 + m := by omega + rw [h1m] + refine seg_apply (seg_cp_ch_t rules m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : n * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil] + refine seg_apply (seg_cj_ch_t rules m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (m * 2)) := by + have hm : n * 2 = 2 + (m * 2) * 2 := by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 + +theorem numRel_pair0 {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) {n : Nat} {r r' : HalfTape} + (hI : NumRel stepRel (n * 2) r r') : NumRel stepRel (1 + n) (d1 +> (d0 +> r)) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil, <- append_assoc d1 d0 r] + cases m with + | zero => + have hn0 : n * 2 = 0 := by omega + rw [hn0] at hI + have hr' := numRel_zero_inv hI + subst hr' + rw [<- append_assoc t one r] + exact seg_apply rules.cp_d1_d0 (Side.nil r) + | succ m => + have h1m : m + 1 = 1 + m := by omega + rw [h1m] + refine seg_apply (seg_cp_ch_d1_d0 rules m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : n * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil, <- append_assoc d1 d0 r] + refine seg_apply (seg_cj_ch_d1_d0 rules m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (m * 2)) := by + have hm : n * 2 = 2 + (m * 2) * 2 := by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 + +theorem numRel_pair1 {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) {n : Nat} {r r' : HalfTape} + (hI : NumRel stepRel (1 + n * 2) r r') : + NumRel stepRel (1 + n) (d1 +> (d1 +> r)) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil, <- append_assoc d1 d1 r] + refine seg_apply (seg_cp_ch_d1_d1 rules m) ?_ + have hN1 : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ (m * 2)) := by + have hm : 1 + n * 2 = 1 + (m * 2) * 2 := by omega + rw [hm]; exact Num.odd (m * 2) + simpa using hI [] _ hN1 + | @even m => + simp only [append_nil, <- append_assoc d1 d1 r] + refine seg_apply (seg_cj_ch_d1_d1 rules m) ?_ + have hN1 : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ (1 + m * 2)) := by + have hm : 1 + n * 2 = 1 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.odd (1 + m * 2) + simpa using hI [] _ hN1 + +theorem numRel_short00 {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) {n : Nat} {r r' : HalfTape} + (hI : NumRel stepRel (n * 2) r r') : NumRel stepRel (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := numRel_zero_inv hI + subst hr' + rw [<- append_assoc d0 one r] + exact seg_apply rules.cj_d0 (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine seg_apply (seg_cj_ch_d0_d0 rules n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using hI [] _ hN2 + +theorem numRel_short01 {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) {n : Nat} {r r' : HalfTape} + (hI : NumRel stepRel (1 + n * 2) r r') : + NumRel stepRel (2 + n * 4) (d1 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + refine seg_apply (seg_cj_ch_d1_d0_half rules n) ?_ + simpa using hI [] _ (Num.odd n) + +theorem numRel_short10 {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) {n : Nat} {r r' : HalfTape} + (hI : NumRel stepRel (n * 2) r r') : NumRel stepRel (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := numRel_zero_inv hI + subst hr' + rw [<- append_assoc d1 one r] + exact seg_apply (seg_cj_ch_d0_one rules) (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine seg_apply (seg_cj_ch_d0_d1 rules n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using hI [] _ hN2 + +theorem numRel_short11 {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) {n : Nat} {r r' : HalfTape} + (hI : NumRel stepRel (1 + n * 2) r r') : + NumRel stepRel (4 + n * 4) (d1 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + refine seg_apply (seg_cj_ch_d1_d1_half rules n) ?_ + simpa using hI [] _ (Num.odd n) + +theorem numRel_of_brIncs {stepRel : Call -> HalfTape -> HalfTape -> Prop} + (rules : SegRules stepRel) {k : Nat} {r r' : HalfTape} (hI : BRIncs k r r') : + NumRel stepRel k r r' := by + induction hI with + | zero r => + intro w hs hN + generalize hk : 0 = k0 at hN + cases hN with + | zero => exact Side.nil (one +> r) + | odd _ => omega + | even _ => omega + | T _ ih => exact numRel_T rules ih + | pair0 _ ih => exact numRel_pair0 rules ih + | pair1 _ ih => exact numRel_pair1 rules ih + | short00 _ ih => exact numRel_short00 rules ih + | short01 _ ih => exact numRel_short01 rules ih + | short10 _ ih => exact numRel_short10 rules ih + | short11 _ ih => exact numRel_short11 rules ih + +theorem brIncs4_step {tm : Machine (Fin 2) (Fin 6)} + {cR : HalfTape -> Call -> HalfTape -> Cfg (Fin 2) (Fin 6)} + {cL : HalfTape -> HalfTape -> Cfg (Fin 2) (Fin 6)} + (rules : SegRules (CallStep tm cR cL)) + (h_cl_to_cf : ∀ r, (cL lh r) [tm]⊢⁺ (cR lh .ca r)) + {r r' : HalfTape} (hI : BRIncs 4 r r') : + (cR lh .ca r) [tm]⊢⁺ (cR lh .ca (t +> r')) := by + have hC := numRel_of_brIncs rules hI [] ([.cj] ++ [.ch] ^ 1) (Num.even 1) + have hS := seg_apply rules.ca_nil hC + dsimp at hS + rcases hS with _ | ⟨hca, hnil⟩ + cases hnil + exact stepPlus_trans (hca lh) (h_cl_to_cf (t +> r')) + +theorem bstep_cfg_step {tm : Machine (Fin 2) (Fin 6)} + {cR : HalfTape -> Call -> HalfTape -> Cfg (Fin 2) (Fin 6)} + {cL : HalfTape -> HalfTape -> Cfg (Fin 2) (Fin 6)} + (rules : SegRules (CallStep tm cR cL)) + (h_cl_to_cf : ∀ r, (cL lh r) [tm]⊢⁺ (cR lh .ca r)) + {orig out : WordList} (hS : BStep orig out) : + (cR lh .ca (evalWords orig default)) [tm]⊢⁺ (cR lh .ca (evalWords out default)) := by + rcases brIncs_of_bstep hS with ⟨r, hI, hEq⟩ + rw [hEq] + exact brIncs4_step rules h_cl_to_cf hI + +theorem rounds_cfg_steps {tm : Machine (Fin 2) (Fin 6)} + {cR : HalfTape -> Call -> HalfTape -> Cfg (Fin 2) (Fin 6)} + {cL : HalfTape -> HalfTape -> Cfg (Fin 2) (Fin 6)} + (rules : SegRules (CallStep tm cR cL)) + (h_cl_to_cf : ∀ r, (cL lh r) [tm]⊢⁺ (cR lh .ca r)) + {r r' : HalfTape} (h : Rounds r r') : + (cR lh .ca r) [tm]⊢* (cR lh .ca r') := by + induction h with + | refl _ => exact ⟨0, rfl⟩ + | next hR _ ih => + rcases brIncs4_step rules h_cl_to_cf hR with ⟨n, _, hn⟩ + rcases ih with ⟨m, hm⟩ + exact ⟨n + m, multiStep_trans tm _ _ _ n m hn hm⟩ + +theorem multiStep_isSome_of_add {tm : Machine (Fin 2) (Fin 6)} + {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep tm c (j + d) = some c') : + (multiStep tm c j).isSome := by + rw [multiStep_add] at h + cases h_j : multiStep tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl + +theorem reach_bgood_at {tm : Machine (Fin 2) (Fin 6)} + {cR : HalfTape -> Call -> HalfTape -> Cfg (Fin 2) (Fin 6)} + {cL : HalfTape -> HalfTape -> Cfg (Fin 2) (Fin 6)} + (rules : SegRules (CallStep tm cR cL)) + (h_cl_to_cf : ∀ r, (cL lh r) [tm]⊢⁺ (cR lh .ca r)) + {r_init : HalfTape} {w_init : WordList} + (h_init : (init []) [tm]⊢⁺ (cR lh .ca r_init)) + (h_rounds : Rounds r_init (evalWords w_init default)) + (h_bgood : BGood w_init) (m : Nat) : + ∃ N ≥ m, ∃ w, multiStep tm (init []) N = some (cR lh .ca (evalWords w default)) /\ BGood w := by + induction m with + | zero => + rcases h_init with ⟨k1, _, hk1⟩ + rcases rounds_cfg_steps rules h_cl_to_cf h_rounds with ⟨k2, hk2⟩ + exact ⟨k1 + k2, Nat.zero_le _, w_init, + multiStep_trans tm _ _ _ k1 k2 hk1 hk2, h_bgood⟩ + | succ m ih => + rcases ih with ⟨N, hN, w, h_ms, h_good⟩ + rcases bstep_of_bgood h_good with ⟨w', hStep, h_good'⟩ + rcases bstep_cfg_step rules h_cl_to_cf hStep with ⟨k, hk_pos, h_step_k⟩ + exact ⟨N + k, Nat.add_le_add hN hk_pos, w', + multiStep_trans tm _ _ _ N k h_ms h_step_k, h_good'⟩ + +theorem does_not_halt_of_segRules {tm : Machine (Fin 2) (Fin 6)} + {cR : HalfTape -> Call -> HalfTape -> Cfg (Fin 2) (Fin 6)} + {cL : HalfTape -> HalfTape -> Cfg (Fin 2) (Fin 6)} + (rules : SegRules (CallStep tm cR cL)) + (h_cl_to_cf : ∀ r, (cL lh r) [tm]⊢⁺ (cR lh .ca r)) + {r_init : HalfTape} {w_init : WordList} + (h_init : (init []) [tm]⊢⁺ (cR lh .ca r_init)) + (h_rounds : Rounds r_init (evalWords w_init default)) + (h_bgood : BGood w_init) : + IsNotHalt tm := by + intro cfg h_reach + rcases h_reach with ⟨n, hn⟩ + rcases reach_bgood_at rules h_cl_to_cf h_init h_rounds h_bgood (n + 1) with ⟨N, hN, _, h_N, _⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := multiStep_isSome_of_add h_N + rw [multiStep_succ, hn] at h_some + exact h_some + +def callState : Call -> Fin 6 + | .ch => B + | .cj => A + | .cp => A + | .ca => A + +def cfgR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + ((l <+ callWord c) {{callState c}}> r) + +def cfgL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (l <{{C}} ([0] +> r)) + +def cfgF (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + cfgR lh .ca r + +syntax "run_0lb" : tactic +macro_rules + | `(tactic| run_0lb) => + `(tactic| ( + dsimp [cfgR, cfgL, callWord, callState, t, d0, d1, one] + try simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute)) + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Justification: symbolic execution of all 15 elementary segment transitions for target_tm. +theorem segRules_0lb : SegRules (CallStep target_tm cfgR cfgL) where + cp_t := seg_step1 (fun _ _ => by run_0lb) + cj_t := seg_step2 (mid := [1, 0, 1, 0]) (fun _ _ => by run_0lb) (fun _ _ => by run_0lb) + ch_t := seg_step3 (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (fun _ _ => by run_0lb) (fun _ _ => by run_0lb) (fun _ _ => by run_0lb) + cp_d1_d0 := seg_step1 (fun _ _ => by run_0lb) + ch_t_one := seg_step3 (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (fun _ _ => by run_0lb) (fun _ _ => by run_0lb) (fun _ _ => by run_0lb) + cj_d1_d0 := seg_step2 (mid := [1, 0, 1, 0]) (fun _ _ => by run_0lb) (fun _ _ => by run_0lb) + cp_d1_d1 := seg_step2 (mid := [1, 0, 1, 0]) (fun _ _ => by run_0lb) (fun _ _ => by run_0lb) + cj_d1_d1 := seg_step3 (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (fun _ _ => by run_0lb) (fun _ _ => by run_0lb) (fun _ _ => by run_0lb) + cj_d0 := seg_step1 (fun _ _ => by run_0lb) + ch_d0_one := seg_step1 (fun _ _ => by run_0lb) + ch_d1_one := seg_step2 (mid := [1, 1]) (fun _ _ => by run_0lb) (fun _ _ => by run_0lb) + cj_d1 := seg_step2 (mid := [1, 1]) (fun _ _ => by run_0lb) (fun _ _ => by run_0lb) + ch_d0 := seg_step1 (fun _ _ => by run_0lb) + ch_d1 := seg_step2 (mid := [1, 1]) (fun _ _ => by run_0lb) (fun _ _ => by run_0lb) + ca_nil := seg_step3_eq (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (fun _ _ => by unfold cfgR callWord callState; simp only [append_cons, append_nil]) + (fun _ _ => by run_0lb) (fun _ _ => by run_0lb) + +theorem cl_to_cf (r : HalfTape) : + (cfgL lh r) [target_tm]⊢⁺ (cfgR lh .ca r) := by + unfold cfgL cfgR lh callWord callState + simp only [append_cons, append_nil] + execute + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 2000000 in +-- Justification: symbolic execution of 58-step initial transition to canonical configuration. +theorem init_to_cf : + (init []) [target_tm]⊢⁺ (cfgR lh .ca default) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + unfold cfgR lh callWord callState + simp only [append_cons, append_nil] + execute + +def initWords : WordList := [] + +def initCodes : List CodeE := [ + (.More CS10 0 (.Stop 0)), + (.More CT 3 (.More CS01 1 (.More CP0 2 (.Stop 2)))), + (.More CT 3 (.More CT 5 (.More CS00 2 (.More CT 3 (.More CS01 1 (.More CP0 2 (.Stop 2))))))), + (.More CT 3 (.More CT 5 (.More CT 9 (.More CS00 4 (.More CT 7 (.More CS00 3 (.More CT 5 (.More + CS01 2 (.More CP0 4 (.Stop 4)))))))))), + (.More CT 3 (.More CT 5 (.More CT 9 (.More CT 17 (.More CS00 8 (.More CT 15 (.More CS00 7 (.More + CT 13 (.More CS00 6 (.More CT 11 (.More CP0 21 (.More CP0 41 (.Stop 41))))))))))))), + (.More CT 3 (.More CT 5 (.More CT 9 (.More CT 17 (.More CT 33 (.More CS00 16 (.More CT 31 (.More + CS00 15 (.More CT 29 (.More CS00 14 (.More CT 27 (.More CT 53 (.More CT 105 (.More CS00 52 + (.More CP0 103 (.More CP0 205 (.More CP0 409 (.Stop 409)))))))))))))))))), + (.More CT 3 (.More CT 5 (.More CT 9 (.More CT 17 (.More CT 33 (.More CT 65 (.More CS00 32 (.More + CT 63 (.More CS00 31 (.More CT 61 (.More CS00 30 (.More CT 59 (.More CT 117 (.More CT 233 + (.More CS00 116 (.More CT 231 (.More CT 461 (.More CT 921 (.More CS00 460 (.More CP0 919 + (.More CS01 459 (.More CP0 918 (.More CS10 458 (.More CS11 228 (.More CP0 456 (.Stop + 456)))))))))))))))))))))))))), + (.More CT 3 (.More CT 5 (.More CT 9 (.More CT 17 (.More CT 33 (.More CT 65 (.More CT 129 (.More + CS00 64 (.More CT 127 (.More CS00 63 (.More CT 125 (.More CS00 62 (.More CT 123 (.More CT 245 + (.More CT 489 (.More CS00 244 (.More CT 487 (.More CT 973 (.More CT 1945 (.More CS00 972 + (.More CT 1943 (.More CS00 971 (.More CT 1941 (.More CP1 3881 (.More CT 7762 (.More CP0 15523 + (.More CS00 7761 (.More CP0 15521 (.More CS00 7760 (.More CP1 15519 (.More CP0 31038 (.Stop + 31038)))))))))))))))))))))))))))))))), + (.More CT 3 (.More CT 5 (.More CT 9 (.More CT 17 (.More CT 33 (.More CT 65 (.More CT 129 (.More CT + 257 (.More CS00 128 (.More CT 255 (.More CS00 127 (.More CT 253 (.More CS00 126 (.More CT 251 + (.More CT 501 (.More CT 1001 (.More CS00 500 (.More CT 999 (.More CT 1997 (.More CT 3993 + (.More CS00 1996 (.More CT 3991 (.More CS00 1995 (.More CT 3989 (.More CT 7977 (.More CT 15953 + (.More CT 31905 (.More CS00 15952 (.More CT 31903 (.More CS00 15951 (.More CT 31901 (.More CT + 63801 (.More CS01 31900 (.More CP1 63800 (.More CP1 127600 (.More CP0 255200 (.More CS10 + 127599 (.More CP0 255197 (.More CS00 127598 (.More CS11 63798 (.More CP1 127596 (.More CP0 + 255192 (.Stop 255192))))))))))))))))))))))))))))))))))))))))))), + (.More CT 3 (.More CT 5 (.More CT 9 (.More CT 17 (.More CT 33 (.More CT 65 (.More CT 129 (.More CT + 257 (.More CT 513 (.More CS00 256 (.More CT 511 (.More CS00 255 (.More CT 509 (.More CS00 254 + (.More CT 507 (.More CT 1013 (.More CT 2025 (.More CS00 1012 (.More CT 2023 (.More CT 4045 + (.More CT 8089 (.More CS00 4044 (.More CT 8087 (.More CS00 4043 (.More CT 8085 (.More CT 16169 + (.More CT 32337 (.More CT 64673 (.More CS00 32336 (.More CT 64671 (.More CS00 32335 (.More CT + 64669 (.More CT 129337 (.More CS00 64668 (.More CT 129335 (.More CT 258669 (.More CT 517337 + (.More CS01 258668 (.More CT 517336 (.More CS10 258667 (.More CS01 129333 (.More CT 258666 + (.More CT 517331 (.More CP0 1034661 (.More CS00 517330 (.More CS11 258664 (.More CP0 517328 + (.More CS11 258663 (.More CP0 517326 (.More CS10 258662 (.More CP0 517323 (.More CS00 258661 + (.More CP1 517321 (.More CP1 1034642 (.More CP0 2069284 (.Stop + 2069284)))))))))))))))))))))))))))))))))))))))))))))))))))))))), + (.More CT 3 (.More CT 5 (.More CT 9 (.More CT 17 (.More CT 33 (.More CT 65 (.More CT 129 (.More CT + 257 (.More CT 513 (.More CT 1025 (.More CS00 512 (.More CT 1023 (.More CS00 511 (.More CT 1021 + (.More CS00 510 (.More CT 1019 (.More CT 2037 (.More CT 4073 (.More CS00 2036 (.More CT 4071 + (.More CT 8141 (.More CT 16281 (.More CS00 8140 (.More CT 16279 (.More CS00 8139 (.More CT + 16277 (.More CT 32553 (.More CT 65105 (.More CT 130209 (.More CS00 65104 (.More CT 130207 + (.More CS00 65103 (.More CT 130205 (.More CT 260409 (.More CS00 130204 (.More CT 260407 (.More + CT 520813 (.More CT 1041625 (.More CS00 520812 (.More CT 1041623 (.More CP0 2083245 (.More CT + 4166489 (.More CT 8332977 (.More CT 16665953 (.More CS00 8332976 (.More CS11 4166487 (.More CT + 8332974 (.More CS11 4166486 (.More CT 8332972 (.More CS11 4166485 (.More CT 8332970 (.More + CS10 4166484 (.More CT 8332967 (.More CT 16665933 (.More CT 33331865 (.More CP0 66663729 + (.More CP0 133327457 (.More CS00 66663728 (.More CP0 133327455 (.More CS00 66663727 (.More + CS01 33331863 (.More CP0 66663726 (.More CS10 33331862 (.More CP0 66663723 (.More CS00 + 33331861 (.More CS01 16665930 (.More CP1 33331860 (.More CP1 66663720 (.More CP0 133327440 + (.Stop 133327440)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +] + +def initU : WordList := + [V, V, V, V, V, V, V, V, V, V, V, K, V, K, V, K, V, V, V, K, V, V, V, K, V, K, V, V, V, V, K, V, + K, V, V, K, V, V, V, K, V, V, V, V, V, K, Q, V, Q, V, Q, V, Q, V, V, V, V, V, K, V, K, K, V, + Q, V, K, K, V, V, V] + +def initDs : WordList := + [Q, K, K, K, Q, K, Q, K, K, Q, K, Q, K, Q, Q, K, K, Q, K, K, Q, Q, Q, Q, Q, Q, Q] + + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 4000000 in +-- Justification: kernel evaluation of 11-round CodeE trace certificate. +theorem init_rounds : + Rounds default (evalWords (initU ++ initDs) default) := by + have h1 : Rounds (evalWords initWords default) (evalWords (initU ++ initDs) default) := by + apply rounds_of_evalCodeList initCodes + decide + simpa [initWords, evalWords] using h1 + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 4000000 in +-- Justification: rational arithmetic evaluation of wordMass and wordScale on 97-word list. +theorem init_bgood : + BGood (initU ++ initDs) := by + apply bgood_of_checks initU initDs 10 + · decide + · norm_num [initU, initDs, wordScale] + · decide + · decide + · decide + · decide + · norm_num [initU, initDs, wordMass, wordMassK, wordScale] + +end Solution + +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := + does_not_halt_of_segRules segRules_0lb cl_to_cf init_to_cf init_rounds init_bgood + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0LBHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0RAHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0RAHHH.lean new file mode 100644 index 00000000..7574933c --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0RAHHH.lean @@ -0,0 +1,269 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusF +public import BusyBeaver.Calculi.WordCalculusG +public import BusyBeaver.Calculi.WordCalculusH + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0RAHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0RAHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +@[reducible] def tm : Machine (Fin 2) (Fin 6) := target_tm +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 2000000 + +open WordVKQ Word WordVKQ.Traj103 + +abbrev evalCCfgVKQ (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev z0b (c : CCfg) : Option CCfg := Counter.bstep tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (evalCCfgVKQ c1) [tm]⊢⁺ (evalCCfgVKQ c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ + +abbrev pref24 : BitWord := [1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0] + + +def zCs : Call -> Fin 6 + | .ch => B + | .ca => A + +def zCR (w : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([1] +> r) {{zCs c}}> w) + +def zCL (w : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (r <{{C}} ([0] +> w)) + +def zCf (w : HalfTape) : Cfg (Fin 2) (Fin 6) := + (default <{{C}} ([0] +> pref24 +> w)) + +abbrev callStep (c : Call) (w1 w2 : HalfTape) : Prop := + ∀ r, (zCR w1 c r) [tm]⊢⁺ (zCL w2 r) + +abbrev Side := SideP callStep +abbrev Seg := SegP callStep + +theorem seg_ch_V : Seg [.ch] [.ch, .ch] V_u V_u := + segP_of_step_two (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (fun u r => by unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_V : Seg [.ca] [.ch] V_u Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Vp : Seg [.ca] [.ca, .ca] Vp Vp := + segP_of_step_two (mid1 := [0, 1, 1, 1]) (mid2 := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_K : Seg [.ch] [] K_u Q_u := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs K_u Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_Q : Seg [.ch] [.ch] Q_u K_u := + segP_of_step_one (mid := [1, 1]) + (fun u r => by unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL K_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_VpQ : Seg [.ca] [.ca] (Vp ++ Q_u) (Kp ++ Vp) := + segP_of_step_one (mid := [0, 1, 0, 1, 1, 1]) + (fun u r => by unfold zCR zCs Vp Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_KpVp : Seg [.ca] [] (Kp ++ Vp) (Qp ++ Vp) := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs Kp Vp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_QpVp : Seg [.ca] [.ca, .ca] (Qp ++ Vp) (Kp ++ Vp) := + segP_of_step_two (mid1 := [0, 1, 1, 1, 1, 1]) (mid2 := [0, 1, 0, 1, 1, 1]) + (fun u r => by unfold zCR zCs Qp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Kp : Seg [.ca] [] Kp Qp := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs Kp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Qp : Seg [.ca] [.ca] Qp Kp := + segP_of_step_one (mid := [1, 1]) + (fun u r => by unfold zCR zCs Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_KQ : Seg [.ca] [] (K_u ++ Q_u) Vp := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs K_u Q_u Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_QQ : Seg [.ca] [.ca] (Q_u ++ Q_u) Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +-- Turnaround zP0..zP6 +abbrev tr1 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1] +abbrev tr2 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1] +abbrev tr3 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1] +abbrev tr4 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1] +abbrev tr5 : BitWord := [0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1] +abbrev tr6 : BitWord := [0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1] + +theorem zP0 (w : HalfTape) : (zCf w) [tm]⊢⁺ (zCR w .ca (tr1 +> default)) := by + unfold zCf zCR zCs pref24 tr1 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP1 (w : HalfTape) : (zCL w (tr1 +> default)) [tm]⊢⁺ (zCR w .ca (tr2 +> default)) := by + unfold zCL zCR zCs tr1 tr2 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP2 (w : HalfTape) : (zCL w (tr2 +> default)) [tm]⊢⁺ (zCR w .ca (tr3 +> default)) := by + unfold zCL zCR zCs tr2 tr3 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP3 (w : HalfTape) : (zCL w (tr3 +> default)) [tm]⊢⁺ (zCR w .ca (tr4 +> default)) := by + unfold zCL zCR zCs tr3 tr4 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP4 (w : HalfTape) : (zCL w (tr4 +> default)) [tm]⊢⁺ (zCR w .ca (tr5 +> default)) := by + unfold zCL zCR zCs tr4 tr5 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP5 (w : HalfTape) : (zCL w (tr5 +> default)) [tm]⊢⁺ (zCR w .ca (tr6 +> default)) := by + unfold zCL zCR zCs tr5 tr6 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP6 (w : HalfTape) : (zCL w (tr6 +> default)) [tm]⊢⁺ (zCf ([1, 1, 0] +> w)) := by + unfold zCL zCf tr6 pref24 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +-- Section 2: Words, Shift Identity, DigitVal, Parse, Scan, Step +theorem segSpec : SegSpec callStep := + ⟨seg_ch_V, seg_ca_V, seg_ca_Vp, seg_ch_K, seg_ch_Q, + seg_ca_VpQ, seg_ca_KpVp, seg_ca_QpVp, seg_ca_Kp, seg_ca_Qp, + seg_ca_KQ, seg_ca_QQ⟩ + +theorem Side_turnaround {w w' : HalfTape} (h : Side ([Call.ca] ^ 6) w w') : + (zCf w) [tm]⊢⁺ (zCf ([1, 1, 0] +> w')) := by + rcases h with _ | ⟨hc1, h⟩ + rcases h with _ | ⟨hc2, h⟩ + rcases h with _ | ⟨hc3, h⟩ + rcases h with _ | ⟨hc4, h⟩ + rcases h with _ | ⟨hc5, h⟩ + rcases h with _ | ⟨hc6, h⟩ + cases h + exact stepPlus_trans_vkq (zP0 w) + (stepPlus_trans_vkq (hc1 (tr1 +> default)) + (stepPlus_trans_vkq (zP1 _) + (stepPlus_trans_vkq (hc2 (tr2 +> default)) + (stepPlus_trans_vkq (zP2 _) + (stepPlus_trans_vkq (hc3 (tr3 +> default)) + (stepPlus_trans_vkq (zP3 _) + (stepPlus_trans_vkq (hc4 (tr4 +> default)) + (stepPlus_trans_vkq (zP4 _) + (stepPlus_trans_vkq (hc5 (tr5 +> default)) + (stepPlus_trans_vkq (zP5 _) + (stepPlus_trans_vkq (hc6 (tr6 +> default)) (zP6 w')))))))))))) + +theorem Step_exec {u u' : List Word} (h : Step u u') : + (zCf (evalWords u default)) [tm]⊢⁺ (zCf (evalWords u' default)) := by + rcases h with ⟨n, b', v, da, H, g, hScan, hDg, rfl⟩ + have hSeg := Seg_of_Scan segSpec hScan + dsimp at hSeg + have hSide0 := sideP_of_segP hSeg (Side_ca_default segSpec hDg) + rw [wordsToBits_append_tape, evalWords_append, evalWords_replicate_K, wordsToBitsShifted_append_tape, <- evalWordsShifted_append] at hSide0 + have hTurn := Side_turnaround hSide0 + rwa [evalWords_V_shift] at hTurn + +theorem Rounds_exec {u v : List Word} (h : Rounds u v) : + (zCf (evalWords u default)) [tm]⊢* (zCf (evalWords v default)) := by + induction h with + | refl _ => exact ⟨0, rfl⟩ + | next hS _ ih => exact stepStar_of_stepPlus_vkq (stepPlus_stepStar_trans_vkq (Step_exec hS) ih) + +-- Section 3: Universal Parse_V_start, Scan_of_Parse, and Trace Evaluators + +def zInitCCfg : CCfg := ⟨0, 0, [], []⟩ +def zHit6CCfg : CCfg := ⟨2, 0, [], [0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,1]⟩ + +set_option maxRecDepth 200000 in +theorem zCm_init_347 : zCm zInitCCfg 347 = some zHit6CCfg := by decide + +theorem init_to_u0 : (init []) [tm]⊢* zCf (evalWords u_0 default) := by + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = evalCCfgVKQ zInitCCfg := rfl + have h1 : evalCCfgVKQ zHit6CCfg = zCf (evalWords u_0 default) := by + dsimp [evalCCfgVKQ, zHit6CCfg, zCf, pref24, u_0, evalWords, V_u, K_u, Q_u] + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq, default_head_vkq, default_tail_vkq] + have hPlus := zTc (by decide : 0 < 347) zCm_init_347 + rw [<- h0, h1] at hPlus + exact stepStar_of_stepPlus_vkq hPlus + +-- 17 finite rounds u_0 -> u_17 +theorem reach_N (m : Nat) : + ∃ N, m <= N ∧ ∃ u, + multiStep tm (init []) N = some (zCf (evalWords u default)) ∧ + Good u := by + induction m with + | zero => + rcases init_to_u0 with ⟨k1, hk1⟩ + rcases Rounds_exec rounds_0_17 with ⟨k2, hk2⟩ + exact ⟨k1 + k2, Nat.zero_le _, u_17, multiStep_trans_vkq tm _ _ _ k1 k2 hk1 hk2, good_u17⟩ + | succ m ih => + rcases ih with ⟨N, hN, u, h_ms, hG⟩ + rcases Good_step hG with ⟨u', hStep, hG'⟩ + rcases Step_exec hStep with ⟨k, hk_pos, h_step_k⟩ + exact ⟨N + k, Nat.add_le_add hN hk_pos, u', multiStep_trans_vkq tm _ _ _ N k h_ms h_step_k, hG'⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n, hn⟩ + rcases reach_N (n + 1) with ⟨N, hN, _, h_N, _⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := multiStep_add_intermediate_vkq h_N + rw [multiStep_succ_vkq, hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0RAHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RDHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RDHHH.lean new file mode 100644 index 00000000..6692e85e --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RDHHH.lean @@ -0,0 +1,72 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH + +open Mathlib Relation Nat Turing BusyBeaver SixState +open BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH + +namespace BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RDHHH + + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RDHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +section + +abbrev fCR_1rdhhh : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6) := + cfgCR true B A -- CR config for 1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RDHHH + +abbrev fCL_1rdhhh : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6) := + cfgCL true C -- CL config for 1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RDHHH + +set_option maxHeartbeats 2000000 in +-- Justification: Symbolic execution of the 15 elementary SegRules for +-- 1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RDHHH. +theorem segRules_1rdhhh : SegRules (callStep target fCR_1rdhhh fCL_1rdhhh) := by + unfold fCR_1rdhhh fCL_1rdhhh + prove_seg_rules + +theorem step_ca_1rdhhh (r : HalfTape) : + (fCL_1rdhhh lh r) [target]⊢⁺ (fCR_1rdhhh ([1] +> default) .ca r) := by + unfold fCL_1rdhhh fCR_1rdhhh cfgCL cfgCR callState callWord lh + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_ca for 1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RDHHH + +theorem step_ch_1rdhhh (r : HalfTape) : + (fCL_1rdhhh ([1] +> default) r) [target]⊢⁺ (fCR_1rdhhh lh .ch r) := by + unfold fCL_1rdhhh fCR_1rdhhh cfgCL cfgCR callState callWord lh + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_ch for 1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RDHHH + +theorem step_init_1rdhhh : + (init []) [target]⊢⁺ fCL_1rdhhh lh (initTape .kindB) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + unfold fCL_1rdhhh initTape cfgCL lh t d1 d0 + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_init for 1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RDHHH + +end + +public section + +theorem is_not_halt : IsNotHalt target := + does_not_halt_of_seg_rules segRules_1rdhhh step_ca_1rdhhh step_ch_1rdhhh .kindB step_init_1rdhhh + +end + +end BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RDHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1REHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1REHHH.lean new file mode 100644 index 00000000..256c6fbe --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1REHHH.lean @@ -0,0 +1,73 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH + +open Mathlib Relation Nat Turing BusyBeaver SixState +open BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH + +namespace BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1REHHH + + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1REHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +section + +abbrev fCR_1rehhh_b : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6) := + cfgCR true B A -- CR config for 1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1REHHH + +abbrev fCL_1rehhh_b : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6) := + cfgCL true C -- CL config for 1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1REHHH + +set_option maxHeartbeats 2000000 in +-- Justification: Symbolic execution of the 15 elementary SegRules for +-- 1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1REHHH. +theorem segRules_1rehhh_b : SegRules (callStep target fCR_1rehhh_b fCL_1rehhh_b) := by + unfold fCR_1rehhh_b fCL_1rehhh_b + prove_seg_rules + +theorem step_ca_1rehhh_b (r : HalfTape) : + (fCL_1rehhh_b lh r) [target]⊢⁺ (fCR_1rehhh_b ([1] +> default) .ca r) := by + unfold fCL_1rehhh_b fCR_1rehhh_b cfgCL cfgCR callState callWord lh + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_ca for 1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1REHHH + +theorem step_ch_1rehhh_b (r : HalfTape) : + (fCL_1rehhh_b ([1] +> default) r) [target]⊢⁺ (fCR_1rehhh_b lh .ch r) := by + unfold fCL_1rehhh_b fCR_1rehhh_b cfgCL cfgCR callState callWord lh + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_ch for 1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1REHHH + +theorem step_init_1rehhh_b : + (init []) [target]⊢⁺ fCL_1rehhh_b lh (initTape .kindB) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + unfold fCL_1rehhh_b initTape cfgCL lh t d1 d0 + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_init for 1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1REHHH + +end + +public section + +theorem is_not_halt : IsNotHalt target := + does_not_halt_of_seg_rules segRules_1rehhh_b step_ca_1rehhh_b step_ch_1rehhh_b .kindB + step_init_1rehhh_b + +end + +end BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1REHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RD_1LD0LC_1RA0RF_1RDHHH_0RD0LA.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RD_1LD0LC_1RA0RF_1RDHHH_0RD0LA.lean new file mode 100644 index 00000000..e2bfdac7 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RD_1LD0LC_1RA0RF_1RDHHH_0RD0LA.lean @@ -0,0 +1,530 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RE_1LC1RD_1LD0LC_1RA0RF_1RDHHH_0RD0LA + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC1RD_1LD0LC_1RA0RF_1RDHHH_0RD0LA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +-- ============================================================================ +-- Wave 25 Standalone verified Canonical Proof Library for holdout_0756 (1RB---_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC) +-- Cluster: Untouched 12/12 & 11/12 Septet IV (0220..0766) | Donor: holdout_0220 (1RB0RA_1LC0LF_1LE0LD_1LB---_1RA1LB_0LB0RC) +-- S_6 x Z_2 Isomorphism: 11/12 match | perm = (E,B,C,A,D,F) | mirror = 1 +-- Differing transition(s): D.F0=0LB vs M.F0=0RA +-- ============================================================================ + +set_option maxHeartbeats 2000000 +set_option maxRecDepth 2000 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem pow_zero_list (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +omit [Inhabited Γ] in +@[simp] +theorem list_pow_append_one (u : List (Fin 2)) (k : Nat) : + u^k ++ u = u^(k + 1) := by + have h := list_pow_add_comm u k 1 + dsimp [HPow.hPow] at h ⊢ + rw [List.append_nil] at h + exact h + +theorem pow_add_append_right (u : List (Fin 2)) (m n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (m + n)) +> r = (u ^ m) +> ((u ^ n) +> r) := by + rw [list_pow_add, ← listblank_append_append] + +theorem pow_succ_append_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (n + 1)) +> r = u +> ((u ^ n) +> r) := by + rw [pow_succ_list, ← listblank_append_append] + +theorem pow_succ_append_right' (u : List (Fin 2)) (k : Nat) (r : ListBlank (Fin 2)) : + (u ^ k) +> (u +> r) = (u ^ (k + 1)) +> r := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (m n : Nat) : + s <+ (u ^ (m + n)) = (s <+ (u ^ m)) <+ (u ^ n) := by + rw [listblank_append_append, ← list_pow_add, add_comm] + +theorem pow_succ_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k : Nat) : + (s <+ u) <+ (u ^ k) = s <+ (u ^ (k + 1)) := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add3_append_right (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) (r : ListBlank (Fin 2)) : + (u ^ (k₁ + k₂ + k₃)) +> r = (u ^ k₁) +> ((u ^ k₂) +> ((u ^ k₃) +> r)) := by + rw [pow_add_append_right u (k₁ + k₂) k₃ r, pow_add_append_right u k₁ k₂ ((u ^ k₃) +> r)] + +theorem pow_add3_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) : + s <+ (u ^ (k₁ + k₂ + k₃)) = ((s <+ (u ^ k₁)) <+ (u ^ k₂)) <+ (u ^ k₃) := by + rw [pow_add_append_left s u (k₁ + k₂) k₃, pow_add_append_left s u k₁ k₂] + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, _, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +theorem step_some {c c' : Cfg (Fin 2) (Fin 6)} (h : step target_tm c = some c') : + c [target_tm]⊢⁺ c' := ⟨1, Nat.zero_lt_one, h⟩ + +theorem stepPlus_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := step_stepStar_stepPlus h1 (stepPlus_stepStar h2) + +theorem stepStar_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢* c₃ := stepStar_trans (step_stepStar target_tm c₁ c₂ h1) h2 + +theorem stepPlus_stepStar_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢⁺ c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepPlus_stepStar_stepPlus h1 h2 + +theorem stepStar_stepPlus_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢* c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepStar_stepPlus_stepPlus h1 h2 + +theorem stepPlus_of_step {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢ c₂) : + c₁ [target_tm]⊢⁺ c₂ := step_stepPlus target_tm c₁ c₂ h + +theorem stepStar_of_stepPlus {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢⁺ c₂) : + c₁ [target_tm]⊢* c₂ := stepPlus_stepStar h + +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail]) +macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step))) +macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +theorem multiStep_step_isSome {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₀ cfg cfg' : Cfg Γ Λ) (n m : Nat) + (hn : multiStep M c₀ n = some cfg) + (hnm : multiStep M c₀ (n + (1 + m)) = some cfg') : + (step M cfg).isSome := by + rw [multiStep_add M c₀ n (1 + m), hn] at hnm + dsimp [Option.bind] at hnm + rw [multiStep_add M cfg 1 m, multiStep_one] at hnm + cases hs : step M cfg with + | none => + rw [hs] at hnm + nomatch hnm + | some c₁ => rfl + +theorem inv_reaches_beyond {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') + (N : Nat) : + ∃ (m : Nat) (cfg' : Cfg Γ Λ), multiStep M (init []) (N + m) = some cfg' ∧ Inv cfg' := by + induction N with + | zero => + obtain ⟨cfg₀, ⟨n₀, hn₀⟩, h_inv₀⟩ := h_init + refine ⟨n₀, cfg₀, ?_, h_inv₀⟩ + rwa [Nat.zero_add] + | succ N ih => + obtain ⟨m, cfg₁, hm, h_inv₁⟩ := ih + cases m with + | zero => + obtain ⟨cfg₂, ⟨k, hk_pos, hk⟩, h_inv₂⟩ := h_step cfg₁ h_inv₁ + cases k with + | zero => omega + | succ k' => + refine ⟨k', cfg₂, ?_, h_inv₂⟩ + have h_trans := multiStep_trans M (init []) cfg₁ cfg₂ N (k' + 1) hm hk + have h_eq : (N + 1) + k' = N + (k' + 1) := by omega + rwa [h_eq] + | succ m' => + refine ⟨m', cfg₁, ?_, h_inv₁⟩ + have h_eq : (N + 1) + m' = N + (m' + 1) := by omega + rwa [h_eq] + +theorem closed_inv_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') : + IsDoesNotHalt M := by + intro cfg ⟨n, hn⟩ + obtain ⟨m, cfg', hnm, _⟩ := inv_reaches_beyond M Inv h_init h_step (n + 1) + have h_eq : (n + 1) + m = n + (1 + m) := by omega + rw [h_eq] at hnm + exact multiStep_step_isSome M (init []) cfg cfg' n m hn hnm + +theorem closed_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) + (n₀ : Nat) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, ∃ n', (hub n) [M]⊢⁺ (hub n')) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hcfg⟩ + subst hcfg + obtain ⟨n', hn'⟩ := h_step n + exact ⟨hub n', hn', ⟨n', rfl⟩⟩ + +theorem closed_guarded_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) (P : Nat → Prop) + (n₀ : Nat) (h_P₀ : P n₀) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, P n → ∃ n', P n' ∧ ((hub n) [M]⊢⁺ (hub n'))) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, P n ∧ cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, h_P₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hPn, hcfg⟩ + subst hcfg + obtain ⟨n', hPn', hn'⟩ := h_step n hPn + exact ⟨hub n', hn', ⟨n', hPn', rfl⟩⟩ + +def A : Fin 6 := 4 +def B : Fin 6 := 3 +def C : Fin 6 := 0 +def D : Fin 6 := 1 +def E : Fin 6 := 2 +def F : Fin 6 := 5 +abbrev sA : Fin 6 := 4 +abbrev sB : Fin 6 := 3 +abbrev sC : Fin 6 := 0 +abbrev sD : Fin 6 := 1 +abbrev sE : Fin 6 := 2 +abbrev sF : Fin 6 := 5 +abbrev holdout_0551_tm : Machine (Fin 2) (Fin 6) := target_tm +abbrev M : Machine (Fin 2) (Fin 6) := target_tm +@[simp] theorem init_nil : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = (default {{C}}> default) := rfl + + + +-- ============================================================================ +-- ============================================================================ +-- Sweeps Transducer & Valid Tape Closure for Holdout 0673 +-- ============================================================================ + +theorem rule_B_000 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 0, 0] +> r)) [target_tm]⊢⁺ (l <{{E}} ([0, 0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_001 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 0, 1] +> r)) [target_tm]⊢⁺ ((l <+ [1, 1, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_010 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 1, 0] +> r)) [target_tm]⊢⁺ ((l <+ [1, 0, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_10 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([1, 0] +> r)) [target_tm]⊢⁺ ((l <+ [0, 0]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_111 (l r : ListBlank (Fin 2)) : + ((l <+ [1, 1, 1]) <{{E}} r) [target_tm]⊢⁺ (l <{{E}} ([0, 0, 0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_101 (l r : ListBlank (Fin 2)) : + ((l <+ [1, 0, 1]) <{{E}} r) [target_tm]⊢⁺ (l <{{E}} ([0, 1, 0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_00 (l r : ListBlank (Fin 2)) : + ((l <+ [0, 0]) <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ (l {{B}}> ([0, 1, 0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_nil (r : ListBlank (Fin 2)) : + (default <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ ((default <+ [1, 0, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +abbrev Round (r r' : ListBlank (Fin 2)) : Prop := + ∀ l : ListBlank (Fin 2), (l {{B}}> r) [target_tm]⊢⁺ (l <{{E}} r') + +inductive Sweeps : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) → Prop + | zero (r : ListBlank (Fin 2)) : Sweeps 0 r r + | succ {n : Nat} {r r₁ r₂ : ListBlank (Fin 2)} : + Round r r₁ → Sweeps n r₁ r₂ → Sweeps (n + 1) r r₂ + +theorem Sweeps.trans {a b : Nat} {r₁ r₂ r₃ : ListBlank (Fin 2)} + (h₁ : Sweeps a r₁ r₂) (h₂ : Sweeps b r₂ r₃) : Sweeps (a + b) r₁ r₃ := by + induction h₁ with + | zero _ => simpa using h₂ + | succ hr _ ih => + rw [Nat.succ_add] + exact Sweeps.succ hr (ih h₂) + +theorem sweeps_split_last {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps (n + 1) r r') : + ∃ r₁ : ListBlank (Fin 2), Sweeps n r r₁ ∧ Round r₁ r' := by + induction n generalizing r with + | zero => + cases h with + | succ hr h0 => + cases h0 with + | zero _ => exact ⟨r, Sweeps.zero r, hr⟩ + | succ m ih => + cases h with + | succ hr hs => + obtain ⟨r₁, hs₁, hr₁⟩ := ih hs + exact ⟨r₁, Sweeps.succ hr hs₁, hr₁⟩ + +theorem round_000 (r : ListBlank (Fin 2)) : + Round ([0, 0, 0] +> r) ([0, 0, 1] +> r) := + fun l => rule_B_000 l r + +theorem round_001 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 0, 1] +> r) ([0, 0, 0] +> r') := + fun l => stepPlus_trans (rule_B_001 l r) (stepPlus_trans (h (l <+ [1, 1, 1])) (rule_E_111 l r')) + +theorem round_010 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 1, 0] +> r) ([0, 1, 0] +> r') := + fun l => stepPlus_trans (rule_B_010 l r) (stepPlus_trans (h (l <+ [1, 0, 1])) (rule_E_101 l r')) + +theorem round_10 {r₁ r r₂ : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Round r r₂) : + Round ([1, 0] +> r₁) ([0, 1, 0] +> r₂) := + fun l => stepPlus_trans (rule_B_10 l r₁) + (stepPlus_trans (h₁ (l <+ [0, 0])) + (stepPlus_trans (rule_E_00 l r) (round_010 h₂ l))) + +theorem sweeps_010 {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps n r r') : + Sweeps n ([0, 1, 0] +> r) ([0, 1, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | succ hr _ ih => exact Sweeps.succ (round_010 hr) ih + +theorem sweeps_10 {n : Nat} {r₁ r r' : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Sweeps (n + 1) r r') : + Sweeps (n + 1) ([1, 0] +> r₁) ([0, 1, 0] +> r') := by + cases h₂ with + | succ hr₂ hs => + exact Sweeps.succ (round_10 h₁ hr₂) (sweeps_010 hs) + +theorem sweeps_000_even {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k) ([0, 0, 0] +> r) ([0, 0, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | @succ m r₀ r₁ r₂ hr _ ih => + have h2 : Sweeps 2 ([0, 0, 0] +> r₀) ([0, 0, 0] +> r₁) := + Sweeps.succ (round_000 r₀) (Sweeps.succ (round_001 hr) (Sweeps.zero _)) + have htr := Sweeps.trans h2 ih + rw [show 2 + 2 * m = 2 * (m + 1) by omega] at htr + exact htr + +theorem sweeps_000_odd {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k + 1) ([0, 0, 0] +> r) ([0, 0, 1] +> r') := by + have he := sweeps_000_even h + have h1 : Sweeps 1 ([0, 0, 0] +> r') ([0, 0, 1] +> r') := + Sweeps.succ (round_000 r') (Sweeps.zero _) + exact Sweeps.trans he h1 + +theorem default_eq_b000 : + (default : ListBlank (Fin 2)) = [0, 0, 0] +> default := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b000_cons_zero (r : ListBlank (Fin 2)) : + [0, 0, 0] +> ((0 : Fin 2) >> r) = (0 : Fin 2) >> ([0, 0, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +theorem b001_cons_zero (r : ListBlank (Fin 2)) : + [0, 0, 1] +> ((0 : Fin 2) >> r) = (0 : Fin 2) >> ([0, 1, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +theorem b001_default_eq : + ([0, 0, 1] +> default : ListBlank (Fin 2)) = (0 : Fin 2) >> ([0, 1, 0] +> default) := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b010_eq_zero_cons_b10 (r : ListBlank (Fin 2)) : + [0, 1, 0] +> r = (0 : Fin 2) >> ([1, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +inductive Valid : Nat → ListBlank (Fin 2) → Prop + | nil {n : Nat} (hn : n ≥ 1) : + Valid n default + | t0 {n : Nat} {r : ListBlank (Fin 2)} (hn : n ≥ 2) (hr : Valid (n / 2) r) : + Valid n ([0, 0, 0] +> r) + | t1 {n : Nat} {r : ListBlank (Fin 2)} (hn : n ≥ 1) (hr : Valid (n + 1) r) : + Valid n ([0, 1, 0] +> r) + | t2 {n : Nat} {r₁ r : ListBlank (Fin 2)} (hn : n ≥ 1) + (hround : Round r₁ ((0 : Fin 2) >> r)) (hr : Valid (n + 1) r) : + Valid n ([1, 0] +> r₁) + +theorem Valid.mono {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) {n' : Nat} (hle : n ≤ n') : + Valid n' r := by + induction h generalizing n' with + | nil hn => exact Valid.nil (by omega) + | t0 hn _ ih => exact Valid.t0 (by omega) (ih (by omega)) + | t1 hn _ ih => exact Valid.t1 (by omega) (ih (by omega)) + | t2 hn hround _ ih => exact Valid.t2 (by omega) hround (ih (by omega)) + +theorem valid_sweeps_nil : ∀ n : Nat, n ≥ 1 → + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ Sweeps n default ((0 : Fin 2) >> r') := by + intro n + induction n using Nat.strongRecOn with + | ind n ih => + intro hn + rcases ( by omega : n = 1 ∨ (n ≥ 2 ∧ n % 2 = 0) ∨ (n ≥ 2 ∧ n % 2 = 1) ) with rfl | ⟨hn2, hev⟩ | ⟨hn2, hod⟩ + · refine ⟨[0, 1, 0] +> default, Valid.t1 (by omega) (Valid.nil (by omega)), ?_⟩ + have h1 : Sweeps 1 ([0, 0, 0] +> default) ([0, 0, 1] +> default) := + Sweeps.succ (round_000 default) (Sweeps.zero _) + rw [b001_default_eq, ← default_eq_b000] at h1 + exact h1 + · obtain ⟨r', hr', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨[0, 0, 0] +> r', Valid.t0 hn2 hr', ?_⟩ + have he := sweeps_000_even hs' + rw [← default_eq_b000, b000_cons_zero, show 2 * (n / 2) = n by omega] at he + exact he + · obtain ⟨r', hr', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨[0, 1, 0] +> r', Valid.t1 (by omega) (hr'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [← default_eq_b000, b001_cons_zero, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + +theorem valid_sweeps {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) : + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ Sweeps n r ((0 : Fin 2) >> r') := by + induction h with + | @nil n hn => exact valid_sweeps_nil n hn + | @t0 n r hn hr ih => + obtain ⟨r', hr', hs'⟩ := ih + rcases ( by omega : n % 2 = 0 ∨ n % 2 = 1 ) with hev | hod + · refine ⟨[0, 0, 0] +> r', Valid.t0 hn hr', ?_⟩ + have he := sweeps_000_even hs' + rw [b000_cons_zero, show 2 * (n / 2) = n by omega] at he + exact he + · refine ⟨[0, 1, 0] +> r', Valid.t1 (by omega) (hr'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [b001_cons_zero, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + | @t1 n r hn hr ih => + obtain ⟨r', hr', hs'⟩ := ih + obtain ⟨r₁, hs₁, hr₁⟩ := sweeps_split_last hs' + refine ⟨[1, 0] +> r₁, Valid.t2 hn hr₁ hr', ?_⟩ + rw [← b010_eq_zero_cons_b10] + exact sweeps_010 hs₁ + | @t2 n r₁ r hn hround hr ih => + obtain ⟨r', hr', hs'⟩ := ih + obtain ⟨r₂, hs₂, hr₂⟩ := sweeps_split_last hs' + refine ⟨[1, 0] +> r₂, Valid.t2 hn hr₂ hr', ?_⟩ + rw [← b010_eq_zero_cons_b10] + rw [show n = (n - 1) + 1 by omega] at hs₂ ⊢ + exact sweeps_10 hround hs₂ + +theorem era_step {r : ListBlank (Fin 2)} (h : Valid 1 r) : + ∃ r' : ListBlank (Fin 2), Valid 1 r' ∧ + ((default <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ (default <{{E}} ((0 : Fin 2) >> r'))) := by + obtain ⟨r', hr', hs'⟩ := valid_sweeps (h.mono (by omega : 1 ≤ 2)) + obtain ⟨r₁, hs₁, hr₂⟩ := sweeps_split_last hs' + obtain ⟨r₀, hs₀, hr₁⟩ := sweeps_split_last hs₁ + cases hs₀ with + | zero _ => + refine ⟨[1, 0] +> r₁, Valid.t2 (by omega) hr₂ hr', ?_⟩ + have s1 := rule_E_nil r + have s2 := hr₁ (default <+ [1, 0, 1]) + have s3 := rule_E_101 default r₁ + rw [← b010_eq_zero_cons_b10] + exact stepPlus_trans s1 (stepPlus_trans s2 s3) + +def era0_r : ListBlank (Fin 2) := + [1, 0] +> default + +theorem init_reaches_era0 : + (init []) [target_tm]⊢* (default <{{E}} ((0 : Fin 2) >> era0_r)) := by + apply stepPlus_stepStar + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{C}}> default) := rfl + rw [h_init] + dsimp [era0_r, ListBlank.append] + execute + +theorem valid_era0 : Valid 1 era0_r := by + have hround : Round default ((0 : Fin 2) >> ([0, 1, 0] +> default)) := by + have h0 := round_000 default + rw [b001_default_eq, ← default_eq_b000] at h0 + exact h0 + exact Valid.t2 (by omega) hround (Valid.t1 (by omega) (Valid.nil (by omega))) + +theorem holdout_0551_nonhalt : IsDoesNotHalt holdout_0551_tm := by + refine closed_inv_does_not_halt target_tm + (fun cfg => ∃ r : ListBlank (Fin 2), Valid 1 r ∧ cfg = (default <{{E}} ((0 : Fin 2) >> r))) + ⟨default <{{E}} ((0 : Fin 2) >> era0_r), init_reaches_era0, ⟨era0_r, valid_era0, rfl⟩⟩ ?_ + intro cfg ⟨r, hr, hcfg⟩ + subst hcfg + obtain ⟨r', hr', hstep⟩ := era_step hr + exact ⟨default <{{E}} ((0 : Fin 2) >> r'), hstep, ⟨r', hr', rfl⟩⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := + holdout_0551_nonhalt + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RE_1LC1RD_1LD0LC_1RA0RF_1RDHHH_0RD0LA diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RF_HHH0LD_0LE1LB_1LF1LD_1RD0RA.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RF_HHH0LD_0LE1LB_1LF1LD_1RD0RA.lean new file mode 100644 index 00000000..0dcd8d1f --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1LC1RF_HHH0LD_0LE1LB_1LF1LD_1RD0RA.lean @@ -0,0 +1,88 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.SharedDonorsA + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RB0RE_1LC1RF_HHH0LD_0LE1LB_1LF1LD_1RD0RA + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC1RF_HHH0LD_0LE1LB_1LF1LD_1RD0RA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +open BusyBeaver.Counter +open TM311Donor + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +def σ_EFDBAC : Fin 6 → Fin 6 + | ⟨0, _⟩ => 4 + | ⟨1, _⟩ => 5 + | ⟨2, _⟩ => 3 + | ⟨3, _⟩ => 1 + | ⟨4, _⟩ => 0 + | ⟨5, _⟩ => 2 + +theorem tableIso_311_128 : ∀ (q : Fin 6) (a : Fin 2), + target_tm (σ_EFDBAC q) a = (donor311_tm q a).map (conjOut σ_EFDBAC true) + | 0, 0 => rfl + | 0, 1 => rfl + | 1, 0 => rfl + | 1, 1 => rfl + | 2, 0 => rfl + | 2, 1 => rfl + | 3, 0 => rfl + | 3, 1 => rfl + | 4, 0 => rfl + | 4, 1 => rfl + | 5, 0 => rfl + | 5, 1 => rfl + +theorem init_reaches_conj_inv_128 : + (init []) [target_tm]⊢⁺ conjCfg σ_EFDBAC true (cfg_modeC (encL 7 []) default) := by + refine run_local_plus_eq (tm := target_tm) (n := 177) + (s1 := ⟨[(0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), + (0 : Fin 2), (0 : Fin 2), (0 : Fin 2)], + [(0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), + (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), + (0 : Fin 2), (0 : Fin 2), (0 : Fin 2)], 0, .right⟩) + (s2 := ⟨[(0 : Fin 2), (0 : Fin 2)], + [(1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), + (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), + (0 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 3, .left⟩) + default default rfl ?_ ?_ + · simp only [cfg_of, init, Tape.mk₁, append_cons, append_nil, + zero_cons_default, default_head, default_tail]; rfl + · simp only [cfg_of, cfg_modeC, conjCfg, mirrorTape, σ_EFDBAC, + encL, encL_tail, prepend10, append_cons, append_nil, + zero_cons_default, default_head, default_tail, Option.map]; rfl + + + +theorem is_does_not_halt : IsNotHalt target_tm := + does_not_halt_of_conj_invariant tableIso_311_128 Inv + ⟨cfg_modeC (encL 7 []) default, stepPlus_stepStar init_reaches_conj_inv_128, + ⟨7, [], rfl, Or.inl ⟨rfl, by omega⟩⟩⟩ + inv_step + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RE_1LC1RF_HHH0LD_0LE1LB_1LF1LD_1RD0RA diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RE_1RC0RB_0RD0RF_0LEHHH_1LF1LE_1LA0LE.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1RC0RB_0RD0RF_0LEHHH_1LF1LE_1LA0LE.lean new file mode 100644 index 00000000..26ae1c9c --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1RC0RB_0RD0RF_0LEHHH_1LF1LE_1LA0LE.lean @@ -0,0 +1,1111 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RE_1RC0RB_0RD0RF_0LEHHH_1LF1LE_1LA0LE + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1RC0RB_0RD0RF_0LEHHH_1LF1LE_1LA0LE" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 2000000 +variable {α β γ : Type*} [Inhabited α] [Inhabited β] [Inhabited γ] + +namespace Solution +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 2000000 +set_option linter.dupNamespace false +set_option linter.deprecated false +set_option maxHeartbeats 2000000 + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 + +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 2000000 +@[simp] theorem zMz (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : HalfTape).head = 0 := rfl +@[simp] theorem zDt : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem zPs {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem zPt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,by omega,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ +theorem refl_star (c : Cfg (Fin 2) (Fin 6)) : c [target_tm]⊢* c := ⟨0, rfl⟩ +theorem step_L_p {q q' : Fin 6} {s a b : Fin 2} {l r : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q s = some (some q', Stmt.write a Dir.left)) + (h : ⟨some q', ⟨b, l, a >> r⟩⟩ [target_tm]⊢* ce) : + ⟨some q, ⟨s, b >> l, r⟩⟩ [target_tm]⊢⁺ ce := by + refine z03 ?_ h; simp only [step, ht, Option.map, Tape.write, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] +theorem step_L0_p {q q' : Fin 6} {s a : Fin 2} {r : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q s = some (some q', Stmt.write a Dir.left)) + (h : ⟨some q', ⟨0, default, a >> r⟩⟩ [target_tm]⊢* ce) : + ⟨some q, ⟨s, default, r⟩⟩ [target_tm]⊢⁺ ce := by + rw [← z00]; exact step_L_p ht h +theorem step_R_p {q0 q1 : Fin 6} {s a b : Fin 2} {l r : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q0 s = some (some q1, Stmt.write a Dir.right)) + (h : ⟨some q1, ⟨b, a >> l, r⟩⟩ [target_tm]⊢* ce) : + ⟨some q0, ⟨s, l, b >> r⟩⟩ [target_tm]⊢⁺ ce := by + refine z03 ?_ h; simp only [step, ht, Option.map, Tape.write, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] +theorem step_R0_p {q0 q1 : Fin 6} {s a : Fin 2} {l : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q0 s = some (some q1, Stmt.write a Dir.right)) + (h : ⟨some q1, ⟨0, a >> l, default⟩⟩ [target_tm]⊢* ce) : + ⟨some q0, ⟨s, l, default⟩⟩ [target_tm]⊢⁺ ce := by + rw [← z00]; exact step_R_p ht h +theorem step_L_s {q q' : Fin 6} {s a b : Fin 2} {l r : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q s = some (some q', Stmt.write a Dir.left)) + (h : ⟨some q', ⟨b, l, a >> r⟩⟩ [target_tm]⊢* ce) : + ⟨some q, ⟨s, b >> l, r⟩⟩ [target_tm]⊢* ce := zPs (step_L_p ht h) +theorem step_L0_s {q q' : Fin 6} {s a : Fin 2} {r : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q s = some (some q', Stmt.write a Dir.left)) + (h : ⟨some q', ⟨0, default, a >> r⟩⟩ [target_tm]⊢* ce) : + ⟨some q, ⟨s, default, r⟩⟩ [target_tm]⊢* ce := zPs (step_L0_p ht h) +theorem step_R_s {q0 q1 : Fin 6} {s a b : Fin 2} {l r : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q0 s = some (some q1, Stmt.write a Dir.right)) + (h : ⟨some q1, ⟨b, a >> l, r⟩⟩ [target_tm]⊢* ce) : + ⟨some q0, ⟨s, l, b >> r⟩⟩ [target_tm]⊢* ce := zPs (step_R_p ht h) +theorem step_R0_s {q0 q1 : Fin 6} {s a : Fin 2} {l : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q0 s = some (some q1, Stmt.write a Dir.right)) + (h : ⟨some q1, ⟨0, a >> l, default⟩⟩ [target_tm]⊢* ce) : + ⟨some q0, ⟨s, l, default⟩⟩ [target_tm]⊢* ce := zPs (step_R0_p ht h) +local macro "finish" : tactic => + `(tactic| exact refl_star _) +local macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt]) +theorem step_Lg_p {q q' : Fin 6} {s a : Fin 2} {l r : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q s = some (some q', Stmt.write a Dir.left)) + (h : ⟨some q', ⟨l.head, l.tail, a >> r⟩⟩ [target_tm]⊢* ce) : + ⟨some q, ⟨s, l, r⟩⟩ [target_tm]⊢⁺ ce := z03 (by rw [step, ht]; rfl) h +theorem step_Rg_p {q0 q1 : Fin 6} {s a : Fin 2} {l r : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q0 s = some (some q1, Stmt.write a Dir.right)) + (h : ⟨some q1, ⟨r.head, a >> l, r.tail⟩⟩ [target_tm]⊢* ce) : + ⟨some q0, ⟨s, l, r⟩⟩ [target_tm]⊢⁺ ce := z03 (by rw [step, ht]; rfl) h +theorem step_Lg_s {q q' : Fin 6} {s a : Fin 2} {l r : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q s = some (some q', Stmt.write a Dir.left)) + (h : ⟨some q', ⟨l.head, l.tail, a >> r⟩⟩ [target_tm]⊢* ce) : + ⟨some q, ⟨s, l, r⟩⟩ [target_tm]⊢* ce := zPs (step_Lg_p ht h) +theorem step_Rg_s {q0 q1 : Fin 6} {s a : Fin 2} {l r : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q0 s = some (some q1, Stmt.write a Dir.right)) + (h : ⟨some q1, ⟨r.head, a >> l, r.tail⟩⟩ [target_tm]⊢* ce) : + ⟨some q0, ⟨s, l, r⟩⟩ [target_tm]⊢* ce := zPs (step_Rg_p ht h) +local macro "fast_step" : tactic => + `(tactic| ( + first + | refine step_R_s rfl ?_ + | refine step_L_s rfl ?_ + | refine step_R0_s rfl ?_ + | refine step_L0_s rfl ?_ + | refine step_Rg_s rfl ?_ + | refine step_Lg_s rfl ?_ + | refine step_R_p rfl ?_ + | refine step_L_p rfl ?_ + | refine step_R0_p rfl ?_ + | refine step_L0_p rfl ?_ + | refine step_Rg_p rfl ?_ + | refine step_Lg_p rfl ?_ + | step) <;> try rw [z00]) +local macro "execute" : tactic => + `(tactic| ( + simp only [Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, zDh, zDt, z00]; + repeat (first | finish | fast_step))) +abbrev CCfg := Counter.CCfg (Fin 2) (Fin 6) +abbrev z04 (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev z0b (c : CCfg) : Option CCfg := Counter.bstep target_tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep target_tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (z04 c1) [target_tm]⊢⁺ (z04 c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ +abbrev t : BitWord := [1,1,0,0] +abbrev d0 : BitWord := [0,0] +abbrev d1 : BitWord := [1,0] +abbrev one : BitWord := [1] +abbrev lh : HalfTape := [1,0,1] +> default +abbrev w_pre : BitWord := t ++ t ++ one +@[simp] theorem zDd : d0 +> (default : HalfTape) = default := by + simp [d0] +inductive Call where + | ch + | cj + | cp + | ca +def zCs : Call -> Fin 6 + | .ch => A + | .cj => F + | .cp => F + | .ca => A +def zCw : Call -> BitWord + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] + | .ca => [1,1,1,0,1,0] +def zCR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (r <{{zCs c}} (l <+ zCw c)) +def zCL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> r) {{B}}> l) +def zCf (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + zCL lh (w_pre +> r) +def z0f (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l,(zCR l c r1) [target_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + z0f c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem z0g {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z0h {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem z0i {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z0j {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z0k {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0l (w : BitWord) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem z0m (ls : List Call) : Seg ls ls [] [] := by + intro r1 r2 h; exact h +theorem zSc {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases z0k h with ⟨r2,ha,hb⟩ + exact z0j (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS0 {ls1 ls2 ls3 : List Call} {w1 w2 v1 v2 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls2 ls3 v1 v2) : + Seg ls1 ls3 (w1 ++ v1) (w2 ++ v2) := by + intro r1 r2 h + rw [append_assoc,append_assoc] + exact h1 (v1 +> r1) (v2 +> r2) (h2 r1 r2 h) +theorem zS4 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc1 (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [target_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem z0n : Seg [.cp] [.ch] t (t ++ [0]) := + zS2 (mid := [1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0o : Seg [.cj] [.ch] t (t ++ one) := + zS2 (mid := [1,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0p : Seg [.ch] [.cj] (t ++ [0]) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0q : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0r : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0s : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1 d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0t : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0u : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0v : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0w : Seg [.cj] [.cp] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons,append_nil]; execute) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem H_T (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact z0l t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [zLp,h_eq,z0i] + exact zSg z0q ih +theorem zSa {w2 : BitWord} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact z0l w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq,z0i,zLp] + exact zSg hw ih +theorem z0x : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0y : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem z0z (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d0 d0 := + zSa z0x n +theorem z0A (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ n) d0 d1 := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg zH0 (zSa z0y n) +theorem z0B (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d1 d1 := + zSa z0y n +theorem z0C (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ (1 + n)) d1 d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg zH4 (zSa z0x n) +theorem z0D (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0n z0p) (H_T n) +theorem z0E (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0o zH2) (H_T n) +theorem z0F (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0r zH2) (H_T n) +theorem z0G (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0s (H_T n) +theorem z0H (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0t (H_T n) +theorem z0I (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [zLp',List.cons_append,List.nil_append] using zSg z0u (H_T n) +theorem z0J (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0v (zSg zH1 zH3) + have h1 := zSg h0 (zSa z0x n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0K (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0w (zSa z0x n) +theorem z0L : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0v zH1 +theorem z0M (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0v (zSg zH1 (zSg zH3 zH0)) + have h1 := zSg h0 (zSa z0y n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0N (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg [.cj,.ch] [.cp] d1 d1 := zSg z0w zH0 + have h1 := zSg h0 (zSa z0y n) + simpa only [zLp',List.cons_append,List.nil_append] using h1 +theorem z0O : Side [.ch] default (d1 +> default) := by + refine Side.cons (fun l => ?_) (Side.nil _) + unfold zCR zCL zCw zCs d1 + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute +theorem z0P : Seg [.ca] [.ch,.ch] t [1,1,0,0,0,1,1,0,0] := + zS5 + (mid1 := [1,0,1,1,1,1,0,1,0]) + (mid2 := [1,0,1,0,1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0Q : Seg [.ch] [.ch] [1,1,0,0,0,1,1,0,0] (t ++ t ++ one) := + zS2 + (mid := [1,1,0,1,1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0R : Seg [.ca,.ch] ([.cj] ++ [.ch] ^ 5) w_pre (w_pre ++ t) := by + have h1 : Seg [.ca,.ch] [.ch,.ch,.ch] t (t ++ t ++ one) := + zSg z0P z0Q + have h2 : Seg [.ch,.ch,.ch] ([.cj] ++ [.ch] ^ 5) (t ++ one) t := + zSg zH2 (H_T 2) + have h3 := zS0 h1 h2 + simpa only [w_pre,List.append_assoc,List.cons_append,List.nil_append] using h3 +theorem z0S (r : HalfTape) : + (zCL lh r) [target_tm]⊢⁺ (zCR ([1] +> default) .ca r) := by + unfold zCL zCR lh zCw zCs + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute +theorem z0T (r : HalfTape) : + (zCL ([1] +> default) r) [target_tm]⊢⁺ (zCR lh .ch r) := by + unfold zCL zCR lh zCw zCs + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute +open WordCalculus +open WordCalculus.Word +local notation "WordList" => List Word +def z3p : WordList := + [Q,V,V,Q,Q,V,K,V,K,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,Q,Q,V] +def z3q : WordList := + [K,V,V,K,Q,V,Q,V,Q,V,V,V,K,V,V,V,V,V,V,K,V,V,V,K,V,K,V,K,Q,V] +theorem z3w (n : Nat) : + Copy (31 + 32 * n) (260 + 256 * n) z3p z3q (9351 + 8192 * n) (58338 + 65536 * n) := by + unfold z3p z3q + refine copy_step_d11 (n' := 16 + 16 * n) (k' := 128 + 128 * n) (m := 64 + 64 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 33 + 32 * n) (k' := 252 + 256 * n) (m := 125 + 128 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 67 + 64 * n) (k' := 500 + 512 * n) (m := 249 + 256 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 34 + 32 * n) (k' := 248 + 256 * n) (m := 124 + 128 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_d10 (n' := 17 + 16 * n) (k' := 123 + 128 * n) (m := 61 + 64 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 35 + 32 * n) (k' := 242 + 256 * n) (m := 120 + 128 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d01 (n' := 17 + 16 * n) (k' := 121 + 128 * n) (m := 60 + 64 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 35 + 32 * n) (k' := 238 + 256 * n) (m := 118 + 128 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d01 (n' := 17 + 16 * n) (k' := 119 + 128 * n) (m := 59 + 64 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 35 + 32 * n) (k' := 234 + 256 * n) (m := 116 + 128 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 71 + 64 * n) (k' := 464 + 512 * n) (m := 231 + 256 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 143 + 128 * n) (k' := 924 + 1024 * n) (m := 461 + 512 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 72 + 64 * n) (k' := 460 + 512 * n) (m := 230 + 256 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 145 + 128 * n) (k' := 916 + 1024 * n) (m := 457 + 512 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 291 + 256 * n) (k' := 1828 + 2048 * n) (m := 913 + 1024 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 583 + 512 * n) (k' := 3652 + 4096 * n) (m := 1825 + 2048 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 1167 + 1024 * n) (k' := 7300 + 8192 * n) (m := 3649 + 4096 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 2335 + 2048 * n) (k' := 14596 + 16384 * n) (m := 7297 + 8192 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 4671 + 4096 * n) (k' := 29188 + 32768 * n) (m := 14593 + 16384 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 2336 + 2048 * n) (k' := 14592 + 16384 * n) (m := 7296 + 8192 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 4673 + 4096 * n) (k' := 29180 + 32768 * n) (m := 14589 + 16384 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 9347 + 8192 * n) (k' := 58356 + 65536 * n) (m := 29177 + 32768 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 18695 + 16384 * n) (k' := 116708 + 131072 * n) (m := 58353 + 65536 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 9348 + 8192 * n) (k' := 58352 + 65536 * n) (m := 29176 + 32768 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 18697 + 16384 * n) (k' := 116700 + 131072 * n) (m := 58349 + 65536 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 9349 + 8192 * n) (k' := 58348 + 65536 * n) (m := 29174 + 32768 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 18699 + 16384 * n) (k' := 116692 + 131072 * n) (m := 58345 + 65536 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 9350 + 8192 * n) (k' := 58344 + 65536 * n) (m := 29172 + 32768 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_d10 (n' := 4675 + 4096 * n) (k' := 29171 + 32768 * n) (m := 14585 + 16384 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 9351 + 8192 * n) (k' := 58338 + 65536 * n) (m := 29168 + 32768 * n) (by omega) (by omega) (by omega) ?_ + exact Copy.nil _ _ +theorem z3x (q : Nat) (hQ : 5 <= q) : + CopyTwelve (List.replicate q V ++ z3p) (List.replicate q V ++ z3q) := by + have hPow : 2 ^ q = 32 * 2 ^ (q - 5) := by + have heq : q = 5 + (q - 5) := by omega + conv_lhs => rw [heq,Nat.pow_add] + have hPos := pow_two_pos (q - 5) + have hTs := copy_replicate_V q 0 8 + have hBase := z3w (2 ^ (q - 5) - 1) + have h1 : (1 + 0) * 2 ^ q - 1 = 31 + 32 * (2 ^ (q - 5) - 1) := by omega + have h2 : 4 + 8 * 2 ^ q = 260 + 256 * (2 ^ (q - 5) - 1) := by omega + rw [h1,h2] at hTs + exact ⟨_,_,copy_append hTs hBase⟩ +theorem z3y : isSafePrefix z3q = true := by decide +kernel +def z3K : WordList := + [K,Q,Q,Q,K,K,Q,Q,K] ++ List.replicate 15 Q +def z3L : WordList := + List.replicate 4 V ++ [Q,V,V,Q,Q,V,K,V,Q,K,K,Q,Q] +def u_5 : WordList := [V,V,V,V,V,V,V,V,V,Q,V,V,Q,Q,V,K,V,K,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,Q,K,V,Q,V,V,V,K,K,K,Q,Q,K,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q] +def z3M : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,Q,V,K,V,K,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,Q,Q,V,K,V,V,V,V,V,Q,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,V,Q,V,V,V,Q,Q,V,K,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,K,V,V,V,V,V,V,V,V,Q,V,V,V,K,V,V,K,K,V,Q,K,Q,K,V,Q,V,K,V,V,V,K,V,V,V,V,Q,Q,V,V,V,V,V,K,V,V,V,Q,Q,V,V,V,V,V,V,V,K,K,K,K,K,Q,Q,Q,K,Q,Q,K,Q,K,K,Q,K,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,K,K,Q,Q,Q,Q,K,Q,K,K,K,K,K,K,K,Q,Q,Q,K,Q,K,Q,Q,K,K,K,K,Q,Q,K,K,Q,Q,Q,K,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def z3N : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,Q,V,K,V,K,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,Q,Q,V,K,V,V,V,V,V,Q,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,V,Q,V,V,V,Q,Q,V,K,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,K,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,V,Q,Q,V,K,V,V,V,V,V,V,Q,V,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,Q,V,Q,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,V,Q,Q,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,Q,V,V,V,V,V,V,V,Q,V,K,V,V,K,Q,V,V,V,V,Q,V,Q,V,Q,V,V,Q,K,V,V,V,Q,V,V,Q,V,K,V,K,Q,V,V,V,Q,V,Q,V,V,V,V,V,Q,Q,K,V,Q,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,K,V,Q,V,V,Q,Q,V,Q,V,Q,Q,V,V,K,K,Q,K,Q,K,Q,K,V,Q,K,K,V,Q,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,K,Q,V,Q,V,K,V,Q,V,V,V,V,V,V,V,Q,K,V,V,V,Q,K,V,V,V,Q,V,V,K,V,K,V,Q,K,V,V,V,Q,V,K,V,V,V,V,V,Q,K,K,V,Q,V,K,V,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,Q,Q,Q,V,V,V,V,K,V,V,V,V,Q,Q,V,V,V,V,V,K,V,V,V,Q,Q,V,Q,V,V,V,V,V,V,V,V,K,K,K,K,K,K,K,K,Q,K,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,K,Q,K,K,K,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,Q,K,Q,K,K,Q,K,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,K,Q,K,Q,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,K,Q,Q,K,Q,K,K,K,Q,K,K,Q,K,Q,K,K,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,K,Q,K,Q,K,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,K,K,K,Q,K,K,K,Q,Q,K,K,Q,Q,Q,K,Q,Q,Q,Q,K,Q,K,K,Q,K,Q,K,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,K,Q,Q,K,Q,Q,K,K,K,K,Q,K,Q,K,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,K,K,Q,Q,Q,Q,K,Q,K,K,K,K,K,K,K,Q,Q,Q,K,Q,K,Q,Q,K,K,K,K,Q,Q,K,K,Q,Q,Q,K,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +theorem z3O : EntrySpec 19 z3p z3K 12000 := entrySpec_of_checkEntrySpec (by decide +kernel) +set_option maxRecDepth 500000 in +theorem z3P : evalRounds 5 z3L = some u_5 := by decide +kernel +set_option maxRecDepth 500000 in +theorem z3Q : evalRounds 5 u_5 = some z3M := by decide +kernel +set_option maxRecDepth 500000 in +theorem z3R : evalRounds 5 z3M = some z3N := by decide +kernel +set_option maxRecDepth 500000 in +theorem z3S : checkEntryTwo 19 z3p z3K 12000 z3N 118572124402667226942787183035401251327472713866885815623334278971049653593343273 9174073771324304005186384064554824126404797020214788052537224621593528352222997552707606800391029695717887 = true := by decide +kernel +theorem z3T : ∃ v,Rounds z3L v /\ AggState z3p 16 19 v := by + refine ⟨z3N,?_,good_of_checkEntryTwo 19 z3p z3K 12000 z3N 118572124402667226942787183035401251327472713866885815623334278971049653593343273 9174073771324304005186384064554824126404797020214788052537224621593528352222997552707606800391029695717887 z3O z3S⟩ + exact rounds_trans (evalRounds_sound 5 z3L u_5 z3P) + (rounds_trans (evalRounds_sound 5 u_5 z3M z3Q) + (evalRounds_sound 5 z3M z3N z3R)) +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) +theorem z3U {k : Nat} (hK : 0 < k) : ∃ hs,Num k [] hs := by + rcases even_or_odd_mul_two k with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · cases a with + | zero => omega + | succ a => + have heq : (a + 1) * 2 = 2 + a * 2 := by omega + rw [heq]; exact ⟨[.cj] ++ [.ch] ^ a,Num.even a⟩ + · exact ⟨[.cp] ++ [.ch] ^ a,Num.odd a⟩ +theorem z3V {k : Nat} {hs hs' : List Call} (h1 : Num k [] hs) (h2 : Num k [] hs') : + hs = hs' := by + cases h1 with + | @odd n => + generalize hk : 1 + n * 2 = k0 at h2 + cases h2 with + | @odd m => + have hnm : n = m := by omega + subst hnm; rfl + | even _ => omega + | @even n => + generalize hk : 2 + n * 2 = k0 at h2 + cases h2 with + | odd _ => omega + | @even m => + have hnm : n = m := by omega + subst hnm; rfl +def z3W (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs,Num k w hs -> Side hs (w +> r) r' +theorem z3X {r r' : HalfTape} (h : z3W 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl +theorem z3Y {n : Nat} {r r' : HalfTape} + (hI : z3W (n * 2) r r') : z3W (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := z3X hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0v (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine zSc (z0J n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using hI [] _ hN2 +theorem z3Z {n : Nat} {r r' : HalfTape} + (hI : z3W (n * 2) r r') : z3W (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := z3X hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0L (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine zSc (z0M n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using hI [] _ hN2 +theorem z40 {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hZ : A = 0) : + evalWords da default = default := by + induction hD with + | nil => rfl + | @zero A H u _ ih => + have hA0 : A = 0 := by omega + dsimp only [evalWords] + rw [ih hA0,zDd] + | one _ => omega +theorem z41 {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hPos : 0 < A) : + z3W ((A - 1) * 2) default (evalWords da default) := by + induction hD with + | nil => omega + | @zero A H u _ ih => + have hA_pos : 0 < A := by omega + have hIH := ih hA_pos + have hs := z3Y hIH + rw [zDd] at hs + have heq : (A * 2 - 1) * 2 = 2 + (A - 1) * 4 := by omega + dsimp [evalWords] + rwa [heq] + | @one A H u hDu ih => + cases A with + | zero => + change z3W 0 default (d1 +> evalWords u default) + rw [z40 hDu rfl] + intro w hs hN + generalize hk : 0 = k0 at hN + cases hN with + | zero => + have hd : d1 +> (default : HalfTape) = one +> default := by simp [d1,one] + rw [hd]; exact Side.nil (one +> default) + | odd _ => omega + | even _ => omega + | succ A => + have hA_pos : 0 < A + 1 := by omega + have hIH := ih hA_pos + have heq_in : (A + 1 - 1) * 2 = A * 2 := by omega + rw [heq_in] at hIH + have hs := z3Z hIH + rw [zDd] at hs + have heq : (1 + (A + 1) * 2 - 1) * 2 = 4 + A * 4 := by omega + dsimp [evalWords] + rwa [heq] +theorem zEd {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ∀ {A H : Nat},DigitVal A H v -> Seg ([Call.ch] ^ n) ([Call.ch] ^ b) (wordsToBits u) (wordsToBits v) := by + induction hI with + | nil n => + intro A H _ + exact z0m ([Call.ch] ^ n) + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | d00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0z _) (ih hD') + | d01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0A _) (ih hD') + | d10 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0B _) (ih hD') + | d11 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0C _) (ih hD') +theorem z42 {n : Nat} {hs hs' : List Call} + (hI : Num (3 + n) [] hs) (hJ : Num (2 + n * 2) [] hs') : + Seg hs ([Call.ch] ++ hs') t t := by + generalize hk1 : 3 + n = k1 at hI + generalize hk2 : 2 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = m * 2 := by omega + subst hq + rw [h1m] + exact z0D m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0E m +theorem z43 {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' (d1 ++ d0) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0F m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + have hq : q = m * 2 := by omega + subst hq + exact z0G m +theorem z44 {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' (d1 ++ d1) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | @odd q => + have hq : q = m * 2 := by omega + subst hq + exact z0H m + | even _ => omega + | @even m => + cases hJ with + | @odd q => + have hq : q = 1 + m * 2 := by omega + subst hq + exact z0I m + | even _ => omega +theorem z45 {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 2 + q * 2 := by omega + subst hm + exact z0J q +theorem z46 {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = q * 2 := by omega + subst hm + exact z0K q + | even _ => omega +theorem z47 {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 3 + q * 2 := by omega + subst hm + exact z0M q +theorem z48 {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = 1 + q * 2 := by omega + subst hm + exact z0N q + | even _ => omega +theorem z49 {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) : + ∀ {u : WordList} {n n' : Nat} {hs hs' : List Call}, + WordEffect n u n' v -> Num k [] hs -> Num k' [] hs' -> + Seg (([Call.ch] ^ n) ++ hs) (([Call.ch] ^ n') ++ hs') (wordsToBits u) (wordsToBits w) := by + induction hI with + | nil k => + intro u n n' hs hs' hE hN hN' + cases hE + rw [z3V hN hN'] + exact z0m (([Call.ch] ^ n) ++ hs') + | @T m _ _ _ _ _ _ ih => + intro u0 n0 n1 hs hs' hE hN hN' + cases hE with + | T hSub => + rcases z3U (by omega : 0 < 2 + m * 2) with ⟨hs0,hN0⟩ + have hIH := ih hSub hN0 hN' + have hStep := zSg (H_T n0) (z42 hN hN0) + have heq : ([Call.ch] ^ (n0 * 2)) ++ ([Call.ch] ++ hs0) = ([Call.ch] ^ (1 + n0 * 2)) ++ hs0 := by + have h1 : 1 + n0 * 2 = n0 * 2 + 1 := by omega + rw [h1,z0i,z0h,List.append_assoc] + rw [heq] at hStep + exact zS0 hStep hIH + | @pair0 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,K] ++ u) at hE + rcases wordEffect_split_output [Q,K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z3U hPos with ⟨hs0,hN0⟩ + have hD10 : DigitVal 1 2 [Q,K] := DigitVal.one (DigitVal.zero DigitVal.nil) + have hStep := zSg (zEd hL hD10) (z43 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @pair1 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,Q] ++ u) at hE + rcases wordEffect_split_output [Q,Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z3U (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD11 : DigitVal 3 2 [Q,Q] := DigitVal.one (DigitVal.one DigitVal.nil) + have hStep := zSg (zEd hL hD11) (z44 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short00 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z3U hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (z45 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short01 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z3U (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (z46 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short10 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z3U hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (z47 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short11 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z3U (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (z48 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') +theorem z4a {n : Nat} {r r' : HalfTape} + (hI : z3W (n * 2) r r') : z3W (1 + n) (d1 +> (d0 +> r)) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil,<- append_assoc d1 d0 r] + cases m with + | zero => + have hn0 : n * 2 = 0 := by omega + rw [hn0] at hI + have hr' := z3X hI + subst hr' + rw [<- append_assoc t one r] + exact zSc z0r (Side.nil r) + | succ m => + have h1m : m + 1 = 1 + m := by omega + rw [h1m] + refine zSc (z0F m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : n * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil,<- append_assoc d1 d0 r] + refine zSc (z0G m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (m * 2)) := by + have hm : n * 2 = 2 + (m * 2) * 2 := by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 +theorem z4b {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) {u : WordList} {r' : HalfTape} + (hE : WordEffect 0 u 1 v) (hK : 0 < k') (hC : z3W k' (d1 +> default) r') : + z3W k (evalWords u default) (evalWords w r') := by + intro w0 hs hN + have hPosK : 0 < k := phaseScan_pos_of_out_pos hI hK + have hw0 : w0 = [] := by cases hN <;> first | rfl | omega + subst hw0 + rcases z3U hK with ⟨hs',hN'⟩ + have hSeg := z49 hI hE hN hN' + dsimp at hSeg + have hSide := zSc hSeg (z0j z0O (hC [] hs' hN')) + rwa [wordsToBits_append_tape,wordsToBits_append_tape] at hSide +theorem z4c {orig out : WordList} (hS : Step orig out) : + ∃ r,z3W 12 (evalWords orig default) r /\ evalWords out default = t +> r := by + cases hS with + | intro eff k v a b J A da hE hI hDA hSum => + have hposJ := pow_two_pos J + have hPosK : 0 < k := by omega + have hDFull : DigitVal k (J + 1) (da ++ [Q]) := by + have h := digitVal_append hDA (DigitVal.one DigitVal.nil) + have heq : A + 1 * 2 ^ J = k := by omega + rwa [heq] at h + have hC0 : z3W ((k - 1) * 2) default (evalWords (da ++ [Q]) default) := + z41 hDFull hPosK + have hC1 : z3W k (d1 +> default) (evalWords (V :: (da ++ [Q])) default) := by + have h := z4a hC0 + have hk : 1 + (k - 1) = k := by omega + rwa [hk,zDd] at h + have hRun := z4b hI hE hPosK hC1 + rw [<- evalWords_append] at hRun + exact ⟨evalWords (v ++ V :: (da ++ [Q])) default,hRun,rfl⟩ +theorem z4d {r r' : HalfTape} (hI : z3W 12 r r') : + (zCf r) [target_tm]⊢⁺ zCf (t +> r') := by + have h_num : Num 12 [] ([.cj] ++ [.ch] ^ 5) := Num.even 5 + have hC := hI [] ([.cj] ++ [.ch] ^ 5) h_num + have hS := zSc z0R hC + rcases hS with _ | ⟨hca,hrest⟩ + rcases hrest with _ | ⟨hch,hnil⟩ + cases hnil + have h1 := zPt (z0S (w_pre +> r)) (hca ([1] +> default)) + have h2 := zPt (z0T _) (hch lh) + have h3 := zPt h1 h2 + rwa [append_assoc] at h3 +theorem z4e {orig out : WordList} (hS : Step orig out) : + (zCf (evalWords orig default)) [target_tm]⊢⁺ zCf (evalWords out default) := by + rcases z4c hS with ⟨r,hC,hEq⟩ + rw [hEq] + exact z4d hC +theorem z4f {u v : WordList} (hR : Rounds u v) : + (zCf (evalWords u default)) [target_tm]⊢* zCf (evalWords v default) := by + induction hR with + | refl u => exact ⟨0,rfl⟩ + | next hS _ ih => + rcases z4e hS with ⟨n1,_,hn1⟩ + rcases ih with ⟨n2,hn2⟩ + exact ⟨n1 + n2,zMt target_tm _ _ _ n1 n2 hn1 hn2⟩ +def zc_0 : CCfg := ⟨0,0,[],[]⟩ +def zc_1 : CCfg := ⟨5,1,[0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1],[1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1]⟩ +def zc_2 : CCfg := ⟨5,1,[0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1],[1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1]⟩ +def zc_3 : CCfg := ⟨1,1,[0, 1, 0, 0, 0, 1],[0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1]⟩ +def zc_4 : CCfg := ⟨1,1,[0, 0, 0, 1, 0, 1],[1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1]⟩ +def zc_5 : CCfg := ⟨0,1,[0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1],[1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1]⟩ +def zc_6 : CCfg := ⟨0,1,[1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1],[1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1]⟩ +def zc_7 : CCfg := ⟨4,0,[0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],[0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1]⟩ +def zc_8 : CCfg := ⟨2,1,[1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1],[0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1]⟩ +def zc_9 : CCfg := ⟨5,0,[0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1],[1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1]⟩ +def zc_10 : CCfg := ⟨0,1,[0, 0, 0, 0, 0, 0, 0, 1, 0, 1],[1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1]⟩ +def zc_11 : CCfg := ⟨1,0,[0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1],[1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1]⟩ +def zc_12 : CCfg := ⟨5,1,[0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1],[1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1]⟩ +def zc_13 : CCfg := ⟨5,0,[],[1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1]⟩ +def zc_14 : CCfg := ⟨4,1,[0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1],[1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1]⟩ +def zc_15 : CCfg := ⟨1,0,[0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1],[1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1]⟩ +def zc_16 : CCfg := ⟨5,0,[1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1],[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1]⟩ +def zc_17 : CCfg := ⟨5,1,[0, 0, 1, 0, 0, 0, 1, 0, 1],[1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1]⟩ +def zc_18 : CCfg := ⟨1,1,[1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1],[1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1]⟩ +def zc_19 : CCfg := ⟨1,0,[0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1],[1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1]⟩ +def zc_20 : CCfg := ⟨4,1,[0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1],[1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1]⟩ +def zc_21 : CCfg := ⟨1,1,[0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1],[1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1]⟩ +def zc_22 : CCfg := ⟨1,1,[0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1],[0, 1]⟩ +theorem zs_0 : zCm zc_0 250 = some zc_1 := by decide +theorem zs_1 : zCm zc_1 250 = some zc_2 := by decide +theorem zs_2 : zCm zc_2 250 = some zc_3 := by decide +theorem zs_3 : zCm zc_3 250 = some zc_4 := by decide +theorem zs_4 : zCm zc_4 250 = some zc_5 := by decide +theorem zs_5 : zCm zc_5 250 = some zc_6 := by decide +theorem zs_6 : zCm zc_6 250 = some zc_7 := by decide +theorem zs_7 : zCm zc_7 250 = some zc_8 := by decide +theorem zs_8 : zCm zc_8 250 = some zc_9 := by decide +theorem zs_9 : zCm zc_9 250 = some zc_10 := by decide +theorem zs_10 : zCm zc_10 250 = some zc_11 := by decide +theorem zs_11 : zCm zc_11 250 = some zc_12 := by decide +theorem zs_12 : zCm zc_12 250 = some zc_13 := by decide +theorem zs_13 : zCm zc_13 250 = some zc_14 := by decide +theorem zs_14 : zCm zc_14 250 = some zc_15 := by decide +theorem zs_15 : zCm zc_15 250 = some zc_16 := by decide +theorem zs_16 : zCm zc_16 250 = some zc_17 := by decide +theorem zs_17 : zCm zc_17 250 = some zc_18 := by decide +theorem zs_18 : zCm zc_18 250 = some zc_19 := by decide +theorem zs_19 : zCm zc_19 250 = some zc_20 := by decide +theorem zs_20 : zCm zc_20 250 = some zc_21 := by decide +theorem zs_21 : zCm zc_21 120 = some zc_22 := by decide +theorem z4t : + (init []) [target_tm]⊢* zCf (evalWords z3L default) := by + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = z04 zc_0 := rfl + have h2 : z04 zc_22 = zCf (evalWords z3L default) := by + unfold z04 zc_22 zCf zCL lh w_pre z3L + simp only [List.replicate,List.cons_append,List.nil_append,evalWords,wordsToBits,t,d1,d0,one,append_cons,append_nil,z00] + rfl + have hPlus : (z04 zc_0) [target_tm]⊢⁺ (z04 zc_22) := (zPt (zTc (by decide) zs_0) (zPt (zTc (by decide) zs_1) (zPt (zTc (by decide) zs_2) (zPt (zTc (by decide) zs_3) (zPt (zTc (by decide) zs_4) (zPt (zTc (by decide) zs_5) (zPt (zTc (by decide) zs_6) (zPt (zTc (by decide) zs_7) (zPt (zTc (by decide) zs_8) (zPt (zTc (by decide) zs_9) (zPt (zTc (by decide) zs_10) (zPt (zTc (by decide) zs_11) (zPt (zTc (by decide) zs_12) (zPt (zTc (by decide) zs_13) (zPt (zTc (by decide) zs_14) (zPt (zTc (by decide) zs_15) (zPt (zTc (by decide) zs_16) (zPt (zTc (by decide) zs_17) (zPt (zTc (by decide) zs_18) (zPt (zTc (by decide) zs_19) (zPt (zTc (by decide) zs_20) (zTc (by decide) zs_21)))))))))))))))))))))) + rw [<- h0,h2] at hPlus + rcases hPlus with ⟨n,_,hn⟩ + exact ⟨n,hn⟩ +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d) = some c') : + (multiStep target_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +theorem z4u (m : Nat) : + ∃ N ≥ m,∃ p q w, + multiStep target_tm (init []) N = some (zCf (evalWords w default)) /\ + AggState z3p p q w := by + induction m with + | zero => + rcases z3T with ⟨v0,hRounds,hGood0⟩ + rcases z4t with ⟨k1,hk1⟩ + rcases z4f hRounds with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,16,19,v0, + zMt target_tm _ _ _ k1 k2 hk1 hk2,hGood0⟩ + | succ m ih => + rcases ih with ⟨N,hN,p,q,w,h_ms,h_good⟩ + rcases aggState_step_of_copyTwelve z3p z3q z3y z3x p q w h_good + with ⟨w',hStep,h_good'⟩ + rcases z4e hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,1 + p,1 + q,w', + zMt target_tm _ _ _ N k h_ms h_step_k,h_good'⟩ + +end Solution + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 2000000 + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases Solution.z4u (n + 1) with ⟨N,hN,_,_,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := Solution.zIm h_N + rw [Solution.zMs,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RE_1RC0RB_0RD0RF_0LEHHH_1LF1LE_1LA0LE diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RE_1RC1LF_0LD0RE_HHH1LE_1RA0LB_1LB0LC.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1RC1LF_0LD0RE_HHH1LE_1RA0LB_1LB0LC.lean new file mode 100644 index 00000000..c8357218 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1RC1LF_0LD0RE_HHH1LE_1RA0LB_1LB0LC.lean @@ -0,0 +1,1336 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter + +open Mathlib Relation Nat Turing BusyBeaver SixState + +@[expose] public section + +namespace BusyBeaver.M_1RB0RE_1RC1LF_0LD0RE_HHH1LE_1RA0LB_1LB0LC + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1RC1LF_0LD0RE_HHH1LE_1RA0LB_1LB0LC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end BusyBeaver.M_1RB0RE_1RC1LF_0LD0RE_HHH1LE_1RA0LB_1LB0LC + +end + +namespace BusyBeaver.M_1RB0RE_1RC1LF_0LD0RE_HHH1LE_1RA0LB_1LB0LC + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +namespace Solution +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = + some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = + step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem pow_zero_list (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ + ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x + :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +theorem list_pow_append_one (u : List (Fin 2)) (k : Nat) : + u^k ++ u = u^(k + 1) := by + have h := list_pow_add_comm u k 1 + dsimp [HPow.hPow] at h ⊢ + rw [List.append_nil] at h + exact h + +theorem pow_add_append_right (u : List (Fin 2)) (m n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (m + n)) +> r = (u ^ m) +> ((u ^ n) +> r) := by + rw [list_pow_add, ← listblank_append_append] + +theorem pow_succ_append_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (n + 1)) +> r = u +> ((u ^ n) +> r) := by + rw [pow_succ_list, ← listblank_append_append] + +theorem pow_succ_append_right' (u : List (Fin 2)) (k : Nat) (r : ListBlank (Fin 2)) : + (u ^ k) +> (u +> r) = (u ^ (k + 1)) +> r := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (m n : Nat) : + s <+ (u ^ (m + n)) = (s <+ (u ^ m)) <+ (u ^ n) := by + rw [listblank_append_append, ← list_pow_add, add_comm] + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, _, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, + BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, + default_head, default_tail]) +macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> + (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> + (any_goals (first | finish | step))) +macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +-- ============================================================================ +-- Section 1: ListBlank Power Conversion Lemmas +-- ============================================================================ + +theorem cons_0_pow_10 (k : Nat) (r : ListBlank (Fin 2)) : + [0] +> ((([1, 0] : List (Fin 2)) ^ k) +> r) = (([0, 1] : List (Fin 2)) ^ k) +> ([0] +> r) := by + induction k generalizing r with + | zero => simp only [pow_zero_list, listblank_append_nil] + | succ k ih => + rw [pow_succ_append_right, pow_succ_append_right, ← ih] + rfl + +theorem cons_1_pow_01 (k : Nat) (r : ListBlank (Fin 2)) : + [1] +> ((([0, 1] : List (Fin 2)) ^ k) +> r) = (([1, 0] : List (Fin 2)) ^ k) +> ([1] +> r) := by + induction k generalizing r with + | zero => simp only [pow_zero_list, listblank_append_nil] + | succ k ih => + rw [pow_succ_append_right, pow_succ_append_right, ← ih] + rfl + +theorem append_0_pow_01 (X : ListBlank (Fin 2)) (k : Nat) : + (X <+ [0]) <+ (([0, 1] : List (Fin 2)) ^ k) = (X <+ (([1, 0] : List (Fin 2)) ^ k)) <+ [0] := + (cons_0_pow_10 k X).symm + +theorem append_1_pow_01 (X : ListBlank (Fin 2)) (k : Nat) : + (X <+ (([0, 1] : List (Fin 2)) ^ k)) <+ [1] = (X <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ k) := + cons_1_pow_01 k X + +theorem append_1_1 (X : ListBlank (Fin 2)) : (X <+ [1]) <+ [1] = X <+ [1, 1] := rfl + +theorem append_11_1 (X : ListBlank (Fin 2)) : (X <+ [1, 1]) <+ [1] = X <+ [1, 1, 1] := rfl + +theorem mul_pow2_ge (c k : Nat) : c ≤ c * (2 ^ k) := + Nat.le_mul_of_pos_right c (Nat.one_le_pow k 2 (by decide)) + +theorem cons_1_pow_11 (k : Nat) (r : ListBlank (Fin 2)) : + [1] +> ((([1, 1] : List (Fin 2)) ^ k) +> r) = (([1, 1] : List (Fin 2)) ^ k) +> ([1] +> r) := by + induction k generalizing r with + | zero => simp only [pow_zero_list, listblank_append_nil] + | succ k ih => + rw [pow_succ_append_right, pow_succ_append_right, ← ih] + rfl + +theorem pow_11_even (k : Nat) (r : ListBlank (Fin 2)) : + (([1, 1] : List (Fin 2)) ^ (2 * k)) +> r = (([1, 1, 1, 1] : List (Fin 2)) ^ k) +> r := by + induction k with + | zero => rfl + | succ k ih => + have h2 : 2 * (k + 1) = 2 + (2 * k) := by omega + rw [h2, pow_add_append_right, ih, pow_succ_append_right] + rfl + +-- ============================================================================ +-- Section 2: Core Shift Lemmas +-- ============================================================================ + +theorem shift_E_right_01 (k : Nat) (l r : ListBlank (Fin 2)) : + (l {{E}}> ((([0, 1] : List (Fin 2)) ^ k) +> r)) [target_tm]⊢* + ((l <+ (([0, 1] : List (Fin 2)) ^ k)) {{E}}> r) := by + induction k generalizing l r with + | zero => + simp only [pow_zero_list, listblank_append_nil] + exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_append_right] + have h1 : (l {{E}}> ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> r))) + [target_tm]⊢* + ((l <+ [0, 1]) {{E}}> ((([0, 1] : List (Fin 2)) ^ k) +> r)) := by + dsimp [ListBlank.append]; (iterate 2 step); finish + have h2 := ih (l <+ [0, 1]) r + rw [listblank_append_append, list_pow_append_one] at h2 + exact stepStar_trans h1 h2 + +theorem shift_B_left_10 (k : Nat) (l r : ListBlank (Fin 2)) : + ((l <+ (([1, 0] : List (Fin 2)) ^ k)) <{{B}} r) [target_tm]⊢* + (l <{{B}} ((([1, 1] : List (Fin 2)) ^ k) +> r)) := by + induction k generalizing l r with + | zero => + simp only [pow_zero_list, listblank_append_nil] + exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_list, ← listblank_append_append] + have h1 : (((l <+ (([1, 0] : List (Fin 2)) ^ k)) <+ [1, 0]) <{{B}} r) + [target_tm]⊢* + ((l <+ (([1, 0] : List (Fin 2)) ^ k)) <{{B}} ([1, 1] +> r)) := by + dsimp [ListBlank.append]; (iterate 2 step); finish + have h2 := ih l (([1, 1] : List (Fin 2)) +> r) + rw [listblank_append_append, list_pow_append_one] at h2 + exact stepStar_trans h1 h2 + +theorem shift_E_left_10 (k : Nat) (l r : ListBlank (Fin 2)) : + ((l <+ (([1, 0] : List (Fin 2)) ^ k)) <{{E}} r) [target_tm]⊢* + (l <{{E}} ((([1, 0] : List (Fin 2)) ^ k) +> r)) := by + induction k generalizing l r with + | zero => + simp only [pow_zero_list, listblank_append_nil] + exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_list, ← listblank_append_append] + have h1 : (((l <+ (([1, 0] : List (Fin 2)) ^ k)) <+ [1, 0]) <{{E}} r) + [target_tm]⊢* + ((l <+ (([1, 0] : List (Fin 2)) ^ k)) <{{E}} ([1, 0] +> r)) := by + dsimp [ListBlank.append]; (iterate 4 step); finish + have h2 := ih l (([1, 0] : List (Fin 2)) +> r) + rw [listblank_append_append, list_pow_append_one] at h2 + exact stepStar_trans h1 h2 + +-- ============================================================================ +-- Section 3: Bounce Lemmas & Rule 1 +-- ============================================================================ + +abbrev r0 : ListBlank (Fin 2) := [0, 1, 0, 1, 1, 0, 1] +> default + +theorem bounce_E_01 (l : ListBlank (Fin 2)) (d : Nat) (r : ListBlank (Fin 2)) : + ((l <+ [0, 1]) {{E}}> ((([0, 1] : List (Fin 2)) ^ d) +> ([1] +> r))) + [target_tm]⊢⁺ + ((l <+ [1]) <{{E}} ((([1, 0] : List (Fin 2)) ^ (d + 1)) +> r)) := by + have h1 := shift_E_right_01 d (l <+ [0, 1]) ([1] +> r) + have heq : (l <+ [0, 1]) <+ (([0, 1] : List (Fin 2)) ^ d) = + ((l <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ d)) <+ [0] := + append_0_pow_01 (l <+ [1]) d + rw [heq] at h1 + have h2 : ((((l <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ d)) <+ [0]) {{E}}> ([1] +> r)) + [target_tm]⊢⁺ + (((l <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ d)) <{{E}} ([1, 0] +> r)) := by + dsimp [ListBlank.append]; (iterate 4 step); finish + have h3 := shift_E_left_10 d (l <+ [1]) ([1, 0] +> r) + rw [pow_succ_append_right'] at h3 + exact stepStar_stepPlus_stepPlus h1 (stepPlus_stepStar_stepPlus h2 h3) + +theorem bounce_E_end (l : ListBlank (Fin 2)) (d : Nat) : + ((l <+ [0, 1]) {{E}}> ((([0, 1] : List (Fin 2)) ^ d) +> ([0, 0, 1] +> default))) + [target_tm]⊢⁺ + ((l <+ [1]) <{{B}} ((([1, 1] : List (Fin 2)) ^ d) +> r0)) := by + have h1 := shift_E_right_01 d (l <+ [0, 1]) ([0, 0, 1] +> default) + have heq : (l <+ [0, 1]) <+ (([0, 1] : List (Fin 2)) ^ d) = + ((l <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ d)) <+ [0] := + append_0_pow_01 (l <+ [1]) d + rw [heq] at h1 + have h2 : ((((l <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ d)) <+ [0]) {{E}}> ([0, 0, 1] +> default)) + [target_tm]⊢⁺ + (((l <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ d)) <{{B}} r0) := by + dsimp [r0, ListBlank.append]; (iterate 24 step); finish + have h3 := shift_B_left_10 d (l <+ [1]) r0 + exact stepStar_stepPlus_stepPlus h1 (stepPlus_stepStar_stepPlus h2 h3) + +theorem rule1_step (a : Nat) (r : ListBlank (Fin 2)) : + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (a + 1)) +> ([1, 1] +> r))) + [target_tm]⊢⁺ + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (a + 3)) +> r)) := by + rw [pow_succ_append_right] + have h1 : (default <{{E}} ([1, 0] +> ((([1, 0] : List (Fin 2)) ^ a) +> ([1, 1] +> r)))) + [target_tm]⊢⁺ + ((default <+ [0, 1]) {{E}}> ([0] +> ((([1, 0] : List (Fin 2)) ^ a) +> ([1, 1] +> r)))) := by + dsimp [ListBlank.append]; (iterate 2 step); finish + rw [cons_0_pow_10] at h1 + have heq : ([0] : List (Fin 2)) +> ([1, 1] +> r) = [0, 1] +> ([1] +> r) := rfl + rw [heq, pow_succ_append_right'] at h1 + have h2 := bounce_E_01 default (a + 1) r + have h3 : ((default <+ [1]) <{{E}} ((([1, 0] : List (Fin 2)) ^ (a + 2)) +> r)) + [target_tm]⊢⁺ + (default <{{E}} ([1, 0] +> ((([1, 0] : List (Fin 2)) ^ (a + 2)) +> r))) := by + dsimp [ListBlank.append]; (iterate 4 step); finish + rw [← pow_succ_append_right] at h3 + exact stepPlus_trans h1 (stepPlus_trans h2 h3) + +theorem rule1_loop (k a : Nat) (r : ListBlank (Fin 2)) : + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (a + 1)) +> ((([1, 1] : List (Fin 2)) ^ k) +> r))) + [target_tm]⊢* + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (a + 2 * k + 1)) +> r)) := by + induction k generalizing a with + | zero => + simp only [pow_zero_list, listblank_append_nil, Nat.mul_zero, Nat.add_zero] + exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_append_right] + have h1 := rule1_step a ((([1, 1] : List (Fin 2)) ^ k) +> r) + have h2 := ih (a + 2) + have heq : a + 2 + 2 * k + 1 = a + 2 * (k + 1) + 1 := by omega + rw [heq] at h2 + exact stepPlus_stepStar (stepPlus_stepStar_stepPlus h1 h2) + +theorem finish_B_left (m : Nat) (r : ListBlank (Fin 2)) : + (((default <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ m)) <{{B}} r) + [target_tm]⊢⁺ + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (2 * m + 2)) +> r)) := by + have h1 := shift_B_left_10 m (default <+ [1]) r + have h2 : ((default <+ [1]) <{{B}} ((([1, 1] : List (Fin 2)) ^ m) +> r)) + [target_tm]⊢⁺ + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ 2) +> ((([1, 1] : List (Fin 2)) ^ m) +> r))) := by + dsimp [ListBlank.append]; (iterate 12 step); finish + have h3 := rule1_loop m 1 r + have heq : 1 + 2 * m + 1 = 2 * m + 2 := by omega + rw [heq] at h3 + exact stepStar_stepPlus_stepPlus h1 (stepPlus_stepStar_stepPlus h2 h3) + +-- ============================================================================ +-- Section 4: Initial Sweep & Local Half-Steps +-- ============================================================================ + +theorem sweep_mid (a b : Nat) (r' : ListBlank (Fin 2)) : + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (a + 2)) +> ((([0, + 1] : List (Fin 2)) ^ (b + 1)) +> r'))) + [target_tm]⊢⁺ + ((((default <+ (([0, 1] : List (Fin 2)) ^ (a + 1))) <+ [0, 0, 1]) <+ [0, 1]) {{E}}> + ((([0, 1] : List (Fin 2)) ^ b) +> r')) := by + rw [pow_succ_append_right] + have h1 : (default <{{E}} ([1, 0] +> ((([1, 0] : List (Fin 2)) ^ (a + 1)) +> ((([0, + 1] : List (Fin 2)) ^ (b + 1)) +> r')))) + [target_tm]⊢⁺ + ((default <+ [0, 1]) {{E}}> ([0] +> ((([1, 0] : List (Fin 2)) ^ (a + 1)) +> ((([0, + 1] : List (Fin 2)) ^ (b + 1)) +> r')))) := by + dsimp [ListBlank.append]; (iterate 2 step); finish + rw [cons_0_pow_10] at h1 + have h2 := + shift_E_right_01 (a + 1) (default <+ [0, 1]) ([0] +> ((([0, + 1] : List (Fin 2)) ^ (b + 1)) +> r')) + have heq1 : (default <+ [0, 1]) <+ (([0, 1] : List (Fin 2)) ^ (a + 1)) = + (default <+ (([0, 1] : List (Fin 2)) ^ (a + 1))) <+ [0, 1] := by + rw [pow_succ_append_right', ← pow_succ_append_right] + rw [heq1, pow_succ_append_right] at h2 + have h3 : (((default <+ (([0, 1] : List (Fin 2)) ^ (a + 1))) <+ [0, 1]) {{E}}> + ([0] +> ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ b) +> r')))) + [target_tm]⊢⁺ + ((((default <+ (([0, 1] : List (Fin 2)) ^ (a + 1))) <+ [0, 0, 1]) <+ [0, 1]) {{E}}> + ((([0, 1] : List (Fin 2)) ^ b) +> r')) := by + dsimp [ListBlank.append]; (iterate 7 step); finish + exact stepPlus_trans (stepPlus_stepStar_stepPlus h1 h2) h3 + +theorem sweep_init (a b : Nat) (r : ListBlank (Fin 2)) : + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (a + 2)) +> ((([0, + 1] : List (Fin 2)) ^ (b + 1)) +> ([1] +> r)))) + [target_tm]⊢⁺ + (((default <+ (([0, 1] : List (Fin 2)) ^ (a + 1))) <+ [0, 1]) <{{E}} ((([1, + 0] : List (Fin 2)) ^ (b + 2)) +> r)) := by + have h1 := sweep_mid a b ([1] +> r) + have h2 := bounce_E_01 ((default <+ (([0, 1] : List (Fin 2)) ^ (a + 1))) <+ [0, 0, 1]) b r + have h3 : ((((default <+ (([0, 1] : List (Fin 2)) ^ (a + 1))) <+ [0, 0, 1]) <+ [1]) <{{E}} + ((([1, 0] : List (Fin 2)) ^ (b + 1)) +> r)) + [target_tm]⊢⁺ + (((default <+ (([0, 1] : List (Fin 2)) ^ (a + 1))) <+ [0, 1]) <{{E}} + ([1, 0] +> ((([1, 0] : List (Fin 2)) ^ (b + 1)) +> r))) := by + dsimp [ListBlank.append]; (iterate 4 step); finish + rw [← pow_succ_append_right] at h3 + exact stepPlus_trans h1 (stepPlus_trans h2 h3) + +theorem step14_E111 (l s : ListBlank (Fin 2)) : + (((l <+ (([0, 1] : List (Fin 2)) ^ 2)) <+ [1, 1, 1]) <{{E}} s) + [target_tm]⊢⁺ + (((l <+ [0, 0, 1, 1]) <+ [0, 1]) {{E}}> ([0] +> s)) := by + dsimp [ListBlank.append]; (iterate 14 step); finish + +theorem half_E1_a (l : ListBlank (Fin 2)) (d : Nat) (r : ListBlank (Fin 2)) : + (((l <+ (([0, 1] : List (Fin 2)) ^ 2)) <+ [1, 1, 1]) <{{E}} ((([1, + 0] : List (Fin 2)) ^ d) +> ([1, 1] +> r))) + [target_tm]⊢⁺ + ((l <+ [0, 1, 1]) <{{E}} ((([1, 0] : List (Fin 2)) ^ (d + 3)) +> r)) := by + have h1 := step14_E111 l ((([1, 0] : List (Fin 2)) ^ d) +> ([1, 1] +> r)) + rw [cons_0_pow_10] at h1 + have heq : ([0] : List (Fin 2)) +> ([1, 1] +> r) = [0, 1] +> ([1] +> r) := rfl + rw [heq, pow_succ_append_right'] at h1 + have h2 := bounce_E_01 (l <+ [0, 0, 1, 1]) (d + 1) r + have h3 : (((l <+ [0, 0, 1, 1]) <+ [1]) <{{E}} ((([1, 0] : List (Fin 2)) ^ (d + 2)) +> r)) + [target_tm]⊢⁺ + ((l <+ [0, 1, 1]) <{{E}} ([1, 0] +> ((([1, 0] : List (Fin 2)) ^ (d + 2)) +> r))) := by + dsimp [ListBlank.append]; (iterate 4 step); finish + rw [← pow_succ_append_right] at h3 + exact stepPlus_trans h1 (stepPlus_trans h2 h3) + +theorem half_E1_b (l : ListBlank (Fin 2)) (d : Nat) (r : ListBlank (Fin 2)) : + ((l <+ [0]) <{{E}} ((([1, 0] : List (Fin 2)) ^ (d + 1)) +> ([1, 1] +> r))) + [target_tm]⊢⁺ + ((l <+ [1]) <{{E}} ((([1, 0] : List (Fin 2)) ^ (d + 2)) +> r)) := by + rw [pow_succ_append_right] + have h1 : ((l <+ [0]) <{{E}} ([1, 0] +> ((([1, 0] : List (Fin 2)) ^ d) +> ([1, 1] +> r)))) + [target_tm]⊢⁺ + ((l <+ [0, 1]) {{E}}> ([0] +> ((([1, 0] : List (Fin 2)) ^ d) +> ([1, 1] +> r)))) := by + dsimp [ListBlank.append]; (iterate 2 step); finish + rw [cons_0_pow_10] at h1 + have heq : ([0] : List (Fin 2)) +> ([1, 1] +> r) = [0, 1] +> ([1] +> r) := rfl + rw [heq, pow_succ_append_right'] at h1 + have h2 := bounce_E_01 l (d + 1) r + exact stepPlus_trans h1 h2 + +theorem loop_E1_step (l : ListBlank (Fin 2)) (d : Nat) (r : ListBlank (Fin 2)) : + (((l <+ (([0, 1] : List (Fin 2)) ^ 2)) <+ [1, 1, 1]) <{{E}} ((([1, + 0] : List (Fin 2)) ^ d) +> ([1, 1, 1, 1] +> r))) + [target_tm]⊢⁺ + ((l <+ [1, 1, 1]) <{{E}} ((([1, 0] : List (Fin 2)) ^ (d + 4)) +> r)) := by + have heq_r : ([1, 1, 1, 1] : List (Fin 2)) +> r = [1, 1] +> ([1, 1] +> r) := rfl + rw [heq_r] + have h1 := half_E1_a l d ([1, 1] +> r) + have heq_l : (l <+ [0, 1, 1]) = ((l <+ [1, 1]) <+ [0]) := rfl + rw [heq_l] at h1 + have h2 := half_E1_b (l <+ [1, 1]) (d + 2) r + exact stepPlus_trans h1 h2 + +theorem loop_E1_iter (k : Nat) (l : ListBlank (Fin 2)) (d : Nat) (r : ListBlank (Fin 2)) : + (((l <+ (([0, 1] : List (Fin 2)) ^ (2 * k))) <+ [1, 1, 1]) <{{E}} + ((([1, 0] : List (Fin 2)) ^ d) +> ((([1, 1, 1, 1] : List (Fin 2)) ^ k) +> r))) + [target_tm]⊢* + ((l <+ [1, 1, 1]) <{{E}} ((([1, 0] : List (Fin 2)) ^ (d + 4 * k)) +> r)) := by + induction k generalizing l d with + | zero => + simp only [Nat.mul_zero, pow_zero_list, listblank_append_nil, Nat.add_zero] + exact ⟨0, rfl⟩ + | succ k ih => + have h2k : 2 * (k + 1) = 2 * k + 2 := by omega + rw [h2k, pow_add_append_left, pow_succ_append_right] + have h1 := + loop_E1_step (l <+ (([0, 1] : List (Fin 2)) ^ (2 * k))) d ((([1, 1, 1, + 1] : List (Fin 2)) ^ k) +> r) + have h2 := ih l (d + 4) + have hd : d + 4 + 4 * k = d + 4 * (k + 1) := by omega + rw [hd] at h2 + exact stepPlus_stepStar (stepPlus_stepStar_stepPlus h1 h2) + +-- ============================================================================ +-- Section 5: Rule 2 & c = 2 Transitions +-- ============================================================================ + +theorem rule2_gen (a b m : Nat) (r : ListBlank (Fin 2)) : + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (a + 2)) +> ((([0, 1] : List (Fin 2)) ^ (b + 1)) +> + ([1] +> ((([1, 0] : List (Fin 2)) ^ m) +> ([1, 1] +> r)))))) + [target_tm]⊢⁺ + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (2 * a + 4)) +> ((([0, + 1] : List (Fin 2)) ^ (b + m + 3)) +> ([0] +> r)))) := by + have h1 := sweep_init a b ((([1, 0] : List (Fin 2)) ^ m) +> ([1, 1] +> r)) + rw [← pow_add_append_right] at h1 + have heq_bm : b + 2 + m = (b + m + 1) + 1 := by omega + rw [heq_bm] at h1 + have heq_l : ((default <+ (([0, 1] : List (Fin 2)) ^ (a + 1))) <+ [0, 1]) = + (((default <+ (([0, 1] : List (Fin 2)) ^ (a + 1))) <+ [1]) <+ [0]) := rfl + rw [heq_l] at h1 + have h2 := half_E1_b ((default <+ (([0, 1] : List (Fin 2)) ^ (a + 1))) <+ [1]) (b + m + 1) r + have heq_bm2 : b + m + 1 + 2 = b + m + 3 := by omega + rw [heq_bm2] at h2 + have h3 : ((((default <+ (([0, 1] : List (Fin 2)) ^ (a + 1))) <+ [1]) <+ [1]) <{{E}} + ((([1, 0] : List (Fin 2)) ^ (b + m + 3)) +> r)) + [target_tm]⊢⁺ + (((default <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ (a + 1))) <{{B}} + ((([0, 1] : List (Fin 2)) ^ (b + m + 3)) +> ([0] +> r))) := by + rw [← cons_0_pow_10, ← append_1_pow_01] + dsimp [ListBlank.append]; (iterate 1 step); finish + have h4 := finish_B_left (a + 1) ((([0, 1] : List (Fin 2)) ^ (b + m + 3)) +> ([0] +> r)) + have ha : 2 * (a + 1) + 2 = 2 * a + 4 := by omega + rw [ha] at h4 + exact stepPlus_trans h1 (stepPlus_trans h2 (stepPlus_trans h3 h4)) + +theorem rule2_step (a b : Nat) (r : ListBlank (Fin 2)) : + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (a + 2)) +> ((([0, 1] : List (Fin 2)) ^ (b + 1)) +> + ([1, 1, 1, 1] +> r)))) + [target_tm]⊢⁺ + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (2 * a + 4)) +> ((([0, + 1] : List (Fin 2)) ^ (b + 4)) +> r))) := by + have h1 := rule2_gen a b 0 ([1] +> r) + simp only [pow_zero_list, listblank_append_nil, Nat.add_zero] at h1 + have heq1 : ([1] : List (Fin 2)) +> ([1, 1] +> ([1] +> r)) = [1, 1, 1, 1] +> r := rfl + have heq2 : ([0] : List (Fin 2)) +> ([1] +> r) = [0, 1] +> r := rfl + rw [heq1, heq2, pow_succ_append_right'] at h1 + exact h1 + +theorem rule2_loop (k a b : Nat) (r : ListBlank (Fin 2)) : + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (a + 2)) +> ((([0, 1] : List (Fin 2)) ^ (b + 1)) +> + ((([1, 1, 1, 1] : List (Fin 2)) ^ k) +> r)))) + [target_tm]⊢* + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ ((a + 2) * (2 ^ k))) +> + ((([0, 1] : List (Fin 2)) ^ (b + 3 * k + 1)) +> r))) := by + induction k generalizing a b with + | zero => + simp only [pow_zero_list, listblank_append_nil, Nat.pow_zero, Nat.mul_one, Nat.mul_zero, + Nat.add_zero] + exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_append_right] + have h1 := rule2_step a b ((([1, 1, 1, 1] : List (Fin 2)) ^ k) +> r) + have h2 := ih (2 * a + 2) (b + 3) + have ha : (2 * a + 2 + 2) * (2 ^ k) = (a + 2) * (2 ^ (k + 1)) := by + have : 2 * a + 2 + 2 = (a + 2) * 2 := by omega + rw [this, Nat.mul_assoc, Nat.mul_comm 2 (2 ^ k), ← Nat.pow_succ] + have hb : b + 3 + 3 * k + 1 = b + 3 * (k + 1) + 1 := by omega + rw [ha, hb] at h2 + exact stepPlus_stepStar (stepPlus_stepStar_stepPlus h1 h2) + +theorem trans_c2_v1 (a b : Nat) : + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (a + 2)) +> ((([0, + 1] : List (Fin 2)) ^ (b + 1)) +> ([1, 1] +> r0)))) + [target_tm]⊢⁺ + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (2 * a + 4)) +> ((([0, + 1] : List (Fin 2)) ^ (b + 5)) +> ([0, 0, 1] +> default)))) := by + have heq_r0 : ([1, 1] : List (Fin 2)) +> r0 = + [1] +> ((([1, 0] : List (Fin 2)) ^ 2) +> ([1, 1] +> ([0, 1] +> default))) := rfl + rw [heq_r0] + have h1 := rule2_gen a b 2 ([0, 1] +> default) + have hb : b + 2 + 3 = b + 5 := by omega + have hr : ([0] : List (Fin 2)) +> ([0, 1] +> default) = [0, 0, 1] +> default := rfl + rw [hb, hr] at h1 + exact h1 + +theorem trans_c2_v2 (a b : Nat) : + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (a + 2)) +> ((([0, + 1] : List (Fin 2)) ^ (b + 2)) +> ([0, 0, 1] +> default)))) + [target_tm]⊢⁺ + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (2 * a + 4)) +> + ((([0, 1] : List (Fin 2)) ^ 2) +> ((([1, 1] : List (Fin 2)) ^ b) +> ([1] +> r0))))) := by + have h1 := sweep_mid a (b + 1) ([0, 0, 1] +> default) + have h2 := bounce_E_end ((default <+ (([0, 1] : List (Fin 2)) ^ (a + 1))) <+ [0, 0, 1]) (b + 1) + rw [pow_succ_append_right] at h2 + have h3 : ((((default <+ (([0, 1] : List (Fin 2)) ^ (a + 1))) <+ [0, 0, 1]) <+ [1]) <{{B}} + ([1, 1] +> ((([1, 1] : List (Fin 2)) ^ b) +> r0))) + [target_tm]⊢⁺ + (((default <+ (([0, 1] : List (Fin 2)) ^ (a + 1))) <+ [1]) <{{B}} + ((([0, 1] : List (Fin 2)) ^ 2) +> ([1] +> ((([1, 1] : List (Fin 2)) ^ b) +> r0)))) := by + dsimp [ListBlank.append]; (iterate 9 step); finish + rw [append_1_pow_01, cons_1_pow_11] at h3 + have h4 := + finish_B_left (a + 1) ((([0, 1] : List (Fin 2)) ^ 2) +> ((([1, + 1] : List (Fin 2)) ^ b) +> ([1] +> r0))) + have ha : 2 * (a + 1) + 2 = 2 * a + 4 := by omega + rw [ha] at h4 + exact stepPlus_trans h1 (stepPlus_trans h2 (stepPlus_trans h3 h4)) + +theorem stepPlus_E_congr {M : Machine (Fin 2) (Fin 6)} {c0 : Cfg (Fin 2) (Fin 6)} + {A A' : Nat} {R R' : ListBlank (Fin 2)} + (hA : A = A') (hR : R = R') + (h : c0 [M]⊢⁺ (default <{{E}} ((([1, 0] : List (Fin 2)) ^ A) +> R))) : + c0 [M]⊢⁺ (default <{{E}} ((([1, 0] : List (Fin 2)) ^ A') +> R')) := by + subst hA; subst hR; exact h + +theorem stepStar_E_congr {M : Machine (Fin 2) (Fin 6)} {c0 : Cfg (Fin 2) (Fin 6)} + {A A' : Nat} {R R' : ListBlank (Fin 2)} + (hA : A = A') (hR : R = R') + (h : c0 [M]⊢* (default <{{E}} ((([1, 0] : List (Fin 2)) ^ A) +> R))) : + c0 [M]⊢* (default <{{E}} ((([1, 0] : List (Fin 2)) ^ A') +> R')) := by + subst hA; subst hR; exact h + +theorem tail_01_congr {B B' : Nat} {r r' : ListBlank (Fin 2)} + (hB : B = B') (hr : r = r') : + ((([0, 1] : List (Fin 2)) ^ B) +> r) = ((([0, 1] : List (Fin 2)) ^ B') +> r') := by + subst hB; subst hr; rfl + +theorem cycle_c2_to_c1 (a k : Nat) : + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (a + 2)) +> ((([0, + 1] : List (Fin 2)) ^ (2 * k + 2)) +> ([1, 1] +> r0)))) + [target_tm]⊢⁺ + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ ((4 * a + 8) * (2 ^ (k + 2)))) +> + ((([0, 1] : List (Fin 2)) ^ (3 * k + 8)) +> ([1] +> r0)))) := by + have hb1 : 2 * k + 2 = (2 * k + 1) + 1 := by omega + have ha2 : 2 * a + 4 = (2 * a + 2) + 2 := by omega + have hb2 : 2 * k + 1 + 5 = (2 * (k + 2)) + 2 := by omega + have ha3 : 2 * (2 * a + 2) + 4 = (4 * a + 6) + 2 := by omega + have ha4 : (4 * a + 6 + 2) * (2 ^ (k + 2)) = (4 * a + 8) * (2 ^ (k + 2)) := by + have : 4 * a + 6 + 2 = 4 * a + 8 := by omega + rw [this] + have hb4 : 1 + 3 * (k + 2) + 1 = 3 * k + 8 := by omega + rw [hb1] + have h1 := trans_c2_v1 a (2 * k + 1) + rw [ha2, hb2] at h1 + have h2 := trans_c2_v2 (2 * a + 2) (2 * (k + 2)) + rw [ha3, pow_11_even] at h2 + have h3' := + stepStar_E_congr ha4 (tail_01_congr hb4 rfl) (rule2_loop (k + 2) (4 * a + 6) 1 ([1] +> r0)) + exact stepPlus_stepStar_stepPlus (stepPlus_trans h1 h2) h3' + +-- ============================================================================ +-- Section 6: c = 1 Even & Odd Transition Lemmas +-- ============================================================================ + +set_option maxRecDepth 4000 in +theorem cap_c1_part1 (Y : ListBlank (Fin 2)) : + ((Y <+ [0, 1, 0]) {{E}}> ((([0, 1] : List (Fin 2)) ^ 5) +> ([0] +> r0))) + [target_tm]⊢⁺ + ((Y <+ [0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0]) {{E}}> ([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, + 1] +> default)) := by + dsimp [r0, ListBlank.append] + (iterate 120 step); finish + +set_option maxRecDepth 4000 in +theorem cap_c1_part2 (Y : ListBlank (Fin 2)) : + ((Y <+ [0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0]) {{E}}> ([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, + 1] +> default)) + [target_tm]⊢⁺ + ((Y <+ [1, 0]) <{{B}} ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, + 1] : List (Fin 2)) ^ 5) +> r0))) := by + dsimp [r0, ListBlank.append] + (iterate 128 step); finish + +theorem cap_c1_248 (Y : ListBlank (Fin 2)) : + ((Y <+ [0, 1, 0]) {{E}}> ((([0, 1] : List (Fin 2)) ^ 5) +> ([0] +> r0))) + [target_tm]⊢⁺ + ((Y <+ [1, 0]) <{{B}} ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, + 1] : List (Fin 2)) ^ 5) +> r0))) := + stepPlus_trans (cap_c1_part1 Y) (cap_c1_part2 Y) + +theorem pass_cap_c1 (X : ListBlank (Fin 2)) (d : Nat) : + ((X <+ [0, 1]) {{E}}> ((([0, 1] : List (Fin 2)) ^ (d + 6)) +> ([0] +> r0))) + [target_tm]⊢⁺ + ((X <+ [1]) <{{B}} ((([1, 1] : List (Fin 2)) ^ (d + 1)) +> ((([0, + 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ 5) +> r0)))) := by + have hd : d + 6 = (d + 1) + 5 := by omega + rw [hd, pow_add_append_right] + have h1 := shift_E_right_01 (d + 1) (X <+ [0, 1]) ((([0, 1] : List (Fin 2)) ^ 5) +> ([0] +> r0)) + have heq1 : (X <+ [0, 1]) <+ (([0, 1] : List (Fin 2)) ^ (d + 1)) = + ((X <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ d)) <+ [0, 1, 0] := by + have := append_0_pow_01 (X <+ [1]) (d + 1) + rw [pow_succ_list, ← listblank_append_append] at this + exact this + rw [heq1] at h1 + have h2 := cap_c1_248 ((X <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ d)) + have heq2 : (((X <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ d)) <+ [1, 0]) = + (X <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ (d + 1)) := by + rw [pow_succ_list, ← listblank_append_append] + rw [heq2] at h2 + have h3 := + shift_B_left_10 (d + 1) (X <+ [1]) ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, + 1] : List (Fin 2)) ^ 5) +> r0)) + exact stepStar_stepPlus_stepPlus h1 (stepPlus_stepStar_stepPlus h2 h3) + +theorem glue_B_11_to_E011 (l s : ListBlank (Fin 2)) : + (((l <+ (([0, 1] : List (Fin 2)) ^ 2)) <+ [1, 1]) <{{B}} ([1, 1, 1, 1] +> s)) + [target_tm]⊢⁺ + ((l <+ [0, 1, 1]) <{{E}} ((([1, 0] : List (Fin 2)) ^ 2) +> ([1, 1] +> ([1] +> s)))) := by + dsimp [ListBlank.append]; (iterate 21 step); finish + +theorem glue_B_111_to_E111 (l s : ListBlank (Fin 2)) : + (((l <+ (([0, 1] : List (Fin 2)) ^ 2)) <+ [1, 1]) <{{B}} ([1, 1, 1, 1] +> s)) + [target_tm]⊢⁺ + ((l <+ [1, 1, 1]) <{{E}} ((([1, 0] : List (Fin 2)) ^ 3) +> ([1] +> s))) := by + have h1 := glue_B_11_to_E011 l s + have heq : (l <+ [0, 1, 1]) = ((l <+ [1, 1]) <+ [0]) := rfl + rw [heq] at h1 + have h2 := half_E1_b (l <+ [1, 1]) 1 ([1] +> s) + exact stepPlus_trans h1 h2 + +theorem glue_B10011_to_E111 (l s : ListBlank (Fin 2)) : + (((l <+ [0, 0, 1, 1]) <+ [1]) <{{B}} s) + [target_tm]⊢⁺ + ((l <+ [1, 1, 1]) <{{E}} ([1, 0] +> s)) := by + dsimp [ListBlank.append]; (iterate 8 step); finish + +theorem bounce_E111_end (l : ListBlank (Fin 2)) (d : Nat) : + (((l <+ (([0, 1] : List (Fin 2)) ^ 2)) <+ [1, 1, 1]) <{{E}} + ((([1, 0] : List (Fin 2)) ^ (d + 1)) +> ([0, 1] +> default))) + [target_tm]⊢⁺ + ((l <+ [1, 1, 1]) <{{E}} ((([1, 0] : List (Fin 2)) ^ 1) +> ((([1, + 1] : List (Fin 2)) ^ (d + 1)) +> r0))) := by + have h1 := step14_E111 l ((([1, 0] : List (Fin 2)) ^ (d + 1)) +> ([0, 1] +> default)) + rw [cons_0_pow_10] at h1 + have heq : ([0] : List (Fin 2)) +> ([0, 1] +> default) = [0, 0, 1] +> default := rfl + rw [heq] at h1 + have h2 := bounce_E_end (l <+ [0, 0, 1, 1]) (d + 1) + have h3 := glue_B10011_to_E111 l ((([1, 1] : List (Fin 2)) ^ (d + 1)) +> r0) + exact stepPlus_trans h1 (stepPlus_trans h2 h3) + +theorem glue_B_11101_to_B1 (l s : ListBlank (Fin 2)) : + (((l <+ (([0, 1] : List (Fin 2)) ^ 2)) <+ [1, 1, 1]) <{{B}} ([1, 1, 1, 1] +> s)) + [target_tm]⊢⁺ + (((l <+ [0, 1]) <+ [1]) <{{B}} ((([0, 1] : List (Fin 2)) ^ 4) +> s)) := by + dsimp [ListBlank.append]; (iterate 32 step); finish + +theorem step_E01_10 (X Y : ListBlank (Fin 2)) : + ((X <+ [0, 1]) <{{E}} ([1, 0] +> Y)) + [target_tm]⊢⁺ + (((X <+ [1]) <+ [0, 1]) {{E}}> ([0] +> Y)) := by + dsimp [ListBlank.append]; (iterate 2 step); finish + +theorem step_E011_10 (X Y : ListBlank (Fin 2)) : + ((X <+ [0, 1, 1]) <{{E}} ([1, 0] +> Y)) + [target_tm]⊢⁺ + (((X <+ [1, 1]) <+ [0, 1]) {{E}}> ([0] +> Y)) := by + dsimp [ListBlank.append]; (iterate 2 step); finish + +theorem append_011 (X : ListBlank (Fin 2)) : X <+ [0, 1, 1] = (X <+ [1, 1]) <+ [0] := rfl + +theorem pow2_11_append (X : ListBlank (Fin 2)) : + (([1, 1] : List (Fin 2)) ^ 2) +> X = [1, 1, 1, 1] +> X := rfl + +theorem r0_11_pow5_1 : + ((([1, 1] : List (Fin 2)) ^ 5) +> ([1] +> r0)) = + [1, 1] +> ([1, 1, 1, 1] +> ([1, 1, 1, 1] +> ((([1, 0] : List (Fin 2)) ^ 2) +> ([1, 1] +> ([0, + 1] +> default))))) := rfl + +theorem r0_11_pow5_2 : + ((([1, 1] : List (Fin 2)) ^ 5) +> ([1] +> r0)) = + [1, 1, 1, 1] +> ([1, 1, 1, 1] +> ([1, 1] +> ((([1, 0] : List (Fin 2)) ^ 2) +> ([1, 1] +> ([0, + 1] +> default))))) := rfl + +theorem r0_11_pow5_3 : + ((([1, 1] : List (Fin 2)) ^ 5) +> r0) = + (([1, 1, 1, 1] : List (Fin 2)) ^ 2) +> ([1, 1] +> r0) := rfl + +set_option maxRecDepth 4000 in +theorem stem_part1 : + (init []) [target_tm]⊢⁺ + ((default <+ [1]) <{{E}} ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, + 1] +> default)) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init]; dsimp [ListBlank.append] + (iterate 200 step); finish + +set_option maxRecDepth 4000 in +theorem stem_part2 : + ((default <+ [1]) <{{E}} ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, + 1] +> default)) + [target_tm]⊢⁺ + ((default <+ [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]) {{E}}> ([0, 1, + 0, 0, 1, 0, 1, 1, 0, 1] +> default)) := by + dsimp [ListBlank.append] + (iterate 200 step); finish + +set_option maxRecDepth 4000 in +theorem stem_part3 : + ((default <+ [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]) {{E}}> ([0, 1, + 0, 0, 1, 0, 1, 1, 0, 1] +> default)) + [target_tm]⊢⁺ + ((default <+ [1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1]) <{{B}} ([1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1] +> default)) := by + dsimp [ListBlank.append] + (iterate 200 step); finish + +set_option maxRecDepth 4000 in +theorem stem_part4 : + ((default <+ [1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1]) <{{B}} ([1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1] +> default)) + [target_tm]⊢⁺ + ((default <+ [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]) <{{E}} ([1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1] +> default)) := by + dsimp [ListBlank.append] + (iterate 200 step); finish + +set_option maxRecDepth 4000 in +theorem stem_part5 : + ((default <+ [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]) <{{E}} ([1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1] +> default)) + [target_tm]⊢⁺ + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ 14) +> ((([0, 1] : List (Fin 2)) ^ 4) +> + ((([1, 1, 1, 1] : List (Fin 2)) ^ 2) +> ([1, 1] +> r0))))) := by + dsimp [r0, ListBlank.append] + (iterate 176 step); finish + + +theorem trans_c1_even (a m : Nat) : + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (a + 2 * m + 17)) +> + ((([0, 1] : List (Fin 2)) ^ (2 * m + 8)) +> ([1] +> r0)))) + [target_tm]⊢⁺ + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (2 * a + 12)) +> + ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ (4 * m + 21)) +> r0)))) := by + have ha0 : a + 2 * m + 17 = (a + 2 * m + 15) + 2 := by omega + have hb0 : 2 * m + 8 = (2 * m + 7) + 1 := by omega + rw [ha0, hb0] + have h1 := sweep_init (a + 2 * m + 15) (2 * m + 7) r0 + have hd1 : 2 * m + 7 + 2 = (2 * m + 8) + 1 := by omega + rw [hd1, pow_succ_append_right [1, 0] (2 * m + 8) r0] at h1 + have h2 := step_E01_10 + (default <+ (([0, 1] : List (Fin 2)) ^ (a + 2 * m + 15 + 1))) + ((([1, 0] : List (Fin 2)) ^ (2 * m + 8)) +> r0) + rw [cons_0_pow_10] at h2 + have hd2 : 2 * m + 8 = (2 * m + 2) + 6 := by omega + rw [hd2] at h2 + have h3 := + pass_cap_c1 ((default <+ (([0, 1] : List (Fin 2)) ^ (a + 2 * m + 15 + 1))) <+ [1]) (2 * m + 2) + have heq3 : (((default <+ (([0, 1] : List (Fin 2)) ^ (a + 2 * m + 15 + 1))) <+ [1]) <+ [1]) = + (((default <+ (([0, 1] : List (Fin 2)) ^ (a + 14))) <+ (([0, 1] : List (Fin 2)) ^ (2 * m))) <+ + (([0, 1] : List (Fin 2)) ^ 2)) <+ [1, 1] := by + have h_exp : a + 2 * m + 15 + 1 = ((a + 14) + 2 * m) + 2 := by omega + rw [h_exp, pow_add_append_left, pow_add_append_left, append_1_1] + have hr3 : ((([1, 1] : List (Fin 2)) ^ (2 * m + 2 + 1)) +> ((([0, + 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ 5) +> r0))) = + [1, 1, 1, 1] +> ((([1, 1] : List (Fin 2)) ^ (2 * m)) +> ([1, 1] +> ((([0, + 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ 5) +> r0)))) := by + have : 2 * m + 2 + 1 = 2 + (2 * m + 1) := by omega + rw [this, pow_add_append_right, pow_succ_append_right', pow2_11_append] + rw [heq3, hr3] at h3 + have h4 := glue_B_111_to_E111 + ((default <+ (([0, 1] : List (Fin 2)) ^ (a + 14))) <+ (([0, 1] : List (Fin 2)) ^ (2 * m))) + ((([1, 1] : List (Fin 2)) ^ (2 * m)) +> ([1, 1] +> ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, + 1] : List (Fin 2)) ^ 5) +> r0)))) + rw [cons_1_pow_11, pow_11_even m ([1] +> ([1, 1] +> ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, + 1] : List (Fin 2)) ^ 5) +> r0))))] at h4 + have h5 := loop_E1_iter m (default <+ (([0, 1] : List (Fin 2)) ^ (a + 14))) 3 + ([1] +> ([1, 1] +> ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ 5) +> r0)))) + have hl5 : ((default <+ (([0, 1] : List (Fin 2)) ^ (a + 14))) <+ [1, 1, 1]) = + (((default <+ (([0, 1] : List (Fin 2)) ^ (((a + 6) + 2) + 2 + 2))) <+ (([0, + 1] : List (Fin 2)) ^ 2)) <+ [1, 1, 1]) := by + have ha5 : a + 14 = (((a + 6) + 2) + 2 + 2) + 2 := by omega + rw [ha5, pow_add_append_left] + have hr5 : ((([1, 0] : List (Fin 2)) ^ (3 + 4 * m)) +> ([1] +> ([1, 1] +> ((([0, + 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ 5) +> r0))))) = + ((([1, 0] : List (Fin 2)) ^ (3 + 4 * m)) +> ([1, 1] +> ([1] +> ((([0, + 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ 5) +> r0))))) := rfl + rw [hl5, hr5] at h5 + have h6 := half_E1_a + (default <+ (([0, 1] : List (Fin 2)) ^ (((a + 6) + 2) + 2 + 2))) + (3 + 4 * m) + ([1] +> ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ 5) +> r0))) + have hl6 : ((default <+ (([0, 1] : List (Fin 2)) ^ (((a + 6) + 2) + 2 + 2))) <+ [0, 1, 1]) = + (((default <+ (([0, 1] : List (Fin 2)) ^ (((a + 6) + 2) + 2 + 2))) <+ [1, 1]) <+ [0]) := + append_011 _ + have hr6' : ((([1, 0] : List (Fin 2)) ^ (3 + 4 * m + 3)) +> ([1] +> ((([0, + 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ 5) +> r0)))) = + ((([1, 0] : List (Fin 2)) ^ ((4 * m + 9) + 1)) +> ([1, 1] +> ([1, 1, 1, 1] +> ([1, 1, 1, + 1] +> ((([1, 0] : List (Fin 2)) ^ 2) +> ([1, 1] +> ([0, 1] +> default))))))) := by + have hd6 : 3 + 4 * m + 3 + 4 = (4 * m + 9) + 1 := by omega + have hr6 := r0_11_pow5_1 + rw [cons_1_pow_01, cons_1_pow_11, ← pow_add_append_right [1, 0], hd6, hr6] + rw [hl6, hr6'] at h6 + have h7 := half_E1_b + ((default <+ (([0, 1] : List (Fin 2)) ^ (((a + 6) + 2) + 2 + 2))) <+ [1, 1]) + (4 * m + 9) + ([1, 1, 1, 1] +> ([1, 1, 1, 1] +> ((([1, 0] : List (Fin 2)) ^ 2) +> ([1, 1] +> ([0, + 1] +> default))))) + have hl7 : (((default <+ (([0, 1] : List (Fin 2)) ^ (((a + 6) + 2) + 2 + 2))) <+ [1, 1]) <+ [1]) = + ((((default <+ (([0, 1] : List (Fin 2)) ^ (a + 6))) <+ (([0, 1] : List (Fin 2)) ^ 2)) <+ (([0, + 1] : List (Fin 2)) ^ 2)) <+ + (([0, 1] : List (Fin 2)) ^ 2)) <+ [1, 1, 1] := by + rw [pow_add_append_left, pow_add_append_left, pow_add_append_left, append_11_1] + rw [hl7] at h7 + have h8 := loop_E1_step + (((default <+ (([0, 1] : List (Fin 2)) ^ (a + 6))) <+ (([0, 1] : List (Fin 2)) ^ 2)) <+ (([0, + 1] : List (Fin 2)) ^ 2)) + (4 * m + 9 + 2) + ([1, 1, 1, 1] +> ((([1, 0] : List (Fin 2)) ^ 2) +> ([1, 1] +> ([0, 1] +> default)))) + have h9 := loop_E1_step + ((default <+ (([0, 1] : List (Fin 2)) ^ (a + 6))) <+ (([0, 1] : List (Fin 2)) ^ 2)) + (4 * m + 9 + 2 + 4) + ((([1, 0] : List (Fin 2)) ^ 2) +> ([1, 1] +> ([0, 1] +> default))) + rw [← pow_add_append_right [1, 0]] at h9 + have h10 := half_E1_a + (default <+ (([0, 1] : List (Fin 2)) ^ (a + 6))) + (4 * m + 9 + 2 + 4 + 4 + 2) + ([0, 1] +> default) + have hd10 : 4 * m + 9 + 2 + 4 + 4 + 2 + 3 = (4 * m + 23) + 1 := by omega + rw [hd10, pow_succ_append_right [1, 0] (4 * m + 23) ([0, 1] +> default)] at h10 + have h11 := step_E011_10 + (default <+ (([0, 1] : List (Fin 2)) ^ (a + 6))) + ((([1, 0] : List (Fin 2)) ^ (4 * m + 23)) +> ([0, 1] +> default)) + rw [cons_0_pow_10] at h11 + have hr11 : ([0] : List (Fin 2)) +> ([0, 1] +> default) = [0, 0, 1] +> default := rfl + rw [hr11] at h11 + have h12 := bounce_E_end + ((default <+ (([0, 1] : List (Fin 2)) ^ (a + 6))) <+ [1, 1]) + (4 * m + 23) + have ha12 : a + 6 = (a + 4) + 2 := by omega + have hl12 : (((default <+ (([0, 1] : List (Fin 2)) ^ ((a + 4) + 2))) <+ [1, 1]) <+ [1]) = + (((default <+ (([0, 1] : List (Fin 2)) ^ (a + 4))) <+ (([0, 1] : List (Fin 2)) ^ 2)) <+ [1, 1, + 1]) := by + rw [pow_add_append_left, append_11_1] + have hr12 : ((([1, 1] : List (Fin 2)) ^ (4 * m + 23)) +> r0) = + [1, 1, 1, 1] +> ((([1, 1] : List (Fin 2)) ^ (4 * m + 21)) +> r0) := by + have : 4 * m + 23 = 2 + (4 * m + 21) := by omega + rw [this, pow_add_append_right, pow2_11_append] + rw [ha12, hl12, hr12] at h12 + have h13 := glue_B_11101_to_B1 + (default <+ (([0, 1] : List (Fin 2)) ^ (a + 4))) + ((([1, 1] : List (Fin 2)) ^ (4 * m + 21)) +> r0) + have hl13 : (((default <+ (([0, 1] : List (Fin 2)) ^ (a + 4))) <+ [0, 1]) <+ [1]) = + (default <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ (a + 5)) := by + have : ((default <+ (([0, 1] : List (Fin 2)) ^ (a + 4))) <+ [0, 1]) = + default <+ (([0, 1] : List (Fin 2)) ^ (a + 5)) := by + exact (pow_succ_append_right [0, 1] (a + 4) default).symm + rw [this, append_1_pow_01] + rw [hl13] at h13 + have h14 := finish_B_left (a + 5) + ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ (4 * m + 21)) +> r0)) + have ha14 : 2 * (a + 5) + 2 = 2 * a + 12 := by omega + rw [ha14] at h14 + exact stepPlus_trans h1 (stepPlus_trans h2 (stepPlus_trans h3 (stepPlus_trans h4 + (stepStar_stepPlus_stepPlus h5 (stepPlus_trans h6 (stepPlus_trans h7 (stepPlus_trans h8 + (stepPlus_trans h9 (stepPlus_trans h10 (stepPlus_trans h11 (stepPlus_trans h12 + (stepPlus_trans h13 h14)))))))))))) + +theorem trans_c1_odd (a m : Nat) : + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (a + 6 * m + 36)) +> + ((([0, 1] : List (Fin 2)) ^ (2 * m + 7)) +> ([1] +> r0)))) + [target_tm]⊢⁺ + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (2 * a + 6)) +> + ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ (8 * m + 36)) +> + ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ 5) +> r0)))))) := by + have ha0 : a + 6 * m + 36 = (a + 6 * m + 34) + 2 := by omega + have hb0 : 2 * m + 7 = (2 * m + 6) + 1 := by omega + rw [ha0, hb0] + have h1 := sweep_init (a + 6 * m + 34) (2 * m + 6) r0 + have hd1 : 2 * m + 6 + 2 = (2 * m + 7) + 1 := by omega + rw [hd1, pow_succ_append_right [1, 0] (2 * m + 7) r0] at h1 + have h2 := step_E01_10 + (default <+ (([0, 1] : List (Fin 2)) ^ (a + 6 * m + 34 + 1))) + ((([1, 0] : List (Fin 2)) ^ (2 * m + 7)) +> r0) + rw [cons_0_pow_10] at h2 + have hd2 : 2 * m + 7 = (2 * m + 1) + 6 := by omega + rw [hd2] at h2 + have h3 := + pass_cap_c1 ((default <+ (([0, 1] : List (Fin 2)) ^ (a + 6 * m + 34 + 1))) <+ [1]) (2 * m + 1) + have heq3 : (((default <+ (([0, 1] : List (Fin 2)) ^ (a + 6 * m + 34 + 1))) <+ [1]) <+ [1]) = + (((default <+ (([0, 1] : List (Fin 2)) ^ (a + 4 * m + 33))) <+ (([0, + 1] : List (Fin 2)) ^ (2 * m))) <+ + (([0, 1] : List (Fin 2)) ^ 2)) <+ [1, 1] := by + have h_exp : a + 6 * m + 34 + 1 = ((a + 4 * m + 33) + 2 * m) + 2 := by omega + rw [h_exp, pow_add_append_left, pow_add_append_left, append_1_1] + have hr3 : ((([1, 1] : List (Fin 2)) ^ (2 * m + 1 + 1)) +> ((([0, + 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ 5) +> r0))) = + [1, 1, 1, 1] +> ((([1, 1] : List (Fin 2)) ^ (2 * m)) +> ((([0, + 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ 5) +> r0))) := by + have : 2 * m + 1 + 1 = 2 + 2 * m := by omega + rw [this, pow_add_append_right, pow2_11_append] + rw [heq3, hr3] at h3 + have h4 := glue_B_111_to_E111 + ((default <+ (([0, 1] : List (Fin 2)) ^ (a + 4 * m + 33))) <+ (([0, + 1] : List (Fin 2)) ^ (2 * m))) + ((([1, 1] : List (Fin 2)) ^ (2 * m)) +> ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, + 1] : List (Fin 2)) ^ 5) +> r0))) + rw [cons_1_pow_11, pow_11_even m ([1] +> ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, + 1] : List (Fin 2)) ^ 5) +> r0)))] at h4 + have h5 := loop_E1_iter m (default <+ (([0, 1] : List (Fin 2)) ^ (a + 4 * m + 33))) 3 + ([1] +> ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ 5) +> r0))) + have hl5 : ((default <+ (([0, 1] : List (Fin 2)) ^ (a + 4 * m + 33))) <+ [1, 1, 1]) = + (((((default <+ (([0, 1] : List (Fin 2)) ^ (a + 4 * m + 27))) <+ (([0, + 1] : List (Fin 2)) ^ 2)) <+ + (([0, 1] : List (Fin 2)) ^ 2)) <+ (([0, 1] : List (Fin 2)) ^ 2)) <+ [1, 1, 1]) := by + have ha5 : a + 4 * m + 33 = (((a + 4 * m + 27) + 2) + 2) + 2 := by omega + rw [ha5, pow_add_append_left, pow_add_append_left, pow_add_append_left] + have hr5' : ((([1, 0] : List (Fin 2)) ^ (3 + 4 * m)) +> ([1] +> ((([0, + 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ 5) +> r0)))) = + ((([1, 0] : List (Fin 2)) ^ (4 * m + 7)) +> ([1, 1, 1, 1] +> ([1, 1, 1, 1] +> ([1, + 1] +> ((([1, 0] : List (Fin 2)) ^ 2) +> ([1, 1] +> ([0, 1] +> default))))))) := by + have hd5 : 3 + 4 * m + 4 = 4 * m + 7 := by omega + have hr5 := r0_11_pow5_2 + rw [cons_1_pow_01, cons_1_pow_11, ← pow_add_append_right [1, 0], hd5, hr5] + rw [hl5, hr5'] at h5 + have h6 := loop_E1_step + (((default <+ (([0, 1] : List (Fin 2)) ^ (a + 4 * m + 27))) <+ (([0, + 1] : List (Fin 2)) ^ 2)) <+ (([0, 1] : List (Fin 2)) ^ 2)) + (4 * m + 7) + ([1, 1, 1, 1] +> ([1, 1] +> ((([1, 0] : List (Fin 2)) ^ 2) +> ([1, 1] +> ([0, 1] +> default))))) + have h7 := loop_E1_step + ((default <+ (([0, 1] : List (Fin 2)) ^ (a + 4 * m + 27))) <+ (([0, 1] : List (Fin 2)) ^ 2)) + (4 * m + 7 + 4) + ([1, 1] +> ((([1, 0] : List (Fin 2)) ^ 2) +> ([1, 1] +> ([0, 1] +> default)))) + have h8 := half_E1_a + (default <+ (([0, 1] : List (Fin 2)) ^ (a + 4 * m + 27))) + (4 * m + 7 + 4 + 4) + ((([1, 0] : List (Fin 2)) ^ 2) +> ([1, 1] +> ([0, 1] +> default))) + rw [← pow_add_append_right [1, 0]] at h8 + have hd8 : 4 * m + 7 + 4 + 4 + 3 + 2 = (4 * m + 19) + 1 := by omega + have hl8 : ((default <+ (([0, 1] : List (Fin 2)) ^ (a + 4 * m + 27))) <+ [0, 1, 1]) = + (((default <+ (([0, 1] : List (Fin 2)) ^ (a + 4 * m + 27))) <+ [1, 1]) <+ [0]) := + append_011 _ + rw [hd8, hl8] at h8 + have h9 := half_E1_b + ((default <+ (([0, 1] : List (Fin 2)) ^ (a + 4 * m + 27))) <+ [1, 1]) + (4 * m + 19) + ([0, 1] +> default) + have hd9 : 4 * m + 19 + 2 = (4 * m + 20) + 1 := by omega + have ha9 : a + 4 * m + 27 = (a + 4 * m + 25) + 2 := by omega + have hl9 : (((default <+ (([0, 1] : List (Fin 2)) ^ ((a + 4 * m + 25) + 2))) <+ [1, 1]) <+ [1]) = + (((default <+ (([0, 1] : List (Fin 2)) ^ (a + 4 * m + 25))) <+ (([0, + 1] : List (Fin 2)) ^ 2)) <+ [1, 1, 1]) := by + rw [pow_add_append_left, append_11_1] + rw [hd9, ha9, hl9] at h9 + have h10 := bounce_E111_end + (default <+ (([0, 1] : List (Fin 2)) ^ (a + 4 * m + 25))) + (4 * m + 20) + have ha10 : a + 4 * m + 25 = (a + 5) + 2 * (2 * m + 10) := by omega + have hl10 : ((default <+ (([0, 1] : List (Fin 2)) ^ (a + 4 * m + 25))) <+ [1, 1, 1]) = + (((default <+ (([0, 1] : List (Fin 2)) ^ (a + 5))) <+ (([0, + 1] : List (Fin 2)) ^ (2 * (2 * m + 10)))) <+ [1, 1, 1]) := by + rw [ha10, pow_add_append_left] + have hr10 : ((([1, 1] : List (Fin 2)) ^ (4 * m + 20 + 1)) +> r0) = + (([1, 1, 1, 1] : List (Fin 2)) ^ (2 * m + 10)) +> ([1, 1] +> r0) := by + have : 4 * m + 20 + 1 = 2 * (2 * m + 10) + 1 := by omega + rw [this, ← pow_succ_append_right', pow_11_even] + rw [hl10, hr10] at h10 + have h11 := loop_E1_iter (2 * m + 10) + (default <+ (([0, 1] : List (Fin 2)) ^ (a + 5))) + 1 + ([1, 1] +> r0) + have ha11 : a + 5 = (a + 3) + 2 := by omega + have hl11 : ((default <+ (([0, 1] : List (Fin 2)) ^ (a + 5))) <+ [1, 1, 1]) = + (((default <+ (([0, 1] : List (Fin 2)) ^ (a + 3))) <+ (([0, 1] : List (Fin 2)) ^ 2)) <+ [1, 1, + 1]) := by + rw [ha11, pow_add_append_left] + rw [hl11] at h11 + have h12 := half_E1_a + (default <+ (([0, 1] : List (Fin 2)) ^ (a + 3))) + (1 + 4 * (2 * m + 10)) + r0 + have hd12 : 1 + 4 * (2 * m + 10) + 3 = (8 * m + 43) + 1 := by omega + rw [hd12, pow_succ_append_right [1, 0]] at h12 + have h13 := step_E011_10 + (default <+ (([0, 1] : List (Fin 2)) ^ (a + 3))) + ((([1, 0] : List (Fin 2)) ^ (8 * m + 43)) +> r0) + rw [cons_0_pow_10] at h13 + have hd13 : 8 * m + 43 = (8 * m + 37) + 6 := by omega + rw [hd13] at h13 + have h14 := pass_cap_c1 + ((default <+ (([0, 1] : List (Fin 2)) ^ (a + 3))) <+ [1, 1]) + (8 * m + 37) + have ha14 : a + 3 = (a + 1) + 2 := by omega + have hl14 : (((default <+ (([0, 1] : List (Fin 2)) ^ ((a + 1) + 2))) <+ [1, 1]) <+ [1]) = + (((default <+ (([0, 1] : List (Fin 2)) ^ (a + 1))) <+ (([0, 1] : List (Fin 2)) ^ 2)) <+ [1, 1, + 1]) := by + rw [pow_add_append_left, append_11_1] + have hr14 : ((([1, 1] : List (Fin 2)) ^ (8 * m + 37 + 1)) +> ((([0, + 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ 5) +> r0))) = + [1, 1, 1, 1] +> ((([1, 1] : List (Fin 2)) ^ (8 * m + 36)) +> ((([0, + 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ 5) +> r0))) := by + have : 8 * m + 37 + 1 = 2 + (8 * m + 36) := by omega + rw [this, pow_add_append_right, pow2_11_append] + rw [ha14, hl14, hr14] at h14 + have h15 := glue_B_11101_to_B1 + (default <+ (([0, 1] : List (Fin 2)) ^ (a + 1))) + ((([1, 1] : List (Fin 2)) ^ (8 * m + 36)) +> ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, + 1] : List (Fin 2)) ^ 5) +> r0))) + have hl15 : (((default <+ (([0, 1] : List (Fin 2)) ^ (a + 1))) <+ [0, 1]) <+ [1]) = + (default <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ (a + 2)) := by + have : ((default <+ (([0, 1] : List (Fin 2)) ^ (a + 1))) <+ [0, 1]) = + default <+ (([0, 1] : List (Fin 2)) ^ (a + 2)) := by + exact (pow_succ_append_right [0, 1] (a + 1) default).symm + rw [this, append_1_pow_01] + rw [hl15] at h15 + have h16 := finish_B_left (a + 2) + ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ (8 * m + 36)) +> + ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ 5) +> r0)))) + have ha16 : 2 * (a + 2) + 2 = 2 * a + 6 := by omega + rw [ha16] at h16 + exact stepPlus_trans h1 (stepPlus_trans h2 (stepPlus_trans h3 (stepPlus_trans h4 + (stepStar_stepPlus_stepPlus h5 (stepPlus_trans h6 (stepPlus_trans h7 (stepPlus_trans h8 + (stepPlus_trans h9 (stepPlus_trans h10 (stepStar_stepPlus_stepPlus h11 + (stepPlus_trans h12 (stepPlus_trans h13 (stepPlus_trans h14 (stepPlus_trans h15 + h16)))))))))))))) + +-- ============================================================================ +-- Section 7: Stem (init [] -> P a₀ 81) & Full Macro-Cycle +-- ============================================================================ + +def P (a j : Nat) : Cfg (Fin 2) (Fin 6) := + default <{{E}} ((([1, 0] : List (Fin 2)) ^ (a + 18 * j + 100)) +> + ((([0, 1] : List (Fin 2)) ^ (4 * j + 16)) +> ([1, 1] +> r0))) + +theorem hide_mul_pow2 (X p : Nat) : ∃ N, X * (2 ^ p) = N ∧ X ≤ N := + ⟨X * (2 ^ p), rfl, mul_pow2_ge X p⟩ + +theorem drain_c1_even (a m : Nat) : + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ (a + 2 * m + 17)) +> + ((([0, 1] : List (Fin 2)) ^ (2 * m + 8)) +> ([1] +> r0)))) + [target_tm]⊢⁺ + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ ((2 * a + 12) * (2 ^ (2 * m + 10)))) +> + ((([0, 1] : List (Fin 2)) ^ (6 * m + 34)) +> ([1, 1] +> r0)))) := by + have ha1 : 2 * a + 12 = (2 * a + 10) + 2 := by omega + have hr1 : ((([1, 1] : List (Fin 2)) ^ (4 * m + 21)) +> r0) = + (([1, 1, 1, 1] : List (Fin 2)) ^ (2 * m + 10)) +> ([1, 1] +> r0) := by + have : 4 * m + 21 = 2 * (2 * m + 10) + 1 := by omega + rw [this, ← pow_succ_append_right', pow_11_even] + have ha2 : (2 * a + 10 + 2) * (2 ^ (2 * m + 10)) = (2 * a + 12) * (2 ^ (2 * m + 10)) := by + have : 2 * a + 10 + 2 = 2 * a + 12 := by omega + rw [this] + have hb2 : 3 + 3 * (2 * m + 10) + 1 = 6 * m + 34 := by omega + have h1' := stepPlus_E_congr ha1 (tail_01_congr rfl hr1) (trans_c1_even a m) + have h2' := + stepStar_E_congr ha2 (tail_01_congr hb2 rfl) (rule2_loop (2 * m + 10) (2 * a + 10) 3 ([1, + 1] +> r0)) + exact stepPlus_stepStar_stepPlus h1' h2' + +theorem init_to_P : + ∃ a₀, (init []) [target_tm]⊢⁺ P a₀ 81 := by + have heq1 : (4 * 54 + 8) * (2 ^ (4 + 2)) = 14307 + 2 * 6 + 17 := by decide + have heq1_b : 3 * 4 + 8 = 2 * 6 + 8 := rfl + rcases hide_mul_pow2 (2 * 14307 + 12) (2 * 6 + 10) with ⟨N1, hN1_eq, hN1_ge⟩ + have hN1_split : N1 = (N1 - 2) + 2 := by clear hN1_eq; omega + have ha_split1 : (2 * 14307 + 12) * (2 ^ (2 * 6 + 10)) = (N1 - 2) + 2 := hN1_eq.trans hN1_split + have hb_next : 6 * 6 + 34 = 2 * 34 + 2 := rfl + rcases hide_mul_pow2 (4 * (N1 - 2) + 8) (34 + 2) with ⟨N2, hN2_eq, hN2_ge⟩ + have hN2_split : N2 = (N2 - 119) + 2 * 51 + 17 := by clear hN1_eq ha_split1 hN2_eq; omega + have ha_split2 : (4 * (N1 - 2) + 8) * (2 ^ (34 + 2)) = (N2 - 119) + 2 * 51 + 17 := + hN2_eq.trans hN2_split + have hb_split2 : 3 * 34 + 8 = 2 * 51 + 8 := rfl + rcases hide_mul_pow2 (2 * (N2 - 119) + 12) (2 * 51 + 10) with ⟨N3, hN3_eq, hN3_ge⟩ + let a₀ := N3 - (18 * 81 + 100) + have hN3_split : N3 = a₀ + 18 * 81 + 100 := by + dsimp [a₀]; clear hN1_eq ha_split1 hN2_eq ha_split2 hN3_eq; omega + have ha_final : (2 * (N2 - 119) + 12) * (2 ^ (2 * 51 + 10)) = a₀ + 18 * 81 + 100 := + hN3_eq.trans hN3_split + have hb_final : 6 * 51 + 34 = 4 * 81 + 16 := rfl + have h_stem := + stepPlus_trans stem_part1 (stepPlus_trans stem_part2 (stepPlus_trans stem_part3 + (stepPlus_trans stem_part4 stem_part5))) + have h_r2 := rule2_loop 2 12 3 ([1, 1] +> r0) + have h_ev4 := stepPlus_stepStar_stepPlus h_stem h_r2 + have h_c2_1 := stepPlus_E_congr heq1 (tail_01_congr heq1_b rfl) (cycle_c2_to_c1 54 4) + have h_c1_1 := stepPlus_E_congr ha_split1 (tail_01_congr hb_next rfl) (drain_c1_even 14307 6) + have h_c2_2 := + stepPlus_E_congr ha_split2 (tail_01_congr hb_split2 rfl) (cycle_c2_to_c1 (N1 - 2) 34) + have h_c1_2 := + stepPlus_E_congr ha_final (tail_01_congr hb_final rfl) (drain_c1_even (N2 - 119) 51) + exact ⟨a₀, + stepPlus_trans h_ev4 (stepPlus_trans h_c2_1 (stepPlus_trans h_c1_1 (stepPlus_trans h_c2_2 + h_c1_2)))⟩ + +theorem P_step (a j : Nat) : + ∃ a', (P a j) [target_tm]⊢⁺ (P a' (9 * j + 46)) := by + unfold P + have ha0 : a + 18 * j + 100 = (a + 18 * j + 98) + 2 := by omega + have hb0 : 4 * j + 16 = 2 * (2 * j + 7) + 2 := by omega + rcases hide_mul_pow2 (4 * (a + 18 * j + 98) + 8) (2 * j + 7 + 2) with ⟨M1, hM1_eq, hM1_ge⟩ + let a1 := M1 - (6 * (3 * j + 11) + 36) + have hM1_split : M1 = a1 + 6 * (3 * j + 11) + 36 := by dsimp [a1]; clear hM1_eq; omega + have ha1 : (4 * (a + 18 * j + 98) + 8) * (2 ^ (2 * j + 7 + 2)) = a1 + 6 * (3 * j + 11) + 36 := + hM1_eq.trans hM1_split + have hb1 : 3 * (2 * j + 7) + 8 = 2 * (3 * j + 11) + 7 := by clear hM1_eq ha1; omega + have ha2 : 2 * a1 + 6 = (2 * a1 + 4) + 2 := by clear hM1_eq ha1; omega + have hr2 : ((([1, 1] : List (Fin 2)) ^ (8 * (3 * j + 11) + 36)) +> + ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ 5) +> r0))) = + (([1, 1, 1, 1] : List (Fin 2)) ^ (12 * j + 62)) +> + ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ 5) +> r0)) := by + have : 8 * (3 * j + 11) + 36 = 2 * (12 * j + 62) := by clear hM1_eq ha1; omega + rw [this, pow_11_even] + rcases hide_mul_pow2 (2 * a1 + 4 + 2) (12 * j + 62) with ⟨M2, hM2_eq, hM2_ge⟩ + have hM2_split : M2 = (M2 - 2) + 2 := by dsimp [a1] at hM2_ge; clear hM1_eq ha1 hr2 hM2_eq; omega + have ha3 : (2 * a1 + 4 + 2) * (2 ^ (12 * j + 62)) = (M2 - 2) + 2 := hM2_eq.trans hM2_split + have hr3_full : ((([0, 1] : List (Fin 2)) ^ (3 + 3 * (12 * j + 62) + 1)) +> + ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, 1] : List (Fin 2)) ^ 5) +> r0))) = + ((([0, 1] : List (Fin 2)) ^ ((36 * j + 193) + 1)) +> + ((([1, 1, 1, 1] : List (Fin 2)) ^ 2) +> ([1, 1] +> r0))) := by + rw [← pow_add_append_right [0, 1]] + have hb3 : 3 + 3 * (12 * j + 62) + 1 + 4 = (36 * j + 193) + 1 := by + clear hM1_eq ha1 hr2 hM2_eq ha3; omega + rw [hb3, r0_11_pow5_3] + let a' := (M2 - 2 + 2) * 4 - (18 * (9 * j + 46) + 100) + have ha4 : (M2 - 2 + 2) * (2 ^ 2) = a' + 18 * (9 * j + 46) + 100 := by + change (M2 - 2 + 2) * 4 = a' + 18 * (9 * j + 46) + 100 + dsimp [a', a1] at hM2_ge ⊢; clear hM1_eq ha1 hr2 hM2_eq ha3 hr3_full; omega + have hb4 : 36 * j + 193 + 3 * 2 + 1 = 4 * (9 * j + 46) + 16 := by + clear hM1_eq ha1 hr2 hM2_eq ha3 hr3_full ha4; omega + rw [ha0, hb0] + have h1 := + stepPlus_E_congr ha1 (tail_01_congr hb1 rfl) (cycle_c2_to_c1 (a + 18 * j + 98) (2 * j + 7)) + have h2 := stepPlus_E_congr ha2 (tail_01_congr rfl hr2) (trans_c1_odd a1 (3 * j + 11)) + have h3 := stepStar_E_congr ha3 hr3_full + (rule2_loop (12 * j + 62) (2 * a1 + 4) 3 ((([0, 1] : List (Fin 2)) ^ 4) +> ((([1, + 1] : List (Fin 2)) ^ 5) +> r0))) + have h4 := + stepStar_E_congr ha4 (tail_01_congr hb4 rfl) (rule2_loop 2 (M2 - 2) (36 * j + 193) ([1, + 1] +> r0)) + exact ⟨a', stepPlus_stepStar_stepPlus (stepPlus_trans h1 h2) (stepStar_trans h3 h4)⟩ + +-- ============================================================================ +-- Section 8: Top-Level Non-Halting Theorem +-- ============================================================================ + +theorem multiStep_prefix_isSome {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d) = some c') : + (multiStep target_tm c j).isSome := by + rw [multiStep_add] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl + +theorem P_reaches (m : Nat) : + ∃ N ≥ m, ∃ a j, multiStep target_tm (init []) N = some (P a j) := by + induction m with + | zero => + rcases init_to_P with ⟨a₀, k, _, hk⟩ + exact ⟨k, Nat.zero_le k, a₀, 81, hk⟩ + | succ m ih => + rcases ih with ⟨N, hN, a, j, h_ms⟩ + rcases P_step a j with ⟨a', k, hk_pos, hk⟩ + exact ⟨N + k, Nat.add_le_add hN hk_pos, a', 9 * j + 46, + multiStep_trans target_tm _ _ _ N k h_ms hk⟩ + + + +set_option maxRecDepth 4000 in +theorem stem_0426_part1 : + (((default : ListBlank (Fin 2)) {{5}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢⁺ + (([1, 1, 0, 1, 0, 1, 0, 1] +> default) <{{D}} + (default <+ [0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1])) := by + have h_init : (((default : ListBlank (Fin 2)) {{5}}> default) : Cfg (Fin 2) (Fin 6)) = + (default <{{F}} default) := rfl + rw [h_init]; dsimp [ListBlank.append] + (iterate 180 step); finish + +set_option maxRecDepth 4000 in +theorem stem_0426_part2 : + (([1, 1, 0, 1, 0, 1, 0, 1] +> default) <{{D}} + (default <+ [0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1])) + [target_tm]⊢⁺ + (([0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1] +> default) <{{B}} + (default <+ [0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1])) := by + dsimp [ListBlank.append] + (iterate 170 step); finish + +set_option maxRecDepth 4000 in +theorem stem_0426_part3 : + (([0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1] +> default) <{{B}} + (default <+ [0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1])) + [target_tm]⊢⁺ + (default <{{E}} ((([1, 0] : List (Fin 2)) ^ 6) +> ((([0, 1] : List (Fin 2)) ^ 4) +> + ((([1, 1, 1, 1] : List (Fin 2)) ^ 2) +> ([1, 1] +> r0))))) := by + dsimp [r0, ListBlank.append] + (iterate 173 step); finish + +theorem c_523_0829_to_P : + ∃ a₀, (default <{{E}} ((([1, 0] : List (Fin 2)) ^ 6) +> ((([0, 1] : List (Fin 2)) ^ 4) +> + ((([1, 1, 1, 1] : List (Fin 2)) ^ 2) +> ([1, 1] +> r0))))) [target_tm]⊢⁺ P a₀ 81 := by + have heq1 : (4 * 22 + 8) * (2 ^ (4 + 2)) = 6115 + 2 * 6 + 17 := by decide + have heq1_b : 3 * 4 + 8 = 2 * 6 + 8 := rfl + rcases hide_mul_pow2 (2 * 6115 + 12) (2 * 6 + 10) with ⟨N1, hN1_eq, hN1_ge⟩ + have hN1_split : N1 = (N1 - 2) + 2 := by clear hN1_eq; omega + have ha_split1 : (2 * 6115 + 12) * (2 ^ (2 * 6 + 10)) = (N1 - 2) + 2 := hN1_eq.trans hN1_split + have hb_next : 6 * 6 + 34 = 2 * 34 + 2 := rfl + rcases hide_mul_pow2 (4 * (N1 - 2) + 8) (34 + 2) with ⟨N2, hN2_eq, hN2_ge⟩ + have hN2_split : N2 = (N2 - 119) + 2 * 51 + 17 := by clear hN1_eq ha_split1 hN2_eq; omega + have ha_split2 : (4 * (N1 - 2) + 8) * (2 ^ (34 + 2)) = (N2 - 119) + 2 * 51 + 17 := + hN2_eq.trans hN2_split + have hb_split2 : 3 * 34 + 8 = 2 * 51 + 8 := rfl + rcases hide_mul_pow2 (2 * (N2 - 119) + 12) (2 * 51 + 10) with ⟨N3, hN3_eq, hN3_ge⟩ + let a₀ := N3 - (18 * 81 + 100) + have hN3_split : N3 = a₀ + 18 * 81 + 100 := by + dsimp [a₀]; clear hN1_eq ha_split1 hN2_eq ha_split2 hN3_eq; omega + have ha_final : (2 * (N2 - 119) + 12) * (2 ^ (2 * 51 + 10)) = a₀ + 18 * 81 + 100 := + hN3_eq.trans hN3_split + have hb_final : 6 * 51 + 34 = 4 * 81 + 16 := rfl + have h_r2 := rule2_loop 2 4 3 ([1, 1] +> r0) + have h_c2_1 := cycle_c2_to_c1 22 4 + have h_ev4_c1_raw := stepStar_stepPlus_stepPlus h_r2 h_c2_1 + have h_ev4_c1 := stepPlus_E_congr heq1 (tail_01_congr heq1_b rfl) h_ev4_c1_raw + have h_c1_1 := stepPlus_E_congr ha_split1 (tail_01_congr hb_next rfl) (drain_c1_even 6115 6) + have h_c2_2 := stepPlus_E_congr ha_split2 (tail_01_congr hb_split2 rfl) + (cycle_c2_to_c1 (N1 - 2) 34) + have h_c1_2 := stepPlus_E_congr ha_final (tail_01_congr hb_final rfl) + (drain_c1_even (N2 - 119) 51) + exact ⟨a₀, stepPlus_trans h_ev4_c1 (stepPlus_trans h_c1_1 (stepPlus_trans h_c2_2 h_c1_2))⟩ + +theorem init_to_P_0426 : + ∃ a₀, (((default : ListBlank (Fin 2)) {{5}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢⁺ + P a₀ 81 := by + have h_stem := stepPlus_trans stem_0426_part1 (stepPlus_trans stem_0426_part2 stem_0426_part3) + rcases c_523_0829_to_P with ⟨a₀, h_to_P⟩ + exact ⟨a₀, stepPlus_trans h_stem h_to_P⟩ + +theorem P_reaches_0426 (m : Nat) : + ∃ N ≥ m, ∃ a j, + multiStep target_tm ((default : ListBlank (Fin 2)) {{5}}> default) N = some (P a j) := by + induction m with + | zero => + rcases init_to_P_0426 with ⟨a₀, k, _, hk⟩ + exact ⟨k, Nat.zero_le k, a₀, 81, hk⟩ + | succ m ih => + rcases ih with ⟨N, hN, a, j, h_ms⟩ + rcases P_step a j with ⟨a', k, hk_pos, hk⟩ + exact ⟨N + k, Nat.add_le_add hN hk_pos, a', 9 * j + 46, + multiStep_trans target_tm _ _ _ N k h_ms hk⟩ + +theorem is_not_halt_from_0426_tm : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{5}}> default) [target_tm]⊢* cfg) → + (step target_tm cfg).isSome := by + intro cfg ⟨n, hn⟩ + rcases P_reaches_0426 (n + 1) with ⟨N, hN, a, j, h_N⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [← h_eq] at h_N + have h_some := multiStep_prefix_isSome h_N + rw [multiStep_succ, hn] at h_some + exact h_some + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg ⟨n, hn⟩ + rcases P_reaches (n + 1) with ⟨N, hN, a, j, h_N⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [← h_eq] at h_N + have h_some := multiStep_prefix_isSome h_N + rw [multiStep_succ, hn] at h_some + exact h_some + +end Solution + +public section + +theorem is_not_halt_from_0426 : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{5}}> default) [target]⊢* cfg) → + (step target cfg).isSome := + Solution.is_not_halt_from_0426_tm + +theorem is_not_halt : IsNotHalt target := Solution.is_does_not_halt + +end + +end BusyBeaver.M_1RB0RE_1RC1LF_0LD0RE_HHH1LE_1RA0LB_1LB0LC diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RE_1RC1RE_1LD1RA_1LA0LD_0RA0LF_1LDHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1RC1RE_1LD1RA_1LA0LD_0RA0LF_1LDHHH.lean new file mode 100644 index 00000000..9a21dbd3 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1RC1RE_1LD1RA_1LA0LD_0RA0LF_1LDHHH.lean @@ -0,0 +1,525 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RE_1RC1RE_1LD1RA_1LA0LD_0RA0LF_1LDHHH + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1RC1RE_1LD1RA_1LA0LD_0RA0LF_1LDHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +set_option maxRecDepth 2000000 +set_option maxHeartbeats 20000000 + +theorem _jb_zero_cons_default : ((0 : Fin 2) >> (default : ListBlank (Fin 2))) = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +theorem _jb_default_head_zero : (default : ListBlank (Fin 2)).head = (0 : Fin 2) := rfl +theorem _jb_default_tail_eq : (default : ListBlank (Fin 2)).tail = default := rfl +theorem _jb_init_nil_cfg : (init [] : Cfg (Fin 2) (Fin 6)) = ⟨some 0, ⟨0, default, default⟩⟩ := by + ext <;> rfl +theorem _jb_mk_nil : (Turing.ListBlank.mk ([] : List (Fin 2))) = default := rfl +theorem _jb_mk_cons (a : Fin 2) (l : List (Fin 2)) : Turing.ListBlank.mk (a :: l) = a >> Turing.ListBlank.mk l := rfl +theorem _jb_head_append_cons (a : Fin 2) (l : List (Fin 2)) (s : ListBlank (Fin 2)) : ((a :: l) +> s).head = a := by + simp [Turing.ListBlank.head_cons] +theorem _jb_tail_append_cons (a : Fin 2) (l : List (Fin 2)) (s : ListBlank (Fin 2)) : ((a :: l) +> s).tail = l +> s := by + simp [Turing.ListBlank.tail_cons] + +-- ============================================================================ +-- Unconditional IsNotHalt proof for holdout_0228 (1RB0RE_1RC1RE_1LD1RA_1LA0LD_0RA0LF_1LD---) +-- Donor: verified_answers/holdout_0712/answer.lean (Round / Sweeps / Valid inductive invariant, B = 0, E = 3) +-- ============================================================================ + +set_option maxHeartbeats 20000000 +set_option maxRecDepth 2000000 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem pow_zero_list (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +omit [Inhabited Γ] in +@[simp] +theorem list_pow_append_one (u : List (Fin 2)) (k : Nat) : + u^k ++ u = u^(k + 1) := by + have h := list_pow_add_comm u k 1 + dsimp [HPow.hPow] at h ⊢ + rw [List.append_nil] at h + exact h + +theorem pow_add_append_right (u : List (Fin 2)) (m n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (m + n)) +> r = (u ^ m) +> ((u ^ n) +> r) := by + rw [list_pow_add, ← listblank_append_append] + +theorem pow_succ_append_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (n + 1)) +> r = u +> ((u ^ n) +> r) := by + rw [pow_succ_list, ← listblank_append_append] + +theorem pow_succ_append_right' (u : List (Fin 2)) (k : Nat) (r : ListBlank (Fin 2)) : + (u ^ k) +> (u +> r) = (u ^ (k + 1)) +> r := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (m n : Nat) : + s <+ (u ^ (m + n)) = (s <+ (u ^ m)) <+ (u ^ n) := by + rw [listblank_append_append, ← list_pow_add, add_comm] + +theorem pow_succ_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k : Nat) : + (s <+ u) <+ (u ^ k) = s <+ (u ^ (k + 1)) := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add3_append_right (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) (r : ListBlank (Fin 2)) : + (u ^ (k₁ + k₂ + k₃)) +> r = (u ^ k₁) +> ((u ^ k₂) +> ((u ^ k₃) +> r)) := by + rw [pow_add_append_right u (k₁ + k₂) k₃ r, pow_add_append_right u k₁ k₂ ((u ^ k₃) +> r)] + +theorem pow_add3_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) : + s <+ (u ^ (k₁ + k₂ + k₃)) = ((s <+ (u ^ k₁)) <+ (u ^ k₂)) <+ (u ^ k₃) := by + rw [pow_add_append_left s u (k₁ + k₂) k₃, pow_add_append_left s u k₁ k₂] + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, _, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +theorem step_some {c c' : Cfg (Fin 2) (Fin 6)} (h : step target_tm c = some c') : + c [target_tm]⊢⁺ c' := ⟨1, Nat.zero_lt_one, h⟩ + +theorem stepPlus_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := step_stepStar_stepPlus h1 (stepPlus_stepStar h2) + +theorem stepStar_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢* c₃ := stepStar_trans (step_stepStar target_tm c₁ c₂ h1) h2 + +theorem stepPlus_stepStar_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢⁺ c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepPlus_stepStar_stepPlus h1 h2 + +theorem stepStar_stepPlus_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢* c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepStar_stepPlus_stepPlus h1 h2 + +theorem stepPlus_of_step {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢ c₂) : + c₁ [target_tm]⊢⁺ c₂ := step_stepPlus target_tm c₁ c₂ h + +theorem stepStar_of_stepPlus {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢⁺ c₂) : + c₁ [target_tm]⊢* c₂ := stepPlus_stepStar h + +local macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +local macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail]) +local macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step))) +local macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +theorem multiStep_step_isSome {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₀ cfg cfg' : Cfg Γ Λ) (n m : Nat) + (hn : multiStep M c₀ n = some cfg) + (hnm : multiStep M c₀ (n + (1 + m)) = some cfg') : + (step M cfg).isSome := by + rw [multiStep_add M c₀ n (1 + m), hn] at hnm + dsimp [Option.bind] at hnm + rw [multiStep_add M cfg 1 m, multiStep_one] at hnm + cases hs : step M cfg with + | none => + rw [hs] at hnm + nomatch hnm + | some c₁ => rfl + +theorem inv_reaches_beyond {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') + (N : Nat) : + ∃ (m : Nat) (cfg' : Cfg Γ Λ), multiStep M (init []) (N + m) = some cfg' ∧ Inv cfg' := by + induction N with + | zero => + obtain ⟨cfg₀, ⟨n₀, hn₀⟩, h_inv₀⟩ := h_init + refine ⟨n₀, cfg₀, ?_, h_inv₀⟩ + rwa [Nat.zero_add] + | succ N ih => + obtain ⟨m, cfg₁, hm, h_inv₁⟩ := ih + cases m with + | zero => + obtain ⟨cfg₂, ⟨k, hk_pos, hk⟩, h_inv₂⟩ := h_step cfg₁ h_inv₁ + cases k with + | zero => omega + | succ k' => + refine ⟨k', cfg₂, ?_, h_inv₂⟩ + have h_trans := multiStep_trans M (init []) cfg₁ cfg₂ N (k' + 1) hm hk + have h_eq : (N + 1) + k' = N + (k' + 1) := by omega + rwa [h_eq] + | succ m' => + refine ⟨m', cfg₁, ?_, h_inv₁⟩ + have h_eq : (N + 1) + m' = N + (m' + 1) := by omega + rwa [h_eq] + +theorem closed_inv_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') : + IsDoesNotHalt M := by + intro cfg ⟨n, hn⟩ + obtain ⟨m, cfg', hnm, _⟩ := inv_reaches_beyond M Inv h_init h_step (n + 1) + have h_eq : (n + 1) + m = n + (1 + m) := by omega + rw [h_eq] at hnm + exact multiStep_step_isSome M (init []) cfg cfg' n m hn hnm + +theorem closed_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) + (n₀ : Nat) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, ∃ n', (hub n) [M]⊢⁺ (hub n')) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hcfg⟩ + subst hcfg + obtain ⟨n', hn'⟩ := h_step n + exact ⟨hub n', hn', ⟨n', rfl⟩⟩ + +theorem closed_guarded_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) (P : Nat → Prop) + (n₀ : Nat) (h_P₀ : P n₀) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, P n → ∃ n', P n' ∧ ((hub n) [M]⊢⁺ (hub n'))) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, P n ∧ cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, h_P₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hPn, hcfg⟩ + subst hcfg + obtain ⟨n', hPn', hn'⟩ := h_step n hPn + exact ⟨hub n', hn', ⟨n', hPn', rfl⟩⟩ + + +def QINIT : Fin 6 := 0 +def B : Fin 6 := 0 +def E : Fin 6 := 3 +abbrev holdout_0228_tm : Machine (Fin 2) (Fin 6) := target_tm +abbrev M : Machine (Fin 2) (Fin 6) := target_tm + +theorem rule_B_000 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 0, 0] +> r)) [target_tm]⊢⁺ (l <{{E}} ([0, 0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_001 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 0, 1] +> r)) [target_tm]⊢⁺ ((l <+ [1, 1, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_010 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 1, 0] +> r)) [target_tm]⊢⁺ ((l <+ [0, 1, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_10 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([1, 0] +> r)) [target_tm]⊢⁺ ((l <+ [0, 0]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_111 (l r : ListBlank (Fin 2)) : + ((l <+ [1, 1, 1]) <{{E}} r) [target_tm]⊢⁺ (l <{{E}} ([0, 0, 0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_011 (l r : ListBlank (Fin 2)) : + ((l <+ [0, 1, 1]) <{{E}} r) [target_tm]⊢⁺ (l <{{E}} ([0, 1, 0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_00 (l r : ListBlank (Fin 2)) : + ((l <+ [0, 0]) <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ ((l <+ [0, 1, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_nil (r : ListBlank (Fin 2)) : + (default <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ ((default <+ [0, 1, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +def Round (r r' : ListBlank (Fin 2)) : Prop := + ∀ l : ListBlank (Fin 2), (l {{B}}> r) [target_tm]⊢⁺ (l <{{E}} r') + +inductive Sweeps : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) → Prop + | zero (r : ListBlank (Fin 2)) : Sweeps 0 r r + | succ {n : Nat} {r r₁ r₂ : ListBlank (Fin 2)} : + Round r r₁ → Sweeps n r₁ r₂ → Sweeps (n + 1) r r₂ + +theorem Sweeps.trans {a b : Nat} {r₁ r₂ r₃ : ListBlank (Fin 2)} + (h₁ : Sweeps a r₁ r₂) (h₂ : Sweeps b r₂ r₃) : Sweeps (a + b) r₁ r₃ := by + induction h₁ with + | zero _ => simpa using h₂ + | succ hr _ ih => + rw [Nat.succ_add] + exact Sweeps.succ hr (ih h₂) + +theorem sweeps_split_last {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps (n + 1) r r') : + ∃ r₁ : ListBlank (Fin 2), Sweeps n r r₁ ∧ Round r₁ r' := by + induction n generalizing r with + | zero => + cases h with + | succ hr h0 => + cases h0 with + | zero _ => exact ⟨r, Sweeps.zero r, hr⟩ + | succ m ih => + cases h with + | succ hr hs => + obtain ⟨r₁, hs₁, hr₁⟩ := ih hs + exact ⟨r₁, Sweeps.succ hr hs₁, hr₁⟩ + +theorem round_000 (r : ListBlank (Fin 2)) : + Round ([0, 0, 0] +> r) ([0, 0, 1] +> r) := + fun l => rule_B_000 l r + +theorem round_001 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 0, 1] +> r) ([0, 0, 0] +> r') := + fun l => stepPlus_trans (rule_B_001 l r) (stepPlus_trans (h (l <+ [1, 1, 1])) (rule_E_111 l r')) + +theorem round_010 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 1, 0] +> r) ([0, 1, 0] +> r') := + fun l => stepPlus_trans (rule_B_010 l r) (stepPlus_trans (h (l <+ [0, 1, 1])) (rule_E_011 l r')) + +theorem round_10 {r₁ r r₂ : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Round r r₂) : + Round ([1, 0] +> r₁) ([0, 1, 0] +> r₂) := + fun l => stepPlus_trans (rule_B_10 l r₁) + (stepPlus_trans (h₁ (l <+ [0, 0])) + (stepPlus_trans (rule_E_00 l r) + (stepPlus_trans (h₂ (l <+ [0, 1, 1])) (rule_E_011 l r₂)))) + +theorem sweeps_010 {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps n r r') : + Sweeps n ([0, 1, 0] +> r) ([0, 1, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | succ hr _ ih => exact Sweeps.succ (round_010 hr) ih + +theorem sweeps_10 {n : Nat} {r₁ r r' : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Sweeps (n + 1) r r') : + Sweeps (n + 1) ([1, 0] +> r₁) ([0, 1, 0] +> r') := by + cases h₂ with + | succ hr₂ hs => + exact Sweeps.succ (round_10 h₁ hr₂) (sweeps_010 hs) + +theorem sweeps_000_even {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k) ([0, 0, 0] +> r) ([0, 0, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | @succ m r₀ r₁ r₂ hr _ ih => + have h2 : Sweeps 2 ([0, 0, 0] +> r₀) ([0, 0, 0] +> r₁) := + Sweeps.succ (round_000 r₀) (Sweeps.succ (round_001 hr) (Sweeps.zero _)) + have htr := Sweeps.trans h2 ih + rw [show 2 + 2 * m = 2 * (m + 1) by omega] at htr + exact htr + +theorem sweeps_000_odd {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k + 1) ([0, 0, 0] +> r) ([0, 0, 1] +> r') := by + have he := sweeps_000_even h + have h1 : Sweeps 1 ([0, 0, 0] +> r') ([0, 0, 1] +> r') := + Sweeps.succ (round_000 r') (Sweeps.zero _) + exact Sweeps.trans he h1 + +theorem default_eq_b000 : + (default : ListBlank (Fin 2)) = [0, 0, 0] +> default := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b000_cons_zero (r : ListBlank (Fin 2)) : + [0, 0, 0] +> ((0 : Fin 2) >> r) = (0 : Fin 2) >> ([0, 0, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +theorem b001_cons_zero (r : ListBlank (Fin 2)) : + [0, 0, 1] +> ((0 : Fin 2) >> r) = (0 : Fin 2) >> ([0, 1, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +theorem b001_default_eq : + ([0, 0, 1] +> default : ListBlank (Fin 2)) = (0 : Fin 2) >> ([0, 1, 0] +> default) := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b010_eq_zero_cons_b10 (r : ListBlank (Fin 2)) : + [0, 1, 0] +> r = (0 : Fin 2) >> ([1, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +inductive Valid : Nat → ListBlank (Fin 2) → Prop + | nil {n : Nat} (hn : n ≥ 1) : + Valid n default + | t0 {n : Nat} {r : ListBlank (Fin 2)} (hn : n ≥ 2) (hr : Valid (n / 2) r) : + Valid n ([0, 0, 0] +> r) + | t1 {n : Nat} {r : ListBlank (Fin 2)} (hn : n ≥ 1) (hr : Valid (n + 1) r) : + Valid n ([0, 1, 0] +> r) + | t2 {n : Nat} {r₁ r : ListBlank (Fin 2)} (hn : n ≥ 1) + (hround : Round r₁ ((0 : Fin 2) >> r)) (hr : Valid (n + 1) r) : + Valid n ([1, 0] +> r₁) + +theorem Valid.mono {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) {n' : Nat} (hle : n ≤ n') : + Valid n' r := by + induction h generalizing n' with + | nil hn => exact Valid.nil (by omega) + | t0 hn _ ih => exact Valid.t0 (by omega) (ih (by omega)) + | t1 hn _ ih => exact Valid.t1 (by omega) (ih (by omega)) + | t2 hn hround _ ih => exact Valid.t2 (by omega) hround (ih (by omega)) + +theorem valid_sweeps_nil : ∀ n : Nat, n ≥ 1 → + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ Sweeps n default ((0 : Fin 2) >> r') := by + intro n + induction n using Nat.strongRecOn with + | ind n ih => + intro hn + rcases ( by omega : n = 1 ∨ (n ≥ 2 ∧ n % 2 = 0) ∨ (n ≥ 2 ∧ n % 2 = 1) ) with rfl | ⟨hn2, hev⟩ | ⟨hn2, hod⟩ + · refine ⟨[0, 1, 0] +> default, Valid.t1 (by omega) (Valid.nil (by omega)), ?_⟩ + have h1 : Sweeps 1 ([0, 0, 0] +> default) ([0, 0, 1] +> default) := + Sweeps.succ (round_000 default) (Sweeps.zero _) + rw [b001_default_eq, ← default_eq_b000] at h1 + exact h1 + · obtain ⟨r', hr', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨[0, 0, 0] +> r', Valid.t0 hn2 hr', ?_⟩ + have he := sweeps_000_even hs' + rw [← default_eq_b000, b000_cons_zero, show 2 * (n / 2) = n by omega] at he + exact he + · obtain ⟨r', hr', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨[0, 1, 0] +> r', Valid.t1 (by omega) (hr'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [← default_eq_b000, b001_cons_zero, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + +theorem valid_sweeps {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) : + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ Sweeps n r ((0 : Fin 2) >> r') := by + induction h with + | @nil n hn => exact valid_sweeps_nil n hn + | @t0 n r hn hr ih => + obtain ⟨r', hr', hs'⟩ := ih + rcases ( by omega : n % 2 = 0 ∨ n % 2 = 1 ) with hev | hod + · refine ⟨[0, 0, 0] +> r', Valid.t0 hn hr', ?_⟩ + have he := sweeps_000_even hs' + rw [b000_cons_zero, show 2 * (n / 2) = n by omega] at he + exact he + · refine ⟨[0, 1, 0] +> r', Valid.t1 (by omega) (hr'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [b001_cons_zero, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + | @t1 n r hn hr ih => + obtain ⟨r', hr', hs'⟩ := ih + obtain ⟨r₁, hs₁, hr₁⟩ := sweeps_split_last hs' + refine ⟨[1, 0] +> r₁, Valid.t2 hn hr₁ hr', ?_⟩ + rw [← b010_eq_zero_cons_b10] + exact sweeps_010 hs₁ + | @t2 n r₁ r hn hround hr ih => + obtain ⟨r', hr', hs'⟩ := ih + obtain ⟨r₂, hs₂, hr₂⟩ := sweeps_split_last hs' + refine ⟨[1, 0] +> r₂, Valid.t2 hn hr₂ hr', ?_⟩ + rw [← b010_eq_zero_cons_b10] + rw [show n = (n - 1) + 1 by omega] at hs₂ ⊢ + exact sweeps_10 hround hs₂ + +theorem era_step {r : ListBlank (Fin 2)} (h : Valid 1 r) : + ∃ r' : ListBlank (Fin 2), Valid 1 r' ∧ + ((default <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ (default <{{E}} ((0 : Fin 2) >> r'))) := by + obtain ⟨r', hr', hs'⟩ := valid_sweeps (h.mono (by omega : 1 ≤ 2)) + obtain ⟨r₁, hs₁, hr₂⟩ := sweeps_split_last hs' + obtain ⟨r₀, hs₀, hr₁⟩ := sweeps_split_last hs₁ + cases hs₀ with + | zero _ => + refine ⟨[1, 0] +> r₁, Valid.t2 (by omega) hr₂ hr', ?_⟩ + have s1 := rule_E_nil r + have s2 := hr₁ (default <+ [0, 1, 1]) + have s3 := rule_E_011 default r₁ + rw [← b010_eq_zero_cons_b10] + exact stepPlus_trans s1 (stepPlus_trans s2 s3) + +def era0_r : ListBlank (Fin 2) := + [0, 1, 0] +> default + +theorem init_reaches_era0 : + (init []) [target_tm]⊢* (default <{{E}} ((0 : Fin 2) >> era0_r)) := by + apply stepPlus_stepStar + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{QINIT}}> default) := rfl + rw [h_init] + dsimp [era0_r, ListBlank.append] + execute + +theorem valid_era0 : Valid 1 era0_r := + Valid.t1 (by omega) (Valid.nil (by omega)) + +private theorem holdout_0228_nonhalt : IsDoesNotHalt holdout_0228_tm := by + refine closed_inv_does_not_halt target_tm + (fun cfg => ∃ r : ListBlank (Fin 2), Valid 1 r ∧ cfg = (default <{{E}} ((0 : Fin 2) >> r))) + ⟨default <{{E}} ((0 : Fin 2) >> era0_r), init_reaches_era0, ⟨era0_r, valid_era0, rfl⟩⟩ ?_ + intro cfg ⟨r, hr, hcfg⟩ + subst hcfg + obtain ⟨r', hr', hstep⟩ := era_step hr + exact ⟨default <{{E}} ((0 : Fin 2) >> r'), hstep, ⟨r', hr', rfl⟩⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := + holdout_0228_nonhalt + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RE_1RC1RE_1LD1RA_1LA0LD_0RA0LF_1LDHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RE_1RCHHH_0LD1LE_0RE1LD_1RF0LC_0RA1RE.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1RCHHH_0LD1LE_0RE1LD_1RF0LC_0RA1RE.lean new file mode 100644 index 00000000..4609668c --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RE_1RCHHH_0LD1LE_0RE1LD_1RF0LC_0RA1RE.lean @@ -0,0 +1,1007 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RE_1RCHHH_0LD1LE_0RE1LD_1RF0LC_0RA1RE + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1RCHHH_0LD1LE_0RE1LD_1RF0LC_0RA1RE" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +set_option maxRecDepth 200000 + +local infixr:67 (priority := high) " >> " => + (ListBlank.cons : Fin 2 → ListBlank (Fin 2) → ListBlank (Fin 2)) + +def mkC (q : Fin 6) (h : Fin 2) (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some q, ⟨h, l, r⟩⟩ + +@[simp] theorem zMs (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem zZcd : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl + +@[simp] theorem zHd : (default : ListBlank (Fin 2)).head = 0 := rfl + +@[simp] theorem zTl : (default : ListBlank (Fin 2)).tail = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl + +theorem zMa {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp [multiStep] + | succ m' ih => + rw [Nat.add_succ, zMs, ih, Option.bind_assoc] + simp_rw [zMs] + +theorem zMt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n + m} c₃ := by + rw [zMa, h₁]; simp [h₂] + +theorem step_plus_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [target_tm]⊢⁺ c₂) (h₂ : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := by + rcases h₁ with ⟨n, hn, h₁⟩; rcases h₂ with ⟨m, hm, h₂⟩ + exact ⟨n + m, by omega, zMt target_tm c₁ c₂ c₃ n m h₁ h₂⟩ + +theorem step_plus_star {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [target_tm]⊢⁺ c₂) (h₂ : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢⁺ c₃ := by + rcases h₁ with ⟨n, hn, h₁⟩; rcases h₂ with ⟨m, h₂⟩ + exact ⟨n + m, by omega, zMt target_tm c₁ c₂ c₃ n m h₁ h₂⟩ + +theorem step_star_plus {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [target_tm]⊢* c₂) (h₂ : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := by + rcases h₁ with ⟨n, h₁⟩; rcases h₂ with ⟨m, hm, h₂⟩ + exact ⟨n + m, by omega, zMt target_tm c₁ c₂ c₃ n m h₁ h₂⟩ + +theorem isNotHalt_of_invariant + (Inv : Cfg (Fin 2) (Fin 6) → Prop) + (h_init : ∃ c₀, ((init []) [target_tm]⊢⁺ c₀) ∧ Inv c₀) + (h_step : ∀ c, Inv c → ∃ c', (c [target_tm]⊢⁺ c') ∧ Inv c') : + IsNotHalt target_tm := by + rcases h_init with ⟨c₀, ⟨n₀, _, hn₀⟩, hinv₀⟩ + exact BusyBeaver.Counter.does_not_halt_of_invariant Inv ⟨c₀, ⟨n₀, hn₀⟩, hinv₀⟩ h_step + +structure SymCfg where + q : Fin 6 + head : Fin 2 + l : List (Fin 2) + r : List (Fin 2) + +def realTape : List (Fin 2) → ListBlank (Fin 2) → ListBlank (Fin 2) + | [], tail => tail + | x :: xs, tail => x >> realTape xs tail + +def realCfg (s : SymCfg) (L R : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + mkC s.q s.head (realTape s.l L) (realTape s.r R) + +def pushSym (b : Bool) (w : Fin 2) (xs : List (Fin 2)) : List (Fin 2) := + match b, xs, w with + | true, [], 0 => [] + | _, _, _ => w :: xs + +def popSym (b : Bool) (xs : List (Fin 2)) : Option (Fin 2 × List (Fin 2)) := + match xs with + | x :: xs' => some (x, xs') + | [] => if b then some (0, []) else none + +def stepSym (bl br : Bool) (s : SymCfg) : Option SymCfg := + match target_tm s.q s.head with + | none => none + | some (none, _) => none + | some (some q', Stmt.write w Dir.right) => + match popSym br s.r with + | none => none + | some (h', r') => some ⟨q', h', pushSym bl w s.l, r'⟩ + | some (some q', Stmt.write w Dir.left) => + match popSym bl s.l with + | none => none + | some (h', l') => some ⟨q', h', l', pushSym br w s.r⟩ + +def runSym (bl br : Bool) : Nat → SymCfg → Option SymCfg + | 0, s => some s + | n + 1, s => (stepSym bl br s).bind (runSym bl br n) + +theorem realTape_pushSym (b : Bool) (w : Fin 2) (xs : List (Fin 2)) (X : ListBlank (Fin 2)) + (hX : b = true → X = default) : + realTape (pushSym b w xs) X = w >> realTape xs X := by + cases b + · rfl + · rw [hX rfl] + cases xs with + | nil => + match w with + | 0 => simp [pushSym, realTape] + | 1 => rfl + | cons _ _ => rfl + +theorem stepSym_sound (bl br : Bool) (s s' : SymCfg) (L R : ListBlank (Fin 2)) + (hL : bl = true → L = default) (hR : br = true → R = default) + (h : stepSym bl br s = some s') : + step target_tm (realCfg s L R) = some (realCfg s' L R) := by + rcases s with ⟨q, hd, l, r⟩ + simp only [stepSym] at h + cases htm : target_tm q hd with + | none => simp [htm] at h + | some res => + rcases res with ⟨q_opt, stmt⟩ + cases q_opt with + | none => simp [htm] at h + | some q' => + rcases stmt with ⟨w, d⟩ + cases d with + | right => + simp only [htm] at h + cases r with + | cons r0 rs => + simp only [popSym, Option.some.injEq] at h + subst h + simp [step, realCfg, mkC, htm, Tape.write, Tape.move, Tape.mk', realTape, + realTape_pushSym bl w l L hL] + | nil => + cases br with + | false => simp [popSym] at h + | true => + simp only [popSym, ↓reduceIte, Option.some.injEq] at h + subst h + rw [hR rfl] + simp [step, realCfg, mkC, htm, Tape.write, Tape.move, Tape.mk', realTape, + realTape_pushSym bl w l L hL] + | left => + simp only [htm] at h + cases l with + | cons l0 ls => + simp only [popSym, Option.some.injEq] at h + subst h + simp [step, realCfg, mkC, htm, Tape.write, Tape.move, Tape.mk', realTape, + realTape_pushSym br w r R hR] + | nil => + cases bl with + | false => simp [popSym] at h + | true => + simp only [popSym, ↓reduceIte, Option.some.injEq] at h + subst h + rw [hL rfl] + simp [step, realCfg, mkC, htm, Tape.write, Tape.move, Tape.mk', realTape, + realTape_pushSym br w r R hR] + +theorem runSym_sound (bl br : Bool) (n : Nat) (s s' : SymCfg) (L R : ListBlank (Fin 2)) + (hL : bl = true → L = default) (hR : br = true → R = default) + (h : runSym bl br n s = some s') : + multiStep target_tm (realCfg s L R) n = some (realCfg s' L R) := by + induction n generalizing s with + | zero => + simp only [runSym, Option.some.injEq] at h + subst h; rfl + | succ n ih => + simp only [runSym] at h + cases hs₁ : stepSym bl br s with + | none => simp [hs₁] at h + | some s₁ => + simp only [hs₁, Option.bind] at h + have h1 : multiStep target_tm (realCfg s L R) 1 = some (realCfg s₁ L R) := + stepSym_sound bl br s s₁ L R hL hR hs₁ + have eq_n : n + 1 = 1 + n := by omega + rw [eq_n] + exact zMt target_tm (realCfg s L R) (realCfg s₁ L R) (realCfg s' L R) 1 n h1 (ih s₁ h) + +theorem runSym_FF_sound (n : Nat) (hn : n > 0) (s s' : SymCfg) (L R : ListBlank (Fin 2)) + (h : runSym false false n s = some s') : + (realCfg s L R) [target_tm]⊢⁺ (realCfg s' L R) := + ⟨n, hn, runSym_sound false false n s s' L R (by intro h'; cases h') (by intro h'; cases h') h⟩ + +theorem runSym_TF_sound (n : Nat) (hn : n > 0) (s s' : SymCfg) (R : ListBlank (Fin 2)) + (h : runSym true false n s = some s') : + (realCfg s default R) [target_tm]⊢⁺ (realCfg s' default R) := + ⟨n, hn, runSym_sound true false n s s' default R (fun _ => rfl) (by intro h'; cases h') h⟩ + +theorem runSym_FT_sound (n : Nat) (hn : n > 0) (s s' : SymCfg) (L : ListBlank (Fin 2)) + (h : runSym false true n s = some s') : + (realCfg s L default) [target_tm]⊢⁺ (realCfg s' L default) := + ⟨n, hn, runSym_sound false true n s s' L default (by intro h'; cases h') (fun _ => rfl) h⟩ + +theorem runSym_TT_sound (n : Nat) (hn : n > 0) (s s' : SymCfg) + (h : runSym true true n s = some s') : + (realCfg s default default) [target_tm]⊢⁺ (realCfg s' default default) := + ⟨n, hn, runSym_sound true true n s s' default default (fun _ => rfl) (fun _ => rfl) h⟩ + +theorem fill_shift_0 (L : ListBlank (Fin 2)) : + (mkC 0 1 (0 >> L) default) [target_tm]⊢⁺ + (mkC 4 1 (0 >> L) (1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> default)) := + runSym_FT_sound 44 (by decide) + ⟨0, 1, [0], []⟩ + ⟨4, 1, [0], [1, 1, 1, 1, 1, 0, 0, 1]⟩ L rfl + +theorem block_A_step (L R : ListBlank (Fin 2)) : + (mkC 0 1 (0 >> L) (1 >> 1 >> R)) [target_tm]⊢⁺ + (mkC 0 1 (0 >> 1 >> 0 >> L) R) := + runSym_FF_sound 6 (by decide) + ⟨0, 1, [0], [1, 1]⟩ + ⟨0, 1, [0, 1, 0], []⟩ L R rfl + +theorem block_A_end (L R : ListBlank (Fin 2)) : + (mkC 0 1 (0 >> L) (0 >> 0 >> 1 >> R)) [target_tm]⊢⁺ + (mkC 0 1 (0 >> 1 >> 0 >> 0 >> L) R) := + runSym_FF_sound 3 (by decide) + ⟨0, 1, [0], [0, 0, 1]⟩ + ⟨0, 1, [0, 1, 0, 0], []⟩ L R rfl + +theorem conv_12 (L R : ListBlank (Fin 2)) : + (mkC 4 1 (0 >> 1 >> 0 >> 0 >> L) (1 >> R)) [target_tm]⊢⁺ + (mkC 4 1 (1 >> 0 >> 1 >> 0 >> L) (1 >> R)) := + runSym_FF_sound 12 (by decide) + ⟨4, 1, [0, 1, 0, 0], [1]⟩ + ⟨4, 1, [1, 0, 1, 0], [1]⟩ L R rfl + +theorem shift_entry_3 (L R : ListBlank (Fin 2)) : + (mkC 4 1 (0 >> 1 >> 1 >> L) R) [target_tm]⊢⁺ + (mkC 3 1 L (1 >> 0 >> 0 >> R)) := + runSym_FF_sound 3 (by decide) + ⟨4, 1, [0, 1, 1], []⟩ + ⟨3, 1, [], [1, 0, 0]⟩ L R rfl + +theorem d_left_two (L R : ListBlank (Fin 2)) : + (mkC 3 1 (1 >> 1 >> L) R) [target_tm]⊢⁺ + (mkC 3 1 L (1 >> 1 >> R)) := + runSym_FF_sound 2 (by decide) + ⟨3, 1, [1, 1], []⟩ + ⟨3, 1, [], [1, 1]⟩ L R rfl + +theorem shift_exit_2 (L R : ListBlank (Fin 2)) : + (mkC 3 1 (0 >> L) R) [target_tm]⊢⁺ + (mkC 4 1 (0 >> L) R) := + runSym_FF_sound 2 (by decide) + ⟨3, 1, [0], []⟩ + ⟨4, 1, [0], []⟩ L R rfl + +theorem e_left_two (L R : ListBlank (Fin 2)) : + (mkC 4 1 (1 >> 1 >> L) R) [target_tm]⊢⁺ + (mkC 4 1 L (1 >> 0 >> R)) := + runSym_FF_sound 2 (by decide) + ⟨4, 1, [1, 1], []⟩ + ⟨4, 1, [], [1, 0]⟩ L R rfl + +theorem e_turn_four (L R : ListBlank (Fin 2)) : + (mkC 4 1 (1 >> 0 >> 1 >> L) R) [target_tm]⊢⁺ + (mkC 4 0 (1 >> 1 >> 1 >> L) R) := + runSym_FF_sound 4 (by decide) + ⟨4, 1, [1, 0, 1], []⟩ + ⟨4, 0, [1, 1, 1], []⟩ L R rfl + +theorem e_right_two (L R : ListBlank (Fin 2)) : + (mkC 4 0 L (1 >> 0 >> R)) [target_tm]⊢⁺ + (mkC 4 0 (1 >> 1 >> L) R) := + runSym_FF_sound 2 (by decide) + ⟨4, 0, [], [1, 0]⟩ + ⟨4, 0, [1, 1], []⟩ L R rfl + +theorem e_top_two (L R : ListBlank (Fin 2)) : + (mkC 4 0 L (1 >> 1 >> R)) [target_tm]⊢⁺ + (mkC 4 1 (1 >> 1 >> L) R) := + runSym_FF_sound 2 (by decide) + ⟨4, 0, [], [1, 1]⟩ + ⟨4, 1, [1, 1], []⟩ L R rfl + +theorem e_exit_to_A (L R : ListBlank (Fin 2)) : + (mkC 4 0 L (1 >> 0 >> 0 >> 1 >> R)) [target_tm]⊢⁺ + (mkC 0 1 (0 >> 1 >> 1 >> 1 >> L) R) := + runSym_FF_sound 4 (by decide) + ⟨4, 0, [], [1, 0, 0, 1]⟩ + ⟨0, 1, [0, 1, 1, 1], []⟩ L R rfl + +theorem step_F0 (L R : ListBlank (Fin 2)) : + (mkC 5 0 L (1 >> R)) [target_tm]⊢⁺ + (mkC 0 1 (0 >> L) R) := + runSym_FF_sound 1 (by decide) + ⟨5, 0, [], [1]⟩ + ⟨0, 1, [0], []⟩ L R rfl + +theorem w7_entry_76 (L R : ListBlank (Fin 2)) : + (mkC 4 1 (0 >> 1 >> 0 >> 0 >> 1 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> L) (1 >> 1 >> 1 >> 1 >> 1 >> 1 >> R)) [target_tm]⊢⁺ + (mkC 3 1 L (0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> R)) := + runSym_FF_sound 76 (by decide) + ⟨4, 1, [0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1], [1, 1, 1, 1, 1, 1]⟩ + ⟨3, 1, [], [0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]⟩ L R rfl + +theorem w7_step_27 (L R : ListBlank (Fin 2)) : + (mkC 3 1 (0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> L) (0 >> 0 >> 0 >> R)) [target_tm]⊢⁺ + (mkC 3 1 L (0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> R)) := + runSym_FF_sound 27 (by decide) + ⟨3, 1, [0, 0, 1, 0, 1, 0, 1], [0, 0, 0]⟩ + ⟨3, 1, [], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0]⟩ L R rfl + +theorem w7_exit_85 (R : ListBlank (Fin 2)) : + (mkC 3 1 (1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> default) (0 >> 0 >> 0 >> R)) [target_tm]⊢⁺ + (mkC 4 1 default (0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> R)) := + runSym_TF_sound 85 (by decide) + ⟨3, 1, [1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 0, 0]⟩ + ⟨4, 1, [], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0]⟩ R rfl + +theorem turn_p7_163 (R : ListBlank (Fin 2)) : + (mkC 4 1 default (0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> R)) [target_tm]⊢⁺ + (mkC 5 1 (1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 1 >> default) (0 >> 0 >> 1 >> 0 >> R)) := + runSym_TF_sound 163 (by decide) + ⟨4, 1, [], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]⟩ + ⟨5, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], [0, 0, 1, 0]⟩ R rfl + +theorem p7_step_29 (L R : ListBlank (Fin 2)) : + (mkC 5 1 L (0 >> 0 >> 1 >> 0 >> 0 >> 0 >> 0 >> 0 >> R)) [target_tm]⊢⁺ + (mkC 5 1 (1 >> 1 >> 1 >> 1 >> 0 >> 1 >> 1 >> L) (0 >> R)) := + runSym_FF_sound 29 (by decide) + ⟨5, 1, [], [0, 0, 1, 0, 0, 0, 0, 0]⟩ + ⟨5, 1, [1, 1, 1, 1, 0, 1, 1], [0]⟩ L R rfl + +theorem br_p7_m7_114 (L R : ListBlank (Fin 2)) : + (mkC 5 1 L (0 >> 0 >> 1 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 1 >> 1 >> 1 >> R)) [target_tm]⊢⁺ + (mkC 4 1 (0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 1 >> 1 >> L) (1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> R)) := + runSym_FF_sound 114 (by decide) + ⟨5, 1, [], [0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1]⟩ + ⟨4, 1, [0, 1, 1, 1, 1, 1, 1, 0, 1, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]⟩ L R rfl + +theorem m7_step_9 (L R : ListBlank (Fin 2)) : + (mkC 4 1 (0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> L) R) [target_tm]⊢⁺ + (mkC 4 1 (0 >> L) (1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> R)) := + runSym_FF_sound 9 (by decide) + ⟨4, 1, [0, 1, 1, 1, 1, 1, 1, 0], []⟩ + ⟨4, 1, [0], [1, 1, 1, 1, 1, 0, 0]⟩ L R rfl + +theorem br_m7_q7_168 (R : ListBlank (Fin 2)) : + (mkC 4 1 (0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 1 >> default) R) [target_tm]⊢⁺ + (mkC 4 0 (1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> default) (0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> R)) := + runSym_TF_sound 168 (by decide) + ⟨4, 1, [0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], []⟩ + ⟨4, 0, [1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 1, 1, 1, 1, 0, 0]⟩ R rfl + +theorem q7_step_15 (L R : ListBlank (Fin 2)) : + (mkC 4 0 L (0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> R)) [target_tm]⊢⁺ + (mkC 4 0 (0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> L) R) := + runSym_FF_sound 15 (by decide) + ⟨4, 0, [], [0, 1, 1, 1, 1, 1, 0]⟩ + ⟨4, 0, [0, 0, 1, 0, 1, 0, 1], []⟩ L R rfl + +theorem br_q7_p46_118 (L R : ListBlank (Fin 2)) : + (mkC 4 0 L (0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 1 >> 1 >> 1 >> R)) [target_tm]⊢⁺ + (mkC 4 0 (1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> L) (1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> R)) := + runSym_FF_sound 118 (by decide) + ⟨4, 0, [], [0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1]⟩ + ⟨4, 0, [1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0]⟩ L R rfl + +theorem pair46_step_46 (L R : ListBlank (Fin 2)) : + (mkC 4 0 (1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> L) (1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 1 >> R)) [target_tm]⊢⁺ + (mkC 4 0 (1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 0 >> L) (1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> R)) := + runSym_FF_sound 46 (by decide) + ⟨4, 0, [1, 1, 1, 1, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1]⟩ + ⟨4, 0, [1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0]⟩ L R rfl + +theorem pair46_exit_13 (L R : ListBlank (Fin 2)) : + (mkC 4 0 L (1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 0 >> R)) [target_tm]⊢⁺ + (mkC 5 0 (1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> L) R) := + runSym_FF_sound 13 (by decide) + ⟨4, 0, [], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0]⟩ + ⟨5, 0, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], []⟩ L R rfl + +theorem head_92 (L R : ListBlank (Fin 2)) : + (mkC 4 1 (0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> L) (1 >> R)) [target_tm]⊢⁺ + (mkC 4 1 (1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> L) (1 >> R)) := + runSym_FF_sound 92 (by decide) + ⟨4, 1, [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0], [1]⟩ + ⟨4, 1, [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [1]⟩ L R rfl + +theorem step4D_entry_49 (L R : ListBlank (Fin 2)) : + (mkC 4 1 (0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> L) R) [target_tm]⊢⁺ + (mkC 3 1 L (0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> R)) := + runSym_FF_sound 49 (by decide) + ⟨4, 1, [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1], []⟩ + ⟨3, 1, [], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]⟩ L R rfl + +theorem brD_p7_m7_114 (L R : ListBlank (Fin 2)) : + (mkC 5 1 L (0 >> 0 >> 1 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> R)) [target_tm]⊢⁺ + (mkC 4 1 (0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 1 >> 1 >> L) (1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 0 >> R)) := + runSym_FF_sound 114 (by decide) + ⟨5, 1, [], [0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]⟩ + ⟨4, 1, [0, 1, 1, 1, 1, 1, 1, 0, 1, 1], [1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0]⟩ L R rfl + +theorem step4D_exit_49 (L R : ListBlank (Fin 2)) : + (mkC 4 0 L (0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 0 >> 0 >> R)) [target_tm]⊢⁺ + (mkC 5 0 (1 >> 0 >> 0 >> 1 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> L) R) := + runSym_FF_sound 49 (by decide) + ⟨4, 0, [], [0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0]⟩ + ⟨5, 0, [1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1], []⟩ L R rfl + +def dbl : Nat → Nat + | 0 => 0 + | n + 1 => dbl n + 2 + +def expBase : Nat → Nat + | 0 => 0 + | k + 1 => dbl (expBase k) + 4 + +def expLen (k : Nat) : Nat := expBase k + 2 + +def pairOnes : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, s => s + | n + 1, s => 1 >> 1 >> pairOnes n s + +def ozTail : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, s => s + | n + 1, s => 0 >> 1 >> ozTail n s + +def towerTail : Nat → ListBlank (Fin 2) + | 0 => default + | k + 1 => pairOnes (expLen k) (0 >> 0 >> 1 >> towerTail k) + +def w7Run : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, s => s + | n + 1, s => 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> w7Run n s + +def Z_base : ListBlank (Fin 2) := + 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> default + +def L_init (b : Nat) : ListBlank (Fin 2) := + 0 >> 1 >> 0 >> 0 >> 1 >> w7Run (b + 1) Z_base + +def S_inv (k b : Nat) : Cfg (Fin 2) (Fin 6) := + mkC 0 1 (L_init b) (towerTail (k + 2)) + +def pairOnesList : Nat → List (Fin 2) → List (Fin 2) + | 0, s => s + | n + 1, s => 1 :: 1 :: pairOnesList n s + +def towerList : Nat → List (Fin 2) + | 0 => [] + | k + 1 => pairOnesList (expLen k) (0 :: 0 :: 1 :: towerList k) + +def runSymK (bl br : Bool) : Nat → Nat → SymCfg → Option SymCfg + | 0, r, s => runSym bl br r s + | k + 1, r, s => + match runSym bl br 256 s with + | none => none + | some s' => runSymK bl br k r s' + +theorem runSymK_sound (bl br : Bool) (k r : Nat) (s s' : SymCfg) (L R : ListBlank (Fin 2)) + (hL : bl = true → L = default) (hR : br = true → R = default) + (h : runSymK bl br k r s = some s') : + multiStep target_tm (realCfg s L R) (k * 256 + r) = some (realCfg s' L R) := by + induction k generalizing s with + | zero => + simp only [Nat.zero_mul, Nat.zero_add] + exact runSym_sound bl br r s s' L R hL hR h + | succ k ih => + simp only [runSymK] at h + cases hs₁ : runSym bl br 256 s with + | none => simp [hs₁] at h + | some s₁ => + simp only [hs₁] at h + have h1 := runSym_sound bl br 256 s s₁ L R hL hR hs₁ + have h2 := ih s₁ h + have eq_n : (k + 1) * 256 + r = 256 + (k * 256 + r) := by omega + rw [eq_n] + exact zMt target_tm (realCfg s L R) (realCfg s₁ L R) (realCfg s' L R) 256 (k * 256 + r) h1 h2 + +theorem init_seg_0 : (realCfg ⟨0, 0, [], []⟩ default default) [target_tm]⊢⁺ (realCfg ⟨2, 0, [1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], []⟩ default default) := + ⟨10 * 256 + 0, by decide, + runSymK_sound true true 10 0 + ⟨0, 0, [], []⟩ + ⟨2, 0, [1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], []⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_seg_1 : (realCfg ⟨2, 0, [1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], []⟩ default default) [target_tm]⊢⁺ (realCfg ⟨4, 0, [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) := + ⟨10 * 256 + 0, by decide, + runSymK_sound true true 10 0 + ⟨2, 0, [1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], []⟩ + ⟨4, 0, [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_seg_2 : (realCfg ⟨4, 0, [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) [target_tm]⊢⁺ (realCfg ⟨4, 0, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], [1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) := + ⟨10 * 256 + 0, by decide, + runSymK_sound true true 10 0 + ⟨4, 0, [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + ⟨4, 0, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], [1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_seg_3 : (realCfg ⟨4, 0, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], [1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) [target_tm]⊢⁺ (realCfg ⟨4, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) := + ⟨10 * 256 + 0, by decide, + runSymK_sound true true 10 0 + ⟨4, 0, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], [1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + ⟨4, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_seg_4 : (realCfg ⟨4, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) [target_tm]⊢⁺ (realCfg ⟨3, 0, [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], [0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) := + ⟨10 * 256 + 0, by decide, + runSymK_sound true true 10 0 + ⟨4, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + ⟨3, 0, [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], [0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_seg_5 : (realCfg ⟨3, 0, [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], [0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) [target_tm]⊢⁺ (realCfg ⟨2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) := + ⟨10 * 256 + 0, by decide, + runSymK_sound true true 10 0 + ⟨3, 0, [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], [0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + ⟨2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_seg_6 : (realCfg ⟨2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) [target_tm]⊢⁺ (realCfg ⟨2, 0, [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) := + ⟨10 * 256 + 0, by decide, + runSymK_sound true true 10 0 + ⟨2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + ⟨2, 0, [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_seg_7 : (realCfg ⟨2, 0, [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) [target_tm]⊢⁺ (realCfg ⟨4, 1, [1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) := + ⟨10 * 256 + 0, by decide, + runSymK_sound true true 10 0 + ⟨2, 0, [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + ⟨4, 1, [1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_seg_8 : (realCfg ⟨4, 1, [1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) [target_tm]⊢⁺ (realCfg ⟨4, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) := + ⟨10 * 256 + 0, by decide, + runSymK_sound true true 10 0 + ⟨4, 1, [1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + ⟨4, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_seg_9 : (realCfg ⟨4, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) [target_tm]⊢⁺ (realCfg ⟨5, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) := + ⟨10 * 256 + 0, by decide, + runSymK_sound true true 10 0 + ⟨4, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + ⟨5, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_seg_10 : (realCfg ⟨5, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) [target_tm]⊢⁺ (realCfg ⟨2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) := + ⟨10 * 256 + 0, by decide, + runSymK_sound true true 10 0 + ⟨5, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + ⟨2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_seg_11 : (realCfg ⟨2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) [target_tm]⊢⁺ (realCfg ⟨2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) := + ⟨10 * 256 + 0, by decide, + runSymK_sound true true 10 0 + ⟨2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + ⟨2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_seg_12 : (realCfg ⟨2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) [target_tm]⊢⁺ (realCfg ⟨5, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) := + ⟨10 * 256 + 0, by decide, + runSymK_sound true true 10 0 + ⟨2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + ⟨5, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_seg_13 : (realCfg ⟨5, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) [target_tm]⊢⁺ (realCfg ⟨2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) := + ⟨10 * 256 + 0, by decide, + runSymK_sound true true 10 0 + ⟨5, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + ⟨2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_seg_14 : (realCfg ⟨2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) [target_tm]⊢⁺ (realCfg ⟨5, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) := + ⟨10 * 256 + 0, by decide, + runSymK_sound true true 10 0 + ⟨2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + ⟨5, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_seg_15 : (realCfg ⟨5, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) [target_tm]⊢⁺ (realCfg ⟨2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) := + ⟨10 * 256 + 0, by decide, + runSymK_sound true true 10 0 + ⟨5, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + ⟨2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_seg_16 : (realCfg ⟨2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) [target_tm]⊢⁺ (realCfg ⟨2, 0, [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 1, 1, 0, 0, 1]⟩ default default) := + ⟨10 * 256 + 0, by decide, + runSymK_sound true true 10 0 + ⟨2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + ⟨2, 0, [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 1, 1, 0, 0, 1]⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_seg_17 : (realCfg ⟨2, 0, [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 1, 1, 0, 0, 1]⟩ default default) [target_tm]⊢⁺ (realCfg ⟨4, 0, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) := + ⟨10 * 256 + 0, by decide, + runSymK_sound true true 10 0 + ⟨2, 0, [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 1, 1, 0, 0, 1]⟩ + ⟨4, 0, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_seg_18 : (realCfg ⟨4, 0, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) [target_tm]⊢⁺ (realCfg ⟨4, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) := + ⟨10 * 256 + 0, by decide, + runSymK_sound true true 10 0 + ⟨4, 0, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + ⟨4, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_seg_19 : (realCfg ⟨4, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) [target_tm]⊢⁺ (realCfg ⟨3, 1, [0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) := + ⟨10 * 256 + 0, by decide, + runSymK_sound true true 10 0 + ⟨4, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + ⟨3, 1, [0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_seg_20 : (realCfg ⟨3, 1, [0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) [target_tm]⊢⁺ (realCfg ⟨0, 1, [0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ default default) := + ⟨5 * 256 + 39, by decide, + runSymK_sound true true 5 39 + ⟨3, 1, [0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + ⟨0, 1, [0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1]⟩ + default default (fun _ => rfl) (fun _ => rfl) rfl⟩ + +theorem init_to_S6_0 : (init []) [target_tm]⊢⁺ S_inv 4 0 := (step_plus_trans (step_plus_trans (step_plus_trans (step_plus_trans (step_plus_trans (step_plus_trans (step_plus_trans (step_plus_trans (step_plus_trans (step_plus_trans (step_plus_trans (step_plus_trans (step_plus_trans (step_plus_trans (step_plus_trans (step_plus_trans (step_plus_trans (step_plus_trans (step_plus_trans (step_plus_trans init_seg_0 init_seg_1) init_seg_2) init_seg_3) init_seg_4) init_seg_5) init_seg_6) init_seg_7) init_seg_8) init_seg_9) init_seg_10) init_seg_11) init_seg_12) init_seg_13) init_seg_14) init_seg_15) init_seg_16) init_seg_17) init_seg_18) init_seg_19) init_seg_20) + + + +theorem pairOnes_one (n : Nat) (R : ListBlank (Fin 2)) : + pairOnes n (1 >> R) = 1 >> pairOnes n R := by + induction n with + | zero => rfl + | succ n ih => simp only [pairOnes, ih] + +theorem pairOnes_snoc (n : Nat) (R : ListBlank (Fin 2)) : + pairOnes n (1 >> 1 >> R) = 1 >> 1 >> pairOnes n R := by + rw [pairOnes_one n (1 >> R), pairOnes_one n R] + +theorem ozTail_snoc (p : Nat) (S : ListBlank (Fin 2)) : + ozTail p (0 >> 1 >> S) = ozTail (p + 1) S := by + induction p with + | zero => rfl + | succ p ih => simp only [ozTail, ih] + +theorem ozTail_add (a b : Nat) (R : ListBlank (Fin 2)) : + ozTail (a + b) R = ozTail a (ozTail b R) := by + induction a with + | zero => simp [ozTail] + | succ a ih => simp [ozTail, Nat.succ_add, ih] + +theorem w7Run_snoc (n : Nat) (L : ListBlank (Fin 2)) : + w7Run n (0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> L) = + 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> w7Run n L := by + induction n with + | zero => rfl + | succ n ih => simp only [w7Run, ih] + +theorem block_A_loop (m : Nat) (X R : ListBlank (Fin 2)) : + (mkC 0 1 (0 >> X) (pairOnes m R)) [target_tm]⊢* + (mkC 0 1 (ozTail m (0 >> X)) R) := by + induction m generalizing R with + | zero => exact ⟨0, rfl⟩ + | succ m ih => + have h1 := ih (1 >> 1 >> R) + rw [pairOnes_snoc m R] at h1 + have h2 : (mkC 0 1 (ozTail m (0 >> X)) (1 >> 1 >> R)) [target_tm]⊢⁺ + (mkC 0 1 (ozTail (m + 1) (0 >> X)) R) := by + cases m with + | zero => exact block_A_step X R + | succ m' => exact block_A_step (1 >> ozTail m' (0 >> X)) R + exact (step_star_plus h1 h2).elim fun n ⟨_, hn⟩ => ⟨n, hn⟩ + +theorem block_A (m : Nat) (X R : ListBlank (Fin 2)) : + (mkC 0 1 (0 >> X) (pairOnes m (0 >> 0 >> 1 >> R))) [target_tm]⊢⁺ + (mkC 0 1 (0 >> 1 >> 0 >> ozTail m (0 >> X)) R) := by + have h1 := block_A_loop m X (0 >> 0 >> 1 >> R) + have h2 : (mkC 0 1 (ozTail m (0 >> X)) (0 >> 0 >> 1 >> R)) [target_tm]⊢⁺ + (mkC 0 1 (0 >> 1 >> 0 >> ozTail m (0 >> X)) R) := by + cases m with + | zero => exact block_A_end X R + | succ m' => exact block_A_end (1 >> ozTail m' (0 >> X)) R + exact step_star_plus h1 h2 + +theorem d_left_loop (m : Nat) (L R : ListBlank (Fin 2)) : + (mkC 3 1 (pairOnes m L) R) [target_tm]⊢* + (mkC 3 1 L (pairOnes m R)) := by + induction m generalizing L R with + | zero => exact ⟨0, rfl⟩ + | succ m ih => + have h1 := d_left_two (pairOnes m L) R + have h2 := ih L (1 >> 1 >> R) + rw [pairOnes_snoc m R] at h2 + exact (step_plus_star h1 h2).elim fun n ⟨_, hn⟩ => ⟨n, hn⟩ + +theorem shift_pair (m : Nat) (L R : ListBlank (Fin 2)) : + (mkC 4 1 (0 >> pairOnes (m + 1) (0 >> L)) R) [target_tm]⊢⁺ + (mkC 4 1 (0 >> L) (1 >> pairOnes m (0 >> 0 >> R))) := by + have h1 := shift_entry_3 (pairOnes m (0 >> L)) R + have h2 := d_left_loop m (0 >> L) (1 >> 0 >> 0 >> R) + have h3 := shift_exit_2 L (pairOnes m (1 >> 0 >> 0 >> R)) + have h123 := step_plus_trans (step_plus_star h1 h2) h3 + rw [pairOnes_one m (0 >> 0 >> R)] at h123 + exact h123 + +theorem e_left_loop (p : Nat) (L S : ListBlank (Fin 2)) : + (mkC 4 1 (pairOnes p L) (1 >> S)) [target_tm]⊢* + (mkC 4 1 L (1 >> ozTail p S)) := by + induction p generalizing L S with + | zero => exact ⟨0, rfl⟩ + | succ p ih => + have h1 := e_left_two (pairOnes p L) (1 >> S) + have h2 : (mkC 4 1 (pairOnes p L) (1 >> (0 >> 1 >> S))) [target_tm]⊢* + (mkC 4 1 L (1 >> ozTail p (0 >> 1 >> S))) := ih L (0 >> 1 >> S) + rw [ozTail_snoc p S] at h2 + exact (step_plus_star h1 h2).elim fun n ⟨_, hn⟩ => ⟨n, hn⟩ + +theorem e_right_loop (p : Nat) (L S : ListBlank (Fin 2)) : + (mkC 4 0 L (1 >> ozTail p S)) [target_tm]⊢* + (mkC 4 0 (pairOnes p L) (1 >> S)) := by + induction p generalizing L S with + | zero => exact ⟨0, rfl⟩ + | succ p ih => + have h1 := e_right_two L (1 >> ozTail p S) + have h2 := ih (1 >> 1 >> L) S + rw [pairOnes_snoc p L] at h2 + exact (step_plus_star h1 h2).elim fun n ⟨_, hn⟩ => ⟨n, hn⟩ + +theorem bounce_loop (m p : Nat) (Y T : ListBlank (Fin 2)) : + (mkC 4 1 (pairOnes p (1 >> ozTail (m + 1) Y)) (1 >> pairOnes m (0 >> 0 >> 1 >> T))) [target_tm]⊢⁺ + (mkC 0 1 (0 >> pairOnes (dbl m + p + 3) Y) T) := by + induction m generalizing p with + | zero => + have h1 := e_left_loop p (1 >> 0 >> 1 >> Y) (0 >> 0 >> 1 >> T) + have h2 := e_turn_four Y (1 >> ozTail p (0 >> 0 >> 1 >> T)) + have h3 := e_right_loop p (1 >> 1 >> 1 >> Y) (0 >> 0 >> 1 >> T) + have h4 := e_exit_to_A (pairOnes p (1 >> 1 >> 1 >> Y)) T + have h_all := step_plus_trans (step_plus_star (step_star_plus h1 h2) h3) h4 + have eq_l : (1 >> 1 >> 1 >> pairOnes p (1 >> 1 >> 1 >> Y)) = pairOnes (dbl 0 + p + 3) Y := by + rw [pairOnes_one p (1 >> 1 >> Y), pairOnes_one p (1 >> Y), pairOnes_one p Y] + have h_eq : p + 3 = dbl 0 + p + 3 := by simp [dbl] + rw [← h_eq] + rfl + rw [eq_l] at h_all + exact h_all + | succ m ih => + have h1 := e_left_loop p (1 >> 0 >> 1 >> ozTail (m + 1) Y) (1 >> 1 >> pairOnes m (0 >> 0 >> 1 >> T)) + have h2 := e_turn_four (ozTail (m + 1) Y) (1 >> ozTail p (1 >> 1 >> pairOnes m (0 >> 0 >> 1 >> T))) + have h3 := e_right_loop p (1 >> 1 >> 1 >> ozTail (m + 1) Y) (1 >> 1 >> pairOnes m (0 >> 0 >> 1 >> T)) + have h4 := e_top_two (pairOnes p (1 >> 1 >> 1 >> ozTail (m + 1) Y)) (1 >> pairOnes m (0 >> 0 >> 1 >> T)) + have h_pre := step_plus_trans (step_plus_star (step_star_plus h1 h2) h3) h4 + have eq_mid : (1 >> 1 >> pairOnes p (1 >> 1 >> 1 >> ozTail (m + 1) Y)) = + pairOnes (p + 2) (1 >> ozTail (m + 1) Y) := by + rw [pairOnes_one p (1 >> 1 >> ozTail (m + 1) Y), pairOnes_one p (1 >> ozTail (m + 1) Y)] + rfl + rw [eq_mid] at h_pre + have h_post := ih (p + 2) + have h_tot := step_plus_trans h_pre h_post + have eq_arith : dbl m + (p + 2) + 3 = dbl (m + 1) + p + 3 := by + simp only [dbl]; omega + rw [eq_arith] at h_tot + exact h_tot + +theorem fill_shift (k : Nat) (L : ListBlank (Fin 2)) : + (mkC 0 1 (0 >> L) (towerTail k)) [target_tm]⊢⁺ + (mkC 4 1 (0 >> L) (1 >> towerTail (k + 1))) := by + induction k generalizing L with + | zero => exact fill_shift_0 L + | succ k ih => + have h1 := block_A (expLen k) L (towerTail k) + have h2 := ih (1 >> 0 >> ozTail (expLen k) (0 >> L)) + have h3 : (mkC 4 1 (0 >> 1 >> 0 >> ozTail (expLen k) (0 >> L)) (1 >> towerTail (k + 1))) [target_tm]⊢⁺ + (mkC 4 1 (1 >> ozTail (expLen k + 1) (0 >> L)) (1 >> towerTail (k + 1))) := by + cases hk : expLen k with + | zero => exact conv_12 L (towerTail (k + 1)) + | succ m' => exact conv_12 (1 >> ozTail m' (0 >> L)) (towerTail (k + 1)) + have h4 := bounce_loop (expLen k) 0 (0 >> L) (towerTail k) + have h5 := ih (pairOnes (expLen (k + 1) + 1) (0 >> L)) + have h6 := shift_pair (expLen (k + 1)) L (1 >> towerTail (k + 1)) + have eq_exp : dbl (expLen k) + 0 + 3 = expLen (k + 1) + 1 := by + simp only [expLen, expBase]; rfl + rw [eq_exp] at h4 + exact step_plus_trans h1 (step_plus_trans h2 (step_plus_trans h3 (step_plus_trans h4 (step_plus_trans h5 h6)))) + +def z09Run : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, s => s + | n + 1, s => 0 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> z09Run n s + +def p7LRun : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, s => s + | n + 1, s => 1 >> 1 >> 1 >> 1 >> 0 >> 1 >> 1 >> p7LRun n s + +def q7RRun : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, s => s + | n + 1, s => 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> q7RRun n s + +theorem z09Run_snoc (n : Nat) (R : ListBlank (Fin 2)) : + z09Run n (0 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> R) = 0 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> z09Run n R := by + induction n with + | zero => rfl + | succ n ih => simp only [z09Run, ih] + +theorem p7LRun_snoc (n : Nat) (L : ListBlank (Fin 2)) : + p7LRun n (1 >> 1 >> 1 >> 1 >> 0 >> 1 >> 1 >> L) = 1 >> 1 >> 1 >> 1 >> 0 >> 1 >> 1 >> p7LRun n L := by + induction n with + | zero => rfl + | succ n ih => simp only [p7LRun, ih] + +theorem q7RRun_snoc (n : Nat) (R : ListBlank (Fin 2)) : + q7RRun n (1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> R) = 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> q7RRun n R := by + induction n with + | zero => rfl + | succ n ih => simp only [q7RRun, ih] + +theorem w7_sweep (b : Nat) (L R : ListBlank (Fin 2)) : + (mkC 3 1 (w7Run b L) (0 >> 0 >> 0 >> R)) [target_tm]⊢* + (mkC 3 1 L (0 >> 0 >> 0 >> z09Run b R)) := by + induction b generalizing L R with + | zero => exact ⟨0, rfl⟩ + | succ b ih => + have h1 := w7_step_27 (w7Run b L) R + have h2 := ih L (0 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> R) + rw [z09Run_snoc b R] at h2 + exact (step_plus_star h1 h2).elim fun n ⟨_, hn⟩ => ⟨n, hn⟩ + +theorem p7_sweep (b : Nat) (L R : ListBlank (Fin 2)) : + (mkC 5 1 L (0 >> 0 >> 1 >> 0 >> z09Run b R)) [target_tm]⊢* + (mkC 5 1 (p7LRun b L) (0 >> 0 >> 1 >> 0 >> R)) := by + induction b generalizing L with + | zero => exact ⟨0, rfl⟩ + | succ b ih => + have h1 := p7_step_29 L (0 >> 1 >> 0 >> z09Run b R) + have h2 := ih (1 >> 1 >> 1 >> 1 >> 0 >> 1 >> 1 >> L) + rw [p7LRun_snoc b L] at h2 + exact (step_plus_star h1 h2).elim fun n ⟨_, hn⟩ => ⟨n, hn⟩ + +theorem m7_sweep (b : Nat) (L R : ListBlank (Fin 2)) : + (mkC 4 1 (0 >> 1 >> 1 >> p7LRun b L) R) [target_tm]⊢* + (mkC 4 1 (0 >> 1 >> 1 >> L) (q7RRun b R)) := by + induction b generalizing L R with + | zero => exact ⟨0, rfl⟩ + | succ b ih => + have h1 := m7_step_9 (1 >> 1 >> p7LRun b L) R + have h2 := ih L (1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> R) + rw [q7RRun_snoc b R] at h2 + exact (step_plus_star h1 h2).elim fun n ⟨_, hn⟩ => ⟨n, hn⟩ + +theorem q7_sweep (b : Nat) (L R : ListBlank (Fin 2)) : + (mkC 4 0 L (0 >> q7RRun b R)) [target_tm]⊢* + (mkC 4 0 (w7Run b L) (0 >> R)) := by + induction b generalizing L with + | zero => exact ⟨0, rfl⟩ + | succ b ih => + have h1 := q7_step_15 L (0 >> q7RRun b R) + have h2 := ih (0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> L) + rw [w7Run_snoc b L] at h2 + exact (step_plus_star h1 h2).elim fun n ⟨_, hn⟩ => ⟨n, hn⟩ + +theorem p46_sweep (n : Nat) (L R : ListBlank (Fin 2)) : + (mkC 4 0 (1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> L) + (1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> pairOnes n R)) [target_tm]⊢* + (mkC 4 0 (1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> ozTail n L) + (1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> R)) := by + induction n generalizing R with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + have h1 := ih (1 >> 1 >> R) + rw [pairOnes_snoc n R] at h1 + have h2 := pair46_step_46 (1 >> ozTail n L) R + exact (step_star_plus h1 h2).elim fun m ⟨_, hm⟩ => ⟨m, hm⟩ + +theorem exp_ident_1 (k : Nat) : dbl (dbl (expBase k)) + 7 + 12 = expLen (k + 2) + 1 + 4 := by + simp only [expLen, expBase, dbl] + +theorem exp_ident_2 (k : Nat) : dbl (expLen (k + 2)) + 0 + 3 = expLen (k + 3) + 1 := by + simp only [expLen, expBase, dbl] + +set_option maxHeartbeats 1000000 in +theorem step4_A (b q : Nat) (T : ListBlank (Fin 2)) : + (mkC 4 1 (L_init b) (1 >> pairOnes (q + 14) (0 >> 0 >> 1 >> T))) [target_tm]⊢⁺ + (mkC 0 1 (0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> ozTail (q + 7) (0 >> 1 >> 0 >> 1 >> w7Run (b + 1) Z_base)) T) := by + have h1 := w7_entry_76 (w7Run b Z_base) (1 >> pairOnes (q + 11) (0 >> 0 >> 1 >> T)) + have h2 := w7_sweep b Z_base (0 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> pairOnes (q + 11) (0 >> 0 >> 1 >> T)) + have h3 := w7_exit_85 (z09Run b (0 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> pairOnes (q + 11) (0 >> 0 >> 1 >> T))) + rw [← z09Run_snoc b (0 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> pairOnes (q + 11) (0 >> 0 >> 1 >> T))] at h3 + have h4 := turn_p7_163 (z09Run b (0 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> pairOnes (q + 11) (0 >> 0 >> 1 >> T))) + have h5 := p7_sweep b (1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 1 >> default) + (0 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> pairOnes (q + 11) (0 >> 0 >> 1 >> T)) + have h6 := br_p7_m7_114 (p7LRun b (1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 1 >> default)) + (1 >> pairOnes (q + 9) (0 >> 0 >> 1 >> T)) + rw [← p7LRun_snoc b (1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 1 >> default)] at h6 + have h7 := m7_sweep b (1 >> 1 >> 1 >> 1 >> 0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 1 >> default) + (1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> pairOnes (q + 9) (0 >> 0 >> 1 >> T)) + have h8 := br_m7_q7_168 (q7RRun b (1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> pairOnes (q + 9) (0 >> 0 >> 1 >> T))) + rw [← q7RRun_snoc b (1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> pairOnes (q + 9) (0 >> 0 >> 1 >> T))] at h8 + have h9' : (mkC 4 0 Z_base (0 >> q7RRun b (1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> pairOnes (q + 9) (0 >> 0 >> 1 >> T)))) [target_tm]⊢* + (mkC 4 0 (w7Run b Z_base) (0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 1 >> 1 >> 1 >> pairOnes (q + 7) (1 >> 0 >> 0 >> 1 >> T))) := by + have eq_r : (1 >> pairOnes (q + 9) (0 >> 0 >> 1 >> T)) = (1 >> 1 >> 1 >> 1 >> pairOnes (q + 7) (1 >> 0 >> 0 >> 1 >> T)) := by + have h_u : (1 >> pairOnes (q + 9) (0 >> 0 >> 1 >> T)) = (1 >> 1 >> 1 >> 1 >> (1 >> pairOnes (q + 7) (0 >> 0 >> 1 >> T))) := rfl + rw [h_u, pairOnes_one (q + 7) (0 >> 0 >> 1 >> T)] + rw [eq_r] + exact q7_sweep b Z_base (1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 1 >> 1 >> 1 >> pairOnes (q + 7) (1 >> 0 >> 0 >> 1 >> T)) + have h10 := br_q7_p46_118 (w7Run b Z_base) (pairOnes (q + 7) (1 >> 0 >> 0 >> 1 >> T)) + have h11 := p46_sweep (q + 7) (0 >> 1 >> 0 >> 1 >> w7Run (b + 1) Z_base) (1 >> 0 >> 0 >> 1 >> T) + have h12 := pair46_exit_13 (1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> ozTail (q + 7) (0 >> 1 >> 0 >> 1 >> w7Run (b + 1) Z_base)) (1 >> T) + have h13 := step_F0 (1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> ozTail (q + 7) (0 >> 1 >> 0 >> 1 >> w7Run (b + 1) Z_base)) T + exact step_plus_trans (step_plus_star h1 h2) + (step_plus_trans h3 (step_plus_trans (step_plus_star h4 h5) + (step_plus_trans (step_plus_star h6 h7) + (step_plus_trans (step_plus_star h8 h9') + (step_plus_trans (step_plus_star h10 h11) + (step_plus_trans h12 h13)))))) + +set_option maxHeartbeats 1000000 in +theorem step4_D (b : Nat) (R : ListBlank (Fin 2)) : + (mkC 4 1 (ozTail 6 (w7Run (b + 1) Z_base)) (1 >> R)) [target_tm]⊢⁺ + (mkC 0 1 (L_init (b + 2)) R) := by + have h1 := step4D_entry_49 (w7Run b Z_base) (1 >> R) + have h2 := w7_sweep b Z_base (0 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 1 >> R) + have h3 := w7_exit_85 (z09Run b (0 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 1 >> R)) + rw [← z09Run_snoc b (0 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 1 >> R)] at h3 + have h4 := turn_p7_163 (z09Run b (0 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 1 >> R)) + have h5 := p7_sweep b (1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 1 >> default) + (0 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 1 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> 1 >> R) + have h6 := brD_p7_m7_114 (p7LRun b (1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 1 >> default)) (0 >> 1 >> R) + rw [← p7LRun_snoc b (1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 1 >> default)] at h6 + have h7 := m7_sweep b (1 >> 1 >> 1 >> 1 >> 0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 1 >> default) + (1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 0 >> 0 >> 1 >> R) + have h8 := br_m7_q7_168 (q7RRun b (1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 0 >> 0 >> 1 >> R)) + rw [← q7RRun_snoc b (1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 0 >> 0 >> 1 >> R)] at h8 + have h9 := q7_sweep b Z_base (1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> 0 >> 0 >> 1 >> R) + have h10 := step4D_exit_49 (w7Run b Z_base) (1 >> R) + have h11 := step_F0 (1 >> 0 >> 0 >> 1 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> w7Run b Z_base) R + exact step_plus_trans (step_plus_star h1 h2) + (step_plus_trans h3 (step_plus_trans (step_plus_star h4 h5) + (step_plus_trans (step_plus_star h6 h7) + (step_plus_trans (step_plus_star h8 h9) + (step_plus_trans h10 h11))))) + +set_option maxHeartbeats 1000000 in +theorem epoch_step (k b : Nat) : (S_inv k b) [target_tm]⊢⁺ (S_inv (k + 2) (b + 2)) := by + let q := dbl (dbl (expBase k)) + have h1 : (S_inv k b) [target_tm]⊢⁺ (mkC 4 1 (L_init b) (1 >> towerTail (k + 3))) := + fill_shift (k + 2) (1 >> 0 >> 0 >> 1 >> w7Run (b + 1) Z_base) + have h2 := step4_A b q (towerTail (k + 2)) + have h3 := fill_shift (k + 2) + (1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 1 >> 0 >> 0 >> 1 >> ozTail (q + 7) (0 >> 1 >> 0 >> 1 >> w7Run (b + 1) Z_base)) + have h4 := head_92 (1 >> ozTail (q + 7) (0 >> 1 >> 0 >> 1 >> w7Run (b + 1) Z_base)) (towerTail (k + 3)) + have h34 := step_plus_trans h3 h4 + have eq_split : (1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> ozTail (q + 7) (0 >> 1 >> 0 >> 1 >> w7Run (b + 1) Z_base)) = + (1 >> ozTail (expLen (k + 2) + 1) (ozTail 6 (w7Run (b + 1) Z_base))) := by + have h_lhs : (1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> 0 >> 1 >> ozTail (q + 7) (0 >> 1 >> 0 >> 1 >> w7Run (b + 1) Z_base)) = + (1 >> ozTail ((q + 7) + 12) (0 >> 1 >> 0 >> 1 >> w7Run (b + 1) Z_base)) := rfl + rw [h_lhs, exp_ident_1 k, ozTail_add (expLen (k + 2) + 1) 4 (0 >> 1 >> 0 >> 1 >> w7Run (b + 1) Z_base)] + rfl + rw [eq_split] at h34 + have h5 := bounce_loop (expLen (k + 2)) 0 (ozTail 6 (w7Run (b + 1) Z_base)) (towerTail (k + 2)) + rw [exp_ident_2 k] at h5 + have h6 := fill_shift (k + 2) (pairOnes (expLen (k + 3) + 1) (ozTail 6 (w7Run (b + 1) Z_base))) + have h7 := shift_pair (expLen (k + 3)) (1 >> ozTail 5 (w7Run (b + 1) Z_base)) (1 >> towerTail (k + 3)) + have h8 : (mkC 4 1 (ozTail 6 (w7Run (b + 1) Z_base)) (1 >> towerTail (k + 4))) [target_tm]⊢⁺ (S_inv (k + 2) (b + 2)) := + step4_D b (towerTail (k + 4)) + exact step_plus_trans h1 (step_plus_trans h2 (step_plus_trans h34 (step_plus_trans h5 (step_plus_trans h6 (step_plus_trans h7 h8))))) + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + refine isNotHalt_of_invariant (fun c => ∃ k b, c = S_inv k b) ?_ ?_ + · refine ⟨S_inv 4 0, ?_, 4, 0, rfl⟩ + exact init_to_S6_0 + · rintro _ ⟨k, b, rfl⟩ + exact ⟨S_inv (k + 2) (b + 2), epoch_step k b, k + 2, b + 2, rfl⟩ + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RE_1RCHHH_0LD1LE_0RE1LD_1RF0LC_0RA1RE diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RF_1LC0LF_1LD0LC_0LE0LA_1LFHHH_1RA1RF.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RF_1LC0LF_1LD0LC_0LE0LA_1LFHHH_1RA1RF.lean new file mode 100644 index 00000000..3bb8b741 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RF_1LC0LF_1LD0LC_0LE0LA_1LFHHH_1RA1RF.lean @@ -0,0 +1,946 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RF_1LC0LF_1LD0LC_0LE0LA_1LFHHH_1RA1RF + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1LC0LF_1LD0LC_0LE0LA_1LFHHH_1RA1RF" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 8000000 +set_option maxRecDepth 4000000 +@[simp] theorem zMz (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : HalfTape).head = 0 := rfl +@[simp] theorem zDt : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem zPs {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem zPt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,by omega,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) +abbrev t : BitWord := [1,1,0,0] +abbrev d0 : BitWord := [0,0] +abbrev d1 : BitWord := [1,0] +abbrev one : BitWord := [1] +abbrev lh : HalfTape := default +abbrev w_pre : BitWord := t ++ t ++ [0] ++ t ++ t ++ one +abbrev w_word : BitWord := w_pre +@[simp] theorem zDd : d0 +> (default : HalfTape) = default := by + simp [d0] +inductive Call where + | ch + | cj + | cp + | ca +def zCs : Call -> Fin 6 + | .ch => B + | .cj => A + | .cp => A + | .ca => A +def zCw : Call -> BitWord + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] + | .ca => [1,0,1,0,1,0] +def zCR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + ((l <+ zCw c) {{zCs c}}> r) +def zCL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (l <{{C}} ([0] +> r)) +def zCf (q : Nat) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + zCL lh ((w_pre ++ (t ^ (2 + q) ++ (d1 ++ one))) +> r) +def z04 (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l,(zCR l c r1) [target_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + z04 c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem z05 {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z06 {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem z07 {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z08 {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z09 {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0a (w : BitWord) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem z0b (ls : List Call) : Seg ls ls [] [] := by + intro r1 r2 h; exact h +theorem zSc {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases z09 h with ⟨r2,ha,hb⟩ + exact z08 (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS0 {ls1 ls2 ls3 : List Call} {w1 w2 v1 v2 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls2 ls3 v1 v2) : + Seg ls1 ls3 (w1 ++ v1) (w2 ++ v2) := by + intro r1 r2 h + rw [append_assoc,append_assoc] + exact h1 (v1 +> r1) (v2 +> r2) (h2 r1 r2 h) +theorem zS4 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc1 (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [target_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem z0c : Seg [.cp] [.ch] t (t ++ [0]) := + zS2 (mid := [1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0d : Seg [.cj] [.ch] t (t ++ one) := + zS2 (mid := [1,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0e : Seg [.ch] [.cj] (t ++ [0]) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0f : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0g : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0h : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1 d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0i : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0j : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0k : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0l : Seg [.cj] [.cp] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons,append_nil]; execute) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem H_T (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact z0a t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [zLp,h_eq,z07] + exact zSg z0f ih +theorem zSa {w2 : BitWord} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact z0a w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq,z07,zLp] + exact zSg hw ih +theorem z0m : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0n : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem z0o (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d0 d0 := + zSa z0m n +theorem z0p (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ n) d0 d1 := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg zH0 (zSa z0n n) +theorem z0q (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d1 d1 := + zSa z0n n +theorem z0r (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ (1 + n)) d1 d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg zH4 (zSa z0m n) +theorem z0s (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0c z0e) (H_T n) +theorem z0t (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0d zH2) (H_T n) +theorem z0u (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0g zH2) (H_T n) +theorem z0v (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0h (H_T n) +theorem z0w (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0i (H_T n) +theorem z0x (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [zLp',List.cons_append,List.nil_append] using zSg z0j (H_T n) +theorem z0y (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0k (zSg zH1 zH3) + have h1 := zSg h0 (zSa z0m n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0z (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0l (zSa z0m n) +theorem z0A : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0k zH1 +theorem z0B (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0k (zSg zH1 (zSg zH3 zH0)) + have h1 := zSg h0 (zSa z0n n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0C (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg [.cj,.ch] [.cp] d1 d1 := zSg z0l zH0 + have h1 := zSg h0 (zSa z0n n) + simpa only [zLp',List.cons_append,List.nil_append] using h1 +theorem z0D (n : Nat) : Seg (([Call.ch] ^ n) ++ [.cj,.ch]) (([Call.ch] ^ (1 + n * 2)) ++ [.cj,.ch]) t t := by + have h1 : Seg (([Call.ch] ^ n) ++ [.cj,.ch]) (([Call.ch] ^ (n * 2)) ++ [.ch,.cj,.ch]) t t := + zSg (H_T n) (z0t 0) + have heq : (([Call.ch] ^ (n * 2)) ++ [.ch,.cj,.ch]) = (([Call.ch] ^ (1 + n * 2)) ++ [.cj,.ch]) := by + have h2 : 1 + n * 2 = n * 2 + 1 := by omega + rw [h2,z07,z06,List.append_assoc] + rfl + rwa [heq] at h1 +theorem z0E (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([.cj] ++ [.ch] ^ n) (d1 ++ one) d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using zSg zH3 (z0o n) +theorem z0F (n : Nat) : Seg (([Call.ch] ^ (1 + n * 2)) ++ [.cj,.ch]) ([.cj] ++ [.ch] ^ n) (d1 ++ one) (d1 ++ one) := by + simpa only [List.append_nil] using zSg (z0E n) z0A +theorem z0G (q : Nat) : + ∀ n,Seg (([Call.ch] ^ n) ++ [.cj,.ch]) (([Call.ch] ^ ((1 + n) * 2 ^ q - 1)) ++ [.cj,.ch]) (t ^ q) (t ^ q) := by + induction q with + | zero => + intro n + have heq : (1 + n) * 2 ^ 0 - 1 = n := by simp + rw [heq] + exact z0b _ + | succ q ih => + intro n + have h1 := zS0 (z0D n) (ih (1 + n * 2)) + have heq : (1 + (1 + n * 2)) * 2 ^ q - 1 = (1 + n) * 2 ^ (q + 1) - 1 := by + rw [Nat.pow_succ]; ring_nf + rw [heq] at h1 + exact h1 +theorem z0H : Seg [.ca] [.cj,.ch] w_pre (w_pre ++ t) := + zS5 + (mid1 := [1,0,1,1,1,1,0,1,1,1,0,1,0,1,1,0,1,0,1,0,1,0]) + (mid2 := [1,0,1,0,1,1,0,1,1,1,0,1,0,1,1,0,1,0,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs w_pre t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL w_pre t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0I (r : HalfTape) : + (zCL lh r) [target_tm]⊢⁺ (zCR lh .ca r) := by + unfold zCL zCR lh zCw zCs + simp only [append_cons,append_nil,z00] + execute +open WordCalculus Word ChoiceE +local notation "WordList" => List Word +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) +theorem loc_z2t {k : Nat} (hK : 0 < k) : ∃ hs,Num k [] hs := by + rcases even_or_odd_mul_two k with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · cases a with + | zero => omega + | succ a => + have heq : (a + 1) * 2 = 2 + a * 2 := by omega + rw [heq]; exact ⟨[.cj] ++ [.ch] ^ a,Num.even a⟩ + · exact ⟨[.cp] ++ [.ch] ^ a,Num.odd a⟩ +theorem loc_z2u {k : Nat} {hs hs' : List Call} (h1 : Num k [] hs) (h2 : Num k [] hs') : + hs = hs' := by + cases h1 with + | @odd n => + generalize hk : 1 + n * 2 = k0 at h2 + cases h2 with + | @odd m => + have hnm : n = m := by omega + subst hnm; rfl + | even _ => omega + | @even n => + generalize hk : 2 + n * 2 = k0 at h2 + cases h2 with + | odd _ => omega + | @even m => + have hnm : n = m := by omega + subst hnm; rfl +def loc_z2v (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs,Num k w hs -> Side hs (w +> r) r' +theorem loc_z2w {r r' : HalfTape} (h : loc_z2v 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl +theorem loc_z2x {n : Nat} {r r' : HalfTape} + (hI : loc_z2v (n * 2) r r') : loc_z2v (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2w hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0k (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine zSc (z0y n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using hI [] _ hN2 +theorem loc_z2y {n : Nat} {r r' : HalfTape} + (hI : loc_z2v (n * 2) r r') : loc_z2v (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2w hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0A (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine zSc (z0B n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using hI [] _ hN2 +theorem loc_z2z {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hZ : A = 0) : + evalWords da default = default := by + induction hD with + | nil => rfl + | @zero A H u _ ih => + have hA0 : A = 0 := by omega + rw [evalWords,ih hA0,zDd] + | one _ => omega +theorem loc_z2A {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hPos : 0 < A) : + loc_z2v ((A - 1) * 2) default (evalWords da default) := by + induction hD with + | nil => omega + | @zero A H u _ ih => + have hA_pos : 0 < A := by omega + have hIH := ih hA_pos + have hs := loc_z2x hIH + rw [zDd] at hs + have heq : (A * 2 - 1) * 2 = 2 + (A - 1) * 4 := by omega + rw [evalWords] + rwa [heq] + | @one A H u hDu ih => + cases A with + | zero => + have h_side : evalWords (Q :: u) default = one +> default := by + rw [evalWords,loc_z2z hDu rfl] + simp [d1,one] + rw [h_side] + intro w hs hN + have hk0 : (1 + 0 * 2 - 1) * 2 = 0 := rfl + rw [hk0] at hN + generalize hk : (0 : Nat) = k0 at hN + cases hN with + | zero => exact Side.nil (one +> default) + | odd _ => omega + | even _ => omega + | succ A => + have hA_pos : 0 < A + 1 := by omega + have hIH := ih hA_pos + have heq_in : (A + 1 - 1) * 2 = A * 2 := by omega + rw [heq_in] at hIH + have hs := loc_z2y hIH + rw [zDd] at hs + have heq : (1 + (A + 1) * 2 - 1) * 2 = 4 + A * 4 := by omega + rw [evalWords] + rwa [heq] +theorem zEd {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ∀ {A H : Nat},DigitVal A H v -> Seg ([Call.ch] ^ n) ([Call.ch] ^ b) (wordsToBits u) (wordsToBits v) := by + induction hI with + | nil n => + intro A H _ + exact z0b _ + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | d00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0o _) (ih hD') + | d01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0p _) (ih hD') + | d10 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0q _) (ih hD') + | d11 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0r _) (ih hD') +theorem loc_z2B {n : Nat} {hs hs' : List Call} + (hI : Num (3 + n) [] hs) (hJ : Num (2 + n * 2) [] hs') : + Seg hs ([Call.ch] ++ hs') t t := by + generalize hk1 : 3 + n = k1 at hI + generalize hk2 : 2 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = m * 2 := by omega + subst hq + rw [h1m] + exact z0s m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0t m +theorem loc_z2C {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' (d1 ++ d0) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0u m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + have hq : q = m * 2 := by omega + subst hq + exact z0v m +theorem loc_z2D {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' (d1 ++ d1) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | @odd q => + have hq : q = m * 2 := by omega + subst hq + exact z0w m + | even _ => omega + | @even m => + cases hJ with + | @odd q => + have hq : q = 1 + m * 2 := by omega + subst hq + exact z0x m + | even _ => omega +theorem loc_z2E {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 2 + q * 2 := by omega + subst hm + exact z0y q +theorem loc_z2F {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = q * 2 := by omega + subst hm + exact z0z q + | even _ => omega +theorem loc_z2G {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 3 + q * 2 := by omega + subst hm + exact z0B q +theorem loc_z2H {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = 1 + q * 2 := by omega + subst hm + exact z0C q + | even _ => omega +theorem loc_z2I {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) : + ∀ {u : WordList} {n n' : Nat} {hs hs' : List Call}, + WordEffect n u n' v -> Num k [] hs -> Num k' [] hs' -> + Seg (([Call.ch] ^ n) ++ hs) (([Call.ch] ^ n') ++ hs') (wordsToBits u) (wordsToBits w) := by + induction hI with + | nil k => + intro u n n' hs hs' hE hN hN' + cases hE + rw [loc_z2u hN hN'] + exact z0b _ + | @T m _ _ _ _ _ _ ih => + intro u0 n0 n1 hs hs' hE hN hN' + cases hE with + | T hSub => + rcases loc_z2t (by omega : 0 < 2 + m * 2) with ⟨hs0,hN0⟩ + have hIH := ih hSub hN0 hN' + have hStep := zSg (H_T n0) (loc_z2B hN hN0) + have heq : ([Call.ch] ^ (n0 * 2)) ++ ([Call.ch] ++ hs0) = ([Call.ch] ^ (1 + n0 * 2)) ++ hs0 := by + have h1 : 1 + n0 * 2 = n0 * 2 + 1 := by omega + rw [h1,z07,z06,List.append_assoc] + rw [heq] at hStep + exact zS0 hStep hIH + | @pair0 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,K] ++ u) at hE + rcases wordEffect_split_output [Q,K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD10 : DigitVal 1 2 [Q,K] := DigitVal.one (DigitVal.zero DigitVal.nil) + have hStep := zSg (zEd hL hD10) (loc_z2C hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @pair1 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,Q] ++ u) at hE + rcases wordEffect_split_output [Q,Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD11 : DigitVal 3 2 [Q,Q] := DigitVal.one (DigitVal.one DigitVal.nil) + have hStep := zSg (zEd hL hD11) (loc_z2D hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short00 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (loc_z2E hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short01 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (loc_z2F hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short10 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (loc_z2G hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short11 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (loc_z2H hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') +theorem loc_z2J {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) {u : WordList} {r r' : HalfTape} + (hE : WordEffect 0 u 0 v) (hK : 0 < k') (hC : loc_z2v k' r r') : + loc_z2v k (evalWords u r) (evalWords w r') := by + intro w0 hs hN + have hPosK : 0 < k := phaseScan_pos_of_out_pos hI hK + have hw0 : w0 = [] := by + cases hN with + | zero => omega + | odd _ => rfl + | even _ => rfl + subst hw0 + rcases loc_z2t hK with ⟨hs',hN'⟩ + have hSeg := loc_z2I hI hE hN hN' + dsimp at hSeg + have hSide := zSc hSeg (hC [] hs' hN') + rwa [wordsToBits_append_tape,wordsToBits_append_tape] at hSide +theorem loc_z2K {q : Nat} {orig out : WordList} (hS : EStep q orig out) : + loc_z2v (4 * 2 ^ q) (evalWords orig default) (evalWords out default) := by + rcases hS with ⟨eff,n,v,a0,b0,J,da,hE,hI,hPos,hDA⟩ + have hBlank : evalWords [K] default = default := by simp [evalWords,d0] + have hC : loc_z2v (n * 2) default (evalWords da default) := by + have heq : n * 2 = ((1 + n) - 1) * 2 := by omega + rw [heq] + exact loc_z2A hDA (by omega) + have hRun := loc_z2J hI hE (by omega : 0 < n * 2) hC + rwa [evalWords_append,hBlank,<- evalWords_append] at hRun +theorem loc_z2L (q : Nat) : + Seg [.cj,.ch] ([.cj] ++ [.ch] ^ (2 ^ q - 1)) (t ^ (1 + q) ++ (d1 ++ one)) (t ^ (1 + q) ++ (d1 ++ one)) := by + have hpos := pow_two_pos q + have hT := z0G (1 + q) 0 + have heq : (1 + 0) * 2 ^ (1 + q) - 1 = 1 + (2 ^ q - 1) * 2 := by + rw [pow_two_one_add]; omega + rw [heq] at hT + dsimp at hT + exact zS0 hT (z0F (2 ^ q - 1)) +theorem loc_z2M (q : Nat) : + Seg [.ca] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) + (w_pre ++ (t ^ (2 + q) ++ (d1 ++ one))) + (w_pre ++ (t ^ (2 + (q + 1)) ++ (d1 ++ one))) := by + have h1 := zS0 z0H (loc_z2L (1 + q)) + have heq1 : 1 + (1 + q) = 2 + q := by omega + have heq2 : (w_pre ++ t) ++ (t ^ (2 + q) ++ (d1 ++ one)) = w_pre ++ (t ^ (2 + (q + 1)) ++ (d1 ++ one)) := by + have h3 : 2 + (q + 1) = 1 + (2 + q) := by omega + rw [h3,zLp'] + simp only [List.append_assoc] + rw [heq1] at h1 + rwa [heq2] at h1 +theorem loc_z2N (q : Nat) {r r' : HalfTape} (hI : loc_z2v (4 * 2 ^ q) r r') : + (zCf q r) [target_tm]⊢⁺ zCf (q + 1) r' := by + have hpos := pow_two_pos q + have h_num : Num (4 * 2 ^ q) [] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) := by + have heq : 4 * 2 ^ q = 2 + (2 ^ (1 + q) - 1) * 2 := by rw [pow_two_one_add]; omega + rw [heq]; exact Num.even (2 ^ (1 + q) - 1) + have hC := hI [] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) h_num + have hS := zSc (loc_z2M q) hC + rcases hS with _ | ⟨hca,hnil⟩ + cases hnil + exact zPt (z0I _) (hca lh) +theorem loc_z2O {q : Nat} {orig out : WordList} (hS : EStep q orig out) : + (zCf q (evalWords orig default)) [target_tm]⊢⁺ zCf (q + 1) (evalWords out default) := + loc_z2N q (loc_z2K hS) +theorem loc_z2P {h : Nat} {u : WordList} {j : Nat} {v : WordList} (hR : ERounds h u j v) : + (zCf h (evalWords u default)) [target_tm]⊢* zCf j (evalWords v default) := by + induction hR with + | refl _ _ => exact ⟨0,rfl⟩ + | next hS _ ih => + rcases loc_z2O hS with ⟨n,_,hn⟩ + rcases ih with ⟨m,hm⟩ + exact ⟨n + m,zMt target_tm _ _ _ n m hn hm⟩ +def loc_z2Q : WordList := [Q,V,K,K,Q] +abbrev CCfg := Counter.CCfg (Fin 2) (Fin 6) +abbrev CCfg.head (c : CCfg) : Fin 2 := c.cur +abbrev CCfg.left (c : CCfg) : List (Fin 2) := c.l +abbrev CCfg.right (c : CCfg) : List (Fin 2) := c.r +abbrev loc_z2R (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev loc_z2Y (c : CCfg) : Option CCfg := Counter.bstep target_tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep target_tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (loc_z2R c1) [target_tm]⊢⁺ (loc_z2R c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ +def loc_z31 : CCfg := + ⟨A,0,[],[]⟩ +def loc_z32 : CCfg := + ⟨C,1,[1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,0,1,1,0,1,0,1,0,1],[0,1,1,0,1,1,0,0,0,0,0,0,1]⟩ +def loc_z33 : CCfg := + ⟨C,0,[],[0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,1,1,0,0,0,0,0,0,1]⟩ +set_option maxRecDepth 4000000 in +theorem loc_z34 : zCm loc_z31 1000 = some loc_z32 := by decide +set_option maxRecDepth 4000000 in +theorem loc_z35 : zCm loc_z32 72 = some loc_z33 := by decide +theorem loc_z36 : + (init []) [target_tm]⊢⁺ zCf 2 (evalWords loc_z2Q default) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = loc_z2R loc_z31 := rfl + have h_end : loc_z2R loc_z33 = zCf 2 (evalWords loc_z2Q default) := by + unfold loc_z2R zCf zCL lh + rw [<- wordsToBits_append_tape,<- append_assoc,<- append_assoc] + have h_list : ([0] ++ (w_pre ++ (t ^ (2 + 2) ++ (d1 ++ one)))) ++ wordsToBits loc_z2Q = loc_z33.right ++ [0] := by decide + rw [h_list,append_assoc] + simp only [append_cons,append_nil,z00] + rfl + rw [h_init,<- h_end] + exact zPt (zTc (by decide) loc_z34) (zTc (by decide) loc_z35) +def loc_z37 : List CodeE := [ + (.More CS11 3 (.More CT 4 (.More CP0 9 (.More CP0 17 (.Stop 17))))), + (.More CS11 7 (.More CT 12 (.More CT 23 (.More CT 45 (.More CP0 91 (.More CS00 45 (.More CS01 22 (.More CP0 44 (.Stop 44))))))))), + (.More CS11 15 (.More CT 28 (.More CT 55 (.More CT 109 (.More CT 217 (.More CP1 435 (.More CT 868 (.More CS00 434 (.More CS10 216 (.More CP0 431 (.More CS01 215 (.More CP0 430 (.Stop 430))))))))))))), + (.More CS11 31 (.More CT 60 (.More CT 119 (.More CT 237 (.More CT 473 (.More CT 945 (.More CT 1889 (.More CP0 3779 (.More CT 7555 (.More CS11 3777 (.More CT 7552 (.More CS00 3776 (.More CS10 1887 (.More CS00 943 (.More CS00 471 (.More CP0 941 (.More CP1 1881 (.More CP0 3762 (.Stop 3762))))))))))))))))))), + (.More CS11 63 (.More CT 124 (.More CT 247 (.More CT 493 (.More CT 985 (.More CT 1969 (.More CT 3937 (.More CT 7873 (.More CT 15745 (.More CS10 7872 (.More CT 15741 (.More CS11 7870 (.More CP0 15740 (.More CS10 7869 (.More CT 15735 (.More CT 31469 (.More CT 62937 (.More CS10 31468 (.More CP0 62935 (.More CP1 125869 (.More CP0 251738 (.More CS10 125868 (.More CS11 62933 (.More CP1 125866 (.More CP0 251732 (.Stop 251732)))))))))))))))))))))))))), + (.More CS11 127 (.More CT 252 (.More CT 503 (.More CT 1005 (.More CT 2009 (.More CT 4017 (.More CT 8033 (.More CT 16065 (.More CT 32129 (.More CS10 16064 (.More CT 32125 (.More CS10 16062 (.More CT 32121 (.More CS10 16060 (.More CT 32117 (.More CT 64233 (.More CT 128465 (.More CS10 64232 (.More CT 128461 (.More CT 256921 (.More CT 513841 (.More CS10 256920 (.More CS11 128459 (.More CT 256916 (.More CT 513831 (.More CS10 256915 (.More CS00 128457 (.More CS00 64228 (.More CS10 32113 (.More CS00 16056 (.More CS10 8027 (.More CP1 16053 (.More CP1 32106 (.More CP0 64212 (.More CS10 32105 (.More CP1 64209 (.More CP1 128418 (.More CP0 256836 (.Stop 256836))))))))))))))))))))))))))))))))))))))), + (.More CS11 255 (.More CT 508 (.More CT 1015 (.More CT 2029 (.More CT 4057 (.More CT 8113 (.More CT 16225 (.More CT 32449 (.More CT 64897 (.More CS10 32448 (.More CT 64893 (.More CS10 32446 (.More CT 64889 (.More CS10 32444 (.More CT 64885 (.More CT 129769 (.More CT 259537 (.More CS10 129768 (.More CT 259533 (.More CT 519065 (.More CT 1038129 (.More CS10 519064 (.More CS11 259531 (.More CT 519060 (.More CT 1038119 (.More CS10 519059 (.More CS00 259529 (.More CP0 519057 (.More CP0 1038113 (.More CT 2076223 (.More CT 4152445 (.More CT 8304889 (.More CS10 4152444 (.More CT 8304885 (.More CT 16609769 (.More CT 33219537 (.More CS10 16609768 (.More CS10 8304883 (.More CS01 4152441 (.More CP0 8304882 (.More CP0 16609763 (.More CP1 33219525 (.More CP0 66439050 (.More CS10 33219524 (.More CS11 16609761 (.More CP1 33219522 (.More CP1 66439044 (.More CP0 132878088 (.Stop 132878088))))))))))))))))))))))))))))))))))))))))))))))))), + (.More CS11 511 (.More CT 1020 (.More CT 2039 (.More CT 4077 (.More CT 8153 (.More CT 16305 (.More CT 32609 (.More CT 65217 (.More CT 130433 (.More CS10 65216 (.More CT 130429 (.More CS10 65214 (.More CT 130425 (.More CS10 65212 (.More CT 130421 (.More CT 260841 (.More CT 521681 (.More CS10 260840 (.More CT 521677 (.More CT 1043353 (.More CT 2086705 (.More CS10 1043352 (.More CS11 521675 (.More CT 1043348 (.More CT 2086695 (.More CS10 1043347 (.More CS00 521673 (.More CT 1043343 (.More CT 2086685 (.More CT 4173369 (.More CT 8346737 (.More CT 16693473 (.More CS10 8346736 (.More CT 16693469 (.More CT 33386937 (.More CT 66773873 (.More CS10 33386936 (.More CP0 66773871 (.More CT 133547739 (.More CT 267095477 (.More CT 534190953 (.More CT 1068381905 (.More CS10 534190952 (.More CS11 267095475 (.More CT 534190948 (.More CT 1068381895 (.More CT 2136763789 (.More CS10 1068381894 (.More CS10 534190946 (.More CS10 267095472 (.More CS10 133547735 (.More CP0 267095469 (.More CP0 534190937 (.More CP1 1068381873 (.More CP0 2136763746 (.More CS10 1068381872 (.More CS10 534190935 (.More CS01 267095467 (.More CP1 534190934 (.More CP0 1068381868 (.More CS10 534190933 (.More CP1 1068381865 (.More CP1 2136763730 (.More CP1 4273527460 (.More CP0 8547054920 (.Stop 8547054920)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))), + (.More CS11 1023 (.More CT 2044 (.More CT 4087 (.More CT 8173 (.More CT 16345 (.More CT 32689 (.More CT 65377 (.More CT 130753 (.More CT 261505 (.More CS10 130752 (.More CT 261501 (.More CS10 130750 (.More CT 261497 (.More CS10 130748 (.More CT 261493 (.More CT 522985 (.More CT 1045969 (.More CS10 522984 (.More CT 1045965 (.More CT 2091929 (.More CT 4183857 (.More CS10 2091928 (.More CS11 1045963 (.More CT 2091924 (.More CT 4183847 (.More CS10 2091923 (.More CS00 1045961 (.More CT 2091919 (.More CT 4183837 (.More CT 8367673 (.More CT 16735345 (.More CT 33470689 (.More CS10 16735344 (.More CT 33470685 (.More CT 66941369 (.More CT 133882737 (.More CS10 66941368 (.More CT 133882733 (.More CT 267765465 (.More CT 535530929 (.More CT 1071061857 (.More CT 2142123713 (.More CS10 1071061856 (.More CS11 535530927 (.More CT 1071061852 (.More CT 2142123703 (.More CT 4284247405 (.More CS10 2142123702 (.More CS11 1071061850 (.More CP0 2142123700 (.More CT 4284247397 (.More CT 8568494793 (.More CT 17136989585 (.More CT 34273979169 (.More CS10 17136989584 (.More CP0 34273979167 (.More CT 68547958331 (.More CT 137095916661 (.More CS10 68547958330 (.More CT 137095916657 (.More CT 274191833313 (.More CT 548383666625 (.More CT 1096767333249 (.More CS10 548383666624 (.More CS10 274191833311 (.More CS00 137095916655 (.More CP1 274191833309 (.More CP1 548383666618 (.More CP0 1096767333236 (.More CP0 2193534666471 (.More CP1 4387069332941 (.More CP0 8774138665882 (.More CP0 17548277331763 (.More CS00 8774138665881 (.More CS00 4387069332940 (.More CS11 2193534666469 (.More CP1 4387069332938 (.More CP0 8774138665876 (.More CS10 4387069332937 (.More CS01 2193534666468 (.More CP1 4387069332936 (.More CP1 8774138665872 (.More CP1 17548277331744 (.More CP0 35096554663488 (.Stop 35096554663488))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))), + (.More CS11 2047 (.More CT 4092 (.More CT 8183 (.More CT 16365 (.More CT 32729 (.More CT 65457 (.More CT 130913 (.More CT 261825 (.More CT 523649 (.More CS10 261824 (.More CT 523645 (.More CS10 261822 (.More CT 523641 (.More CS10 261820 (.More CT 523637 (.More CT 1047273 (.More CT 2094545 (.More CS10 1047272 (.More CT 2094541 (.More CT 4189081 (.More CT 8378161 (.More CS10 4189080 (.More CS11 2094539 (.More CT 4189076 (.More CT 8378151 (.More CS10 4189075 (.More CS00 2094537 (.More CT 4189071 (.More CT 8378141 (.More CT 16756281 (.More CT 33512561 (.More CT 67025121 (.More CS10 33512560 (.More CT 67025117 (.More CT 134050233 (.More CT 268100465 (.More CS10 134050232 (.More CT 268100461 (.More CT 536200921 (.More CT 1072401841 (.More CT 2144803681 (.More CT 4289607361 (.More CS10 2144803680 (.More CS11 1072401839 (.More CT 2144803676 (.More CT 4289607351 (.More CT 8579214701 (.More CS10 4289607350 (.More CS11 2144803674 (.More CT 4289607346 (.More CT 8579214691 (.More CT 17158429381 (.More CT 34316858761 (.More CT 68633717521 (.More CS10 34316858760 (.More CT 68633717517 (.More CT 137267435033 (.More CT 274534870065 (.More CS10 137267435032 (.More CT 274534870061 (.More CT 549069740121 (.More CT 1098139480241 (.More CT 2196278960481 (.More CS10 1098139480240 (.More CP0 2196278960479 (.More CT 4392557920955 (.More CT 8785115841909 (.More CT 17570231683817 (.More CT 35140463367633 (.More CT 70280926735265 (.More CT 140561853470529 (.More CT 281123706941057 (.More CS11 140561853470528 (.More CP0 281123706941056 (.More CT 562247413882109 (.More CT 1124494827764217 (.More CS10 562247413882108 (.More CS10 281123706941053 (.More CT 562247413882103 (.More CT 1124494827764205 (.More CT 2248989655528409 (.More CT 4497979311056817 (.More CS10 2248989655528408 (.More CS10 1124494827764203 (.More CS00 562247413882101 (.More CS00 281123706941050 (.More CS10 140561853470524 (.More CS11 70280926735261 (.More CP0 140561853470522 (.More CP0 281123706941043 (.More CS00 140561853470521 (.More CS01 70280926735260 (.More CP1 140561853470520 (.More CP1 281123706941040 (.More CP0 562247413882080 (.More CP0 1124494827764159 (.More CP0 2248989655528317 (.More CP1 4497979311056633 (.More CP0 8995958622113266 (.More CP0 17991917244226531 (.More CS00 8995958622113265 (.More CS00 4497979311056632 (.More CS11 2248989655528315 (.More CP1 4497979311056630 (.More CP0 8995958622113260 (.More CS10 4497979311056629 (.More CP1 8995958622113257 (.More CP1 17991917244226514 (.More CP1 35983834488453028 (.More CP1 71967668976906056 (.More CP0 143935337953812112 (.Stop 143935337953812112)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +] +def loc_z38 : WordList := [Q,V,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,V,Q,V,V,V,Q,Q,V,V,Q,K,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,Q,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,Q,K,K,Q,Q,V,V,K,K,V,V,V,V,V,V,V,V,K,K,Q,V,V,Q,V,V,V,V,V] +def loc_z39 : WordList := [Q,K,K,K,Q,K,K,Q,K,Q,Q,Q,Q,K,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,K,K,K,K,Q,Q,K,Q,K,Q,Q,K,Q,Q,K,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def loc_z3a : WordList := [K,K,K,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,K,Q,K,Q,Q,K,Q,Q,K,Q,K,Q,K,Q,Q,Q,K,Q,K,K,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +set_option maxRecDepth 4000000 in +theorem loc_z3b : + ERounds 2 loc_z2Q 12 (loc_z38 ++ loc_z39) := by + have h1 : ERounds 2 loc_z2Q (2 + loc_z37.length) (loc_z38 ++ loc_z39) := by + apply evalERounds_sound loc_z37 + decide + exact h1 +set_option maxRecDepth 4000000 in +theorem loc_z3c : + EGood 12 (loc_z38 ++ loc_z39) := by + apply eGood_of_check 12 loc_z38 loc_z39 loc_z3a + · decide + · exact EGuard.D _ + · decide + · decide + · decide + · decide + · decide + · decide + · decide + · norm_num [loc_z38,loc_z3a,wordMass,wordMassK,wordScale] +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d) = some c') : + (multiStep target_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +theorem loc_z3d (m : Nat) : + ∃ N ≥ m,∃ h w,multiStep target_tm (init []) N = some (zCf h (evalWords w default)) /\ EGood h w := by + induction m with + | zero => + rcases loc_z36 with ⟨k1,_,hk1⟩ + rcases loc_z2P loc_z3b with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,12,loc_z38 ++ loc_z39, + zMt target_tm _ _ _ k1 k2 hk1 hk2,loc_z3c⟩ + | succ m ih => + rcases ih with ⟨N,hN,h,w,h_ms,h_good⟩ + rcases eGood_progress h_good with ⟨w',hStep,h_good'⟩ + rcases loc_z2O hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,h + 1,w', + zMt target_tm _ _ _ N k h_ms h_step_k,h_good'⟩ + +end Solution + + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases loc_z3d (n + 1) with ⟨N,hN,_,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := zIm h_N + rw [zMs,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RF_1LC0LF_1LD0LC_0LE0LA_1LFHHH_1RA1RF diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RF_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RF_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH.lean new file mode 100644 index 00000000..91634344 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RF_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH.lean @@ -0,0 +1,832 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.Longitudinal + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RF_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +local notation "zB" => ListBlank (Fin 2) +local notation "zF" => List (Fin 2) + +set_option linter.unusedSectionVars false +set_option maxHeartbeats 2000000 + +@[simp] theorem zMz (M : Machine (Fin 2) (Fin 6)) (config : Cfg (Fin 2) (Fin 6)) : + multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine (Fin 2) (Fin 6)) (config : Cfg (Fin 2) (Fin 6)) : + multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine (Fin 2) (Fin 6)) (config : Cfg (Fin 2) (Fin 6)) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : zB).head = 0 := rfl +@[simp] theorem zDt : (default : zB).tail = default := rfl +@[simp] theorem append_nil (s : zB) : ([] : zF) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : zF) (s : zB) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : zF) (s : zB) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append, append_cons, ih] + +theorem zSm (tm : Machine (Fin 2) (Fin 6)) (c_1 c_2 : Cfg (Fin 2) (Fin 6)) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 (tm : Machine (Fin 2) (Fin 6)) (c_1 c_2 : Cfg (Fin 2) (Fin 6)) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1, by decide, zSm tm c_1 c_2 h⟩ +theorem zMa (tm : Machine (Fin 2) (Fin 6)) (c_1 : Cfg (Fin 2) (Fin 6)) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, zMs, ih, Option.bind_assoc] + simp_rw [zMs] +theorem zMt (tm : Machine (Fin 2) (Fin 6)) (c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa, h₁]; simp [h₂] +theorem zPs {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 : Cfg (Fin 2) (Fin 6)} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ +theorem zPt {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, by omega, zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ + +macro "finish" : tactic => + `(tactic| exact ⟨0, rfl⟩) +macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, z00, zDh, zDt]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) + +abbrev ld : zF := [1, 1, 0] +abbrev d0 : zF := [0, 0, 0] +abbrev d1 : zF := [1, 0, 0] +abbrev w1ld : zF := [1, 1, 1, 0] +abbrev lh : zB := [1] +> default + +@[simp] theorem zDd : d0 +> (default : zB) = default := by simp [d0] + +theorem z1_eq : [1] +> (d1 +> (default : zB)) = ld +> default := by simp [d1, ld] +theorem z0_eq : [1] +> (d0 +> (default : zB)) = d1 +> default := by simp [d0, d1] + +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 + +open BusyBeaver.Longitudinal (DH0 toDHCfg SideRLs SegRLs) +open BusyBeaver.Longitudinal.BoundedConfig (segRLs_c_spec) + +abbrev Call := DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6) +abbrev ch : Call := ((B, []), (C, [])) +abbrev ch' : Call := ((D, [1]), (C, [])) + +def zCR (l : zB) (c : Call) (r : zB) : Cfg (Fin 2) (Fin 6) := + toDHCfg (c.1, .right) l r + +def zCL (l : zB) (r : zB) : Cfg (Fin 2) (Fin 6) := + toDHCfg ((C, []), .left) l r + +abbrev Side := SideRLs target_tm +abbrev Seg := SegRLs target_tm + +@[simp] theorem z05 {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z06 {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l + +theorem z08 {ls1 ls2 : List Call} {r1 r2 r3 : zB} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := + h1.trans h2 + +theorem zSc {ls1 ls2 : List Call} {w1 w2 : zF} {r1 r2 : zB} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1.sideRLs_concat h2 + +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : zF} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := + h1.trans h2 + +theorem seg_ch_d0 : Seg [ch] [] d0 d1 := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem seg_ch_d1 : Seg [ch] [ch] d1 d0 := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem seg_ch_ld : Seg [ch] [ch] ld ld := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem seg_ch'_ld_atom : Seg [ch'] [ch, ch', ch] ld ld := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem seg_ch_w1ld_atom : Seg [ch] [ch, ch', ch] w1ld ld := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem seg_ch'_d1 : Seg [ch'] [] d1 (ld ++ [1]) := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem seg_ch'_d0_atom : Seg [ch'] [ch', ch] d0 ld := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem seg_ch_1d1 : Seg [ch] [] ([1] ++ d1) (ld ++ [1]) := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem seg_ch_1d0 : Seg [ch] [] ([1] ++ d0) (d0 ++ [1]) := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem seg_wall_ld (k : Nat) : Seg ([ch] ^ k) ([ch] ^ k) ld ld := + seg_ch_ld.wall_pow k + +theorem seg_ch2_d0 : Seg [ch, ch] [ch] d0 d0 := zSg seg_ch_d0 seg_ch_d1 +theorem seg_ch2_d1 : Seg [ch, ch] [ch] d1 d1 := zSg seg_ch_d1 seg_ch_d0 + +theorem seg_d0_even (k : Nat) : Seg ([ch] ^ (k * 2)) ([ch] ^ k) d0 d0 := + SegRLs.addmul (h := [ch]) (a := 2) (x := k) (b := 0) (c := 0) (.nil d0) seg_ch2_d0 + +theorem seg_d1_even (k : Nat) : Seg ([ch] ^ (k * 2)) ([ch] ^ k) d1 d1 := + SegRLs.addmul (h := [ch]) (a := 2) (x := k) (b := 0) (c := 0) (.nil d1) seg_ch2_d1 + +theorem seg_d0_odd (k : Nat) : Seg ([ch] ^ (1 + k * 2)) ([ch] ^ k) d0 d1 := by + simpa only [zLp', List.cons_append, List.nil_append] using zSg seg_ch_d0 (seg_d1_even k) + +theorem seg_hx_ld (k : Nat) : Seg ([ch'] ++ [ch] ^ k) ([ch] ++ ([ch'] ++ [ch] ^ (1 + k))) ld ld := by + simpa only [zLp', List.cons_append, List.nil_append] using zSg seg_ch'_ld_atom (seg_wall_ld k) + +theorem seg_h1_ld (k : Nat) : Seg ([ch] ^ (1 + k)) ([ch] ++ ([ch'] ++ [ch] ^ (1 + k))) w1ld ld := by + simpa only [zLp', List.cons_append, List.nil_append] using zSg seg_ch_w1ld_atom (seg_wall_ld k) + +theorem seg_hx_d0 (k : Nat) : Seg ([ch'] ++ [ch] ^ k) ([ch'] ++ [ch] ^ (1 + k)) d0 ld := by + simpa only [zLp', List.cons_append, List.nil_append] using zSg seg_ch'_d0_atom (seg_wall_ld k) + +inductive RD where + | LD + | D0 + | D1 +deriving DecidableEq + +inductive H where + | hx + | h1 +deriving DecidableEq + +open RD H + +def toRC : List RD -> zB + | [] => default + | LD :: ls => ld +> toRC ls + | D0 :: ls => d0 +> toRC ls + | D1 :: ls => d1 +> toRC ls + +def toH' : H -> zF + | hx => [] + | h1 => [1] + +def toH : H -> List Call + | hx => [ch'] + | h1 => [] + +inductive Inc : List RD -> List RD -> Prop where + | nil : Inc [] [D1] + | d0 (r : List RD) : Inc (D0 :: r) (D1 :: r) + | d1 {r r' : List RD} : Inc r r' -> Inc (D1 :: r) (D0 :: r') + | ld {r r' : List RD} : Inc r r' -> Inc (LD :: r) (LD :: r') + +inductive RIncs : H -> Nat -> List RD -> List RD -> Prop where + | hx_ld {k : Nat} {r r1 r' : List RD} : + Inc r r1 -> RIncs hx (1 + k) r1 r' -> RIncs hx k (LD :: r) (LD :: r') + | hx_d1 {k : Nat} {r r' : List RD} : + RIncs h1 k r r' -> RIncs hx k (D1 :: r) (LD :: r') + | hx_d0 {k : Nat} {r r' : List RD} : + RIncs hx (1 + k) r r' -> RIncs hx k (D0 :: r) (LD :: r') + | h1_ld {k : Nat} {r r1 r' : List RD} : + Inc r r1 -> RIncs hx (1 + k) r1 r' -> RIncs h1 (1 + k) (LD :: r) (LD :: r') + | h1_d1 {k : Nat} {r r' : List RD} : + RIncs h1 k r r' -> RIncs h1 (1 + k) (D1 :: r) (LD :: r') + | h1_d0_0 {k : Nat} {r r' : List RD} : + RIncs h1 k r r' -> RIncs h1 (1 + k * 2) (D0 :: r) (D0 :: r') + | h1_d0_1 {k : Nat} {r r' : List RD} : + RIncs h1 k r r' -> RIncs h1 (2 + k * 2) (D0 :: r) (D1 :: r') + | h1_rh_0 : + RIncs h1 0 [] [D1] + | h1_rh_1 {k : Nat} {r' : List RD} : + RIncs h1 k [] r' -> RIncs h1 (1 + k * 2) [] (D0 :: r') + | h1_rh_2 {k : Nat} {r' : List RD} : + RIncs h1 k [] r' -> RIncs h1 (2 + k * 2) [] (D1 :: r') + | h1_z1 : + RIncs h1 0 [D1] [LD] + | h1_z0 : + RIncs h1 0 [D0] [D1] + +theorem Inc_spec {r r' : List RD} (h : Inc r r') : + Side [ch] (toRC r) (toRC r') := by + induction h with + | nil => + simpa only [toRC, zDd] using zSc seg_ch_d0 (SideRLs.nil default) + | d0 r => + exact zSc seg_ch_d0 (SideRLs.nil (toRC r)) + | d1 _ ih => + exact zSc seg_ch_d1 ih + | ld _ ih => + exact zSc seg_ch_ld ih + +theorem RIncs_spec {tp : H} {k : Nat} {r r' : List RD} (h : RIncs tp k r r') : + Side (toH tp ++ [ch] ^ k) (toH' tp +> toRC r) (toRC r') := by + induction h with + | @hx_ld k r r1 r' h_inc _ ih => + simp only [toH, toH', toRC, append_nil] at ih ⊢ + exact zSc (seg_hx_ld k) (z08 (Inc_spec h_inc) ih) + | @hx_d1 k r r' _ ih => + simp only [toH, toH', toRC, append_nil, List.nil_append] at ih ⊢ + have h1 := zSc seg_ch'_d1 (SideRLs.nil (toRC r)) + rw [append_assoc] at h1 + have h2 := zSc (seg_wall_ld k) ih + exact z08 h1 h2 + | @hx_d0 k r r' _ ih => + simp only [toH, toH', toRC, append_nil] at ih ⊢ + exact zSc (seg_hx_d0 k) ih + | @h1_ld k r r1 r' h_inc _ ih => + simp only [toH, toH', toRC, append_nil, List.nil_append] at ih ⊢ + have hw : [1] +> (ld +> toRC r) = w1ld +> toRC r := by rfl + rw [hw] + exact zSc (seg_h1_ld k) (z08 (Inc_spec h_inc) ih) + | @h1_d1 k r r' _ ih => + simp only [toH, toH', toRC, List.nil_append] at ih ⊢ + rw [zLp', <- append_assoc [1] d1 (toRC r)] + have h1 := zSc seg_ch_1d1 (SideRLs.nil (toRC r)) + rw [append_assoc] at h1 + have h2 := zSc (seg_wall_ld k) ih + exact z08 h1 h2 + | @h1_d0_0 k r r' _ ih => + simp only [toH, toH', toRC, List.nil_append] at ih ⊢ + rw [zLp', <- append_assoc [1] d0 (toRC r)] + have h1 := zSc seg_ch_1d0 (SideRLs.nil (toRC r)) + rw [append_assoc] at h1 + have h2 := zSc (seg_d0_even k) ih + exact z08 h1 h2 + | @h1_d0_1 k r r' _ ih => + simp only [toH, toH', toRC, List.nil_append] at ih ⊢ + have hk : 2 + k * 2 = 1 + (1 + k * 2) := by omega + rw [hk, zLp', <- append_assoc [1] d0 (toRC r)] + have h1 := zSc seg_ch_1d0 (SideRLs.nil (toRC r)) + rw [append_assoc] at h1 + have h2 := zSc (seg_d0_odd k) ih + exact z08 h1 h2 + | h1_rh_0 => + simp only [toH, toH', toRC, z05, List.append_nil, <- z0_eq, zDd] + exact SideRLs.nil ([1] +> default) + | @h1_rh_1 k r' _ ih => + simp only [toH, toH', toRC, List.nil_append] at ih ⊢ + have h_in : [1] +> (default : zB) = ([1] ++ d0) +> default := by + rw [append_assoc, zDd] + rw [zLp', h_in] + have h1 := zSc seg_ch_1d0 (SideRLs.nil default) + rw [append_assoc] at h1 + have h2 := zSc (seg_d0_even k) ih + exact z08 h1 h2 + | @h1_rh_2 k r' _ ih => + simp only [toH, toH', toRC, List.nil_append] at ih ⊢ + have hk : 2 + k * 2 = 1 + (1 + k * 2) := by omega + have h_in : [1] +> (default : zB) = ([1] ++ d0) +> default := by + rw [append_assoc, zDd] + rw [hk, zLp', h_in] + have h1 := zSc seg_ch_1d0 (SideRLs.nil default) + rw [append_assoc] at h1 + have h2 := zSc (seg_d0_odd k) ih + exact z08 h1 h2 + | h1_z1 => + simp only [toH, toH', toRC, z05, List.append_nil, z1_eq] + exact SideRLs.nil (ld +> default) + | h1_z0 => + simp only [toH, toH', toRC, z05, List.append_nil, z0_eq] + exact SideRLs.nil (d1 +> default) + +theorem Inc_total (r : List RD) : ∃ r', Inc r r' := by + induction r with + | nil => exact ⟨[D1], Inc.nil⟩ + | cons d r ih => + rcases ih with ⟨r', hI⟩ + cases d with + | LD => exact ⟨LD :: r', Inc.ld hI⟩ + | D0 => exact ⟨D1 :: r, Inc.d0 r⟩ + | D1 => exact ⟨D0 :: r', Inc.d1 hI⟩ + +theorem Inc_fun {r r1 r2 : List RD} (h1 : Inc r r1) (h2 : Inc r r2) : r1 = r2 := by + induction h1 generalizing r2 with + | nil => cases h2; rfl + | d0 r => cases h2; rfl + | d1 _ ih => cases h2 with | d1 h2' => rw [ih h2'] + | ld _ ih => cases h2 with | ld h2' => rw [ih h2'] + +theorem RIncs_eqk {tp : H} {k k' : Nat} {r r' : List RD} + (h : RIncs tp k r r') (hk : k = k') : RIncs tp k' r r' := by + subst hk; exact h + +theorem RIncs_Inc {tp : H} {k : Nat} {r r' r'' : List RD} + (h : RIncs tp k r r') (hJ : Inc r' r'') : RIncs tp (1 + k) r r'' := by + induction h generalizing r'' with + | hx_ld h_inc h_ri ih => + cases hJ with + | ld hJ' => exact RIncs.hx_ld h_inc (ih hJ') + | hx_d1 h_ri ih => + cases hJ with + | ld hJ' => exact RIncs.hx_d1 (ih hJ') + | hx_d0 h_ri ih => + cases hJ with + | ld hJ' => exact RIncs.hx_d0 (ih hJ') + | h1_ld h_inc h_ri ih => + cases hJ with + | ld hJ' => exact RIncs.h1_ld h_inc (ih hJ') + | h1_d1 h_ri ih => + cases hJ with + | ld hJ' => exact RIncs.h1_d1 (ih hJ') + | @h1_d0_0 k r r' h_ri ih => + cases hJ with + | d0 _ => + exact RIncs_eqk (RIncs.h1_d0_1 h_ri) (by omega) + | @h1_d0_1 k r r' h_ri ih => + cases hJ with + | d1 hJ' => + exact RIncs_eqk (RIncs.h1_d0_0 (ih hJ')) (by omega) + | h1_rh_0 => + cases hJ with + | d1 hJ' => + cases hJ' with + | nil => exact RIncs.h1_rh_1 RIncs.h1_rh_0 + | @h1_rh_1 k r' h_ri ih => + cases hJ with + | d0 _ => + exact RIncs_eqk (RIncs.h1_rh_2 h_ri) (by omega) + | @h1_rh_2 k r' h_ri ih => + cases hJ with + | d1 hJ' => + exact RIncs_eqk (RIncs.h1_rh_1 (ih hJ')) (by omega) + | h1_z1 => + cases hJ with + | ld hJ' => + cases hJ' with + | nil => exact RIncs.h1_d1 RIncs.h1_rh_0 + | h1_z0 => + cases hJ with + | d1 hJ' => + cases hJ' with + | nil => exact RIncs.h1_d0_0 RIncs.h1_rh_0 + +theorem mod2 (n : Nat) : (∃ b, n = b * 2) ∨ (∃ b, n = 1 + b * 2) := by + rcases Nat.mod_two_eq_zero_or_one n with h | h + · left; exact ⟨n / 2, by omega⟩ + · right; exact ⟨n / 2, by omega⟩ + +theorem RIncs_nxt_1 (k : Nat) : ∃ r, RIncs h1 k [] r := by + induction k using Nat.strong_induction_on with + | h k ih => + cases k with + | zero => exact ⟨[D1], RIncs.h1_rh_0⟩ + | succ m => + rcases mod2 m with ⟨b, rfl⟩ | ⟨b, rfl⟩ + · rcases ih b (by omega) with ⟨r, hI⟩ + refine ⟨D0 :: r, ?_⟩ + exact RIncs_eqk (RIncs.h1_rh_1 hI) (by omega) + · rcases ih b (by omega) with ⟨r, hI⟩ + refine ⟨D1 :: r, ?_⟩ + exact RIncs_eqk (RIncs.h1_rh_2 hI) (by omega) + +theorem End_1 {tp : H} {m : Nat} {e w : List RD} (h : RIncs tp m e w) + (htp : tp = h1) (he : e = []) : + ∀ q, m ≤ q -> ∃ w', RIncs h1 q w w' := by + induction h with + | hx_ld _ _ _ => cases htp + | hx_d1 _ _ => cases htp + | hx_d0 _ _ => cases htp + | h1_ld _ _ _ => cases he + | h1_d1 _ _ => cases he + | h1_d0_0 _ _ => cases he + | h1_d0_1 _ _ => cases he + | h1_rh_0 => + intro q _ + cases q with + | zero => exact ⟨[LD], RIncs.h1_z1⟩ + | succ q => + rcases RIncs_nxt_1 q with ⟨w', hI⟩ + exact ⟨LD :: w', RIncs_eqk (RIncs.h1_d1 hI) (by omega)⟩ + | @h1_rh_1 k r' h_ri ih => + intro q hq + have ih' := ih rfl rfl + rcases mod2 q with ⟨b, rfl⟩ | ⟨b, rfl⟩ + · cases b with + | zero => omega + | succ b => + rcases ih' b (by omega) with ⟨w', hI2⟩ + exact ⟨D1 :: w', RIncs_eqk (RIncs.h1_d0_1 hI2) (by omega)⟩ + · rcases ih' b (by omega) with ⟨w', hI2⟩ + exact ⟨D0 :: w', RIncs.h1_d0_0 hI2⟩ + | @h1_rh_2 k r' h_ri ih => + intro q hq + have ih' := ih rfl rfl + cases q with + | zero => omega + | succ q => + rcases ih' q (by omega) with ⟨w', hI2⟩ + exact ⟨LD :: w', RIncs_eqk (RIncs.h1_d1 hI2) (by omega)⟩ + | h1_z1 => cases he + | h1_z0 => cases he + +theorem End_x {tp : H} {m : Nat} {e w : List RD} (h : RIncs tp m e w) + (htp : tp = h1) (he : e = []) : + ∀ q, m ≤ 2 * q + 2 -> ∃ w', RIncs hx q w w' := by + induction h with + | hx_ld _ _ _ => cases htp + | hx_d1 _ _ => cases htp + | hx_d0 _ _ => cases htp + | h1_ld _ _ _ => cases he + | h1_d1 _ _ => cases he + | h1_d0_0 _ _ => cases he + | h1_d0_1 _ _ => cases he + | h1_rh_0 => + intro q _ + rcases RIncs_nxt_1 q with ⟨w', hI⟩ + exact ⟨LD :: w', RIncs.hx_d1 hI⟩ + | @h1_rh_1 k r' h_ri ih => + intro q hq + rcases ih rfl rfl (1 + q) (by omega) with ⟨w', hI2⟩ + exact ⟨LD :: w', RIncs.hx_d0 hI2⟩ + | @h1_rh_2 k r' h_ri _ => + intro q hq + rcases End_1 h_ri rfl rfl q (by omega) with ⟨w', hI2⟩ + exact ⟨LD :: w', RIncs.hx_d1 hI2⟩ + | h1_z1 => cases he + | h1_z0 => cases he + +theorem inv_hx_ld {k : Nat} {r rK : List RD} (h : RIncs hx k (LD :: r) rK) : + ∃ r1 rK', Inc r r1 ∧ RIncs hx (1 + k) r1 rK' ∧ rK = LD :: rK' := by + cases h with + | hx_ld h_inc h_ri => exact ⟨_, _, h_inc, h_ri, rfl⟩ + +theorem inv_hx_d1 {k : Nat} {r rK : List RD} (h : RIncs hx k (D1 :: r) rK) : + ∃ rK', RIncs h1 k r rK' ∧ rK = LD :: rK' := by + cases h with + | hx_d1 h_ri => exact ⟨_, h_ri, rfl⟩ + +theorem inv_hx_d0 {k : Nat} {r rK : List RD} (h : RIncs hx k (D0 :: r) rK) : + ∃ rK', RIncs hx (1 + k) r rK' ∧ rK = LD :: rK' := by + cases h with + | hx_d0 h_ri => exact ⟨_, h_ri, rfl⟩ + +theorem inv_h1_ld {k : Nat} {r rK : List RD} (h : RIncs h1 (1 + k) (LD :: r) rK) : + ∃ r1 rK', Inc r r1 ∧ RIncs hx (1 + k) r1 rK' ∧ rK = LD :: rK' := by + generalize hk : 1 + k = K at h + cases h with + | @h1_ld k0 _ r1 rK' h_inc h_ri => + have hk0 : k0 = k := by omega + subst hk0 + exact ⟨r1, rK', h_inc, h_ri, rfl⟩ + +theorem inv_h1_d1 {k : Nat} {r rK : List RD} (h : RIncs h1 (1 + k) (D1 :: r) rK) : + ∃ rK', RIncs h1 k r rK' ∧ rK = LD :: rK' := by + generalize hk : 1 + k = K at h + cases h with + | @h1_d1 k0 _ rK' h_ri => + have hk0 : k0 = k := by omega + subst hk0 + exact ⟨rK', h_ri, rfl⟩ + | h1_z1 => omega + +theorem inv_h1_d0 {K : Nat} {r rK : List RD} (h : RIncs h1 K (D0 :: r) rK) : + (∃ A rK', K = 1 + A * 2 ∧ RIncs h1 A r rK' ∧ rK = D0 :: rK') ∨ + (∃ A rK', K = 2 + A * 2 ∧ RIncs h1 A r rK' ∧ rK = D1 :: rK') ∨ + (K = 0 ∧ r = [] ∧ rK = [D1]) := by + generalize hd : D0 :: r = r0 at h + cases h with + | h1_ld _ _ => cases hd + | h1_d1 _ => cases hd + | @h1_d0_0 A r_in rK' h_ri => + injection hd with _ hr; subst hr + left; exact ⟨A, rK', rfl, h_ri, rfl⟩ + | @h1_d0_1 A r_in rK' h_ri => + injection hd with _ hr; subst hr + right; left; exact ⟨A, rK', rfl, h_ri, rfl⟩ + | h1_rh_0 => cases hd + | h1_rh_1 _ => cases hd + | h1_rh_2 _ => cases hd + | h1_z1 => cases hd + | h1_z0 => + injection hd with _ hr; subst hr + right; right; exact ⟨rfl, rfl, rfl⟩ + +theorem inv_z1 {K : Nat} {rK : List RD} (h : RIncs h1 K [D1] rK) : + (K = 0 ∧ rK = [LD]) ∨ + (∃ K0 rK', K = 1 + K0 ∧ RIncs h1 K0 [] rK' ∧ rK = LD :: rK') := by + generalize hd : ([D1] : List RD) = r0 at h + cases h with + | h1_ld _ _ => cases hd + | @h1_d1 K0 r_in rK' h_ri => + injection hd with _ hr; subst hr + right; exact ⟨K0, rK', rfl, h_ri, rfl⟩ + | h1_d0_0 _ => cases hd + | h1_d0_1 _ => cases hd + | h1_rh_0 => cases hd + | h1_rh_1 _ => cases hd + | h1_rh_2 _ => cases hd + | h1_z1 => left; exact ⟨rfl, rfl⟩ + | h1_z0 => cases hd + +def Inv (tp : H) (k j : Nat) (tq : H) (q : Nat) : Prop := + match tp, tq with + | hx, hx => k ≤ q ∧ j ≤ q + | h1, hx => k + 1 ≤ q ∧ j ≤ q + | h1, h1 => (j = 0 ∧ 2 * k + 1 ≤ q) ∨ (1 ≤ j ∧ k + j ≤ q ∧ 1 ≤ q) + | hx, h1 => False + +theorem key {tp : H} {k : Nat} {r r1 : List RD} (D : RIncs tp k r r1) : + ∀ j rK tq q, RIncs tp (k + j) r rK -> Inv tp k j tq q -> ∃ r2, RIncs tq q rK r2 := by + induction D with + | @hx_ld k r r1 r' Hi D ih => + intro j rK tq q E HI + rcases inv_hx_ld E with ⟨r1', rK', Hi', E', rfl⟩ + rw [Inc_fun Hi' Hi] at E' + cases tq with + | h1 => cases HI + | hx => + rcases Inc_total rK' with ⟨rK'', J⟩ + have E'' : RIncs hx ((1 + k) + (1 + j)) r1 rK'' := + RIncs_eqk (RIncs_Inc E' J) (by omega) + rcases ih (1 + j) rK'' hx (1 + q) E'' (by dsimp [Inv] at HI ⊢; omega) with ⟨r2, I2⟩ + exact ⟨LD :: r2, RIncs.hx_ld J I2⟩ + | @hx_d1 k r r' D ih => + intro j rK tq q E HI + rcases inv_hx_d1 E with ⟨rK', E', rfl⟩ + cases tq with + | h1 => cases HI + | hx => + rcases Inc_total rK' with ⟨rK'', J⟩ + have E'' : RIncs h1 (k + (1 + j)) r rK'' := + RIncs_eqk (RIncs_Inc E' J) (by omega) + rcases ih (1 + j) rK'' hx (1 + q) E'' (by dsimp [Inv] at HI ⊢; omega) with ⟨r2, I2⟩ + exact ⟨LD :: r2, RIncs.hx_ld J I2⟩ + | @hx_d0 k r r' D ih => + intro j rK tq q E HI + rcases inv_hx_d0 E with ⟨rK', E', rfl⟩ + cases tq with + | h1 => cases HI + | hx => + rcases Inc_total rK' with ⟨rK'', J⟩ + have E'' : RIncs hx ((1 + k) + (1 + j)) r rK'' := + RIncs_eqk (RIncs_Inc E' J) (by omega) + rcases ih (1 + j) rK'' hx (1 + q) E'' (by dsimp [Inv] at HI ⊢; omega) with ⟨r2, I2⟩ + exact ⟨LD :: r2, RIncs.hx_ld J I2⟩ + | @h1_ld k r r1 r' Hi D ih => + intro j rK tq q E HI + have E0 : RIncs h1 (1 + (k + j)) (LD :: r) rK := RIncs_eqk E (by omega) + rcases inv_h1_ld E0 with ⟨r1', rK', Hi', E', rfl⟩ + rw [Inc_fun Hi' Hi] at E' + rcases Inc_total rK' with ⟨rK'', J⟩ + have E'' : RIncs hx ((1 + k) + (1 + j)) r1 rK'' := + RIncs_eqk (RIncs_Inc E' J) (by omega) + cases tq with + | hx => + rcases ih (1 + j) rK'' hx (1 + q) E'' (by dsimp [Inv] at HI ⊢; omega) with ⟨r2, I2⟩ + exact ⟨LD :: r2, RIncs.hx_ld J I2⟩ + | h1 => + cases q with + | zero => dsimp [Inv] at HI; omega + | succ q0 => + rcases ih (1 + j) rK'' hx (1 + q0) E'' (by dsimp [Inv] at HI ⊢; omega) with ⟨r2, I2⟩ + exact ⟨LD :: r2, RIncs_eqk (RIncs.h1_ld J I2) (by omega)⟩ + | @h1_d1 k r r' D ih => + intro j rK tq q E HI + have E0 : RIncs h1 (1 + (k + j)) (D1 :: r) rK := RIncs_eqk E (by omega) + rcases inv_h1_d1 E0 with ⟨rK', E', rfl⟩ + rcases Inc_total rK' with ⟨rK'', J⟩ + have E'' : RIncs h1 (k + (1 + j)) r rK'' := + RIncs_eqk (RIncs_Inc E' J) (by omega) + cases tq with + | hx => + rcases ih (1 + j) rK'' hx (1 + q) E'' (by dsimp [Inv] at HI ⊢; omega) with ⟨r2, I2⟩ + exact ⟨LD :: r2, RIncs.hx_ld J I2⟩ + | h1 => + cases q with + | zero => dsimp [Inv] at HI; omega + | succ q0 => + rcases ih (1 + j) rK'' hx (1 + q0) E'' (by dsimp [Inv] at HI ⊢; omega) with ⟨r2, I2⟩ + exact ⟨LD :: r2, RIncs_eqk (RIncs.h1_ld J I2) (by omega)⟩ + | @h1_d0_0 a r r' D ih => + intro j rK tq q E HI + rcases inv_h1_d0 E with ⟨A, rK', HK, E', rfl⟩ | ⟨A, rK', HK, E', rfl⟩ | ⟨HK, _, _⟩ + · have E2 : RIncs h1 (a + (A - a)) r rK' := RIncs_eqk E' (by omega) + cases tq with + | hx => + rcases ih (A - a) rK' hx (1 + q) E2 (by dsimp [Inv] at HI ⊢; omega) with ⟨r2, I2⟩ + exact ⟨LD :: r2, RIncs.hx_d0 I2⟩ + | h1 => + rcases mod2 q with ⟨b, rfl⟩ | ⟨b, rfl⟩ + · cases b with + | zero => dsimp [Inv] at HI; omega + | succ b => + rcases ih (A - a) rK' h1 b E2 (by dsimp [Inv] at HI ⊢; omega) with ⟨r2, I2⟩ + exact ⟨D1 :: r2, RIncs_eqk (RIncs.h1_d0_1 I2) (by omega)⟩ + · rcases ih (A - a) rK' h1 b E2 (by dsimp [Inv] at HI ⊢; omega) with ⟨r2, I2⟩ + exact ⟨D0 :: r2, RIncs.h1_d0_0 I2⟩ + · have E2 : RIncs h1 (a + (A - a)) r rK' := RIncs_eqk E' (by omega) + cases tq with + | hx => + rcases ih (A - a) rK' h1 q E2 (by dsimp [Inv] at HI ⊢; omega) with ⟨r2, I2⟩ + exact ⟨LD :: r2, RIncs.hx_d1 I2⟩ + | h1 => + cases q with + | zero => dsimp [Inv] at HI; omega + | succ q0 => + rcases ih (A - a) rK' h1 q0 E2 (by dsimp [Inv] at HI ⊢; omega) with ⟨r2, I2⟩ + exact ⟨LD :: r2, RIncs_eqk (RIncs.h1_d1 I2) (by omega)⟩ + · omega + | @h1_d0_1 a r r' D ih => + intro j rK tq q E HI + rcases inv_h1_d0 E with ⟨A, rK', HK, E', rfl⟩ | ⟨A, rK', HK, E', rfl⟩ | ⟨HK, _, _⟩ + · have E2 : RIncs h1 (a + (A - a)) r rK' := RIncs_eqk E' (by omega) + cases tq with + | hx => + rcases ih (A - a) rK' hx (1 + q) E2 (by dsimp [Inv] at HI ⊢; omega) with ⟨r2, I2⟩ + exact ⟨LD :: r2, RIncs.hx_d0 I2⟩ + | h1 => + rcases mod2 q with ⟨b, rfl⟩ | ⟨b, rfl⟩ + · cases b with + | zero => dsimp [Inv] at HI; omega + | succ b => + rcases ih (A - a) rK' h1 b E2 (by dsimp [Inv] at HI ⊢; omega) with ⟨r2, I2⟩ + exact ⟨D1 :: r2, RIncs_eqk (RIncs.h1_d0_1 I2) (by omega)⟩ + · rcases ih (A - a) rK' h1 b E2 (by dsimp [Inv] at HI ⊢; omega) with ⟨r2, I2⟩ + exact ⟨D0 :: r2, RIncs.h1_d0_0 I2⟩ + · have E2 : RIncs h1 (a + (A - a)) r rK' := RIncs_eqk E' (by omega) + cases tq with + | hx => + rcases ih (A - a) rK' h1 q E2 (by dsimp [Inv] at HI ⊢; omega) with ⟨r2, I2⟩ + exact ⟨LD :: r2, RIncs.hx_d1 I2⟩ + | h1 => + cases q with + | zero => dsimp [Inv] at HI; omega + | succ q0 => + rcases ih (A - a) rK' h1 q0 E2 (by dsimp [Inv] at HI ⊢; omega) with ⟨r2, I2⟩ + exact ⟨LD :: r2, RIncs_eqk (RIncs.h1_d1 I2) (by omega)⟩ + · omega + | h1_rh_0 => + intro j rK tq q E HI + cases tq with + | hx => exact End_x E rfl rfl q (by dsimp [Inv] at HI; omega) + | h1 => exact End_1 E rfl rfl q (by dsimp [Inv] at HI; omega) + | h1_rh_1 _ _ => + intro j rK tq q E HI + cases tq with + | hx => exact End_x E rfl rfl q (by dsimp [Inv] at HI; omega) + | h1 => exact End_1 E rfl rfl q (by dsimp [Inv] at HI; omega) + | h1_rh_2 _ _ => + intro j rK tq q E HI + cases tq with + | hx => exact End_x E rfl rfl q (by dsimp [Inv] at HI; omega) + | h1 => exact End_1 E rfl rfl q (by dsimp [Inv] at HI; omega) + | h1_z1 => + intro j rK tq q E HI + rcases inv_z1 E with ⟨HK, rfl⟩ | ⟨K0, rK', HK, E', rfl⟩ + · cases tq with + | hx => + rcases RIncs_nxt_1 (1 + q) with ⟨w, I⟩ + exact ⟨LD :: LD :: w, RIncs.hx_ld Inc.nil (RIncs.hx_d1 I)⟩ + | h1 => + cases q with + | zero => dsimp [Inv] at HI; omega + | succ q0 => + rcases RIncs_nxt_1 (1 + q0) with ⟨w, I⟩ + exact ⟨LD :: LD :: w, RIncs_eqk (RIncs.h1_ld Inc.nil (RIncs.hx_d1 I)) (by omega)⟩ + · rcases Inc_total rK' with ⟨rK'', J⟩ + have E'' := RIncs_Inc E' J + cases tq with + | hx => + rcases End_x E'' rfl rfl (1 + q) (by dsimp [Inv] at HI; omega) with ⟨w, I⟩ + exact ⟨LD :: w, RIncs.hx_ld J I⟩ + | h1 => + cases q with + | zero => dsimp [Inv] at HI; omega + | succ q0 => + rcases End_x E'' rfl rfl (1 + q0) (by dsimp [Inv] at HI; omega) with ⟨w, I⟩ + exact ⟨LD :: w, RIncs_eqk (RIncs.h1_ld J I) (by omega)⟩ + | h1_z0 => + intro j rK tq q E HI + rcases inv_h1_d0 E with ⟨A, rK', HK, E', rfl⟩ | ⟨A, rK', HK, E', rfl⟩ | ⟨HK, _, rfl⟩ + · cases tq with + | hx => + rcases End_x E' rfl rfl (1 + q) (by dsimp [Inv] at HI; omega) with ⟨w, I⟩ + exact ⟨LD :: w, RIncs.hx_d0 I⟩ + | h1 => + rcases mod2 q with ⟨b, rfl⟩ | ⟨b, rfl⟩ + · cases b with + | zero => dsimp [Inv] at HI; omega + | succ b => + rcases End_1 E' rfl rfl b (by dsimp [Inv] at HI; omega) with ⟨w, I⟩ + exact ⟨D1 :: w, RIncs_eqk (RIncs.h1_d0_1 I) (by omega)⟩ + · rcases End_1 E' rfl rfl b (by dsimp [Inv] at HI; omega) with ⟨w, I⟩ + exact ⟨D0 :: w, RIncs.h1_d0_0 I⟩ + · cases tq with + | hx => + rcases End_1 E' rfl rfl q (by dsimp [Inv] at HI; omega) with ⟨w, I⟩ + exact ⟨LD :: w, RIncs.hx_d1 I⟩ + | h1 => + cases q with + | zero => dsimp [Inv] at HI; omega + | succ q0 => + rcases End_1 E' rfl rfl q0 (by dsimp [Inv] at HI; omega) with ⟨w, I⟩ + exact ⟨LD :: w, RIncs_eqk (RIncs.h1_d1 I) (by omega)⟩ + · cases tq with + | hx => + rcases RIncs_nxt_1 q with ⟨w, I⟩ + exact ⟨LD :: w, RIncs.hx_d1 I⟩ + | h1 => + cases q with + | zero => dsimp [Inv] at HI; omega + | succ q0 => + rcases RIncs_nxt_1 q0 with ⟨w, I⟩ + exact ⟨LD :: w, RIncs_eqk (RIncs.h1_d1 I) (by omega)⟩ + +theorem domain {r r' : List RD} (h : RIncs hx 0 r r') : ∃ r'', RIncs hx 0 r' r'' := + key h 0 r' hx 0 h (by dsimp [Inv]; omega) + +def S' (r : List RD) : Cfg (Fin 2) (Fin 6) := + zCR lh ch' (toRC r) + +theorem turn_lh (r : List RD) : (zCL lh (toRC r)) [target_tm]⊢⁺ S' r := by + unfold zCL S' zCR lh toDHCfg + simp only [append_cons, append_nil] + execute + +theorem BigStep {r r' : List RD} (h : RIncs hx 0 r r') : + (S' r) [target_tm]⊢⁺ (S' r') := by + have hS := RIncs_spec h + simp only [toH, toH', z05, List.append_nil, append_nil] at hS + exact zPt (hS.elim_single lh) (turn_lh r') + +theorem start_to_S' : (init []) [target_tm]⊢⁺ S' [LD, D1] := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + unfold S' zCR lh toDHCfg + dsimp [toRC, ld, d1] + execute + +theorem init_r : ∃ r', RIncs hx 0 [LD, D1] r' := by + refine ⟨[LD, LD, LD, D1, D1], ?_⟩ + refine RIncs.hx_ld (Inc.d1 Inc.nil) ?_ + refine RIncs.hx_d0 ?_ + refine RIncs.hx_d1 ?_ + exact RIncs.h1_rh_2 RIncs.h1_rh_0 + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + refine Counter.does_not_halt_of_invariant + (Inv := fun c => ∃ r r', c = S' r ∧ RIncs hx 0 r r') + ⟨S' [LD, D1], zPs start_to_S', [LD, D1], ?_⟩ ?_ + · rcases init_r with ⟨r', hr'⟩ + exact ⟨r', rfl, hr'⟩ + · rintro _ ⟨r, r', rfl, hR⟩ + rcases domain hR with ⟨r'', hR'⟩ + exact ⟨S' r', BigStep hR, r', r'', rfl, hR'⟩ + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RF_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_0RFHHH_1RA1RF.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_0RFHHH_1RA1RF.lean new file mode 100644 index 00000000..5f715a57 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_0RFHHH_1RA1RF.lean @@ -0,0 +1,1008 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_0RFHHH_1RA1RF + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1LC1RA_1LD0LC_0LE0LA_0RFHHH_1RA1RF" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 8000000 +@[simp] theorem zMz (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0=some config:=rfl +@[simp] theorem zMo (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1=step M config:=rfl +@[simp] theorem zMs (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : Nat) : + multiStep M config (n + 1)=Option.bind (multiStep M config n) (step M):= by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default=default:= by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : HalfTape).head=0:=rfl +@[simp] theorem zDt : (default : HalfTape).tail=default:=rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s=s:=rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s=a >> (l +> s):=rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s=l1 +> (l2 +> s):= by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢^{1} c₂:= by simp [h] +theorem z01 {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢⁺ c₂:=⟨1,by decide,zSm tm c₁ c₂ h⟩ +theorem zMa {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m)=(multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m):= by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c3 : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c3) : + c₁ [tm]⊢^{n+m} c3:= by + rw [zMa,h₁]; simp [h₂] +theorem zPs {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂:= by obtain ⟨n,_,hn⟩:=h; exact ⟨n,hn⟩ +theorem zPt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c3) : c₁ [tm]⊢⁺ c3:= by + obtain ⟨n,n_pos,hn⟩:=h₁; obtain ⟨m,m_pos,hm⟩:=h₂ + exact ⟨n + m,by omega,zMt tm c₁ c₂ c3 n m hn hm⟩ +theorem z02 {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c3) : c₁ [tm]⊢⁺ c3:= by + obtain ⟨n,n_pos,hn⟩:=h₁; obtain ⟨m,hm⟩:=h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c₁ c₂ c3 n m hn hm⟩ +theorem z03 {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c3) : c₁ [tm]⊢⁺ c3 := + z02 (z01 tm c₁ c₂ h₁) h₂ +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) +abbrev CCfg := Counter.CCfg (Fin 2) (Fin 6) +abbrev z04 (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev z0b (c : CCfg) : Option CCfg := Counter.bstep target_tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep target_tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (z04 c1) [target_tm]⊢⁺ (z04 c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ +abbrev t : BitWord:=[1,1,0,0] +abbrev d0 : BitWord:=[0,0] +abbrev d1 : BitWord:=[1,0] +abbrev one : BitWord:=[1] +abbrev lh : HalfTape:=[1,0,1] +> default +abbrev w_pre : BitWord:=t ++ t ++ one +@[simp] theorem zDd : d0 +> (default : HalfTape)=default:= by + simp [d0] +inductive Call where + | ch + | cj + | cp + | ca +def zCs : Call -> Fin 6 + | .ch => B + | .cj => A + | .cp => A + | .ca => B +def zCw : Call -> BitWord + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] + | .ca => [1,1,1,0,1,0] +def zCR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + ((l <+ zCw c) {{zCs c}}> r) +def zCL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (l <{{C}} ([0] +> r)) +def zCf (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + zCL lh (w_pre +> r) +def z0f (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l,(zCR l c r1) [target_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + z0f c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem z0g {α : Type*} (l : List α) : l ^ (0 : Nat)=[]:=rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1)=l ++ l ^ n:=rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n)=l ++ l ^ n:= by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z0h {α : Type*} (l : List α) : l ^ (1 : Nat)=l:= by + change l ++ []=l; exact List.append_nil l +theorem z0i {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n)=l ^ m ++ l ^ n:= by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z0j {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3:= by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z0k {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3:= by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0l (w : BitWord) : Seg [] [] w w:= by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem z0m (ls : List Call) : Seg ls ls [] []:= by + intro r1 r2 h; exact h +theorem zSc {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3:= by + intro r1 r3 h + rcases z0k h with ⟨r2,ha,hb⟩ + exact z0j (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS0 {ls1 ls2 ls3 : List Call} {w1 w2 v1 v2 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls2 ls3 v1 v2) : + Seg ls1 ls3 (w1 ++ v1) (w2 ++ v2):= by + intro r1 r2 h + rw [append_assoc,append_assoc] + exact h1 (v1 +> r1) (v2 +> r2) (h2 r1 r2 h) +theorem zS4 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2:= by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2:= by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc1 (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [target_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2:= by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem z0n : Seg [.cp] [.ch] t (t ++ [0]) := + zS2 (mid:=[1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0o : Seg [.cj] [.ch] t (t ++ one) := + zS2 (mid:=[1,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0p : Seg [.ch] [.cj] (t ++ [0]) t := + zS2 (mid:=[1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1:=[1,0,1,1]) (mid2:=[1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0q : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1:=[1,0,1,1]) (mid2:=[1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0r : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0s : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid:=[1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1 d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0t : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid:=[1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0u : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1:=[1,0,1,1]) (mid2:=[1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0v : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid:=[1,1]) + (fun l r => by unfold zCR zCw zCs d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0w : Seg [.cj] [.cp] d1 d0 := + zS2 (mid:=[1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons,append_nil]; execute) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid:=[1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem H_T (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t:= by + induction n with + | zero => exact z0l t + | succ n ih => + have h_eq : (n + 1) * 2=2 + n * 2:= by omega + rw [zLp,h_eq,z0i] + exact zSg z0q ih +theorem zSa {w2 : BitWord} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2:= by + induction n with + | zero => exact z0l w2 + | succ n ih => + have h_eq : (n + 1) * 2=2 + n * 2:= by omega + rw [h_eq,z0i,zLp] + exact zSg hw ih +theorem z0x : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0y : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem z0z (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d0 d0 := + zSa z0x n +theorem z0A (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ n) d0 d1:= by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg zH0 (zSa z0y n) +theorem z0B (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d1 d1 := + zSa z0y n +theorem z0C (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ (1 + n)) d1 d0:= by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg zH4 (zSa z0x n) +theorem z0D (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (n * 2)) t t:= by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0n z0p) (H_T n) +theorem z0E (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (1 + n * 2)) t t:= by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0o zH2) (H_T n) +theorem z0F (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t:= by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0r zH2) (H_T n) +theorem z0G (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0s (H_T n) +theorem z0H (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0t (H_T n) +theorem z0I (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t:= by + simpa only [zLp',List.cons_append,List.nil_append] using zSg z0u (H_T n) +theorem z0J (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0:= by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0v (zSg zH1 zH3) + have h1:=zSg h0 (zSa z0x n) + have heq : (2 + n * 2)=1 + (1 + n * 2):= by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0K (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0w (zSa z0x n) +theorem z0L : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0v zH1 +theorem z0M (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1:= by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0v (zSg zH1 (zSg zH3 zH0)) + have h1:=zSg h0 (zSa z0y n) + have heq : (3 + n * 2)=1 + (1 + (1 + n * 2)):= by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0N (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1:= by + have h0 : Seg [.cj,.ch] [.cp] d1 d1:=zSg z0w zH0 + have h1:=zSg h0 (zSa z0y n) + simpa only [zLp',List.cons_append,List.nil_append] using h1 +theorem z0O : Side [.ch] default (d1 +> default):= by + refine Side.cons (fun l => ?_) (Side.nil _) + unfold zCR zCL zCw zCs d1 + simp only [append_cons,append_nil,z00] + execute +theorem z0P : Seg [.ca] [.ch,.ch] t [1,1,0,0,0,1,1,0,0] := + zS5 + (mid1:=[1,0,1,1,1,1,0,1,0]) + (mid2:=[1,0,1,0,1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0Q : Seg [.ch] [.ch] [1,1,0,0,0,1,1,0,0] (t ++ t ++ one) := + zS2 + (mid:=[1,1,0,1,1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0R : Seg [.ca,.ch] ([.cj] ++ [.ch] ^ 5) w_pre (w_pre ++ t):= by + have h1 : Seg [.ca,.ch] [.ch,.ch,.ch] t (t ++ t ++ one) := + zSg z0P z0Q + have h2 : Seg [.ch,.ch,.ch] ([.cj] ++ [.ch] ^ 5) (t ++ one) t := + zSg zH2 (H_T 2) + have h3:=zS0 h1 h2 + simpa only [w_pre,List.append_assoc,List.cons_append,List.nil_append] using h3 +theorem z0S (r : HalfTape) : + (zCL lh r) [target_tm]⊢⁺ (zCR ([1] +> default) .ca r):= by + unfold zCL zCR lh zCw zCs + simp only [append_cons,append_nil,z00] + execute +theorem z0T (r : HalfTape) : + (zCL ([1] +> default) r) [target_tm]⊢⁺ (zCR lh .ch r):= by + unfold zCL zCR lh zCw zCs + simp only [append_cons,append_nil,z00] + execute +open WordCalculus +open WordCalculus.Word +local notation "WordList" => List Word +def z3p : WordList := + [Q,Q,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,Q,Q,V] +def z3q : WordList := + [K,Q,V,V,V,V,K,V,K,K,K,V,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,K,K,V] +theorem z3w (n : Nat) : + Copy (31 + 32 * n) (260 + 256 * n) z3p z3q (10373 + 8192 * n) (55788 + 65536 * n):= by + unfold z3p z3q + refine copy_step_d11 (n':=16 + 16 * n) (k':=128 + 128 * n) (m:=64 + 64 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_d10 (n':=8 + 8 * n) (k':=63 + 64 * n) (m:=31 + 32 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=17 + 16 * n) (k':=122 + 128 * n) (m:=60 + 64 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=35 + 32 * n) (k':=240 + 256 * n) (m:=119 + 128 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=71 + 64 * n) (k':=476 + 512 * n) (m:=237 + 256 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=143 + 128 * n) (k':=948 + 1024 * n) (m:=473 + 512 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n':=72 + 64 * n) (k':=472 + 512 * n) (m:=236 + 256 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=145 + 128 * n) (k':=940 + 1024 * n) (m:=469 + 512 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n':=73 + 64 * n) (k':=468 + 512 * n) (m:=234 + 256 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n':=37 + 32 * n) (k':=232 + 256 * n) (m:=116 + 128 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n':=19 + 16 * n) (k':=114 + 128 * n) (m:=57 + 64 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=39 + 32 * n) (k':=224 + 256 * n) (m:=111 + 128 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=79 + 64 * n) (k':=444 + 512 * n) (m:=221 + 256 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=159 + 128 * n) (k':=884 + 1024 * n) (m:=441 + 512 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n':=80 + 64 * n) (k':=440 + 512 * n) (m:=220 + 256 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=161 + 128 * n) (k':=876 + 1024 * n) (m:=437 + 512 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=323 + 256 * n) (k':=1748 + 2048 * n) (m:=873 + 1024 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=647 + 512 * n) (k':=3492 + 4096 * n) (m:=1745 + 2048 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=1295 + 1024 * n) (k':=6980 + 8192 * n) (m:=3489 + 4096 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=2591 + 2048 * n) (k':=13956 + 16384 * n) (m:=6977 + 8192 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=5183 + 4096 * n) (k':=27908 + 32768 * n) (m:=13953 + 16384 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=10367 + 8192 * n) (k':=55812 + 65536 * n) (m:=27905 + 32768 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n':=5184 + 4096 * n) (k':=27904 + 32768 * n) (m:=13952 + 16384 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=10369 + 8192 * n) (k':=55804 + 65536 * n) (m:=27901 + 32768 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=20739 + 16384 * n) (k':=111604 + 131072 * n) (m:=55801 + 65536 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n':=10370 + 8192 * n) (k':=55800 + 65536 * n) (m:=27900 + 32768 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=20741 + 16384 * n) (k':=111596 + 131072 * n) (m:=55797 + 65536 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n':=10371 + 8192 * n) (k':=55796 + 65536 * n) (m:=27898 + 32768 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n':=5186 + 4096 * n) (k':=27896 + 32768 * n) (m:=13948 + 16384 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=10373 + 8192 * n) (k':=55788 + 65536 * n) (m:=27893 + 32768 * n) (by omega) (by omega) (by omega) ?_ + exact Copy.nil _ _ +theorem z3x (q : Nat) (hQ : 5 <= q) : + CopyTwelve (List.replicate q V ++ z3p) (List.replicate q V ++ z3q):= by + have hPow : 2 ^ q=32 * 2 ^ (q - 5):= by + have heq : q=5 + (q - 5):= by omega + conv_lhs => rw [heq,Nat.pow_add] + have hPos:=pow_two_pos (q - 5) + have hTs:=copy_replicate_V q 0 8 + have hBase:=z3w (2 ^ (q - 5) - 1) + have h1 : (1 + 0) * 2 ^ q - 1=31 + 32 * (2 ^ (q - 5) - 1):= by omega + have h2 : 4 + 8 * 2 ^ q=260 + 256 * (2 ^ (q - 5) - 1):= by omega + rw [h1,h2] at hTs + exact ⟨_,_,copy_append hTs hBase⟩ +theorem z3y : isSafePrefix z3q=true:= by decide +kernel +def z3K : WordList := + [Q,Q,Q,Q,K,Q,K,Q,K] ++ List.replicate 15 Q +def z3L : WordList := + List.replicate 4 V ++ [Q,Q] ++ List.replicate 4 V ++ [Q,V] ++ List.replicate 5 Q ++ [K,Q] +def u_5 : WordList:=(([V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,Q] ++ [V,V,Q,V,Q,Q,V,V,V,V,V,V,V,Q,V,Q,V,K,V,V,V,V,K,V,V,V,K,K,K,K,Q,Q]) ++ [Q,K,Q,Q,K,Q,K,Q,K,Q,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q]) +def z3M : WordList:=(((([V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V] ++ [V,V,V,V,Q,V,V,Q,V,Q,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,V,V,Q,V,V,V,Q]) ++ ([V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,Q,V,V,V,V,Q,V,V,Q,Q] ++ [V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,Q,V,V])) ++ (([V,V,V,V,V,V,V,Q,V,V,Q,Q,K,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,K,K,V,V,Q] ++ [K,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,K,Q,V,V,V,V,V,V,Q,V,V,V,V,Q]) ++ ([V,Q,V,V,V,V,V,V,Q,V,V,K,V,Q,Q,V,V,Q,K,V,V,V,V,V,V,V,V,V,V,K,K,K] ++ [K,K,Q,K,K,Q,Q,Q,Q,Q,K,K,Q,K,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,K]))) ++ (([K,K,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,K,Q,K,K,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,K] ++ [Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q]) ++ [Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q])) +def z3N : WordList:=(((((([V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,Q,Q,V,V] ++ [V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,Q,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,V,V]) ++ ([Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,Q,V,V,V,V] ++ [Q,V,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,V,V,V])) ++ (([V,Q,Q,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V] ++ [V,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V]) ++ ([V,Q,V,Q,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V] ++ [V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V]))) ++ ((([V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,V,V] ++ [V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q]) ++ ([V,V,V,V,V,Q,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,Q,V,Q,V,Q,V,V,V,V,V,V,V] ++ [V,V,V,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V])) ++ (([V,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,V,V,V,V,V,Q,V,V] ++ [V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,Q,Q,V,V,V,Q,V,Q,V,Q,V,K,V,V]) ++ ([V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,V,V,Q] ++ [V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,Q,Q,V,Q,V,V,V,V,V,Q,Q,V,V,V,V,V])))) ++ (((([V,V,Q,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,K,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V] ++ [V,Q,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V]) ++ ([Q,V,V,V,V,V,V,Q,Q,V,V,V,Q,V,Q,V,K,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V] ++ [V,Q,V,K,K,V,V,Q,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,K,K,V,V,V,K])) ++ (([Q,V,V,Q,V,V,Q,V,V,Q,K,V,Q,V,V,V,V,V,V,V,Q,K,K,V,V,V,Q,K,Q,V,V,V] ++ [V,V,V,V,V,V,Q,V,V,V,Q,V,Q,K,K,V,K,V,V,V,V,V,K,V,V,V,V,V,V,Q,V,V]) ++ ([Q,V,Q,K,V,V,K,Q,V,V,V,V,V,V,V,V,K,V,K,V,V,V,V,V,Q,V,V,V,V,Q,V,Q] ++ [V,V,Q,V,V,V,V,V,Q,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,K,Q,V,V,V,V]))) ++ ((([Q,K,V,V,V,Q,V,K,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,K,V,Q,Q,V,V] ++ [Q,K,V,V,V,V,K,V,V,V,V,V,V,V,V,K,K,K,K,K,K,K,K,K,Q,Q,Q,Q,Q,K,K,K]) ++ ([K,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,K,K,Q,Q,K,Q,K,Q,Q,K,Q,K,Q,K,Q,Q,K,Q] ++ [K,Q,Q,Q,Q,Q,K,Q,K,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,K,K,K,K,K,K,K])) ++ (([K,K,K,K,K,K,K,K,K,K,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,Q,Q,Q] ++ [Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,K,K,K,K,K,Q,Q,K,K,Q]) ++ ([Q,Q,Q,Q,K,K,Q,Q,K,Q,K,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,K,Q,Q] ++ [K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K]))))) ++ ((([Q,Q,Q,Q,K,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,K] ++ [Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,K,K,K,Q,K,Q,Q,Q,K,K,Q,K,Q,Q,K,K,K,K,K,K,Q]) ++ ([Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q] ++ [Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K])) ++ (([Q,K,K,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,K,Q,K] ++ [K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q]) ++ ([Q,K,K,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,K,K,Q,Q,Q,Q,K] ++ [K,Q,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q])))) +theorem z3O : EntrySpec 19 z3p z3K 4000 := entrySpec_of_checkEntrySpec (by decide +kernel) +set_option maxRecDepth 4000000 in +theorem z3P : evalRounds 5 z3L=some u_5:= by decide +kernel +set_option maxRecDepth 4000000 in +theorem z3Q : evalRounds 5 u_5=some z3M:= by decide +kernel +set_option maxRecDepth 4000000 in +theorem z3R : evalRounds 5 z3M=some z3N:= by decide +kernel +set_option maxRecDepth 4000000 in +theorem z3S : checkEntryTwo 19 z3p z3K 4000 z3N 2037069094267076958420888491435203179760967054091814261035682930018874896175844063321850884 372147477078439049726577797474543292014151550417027720452348906634812472893970907240825621059509536667077236084730116958171344441069017087=true:= by decide +kernel +theorem z3T : ∃ v,Rounds z3L v /\ AggState z3p 16 19 v:= by + refine ⟨z3N,?_,good_of_checkEntryTwo 19 z3p z3K 4000 z3N 2037069094267076958420888491435203179760967054091814261035682930018874896175844063321850884 372147477078439049726577797474543292014151550417027720452348906634812472893970907240825621059509536667077236084730116958171344441069017087 z3O z3S⟩ + exact rounds_trans (evalRounds_sound 5 z3L u_5 z3P) + (rounds_trans (evalRounds_sound 5 u_5 z3M z3Q) + (evalRounds_sound 5 z3M z3N z3R)) +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) +theorem z3U {k : Nat} (hK : 0 < k) : ∃ hs,Num k [] hs:= by + rcases even_or_odd_mul_two k with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · cases a with + | zero => omega + | succ a => + have heq : (a + 1) * 2=2 + a * 2:= by omega + rw [heq]; exact ⟨[.cj] ++ [.ch] ^ a,Num.even a⟩ + · exact ⟨[.cp] ++ [.ch] ^ a,Num.odd a⟩ +theorem z3V {k : Nat} {hs hs' : List Call} (h1 : Num k [] hs) (h2 : Num k [] hs') : + hs=hs':= by + cases h1 with + | @odd n => + generalize hk : 1 + n * 2=k0 at h2 + cases h2 with + | @odd m => + have hnm : n=m:= by omega + subst hnm; rfl + | even _ => omega + | @even n => + generalize hk : 2 + n * 2=k0 at h2 + cases h2 with + | odd _ => omega + | @even m => + have hnm : n=m:= by omega + subst hnm; rfl +def z3W (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs,Num k w hs -> Side hs (w +> r) r' +theorem z3X {r r' : HalfTape} (h : z3W 0 r r') : + r'=one +> r:= by + have h0:=h one [] Num.zero + cases h0 + rfl +theorem z3Y {n : Nat} {r r' : HalfTape} + (hI : z3W (n * 2) r r') : z3W (2 + n * 4) (d0 +> r) (d0 +> r'):= by + intro w hs hN + generalize hk : 2 + n * 4=k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m=n * 2:= by omega + subst hm + cases n with + | zero => + have hr':=z3X hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0v (Side.nil r) + | succ n => + have heq : (n + 1) * 2=2 + n * 2:= by omega + rw [heq] + refine zSc (z0J n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n):= by + rw [heq]; exact Num.even n + simpa using hI [] _ hN2 +theorem z3Z {n : Nat} {r r' : HalfTape} + (hI : z3W (n * 2) r r') : z3W (4 + n * 4) (d0 +> r) (d1 +> r'):= by + intro w hs hN + generalize hk : 4 + n * 4=k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m=1 + n * 2:= by omega + subst hm + cases n with + | zero => + have hr':=z3X hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0L (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2=3 + n * 2:= by omega + rw [heq] + refine zSc (z0M n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n):= by + have heq2 : (n + 1) * 2=2 + n * 2:= by omega + rw [heq2]; exact Num.even n + simpa using hI [] _ hN2 +theorem z40 {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hZ : A=0) : + evalWords da default=default:= by + induction hD with + | nil => rfl + | @zero A H u _ ih => + have hA0 : A=0:= by omega + dsimp only [evalWords] + rw [ih hA0,zDd] + | one _ => omega +theorem z41 {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hPos : 0 < A) : + z3W ((A - 1) * 2) default (evalWords da default):= by + induction hD with + | nil => omega + | @zero A H u _ ih => + have hA_pos : 0 < A:= by omega + have hIH:=ih hA_pos + have hs:=z3Y hIH + rw [zDd] at hs + have heq : (A * 2 - 1) * 2=2 + (A - 1) * 4:= by omega + dsimp [evalWords] + rwa [heq] + | @one A H u hDu ih => + cases A with + | zero => + change z3W 0 default (d1 +> evalWords u default) + rw [z40 hDu rfl] + intro w hs hN + generalize hk : 0=k0 at hN + cases hN with + | zero => + have hd : d1 +> (default : HalfTape)=one +> default:= by simp [d1,one] + rw [hd]; exact Side.nil (one +> default) + | odd _ => omega + | even _ => omega + | succ A => + have hA_pos : 0 < A + 1:= by omega + have hIH:=ih hA_pos + have heq_in : (A + 1 - 1) * 2=A * 2:= by omega + rw [heq_in] at hIH + have hs:=z3Z hIH + rw [zDd] at hs + have heq : (1 + (A + 1) * 2 - 1) * 2=4 + A * 4:= by omega + dsimp [evalWords] + rwa [heq] +theorem zEd {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ∀ {A H : Nat},DigitVal A H v -> Seg ([Call.ch] ^ n) ([Call.ch] ^ b) (wordsToBits u) (wordsToBits v):= by + induction hI with + | nil n => + intro A H _ + exact z0m ([Call.ch] ^ n) + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | d00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0z _) (ih hD') + | d01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0A _) (ih hD') + | d10 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0B _) (ih hD') + | d11 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0C _) (ih hD') +theorem z42 {n : Nat} {hs hs' : List Call} + (hI : Num (3 + n) [] hs) (hJ : Num (2 + n * 2) [] hs') : + Seg hs ([Call.ch] ++ hs') t t:= by + generalize hk1 : 3 + n=k1 at hI + generalize hk2 : 2 + n * 2=k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1=1 + m:= by omega + have hq : q=m * 2:= by omega + subst hq + rw [h1m] + exact z0D m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1=1 + m:= by omega + have hq : q=1 + m * 2:= by omega + subst hq + rw [h1m] + exact z0E m +theorem z43 {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' (d1 ++ d0) t:= by + generalize hk1 : 1 + n=k1 at hI + generalize hk2 : n * 2=k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1=1 + m:= by omega + have hq : q=1 + m * 2:= by omega + subst hq + rw [h1m] + exact z0F m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + have hq : q=m * 2:= by omega + subst hq + exact z0G m +theorem z44 {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' (d1 ++ d1) t:= by + generalize hk1 : 1 + n=k1 at hI + generalize hk2 : 1 + n * 2=k2 at hJ + cases hI with + | @odd m => + cases hJ with + | @odd q => + have hq : q=m * 2:= by omega + subst hq + exact z0H m + | even _ => omega + | @even m => + cases hJ with + | @odd q => + have hq : q=1 + m * 2:= by omega + subst hq + exact z0I m + | even _ => omega +theorem z45 {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d0:= by + generalize hk1 : 2 + n * 4=k1 at hI + generalize hk2 : n * 2=k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m=2 + q * 2:= by omega + subst hm + exact z0J q +theorem z46 {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d0:= by + generalize hk1 : 2 + n * 4=k1 at hI + generalize hk2 : 1 + n * 2=k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m=q * 2:= by omega + subst hm + exact z0K q + | even _ => omega +theorem z47 {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d1:= by + generalize hk1 : 4 + n * 4=k1 at hI + generalize hk2 : n * 2=k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m=3 + q * 2:= by omega + subst hm + exact z0M q +theorem z48 {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d1:= by + generalize hk1 : 4 + n * 4=k1 at hI + generalize hk2 : 1 + n * 2=k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m=1 + q * 2:= by omega + subst hm + exact z0N q + | even _ => omega +theorem z49 {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : ℚ} + (hI : PhaseScan k v k' w a b) : + ∀ {u : WordList} {n n' : Nat} {hs hs' : List Call}, + WordEffect n u n' v -> Num k [] hs -> Num k' [] hs' -> + Seg (([Call.ch] ^ n) ++ hs) (([Call.ch] ^ n') ++ hs') (wordsToBits u) (wordsToBits w):= by + induction hI with + | nil k => + intro u n n' hs hs' hE hN hN' + cases hE + rw [z3V hN hN'] + exact z0m (([Call.ch] ^ n) ++ hs') + | @T m _ _ _ _ _ _ ih => + intro u0 n0 n1 hs hs' hE hN hN' + cases hE with + | T hSub => + rcases z3U (by omega : 0 < 2 + m * 2) with ⟨hs0,hN0⟩ + have hIH:=ih hSub hN0 hN' + have hStep:=zSg (H_T n0) (z42 hN hN0) + have heq : ([Call.ch] ^ (n0 * 2)) ++ ([Call.ch] ++ hs0)=([Call.ch] ^ (1 + n0 * 2)) ++ hs0:= by + have h1 : 1 + n0 * 2=n0 * 2 + 1:= by omega + rw [h1,z0i,z0h,List.append_assoc] + rw [heq] at hStep + exact zS0 hStep hIH + | @pair0 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,K] ++ u) at hE + rcases wordEffect_split_output [Q,K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2:=phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z3U hPos with ⟨hs0,hN0⟩ + have hD10 : DigitVal 1 2 [Q,K]:=DigitVal.one (DigitVal.zero DigitVal.nil) + have hStep:=zSg (zEd hL hD10) (z43 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @pair1 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,Q] ++ u) at hE + rcases wordEffect_split_output [Q,Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z3U (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD11 : DigitVal 3 2 [Q,Q]:=DigitVal.one (DigitVal.one DigitVal.nil) + have hStep:=zSg (zEd hL hD11) (z44 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short00 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2:=phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z3U hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K]:=DigitVal.zero DigitVal.nil + have hStep:=zSg (zEd hL hD0) (z45 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short01 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z3U (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q]:=DigitVal.one DigitVal.nil + have hStep:=zSg (zEd hL hD1) (z46 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short10 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2:=phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z3U hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K]:=DigitVal.zero DigitVal.nil + have hStep:=zSg (zEd hL hD0) (z47 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short11 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z3U (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q]:=DigitVal.one DigitVal.nil + have hStep:=zSg (zEd hL hD1) (z48 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') +theorem z4a {n : Nat} {r r' : HalfTape} + (hI : z3W (n * 2) r r') : z3W (1 + n) (d1 +> (d0 +> r)) (t +> r'):= by + intro w hs hN + generalize hk : 1 + n=k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil,<- append_assoc d1 d0 r] + cases m with + | zero => + have hn0 : n * 2=0:= by omega + rw [hn0] at hI + have hr':=z3X hI + subst hr' + rw [<- append_assoc t one r] + exact zSc z0r (Side.nil r) + | succ m => + have h1m : m + 1=1 + m:= by omega + rw [h1m] + refine zSc (z0F m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)):= by + have hm : n * 2=2 + (1 + m * 2) * 2:= by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil,<- append_assoc d1 d0 r] + refine zSc (z0G m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (m * 2)):= by + have hm : n * 2=2 + (m * 2) * 2:= by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 +theorem z4b {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : ℚ} + (hI : PhaseScan k v k' w a b) {u : WordList} {r' : HalfTape} + (hE : WordEffect 0 u 1 v) (hK : 0 < k') (hC : z3W k' (d1 +> default) r') : + z3W k (evalWords u default) (evalWords w r'):= by + intro w0 hs hN + have hPosK : 0 < k:=phaseScan_pos_of_out_pos hI hK + have hw0 : w0=[]:= by cases hN <;> first | rfl | omega + subst hw0 + rcases z3U hK with ⟨hs',hN'⟩ + have hSeg:=z49 hI hE hN hN' + dsimp at hSeg + have hSide:=zSc hSeg (z0j z0O (hC [] hs' hN')) + rwa [wordsToBits_append_tape,wordsToBits_append_tape] at hSide +theorem z4c {orig out : WordList} (hS : Step orig out) : + ∃ r,z3W 12 (evalWords orig default) r /\ evalWords out default=t +> r:= by + cases hS with + | intro eff k v a b J A da hE hI hDA hSum => + have hposJ:=pow_two_pos J + have hPosK : 0 < k:= by omega + have hDFull : DigitVal k (J + 1) (da ++ [Q]):= by + have h:=digitVal_append hDA (DigitVal.one DigitVal.nil) + have heq : A + 1 * 2 ^ J=k:= by omega + rwa [heq] at h + have hC0 : z3W ((k - 1) * 2) default (evalWords (da ++ [Q]) default) := + z41 hDFull hPosK + have hC1 : z3W k (d1 +> default) (evalWords (V :: (da ++ [Q])) default):= by + have h:=z4a hC0 + have hk : 1 + (k - 1)=k:= by omega + rwa [hk,zDd] at h + have hRun:=z4b hI hE hPosK hC1 + rw [<- evalWords_append] at hRun + exact ⟨evalWords (v ++ V :: (da ++ [Q])) default,hRun,rfl⟩ +theorem z4d {r r' : HalfTape} (hI : z3W 12 r r') : + (zCf r) [target_tm]⊢⁺ zCf (t +> r'):= by + have h_num : Num 12 [] ([.cj] ++ [.ch] ^ 5):=Num.even 5 + have hC:=hI [] ([.cj] ++ [.ch] ^ 5) h_num + have hS:=zSc z0R hC + rcases hS with _ | ⟨hca,hrest⟩ + rcases hrest with _ | ⟨hch,hnil⟩ + cases hnil + have h1:=zPt (z0S (w_pre +> r)) (hca ([1] +> default)) + have h2:=zPt (z0T _) (hch lh) + have h3:=zPt h1 h2 + rwa [append_assoc] at h3 +theorem z4e {orig out : WordList} (hS : Step orig out) : + (zCf (evalWords orig default)) [target_tm]⊢⁺ zCf (evalWords out default):= by + rcases z4c hS with ⟨r,hC,hEq⟩ + rw [hEq] + exact z4d hC +theorem z4f {u v : WordList} (hR : Rounds u v) : + (zCf (evalWords u default)) [target_tm]⊢* zCf (evalWords v default):= by + induction hR with + | refl u => exact ⟨0,rfl⟩ + | next hS _ ih => + rcases z4e hS with ⟨n1,_,hn1⟩ + rcases ih with ⟨n2,hn2⟩ + exact ⟨n1 + n2,zMt target_tm _ _ _ n1 n2 hn1 hn2⟩ +def z4g : CCfg:=⟨0,0,[],[]⟩ +def z4h : CCfg:=⟨2,1,[1,0,1,0,1,0,1,1,1,0,1,0,1,1,0,1,0,1],[1,1,0,0,1,0,1,0,1,1,0,0,0,0,0,0,0,1,1]⟩ +def z4i : CCfg:=⟨5,0,[0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,1,0,1,0,1],[1,0,0,0,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,1]⟩ +def z4j : CCfg:=⟨2,1,[1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1],[0,0,0,1,0,1]⟩ +def z4k : CCfg:=⟨5,0,[0,1,0,1,0,1,1,1,1,0,1,1,1,0,1,0,1,0,1],[0,1,1,0,0,1,1,0,0,1,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,1,0,1,0,1,0,0,0,1]⟩ +def z4l : CCfg:=⟨3,1,[1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,0,1,0,1],[1,0,0,0,0,1,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1]⟩ +def z4m : CCfg:=⟨2,1,[0,1],[0,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,1,0,1,0,1,0,1,0,0,0,1]⟩ +set_option maxRecDepth 4000000 in +theorem z4n : zCm z4g 1000=some z4h:= by decide +kernel +set_option maxRecDepth 4000000 in +theorem z4o : zCm z4h 1000=some z4i:= by decide +kernel +set_option maxRecDepth 4000000 in +theorem z4p : zCm z4i 1000=some z4j:= by decide +kernel +set_option maxRecDepth 4000000 in +theorem z4q : zCm z4j 1000=some z4k:= by decide +kernel +set_option maxRecDepth 4000000 in +theorem z4r : zCm z4k 1000=some z4l:= by decide +kernel +set_option maxRecDepth 4000000 in +theorem z4s : zCm z4l 949=some z4m:= by decide +kernel +theorem z4t : + (init []) [target_tm]⊢* zCf (evalWords z3L default):= by + have h0 : (init [] : Cfg (Fin 2) (Fin 6))=z04 z4g:=rfl + have h2 : z04 z4m=zCf (evalWords z3L default):= by + unfold z04 z4m zCf zCL lh w_pre z3L + simp only [List.replicate,List.cons_append,List.nil_append,evalWords,wordsToBits,t,d1,d0,one,append_cons,append_nil,z00] + rfl + have hPlus : (z04 z4g) [target_tm]⊢⁺ (z04 z4m) := + zPt (zTc (by decide) z4n) + (zPt (zTc (by decide) z4o) + (zPt (zTc (by decide) z4p) + (zPt (zTc (by decide) z4q) + (zPt (zTc (by decide) z4r) + (zTc (by decide) z4s))))) + rw [<- h0,h2] at hPlus + rcases hPlus with ⟨n,_,hn⟩ + exact ⟨n,hn⟩ +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d)=some c') : + (multiStep target_tm c j).isSome:= by + rw [zMa] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +theorem z4u (m : Nat) : + ∃ N ≥ m,∃ p q w, + multiStep target_tm (init []) N=some (zCf (evalWords w default)) /\ + AggState z3p p q w:= by + induction m with + | zero => + rcases z3T with ⟨v0,hRounds,hGood0⟩ + rcases z4t with ⟨k1,hk1⟩ + rcases z4f hRounds with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,16,19,v0, + zMt target_tm _ _ _ k1 k2 hk1 hk2,hGood0⟩ + | succ m ih => + rcases ih with ⟨N,hN,p,q,w,h_ms,h_good⟩ + rcases aggState_step_of_copyTwelve z3p z3q z3y z3x p q w h_good + with ⟨w',hStep,h_good'⟩ + rcases z4e hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,1 + p,1 + q,w', + zMt target_tm _ _ _ N k h_ms h_step_k,h_good'⟩ + +end Solution +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + + + +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases z4u (n + 1) with ⟨N,hN,_,_,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1))=N:=Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some:=zIm h_N + rw [zMs,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_0RFHHH_1RA1RF diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_1RFHHH_1RA1RE.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_1RFHHH_1RA1RE.lean new file mode 100644 index 00000000..f8de5442 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_1RFHHH_1RA1RE.lean @@ -0,0 +1,1701 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_1RFHHH_1RA1RE + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1LC1RA_1LD0LC_0LE0LA_1RFHHH_1RA1RE" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 8000000 +@[simp] theorem zMz (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : HalfTape).head = 0 := rfl +@[simp] theorem zDt : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem zPs {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem zPt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,by omega,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) +abbrev t : BitWord := [1,1,0,0] +abbrev d0 : BitWord := [0,0] +abbrev d1 : BitWord := [1,0] +abbrev one : BitWord := [1] +abbrev lh : HalfTape := (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default +@[simp] theorem zDd : d0 +> (default : HalfTape) = default := by + simp [d0] +inductive Call where + | ch + | cj + | cp + | ca +def zCs : Call -> Fin 6 + | .ch => B + | .cj => A + | .cp => A + | .ca => A +def zCw : Call -> BitWord + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] + | .ca => [1,1,1,0,1,0] +def zCR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + ((l <+ zCw c) {{zCs c}}> r) +def zCL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (l <{{C}} ([0] +> r)) +def zCf (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + zCL lh r +def z04 (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l,(zCR l c r1) [target_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + z04 c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem z05 {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z06 {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem z07 {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z08 {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z09 {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0a (w : BitWord) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem zSc {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases z09 h with ⟨r2,ha,hb⟩ + exact z08 (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS4 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc1 (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [target_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem z0b : Seg [.cp] [.cj] t t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0c : Seg [.cj] [.cj,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0d : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0e : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0f : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1 d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0g : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0h : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0i : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0j : Seg [.cj] [.cp] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons,append_nil]; execute) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0k : Seg [.ca] [.cj] [] t := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + have h1 : zCR l .ca ([] +> r1) = zCR ([1,0,1,0] +> l) .cj r1 := by + unfold zCR zCw zCs; simp only [append_cons,append_nil] + have h2 : (zCL ([1,0,1,0] +> l) r2) [target_tm]⊢⁺ (zCL l (t +> r2)) := by + unfold zCL t; simp only [append_cons,append_nil]; execute + rw [h1] + exact zPt (hc1 ([1,0,1,0] +> l)) h2 +theorem zS3 (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact z0a t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [zLp,h_eq,z07] + exact zSg z0d ih +theorem zSa {w2 : BitWord} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact z0a w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq,z07,zLp] + exact zSg hw ih +theorem z0l : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0m : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem z0n (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) t t := + zSg z0b (zS3 n) +theorem z0o (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using zSg z0c (zS3 n) +theorem z0p (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0e zH2) (zS3 n) +theorem z0q (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0f (zS3 n) +theorem z0r (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0g (zS3 n) +theorem z0s (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [zLp',List.cons_append,List.nil_append] using zSg z0h (zS3 n) +theorem z0t (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0i (zSg zH1 zH3) + have h1 := zSg h0 (zSa z0l n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0u (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0j (zSa z0l n) +theorem z0v : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0i zH1 +theorem z0w (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0i (zSg zH1 (zSg zH3 zH0)) + have h1 := zSg h0 (zSa z0m n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0x (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg [.cj,.ch] [.cp] d1 d1 := zSg z0j zH0 + have h1 := zSg h0 (zSa z0m n) + simpa only [zLp',List.cons_append,List.nil_append] using h1 +theorem z0y : Seg [.ca] [.cj] [] t := + z0k +theorem z0z (r : HalfTape) : + (zCf r) [target_tm]⊢⁺ (zCR ([1,1] +> default) .ca r) := by + unfold zCf zCL zCR lh zCw zCs + simp only [append_cons,append_nil] + execute +theorem z0A (r : HalfTape) : + (zCL ([1,1] +> default) r) [target_tm]⊢⁺ (zCR lh .cj r) := by + unfold zCL zCR lh zCw zCs + simp only [append_cons,append_nil] + execute +def z0B : Cfg (Fin 2) (Fin 6) := + (([1,1,1,0,1,0,1,0,1,1,1,0,1] +> default) {{C}}> ([1,1] +> default)) +def z0C : Cfg (Fin 2) (Fin 6) := + (([] +> default) {{D}}> ([0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,0,0,1] +> default)) +def z0D : Cfg (Fin 2) (Fin 6) := + (([0,1,1,1,0,1,0,1,0,1,0,1,1] +> default) {{C}}> ([1,0,0,0,0,0,1,1] +> default)) +def z0E : Cfg (Fin 2) (Fin 6) := + (([1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1] +> default) {{A}}> ([1,0,0,0,1,1] +> default)) +def z0F : Cfg (Fin 2) (Fin 6) := + (([1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1] +> default) {{A}}> ([0,1,0,1] +> default)) +def z0G : Cfg (Fin 2) (Fin 6) := + (([1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1] +> default) {{C}}> ([1,1,1,0,0,1,0,1,0,1] +> default)) +def z0H : Cfg (Fin 2) (Fin 6) := + (([1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1] +> default) {{A}}> ([0,0,1,0,0,1,0,0,0,0,0,1] +> default)) +def z0I : Cfg (Fin 2) (Fin 6) := + (([1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1] +> default) {{A}}> ([0,1,0,0,0,1] +> default)) +def z0J : Cfg (Fin 2) (Fin 6) := + (([1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1] +> default) {{C}}> ([0,0,0,1,1,0,0,1,0,1,0,1,0,1] +> default)) +def z0K : Cfg (Fin 2) (Fin 6) := + (([1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1] +> default) {{C}}> ([0,0,0,0,0,0,0,0,0,0,0,1] +> default)) +def z0L : Cfg (Fin 2) (Fin 6) := + (([1,0,1,0,1,1,1,0,1,0,1,0,1] +> default) {{A}}> ([1,0,0,1,1,0,0,1,1,0,0,1,0,1,0,0,0,0,0,1] +> default)) +def z0M : Cfg (Fin 2) (Fin 6) := + (([1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1] +> default) {{A}}> ([1,0,0,0,0,1,0,1,0,0,0,1] +> default)) +def z0N : Cfg (Fin 2) (Fin 6) := + (([1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1] +> default) {{A}}> ([1,0,1,0,0,0,0,0,0,0,0,1,0,1] +> default)) +def z0O : Cfg (Fin 2) (Fin 6) := + (([1,0,1,0,1,0,1,0,1,0,1,0,1,0,1] +> default) {{A}}> ([0,1,1,0,0,1,1,0,0,1,0,1,0,0,0,1,0,1] +> default)) +def z0P : Cfg (Fin 2) (Fin 6) := + (([1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1] +> default) {{A}}> ([0,0,0,1,0,1,0,1,0,1] +> default)) +theorem z0Q : (init []) [target_tm]⊢⁺ z0B := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init]; unfold z0B; simp only [append_cons,append_nil]; execute +theorem z0R : z0B [target_tm]⊢⁺ z0C := by + unfold z0B z0C; simp only [append_cons,append_nil]; execute +theorem z0S : z0C [target_tm]⊢⁺ z0D := by + unfold z0C z0D; simp only [append_cons,append_nil]; execute +theorem z0T : z0D [target_tm]⊢⁺ z0E := by + unfold z0D z0E; simp only [append_cons,append_nil]; execute +theorem pre_z0U : z0E [target_tm]⊢⁺ z0F := by + unfold z0E z0F; simp only [append_cons,append_nil]; execute +theorem pre_z0V : z0F [target_tm]⊢⁺ z0G := by + unfold z0F z0G; simp only [append_cons,append_nil]; execute +theorem pre_z0W : z0G [target_tm]⊢⁺ z0H := by + unfold z0G z0H; simp only [append_cons,append_nil]; execute +theorem pre_z0X : z0H [target_tm]⊢⁺ z0I := by + unfold z0H z0I; simp only [append_cons,append_nil]; execute +theorem pre_z0Y : z0I [target_tm]⊢⁺ z0J := by + unfold z0I z0J; simp only [append_cons,append_nil]; execute +theorem pre_z0Z : z0J [target_tm]⊢⁺ z0K := by + unfold z0J z0K; simp only [append_cons,append_nil]; execute +theorem pre_z10 : z0K [target_tm]⊢⁺ z0L := by + unfold z0K z0L; simp only [append_cons,append_nil]; execute +theorem pre_z11 : z0L [target_tm]⊢⁺ z0M := by + unfold z0L z0M; simp only [append_cons,append_nil]; execute +theorem pre_z12 : z0M [target_tm]⊢⁺ z0N := by + unfold z0M z0N; simp only [append_cons,append_nil]; execute +theorem pre_z13 : z0N [target_tm]⊢⁺ z0O := by + unfold z0N z0O; simp only [append_cons,append_nil]; execute +theorem pre_z14 : z0O [target_tm]⊢⁺ z0P := by + unfold z0O z0P; simp only [append_cons,append_nil]; execute +theorem pre_z15 : z0P [target_tm]⊢⁺ + zCf (([1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,0,1,0,1,0,1,0] : BitWord) +> default) := by + unfold z0P zCf zCL lh + simp only [append_cons,append_nil,z00] + execute +theorem pre_z16 : + (init []) [target_tm]⊢⁺ + zCf (([1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,0,1,0,1,0,1,0] : BitWord) +> default) := + zPt z0Q + (zPt z0R + (zPt z0S + (zPt z0T + (zPt pre_z0U + (zPt pre_z0V + (zPt pre_z0W + (zPt pre_z0X + (zPt pre_z0Y + (zPt pre_z0Z + (zPt pre_z10 + (zPt pre_z11 + (zPt pre_z12 + (zPt pre_z13 + (zPt pre_z14 pre_z15)))))))))))))) +inductive RIncs : Nat -> HalfTape -> HalfTape -> Prop where + | zero (r : HalfTape) : RIncs 0 r (one +> r) + | T {n : Nat} {r r' : HalfTape} : + RIncs ((1 + n) * 2) r r' -> RIncs (1 + n) (t +> r) (t +> r') + | pair0 {n : Nat} {r r' : HalfTape} : + RIncs (n * 2) r r' -> RIncs (1 + n) (d1 +> (d0 +> r)) (t +> r') + | pair1 {n : Nat} {r r' : HalfTape} : + RIncs (1 + n * 2) r r' -> RIncs (1 + n) (d1 +> (d1 +> r)) (t +> r') + | short00 {n : Nat} {r r' : HalfTape} : + RIncs (n * 2) r r' -> RIncs (2 + n * 4) (d0 +> r) (d0 +> r') + | short01 {n : Nat} {r r' : HalfTape} : + RIncs (1 + n * 2) r r' -> RIncs (2 + n * 4) (d1 +> r) (d0 +> r') + | short10 {n : Nat} {r r' : HalfTape} : + RIncs (n * 2) r r' -> RIncs (4 + n * 4) (d0 +> r) (d1 +> r') + | short11 {n : Nat} {r r' : HalfTape} : + RIncs (1 + n * 2) r r' -> RIncs (4 + n * 4) (d1 +> r) (d1 +> r') +inductive Binary : Nat -> Nat -> HalfTape -> Prop where + | one : Binary 1 1 (d1 +> default) + | zero {n H : Nat} {r : HalfTape} : + Binary (1 + n) H r -> Binary (2 + n * 2) (1 + H) (d0 +> r) + | two {n H : Nat} {r : HalfTape} : + Binary (1 + n) H r -> Binary (3 + n * 2) (1 + H) (d1 +> r) + +open WordCalculus Word +local notation "WordList" => List Word + +theorem loc_z17 (n : Nat) : 0 < 8 ^ n := by + induction n with + | zero => decide + | succ n ih => rw [Nat.pow_succ]; omega + +theorem loc_z19 {A H : Nat} {r : HalfTape} (h : Binary A H r) : + 0 < A /\ 0 < H /\ 2 ^ H <= A * 2 /\ A < 2 ^ H := by + induction h with + | one => decide + | @zero n H r _ ih => + rw [pow_two_one_add H]; omega + | @two n H r _ ih => + rw [pow_two_one_add H]; omega + +theorem loc_z1a (n : Nat) : ∃ H r,Binary (1 + n) H r := by + induction n using Nat.strong_induction_on with + | h n ih => + cases n with + | zero => exact ⟨1,d1 +> default,Binary.one⟩ + | succ m => + rcases even_or_odd_mul_two m with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · rcases ih a (by omega) with ⟨H0,r,hI⟩ + refine ⟨1 + H0,d0 +> r,?_⟩ + have heq : 1 + (a * 2 + 1) = 2 + a * 2 := by omega + rw [heq]; exact Binary.zero hI + · rcases ih a (by omega) with ⟨H0,r,hI⟩ + refine ⟨1 + H0,d1 +> r,?_⟩ + have heq : 1 + ((1 + a * 2) + 1) = 3 + a * 2 := by omega + rw [heq]; exact Binary.two hI + +theorem loc_z1b {A H : Nat} {r : HalfTape} (h : Binary A H r) : + RIncs ((A - 1) * 2) default r := by + induction h with + | one => + have h0 := RIncs.zero (default : HalfTape) + have hd : d1 +> (default : HalfTape) = one +> default := by simp [d1,one] + rw [hd]; exact h0 + | @zero n H r _ ih => + have ih' : RIncs (n * 2) default r := by + have heq : ((1 + n) - 1) * 2 = n * 2 := by omega + rwa [heq] at ih + have hs := RIncs.short00 ih' + rw [zDd] at hs + have heq : ((2 + n * 2) - 1) * 2 = 2 + n * 4 := by omega + rwa [heq] + | @two n H r _ ih => + have ih' : RIncs (n * 2) default r := by + have heq : ((1 + n) - 1) * 2 = n * 2 := by omega + rwa [heq] at ih + have hs := RIncs.short10 ih' + rw [zDd] at hs + have heq : ((3 + n * 2) - 1) * 2 = 4 + n * 4 := by omega + rwa [heq] + +theorem loc_z1n {A H : Nat} {u : WordList} (h1 : DigitVal A H u) : + ∀ {B J : Nat} {r : HalfTape},Binary B J r -> Binary (A + B * 2 ^ H) (H + J) (evalWords u r) := by + induction h1 with + | nil => + intro B J r h2 + simpa [evalWords] using h2 + | @zero A H u _ ih => + intro B J r h2 + have hI := ih h2 + have hB := loc_z19 hI + have hI' : Binary (1 + (A + B * 2 ^ H - 1)) (H + J) (evalWords u r) := by + have heq : 1 + (A + B * 2 ^ H - 1) = A + B * 2 ^ H := by omega + rwa [heq] + have h3 := Binary.zero hI' + have heq1 : 2 + (A + B * 2 ^ H - 1) * 2 = A * 2 + B * 2 ^ (1 + H) := by + rw [pow_two_one_add H,Nat.mul_add]; omega + have heq2 : 1 + (H + J) = (1 + H) + J := by omega + simpa [evalWords,heq1,heq2] using h3 + | @one A H u _ ih => + intro B J r h2 + have hI := ih h2 + have hB := loc_z19 hI + have hI' : Binary (1 + (A + B * 2 ^ H - 1)) (H + J) (evalWords u r) := by + have heq : 1 + (A + B * 2 ^ H - 1) = A + B * 2 ^ H := by omega + rwa [heq] + have h3 := Binary.two hI' + have heq1 : 3 + (A + B * 2 ^ H - 1) * 2 = (1 + A * 2) + B * 2 ^ (1 + H) := by + rw [pow_two_one_add H,Nat.mul_add]; omega + have heq2 : 1 + (H + J) = (1 + H) + J := by omega + simpa [evalWords,heq1,heq2] using h3 + +def loc_z1p (ds : WordList) : Prop := ∃ w,ds = Q :: (List.replicate 1 K ++ w) + +def loc_z1q (ds : WordList) : Prop := ∃ w,ds = w ++ List.replicate 5 Q + +theorem loc_z1r (n : Nat) : DigitVal 0 n (List.replicate n K) := by + induction n with + | zero => exact DigitVal.nil + | succ n ih => + have h0 := DigitVal.zero ih + have heq : 1 + n = n + 1 := by omega + simpa [List.replicate,heq] using h0 + +theorem loc_z1s (n : Nat) : + Binary (2 ^ (n + 1) - 1) (n + 1) (evalWords (List.replicate (n + 1) Q) default) := by + rw [replicate_succ_append,evalWords_append] + dsimp [evalWords] + have hpos := pow_two_pos n + have hB := loc_z1n (digitVal_replicate_Q n) Binary.one + have heq : (2 ^ n - 1) + 1 * 2 ^ n = 2 ^ (n + 1) - 1 := by + rw [Nat.pow_succ]; omega + rwa [heq] at hB + +theorem loc_z1t (r k : Nat) (hL : 31 * 2 ^ r <= k) (hU : k < 32 * 2 ^ r) : + ∃ ds,DigitVal (1 + k * 4) (7 + r) ds /\ loc_z1p ds /\ loc_z1q ds /\ + Binary (1 + k * 4) (7 + r) (evalWords ds default) := by + let a := k - 31 * 2 ^ r + have hA : a + 31 * 2 ^ r = k := by omega + have ha_lt : a < 2 ^ r := by omega + rcases exists_digitVal_of_lt_pow r a ha_lt with ⟨v,hD⟩ + have hLow : DigitVal 1 2 (Q :: List.replicate 1 K) := by + have h1 := DigitVal.one (loc_z1r 1) + simpa using h1 + have hHigh : DigitVal k (r + 5) (v ++ List.replicate 5 Q) := by + have hApp := digitVal_append hD (digitVal_replicate_Q 5) + have heq : a + (2 ^ 5 - 1) * 2 ^ r = k := by + change a + 31 * 2 ^ r = k + exact hA + rwa [heq] at hApp + have hHighB : Binary k (r + 5) (evalWords (v ++ List.replicate 5 Q) default) := by + rw [evalWords_append] + have hB := loc_z1n hD (loc_z1s 4) + have heq : a + (2 ^ 5 - 1) * 2 ^ r = k := by + change a + 31 * 2 ^ r = k + exact hA + rwa [heq] at hB + refine ⟨(Q :: List.replicate 1 K) ++ (v ++ List.replicate 5 Q),?_,⟨v ++ List.replicate 5 Q,rfl⟩, + ⟨(Q :: List.replicate 1 K) ++ v,by rw [List.append_assoc]⟩,?_⟩ + · have hApp := digitVal_append hLow hHigh + have heq1 : 1 + k * 2 ^ 2 = 1 + k * 4 := by ring + have heq2 : 2 + (r + 5) = 7 + r := by omega + rwa [heq1,heq2] at hApp + · rw [evalWords_append] + have hB := loc_z1n hLow hHighB + have heq1 : 1 + k * 2 ^ 2 = 1 + k * 4 := by ring + have heq2 : 2 + (r + 5) = 7 + r := by omega + rwa [heq1,heq2] at hB + +theorem loc_z1u (n : Nat) : 2 ^ (3 * n) = 8 ^ n := by + induction n with + | zero => rfl + | succ n ih => + have heq : 3 * (n + 1) = 3 * n + 3 := by omega + rw [heq,Nat.pow_add,ih,Nat.pow_succ]; ring + +theorem loc_z1D {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) : + ∀ {r r' : HalfTape},RIncs b r r' -> RIncs a (evalWords u r) (evalWords v r') := by + induction h with + | nil _ => intro r r' hR; exact hR + | T _ ih => intro r r' hR; exact RIncs.T (ih hR) + | pair0 _ ih => intro r r' hR; exact RIncs.pair0 (ih hR) + | pair1 _ ih => intro r r' hR; exact RIncs.pair1 (ih hR) + | short00 _ ih => intro r r' hR; exact RIncs.short00 (ih hR) + | short01 _ ih => intro r r' hR; exact RIncs.short01 (ih hR) + | short10 _ ih => intro r r' hR; exact RIncs.short10 (ih hR) + | short11 _ ih => intro r r' hR; exact RIncs.short11 (ih hR) + +theorem loc_z1F {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) : + (a : Rat) = (b : Rat) * wordScale v + (wordMassQ v + l) * 2 := by + induction h with + | nil k => simp [wordMassQ,wordScale] + | T _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | pair0 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | pair1 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | short00 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | short01 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | short10 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + | short11 _ ih => dsimp [wordMassQ,wordScale]; push_cast at ih ⊢; linarith + +theorem loc_z1J {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) : wordScale v <= wordScale u := by + induction h with + | nil _ => simp [wordScale] + | T _ ih => dsimp [wordScale]; linarith + | @pair0 _ u _ _ _ _ _ => have hp := wordScale_pos u; dsimp [wordScale]; linarith + | @pair1 _ u _ _ _ _ _ => have hp := wordScale_pos u; dsimp [wordScale]; linarith + | short00 _ ih => dsimp [wordScale]; linarith + | short01 _ ih => dsimp [wordScale]; linarith + | short10 _ ih => dsimp [wordScale]; linarith + | short11 _ ih => dsimp [wordScale]; linarith + +theorem loc_z1K {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) (he : hasQKSubword u = true) : wordScale v * 8 <= wordScale u := by + induction h with + | nil _ => contradiction + | T _ ih => dsimp [hasQKSubword,wordScale] at he ⊢; have := ih he; linarith + | pair0 hS _ => have := loc_z1J hS; dsimp [wordScale]; linarith + | pair1 hS _ => have := loc_z1J hS; dsimp [wordScale]; linarith + | short00 _ ih => dsimp [hasQKSubword,wordScale] at he ⊢; have := ih he; linarith + | @short01 n u k v l hS ih => + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => dsimp [hasQKSubword,wordScale] at he ih ⊢; have := ih he; linarith + | K => exact False.elim (not_scan_odd_cons_K n u' k v l hS) + | Q => dsimp [hasQKSubword,wordScale] at he ih ⊢; have := ih he; linarith + | short10 _ ih => dsimp [hasQKSubword,wordScale] at he ⊢; have := ih he; linarith + | @short11 n u k v l hS ih => + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => dsimp [hasQKSubword,wordScale] at he ih ⊢; have := ih he; linarith + | K => exact False.elim (not_scan_odd_cons_K n u' k v l hS) + | Q => dsimp [hasQKSubword,wordScale] at he ih ⊢; have := ih he; linarith + +theorem loc_z1O {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) (he : hasQKSubword u = true) : 0 < l := by + induction h with + | nil _ => contradiction + | T _ ih => dsimp [hasQKSubword] at he; have := ih he; linarith + | pair0 hI _ => have := scan_mass_bounds hI; linarith + | pair1 hI _ => have := scan_mass_bounds hI; linarith + | short00 hI _ => have := scan_mass_bounds hI; linarith + | @short01 n u k v l hI ih => + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => dsimp [hasQKSubword] at he; have := ih he; linarith + | K => exact False.elim (not_scan_odd_cons_K n u' k v l hI) + | Q => dsimp [hasQKSubword] at he; have := ih he; linarith + | short10 hI _ => have := scan_mass_bounds hI; linarith + | @short11 n u k v l hI ih => + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => dsimp [hasQKSubword] at he; have := ih he; linarith + | K => exact False.elim (not_scan_odd_cons_K n u' k v l hI) + | Q => dsimp [hasQKSubword] at he; have := ih he; linarith + +theorem loc_z1Q (n : Nat) : + ∀ (a b : Nat) (v : WordList) (l : Rat), + Scan a (List.replicate n V) b v l -> + v = List.replicate n V /\ b = a * 2 ^ n /\ l = 0 := by + induction n with + | zero => + intro a b v l hI + cases hI + exact ⟨rfl,by simp,rfl⟩ + | succ n ih => + intro a b v l hI + cases hI with + | @T m _ _ v0 l0 hJ => + rcases ih ((1 + m) * 2) b v0 l0 hJ with ⟨rfl,rfl,rfl⟩ + refine ⟨rfl,?_,by ring⟩ + rw [Nat.pow_succ]; ring + +theorem loc_z1W {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (hI : Scan a (Q :: K :: u) b v l) : + ∃ n w s,a = 1 + n /\ Scan (n * 2) u b w s /\ v = V :: w /\ l = (1 + s) * (1 / 2) := by + cases hI with + | @pair0 n _ _ w s hJ => + exact ⟨n,w,s,rfl,hJ,rfl,rfl⟩ + | @short01 n _ _ _ _ hJ => + exact False.elim (not_scan_odd_cons_K n u b _ _ hJ) + | @short11 n _ _ _ _ hJ => + exact False.elim (not_scan_odd_cons_K n u b _ _ hJ) + +theorem loc_z1X {a : Nat} {ds : WordList} {b : Nat} {v : WordList} {l : Rat} + (hI : Scan a (ds ++ [K]) b v l) + (hw : ∃ w,ds = Q :: K :: w) + (hD : ∃ A H,DigitVal A H ds) + (hZ : 2 <= wordMassK ds) : + wordMass v <= wordMassK ds * (1 / 4) /\ wordMass v + l <= wordMassK ds * (3 / 4) := by + rcases hw with ⟨w,rfl⟩ + rcases hD with ⟨A,H,hD⟩ + cases hD with + | one hJ => + cases hJ with + | zero hK => + rcases loc_z1W hI with ⟨n,x,s,_,hJ',rfl,rfl⟩ + have hB := scan_tailDefect_bound hJ' (tailDefect_append_K_of_digitVal hK) + rcases hB with ⟨hM,hL,_⟩ + have hZw := (wordMass_nonneg w).2.1 + dsimp [wordMassK,wordMass] at hZ ⊢ + constructor <;> linarith + +theorem loc_z1Y {m : Nat} {u : WordList} {A H : Nat} {ds : WordList} + (hD : DigitVal A H ds) + (hS : wordScale u * ((2 ^ H : Nat) : Rat) = 1) + (hM : 1 <= m) + (hF : wordMass u + wordMassK u < 1 / 2) + (hW : ∃ w,ds = Q :: K :: w) : + ∃ b x l c y s, + Scan (m * 2) u b x l /\ Scan b (ds ++ [K]) c y s /\ 0 < c := by + rcases hW with ⟨w,rfl⟩ + have hm_q : (1 : Rat) <= (m : Rat) := by exact_mod_cast hM + have hEx1 : (wordMass u + wordMassK u) * 2 < ((m * 2 : Nat) : Rat) := by + push_cast; linarith + rcases exists_scan_of_mass_lt u m hEx1 with ⟨b,x,l,hI,hB_pos⟩ + have hBounds := scan_mass_bounds hI + have hSplit_x := wordMass_eq_add x + have hPos_x := wordMass_nonneg x + have hDelt : wordMassQ x + l < 1 / 2 := by linarith + have hBudget_eq := loc_z1F hI + have hBudget : 1 < (b : Rat) * wordScale x := by + push_cast at hBudget_eq; linarith + have hRest : (wordMass (w ++ [K]) + wordMassK (w ++ [K]) + 2) * wordScale x <= 1 := by + rw [<- (digitVal_scale_and_mass hD).1] at hS + cases hD with + | one hJ => + cases hJ with + | zero hK => + have hDw := digitVal_scale_and_mass hK + have hSc := loc_z1J hI + have hPos_w := wordMass_nonneg w + have hSplit_w := wordMass_eq_add w + have hSc_x := wordScale_pos x + have hSc_u := wordScale_pos u + have hSc_w := wordScale_pos w + dsimp [wordScale] at hS + rw [wordMass_append,wordMassK_append] + dsimp [wordMass,wordMassK] + nlinarith + cases b with + | zero => omega + | succ b => + have hSc_x := wordScale_pos x + have hEx2 : (wordMass (w ++ [K]) + wordMassK (w ++ [K])) * 2 < ((b * 2 : Nat) : Rat) := by + push_cast at hBudget ⊢ + nlinarith + rcases exists_scan_of_mass_lt (w ++ [K]) b hEx2 with ⟨c,y,s,hJ,hC_pos⟩ + refine ⟨1 + b,x,l,c,V :: y,(1 + s) * (1 / 2),?_,?_,hC_pos⟩ + · have heq : 1 + b = b + 1 := by omega + rwa [heq] + · exact Scan.pair0 hJ + +theorem loc_z20 (r a : Nat) (u : WordList) (b : Nat) (v : WordList) (l : Rat) + (hI : Scan a (u ++ List.replicate (1 + r * 2) Q ++ [K]) b v l) : + ∃ w k,v = w ++ List.replicate (1 + r) V /\ b = k * 2 ^ (1 + r) := by + rcases split_trailing_Q u with ⟨p,n,rfl,hP⟩ + have hE : (p ++ List.replicate n Q) ++ List.replicate (1 + r * 2) Q ++ [K] = + p ++ (List.replicate (1 + r * 2 + n) Q ++ [K]) := by + have heq : 1 + r * 2 + n = n + (1 + r * 2) := by omega + rw [heq,List.replicate_add n (1 + r * 2)] + simp only [List.append_assoc] + rw [hE] at hI + rcases scan_split_of_splitCond hI p (List.replicate (1 + r * 2 + n) Q ++ [K]) rfl (Or.inl hP) with ⟨c,x,y,s,t0,_,hK,rfl,_⟩ + rcases scan_add_Q_K_inv n r c b y t0 hK with ⟨w,k,rfl,rfl⟩ + exact ⟨x ++ w,k,by rw [List.append_assoc],rfl⟩ + +theorem loc_z21 {ds : WordList} (h : loc_z1p ds) : ∃ w,ds = Q :: K :: w := by + rcases h with ⟨w,rfl⟩ + exact ⟨w,rfl⟩ + +theorem loc_z22 {ds : WordList} (h : loc_z1p ds) : 2 <= wordMassK ds := by + rcases h with ⟨w,rfl⟩ + have hw := (wordMass_nonneg w).2.1 + dsimp [List.replicate,wordMassK] + linarith + +theorem loc_z23 {m : Nat} {u : WordList} {A H : Nat} {ds : WordList} + (hD : DigitVal A H ds) + (hS : wordScale u * ((2 ^ H : Nat) : Rat) = 1) + (hM : 1 <= m) + (hF : (5 / 2) * wordMass u + wordMassK u + wordScale u * wordMassK ds <= 1 / 32) + (hLo : loc_z1p ds) + (hHi : loc_z1q ds) : + ∃ k v l g, + Scan (m * 2) (u ++ ds ++ [K]) (k * 8) v l /\ + (∃ w,v = w ++ List.replicate 3 V) /\ + wordScale v * ((8 ^ g : Nat) : Rat) = 2 /\ + wordMass v <= wordMass u + (1 / 4) * (wordScale u * wordMassK ds) /\ + wordMass v + l <= wordMass u + wordMassK u + (3 / 4) * (wordScale u * wordMassK ds) /\ + 0 < wordMassQ v + l /\ wordMassQ v + l <= 1 / 32 := by + rcases hHi with ⟨w,hHi_eq⟩ + have hU := wordMass_nonneg u + have hDs := wordMass_nonneg ds + have hSu := wordScale_pos u + have hSmall : wordMass u + wordMassK u < 1 / 2 := by nlinarith + rcases loc_z1Y hD hS hM hSmall (loc_z21 hLo) with ⟨b,x,s,c,y,t0,hI1,hI2,_⟩ + rcases scan_append hI1 hI2 with ⟨l,hI,rfl⟩ + have hI_assoc : Scan (m * 2) (u ++ ds ++ [K]) c (x ++ y) (s + wordScale x * t0) := by + simpa [List.append_assoc] using hI + have hEnd : ∃ p k,x ++ y = p ++ List.replicate 3 V /\ c = k * 8 := by + have hI_hi : Scan (m * 2) ((u ++ w) ++ List.replicate (1 + 2 * 2) Q ++ [K]) c (x ++ y) (s + wordScale x * t0) := by + have heq_list : u ++ ds ++ [K] = (u ++ w) ++ List.replicate (1 + 2 * 2) Q ++ [K] := by + rw [hHi_eq]; simp [List.append_assoc] + rwa [<- heq_list] + rcases loc_z20 2 (m * 2) (u ++ w) c (x ++ y) (s + wordScale x * t0) hI_hi with ⟨p,k,hE,hC⟩ + exact ⟨p,k,hE,hC⟩ + rcases hEnd with ⟨p,k,hE,rfl⟩ + rcases scan_scale_pow_eight hI_assoc with ⟨g,hG⟩ + refine ⟨k,x ++ y,s + wordScale x * t0,g,hI_assoc,⟨p,hE⟩,?_,?_,?_,?_⟩ + · rw [wordScale_append,wordScale_append] at hG + dsimp [wordScale] at hG + rw [(digitVal_scale_and_mass hD).1] at hG + nlinarith + · have hB1 := scan_mass_bounds hI1 + have hS1 := loc_z1J hI1 + have hB2 := loc_z1X hI2 (loc_z21 hLo) ⟨A,H,hD⟩ (loc_z22 hLo) + have hSx := wordScale_pos x + rw [wordMass_append]; nlinarith + · have hB1 := scan_mass_bounds hI1 + have hS1 := loc_z1J hI1 + have hB2 := loc_z1X hI2 (loc_z21 hLo) ⟨A,H,hD⟩ (loc_z22 hLo) + have hSx := wordScale_pos x + rw [wordMass_append]; nlinarith + · have hW : hasQKSubword (u ++ ds ++ [K]) = true := by + rw [List.append_assoc] + apply hasQKSubword_append_right + rcases loc_z21 hLo with ⟨z,rfl⟩ + rfl + have hLoss := loc_z1O hI_assoc hW + have hB1 := scan_mass_bounds hI1 + have hS1 := loc_z1J hI1 + have hB2 := loc_z1X hI2 (loc_z21 hLo) ⟨A,H,hD⟩ (loc_z22 hLo) + have hSx := wordScale_pos x + have hMv : wordMass (x ++ y) + (s + wordScale x * t0) <= wordMass u + wordMassK u + (3 / 4) * (wordScale u * wordMassK ds) := by + rw [wordMass_append]; nlinarith + have hSuz : 0 <= wordScale u * wordMassK ds := by nlinarith + have hPos_xy := wordMass_nonneg (x ++ y) + have hSplit_xy := wordMass_eq_add (x ++ y) + constructor <;> linarith + +theorem loc_z24 {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} {H : Nat} {r : HalfTape} + (hI : Scan a u (b * 2) v l) (hB : Binary (1 + b) H r) : + RIncs a (evalWords u default) (evalWords v r) := by + apply loc_z1D hI + have hR := loc_z1b hB + have heq : ((1 + b) - 1) * 2 = b * 2 := by omega + rwa [heq] at hR + +theorem loc_z25 (m g k : Nat) (s delta : Rat) + (hM : m = 1 \/ m = 2) + (hS : s * ((8 ^ g : Nat) : Rat) = 2) + (hB : ((m * 2 : Nat) : Rat) = ((k * 8 : Nat) : Rat) * s + delta * 2) + (hPos : 0 < delta) + (hSmall : delta <= 1 / 32) : + ∃ n,g = 3 + n /\ 31 * 2 ^ (m + 3 * n) <= k /\ k < 32 * 2 ^ (m + 3 * n) := by + have hMq : (1 : Rat) <= (m : Rat) /\ (m : Rat) <= 2 := by + rcases hM with rfl | rfl <;> norm_num + have hPow : (0 : Rat) < ((8 ^ g : Nat) : Rat) := by exact_mod_cast loc_z17 g + have hEq : ((k * 8 : Nat) : Rat) = ((m : Rat) - delta) * ((8 ^ g : Nat) : Rat) := by + push_cast at hB ⊢ + have hE : (k : Rat) * 8 * s = ((m : Rat) - delta) * 2 := by linarith + have hE' : (k : Rat) * 8 * (s * ((8 ^ g : Nat) : Rat)) = ((m : Rat) - delta) * 2 * ((8 ^ g : Nat) : Rat) := by + calc (k : Rat) * 8 * (s * ((8 ^ g : Nat) : Rat)) + _ = ((k : Rat) * 8 * s) * ((8 ^ g : Nat) : Rat) := by ring + _ = ((m : Rat) - delta) * 2 * ((8 ^ g : Nat) : Rat) := by rw [hE] + rw [hS] at hE' + push_cast at hE' + linarith + have hK : 0 < k := by + by_contra hk0 + have hk_eq : k = 0 := by omega + subst hk_eq + push_cast at hPow hEq + nlinarith + have hR_q : ((k * 8 : Nat) : Rat) < ((m * 8 ^ g : Nat) : Rat) := by + push_cast at hPow hEq ⊢ + nlinarith + have hR : k * 8 < m * 8 ^ g := by exact_mod_cast hR_q + have hg1 : 1 <= g := by + by_contra hg_lt + have hg_eq : g = 0 := by omega + subst hg_eq + rcases hM with rfl | rfl <;> omega + let n1 := g - 1 + have hg_eq : g = 1 + n1 := by omega + rw [hg_eq] at hR hEq + have hpow_1n : 8 ^ (1 + n1) = 8 * 8 ^ n1 := by + rw [Nat.pow_add] + rw [hpow_1n] at hR hEq + have hRn : k + 1 <= m * 8 ^ n1 := by + rcases hM with rfl | rfl <;> omega + have hRn_q : ((k + 1 : Nat) : Rat) <= ((m * 8 ^ n1 : Nat) : Rat) := by exact_mod_cast hRn + have hPow_n1 : (0 : Rat) <= ((8 ^ n1 : Nat) : Rat) := by positivity + have hP : (32 : Rat) <= ((8 ^ n1 : Nat) : Rat) := by + rcases hM with rfl | rfl <;> (push_cast at hEq hRn_q ⊢; nlinarith) + have hP_nat : 32 <= 8 ^ n1 := by exact_mod_cast hP + have hN : 2 <= n1 := by + by_contra hn2 + have hn1 : n1 <= 1 := by omega + have hle1 : 8 ^ n1 <= 8 ^ 1 := Nat.pow_le_pow_right (by decide) hn1 + (try omega) + let j := n1 - 2 + have hNJ : n1 = 2 + j := by omega + refine ⟨j,by omega,?_,?_⟩ + · rw [hNJ,Nat.pow_add 8 2 j] at hEq + have hPow_j : (0 : Rat) < ((8 ^ j : Nat) : Rat) := by exact_mod_cast loc_z17 j + have h_le_q : ((31 * 2 ^ (m + 3 * j) : Nat) : Rat) <= (k : Rat) := by + rw [Nat.pow_add 2 m (3 * j),loc_z1u] + rcases hM with rfl | rfl <;> (push_cast at hPow_j hEq ⊢; nlinarith) + exact_mod_cast h_le_q + · rw [hNJ,Nat.pow_add 8 2 j] at hEq + have hPow_j : (0 : Rat) < ((8 ^ j : Nat) : Rat) := by exact_mod_cast loc_z17 j + have h_lt_q : (k : Rat) < ((32 * 2 ^ (m + 3 * j) : Nat) : Rat) := by + rw [Nat.pow_add 2 m (3 * j),loc_z1u] + rcases hM with rfl | rfl <;> (push_cast at hPow_j hEq ⊢; nlinarith) + exact_mod_cast h_lt_q + +theorem loc_z26 {m : Nat} {a : WordList} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + {H : Nat} {ds : WordList} {z : Rat} + (hI : Scan (m * 2) a (b * 2) v l) + (hD : DigitVal (1 + b) H ds) + (hS : wordScale v * wordScale ds = (m : Rat)) + (hM : wordMass v <= wordMass u + (1 / 4) * z) + (hB : wordMass v + l <= wordMass u + wordMassK u + (3 / 4) * z) + (hZ : 0 <= z) : + (5 / 2) * wordMass v + wordMassK (v ++ ds) <= + (7 / 5) * ((5 / 2) * wordMass u + wordMassK u + z) := by + have hE := loc_z1F hI + have hDt := digitVal_wordMassK_eq hD + have hDs := (digitVal_scale_and_mass hD).1 + have hSplit_v := wordMass_eq_add v + have hPos_u := wordMass_nonneg u + have hSv := wordScale_pos v + push_cast at hE hDt hDs + rw [wordMassK_append] + nlinarith + +theorem loc_z27 (m n : Nat) (s : Rat) + (hM : m = 1 \/ m = 2) + (hS : s * ((8 ^ (3 + n) : Nat) : Rat) = 2) : + s * ((2 ^ (7 + (m + 3 * n)) : Nat) : Rat) = (m : Rat) := by + have h8 : 8 ^ (3 + n) = 512 * 8 ^ n := by + rw [Nat.pow_add 8 3 n] + rw [h8] at hS + have h2 : 2 ^ (7 + (m + 3 * n)) = 128 * 2 ^ m * 8 ^ n := by + rw [Nat.pow_add 2 7 _,Nat.pow_add 2 m (3 * n),loc_z1u]; ring + rw [h2] + rcases hM with rfl | rfl <;> (push_cast at hS ⊢; linarith) + +inductive C24Good (bound : Rat) : HalfTape -> Prop where + | intro (u : WordList) (A H : Nat) (ds : WordList) : + DigitVal A H ds -> + wordScale u * ((2 ^ H : Nat) : Rat) = 1 -> + (5 / 2) * wordMass u + wordMassK u + wordScale u * wordMassK ds <= bound -> + loc_z1p ds -> + loc_z1q ds -> + C24Good bound (evalWords (u ++ ds) default) + +theorem loc_z28 (m : Nat) (bound bound' : Rat) (r : HalfTape) + (hM : m = 1 \/ m = 2) + (hLimit : bound <= 1 / 32) + (hG : C24Good bound r) + (hRate : (7 / 5) * bound <= (m : Rat) * bound') : + ∃ r',RIncs (m * 2) r r' /\ C24Good bound' (evalWords (List.replicate (m - 1) V) r') := by + rcases hG with ⟨u,A,H,ds,hD,hS,hF,hLo,hHi⟩ + have hPos_m : 1 <= m := by rcases hM with rfl | rfl <;> omega + have hSmall : (5 / 2) * wordMass u + wordMassK u + wordScale u * wordMassK ds <= 1 / 32 := by linarith + rcases loc_z23 hD hS hPos_m hSmall hLo hHi with ⟨k,v,l,g,hI,hEnd,hScale,hMv,hBv,hPos,hUpper⟩ + have hBudget := loc_z1F hI + rcases loc_z25 m g k (wordScale v) (wordMassQ v + l) hM hScale hBudget hPos hUpper with ⟨n,rfl,hKl,hKu⟩ + rcases loc_z1t (m + 3 * n) k hKl hKu with ⟨ds',hD',hLo',hHi',hBin⟩ + have hScale' : wordScale v * wordScale ds' = (m : Rat) := by + rw [(digitVal_scale_and_mass hD').1] + exact loc_z27 m n (wordScale v) hM hScale + have hI' : Scan (m * 2) (u ++ ds ++ [K]) ((k * 4) * 2) v l := by + have heq : k * 8 = (k * 4) * 2 := by omega + rwa [<- heq] + have hR := loc_z24 hI' hBin + have hd0_side : evalWords [K] default = default := zDd + have hR' : RIncs (m * 2) (evalWords (u ++ ds) default) (evalWords (v ++ ds') default) := by + rw [evalWords_append (u ++ ds) [K],hd0_side,<- evalWords_append v ds'] at hR + exact hR + have hZ : 0 <= wordScale u * wordMassK ds := by + have hSu := wordScale_pos u + have hPos_ds := (wordMass_nonneg ds).2.1 + nlinarith + have hWeight := loc_z26 hI' hD' hScale' hMv hBv hZ + refine ⟨evalWords (v ++ ds') default,hR',?_⟩ + rw [<- evalWords_append,<- List.append_assoc] + refine C24Good.intro (List.replicate (m - 1) V ++ v) (1 + k * 4) (7 + (m + 3 * n)) ds' hD' ?_ ?_ hLo' hHi' + · rw [<- (digitVal_scale_and_mass hD').1,wordScale_append] + rcases hM with rfl | rfl <;> (dsimp [List.replicate,wordScale]; push_cast at hScale'; nlinarith) + · rw [wordMass_append,wordMassK_append,wordScale_append] + rw [wordMassK_append] at hWeight + rcases hM with rfl | rfl <;> (dsimp [List.replicate,wordMass,wordMassK,wordScale]; push_cast at hRate; nlinarith) + +theorem loc_z29 {r : HalfTape} (hG : C24Good (1 / 64) r) : + ∃ s r',RIncs 2 r s /\ RIncs 4 s r' /\ C24Good (1 / 64) (t +> r') := by + rcases loc_z28 1 (1 / 64) ((7 / 5) * (1 / 64)) r (Or.inl rfl) (by norm_num) hG (by norm_num) with ⟨s,hR,hH⟩ + dsimp [List.replicate,evalWords] at hH + rcases loc_z28 2 ((7 / 5) * (1 / 64)) (1 / 64) s (Or.inr rfl) (by norm_num) hH (by norm_num) with ⟨r',hS,hI⟩ + dsimp [List.replicate,evalWords] at hI + exact ⟨s,r',hR,hS,hI⟩ + +theorem ne_of_beq_eq_false {a b : Nat} (h : (a == b) = false) : a ≠ b := by + intro heq; subst heq; rw [beq_self_eq_true] at h; contradiction + +def loc_zPf : Nat -> Nat -> Option (WordList) + | 0,_ => none + | fuel + 1,k => + if k == 0 then none + else if k == 1 then some [Q] + else match loc_zPf fuel (k / 2) with + | none => none + | some ws => some ((if k % 2 == 0 then K else Q) :: ws) + +theorem loc_z2a (fuel : Nat) : + ∀ (k : Nat) (ws : WordList),loc_zPf fuel k = some ws -> + ∃ H,Binary k H (evalWords ws default) := by + induction fuel with + | zero => intro k ws h; contradiction + | succ fuel ih => + intro k ws h + dsimp [loc_zPf] at h + cases hk0 : (k == 0) with + | true => rw [hk0] at h; contradiction + | false => + rw [hk0] at h; dsimp at h + have hk0' : k ≠ 0 := ne_of_beq_eq_false hk0 + cases hk1 : (k == 1) with + | true => + rw [hk1] at h; dsimp at h + injection h with h; subst h + have rfl_k : k = 1 := beq_iff_eq.mp hk1 + subst rfl_k + exact ⟨1,Binary.one⟩ + | false => + rw [hk1] at h; dsimp at h + have hk1' : k ≠ 1 := ne_of_beq_eq_false hk1 + cases hrec : loc_zPf fuel (k / 2) with + | none => rw [hrec] at h; contradiction + | some ws' => + rw [hrec] at h; dsimp at h + injection h with h; subst h + rcases ih (k / 2) ws' hrec with ⟨H,hB⟩ + have hq : k / 2 = 1 + (k / 2 - 1) := by omega + rw [hq] at hB + rcases Nat.mod_two_eq_zero_or_one k with hmod | hmod + · have hcond : (k % 2 == 0) = true := beq_iff_eq.mpr hmod + rw [hcond]; dsimp [evalWords] + refine ⟨1 + H,?_⟩ + have heq : k = 2 + (k / 2 - 1) * 2 := by omega + rw [heq]; exact Binary.zero hB + · have hcond : (k % 2 == 0) = false := beq_false_of_ne (by omega) + rw [hcond]; dsimp [evalWords] + refine ⟨1 + H,?_⟩ + have heq : k = 3 + (k / 2 - 1) * 2 := by omega + rw [heq]; exact Binary.two hB + +def loc_z2h (e : Bool) : Word := if e then Q else K + +def loc_z2i (e : Bool) (k : Nat) : Option (Word × Nat) := + if k == 0 then none + else if k % 2 == 0 then + if k % 4 == 2 then + some (K,bitStepNat e (k / 4)) + else + some (Q,bitStepNat e (k / 4 - 1)) + else none + +theorem loc_z2j (e : Bool) (k : Nat) (d : Word) (k' : Nat) (r r' : HalfTape) + (hS : loc_z2i e k = some (d,k')) (hI : RIncs k' r r') : + RIncs k (evalWords [loc_z2h e] r) (evalWords [d] r') := by + dsimp [loc_z2i] at hS + cases hk0 : (k == 0) with + | true => rw [hk0] at hS; contradiction + | false => + rw [hk0] at hS; dsimp at hS + have hk0' : k ≠ 0 := ne_of_beq_eq_false hk0 + cases hk2 : (k % 2 == 0) with + | false => rw [hk2] at hS; contradiction + | true => + rw [hk2] at hS; dsimp at hS + have hk2' : k % 2 = 0 := beq_iff_eq.mp hk2 + cases hk4 : (k % 4 == 2) with + | true => + rw [hk4] at hS; dsimp at hS + injection hS with hS1; injection hS1 with hS1 hS2; subst hS1; subst hS2 + have hk4' : k % 4 = 2 := beq_iff_eq.mp hk4 + have hk_eq : k = 2 + (k / 4) * 4 := by omega + rw [hk_eq] + cases e + · exact RIncs.short00 hI + · exact RIncs.short01 hI + | false => + rw [hk4] at hS; dsimp at hS + injection hS with hS1; injection hS1 with hS1 hS2; subst hS1; subst hS2 + have hk4' : k % 4 ≠ 2 := ne_of_beq_eq_false hk4 + have hk_eq : k = 4 + (k / 4 - 1) * 4 := by omega + rw [hk_eq] + cases e + · exact RIncs.short10 hI + · exact RIncs.short11 hI + +def loc_z2l : Nat -> WordList -> Nat -> WordList -> Option (WordList) + | 0,_,_,_ => none + | fuel + 1,u,k,acc => + if k == 0 then + if u.all isWordK then some (acc.reverseAux [Q]) else none + else + match u with + | [] => + if k % 2 == 0 then + match loc_zPf 64 (1 + k / 2) with + | some ws => some (acc.reverseAux ws) + | none => none + else none + | V :: u' => loc_z2l fuel u' (k * 2) (V :: acc) + | K :: u' => + match loc_z2i false k with + | some (d,k') => loc_z2l fuel u' k' (d :: acc) + | none => none + | Q :: u' => + if (k % 2 == 0) && startsWithKOrNil (Q :: u') then + match loc_z2i true k with + | some (d,k') => loc_z2l fuel u' k' (d :: acc) + | none => none + else + match u' with + | K :: v => loc_z2l fuel v ((k - 1) * 2) (V :: acc) + | Q :: v => loc_z2l fuel v (1 + (k - 1) * 2) (V :: acc) + | _ => none + +theorem loc_z2m (fuel : Nat) : + ∀ (u : WordList) (k : Nat) (acc v : WordList),loc_z2l fuel u k acc = some v -> + ∃ w,v = acc.reverseAux w /\ RIncs k (evalWords u default) (evalWords w default) := by + induction fuel with + | zero => intro u k acc v hE; contradiction + | succ fuel ih => + intro u k acc v hE + dsimp [loc_z2l] at hE + cases hk0 : (k == 0) with + | true => + rw [hk0] at hE; dsimp at hE + have rfl_k : k = 0 := beq_iff_eq.mp hk0; subst rfl_k + cases hu : u.all isWordK with + | false => rw [hu] at hE; contradiction + | true => + rw [hu] at hE; dsimp at hE + injection hE with hE; subst hE + refine ⟨[Q],rfl,?_⟩ + rw [evalWords_default_of_all_K u hu] + have h0 := RIncs.zero (default : HalfTape) + simpa [evalWords,d1,one] using h0 + | false => + rw [hk0] at hE; dsimp at hE + have hk0' : k ≠ 0 := ne_of_beq_eq_false hk0 + cases u with + | nil => + cases hk2 : (k % 2 == 0) with + | false => rw [hk2] at hE; contradiction + | true => + rw [hk2] at hE; dsimp at hE + have hk2' : k % 2 = 0 := beq_iff_eq.mp hk2 + cases hp : loc_zPf 64 (1 + k / 2) with + | none => rw [hp] at hE; contradiction + | some ws => + rw [hp] at hE; dsimp at hE + injection hE with hE; subst hE + rcases loc_z2a 64 (1 + k / 2) ws hp with ⟨H,hB⟩ + have hR := loc_z1b hB + have heq : ((1 + k / 2) - 1) * 2 = k := by omega + rw [heq] at hR + exact ⟨ws,rfl,hR⟩ + | cons x u' => + cases x + · dsimp at hE + rcases ih u' (k * 2) (V :: acc) v hE with ⟨w,rfl,hR⟩ + refine ⟨V :: w,rfl,?_⟩ + have hk_eq : k = 1 + (k - 1) := by omega + have hk2_eq : k * 2 = (1 + (k - 1)) * 2 := by omega + rw [hk2_eq] at hR + rw [hk_eq] + exact RIncs.T hR + · dsimp at hE + cases hS : loc_z2i false k with + | none => rw [hS] at hE; contradiction + | some dk => + rcases dk with ⟨d,k'⟩ + rw [hS] at hE; dsimp at hE + rcases ih u' k' (d :: acc) v hE with ⟨w,rfl,hR⟩ + have h_sn := loc_z2j false k d k' (evalWords u' default) (evalWords w default) hS hR + rw [<- evalWords_append [d] w default] at h_sn + exact ⟨d :: w,rfl,h_sn⟩ + · dsimp at hE + cases hcond : ((k % 2 == 0) && startsWithKOrNil (Q :: u')) with + | true => + rw [hcond] at hE; dsimp at hE + cases hS : loc_z2i true k with + | none => rw [hS] at hE; contradiction + | some dk => + rcases dk with ⟨d,k'⟩ + rw [hS] at hE; dsimp at hE + rcases ih u' k' (d :: acc) v hE with ⟨w,rfl,hR⟩ + have h_sn := loc_z2j true k d k' (evalWords u' default) (evalWords w default) hS hR + rw [<- evalWords_append [d] w default] at h_sn + exact ⟨d :: w,rfl,h_sn⟩ + | false => + rw [hcond] at hE; dsimp at hE + cases u' with + | nil => contradiction + | cons x2 u'' => + cases x2 + · contradiction + · dsimp at hE + rcases ih u'' ((k - 1) * 2) (V :: acc) v hE with ⟨w,rfl,hR⟩ + refine ⟨V :: w,rfl,?_⟩ + have hk_eq : k = 1 + (k - 1) := by omega + rw [hk_eq] + exact RIncs.pair0 hR + · dsimp at hE + rcases ih u'' (1 + (k - 1) * 2) (V :: acc) v hE with ⟨w,rfl,hR⟩ + refine ⟨V :: w,rfl,?_⟩ + have hk_eq : k = 1 + (k - 1) := by omega + rw [hk_eq] + exact RIncs.pair1 hR + +def loc_z2n (k : Nat) (u : WordList) : Option (WordList) := + loc_z2l 64 (u ++ [K]) k [] + +theorem loc_z2o (k : Nat) (u v : WordList) (hE : loc_z2n k u = some v) : + RIncs k (evalWords u default) (evalWords v default) := by + rcases loc_z2m 64 (u ++ [K]) k [] v hE with ⟨w,rfl,hR⟩ + have hd0_side : evalWords [K] default = default := zDd + rw [evalWords_append u [K],hd0_side] at hR + exact hR + +def loc_z2s (c0 c1 : Nat) : WordList -> Nat -> Nat + | [],n => n + | V :: u,n => loc_z2s c0 c1 u (halfCeil n) + | K :: u,n => loc_z2s c0 c1 u (n * 2 + c0) + | Q :: u,n => loc_z2s c0 c1 u (n * 2 + c1) + +theorem loc_z2u (c0 c1 : Nat) (u : WordList) : + ∀ (n : Nat), + (c0 : Rat) * wordMassK u.reverse + (c1 : Rat) * wordMassQ u.reverse + wordScale u.reverse * (n : Rat) <= + ((loc_z2s c0 c1 u n : Nat) : Rat) := by + induction u with + | nil => + intro n + simp [wordMassK,wordMassQ,wordScale,loc_z2s] + | cons w u ih => + intro n + have hsp := wordScale_pos u.reverse + cases w + · dsimp [loc_z2s] + rw [List.reverse_cons,wordMassK_append,wordMassQ_append,wordScale_append] + dsimp [wordMassK,wordMassQ,wordScale] + have hhu := rat_le_two_mul_halfCeil n + have hih := ih (halfCeil n) + nlinarith + · dsimp [loc_z2s] + rw [List.reverse_cons,wordMassK_append,wordMassQ_append,wordScale_append] + dsimp [wordMassK,wordMassQ,wordScale] + have hih := ih (n * 2 + c0) + push_cast at hih + nlinarith + · dsimp [loc_z2s] + rw [List.reverse_cons,wordMassK_append,wordMassQ_append,wordScale_append] + dsimp [wordMassK,wordMassQ,wordScale] + have hih := ih (n * 2 + c1) + push_cast at hih + nlinarith + +theorem loc_z2v (c0 c1 : Nat) (u : WordList) (n : Nat) : + (c0 : Rat) * wordMassK u + (c1 : Rat) * wordMassQ u + wordScale u * (n : Rat) <= + ((loc_z2s c0 c1 u.reverse n : Nat) : Rat) := by + have h := loc_z2u c0 c1 u.reverse n + simpa [List.reverse_reverse] using h + +def loc_z2B (u ds : WordList) : Bool := + decide (loc_z2s (7 * 65536) (5 * 65536) u.reverse + (loc_z2s (2 * 65536) 0 ds.reverse 0) <= 2048) + +theorem loc_z2C (u ds : WordList) (hE : loc_z2B u ds = true) : + (5 / 2) * wordMass u + wordMassK u + wordScale u * wordMassK ds <= 1 / 64 := by + unfold loc_z2B at hE + have hle : loc_z2s (7 * 65536) (5 * 65536) u.reverse (loc_z2s (2 * 65536) 0 ds.reverse 0) <= 2048 := + of_decide_eq_true hE + have hle_q : ((loc_z2s (7 * 65536) (5 * 65536) u.reverse (loc_z2s (2 * 65536) 0 ds.reverse 0) : Nat) : Rat) <= 2048 := by + exact_mod_cast hle + have hD := loc_z2v (2 * 65536) 0 ds 0 + have hU := loc_z2v (7 * 65536) (5 * 65536) u (loc_z2s (2 * 65536) 0 ds.reverse 0) + have hSu := wordScale_pos u + have hSplit := wordMass_eq_add u + push_cast at hD hU + nlinarith + +def loc_z2E : WordList := Q :: List.replicate 1 K + +def loc_z2F : WordList := List.replicate 5 Q + +def loc_z2G (u : WordList) : Bool := + match splitPrefixDigits u with + | none => false + | some (p,ds) => + match heightShift p 0 with + | none => false + | some H => + if H == ds.length then + match stripWordPrefix loc_z2E ds, + stripWordPrefix loc_z2F ds.reverse with + | some _,some _ => loc_z2B p ds + | _,_ => false + else false + +theorem loc_z2H (u : WordList) (hE : loc_z2G u = true) : + C24Good (1 / 64) (evalWords u default) := by + unfold loc_z2G at hE + cases hC : splitPrefixDigits u with + | none => rw [hC] at hE; contradiction + | some pds => + rcases pds with ⟨p,ds⟩ + rw [hC] at hE; dsimp only [] at hE + cases hU : heightShift p 0 with + | none => rw [hU] at hE; contradiction + | some H => + rw [hU] at hE; dsimp only [] at hE + cases hL : (H == ds.length) with + | false => rw [hL] at hE; contradiction + | true => + rw [hL] at hE; rw [if_pos rfl] at hE + have rfl_H : H = ds.length := beq_iff_eq.mp hL + subst rfl_H + cases hLo : stripWordPrefix loc_z2E ds with + | none => rw [hLo] at hE; contradiction + | some lo => + rw [hLo] at hE + cases hHi : stripWordPrefix loc_z2F ds.reverse with + | none => rw [hHi] at hE; contradiction + | some hi => + rw [hHi] at hE; dsimp only [] at hE + rcases splitPrefixDigits_sound u p ds hC with ⟨rfl,hD⟩ + rcases exists_digitVal_of_all_isDigitWord ds hD with ⟨A,hDA⟩ + refine C24Good.intro p A ds.length ds hDA ?_ ?_ ?_ ?_ + · have hsp := heightShift_sound p 0 ds.length hU + simpa using hsp + · exact loc_z2C p ds hE + · exact ⟨lo,stripWordPrefix_sound loc_z2E ds lo hLo⟩ + · have hHi_eq := stripWordPrefix_sound loc_z2F ds.reverse hi hHi + have hRev := congrArg List.reverse hHi_eq + rw [List.reverse_reverse,List.reverse_append] at hRev + change ds = hi.reverse ++ (List.replicate 5 Q).reverse at hRev + rw [replicate_reverse] at hRev + exact ⟨hi.reverse,hRev⟩ + +def loc_z2I (u : WordList) : Option (WordList) := + match loc_z2n 2 u with + | none => none + | some v => + match loc_z2n 4 v with + | none => none + | some w => some (V :: w) + +inductive C24Rounds : HalfTape -> HalfTape -> Prop where + | refl (r : HalfTape) : C24Rounds r r + | next {r s v w : HalfTape} : + RIncs 2 r s -> RIncs 4 s v -> C24Rounds (t +> v) w -> C24Rounds r w + +def loc_z2J : Nat -> WordList -> Bool + | 0,u => loc_z2G u + | n + 1,u => + match loc_z2I u with + | none => false + | some v => loc_z2J n v + +theorem loc_z2K (n : Nat) : + ∀ (u : WordList),loc_z2J n u = true -> + ∃ r,C24Rounds (evalWords u default) r /\ C24Good (1 / 64) r := by + induction n with + | zero => + intro u hE + exact ⟨evalWords u default,C24Rounds.refl _,loc_z2H u hE⟩ + | succ n ih => + intro u hE + dsimp [loc_z2J,loc_z2I] at hE + cases hV : loc_z2n 2 u with + | none => rw [hV] at hE; contradiction + | some v => + rw [hV] at hE; dsimp at hE + cases hW : loc_z2n 4 v with + | none => rw [hW] at hE; contradiction + | some w => + rw [hW] at hE; dsimp at hE + rcases ih (V :: w) hE with ⟨r,hR,hG⟩ + exact ⟨r,C24Rounds.next (loc_z2o 2 u v hV) (loc_z2o 4 v w hW) hR,hG⟩ + +def loc_z2L : WordList := + List.replicate 5 V ++ List.replicate 5 Q + +theorem loc_z2M : loc_z2J 1 loc_z2L = true := by + decide + +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) + +def loc_z2N (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs,Num k w hs -> Side hs (w +> r) r' + +theorem loc_z2O {r r' : HalfTape} (h : loc_z2N 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl + +theorem loc_z2P {n : Nat} {r r' : HalfTape} + (hI : loc_z2N ((1 + n) * 2) r r') : loc_z2N (1 + n) (t +> r) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil] + refine zSc (z0n m) ?_ + have hN2 : Num ((1 + n) * 2) [] ([.cj] ++ [.ch] ^ (m * 2)) := by + have hm : (1 + n) * 2 = 2 + (m * 2) * 2 := by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil] + refine zSc (z0o m) ?_ + have hN2 : Num ((1 + n) * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : (1 + n) * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + +theorem loc_z2Q {n : Nat} {r r' : HalfTape} + (hI : loc_z2N (n * 2) r r') : loc_z2N (1 + n) (d1 +> (d0 +> r)) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil,<- append_assoc d1 d0 r] + cases m with + | zero => + have hn0 : n * 2 = 0 := by omega + rw [hn0] at hI + have hr' := loc_z2O hI + subst hr' + rw [<- append_assoc t one r] + exact zSc z0e (Side.nil r) + | succ m => + have h1m : m + 1 = 1 + m := by omega + rw [h1m] + refine zSc (z0p m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : n * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil,<- append_assoc d1 d0 r] + refine zSc (z0q m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (m * 2)) := by + have hm : n * 2 = 2 + (m * 2) * 2 := by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 + +theorem loc_z2R {n : Nat} {r r' : HalfTape} + (hI : loc_z2N (1 + n * 2) r r') : loc_z2N (1 + n) (d1 +> (d1 +> r)) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil,<- append_assoc d1 d1 r] + refine zSc (z0r m) ?_ + have hN1 : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ (m * 2)) := by + have hm : 1 + n * 2 = 1 + (m * 2) * 2 := by omega + rw [hm]; exact Num.odd (m * 2) + simpa using hI [] _ hN1 + | @even m => + simp only [append_nil,<- append_assoc d1 d1 r] + refine zSc (z0s m) ?_ + have hN1 : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ (1 + m * 2)) := by + have hm : 1 + n * 2 = 1 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.odd (1 + m * 2) + simpa using hI [] _ hN1 + +theorem loc_z2S {n : Nat} {r r' : HalfTape} + (hI : loc_z2N (n * 2) r r') : loc_z2N (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2O hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0i (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine zSc (z0t n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using hI [] _ hN2 + +theorem loc_z2T {n : Nat} {r r' : HalfTape} + (hI : loc_z2N (1 + n * 2) r r') : loc_z2N (2 + n * 4) (d1 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + refine zSc (z0u n) ?_ + simpa using hI [] _ (Num.odd n) + +theorem loc_z2U {n : Nat} {r r' : HalfTape} + (hI : loc_z2N (n * 2) r r') : loc_z2N (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2O hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0v (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine zSc (z0w n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using hI [] _ hN2 + +theorem loc_z2V {n : Nat} {r r' : HalfTape} + (hI : loc_z2N (1 + n * 2) r r') : loc_z2N (4 + n * 4) (d1 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + refine zSc (z0x n) ?_ + simpa using hI [] _ (Num.odd n) + +theorem loc_z2W {k : Nat} {r r' : HalfTape} (hI : RIncs k r r') : + loc_z2N k r r' := by + induction hI with + | zero r => + intro w hs hN + generalize hk : 0 = k0 at hN + cases hN with + | zero => exact Side.nil (one +> r) + | odd _ => omega + | even _ => omega + | T _ ih => exact loc_z2P ih + | pair0 _ ih => exact loc_z2Q ih + | pair1 _ ih => exact loc_z2R ih + | short00 _ ih => exact loc_z2S ih + | short01 _ ih => exact loc_z2T ih + | short10 _ ih => exact loc_z2U ih + | short11 _ ih => exact loc_z2V ih + +theorem loc_z2X {r s r' : HalfTape} (hI : RIncs 2 r s) (hJ : RIncs 4 s r') : + (zCf r) [target_tm]⊢⁺ zCf (t +> r') := by + have hC1 := loc_z2W hI [] ([.cj] ++ [.ch] ^ 0) (Num.even 0) + have hS1 := zSc z0y hC1 + dsimp at hS1 + rcases hS1 with _ | ⟨hca,hnil1⟩ + cases hnil1 + have hC2 := loc_z2W hJ [] ([.cj] ++ [.ch] ^ 1) (Num.even 1) + have hS2 := zSc (z0o 0) hC2 + dsimp at hS2 + rcases hS2 with _ | ⟨hcj,hnil2⟩ + cases hnil2 + exact zPt (z0z r) + (zPt (hca ([1,1] +> default)) + (zPt (z0A (t +> s)) (hcj lh))) + +theorem loc_z2Y {r r' : HalfTape} (h : C24Rounds r r') : + (zCf r) [target_tm]⊢* zCf r' := by + induction h with + | refl _ => exact ⟨0,rfl⟩ + | next hR1 hR2 _ ih => + rcases loc_z2X hR1 hR2 with ⟨n,_,hn⟩ + rcases ih with ⟨m,hm⟩ + exact ⟨n + m,zMt target_tm _ _ _ n m hn hm⟩ + +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d) = some c') : + (multiStep target_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl + +theorem loc_z2Z : + (init []) [target_tm]⊢⁺ zCf (evalWords loc_z2L default) := by + have h := pre_z16 + have heq : evalWords loc_z2L default = + (([1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,0,1,0,1,0,1,0] : BitWord) +> default) := by + simp [loc_z2L,List.replicate,evalWords,t,d1,append_cons,append_nil] + rwa [heq] + +theorem loc_z30 (m : Nat) : + ∃ N ≥ m,∃ r,multiStep target_tm (init []) N = some (zCf r) /\ C24Good (1 / 64) r := by + induction m with + | zero => + rcases loc_z2Z with ⟨k1,_,hk1⟩ + rcases loc_z2K 1 loc_z2L loc_z2M with ⟨r0,hR0,hG0⟩ + rcases loc_z2Y hR0 with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,r0,zMt target_tm _ _ _ k1 k2 hk1 hk2,hG0⟩ + | succ m ih => + rcases ih with ⟨N,hN,r,h_ms,h_good⟩ + rcases loc_z29 h_good with ⟨s,r',hR1,hR2,h_good'⟩ + rcases loc_z2X hR1 hR2 with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,t +> r',zMt target_tm _ _ _ N k h_ms h_step_k,h_good'⟩ + +end Solution + + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases loc_z30 (n + 1) with ⟨N,hN,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := zIm h_N + rw [zMs,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_1RFHHH_1RA1RE diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RB.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RB.lean new file mode 100644 index 00000000..3ecf7e9e --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RB.lean @@ -0,0 +1,483 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusH +public import BusyBeaver.Calculi.WordCalculusI + + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RB + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RB" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +open WordCalculus Word WordCanonBR WordCanonBR.BRIncs WordCanonBR.Choice +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +local notation "WordList" => List Word + +def z29_0539 : WordList := [V, V, V, V, V, V, V, V, K, V, Q, V, V, K, V, V, Q, V, V, V, Q, V, + V, V, K, V, V, Q, K, V, V, V, Q, Q, Q, V, K, Q, Q, Q, Q, K, K, Q, K, Q, Q, Q, K, K, K, K, + K, K, Q] + +def z2a_0539 : List (List Choice) := [ + [CT, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), + CSP1, CT, CT, (COC0 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CT, CP0, CT, CT, (COC0 0), + CSP1, CP1, (COC1 0), CSP0, CS11, CP1, CP0, CS10, CP0, CP1, CP0, CS10, CS10, CS00, CS00, + CS10, CP0], + [CT, (COC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, (COC0 0), + CSP0, CT, (COC1 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, + CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, CT, + (COC0 0), CSP1, CP0, CS10, CS01, (COC0 0), CSP0, CS10, CS01, CP0, CS10, CP0, CP0, CS01, + CP0, CS10, CP1, CP0, CS10, CP1, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), + CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), + CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, (COC1 0), CSP1, CT, + (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CP0, CS10, CT, (COC1 1), CSP1, CT, + (COC0 0), (CSC0 0), CSP1, CT, (COC0 0), CSP1, CT, CT, CT, CP0, CP1, CP1, CP0, CS10, CP0, + CS00, CS10, CS00, CP0, CP0, CP0, CS01, CP1, CP0, CP0, CS01, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CS11, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, (COC0 0), CSP0, + CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, (COC1 0), + CSP1, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP1, (COC1 0), + CSP1, CT, CT, (COC0 0), CSP0, CS10, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP1, (COC1 0), CSP0, CP0, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, + CT, CP0, CS11, CP1, CP0, CP1, CP0, CS10, CP0, CS01, CP1, CP1, CP1, CP0, CP0, CS00, CS00, + CS00, CP0, CS01, CP0, CS10, CS01, CP1, CP0, CS10, CP0, CS01, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, CT, CT, + CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, + (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), + CSP1, (COC1 0), CSP1, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, + CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, + CT, CT, (COC0 0), CSP1, CT, CT, CT, (COC0 0), CSP1, (COC1 0), CSP0, CT, CT, CT, CT, + (COC0 0), CSP0, CS10, (CEC 0), CSP0, CT, CP0, CT, (COC1 0), CSP1, (COC1 0), CSP0, CT, CT, + CP0, CS10, CP1, CP0, CP0, CS00, CS00, CS10, CS10, CP0, CS00, CS11, CP1, CP0, CS10, CS00, + CS01, CP1, CP1, CP1, CP1, CP0, CP0, CS00, CS00, CS00, CP0, CP0, CP0, CP1, CP0, CS10, + CS10, CS00, CP0, CS01, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, (COC0 0), CSP0, + CT, (COC1 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, (COC1 0), CSP1, (COC1 0), CSP1, CT, (COC0 0), CSP0, CT, CT, (COC0 0), + CSP0, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, (COC0 0), CSP1, + (COC1 0), CSP1, CT, CT, CT, (COC0 0), CSP1, CT, CT, (COC0 0), CSP0, CS10, CP1, (COC0 0), + CSP0, CS11, CT, CT, CP0, CS10, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS10, CS00, CT, CT, + CT, CT, (COC0 0), CSP1, (COC1 1), CSP0, CT, CT, CP0, CS10, CS11, CP0, CS11, CP0, CP1, + CP1, CP1, CP0, CS10, CP0, CS00, CS10, CS10, CS01, CP0, CP0, CP1, CP0, CS10, CS10, CS01, + CP0, CP1, CP1, CP1, CP0, CP0, CS00, CS00, CS00, CP0, CS01, CP0, CS10, CP1, CP0, CS10, + CP1, CP0, CS10, CS11, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, + CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, + CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, (COC1 0), CSP1, CT, (COC0 0), + CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, (COC0 0), + (CSC1 0), CSP1, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, + CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CT, CT, + CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, + (COC0 0), (CSC1 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), (CSC0 0), CSP1, + (COC1 0), (CSC0 0), CSP1, CT, CT, (COC0 0), CSP1, CT, CT, CT, CT, (COC0 0), CSP0, CT, + CP0, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, CT, CP1, (COC1 0), CSP1, CT, + CT, CT, CT, (COC0 0), CSP1, (COC1 0), CSP0, CS11, CP0, CT, CT, CT, (COC0 0), CSP1, CP0, + CT, CT, CT, CT, CT, (COC0 0), CSP0, CS10, (CEC 0), (CSC0 0), CSP1, CT, (COC0 0), CSP1, + CT, CT, CP1, CT, CT, CP0, CS10, CP0, CS00, CP0, CP0, CS00, CS10, CP0, CP0, CS00, CS10, + CS01, CP0, CS10, CP0, CS00, CS01, CP0, CP0, CP0, CP1, CP0, CS10, CS10, CS00, CS00, CS11, + CP1, CP0, CP1, CP0, CS10, CS11, CP0, CS11, CP1, CP1, CP1, CP0, CP0, CS00, CS00, CS00, + CP0, CP0, CP0, CS01, CP1, CP0, CP0, CS01, CP0, CS10, CS11, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CS11, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, (COC0 0), CSP0, + CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, (COC1 0), + CSP1, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CS11, CT, + CT, CT, (COC0 0), CSP0, CS11, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CS11, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, (COC0 0), (CSC1 0), + CSP1, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, + (COC0 0), CSP0, CS10, CT, CT, CP0, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), + CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, CT, CT, (COC0 0), + CSP1, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP1, CT, CT, CT, (COC0 0), + CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP0, CT, CT, (COC0 0), + CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, (COC1 0), CSP0, CT, (COC1 0), CSP0, CS11, + CT, (COC0 0), (CSC1 1), CSP1, (COC1 0), CSP0, CS10, CT, CT, CT, CT, (COC0 0), CSP1, CP0, + CS10, CS01, CT, CT, CT, CT, CP1, (COC1 0), CSP1, CT, CT, CT, CT, (COC0 0), CSP0, CS10, + CS00, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CP1, CT, CT, CP0, CS10, CP1, + CP0, CS10, CS10, CS11, CP0, CS10, CS00, CP1, CP0, CS10, CS10, CS01, CP0, CS10, CP0, CP0, + CP1, CP1, CP0, CP1, CP0, CS10, CP1, CP0, CP0, CP0, CS00, CP0, CP0, CP1, CP0, CP1, CP1, + CP0, CS10, CS00, CS10, CS10, CS01, CP0, CP0, CP1, CP0, CS10, CS10, CS01, CP0, CP1, CP1, + CP1, CP0, CP0, CS00, CS00, CS00, CP0, CS01, CP0, CS10, CS01, CP1, CP0, CS10, CP0, CS01, + CP0, CS10, CS01, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, CT, CT, + CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, + (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), + CSP1, (COC1 0), CSP1, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, + CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, + CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, (COC0 0), + CSP0, CS11, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CT, + CT, (COC0 0), (CSC0 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, (COC0 0), CSP1, + (COC1 0), CSP1, (COC1 0), CSP0, CS11, CT, CT, (COC0 0), CSP1, (COC1 0), CSP1, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CP0, CT, CT, CT, CT, (COC0 0), CSP1, CT, CT, CT, CT, (COC0 0), + CSP0, CT, CP0, CT, (COC1 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), + CSP1, CT, (COC0 0), CSP1, CP1, CT, CP0, CT, (COC1 0), CSP1, (COC1 1), CSP1, CT, CT, CT, + CT, CT, CT, (COC0 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CP0, + CS11, CP0, CT, CT, CT, (COC0 0), CSP1, CP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS10, + (CEC 0), CSP0, CT, CP0, CT, (COC1 0), CSP1, (COC1 0), CSP0, CT, CP0, CT, CT, CP0, CS11, + CP0, CP0, CS00, CS00, CS00, CP0, CP0, CS00, CS10, CP0, CP1, CP0, CS10, CS10, CP1, CP1, + CP0, CS10, CS00, CS10, CS01, CP0, CP0, CS00, CS00, CS10, CS10, CS10, CS11, CP0, CS10, + CS01, CP0, CS10, CS00, CP0, CP1, CP1, CP1, CP0, CP0, CS00, CS01, CP0, CS10, CP0, CS00, + CS00, CP0, CP0, CP1, CP0, CP0, CP0, CP0, CP1, CP0, CS10, CS10, CS00, CS00, CS01, CP1, + CP0, CP1, CP0, CS10, CS11, CP0, CS11, CP1, CP1, CP1, CP0, CP0, CS00, CS00, CS00, CP0, + CP0, CP0, CP1, CP0, CS10, CS10, CS00, CP0, CS01, CP0, CS10, CS01, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, (COC1 0), + CSP1, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, (COC0 0), CSP0, CT, + (COC1 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, (COC1 0), CSP1, (COC1 0), CSP1, CT, (COC0 0), CSP0, CT, CT, (COC0 0), + CSP0, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, (COC0 0), CSP0, + CS11, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CS10, CT, CT, CT, CT, CT, + CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, + CS11, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), (CSC1 0), + CSP1, (COC1 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, (COC1 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), + CSP0, CS11, CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP1, (COC1 0), CSP1, CT, + (COC0 0), (CSC0 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP1, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, CT, CT, CT, + (COC0 0), CSP1, (COC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, CT, CT, CT, (COC0 0), + CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, (COC0 0), CSP1, + (COC1 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CS10, CS10, CT, + (COC1 0), CSP0, CS11, CT, CT, CT, CP1, CT, CT, CT, CP0, CP0, CT, (COC1 0), CSP0, CS10, + CP1, CP1, CT, CP0, CT, CP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, (CEC 0), CSP1, (COC1 0), + CSP0, CS10, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, CP0, CS10, CS00, CT, CT, CT, + CT, CP1, (COC1 0), CSP1, CT, CT, CT, CT, (COC0 0), CSP0, CS10, CS00, CT, CT, CT, CT, + (COC0 0), CSP1, (COC1 1), CSP0, CT, CP0, CT, CT, CP0, CS10, CP0, CS00, CS00, CS11, CP1, + CP0, CS11, CP0, CS10, CS11, CP0, CS10, CS10, CS11, CP0, CS10, CS01, CP1, CP1, CP0, CS10, + CS01, CP0, CP1, CP1, CP0, CP0, CP0, CP0, CP1, CP0, CS10, CS10, CS00, CP0, CS00, CP1, CP0, + CS11, CP0, CS10, CS00, CP0, CS01, CP0, CS10, CS10, CS11, CP0, CP0, CS00, CP0, CP0, CS01, + CP0, CS10, CS01, CP0, CP0, CS00, CS00, CP1, CP1, CP0, CP0, CP0, CS00, CS11, CP0, CS10, + CS01, CP1, CP0, CS11, CP0, CP0, CP0, CP1, CP0, CP1, CP1, CP0, CS10, CS00, CS10, CS10, + CS01, CP0, CP0, CP1, CP0, CS10, CS10, CS01, CP0, CP1, CP1, CP1, CP0, CP0, CS00, CS00, + CS00, CP0, CS01, CP0, CS10, CP1, CP0, CS10, CP1, CP0, CS10, CS11, CP0, CS10, CS01, CP1, + CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, (COC1 0), + CSP1, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, + (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, + CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, (COC1 0), CSP1, CT, (COC0 0), CSP0, + CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, (COC0 0), (CSC1 0), + CSP1, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, + CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, + (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, + (COC0 0), (CSC1 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), (CSC0 0), CSP1, + CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, + (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, + (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, + CT, (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, + CT, (COC0 0), (CSC1 0), CSP1, CT, (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, (COC1 0), + CSP1, CT, (COC0 0), CSP0, CS10, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, + CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, CT, + (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), + CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, CP1, + (COC1 0), CSP1, (COC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, + (COC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), + CSP1, (COC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CP0, CT, CT, + CT, CT, (COC0 0), CSP1, CT, CT, CT, CT, (COC0 0), CSP0, CT, CP0, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, (COC1 0), CSP0, CS10, CS11, CT, + (COC0 0), CSP1, CT, CP1, (COC1 0), CSP1, CP1, CT, CP0, CT, CT, CT, CP0, CT, CT, CT, CT, + CT, CT, CT, CT, (COC0 0), CSP1, (COC1 1), CSP0, CT, (COC1 0), CSP1, CT, (COC0 1), + (CSC1 0), CSP1, CP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, CP0, CT, (COC1 0), CSP0, + CS10, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CP0, CT, (COC1 0), CSP1, CT, CT, CT, CT, + CT, CT, CT, CT, CP0, CS11, CP0, CT, CT, CT, (COC0 0), CSP1, CP0, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CS10, (CEC 0), (CSC0 0), CSP1, CT, (COC0 0), CSP1, CT, CT, CP1, CT, CP0, + CT, CT, CP0, CS10, CS10, CS10, CS01, CP0, CS10, CS10, CS01, CP0, CP0, CP0, CS00, CS10, + CP0, CS00, CP0, CS00, CP1, CP0, CP0, CS01, CP1, CP0, CP1, CP0, CP0, CS00, CP0, CS00, CP0, + CP1, CP1, CP0, CS10, CS00, CS10, CS00, CP0, CP0, CS00, CS11, CP0, CP0, CS01, CP0, CS10, + CS11, CP0, CS11, CP1, CP1, CP0, CS10, CP0, CS00, CS11, CP1, CP1, CP0, CS10, CP0, CS00, + CP0, CS01, CP0, CS10, CP0, CP0, CS00, CS11, CP0, CS10, CP1, CP1, CP0, CS10, CS01, CP0, + CP0, CS01, CP0, CP0, CS00, CS00, CS10, CS10, CS10, CS11, CP0, CS10, CP0, CS00, CS10, + CS10, CS00, CS00, CP1, CP1, CP1, CP0, CP0, CS00, CS01, CP0, CS10, CS11, CP1, CP0, CS10, + CP0, CP1, CP0, CP0, CP0, CP0, CP1, CP0, CS10, CS10, CS00, CS00, CS01, CP1, CP0, CP1, CP0, + CS10, CS11, CP0, CS11, CP1, CP1, CP1, CP0, CP0, CS00, CS00, CS00, CP0, CP0, CP0, CS01, + CP1, CP0, CP0, CS01, CP0, CS10, CS11, CP0, CS10, CS01, CP1, CP0] +] + +def z2b_0539 : WordList := [V, V, V, V, V, V, V, V, K, Q, V, V, V, K, V, V, Q, V, V, V, K, V, + V, V, K, V, V, V, V, V, V, K, V, V, Q, V, Q, V, V, K, V, V, V, K, V, V, V, V, K, Q, V, V, + V, V, K, Q, V, V, V, K, V, V, V, V, V, V, V, V, K, Q, V, V, V, V, V, K, V, V, V, K, V, V, + V, V, K, V, V, V, V, K, V, Q, V, V, V, V, V, K, V, Q, V, V, V, V, V, K, Q, V, V, V, V, V, + K, V, V, V, K, K, V, V, V, V, V, V, V, K, V, V, V, V, V, K, V, V, V, V, V, V, K, Q, V, V, + V, V, V, V, V, V, K, V, V, V, V, V, K, V, Q, V, K, V, V, V, V, K, V, V, V, V, V, V, V, K, + V, Q, V, K, V, V, V, K, V, V, V, V, V, V, V, K, Q, V, V, V, K, V, Q, V, K, V, Q, V, V, K, + V, Q, V, V, V, V, K, V, V, V, V, V, V, V, V, K, V, V, V, V, V, K, V, V, V, V, K, V, V, V, + K, V, V, V, V, V, V, K, V, V, Q, V, V, V, V, V, K, Q, V, V, V, V, V, V, V, V, V, K, V, V, + V, V, K, V, V, V, V, V, V, V, V, V, K, V, V, V, V, K, V, V, V, V, V, V, V, K, V, Q, V, V, + V, V, V, K, Q, V, V, V, V, V, V, V, K, V, V, Q, V, V, V, Q, V, Q, V, V, V, V, V, V, V, V, + V, V, K, V, Q, V, V, V, V, V, V, V, V, V, V, V, K, V, V, V, K, V, Q, V, V, V, V, V, V, V, + V, K, V, V, V, V, V, V, V, V, K, V, V, V, V, V, K, V, V, V, V, V, V, K, Q, V, V, V, V, V, + V, V, V, K, V, Q, V, Q, Q, V, K, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, K, V, Q, V, V, V, Q, V, V, K, V, Q, V, V, V, V, K, V, V, Q, V, V, V, V, Q, V, Q, V, V, + V, V, K, V, Q, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, Q, V, V, V, V, K, V, V, V, V, V, + V, V, K, V, Q, V, K, V, V, V, K, V, V, V, V, V, V, V, V, V, Q, Q, Q, K, V, Q, Q, K, V, V, + V, K, Q, V, K, V, K, V, V, V, K, V, V, V, V, V, K, V, K, V, V, V, V, Q, K, Q, K, V, V, K, + Q, V, V, K, V, Q, Q, V, Q, V, V, V, Q, V, K, Q, V, V, V, Q, V, K, V, K, V, Q, V, V, K, Q, + V, Q, V, V, V, Q, K, V, V, K, V, V, K, K, Q, Q, Q, Q, V, Q, V, K, Q, Q, K, K, V, V, V, V, + V, K, K, V, Q, Q, V, V, Q, V, V, V, V, V, V, V, V, Q, Q, K, K, K, V, V, V, V, Q, Q, V, Q, + V, V, V, V, V, K, K, K, V, V, V, K, V, V, V, K, V, Q, Q, V, Q, K, V, V] + +def z2c_low_0539 : WordList := [Q, K, K, Q, Q, K, K, K, Q, Q, Q, Q, K, Q, Q, K, Q, K, K, K, K, + K, Q, Q, Q, K, K, K, Q, Q, K, K, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, K, K, Q, Q, Q, K, Q, + K, Q, Q, K, K, K, Q, Q, Q, Q, Q, K, K, K, K, Q, K, K, Q, Q, Q, K, K, K, Q, Q, K, Q, Q, Q, + K, K, Q, Q, Q, K, Q, Q, K, K, K, Q, K, Q, Q, Q, Q, Q, Q, K, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, + Q, K, K, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, K, K, Q, Q, Q, K, Q, K, Q, Q, Q, K, Q, Q, K, K, Q, + K, K, Q, Q, Q, Q, Q, Q, K, K, Q, K, K, Q, Q, Q, Q, Q, Q, K, Q, K, Q, K, Q, K, Q, Q, K, K, + K, K, Q, K, K, Q, Q, K, K, Q, Q, Q, Q, Q, K, K, Q, Q, K, K, K, Q, Q, K, Q, K, K, Q, K, Q, + K, Q, Q, K, K, Q, Q, K, Q, K, K, K, Q, Q, Q, Q, Q, K, Q, K, Q, K, K, Q, Q, K, K, Q, Q, Q, + Q, K, Q, Q, K, Q, K, Q, K, Q, Q, Q, K, Q, Q, Q, Q, Q, K, K, K, K, K, Q, Q, K, Q, K, Q, Q, + Q, K, K, K, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, K, Q, K, K, K, K, Q, K] + +def z2c_top_0539 : WordList := [Q,Q,K,K,Q,Q,Q,Q,K,K,Q,K,Q,Q,K,K] + +def z2c_0539 : WordList := z2c_low_0539 ++ z2c_top_0539 + +theorem z2d_0539 : + CanonRounds (evalWords z29_0539 default) + (evalWords (prefix33Words ++ (z2b_0539 ++ (z2c_0539 ++ tail8Words))) default) := + evalCanonRounds_sound z2a_0539 z29_0539 + (prefix33Words ++ (z2b_0539 ++ (z2c_0539 ++ tail8Words))) + (by decide +kernel) + +theorem z2e_0539 : + BGood (z2b_0539 ++ (z2c_0539 ++ tail8Words)) := by + apply bGood_of_check z2b_0539 z2c_low_0539 z2c_top_0539 <;> decide +kernel + +def zRem1Pad_0539 : WordList := [V,V,V,V,V,V,V,V,K,V,Q,V,V,K,V,V,K,K,K,K,Q,Q,Q,Q,Q,K,K,K,K] + +def zMid1_0539 : WordList := [V,V,V,V,V,V,V,V,K,V,Q,V,V,K,V,V,K,K,K,K,Q,Q,Q,Q,Q,K,K,K,Q] + +def zCh1_0539 : List Choice := [CT, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, + (COC0 0), CSP0, CT, (COC1 0), CSP0, CS10, CS00, CS00, CP1, CP1, CP0, CS10, CS00, CP0] + +def zOut1_0539 : WordList := [V,V,V,V,V,V,V,K,Q,V,V,V,K,V,V,Q,V,Q,K,K,V,V,V,Q,K,V,K,K,Q,Q,K,Q,Q,Q] + +def zRem2Pad_0539 : WordList := [V, V, V, V, V, V, V, V, K, Q, V, V, V, K, V, V, Q, V, Q, K, K, + V, V, V, Q, K, V, K, K, Q, Q, K, Q, Q, Q, K, K, K, K, K] + +def zMid2_0539 : WordList := [V, V, V, V, V, V, V, V, K, Q, V, V, V, K, V, V, Q, V, Q, K, K, V, + V, V, Q, K, V, K, K, Q, Q, K, Q, Q, Q, K, K, K, K, Q] + +def zCh2_0539 : List Choice := [CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, + (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CP0, CS10, CT, CT, CT, (COC0 1), CSP0, CS10, CS01, + CP0, CP1, CP0, CS10, CS10, CS10, CP0] + +def zOut2_0539 : WordList := [V, V, V, V, V, V, V, K, V, Q, V, V, K, V, V, Q, V, V, V, Q, V, V, + V, K, V, V, Q, K, V, V, V, Q, Q, Q, V, K, Q, Q, Q, Q, K, K, Q, K, Q, Q, Q] + +def zRem3Pad_0539 : WordList := [V, V, V, V, V, V, V, V, K, V, Q, V, V, K, V, V, Q, V, V, V, Q, + V, V, V, K, V, V, Q, K, V, V, V, Q, Q, Q, V, K, Q, Q, Q, Q, K, K, Q, K, Q, Q, Q, K, K, K, + K, K, K, K] + +def zCk0_0539 : CCfg := ⟨A,0,[],[]⟩ + +def zCk1_0539 : CCfg := ⟨C,1, + [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, + 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1], + [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1]⟩ + +def zCk2_0539 : CCfg := ⟨A,0, + [1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1], + [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1]⟩ + +def zCk3_0539 : CCfg := ⟨C,0, + [1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1], + [0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1]⟩ + +def zCk4_0539 : CCfg := ⟨C,1, + [0, 1], + [0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, + 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, + 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1]⟩ + +private theorem zCk_step1_0539 : (c_to_cfg zCk0_0539) [canon_tm]⊢⁺ (c_to_cfg zCk1_0539) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk0_0539 10000 = some zCk1_0539) + +private theorem zCk_step2_0539 : (c_to_cfg zCk1_0539) [canon_tm]⊢⁺ (c_to_cfg zCk2_0539) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk1_0539 10000 = some zCk2_0539) + +private theorem zCk_step3_0539 : (c_to_cfg zCk2_0539) [canon_tm]⊢⁺ (c_to_cfg zCk3_0539) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk2_0539 10000 = some zCk3_0539) + +private theorem zCk_step4_0539 : (c_to_cfg zCk3_0539) [canon_tm]⊢⁺ (c_to_cfg zCk4_0539) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk3_0539 6519 = some zCk4_0539) + +private theorem zH1_0539 : + Side ([Call.ch] ^ 4) (evalWords zRem1Pad_0539 default) (evalWords zMid1_0539 default) := + evalChPow_sound zRem1Pad_0539 4 zMid1_0539 (by decide +kernel) + +private theorem zB1_0539 : + BRIncs false 5 (evalWords (zMid1_0539 ++ [K]) default) (evalWords zOut1_0539 default) := + evalChoiceList_sound zCh1_0539 false 5 (zMid1_0539 ++ [K]) zOut1_0539 (by decide +kernel) + +private theorem zH2_0539 : + Side ([Call.ch] ^ 8) (evalWords zRem2Pad_0539 default) (evalWords zMid2_0539 default) := + evalChPow_sound zRem2Pad_0539 8 zMid2_0539 (by decide +kernel) + +private theorem zB2_0539 : + BRIncs false 4 (evalWords (zMid2_0539 ++ [K]) default) (evalWords zOut2_0539 default) := + evalChoiceList_sound zCh2_0539 false 4 (zMid2_0539 ++ [K]) zOut2_0539 (by decide +kernel) + +private theorem zH3_0539 : + Side ([Call.ch] ^ 16) (evalWords zRem3Pad_0539 default) (evalWords z29_0539 default) := + evalChPow_sound zRem3Pad_0539 16 z29_0539 (by decide +kernel) + +theorem z0E_0539 : (c_to_cfg zCk0_0539) [canon_tm]⊢⁺ (cfgCanon (evalWords z29_0539 default)) := by + have h_all := stepPlus_trans_canon zCk_step1_0539 + (stepPlus_trans_canon zCk_step2_0539 + (stepPlus_trans_canon zCk_step3_0539 zCk_step4_0539)) + have heq1 : c_to_cfg zCk4_0539 = cfgLeft lh (w_pre3 +> evalWords zRem1Pad_0539 default) := by + simp only [c_to_cfg, C, WordCanonBR.C, zCk4_0539, zCL, cfgLeft, lh, w_pre3, w_pre3_rest, + w_word, zRem1Pad_0539, evalWords, t, d0, d1, one, List.cons_append, List.nil_append, + append_cons, append_nil, z00, zero_cons_default_canon, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] + rw [heq1] at h_all + have h_h1 := zH1_0539 + have h_b1_0 := zB1_0539 + have h_b1 : BRIncs false 5 (evalWords zMid1_0539 default) (evalWords zOut1_0539 default) := by + simpa only [evalWords_append,evalWords,d0_append_default] using! h_b1_0 + have h_s1 : + Side ([.cp] ++ [.ch] ^ 2) (evalWords zMid1_0539 default) (evalWords zOut1_0539 default) := by + simpa only [append_nil] using! numSide_of_brIncs h_b1 [] ([.cp] ++ [.ch] ^ 2) (Num.odd 2) + have h_turn1 := stepPlus_word_pre3_full (by have h := side_append h_h1 h_s1; exact h) + have heq2 : t +> evalWords zOut1_0539 default = evalWords zRem2Pad_0539 default := by + simp only [zOut1_0539, zRem2Pad_0539, evalWords, t, d0, d1, List.cons_append, + List.nil_append, append_cons, append_nil, z00, zero_cons_default_canon] + rw [heq2] at h_turn1 + have h_h2 := zH2_0539 + have h_b2_0 := zB2_0539 + have h_b2 : BRIncs false 4 (evalWords zMid2_0539 default) (evalWords zOut2_0539 default) := by + simpa only [evalWords_append,evalWords,d0_append_default] using! h_b2_0 + have h_s2 : Side ([.cj,.ch]) (evalWords zMid2_0539 default) (evalWords zOut2_0539 default) := by + simpa only [z06, list_pow_one_canon, List.cons_append, List.nil_append, + append_nil] using! numSide_of_brIncs h_b2 [] ([.cj] ++ [.ch] ^ 1) (Num.even 1) + have h_turn2 := stepPlus_word_pre5_full (side_append h_h2 h_s2) + have heq3 : t +> evalWords zOut2_0539 default = evalWords zRem3Pad_0539 default := by + simp only [zOut2_0539, zRem3Pad_0539, evalWords, t, d0, d1, List.cons_append, + List.nil_append, append_cons, append_nil, z00, zero_cons_default_canon] + rw [heq3] at h_turn2 + have h_h3 := zH3_0539 + have h_turn3 := stepPlus_word_pre_full h_h3 + exact stepPlus_trans_canon h_all + (stepPlus_trans_canon h_turn1 + (stepPlus_trans_canon h_turn2 h_turn3)) + +theorem z2s_0539 (m : Nat) : + ∃ N ≥ m,∃ w,multiStep canon_tm (c_to_cfg zCk0_0539) N = + some (cfgCanon (evalWords (prefix33Words ++ w) default)) /\ BGood w := by + induction m with + | zero => + rcases z0E_0539 with ⟨k1,_,hk1⟩ + rcases stepStar_of_canonRounds z2d_0539 with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,z2b_0539 ++ (z2c_0539 ++ tail8Words), + multiStep_trans_canon canon_tm _ _ _ k1 k2 hk1 hk2,z2e_0539⟩ + | succ m ih => + rcases ih with ⟨N,hN,w,h_ms,h_good⟩ + rcases bGood_progress h_good with ⟨w',hStep,h_good'⟩ + rcases stepPlus_of_bStep hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,w', + multiStep_trans_canon canon_tm _ _ _ N k h_ms h_step_k,h_good'⟩ + +def zStMap_0539 : Fin 6 -> Fin 6 + | 0 => 0 + | 1 => 1 + | 2 => 2 + | 3 => 3 + | 4 => 5 + | 5 => 4 + +def zCfgMap_0539 (c : Cfg (Fin 2) (Fin 6)) : Cfg (Fin 2) (Fin 6) := + ⟨c.q.map zStMap_0539,c.tape⟩ + +theorem zStepMap_0539 (c : Cfg (Fin 2) (Fin 6)) : + step target_tm (zCfgMap_0539 c) = (step canon_tm c).map zCfgMap_0539 := by + rcases c with ⟨_ | ⟨_ | _ | _ | _ | _ | _ | q,hq⟩,⟨h,l,r⟩⟩ <;> + rcases h with ⟨_ | _ | a,ha⟩ <;> + first | omega | rfl + +theorem zMultiStepMap_0539 (c : Cfg (Fin 2) (Fin 6)) (n : Nat) : + multiStep target_tm (zCfgMap_0539 c) n = (multiStep canon_tm c n).map zCfgMap_0539 := by + induction n with + | zero => rfl + | succ n ih => + rw [multiStep_succ_canon,multiStep_succ_canon,ih] + cases multiStep canon_tm c n with + | none => rfl + | some c' => exact zStepMap_0539 c' + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases z2s_0539 (n + 1) with ⟨N,hN,_,h_N,_⟩ + have h_init : zCfgMap_0539 (c_to_cfg zCk0_0539) = init [] := rfl + have h_map := zMultiStepMap_0539 (c_to_cfg zCk0_0539) N + rw [h_init,h_N] at h_map + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_map + have h_some := multiStep_add_Intermediate h_map + rw [multiStep_succ_canon,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RB diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RF.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RF.lean new file mode 100644 index 00000000..dbf645b5 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RF.lean @@ -0,0 +1,1037 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RF + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RF" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 8000000 +set_option maxRecDepth 4000000 +@[simp] theorem zMz (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : HalfTape).head = 0 := rfl +@[simp] theorem zDt : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem zPs {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem zPt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,by omega,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) +abbrev t : BitWord := [1,1,0,0] +abbrev d0 : BitWord := [0,0] +abbrev d1 : BitWord := [1,0] +abbrev one : BitWord := [1] +abbrev lh : HalfTape := (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default +abbrev w_pre : BitWord := t ++ one +abbrev w_word : BitWord := w_pre +@[simp] theorem zDd : d0 +> (default : HalfTape) = default := by + simp [d0] +inductive Call where + | ch + | cj + | cp + | ca +def zCs : Call -> Fin 6 + | .ch => B + | .cj => A + | .cp => A + | .ca => B +def zCw : Call -> BitWord + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] + | .ca => [1,1,1,0,1,1] +def zCR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + ((l <+ zCw c) {{zCs c}}> r) +def zCL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (l <{{C}} ([0] +> r)) +def zCf (q : Nat) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + zCL lh ((w_pre ++ (t ^ (2 + q) ++ (d1 ++ one))) +> r) +def z04 (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l,(zCR l c r1) [target_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + z04 c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem z05 {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z06 {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem z07 {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z08 {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z09 {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0a (w : BitWord) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem z0b (ls : List Call) : Seg ls ls [] [] := by + intro r1 r2 h; exact h +theorem zSc {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases z09 h with ⟨r2,ha,hb⟩ + exact z08 (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS0 {ls1 ls2 ls3 : List Call} {w1 w2 v1 v2 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls2 ls3 v1 v2) : + Seg ls1 ls3 (w1 ++ v1) (w2 ++ v2) := by + intro r1 r2 h + rw [append_assoc,append_assoc] + exact h1 (v1 +> r1) (v2 +> r2) (h2 r1 r2 h) +theorem zS4 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc1 (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [target_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem z0c : Seg [.cp] [.ch] t (t ++ [0]) := + zS2 (mid := [1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0d : Seg [.cj] [.ch] t (t ++ one) := + zS2 (mid := [1,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0e : Seg [.ch] [.cj] (t ++ [0]) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0f : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0g : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0h : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1 d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0i : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0j : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0k : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0l : Seg [.cj] [.cp] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons,append_nil]; execute) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem H_T (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact z0a t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [zLp,h_eq,z07] + exact zSg z0f ih +theorem zSa {w2 : BitWord} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact z0a w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq,z07,zLp] + exact zSg hw ih +theorem z0m : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0n : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem z0o (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d0 d0 := + zSa z0m n +theorem z0p (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ n) d0 d1 := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg zH0 (zSa z0n n) +theorem z0q (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d1 d1 := + zSa z0n n +theorem z0r (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ (1 + n)) d1 d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg zH4 (zSa z0m n) +theorem z0s (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0c z0e) (H_T n) +theorem z0t (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0d zH2) (H_T n) +theorem z0u (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0g zH2) (H_T n) +theorem z0v (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0h (H_T n) +theorem z0w (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0i (H_T n) +theorem z0x (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [zLp',List.cons_append,List.nil_append] using! zSg z0j (H_T n) +theorem z0y (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0k (zSg zH1 zH3) + have h1 := zSg h0 (zSa z0m n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using! h1 +theorem z0z (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0l (zSa z0m n) +theorem z0A : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0k zH1 +theorem z0B (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0k (zSg zH1 (zSg zH3 zH0)) + have h1 := zSg h0 (zSa z0n n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using! h1 +theorem z0C (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg [.cj,.ch] [.cp] d1 d1 := zSg z0l zH0 + have h1 := zSg h0 (zSa z0n n) + simpa only [zLp',List.cons_append,List.nil_append] using! h1 +theorem z0D (n : Nat) : Seg (([Call.ch] ^ n) ++ [.cj,.ch]) (([Call.ch] ^ (1 + n * 2)) ++ [.cj,.ch]) t t := by + have h1 : Seg (([Call.ch] ^ n) ++ [.cj,.ch]) (([Call.ch] ^ (n * 2)) ++ [.ch,.cj,.ch]) t t := + zSg (H_T n) (z0t 0) + have heq : (([Call.ch] ^ (n * 2)) ++ [.ch,.cj,.ch]) = (([Call.ch] ^ (1 + n * 2)) ++ [.cj,.ch]) := by + have h2 : 1 + n * 2 = n * 2 + 1 := by omega + rw [h2,z07,z06,List.append_assoc] + rfl + rwa [heq] at h1 +theorem z0E (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([.cj] ++ [.ch] ^ n) (d1 ++ one) d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using! zSg zH3 (z0o n) +theorem z0F (n : Nat) : Seg (([Call.ch] ^ (1 + n * 2)) ++ [.cj,.ch]) ([.cj] ++ [.ch] ^ n) (d1 ++ one) (d1 ++ one) := by + simpa only [List.append_nil] using! zSg (z0E n) z0A +theorem z0G (q : Nat) : + ∀ n,Seg (([Call.ch] ^ n) ++ [.cj,.ch]) (([Call.ch] ^ ((1 + n) * 2 ^ q - 1)) ++ [.cj,.ch]) (t ^ q) (t ^ q) := by + induction q with + | zero => + intro n + have heq : (1 + n) * 2 ^ 0 - 1 = n := by simp + rw [heq] + exact z0b _ + | succ q ih => + intro n + have h1 := zS0 (z0D n) (ih (1 + n * 2)) + have heq : (1 + (1 + n * 2)) * 2 ^ q - 1 = (1 + n) * 2 ^ (q + 1) - 1 := by + rw [Nat.pow_succ]; ring_nf + rw [heq] at h1 + exact h1 +theorem z0H : Seg [.ca] [.cj,.ch] w_pre (w_pre ++ t) := + zS5 + (mid1 := [1,0,1,1,1,1,0,1,1]) + (mid2 := [1,0,1,0,1,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs w_pre t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL w_pre t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0I (r : HalfTape) : + (zCL lh r) [target_tm]⊢⁺ (zCR lh .ca r) := by + unfold zCL zCR lh zCw zCs + simp only [append_cons,append_nil,z00] + execute +open WordCalculus Word ChoiceE +local notation "WordList" => List Word +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) +theorem loc_z2t {k : Nat} (hK : 0 < k) : ∃ hs,Num k [] hs := by + rcases even_or_odd_mul_two k with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · cases a with + | zero => omega + | succ a => + have heq : (a + 1) * 2 = 2 + a * 2 := by omega + rw [heq]; exact ⟨[.cj] ++ [.ch] ^ a,Num.even a⟩ + · exact ⟨[.cp] ++ [.ch] ^ a,Num.odd a⟩ +theorem loc_z2u {k : Nat} {hs hs' : List Call} (h1 : Num k [] hs) (h2 : Num k [] hs') : + hs = hs' := by + cases h1 with + | @odd n => + generalize hk : 1 + n * 2 = k0 at h2 + cases h2 with + | @odd m => + have hnm : n = m := by omega + subst hnm; rfl + | even _ => omega + | @even n => + generalize hk : 2 + n * 2 = k0 at h2 + cases h2 with + | odd _ => omega + | @even m => + have hnm : n = m := by omega + subst hnm; rfl +def loc_z2v (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs,Num k w hs -> Side hs (w +> r) r' +theorem loc_z2w {r r' : HalfTape} (h : loc_z2v 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl +theorem loc_z2x {n : Nat} {r r' : HalfTape} + (hI : loc_z2v (n * 2) r r') : loc_z2v (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2w hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0k (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine zSc (z0y n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using! hI [] _ hN2 +theorem loc_z2y {n : Nat} {r r' : HalfTape} + (hI : loc_z2v (n * 2) r r') : loc_z2v (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2w hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0A (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine zSc (z0B n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using! hI [] _ hN2 +theorem loc_z2z {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hZ : A = 0) : + evalWords da default = default := by + induction hD with + | nil => rfl + | @zero A H u _ ih => + have hA0 : A = 0 := by omega + rw [evalWords,ih hA0,zDd] + | one _ => omega +theorem loc_z2A {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hPos : 0 < A) : + loc_z2v ((A - 1) * 2) default (evalWords da default) := by + induction hD with + | nil => omega + | @zero A H u _ ih => + have hA_pos : 0 < A := by omega + have hIH := ih hA_pos + have hs := loc_z2x hIH + rw [zDd] at hs + have heq : (A * 2 - 1) * 2 = 2 + (A - 1) * 4 := by omega + rw [evalWords] + rwa [heq] + | @one A H u hDu ih => + cases A with + | zero => + have h_side : evalWords (Q :: u) default = one +> default := by + rw [evalWords,loc_z2z hDu rfl] + simp [d1,one] + rw [h_side] + intro w hs hN + have hk0 : (1 + 0 * 2 - 1) * 2 = 0 := rfl + rw [hk0] at hN + generalize hk : (0 : Nat) = k0 at hN + cases hN with + | zero => exact Side.nil (one +> default) + | odd _ => omega + | even _ => omega + | succ A => + have hA_pos : 0 < A + 1 := by omega + have hIH := ih hA_pos + have heq_in : (A + 1 - 1) * 2 = A * 2 := by omega + rw [heq_in] at hIH + have hs := loc_z2y hIH + rw [zDd] at hs + have heq : (1 + (A + 1) * 2 - 1) * 2 = 4 + A * 4 := by omega + rw [evalWords] + rwa [heq] +theorem zEd {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ∀ {A H : Nat},DigitVal A H v -> Seg ([Call.ch] ^ n) ([Call.ch] ^ b) (wordsToBits u) (wordsToBits v) := by + induction hI with + | nil n => + intro A H _ + exact z0b _ + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | d00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0o _) (ih hD') + | d01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0p _) (ih hD') + | d10 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0q _) (ih hD') + | d11 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0r _) (ih hD') +theorem loc_z2B {n : Nat} {hs hs' : List Call} + (hI : Num (3 + n) [] hs) (hJ : Num (2 + n * 2) [] hs') : + Seg hs ([Call.ch] ++ hs') t t := by + generalize hk1 : 3 + n = k1 at hI + generalize hk2 : 2 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = m * 2 := by omega + subst hq + rw [h1m] + exact z0s m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0t m +theorem loc_z2C {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' (d1 ++ d0) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0u m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + have hq : q = m * 2 := by omega + subst hq + exact z0v m +theorem loc_z2D {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' (d1 ++ d1) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | @odd q => + have hq : q = m * 2 := by omega + subst hq + exact z0w m + | even _ => omega + | @even m => + cases hJ with + | @odd q => + have hq : q = 1 + m * 2 := by omega + subst hq + exact z0x m + | even _ => omega +theorem loc_z2E {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 2 + q * 2 := by omega + subst hm + exact z0y q +theorem loc_z2F {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = q * 2 := by omega + subst hm + exact z0z q + | even _ => omega +theorem loc_z2G {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 3 + q * 2 := by omega + subst hm + exact z0B q +theorem loc_z2H {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = 1 + q * 2 := by omega + subst hm + exact z0C q + | even _ => omega +theorem loc_z2I {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) : + ∀ {u : WordList} {n n' : Nat} {hs hs' : List Call}, + WordEffect n u n' v -> Num k [] hs -> Num k' [] hs' -> + Seg (([Call.ch] ^ n) ++ hs) (([Call.ch] ^ n') ++ hs') (wordsToBits u) (wordsToBits w) := by + induction hI with + | nil k => + intro u n n' hs hs' hE hN hN' + cases hE + rw [loc_z2u hN hN'] + exact z0b _ + | @T m _ _ _ _ _ _ ih => + intro u0 n0 n1 hs hs' hE hN hN' + cases hE with + | T hSub => + rcases loc_z2t (by omega : 0 < 2 + m * 2) with ⟨hs0,hN0⟩ + have hIH := ih hSub hN0 hN' + have hStep := zSg (H_T n0) (loc_z2B hN hN0) + have heq : ([Call.ch] ^ (n0 * 2)) ++ ([Call.ch] ++ hs0) = ([Call.ch] ^ (1 + n0 * 2)) ++ hs0 := by + have h1 : 1 + n0 * 2 = n0 * 2 + 1 := by omega + rw [h1,z07,z06,List.append_assoc] + rw [heq] at hStep + exact zS0 hStep hIH + | @pair0 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,K] ++ u) at hE + rcases wordEffect_split_output [Q,K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD10 : DigitVal 1 2 [Q,K] := DigitVal.one (DigitVal.zero DigitVal.nil) + have hStep := zSg (zEd hL hD10) (loc_z2C hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @pair1 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,Q] ++ u) at hE + rcases wordEffect_split_output [Q,Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD11 : DigitVal 3 2 [Q,Q] := DigitVal.one (DigitVal.one DigitVal.nil) + have hStep := zSg (zEd hL hD11) (loc_z2D hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short00 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (loc_z2E hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short01 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (loc_z2F hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short10 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (loc_z2G hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short11 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (loc_z2H hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') +theorem loc_z2J {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) {u : WordList} {r r' : HalfTape} + (hE : WordEffect 0 u 0 v) (hK : 0 < k') (hC : loc_z2v k' r r') : + loc_z2v k (evalWords u r) (evalWords w r') := by + intro w0 hs hN + have hPosK : 0 < k := phaseScan_pos_of_out_pos hI hK + have hw0 : w0 = [] := by + cases hN with + | zero => omega + | odd _ => rfl + | even _ => rfl + subst hw0 + rcases loc_z2t hK with ⟨hs',hN'⟩ + have hSeg := loc_z2I hI hE hN hN' + dsimp at hSeg + have hSide := zSc hSeg (hC [] hs' hN') + rwa [wordsToBits_append_tape,wordsToBits_append_tape] at hSide +theorem loc_z2K {q : Nat} {orig out : WordList} (hS : EStep q orig out) : + loc_z2v (4 * 2 ^ q) (evalWords orig default) (evalWords out default) := by + rcases hS with ⟨eff,n,v,a0,b0,J,da,hE,hI,hPos,hDA⟩ + have hBlank : evalWords [K] default = default := by simp [evalWords,d0] + have hC : loc_z2v (n * 2) default (evalWords da default) := by + have heq : n * 2 = ((1 + n) - 1) * 2 := by omega + rw [heq] + exact loc_z2A hDA (by omega) + have hRun := loc_z2J hI hE (by omega : 0 < n * 2) hC + rwa [evalWords_append,hBlank,<- evalWords_append] at hRun +theorem loc_z2L (q : Nat) : + Seg [.cj,.ch] ([.cj] ++ [.ch] ^ (2 ^ q - 1)) (t ^ (1 + q) ++ (d1 ++ one)) (t ^ (1 + q) ++ (d1 ++ one)) := by + have hpos := pow_two_pos q + have hT := z0G (1 + q) 0 + have heq : (1 + 0) * 2 ^ (1 + q) - 1 = 1 + (2 ^ q - 1) * 2 := by + rw [pow_two_one_add]; omega + rw [heq] at hT + dsimp at hT + exact zS0 hT (z0F (2 ^ q - 1)) +theorem loc_z2M (q : Nat) : + Seg [.ca] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) + (w_pre ++ (t ^ (2 + q) ++ (d1 ++ one))) + (w_pre ++ (t ^ (2 + (q + 1)) ++ (d1 ++ one))) := by + have h1 := zS0 z0H (loc_z2L (1 + q)) + have heq1 : 1 + (1 + q) = 2 + q := by omega + have heq2 : (w_pre ++ t) ++ (t ^ (2 + q) ++ (d1 ++ one)) = w_pre ++ (t ^ (2 + (q + 1)) ++ (d1 ++ one)) := by + have h3 : 2 + (q + 1) = 1 + (2 + q) := by omega + rw [h3,zLp'] + simp only [List.append_assoc] + rw [heq1] at h1 + rwa [heq2] at h1 +theorem loc_z2N (q : Nat) {r r' : HalfTape} (hI : loc_z2v (4 * 2 ^ q) r r') : + (zCf q r) [target_tm]⊢⁺ zCf (q + 1) r' := by + have hpos := pow_two_pos q + have h_num : Num (4 * 2 ^ q) [] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) := by + have heq : 4 * 2 ^ q = 2 + (2 ^ (1 + q) - 1) * 2 := by rw [pow_two_one_add]; omega + rw [heq]; exact Num.even (2 ^ (1 + q) - 1) + have hC := hI [] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) h_num + have hS := zSc (loc_z2M q) hC + rcases hS with _ | ⟨hca,hnil⟩ + cases hnil + exact zPt (z0I _) (hca lh) +theorem loc_z2O {q : Nat} {orig out : WordList} (hS : EStep q orig out) : + (zCf q (evalWords orig default)) [target_tm]⊢⁺ zCf (q + 1) (evalWords out default) := + loc_z2N q (loc_z2K hS) +theorem loc_z2P {h : Nat} {u : WordList} {j : Nat} {v : WordList} (hR : ERounds h u j v) : + (zCf h (evalWords u default)) [target_tm]⊢* zCf j (evalWords v default) := by + induction hR with + | refl _ _ => exact ⟨0,rfl⟩ + | next hS _ ih => + rcases loc_z2O hS with ⟨n,_,hn⟩ + rcases ih with ⟨m,hm⟩ + exact ⟨n + m,zMt target_tm _ _ _ n m hn hm⟩ +def loc_z2Q : WordList := [Q,K,Q,K,K,V,K,Q,Q,Q,Q,Q,Q,Q] +abbrev CCfg := Counter.CCfg (Fin 2) (Fin 6) +abbrev CCfg.head (c : CCfg) : Fin 2 := c.cur +abbrev CCfg.left (c : CCfg) : List (Fin 2) := c.l +abbrev CCfg.right (c : CCfg) : List (Fin 2) := c.r +abbrev loc_z2R (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev loc_z2Y (c : CCfg) : Option CCfg := Counter.bstep target_tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep target_tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (loc_z2R c1) [target_tm]⊢⁺ (loc_z2R c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ +def loc_z31 : CCfg := + ⟨A,0,[],[]⟩ +def loc_z32 : CCfg := + ⟨B,0,[1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1],[1,0,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,1]⟩ +def loc_z33 : CCfg := + ⟨C,1,[0,1],[0,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,1]⟩ +set_option maxRecDepth 4000000 in +theorem loc_z34 : zCm loc_z31 1000 = some loc_z32 := by decide +set_option maxRecDepth 4000000 in +theorem loc_z35 : zCm loc_z32 49 = some loc_z33 := by decide +theorem loc_z36 : + (init []) [target_tm]⊢⁺ + (zCL lh ((w_pre ++ (t ^ 8 ++ [0,0,1,0,0,0,1])) +> default)) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = loc_z2R loc_z31 := rfl + have h_end : loc_z2R loc_z33 = zCL lh ((w_pre ++ (t ^ 8 ++ [0,0,1,0,0,0,1])) +> default) := by + unfold loc_z2R zCL lh + rw [<- append_assoc] + have h_list : [0] ++ (w_pre ++ (t ^ 8 ++ [0,0,1,0,0,0,1])) = loc_z33.right := by decide + rw [h_list] + simp only [Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,append_cons,append_nil,z00] + rfl + rw [h_init,<- h_end] + exact zPt (zTc (by decide) loc_z34) (zTc (by decide) loc_z35) +def loc_z37 : WordList := [K,Q,K,Q,K,K,K,K,K] +def loc_z38 : WordList := [Q,K,K,Q,K,K,K,K,Q] +theorem loc_z39 : + Side [.cj,.ch] (wordsToBits loc_z38 +> default) ((t ++ [0,0,1,1,0,0,0,0,1,0,0,0,0,1]) +> default) := by + refine Side.cons (r2 := [1,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1] +> default) ?_ (Side.cons ?_ (Side.nil _)) + · intro l + unfold zCR zCL zCw zCs + simp only [loc_z38,wordsToBits,d1,d0,List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute + · intro l + unfold zCR zCL zCw zCs t + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute +theorem loc_z3a : + (zCL lh ((w_pre ++ (t ^ 8 ++ [0,0,1,0,0,0,1])) +> default)) + [target_tm]⊢⁺ + (zCL lh ((w_pre ++ (t ^ 10 ++ [0,0,1,1,0,0,0,0,1,0,0,0,0,1])) +> default)) := by + have hE : WordEffect 255 loc_z37 0 loc_z38 := by + have h1 := evalEffect_sound loc_z37 255 + have h2 : evalEffect 255 loc_z37 = (0,loc_z38) := by decide + rwa [h2] at h1 + rcases exists_digitVal_of_all_isDigitWordE loc_z38 (by decide) with ⟨A,hD⟩ + have hSeg_ch := zEd hE hD + have hSide_ch := zSc hSeg_ch (Side.nil default) + have hSide_255 := z08 hSide_ch loc_z39 + have hCarry : Seg [.cj,.ch] (([Call.ch] ^ 255) ++ [.cj,.ch]) (t ^ 8) (t ^ 8) := z0G 8 0 + have hSide_t8 := zSc hCarry hSide_255 + have hSide_ca := zSc z0H hSide_t8 + rcases hSide_ca with _ | ⟨hca,hnil⟩ + cases hnil + have h_in : (w_pre +> ((t ^ 8) +> (wordsToBits loc_z37 +> default))) = + ((w_pre ++ (t ^ 8 ++ [0,0,1,0,0,0,1])) +> default) := by + simp only [loc_z37,wordsToBits,d0,d1,List.cons_append,List.nil_append,append_cons,append_nil,z00,append_assoc] + have h_out : ((w_pre ++ t) +> ((t ^ 8) +> ((t ++ [0,0,1,1,0,0,0,0,1,0,0,0,0,1]) +> default))) = + ((w_pre ++ (t ^ 10 ++ [0,0,1,1,0,0,0,0,1,0,0,0,0,1])) +> default) := by + simp only [zLp,z05,List.cons_append,List.nil_append,append_cons,append_nil,append_assoc] + rw [h_in,h_out] at hca + exact zPt (z0I _) (hca lh) +theorem loc_z3b : Seg [.ch] [] [0,1,0,0] t := + zS4 (fun l r => by unfold zCR zCL zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +def loc_z3c : WordList := [K,K,K,K,K,K,K,K] +def loc_z3d : WordList := [K,Q,Q,Q,Q,Q,Q,Q] +theorem loc_z3e : + Seg ([Call.ch] ^ 1023) ([Call.ch] ^ 254) + (d0 ++ (t ++ (d0 ++ (d1 ++ (d0 ++ [0,1,0,0]))))) + (d1 ++ (t ++ (d0 ++ (d0 ++ (d0 ++ t))))) := by + have h6 : Seg ([Call.ch] ^ 128) ([Call.ch] ^ 254) [0,1,0,0] t := by + simpa only [zLp',List.cons_append,List.nil_append] using! zSg loc_z3b (H_T 127) + exact zS0 (z0p 511) + (zS0 (H_T 511) + (zS0 (z0o 511) + (zS0 (z0r 255) + (zS0 (z0o 128) h6)))) +theorem loc_z3f : + Side [.cj,.ch] + (((d1 ++ (t ++ (d0 ++ (d0 ++ (d0 ++ t))))) ++ wordsToBits loc_z3d) +> default) + ((d1 ++ one) +> evalWords loc_z2Q default) := by + refine Side.cons (r2 := ([0,0,1,1,0,0,0,1,0] ++ ((d0 ++ (d0 ++ t)) ++ wordsToBits loc_z3d)) +> default) ?_ (Side.cons ?_ (Side.nil _)) + · intro l + unfold zCR zCL zCw zCs + simp only [loc_z3d,wordsToBits,d1,d0,t,List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute + · intro l + unfold zCR zCL zCw zCs + simp only [loc_z3d,wordsToBits,loc_z2Q,evalWords,d1,d0,t,one,List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute +theorem loc_z3g : + (zCL lh ((w_pre ++ (t ^ 10 ++ [0,0,1,1,0,0,0,0,1,0,0,0,0,1])) +> default)) + [target_tm]⊢⁺ + (zCf 9 (evalWords loc_z2Q default)) := by + have hE : WordEffect 254 loc_z3c 0 loc_z3d := by + have h1 := evalEffect_sound loc_z3c 254 + have h2 : evalEffect 254 loc_z3c = (0,loc_z3d) := by decide + rwa [h2] at h1 + rcases exists_digitVal_of_all_isDigitWordE loc_z3d (by decide) with ⟨A,hD⟩ + have hSeg_b := zEd hE hD + have hSeg_all := zS0 loc_z3e hSeg_b + have hSide_ch := zSc hSeg_all (Side.nil default) + have hSide_1023 := z08 hSide_ch loc_z3f + have hCarry : Seg [.cj,.ch] (([Call.ch] ^ 1023) ++ [.cj,.ch]) (t ^ 10) (t ^ 10) := z0G 10 0 + have hSide_t10 := zSc hCarry hSide_1023 + have hSide_ca := zSc z0H hSide_t10 + rcases hSide_ca with _ | ⟨hca,hnil⟩ + cases hnil + have h_in : (w_pre +> ((t ^ 10) +> (((d0 ++ (t ++ (d0 ++ (d1 ++ (d0 ++ [0,1,0,0]))))) ++ wordsToBits loc_z3c) +> default))) = + ((w_pre ++ (t ^ 10 ++ [0,0,1,1,0,0,0,0,1,0,0,0,0,1])) +> default) := by + simp only [loc_z3c,wordsToBits,d0,d1,t,List.cons_append,List.nil_append,append_cons,append_nil,z00,append_assoc] + have h_out : zCL lh (((w_pre ++ t) +> ((t ^ 10) +> ((d1 ++ one) +> evalWords loc_z2Q default)))) = + zCf 9 (evalWords loc_z2Q default) := by + unfold zCf + simp only [zLp,z05,List.cons_append,List.nil_append,append_cons,append_nil,append_assoc] + rw [h_in] at hca + have hStep := zPt (z0I _) (hca lh) + rwa [h_out] at hStep +theorem loc_z3h : + (init []) [target_tm]⊢⁺ zCf 9 (evalWords loc_z2Q default) := + zPt loc_z36 (zPt loc_z3a loc_z3g) +def loc_z3i : List CodeE := [ + (.More CP0 2047 (.More CP0 4093 (.More CS00 2046 (.More CT 4089 (.More CS11 2044 (.More CP1 4088 (.More CP1 8176 (.More CP1 16352 (.More CP0 32704 (.Stop 32704)))))))))), + (.More CT 4093 (.More CT 8185 (.More CS11 4092 (.More CT 8182 (.More CS00 4091 (.More CT 8179 (.More CT 16357 (.More CT 32713 (.More CT 65425 (.More CS10 32712 (.More CS10 16355 (.More CS00 8177 (.More CS00 4088 (.More CP1 8175 (.More CP1 16350 (.More CP1 32700 (.More CP1 65400 (.More CP1 130800 (.More CP0 261600 (.Stop 261600)))))))))))))))))))), + (.More CT 8189 (.More CT 16377 (.More CS10 8188 (.More CT 16373 (.More CS11 8186 (.More CT 16370 (.More CT 32739 (.More CT 65477 (.More CT 130953 (.More CS10 65476 (.More CP0 130951 (.More CS00 65475 (.More CT 130947 (.More CT 261893 (.More CT 523785 (.More CT 1047569 (.More CT 2095137 (.More CT 4190273 (.More CS10 2095136 (.More CS10 1047567 (.More CS00 523783 (.More CS00 261891 (.More CS00 130945 (.More CP1 261889 (.More CP0 523778 (.More CP1 1047555 (.More CP1 2095110 (.More CP1 4190220 (.More CP1 8380440 (.More CP0 16760880 (.Stop 16760880))))))))))))))))))))))))))))))) +] +def loc_z3j : WordList := [V,V,Q,V,Q,V,V,V,V,Q,V,K,V,V,V,V,V,V,Q,Q,K,K,K,V,V,V,V,V,V,V] +def loc_z3k : WordList := [Q,K,K,K,Q,Q,K,K,K,K,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def loc_z3l : WordList := [K,K,K,K,Q,Q,K,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +set_option maxRecDepth 4000000 in +theorem loc_z3m : + ERounds 9 loc_z2Q 12 (loc_z3j ++ loc_z3k) := by + have h1 : ERounds 9 loc_z2Q (9 + loc_z3i.length) (loc_z3j ++ loc_z3k) := by + apply evalERounds_sound loc_z3i + decide + exact h1 +set_option maxRecDepth 4000000 in +theorem loc_z3n : + EGood 12 (loc_z3j ++ loc_z3k) := by + apply eGood_of_check 12 loc_z3j loc_z3k loc_z3l + · decide + · exact EGuard.T 0 _ + · decide + · decide + · decide + · decide + · decide + · decide + · decide + · norm_num [loc_z3j,loc_z3l,wordMass,wordMassK,wordScale] +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d) = some c') : + (multiStep target_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +theorem loc_z3o (m : Nat) : + ∃ N ≥ m,∃ h w,multiStep target_tm (init []) N = some (zCf h (evalWords w default)) /\ EGood h w := by + induction m with + | zero => + rcases loc_z3h with ⟨k1,_,hk1⟩ + rcases loc_z2P loc_z3m with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,12,loc_z3j ++ loc_z3k, + zMt target_tm _ _ _ k1 k2 hk1 hk2,loc_z3n⟩ + | succ m ih => + rcases ih with ⟨N,hN,h,w,h_ms,h_good⟩ + rcases eGood_progress h_good with ⟨w',hStep,h_good'⟩ + rcases loc_z2O hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,h + 1,w', + zMt target_tm _ _ _ N k h_ms h_step_k,h_good'⟩ + +end Solution + + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases loc_z3o (n + 1) with ⟨N,hN,_,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := zIm h_N + rw [zMs,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RF diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RA0LB.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RA0LB.lean new file mode 100644 index 00000000..005eb2b8 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RA0LB.lean @@ -0,0 +1,526 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RA0LB + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RA0LB" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +-- ============================================================================ +-- Wave 25 Standalone verified Canonical Proof Library for holdout_0756 (1RB---_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC) +-- Cluster: Untouched 12/12 & 11/12 Septet IV (0220..0766) | Donor: holdout_0220 (1RB0RA_1LC0LF_1LE0LD_1LB---_1RA1LB_0LB0RC) +-- S_6 x Z_2 Isomorphism: 11/12 match | perm = (E,B,C,A,D,F) | mirror = 1 +-- Differing transition(s): D.F0=0LB vs M.F0=0RA +-- ============================================================================ + +set_option maxHeartbeats 2000000 +set_option maxRecDepth 2000 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem pow_zero_list (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +omit [Inhabited Γ] in +@[simp] +theorem list_pow_append_one (u : List (Fin 2)) (k : Nat) : + u^k ++ u = u^(k + 1) := by + have h := list_pow_add_comm u k 1 + dsimp [HPow.hPow] at h ⊢ + rw [List.append_nil] at h + exact h + +theorem pow_add_append_right (u : List (Fin 2)) (m n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (m + n)) +> r = (u ^ m) +> ((u ^ n) +> r) := by + rw [list_pow_add, ← listblank_append_append] + +theorem pow_succ_append_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (n + 1)) +> r = u +> ((u ^ n) +> r) := by + rw [pow_succ_list, ← listblank_append_append] + +theorem pow_succ_append_right' (u : List (Fin 2)) (k : Nat) (r : ListBlank (Fin 2)) : + (u ^ k) +> (u +> r) = (u ^ (k + 1)) +> r := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (m n : Nat) : + s <+ (u ^ (m + n)) = (s <+ (u ^ m)) <+ (u ^ n) := by + rw [listblank_append_append, ← list_pow_add, add_comm] + +theorem pow_succ_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k : Nat) : + (s <+ u) <+ (u ^ k) = s <+ (u ^ (k + 1)) := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add3_append_right (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) (r : ListBlank (Fin 2)) : + (u ^ (k₁ + k₂ + k₃)) +> r = (u ^ k₁) +> ((u ^ k₂) +> ((u ^ k₃) +> r)) := by + rw [pow_add_append_right u (k₁ + k₂) k₃ r, pow_add_append_right u k₁ k₂ ((u ^ k₃) +> r)] + +theorem pow_add3_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) : + s <+ (u ^ (k₁ + k₂ + k₃)) = ((s <+ (u ^ k₁)) <+ (u ^ k₂)) <+ (u ^ k₃) := by + rw [pow_add_append_left s u (k₁ + k₂) k₃, pow_add_append_left s u k₁ k₂] + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, _, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +theorem step_some {c c' : Cfg (Fin 2) (Fin 6)} (h : step target_tm c = some c') : + c [target_tm]⊢⁺ c' := ⟨1, Nat.zero_lt_one, h⟩ + +theorem stepPlus_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := step_stepStar_stepPlus h1 (stepPlus_stepStar h2) + +theorem stepStar_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢* c₃ := stepStar_trans (step_stepStar target_tm c₁ c₂ h1) h2 + +theorem stepPlus_stepStar_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢⁺ c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepPlus_stepStar_stepPlus h1 h2 + +theorem stepStar_stepPlus_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢* c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepStar_stepPlus_stepPlus h1 h2 + +theorem stepPlus_of_step {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢ c₂) : + c₁ [target_tm]⊢⁺ c₂ := step_stepPlus target_tm c₁ c₂ h + +theorem stepStar_of_stepPlus {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢⁺ c₂) : + c₁ [target_tm]⊢* c₂ := stepPlus_stepStar h + +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail]) +macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step))) +macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +theorem multiStep_step_isSome {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₀ cfg cfg' : Cfg Γ Λ) (n m : Nat) + (hn : multiStep M c₀ n = some cfg) + (hnm : multiStep M c₀ (n + (1 + m)) = some cfg') : + (step M cfg).isSome := by + rw [multiStep_add M c₀ n (1 + m), hn] at hnm + dsimp [Option.bind] at hnm + rw [multiStep_add M cfg 1 m, multiStep_one] at hnm + cases hs : step M cfg with + | none => + rw [hs] at hnm + nomatch hnm + | some c₁ => rfl + +theorem inv_reaches_beyond {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') + (N : Nat) : + ∃ (m : Nat) (cfg' : Cfg Γ Λ), multiStep M (init []) (N + m) = some cfg' ∧ Inv cfg' := by + induction N with + | zero => + obtain ⟨cfg₀, ⟨n₀, hn₀⟩, h_inv₀⟩ := h_init + refine ⟨n₀, cfg₀, ?_, h_inv₀⟩ + rwa [Nat.zero_add] + | succ N ih => + obtain ⟨m, cfg₁, hm, h_inv₁⟩ := ih + cases m with + | zero => + obtain ⟨cfg₂, ⟨k, hk_pos, hk⟩, h_inv₂⟩ := h_step cfg₁ h_inv₁ + cases k with + | zero => omega + | succ k' => + refine ⟨k', cfg₂, ?_, h_inv₂⟩ + have h_trans := multiStep_trans M (init []) cfg₁ cfg₂ N (k' + 1) hm hk + have h_eq : (N + 1) + k' = N + (k' + 1) := by omega + rwa [h_eq] + | succ m' => + refine ⟨m', cfg₁, ?_, h_inv₁⟩ + have h_eq : (N + 1) + m' = N + (m' + 1) := by omega + rwa [h_eq] + +theorem closed_inv_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') : + IsDoesNotHalt M := by + intro cfg ⟨n, hn⟩ + obtain ⟨m, cfg', hnm, _⟩ := inv_reaches_beyond M Inv h_init h_step (n + 1) + have h_eq : (n + 1) + m = n + (1 + m) := by omega + rw [h_eq] at hnm + exact multiStep_step_isSome M (init []) cfg cfg' n m hn hnm + +theorem closed_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) + (n₀ : Nat) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, ∃ n', (hub n) [M]⊢⁺ (hub n')) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hcfg⟩ + subst hcfg + obtain ⟨n', hn'⟩ := h_step n + exact ⟨hub n', hn', ⟨n', rfl⟩⟩ + +theorem closed_guarded_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) (P : Nat → Prop) + (n₀ : Nat) (h_P₀ : P n₀) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, P n → ∃ n', P n' ∧ ((hub n) [M]⊢⁺ (hub n'))) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, P n ∧ cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, h_P₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hPn, hcfg⟩ + subst hcfg + obtain ⟨n', hPn', hn'⟩ := h_step n hPn + exact ⟨hub n', hn', ⟨n', hPn', rfl⟩⟩ + +def A : Fin 6 := 4 +def B : Fin 6 := 0 +def C : Fin 6 := 1 +def D : Fin 6 := 2 +def E : Fin 6 := 3 +def F : Fin 6 := 5 +abbrev sA : Fin 6 := 4 +abbrev sB : Fin 6 := 0 +abbrev sC : Fin 6 := 1 +abbrev sD : Fin 6 := 2 +abbrev sE : Fin 6 := 3 +abbrev sF : Fin 6 := 5 +abbrev holdout_0236_tm : Machine (Fin 2) (Fin 6) := target_tm +abbrev M : Machine (Fin 2) (Fin 6) := target_tm +@[simp] theorem init_nil : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = (default {{B}}> default) := rfl + + + +-- ============================================================================ +-- ============================================================================ +-- Sweeps Transducer & Valid Tape Closure for Holdout 0673 +-- ============================================================================ + +theorem rule_B_000 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 0, 0] +> r)) [target_tm]⊢⁺ (l <{{E}} ([0, 0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_001 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 0, 1] +> r)) [target_tm]⊢⁺ ((l <+ [1, 1, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_010 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 1, 0] +> r)) [target_tm]⊢⁺ ((l <+ [1, 0, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_10 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([1, 0] +> r)) [target_tm]⊢⁺ ((l <+ [0, 0]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_111 (l r : ListBlank (Fin 2)) : + ((l <+ [1, 1, 1]) <{{E}} r) [target_tm]⊢⁺ (l <{{E}} ([0, 0, 0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_101 (l r : ListBlank (Fin 2)) : + ((l <+ [1, 0, 1]) <{{E}} r) [target_tm]⊢⁺ (l <{{E}} ([0, 1, 0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_00 (l r : ListBlank (Fin 2)) : + ((l <+ [0, 0]) <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ (l {{B}}> ([0, 1, 0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_nil (r : ListBlank (Fin 2)) : + (default <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ ((default <+ [1, 0, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +abbrev Round (r r' : ListBlank (Fin 2)) : Prop := + ∀ l : ListBlank (Fin 2), (l {{B}}> r) [target_tm]⊢⁺ (l <{{E}} r') + +inductive Sweeps : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) → Prop + | zero (r : ListBlank (Fin 2)) : Sweeps 0 r r + | succ {n : Nat} {r r₁ r₂ : ListBlank (Fin 2)} : + Round r r₁ → Sweeps n r₁ r₂ → Sweeps (n + 1) r r₂ + +theorem Sweeps.trans {a b : Nat} {r₁ r₂ r₃ : ListBlank (Fin 2)} + (h₁ : Sweeps a r₁ r₂) (h₂ : Sweeps b r₂ r₃) : Sweeps (a + b) r₁ r₃ := by + induction h₁ with + | zero _ => simpa using h₂ + | succ hr _ ih => + rw [Nat.succ_add] + exact Sweeps.succ hr (ih h₂) + +theorem sweeps_split_last {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps (n + 1) r r') : + ∃ r₁ : ListBlank (Fin 2), Sweeps n r r₁ ∧ Round r₁ r' := by + induction n generalizing r with + | zero => + cases h with + | succ hr h0 => + cases h0 with + | zero _ => exact ⟨r, Sweeps.zero r, hr⟩ + | succ m ih => + cases h with + | succ hr hs => + obtain ⟨r₁, hs₁, hr₁⟩ := ih hs + exact ⟨r₁, Sweeps.succ hr hs₁, hr₁⟩ + +theorem round_000 (r : ListBlank (Fin 2)) : + Round ([0, 0, 0] +> r) ([0, 0, 1] +> r) := + fun l => rule_B_000 l r + +theorem round_001 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 0, 1] +> r) ([0, 0, 0] +> r') := + fun l => stepPlus_trans (rule_B_001 l r) (stepPlus_trans (h (l <+ [1, 1, 1])) (rule_E_111 l r')) + +theorem round_010 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 1, 0] +> r) ([0, 1, 0] +> r') := + fun l => stepPlus_trans (rule_B_010 l r) (stepPlus_trans (h (l <+ [1, 0, 1])) (rule_E_101 l r')) + +theorem round_10 {r₁ r r₂ : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Round r r₂) : + Round ([1, 0] +> r₁) ([0, 1, 0] +> r₂) := + fun l => stepPlus_trans (rule_B_10 l r₁) + (stepPlus_trans (h₁ (l <+ [0, 0])) + (stepPlus_trans (rule_E_00 l r) (round_010 h₂ l))) + +theorem sweeps_010 {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps n r r') : + Sweeps n ([0, 1, 0] +> r) ([0, 1, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | succ hr _ ih => exact Sweeps.succ (round_010 hr) ih + +theorem sweeps_10 {n : Nat} {r₁ r r' : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Sweeps (n + 1) r r') : + Sweeps (n + 1) ([1, 0] +> r₁) ([0, 1, 0] +> r') := by + cases h₂ with + | succ hr₂ hs => + exact Sweeps.succ (round_10 h₁ hr₂) (sweeps_010 hs) + +theorem sweeps_000_even {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k) ([0, 0, 0] +> r) ([0, 0, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | @succ m r₀ r₁ r₂ hr _ ih => + have h2 : Sweeps 2 ([0, 0, 0] +> r₀) ([0, 0, 0] +> r₁) := + Sweeps.succ (round_000 r₀) (Sweeps.succ (round_001 hr) (Sweeps.zero _)) + have htr := Sweeps.trans h2 ih + rw [show 2 + 2 * m = 2 * (m + 1) by omega] at htr + exact htr + +theorem sweeps_000_odd {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k + 1) ([0, 0, 0] +> r) ([0, 0, 1] +> r') := by + have he := sweeps_000_even h + have h1 : Sweeps 1 ([0, 0, 0] +> r') ([0, 0, 1] +> r') := + Sweeps.succ (round_000 r') (Sweeps.zero _) + exact Sweeps.trans he h1 + +theorem default_eq_b000 : + (default : ListBlank (Fin 2)) = [0, 0, 0] +> default := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b000_cons_zero (r : ListBlank (Fin 2)) : + [0, 0, 0] +> ((0 : Fin 2) >> r) = (0 : Fin 2) >> ([0, 0, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +theorem b001_cons_zero (r : ListBlank (Fin 2)) : + [0, 0, 1] +> ((0 : Fin 2) >> r) = (0 : Fin 2) >> ([0, 1, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +theorem b001_default_eq : + ([0, 0, 1] +> default : ListBlank (Fin 2)) = (0 : Fin 2) >> ([0, 1, 0] +> default) := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b010_eq_zero_cons_b10 (r : ListBlank (Fin 2)) : + [0, 1, 0] +> r = (0 : Fin 2) >> ([1, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +inductive Valid : Nat → ListBlank (Fin 2) → Prop + | nil {n : Nat} (hn : n ≥ 1) : + Valid n default + | t0 {n : Nat} {r : ListBlank (Fin 2)} (hn : n ≥ 2) (hr : Valid (n / 2) r) : + Valid n ([0, 0, 0] +> r) + | t1 {n : Nat} {r : ListBlank (Fin 2)} (hn : n ≥ 1) (hr : Valid (n + 1) r) : + Valid n ([0, 1, 0] +> r) + | t2 {n : Nat} {r₁ r : ListBlank (Fin 2)} (hn : n ≥ 1) + (hround : Round r₁ ((0 : Fin 2) >> r)) (hr : Valid (n + 1) r) : + Valid n ([1, 0] +> r₁) + +theorem Valid.mono {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) {n' : Nat} (hle : n ≤ n') : + Valid n' r := by + induction h generalizing n' with + | nil hn => exact Valid.nil (by omega) + | t0 hn _ ih => exact Valid.t0 (by omega) (ih (by omega)) + | t1 hn _ ih => exact Valid.t1 (by omega) (ih (by omega)) + | t2 hn hround _ ih => exact Valid.t2 (by omega) hround (ih (by omega)) + +theorem valid_sweeps_nil : ∀ n : Nat, n ≥ 1 → + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ Sweeps n default ((0 : Fin 2) >> r') := by + intro n + induction n using Nat.strongRecOn with + | ind n ih => + intro hn + rcases ( by omega : n = 1 ∨ (n ≥ 2 ∧ n % 2 = 0) ∨ (n ≥ 2 ∧ n % 2 = 1) ) with rfl | ⟨hn2, hev⟩ | ⟨hn2, hod⟩ + · refine ⟨[0, 1, 0] +> default, Valid.t1 (by omega) (Valid.nil (by omega)), ?_⟩ + have h1 : Sweeps 1 ([0, 0, 0] +> default) ([0, 0, 1] +> default) := + Sweeps.succ (round_000 default) (Sweeps.zero _) + rw [b001_default_eq, ← default_eq_b000] at h1 + exact h1 + · obtain ⟨r', hr', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨[0, 0, 0] +> r', Valid.t0 hn2 hr', ?_⟩ + have he := sweeps_000_even hs' + rw [← default_eq_b000, b000_cons_zero, show 2 * (n / 2) = n by omega] at he + exact he + · obtain ⟨r', hr', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨[0, 1, 0] +> r', Valid.t1 (by omega) (hr'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [← default_eq_b000, b001_cons_zero, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + +theorem valid_sweeps {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) : + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ Sweeps n r ((0 : Fin 2) >> r') := by + induction h with + | @nil n hn => exact valid_sweeps_nil n hn + | @t0 n r hn hr ih => + obtain ⟨r', hr', hs'⟩ := ih + rcases ( by omega : n % 2 = 0 ∨ n % 2 = 1 ) with hev | hod + · refine ⟨[0, 0, 0] +> r', Valid.t0 hn hr', ?_⟩ + have he := sweeps_000_even hs' + rw [b000_cons_zero, show 2 * (n / 2) = n by omega] at he + exact he + · refine ⟨[0, 1, 0] +> r', Valid.t1 (by omega) (hr'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [b001_cons_zero, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + | @t1 n r hn hr ih => + obtain ⟨r', hr', hs'⟩ := ih + obtain ⟨r₁, hs₁, hr₁⟩ := sweeps_split_last hs' + refine ⟨[1, 0] +> r₁, Valid.t2 hn hr₁ hr', ?_⟩ + rw [← b010_eq_zero_cons_b10] + exact sweeps_010 hs₁ + | @t2 n r₁ r hn hround hr ih => + obtain ⟨r', hr', hs'⟩ := ih + obtain ⟨r₂, hs₂, hr₂⟩ := sweeps_split_last hs' + refine ⟨[1, 0] +> r₂, Valid.t2 hn hr₂ hr', ?_⟩ + rw [← b010_eq_zero_cons_b10] + rw [show n = (n - 1) + 1 by omega] at hs₂ ⊢ + exact sweeps_10 hround hs₂ + +theorem era_step {r : ListBlank (Fin 2)} (h : Valid 1 r) : + ∃ r' : ListBlank (Fin 2), Valid 1 r' ∧ + ((default <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ (default <{{E}} ((0 : Fin 2) >> r'))) := by + obtain ⟨r', hr', hs'⟩ := valid_sweeps (h.mono (by omega : 1 ≤ 2)) + obtain ⟨r₁, hs₁, hr₂⟩ := sweeps_split_last hs' + obtain ⟨r₀, hs₀, hr₁⟩ := sweeps_split_last hs₁ + cases hs₀ with + | zero _ => + refine ⟨[1, 0] +> r₁, Valid.t2 (by omega) hr₂ hr', ?_⟩ + have s1 := rule_E_nil r + have s2 := hr₁ (default <+ [1, 0, 1]) + have s3 := rule_E_101 default r₁ + rw [← b010_eq_zero_cons_b10] + exact stepPlus_trans s1 (stepPlus_trans s2 s3) + +def era0_r : ListBlank (Fin 2) := + [0, 1, 0] +> default + +theorem init_reaches_era0 : + (init []) [target_tm]⊢* (default <{{E}} ((0 : Fin 2) >> era0_r)) := by + apply stepPlus_stepStar + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{B}}> default) := rfl + rw [h_init] + dsimp [era0_r, ListBlank.append] + execute + +theorem valid_era0 : Valid 1 era0_r := + Valid.t1 (by omega) (Valid.nil (by omega)) + +theorem holdout_0236_nonhalt : IsDoesNotHalt holdout_0236_tm := by + refine closed_inv_does_not_halt target_tm + (fun cfg => ∃ r : ListBlank (Fin 2), Valid 1 r ∧ cfg = (default <{{E}} ((0 : Fin 2) >> r))) + ⟨default <{{E}} ((0 : Fin 2) >> era0_r), init_reaches_era0, ⟨era0_r, valid_era0, rfl⟩⟩ ?_ + intro cfg ⟨r, hr, hcfg⟩ + subst hcfg + obtain ⟨r', hr', hstep⟩ := era_step hr + exact ⟨default <{{E}} ((0 : Fin 2) >> r'), hstep, ⟨r', hr', rfl⟩⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := + holdout_0236_nonhalt + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RA0LB diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RE0LB.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RE0LB.lean new file mode 100644 index 00000000..c7a57547 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RE0LB.lean @@ -0,0 +1,49 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RE0LB + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RE0LB" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +def stateMap_m0693 : Fin 6 → Fin 6 + | 0 => 3 + | 1 => 0 + | 2 => 1 + | 3 => 4 + | 4 => 2 + | 5 => 5 + +public section + +theorem is_not_halt : IsNotHalt target := by + exact Counter.does_not_halt_of_conj_stem + (M_tgt := target) + (M_src := BusyBeaver.M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC.target) + (σ := stateMap_m0693) (f := true) + (c₁ := (default : ListBlank (Fin 2)) {{1}}> default) + (by decide) (Counter.init_reaches_conjCfg_default rfl) + BusyBeaver.M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC.is_not_halt_from_0446 + +end + +end BusyBeaver.M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RE0LB diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RF_1RC1RF_1LD0RE_HHH0LE_1LA0LE_0RA0LC.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RF_1RC1RF_1LD0RE_HHH0LE_1LA0LE_0RA0LC.lean new file mode 100644 index 00000000..647f287e --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RF_1RC1RF_1LD0RE_HHH0LE_1LA0LE_0RA0LC.lean @@ -0,0 +1,49 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RB0RF_1RC1RF_1LD0RE_HHH0LE_1LA0LE_0RA0LC + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1RC1RF_1LD0RE_HHH0LE_1LA0LE_0RA0LC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +def stateMap_m0471 : Fin 6 → Fin 6 + | 0 => 4 -- m0471 state A + | 1 => 0 -- m0471 state B + | 2 => 1 -- m0471 state C + | 3 => 5 -- m0471 state D + | 4 => 2 -- m0471 state E + | 5 => 3 -- m0471 state F + +public section + +theorem is_not_halt : IsNotHalt target := by + exact Counter.does_not_halt_of_conj_stem + (M_tgt := target) + (M_src := BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA.target) + (σ := stateMap_m0471) (f := true) + (c₁ := (default : ListBlank (Fin 2)) {{1}}> default) + (by decide) (Counter.init_reaches_conjCfg_default rfl) + BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA.is_not_halt_from_0471 + +end + +end BusyBeaver.M_1RB0RF_1RC1RF_1LD0RE_HHH0LE_1LA0LE_0RA0LC diff --git a/BusyBeaver/BB6/NonHalt/M_1RB0RF_1RC1RF_1LD1RA_HHH0LE_1LA0LE_0RA0LC.lean b/BusyBeaver/BB6/NonHalt/M_1RB0RF_1RC1RF_1LD1RA_HHH0LE_1LA0LE_0RA0LC.lean new file mode 100644 index 00000000..9cb38bdb --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB0RF_1RC1RF_1LD1RA_HHH0LE_1LA0LE_0RA0LC.lean @@ -0,0 +1,511 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB0RF_1RC1RF_1LD1RA_HHH0LE_1LA0LE_0RA0LC + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1RC1RF_1LD1RA_HHH0LE_1LA0LE_0RA0LC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +-- ============================================================================ +-- Wave 25 Standalone verified Canonical Proof Library for holdout_0756 (1RB---_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC) +-- Cluster: Untouched 12/12 & 11/12 Septet IV (0220..0766) | Donor: holdout_0220 (1RB0RA_1LC0LF_1LE0LD_1LB---_1RA1LB_0LB0RC) +-- S_6 x Z_2 Isomorphism: 11/12 match | perm = (E,B,C,A,D,F) | mirror = 1 +-- Differing transition(s): D.F0=0LB vs M.F0=0RA +-- ============================================================================ + +set_option maxHeartbeats 2000000 +set_option maxRecDepth 2000 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem pow_zero_list (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +omit [Inhabited Γ] in +@[simp] +theorem list_pow_append_one (u : List (Fin 2)) (k : Nat) : + u^k ++ u = u^(k + 1) := by + have h := list_pow_add_comm u k 1 + dsimp [HPow.hPow] at h ⊢ + rw [List.append_nil] at h + exact h + +theorem pow_add_append_right (u : List (Fin 2)) (m n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (m + n)) +> r = (u ^ m) +> ((u ^ n) +> r) := by + rw [list_pow_add, ← listblank_append_append] + +theorem pow_succ_append_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (n + 1)) +> r = u +> ((u ^ n) +> r) := by + rw [pow_succ_list, ← listblank_append_append] + +theorem pow_succ_append_right' (u : List (Fin 2)) (k : Nat) (r : ListBlank (Fin 2)) : + (u ^ k) +> (u +> r) = (u ^ (k + 1)) +> r := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (m n : Nat) : + s <+ (u ^ (m + n)) = (s <+ (u ^ m)) <+ (u ^ n) := by + rw [listblank_append_append, ← list_pow_add, add_comm] + +theorem pow_succ_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k : Nat) : + (s <+ u) <+ (u ^ k) = s <+ (u ^ (k + 1)) := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add3_append_right (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) (r : ListBlank (Fin 2)) : + (u ^ (k₁ + k₂ + k₃)) +> r = (u ^ k₁) +> ((u ^ k₂) +> ((u ^ k₃) +> r)) := by + rw [pow_add_append_right u (k₁ + k₂) k₃ r, pow_add_append_right u k₁ k₂ ((u ^ k₃) +> r)] + +theorem pow_add3_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) : + s <+ (u ^ (k₁ + k₂ + k₃)) = ((s <+ (u ^ k₁)) <+ (u ^ k₂)) <+ (u ^ k₃) := by + rw [pow_add_append_left s u (k₁ + k₂) k₃, pow_add_append_left s u k₁ k₂] + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, _, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +theorem step_some {c c' : Cfg (Fin 2) (Fin 6)} (h : step target_tm c = some c') : + c [target_tm]⊢⁺ c' := ⟨1, Nat.zero_lt_one, h⟩ + +theorem stepPlus_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := step_stepStar_stepPlus h1 (stepPlus_stepStar h2) + +theorem stepStar_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢* c₃ := stepStar_trans (step_stepStar target_tm c₁ c₂ h1) h2 + +theorem stepPlus_stepStar_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢⁺ c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepPlus_stepStar_stepPlus h1 h2 + +theorem stepStar_stepPlus_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢* c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepStar_stepPlus_stepPlus h1 h2 + +theorem stepPlus_of_step {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢ c₂) : + c₁ [target_tm]⊢⁺ c₂ := step_stepPlus target_tm c₁ c₂ h + +theorem stepStar_of_stepPlus {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢⁺ c₂) : + c₁ [target_tm]⊢* c₂ := stepPlus_stepStar h + +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail]) +macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step))) +macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +theorem multiStep_step_isSome {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₀ cfg cfg' : Cfg Γ Λ) (n m : Nat) + (hn : multiStep M c₀ n = some cfg) + (hnm : multiStep M c₀ (n + (1 + m)) = some cfg') : + (step M cfg).isSome := by + rw [multiStep_add M c₀ n (1 + m), hn] at hnm + dsimp [Option.bind] at hnm + rw [multiStep_add M cfg 1 m, multiStep_one] at hnm + cases hs : step M cfg with + | none => + rw [hs] at hnm + nomatch hnm + | some c₁ => rfl + +theorem inv_reaches_beyond {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') + (N : Nat) : + ∃ (m : Nat) (cfg' : Cfg Γ Λ), multiStep M (init []) (N + m) = some cfg' ∧ Inv cfg' := by + induction N with + | zero => + obtain ⟨cfg₀, ⟨n₀, hn₀⟩, h_inv₀⟩ := h_init + refine ⟨n₀, cfg₀, ?_, h_inv₀⟩ + rwa [Nat.zero_add] + | succ N ih => + obtain ⟨m, cfg₁, hm, h_inv₁⟩ := ih + cases m with + | zero => + obtain ⟨cfg₂, ⟨k, hk_pos, hk⟩, h_inv₂⟩ := h_step cfg₁ h_inv₁ + cases k with + | zero => omega + | succ k' => + refine ⟨k', cfg₂, ?_, h_inv₂⟩ + have h_trans := multiStep_trans M (init []) cfg₁ cfg₂ N (k' + 1) hm hk + have h_eq : (N + 1) + k' = N + (k' + 1) := by omega + rwa [h_eq] + | succ m' => + refine ⟨m', cfg₁, ?_, h_inv₁⟩ + have h_eq : (N + 1) + m' = N + (m' + 1) := by omega + rwa [h_eq] + +theorem closed_inv_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') : + IsDoesNotHalt M := by + intro cfg ⟨n, hn⟩ + obtain ⟨m, cfg', hnm, _⟩ := inv_reaches_beyond M Inv h_init h_step (n + 1) + have h_eq : (n + 1) + m = n + (1 + m) := by omega + rw [h_eq] at hnm + exact multiStep_step_isSome M (init []) cfg cfg' n m hn hnm + +theorem closed_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) + (n₀ : Nat) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, ∃ n', (hub n) [M]⊢⁺ (hub n')) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hcfg⟩ + subst hcfg + obtain ⟨n', hn'⟩ := h_step n + exact ⟨hub n', hn', ⟨n', rfl⟩⟩ + +theorem closed_guarded_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) (P : Nat → Prop) + (n₀ : Nat) (h_P₀ : P n₀) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, P n → ∃ n', P n' ∧ ((hub n) [M]⊢⁺ (hub n'))) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, P n ∧ cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, h_P₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hPn, hcfg⟩ + subst hcfg + obtain ⟨n', hPn', hn'⟩ := h_step n hPn + exact ⟨hub n', hn', ⟨n', hPn', rfl⟩⟩ + + +def QINIT : Fin 6 := 0 +def B : Fin 6 := 0 +def E : Fin 6 := 4 +abbrev holdout_0712_tm : Machine (Fin 2) (Fin 6) := target_tm +abbrev M : Machine (Fin 2) (Fin 6) := target_tm + +theorem rule_B_000 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 0, 0] +> r)) [target_tm]⊢⁺ (l <{{E}} ([0, 0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_001 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 0, 1] +> r)) [target_tm]⊢⁺ ((l <+ [1, 1, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_010 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 1, 0] +> r)) [target_tm]⊢⁺ ((l <+ [0, 1, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_10 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([1, 0] +> r)) [target_tm]⊢⁺ ((l <+ [0, 0]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_111 (l r : ListBlank (Fin 2)) : + ((l <+ [1, 1, 1]) <{{E}} r) [target_tm]⊢⁺ (l <{{E}} ([0, 0, 0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_011 (l r : ListBlank (Fin 2)) : + ((l <+ [0, 1, 1]) <{{E}} r) [target_tm]⊢⁺ (l <{{E}} ([0, 1, 0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_00 (l r : ListBlank (Fin 2)) : + ((l <+ [0, 0]) <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ ((l <+ [0, 1, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_nil (r : ListBlank (Fin 2)) : + (default <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ ((default <+ [0, 1, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +abbrev Round (r r' : ListBlank (Fin 2)) : Prop := + ∀ l : ListBlank (Fin 2), (l {{B}}> r) [target_tm]⊢⁺ (l <{{E}} r') + +inductive Sweeps : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) → Prop + | zero (r : ListBlank (Fin 2)) : Sweeps 0 r r + | succ {n : Nat} {r r₁ r₂ : ListBlank (Fin 2)} : + Round r r₁ → Sweeps n r₁ r₂ → Sweeps (n + 1) r r₂ + +theorem Sweeps.trans {a b : Nat} {r₁ r₂ r₃ : ListBlank (Fin 2)} + (h₁ : Sweeps a r₁ r₂) (h₂ : Sweeps b r₂ r₃) : Sweeps (a + b) r₁ r₃ := by + induction h₁ with + | zero _ => simpa using h₂ + | succ hr _ ih => + rw [Nat.succ_add] + exact Sweeps.succ hr (ih h₂) + +theorem sweeps_split_last {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps (n + 1) r r') : + ∃ r₁ : ListBlank (Fin 2), Sweeps n r r₁ ∧ Round r₁ r' := by + induction n generalizing r with + | zero => + cases h with + | succ hr h0 => + cases h0 with + | zero _ => exact ⟨r, Sweeps.zero r, hr⟩ + | succ m ih => + cases h with + | succ hr hs => + obtain ⟨r₁, hs₁, hr₁⟩ := ih hs + exact ⟨r₁, Sweeps.succ hr hs₁, hr₁⟩ + +theorem round_000 (r : ListBlank (Fin 2)) : + Round ([0, 0, 0] +> r) ([0, 0, 1] +> r) := + fun l => rule_B_000 l r + +theorem round_001 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 0, 1] +> r) ([0, 0, 0] +> r') := + fun l => stepPlus_trans (rule_B_001 l r) (stepPlus_trans (h (l <+ [1, 1, 1])) (rule_E_111 l r')) + +theorem round_010 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 1, 0] +> r) ([0, 1, 0] +> r') := + fun l => stepPlus_trans (rule_B_010 l r) (stepPlus_trans (h (l <+ [0, 1, 1])) (rule_E_011 l r')) + +theorem round_10 {r₁ r r₂ : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Round r r₂) : + Round ([1, 0] +> r₁) ([0, 1, 0] +> r₂) := + fun l => stepPlus_trans (rule_B_10 l r₁) + (stepPlus_trans (h₁ (l <+ [0, 0])) + (stepPlus_trans (rule_E_00 l r) + (stepPlus_trans (h₂ (l <+ [0, 1, 1])) (rule_E_011 l r₂)))) + +theorem sweeps_010 {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps n r r') : + Sweeps n ([0, 1, 0] +> r) ([0, 1, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | succ hr _ ih => exact Sweeps.succ (round_010 hr) ih + +theorem sweeps_10 {n : Nat} {r₁ r r' : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Sweeps (n + 1) r r') : + Sweeps (n + 1) ([1, 0] +> r₁) ([0, 1, 0] +> r') := by + cases h₂ with + | succ hr₂ hs => + exact Sweeps.succ (round_10 h₁ hr₂) (sweeps_010 hs) + +theorem sweeps_000_even {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k) ([0, 0, 0] +> r) ([0, 0, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | @succ m r₀ r₁ r₂ hr _ ih => + have h2 : Sweeps 2 ([0, 0, 0] +> r₀) ([0, 0, 0] +> r₁) := + Sweeps.succ (round_000 r₀) (Sweeps.succ (round_001 hr) (Sweeps.zero _)) + have htr := Sweeps.trans h2 ih + rw [show 2 + 2 * m = 2 * (m + 1) by omega] at htr + exact htr + +theorem sweeps_000_odd {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k + 1) ([0, 0, 0] +> r) ([0, 0, 1] +> r') := by + have he := sweeps_000_even h + have h1 : Sweeps 1 ([0, 0, 0] +> r') ([0, 0, 1] +> r') := + Sweeps.succ (round_000 r') (Sweeps.zero _) + exact Sweeps.trans he h1 + +theorem default_eq_b000 : + (default : ListBlank (Fin 2)) = [0, 0, 0] +> default := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b000_cons_zero (r : ListBlank (Fin 2)) : + [0, 0, 0] +> ((0 : Fin 2) >> r) = (0 : Fin 2) >> ([0, 0, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +theorem b001_cons_zero (r : ListBlank (Fin 2)) : + [0, 0, 1] +> ((0 : Fin 2) >> r) = (0 : Fin 2) >> ([0, 1, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +theorem b001_default_eq : + ([0, 0, 1] +> default : ListBlank (Fin 2)) = (0 : Fin 2) >> ([0, 1, 0] +> default) := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b010_eq_zero_cons_b10 (r : ListBlank (Fin 2)) : + [0, 1, 0] +> r = (0 : Fin 2) >> ([1, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +inductive Valid : Nat → ListBlank (Fin 2) → Prop + | nil {n : Nat} (hn : n ≥ 1) : + Valid n default + | t0 {n : Nat} {r : ListBlank (Fin 2)} (hn : n ≥ 2) (hr : Valid (n / 2) r) : + Valid n ([0, 0, 0] +> r) + | t1 {n : Nat} {r : ListBlank (Fin 2)} (hn : n ≥ 1) (hr : Valid (n + 1) r) : + Valid n ([0, 1, 0] +> r) + | t2 {n : Nat} {r₁ r : ListBlank (Fin 2)} (hn : n ≥ 1) + (hround : Round r₁ ((0 : Fin 2) >> r)) (hr : Valid (n + 1) r) : + Valid n ([1, 0] +> r₁) + +theorem Valid.mono {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) {n' : Nat} (hle : n ≤ n') : + Valid n' r := by + induction h generalizing n' with + | nil hn => exact Valid.nil (by omega) + | t0 hn _ ih => exact Valid.t0 (by omega) (ih (by omega)) + | t1 hn _ ih => exact Valid.t1 (by omega) (ih (by omega)) + | t2 hn hround _ ih => exact Valid.t2 (by omega) hround (ih (by omega)) + +theorem valid_sweeps_nil : ∀ n : Nat, n ≥ 1 → + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ Sweeps n default ((0 : Fin 2) >> r') := by + intro n + induction n using Nat.strongRecOn with + | ind n ih => + intro hn + rcases ( by omega : n = 1 ∨ (n ≥ 2 ∧ n % 2 = 0) ∨ (n ≥ 2 ∧ n % 2 = 1) ) with rfl | ⟨hn2, hev⟩ | ⟨hn2, hod⟩ + · refine ⟨[0, 1, 0] +> default, Valid.t1 (by omega) (Valid.nil (by omega)), ?_⟩ + have h1 : Sweeps 1 ([0, 0, 0] +> default) ([0, 0, 1] +> default) := + Sweeps.succ (round_000 default) (Sweeps.zero _) + rw [b001_default_eq, ← default_eq_b000] at h1 + exact h1 + · obtain ⟨r', hr', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨[0, 0, 0] +> r', Valid.t0 hn2 hr', ?_⟩ + have he := sweeps_000_even hs' + rw [← default_eq_b000, b000_cons_zero, show 2 * (n / 2) = n by omega] at he + exact he + · obtain ⟨r', hr', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨[0, 1, 0] +> r', Valid.t1 (by omega) (hr'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [← default_eq_b000, b001_cons_zero, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + +theorem valid_sweeps {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) : + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ Sweeps n r ((0 : Fin 2) >> r') := by + induction h with + | @nil n hn => exact valid_sweeps_nil n hn + | @t0 n r hn hr ih => + obtain ⟨r', hr', hs'⟩ := ih + rcases ( by omega : n % 2 = 0 ∨ n % 2 = 1 ) with hev | hod + · refine ⟨[0, 0, 0] +> r', Valid.t0 hn hr', ?_⟩ + have he := sweeps_000_even hs' + rw [b000_cons_zero, show 2 * (n / 2) = n by omega] at he + exact he + · refine ⟨[0, 1, 0] +> r', Valid.t1 (by omega) (hr'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [b001_cons_zero, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + | @t1 n r hn hr ih => + obtain ⟨r', hr', hs'⟩ := ih + obtain ⟨r₁, hs₁, hr₁⟩ := sweeps_split_last hs' + refine ⟨[1, 0] +> r₁, Valid.t2 hn hr₁ hr', ?_⟩ + rw [← b010_eq_zero_cons_b10] + exact sweeps_010 hs₁ + | @t2 n r₁ r hn hround hr ih => + obtain ⟨r', hr', hs'⟩ := ih + obtain ⟨r₂, hs₂, hr₂⟩ := sweeps_split_last hs' + refine ⟨[1, 0] +> r₂, Valid.t2 hn hr₂ hr', ?_⟩ + rw [← b010_eq_zero_cons_b10] + rw [show n = (n - 1) + 1 by omega] at hs₂ ⊢ + exact sweeps_10 hround hs₂ + +theorem era_step {r : ListBlank (Fin 2)} (h : Valid 1 r) : + ∃ r' : ListBlank (Fin 2), Valid 1 r' ∧ + ((default <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ (default <{{E}} ((0 : Fin 2) >> r'))) := by + obtain ⟨r', hr', hs'⟩ := valid_sweeps (h.mono (by omega : 1 ≤ 2)) + obtain ⟨r₁, hs₁, hr₂⟩ := sweeps_split_last hs' + obtain ⟨r₀, hs₀, hr₁⟩ := sweeps_split_last hs₁ + cases hs₀ with + | zero _ => + refine ⟨[1, 0] +> r₁, Valid.t2 (by omega) hr₂ hr', ?_⟩ + have s1 := rule_E_nil r + have s2 := hr₁ (default <+ [0, 1, 1]) + have s3 := rule_E_011 default r₁ + rw [← b010_eq_zero_cons_b10] + exact stepPlus_trans s1 (stepPlus_trans s2 s3) + +def era0_r : ListBlank (Fin 2) := + [0, 1, 0] +> default + +theorem init_reaches_era0 : + (init []) [target_tm]⊢* (default <{{E}} ((0 : Fin 2) >> era0_r)) := by + apply stepPlus_stepStar + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{QINIT}}> default) := rfl + rw [h_init] + dsimp [era0_r, ListBlank.append] + execute + +theorem valid_era0 : Valid 1 era0_r := + Valid.t1 (by omega) (Valid.nil (by omega)) + +theorem holdout_0712_nonhalt : IsDoesNotHalt holdout_0712_tm := by + refine closed_inv_does_not_halt target_tm + (fun cfg => ∃ r : ListBlank (Fin 2), Valid 1 r ∧ cfg = (default <{{E}} ((0 : Fin 2) >> r))) + ⟨default <{{E}} ((0 : Fin 2) >> era0_r), init_reaches_era0, ⟨era0_r, valid_era0, rfl⟩⟩ ?_ + intro cfg ⟨r, hr, hcfg⟩ + subst hcfg + obtain ⟨r', hr', hstep⟩ := era_step hr + exact ⟨default <{{E}} ((0 : Fin 2) >> r'), hstep, ⟨r', hr', rfl⟩⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := + holdout_0712_nonhalt + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB0RF_1RC1RF_1LD1RA_HHH0LE_1LA0LE_0RA0LC diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LA_0RC0RD_1LC1LA_1RE1RD_1LF0LA_HHH0LE.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LA_0RC0RD_1LC1LA_1RE1RD_1LF0LA_HHH0LE.lean new file mode 100644 index 00000000..410d91e7 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LA_0RC0RD_1LC1LA_1RE1RD_1LF0LA_HHH0LE.lean @@ -0,0 +1,6806 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1LA_0RC0RD_1LC1LA_1RE1RD_1LF0LA_HHH0LE + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LA_0RC0RD_1LC1LA_1RE1RD_1LF0LA_HHH0LE" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {zG_ zL_ α β γ : Type*} [Inhabited zG_] [Inhabited zL_] +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +set_option maxHeartbeats 8000000 +set_option maxRecDepth 4000000 +namespace Prefix +def mass (xs : List ℕ) : ℕ:=xs.foldr (· + ·) 0 +@[simp] theorem mass_nil : mass []=0:=rfl +@[simp] theorem mass_cons (x : ℕ) (xs : List ℕ) : mass (x :: xs)=x + mass xs:=rfl +theorem mass_append (xs ys : List ℕ) : mass (xs ++ ys)=mass xs + mass ys:= by + induction xs with + | nil => simp + | cons x xs ih => simp [ih,Nat.add_assoc] +inductive Step : ℕ → List ℕ → List ℕ → Prop where + | E (n v w : ℕ) (r : List ℕ) : Step 1 ((2 * n) :: v :: w :: r) ((2 * n + v + w + 3) :: r) + | O (n v w : ℕ) (r : List ℕ) : 1 ≤ n + v → + Step 0 ((2 * n + 1) :: v :: w :: r) ((n + v - 1) :: 0 :: 1 :: (w + n + 1) :: r) +inductive Run : ℕ → List ℕ → List ℕ → Prop where + | refl (xs : List ℕ) : Run 0 xs xs + | cons {e f : ℕ} {xs ys zs : List ℕ} : Step e xs ys → Run f ys zs → Run (e + f) xs zs +theorem one {e : ℕ} {xs ys : List ℕ} (h : Step e xs ys) : Run e xs ys:= by + simpa using! Run.cons h (Run.refl ys) +theorem trans {e f : ℕ} {xs ys zs : List ℕ} (h1 : Run e xs ys) (h2 : Run f ys zs) : + Run (e + f) xs zs:= by + induction h1 with + | refl _ => simpa using! h2 + | cons hs _ ih => + rw [Nat.add_assoc] + exact Run.cons hs (ih h2) +theorem step_app {e : ℕ} {xs ys : List ℕ} (r : List ℕ) (h : Step e xs ys) : + Step e (xs ++ r) (ys ++ r):= by + cases h with + | E n v w r0 => exact Step.E n v w (r0 ++ r) + | O n v w r0 hle => exact Step.O n v w (r0 ++ r) hle +theorem app {e : ℕ} {xs ys : List ℕ} (r : List ℕ) (h : Run e xs ys) : + Run e (xs ++ r) (ys ++ r):= by + induction h with + | refl _ => exact Run.refl _ + | cons hs _ ih => exact Run.cons (step_app r hs) ih +theorem step_mass {e : ℕ} {xs ys : List ℕ} (h : Step e xs ys) : + mass ys=mass xs + 3 * e:= by + cases h <;> simp [mass] <;> omega +theorem step_length {e : ℕ} {xs ys : List ℕ} (h : Step e xs ys) : + xs.length ≤ ys.length + 2 * e:= by + cases h <;> simp <;> omega +theorem run_length {e : ℕ} {xs ys : List ℕ} (h : Run e xs ys) : + xs.length ≤ ys.length + 2 * e:= by + induction h with + | refl _ => omega + | cons hs _ ih => + have hl:=step_length hs + omega +theorem qaS {α : Type*} : ∀ (l : List α),l ≠ [] → ∃ p z,l=p ++ [z] + | [],h => absurd rfl h + | [x],_ => ⟨[],x,rfl⟩ + | x :: y :: r,_ => by + rcases qaS (y :: r) (by simp) with ⟨p,z,hp⟩ + exact ⟨x :: p,z,by simp [hp]⟩ +theorem qN {α : Type*} {p1 p2 : List α} {z1 z2 : α} + (h : p1 ++ [z1]=p2 ++ [z2]) : p1=p2 ∧ z1=z2:= by + have h1:=List.append_inj_left' h rfl + have h2:=List.append_inj_right' h rfl + exact ⟨h1,by simpa using! h2⟩ +theorem step_last {e : ℕ} {xs ys : List ℕ} (h : Step e xs ys) : + ∀ p z,xs=p ++ [z] → + ∃ q d,ys=q ++ [z + d] ∧ ∀ z',Step e (p ++ [z']) (q ++ [z' + d]):= by + cases h with + | E n v w r => + intro p z hx + cases r with + | nil => + have hx' : [2 * n,v] ++ [w]=p ++ [z]:=hx + rcases qN hx' with ⟨rfl,rfl⟩ + refine ⟨[],2 * n + v + 3,?_,?_⟩ + · simp; omega + · intro z' + have hstep:=Step.E n v z' [] + have heq : 2 * n + v + z' + 3=z' + (2 * n + v + 3):= by omega + simpa [heq] using! hstep + | cons h0 r0 => + rcases qaS (h0 :: r0) (by simp) with ⟨p0,z0,hr0⟩ + rw [hr0] at hx ⊢ + have hx' : (2 * n :: v :: w :: p0) ++ [z0]=p ++ [z]:=hx + rcases qN hx' with ⟨rfl,rfl⟩ + refine ⟨(2 * n + v + w + 3) :: p0,0,?_,?_⟩ + · simp + · intro z' + simpa using! Step.E n v w (p0 ++ [z']) + | O n v w r hsafe => + intro p z hx + cases r with + | nil => + have hx' : [2 * n + 1,v] ++ [w]=p ++ [z]:=hx + rcases qN hx' with ⟨rfl,rfl⟩ + refine ⟨[n + v - 1,0,1],n + 1,?_,?_⟩ + · simp; omega + · intro z' + have hstep:=Step.O n v z' [] hsafe + have heq : z' + n + 1=z' + (n + 1):= by omega + simpa [heq] using! hstep + | cons h0 r0 => + rcases qaS (h0 :: r0) (by simp) with ⟨p0,z0,hr0⟩ + rw [hr0] at hx ⊢ + have hx' : ((2 * n + 1) :: v :: w :: p0) ++ [z0]=p ++ [z]:=hx + rcases qN hx' with ⟨rfl,rfl⟩ + refine ⟨(n + v - 1) :: 0 :: 1 :: (w + n + 1) :: p0,0,?_,?_⟩ + · simp + · intro z' + simpa using! Step.O n v w (p0 ++ [z']) hsafe +theorem run_last {e : ℕ} {xs ys : List ℕ} (h : Run e xs ys) : + ∀ p z,xs=p ++ [z] → + ∃ q d,ys=q ++ [z + d] ∧ ∀ z',Run e (p ++ [z']) (q ++ [z' + d]):= by + induction h with + | refl xs => + intro p z hx + refine ⟨p,0,by simpa using! hx,fun z' => by simpa using! Run.refl (p ++ [z'])⟩ + | cons hs hr ih => + intro p z hx + rcases step_last hs p z hx with ⟨p1,d1,hy,hstep⟩ + rcases ih p1 (z + d1) hy with ⟨p2,d2,hz,hrun⟩ + refine ⟨p2,d1 + d2,by simpa [Nat.add_assoc] using! hz,fun z' => ?_⟩ + rw [← Nat.add_assoc] + exact Run.cons (hstep z') (hrun (z' + d1)) +def geometric : ℕ → ℕ → List ℕ + | 0,_ => [] + | k + 1,q => q :: geometric k (2 * q) +def F (k q : ℕ) : List ℕ:=(q + 1) :: geometric k q +def G (k q : ℕ) : List ℕ := + match k with + | 0 => [q] + | k + 1 => F k q ++ [2 ^ k * q - 1] +theorem qY (k q : ℕ) : geometric (k + 1) q=geometric k q ++ [2 ^ k * q]:= by + induction k generalizing q with + | zero => simp [geometric] + | succ k ih => + conv_lhs => rw [geometric]; rw [ih (2 * q)] + conv_rhs => rw [geometric] + simp only [List.cons_append,List.cons.injEq,true_and] + congr 2 + rw [Nat.pow_succ] + ring +theorem qY' (k q : ℕ) : geometric (1 + k) q=geometric k q ++ [2 ^ k * q]:= by + rw [Nat.add_comm 1 k,qY] +theorem geometric_length (k q : ℕ) : (geometric k q).length=k:= by + induction k generalizing q with + | zero => rfl + | succ k ih => simp [geometric,ih] +theorem F_snoc (k q : ℕ) : F (1 + k) q=F k q ++ [2 ^ k * q]:= by + simp [F,qY'] +theorem F_to_G {e k q : ℕ} {ys : List ℕ} {a : ℕ} (hq : 0 < q) + (h : Run e (F (1 + k) q) (ys ++ [1 + a])) : + Run e (G (1 + k) q) (ys ++ [a]):= by + rcases run_last h (F k q) (2 ^ k * q) (F_snoc k q) with ⟨p,d,he,hr⟩ + rcases qN he with ⟨rfl,ha⟩ + have hpow : 0 < 2 ^ k:=Nat.pos_of_ne_zero (by positivity) + have hpos : 1 ≤ 2 ^ k * q:=Nat.mul_pos hpow hq + have h1:=hr (2 ^ k * q - 1) + have heq : 2 ^ k * q - 1 + d=a:= by omega + have hg : G (1 + k) q=F k q ++ [2 ^ k * q - 1]:= by + rw [Nat.add_comm 1 k]; rfl + rw [hg,← heq] + exact h1 +theorem odd_descent (k t w : ℕ) (r : List ℕ) : + Run 1 ((2 ^ k * (3 + 2 * t) - 3) :: 0 :: 1 :: w :: r) + ((4 + 2 * t) :: geometric k (3 + 2 * t) ++ w :: r):= by + induction k generalizing w r with + | zero => + simp only [Nat.pow_zero,Nat.one_mul,Nat.add_sub_cancel_left,geometric,List.nil_append] + have hstep:=Step.E t 0 1 (w :: r) + have h1 : 2 * t + 0 + 1 + 3=4 + 2 * t:= by omega + simpa [h1] using! one hstep + | succ k ih => + have hpow : 1 ≤ 2 ^ k:=Nat.one_le_pow k 2 (by decide) + have hp : 3 ≤ 2 ^ k * (3 + 2 * t):= by nlinarith + simp only [qY,List.append_assoc,List.cons_append,List.nil_append] + have h0 : Step 0 ((2 ^ (k + 1) * (3 + 2 * t) - 3) :: 0 :: 1 :: w :: r) + ((2 ^ k * (3 + 2 * t) - 3) :: 0 :: 1 :: (2 ^ k * (3 + 2 * t)) :: w :: r):= by + have ho:=Step.O (2 ^ k * (3 + 2 * t) - 2) 0 1 (w :: r) (by omega) + have hmul : 2 ^ (k + 1) * (3 + 2 * t)=2 * (2 ^ k * (3 + 2 * t)):= by + rw [Nat.pow_succ]; ring + have ha : 2 * (2 ^ k * (3 + 2 * t) - 2) + 1=2 ^ (k + 1) * (3 + 2 * t) - 3:= by + omega + have hb : 2 ^ k * (3 + 2 * t) - 2 + 0 - 1=2 ^ k * (3 + 2 * t) - 3:= by omega + have hc : 1 + (2 ^ k * (3 + 2 * t) - 2) + 1=2 ^ k * (3 + 2 * t):= by omega + rw [ha,hb,hc] at ho + exact ho + have h1:=ih (2 ^ k * (3 + 2 * t)) (w :: r) + simpa [List.append_assoc] using! Run.cons h0 h1 +theorem qcn {k t n v : ℕ} (w : ℕ) (r : List ℕ) (h : n + v + 2=2 ^ k * (3 + 2 * t)) : + Run 1 ((2 * n + 1) :: v :: w :: r) + ((4 + 2 * t) :: geometric k (3 + 2 * t) ++ (w + n + 1) :: r):= by + have hpow : 1 ≤ 2 ^ k:=Nat.one_le_pow k 2 (by decide) + have hp : 3 ≤ 2 ^ k * (3 + 2 * t):= by nlinarith + have h0 : Step 0 ((2 * n + 1) :: v :: w :: r) + ((2 ^ k * (3 + 2 * t) - 3) :: 0 :: 1 :: (w + n + 1) :: r):= by + have ho:=Step.O n v w r (by omega) + have ha : n + v - 1=2 ^ k * (3 + 2 * t) - 3:= by omega + rw [ha] at ho + exact ho + exact Run.cons h0 (odd_descent k t (w + n + 1) r) +theorem odd_lookup {k t n v : ℕ} (w : ℕ) (r : List ℕ) {e : ℕ} {ys : List ℕ} {a : ℕ} + (hn : n + v + 2=2 ^ k * (3 + 2 * t)) + (hr : Run e (F (1 + k) (3 + 2 * t)) (ys ++ [a])) : + Run (1 + e) ((2 * n + 1) :: v :: w :: r) ((ys ++ [a + w - v - 1]) ++ r):= by + have hf : F (1 + k) (3 + 2 * t)=F k (3 + 2 * t) ++ [2 ^ k * (3 + 2 * t)]:=F_snoc k (3 + 2 * t) + rcases run_last hr (F k (3 + 2 * t)) (2 ^ k * (3 + 2 * t)) hf with ⟨p,d,hlast,hrun⟩ + rcases qN hlast with ⟨rfl,ha⟩ + have h1 : Run 1 ((2 * n + 1) :: v :: w :: r) ((F k (3 + 2 * t) ++ [w + n + 1]) ++ r):= by + have he:=qcn w r hn + have hfeq : (4 + 2 * t) :: geometric k (3 + 2 * t) ++ (w + n + 1) :: r = + (F k (3 + 2 * t) ++ [w + n + 1]) ++ r:= by + simp only [F,List.cons_append,List.nil_append,List.append_assoc,List.cons.injEq,and_true] + omega + rwa [← hfeq] + have h2 : Run e ((F k (3 + 2 * t) ++ [w + n + 1]) ++ r) ((ys ++ [a + w - v - 1]) ++ r):= by + have hr':=app r (hrun (w + n + 1)) + have haeq : w + n + 1 + d=a + w - v - 1:= by omega + rwa [haeq] at hr' + exact trans h1 h2 +inductive Exec : ℕ → List ℕ → List ℕ → Prop where + | stop (xs : List ℕ) : Exec 0 xs xs + | take {e f : ℕ} {xs ys zs : List ℕ} : Step e xs ys → Exec f ys zs → Exec (e + f) xs zs + | zero {e : ℕ} {xs ys : List ℕ} : Exec e (xs ++ [0]) ys → Exec e xs ys +theorem run_exec {e : ℕ} {xs ys : List ℕ} (h : Run e xs ys) : Exec e xs ys:= by + induction h with + | refl _ => exact Exec.stop _ + | cons hs _ ih => exact Exec.take hs ih +theorem exec_trans {e f : ℕ} {xs ys zs : List ℕ} (h1 : Exec e xs ys) (h2 : Exec f ys zs) : + Exec (e + f) xs zs:= by + induction h1 with + | stop _ => simpa using! h2 + | take hs _ ih => + rw [Nat.add_assoc] + exact Exec.take hs (ih h2) + | zero _ ih => exact Exec.zero (ih h2) +theorem mass_zero (xs : List ℕ) : mass (xs ++ [0])=mass xs:= by + simp [mass_append] +theorem exec_mass {e : ℕ} {xs ys : List ℕ} (h : Exec e xs ys) : + mass ys=mass xs + 3 * e:= by + induction h with + | stop _ => omega + | take hs _ ih => + have hm:=step_mass hs + omega + | zero _ ih => + rw [mass_zero] at ih + exact ih +theorem split2 (n : ℕ) (hn : 0 < n) : ∃ k t,n=2 ^ k * (1 + 2 * t):= by + induction n using Nat.strongRecOn with + | ind n ih => + rcases Nat.even_or_odd' n with ⟨a,rfl | rfl⟩ + · have ha : 0 < a:= by omega + have hlt : a < 2 * a:= by omega + rcases ih a hlt ha with ⟨k,t,hk⟩ + refine ⟨k + 1,t,?_⟩ + rw [Nat.pow_succ] + linarith + · exact ⟨0,a,by simp [Nat.add_comm]⟩ +theorem pow2_mod3 (n : ℕ) : 2 ^ n % 3=1 ∨ 2 ^ n % 3=2:= by + induction n with + | zero => left; rfl + | succ n ih => + rw [Nat.pow_succ,Nat.mul_mod] + rcases ih with h | h <;> rw [h] <;> decide +theorem single_returns + (hG : ∀ k t,∃ e m,Exec e (G (1 + k) (1 + 2 * t)) [m]) + (j : ℕ) : ∃ e m,Exec (1 + e) [3 * j] [m]:= by + rcases Nat.even_or_odd' (3 * j) with ⟨n,hn | hn⟩ + · refine ⟨0,2 * n + 3,?_⟩ + rw [hn] + apply Exec.zero + apply Exec.zero + apply run_exec + simpa using! one (Step.E n 0 0 []) + · rcases split2 (n + 2) (by omega) with ⟨k,t,hk⟩ + have ht : 1 ≤ t:= by + by_contra hlt + have ht0 : t=0:= by omega + subst ht0 + have hp : 2 ^ (k + 1)=(j + 1) * 3:= by + rw [Nat.pow_succ] + omega + have hmod:=pow2_mod3 (k + 1) + rw [hp,Nat.mul_mod_left] at hmod + rcases hmod with h | h <;> contradiction + rcases hG k t with ⟨e,m,hr⟩ + refine ⟨e,m,?_⟩ + apply Exec.zero + apply Exec.zero + change Exec (1 + e) [3 * j,0,0] [m] + rw [hn] + have ht1 : 3 + 2 * (t - 1)=1 + 2 * t:= by omega + have ht2 : 4 + 2 * (t - 1)=1 + 2 * t + 1:= by omega + have ht3 : n + 1=2 ^ k * (1 + 2 * t) - 1:= by omega + have hn_eq : n + 0 + 2=2 ^ k * (3 + 2 * (t - 1)):= by + rw [ht1]; omega + have hexp:=qcn (k:=k) (t:=t - 1) (n:=n) (v:=0) 0 [] hn_eq + have hge : (4 + 2 * (t - 1)) :: geometric k (3 + 2 * (t - 1)) ++ (0 + n + 1) :: [] = + G (1 + k) (1 + 2 * t):= by + rw [Nat.add_comm 1 k] + simp only [G,F,ht1,ht2,Nat.zero_add,ht3] + rw [hge] at hexp + exact exec_trans (run_exec hexp) hr +end Prefix +def q0 (k : ℤ) : ℤ := + match k with + | Int.ofNat n => Int.ofNat (Nat.pow 2 n) + | Int.negSucc _ => 0 +def ZEven (x : ℤ) : Prop:=∃ k : ℤ,x=2 * k +def qW (x : ℤ) : Prop:=∃ k : ℤ,x=2 * k + 1 +def qb6 (x : ℤ) : Bool:=decide (x % 2=0) +def zodd (x : ℤ) : Bool:=decide (x % 2=1) +theorem qe {k : ℤ} (hk : 0 ≤ k) : q0 k=(2 : ℤ) ^ k.toNat:= by + cases k with + | ofNat n => + change ((2 ^ n : ℕ) : ℤ) = (2 : ℤ) ^ n + exact Nat.cast_pow 2 n + | negSucc n => omega +@[simp] theorem pow2_zero : q0 0=1:=rfl +@[simp] theorem pow2_one : q0 1=2:=rfl +theorem qc {k : ℤ} (hk : 0 ≤ k) : 0 < q0 k:= by + rw [qe hk]; positivity +theorem qs (k : ℤ) : 0 ≤ q0 k:= by + cases k with + | ofNat n => exact Int.natCast_nonneg (2 ^ n) + | negSucc n => exact le_refl 0 +theorem q5 {a b : ℤ} (ha : 0 ≤ a) (hb : 0 ≤ b) : + q0 (a + b)=q0 a * q0 b:= by + rw [qe (by omega),qe ha,qe hb, + Int.toNat_add ha hb,pow_add] +theorem qcl {k d : ℤ} (hd : 0 ≤ d) (hdk : d ≤ k) : + q0 k=q0 d * q0 (k - d):= by + have h:=q5 hd (sub_nonneg.mpr hdk) + rwa [add_sub_cancel] at h +theorem qd {a b : ℤ} (ha : 0 ≤ a) (hab : a ≤ b) : + q0 a ≤ q0 b:= by + rw [qcl ha hab] + have hpos : 1 ≤ q0 (b - a):= by + have:=qc (sub_nonneg.mpr hab) + omega + have ha_pos:=qc ha + nlinarith +theorem qbm {a b : ℤ} (ha : 0 ≤ a) (hab : a < b) : + q0 a < q0 b:= by + have hle : a + 1 ≤ b:= by omega + have h1 : q0 (a + 1) ≤ q0 b:=qd (by omega) hle + rw [q5 ha (by omega),pow2_one] at h1 + have ha_pos:=qc ha + omega +theorem qv {a b : ℤ} (ha : 0 ≤ a) (hb : 0 ≤ b) : + q0 a < q0 b ↔ a < b:= by + constructor + · intro hlt + by_contra hge + have hle : q0 b ≤ q0 a:=qd hb (by omega) + omega + · exact qbm ha +theorem qah (x : ℤ) : qb6 x=true ↔ ZEven x:= by + simp only [qb6,decide_eq_true_iff,ZEven] + constructor + · intro h; exact ⟨x / 2,by omega⟩ + · rintro ⟨k,rfl⟩; omega +theorem zodd_iff (x : ℤ) : zodd x=true ↔ qW x:= by + simp only [zodd,decide_eq_true_iff,qW] + constructor + · intro h; exact ⟨x / 2,by omega⟩ + · rintro ⟨k,rfl⟩; omega +theorem qa9 (x : ℤ) : qb6 x=false ↔ qW x:= by + simp only [qb6,decide_eq_false_iff_not,qW] + constructor + · intro h; exact ⟨x / 2,by omega⟩ + · rintro ⟨k,rfl⟩; omega +def qS : ℕ → ℕ → ℕ + | 0,_ => 0 + | fuel + 1,n => if n < 2 then 0 else qS fuel (n / 2) + 1 +theorem qcb {fuel n : ℕ} (hn : 0 < n) (hle : n ≤ fuel) : + 2 ^ qS fuel n ≤ n ∧ n < 2 ^ (qS fuel n + 1):= by + induction fuel generalizing n with + | zero => omega + | succ fuel ih => + unfold qS + split_ifs with hlt + · simp only [Nat.pow_zero,Nat.zero_add,Nat.pow_one] + omega + · rcases ih (n:=n / 2) (by omega) (by omega) with ⟨hlo,hhi⟩ + rw [Nat.pow_succ,Nat.pow_succ] + omega +def qH (x : ℤ) : ℤ := + if x ≤ 0 then 0 else (qS x.toNat x.toNat : ℤ) +theorem qM (x : ℤ) : 0 ≤ qH x:= by + unfold qH; split_ifs <;> positivity +theorem qag {x : ℤ} (hx : 0 < x) : + q0 (qH x) ≤ x ∧ x < q0 (qH x + 1):= by + have hle : ¬ x ≤ 0:= by omega + unfold qH + rw [if_neg hle] + rcases qcb (fuel:=x.toNat) (n:=x.toNat) (by omega) (le_refl _) with ⟨hlo,hhi⟩ + rw [qe (by positivity),qe (by positivity)] + have h1 : ((qS x.toNat x.toNat : ℤ) + 1).toNat=qS x.toNat x.toNat + 1:= by omega + rw [Int.toNat_natCast,h1] + have hlo' : ((2 ^ qS x.toNat x.toNat : ℕ) : ℤ) ≤ (x.toNat : ℤ):=Int.ofNat_le.mpr hlo + have hhi' : (x.toNat : ℤ) < ((2 ^ (qS x.toNat x.toNat + 1) : ℕ) : ℤ):=Int.ofNat_lt.mpr hhi + push_cast at hlo' hhi' + rw [Int.toNat_of_nonneg (by omega)] at hlo' hhi' + exact ⟨hlo',hhi'⟩ +theorem qas {x y : ℤ} (hxy : x ≤ y) : qH x ≤ qH y:= by + by_cases hx : x ≤ 0 + · have : qH x=0:= by unfold qH; rw [if_pos hx] + have:=qM y + omega + · push Not at hx + have hy : 0 < y:= by omega + rcases qag hx with ⟨hx1,_⟩ + rcases qag hy with ⟨_,hy2⟩ + have hlt : q0 (qH x) < q0 (qH y + 1):= by omega + have hlt':=(qv (qM x) (by have:=qM y; omega)).mp hlt + omega +theorem qck {a : ℤ} (ha : 0 ≤ a) : qH (q0 a)=a:= by + have hp : 0 < q0 a:=qc ha + rcases qag hp with ⟨h1,h2⟩ + have hlt1:=(qv ha (by have:=qM (q0 a); omega)).mp h2 + by_contra hne + have hgt : a < qH (q0 a):= by omega + have hle:=qd (by omega : 0 ≤ a + 1) (by omega : a + 1 ≤ qH (q0 a)) + rw [q5 ha (by omega),pow2_one] at hle + omega +def q1 (x : ℤ) : ℤ := + if x ≤ 1 then 0 else qH (x - 1) + 1 +theorem qh (x : ℤ) : 0 ≤ q1 x:= by + unfold q1 + split_ifs + · omega + · have:=qM (x - 1); omega +theorem qy {x : ℤ} (hx : 1 < x) : + q0 (q1 x - 1) < x ∧ x ≤ q0 (q1 x):= by + unfold q1 + rw [if_neg (by omega)] + have hsub : qH (x - 1) + 1 - 1=qH (x - 1):= by ring + rw [hsub] + rcases qag (by omega : 0 < x - 1) with ⟨h1,h2⟩ + omega +theorem qt {x y : ℤ} (hxy : x ≤ y) : q1 x ≤ q1 y:= by + unfold q1 + split_ifs with hx hy + · omega + · have:=qM (y - 1); omega + · omega + · have:=qas (by omega : x - 1 ≤ y - 1); omega +theorem qar {a : ℤ} (ha : 0 ≤ a) : q1 (q0 a)=a:= by + by_cases ha0 : a=0 + · subst ha0; simp [q1,q0] + · have ha1 : 1 ≤ a:= by omega + have hp : 1 < q0 a:= by + have:=qd (by omega : (0 : ℤ) ≤ 1) ha1 + rw [pow2_one] at this; omega + rcases qy hp with ⟨h1,h2⟩ + have hzu:=qh (q0 a) + have hzu1 : 1 ≤ q1 (q0 a):= by + by_contra h + have h0 : q1 (q0 a)=0:= by omega + rw [h0,pow2_zero] at h2 + omega + have hlt:=(qv (by omega : 0 ≤ q1 (q0 a) - 1) ha).mp h1 + by_contra hne + have hgt : q1 (q0 a) < a:= by omega + have hle:=qd (by omega : 0 ≤ q1 (q0 a) + 1) (by omega : q1 (q0 a) + 1 ≤ a) + rw [q5 hzu (by omega),pow2_one] at hle + have hp0:=qc hzu + omega +theorem qm {x a : ℤ} (hx : 0 < x) (ha : 0 ≤ a) : + x ≤ q0 a ↔ q1 x ≤ a:= by + constructor + · intro hle + have:=qt hle + rwa [qar ha] at this + · intro hle + by_cases hx1 : x ≤ 1 + · have:=qc ha; omega + · push Not at hx1 + rcases qy hx1 with ⟨_,h2⟩ + have hmono:=qd (qh x) hle + omega +def sNat {α : Type*} (n : ℕ) (f : ℕ → α) : α := + Nat.casesOn n (f 0) (fun m => f (Nat.succ m)) +@[simp] theorem sNat_eq {α : Type*} (n : ℕ) (f : ℕ → α) : sNat n f = f n := by + cases n <;> rfl +def q2 {α : Type*} (x : ℤ) (f : ℤ → α) : α := + Int.casesOn x (fun n => sNat n (fun n' => f (Int.ofNat n'))) (fun n => sNat n (fun n' => f (Int.negSucc n'))) +@[simp] theorem strictInt_eq {α : Type*} (x : ℤ) (f : ℤ → α) : q2 x f=f x:= by + cases x with + | ofNat n => cases n <;> rfl + | negSucc n => cases n <;> rfl +def q4 : ℕ → ℤ → ℤ × ℤ + | 0,x => (0,x) + | fuel + 1,x => + if x % 2=0 then + let p:=q4 fuel (x / 2) + (p.1 + 1,p.2) + else + (0,x) +theorem qaw (fuel : ℕ) (x : ℤ) : + 0 ≤ (q4 fuel x).1 ∧ + (q4 fuel x).1 ≤ (fuel : ℤ) ∧ + x=q0 (q4 fuel x).1 * (q4 fuel x).2 ∧ + ((q4 fuel x).1 < (fuel : ℤ) → qW (q4 fuel x).2):= by + induction fuel generalizing x with + | zero => + simp only [q4,Nat.cast_zero,le_refl,pow2_zero,one_mul,lt_self_iff_false, + IsEmpty.forall_iff,and_self] + | succ fuel ih => + unfold q4 + split_ifs with hmod + · rcases ih (x / 2) with ⟨hs0,hsf,heq,hodd⟩ + dsimp -failIfUnchanged + refine ⟨by omega,by omega,?_,?_⟩ + · rw [q5 hs0 (by omega),pow2_one] + have hx : x=2 * (x / 2):= by omega + linarith + · intro hlt + exact hodd (by omega) + · dsimp -failIfUnchanged + refine ⟨by omega,by omega,by simp [pow2_zero],?_⟩ + intro _ + exact ⟨x / 2,by omega⟩ +theorem qbP (n : ℕ) : (n : ℤ) < q0 (n : ℤ):= by + induction n with + | zero => simp [q0] + | succ n ih => + push_cast + rw [q5 (by positivity) (by omega),pow2_one] + have hp:=qc (k:=(n : ℤ)) (by positivity) + omega +theorem qbH {x : ℤ} (hx : 0 < x) : + 0 ≤ (q4 x.toNat x).1 ∧ + x=q0 (q4 x.toNat x).1 * (q4 x.toNat x).2 ∧ + qW (q4 x.toNat x).2:= by + rcases qaw x.toNat x with ⟨hs0,hsf,heq,hodd⟩ + refine ⟨hs0,heq,hodd ?_⟩ + by_contra hge + have hs : (q4 x.toNat x).1=(x.toNat : ℤ):= by omega + rw [hs,Int.toNat_of_nonneg (by omega)] at heq + have hp:=qc (by omega : 0 ≤ x) + have hr : 1 ≤ (q4 x.toNat x).2:= by nlinarith + have hlt:=qbP x.toNat + rw [Int.toNat_of_nonneg (by omega)] at hlt + nlinarith +namespace Block +structure kernel where + den : ℤ + num : ℤ + bias : ℤ + gain : ℤ + deriving DecidableEq,Repr +def good (k : kernel) : Prop := + 0 < k.den ∧ 0 < k.num ∧ 2 * k.num ≤ k.den ∧ 1 ≤ k.bias ∧ k.bias + 2 ≤ k.gain +def call (k : kernel) (S H S' H' : ℤ) : Prop := + S'=S + k.gain ∧ + k.den * H'=2 * k.den * S - k.num * H + k.den * (2 * k.gain + 3 - k.bias) +structure summary where + scale : ℤ + sc : ℤ + hc : ℤ + offset : ℤ + added : ℤ + deriving DecidableEq,Repr +def identity : summary:=⟨1,0,1,0,0⟩ +def push (k : kernel) (z : summary) : summary := + ⟨k.den * z.scale, + 2 * k.den * z.scale - k.num * z.sc, + -k.num * z.hc, + k.den * z.scale * (2 * z.added + 2 * k.gain + 3 - k.bias) - k.num * z.offset, + z.added + k.gain⟩ +def denotes (z : summary) (S H S' H' : ℤ) : Prop := + S'=S + z.added ∧ z.scale * H'=z.sc * S + z.hc * H + z.offset +def bounded (z : summary) : Prop := + 0 < z.scale ∧ 0 ≤ z.sc ∧ z.sc ≤ 2 * z.scale ∧ + 0 ≤ z.added ∧ 0 ≤ z.offset ∧ z.offset ≤ z.scale * (2 * z.added + 2) +theorem identity_bounded : bounded identity:= by + unfold bounded identity; simp +theorem push_bounded (k : kernel) (z : summary) (hk : good k) (hz : bounded z) : + bounded (push k z) ∧ (push k z).scale ≤ (push k z).sc ∧ 0 < (push k z).offset:= by + rcases k with ⟨q,p,b,lam⟩ + rcases z with ⟨Q,A,B,C,M⟩ + rcases hk with ⟨hq,hp,hqp,hb,hl⟩ + rcases hz with ⟨hQ,hA0,hA1,hM,hC0,hC1⟩ + simp only [bounded,push] at * + have hqQ : 0 < q * Q:=mul_pos hq hQ + have hpA1 : p * A ≤ q * Q:= by nlinarith + have hpC0 : 0 ≤ p * C:= by positivity + have hpC1 : p * C ≤ (q * Q) * (M + 1):= by + have : p * C ≤ p * (Q * (2 * M + 2)):= by nlinarith + have : (2 * p) * (Q * (M + 1)) ≤ q * (Q * (M + 1)):= by nlinarith + linarith + have hbl : (q * Q) * (b + 2) ≤ (q * Q) * lam:= by nlinarith + have hb1 : (q * Q) * 1 ≤ (q * Q) * b:= by nlinarith + have hM0 : 0 ≤ (q * Q) * M:= by nlinarith + refine ⟨⟨by nlinarith,by nlinarith,by nlinarith,by linarith,by linarith,by linarith⟩, + by nlinarith,by linarith⟩ +theorem push_sound (k : kernel) (z : summary) (S H S1 H1 S2 H2 : ℤ) + (hz : denotes z S H S1 H1) (hk : call k S1 H1 S2 H2) : + denotes (push k z) S H S2 H2:= by + rcases k with ⟨q,p,b,lam⟩ + rcases z with ⟨Q,A,B,C,M⟩ + unfold denotes call push at * + dsimp -failIfUnchanged at * + rcases hz with ⟨rfl,hH1⟩ + rcases hk with ⟨rfl,hH2⟩ + refine ⟨by ring,?_⟩ + calc q * Q * H2 = Q * (q * H2) := by ring + _ = Q * (2 * q * (S + M) - p * H1 + q * (2 * lam + 3 - b)) := by rw [hH2] + _ = Q * (2 * q * (S + M) + q * (2 * lam + 3 - b)) - p * (Q * H1) := by ring + _ = Q * (2 * q * (S + M) + q * (2 * lam + 3 - b)) - p * (A * S + B * H + C) := by rw [hH1] + _ = (2 * q * Q - p * A) * S + -p * B * H + (q * Q * (2 * M + 2 * lam + 3 - b) - p * C) := by ring +inductive calls : List kernel → ℤ → ℤ → ℤ → ℤ → Prop where + | no_calls (S H : ℤ) : calls [] S H S H + | more_calls {k : kernel} {ks : List kernel} {S H S1 H1 S2 H2 : ℤ} : + call k S H S1 H1 → calls ks S1 H1 S2 H2 → calls (k :: ks) S H S2 H2 +theorem fold_sound {ks : List kernel} {S H S' H' : ℤ} (hrun : calls ks S H S' H') : + ∀ z S0 H0,denotes z S0 H0 S H → + denotes (ks.foldl (fun z k => push k z) z) S0 H0 S' H':= by + induction hrun with + | no_calls _ _ => intro z S0 H0 hz; exact hz + | more_calls hstep _ ih => + intro z S0 H0 hz + exact ih (push _ z) S0 H0 (push_sound _ _ _ _ _ _ _ _ hz hstep) +def low_push (k : kernel) (z : summary) : summary := + ⟨k.den * z.scale, + k.num * (2 * z.scale - z.sc), + -k.num * z.hc, + k.num * z.scale * (2 * z.added + 3) - k.num * z.offset + k.den * z.scale * k.bias, + z.added + k.gain⟩ +def qA (z : summary) : Prop := + 0 < z.scale ∧ 0 ≤ z.sc ∧ z.sc ≤ z.scale ∧ + -z.scale ≤ z.hc ∧ z.hc ≤ z.scale ∧ + 0 ≤ z.added ∧ 0 ≤ z.offset ∧ z.offset ≤ z.scale * z.added +theorem qa5 : qA identity:= by + unfold qA identity; simp +theorem qax (k : kernel) (z : summary) (hk : good k) (hz : qA z) : + qA (low_push k z) ∧ + -(low_push k z).scale ≤ 2 * (low_push k z).hc ∧ + 2 * (low_push k z).hc ≤ (low_push k z).scale:= by + rcases k with ⟨q,p,b,lam⟩ + rcases z with ⟨Q,E,T,V,K⟩ + rcases hk with ⟨hq,hp,hqp,hb,hl⟩ + rcases hz with ⟨hQ,hE0,hE1,hT0,hT1,hK,hV0,hV1⟩ + simp only [qA,low_push] at * + have hqQ : 0 < q * Q:=mul_pos hq hQ + have hpQ : 0 < p * Q:=mul_pos hp hQ + have hqpQ : 2 * (p * Q) ≤ q * Q:= by nlinarith + have hpV0 : 0 ≤ p * V:= by positivity + have hpQK : 0 ≤ (p * Q) * K:= by positivity + have hpV : p * V ≤ (p * Q) * K:= by + have : p * V ≤ p * (Q * K):= by nlinarith + linarith + have h2K : 2 * ((p * Q) * K) ≤ (q * Q) * K:= by nlinarith + have hb1 : (q * Q) * 1 ≤ (q * Q) * b:= by nlinarith + have hbl : (q * Q) * (b + 2) ≤ (q * Q) * lam:= by nlinarith + have hbias : 3 * (p * Q) + (q * Q) * b ≤ (q * Q) * lam:= by linarith + refine ⟨⟨by nlinarith,by nlinarith,by nlinarith,by nlinarith,by nlinarith, + by linarith,by linarith,by linarith⟩,by nlinarith,by nlinarith⟩ +theorem qbx (ks : List kernel) (z : summary) + (hks : ∀ k ∈ ks,good k) (hz : qA z) : + qA (ks.foldl (fun z k => low_push k z) z):= by + induction ks generalizing z with + | nil => exact hz + | cons k ks ih => + exact ih (low_push k z) (fun x hx => hks x (List.mem_cons_of_mem k hx)) + (qax k z (hks k List.mem_cons_self) hz).1 +def qX (k : kernel) (z : summary) : summary := + ⟨k.den * z.scale, + k.den * (2 * z.scale - z.sc), + -k.num * z.hc, + k.den * ((2 * z.scale - z.sc) * k.gain + 2 * z.scale * z.added - z.offset + 3 * z.scale - z.hc * k.bias), + k.gain + z.added⟩ +theorem qbe (k : kernel) : qX k identity=push k identity:= by + cases k; unfold qX push identity; dsimp -failIfUnchanged; congr 1 <;> ring +theorem high_low_push (h k : kernel) (z : summary) : + push k (qX h z)=qX h (low_push k z):= by + cases h; cases k; cases z + unfold qX push low_push; dsimp -failIfUnchanged; congr 1 <;> ring +theorem high_low_fold (h : kernel) (ks : List kernel) (z : summary) : + ks.foldl (fun z k => push k z) (qX h z) = + qX h (ks.foldl (fun z k => low_push k z) z):= by + induction ks generalizing z with + | nil => rfl + | cons k ks ih => + simp only [List.foldl_cons,high_low_push,ih] +theorem high_low_word (h : kernel) (ks : List kernel) : + (h :: ks).foldl (fun z k => push k z) identity = + qX h (ks.foldl (fun z k => low_push k z) identity):= by + simp only [List.foldl_cons,← qbe,high_low_fold] +theorem low_fold_half (ks : List kernel) (z : summary) + (hks : ∀ k ∈ ks,good k) (hz : qA z) (hne : ks ≠ []) : + -(ks.foldl (fun z k => low_push k z) z).scale ≤ 2 * (ks.foldl (fun z k => low_push k z) z).hc ∧ + 2 * (ks.foldl (fun z k => low_push k z) z).hc ≤ (ks.foldl (fun z k => low_push k z) z).scale:= by + induction ks generalizing z with + | nil => contradiction + | cons k ks ih => + have hk:=hks k List.mem_cons_self + have hstep:=qax k z hk hz + cases ks with + | nil => exact hstep.2 + | cons k2 ks2 => + exact ih (low_push k z) (fun x hx => hks x (List.mem_cons_of_mem k hx)) hstep.1 (by simp) +theorem qbT {m z : ℤ} (hm : 0 < m) (hdvd : m ∣ z) (hlt : |z| < m) : z=0:= by + rcases hdvd with ⟨k,rfl⟩ + rw [abs_lt] at hlt + have hk : k=0:= by nlinarith + subst hk; ring +theorem exact_descent (m S H0 H1 H2 Q0 Q1 A0 A1 B0 B1 C0 C1 mass : ℤ) + (hm : 0 < m) (hd0 : m ∣ H0) (hd1 : m ∣ H1) (hd2 : m ∣ H2) + (E0 : Q0 * H1=A0 * S + B0 * H0 + C0) + (E1 : Q1 * H2=A1 * (S + mass) + B1 * H1 + C1) + (hbound : |A0 * A1 * mass + A0 * C1 - A1 * C0| < m) : + A0 * C1=A1 * (C0 - A0 * mass):= by + have E : A0 * A1 * mass + A0 * C1 - A1 * C0 = + A0 * Q1 * H2 - (A1 * Q0 + A0 * B1) * H1 + A1 * B0 * H0:= by + calc A0 * A1 * mass + A0 * C1 - A1 * C0 + = A0 * (A1 * (S + mass) + B1 * H1 + C1) - A1 * (A0 * S + B0 * H0 + C0) - A0 * B1 * H1 + A1 * B0 * H0 := by ring + _ = A0 * (Q1 * H2) - A1 * (Q0 * H1) - A0 * B1 * H1 + A1 * B0 * H0 := by rw [← E1, ← E0] + _ = A0 * Q1 * H2 - (A1 * Q0 + A0 * B1) * H1 + A1 * B0 * H0 := by ring + have hd : m ∣ A0 * A1 * mass + A0 * C1 - A1 * C0:= by + rw [E] + rcases hd0 with ⟨k0,rfl⟩ + rcases hd1 with ⟨k1,rfl⟩ + rcases hd2 with ⟨k2,rfl⟩ + exact ⟨A0 * Q1 * k2 - (A1 * Q0 + A0 * B1) * k1 + A1 * B0 * k0,by ring⟩ + have hz:=qbT hm hd hbound + linarith +theorem cross_bound (Q0 Q1 A0 A1 C0 C1 mass M : ℤ) + (hQ0 : 0 < Q0) (hQ1 : 0 < Q1) (hm0 : 0 ≤ mass) (hm1 : mass ≤ M) + (hA00 : 0 ≤ A0) (hA01 : A0 ≤ 2 * Q0) + (hA10 : 0 ≤ A1) (hA11 : A1 ≤ 2 * Q1) + (hC00 : 0 ≤ C0) (hC01 : C0 ≤ Q0 * (2 * M + 2)) + (hC10 : 0 ≤ C1) (hC11 : C1 ≤ Q1 * (2 * M + 2)) : + |A0 * A1 * mass + A0 * C1 - A1 * C0| ≤ Q0 * Q1 * (12 * M + 8):= by + rw [abs_le] + have hQ01 : 0 < Q0 * Q1:=mul_pos hQ0 hQ1 + have h1 : A0 * A1 ≤ 4 * (Q0 * Q1):= by nlinarith + have h2 : (A0 * A1) * mass ≤ 4 * (Q0 * Q1) * M:= by + have : (A0 * A1) * mass ≤ 4 * (Q0 * Q1) * mass:= by nlinarith + have : (Q0 * Q1) * mass ≤ (Q0 * Q1) * M:= by nlinarith + linarith + have h3 : A0 * C1 ≤ 2 * (Q0 * Q1) * (2 * M + 2):= by + have : A0 * C1 ≤ (2 * Q0) * (Q1 * (2 * M + 2)):= by nlinarith + linarith + have h4 : A1 * C0 ≤ 2 * (Q0 * Q1) * (2 * M + 2):= by + have : A1 * C0 ≤ (2 * Q1) * (Q0 * (2 * M + 2)):= by nlinarith + linarith + have h5 : 0 ≤ (A0 * A1) * mass:= by positivity + have h6 : 0 ≤ A0 * C1:= by positivity + have h7 : 0 ≤ A1 * C0:= by positivity + constructor <;> linarith +theorem qci (m D d0 d1 S H0 H1 H2 A0 A1 B0 B1 C0 C1 mass M : ℤ) + (hm : 0 ≤ m) (hd00 : 0 ≤ d0) (hd01 : d0 ≤ D) (hd10 : 0 ≤ d1) (hd11 : d1 ≤ D) + (hm0 : 0 ≤ mass) (hm1 : mass ≤ M) + (hA00 : 0 ≤ A0) (hA01 : A0 ≤ 2 * q0 d0) + (hA10 : 0 ≤ A1) (hA11 : A1 ≤ 2 * q0 d1) + (hC00 : 0 ≤ C0) (hC01 : C0 ≤ q0 d0 * (2 * M + 2)) + (hC10 : 0 ≤ C1) (hC11 : C1 ≤ q0 d1 * (2 * M + 2)) + (hH0 : q0 (m + 1) ∣ H0) (hH1 : q0 (m + 1) ∣ H1) (hH2 : q0 (m + 1) ∣ H2) + (E0 : q0 d0 * H1=A0 * S + B0 * H0 + C0) + (E1 : q0 d1 * H2=A1 * (S + mass) + B1 * H1 + C1) + (hbound : q0 (2 * D) * (12 * M + 8) < q0 (m + 1)) : + A0 * C1=A1 * (C0 - A0 * mass):= by + have hQ0 : 0 < q0 d0:=qc hd00 + have hQ1 : 0 < q0 d1:=qc hd10 + have hQ : q0 d0 * q0 d1 ≤ q0 (2 * D):= by + rw [← q5 hd00 hd10] + exact qd (by omega) (by omega) + have hcb:=cross_bound (q0 d0) (q0 d1) A0 A1 C0 C1 mass M + hQ0 hQ1 hm0 hm1 hA00 hA01 hA10 hA11 hC00 hC01 hC10 hC11 + apply exact_descent (q0 (m + 1)) S H0 H1 H2 (q0 d0) (q0 d1) + A0 A1 B0 B1 C0 C1 mass (qc (by omega)) hH0 hH1 hH2 E0 E1 + have hle : q0 d0 * q0 d1 * (12 * M + 8) ≤ q0 (2 * D) * (12 * M + 8):= by nlinarith + linarith +theorem qaN (Q A T V K b lam C : ℤ) + (hQ0 : 0 < Q) (hQA : Q ≤ A) (hT0 : -Q ≤ 2 * T) (hT1 : 2 * T ≤ Q) + (hV : 0 ≤ V) (hK : 0 ≤ K) (hb0 : 0 ≤ b) (hbl : b ≤ lam) + (hC : C=A * lam + 2 * Q * K - V + 3 * Q - T * b) : + 2 * C ≤ A * (3 * (lam + K) + 2 * K + 6):= by + have h1 : -2 * T * b ≤ Q * b:= by nlinarith + have h2 : Q * b ≤ A * lam:= by nlinarith + have h3 : Q * K ≤ A * K:= by nlinarith + have hAK : 0 ≤ A * K:= by nlinarith + linarith +theorem word_contraction (h : kernel) (ks : List kernel) + (hh : good h) (hks : ∀ k ∈ ks,good k) : + let z:=ks.foldl (fun z k => low_push k z) identity + let r:=(h :: ks).foldl (fun z k => push k z) identity + 2 * r.offset ≤ r.sc * (3 * r.added + 2 * z.added + 6):= by + intro z r + have hr : r=qX h z:=high_low_word h ks + have hz : qA z:=qbx ks identity hks qa5 + cases ks with + | nil => + rcases h with ⟨q,p,b,lam⟩ + rcases hh with ⟨hq,hp,hqp,hb,hl⟩ + simp only [r,z,List.foldl_nil,List.foldl_cons,push,identity] + nlinarith + | cons k ks => + have hhalf:=low_fold_half (k :: ks) identity hks qa5 (by simp) + change -z.scale ≤ 2 * z.hc ∧ 2 * z.hc ≤ z.scale at hhalf + rcases h with ⟨q,p,b,lam⟩ + rcases z with ⟨Q,E,T,V,K⟩ + rcases hh with ⟨hq,hp,hqp,hb,hl⟩ + rcases hz with ⟨hQ,hE0,hE1,hT0,hT1,hK,hV0,hV1⟩ + have hc:=qaN Q (2 * Q - E) T V K b lam + ((2 * Q - E) * lam + 2 * Q * K - V + 3 * Q - T * b) + hQ (by linarith) hhalf.1 hhalf.2 hV0 hK (by linarith) (by linarith) rfl + rw [hr] + simp only [qX] + nlinarith +theorem qc6 (A C A0 C0 A1 C1 T mass : ℤ) + (hA0 : 0 < A0) (h0 : A * C0=A0 * (C - A * T)) + (h1 : A0 * C1=A1 * (C0 - A0 * mass)) : + A * C1=A1 * (C - A * (T + mass)):= by + have h : A0 * (A * C1 - A1 * (C - A * (T + mass)))=0:= by + have h1' := congr_arg (fun z => A * z) h1 + have h0' := congr_arg (fun z => A1 * z) h0 + dsimp -failIfUnchanged only at h1' h0' + linarith + rcases mul_eq_zero.mp h with hzero | hzero + · omega + · linarith +theorem shrink_bound (f : ℕ → ℤ) (C : ℤ) (n : ℕ) + (h : ∀ i < n,3 * f (i + 1) ≤ f i + 2 * C) : + (3 : ℤ) ^ n * f n ≤ f 0 + ((3 : ℤ) ^ n - 1) * C:= by + induction n with + | zero => simp + | succ n ih => + have ih':=ih (fun i hi => h i (by omega)) + have hstep:=h n (by omega) + have hp : 0 < (3 : ℤ) ^ n:= by positivity + have hpow : (3 : ℤ) ^ (n + 1)=3 * (3 : ℤ) ^ n:= by ring + rw [hpow] + nlinarith +theorem qcd (f : ℕ → ℤ) (gap : ℤ) (n : ℕ) + (h : ∀ i < n,f (i + 1) < f i - gap) : + f n ≤ f 0 - (n : ℤ) * (gap + 1):= by + induction n with + | zero => simp + | succ n ih => + have ih':=ih (fun i hi => h i (by omega)) + have hstep:=h n (by omega) + push_cast + linarith +theorem high_count (f : ℕ → ℤ) (A B V m : ℤ) (t q n : ℕ) + (hA : 0 < A) (hB : 0 ≤ B) (hm : 0 < m) (hV : 0 ≤ V) + (hpow : V ≤ (3 : ℤ) ^ t) (hq : B + 4 ≤ (q : ℤ) * m) + (hstart : f 0 ≤ A * V) (hend : 0 < f n) + (hshrink : ∀ i < n,3 * f (i + 1) ≤ f i + 2 * A * (B + 3)) + (hdrop : ∀ i < n,f (i + 1) < f i - A * m) : + n < t + q:= by + by_contra hge + have hnt : t ≤ n:= by omega + have ht:=shrink_bound f (A * (B + 3)) t (fun i hi => by + have:=hshrink i (by omega); linarith) + have hp : 0 < (3 : ℤ) ^ t:= by positivity + have hmid : f t ≤ A * (B + 4):= by + have hinit : f 0 ≤ A * (3 : ℤ) ^ t:= by nlinarith + nlinarith + have htail:=qcd (fun i => f (t + i)) (A * m) (n - t) (fun i hi => by + have h1:=hdrop (t + i) (by omega) + simpa [Nat.add_assoc] using! h1) + have hsub : t + (n - t)=n:= by omega + simp only [Nat.add_zero,hsub] at htail + have hcount : (q : ℤ) ≤ ((n - t : ℕ) : ℤ):= by omega + have hbound : A * (B + 4) ≤ A * ((q : ℤ) * m):= by nlinarith + have hqm : (q : ℤ) * m ≤ ((n - t : ℕ) : ℤ) * m:= by nlinarith + have hlast : A * ((q : ℤ) * m) ≤ A * (((n - t : ℕ) : ℤ) * m):= by nlinarith + have hlast' : A * (((n - t : ℕ) : ℤ) * m)=((n - t : ℕ) : ℤ) * (A * m):= by ring + linarith +end Block +namespace Table +def qbn (xs : List ℤ) : List ℕ:=xs.map Int.toNat +def F (k q : ℤ) : List ℕ:=Prefix.F k.toNat q.toNat +def G (k q : ℤ) : List ℕ:=Prefix.G k.toNat q.toNat +def run (e : ℕ) (xs ys : List ℤ) : Prop:=Prefix.Run e (qbn xs) (qbn ys) +def exec (e : ℕ) (xs ys : List ℤ) : Prop:=Prefix.Exec e (qbn xs) (qbn ys) +theorem pow_split {k d : ℤ} (hd : 0 ≤ d) (hdk : d ≤ k) : + q0 k=q0 d * q0 (k - d):=qcl hd hdk +theorem pow_pos {k : ℤ} (hk : 0 ≤ k) : 0 < q0 k:=qc hk +theorem run_even {u v w : ℤ} (r : List ℤ) (hu : 0 ≤ u) (hv : 0 ≤ v) (hw : 0 ≤ w) + (heven : ZEven u) : + run 1 (u :: v :: w :: r) ((u + v + w + 3) :: r):= by + rcases heven with ⟨n,rfl⟩ + have hn : 0 ≤ n:= by omega + unfold run qbn + simp only [List.map_cons] + have hstep:=Prefix.one (Prefix.Step.E n.toNat v.toNat w.toNat (qbn r)) + have h1 : (2 * n).toNat=2 * n.toNat:= by omega + have h2 : (2 * n + v + w + 3).toNat=2 * n.toNat + v.toNat + w.toNat + 3:= by omega + rwa [h1,h2] +theorem odd_lookup {u v w s q : ℤ} (r : List ℤ) {e : ℕ} {ys : List ℤ} {z : ℤ} + (hu : 0 ≤ u) (hv : 0 ≤ v) (hw : 0 ≤ w) (hodd : qW u) + (hs : 1 ≤ s) (hq : 3 ≤ q) (hqo : qW q) + (hH : u + 2 * v + 3=q0 s * q) + (hr : Prefix.Run e (F s q) (qbn ys ++ [z.toNat])) + (hzn : 0 ≤ z) (hz : 0 ≤ z + w - v - 1) : + run (1 + e) (u :: v :: w :: r) ((ys ++ [z + w - v - 1]) ++ r):= by + rcases hodd with ⟨n,rfl⟩ + rcases hqo with ⟨t,rfl⟩ + have hn0 : 0 ≤ n:= by omega + have ht0 : 0 ≤ t - 1:= by omega + have hhalf : n + v + 2=q0 (s - 1) * (3 + 2 * (t - 1)):= by + have hsp:=pow_split (k:=s) (d:=1) (by omega) hs + rw [pow2_one] at hsp + rw [hsp] at hH + linarith + have hnat : n.toNat + v.toNat + 2=2 ^ (s - 1).toNat * (3 + 2 * (t - 1).toNat):= by + rw [qe (by omega)] at hhalf + have hcast : ((n.toNat + v.toNat + 2 : ℕ) : ℤ) = + ((2 ^ (s - 1).toNat * (3 + 2 * (t - 1).toNat) : ℕ) : ℤ):= by + push_cast + rw [Int.toNat_of_nonneg hn0,Int.toNat_of_nonneg hv,Int.toNat_of_nonneg ht0] + exact hhalf + exact Int.ofNat_inj.mp hcast + have hF : F s (2 * t + 1)=Prefix.F (1 + (s - 1).toNat) (3 + 2 * (t - 1).toNat):= by + unfold F + congr 1 <;> omega + rw [hF] at hr + have h:=Prefix.odd_lookup w.toNat (qbn r) hnat hr + unfold run qbn + simp only [List.map_append,List.map_cons,List.map_nil] + have h1 : (2 * n + 1).toNat=2 * n.toNat + 1:= by omega + have h2 : (z + w - v - 1).toNat=z.toNat + w.toNat - v.toNat - 1:= by omega + rw [← h1,← h2] at h + simpa only [List.append_assoc] using! h +structure pair where + p : ℤ + d : ℤ + b : ℤ + c : ℤ + deriving DecidableEq,Repr +def ql (k : ℤ) (x : pair) : ℤ:=x.p * q0 (k - x.d) +def left (k q : ℤ) (x : pair) : ℤ:=ql k x * q + x.b +def right (k q : ℤ) (x : pair) : ℤ:=(q0 k - ql k x) * q + x.c +def qai (k q : ℤ) (x : pair) : List ℤ:=[left k q x,right k q x] +def h (x : pair) : ℤ:=x.b + 2 * x.c + 3 +def qaB (k : ℤ) (x : pair) : Prop := + 0 ≤ x.d ∧ x.d ≤ k ∧ 0 < x.p ∧ x.p < q0 x.d ∧ qW x.p ∧ 1 ≤ x.b ∧ -1 ≤ x.c +def qo (k : ℤ) (x : pair) : Prop := + qaB k x ∧ 2 * x.p ≤ q0 x.d ∧ 0 ≤ x.c +theorem qac {k : ℤ} {x : pair} (hx : qaB k x) : + 0 < ql k x ∧ ql k x < q0 k:= by + rcases hx with ⟨hd0,hdk,hp0,hpd,_,_,_⟩ + unfold ql + rw [pow_split hd0 hdk] + have hp : 0 < q0 (k - x.d):=pow_pos (by omega) + exact ⟨by nlinarith,by nlinarith⟩ +theorem qn {k q : ℤ} {x : pair} (hx : qaB k x) (hq : 1 ≤ q) : + 1 ≤ left k q x ∧ 0 ≤ right k q x:= by + have hc:=qac hx + rcases hx with ⟨_,_,_,_,_,hb,hc0⟩ + unfold left right + exact ⟨by nlinarith,by nlinarith⟩ +def qa (k : ℤ) (x : pair) (s r : ℤ) : Prop := + 1 ≤ s ∧ s < k - x.d ∧ h x=q0 s * r ∧ qW r +def qg (k q : ℤ) (x : pair) (s r : ℤ) : ℤ := + (q0 (x.d + 1) - x.p) * q0 (k - x.d - s) * q + r +theorem qz {k q : ℤ} {x : pair} {s r : ℤ} + (hx : qaB k x) (hq : 1 ≤ q) (hqo : qW q) (hs : qa k x s r) : + 3 ≤ qg k q x s r ∧ qW (qg k q x s r) ∧ + left k q x + 2 * right k q x + 3=q0 s * qg k q x s r:= by + rcases hx with ⟨hd0,hdk,hp0,hpd,hpo,hb,hc⟩ + rcases hs with ⟨hs1,hsk,hh,hr⟩ + have hsp : 0 < q0 s:=pow_pos (by omega) + have h_pos : 2 ≤ h x:= by unfold h; omega + have hr0 : 1 ≤ r:= by nlinarith + have hpos : 0 < q0 (k - x.d - s - 1):=pow_pos (by omega) + have hE : q0 (k - x.d - s)=2 * q0 (k - x.d - s - 1):= by + have:=pow_split (k:=k - x.d - s) (d:=1) (by omega) (by omega) + simpa [pow2_one] using! this + have hD : q0 (x.d + 1)=2 * q0 x.d:= by + rw [q5 hd0 (by omega),pow2_one]; ring + unfold qg + have hq1 : 1 ≤ 2 * q0 x.d - x.p:= by omega + have hq2 : 2 ≤ 2 * q0 (k - x.d - s - 1):= by omega + have hq3 : 2 ≤ (2 * q0 x.d - x.p) * (2 * q0 (k - x.d - s - 1)):= by nlinarith + have hq4 : 2 ≤ (2 * q0 x.d - x.p) * (2 * q0 (k - x.d - s - 1)) * q:= by nlinarith + refine ⟨by rw [hE,hD]; linarith,?_,?_⟩ + · rcases hr with ⟨v,rfl⟩ + refine ⟨(q0 (x.d + 1) - x.p) * q0 (k - x.d - s - 1) * q + v,?_⟩ + rw [hE]; ring + · unfold left right ql + have h1:=pow_split hd0 hdk + have h2:=pow_split (k:=k - x.d) (d:=s) (by omega) (by omega) + unfold h at hh + rw [h1,h2,hD] + nlinarith +theorem qu (k q : ℤ) (x : pair) : + left k q x + right k q x=q0 k * q + x.b + x.c:= by + unfold left right; ring +theorem left_odd {k q : ℤ} {x : pair} (hx : qaB k x) (hd : x.d < k) (hb : qW x.b) : + qW (left k q x):= by + rcases hb with ⟨t,hb⟩ + unfold left ql + refine ⟨x.p * q0 (k - x.d - 1) * q + t,?_⟩ + have h1:=pow_split (k:=k - x.d) (d:=1) (by omega) (by omega) + rw [pow2_one] at h1 + rw [h1,hb]; ring +def delta (s r : ℤ) (y : pair) : ℤ:=y.p * q0 (s - y.d) * r +def qQ (x : pair) (s r : ℤ) (y : pair) : pair := + ⟨y.p * (q0 (x.d + 1) - x.p), + x.d + y.d, + delta s r y + y.b, + h x - delta s r y + y.c - x.c - 1⟩ +def qbu (x : pair) : pair:=⟨x.p,x.d + 1,x.b,x.c⟩ +theorem qI (x : pair) (s r : ℤ) (y : pair) : + (qQ x s r y).b + (qQ x s r y).c=x.b + x.c + y.b + y.c + 2:= by + unfold qQ h; dsimp -failIfUnchanged; ring +theorem qbU {k : ℤ} {x : pair} {s r : ℤ} {y : pair} + (hs : qa k x s r) (hy : qo s y) : + q0 y.d * delta s r y=y.p * h x:= by + rcases hs with ⟨_,_,hh,_⟩ + rcases hy with ⟨⟨hyd0,hyds,_⟩,_⟩ + unfold delta + rw [hh,pow_split hyd0 hyds] + ring +theorem qan {k : ℤ} {x : pair} {s r : ℤ} {y : pair} + (hx : qaB k x) (hs : qa k x s r) (hy : qo s y) : + qaB k (qQ x s r y) ∧ 1 ≤ (qQ x s r y).c:= by + have he:=qbU hs hy + rcases hx with ⟨hdx0,hdxk,hpx0,hpxd,hox,hbx,hcx⟩ + rcases hs with ⟨hs1,hsk,hh,hr⟩ + rcases hy with ⟨⟨hdy0,hdys,hpy0,hpyd,hoy,hby,hcy⟩,hhalf,hcy0⟩ + have hD : q0 (x.d + 1)=2 * q0 x.d:= by + rw [q5 hdx0 (by omega),pow2_one]; ring + have hDs : q0 (x.d + y.d)=q0 x.d * q0 y.d:=q5 hdx0 hdy0 + have hxpos : 0 < q0 x.d:=pow_pos hdx0 + have hypos : 0 < q0 y.d:=pow_pos hdy0 + have h_pos : 2 ≤ h x:= by unfold h; omega + have hsp : 0 < q0 s:=pow_pos (by omega) + have hr0 : 1 ≤ r:= by nlinarith + have hds_pos : 0 < q0 (s - y.d):=pow_pos (by omega) + have hz_pos : 0 < delta s r y:= by unfold delta; positivity + have hnewc : 1 ≤ (qQ x s r y).c:= by + unfold qQ h at * + dsimp -failIfUnchanged + have h1 : 0 ≤ (q0 y.d - y.p) * (x.b - 1):= by nlinarith + have h2 : 0 ≤ (q0 y.d - 2 * y.p) * (x.c + 2):= by nlinarith + nlinarith + refine ⟨?_,hnewc⟩ + unfold qaB qQ + dsimp -failIfUnchanged + change 1 ≤ h x - delta s r y + y.c - x.c - 1 at hnewc + refine ⟨by omega,by omega,by rw [hD]; nlinarith,by rw [hD,hDs]; nlinarith,?_,by linarith,by omega⟩ + rcases hox with ⟨a,ha⟩ + rcases hoy with ⟨v,hv⟩ + refine ⟨(2 * v + 1) * (q0 x.d - a) - v - 1,?_⟩ + rw [hD,ha,hv]; ring +theorem widen_table {k : ℤ} {x : pair} (hx : qaB k x) (hc : 0 ≤ x.c) : + qo (k + 1) (qbu x):= by + rcases hx with ⟨hd0,hdk,hp0,hpd,ho,hb,hc0⟩ + unfold qo qaB qbu + dsimp -failIfUnchanged + have hD : q0 (x.d + 1)=2 * q0 x.d:= by + rw [q5 hd0 (by omega),pow2_one]; ring + refine ⟨⟨by omega,by omega,hp0,by rw [hD]; omega,ho,hb,hc0⟩,by rw [hD]; omega,hc⟩ +theorem widen_values {k : ℤ} (q : ℤ) (x : pair) (hk : 0 ≤ k) : + qai (k + 1) q (qbu x)=[left k q x,right k q x + q0 k * q]:= by + unfold qai qbu left right ql + dsimp -failIfUnchanged + have hsub : k + 1 - (x.d + 1)=k - x.d:= by omega + have hD : q0 (k + 1)=2 * q0 k:= by + rw [q5 hk (by omega),pow2_one]; ring + rw [hsub,hD] + congr 1; congr 1; ring +theorem qaF {k : ℤ} (q : ℤ) {x : pair} {s r : ℤ} {y : pair} + (hx : qaB k x) (hs : qa k x s r) (hy : qo s y) : + left s (qg k q x s r) y=left k q (qQ x s r y):= by + rcases hx with ⟨hdx0,hdxk,_⟩ + rcases hs with ⟨hs1,hsk,_⟩ + rcases hy with ⟨⟨hdy0,hdys,_⟩,_⟩ + unfold left ql qg qQ delta + dsimp -failIfUnchanged + have hP : q0 (s - y.d) * q0 (k - x.d - s)=q0 (k - (x.d + y.d)):= by + rw [← q5 (by omega) (by omega)] + congr 1; omega + have hP' := congr_arg (fun z => y.p * (q0 (x.d + 1) - x.p) * q * z) hP + dsimp -failIfUnchanged only at hP' + linarith +theorem next_right {k q : ℤ} {x : pair} {s r : ℤ} {y : pair} + (hx : qaB k x) (hq : 1 ≤ q) (ho : qW q) + (hs : qa k x s r) (hy : qo s y) : + right s (qg k q x s r) y - right k q x - 1=right k q (qQ x s r y):= by + have hQ:=(qz hx hq ho hs).2.2 + have hL:=qaF q hx hs hy + have hS0:=qu k q x + have hS1:=qu s (qg k q x s r) y + have hS2:=qu k q (qQ x s r y) + have hC:=qI x s r y + linarith +def qk (k : ℤ) (x : pair) : ℤ := + if x.d < k then x.b else x.p + x.b +def q3 (k : ℤ) (x : pair) : Bool := + qb6 (qk k x) +theorem qbS {k q : ℤ} {x : pair} (hx : qaB k x) (hq : qW q) : + ∃ a,left k q x=qk k x + 2 * a:= by + rcases hq with ⟨t,rfl⟩ + unfold qk + split_ifs with hdk + · refine ⟨x.p * q0 (k - x.d - 1) * (2 * t + 1),?_⟩ + unfold left ql + have h1:=pow_split (k:=k - x.d) (d:=1) (by omega) (by omega) + rw [pow2_one] at h1 + rw [h1]; ring + · have hd : x.d=k:= by rcases hx with ⟨_,hdk',_⟩; omega + refine ⟨x.p * t,?_⟩ + unfold left ql + rw [hd,sub_self,pow2_zero]; ring +theorem qaO {k q : ℤ} {x : pair} + (hx : qaB k x) (hq : qW q) (he : q3 k x=true) : + ZEven (left k q x):= by + rcases qbS hx hq with ⟨a,ha⟩ + rcases (qah _).mp he with ⟨v,hv⟩ + exact ⟨v + a,by linarith⟩ +theorem qb0 {k : ℤ} {x : pair} {s r : ℤ} + (hs : qa k x s r) (he : q3 k x=false) : + qW x.b:= by + rcases hs with ⟨hs1,hsk,_⟩ + unfold q3 qk at he + have hdk : x.d < k:= by omega + rw [if_pos hdk] at he + exact (qa9 x.b).mp he +inductive entry where + | One (const_val count : ℤ) + | Two (state : pair) (count : ℤ) + deriving DecidableEq,Repr +def qad : entry → ℤ + | .One _ e => e + | .Two _ e => e +def eval (k q : ℤ) : entry → List ℤ + | .One v _ => [q0 k * q + v] + | .Two x _ => qai k q x +def qU (k : ℤ) (f : entry) : Prop := + 0 ≤ k ∧ 0 ≤ qad f ∧ + match f with + | .One v e => v=1 + 3 * e + | .Two x e => qo k x ∧ x.b + x.c=1 + 3 * e +def realizes (k : ℤ) (f : entry) : Prop := + ∀ q,1 ≤ q → qW q → Prefix.Run (qad f).toNat (F k q) (qbn (eval k q f)) +def qZ (k : ℤ) (f : entry) : Prop := + qU k f ∧ realizes k f +theorem qcp {k q : ℤ} {x : pair} {s r : ℤ} {y : pair} {e w : ℤ} + (hx : qaB k x) (hq : 1 ≤ q) (ho : qW q) + (hs : qa k x s r) (he : q3 k x=false) + (hval : qZ s (.Two y e)) (hw : 0 ≤ w) : + run (1 + e.toNat) + [left k q x,right k q x,w] + [left k q (qQ x s r y),right k q (qQ x s r y) + w]:= by + rcases hval with ⟨⟨hs0,he0,hy,hmass⟩,hreal⟩ + rcases qz hx hq ho hs with ⟨hQ,hQo,hH⟩ + rcases qn hx hq with ⟨hu,hv⟩ + rcases qan hx hs hy with ⟨hnext,hc⟩ + rcases qn hnext hq with ⟨hu',hv'⟩ + rcases qn hy.1 (by omega : 1 ≤ qg k q x s r) with ⟨hU,hV⟩ + have hreal':=hreal (qg k q x s r) (by omega) hQo + change Prefix.Run e.toNat (F s (qg k q x s r)) + (qbn [left s (qg k q x s r) y] ++ [(right s (qg k q x s r) y).toNat]) at hreal' + have hR:=next_right hx hq ho hs hy + have hdk : x.d < k:= by rcases hs with ⟨_,hsk,_⟩; omega + have hrun:=odd_lookup [] (by omega : 0 ≤ left k q x) hv hw + (left_odd hx hdk (qb0 hs he)) (by rcases hs with ⟨hs1,_⟩; omega) + hQ hQo hH hreal' hV (by omega) + rw [qaF q hx hs hy] at hrun + have heq : right s (qg k q x s r) y + w - right k q x - 1 = + right k q (qQ x s r y) + w:= by linarith + rwa [heq] at hrun +theorem qcq {k q : ℤ} {x : pair} {s r v e w : ℤ} + (hx : qaB k x) (hq : 1 ≤ q) (ho : qW q) + (hs : qa k x s r) (he : q3 k x=false) + (hval : qZ s (.One v e)) (hw : 0 ≤ w) : + run (1 + e.toNat) [left k q x,right k q x,w] + [q0 k * q + x.b + x.c + v + 2 + w]:= by + rcases hval with ⟨⟨hs0,he0,hv_eq⟩,hreal⟩ + change 0 ≤ e at he0 + change v=1 + 3 * e at hv_eq + rcases qz hx hq ho hs with ⟨hQ,hQo,hH⟩ + rcases qn hx hq with ⟨hu,hright⟩ + have hsum:=qu k q x + have hreal':=hreal (qg k q x s r) (by omega) hQo + change Prefix.Run e.toNat (F s (qg k q x s r)) + (qbn [] ++ [(q0 s * qg k q x s r + v).toNat]) at hreal' + have hdk : x.d < k:= by rcases hs with ⟨_,hsk,_⟩; omega + have hsp : 0 < q0 s:=pow_pos hs0 + have hrun:=odd_lookup [] (by omega : 0 ≤ left k q x) hright hw + (left_odd hx hdk (qb0 hs he)) (by rcases hs with ⟨hs1,_⟩; omega) + hQ hQo hH hreal' (by nlinarith) (by linarith) + have heq : q0 s * qg k q x s r + v + w - right k q x - 1 = + q0 k * q + x.b + x.c + v + 2 + w:= by linarith + simpa [heq] using! hrun +theorem snoc {k q : ℤ} (hk : 0 ≤ k) (hq : 0 ≤ q) : + F (k + 1) q=F k q ++ qbn [q0 k * q]:= by + unfold F qbn + have h1 : (k + 1).toNat=1 + k.toNat:= by omega + rw [h1,Prefix.F_snoc] + simp only [List.map_cons,List.map_nil] + rw [qe hk] + have h2 : ((2 : ℤ) ^ k.toNat * q).toNat=2 ^ k.toNat * q.toNat:= by + have hcast : (((2 ^ k.toNat * q.toNat : ℕ) : ℤ)).toNat=2 ^ k.toNat * q.toNat := + Int.toNat_natCast _ + have heq : ((2 ^ k.toNat * q.toNat : ℕ) : ℤ)=(2 : ℤ) ^ k.toNat * q:= by + push_cast + rw [Int.toNat_of_nonneg hq] + rwa [heq] at hcast + rw [h2] +theorem qP {k : ℤ} {f : entry} {q : ℤ} + (hr : realizes k f) (hk : 0 ≤ k) (hq : 1 ≤ q) (ho : qW q) : + Prefix.Run (qad f).toNat (F (k + 1) q) (qbn (eval k q f ++ [q0 k * q])):= by + rw [snoc hk (by omega)] + unfold qbn + rw [List.map_append] + exact Prefix.app _ (hr q hq ho) +theorem valid_root : qZ 0 (.One 1 0):= by + unfold qZ qU qad + dsimp -failIfUnchanged + refine ⟨⟨by omega,by omega,rfl⟩,?_⟩ + intro q hq ho + unfold F Prefix.F eval qad qbn + simp only [Int.toNat_zero,Prefix.geometric,List.map_cons,List.map_nil,pow2_zero,one_mul] + have h1 : q.toNat + 1=(q + 1).toNat:= by omega + rw [h1] + exact Prefix.Run.refl _ +theorem valid_add_one {k v e : ℤ} (h : qZ k (.One v e)) : + qZ (k + 1) (.Two ⟨1,1,v,0⟩ e):= by + rcases h with ⟨⟨hk,he,hv⟩,hreal⟩ + change 0 ≤ e at he + change v=1 + 3 * e at hv + unfold qZ qU qad qo qaB + dsimp -failIfUnchanged + refine ⟨⟨by omega,he,⟨⟨by omega,by omega,by omega,by simp [q0],⟨0,rfl⟩,by omega,by omega⟩, + by simp [q0],by omega⟩,by omega⟩,?_⟩ + intro q hq ho + have h:=qP hreal hk hq ho + change Prefix.Run e.toNat (F (k + 1) q) (qbn [q0 k * q + v,q0 k * q]) at h + change Prefix.Run e.toNat (F (k + 1) q) (qbn (qai (k + 1) q ⟨1,1,v,0⟩)) + have heq : qai (k + 1) q ⟨1,1,v,0⟩=[q0 k * q + v,q0 k * q]:= by + unfold qai left right ql + dsimp -failIfUnchanged + have hsub : k + 1 - 1=k:= by omega + have hD : q0 (k + 1)=2 * q0 k:= by + rw [q5 hk (by omega),pow2_one]; ring + rw [hsub,hD] + congr 1; · ring + congr 1; ring + rwa [heq] +theorem qc1 {k : ℤ} {x : pair} {e : ℤ} + (h : qZ k (.Two x e)) (heven : q3 k x=true) : + qZ (k + 1) (.One (x.b + x.c + 3) (e + 1)):= by + rcases h with ⟨⟨hk,he,hx,hmass⟩,hreal⟩ + change 0 ≤ e at he + unfold qZ qU qad + dsimp -failIfUnchanged + refine ⟨⟨by omega,by omega,by omega⟩,?_⟩ + intro q hq ho + have h1:=qP hreal hk hq ho + rcases qn hx.1 hq with ⟨hu,hv⟩ + have hP:=pow_pos hk + have hr:=run_even (w:=q0 k * q) [] (by omega) hv (by nlinarith) (qaO hx.1 ho heven) + have hrun:=Prefix.trans h1 hr + unfold eval qad + dsimp -failIfUnchanged + have hadd : (e + 1).toNat=e.toNat + 1:= by omega + rw [hadd] + have heq : q0 (k + 1) * q + (x.b + x.c + 3) = + left k q x + right k q x + q0 k * q + 3:= by + have hsum:=qu k q x + have hD : q0 (k + 1)=2 * q0 k:= by + rw [q5 hk (by omega),pow2_one]; ring + rw [hD]; linarith + rwa [heq] +theorem qaM {k : ℤ} {x : pair} {e s r v f : ℤ} + (h : qZ k (.Two x e)) (hs : qa k x s r) + (ho : q3 k x=false) (hsmall : qZ s (.One v f)) : + qZ (k + 1) (.One (x.b + x.c + v + 2) (e + 1 + f)):= by + rcases h with ⟨⟨hk,he,hx,hmass⟩,hreal⟩ + rcases hsmall.1 with ⟨hs0,hf,hv⟩ + change 0 ≤ e at he + change 0 ≤ f at hf + change v=1 + 3 * f at hv + unfold qZ qU qad + dsimp -failIfUnchanged + refine ⟨⟨by omega,by omega,by omega⟩,?_⟩ + intro q hq hqo + have h1:=qP hreal hk hq hqo + have hP:=pow_pos hk + have hr:=qcq hx.1 hq hqo hs ho hsmall (w:=q0 k * q) (by nlinarith) + have hrun:=Prefix.trans h1 hr + unfold eval qad + dsimp -failIfUnchanged + have hadd : (e + 1 + f).toNat=e.toNat + (1 + f.toNat):= by omega + rw [hadd] + have heq : q0 (k + 1) * q + (x.b + x.c + v + 2) = + q0 k * q + x.b + x.c + v + 2 + q0 k * q:= by + have hD : q0 (k + 1)=2 * q0 k:= by + rw [q5 hk (by omega),pow2_one]; ring + rw [hD]; ring + rwa [heq] +theorem qaL {k : ℤ} {x : pair} {e s r : ℤ} {y : pair} {f : ℤ} + (h : qZ k (.Two x e)) (hs : qa k x s r) + (ho : q3 k x=false) (hsmall : qZ s (.Two y f)) : + qZ (k + 1) (.Two (qbu (qQ x s r y)) (e + 1 + f)):= by + rcases h with ⟨⟨hk,he,hx,hmass⟩,hreal⟩ + rcases hsmall.1 with ⟨hs0,hf,hy,hmass'⟩ + change 0 ≤ e at he + change 0 ≤ f at hf + rcases qan hx.1 hs hy with ⟨hnext,hc⟩ + unfold qZ qU qad + dsimp -failIfUnchanged + refine ⟨⟨by omega,by omega,widen_table hnext (by omega),?_⟩,?_⟩ + · change (qQ x s r y).b + (qQ x s r y).c=1 + 3 * (e + 1 + f) + have hnm:=qI x s r y + linarith + · intro q hq hqo + have h1:=qP hreal hk hq hqo + have hP:=pow_pos hk + have hr:=qcp hx.1 hq hqo hs ho hsmall (w:=q0 k * q) (by nlinarith) + have hrun:=Prefix.trans h1 hr + unfold eval qad + dsimp -failIfUnchanged + rw [widen_values q _ hk] + have hadd : (e + 1 + f).toNat=e.toNat + (1 + f.toNat):= by omega + rwa [hadd] +inductive Built : ℤ → entry → Prop where + | built_root : Built 0 (.One 1 0) + | built_one {k v e : ℤ} : Built k (.One v e) → Built (k + 1) (.Two ⟨1,1,v,0⟩ e) + | built_even {k : ℤ} {x : pair} {e : ℤ} : + Built k (.Two x e) → q3 k x=true → Built (k + 1) (.One (x.b + x.c + 3) (e + 1)) + | built_lookup_one {k : ℤ} {x : pair} {e s r v f : ℤ} : + Built k (.Two x e) → qa k x s r → q3 k x=false → + Built s (.One v f) → Built (k + 1) (.One (x.b + x.c + v + 2) (e + 1 + f)) + | built_lookup_two {k : ℤ} {x : pair} {e s r : ℤ} {y : pair} {f : ℤ} : + Built k (.Two x e) → qa k x s r → q3 k x=false → + Built s (.Two y f) → Built (k + 1) (.Two (qbu (qQ x s r y)) (e + 1 + f)) +theorem built_valid {k : ℤ} {f : entry} (h : Built k f) : qZ k f:= by + induction h with + | built_root => exact valid_root + | built_one _ ih => exact valid_add_one ih + | built_even _ he ih => exact qc1 ih he + | built_lookup_one _ hs ho _ ih1 ih2 => exact qaM ih1 hs ho ih2 + | built_lookup_two _ hs ho _ ih1 ih2 => exact qaL ih1 hs ho ih2 +inductive Boundary (lib : ℤ → entry → Prop) (k : ℤ) : pair → ℤ → ℕ → Prop where + | boundary_even (x : pair) : q3 k x=true → Boundary lib k x 1 1 + | boundary_one (x : pair) (s r v e : ℤ) : + qa k x s r → q3 k x=false → lib s (.One v e) → + Boundary lib k x (1 + e) 1 + | boundary_two (x : pair) (s r : ℤ) (y : pair) (e f : ℤ) (n : ℕ) : + qa k x s r → q3 k x=false → lib s (.Two y e) → + Boundary lib k (qQ x s r y) f n → Boundary lib k x (1 + e + f) (1 + n) +theorem qcm {k : ℤ} {x : pair} (hx : qaB k x) : 1 ≤ x.d:= by + rcases hx with ⟨hd0,_,hp0,hpd,_⟩ + by_contra hlt + have hd : x.d=0:= by omega + rw [hd,pow2_zero] at hpd + omega +theorem run_zero {e : ℕ} {xs ys : List ℤ} (h : run e (xs ++ [0]) ys) : exec e xs ys:= by + unfold run exec qbn at * + rw [List.map_append] at h + exact Prefix.Exec.zero (Prefix.run_exec h) +theorem qb5 {lib : ℤ → entry → Prop} {k : ℤ} {x : pair} {e : ℤ} {n : ℕ} + (hlib : ∀ s f,lib s f → qZ s f) + (hb : Boundary lib k x e n) (hx : qaB k x) : + 0 ≤ e ∧ (n : ℤ) + x.d ≤ k + 1 ∧ + ∀ q,1 ≤ q → qW q → exec e.toNat (qai k q x) [q0 k * q + x.b + x.c + 3 * e]:= by + induction hb with + | boundary_even x he => + refine ⟨by omega,by rcases hx with ⟨_,hdk,_⟩; omega,?_⟩ + intro q hq hqo + rcases qn hx hq with ⟨hu,hv⟩ + have hr:=run_even [] (by omega) hv (by omega : 0 ≤ (0 : ℤ)) (qaO hx hqo he) + apply run_zero + unfold qai + have heq : q0 k * q + x.b + x.c + 3 * 1=left k q x + right k q x + 0 + 3:= by + have:=qu k q x; linarith + rw [heq] + exact hr + | boundary_one x s r v e hs ho hsmall => + have hval:=hlib s (.One v e) hsmall + rcases hval.1 with ⟨hs0,he0,hv⟩ + change 0 ≤ e at he0 + change v=1 + 3 * e at hv + refine ⟨by omega,by rcases hx with ⟨_,hdk,_⟩; omega,?_⟩ + intro q hq hqo + have hr:=qcq hx hq hqo hs ho hval (w:=0) (by omega) + have heq : q0 k * q + x.b + x.c + 3 * (1 + e)=q0 k * q + x.b + x.c + v + 2 + 0:= by + linarith + have hadd : (1 + e).toNat=1 + e.toNat:= by omega + rw [heq,hadd] + exact run_zero hr + | boundary_two x s r y e f n hs ho hsmall htail ih => + have hval:=hlib s (.Two y e) hsmall + rcases hval.1 with ⟨hs0,he0,hy,hmass⟩ + change 0 ≤ e at he0 + rcases qan hx hs hy with ⟨hnext,hc⟩ + rcases ih hnext with ⟨hf,hdepth,hexec⟩ + have hyd : 1 ≤ y.d:=qcm hy.1 + refine ⟨by omega,?_,?_⟩ + · change (n : ℤ) + (x.d + y.d) ≤ k + 1 at hdepth + push_cast; omega + · intro q hq hqo + have hr:=qcp hx hq hqo hs ho hval (w:=0) (by omega) + rw [add_zero] at hr + have hr0:=run_zero (xs:=qai k q x) hr + have hrun:=Prefix.exec_trans hr0 (hexec q hq hqo) + unfold exec at * + have hadd : (1 + e + f).toNat=1 + e.toNat + f.toNat:= by omega + have heq : q0 k * q + x.b + x.c + 3 * (1 + e + f) = + q0 k * q + (qQ x s r y).b + (qQ x s r y).c + 3 * f:= by + have:=qI x s r y; linarith + rw [hadd,heq] + exact hrun +def qba (x : pair) : pair:=⟨x.p,x.d,x.b,x.c - 1⟩ +theorem qb9 {k : ℤ} {x : pair} (hx : qo k x) : qaB k (qba x):= by + rcases hx with ⟨⟨hd0,hdk,hp0,hpd,ho,hb,hc⟩,hhalf,hc0⟩ + exact ⟨hd0,hdk,hp0,hpd,ho,hb,by unfold qba; dsimp -failIfUnchanged; omega⟩ +theorem lower_values (k q : ℤ) (x : pair) : + qai k q (qba x)=[left k q x,right k q x - 1]:= by + unfold qai qba left right ql + dsimp -failIfUnchanged; congr 1; congr 1; ring +theorem qcs {e : ℕ} {k q : ℤ} (ys : List ℤ) {z : ℤ} + (hk : 1 ≤ k) (hq : 1 ≤ q) (hz : 1 ≤ z) + (h : Prefix.Run e (F k q) (qbn (ys ++ [z]))) : + Prefix.Run e (G k q) (qbn (ys ++ [z - 1])):= by + unfold F G qbn at * + rw [List.map_append] at * + simp only [List.map_cons,List.map_nil] at * + have hk1 : k.toNat=1 + (k - 1).toNat:= by omega + have hz1 : z.toNat=1 + (z - 1).toNat:= by omega + rw [hk1,hz1] at h + have hres:=Prefix.F_to_G (k:=(k - 1).toNat) (q:=q.toNat) (by omega) h + rw [hk1] + exact hres +theorem G_single {k v e : ℤ} (h : qZ k (.One v e)) (hk1 : 1 ≤ k) : + ∀ q,1 ≤ q → qW q → Prefix.Run e.toNat (G k q) (qbn [q0 k * q + v - 1]):= by + rcases h with ⟨⟨hk,he,hv⟩,hr⟩ + change 0 ≤ e at he + change v=1 + 3 * e at hv + have hP:=pow_pos hk + intro q hq ho + exact qcs [] hk1 hq (by nlinarith) (hr q hq ho) +theorem G_pair {k : ℤ} {x : pair} {e : ℤ} (h : qZ k (.Two x e)) (hk1 : 1 ≤ k) : + ∀ q,1 ≤ q → qW q → Prefix.Run e.toNat (G k q) (qbn (qai k q (qba x))):= by + rcases h with ⟨⟨hk,he,hx,hmass⟩,hr⟩ + intro q hq ho + rw [lower_values] + have hcoeff:=qac hx.1 + have hright : 1 ≤ right k q x:= by + unfold right + rcases hx with ⟨_,_,hc0⟩ + nlinarith + exact qcs [left k q x] hk1 hq hright (hr q hq ho) +def qaf (lib : ℤ → entry → Prop) (k : ℤ) (f : entry) : Prop := + match f with + | .One _ _ => True + | .Two x _ => ∃ e n,Boundary lib k (qba x) e n +theorem G_returns {lib : ℤ → entry → Prop} {k : ℤ} {f : entry} + (hlib : ∀ s g,lib s g → qZ s g) + (hvalid : qZ k f) (hr : qaf lib k f) (hk : 1 ≤ k) : + ∀ q,1 ≤ q → qW q → ∃ e m,Prefix.Exec e (G k q) [m]:= by + intro q hq ho + cases f with + | One v e => + exact ⟨e.toNat,(q0 k * q + v - 1).toNat,Prefix.run_exec (G_single hvalid hk q hq ho)⟩ + | Two x e => + rcases hr with ⟨f,n,hb⟩ + rcases qb5 hlib hb (qb9 hvalid.1.2.2.1) with ⟨hf,hn,hexec⟩ + exact ⟨e.toNat + f.toNat,(q0 k * q + (qba x).b + (qba x).c + 3 * f).toNat, + Prefix.exec_trans (Prefix.run_exec (G_pair hvalid hk q hq ho)) (hexec q hq ho)⟩ +end Table +namespace UniqueTable +open Table +theorem qaR {s r t u : ℤ} + (hs : 0 ≤ s) (ht : 0 ≤ t) (hr : qW r) (hu : qW u) + (he : q0 s * r=q0 t * u) : s=t ∧ r=u:= by + have hlt : ∀ a b x y,0 ≤ a → a < b → qW x → q0 a * x=q0 b * y → False:= by + intro a b x y ha hab ⟨z,hz⟩ heq + have hsp:=pow_split (k:=b) (d:=a) ha (by omega) + have hba:=pow_split (k:=b - a) (d:=1) (by omega) (by omega) + rw [pow2_one] at hba + have hp:=pow_pos ha + have hmul : q0 a * x=q0 a * (2 * (q0 (b - a - 1) * y)):= by + calc q0 a * x=q0 b * y:=heq + _ = q0 a * q0 (b - a) * y:= by rw [hsp] + _ = q0 a * (2 * q0 (b - a - 1)) * y:= by rw [hba] + _ = q0 a * (2 * (q0 (b - a - 1) * y)):= by ring + have hx : x=2 * (q0 (b - a - 1) * y):=mul_left_cancel₀ (by omega) hmul + omega + have hst : s=t:= by + rcases lt_trichotomy s t with h | h | h + · exfalso; exact hlt s t r u hs h hr he + · exact h + · exfalso; exact hlt t s u r ht h hu he.symm + subst hst + have hp:=pow_pos hs + exact ⟨rfl,mul_left_cancel₀ (by omega) he⟩ +theorem qK {k : ℤ} {x : pair} {s r t u : ℤ} + (h1 : qa k x s r) (h2 : qa k x t u) : s=t ∧ r=u:= by + rcases h1 with ⟨hs1,_,he1,hr⟩ + rcases h2 with ⟨ht1,_,he2,hu⟩ + exact qaR (by omega) (by omega) hr hu (by linarith) +theorem built_nonnegative {k : ℤ} {f : entry} (h : Built k f) : 0 ≤ k := + (built_valid h).1.1 +theorem qbC {k1 : ℤ} {f : entry} (h : Built k1 f) : + ∀ k2 g,k1=k2 → Built k2 g → f=g:= by + induction h with + | built_root => + intro k2 g hk hg + cases hg with + | built_root => rfl + | @built_one k2' _ _ hb => have:=built_nonnegative hb; omega + | @built_even k2' _ _ hb _ => have:=built_nonnegative hb; omega + | @built_lookup_one k2' _ _ _ _ _ _ hb _ _ _ => have:=built_nonnegative hb; omega + | @built_lookup_two k2' _ _ _ _ _ _ hb _ _ _ => have:=built_nonnegative hb; omega + | @built_one k1 v1 e1 hb ih => + intro k2 g hk hg + cases hg with + | built_root => have:=built_nonnegative hb; omega + | @built_one k2' v2 e2 hb2 => + have heq:=ih k2' _ (by omega) hb2 + injection heq with h1 h2 + subst h1 h2; rfl + | @built_even k2' _ _ hb2 _ => + have heq:=ih k2' _ (by omega) hb2 + contradiction + | @built_lookup_one k2' _ _ _ _ _ _ hb2 _ _ _ => + have heq:=ih k2' _ (by omega) hb2 + contradiction + | @built_lookup_two k2' _ _ _ _ _ _ hb2 _ _ _ => + have heq:=ih k2' _ (by omega) hb2 + contradiction + | @built_even k1 x1 e1 hb heven ih => + intro k2 g hk hg + cases hg with + | built_root => have:=built_nonnegative hb; omega + | @built_one k2' _ _ hb2 => + have heq:=ih k2' _ (by omega) hb2 + contradiction + | @built_even k2' x2 e2 hb2 heven2 => + have heq:=ih k2' _ (by omega) hb2 + injection heq with h1 h2 + subst h1 h2; rfl + | @built_lookup_one k2' x2 e2 _ _ _ _ hb2 _ hodd2 _ => + have hk' : k1=k2':= by omega + subst hk' + have heq:=ih k1 _ rfl hb2 + injection heq with h1 h2 + subst h1 h2 + rw [heven] at hodd2; contradiction + | @built_lookup_two k2' x2 e2 _ _ _ _ hb2 _ hodd2 _ => + have hk' : k1=k2':= by omega + subst hk' + have heq:=ih k1 _ rfl hb2 + injection heq with h1 h2 + subst h1 h2 + rw [heven] at hodd2; contradiction + | @built_lookup_one k1 x1 e1 s1 r1 v1 f1 hb hsep hodd hsmall ihprev ihsmall => + intro k2 g hk hg + cases hg with + | built_root => have:=built_nonnegative hb; omega + | @built_one k2' _ _ hb2 => + have heq:=ihprev k2' _ (by omega) hb2 + contradiction + | @built_even k2' x2 e2 hb2 heven2 => + have hk' : k1=k2':= by omega + subst hk' + have heq:=ihprev k1 _ rfl hb2 + injection heq with h1 h2 + subst h1 h2 + rw [hodd] at heven2; contradiction + | @built_lookup_one k2' x2 e2 s2 r2 v2 f2 hb2 hsep2 _ hsmall2 => + have hk' : k1=k2':= by omega + subst hk' + have heq:=ihprev k1 _ rfl hb2 + injection heq with h1 h2 + subst h1 h2 + rcases qK hsep hsep2 with ⟨rfl,rfl⟩ + have heq2:=ihsmall s1 _ rfl hsmall2 + injection heq2 with h3 h4 + subst h3 h4; rfl + | @built_lookup_two k2' x2 e2 s2 r2 y2 f2 hb2 hsep2 _ hsmall2 => + have hk' : k1=k2':= by omega + subst hk' + have heq:=ihprev k1 _ rfl hb2 + injection heq with h1 h2 + subst h1 h2 + rcases qK hsep hsep2 with ⟨rfl,rfl⟩ + have heq2:=ihsmall s1 _ rfl hsmall2 + contradiction + | @built_lookup_two k1 x1 e1 s1 r1 y1 f1 hb hsep hodd hsmall ihprev ihsmall => + intro k2 g hk hg + cases hg with + | built_root => have:=built_nonnegative hb; omega + | @built_one k2' _ _ hb2 => + have heq:=ihprev k2' _ (by omega) hb2 + contradiction + | @built_even k2' x2 e2 hb2 heven2 => + have hk' : k1=k2':= by omega + subst hk' + have heq:=ihprev k1 _ rfl hb2 + injection heq with h1 h2 + subst h1 h2 + rw [hodd] at heven2; contradiction + | @built_lookup_one k2' x2 e2 s2 r2 v2 f2 hb2 hsep2 _ hsmall2 => + have hk' : k1=k2':= by omega + subst hk' + have heq:=ihprev k1 _ rfl hb2 + injection heq with h1 h2 + subst h1 h2 + rcases qK hsep hsep2 with ⟨rfl,rfl⟩ + have heq2:=ihsmall s1 _ rfl hsmall2 + contradiction + | @built_lookup_two k2' x2 e2 s2 r2 y2 f2 hb2 hsep2 _ hsmall2 => + have hk' : k1=k2':= by omega + subst hk' + have heq:=ihprev k1 _ rfl hb2 + injection heq with h1 h2 + subst h1 h2 + rcases qK hsep hsep2 with ⟨rfl,rfl⟩ + have heq2:=ihsmall s1 _ rfl hsmall2 + injection heq2 with h3 h4 + subst h3 h4; rfl +theorem built_unique {k : ℤ} {f : entry} (h : Built k f) : + ∀ g,Built k g → f=g := + fun g hg => qbC h k g rfl hg +end UniqueTable +namespace CheckTable +open Table +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 +def qb7 (p : pair) (f : pair → Option entry) : Option entry := + q2 p.d fun d => + q2 p.p fun pp => + q2 p.b fun b => + q2 p.c fun c => + f ⟨pp,d,b,c⟩ +@[simp] theorem strictPair_eq (p : pair) (f : pair → Option entry) : + qb7 p f=f p:= by + cases p; simp [qb7] +def qaK (k : ℤ) (x : pair) : Option (ℤ × ℤ) := + q2 (h x) fun hx => + if 0 < hx then + let p:=q4 18 hx + q2 p.1 fun s => + q2 p.2 fun r => + if decide (1 ≤ s ∧ s < k - x.d ∧ hx=q0 s * r) && zodd r then + some (s,r) + else + none + else + none +theorem qaY {k : ℤ} {x : pair} {s r : ℤ} (hsep : qaK k x=some (s,r)) : + qa k x s r:= by + unfold qaK at hsep + simp only [strictInt_eq] at hsep + try dsimp -failIfUnchanged only at hsep + split_ifs at hsep with hpos hcond + injection hsep with hpair + injection hpair with hs hr + subst hs hr + rcases Bool.and_eq_true_iff.mp hcond with ⟨hdec,hodd⟩ + rcases of_decide_eq_true hdec with ⟨h1,h2,h3⟩ + exact ⟨h1,h2,h3,(zodd_iff _).mp hodd⟩ +def advance (lookup : ℤ → Option entry) (k : ℤ) (f : entry) : Option entry := + match f with + | .One v e => + q2 v fun v => + q2 e fun e => + some (.Two ⟨1,1,v,0⟩ e) + | .Two x e => + if q3 k x then + q2 (x.b + x.c + 3) fun v' => + q2 (e + 1) fun e' => + some (.One v' e') + else + match qaK k x with + | some (s,r) => + match lookup s with + | some (.One v f) => + q2 (x.b + x.c + v + 2) fun v' => + q2 (e + 1 + f) fun e' => + some (.One v' e') + | some (.Two y f) => + q2 (e + 1 + f) fun e' => + qb7 (qbu (qQ x s r y)) fun p' => + some (.Two p' e') + | none => none + | none => none +theorem advance_spec {lookup : ℤ → Option entry} {k : ℤ} {f g : entry} + (hlib : ∀ s x,lookup s=some x → Built s x) + (hf : Built k f) (hadv : advance lookup k f=some g) : + Built (k + 1) g:= by + cases f with + | One v e => + unfold advance at hadv + simp only [strictInt_eq] at hadv + try dsimp -failIfUnchanged only at hadv + injection hadv with h; subst h + exact Built.built_one hf + | Two x e => + unfold advance at hadv + simp only [strictInt_eq,strictPair_eq] at hadv + try dsimp -failIfUnchanged only at hadv + split_ifs at hadv with he + · injection hadv with h; subst h + exact Built.built_even hf he + · have he' : q3 k x=false:=Bool.eq_false_iff.mpr he + cases hsep : qaK k x with + | none => rw [hsep] at hadv; contradiction + | some sr => + rcases sr with ⟨s,r⟩ + rw [hsep] at hadv + try dsimp -failIfUnchanged only at hadv + have hs:=qaY hsep + cases hsmall : lookup s with + | none => rw [hsmall] at hadv; contradiction + | some entry_s => + rw [hsmall] at hadv + cases entry_s with + | One v f => + try dsimp -failIfUnchanged only at hadv + injection hadv with h; subst h + exact Built.built_lookup_one hf hs he' (hlib s _ hsmall) + | Two y f => + try dsimp -failIfUnchanged only at hadv + injection hadv with h; subst h + exact Built.built_lookup_two hf hs he' (hlib s _ hsmall) +def qbq : ℕ → (ℤ → Option entry) → ℤ → pair → Option (ℤ × ℕ) + | 0,_,_,_ => none + | fuel + 1,lookup,k,x => + if q3 k x then some (1,1) + else + match qaK k x with + | some (s,r) => + match lookup s with + | some (.One _ e) => some (1 + e,1) + | some (.Two y e) => + match qbq fuel lookup k (qQ x s r y) with + | some (f,n) => some (1 + e + f,1 + n) + | none => none + | none => none + | none => none +def nth_entry : List entry → ℕ → Option entry + | [],_ => none + | x :: _,0 => some x + | _ :: xs,n + 1 => nth_entry xs n +theorem qc7 (xs : List entry) (f : entry) (i : ℕ) : + nth_entry (xs ++ [f]) i = + if i < xs.length then nth_entry xs i + else if i=xs.length then some f + else none:= by + induction xs generalizing i with + | nil => + cases i <;> simp [nth_entry] + | cons x xs ih => + cases i with + | zero => simp [nth_entry] + | succ i => + simp only [List.cons_append,nth_entry,List.length_cons,ih i] + split_ifs <;> first | rfl | omega +def lookup (bank : List entry) (s : ℤ) : Option entry := + if 0 ≤ s then nth_entry bank s.toNat else none +def bank_ok (bank : List entry) : Prop := + ∀ (i : ℕ) (f : entry),nth_entry bank i=some f → Built (i : ℤ) f +theorem lookup_spec {bank : List entry} (hb : bank_ok bank) : + ∀ s f,lookup bank s=some f → Built s f:= by + intro s f hl + unfold lookup at hl + split_ifs at hl with hs + have h:=hb s.toNat f hl + rwa [Int.toNat_of_nonneg hs] at h +theorem bank_snoc {bank : List entry} {f : entry} (hbank : bank_ok bank) + (hf : Built (bank.length : ℤ) f) : + bank_ok (bank ++ [f]):= by + intro i g hget + rw [qc7] at hget + split_ifs at hget with hlt heq + · exact hbank i g hget + · injection hget with h; subst h; subst heq; exact hf +def qa8 : ℕ → Option (List entry) + | 0 => some [.One 1 0] + | n + 1 => + match qa8 n with + | some bank => + match nth_entry bank n with + | some f => + match advance (lookup bank) (n : ℤ) f with + | some g => some (bank ++ [g]) + | none => none + | none => none + | none => none +theorem qc0 (n : ℕ) (bank : List entry) (hb : qa8 n=some bank) : + bank.length=1 + n ∧ bank_ok bank:= by + induction n generalizing bank with + | zero => + unfold qa8 at hb + injection hb with h; subst h + refine ⟨rfl,?_⟩ + intro i f hget + cases i with + | zero => + unfold nth_entry at hget + injection hget with h; subst h + exact Built.built_root + | succ i => + cases i <;> contradiction + | succ n ih => + unfold qa8 at hb + cases hxs : qa8 n with + | none => rw [hxs] at hb; contradiction + | some xs => + rw [hxs] at hb + try dsimp -failIfUnchanged only at hb + rcases ih xs hxs with ⟨hlen,hbank⟩ + cases hf : nth_entry xs n with + | none => rw [hf] at hb; contradiction + | some f => + rw [hf] at hb + try dsimp -failIfUnchanged only at hb + cases hg : advance (lookup xs) (n : ℤ) f with + | none => rw [hg] at hb; contradiction + | some g => + rw [hg] at hb + try dsimp -failIfUnchanged only at hb + injection hb with h; subst h + refine ⟨by simp [hlen]; omega,?_⟩ + apply bank_snoc hbank + rw [hlen] + have hcast : ((1 + n : ℕ) : ℤ)=(n : ℤ) + 1:= by omega + rw [hcast] + exact advance_spec (lookup_spec hbank) (hbank n f hf) hg +def depth : entry → ℤ + | .One _ _ => 0 + | .Two x _ => x.d +def bounded (k : ℤ) (f : entry) : Prop := + qad f ≤ 4 * k ^ 3 ∧ depth f ≤ 6 * q1 k + 9 +def bank : List entry:=[ + .One 1 0, + .Two ⟨1,1,1,0⟩ 0, + .One 4 1, + .Two ⟨1,1,4,0⟩ 1, + .One 7 2, + .Two ⟨1,1,7,0⟩ 2, + .Two ⟨3,3,6,4⟩ 3, + .One 13 4, + .Two ⟨1,1,13,0⟩ 4, + .One 22 7, + .Two ⟨1,1,22,0⟩ 7, + .One 25 8, + .Two ⟨1,1,25,0⟩ 8, + .One 31 10, + .Two ⟨1,1,31,0⟩ 10, + .Two ⟨3,3,18,16⟩ 11, + .One 37 12, + .Two ⟨1,1,37,0⟩ 12 +] +theorem qaJ : qa8 17=some bank:= by decide +kernel +theorem checked_bank : bank_ok bank:=(qc0 17 bank qaJ).2 +theorem first : Built 1 (.Two ⟨1,1,1,0⟩ 0) := + Built.built_one Built.built_root +theorem pair.ext {x y : pair} (hp : x.p = y.p) (hd : x.d = y.d) (hb : x.b = y.b) (hc : x.c = y.c) : x = y := by + cases x; cases y; dsimp -failIfUnchanged at *; subst hp hd hb hc; rfl + +theorem nat_add_eq (a b : ℕ) : Nat.add a b = a + b := rfl +theorem nat_sub_eq (a b : ℕ) : Nat.sub a b = a - b := rfl +theorem nat_mul_eq (a b : ℕ) : Nat.mul a b = a * b := rfl +theorem nat_pow_eq (a b : ℕ) : Nat.pow a b = a ^ b := rfl +theorem nat_mod_eq (a b : ℕ) : Nat.mod a b = a % b := rfl + +inductive entry_nat where + | One (v e : ℕ) + | Two (p d b c e : ℕ) + deriving DecidableEq, Repr + +def to_pair (p d b c : ℕ) : pair := + ⟨(p : ℤ), (d : ℤ), (b : ℤ), (c : ℤ)⟩ + +def to_pair_c1 (p d b c1 : ℕ) : pair := + ⟨(p : ℤ), (d : ℤ), (b : ℤ), (c1 : ℤ) - 1⟩ + +def to_entry : entry_nat → entry + | .One v e => .One (v : ℤ) (e : ℤ) + | .Two p d b c e => .Two (to_pair p d b c) (e : ℤ) + +def ctz18 (m : ℕ) : ℕ × ℕ := + sNat (Nat.mod m 16) fun r4 => + if Nat.beq r4 0 then + sNat (Nat.div m 16) fun q4 => + sNat (Nat.mod q4 16) fun r8 => + if Nat.beq r8 0 then + sNat (Nat.div q4 16) fun q8 => + sNat (Nat.mod q8 16) fun r12 => + if Nat.beq r12 0 then + sNat (Nat.div q8 16) fun q12 => + sNat (Nat.mod q12 16) fun r16 => + if Nat.beq r16 0 then + sNat (Nat.div q12 16) fun q16 => + if Nat.beq (Nat.mod q16 4) 0 then (18, Nat.div q16 4) + else if Nat.beq (Nat.mod q16 2) 0 then (17, Nat.div q16 2) + else (16, q16) + else + if Nat.beq (Nat.mod r16 4) 0 then + if Nat.beq (Nat.mod r16 8) 0 then (15, Nat.div q12 8) else (14, Nat.div q12 4) + else if Nat.beq (Nat.mod r16 2) 0 then (13, Nat.div q12 2) else (12, q12) + else + if Nat.beq (Nat.mod r12 4) 0 then + if Nat.beq (Nat.mod r12 8) 0 then (11, Nat.div q8 8) else (10, Nat.div q8 4) + else if Nat.beq (Nat.mod r12 2) 0 then (9, Nat.div q8 2) else (8, q8) + else + if Nat.beq (Nat.mod r8 4) 0 then + if Nat.beq (Nat.mod r8 8) 0 then (7, Nat.div q4 8) else (6, Nat.div q4 4) + else if Nat.beq (Nat.mod r8 2) 0 then (5, Nat.div q4 2) else (4, q4) + else + if Nat.beq (Nat.mod r4 4) 0 then + if Nat.beq (Nat.mod r4 8) 0 then (3, Nat.div m 8) else (2, Nat.div m 4) + else if Nat.beq (Nat.mod r4 2) 0 then (1, Nat.div m 2) else (0, m) + +def bank_nat (s : ℕ) : Option entry_nat := + if Nat.ble s 8 then + if Nat.ble s 4 then + if Nat.ble s 2 then + if Nat.beq s 0 then some (.One 1 0) + else if Nat.beq s 1 then some (.Two 1 1 1 0 0) + else if Nat.beq s 2 then some (.One 4 1) + else none + else + if Nat.beq s 3 then some (.Two 1 1 4 0 1) + else if Nat.beq s 4 then some (.One 7 2) + else none + else + if Nat.ble s 6 then + if Nat.beq s 5 then some (.Two 1 1 7 0 2) + else if Nat.beq s 6 then some (.Two 3 3 6 4 3) + else none + else + if Nat.beq s 7 then some (.One 13 4) + else if Nat.beq s 8 then some (.Two 1 1 13 0 4) + else none + else + if Nat.ble s 13 then + if Nat.ble s 10 then + if Nat.beq s 9 then some (.One 22 7) + else if Nat.beq s 10 then some (.Two 1 1 22 0 7) + else none + else + if Nat.beq s 11 then some (.One 25 8) + else if Nat.beq s 12 then some (.Two 1 1 25 0 8) + else if Nat.beq s 13 then some (.One 31 10) + else none + else + if Nat.ble s 15 then + if Nat.beq s 14 then some (.Two 1 1 31 0 10) + else if Nat.beq s 15 then some (.Two 3 3 18 16 11) + else none + else + if Nat.beq s 16 then some (.One 37 12) + else if Nat.beq s 17 then some (.Two 1 1 37 0 12) + else none + +theorem bank_nat_lt18 (s : ℕ) (f : entry_nat) (h : bank_nat s = some f) : s < 18 := by + by_contra hge + have h1 : Nat.ble s 8 = false := by rw [Bool.eq_false_iff, ne_eq, Nat.ble_eq]; omega + have h2 : Nat.ble s 13 = false := by rw [Bool.eq_false_iff, ne_eq, Nat.ble_eq]; omega + have h3 : Nat.ble s 15 = false := by rw [Bool.eq_false_iff, ne_eq, Nat.ble_eq]; omega + have h4 : Nat.beq s 16 = false := by rw [Bool.eq_false_iff, ne_eq, Nat.beq_eq]; omega + have h5 : Nat.beq s 17 = false := by rw [Bool.eq_false_iff, ne_eq, Nat.beq_eq]; omega + unfold bank_nat at h + rw [h1, h2, h3, h4, h5] at h + contradiction + +theorem bank_nat_spec (s : ℕ) (f : entry_nat) (h : bank_nat s = some f) : + Built (s : ℤ) (to_entry f) := by + apply lookup_spec checked_bank (s : ℤ) (to_entry f) + have hs : s < 18 := bank_nat_lt18 s f h + rcases (by omega : s = 0 ∨ s = 1 ∨ s = 2 ∨ s = 3 ∨ s = 4 ∨ s = 5 ∨ s = 6 ∨ s = 7 ∨ s = 8 ∨ + s = 9 ∨ s = 10 ∨ s = 11 ∨ s = 12 ∨ s = 13 ∨ s = 14 ∨ s = 15 ∨ s = 16 ∨ s = 17) with + rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl <;> { + dsimp -failIfUnchanged [bank_nat] at h + injection h with h + subst h + decide + } + +def q3_nat (k p d b : ℕ) : Bool := + let qk := if Nat.ble (Nat.add d 1) k then b else Nat.add p b + Nat.beq (Nat.mod qk 2) 0 + +theorem q3_nat_eq (k p d b : ℕ) (c : ℤ) : + q3_nat k p d b = q3 (k : ℤ) ⟨(p : ℤ), (d : ℤ), (b : ℤ), c⟩ := by + unfold q3_nat q3 qk qb6 + dsimp -failIfUnchanged only + by_cases hlt : (d : ℤ) < (k : ℤ) + · have hble : Nat.ble (Nat.add d 1) k = true := by + rw [Nat.ble_eq, nat_add_eq]; omega + rw [if_pos hble, if_pos hlt] + by_cases hev : (b : ℤ) % 2 = 0 + · have hbeq : Nat.beq (Nat.mod b 2) 0 = true := by + rw [Nat.beq_eq, nat_mod_eq]; omega + rw [hbeq, decide_eq_true hev] + · have hbeq : Nat.beq (Nat.mod b 2) 0 = false := by + rw [Bool.eq_false_iff, ne_eq, Nat.beq_eq, nat_mod_eq]; omega + rw [hbeq, decide_eq_false hev] + · have hble : ¬ Nat.ble (Nat.add d 1) k = true := by + rw [Nat.ble_eq, nat_add_eq]; omega + rw [if_neg hble, if_neg hlt] + by_cases hev : ((p : ℤ) + (b : ℤ)) % 2 = 0 + · have hbeq : Nat.beq (Nat.mod (Nat.add p b) 2) 0 = true := by + rw [Nat.beq_eq, nat_mod_eq, nat_add_eq]; omega + rw [hbeq, decide_eq_true hev] + · have hbeq : Nat.beq (Nat.mod (Nat.add p b) 2) 0 = false := by + rw [Bool.eq_false_iff, ne_eq, Nat.beq_eq, nat_mod_eq, nat_add_eq]; omega + rw [hbeq, decide_eq_false hev] + +def qaK_nat (k d hx : ℕ) : Option (ℕ × ℕ) := + if Nat.beq (Nat.mod hx 2) 0 then + match ctz18 hx with + | (sn, rn) => + sNat rn fun r => + if Nat.ble 1 sn && Nat.ble (Nat.add (Nat.add sn d) 1) k && + Nat.beq hx (Nat.mul (Nat.pow 2 sn) r) && Nat.beq (Nat.mod r 2) 1 then + some (sn, r) + else none + else none + +theorem qaK_nat_spec {k p d b : ℕ} {c : ℤ} {hx s r : ℕ} + (hhx : (hx : ℤ) = h ⟨(p : ℤ), (d : ℤ), (b : ℤ), c⟩) + (hsep : qaK_nat k d hx = some (s, r)) : + qa (k : ℤ) ⟨(p : ℤ), (d : ℤ), (b : ℤ), c⟩ (s : ℤ) (r : ℤ) := by + unfold qaK_nat at hsep + split_ifs at hsep with hmod + rcases hctz : ctz18 hx with ⟨sn, rn⟩ + rw [hctz] at hsep + simp only [sNat_eq] at hsep + split_ifs at hsep with hcond + injection hsep with hpair + injection hpair with hs hr + subst hs + subst hr + rcases Bool.and_eq_true_iff.mp hcond with ⟨hcond1, hodd⟩ + rcases Bool.and_eq_true_iff.mp hcond1 with ⟨hcond2, hmul⟩ + rcases Bool.and_eq_true_iff.mp hcond2 with ⟨hs1, hsk⟩ + rw [Nat.ble_eq] at hs1 hsk + rw [Nat.beq_eq] at hmul hodd + simp only [nat_add_eq, nat_mul_eq, nat_pow_eq, nat_mod_eq] at hsk hmul hodd + have hq0 : q0 (sn : ℤ) = ((2 ^ sn : ℕ) : ℤ) := rfl + refine ⟨by omega, by dsimp -failIfUnchanged; omega, ?_, ?_⟩ + · rw [← hhx, hq0] + exact_mod_cast hmul + · refine ⟨(rn / 2 : ℕ), ?_⟩ + omega + +def qbq_nat : ℕ → ℕ → ℕ → ℕ → ℕ → ℕ → Bool + | 0, _, _, _, _, _ => false + | fuel + 1, k, p, d, b, c1 => + if q3_nat k p d b then true + else + sNat (Nat.add (Nat.add b (Nat.mul 2 c1)) 1) fun hx => + match qaK_nat k d hx with + | some (s, r) => + match bank_nat s with + | some (.One _ _) => true + | some (.Two yp yd yb yc _) => + if Nat.ble yd s && Nat.ble p (Nat.pow 2 (Nat.add d 1)) then + sNat (Nat.mul (Nat.mul yp (Nat.pow 2 (Nat.sub s yd))) r) fun dlt => + sNat (Nat.add (Nat.add hx yc) 1) fun num1 => + sNat (Nat.add dlt c1) fun den => + if Nat.ble den num1 then + sNat (Nat.mul yp (Nat.sub (Nat.pow 2 (Nat.add d 1)) p)) fun pp => + sNat (Nat.add d yd) fun dd => + sNat (Nat.add dlt yb) fun bb => + sNat (Nat.sub num1 den) fun cc1 => + qbq_nat fuel k pp dd bb cc1 + else false + else false + | none => false + | none => false + +theorem qbq_nat_spec {fuel k p d b c1 : ℕ} + (hfin : qbq_nat fuel k p d b c1 = true) : + ∃ e n, Boundary Built (k : ℤ) (to_pair_c1 p d b c1) e n := by + induction fuel generalizing p d b c1 with + | zero => contradiction + | succ fuel ih => + unfold qbq_nat at hfin + split_ifs at hfin with he + · rw [q3_nat_eq k p d b ((c1 : ℤ) - 1)] at he + exact ⟨1, 1, Boundary.boundary_even (to_pair_c1 p d b c1) he⟩ + · simp only [sNat_eq] at hfin + have he' : q3 (k : ℤ) (to_pair_c1 p d b c1) = false := by + unfold to_pair_c1 + rw [← q3_nat_eq k p d b ((c1 : ℤ) - 1)] + exact Bool.eq_false_iff.mpr he + set hx := Nat.add (Nat.add b (Nat.mul 2 c1)) 1 + have hhx_val : (hx : ℤ) = (b : ℤ) + 2 * (c1 : ℤ) + 1 := by + change ((b + 2 * c1 + 1 : ℕ) : ℤ) = (b : ℤ) + 2 * (c1 : ℤ) + 1 + omega + have hhx : (hx : ℤ) = h (to_pair_c1 p d b c1) := by + unfold to_pair_c1 h; dsimp -failIfUnchanged only; rw [hhx_val]; ring + cases hsep : qaK_nat k d hx with + | none => rw [hsep] at hfin; contradiction + | some sr => + rcases sr with ⟨s, r⟩ + rw [hsep] at hfin + dsimp -failIfUnchanged only at hfin + have hs := qaK_nat_spec hhx hsep + cases hsmall : bank_nat s with + | none => rw [hsmall] at hfin; contradiction + | some entry_s => + rw [hsmall] at hfin + have hbuilt_s := bank_nat_spec s entry_s hsmall + cases entry_s with + | One v f_cnt => + exact ⟨1 + (f_cnt : ℤ), 1, Boundary.boundary_one _ (s : ℤ) (r : ℤ) (v : ℤ) (f_cnt : ℤ) hs he' hbuilt_s⟩ + | Two yp yd yb yc f_cnt => + dsimp -failIfUnchanged only at hfin + split_ifs at hfin with hbounds hble + rcases Bool.and_eq_true_iff.mp hbounds with ⟨hyd_le, hp_le⟩ + rw [Nat.ble_eq] at hyd_le hp_le hble + simp only [nat_add_eq, nat_sub_eq, nat_mul_eq, nat_pow_eq] at hyd_le hp_le hble + rcases ih hfin with ⟨g_cnt, m_cnt, htail⟩ + have hqQ_eq : to_pair_c1 + (Nat.mul yp (Nat.sub (Nat.pow 2 (Nat.add d 1)) p)) + (Nat.add d yd) + (Nat.add (Nat.mul (Nat.mul yp (Nat.pow 2 (Nat.sub s yd))) r) yb) + (Nat.sub (Nat.add (Nat.add hx yc) 1) (Nat.add (Nat.mul (Nat.mul yp (Nat.pow 2 (Nat.sub s yd))) r) c1)) = + qQ (to_pair_c1 p d b c1) (s : ℤ) (r : ℤ) (to_pair yp yd yb yc) := by + have hq0_d1 : q0 ((d : ℤ) + 1) = ((2 ^ (d + 1) : ℕ) : ℤ) := rfl + have hq0_s : q0 ((s : ℤ) - (yd : ℤ)) = ((2 ^ (s - yd) : ℕ) : ℤ) := by + have hsub : (s : ℤ) - (yd : ℤ) = ((s - yd : ℕ) : ℤ) := by omega + rw [hsub]; rfl + apply pair.ext + · dsimp -failIfUnchanged only [to_pair_c1, to_pair, qQ] + simp only [nat_add_eq, nat_sub_eq, nat_mul_eq, nat_pow_eq, hq0_d1] + rw [Nat.cast_mul, Nat.cast_sub hp_le] + · dsimp -failIfUnchanged only [to_pair_c1, to_pair, qQ] + simp only [nat_add_eq] + push_cast; rfl + · dsimp -failIfUnchanged only [to_pair_c1, to_pair, qQ, delta] + simp only [nat_add_eq, nat_sub_eq, nat_mul_eq, nat_pow_eq, hq0_s] + push_cast; ring + · dsimp -failIfUnchanged only [to_pair_c1, to_pair, qQ, delta, h] + simp only [nat_add_eq, nat_sub_eq, nat_mul_eq, nat_pow_eq, hq0_s] + rw [Nat.cast_sub hble] + push_cast + rw [hhx_val] + ring + rw [hqQ_eq] at htail + exact ⟨1 + (f_cnt : ℤ) + g_cnt, 1 + m_cnt, + Boundary.boundary_two _ (s : ℤ) (r : ℤ) _ (f_cnt : ℤ) g_cnt m_cnt hs he' hbuilt_s htail⟩ + +def step1_nat (k : ℕ) (f : entry_nat) : Option entry_nat := + match f with + | .One v e => + if Nat.ble e (Nat.mul 4 (Nat.mul k (Nat.mul k k))) then + some (.Two 1 1 v 0 e) + else none + | .Two p d b c e => + if Nat.ble d 9 && Nat.ble e (Nat.mul 4 (Nat.mul k (Nat.mul k k))) then + if q3_nat k p d b then + sNat (Nat.add (Nat.add b c) 3) fun v' => + sNat (Nat.add e 1) fun e' => + some (.One v' e') + else if qbq_nat 4 k p d b c then + sNat (Nat.add (Nat.add b (Nat.mul 2 c)) 3) fun hx => + match qaK_nat k d hx with + | some (s, r) => + match bank_nat s with + | some (.One v f_cnt) => + sNat (Nat.add (Nat.add (Nat.add b c) v) 2) fun v' => + sNat (Nat.add (Nat.add e 1) f_cnt) fun e' => + some (.One v' e') + | some (.Two yp yd yb yc f_cnt) => + if Nat.ble yd s && Nat.ble p (Nat.pow 2 (Nat.add d 1)) then + sNat (Nat.mul (Nat.mul yp (Nat.pow 2 (Nat.sub s yd))) r) fun dlt => + sNat (Nat.add hx yc) fun num => + sNat (Nat.add (Nat.add dlt c) 1) fun den => + if Nat.ble den num then + sNat (Nat.mul yp (Nat.sub (Nat.pow 2 (Nat.add d 1)) p)) fun pp => + sNat (Nat.add (Nat.add d yd) 1) fun dd1 => + sNat (Nat.add dlt yb) fun bb => + sNat (Nat.sub num den) fun cc => + sNat (Nat.add (Nat.add e 1) f_cnt) fun e' => + some (.Two pp dd1 bb cc e') + else none + else none + | none => none + | none => none + else none + else none + +theorem step1_nat_spec {k : ℕ} {f g : entry_nat} + (hf : Built (k : ℤ) (to_entry f)) + (hstep : step1_nat k f = some g) : + Built ((k : ℤ) + 1) (to_entry g) ∧ + bounded (k : ℤ) (to_entry f) ∧ + qaf Built (k : ℤ) (to_entry f) := by + cases f with + | One v e => + unfold step1_nat at hstep + dsimp -failIfUnchanged only at hstep + split_ifs at hstep with hble + injection hstep with h; subst h + rw [Nat.ble_eq] at hble + simp only [nat_mul_eq] at hble + have hlog := qh (k : ℤ) + have hpow3 : ((4 * (k * (k * k)) : ℕ) : ℤ) = 4 * (k : ℤ) ^ 3 := by + push_cast; ring + refine ⟨Built.built_one hf, ⟨?_, ?_⟩, trivial⟩ + · dsimp -failIfUnchanged only [to_entry, qad]; rw [← hpow3]; exact_mod_cast hble + · dsimp -failIfUnchanged only [to_entry, depth]; omega + | Two p d b c e => + unfold step1_nat at hstep + dsimp -failIfUnchanged only at hstep + split_ifs at hstep with hbd hq3 hqbq + · simp only [sNat_eq] at hstep + injection hstep with h; subst h + rcases Bool.and_eq_true_iff.mp hbd with ⟨hd9, he_le⟩ + rw [Nat.ble_eq] at hd9 he_le + simp only [nat_mul_eq] at he_le + have hlog := qh (k : ℤ) + have hpow3 : ((4 * (k * (k * k)) : ℕ) : ℤ) = 4 * (k : ℤ) ^ 3 := by + push_cast; ring + have hq3_int : q3 (k : ℤ) (to_pair p d b c) = true := by + unfold to_pair; rw [← q3_nat_eq]; exact hq3 + have hq3_qba : q3 (k : ℤ) (qba (to_pair p d b c)) = true := by + unfold qba to_pair; dsimp -failIfUnchanged only; rw [← q3_nat_eq]; exact hq3 + refine ⟨?_, ⟨?_, ?_⟩, ⟨1, 1, Boundary.boundary_even _ hq3_qba⟩⟩ + · dsimp -failIfUnchanged only [to_entry, to_pair] + simp only [nat_add_eq] + push_cast + exact Built.built_even hf hq3_int + · dsimp -failIfUnchanged only [to_entry, qad]; rw [← hpow3]; exact_mod_cast he_le + · dsimp -failIfUnchanged only [to_entry, depth, to_pair]; omega + · simp only [sNat_eq] at hstep + rcases Bool.and_eq_true_iff.mp hbd with ⟨hd9, he_le⟩ + rw [Nat.ble_eq] at hd9 he_le + simp only [nat_mul_eq] at he_le + have hlog := qh (k : ℤ) + have hpow3 : ((4 * (k * (k * k)) : ℕ) : ℤ) = 4 * (k : ℤ) ^ 3 := by + push_cast; ring + have hbounded : bounded (k : ℤ) (to_entry (.Two p d b c e)) := by + refine ⟨?_, ?_⟩ + · dsimp -failIfUnchanged only [to_entry, qad]; rw [← hpow3]; exact_mod_cast he_le + · dsimp -failIfUnchanged only [to_entry, depth, to_pair]; omega + have hqaf : qaf Built (k : ℤ) (to_entry (.Two p d b c e)) := by + dsimp -failIfUnchanged only [qaf, to_entry] + have hqba_eq : qba (to_pair p d b c) = to_pair_c1 p d b c := rfl + rw [hqba_eq] + exact qbq_nat_spec hqbq + have he' : q3 (k : ℤ) (to_pair p d b c) = false := by + unfold to_pair; rw [← q3_nat_eq]; exact Bool.eq_false_iff.mpr hq3 + set hx := Nat.add (Nat.add b (Nat.mul 2 c)) 3 + have hhx_val : (hx : ℤ) = (b : ℤ) + 2 * (c : ℤ) + 3 := by + change ((b + 2 * c + 3 : ℕ) : ℤ) = (b : ℤ) + 2 * (c : ℤ) + 3 + omega + have hhx : (hx : ℤ) = h (to_pair p d b c) := by + unfold to_pair h; dsimp -failIfUnchanged only; exact hhx_val + cases hsep : qaK_nat k d hx with + | none => rw [hsep] at hstep; contradiction + | some sr => + rcases sr with ⟨s, r⟩ + rw [hsep] at hstep + dsimp -failIfUnchanged only at hstep + have hs := qaK_nat_spec hhx hsep + cases hsmall : bank_nat s with + | none => rw [hsmall] at hstep; contradiction + | some entry_s => + rw [hsmall] at hstep + have hbuilt_s := bank_nat_spec s entry_s hsmall + cases entry_s with + | One v f_cnt => + simp only [sNat_eq] at hstep + injection hstep with h; subst h + refine ⟨?_, hbounded, hqaf⟩ + dsimp -failIfUnchanged only [to_entry] + simp only [nat_add_eq] + push_cast + exact Built.built_lookup_one hf hs he' hbuilt_s + | Two yp yd yb yc f_cnt => + dsimp -failIfUnchanged only at hstep + split_ifs at hstep with hbounds hble + injection hstep with h; subst h + rcases Bool.and_eq_true_iff.mp hbounds with ⟨hyd_le, hp_le⟩ + rw [Nat.ble_eq] at hyd_le hp_le hble + simp only [nat_add_eq, nat_sub_eq, nat_mul_eq, nat_pow_eq] at hyd_le hp_le hble + refine ⟨?_, hbounded, hqaf⟩ + dsimp -failIfUnchanged only [to_entry] + have hqbu_eq : to_pair + (Nat.mul yp (Nat.sub (Nat.pow 2 (Nat.add d 1)) p)) + (Nat.add (Nat.add d yd) 1) + (Nat.add (Nat.mul (Nat.mul yp (Nat.pow 2 (Nat.sub s yd))) r) yb) + (Nat.sub (Nat.add hx yc) (Nat.add (Nat.add (Nat.mul (Nat.mul yp (Nat.pow 2 (Nat.sub s yd))) r) c) 1)) = + qbu (qQ (to_pair p d b c) (s : ℤ) (r : ℤ) (to_pair yp yd yb yc)) := by + have hq0_d1 : q0 ((d : ℤ) + 1) = ((2 ^ (d + 1) : ℕ) : ℤ) := rfl + have hq0_s : q0 ((s : ℤ) - (yd : ℤ)) = ((2 ^ (s - yd) : ℕ) : ℤ) := by + have hsub : (s : ℤ) - (yd : ℤ) = ((s - yd : ℕ) : ℤ) := by omega + rw [hsub]; rfl + apply pair.ext + · dsimp -failIfUnchanged only [to_pair, qbu, qQ] + simp only [nat_add_eq, nat_sub_eq, nat_mul_eq, nat_pow_eq, hq0_d1] + rw [Nat.cast_mul, Nat.cast_sub hp_le] + · dsimp -failIfUnchanged only [to_pair, qbu, qQ] + simp only [nat_add_eq] + push_cast; ring + · dsimp -failIfUnchanged only [to_pair, qbu, qQ, delta] + simp only [nat_add_eq, nat_sub_eq, nat_mul_eq, nat_pow_eq, hq0_s] + push_cast; ring + · dsimp -failIfUnchanged only [to_pair, qbu, qQ, delta, h] + simp only [nat_add_eq, nat_sub_eq, nat_mul_eq, nat_pow_eq, hq0_s] + rw [Nat.cast_sub hble] + push_cast + rw [hhx_val] + ring + rw [hqbu_eq] + simp only [nat_add_eq] + push_cast + exact Built.built_lookup_two hf hs he' hbuilt_s + +def qb_nat : ℕ → ℕ → entry_nat → Option entry_nat + | 0, k, f => step1_nat k f + | n + 1, k, f => + match qb_nat n k f with + | some g => sNat (Nat.add k (Nat.pow 2 n)) fun k' => qb_nat n k' g + | none => none + +theorem qc2_nat {n k : ℕ} {f f_end : entry_nat} + (hf : Built (k : ℤ) (to_entry f)) + (hcheck : qb_nat n k f = some f_end) : + Built (((k + 2 ^ n : ℕ) : ℤ)) (to_entry f_end) ∧ + ∀ j : ℤ, (k : ℤ) ≤ j ∧ j < ((k + 2 ^ n : ℕ) : ℤ) → + ∃ g, Built j g ∧ bounded j g ∧ qaf Built j g := by + induction n generalizing k f f_end with + | zero => + unfold qb_nat at hcheck + rcases step1_nat_spec hf hcheck with ⟨hb_end, hbd, hqaf⟩ + have hpow : k + 2 ^ 0 = k + 1 := rfl + rw [hpow] + refine ⟨by push_cast; exact hb_end, fun j hj => ?_⟩ + have hjk : j = (k : ℤ) := by omega + subst hjk + exact ⟨to_entry f, hf, hbd, hqaf⟩ + | succ n ih => + unfold qb_nat at hcheck + cases hmid : qb_nat n k f with + | none => rw [hmid] at hcheck; contradiction + | some g => + rw [hmid] at hcheck + simp only [sNat_eq] at hcheck + have hk' : Nat.add k (Nat.pow 2 n) = k + 2 ^ n := rfl + rw [hk'] at hcheck + rcases ih hf hmid with ⟨hg, hrange1⟩ + rcases ih hg hcheck with ⟨hend, hrange2⟩ + have hpow : k + 2 ^ (n + 1) = (k + 2 ^ n) + 2 ^ n := by + rw [Nat.pow_succ]; ring + rw [hpow] + refine ⟨hend, fun j hj => ?_⟩ + by_cases hjlt : j < ((k + 2 ^ n : ℕ) : ℤ) + · exact hrange1 j ⟨hj.1, hjlt⟩ + · exact hrange2 j ⟨by omega, by omega⟩ + +theorem chunk_0 : qb_nat 12 1 (.Two 1 1 1 0 0) = some (.Two 1 1 10951 0 3650) := by decide +kernel +theorem chunk_1 : qb_nat 12 4097 (.Two 1 1 10951 0 3650) = some (.Two 1 1 21925 0 7308) := by decide +kernel +theorem chunk_2 : qb_nat 12 8193 (.Two 1 1 21925 0 7308) = some (.One 32881 10960) := by decide +kernel +theorem chunk_3 : qb_nat 12 12289 (.One 32881 10960) = some (.One 43852 14617) := by decide +kernel +theorem chunk_4 : qb_nat 12 16385 (.One 43852 14617) = some (.One 54817 18272) := by decide +kernel +theorem chunk_5 : qb_nat 12 20481 (.One 54817 18272) = some (.Two 1 1 65782 0 21927) := by decide +kernel +theorem chunk_6 : qb_nat 12 24577 (.Two 1 1 65782 0 21927) = some (.Two 1 1 76735 0 25578) := by decide +kernel +theorem chunk_7 : qb_nat 12 28673 (.Two 1 1 76735 0 25578) = some (.Two 3 3 43848 43843 29230) := by decide +kernel +theorem chunk_8 : qb_nat 12 32769 (.Two 3 3 43848 43843 29230) = some (.Two 1 1 98653 0 32884) := by decide +kernel +theorem chunk_9 : qb_nat 12 36865 (.Two 1 1 98653 0 32884) = some (.Two 1 1 109615 0 36538) := by decide +kernel +theorem chunk_10 : qb_nat 12 40961 (.Two 1 1 109615 0 36538) = some (.Two 3 3 60294 60292 40195) := by decide +kernel +theorem chunk_11 : qb_nat 12 45057 (.Two 3 3 60294 60292 40195) = some (.Two 1 1 131542 0 43847) := by decide +kernel +theorem chunk_12 : qb_nat 12 49153 (.Two 1 1 131542 0 43847) = some (.Two 1 1 142513 0 47504) := by decide +kernel +theorem chunk_13 : qb_nat 12 53249 (.Two 1 1 142513 0 47504) = some (.Two 1 1 153469 0 51156) := by decide +kernel +theorem chunk_14 : qb_nat 12 57345 (.Two 1 1 153469 0 51156) = some (.Two 1 1 164437 0 54812) := by decide +kernel +theorem chunk_15 : qb_nat 12 61441 (.Two 1 1 164437 0 54812) = some (.Two 1 1 175393 0 58464) := by decide +kernel + +theorem q8_nat {n k k' : ℕ} {f g h : entry_nat} + (h1 : qb_nat n k f = some g) (h2 : qb_nat n k' g = some h) + (hk : Nat.add k (Nat.pow 2 n) = k' := by decide) : + qb_nat (n + 1) k f = some h := by + unfold qb_nat + rw [h1] + simp only [sNat_eq, hk] + exact h2 + +theorem qaH_nat : qb_nat 16 1 (.Two 1 1 1 0 0) = some (.Two 1 1 175393 0 58464) := by + have h13_0 := q8_nat chunk_0 chunk_1 + have h13_1 := q8_nat chunk_2 chunk_3 + have h13_2 := q8_nat chunk_4 chunk_5 + have h13_3 := q8_nat chunk_6 chunk_7 + have h13_4 := q8_nat chunk_8 chunk_9 + have h13_5 := q8_nat chunk_10 chunk_11 + have h13_6 := q8_nat chunk_12 chunk_13 + have h13_7 := q8_nat chunk_14 chunk_15 + have h14_0 := q8_nat h13_0 h13_1 + have h14_1 := q8_nat h13_2 h13_3 + have h14_2 := q8_nat h13_4 h13_5 + have h14_3 := q8_nat h13_6 h13_7 + have h15_0 := q8_nat h14_0 h14_1 + have h15_1 := q8_nat h14_2 h14_3 + exact q8_nat h15_0 h15_1 + +theorem base_structured (k : ℤ) (hk : 1 ≤ k ∧ k ≤ 65536) : + ∃ f, Built k f ∧ bounded k f ∧ qaf Built k f := by + exact (qc2_nat first qaH_nat).2 k (by omega) +theorem bank16 : lookup bank 16=some (.One 37 12):= by decide +kernel +theorem P16 : Built 16 (.One 37 12) := + lookup_spec checked_bank 16 (.One 37 12) bank16 +end CheckTable +namespace Bridge +open Table +def kernel (x : pair) : Block.kernel := + ⟨q0 x.d,x.p,x.b,x.b + x.c + 2⟩ +theorem kernel_good {s : ℤ} {x : pair} (hx : qo s x) : Block.good (kernel x):= by + rcases hx with ⟨⟨hd0,hdk,hp0,hpd,ho,hb,hc⟩,hhalf,hc0⟩ + unfold Block.good kernel + dsimp -failIfUnchanged + have hP:=pow_pos hd0 + refine ⟨hP,hp0,hhalf,hb,by omega⟩ +theorem gain_large {k : ℤ} {f : entry} (h : qZ k f) : k < 3 * (qad f + 1):= by + rcases h with ⟨⟨hk,he,hwf⟩,hr⟩ + have hr1:=hr 1 (by omega) ⟨0,rfl⟩ + have hl:=Prefix.run_length hr1 + unfold Table.F Prefix.F qbn at hl + rw [List.length_map,List.length_cons,Prefix.geometric_length] at hl + have hlen : (Table.eval k 1 f).length ≤ 2:= by + cases f <;> simp [Table.eval,qai] + omega +theorem kernel_gain {s : ℤ} {x : pair} {e : ℤ} (h : qZ s (.Two x e)) : + s < (kernel x).gain:= by + have hg:=gain_large h + rcases h.1 with ⟨hs,he,hx,hmass⟩ + unfold kernel qad at * + dsimp -failIfUnchanged at * + omega +theorem head_value {k q : ℤ} {x : pair} (hx : qaB k x) (hq : qW q) : + qb6 (left k q x)=q3 k x:= by + rcases qbS hx hq with ⟨a,ha⟩ + unfold q3 + rw [ha] + cases h1 : qb6 (qk k x + 2 * a) <;> cases h2 : qb6 (qk k x) + · rfl + · exfalso + rcases (qah _).mp h2 with ⟨b,hb⟩ + have hev : ZEven (qk k x + 2 * a):=⟨b + a,by linarith⟩ + have:=(qah _).mpr hev + rw [h1] at this; contradiction + · exfalso + rcases (qah _).mp h1 with ⟨b,hb⟩ + have hev : ZEven (qk k x):=⟨b - a,by linarith⟩ + have:=(qah _).mpr hev + rw [h2] at this; contradiction + · rfl +theorem lookup_parity {k : ℤ} {x : pair} {s r : ℤ} {y : pair} + (hx : qaB k x) (hs : qa k x s r) (hy : qo s y) : + q3 k (qQ x s r y)=q3 s y:= by + rcases qan hx hs hy with ⟨hnext,_⟩ + have hodd : qW 1:=⟨0,rfl⟩ + rw [← head_value hnext hodd,← qaF 1 hx hs hy] + exact head_value hy.1 (qz hx (by omega) hodd hs).2.1 +end Bridge +namespace Finite +open Table +theorem all_base {k : ℤ} {f : entry} (hk : 1 ≤ k ∧ k ≤ 65536) (hf : Built k f) : + CheckTable.bounded k f ∧ qaf Built k f:= by + rcases CheckTable.base_structured k hk with ⟨g,hg,hb,hr⟩ + have heq:=UniqueTable.built_unique hf g hg + subst heq + exact ⟨hb,hr⟩ +end Finite +namespace WordArith +def qa3 (n x : ℤ) : Prop:=∃ q : ℤ,x=q0 n * q +theorem div2_zero (n : ℤ) : qa3 n 0:=⟨0,by ring⟩ +theorem div2_refl (x : ℤ) : qa3 0 x:=⟨x,by simp [pow2_zero]⟩ +theorem div2_add {n x y : ℤ} (hx : qa3 n x) (hy : qa3 n y) : qa3 n (x + y):= by + rcases hx with ⟨a,rfl⟩ + rcases hy with ⟨b,rfl⟩ + exact ⟨a + b,by ring⟩ +theorem qb4 {n x y : ℤ} (hx : qa3 n x) (hy : qa3 n y) : qa3 n (x - y):= by + rcases hx with ⟨a,rfl⟩ + rcases hy with ⟨b,rfl⟩ + exact ⟨a - b,by ring⟩ +theorem qa7 {n x : ℤ} (a : ℤ) (hx : qa3 n x) : qa3 n (a * x):= by + rcases hx with ⟨b,rfl⟩ + exact ⟨a * b,by ring⟩ +theorem qp {n m x : ℤ} (hm : 0 ≤ m) (hmn : m ≤ n) (hx : qa3 n x) : qa3 m x:= by + rcases hx with ⟨a,rfl⟩ + refine ⟨q0 (n - m) * a,?_⟩ + rw [Table.pow_split hm hmn] + ring +theorem div2_product {n m x y : ℤ} (hn : 0 ≤ n) (hm : 0 ≤ m) + (hx : qa3 n x) (hy : qa3 m y) : qa3 (n + m) (x * y):= by + rcases hx with ⟨a,rfl⟩ + rcases hy with ⟨b,rfl⟩ + refine ⟨a * b,?_⟩ + rw [q5 hn hm] + ring +theorem qaa {n m x : ℤ} (hm : 0 ≤ m) (hmn : m ≤ n) + (h : qa3 n (q0 m * x)) : qa3 (n - m) x:= by + rcases h with ⟨a,ha⟩ + refine ⟨a,?_⟩ + rw [Table.pow_split hm hmn] at ha + have hp:=Table.pow_pos hm + nlinarith +def qab (x n : ℤ) : ℤ:=x / q0 n +theorem qbh {n x : ℤ} (hn : 0 ≤ n) (hx : qa3 n x) : x=q0 n * qab x n:= by + rcases hx with ⟨a,rfl⟩ + unfold qab + have hp:=Table.pow_pos hn + rw [Int.mul_ediv_cancel_left _ (by omega)] +theorem qat {n x : ℤ} (hn : 1 ≤ n) (ho : qW x) : ¬ qa3 n x:= by + intro hd + rcases ho with ⟨a,ha⟩ + rcases qp (by omega : 0 ≤ (1 : ℤ)) hn hd with ⟨b,hb⟩ + rw [pow2_one] at hb + omega +def ctz_nat : ℕ → ℕ → ℕ + | 0, _ => 0 + | fuel + 1, x => + if x % 2 = 0 then ctz_nat fuel (x / 2) + 1 else 0 +theorem ctz_nat_eq_q4 (fuel : ℕ) (x : ℤ) : + ((ctz_nat fuel x.natAbs : ℕ) : ℤ) = (q4 fuel x).1 := by + induction fuel generalizing x with + | zero => rfl + | succ fuel ih => + unfold ctz_nat q4 + by_cases hmod : x % 2 = 0 + · have hnat : x.natAbs % 2 = 0 := by omega + have hdiv : (x / 2).natAbs = x.natAbs / 2 := by omega + rw [if_pos hmod, if_pos hnat, ← hdiv] + push_cast + rw [ih (x / 2)] + · have hnat : x.natAbs % 2 ≠ 0 := by omega + rw [if_neg hmod, if_neg hnat] + rfl +theorem mod_two_mul_mod_two (x m : ℕ) : (x % (2 * m)) % 2 = x % 2 := by + have h := Nat.div_add_mod x (2 * m) + have h2 : 2 * m * (x / (2 * m)) = 2 * (m * (x / (2 * m))) := by ring + omega +theorem mod_two_mul_div_two (x m : ℕ) : (x % (2 * m)) / 2 = (x / 2) % m := by + rcases Nat.eq_zero_or_pos m with rfl | hm + · simp + · have h1 := Nat.div_add_mod x (2 * m) + have h2 := Nat.mod_lt x (by omega : 0 < 2 * m) + have h3 : x / 2 = m * (x / (2 * m)) + (x % (2 * m)) / 2 := by + have : 2 * m * (x / (2 * m)) = 2 * (m * (x / (2 * m))) := by ring + omega + have hlt : (x % (2 * m)) / 2 < m := by omega + rw [h3, Nat.mul_add_mod, Nat.mod_eq_of_lt hlt] +theorem div_two_mod_eq_zero (x m : ℕ) (hx : x % 2 = 0) : + (x / 2) % m = 0 ↔ x % (2 * m) = 0 := by + have hm2 := mod_two_mul_mod_two x m + rw [← mod_two_mul_div_two] + omega +theorem ctz_nat_step_k (k : ℕ) : + ∀ (fuel x : ℕ), + ctz_nat (k + fuel) x = + if x % (2 ^ k) = 0 then ctz_nat fuel (x / (2 ^ k)) + k + else ctz_nat k (x % (2 ^ k)) := by + induction k with + | zero => + intro fuel x + simp [Nat.mod_one] + | succ k ih => + intro fuel x + conv_lhs => rw [Nat.succ_add, ctz_nat] + have hpow : 2 ^ (k + 1) = 2 * 2 ^ k := by rw [Nat.pow_succ, Nat.mul_comm] + by_cases hx2 : x % 2 = 0 + · rw [if_pos hx2, ih fuel (x / 2)] + have hdiv_mod : (x / 2) % (2 ^ k) = 0 ↔ x % (2 ^ (k + 1)) = 0 := by + rw [hpow]; exact div_two_mod_eq_zero x (2 ^ k) hx2 + by_cases hxk : (x / 2) % (2 ^ k) = 0 + · have hxk' : x % (2 ^ (k + 1)) = 0 := hdiv_mod.mp hxk + rw [if_pos hxk, if_pos hxk'] + have hdiv2 : (x / 2) / (2 ^ k) = x / (2 ^ (k + 1)) := by + rw [hpow, Nat.div_div_eq_div_mul] + rw [hdiv2] + omega + · have hxk' : x % (2 ^ (k + 1)) ≠ 0 := fun h => hxk (hdiv_mod.mpr h) + rw [if_neg hxk, if_neg hxk'] + conv_rhs => unfold ctz_nat + have hmod2 : (x % (2 ^ (k + 1))) % 2 = 0 := by + rw [hpow, mod_two_mul_mod_two, hx2] + have hmod_div : (x % (2 ^ (k + 1))) / 2 = (x / 2) % (2 ^ k) := by + rw [hpow, mod_two_mul_div_two] + rw [if_pos hmod2, hmod_div] + · have hmod2 : (x % (2 ^ (k + 1))) % 2 ≠ 0 := by + rw [hpow, mod_two_mul_mod_two]; exact hx2 + have hxk' : x % (2 ^ (k + 1)) ≠ 0 := by omega + rw [if_neg hx2, if_neg hxk'] + conv_rhs => unfold ctz_nat + rw [if_neg hmod2] +def ctz_0 : ℕ → ℕ → ℕ + | 0, _ => 0 + | fuel + 1, x => + if Nat.beq (Nat.mod x 2) 0 then Nat.add (ctz_0 fuel (Nat.div x 2)) 1 else 0 +theorem ctz_0_eq : ∀ fuel x, ctz_0 fuel x = ctz_nat fuel x + | 0, _ => rfl + | fuel + 1, x => by + unfold ctz_0 ctz_nat + by_cases h : x % 2 = 0 + · have hb : Nat.beq (Nat.mod x 2) 0 = true := Nat.beq_eq.mpr h + rw [hb, if_pos rfl, if_pos h, ctz_0_eq fuel (Nat.div x 2)] + rfl + · have hb : Nat.beq (Nat.mod x 2) 0 = false := by + rw [Bool.eq_false_iff, ne_eq, Nat.beq_eq]; exact h + rw [hb, if_neg Bool.false_ne_true, if_neg h] +def ctz_split (k pk : ℕ) (f_low f_high : ℕ → ℕ → ℕ) (fuel x : ℕ) : ℕ := + match Nat.ble fuel k with + | true => f_low fuel x + | false => + sNat (Nat.mod x pk) fun r => + match Nat.beq r 0 with + | true => Nat.add (f_high (Nat.sub fuel k) (Nat.div x pk)) k + | false => f_low k r +theorem ctz_split_eq (k pk : ℕ) (f_low f_high : ℕ → ℕ → ℕ) (hpk : pk = 2 ^ k) + (hlow : ∀ fuel x, f_low fuel x = ctz_nat fuel x) + (hhigh : ∀ fuel x, f_high fuel x = ctz_nat fuel x) (fuel x : ℕ) : + ctz_split k pk f_low f_high fuel x = ctz_nat fuel x := by + unfold ctz_split + rw [hpk] + simp only [sNat_eq] + cases hle : Nat.ble fuel k + · have hle' : ¬ fuel ≤ k := by + intro h; have := Nat.ble_eq.mpr h; rw [hle] at this; contradiction + have hfuel : fuel = k + (fuel - k) := by omega + try dsimp -failIfUnchanged only + cases hmod : Nat.beq (Nat.mod x (2 ^ k)) 0 + · have hmod' : ¬ x % 2 ^ k = 0 := by + intro h + have h1 : Nat.beq (Nat.mod x (2 ^ k)) 0 = true := Nat.beq_eq.mpr h + rw [hmod] at h1; contradiction + try dsimp -failIfUnchanged only + rw [hlow] + conv_rhs => rw [hfuel, ctz_nat_step_k k (fuel - k) x, if_neg hmod'] + rfl + · have hmod' : x % 2 ^ k = 0 := Nat.beq_eq.mp hmod + try dsimp -failIfUnchanged only + rw [hhigh] + conv_rhs => rw [hfuel, ctz_nat_step_k k (fuel - k) x, if_pos hmod'] + rfl + · try dsimp -failIfUnchanged only + rw [hlow] +def ctz_1 : ℕ → ℕ → ℕ := ctz_split 1 2 ctz_0 ctz_0 +theorem ctz_1_eq : ∀ fuel x, ctz_1 fuel x = ctz_nat fuel x := + ctz_split_eq 1 2 ctz_0 ctz_0 rfl ctz_0_eq ctz_0_eq +def ctz_2 : ℕ → ℕ → ℕ := ctz_split 2 4 ctz_1 ctz_1 +theorem ctz_2_eq : ∀ fuel x, ctz_2 fuel x = ctz_nat fuel x := + ctz_split_eq 2 4 ctz_1 ctz_1 rfl ctz_1_eq ctz_1_eq +def ctz_4 : ℕ → ℕ → ℕ := ctz_split 4 16 ctz_2 ctz_2 +theorem ctz_4_eq : ∀ fuel x, ctz_4 fuel x = ctz_nat fuel x := + ctz_split_eq 4 16 ctz_2 ctz_2 rfl ctz_2_eq ctz_2_eq +def ctz_8 : ℕ → ℕ → ℕ := ctz_split 8 256 ctz_4 ctz_4 +theorem ctz_8_eq : ∀ fuel x, ctz_8 fuel x = ctz_nat fuel x := + ctz_split_eq 8 256 ctz_4 ctz_4 rfl ctz_4_eq ctz_4_eq +def ctz_16 : ℕ → ℕ → ℕ := ctz_split 16 65536 ctz_8 ctz_8 +theorem ctz_16_eq : ∀ fuel x, ctz_16 fuel x = ctz_nat fuel x := + ctz_split_eq 16 65536 ctz_8 ctz_8 rfl ctz_8_eq ctz_8_eq +def ctz_top_256 : ℕ → ℕ → ℕ := ctz_split 256 (Nat.pow 2 256) ctz_16 ctz_16 +theorem ctz_top_256_eq : ∀ fuel x, ctz_top_256 fuel x = ctz_nat fuel x := + ctz_split_eq 256 (Nat.pow 2 256) ctz_16 ctz_16 rfl ctz_16_eq ctz_16_eq +def ctz_top_64 : ℕ → ℕ → ℕ := ctz_split 64 (Nat.pow 2 64) ctz_16 ctz_top_256 +theorem ctz_top_64_eq : ∀ fuel x, ctz_top_64 fuel x = ctz_nat fuel x := + ctz_split_eq 64 (Nat.pow 2 64) ctz_16 ctz_top_256 rfl ctz_16_eq ctz_top_256_eq +def ctz_top_12 : ℕ → ℕ → ℕ := ctz_split 12 4096 ctz_4 ctz_top_64 +theorem ctz_top_12_eq : ∀ fuel x, ctz_top_12 fuel x = ctz_nat fuel x := + ctz_split_eq 12 4096 ctz_4 ctz_top_64 rfl ctz_4_eq ctz_top_64_eq +def ctz_fast : ℕ → ℕ → ℕ := ctz_split 4 16 ctz_2 ctz_top_12 +theorem ctz_fast_eq (fuel x : ℕ) : ctz_fast fuel x = ctz_nat fuel x := + ctz_split_eq 4 16 ctz_2 ctz_top_12 rfl ctz_2_eq ctz_top_12_eq fuel x +def qq (n x : ℤ) : ℤ := + if Nat.beq x.natAbs 0 then n else Int.ofNat (ctz_fast n.toNat x.natAbs) +theorem qq_eq_orig (n x : ℤ) : + qq n x = (if x = 0 then n else (q4 n.toNat x).1) := by + unfold qq + by_cases hx : x = 0 + · subst hx; simp + · have hna : Nat.beq x.natAbs 0 = false := by + rw [Bool.eq_false_iff, ne_eq, Nat.beq_eq, Int.natAbs_eq_zero]; exact hx + rw [hna, if_neg Bool.false_ne_true, if_neg hx] + change ((ctz_fast n.toNat x.natAbs : ℕ) : ℤ) = (q4 n.toNat x).1 + rw [ctz_fast_eq, ctz_nat_eq_q4] +theorem qal {n : ℤ} (x : ℤ) (hn : 0 ≤ n) : + (0 ≤ qq n x ∧ qq n x ≤ n) ∧ + ∃ q,x=q0 (qq n x) * q ∧ (qq n x < n → qW q):= by + rw [qq_eq_orig] + split_ifs with hx + · subst hx + exact ⟨⟨hn,le_refl n⟩,0,by ring,fun h => by omega⟩ + · rcases qaw n.toNat x with ⟨h0,h1,heq,hodd⟩ + rw [Int.toNat_of_nonneg hn] at h1 hodd + exact ⟨⟨h0,h1⟩,(q4 n.toNat x).2,heq,hodd⟩ +theorem qam {n : ℤ} (x : ℤ) (hn : 0 ≤ n) : qa3 (qq n x) x:= by + rcases (qal x hn).2 with ⟨q,hq,_⟩ + exact ⟨q,hq⟩ +theorem qL {n : ℤ} (x : ℤ) (hn : 0 ≤ n) : 0 ≤ qq n x ∧ qq n x ≤ n := + (qal x hn).1 +theorem qbO {n x : ℤ} (hn : 0 ≤ n) (hlt : qq n x < n) : + qW (qab x (qq n x)):= by + rcases qal x hn with ⟨⟨h0,_⟩,q,hx,hodd⟩ + have he:=qbh h0 (qam x hn) + have hp:=Table.pow_pos h0 + have hq : qab x (qq n x)=q:= by nlinarith + rw [hq] + exact hodd hlt +theorem div2_order {n x : ℤ} (hn : 0 ≤ n) : qa3 n x ↔ qq n x=n:= by + rcases qal x hn with ⟨⟨h0,h1⟩,q,hx,hodd⟩ + constructor + · intro h + by_contra hne + have hlt : qq n x < n:= by omega + rw [hx] at h + have hdiv:=qaa h0 h1 h + exact qat (by omega : 1 ≤ n - qq n x) (hodd hlt) hdiv + · intro h + rw [← h] + exact qam x hn +def qbg (n x : ℤ) : Bool := + match n with + | Int.ofNat 0 => true + | Int.ofNat (m + 1) => Nat.beq (x.natAbs % (2 ^ (m + 1))) 0 + | Int.negSucc _ => false +theorem qbs {n x : ℤ} (hn : 0 ≤ n) : qbg n x=true ↔ qa3 n x:= by + cases n with + | negSucc m => omega + | ofNat m => + have hq0 : q0 (Int.ofNat m) = Int.ofNat (2 ^ m) := rfl + have heq : qbg (Int.ofNat m) x = true ↔ (2 ^ m) ∣ x.natAbs := by + cases m with + | zero => simp [qbg] + | succ m => + simp only [qbg, Nat.beq_eq, Nat.dvd_iff_mod_eq_zero] + rw [heq, ← Int.ofNat_dvd_left] + unfold qa3 + rw [hq0] + rfl +theorem qbw {n x m q : ℤ} (hn : 0 ≤ n) (hm : 0 ≤ m) (hq : qW q) + (h : qa3 n (x - q0 m * q)) : + (qq n x < n → m=qq n x) ∧ (qq n x=n → n ≤ m):= by + rcases qal x hn with ⟨⟨hv0,hvn⟩,a,ha,ho⟩ + have hsame : qq n x < n → m=qq n x:= by + intro hvlt + rcases lt_trichotomy m (qq n x) with hlt | heq | hgt + · have h1 : qa3 (m + 1) x:=qp (by omega) (by omega) (qam x hn) + have h2 : qa3 (m + 1) (x - q0 m * q):=qp (by omega) (by omega) h + have h3 : qa3 (m + 1) (q0 m * q):= by + have hsub:=qb4 h1 h2 + have heq_sub : x - (x - q0 m * q)=q0 m * q:= by ring + rwa [heq_sub] at hsub + have h4:=qaa hm (by omega) h3 + exfalso + exact qat (by omega : 1 ≤ m + 1 - m) hq h4 + · exact heq + · have h1 : qa3 (qq n x + 1) (q0 m * q) := + qp (by omega) (by omega) ⟨q,rfl⟩ + have h2 : qa3 (qq n x + 1) (x - q0 m * q) := + qp (by omega) (by omega) h + have h3 : qa3 (qq n x + 1) (q0 (qq n x) * a):= by + have hsum:=div2_add h2 h1 + have heq_sum : x - q0 m * q + q0 m * q=q0 (qq n x) * a:= by linarith + rwa [heq_sum] at hsum + have h4:=qaa hv0 (by omega) h3 + exfalso + exact qat (by omega : 1 ≤ qq n x + 1 - qq n x) (ho hvlt) h4 + refine ⟨hsame,?_⟩ + intro hv0 + by_contra hlt + have h1 : qa3 n x:=(div2_order hn).mpr hv0 + have h2 : qa3 n (q0 m * q):= by + have hsub:=qb4 h1 h + have heq_sub : x - (x - q0 m * q)=q0 m * q:= by ring + rwa [heq_sub] at hsub + have h3:=qaa hm (by omega) h2 + exact qat (by omega : 1 ≤ n - m) hq h3 +end WordArith +namespace WordRelation +open WordArith +structure relation where + a : ℤ + q : ℤ + c : ℤ + n : ℤ + sa : ℤ + sb : ℤ + sn : ℤ + deriving DecidableEq,Repr +def qbd (z : relation) (S U : ℤ) : Prop := + 0 ≤ z.n ∧ 0 ≤ z.sn ∧ qW z.q ∧ qW z.sa ∧ + qa3 z.n (z.q * U - z.a * S - z.c) ∧ qa3 z.sn (z.sa * S - z.sb) +def choose (z : relation) (A Q C N a0 b0 p0 : ℤ) : relation := + if decide (z.n < N) then ⟨A,Q,C,N,a0,b0,p0⟩ + else ⟨z.a,z.q,z.c,z.n,a0,b0,p0⟩ +theorem qaU (z : relation) (A Q C N a0 b0 p0 S U : ℤ) + (hz : qbd z S U) (hN : 0 ≤ N) (hQ : qW Q) + (hR : qa3 N (Q * U - A * S - C)) (hp0 : 0 ≤ p0) (ha0 : qW a0) + (hS : qa3 p0 (a0 * S - b0)) : + qbd (choose z A Q C N a0 b0 p0) S U:= by + rcases hz with ⟨hn,hp,hq,ha,hr,hs⟩ + unfold choose + split_ifs <;> exact ⟨by assumption,hp0,by assumption,ha0,by assumption,hS⟩ +theorem eliminate (z : relation) (A Q C N S U : ℤ) + (hz : qbd z S U) (hN : 0 ≤ N) (hnew : qa3 N (Q * U - A * S - C)) : + qa3 (min N z.n) ((Q * z.a - z.q * A) * S - (z.q * C - Q * z.c)):= by + rcases hz with ⟨hn,hp,hq,ha,hr,hs⟩ + have hr' : qa3 (min N z.n) (z.q * U - z.a * S - z.c) := + qp (by omega) (by omega) hr + have hnew' : qa3 (min N z.n) (Q * U - A * S - C) := + qp (by omega) (by omega) hnew + have h:=qb4 (qa7 z.q hnew') (qa7 Q hr') + have heq : z.q * (Q * U - A * S - C) - Q * (z.q * U - z.a * S - z.c) = + (Q * z.a - z.q * A) * S - (z.q * C - Q * z.c):= by ring + rwa [heq] at h +theorem qaP (m A B S : ℤ) (hm : 0 ≤ m) (h : qa3 m (A * S - B)) : + qa3 (qq m A) B:= by + have hv:=qL A hm + have hA:=qa7 S (qam A hm) + have hB:=qp hv.1 hv.2 h + have hsub:=qb4 hA hB + have heq : S * A - (A * S - B)=B:= by ring + rwa [heq] at hsub +theorem qb3 (m A B S : ℤ) (hm : 0 ≤ m) (h : qa3 m (A * S - B)) : + qa3 (m - qq m A) (qab A (qq m A) * S - qab B (qq m A)):= by + have hv:=qL A hm + have hA:=qbh hv.1 (qam A hm) + have hB:=qbh hv.1 (qaP m A B S hm h) + apply qaa hv.1 hv.2 + have heq : q0 (qq m A) * (qab A (qq m A) * S - qab B (qq m A))=A * S - B:= by + have hA' := congr_arg (fun z => S * z) hA.symm + dsimp -failIfUnchanged only at hA' + linarith + rwa [heq] +theorem compatible (m a0 b0 p0 a1 b1 S : ℤ) (hm : 0 ≤ m) (hp : 0 ≤ p0) + (h0 : qa3 m (a0 * S - b0)) (h1 : qa3 p0 (a1 * S - b1)) : + qa3 (min m p0) (a0 * b1 - a1 * b0):= by + have h0':=qp (by omega) (by omega : min m p0 ≤ m) h0 + have h1':=qp (by omega) (by omega : min m p0 ≤ p0) h1 + have h:=qb4 (qa7 a1 h0') (qa7 a0 h1') + have heq : a1 * (a0 * S - b0) - a0 * (a1 * S - b1)=a0 * b1 - a1 * b0:= by ring + rwa [heq] at h +def qaC (r : relation) (f : relation → Option relation) : Option relation := + q2 r.a fun a => + q2 r.q fun q => + q2 r.c fun c => + q2 r.n fun n => + q2 r.sa fun sa => + q2 r.sb fun sb => + q2 r.sn fun sn => + f ⟨a,q,c,n,sa,sb,sn⟩ +@[simp] theorem strictRel_eq (r : relation) (f : relation → Option relation) : + qaC r f=f r:= by + cases r; simp [qaC] +def qbR (z : relation) (A Q C N : ℤ) : Option relation := + q2 (min N z.n) fun m => + q2 (Q * z.a - z.q * A) fun aa => + q2 (z.q * C - Q * z.c) fun bb => + q2 (qq m aa) fun v => + if qbg v bb then + if decide (v < m) then + q2 (qab aa v) fun ca => + q2 (qab bb v) fun cb => + q2 (m - v) fun cp => + if qbg (min cp z.sn) (ca * z.sb - z.sa * cb) then + if decide (z.sn < cp) then qaC (choose z A Q C N ca cb cp) some + else qaC (choose z A Q C N z.sa z.sb z.sn) some + else none + else qaC (choose z A Q C N z.sa z.sb z.sn) some + else none +theorem qce (z : relation) (A Q C N S U : ℤ) + (hz : qbd z S U) (hN : 0 ≤ N) (hQ : qW Q) + (hnew : qa3 N (Q * U - A * S - C)) : + ∃ z',qbR z A Q C N=some z' ∧ qbd z' S U:= by + have helim:=eliminate z A Q C N S U hz hN hnew + rcases hz with ⟨hn,hp,hq,ha,hU,hS⟩ + have hwhole : qbd z S U:=⟨hn,hp,hq,ha,hU,hS⟩ + have hm : 0 ≤ min N z.n:= by omega + have hv:=qL (Q * z.a - z.q * A) hm + have hB:=qaP (min N z.n) (Q * z.a - z.q * A) (z.q * C - Q * z.c) S hm helim + have hdiv:=qb3 (min N z.n) (Q * z.a - z.q * A) (z.q * C - Q * z.c) S hm helim + unfold qbR + simp only [strictInt_eq,strictRel_eq] + try dsimp -failIfUnchanged only + have htest : qbg (qq (min N z.n) (Q * z.a - z.q * A)) (z.q * C - Q * z.c)=true := + (qbs hv.1).mpr hB + rw [htest,if_pos rfl] + split_ifs with hlt hctest hsn + · have hlt' : qq (min N z.n) (Q * z.a - z.q * A) < min N z.n:=of_decide_eq_true hlt + have hO:=qbO hm hlt' + refine ⟨_,rfl,qaU z A Q C N _ _ _ S U hwhole hN hQ hnew (by omega) hO hdiv⟩ + · refine ⟨_,rfl,qaU z A Q C N _ _ _ S U hwhole hN hQ hnew hp ha hS⟩ + · exfalso + have hlt' : qq (min N z.n) (Q * z.a - z.q * A) < min N z.n:=of_decide_eq_true hlt + have hC:=compatible (min N z.n - qq (min N z.n) (Q * z.a - z.q * A)) + (qab (Q * z.a - z.q * A) (qq (min N z.n) (Q * z.a - z.q * A))) + (qab (z.q * C - Q * z.c) (qq (min N z.n) (Q * z.a - z.q * A))) + z.sn z.sa z.sb S (by omega) hp hdiv hS + have hC_true : qbg (min (min N z.n - qq (min N z.n) (Q * z.a - z.q * A)) z.sn) + (qab (Q * z.a - z.q * A) (qq (min N z.n) (Q * z.a - z.q * A)) * z.sb - + z.sa * qab (z.q * C - Q * z.c) (qq (min N z.n) (Q * z.a - z.q * A)))=true := + (qbs (by omega)).mpr hC + exact hctest hC_true + · refine ⟨_,rfl,qaU z A Q C N _ _ _ S U hwhole hN hQ hnew hp ha hS⟩ +def optional (z : Option relation) (S U : ℤ) : Prop := + match z with + | none => True + | some z => qbd z S U +def add (z : Option relation) (A Q C N : ℤ) : Option relation := + match z with + | none => some ⟨A,Q,C,N,1,0,0⟩ + | some z => qbR z A Q C N +theorem add_spec (z : Option relation) (A Q C N S U : ℤ) + (hz : optional z S U) (hN : 0 ≤ N) (hQ : qW Q) + (hnew : qa3 N (Q * U - A * S - C)) : + ∃ z',add z A Q C N=some z' ∧ qbd z' S U:= by + cases z with + | none => + refine ⟨⟨A,Q,C,N,1,0,0⟩,rfl,?_⟩ + unfold qbd + try dsimp -failIfUnchanged only + refine ⟨hN,by omega,hQ,⟨0,rfl⟩,hnew,?_⟩ + simpa using! div2_refl S + | some z => + exact qce z A Q C N S U hz hN hQ hnew +def qb2 (z : relation) (A Q : ℤ) : ℤ:=Q * z.a - z.q * A +def elim_b (z : relation) (B Q : ℤ) : ℤ:=z.q * B - Q * z.c +def qa2 (z : relation) (A Q : ℤ) : ℤ:=min z.n (z.sn + qq z.n (qb2 z A Q)) +def qa6 (z : relation) (A B Q : ℤ) : ℤ:=z.sa * elim_b z B Q - qb2 z A Q * z.sb +theorem qaZ (z : relation) (A B Q S U H : ℤ) + (hz : qbd z S U) (hH : H=A * S - Q * U + B) : + qa3 (qa2 z A Q) (qa6 z A B Q - z.sa * z.q * H):= by + rcases hz with ⟨hn,hp,hq,ha,hU,hS⟩ + have hv:=qL (qb2 z A Q) hn + have hmul:=div2_product hp hv.1 hS (qam (qb2 z A Q) hn) + have hcut0 : 0 ≤ qa2 z A Q:= by unfold qa2; omega + have hmul':=qp hcut0 (by unfold qa2; omega) hmul + have hscaled:=qa7 (z.sa * Q) hU + have hscaled':=qp hcut0 (by unfold qa2; omega) hscaled + have hsum:=div2_add hmul' hscaled' + unfold qa6 + have heq : (z.sa * S - z.sb) * qb2 z A Q + z.sa * Q * (z.q * U - z.a * S - z.c) = + z.sa * elim_b z B Q - qb2 z A Q * z.sb - z.sa * z.q * H:= by + unfold qb2 elim_b + rw [hH] + ring + rwa [heq] at hsum +theorem pruning_spec (z : relation) (A B Q S U D s t : ℤ) + (hz : qbd z S U) (hD : 0 ≤ D) (hs : 0 ≤ s) + (hH : A * S - Q * U + B=q0 (D + s) * (2 * t + 1)) : + let bound:=qa2 z A Q + let v:=qq bound (qa6 z A B Q) + (v < bound → s=v - D) ∧ (v=bound → bound - D ≤ s):= by + have hdiv:=qaZ z A B Q S U (q0 (D + s) * (2 * t + 1)) hz hH.symm + rcases hz with ⟨hn,hp,hQ,ha,hU,hS⟩ + have horder:=qL (qb2 z A Q) hn + have hbound : 0 ≤ qa2 z A Q:= by unfold qa2; omega + have hodd : qW (z.sa * z.q * (2 * t + 1)):= by + rcases hQ with ⟨u,hu⟩ + rcases ha with ⟨v,hv⟩ + refine ⟨2 * v * u * (2 * t + 1) + (v + u) * (2 * t + 1) + t,?_⟩ + rw [hu,hv]; ring + have heq : qa6 z A B Q - z.sa * z.q * (q0 (D + s) * (2 * t + 1)) = + qa6 z A B Q - q0 (D + s) * (z.sa * z.q * (2 * t + 1)):= by ring + rw [heq] at hdiv + rcases qbw hbound (by omega : 0 ≤ D + s) hodd hdiv with ⟨he,hle⟩ + try dsimp -failIfUnchanged only + refine ⟨fun h => by have:=he h; omega,fun h => by have:=hle h; omega⟩ +end WordRelation +namespace WordLibrary +open Table +structure kernel where + index : ℤ + pair : Table.pair + deriving DecidableEq,Repr +def gain (k : kernel) : ℤ:=k.pair.b + k.pair.c + 2 +def continuing (k : kernel) : Prop := + ∃ e,Built k.index (.Two k.pair e) ∧ 1 ≤ k.index ∧ q3 k.index k.pair=false +def qV : ℕ → ℤ → entry → Option (List entry) + | 0,_,f => some [f] + | n + 1,k,f => + match CheckTable.advance (CheckTable.lookup CheckTable.bank) k f with + | some g => + match qV n (k + 1) g with + | some xs => some (f :: xs) + | none => none + | none => none +theorem qbY (n : ℕ) (k : ℤ) (f : entry) (xs : List entry) + (hf : Built k f) (hb : qV n k f=some xs) : + xs.length=n + 1 ∧ + ∀ (i : ℕ) (g : entry),CheckTable.nth_entry xs i=some g → Built (k + (i : ℤ)) g:= by + induction n generalizing k f xs with + | zero => + unfold qV at hb + injection hb with h; subst h + refine ⟨rfl,?_⟩ + intro i g hget + cases i with + | zero => + unfold CheckTable.nth_entry at hget + injection hget with h; subst h + simpa using! hf + | succ i => + cases i <;> contradiction + | succ n ih => + unfold qV at hb + cases hadv : CheckTable.advance (CheckTable.lookup CheckTable.bank) k f with + | none => rw [hadv] at hb; contradiction + | some g => + rw [hadv] at hb + try dsimp -failIfUnchanged only at hb + cases hrest : qV n (k + 1) g with + | none => rw [hrest] at hb; contradiction + | some rest => + rw [hrest] at hb + try dsimp -failIfUnchanged only at hb + injection hb with h; subst h + have hg : Built (k + 1) g := + CheckTable.advance_spec (CheckTable.lookup_spec CheckTable.checked_bank) hf hadv + rcases ih (k + 1) g rest hg hrest with ⟨hlen,hok⟩ + refine ⟨by simp [hlen],?_⟩ + intro i h hget + cases i with + | zero => + unfold CheckTable.nth_entry at hget + injection hget with heq; subst heq + simpa using! hf + | succ i => + unfold CheckTable.nth_entry at hget + have hi:=hok i h hget + have heq : k + 1 + (i : ℤ)=k + ((i + 1 : ℕ) : ℤ):= by push_cast; ring + rwa [heq] at hi +def bank_opt : Option (List entry):=qV 2048 0 (.One 1 0) +def bank : List entry:=bank_opt.getD [] +theorem bank_opt_some : bank_opt.isSome=true:= by decide +kernel +theorem qaA {α : Type*} {o : Option α} (d : α) (h : o.isSome=true) : + o=some (o.getD d):= by + cases o with + | none => contradiction + | some xs => rfl +theorem qaJ : bank_opt=some bank := + qaA [] bank_opt_some +theorem qaq (xs : List entry) + (hb : qV 2048 0 (.One 1 0)=some xs) : + xs.length=2049 ∧ CheckTable.bank_ok xs:= by + rcases qbY 2048 0 (.One 1 0) xs Built.built_root hb with ⟨hlen,hok⟩ + refine ⟨hlen,fun i f hget => ?_⟩ + simpa using! hok i f hget +theorem bank_valid : bank.length=2049 ∧ CheckTable.bank_ok bank := + qaq bank qaJ +theorem qc8 {xs : List entry} {i : ℕ} (h : CheckTable.nth_entry xs i=none) : + xs.length ≤ i:= by + induction xs generalizing i with + | nil => simp + | cons x xs ih => + cases i with + | zero => contradiction + | succ i => + simp only [List.length_cons] + have:=ih h + omega +def qaI (k : ℤ) : List entry → List kernel + | [] => [] + | f :: r => + let rest:=qaI (k + 1) r + match f with + | .One _ _ => rest + | .Two x _ => + if decide (1 ≤ k) then + if q3 k x then rest else ⟨k,x⟩ :: rest + else rest +theorem collect_tail (k : ℤ) (f : entry) (xs : List entry) (z : kernel) + (hz : z ∈ qaI (k + 1) xs) : z ∈ qaI k (f :: xs):= by + cases f with + | One _ _ => exact hz + | Two x _ => + unfold qaI + try dsimp -failIfUnchanged only + split_ifs <;> simp [hz] +theorem qbB (k : ℤ) (xs : List entry) (i : ℕ) (x : Table.pair) (e : ℤ) + (hget : CheckTable.nth_entry xs i=some (.Two x e)) + (hk : 1 ≤ k + (i : ℤ)) + (he : q3 (k + (i : ℤ)) x=false) : + ⟨k + (i : ℤ),x⟩ ∈ qaI k xs:= by + induction xs generalizing k i with + | nil => contradiction + | cons f xs ih => + cases i with + | zero => + unfold CheckTable.nth_entry at hget + injection hget with hf; subst hf + simp only [Nat.cast_zero,add_zero] at hk he ⊢ + unfold qaI + try dsimp -failIfUnchanged only + rw [if_pos (decide_eq_true hk),he] + simp + | succ i => + unfold CheckTable.nth_entry at hget + apply collect_tail + have heq : k + ((i + 1 : ℕ) : ℤ)=(k + 1) + (i : ℤ):= by push_cast; ring + rw [heq] at hk he ⊢ + exact ih (k + 1) i hget hk he +theorem qap (xs : List entry) + (hlen : xs.length=2049) (hbank : CheckTable.bank_ok xs) + (k : kernel) (hk : continuing k) (hmax : k.index ≤ 2048) : + k ∈ qaI 0 xs:= by + rcases k with ⟨s,x⟩ + rcases hk with ⟨e,hb,hs,he⟩ + dsimp -failIfUnchanged at hb hs he hmax + have hs0 : 0 ≤ s:= by omega + cases hg : CheckTable.nth_entry xs s.toNat with + | none => + have hle:=qc8 hg + omega + | some g => + have hbuilt:=hbank s.toNat g hg + rw [Int.toNat_of_nonneg hs0] at hbuilt + have heq:=UniqueTable.built_unique hb g hbuilt + subst heq + have hs_eq : s=0 + (s.toNat : ℤ):= by omega + rw [hs_eq] + apply qbB 0 xs s.toNat x e hg (by omega) + rwa [← hs_eq] +def library : List kernel:=qaI 0 bank +theorem qby (k : kernel) (hk : continuing k) (hmax : k.index ≤ 2048) : + k ∈ library := + qap bank bank_valid.1 bank_valid.2 k hk hmax +def lib_0a : List kernel:=[ + ⟨5,⟨1,1,7,0⟩⟩,⟨8,⟨1,1,13,0⟩⟩,⟨12,⟨1,1,25,0⟩⟩,⟨14,⟨1,1,31,0⟩⟩,⟨17,⟨1,1,37,0⟩⟩,⟨22,⟨1,1,49,0⟩⟩, + ⟨24,⟨1,1,55,0⟩⟩,⟨27,⟨1,1,61,0⟩⟩,⟨32,⟨1,1,79,0⟩⟩,⟨35,⟨1,1,85,0⟩⟩,⟨40,⟨1,1,97,0⟩⟩,⟨42,⟨1,1,103,0⟩⟩, + ⟨45,⟨1,1,109,0⟩⟩,⟨49,⟨1,1,121,0⟩⟩,⟨51,⟨1,1,127,0⟩⟩,⟨54,⟨1,1,133,0⟩⟩,⟨59,⟨1,1,145,0⟩⟩,⟨61,⟨1,1,151,0⟩⟩, + ⟨64,⟨1,1,157,0⟩⟩ +] +def lib_0b : List kernel:=[ + ⟨65,⟨3,3,87,79⟩⟩ +] +def lib_0c : List kernel:=[ + ⟨68,⟨1,1,175,0⟩⟩,⟨71,⟨1,1,181,0⟩⟩,⟨76,⟨1,1,193,0⟩⟩,⟨78,⟨1,1,199,0⟩⟩, + ⟨81,⟨1,1,205,0⟩⟩,⟨85,⟨1,1,217,0⟩⟩,⟨87,⟨1,1,223,0⟩⟩,⟨90,⟨1,1,229,0⟩⟩,⟨95,⟨1,1,241,0⟩⟩,⟨97,⟨1,1,247,0⟩⟩, + ⟨100,⟨1,1,253,0⟩⟩,⟨101,⟨3,3,141,127⟩⟩,⟨106,⟨1,1,277,0⟩⟩,⟨111,⟨1,1,289,0⟩⟩,⟨113,⟨1,1,295,0⟩⟩,⟨116,⟨1,1,301,0⟩⟩, + ⟨120,⟨1,1,313,0⟩⟩,⟨122,⟨1,1,319,0⟩⟩,⟨125,⟨1,1,325,0⟩⟩,⟨130,⟨1,1,337,0⟩⟩,⟨132,⟨1,1,343,0⟩⟩ +] +def lib_0 : List kernel:=lib_0a ++ lib_0b ++ lib_0c +def lib_1 : List kernel:=[ + ⟨135,⟨1,1,349,0⟩⟩,⟨136,⟨3,3,183,175⟩⟩,⟨139,⟨1,1,367,0⟩⟩,⟨142,⟨1,1,373,0⟩⟩,⟨147,⟨1,1,385,0⟩⟩,⟨149,⟨1,1,391,0⟩⟩, + ⟨152,⟨1,1,397,0⟩⟩,⟨156,⟨1,1,409,0⟩⟩,⟨158,⟨1,1,415,0⟩⟩,⟨161,⟨1,1,421,0⟩⟩,⟨166,⟨1,1,433,0⟩⟩,⟨168,⟨1,1,439,0⟩⟩, + ⟨171,⟨1,1,445,0⟩⟩,⟨176,⟨1,1,463,0⟩⟩,⟨179,⟨1,1,469,0⟩⟩,⟨184,⟨1,1,481,0⟩⟩,⟨186,⟨1,1,487,0⟩⟩,⟨189,⟨1,1,493,0⟩⟩, + ⟨193,⟨1,1,505,0⟩⟩,⟨195,⟨1,1,511,0⟩⟩,⟨198,⟨1,1,517,0⟩⟩,⟨203,⟨1,1,529,0⟩⟩,⟨205,⟨1,1,535,0⟩⟩,⟨208,⟨1,1,541,0⟩⟩, + ⟨209,⟨3,3,279,271⟩⟩,⟨212,⟨1,1,559,0⟩⟩,⟨215,⟨1,1,565,0⟩⟩,⟨220,⟨1,1,577,0⟩⟩,⟨222,⟨1,1,583,0⟩⟩,⟨225,⟨1,1,589,0⟩⟩, + ⟨229,⟨1,1,601,0⟩⟩,⟨231,⟨1,1,607,0⟩⟩,⟨234,⟨1,1,613,0⟩⟩,⟨239,⟨1,1,625,0⟩⟩,⟨241,⟨1,1,631,0⟩⟩,⟨244,⟨1,1,637,0⟩⟩, + ⟨248,⟨1,1,655,0⟩⟩,⟨251,⟨1,1,661,0⟩⟩,⟨256,⟨1,1,673,0⟩⟩,⟨258,⟨1,1,679,0⟩⟩,⟨261,⟨1,1,685,0⟩⟩ +] +def lib_2 : List kernel:=[ + ⟨265,⟨1,1,697,0⟩⟩,⟨267,⟨1,1,703,0⟩⟩,⟨270,⟨1,1,709,0⟩⟩,⟨275,⟨1,1,721,0⟩⟩,⟨277,⟨1,1,727,0⟩⟩,⟨280,⟨1,1,733,0⟩⟩, + ⟨281,⟨3,3,375,367⟩⟩,⟨284,⟨1,1,751,0⟩⟩,⟨287,⟨1,1,757,0⟩⟩,⟨292,⟨1,1,769,0⟩⟩,⟨294,⟨1,1,775,0⟩⟩,⟨297,⟨1,1,781,0⟩⟩, + ⟨301,⟨1,1,793,0⟩⟩,⟨303,⟨1,1,799,0⟩⟩,⟨306,⟨1,1,805,0⟩⟩,⟨311,⟨1,1,817,0⟩⟩,⟨313,⟨1,1,823,0⟩⟩,⟨316,⟨1,1,829,0⟩⟩, + ⟨321,⟨1,1,847,0⟩⟩,⟨324,⟨1,1,853,0⟩⟩,⟨329,⟨1,1,865,0⟩⟩,⟨331,⟨1,1,871,0⟩⟩,⟨334,⟨1,1,877,0⟩⟩,⟨338,⟨1,1,889,0⟩⟩, + ⟨340,⟨1,1,895,0⟩⟩,⟨343,⟨1,1,901,0⟩⟩,⟨348,⟨1,1,913,0⟩⟩,⟨350,⟨1,1,919,0⟩⟩,⟨353,⟨1,1,925,0⟩⟩,⟨354,⟨3,3,471,463⟩⟩, + ⟨357,⟨1,1,943,0⟩⟩,⟨360,⟨1,1,949,0⟩⟩,⟨365,⟨1,1,961,0⟩⟩,⟨367,⟨1,1,967,0⟩⟩,⟨370,⟨1,1,973,0⟩⟩,⟨374,⟨1,1,985,0⟩⟩, + ⟨376,⟨1,1,991,0⟩⟩,⟨379,⟨1,1,997,0⟩⟩,⟨384,⟨1,1,1009,0⟩⟩,⟨386,⟨1,1,1015,0⟩⟩,⟨389,⟨1,1,1021,0⟩⟩ +] +def lib_3 : List kernel:=[ + ⟨394,⟨1,1,1051,0⟩⟩,⟨397,⟨1,1,1057,0⟩⟩,⟨399,⟨1,1,1063,0⟩⟩,⟨402,⟨1,1,1069,0⟩⟩,⟨406,⟨1,1,1081,0⟩⟩,⟨408,⟨1,1,1087,0⟩⟩, + ⟨411,⟨1,1,1093,0⟩⟩,⟨416,⟨1,1,1105,0⟩⟩,⟨418,⟨1,1,1111,0⟩⟩,⟨421,⟨1,1,1117,0⟩⟩,⟨422,⟨3,3,567,559⟩⟩,⟨425,⟨1,1,1135,0⟩⟩, + ⟨428,⟨1,1,1141,0⟩⟩,⟨433,⟨1,1,1153,0⟩⟩,⟨435,⟨1,1,1159,0⟩⟩,⟨438,⟨1,1,1165,0⟩⟩,⟨442,⟨1,1,1177,0⟩⟩,⟨444,⟨1,1,1183,0⟩⟩, + ⟨447,⟨1,1,1189,0⟩⟩,⟨452,⟨1,1,1201,0⟩⟩,⟨454,⟨1,1,1207,0⟩⟩,⟨457,⟨1,1,1213,0⟩⟩,⟨462,⟨1,1,1231,0⟩⟩,⟨465,⟨1,1,1237,0⟩⟩, + ⟨470,⟨1,1,1249,0⟩⟩,⟨472,⟨1,1,1255,0⟩⟩,⟨475,⟨1,1,1261,0⟩⟩,⟨479,⟨1,1,1273,0⟩⟩,⟨481,⟨1,1,1279,0⟩⟩,⟨484,⟨1,1,1285,0⟩⟩, + ⟨489,⟨1,1,1297,0⟩⟩,⟨491,⟨1,1,1303,0⟩⟩,⟨494,⟨1,1,1309,0⟩⟩,⟨495,⟨3,3,663,655⟩⟩,⟨498,⟨1,1,1327,0⟩⟩,⟨501,⟨1,1,1333,0⟩⟩, + ⟨506,⟨1,1,1345,0⟩⟩,⟨508,⟨1,1,1351,0⟩⟩,⟨511,⟨1,1,1357,0⟩⟩,⟨515,⟨1,1,1369,0⟩⟩,⟨517,⟨1,1,1375,0⟩⟩ +] +def lib_4 : List kernel:=[ + ⟨520,⟨1,1,1381,0⟩⟩,⟨525,⟨1,1,1393,0⟩⟩,⟨527,⟨1,1,1399,0⟩⟩,⟨530,⟨1,1,1405,0⟩⟩,⟨534,⟨1,1,1423,0⟩⟩,⟨537,⟨1,1,1429,0⟩⟩, + ⟨542,⟨1,1,1441,0⟩⟩,⟨544,⟨1,1,1447,0⟩⟩,⟨547,⟨1,1,1453,0⟩⟩,⟨551,⟨1,1,1465,0⟩⟩,⟨553,⟨1,1,1471,0⟩⟩,⟨556,⟨1,1,1477,0⟩⟩, + ⟨561,⟨1,1,1489,0⟩⟩,⟨563,⟨1,1,1495,0⟩⟩,⟨566,⟨1,1,1501,0⟩⟩,⟨567,⟨3,3,759,751⟩⟩,⟨570,⟨1,1,1519,0⟩⟩,⟨573,⟨1,1,1525,0⟩⟩, + ⟨578,⟨1,1,1537,0⟩⟩,⟨580,⟨1,1,1543,0⟩⟩,⟨583,⟨1,1,1549,0⟩⟩,⟨587,⟨1,1,1561,0⟩⟩,⟨589,⟨1,1,1567,0⟩⟩,⟨592,⟨1,1,1573,0⟩⟩, + ⟨597,⟨1,1,1585,0⟩⟩,⟨599,⟨1,1,1591,0⟩⟩,⟨602,⟨1,1,1597,0⟩⟩,⟨607,⟨1,1,1615,0⟩⟩,⟨610,⟨1,1,1621,0⟩⟩,⟨615,⟨1,1,1633,0⟩⟩, + ⟨617,⟨1,1,1639,0⟩⟩,⟨620,⟨1,1,1645,0⟩⟩,⟨624,⟨1,1,1657,0⟩⟩,⟨626,⟨1,1,1663,0⟩⟩,⟨629,⟨1,1,1669,0⟩⟩,⟨634,⟨1,1,1681,0⟩⟩, + ⟨636,⟨1,1,1687,0⟩⟩,⟨639,⟨1,1,1693,0⟩⟩,⟨640,⟨3,3,855,847⟩⟩,⟨643,⟨1,1,1711,0⟩⟩,⟨646,⟨1,1,1717,0⟩⟩ +] +def lib_5 : List kernel:=[ + ⟨651,⟨1,1,1729,0⟩⟩,⟨653,⟨1,1,1735,0⟩⟩,⟨656,⟨1,1,1741,0⟩⟩,⟨660,⟨1,1,1753,0⟩⟩,⟨662,⟨1,1,1759,0⟩⟩,⟨665,⟨1,1,1765,0⟩⟩, + ⟨670,⟨1,1,1777,0⟩⟩,⟨672,⟨1,1,1783,0⟩⟩,⟨675,⟨1,1,1789,0⟩⟩,⟨676,⟨3,3,909,895⟩⟩,⟨681,⟨1,1,1813,0⟩⟩,⟨686,⟨1,1,1825,0⟩⟩, + ⟨688,⟨1,1,1831,0⟩⟩,⟨691,⟨1,1,1837,0⟩⟩,⟨695,⟨1,1,1849,0⟩⟩,⟨697,⟨1,1,1855,0⟩⟩,⟨700,⟨1,1,1861,0⟩⟩,⟨705,⟨1,1,1873,0⟩⟩, + ⟨707,⟨1,1,1879,0⟩⟩,⟨710,⟨1,1,1885,0⟩⟩,⟨711,⟨3,3,951,943⟩⟩,⟨714,⟨1,1,1903,0⟩⟩,⟨717,⟨1,1,1909,0⟩⟩,⟨722,⟨1,1,1921,0⟩⟩, + ⟨724,⟨1,1,1927,0⟩⟩,⟨727,⟨1,1,1933,0⟩⟩,⟨731,⟨1,1,1945,0⟩⟩,⟨733,⟨1,1,1951,0⟩⟩,⟨736,⟨1,1,1957,0⟩⟩,⟨741,⟨1,1,1969,0⟩⟩, + ⟨743,⟨1,1,1975,0⟩⟩,⟨746,⟨1,1,1981,0⟩⟩,⟨751,⟨1,1,1999,0⟩⟩,⟨754,⟨1,1,2005,0⟩⟩,⟨759,⟨1,1,2017,0⟩⟩,⟨761,⟨1,1,2023,0⟩⟩, + ⟨764,⟨1,1,2029,0⟩⟩,⟨768,⟨1,1,2041,0⟩⟩,⟨770,⟨1,1,2047,0⟩⟩,⟨773,⟨1,1,2053,0⟩⟩,⟨778,⟨1,1,2065,0⟩⟩ +] +def lib_6 : List kernel:=[ + ⟨780,⟨1,1,2071,0⟩⟩,⟨783,⟨1,1,2077,0⟩⟩,⟨784,⟨3,3,1047,1039⟩⟩,⟨787,⟨1,1,2095,0⟩⟩,⟨790,⟨1,1,2101,0⟩⟩,⟨795,⟨1,1,2113,0⟩⟩, + ⟨797,⟨1,1,2119,0⟩⟩,⟨800,⟨1,1,2125,0⟩⟩,⟨804,⟨1,1,2137,0⟩⟩,⟨806,⟨1,1,2143,0⟩⟩,⟨809,⟨1,1,2149,0⟩⟩,⟨814,⟨1,1,2161,0⟩⟩, + ⟨816,⟨1,1,2167,0⟩⟩,⟨819,⟨1,1,2173,0⟩⟩,⟨823,⟨1,1,2191,0⟩⟩,⟨826,⟨1,1,2197,0⟩⟩,⟨831,⟨1,1,2209,0⟩⟩,⟨833,⟨1,1,2215,0⟩⟩, + ⟨836,⟨1,1,2221,0⟩⟩,⟨840,⟨1,1,2233,0⟩⟩,⟨842,⟨1,1,2239,0⟩⟩,⟨845,⟨1,1,2245,0⟩⟩,⟨850,⟨1,1,2257,0⟩⟩,⟨852,⟨1,1,2263,0⟩⟩, + ⟨855,⟨1,1,2269,0⟩⟩,⟨856,⟨3,3,1143,1135⟩⟩,⟨859,⟨1,1,2287,0⟩⟩,⟨862,⟨1,1,2293,0⟩⟩,⟨867,⟨1,1,2305,0⟩⟩,⟨869,⟨1,1,2311,0⟩⟩, + ⟨872,⟨1,1,2317,0⟩⟩,⟨876,⟨1,1,2329,0⟩⟩,⟨878,⟨1,1,2335,0⟩⟩,⟨881,⟨1,1,2341,0⟩⟩,⟨886,⟨1,1,2353,0⟩⟩,⟨888,⟨1,1,2359,0⟩⟩, + ⟨891,⟨1,1,2365,0⟩⟩,⟨896,⟨1,1,2383,0⟩⟩,⟨899,⟨1,1,2389,0⟩⟩,⟨904,⟨1,1,2401,0⟩⟩,⟨906,⟨1,1,2407,0⟩⟩ +] +def lib_7 : List kernel:=[ + ⟨909,⟨1,1,2413,0⟩⟩,⟨913,⟨1,1,2425,0⟩⟩,⟨915,⟨1,1,2431,0⟩⟩,⟨918,⟨1,1,2437,0⟩⟩,⟨923,⟨1,1,2449,0⟩⟩,⟨925,⟨1,1,2455,0⟩⟩, + ⟨928,⟨1,1,2461,0⟩⟩,⟨929,⟨3,3,1239,1231⟩⟩,⟨932,⟨1,1,2479,0⟩⟩,⟨935,⟨1,1,2485,0⟩⟩,⟨940,⟨1,1,2497,0⟩⟩,⟨942,⟨1,1,2503,0⟩⟩, + ⟨945,⟨1,1,2509,0⟩⟩,⟨949,⟨1,1,2521,0⟩⟩,⟨951,⟨1,1,2527,0⟩⟩,⟨954,⟨1,1,2533,0⟩⟩,⟨959,⟨1,1,2545,0⟩⟩,⟨961,⟨1,1,2551,0⟩⟩, + ⟨964,⟨1,1,2557,0⟩⟩,⟨966,⟨1,1,2581,0⟩⟩,⟨971,⟨1,1,2593,0⟩⟩,⟨973,⟨1,1,2599,0⟩⟩,⟨976,⟨1,1,2605,0⟩⟩,⟨980,⟨1,1,2617,0⟩⟩, + ⟨982,⟨1,1,2623,0⟩⟩,⟨985,⟨1,1,2629,0⟩⟩,⟨990,⟨1,1,2641,0⟩⟩,⟨992,⟨1,1,2647,0⟩⟩,⟨995,⟨1,1,2653,0⟩⟩,⟨996,⟨3,3,1335,1327⟩⟩, + ⟨999,⟨1,1,2671,0⟩⟩,⟨1002,⟨1,1,2677,0⟩⟩,⟨1007,⟨1,1,2689,0⟩⟩,⟨1009,⟨1,1,2695,0⟩⟩,⟨1012,⟨1,1,2701,0⟩⟩,⟨1016,⟨1,1,2713,0⟩⟩, + ⟨1018,⟨1,1,2719,0⟩⟩,⟨1021,⟨1,1,2725,0⟩⟩,⟨1026,⟨1,1,2737,0⟩⟩,⟨1028,⟨1,1,2743,0⟩⟩,⟨1031,⟨1,1,2749,0⟩⟩ +] +def lib_8 : List kernel:=[ + ⟨1036,⟨1,1,2767,0⟩⟩,⟨1039,⟨1,1,2773,0⟩⟩,⟨1044,⟨1,1,2785,0⟩⟩,⟨1046,⟨1,1,2791,0⟩⟩,⟨1049,⟨1,1,2797,0⟩⟩,⟨1053,⟨1,1,2809,0⟩⟩, + ⟨1055,⟨1,1,2815,0⟩⟩,⟨1058,⟨1,1,2821,0⟩⟩,⟨1063,⟨1,1,2833,0⟩⟩,⟨1065,⟨1,1,2839,0⟩⟩,⟨1068,⟨1,1,2845,0⟩⟩,⟨1069,⟨3,3,1431,1423⟩⟩, + ⟨1072,⟨1,1,2863,0⟩⟩,⟨1075,⟨1,1,2869,0⟩⟩,⟨1080,⟨1,1,2881,0⟩⟩,⟨1082,⟨1,1,2887,0⟩⟩,⟨1085,⟨1,1,2893,0⟩⟩,⟨1089,⟨1,1,2905,0⟩⟩, + ⟨1091,⟨1,1,2911,0⟩⟩,⟨1094,⟨1,1,2917,0⟩⟩,⟨1099,⟨1,1,2929,0⟩⟩,⟨1101,⟨1,1,2935,0⟩⟩,⟨1104,⟨1,1,2941,0⟩⟩,⟨1108,⟨1,1,2959,0⟩⟩, + ⟨1111,⟨1,1,2965,0⟩⟩,⟨1116,⟨1,1,2977,0⟩⟩,⟨1118,⟨1,1,2983,0⟩⟩,⟨1121,⟨1,1,2989,0⟩⟩,⟨1125,⟨1,1,3001,0⟩⟩,⟨1127,⟨1,1,3007,0⟩⟩, + ⟨1130,⟨1,1,3013,0⟩⟩,⟨1135,⟨1,1,3025,0⟩⟩,⟨1137,⟨1,1,3031,0⟩⟩,⟨1140,⟨1,1,3037,0⟩⟩,⟨1141,⟨3,3,1527,1519⟩⟩,⟨1144,⟨1,1,3055,0⟩⟩, + ⟨1147,⟨1,1,3061,0⟩⟩,⟨1152,⟨1,1,3073,0⟩⟩,⟨1154,⟨1,1,3079,0⟩⟩,⟨1157,⟨1,1,3085,0⟩⟩,⟨1161,⟨1,1,3097,0⟩⟩ +] +def lib_9 : List kernel:=[ + ⟨1163,⟨1,1,3103,0⟩⟩,⟨1166,⟨1,1,3109,0⟩⟩,⟨1171,⟨1,1,3121,0⟩⟩,⟨1173,⟨1,1,3127,0⟩⟩,⟨1176,⟨1,1,3133,0⟩⟩,⟨1181,⟨1,1,3151,0⟩⟩, + ⟨1184,⟨1,1,3157,0⟩⟩,⟨1189,⟨1,1,3169,0⟩⟩,⟨1191,⟨1,1,3175,0⟩⟩,⟨1194,⟨1,1,3181,0⟩⟩,⟨1198,⟨1,1,3193,0⟩⟩,⟨1200,⟨1,1,3199,0⟩⟩, + ⟨1203,⟨1,1,3205,0⟩⟩,⟨1208,⟨1,1,3217,0⟩⟩,⟨1210,⟨1,1,3223,0⟩⟩,⟨1213,⟨1,1,3229,0⟩⟩,⟨1214,⟨3,3,1623,1615⟩⟩,⟨1217,⟨1,1,3247,0⟩⟩, + ⟨1220,⟨1,1,3253,0⟩⟩,⟨1225,⟨1,1,3265,0⟩⟩,⟨1227,⟨1,1,3271,0⟩⟩,⟨1230,⟨1,1,3277,0⟩⟩,⟨1234,⟨1,1,3289,0⟩⟩,⟨1236,⟨1,1,3295,0⟩⟩, + ⟨1239,⟨1,1,3301,0⟩⟩,⟨1244,⟨1,1,3313,0⟩⟩,⟨1246,⟨1,1,3319,0⟩⟩,⟨1249,⟨1,1,3325,0⟩⟩,⟨1250,⟨3,3,1677,1663⟩⟩,⟨1255,⟨1,1,3349,0⟩⟩, + ⟨1260,⟨1,1,3361,0⟩⟩,⟨1262,⟨1,1,3367,0⟩⟩,⟨1265,⟨1,1,3373,0⟩⟩,⟨1269,⟨1,1,3385,0⟩⟩,⟨1271,⟨1,1,3391,0⟩⟩,⟨1274,⟨1,1,3397,0⟩⟩, + ⟨1279,⟨1,1,3409,0⟩⟩,⟨1281,⟨1,1,3415,0⟩⟩,⟨1284,⟨1,1,3421,0⟩⟩,⟨1285,⟨3,3,1719,1711⟩⟩,⟨1288,⟨1,1,3439,0⟩⟩ +] +def lib_10 : List kernel:=[ + ⟨1291,⟨1,1,3445,0⟩⟩,⟨1296,⟨1,1,3457,0⟩⟩,⟨1298,⟨1,1,3463,0⟩⟩,⟨1301,⟨1,1,3469,0⟩⟩,⟨1305,⟨1,1,3481,0⟩⟩,⟨1307,⟨1,1,3487,0⟩⟩, + ⟨1310,⟨1,1,3493,0⟩⟩,⟨1315,⟨1,1,3505,0⟩⟩,⟨1317,⟨1,1,3511,0⟩⟩,⟨1320,⟨1,1,3517,0⟩⟩,⟨1325,⟨1,1,3535,0⟩⟩,⟨1328,⟨1,1,3541,0⟩⟩, + ⟨1333,⟨1,1,3553,0⟩⟩,⟨1335,⟨1,1,3559,0⟩⟩,⟨1338,⟨1,1,3565,0⟩⟩,⟨1342,⟨1,1,3577,0⟩⟩,⟨1344,⟨1,1,3583,0⟩⟩,⟨1347,⟨1,1,3589,0⟩⟩, + ⟨1352,⟨1,1,3601,0⟩⟩,⟨1354,⟨1,1,3607,0⟩⟩,⟨1357,⟨1,1,3613,0⟩⟩,⟨1358,⟨3,3,1815,1807⟩⟩,⟨1361,⟨1,1,3631,0⟩⟩,⟨1364,⟨1,1,3637,0⟩⟩, + ⟨1369,⟨1,1,3649,0⟩⟩,⟨1371,⟨1,1,3655,0⟩⟩,⟨1374,⟨1,1,3661,0⟩⟩,⟨1378,⟨1,1,3673,0⟩⟩,⟨1380,⟨1,1,3679,0⟩⟩,⟨1383,⟨1,1,3685,0⟩⟩, + ⟨1388,⟨1,1,3697,0⟩⟩,⟨1390,⟨1,1,3703,0⟩⟩,⟨1393,⟨1,1,3709,0⟩⟩,⟨1397,⟨1,1,3727,0⟩⟩,⟨1400,⟨1,1,3733,0⟩⟩,⟨1405,⟨1,1,3745,0⟩⟩, + ⟨1407,⟨1,1,3751,0⟩⟩,⟨1410,⟨1,1,3757,0⟩⟩,⟨1414,⟨1,1,3769,0⟩⟩,⟨1416,⟨1,1,3775,0⟩⟩,⟨1419,⟨1,1,3781,0⟩⟩ +] +def lib_11 : List kernel:=[ + ⟨1424,⟨1,1,3793,0⟩⟩,⟨1426,⟨1,1,3799,0⟩⟩,⟨1429,⟨1,1,3805,0⟩⟩,⟨1430,⟨3,3,1911,1903⟩⟩,⟨1433,⟨1,1,3823,0⟩⟩,⟨1436,⟨1,1,3829,0⟩⟩, + ⟨1441,⟨1,1,3841,0⟩⟩,⟨1443,⟨1,1,3847,0⟩⟩,⟨1446,⟨1,1,3853,0⟩⟩,⟨1450,⟨1,1,3865,0⟩⟩,⟨1452,⟨1,1,3871,0⟩⟩,⟨1455,⟨1,1,3877,0⟩⟩, + ⟨1460,⟨1,1,3889,0⟩⟩,⟨1462,⟨1,1,3895,0⟩⟩,⟨1465,⟨1,1,3901,0⟩⟩,⟨1470,⟨1,1,3919,0⟩⟩,⟨1473,⟨1,1,3925,0⟩⟩,⟨1478,⟨1,1,3937,0⟩⟩, + ⟨1480,⟨1,1,3943,0⟩⟩,⟨1483,⟨1,1,3949,0⟩⟩,⟨1487,⟨1,1,3961,0⟩⟩,⟨1489,⟨1,1,3967,0⟩⟩,⟨1492,⟨1,1,3973,0⟩⟩,⟨1497,⟨1,1,3985,0⟩⟩, + ⟨1499,⟨1,1,3991,0⟩⟩,⟨1502,⟨1,1,3997,0⟩⟩,⟨1503,⟨3,3,2007,1999⟩⟩,⟨1506,⟨1,1,4015,0⟩⟩,⟨1509,⟨1,1,4021,0⟩⟩,⟨1514,⟨1,1,4033,0⟩⟩, + ⟨1516,⟨1,1,4039,0⟩⟩,⟨1519,⟨1,1,4045,0⟩⟩,⟨1523,⟨1,1,4057,0⟩⟩,⟨1525,⟨1,1,4063,0⟩⟩,⟨1528,⟨1,1,4069,0⟩⟩,⟨1533,⟨1,1,4081,0⟩⟩, + ⟨1535,⟨1,1,4087,0⟩⟩,⟨1538,⟨1,1,4093,0⟩⟩,⟨1539,⟨3,3,2073,2047⟩⟩,⟨1544,⟨1,1,4129,0⟩⟩,⟨1546,⟨1,1,4135,0⟩⟩ +] +def lib_12 : List kernel:=[ + ⟨1549,⟨1,1,4141,0⟩⟩,⟨1553,⟨1,1,4153,0⟩⟩,⟨1555,⟨1,1,4159,0⟩⟩,⟨1558,⟨1,1,4165,0⟩⟩,⟨1563,⟨1,1,4177,0⟩⟩,⟨1565,⟨1,1,4183,0⟩⟩, + ⟨1568,⟨1,1,4189,0⟩⟩,⟨1569,⟨3,3,2103,2095⟩⟩,⟨1572,⟨1,1,4207,0⟩⟩,⟨1575,⟨1,1,4213,0⟩⟩,⟨1580,⟨1,1,4225,0⟩⟩,⟨1582,⟨1,1,4231,0⟩⟩, + ⟨1585,⟨1,1,4237,0⟩⟩,⟨1589,⟨1,1,4249,0⟩⟩,⟨1591,⟨1,1,4255,0⟩⟩,⟨1594,⟨1,1,4261,0⟩⟩,⟨1599,⟨1,1,4273,0⟩⟩,⟨1601,⟨1,1,4279,0⟩⟩, + ⟨1604,⟨1,1,4285,0⟩⟩,⟨1609,⟨1,1,4303,0⟩⟩,⟨1612,⟨1,1,4309,0⟩⟩,⟨1617,⟨1,1,4321,0⟩⟩,⟨1619,⟨1,1,4327,0⟩⟩,⟨1622,⟨1,1,4333,0⟩⟩, + ⟨1626,⟨1,1,4345,0⟩⟩,⟨1628,⟨1,1,4351,0⟩⟩,⟨1631,⟨1,1,4357,0⟩⟩,⟨1636,⟨1,1,4369,0⟩⟩,⟨1638,⟨1,1,4375,0⟩⟩,⟨1641,⟨1,1,4381,0⟩⟩, + ⟨1642,⟨3,3,2199,2191⟩⟩,⟨1645,⟨1,1,4399,0⟩⟩,⟨1648,⟨1,1,4405,0⟩⟩,⟨1653,⟨1,1,4417,0⟩⟩,⟨1655,⟨1,1,4423,0⟩⟩,⟨1658,⟨1,1,4429,0⟩⟩, + ⟨1662,⟨1,1,4441,0⟩⟩,⟨1664,⟨1,1,4447,0⟩⟩,⟨1667,⟨1,1,4453,0⟩⟩,⟨1672,⟨1,1,4465,0⟩⟩,⟨1674,⟨1,1,4471,0⟩⟩ +] +def lib_13 : List kernel:=[ + ⟨1677,⟨1,1,4477,0⟩⟩,⟨1681,⟨1,1,4495,0⟩⟩,⟨1684,⟨1,1,4501,0⟩⟩,⟨1689,⟨1,1,4513,0⟩⟩,⟨1691,⟨1,1,4519,0⟩⟩,⟨1694,⟨1,1,4525,0⟩⟩, + ⟨1698,⟨1,1,4537,0⟩⟩,⟨1700,⟨1,1,4543,0⟩⟩,⟨1703,⟨1,1,4549,0⟩⟩,⟨1708,⟨1,1,4561,0⟩⟩,⟨1710,⟨1,1,4567,0⟩⟩,⟨1713,⟨1,1,4573,0⟩⟩, + ⟨1714,⟨3,3,2295,2287⟩⟩,⟨1717,⟨1,1,4591,0⟩⟩,⟨1720,⟨1,1,4597,0⟩⟩,⟨1725,⟨1,1,4609,0⟩⟩,⟨1727,⟨1,1,4615,0⟩⟩,⟨1730,⟨1,1,4621,0⟩⟩, + ⟨1734,⟨1,1,4633,0⟩⟩,⟨1736,⟨1,1,4639,0⟩⟩,⟨1739,⟨1,1,4645,0⟩⟩,⟨1744,⟨1,1,4657,0⟩⟩,⟨1746,⟨1,1,4663,0⟩⟩,⟨1749,⟨1,1,4669,0⟩⟩, + ⟨1754,⟨1,1,4687,0⟩⟩,⟨1757,⟨1,1,4693,0⟩⟩,⟨1762,⟨1,1,4705,0⟩⟩,⟨1764,⟨1,1,4711,0⟩⟩,⟨1767,⟨1,1,4717,0⟩⟩,⟨1771,⟨1,1,4729,0⟩⟩, + ⟨1773,⟨1,1,4735,0⟩⟩,⟨1776,⟨1,1,4741,0⟩⟩,⟨1781,⟨1,1,4753,0⟩⟩,⟨1783,⟨1,1,4759,0⟩⟩,⟨1786,⟨1,1,4765,0⟩⟩,⟨1787,⟨3,3,2391,2383⟩⟩, + ⟨1790,⟨1,1,4783,0⟩⟩,⟨1793,⟨1,1,4789,0⟩⟩,⟨1798,⟨1,1,4801,0⟩⟩,⟨1800,⟨1,1,4807,0⟩⟩,⟨1803,⟨1,1,4813,0⟩⟩ +] +def lib_14 : List kernel:=[ + ⟨1807,⟨1,1,4825,0⟩⟩,⟨1809,⟨1,1,4831,0⟩⟩,⟨1812,⟨1,1,4837,0⟩⟩,⟨1817,⟨1,1,4849,0⟩⟩,⟨1819,⟨1,1,4855,0⟩⟩,⟨1822,⟨1,1,4861,0⟩⟩, + ⟨1823,⟨3,3,2445,2431⟩⟩,⟨1828,⟨1,1,4885,0⟩⟩,⟨1833,⟨1,1,4897,0⟩⟩,⟨1835,⟨1,1,4903,0⟩⟩,⟨1838,⟨1,1,4909,0⟩⟩,⟨1842,⟨1,1,4921,0⟩⟩, + ⟨1844,⟨1,1,4927,0⟩⟩,⟨1847,⟨1,1,4933,0⟩⟩,⟨1852,⟨1,1,4945,0⟩⟩,⟨1854,⟨1,1,4951,0⟩⟩,⟨1857,⟨1,1,4957,0⟩⟩,⟨1858,⟨3,3,2487,2479⟩⟩, + ⟨1861,⟨1,1,4975,0⟩⟩,⟨1864,⟨1,1,4981,0⟩⟩,⟨1869,⟨1,1,4993,0⟩⟩,⟨1871,⟨1,1,4999,0⟩⟩,⟨1874,⟨1,1,5005,0⟩⟩,⟨1878,⟨1,1,5017,0⟩⟩, + ⟨1880,⟨1,1,5023,0⟩⟩,⟨1883,⟨1,1,5029,0⟩⟩,⟨1888,⟨1,1,5041,0⟩⟩,⟨1890,⟨1,1,5047,0⟩⟩,⟨1893,⟨1,1,5053,0⟩⟩,⟨1898,⟨1,1,5071,0⟩⟩, + ⟨1901,⟨1,1,5077,0⟩⟩,⟨1906,⟨1,1,5089,0⟩⟩,⟨1908,⟨1,1,5095,0⟩⟩,⟨1911,⟨1,1,5101,0⟩⟩,⟨1915,⟨1,1,5113,0⟩⟩,⟨1917,⟨1,1,5119,0⟩⟩, + ⟨1920,⟨1,1,5125,0⟩⟩,⟨1925,⟨1,1,5137,0⟩⟩,⟨1927,⟨1,1,5143,0⟩⟩,⟨1930,⟨1,1,5149,0⟩⟩,⟨1931,⟨3,3,2583,2575⟩⟩ +] +def lib_15 : List kernel:=[ + ⟨1934,⟨1,1,5167,0⟩⟩,⟨1937,⟨1,1,5173,0⟩⟩,⟨1942,⟨1,1,5185,0⟩⟩,⟨1944,⟨1,1,5191,0⟩⟩,⟨1947,⟨1,1,5197,0⟩⟩,⟨1951,⟨1,1,5209,0⟩⟩, + ⟨1953,⟨1,1,5215,0⟩⟩,⟨1956,⟨1,1,5221,0⟩⟩,⟨1961,⟨1,1,5233,0⟩⟩,⟨1963,⟨1,1,5239,0⟩⟩,⟨1966,⟨1,1,5245,0⟩⟩,⟨1970,⟨1,1,5263,0⟩⟩, + ⟨1973,⟨1,1,5269,0⟩⟩,⟨1978,⟨1,1,5281,0⟩⟩,⟨1980,⟨1,1,5287,0⟩⟩,⟨1983,⟨1,1,5293,0⟩⟩,⟨1987,⟨1,1,5305,0⟩⟩,⟨1989,⟨1,1,5311,0⟩⟩, + ⟨1992,⟨1,1,5317,0⟩⟩,⟨1997,⟨1,1,5329,0⟩⟩,⟨1999,⟨1,1,5335,0⟩⟩,⟨2002,⟨1,1,5341,0⟩⟩,⟨2003,⟨3,3,2679,2671⟩⟩,⟨2006,⟨1,1,5359,0⟩⟩, + ⟨2009,⟨1,1,5365,0⟩⟩,⟨2014,⟨1,1,5377,0⟩⟩,⟨2016,⟨1,1,5383,0⟩⟩,⟨2019,⟨1,1,5389,0⟩⟩,⟨2023,⟨1,1,5401,0⟩⟩,⟨2025,⟨1,1,5407,0⟩⟩, + ⟨2028,⟨1,1,5413,0⟩⟩,⟨2033,⟨1,1,5425,0⟩⟩,⟨2035,⟨1,1,5431,0⟩⟩,⟨2038,⟨1,1,5437,0⟩⟩,⟨2043,⟨1,1,5455,0⟩⟩,⟨2046,⟨1,1,5461,0⟩⟩ +] +def library_val : List kernel := + lib_0 ++ lib_1 ++ lib_2 ++ lib_3 ++ lib_4 ++ lib_5 ++ lib_6 ++ lib_7 ++ lib_8 ++ lib_9 ++ lib_10 ++ lib_11 ++ lib_12 ++ lib_13 ++ lib_14 ++ lib_15 +theorem library_eq : library=library_val:= by decide +kernel +def action (k : kernel) (S U S' U' : ℤ) : Prop := + S'=S + gain k ∧ + q0 k.pair.d * U'=k.pair.p * (2 * S - U + 3) + q0 k.pair.d * k.pair.b ∧ + ∃ t,2 * S - U + 3=q0 k.index * (2 * t + 1) +inductive trace : List kernel → ℤ → ℤ → Prop where + | trace_nil (S U : ℤ) : trace [] S U + | trace_cons {k : kernel} {r : List kernel} {S U S' U' : ℤ} : + action k S U S' U' → trace r S' U' → trace (k :: r) S U +end WordLibrary +namespace WordCheck +open Table WordArith WordRelation WordLibrary +structure state where + rel : Option relation + P : ℤ + Q : ℤ + C : ℤ + D : ℤ + mass : ℤ + deriving DecidableEq,Repr +def qE (z : state) (S0 U0 S U : ℤ) : Prop := + 0 ≤ z.D ∧ qW z.Q ∧ + q0 z.D * U=z.P * S0 + z.Q * U0 + z.C ∧ S=S0 + z.mass ∧ optional z.rel S0 U0 +def A (z : state) : ℤ:=q0 (z.D + 1) - z.P +def B (z : state) : ℤ:=(2 * z.mass + 3) * q0 z.D - z.C +theorem qav (z : state) (S0 U0 S U : ℤ) (hz : qE z S0 U0 S U) : + q0 z.D * (2 * S - U + 3)=A z * S0 - z.Q * U0 + B z:= by + rcases hz with ⟨hD,hQ,hU,hS,hR⟩ + unfold A B + rw [q5 hD (by omega),pow2_one,hS] + linarith +theorem qcj (z : state) (k : kernel) (S0 U0 S U S' U' : ℤ) + (hz : qE z S0 U0 S U) (hk : 0 ≤ k.index) (hact : action k S U S' U') : + qa3 (z.D + k.index + 1) (z.Q * U0 - A z * S0 - (B z - q0 (z.D + k.index))):= by + rcases hact with ⟨hS,hU,t,ht⟩ + have hH:=qav z S0 U0 S U hz + rcases hz with ⟨hD,_⟩ + refine ⟨-t,?_⟩ + rw [ht] at hH + rw [q5 (by omega : 0 ≤ z.D + k.index) (by omega : 0 ≤ (1 : ℤ)),pow2_one] + rw [q5 hD hk] + linarith +def push (z : state) (k : kernel) (r : relation) : state := + ⟨some r, + k.pair.p * A z, + -k.pair.p * z.Q, + k.pair.p * B z + k.pair.b * q0 (z.D + k.pair.d), + z.D + k.pair.d, + z.mass + gain k⟩ +theorem push_spec (z : state) (k : kernel) (r : relation) (S0 U0 S U S' U' : ℤ) + (hz : qE z S0 U0 S U) (hd : 0 ≤ k.pair.d) (hp : qW k.pair.p) + (hact : action k S U S' U') (hr : qbd r S0 U0) : + qE (push z k r) S0 U0 S' U':= by + rcases hact with ⟨hS,hU,_⟩ + have hH:=qav z S0 U0 S U hz + rcases hz with ⟨hD,hQ,hU0,hS0,hR0⟩ + unfold qE push WordRelation.optional + try dsimp -failIfUnchanged only + refine ⟨by omega,?_,?_,by omega,hr⟩ + · rcases hp with ⟨a,ha⟩ + rcases hQ with ⟨b,hb⟩ + refine ⟨-2 * a * b - a - b - 1,?_⟩ + rw [ha,hb]; ring + · rw [q5 hD hd] + have h1 := congr_arg (fun t => q0 z.D * t) hU + have h2 := congr_arg (fun t => k.pair.p * t) hH + linarith +def qJ {T : Type*} (f : T → Bool) : List T → Bool + | [] => true + | x :: r => if f x then qJ f r else false +theorem qbf {T : Type*} (f : T → Bool) (xs : List T) (h : qJ f xs=true) : + ∀ x ∈ xs,f x=true:= by + induction xs with + | nil => intro x hx; contradiction + | cons a xs ih => + unfold qJ at h + split_ifs at h with ha + intro x hx + rcases List.mem_cons.mp hx with rfl | hx' + · exact ha + · exact ih h x hx' +theorem qbr {T : Type*} (f : T → Bool) (xs ys : List T) : + qJ f (xs ++ ys)=(qJ f xs && qJ f ys):= by + induction xs with + | nil => simp [qJ] + | cons a xs ih => + simp only [List.cons_append,qJ,ih] + cases f a <;> rfl +def int_le (a b : ℤ) : Bool := + match a, b with + | Int.ofNat m, Int.ofNat n => Nat.ble m n + | Int.negSucc _, Int.ofNat _ => true + | Int.ofNat _, Int.negSucc _ => false + | Int.negSucc m, Int.negSucc n => Nat.ble n m +def int_lt (a b : ℤ) : Bool := + match a, b with + | Int.ofNat m, Int.ofNat n => Nat.ble (Nat.add m 1) n + | Int.negSucc _, Int.ofNat _ => true + | Int.ofNat _, Int.negSucc _ => false + | Int.negSucc m, Int.negSucc n => Nat.ble (Nat.add n 1) m +def int_eq (a b : ℤ) : Bool := + match a, b with + | Int.ofNat m, Int.ofNat n => Nat.beq m n + | Int.negSucc m, Int.negSucc n => Nat.beq m n + | _, _ => false +def find_kernel (s : ℤ) : List kernel → List kernel + | [] => [] + | k :: ks => + if int_eq k.index s then [k] + else if int_lt s k.index then [] + else find_kernel s ks +def single (s : ℤ) : List kernel := + if int_lt s 5 then [] + else if int_eq s 5 then [⟨5,⟨1,1,7,0⟩⟩] + else if int_lt s 8 then [] + else if int_eq s 8 then [⟨8,⟨1,1,13,0⟩⟩] + else if int_lt s 12 then [] + else if int_eq s 12 then [⟨12,⟨1,1,25,0⟩⟩] + else if int_lt s 14 then [] + else if int_lt s 1036 then + if int_lt s 520 then + if int_lt s 265 then + if int_lt s 135 then find_kernel s lib_0 + else find_kernel s lib_1 + else + if int_lt s 394 then find_kernel s lib_2 + else find_kernel s lib_3 + else + if int_lt s 780 then + if int_lt s 651 then find_kernel s lib_4 + else find_kernel s lib_5 + else + if int_lt s 909 then find_kernel s lib_6 + else find_kernel s lib_7 + else + if int_lt s 1549 then + if int_lt s 1291 then + if int_lt s 1163 then find_kernel s lib_8 + else find_kernel s lib_9 + else + if int_lt s 1424 then find_kernel s lib_10 + else find_kernel s lib_11 + else + if int_lt s 1807 then + if int_lt s 1677 then find_kernel s lib_12 + else find_kernel s lib_13 + else + if int_lt s 1934 then find_kernel s lib_14 + else if int_le s 2046 then find_kernel s lib_15 + else [] +theorem single_all : + qJ (fun k => decide (k ∈ single k.index)) library_val=true:= by + decide +kernel +theorem qx (k : kernel) (hk : continuing k) (hmax : k.index ≤ 2048) : + k ∈ library_val:= by + rw [← library_eq] + exact qby k hk hmax +theorem qbL (k : kernel) (hk : continuing k) (hmax : k.index ≤ 2048) : + k ∈ single k.index:= by + have hmem : k ∈ library_val:=qx k hk hmax + exact of_decide_eq_true (qbf _ library_val single_all k hmem) +def qaQ (z : state) (f : state → Option state) : Option state := + q2 z.P fun P => + q2 z.Q fun Q => + q2 z.C fun C => + q2 z.D fun D => + q2 z.mass fun mass => + f ⟨z.rel,P,Q,C,D,mass⟩ +@[simp] theorem strictState_eq (z : state) (f : state → Option state) : + qaQ z f=f z:= by + cases z; simp [qaQ] +def qbj (z : state) : List kernel := + match z.rel with + | none => library_val + | some r => + q2 (A z) fun az => + q2 (B z) fun bz => + q2 (qa2 r az z.Q) fun bound => + q2 (qq bound (qa6 r az bz z.Q)) fun v => + if decide (v < bound) then + q2 (v - z.D) fun s => single s + else + q2 (bound - z.D) fun min_idx => + library_val.filter (fun k => decide (min_idx ≤ k.index)) +theorem choices_spec (z : state) (k : kernel) (S0 U0 S U S' U' : ℤ) + (hz : qE z S0 U0 S U) (hk : continuing k) (hmax : k.index ≤ 2048) + (hstep : action k S U S' U') : + k ∈ qbj z:= by + rcases hstep with ⟨hS,hU,t,ht⟩ + have hH:=qav z S0 U0 S U hz + rcases hz with ⟨hD,hQ,hU0,hS0,hR⟩ + rcases hk with ⟨e,hbuilt,hindex,hodd⟩ + have hkeep : continuing k:=⟨e,hbuilt,hindex,hodd⟩ + have hH' : A z * S0 - z.Q * U0 + B z=q0 (z.D + k.index) * (2 * t + 1):= by + rw [← hH,ht,q5 hD (by omega)] + ring + unfold qbj + simp only [strictInt_eq] + cases hr : z.rel with + | none => exact qx k hkeep hmax + | some r => + rw [hr] at hR + change qbd r S0 U0 at hR + rcases pruning_spec r (A z) (B z) z.Q S0 U0 z.D k.index t hR hD (by omega) hH' with ⟨he,hl⟩ + try dsimp -failIfUnchanged only at he hl ⊢ + have hb : 0 ≤ qa2 r (A z) z.Q:= by + rcases hR with ⟨hn,hp,_⟩ + unfold qa2 + have:=qL (qb2 r (A z) z.Q) hn + omega + have hv:=qL (qa6 r (A z) (B z) z.Q) hb + split_ifs with hvb + · have hvb' : qq (qa2 r (A z) z.Q) (qa6 r (A z) (B z) z.Q) < qa2 r (A z) z.Q := + of_decide_eq_true hvb + have hs_eq : k.index=qq (qa2 r (A z) z.Q) (qa6 r (A z) (B z) z.Q) - z.D:=he hvb' + rw [← hs_eq] + exact qbL k hkeep hmax + · rw [decide_eq_true_iff] at hvb + exact List.mem_filter.mpr ⟨qx k hkeep hmax,decide_eq_true (hl (by omega))⟩ +def advance (z : state) (k : kernel) : Option state := + q2 (A z) fun az => + q2 (B z) fun bz => + q2 (z.D + k.index) fun dki => + q2 (bz - q0 dki) fun c_arg => + q2 (dki + 1) fun n_arg => + match add z.rel az z.Q c_arg n_arg with + | some r => qaQ (push z k r) some + | none => none +theorem advance_spec (z : state) (k : kernel) (S0 U0 S U S' U' : ℤ) + (hz : qE z S0 U0 S U) (hk : continuing k) (hstep : action k S U S' U') : + ∃ z',advance z k=some z' ∧ qE z' S0 U0 S' U':= by + rcases hk with ⟨e,hbuilt,hindex,hodd⟩ + rcases (Table.built_valid hbuilt).1 with ⟨hk0,he0,⟨⟨hd,_,hp,_,hpo,_⟩,_⟩,_⟩ + have hcond:=qcj z k S0 U0 S U S' U' hz (by omega) hstep + have hkeep:=hz + rcases hz with ⟨hD,hQ,hU,hS,hR⟩ + rcases add_spec z.rel (A z) z.Q (B z - q0 (z.D + k.index)) (z.D + k.index + 1) + S0 U0 hR (by omega) hQ hcond with ⟨r,hadd,hholds⟩ + refine ⟨push z k r,?_,?_⟩ + · unfold advance + simp only [strictInt_eq,strictState_eq] + rw [hadd] + · exact push_spec z k r S0 U0 S U S' U' hkeep hd hpo hstep hholds +def qB (f : state → Bool) (z : state) (k : kernel) : Bool := + match advance z k with + | none => true + | some z' => f z' +def bkt_1 : List kernel := [⟨27,⟨1,1,61,0⟩⟩,⟨64,⟨1,1,157,0⟩⟩,⟨100,⟨1,1,253,0⟩⟩,⟨135,⟨1,1,349,0⟩⟩,⟨171,⟨1,1,445,0⟩⟩,⟨208,⟨1,1,541,0⟩⟩,⟨244,⟨1,1,637,0⟩⟩,⟨280,⟨1,1,733,0⟩⟩,⟨316,⟨1,1,829,0⟩⟩,⟨353,⟨1,1,925,0⟩⟩,⟨389,⟨1,1,1021,0⟩⟩,⟨421,⟨1,1,1117,0⟩⟩,⟨457,⟨1,1,1213,0⟩⟩,⟨494,⟨1,1,1309,0⟩⟩,⟨530,⟨1,1,1405,0⟩⟩,⟨566,⟨1,1,1501,0⟩⟩,⟨602,⟨1,1,1597,0⟩⟩,⟨639,⟨1,1,1693,0⟩⟩,⟨675,⟨1,1,1789,0⟩⟩,⟨710,⟨1,1,1885,0⟩⟩,⟨746,⟨1,1,1981,0⟩⟩,⟨783,⟨1,1,2077,0⟩⟩,⟨819,⟨1,1,2173,0⟩⟩,⟨855,⟨1,1,2269,0⟩⟩,⟨891,⟨1,1,2365,0⟩⟩,⟨928,⟨1,1,2461,0⟩⟩,⟨964,⟨1,1,2557,0⟩⟩,⟨995,⟨1,1,2653,0⟩⟩,⟨1031,⟨1,1,2749,0⟩⟩,⟨1068,⟨1,1,2845,0⟩⟩,⟨1104,⟨1,1,2941,0⟩⟩,⟨1140,⟨1,1,3037,0⟩⟩,⟨1176,⟨1,1,3133,0⟩⟩,⟨1213,⟨1,1,3229,0⟩⟩,⟨1249,⟨1,1,3325,0⟩⟩,⟨1284,⟨1,1,3421,0⟩⟩,⟨1320,⟨1,1,3517,0⟩⟩,⟨1357,⟨1,1,3613,0⟩⟩,⟨1393,⟨1,1,3709,0⟩⟩,⟨1429,⟨1,1,3805,0⟩⟩,⟨1465,⟨1,1,3901,0⟩⟩,⟨1502,⟨1,1,3997,0⟩⟩,⟨1538,⟨1,1,4093,0⟩⟩,⟨1568,⟨1,1,4189,0⟩⟩,⟨1604,⟨1,1,4285,0⟩⟩,⟨1641,⟨1,1,4381,0⟩⟩,⟨1677,⟨1,1,4477,0⟩⟩,⟨1713,⟨1,1,4573,0⟩⟩,⟨1749,⟨1,1,4669,0⟩⟩,⟨1786,⟨1,1,4765,0⟩⟩,⟨1822,⟨1,1,4861,0⟩⟩,⟨1857,⟨1,1,4957,0⟩⟩,⟨1893,⟨1,1,5053,0⟩⟩,⟨1930,⟨1,1,5149,0⟩⟩,⟨1966,⟨1,1,5245,0⟩⟩,⟨2002,⟨1,1,5341,0⟩⟩,⟨2038,⟨1,1,5437,0⟩⟩] +def bkt_3 : List kernel := [⟨14,⟨1,1,31,0⟩⟩,⟨51,⟨1,1,127,0⟩⟩,⟨87,⟨1,1,223,0⟩⟩,⟨122,⟨1,1,319,0⟩⟩,⟨158,⟨1,1,415,0⟩⟩,⟨195,⟨1,1,511,0⟩⟩,⟨231,⟨1,1,607,0⟩⟩,⟨267,⟨1,1,703,0⟩⟩,⟨303,⟨1,1,799,0⟩⟩,⟨340,⟨1,1,895,0⟩⟩,⟨376,⟨1,1,991,0⟩⟩,⟨408,⟨1,1,1087,0⟩⟩,⟨444,⟨1,1,1183,0⟩⟩,⟨481,⟨1,1,1279,0⟩⟩,⟨517,⟨1,1,1375,0⟩⟩,⟨553,⟨1,1,1471,0⟩⟩,⟨589,⟨1,1,1567,0⟩⟩,⟨626,⟨1,1,1663,0⟩⟩,⟨662,⟨1,1,1759,0⟩⟩,⟨697,⟨1,1,1855,0⟩⟩,⟨733,⟨1,1,1951,0⟩⟩,⟨770,⟨1,1,2047,0⟩⟩,⟨806,⟨1,1,2143,0⟩⟩,⟨842,⟨1,1,2239,0⟩⟩,⟨878,⟨1,1,2335,0⟩⟩,⟨915,⟨1,1,2431,0⟩⟩,⟨951,⟨1,1,2527,0⟩⟩,⟨982,⟨1,1,2623,0⟩⟩,⟨1018,⟨1,1,2719,0⟩⟩,⟨1055,⟨1,1,2815,0⟩⟩,⟨1091,⟨1,1,2911,0⟩⟩,⟨1127,⟨1,1,3007,0⟩⟩,⟨1163,⟨1,1,3103,0⟩⟩,⟨1200,⟨1,1,3199,0⟩⟩,⟨1236,⟨1,1,3295,0⟩⟩,⟨1271,⟨1,1,3391,0⟩⟩,⟨1307,⟨1,1,3487,0⟩⟩,⟨1344,⟨1,1,3583,0⟩⟩,⟨1380,⟨1,1,3679,0⟩⟩,⟨1416,⟨1,1,3775,0⟩⟩,⟨1452,⟨1,1,3871,0⟩⟩,⟨1489,⟨1,1,3967,0⟩⟩,⟨1525,⟨1,1,4063,0⟩⟩,⟨1555,⟨1,1,4159,0⟩⟩,⟨1591,⟨1,1,4255,0⟩⟩,⟨1628,⟨1,1,4351,0⟩⟩,⟨1664,⟨1,1,4447,0⟩⟩,⟨1700,⟨1,1,4543,0⟩⟩,⟨1736,⟨1,1,4639,0⟩⟩,⟨1773,⟨1,1,4735,0⟩⟩,⟨1809,⟨1,1,4831,0⟩⟩,⟨1844,⟨1,1,4927,0⟩⟩,⟨1880,⟨1,1,5023,0⟩⟩,⟨1917,⟨1,1,5119,0⟩⟩,⟨1953,⟨1,1,5215,0⟩⟩,⟨1989,⟨1,1,5311,0⟩⟩,⟨2025,⟨1,1,5407,0⟩⟩] +def bkt_5 : List kernel := [⟨40,⟨1,1,97,0⟩⟩,⟨76,⟨1,1,193,0⟩⟩,⟨111,⟨1,1,289,0⟩⟩,⟨147,⟨1,1,385,0⟩⟩,⟨184,⟨1,1,481,0⟩⟩,⟨220,⟨1,1,577,0⟩⟩,⟨256,⟨1,1,673,0⟩⟩,⟨292,⟨1,1,769,0⟩⟩,⟨329,⟨1,1,865,0⟩⟩,⟨365,⟨1,1,961,0⟩⟩,⟨397,⟨1,1,1057,0⟩⟩,⟨433,⟨1,1,1153,0⟩⟩,⟨470,⟨1,1,1249,0⟩⟩,⟨506,⟨1,1,1345,0⟩⟩,⟨542,⟨1,1,1441,0⟩⟩,⟨578,⟨1,1,1537,0⟩⟩,⟨615,⟨1,1,1633,0⟩⟩,⟨651,⟨1,1,1729,0⟩⟩,⟨686,⟨1,1,1825,0⟩⟩,⟨722,⟨1,1,1921,0⟩⟩,⟨759,⟨1,1,2017,0⟩⟩,⟨795,⟨1,1,2113,0⟩⟩,⟨831,⟨1,1,2209,0⟩⟩,⟨867,⟨1,1,2305,0⟩⟩,⟨904,⟨1,1,2401,0⟩⟩,⟨940,⟨1,1,2497,0⟩⟩,⟨971,⟨1,1,2593,0⟩⟩,⟨1007,⟨1,1,2689,0⟩⟩,⟨1044,⟨1,1,2785,0⟩⟩,⟨1080,⟨1,1,2881,0⟩⟩,⟨1116,⟨1,1,2977,0⟩⟩,⟨1152,⟨1,1,3073,0⟩⟩,⟨1189,⟨1,1,3169,0⟩⟩,⟨1225,⟨1,1,3265,0⟩⟩,⟨1260,⟨1,1,3361,0⟩⟩,⟨1296,⟨1,1,3457,0⟩⟩,⟨1333,⟨1,1,3553,0⟩⟩,⟨1369,⟨1,1,3649,0⟩⟩,⟨1405,⟨1,1,3745,0⟩⟩,⟨1441,⟨1,1,3841,0⟩⟩,⟨1478,⟨1,1,3937,0⟩⟩,⟨1514,⟨1,1,4033,0⟩⟩,⟨1544,⟨1,1,4129,0⟩⟩,⟨1580,⟨1,1,4225,0⟩⟩,⟨1617,⟨1,1,4321,0⟩⟩,⟨1653,⟨1,1,4417,0⟩⟩,⟨1689,⟨1,1,4513,0⟩⟩,⟨1725,⟨1,1,4609,0⟩⟩,⟨1762,⟨1,1,4705,0⟩⟩,⟨1798,⟨1,1,4801,0⟩⟩,⟨1833,⟨1,1,4897,0⟩⟩,⟨1869,⟨1,1,4993,0⟩⟩,⟨1906,⟨1,1,5089,0⟩⟩,⟨1942,⟨1,1,5185,0⟩⟩,⟨1978,⟨1,1,5281,0⟩⟩,⟨2014,⟨1,1,5377,0⟩⟩] +def bkt_7 : List kernel := [] +def bkt_9 : List kernel := [⟨17,⟨1,1,37,0⟩⟩,⟨54,⟨1,1,133,0⟩⟩,⟨90,⟨1,1,229,0⟩⟩,⟨125,⟨1,1,325,0⟩⟩,⟨161,⟨1,1,421,0⟩⟩,⟨198,⟨1,1,517,0⟩⟩,⟨234,⟨1,1,613,0⟩⟩,⟨270,⟨1,1,709,0⟩⟩,⟨306,⟨1,1,805,0⟩⟩,⟨343,⟨1,1,901,0⟩⟩,⟨379,⟨1,1,997,0⟩⟩,⟨411,⟨1,1,1093,0⟩⟩,⟨447,⟨1,1,1189,0⟩⟩,⟨484,⟨1,1,1285,0⟩⟩,⟨520,⟨1,1,1381,0⟩⟩,⟨556,⟨1,1,1477,0⟩⟩,⟨592,⟨1,1,1573,0⟩⟩,⟨629,⟨1,1,1669,0⟩⟩,⟨665,⟨1,1,1765,0⟩⟩,⟨700,⟨1,1,1861,0⟩⟩,⟨736,⟨1,1,1957,0⟩⟩,⟨773,⟨1,1,2053,0⟩⟩,⟨809,⟨1,1,2149,0⟩⟩,⟨845,⟨1,1,2245,0⟩⟩,⟨881,⟨1,1,2341,0⟩⟩,⟨918,⟨1,1,2437,0⟩⟩,⟨954,⟨1,1,2533,0⟩⟩,⟨985,⟨1,1,2629,0⟩⟩,⟨1021,⟨1,1,2725,0⟩⟩,⟨1058,⟨1,1,2821,0⟩⟩,⟨1094,⟨1,1,2917,0⟩⟩,⟨1130,⟨1,1,3013,0⟩⟩,⟨1166,⟨1,1,3109,0⟩⟩,⟨1203,⟨1,1,3205,0⟩⟩,⟨1239,⟨1,1,3301,0⟩⟩,⟨1274,⟨1,1,3397,0⟩⟩,⟨1310,⟨1,1,3493,0⟩⟩,⟨1347,⟨1,1,3589,0⟩⟩,⟨1383,⟨1,1,3685,0⟩⟩,⟨1419,⟨1,1,3781,0⟩⟩,⟨1455,⟨1,1,3877,0⟩⟩,⟨1492,⟨1,1,3973,0⟩⟩,⟨1528,⟨1,1,4069,0⟩⟩,⟨1558,⟨1,1,4165,0⟩⟩,⟨1594,⟨1,1,4261,0⟩⟩,⟨1631,⟨1,1,4357,0⟩⟩,⟨1667,⟨1,1,4453,0⟩⟩,⟨1703,⟨1,1,4549,0⟩⟩,⟨1739,⟨1,1,4645,0⟩⟩,⟨1776,⟨1,1,4741,0⟩⟩,⟨1812,⟨1,1,4837,0⟩⟩,⟨1847,⟨1,1,4933,0⟩⟩,⟨1883,⟨1,1,5029,0⟩⟩,⟨1920,⟨1,1,5125,0⟩⟩,⟨1956,⟨1,1,5221,0⟩⟩,⟨1992,⟨1,1,5317,0⟩⟩,⟨2028,⟨1,1,5413,0⟩⟩] +def bkt_11 : List kernel := [⟨42,⟨1,1,103,0⟩⟩,⟨78,⟨1,1,199,0⟩⟩,⟨113,⟨1,1,295,0⟩⟩,⟨149,⟨1,1,391,0⟩⟩,⟨186,⟨1,1,487,0⟩⟩,⟨222,⟨1,1,583,0⟩⟩,⟨258,⟨1,1,679,0⟩⟩,⟨294,⟨1,1,775,0⟩⟩,⟨331,⟨1,1,871,0⟩⟩,⟨367,⟨1,1,967,0⟩⟩,⟨399,⟨1,1,1063,0⟩⟩,⟨435,⟨1,1,1159,0⟩⟩,⟨472,⟨1,1,1255,0⟩⟩,⟨508,⟨1,1,1351,0⟩⟩,⟨544,⟨1,1,1447,0⟩⟩,⟨580,⟨1,1,1543,0⟩⟩,⟨617,⟨1,1,1639,0⟩⟩,⟨653,⟨1,1,1735,0⟩⟩,⟨688,⟨1,1,1831,0⟩⟩,⟨724,⟨1,1,1927,0⟩⟩,⟨761,⟨1,1,2023,0⟩⟩,⟨797,⟨1,1,2119,0⟩⟩,⟨833,⟨1,1,2215,0⟩⟩,⟨869,⟨1,1,2311,0⟩⟩,⟨906,⟨1,1,2407,0⟩⟩,⟨942,⟨1,1,2503,0⟩⟩,⟨973,⟨1,1,2599,0⟩⟩,⟨1009,⟨1,1,2695,0⟩⟩,⟨1046,⟨1,1,2791,0⟩⟩,⟨1082,⟨1,1,2887,0⟩⟩,⟨1118,⟨1,1,2983,0⟩⟩,⟨1154,⟨1,1,3079,0⟩⟩,⟨1191,⟨1,1,3175,0⟩⟩,⟨1227,⟨1,1,3271,0⟩⟩,⟨1262,⟨1,1,3367,0⟩⟩,⟨1298,⟨1,1,3463,0⟩⟩,⟨1335,⟨1,1,3559,0⟩⟩,⟨1371,⟨1,1,3655,0⟩⟩,⟨1407,⟨1,1,3751,0⟩⟩,⟨1443,⟨1,1,3847,0⟩⟩,⟨1480,⟨1,1,3943,0⟩⟩,⟨1516,⟨1,1,4039,0⟩⟩,⟨1546,⟨1,1,4135,0⟩⟩,⟨1582,⟨1,1,4231,0⟩⟩,⟨1619,⟨1,1,4327,0⟩⟩,⟨1655,⟨1,1,4423,0⟩⟩,⟨1691,⟨1,1,4519,0⟩⟩,⟨1727,⟨1,1,4615,0⟩⟩,⟨1764,⟨1,1,4711,0⟩⟩,⟨1800,⟨1,1,4807,0⟩⟩,⟨1835,⟨1,1,4903,0⟩⟩,⟨1871,⟨1,1,4999,0⟩⟩,⟨1908,⟨1,1,5095,0⟩⟩,⟨1944,⟨1,1,5191,0⟩⟩,⟨1980,⟨1,1,5287,0⟩⟩,⟨2016,⟨1,1,5383,0⟩⟩] +def bkt_13 : List kernel := [] +def bkt_15 : List kernel := [⟨101,⟨3,3,141,127⟩⟩,⟨676,⟨3,3,909,895⟩⟩,⟨1250,⟨3,3,1677,1663⟩⟩,⟨1823,⟨3,3,2445,2431⟩⟩] +def bkt_17 : List kernel := [⟨8,⟨1,1,13,0⟩⟩,⟨45,⟨1,1,109,0⟩⟩,⟨81,⟨1,1,205,0⟩⟩,⟨116,⟨1,1,301,0⟩⟩,⟨152,⟨1,1,397,0⟩⟩,⟨189,⟨1,1,493,0⟩⟩,⟨225,⟨1,1,589,0⟩⟩,⟨261,⟨1,1,685,0⟩⟩,⟨297,⟨1,1,781,0⟩⟩,⟨334,⟨1,1,877,0⟩⟩,⟨370,⟨1,1,973,0⟩⟩,⟨402,⟨1,1,1069,0⟩⟩,⟨438,⟨1,1,1165,0⟩⟩,⟨475,⟨1,1,1261,0⟩⟩,⟨511,⟨1,1,1357,0⟩⟩,⟨547,⟨1,1,1453,0⟩⟩,⟨583,⟨1,1,1549,0⟩⟩,⟨620,⟨1,1,1645,0⟩⟩,⟨656,⟨1,1,1741,0⟩⟩,⟨691,⟨1,1,1837,0⟩⟩,⟨727,⟨1,1,1933,0⟩⟩,⟨764,⟨1,1,2029,0⟩⟩,⟨800,⟨1,1,2125,0⟩⟩,⟨836,⟨1,1,2221,0⟩⟩,⟨872,⟨1,1,2317,0⟩⟩,⟨909,⟨1,1,2413,0⟩⟩,⟨945,⟨1,1,2509,0⟩⟩,⟨976,⟨1,1,2605,0⟩⟩,⟨1012,⟨1,1,2701,0⟩⟩,⟨1049,⟨1,1,2797,0⟩⟩,⟨1085,⟨1,1,2893,0⟩⟩,⟨1121,⟨1,1,2989,0⟩⟩,⟨1157,⟨1,1,3085,0⟩⟩,⟨1194,⟨1,1,3181,0⟩⟩,⟨1230,⟨1,1,3277,0⟩⟩,⟨1265,⟨1,1,3373,0⟩⟩,⟨1301,⟨1,1,3469,0⟩⟩,⟨1338,⟨1,1,3565,0⟩⟩,⟨1374,⟨1,1,3661,0⟩⟩,⟨1410,⟨1,1,3757,0⟩⟩,⟨1446,⟨1,1,3853,0⟩⟩,⟨1483,⟨1,1,3949,0⟩⟩,⟨1519,⟨1,1,4045,0⟩⟩,⟨1549,⟨1,1,4141,0⟩⟩,⟨1585,⟨1,1,4237,0⟩⟩,⟨1622,⟨1,1,4333,0⟩⟩,⟨1658,⟨1,1,4429,0⟩⟩,⟨1694,⟨1,1,4525,0⟩⟩,⟨1730,⟨1,1,4621,0⟩⟩,⟨1767,⟨1,1,4717,0⟩⟩,⟨1803,⟨1,1,4813,0⟩⟩,⟨1838,⟨1,1,4909,0⟩⟩,⟨1874,⟨1,1,5005,0⟩⟩,⟨1911,⟨1,1,5101,0⟩⟩,⟨1947,⟨1,1,5197,0⟩⟩,⟨1983,⟨1,1,5293,0⟩⟩,⟨2019,⟨1,1,5389,0⟩⟩] +def bkt_19 : List kernel := [⟨32,⟨1,1,79,0⟩⟩,⟨68,⟨1,1,175,0⟩⟩,⟨139,⟨1,1,367,0⟩⟩,⟨176,⟨1,1,463,0⟩⟩,⟨212,⟨1,1,559,0⟩⟩,⟨248,⟨1,1,655,0⟩⟩,⟨284,⟨1,1,751,0⟩⟩,⟨321,⟨1,1,847,0⟩⟩,⟨357,⟨1,1,943,0⟩⟩,⟨425,⟨1,1,1135,0⟩⟩,⟨462,⟨1,1,1231,0⟩⟩,⟨498,⟨1,1,1327,0⟩⟩,⟨534,⟨1,1,1423,0⟩⟩,⟨570,⟨1,1,1519,0⟩⟩,⟨607,⟨1,1,1615,0⟩⟩,⟨643,⟨1,1,1711,0⟩⟩,⟨714,⟨1,1,1903,0⟩⟩,⟨751,⟨1,1,1999,0⟩⟩,⟨787,⟨1,1,2095,0⟩⟩,⟨823,⟨1,1,2191,0⟩⟩,⟨859,⟨1,1,2287,0⟩⟩,⟨896,⟨1,1,2383,0⟩⟩,⟨932,⟨1,1,2479,0⟩⟩,⟨999,⟨1,1,2671,0⟩⟩,⟨1036,⟨1,1,2767,0⟩⟩,⟨1072,⟨1,1,2863,0⟩⟩,⟨1108,⟨1,1,2959,0⟩⟩,⟨1144,⟨1,1,3055,0⟩⟩,⟨1181,⟨1,1,3151,0⟩⟩,⟨1217,⟨1,1,3247,0⟩⟩,⟨1288,⟨1,1,3439,0⟩⟩,⟨1325,⟨1,1,3535,0⟩⟩,⟨1361,⟨1,1,3631,0⟩⟩,⟨1397,⟨1,1,3727,0⟩⟩,⟨1433,⟨1,1,3823,0⟩⟩,⟨1470,⟨1,1,3919,0⟩⟩,⟨1506,⟨1,1,4015,0⟩⟩,⟨1572,⟨1,1,4207,0⟩⟩,⟨1609,⟨1,1,4303,0⟩⟩,⟨1645,⟨1,1,4399,0⟩⟩,⟨1681,⟨1,1,4495,0⟩⟩,⟨1717,⟨1,1,4591,0⟩⟩,⟨1754,⟨1,1,4687,0⟩⟩,⟨1790,⟨1,1,4783,0⟩⟩,⟨1861,⟨1,1,4975,0⟩⟩,⟨1898,⟨1,1,5071,0⟩⟩,⟨1934,⟨1,1,5167,0⟩⟩,⟨1970,⟨1,1,5263,0⟩⟩,⟨2006,⟨1,1,5359,0⟩⟩,⟨2043,⟨1,1,5455,0⟩⟩] +def bkt_21 : List kernel := [⟨22,⟨1,1,49,0⟩⟩,⟨59,⟨1,1,145,0⟩⟩,⟨95,⟨1,1,241,0⟩⟩,⟨130,⟨1,1,337,0⟩⟩,⟨166,⟨1,1,433,0⟩⟩,⟨203,⟨1,1,529,0⟩⟩,⟨239,⟨1,1,625,0⟩⟩,⟨275,⟨1,1,721,0⟩⟩,⟨311,⟨1,1,817,0⟩⟩,⟨348,⟨1,1,913,0⟩⟩,⟨384,⟨1,1,1009,0⟩⟩,⟨416,⟨1,1,1105,0⟩⟩,⟨452,⟨1,1,1201,0⟩⟩,⟨489,⟨1,1,1297,0⟩⟩,⟨525,⟨1,1,1393,0⟩⟩,⟨561,⟨1,1,1489,0⟩⟩,⟨597,⟨1,1,1585,0⟩⟩,⟨634,⟨1,1,1681,0⟩⟩,⟨670,⟨1,1,1777,0⟩⟩,⟨705,⟨1,1,1873,0⟩⟩,⟨741,⟨1,1,1969,0⟩⟩,⟨778,⟨1,1,2065,0⟩⟩,⟨814,⟨1,1,2161,0⟩⟩,⟨850,⟨1,1,2257,0⟩⟩,⟨886,⟨1,1,2353,0⟩⟩,⟨923,⟨1,1,2449,0⟩⟩,⟨959,⟨1,1,2545,0⟩⟩,⟨990,⟨1,1,2641,0⟩⟩,⟨1026,⟨1,1,2737,0⟩⟩,⟨1063,⟨1,1,2833,0⟩⟩,⟨1099,⟨1,1,2929,0⟩⟩,⟨1135,⟨1,1,3025,0⟩⟩,⟨1171,⟨1,1,3121,0⟩⟩,⟨1208,⟨1,1,3217,0⟩⟩,⟨1244,⟨1,1,3313,0⟩⟩,⟨1279,⟨1,1,3409,0⟩⟩,⟨1315,⟨1,1,3505,0⟩⟩,⟨1352,⟨1,1,3601,0⟩⟩,⟨1388,⟨1,1,3697,0⟩⟩,⟨1424,⟨1,1,3793,0⟩⟩,⟨1460,⟨1,1,3889,0⟩⟩,⟨1497,⟨1,1,3985,0⟩⟩,⟨1533,⟨1,1,4081,0⟩⟩,⟨1563,⟨1,1,4177,0⟩⟩,⟨1599,⟨1,1,4273,0⟩⟩,⟨1636,⟨1,1,4369,0⟩⟩,⟨1672,⟨1,1,4465,0⟩⟩,⟨1708,⟨1,1,4561,0⟩⟩,⟨1744,⟨1,1,4657,0⟩⟩,⟨1781,⟨1,1,4753,0⟩⟩,⟨1817,⟨1,1,4849,0⟩⟩,⟨1852,⟨1,1,4945,0⟩⟩,⟨1888,⟨1,1,5041,0⟩⟩,⟨1925,⟨1,1,5137,0⟩⟩,⟨1961,⟨1,1,5233,0⟩⟩,⟨1997,⟨1,1,5329,0⟩⟩,⟨2033,⟨1,1,5425,0⟩⟩] +def bkt_23 : List kernel := [] +def bkt_25 : List kernel := [⟨35,⟨1,1,85,0⟩⟩,⟨65,⟨3,3,87,79⟩⟩,⟨71,⟨1,1,181,0⟩⟩,⟨106,⟨1,1,277,0⟩⟩,⟨136,⟨3,3,183,175⟩⟩,⟨142,⟨1,1,373,0⟩⟩,⟨179,⟨1,1,469,0⟩⟩,⟨209,⟨3,3,279,271⟩⟩,⟨215,⟨1,1,565,0⟩⟩,⟨251,⟨1,1,661,0⟩⟩,⟨281,⟨3,3,375,367⟩⟩,⟨287,⟨1,1,757,0⟩⟩,⟨324,⟨1,1,853,0⟩⟩,⟨354,⟨3,3,471,463⟩⟩,⟨360,⟨1,1,949,0⟩⟩,⟨422,⟨3,3,567,559⟩⟩,⟨428,⟨1,1,1141,0⟩⟩,⟨465,⟨1,1,1237,0⟩⟩,⟨495,⟨3,3,663,655⟩⟩,⟨501,⟨1,1,1333,0⟩⟩,⟨537,⟨1,1,1429,0⟩⟩,⟨567,⟨3,3,759,751⟩⟩,⟨573,⟨1,1,1525,0⟩⟩,⟨610,⟨1,1,1621,0⟩⟩,⟨640,⟨3,3,855,847⟩⟩,⟨646,⟨1,1,1717,0⟩⟩,⟨681,⟨1,1,1813,0⟩⟩,⟨711,⟨3,3,951,943⟩⟩,⟨717,⟨1,1,1909,0⟩⟩,⟨754,⟨1,1,2005,0⟩⟩,⟨784,⟨3,3,1047,1039⟩⟩,⟨790,⟨1,1,2101,0⟩⟩,⟨826,⟨1,1,2197,0⟩⟩,⟨856,⟨3,3,1143,1135⟩⟩,⟨862,⟨1,1,2293,0⟩⟩,⟨899,⟨1,1,2389,0⟩⟩,⟨929,⟨3,3,1239,1231⟩⟩,⟨935,⟨1,1,2485,0⟩⟩,⟨966,⟨1,1,2581,0⟩⟩,⟨996,⟨3,3,1335,1327⟩⟩,⟨1002,⟨1,1,2677,0⟩⟩,⟨1039,⟨1,1,2773,0⟩⟩,⟨1069,⟨3,3,1431,1423⟩⟩,⟨1075,⟨1,1,2869,0⟩⟩,⟨1111,⟨1,1,2965,0⟩⟩,⟨1141,⟨3,3,1527,1519⟩⟩,⟨1147,⟨1,1,3061,0⟩⟩,⟨1184,⟨1,1,3157,0⟩⟩,⟨1214,⟨3,3,1623,1615⟩⟩,⟨1220,⟨1,1,3253,0⟩⟩,⟨1255,⟨1,1,3349,0⟩⟩,⟨1285,⟨3,3,1719,1711⟩⟩,⟨1291,⟨1,1,3445,0⟩⟩,⟨1328,⟨1,1,3541,0⟩⟩,⟨1358,⟨3,3,1815,1807⟩⟩,⟨1364,⟨1,1,3637,0⟩⟩,⟨1400,⟨1,1,3733,0⟩⟩,⟨1430,⟨3,3,1911,1903⟩⟩,⟨1436,⟨1,1,3829,0⟩⟩,⟨1473,⟨1,1,3925,0⟩⟩,⟨1503,⟨3,3,2007,1999⟩⟩,⟨1509,⟨1,1,4021,0⟩⟩,⟨1569,⟨3,3,2103,2095⟩⟩,⟨1575,⟨1,1,4213,0⟩⟩,⟨1612,⟨1,1,4309,0⟩⟩,⟨1642,⟨3,3,2199,2191⟩⟩,⟨1648,⟨1,1,4405,0⟩⟩,⟨1684,⟨1,1,4501,0⟩⟩,⟨1714,⟨3,3,2295,2287⟩⟩,⟨1720,⟨1,1,4597,0⟩⟩,⟨1757,⟨1,1,4693,0⟩⟩,⟨1787,⟨3,3,2391,2383⟩⟩,⟨1793,⟨1,1,4789,0⟩⟩,⟨1828,⟨1,1,4885,0⟩⟩,⟨1858,⟨3,3,2487,2479⟩⟩,⟨1864,⟨1,1,4981,0⟩⟩,⟨1901,⟨1,1,5077,0⟩⟩,⟨1931,⟨3,3,2583,2575⟩⟩,⟨1937,⟨1,1,5173,0⟩⟩,⟨1973,⟨1,1,5269,0⟩⟩,⟨2003,⟨3,3,2679,2671⟩⟩,⟨2009,⟨1,1,5365,0⟩⟩,⟨2046,⟨1,1,5461,0⟩⟩] +def bkt_27 : List kernel := [⟨5,⟨1,1,7,0⟩⟩,⟨24,⟨1,1,55,0⟩⟩,⟨61,⟨1,1,151,0⟩⟩,⟨97,⟨1,1,247,0⟩⟩,⟨132,⟨1,1,343,0⟩⟩,⟨168,⟨1,1,439,0⟩⟩,⟨205,⟨1,1,535,0⟩⟩,⟨241,⟨1,1,631,0⟩⟩,⟨277,⟨1,1,727,0⟩⟩,⟨313,⟨1,1,823,0⟩⟩,⟨350,⟨1,1,919,0⟩⟩,⟨386,⟨1,1,1015,0⟩⟩,⟨418,⟨1,1,1111,0⟩⟩,⟨454,⟨1,1,1207,0⟩⟩,⟨491,⟨1,1,1303,0⟩⟩,⟨527,⟨1,1,1399,0⟩⟩,⟨563,⟨1,1,1495,0⟩⟩,⟨599,⟨1,1,1591,0⟩⟩,⟨636,⟨1,1,1687,0⟩⟩,⟨672,⟨1,1,1783,0⟩⟩,⟨707,⟨1,1,1879,0⟩⟩,⟨743,⟨1,1,1975,0⟩⟩,⟨780,⟨1,1,2071,0⟩⟩,⟨816,⟨1,1,2167,0⟩⟩,⟨852,⟨1,1,2263,0⟩⟩,⟨888,⟨1,1,2359,0⟩⟩,⟨925,⟨1,1,2455,0⟩⟩,⟨961,⟨1,1,2551,0⟩⟩,⟨992,⟨1,1,2647,0⟩⟩,⟨1028,⟨1,1,2743,0⟩⟩,⟨1065,⟨1,1,2839,0⟩⟩,⟨1101,⟨1,1,2935,0⟩⟩,⟨1137,⟨1,1,3031,0⟩⟩,⟨1173,⟨1,1,3127,0⟩⟩,⟨1210,⟨1,1,3223,0⟩⟩,⟨1246,⟨1,1,3319,0⟩⟩,⟨1281,⟨1,1,3415,0⟩⟩,⟨1317,⟨1,1,3511,0⟩⟩,⟨1354,⟨1,1,3607,0⟩⟩,⟨1390,⟨1,1,3703,0⟩⟩,⟨1426,⟨1,1,3799,0⟩⟩,⟨1462,⟨1,1,3895,0⟩⟩,⟨1499,⟨1,1,3991,0⟩⟩,⟨1535,⟨1,1,4087,0⟩⟩,⟨1539,⟨3,3,2073,2047⟩⟩,⟨1565,⟨1,1,4183,0⟩⟩,⟨1601,⟨1,1,4279,0⟩⟩,⟨1638,⟨1,1,4375,0⟩⟩,⟨1674,⟨1,1,4471,0⟩⟩,⟨1710,⟨1,1,4567,0⟩⟩,⟨1746,⟨1,1,4663,0⟩⟩,⟨1783,⟨1,1,4759,0⟩⟩,⟨1819,⟨1,1,4855,0⟩⟩,⟨1854,⟨1,1,4951,0⟩⟩,⟨1890,⟨1,1,5047,0⟩⟩,⟨1927,⟨1,1,5143,0⟩⟩,⟨1963,⟨1,1,5239,0⟩⟩,⟨1999,⟨1,1,5335,0⟩⟩,⟨2035,⟨1,1,5431,0⟩⟩] +def bkt_29 : List kernel := [⟨12,⟨1,1,25,0⟩⟩,⟨49,⟨1,1,121,0⟩⟩,⟨85,⟨1,1,217,0⟩⟩,⟨120,⟨1,1,313,0⟩⟩,⟨156,⟨1,1,409,0⟩⟩,⟨193,⟨1,1,505,0⟩⟩,⟨229,⟨1,1,601,0⟩⟩,⟨265,⟨1,1,697,0⟩⟩,⟨301,⟨1,1,793,0⟩⟩,⟨338,⟨1,1,889,0⟩⟩,⟨374,⟨1,1,985,0⟩⟩,⟨406,⟨1,1,1081,0⟩⟩,⟨442,⟨1,1,1177,0⟩⟩,⟨479,⟨1,1,1273,0⟩⟩,⟨515,⟨1,1,1369,0⟩⟩,⟨551,⟨1,1,1465,0⟩⟩,⟨587,⟨1,1,1561,0⟩⟩,⟨624,⟨1,1,1657,0⟩⟩,⟨660,⟨1,1,1753,0⟩⟩,⟨695,⟨1,1,1849,0⟩⟩,⟨731,⟨1,1,1945,0⟩⟩,⟨768,⟨1,1,2041,0⟩⟩,⟨804,⟨1,1,2137,0⟩⟩,⟨840,⟨1,1,2233,0⟩⟩,⟨876,⟨1,1,2329,0⟩⟩,⟨913,⟨1,1,2425,0⟩⟩,⟨949,⟨1,1,2521,0⟩⟩,⟨980,⟨1,1,2617,0⟩⟩,⟨1016,⟨1,1,2713,0⟩⟩,⟨1053,⟨1,1,2809,0⟩⟩,⟨1089,⟨1,1,2905,0⟩⟩,⟨1125,⟨1,1,3001,0⟩⟩,⟨1161,⟨1,1,3097,0⟩⟩,⟨1198,⟨1,1,3193,0⟩⟩,⟨1234,⟨1,1,3289,0⟩⟩,⟨1269,⟨1,1,3385,0⟩⟩,⟨1305,⟨1,1,3481,0⟩⟩,⟨1342,⟨1,1,3577,0⟩⟩,⟨1378,⟨1,1,3673,0⟩⟩,⟨1414,⟨1,1,3769,0⟩⟩,⟨1450,⟨1,1,3865,0⟩⟩,⟨1487,⟨1,1,3961,0⟩⟩,⟨1523,⟨1,1,4057,0⟩⟩,⟨1553,⟨1,1,4153,0⟩⟩,⟨1589,⟨1,1,4249,0⟩⟩,⟨1626,⟨1,1,4345,0⟩⟩,⟨1662,⟨1,1,4441,0⟩⟩,⟨1698,⟨1,1,4537,0⟩⟩,⟨1734,⟨1,1,4633,0⟩⟩,⟨1771,⟨1,1,4729,0⟩⟩,⟨1807,⟨1,1,4825,0⟩⟩,⟨1842,⟨1,1,4921,0⟩⟩,⟨1878,⟨1,1,5017,0⟩⟩,⟨1915,⟨1,1,5113,0⟩⟩,⟨1951,⟨1,1,5209,0⟩⟩,⟨1987,⟨1,1,5305,0⟩⟩,⟨2023,⟨1,1,5401,0⟩⟩] +def bkt_31 : List kernel := [⟨394,⟨1,1,1051,0⟩⟩] +def cands_5 : List kernel := [⟨17,⟨1,1,37,0⟩⟩,⟨54,⟨1,1,133,0⟩⟩,⟨90,⟨1,1,229,0⟩⟩,⟨125,⟨1,1,325,0⟩⟩,⟨161,⟨1,1,421,0⟩⟩,⟨198,⟨1,1,517,0⟩⟩,⟨234,⟨1,1,613,0⟩⟩,⟨270,⟨1,1,709,0⟩⟩,⟨306,⟨1,1,805,0⟩⟩,⟨343,⟨1,1,901,0⟩⟩,⟨379,⟨1,1,997,0⟩⟩,⟨411,⟨1,1,1093,0⟩⟩,⟨447,⟨1,1,1189,0⟩⟩,⟨484,⟨1,1,1285,0⟩⟩,⟨520,⟨1,1,1381,0⟩⟩,⟨556,⟨1,1,1477,0⟩⟩,⟨592,⟨1,1,1573,0⟩⟩,⟨629,⟨1,1,1669,0⟩⟩,⟨665,⟨1,1,1765,0⟩⟩,⟨700,⟨1,1,1861,0⟩⟩,⟨736,⟨1,1,1957,0⟩⟩,⟨773,⟨1,1,2053,0⟩⟩,⟨809,⟨1,1,2149,0⟩⟩,⟨845,⟨1,1,2245,0⟩⟩,⟨881,⟨1,1,2341,0⟩⟩,⟨918,⟨1,1,2437,0⟩⟩,⟨954,⟨1,1,2533,0⟩⟩,⟨985,⟨1,1,2629,0⟩⟩,⟨1021,⟨1,1,2725,0⟩⟩,⟨1058,⟨1,1,2821,0⟩⟩,⟨1094,⟨1,1,2917,0⟩⟩,⟨1130,⟨1,1,3013,0⟩⟩,⟨1166,⟨1,1,3109,0⟩⟩,⟨1203,⟨1,1,3205,0⟩⟩,⟨1239,⟨1,1,3301,0⟩⟩,⟨1274,⟨1,1,3397,0⟩⟩,⟨1310,⟨1,1,3493,0⟩⟩,⟨1347,⟨1,1,3589,0⟩⟩,⟨1383,⟨1,1,3685,0⟩⟩,⟨1419,⟨1,1,3781,0⟩⟩,⟨1455,⟨1,1,3877,0⟩⟩,⟨1492,⟨1,1,3973,0⟩⟩,⟨1528,⟨1,1,4069,0⟩⟩,⟨1558,⟨1,1,4165,0⟩⟩,⟨1594,⟨1,1,4261,0⟩⟩,⟨1631,⟨1,1,4357,0⟩⟩,⟨1667,⟨1,1,4453,0⟩⟩,⟨1703,⟨1,1,4549,0⟩⟩,⟨1739,⟨1,1,4645,0⟩⟩,⟨1776,⟨1,1,4741,0⟩⟩,⟨1812,⟨1,1,4837,0⟩⟩,⟨1847,⟨1,1,4933,0⟩⟩,⟨1883,⟨1,1,5029,0⟩⟩,⟨1920,⟨1,1,5125,0⟩⟩,⟨1956,⟨1,1,5221,0⟩⟩,⟨1992,⟨1,1,5317,0⟩⟩,⟨2028,⟨1,1,5413,0⟩⟩] +def cands_8 : List kernel := [⟨139,⟨1,1,367,0⟩⟩,⟨425,⟨1,1,1135,0⟩⟩,⟨714,⟨1,1,1903,0⟩⟩,⟨999,⟨1,1,2671,0⟩⟩,⟨1288,⟨1,1,3439,0⟩⟩,⟨1572,⟨1,1,4207,0⟩⟩,⟨1861,⟨1,1,4975,0⟩⟩] + +def qaG : state:=⟨none,0,1,0,0,0⟩ +theorem initial_spec (S U : ℤ) : qE qaG S U S U:= by + unfold qE qaG WordRelation.optional + try dsimp -failIfUnchanged only + refine ⟨by omega,⟨0,rfl⟩,by simp,by omega,trivial⟩ + +def get_bkt (r : ℤ) : List kernel := + if int_lt r 16 then + if int_lt r 8 then + if int_lt r 4 then + if int_eq r 1 then bkt_1 else if int_eq r 3 then bkt_3 else [] + else + if int_eq r 5 then bkt_5 else if int_eq r 7 then bkt_7 else [] + else + if int_lt r 12 then + if int_eq r 9 then bkt_9 else if int_eq r 11 then bkt_11 else [] + else + if int_eq r 13 then bkt_13 else if int_eq r 15 then bkt_15 else [] + else + if int_lt r 24 then + if int_lt r 20 then + if int_eq r 17 then bkt_17 else if int_eq r 19 then bkt_19 else [] + else + if int_eq r 21 then bkt_21 else if int_eq r 23 then bkt_23 else [] + else + if int_lt r 28 then + if int_eq r 25 then bkt_25 else if int_eq r 27 then bkt_27 else [] + else + if int_eq r 29 then bkt_29 else if int_eq r 31 then bkt_31 else [] + +def k_tag (k : kernel) : ℤ := + (2 * gain k - k.pair.b + (if int_eq k.index 5 then 16 else 0)) % 32 + +def k_req (kp : kernel) : ℤ := + (32 - ((kp.pair.b + (if int_eq kp.index 5 then 16 else 0)) % 32)) % 32 + +def get_cands_3 (kp : kernel) : List kernel := + if int_eq kp.index 5 then cands_5 + else if int_eq kp.index 8 then cands_8 + else + q2 (k_req kp) fun r => + if int_eq r 27 then [⟨5,⟨1,1,7,0⟩⟩] + else if int_eq r 17 then [⟨8,⟨1,1,13,0⟩⟩] + else [] + +def get_cands (fuel : ℕ) (kp : kernel) : List kernel := + match fuel with + | 0 => library_val + | _ + 1 => + match Nat.ble 3 fuel with + | true => get_cands_3 kp + | false => get_bkt (k_req kp) + +def qq16 (n x : ℤ) : ℤ := + if Nat.beq x.natAbs 0 then n else Int.ofNat (ctz_16 n.toNat x.natAbs) + +def qbg5 (x : ℤ) : Bool := + Nat.beq (Nat.mod x.natAbs 32) 0 + +def single_small (v : ℤ) : Option kernel := + if int_eq v 5 then some ⟨5,⟨1,1,7,0⟩⟩ + else if int_eq v 8 then some ⟨8,⟨1,1,13,0⟩⟩ + else if int_eq v 12 then some ⟨12,⟨1,1,25,0⟩⟩ + else if int_eq v 14 then some ⟨14,⟨1,1,31,0⟩⟩ + else none + +def int_min (a b : ℤ) : ℤ := + if int_le a b then a else b + +def step_base (base m1 m2 : ℤ) : Bool × Option kernel := + q2 (int_min m1 m2) fun m_raw => + if int_lt m_raw 4 then (true, none) + else + q2 (int_min 15 (m_raw + 1)) fun m => + q2 (if int_eq m1 m2 then 0 else if int_le m_raw 14 then q0 m_raw else 0) fun adj => + q2 (base + adj) fun diff => + if !(qbg5 diff) then (false, none) + else + q2 (qq16 m diff) fun v => + if int_lt v m then + match single_small v with + | none => (false, none) + | some k3 => (true, some k3) + else (true, none) + +def chain_simple : ℕ → kernel → kernel → Bool + | 0, _, _ => true + | fuel + 1, k1, k2 => + q2 (k1.index - k1.pair.d) fun m1 => + q2 (k2.index - k2.pair.d) fun m2 => + q2 (2 * gain k2 + k1.pair.b - k2.pair.b) fun base => + match step_base base m1 m2 with + | (false, _) => false + | (true, none) => true + | (true, some k3) => + if !(chain_simple fuel k2 k3) then false + else + match fuel with + | 0 => true + | fuel2 + 1 => + if int_le k3.index (int_min m1 m2) then + q2 (2 * gain k3 + k2.pair.b - k3.pair.b + base / 2) fun base_div => + match step_base base_div (m1 - 1) (m2 - 1) with + | (false, _) => false + | (true, none) => true + | (true, some k4) => chain_simple fuel2 k3 k4 + else true + +def eval_step_rel (fuel1 : ℕ) (base m1 : ℤ) (k_last : kernel) : Bool := + q2 (k_last.index - k_last.pair.d) fun m2 => + match step_base base m1 m2 with + | (false, _) => false + | (true, none) => true + | (true, some k_next) => + if !(chain_simple fuel1 k_last k_next) then false + else + match fuel1 with + | 0 => true + | fuel2 + 1 => + if int_le k_next.index (int_min m1 m2) then + q2 (2 * gain k_next + k_last.pair.b - k_next.pair.b + base / 2) fun base_div => + match step_base base_div (m1 - 1) (m2 - 1) with + | (false, _) => false + | (true, none) => true + | (true, some k_next2) => chain_simple fuel2 k_next k_next2 + else true + +def check_4k_simple (fuel : ℕ) (kp2 : Option kernel) (kp k : kernel) : Bool := + let ok4 := + match kp2, fuel with + | none, _ => true + | _, 0 => true + | some k0, fuel1 + 1 => + if !(int_eq kp.pair.d 1) then true + else + q2 (k0.index - k0.pair.d) fun m1 => + q2 (2 * gain k - k.pair.b - k0.pair.b - 4) fun base => + eval_step_rel fuel1 base m1 k + if !ok4 then false else chain_simple fuel kp k + +def qJ_cands (fuel : ℕ) (min_idx : ℤ) (kp2 : Option kernel) (kp : kernel) + (step : kernel → Bool) : List kernel → Bool + | [] => true + | k :: ks => + if int_le min_idx k.index then + if check_4k_simple fuel kp2 kp k then + if step k then qJ_cands fuel min_idx kp2 kp step ks else false + else + qJ_cands fuel min_idx kp2 kp step ks + else + qJ_cands fuel min_idx kp2 kp step ks + +def qbN_c : ℕ → state → Option kernel → kernel → Bool + | 0, _, _, _ => false + | fuel + 1, z, kp2, kp => + match z.rel with + | none => qJ_cands fuel 0 kp2 kp (fun k => qB (fun z' => qbN_c fuel z' (some kp) k) z k) (get_cands fuel kp) + | some r => + q2 (A z) fun az => + q2 (B z) fun bz => + q2 (qa2 r az z.Q) fun bound => + q2 (qq bound (qa6 r az bz z.Q)) fun v => + if int_lt v bound then + q2 (v - z.D) fun s => + qJ_cands fuel 0 kp2 kp (fun k => qB (fun z' => qbN_c fuel z' (some kp) k) z k) (single s) + else + q2 (bound - z.D) fun min_idx => + qJ_cands fuel min_idx kp2 kp (fun k => qB (fun z' => qbN_c fuel z' (some kp) k) z k) (get_cands fuel kp) + +theorem int_le_iff (a b : ℤ) : int_le a b = true ↔ a ≤ b := by + cases a <;> cases b <;> simp [int_le, Nat.ble_eq] <;> omega + +theorem int_lt_iff (a b : ℤ) : int_lt a b = true ↔ a < b := by + cases a <;> cases b <;> simp [int_lt, Nat.ble_eq] <;> omega + +theorem int_eq_iff (a b : ℤ) : int_eq a b = true ↔ a = b := by + cases a <;> cases b <;> simp [int_eq, Nat.beq_eq] <;> omega + +theorem int_min_eq (a b : ℤ) : int_min a b = min a b := by + unfold int_min + split_ifs with h + · rw [int_le_iff] at h; exact (min_eq_left h).symm + · have h' : ¬ a ≤ b := fun hab => h ((int_le_iff a b).mpr hab) + omega + +theorem qq16_eq (n x : ℤ) : qq16 n x = qq n x := by + unfold qq16 qq + split_ifs with h + · rfl + · rw [ctz_16_eq, ctz_fast_eq] + +theorem qbg5_iff (x : ℤ) : qbg5 x = true ↔ qa3 5 x := by + have h5 : (0 : ℤ) ≤ 5 := by omega + rw [← qbs h5] + rfl + +def lib_kernel_ok (k : kernel) : Bool := + decide (5 ≤ k.index) && + decide (1 ≤ k.pair.d) && + decide (4 ≤ k.index - k.pair.d) && + decide (k.index - k.pair.d = 4 ↔ k.index = 5) && + zodd k.pair.p && + zodd (q0 k.pair.d - k.pair.p) && + zodd (q0 (k.pair.d + 1) - k.pair.p) && + decide (k.pair.d = 1 → k.pair.p = 1 ∧ gain k = k.pair.b + 2) && + decide (k.index < 15 → single_small k.index = some k) && + decide (k ∈ get_bkt (k_tag k)) + +theorem lib_kernel_ok_all : qJ lib_kernel_ok library_val = true := by decide +kernel + +theorem lib_kernel_props {k : kernel} (hk : k ∈ library_val) : + 5 ≤ k.index ∧ + 1 ≤ k.pair.d ∧ + 4 ≤ k.index - k.pair.d ∧ + (k.index - k.pair.d = 4 ↔ k.index = 5) ∧ + qW k.pair.p ∧ + qW (q0 k.pair.d - k.pair.p) ∧ + qW (q0 (k.pair.d + 1) - k.pair.p) ∧ + (k.pair.d = 1 → k.pair.p = 1 ∧ gain k = k.pair.b + 2) ∧ + (k.index < 15 → single_small k.index = some k) ∧ + k ∈ get_bkt (k_tag k) := by + have h := qbf lib_kernel_ok library_val lib_kernel_ok_all k hk + unfold lib_kernel_ok at h + simp only [Bool.and_eq_true, decide_eq_true_eq, zodd_iff] at h + exact ⟨h.1.1.1.1.1.1.1.1.1, h.1.1.1.1.1.1.1.1.2, h.1.1.1.1.1.1.1.2, + h.1.1.1.1.1.1.2, h.1.1.1.1.1.2, h.1.1.1.1.2, h.1.1.1.2, h.1.1.2, h.1.2, h.2⟩ + +theorem single_small_props (v : ℤ) (k3 : kernel) (h : single_small v = some k3) : + k3 ∈ library_val ∧ k3.index = v ∧ k3.pair.d = 1 ∧ k3.pair.p = 1 := by + unfold single_small at h + split_ifs at h with h5 h8 h12 h14 + · injection h with h; subst h; rw [int_eq_iff] at h5; subst h5 + exact ⟨by decide, rfl, rfl, rfl⟩ + · injection h with h; subst h; rw [int_eq_iff] at h8; subst h8 + exact ⟨by decide, rfl, rfl, rfl⟩ + · injection h with h; subst h; rw [int_eq_iff] at h12; subst h12 + exact ⟨by decide, rfl, rfl, rfl⟩ + · injection h with h; subst h; rw [int_eq_iff] at h14; subst h14 + exact ⟨by decide, rfl, rfl, rfl⟩ + +theorem odd_mul {x y : ℤ} (hx : qW x) (hy : qW y) : qW (x * y) := by + rcases hx with ⟨a, rfl⟩ + rcases hy with ⟨b, rfl⟩ + refine ⟨2 * a * b + a + b, ?_⟩ + ring + +theorem odd_neg {x : ℤ} (hx : qW x) : qW (-x) := by + rcases hx with ⟨a, rfl⟩ + refine ⟨-a - 1, ?_⟩ + ring + +theorem odd_add_two_mul {x : ℤ} (y : ℤ) (hx : qW x) : qW (2 * y + x) := by + rcases hx with ⟨a, rfl⟩ + refine ⟨y + a, ?_⟩ + ring + +theorem odd_pair_adj_dvd {m1 m2 u1 u2 : ℤ} + (hm1 : 0 ≤ m1) (hm2 : 0 ≤ m2) (hu1 : qW u1) (hu2 : qW u2) : + qa3 (min 15 (min m1 m2 + 1)) + (q0 m1 * u1 + q0 m2 * u2 - + (if m1 = m2 then 0 else if min m1 m2 ≤ 14 then q0 (min m1 m2) else 0)) := by + rcases hu1 with ⟨a, rfl⟩ + rcases hu2 with ⟨b, rfl⟩ + have hm_raw : 0 ≤ min m1 m2 := by omega + have hm : 0 ≤ min 15 (min m1 m2 + 1) := by omega + split_ifs with heq hle14 + · subst heq + have hmin : min m1 m1 = m1 := min_self m1 + rw [hmin] + apply qp (by omega) (by omega : min 15 (m1 + 1) ≤ m1 + 1) + refine ⟨a + b + 1, ?_⟩ + rw [q5 hm1 (by omega : (0 : ℤ) ≤ 1), pow2_one] + ring + · apply qp hm (by omega : min 15 (min m1 m2 + 1) ≤ min m1 m2 + 1) + rcases lt_trichotomy m1 m2 with hlt | h_eq | hgt + · have hmin : min m1 m2 = m1 := min_eq_left (by omega) + rw [hmin] + have h1 : qa3 (m1 + 1) (q0 m1 * (2 * a + 1) - q0 m1) := by + refine ⟨a, ?_⟩ + rw [q5 hm1 (by omega : (0 : ℤ) ≤ 1), pow2_one] + ring + have h2 : qa3 (m1 + 1) (q0 m2 * (2 * b + 1)) := + qp (by omega) (by omega : m1 + 1 ≤ m2) ⟨2 * b + 1, rfl⟩ + have hsum := div2_add h1 h2 + have heq_sum : q0 m1 * (2 * a + 1) - q0 m1 + q0 m2 * (2 * b + 1) = + q0 m1 * (2 * a + 1) + q0 m2 * (2 * b + 1) - q0 m1 := by ring + rwa [heq_sum] at hsum + · exact absurd h_eq heq + · have hmin : min m1 m2 = m2 := min_eq_right (by omega) + rw [hmin] + have h1 : qa3 (m2 + 1) (q0 m2 * (2 * b + 1) - q0 m2) := by + refine ⟨b, ?_⟩ + rw [q5 hm2 (by omega : (0 : ℤ) ≤ 1), pow2_one] + ring + have h2 : qa3 (m2 + 1) (q0 m1 * (2 * a + 1)) := + qp (by omega) (by omega : m2 + 1 ≤ m1) ⟨2 * a + 1, rfl⟩ + have hsum := div2_add h2 h1 + have heq_sum : q0 m1 * (2 * a + 1) + (q0 m2 * (2 * b + 1) - q0 m2) = + q0 m1 * (2 * a + 1) + q0 m2 * (2 * b + 1) - q0 m2 := by ring + rwa [heq_sum] at hsum + · have hm15 : min 15 (min m1 m2 + 1) = 15 := by omega + rw [hm15] + have h1 : qa3 15 (q0 m1 * (2 * a + 1)) := + qp (by omega) (by omega : 15 ≤ m1) ⟨2 * a + 1, rfl⟩ + have h2 : qa3 15 (q0 m2 * (2 * b + 1)) := + qp (by omega) (by omega : 15 ≤ m2) ⟨2 * b + 1, rfl⟩ + have hsum := div2_add h1 h2 + simpa using! hsum + +def H_rel (base m1 m2 S U : ℤ) : Prop := + 4 ≤ m1 ∧ 4 ≤ m2 ∧ + ∃ u1 u2 : ℤ, qW u1 ∧ qW u2 ∧ 2 * S - U + 3 = base + q0 m1 * u1 + q0 m2 * u2 + +theorem step_base_sound {base m1 m2 S U S' U' : ℤ} {k_next : kernel} + (hrel : H_rel base m1 m2 S U) + (hk : k_next ∈ library_val) + (hact : action k_next S U S' U') : + (step_base base m1 m2).1 = true ∧ + ∀ k3, (step_base base m1 m2).2 = some k3 → + k3 = k_next ∧ k_next.pair.d = 1 ∧ k_next.pair.p = 1 := by + rcases hrel with ⟨hm1, hm2, u1, u2, hu1, hu2, hH⟩ + rcases hact with ⟨_, _, t, ht⟩ + have hkp := lib_kernel_props hk + have hi_ge5 : 5 ≤ k_next.index := hkp.1 + have h_if_lt : int_lt (int_min m1 m2) 4 = false := by + rw [Bool.eq_false_iff, Ne, int_lt_iff, int_min_eq]; omega + unfold step_base + simp only [strictInt_eq] + rw [h_if_lt] + try dsimp -failIfUnchanged only + have hm_eq : int_min 15 (int_min m1 m2 + 1) = min 15 (min m1 m2 + 1) := by + rw [int_min_eq, int_min_eq] + have hadj_eq : (if int_eq m1 m2 = true then 0 else if int_le (int_min m1 m2) 14 = true then q0 (int_min m1 m2) else 0) = + (if m1 = m2 then 0 else if min m1 m2 ≤ 14 then q0 (min m1 m2) else 0) := by + rw [int_min_eq] + by_cases h12 : m1 = m2 + · have h12' : int_eq m1 m2 = true := (int_eq_iff m1 m2).mpr h12 + rw [if_pos h12', if_pos h12] + · have h12' : ¬ int_eq m1 m2 = true := fun h => h12 ((int_eq_iff m1 m2).mp h) + rw [if_neg h12', if_neg h12] + by_cases hle : min m1 m2 ≤ 14 + · have hle' : int_le (min m1 m2) 14 = true := (int_le_iff _ _).mpr hle + rw [if_pos hle', if_pos hle] + · have hle' : ¬ int_le (min m1 m2) 14 = true := fun h => hle ((int_le_iff _ _).mp h) + rw [if_neg hle', if_neg hle] + rw [hm_eq, hadj_eq] + set m := min 15 (min m1 m2 + 1) + set adj := if m1 = m2 then 0 else if min m1 m2 ≤ 14 then q0 (min m1 m2) else 0 + set diff := base + adj + have hm_ge5 : 5 ≤ m := by omega + have hm_le15 : m ≤ 15 := by omega + have hdvd_m : qa3 m (diff - q0 k_next.index * (2 * t + 1)) := by + have h1 := odd_pair_adj_dvd (by omega : 0 ≤ m1) (by omega : 0 ≤ m2) hu1 hu2 + have hneg := qb4 (div2_zero m) h1 + have heq_diff : 0 - (q0 m1 * u1 + q0 m2 * u2 - adj) = diff - q0 k_next.index * (2 * t + 1) := by + change 0 - (q0 m1 * u1 + q0 m2 * u2 - adj) = (base + adj) - q0 k_next.index * (2 * t + 1) + linarith + rwa [heq_diff] at hneg + have hdvd5 : qa3 5 diff := by + have h1 : qa3 5 (diff - q0 k_next.index * (2 * t + 1)) := qp (by omega) hm_ge5 hdvd_m + have h2 : qa3 5 (q0 k_next.index * (2 * t + 1)) := qp (by omega) hi_ge5 ⟨2 * t + 1, rfl⟩ + have hsum := div2_add h1 h2 + have heq : diff - q0 k_next.index * (2 * t + 1) + q0 k_next.index * (2 * t + 1) = diff := by ring + rwa [heq] at hsum + have hqbg5 : qbg5 diff = true := (qbg5_iff diff).mpr hdvd5 + rw [hqbg5] + simp only [Bool.not_true, Bool.false_eq_true, ↓reduceIte, qq16_eq] + rcases qbw (by omega : 0 ≤ m) (by omega : 0 ≤ k_next.index) ⟨t, rfl⟩ hdvd_m with ⟨hv_lt, _⟩ + split_ifs with hlt + · have hlt' : qq m diff < m := (int_lt_iff _ _).mp hlt + have hi_eq : k_next.index = qq m diff := hv_lt hlt' + have hi_lt15 : k_next.index < 15 := by omega + have hss : single_small (qq m diff) = some k_next := by + rw [← hi_eq] + exact hkp.2.2.2.2.2.2.2.2.1 hi_lt15 + rw [hss] + rcases single_small_props _ _ hss with ⟨_, _, hd, hp⟩ + exact ⟨rfl, fun k3 hk3 => by injection hk3 with hk3; exact ⟨hk3.symm, hd, hp⟩⟩ + · exact ⟨rfl, fun k3 hk3 => by contradiction⟩ + +theorem action_step_eq {k : kernel} {S U S' U' : ℤ} + (hk : k ∈ library_val) (hact : action k S U S' U') : + ∃ t : ℤ, + 2 * S - U + 3 = q0 k.index * (2 * t + 1) ∧ + U' = k.pair.b + q0 (k.index - k.pair.d) * (k.pair.p * (2 * t + 1)) ∧ + 2 * S' - U' + 3 = U + 2 * gain k - k.pair.b + + q0 (k.index - k.pair.d) * ((q0 k.pair.d - k.pair.p) * (2 * t + 1)) := by + rcases hact with ⟨hS, hU, t, ht⟩ + have hkp := lib_kernel_props hk + have hd_ge1 : 1 ≤ k.pair.d := hkp.2.1 + have h_sub : 4 ≤ k.index - k.pair.d := hkp.2.2.1 + have hsplit : q0 k.index = q0 k.pair.d * q0 (k.index - k.pair.d) := + pow_split (by omega) (by omega) + have hd_pos : 0 < q0 k.pair.d := pow_pos (by omega) + have hU' : U' = k.pair.b + q0 (k.index - k.pair.d) * (k.pair.p * (2 * t + 1)) := by + apply mul_left_cancel₀ (ne_of_gt hd_pos) + calc q0 k.pair.d * U' + _ = k.pair.p * (2 * S - U + 3) + q0 k.pair.d * k.pair.b := hU + _ = k.pair.p * (q0 k.pair.d * q0 (k.index - k.pair.d) * (2 * t + 1)) + q0 k.pair.d * k.pair.b := by + rw [ht, hsplit] + _ = q0 k.pair.d * (k.pair.b + q0 (k.index - k.pair.d) * (k.pair.p * (2 * t + 1))) := by ring + refine ⟨t, ht, hU', ?_⟩ + have ht' : 2 * S - U + 3 = q0 k.pair.d * q0 (k.index - k.pair.d) * (2 * t + 1) := by + rw [← hsplit]; exact ht + linarith + +def H_rel_full (base m1 : ℤ) (k_last : kernel) (S_cur U_cur : ℤ) : Prop := + H_rel base m1 (k_last.index - k_last.pair.d) S_cur U_cur ∧ + ∃ v2 : ℤ, U_cur = k_last.pair.b + q0 (k_last.index - k_last.pair.d) * v2 + +theorem two_step_rel {k1 k2 : kernel} {S0 U0 S1 U1 S2 U2 : ℤ} + (hk1 : k1 ∈ library_val) (hk2 : k2 ∈ library_val) + (hact1 : action k1 S0 U0 S1 U1) (hact2 : action k2 S1 U1 S2 U2) : + H_rel_full (2 * gain k2 + k1.pair.b - k2.pair.b) (k1.index - k1.pair.d) k2 S2 U2 := by + rcases action_step_eq hk1 hact1 with ⟨t1, _, hU1, _⟩ + rcases action_step_eq hk2 hact2 with ⟨t2, _, hU2, hH2⟩ + have hkp1 := lib_kernel_props hk1 + have hkp2 := lib_kernel_props hk2 + refine ⟨⟨hkp1.2.2.1, hkp2.2.2.1, + k1.pair.p * (2 * t1 + 1), (q0 k2.pair.d - k2.pair.p) * (2 * t2 + 1), + odd_mul hkp1.2.2.2.2.1 ⟨t1, rfl⟩, + odd_mul hkp2.2.2.2.2.2.1 ⟨t2, rfl⟩, ?_⟩, + ⟨k2.pair.p * (2 * t2 + 1), hU2⟩⟩ + linarith + +theorem three_step_4k_rel {k0 kp k : kernel} {S0 U0 S1 U1 S2 U2 S3 U3 : ℤ} + (hk0 : k0 ∈ library_val) (hkp : kp ∈ library_val) (hk : k ∈ library_val) + (hd1 : kp.pair.d = 1) + (hact0 : action k0 S0 U0 S1 U1) + (hact1 : action kp S1 U1 S2 U2) + (hact2 : action k S2 U2 S3 U3) : + H_rel_full (2 * gain k - k.pair.b - k0.pair.b - 4) (k0.index - k0.pair.d) k S3 U3 := by + rcases action_step_eq hk0 hact0 with ⟨t0, _, hU1, _⟩ + rcases action_step_eq hk hact2 with ⟨t2, ht2, hU3, hH3⟩ + rcases hact1 with ⟨hS2, hU2_raw, _⟩ + have hkp0 := lib_kernel_props hk0 + have hkpp := lib_kernel_props hkp + have hkpk := lib_kernel_props hk + rcases hkpp.2.2.2.2.2.2.2.1 hd1 with ⟨hp1, hgain1⟩ + have hU2_eq : 2 * U2 = (2 * S1 - U1 + 3) + 2 * kp.pair.b := by + have h := hU2_raw + rw [hd1, hp1, pow2_one] at h + linarith + have hU2_rel : U2 = (2 * S2 - U2 + 3) - U1 - 4 := by linarith + have hsplit_k : q0 k.index = q0 k.pair.d * q0 (k.index - k.pair.d) := + pow_split (by omega : 0 ≤ k.pair.d) (by omega : k.pair.d ≤ k.index) + have hpow_d1 : q0 (k.pair.d + 1) = 2 * q0 k.pair.d := by + rw [q5 (by omega : 0 ≤ k.pair.d) (by omega : 0 ≤ (1 : ℤ)), pow2_one] + ring + refine ⟨⟨hkp0.2.2.1, hkpk.2.2.1, + -(k0.pair.p * (2 * t0 + 1)), (q0 (k.pair.d + 1) - k.pair.p) * (2 * t2 + 1), + odd_neg (odd_mul hkp0.2.2.2.2.1 ⟨t0, rfl⟩), + odd_mul hkpk.2.2.2.2.2.2.1 ⟨t2, rfl⟩, ?_⟩, + ⟨k.pair.p * (2 * t2 + 1), hU3⟩⟩ + have ht2' : 2 * S2 - U2 + 3 = q0 k.pair.d * q0 (k.index - k.pair.d) * (2 * t2 + 1) := by + rw [← hsplit_k]; exact ht2 + have hpow' := congr_arg (fun z => q0 (k.index - k.pair.d) * (2 * t2 + 1) * z) hpow_d1 + dsimp -failIfUnchanged only at hpow' + linarith + +theorem step_rel_div {base m1 : ℤ} {k_last k_next : kernel} {S_cur U_cur S_next U_next : ℤ} + (hrel : H_rel_full base m1 k_last S_cur U_cur) + (hk_next : k_next ∈ library_val) + (hd1 : k_next.pair.d = 1) (hp1 : k_next.pair.p = 1) + (hact : action k_next S_cur U_cur S_next U_next) + (hle : k_next.index ≤ min m1 (k_last.index - k_last.pair.d)) : + H_rel (2 * gain k_next + k_last.pair.b - k_next.pair.b + base / 2) + (m1 - 1) (k_last.index - k_last.pair.d - 1) S_next U_next := by + rcases hrel with ⟨⟨hm1, hm2, u1, u2, hu1, hu2, hH_cur⟩, v2, hU_cur⟩ + rcases hact with ⟨hS_next, hU_next_raw, t_next, ht_next⟩ + have hkp_next := lib_kernel_props hk_next + have hi_ge5 : 5 ≤ k_next.index := hkp_next.1 + have hm1_ge5 : 5 ≤ m1 := by omega + have hm2_ge5 : 5 ≤ k_last.index - k_last.pair.d := by omega + have hU_next : 2 * U_next = (2 * S_cur - U_cur + 3) + 2 * k_next.pair.b := by + have h := hU_next_raw + rw [hd1, hp1, pow2_one] at h + linarith + have hpow_i : q0 k_next.index = 2 * q0 (k_next.index - 1) := by + rw [pow_split (by omega : 0 ≤ (1 : ℤ)) (by omega : 1 ≤ k_next.index), pow2_one] + have hpow_m1 : q0 m1 = 2 * q0 (m1 - 1) := by + rw [pow_split (by omega : 0 ≤ (1 : ℤ)) (by omega : 1 ≤ m1), pow2_one] + have hpow_m2 : q0 (k_last.index - k_last.pair.d) = 2 * q0 (k_last.index - k_last.pair.d - 1) := by + rw [pow_split (by omega : 0 ≤ (1 : ℤ)) (by omega : 1 ≤ k_last.index - k_last.pair.d), pow2_one] + refine ⟨by omega, by omega, u1, 2 * v2 + u2, hu1, odd_add_two_mul v2 hu2, ?_⟩ + set Q_next := q0 (k_next.index - 1) * (2 * t_next + 1) + set Q1 := q0 (m1 - 1) * u1 + set Q2 := q0 (k_last.index - k_last.pair.d - 1) * u2 + set V2 := q0 (k_last.index - k_last.pair.d - 1) * v2 + have h1 : 2 * S_cur - U_cur + 3 = 2 * Q_next := by + calc 2 * S_cur - U_cur + 3 = q0 k_next.index * (2 * t_next + 1) := ht_next + _ = 2 * Q_next := by rw [hpow_i]; ring + have h2 : 2 * S_cur - U_cur + 3 = base + 2 * Q1 + 2 * Q2 := by + calc 2 * S_cur - U_cur + 3 = base + q0 m1 * u1 + q0 (k_last.index - k_last.pair.d) * u2 := hH_cur + _ = base + 2 * Q1 + 2 * Q2 := by rw [hpow_m1, hpow_m2]; ring + have h3 : U_cur = k_last.pair.b + 2 * V2 := by + calc U_cur = k_last.pair.b + q0 (k_last.index - k_last.pair.d) * v2 := hU_cur + _ = k_last.pair.b + 2 * V2 := by rw [hpow_m2]; ring + have h4 : 2 * S_next - U_next + 3 = + (2 * gain k_next + k_last.pair.b - k_next.pair.b + base / 2) + Q1 + (2 * V2 + Q2) := by + omega + calc 2 * S_next - U_next + 3 + _ = (2 * gain k_next + k_last.pair.b - k_next.pair.b + base / 2) + Q1 + (2 * V2 + Q2) := h4 + _ = 2 * gain k_next + k_last.pair.b - k_next.pair.b + base / 2 + + q0 (m1 - 1) * u1 + q0 (k_last.index - k_last.pair.d - 1) * (2 * v2 + u2) := by + dsimp -failIfUnchanged [Q1, Q2, V2]; ring + +theorem chain_simple_succ (fuel1 : ℕ) (k1 k2 : kernel) : + chain_simple (fuel1 + 1) k1 k2 = + eval_step_rel fuel1 (2 * gain k2 + k1.pair.b - k2.pair.b) (k1.index - k1.pair.d) k2 := by + unfold chain_simple eval_step_rel + simp only [strictInt_eq] + +theorem eval_step_rel_sound {fuel1 : ℕ} {base m1 : ℤ} {k_last : kernel} + {S_prev U_prev S_cur U_cur : ℤ} {rest : List kernel} + (ih1 : ∀ (k_a k_b : kernel) (S_a U_a S_b U_b S_c U_c : ℤ) (rest_c : List kernel), + k_a ∈ library_val → k_b ∈ library_val → + action k_a S_a U_a S_b U_b → action k_b S_b U_b S_c U_c → + (∀ x ∈ rest_c, x ∈ library_val) → trace rest_c S_c U_c → + fuel1 ≤ rest_c.length → chain_simple fuel1 k_a k_b = true) + (ih2 : ∀ (fuel2 : ℕ), fuel1 = fuel2 + 1 → + ∀ (k_a k_b : kernel) (S_a U_a S_b U_b S_c U_c : ℤ) (rest_c : List kernel), + k_a ∈ library_val → k_b ∈ library_val → + action k_a S_a U_a S_b U_b → action k_b S_b U_b S_c U_c → + (∀ x ∈ rest_c, x ∈ library_val) → trace rest_c S_c U_c → + fuel2 ≤ rest_c.length → chain_simple fuel2 k_a k_b = true) + (hk_last : k_last ∈ library_val) + (hrel : H_rel_full base m1 k_last S_cur U_cur) + (hact_last : action k_last S_prev U_prev S_cur U_cur) + (hall : ∀ x ∈ rest, x ∈ library_val) + (htrace : trace rest S_cur U_cur) + (hlen : fuel1 + 1 ≤ rest.length) : + eval_step_rel fuel1 base m1 k_last = true := by + cases htrace with + | trace_nil => simp at hlen + | @trace_cons k_next rest1 _ _ S_next U_next hstep_next htail1 => + have hk_next : k_next ∈ library_val := hall k_next List.mem_cons_self + have hall1 : ∀ x ∈ rest1, x ∈ library_val := + fun x hx => hall x (List.mem_cons_of_mem _ hx) + have hlen1 : fuel1 ≤ rest1.length := by simp at hlen; omega + rcases step_base_sound hrel.1 hk_next hstep_next with ⟨hsb1, hsb2⟩ + unfold eval_step_rel + simp only [strictInt_eq] + generalize h_sb : step_base base m1 (k_last.index - k_last.pair.d) = sb + rcases sb with ⟨b, opt_k⟩ + have hb : b = true := by rw [← hsb1, h_sb] + subst hb + cases opt_k with + | none => rfl + | some k3 => + rcases hsb2 k3 (by rw [h_sb]) with ⟨hk3_eq, hd1, hp1⟩ + subst k3 + dsimp -failIfUnchanged only + have hcs1 : chain_simple fuel1 k_last k_next = true := + ih1 k_last k_next S_prev U_prev S_cur U_cur S_next U_next rest1 + hk_last hk_next hact_last hstep_next hall1 htail1 hlen1 + rw [hcs1] + simp only [Bool.not_true, Bool.false_eq_true, ↓reduceIte] + cases fuel1 with + | zero => rfl + | succ fuel2 => + dsimp -failIfUnchanged only + split_ifs with hle_idx + · have hle' : k_next.index ≤ min m1 (k_last.index - k_last.pair.d) := by + rw [int_le_iff, int_min_eq] at hle_idx + exact hle_idx + cases htail1 with + | trace_nil => simp at hlen1 + | @trace_cons k_next2 rest2 _ _ S_next2 U_next2 hstep_next2 htail2 => + have hk_next2 : k_next2 ∈ library_val := hall1 k_next2 List.mem_cons_self + have hall2 : ∀ x ∈ rest2, x ∈ library_val := + fun x hx => hall1 x (List.mem_cons_of_mem _ hx) + have hlen2 : fuel2 ≤ rest2.length := by simp at hlen1; omega + have hrel_div := step_rel_div hrel hk_next hd1 hp1 hstep_next hle' + rcases step_base_sound hrel_div hk_next2 hstep_next2 with ⟨hsb_d1, hsb_d2⟩ + generalize h_sbd : step_base (2 * gain k_next + k_last.pair.b - k_next.pair.b + base / 2) + (m1 - 1) (k_last.index - k_last.pair.d - 1) = sbd + rcases sbd with ⟨bd, opt_kd⟩ + have hbd : bd = true := by rw [← hsb_d1, h_sbd] + subst hbd + cases opt_kd with + | none => rfl + | some k4 => + rcases hsb_d2 k4 (by rw [h_sbd]) with ⟨hk4_eq, _, _⟩ + subst k4 + dsimp -failIfUnchanged only + exact ih2 fuel2 rfl k_next k_next2 S_cur U_cur S_next U_next S_next2 U_next2 rest2 + hk_next hk_next2 hstep_next hstep_next2 hall2 htail2 hlen2 + · rfl + +theorem chain_simple_sound (fuel : ℕ) : + ∀ (k1 k2 : kernel) (S0 U0 S1 U1 S2 U2 : ℤ) (rest : List kernel), + k1 ∈ library_val → k2 ∈ library_val → + action k1 S0 U0 S1 U1 → action k2 S1 U1 S2 U2 → + (∀ x ∈ rest, x ∈ library_val) → trace rest S2 U2 → + fuel ≤ rest.length → chain_simple fuel k1 k2 = true := by + induction fuel using Nat.strong_induction_on with + | h fuel ih => + intro k1 k2 S0 U0 S1 U1 S2 U2 rest hk1 hk2 hact1 hact2 hall htrace hlen + cases fuel with + | zero => rfl + | succ fuel1 => + rw [chain_simple_succ] + have hrel := two_step_rel hk1 hk2 hact1 hact2 + exact eval_step_rel_sound + (ih fuel1 (by omega)) + (fun fuel2 h_eq => ih fuel2 (by omega)) + hk2 hrel hact2 hall htrace hlen + +def prev_ok (kp2 : Option kernel) (kp : kernel) (S U : ℤ) : Prop := + kp ∈ library_val ∧ + ∃ S_prev U_prev : ℤ, action kp S_prev U_prev S U ∧ + match kp2 with + | none => True + | some k0 => k0 ∈ library_val ∧ ∃ S_prev2 U_prev2 : ℤ, action k0 S_prev2 U_prev2 S_prev U_prev + +theorem check_4k_simple_sound (fuel : ℕ) (kp2 : Option kernel) (kp k : kernel) + (S U S' U' : ℤ) (rest : List kernel) + (hp_ok : prev_ok kp2 kp S U) + (hk : k ∈ library_val) + (hact_k : action k S U S' U') + (hall : ∀ x ∈ rest, x ∈ library_val) + (htrace : trace rest S' U') + (hlen : fuel ≤ rest.length) : + check_4k_simple fuel kp2 kp k = true := by + rcases hp_ok with ⟨hkp, S_prev, U_prev, hact_kp, hkp2⟩ + have hcs : chain_simple fuel kp k = true := + chain_simple_sound fuel kp k S_prev U_prev S U S' U' rest hkp hk hact_kp hact_k hall htrace hlen + unfold check_4k_simple + dsimp -failIfUnchanged only + cases kp2 with + | none => + simp only [Bool.not_true, Bool.false_eq_true, ↓reduceIte, hcs] + | some k0 => + cases fuel with + | zero => + simp only [Bool.not_true, Bool.false_eq_true, ↓reduceIte, hcs] + | succ fuel1 => + dsimp -failIfUnchanged only + cases hd1_b : int_eq kp.pair.d 1 + · simp only [Bool.not_false, ↓reduceIte, Bool.not_true, Bool.false_eq_true, hcs] + · have hd1 : kp.pair.d = 1 := (int_eq_iff _ _).mp hd1_b + rcases hkp2 with ⟨hk0, S_prev2, U_prev2, hact_k0⟩ + have hrel := three_step_4k_rel hk0 hkp hk hd1 hact_k0 hact_kp hact_k + have heval : eval_step_rel fuel1 (2 * gain k - k.pair.b - k0.pair.b - 4) + (k0.index - k0.pair.d) k = true := + eval_step_rel_sound + (chain_simple_sound fuel1) + (fun fuel2 _ => chain_simple_sound fuel2) + hk hrel hact_k hall htrace hlen + simp only [Bool.not_true, Bool.false_eq_true, ↓reduceIte, strictInt_eq, heval, hcs] + +theorem kernel_term_mod32 {k0 : kernel} {u : ℤ} + (hk0 : k0 ∈ library_val) (hu : qW u) : + ∃ c : ℤ, q0 (k0.index - k0.pair.d) * u = + 32 * c + (if int_eq k0.index 5 then 16 else 0) := by + rcases hu with ⟨a, rfl⟩ + have hkp0 := lib_kernel_props hk0 + have hm_ge4 : 4 ≤ k0.index - k0.pair.d := hkp0.2.2.1 + have hm_iff : k0.index - k0.pair.d = 4 ↔ k0.index = 5 := hkp0.2.2.2.1 + by_cases h5 : k0.index = 5 + · have hm4 : k0.index - k0.pair.d = 4 := hm_iff.mpr h5 + have h5' : int_eq k0.index 5 = true := (int_eq_iff _ _).mpr h5 + have hq0_4 : q0 4 = 16 := by decide + rw [hm4, h5', if_pos rfl, hq0_4] + exact ⟨a, by ring⟩ + · have hm5 : 5 ≤ k0.index - k0.pair.d := by omega + have h5' : ¬ int_eq k0.index 5 = true := fun h => h5 ((int_eq_iff _ _).mp h) + have hsplit : q0 (k0.index - k0.pair.d) = 32 * q0 (k0.index - k0.pair.d - 5) := by + rw [pow_split (by omega : 0 ≤ (5 : ℤ)) hm5] + have hq0_5 : q0 5 = 32 := by decide + rw [hq0_5] + rw [if_neg h5', hsplit] + exact ⟨q0 (k0.index - k0.pair.d - 5) * (2 * a + 1), by ring⟩ + +theorem two_step_bkt {kp k k_next : kernel} {S_prev U_prev S U S' U' S'' U'' : ℤ} + (hkp : kp ∈ library_val) (hk : k ∈ library_val) (hk_next : k_next ∈ library_val) + (hact_kp : action kp S_prev U_prev S U) + (hact_k : action k S U S' U') + (hact_next : action k_next S' U' S'' U'') : + k ∈ get_bkt (k_req kp) := by + rcases (two_step_rel hkp hk hact_kp hact_k).1 with ⟨_, _, u1, u2, hu1, hu2, hH⟩ + rcases hact_next with ⟨_, _, t, ht⟩ + rcases kernel_term_mod32 hkp hu1 with ⟨c1, hc1⟩ + rcases kernel_term_mod32 hk hu2 with ⟨c2, hc2⟩ + have hi_ge5 : 5 ≤ k_next.index := (lib_kernel_props hk_next).1 + have hsplit_next : q0 k_next.index = 32 * q0 (k_next.index - 5) := by + rw [pow_split (by omega : 0 ≤ (5 : ℤ)) hi_ge5] + have hq0_5 : q0 5 = 32 := by decide + rw [hq0_5] + have ht_32 : 2 * S' - U' + 3 = 32 * (q0 (k_next.index - 5) * (2 * t + 1)) := by + rw [ht, hsplit_next]; ring + have htag_eq : k_tag k = k_req kp := by + unfold k_tag k_req + omega + rw [← htag_eq] + exact (lib_kernel_props hk).2.2.2.2.2.2.2.2.2 + +def eq_kernel (k1 k2 : kernel) : Bool := + int_eq k1.index k2.index && + int_eq k1.pair.p k2.pair.p && + int_eq k1.pair.d k2.pair.d && + int_eq k1.pair.b k2.pair.b && + int_eq k1.pair.c k2.pair.c + +theorem eq_kernel_iff (k1 k2 : kernel) : eq_kernel k1 k2 = true ↔ k1 = k2 := by + rcases k1 with ⟨i1, p1, d1, b1, c1⟩ + rcases k2 with ⟨i2, p2, d2, b2, c2⟩ + simp only [eq_kernel, Bool.and_eq_true, int_eq_iff, kernel.mk.injEq, Table.pair.mk.injEq] + tauto + +def mem_kernel (k : kernel) : List kernel → Bool + | [] => false + | x :: xs => if eq_kernel k x then true else mem_kernel k xs + +theorem mem_kernel_iff (k : kernel) (xs : List kernel) : + mem_kernel k xs = true ↔ k ∈ xs := by + induction xs with + | nil => simp [mem_kernel] + | cons x xs ih => + unfold mem_kernel + by_cases h : k = x + · subst h + have heq : eq_kernel k k = true := (eq_kernel_iff k k).mpr rfl + rw [heq, if_pos rfl] + simp + · have heq : eq_kernel k x = false := by + rw [Bool.eq_false_iff, ne_eq, eq_kernel_iff]; exact h + rw [heq, if_neg Bool.false_ne_true, ih] + simp [h] + +def cs2_small (k k3 : kernel) : Bool := + if int_eq k3.index 5 then int_eq (k_tag k) 9 + else if int_eq k3.index 8 then mem_kernel k cands_8 + else false + +def bool_beq (a b : Bool) : Bool := + match a, b with + | true, true => true + | false, false => true + | _, _ => false + +def check_cs2_small (k : kernel) : Bool := + bool_beq (chain_simple 2 k ⟨5, ⟨1, 1, 7, 0⟩⟩) (cs2_small k ⟨5, ⟨1, 1, 7, 0⟩⟩) && + bool_beq (chain_simple 2 k ⟨8, ⟨1, 1, 13, 0⟩⟩) (cs2_small k ⟨8, ⟨1, 1, 13, 0⟩⟩) && + bool_beq (chain_simple 2 k ⟨12, ⟨1, 1, 25, 0⟩⟩) (cs2_small k ⟨12, ⟨1, 1, 25, 0⟩⟩) && + bool_beq (chain_simple 2 k ⟨14, ⟨1, 1, 31, 0⟩⟩) (cs2_small k ⟨14, ⟨1, 1, 31, 0⟩⟩) + +theorem check_cs2_small_all : qJ check_cs2_small library_val = true := by decide +kernel + +theorem bool_beq_eq {a b : Bool} (h : bool_beq a b = true) : a = b := by + cases a <;> cases b <;> first | rfl | contradiction + +theorem cs2_small_eq {k k3 : kernel} {v : ℤ} (hk : k ∈ library_val) + (hss : single_small v = some k3) : + chain_simple 2 k k3 = cs2_small k k3 := by + have h := qbf check_cs2_small library_val check_cs2_small_all k hk + unfold check_cs2_small at h + simp only [Bool.and_eq_true] at h + unfold single_small at hss + split_ifs at hss with h5 h8 h12 h14 + · injection hss with hss; subst hss; exact bool_beq_eq h.1.1.1 + · injection hss with hss; subst hss; exact bool_beq_eq h.1.1.2 + · injection hss with hss; subst hss; exact bool_beq_eq h.1.2 + · injection hss with hss; subst hss; exact bool_beq_eq h.2 + +theorem step_base_some_small {base m1 m2 : ℤ} {k3 : kernel} + (h : (step_base base m1 m2).2 = some k3) : + ∃ v, single_small v = some k3 := by + unfold step_base at h + simp only [strictInt_eq] at h + generalize hv : qq16 (int_min 15 (int_min m1 m2 + 1)) + (base + if int_eq m1 m2 = true then 0 else if int_le (int_min m1 m2) 14 = true then q0 (int_min m1 m2) else 0) = v at h + generalize hadj : (if int_eq m1 m2 = true then 0 else if int_le (int_min m1 m2) 14 = true then q0 (int_min m1 m2) else 0) = adj at h + split_ifs at h with h1 h2 h3 + cases hss : single_small v with + | none => rw [hss] at h; contradiction + | some k3' => + rw [hss] at h + injection h with h; subst h + exact ⟨v, hss⟩ + +def chain_simple_3_fast (kp k : kernel) : Bool := + q2 (kp.index - kp.pair.d) fun m1 => + q2 (k.index - k.pair.d) fun m2 => + q2 (2 * gain k + kp.pair.b - k.pair.b) fun base => + match step_base base m1 m2 with + | (false, _) => false + | (true, none) => true + | (true, some k3) => + if !(cs2_small k k3) then false + else + if int_le k3.index (int_min m1 m2) then + q2 (2 * gain k3 + k.pair.b - k3.pair.b + base / 2) fun base_div => + match step_base base_div (m1 - 1) (m2 - 1) with + | (false, _) => false + | (true, none) => true + | (true, some k4) => chain_simple 1 k3 k4 + else true + +theorem chain_simple_3_fast_eq (kp : kernel) {k : kernel} (hk : k ∈ library_val) : + chain_simple_3_fast kp k = chain_simple 3 kp k := by + unfold chain_simple_3_fast + conv_rhs => unfold chain_simple + simp only [strictInt_eq] + generalize hsb : step_base (2 * gain k + kp.pair.b - k.pair.b) + (kp.index - kp.pair.d) (k.index - k.pair.d) = sb + rcases sb with ⟨b, opt_k3⟩ + cases b with + | false => rfl + | true => + cases opt_k3 with + | none => rfl + | some k3 => + have h2 : (step_base (2 * gain k + kp.pair.b - k.pair.b) + (kp.index - kp.pair.d) (k.index - k.pair.d)).2 = some k3 := by + rw [hsb] + rcases step_base_some_small h2 with ⟨v, hss⟩ + dsimp -failIfUnchanged only + rw [cs2_small_eq hk hss] + +def check_cands_3 (kp : kernel) : Bool := + let cands := get_cands_3 kp + qJ (fun k => if mem_kernel k cands then true else !(chain_simple_3_fast kp k)) + (get_bkt (k_req kp)) + +theorem cands_3_0 : qJ check_cands_3 lib_0 = true := by decide +kernel +theorem cands_3_1 : qJ check_cands_3 lib_1 = true := by decide +kernel +theorem cands_3_2 : qJ check_cands_3 lib_2 = true := by decide +kernel +theorem cands_3_3 : qJ check_cands_3 lib_3 = true := by decide +kernel +theorem cands_3_4 : qJ check_cands_3 lib_4 = true := by decide +kernel +theorem cands_3_5 : qJ check_cands_3 lib_5 = true := by decide +kernel +theorem cands_3_6 : qJ check_cands_3 lib_6 = true := by decide +kernel +theorem cands_3_7 : qJ check_cands_3 lib_7 = true := by decide +kernel +theorem cands_3_8 : qJ check_cands_3 lib_8 = true := by decide +kernel +theorem cands_3_9 : qJ check_cands_3 lib_9 = true := by decide +kernel +theorem cands_3_10 : qJ check_cands_3 lib_10 = true := by decide +kernel +theorem cands_3_11 : qJ check_cands_3 lib_11 = true := by decide +kernel +theorem cands_3_12 : qJ check_cands_3 lib_12 = true := by decide +kernel +theorem cands_3_13 : qJ check_cands_3 lib_13 = true := by decide +kernel +theorem cands_3_14 : qJ check_cands_3 lib_14 = true := by decide +kernel +theorem cands_3_15 : qJ check_cands_3 lib_15 = true := by decide +kernel + +theorem cands_3_sub_bkt : qJ check_cands_3 library_val = true := by + unfold library_val + simp only [qbr, cands_3_0, cands_3_1, cands_3_2, cands_3_3, cands_3_4, cands_3_5, + cands_3_6, cands_3_7, cands_3_8, cands_3_9, cands_3_10, cands_3_11, + cands_3_12, cands_3_13, cands_3_14, cands_3_15, Bool.and_self] + +theorem get_cands_sound (fuel : ℕ) (kp k : kernel) + (S_prev U_prev S U S' U' : ℤ) (rest : List kernel) + (hkp : kp ∈ library_val) (hk : k ∈ library_val) + (hact_kp : action kp S_prev U_prev S U) + (hact_k : action k S U S' U') + (hall : ∀ x ∈ rest, x ∈ library_val) + (htrace : trace rest S' U') + (hlen : fuel ≤ rest.length) : + k ∈ get_cands fuel kp := by + unfold get_cands + cases fuel with + | zero => exact hk + | succ fuel1 => + have hbkt : k ∈ get_bkt (k_req kp) := by + cases htrace with + | trace_nil => simp at hlen + | @trace_cons k_next rest1 _ _ S'' U'' hstep_next _ => + have hk_next : k_next ∈ library_val := hall k_next List.mem_cons_self + exact two_step_bkt hkp hk hk_next hact_kp hact_k hstep_next + cases hble : Nat.ble 3 (fuel1 + 1) + · exact hbkt + · have hge3 : 3 ≤ fuel1 + 1 := Nat.le_of_ble_eq_true hble + have hcs3 : chain_simple 3 kp k = true := + chain_simple_sound 3 kp k S_prev U_prev S U S' U' rest hkp hk hact_kp hact_k hall htrace (by omega) + have h3 := qbf check_cands_3 library_val cands_3_sub_bkt kp hkp + unfold check_cands_3 at h3 + have h4 := qbf _ (get_bkt (k_req kp)) h3 k hbkt + try dsimp -failIfUnchanged only at h4 + by_cases hmem : k ∈ get_cands_3 kp + · exact hmem + · have hmem_f : mem_kernel k (get_cands_3 kp) = false := by + rw [Bool.eq_false_iff, ne_eq, mem_kernel_iff]; exact hmem + rw [hmem_f, if_neg Bool.false_ne_true, chain_simple_3_fast_eq kp hk, hcs3] at h4 + contradiction + +theorem qJ_cands_sound (fuel : ℕ) (min_idx : ℤ) (kp2 : Option kernel) (kp : kernel) + (step : kernel → Bool) (ks : List kernel) + (h : qJ_cands fuel min_idx kp2 kp step ks = true) : + ∀ k ∈ ks, min_idx ≤ k.index → check_4k_simple fuel kp2 kp k = true → step k = true := by + induction ks with + | nil => intro k hk; contradiction + | cons a ks ih => + intro k hk hle hchk + unfold qJ_cands at h + rcases List.mem_cons.mp hk with rfl | hk' + · have hle' : int_le min_idx k.index = true := (int_le_iff _ _).mpr hle + rw [hle', hchk] at h + simp only [↓reduceIte] at h + split_ifs at h with hstep + exact hstep + · split_ifs at h <;> exact ih h k hk' hle hchk + +theorem refute_spec_c (fuel : ℕ) (z : state) (kp2 : Option kernel) (kp : kernel) + (S0 U0 S U : ℤ) + (hz : qE z S0 U0 S U) + (hp_ok : prev_ok kp2 kp S U) + (hcheck : qbN_c fuel z kp2 kp = true) : + ∀ word, (∀ k ∈ word, continuing k ∧ k.index ≤ 2048) → + trace word S U → word.length < fuel := by + induction fuel generalizing z kp2 kp S U with + | zero => contradiction + | succ fuel ih => + intro word hall htrace + cases htrace with + | trace_nil => simp + | @trace_cons k rest _ _ S' U' hstep htail => + by_contra hnot + have hlen : fuel ≤ rest.length := by simp only [List.length_cons] at hnot; omega + rcases hall k List.mem_cons_self with ⟨hk_cont, hmax⟩ + have hk_lib : k ∈ library_val := qx k hk_cont hmax + have hrest_all : ∀ x ∈ rest, continuing x ∧ x.index ≤ 2048 := + fun x hx => hall x (List.mem_cons_of_mem k hx) + have hrest_lib : ∀ x ∈ rest, x ∈ library_val := + fun x hx => qx x (hrest_all x hx).1 (hrest_all x hx).2 + have hchk : check_4k_simple fuel kp2 kp k = true := + check_4k_simple_sound fuel kp2 kp k S U S' U' rest hp_ok hk_lib hstep hrest_lib htail hlen + rcases hp_ok with ⟨hkp_lib, S_prev, U_prev, hact_kp, hkp2_rest⟩ + have hcands : k ∈ get_cands fuel kp := + get_cands_sound fuel kp k S_prev U_prev S U S' U' rest hkp_lib hk_lib hact_kp hstep hrest_lib htail hlen + have hi_ge0 : 0 ≤ k.index := by + have := (lib_kernel_props hk_lib).1 + omega + have hnext : qB (fun z' => qbN_c fuel z' (some kp) k) z k = true := by + unfold qbN_c at hcheck + simp only [strictInt_eq] at hcheck + cases hr : z.rel with + | none => + rw [hr] at hcheck + exact qJ_cands_sound fuel 0 kp2 kp _ (get_cands fuel kp) hcheck k hcands hi_ge0 hchk + | some r => + rw [hr] at hcheck + dsimp -failIfUnchanged only at hcheck + have hin : k ∈ qbj z := choices_spec z k S0 U0 S U S' U' hz hk_cont hmax hstep + unfold qbj at hin + simp only [strictInt_eq, hr] at hin + try dsimp -failIfUnchanged only at hin + cases hvb : int_lt (qq (qa2 r (A z) z.Q) (qa6 r (A z) (B z) z.Q)) (qa2 r (A z) z.Q) + · rw [hvb] at hcheck + simp only [Bool.false_eq_true, ↓reduceIte] at hcheck + have hvb' : ¬ (decide (qq (qa2 r (A z) z.Q) (qa6 r (A z) (B z) z.Q) < qa2 r (A z) z.Q) = true) := by + rw [decide_eq_true_iff, ← int_lt_iff, hvb] + decide + rw [if_neg hvb'] at hin + rcases List.mem_filter.mp hin with ⟨_, hmin⟩ + rw [decide_eq_true_iff] at hmin + exact qJ_cands_sound fuel (qa2 r (A z) z.Q - z.D) kp2 kp _ (get_cands fuel kp) hcheck k hcands hmin hchk + · rw [hvb, if_pos rfl] at hcheck + have hvb' : decide (qq (qa2 r (A z) z.Q) (qa6 r (A z) (B z) z.Q) < qa2 r (A z) z.Q) = true := by + rw [decide_eq_true_iff] + exact (int_lt_iff _ _).mp hvb + rw [if_pos hvb'] at hin + exact qJ_cands_sound fuel 0 kp2 kp _ _ hcheck k hin hi_ge0 hchk + rcases advance_spec z k S0 U0 S U S' U' hz hk_cont hstep with ⟨z', hadvance, hz'⟩ + unfold qB at hnext + rw [hadvance] at hnext + have hp_ok' : prev_ok (some kp) k S' U' := + ⟨hk_lib, S, U, hstep, hkp_lib, S_prev, U_prev, hact_kp⟩ + have ih_res := ih z' (some kp) k S' U' hz' hp_ok' hnext rest hrest_all htail + omega + +def q9_c (k : kernel) : Bool := + qB (fun z' => qbN_c 6 z' none k) qaG k +theorem ref_0a : qJ q9_c lib_0a=true:= by decide +kernel +theorem ref_0b : qJ q9_c lib_0b=true:= by decide +kernel +theorem ref_0c : qJ q9_c lib_0c=true:= by decide +kernel +theorem ref_0 : qJ q9_c lib_0=true:= by + unfold lib_0 + simp only [qbr,ref_0a,ref_0b,ref_0c,Bool.and_self] +theorem ref_1 : qJ q9_c lib_1=true:= by decide +kernel +theorem ref_2 : qJ q9_c lib_2=true:= by decide +kernel +theorem ref_3 : qJ q9_c lib_3=true:= by decide +kernel +theorem ref_4 : qJ q9_c lib_4=true:= by decide +kernel +theorem ref_5 : qJ q9_c lib_5=true:= by decide +kernel +theorem ref_6 : qJ q9_c lib_6=true:= by decide +kernel +theorem ref_7 : qJ q9_c lib_7=true:= by decide +kernel +theorem ref_8 : qJ q9_c lib_8=true:= by decide +kernel +theorem ref_9 : qJ q9_c lib_9=true:= by decide +kernel +theorem ref_10 : qJ q9_c lib_10=true:= by decide +kernel +theorem ref_11 : qJ q9_c lib_11=true:= by decide +kernel +theorem ref_12 : qJ q9_c lib_12=true:= by decide +kernel +theorem ref_13 : qJ q9_c lib_13=true:= by decide +kernel +theorem ref_14 : qJ q9_c lib_14=true:= by decide +kernel +theorem ref_15 : qJ q9_c lib_15=true:= by decide +kernel +theorem qbA : qJ q9_c library_val=true:= by + unfold library_val + simp only [qbr,ref_0,ref_1,ref_2,ref_3,ref_4,ref_5,ref_6,ref_7, + ref_8,ref_9,ref_10,ref_11,ref_12,ref_13,ref_14,ref_15,Bool.and_self] +theorem F2 (word : List kernel) (S U : ℤ) + (hall : ∀ k ∈ word,continuing k ∧ k.index ≤ 2048) + (htrace : trace word S U) : + word.length ≤ 6:= by + cases htrace with + | trace_nil => simp + | @trace_cons k rest _ _ S' U' hstep htail => + rcases hall k List.mem_cons_self with ⟨hk_cont, hmax⟩ + have hk_lib : k ∈ library_val := qx k hk_cont hmax + have hrest_all : ∀ x ∈ rest, continuing x ∧ x.index ≤ 2048 := + fun x hx => hall x (List.mem_cons_of_mem k hx) + have hq9 : q9_c k = true := qbf q9_c library_val qbA k hk_lib + rcases advance_spec qaG k S U S U S' U' (initial_spec S U) hk_cont hstep with ⟨z', hadvance, hz'⟩ + unfold q9_c qB at hq9 + rw [hadvance] at hq9 + have hp_ok : prev_ok none k S' U' := ⟨hk_lib, S, U, hstep, trivial⟩ + have hlen := refute_spec_c 6 z' none k S U S' U' hz' hp_ok hq9 rest hrest_all htail + simp only [List.length_cons] + omega +theorem finite_bounds : + qJ (fun k => decide (k.pair.d ≤ 5) && decide (gain k ≤ 5472)) library_val=true:= by decide +kernel +theorem kernel_bounds (k : WordLibrary.kernel) (hk : WordLibrary.continuing k) (hmax : k.index ≤ 2048) : + k.pair.d ≤ 5 ∧ WordLibrary.gain k ≤ 5472:= by + have hmem : k ∈ library_val:=qx k hk hmax + have h:=qbf _ library_val finite_bounds k hmem + rcases Bool.and_eq_true_iff.mp h with ⟨hd,hg⟩ + exact ⟨of_decide_eq_true hd,of_decide_eq_true hg⟩ +end WordCheck +namespace WordLink +open Table WordLibrary +theorem continuing_good (k : WordLibrary.kernel) (hk : WordLibrary.continuing k) : + Block.good (Bridge.kernel k.pair):= by + rcases hk with ⟨e,hb,hs,he⟩ + rcases (built_valid hb).1 with ⟨_,_,hx,_⟩ + exact Bridge.kernel_good hx +theorem continuing_gain (k : WordLibrary.kernel) (hk : WordLibrary.continuing k) : + k.index < WordLibrary.gain k:= by + rcases hk with ⟨e,hb,_⟩ + exact Bridge.kernel_gain (built_valid hb) +theorem action_block {k : WordLibrary.kernel} {S U S' U' : ℤ} + (h : WordLibrary.action k S U S' U') : + Block.call (Bridge.kernel k.pair) S (2 * S - U + 3) S' (2 * S' - U' + 3):= by + rcases h with ⟨hS,hU,_⟩ + unfold Block.call Bridge.kernel gain at * + try dsimp -failIfUnchanged only at * + refine ⟨hS,?_⟩ + rw [hS] + linarith +theorem trace_suffix (pref suf : List WordLibrary.kernel) (S U : ℤ) + (h : WordLibrary.trace (pref ++ suf) S U) : + ∃ S' U',WordLibrary.trace suf S' U':= by + induction pref generalizing S U with + | nil => exact ⟨S,U,h⟩ + | cons k pref ih => + cases h with + | trace_cons _ htail => exact ih _ _ htail +def bound (L r : ℤ) : Prop := + ∀ word S U,(∀ k ∈ word,WordLibrary.continuing k ∧ k.index ≤ L) → + WordLibrary.trace word S U → (word.length : ℤ) ≤ r +theorem bound_mono (L L' r r' : ℤ) (hL : L' ≤ L) (hr : r ≤ r') (hb : bound L r) : bound L' r':= by + intro word S U hall htrace + have hall' : ∀ k ∈ word,WordLibrary.continuing k ∧ k.index ≤ L:= by + intro k hk + rcases hall k hk with ⟨hc,hi⟩ + exact ⟨hc,by omega⟩ + have h1:=hb word S U hall' htrace + omega +theorem base_bound : bound 2048 6:= by + intro word S U hall htrace + have h:=WordCheck.F2 word S U hall htrace + omega +end WordLink +namespace Phase +open Table +def qct (s r gap : ℤ) (x : pair) (K : ℤ) (y : pair) : Prop := + y.b=left s r x ∧ y.c=right s r x ∧ K - y.d=s - x.d + gap +theorem qaT (s r gap : ℤ) (x : pair) (K : ℤ) (y : pair) + (hx : qaB s x) (hr : qW r) (hg : 1 ≤ gap) (hc : qct s r gap x K y) : + q3 K y=q3 s x:= by + rcases hc with ⟨hb,hcy,hd⟩ + rcases hx with ⟨hdx0,hdxs,hpx0,hpxd,hpodd,hbx,hcx⟩ + have hlt : y.d < K:= by omega + unfold q3 qk + rw [if_pos hlt,hb] + exact Bridge.head_value ⟨hdx0,hdxs,hpx0,hpxd,hpodd,hbx,hcx⟩ hr +theorem qay (s r gap : ℤ) (x : pair) (K : ℤ) (y : pair) (t u : ℤ) + (hx : qaB s x) (hr : 1 ≤ r) (ho : qW r) (hg : 1 ≤ gap) + (hc : qct s r gap x K y) (hsep : qa s x t u) : + qa K y t (qg s r x t u):= by + rcases hc with ⟨hb,hcy,hd⟩ + rcases qz hx hr ho hsep with ⟨hQ,hQo,hH⟩ + rcases hsep with ⟨ht1,hts,_,_⟩ + refine ⟨ht1,by omega,?_,hQo⟩ + unfold h + rw [hb,hcy] + exact hH +theorem copies_next (s r gap : ℤ) (x : pair) (K : ℤ) (y : pair) (t u : ℤ) (z : pair) + (hx : qaB s x) (hc : qct s r gap x K y) + (hsep : qa s x t u) (hz : qo t z) : + qct s r gap (qQ x t u z) (K + 1) (qbu (qQ y t (qg s r x t u) z)):= by + rcases hc with ⟨hb,hcy,hd⟩ + have hL:=qaF r hx hsep hz + have hB : (qbu (qQ y t (qg s r x t u) z)).b=left s r (qQ x t u z):= by + rw [← hL] + rfl + have hm:=qI x t u z + have hn:=qI y t (qg s r x t u) z + have hs:=qu s r x + have ht:=qu s r (qQ x t u z) + refine ⟨hB,?_,?_⟩ + · change (qQ y t (qg s r x t u) z).c=right s r (qQ x t u z) + change (qQ y t (qg s r x t u) z).b=left s r (qQ x t u z) at hB + linarith + · change K + 1 - (y.d + z.d + 1)=s - (x.d + z.d) + gap + omega +def span (K : ℤ) (n : ℕ) (D : ℤ) : Prop := + ∀ i,0 ≤ i ∧ i ≤ (n : ℤ) → ∃ f,Built (K + i) f ∧ CheckTable.depth f ≤ D +theorem span_one (K : ℤ) (y : pair) (e v f D : ℤ) + (h0 : Built K (.Two y e)) (h1 : Built (K + 1) (.One v f)) + (hD : y.d ≤ D) (hD0 : 0 ≤ D) : + span K 1 D:= by + intro i hi + have hi' : i=0 ∨ i=1:= by omega + rcases hi' with rfl | rfl + · refine ⟨.Two y e,?_,hD⟩ + simpa using! h0 + · exact ⟨.One v f,h1,hD0⟩ +theorem qa0 (K : ℤ) (f : entry) (n : ℕ) (D : ℤ) + (h0 : Built K f) (hD : CheckTable.depth f ≤ D) (htail : span (K + 1) n D) : + span K (1 + n) D:= by + intro i hi + by_cases hiz : i=0 + · subst hiz + refine ⟨f,?_,hD⟩ + simpa using! h0 + · rcases htail (i - 1) (by omega) with ⟨g,hg,hdepth⟩ + refine ⟨g,?_,hdepth⟩ + have heq : K + i=K + 1 + (i - 1):= by omega + rwa [heq] +theorem boundary_copy (s : ℤ) (x : pair) (f : ℤ) (n : ℕ) + (hb : Boundary Built s x f n) (hx : qaB s x) : + ∀ r gap K y e,1 ≤ r → qW r → 1 ≤ gap → + qct s r gap x K y → Built K (.Two y e) → + Built (K + (n : ℤ)) (.One (y.b + y.c + 3 * f) (e + f)) ∧ + span K n (K - s - gap + s + (n : ℤ) - 1):= by + induction hb with + | boundary_even x he => + intro r gap K y e hr hro hg hcopy hlarge + have hy : qaB K y:=(built_valid hlarge).1.2.2.1.1 + have hp:=qaT s r gap x K y hx hro hg hcopy + have hB : Built (K + 1) (.One (y.b + y.c + 3) (e + 1)) := + Built.built_even hlarge (by rw [hp,he]) + refine ⟨?_,?_⟩ + · simpa using! hB + · apply span_one K y e (y.b + y.c + 3) (e + 1) _ hlarge hB + · rcases hcopy with ⟨_,_,hD⟩; rcases hx with ⟨hdx0,_⟩; omega + · rcases hcopy with ⟨_,_,hD⟩; rcases hx with ⟨hdx0,_⟩; rcases hy with ⟨hdy0,_⟩; omega + | boundary_one x t u v f hsep ho hsmall => + intro r gap K y e hr hro hg hcopy hlarge + have hy : qaB K y:=(built_valid hlarge).1.2.2.1.1 + have hp:=qaT s r gap x K y hx hro hg hcopy + have hs:=qay s r gap x K y t u hx hr hro hg hcopy hsep + have hB:=Built.built_lookup_one hlarge hs (by rw [hp,ho]) hsmall + have hv : v=1 + 3 * f:=(built_valid hsmall).1.2.2 + have hB' : Built (K + 1) (.One (y.b + y.c + 3 * (1 + f)) (e + (1 + f))):= by + have h1 : y.b + y.c + 3 * (1 + f)=y.b + y.c + v + 2:= by omega + have h2 : e + (1 + f)=e + 1 + f:= by omega + rwa [h1,h2] + refine ⟨?_,?_⟩ + · simpa using! hB' + · apply span_one K y e (y.b + y.c + 3 * (1 + f)) (e + (1 + f)) _ hlarge hB' + · rcases hcopy with ⟨_,_,hD⟩; rcases hx with ⟨hdx0,_⟩; omega + · rcases hcopy with ⟨_,_,hD⟩; rcases hx with ⟨hdx0,_⟩; rcases hy with ⟨hdy0,_⟩; omega + | boundary_two x t u z f g n hsep ho hsmall htail ih => + intro r gap K y e hr hro hg hcopy hlarge + have hy : qaB K y:=(built_valid hlarge).1.2.2.1.1 + rcases (built_valid hsmall).1 with ⟨ht0,hf,hz,hmass⟩ + have hp:=qaT s r gap x K y hx hro hg hcopy + have hs:=qay s r gap x K y t u hx hr hro hg hcopy hsep + have hB:=Built.built_lookup_two hlarge hs (by rw [hp,ho]) hsmall + have hC:=copies_next s r gap x K y t u z hx hcopy hsep hz + rcases ih (qan hx hsep hz).1 r gap (K + 1) + (qbu (qQ y t (qg s r x t u) z)) (e + 1 + f) hr hro hg hC hB with ⟨hend,hspan⟩ + refine ⟨?_,?_⟩ + · have hk_eq : K + ((1 + n : ℕ) : ℤ)=K + 1 + (n : ℤ):= by push_cast; omega + rw [hk_eq] + change Built (K + 1 + (n : ℤ)) + (.One ((qQ y t (qg s r x t u) z).b + (qQ y t (qg s r x t u) z).c + 3 * g) + (e + 1 + f + g)) at hend + rw [qI] at hend + have h1 : y.b + y.c + 3 * (1 + f + g)=y.b + y.c + z.b + z.c + 2 + 3 * g:= by omega + have h2 : e + (1 + f + g)=e + 1 + f + g:= by omega + rwa [h1,h2] + · apply qa0 K (.Two y e) n _ hlarge + · change y.d ≤ K - s - gap + s + ((1 + n : ℕ) : ℤ) - 1 + rcases hcopy with ⟨_,_,hD⟩ + rcases hx with ⟨hdx0,_⟩ + omega + · have h_eq : K - s - gap + s + ((1 + n : ℕ) : ℤ) - 1 = + K + 1 - s - gap + s + (n : ℤ) - 1:= by omega + rwa [h_eq] +theorem qbI (K : ℤ) (n : ℕ) (D D' : ℤ) (hD : D ≤ D') (hspan : span K n D) : + span K n D':= by + intro i hi + rcases hspan i hi with ⟨f,hf,hd⟩ + exact ⟨f,hf,by omega⟩ +theorem span_zero (K : ℤ) (f : entry) (D : ℤ) (hf : Built K f) (hd : CheckTable.depth f ≤ D) : + span K 0 D:= by + intro i hi + have hi0 : i=0:= by omega + subst hi0 + refine ⟨f,?_,hd⟩ + simpa using! hf +theorem qbp (l B : ℤ) (hl : 1 ≤ l) : + q3 (l + 1) ⟨1,1,B,0⟩=qb6 B:= by + unfold q3 qk + dsimp -failIfUnchanged + rw [if_pos (by omega)] +theorem qbc (l B s r : ℤ) (hs : 1 ≤ s ∧ s < l) + (hB : B + 3=q0 s * r) (hr : qW r) : + qa (l + 1) ⟨1,1,B,0⟩ s r:= by + refine ⟨hs.1,by dsimp -failIfUnchanged; omega,?_,hr⟩ + unfold h + dsimp -failIfUnchanged + linarith +theorem qcf (l B s r : ℤ) (x : pair) (hB : B + 3=q0 s * r) : + qct s r (l - s) (qba x) (l + 2) (qbu (qQ ⟨1,1,B,0⟩ s r x)):= by + refine ⟨rfl,?_,?_⟩ + · change B + 2 * 0 + 3 - (x.p * q0 (s - x.d) * r) + x.c - 0 - 1 = + (q0 s - x.p * q0 (s - x.d)) * r + (x.c - 1) + nlinarith + · change l + 2 - (1 + x.d + 1)=s - x.d + (l - s) + omega +theorem odd_factor (B s r : ℤ) (hs : 1 ≤ s) (hB : B + 3=q0 s * r) : + qb6 B=false:= by + rw [qa9] + refine ⟨q0 (s - 1) * r - 2,?_⟩ + have hsp:=pow_split (k:=s) (d:=1) (by omega) hs + rw [pow2_one] at hsp + rw [hsp] at hB + linarith +theorem stage_even (l B e : ℤ) (hl : 1 ≤ l) (hB : Built l (.One B e)) (he : qb6 B=true) : + Built (l + 2) (.One (B + 3) (e + 1)) ∧ span l 2 1:= by + have h1:=Built.built_one hB + have h2 : Built (l + 1 + 1) (.One (B + 3) (e + 1)):= by + have hB3 : B + 3=(⟨1,1,B,0⟩ : pair).b + (⟨1,1,B,0⟩ : pair).c + 3:= by dsimp -failIfUnchanged; omega + rw [hB3] + apply Built.built_even h1 + rw [qbp l B hl] + exact he + have h2' : Built (l + 2) (.One (B + 3) (e + 1)):= by + have heq : l + 2=l + 1 + 1:= by omega + rwa [heq] + refine ⟨h2',?_⟩ + change span l (1 + (1 + 0)) 1 + apply qa0 l (.One B e) (1 + 0) 1 hB (by simp [CheckTable.depth]) + apply qa0 (l + 1) (.Two ⟨1,1,B,0⟩ e) 0 1 h1 (by simp [CheckTable.depth]) + exact span_zero (l + 1 + 1) (.One (B + 3) (e + 1)) 1 h2 (by simp [CheckTable.depth]) +theorem stage_odd (l B e s r : ℤ) (g : entry) + (hB : Built l (.One B e)) (hs : 1 ≤ s ∧ s < l) + (hfactor : B + 3=q0 s * r) (hr : qW r) + (hg : Built s g) (hreturn : qaf Built s g) : + ∃ (n : ℕ) (v f : ℤ),(n : ℤ) ≤ s ∧ Built (l + 2 + (n : ℤ)) (.One v f) ∧ span l (2 + n) (2 * s + 1):= by + rcases (built_valid hB).1 with ⟨hl,he,hBmass⟩ + change 0 ≤ e at he + change B=1 + 3 * e at hBmass + have hsp : 0 < q0 s:=pow_pos (by omega) + have hr0 : 1 ≤ r:= by nlinarith + have h1:=Built.built_one hB + have hS:=qbc l B s r hs hfactor hr + have hO : q3 (l + 1) ⟨1,1,B,0⟩=false:= by + rw [qbp l B (by omega)] + exact odd_factor B s r hs.1 hfactor + have hprefix : ∀ n : ℕ,span (l + 2) n (2 * s + 1) → span l (2 + n) (2 * s + 1):= by + intro n hspan + have h2n : 2 + n=1 + (1 + n):= by omega + rw [h2n] + apply qa0 l (.One B e) (1 + n) (2 * s + 1) hB (by simp [CheckTable.depth]; omega) + apply qa0 (l + 1) (.Two ⟨1,1,B,0⟩ e) n (2 * s + 1) h1 (by simp [CheckTable.depth]; omega) + have heq : l + 1 + 1=l + 2:= by omega + rwa [heq] + cases g with + | One v f => + have h2:=Built.built_lookup_one h1 hS hO hg + have heq : l + 1 + 1=l + 2:= by omega + rw [heq] at h2 + refine ⟨0,B + 0 + v + 2,e + 1 + f,by omega,?_,?_⟩ + · simpa using! h2 + · apply hprefix + exact span_zero (l + 2) (.One (B + 0 + v + 2) (e + 1 + f)) (2 * s + 1) h2 + (by simp [CheckTable.depth]; omega) + | Two x f => + have h2:=Built.built_lookup_two h1 hS hO hg + have heq : l + 1 + 1=l + 2:= by omega + rw [heq] at h2 + rcases (built_valid hg).1 with ⟨hs0,hf,hx,hmass⟩ + rcases hreturn with ⟨j,n,hbound⟩ + have hlow:=qb9 hx + rcases qb5 (fun _ _ h => built_valid h) hbound hlow with ⟨hj,hn,hexec⟩ + have hd:=qcm hlow + have hns : (n : ℤ) ≤ s:= by omega + rcases boundary_copy s (qba x) j n hbound hlow r (l - s) (l + 2) + (qbu (qQ ⟨1,1,B,0⟩ s r x)) (e + 1 + f) hr0 hr (by omega) + (qcf l B s r x hfactor) h2 with ⟨hend,hspan⟩ + refine ⟨n,_,_,hns,hend,?_⟩ + apply hprefix + exact qbI (l + 2) n _ (2 * s + 1) (by omega) hspan +end Phase +namespace Cubic +open Table +theorem cubic_exp (k : ℤ) (hk : 16 ≤ k) : 12 * k ^ 3 + 4 < q0 k:= by + have h : ∀ n : ℕ,12 * (16 + (n : ℤ)) ^ 3 + 4 < q0 (16 + (n : ℤ)):= by + intro n + induction n with + | zero => decide + | succ n ih => + have hcast : (16 + ((n + 1 : ℕ) : ℤ))=(16 + (n : ℤ)) + 1:= by push_cast; ring + rw [hcast,q5 (by omega) (by omega),pow2_one] + have hdiff : 2 * (12 * (16 + (n : ℤ)) ^ 3 + 4) - (12 * ((16 + (n : ℤ)) + 1) ^ 3 + 4) = + 12 * (n : ℤ) ^ 3 + 540 * (n : ℤ) ^ 2 + 8028 * (n : ℤ) + 39352:= by ring + have hpos : 0 ≤ 12 * (n : ℤ) ^ 3 + 540 * (n : ℤ) ^ 2 + 8028 * (n : ℤ) + 39352:= by positivity + linarith + have hk_eq : k=16 + ((k - 16).toNat : ℤ):= by omega + rw [hk_eq] + exact h (k - 16).toNat +theorem cubic_exp2 (x : ℤ) (hx : 16 ≤ x) : 2048 * x ^ 3 ≤ 12 * q0 (2 * x - 2):= by + have h : ∀ n : ℕ,2048 * (16 + (n : ℤ)) ^ 3 ≤ 12 * q0 (2 * (16 + (n : ℤ)) - 2):= by + intro n + induction n with + | zero => decide + | succ n ih => + have hcast1 : (16 + ((n + 1 : ℕ) : ℤ))=(16 + (n : ℤ)) + 1:= by push_cast; ring + have hcast2 : 2 * ((16 + (n : ℤ)) + 1) - 2=(2 * (16 + (n : ℤ)) - 2) + 2:= by ring + rw [hcast1,hcast2,q5 (by omega) (by omega)] + have hp2 : q0 2=4:= by decide + rw [hp2] + have hdiff : 4 * (2048 * (16 + (n : ℤ)) ^ 3) - 2048 * ((16 + (n : ℤ)) + 1) ^ 3 = + 6144 * (n : ℤ) ^ 3 + 288768 * (n : ℤ) ^ 2 + 4515840 * (n : ℤ) + 23492608:= by ring + have hpos : 0 ≤ 6144 * (n : ℤ) ^ 3 + 288768 * (n : ℤ) ^ 2 + 4515840 * (n : ℤ) + 23492608:= by positivity + linarith + have hx_eq : x=16 + ((x - 16).toNat : ℤ):= by omega + rw [hx_eq] + exact h (x - 16).toNat +theorem qbo (k s : ℤ) (hk : 2 ≤ k) (hs : 1 ≤ s) (hp : q0 s ≤ 24 * k ^ 3 + 4) : + s ≤ 3 * q1 k + 4:= by + set x:=q1 k + have hx : 0 ≤ x:=qh k + rcases qy (by omega : 1 < k) with ⟨hlo,hhi⟩ + have hE : q0 (3 * x + 5)=32 * q0 x ^ 3:= by + have heq : 3 * x + 5=x + (x + (x + 5)):= by ring + rw [heq,q5 hx (by omega),q5 hx (by omega),q5 hx (by omega)] + have hp5 : q0 5=32:= by decide + rw [hp5] + ring + have hcube : k ^ 3 ≤ q0 x ^ 3:=pow_le_pow_left₀ (by omega) hhi 3 + have hpow : 0 < q0 x:=pow_pos hx + have hpow3 : 1 ≤ q0 x ^ 3:= by + have : 1 ^ 3 ≤ q0 x ^ 3:=pow_le_pow_left₀ (by omega) (by omega : 1 ≤ q0 x) 3 + linarith + have hL : q0 s < q0 (3 * x + 5):= by linarith + have hlt:=(qv (by omega) (by omega)).mp hL + omega +theorem growth (k s : ℤ) (hk : 65536 ≤ k) (hs : 1 ≤ s) (hp : q0 s ≤ 24 * k ^ 3 + 4) : + 1 + 4 * s ^ 3 ≤ 12 * k ^ 2:= by + have hsbound:=qbo k s (by omega) hs hp + set x:=q1 k + have hx : 16 ≤ x:= by + have hp16 : (65536 : ℤ)=q0 16:= by decide + have hmono:=qt hk + rw [hp16,qar (by omega)] at hmono + exact hmono + have hE:=cubic_exp2 x hx + have hsmall : 1 + 4 * s ^ 3 ≤ 2048 * x ^ 3:= by + have hcube : s ^ 3 ≤ (4 * x) ^ 3:=pow_le_pow_left₀ (by omega) (by omega : s ≤ 4 * x) 3 + have hx3 : 1 ≤ x ^ 3:= by + have : 1 ^ 3 ≤ x ^ 3:=pow_le_pow_left₀ (by omega) (by omega : 1 ≤ x) 3 + linarith + have h64 : (4 * x) ^ 3=64 * x ^ 3:= by ring + linarith + rcases qy (by omega : 1 < k) with ⟨hlo,hhi⟩ + have hP : q0 (2 * x - 2)=q0 (x - 1) * q0 (x - 1):= by + have heq : 2 * x - 2=(x - 1) + (x - 1):= by ring + rw [heq,q5 (by omega) (by omega)] + rw [hP] at hE + have hp_pos:=pow_pos (by omega : 0 ≤ x - 1) + nlinarith +theorem lookup_h (k : ℤ) (x : pair) (e s r : ℤ) + (hb : Built k (.Two x e)) (hsep : qa k x s r) (he : e ≤ 4 * k ^ 3) : + q0 s ≤ 24 * k ^ 3 + 4:= by + rcases hsep with ⟨hs1,hsk,hh,hr⟩ + rcases (built_valid hb).1 with ⟨hk,he0,hx,hmass⟩ + rcases hx with ⟨⟨hd0,hdk,hp,hpd,ho,hb0,hc⟩,hhalf,hc0⟩ + unfold h at hh + have hp_pos:=pow_pos (by omega : 0 ≤ s) + have hr1 : 1 ≤ r:= by nlinarith + nlinarith +theorem qaV (k : ℤ) (f : entry) (h : Built k f) : qad f ≤ 4 * k ^ 3:= by + induction h with + | built_root => simp [qad] + | @built_one k v e hb ih => + by_cases hbase : k + 1 ≤ 65536 + · have hk0:=UniqueTable.built_nonnegative hb + exact (Finite.all_base ⟨by omega,hbase⟩ (Built.built_one hb)).1.1 + · change e ≤ 4 * k ^ 3 at ih + change e ≤ 4 * (k + 1) ^ 3 + have hk0 : 0 ≤ k:= by omega + have hdiff : 4 * (k + 1) ^ 3 - 4 * k ^ 3=12 * k ^ 2 + 12 * k + 4:= by ring + have hpos : 0 ≤ 12 * k ^ 2 + 12 * k + 4:= by positivity + linarith + | @built_even k x e hb he ih => + by_cases hbase : k + 1 ≤ 65536 + · have hk0:=UniqueTable.built_nonnegative hb + exact (Finite.all_base ⟨by omega,hbase⟩ (Built.built_even hb he)).1.1 + · change e ≤ 4 * k ^ 3 at ih + change e + 1 ≤ 4 * (k + 1) ^ 3 + have hk0 : 0 ≤ k:= by omega + have hdiff : 4 * (k + 1) ^ 3 - (4 * k ^ 3 + 1)=12 * k ^ 2 + 12 * k + 3:= by ring + have hpos : 0 ≤ 12 * k ^ 2 + 12 * k + 3:= by positivity + linarith + | @built_lookup_one k x e s r v f hb hs ho hsmall ih ihsmall => + by_cases hbase : k + 1 ≤ 65536 + · have hk0:=UniqueTable.built_nonnegative hb + exact (Finite.all_base ⟨by omega,hbase⟩ (Built.built_lookup_one hb hs ho hsmall)).1.1 + · change e ≤ 4 * k ^ 3 at ih + change f ≤ 4 * s ^ 3 at ihsmall + change e + 1 + f ≤ 4 * (k + 1) ^ 3 + have hgrow:=growth k s (by omega) hs.1 (lookup_h k x e s r hb hs ih) + have hk0 : 0 ≤ k:= by omega + have hdiff : 4 * (k + 1) ^ 3 - (4 * k ^ 3 + 12 * k ^ 2)=12 * k + 4:= by ring + linarith + | @built_lookup_two k x e s r y f hb hs ho hsmall ih ihsmall => + by_cases hbase : k + 1 ≤ 65536 + · have hk0:=UniqueTable.built_nonnegative hb + exact (Finite.all_base ⟨by omega,hbase⟩ (Built.built_lookup_two hb hs ho hsmall)).1.1 + · change e ≤ 4 * k ^ 3 at ih + change f ≤ 4 * s ^ 3 at ihsmall + change e + 1 + f ≤ 4 * (k + 1) ^ 3 + have hgrow:=growth k s (by omega) hs.1 (lookup_h k x e s r hb hs ih) + have hk0 : 0 ≤ k:= by omega + have hdiff : 4 * (k + 1) ^ 3 - (4 * k ^ 3 + 12 * k ^ 2)=12 * k + 4:= by ring + linarith +end Cubic +namespace Stages +open Table Phase Cubic +theorem split2_spec (x : ℤ) (hx : 0 < x) : + let s:=(q4 x.toNat x).1 + let r:=(q4 x.toNat x).2 + 0 ≤ s ∧ 1 ≤ r ∧ qW r ∧ x=q0 s * r:= by + rcases qbH hx with ⟨hs0,heq,hodd⟩ + have hp:=qc hs0 + exact ⟨hs0,by nlinarith,hodd,heq⟩ +theorem qbv (l B e : ℤ) (hl : 16 ≤ l) (hB : Built l (.One B e)) (ho : qb6 B=false) : + ∃ s r,(1 ≤ s ∧ s < l) ∧ B + 3=q0 s * r ∧ qW r ∧ s ≤ 3 * q1 l + 4:= by + rcases (built_valid hB).1 with ⟨hl0,he0,hmass⟩ + change 0 ≤ e at he0 + change B=1 + 3 * e at hmass + have hE : e ≤ 4 * l ^ 3:=qaV l (.One B e) hB + have hpos : 0 < B + 3:= by omega + rcases split2_spec (B + 3) hpos with ⟨hs,hr,hro,hfactor⟩ + set s:=(q4 (B + 3).toNat (B + 3)).1 + set r:=(q4 (B + 3).toNat (B + 3)).2 + have hs1 : 1 ≤ s:= by + by_contra hlt + have hs0 : s=0:= by omega + rw [hs0,pow2_zero,one_mul] at hfactor + rcases hro with ⟨t,ht⟩ + have hBeven : ZEven B:=⟨t - 1,by omega⟩ + have htr:=(qah B).mpr hBeven + rw [ho] at htr + contradiction + have hp:=pow_pos hs + have hbound : q0 s ≤ 12 * l ^ 3 + 4:= by nlinarith + have hlt : q0 s < q0 l:= by + have:=cubic_exp l hl + omega + have hsl : s < l:=(qv hs (by omega)).mp hlt + have hl3 : 0 ≤ l ^ 3:= by positivity + exact ⟨s,r,⟨hs1,hsl⟩,hfactor,hro,qbo l s (by omega) hs1 (by linarith)⟩ +theorem next_stage (l B e : ℤ) (hl : 16 ≤ l) (hB : Built l (.One B e)) + (hsmall : ∀ s,1 ≤ s ∧ s < l → ∃ g,Built s g ∧ qaf Built s g) : + ∃ (n : ℕ) (v f : ℤ),2 ≤ (n : ℤ) ∧ Built (l + (n : ℤ)) (.One v f) ∧ span l n (6 * q1 l + 9):= by + cases he : qb6 B + · rcases qbv l B e hl hB he with ⟨s,r,hs,hfactor,hr,hbound⟩ + rcases hsmall s hs with ⟨g,hg,hreturn⟩ + rcases stage_odd l B e s r g hB hs hfactor hr hg hreturn with ⟨n,v,f,hn,hend,hspan⟩ + refine ⟨2 + n,v,f,by omega,?_,?_⟩ + · have heq : l + ((2 + n : ℕ) : ℤ)=l + 2 + (n : ℤ):= by omega + rwa [heq] + · exact qbI l (2 + n) (2 * s + 1) (6 * q1 l + 9) (by omega) hspan + · rcases stage_even l B e (by omega) hB he with ⟨hend,hspan⟩ + refine ⟨2,B + 3,e + 1,by omega,?_,?_⟩ + · simpa using! hend + · have hlog:=qh l + exact qbI l 2 1 (6 * q1 l + 9) (by omega) hspan +theorem through (target : ℤ) (htarget : 0 ≤ target) + (hreturns : ∀ s,1 ≤ s ∧ s < target → ∃ g,Built s g ∧ qaf Built s g) : + ∃ f,Built target f ∧ CheckTable.bounded target f:= by + by_cases hbase : target ≤ 16 + · by_cases htz : target=0 + · subst htz + exact ⟨.One 1 0,Built.built_root,by simp [CheckTable.bounded,qad,CheckTable.depth,q1]⟩ + · rcases CheckTable.base_structured target ⟨by omega,by omega⟩ with ⟨f,hf,hbounds,_⟩ + exact ⟨f,hf,hbounds⟩ + · have hgo : ∀ (n : ℕ) (l B e : ℤ),(16 ≤ l ∧ l ≤ target) → target - l ≤ (n : ℤ) → + Built l (.One B e) → ∃ f,Built target f ∧ CheckTable.bounded target f:= by + intro n + induction n with + | zero => + intro l B e hl hfuel hB + have htl : target=l:= by omega + subst htl + refine ⟨.One B e,hB,qaV target (.One B e) hB,?_⟩ + simp only [CheckTable.depth] + have:=qh target + omega + | succ n ih => + intro l B e hl hfuel hB + rcases next_stage l B e hl.1 hB (fun s hs => hreturns s ⟨hs.1,by omega⟩) with + ⟨m,v,f,hm,hend,hspan⟩ + by_cases hstop : target ≤ l + (m : ℤ) + · rcases hspan (target - l) ⟨by omega,by omega⟩ with ⟨g,hg,hD⟩ + have heq : l + (target - l)=target:= by omega + rw [heq] at hg + have hlog:=qt hl.2 + exact ⟨g,hg,qaV target g hg,by omega⟩ + · exact ih (l + (m : ℤ)) v f ⟨by omega,by omega⟩ (by omega) hend + exact hgo (target - 16).toNat 16 37 12 ⟨by omega,by omega⟩ (by omega) CheckTable.P16 +end Stages +namespace BoundaryBound +open Table WordLibrary +theorem qbV (k : ℤ) (x : pair) (s r : ℤ) (y : pair) (e : ℤ) + (hsep : qa k x s r) (hb : Built s (.Two y e)) : + action ⟨s,y⟩ (x.b + x.c) x.b ((qQ x s r y).b + (qQ x s r y).c) (qQ x s r y).b:= by + rcases (built_valid hb).1 with ⟨hs,he,hy,hmass⟩ + refine ⟨by rw [qI]; unfold gain; dsimp -failIfUnchanged; ring,?_,?_⟩ + · have hdelta:=qbU hsep hy + unfold qQ h at * + dsimp -failIfUnchanged at * + linarith + · rcases hsep with ⟨_,_,hh,t,rfl⟩ + refine ⟨t,?_⟩ + unfold h at hh + dsimp -failIfUnchanged + linarith +theorem qbJ (k : ℤ) (x : pair) (L : ℤ) + (hx : qaB k x) (hL : 1 ≤ L) (hdepth : x.d + L < k) (hbound : h x < q0 L) + (he : q3 k x=false) : + ∃ s r,qa k x s r ∧ s < L:= by + rcases hx with ⟨hd,hdk,hp,hpd,ho,hb,hc⟩ + have hpos : 0 < h x:= by unfold h; omega + have hbodd : qW x.b:= by + unfold q3 qk at he + rw [if_pos (by omega : x.d < k)] at he + exact (qa9 x.b).mp he + rcases Stages.split2_spec (h x) hpos with ⟨hs,hr,hro,hfactor⟩ + set s:=(q4 (h x).toNat (h x)).1 + set r:=(q4 (h x).toNat (h x)).2 + have hs1 : 1 ≤ s:= by + by_contra hlt + have hs0 : s=0:= by omega + rw [hs0,pow2_zero,one_mul] at hfactor + unfold h at hfactor + rcases hbodd with ⟨a,ha⟩ + rcases hro with ⟨v,hv⟩ + omega + have hsL : s < L:= by + apply (qv hs (by omega)).mp + have hp2:=pow_pos hs + nlinarith + exact ⟨s,r,⟨hs1,by omega,hfactor,hro⟩,hsL⟩ +theorem qbD (k L D M : ℤ) + (hL : 1 ≤ L) (hD : 0 ≤ D) (hM : 0 ≤ M) + (hlib : ∀ s,1 ≤ s ∧ s ≤ L → ∃ f,Built s f) + (hparams : ∀ s y e,1 ≤ s ∧ s ≤ L → Built s (.Two y e) → y.d ≤ D ∧ y.b + y.c + 2 ≤ M) + (n : ℕ) : + ∀ x,qaB k x → x.d + (n : ℤ) * D + L < k → + 2 * (x.b + x.c + (n : ℤ) * M) + 3 < q0 L → + (∃ e m,Boundary Built k x e m) ∨ + (∃ word : List kernel,word.length=n ∧ + (∀ z ∈ word,continuing z ∧ z.index ≤ L) ∧ + trace word (x.b + x.c) x.b):= by + induction n with + | zero => + intro x hx hdepth hmass + right + exact ⟨[],rfl,by simp,trace.trace_nil _ _⟩ + | succ n ih => + intro x hx hdepth hmass + cases he : q3 k x + · have hxdepth : x.d + L < k:= by nlinarith + have hxbound : h x < q0 L:= by + rcases hx with ⟨_,_,_,_,_,hb,hc⟩ + unfold h + nlinarith + rcases qbJ k x L hx hL hxdepth hxbound he with ⟨s,r,hsep,hsL⟩ + have hs : 1 ≤ s ∧ s ≤ L:=⟨hsep.1,by omega⟩ + rcases hlib s hs with ⟨f_s,hb⟩ + cases f_s with + | One v e => + left + exact ⟨1 + e,1,Boundary.boundary_one x s r v e hsep he hb⟩ + | Two y e => + rcases (built_valid hb).1 with ⟨hs0,he0,hy,hysum⟩ + rcases qan hx hsep hy with ⟨hnext,hc⟩ + have hP:=Bridge.lookup_parity hx hsep hy + cases hparity : q3 s y + · rcases hparams s y e hs hb with ⟨hDy,hMy⟩ + have hdepth' : (qQ x s r y).d + (n : ℤ) * D + L < k:= by + change x.d + y.d + (n : ℤ) * D + L < k + push_cast at hdepth + linarith + have hmass' : 2 * ((qQ x s r y).b + (qQ x s r y).c + (n : ℤ) * M) + 3 < q0 L:= by + rw [qI] + push_cast at hmass + linarith + rcases ih (qQ x s r y) hnext hdepth' hmass' with + ⟨f,m,hreturn⟩ | ⟨word,hlen,hall,htrace⟩ + · left + exact ⟨1 + e + f,1 + m,Boundary.boundary_two x s r y e f m hsep he hb hreturn⟩ + · right + refine ⟨⟨s,y⟩ :: word,by simp [hlen],?_,?_⟩ + · intro z hz + rcases List.mem_cons.mp hz with rfl | hz' + · exact ⟨⟨e,hb,hs.1,hparity⟩,hs.2⟩ + · exact hall z hz' + · exact trace.trace_cons (qbV k x s r y e hsep hb) htrace + · left + refine ⟨1 + e + 1,2,Boundary.boundary_two x s r y e 1 1 hsep he hb ?_⟩ + exact Boundary.boundary_even (qQ x s r y) (by rw [hP,hparity]) + · left + exact ⟨1,1,Boundary.boundary_even x he⟩ +theorem returns_of_bound (k : ℤ) (x : pair) (L D M : ℤ) (n : ℕ) + (hL : 1 ≤ L) (hD : 0 ≤ D) (hM : 0 ≤ M) (hx : qaB k x) + (hlib : ∀ s,1 ≤ s ∧ s ≤ L → ∃ f,Built s f) + (hparams : ∀ s y e,1 ≤ s ∧ s ≤ L → Built s (.Two y e) → y.d ≤ D ∧ y.b + y.c + 2 ≤ M) + (hwords : WordLink.bound L ((n : ℤ) - 1)) + (hdepth : x.d + (n : ℤ) * D + L < k) + (hmass : 2 * (x.b + x.c + (n : ℤ) * M) + 3 < q0 L) : + ∃ e m,Boundary Built k x e m:= by + rcases qbD k L D M hL hD hM hlib hparams n x hx hdepth hmass with + hreturn | ⟨word,hlen,hall,htrace⟩ + · exact hreturn + · have hbw:=hwords word (x.b + x.c) x.b hall htrace + rw [hlen] at hbw + omega +end BoundaryBound +namespace Closure +open Table +def good (k : ℤ) : Prop := + ∃ f,Built k f ∧ CheckTable.bounded k f ∧ qaf Built k f +def earlier (k : ℤ) : Prop := + ∀ s,1 ≤ s ∧ s < k → good s +def budget (k : ℤ) : Prop := + ∃ L : ℤ,∃ n : ℕ,(1 ≤ L ∧ L < k) ∧ WordLink.bound L ((n : ℤ) - 1) ∧ + 6 * q1 k + 9 + (n : ℤ) * (6 * q1 L + 9) + L < k ∧ + 2 * (12 * k ^ 3 + (n : ℤ) * (12 * L ^ 3 + 3)) + 3 < q0 L +theorem qch (k : ℤ) (h : earlier k) : + ∀ s f,1 ≤ s ∧ s < k → Built s f → CheckTable.bounded s f:= by + intro s f hs hf + rcases h s hs with ⟨g,hg,hbounds,_⟩ + have heq:=UniqueTable.built_unique hf g hg + subst heq + exact hbounds +theorem kernel_bounds (k L : ℤ) (hL : 1 ≤ L ∧ L < k) (hprev : earlier k) : + ∀ s y e,(1 ≤ s ∧ s ≤ L) → Built s (.Two y e) → + y.d ≤ 6 * q1 L + 9 ∧ y.b + y.c + 2 ≤ 12 * L ^ 3 + 3:= by + intro s y e hs hb + rcases qch k hprev s (.Two y e) ⟨hs.1,by omega⟩ hb with ⟨hE,hD⟩ + change e ≤ 4 * s ^ 3 at hE + change y.d ≤ 6 * q1 s + 9 at hD + have hlog:=qt hs.2 + have hpow : s ^ 3 ≤ L ^ 3:=pow_le_pow_left₀ (by omega) hs.2 3 + rcases (built_valid hb).1 with ⟨hs0,he,hy,hmass⟩ + exact ⟨by omega,by omega⟩ +theorem close (k : ℤ) (hk : 1 ≤ k) (hprevious : earlier k) (hbudget : budget k) : + good k:= by + rcases hbudget with ⟨L,n,hL,hword,hdepth,hmass⟩ + have hentries : ∀ s,1 ≤ s ∧ s < k → ∃ f,Built s f ∧ qaf Built s f:= by + intro s hs + rcases hprevious s hs with ⟨f,hf,_,hreturn⟩ + exact ⟨f,hf,hreturn⟩ + rcases Stages.through k (by omega) hentries with ⟨f,hf,hbounds⟩ + refine ⟨f,hf,hbounds,?_⟩ + cases f with + | One v e => trivial + | Two x e => + rcases hbounds with ⟨hE,hD⟩ + change e ≤ 4 * k ^ 3 at hE + change x.d ≤ 6 * q1 k + 9 at hD + rcases (built_valid hf).1 with ⟨hk0,he,hx,hsum⟩ + have hL0 : 0 ≤ L:= by omega + have hL3 : 0 ≤ L ^ 3:= by positivity + apply BoundaryBound.returns_of_bound k (qba x) L + (6 * q1 L + 9) (12 * L ^ 3 + 3) n + · omega + · have:=qh L; omega + · omega + · exact qb9 hx + · intro s hs + rcases hentries s ⟨hs.1,by omega⟩ with ⟨g,hg,_⟩ + exact ⟨g,hg⟩ + · exact kernel_bounds k L hL hprevious + · exact hword + · change x.d + (n : ℤ) * (6 * q1 L + 9) + L < k + omega + · change 2 * (x.b + (x.c - 1) + (n : ℤ) * (12 * L ^ 3 + 3)) + 3 < q0 L + omega +theorem qae (k : ℤ) (hk : 1 ≤ k) (hprevious : earlier k) + (hbudget : 65536 < k → budget k) : good k:= by + by_cases hsmall : k ≤ 65536 + · exact CheckTable.base_structured k ⟨hk,hsmall⟩ + · exact close k hk hprevious (hbudget (by omega)) +theorem all_good (hbudget : ∀ k,65536 < k → earlier k → budget k) : + ∀ k,1 ≤ k → good k:= by + have hnat : ∀ n : ℕ,1 ≤ n → good (n : ℤ):= by + intro n + induction n using Nat.strongRecOn with + | ind n ih => + intro hn + have hprevious : earlier (n : ℤ):= by + intro s hs + have hs_eq : s=(s.toNat : ℤ):= by omega + rw [hs_eq] + exact ih s.toNat (by omega) (by omega) + exact qae (n : ℤ) (by omega) hprevious (fun hlarge => hbudget (n : ℤ) hlarge hprevious) + intro k hk + have hk_eq : k=(k.toNat : ℤ):= by omega + rw [hk_eq] + exact hnat k.toNat (by omega) +theorem G_returns (hbudget : ∀ k,65536 < k → earlier k → budget k) : + ∀ k t : ℕ,∃ e m,Prefix.Exec e (Prefix.G (1 + k) (1 + 2 * t)) [m]:= by + intro k t + rcases all_good hbudget ((1 + k : ℕ) : ℤ) (by omega) with ⟨f,hf,hbounds,hreturn⟩ + have h:=Table.G_returns (fun s g hsg => built_valid hsg) + (built_valid hf) hreturn (by omega) ((1 + 2 * t : ℕ) : ℤ) (by omega) + ⟨(t : ℤ),by push_cast; ring⟩ + unfold Table.G at h + simpa only [Int.toNat_natCast] using! h +end Closure +namespace HighPath +open Block +def certified (m D M B : ℤ) (z : summary) : Prop := + ∃ d,(0 ≤ d ∧ d ≤ D) ∧ z.scale=q0 d ∧ (z.scale ≤ z.sc ∧ z.sc ≤ 2 * z.scale) ∧ + (0 < z.offset ∧ z.offset ≤ z.scale * (2 * M + 2)) ∧ (m < z.added ∧ z.added ≤ M) ∧ + 2 * z.offset ≤ z.sc * (3 * z.added + 2 * B + 6) +inductive path (m D M B : ℤ) : List summary → ℤ → ℤ → Prop where + | path_stop (S H : ℤ) : q0 (m + 1) ∣ H → path m D M B [] S H + | path_step (z : summary) (zs : List summary) (S H H' : ℤ) : + q0 (m + 1) ∣ H → certified m D M B z → + denotes z S H (S + z.added) H' → path m D M B zs (S + z.added) H' → + path m D M B (z :: zs) S H +theorem path_div (m D M B : ℤ) (zs : List summary) (S H : ℤ) + (hp : path m D M B zs S H) : q0 (m + 1) ∣ H:= by + cases hp with + | path_stop _ _ h => exact h + | path_step _ _ _ _ _ h _ _ _ => exact h +inductive chain (m D M B : ℤ) : List summary → Prop where + | chain_one (z : summary) : certified m D M B z → chain m D M B [z] + | chain_more (z z' : summary) (zs : List summary) : + certified m D M B z → + z.sc * z'.offset=z'.sc * (z.offset - z.sc * z.added) → + chain m D M B (z' :: zs) → + chain m D M B (z :: z' :: zs) +theorem adjacent (m D M B : ℤ) (z z' : summary) (S H0 H1 H2 : ℤ) + (hm : 0 ≤ m) + (hz : certified m D M B z) (hz' : certified m D M B z') + (hH0 : q0 (m + 1) ∣ H0) (hH1 : q0 (m + 1) ∣ H1) (hH2 : q0 (m + 1) ∣ H2) + (hden0 : denotes z S H0 (S + z.added) H1) + (hden1 : denotes z' (S + z.added) H1 (S + z.added + z'.added) H2) + (hbudget : q0 (2 * D) * (12 * M + 8) < q0 (m + 1)) : + z.sc * z'.offset=z'.sc * (z.offset - z.sc * z.added):= by + rcases hz with ⟨d0,⟨hd00,hd01⟩,hQ0,⟨hA00,hA01⟩,⟨hC00,hC01⟩,⟨hM00,hM01⟩,_⟩ + rcases hz' with ⟨d1,⟨hd10,hd11⟩,hQ1,⟨hA10,hA11⟩,⟨hC10,hC11⟩,_,_⟩ + rcases hden0 with ⟨_,hE0⟩ + rcases hden1 with ⟨_,hE1⟩ + rw [hQ0] at hA00 hA01 hC01 hE0 + rw [hQ1] at hA10 hA11 hC11 hE1 + have hp0:=qc hd00 + have hp1:=qc hd10 + exact qci m D d0 d1 S H0 H1 H2 z.sc z'.sc z.hc z'.hc z.offset z'.offset z.added M + hm hd00 hd01 hd10 hd11 (by omega) hM01 + (by omega) hA01 (by omega) hA11 + (by omega) hC01 (by omega) hC11 + hH0 hH1 hH2 hE0 hE1 hbudget +theorem path_chain (m D M B : ℤ) (zs : List summary) (S H : ℤ) + (hm : 0 ≤ m) (hbudget : q0 (2 * D) * (12 * M + 8) < q0 (m + 1)) + (hp : path m D M B zs S H) (hne : zs ≠ []) : chain m D M B zs:= by + induction hp with + | path_stop _ _ _ => contradiction + | path_step z zs S H H' hH hz hstep htail ih => + cases zs with + | nil => exact chain.chain_one z hz + | cons z' zs' => + cases htail with + | path_step _ _ _ _ H2 hH1 hz' hstep' htail' => + have hH2 : q0 (m + 1) ∣ H2:=path_div m D M B zs' (S + z.added + z'.added) H2 htail' + have hadj:=adjacent m D M B z z' S H H' H2 hm hz hz' hH hH1 hH2 hstep hstep' hbudget + exact chain.chain_more z z' zs' hz hadj (ih (by simp)) +inductive roots (A B m : ℤ) : ℤ → ℕ → Prop where + | roots_one (f : ℤ) : 0 < f → roots A B m f 0 + | roots_more (f g : ℤ) (n : ℕ) : + 3 * g ≤ f + 2 * A * (B + 3) → + g < f - A * m → + roots A B m g n → + roots A B m f (n + 1) +theorem qc4 (A B m f : ℤ) (n : ℕ) (hr : roots A B m f n) : + ∃ v : ℕ → ℤ,v 0=f ∧ 0 < v n ∧ + ∀ i < n,3 * v (i + 1) ≤ v i + 2 * A * (B + 3) ∧ v (i + 1) < v i - A * m:= by + induction hr with + | roots_one f hf => + refine ⟨fun _ => f,rfl,hf,fun i hi => by omega⟩ + | roots_more f g n hshrink hdrop _ ih => + rcases ih with ⟨v,hv0,hvn,hsteps⟩ + refine ⟨fun i => match i with | 0 => f | j + 1 => v j,rfl,hvn,?_⟩ + intro i hi + cases i with + | zero => + dsimp -failIfUnchanged + rw [hv0] + exact ⟨hshrink,hdrop⟩ + | succ j => + exact hsteps j (by omega) +theorem roots_count (A B m f : ℤ) (n t q : ℕ) (V : ℤ) + (hA : 0 < A) (hB : 0 ≤ B) (hm : 0 < m) (hV : 0 ≤ V) + (hpow : V ≤ (3 : ℤ) ^ t) (hq : B + 4 ≤ (q : ℤ) * m) (hf : f ≤ A * V) + (hr : roots A B m f n) : n < t + q:= by + rcases qc4 A B m f n hr with ⟨v,hv0,hlast,hsteps⟩ + apply high_count v A B V m t q n hA hB hm hV hpow hq + · rw [hv0]; exact hf + · exact hlast + · intro i hi; exact (hsteps i hi).1 + · intro i hi; exact (hsteps i hi).2 +theorem chain_roots (m D M B : ℤ) (zs : List summary) (hch : chain m D M B zs) : + ∀ z rest,zs=z :: rest → ∀ A f,0 < A → A * z.offset=z.sc * f → + roots A B m f rest.length:= by + induction hch with + | chain_one z hz => + intro z0 rest heq A f hA hroot + injection heq with hz0 hrest + subst hz0 hrest + rcases hz with ⟨d,⟨hd0,_⟩,hQ,⟨hsc1,_⟩,⟨hc1,_⟩,_,_⟩ + have hp:=qc hd0 + have hsc_pos : 0 < z.sc:= by linarith + have hAf_pos : 0 < z.sc * f:= by nlinarith + have hf_pos : 0 < f:= by nlinarith + exact roots.roots_one f hf_pos + | chain_more z z' zs hz hdescent _ ih => + intro z0 rest heq A f hA hroot + injection heq with hz0 hrest + subst hz0 hrest + rcases hz with ⟨d,⟨hd0,_⟩,hQ,⟨hsc1,_⟩,⟨hc1,_⟩,⟨hm1,_⟩,hcontract⟩ + have hp:=qc hd0 + have hsc_pos : 0 < z.sc:= by linarith + have hnext : A * z'.offset=z'.sc * (f - A * z.added):= by + have hroot0 : A * z.offset=z.sc * (f - A * 0):= by + simpa using! hroot + have hprop:=qc6 A f z.sc z.offset z'.sc z'.offset 0 z.added hsc_pos hroot0 hdescent + simpa using! hprop + apply roots.roots_more f (f - A * z.added) zs.length + · have hmul : A * (2 * z.offset) ≤ A * (z.sc * (3 * z.added + 2 * B + 6)) := + mul_le_mul_of_nonneg_left hcontract (by omega) + nlinarith + · nlinarith + · exact ih z' zs rfl A (f - A * z.added) hA hnext +theorem path_count (m D M B : ℤ) (zs : List summary) (S H : ℤ) (t q : ℕ) + (hm : 0 < m) (hB : 0 ≤ B) (hM : 0 ≤ M) + (hpow : 2 * M + 2 ≤ (3 : ℤ) ^ t) (hq : B + 4 ≤ (q : ℤ) * m) + (hbudget : q0 (2 * D) * (12 * M + 8) < q0 (m + 1)) + (hp : path m D M B zs S H) : zs.length < t + q + 1:= by + cases zs with + | nil => simp + | cons z rest => + have hch : chain m D M B (z :: rest) := + path_chain m D M B (z :: rest) S H (by omega) hbudget hp (by simp) + cases hp with + | path_step _ _ _ _ _ _ hz _ _ => + rcases hz with ⟨d,⟨hd0,_⟩,hQ,⟨hA1,_⟩,⟨hC1,hC2⟩,_,_⟩ + have hp_pos:=qc hd0 + have hsc_pos : 0 < z.sc:= by linarith + have hr : roots z.sc B m z.offset rest.length := + chain_roots m D M B (z :: rest) hch z rest rfl z.sc z.offset hsc_pos rfl + have hrc : rest.length < t + q := + roots_count z.sc B m z.offset rest.length t q (2 * M + 2) + hsc_pos hB hm (by omega) hpow hq (by nlinarith) hr + simp; omega +end HighPath +namespace WordBlocks +open WordLibrary +def qD (f : kernel → ℤ) (word : List kernel) : ℤ := + word.foldr (fun k z => f k + z) 0 +def depth (k : kernel) : ℤ:=k.pair.d +def qw (word : List kernel) : List Block.kernel := + word.map (fun k => Bridge.kernel k.pair) +def summary (word : List kernel) : Block.summary := + (qw word).foldl (fun z k => Block.push k z) Block.identity +theorem qaj (f : kernel → ℤ) (word : List kernel) + (h : ∀ k ∈ word,0 ≤ f k) : 0 ≤ qD f word:= by + induction word with + | nil => simp [qD] + | cons k word ih => + have hk:=h k (by simp) + have hrest:=ih (fun x hx => h x (by simp [hx])) + rw [qD,List.foldr_cons,← qD] + omega +theorem qbF (f : kernel → ℤ) (word : List kernel) (C : ℤ) + (h : ∀ k ∈ word,0 ≤ f k ∧ f k ≤ C) : + 0 ≤ qD f word ∧ qD f word ≤ (word.length : ℤ) * C:= by + induction word with + | nil => simp [qD] + | cons k word ih => + have hk:=h k (by simp) + have hrest:=ih (fun x hx => h x (by simp [hx])) + rw [qD,List.foldr_cons,← qD] + simp only [List.length_cons] + push_cast + constructor + · omega + · nlinarith +theorem fold_added (word : List kernel) (z : Block.summary) : + ((qw word).foldl (fun z k => Block.push k z) z).added=z.added + qD gain word:= by + induction word generalizing z with + | nil => simp [qw,qD] + | cons k word ih => + rw [qw,List.map_cons,List.foldl_cons,← qw,qD,List.foldr_cons,← qD] + rw [ih] + dsimp -failIfUnchanged [Block.push,Bridge.kernel,gain] + ring +theorem qca (word : List kernel) (z : Block.summary) : + ((qw word).foldl (fun z k => Block.low_push k z) z).added=z.added + qD gain word:= by + induction word generalizing z with + | nil => simp [qw,qD] + | cons k word ih => + rw [qw,List.map_cons,List.foldl_cons,← qw,qD,List.foldr_cons,← qD] + rw [ih] + dsimp -failIfUnchanged [Block.low_push,Bridge.kernel,gain] + ring +theorem fold_scale (word : List kernel) (z : Block.summary) + (h : ∀ k ∈ word,0 ≤ depth k) : + ((qw word).foldl (fun z k => Block.push k z) z).scale=z.scale * q0 (qD depth word):= by + induction word generalizing z with + | nil => simp [qw,qD,pow2_zero] + | cons k word ih => + have hk : 0 ≤ depth k:=h k (by simp) + have hrest : ∀ x ∈ word,0 ≤ depth x:=fun x hx => h x (by simp [hx]) + have htot : 0 ≤ qD depth word:=qaj depth word hrest + rw [qw,List.map_cons,List.foldl_cons,← qw,qD,List.foldr_cons,← qD] + rw [ih (Block.push (Bridge.kernel k.pair) z) hrest] + rw [q5 hk htot] + dsimp -failIfUnchanged [Block.push,Bridge.kernel,depth] + ring +theorem fold_strong (ks : List Block.kernel) (z : Block.summary) + (hgood : ∀ k ∈ ks,Block.good k) (hz : Block.bounded z) (hne : ks ≠ []) : + let r:=ks.foldl (fun z k => Block.push k z) z + Block.bounded r ∧ r.scale ≤ r.sc ∧ 0 < r.offset:= by + induction ks generalizing z with + | nil => contradiction + | cons k ks ih => + have hk : Block.good k:=hgood k (by simp) + cases ks with + | nil => + simp only [List.foldl_cons,List.foldl_nil] + exact Block.push_bounded k z hk hz + | cons a ks' => + simp only [List.foldl_cons] + have hpush:=(Block.push_bounded k z hk hz).1 + exact ih (Block.push k z) (fun x hx => hgood x (by simp [hx])) hpush (by simp) +theorem summary_data (word : List kernel) + (hall : ∀ k ∈ word,continuing k) (hne : word ≠ []) : + 0 ≤ qD depth word ∧ + (summary word).scale=q0 (qD depth word) ∧ + Block.bounded (summary word) ∧ + (summary word).scale ≤ (summary word).sc ∧ + 0 < (summary word).offset ∧ + (summary word).added=qD gain word:= by + have hgood : ∀ k ∈ qw word,Block.good k:= by + intro bk hbk + rcases List.mem_map.mp hbk with ⟨k,hk_mem,rfl⟩ + exact WordLink.continuing_good k (hall k hk_mem) + have hdepth : ∀ k ∈ word,0 ≤ depth k:= by + intro k hk_mem + rcases hall k hk_mem with ⟨e,hb,_,_⟩ + have hval:=Table.built_valid hb + rcases hval with ⟨⟨_,_,⟨hx,_⟩,_⟩,_⟩ + exact hx.1 + refine ⟨qaj depth word hdepth,?_,?_⟩ + · unfold summary + rw [fold_scale word Block.identity hdepth] + dsimp -failIfUnchanged [Block.identity] + ring + · have hkne : qw word ≠ []:= by + cases word with + | nil => contradiction + | cons _ _ => simp [qw] + rcases fold_strong (qw word) Block.identity hgood Block.identity_bounded hkne with + ⟨hb,hA,hC⟩ + refine ⟨hb,hA,hC,?_⟩ + unfold summary + rw [fold_added] + dsimp -failIfUnchanged [Block.identity] + ring +theorem qbl (xs ys : List kernel) (S U : ℤ) + (h : trace (xs ++ ys) S U) : trace xs S U:= by + induction xs generalizing S U with + | nil => exact trace.trace_nil S U + | cons k xs ih => + cases h with + | trace_cons hact htr => + exact trace.trace_cons hact (ih _ _ htr) +theorem trace_split (xs ys : List kernel) (S U : ℤ) + (h : trace (xs ++ ys) S U) : + ∃ S' U',Block.calls (qw xs) S (2 * S - U + 3) S' (2 * S' - U' + 3) ∧ trace ys S' U':= by + induction xs generalizing S U with + | nil => + exact ⟨S,U,Block.calls.no_calls S (2 * S - U + 3),h⟩ + | cons k xs ih => + cases h with + | trace_cons hact htr => + rcases ih _ _ htr with ⟨S2,U2,hcalls,hrest⟩ + refine ⟨S2,U2,?_,hrest⟩ + exact Block.calls.more_calls (WordLink.action_block hact) hcalls +theorem summary_sound (word : List kernel) (S U S' U' : ℤ) + (h : Block.calls (qw word) S (2 * S - U + 3) S' (2 * S' - U' + 3)) : + Block.denotes (summary word) S (2 * S - U + 3) S' (2 * S' - U' + 3):= by + apply Block.fold_sound h Block.identity S (2 * S - U + 3) + dsimp -failIfUnchanged [Block.denotes,Block.identity] + exact ⟨by ring,by ring⟩ +theorem high_div (m : ℤ) (k : kernel) (word : List kernel) (S U : ℤ) + (hm : 0 ≤ m) (hhigh : m < k.index) (htrace : trace (k :: word) S U) : + q0 (m + 1) ∣ (2 * S - U + 3):= by + cases htrace with + | trace_cons hact _ => + rcases hact with ⟨_,_,t,ht⟩ + rw [ht,Table.pow_split (by omega : 0 ≤ m + 1) (by omega : m + 1 ≤ k.index)] + exact ⟨q0 (k.index - (m + 1)) * (2 * t + 1),by ring⟩ +theorem qbX (m r dL dm gL gm : ℤ) (k : kernel) (lows : List kernel) (S U : ℤ) + (hm : 0 ≤ m) (hr : 0 ≤ r) (hdm : 0 ≤ dm) (hgm : 0 ≤ gm) + (hhigh : m < k.index) (hk : continuing k) (hdk : depth k ≤ dL) (hgk : gain k ≤ gL) + (hlow : ∀ z ∈ lows,continuing z ∧ z.index ≤ m ∧ depth z ≤ dm ∧ gain z ≤ gm) + (htrace : trace lows S U) (hbound : WordLink.bound m r) : + HighPath.certified m (dL + r * dm) (gL + r * gm) (r * gm) (summary (k :: lows)):= by + have hall : ∀ z ∈ (k :: lows),continuing z:= by + intro z hz + rcases List.mem_cons.mp hz with rfl | hz' + · exact hk + · exact (hlow z hz').1 + have hlen : (lows.length : ℤ) ≤ r := + hbound lows S U (fun z hz => ⟨(hlow z hz).1,(hlow z hz).2.1⟩) htrace + have hD : 0 ≤ qD depth lows ∧ qD depth lows ≤ r * dm:= by + have h1 : ∀ z ∈ lows,0 ≤ depth z ∧ depth z ≤ dm:= by + intro z hz + rcases hlow z hz with ⟨⟨e,hb,_,_⟩,_,hd,_⟩ + rcases Table.built_valid hb with ⟨⟨_,_,⟨hx,_⟩,_⟩,_⟩ + exact ⟨hx.1,hd⟩ + have htb:=qbF depth lows dm h1 + exact ⟨htb.1,by nlinarith⟩ + have hG : 0 ≤ qD gain lows ∧ qD gain lows ≤ r * gm:= by + have h1 : ∀ z ∈ lows,0 ≤ gain z ∧ gain z ≤ gm:= by + intro z hz + rcases hlow z hz with ⟨hz_cont,_,_,hg⟩ + have hgood:=WordLink.continuing_good z hz_cont + dsimp -failIfUnchanged [Block.good,Bridge.kernel] at hgood + have hgain_eq : gain z=z.pair.b + z.pair.c + 2:=rfl + exact ⟨by omega,hg⟩ + have htb:=qbF gain lows gm h1 + exact ⟨htb.1,by nlinarith⟩ + rcases summary_data (k :: lows) hall (by simp) with ⟨hd0,hQ,hz,hA,hC,hM⟩ + have hMbound : m < (summary (k :: lows)).added ∧ (summary (k :: lows)).added ≤ gL + r * gm:= by + rw [hM,qD,List.foldr_cons,← qD] + have hcg:=WordLink.continuing_gain k hk + exact ⟨by omega,by omega⟩ + have hDfull : qD depth (k :: lows) ≤ dL + r * dm:= by + rw [qD,List.foldr_cons,← qD] + omega + rcases hz with ⟨hQpos,hA0,hAs,hMpos,hC0,hCs⟩ + have hcontract : 2 * (summary (k :: lows)).offset ≤ + (summary (k :: lows)).sc * (3 * (summary (k :: lows)).added + 2 * (r * gm) + 6):= by + have hgood_lows : ∀ bk ∈ qw lows,Block.good bk:= by + intro bk hbk + rcases List.mem_map.mp hbk with ⟨z,hz_mem,rfl⟩ + exact WordLink.continuing_good z (hlow z hz_mem).1 + have hwc:=Block.word_contraction (Bridge.kernel k.pair) (qw lows) + (WordLink.continuing_good k hk) hgood_lows + try dsimp -failIfUnchanged only at hwc + rw [qca] at hwc + change 2 * (summary (k :: lows)).offset ≤ + (summary (k :: lows)).sc * (3 * (summary (k :: lows)).added + + 2 * (Block.identity.added + qD gain lows) + 6) at hwc + dsimp -failIfUnchanged [Block.identity] at hwc + nlinarith + refine ⟨qD depth (k :: lows),⟨hd0,hDfull⟩,hQ,⟨hA,hAs⟩,⟨hC,?_⟩,hMbound,hcontract⟩ + nlinarith +end WordBlocks +namespace Multiscale +open WordLibrary WordBlocks +def qC (L d g : ℤ) : Prop := + ∀ k,continuing k → k.index ≤ L → depth k ≤ d ∧ gain k ≤ g +theorem low_split (m : ℤ) (word : List kernel) : + ∃ lows tail,word=lows ++ tail ∧ + (∀ k ∈ lows,k.index ≤ m) ∧ + (tail=[] ∨ ∃ k rest,tail=k :: rest ∧ m < k.index):= by + induction word with + | nil => + exact ⟨[],[],rfl,by simp,Or.inl rfl⟩ + | cons k word ih => + by_cases hlow : k.index ≤ m + · rcases ih with ⟨lows,tail,heq,hall,htail⟩ + refine ⟨k :: lows,tail,by simp [heq],?_,htail⟩ + intro x hx + rcases List.mem_cons.mp hx with rfl | hx' + · exact hlow + · exact hall x hx' + · refine ⟨[],k :: word,rfl,by simp,Or.inr ⟨k,word,rfl,by omega⟩⟩ +theorem qc9 (m L dm gm : ℤ) (lows : List kernel) + (hparams : qC m dm gm) + (hall : ∀ k ∈ lows,continuing k ∧ k.index ≤ L) + (hlow : ∀ k ∈ lows,k.index ≤ m) : + ∀ k ∈ lows,continuing k ∧ k.index ≤ m ∧ depth k ≤ dm ∧ gain k ≤ gm:= by + intro k hk + have h1:=hall k hk + have h2:=hlow k hk + have h3:=hparams k h1.1 h2 + exact ⟨h1.1,h2,h3.1,h3.2⟩ +theorem qco (m L r : ℤ) (lows : List kernel) (S U : ℤ) + (hb : WordLink.bound m r) + (hall : ∀ k ∈ lows,continuing k ∧ k.index ≤ L) + (hlow : ∀ k ∈ lows,k.index ≤ m) + (htrace : trace lows S U) : + (lows.length : ℤ) ≤ r:= by + exact hb lows S U (fun k hk => ⟨(hall k hk).1,hlow k hk⟩) htrace +theorem qcg (m L r dL dm gL gm : ℤ) + (hm : 0 ≤ m) (hr : 0 ≤ r) (hdm : 0 ≤ dm) (hgm : 0 ≤ gm) + (hglobal : qC L dL gL) (hlow : qC m dm gm) (hbound : WordLink.bound m r) : + ∀ (fuel : ℕ) (k : kernel) (rest : List kernel) (S U : ℤ), + (k :: rest).length ≤ fuel → m < k.index → + (∀ z ∈ (k :: rest),continuing z ∧ z.index ≤ L) → + trace (k :: rest) S U → + ∃ zs,HighPath.path m (dL + r * dm) (gL + r * gm) (r * gm) zs S (2 * S - U + 3) ∧ + ((k :: rest).length : ℤ) ≤ (r + 1) * ((zs.length : ℤ) + 1):= by + intro fuel + induction fuel with + | zero => + intro k rest S U hfuel + simp at hfuel + | succ fuel ih => + intro k rest Sa Ua hfuel hhigh hall htrace + rcases low_split m rest with ⟨lows,tail,hsplit,hindices,htail⟩ + subst hsplit + have hk : continuing k ∧ k.index ≤ L:=hall k (by simp) + have hlows : ∀ z ∈ lows,continuing z ∧ z.index ≤ L := + fun z hz => hall z (by simp [hz]) + have htailall : ∀ z ∈ tail,continuing z ∧ z.index ≤ L := + fun z hz => hall z (by simp [hz]) + cases htrace with + | trace_cons hfirst hafter => + rename_i S1 U1 + have hlowtrace : trace lows S1 U1:=qbl lows tail S1 U1 hafter + have hlen : (lows.length : ℤ) ≤ r := + qco m L r lows S1 U1 hbound hlows hindices hlowtrace + have hdiv : q0 (m + 1) ∣ (2 * Sa - Ua + 3) := + high_div m k (lows ++ tail) Sa Ua hm hhigh (trace.trace_cons hfirst hafter) + rcases htail with rfl | ⟨k',rest',rfl,hhigh'⟩ + · refine ⟨[],HighPath.path.path_stop Sa (2 * Sa - Ua + 3) hdiv,?_⟩ + simp only [List.append_nil,List.length_cons,List.length_nil] + push_cast + omega + · have htr_full : trace ((k :: lows) ++ (k' :: rest')) Sa Ua:= by + simpa using! trace.trace_cons hfirst hafter + rcases trace_split (k :: lows) (k' :: rest') Sa Ua htr_full with + ⟨Sb,Ub,hcalls,hresttrace⟩ + have hfuel' : (k' :: rest').length ≤ fuel:= by + simp only [List.length_cons,List.length_append] at hfuel ⊢ + omega + rcases ih k' rest' Sb Ub hfuel' hhigh' htailall hresttrace with + ⟨zs,hpath,hcount⟩ + refine ⟨summary (k :: lows) :: zs,?_,?_⟩ + · rcases summary_sound (k :: lows) Sa Ua Sb Ub hcalls with ⟨hS,hH⟩ + subst hS + rcases hglobal k hk.1 hk.2 with ⟨hd,hg⟩ + have hcert:=qbX m r dL dm gL gm k lows S1 U1 + hm hr hdm hgm hhigh hk.1 hd hg + (qc9 m L dm gm lows hlow hlows hindices) hlowtrace hbound + exact HighPath.path.path_step (summary (k :: lows)) zs Sa + (2 * Sa - Ua + 3) (2 * (Sa + (summary (k :: lows)).added) - Ub + 3) + hdiv hcert ⟨rfl,hH⟩ hpath + · simp only [List.length_cons,List.length_append] at hcount ⊢ + push_cast at hcount ⊢ + linarith +theorem qcr (m L r dL dm gL gm : ℤ) (t q : ℕ) + (hm : 0 < m) (hr : 0 ≤ r) (hdm : 0 ≤ dm) (hgm : 0 ≤ gm) (hgL : 0 ≤ gL) + (hglobal : qC L dL gL) (hlow : qC m dm gm) (hbound : WordLink.bound m r) + (hbudget : q0 (2 * (dL + r * dm)) * (12 * (gL + r * gm) + 8) < q0 (m + 1)) + (hpow : 2 * (gL + r * gm) + 2 ≤ (3 : ℤ) ^ t) + (hq : r * gm + 4 ≤ (q : ℤ) * m) : + WordLink.bound L ((r + 1) * ((t : ℤ) + (q : ℤ) + 2) + r):= by + intro word S U hall htrace + rcases low_split m word with ⟨lows,tail,rfl,hindices,htail⟩ + have hlows : ∀ z ∈ lows,continuing z ∧ z.index ≤ L := + fun z hz => hall z (by simp [hz]) + have htailall : ∀ z ∈ tail,continuing z ∧ z.index ≤ L := + fun z hz => hall z (by simp [hz]) + have hlowtrace : trace lows S U:=qbl lows tail S U htrace + have hlen : (lows.length : ℤ) ≤ r := + qco m L r lows S U hbound hlows hindices hlowtrace + rcases htail with rfl | ⟨k,rest,rfl,hhigh⟩ + · simp only [List.append_nil] + have : 0 ≤ (r + 1) * ((t : ℤ) + (q : ℤ) + 2):= by positivity + linarith + · rcases WordLink.trace_suffix lows (k :: rest) S U htrace with ⟨S',U',hsuffix⟩ + rcases qcg m L r dL dm gL gm (by omega) hr hdm hgm hglobal hlow hbound + (k :: rest).length k rest S' U' (le_refl _) hhigh htailall hsuffix with + ⟨zs,hpath,hcount⟩ + have hhighcount : zs.length < t + q + 1 := + HighPath.path_count m (dL + r * dm) (gL + r * gm) (r * gm) zs S' (2 * S' - U' + 3) + t q hm (by positivity) (by positivity) hpow hq hbudget hpath + simp only [List.length_append] + push_cast + have hzs : (zs.length : ℤ) + 1 ≤ (t : ℤ) + (q : ℤ) + 1:= by omega + have hmul : (r + 1) * ((zs.length : ℤ) + 1) ≤ (r + 1) * ((t : ℤ) + (q : ℤ) + 1) := + mul_le_mul_of_nonneg_left hzs (by omega) + linarith +end Multiscale +namespace SmallScale +open WordLibrary WordBlocks Multiscale +theorem qbZ : qC 2048 5 5472:= by + intro k hk hL + exact WordCheck.kernel_bounds k hk hL +theorem earlier_parameters (k L : ℤ) (hL : 1 ≤ L ∧ L < k) (hprev : Closure.earlier k) : + qC L (6 * q1 L + 9) (12 * L ^ 3 + 3):= by + intro z hcont hindex + rcases hcont with ⟨e,hb,hs,_⟩ + exact Closure.kernel_bounds k L hL hprev z.index z.pair e ⟨hs,hindex⟩ hb +theorem exp3 (x : ℤ) (hx : 0 ≤ x) : q0 (3 * x)=(q0 x) ^ 3:= by + have h1 : 3 * x=x + (x + x):= by ring + rw [h1,q5 hx (by omega),q5 hx hx] + ring +theorem qao (L x : ℤ) (hL : 2048 < L) (hx : 12 ≤ x) (hpow : L ≤ q0 x) : + 12 * L ^ 3 + 3 + 6 * 5472 ≤ 13 * q0 (3 * x):= by + have hL3 : L ^ 3 ≤ (q0 x) ^ 3:=pow_le_pow_left₀ (by omega) hpow 3 + have hsmall : 65536 ≤ q0 (3 * x):= by + have h16 : (65536 : ℤ)=q0 16:= by decide + rw [h16] + exact qd (by omega) (by omega) + rw [exp3 x (by omega)] at hsmall ⊢ + linarith +theorem budget120 (x M : ℤ) (hx : 12 ≤ x ∧ x ≤ 120) (hM : 0 ≤ M ∧ M ≤ 13 * q0 (3 * x)) : + q0 (2 * (6 * x + 39)) * (12 * M + 8) < q0 2049:= by + have hp : 0 < q0 (3 * x):=qc (by omega) + have hB : 12 * M + 8 < q0 (3 * x + 8):= by + rw [q5 (by omega) (by omega)] + have h8 : q0 8=256:= by decide + rw [h8] + linarith + have hbig : q0 (2 * (6 * x + 39)) * (12 * M + 8) < q0 (15 * x + 86):= by + have heq : 15 * x + 86=2 * (6 * x + 39) + (3 * x + 8):= by ring + rw [heq,q5 (by omega) (by omega)] + exact mul_lt_mul_of_pos_left hB (qc (by omega)) + exact lt_trans hbig (qbm (by omega) (by omega)) +theorem qa4 (x M : ℤ) (hx : 0 ≤ x) (hM : 0 ≤ M ∧ M ≤ 13 * q0 (3 * x)) : + 2 * M + 2 ≤ (3 : ℤ) ^ (2 * x + 4).toNat:= by + let n : ℕ:=x.toNat + have hxn : x=(n : ℤ):=(Int.toNat_of_nonneg hx).symm + have h2x4 : (2 * x + 4).toNat=2 * n + 4:= by omega + rw [h2x4] + have hpow8 : q0 (3 * x)=(8 : ℤ) ^ n:= by + rw [hxn,qe (by omega)] + have h3n : (3 * (n : ℤ)).toNat=3 * n:= by omega + rw [h3n,pow_mul] + norm_num + have hpow9 : (3 : ℤ) ^ (2 * n + 4)=81 * (9 : ℤ) ^ n:= by + rw [pow_add,pow_mul] + norm_num + ring + have h89 : (8 : ℤ) ^ n ≤ (9 : ℤ) ^ n:= by + gcongr + norm_num + have h8pos : 1 ≤ (8 : ℤ) ^ n:=one_le_pow₀ (by norm_num) + rw [hpow8] at hM + rw [hpow9] + linarith +theorem range120 (L : ℤ) (hL : 2 ≤ L ∧ L ≤ q0 120) + (hparams : qC L (6 * q1 L + 9) (12 * L ^ 3 + 3)) : + WordLink.bound L (30 * q1 L):= by + by_cases hsmall : L ≤ 2048 + · apply WordLink.bound_mono 2048 L 6 (30 * q1 L) hsmall _ WordLink.base_bound + have hlog : 1 ≤ q1 L:= by + have h1 : q1 2 ≤ q1 L:=qt hL.1 + have h2 : q1 2=1:= by decide + omega + omega + · push Not at hsmall + set x:=q1 L + have hx : 12 ≤ x ∧ x ≤ 120:= by + constructor + · have hp11 : (2048 : ℤ)=q0 11:= by decide + by_contra hlt + have hle:=(qm (by omega : 0 < L) (by omega : 0 ≤ (11 : ℤ))).mpr (by omega : x ≤ 11) + omega + · exact (qm (by omega) (by omega)).mp hL.2 + have hLpow : L ≤ q0 x:=(qy (by omega)).2 + have hL0 : 0 ≤ L:= by omega + have hL3_nonneg : 0 ≤ L ^ 3:= by positivity + have hM : 0 ≤ 12 * L ^ 3 + 3 + 6 * 5472 ∧ 12 * L ^ 3 + 3 + 6 * 5472 ≤ 13 * q0 (3 * x) := + ⟨by linarith,qao L x hsmall hx.1 hLpow⟩ + have hbudget : q0 (2 * (6 * x + 9 + 6 * 5)) * (12 * (12 * L ^ 3 + 3 + 6 * 5472) + 8) < q0 (2048 + 1):= by + have heq : 6 * x + 9 + 6 * 5=6 * x + 39:= by ring + rw [heq] + exact budget120 x (12 * L ^ 3 + 3 + 6 * 5472) hx hM + have htime : 2 * (12 * L ^ 3 + 3 + 6 * 5472) + 2 ≤ (3 : ℤ) ^ (2 * x + 4).toNat := + qa4 x (12 * L ^ 3 + 3 + 6 * 5472) (by omega) hM + have hlift:=qcr 2048 L 6 (6 * x + 9) 5 (12 * L ^ 3 + 3) 5472 + (2 * x + 4).toNat 17 (by omega) (by omega) (by omega) (by omega) (by linarith) + hparams qbZ WordLink.base_bound hbudget htime (by omega) + apply WordLink.bound_mono L L ((6 + 1) * (((2 * x + 4).toNat : ℤ) + (17 : ℕ) + 2) + 6) (30 * x) + (le_refl L) _ hlift + have htoNat : ((2 * x + 4).toNat : ℤ)=2 * x + 4:=Int.toNat_of_nonneg (by omega) + rw [htoNat] + push_cast + omega +end SmallScale +namespace Exponential +theorem power_ratio (a b : ℤ) (p : ℕ) (c : ℤ) + (hab : 0 < b ∧ b ≤ a) (hc : 0 ≤ c) (hbase : (b + 1) ^ p ≤ c * b ^ p) : + (a + 1) ^ p ≤ c * a ^ p:= by + have hb0 : 0 ≤ b:= by omega + have ha0 : 0 ≤ a:= by omega + have h1 : b * (a + 1) ≤ (b + 1) * a:= by nlinarith + have h2 : (b * (a + 1)) ^ p ≤ ((b + 1) * a) ^ p := + pow_le_pow_left₀ (by positivity) h1 p + rw [mul_pow,mul_pow] at h2 + have ha_nonneg : 0 ≤ a ^ p:= by positivity + have hb_pos : 0 < b ^ p:= by have : 0 < b:=hab.1; positivity + have h3 : (b + 1) ^ p * a ^ p ≤ (c * b ^ p) * a ^ p := + mul_le_mul_of_nonneg_right hbase ha_nonneg + nlinarith +theorem qO (K c : ℤ) (p : ℕ) (start slope : ℤ) + (hK : 0 ≤ K) (hstart0 : 0 ≤ start) (hstart : 0 < start + c) (hslope : 0 ≤ slope) + (hratio : (start + c + 1) ^ p ≤ q0 slope * (start + c) ^ p) + (hbase : K * (start + c) ^ p < q0 (slope * start)) : + ∀ n,start ≤ n → K * (n + c) ^ p < q0 (slope * n):= by + have hall : ∀ i : ℕ,K * (start + (i : ℤ) + c) ^ p < q0 (slope * (start + (i : ℤ))):= by + intro i + induction i with + | zero => + simpa using! hbase + | succ i ih => + push_cast + have heq1 : start + ((i : ℤ) + 1) + c=(start + (i : ℤ) + c) + 1:= by ring + have heq2 : slope * (start + ((i : ℤ) + 1))=slope * (start + (i : ℤ)) + slope:= by ring + rw [heq1,heq2,q5 (by nlinarith) hslope] + have hstep : (start + (i : ℤ) + c + 1) ^ p ≤ q0 slope * (start + (i : ℤ) + c) ^ p := + power_ratio (start + (i : ℤ) + c) (start + c) p (q0 slope) + ⟨hstart,by omega⟩ (qs slope) hratio + have hscaled : K * (start + (i : ℤ) + c + 1) ^ p ≤ K * (q0 slope * (start + (i : ℤ) + c) ^ p) := + mul_le_mul_of_nonneg_left hstep hK + have hpos : 0 < q0 slope:=qc hslope + nlinarith + intro n hn + have hdecomp : n=start + ((n - start).toNat : ℤ):= by omega + rw [hdecomp] + exact hall (n - start).toNat +theorem square_tail (n : ℤ) (hn : 20 ≤ n) : 1024 * (n + 8) ^ 2 < q0 n:= by + have h:=qO 1024 8 2 20 1 (by omega) (by omega) (by omega) (by omega) + (by decide) (by decide) n hn + simpa using! h +theorem fifth_tail (n : ℤ) (hn : 114 ≤ n) : q0 70 * (n + 8) ^ 5 < q0 n:= by + have h:=qO (q0 70) 8 5 114 1 (qs 70) (by omega) (by omega) (by omega) + (by decide) (by decide) n hn + simpa using! h +theorem eighth_tail (n : ℤ) (hn : 114 ≤ n) : q0 84 * (n + 8) ^ 8 < q0 (2 * n):= by + exact qO (q0 84) 8 8 114 2 (qs 84) (by omega) (by omega) (by omega) + (by decide) (by decide) n hn +set_option exponentiation.threshold 2048 in +theorem final_tail (n : ℤ) (hn : 1024 ≤ n) : q0 70 * (n + 1) ^ 5 < q0 (n - 1):= by + have h:=qO (q0 71) 1 5 1024 1 (qs 71) (by omega) (by omega) (by omega) + (by decide) (by decide) n hn + rw [one_mul,Table.pow_split (by omega : (0 : ℤ) ≤ 1) (by omega : 1 ≤ n)] at h + have h1 : q0 1=2:= by decide + have h71 : q0 71=2 * q0 70:= by decide + rw [h1,h71] at h + linarith +theorem final_square (n : ℤ) (hn : 17 ≤ n) : 200 * n ^ 2 < q0 (n - 1):= by + have h:=qO 400 0 2 17 1 (by omega) (by omega) (by omega) (by omega) + (by decide) (by decide) n hn + rw [add_zero,one_mul,Table.pow_split (by omega : (0 : ℤ) ≤ 1) (by omega : 1 ≤ n)] at h + have h1 : q0 1=2:= by decide + rw [h1] at h + linarith +end Exponential +namespace LargeStep +open WordLibrary WordBlocks Multiscale +theorem lin_lt_pow2 (n : ℤ) (hn : 0 ≤ n) : n < q0 n:= by + have h:=qbP n.toNat + rwa [Int.toNat_of_nonneg hn] at h +theorem qao (L m x r : ℤ) + (hx : 3 ≤ x) (hm : 2 ≤ m ∧ m ≤ L) (hL : L ≤ q0 x) (hr : 0 ≤ r) : + 0 ≤ 12 * L ^ 3 + 3 + r * (12 * m ^ 3 + 3) ∧ + 12 * L ^ 3 + 3 + r * (12 * m ^ 3 + 3) ≤ 13 * (r + 1) * q0 (3 * x):= by + have hmL : m ^ 3 ≤ L ^ 3:=pow_le_pow_left₀ (by omega) hm.2 3 + have hLP : L ^ 3 ≤ (q0 x) ^ 3:=pow_le_pow_left₀ (by omega) hL 3 + have hm0 : 0 ≤ m:= by omega + have hm3 : 0 ≤ m ^ 3:= by positivity + have hP : 8 ≤ q0 (3 * x):= by + have h8 : (8 : ℤ)=q0 3:= by decide + rw [h8] + exact qd (by omega) (by omega) + rw [SmallScale.exp3 x (by omega)] at hP ⊢ + constructor + · nlinarith + · nlinarith +theorem budget (m x y r M : ℤ) + (hx : 3 ≤ x) (hy : 0 ≤ y) (hr : 1 ≤ r) + (hM : 0 ≤ M ∧ M ≤ 13 * (r + 1) * q0 (3 * x)) + (hbudget : 15 * x + 27 + 2 * r * (6 * y + 9) + r ≤ m + 1) : + q0 (2 * (6 * x + 9 + r * (6 * y + 9))) * (12 * M + 8) < q0 (m + 1):= by + have hrpow : r + 1 < q0 (r + 1):=lin_lt_pow2 (r + 1) (by omega) + have hP : 0 < q0 (3 * x):=qc (by omega) + have hE : q0 (3 * x + 8 + (r + 1))=256 * q0 (3 * x) * q0 (r + 1):= by + rw [q5 (by omega) (by omega),q5 (by omega) (by omega)] + have h8 : q0 8=256:= by decide + rw [h8] + ring + have hMpow : 12 * M + 8 < q0 (3 * x + 8 + (r + 1)):= by + rw [hE] + nlinarith + have hstep : q0 (2 * (6 * x + 9 + r * (6 * y + 9))) * (12 * M + 8) < + q0 (15 * x + 27 + 2 * r * (6 * y + 9) + r):= by + have heq : 15 * x + 27 + 2 * r * (6 * y + 9) + r = + 2 * (6 * x + 9 + r * (6 * y + 9)) + (3 * x + 8 + (r + 1)):= by ring + rw [heq,q5 (by nlinarith) (by omega)] + exact mul_lt_mul_of_pos_left hMpow (qc (by nlinarith)) + exact lt_of_lt_of_le hstep (qd (by nlinarith) hbudget) +theorem qa4 (x r M : ℤ) + (hx : 3 ≤ x) (hr : 1 ≤ r) (hrpow : r + 1 ≤ q0 x) + (hM : 0 ≤ M ∧ M ≤ 13 * (r + 1) * q0 (3 * x)) : + 2 * M + 2 ≤ (3 : ℤ) ^ (4 * x).toNat:= by + have hE : q0 (4 * x)=q0 x * q0 (3 * x):= by + have heq : 4 * x=x + 3 * x:= by ring + rw [heq,q5 (by omega) (by omega)] + have hMpow : 2 * M + 2 ≤ 28 * q0 (4 * x):= by + rw [hE] + have hpx : 0 < q0 x:=qc (by omega) + have hp3x : 0 < q0 (3 * x):=qc (by omega) + nlinarith + let n : ℕ:=x.toNat + have hxn : x=(n : ℤ):=(Int.toNat_of_nonneg (by omega)).symm + have hn3 : 3 ≤ n:= by omega + have h4x : (4 * x).toNat=4 * n:= by omega + rw [h4x] + have hpow16 : q0 (4 * x)=(16 : ℤ) ^ n:= by + rw [hxn,qe (by omega)] + have h4n : (4 * (n : ℤ)).toNat=4 * n:= by omega + rw [h4n,pow_mul] + norm_num + have hpow81 : (3 : ℤ) ^ (4 * n)=(81 : ℤ) ^ n:= by + rw [pow_mul] + norm_num + have h4_ge : (64 : ℤ) ≤ (4 : ℤ) ^ n:= by + have h64 : (64 : ℤ)=(4 : ℤ) ^ 3:= by norm_num + rw [h64] + exact pow_le_pow_right₀ (by norm_num) hn3 + have h64_81 : (64 : ℤ) ^ n ≤ (81 : ℤ) ^ n:= by + gcongr + norm_num + have hmul64 : (4 : ℤ) ^ n * (16 : ℤ) ^ n=(64 : ℤ) ^ n:= by + rw [← mul_pow] + norm_num + have h16_pos : 0 < (16 : ℤ) ^ n:= by positivity + rw [hpow16] at hMpow + rw [hpow81] + nlinarith +theorem qbQ (r x m : ℤ) (hr : 1 ≤ r) (hm : 2 ≤ m) (hx : x ≤ m ^ 2) : + (r + 1) * (4 * x + 13 * r * m ^ 2 + 2) + r ≤ 64 * (r + 1) ^ 2 * m ^ 2:= by + have h1 : (r + 1) * (4 * x + 13 * r * m ^ 2 + 2) ≤ (r + 1) * (4 * m ^ 2 + 13 * r * m ^ 2 + 2) := + mul_le_mul_of_nonneg_left (by linarith) (by omega) + have hm2 : 1 ≤ m ^ 2:= by nlinarith + nlinarith +theorem lift (m L x y r : ℤ) + (hx : 3 ≤ x) (hy : 0 ≤ y) (hm : 2 ≤ m ∧ m ≤ L) (hr : 1 ≤ r) + (hL : L ≤ q0 x) (hsquare : x ≤ m ^ 2) + (hparams : qC L (6 * x + 9) (12 * L ^ 3 + 3)) + (hlow : qC m (6 * y + 9) (12 * m ^ 3 + 3)) + (hbound : WordLink.bound m r) + (hbudget : 15 * x + 27 + 2 * r * (6 * y + 9) + r ≤ m + 1) : + WordLink.bound L (64 * (r + 1) ^ 2 * m ^ 2):= by + have hM:=qao L m x r hx hm hL (by omega) + have hexp:=budget m x y r (12 * L ^ 3 + 3 + r * (12 * m ^ 3 + 3)) hx hy hr hM hbudget + have hrpow : r + 1 ≤ q0 x:= by + have hnonneg : 0 ≤ 2 * r * (6 * y + 9):= by positivity + omega + have htime:=qa4 x r (12 * L ^ 3 + 3 + r * (12 * m ^ 3 + 3)) hx hr hrpow hM + have hq : r * (12 * m ^ 3 + 3) + 4 ≤ (13 * r * m ^ 2) * m:= by + have hm2 : 2 * m ^ 2 ≤ m ^ 3:= by nlinarith [sq_nonneg m] + nlinarith + have hm0 : 0 ≤ m:= by omega + have hL0 : 0 ≤ L:= by omega + have hq0 : 0 ≤ 13 * r * m ^ 2:= by positivity + have h4x_eq : ((4 * x).toNat : ℤ)=4 * x:=Int.toNat_of_nonneg (by omega) + have hq_eq : ((13 * r * m ^ 2).toNat : ℤ)=13 * r * m ^ 2:=Int.toNat_of_nonneg hq0 + have hq' : r * (12 * m ^ 3 + 3) + 4 ≤ ((13 * r * m ^ 2).toNat : ℤ) * m:= by + rw [hq_eq]; exact hq + have hm3 : 0 ≤ m ^ 3:= by positivity + have hL3 : 0 ≤ L ^ 3:= by positivity + have hlift:=qcr m L r (6 * x + 9) (6 * y + 9) (12 * L ^ 3 + 3) (12 * m ^ 3 + 3) + (4 * x).toNat (13 * r * m ^ 2).toNat (by omega) (by omega) (by omega) + (by linarith) (by linarith) hparams hlow hbound hexp htime hq' + apply WordLink.bound_mono L L + ((r + 1) * (((4 * x).toNat : ℤ) + ((13 * r * m ^ 2).toNat : ℤ) + 2) + r) + (64 * (r + 1) ^ 2 * m ^ 2) (le_refl L) _ hlift + rw [h4x_eq,hq_eq] + exact qbQ r x m hr hm.1 hsquare +end LargeStep +namespace ScaleNumbers +theorem threshold (x : ℤ) (hx : 121 ≤ x) : q0 20 + 32 * x < q0 (x - 1):= by + have h:=Exponential.final_square x (by omega) + have h20 : q0 20=1048576:= by decide + nlinarith +theorem subscale (x : ℤ) (hx : 121 ≤ x) : + (20 ≤ q1 (q0 20 + 32 * x) ∧ q1 (q0 20 + 32 * x) ≤ x) ∧ + q0 20 + 32 * x ≤ q0 14 * x ∧ x ≤ (q0 20 + 32 * x) ^ 2:= by + have ht:=threshold x hx + have h20 : q0 20=1048576:= by decide + have h14 : q0 14=16384:= by decide + refine ⟨⟨?_,?_⟩,?_,?_⟩ + · have h:=qt (by omega : q0 20 ≤ q0 20 + 32 * x) + rw [qar (by omega)] at h + exact h + · apply (qm (by omega) (by omega)).mp + have hmono:=qd (by omega : 0 ≤ x - 1) (by omega : x - 1 ≤ x) + linarith + · rw [h20,h14]; omega + · nlinarith +theorem small_window (x : ℤ) (hx : 121 ≤ x ∧ x ≤ q0 20) : + q1 (q0 20 + 32 * x) ≤ 26:= by + have h20 : q0 20=1048576:= by decide + have h26 : q0 26=67108864:= by decide + apply (qm (by omega) (by omega)).mp + omega +theorem large_window (x : ℤ) (hx : q0 20 < x) : + 20 ≤ qH x ∧ + (q0 (qH x) ≤ x ∧ x < q0 (qH x + 1)) ∧ + q1 (q0 20 + 32 * x) ≤ qH x + 7 ∧ + q0 20 + 32 * x ≤ 64 * x:= by + have h20 : q0 20=1048576:= by decide + have hpow:=qag (by omega : 0 < x) + have hn : 20 ≤ qH x:= by + have h:=qas (le_of_lt hx) + rw [qck (by omega)] at h + exact h + refine ⟨hn,hpow,?_,by omega⟩ + apply (qm (by omega) (by omega)).mp + rw [Table.pow_split (by omega : (0 : ℤ) ≤ 6) (by omega : 6 ≤ qH x + 7)] + have h6 : q0 6=64:= by decide + have heq : qH x + 7 - 6=qH x + 1:= by ring + rw [h6,heq] + omega +theorem huge_window (x : ℤ) (hm : q0 120 < q0 20 + 32 * x) : + q0 114 < x ∧ 114 ≤ qH x:= by + have hfixed : q0 20 + 32 * q0 114 < q0 120:= by decide + have hx : q0 114 < x:= by linarith + refine ⟨hx,?_⟩ + have h:=qas (le_of_lt hx) + rw [qck (by omega)] at h + exact h +theorem qak (y n : ℤ) (hy : 0 ≤ y ∧ y ≤ n + 7) (hn : 0 ≤ n) : + 27 + 2 * (30 * y) * (6 * y + 9) + 30 * y ≤ 1024 * (n + 8) ^ 2:= by + nlinarith +theorem small_budget (x : ℤ) (hx : 121 ≤ x) : + let y:=q1 (q0 20 + 32 * x) + 15 * x + 27 + 2 * (30 * y) * (6 * y + 9) + 30 * y ≤ q0 20 + 32 * x + 1:= by + rcases subscale x hx with ⟨hy,_⟩ + try dsimp -failIfUnchanged only + have h20 : q0 20=1048576:= by decide + by_cases hsmall : x ≤ q0 20 + · have hsw:=small_window x ⟨hx,hsmall⟩ + have hpoly:=qak (q1 (q0 20 + 32 * x)) 19 ⟨by omega,by omega⟩ (by omega) + omega + · push Not at hsmall + rcases large_window x hsmall with ⟨hn,⟨hpow1,hpow2⟩,hyn,hm⟩ + have hpoly:=qak (q1 (q0 20 + 32 * x)) (qH x) ⟨by omega,hyn⟩ (by omega) + have htail:=Exponential.square_tail (qH x) hn + linarith +theorem qbb (y : ℤ) (hy : 0 ≤ y) : + 27 + 2 * (q0 64 * (y + 1) ^ 4) * (6 * y + 9) + q0 64 * (y + 1) ^ 4 ≤ + q0 70 * (y + 1) ^ 5:= by + have hP : 1 ≤ (y + 1) ^ 4:=one_le_pow₀ (by omega) + have hy4y : 0 ≤ (y + 1) ^ 4 * y:= by positivity + have h64_ge : (27 : ℤ) ≤ q0 64:= by decide + have heq : q0 70 * (y + 1) ^ 5=64 * q0 64 * ((y + 1) ^ 4 * y) + 64 * q0 64 * (y + 1) ^ 4:= by + have h70 : q0 70=64 * q0 64:= by decide + rw [h70] + ring + have heq2 : 27 + 2 * (q0 64 * (y + 1) ^ 4) * (6 * y + 9) + q0 64 * (y + 1) ^ 4 = + 27 + 12 * q0 64 * ((y + 1) ^ 4 * y) + 19 * q0 64 * (y + 1) ^ 4:= by ring + rw [heq,heq2] + have hp64 : 0 < q0 64:=qc (by omega) + nlinarith +theorem large_budget (x : ℤ) (hx : 121 ≤ x) (hm : q0 120 < q0 20 + 32 * x) : + let y:=q1 (q0 20 + 32 * x) + 15 * x + 27 + 2 * (q0 64 * (y + 1) ^ 4) * (6 * y + 9) + q0 64 * (y + 1) ^ 4 ≤ + q0 20 + 32 * x + 1:= by + try dsimp -failIfUnchanged only + have hp20 : 0 ≤ q0 20:=qs 20 + rcases huge_window x hm with ⟨hxlarge,hn⟩ + have h20 : q0 20 < x:= by + have hmono : q0 20 ≤ q0 114:=qd (by omega) (by omega) + omega + rcases large_window x h20 with ⟨_,⟨hpow1,hpow2⟩,hy,_⟩ + have hy0:=qh (q0 20 + 32 * x) + have hpoly:=qbb (q1 (q0 20 + 32 * x)) hy0 + have hmono : (q1 (q0 20 + 32 * x) + 1) ^ 5 ≤ (qH x + 8) ^ 5 := + pow_le_pow_left₀ (by omega) (by omega) 5 + have htail:=Exponential.fifth_tail (qH x) hn + have hpow70_mono : q0 70 * (q1 (q0 20 + 32 * x) + 1) ^ 5 ≤ q0 70 * (qH x + 8) ^ 5 := + mul_le_mul_of_nonneg_left hmono (qs 70) + linarith +theorem qaE (a A b B : ℤ) (ha : 0 ≤ a ∧ a ≤ A) (hb : 0 ≤ b ∧ b ≤ B) : + 64 * a ^ 2 * b ^ 2 ≤ 64 * A ^ 2 * B ^ 2:= by + have ha2 : a ^ 2 ≤ A ^ 2:=pow_le_pow_left₀ ha.1 ha.2 2 + have hb2 : b ^ 2 ≤ B ^ 2:=pow_le_pow_left₀ hb.1 hb.2 2 + have ha0 : 0 ≤ a ^ 2:=sq_nonneg a + have hA0 : 0 ≤ A ^ 2:=sq_nonneg A + have hmul : a ^ 2 * b ^ 2 ≤ A ^ 2 * B ^ 2:=mul_le_mul ha2 hb2 (sq_nonneg b) hA0 + linarith +theorem small_output (x y m : ℤ) + (hx : 121 ≤ x) (hy : 0 ≤ y ∧ y ≤ x) (hm : 0 ≤ m ∧ m ≤ q0 14 * x) : + 64 * (30 * y + 1) ^ 2 * m ^ 2 ≤ q0 64 * (x + 1) ^ 4:= by + have h:=qaE (30 * y + 1) (32 * x) m (q0 14 * x) ⟨by omega,by omega⟩ hm + have h14 : q0 14=16384:= by decide + have h44 : (64 : ℤ) * (32 * x) ^ 2 * (q0 14 * x) ^ 2=q0 44 * x ^ 4:= by + rw [h14] + have hp44 : q0 44=17592186044416:= by decide + rw [hp44] + ring + rw [h44] at h + have hx4 : x ^ 4 ≤ (x + 1) ^ 4:=pow_le_pow_left₀ (by omega) (by omega) 4 + have hx4_0 : 0 ≤ x ^ 4:= by positivity + have h44_64 : q0 44 ≤ q0 64:=qd (by omega) (by omega) + have hp64 : 0 ≤ q0 64:=qs 64 + nlinarith +theorem large_output (x y m n : ℤ) + (hx : 1 ≤ x) (hy : 0 ≤ y ∧ y ≤ n + 7) (hn : 114 ≤ n) + (hnx : q0 n ≤ x) (hm : 0 ≤ m ∧ m ≤ 64 * x) : + 64 * (q0 64 * (y + 1) ^ 4 + 1) ^ 2 * m ^ 2 ≤ q0 64 * (x + 1) ^ 4:= by + have hP : 1 ≤ (y + 1) ^ 4:=one_le_pow₀ (by omega) + have hp64_pos : 0 < q0 64:=qc (by omega) + have h65_eq : q0 65=2 * q0 64:= by decide + have h:=qaE (q0 64 * (y + 1) ^ 4 + 1) (q0 65 * (y + 1) ^ 4) m (64 * x) + ⟨by positivity,by rw [h65_eq]; nlinarith⟩ hm + have h148 : 64 * (q0 65 * (y + 1) ^ 4) ^ 2 * (64 * x) ^ 2=q0 148 * (y + 1) ^ 8 * x ^ 2:= by + have hp65 : q0 65=36893488147419103232:= by decide + have hp148 : q0 148=356811923176489970264571492362373784095686656:= by decide + rw [hp65,hp148] + ring + rw [h148] at h + have hy8 : (y + 1) ^ 8 ≤ (n + 8) ^ 8:=pow_le_pow_left₀ (by omega) (by omega) 8 + have htail:=Exponential.eighth_tail n hn + have hn2 : q0 (2 * n) ≤ x ^ 2:= by + have heq : 2 * n=n + n:= by ring + rw [heq,q5 (by omega) (by omega)] + have hpn:=qs n + nlinarith + have hp84 : 0 < q0 84:=qc (by omega) + have h8 : q0 84 * (y + 1) ^ 8 ≤ x ^ 2:= by nlinarith + have hstep : q0 148 * (y + 1) ^ 8 * x ^ 2 ≤ q0 64 * x ^ 4:= by + have hp148_split : q0 148=q0 64 * q0 84:= by decide + rw [hp148_split] + have hx2_0 : 0 ≤ x ^ 2:=sq_nonneg x + have h1 : q0 84 * (y + 1) ^ 8 * x ^ 2 ≤ x ^ 2 * x ^ 2 := + mul_le_mul_of_nonneg_right h8 hx2_0 + have h2 : q0 64 * (q0 84 * (y + 1) ^ 8 * x ^ 2) ≤ q0 64 * (x ^ 2 * x ^ 2) := + mul_le_mul_of_nonneg_left h1 (qs 64) + linarith [show q0 64 * (x ^ 2 * x ^ 2)=q0 64 * x ^ 4 by ring, + show q0 64 * (q0 84 * (y + 1) ^ 8 * x ^ 2)=q0 64 * q0 84 * (y + 1) ^ 8 * x ^ 2 by ring] + have hx4 : x ^ 4 ≤ (x + 1) ^ 4:=pow_le_pow_left₀ (by omega) (by omega) 4 + nlinarith +end ScaleNumbers +namespace GlobalBounds +theorem qcc (x : ℤ) (hx : 0 ≤ x) : 30 * x ≤ q0 64 * (x + 1) ^ 4:= by + have hpow : x + 1 ≤ (x + 1) ^ 4:= by + have h1 : 1 ≤ (x + 1) ^ 3:=one_le_pow₀ (by omega) + have h2 : (x + 1) * 1 ≤ (x + 1) * (x + 1) ^ 3:=mul_le_mul_of_nonneg_left h1 (by omega) + linarith [show (x + 1) * (x + 1) ^ 3=(x + 1) ^ 4 by ring] + have h64 : (30 : ℤ) ≤ q0 64:= by decide + nlinarith +theorem qae (k L : ℤ) (hprev : Closure.earlier k) (hL : 2 ≤ L ∧ L < k) + (ih : ∀ m,2 ≤ m ∧ m < L → WordLink.bound m (q0 64 * (q1 m + 1) ^ 4)) : + WordLink.bound L (q0 64 * (q1 L + 1) ^ 4):= by + have hparams:=SmallScale.earlier_parameters k L ⟨by omega,hL.2⟩ hprev + by_cases hsmall : L ≤ q0 120 + · exact WordLink.bound_mono L L (30 * q1 L) (q0 64 * (q1 L + 1) ^ 4) + (le_refl L) (qcc (q1 L) (qh L)) + (SmallScale.range120 L ⟨hL.1,hsmall⟩ hparams) + · push Not at hsmall + have hpow:=qy (by omega : 1 < L) + set x:=q1 L with hx_def + have hx : 121 ≤ x:= by + by_contra hle + push Not at hle + have:=(qm (by omega : 0 < L) (by omega : 0 ≤ (120 : ℤ))).mpr (by omega : x ≤ 120) + omega + have hth:=ScaleNumbers.threshold x hx + have hsub:=ScaleNumbers.subscale x hx + set m:=q0 20 + 32 * x with hm_def + have h20_val : q0 20=1048576:= by decide + have hm : 2 ≤ m ∧ m < L:=⟨by omega,by omega⟩ + have hmparams:=SmallScale.earlier_parameters k m ⟨by omega,by omega⟩ hprev + set y:=q1 m with hy_def + rcases hsub with ⟨hy,hm14,hxm⟩ + by_cases hmsmall : m ≤ q0 120 + · have hword:=SmallScale.range120 m ⟨hm.1,hmsmall⟩ hmparams + rw [← hy_def] at hword + have hsb:=ScaleNumbers.small_budget x hx + try dsimp -failIfUnchanged only at hsb + rw [← hm_def,← hy_def] at hsb + have hlift:=LargeStep.lift m L x y (30 * y) (by omega) (by omega) + ⟨hm.1,by omega⟩ (by omega) hpow.2 hxm hparams hmparams hword hsb + exact WordLink.bound_mono L L (64 * (30 * y + 1) ^ 2 * m ^ 2) (q0 64 * (x + 1) ^ 4) + (le_refl L) (ScaleNumbers.small_output x y m hx ⟨by omega,hy.2⟩ ⟨by omega,hm14⟩) hlift + · push Not at hmsmall + have hword:=ih m hm + rw [← hy_def] at hword + have hP : 1 ≤ (y + 1) ^ 4:=one_le_pow₀ (by omega) + have hp64_pos : 0 < q0 64:=qc (by omega) + have hr : 1 ≤ q0 64 * (y + 1) ^ 4:= by nlinarith + have hlb:=ScaleNumbers.large_budget x hx (by rwa [← hm_def]) + try dsimp -failIfUnchanged only at hlb + rw [← hm_def,← hy_def] at hlb + have hlift:=LargeStep.lift m L x y (q0 64 * (y + 1) ^ 4) (by omega) (by omega) + ⟨hm.1,by omega⟩ hr hpow.2 hxm hparams hmparams hword hlb + rcases ScaleNumbers.huge_window x (by rwa [← hm_def]) with ⟨hx114,hn⟩ + have hx20 : q0 20 < x:= by + have hmono : q0 20 ≤ q0 114:=qd (by omega) (by omega) + omega + have hlw:=ScaleNumbers.large_window x hx20 + rw [← hm_def,← hy_def] at hlw + rcases hlw with ⟨_,hnx,hyn,hm64⟩ + exact WordLink.bound_mono L L (64 * (q0 64 * (y + 1) ^ 4 + 1) ^ 2 * m ^ 2) + (q0 64 * (x + 1) ^ 4) (le_refl L) + (ScaleNumbers.large_output x y m (qH x) (by omega) ⟨by omega,hyn⟩ hn hnx.1 ⟨by omega,hm64⟩) + hlift +theorem quartic (k : ℤ) (hprev : Closure.earlier k) : + ∀ L,2 ≤ L ∧ L < k → WordLink.bound L (q0 64 * (q1 L + 1) ^ 4):= by + have hnat : ∀ n : ℕ,2 ≤ (n : ℤ) ∧ (n : ℤ) < k → + WordLink.bound (n : ℤ) (q0 64 * (q1 (n : ℤ) + 1) ^ 4):= by + intro n + induction n using Nat.strong_induction_on with + | h n ih => + intro hn + apply qae k (n : ℤ) hprev hn + intro m hm + have hm_eq : m=(m.toNat : ℤ):=(Int.toNat_of_nonneg (by omega)).symm + rw [hm_eq] + exact ih m.toNat (by omega) ⟨by omega,by omega⟩ + intro L hL + have hL_eq : L=(L.toNat : ℤ):=(Int.toNat_of_nonneg (by omega)).symm + rw [hL_eq] + exact hnat L.toNat ⟨by omega,by omega⟩ +end GlobalBounds +namespace FinalBudget +theorem qa2 (k : ℤ) (hk : 65536 < k) : + let x:=q1 k + 17 ≤ x ∧ (q0 (x - 1) < k ∧ k ≤ q0 x) ∧ + (2 ≤ 8 * x ∧ 8 * x < k) ∧ (0 ≤ q1 (8 * x) ∧ q1 (8 * x) ≤ x):= by + try dsimp -failIfUnchanged only + set x:=q1 k + have hx : 17 ≤ x:= by + have hp16 : (65536 : ℤ)=q0 16:= by decide + by_contra hlt + have hle:=(qm (by omega : 0 < k) (by omega : 0 ≤ (16 : ℤ))).mpr (by omega : x ≤ 16) + omega + have hpow:=qy (by omega : 1 < k) + have hsquare:=Exponential.final_square x hx + have hL : 2 ≤ 8 * x ∧ 8 * x < k:=⟨by omega,by nlinarith⟩ + refine ⟨hx,hpow,hL,qh (8 * x),?_⟩ + apply (qm (by omega) (by omega)).mp + have hmono:=qd (by omega : 0 ≤ x - 1) (by omega : x - 1 ≤ x) + nlinarith +theorem small_depth (x y : ℤ) (hx : 17 ≤ x) (hy : 0 ≤ y ∧ y ≤ x) : + 6 * x + 9 + (30 * y + 1) * (6 * y + 9) + 8 * x ≤ 200 * x ^ 2:= by + nlinarith +theorem qbz (x : ℤ) (hx : 0 ≤ x) : + 6 * x + 9 + (q0 64 * (x + 1) ^ 4 + 1) * (6 * x + 9) + 8 * x ≤ q0 70 * (x + 1) ^ 5:= by + have hP : 1 ≤ (x + 1) ^ 4:=one_le_pow₀ (by omega) + have hx4x : 0 ≤ (x + 1) ^ 4 * x:=mul_nonneg (pow_nonneg (by omega) 4) (by omega) + have h64_ge : (27 : ℤ) ≤ q0 64:= by decide + have heq : q0 70 * (x + 1) ^ 5=64 * q0 64 * ((x + 1) ^ 4 * x) + 64 * q0 64 * (x + 1) ^ 4:= by + have h70 : q0 70=64 * q0 64:= by decide + rw [h70] + ring + have heq2 : 6 * x + 9 + (q0 64 * (x + 1) ^ 4 + 1) * (6 * x + 9) + 8 * x = + 18 + 20 * x + 6 * q0 64 * ((x + 1) ^ 4 * x) + 9 * q0 64 * (x + 1) ^ 4:= by ring + rw [heq,heq2] + have hp64 : 0 < q0 64:=qc (by omega) + have hx_le : x ≤ (x + 1) ^ 4 * x:= by nlinarith + nlinarith +theorem large_depth (x y : ℤ) (hy : 0 ≤ y ∧ y ≤ x) : + 6 * x + 9 + (q0 64 * (y + 1) ^ 4 + 1) * (6 * y + 9) + 8 * x ≤ q0 70 * (x + 1) ^ 5:= by + have hP : (y + 1) ^ 4 ≤ (x + 1) ^ 4:=pow_le_pow_left₀ (by omega) (by omega) 4 + have hP0 : 0 ≤ (y + 1) ^ 4:=pow_nonneg (by omega) 4 + have hx0 : 0 ≤ (x + 1) ^ 4:=pow_nonneg (by omega) 4 + have hp64:=qs 64 + have hprod : (q0 64 * (y + 1) ^ 4 + 1) * (6 * y + 9) ≤ (q0 64 * (x + 1) ^ 4 + 1) * (6 * x + 9) := + mul_le_mul (by nlinarith) (by omega) (by omega) (by nlinarith) + have hpoly:=qbz x (by omega) + linarith +theorem mass_poly (k : ℤ) (hk : 3 ≤ k) : + 2 * (12 * k ^ 3 + k * (12 * k ^ 3 + 3)) + 3 < k ^ 8:= by + have hsmall : 2 * (12 * k ^ 3 + k * (12 * k ^ 3 + 3)) + 3 ≤ 40 * k ^ 4:= by + have hk0 : 0 ≤ k:= by omega + have hk3_0 : 0 ≤ k ^ 3:=pow_nonneg (by omega) 3 + have hk1 : 1 ≤ k ^ 3:=one_le_pow₀ (by omega) + have hkk3 : k ≤ k ^ 3:= by nlinarith [sq_nonneg k] + have hk34 : 3 * k ^ 3 ≤ k ^ 4:= by + have h1:=mul_le_mul_of_nonneg_right hk hk3_0 + linarith [show k * k ^ 3=k ^ 4 by ring] + linarith [show 2 * (12 * k ^ 3 + k * (12 * k ^ 3 + 3)) + 3=24 * k ^ 3 + 24 * k ^ 4 + 6 * k + 3 by ring] + have hpow : 81 ≤ k ^ 4:= by + have h81 : (81 : ℤ)=3 ^ 4:= by norm_num + rw [h81] + exact pow_le_pow_left₀ (by omega) hk 4 + have hbig : 40 * k ^ 4 < k ^ 8:= by + have heq : k ^ 8=k ^ 4 * k ^ 4:= by ring + rw [heq] + nlinarith + linarith +theorem qao (k L n : ℤ) (hk : 3 ≤ k) (hL : 0 ≤ L ∧ L ≤ k) (hn : 0 ≤ n ∧ n ≤ k) : + 2 * (12 * k ^ 3 + n * (12 * L ^ 3 + 3)) + 3 < k ^ 8:= by + have hLk3 : L ^ 3 ≤ k ^ 3:=pow_le_pow_left₀ hL.1 hL.2 3 + have hL3_0 : 0 ≤ L ^ 3:=pow_nonneg hL.1 3 + have hk3_0 : 0 ≤ k ^ 3:=pow_nonneg (by omega) 3 + have hmul : n * (12 * L ^ 3 + 3) ≤ k * (12 * k ^ 3 + 3) := + mul_le_mul hn.2 (by linarith) (by linarith) (by omega) + have hmp:=mass_poly k hk + linarith +theorem assemble (k x y r : ℤ) + (hk : 65536 < k) (hx : x=q1 k) (hy : y=q1 (8 * x)) + (hr : 0 ≤ r) (hword : WordLink.bound (8 * x) r) + (hD : 6 * x + 9 + (r + 1) * (6 * y + 9) + 8 * x < k) : + Closure.budget k:= by + rcases qa2 k hk with ⟨hx17,hpow,hL,hys⟩ + rw [← hx] at hx17 hpow hL hys + rw [← hy] at hys + have hn : r + 1 < k:= by nlinarith + refine ⟨8 * x,(r + 1).toNat,⟨by omega,hL.2⟩,?_,?_,?_⟩ + · have htoNat : (((r + 1).toNat : ℤ) - 1)=r:= by omega + rw [htoNat] + exact hword + · have htoNat : ((r + 1).toNat : ℤ)=r + 1:=Int.toNat_of_nonneg (by omega) + rw [htoNat,← hx,← hy] + exact hD + · have htoNat : ((r + 1).toNat : ℤ)=r + 1:=Int.toNat_of_nonneg (by omega) + rw [htoNat] + have hmb:=qao k (8 * x) (r + 1) (by omega) ⟨by omega,by omega⟩ ⟨by omega,by omega⟩ + have hk8 : k ^ 8 ≤ q0 (8 * x):= by + have heq : 8 * x=x + (x + (x + (x + (x + (x + (x + x)))))):= by ring + have hx0 : 0 ≤ x:= by omega + have hpow8 : q0 (8 * x)=(q0 x) ^ 8:= by + rw [qe (by omega),qe hx0] + have h8t : (8 * x).toNat=x.toNat * 8:= by omega + rw [h8t,pow_mul] + rw [hpow8] + exact pow_le_pow_left₀ (by omega) hpow.2 8 + exact lt_of_lt_of_le hmb hk8 +theorem budget (k : ℤ) (hk : 65536 < k) (hprev : Closure.earlier k) : + Closure.budget k:= by + rcases qa2 k hk with ⟨hx,hpow,hL,hy⟩ + set x:=q1 k + set y:=q1 (8 * x) + by_cases hsmall : 8 * x ≤ q0 120 + · apply assemble k x y (30 * y) hk rfl rfl (by omega) + · exact SmallScale.range120 (8 * x) ⟨hL.1,hsmall⟩ + (SmallScale.earlier_parameters k (8 * x) ⟨by omega,hL.2⟩ hprev) + · have hsd:=small_depth x y hx hy + have hfs:=Exponential.final_square x hx + linarith + · push Not at hsmall + have hy4 : 0 ≤ (y + 1) ^ 4:=pow_nonneg (by omega) 4 + have hp64:=qs 64 + apply assemble k x y (q0 64 * (y + 1) ^ 4) hk rfl rfl (mul_nonneg hp64 hy4) + · exact GlobalBounds.quartic k hprev (8 * x) hL + · have hx1024 : 1024 ≤ x:= by + have hfixed : 8 * 1024 < q0 120:= by decide + omega + have hld:=large_depth x y hy + have hft:=Exponential.final_tail x hx1024 + linarith +end FinalBudget +namespace TM1 +abbrev M:=target_tm +@[simp] theorem multiStep_zero (config : Cfg (Fin 2) (Fin 6)) : multiStep M config 0=some config:=rfl +@[simp] theorem multiStep_one (config : Cfg (Fin 2) (Fin 6)) : multiStep M config 1=step M config:=rfl +@[simp] theorem multiStep_succ (config : Cfg (Fin 2) (Fin 6)) (n : ℕ) : + multiStep M config (n + 1)=Option.bind (multiStep M config n) (step M):= by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem zero_cons_default : (0 : Fin 2) >> (default : ListBlank (Fin 2))=default:= by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head=0:=rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail=default:=rfl +theorem qc3 {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [M]⊢ c₂) : + c₁ [M]⊢^{1} c₂:= by simp [h] +theorem step_stepPlus {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [M]⊢ c₂) : + c₁ [M]⊢⁺ c₂:=⟨1,by decide,qc3 h⟩ +theorem qb1 (c₁ : Cfg (Fin 2) (Fin 6)) (n m : ℕ) : + multiStep M c₁ (n + m)=(multiStep M c₁ n).bind (fun c₂ => multiStep M c₂ m):= by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,multiStep_succ,ih,Option.bind_assoc] + simp_rw [multiStep_succ] +theorem qR {c₁ c₂ c3 : Cfg (Fin 2) (Fin 6)} {n m : ℕ} + (h₁ : c₁ [M]⊢^{n} c₂) (h₂ : c₂ [M]⊢^{m} c3) : + c₁ [M]⊢^{n+m} c3:= by + rw [qb1,h₁]; simp [h₂] +theorem qF (c : Cfg (Fin 2) (Fin 6)) : c [M]⊢* c:=⟨0,rfl⟩ +theorem qi {c₁ c₂ c3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [M]⊢* c₂) (h₂ : c₂ [M]⊢* c3) : c₁ [M]⊢* c3:= by + rcases h₁ with ⟨n,hn⟩; rcases h₂ with ⟨m,hm⟩ + exact ⟨n + m,qR hn hm⟩ +theorem qf {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [M]⊢⁺ c₂) : + c₁ [M]⊢* c₂:= by rcases h with ⟨n,_,hn⟩; exact ⟨n,hn⟩ +theorem q7 {c₁ c₂ c3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [M]⊢⁺ c₂) (h₂ : c₂ [M]⊢* c3) : c₁ [M]⊢⁺ c3:= by + rcases h₁ with ⟨n,hn0,hn⟩; rcases h₂ with ⟨m,hm⟩ + exact ⟨n + m,by omega,qR hn hm⟩ +theorem qG {c₁ c₂ c3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [M]⊢* c₂) (h₂ : c₂ [M]⊢⁺ c3) : c₁ [M]⊢⁺ c3:= by + rcases h₁ with ⟨n,hn⟩; rcases h₂ with ⟨m,hm0,hm⟩ + exact ⟨n + m,by omega,qR hn hm⟩ +theorem qaz {c₁ c₂ c3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [M]⊢ c₂) (h₂ : c₂ [M]⊢* c3) : c₁ [M]⊢⁺ c3 := + q7 (step_stepPlus h₁) h₂ +macro "qbq" : tactic => + `(tactic| exact qF _) +macro "step" : tactic => + `(tactic| (try refine qf ?_) <;> + refine qaz (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,zero_cons_default,default_head,default_tail]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | qbq | step))) +abbrev o1 : List (Fin 2):=[1] +@[simp] theorem o1_pow_zero (s : ListBlank (Fin 2)) : (o1 ^ (0 : ℕ)) +> s=s:=rfl +theorem q6 (n : ℕ) (s : ListBlank (Fin 2)) : + (o1 ^ (n + 1)) +> s=(1 : Fin 2) >> ((o1 ^ n) +> s):=rfl +theorem qj (n : ℕ) (s : ListBlank (Fin 2)) : + (o1 ^ n) +> ((1 : Fin 2) >> s)=(1 : Fin 2) >> ((o1 ^ n) +> s):= by + induction n with + | zero => rfl + | succ n ih => + rw [q6,ih,← q6] +theorem o1_pow_add (m n : ℕ) (s : ListBlank (Fin 2)) : + (o1 ^ (m + n)) +> s=(o1 ^ m) +> ((o1 ^ n) +> s):= by + induction m with + | zero => simp [o1_pow_zero] + | succ m ih => + rw [Nat.succ_add,q6,q6,ih] +theorem qa1 (n : ℕ) (l r : ListBlank (Fin 2)) : + (((o1 ^ n) +> l) <{{A}} r) [M]⊢* (l <{{A}} ((o1 ^ n) +> r)):= by + induction n generalizing l r with + | zero => exact qF _ + | succ n ih => + rw [q6] + have h1 : (((1 : Fin 2) >> ((o1 ^ n) +> l)) <{{A}} r) [M]⊢⁺ + (((o1 ^ n) +> l) <{{A}} ((1 : Fin 2) >> r)):= by execute + exact qi (qf h1) (by rw [q6,← qj]; exact ih l ((1 : Fin 2) >> r)) +theorem qaX (n : ℕ) (l r : ListBlank (Fin 2)) : + (l {{D}}> ((o1 ^ n) +> r)) [M]⊢* (((o1 ^ n) +> l) {{D}}> r):= by + induction n generalizing l r with + | zero => exact qF _ + | succ n ih => + rw [q6] + have h1 : (l {{D}}> ((1 : Fin 2) >> ((o1 ^ n) +> r))) [M]⊢⁺ + (((1 : Fin 2) >> l) {{D}}> ((o1 ^ n) +> r)):= by execute + exact qi (qf h1) (by rw [q6,← qj]; exact ih ((1 : Fin 2) >> l) r) +def S1 (a b c : ℕ) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ((0 : Fin 2) >> ((o1 ^ a) +> default)) <{{A}} + ((o1 ^ b) +> ((0 : Fin 2) >> (0 : Fin 2) >> ((o1 ^ c) +> r))) +def S2 (a b c : ℕ) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ((0 : Fin 2) >> ((o1 ^ a) +> default)) <{{A}} + ((o1 ^ b) +> ((1 : Fin 2) >> (0 : Fin 2) >> ((o1 ^ c) +> r))) +theorem Inc1 (a b c : ℕ) (r : ListBlank (Fin 2)) : + (S1 a (2 + b) c r) [M]⊢* (S1 (1 + a) b (1 + c) r):= by + unfold S1 + rw [show 2 + b=b + 1 + 1 by omega,q6 (b + 1),q6 b] + have h1 : (((0 : Fin 2) >> ((o1 ^ a) +> default)) <{{A}} + ((1 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ b) +> ((0 : Fin 2) >> (0 : Fin 2) >> ((o1 ^ c) +> r))))) [M]⊢⁺ + (((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ a) +> default)) {{D}}> + ((o1 ^ b) +> ((0 : Fin 2) >> (0 : Fin 2) >> ((o1 ^ c) +> r)))):= by execute + have h2:=qaX b ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ a) +> default)) + ((0 : Fin 2) >> (0 : Fin 2) >> ((o1 ^ c) +> r)) + rw [qj] at h2 + have h3 : (((1 : Fin 2) >> ((o1 ^ b) +> ((0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ a) +> default)))) {{D}}> + ((0 : Fin 2) >> (0 : Fin 2) >> ((o1 ^ c) +> r))) [M]⊢⁺ + (((o1 ^ b) +> ((0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ a) +> default))) <{{A}} + ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ c) +> r))):= by execute + have h4:=qa1 b ((0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ a) +> default)) + ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ c) +> r)) + rw [show 1 + a=a + 1 by omega,show 1 + c=c + 1 by omega,q6 a,q6 c] + exact qi (qf h1) (qi h2 (qi (qf h3) h4)) +theorem Incs1 (n a b c : ℕ) (r : ListBlank (Fin 2)) : + (S1 a (n * 2 + b) c r) [M]⊢* (S1 (n + a) b (n + c) r):= by + induction n generalizing a b c with + | zero => simp [qF] + | succ n ih => + rw [show (n + 1) * 2 + b=n * 2 + (2 + b) by omega] + have h1:=ih a (2 + b) c + have h2:=Inc1 (n + a) b (n + c) r + rw [show 1 + (n + a)=n + 1 + a by omega,show 1 + (n + c)=n + 1 + c by omega] at h2 + exact qi h1 h2 +theorem Inc2 (a b c : ℕ) (r : ListBlank (Fin 2)) : + (S2 a b (1 + c) r) [M]⊢* (S2 (1 + a) b c r):= by + unfold S2 + rw [show 1 + c=c + 1 by omega,q6 c,qj b] + have h1 : (((0 : Fin 2) >> ((o1 ^ a) +> default)) <{{A}} + ((1 : Fin 2) >> ((o1 ^ b) +> ((0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ c) +> r))))) [M]⊢⁺ + (((0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ a) +> default)) {{D}}> + ((o1 ^ b) +> ((0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ c) +> r)))):= by execute + have h2:=qaX b ((0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ a) +> default)) + ((0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ c) +> r)) + have h3 : ((((o1 ^ b) +> ((0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ a) +> default))) {{D}}> + ((0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ c) +> r)))) [M]⊢⁺ + (((o1 ^ b) +> ((0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ a) +> default))) <{{A}} + ((1 : Fin 2) >> (0 : Fin 2) >> ((o1 ^ c) +> r))):= by execute + have h4:=qa1 b ((0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ a) +> default)) + ((1 : Fin 2) >> (0 : Fin 2) >> ((o1 ^ c) +> r)) + rw [show 1 + a=a + 1 by omega,q6 a] + exact qi (qf h1) (qi h2 (qi (qf h3) h4)) +theorem Incs2 (a b c : ℕ) (r : ListBlank (Fin 2)) : + (S2 a b c r) [M]⊢* (S2 (c + a) b 0 r):= by + induction c generalizing a b with + | zero => simp [qF] + | succ c ih => + rw [show c + 1=1 + c by omega] + have h1:=Inc2 a b c r + have h2:=ih (1 + a) b + rw [show c + (1 + a)=(1 + c) + a by omega] at h2 + exact qi h1 h2 +theorem Ov0_start (a c d : ℕ) (r' : ListBlank (Fin 2)) : + (S1 a 0 c ((0 : Fin 2) >> ((o1 ^ d) +> r'))) [M]⊢⁺ (S2 0 (2 + a + c) d r'):= by + unfold S1 S2 + simp only [o1_pow_zero,zero_add] + cases c with + | zero => + simp only [o1_pow_zero,Nat.add_zero] + have h1 : (((0 : Fin 2) >> ((o1 ^ a) +> default)) <{{A}} + ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> ((o1 ^ d) +> r'))) [M]⊢⁺ + (((o1 ^ a) +> default) <{{A}} + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> ((o1 ^ d) +> r'))):= by execute + have h2:=qa1 a default + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> ((o1 ^ d) +> r')) + have h_eq : ((default : ListBlank (Fin 2)) <{{A}} + ((o1 ^ a) +> ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> ((o1 ^ d) +> r')))) = + (((0 : Fin 2) >> default) <{{A}} + ((o1 ^ (2 + a)) +> ((1 : Fin 2) >> (0 : Fin 2) >> ((o1 ^ d) +> r')))):= by + rw [zero_cons_default,show 2 + a=a + 1 + 1 by omega, + q6 (a + 1),q6 a,← qj a,← qj a] + rw [h_eq] at h2 + exact q7 h1 h2 + | succ c => + rw [q6 c] + have h1 : (((0 : Fin 2) >> ((o1 ^ a) +> default)) <{{A}} + ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ c) +> ((0 : Fin 2) >> ((o1 ^ d) +> r'))))) [M]⊢⁺ + (((o1 ^ a) +> default) <{{A}} + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ c) +> ((0 : Fin 2) >> ((o1 ^ d) +> r'))))):= by execute + have h2:=qa1 a default + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ c) +> ((0 : Fin 2) >> ((o1 ^ d) +> r')))) + have h_eq : ((default : ListBlank (Fin 2)) <{{A}} + ((o1 ^ a) +> ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ c) +> ((0 : Fin 2) >> ((o1 ^ d) +> r')))))) = + (((0 : Fin 2) >> default) <{{A}} + ((o1 ^ (2 + a + (c + 1))) +> ((1 : Fin 2) >> (0 : Fin 2) >> ((o1 ^ d) +> r')))):= by + rw [zero_cons_default,show 2 + a + (c + 1)=a + (1 + 1 + 1 + c) by omega, + o1_pow_add a (1 + 1 + 1 + c)] + congr 2 + rw [show 1 + 1 + 1 + c=c + 1 + 1 + 1 by omega, + q6 (c + 1 + 1),q6 (c + 1),q6 c,qj c] + rw [h_eq] at h2 + exact q7 h1 h2 +theorem Ov0 (a c d e : ℕ) (r : ListBlank (Fin 2)) : + (S1 a 0 c ((0 : Fin 2) >> ((o1 ^ d) +> ((0 : Fin 2) >> ((o1 ^ e) +> r))))) [M]⊢⁺ + (S1 d (3 + a + c) e r):= by + have h1:=Ov0_start a c d ((0 : Fin 2) >> ((o1 ^ e) +> r)) + have h2:=Incs2 0 (2 + a + c) d ((0 : Fin 2) >> ((o1 ^ e) +> r)) + rw [Nat.add_zero] at h2 + have h_eq : S2 d (2 + a + c) 0 ((0 : Fin 2) >> ((o1 ^ e) +> r))=S1 d (3 + a + c) e r:= by + unfold S2 S1 + simp only [o1_pow_zero] + rw [show 3 + a + c=(2 + a + c) + 1 by omega,q6 (2 + a + c),qj (2 + a + c)] + rw [h_eq] at h2 + exact q7 h1 h2 +theorem Ov1 (a c : ℕ) (r : ListBlank (Fin 2)) : + (S1 (1 + a) 1 c r) [M]⊢⁺ (S1 0 a 1 ((0 : Fin 2) >> ((o1 ^ (1 + c)) +> r))):= by + unfold S1 + rw [show 1 + a=a + 1 by omega,show 1 + c=c + 1 by omega, + q6 a,q6 0,o1_pow_zero,q6 c] + have h1 : (((0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ a) +> default)) <{{A}} + ((1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> ((o1 ^ c) +> r))) [M]⊢⁺ + (((o1 ^ a) +> default) <{{A}} + ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ c) +> r))):= by execute + have h2:=qa1 a default + ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ c) +> r)) + have h_eq : ((default : ListBlank (Fin 2)) <{{A}} + ((o1 ^ a) +> ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ c) +> r)))) = + (((0 : Fin 2) >> default) <{{A}} + ((o1 ^ a) +> ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> ((o1 ^ c) +> r)))):= by + rw [zero_cons_default] + rw [h_eq] at h2 + exact q7 h1 h2 +theorem MacroE (n v w d e : ℕ) (r : ListBlank (Fin 2)) : + (S1 v (2 * n) w ((0 : Fin 2) >> ((o1 ^ d) +> ((0 : Fin 2) >> ((o1 ^ e) +> r))))) [M]⊢⁺ + (S1 d (2 * n + v + w + 3) e r):= by + have h1:=Incs1 n v 0 w ((0 : Fin 2) >> ((o1 ^ d) +> ((0 : Fin 2) >> ((o1 ^ e) +> r)))) + rw [show n * 2 + 0=2 * n by omega] at h1 + have h2:=Ov0 (n + v) (n + w) d e r + rw [show 3 + (n + v) + (n + w)=2 * n + v + w + 3 by omega] at h2 + exact qG h1 h2 +theorem MacroO (n v w : ℕ) (r : ListBlank (Fin 2)) (h : 1 ≤ n + v) : + (S1 v (2 * n + 1) w r) [M]⊢⁺ + (S1 0 (n + v - 1) 1 ((0 : Fin 2) >> ((o1 ^ (w + n + 1)) +> r))):= by + have h1:=Incs1 n v 1 w r + rw [show n * 2 + 1=2 * n + 1 by omega] at h1 + have h2:=Ov1 (n + v - 1) (n + w) r + rw [show 1 + (n + v - 1)=n + v by omega,show 1 + (n + w)=w + n + 1 by omega] at h2 + exact qG h1 h2 +def qr : List ℕ → ListBlank (Fin 2) + | [] => default + | n :: xs => (0 : Fin 2) >> ((o1 ^ n) +> qr xs) +def qT : List ℕ → Cfg (Fin 2) (Fin 6) + | [] => S1 0 0 0 default + | [u] => S1 0 u 0 default + | [u,v] => S1 v u 0 default + | u :: v :: w :: r => S1 v u w (qr r) +theorem step_spec {e : ℕ} {xs ys : List ℕ} (h : Prefix.Step e xs ys) : + (qT xs) [M]⊢⁺ (qT ys):= by + cases h with + | E n v w r => + rcases r with _ | ⟨d,_ | ⟨e',r⟩⟩ + · dsimp -failIfUnchanged [qT,qr] + have hM:=MacroE n v w 0 0 default + simpa [o1_pow_zero,zero_cons_default] using! hM + · dsimp -failIfUnchanged [qT,qr] + have hM:=MacroE n v w d 0 default + simpa [o1_pow_zero,zero_cons_default] using! hM + · dsimp -failIfUnchanged [qT,qr] + exact MacroE n v w d e' (qr r) + | O n v w r hnv => + dsimp -failIfUnchanged [qT,qr] + exact MacroO n v w (qr r) hnv +theorem qbG (xs : List ℕ) : qr (xs ++ [0])=qr xs:= by + induction xs with + | nil => simp [qr,o1_pow_zero,zero_cons_default] + | cons x xs ih => simp [qr,ih] +theorem qaW (xs : List ℕ) : qT (xs ++ [0])=qT xs:= by + rcases xs with _ | ⟨u,_ | ⟨v,_ | ⟨w,xs⟩⟩⟩ + · simp [qT,S1,o1_pow_zero,zero_cons_default] + · simp [qT,S1,o1_pow_zero,zero_cons_default] + · simp [qT,S1,qr,o1_pow_zero,zero_cons_default] + · simp [qT,qbG] +theorem init_eq : init []=qT []:= by + unfold init qT S1 + simp [Tape.mk₁,o1_pow_zero,zero_cons_default,A] + rfl +theorem exec_spec {e : ℕ} {xs ys : List ℕ} (h : Prefix.Exec e xs ys) : + (qT xs) [M]⊢* (qT ys):= by + induction h with + | stop xs => exact qF _ + | take hs _ ih => exact qi (qf (step_spec hs)) ih + | zero _ ih => rw [← qaW]; exact ih +theorem exec_progress {e : ℕ} {xs ys : List ℕ} (h : Prefix.Exec e xs ys) (he : 0 < e) : + (qT xs) [M]⊢⁺ (qT ys):= by + induction h with + | stop xs => omega + | take hs hex ih => + exact q7 (step_spec hs) (exec_spec hex) + | zero _ ih => + rw [← qaW] + exact ih he +theorem qau {c c' : Cfg (Fin 2) (Fin 6)} {j d : ℕ} + (h : multiStep M c (j + d)=some c') : + (multiStep M c j).isSome:= by + rw [qb1] at h + cases h_j : multiStep M c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +theorem nonhalt_of_returns (hreturn : ∀ k : ℕ,∃ e m : ℕ,Prefix.Exec (1 + e) [3 * k] [m]) : + IsDoesNotHalt M:= by + have h_chain : ∀ m : ℕ,∃ N ≥ m,∃ k : ℕ,multiStep M (init []) N=some (qT [3 * k]):= by + intro m + induction m with + | zero => + refine ⟨0,Nat.le_refl 0,0,?_⟩ + rw [init_eq,← qaW []] + rfl + | succ m ih => + rcases ih with ⟨N,hN,k,h_ms⟩ + rcases hreturn k with ⟨e,m_out,hex⟩ + have hmass:=Prefix.exec_mass hex + simp [Prefix.mass] at hmass + have hm_eq : m_out=3 * (k + 1 + e):= by omega + rw [hm_eq] at hex + rcases exec_progress hex (by omega) with ⟨qad,hsteps_pos,hsteps⟩ + exact ⟨N + qad,by omega,k + 1 + e,qR h_ms hsteps⟩ + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases h_chain (n + 1) with ⟨N,hN,k,h_N⟩ + have h_eq : (n + 1) + (N - (n + 1))=N:=Nat.add_sub_of_le hN + rw [← h_eq] at h_N + have h_some:=qau h_N + rw [multiStep_succ,hn] at h_some + exact h_some +end TM1 + +end Solution +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + + + +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := TM1.nonhalt_of_returns (Prefix.single_returns (Closure.G_returns FinalBudget.budget)) + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1LA_0RC0RD_1LC1LA_1RE1RD_1LF0LA_HHH0LE diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LA_1LA1RC_1RD0RB_1LE0LF_HHH1LD_0LE1LA.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LA_1LA1RC_1RD0RB_1LE0LF_HHH1LD_0LE1LA.lean new file mode 100644 index 00000000..4d8b7634 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LA_1LA1RC_1RD0RB_1LE0LF_HHH1LD_0LE1LA.lean @@ -0,0 +1,48 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.BB6.NonHalt.M_1RB1LC_1LA1RB_1LD0LA_1RE0RF_HHH1RD_0RE1RB + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RB1LA_1LA1RC_1RD0RB_1LE0LF_HHH1LD_0LE1LA + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LA_1LA1RC_1RD0RB_1LE0LF_HHH1LD_0LE1LA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +def stateMap_m0831 : Fin 6 → Fin 6 + | 0 => 1 -- m0831 state A + | 1 => 0 -- m0831 state B + | 2 => 2 -- m0831 state C + | 3 => 3 -- m0831 state D + | 4 => 4 -- m0831 state E + | 5 => 5 -- m0831 state F + +public section + +theorem is_not_halt : IsNotHalt target := by + exact Counter.does_not_halt_of_conj_stem + (M_src := BusyBeaver.M_1RB1LC_1LA1RB_1LD0LA_1RE0RF_HHH1RD_0RE1RB.target) + (σ := stateMap_m0831) (f := true) + (c₁ := (default : ListBlank (Fin 2)) {{1}}> default) + (by decide) ⟨0, rfl⟩ + BusyBeaver.M_1RB1LC_1LA1RB_1LD0LA_1RE0RF_HHH1RD_0RE1RB.is_not_halt_from_0831 + +end + +end BusyBeaver.M_1RB1LA_1LA1RC_1RD0RB_1LE0LF_HHH1LD_0LE1LA diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LA_1LC0RA_0LD1RC_HHH0LE_0LF1LE_1RF1LB.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LA_1LC0RA_0LD1RC_HHH0LE_0LF1LE_1RF1LB.lean new file mode 100644 index 00000000..d1275029 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LA_1LC0RA_0LD1RC_HHH0LE_0LF1LE_1RF1LB.lean @@ -0,0 +1,1814 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1LA_1LC0RA_0LD1RC_HHH0LE_0LF1LE_1RF1LB + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LA_1LC0RA_0LD1RC_HHH0LE_0LF1LE_1RF1LB" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +variable {Γ_ Λ_ : Type*} [Inhabited Γ_] [Inhabited Λ_] +abbrev s0 : Fin 2 := 0 +abbrev s1 : Fin 2 := 1 +abbrev TapeB := ListBlank (Fin 2) +abbrev TapeF := List (Fin 2) +infixr:67 " ∷ " => ListBlank.cons + +@[simp] theorem multiStep_zero (M : Machine Γ_ Λ_) (config : Cfg Γ_ Λ_) : + multiStep M config 0 = some config := rfl +theorem multiStep_succ (M : Machine Γ_ Λ_) (config : Cfg Γ_ Λ_) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem zero_cons_default : s0 ∷ (default : TapeB) = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : TapeB).head = 0 := rfl +@[simp] theorem default_tail : (default : TapeB).tail = default := rfl +@[simp] theorem append_nil (s : TapeB) : ([] : TapeF) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : TapeF) (s : TapeB) : + (a :: l) +> s = a ∷ (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : TapeF) (s : TapeB) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append, append_cons, ih] + +theorem step_one {Γ_ Λ_ : Type*} [Inhabited Γ_] [Inhabited Λ_] + (M : Machine Γ_ Λ_) (c_1 c_2 : Cfg Γ_ Λ_) (h : c_1 [M]⊢ c_2) : + c_1 [M]⊢^{1} c_2 := by simp [multiStep_succ, h] +theorem stepPlus_one {Γ_ Λ_ : Type*} [Inhabited Γ_] [Inhabited Λ_] + (M : Machine Γ_ Λ_) (c_1 c_2 : Cfg Γ_ Λ_) (h : c_1 [M]⊢ c_2) : + c_1 [M]⊢⁺ c_2 := ⟨1, by decide, step_one M c_1 c_2 h⟩ +theorem multiStep_add {Γ_ Λ_ : Type*} [Inhabited Γ_] [Inhabited Λ_] + (M : Machine Γ_ Λ_) (c_1 : Cfg Γ_ Λ_) (n m : Nat) : + multiStep M c_1 (n + m) = (multiStep M c_1 n).bind (fun c_2 => multiStep M c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] +theorem multiStep_trans {Γ_ Λ_ : Type*} [Inhabited Γ_] [Inhabited Λ_] + (M : Machine Γ_ Λ_) (c_1 c_2 c_3 : Cfg Γ_ Λ_) (n m : Nat) + (h1 : c_1 [M]⊢^{n} c_2) (h2 : c_2 [M]⊢^{m} c_3) : + c_1 [M]⊢^{n+m} c_3 := by + rw [multiStep_add, h1]; simp [h2] +theorem stepPlus_to_stepStar {Γ_ Λ_ : Type*} [Inhabited Γ_] [Inhabited Λ_] + {M : Machine Γ_ Λ_} {c_1 c_2 : Cfg Γ_ Λ_} (h : c_1 [M]⊢⁺ c_2) : + c_1 [M]⊢* c_2 := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ +theorem stepPlus_trans {Γ_ Λ_ : Type*} [Inhabited Γ_] [Inhabited Λ_] + {M : Machine Γ_ Λ_} {c_1 c_2 c_3 : Cfg Γ_ Λ_} + (h1 : c_1 [M]⊢⁺ c_2) (h2 : c_2 [M]⊢⁺ c_3) : c_1 [M]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h1; obtain ⟨m, m_pos, hm⟩ := h2 + exact ⟨n + m, by omega, multiStep_trans M c_1 c_2 c_3 n m hn hm⟩ +theorem stepPlus_stepStar_trans {Γ_ Λ_ : Type*} [Inhabited Γ_] [Inhabited Λ_] + {M : Machine Γ_ Λ_} {c_1 c_2 c_3 : Cfg Γ_ Λ_} + (h1 : c_1 [M]⊢⁺ c_2) (h2 : c_2 [M]⊢* c_3) : c_1 [M]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h1; obtain ⟨m, hm⟩ := h2 + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), + multiStep_trans M c_1 c_2 c_3 n m hn hm⟩ +theorem step_stepStar_trans {Γ_ Λ_ : Type*} [Inhabited Γ_] [Inhabited Λ_] + {M : Machine Γ_ Λ_} {c_1 c_2 c_3 : Cfg Γ_ Λ_} + (h1 : c_1 [M]⊢ c_2) (h2 : c_2 [M]⊢* c_3) : c_1 [M]⊢⁺ c_3 := + stepPlus_stepStar_trans (stepPlus_one M c_1 c_2 h1) h2 +theorem stepStar_stepPlus_trans {Γ_ Λ_ : Type*} [Inhabited Γ_] [Inhabited Λ_] + {M : Machine Γ_ Λ_} {c_1 c_2 c_3 : Cfg Γ_ Λ_} + (h1 : c_1 [M]⊢* c_2) (h2 : c_2 [M]⊢⁺ c_3) : c_1 [M]⊢⁺ c_3 := by + obtain ⟨n, hn⟩ := h1; obtain ⟨m, m_pos, hm⟩ := h2 + exact ⟨n + m, by omega, multiStep_trans M c_1 c_2 c_3 n m hn hm⟩ + +@[simp] theorem pow_zero_eq (l : TapeF) : l ^ 0 = [] := rfl +@[simp] theorem pow_succ_eq (l : TapeF) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl + +macro "finish" : tactic => + `(tactic| exists 0 <;> rfl) +macro "gstep" : tactic => + `(tactic| (try refine stepPlus_to_stepStar ?_) <;> + refine step_stepStar_trans (by + (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, pow_zero_eq, + pow_succ_eq, List.singleton_append, List.cons_append, List.nil_append, append_nil, + append_cons, Turing.ListBlank.head_cons, default_head]); + rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, pow_zero_eq, pow_succ_eq, + List.singleton_append, List.cons_append, List.nil_append, append_nil, append_cons, + Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, + zero_cons_default, default_head, default_tail]) +macro "execute" : tactic => + `(tactic| iterate 20 (try (any_goals (first | finish | gstep)))) + +def encL : List ℕ → TapeB + | [] => default + | k :: L => ([s1] ^ k) +> (s0 ∷ encL L) + +def D_cfg_raw (stD : Fin 6) (L : List ℕ) (R : TapeB) : Cfg (Fin 2) (Fin 6) := + ⟨some stD, ⟨s0, encL L, R⟩⟩ + +def addBot (bot : ℕ) : List ℕ → List ℕ + | [] => [] + | [x] => [x + bot] + | x :: y :: L => x :: addBot bot (y :: L) + +def D_cfg_bot (stD : Fin 6) (bot : ℕ) (L : List ℕ) (R : TapeB) : Cfg (Fin 2) (Fin 6) := + D_cfg_raw stD (addBot bot L) R + +macro "execute_init" : tactic => + `(tactic| ( + simp only [D_cfg_raw, encL, pow_succ_eq, pow_zero_eq, append_cons, append_nil, + zero_cons_default] + iterate 30 (try (any_goals (first | finish | gstep))))) + +theorem ones_zero_eq (s : TapeB) : ([s1] ^ 0) +> s = s := rfl +theorem ones_succ_eq (n : ℕ) (s : TapeB) : + ([s1] ^ (n + 1)) +> s = s1 ∷ (([s1] ^ n) +> s) := rfl +theorem ones_add_merge (a b : ℕ) (s : TapeB) : + ([s1] ^ a) +> (([s1] ^ b) +> s) = ([s1] ^ (a + b)) +> s := by + induction a with + | zero => rw [Nat.zero_add]; rfl + | succ a ih => + rw [Nat.add_right_comm, ones_succ_eq, ih, ← ones_succ_eq] + +theorem zeros_succ_eq (n : ℕ) (s : TapeB) : + ([s0] ^ (n + 1)) +> s = s0 ∷ (([s0] ^ n) +> s) := rfl +theorem zeros_add_merge (a b : ℕ) (s : TapeB) : + ([s0] ^ a) +> (([s0] ^ b) +> s) = ([s0] ^ (a + b)) +> s := by + induction a with + | zero => rw [Nat.zero_add]; rfl + | succ a ih => + rw [Nat.add_right_comm, zeros_succ_eq, ih, ← zeros_succ_eq] + +structure StackRules (tm : Machine (Fin 2) (Fin 6)) + (D_cfg : List ℕ → TapeB → Cfg (Fin 2) (Fin 6)) : Prop where + rule_mp : ∀ a z L R, + (D_cfg ((a + 2) :: 1 :: (z + 1) :: L) R) [tm]⊢⁺ + (D_cfg ((z + 3) :: L) (([s1] ^ (a + 1)) +> ([s0, s0] +> R))) + rule_pop : ∀ a b d L R, + (D_cfg ((a + 2) :: (b + 2) :: L) (([s1] ^ d) +> (s0 ∷ R))) [tm]⊢⁺ + (D_cfg ((d + 2) :: (a + 1) :: (b + 1) :: L) R) + rule_edge : ∀ d R, + (D_cfg [3] (([s1] ^ d) +> (s0 ∷ R))) [tm]⊢⁺ + (D_cfg [d + 2, 3] R) + init_to_hit0 : + (init []) [tm]⊢⁺ (D_cfg [3] (s1 ∷ default)) + +theorem mkStackRules (tm : Machine (Fin 2) (Fin 6)) (stC stD stF : Fin 6) (bot : ℕ) + (h_F0 : ∀ (l r : TapeB), + (⟨some stF, ⟨s1, s0 ∷ l, r⟩⟩ : Cfg (Fin 2) (Fin 6)) [tm]⊢⁺ + ⟨some stF, ⟨s0, l, s1 ∷ r⟩⟩) + (h_F1 : ∀ (a : ℕ) (l r : TapeB), + (⟨some stF, ⟨s1, s1 ∷ (([s1] ^ a) +> (s0 ∷ l)), r⟩⟩ : Cfg (Fin 2) (Fin 6)) [tm]⊢⁺ + ⟨some stF, ⟨s1, ([s1] ^ a) +> (s0 ∷ l), s1 ∷ r⟩⟩) + (h_C1 : ∀ (a : ℕ) (l r : TapeB), + (⟨some stC, ⟨s1, l, s1 ∷ (([s1] ^ a) +> (s0 ∷ r))⟩⟩ : Cfg (Fin 2) (Fin 6)) [tm]⊢⁺ + ⟨some stC, ⟨s1, s1 ∷ l, ([s1] ^ a) +> (s0 ∷ r)⟩⟩) + (h_D0 : ∀ (l r : TapeB), + (⟨some stD, ⟨s1, l, s0 ∷ r⟩⟩ : Cfg (Fin 2) (Fin 6)) [tm]⊢⁺ + ⟨some stD, ⟨s0, s1 ∷ l, r⟩⟩) + (h_D1 : ∀ (d : ℕ) (l r : TapeB), + (⟨some stD, ⟨s1, l, s1 ∷ (([s1] ^ d) +> (s0 ∷ r))⟩⟩ : Cfg (Fin 2) (Fin 6)) [tm]⊢⁺ + ⟨some stD, ⟨s1, s1 ∷ l, ([s1] ^ d) +> (s0 ∷ r)⟩⟩) + (h_D_start : ∀ (a : ℕ) (l r : TapeB), + (⟨some stD, ⟨s0, s1 ∷ (s1 ∷ (([s1] ^ a) +> (s0 ∷ l))), r⟩⟩ : Cfg (Fin 2) (Fin 6)) [tm]⊢⁺ + ⟨some stF, ⟨s1, ([s1] ^ a) +> (s0 ∷ l), [s0, s0] +> r⟩⟩) + (h_merge_end : ∀ (a b : ℕ) (L : List ℕ) (R : TapeB), + (⟨some stF, ⟨s0, ([s1] ^ 1) +> (s0 ∷ (s1 ∷ (([s1] ^ (b + 1)) +> (s0 ∷ encL L)))), + ([s1] ^ (a + 1)) +> ([s0, s0] +> R)⟩⟩ : Cfg (Fin 2) (Fin 6)) [tm]⊢⁺ + ⟨some stD, ⟨s0, s1 ∷ (s1 ∷ (s1 ∷ (([s1] ^ (b + 1)) +> (s0 ∷ encL L)))), + ([s1] ^ (a + 1)) +> ([s0, s0] +> R)⟩⟩) + (h_push_end : ∀ (a : ℕ) (L : List ℕ) (R : TapeB), + (⟨some stF, ⟨s0, ([s1] ^ 1) +> (s0 ∷ (([s1] ^ 1) +> (s0 ∷ encL L))), + ([s1] ^ (a + 1)) +> ([s0, s0] +> R)⟩⟩ : Cfg (Fin 2) (Fin 6)) [tm]⊢⁺ + (D_cfg_raw stD (3 :: L) (([s1] ^ (a + 1)) +> ([s0, s0] +> R)))) + (h_pop_mid1 : ∀ (a b : ℕ) (L : List ℕ) (r0 : TapeB), + (⟨some stF, ⟨s0, s1 ∷ (s1 ∷ (([s1] ^ b) +> (s0 ∷ encL L))), + s1 ∷ (([s1] ^ a) +> ([s0, s0] +> r0))⟩⟩ : Cfg (Fin 2) (Fin 6)) [tm]⊢⁺ + ⟨some stC, ⟨s1, s1 ∷ (s0 ∷ (s1 ∷ (([s1] ^ b) +> (s0 ∷ encL L)))), + ([s1] ^ a) +> (s0 ∷ (s0 ∷ r0))⟩⟩) + (h_pop_mid2 : ∀ (a b : ℕ) (L : List ℕ) (r0 : TapeB), + (⟨some stC, ⟨s1, ([s1] ^ (a + 1)) +> (s0 ∷ (([s1] ^ (b + 1)) +> (s0 ∷ encL L))), + s0 ∷ (s0 ∷ r0)⟩⟩ : Cfg (Fin 2) (Fin 6)) [tm]⊢⁺ + ⟨some stD, ⟨s1, + s1 ∷ (s0 ∷ (([s1] ^ (a + 1)) +> (s0 ∷ (([s1] ^ (b + 1)) +> (s0 ∷ encL L))))), r0⟩⟩) + (h_edge_start : ∀ (r0 : TapeB), + (⟨some stD, ⟨s0, ([s1] ^ (bot + 3)) +> (s0 ∷ default), r0⟩⟩ : Cfg (Fin 2) (Fin 6)) [tm]⊢⁺ + ⟨some stD, ⟨s1, s1 ∷ (s0 ∷ (([s1] ^ (bot + 3)) +> (s0 ∷ default))), r0⟩⟩) + (h_init1 : (default {{0}}> (s0 ∷ default)) [tm]⊢⁺ (D_cfg_raw stD [bot + 2] default)) + (h_init2 : (D_cfg_raw stD [bot + 2] default) [tm]⊢⁺ (D_cfg_raw stD [2, bot + 2] default)) + (h_init3 : (D_cfg_raw stD [2, bot + 2] default) [tm]⊢⁺ + (D_cfg_raw stD [2, 1, bot + 1] default)) + (h_init4 : (D_cfg_raw stD [2, 1, bot + 1] default) [tm]⊢⁺ + (D_cfg_raw stD [bot + 3] (s1 ∷ default))) : + StackRules tm (D_cfg_bot stD bot) := by + have scanL_F' : ∀ (a : ℕ) (l r : TapeB), + (⟨some stF, ⟨s1, ([s1] ^ a) +> (s0 ∷ l), r⟩⟩ : Cfg (Fin 2) (Fin 6)) [tm]⊢⁺ + ⟨some stF, ⟨s0, l, ([s1] ^ (a + 1)) +> r⟩⟩ := by + intro a l r + induction a generalizing r with + | zero => + simp only [ones_zero_eq, pow_succ_eq, pow_zero_eq, List.singleton_append, + append_cons, append_nil] + exact h_F0 l r + | succ a ih => + rw [ones_succ_eq] + have h1 := h_F1 a l r + have h2 := ih (s1 ∷ r) + have heq : ([s1] ^ (a + 1)) +> (s1 ∷ r) = ([s1] ^ (a + 2)) +> r := by + have : s1 ∷ r = ([s1] ^ 1) +> r := rfl + rw [this, ones_add_merge] + rw [heq] at h2 + exact stepPlus_trans h1 h2 + have walkR_BBC : ∀ (a : ℕ) (l r : TapeB), + (⟨some stC, ⟨s1, l, ([s1] ^ a) +> (s0 ∷ r)⟩⟩ : Cfg (Fin 2) (Fin 6)) [tm]⊢* + ⟨some stC, ⟨s1, ([s1] ^ a) +> l, s0 ∷ r⟩⟩ := by + intro a l r + induction a generalizing l with + | zero => exists 0 + | succ a ih => + rw [ones_succ_eq] + have h1 := h_C1 a l r + have h2 := ih (s1 ∷ l) + have heq : ([s1] ^ a) +> (s1 ∷ l) = ([s1] ^ (a + 1)) +> l := by + have : s1 ∷ l = ([s1] ^ 1) +> l := rfl + rw [this, ones_add_merge] + rw [heq] at h2 + exact stepPlus_to_stepStar (stepPlus_stepStar_trans h1 h2) + have scanR_D : ∀ (d : ℕ) (l r : TapeB), + (⟨some stD, ⟨s1, l, ([s1] ^ d) +> (s0 ∷ r)⟩⟩ : Cfg (Fin 2) (Fin 6)) [tm]⊢⁺ + ⟨some stD, ⟨s0, ([s1] ^ (d + 1)) +> l, r⟩⟩ := by + intro d l r + induction d generalizing l with + | zero => + simp only [ones_zero_eq, pow_succ_eq, pow_zero_eq, List.singleton_append, + append_cons, append_nil] + exact h_D0 l r + | succ d ih => + rw [ones_succ_eq] + have h1 := h_D1 d l r + have h2 := ih (s1 ∷ l) + have heq : ([s1] ^ (d + 1)) +> (s1 ∷ l) = ([s1] ^ (d + 2)) +> l := by + have : s1 ∷ l = ([s1] ^ 1) +> l := rfl + rw [this, ones_add_merge] + rw [heq] at h2 + exact stepPlus_trans h1 h2 + have raw_merge : ∀ (a b : ℕ) (L : List ℕ) (R : TapeB), + (D_cfg_raw stD ((a + 2) :: 1 :: (b + 2) :: L) R) [tm]⊢⁺ + (D_cfg_raw stD ((b + 4) :: L) (([s1] ^ (a + 1)) +> ([s0, s0] +> R))) := by + intro a b L R + simp only [D_cfg_raw, encL] + rw [ones_succ_eq (a + 1), ones_succ_eq a, ones_succ_eq (b + 1)] + have h1 := h_D_start a (([s1] ^ 1) +> (s0 ∷ (s1 ∷ (([s1] ^ (b + 1)) +> (s0 ∷ encL L))))) R + have h2 := scanL_F' a (([s1] ^ 1) +> (s0 ∷ (s1 ∷ (([s1] ^ (b + 1)) +> (s0 ∷ encL L))))) + ([s0, s0] +> R) + refine stepPlus_trans (stepPlus_trans h1 h2) ?_ + rw [ones_succ_eq (b + 3), ones_succ_eq (b + 2), ones_succ_eq (b + 1)] + exact h_merge_end a b L R + have raw_push : ∀ (a : ℕ) (L : List ℕ) (R : TapeB), + (D_cfg_raw stD ((a + 2) :: 1 :: 1 :: L) R) [tm]⊢⁺ + (D_cfg_raw stD (3 :: L) (([s1] ^ (a + 1)) +> ([s0, s0] +> R))) := by + intro a L R + simp only [D_cfg_raw, encL] + rw [ones_succ_eq (a + 1), ones_succ_eq a] + have h1 := h_D_start a (([s1] ^ 1) +> (s0 ∷ (([s1] ^ 1) +> (s0 ∷ encL L)))) R + have h2 := scanL_F' a (([s1] ^ 1) +> (s0 ∷ (([s1] ^ 1) +> (s0 ∷ encL L)))) ([s0, s0] +> R) + exact stepPlus_trans (stepPlus_trans h1 h2) (h_push_end a L R) + have raw_mp : ∀ (a z : ℕ) (L : List ℕ) (R : TapeB), + (D_cfg_raw stD ((a + 2) :: 1 :: (z + 1) :: L) R) [tm]⊢⁺ + (D_cfg_raw stD ((z + 3) :: L) (([s1] ^ (a + 1)) +> ([s0, s0] +> R))) := by + intro a z L R + cases z with + | zero => exact raw_push a L R + | succ b => exact raw_merge a b L R + have raw_pop : ∀ (a b d : ℕ) (L : List ℕ) (R : TapeB), + (D_cfg_raw stD ((a + 2) :: (b + 2) :: L) (([s1] ^ d) +> (s0 ∷ R))) [tm]⊢⁺ + (D_cfg_raw stD ((d + 2) :: (a + 1) :: (b + 1) :: L) R) := by + intro a b d L R + simp only [D_cfg_raw, encL] + rw [ones_succ_eq (a + 1), ones_succ_eq a, ones_succ_eq (b + 1), ones_succ_eq b] + set r0 := ([s1] ^ d) +> (s0 ∷ R) + have h1 := h_D_start a (s1 ∷ (s1 ∷ (([s1] ^ b) +> (s0 ∷ encL L)))) r0 + have h2 := scanL_F' a (s1 ∷ (s1 ∷ (([s1] ^ b) +> (s0 ∷ encL L)))) ([s0, s0] +> r0) + rw [ones_succ_eq a] at h2 + have h3 := h_pop_mid1 a b L r0 + have h4 := walkR_BBC a (s1 ∷ (s0 ∷ (s1 ∷ (([s1] ^ b) +> (s0 ∷ encL L))))) (s0 ∷ r0) + have h4_eq : ([s1] ^ a) +> (s1 ∷ (s0 ∷ (s1 ∷ (([s1] ^ b) +> (s0 ∷ encL L))))) = + ([s1] ^ (a + 1)) +> (s0 ∷ (([s1] ^ (b + 1)) +> (s0 ∷ encL L))) := by + rw [← ones_succ_eq b] + have : s1 ∷ (s0 ∷ (([s1] ^ (b + 1)) +> (s0 ∷ encL L))) = + ([s1] ^ 1) +> (s0 ∷ (([s1] ^ (b + 1)) +> (s0 ∷ encL L))) := rfl + rw [this, ones_add_merge] + rw [h4_eq] at h4 + have h5 := h_pop_mid2 a b L r0 + have h6 := scanR_D d + (s1 ∷ (s0 ∷ (([s1] ^ (a + 1)) +> (s0 ∷ (([s1] ^ (b + 1)) +> (s0 ∷ encL L)))))) R + have h6_eq : ([s1] ^ (d + 1)) +> + (s1 ∷ (s0 ∷ (([s1] ^ (a + 1)) +> (s0 ∷ (([s1] ^ (b + 1)) +> (s0 ∷ encL L)))))) = + ([s1] ^ (d + 2)) +> + (s0 ∷ (([s1] ^ (a + 1)) +> (s0 ∷ (([s1] ^ (b + 1)) +> (s0 ∷ encL L))))) := by + have : s1 ∷ (s0 ∷ (([s1] ^ (a + 1)) +> (s0 ∷ (([s1] ^ (b + 1)) +> (s0 ∷ encL L))))) = + ([s1] ^ 1) +> + (s0 ∷ (([s1] ^ (a + 1)) +> (s0 ∷ (([s1] ^ (b + 1)) +> (s0 ∷ encL L))))) := rfl + rw [this, ones_add_merge] + rw [h6_eq] at h6 + exact stepPlus_trans (stepPlus_stepStar_trans + (stepPlus_trans (stepPlus_trans h1 h2) h3) h4) (stepPlus_trans h5 h6) + have raw_edge : ∀ (d : ℕ) (R : TapeB), + (D_cfg_raw stD [bot + 3] (([s1] ^ d) +> (s0 ∷ R))) [tm]⊢⁺ + (D_cfg_raw stD [d + 2, bot + 3] R) := by + intro d R + simp only [D_cfg_raw, encL] + set r0 := ([s1] ^ d) +> (s0 ∷ R) + have h1 := h_edge_start r0 + have h2 := scanR_D d (s1 ∷ (s0 ∷ (([s1] ^ (bot + 3)) +> (s0 ∷ default)))) R + have h2_eq : ([s1] ^ (d + 1)) +> (s1 ∷ (s0 ∷ (([s1] ^ (bot + 3)) +> (s0 ∷ default)))) = + ([s1] ^ (d + 2)) +> (s0 ∷ (([s1] ^ (bot + 3)) +> (s0 ∷ default))) := by + have : s1 ∷ (s0 ∷ (([s1] ^ (bot + 3)) +> (s0 ∷ default))) = + ([s1] ^ 1) +> (s0 ∷ (([s1] ^ (bot + 3)) +> (s0 ∷ default))) := rfl + rw [this, ones_add_merge] + rw [h2_eq] at h2 + exact stepPlus_trans h1 h2 + refine ⟨?_, ?_, ?_, ?_⟩ + · intro a z L R + cases L with + | nil => + dsimp only [D_cfg_bot, addBot] + have hz1 : z + 1 + bot = (z + bot) + 1 := by omega + have hz3 : z + 3 + bot = (z + bot) + 3 := by omega + rw [hz1, hz3] + exact raw_mp a (z + bot) [] R + | cons w L' => + exact raw_mp a z (addBot bot (w :: L')) R + · intro a b d L R + cases L with + | nil => + dsimp only [D_cfg_bot, addBot] + have hb2 : b + 2 + bot = (b + bot) + 2 := by omega + have hb1 : b + 1 + bot = (b + bot) + 1 := by omega + rw [hb2, hb1] + exact raw_pop a (b + bot) d [] R + | cons w L' => + exact raw_pop a b d (addBot bot (w :: L')) R + · intro d R + dsimp only [D_cfg_bot, addBot] + have hb3 : 3 + bot = bot + 3 := by omega + rw [hb3] + exact raw_edge d R + · dsimp only [D_cfg_bot, addBot] + have hb3 : 3 + bot = bot + 3 := by omega + rw [hb3] + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{0}}> (s0 ∷ default)) := by + simp only [init, Tape.mk₁, Tape.mk₂, Tape.mk', zero_cons_default, default_head, default_tail] + congr 1 <;> (apply Turing.ListBlank.ext; intro _; rfl) + rw [h0] + exact stepPlus_trans (stepPlus_trans (stepPlus_trans h_init1 h_init2) h_init3) h_init4 + +end + +section + +variable {tm : Machine (Fin 2) (Fin 6)} {D_cfg : List ℕ → TapeB → Cfg (Fin 2) (Fin 6)} +variable (R_rules : StackRules tm D_cfg) + +abbrev bot : ℕ := 0 + +include R_rules in +theorem rule_pop_end (a b : ℕ) (L : List ℕ) : + (D_cfg ((a + 2) :: (b + 2) :: L) default) [tm]⊢⁺ + (D_cfg (2 :: (a + 1) :: (b + 1) :: L) default) := by + have h := R_rules.rule_pop a b 0 L default + simp only [ones_zero_eq, zero_cons_default] at h + exact h + +def encR : List ℕ → TapeB → TapeB + | [], rest => rest + | d :: R, rest => ([s1] ^ d) +> (s0 ∷ encR R rest) + +include R_rules in +theorem r_pop (a b d : ℕ) (L R : List ℕ) (rest : TapeB) : + (D_cfg ((a + 2) :: (b + 2) :: L) (encR (d :: R) rest)) [tm]⊢⁺ + (D_cfg ((d + 2) :: (a + 1) :: (b + 1) :: L) (encR R rest)) := + R_rules.rule_pop a b d L (encR R rest) + +include R_rules in +theorem r_edge (d : ℕ) (R : List ℕ) (rest : TapeB) : + (D_cfg [bot + 3] (encR (d :: R) rest)) [tm]⊢⁺ + (D_cfg [d + 2, bot + 3] (encR R rest)) := + R_rules.rule_edge d (encR R rest) + +include R_rules in +theorem r_mp (a z : ℕ) (L R : List ℕ) (rest : TapeB) : + (D_cfg ((a + 2) :: 1 :: (z + 1) :: L) (encR R rest)) [tm]⊢⁺ + (D_cfg ((z + 3) :: L) (encR ((a + 1) :: 0 :: R) rest)) := + R_rules.rule_mp a z L (encR R rest) + +theorem D_cfg_congr {L1 L2 : List ℕ} {R1 R2 : TapeB} (hL : L1 = L2) (hR : R1 = R2) : + D_cfg L1 R1 = D_cfg L2 R2 := by + subst hL; subst hR; rfl + +def dStep (L R : List ℕ) : Option (List ℕ × List ℕ) := + match L with + | [] => none + | [x] => + match R with + | [] => none + | d :: R0 => if x == bot + 3 then some ([d + 2, bot + 3], R0) else none + | x :: y :: L2 => + match x, y with + | a + 2, 1 => + match L2 with + | (z + 1) :: L0 => some ((z + 3) :: L0, (a + 1) :: 0 :: R) + | _ => none + | a + 2, b + 2 => + match R with + | [] => none + | d :: R0 => some ((d + 2) :: (a + 1) :: (b + 1) :: L2, R0) + | _, _ => none + +def dRun : ℕ → List ℕ → List ℕ → Option (List ℕ × List ℕ) + | 0, L, R => some (L, R) + | n + 1, L, R => + match dStep L R with + | none => none + | some (L', R') => dRun n L' R' + +include R_rules in +theorem dStep_sound (L R L' R' : List ℕ) (rest : TapeB) (h : dStep L R = some (L', R')) : + (D_cfg L (encR R rest)) [tm]⊢⁺ (D_cfg L' (encR R' rest)) := by + unfold dStep at h + cases L with + | nil => simp at h + | cons x L1 => + cases L1 with + | nil => + cases R with + | nil => simp at h + | cons d R0 => + simp only at h + split at h + · rename_i hx + have hx' : x = bot + 3 := beq_iff_eq.mp hx + subst hx' + simp only [Option.some.injEq, Prod.mk.injEq] at h + obtain ⟨rfl, rfl⟩ := h + exact r_edge R_rules d R0 rest + · simp at h + | cons y L2 => + simp only at h + cases x with + | zero => simp at h + | succ x1 => + cases x1 with + | zero => simp at h + | succ a => + cases y with + | zero => simp at h + | succ y1 => + cases y1 with + | zero => + cases L2 with + | nil => simp at h + | cons z1 L0 => + cases z1 with + | zero => simp at h + | succ z => + simp only [Option.some.injEq, Prod.mk.injEq] at h + obtain ⟨rfl, rfl⟩ := h + exact r_mp R_rules a z L0 R rest + | succ b => + cases R with + | nil => simp at h + | cons d R0 => + simp only [Option.some.injEq, Prod.mk.injEq] at h + obtain ⟨rfl, rfl⟩ := h + exact r_pop R_rules a b d L2 R0 rest + +include R_rules in +theorem dRun_sound : ∀ (n : ℕ) (L R L' R' : List ℕ) (rest : TapeB), + dRun (n + 1) L R = some (L', R') → + (D_cfg L (encR R rest)) [tm]⊢⁺ (D_cfg L' (encR R' rest)) := by + intro n + induction n with + | zero => + intro L R L' R' rest h + simp only [dRun] at h + cases hs : dStep L R with + | none => rw [hs] at h; cases h + | some p => + obtain ⟨Lp, Rp⟩ := p + rw [hs] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + obtain ⟨rfl, rfl⟩ := h + exact dStep_sound R_rules L R Lp Rp rest hs + | succ n ih => + intro L R L' R' rest h + simp only [dRun] at h + cases hs : dStep L R with + | none => rw [hs] at h; cases h + | some p => + rw [hs] at h + exact stepPlus_trans (dStep_sound R_rules L R p.1 p.2 rest hs) (ih p.1 p.2 L' R' rest h) + +include R_rules in +theorem dRun_eq (n : ℕ) (L R L1 R1 : List ℕ) (rest : TapeB) {c1 c2 : Cfg (Fin 2) (Fin 6)} + (hr : dRun (n + 1) L R = some (L1, R1)) + (hc1 : D_cfg L (encR R rest) = c1) + (hc2 : D_cfg L1 (encR R1 rest) = c2) : + c1 [tm]⊢⁺ c2 := by + rw [← hc1, ← hc2] + exact dRun_sound R_rules n L R L1 R1 rest hr + +theorem pow_add_split (a b : ℕ) (s : TapeB) : + ([s1] ^ (a + b)) +> s = ([s1] ^ a) +> (([s1] ^ b) +> s) := + (ones_add_merge a b s).symm +theorem ones_two (s : TapeB) : ([s1] ^ 2) +> s = s1 ∷ (s1 ∷ s) := rfl +theorem ones_four (s : TapeB) : ([s1] ^ 4) +> s = s1 ∷ (s1 ∷ (s1 ∷ (s1 ∷ s))) := rfl +theorem pow_two_add (n : ℕ) (s : TapeB) : + ([s1] ^ (2 + n)) +> s = s1 ∷ (s1 ∷ (([s1] ^ n) +> s)) := by + rw [pow_add_split, ones_two] +theorem pow_four_add (n : ℕ) (s : TapeB) : + ([s1] ^ (4 + n)) +> s = s1 ∷ (s1 ∷ (s1 ∷ (s1 ∷ (([s1] ^ n) +> s)))) := by + rw [pow_add_split, ones_four] + +local macro "rclose_eq" : tactic => + `(tactic| refine D_cfg_congr + (by simp only [Bool.toNat, Bool.cond_false, Bool.cond_true, List.append_eq, List.cons_append, + List.nil_append, List.singleton_append]; try ring_nf) + (by simp only [encR, ones_zero_eq, ones_add_merge, pow_succ_eq, pow_zero_eq, + List.append_eq, List.cons_append, List.nil_append, List.singleton_append, + append_cons, append_nil, zero_cons_default] + try ring_nf + try simp only [pow_two_add, pow_four_add, ones_two, ones_four, pow_succ_eq, + pow_zero_eq, List.singleton_append, List.nil_append, append_cons, append_nil, + zero_cons_default])) + +local macro "run_d" n:num L:term "," R:term "," rest:term : tactic => + `(tactic| refine dRun_eq R_rules $n $L $R _ _ $rest rfl (by rclose_eq) (by rclose_eq)) + +/-! ## Section 2: Bitstring Encoding & Linear Stack-Peeling Engine -/ + +def pairVal : Bool → Bool → ℕ + | false, false => 2 + | false, true => 1 + | true, false => 3 + | true, true => 2 + +def pairValPred : Bool → Bool → ℕ + | false, false => 1 + | false, true => 0 + | true, false => 2 + | true, true => 1 + +def encS : Bool → List Bool → List ℕ + | _, [] => [] + | prev, b :: bs => 2 :: pairVal prev b :: encS b bs + +def bitW : Bool → ℕ + | false => 2 + | true => 1 + +def weight2 : List Bool → ℕ + | [] => 0 + | b :: bs => bitW b + weight2 bs + +def dropChain : Bool → List Bool → ℕ + | _, [] => 0 + | cc, b :: bs => bitW cc + dropChain b bs + +def lastAfter : Bool → List Bool → Bool + | prev, [] => prev + | _, b :: bs => lastAfter b bs + +def lastBit (s : List Bool) : Bool := lastAfter false s + +def bitTape : Bool → TapeF + | false => [s0, s0] + | true => [s1, s0, s0] + +def peelTape : List Bool → TapeB → TapeB + | [], acc => acc + | b :: bs, acc => peelTape bs (bitTape b +> acc) + +def stackTape : List Bool → TapeB → TapeB + | [], R0 => R0 + | b :: bs, R0 => bitTape b +> stackTape bs R0 + +def peelCfg (D_cfg : List ℕ → TapeB → Cfg (Fin 2) (Fin 6)) : + Bool → ℕ → ℕ → List ℕ → TapeB → Cfg (Fin 2) (Fin 6) + | false, k, w, tailL, acc => + D_cfg ([w + 2, 1, 1] ++ tailL) (([s1] ^ (2 * k)) +> (s0 ∷ acc)) + | true, 0, w, tailL, acc => + D_cfg ([3, 1] ++ tailL) (([s1] ^ (w + 1)) +> ([s0, s0] +> acc)) + | true, k' + 1, w, tailL, acc => + D_cfg ([3, 1] ++ tailL) (([s1] ^ (w + 1)) +> ([s0, s0] +> (([s1] ^ (2 * k')) +> acc))) + +theorem peelCfg_true_encR (k' w : ℕ) (tailL : List ℕ) (acc0 : TapeB) : + peelCfg D_cfg true (k' + 1) w tailL ([s1, s0, s0] +> acc0) = + D_cfg ([3, 1] ++ tailL) (encR [w + 1, 0, 2 * k' + 1, 0] acc0) := by + dsimp only [peelCfg, encR] + have hm : ([s1] ^ (2 * k')) +> ([s1, s0, s0] +> acc0) = + ([s1] ^ (2 * k' + 1)) +> ([s0, s0] +> acc0) := by + change ([s1] ^ (2 * k')) +> (([s1] ^ 1) +> ([s0, s0] +> acc0)) = _ + rw [ones_add_merge] + rw [hm]; rfl + +include R_rules in +theorem peel_step_00 (k w : ℕ) (tailL : List ℕ) (acc : TapeB) : + (peelCfg D_cfg false k w (2 :: 2 :: tailL) acc) [tm]⊢⁺ + (peelCfg D_cfg false (k + 1) (w + 2) tailL ([s0, s0] +> acc)) := by + dsimp only [peelCfg] + run_d 9 ((w + 2) :: 1 :: 1 :: 2 :: 2 :: tailL), [2 * k], acc + +include R_rules in +theorem peel_step_01 (k w : ℕ) (tailL : List ℕ) (acc : TapeB) : + (peelCfg D_cfg false k w (2 :: 1 :: tailL) acc) [tm]⊢⁺ + (peelCfg D_cfg true (k + 1) (w + 1) tailL ([s1, s0, s0] +> acc)) := by + rw [peelCfg_true_encR]; dsimp only [peelCfg] + run_d 5 ((w + 2) :: 1 :: 1 :: 2 :: 1 :: tailL), [2 * k], acc + +include R_rules in +theorem peel_step_10 (k' w : ℕ) (tailL : List ℕ) (acc0 : TapeB) : + (peelCfg D_cfg true (k' + 1) w (2 :: 3 :: tailL) ([s1, s0, s0] +> acc0)) [tm]⊢⁺ + (peelCfg D_cfg false (k' + 2) (w + 2) tailL ([s0, s0] +> ([s1, s0, s0] +> acc0))) := by + rw [peelCfg_true_encR]; dsimp only [peelCfg] + have hr : ([s1] ^ (2 * (k' + 2))) +> (s0 ∷ ([s0, s0] +> ([s1, s0, s0] +> acc0))) = + encR [2 * (k' + 2), 0, 0, 1, 0] acc0 := rfl + rw [hr] + run_d 22 ([3, 1, 2, 3] ++ tailL), [w + 1, 0, 2 * k' + 1, 0], acc0 + +include R_rules in +theorem peel_step_11 (k' w : ℕ) (tailL : List ℕ) (acc0 : TapeB) : + (peelCfg D_cfg true (k' + 1) w (2 :: 2 :: tailL) ([s1, s0, s0] +> acc0)) [tm]⊢⁺ + (peelCfg D_cfg true (k' + 2) (w + 1) tailL ([s1, s0, s0] +> ([s1, s0, s0] +> acc0))) := by + rw [peelCfg_true_encR, peelCfg_true_encR] + run_d 18 ([3, 1, 2, 2] ++ tailL), [w + 1, 0, 2 * k' + 1, 0], acc0 + +include R_rules in +theorem peel_all (s : List Bool) (prev : Bool) (k w : ℕ) (tailL : List ℕ) (acc : TapeB) + (h_inv : prev = true → ∃ k' acc0, k = k' + 1 ∧ acc = [s1, s0, s0] +> acc0) : + (peelCfg D_cfg prev k w (encS prev s ++ tailL) acc) [tm]⊢* + (peelCfg D_cfg (lastAfter prev s) (k + s.length) (w + weight2 s) tailL (peelTape s acc)) := by + induction s generalizing prev k w acc with + | nil => + simp only [encS, List.nil_append, lastAfter, List.length_nil, Nat.add_zero, weight2, peelTape] + exists 0 + | cons b bs ih => + simp only [encS, List.cons_append, lastAfter, List.length_cons, weight2, peelTape] + cases prev <;> cases b + · have h1 := peel_step_00 R_rules k w (encS false bs ++ tailL) acc + have h2 := ih false (k + 1) (w + 2) ([s0, s0] +> acc) (fun h => by cases h) + have hk : k + 1 + bs.length = k + (bs.length + 1) := by omega + have hw : w + 2 + weight2 bs = w + (bitW false + weight2 bs) := by dsimp only [bitW]; omega + rw [hk, hw] at h2 + exact stepPlus_to_stepStar (stepPlus_stepStar_trans h1 h2) + · have h1 := peel_step_01 R_rules k w (encS true bs ++ tailL) acc + have h2 := ih true (k + 1) (w + 1) ([s1, s0, s0] +> acc) (fun _ => ⟨k, acc, rfl, rfl⟩) + have hk : k + 1 + bs.length = k + (bs.length + 1) := by omega + have hw : w + 1 + weight2 bs = w + (bitW true + weight2 bs) := by dsimp only [bitW]; omega + rw [hk, hw] at h2 + exact stepPlus_to_stepStar (stepPlus_stepStar_trans h1 h2) + · obtain ⟨k', acc0, rfl, rfl⟩ := h_inv rfl + have h1 := peel_step_10 R_rules k' w (encS false bs ++ tailL) acc0 + have h2 := + ih false (k' + 2) (w + 2) ([s0, s0] +> ([s1, s0, s0] +> acc0)) (fun h => by cases h) + have hk : k' + 2 + bs.length = k' + 1 + (bs.length + 1) := by omega + have hw : w + 2 + weight2 bs = w + (bitW false + weight2 bs) := by dsimp only [bitW]; omega + rw [hk, hw] at h2 + exact stepPlus_to_stepStar (stepPlus_stepStar_trans h1 h2) + · obtain ⟨k', acc0, rfl, rfl⟩ := h_inv rfl + have h1 := peel_step_11 R_rules k' w (encS true bs ++ tailL) acc0 + have h2 := ih true (k' + 2) (w + 1) ([s1, s0, s0] +> ([s1, s0, s0] +> acc0)) + (fun _ => ⟨k' + 1, [s1, s0, s0] +> acc0, rfl, rfl⟩) + have hk : k' + 2 + bs.length = k' + 1 + (bs.length + 1) := by omega + have hw : w + 1 + weight2 bs = w + (bitW true + weight2 bs) := by dsimp only [bitW]; omega + rw [hk, hw] at h2 + exact stepPlus_to_stepStar (stepPlus_stepStar_trans h1 h2) + +theorem peelTape_eq_stack (s stk : List Bool) (R0 : TapeB) : + peelTape s (stackTape stk R0) = stackTape (s.reverse ++ stk) R0 := by + induction s generalizing stk with + | nil => simp [peelTape] + | cons b bs ih => + simp only [peelTape, List.reverse_cons, List.append_assoc, List.singleton_append] + exact ih (b :: stk) + +theorem lastAfter_snoc (prev : Bool) (u : List Bool) (x : Bool) : + lastAfter prev (u ++ [x]) = x := by + induction u generalizing prev with + | nil => rfl + | cons b bs ih => exact ih b + +theorem lastAfter_eq_last_rev (prev : Bool) (s : List Bool) : + ∀ b0 sb, s.reverse = b0 :: sb → lastAfter prev s = b0 := by + induction s generalizing prev with + | nil => intro b0 sb h; cases h + | cons x xs ih => + intro b0 sb h + simp only [List.reverse_cons] at h + cases h_rev : xs.reverse with + | nil => + rw [h_rev] at h + have hxs : xs = [] := List.reverse_eq_nil_iff.mp h_rev + subst hxs + simp only [List.nil_append, List.cons.injEq] at h + obtain ⟨rfl, _⟩ := h + rfl + | cons y ys => + rw [h_rev, List.cons_append, List.cons.injEq] at h + obtain ⟨rfl, _⟩ := h + exact ih x y ys h_rev + +/-! ## Section 3: Finite Boundary Blocks & `Sweep0 R_rules` Strong Induction -/ + +include R_rules in +theorem sweep0_r0 (c : Bool) (A B : ℕ) (tail : List ℕ) (R_rest : TapeB) : + (D_cfg ([2 + c.toNat, 1, 1, A + 3, B + 2] ++ tail) (s0 ∷ R_rest)) [tm]⊢⁺ + (D_cfg ([2, 2, 2, 1 + c.toNat, A + 1, B + 1] ++ tail) R_rest) := by + cases c + · run_d 15 ([2, 1, 1, A + 3, B + 2] ++ tail), [0], R_rest + · run_d 15 ([3, 1, 1, A + 3, B + 2] ++ tail), [0], R_rest + +include R_rules in +theorem sweep0_r1_false (c : Bool) (A B : ℕ) (tail : List ℕ) (R_rest : TapeB) : + (D_cfg ([2 + c.toNat, 1, 1, 2, 2, A + 3, B + 2] ++ tail) (s0 ∷ R_rest)) [tm]⊢⁺ + (D_cfg ([2, 2, 2, 1, 2, 2 + c.toNat, A + 1, B + 1] ++ tail) R_rest) := by + cases c + · run_d 42 ([2, 1, 1, 2, 2, A + 3, B + 2] ++ tail), [0], R_rest + · run_d 42 ([3, 1, 1, 2, 2, A + 3, B + 2] ++ tail), [0], R_rest + +include R_rules in +theorem sweep0_r1_true (c : Bool) (A B : ℕ) (tail : List ℕ) (R_rest : TapeB) : + (D_cfg ([2 + c.toNat, 1, 1, 2, 1, A + 3, B + 3] ++ tail) (s0 ∷ R_rest)) [tm]⊢⁺ + (D_cfg ([2, 2, 2, 2, 2, 1 + c.toNat, A + 1, B + 1] ++ tail) R_rest) := by + cases c + · run_d 51 ([2, 1, 1, 2, 1, A + 3, B + 3] ++ tail), [0], R_rest + · run_d 51 ([3, 1, 1, 2, 1, A + 3, B + 3] ++ tail), [0], R_rest + +include R_rules in +theorem mid_finish_false (r' w A B : ℕ) (tail : List ℕ) (rest : TapeB) : + (peelCfg D_cfg false (r' + 2) w ([A + 3, B + 2] ++ tail) ([s0, s0] +> rest)) [tm]⊢⁺ + (D_cfg ([2, 1, 1, 2 * r' + 6, w + 1, A + 1, B + 1] ++ tail) (s0 ∷ rest)) := by + dsimp only [peelCfg] + run_d 16 ((w + 2) :: 1 :: 1 :: (A + 3) :: (B + 2) :: tail), [2 * (r' + 2), 0, 0], rest + +include R_rules in +theorem mid_finish_true (r' w A B : ℕ) (tail : List ℕ) (rest : TapeB) : + (peelCfg D_cfg true (r' + 2) w ([A + 3, B + 3] ++ tail) ([s1, s0, s0] +> rest)) [tm]⊢⁺ + (D_cfg ([3, 1, 1, 2 * r' + 6, w + 1, A + 1, B + 1] ++ tail) (s0 ∷ rest)) := by + rw [peelCfg_true_encR] + run_d 29 ([3, 1, A + 3, B + 3] ++ tail), [w + 1, 0, 2 * r' + 3, 0], rest + +include R_rules in +theorem end_finish_era (r' w : ℕ) (rest : TapeB) : + (peelCfg D_cfg false (r' + 2) w [2, 1, bot + 1] ([s0, s0] +> rest)) [tm]⊢⁺ + (D_cfg [bot + 3] + ([s1, s1, s0, s0] +> + (([s1] ^ (w + 2)) +> ([s0, s0] +> (([s1] ^ (2 * r' + 5)) +> ([s0, s0, s0, + s0] +> rest)))))) := by + dsimp only [peelCfg] + run_d 6 [w + 2, 1, 1, 2, 1, bot + 1], [2 * (r' + 2), 0, 0], rest + +include R_rules in +theorem end_finish_era0 (r' w : ℕ) (rest : TapeB) : + (peelCfg D_cfg true (r' + 2) w [2, 2, bot + 1] ([s1, s0, s0] +> rest)) [tm]⊢⁺ + (D_cfg [bot + 3] + ([s1, s1, s0, s0] +> + (([s1] ^ (w + 2)) +> + ([s0, s0] +> (([s1] ^ (2 * r' + 5)) +> ([s0, s0, s1, s0, s0] +> rest)))))) := by + rw [peelCfg_true_encR] + run_d 19 [3, 1, 2, 2, bot + 1], [w + 1, 0, 2 * r' + 3, 0], rest + +include R_rules in +theorem bounce1_header (np d : ℕ) (R_in : TapeB) : + (D_cfg [bot + 3] + (([s1] ^ (2 * np + 3)) +> ([s0, s0] +> (([s1] ^ (d + 2)) +> ([s0, s0, s1, + s0] +> R_in))))) [tm]⊢⁺ + (D_cfg [3, 1, 1, d + 3, 2 * np + 2, bot + 1] R_in) := by + run_d 10 [bot + 3], [2 * np + 3, 0, d + 2, 0, 1], R_in + +include R_rules in +theorem bounce2 (p q : ℕ) (R_tail : TapeB) : + (D_cfg [bot + 3] + ([s1, s1, s0, s0] +> + (([s1] ^ (p + 2)) +> ([s0, s0] +> (([s1] ^ (q + 1)) +> ([s0, s0] +> R_tail)))))) [tm]⊢⁺ + (D_cfg [bot + 3] + (([s1] ^ (p + 3)) +> + ([s0, s0] +> (([s1] ^ (q + 3)) +> ([s0, s0, s1, s0, s0] +> R_tail))))) := by + run_d 17 [bot + 3], [2, 0, p + 2, 0, q + 1, 0], R_tail + +/-! ## Section 4: `coreS`, `run_rounds R_rules`, and `Sweep0 R_rules` -/ + +def runChain (stepFn : Bool → List Bool → List Bool) : + Bool → List Bool → List Bool → List Bool + | c, cur, [] => stepFn c cur + | c, cur, b :: bs => runChain stepFn b (stepFn c cur) bs + +def coreSFuel : ℕ → List Bool → List Bool + | 0, _ => [] + | _ + 1, [] => [] + | fuel + 1, s => + match s.reverse with + | [] => [] + | b0 :: sb => runChain (fun c cur => coreSFuel fuel cur ++ [!c]) b0 [] sb + +def coreS (s : List Bool) : List Bool := coreSFuel s.length s + +theorem coreSFuel_length : ∀ fuel (s : List Bool), + s.length ≤ fuel → (coreSFuel fuel s).length = s.length := by + intro fuel + induction fuel with + | zero => + intro s hs; cases s with | nil => rfl | cons _ _ => simp at hs + | succ fuel ih => + intro s hs + cases s with + | nil => rfl + | cons x xs => + simp only [coreSFuel] + cases h_rev : (x :: xs).reverse with + | nil => cases List.reverse_eq_nil_iff.mp h_rev + | cons b0 sb => + have h_len_rev : sb.length = xs.length := by + have := congrArg List.length h_rev; simp at this; omega + have h_chain : ∀ c (cur bs : List Bool), + cur.length + bs.length ≤ fuel → + (runChain (fun c' u => coreSFuel fuel u ++ [!c']) c cur bs).length = + cur.length + bs.length + 1 := by + intro c cur bs + induction bs generalizing c cur with + | nil => + intro hb + simp only [List.length_nil] at hb + simp only [runChain, List.length_append, List.length_singleton, List.length_nil] + rw [ih cur (by omega)] + | cons b bs ihb => + intro hb + simp only [List.length_cons] at hb + simp only [runChain, List.length_cons] + have hu : (coreSFuel fuel cur ++ [!c]).length = cur.length + 1 := by + simp only [List.length_append, List.length_singleton] + rw [ih cur (by omega)] + have := ihb b (coreSFuel fuel cur ++ [!c]) (by omega) + omega + have := h_chain b0 [] sb (by simp [h_len_rev] at hs ⊢; omega) + simpa [h_len_rev] using this + +theorem coreSFuel_eq_of_ge : ∀ f1 f2 (s : List Bool), + s.length ≤ f1 → s.length ≤ f2 → coreSFuel f1 s = coreSFuel f2 s := by + intro f1 + induction f1 with + | zero => + intro f2 s h1 _; cases s with | nil => cases f2 <;> rfl | cons _ _ => simp at h1 + | succ f1 ih => + intro f2 s h1 h2 + cases f2 with + | zero => cases s with | nil => rfl | cons _ _ => simp at h2 + | succ f2 => + cases s with + | nil => rfl + | cons x xs => + simp only [coreSFuel] + cases h_rev : (x :: xs).reverse with + | nil => cases List.reverse_eq_nil_iff.mp h_rev + | cons b0 sb => + have h_len_rev : sb.length = xs.length := by + have := congrArg List.length h_rev; simp at this; omega + have h_chain : ∀ c (cur bs : List Bool), + cur.length + bs.length ≤ xs.length → + runChain (fun c' u => coreSFuel f1 u ++ [!c']) c cur bs = + runChain (fun c' u => coreSFuel f2 u ++ [!c']) c cur bs := by + intro c cur bs + induction bs generalizing c cur with + | nil => + intro hb; simp only [List.length_nil] at hb; simp only [runChain] + rw [ih f2 cur (by simp at h1; omega) (by simp at h2; omega)] + | cons b bs ihb => + intro hb; simp only [List.length_cons] at hb; simp only [runChain] + rw [ih f2 cur (by simp at h1; omega) (by simp at h2; omega)] + have hlen2 : (coreSFuel f2 cur ++ [!c]).length = cur.length + 1 := by + simp only [List.length_append, List.length_singleton] + rw [coreSFuel_length f2 cur (by simp at h2; omega)] + exact ihb b (coreSFuel f2 cur ++ [!c]) (by omega) + exact h_chain b0 [] sb (by simp [h_len_rev]) + +theorem coreS_length (s : List Bool) : (coreS s).length = s.length := + coreSFuel_length s.length s (Nat.le_refl _) + +theorem runChain_length (cc : Bool) (cur bs : List Bool) : + (runChain (fun c' u => coreS u ++ [!c']) cc cur bs).length = cur.length + bs.length + 1 := by + induction bs generalizing cc cur with + | nil => simp [runChain, coreS_length] + | cons b bs ih => simp [runChain, ih, coreS_length]; omega + +theorem coreS_unfold {s : List Bool} {b0 : Bool} {sb : List Bool} + (h_rev : s.reverse = b0 :: sb) : + coreS s = runChain (fun c cur => coreS cur ++ [!c]) b0 [] sb := by + have hs_len : s.length = sb.length + 1 := by + have := congrArg List.length h_rev; simp at this; omega + unfold coreS + cases h_s : s with + | nil => simp [h_s] at h_rev + | cons x xs => + have hf : xs.length = sb.length := by simpa [h_s] using hs_len + simp only [List.length_cons, coreSFuel, h_s ▸ h_rev] + have h_chain : ∀ c (cur bs : List Bool), + cur.length + bs.length ≤ xs.length → + runChain (fun c' u => coreSFuel xs.length u ++ [!c']) c cur bs = + runChain (fun c' u => coreS u ++ [!c']) c cur bs := by + intro c cur bs + induction bs generalizing c cur with + | nil => + intro hb; simp only [List.length_nil] at hb; simp only [runChain] + rw [coreSFuel_eq_of_ge xs.length cur.length cur (by omega) (Nat.le_refl _)] + rfl + | cons b bs ihb => + intro hb; simp only [List.length_cons] at hb; simp only [runChain] + rw [coreSFuel_eq_of_ge xs.length cur.length cur (by omega) (Nat.le_refl _)] + have hlen2 : (coreS cur ++ [!c]).length = cur.length + 1 := by simp [coreS_length] + exact ihb b (coreS cur ++ [!c]) (by omega) + exact h_chain b0 [] sb (by simp [hf]) + +theorem encS_snoc (prev : Bool) (u : List Bool) (x : Bool) : + encS prev (u ++ [x]) = encS prev u ++ [2, pairVal (lastAfter prev u) x] := by + induction u generalizing prev with + | nil => rfl + | cons b bs ih => simp only [List.cons_append, encS, lastAfter]; rw [ih b] + +theorem bitTape_as_ones (b : Bool) (R0 : TapeB) : + bitTape b +> R0 = ([s1] ^ b.toNat) +> (s0 ∷ (s0 ∷ R0)) := by + cases b <;> rfl + +theorem weight2_append (u v : List Bool) : + weight2 (u ++ v) = weight2 u + weight2 v := by + induction u with + | nil => simp [weight2] + | cons b bs ih => simp [weight2, ih]; omega + +theorem weight2_reverse (s : List Bool) : weight2 s.reverse = weight2 s := by + induction s with + | nil => rfl + | cons b bs ih => simp [List.reverse_cons, weight2_append, weight2, ih]; omega + +theorem dropChain_snoc (cc : Bool) (mid : List Bool) (x : Bool) : + dropChain cc (mid ++ [x]) = bitW cc + weight2 mid := by + induction mid generalizing cc with + | nil => simp [dropChain, weight2] + | cons y ys ih => simp [dropChain, weight2, ih] + +theorem runChain_lastAfter (prev cc : Bool) (cur mid : List Bool) (x : Bool) : + lastAfter prev (runChain (fun c' u => coreS u ++ [!c']) cc cur (mid ++ [x])) = !x := by + induction mid generalizing cc cur with + | nil => simp [runChain, lastAfter_snoc] + | cons y ys ih => + simp only [List.cons_append, runChain] + exact ih y (coreS cur ++ [!cc]) + +include R_rules in +theorem run_rounds (N : ℕ) + (h_sweep : ∀ s, s.length ≤ N → ∀ c A B tail R_rest, + (D_cfg ([2 + c.toNat, 1, 1] ++ encS false s ++ + [A + 3, B + (1 + (lastBit s).toNat) + 1] ++ tail) (s0 ∷ R_rest)) [tm]⊢⁺ + (D_cfg ([2, 2] ++ encS false (coreS s ++ [!c]) ++ [A + 1, B + 1] ++ tail) R_rest)) + (cc : Bool) (cur bs : List Bool) (A_base B_rem : ℕ) (tail : List ℕ) (R_after : TapeB) + (hbound : cur.length + bs.length ≤ N) : + (D_cfg ([2 + cc.toNat, 1, 1] ++ encS false cur ++ + [2 * bs.length + A_base + 3, + B_rem + (1 + (lastBit cur).toNat) + dropChain cc bs + 1] ++ tail) + (s0 ∷ stackTape bs R_after)) [tm]⊢⁺ + (D_cfg ([2, 2] ++ encS false (runChain (fun c' u => coreS u ++ [!c']) cc cur bs) ++ + [A_base + 1, B_rem + 1] ++ tail) R_after) := by + induction bs generalizing cc cur with + | nil => + simp only [List.length_nil, Nat.mul_zero, Nat.zero_add, dropChain, Nat.add_zero, + stackTape, runChain] at hbound ⊢ + exact h_sweep cur (by omega) cc A_base B_rem tail R_after + | cons b_next bs_rem ih_bs => + simp only [List.length_cons, dropChain, stackTape, runChain] at hbound ⊢ + have h1 := h_sweep cur (by omega) cc (2 * bs_rem.length + A_base + 2) + (B_rem + (bitW cc + dropChain b_next bs_rem)) tail + (bitTape b_next +> stackTape bs_rem R_after) + have hA : 2 * bs_rem.length + A_base + 2 + 3 = 2 * (bs_rem.length + 1) + A_base + 3 := by + omega + have hB : B_rem + (bitW cc + dropChain b_next bs_rem) + (1 + (lastBit cur).toNat) + 1 = + B_rem + (1 + (lastBit cur).toNat) + (bitW cc + dropChain b_next bs_rem) + 1 := by + omega + rw [hA, hB] at h1 + let u_next := coreS cur ++ [!cc] + have h_pop : (D_cfg ([2, 2] ++ encS false u_next ++ + [2 * bs_rem.length + A_base + 3, + B_rem + (bitW cc + dropChain b_next bs_rem) + 1] ++ tail) + (bitTape b_next +> stackTape bs_rem R_after)) [tm]⊢⁺ + (D_cfg ([2 + b_next.toNat, 1, 1] ++ encS false u_next ++ + [2 * bs_rem.length + A_base + 3, + B_rem + (bitW cc + dropChain b_next bs_rem) + 1] ++ tail) + (s0 ∷ stackTape bs_rem R_after)) := by + rw [bitTape_as_ones] + have hp := R_rules.rule_pop 0 0 b_next.toNat + (encS false u_next ++ + [2 * bs_rem.length + A_base + 3, + B_rem + (bitW cc + dropChain b_next bs_rem) + 1] ++ tail) + (s0 ∷ stackTape bs_rem R_after) + simp only [List.append_assoc, List.cons_append, List.nil_append, Nat.zero_add, + Nat.add_comm b_next.toNat 2] at hp ⊢ + exact hp + have hu_len : u_next.length = cur.length + 1 := by simp [u_next, coreS_length] + have hu_last : 1 + (lastBit u_next).toNat = bitW cc := by + have hl : lastBit u_next = !cc := lastAfter_snoc false (coreS cur) (!cc) + rw [hl]; cases cc <;> rfl + have h3 := ih_bs b_next u_next (by omega) + rw [hu_last, Nat.add_assoc B_rem (bitW cc) (dropChain b_next bs_rem)] at h3 + have hA1 : 2 * bs_rem.length + A_base + 2 + 1 = 2 * bs_rem.length + A_base + 3 := by omega + rw [hA1] at h1 + exact stepPlus_trans (stepPlus_trans h1 h_pop) h3 + +set_option maxHeartbeats 2000000 in +-- Justification: Strong induction over bitstring length. +include R_rules in +theorem Sweep0 : ∀ (n : ℕ) (s : List Bool), s.length ≤ n → + ∀ (c : Bool) (A B : ℕ) (tail : List ℕ) (R_rest : TapeB), + (D_cfg ([2 + c.toNat, 1, 1] ++ encS false s ++ + [A + 3, B + (1 + (lastBit s).toNat) + 1] ++ tail) (s0 ∷ R_rest)) [tm]⊢⁺ + (D_cfg ([2, 2] ++ encS false (coreS s ++ [!c]) ++ [A + 1, B + 1] ++ tail) R_rest) := by + intro n + induction n with + | zero => + intro s hs c A B tail R_rest + cases s with + | nil => + cases c + · exact sweep0_r0 R_rules false A B tail R_rest + · exact sweep0_r0 R_rules true A B tail R_rest + | cons _ _ => simp at hs + | succ n ih => + intro s hs c A B tail R_rest + cases s with + | nil => + cases c + · exact sweep0_r0 R_rules false A B tail R_rest + · exact sweep0_r0 R_rules true A B tail R_rest + | cons x1 s1 => + cases s1 with + | nil => + cases x1 + · cases c + · exact sweep0_r1_false R_rules false A B tail R_rest + · exact sweep0_r1_false R_rules true A B tail R_rest + · cases c + · exact sweep0_r1_true R_rules false A B tail R_rest + · exact sweep0_r1_true R_rules true A B tail R_rest + | cons x2 xs => + let r' := xs.length + cases h_rev2 : (x2 :: xs).reverse with + | nil => cases List.reverse_eq_nil_iff.mp h_rev2 + | cons b0 mid => + have hmid_len : mid.length = r' := by + have := congrArg List.length h_rev2; simp at this; omega + have h_rev : (x1 :: x2 :: xs).reverse = b0 :: (mid ++ [x1]) := by + simp [List.reverse_cons, h_rev2] + have h_last : lastBit (x1 :: x2 :: xs) = b0 := + lastAfter_eq_last_rev false (x1 :: x2 :: xs) b0 (mid ++ [x1]) h_rev + have h_peel := peel_all R_rules (x1 :: x2 :: xs) false 0 c.toNat + ([A + 3, B + (1 + b0.toNat) + 1] ++ tail) R_rest (fun h => by cases h) + have h_tape : peelTape (x1 :: x2 :: xs) R_rest = + bitTape b0 +> stackTape (mid ++ [x1]) R_rest := by + simpa [stackTape, h_rev] using peelTape_eq_stack (x1 :: x2 :: xs) [] R_rest + have h_la : lastAfter false (x1 :: x2 :: xs) = b0 := h_last + have h_len_s : (x1 :: x2 :: xs).length = r' + 2 := by simp [r'] + rw [h_la, Nat.zero_add, h_len_s, h_tape] at h_peel + have h_mid : (peelCfg D_cfg b0 (r' + 2) (c.toNat + weight2 (x1 :: x2 :: xs)) + ([A + 3, B + (1 + b0.toNat) + 1] ++ tail) + (bitTape b0 +> stackTape (mid ++ [x1]) R_rest)) [tm]⊢⁺ + (D_cfg ([b0.toNat + 2, 1, 1, 2 * r' + 6, + c.toNat + weight2 (x1 :: x2 :: xs) + 1, A + 1, B + 1] ++ tail) + (s0 ∷ stackTape (mid ++ [x1]) R_rest)) := by + cases b0 + · exact mid_finish_false R_rules r' (c.toNat + weight2 (x1 :: x2 :: xs)) A B tail + (stackTape (mid ++ [x1]) R_rest) + · exact mid_finish_true R_rules r' (c.toNat + weight2 (x1 :: x2 :: xs)) A B tail + (stackTape (mid ++ [x1]) R_rest) + have h_p1 : (D_cfg ([2 + c.toNat, 1, 1] ++ encS false (x1 :: x2 :: xs) ++ + [A + 3, B + (1 + (lastBit (x1 :: x2 :: xs)).toNat) + 1] ++ tail) + (s0 ∷ R_rest)) [tm]⊢⁺ + (D_cfg ([2 + b0.toNat, 1, 1, 2 * r' + 6, + c.toNat + weight2 (x1 :: x2 :: xs) + 1, A + 1, B + 1] ++ tail) + (s0 ∷ stackTape (mid ++ [x1]) R_rest)) := by + rw [h_last] + have h0 : peelCfg D_cfg false 0 c.toNat + (encS false (x1 :: x2 :: xs) ++ ([A + 3, B + (1 + b0.toNat) + 1] ++ tail)) R_rest = + D_cfg ([2 + c.toNat, 1, 1] ++ encS false (x1 :: x2 :: xs) ++ + [A + 3, B + (1 + b0.toNat) + 1] ++ tail) (s0 ∷ R_rest) := by + unfold peelCfg + simp only [List.append_assoc, Nat.mul_zero, ones_zero_eq, Nat.add_comm c.toNat 2] + rw [← h0, Nat.add_comm 2 b0.toNat] + exact stepStar_stepPlus_trans h_peel h_mid + have h_sub := run_rounds R_rules n ih b0 [] (mid ++ [x1]) 1 (pairValPred (!x1) (!c)) + ((A + 1) :: (B + 1) :: tail) R_rest (by simp [r', hmid_len] at hs ⊢; omega) + have hA_eq : 2 * (mid ++ [x1]).length + 1 + 3 = 2 * r' + 6 := by + simp [hmid_len]; omega + have hB_eq : pairValPred (!x1) (!c) + (1 + (lastBit []).toNat) + + dropChain b0 (mid ++ [x1]) + 1 = + c.toNat + weight2 (x1 :: x2 :: xs) + 1 := by + have hd := dropChain_snoc b0 mid x1 + have hw2 := weight2_reverse (x2 :: xs) + rw [h_rev2] at hw2 + simp only [weight2] at hw2 ⊢ + have hpv : pairValPred (!x1) (!c) + 1 = c.toNat + bitW x1 := by + cases x1 <;> cases c <;> rfl + have hl0 : (lastBit []).toNat = 0 := rfl + omega + simp only [encS] at h_sub + rw [hA_eq, hB_eq] at h_sub + have h_end_eq : D_cfg ([2, 2] ++ + encS false (runChain (fun c' u => coreS u ++ [!c']) b0 [] (mid ++ [x1])) ++ + [2, pairValPred (!x1) (!c) + 1] ++ ((A + 1) :: (B + 1) :: tail)) R_rest = + D_cfg ([2, 2] ++ encS false (coreS (x1 :: x2 :: xs) ++ [!c]) ++ + [A + 1, B + 1] ++ tail) R_rest := by + rw [← coreS_unfold h_rev, encS_snoc] + have hla : lastAfter false (coreS (x1 :: x2 :: xs)) = !x1 := by + rw [coreS_unfold h_rev] + exact runChain_lastAfter false b0 [] mid x1 + have hpv : pairValPred (!x1) (!c) + 1 = pairVal (!x1) (!c) := by + cases x1 <;> cases c <;> rfl + rw [hla, hpv] + simp only [List.append_assoc, List.cons_append, List.nil_append] + rw [h_end_eq] at h_sub + exact stepPlus_trans h_p1 h_sub + +/-! ## Section 5: Theorem 1 (`coreS_book_le`) & Theorem 2 (`hamming_coreS_and_chain`) -/ + +theorem rc_snoc (cc : Bool) (cur xs : List Bool) (b : Bool) : + runChain (fun c u => coreS u ++ [!c]) cc cur (xs ++ [b]) = + coreS (runChain (fun c u => coreS u ++ [!c]) cc cur xs) ++ [!b] := by + induction xs generalizing cc cur with + | nil => rfl + | cons y ys ih => exact ih y (coreS cur ++ [!cc]) + +theorem coreS_book_le : ∀ (M d : ℕ), d ≤ M → + coreS (true :: (List.replicate d false ++ [true])) = + true :: List.replicate (d + 1) false := by + intro M + induction M with + | zero => + intro d hd + have : d = 0 := by omega + subst this; rfl + | succ M ih => + intro d hd + cases d with + | zero => rfl + | succ d' => + have h_pal : (true :: (List.replicate (d' + 1) false ++ [true])).reverse = + true :: (List.replicate (d' + 1) false ++ [true]) := by + simp [List.reverse_append, List.reverse_replicate] + rw [coreS_unfold h_pal] + have h_z : ∀ k, k ≤ d' → + runChain (fun c u => coreS u ++ [!c]) true [] (List.replicate (k + 1) false) = + true :: (List.replicate k false ++ [true]) := by + intro k + induction k with + | zero => intro _; rfl + | succ k ihk => + intro hk + have h_rep : List.replicate (k + 2) false = + List.replicate (k + 1) false ++ [false] := by + rw [List.replicate_succ'] + rw [h_rep, rc_snoc, ihk (by omega), ih k (by omega)] + simp + rw [rc_snoc, h_z d' (Nat.le_refl _), ih d' (by omega)] + simp [List.replicate_succ'] + +theorem era0_chain (k : ℕ) : + runChain (fun c u => coreS u ++ [!c]) true [] (List.replicate (k + 1) false) = + true :: (List.replicate k false ++ [true]) := by + induction k with + | zero => rfl + | succ k ih => + have h_rep : List.replicate (k + 2) false = List.replicate (k + 1) false ++ [false] := by + rw [List.replicate_succ'] + rw [h_rep, rc_snoc, ih, coreS_book_le k k (Nat.le_refl _)] + simp + +def bitDiff (a b : Bool) : ℕ := if a == b then 0 else 1 + +def hamming : List Bool → List Bool → ℕ + | [], _ => 0 + | _, [] => 0 + | x :: xs, y :: ys => bitDiff x y + hamming xs ys + +theorem bitDiff_not (a b : Bool) : bitDiff (!a) (!b) = bitDiff a b := by + cases a <;> cases b <;> rfl + +theorem hamming_self (xs : List Bool) : hamming xs xs = 0 := by + induction xs with + | nil => rfl + | cons x xs ih => simp [hamming, bitDiff, ih] + +theorem hamming_snoc (xs ys : List Bool) (a b : Bool) (h : xs.length = ys.length) : + hamming (xs ++ [a]) (ys ++ [b]) = hamming xs ys + bitDiff a b := by + induction xs generalizing ys with + | nil => + cases ys with + | nil => simp [hamming] + | cons _ _ => simp at h + | cons x xs ih => + cases ys with + | nil => simp at h + | cons y ys => + simp only [List.length_cons] at h + simp only [List.cons_append, hamming, ih ys (by omega), Nat.add_assoc] + +theorem hamming_reverse (xs ys : List Bool) (h : xs.length = ys.length) : + hamming xs.reverse ys.reverse = hamming xs ys := by + induction xs generalizing ys with + | nil => + cases ys with + | nil => rfl + | cons _ _ => simp at h + | cons x xs ih => + cases ys with + | nil => simp at h + | cons y ys => + simp only [List.length_cons] at h + have hlen' : xs.length = ys.length := by omega + simp only [List.reverse_cons, hamming] + rw [hamming_snoc xs.reverse ys.reverse x y (by simp [hlen'])] + rw [ih ys hlen'] + omega + +theorem hamming_coreS_and_chain : ∀ (M : ℕ), + (∀ (s1 s2 : List Bool), s1.length ≤ M → s1.length = s2.length → + hamming (coreS s1) (coreS s2) = hamming s1 s2) ∧ + (∀ cc1 cc2 (u1 u2 bs1 bs2 : List Bool), + u1.length = u2.length → bs1.length = bs2.length → + u1.length + bs1.length ≤ M → + hamming (runChain (fun c u => coreS u ++ [!c]) cc1 u1 bs1) + (runChain (fun c u => coreS u ++ [!c]) cc2 u2 bs2) = + bitDiff cc1 cc2 + hamming u1 u2 + hamming bs1 bs2) := by + have h_chain_of : ∀ (M : ℕ) + (ih_core : ∀ (s1 s2 : List Bool), s1.length ≤ M → s1.length = s2.length → + hamming (coreS s1) (coreS s2) = hamming s1 s2), + ∀ cc1 cc2 (u1 u2 bs1 bs2 : List Bool), + u1.length = u2.length → bs1.length = bs2.length → + u1.length + bs1.length ≤ M → + hamming (runChain (fun c u => coreS u ++ [!c]) cc1 u1 bs1) + (runChain (fun c u => coreS u ++ [!c]) cc2 u2 bs2) = + bitDiff cc1 cc2 + hamming u1 u2 + hamming bs1 bs2 := by + intro M ih_core cc1 cc2 u1 u2 bs1 + induction bs1 generalizing cc1 cc2 u1 u2 with + | nil => + intro bs2 hu hbs hM + cases bs2 with + | nil => + simp only [List.length_nil] at hM + simp only [runChain, hamming] + rw [hamming_snoc (coreS u1) (coreS u2) (!cc1) (!cc2) (by simp [coreS_length, hu]), + ih_core u1 u2 (by omega) hu, bitDiff_not] + omega + | cons _ _ => simp at hbs + | cons y1 ys1 ihb => + intro bs2 hu hbs hM + cases bs2 with + | nil => simp at hbs + | cons y2 ys2 => + simp only [List.length_cons] at hbs hM + simp only [runChain, hamming] + have hu' : (coreS u1 ++ [!cc1]).length = (coreS u2 ++ [!cc2]).length := by + simp [coreS_length, hu] + have h_rec := ihb y1 y2 (coreS u1 ++ [!cc1]) (coreS u2 ++ [!cc2]) ys2 + hu' (by omega) (by simp [coreS_length] at *; omega) + have h_ham_u : hamming (coreS u1 ++ [!cc1]) (coreS u2 ++ [!cc2]) = + hamming u1 u2 + bitDiff cc1 cc2 := by + rw [hamming_snoc (coreS u1) (coreS u2) (!cc1) (!cc2) (by simp [coreS_length, hu]), + ih_core u1 u2 (by omega) hu, bitDiff_not] + rw [h_rec, h_ham_u] + omega + intro M + induction M with + | zero => + have hc0 : ∀ (s1 s2 : List Bool), s1.length ≤ 0 → s1.length = s2.length → + hamming (coreS s1) (coreS s2) = hamming s1 s2 := by + intro s1 s2 h1 _ + cases s1 with + | nil => cases s2 <;> simp [hamming, coreS, coreSFuel] + | cons _ _ => simp at h1 + exact ⟨hc0, h_chain_of 0 hc0⟩ + | succ M ih => + have hcS : ∀ (s1 s2 : List Bool), s1.length ≤ M + 1 → s1.length = s2.length → + hamming (coreS s1) (coreS s2) = hamming s1 s2 := by + intro s1 s2 h1 hlen + cases s1 with + | nil => + cases s2 with + | nil => rfl + | cons _ _ => simp at hlen + | cons x1 xs1 => + cases s2 with + | nil => simp at hlen + | cons x2 xs2 => + have h_rev_len : (x1 :: xs1).reverse.length = (x2 :: xs2).reverse.length := by + rw [List.length_reverse, List.length_reverse, hlen] + cases hr1 : (x1 :: xs1).reverse with + | nil => cases List.reverse_eq_nil_iff.mp hr1 + | cons b0 sb1 => + cases hr2 : (x2 :: xs2).reverse with + | nil => cases List.reverse_eq_nil_iff.mp hr2 + | cons c0 sb2 => + rw [hr1, hr2] at h_rev_len + simp only [List.length_cons] at h_rev_len + have hsb1_len : sb1.length ≤ M := by + have := congrArg List.length hr1; simp at this h1; omega + rw [coreS_unfold hr1, coreS_unfold hr2] + have h_tot := ih.2 b0 c0 [] [] sb1 sb2 rfl (by omega) (by simp [hsb1_len]) + have h_rev_ham := hamming_reverse (x1 :: xs1) (x2 :: xs2) hlen + rw [hr1, hr2] at h_rev_ham + simp only [hamming] at h_tot h_rev_ham ⊢ + omega + exact ⟨hcS, h_chain_of (M + 1) hcS⟩ + +theorem hamming_single_true (u' v' : ℕ) : + hamming (List.replicate u' false ++ (true :: List.replicate v' false)) + (List.replicate (u' + v' + 1) false) = 1 := by + induction u' with + | zero => + simp [List.replicate_succ, hamming, bitDiff, hamming_self] + | succ u' ih => + have heq : List.replicate (u' + 1 + v' + 1) false = + false :: List.replicate (u' + v' + 1) false := by + rw [show u' + 1 + v' + 1 = (u' + v' + 1) + 1 by omega, List.replicate_succ] + rw [heq] + simp only [List.replicate_succ, List.cons_append, hamming, bitDiff, beq_self_eq_true, + ↓reduceIte, Nat.zero_add] + exact ih + +theorem hamming_zero_rep : ∀ (k : ℕ) (xs : List Bool), + xs.length = k → hamming xs (List.replicate k false) = 0 → + xs = List.replicate k false := by + intro k + induction k with + | zero => + intro xs hlen _; cases xs with | nil => rfl | cons _ _ => simp at hlen + | succ k ih => + intro xs hlen hham + cases xs with + | nil => simp at hlen + | cons x xs => + simp only [List.length_cons] at hlen + simp only [List.replicate_succ, hamming] at hham ⊢ + cases x + · simp only [bitDiff, beq_self_eq_true, ↓reduceIte, Nat.zero_add] at hham + rw [ih xs (by omega) hham] + · simp [bitDiff] at hham + +theorem hamming_one_rep : ∀ (k : ℕ) (xs : List Bool), + xs.length = k → hamming xs (List.replicate k false) = 1 → + ∃ a b, a + b + 1 = k ∧ xs = List.replicate a false ++ (true :: List.replicate b false) := by + intro k + induction k with + | zero => + intro xs hlen hham; cases xs with | nil => simp [hamming] at hham | cons _ _ => simp at hlen + | succ k ih => + intro xs hlen hham + cases xs with + | nil => simp at hlen + | cons x xs => + simp only [List.length_cons] at hlen + simp only [List.replicate_succ, hamming] at hham + cases x + · simp only [bitDiff, beq_self_eq_true, ↓reduceIte, Nat.zero_add] at hham + obtain ⟨a, b, hab, rfl⟩ := ih xs (by omega) hham + exact ⟨a + 1, b, by omega, by simp [List.replicate_succ]⟩ + · have h0 : hamming xs (List.replicate k false) = 0 := by simp [bitDiff] at hham; omega + rw [hamming_zero_rep k xs (by omega) h0] + exact ⟨0, k, by omega, rfl⟩ + +/-! ## Section 6: Canonical Closed Invariant `GoodCfg` & Full `IsNotHalt` Proof -/ + +def Era0_cfg (D_cfg : List ℕ → TapeB → Cfg (Fin 2) (Fin 6)) (m : ℕ) : Cfg (Fin 2) (Fin 6) := + D_cfg [bot + 3] + (([s1] ^ (2 * m + 1)) +> ([s0, s0] +> (([s1] ^ (2 * m + 1)) +> ([s0, s0, s1] +> default)))) + +def Era_cfg (D_cfg : List ℕ → TapeB → Cfg (Fin 2) (Fin 6)) (u v : ℕ) : Cfg (Fin 2) (Fin 6) := + let m := u + v + D_cfg [bot + 3] + (([s1] ^ (2 * m + 1)) +> ([s0, s0] +> (([s1] ^ (2 * m + 3)) +> + ([s0, s0, s1] +> (([s0] ^ (2 * u)) +> ([s1] +> (([s0] ^ (2 * v)) +> ([s1] +> default)))))))) + +inductive GoodCfg (D_cfg : List ℕ → TapeB → Cfg (Fin 2) (Fin 6)) : Cfg (Fin 2) (Fin 6) → Prop + | era0 (m : ℕ) (hm : 1 ≤ m) : GoodCfg D_cfg (Era0_cfg D_cfg m) + | era (u v : ℕ) (hu : 1 ≤ u) (hv : 1 ≤ v) : GoodCfg D_cfg (Era_cfg D_cfg u v) + +theorem stackTape_append (xs ys : List Bool) (R0 : TapeB) : + stackTape (xs ++ ys) R0 = stackTape xs (stackTape ys R0) := by + induction xs with + | nil => rfl + | cons b bs ih => simp [stackTape, ih] + +theorem stackTape_rep_false_default (k : ℕ) : + stackTape (List.replicate k false) default = default := by + induction k with + | zero => rfl + | succ k ih => simp [List.replicate_succ, stackTape, bitTape, ih] + +theorem stackTape_rep_false (k : ℕ) (R0 : TapeB) : + stackTape (List.replicate k false) R0 = ([s0] ^ (2 * k)) +> R0 := by + induction k with + | zero => rfl + | succ k ih => + simp only [List.replicate_succ, stackTape, bitTape, ih] + have h0 : [s0, s0] +> (([s0] ^ (2 * k)) +> R0) = ([s0] ^ 2) +> (([s0] ^ (2 * k)) +> R0) := rfl + rw [h0, zeros_add_merge, show 2 + 2 * k = 2 * (k + 1) by omega] + +theorem weight2_rep_false (k : ℕ) : weight2 (List.replicate k false) = 2 * k := by + induction k with + | zero => rfl + | succ k ih => simp [List.replicate_succ, weight2, bitW, ih]; omega + +theorem dropChain_rep_false (k : ℕ) : + dropChain true (List.replicate (k + 1) false) = 1 + 2 * k := by + rw [List.replicate_succ', dropChain_snoc, weight2_rep_false]; rfl + +include R_rules in +theorem hit0_to_era0_1 : (D_cfg [bot + 3] (s1 ∷ default)) [tm]⊢⁺ (Era0_cfg D_cfg 1) := by + unfold Era0_cfg + run_d 44 [bot + 3], [1, 0, 0, 0, 0, 0], default + +include R_rules in +theorem era0_1_to_2 : (Era0_cfg D_cfg 1) [tm]⊢⁺ (Era0_cfg D_cfg 2) := by + unfold Era0_cfg + run_d 62 [bot + 3], [3, 0, 3, 0, 1, 0, 0, 0], default + +set_option maxHeartbeats 2000000 in +-- Justification: Multi-phase era transition. +include R_rules in +theorem step_era0_succ (k : ℕ) : + (Era0_cfg D_cfg (k + 2)) [tm]⊢⁺ (Era_cfg D_cfg 1 (k + 1)) := by + let m := k + 2 + have h_hdr : (Era0_cfg D_cfg m) [tm]⊢⁺ (D_cfg [3, 1, 1, 2 * m + 2, 2 * m, bot + 1] default) := by + unfold Era0_cfg + have h := bounce1_header R_rules (k + 1) (2 * k + 3) default + have hm1 : 2 * (k + 1) + 3 = 2 * m + 1 := by omega + have hm2 : 2 * k + 3 + 2 = 2 * m + 1 := by omega + have hm3 : 2 * k + 3 + 3 = 2 * m + 2 := by omega + have hm4 : 2 * (k + 1) + 2 = 2 * m := by omega + rw [hm1, hm2, hm3, hm4] at h + simp only [append_cons, append_nil, zero_cons_default] at h ⊢ + exact h + let cs := List.replicate (k + 1) false + let sf := true :: (List.replicate k false ++ [true]) + have h_rnd : (D_cfg [3, 1, 1, 2 * m + 2, 2 * m, bot + 1] default) [tm]⊢⁺ + (D_cfg ([2, 2] ++ encS false sf ++ [2, 2, bot + 1]) default) := by + have hr := run_rounds R_rules m (Sweep0 R_rules m) true [] cs 1 1 [bot + 1] default + (by simp [cs, m]) + have hcs_tape : s0 ∷ stackTape cs default = default := by + rw [stackTape_rep_false_default]; exact zero_cons_default + have hA : 2 * cs.length + 1 + 3 = 2 * m + 2 := by simp [cs, m]; omega + have hB : 1 + (1 + (lastBit []).toNat) + dropChain true cs + 1 = 2 * m := by + have hdc := dropChain_rep_false k + have hl0 : (lastBit []).toNat = 0 := rfl + simp only [cs] at hdc ⊢ + omega + simp only [encS] at hr + rw [hcs_tape, hA, hB, era0_chain k] at hr + simpa [sf, List.append_assoc] using hr + have h_pop0 : (D_cfg ([2, 2] ++ encS false sf ++ [2, 2, bot + 1]) default) [tm]⊢⁺ + (peelCfg D_cfg false 0 0 (encS false sf ++ [2, 2, bot + 1]) default) := by + unfold peelCfg + simp only [List.cons_append, List.nil_append, Nat.mul_zero, ones_zero_eq, zero_cons_default] + exact rule_pop_end R_rules 0 0 (encS false sf ++ [2, 2, bot + 1]) + have h_peel := peel_all R_rules sf false 0 0 [2, 2, bot + 1] default (fun h => by cases h) + have h_sf_la : lastAfter false sf = true := by + simp [sf, lastAfter, lastAfter_snoc] + have h_sf_len : 0 + sf.length = k + 2 := by simp [sf] + have h_sf_w : 0 + weight2 sf = 2 * k + 2 := by + simp [sf, weight2, weight2_append, weight2_rep_false, bitW]; omega + let tail_era0 : TapeB := ([s0] ^ (2 * k)) +> ([s1] +> default) + have h_sf_tape : peelTape sf default = [s1, s0, s0] +> tail_era0 := by + have hp := peelTape_eq_stack sf [] default + dsimp only [stackTape] at hp + have hrev : sf.reverse = true :: (List.replicate k false ++ [true]) := by + simp [sf, List.reverse_append, List.reverse_replicate] + rw [hrev, List.append_nil] at hp + rw [hp] + have hst : stackTape (List.replicate k false ++ [true]) default = tail_era0 := by + rw [stackTape_append, stackTape_rep_false] + simp [stackTape, bitTape, tail_era0] + simp [stackTape, bitTape, hst] + rw [h_sf_la, h_sf_len, h_sf_w, h_sf_tape] at h_peel + have h_end := end_finish_era0 R_rules k (2 * k + 2) tail_era0 + have h_b2 := bounce2 R_rules (2 * k + 2) (2 * k + 4) ([s1, s0, s0] +> tail_era0) + have h_mid_eq : D_cfg [bot + 3] + ([s1, s1, s0, s0] +> (([s1] ^ (2 * k + 2 + 2)) +> + ([s0, s0] +> (([s1] ^ (2 * k + 5)) +> ([s0, s0, s1, s0, s0] +> tail_era0))))) = + D_cfg [bot + 3] + ([s1, s1, s0, s0] +> (([s1] ^ (2 * k + 2 + 2)) +> + ([s0, s0] +> (([s1] ^ (2 * k + 4 + 1)) +> ([s0, s0] +> ([s1, s0, s0] +> tail_era0)))))) := + by + congr 1 + rw [h_mid_eq] at h_end + have h_target : D_cfg [bot + 3] + (([s1] ^ (2 * k + 2 + 3)) +> + ([s0, s0] +> (([s1] ^ (2 * k + 4 + 3)) +> + ([s0, s0, s1, s0, s0] +> ([s1, s0, s0] +> tail_era0))))) = Era_cfg D_cfg 1 (k + 1) := by + unfold Era_cfg + dsimp only [tail_era0] + have h1 : 2 * (1 + (k + 1)) + 1 = 2 * k + 2 + 3 := by omega + have h2 : 2 * (1 + (k + 1)) + 3 = 2 * k + 4 + 3 := by omega + rw [h1, h2] + congr 1 + rw [h_target] at h_b2 + exact stepPlus_trans (stepPlus_trans (stepPlus_trans h_hdr h_rnd) h_pop0) (stepStar_stepPlus_trans + h_peel (stepPlus_trans h_end h_b2)) + +set_option maxHeartbeats 2000000 in +-- Justification: Multi-phase era transition. +include R_rules in +theorem step_era (u' v' : ℕ) : + ∃ c', ((Era_cfg D_cfg (u' + 1) (v' + 1)) [tm]⊢⁺ c') ∧ GoodCfg D_cfg c' := by + let m' := u' + v' + let cs_mid := List.replicate u' false ++ (true :: List.replicate v' false) + let cs := cs_mid ++ [true] + have hcs_len : cs.length = m' + 2 := by simp [cs, cs_mid, m']; omega + have h_hdr : (Era_cfg D_cfg (u' + 1) (v' + 1)) [tm]⊢⁺ + (D_cfg [3, 1, 1, 2 * m' + 8, 2 * m' + 4, bot + 1] (s0 ∷ stackTape cs default)) := by + have h := bounce1_header R_rules (m' + 1) (2 * m' + 5) (s0 ∷ stackTape cs default) + have h_in_eq : D_cfg [bot + 3] + (([s1] ^ (2 * (m' + 1) + 3)) +> ([s0, s0] +> (([s1] ^ (2 * m' + 5 + 2)) +> + ([s0, s0, s1, s0] +> (s0 ∷ stackTape cs default))))) = + Era_cfg D_cfg (u' + 1) (v' + 1) := by + unfold Era_cfg + have he1 : 2 * (m' + 1) + 3 = 2 * (u' + 1 + (v' + 1)) + 1 := by omega + have he2 : 2 * m' + 5 + 2 = 2 * (u' + 1 + (v' + 1)) + 3 := by omega + have hst : stackTape cs default = + ([s0] ^ (2 * u')) +> ([s1] +> (([s0] ^ (2 * (v' + 1))) +> ([s1] +> default))) := by + simp only [cs, cs_mid, List.append_assoc, List.cons_append, stackTape_append, + stackTape_rep_false, stackTape, bitTape, zero_cons_default, append_cons, append_nil] + have hv_eq : s0 ∷ (s0 ∷ (([s0] ^ (2 * v')) +> (s1 ∷ default))) = + ([s0] ^ (2 * (v' + 1))) +> ([s1] +> default) := by + change ([s0] ^ 2) +> (([s0] ^ (2 * v')) +> ([s1] +> default)) = _ + rw [zeros_add_merge, show 2 + 2 * v' = 2 * (v' + 1) by omega] + rw [hv_eq] + rfl + have htop : [s0, s0, s1, s0] +> (s0 ∷ + (([s0] ^ (2 * u')) +> ([s1] +> (([s0] ^ (2 * (v' + 1))) +> ([s1] +> default))))) = + [s0, s0, s1] +> (([s0] ^ (2 * (u' + 1))) +> + ([s1] +> (([s0] ^ (2 * (v' + 1))) +> ([s1] +> default)))) := by + change [s0, s0, s1] +> (([s0] ^ 2) +> (([s0] ^ (2 * u')) +> + ([s1] +> (([s0] ^ (2 * (v' + 1))) +> ([s1] +> default))))) = _ + rw [zeros_add_merge, show 2 + 2 * u' = 2 * (u' + 1) by omega] + rw [he1, he2, hst, htop] + rw [h_in_eq] at h + rw [show 2 * m' + 5 + 3 = 2 * m' + 8 by omega, + show 2 * (m' + 1) + 2 = 2 * m' + 4 by omega] at h + exact h + let sf := runChain (fun c' u => coreS u ++ [!c']) true [] cs + have h_rnd : (D_cfg [3, 1, 1, 2 * m' + 8, 2 * m' + 4, bot + 1] (s0 ∷ stackTape cs default)) [tm]⊢⁺ + (D_cfg ([2, 2] ++ encS false sf ++ [2, 1, bot + 1]) default) := by + have hr := + run_rounds R_rules (m' + 2) (Sweep0 R_rules (m' + 2)) true [] cs 1 0 [bot + 1] default + (by simp [hcs_len]) + have hA : 2 * cs.length + 1 + 3 = 2 * m' + 8 := by rw [hcs_len]; omega + have hB : 0 + (1 + (lastBit []).toNat) + dropChain true cs + 1 = 2 * m' + 4 := by + have hdc : dropChain true cs = 2 * m' + 2 := by + rw [dropChain_snoc] + simp only [cs_mid, weight2_append, weight2, weight2_rep_false, bitW] + omega + have hl0 : (lastBit []).toNat = 0 := rfl + omega + simp only [encS] at hr + rw [hA, hB] at hr + simpa [sf, List.append_assoc] using hr + have h_pop0 : (D_cfg ([2, 2] ++ encS false sf ++ [2, 1, bot + 1]) default) [tm]⊢⁺ + (peelCfg D_cfg false 0 0 (encS false sf ++ [2, 1, bot + 1]) default) := by + unfold peelCfg + simp only [List.cons_append, List.nil_append, Nat.mul_zero, ones_zero_eq, zero_cons_default] + exact rule_pop_end R_rules 0 0 (encS false sf ++ [2, 1, bot + 1]) + have h_sf_la : lastAfter false sf = false := runChain_lastAfter false true [] cs_mid true + have h_sf_len : sf.length = m' + 3 := by + rw [runChain_length, hcs_len]; simp + let cs_ref := List.replicate (m' + 1) false ++ [true] + let sf_ref := runChain (fun c' u => coreS u ++ [!c']) true [] cs_ref + have h_sf_ref : sf_ref = true :: List.replicate (m' + 2) false := by + dsimp only [sf_ref, cs_ref] + rw [rc_snoc, era0_chain m', coreS_book_le m' m' (Nat.le_refl _)] + simp only [Bool.not_true, List.cons_append, ← List.replicate_succ'] + have h_ham_cs : hamming cs cs_ref = 1 := by + dsimp only [cs, cs_ref] + rw [hamming_snoc cs_mid (List.replicate (m' + 1) false) true true + (by simp [cs_mid, m']; omega)] + rw [hamming_single_true u' v'] + simp [bitDiff] + have h_ham_sf : hamming sf (true :: List.replicate (m' + 2) false) = 1 := by + rw [← h_sf_ref] + have hch := (hamming_coreS_and_chain (m' + 2)).2 true true [] [] cs cs_ref + rfl (by simp [hcs_len, cs_ref]) (by simp [hcs_len]) + simp only [bitDiff, beq_self_eq_true, ↓reduceIte, hamming, h_ham_cs] at hch + exact hch + cases h_head : sf with + | nil => rw [h_head] at h_sf_len; simp at h_sf_len + | cons h sf_tail => + rw [h_head] at h_sf_len h_ham_sf + simp only [List.length_cons] at h_sf_len + cases h + · have h_ham_sf' : hamming sf_tail (List.replicate (m' + 2) false) = 0 := by + simpa [hamming, bitDiff] using h_ham_sf + have htail_eq := hamming_zero_rep (m' + 2) sf_tail (by omega) h_ham_sf' + have hsf_rep : sf = List.replicate (m' + 3) false := by + rw [h_head, htail_eq]; rfl + have h_peel := peel_all R_rules sf false 0 0 [2, 1, bot + 1] default (fun hh => by cases hh) + have h_w : 0 + weight2 sf = 2 * m' + 6 := by + rw [hsf_rep, weight2_rep_false]; omega + have h_tape : peelTape sf default = [s0, s0] +> default := by + have hp := peelTape_eq_stack sf [] default + dsimp only [stackTape] at hp + rw [List.append_nil] at hp + rw [hp, hsf_rep, List.reverse_replicate, stackTape_rep_false_default] + simp + rw [h_sf_la, show 0 + sf.length = m' + 3 by rw [hsf_rep]; simp, h_w, h_tape] at h_peel + have h_end := end_finish_era R_rules (m' + 1) (2 * m' + 6) default + have h_b2 := bounce2 R_rules (2 * m' + 6) (2 * m' + 6) default + have h_end_eq : D_cfg [bot + 3] + ([s1, s1, s0, s0] +> (([s1] ^ (2 * m' + 6 + 2)) +> + ([s0, s0] +> (([s1] ^ (2 * (m' + 1) + 5)) +> ([s0, s0, s0, s0] +> default))))) = + D_cfg [bot + 3] + ([s1, s1, s0, s0] +> (([s1] ^ (2 * m' + 6 + 2)) +> + ([s0, s0] +> (([s1] ^ (2 * m' + 6 + 1)) +> ([s0, s0] +> default))))) := by + have : 2 * (m' + 1) + 5 = 2 * m' + 6 + 1 := by omega + rw [this]; simp + rw [h_end_eq] at h_end + have h_tgt : D_cfg [bot + 3] + (([s1] ^ (2 * m' + 6 + 3)) +> ([s0, s0] +> (([s1] ^ (2 * m' + 6 + 3)) +> + ([s0, s0, s1, s0, s0] +> default)))) = Era0_cfg D_cfg (m' + 4) := by + unfold Era0_cfg + have : 2 * (m' + 4) + 1 = 2 * m' + 6 + 3 := by omega + rw [this]; simp + rw [h_tgt] at h_b2 + exact ⟨Era0_cfg D_cfg (m' + 4), + stepPlus_trans (stepPlus_trans (stepPlus_trans h_hdr h_rnd) h_pop0) + (stepStar_stepPlus_trans h_peel (stepPlus_trans h_end h_b2)), + GoodCfg.era0 (m' + 4) (by omega)⟩ + · have h_ham_sf' : hamming sf_tail (List.replicate (m' + 2) false) = 1 := by + simpa [hamming, bitDiff] using h_ham_sf + obtain ⟨a, b, hab, htail_eq⟩ := hamming_one_rep (m' + 2) sf_tail (by omega) h_ham_sf' + cases b with + | zero => + have h_la' := h_sf_la + rw [h_head, htail_eq] at h_la' + simp [lastAfter, lastAfter_snoc] at h_la' + | succ b' => + have hab' : a + b' = m' := by omega + have h_peel := peel_all R_rules sf false 0 0 [2, 1, bot + 1] default (fun hh => by cases hh) + have h_w : 0 + weight2 sf = 2 * m' + 4 := by + rw [h_head, htail_eq] + simp [weight2, weight2_append, weight2_rep_false, bitW] + omega + let mid_bits := List.replicate b' false ++ ([true] ++ (List.replicate a false ++ [true])) + let rest : TapeB := stackTape mid_bits default + have h_tape : peelTape sf default = [s0, s0] +> rest := by + have hp := peelTape_eq_stack sf [] default + dsimp only [stackTape] at hp + have hrev : sf.reverse = false :: mid_bits := by + have hsf_form : sf = + ([true] ++ List.replicate a false ++ [true] ++ List.replicate b' false) ++ + [false] := by + rw [h_head, htail_eq, List.replicate_succ'] + simp [List.append_assoc] + rw [hsf_form] + simp [mid_bits, List.reverse_append, List.reverse_replicate, List.append_assoc] + rw [List.append_nil, hrev] at hp + simpa [stackTape, bitTape] using hp + rw [h_sf_la, show 0 + sf.length = m' + 3 by rw [h_head]; simp; omega, h_w, h_tape] at h_peel + have h_end := end_finish_era R_rules (m' + 1) (2 * m' + 4) rest + have h_b2 := bounce2 R_rules (2 * m' + 4) (2 * m' + 6) ([s0, s0] +> rest) + have h_end_eq : D_cfg [bot + 3] + ([s1, s1, s0, s0] +> (([s1] ^ (2 * m' + 4 + 2)) +> + ([s0, s0] +> (([s1] ^ (2 * (m' + 1) + 5)) +> ([s0, s0, s0, s0] +> rest))))) = + D_cfg [bot + 3] + ([s1, s1, s0, s0] +> (([s1] ^ (2 * m' + 4 + 2)) +> + ([s0, s0] +> (([s1] ^ (2 * m' + 6 + 1)) +> ([s0, s0] +> ([s0, s0] +> rest)))))) := + by + have : 2 * (m' + 1) + 5 = 2 * m' + 6 + 1 := by omega + rw [this]; rfl + rw [h_end_eq] at h_end + have h_tgt : D_cfg [bot + 3] + (([s1] ^ (2 * m' + 4 + 3)) +> ([s0, s0] +> (([s1] ^ (2 * m' + 6 + 3)) +> + ([s0, s0, s1, s0, s0] +> ([s0, s0] +> rest))))) = + Era_cfg D_cfg (b' + 2) (a + 1) := by + dsimp only [Era_cfg] + have he1 : 2 * (b' + 2 + (a + 1)) + 1 = 2 * m' + 4 + 3 := by omega + have he2 : 2 * (b' + 2 + (a + 1)) + 3 = 2 * m' + 6 + 3 := by omega + have hrest : rest = + ([s0] ^ (2 * b')) +> ([s1] +> (([s0] ^ (2 * (a + 1))) +> ([s1] +> default))) := by + simp only [rest, mid_bits, stackTape_append, stackTape_rep_false, stackTape, bitTape, + zero_cons_default, append_cons, append_nil] + have ha_eq : s0 ∷ (s0 ∷ (([s0] ^ (2 * a)) +> (s1 ∷ default))) = + ([s0] ^ (2 * (a + 1))) +> ([s1] +> default) := by + change ([s0] ^ 2) +> (([s0] ^ (2 * a)) +> ([s1] +> default)) = _ + rw [zeros_add_merge, show 2 + 2 * a = 2 * (a + 1) by omega] + rw [ha_eq] + rfl + have htop : [s0, s0, s1, s0, s0] +> ([s0, s0] +> + (([s0] ^ (2 * b')) +> ([s1] +> (([s0] ^ (2 * (a + 1))) +> ([s1] +> default))))) = + [s0, s0, s1] +> (([s0] ^ (2 * (b' + 2))) +> + ([s1] +> (([s0] ^ (2 * (a + 1))) +> ([s1] +> default)))) := by + change [s0, s0, s1] +> (([s0] ^ 2) +> (([s0] ^ 2) +> (([s0] ^ (2 * b')) +> + ([s1] +> (([s0] ^ (2 * (a + 1))) +> ([s1] +> default)))))) = _ + rw [zeros_add_merge, zeros_add_merge, show 2 + 2 + 2 * b' = 2 * (b' + 2) by omega] + rw [he1, he2, hrest, htop] + rw [h_tgt] at h_b2 + exact ⟨Era_cfg D_cfg (b' + 2) (a + 1), + stepPlus_trans (stepPlus_trans (stepPlus_trans h_hdr h_rnd) h_pop0) + (stepStar_stepPlus_trans h_peel (stepPlus_trans h_end h_b2)), + GoodCfg.era (b' + 2) (a + 1) (by omega) (by omega)⟩ + +include R_rules in +theorem good_step (c : Cfg (Fin 2) (Fin 6)) (hc : GoodCfg D_cfg c) : + ∃ c', (c [tm]⊢⁺ c') ∧ GoodCfg D_cfg c' := by + cases hc with + | era0 m hm => + cases m with + | zero => omega + | succ m1 => + cases m1 with + | zero => exact ⟨Era0_cfg D_cfg 2, era0_1_to_2 R_rules, GoodCfg.era0 2 (by omega)⟩ + | succ k => + exact ⟨Era_cfg D_cfg 1 (k + 1), step_era0_succ R_rules k, + GoodCfg.era 1 (k + 1) (by omega) (by omega)⟩ + | era u v hu hv => + cases u with + | zero => omega + | succ u' => + cases v with + | zero => omega + | succ v' => exact step_era R_rules u' v' + +include R_rules in +theorem reach_N : ∀ k : ℕ, ∃ m c, k ≤ m ∧ ((init []) [tm]⊢^{m} c) ∧ GoodCfg D_cfg c := by + intro k + induction k with + | zero => + obtain ⟨m, _, hm⟩ := stepPlus_trans R_rules.init_to_hit0 (hit0_to_era0_1 R_rules) + exact ⟨m, Era0_cfg D_cfg 1, Nat.zero_le m, hm, GoodCfg.era0 1 (Nat.le_refl 1)⟩ + | succ k ih => + obtain ⟨m, c, _, hm, hc⟩ := ih + obtain ⟨c', ⟨d, hd, hstep⟩, hc'⟩ := good_step R_rules c hc + exact ⟨m + d, c', by omega, multiStep_trans tm (init []) c c' m d hm hstep, hc'⟩ + +theorem multiStep_none_of_step_none (cfg : Cfg (Fin 2) (Fin 6)) (h0 : step tm cfg = none) : + ∀ r : ℕ, multiStep tm cfg (r + 1) = none := by + intro r + induction r with + | zero => simp [multiStep_succ, h0] + | succ r ih => rw [multiStep_succ, ih]; rfl + + + +end + +@[expose] public section + +theorem does_not_halt_of_stack_rules {tm : Machine (Fin 2) (Fin 6)} + {D_cfg : List ℕ → TapeB → Cfg (Fin 2) (Fin 6)} + (R_rules : StackRules tm D_cfg) : IsNotHalt tm := by + intro cfg ⟨n, hn⟩ + obtain ⟨m, c, hnm, hm, _⟩ := reach_N R_rules (n + 1) + obtain ⟨r, rfl⟩ := Nat.exists_eq_add_of_le hnm + have hsplit : n + 1 + r = n + (r + 1) := by omega + rw [hsplit, multiStep_add, hn] at hm + dsimp only [Option.bind] at hm + cases hstep : step tm cfg with + | none => + rw [multiStep_none_of_step_none cfg hstep r] at hm + cases hm + | some _ => rfl + +set_option maxHeartbeats 2000000 in +-- Justification: Finite symbolic execution of the 15 elementary stack rules. +theorem is_not_halt : IsNotHalt target := by + refine does_not_halt_of_stack_rules + (mkStackRules target 1 2 4 0 + (fun _ _ => by execute) + (fun _ _ _ => by execute) + (fun _ _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ _ => by execute) + (fun _ _ _ => by execute) + (fun _ _ _ _ => by execute) + (fun _ _ _ => by execute) + (fun _ _ _ _ => by execute) + (fun _ _ _ _ => by execute) + (fun _ => by execute) + (by execute_init) + (by execute_init) + (by execute_init) + (by execute_init)) + +end + +end BusyBeaver.M_1RB1LA_1LC0RA_0LD1RC_HHH0LE_0LF1LE_1RF1LB diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LA_1RC0LE_1RD0LF_0LA0RD_1LC0LE_HHH0RE.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LA_1RC0LE_1RD0LF_0LA0RD_1LC0LE_HHH0RE.lean new file mode 100644 index 00000000..6481b361 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LA_1RC0LE_1RD0LF_0LA0RD_1LC0LE_HHH0RE.lean @@ -0,0 +1,54 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.SharedDonorsA + +open Mathlib Relation Nat Turing BusyBeaver + + +namespace BusyBeaver.M_1RB1LA_1RC0LE_1RD0LF_0LA0RD_1LC0LE_HHH0RE + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LA_1RC0LE_1RD0LF_0LA0RD_1LC0LE_HHH0RE" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +open TM24Donor Records Stack Cap + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +set_option maxHeartbeats 2000000 in +set_option maxRecDepth 200000 in +theorem init_to_active : + (init []) [target_tm]⊢* active (SCap C0) (REnd (seed_offset ++ [1])) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + unfold active stack_side cap_word put_left records_side seed_offset TM24Donor.digits stepCfg + simp only [List.foldl_cons, List.foldl_nil, + List.flatMap_cons, List.flatMap_nil, + listPow_succ, listPow_zero, bit0, bit1, + List.cons_append, List.nil_append, List.append_nil, append_cons, append_nil] + execute + + + +theorem is_does_not_halt : IsNotHalt target_tm := + isNotHalt_of_neverHaltsFrom init_to_active (source_nonhalt initial_source) + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1LA_1RC0LE_1RD0LF_0LA0RD_1LC0LE_HHH0RE diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LB_1LC0LF_1LD0RC_1RE0LA_1RE1RC_HHH0LE.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LB_1LC0LF_1LD0RC_1RE0LA_1RE1RC_HHH0LE.lean new file mode 100644 index 00000000..2a7af70b --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LB_1LC0LF_1LD0RC_1RE0LA_1RE1RC_HHH0LE.lean @@ -0,0 +1,724 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1LB_1LC0LF_1LD0RC_1RE0LA_1RE1RC_HHH0LE + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LB_1LC0LF_1LD0RC_1RE0LA_1RE1RC_HHH0LE" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {zG_ zL_ α β γ : Type*} [Inhabited zG_] [Inhabited zL_] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +-- ============================================================================ +-- Section 2: Turing Machine Infrastructure & Notations +-- ============================================================================ + + +/- A Turing machine statement writing a symbol and moving in direction `dir`. -/ +-- ============================================================================ +-- Section 5: Specific Turing Machine: holdout_0203 +-- ============================================================================ +/- Transition function for holdout_0203: `1RB1LB_1LC0LF_1LD0RC_1RE0LA_1RE1RC_---0LE` -/ + +-- ============================================================================ +-- Section 6: Proof of holdout_0203_nonhalt +-- ============================================================================ + +set_option maxHeartbeats 8000000 + +@[simp] theorem zMz (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] +@[simp] theorem tape_mk1_nil : Tape.mk₁ ([] : List (Fin 2)) = ⟨0, default, default⟩ := rfl +@[simp] theorem zPz (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zPsl (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl +@[simp] theorem zCal (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ ys) := rfl +@[simp] theorem zLan (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem zLac (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zZcd : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem zDt : (default : ListBlank (Fin 2)).tail = default := rfl +@[simp] theorem zAnl (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem zNal (l : List (Fin 2)) : [] ++ l = l := rfl + +omit [Inhabited Γ] in +@[simp] +theorem zLpa (l : List Γ) (n m : Nat) : l^(n + m) = l^n ++ l^m := by + dsimp [HPow.hPow] + rw [List.replicate_add, List.flatten_append] + +omit [Inhabited Γ] in +@[simp] +theorem zLpc (l : List Γ) (n m : Nat) : l^n ++ l^m = l^m ++ l^n := by + rw [<- zLpa, add_comm, zLpa] + +theorem zLaa (s : ListBlank Γ) (l₁ l₂ : List Γ) : + (s <+ l₁) <+ l₂ = s <+ (l₂ ++ l₁) := by + unfold ListBlank.append + split + · split + · next h => simp_all + · simp_all + · rename_i _ l₂ l₁ + refine (congr_arg _ ?_).symm + exact ListBlank.append_assoc l₁ _ s + +theorem zLp1 (u : List (Fin 2)) (k : Nat) : + u^k ++ u = u^(k + 1) := by + have h := zLpc u k 1 + dsimp [HPow.hPow] at h ⊢ + rw [List.append_nil] at h + exact h + +theorem zSm {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢^{1} c₂ := by simp [h] + +theorem zSp2 {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢⁺ c₂ := ⟨1, by decide, zSm tm c₁ c₂ h⟩ + +theorem zMa {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, zMs, ih, Option.bind_assoc] + simp_rw [zMs] + +theorem zMt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [zMa, h₁]; simp [h₂] + +theorem zPs {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem zMst {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, zMt tm c₁ c₂ c₃ n m hn hm⟩ + +theorem zPsp {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), zMt tm c₁ c₂ c₃ n m hn hm⟩ + +theorem zSsp {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + zPsp (zSp2 tm c₁ c₂ h₁) h₂ + +theorem zSpp {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), zMt tm c₁ c₂ c₃ n m hn hm⟩ + +theorem zPpp {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := + zPsp h₁ (zPs h₂) + +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine zSsp (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zZcd, zDh, zDt]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) + +-- Non-halting from an arbitrary configuration +def NonHaltFrom (c : Cfg (Fin 2) (Fin 6)) : Prop := + ∀ n : Nat, (multiStep target_tm c n).isSome + +theorem zIm_some {c : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : (multiStep target_tm c (j + d)).isSome) : + (multiStep target_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl + +theorem multistep_nonhalt {c₁ c₂ : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [target_tm]⊢* c₂) (h₂ : NonHaltFrom c₂) : + NonHaltFrom c₁ := by + rcases h₁ with ⟨k, hk⟩ + intro n + have h_some : (multiStep target_tm c₁ (k + n)).isSome := by + rw [zMa, hk] + exact h₂ n + rw [Nat.add_comm k n] at h_some + exact zIm_some h_some + +-- Head configurations (L-R mirror of SBCv12.v TM1) +structure Head0 where + q : Fin 6 + u : List (Fin 2) + +def hf : Head0 := ⟨A, [0]⟩ +def hh : Head0 := ⟨B, [1, 0]⟩ +def ht : Head0 := ⟨E, [0, 0, 1, 0]⟩ + +def cfgL (h : Head0) (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + l <{{h.q}} (h.u +> r) + +def cfgR (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + l {{C}}> r + +def sideLR (h : Head0) (l l' : ListBlank (Fin 2)) : Prop := + ∀ r : ListBlank (Fin 2), (cfgL h l r) [target_tm]⊢⁺ (cfgR l' r) + +def segLR (h : Head0) (w w' : List (Fin 2)) : Prop := + ∀ l r : ListBlank (Fin 2), (cfgL h (w +> l) r) [target_tm]⊢⁺ (cfgR (w' +> l) r) + +def segLL (h h' : Head0) (w v : List (Fin 2)) : Prop := + ∀ l r : ListBlank (Fin 2), (cfgL h (w +> l) r) [target_tm]⊢* (cfgL h' l (v +> r)) + +def segRR (v w' : List (Fin 2)) : Prop := + ∀ l r : ListBlank (Fin 2), (cfgR l (v +> r)) [target_tm]⊢* (cfgR (w' +> l) r) + +def Result (h : Head0) (l : ListBlank (Fin 2)) (P : ListBlank (Fin 2) → Prop) : Prop := + (∃ l', sideLR h l l' ∧ P l') ∨ (∀ r, NonHaltFrom (cfgL h l r)) + +theorem result_mono {h : Head0} {l : ListBlank (Fin 2)} {P Q : ListBlank (Fin 2) → Prop} + (hr : Result h l P) (hPQ : ∀ l', P l' → Q l') : Result h l Q := by + rcases hr with ⟨l', hstep, hP⟩ | hnh + · exact Or.inl ⟨l', hstep, hPQ l' hP⟩ + · exact Or.inr hnh + +theorem result_return {h : Head0} {w w' : List (Fin 2)} {l : ListBlank (Fin 2)} + {P : ListBlank (Fin 2) → Prop} + (hseg : segLR h w w') (hP : P (w' +> l)) : Result h (w +> l) P := + Or.inl ⟨w' +> l, fun r => hseg l r, hP⟩ + +def Calls (h h' : Head0) (w w' : List (Fin 2)) : Prop := + ∃ v, segLL h h' w v ∧ segRR v w' + +theorem result_call {h h' : Head0} {w w' : List (Fin 2)} {l : ListBlank (Fin 2)} + {P Q : ListBlank (Fin 2) → Prop} + (hc : Calls h h' w w') (hr : Result h' l P) + (hPQ : ∀ l', P l' → Q (w' +> l')) : Result h (w +> l) Q := by + rcases hc with ⟨v, hLL, hRR⟩ + rcases hr with ⟨l', hstep, hP⟩ | hnh + · refine Or.inl ⟨w' +> l', fun r => ?_, hPQ l' hP⟩ + exact zPsp (zSpp (hLL l r) (hstep (v +> r))) (hRR l' r) + · refine Or.inr (fun r => ?_) + exact multistep_nonhalt (hLL l r) (hnh (v +> r)) + +theorem calls_app {h1 h2 h3 : Head0} {w1 w2 w3 w4 : List (Fin 2)} + (hc1 : Calls h1 h2 w1 w2) (hc2 : Calls h2 h3 w3 w4) : + Calls h1 h3 (w1 ++ w3) (w2 ++ w4) := by + rcases hc1 with ⟨v1, h1, h2⟩ + rcases hc2 with ⟨v2, h3, h4⟩ + refine ⟨v2 ++ v1, fun l r => ?_, fun l r => ?_⟩ + · rw [<- zLaa] + have step1 := h1 (w3 +> l) r + have step2 := h3 l (v1 +> r) + rw [zLaa] at step2 + exact zMst step1 step2 + · rw [<- zLaa] + have step1 := h4 l (v1 +> r) + have step2 := h2 (w4 +> l) r + rw [zLaa] at step2 + exact zMst step1 step2 + +-- Base return segments +theorem f_zero : segLR hf [0] [0, 0] := by + intro l r; unfold cfgL cfgR hf; simp only [zCal, zLac, zLan]; execute + +theorem h_zero : segLR hh [0, 0, 0] [1, 1, 0, 1, 1] := by + intro l r; unfold cfgL cfgR hh; simp only [zCal, zLac, zLan]; execute + +theorem h_one : segLR hh [0, 1] [1, 1, 0, 0] := by + intro l r; unfold cfgL cfgR hh; simp only [zCal, zLac, zLan]; execute + +-- Base and inductive call segments +theorem t_zeros_step : Calls ht ht [0] [0] := by + refine ⟨[1], fun l r => ?_, fun l r => ?_⟩ + · refine zPs ?_; unfold cfgL ht; simp only [zCal, zLac, zLan]; execute + · refine zPs ?_; unfold cfgR; simp only [zCal, zLac, zLan]; execute + +theorem t_zeros (n : Nat) : Calls ht ht (([0] : List (Fin 2))^n) (([0] : List (Fin 2))^n) := by + induction n with + | zero => + refine ⟨[], fun l r => ⟨0, by simp⟩, fun l r => ⟨0, by simp⟩⟩ + | succ n ih => + simpa only [zPsl] using calls_app t_zeros_step ih + +theorem t_four_step : Calls ht ht [1, 1, 1, 1] [1, 1, 1, 1] := by + refine ⟨[1, 0, 1, 0], fun l r => ?_, fun l r => ?_⟩ + · refine zPs ?_; unfold cfgL ht; simp only [zCal, zLac, zLan]; execute + · refine zPs ?_; unfold cfgR; simp only [zCal, zLac, zLan]; execute + +theorem t_four_pow (q : Nat) : Calls ht ht (([1] : List (Fin 2))^(q * 4)) (([1] : List (Fin 2))^(q * 4)) := by + induction q with + | zero => + refine ⟨[], fun l r => ⟨0, by simp⟩, fun l r => ⟨0, by simp⟩⟩ + | succ q ih => + have h_eq : ([1] : List (Fin 2))^((q + 1) * 4) = ([1] : List (Fin 2))^(q * 4) ++ [1, 1, 1, 1] := by + have h_add : (q + 1) * 4 = q * 4 + 4 := by omega + rw [h_add, zLpa]; rfl + rw [h_eq] + exact calls_app ih t_four_step + +theorem t_four (q : Nat) : Calls ht ht (([1] : List (Fin 2))^(4 + q * 4)) (([1] : List (Fin 2))^(4 + q * 4)) := by + have h_eq : ([1] : List (Fin 2))^(4 + q * 4) = [1, 1, 1, 1] ++ ([1] : List (Fin 2))^(q * 4) := by + rw [zLpa]; rfl + rw [h_eq] + exact calls_app t_four_step (t_four_pow q) + +theorem t_one_base : Calls ht hf [1] [1, 1, 1, 1] := by + refine ⟨[1, 0, 1, 0], fun l r => ?_, ?_⟩ + · refine zPs ?_; unfold cfgL ht hf; simp only [zCal, zLac, zLan]; execute + · intro l r; unfold cfgR; refine zPs ?_; simp only [zCal, zLac, zLan]; execute + +theorem t_one (q : Nat) : Calls ht hf (([1] : List (Fin 2))^(1 + q * 4)) (([1] : List (Fin 2))^(4 + q * 4)) := by + have h1 : ([1] : List (Fin 2))^(1 + q * 4) = ([1] : List (Fin 2))^(q * 4) ++ [1] := by + have h_add : 1 + q * 4 = q * 4 + 1 := by omega + rw [h_add, zLpa]; rfl + have h2 : ([1] : List (Fin 2))^(4 + q * 4) = ([1] : List (Fin 2))^(q * 4) ++ [1, 1, 1, 1] := by + have h_add : 4 + q * 4 = q * 4 + 4 := by omega + rw [h_add, zLpa]; rfl + rw [h1, h2] + exact calls_app (t_four_pow q) t_one_base + +theorem t_two_base : Calls ht hh [1, 1] [1, 1, 1, 1] := by + refine ⟨[1, 0, 1, 0], fun l r => ?_, ?_⟩ + · refine zPs ?_; unfold cfgL ht hh; simp only [zCal, zLac, zLan]; execute + · intro l r; unfold cfgR; refine zPs ?_; simp only [zCal, zLac, zLan]; execute + +theorem t_two (q : Nat) : Calls ht hh (([1] : List (Fin 2))^(2 + q * 4)) (([1] : List (Fin 2))^(4 + q * 4)) := by + have h1 : ([1] : List (Fin 2))^(2 + q * 4) = ([1] : List (Fin 2))^(q * 4) ++ [1, 1] := by + have h_add : 2 + q * 4 = q * 4 + 2 := by omega + rw [h_add, zLpa]; rfl + have h2 : ([1] : List (Fin 2))^(4 + q * 4) = ([1] : List (Fin 2))^(q * 4) ++ [1, 1, 1, 1] := by + have h_add : 4 + q * 4 = q * 4 + 4 := by omega + rw [h_add, zLpa]; rfl + rw [h1, h2] + exact calls_app (t_four_pow q) t_two_base + +theorem h_two_four_base : Calls hh ht [0, 0, 1, 1, 1, 1] [1, 1, 0, 0] := by + refine ⟨[1, 1, 1, 0], fun l r => ?_, fun l r => ?_⟩ + · refine zPs ?_; unfold cfgL hh ht; simp only [zCal, zLac, zLan]; execute + · refine zPs ?_; unfold cfgR; simp only [zCal, zLac, zLan]; execute + +theorem h_two_four (q : Nat) : Calls hh ht ([0, 0] ++ ([1] : List (Fin 2))^(4 + q * 4)) ([1, 1, 0, 0] ++ ([1] : List (Fin 2))^(q * 4)) := by + have h1 : ([0, 0] ++ ([1] : List (Fin 2))^(4 + q * 4)) = [0, 0, 1, 1, 1, 1] ++ ([1] : List (Fin 2))^(q * 4) := by + rw [zLpa]; rfl + rw [h1] + exact calls_app h_two_four_base (t_four_pow q) + +theorem h_two_one_base : Calls hh hf [0, 0, 1] [1, 1, 0, 0] := by + refine ⟨[1, 1, 1, 0], fun l r => ?_, fun l r => ?_⟩ + · refine zPs ?_; unfold cfgL hh hf; simp only [zCal, zLac, zLan]; execute + · refine zPs ?_; unfold cfgR; simp only [zCal, zLac, zLan]; execute + +theorem h_two_one (q : Nat) : Calls hh hf ([0, 0] ++ ([1] : List (Fin 2))^(1 + q * 4)) ([1, 1, 0, 0] ++ ([1] : List (Fin 2))^(q * 4)) := by + cases q with + | zero => + exact h_two_one_base + | succ q' => + have h1 : ([0, 0] ++ ([1] : List (Fin 2))^(1 + (q' + 1) * 4)) = + [0, 0, 1, 1, 1, 1] ++ ([1] : List (Fin 2))^(1 + q' * 4) := by + have h_add : 1 + (q' + 1) * 4 = 4 + (1 + q' * 4) := by omega + rw [h_add, zLpa]; rfl + have h2 : ([1, 1, 0, 0] ++ ([1] : List (Fin 2))^((q' + 1) * 4)) = + [1, 1, 0, 0] ++ ([1] : List (Fin 2))^(4 + q' * 4) := by + have h_add : (q' + 1) * 4 = 4 + q' * 4 := by omega + rw [h_add] + rw [h1, h2] + exact calls_app h_two_four_base (t_one q') + +theorem h_two : Calls hh ht [1, 1] [] := by + refine ⟨[], fun l r => ?_, fun l r => ⟨0, by simp⟩⟩ + refine zPs ?_; unfold cfgL hh ht; simp only [zCal, zLac, zLan]; execute + +-- Blank divergence for ht +theorem t_blank_step (r : ListBlank (Fin 2)) : + (cfgL ht default r) [target_tm]⊢⁺ (cfgL ht default ((1 : Fin 2) >> r)) := by + unfold cfgL ht; simp only [zCal, zLac, zLan]; execute + +theorem t_blank_reach (n : Nat) (r : ListBlank (Fin 2)) : + ∃ N ≥ n, (multiStep target_tm (cfgL ht default r) N).isSome := by + induction n generalizing r with + | zero => exact ⟨0, Nat.le_refl 0, rfl⟩ + | succ n ih => + rcases t_blank_step r with ⟨k, hk_pos, hk⟩ + rcases ih ((1 : Fin 2) >> r) with ⟨N', hN', hsome⟩ + refine ⟨k + N', by omega, ?_⟩ + rw [zMa, hk] + exact hsome + +theorem t_blank (r : ListBlank (Fin 2)) : NonHaltFrom (cfgL ht default r) := by + intro n + rcases t_blank_reach n r with ⟨N, hN, hsome⟩ + have h_eq : n + (N - n) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at hsome + exact zIm_some hsome + +-- Inductive grammar G on the active left half-tape +inductive G : Bool → ListBlank (Fin 2) → Prop where + | blank (p : Bool) : G p default + | four (p : Bool) (n q : Nat) (l : ListBlank (Fin 2)) : + G false l → + G p ((([0] : List (Fin 2))^((if p then 2 else 3) + n * 3)) +> + ((([1] : List (Fin 2))^(4 + q * 4)) +> l)) + | one (p : Bool) (n q : Nat) (l : ListBlank (Fin 2)) : + G true l → + G p ((([0] : List (Fin 2))^((if p then 2 else 3) + n * 3)) +> + ((([1] : List (Fin 2))^(1 + q * 4)) +> l)) + | two (p : Bool) (n q : Nat) (l : ListBlank (Fin 2)) : + G true l → + G p ((([0] : List (Fin 2))^((if p then 1 else 2) + n * 3)) +> + ((([1] : List (Fin 2))^(2 + q * 4)) +> l)) + +theorem zero_cons_pow (k : Nat) (s : ListBlank (Fin 2)) : + (0 : Fin 2) >> ((([0] : List (Fin 2))^k) +> s) = (([0] : List (Fin 2))^(1 + k)) +> s := by + have h : ([0] : List (Fin 2))^(1 + k) = [0] ++ ([0] : List (Fin 2))^k := by + rw [zLpa]; rfl + rw [h, <- zLaa]; rfl + +theorem twozeros_append_pow (k : Nat) (s : ListBlank (Fin 2)) : + ([0, 0] : List (Fin 2)) +> ((([0] : List (Fin 2))^k) +> s) = (([0] : List (Fin 2))^(2 + k)) +> s := by + have h : ([0] : List (Fin 2))^(2 + k) = [0, 0] ++ ([0] : List (Fin 2))^k := by + rw [zLpa]; rfl + rw [h, <- zLaa] + +theorem G_zero (l : ListBlank (Fin 2)) (h : G true l) : G false ((0 : Fin 2) >> l) := by + cases h with + | blank => + rw [zZcd]; exact G.blank false + | four _ n q l₀ h₀ => + rw [zero_cons_pow] + have h_exp : 1 + ((if true then 2 else 3) + n * 3) = (if false then 2 else 3) + n * 3 := by (try dsimp); omega + rw [h_exp] + exact G.four false n q l₀ h₀ + | one _ n q l₀ h₀ => + rw [zero_cons_pow] + have h_exp : 1 + ((if true then 2 else 3) + n * 3) = (if false then 2 else 3) + n * 3 := by (try dsimp); omega + rw [h_exp] + exact G.one false n q l₀ h₀ + | two _ n q l₀ h₀ => + rw [zero_cons_pow] + have h_exp : 1 + ((if true then 1 else 2) + n * 3) = (if false then 1 else 2) + n * 3 := by (try dsimp); omega + rw [h_exp] + exact G.two false n q l₀ h₀ + +theorem G_twozeros (l : ListBlank (Fin 2)) (h : G false l) : G true (([0, 0] : List (Fin 2)) +> l) := by + cases h with + | blank => + have h_def : ([0, 0] : List (Fin 2)) +> (default : ListBlank (Fin 2)) = default := by + simp [zLac, zLan, zZcd] + rw [h_def]; exact G.blank true + | four _ n q l₀ h₀ => + rw [twozeros_append_pow] + have h_exp : 2 + ((if false then 2 else 3) + n * 3) = (if true then 2 else 3) + (1 + n) * 3 := by (try dsimp); omega + rw [h_exp] + exact G.four true (1 + n) q l₀ h₀ + | one _ n q l₀ h₀ => + rw [twozeros_append_pow] + have h_exp : 2 + ((if false then 2 else 3) + n * 3) = (if true then 2 else 3) + (1 + n) * 3 := by (try dsimp); omega + rw [h_exp] + exact G.one true (1 + n) q l₀ h₀ + | two _ n q l₀ h₀ => + rw [twozeros_append_pow] + have h_exp : 2 + ((if false then 1 else 2) + n * 3) = (if true then 1 else 2) + (1 + n) * 3 := by (try dsimp); omega + rw [h_exp] + exact G.two true (1 + n) q l₀ h₀ + +theorem G_twoblocks (q : Nat) (l : ListBlank (Fin 2)) (h : G false l) : + G true (([0, 0] : List (Fin 2)) +> ((([1] : List (Fin 2))^(q * 4)) +> l)) := by + cases q with + | zero => + simpa using G_twozeros l h + | succ q' => + have h_0 : ([0, 0] : List (Fin 2)) = ([0] : List (Fin 2))^((if true then 2 else 3) + 0 * 3) := rfl + have h_1 : (q' + 1) * 4 = 4 + q' * 4 := by (try dsimp); omega + rw [h_0, h_1] + exact G.four true 0 q' l h + +theorem G_mark (l : ListBlank (Fin 2)) (h : G true l) : + G true (([0, 1, 1] : List (Fin 2)) +> l) := by + have h_eq : ([0, 1, 1] : List (Fin 2)) +> l = + (([0] : List (Fin 2))^((if true then 1 else 2) + 0 * 3)) +> + ((([1] : List (Fin 2))^(2 + 0 * 4)) +> l) := rfl + rw [h_eq] + exact G.two true 0 0 l h + +theorem G_true_has_zero (l : ListBlank (Fin 2)) (h : G true l) : + ∃ u, l = ([0] : List (Fin 2)) +> u := by + cases h with + | blank => + refine ⟨default, ?_⟩ + simp [zLac, zLan, zZcd] + | four _ n q l₀ _ => + refine ⟨(([0] : List (Fin 2))^(1 + n * 3)) +> ((([1] : List (Fin 2))^(4 + q * 4)) +> l₀), ?_⟩ + have h_exp : ([0] : List (Fin 2))^((if true then 2 else 3) + n * 3) = + [0] ++ ([0] : List (Fin 2))^(1 + n * 3) := by + have h_add : (if true then 2 else 3) + n * 3 = 1 + (1 + n * 3) := by (try dsimp); omega + rw [h_add, zLpa]; rfl + rw [h_exp, <- zLaa] + | one _ n q l₀ _ => + refine ⟨(([0] : List (Fin 2))^(1 + n * 3)) +> ((([1] : List (Fin 2))^(1 + q * 4)) +> l₀), ?_⟩ + have h_exp : ([0] : List (Fin 2))^((if true then 2 else 3) + n * 3) = + [0] ++ ([0] : List (Fin 2))^(1 + n * 3) := by + have h_add : (if true then 2 else 3) + n * 3 = 1 + (1 + n * 3) := by (try dsimp); omega + rw [h_add, zLpa]; rfl + rw [h_exp, <- zLaa] + | two _ n q l₀ _ => + refine ⟨(([0] : List (Fin 2))^(n * 3)) +> ((([1] : List (Fin 2))^(2 + q * 4)) +> l₀), ?_⟩ + have h_exp : ([0] : List (Fin 2))^((if true then 1 else 2) + n * 3) = + [0] ++ ([0] : List (Fin 2))^(n * 3) := by + have h_add : (if true then 1 else 2) + n * 3 = 1 + n * 3 := rfl + rw [h_add, zLpa]; rfl + rw [h_exp, <- zLaa] + +theorem f_G (l : ListBlank (Fin 2)) (h : G true l) : Result hf l (G false) := by + rcases G_true_has_zero l h with ⟨u, hlu⟩ + rw [hlu] + refine result_return f_zero ?_ + have h_eq : ([0, 0] : List (Fin 2)) +> u = (0 : Fin 2) >> (([0] : List (Fin 2)) +> u) := rfl + rw [h_eq, <- hlu] + exact G_zero l h + +def Mark (l : ListBlank (Fin 2)) : Prop := + ∃ u, G true u ∧ l = ([1, 1] : List (Fin 2)) +> u + +theorem h_big (l : ListBlank (Fin 2)) (h : G true l) : + Result hh (([0, 0, 0] : List (Fin 2)) +> l) Mark := by + refine result_return h_zero ?_ + exact ⟨([0, 1, 1] : List (Fin 2)) +> l, G_mark l h, rfl⟩ + +theorem G_calls (p : Bool) (l : ListBlank (Fin 2)) (h : G p l) : + Result ht l (G p) ∧ (p = true → Result hh l Mark) := by + induction h with + | blank p => + refine ⟨Or.inr t_blank, fun hp => ?_⟩ + have h_def : (default : ListBlank (Fin 2)) = ([0, 0, 0] : List (Fin 2)) +> default := by + simp [zLac, zLan, zZcd] + rw [h_def] + exact h_big default (G.blank true) + | four p n q l₀ h₀ ih => + rcases ih with ⟨IT, _⟩ + refine ⟨?_, fun hp => ?_⟩ + · rw [zLaa] + refine result_call (calls_app (t_zeros ((if p then 2 else 3) + n * 3)) (t_four q)) IT ?_ + intro u hu + rw [<- zLaa] + exact G.four p n q u hu + · subst hp + cases n with + | zero => + have h_eq : ((([0] : List (Fin 2))^((if true then 2 else 3) + 0 * 3)) +> + ((([1] : List (Fin 2))^(4 + q * 4)) +> l₀)) = + (([0, 0] ++ ([1] : List (Fin 2))^(4 + q * 4)) +> l₀) := by + rw [<- zLaa]; rfl + rw [h_eq] + refine result_call (h_two_four q) IT ?_ + intro u hu + refine ⟨([0, 0] : List (Fin 2)) +> ((([1] : List (Fin 2))^(q * 4)) +> u), + G_twoblocks q u hu, ?_⟩ + rw [<- zLaa]; rfl + | succ n' => + have h_eq : ((([0] : List (Fin 2))^((if true then 2 else 3) + (n' + 1) * 3)) +> + ((([1] : List (Fin 2))^(4 + q * 4)) +> l₀)) = + ([0, 0, 0] : List (Fin 2)) +> + ((([0] : List (Fin 2))^((if true then 2 else 3) + n' * 3)) +> + ((([1] : List (Fin 2))^(4 + q * 4)) +> l₀)) := by + have h_exp : ([0] : List (Fin 2))^((if true then 2 else 3) + (n' + 1) * 3) = + [0, 0, 0] ++ ([0] : List (Fin 2))^((if true then 2 else 3) + n' * 3) := by + have h_add : (if true then 2 else 3) + (n' + 1) * 3 = 3 + ((if true then 2 else 3) + n' * 3) := by omega + rw [h_add, zLpa]; rfl + rw [h_exp, <- zLaa] + rw [h_eq] + exact h_big _ (G.four true n' q l₀ h₀) + | one p n q l₀ h₀ ih => + refine ⟨?_, fun hp => ?_⟩ + · rw [zLaa] + refine result_call (calls_app (t_zeros ((if p then 2 else 3) + n * 3)) (t_one q)) (f_G l₀ h₀) ?_ + intro u hu + rw [<- zLaa] + exact G.four p n q u hu + · subst hp + cases n with + | zero => + have h_eq : ((([0] : List (Fin 2))^((if true then 2 else 3) + 0 * 3)) +> + ((([1] : List (Fin 2))^(1 + q * 4)) +> l₀)) = + (([0, 0] ++ ([1] : List (Fin 2))^(1 + q * 4)) +> l₀) := by + rw [<- zLaa]; rfl + rw [h_eq] + refine result_call (h_two_one q) (f_G l₀ h₀) ?_ + intro u hu + refine ⟨([0, 0] : List (Fin 2)) +> ((([1] : List (Fin 2))^(q * 4)) +> u), + G_twoblocks q u hu, ?_⟩ + rw [<- zLaa]; rfl + | succ n' => + have h_eq : ((([0] : List (Fin 2))^((if true then 2 else 3) + (n' + 1) * 3)) +> + ((([1] : List (Fin 2))^(1 + q * 4)) +> l₀)) = + ([0, 0, 0] : List (Fin 2)) +> + ((([0] : List (Fin 2))^((if true then 2 else 3) + n' * 3)) +> + ((([1] : List (Fin 2))^(1 + q * 4)) +> l₀)) := by + have h_exp : ([0] : List (Fin 2))^((if true then 2 else 3) + (n' + 1) * 3) = + [0, 0, 0] ++ ([0] : List (Fin 2))^((if true then 2 else 3) + n' * 3) := by + have h_add : (if true then 2 else 3) + (n' + 1) * 3 = 3 + ((if true then 2 else 3) + n' * 3) := by omega + rw [h_add, zLpa]; rfl + rw [h_exp, <- zLaa] + rw [h_eq] + exact h_big _ (G.one true n' q l₀ h₀) + | two p n q l₀ h₀ ih => + rcases ih with ⟨_, IH⟩ + refine ⟨?_, fun hp => ?_⟩ + · rw [zLaa] + refine result_call (calls_app (t_zeros ((if p then 1 else 2) + n * 3)) (t_two q)) (IH rfl) ?_ + rintro v ⟨u, hu, rfl⟩ + rw [<- zLaa] + have h_ones : (([1] : List (Fin 2))^(4 + q * 4)) +> (([1, 1] : List (Fin 2)) +> u) = + (([1] : List (Fin 2))^(2 + (1 + q) * 4)) +> u := by + have h_eq1 : ([1, 1] : List (Fin 2)) = ([1] : List (Fin 2))^2 := rfl + have h_add : (4 + q * 4) + 2 = 2 + (1 + q) * 4 := by omega + rw [h_eq1, zLaa, <- zLpa, h_add] + rw [h_ones] + exact G.two p n (1 + q) u hu + · subst hp + cases n with + | zero => + have h_eq : ((([0] : List (Fin 2))^((if true then 1 else 2) + 0 * 3)) +> + ((([1] : List (Fin 2))^(2 + q * 4)) +> l₀)) = + ([0, 1] : List (Fin 2)) +> ((([1] : List (Fin 2))^(1 + q * 4)) +> l₀) := by + have h_1 : ([1] : List (Fin 2))^(2 + q * 4) = [1] ++ ([1] : List (Fin 2))^(1 + q * 4) := by + have h_add : 2 + q * 4 = 1 + (1 + q * 4) := by omega + rw [h_add, zLpa]; rfl + rw [h_1, <- zLaa]; rfl + rw [h_eq] + refine result_return h_one ?_ + refine ⟨(([0] : List (Fin 2))^((if true then 2 else 3) + 0 * 3)) +> + ((([1] : List (Fin 2))^(1 + q * 4)) +> l₀), + G.one true 0 q l₀ h₀, rfl⟩ + | succ n' => + have h_eq : ((([0] : List (Fin 2))^((if true then 1 else 2) + (n' + 1) * 3)) +> + ((([1] : List (Fin 2))^(2 + q * 4)) +> l₀)) = + ([0, 0, 0] : List (Fin 2)) +> + ((([0] : List (Fin 2))^((if true then 1 else 2) + n' * 3)) +> + ((([1] : List (Fin 2))^(2 + q * 4)) +> l₀)) := by + have h_exp : ([0] : List (Fin 2))^((if true then 1 else 2) + (n' + 1) * 3) = + [0, 0, 0] ++ ([0] : List (Fin 2))^((if true then 1 else 2) + n' * 3) := by + have h_add : (if true then 1 else 2) + (n' + 1) * 3 = 3 + ((if true then 1 else 2) + n' * 3) := by omega + rw [h_add, zLpa]; rfl + rw [h_exp, <- zLaa] + rw [h_eq] + exact h_big _ (G.two true n' q l₀ h₀) + +def Safe (l : ListBlank (Fin 2)) : Prop := + G true l ∨ Mark l + +theorem safe_step (l : ListBlank (Fin 2)) (hs : Safe l) : Result hh l Safe := by + rcases hs with hG | ⟨u, hG, rfl⟩ + · exact result_mono ((G_calls true l hG).2 rfl) (fun u hu => Or.inr hu) + · refine result_call h_two (G_calls true u hG).1 ?_ + intro v hv + exact Or.inl hv + +def cfg (l : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + cfgL hh l ((1 : Fin 2) >> default) + +theorem left_return (l : ListBlank (Fin 2)) : + (cfgR l ((1 : Fin 2) >> default)) [target_tm]⊢⁺ (cfg l) := by + unfold cfg cfgL cfgR hh; simp only [zCal, zLac, zLan]; execute + +theorem safe_reach (m : Nat) (l : ListBlank (Fin 2)) (hs : Safe l) : + ∃ N ≥ m, (multiStep target_tm (cfg l) N).isSome := by + induction m generalizing l with + | zero => exact ⟨0, Nat.le_refl 0, rfl⟩ + | succ m ih => + rcases safe_step l hs with ⟨l', hstep, hs'⟩ | hnh + · have hrun : (cfg l) [target_tm]⊢⁺ (cfg l') := + zPpp (hstep ((1 : Fin 2) >> default)) (left_return l') + rcases hrun with ⟨k, hk_pos, hk⟩ + rcases ih l' hs' with ⟨N', hN', hsome⟩ + refine ⟨k + N', by omega, ?_⟩ + rw [zMa, hk] + exact hsome + · exact ⟨m + 1, Nat.le_refl (m + 1), hnh ((1 : Fin 2) >> default) (m + 1)⟩ + +theorem safe_nonhalt (l : ListBlank (Fin 2)) (hs : Safe l) : NonHaltFrom (cfg l) := by + intro m + rcases safe_reach m l hs with ⟨N, hN, hsome⟩ + have h_eq : m + (N - m) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at hsome + exact zIm_some hsome + +theorem init_to_cfg : (init []) [target_tm]⊢* (cfg default) := by + refine zPs ?_ + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + unfold cfg cfgL hh + simp only [zCal, zLac, zLan] + execute + +end Solution + + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + have h_nh : NonHaltFrom (init []) := + multistep_nonhalt init_to_cfg (safe_nonhalt default (Or.inl (G.blank true))) + intro c hc + rcases hc with ⟨n, hn⟩ + have h_some := h_nh (n + 1) + rw [zMs, hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1LB_1LC0LF_1LD0RC_1RE0LA_1RE1RC_HHH0LE diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LB_1LC1RB_1RF1LD_0LE0LC_0RCHHH_1LA0RF.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LB_1LC1RB_1RF1LD_0LE0LC_0RCHHH_1LA0RF.lean new file mode 100644 index 00000000..6929ef47 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LB_1LC1RB_1RF1LD_0LE0LC_0RCHHH_1LA0RF.lean @@ -0,0 +1,1581 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1LB_1LC1RB_1RF1LD_0LE0LC_0RCHHH_1LA0RF + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LB_1LC1RB_1RF1LD_0LE0LC_0RCHHH_1LA0RF" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def F : Fin 6 := 5 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : + multiStep M config 0 = some config := rfl + +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : + multiStep M config 1 = step M config := rfl + +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +theorem multiStep_add (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n + m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem multiStep_step {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} {n : Nat} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢^{n} c₃) : c₁ [tm]⊢^{n + 1} c₃ := by + have := multiStep_trans tm c₁ c₂ c₃ 1 n h₁ h₂ + rwa [Nat.add_comm 1 n] at this + +theorem stepStar_refl (c : Cfg (Fin 2) (Fin 6)) : c [target_tm]⊢* c := ⟨0, rfl⟩ + +theorem stepPlus_to_stepStar {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢⁺ c₂) : + c₁ [target_tm]⊢* c₂ := by + rcases h with ⟨n, _, hn⟩; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [target_tm]⊢⁺ c₂) (h₂ : c₂ [target_tm]⊢* c₃) : c₁ [target_tm]⊢⁺ c₃ := by + rcases h₁ with ⟨n, hn_pos, hn⟩; rcases h₂ with ⟨m, hm⟩ + exact ⟨n + m, Nat.add_pos_left hn_pos m, multiStep_trans target_tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [target_tm]⊢* c₂) (h₂ : c₂ [target_tm]⊢⁺ c₃) : c₁ [target_tm]⊢⁺ c₃ := by + rcases h₁ with ⟨n, hn⟩; rcases h₂ with ⟨m, hm_pos, hm⟩ + exact ⟨n + m, Nat.add_pos_right n hm_pos, multiStep_trans target_tm c₁ c₂ c₃ n m hn hm⟩ + +omit [Inhabited Γ] in +@[simp] theorem pow_zero_list (l : List Γ) : l ^ (0 : Nat) = [] := rfl + +omit [Inhabited Γ] in +theorem pow_succ_list (l : List Γ) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl + +omit [Inhabited Γ] in +@[simp] theorem list_pow_add (l : List Γ) (n m : Nat) : l ^ (n + m) = l ^ n ++ l ^ m := by + induction n with + | zero => simp [pow_zero_list] + | succ n ih => + rw [Nat.succ_add, pow_succ_list, pow_succ_list, ih, List.append_assoc] + +omit [Inhabited Γ] in +theorem pow_succ_right (l : List Γ) (n : Nat) : l ^ (n + 1) = l ^ n ++ l := by + rw [list_pow_add]; simp [pow_succ_list, pow_zero_list] + +@[simp] theorem listblank_append_nil (s : ListBlank Γ) : ([] : List Γ) +> s = s := rfl + +@[simp] theorem listblank_append_cons (a : Γ) (l : List Γ) (s : ListBlank Γ) : + (a :: l) +> s = a >> (l +> s) := rfl + +@[simp] theorem listblank_append_assoc (l₁ l₂ : List Γ) (s : ListBlank Γ) : + (l₁ ++ l₂) +> s = l₁ +> (l₂ +> s) := + Turing.ListBlank.append_assoc l₁ l₂ s + +theorem left_pow_succ (l : ListBlank (Fin 2)) (u : List (Fin 2)) (n : Nat) : + l <+ u ^ (n + 1) = l <+ u ^ n <+ u := by + rw [pow_succ_list, listblank_append_assoc] + +theorem left_pow_succ_right (l : ListBlank (Fin 2)) (u : List (Fin 2)) (n : Nat) : + l <+ u ^ (n + 1) = l <+ u <+ u ^ n := by + rw [pow_succ_right, listblank_append_assoc] + +theorem right_pow_add (u : List (Fin 2)) (n m : Nat) (r : ListBlank (Fin 2)) : + u ^ (n + m) +> r = u ^ n +> (u ^ m +> r) := by + rw [list_pow_add, listblank_append_assoc] + +theorem right_pow_succ (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + u ^ (n + 1) +> r = u +> (u ^ n +> r) := by + rw [pow_succ_list, listblank_append_assoc] + +theorem right_pow_succ_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + u ^ (n + 1) +> r = u ^ n +> (u +> r) := by + rw [pow_succ_right, listblank_append_assoc] + +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +@[simp] theorem zero_cons_default : (0 : Fin 2) >> (default : ListBlank (Fin 2)) = default := by + change ListBlank.cons default default = default + exact ListBlank.cons_head_tail default + +@[simp] theorem init_nil : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = + ⟨some A, ⟨0, default, default⟩⟩ := rfl + +def U0 : List (Fin 2) := [1, 1, 0, 0, 0] +def U1 : List (Fin 2) := [1, 1, 1, 0, 0] +def d0 : List (Fin 2) := [0, 0, 0, 0] +def d1 : List (Fin 2) := [1, 0, 0, 0] +def d2 : List (Fin 2) := [0, 1, 0, 0] +def d3 : List (Fin 2) := [1, 1, 0, 0] +def p11 : List (Fin 2) := [1, 1] +def p10 : List (Fin 2) := [1, 0] +def p01 : List (Fin 2) := [0, 1] +def one_tok : List (Fin 2) := [1] + +macro "step1" : tactic => `(tactic| ( + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, init_nil, U0, U1, d0, d1, d2, d3, p11, p10, p01, one_tok, + pow_succ_list, pow_zero_list, + List.singleton_append, List.nil_append, List.cons_append, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail] + refine multiStep_step (by rfl) ?_ + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Tape.write, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail])) + +macro "run_steps" n:num : tactic => `(tactic| ( + iterate $n step1 + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, U0, U1, d0, d1, d2, d3, p11, p10, p01, one_tok, + pow_succ_list, pow_zero_list, + List.singleton_append, List.nil_append, List.cons_append, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail, multiStep_zero] + rfl)) + +-- ============================================================================ +-- Section 1: Tape Rotation & Power Shift Identities +-- ============================================================================ + +theorem one_zero_pow_shift (m : Nat) (r : ListBlank (Fin 2)) : + p10 ^ m +> ([1] +> r) = [1] +> (p01 ^ m +> r) := by + induction m with + | zero => rfl + | succ m ih => + rw [right_pow_succ p10 m, ih, right_pow_succ p01 m] + rfl + +theorem one_one_pow_shift (m : Nat) (l : ListBlank (Fin 2)) : + l <+ p11 ^ m <+ [1] = l <+ [1] <+ p11 ^ m := by + induction m generalizing l with + | zero => rfl + | succ m ih => + rw [left_pow_succ_right l p11 m, ih (l <+ p11), left_pow_succ_right (l <+ [1]) p11 m] + rfl + +-- ============================================================================ +-- Section 2: Side Call Relations & Primitive Machine Rules +-- ============================================================================ + +def sideH (l l' : ListBlank (Fin 2)) : Prop := + ∀ r, (l <{{C}} r) [target_tm]⊢⁺ (l' {{F}}> r) + +def sideP (l l' : ListBlank (Fin 2)) : Prop := + ∀ r, (l <{{D}} r) [target_tm]⊢⁺ (l' {{B}}> r) + +def sidePs : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) → Prop + | 0, l, l' => l = l' + | q + 1, l, l' => ∃ lm, sideP l lm ∧ sidePs q lm l' + +theorem sidePs_snoc {q : Nat} {l l' : ListBlank (Fin 2)} + (h : sidePs (q + 1) l l') : ∃ lm, sidePs q l lm ∧ sideP lm l' := by + induction q generalizing l with + | zero => + rcases h with ⟨lm, hp, rfl⟩ + exact ⟨l, rfl, hp⟩ + | succ q ih => + rcases h with ⟨lm₁, hp₁, hps⟩ + rcases ih hps with ⟨lm₂, hps₂, hp₂⟩ + exact ⟨lm₂, ⟨lm₁, hp₁, hps₂⟩, hp₂⟩ + +theorem P0 (l : ListBlank (Fin 2)) : sideP (l <+ U0) (l <+ U1) := + fun _ => ⟨9, by omega, by run_steps 9⟩ + +theorem P1_enter (l r : ListBlank (Fin 2)) : + ((l <+ U1) <{{D}} r) [target_tm]⊢⁺ (l <{{C}} (p11 ^ 2 +> ([0] +> r))) := + ⟨7, by omega, by run_steps 7⟩ + +theorem P1_exit (l' r : ListBlank (Fin 2)) : + (l' {{F}}> (p11 ^ 2 +> ([0] +> r))) [target_tm]⊢⁺ ((l' <+ U0) {{B}}> r) := + ⟨7, by omega, by run_steps 7⟩ + +theorem P1 {l l' : ListBlank (Fin 2)} (h : sideH l l') : sideP (l <+ U1) (l' <+ U0) := + fun r => stepPlus_trans (P1_enter l r) (stepPlus_trans (h (p11 ^ 2 +> ([0] +> r))) (P1_exit l' r)) + +theorem H0 (l : ListBlank (Fin 2)) : sideH (l <+ d0) (l <+ d1) := + fun _ => ⟨1, by omega, by run_steps 1⟩ + +theorem H1 (l : ListBlank (Fin 2)) : sideH (l <+ d1) (l <+ d2) := + fun _ => ⟨5, by omega, by run_steps 5⟩ + +theorem H2 (l : ListBlank (Fin 2)) : sideH (l <+ d2) (l <+ d3) := + fun _ => ⟨1, by omega, by run_steps 1⟩ + +theorem H3_enter (l r : ListBlank (Fin 2)) : + ((l <+ d3) <{{C}} r) [target_tm]⊢⁺ (l <{{C}} (p11 ^ 2 +> r)) := + ⟨6, by omega, by run_steps 6⟩ + +theorem H3_exit (l' r : ListBlank (Fin 2)) : + (l' {{F}}> (p11 ^ 2 +> r)) [target_tm]⊢⁺ ((l' <+ d0) {{F}}> r) := + ⟨4, by omega, by run_steps 4⟩ + +theorem H3 {l l' : ListBlank (Fin 2)} (h : sideH l l') : sideH (l <+ d3) (l' <+ d0) := + fun r => stepPlus_trans (H3_enter l r) (stepPlus_trans (h (p11 ^ 2 +> r)) (H3_exit l' r)) + +theorem HT0 (l : ListBlank (Fin 2)) : sideH (l <+ [0, 0, 0]) (l <+ [1, 0, 0]) := + fun _ => ⟨1, by omega, by run_steps 1⟩ + +theorem HT1 (l : ListBlank (Fin 2)) : sideH (l <+ [1, 0, 0]) (l <+ [0, 1, 0]) := + fun _ => ⟨5, by omega, by run_steps 5⟩ + +theorem HT2 (l : ListBlank (Fin 2)) : sideH (l <+ [0, 1, 0]) (l <+ [1, 1, 0]) := + fun _ => ⟨1, by omega, by run_steps 1⟩ + +theorem StackEnter (l r : ListBlank (Fin 2)) : + ((l <+ p11) <{{D}} r) [target_tm]⊢⁺ (l <{{D}} (p10 +> r)) := + ⟨2, by omega, by run_steps 2⟩ + +theorem StackFirst (l r : ListBlank (Fin 2)) : + (l {{B}}> (p10 +> r)) [target_tm]⊢⁺ (l <{{D}} (p11 +> r)) := + ⟨3, by omega, by run_steps 3⟩ + +theorem StackLast (l r : ListBlank (Fin 2)) : + (l {{B}}> (p11 +> r)) [target_tm]⊢⁺ ((l <+ p11) {{B}}> r) := + ⟨2, by omega, by run_steps 2⟩ + +theorem LastReturn (m : Nat) (l r : ListBlank (Fin 2)) : + (l {{B}}> (p11 ^ m +> r)) [target_tm]⊢* ((l <+ p11 ^ m) {{B}}> r) := by + induction m generalizing l with + | zero => try exact stepStar_refl _ + | succ m ih => + rw [right_pow_succ p11 m r, left_pow_succ_right l p11 m] + exact stepStar_trans (stepPlus_to_stepStar (StackLast l _)) (ih (l <+ p11)) + +theorem H3_enter_pow (k : Nat) (l r : ListBlank (Fin 2)) : + ((l <+ d3 ^ k) <{{C}} r) [target_tm]⊢* (l <{{C}} (p11 ^ (k * 2) +> r)) := by + induction k generalizing r with + | zero => try exact stepStar_refl _ + | succ k ih => + rw [left_pow_succ l d3 k] + refine stepStar_trans (stepPlus_to_stepStar (H3_enter (l <+ d3 ^ k) r)) ?_ + refine stepStar_trans (ih (p11 ^ 2 +> r)) ?_ + rw [← right_pow_add p11 (k * 2) 2 r, show k * 2 + 2 = (k + 1) * 2 by omega] + try exact stepStar_refl _ + +theorem overflow_turn (l r : ListBlank (Fin 2)) : + ((l <+ [1, 1, 0, 1]) <{{C}} r) [target_tm]⊢⁺ (l {{B}}> (p11 ^ 2 +> r)) := + ⟨5, by omega, by run_steps 5⟩ + +theorem overflow_b0 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0] +> r)) [target_tm]⊢⁺ (l <{{C}} ([1] +> r)) := + ⟨1, by omega, by run_steps 1⟩ + +theorem overflow_c_step (l r : ListBlank (Fin 2)) : + ((l <+ p11) <{{C}} r) [target_tm]⊢⁺ (l <{{C}} (p01 +> r)) := + ⟨2, by omega, by run_steps 2⟩ + +theorem overflow_c_scan (m : Nat) (l r : ListBlank (Fin 2)) : + ((l <+ p11 ^ m) <{{C}} r) [target_tm]⊢* (l <{{C}} (p01 ^ m +> r)) := by + induction m generalizing r with + | zero => try exact stepStar_refl _ + | succ m ih => + rw [left_pow_succ l p11 m] + refine stepStar_trans (stepPlus_to_stepStar (overflow_c_step (l <+ p11 ^ m) r)) ?_ + refine stepStar_trans (ih (p01 +> r)) ?_ + rw [← right_pow_succ_right p01 m r] + try exact stepStar_refl _ + +theorem TerminalOverflow (l r : ListBlank (Fin 2)) (k : Nat) : + ((l <+ [1, 1, 0, 1] <+ d3 ^ k <+ U1) <{{D}} r) [target_tm]⊢⁺ + (l <{{C}} (p01 ^ (k * 2 + 4) +> ([1] +> r))) := by + have h1 : ((l <+ [1, 1, 0, 1] <+ d3 ^ k <+ U1) <{{D}} r) [target_tm]⊢⁺ + ((l <+ [1, 1, 0, 1] <+ d3 ^ k) <{{C}} (p11 ^ 2 +> ([0] +> r))) := + P1_enter (l <+ [1, 1, 0, 1] <+ d3 ^ k) r + have h2 : ((l <+ [1, 1, 0, 1] <+ d3 ^ k) <{{C}} (p11 ^ 2 +> ([0] +> r))) [target_tm]⊢* + ((l <+ [1, 1, 0, 1]) <{{C}} (p11 ^ (k * 2 + 2) +> ([0] +> r))) := by + have h2' := H3_enter_pow k (l <+ [1, 1, 0, 1]) (p11 ^ 2 +> ([0] +> r)) + rwa [← right_pow_add p11 (k * 2) 2 ([0] +> r)] at h2' + have h3 : ((l <+ [1, 1, 0, 1]) <{{C}} (p11 ^ (k * 2 + 2) +> ([0] +> r))) [target_tm]⊢⁺ + (l {{B}}> (p11 ^ (k * 2 + 4) +> ([0] +> r))) := by + have h3' := overflow_turn l (p11 ^ (k * 2 + 2) +> ([0] +> r)) + rwa [← right_pow_add p11 2 (k * 2 + 2) ([0] +> r), show 2 + (k * 2 + 2) = k * 2 + 4 by omega] at h3' + have h4 := LastReturn (k * 2 + 4) l ([0] +> r) + have h5 := overflow_b0 (l <+ p11 ^ (k * 2 + 4)) r + have h6 := overflow_c_scan (k * 2 + 4) l ([1] +> r) + exact stepPlus_stepStar_trans + (stepPlus_trans (stepPlus_stepStar_trans h1 h2) (stepPlus_trans (stepPlus_stepStar_trans h3 h4) h5)) h6 + +theorem Reentry0 (l r : ListBlank (Fin 2)) : + ((l <+ [0, 0, 0, 0, 0, 0]) <{{C}} (p01 ^ 3 +> r)) [target_tm]⊢⁺ + ((l <+ [1, 1, 0, 0, 0, 1, 0, 0, 0]) <{{D}} ([1, 1, 1] +> r)) := + ⟨15, by omega, by run_steps 15⟩ + +theorem Reentry1 (l r : ListBlank (Fin 2)) : + ((l <+ [1, 0, 0, 0]) <{{C}} (p01 ^ 2 +> r)) [target_tm]⊢⁺ + ((l <+ U1) <{{D}} ([1, 1, 1] +> r)) := + ⟨11, by omega, by run_steps 11⟩ + +theorem Restart0 (l r : ListBlank (Fin 2)) : + ((l <+ [1]) {{B}}> ([0] +> r)) [target_tm]⊢⁺ (l <{{D}} (p11 +> r)) := + ⟨2, by omega, by run_steps 2⟩ + +theorem Restart11 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([1, 1, 0] +> r)) [target_tm]⊢⁺ ((l <+ [1]) <{{D}} (p11 +> r)) := + ⟨4, by omega, by run_steps 4⟩ + +-- ============================================================================ +-- Section 3: Base-4 and Normal Counters (TM6Counter) +-- ============================================================================ + +inductive RC : Nat → ListBlank (Fin 2) → Prop where + | zero : RC 0 default + | d0 (n : Nat) (l : ListBlank (Fin 2)) : RC n l → RC (4 * n) (l <+ d0) + | d1 (n : Nat) (l : ListBlank (Fin 2)) : RC n l → RC (1 + 4 * n) (l <+ d1) + | d2 (n : Nat) (l : ListBlank (Fin 2)) : RC n l → RC (2 + 4 * n) (l <+ d2) + | d3 (n : Nat) (l : ListBlank (Fin 2)) : RC n l → RC (3 + 4 * n) (l <+ d3) + +theorem d0_default : (default : ListBlank (Fin 2)) <+ d0 = default := by + simp [d0] + +theorem RC_zero_unique {l : ListBlank (Fin 2)} (h : RC 0 l) : l = default := by + generalize hn : (0 : Nat) = n at h + induction h with + | zero => rfl + | d0 n l _ ih => + have hn0 : n = 0 := by omega + rw [ih hn0.symm, d0_default] + | d1 => omega + | d2 => omega + | d3 => omega + +theorem RC_unique {n : Nat} {l l' : ListBlank (Fin 2)} (h : RC n l) (h' : RC n l') : l = l' := by + induction h generalizing l' with + | zero => exact (RC_zero_unique h').symm + | d0 n l h ih => + generalize hm : 4 * n = m at h' + cases h' with + | zero => + have hn0 : n = 0 := by omega + subst hn0 + rw [RC_zero_unique h, d0_default] + | d0 n' l' h' => + have : n = n' := by omega + subst this; rw [ih h'] + | d1 => omega + | d2 => omega + | d3 => omega + | d1 n l h ih => + generalize hm : 1 + 4 * n = m at h' + cases h' with + | zero => omega + | d0 => omega + | d1 n' l' h' => + have : n = n' := by omega + subst this; rw [ih h'] + | d2 => omega + | d3 => omega + | d2 n l h ih => + generalize hm : 2 + 4 * n = m at h' + cases h' with + | zero => omega + | d0 => omega + | d1 => omega + | d2 n' l' h' => + have : n = n' := by omega + subst this; rw [ih h'] + | d3 => omega + | d3 n l h ih => + generalize hm : 3 + 4 * n = m at h' + cases h' with + | zero => omega + | d0 => omega + | d1 => omega + | d2 => omega + | d3 n' l' h' => + have : n = n' := by omega + subst this; rw [ih h'] + +theorem RInc {n : Nat} {l : ListBlank (Fin 2)} (h : RC n l) : + ∃ l', RC (n + 1) l' ∧ sideH l l' := by + induction h with + | zero => + refine ⟨default <+ d1, ?_, ?_⟩ + · exact RC.d1 0 default RC.zero + · have h0 := H0 default + rwa [d0_default] at h0 + | d0 n l h _ => + refine ⟨l <+ d1, ?_, H0 l⟩ + rw [show 4 * n + 1 = 1 + 4 * n by omega] + exact RC.d1 n l h + | d1 n l h _ => + refine ⟨l <+ d2, ?_, H1 l⟩ + rw [show (1 + 4 * n) + 1 = 2 + 4 * n by omega] + exact RC.d2 n l h + | d2 n l h _ => + refine ⟨l <+ d3, ?_, H2 l⟩ + rw [show (2 + 4 * n) + 1 = 3 + 4 * n by omega] + exact RC.d3 n l h + | d3 n l _ ih => + rcases ih with ⟨l', hl', hstep⟩ + refine ⟨l' <+ d0, ?_, H3 hstep⟩ + rw [show (3 + 4 * n) + 1 = 4 * (n + 1) by omega] + exact RC.d0 (n + 1) l' hl' + +inductive NC : Nat → ListBlank (Fin 2) → Prop where + | u0 (n : Nat) (l : ListBlank (Fin 2)) : RC n l → NC (2 * n) (l <+ U0) + | u1 (n : Nat) (l : ListBlank (Fin 2)) : RC n l → NC (1 + 2 * n) (l <+ U1) + +theorem NC_unique {n : Nat} {l l' : ListBlank (Fin 2)} (h : NC n l) (h' : NC n l') : l = l' := by + cases h with + | u0 n l h => + generalize hm : 2 * n = m at h' + cases h' with + | u0 n' l' h' => + have : n = n' := by omega + subst this; rw [RC_unique h h'] + | u1 => omega + | u1 n l h => + generalize hm : 1 + 2 * n = m at h' + cases h' with + | u0 => omega + | u1 n' l' h' => + have : n = n' := by omega + subst this; rw [RC_unique h h'] + +theorem NormalInc {n : Nat} {l : ListBlank (Fin 2)} (h : NC n l) : + ∃ l', NC (n + 1) l' ∧ sideP l l' := by + cases h with + | u0 n l h => + refine ⟨l <+ U1, ?_, P0 l⟩ + rw [show 2 * n + 1 = 1 + 2 * n by omega] + exact NC.u1 n l h + | u1 n l h => + rcases RInc h with ⟨l', hl', hstep⟩ + refine ⟨l' <+ U0, ?_, P1 hstep⟩ + rw [show (1 + 2 * n) + 1 = 2 * (n + 1) by omega] + exact NC.u0 (n + 1) l' hl' + +theorem NormalAdds_ex (q : Nat) {n : Nat} {l : ListBlank (Fin 2)} (h : NC n l) : + ∃ l', NC (n + q) l' ∧ sidePs q l l' := by + induction q generalizing n l with + | zero => exact ⟨l, h, rfl⟩ + | succ q ih => + rcases NormalInc h with ⟨l₁, hl₁, hp⟩ + rcases ih hl₁ with ⟨l₂, hl₂, hps⟩ + rw [show n + (q + 1) = (n + 1) + q by omega] + exact ⟨l₂, hl₂, ⟨l₁, hp, hps⟩⟩ + +theorem NormalAdds (q : Nat) {n : Nat} {l l' : ListBlank (Fin 2)} + (h : NC n l) (h' : NC (n + q) l') : sidePs q l l' := by + rcases NormalAdds_ex q h with ⟨l₂, hl₂, hps⟩ + rw [NC_unique h' hl₂] + exact hps + +inductive FC (tail : ListBlank (Fin 2)) : Nat → Nat → ListBlank (Fin 2) → Prop where + | t0 : FC tail 0 0 (tail <+ [0, 0, 0]) + | t1 : FC tail 0 1 (tail <+ [1, 0, 0]) + | t2 : FC tail 0 2 (tail <+ [0, 1, 0]) + | t3 : FC tail 0 3 (tail <+ [1, 1, 0]) + | d0 (k n : Nat) (l : ListBlank (Fin 2)) : FC tail k n l → FC tail (k + 1) (4 * n) (l <+ d0) + | d1 (k n : Nat) (l : ListBlank (Fin 2)) : FC tail k n l → FC tail (k + 1) (1 + 4 * n) (l <+ d1) + | d2 (k n : Nat) (l : ListBlank (Fin 2)) : FC tail k n l → FC tail (k + 1) (2 + 4 * n) (l <+ d2) + | d3 (k n : Nat) (l : ListBlank (Fin 2)) : FC tail k n l → FC tail (k + 1) (3 + 4 * n) (l <+ d3) + +theorem FC_zero_inv {tail : ListBlank (Fin 2)} {K m : Nat} {l' : ListBlank (Fin 2)} + (h : FC tail K m l') (hK : K = 0) : + (m = 0 ∧ l' = tail <+ [0, 0, 0]) ∨ + (m = 1 ∧ l' = tail <+ [1, 0, 0]) ∨ + (m = 2 ∧ l' = tail <+ [0, 1, 0]) ∨ + (m = 3 ∧ l' = tail <+ [1, 1, 0]) := by + cases h with + | t0 => exact Or.inl ⟨rfl, rfl⟩ + | t1 => exact Or.inr (Or.inl ⟨rfl, rfl⟩) + | t2 => exact Or.inr (Or.inr (Or.inl ⟨rfl, rfl⟩)) + | t3 => exact Or.inr (Or.inr (Or.inr ⟨rfl, rfl⟩)) + | _ => omega + +theorem FC_unique {tail : ListBlank (Fin 2)} {k n : Nat} {l l' : ListBlank (Fin 2)} + (h : FC tail k n l) (h' : FC tail k n l') : l = l' := by + induction h generalizing l' with + | t0 => + rcases FC_zero_inv h' rfl with ⟨_, rfl⟩ | ⟨h1, _⟩ | ⟨h2, _⟩ | ⟨h3, _⟩ <;> first | rfl | omega + | t1 => + rcases FC_zero_inv h' rfl with ⟨h0, _⟩ | ⟨_, rfl⟩ | ⟨h2, _⟩ | ⟨h3, _⟩ <;> first | rfl | omega + | t2 => + rcases FC_zero_inv h' rfl with ⟨h0, _⟩ | ⟨h1, _⟩ | ⟨_, rfl⟩ | ⟨h3, _⟩ <;> first | rfl | omega + | t3 => + rcases FC_zero_inv h' rfl with ⟨h0, _⟩ | ⟨h1, _⟩ | ⟨h2, _⟩ | ⟨_, rfl⟩ <;> first | rfl | omega + | d0 k n l _ ih => + generalize hk : k + 1 = K, hm : 4 * n = m at h' + cases h' with + | d0 k' n' l' h' => + have hk' : k = k' := by omega + have hn' : n = n' := by omega + subst hk'; subst hn'; rw [ih h'] + | _ => omega + | d1 k n l _ ih => + generalize hk : k + 1 = K, hm : 1 + 4 * n = m at h' + cases h' with + | d1 k' n' l' h' => + have hk' : k = k' := by omega + have hn' : n = n' := by omega + subst hk'; subst hn'; rw [ih h'] + | _ => omega + | d2 k n l _ ih => + generalize hk : k + 1 = K, hm : 2 + 4 * n = m at h' + cases h' with + | d2 k' n' l' h' => + have hk' : k = k' := by omega + have hn' : n = n' := by omega + subst hk'; subst hn'; rw [ih h'] + | _ => omega + | d3 k n l _ ih => + generalize hk : k + 1 = K, hm : 3 + 4 * n = m at h' + cases h' with + | d3 k' n' l' h' => + have hk' : k = k' := by omega + have hn' : n = n' := by omega + subst hk'; subst hn'; rw [ih h'] + | _ => omega + +theorem FiniteRInc {tail : ListBlank (Fin 2)} {k n : Nat} {l : ListBlank (Fin 2)} + (h : FC tail k n l) (hbound : n + 1 < 4 ^ (k + 1)) : + ∃ l', FC tail k (n + 1) l' ∧ sideH l l' := by + induction h with + | t0 => exact ⟨tail <+ [1, 0, 0], FC.t1, HT0 tail⟩ + | t1 => exact ⟨tail <+ [0, 1, 0], FC.t2, HT1 tail⟩ + | t2 => exact ⟨tail <+ [1, 1, 0], FC.t3, HT2 tail⟩ + | t3 => simp at hbound + | d0 k n l h _ => + refine ⟨l <+ d1, ?_, H0 l⟩ + rw [show 4 * n + 1 = 1 + 4 * n by omega] + exact FC.d1 k n l h + | d1 k n l h _ => + refine ⟨l <+ d2, ?_, H1 l⟩ + rw [show (1 + 4 * n) + 1 = 2 + 4 * n by omega] + exact FC.d2 k n l h + | d2 k n l h _ => + refine ⟨l <+ d3, ?_, H2 l⟩ + rw [show (2 + 4 * n) + 1 = 3 + 4 * n by omega] + exact FC.d3 k n l h + | d3 k n l _ ih => + have hsmall : n + 1 < 4 ^ (k + 1) := by + rw [Nat.pow_succ] at hbound; omega + rcases ih hsmall with ⟨l', hl', hstep⟩ + refine ⟨l' <+ d0, ?_, H3 hstep⟩ + rw [show (3 + 4 * n) + 1 = 4 * (n + 1) by omega] + exact FC.d0 k (n + 1) l' hl' + +inductive FNC (tail : ListBlank (Fin 2)) (k : Nat) : Nat → ListBlank (Fin 2) → Prop where + | u0 (n : Nat) (l : ListBlank (Fin 2)) : FC tail k n l → FNC tail k (2 * n) (l <+ U0) + | u1 (n : Nat) (l : ListBlank (Fin 2)) : FC tail k n l → FNC tail k (1 + 2 * n) (l <+ U1) + +theorem FNC_unique {tail : ListBlank (Fin 2)} {k n : Nat} {l l' : ListBlank (Fin 2)} + (h : FNC tail k n l) (h' : FNC tail k n l') : l = l' := by + cases h with + | u0 n l h => + generalize hm : 2 * n = m at h' + cases h' with + | u0 n' l' h' => + have : n = n' := by omega + subst this; rw [FC_unique h h'] + | u1 => omega + | u1 n l h => + generalize hm : 1 + 2 * n = m at h' + cases h' with + | u0 => omega + | u1 n' l' h' => + have : n = n' := by omega + subst this; rw [FC_unique h h'] + +theorem FiniteInc {tail : ListBlank (Fin 2)} {k n : Nat} {l : ListBlank (Fin 2)} + (h : FNC tail k n l) (hbound : n + 1 < 2 * 4 ^ (k + 1)) : + ∃ l', FNC tail k (n + 1) l' ∧ sideP l l' := by + cases h with + | u0 n l h => + refine ⟨l <+ U1, ?_, P0 l⟩ + rw [show 2 * n + 1 = 1 + 2 * n by omega] + exact FNC.u1 n l h + | u1 n l h => + have hsmall : n + 1 < 4 ^ (k + 1) := by omega + rcases FiniteRInc h hsmall with ⟨l', hl', hstep⟩ + refine ⟨l' <+ U0, ?_, P1 hstep⟩ + rw [show (1 + 2 * n) + 1 = 2 * (n + 1) by omega] + exact FNC.u0 (n + 1) l' hl' + +theorem FiniteAdds_ex {tail : ListBlank (Fin 2)} {k : Nat} (q : Nat) {n : Nat} {l : ListBlank (Fin 2)} + (h : FNC tail k n l) (hbound : n + q < 2 * 4 ^ (k + 1)) : + ∃ l', FNC tail k (n + q) l' ∧ sidePs q l l' := by + induction q generalizing n l with + | zero => exact ⟨l, h, rfl⟩ + | succ q ih => + have hfirst : n + 1 < 2 * 4 ^ (k + 1) := by omega + rcases FiniteInc h hfirst with ⟨l₁, hl₁, hp⟩ + have hrest : (n + 1) + q < 2 * 4 ^ (k + 1) := by omega + rcases ih hl₁ hrest with ⟨l₂, hl₂, hps⟩ + rw [show n + (q + 1) = (n + 1) + q by omega] + exact ⟨l₂, hl₂, ⟨l₁, hp, hps⟩⟩ + +theorem FiniteAdds {tail : ListBlank (Fin 2)} {k : Nat} (q : Nat) {n : Nat} {l l' : ListBlank (Fin 2)} + (h : FNC tail k n l) (h' : FNC tail k (n + q) l') (hbound : n + q < 2 * 4 ^ (k + 1)) : + sidePs q l l' := by + rcases FiniteAdds_ex q h hbound with ⟨l₂, hl₂, hps⟩ + rw [FNC_unique h' hl₂] + exact hps + +-- ============================================================================ +-- Section 4: Binary Call Stack Frames (TM6Frames) +-- ============================================================================ + +def bval (b : Bool) : Nat := if b then 1 else 0 +def bit (b : Bool) : Fin 2 := if b then 1 else 0 + +def fvalue : List Bool → Nat + | [] => 0 + | b :: bs => bval b + 2 * fvalue bs + +def Frame : List Bool → List (Fin 2) + | [] => [] + | b :: bs => [1, bit b] ++ Frame bs + +def finc : List Bool → List Bool + | [] => [] + | false :: bs => true :: bs + | true :: bs => false :: finc bs + +theorem Frame_app (xs ys : List Bool) : Frame (xs ++ ys) = Frame xs ++ Frame ys := by + induction xs with + | nil => rfl + | cons b xs ih => simp [Frame, ih] + +theorem fvalue_app (xs ys : List Bool) : + fvalue (xs ++ ys) = fvalue xs + 2 ^ xs.length * fvalue ys := by + induction xs with + | nil => simp [fvalue] + | cons b xs ih => + simp only [List.cons_append, fvalue, List.length_cons, ih, Nat.pow_succ] + ring + +theorem fvalue_zeros (m : Nat) : fvalue (List.replicate m false) = 0 := by + induction m with + | zero => rfl + | succ m ih => simp [List.replicate_succ, fvalue, bval, ih] + +theorem fvalue_bound (bs : List Bool) : fvalue bs < 2 ^ bs.length := by + induction bs with + | nil => simp [fvalue] + | cons b bs ih => + cases b + · change 0 + 2 * fvalue bs < 2 ^ bs.length * 2; omega + · change 1 + 2 * fvalue bs < 2 ^ bs.length * 2; omega + +theorem finc_length (bs : List Bool) : (finc bs).length = bs.length := by + induction bs with + | nil => rfl + | cons b bs ih => cases b <;> simp [finc, ih] + +theorem fvalue_finc (bs : List Bool) (h : fvalue bs + 1 < 2 ^ bs.length) : + fvalue (finc bs) = fvalue bs + 1 := by + induction bs with + | nil => simp [fvalue] at h + | cons b bs ih => + cases b + · change 1 + 2 * fvalue bs = (0 + 2 * fvalue bs) + 1 + omega + · change 1 + 2 * fvalue bs + 1 < 2 ^ bs.length * 2 at h + have hbs : fvalue bs + 1 < 2 ^ bs.length := by omega + change 0 + 2 * fvalue (finc bs) = (1 + 2 * fvalue bs) + 1 + rw [ih hbs] + omega + +theorem fvalue_injective {xs ys : List Bool} + (hlen : xs.length = ys.length) (hval : fvalue xs = fvalue ys) : xs = ys := by + induction xs generalizing ys with + | nil => + cases ys with + | nil => rfl + | cons _ _ => simp at hlen + | cons b xs ih => + cases ys with + | nil => simp at hlen + | cons c ys => + simp only [List.length_cons] at hlen + cases b <;> cases c + · change 0 + 2 * fvalue xs = 0 + 2 * fvalue ys at hval + congr 1; exact ih (by omega) (by omega) + · change 0 + 2 * fvalue xs = 1 + 2 * fvalue ys at hval; omega + · change 1 + 2 * fvalue xs = 0 + 2 * fvalue ys at hval; omega + · change 1 + 2 * fvalue xs = 1 + 2 * fvalue ys at hval + congr 1; exact ih (by omega) (by omega) + +theorem fvalue_ones (m : Nat) : fvalue (List.replicate m true) + 1 = 2 ^ m := by + induction m with + | zero => rfl + | succ m ih => + change (1 + 2 * fvalue (List.replicate m true)) + 1 = 2 ^ m * 2 + omega + +theorem Frame_ones (m : Nat) : Frame (List.replicate m true) = p11 ^ m := by + induction m with + | zero => rfl + | succ m ih => + rw [List.replicate_succ, Frame, ih, pow_succ_list] + rfl + +theorem Frame_zeros (m : Nat) : Frame (List.replicate m false) = p10 ^ m := by + induction m with + | zero => rfl + | succ m ih => + rw [List.replicate_succ, Frame, ih, pow_succ_list] + rfl + +theorem FrameInc (bs : List Bool) (h : fvalue bs + 1 < 2 ^ bs.length) + (l r : ListBlank (Fin 2)) : + (l {{B}}> (Frame bs +> r)) [target_tm]⊢⁺ (l <{{D}} (Frame (finc bs) +> r)) := by + induction bs generalizing l with + | nil => simp [fvalue] at h + | cons b bs ih => + cases b + · change (l {{B}}> (p10 +> (Frame bs +> r))) [target_tm]⊢⁺ (l <{{D}} (p11 +> (Frame bs +> r))) + exact StackFirst l (Frame bs +> r) + · change 1 + 2 * fvalue bs + 1 < 2 ^ bs.length * 2 at h + have hbs : fvalue bs + 1 < 2 ^ bs.length := by omega + change (l {{B}}> (p11 +> (Frame bs +> r))) [target_tm]⊢⁺ (l <{{D}} (p10 +> (Frame (finc bs) +> r))) + exact stepPlus_trans (StackLast l (Frame bs +> r)) + (stepPlus_trans (ih hbs (l <+ p11)) (StackEnter l (Frame (finc bs) +> r))) + +theorem FrameWalkCalls (q : Nat) {xs ys : List Bool} {l l' : ListBlank (Fin 2)} + (hlen : xs.length = ys.length) (hval : fvalue xs + q = fvalue ys) + (hps : sidePs q l l') (r : ListBlank (Fin 2)) : + (l <{{D}} (Frame xs +> r)) [target_tm]⊢* (l' <{{D}} (Frame ys +> r)) := by + induction q generalizing xs l with + | zero => + have hxy : xs = ys := fvalue_injective hlen (by omega) + subst hxy; subst hps + try exact stepStar_refl _ + | succ q ih => + rcases hps with ⟨lm, hp, hps'⟩ + have hys_bound := fvalue_bound ys + rw [← hlen] at hys_bound + have hxs_inc : fvalue xs + 1 < 2 ^ xs.length := by omega + have hlen' : (finc xs).length = ys.length := by rw [finc_length, hlen] + have hval' : fvalue (finc xs) + q = fvalue ys := by rw [fvalue_finc xs hxs_inc]; omega + exact stepStar_trans (stepPlus_to_stepStar (hp (Frame xs +> r))) + (stepStar_trans (stepPlus_to_stepStar (FrameInc xs hxs_inc lm r)) + (ih hlen' hval' hps')) + +theorem Descend (m : Nat) (l r : ListBlank (Fin 2)) : + ((l <+ p11 ^ m) <{{D}} r) [target_tm]⊢* + (l <{{D}} (Frame (List.replicate m false) +> r)) := by + rw [Frame_zeros] + induction m generalizing r with + | zero => try exact stepStar_refl _ + | succ m ih => + rw [left_pow_succ l p11 m] + refine stepStar_trans (stepPlus_to_stepStar (StackEnter (l <+ p11 ^ m) r)) ?_ + refine stepStar_trans (ih (p10 +> r)) ?_ + rw [← right_pow_succ_right p10 m r] + try exact stepStar_refl _ + +theorem Drain (q : Nat) (bs : List Bool) (l l' r : ListBlank (Fin 2)) + (hval : fvalue bs + q + 1 = 2 ^ bs.length) (hps : sidePs (q + 1) l l') : + (l <{{D}} (Frame bs +> r)) [target_tm]⊢⁺ + ((l' <+ p11 ^ bs.length) {{B}}> r) := by + rcases sidePs_snoc hps with ⟨lm, hps_q, hp_last⟩ + have hlen : bs.length = (List.replicate bs.length true).length := by simp + have hval_ones : fvalue bs + q = fvalue (List.replicate bs.length true) := by + have := fvalue_ones bs.length; omega + have hwalk := FrameWalkCalls q hlen hval_ones hps_q r + rw [Frame_ones] at hwalk + have hcall := hp_last (p11 ^ bs.length +> r) + have hret := LastReturn bs.length l' r + exact stepStar_stepPlus_trans hwalk (stepPlus_stepStar_trans hcall hret) + +theorem Double {l lm l' : ListBlank (Fin 2)} (h₁ : sideP l lm) (h₂ : sideP lm l') : + sideP (l <+ p11) (l' <+ p11) := by + intro r + exact stepPlus_trans (StackEnter l r) + (stepPlus_trans (h₁ (p10 +> r)) + (stepPlus_trans (StackFirst lm r) + (stepPlus_trans (h₂ (p11 +> r)) (StackLast l' r)))) + +theorem Double_ps (q : Nat) {l l' : ListBlank (Fin 2)} (h : sidePs (q * 2) l l') : + sidePs q (l <+ p11) (l' <+ p11) := by + induction q generalizing l with + | zero => + change l = l' at h + subst h; rfl + | succ q ih => + rw [show (q + 1) * 2 = q * 2 + 1 + 1 by omega] at h + rcases h with ⟨lm₁, hp₁, lm₂, hp₂, hps⟩ + exact ⟨lm₂ <+ p11, Double hp₁ hp₂, ih hps⟩ + +theorem Multiplier (n q : Nat) {l l' : ListBlank (Fin 2)} (h : sidePs (q * 2 ^ n) l l') : + sidePs q (l <+ p11 ^ n) (l' <+ p11 ^ n) := by + induction n generalizing q with + | zero => + rw [Nat.pow_zero, Nat.mul_one] at h + simpa using h + | succ n ih => + rw [left_pow_succ l p11 n, left_pow_succ l' p11 n] + apply Double_ps + apply ih (q * 2) + rwa [show q * 2 * 2 ^ n = q * 2 ^ (n + 1) by rw [Nat.pow_succ]; ring] + +-- ============================================================================ +-- Section 5: Entry Family, Bit Budgets & Reentry Bridges (Entry / TM6Bits / TM6Reentry) +-- ============================================================================ + +def bnat (b : Bool) : Nat := if b then 1 else 0 + +def sparse : List Bool → List (Fin 2) + | [] => [] + | b :: w => (if b then d1 else d0) ++ sparse w + +def doubled : List Bool → List (Fin 2) + | [] => [] + | b :: w => (if b then d2 else d0) ++ doubled w + +def E_cfg (b : Bool) (w : List Bool) : Cfg (Fin 2) (Fin 6) := + ((default <+ one_tok ^ (1 + bnat b) <+ [0, 0, 0] <+ sparse w <+ U0 <+ + p11 ^ (w.length * 2 + 3 + bnat b)) <{{D}} (p11 +> default)) + +def next_word (b : Bool) (w : List Bool) : List Bool := + List.replicate (w.length + bnat b) false ++ [true] ++ w ++ [false] + +def evalue : List Bool → Nat + | [] => 0 + | b :: w => bnat b + evalue w * 4 + +theorem evalue_app (u v : List Bool) : + evalue (u ++ v) = evalue u + evalue v * 4 ^ u.length := by + induction u with + | nil => simp [evalue] + | cons b u ih => + simp only [List.cons_append, evalue, List.length_cons, ih, Nat.pow_succ] + ring + +theorem evalue_zeroes (n : Nat) : evalue (List.replicate n false) = 0 := by + induction n with + | zero => rfl + | succ n ih => simp [List.replicate_succ, evalue, bnat, ih] + +theorem sparse_app (u v : List Bool) : sparse (u ++ v) = sparse u ++ sparse v := by + induction u with + | nil => rfl + | cons b u ih => simp [sparse, ih] + +theorem doubled_app (u v : List Bool) : doubled (u ++ v) = doubled u ++ doubled v := by + induction u with + | nil => rfl + | cons b u ih => simp [doubled, ih] + +theorem sparse_shift (w : List Bool) : ([0] : List (Fin 2)) ++ sparse w = doubled w ++ [0] := by + induction w with + | nil => rfl + | cons b w ih => + cases b <;> simp only [sparse, doubled, d0, d1, d2, List.cons_append, List.nil_append] + · exact congrArg (fun xs => (0 : Fin 2) :: 0 :: 0 :: 0 :: xs) ih + · exact congrArg (fun xs => (0 : Fin 2) :: 1 :: 0 :: 0 :: xs) ih + +theorem init_step_1 : + (init ([] : List (Fin 2))) [target_tm]⊢* + ((default <+ [1, 1, 0, 0, 0, 1, 1]) <{{D}} ([1, 1, 1, 1] +> default)) := + ⟨79, by run_steps 79⟩ + +theorem init_step_2 : + ((default <+ [1, 1, 0, 0, 0, 1, 1]) <{{D}} ([1, 1, 1, 1] +> default)) [target_tm]⊢* + ((default <+ [1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1]) <{{D}} ([1, 1, 1, 1] +> default)) := + ⟨81, by run_steps 81⟩ + +theorem init_step_3 : + ((default <+ [1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1]) <{{D}} ([1, 1, 1, 1] +> default)) [target_tm]⊢* + ((default <+ [1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1]) <{{D}} ([1, 1, 1, 1, 1, 1] +> default)) := + ⟨78, by run_steps 78⟩ + +theorem init_step_4 : + ((default <+ [1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1]) <{{D}} ([1, 1, 1, 1, 1, 1] +> default)) [target_tm]⊢* + ((default <+ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1]) <{{D}} ([1, 1] +> default)) := + ⟨87, by run_steps 87⟩ + +theorem init_step_5 : + ((default <+ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1]) <{{D}} ([1, 1] +> default)) [target_tm]⊢* + ((default <+ [1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1]) <{{D}} ([1, 1, 1, 1] +> default)) := + ⟨164, by run_steps 164⟩ + +theorem init_step_6 : + ((default <+ [1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1]) <{{D}} ([1, 1, 1, 1] +> default)) [target_tm]⊢* + E_cfg false [true] := by + unfold E_cfg bnat sparse + exact ⟨175, by run_steps 175⟩ + +theorem Entry_init : (init ([] : List (Fin 2))) [target_tm]⊢* E_cfg false [true] := + stepStar_trans init_step_1 + (stepStar_trans init_step_2 + (stepStar_trans init_step_3 + (stepStar_trans init_step_4 + (stepStar_trans init_step_5 init_step_6)))) + +def exit_bits (b : Bool) (w : List Bool) : List Bool := + (w.flatMap fun d => [true, !d]) ++ [true, true, true] ++ List.replicate (bnat b) false + +theorem exit_bits_length (b : Bool) (w : List Bool) : + (exit_bits b w).length = w.length * 2 + 3 + bnat b := by + induction w with + | nil => + simp only [exit_bits, List.flatMap_nil, List.nil_append, List.cons_append, + List.length_cons, List.length_replicate, List.length_nil] + omega + | cons d w ih => + simp only [exit_bits] at ih ⊢ + simp only [List.flatMap_cons, List.cons_append, List.nil_append, List.length_cons] + omega + +theorem exit_bits_value (b : Bool) (w : List Bool) : + 2 * evalue w + fvalue (exit_bits b w) + 1 = 2 * 4 ^ (w.length + 1) := by + induction w with + | nil => cases b <;> rfl + | cons d w ih => + simp only [exit_bits] at ih ⊢ + cases d + · change 2 * (0 + evalue w * 4) + (1 + 2 * (1 + 2 * fvalue + (List.flatMap (fun d => [true, !d]) w ++ [true, true, true] ++ List.replicate (bnat b) false))) + 1 = + 2 * (4 ^ (w.length + 1) * 4) + omega + · change 2 * (1 + evalue w * 4) + (1 + 2 * (0 + 2 * fvalue + (List.flatMap (fun d => [true, !d]) w ++ [true, true, true] ++ List.replicate (bnat b) false))) + 1 = + 2 * (4 ^ (w.length + 1) * 4) + omega + +def reentry_radius (b : Bool) (w : List Bool) : Nat := w.length * 2 + 1 + bnat b + +def reentry_bits (b : Bool) (w : List Bool) : List Bool := + [true] ++ List.replicate (reentry_radius b w) false ++ [true] ++ exit_bits b w ++ [true] + +theorem reentry_bits_length (b : Bool) (w : List Bool) : + (reentry_bits b w).length = w.length * 4 + 7 + bnat b * 2 := by + simp only [reentry_bits, List.length_append, List.length_replicate, + exit_bits_length, reentry_radius, List.length_cons, List.length_nil] + omega + +theorem reentry_bits_length_parts (b : Bool) (w : List Bool) : + (reentry_bits b w).length = reentry_radius b w + (exit_bits b w).length + 3 := by + simp only [reentry_bits, List.length_append, List.length_replicate, + List.length_cons, List.length_nil] + omega + +theorem reentry_bits_value (b : Bool) (w : List Bool) : + fvalue (reentry_bits b w) = 1 + 2 ^ (reentry_radius b w + 1) * + (1 + 2 * fvalue (exit_bits b w) + 2 ^ ((exit_bits b w).length + 1)) := by + have hb1 : bval true = 1 := rfl + simp only [reentry_bits, List.append_assoc, fvalue_app, fvalue_zeros, + List.length_replicate, fvalue, hb1, List.length_cons, List.length_nil, Nat.pow_succ, Nat.pow_zero] + ring + +theorem pow2_twice (k : Nat) : 2 ^ (k * 2) = 4 ^ k := by + induction k with + | zero => rfl + | succ k ih => + rw [show (k + 1) * 2 = k * 2 + 1 + 1 by omega, Nat.pow_succ, Nat.pow_succ, ih, Nat.pow_succ] + ring + +theorem pow2_exit_length (b : Bool) (k : Nat) : + 2 ^ (k * 2 + 3 + bnat b + 1) = (1 + bnat b) * 4 ^ (k + 2) := by + cases b + · change 2 ^ (k * 2 + 3 + 0 + 1) = (1 + 0) * 4 ^ (k + 2) + rw [show k * 2 + 3 + 0 + 1 = (k + 2) * 2 by omega, pow2_twice]; ring + · change 2 ^ (k * 2 + 3 + 1 + 1) = (1 + 1) * 4 ^ (k + 2) + rw [show k * 2 + 3 + 1 + 1 = (k + 2) * 2 + 1 by omega, Nat.pow_succ, pow2_twice]; ring + +def drain_A (b : Bool) (w : List Bool) : Nat := 4 * evalue w + 1 + bnat b * 4 ^ (w.length + 2) +def drain_q (b : Bool) (w : List Bool) : Nat := drain_A b w * 2 ^ (reentry_radius b w + 1) - 2 + +theorem exit_budget_identity (b : Bool) (w : List Bool) : + drain_A b w + 2 * fvalue (exit_bits b w) + 1 = 2 ^ ((exit_bits b w).length + 1) := by + have he := exit_bits_value b w + rw [exit_bits_length, pow2_exit_length] + unfold drain_A + rw [show w.length + 2 = (w.length + 1) + 1 by omega, Nat.pow_succ] + cases b + · change 4 * evalue w + 1 + 0 * (4 ^ (w.length + 1) * 4) + 2 * fvalue (exit_bits false w) + 1 = + (1 + 0) * (4 ^ (w.length + 1) * 4) + omega + · change 4 * evalue w + 1 + 1 * (4 ^ (w.length + 1) * 4) + 2 * fvalue (exit_bits true w) + 1 = + (1 + 1) * (4 ^ (w.length + 1) * 4) + omega + +theorem drain_budget (b : Bool) (w : List Bool) : + fvalue (reentry_bits b w) + drain_q b w + 1 = 2 ^ (reentry_bits b w).length := by + have ha := exit_budget_identity b w + have hv := reentry_bits_value b w + rw [reentry_bits_length_parts] + set R := 2 ^ (reentry_radius b w + 1) + set N := 2 ^ ((exit_bits b w).length + 1) + set j := fvalue (exit_bits b w) + set a := drain_A b w + have ha_pos : 1 ≤ a := by unfold a drain_A; omega + have hR_ge : 2 ≤ R := by + unfold R; rw [Nat.pow_succ] + have := Nat.one_le_pow (reentry_radius b w) 2 (by omega) + omega + have hprod : 2 ≤ a * R := by nlinarith + have hpow_end : 2 ^ (reentry_radius b w + (exit_bits b w).length + 3) = R * N * 2 := by + rw [show reentry_radius b w + (exit_bits b w).length + 3 = + (reentry_radius b w + 1) + ((exit_bits b w).length + 1) + 1 by omega, + Nat.pow_succ, Nat.pow_add] + rw [hpow_end, hv] + have h_lin : R * (1 + 2 * j + N) + a * R = R * N * 2 := by nlinarith + change (1 + R * (1 + 2 * j + N)) + (a * R - 2) + 1 = R * N * 2 + omega + +theorem Reentry0Frames (k : Nat) (bs : List Bool) : + ((default : ListBlank (Fin 2)) <{{C}} + (p01 ^ (k * 2 + 4) +> ([1] +> (Frame bs +> (p11 +> default))))) [target_tm]⊢⁺ + ((default <+ d1 <+ U0) <{{D}} + (Frame ([true] ++ List.replicate (k * 2 + 1) false ++ [true] ++ bs ++ [true]) +> default)) := by + have h_lhs : ((default : ListBlank (Fin 2)) <{{C}} + (p01 ^ (k * 2 + 4) +> ([1] +> (Frame bs +> (p11 +> default))))) = + ((default <+ [0, 0, 0, 0, 0, 0]) <{{C}} + (p01 ^ 3 +> (p01 ^ (k * 2 + 1) +> ([1] +> (Frame bs +> (p11 +> default)))))) := by + rw [show (default : ListBlank (Fin 2)) <+ [0, 0, 0, 0, 0, 0] = default by simp] + rw [show k * 2 + 4 = 3 + (k * 2 + 1) by omega, right_pow_add p01 3 (k * 2 + 1)] + have h_rhs : ((default <+ [1, 1, 0, 0, 0, 1, 0, 0, 0]) <{{D}} + ([1, 1, 1] +> (p01 ^ (k * 2 + 1) +> ([1] +> (Frame bs +> (p11 +> default)))))) = + ((default <+ d1 <+ U0) <{{D}} + (Frame ([true] ++ List.replicate (k * 2 + 1) false ++ [true] ++ bs ++ [true]) +> default)) := by + have h_l : (default : ListBlank (Fin 2)) <+ [1, 1, 0, 0, 0, 1, 0, 0, 0] = default <+ d1 <+ U0 := rfl + have h_r : ([1, 1, 1] : List (Fin 2)) +> (p01 ^ (k * 2 + 1) +> ([1] +> (Frame bs +> (p11 +> default)))) = + Frame ([true] ++ List.replicate (k * 2 + 1) false ++ [true] ++ bs ++ [true]) +> default := by + simp only [List.append_assoc, Frame_app, Frame_zeros, listblank_append_assoc] + have h_f1 : Frame [true] = [1, 1] := rfl + rw [h_f1] + change ([1, 1] : List (Fin 2)) +> ([1] +> (p01 ^ (k * 2 + 1) +> ([1] +> (Frame bs +> (p11 +> default))))) = + ([1, 1] : List (Fin 2)) +> (p10 ^ (k * 2 + 1) +> ([1] +> ([1] +> (Frame bs +> (p11 +> default))))) + rw [one_zero_pow_shift] + rw [h_l, h_r] + rw [h_lhs, ← h_rhs] + exact Reentry0 default _ + +theorem Reentry1Frames (k : Nat) (bs : List Bool) : + ((default <+ [1]) <{{C}} + (p01 ^ (k * 2 + 4) +> ([1] +> (Frame bs +> (p11 +> default))))) [target_tm]⊢⁺ + ((default <+ U1) <{{D}} + (Frame ([true] ++ List.replicate (k * 2 + 2) false ++ [true] ++ bs ++ [true]) +> default)) := by + have h_lhs : ((default <+ [1]) <{{C}} + (p01 ^ (k * 2 + 4) +> ([1] +> (Frame bs +> (p11 +> default))))) = + ((default <+ [1, 0, 0, 0]) <{{C}} + (p01 ^ 2 +> (p01 ^ (k * 2 + 2) +> ([1] +> (Frame bs +> (p11 +> default)))))) := by + rw [show (default : ListBlank (Fin 2)) <+ [1, 0, 0, 0] = default <+ [1] by simp] + rw [show k * 2 + 4 = 2 + (k * 2 + 2) by omega, right_pow_add p01 2 (k * 2 + 2)] + have h_rhs : ((default <+ U1) <{{D}} + ([1, 1, 1] +> (p01 ^ (k * 2 + 2) +> ([1] +> (Frame bs +> (p11 +> default)))))) = + ((default <+ U1) <{{D}} + (Frame ([true] ++ List.replicate (k * 2 + 2) false ++ [true] ++ bs ++ [true]) +> default)) := by + have h_r : ([1, 1, 1] : List (Fin 2)) +> (p01 ^ (k * 2 + 2) +> ([1] +> (Frame bs +> (p11 +> default)))) = + Frame ([true] ++ List.replicate (k * 2 + 2) false ++ [true] ++ bs ++ [true]) +> default := by + simp only [List.append_assoc, Frame_app, Frame_zeros, listblank_append_assoc] + have h_f1 : Frame [true] = [1, 1] := rfl + rw [h_f1] + change ([1, 1] : List (Fin 2)) +> ([1] +> (p01 ^ (k * 2 + 2) +> ([1] +> (Frame bs +> (p11 +> default))))) = + ([1, 1] : List (Fin 2)) +> (p10 ^ (k * 2 + 2) +> ([1] +> ([1] +> (Frame bs +> (p11 +> default))))) + rw [one_zero_pow_shift] + rw [h_r] + rw [h_lhs, ← h_rhs] + exact Reentry1 default _ + +-- ============================================================================ +-- Section 6: Cycle Closure & Non-Halting (TM6Cycle / TM6Target / TM6Outer) +-- ============================================================================ + +theorem sparse_RC (w : List Bool) : RC (evalue w) (default <+ sparse w) := by + induction w with + | nil => exact RC.zero + | cons b w ih => + cases b + · change RC (0 + evalue w * 4) (default <+ sparse w <+ d0) + rw [show 0 + evalue w * 4 = 4 * evalue w by omega] + exact RC.d0 (evalue w) (default <+ sparse w) ih + · change RC (1 + evalue w * 4) (default <+ sparse w <+ d1) + rw [show 1 + evalue w * 4 = 1 + 4 * evalue w by omega] + exact RC.d1 (evalue w) (default <+ sparse w) ih + +theorem doubled_RC (w : List Bool) : RC (evalue w * 2) (default <+ doubled w) := by + induction w with + | nil => exact RC.zero + | cons b w ih => + cases b + · change RC ((0 + evalue w * 4) * 2) (default <+ doubled w <+ d0) + rw [show (0 + evalue w * 4) * 2 = 4 * (evalue w * 2) by omega] + exact RC.d0 (evalue w * 2) (default <+ doubled w) ih + · change RC ((1 + evalue w * 4) * 2) (default <+ doubled w <+ d2) + rw [show (1 + evalue w * 4) * 2 = 2 + 4 * (evalue w * 2) by omega] + exact RC.d2 (evalue w * 2) (default <+ doubled w) ih + +theorem sparse_FC (w : List Bool) (tail : ListBlank (Fin 2)) : + FC tail w.length (evalue w) (tail <+ [0, 0, 0] <+ sparse w) := by + induction w with + | nil => exact FC.t0 + | cons b w ih => + cases b + · change FC tail (w.length + 1) (0 + evalue w * 4) (tail <+ [0, 0, 0] <+ sparse w <+ d0) + rw [show 0 + evalue w * 4 = 4 * evalue w by omega] + exact FC.d0 w.length (evalue w) (tail <+ [0, 0, 0] <+ sparse w) ih + · change FC tail (w.length + 1) (1 + evalue w * 4) (tail <+ [0, 0, 0] <+ sparse w <+ d1) + rw [show 1 + evalue w * 4 = 1 + 4 * evalue w by omega] + exact FC.d1 w.length (evalue w) (tail <+ [0, 0, 0] <+ sparse w) ih + +theorem FC_last (k : Nat) (tail : ListBlank (Fin 2)) : + FC tail k (4 ^ (k + 1) - 1) (tail <+ [1, 1, 0] <+ d3 ^ k) := by + induction k with + | zero => exact FC.t3 + | succ k ih => + rw [left_pow_succ (tail <+ [1, 1, 0]) d3 k] + have hpow : 4 ^ (k + 1 + 1) - 1 = 3 + 4 * (4 ^ (k + 1) - 1) := by + rw [Nat.pow_succ (4 : Nat) (k + 1)] + have := Nat.one_le_pow (k + 1) 4 (by omega) + omega + rw [hpow] + exact FC.d3 k (4 ^ (k + 1) - 1) (tail <+ [1, 1, 0] <+ d3 ^ k) ih + +theorem FNC_last (k : Nat) (tail : ListBlank (Fin 2)) : + FNC tail k (2 * 4 ^ (k + 1) - 1) (tail <+ [1, 1, 0] <+ d3 ^ k <+ U1) := by + have hpow : 2 * 4 ^ (k + 1) - 1 = 1 + 2 * (4 ^ (k + 1) - 1) := by + have := Nat.one_le_pow (k + 1) 4 (by omega) + omega + rw [hpow] + exact FNC.u1 (4 ^ (k + 1) - 1) (tail <+ [1, 1, 0] <+ d3 ^ k) (FC_last k tail) + +theorem FirstExit {n k v : Nat} {bs : List Bool} {l x r : ListBlank (Fin 2)} + (hx : FNC (l <+ [1]) k v x) (hlen : bs.length = n) + (hval : v + fvalue bs + 1 = 2 * 4 ^ (k + 1)) : + ((x <+ p11 ^ n) <{{D}} r) [target_tm]⊢⁺ + (l <{{C}} (p01 ^ (k * 2 + 4) +> ([1] +> (Frame bs +> r)))) := by + have hdesc := Descend n x r + have hlen_z : (List.replicate n false).length = bs.length := by simp [hlen] + have hval_z : fvalue (List.replicate n false) + fvalue bs = fvalue bs := by + rw [fvalue_zeros, Nat.zero_add] + have htarget : FNC (l <+ [1]) k (v + fvalue bs) (l <+ [1] <+ [1, 1, 0] <+ d3 ^ k <+ U1) := by + rw [show v + fvalue bs = 2 * 4 ^ (k + 1) - 1 by omega] + exact FNC_last k (l <+ [1]) + have hadds := FiniteAdds (fvalue bs) hx htarget (by omega) + have hwalk := FrameWalkCalls (fvalue bs) hlen_z hval_z hadds r + have hovf := TerminalOverflow l (Frame bs +> r) k + have h_eq : l <+ [1] <+ [1, 1, 0] = l <+ [1, 1, 0, 1] := rfl + rw [h_eq] at hwalk + exact stepStar_stepPlus_trans (stepStar_trans hdesc hwalk) hovf + +theorem E_exit (b : Bool) (w : List Bool) : + (E_cfg b w) [target_tm]⊢⁺ + ((default <+ one_tok ^ (bnat b)) <{{C}} + (p01 ^ (w.length * 2 + 4) +> + ([1] +> (Frame (exit_bits b w) +> (p11 +> default))))) := by + unfold E_cfg + rw [show 1 + bnat b = bnat b + 1 by omega, left_pow_succ default one_tok (bnat b)] + refine FirstExit ?_ (exit_bits_length b w) (exit_bits_value b w) + exact FNC.u0 (evalue w) _ (sparse_FC w (default <+ one_tok ^ (bnat b) <+ one_tok)) + +def reentry_left (b : Bool) : ListBlank (Fin 2) := + if b then default <+ U1 else default <+ d1 <+ U0 + +theorem reentry_normal (b : Bool) : NC (2 - bnat b) (reentry_left b) := by + cases b <;> unfold reentry_left bnat + · change NC (2 * (1 + 4 * 0)) (default <+ d1 <+ U0) + exact NC.u0 1 (default <+ d1) (RC.d1 0 default RC.zero) + · change NC (1 + 2 * 0) (default <+ U1) + exact NC.u1 0 default RC.zero + +theorem E_reentry (b : Bool) (w : List Bool) : + (E_cfg b w) [target_tm]⊢⁺ + ((reentry_left b) <{{D}} (Frame (reentry_bits b w) +> default)) := by + refine stepPlus_trans (E_exit b w) ?_ + cases b <;> unfold reentry_left reentry_bits reentry_radius bnat + · exact Reentry0Frames w.length (exit_bits false w) + · exact Reentry1Frames w.length (exit_bits true w) + +theorem E_drain (b : Bool) (w : List Bool) : + ∃ l, NC ((2 - bnat b) + (drain_q b w + 1)) l ∧ + (E_cfg b w) [target_tm]⊢⁺ + ((l <+ p11 ^ (w.length * 4 + 7 + bnat b * 2)) {{B}}> default) := by + rcases NormalAdds_ex (drain_q b w + 1) (reentry_normal b) with ⟨l, hnc, hps⟩ + refine ⟨l, hnc, stepPlus_trans (E_reentry b w) ?_⟩ + rw [← reentry_bits_length b w] + exact Drain (drain_q b w) (reentry_bits b w) (reentry_left b) l default (drain_budget b w) hps + +theorem sparse_with_tail_RC (t : List Bool) {n : Nat} {l : ListBlank (Fin 2)} (hl : RC n l) : + RC (evalue t + n * 4 ^ t.length) (l <+ sparse t) := by + induction t with + | nil => + simp only [evalue, sparse, List.length_nil, Nat.pow_zero, Nat.mul_one, Nat.zero_add, + listblank_append_nil] + exact hl + | cons b t ih => + cases b + · change RC ((0 + evalue t * 4) + n * (4 ^ t.length * 4)) (l <+ sparse t <+ d0) + rw [show (0 + evalue t * 4) + n * (4 ^ t.length * 4) = 4 * (evalue t + n * 4 ^ t.length) by ring] + exact RC.d0 _ _ ih + · change RC ((1 + evalue t * 4) + n * (4 ^ t.length * 4)) (l <+ sparse t <+ d1) + rw [show (1 + evalue t * 4) + n * (4 ^ t.length * 4) = 1 + 4 * (evalue t + n * 4 ^ t.length) by ring] + exact RC.d1 _ _ ih + +theorem doubled_with_tail_RC (t : List Bool) {n : Nat} {l : ListBlank (Fin 2)} (hl : RC n l) : + RC (2 * evalue t + n * 4 ^ t.length) (l <+ doubled t) := by + induction t with + | nil => + change RC (2 * 0 + n * 1) l + rw [show 2 * 0 + n * 1 = n by omega] + exact hl + | cons b t ih => + cases b + · change RC (2 * (0 + evalue t * 4) + n * (4 ^ t.length * 4)) (l <+ doubled t <+ d0) + rw [show 2 * (0 + evalue t * 4) + n * (4 ^ t.length * 4) = 4 * (2 * evalue t + n * 4 ^ t.length) by ring] + exact RC.d0 _ _ ih + · change RC (2 * (1 + evalue t * 4) + n * (4 ^ t.length * 4)) (l <+ doubled t <+ d2) + rw [show 2 * (1 + evalue t * 4) + n * (4 ^ t.length * 4) = 2 + 4 * (2 * evalue t + n * 4 ^ t.length) by ring] + exact RC.d2 _ _ ih + +def core (b : Bool) (w : List Bool) : List Bool := + List.replicate (w.length + bnat b) false ++ [true] ++ w + +theorem core_length (b : Bool) (w : List Bool) : + (core b w).length = w.length * 2 + 1 + bnat b := by + simp only [core, List.length_append, List.length_replicate, List.length_cons, List.length_nil] + omega + +theorem next_word_core (b : Bool) (w : List Bool) : + next_word b w = core b w ++ [false] := by + simp [next_word, core, List.append_assoc] + +theorem core_value (b : Bool) (w : List Bool) : + evalue (core b w) = (4 * evalue w + 1) * 4 ^ (w.length + bnat b) := by + have hb1 : bnat true = 1 := rfl + simp only [core, List.append_assoc, evalue_app, evalue_zeroes, List.length_replicate, + evalue, hb1, List.length_cons, List.length_nil, Nat.pow_succ, Nat.pow_zero] + ring + +theorem drain_joint_value (b : Bool) (w : List Bool) : + (2 - bnat b) + (drain_q b w + 1) = + drain_A b w * 2 ^ (reentry_radius b w + 1) + 1 - bnat b := by + have ha : 1 ≤ drain_A b w := by unfold drain_A; omega + have hr : 2 ≤ 2 ^ (reentry_radius b w + 1) := by + rw [Nat.pow_succ]; have := Nat.one_le_pow (reentry_radius b w) 2 (by omega); omega + have hprod : 2 ≤ drain_A b w * 2 ^ (reentry_radius b w + 1) := by nlinarith + unfold drain_q + cases b + · change (2 - 0) + (drain_A false w * 2 ^ (reentry_radius false w + 1) - 2 + 1) = + drain_A false w * 2 ^ (reentry_radius false w + 1) + 1 - 0 + omega + · change (2 - 1) + (drain_A true w * 2 ^ (reentry_radius true w + 1) - 2 + 1) = + drain_A true w * 2 ^ (reentry_radius true w + 1) + 1 - 1 + omega + +theorem drain_core_value (b : Bool) (w : List Bool) : + (2 - bnat b) + (drain_q b w + 1) = + if b then 2 * (evalue (core b w) + 4 ^ ((core b w).length + 1)) + else 1 + 4 * evalue (core b w) := by + rw [drain_joint_value] + cases b + · rw [core_value, drain_A, reentry_radius] + change (4 * evalue w + 1 + 0 * 4 ^ (w.length + 2)) * 2 ^ (w.length * 2 + 1 + 0 + 1) + 1 = + 1 + 4 * ((4 * evalue w + 1) * 4 ^ (w.length + 0)) + rw [show w.length * 2 + 1 + 0 + 1 = (w.length + 1) * 2 by omega, pow2_twice, + Nat.add_zero, Nat.pow_succ] + ring + · rw [core_value, core_length, drain_A, reentry_radius] + change (4 * evalue w + 1 + 1 * 4 ^ (w.length + 2)) * 2 ^ (w.length * 2 + 1 + 1 + 1) = + 2 * ((4 * evalue w + 1) * 4 ^ (w.length + 1) + 4 ^ (w.length * 2 + 1 + 1 + 1)) + have hp2 : 2 ^ (w.length * 2 + 1 + 1 + 1) = 2 * 4 ^ (w.length + 1) := by + rw [show w.length * 2 + 1 + 1 + 1 = (w.length + 1) * 2 + 1 by omega, Nat.pow_succ, pow2_twice] + ring + have hp4 : 4 ^ (w.length * 2 + 1 + 1 + 1) = 4 ^ (w.length + 2) * 4 ^ (w.length + 1) := by + rw [show w.length * 2 + 1 + 1 + 1 = (w.length + 2) + (w.length + 1) by omega, Nat.pow_add] + rw [hp2, hp4] + ring + +def outer_left (b : Bool) (t : List Bool) : ListBlank (Fin 2) := + if b then default <+ d1 <+ d0 <+ sparse t <+ U0 + else default <+ doubled t <+ U1 + +theorem outer_left_false_NC (t : List Bool) : + NC (1 + 4 * evalue t) (outer_left false t) := by + unfold outer_left + rw [show 1 + 4 * evalue t = 1 + 2 * (evalue t * 2) by ring] + exact NC.u1 (evalue t * 2) (default <+ doubled t) (doubled_RC t) + +theorem outer_left_true_NC (t : List Bool) : + NC (2 * (evalue t + 4 ^ (t.length + 1))) (outer_left true t) := by + unfold outer_left + have hr4 : RC 4 (default <+ d1 <+ d0) := RC.d0 1 (default <+ d1) (RC.d1 0 default RC.zero) + have hst := sparse_with_tail_RC t hr4 + rw [show 2 * (evalue t + 4 ^ (t.length + 1)) = 2 * (evalue t + 4 * 4 ^ t.length) by + rw [Nat.pow_succ]; ring] + exact NC.u0 (evalue t + 4 * 4 ^ t.length) _ hst + +theorem drain_target_NC (b : Bool) (w : List Bool) : + NC ((2 - bnat b) + (drain_q b w + 1)) (outer_left b (core b w)) := by + rw [drain_core_value] + cases b + · exact outer_left_false_NC (core false w) + · exact outer_left_true_NC (core true w) + +theorem Batch (n v : Nat) (l l' r : ListBlank (Fin 2)) + (hl : NC v l) (hl' : NC (v + 2 ^ n) l') : + ((l <+ p11 ^ n) <{{D}} r) [target_tm]⊢⁺ + ((l' <+ p11 ^ n) {{B}}> r) := by + have hadds : sidePs (1 * 2 ^ n) l l' := by + rw [Nat.one_mul] + exact NormalAdds (2 ^ n) hl hl' + have hmul := Multiplier n 1 hadds + rcases hmul with ⟨lm, hp, rfl⟩ + exact hp r + +theorem Shift (t : List Bool) (l : ListBlank (Fin 2)) : + l <+ [0] <+ doubled t = l <+ sparse t <+ [0] := by + rw [← listblank_append_assoc, ← sparse_shift, listblank_append_assoc] + +theorem Blank0 (n : Nat) (t : List Bool) (l : ListBlank (Fin 2)) : + ((l <+ sparse t <+ U0 <+ p11 ^ (n + 1)) {{B}}> default) [target_tm]⊢⁺ + ((l <+ [0] <+ doubled t <+ U1 <+ p11 ^ n) <{{D}} (p11 +> default)) := by + have h_eq : l <+ sparse t <+ U0 <+ p11 ^ (n + 1) = + l <+ [0] <+ doubled t <+ U1 <+ p11 ^ n <+ [1] := by + rw [Shift, left_pow_succ_right _ p11 n] + have h_u : l <+ sparse t <+ U0 <+ p11 = l <+ sparse t <+ [0] <+ U1 <+ [1] := rfl + rw [h_u, one_one_pow_shift] + have h_step := Restart0 (l <+ [0] <+ doubled t <+ U1 <+ p11 ^ n) default + rw [show ([0] : List (Fin 2)) +> (default : ListBlank (Fin 2)) = default by simp] at h_step + rwa [h_eq] + +theorem Blank1 (n : Nat) (t : List Bool) (l : ListBlank (Fin 2)) : + ((l <+ [0] <+ doubled t <+ U1 <+ p11 ^ (n + 1)) {{B}}> default) [target_tm]⊢⁺ + ((l <+ sparse t <+ U0 <+ p11 ^ (n + 1)) <{{D}} (p11 +> default)) := by + have h_eq : l <+ [0] <+ doubled t <+ U1 <+ p11 ^ (n + 1) = + l <+ sparse t <+ U0 <+ p11 ^ (n + 1) <+ [1] := by + rw [Shift] + have h_u : l <+ sparse t <+ [0] <+ U1 = l <+ sparse t <+ U0 <+ [1] := rfl + rw [h_u, one_one_pow_shift] + have h_step := Restart0 (l <+ sparse t <+ U0 <+ p11 ^ (n + 1)) default + rw [show ([0] : List (Fin 2)) +> (default : ListBlank (Fin 2)) = default by simp] at h_step + rwa [h_eq] + +theorem Boundary0 (n : Nat) (t : List Bool) (l : ListBlank (Fin 2)) : + ((l <+ sparse t <+ U0 <+ p11 ^ n) {{B}}> (p11 +> default)) [target_tm]⊢⁺ + ((l <+ [0] <+ doubled t <+ U1 <+ p11 ^ n) <{{D}} (p11 +> default)) := by + have h_eq : l <+ sparse t <+ U0 <+ p11 ^ n <+ [1] = + l <+ [0] <+ doubled t <+ U1 <+ p11 ^ n := by + rw [Shift, one_one_pow_shift] + rfl + have h_r : p11 +> (default : ListBlank (Fin 2)) = [1, 1, 0] +> default := by simp [p11] + rw [← h_eq] + have h_step := Restart11 (l <+ sparse t <+ U0 <+ p11 ^ n) default + rwa [← h_r] at h_step + +theorem Boundary1 (n : Nat) (t : List Bool) (l : ListBlank (Fin 2)) : + ((l <+ [0] <+ doubled t <+ U1 <+ p11 ^ n) {{B}}> (p11 +> default)) [target_tm]⊢⁺ + ((l <+ sparse t <+ U0 <+ p11 ^ (n + 1)) <{{D}} (p11 +> default)) := by + have h_eq : l <+ [0] <+ doubled t <+ U1 <+ p11 ^ n <+ [1] = + l <+ sparse t <+ U0 <+ p11 ^ (n + 1) := by + rw [Shift, one_one_pow_shift, left_pow_succ_right _ p11 n] + rfl + have h_r : p11 +> (default : ListBlank (Fin 2)) = [1, 1, 0] +> default := by simp [p11] + rw [← h_eq] + have h_step := Restart11 (l <+ [0] <+ doubled t <+ U1 <+ p11 ^ n) default + rwa [← h_r] at h_step + +theorem pow_batch4 (n : Nat) : 2 ^ (n * 2 + 4) = 16 * 4 ^ n := by + rw [Nat.pow_add, pow2_twice]; ring + +theorem pow_batch5 (n : Nat) : 2 ^ (n * 2 + 5) = 32 * 4 ^ n := by + rw [Nat.pow_add, pow2_twice]; ring + +theorem Outer0 (t : List Bool) : + ((default <+ doubled t <+ U1 <+ p11 ^ (t.length * 2 + 5)) {{B}}> default) [target_tm]⊢⁺ + E_cfg true (t ++ [false]) := by + have h1 : ((default <+ doubled t <+ U1 <+ p11 ^ (t.length * 2 + 5)) {{B}}> default) [target_tm]⊢⁺ + ((default <+ sparse t <+ U0 <+ p11 ^ (t.length * 2 + 5)) <{{D}} (p11 +> default)) := by + have h1' := Blank1 (t.length * 2 + 4) t default + rwa [show (default : ListBlank (Fin 2)) <+ [0] = default by simp, + show t.length * 2 + 4 + 1 = t.length * 2 + 5 by omega] at h1' + have h2 : ((default <+ sparse t <+ U0 <+ p11 ^ (t.length * 2 + 5)) <{{D}} (p11 +> default)) [target_tm]⊢⁺ + ((default <+ d1 <+ d0 <+ d0 <+ sparse t <+ U0 <+ p11 ^ (t.length * 2 + 5)) {{B}}> (p11 +> default)) := by + refine Batch (t.length * 2 + 5) (2 * evalue t) _ _ (p11 +> default) + (NC.u0 (evalue t) (default <+ sparse t) (sparse_RC t)) ?_ + have hrc16 : RC 16 (default <+ d1 <+ d0 <+ d0) := + RC.d0 4 (default <+ d1 <+ d0) (RC.d0 1 (default <+ d1) (RC.d1 0 default RC.zero)) + have hst := sparse_with_tail_RC t hrc16 + rw [pow_batch5, show 2 * evalue t + 32 * 4 ^ t.length = 2 * (evalue t + 16 * 4 ^ t.length) by ring] + exact NC.u0 _ _ hst + have h3 : ((default <+ d1 <+ d0 <+ d0 <+ sparse t <+ U0 <+ p11 ^ (t.length * 2 + 5)) {{B}}> (p11 +> default)) [target_tm]⊢⁺ + ((default <+ d2 <+ d0 <+ d0 <+ doubled t <+ U1 <+ p11 ^ (t.length * 2 + 5)) <{{D}} (p11 +> default)) := by + have h3' := Boundary0 (t.length * 2 + 5) (t ++ [false, false, true]) default + have h_sp : sparse (t ++ [false, false, true]) = sparse t ++ (d0 ++ d0 ++ d1) := by + rw [sparse_app]; rfl + have h_db : doubled (t ++ [false, false, true]) = doubled t ++ (d0 ++ d0 ++ d2) := by + rw [doubled_app]; rfl + rw [h_sp, h_db] at h3' + simp only [listblank_append_assoc] at h3' + have h_l1 : (default : ListBlank (Fin 2)) <+ d1 <+ d0 <+ d0 = default <+ d1 <+ d0 <+ d0 := rfl + have h_l2 : (default : ListBlank (Fin 2)) <+ [0] <+ d2 <+ d0 <+ d0 = default <+ d2 <+ d0 <+ d0 := by + simp [d0, d2] + rwa [h_l2] at h3' + have h4 : ((default <+ d2 <+ d0 <+ d0 <+ doubled t <+ U1 <+ p11 ^ (t.length * 2 + 5)) <{{D}} (p11 +> default)) [target_tm]⊢⁺ + ((default <+ d3 <+ d0 <+ d0 <+ doubled t <+ U1 <+ p11 ^ (t.length * 2 + 5)) {{B}}> (p11 +> default)) := by + have hrc32 : RC 32 (default <+ d2 <+ d0 <+ d0) := + RC.d0 8 (default <+ d2 <+ d0) (RC.d0 2 (default <+ d2) (RC.d2 0 default RC.zero)) + have hrc48 : RC 48 (default <+ d3 <+ d0 <+ d0) := + RC.d0 12 (default <+ d3 <+ d0) (RC.d0 3 (default <+ d3) (RC.d3 0 default RC.zero)) + refine Batch (t.length * 2 + 5) (1 + 2 * (2 * evalue t + 32 * 4 ^ t.length)) _ _ (p11 +> default) + (NC.u1 _ _ (doubled_with_tail_RC t hrc32)) ?_ + rw [pow_batch5, show 1 + 2 * (2 * evalue t + 32 * 4 ^ t.length) + 32 * 4 ^ t.length = + 1 + 2 * (2 * evalue t + 48 * 4 ^ t.length) by ring] + exact NC.u1 _ _ (doubled_with_tail_RC t hrc48) + have h5 : ((default <+ d3 <+ d0 <+ d0 <+ doubled t <+ U1 <+ p11 ^ (t.length * 2 + 5)) {{B}}> (p11 +> default)) [target_tm]⊢⁺ + E_cfg true (t ++ [false]) := by + have h5' := Boundary1 (t.length * 2 + 5) (t ++ [false]) (default <+ [1, 1] <+ [0, 0, 0]) + have h_db : doubled (t ++ [false]) = doubled t ++ d0 := by rw [doubled_app]; rfl + rw [h_db] at h5' + simp only [listblank_append_assoc] at h5' + have h_l1 : (default : ListBlank (Fin 2)) <+ [1, 1] <+ [0, 0, 0] <+ [0] <+ d0 = + default <+ d3 <+ d0 <+ d0 := by simp [d0, d3] + have h_rhs : ((default <+ [1, 1] <+ [0, 0, 0] <+ sparse (t ++ [false]) <+ U0 <+ + p11 ^ (t.length * 2 + 5 + 1)) <{{D}} (p11 +> default)) = + E_cfg true (t ++ [false]) := by + unfold E_cfg + have h_b : bnat true = 1 := rfl + have h_len : (t ++ [false]).length = t.length + 1 := by simp + rw [h_b, h_len, show (t.length + 1) * 2 + 3 + 1 = t.length * 2 + 5 + 1 by omega] + rfl + rwa [h_l1, h_rhs] at h5' + exact stepPlus_trans h1 (stepPlus_trans h2 (stepPlus_trans h3 (stepPlus_trans h4 h5))) + +theorem Outer1 (t : List Bool) : + ((default <+ d1 <+ d0 <+ sparse t <+ U0 <+ p11 ^ (t.length * 2 + 5)) {{B}}> default) [target_tm]⊢⁺ + E_cfg false (t ++ [false]) := by + have h1 : ((default <+ d1 <+ d0 <+ sparse t <+ U0 <+ p11 ^ (t.length * 2 + 5)) {{B}}> default) [target_tm]⊢⁺ + ((default <+ d1 <+ d0 <+ [0] <+ doubled t <+ U1 <+ p11 ^ (t.length * 2 + 4)) <{{D}} (p11 +> default)) := by + have h1' := Blank0 (t.length * 2 + 4) t (default <+ d1 <+ d0) + rwa [show t.length * 2 + 4 + 1 = t.length * 2 + 5 by omega] at h1' + have h2 : ((default <+ d1 <+ d0 <+ [0] <+ doubled t <+ U1 <+ p11 ^ (t.length * 2 + 4)) <{{D}} (p11 +> default)) [target_tm]⊢⁺ + ((default <+ d1 <+ d0 <+ d0 <+ doubled t <+ U1 <+ p11 ^ (t.length * 2 + 4)) {{B}}> (p11 +> default)) := by + have h_l1 : (default : ListBlank (Fin 2)) <+ d1 <+ d0 <+ [0] = default <+ d2 <+ d0 := by + simp [d0, d1, d2] + rw [h_l1] + have hrc8 : RC 8 (default <+ d2 <+ d0) := + RC.d0 2 (default <+ d2) (RC.d2 0 default RC.zero) + have hrc16 : RC 16 (default <+ d1 <+ d0 <+ d0) := + RC.d0 4 (default <+ d1 <+ d0) (RC.d0 1 (default <+ d1) (RC.d1 0 default RC.zero)) + refine Batch (t.length * 2 + 4) (1 + 2 * (2 * evalue t + 8 * 4 ^ t.length)) _ _ (p11 +> default) + (NC.u1 _ _ (doubled_with_tail_RC t hrc8)) ?_ + rw [pow_batch4, show 1 + 2 * (2 * evalue t + 8 * 4 ^ t.length) + 16 * 4 ^ t.length = + 1 + 2 * (2 * evalue t + 16 * 4 ^ t.length) by ring] + exact NC.u1 _ _ (doubled_with_tail_RC t hrc16) + have h3 : ((default <+ d1 <+ d0 <+ d0 <+ doubled t <+ U1 <+ p11 ^ (t.length * 2 + 4)) {{B}}> (p11 +> default)) [target_tm]⊢⁺ + E_cfg false (t ++ [false]) := by + have h3' := Boundary1 (t.length * 2 + 4) (t ++ [false]) (default <+ [1] <+ [0, 0, 0]) + have h_db : doubled (t ++ [false]) = doubled t ++ d0 := by rw [doubled_app]; rfl + rw [h_db] at h3' + simp only [listblank_append_assoc] at h3' + have h_l1 : (default : ListBlank (Fin 2)) <+ [1] <+ [0, 0, 0] <+ [0] <+ d0 = + default <+ d1 <+ d0 <+ d0 := by simp [d0, d1] + have h_rhs : ((default <+ [1] <+ [0, 0, 0] <+ sparse (t ++ [false]) <+ U0 <+ + p11 ^ (t.length * 2 + 4 + 1)) <{{D}} (p11 +> default)) = + E_cfg false (t ++ [false]) := by + unfold E_cfg + have h_b : bnat false = 0 := rfl + have h_len : (t ++ [false]).length = t.length + 1 := by simp + rw [h_b, h_len, show (t.length + 1) * 2 + 3 + 0 = t.length * 2 + 4 + 1 by omega] + rfl + rwa [h_l1, h_rhs] at h3' + exact stepPlus_trans h1 (stepPlus_trans h2 h3) + +theorem E_outer (b : Bool) (w : List Bool) : + (E_cfg b w) [target_tm]⊢⁺ + ((outer_left b (core b w) <+ p11 ^ ((core b w).length * 2 + 5)) {{B}}> default) := by + rcases E_drain b w with ⟨l, hnc, hstep⟩ + have hl_eq : l = outer_left b (core b w) := NC_unique hnc (drain_target_NC b w) + subst hl_eq + have hexp : w.length * 4 + 7 + bnat b * 2 = (core b w).length * 2 + 5 := by + rw [core_length]; omega + rwa [hexp] at hstep + +theorem E_step (b : Bool) (w : List Bool) : + (E_cfg b w) [target_tm]⊢⁺ E_cfg (!b) (next_word b w) := by + refine stepPlus_trans (E_outer b w) ?_ + rw [next_word_core] + cases b <;> unfold outer_left + · exact Outer0 (core false w) + · exact Outer1 (core true w) + +def Allowed (c : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ b w, c = E_cfg b w + +theorem Allowed_step {c : Cfg (Fin 2) (Fin 6)} (h : Allowed c) : + ∃ c', Allowed c' ∧ c [target_tm]⊢⁺ c' := by + rcases h with ⟨b, w, rfl⟩ + exact ⟨E_cfg (!b) (next_word b w), ⟨!b, next_word b w, rfl⟩, E_step b w⟩ + +theorem multiStep_none_add {c : Cfg (Fin 2) (Fin 6)} {k : Nat} + (h : multiStep target_tm c k = none) (d : Nat) : + multiStep target_tm c (k + d) = none := by + rw [multiStep_add, h]; rfl + +theorem reach_arbitrarily_long : + ∀ m : Nat, ∃ N c, m ≤ N ∧ Allowed c ∧ multiStep target_tm (init []) N = some c + | 0 => by + rcases Entry_init with ⟨N₀, hN₀⟩ + exact ⟨N₀, _, Nat.zero_le N₀, ⟨false, [true], rfl⟩, hN₀⟩ + | m + 1 => by + rcases reach_arbitrarily_long m with ⟨N, c, _, hc, hN⟩ + rcases Allowed_step hc with ⟨c', hc', k, _, hk⟩ + exact ⟨N + k, c', by omega, hc', multiStep_trans target_tm _ _ _ N k hN hk⟩ + +end Solution + + + +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg ⟨k, hk⟩ + cases h_step : step target_tm cfg with + | some cfg' => rfl + | none => + have h_none : multiStep target_tm (init []) (k + 1) = none := by + rw [multiStep_succ', hk]; exact h_step + rcases reach_arbitrarily_long (k + 1) with ⟨N, _, h_ge, _, hN⟩ + have h_split : N = (k + 1) + (N - (k + 1)) := by omega + have h_none_N : multiStep target_tm (init []) N = none := by + rw [h_split] + exact multiStep_none_add h_none (N - (k + 1)) + rw [h_none_N] at hN + nomatch hN + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1LB_1LC1RB_1RF1LD_0LE0LC_0RCHHH_1LA0RF diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LB_1RC0LA_1LD1RF_1RB0LE_HHH1LA_1RD0RD.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LB_1RC0LA_1LD1RF_1RB0LE_HHH1LA_1RD0RD.lean new file mode 100644 index 00000000..950eb947 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LB_1RC0LA_1LD1RF_1RB0LE_HHH1LA_1RD0RD.lean @@ -0,0 +1,2129 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.Longitudinal + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1LB_1RC0LA_1LD1RF_1RB0LE_HHH1LA_1RD0RD + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +local macro "normalize" : tactic => `(tactic| ( + try simp only [ListBlank.append_cons, ListBlank.append_nil, + ListBlank.head_cons, ListBlank.tail_cons, + ListBlank.head_default, ListBlank.head_default_fin, ListBlank.tail_default, + ListBlank.cons_zero_default, ListBlank.cons_default_default, + list_pow_zero, list_pow_succ, + List.nil_append, List.cons_append, List.append_nil, + Nat.mul_zero, Nat.mul_add, Nat.mul_one])) +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LB_1RC0LA_1LD1RF_1RB0LE_HHH1LA_1RD0RD" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open BusyBeaver.Longitudinal + +local notation "Γ" => Fin 2 +local notation "Λ" => Fin 6 + +set_option linter.unusedSectionVars false +set_option maxHeartbeats 2000000 +set_option maxRecDepth 200000 + +abbrev O : Fin 2 := 0 +abbrev I : Fin 2 := 1 + +/-- State relabeling isomorphism between `TM13` and `TM12` (`D↔0, C↔1, A↔2, B↔3, F↔4, E↔5`). -/ +abbrev A : Fin 6 := 2 +abbrev B : Fin 6 := 3 +abbrev C : Fin 6 := 1 +abbrev D : Fin 6 := 0 +abbrev E : Fin 6 := 5 +abbrev F : Fin 6 := 4 + +abbrev tm : Machine (Fin 2) (Fin 6) := target_tm + +-- ============================================================================ +-- 1. Bounded Execution Helpers & Tape Words +-- ============================================================================ + +def runSteps (M : Machine (Fin 2) (Fin 6)) : + ℕ → BoundedConfig.BCfg (Fin 2) (Fin 6) → Option (BoundedConfig.BCfg (Fin 2) (Fin 6)) + | 0, x => some x + | n + 1, x => (BoundedConfig.step M x).bind (runSteps M n) + +theorem runSteps_spec (M : Machine (Fin 2) (Fin 6)) (n : ℕ) + (x x' : BoundedConfig.BCfg (Fin 2) (Fin 6)) + (h : runSteps M n x = some x') (l₀ r₀ : ListBlank (Fin 2)) : + (BoundedConfig.toCfg x l₀ r₀) [M]⊢* (BoundedConfig.toCfg x' l₀ r₀) := by + induction n generalizing x with + | zero => cases h; try exact stepStar_refl M _ + | succ n ih => + dsimp [runSteps] at h + rcases hst : BoundedConfig.step M x with _ | y <;> rw [hst] at h + · cases h + · exact stepStar_trans ⟨1, BoundedConfig.step_spec M x hst l₀ r₀⟩ (ih y h) + +theorem runSteps1_spec (M : Machine (Fin 2) (Fin 6)) (n : ℕ) + (x x' : BoundedConfig.BCfg (Fin 2) (Fin 6)) + (h : runSteps M (n + 1) x = some x') (l₀ r₀ : ListBlank (Fin 2)) : + (BoundedConfig.toCfg x l₀ r₀) [M]⊢⁺ (BoundedConfig.toCfg x' l₀ r₀) := by + dsimp [runSteps] at h + rcases hst : BoundedConfig.step M x with _ | y <;> rw [hst] at h + · cases h + · exact stepPlus_stepStar_trans ⟨1, by decide, BoundedConfig.step_spec M x hst l₀ r₀⟩ + (runSteps_spec M n y x' h l₀ r₀) + +theorem SegRLs.congr + {ls₁ ls₁' ls₂ ls₂' : List (DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6))} + {w₁ w₁' w₂ w₂' : List (Fin 2)} + (h : SegRLs tm ls₁ ls₂ w₁ w₂) + (hls₁ : ls₁ = ls₁') (hls₂ : ls₂ = ls₂') (hw₁ : w₁ = w₁') (hw₂ : w₂ = w₂') : + SegRLs tm ls₁' ls₂' w₁' w₂' := by + subst hls₁ hls₂ hw₁ hw₂; exact h + +theorem SegRLs.trans_eq + {ls₁ ls₂ ls₃ ls₄ : List (DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6))} + {w₁ w₂ w₂' w₃ : List (Fin 2)} + (h₁ : SegRLs tm ls₁ ls₂ w₁ w₂) (h₂ : SegRLs tm ls₃ ls₄ w₂' w₃) + (hw : w₂ = w₂') : + SegRLs tm (ls₁ ++ ls₃) (ls₂ ++ ls₄) w₁ w₃ := by + subst hw; exact h₁.trans h₂ + +theorem SideRLs.congr + {ls ls' : List (DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6))} + {r₁ r₁' r₂ r₂' : ListBlank (Fin 2)} + (h : SideRLs tm ls r₁ r₂) (hls : ls = ls') (hr₁ : r₁ = r₁') (hr₂ : r₂ = r₂') : + SideRLs tm ls' r₁' r₂' := by + subst hls hr₁ hr₂; exact h + +theorem stepStar_congr {c₁ c₁' c₂ c₂' : Cfg (Fin 2) (Fin 6)} + (h : c₁ [tm]⊢* c₂) (hc₁ : c₁ = c₁') (hc₂ : c₂ = c₂') : + c₁' [tm]⊢* c₂' := by + subst hc₁ hc₂; exact h + +theorem stepPlus_congr {c₁ c₁' c₂ c₂' : Cfg (Fin 2) (Fin 6)} + (h : c₁ [tm]⊢⁺ c₂) (hc₁ : c₁ = c₁') (hc₂ : c₂ = c₂') : + c₁' [tm]⊢⁺ c₂' := by + subst hc₁ hc₂; exact h + +abbrev aw : List (Fin 2) := [I, O] +abbrev bw : List (Fin 2) := [O, I] +abbrev tw : List (Fin 2) := [O, I, O, I] +abbrev kw : List (Fin 2) := [I, O, I, O] +abbrev zw : List (Fin 2) := [O, I, I, O] +abbrev jw : List (Fin 2) := [O, I, O, O] +abbrev lw : List (Fin 2) := [I, O, O, I] +abbrev mw : List (Fin 2) := [O, O, O, I] +abbrev rw : List (Fin 2) := [O, O, I, O] +abbrev cw : List (Fin 2) := lw ++ rw +abbrev dw : List (Fin 2) := lw ++ mw ++ rw + +def root (q : Fin 6) (n : ℕ) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + default <{{q}} (zw ^ (1 + n) +> (tw +> r)) + +abbrev f_st : Fin 6 := C +abbrev h_st : Fin 6 := E +abbrev p_st : Fin 6 := D + +abbrev fR : DH0 (Fin 2) (Fin 6) := (f_st, [I]) +abbrev fL : DH0 (Fin 2) (Fin 6) := (f_st, [I]) +abbrev hR : DH0 (Fin 2) (Fin 6) := (h_st, [I]) +abbrev hL : DH0 (Fin 2) (Fin 6) := (f_st, [I]) +abbrev hf : List (DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6)) := [(fR, fL)] +abbrev hh : List (DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6)) := [(hR, hL)] +abbrev hg : List (DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6)) := hf ++ hh + +def P (n : ℕ) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := root p_st n r + +-- ============================================================================ +-- 2. Base Kernel Rules for TM13 +-- ============================================================================ + +theorem F_A : SegRLs tm hf [] aw [O, O] := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem F_T : SegRLs tm hf [] tw zw := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem F_11 : SegRLs tm hf [] [I, I] bw := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem H_T : SegRLs tm hh [] tw lw := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem H_Z : SegRLs tm hh [] zw kw := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem H_R : SegRLs tm hh [] rw jw := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem F_J : SegRLs tm hf hf jw tw := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem H_M : SegRLs tm hh hh mw tw := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem H_L : SegRLs tm hh hh lw zw := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem H_K : SegRLs tm hh hf kw tw := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem F_Z : SegRLs tm hf hg zw tw := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +abbrev uw : List Γ := [I, O, I, I] + +private theorem shift_C_zw_step (l r : ListBlank Γ) : + (l {{C}}> (zw +> r)) [tm]⊢* ((uw +> l) {{C}}> r) := + runSteps_spec tm 4 ⟨[], zw, C, .right⟩ ⟨uw, [], C, .right⟩ (by decide) l r + +private theorem shift_C_zw (n : ℕ) (l r : ListBlank Γ) : + (l {{C}}> (zw ^ n +> r)) [tm]⊢* ((uw ^ n +> l) {{C}}> r) := by + induction n generalizing l with + | zero => try exact stepStar_refl tm _ + | succ n ih => + rw [pow_succ_list, append_assoc] + refine stepStar_trans (shift_C_zw_step l (zw ^ n +> r)) ?_ + refine stepStar_congr (ih (uw +> l)) rfl ?_ + rw [← append_assoc, ← pow_succ_list'] + +private theorem shift_D_back_step (l r : ListBlank Γ) : + ((uw +> l) <{{D}} (bw +> r)) [tm]⊢* (l <{{D}} (bw +> (zw +> r))) := by + have h := runSteps_spec tm 10 ⟨bw, uw, D, .left⟩ ⟨bw ++ zw, [], D, .left⟩ (by decide) l r + simpa only [BoundedConfig.toCfg, append_nil, append_assoc] using h + +private theorem shift_D_back (n : ℕ) (l r : ListBlank Γ) : + ((uw ^ n +> l) <{{D}} (bw +> r)) [tm]⊢* (l <{{D}} (bw +> (zw ^ n +> r))) := by + induction n generalizing r with + | zero => try exact stepStar_refl tm _ + | succ n ih => + rw [pow_succ_list, append_assoc] + refine stepStar_trans (shift_D_back_step (uw ^ n +> l) r) ?_ + refine stepStar_congr (ih (zw +> r)) rfl ?_ + rw [← append_assoc (zw ^ n) zw r, ← pow_succ_list'] + +private theorem bounce_D_left (r : ListBlank Γ) : + (([I] +> default) <{{D}} (bw +> r)) [tm]⊢⁺ (default <{{D}} (zw +> r)) := by + have h := runSteps1_spec tm 7 ⟨bw, [I, O], D, .left⟩ ⟨zw, [], D, .left⟩ (by decide) default r + have hd : ([I, O] : List Γ) +> (default : ListBlank Γ) = [I] +> default := by + rw [show ([I, O] : List Γ) = [I] ++ [O] from rfl, append_assoc, + BoundedConfig.all0_spec (a := [O]) (by decide)] + simpa only [BoundedConfig.toCfg, append_nil, hd] using h + +private theorem P_enter (n : ℕ) (r : ListBlank Γ) : + (root D n r) [tm]⊢⁺ + (toDHCfg (fR, .right) ([I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default))) r) := by + have h1 : (root D n r) [tm]⊢⁺ (([I] +> default) {{C}}> (zw ^ (1 + n) +> (tw +> r))) := by + have h := runSteps1_spec tm 0 ⟨[], [O], D, .left⟩ ⟨[I], [], C, .right⟩ (by decide) + default (zw ^ (1 + n) +> (tw +> r)) + have hd : ([O] : List Γ) +> (default : ListBlank Γ) = default := + BoundedConfig.all0_spec (by decide) + simpa only [root, BoundedConfig.toCfg, append_nil, hd] using h + have h2 := shift_C_zw (1 + n) ([I] +> default) (tw +> r) + have h3 : ((uw ^ (1 + n) +> ([I] +> default)) {{C}}> (tw +> r)) [tm]⊢* + ((uw ^ n +> ([I] +> default)) <{{D}} (bw +> (zw +> (aw +> r)))) := by + have h' := runSteps_spec tm 17 ⟨uw, tw, C, .right⟩ ⟨bw ++ zw ++ aw, [], D, .left⟩ (by decide) + (uw ^ n +> ([I] +> default)) r + simpa only [BoundedConfig.toCfg, append_nil, append_assoc, + show (1 + n : ℕ) = n + 1 by omega, pow_succ_list] using h' + have h4 := shift_D_back n ([I] +> default) (zw +> (aw +> r)) + have h5 := bounce_D_left (zw ^ n +> (zw +> (aw +> r))) + have h5' : (default <{{D}} (zw +> (zw ^ n +> (zw +> (aw +> r))))) = + (default <{{D}} (zw ^ (2 + n) +> (aw +> r))) := by + congr 2 + rw [show (2 + n : ℕ) = (n + 1) + 1 by omega, pow_succ_list, pow_succ_list', + append_assoc, append_assoc] + have h6 : (default <{{D}} (zw ^ (2 + n) +> (aw +> r))) [tm]⊢* + (([I] +> default) {{C}}> (zw ^ (2 + n) +> (aw +> r))) := by + have h := runSteps_spec tm 1 ⟨[], [O], D, .left⟩ ⟨[I], [], C, .right⟩ (by decide) + default (zw ^ (2 + n) +> (aw +> r)) + have hd : ([O] : List Γ) +> (default : ListBlank Γ) = default := + BoundedConfig.all0_spec (by decide) + simpa only [BoundedConfig.toCfg, append_nil, hd] using h + have h7 := shift_C_zw (2 + n) ([I] +> default) (aw +> r) + have h8 : ((uw ^ (2 + n) +> ([I] +> default)) {{C}}> (aw +> r)) [tm]⊢* + (toDHCfg (fR, .right) ([I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default))) r) := by + have h := runSteps_spec tm 6 ⟨uw, aw, C, .right⟩ ⟨[I] ++ [I, I, I, I, I], [], C, .right⟩ (by decide) + (uw ^ (1 + n) +> ([I] +> default)) r + have h2n : uw ^ (2 + n) = uw ++ uw ^ (1 + n) := by + rw [show (2 + n : ℕ) = (1 + n) + 1 by omega, pow_succ_list] + simpa only [BoundedConfig.toCfg, toDHCfg, append_nil, append_assoc, h2n] using h + exact stepPlus_stepStar_trans h1 + (stepStar_trans h2 (stepStar_trans h3 (stepStar_trans h4 + (stepStar_trans (stepPlus_to_stepStar (stepPlus_congr h5 rfl h5')) + (stepStar_trans h6 (stepStar_trans h7 h8)))))) + +private theorem P_exit (n : ℕ) (s : ListBlank Γ) : + (toDHCfg (fL, .left) ([I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default))) s) [tm]⊢⁺ + (root D (1 + n) s) := by + have h1 : (toDHCfg (fL, .left) ([I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default))) s) [tm]⊢* + ((uw ^ (1 + n) +> ([I] +> default)) <{{D}} (bw +> (tw +> s))) := by + have h := runSteps_spec tm 5 ⟨[I], [I, I, I, I, I], C, .left⟩ ⟨bw ++ tw, [], D, .left⟩ + (by decide) (uw ^ (1 + n) +> ([I] +> default)) s + simpa only [BoundedConfig.toCfg, toDHCfg, append_nil, append_assoc] using h + have h2 := shift_D_back (1 + n) ([I] +> default) (tw +> s) + have h3 := bounce_D_left (zw ^ (1 + n) +> (tw +> s)) + have h3' : (default <{{D}} (zw +> (zw ^ (1 + n) +> (tw +> s)))) = root D (1 + n) s := by + unfold root + rw [show (1 + (1 + n) : ℕ) = (1 + n) + 1 by omega, pow_succ_list, append_assoc] + exact stepStar_stepPlus_trans h1 (stepStar_stepPlus_trans h2 (stepPlus_congr h3 rfl h3')) + +theorem P_step (n : ℕ) (r s : ListBlank Γ) (H : SideRLs tm hf r s) : + (P n r) [tm]⊢⁺ (P (1 + n) s) := by + unfold P + exact stepPlus_trans (P_enter n r) + (stepPlus_trans (H.elim_single ([I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default)))) + (P_exit n s)) + +private theorem shift_C_jw_step (l r : ListBlank Γ) : + (l {{C}}> (jw +> r)) [tm]⊢* (([I, I, I, I] +> l) {{C}}> r) := + runSteps_spec tm 4 ⟨[], jw, C, .right⟩ ⟨[I, I, I, I], [], C, .right⟩ (by decide) l r + +private theorem shift_C_jw (k : ℕ) (l r : ListBlank Γ) : + (l {{C}}> (jw ^ k +> r)) [tm]⊢* (([I, I, I, I] ^ k +> l) {{C}}> r) := by + induction k generalizing l with + | zero => try exact stepStar_refl tm _ + | succ k ih => + rw [pow_succ_list, append_assoc] + refine stepStar_trans (shift_C_jw_step l (jw ^ k +> r)) ?_ + refine stepStar_congr (ih ([I, I, I, I] +> l)) rfl ?_ + rw [← append_assoc, ← pow_succ_list'] + +private theorem shift_C_IIII_step (l r : ListBlank Γ) : + (([I, I, I, I] +> l) <{{C}} r) [tm]⊢* (l <{{C}} (kw +> r)) := by + have h := runSteps_spec tm 4 ⟨[], [I, I, I, I], C, .left⟩ ⟨kw, [], C, .left⟩ (by decide) l r + simpa only [BoundedConfig.toCfg, append_nil, append_assoc] using h + +private theorem shift_C_IIII (k : ℕ) (l r : ListBlank Γ) : + (([I, I, I, I] ^ k +> l) <{{C}} r) [tm]⊢* (l <{{C}} (kw ^ k +> r)) := by + induction k generalizing r with + | zero => try exact stepStar_refl tm _ + | succ k ih => + rw [pow_succ_list, append_assoc] + refine stepStar_trans (shift_C_IIII_step ([I, I, I, I] ^ k +> l) r) ?_ + refine stepStar_congr (ih (kw +> r)) rfl ?_ + rw [← append_assoc (kw ^ k) kw r, ← pow_succ_list'] + +private theorem shift_C_lw_step (l r : ListBlank Γ) : + ((uw +> l) <{{C}} ([I, O, I, O, I] +> r)) [tm]⊢* + (l <{{C}} ([I, O, I, O, I] +> (lw +> r))) := by + have h := runSteps_spec tm 12 ⟨[I, O, I, O, I], uw, C, .left⟩ + ⟨[I, O, I, O, I] ++ lw, [], C, .left⟩ (by decide) l r + simpa only [BoundedConfig.toCfg, append_nil, append_assoc] using h + +private theorem shift_C_lw (n : ℕ) (l r : ListBlank Γ) : + ((uw ^ n +> l) <{{C}} ([I, O, I, O, I] +> r)) [tm]⊢* + (l <{{C}} ([I, O, I, O, I] +> (lw ^ n +> r))) := by + induction n generalizing r with + | zero => try exact stepStar_refl tm _ + | succ n ih => + rw [pow_succ_list, append_assoc] + refine stepStar_trans (shift_C_lw_step (uw ^ n +> l) r) ?_ + refine stepStar_congr (ih (lw +> r)) rfl ?_ + rw [← append_assoc (lw ^ n) lw r, ← pow_succ_list'] + +private theorem O_kw_pow (k : ℕ) (r : ListBlank Γ) : + ([O] +> (kw ^ k +> r)) = (tw ^ k +> ([O] +> r)) := by + induction k with + | zero => rfl + | succ k ih => + rw [pow_succ_list, append_assoc, ← append_assoc [O] kw, + show ([O] ++ kw : List Γ) = tw ++ [O] from rfl, + append_assoc tw [O], ih, ← append_assoc tw (tw ^ k), ← pow_succ_list] + +private theorem OI_lw_pow (n : ℕ) (r : ListBlank Γ) : + (bw +> (lw ^ n +> r)) = (zw ^ n +> (bw +> r)) := by + induction n with + | zero => rfl + | succ n ih => + rw [pow_succ_list, append_assoc, ← append_assoc bw lw, + show (bw ++ lw : List Γ) = zw ++ bw from rfl, + append_assoc zw bw, ih, ← append_assoc zw (zw ^ n), ← pow_succ_list] + +private theorem IO_zw_pow (n : ℕ) (r : ListBlank Γ) : + (aw +> (zw ^ n +> r)) = (lw ^ n +> (aw +> r)) := by + induction n with + | zero => rfl + | succ n ih => + rw [pow_succ_list, append_assoc, ← append_assoc aw zw, + show (aw ++ zw : List Γ) = lw ++ aw from rfl, + append_assoc lw aw, ih, ← append_assoc lw (lw ^ n), ← pow_succ_list] + +theorem bw_comm_T (n : ℕ) : bw ++ tw ^ n = tw ^ n ++ bw := by + induction n with + | zero => rfl + | succ n ih => + change tw ++ (bw ++ tw ^ n) = tw ++ (tw ^ n ++ bw) + rw [ih] + +private theorem return_tail (n : ℕ) (r_tail : ListBlank Γ) : + (([O, I, I] +> ([I, I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default)))) <{{D}} + (tw +> r_tail)) [tm]⊢* + (root D 0 (tw +> (lw ^ n +> (kw +> (tw +> (aw +> r_tail)))))) := by + have h1 : (([O, I, I] +> ([I, I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default)))) <{{D}} + (tw +> r_tail)) [tm]⊢* + ((uw ^ (1 + n) +> ([I] +> default)) <{{C}} + ([I, O, I, O, I] +> ([O, I, O, I, O, I, I, O] +> r_tail))) := by + have h := runSteps_spec tm 17 ⟨tw, [O, I, I] ++ [I, I, I, I, I, I], D, .left⟩ + ⟨[I, O, I, O, I] ++ [O, I, O, I, O, I, I, O], [], C, .left⟩ (by decide) + (uw ^ (1 + n) +> ([I] +> default)) r_tail + simpa only [BoundedConfig.toCfg, append_nil, append_assoc] using h + have h2 := shift_C_lw (1 + n) ([I] +> default) ([O, I, O, I, O, I, I, O] +> r_tail) + have h2_eq : (([I] +> default) <{{C}} + ([I, O, I, O, I] +> (lw ^ (1 + n) +> ([O, I, O, I, O, I, I, O] +> r_tail)))) = + (([I] +> default) <{{C}} + ([I, O, I, O, I, I, O] +> (zw ^ n +> ([O, I, O, I, O, I, O, I, I, O] +> r_tail)))) := by + congr 1 + have h_lw : lw ^ (1 + n) +> ([O, I, O, I, O, I, I, O] +> r_tail) = + aw +> (zw ^ n +> ([O, I, O, I, O, I, O, I, I, O] +> r_tail)) := by + rw [show (1 + n : ℕ) = n + 1 by omega, pow_succ_list, append_assoc, + show (lw +> (lw ^ n +> ([O, I, O, I, O, I, I, O] +> r_tail))) = + aw +> (bw +> (lw ^ n +> ([O, I, O, I, O, I, I, O] +> r_tail))) from rfl, + OI_lw_pow] + rfl + rw [h_lw] + rfl + have h3 : (([I] +> default) <{{C}} + ([I, O, I, O, I, I, O] +> (zw ^ n +> ([O, I, O, I, O, I, O, I, I, O] +> r_tail)))) [tm]⊢* + (([I, O, I, I, I, I, I, I, I, I, I] +> default) {{C}}> + (zw ^ n +> ([O, I, O, I, O, I, O, I, I, O] +> r_tail))) := by + have h := runSteps_spec tm 32 ⟨[I, O, I, O, I, I, O], [I, O, O, O], C, .left⟩ + ⟨[I, O, I, I, I, I, I, I, I, I, I], [], C, .right⟩ (by decide) + default (zw ^ n +> ([O, I, O, I, O, I, O, I, I, O] +> r_tail)) + have hd : ([I, O, O, O] : List Γ) +> (default : ListBlank Γ) = [I] +> default := by + rw [show ([I, O, O, O] : List Γ) = [I] ++ [O, O, O] from rfl, append_assoc, + BoundedConfig.all0_spec (a := [O, O, O]) (by decide)] + simpa only [BoundedConfig.toCfg, append_nil, hd] using h + have h4 := shift_C_zw n ([I, O, I, I, I, I, I, I, I, I, I] +> default) + ([O, I, O, I, O, I, O, I, I, O] +> r_tail) + have h5 : ((uw ^ n +> ([I, O, I, I, I, I, I, I, I, I, I] +> default)) {{C}}> + ([O, I, O, I, O, I, O, I, I, O] +> r_tail)) [tm]⊢* + ((uw ^ n +> ([I, O, I, I, I, I, I, I, I, I, I] +> default)) <{{D}} + (bw +> ([I, O, O, I, O, I, I, O] +> r_tail))) := by + have h := runSteps_spec tm 7 ⟨[], [O, I, O, I, O, I], C, .right⟩ + ⟨bw ++ [I, O, O, I], [], D, .left⟩ (by decide) + (uw ^ n +> ([I, O, I, I, I, I, I, I, I, I, I] +> default)) + ([O, I, I, O] +> r_tail) + have hr1 : ([O, I, O, I, O, I] : List Γ) +> ([O, I, I, O] +> r_tail) = + [O, I, O, I, O, I, O, I, I, O] +> r_tail := by + rw [← append_assoc]; rfl + have hr2 : ([I, O, O, I] : List Γ) +> ([O, I, I, O] +> r_tail) = + [I, O, O, I, O, I, I, O] +> r_tail := by + rw [← append_assoc]; rfl + simpa only [BoundedConfig.toCfg, append_nil, append_assoc, hr1, hr2] using h + have h6 := shift_D_back n ([I, O, I, I, I, I, I, I, I, I, I] +> default) + ([I, O, O, I, O, I, I, O] +> r_tail) + have h7 : (([I, O, I, I, I, I, I, I, I, I, I] +> default) <{{D}} + (bw +> (zw ^ n +> ([I, O, O, I, O, I, I, O] +> r_tail)))) [tm]⊢* + (root D 0 (tw +> (lw ^ n +> (kw +> (tw +> (aw +> r_tail)))))) := by + have h := runSteps_spec tm 24 ⟨bw, [I, O, I, I, I, I, I, I, I, I, I, O], D, .left⟩ + ⟨zw ++ tw ++ tw ++ aw, [], D, .left⟩ (by decide) + default (zw ^ n +> ([I, O, O, I, O, I, I, O] +> r_tail)) + have hd : ([I, O, I, I, I, I, I, I, I, I, I, O] : List Γ) +> (default : ListBlank Γ) = + [I, O, I, I, I, I, I, I, I, I, I] +> default := by + rw [show ([I, O, I, I, I, I, I, I, I, I, I, O] : List Γ) = + [I, O, I, I, I, I, I, I, I, I, I] ++ [O] from rfl, + append_assoc, BoundedConfig.all0_spec (a := [O]) (by decide)] + have hr : ((zw ++ tw ++ tw ++ aw) +> + (zw ^ n +> ([I, O, O, I, O, I, I, O] +> r_tail))) = + (zw ^ (1 + 0) +> (tw +> (tw +> (lw ^ n +> (kw +> (tw +> (aw +> r_tail))))))) := by + rw [Nat.add_zero, pow_one_list, append_assoc, append_assoc, append_assoc, IO_zw_pow, + ← append_assoc aw [I, O, O, I, O, I, I, O], + show (aw ++ [I, O, O, I, O, I, I, O] : List Γ) = kw ++ tw ++ aw from rfl, + append_assoc, append_assoc] + simpa only [BoundedConfig.toCfg, root, append_nil, hd, hr] using h + exact stepStar_trans h1 (stepStar_trans (stepStar_congr h2 rfl h2_eq) + (stepStar_trans h3 (stepStar_trans h4 (stepStar_trans h5 (stepStar_trans h6 h7))))) + +theorem zero_return (n k : ℕ) (r : ListBlank Γ) : + (P n (zw +> (jw ^ (1 + k) +> ([O, O] +> r)))) [tm]⊢⁺ + (P 0 (tw +> (lw ^ n +> (kw +> (tw +> (aw +> (tw ^ k +> ([I, O, I] +> r)))))))) := by + unfold P + let l_base : ListBlank Γ := [I, I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default)) + have h1 := P_enter n (zw +> (jw ^ (1 + k) +> ([O, O] +> r))) + have h2 : (toDHCfg (fR, .right) ([I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default))) + (zw +> (jw ^ (1 + k) +> ([O, O] +> r)))) [tm]⊢* + ((uw +> l_base) {{C}}> (jw ^ (1 + k) +> ([O, O] +> r))) := + shift_C_zw_step l_base (jw ^ (1 + k) +> ([O, O] +> r)) + have h3 := shift_C_jw (1 + k) (uw +> l_base) ([O, O] +> r) + have h4 : (([I, I, I, I] ^ (1 + k) +> (uw +> l_base)) {{C}}> ([O, O] +> r)) [tm]⊢* + (([I, I, I, I] ^ k +> (uw +> l_base)) <{{C}} ([I, O, I, I, O, I] +> r)) := by + have h := runSteps_spec tm 7 ⟨[I, I, I, I], [O, O], C, .right⟩ + ⟨[I, O, I, I, O, I], [], C, .left⟩ (by decide) + ([I, I, I, I] ^ k +> (uw +> l_base)) r + simpa only [BoundedConfig.toCfg, append_nil, append_assoc, + show (1 + k : ℕ) = k + 1 by omega, pow_succ_list] using h + have h5 := shift_C_IIII k (uw +> l_base) ([I, O, I, I, O, I] +> r) + have h6 : ((uw +> l_base) <{{C}} (kw ^ k +> ([I, O, I, I, O, I] +> r))) [tm]⊢* + (([O, I, I] +> l_base) <{{D}} (tw +> (tw ^ k +> ([I, O, I] +> r)))) := by + have h := runSteps_spec tm 1 ⟨[], [I], C, .left⟩ ⟨[O], [], D, .left⟩ (by decide) + ([O, I, I] +> l_base) (kw ^ k +> ([I, O, I, I, O, I] +> r)) + have hl : ([I] : List Γ) +> ([O, I, I] +> l_base) = uw +> l_base := by + rw [← append_assoc]; rfl + have hr : ([O] +> (kw ^ k +> ([I, O, I, I, O, I] +> r))) = + (tw +> (tw ^ k +> ([I, O, I] +> r))) := by + rw [O_kw_pow, show ([O] +> ([I, O, I, I, O, I] +> r)) = tw +> ([I, O, I] +> r) from rfl, + ← append_assoc, ← pow_succ_list', pow_succ_list, append_assoc] + simpa only [BoundedConfig.toCfg, append_nil, hl, hr] using h + have h7 := return_tail n (tw ^ k +> ([I, O, I] +> r)) + exact stepPlus_stepStar_trans h1 + (stepStar_trans h2 (stepStar_trans h3 (stepStar_trans h4 + (stepStar_trans h5 (stepStar_trans h6 h7))))) + + +theorem init_raw12 : + (init []) [tm]⊢* + (P 0 (tw +> (lw ^ 12 +> (kw +> (tw +> (lw +> (zw +> ([I] +> default)))))))) := by + have h := runSteps_spec tm 3686 ⟨List.replicate 67 O, List.replicate 10 O, D, .right⟩ + ⟨zw ++ tw ++ tw ++ lw ^ 12 ++ kw ++ tw ++ lw ++ zw ++ [I], [], D, .left⟩ + (by decide) default default + have hl : List.replicate 67 O +> (default : ListBlank Γ) = default := + BoundedConfig.all0_spec (by decide) + have hr : List.replicate 10 O +> (default : ListBlank Γ) = default := + BoundedConfig.all0_spec (by decide) + refine stepStar_congr h ?_ ?_ + · simp only [BoundedConfig.toCfg, hl, hr]; rfl + · simp only [BoundedConfig.toCfg, P, root, Nat.add_zero, pow_one_list, append_nil, append_assoc] + +theorem one_return_15 (n : ℕ) : + (P n (zw +> (jw ^ 16 +> ([I] +> default)))) [tm]⊢⁺ + (P (1 + n) (tw +> (lw +> (tw ^ 15 +> default)))) := by + unfold P + have h1 := P_enter n (zw +> (jw ^ 16 +> ([I] +> default))) + have h2 : (toDHCfg (fR, .right) ([I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default))) + (zw +> (jw ^ 16 +> ([I] +> default)))) [tm]⊢* + ((uw ^ (1 + n) +> ([I] +> default)) <{{D}} + (bw +> (tw +> (tw +> (lw +> (tw ^ 15 +> default)))))) := by + have h := runSteps_spec tm 149 ⟨[I] ++ [I, I, I, I, I], zw ++ jw ^ 16 ++ [I], C, .right⟩ + ⟨bw ++ tw ++ tw ++ lw ++ tw ^ 15 ++ [O], [], D, .left⟩ + (by decide) (uw ^ (1 + n) +> ([I] +> default)) default + have hd : ([O] : List Γ) +> (default : ListBlank Γ) = default := + BoundedConfig.all0_spec (by decide) + simpa only [BoundedConfig.toCfg, toDHCfg, append_nil, append_assoc, hd] using h + have h3 := shift_D_back (1 + n) ([I] +> default) (tw +> (tw +> (lw +> (tw ^ 15 +> default)))) + have h4 := bounce_D_left (zw ^ (1 + n) +> (tw +> (tw +> (lw +> (tw ^ 15 +> default))))) + have h4' : (default <{{D}} (zw +> (zw ^ (1 + n) +> (tw +> (tw +> (lw +> (tw ^ 15 +> default))))))) = + root D (1 + n) (tw +> (lw +> (tw ^ 15 +> default))) := by + unfold root + rw [show (1 + (1 + n) : ℕ) = (1 + n) + 1 by omega, pow_succ_list zw (1 + n), append_assoc zw (zw ^ (1 + n))] + exact stepPlus_stepStar_trans h1 + (stepStar_trans h2 (stepStar_trans h3 (stepPlus_to_stepStar (stepPlus_congr h4 rfl h4')))) + +theorem ten_return_15 (n : ℕ) : + (P n (zw +> (lw +> (mw ^ 15 +> default)))) [tm]⊢⁺ + (P 0 (tw +> (lw ^ n +> (kw +> (tw ^ 17 +> ([I, O, I] +> default)))))) := by + unfold P + have h1 := P_enter n (zw +> (lw +> (mw ^ 15 +> default))) + have h2 : (toDHCfg (fR, .right) ([I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default))) + (zw +> (lw +> (mw ^ 15 +> default)))) [tm]⊢* + ((uw ^ (1 + n) +> ([I] +> default)) <{{C}} + ([I, O, I, O, I] +> ([O, I, O, I, O, I] +> (tw ^ 16 +> ([I, O, I] +> default))))) := by + have h := runSteps_spec tm 153 ⟨[I] ++ [I, I, I, I, I], zw ++ lw ++ mw ^ 15 ++ [O, O, O, O], C, .right⟩ + ⟨[I, O, I, O, I] ++ [O, I, O, I, O, I] ++ tw ^ 16 ++ [I, O, I], [], C, .left⟩ + (by decide) (uw ^ (1 + n) +> ([I] +> default)) default + have hd : ([O, O, O, O] : List Γ) +> (default : ListBlank Γ) = default := + BoundedConfig.all0_spec (by decide) + simpa only [BoundedConfig.toCfg, toDHCfg, append_nil, append_assoc, hd] using h + have h3 := shift_C_lw (1 + n) ([I] +> default) ([O, I, O, I, O, I] +> (tw ^ 16 +> ([I, O, I] +> default))) + have h3_eq : (([I] +> default) <{{C}} + ([I, O, I, O, I] +> (lw ^ (1 + n) +> ([O, I, O, I, O, I] +> (tw ^ 16 +> ([I, O, I] +> default)))))) = + (([I] +> default) <{{C}} + ([I, O, I, O, I, I, O] +> (zw ^ n +> ([O, I, O, I, O, I] +> (bw +> (tw ^ 16 +> ([I, O, I] +> default))))))) := by + congr 1 + have h_lw : lw ^ (1 + n) +> ([O, I, O, I, O, I] +> (tw ^ 16 +> ([I, O, I] +> (default : ListBlank Γ)))) = + aw +> (zw ^ n +> ([O, I, O, I, O, I] +> (bw +> (tw ^ 16 +> ([I, O, I] +> default))))) := by + rw [show (1 + n : ℕ) = n + 1 by omega, pow_succ_list lw n, append_assoc lw (lw ^ n), + show (lw +> (lw ^ n +> ([O, I, O, I, O, I] +> (tw ^ 16 +> ([I, O, I] +> (default : ListBlank Γ)))))) = + aw +> (bw +> (lw ^ n +> ([O, I, O, I, O, I] +> (tw ^ 16 +> ([I, O, I] +> default))))) from rfl, + OI_lw_pow] + rfl + rw [h_lw] + rfl + have h4 : (([I] +> default) <{{C}} + ([I, O, I, O, I, I, O] +> (zw ^ n +> ([O, I, O, I, O, I] +> (bw +> (tw ^ 16 +> ([I, O, I] +> default))))))) [tm]⊢* + (([I, O, I, I, I, I, I, I, I, I, I] +> default) {{C}}> + (zw ^ n +> ([O, I, O, I, O, I] +> (bw +> (tw ^ 16 +> ([I, O, I] +> default)))))) := by + have h := runSteps_spec tm 32 ⟨[I, O, I, O, I, I, O], [I, O, O, O], C, .left⟩ + ⟨[I, O, I, I, I, I, I, I, I, I, I], [], C, .right⟩ (by decide) + default (zw ^ n +> ([O, I, O, I, O, I] +> (bw +> (tw ^ 16 +> ([I, O, I] +> default))))) + have hd : ([I, O, O, O] : List Γ) +> (default : ListBlank Γ) = [I] +> default := by + rw [show ([I, O, O, O] : List Γ) = [I] ++ [O, O, O] from rfl, append_assoc, + BoundedConfig.all0_spec (a := [O, O, O]) (by decide)] + simpa only [BoundedConfig.toCfg, append_nil, hd] using h + have h5 := shift_C_zw n ([I, O, I, I, I, I, I, I, I, I, I] +> default) + ([O, I, O, I, O, I] +> (bw +> (tw ^ 16 +> ([I, O, I] +> default)))) + have h6 : ((uw ^ n +> ([I, O, I, I, I, I, I, I, I, I, I] +> default)) {{C}}> + ([O, I, O, I, O, I] +> (bw +> (tw ^ 16 +> ([I, O, I] +> default))))) [tm]⊢* + ((uw ^ n +> ([I, O, I, I, I, I, I, I, I, I, I] +> default)) <{{D}} + (bw +> ([I, O, O, I] +> (bw +> (tw ^ 16 +> ([I, O, I] +> default)))))) := by + have h := runSteps_spec tm 7 ⟨[], [O, I, O, I, O, I], C, .right⟩ + ⟨bw ++ [I, O, O, I], [], D, .left⟩ (by decide) + (uw ^ n +> ([I, O, I, I, I, I, I, I, I, I, I] +> default)) + (bw +> (tw ^ 16 +> ([I, O, I] +> default))) + simpa only [BoundedConfig.toCfg, append_nil, append_assoc] using h + have h7 := shift_D_back n ([I, O, I, I, I, I, I, I, I, I, I] +> default) + ([I, O, O, I] +> (bw +> (tw ^ 16 +> ([I, O, I] +> default)))) + have h8 : (([I, O, I, I, I, I, I, I, I, I, I] +> default) <{{D}} + (bw +> (zw ^ n +> ([I, O, O, I] +> (bw +> (tw ^ 16 +> ([I, O, I] +> default))))))) [tm]⊢* + (root D 0 (tw +> (lw ^ n +> (kw +> (tw ^ 17 +> ([I, O, I] +> default)))))) := by + have h := runSteps_spec tm 24 ⟨bw, [I, O, I, I, I, I, I, I, I, I, I, O], D, .left⟩ + ⟨zw ++ tw ++ tw ++ aw, [], D, .left⟩ (by decide) + default (zw ^ n +> ([I, O, O, I] +> (bw +> (tw ^ 16 +> ([I, O, I] +> default))))) + have hd : ([I, O, I, I, I, I, I, I, I, I, I, O] : List Γ) +> (default : ListBlank Γ) = + [I, O, I, I, I, I, I, I, I, I, I] +> default := by + rw [show ([I, O, I, I, I, I, I, I, I, I, I, O] : List Γ) = + [I, O, I, I, I, I, I, I, I, I, I] ++ [O] from rfl, + append_assoc, BoundedConfig.all0_spec (a := [O]) (by decide)] + have hr : ((zw ++ tw ++ tw ++ aw) +> + (zw ^ n +> ([I, O, O, I] +> (bw +> (tw ^ 16 +> ([I, O, I] +> (default : ListBlank Γ))))))) = + (zw ^ (1 + 0) +> (tw +> (tw +> (lw ^ n +> (kw +> (tw ^ 17 +> ([I, O, I] +> default))))))) := by + rw [Nat.add_zero, pow_one_list, append_assoc, append_assoc, append_assoc, IO_zw_pow, + ← append_assoc aw [I, O, O, I], + ← append_assoc (aw ++ [I, O, O, I]) bw, + show (aw ++ [I, O, O, I] ++ bw : List Γ) = kw ++ tw from rfl, + append_assoc kw tw, + show (tw +> (tw ^ 16 +> ([I, O, I] +> (default : ListBlank Γ)))) = + (tw ^ 17 +> ([I, O, I] +> default)) from rfl] + simpa only [BoundedConfig.toCfg, root, append_nil, hd, hr] using h + exact stepPlus_stepStar_trans h1 + (stepStar_trans h2 (stepStar_trans (stepStar_congr h3 rfl h3_eq) + (stepStar_trans h4 (stepStar_trans h5 (stepStar_trans h6 (stepStar_trans h7 h8)))))) + +-- ============================================================================ +-- 3. Common Service Algebra & Closed Reset Family (`SOBCv13.v:79-1183`) +-- ============================================================================ + +theorem F_K : SegRLs tm hf [] kw rw := + F_A.concat (.nil aw) + +theorem F_L : SegRLs tm hf [] lw mw := + F_A.concat (.nil bw) + +theorem G_T : SegRLs tm hg [] tw kw := + F_T.trans H_Z + +theorem G_K : SegRLs tm hg [] kw jw := + F_K.trans H_R + +theorem G_J : SegRLs tm hg hf jw lw := + SegRLs.congr (F_J.trans H_T) rfl rfl rfl rfl + +theorem G_L : SegRLs tm hg hh lw tw := + F_L.trans H_M + +theorem G_Z : SegRLs tm hg hg zw lw := + SegRLs.congr (F_Z.trans H_T) rfl rfl rfl rfl + +theorem G2_J : SegRLs tm (hg ^ 2) hg jw tw := + SegRLs.congr (G_J.trans G_L) (by rfl) rfl rfl rfl + +theorem G4_T : SegRLs tm (hg ^ 4) hg tw tw := + SegRLs.congr (G_T.trans (G_K.trans G2_J)) (by rfl) rfl rfl rfl + +theorem G4_J : SegRLs tm (hg ^ 4) hg jw jw := + SegRLs.congr (G2_J.trans (G_T.trans G_K)) (by rfl) rfl rfl rfl + +theorem F_Js (n : ℕ) : SegRLs tm hf hf (jw ^ n) (tw ^ n) := by + induction n with + | zero => exact SegRLs.empty tm hf + | succ n ih => exact F_J.concat ih + +theorem H_Ms (n : ℕ) : SegRLs tm hh hh (mw ^ n) (tw ^ n) := by + induction n with + | zero => exact SegRLs.empty tm hh + | succ n ih => exact H_M.concat ih + +theorem H_Ls (n : ℕ) : SegRLs tm hh hh (lw ^ n) (zw ^ n) := by + induction n with + | zero => exact SegRLs.empty tm hh + | succ n ih => exact H_L.concat ih + +def q4 : ℕ → ℕ + | 0 => 0 + | k + 1 => 1 + 4 * q4 k + +theorem q4_pow (n : ℕ) : 1 + 3 * q4 n = 4 ^ n := by + induction n with + | zero => rfl + | succ n ih => + dsimp [q4] + rw [Nat.pow_succ] + omega + +theorem q4_add (n m : ℕ) : q4 (n + m) = q4 n + 4 ^ n * q4 m := by + induction n with + | zero => + rw [Nat.zero_add, Nat.pow_zero, Nat.one_mul] + dsimp [q4] + omega + | succ n ih => + rw [Nat.succ_add, q4, q4, ih, Nat.pow_succ] + ring + +theorem service_repeat {hs ks : List (DH0 Γ Λ × DH0 Γ Λ)} {w : List Γ} (n : ℕ) + (H : SegRLs tm hs ks w w) : SegRLs tm (hs ^ n) (ks ^ n) w w := by + induction n with + | zero => exact .nil w + | succ n ih => exact H.trans ih + +theorem F2_T : SegRLs tm (hf ^ 2) hg tw tw := + SegRLs.congr (F_T.trans F_Z) (by rfl) rfl rfl rfl + +theorem G_recycle {w : List Γ} (n : ℕ) (H : SegRLs tm (hg ^ 4) hg w w) : + SegRLs tm (hg ^ (n * 4)) (hg ^ n) w w := by + rw [Nat.mul_comm, pow_mul_list] + exact service_repeat n H + +theorem G_lift {w : List Γ} (a n : ℕ) (H : SegRLs tm (hg ^ 4) hg w w) : + SegRLs tm (hg ^ (n * 4 ^ a)) (hg ^ n) (w ^ a) (w ^ a) := by + induction a generalizing n with + | zero => + rw [Nat.pow_zero, Nat.mul_one] + exact SegRLs.empty tm (hg ^ n) + | succ a ih => + rw [pow_succ_list, + show n * 4 ^ (a + 1) = (n * 4 ^ a) * 4 by rw [Nat.pow_succ]; ring] + exact (G_recycle (n * 4 ^ a) H).concat (ih n) + +theorem G_Ts (a n : ℕ) : SegRLs tm (hg ^ (n * 4 ^ a)) (hg ^ n) (tw ^ a) (tw ^ a) := + G_lift a n G4_T + +theorem G_Js (a n : ℕ) : SegRLs tm (hg ^ (n * 4 ^ a)) (hg ^ n) (jw ^ a) (jw ^ a) := + G_lift a n G4_J + +theorem F_T_calls (a n : ℕ) : + SegRLs tm (hf ^ (2 * n * 4 ^ a)) (hg ^ n) (tw ^ (1 + a)) (tw ^ (1 + a)) := by + have h1 : SegRLs tm (hf ^ (2 * (n * 4 ^ a))) (hg ^ (n * 4 ^ a)) tw tw := by + rw [pow_mul_list] + exact service_repeat (n * 4 ^ a) F2_T + refine SegRLs.congr (h1.concat (G_Ts a n)) ?_ rfl ?_ ?_ + · rw [show 2 * (n * 4 ^ a) = 2 * n * 4 ^ a by ring] + · rw [Nat.add_comm 1 a, pow_succ_list] + · rw [Nat.add_comm 1 a, pow_succ_list] + +theorem G2_T : SegRLs tm (hg ^ 2) [] tw jw := + SegRLs.congr (G_T.trans G_K) (by rfl) rfl rfl rfl + +theorem G_normalize (n : ℕ) : SegRLs tm (hg ^ (2 * q4 n)) [] (tw ^ n) (jw ^ n) := by + induction n with + | zero => exact .nil [] + | succ n ih => + have h1 := G2_T.concat (.nil (tw ^ n)) + have h2 := (G_recycle (2 * q4 n) G4_J).concat ih + refine SegRLs.congr (h1.trans h2) ?_ rfl rfl rfl + rw [← pow_add_list, show 2 + 2 * q4 n * 4 = 2 * q4 (n + 1) by dsimp [q4]; omega] + +theorem F_normalize (n : ℕ) : + SegRLs tm (hf ^ (q4 (1 + n))) [] (tw ^ (1 + n)) (zw ++ jw ^ n) := by + have h1 := (F_T_calls 0 (2 * q4 n)).concat (G_normalize n) + have h2 := F_T.concat (.nil (jw ^ n)) + refine SegRLs.congr (SegRLs.trans_eq h1 h2 (by rfl)) ?_ rfl ?_ rfl + · rw [← pow_succ_list'] + congr 1 + rw [Nat.add_comm 1 n] + dsimp [q4] + omega + · rw [Nat.add_comm 1 n, pow_succ_list] + rfl + +theorem F_outer (n : ℕ) : + SegRLs tm hf hh (zw ++ lw ++ mw ^ n) (tw ^ (2 + n)) := by + have h := F_Z.concat (G_L.concat (H_Ms n)) + refine SegRLs.congr h rfl rfl (by simp only [List.append_assoc]) ?_ + rw [show (2 + n : ℕ) = (n + 1) + 1 by omega, pow_succ_list, pow_succ_list] + +theorem F_postJ (n : ℕ) : + SegRLs tm hf hf (zw ++ jw ^ (1 + n)) (tw ++ lw ++ tw ^ n) := by + have h := F_Z.concat (G_J.concat (F_Js n)) + refine SegRLs.congr h rfl rfl ?_ (by simp only [List.append_assoc]) + rw [Nat.add_comm 1 n, pow_succ_list] + +theorem BIN_borrow (n : ℕ) : + SegRLs tm (hf ^ (8 + 16 * q4 n)) [] + (zw ++ lw ++ mw ^ n ++ tw) (zw ++ lw ++ tw ^ n ++ mw) := by + have h1 := (F_outer n).concat H_T + have h2 := (F_normalize (1 + n)).concat (.nil lw) + have h3 := (F_postJ n).concat F_L + have h4 := F_T.concat (.nil (lw ++ tw ^ n ++ mw)) + have h12 := SegRLs.trans_eq h1 h2 (by rw [show 2 + n = 1 + (1 + n) by omega]) + have h34 := SegRLs.trans_eq h3 h4 (by simp only [List.append_assoc]) + have hall := SegRLs.trans_eq h12 h34 (by simp only [List.append_assoc]) + refine SegRLs.congr hall ?_ rfl (by simp only [List.append_assoc]) + (by simp only [List.append_assoc]) + rw [← List.append_assoc, ← pow_succ_list, ← pow_succ_list', ← pow_succ_list'] + congr 1 + rw [show 1 + (1 + n) = (n + 1) + 1 by omega] + dsimp [q4] + omega + +theorem BIN (n : ℕ) : + SegRLs tm (hf ^ (8 * q4 n)) [] (zw ++ lw ++ tw ^ n) (zw ++ lw ++ mw ^ n) := by + induction n with + | zero => exact .nil _ + | succ n ih => + have h1 : SegRLs tm (hf ^ (8 * q4 n)) [] + (zw ++ lw ++ tw ^ n ++ tw) (zw ++ lw ++ mw ^ n ++ tw) := + ih.concat (.nil tw) + have h2 := BIN_borrow n + have h3 : SegRLs tm (hf ^ (8 * q4 n)) [] + (zw ++ lw ++ tw ^ n ++ mw) (zw ++ lw ++ mw ^ n ++ mw) := + ih.concat (.nil mw) + refine SegRLs.congr ((h1.trans h2).trans h3) ?_ rfl ?_ ?_ + · rw [← pow_add_list, ← pow_add_list] + congr 1 + dsimp [q4] + omega + · rw [pow_succ_list', List.append_assoc] + · rw [pow_succ_list', List.append_assoc] + +theorem G_Zs (n : ℕ) : SegRLs tm hg hg (zw ^ n) (lw ^ n) := by + induction n with + | zero => exact SegRLs.empty tm hg + | succ n ih => exact G_Z.concat ih + +theorem G_Ls (n : ℕ) : SegRLs tm hg hh (lw ^ (1 + n)) (tw ++ zw ^ n) := by + rw [Nat.add_comm 1 n, pow_succ_list] + exact G_L.concat (H_Ls n) + +theorem G_ZT (n : ℕ) : + SegRLs tm (hg ^ 2) hf (zw ^ (1 + n) ++ tw) (tw ++ zw ^ n ++ tw) := by + have h1 := (G_Zs (1 + n)).concat G_T + have h2 := (G_Ls n).concat H_K + exact SegRLs.congr (h1.trans h2) (by rfl) rfl rfl (by simp only [List.append_assoc]) + +theorem G_reduce_Z (n : ℕ) : + SegRLs tm (hg ^ (2 * q4 n)) (hf ^ n) (zw ^ n ++ tw) (tw ^ (1 + n)) := by + induction n with + | zero => exact .nil tw + | succ n ih => + have h1 := G_ZT (n := n) + have h2 := (G_recycle (2 * q4 n) G4_T).concat ih + refine SegRLs.congr (SegRLs.trans_eq h1 h2 (by simp only [List.append_assoc])) + ?_ ?_ (by rw [Nat.add_comm 1 n]) ?_ + · rw [← pow_add_list, show 2 + 2 * q4 n * 4 = 2 * q4 (n + 1) by dsimp [q4]; omega] + · rw [← pow_succ_list] + · rw [show 1 + (n + 1) = (1 + n) + 1 by omega, pow_succ_list] + +theorem G_column_start (n : ℕ) (w : List Γ) : + SegRLs tm hg [] (lw ^ (1 + n) ++ kw ++ tw ++ w) (tw ++ zw ^ n ++ tw ++ zw ++ w) := by + have h := (G_Ls n).concat (H_K.concat (F_T.concat (.nil w))) + exact SegRLs.congr h rfl rfl (by simp only [List.append_assoc]) (by simp only [List.append_assoc]) + +theorem COLUMN (n : ℕ) (w e : List Γ) (hs : List (DH0 Γ Λ × DH0 Γ Λ)) + (H : SegRLs tm (hf ^ n) hs (zw ++ w) e) : + SegRLs tm (hf ^ (2 + 16 * q4 n)) hs + (tw ++ lw ^ (1 + n) ++ kw ++ tw ++ w) (tw ^ (n + 3) ++ e) := by + have h_inner1 := G_column_start n w + have h_inner2 := (G_recycle (2 * q4 n) G4_T).concat ((G_reduce_Z n).concat H) + have h_inner : SegRLs tm (hg ^ (1 + 8 * q4 n)) hs + (lw ^ (1 + n) ++ kw ++ tw ++ w) (tw ++ tw ^ (1 + n) ++ e) := by + refine SegRLs.congr (SegRLs.trans_eq h_inner1 h_inner2 (by simp only [List.append_assoc])) + ?_ (List.nil_append hs) rfl (by simp only [List.append_assoc]) + rw [← pow_succ_list] + congr 1 + omega + have h_outer := (F_T_calls 0 (1 + 8 * q4 n)).concat h_inner + refine SegRLs.congr h_outer ?_ (List.nil_append hs) + (by simp only [pow_zero_list, pow_succ_list, List.append_nil, List.append_assoc]) ?_ + · congr 1 + rw [Nat.pow_zero] + omega + · rw [show (1 + 0 : ℕ) = 1 from rfl, pow_one_list, + show n + 3 = 1 + (1 + (1 + n)) by omega, + Nat.add_comm 1 (1 + (1 + n)), pow_succ_list, + Nat.add_comm 1 (1 + n), pow_succ_list] + simp only [List.append_assoc] + +theorem G3_T : SegRLs tm (hg ^ 3) hf tw lw := + SegRLs.congr (G2_T.trans G_J) (by rfl) rfl rfl rfl + +theorem G_almost (n : ℕ) : + SegRLs tm (hg ^ (3 + 12 * q4 n)) hf (tw ^ (1 + n)) (lw ++ mw ^ n) := by + induction n with + | zero => exact G3_T + | succ n ih => + have h1 := (G_recycle (3 + 12 * q4 n) G4_T).concat ih + have h2 := G3_T.concat (F_L.concat (.nil (mw ^ n))) + refine SegRLs.congr (SegRLs.trans_eq h1 h2 (by simp only [List.append_assoc])) + ?_ rfl ?_ ?_ + · rw [← pow_add_list] + congr 1 + dsimp [q4] + omega + · rw [show 1 + (n + 1) = (1 + n) + 1 by omega, pow_succ_list] + · rw [pow_succ_list] + +theorem G_two_before (n : ℕ) : + SegRLs tm (hg ^ (14 + 48 * q4 n)) hf (tw ^ (2 + n)) (jw ++ lw ++ mw ^ n) := by + have h1 := (G_recycle (3 + 12 * q4 n) G4_T).concat (G_almost n) + have h2 := G2_T.concat (.nil (lw ++ mw ^ n)) + refine SegRLs.congr (h1.trans h2) ?_ rfl ?_ (by simp only [List.append_assoc]) + · rw [← pow_add_list] + congr 1 + omega + · rw [show 2 + n = (1 + n) + 1 by omega, pow_succ_list] + +theorem NEAR_WRAP (n j : ℕ) : + SegRLs tm (hf ^ (29 + 96 * q4 n + 2 * j * 4 ^ (2 + n))) (hg ^ j ++ hf) + (tw ^ (3 + n)) (zw ++ jw ++ lw ++ mw ^ n) := by + have h1 := F_T_calls (2 + n) j + have h2 := SegRLs.trans_eq ((F_T_calls 0 (14 + 48 * q4 n)).concat (G_two_before n)) + (F_T.concat (.nil (jw ++ lw ++ mw ^ n))) (by rfl) + refine SegRLs.congr (SegRLs.trans_eq h1 h2 ?_) ?_ (by simp only [List.append_nil]) + (by rw [show 3 + n = 1 + (2 + n) by omega]) (by simp only [List.append_assoc]) + · rw [show (1 + 0 : ℕ) = 1 from rfl, pow_one_list, + show 1 + (2 + n) = (2 + n) + 1 by omega, pow_succ_list] + · rw [← pow_succ_list', ← pow_add_list] + congr 1 + rw [Nat.pow_zero] + omega + +theorem G_append (n k : ℕ) (u v w : List Γ) + (H : SegRLs tm (hg ^ n) [] u v) + (H' : SegRLs tm (hg ^ k) [] (tw ++ v) w) : + SegRLs tm (hg ^ (4 * n + k)) [] (tw ++ u) w := by + have h1 := (G_recycle n G4_T).concat H + refine SegRLs.congr (h1.trans H') ?_ rfl rfl rfl + rw [← pow_add_list, Nat.mul_comm n 4] + +theorem G7 : SegRLs tm (hg ^ 7) [] (tw ^ 2) cw := + G_append 1 3 tw kw cw G_T (G3_T.concat F_K) + +theorem G125 : SegRLs tm (hg ^ 125) [] (tw ^ 4) (kw ++ dw) := by + have H31 : SegRLs tm (hg ^ 31) [] (tw ^ 3) dw := + G_append 7 3 (tw ^ 2) cw dw G7 + (SegRLs.congr (G3_T.concat (F_L.concat (.nil rw))) rfl rfl rfl rfl) + exact G_append 31 1 (tw ^ 3) dw (kw ++ dw) H31 (G_T.concat (.nil dw)) + +theorem G_prefix7 : SegRLs tm (hg ^ 8061) [] (tw ^ 7) (kw ++ dw ^ 2) := by + have H5 : SegRLs tm (hg ^ 503) [] (tw ^ 5) (cw ++ dw) := + G_append 125 3 (tw ^ 4) (kw ++ dw) (cw ++ dw) G125 + (SegRLs.congr (G3_T.concat (F_K.concat (.nil dw))) rfl rfl rfl rfl) + have H6 : SegRLs tm (hg ^ 2015) [] (tw ^ 6) (dw ++ dw) := + G_append 503 3 (tw ^ 5) (cw ++ dw) (dw ++ dw) H5 + (SegRLs.congr (G3_T.concat (F_L.concat (.nil (rw ++ dw)))) rfl rfl rfl rfl) + exact G_append 2015 1 (tw ^ 6) (dw ++ dw) (kw ++ dw ^ 2) H6 + (SegRLs.congr (G_T.concat (.nil (dw ++ dw))) rfl rfl rfl rfl) + +theorem G_pair13 : SegRLs tm (hg ^ 13) [] (tw ^ 2 ++ kw) (kw ++ cw) := + SegRLs.congr (G_append 3 1 (tw ++ kw) cw (kw ++ cw) (G3_T.concat F_K) (G_T.concat (.nil cw))) + rfl rfl rfl rfl + +theorem G_last61 : SegRLs tm (hg ^ 61) [] (tw ^ 3 ++ kw) (kw ++ dw) := by + have H15 : SegRLs tm (hg ^ 15) [] (tw ^ 2 ++ kw) dw := + SegRLs.congr (G_append 3 3 (tw ++ kw) cw dw (G3_T.concat F_K) + (SegRLs.congr (G3_T.concat (F_L.concat (.nil rw))) rfl rfl rfl rfl)) + rfl rfl rfl rfl + exact SegRLs.congr (G_append 15 1 (tw ^ 2 ++ kw) dw (kw ++ dw) H15 (G_T.concat (.nil dw))) + rfl rfl rfl rfl + +def supply_d : ℕ → ℕ + | 0 => 8061 + | r + 1 => 16 * supply_d r + 13 + +theorem G_supply_pairs (r : ℕ) : + SegRLs tm (hg ^ (supply_d r)) [] (tw ^ (7 + 2 * r)) (kw ++ cw ^ r ++ dw ^ 2) := by + induction r with + | zero => exact G_prefix7 + | succ r ih => + have h1 := (G_Ts 2 (supply_d r)).concat ih + have h2 := G_pair13.concat (.nil (cw ^ r ++ dw ^ 2)) + refine SegRLs.congr (SegRLs.trans_eq h1 h2 (by simp only [List.append_assoc])) ?_ rfl ?_ + (by rw [pow_succ_list cw r]; simp only [List.append_assoc]) + · rw [← pow_add_list] + congr 1 + dsimp [supply_d] + omega + · rw [← pow_add_list] + congr 1 + omega + +theorem G_supply_digits (r : ℕ) : + SegRLs tm (hg ^ (64 * supply_d r + 61)) [] (tw ^ (10 + 2 * r)) + (kw ++ dw ++ cw ^ r ++ dw ^ 2) := by + have h1 := (G_Ts 3 (supply_d r)).concat (G_supply_pairs r) + have h2 := G_last61.concat (.nil (cw ^ r ++ dw ^ 2)) + refine SegRLs.congr (SegRLs.trans_eq h1 h2 (by simp only [List.append_assoc])) ?_ rfl ?_ rfl + · rw [← pow_add_list] + congr 1 + omega + · rw [← pow_add_list] + congr 1 + omega + +theorem G2_KK : SegRLs tm (hg ^ 2) [] (kw ++ kw) cw := + SegRLs.congr ((G_K.concat (.nil kw)).trans (G_J.concat F_K)) (by rfl) rfl rfl rfl + +def supply_g (r : ℕ) : ℕ := 2 * 4 ^ (10 + 2 * r) + 64 * supply_d r + 61 + +theorem pow_add2_eq {α : Type} (l : List α) {a b d : ℕ} (h : a + b = d) : + l ^ a ++ l ^ b = l ^ d := by + subst h + rw [← pow_add_list] + +theorem pow_add3_eq {α : Type} (l : List α) {a b c d : ℕ} (h : a + (b + c) = d) : + l ^ a ++ (l ^ b ++ l ^ c) = l ^ d := by + subst h + rw [← pow_add_list, ← pow_add_list] + +theorem G_SUPPLY (r : ℕ) : + SegRLs tm (hg ^ (supply_g r)) [] (tw ^ (10 + 2 * r) ++ kw ++ kw) + (kw ++ dw ++ cw ^ r ++ dw ^ 2 ++ cw) := by + have h1 := (G_Ts (10 + 2 * r) 2).concat G2_KK + have h2 := (G_supply_digits r).concat (.nil cw) + refine SegRLs.congr (h1.trans h2) ?_ rfl (by simp only [List.append_assoc]) + (by simp only [List.append_assoc]) + exact pow_add2_eq hg (by unfold supply_g; omega) + +def supply_f (r n : ℕ) : ℕ := + 8 * q4 (n + 11 + 2 * r) + 1 + (29 + 96 * q4 n + 2 * supply_g r * 4 ^ (2 + n)) + +theorem SUPPLY (r n : ℕ) : + SegRLs tm (hf ^ (supply_f r n)) [] + (zw ++ lw ++ tw ^ (n + 11 + 2 * r) ++ zw ++ kw) + (zw ++ jw ++ lw ++ mw ^ n ++ rw ++ dw ++ cw ^ r ++ dw ^ 2 ++ cw) := by + have h1 := (BIN (n + 11 + 2 * r)).concat (.nil (zw ++ kw)) + have h2 := (F_outer (n + 11 + 2 * r)).concat (H_Z.concat (.nil kw)) + have h3_right := SegRLs.trans_eq (G_SUPPLY r) (F_K.concat (.nil (dw ++ cw ^ r ++ dw ^ 2 ++ cw))) + (by simp only [List.append_assoc]) + have h3 := (NEAR_WRAP n (supply_g r)).concat h3_right + have h12 := SegRLs.trans_eq h1 h2 (by simp only [List.append_assoc]) + have h123 := SegRLs.trans_eq h12 h3 (by + rw [show 2 + (n + 11 + 2 * r) = (3 + n) + (10 + 2 * r) by omega, pow_add_list] + simp only [List.append_assoc]) + refine SegRLs.congr h123 ?_ rfl (by simp only [List.append_assoc]) + (by simp only [List.append_assoc]) + rw [← pow_succ_list', ← pow_add_list] + rfl + +def q16 : ℕ → ℕ + | 0 => 0 + | k + 1 => 1 + 16 * q16 k + +theorem q16_pow (n : ℕ) : 1 + 15 * q16 n = 16 ^ n := by + induction n with + | zero => rfl + | succ n ih => + dsimp [q16] + rw [Nat.pow_succ] + omega + +theorem pow4_double (n : ℕ) : 4 ^ (2 * n) = 16 ^ n := by + induction n with + | zero => rfl + | succ n ih => + rw [show 2 * (n + 1) = 2 * n + 2 by omega, Nat.pow_add, ih, Nat.pow_succ] + rfl + +theorem EVEN_END : SegRLs tm (hg ^ 8) (hg ++ hh) (tw ++ zw) (tw ^ 2) := by + have h1 := G3_T.concat F_Z + have h2 := G_L.concat H_T + have h3 := G2_T.concat (.nil lw) + have h4 := G_J.concat F_L + have h5 := G_L.concat H_M + exact SegRLs.congr (h1.trans (h2.trans (h3.trans (h4.trans h5)))) + (by rfl) (by rfl) rfl (by rfl) + +theorem ODD_END : SegRLs tm (hg ^ 8) hf (tw ++ zw ++ tw) (tw ^ 3) := by + have h := EVEN_END.concat (G_T.trans H_K) + exact SegRLs.congr h rfl rfl rfl (by rfl) + +theorem SHIFT : SegRLs tm (hg ^ 8) [] (tw ++ zw ++ tw ^ 2) (tw ^ 3 ++ zw) := by + have h := ODD_END.concat F_T + exact SegRLs.congr h rfl rfl rfl rfl + +theorem SHIFTS (r : ℕ) : + SegRLs tm (hg ^ (8 * q16 r)) [] (tw ++ zw ++ tw ^ (2 * r)) (tw ^ (1 + 2 * r) ++ zw) := by + induction r with + | zero => exact .nil (tw ++ zw) + | succ r ih => + have h1 := SHIFT.concat (.nil (tw ^ (2 * r))) + have h2 := (G_Ts 2 (8 * q16 r)).concat ih + refine SegRLs.congr (SegRLs.trans_eq h1 h2 ?_) ?_ rfl ?_ ?_ + · rw [show (3 : ℕ) = 2 + 1 from rfl, pow_add_list, pow_one_list] + simp only [List.append_assoc] + · rw [← pow_add_list] + congr 1 + dsimp [q16] + omega + · rw [show 2 * (r + 1) = 2 + 2 * r by omega, pow_add_list] + simp only [List.append_assoc] + · rw [show 1 + 2 * (r + 1) = 2 + (1 + 2 * r) by omega, pow_add_list tw 2 (1 + 2 * r)] + simp only [List.append_assoc] + +theorem G_Mstart (n : ℕ) : + SegRLs tm (hg ^ 2) hh (zw ++ jw ++ lw ++ mw ^ n) (tw ++ zw ++ tw ^ (1 + n)) := by + have h1 := G_Z.concat (G_J.concat (F_L.concat (.nil (mw ^ n)))) + have h2 := (G_Ls 1).concat (H_Ms (1 + n)) + refine SegRLs.congr (SegRLs.trans_eq h1 h2 (by rw [Nat.add_comm 1 n, pow_succ_list]; rfl)) + (by rfl) rfl (by simp only [List.append_assoc]) (by simp only [pow_one_list, List.append_assoc]) + +theorem M_ODD (r : ℕ) : + SegRLs tm (hg ^ (2 + 8 * q16 (2 + r))) (hh ++ hg ++ hh) + (zw ++ jw ++ lw ++ mw ^ (1 + 2 * r)) (tw ^ (4 + 2 * r)) := by + have h1 := G_Mstart (1 + 2 * r) + have h2 := SHIFTS (1 + r) + have h3 := (G_Ts (2 + 2 * r) 8).concat EVEN_END + have h12 := SegRLs.trans_eq h1 h2 (by rw [show 2 * (1 + r) = 1 + (1 + 2 * r) by omega]) + have h123 := SegRLs.trans_eq h12 h3 (by + rw [show 1 + 2 * (1 + r) = (2 + 2 * r) + 1 by omega, pow_add_list, pow_one_list] + simp only [List.append_assoc]) + refine SegRLs.congr h123 ?_ (by simp only [List.append_assoc, List.nil_append]) rfl + (by rw [show 4 + 2 * r = (2 + 2 * r) + 2 by omega, pow_add_list tw (2 + 2 * r) 2]) + rw [← pow_add_list, ← pow_add_list] + congr 1 + have hpow : 4 ^ (2 + 2 * r) = 16 ^ (1 + r) := by + rw [show 2 + 2 * r = 2 * (1 + r) by omega, pow4_double] + have hq := q16_pow (1 + r) + rw [hpow, show 2 + r = (1 + r) + 1 by omega] + dsimp [q16] + omega + +theorem GH_JC : SegRLs tm (hg ++ hh) [] (jw ++ cw) (zw ++ tw ++ jw) := by + have h1 := G_J.concat (F_L.concat (.nil rw)) + have h2 := H_L.concat (H_M.concat H_R) + exact SegRLs.congr (SegRLs.trans_eq h1 h2 rfl) rfl rfl rfl rfl + +theorem F_JC : SegRLs tm hf [] (jw ++ cw) (tw ++ mw ++ rw) := + SegRLs.congr (F_J.concat (F_L.concat (.nil rw))) rfl rfl rfl rfl + +theorem HGH_F : SegRLs tm (hh ++ hg ++ hh) [] (rw ++ dw) (zw ++ tw ^ 2 ++ jw) := by + have h1 := H_R.concat (.nil dw) + have h2 := G_J.concat (F_L.concat (.nil (mw ++ rw))) + have h3 := H_L.concat (H_M.concat (H_M.concat H_R)) + exact SegRLs.congr (SegRLs.trans_eq h1 (SegRLs.trans_eq h2 h3 rfl) rfl) rfl rfl rfl rfl + +theorem G_packet2 : SegRLs tm (hg ^ 2) [] (zw ++ tw ^ 2) (tw ^ 2 ++ zw) := + SegRLs.congr ((G_ZT 0).concat F_T) rfl rfl rfl rfl + +theorem PACKET162 : + SegRLs tm (hg ^ 162) [] (zw ++ tw ^ 2 ++ jw ++ cw ^ 2) (tw ^ 6 ++ mw ++ rw) := by + have h1 := G_packet2.concat (.nil (jw ++ cw ^ 2)) + have h2 := (G_Ts 1 8).concat (EVEN_END.concat (GH_JC.concat (.nil cw))) + have h3 := (G_Ts 2 8).concat (ODD_END.concat F_JC) + have h12 := SegRLs.trans_eq h1 h2 (by rfl) + have h123 := SegRLs.trans_eq h12 h3 (by rfl) + exact SegRLs.congr h123 (by rw [← pow_add_list, ← pow_add_list]; congr 1) rfl (by rfl) (by rfl) + +theorem PACKET (r : ℕ) : + SegRLs tm (hg ^ 2892) [] (zw ++ tw ^ 2 ++ jw ++ cw ^ (2 + r)) + (jw ^ 6 ++ mw ++ rw ++ cw ^ r) := by + have h1 := PACKET162.concat (.nil (cw ^ r)) + have h2 := (G_normalize 6).concat (.nil (mw ++ rw ++ cw ^ r)) + refine SegRLs.congr (SegRLs.trans_eq h1 h2 (by simp only [List.append_assoc])) + (by rw [← pow_add_list]; congr 1) rfl ?_ (by simp only [List.append_assoc]) + rw [pow_add_list] + simp only [List.append_assoc] + +theorem P_calls (n k : ℕ) (r s : ListBlank Γ) (H : SideRLs tm (hf ^ k) r s) : + (P n r) [tm]⊢* (P (n + k) s) := by + induction k generalizing n r with + | zero => + cases H + rw [Nat.add_zero] + try exact stepStar_refl tm _ + | succ k ih => + rw [pow_succ_list] at H + obtain ⟨r₁, H₁, H₂⟩ := H.split + refine stepStar_trans (stepPlus_to_stepStar (P_step n r r₁ H₁)) ?_ + refine stepStar_congr (ih (1 + n) r₁ H₂) rfl ?_ + rw [show 1 + n + k = n + (k + 1) by omega] + +theorem supply_balance (r : ℕ) : + 6 * supply_d r + 5 = 3 * q16 (2 + r) + 755 * 4 ^ (3 + 2 * r) := by + induction r with + | zero => rfl + | succ r ih => + rw [show 2 + (r + 1) = (2 + r) + 1 by omega, + show 3 + 2 * (r + 1) = (3 + 2 * r) + 2 by omega, Nat.pow_add] + dsimp [supply_d, q16] + omega + +theorem supply_g_balance (r : ℕ) : + 24 * supply_g r = 184 + 768 * q16 (2 + r) + 3827 * 4 ^ (7 + 2 * r) := by + have H := supply_balance r + have P7 : 4 ^ (7 + 2 * r) = 256 * 4 ^ (3 + 2 * r) := by + rw [show 7 + 2 * r = (3 + 2 * r) + 4 by omega, Nat.pow_add] + omega + have P10 : 4 ^ (10 + 2 * r) = 64 * 4 ^ (7 + 2 * r) := by + rw [show 10 + 2 * r = (7 + 2 * r) + 3 by omega, Nat.pow_add] + omega + unfold supply_g + omega + +theorem budget_algebra (a b c d x y g q : ℕ) + (Q0 : 1 + 3 * a = x) (Q1 : 1 + 3 * b = 4 * x) + (Q11 : 1 + 3 * c = 256 * (x * y)) (Q8 : 1 + 3 * d = 4 * (x * y)) + (G : x * (24 * g) = x * (184 + 768 * q + 3827 * y)) : + 1 + (8 * c + 1 + (29 + 96 * a + 2 * g * (16 * x))) = + 2 + 16 * b + 2 * (2 + 8 * q) * (64 * x) + 2 * 2892 * (x * y) + d := by + nlinarith + +theorem supply_budget (r n : ℕ) : + 1 + supply_f r n = + 2 + 16 * q4 (1 + n) + 2 * (2 + 8 * q16 (2 + r)) * 4 ^ (3 + n) + + 2 * 2892 * 4 ^ (7 + n + 2 * r) + q4 (8 + n + 2 * r) := by + have P1 : 4 ^ (1 + n) = 4 * 4 ^ n := by rw [Nat.add_comm 1 n, Nat.pow_succ]; ring + have P2 : 4 ^ (2 + n) = 16 * 4 ^ n := by rw [Nat.add_comm 2 n, Nat.pow_add]; ring + have P3 : 4 ^ (3 + n) = 64 * 4 ^ n := by rw [Nat.add_comm 3 n, Nat.pow_add]; ring + have P7 : 4 ^ (7 + n + 2 * r) = 4 ^ n * 4 ^ (7 + 2 * r) := by + rw [show 7 + n + 2 * r = n + (7 + 2 * r) by omega, Nat.pow_add] + have P8 : 4 ^ (8 + n + 2 * r) = 4 * (4 ^ n * 4 ^ (7 + 2 * r)) := by + rw [show 8 + n + 2 * r = (7 + n + 2 * r) + 1 by omega, Nat.pow_succ, P7]; ring + have P11 : 4 ^ (n + 11 + 2 * r) = 256 * (4 ^ n * 4 ^ (7 + 2 * r)) := by + rw [show n + 11 + 2 * r = (7 + n + 2 * r) + 4 by omega, Nat.pow_add, P7]; ring + have Q0 := q4_pow n + have Q1 := q4_pow (1 + n); rw [P1] at Q1 + have Q11 := q4_pow (n + 11 + 2 * r); rw [P11] at Q11 + have Q8 := q4_pow (8 + n + 2 * r); rw [P8] at Q8 + have G := congrArg (fun z => 4 ^ n * z) (supply_g_balance r) + unfold supply_f + rw [P2, P3, P7] + exact budget_algebra _ _ _ _ _ _ _ _ Q0 Q1 Q11 Q8 G + +def e (a b : ℕ) : ℕ := + 11 + 4 * q4 (24 + 2 * a + 2 * b) + 48 * q4 (7 + 2 * b) + + supply_g (3 + a) * 4 ^ (9 + 2 * b) + +theorem supply_index (a b : ℕ) : supply_f (3 + a) (7 + 2 * b) = 8 + 2 * e a b := by + unfold supply_f e + rw [show 7 + 2 * b + 11 + 2 * (3 + a) = 24 + 2 * a + 2 * b by omega, + show 2 + (7 + 2 * b) = 9 + 2 * b by omega] + ring + +theorem family_budget (a b : ℕ) : + 2 + 16 * q4 (8 + 2 * e a b) + + 2 * (2 + 8 * q16 (5 + b)) * 4 ^ (10 + 2 * e a b) + + 2 * 2892 * 4 ^ (20 + 2 * e a b + 2 * b) + q4 (21 + 2 * e a b + 2 * b) = + 9 + 2 * e b (e a b) := by + have H := supply_budget (3 + b) (7 + 2 * e a b) + rw [supply_index] at H + rw [show 1 + (7 + 2 * e a b) = 8 + 2 * e a b by omega, + show 2 + (3 + b) = 5 + b by omega, + show 3 + (7 + 2 * e a b) = 10 + 2 * e a b by omega, + show 7 + (7 + 2 * e a b) + 2 * (3 + b) = 20 + 2 * e a b + 2 * b by omega, + show 8 + (7 + 2 * e a b) + 2 * (3 + b) = 21 + 2 * e a b + 2 * b by omega] at H + omega + +theorem service_tail {hs : List (DH0 Γ Λ × DH0 Γ Λ)} {u v : List Γ} (w : List Γ) + (H : SegRLs tm hs [] u v) : SegRLs tm hs [] (u ++ w) (v ++ w) := + H.concat (.nil w) + +theorem F_T_service (n k : ℕ) {u v : List Γ} + (H : SegRLs tm (hg ^ k) [] u v) : + SegRLs tm (hf ^ (2 * k * 4 ^ n)) [] (tw ^ (1 + n) ++ u) (tw ^ (1 + n) ++ v) := + (F_T_calls n k).concat H + +def family_word (a b : ℕ) : List Γ := + tw ++ lw ^ (9 + 2 * e a b) ++ kw ++ tw ++ lw ++ + tw ^ (24 + 2 * a + 2 * b) ++ zw ++ kw ++ tw ++ [O, O] + +def family_col (a b : ℕ) : List Γ := + tw ^ (11 + 2 * e a b) ++ zw ++ jw ++ lw ++ mw ^ (7 + 2 * b) ++ + rw ++ dw ++ cw ^ (3 + a) ++ dw ^ 2 ++ cw ++ tw ++ [O, O] + +def family_mid (a b : ℕ) : List Γ := + tw ^ (21 + 2 * e a b + 2 * b) ++ zw ++ tw ^ 2 ++ jw ++ + cw ^ (3 + a) ++ dw ^ 2 ++ cw ++ tw ++ [O, O] + +def family_end (a b : ℕ) : List Γ := + zw ++ jw ^ (26 + 2 * e a b + 2 * b) ++ mw ++ rw ++ + cw ^ (1 + a) ++ dw ^ 2 ++ cw ++ tw ++ [O, O] + +theorem family_column (a b : ℕ) : + SegRLs tm (hf ^ (2 + 16 * q4 (8 + 2 * e a b))) [] + (family_word a b) (family_col a b) := by + have h_sup := service_tail (tw ++ [O, O]) (SUPPLY (3 + a) (7 + 2 * b)) + have h_sup' : SegRLs tm (hf ^ (8 + 2 * e a b)) [] + (zw ++ (lw ++ tw ^ (24 + 2 * a + 2 * b) ++ zw ++ kw ++ tw ++ [O, O])) + (zw ++ jw ++ lw ++ mw ^ (7 + 2 * b) ++ rw ++ dw ++ cw ^ (3 + a) ++ dw ^ 2 ++ cw ++ tw ++ [O, O]) := by + refine SegRLs.congr h_sup (by rw [supply_index a b]) rfl ?_ (by simp only [List.append_assoc]) + rw [show 7 + 2 * b + 11 + 2 * (3 + a) = 24 + 2 * a + 2 * b by omega] + simp only [List.append_assoc] + have h_col := COLUMN (8 + 2 * e a b) + (lw ++ tw ^ (24 + 2 * a + 2 * b) ++ zw ++ kw ++ tw ++ [O, O]) + (zw ++ jw ++ lw ++ mw ^ (7 + 2 * b) ++ rw ++ dw ++ cw ^ (3 + a) ++ dw ^ 2 ++ cw ++ tw ++ [O, O]) + [] h_sup' + unfold family_word family_col + refine SegRLs.congr h_col rfl rfl ?_ ?_ + · rw [show 9 + 2 * e a b = 1 + (8 + 2 * e a b) by omega] + simp only [List.append_assoc] + · rw [show 11 + 2 * e a b = (8 + 2 * e a b) + 3 by omega] + simp only [List.append_assoc] + +theorem M_block (r : ℕ) : + SegRLs tm (hg ^ (2 + 8 * q16 (2 + r))) [] + (zw ++ jw ++ lw ++ mw ^ (1 + 2 * r) ++ rw ++ dw) + (tw ^ (4 + 2 * r) ++ zw ++ tw ^ 2 ++ jw) := by + have h := (M_ODD r).concat HGH_F + exact SegRLs.congr h rfl rfl (by simp only [List.append_assoc]) (by simp only [List.append_assoc]) + +theorem family_m (a b : ℕ) : + SegRLs tm (hf ^ (2 * (2 + 8 * q16 (5 + b)) * 4 ^ (10 + 2 * e a b))) [] + (family_col a b) (family_mid a b) := by + have h_mb := service_tail (cw ^ (3 + a) ++ dw ^ 2 ++ cw ++ tw ++ [O, O]) (M_block (3 + b)) + have h := F_T_service (10 + 2 * e a b) (2 + 8 * q16 (2 + (3 + b))) h_mb + unfold family_col family_mid + refine SegRLs.congr h ?_ rfl ?_ ?_ + · rw [show 2 + (3 + b) = 5 + b by omega] + · rw [show 11 + 2 * e a b = 1 + (10 + 2 * e a b) by omega, + show 7 + 2 * b = 1 + 2 * (3 + b) by omega] + simp only [List.append_assoc] + · rw [show 21 + 2 * e a b + 2 * b = (1 + (10 + 2 * e a b)) + (4 + 2 * (3 + b)) by omega, + pow_add_list tw (1 + (10 + 2 * e a b)) (4 + 2 * (3 + b))] + simp only [List.append_assoc] + +theorem family_finish (a b : ℕ) : + SegRLs tm (hf ^ (2 * 2892 * 4 ^ (20 + 2 * e a b + 2 * b) + q4 (21 + 2 * e a b + 2 * b))) [] + (family_mid a b) (family_end a b) := by + have h1 := F_T_service (20 + 2 * e a b + 2 * b) 2892 + (service_tail (dw ^ 2 ++ cw ++ tw ++ [O, O]) (PACKET (1 + a))) + have h2 := service_tail (jw ^ 6 ++ mw ++ rw ++ cw ^ (1 + a) ++ dw ^ 2 ++ cw ++ tw ++ [O, O]) + (F_normalize (20 + 2 * e a b + 2 * b)) + have h12 := SegRLs.trans_eq h1 h2 (by simp only [List.append_assoc]) + unfold family_mid family_end + refine SegRLs.congr h12 ?_ rfl ?_ ?_ + · exact pow_add2_eq hf (by rw [show 1 + (20 + 2 * e a b + 2 * b) = 21 + 2 * e a b + 2 * b by omega]) + · rw [show 21 + 2 * e a b + 2 * b = 1 + (20 + 2 * e a b + 2 * b) by omega, + show 3 + a = 2 + (1 + a) by omega] + simp only [List.append_assoc] + · rw [show 26 + 2 * e a b + 2 * b = (20 + 2 * e a b + 2 * b) + 6 by omega, + pow_add_list jw (20 + 2 * e a b + 2 * b) 6] + simp only [List.append_assoc] + +theorem family_services (a b : ℕ) : + SegRLs tm (hf ^ (9 + 2 * e b (e a b))) [] (family_word a b) (family_end a b) := by + have h := (family_column a b).trans ((family_m a b).trans (family_finish a b)) + refine SegRLs.congr h ?_ rfl rfl rfl + exact pow_add3_eq hf (by have := family_budget a b; omega) + +def family_prefix (a : ℕ) : List Γ := + [I] ++ rw ++ cw ^ a ++ dw ^ 2 ++ cw ++ tw ++ [O, O] + +def family_after_zero (a b : ℕ) : List Γ := + tw ++ lw ^ (9 + 2 * e b (e a b)) ++ kw ++ tw ++ aw ++ + tw ^ (25 + 2 * e a b + 2 * b) ++ [I, O, I] ++ bw ++ rw ++ + cw ^ (1 + a) ++ dw ^ 2 ++ cw ++ tw ++ [O, O] + +theorem reset_recut (a k : ℕ) : + aw ++ tw ^ (1 + k) ++ [I, O, I] ++ bw ++ rw ++ cw ^ (1 + a) ++ dw ^ 2 ++ cw ++ tw ++ [O, O] = + lw ++ tw ^ k ++ zw ++ kw ++ tw ++ [O, O] ++ family_prefix a := by + unfold family_prefix + rw [Nat.add_comm 1 k, pow_succ_list, Nat.add_comm 1 a, pow_succ_list] + have hbw := bw_comm_T k + have haw : aw ++ tw ++ tw ^ k = lw ++ (bw ++ tw ^ k) := rfl + rw [← List.append_assoc aw tw (tw ^ k), haw, hbw] + simp only [List.append_assoc] + rfl + +theorem family_recut (a b : ℕ) : + family_after_zero a b = family_word b (e a b) ++ family_prefix a := by + unfold family_after_zero family_word + have h := reset_recut a (24 + 2 * b + 2 * e a b) + rw [show 25 + 2 * e a b + 2 * b = 1 + (24 + 2 * b + 2 * e a b) by omega] + simp only [List.append_assoc] at h ⊢ + rw [h] + +theorem P_service (n k : ℕ) (w1 w2 : List Γ) (u : ListBlank Γ) + (H : SegRLs tm (hf ^ k) [] w1 w2) : + (P n (w1 +> u)) [tm]⊢* (P (n + k) (w2 +> u)) := + P_calls n k (w1 +> u) (w2 +> u) (H.sideRLs_concat (.nil u)) + +theorem P_service_zero (k : ℕ) (w1 w2 : List Γ) (u : ListBlank Γ) + (H : SegRLs tm (hf ^ k) [] w1 w2) : + (P 0 (w1 +> u)) [tm]⊢* (P k (w2 +> u)) := by + have h := P_service 0 k w1 w2 u H + rwa [Nat.zero_add] at h + +theorem family_reset (a b : ℕ) (u : ListBlank Γ) : + (P (9 + 2 * e b (e a b)) (family_end a b +> u)) [tm]⊢⁺ + (P 0 (family_word b (e a b) +> (family_prefix a +> u))) := by + have h := zero_return (9 + 2 * e b (e a b)) (25 + 2 * e a b + 2 * b) + ((bw ++ rw ++ cw ^ (1 + a) ++ dw ^ 2 ++ cw ++ tw ++ [O, O]) +> u) + refine stepPlus_congr h ?_ ?_ + · unfold family_end + rw [show 26 + 2 * e a b + 2 * b = 1 + (25 + 2 * e a b + 2 * b) by omega] + simp only [append_assoc] + rfl + · rw [← append_assoc (family_word b (e a b)), ← family_recut a b] + unfold family_after_zero + simp only [append_assoc] + +def Inv (a b : ℕ) (u : ListBlank Γ) : Cfg Γ Λ := + P 0 (family_word a b +> u) + +theorem I_step (a b : ℕ) (u : ListBlank Γ) : + (Inv a b u) [tm]⊢⁺ (Inv b (e a b) (family_prefix a +> u)) := + stepStar_stepPlus_trans + (P_service_zero (9 + 2 * e b (e a b)) (family_word a b) (family_end a b) u + (family_services a b)) + (family_reset a b u) + +theorem tower_budget (a b : ℕ) : + 2 + 16 * q4 (8 + 2 * b) + 2 * (2 + 8 * q16 (5 + a)) * 4 ^ (10 + 2 * b) + + 2 * 2892 * 4 ^ (20 + 2 * a + 2 * b) + q4 (21 + 2 * a + 2 * b) = 9 + 2 * e a b := by + have H := supply_budget (3 + a) (7 + 2 * b) + rw [supply_index] at H + rw [show 1 + (7 + 2 * b) = 8 + 2 * b by omega, + show 2 + (3 + a) = 5 + a by omega, + show 3 + (7 + 2 * b) = 10 + 2 * b by omega, + show 7 + (7 + 2 * b) + 2 * (3 + a) = 20 + 2 * a + 2 * b by omega, + show 8 + (7 + 2 * b) + 2 * (3 + a) = 21 + 2 * a + 2 * b by omega] at H + omega + +def supply_count (n k j : ℕ) : ℕ := + 8 * q4 k + 1 + (4 * 4 ^ (1 + k) + (29 + 96 * q4 n + 2 * j * 4 ^ (2 + n))) + +theorem reset_supply (n k z j : ℕ) (u v w t : List Γ) (E_eq : k + 2 = 3 + n + z) + (H : SegRLs tm hh [] u v) (K : SegRLs tm (hg ^ 2) [] v w) + (L : SegRLs tm (hg ^ j ++ hf) [] (tw ^ z ++ w) t) : + SegRLs tm (hf ^ (supply_count n k j)) [] + (zw ++ lw ++ tw ^ k ++ u) (zw ++ jw ++ lw ++ mw ^ n ++ t) := by + have h1 := service_tail u (BIN k) + have h2 := (F_outer k).concat H + have h3 := F_T_service (1 + k) 2 K + have h4 := (NEAR_WRAP n j).concat L + have h12 := SegRLs.trans_eq h1 h2 (by simp only [List.append_assoc]) + have h123 := SegRLs.trans_eq h12 h3 (by rw [show 2 + k = 1 + (1 + k) by omega]) + have h1234 := SegRLs.trans_eq h123 h4 (by + rw [show 1 + (1 + k) = (3 + n) + z by omega, pow_add_list] + simp only [List.append_assoc]) + refine SegRLs.congr h1234 ?_ rfl (by simp only [List.append_assoc]) + (by simp only [List.append_assoc]) + rw [← pow_succ_list', ← pow_add_list, ← pow_add_list] + congr 1 + unfold supply_count + omega + +-- ============================================================================ +-- 4. Blank-Start Entrance for TM13 (`SOBCv13.v:1867-2440`) +-- ============================================================================ + + +-- ============================================================================ +-- 4. TM12 Entrance & Tower-Scale Specialization (`SOBCv13.v:1220-1832`) +-- ============================================================================ + +theorem init_F11 : SegRLs tm (hf ^ 11) [] (zw ++ lw ++ zw) (tw ++ kw ++ jw) := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +@[irreducible] def init_h : ℕ := 2 + 16 * q4 11 + 2 * 4 ^ 14 + q4 15 + +theorem init_services : + SegRLs tm (hf ^ init_h) [] (tw ++ lw ^ 12 ++ kw ++ tw ++ lw ++ zw) (zw ++ jw ^ 16) := by + have h1 := COLUMN 11 (lw ++ zw) (tw ++ kw ++ jw) [] + (SegRLs.congr init_F11 rfl rfl (by simp only [List.append_assoc]) rfl) + have h1' : SegRLs tm (hf ^ (2 + 16 * q4 11)) [] + (tw ++ lw ^ 12 ++ kw ++ tw ++ lw ++ zw) (tw ^ 15 ++ kw ++ jw) := by + refine SegRLs.congr h1 rfl rfl ?_ ?_ + · change tw ++ lw ^ 12 ++ kw ++ tw ++ (lw ++ zw) ++ [] = + tw ++ lw ^ 12 ++ kw ++ tw ++ lw ++ zw + simp only [List.append_nil, List.append_assoc] + · rfl + have h2 := F_T_service 14 1 (G_K.concat (.nil jw)) + have h2' : SegRLs tm (hf ^ (2 * 4 ^ 14)) [] (tw ^ 15 ++ kw ++ jw) (tw ^ 15 ++ jw ^ 2) := by + refine SegRLs.congr h2 (by rfl) rfl ?_ ?_ + · change tw ^ 15 ++ (kw ++ jw) = tw ^ 15 ++ kw ++ jw + simp only [List.append_assoc] + · change tw ^ 15 ++ (jw ++ jw) = tw ^ 15 ++ jw ^ 2 + rfl + have h3 := (F_normalize 14).concat (.nil (jw ^ 2)) + have h3' : SegRLs tm (hf ^ (q4 15)) [] (tw ^ 15 ++ jw ^ 2) (zw ++ jw ^ 16) := by + refine SegRLs.congr h3 (by rfl) rfl (by rfl) ?_ + rw [List.append_assoc, ← pow_add_list] + have h123 := h1'.trans (h2'.trans h3') + refine SegRLs.congr h123 ?_ rfl rfl rfl + exact pow_add3_eq hf (by unfold init_h; omega) + +@[irreducible] def m0 : ℕ := init_h + 2 + 8 * q4 15 + +theorem m0_eq_init_h : 1 + init_h + 1 + 8 * q4 15 = m0 := by + unfold m0 + omega + +theorem init_anchor_gen (h m : ℕ) (hm : 1 + h + 1 + 8 * q4 15 = m) + (h_serv : SegRLs tm (hf ^ h) [] (tw ++ lw ^ 12 ++ kw ++ tw ++ lw ++ zw) (zw ++ jw ^ 16)) : + (init []) [tm]⊢* (P 0 (tw +> (lw ^ m +> (kw +> (tw ^ 17 +> ([I, O, I] +> default)))))) := by + have s1 : (init []) [tm]⊢* (P h (zw +> (jw ^ 16 +> ([I] +> default)))) := by + refine stepStar_trans init_raw12 ?_ + have hs := P_service_zero h (tw ++ lw ^ 12 ++ kw ++ tw ++ lw ++ zw) (zw ++ jw ^ 16) + ([I] +> default) h_serv + refine stepStar_congr hs ?_ ?_ + · simp only [append_assoc] + · simp only [append_assoc] + have s2 : (P h (zw +> (jw ^ 16 +> ([I] +> default)))) [tm]⊢* + (P (1 + h) (tw +> (lw +> (tw ^ 15 +> default)))) := + stepPlus_to_stepStar (one_return_15 h) + have s3 : (P (1 + h) (tw +> (lw +> (tw ^ 15 +> default)))) [tm]⊢* + (P (1 + h + 1) (zw +> (lw +> (tw ^ 15 +> default)))) := + P_service (1 + h) 1 tw zw (lw +> (tw ^ 15 +> default)) F_T + have s4 : (P (1 + h + 1) (zw +> (lw +> (tw ^ 15 +> default)))) [tm]⊢* + (P m (zw +> (lw +> (mw ^ 15 +> default)))) := by + have hb := P_service (1 + h + 1) (8 * q4 15) (zw ++ lw ++ tw ^ 15) (zw ++ lw ++ mw ^ 15) + default (BIN 15) + refine stepStar_congr hb ?_ ?_ + · simp only [append_assoc] + · rw [hm]; simp only [append_assoc] + have s5 : (P m (zw +> (lw +> (mw ^ 15 +> default)))) [tm]⊢* + (P 0 (tw +> (lw ^ m +> (kw +> (tw ^ 17 +> ([I, O, I] +> default)))))) := + stepPlus_to_stepStar (ten_return_15 m) + exact stepStar_trans s1 (stepStar_trans s2 (stepStar_trans s3 (stepStar_trans s4 s5))) + +theorem init_anchor : + (init []) [tm]⊢* (P 0 (tw +> (lw ^ m0 +> (kw +> (tw ^ 17 +> ([I, O, I] +> default)))))) := + init_anchor_gen init_h m0 m0_eq_init_h init_services + +theorem G_digits (j k n : ℕ) (u v w : List Γ) + (H : SegRLs tm (hg ^ n) [] u v) (K : SegRLs tm (hg ^ k) [] tw w) : + SegRLs tm (hg ^ (n * 4 ^ j + k * q4 j)) [] (tw ^ j ++ u) (w ^ j ++ v) := by + induction j with + | zero => + have h0 : n * 4 ^ 0 + k * q4 0 = n := by dsimp [q4]; omega + exact SegRLs.congr H (by rw [h0]) rfl rfl rfl + | succ j ih => + have h := G_append (n * 4 ^ j + k * q4 j) k (tw ^ j ++ u) (w ^ j ++ v) (w ++ (w ^ j ++ v)) + ih (service_tail (w ^ j ++ v) K) + refine SegRLs.congr h ?_ rfl ?_ ?_ + · refine congrArg (hg ^ ·) ?_ + dsimp [q4] + rw [Nat.pow_succ] + ring + · rw [pow_succ_list tw j, List.append_assoc] + · rw [pow_succ_list w j, List.append_assoc] + +theorem short1_start (r : ℕ) : + SegRLs tm (hg ^ 2) [] (zw ++ tw ++ jw ^ r ++ tw ^ 2 ++ lw) (tw ^ (r + 2) ++ zw ++ tw ++ lw) := by + have h1 := G_Z.concat (service_tail (jw ^ r ++ tw ^ 2 ++ lw) G_T) + have h2 := G_L.concat (H_K.concat ((F_Js r).concat (service_tail (tw ++ lw) F_T))) + have h12 := SegRLs.trans_eq h1 h2 (by rw [show (tw ^ 2 : List Γ) = tw ++ tw from rfl]; simp only [List.append_assoc]) + refine SegRLs.congr h12 (by rfl) rfl (by simp only [List.append_assoc]) ?_ + rw [show r + 2 = 2 + r by omega, pow_add_list tw 2 r] + change tw ++ (tw ++ (tw ^ r ++ (zw ++ (tw ++ lw)))) = + (tw ++ (tw ++ [])) ++ tw ^ r ++ zw ++ tw ++ lw + simp only [List.append_nil, List.append_assoc] + +def short1_count (r : ℕ) : ℕ := 2 + 8 * 4 ^ (1 + r) + 2 * q4 (r + 4) + +theorem short1 (r : ℕ) : + SegRLs tm (hg ^ (short1_count r)) [] + (zw ++ tw ++ jw ^ r ++ tw ^ 2 ++ lw) (jw ^ (r + 4) ++ mw) := by + have h1 := short1_start r + have h2_mid : SegRLs tm (hg ^ (8 * 4 ^ (1 + r))) [] + (tw ^ (1 + r) ++ ((tw ++ zw ++ tw) ++ lw)) + (tw ^ (1 + r) ++ (tw ^ 3 ++ mw)) := + (G_Ts (1 + r) 8).concat (ODD_END.concat F_L) + have h2 : SegRLs tm (hg ^ (8 * 4 ^ (1 + r))) [] + (tw ^ (r + 2) ++ zw ++ tw ++ lw) (tw ^ (r + 4) ++ mw) := by + refine SegRLs.congr h2_mid rfl rfl ?_ ?_ + · rw [show r + 2 = (1 + r) + 1 by omega, pow_add_list tw (1 + r) 1, pow_one_list] + simp only [List.append_assoc] + · rw [show r + 4 = (1 + r) + 3 by omega, pow_add_list tw (1 + r) 3] + simp only [List.append_assoc] + have h3 := service_tail mw (G_normalize (r + 4)) + have h123 := h1.trans (h2.trans h3) + refine SegRLs.congr h123 ?_ rfl rfl rfl + exact pow_add3_eq hg (by unfold short1_count; omega) + +def reset_count (p j : ℕ) : ℕ := 2 + 16 * q4 p + 2 * j * 4 ^ (2 + p) + q4 (3 + p) + +theorem reset_services (p j k : ℕ) (w v u : List Γ) + (H : SegRLs tm (hf ^ p) [] (zw ++ w) v) + (K : SegRLs tm (hg ^ j) [] v (jw ^ (1 + k) ++ [O, O] ++ u)) : + SegRLs tm (hf ^ (reset_count p j)) [] + (tw ++ lw ^ (1 + p) ++ kw ++ tw ++ w) (zw ++ jw ^ (3 + p + k) ++ [O, O] ++ u) := by + have h1 : SegRLs tm (hf ^ (2 + 16 * q4 p)) [] + (tw ++ lw ^ (1 + p) ++ kw ++ tw ++ w) (tw ^ (3 + p) ++ v) := by + have hc := COLUMN p w v [] H + refine SegRLs.congr hc rfl rfl ?_ ?_ + · simp only [List.append_nil, List.append_assoc] + · rw [show p + 3 = 3 + p by omega] + have h2 : SegRLs tm (hf ^ (2 * j * 4 ^ (2 + p))) [] + (tw ^ (3 + p) ++ v) (tw ^ (3 + p) ++ jw ^ (1 + k) ++ [O, O] ++ u) := by + have hf_t := F_T_service (2 + p) j K + refine SegRLs.congr hf_t rfl rfl ?_ ?_ + · rw [show 1 + (2 + p) = 3 + p by omega] + · rw [show 1 + (2 + p) = 3 + p by omega] + simp only [List.append_assoc] + have h3 : SegRLs tm (hf ^ (q4 (3 + p))) [] + (tw ^ (3 + p) ++ jw ^ (1 + k) ++ [O, O] ++ u) + (zw ++ jw ^ (3 + p + k) ++ [O, O] ++ u) := by + have hfn := service_tail (jw ^ (1 + k) ++ [O, O] ++ u) (F_normalize (2 + p)) + refine SegRLs.congr hfn ?_ rfl ?_ ?_ + · rw [show 1 + (2 + p) = 3 + p by omega] + · rw [show 1 + (2 + p) = 3 + p by omega] + simp only [List.append_assoc] + · rw [show 3 + p + k = (2 + p) + (1 + k) by omega, pow_add_list jw (2 + p) (1 + k)] + simp only [List.append_assoc] + have h123 := h1.trans (h2.trans h3) + refine SegRLs.congr h123 ?_ rfl rfl rfl + exact pow_add3_eq hf (by unfold reset_count; omega) + +theorem reset_run (p j k : ℕ) (w v u : List Γ) (r : ListBlank Γ) + (H : SegRLs tm (hf ^ p) [] (zw ++ w) v) + (K : SegRLs tm (hg ^ j) [] v (jw ^ (1 + k) ++ [O, O] ++ u)) : + (P 0 ((tw ++ lw ^ (1 + p) ++ kw ++ tw ++ w) +> r)) [tm]⊢⁺ + (P 0 (tw +> (lw ^ (reset_count p j) +> (kw +> (tw +> (aw +> + (tw ^ (2 + p + k) +> ([I, O, I] +> (u +> r))))))))) := by + have h1 := P_service_zero (reset_count p j) + (tw ++ lw ^ (1 + p) ++ kw ++ tw ++ w) (zw ++ jw ^ (3 + p + k) ++ [O, O] ++ u) r + (reset_services p j k w v u H K) + have h2 := zero_return (reset_count p j) (2 + p + k) (u +> r) + have h2' : (P (reset_count p j) ((zw ++ jw ^ (3 + p + k) ++ [O, O] ++ u) +> r)) [tm]⊢⁺ + (P 0 (tw +> (lw ^ (reset_count p j) +> (kw +> (tw +> (aw +> + (tw ^ (2 + p + k) +> ([I, O, I] +> (u +> r))))))))) := by + refine stepPlus_congr h2 ?_ rfl + rw [show 1 + (2 + p + k) = 3 + p + k by omega] + simp only [append_assoc] + exact stepStar_stepPlus_trans h1 h2' + +@[irreducible] def p0 : ℕ := (7 * 4 ^ 13 + 2 * q4 11) * 4 + +theorem first_g : + SegRLs tm (hg ^ p0) [] (tw ^ 16) (tw ++ jw ^ 11 ++ tw ^ 2 ++ cw) := by + have H : SegRLs tm (hg ^ (7 * 4 ^ 2)) [] (tw ^ 4) (tw ^ 2 ++ cw) := + (G_Ts 2 7).concat G7 + have K : SegRLs tm (hg ^ (7 * 4 ^ 13 + 2 * q4 11)) [] (tw ^ 15) (jw ^ 11 ++ tw ^ 2 ++ cw) := by + have hd := G_digits 11 2 (7 * 4 ^ 2) (tw ^ 4) (tw ^ 2 ++ cw) jw H G2_T + refine SegRLs.congr hd ?_ rfl (by rfl) (by simp only [List.append_assoc]) + refine congrArg (hg ^ ·) ?_ + decide + have h_app := G_append (7 * 4 ^ 13 + 2 * q4 11) 0 (tw ^ 15) (jw ^ 11 ++ tw ^ 2 ++ cw) + (tw ++ (jw ^ 11 ++ tw ^ 2 ++ cw)) K (.nil (tw ++ (jw ^ 11 ++ tw ^ 2 ++ cw))) + refine SegRLs.congr h_app ?_ rfl (by rfl) (by simp only [List.append_assoc]) + unfold p0 + refine congrArg (hg ^ ·) ?_ + omega + +theorem m0_first : m0 = 1 + 2 * p0 := by + unfold m0 init_h p0 + decide + +@[irreducible] def a0 : ℕ := p0 - 4 + +theorem m0_odd : m0 = 9 + 2 * a0 := by + unfold m0 a0 p0 init_h + decide + +theorem first_supply_gen (p : ℕ) (hg_p : SegRLs tm (hg ^ p) [] (tw ^ 16) (tw ++ jw ^ 11 ++ tw ^ 2 ++ cw)) : + SegRLs tm (hf ^ (2 * p)) [] (zw ++ tw ^ 16) (zw ++ tw ++ jw ^ 11 ++ tw ^ 2 ++ cw) := by + have H : SegRLs tm (hf ^ 2) hg zw zw := + SegRLs.congr (F_Z.trans F_T) (by rfl) (by rfl) rfl rfl + have h_rep := (service_repeat p H).concat hg_p + refine SegRLs.congr h_rep ?_ rfl rfl (by simp only [List.append_assoc]) + rw [← pow_mul_list] + +theorem first_supply : + SegRLs tm (hf ^ (2 * p0)) [] (zw ++ tw ^ 16) (zw ++ tw ++ jw ^ 11 ++ tw ^ 2 ++ cw) := + first_supply_gen p0 first_g + +def reset_index (p j : ℕ) : ℕ := 7 + 40 * q4 p + 16 * j * 4 ^ p + +theorem reset_index_spec (p j : ℕ) : reset_count p j = 9 + 2 * reset_index p j := by + unfold reset_count reset_index + have hq3 := q4_add 3 p + have hp2 : 4 ^ (2 + p) = 16 * 4 ^ p := by rw [Nat.pow_add] + have hq3_val : q4 3 = 21 := rfl + have hp3_val : 4 ^ 3 = 64 := rfl + rw [hq3_val, hp3_val] at hq3 + rw [hq3, hp2] + ring + +local notation "b0" => reset_index (2 * p0) (short1_count 11) +def u1 : List Γ := zw ++ kw ++ tw ++ bw + +theorem recut1 (k : ℕ) : + aw ++ tw ^ (1 + k) ++ [I, O, I] ++ bw ++ rw ++ [I, O, I] = lw ++ tw ^ k ++ u1 := by + unfold u1 + rw [Nat.add_comm 1 k, pow_succ_list] + have hbw := bw_comm_T k + have haw : aw ++ tw ++ tw ^ k = lw ++ (bw ++ tw ^ k) := rfl + rw [← List.append_assoc aw tw (tw ^ k), haw, hbw] + simp only [List.append_assoc] + rfl + +theorem first_reset_gen (m p a : ℕ) (hm : m = 1 + 2 * p) (ha : m = 9 + 2 * a) + (h_anch : (init []) [tm]⊢* (P 0 (tw +> (lw ^ m +> (kw +> (tw ^ 17 +> ([I, O, I] +> default))))))) + (h_sup : SegRLs tm (hf ^ (2 * p)) [] (zw ++ tw ^ 16) (zw ++ tw ++ jw ^ 11 ++ tw ^ 2 ++ cw)) : + (init []) [tm]⊢* + (P 0 (tw +> (lw ^ (9 + 2 * reset_index (2 * p) (short1_count 11)) +> + (kw +> (tw +> (lw +> (tw ^ (23 + 2 * a) +> (u1 +> default)))))))) := by + have H : SegRLs tm (hf ^ (2 * p)) [] + (zw ++ (tw ^ 16 ++ [I, O, I])) + ((zw ++ tw ++ jw ^ 11 ++ tw ^ 2 ++ lw) ++ rw ++ [I, O, I]) := by + refine SegRLs.congr (service_tail [I, O, I] h_sup) rfl rfl ?_ ?_ + · simp only [List.append_assoc] + · simp only [List.append_assoc] + have K : SegRLs tm (hg ^ (short1_count 11)) [] + ((zw ++ tw ++ jw ^ 11 ++ tw ^ 2 ++ lw) ++ rw ++ [I, O, I]) + (jw ^ 15 ++ [O, O] ++ (bw ++ rw ++ [I, O, I])) := by + refine SegRLs.congr (service_tail (rw ++ [I, O, I]) (short1 11)) rfl rfl ?_ ?_ + · simp only [List.append_assoc] + · simp only [List.append_assoc]; rfl + have R := reset_run (2 * p) (short1_count 11) 14 + (tw ^ 16 ++ [I, O, I]) + ((zw ++ tw ++ jw ^ 11 ++ tw ^ 2 ++ lw) ++ rw ++ [I, O, I]) + (bw ++ rw ++ [I, O, I]) default H K + refine stepStar_trans h_anch ?_ + refine stepPlus_to_stepStar (stepPlus_congr R ?_ ?_) + · have h17 : (tw ^ 17 : List Γ) = tw ++ tw ^ 16 := rfl + rw [hm, h17] + simp only [append_assoc] + · have h_rec := recut1 (23 + 2 * a) + have h_rec' : (aw +> (tw ^ (1 + (23 + 2 * a)) +> ([I, O, I] +> ((bw ++ rw ++ [I, O, I]) +> (default : ListBlank Γ))))) = + (lw +> (tw ^ (23 + 2 * a) +> (u1 +> default))) := by + simpa only [append_assoc] using congrArg (· +> (default : ListBlank Γ)) h_rec + rw [reset_index_spec, show 2 + 2 * p + 14 = 1 + (23 + 2 * a) by omega] + simp only [append_assoc] at h_rec' ⊢ + rw [h_rec'] + +theorem first_reset : + (init []) [tm]⊢* + (P 0 (tw +> (lw ^ (9 + 2 * b0) +> + (kw +> (tw +> (lw +> (tw ^ (23 + 2 * a0) +> (u1 +> default)))))))) := + first_reset_gen m0 p0 a0 m0_first m0_odd init_anchor first_supply + +def ww : List Γ := rw ++ tw ++ bw +def v1 : List Γ := kw ++ kw ++ tw ++ bw +def w1 : List Γ := cw ++ tw ++ bw +def tail1 : List Γ := kw ^ 11 ++ lw ++ mw ++ ww +@[irreducible] def j1 : ℕ := 4 * (4 * (3 * 4 ^ 12 + q4 12) + 3) + 1 + +theorem second_g : SegRLs tm (hg ^ j1) [] (tw ^ 15 ++ w1) (kw ++ cw ++ tail1) := by + have H : SegRLs tm (hg ^ 3) [] (tw ++ w1) (lw ++ mw ++ ww) := by + have h := G3_T.concat (service_tail (rw ++ tw ++ bw) F_L) + exact SegRLs.congr h rfl rfl (by unfold w1; simp only [List.append_assoc]) + (by unfold ww; simp only [List.append_assoc]) + have K : SegRLs tm (hg ^ (3 * 4 ^ 12 + 1 * q4 12)) [] (tw ^ 12 ++ (tw ++ w1)) + (kw ^ 12 ++ (lw ++ mw ++ ww)) := + G_digits 12 1 3 (tw ++ w1) (lw ++ mw ++ ww) kw H G_T + have K' : SegRLs tm (hg ^ (3 * 4 ^ 12 + q4 12)) [] (tw ^ 13 ++ w1) + (kw ^ 12 ++ lw ++ mw ++ ww) := by + refine SegRLs.congr K (by rw [Nat.one_mul]) rfl ?_ (by simp only [List.append_assoc]) + have h13 : (tw ^ 13 : List Γ) = tw ^ 12 ++ tw := rfl + rw [h13, List.append_assoc] + have L_step : SegRLs tm (hg ^ 3) [] (tw ++ (kw ^ 12 ++ lw ++ mw ++ ww)) (cw ++ tail1) := by + have h := G3_T.concat (service_tail (kw ^ 11 ++ lw ++ mw ++ ww) F_K) + refine SegRLs.congr h rfl rfl ?_ (by unfold tail1; simp only [List.append_assoc]) + have h12 : (kw ^ 12 : List Γ) = kw ++ kw ^ 11 := rfl + rw [h12] + simp only [List.append_assoc] + have L : SegRLs tm (hg ^ (4 * (3 * 4 ^ 12 + q4 12) + 3)) [] (tw ^ 14 ++ w1) (cw ++ tail1) := by + have h := G_append (3 * 4 ^ 12 + q4 12) 3 (tw ^ 13 ++ w1) (kw ^ 12 ++ lw ++ mw ++ ww) + (cw ++ tail1) K' L_step + refine SegRLs.congr h rfl rfl ?_ rfl + have h14 : (tw ^ 14 : List Γ) = tw ++ tw ^ 13 := rfl + rw [h14, List.append_assoc] + have M := G_append (4 * (3 * 4 ^ 12 + q4 12) + 3) 1 (tw ^ 14 ++ w1) (cw ++ tail1) + (kw ++ (cw ++ tail1)) L (service_tail (cw ++ tail1) G_T) + refine SegRLs.congr M (by unfold j1; rfl) rfl ?_ (by simp only [List.append_assoc]) + have h15 : (tw ^ 15 : List Γ) = tw ++ tw ^ 14 := rfl + rw [h15, List.append_assoc] + +theorem second_supply (a : ℕ) : + SegRLs tm (hf ^ (supply_count (7 + 2 * a) (23 + 2 * a) j1)) [] + (zw ++ lw ++ tw ^ (23 + 2 * a) ++ u1) + (zw ++ jw ++ lw ++ mw ^ (7 + 2 * a) ++ rw ++ cw ++ tail1) := by + have hH : SegRLs tm hh [] u1 v1 := service_tail (kw ++ tw ++ bw) H_Z + have hK : SegRLs tm (hg ^ 2) [] v1 w1 := + SegRLs.congr (service_tail (tw ++ bw) G2_KK) rfl rfl (by unfold v1; simp only [List.append_assoc]) + (by unfold w1; simp only [List.append_assoc]) + have hL : SegRLs tm (hg ^ j1 ++ hf) [] (tw ^ 15 ++ w1) (rw ++ cw ++ tail1) := by + have h := second_g.trans (service_tail (cw ++ tail1) F_K) + exact SegRLs.congr h rfl rfl rfl (by simp only [List.append_assoc]) + have h := reset_supply (7 + 2 * a) (23 + 2 * a) 15 j1 u1 v1 w1 (rw ++ cw ++ tail1) + (by omega) hH hK hL + exact SegRLs.congr h rfl rfl rfl (by simp only [List.append_assoc]) + +theorem HGH_C : SegRLs tm (hh ++ hg ++ hh) [] (rw ++ cw) (zw ++ tw ++ jw) := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem short2 : SegRLs tm (hg ^ 44) [] (zw ++ tw ++ jw ++ kw) (jw ^ 3 ++ rw) := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +def clean2 (a : ℕ) : ℕ := 2 + 8 * q16 (5 + a) + 44 * 4 ^ (10 + 2 * a) + 2 * q4 (10 + 2 * a) +def v2 : List Γ := aw ++ kw ^ 10 ++ lw ++ mw ++ ww +def u2 : List Γ := zw ++ [I, I, O] ++ kw ^ 10 ++ lw ++ mw ++ ww + +theorem second_clean (a : ℕ) : + SegRLs tm (hg ^ (clean2 a)) [] + (zw ++ jw ++ lw ++ mw ^ (7 + 2 * a) ++ rw ++ cw ++ tail1) + (jw ^ (13 + 2 * a) ++ [O, O] ++ v2) := by + have h1_raw := (M_ODD (3 + a)).concat (service_tail tail1 HGH_C) + have h1 : SegRLs tm (hg ^ (2 + 8 * q16 (5 + a))) [] + (zw ++ jw ++ lw ++ mw ^ (7 + 2 * a) ++ rw ++ cw ++ tail1) + (tw ^ (10 + 2 * a) ++ zw ++ tw ++ jw ++ tail1) := by + refine SegRLs.congr h1_raw ?_ rfl ?_ ?_ + · rw [show 2 + (3 + a) = 5 + a by omega] + · rw [show 1 + 2 * (3 + a) = 7 + 2 * a by omega] + simp only [List.append_assoc] + · rw [show 4 + 2 * (3 + a) = 10 + 2 * a by omega] + simp only [List.append_assoc] + have h2_raw := (G_Ts (10 + 2 * a) 44).concat (service_tail (kw ^ 10 ++ lw ++ mw ++ ww) short2) + have h2 : SegRLs tm (hg ^ (44 * 4 ^ (10 + 2 * a))) [] + (tw ^ (10 + 2 * a) ++ zw ++ tw ++ jw ++ tail1) + (tw ^ (10 + 2 * a) ++ jw ^ 3 ++ [O, O] ++ v2) := by + refine SegRLs.congr h2_raw rfl rfl ?_ ?_ + · unfold tail1 + have h11 : (kw ^ 11 : List Γ) = kw ++ kw ^ 10 := rfl + rw [h11] + simp only [List.append_assoc] + · unfold v2 + simp only [List.append_assoc] + rfl + have h3_raw := service_tail (jw ^ 3 ++ [O, O] ++ v2) (G_normalize (10 + 2 * a)) + have h3 : SegRLs tm (hg ^ (2 * q4 (10 + 2 * a))) [] + (tw ^ (10 + 2 * a) ++ jw ^ 3 ++ [O, O] ++ v2) + (jw ^ (13 + 2 * a) ++ [O, O] ++ v2) := by + refine SegRLs.congr h3_raw rfl rfl (by simp only [List.append_assoc]) ?_ + rw [show 13 + 2 * a = (10 + 2 * a) + 3 by omega, pow_add_list jw (10 + 2 * a) 3] + simp only [List.append_assoc] + have h123 := h1.trans (h2.trans h3) + refine SegRLs.congr h123 ?_ rfl rfl rfl + exact pow_add3_eq hg (by unfold clean2; omega) + +theorem recut2 (k : ℕ) : aw ++ tw ^ (1 + k) ++ [I, O, I] ++ v2 = lw ++ tw ^ k ++ u2 := by + unfold v2 u2 + rw [Nat.add_comm 1 k, pow_succ_list] + have hbw := bw_comm_T k + have haw : aw ++ tw ++ tw ^ k = lw ++ (bw ++ tw ^ k) := rfl + rw [← List.append_assoc aw tw (tw ^ k), haw, hbw] + simp only [List.append_assoc] + rfl + +theorem first_constants : 72 + 128 * short1_count 11 = 8 * q4 16 + 4 * 4 ^ 17 + 32 * j1 := by + unfold short1_count j1 + decide + +theorem first_budget_algebra (qn q16_v p17 s11 j1_v xn : ℕ) + (hc : 72 + 128 * s11 = 8 * q16_v + 4 * p17 + 32 * j1_v) + (hk : 1 + 3 * qn = xn) : + 2 + 16 * (qn + xn) + 2 * s11 * (xn * 64) + (qn + xn * 85) = + 1 + (8 * (qn + xn * q16_v) + 1 + (4 * (xn * p17) + (29 + 96 * qn + 2 * j1_v * (xn * 16)))) := by + nlinarith + +theorem first_budget (n : ℕ) : + reset_count (1 + n) (short1_count 11) = 1 + supply_count n (16 + n) j1 := by + unfold reset_count supply_count + have h1 : 2 + (1 + n) = n + 3 := by omega + have h2 : 3 + (1 + n) = n + 4 := by omega + have h3 : 1 + (16 + n) = n + 17 := by omega + have h4 : 2 + n = n + 2 := by omega + have h5 : 1 + n = n + 1 := by omega + have h6 : 16 + n = n + 16 := by omega + rw [h1, h2, h3, h4, h5, h6] + rw [q4_add n 1, q4_add n 4, q4_add n 16] + rw [Nat.pow_add 4 n 3, Nat.pow_add 4 n 17, Nat.pow_add 4 n 2] + have hq1 : q4 1 = 1 := rfl + have hq4 : q4 4 = 85 := rfl + have hp3 : 4 ^ 3 = 64 := rfl + have hp2 : 4 ^ 2 = 16 := rfl + rw [hq1, Nat.mul_one, hq4, hp3, hp2] + exact first_budget_algebra (q4 n) (q4 16) (4 ^ 17) (short1_count 11) j1 (4 ^ n) + first_constants (q4_pow n) + +theorem first_supply_index_gen (m p a : ℕ) (hm : m = 1 + 2 * p) (ha : m = 9 + 2 * a) : + supply_count (7 + 2 * a) (23 + 2 * a) j1 = 8 + 2 * reset_index (2 * p) (short1_count 11) := by + have H := first_budget (7 + 2 * a) + rw [show 1 + (7 + 2 * a) = 2 * p by omega, + reset_index_spec (2 * p) (short1_count 11), + show 16 + (7 + 2 * a) = 23 + 2 * a by omega] at H + omega + +theorem first_supply_index : supply_count (7 + 2 * a0) (23 + 2 * a0) j1 = 8 + 2 * b0 := + first_supply_index_gen m0 p0 a0 m0_first m0_odd + +local notation "c0_index" => reset_index (8 + 2 * b0) (clean2 a0) + +theorem second_run (a b : ℕ) (E : supply_count (7 + 2 * a) (23 + 2 * a) j1 = 8 + 2 * b) : + (P 0 (tw +> (lw ^ (9 + 2 * b) +> (kw +> (tw +> (lw +> (tw ^ (23 + 2 * a) +> (u1 +> default)))))))) [tm]⊢* + (P 0 (tw +> (lw ^ (9 + 2 * reset_index (8 + 2 * b) (clean2 a)) +> + (kw +> (tw +> (lw +> (tw ^ (21 + 2 * a + 2 * b) +> (u2 +> default)))))))) := by + have H : SegRLs tm (hf ^ (8 + 2 * b)) [] + (zw ++ (lw ++ tw ^ (23 + 2 * a) ++ u1)) + (zw ++ jw ++ lw ++ mw ^ (7 + 2 * a) ++ rw ++ cw ++ tail1) := + SegRLs.congr (second_supply a) (by rw [E]) rfl (by simp only [List.append_assoc]) rfl + have K : SegRLs tm (hg ^ (clean2 a)) [] + (zw ++ jw ++ lw ++ mw ^ (7 + 2 * a) ++ rw ++ cw ++ tail1) + (jw ^ (1 + (12 + 2 * a)) ++ [O, O] ++ v2) := + SegRLs.congr (second_clean a) rfl rfl rfl + (by rw [show 13 + 2 * a = 1 + (12 + 2 * a) by omega]) + have R := reset_run (8 + 2 * b) (clean2 a) (12 + 2 * a) + (lw ++ tw ^ (23 + 2 * a) ++ u1) + (zw ++ jw ++ lw ++ mw ^ (7 + 2 * a) ++ rw ++ cw ++ tail1) + v2 default H K + refine stepPlus_to_stepStar (stepPlus_congr R ?_ ?_) + · rw [show 1 + (8 + 2 * b) = 9 + 2 * b by omega] + simp only [append_assoc] + · have h_rec := recut2 (21 + 2 * a + 2 * b) + have h_rec' : (aw +> (tw ^ (1 + (21 + 2 * a + 2 * b)) +> ([I, O, I] +> (v2 +> (default : ListBlank Γ))))) = + (lw +> (tw ^ (21 + 2 * a + 2 * b) +> (u2 +> default))) := by + simpa only [append_assoc] using congrArg (· +> (default : ListBlank Γ)) h_rec + rw [reset_index_spec, show 2 + (8 + 2 * b) + (12 + 2 * a) = 1 + (21 + 2 * a + 2 * b) by omega, h_rec'] + +theorem second_reset : + (init []) [tm]⊢* + (P 0 (tw +> (lw ^ (9 + 2 * c0_index) +> + (kw +> (tw +> (lw +> (tw ^ (21 + 2 * a0 + 2 * b0) +> (u2 +> default)))))))) := + stepStar_trans first_reset (second_run a0 b0 first_supply_index) + +def pair_count (r : ℕ) : ℕ := 125 * 16 ^ r + 13 * q16 r + +theorem pair_digits (r : ℕ) : + SegRLs tm (hg ^ (pair_count r)) [] (tw ^ (4 + 2 * r)) (kw ++ cw ^ r ++ dw) := by + induction r with + | zero => + have h0 : pair_count 0 = 125 := rfl + exact SegRLs.congr G125 (by rw [h0]) rfl rfl rfl + | succ r ih => + have E : pair_count (r + 1) = 16 * pair_count r + 13 := by + unfold pair_count + dsimp [q16] + rw [Nat.pow_succ] + ring + have h1 := (G_Ts 2 (pair_count r)).concat ih + have h2 := service_tail (cw ^ r ++ dw) G_pair13 + have h12 := SegRLs.trans_eq h1 h2 (by simp only [List.append_assoc]) + refine SegRLs.congr h12 ?_ rfl ?_ ?_ + · exact pow_add2_eq hg (by rw [E]; omega) + · rw [← pow_add_list] + exact congrArg (tw ^ ·) (by omega) + · rw [pow_succ_list cw r] + simp only [List.append_assoc] + +def j2 (r : ℕ) : ℕ := 64 * pair_count r + 61 + +theorem third_g (r : ℕ) : + SegRLs tm (hg ^ (j2 r)) [] (tw ^ (7 + 2 * r)) (kw ++ dw ++ cw ^ r ++ dw) := by + have h1 := (G_Ts 3 (pair_count r)).concat (pair_digits r) + have h2 := service_tail (cw ^ r ++ dw) G_last61 + have h12 := SegRLs.trans_eq h1 h2 (by simp only [List.append_assoc]) + refine SegRLs.congr h12 ?_ rfl ?_ rfl + · exact pow_add2_eq hg (by unfold j2; omega) + · rw [← pow_add_list] + exact congrArg (tw ^ ·) (by omega) + +def v3 : List Γ := kw ++ [I, I, O] ++ kw ^ 10 ++ lw ++ mw ++ ww +def w3 : List Γ := lw ++ [O, I, O] ++ kw ^ 10 ++ lw ++ mw ++ ww +def tail3 (a : ℕ) : List Γ := cw ^ (3 + a) ++ dw ++ w3 + +theorem third_H : SegRLs tm hh [] u2 v3 := by + unfold u2 v3 + exact SegRLs.congr (service_tail ([I, I, O] ++ kw ^ 10 ++ lw ++ mw ++ ww) H_Z) + rfl rfl (by simp only [List.append_assoc]) (by simp only [List.append_assoc]) + +theorem third_G2 : SegRLs tm (hg ^ 2) [] v3 w3 := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem third_supply (a b : ℕ) : + SegRLs tm (hf ^ (supply_count (7 + 2 * b) (21 + 2 * a + 2 * b) (j2 (3 + a)))) [] + (zw ++ lw ++ tw ^ (21 + 2 * a + 2 * b) ++ u2) + (zw ++ jw ++ lw ++ mw ^ (7 + 2 * b) ++ rw ++ dw ++ tail3 a) := by + have h1 : SegRLs tm (hg ^ (j2 (3 + a))) [] (tw ^ (7 + 2 * (3 + a)) ++ w3) (kw ++ dw ++ tail3 a) := + SegRLs.congr (service_tail w3 (third_g (3 + a))) rfl rfl rfl + (by unfold tail3; simp only [List.append_assoc]) + have h2 := service_tail (dw ++ tail3 a) F_K + have hL : SegRLs tm (hg ^ (j2 (3 + a)) ++ hf) [] (tw ^ (7 + 2 * (3 + a)) ++ w3) (rw ++ dw ++ tail3 a) := + SegRLs.congr (SegRLs.trans_eq h1 h2 (by simp only [List.append_assoc])) + rfl rfl rfl (by simp only [List.append_assoc]) + have h := reset_supply (7 + 2 * b) (21 + 2 * a + 2 * b) (7 + 2 * (3 + a)) (j2 (3 + a)) + u2 v3 w3 (rw ++ dw ++ tail3 a) (by omega) third_H third_G2 hL + exact SegRLs.congr h rfl rfl rfl (by simp only [List.append_assoc]) + +def clean3 (b : ℕ) : ℕ := 2 + 8 * q16 (5 + b) + 2892 * 4 ^ (10 + 2 * b) + 2 * q4 (10 + 2 * b) +def v4 (a : ℕ) : List Γ := bw ++ rw ++ cw ^ (1 + a) ++ dw ++ w3 + +theorem third_clean (a b : ℕ) : + SegRLs tm (hg ^ (clean3 b)) [] + (zw ++ jw ++ lw ++ mw ^ (7 + 2 * b) ++ rw ++ dw ++ tail3 a) + (jw ^ (16 + 2 * b) ++ [O, O] ++ v4 a) := by + have h1_raw := service_tail (tail3 a) (M_block (3 + b)) + have h1 : SegRLs tm (hg ^ (2 + 8 * q16 (5 + b))) [] + (zw ++ jw ++ lw ++ mw ^ (7 + 2 * b) ++ rw ++ dw ++ tail3 a) + (tw ^ (10 + 2 * b) ++ zw ++ tw ^ 2 ++ jw ++ tail3 a) := by + refine SegRLs.congr h1_raw ?_ rfl ?_ ?_ + · rw [show 2 + (3 + b) = 5 + b by omega] + · rw [show 1 + 2 * (3 + b) = 7 + 2 * b by omega] + · rw [show 4 + 2 * (3 + b) = 10 + 2 * b by omega] + have h2_raw := (G_Ts (10 + 2 * b) 2892).concat (service_tail (dw ++ w3) (PACKET (1 + a))) + have h2 : SegRLs tm (hg ^ (2892 * 4 ^ (10 + 2 * b))) [] + (tw ^ (10 + 2 * b) ++ zw ++ tw ^ 2 ++ jw ++ tail3 a) + (tw ^ (10 + 2 * b) ++ jw ^ 6 ++ [O, O] ++ v4 a) := by + refine SegRLs.congr h2_raw rfl rfl ?_ ?_ + · unfold tail3 + rw [show 3 + a = 2 + (1 + a) by omega] + simp only [List.append_assoc] + · unfold v4 + simp only [List.append_assoc] + rfl + have h3_raw := service_tail (jw ^ 6 ++ [O, O] ++ v4 a) (G_normalize (10 + 2 * b)) + have h3 : SegRLs tm (hg ^ (2 * q4 (10 + 2 * b))) [] + (tw ^ (10 + 2 * b) ++ jw ^ 6 ++ [O, O] ++ v4 a) + (jw ^ (16 + 2 * b) ++ [O, O] ++ v4 a) := by + refine SegRLs.congr h3_raw rfl rfl (by simp only [List.append_assoc]) ?_ + rw [show 16 + 2 * b = (10 + 2 * b) + 6 by omega, pow_add_list jw (10 + 2 * b) 6] + simp only [List.append_assoc] + have h123 := h1.trans (h2.trans h3) + refine SegRLs.congr h123 ?_ rfl rfl rfl + exact pow_add3_eq hg (by unfold clean3; omega) + +def v5 (a : ℕ) : List Γ := [I] ++ rw ++ cw ^ a ++ dw ++ w3 + +theorem recut3 (a k : ℕ) : + aw ++ tw ^ (1 + k) ++ [I, O, I] ++ v4 a = lw ++ tw ^ k ++ zw ++ kw ++ tw ++ [O, O] ++ v5 a := by + unfold v4 v5 + rw [Nat.add_comm 1 k, pow_succ_list, Nat.add_comm 1 a, pow_succ_list] + have hbw := bw_comm_T k + have haw : aw ++ tw ++ tw ^ k = lw ++ (bw ++ tw ^ k) := rfl + rw [← List.append_assoc aw tw (tw ^ k), haw, hbw] + simp only [List.append_assoc] + rfl + +theorem reset_supply_balance_algebra (qn qt j k xn xt : ℕ) + (h1 : 9 + 16 * j = qt + 2 * xt + 4 * k) + (h2 : 1 + 3 * qn = xn) : + 2 + 16 * (qn + xn) + 2 * j * (xn * 64) + (qn + xn * 85) = + 1 + (8 * (qn + xn * qt) + 1 + (4 * (xn * (4 * xt)) + (29 + 96 * qn + 2 * k * (xn * 16)))) := by + nlinarith + +theorem reset_supply_balance (n t j k : ℕ) (H : 9 + 16 * j = q4 t + 2 * 4 ^ t + 4 * k) : + reset_count (1 + n) j = 1 + supply_count n (n + t) k := by + unfold reset_count supply_count + have h1 : 2 + (1 + n) = n + 3 := by omega + have h2 : 3 + (1 + n) = n + 4 := by omega + have h3 : 1 + (n + t) = n + (1 + t) := by omega + have h4 : 2 + n = n + 2 := by omega + have h5 : 1 + n = n + 1 := by omega + rw [h1, h2, h3, h4, h5] + rw [q4_add n 1, q4_add n 4, q4_add n t] + rw [Nat.pow_add 4 n 3, Nat.pow_add 4 n (1 + t), Nat.pow_add 4 n 2] + have hq1 : q4 1 = 1 := rfl + have hq4 : q4 4 = 85 := rfl + have hp3 : 4 ^ 3 = 64 := rfl + have hp2 : 4 ^ 2 = 16 := rfl + have hp1t : 4 ^ (1 + t) = 4 * 4 ^ t := by rw [Nat.pow_add] + rw [hq1, Nat.mul_one, hq4, hp3, hp2, hp1t] + exact reset_supply_balance_algebra (q4 n) (q4 t) j k (4 ^ n) (4 ^ t) H (q4_pow n) + +theorem bridge_constants_algebra (q10 q14 q16_3 x : ℕ) + (H1 : 1 + 3 * q10 = 256 * x) + (H2 : 1 + 3 * q14 = 65536 * x) + (H3 : 1 + 15 * q16_3 = x) : + 9 + 16 * (2 + 8 * (1 + 16 * (1 + 16 * q16_3)) + 44 * (256 * x) + 2 * q10) = + q14 + 2 * (65536 * x) + 4 * (64 * (125 * x + 13 * q16_3) + 61) := by + omega + +theorem bridge_constants (a : ℕ) : + 9 + 16 * clean2 a = q4 (14 + 2 * a) + 2 * 4 ^ (14 + 2 * a) + 4 * j2 (3 + a) := by + have E1 : 4 ^ (10 + 2 * a) = 256 * 16 ^ (3 + a) := by + rw [show 10 + 2 * a = 4 + 2 * (3 + a) by omega, Nat.pow_add, pow4_double] + have E2 : 4 ^ (14 + 2 * a) = 65536 * 16 ^ (3 + a) := by + rw [show 14 + 2 * a = 4 + (10 + 2 * a) by omega, Nat.pow_add, E1] + ring + have H1 := q4_pow (10 + 2 * a); rw [E1] at H1 + have H2 := q4_pow (14 + 2 * a); rw [E2] at H2 + have H3 := q16_pow (3 + a) + have hq16 : q16 (5 + a) = 1 + 16 * (1 + 16 * q16 (3 + a)) := by + rw [show 5 + a = (3 + a) + 1 + 1 by omega] + rfl + unfold clean2 j2 pair_count + rw [E1, E2, hq16] + exact bridge_constants_algebra (q4 (10 + 2 * a)) (q4 (14 + 2 * a)) (q16 (3 + a)) (16 ^ (3 + a)) + H1 H2 H3 + +theorem bridge_budget (a b : ℕ) : + reset_count (8 + 2 * b) (clean2 a) = + 1 + supply_count (7 + 2 * b) (21 + 2 * a + 2 * b) (j2 (3 + a)) := by + have h := reset_supply_balance (7 + 2 * b) (14 + 2 * a) (clean2 a) (j2 (3 + a)) (bridge_constants a) + rwa [show 1 + (7 + 2 * b) = 8 + 2 * b by omega, + show 7 + 2 * b + (14 + 2 * a) = 21 + 2 * a + 2 * b by omega] at h + +theorem third_supply_index_gen (a b : ℕ) : + supply_count (7 + 2 * b) (21 + 2 * a + 2 * b) (j2 (3 + a)) = + 8 + 2 * reset_index (8 + 2 * b) (clean2 a) := by + have H := bridge_budget a b + rw [reset_index_spec (8 + 2 * b) (clean2 a)] at H + omega + +theorem third_supply_index : + supply_count (7 + 2 * b0) (21 + 2 * a0 + 2 * b0) (j2 (3 + a0)) = 8 + 2 * c0_index := + third_supply_index_gen a0 b0 + +theorem final_budget (a b : ℕ) : reset_count (8 + 2 * b) (clean3 a) = 9 + 2 * e a b := by + rw [← tower_budget a b] + unfold reset_count clean3 + have hp : 4 ^ (20 + 2 * a + 2 * b) = 4 ^ (10 + 2 * a) * 4 ^ (10 + 2 * b) := by + rw [show 20 + 2 * a + 2 * b = (10 + 2 * a) + (10 + 2 * b) by omega, Nat.pow_add] + have hq : q4 (21 + 2 * a + 2 * b) = q4 (11 + 2 * b) + 4 ^ (11 + 2 * b) * q4 (10 + 2 * a) := by + rw [show 21 + 2 * a + 2 * b = (11 + 2 * b) + (10 + 2 * a) by omega, q4_add] + have hp11 : 4 ^ (11 + 2 * b) = 4 * 4 ^ (10 + 2 * b) := by + rw [show 11 + 2 * b = 1 + (10 + 2 * b) by omega, Nat.pow_add] + have h28 : 2 + (8 + 2 * b) = 10 + 2 * b := by omega + have h38 : 3 + (8 + 2 * b) = 11 + 2 * b := by omega + rw [h28, h38, hp, hq, hp11] + ring + +theorem third_run (a b c : ℕ) + (E : supply_count (7 + 2 * b) (21 + 2 * a + 2 * b) (j2 (3 + a)) = 8 + 2 * c) : + (P 0 (tw +> (lw ^ (9 + 2 * c) +> (kw +> (tw +> (lw +> + (tw ^ (21 + 2 * a + 2 * b) +> (u2 +> default)))))))) [tm]⊢* + (Inv b c (v5 a +> default)) := by + have H : SegRLs tm (hf ^ (8 + 2 * c)) [] + (zw ++ (lw ++ tw ^ (21 + 2 * a + 2 * b) ++ u2)) + (zw ++ jw ++ lw ++ mw ^ (7 + 2 * b) ++ rw ++ dw ++ tail3 a) := + SegRLs.congr (third_supply a b) (by rw [E]) rfl (by simp only [List.append_assoc]) rfl + have K : SegRLs tm (hg ^ (clean3 b)) [] + (zw ++ jw ++ lw ++ mw ^ (7 + 2 * b) ++ rw ++ dw ++ tail3 a) + (jw ^ (1 + (15 + 2 * b)) ++ [O, O] ++ v4 a) := + SegRLs.congr (third_clean a b) rfl rfl rfl + (by rw [show 16 + 2 * b = 1 + (15 + 2 * b) by omega]) + have R := reset_run (8 + 2 * c) (clean3 b) (15 + 2 * b) + (lw ++ tw ^ (21 + 2 * a + 2 * b) ++ u2) + (zw ++ jw ++ lw ++ mw ^ (7 + 2 * b) ++ rw ++ dw ++ tail3 a) + (v4 a) default H K + refine stepPlus_to_stepStar (stepPlus_congr R ?_ ?_) + · rw [show 1 + (8 + 2 * c) = 9 + 2 * c by omega] + simp only [append_assoc] + · have h_rec := recut3 a (24 + 2 * b + 2 * c) + have h_rec' : (aw +> (tw ^ (1 + (24 + 2 * b + 2 * c)) +> ([I, O, I] +> (v4 a +> (default : ListBlank Γ))))) = + (lw +> (tw ^ (24 + 2 * b + 2 * c) +> (zw +> (kw +> (tw +> ([O, O] +> (v5 a +> default))))))) := by + simpa only [append_assoc] using congrArg (· +> (default : ListBlank Γ)) h_rec + unfold Inv family_word + rw [final_budget, show 2 + (8 + 2 * c) + (15 + 2 * b) = 1 + (24 + 2 * b + 2 * c) by omega] + simp only [append_assoc] at h_rec' ⊢ + rw [h_rec'] + +theorem init_family : (init []) [tm]⊢* (Inv b0 c0_index (v5 a0 +> default)) := + stepStar_trans second_reset (third_run a0 b0 c0_index third_supply_index) + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + refine Counter.does_not_halt_of_invariant + (Inv := fun c => ∃ a b u, c = Inv a b u) + ⟨Inv b0 c0_index (v5 a0 +> default), init_family, b0, c0_index, v5 a0 +> default, rfl⟩ ?_ + rintro _ ⟨a, b, u, rfl⟩ + exact ⟨Inv b (e a b) (family_prefix a +> u), I_step a b u, b, e a b, family_prefix a +> u, rfl⟩ + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1LB_1RC0LA_1LD1RF_1RB0LE_HHH1LA_1RD0RD diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LC_1LA1RB_1LD0LA_1RE0RF_HHH1RD_0RE1RB.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LC_1LA1RB_1LD0LA_1RE0RF_HHH1RD_0RE1RB.lean new file mode 100644 index 00000000..5d4879ac --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LC_1LA1RB_1LD0LA_1RE0RF_HHH1RD_0RE1RB.lean @@ -0,0 +1,1891 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter + +open Mathlib Relation Nat Turing BusyBeaver SixState + +@[expose] public section + +namespace BusyBeaver.M_1RB1LC_1LA1RB_1LD0LA_1RE0RF_HHH1RD_0RE1RB + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LC_1LA1RB_1LD0LA_1RE0RF_HHH1RD_0RE1RB" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end BusyBeaver.M_1RB1LC_1LA1RB_1LD0LA_1RE0RF_HHH1RD_0RE1RB + +end + +namespace BusyBeaver.M_1RB1LC_1LA1RB_1LD0LA_1RE0RF_HHH1RD_0RE1RB + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + + +variable {Γ' Λ' α β γ : Type*} [Inhabited Γ'] [Inhabited Λ'] +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +local notation "TapeBlank" => ListBlank (Fin 2) +local notation "FinWord" => List (Fin 2) +theorem lem_00 (m r : Nat) (hr : r <= m) : + ((m - r) * (m - r)) % m = (r * r) % m := by + set b := m - r + have h1 : b * b + m * r = r * r + m * b := by + have hm : r + b = m := by omega + calc b * b + m * r = b * b + (r + b) * r := by rw [hm] + _ = r * r + (r + b) * b := by ring + _ = r * r + m * b := by rw [hm] + have h2 := congrArg (· % m) h1 + simpa [Nat.add_mul_mod_self_left] using h2 +theorem lem_01 (m y : Nat) (hm : 0 < m) : + ∃ r ≤ m / 2, (r * r) % m = (y * y) % m := by + have hmod : (y * y) % m = ((y % m) * (y % m)) % m := by rw [<- Nat.mul_mod] + have hlt : y % m < m := Nat.mod_lt y hm + rcases (by omega : y % m <= m / 2 \/ m - y % m <= m / 2) with hle | hle + · exact ⟨y % m, hle, hmod.symm⟩ + · refine ⟨m - y % m, hle, ?_⟩ + rw [lem_00 m (y % m) (by omega), hmod] +def sNat (n : Nat) (f : Nat -> α) : α := + Nat.casesOn n (f 0) (fun m => f (m + 1)) +@[simp] theorem sNat_eq (n : Nat) (f : Nat -> α) : sNat n f = f n := by + cases n <;> rfl +inductive BitTrie where + | leaf (b : Bool) + | node (l r : BitTrie) +def lem_02 : BitTrie -> Nat -> Bool + | .leaf b, _ => b + | .node l r, n => if n % 2 == 0 then sNat (n / 2) (lem_02 l) else sNat (n / 2) (lem_02 r) +def lem_03 (l r : BitTrie) : BitTrie := + match l with + | .leaf false => + match r with + | .leaf false => .leaf false + | .leaf true => .node (.leaf false) (.leaf true) + | .node l2 r2 => .node (.leaf false) (.node l2 r2) + | .leaf true => + match r with + | .leaf b2 => .node (.leaf true) (.leaf b2) + | .node l2 r2 => .node (.leaf true) (.node l2 r2) + | .node l1 r1 => + match r with + | .leaf b2 => .node (.node l1 r1) (.leaf b2) + | .node l2 r2 => .node (.node l1 r1) (.node l2 r2) +theorem lem_04 (l r : BitTrie) (n : Nat) : + lem_02 (lem_03 l r) n = (if n % 2 == 0 then lem_02 l (n / 2) else lem_02 r (n / 2)) := by + cases l with + | leaf b1 => + cases b1 <;> cases r with + | leaf b2 => cases b2 <;> simp [lem_03, lem_02] + | node l2 r2 => simp [lem_03, lem_02] + | node l1 r1 => + cases r with + | leaf b2 => simp [lem_03, lem_02] + | node l2 r2 => simp [lem_03, lem_02] +def lem_05 : Nat -> Nat -> BitTrie + | 0, _ => .leaf true + | d + 1, n => + if n % 2 == 0 then sNat (n / 2) (fun n2 => lem_03 (lem_05 d n2) (.leaf false)) + else sNat (n / 2) (fun n2 => lem_03 (.leaf false) (lem_05 d n2)) +theorem lem_06 (d n : Nat) : + lem_02 (lem_05 d n) n = true := by + induction d generalizing n with + | zero => rfl + | succ d ih => + simp only [lem_05, sNat_eq] + split_ifs with h <;> simp only [lem_04, h, ↓reduceIte, Bool.false_eq_true, ih] +def lem_07 : BitTrie -> BitTrie -> BitTrie + | .leaf true, _ => .leaf true + | _, .leaf true => .leaf true + | .leaf false, t => t + | t, .leaf false => t + | .node l1 r1, .node l2 r2 => lem_03 (lem_07 l1 l2) (lem_07 r1 r2) +theorem lem_08 (t1 t2 : BitTrie) (n : Nat) : + lem_02 (lem_07 t1 t2) n = (lem_02 t1 n || lem_02 t2 n) := by + induction t1 generalizing t2 n with + | leaf b1 => + cases b1 <;> cases t2 with + | leaf b2 => cases b2 <;> rfl + | node l2 r2 => rfl + | node l1 r1 ih1 ih2 => + cases t2 with + | leaf b2 => + cases b2 + · simp [lem_07, lem_02, Bool.or_false] + · simp [lem_07, lem_02] + | node l2 r2 => + simp only [lem_07, lem_04, lem_02, sNat_eq] + split_ifs with h + · exact ih1 l2 (n / 2) + · exact ih2 r2 (n / 2) +def lem_09 : Nat -> Nat -> Nat -> BitTrie + | 0, m, x => sNat ((x * x) % m) (lem_05 11) + | k + 1, m, x => sNat (2 * x) (fun x0 => sNat (2 * x + 1) (fun x1 => + lem_07 (lem_09 k m x0) (lem_09 k m x1))) +theorem lem_0a (k m x y : Nat) (hy : y < 2 ^ k) : + lem_02 (lem_09 k m x) (((x * 2 ^ k + y) * (x * 2 ^ k + y)) % m) = true := by + induction k generalizing x y with + | zero => + have hy0 : y = 0 := by omega + subst hy0 + simp only [Nat.pow_zero, Nat.mul_one, Nat.add_zero, lem_09, sNat_eq] + exact lem_06 11 _ + | succ k ih => + simp only [lem_09, sNat_eq, lem_08, Bool.or_eq_true] + have hpow : 2 ^ (k + 1) = 2 ^ k + 2 ^ k := by rw [Nat.pow_succ']; ring + rcases (by omega : y < 2 ^ k \/ 2 ^ k <= y) with hlt | hge + · left + have hmul : (2 * x) * 2 ^ k = x * 2 ^ (k + 1) := by rw [Nat.pow_succ']; ring + have heq : x * 2 ^ (k + 1) + y = (2 * x) * 2 ^ k + y := by omega + rw [heq] + exact ih (2 * x) y hlt + · right + have hmul : (2 * x + 1) * 2 ^ k = x * 2 ^ (k + 1) + 2 ^ k := by rw [Nat.pow_succ']; ring + have heq : x * 2 ^ (k + 1) + y = (2 * x + 1) * 2 ^ k + (y - 2 ^ k) := by omega + rw [heq] + exact ih (2 * x + 1) (y - 2 ^ k) (by omega) +def lem_0b (m : Nat) : Nat := + if m <= 31 then 4 else if m <= 127 then 6 else if m <= 511 then 8 else 10 +def lem_0c (m : Nat) : BitTrie := lem_09 (lem_0b m) m 0 +theorem lem_0d (m y : Nat) (hm : 0 < m) (hm_ub : m <= 2047) : + lem_02 (lem_0c m) ((y * y) % m) = true := by + rcases lem_01 m y hm with ⟨r, hr, hsq⟩ + rw [<- hsq] + unfold lem_0c + have hlt : r < 2 ^ (lem_0b m) := by + unfold lem_0b + split_ifs <;> omega + have h := lem_0a (lem_0b m) m 0 r hlt + simpa using h +def lem_0e : Nat -> Nat -> (Nat -> Bool) -> Nat -> Bool + | 0, m, p, x => p ((x * x) % m) + | k + 1, m, p, x => lem_0e k m p (2 * x) || lem_0e k m p (2 * x + 1) +theorem lem_0f (k m : Nat) (p : Nat -> Bool) (x y : Nat) (hy : y < 2 ^ k) + (hp : p (((x * 2 ^ k + y) * (x * 2 ^ k + y)) % m) = true) : + lem_0e k m p x = true := by + induction k generalizing x y with + | zero => + have hy0 : y = 0 := by omega + subst hy0 + simp only [Nat.pow_zero, Nat.mul_one, Nat.add_zero] at hp + simpa [lem_0e, sNat_eq] using hp + | succ k ih => + simp only [lem_0e, Bool.or_eq_true] + have hpow : 2 ^ (k + 1) = 2 ^ k + 2 ^ k := by rw [Nat.pow_succ']; ring + rcases (by omega : y < 2 ^ k \/ 2 ^ k <= y) with hlt | hge + · left + apply ih (2 * x) y hlt + have hmul : (2 * x) * 2 ^ k = x * 2 ^ (k + 1) := by rw [Nat.pow_succ']; ring + have heq : (2 * x) * 2 ^ k + y = x * 2 ^ (k + 1) + y := by omega + rw [heq]; exact hp + · right + apply ih (2 * x + 1) (y - 2 ^ k) (by omega) + have hmul : (2 * x + 1) * 2 ^ k = x * 2 ^ (k + 1) + 2 ^ k := by rw [Nat.pow_succ']; ring + have heq : (2 * x + 1) * 2 ^ k + (y - 2 ^ k) = x * 2 ^ (k + 1) + y := by omega + rw [heq]; exact hp +theorem lem_0g (k m : Nat) (p : Nat -> Bool) (y : Nat) + (hm : 0 < m) (hub : m / 2 <= 2 ^ k) + (hcert : (p (((2 ^ k) * (2 ^ k)) % m) || lem_0e k m p 0) = false) : + p ((y * y) % m) = false := by + rcases lem_01 m y hm with ⟨r, hr, hsq⟩ + rw [<- hsq] + simp only [Bool.or_eq_false_iff] at hcert + rcases (by omega : r = 2 ^ k \/ r < 2 ^ k) with rfl | hlt + · exact hcert.1 + · cases hpr : p ((r * r) % m) with + | false => rfl + | true => + have hbad := lem_0f k m p 0 r hlt (by simpa using hpr) + rw [hcert.2] at hbad + contradiction +def lem_0h : Nat -> Nat -> Nat -> Nat + | 0, e, m => (2 ^ e) % m + | fuel + 1, e, m => + if e == 0 then 1 % m + else + sNat (lem_0h fuel (e / 2) m) (fun half => + sNat ((half * half) % m) (fun sq => + if e % 2 == 1 then (2 * sq) % m else sq)) +theorem lem_0i (fuel e m : Nat) : lem_0h fuel e m = (2 ^ e) % m := by + induction fuel generalizing e with + | zero => rfl + | succ fuel ih => + simp only [lem_0h, sNat_eq] + split_ifs with h0 h1 + · have he : e = 0 := beq_iff_eq.mp h0 + subst he; rfl + · have he1 : e % 2 = 1 := beq_iff_eq.mp h1 + rw [ih] + have hdiv : e = (e / 2) + (e / 2) + 1 := by omega + conv_rhs => + rw [hdiv, Nat.pow_add, Nat.pow_add, Nat.pow_one, Nat.mul_comm _ 2, Nat.mul_mod 2, + Nat.mul_mod (2 + ^ (e / 2))] + rw [Nat.mul_mod 2, Nat.mod_mod] + · have he0 : e % 2 = 0 := by + have : e % 2 ≠ 1 := fun h => h1 (beq_iff_eq.mpr h) + omega + rw [ih] + have hdiv : e = (e / 2) + (e / 2) := by omega + conv_rhs => rw [hdiv, Nat.pow_add, Nat.mul_mod] +theorem lem_0j (m p e : Nat) (_hp : 0 < p) (hper : 2 ^ p % m = 1) : + 2 ^ e % m = 2 ^ (e % p) % m := by + have hdiv : e = p * (e / p) + e % p := (Nat.div_add_mod e p).symm + conv_lhs => rw [hdiv, Nat.pow_add, Nat.pow_mul] + have h1 : ∀ k, (2 ^ p) ^ k % m = 1 % m := by + intro k + induction k with + | zero => simp + | succ k ih => + rw [Nat.pow_succ, Nat.mul_mod, ih, hper, Nat.mul_one, Nat.mod_mod] + rw [Nat.mul_mod, h1 (e / p), <- Nat.mul_mod, Nat.one_mul] +theorem lem_0k {a m : Nat} (_hm : 0 < m) (ha : a < 2 * m) : + a % m = if a < m then a else a - m := by + split_ifs with h + · exact Nat.mod_eq_of_lt h + · rw [Nat.mod_eq_sub_mod (by omega)] + exact Nat.mod_eq_of_lt (by omega) +theorem lem_0l {L Y R m : Nat} (hm : 0 < m) (h : L = Y + R) : + (L % m + m - R % m) % m = Y % m := by + have hL : L % m = (Y % m + R % m) % m := by rw [h, Nat.add_mod] + have hYlt : Y % m < m := Nat.mod_lt Y hm + have hRlt : R % m < m := Nat.mod_lt R hm + rw [lem_0k (a := Y % m + R % m) hm (by omega)] at hL + generalize Y % m = ym at hL hYlt + generalize R % m = rm at hL hRlt + split_ifs at hL with hsum + · have h1 : L % m + m - rm = ym + m := by omega + rw [h1, Nat.add_mod_right, Nat.mod_eq_of_lt hYlt] + · have h1 : L % m + m - rm = ym := by omega + rw [h1, Nat.mod_eq_of_lt hYlt] +abbrev Row := Nat × Nat × Nat × Nat +def lem_0m (p : Nat) (s : Row) : Row := + let (l, n, a, r) := s + (l % p, n % p, a % p, r) +def lem_0n (n a r : Nat) : Nat := + if r == 1 then 2 * n * (n + 1) + a + 1 else 2 * (n + 1) * (n + 1) + a + 1 +def lem_0o (x : Nat) : Bool := + (x % 32 == 11) || (x % 32 == 15) || (x % 32 == 31) +def lem_0p (l x : Nat) : Bool := + (x % 96 == 15) || ((x % 96 == 11) && (l % 2 == 1)) +def lem_0q (s : Row) : Bool := + let (l, n, a, r) := s + sNat (lem_0n n a r) (fun x => lem_0o x && !lem_0p l x) +def lem_0r (p m : Nat) (s : Row) : Nat := + let (l, n, _, r) := s + sNat ((l + 2 * n + r + 3) % p) (fun e => (lem_0h 12 e m + 1) % m) +def lem_0s (p m : Nat) (s : Row) : Nat := + let (_, n, a, r) := s + sNat ((2 * n + 2) % p) (fun e1 => + sNat ((a + 1) % p) (fun e2 => + ((2 * r - 1) * lem_0h 12 e1 m + 5 * lem_0h 12 e2 m) % m)) +def lem_0t (p m : Nat) (s : Row) : Nat := + sNat (lem_0r p m s) (fun r1 => sNat (lem_0s p m s) (fun s1 => (r1 + m - s1) % m)) +theorem lem_0u (p m : Nat) (s : Row) : + lem_0t p m (lem_0m p s) = lem_0t p m s := by + rcases s with ⟨l, n, a, r⟩ + simp only [lem_0t, lem_0r, lem_0s, lem_0m, sNat_eq] + have h1 : (l % p + 2 * (n % p) + r + 3) % p = (l + 2 * n + r + 3) % p := by + simp only [Nat.add_mod, Nat.mul_mod, Nat.mod_mod] + have h2 : (2 * (n % p) + 2) % p = (2 * n + 2) % p := by + simp only [Nat.add_mod, Nat.mul_mod, Nat.mod_mod] + have h3 : (a % p + 1) % p = (a + 1) % p := by + simp only [Nat.add_mod, Nat.mod_mod] + rw [h1, h2, h3] +theorem lem_0v (p m : Nat) (s : Row) (y : Nat) + (hp : 0 < p) (hm : 0 < m) (hper : lem_0h 12 p m = 1) + (hsq : 2 ^ (s.1 + 2 * s.2.1 + s.2.2.2 + 3) + 1 = + y * y + ((2 * s.2.2.2 - 1) * 2 ^ (2 * s.2.1 + 2) + 5 * 2 ^ (s.2.2.1 + 1))) : + lem_0t p m s = (y * y) % m := by + rcases s with ⟨l, n, a, r⟩ + rw [lem_0i] at hper + simp only [lem_0t, lem_0r, lem_0s, lem_0i, sNat_eq] + rw [<- lem_0j m p (l + 2 * n + r + 3) hp hper, + <- lem_0j m p (2 * n + 2) hp hper, + <- lem_0j m p (a + 1) hp hper] + have hlhs : (2 ^ (l + 2 * n + r + 3) % m + 1) % m = (2 ^ (l + 2 * n + r + 3) + 1) % m := by + simp only [Nat.add_mod, Nat.mod_mod] + have hrhs : ((2 * r - 1) * (2 ^ (2 * n + 2) % m) + 5 * (2 ^ (a + 1) % m)) % m = + ((2 * r - 1) * 2 ^ (2 * n + 2) + 5 * 2 ^ (a + 1)) % m := by + simp only [Nat.add_mod, Nat.mul_mod, Nat.mod_mod] + rw [hlhs, hrhs] + exact lem_0l hm hsq +def lem_0w (p m : Nat) : Bool := + (0 < m) && (m <= 2047) && (lem_0h 12 p m == 1) +def lem_0x (p m : Nat) (qr : BitTrie) (xs : List Row) : List Row := + match qr with + | .leaf false => [] + | .leaf true => xs + | .node l r => + xs.filter (fun s => sNat (lem_0t p m s) (lem_02 (.node l r))) +theorem lem_0y (p m : Nat) (qr : BitTrie) (xs : List Row) : + lem_0x p m qr xs = xs.filter (fun s => lem_02 qr (lem_0t p m s)) := by + cases qr with + | leaf b => + cases b <;> simp [lem_0x, lem_02] + | node l r => simp [lem_0x, sNat_eq] +def lem_0z (p : Nat) (ms : List Nat) (xs : List Row) : List Row := + match ms with + | [] => xs + | m :: ms => + lem_0z p ms (lem_0x p m (lem_0c m) xs) +theorem lem_0A (p : Nat) (ms : List Nat) (xs : List Row) (s : Row) (y : Nat) + (hp : 0 < p) (hms : ms.all (lem_0w p) = true) + (hsq : 2 ^ (s.1 + 2 * s.2.1 + s.2.2.2 + 3) + 1 = + y * y + ((2 * s.2.2.2 - 1) * 2 ^ (2 * s.2.1 + 2) + 5 * 2 ^ (s.2.2.1 + 1))) + (hin : lem_0m p s ∈ xs) : + lem_0m p s ∈ lem_0z p ms xs := by + induction ms generalizing xs with + | nil => exact hin + | cons m ms ih => + simp only [List.all_cons, Bool.and_eq_true] at hms + rcases hms with ⟨hm_val, hms_rest⟩ + simp only [lem_0w, Bool.and_eq_true, decide_eq_true_eq, beq_iff_eq] at hm_val + rcases hm_val with ⟨⟨hm, hm_ub⟩, hper⟩ + apply ih _ hms_rest + rw [lem_0y, List.mem_filter] + refine ⟨hin, ?_⟩ + rw [lem_0u, lem_0v p m s y hp hm hper hsq] + exact lem_0d m y hm hm_ub +def box (ls ns as_ rs : List Nat) : List Row := + ls.flatMap (fun l => ns.flatMap (fun n => as_.flatMap (fun a => rs.map (fun r => (l, n, a, r))))) +def lem_0B (p k : Nat) (xs : List Row) : List Row := + xs.flatMap (fun (l, n, a, r) => + box ((List.range k).map (fun i => sNat (l + p * i) (fun x => x))) + ((List.range k).map (fun i => sNat (n + p * i) (fun x => x))) + ((List.range k).map (fun i => sNat (a + p * i) (fun x => x))) + [r]) +theorem lem_0C {ls ns as_ rs : List Nat} {l n a r : Nat} + (hl : l ∈ ls) (hn : n ∈ ns) (ha : a ∈ as_) (hr : r ∈ rs) : + (l, n, a, r) ∈ box ls ns as_ rs := by + unfold box + rw [List.mem_flatMap]; refine ⟨l, hl, ?_⟩ + rw [List.mem_flatMap]; refine ⟨n, hn, ?_⟩ + rw [List.mem_flatMap]; refine ⟨a, ha, ?_⟩ + rw [List.mem_map]; exact ⟨r, hr, rfl⟩ +theorem lem_0D (x p k : Nat) (hp : 0 < p) (hk : 0 < k) : + ∃ i < k, x % (p * k) = x % p + p * i := by + refine ⟨(x % (p * k)) / p, ?_, ?_⟩ + · rw [Nat.div_lt_iff_lt_mul hp, Nat.mul_comm] + exact Nat.mod_lt x (Nat.mul_pos hk hp) + · have h1 : (x % (p * k)) % p = x % p := Nat.mod_mod_of_dvd x ⟨k, rfl⟩ + have h2 := (Nat.div_add_mod (x % (p * k)) p).symm + omega +theorem lem_0E (p k : Nat) (xs : List Row) (s : Row) + (hp : 0 < p) (hk : 0 < k) (hin : lem_0m p s ∈ xs) : + lem_0m (p * k) s ∈ lem_0B p k xs := by + rcases s with ⟨l, n, a, r⟩ + unfold lem_0B + rw [List.mem_flatMap] + refine ⟨lem_0m p (l, n, a, r), hin, ?_⟩ + simp only [lem_0m, sNat_eq] + rcases lem_0D l p k hp hk with ⟨il, hil, hl⟩ + rcases lem_0D n p k hp hk with ⟨in_, hin_, hn⟩ + rcases lem_0D a p k hp hk with ⟨ia, hia, ha⟩ + rw [hl, hn, ha] + apply lem_0C + · rw [List.mem_map]; exact ⟨il, List.mem_range.mpr hil, rfl⟩ + · rw [List.mem_map]; exact ⟨in_, List.mem_range.mpr hin_, rfl⟩ + · rw [List.mem_map]; exact ⟨ia, List.mem_range.mpr hia, rfl⟩ + · simp +def lem_0F (s t : Row) : Bool := + (s.1 == t.1) && (s.2.1 == t.2.1) && (s.2.2.1 == t.2.2.1) && (s.2.2.2 == t.2.2.2) +def lem_0G (xs ys : List Row) : Bool := + xs.all (fun x => ys.any (lem_0F x)) +theorem lem_0H {xs ys : List Row} (h : lem_0G xs ys = true) {s : Row} (hs : s ∈ xs) : + s ∈ ys := by + unfold lem_0G at h + rw [List.all_eq_true] at h + have h1 := h s hs + rw [List.any_eq_true] at h1 + rcases h1 with ⟨t, ht, heq⟩ + rcases s with ⟨l1, n1, a1, r1⟩ + rcases t with ⟨l2, n2, a2, r2⟩ + simp only [lem_0F, Bool.and_eq_true, beq_iff_eq] at heq + rcases heq with ⟨⟨⟨rfl, rfl⟩, rfl⟩, rfl⟩ + exact ht +def lem_0I_raw : List Row := + lem_0z 6 [3, 7, 9] (box (List.range 6) (List.range 6) [0, 2, 4] [1, 2]) +def lem_0I : List Row := [ + (0, 0, 2, 1), (0, 1, 2, 1), (0, 3, 2, 1), (0, 4, 2, 1), (1, 0, 0, 2), (1, 0, 4, 1), + (1, 1, 2, 2), (1, 1, 4, 1), (1, 1, 4, 2), (1, 2, 0, 2), (1, 2, 2, 2), (1, 2, 4, 1), + (1, 2, 4, 2), (1, 3, 0, 2), (1, 3, 4, 1), (1, 4, 2, 2), (1, 4, 4, 1), (1, 4, 4, 2), + (1, 5, 0, 2), (1, 5, 2, 2), (1, 5, 4, 1), (1, 5, 4, 2), (2, 1, 4, 1), (2, 4, 4, 1), + (3, 0, 0, 2), (3, 0, 2, 1), (3, 0, 2, 2), (3, 0, 4, 1), (3, 0, 4, 2), (3, 1, 0, 1), + (3, 1, 0, 2), (3, 1, 2, 1), (3, 1, 4, 1), (3, 2, 0, 1), (3, 2, 2, 2), (3, 2, 4, 2), + (3, 3, 0, 2), (3, 3, 2, 1), (3, 3, 2, 2), (3, 3, 4, 1), (3, 3, 4, 2), (3, 4, 0, 1), + (3, 4, 0, 2), (3, 4, 2, 1), (3, 4, 4, 1), (3, 5, 0, 1), (3, 5, 2, 2), (3, 5, 4, 2), + (5, 0, 0, 1), (5, 0, 0, 2), (5, 0, 2, 1), (5, 0, 2, 2), (5, 1, 0, 1), (5, 1, 0, 2), + (5, 1, 4, 1), (5, 1, 4, 2), (5, 2, 2, 1), (5, 2, 2, 2), (5, 3, 0, 1), (5, 3, 0, 2), + (5, 3, 2, 1), (5, 3, 2, 2), (5, 4, 0, 1), (5, 4, 0, 2), (5, 4, 4, 1), (5, 4, 4, 2), + (5, 5, 2, 1), (5, 5, 2, 2)] +def lem_0J_raw : List Row := + lem_0z 12 [5, 13] (lem_0B 6 2 lem_0I) +def lem_0J : List Row := [ + (0, 1, 2, 1), (0, 3, 2, 1), (0, 3, 8, 1), (0, 7, 2, 1), (0, 9, 2, 1), (0, 9, 8, 1), + (1, 0, 4, 1), (1, 1, 2, 2), (1, 1, 4, 2), (1, 2, 4, 1), (1, 3, 0, 2), (1, 4, 10, 1), + (1, 5, 0, 2), (1, 5, 2, 2), (1, 5, 4, 2), (1, 6, 4, 1), (1, 7, 2, 2), (1, 7, 4, 2), + (1, 8, 4, 1), (1, 9, 0, 2), (1, 10, 10, 1), (1, 11, 0, 2), (1, 11, 2, 2), (1, 11, 4, 2), + (2, 1, 4, 1), (2, 4, 4, 1), (2, 4, 10, 1), (2, 7, 4, 1), (2, 10, 4, 1), (2, 10, 10, 1), + (3, 0, 0, 2), (3, 0, 2, 2), (3, 0, 4, 1), (3, 0, 8, 1), (3, 0, 8, 2), (3, 0, 10, 1), + (3, 2, 0, 1), (3, 2, 2, 2), (3, 2, 4, 2), (3, 2, 10, 2), (3, 4, 0, 2), (3, 4, 6, 1), + (3, 4, 6, 2), (3, 4, 8, 1), (3, 4, 10, 1), (3, 6, 0, 2), (3, 6, 2, 2), (3, 6, 4, 1), + (3, 6, 8, 1), (3, 6, 8, 2), (3, 6, 10, 1), (3, 8, 0, 1), (3, 8, 2, 2), (3, 8, 4, 2), + (3, 8, 10, 2), (3, 10, 0, 2), (3, 10, 6, 1), (3, 10, 6, 2), (3, 10, 8, 1), (3, 10, 10, 1), + (5, 0, 2, 1), (5, 0, 6, 1), (5, 0, 8, 1), (5, 1, 0, 2), (5, 1, 6, 2), (5, 1, 10, 2), + (5, 2, 2, 1), (5, 3, 6, 2), (5, 3, 8, 2), (5, 4, 0, 1), (5, 4, 10, 1), (5, 6, 2, 1), + (5, 6, 6, 1), (5, 6, 8, 1), (5, 7, 0, 2), (5, 7, 6, 2), (5, 7, 10, 2), (5, 8, 2, 1), + (5, 9, 6, 2), (5, 9, 8, 2), (5, 10, 0, 1), (5, 10, 10, 1), (6, 1, 8, 1), (6, 3, 8, 1), + (6, 4, 8, 1), (6, 7, 8, 1), (6, 9, 8, 1), (6, 10, 8, 1), (7, 0, 4, 1), (7, 0, 6, 2), + (7, 2, 0, 2), (7, 2, 4, 2), (7, 2, 6, 2), (7, 2, 10, 1), (7, 4, 10, 2), (7, 6, 4, 1), + (7, 6, 6, 2), (7, 8, 0, 2), (7, 8, 4, 2), (7, 8, 6, 2), (7, 8, 10, 1), (7, 10, 10, 2), + (9, 0, 8, 1), (9, 0, 10, 1), (9, 3, 0, 2), (9, 3, 8, 2), (9, 3, 10, 2), (9, 4, 0, 1), + (9, 4, 8, 1), (9, 4, 10, 1), (9, 5, 8, 2), (9, 5, 10, 2), (9, 6, 8, 1), (9, 6, 10, 1), + (9, 9, 0, 2), (9, 9, 8, 2), (9, 9, 10, 2), (9, 10, 0, 1), (9, 10, 8, 1), (9, 10, 10, 1), + (9, 11, 8, 2), (9, 11, 10, 2), (11, 0, 2, 1), (11, 0, 2, 2), (11, 2, 2, 1), (11, 2, 2, 2), + (11, 2, 8, 1), (11, 2, 8, 2), (11, 4, 0, 1), (11, 4, 0, 2), (11, 6, 2, 1), (11, 6, 2, 2), + (11, 8, 2, 1), (11, 8, 2, 2), (11, 8, 8, 1), (11, 8, 8, 2), (11, 10, 0, 1), (11, 10, 0, 2)] +def lem_0K_raw : List Row := + lem_0z 24 [17, 241] (lem_0B 12 2 lem_0J) +def lem_0K : List Row := [ + (0, 1, 2, 1), (0, 3, 2, 1), (0, 7, 2, 1), (0, 9, 14, 1), (0, 9, 20, 1), (0, 13, 2, 1), + (0, 15, 2, 1), (0, 19, 2, 1), (0, 21, 14, 1), (0, 21, 20, 1), (1, 1, 2, 2), (1, 1, 4, 2), + (1, 2, 4, 1), (1, 5, 12, 2), (1, 6, 4, 1), (1, 7, 2, 2), (1, 7, 16, 2), (1, 10, 22, 1), + (1, 11, 0, 2), (1, 11, 16, 2), (1, 13, 2, 2), (1, 13, 4, 2), (1, 14, 4, 1), (1, 17, 12, 2), + (1, 18, 4, 1), (1, 19, 2, 2), (1, 19, 16, 2), (1, 22, 22, 1), (1, 23, 0, 2), (1, 23, 16, 2), + (2, 1, 4, 1), (2, 4, 10, 1), (2, 4, 16, 1), (2, 7, 4, 1), (2, 10, 16, 1), (2, 10, 22, 1), + (2, 13, 4, 1), (2, 16, 10, 1), (2, 16, 16, 1), (2, 19, 4, 1), (2, 22, 16, 1), (2, 22, 22, 1), + (3, 0, 2, 2), (3, 0, 8, 1), (3, 0, 20, 2), (3, 2, 16, 2), (3, 4, 8, 1), (3, 4, 18, 1), + (3, 4, 20, 1), (3, 6, 0, 2), (3, 6, 22, 1), (3, 8, 2, 2), (3, 8, 12, 1), (3, 10, 0, 2), + (3, 10, 22, 1), (3, 12, 2, 2), (3, 12, 8, 1), (3, 12, 20, 2), (3, 14, 16, 2), (3, 16, 8, 1), + (3, 16, 18, 1), (3, 16, 20, 1), (3, 18, 0, 2), (3, 18, 22, 1), (3, 20, 2, 2), (3, 20, 12, 1), + (3, 22, 0, 2), (3, 22, 22, 1), (5, 0, 20, 1), (5, 2, 14, 1), (5, 3, 20, 2), (5, 4, 12, 1), + (5, 6, 6, 1), (5, 6, 14, 1), (5, 6, 20, 1), (5, 7, 12, 2), (5, 9, 6, 2), (5, 9, 20, 2), + (5, 10, 22, 1), (5, 12, 20, 1), (5, 14, 14, 1), (5, 15, 20, 2), (5, 16, 12, 1), (5, 18, 6, 1), + (5, 18, 14, 1), (5, 18, 20, 1), (5, 19, 12, 2), (5, 21, 6, 2), (5, 21, 20, 2), (5, 22, 22, 1), + (6, 1, 8, 1), (6, 3, 8, 1), (6, 4, 8, 1), (6, 9, 8, 1), (6, 10, 8, 1), (6, 13, 8, 1), + (6, 15, 8, 1), (6, 16, 8, 1), (6, 21, 8, 1), (6, 22, 8, 1), (7, 2, 0, 2), (7, 2, 16, 2), + (7, 2, 18, 2), (7, 6, 16, 1), (7, 8, 4, 2), (7, 8, 10, 1), (7, 14, 0, 2), (7, 14, 16, 2), + (7, 14, 18, 2), (7, 18, 16, 1), (7, 20, 4, 2), (7, 20, 10, 1), (9, 0, 22, 1), (9, 3, 8, 2), + (9, 3, 10, 2), (9, 4, 8, 1), (9, 4, 22, 1), (9, 5, 10, 2), (9, 6, 22, 1), (9, 9, 20, 2), + (9, 10, 10, 1), (9, 10, 20, 1), (9, 10, 22, 1), (9, 11, 10, 2), (9, 12, 22, 1), (9, 15, 8, 2), + (9, 15, 10, 2), (9, 16, 8, 1), (9, 16, 22, 1), (9, 17, 10, 2), (9, 18, 22, 1), (9, 21, 20, 2), + (9, 22, 10, 1), (9, 22, 20, 1), (9, 22, 22, 1), (9, 23, 10, 2), (11, 0, 2, 2), (11, 2, 14, 1), + (11, 2, 14, 2), (11, 4, 12, 1), (11, 6, 14, 1), (11, 12, 2, 2), (11, 14, 14, 1), (11, 14, 14, 2), + (11, 16, 12, 1), (11, 18, 14, 1), (12, 1, 2, 1), (12, 7, 14, 1), (12, 9, 2, 1), (12, 9, 20, 1), + (12, 13, 2, 1), (12, 19, 14, 1), (12, 21, 2, 1), (12, 21, 20, 1), (13, 2, 4, 1), (13, 5, 12, 2), + (13, 5, 14, 2), (13, 6, 4, 1), (13, 7, 4, 2), (13, 10, 22, 1), (13, 11, 12, 2), (13, 14, 4, 1), + (13, 17, 12, 2), (13, 17, 14, 2), (13, 18, 4, 1), (13, 19, 4, 2), (13, 22, 22, 1), (13, 23, 12, + 2), + (14, 7, 16, 1), (14, 10, 16, 1), (14, 19, 16, 1), (14, 22, 16, 1), (15, 0, 4, 1), (15, 0, 10, 1), + (15, 0, 12, 2), (15, 2, 0, 1), (15, 2, 10, 2), (15, 2, 16, 2), (15, 4, 10, 1), (15, 4, 18, 1), + (15, 4, 18, 2), (15, 6, 0, 2), (15, 6, 2, 2), (15, 6, 8, 2), (15, 6, 10, 1), (15, 8, 4, 2), + (15, 10, 8, 1), (15, 10, 18, 1), (15, 10, 18, 2), (15, 12, 4, 1), (15, 12, 10, 1), (15, 12, 12, + 2), + (15, 14, 0, 1), (15, 14, 10, 2), (15, 14, 16, 2), (15, 16, 10, 1), (15, 16, 18, 1), (15, 16, 18, + 2), + (15, 18, 0, 2), (15, 18, 2, 2), (15, 18, 8, 2), (15, 18, 10, 1), (15, 20, 4, 2), (15, 22, 8, 1), + (15, 22, 18, 1), (15, 22, 18, 2), (17, 0, 6, 1), (17, 0, 8, 1), (17, 1, 10, 2), (17, 1, 12, 2), + (17, 4, 22, 1), (17, 6, 2, 1), (17, 6, 6, 1), (17, 6, 14, 1), (17, 6, 18, 1), (17, 9, 18, 2), + (17, 9, 20, 2), (17, 10, 22, 1), (17, 12, 6, 1), (17, 12, 8, 1), (17, 13, 10, 2), (17, 13, 12, + 2), + (17, 16, 22, 1), (17, 18, 2, 1), (17, 18, 6, 1), (17, 18, 14, 1), (17, 18, 18, 1), (17, 21, 18, + 2), + (17, 21, 20, 2), (17, 22, 22, 1), (18, 4, 8, 1), (18, 7, 20, 1), (18, 9, 20, 1), (18, 10, 20, 1), + (18, 16, 8, 1), (18, 19, 20, 1), (18, 21, 20, 1), (18, 22, 20, 1), (19, 2, 16, 2), (19, 4, 10, + 2), + (19, 8, 10, 1), (19, 8, 12, 2), (19, 8, 18, 2), (19, 14, 16, 2), (19, 16, 10, 2), (19, 20, 10, + 1), + (19, 20, 12, 2), (19, 20, 18, 2), (21, 3, 20, 2), (21, 4, 20, 1), (21, 5, 22, 2), (21, 6, 22, 1), + (21, 9, 12, 2), (21, 9, 20, 2), (21, 10, 12, 1), (21, 10, 20, 1), (21, 15, 20, 2), (21, 16, 20, + 1), + (21, 17, 22, 2), (21, 18, 22, 1), (21, 21, 12, 2), (21, 21, 20, 2), (21, 22, 12, 1), (21, 22, 20, + 1), + (23, 2, 2, 1), (23, 2, 2, 2), (23, 8, 20, 1), (23, 8, 20, 2), (23, 14, 2, 1), (23, 14, 2, 2), + (23, 20, 20, 1), (23, 20, 20, 2)] +def lem_0L_raw : List Row := + lem_0z 48 [97, 257, 673] (lem_0B 24 2 lem_0K) +def lem_0L : List Row := [ + (0, 1, 2, 1), (0, 1, 26, 1), (0, 3, 2, 1), (0, 7, 2, 1), (0, 15, 26, 1), (0, 21, 44, 1), + (0, 25, 2, 1), (0, 25, 26, 1), (0, 27, 2, 1), (0, 31, 2, 1), (0, 39, 26, 1), (0, 45, 44, 1), + (1, 1, 2, 2), (1, 1, 4, 2), (1, 2, 4, 1), (1, 2, 28, 1), (1, 6, 28, 1), (1, 7, 2, 2), + (1, 11, 24, 2), (1, 19, 40, 2), (1, 22, 46, 1), (1, 23, 0, 2), (1, 25, 2, 2), (1, 25, 4, 2), + (1, 26, 4, 1), (1, 26, 28, 1), (1, 30, 28, 1), (1, 31, 2, 2), (1, 35, 24, 2), (1, 43, 40, 2), + (1, 46, 46, 1), (1, 47, 0, 2), (2, 1, 4, 1), (2, 7, 28, 1), (2, 10, 22, 1), (2, 19, 28, 1), + (2, 22, 46, 1), (2, 25, 4, 1), (2, 31, 28, 1), (2, 34, 22, 1), (2, 43, 28, 1), (2, 46, 46, 1), + (3, 0, 2, 2), (3, 4, 32, 1), (3, 8, 36, 1), (3, 12, 8, 1), (3, 12, 32, 1), (3, 16, 42, 1), + (3, 18, 24, 2), (3, 22, 0, 2), (3, 22, 46, 1), (3, 24, 2, 2), (3, 28, 32, 1), (3, 32, 36, 1), + (3, 36, 8, 1), (3, 36, 32, 1), (3, 40, 42, 1), (3, 42, 24, 2), (3, 46, 0, 2), (3, 46, 46, 1), + (5, 0, 20, 1), (5, 3, 44, 2), (5, 9, 6, 2), (5, 9, 20, 2), (5, 15, 44, 2), (5, 19, 12, 2), + (5, 21, 44, 2), (5, 22, 46, 1), (5, 24, 20, 1), (5, 27, 44, 2), (5, 33, 6, 2), (5, 33, 20, 2), + (5, 39, 44, 2), (5, 43, 12, 2), (5, 45, 44, 2), (5, 46, 46, 1), (6, 1, 8, 1), (6, 10, 32, 1), + (6, 16, 32, 1), (6, 21, 32, 1), (6, 25, 8, 1), (6, 34, 32, 1), (6, 40, 32, 1), (6, 45, 32, 1), + (7, 2, 0, 2), (7, 2, 16, 2), (7, 20, 28, 2), (7, 26, 0, 2), (7, 26, 16, 2), (7, 44, 28, 2), + (9, 5, 34, 2), (9, 10, 10, 1), (9, 10, 22, 1), (9, 23, 10, 2), (9, 29, 34, 2), (9, 34, 10, 1), + (9, 34, 22, 1), (9, 47, 10, 2), (11, 2, 14, 2), (11, 26, 14, 2), (12, 19, 38, 1), (12, 43, 38, + 1), + (13, 10, 22, 1), (13, 19, 4, 2), (13, 22, 46, 1), (13, 34, 22, 1), (13, 43, 4, 2), (13, 46, 46, + 1), + (14, 7, 16, 1), (14, 7, 40, 1), (14, 22, 40, 1), (14, 31, 16, 1), (14, 31, 40, 1), (14, 46, 40, + 1), + (15, 6, 0, 2), (15, 6, 32, 2), (15, 10, 18, 2), (15, 12, 28, 1), (15, 16, 18, 1), (15, 30, 0, 2), + (15, 30, 32, 2), (15, 34, 18, 2), (15, 36, 28, 1), (15, 40, 18, 1), (17, 6, 6, 1), (17, 6, 14, + 1), + (17, 10, 46, 1), (17, 12, 6, 1), (17, 18, 14, 1), (17, 22, 46, 1), (17, 30, 6, 1), (17, 30, 14, + 1), + (17, 34, 46, 1), (17, 36, 6, 1), (17, 42, 14, 1), (17, 46, 46, 1), (18, 7, 44, 1), (18, 10, 20, + 1), + (18, 31, 44, 1), (18, 34, 20, 1), (19, 8, 18, 2), (19, 32, 18, 2), (21, 4, 20, 1), (21, 5, 22, + 2), + (21, 6, 46, 1), (21, 10, 20, 1), (21, 16, 20, 1), (21, 21, 44, 2), (21, 22, 44, 1), (21, 28, 20, + 1), + (21, 29, 22, 2), (21, 30, 46, 1), (21, 34, 20, 1), (21, 40, 20, 1), (21, 45, 44, 2), (21, 46, 44, + 1), + (23, 14, 26, 2), (23, 38, 26, 2), (24, 7, 2, 1), (24, 7, 26, 1), (24, 9, 38, 1), (24, 13, 26, 1), + (24, 19, 2, 1), (24, 21, 44, 1), (24, 31, 2, 1), (24, 31, 26, 1), (24, 33, 38, 1), (24, 37, 26, + 1), + (24, 43, 2, 1), (24, 45, 44, 1), (25, 6, 28, 1), (25, 19, 26, 2), (25, 19, 40, 2), (25, 23, 24, + 2), + (25, 30, 28, 1), (25, 43, 26, 2), (25, 43, 40, 2), (25, 47, 24, 2), (26, 4, 16, 1), (26, 10, 40, + 1), + (26, 28, 16, 1), (26, 34, 40, 1), (27, 0, 8, 1), (27, 0, 26, 2), (27, 0, 32, 1), (27, 4, 8, 1), + (27, 4, 32, 1), (27, 6, 24, 2), (27, 8, 2, 2), (27, 8, 26, 2), (27, 12, 26, 2), (27, 16, 44, 1), + (27, 20, 12, 1), (27, 24, 8, 1), (27, 24, 26, 2), (27, 24, 32, 1), (27, 28, 8, 1), (27, 28, 32, + 1), + (27, 30, 24, 2), (27, 32, 2, 2), (27, 32, 26, 2), (27, 36, 26, 2), (27, 40, 44, 1), (27, 44, 12, + 1), + (29, 18, 6, 1), (29, 18, 14, 1), (29, 18, 38, 1), (29, 18, 44, 1), (29, 21, 30, 2), (29, 42, 6, + 1), + (29, 42, 14, 1), (29, 42, 38, 1), (29, 42, 44, 1), (29, 45, 30, 2), (30, 1, 32, 1), (30, 4, 8, + 1), + (30, 4, 32, 1), (30, 10, 8, 1), (30, 10, 32, 1), (30, 13, 8, 1), (30, 15, 8, 1), (30, 15, 32, 1), + (30, 21, 8, 1), (30, 22, 32, 1), (30, 25, 32, 1), (30, 28, 8, 1), (30, 28, 32, 1), (30, 34, 8, + 1), + (30, 34, 32, 1), (30, 37, 8, 1), (30, 39, 8, 1), (30, 39, 32, 1), (30, 45, 8, 1), (30, 46, 32, + 1), + (31, 8, 28, 2), (31, 14, 0, 2), (31, 14, 16, 2), (31, 32, 28, 2), (31, 38, 0, 2), (31, 38, 16, + 2), + (33, 3, 8, 2), (33, 4, 8, 1), (33, 10, 44, 1), (33, 10, 46, 1), (33, 11, 34, 2), (33, 17, 10, 2), + (33, 18, 46, 1), (33, 22, 22, 1), (33, 22, 46, 1), (33, 23, 34, 2), (33, 27, 8, 2), (33, 28, 8, + 1), + (33, 34, 44, 1), (33, 34, 46, 1), (33, 35, 34, 2), (33, 41, 10, 2), (33, 42, 46, 1), (33, 46, 22, + 1), + (33, 46, 46, 1), (33, 47, 34, 2), (35, 4, 36, 1), (35, 14, 14, 1), (35, 16, 36, 1), (35, 18, 38, + 1), + (35, 28, 36, 1), (35, 38, 14, 1), (35, 40, 36, 1), (35, 42, 38, 1), (36, 1, 26, 1), (36, 7, 14, + 1), + (36, 7, 38, 1), (36, 9, 26, 1), (36, 25, 26, 1), (36, 31, 14, 1), (36, 31, 38, 1), (36, 33, 26, + 1), + (37, 5, 12, 2), (37, 6, 28, 1), (37, 10, 22, 1), (37, 14, 28, 1), (37, 19, 28, 2), (37, 22, 22, + 1), + (37, 29, 12, 2), (37, 30, 28, 1), (37, 34, 22, 1), (37, 38, 28, 1), (37, 43, 28, 2), (37, 46, 22, + 1), + (38, 22, 40, 1), (38, 46, 40, 1), (39, 0, 10, 1), (39, 0, 36, 2), (39, 2, 16, 2), (39, 6, 34, 1), + (39, 16, 42, 1), (39, 16, 42, 2), (39, 18, 0, 2), (39, 18, 32, 2), (39, 22, 42, 2), (39, 24, 10, + 1), + (39, 24, 36, 2), (39, 26, 16, 2), (39, 30, 34, 1), (39, 40, 42, 1), (39, 40, 42, 2), (39, 42, 0, + 2), + (39, 42, 32, 2), (39, 46, 42, 2), (41, 6, 2, 1), (41, 10, 22, 1), (41, 21, 42, 2), (41, 21, 44, + 2), + (41, 30, 2, 1), (41, 34, 22, 1), (41, 45, 42, 2), (41, 45, 44, 2), (42, 4, 32, 1), (42, 7, 44, + 1), + (42, 19, 44, 1), (42, 21, 44, 1), (42, 22, 20, 1), (42, 22, 44, 1), (42, 28, 32, 1), (42, 31, 44, + 1), + (42, 43, 44, 1), (42, 45, 44, 1), (42, 46, 20, 1), (42, 46, 44, 1), (43, 2, 40, 2), (43, 8, 42, + 2), + (43, 20, 42, 2), (43, 26, 40, 2), (43, 32, 42, 2), (43, 44, 42, 2), (45, 5, 46, 2), (45, 6, 46, + 1), + (45, 9, 44, 2), (45, 10, 44, 1), (45, 17, 46, 2), (45, 18, 46, 1), (45, 21, 44, 2), (45, 22, 44, + 1), + (45, 29, 46, 2), (45, 30, 46, 1), (45, 33, 44, 2), (45, 34, 44, 1), (45, 41, 46, 2), (45, 42, 46, + 1), + (45, 45, 44, 2), (45, 46, 44, 1), (47, 2, 2, 1), (47, 2, 2, 2), (47, 20, 44, 1), (47, 20, 44, 2), + (47, 26, 2, 1), (47, 26, 2, 2), (47, 44, 44, 1), (47, 44, 44, 2)] +def lem_0M : List Row := + lem_0z 96 [193] ((lem_0B 48 2 lem_0L).filter lem_0q) +theorem lem_0I_sub : lem_0G lem_0I_raw lem_0I = true := by decide +kernel +theorem lem_0J_sub : lem_0G lem_0J_raw lem_0J = true := by decide +kernel +theorem lem_0K_sub : lem_0G lem_0K_raw lem_0K = true := by decide +kernel +theorem lem_0L_sub : lem_0G lem_0L_raw lem_0L = true := by decide +kernel +def lem_0N : List Row := + [(0, 1, 26, 1), (0, 49, 26, 1), (0, 25, 74, 1), (0, 73, 74, 1), (84, 1, 26, 1), (84, 1, 74, 1), + (84, 49, 26, 1), (84, 49, 74, 1), (36, 25, 26, 1), (36, 25, 74, 1), (36, 73, 26, 1), (36, 73, 74, + 1), + (84, 25, 26, 1), (84, 73, 26, 1), (72, 19, 50, 1), (72, 67, 50, 1), (36, 7, 62, 1), (36, 55, 62, + 1), + (84, 7, 14, 1), (84, 55, 14, 1), (36, 31, 14, 1), (36, 31, 62, 1), (36, 79, 14, 1), (36, 79, 62, + 1), + (84, 31, 14, 1), (84, 79, 14, 1), (12, 19, 38, 1), (12, 19, 86, 1), (12, 67, 38, 1), (12, 67, 86, + 1), + (60, 19, 86, 1), (60, 67, 86, 1), (60, 43, 86, 1), (60, 91, 86, 1), (48, 3, 50, 1), (48, 51, 50, + 1), + (48, 27, 2, 1), (48, 75, 2, 1), (48, 15, 74, 1), (48, 63, 74, 1), (72, 9, 86, 1), (72, 57, 86, + 1), + (36, 9, 74, 1), (36, 57, 74, 1), (84, 33, 26, 1), (84, 81, 26, 1), (31, 8, 76, 2), (31, 56, 76, + 2), + (79, 8, 76, 2), (79, 56, 76, 2), (31, 32, 28, 2), (31, 32, 76, 2), (31, 80, 28, 2), (31, 80, 76, + 2), + (55, 20, 76, 2), (55, 68, 76, 2), (7, 44, 28, 2), (7, 44, 76, 2), (7, 92, 28, 2), (7, 92, 76, 2), + (55, 44, 28, 2), (55, 92, 28, 2), (37, 46, 70, 1), (37, 94, 70, 1), (75, 6, 72, 2), (75, 54, 72, + 2), + (27, 30, 72, 2), (27, 78, 72, 2), (3, 42, 24, 2), (3, 90, 24, 2), (33, 10, 46, 1), (33, 58, 46, + 1), + (33, 34, 94, 1), (33, 82, 94, 1), (81, 34, 94, 1), (81, 82, 94, 1), (33, 22, 22, 1), (33, 70, 22, + 1), + (21, 5, 22, 2), (21, 5, 70, 2), (21, 53, 22, 2), (21, 53, 70, 2), (69, 5, 70, 2), (69, 53, 70, + 2), + (17, 12, 6, 1), (17, 12, 54, 1), (17, 60, 6, 1), (17, 60, 54, 1), (65, 12, 54, 1), (65, 60, 54, + 1), + (17, 36, 54, 1), (17, 84, 54, 1), (29, 18, 62, 1), (29, 66, 62, 1), (29, 42, 14, 1), (29, 90, 14, + 1), + (77, 42, 14, 1), (77, 90, 14, 1), (17, 42, 14, 1), (17, 90, 14, 1), (65, 42, 14, 1), (65, 90, 14, + 1), + (47, 2, 50, 1), (47, 50, 50, 1), (47, 44, 44, 2), (47, 92, 44, 2), (5, 9, 54, 2), (5, 57, 54, 2), + (53, 9, 54, 2), (53, 57, 54, 2), (5, 33, 54, 2), (5, 81, 54, 2), (53, 33, 54, 2), (53, 81, 54, + 2), + (17, 10, 46, 1), (17, 58, 46, 1), (17, 34, 94, 1), (17, 82, 94, 1), (65, 34, 94, 1), (65, 82, 94, + 1)] +def lem_0O : List Row := + lem_0z 288 [19, 27, 37, 73, 109, 433, 577, 1153] (lem_0B 96 3 lem_0N) +def lem_0P : List Row := + [(276, 1, 26, 1), (276, 1, 170, 1), (276, 145, 26, 1), (276, 145, 170, 1), + (132, 217, 170, 1), (132, 73, 170, 1), (12, 115, 230, 1), (12, 115, 86, 1), + (12, 259, 230, 1), (12, 259, 86, 1), (144, 3, 146, 1), (144, 147, 146, 1), + (144, 219, 2, 1), (144, 75, 2, 1), (257, 204, 150, 1), (257, 60, 150, 1), + (29, 114, 254, 1), (29, 258, 254, 1), (173, 42, 110, 1), (173, 186, 110, 1), + (143, 140, 140, 2), (143, 284, 140, 2), (53, 105, 54, 2), (53, 249, 54, 2), + (53, 33, 54, 2), (53, 177, 54, 2)] +def lem_0Q : List Row := + lem_0z 1440 [11, 25, 31, 41, 61, 151, 181, 331, 631, 1321] (lem_0B 288 5 lem_0P) +def lem_0R : List Row := + [(300, 691, 1382, 1), (1164, 403, 806, 1), (300, 691, 662, 1), (1164, 403, 86, 1), + (300, 1411, 1382, 1), (1164, 1123, 806, 1), (300, 1411, 662, 1), (1164, 1123, 86, 1), + (720, 3, 722, 1), (720, 723, 722, 1), (720, 1083, 2, 1), (720, 363, 2, 1), + (719, 716, 716, 2), (719, 1436, 716, 2), (341, 1257, 342, 2), (341, 537, 342, 2), + (341, 897, 342, 2), (341, 177, 342, 2)] +def lem_0S (d : Nat) : Bool := d == 5098 || d == 1241 || d == 3447 +def lem_0T (d : Nat) : Bool := d == 20198 || d == 2609 || d == 11162 +def lem_0U (d : Nat) : Bool := d == 24525 || d == 19976 +def lem_0V (d : Nat) : Bool := d == 321 +def lem_0W (s : Row) : Bool := + !lem_0S (lem_0t 1440 6337 s) && + !lem_0T (lem_0t 1440 23041 s) && + !lem_0U (lem_0t 1440 37441 s) && + !lem_0V (lem_0t 1440 65537 s) +set_option maxHeartbeats 8000000 in +-- Needed for large symbolic execution or decision procedure +theorem lem_0X : + ([3, 7, 9].all (lem_0w 6) && + [5, 13].all (lem_0w 12) && + [17, 241].all (lem_0w 24) && + [97, 257, 673].all (lem_0w 48) && + [193].all (lem_0w 96) && + [19, 27, 37, 73, 109, 433, 577, 1153].all (lem_0w 288) && + [11, 25, 31, 41, 61, 151, 181, 331, 631, 1321].all (lem_0w 1440)) = true := by decide +kernel +set_option maxHeartbeats 8000000 in +-- Needed for large symbolic execution or decision procedure +theorem lem_0Y : lem_0G lem_0M lem_0N = true := by decide +kernel +set_option maxHeartbeats 8000000 in +-- Needed for large symbolic execution or decision procedure +theorem lem_0Z : lem_0G lem_0O lem_0P = true := by decide +kernel +set_option maxHeartbeats 8000000 in +-- Needed for large symbolic execution or decision procedure +theorem lem_10 : lem_0G lem_0Q lem_0R = true := by decide +kernel +set_option maxHeartbeats 8000000 in +-- Needed for large symbolic execution or decision procedure +theorem lem_11 : (lem_0S (((2 ^ 12) * (2 ^ 12)) % 6337) || lem_0e 12 6337 lem_0S 0) = false := by + decide +kernel +set_option maxHeartbeats 8000000 in +-- Needed for large symbolic execution or decision procedure +theorem lem_12 : (lem_0T (((2 ^ 14) * (2 ^ 14)) % 23041) || lem_0e 14 23041 lem_0T 0) = false := by + decide +kernel +set_option maxHeartbeats 8000000 in +-- Needed for large symbolic execution or decision procedure +theorem lem_13 : (lem_0U (((2 ^ 15) * (2 ^ 15)) % 37441) || lem_0e 15 37441 lem_0U 0) = false := by + decide +kernel +set_option maxHeartbeats 8000000 in +-- Needed for large symbolic execution or decision procedure +theorem lem_14 : (lem_0V (((2 ^ 15) * (2 ^ 15)) % 65537) || lem_0e 15 65537 lem_0V 0) = false := by + decide +kernel +set_option maxHeartbeats 8000000 in +-- Needed for large symbolic execution or decision procedure +theorem lem_15 : lem_0R.filter lem_0W = [] := by decide +kernel +theorem lem_16 (p n a r : Nat) : + lem_0n (n % p) (a % p) r % p = lem_0n n a r % p := by + unfold lem_0n + split_ifs <;> simp only [Nat.add_mod, Nat.mul_mod, Nat.mod_mod] +theorem lem_17 (s : Row) : lem_0q (lem_0m 96 s) = lem_0q s := by + rcases s with ⟨l, n, a, r⟩ + simp only [lem_0q, lem_0m, lem_0o, lem_0p, sNat_eq] + have h32 : lem_0n (n % 96) (a % 96) r % 32 = lem_0n n a r % 32 := by + rw [<- Nat.mod_mod_of_dvd (lem_0n (n % 96) (a % 96) r) (⟨3, rfl⟩ : 32 ∣ 96), + lem_16 96 n a r, + Nat.mod_mod_of_dvd (lem_0n n a r) (⟨3, rfl⟩ : 32 ∣ 96)] + have h96 : lem_0n (n % 96) (a % 96) r % 96 = lem_0n n a r % 96 := lem_16 96 n a r + have hl2 : (l % 96) % 2 = l % 2 := Nat.mod_mod_of_dvd l ⟨48, rfl⟩ + rw [h32, h96, hl2] +theorem lem_18 (l n a r y : Nat) + (ha_even : a % 2 = 0) (hr : r = 1 \/ r = 2) + (hok : lem_0q (l, n, a, r) = true) : + 2 ^ (l + 2 * n + r + 3) + 1 ≠ + y * y + ((2 * r - 1) * 2 ^ (2 * n + 2) + 5 * 2 ^ (a + 1)) := by + intro hsq + have hmv := lem_0X + simp only [Bool.and_eq_true] at hmv + rcases hmv with ⟨⟨⟨⟨⟨⟨hm6, hm12⟩, hm24⟩, hm48⟩, hm96⟩, hm288⟩, hm1440⟩ + have h_in6 : lem_0m 6 (l, n, a, r) ∈ lem_0I := by + apply lem_0H lem_0I_sub + apply lem_0A 6 [3, 7, 9] _ (l, n, a, r) y (by decide) hm6 hsq + apply lem_0C + · exact List.mem_range.mpr (Nat.mod_lt l (by decide)) + · exact List.mem_range.mpr (Nat.mod_lt n (by decide)) + · have ha6 : a % 6 < 6 := Nat.mod_lt a (by decide) + have ha2 : (a % 6) % 2 = a % 2 := Nat.mod_mod_of_dvd a ⟨3, rfl⟩ + simp only [List.mem_cons, List.not_mem_nil, or_false] + omega + · simp only [List.mem_cons, List.not_mem_nil, or_false]; exact hr + have h_in12 : lem_0m 12 (l, n, a, r) ∈ lem_0J := + lem_0H lem_0J_sub + (lem_0A 12 [5, 13] _ (l, n, a, r) y (by decide +kernel) hm12 hsq + (lem_0E 6 2 lem_0I (l, n, a, r) (by decide +kernel) (by decide +kernel) h_in6)) + have h_in24 : lem_0m 24 (l, n, a, r) ∈ lem_0K := + lem_0H lem_0K_sub + (lem_0A 24 [17, 241] _ (l, n, a, r) y (by decide +kernel) hm24 hsq + (lem_0E 12 2 lem_0J (l, n, a, r) (by decide +kernel) (by decide +kernel) h_in12)) + have h_in48 : lem_0m 48 (l, n, a, r) ∈ lem_0L := + lem_0H lem_0L_sub + (lem_0A 48 [97, 257, 673] _ (l, n, a, r) y (by decide +kernel) hm48 hsq + (lem_0E 24 2 lem_0K (l, n, a, r) (by decide +kernel) (by decide +kernel) h_in24)) + have h_in96 : lem_0m 96 (l, n, a, r) ∈ lem_0N := by + apply lem_0H lem_0Y + apply lem_0A 96 [193] _ (l, n, a, r) y (by decide +kernel) hm96 hsq + rw [List.mem_filter] + refine ⟨lem_0E 48 2 lem_0L (l, n, a, r) (by decide +kernel) (by decide +kernel) h_in48, ?_⟩ + rw [lem_17]; exact hok + have h_in288 : lem_0m 288 (l, n, a, r) ∈ lem_0P := + lem_0H lem_0Z + (lem_0A 288 _ _ (l, n, a, r) y (by decide +kernel) hm288 hsq + (lem_0E 96 3 lem_0N (l, n, a, r) (by decide +kernel) (by decide +kernel) h_in96)) + have h_in1440 : lem_0m 1440 (l, n, a, r) ∈ lem_0R := + lem_0H lem_10 + (lem_0A 1440 _ _ (l, n, a, r) y (by decide +kernel) hm1440 hsq + (lem_0E 288 5 lem_0P (l, n, a, r) (by decide +kernel) (by decide +kernel) h_in288)) + have h_final : lem_0m 1440 (l, n, a, r) ∈ lem_0R.filter lem_0W := by + rw [List.mem_filter] + refine ⟨h_in1440, ?_⟩ + unfold lem_0W + rw [lem_0u 1440 6337, lem_0v 1440 6337 (l, n, a, + r) y (by decide +kernel) (by decide +kernel) (by + decide +kernel) hsq, + lem_0u 1440 23041, lem_0v 1440 23041 (l, n, a, + r) y (by decide +kernel) (by decide +kernel) (by + decide +kernel) hsq, + lem_0u 1440 37441, lem_0v 1440 37441 (l, n, a, + r) y (by decide +kernel) (by decide +kernel) (by + decide +kernel) hsq, + lem_0u 1440 65537, lem_0v 1440 65537 (l, n, a, + r) y (by decide +kernel) (by decide +kernel) (by + decide +kernel) hsq, + lem_0g 12 6337 lem_0S y (by decide +kernel) (by decide +kernel) lem_11, + lem_0g 14 23041 lem_0T y (by decide +kernel) (by decide +kernel) lem_12, + lem_0g 15 37441 lem_0U y (by decide +kernel) (by decide +kernel) lem_13, + lem_0g 15 65537 lem_0V y (by decide +kernel) (by decide +kernel) lem_14] + rfl + rw [lem_15] at h_final + nomatch h_final +def lem_19 (x : Nat) : Prop := + x % 128 = 47 \/ x % 128 = 63 \/ x % 128 = 107 \/ x % 128 = 127 +structure Weak (l x : Nat) : Prop where + weak_length : 18 <= l + weak_pos : 0 < x + weak_bound : x < 2 ^ l + weak_low : lem_19 x + weak_exc : lem_0p l x = false +structure Inv (l x : Nat) : Prop where + inv_weak : Weak l x + inv_half : ∀ q, x + 1 ≠ 2 * q * q + inv_disc : ∀ q, 2 * x + 3 ≠ q * q +def lem_1a (l n r : Nat) : Nat := l + 2 * n + r + 2 +def lem_1b (l n a r : Nat) : Nat := + 2 ^ (lem_1a l n r) - (2 * r - 1) * 2 ^ (2 * n + 1) - 5 * 2 ^ a - 1 +theorem lem_1c {q : Nat} (h : (q * q) % 2 = 0) : q % 2 = 0 := by + have hdiv : q = 2 * (q / 2) + q % 2 := (Nat.div_add_mod q 2).symm + rcases (by omega : q % 2 = 0 \/ q % 2 = 1) with h0 | h1 + · exact h0 + · exfalso + have hsq : q * q = 2 * (2 * (q / 2) * (q / 2) + 2 * (q / 2)) + 1 := by + conv_lhs => rw [hdiv, h1] + ring + omega +theorem lem_1d (k u : Nat) (hu : u % 2 = 1) : + ∀ q, 4 ^ k * u ≠ 2 * q * q := by + induction k with + | zero => + intro q h + simp only [Nat.pow_zero, Nat.one_mul, Nat.mul_assoc] at h + omega + | succ k ih => + intro q h + have h5 : 4 ^ (k + 1) * u = 4 * (4 ^ k * u) := by rw [Nat.pow_succ]; ring + have hq_even : (q * q) % 2 = 0 := by + rw [Nat.mul_assoc 2 q q] at h + omega + have hq2 : q % 2 = 0 := lem_1c hq_even + have hq_eq : q = 2 * (q / 2) := by omega + apply ih (q / 2) + have h4 : 2 * q * q = 4 * (2 * (q / 2) * (q / 2)) := by + conv_lhs => rw [hq_eq] + ring + omega +theorem lem_1e {x : Nat} (h : lem_19 x) : x % 4 = 3 := by + unfold lem_19 at h + omega +theorem lem_1f (l x : Nat) (hinv : Inv l x) : + ∃ n a r, 1 <= n /\ a <= 2 * n - 2 /\ (r = 1 \/ r = 2) /\ x = lem_0n n a r := by + rcases hinv with ⟨⟨_, _, _, hlow, _⟩, hhalf, hdisc⟩ + have hx4 : x % 4 = 3 := lem_1e hlow + set y := x / 2 + 1 + have hy : 1 <= y /\ x + 1 = 2 * y := by omega + set q := Nat.sqrt y + have hq_le : q * q <= y := Nat.sqrt_le y + have hq_lt : y < (q + 1) * (q + 1) := Nat.lt_succ_sqrt y + have hq_ne : q * q ≠ y := by + intro heq + apply hhalf q + rw [Nat.mul_assoc, heq] + omega + have hq_strict : q * q < y := by omega + have hq_pos : 1 <= q := by + by_contra h + have h0 : q = 0 := by omega + rw [h0] at hq_strict hq_lt + omega + have hadj : y ≠ q * (q + 1) := by + intro heq + apply hdisc (2 * q + 1) + calc 2 * x + 3 = 4 * y + 1 := by omega + _ = 4 * (q * (q + 1)) + 1 := by rw [heq] + _ = (2 * q + 1) * (2 * q + 1) := by ring + rcases (by omega : y < q * (q + 1) \/ q * (q + 1) < y) with hlt | hgt + · have hq2 : 2 <= q := by nlinarith + have hqq : 2 * q * q = 2 * (q * q) := Nat.mul_assoc 2 q q + refine ⟨q - 1, x - 2 * (q * q) - 1, 2, by omega, ?_, Or.inr rfl, ?_⟩ + · have h1 : q * (q + 1) = q * q + q := by ring + omega + · unfold lem_0n + have hne : (2 == 1) = false := rfl + have hq_sub : q - 1 + 1 = q := by omega + rw [hne] + simp only [Bool.false_eq_true, ↓reduceIte, hq_sub, hqq] + omega + · have hqq1 : 2 * q * (q + 1) = 2 * (q * (q + 1)) := Nat.mul_assoc 2 q (q + 1) + refine ⟨q, x - 2 * (q * (q + 1)) - 1, 1, hq_pos, ?_, Or.inl rfl, ?_⟩ + · have h1 : (q + 1) * (q + 1) = q * (q + 1) + q + 1 := by ring + omega + · unfold lem_0n + have heq1 : (1 == 1) = true := rfl + rw [heq1] + simp only [↓reduceIte, hqq1] + omega +theorem lem_1g (n a r : Nat) (hn : 1 <= n) (ha : a <= 2 * n - 2) + (hr : r = 1 \/ r = 2) (hlow : lem_19 (lem_0n n a r)) : + 3 <= n /\ 2 <= a /\ a % 2 = 0 /\ (r = 1 -> a % 4 = 2) /\ (r = 2 -> 4 <= a) := by + have hx4 : lem_0n n a r % 4 = 3 := lem_1e hlow + have ha_even : a % 2 = 0 := by + rcases hr with rfl | rfl + · unfold lem_0n at hx4 + have heq1 : (1 == 1) = true := rfl + rw [heq1, ite_eq_left rfl, Nat.mul_assoc 2 n (n + 1)] at hx4 + omega + · unfold lem_0n at hx4 + have hne : (2 == 1) = false := rfl + rw [hne, ite_eq_right Bool.noConfusion, Nat.mul_assoc 2 (n + 1) (n + 1)] at hx4 + omega + have hr1 : r = 1 -> a % 4 = 2 := by + intro h1; subst h1 + unfold lem_0n at hx4 + have heq1 : (1 == 1) = true := rfl + rw [heq1, ite_eq_left rfl] at hx4 + have hn_div : 2 * n * (n + 1) = + 4 * (2 * (n / 2) * (n / 2) + 2 * (n / 2) * (n % 2) + n / 2) + 2 * (n % 2) * (n % 2 + 1) := + by + have hdiv : n = 2 * (n / 2) + n % 2 := (Nat.div_add_mod n 2).symm + conv_lhs => rw [hdiv] + ring + have hrem : 2 * (n % 2) * (n % 2 + 1) % 4 = 0 := by + rcases (by omega : n % 2 = 0 \/ n % 2 = 1) with h0 | h1 + · rw [h0] + · rw [h1] + rw [hn_div] at hx4 + omega + have hr2 : r = 2 -> 4 <= a := by + intro h2; subst h2 + by_contra hlt4 + have ha02 : a = 0 \/ a = 2 := by omega + unfold lem_19 lem_0n at hlow + have hne : (2 == 1) = false := rfl + rw [hne, ite_eq_right Bool.noConfusion] at hlow + set m := n + 1 + have hm16 : 2 * m * m + a + 1 = + 64 * (8 * (m / 16) * (m / 16) + (m / 16) * (m % 16)) + (2 * (m % 16) * (m % 16) + a + + 1) := by + have hdiv : m = 16 * (m / 16) + m % 16 := (Nat.div_add_mod m 16).symm + conv_lhs => rw [hdiv] + ring + have hlow64 : (2 * m * m + a + 1) % 64 = 47 \/ (2 * m * m + a + 1) % 64 = 63 \/ + (2 * m * m + a + 1) % 64 = 43 := by omega + rw [hm16] at hlow64 + have hmod64 : (64 * (8 * (m / 16) * (m / 16) + (m / 16) * (m % 16)) + (2 * (m % 16) * (m % 16) + + a + 1)) % 64 = + (2 * (m % 16) * (m % 16) + a + 1) % 64 := Nat.mul_add_mod _ _ _ + rw [hmod64] at hlow64 + have hlt16 : m % 16 < 16 := Nat.mod_lt m (by decide) + generalize m % 16 = k at hlt16 hlow64 + rcases ha02 with rfl | rfl <;> (revert k; decide +kernel) + have ha2 : 2 <= a := by + rcases hr with rfl | rfl + · have := hr1 rfl; omega + · have := hr2 rfl; omega + have hbig : 47 <= lem_0n n a r := by + unfold lem_19 at hlow; omega + have ha' : a + 2 <= 2 * n := by omega + have hn3 : 3 <= n := by + rcases hr with rfl | rfl + · unfold lem_0n at hbig + have heq1 : (1 == 1) = true := rfl + rw [heq1, ite_eq_left rfl] at hbig + nlinarith + · unfold lem_0n at hbig + have hne : (2 == 1) = false := rfl + rw [hne, ite_eq_right Bool.noConfusion] at hbig + nlinarith + exact ⟨hn3, ha2, ha_even, hr1, hr2⟩ +def lem_1h (l n a r : Nat) : Nat := + 2 ^ (2 * n + 1 - a) * (2 ^ (l + r + 1) - (2 * r - 1)) - 5 +theorem lem_1i (l n a r : Nat) (hl : 18 <= l) (ha2 : 2 <= a) (ha : a <= 2 * n - 2) + (ha_even : a % 2 = 0) (hr : r = 1 \/ r = 2) : + 18 <= lem_1a l n r /\ + (2 * r - 1) * 2 ^ (2 * n + 1) + 5 * 2 ^ a + 1 < 2 ^ (lem_1a l n r) /\ + 0 < lem_1b l n a r /\ + lem_1b l n a r < 2 ^ (lem_1a l n r) /\ + (∀ q, lem_1b l n a r + 1 ≠ 2 * q * q) := by + have he1 : l + 2 * n + r + 2 = a + (2 * n + 1 - a) + (l + r + 1) := by omega + have he2 : 2 * n + 1 = a + (2 * n + 1 - a) := by omega + have hA : 4 <= 2 ^ a := by + obtain ⟨k, rfl⟩ : ∃ k, a = k + 2 := ⟨a - 2, by omega⟩ + rw [Nat.pow_add] + have := Nat.one_le_pow k 2 (by decide) + omega + have hB : 8 <= 2 ^ (2 * n + 1 - a) := by + obtain ⟨k, hk⟩ : ∃ k, 2 * n + 1 - a = k + 3 := ⟨2 * n - 2 - a, by omega⟩ + rw [hk, Nat.pow_add] + have := Nat.one_le_pow k 2 (by decide) + omega + have hC : 16 <= 2 ^ (l + r + 1) := by + obtain ⟨k, hk⟩ : ∃ k, l + r + 1 = k + 4 := ⟨l + r - 3, by omega⟩ + rw [hk, Nat.pow_add] + have := Nat.one_le_pow k 2 (by decide) + omega + have hR : 1 <= 2 * r - 1 /\ 2 * r - 1 <= 3 := by omega + have hpow1 : 2 ^ (lem_1a l n r) = 2 ^ a * (2 ^ (2 * n + 1 - a) * 2 ^ (l + r + 1)) := by + unfold lem_1a + rw [he1, Nat.pow_add, Nat.pow_add, Nat.mul_assoc] + have hpow2 : (2 * r - 1) * 2 ^ (2 * n + 1) = 2 ^ a * (2 ^ (2 * n + 1 - a) * (2 * r - 1)) := by + conv_lhs => rw [he2, Nat.pow_add] + ring + have hB_even : (2 ^ (2 * n + 1 - a)) % 2 = 0 := by + obtain ⟨k, hk⟩ : ∃ k, 2 * n + 1 - a = k + 1 := ⟨2 * n - a, by omega⟩ + rw [hk, Nat.pow_succ] + omega + have ha_pow4 : 2 ^ a = 4 ^ (a / 2) := by + have ha_div : a = 2 * (a / 2) := by omega + conv_lhs => rw [ha_div, Nat.pow_mul] + have hBC : 2 ^ (2 * n + 1 - a) * (2 * r - 1) + 6 <= 2 ^ (2 * n + 1 - a) * 2 ^ (l + r + 1) := by + nlinarith + have h_ineq : (2 * r - 1) * 2 ^ (2 * n + 1) + 5 * 2 ^ a + 1 < 2 ^ (lem_1a l n r) := by + rw [hpow1, hpow2] + nlinarith + refine ⟨by unfold lem_1a; omega, h_ineq, by unfold lem_1b; omega, by unfold lem_1b; omega, ?_⟩ + set A := 2 ^ a + set B := 2 ^ (2 * n + 1 - a) + set C := 2 ^ (l + r + 1) + set R := 2 * r - 1 + intro q hq + have hfactor : lem_1b l n a r + 1 = A * lem_1h l n a r := by + have h_odd_mul : A * lem_1h l n a r = A * (B * C) - A * (B * R) - 5 * A := by + unfold lem_1h + rw [Nat.mul_sub_left_distrib A, Nat.mul_sub_left_distrib B, Nat.mul_sub_left_distrib + A, Nat.mul_comm A 5] + unfold lem_1b + rw [h_odd_mul, hpow1, hpow2] + omega + have hodd : lem_1h l n a r % 2 = 1 := by + change (B * (C - R) - 5) % 2 = 1 + have hB_div : B = 2 * (B / 2) := by omega + have hCR : 13 <= C - R := by omega + have hB2 : 4 <= B / 2 := by omega + have hprod : B * (C - R) = 2 * ((B / 2) * (C - R)) := by + conv_lhs => rw [hB_div] + ring + have hge : 52 <= (B / 2) * (C - R) := by nlinarith + rw [hprod] + omega + rw [hfactor, ha_pow4] at hq + exact lem_1d (a / 2) (lem_1h l n a r) hodd q hq +theorem lem_1j (e : Nat) (he : 7 <= e) : 2 ^ e % 128 = 0 := by + obtain ⟨k, rfl⟩ : ∃ k, e = k + 7 := ⟨e - 7, by omega⟩ + rw [Nat.pow_add] + omega +theorem lem_1k (e : Nat) (he : 5 <= e) : + 2 ^ e % 96 = if e % 2 == 0 then 64 else 32 := by + obtain ⟨k, rfl⟩ : ∃ k, e = k + 5 := ⟨e - 5, by omega⟩ + clear he + induction k with + | zero => decide + | succ k ih => + have h1 : 2 ^ (k + 1 + 5) % 96 = (2 * (2 ^ (k + 5) % 96)) % 96 := by + rw [show k + 1 + 5 = (k + 5) + 1 by omega, Nat.pow_succ', Nat.mul_mod] + rcases (by omega : (k + 5) % 2 = 0 \/ (k + 5) % 2 = 1) with h0 | h0 + · have h2 : (k + 1 + 5) % 2 = 1 := by omega + have h10 : (1 == 0) = false := rfl + rw [h0, beq_self_eq_true, ite_eq_left rfl] at ih + rw [h2, h10, ite_eq_right Bool.noConfusion, h1, ih] + · have h2 : (k + 1 + 5) % 2 = 0 := by omega + have h10 : (1 == 0) = false := rfl + rw [h0, h10, ite_eq_right Bool.noConfusion] at ih + rw [h2, beq_self_eq_true, ite_eq_left rfl, h1, ih] +theorem lem_1l (m l n a r : Nat) (hm : 0 < m) + (hle : (2 * r - 1) * 2 ^ (2 * n + 1) + 5 * 2 ^ a + 1 < 2 ^ (lem_1a l n r)) : + lem_1b l n a r % m = + (2 ^ (lem_1a l n r) % m + m - + ((2 * r - 1) * (2 ^ (2 * n + 1) % m) + 5 * (2 ^ a % m) + 1) % m) % m := by + have heq : 2 ^ (lem_1a l n r) = + lem_1b l n a r + ((2 * r - 1) * 2 ^ (2 * n + 1) + 5 * 2 ^ a + 1) := by + unfold lem_1b; omega + have h1 := lem_0l hm heq + have h2 : ((2 * r - 1) * (2 ^ (2 * n + 1) % m) + 5 * (2 ^ a % m) + 1) % m = + ((2 * r - 1) * 2 ^ (2 * n + 1) + 5 * 2 ^ a + 1) % m := by + simp only [Nat.add_mod, Nat.mul_mod, Nat.mod_mod] + rw [h2, h1] +theorem lem_1m (l n a r : Nat) (hl : 18 <= l) (hn : 3 <= n) (ha2 : 2 <= a) + (ha_even : a % 2 = 0) (hr : r = 1 \/ r = 2) + (hr1 : r = 1 -> a % 4 = 2) (hr2 : r = 2 -> 4 <= a) + (hle : (2 * r - 1) * 2 ^ (2 * n + 1) + 5 * 2 ^ a + 1 < 2 ^ (lem_1a l n r)) : + lem_19 (lem_1b l n a r) /\ lem_0p (lem_1a l n r) (lem_1b l n a r) = false := by + have hL7 : 7 <= lem_1a l n r := by unfold lem_1a; omega + have hN7 : 7 <= 2 * n + 1 := by omega + have h128 : lem_1b l n a r % 128 = (128 - (5 * (2 ^ a % 128) + 1) % 128) % 128 := by + rw [lem_1l 128 l n a r (by decide) hle, + lem_1j _ hL7, lem_1j _ hN7] + simp + have hgood : lem_19 (lem_1b l n a r) := by + unfold lem_19 + rw [h128] + rcases (by omega : a = 2 \/ a = 4 \/ a = 6 \/ 8 <= a) with rfl | rfl | rfl | ha8 + · decide + · decide + · decide + · rw [lem_1j a (by omega)]; decide + refine ⟨hgood, ?_⟩ + unfold lem_0p + rw [lem_1l 96 l n a r (by decide) hle, + lem_1k (lem_1a l n r) (by omega), + lem_1k (2 * n + 1) (by omega)] + have hn_odd : (2 * n + 1) % 2 = 1 := by omega + rw [hn_odd] + rcases hr with rfl | rfl + · have ha4 := hr1 rfl + rcases (by omega : a = 2 \/ 6 <= a) with rfl | ha6 + · rcases (by omega : lem_1a l n 1 % 2 = 0 \/ lem_1a l n 1 % 2 = 1) with h0 | h1 + · simp [h0] + · simp [h1] + · rw [lem_1k a (by omega), ha_even] + rcases (by omega : lem_1a l n 1 % 2 = 0 \/ lem_1a l n 1 % 2 = 1) with h0 | h1 + · simp [h0] + · simp [h1] + · have ha4 := hr2 rfl + rcases (by omega : a = 4 \/ 6 <= a) with rfl | ha6 + · rcases (by omega : lem_1a l n 2 % 2 = 0 \/ lem_1a l n 2 % 2 = 1) with h0 | h1 + · simp [h0] + · simp [h1] + · rw [lem_1k a (by omega), ha_even] + rcases (by omega : lem_1a l n 2 % 2 = 0 \/ lem_1a l n 2 % 2 = 1) with h0 | h1 + · simp [h0] + · simp [h1] +theorem lem_1n (l n a r : Nat) (hw : Weak l (lem_0n n a r)) + (hn : 1 <= n) (ha : a <= 2 * n - 2) (hr : r = 1 \/ r = 2) : + Inv (lem_1a l n r) (lem_1b l n a r) := by + rcases hw with ⟨hl, _, _, hlow, hexc⟩ + rcases lem_1g n a r hn ha hr hlow with ⟨hn3, ha2, ha_even, hr1, hr2⟩ + rcases lem_1i l n a r hl ha2 ha ha_even hr with ⟨hL, hle, hpos, hbound, hhalf⟩ + rcases lem_1m l n a r hl hn3 ha2 ha_even hr hr1 hr2 hle with ⟨hlow', hexc'⟩ + refine ⟨⟨hL, hpos, hbound, hlow', hexc'⟩, hhalf, ?_⟩ + intro q hq + have hok : lem_0q (l, n, a, r) = true := by + unfold lem_0q + have hinp : lem_0o (lem_0n n a r) = true := by + unfold lem_0o; unfold lem_19 at hlow + simp only [Bool.or_eq_true, beq_iff_eq] + omega + simp [hinp, hexc] + apply lem_18 l n a r q ha_even hr hok + have h1 : 2 ^ (l + 2 * n + r + 3) = 2 * 2 ^ (lem_1a l n r) := by + unfold lem_1a + rw [show l + 2 * n + r + 3 = (l + 2 * n + r + 2) + 1 by omega, Nat.pow_succ'] + have h2 : (2 * r - 1) * 2 ^ (2 * n + 2) = 2 * ((2 * r - 1) * 2 ^ (2 * n + 1)) := by + rw [show 2 * n + 2 = (2 * n + 1) + 1 by omega, Nat.pow_succ'] + ring + have h3 : 5 * 2 ^ (a + 1) = 2 * (5 * 2 ^ a) := by + rw [Nat.pow_succ'] + ring + unfold lem_1b at hq + omega +theorem lem_1o : Inv 18 260799 := by + refine ⟨⟨by decide, by decide, by decide, Or.inr (Or.inl (by decide)), by decide⟩, ?_, ?_⟩ + · intro q hq + rw [Nat.mul_assoc] at hq + have h0 : q * q = 130400 := by omega + have h2 : lem_02 (lem_0c 3) ((q * q) % 3) = true := lem_0d 3 q (by decide) (by decide) + rw [h0] at h2 + revert h2; decide + · intro q hq + have h2 : lem_02 (lem_0c 9) ((q * q) % 9) = true := lem_0d 9 q (by decide) (by decide) + rw [<- hq] at h2 + revert h2; decide +@[simp] theorem lem_Mz (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := + rfl +@[simp] theorem lem_Mo (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M + config := rfl +@[simp] theorem lem_Ms (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] +@[simp] theorem lem_1q : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem lem_Dh : (default : TapeBlank).head = 0 := rfl +@[simp] theorem lem_Dt : (default : TapeBlank).tail = default := rfl +@[simp] theorem append_nil (s : TapeBlank) : ([] : FinWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : FinWord) (s : TapeBlank) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : FinWord) (s : TapeBlank) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append, append_cons, ih] +theorem lem_Sm {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢^{1} c₂ := by simp [h] +theorem lem_1r {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢⁺ c₂ := ⟨1, by decide, lem_Sm tm c₁ c₂ h⟩ +theorem lem_Ma {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, lem_Ms, ih, Option.bind_assoc] + simp_rw [lem_Ms] +theorem lem_Mt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c3 : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c3) : + c₁ [tm]⊢^{n+m} c3 := by + rw [lem_Ma, h₁]; simp [h₂] +theorem lem_St {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c3) : c₁ [tm]⊢* c3 := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lem_Mt tm c₁ c₂ c3 n m hn hm⟩ +theorem lem_Ps {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ +theorem lem_Pt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c3) : c₁ [tm]⊢⁺ c3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, by omega, lem_Mt tm c₁ c₂ c3 n m hn hm⟩ +theorem lem_1s {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c3) : c₁ [tm]⊢⁺ c3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), lem_Mt tm c₁ c₂ c3 n m hn hm⟩ +theorem lem_1t {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c3) : c₁ [tm]⊢⁺ c3 := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, by omega, lem_Mt tm c₁ c₂ c3 n m hn hm⟩ +theorem lem_1u {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c3) : c₁ [tm]⊢⁺ c3 := + lem_1s (lem_1r tm c₁ c₂ h₁) h₂ +macro "finish" : tactic => + `(tactic| exact ⟨0, rfl⟩) +macro "step" : tactic => + `(tactic| (try refine lem_Ps ?_) <;> + refine lem_1u (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, + Turing.ListBlank.head_cons, lem_Dh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, + Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, + lem_1q, lem_Dh, lem_Dt, append_cons, append_nil]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) +@[simp] theorem lem_1v {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem lem_Lp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem lem_1w {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem lem_1x {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm, lem_Lp, lem_Lp, ih, List.append_assoc] +theorem lem_1y {α : Type*} (l : List α) (n : Nat) : l ^ n ++ l = l ++ l ^ n := by + induction n with + | zero => simp + | succ n ih => rw [lem_Lp, List.append_assoc, ih] +theorem lem_1y' {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ^ n ++ l := by + rw [lem_Lp]; exact (lem_1y l n).symm +abbrev P11 : FinWord := [1, 1] +abbrev P01 : FinWord := [0, 1] +abbrev P00 : FinWord := [0, 0] +theorem lem_1z (k : Nat) (s : TapeBlank) : + ([1] : FinWord) +> (P11 ^ k +> s) = P11 ^ k +> ([1] +> s) := by + induction k with + | zero => rfl + | succ k ih => + simp only [lem_Lp, append_assoc, <- ih] + rfl +theorem lem_1A (k : Nat) (l r : TapeBlank) : + ((P11 ^ k +> l) <{{A}} r) [target_tm]⊢* (l <{{A}} (P01 ^ k +> r)) := by + induction k generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ k ih => + rw [lem_Lp P11 k, append_assoc, lem_1y' P01 k, append_assoc] + have h1 : ((P11 +> (P11 ^ k +> l)) <{{A}} r) [target_tm]⊢⁺ + ((P11 ^ k +> l) <{{A}} (P01 +> r)) := by + simp only [append_cons, append_nil]; execute + exact lem_Ps (lem_1s h1 (ih l (P01 +> r))) +theorem lem_1B (k : Nat) (l r : TapeBlank) : + (l {{B}}> (P11 ^ k +> r)) [target_tm]⊢* ((P11 ^ k +> l) {{B}}> r) := by + induction k generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ k ih => + have h_lhs : (l {{B}}> (P11 ^ (k + 1) +> r)) = (l {{B}}> (P11 +> (P11 ^ k +> r))) := by + rw [lem_Lp P11 k, append_assoc] + have h_rhs : ((P11 ^ (k + 1) +> l) {{B}}> r) = ((P11 ^ k +> (P11 +> l)) {{B}}> r) := by + rw [lem_1y' P11 k, append_assoc] + rw [h_lhs, h_rhs] + have h1 : (l {{B}}> (P11 +> (P11 ^ k +> r))) [target_tm]⊢⁺ + ((P11 +> l) {{B}}> (P11 ^ k +> r)) := by + simp only [append_cons, append_nil]; execute + exact lem_Ps (lem_1s h1 (ih (P11 +> l) r)) +theorem lem_1C (k : Nat) (l r : TapeBlank) : + (l {{D}}> (P01 ^ k +> r)) [target_tm]⊢* ((P11 ^ k +> l) {{D}}> r) := by + induction k generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ k ih => + rw [lem_Lp P01 k, append_assoc, lem_1y' P11 k, append_assoc] + have h1 : (l {{D}}> (P01 +> (P01 ^ k +> r))) [target_tm]⊢⁺ + ((P11 +> l) {{D}}> (P01 ^ k +> r)) := by + simp only [append_cons, append_nil]; execute + exact lem_Ps (lem_1s h1 (ih (P11 +> l) r)) +def lem_1D (b : Bool) : FinWord := + if b then P01 else P11 +def lem_1E : Nat -> Nat -> FinWord + | 0, _ => [] + | len + 1, n => lem_1D (n % 2 == 1) ++ lem_1E len (n / 2) +def RC (len n : Nat) : TapeBlank := + lem_1E len n +> ([1] +> default) +theorem lem_1F (len : Nat) : lem_1E len 0 = P11 ^ len := by + induction len with + | zero => rfl + | succ len ih => + have h0 : (0 % 2 == 1) = false := rfl + simp only [lem_1E, h0, lem_1D, Bool.false_eq_true, ↓reduceIte, + Nat.zero_div, ih, lem_Lp] +theorem lem_1G (len : Nat) : lem_1E len (2 ^ len - 1) = P01 ^ len := by + induction len with + | zero => rfl + | succ len ih => + have hpos : 1 <= 2 ^ len := Nat.one_le_pow len 2 (by decide) + have hmod : (2 ^ (len + 1) - 1) % 2 = 1 := by + rw [Nat.pow_succ']; omega + have hdiv : (2 ^ (len + 1) - 1) / 2 = 2 ^ len - 1 := by + rw [Nat.pow_succ']; omega + simp only [lem_1E, hmod, beq_self_eq_true, lem_1D, ↓reduceIte, hdiv, ih, lem_Lp] +theorem lem_1H (len1 len2 a b : Nat) (ha : a < 2 ^ len1) : + lem_1E (len1 + len2) (b * 2 ^ len1 + a) = lem_1E len1 a ++ lem_1E len2 b := by + induction len1 generalizing a with + | zero => + have ha0 : a = 0 := by omega + subst ha0 + simp [lem_1E] + | succ len1 ih => + have hpow : b * 2 ^ (len1 + 1) = 2 * (b * 2 ^ len1) := by rw [Nat.pow_succ']; ring + have h1 : (b * 2 ^ (len1 + 1) + a) % 2 = a % 2 := by omega + have h2 : (b * 2 ^ (len1 + 1) + a) / 2 = b * 2 ^ len1 + a / 2 := by omega + have ha2 : a / 2 < 2 ^ len1 := by + rw [Nat.pow_succ'] at ha + omega + rw [Nat.succ_add, lem_1E, lem_1E, h1, h2, ih (a / 2) ha2, List.append_assoc] +theorem lem_1I (len b : Nat) : + lem_1E (1 + len) (b * 2) = P11 ++ lem_1E len b := by + have h := lem_1H 1 len 0 b (by decide) + simpa [lem_1E, lem_1D] using h +theorem lem_1J (len b : Nat) : + lem_1E (1 + len) (b * 2 + 1) = P01 ++ lem_1E len b := by + have h := lem_1H 1 len 1 b (by decide) + simpa [lem_1E, lem_1D] using h +theorem lem_1K (k len b : Nat) : + lem_1E (k + len) (b * 2 ^ k + (2 ^ k - 1)) = P01 ^ k ++ lem_1E len b := by + have hpos : 1 <= 2 ^ k := Nat.one_le_pow k 2 (by decide) + rw [lem_1H k len (2 ^ k - 1) b (by omega), lem_1G] +theorem lem_1L (len n : Nat) (hn : n + 1 < 2 ^ len) (l r : TapeBlank) : + (l {{B}}> (lem_1E len (n + 1) +> r)) [target_tm]⊢⁺ + (l <{{A}} (lem_1E len n +> r)) := by + induction len generalizing n l with + | zero => omega + | succ len ih => + rcases (by omega : n % 2 = 0 \/ n % 2 = 1) with h0 | h1 + · have hm1 : ((n + 1) % 2 == 1) = true := by rw [beq_iff_eq]; omega + have hm0 : (n % 2 == 1) = false := by rw [beq_eq_false_iff_ne]; omega + have hd1 : (n + 1) / 2 = n / 2 := by omega + simp only [lem_1E, hm1, hm0, lem_1D, ↓reduceIte, Bool.false_eq_true, hd1, + append_assoc, append_cons, append_nil] + execute + · have hm1 : ((n + 1) % 2 == 1) = false := by rw [beq_eq_false_iff_ne]; omega + have hm0 : (n % 2 == 1) = true := by rw [beq_iff_eq]; omega + have hd1 : (n + 1) / 2 = n / 2 + 1 := by omega + have hlt : n / 2 + 1 < 2 ^ len := by + rw [Nat.pow_succ'] at hn; omega + simp only [lem_1E, hm1, hm0, lem_1D, ↓reduceIte, Bool.false_eq_true, hd1, append_assoc] + have hs1 : (l {{B}}> (P11 +> (lem_1E len (n / 2 + 1) +> r))) [target_tm]⊢⁺ + ((P11 +> l) {{B}}> (lem_1E len (n / 2 + 1) +> r)) := by + simp only [append_cons, append_nil]; execute + have hs2 := ih (n / 2) hlt (P11 +> l) + have hs3 : ((P11 +> l) <{{A}} (lem_1E len (n / 2) +> r)) [target_tm]⊢⁺ + (l <{{A}} (P01 +> (lem_1E len (n / 2) +> r))) := by + simp only [append_cons, append_nil]; execute + exact lem_Pt hs1 (lem_Pt hs2 hs3) +theorem lem_1M (len n : Nat) (hn : n + 1 < 2 ^ len) (l : TapeBlank) : + (l {{B}}> RC len (n + 1)) [target_tm]⊢⁺ (l <{{A}} RC len n) := + lem_1L len n hn l ([1] +> default) +def LC0 (a b : Nat) : TapeBlank := + [1, 1, 1, 0, 1] +> (P11 ^ b +> (P00 +> (P11 ^ a +> default))) +def LC1 (a b : Nat) : TapeBlank := + [1, 1, 1, 1, 0] +> (P11 ^ b +> (P00 +> (P11 ^ a +> default))) +theorem lem_1N (k : Nat) (s r : TapeBlank) : + (([1, 1, 1] +> (P11 ^ k +> (P00 +> s))) <{{A}} r) [target_tm]⊢⁺ + (([1] +> (P11 ^ k +> (P00 +> (P11 +> s)))) {{D}}> r) := by + have heq1 : ([1, 1, 1] : FinWord) +> (P11 ^ k +> (P00 +> s)) = + P11 ^ (k + 1) +> ([1] +> (P00 +> s)) := by + change P11 +> ([1] +> (P11 ^ k +> (P00 +> s))) = P11 ^ (k + 1) +> ([1] +> (P00 +> s)) + rw [lem_1z, <- append_assoc, <- lem_Lp] + rw [heq1] + have h1 := lem_1A (k + 1) ([1] +> (P00 +> s)) r + rw [lem_Lp P01 k, append_assoc] at h1 + have h2 : (([1] +> (P00 +> s)) <{{A}} (P01 +> (P01 ^ k +> r))) [target_tm]⊢⁺ + (([1] +> (P00 +> (P11 +> s))) {{D}}> (P01 ^ k +> r)) := by + simp only [append_cons, append_nil]; execute + have h3 := lem_1C k ([1] +> (P00 +> (P11 +> s))) r + rw [<- lem_1z] at h3 + exact lem_1t h1 (lem_1s h2 h3) +theorem lem_1O (a b : Nat) (r : TapeBlank) : + (LC0 a (b + 1) <{{A}} r) [target_tm]⊢⁺ (LC0 (a + 1) b {{B}}> r) := by + unfold LC0 + rw [lem_Lp P11 b, append_assoc, lem_Lp P11 a, append_assoc] + have h1 : (([1, 1, 1, 0, 1] +> (P11 +> (P11 ^ b +> (P00 +> (P11 ^ a +> default))))) <{{A}} r) + [target_tm]⊢⁺ + (([1, 1, 1] +> (P11 ^ b +> (P00 +> (P11 ^ a +> default)))) <{{A}} ([1, 1, 1, 1] +> r)) := by + simp only [append_cons, append_nil]; execute + have h2 := lem_1N b (P11 ^ a +> default) ([1, 1, 1, 1] +> r) + have h3 : (([1] +> (P11 ^ b +> (P00 +> (P11 +> (P11 ^ a +> default))))) {{D}}> ([1, 1, 1, + 1] +> r)) + [target_tm]⊢⁺ + (([1, 1, 1, 0, 1] +> (P11 ^ b +> (P00 +> (P11 +> (P11 ^ a +> default))))) {{B}}> r) := by + simp only [append_cons, append_nil]; execute + exact lem_Pt h1 (lem_Pt h2 h3) +theorem lem_1P (a b : Nat) (r : TapeBlank) : + (LC1 a (b + 1) <{{A}} r) [target_tm]⊢⁺ (LC1 (a + 1) b {{B}}> r) := by + unfold LC1 + rw [lem_Lp P11 b, append_assoc, lem_Lp P11 a, append_assoc] + have h1 : (([1, 1, 1, 1, 0] +> (P11 +> (P11 ^ b +> (P00 +> (P11 ^ a +> default))))) <{{A}} r) + [target_tm]⊢⁺ + (([1, 1, 1] +> (P11 ^ b +> (P00 +> (P11 ^ a +> default)))) <{{A}} ([1, 1, 0, 1] +> r)) := by + simp only [append_cons, append_nil]; execute + have h2 := lem_1N b (P11 ^ a +> default) ([1, 1, 0, 1] +> r) + have h3 : (([1] +> (P11 ^ b +> (P00 +> (P11 +> (P11 ^ a +> default))))) {{D}}> ([1, 1, 0, + 1] +> r)) + [target_tm]⊢⁺ + (([1, 1, 1, 1, 0] +> (P11 ^ b +> (P00 +> (P11 +> (P11 ^ a +> default))))) {{B}}> r) := by + simp only [append_cons, append_nil]; execute + exact lem_Pt h1 (lem_Pt h2 h3) +theorem lem_1Q (a : Nat) (r : TapeBlank) : + (LC0 (a + 1) 0 <{{A}} r) [target_tm]⊢⁺ (LC1 0 (a + 2) {{B}}> r) := by + unfold LC0 LC1 + have hd : (P00 +> (P11 ^ 0 +> default) : TapeBlank) = default := by + simp only [lem_1v, append_nil, append_cons, lem_1q] + rw [hd, lem_1v, append_nil, lem_Lp P11 (a + 1), append_assoc, lem_Lp P11 a, append_assoc] + simp only [append_cons, append_nil] + execute +theorem lem_1R (a : Nat) (r : TapeBlank) : + (LC1 a 0 <{{A}} r) [target_tm]⊢⁺ (LC0 1 a {{B}}> r) := by + unfold LC1 LC0 + have hd : (P00 +> default : TapeBlank) = default := by + simp only [append_cons, append_nil, lem_1q] + rw [lem_1v, append_nil, lem_1w] + have h1 : (([1, 1, 1, 1, 0] +> (P00 +> (P11 ^ a +> default))) <{{A}} r) + [target_tm]⊢⁺ + (([1, 1, 1] +> (P11 ^ a +> (P00 +> default))) <{{A}} ([1, 1, 1, 1] +> r)) := by + rw [hd]; simp only [append_cons, append_nil]; execute + have h2 := lem_1N a default ([1, 1, 1, 1] +> r) + have h3 : (([1] +> (P11 ^ a +> (P00 +> (P11 +> default)))) {{D}}> ([1, 1, 1, 1] +> r)) + [target_tm]⊢⁺ + (([1, 1, 1, 0, 1] +> (P11 ^ a +> (P00 +> (P11 +> default)))) {{B}}> r) := by + simp only [append_cons, append_nil]; execute + exact lem_Pt h1 (lem_Pt h2 h3) +inductive LRun : Nat -> TapeBlank -> TapeBlank -> Prop where + | zero (l : TapeBlank) : LRun 0 l l + | step {k : Nat} {l1 l2 l3 : TapeBlank} : + (∀ r, (l1 <{{A}} r) [target_tm]⊢⁺ (l2 {{B}}> r)) -> + LRun k l2 l3 -> LRun (k + 1) l1 l3 +theorem lem_1S {k1 k2 : Nat} {l1 l2 l3 : TapeBlank} + (h1 : LRun k1 l1 l2) (h2 : LRun k2 l2 l3) : LRun (k1 + k2) l1 l3 := by + induction h1 with + | zero _ => rw [Nat.zero_add]; exact h2 + | step hs _ ih => rw [Nat.succ_add]; exact LRun.step hs (ih h2) +theorem lem_1T {l1 l2 : TapeBlank} + (hs : ∀ r, (l1 <{{A}} r) [target_tm]⊢⁺ (l2 {{B}}> r)) : LRun 1 l1 l2 := + LRun.step hs (LRun.zero l2) +theorem lem_1U {k : Nat} {l1 l2 : TapeBlank} (h : LRun k l1 l2) + (len m : Nat) (hlt : m + k < 2 ^ len) : + (l1 {{B}}> RC len (m + k)) [target_tm]⊢* (l2 {{B}}> RC len m) := by + induction h generalizing m with + | zero l => exact ⟨0, rfl⟩ + | @step k l1 l_mid l2 hs hrest ih => + rw [show m + (k + 1) = (m + k) + 1 by omega] + have hdec := lem_1M len (m + k) (by omega) l1 + have hbounce := hs (RC len (m + k)) + have htail := ih m (by omega) + exact lem_Ps (lem_1s (lem_Pt hdec hbounce) htail) +theorem lem_1V (n a : Nat) : LRun n (LC0 1 (n + a)) (LC0 (n + 1) a) := by + induction n generalizing a with + | zero => + rw [Nat.zero_add] + exact LRun.zero _ + | succ n ih => + have h1 := ih (a + 1) + rw [show n + (a + 1) = n + 1 + a by omega] at h1 + exact lem_1S h1 (lem_1T (lem_1O (n + 1) a)) +theorem lem_1W (n a : Nat) : LRun n (LC1 0 (n + a)) (LC1 n a) := by + induction n generalizing a with + | zero => + rw [Nat.zero_add] + exact LRun.zero _ + | succ n ih => + have h1 := ih (a + 1) + rw [show n + (a + 1) = n + 1 + a by omega] at h1 + exact lem_1S h1 (lem_1T (lem_1P n a)) +theorem lem_1X (a : Nat) : LRun (a + 1) (LC0 1 a) (LC1 0 (a + 2)) := by + have h1 := lem_1V a 0 + rw [Nat.add_zero] at h1 + exact lem_1S h1 (lem_1T (lem_1Q a)) +theorem lem_1Y (a : Nat) : LRun (a + 1) (LC1 0 a) (LC0 1 a) := by + have h1 := lem_1W a 0 + rw [Nat.add_zero] at h1 + exact lem_1S h1 (lem_1T (lem_1R a)) +theorem lem_1Z (a : Nat) : LRun (2 * a + 4) (LC0 1 a) (LC0 1 (a + 2)) := by + have h := lem_1S (lem_1X a) (lem_1Y (a + 2)) + rw [show (a + 1) + (a + 2 + 1) = 2 * a + 4 by omega] at h + exact h +theorem lem_20 (a : Nat) : LRun (a * (a + 1) * 2) (LC0 1 0) (LC0 1 (2 * a)) := by + induction a with + | zero => exact LRun.zero _ + | succ a ih => + have h := lem_1S ih (lem_1Z (2 * a)) + rw [show a * (a + 1) * 2 + (2 * (2 * a) + 4) = (a + 1) * (a + 1 + 1) * 2 by ring] at h + exact h +theorem lem_21 (a b : Nat) (r : TapeBlank) : + ((P11 ^ (b + 2) +> (P00 +> (P11 ^ (a + 2) +> default))) <{{A}} r) [target_tm]⊢⁺ + (LC0 1 0 {{B}}> (P01 ^ a +> (P11 +> (P01 +> (P11 +> (P01 ^ b +> r)))))) := by + have h1 := lem_1A (b + 2) (P00 +> (P11 ^ (a + 2) +> default)) r + have h2 : ((P00 +> (P11 ^ (a + 2) +> default)) <{{A}} (P01 ^ (b + 2) +> r)) [target_tm]⊢⁺ + ((P11 ^ (a + 2) +> default) <{{A}} (P11 +> (P01 +> (P11 +> (P01 ^ b +> r))))) := by + rw [show b + 2 = 2 + b by omega, lem_1x P01 2 b, append_assoc, + show a + 2 = 1 + (a + 1) by omega, lem_1x P11 1 (a + 1), append_assoc] + simp only [lem_Lp, lem_1v, append_assoc, append_cons, append_nil]; execute + have h3 := lem_1A (a + 2) default (P11 +> (P01 +> (P11 +> (P01 ^ b +> r)))) + have h4 : (default <{{A}} (P01 ^ (a + 2) +> (P11 +> (P01 +> (P11 +> (P01 ^ b +> r)))))) + [target_tm]⊢⁺ + (LC0 1 0 {{B}}> (P01 ^ a +> (P11 +> (P01 +> (P11 +> (P01 ^ b +> r)))))) := by + unfold LC0 + rw [show a + 2 = 2 + a by omega, lem_1x P01 2 a, append_assoc] + simp only [lem_Lp, lem_1v, append_assoc, append_cons, append_nil] + execute + exact lem_1t h1 (lem_Pt (lem_1s h2 h3) h4) +theorem lem_22 (a b len : Nat) : + (LC0 (a + 2) (b + 1) {{B}}> RC len 0) [target_tm]⊢⁺ + (LC0 1 0 {{B}}> RC (len + a + b + 5) (2 ^ (len + a + b) * 32 - 2 ^ (a + b) * 8 - 2 ^ a * 5 - + 1)) := by + unfold RC + rw [lem_1F] + set s := P00 +> (P11 ^ (a + 2) +> default) + have h1 : (LC0 (a + 2) (b + 1) {{B}}> (P11 ^ len +> ([1] +> default))) [target_tm]⊢* + ((P11 ^ len +> ([1, 1, 1, 0, 1] +> (P11 ^ (b + 1) +> s))) {{B}}> ([1] +> default)) := + lem_1B len ([1, 1, 1, 0, 1] +> (P11 ^ (b + 1) +> s)) ([1] +> default) + have h2 : ((P11 ^ len +> ([1, 1, 1, 0, 1] +> (P11 ^ (b + 1) +> s))) {{B}}> ([1] +> default)) + [target_tm]⊢⁺ + (([1] +> (P11 ^ len +> ([1, 1, 1, 0, 1] +> (P11 ^ (b + 1) +> s)))) <{{A}} ([1] +> default)) := + by + simp only [append_cons, append_nil]; execute + have h2_eq : ([1] : FinWord) +> (P11 ^ len +> ([1, 1, 1, 0, 1] +> (P11 ^ (b + 1) +> s))) = + P11 ^ (len + 1) +> ([1, 1, 0, 1] +> (P11 ^ (b + 1) +> s)) := by + rw [lem_1z, lem_1y' P11 len, append_assoc] + simp only [append_cons, append_nil] + rw [h2_eq] at h2 + have h3 := lem_1A (len + 1) ([1, 1, 0, 1] +> (P11 ^ (b + 1) +> s)) ([1] +> default) + have h4 : (([1, 1, 0, 1] +> (P11 ^ (b + 1) +> s)) <{{A}} (P01 ^ (len + 1) +> ([1] +> default))) + [target_tm]⊢⁺ + ((P11 ^ (b + 2) +> s) <{{A}} (P11 +> (P01 ^ (len + 1) +> ([1] +> default)))) := by + rw [lem_Lp P11 (b + 1), append_assoc] + simp only [append_cons, append_nil]; execute + have h5 := lem_21 a b (P11 +> (P01 ^ (len + 1) +> ([1] +> default))) + have h_all := lem_1t h1 + (lem_Pt (lem_1s h2 h3) (lem_Pt h4 h5)) + have h_word : lem_1E (len + a + b + 5) (2 ^ (len + a + b) * 32 - 2 ^ (a + b) * 8 - 2 ^ a * 5 - 1) + +> + ([1] +> default) = + (P01 ^ a +> (P11 +> (P01 +> (P11 +> (P01 ^ b +> (P11 +> (P01 ^ (len + 1) +> ([1] +> + default)))))))) := by + have hlen : len + a + b + 5 = a + (1 + (1 + (1 + (b + (1 + (1 + len)))))) := by omega + have hval : 2 ^ (len + a + b) * 32 - 2 ^ (a + b) * 8 - 2 ^ a * 5 - 1 = + ((((((2 ^ len - 1) * 2 + 1) * 2) * 2 ^ b + (2 ^ b - 1)) * 2 * 2 + 1) * 2) * 2 ^ a + (2 ^ a - + 1) := by + obtain ⟨L, hL⟩ : ∃ L, 2 ^ len = L + 1 := + ⟨2 ^ len - 1, by have := Nat.one_le_pow len 2 (by decide); omega⟩ + obtain ⟨A, hA⟩ : ∃ A, 2 ^ a = A + 1 := + ⟨2 ^ a - 1, by have := Nat.one_le_pow a 2 (by decide); omega⟩ + obtain ⟨B, hB⟩ : ∃ B, 2 ^ b = B + 1 := + ⟨2 ^ b - 1, by have := Nat.one_le_pow b 2 (by decide); omega⟩ + rw [show len + a + b = len + (a + b) by omega, Nat.pow_add 2 len (a + b), Nat.pow_add 2 a + b, hL, hA, hB] + simp only [Nat.add_sub_cancel] + have hring : (L + 1) * ((A + 1) * (B + 1)) * 32 = + ((((((L * 2 + 1) * 2) * (B + 1) + B) * 2 * 2 + 1) * 2) * (A + 1) + A) + + ((A + 1) * (B + 1) * 8 + (A + 1) * 5 + 1) := by ring + omega + rw [hlen, hval, + lem_1K a, + lem_1I, + lem_1J, + lem_1I, + lem_1K b, + lem_1I, + lem_1J, + lem_1G, + lem_Lp P01 len] + simp only [append_assoc] + rw [h_word] + exact h_all +theorem lem_23 (a b len : Nat) : + (LC1 (a + 2) (b + 2) {{B}}> RC len 0) [target_tm]⊢⁺ + (LC0 1 0 {{B}}> RC (len + a + b + 6) (2 ^ (len + a + b) * 64 - 2 ^ (a + b) * 24 - 2 ^ a * 5 - + 1)) := by + unfold RC + rw [lem_1F] + set s := P00 +> (P11 ^ (a + 2) +> default) + have h1 : (LC1 (a + 2) (b + 2) {{B}}> (P11 ^ len +> ([1] +> default))) [target_tm]⊢* + ((P11 ^ len +> ([1, 1, 1, 1, 0] +> (P11 ^ (b + 2) +> s))) {{B}}> ([1] +> default)) := + lem_1B len ([1, 1, 1, 1, 0] +> (P11 ^ (b + 2) +> s)) ([1] +> default) + have h2 : ((P11 ^ len +> ([1, 1, 1, 1, 0] +> (P11 ^ (b + 2) +> s))) {{B}}> ([1] +> default)) + [target_tm]⊢⁺ + (([1] +> (P11 ^ len +> ([1, 1, 1, 1, 0] +> (P11 ^ (b + 2) +> s)))) <{{A}} ([1] +> default)) := + by + simp only [append_cons, append_nil]; execute + have h2_eq : ([1] : FinWord) +> (P11 ^ len +> ([1, 1, 1, 1, 0] +> (P11 ^ (b + 2) +> s))) = + P11 ^ (len + 1) +> ([1, 1, 1, 0] +> (P11 ^ (b + 2) +> s)) := by + rw [lem_1z, lem_1y' P11 len, append_assoc] + simp only [append_cons, append_nil] + rw [h2_eq] at h2 + have h3 := lem_1A (len + 1) ([1, 1, 1, 0] +> (P11 ^ (b + 2) +> s)) ([1] +> default) + have h4 : (([1, 1, 1, 0] +> (P11 ^ (b + 2) +> s)) <{{A}} (P01 ^ (len + 1) +> ([1] +> default))) + [target_tm]⊢⁺ + ((P11 ^ (b + 2) +> s) <{{A}} (P11 +> (P11 +> (P01 ^ (len + 1) +> ([1] +> default))))) := by + rw [lem_Lp P11 (b + 1), append_assoc] + simp only [append_cons, append_nil]; execute + have h5 := lem_21 a b (P11 +> (P11 +> (P01 ^ (len + 1) +> ([1] +> default)))) + have h_all := lem_1t h1 + (lem_Pt (lem_1s h2 h3) (lem_Pt h4 h5)) + have h_word : lem_1E (len + a + b + 6) (2 ^ (len + a + b) * 64 - 2 ^ (a + b) * 24 - 2 ^ a * 5 - 1) + +> + ([1] +> default) = + (P01 ^ a +> (P11 +> (P01 +> (P11 +> (P01 ^ b +> (P11 +> (P11 +> (P01 ^ (len + 1) +> ([1] +> + default))))))))) := by + have hlen : len + a + b + 6 = a + (1 + (1 + (1 + (b + (1 + (1 + (1 + len))))))) := by omega + have hval : 2 ^ (len + a + b) * 64 - 2 ^ (a + b) * 24 - 2 ^ a * 5 - 1 = + ((((((2 ^ len - 1) * 2 + 1) * 2 * 2) * 2 ^ b + (2 ^ b - 1)) * 2 * 2 + 1) * 2) * 2 ^ a + (2 ^ + a - 1) := by + obtain ⟨L, hL⟩ : ∃ L, 2 ^ len = L + 1 := + ⟨2 ^ len - 1, by have := Nat.one_le_pow len 2 (by decide); omega⟩ + obtain ⟨A, hA⟩ : ∃ A, 2 ^ a = A + 1 := + ⟨2 ^ a - 1, by have := Nat.one_le_pow a 2 (by decide); omega⟩ + obtain ⟨B, hB⟩ : ∃ B, 2 ^ b = B + 1 := + ⟨2 ^ b - 1, by have := Nat.one_le_pow b 2 (by decide); omega⟩ + rw [show len + a + b = len + (a + b) by omega, Nat.pow_add 2 len (a + b), Nat.pow_add 2 a + b, hL, hA, hB] + simp only [Nat.add_sub_cancel] + have hring : (L + 1) * ((A + 1) * (B + 1)) * 64 = + ((((((L * 2 + 1) * 2 * 2) * (B + 1) + B) * 2 * 2 + 1) * 2) * (A + 1) + A) + + ((A + 1) * (B + 1) * 24 + (A + 1) * 5 + 1) := by ring + omega + rw [hlen, hval, + lem_1K a, + lem_1I, + lem_1J, + lem_1I, + lem_1K b, + lem_1I, + lem_1I, + lem_1J, + lem_1G, + lem_Lp P01 len] + simp only [append_assoc] + rw [h_word] + exact h_all +def S' (len x : Nat) : Cfg (Fin 2) (Fin 6) := + LC0 1 0 {{B}}> RC len x +theorem lem_24 (n a b len : Nat) (hab : a + b + 2 = 2 * n) + (hlt : n * (n + 1) * 2 + (a + 1) < 2 ^ len) : + (S' len (n * (n + 1) * 2 + (a + 1))) [target_tm]⊢⁺ + (S' (len + a + b + 5) (2 ^ (len + a + b) * 32 - 2 ^ (a + b) * 8 - 2 ^ a * 5 - 1)) := by + unfold S' + have hrun : LRun (n * (n + 1) * 2 + (a + 1)) (LC0 1 0) (LC0 (a + 2) (b + 1)) := by + have h1 := lem_20 n + have h2 := lem_1V (a + 1) (b + 1) + rw [show (a + 1) + (b + 1) = 2 * n by omega] at h2 + exact lem_1S h1 h2 + have hinc := lem_1U hrun len 0 (by rw [Nat.zero_add]; exact hlt) + rw [Nat.zero_add] at hinc + exact lem_1t hinc (lem_22 a b len) +theorem lem_25 (n a b len : Nat) (hab : a + b + 2 = 2 * n) + (hlt : n * (n + 1) * 2 + ((n * 2 + 1) + (a + 2)) < 2 ^ len) : + (S' len (n * (n + 1) * 2 + ((n * 2 + 1) + (a + 2)))) [target_tm]⊢⁺ + (S' (len + a + b + 6) (2 ^ (len + a + b) * 64 - 2 ^ (a + b) * 24 - 2 ^ a * 5 - 1)) := by + unfold S' + have hrun : LRun (n * (n + 1) * 2 + ((n * 2 + 1) + (a + 2))) (LC0 1 0) (LC1 (a + 2) (b + 2)) := by + have h1 := lem_20 n + have h2 := lem_1X (2 * n) + have h3 := lem_1W (a + 2) (b + 2) + rw [show (a + 2) + (b + 2) = 2 * n + 2 by omega] at h3 + rw [show 2 * n = n * 2 by ring] at h1 h2 h3 + exact lem_1S h1 (lem_1S h2 h3) + have hinc := lem_1U hrun len 0 (by rw [Nat.zero_add]; exact hlt) + rw [Nat.zero_add] at hinc + exact lem_1t hinc (lem_23 a b len) +theorem lem_26 (l n a r : Nat) (hw : Weak l (lem_0n n a r)) + (hn : 1 <= n) (ha : a <= 2 * n - 2) (hr : r = 1 \/ r = 2) : + (S' l (lem_0n n a r)) [target_tm]⊢⁺ (S' (lem_1a l n r) (lem_1b l n a r)) := by + rcases hw with ⟨_, _, hbound, _, _⟩ + set b := 2 * n - 2 - a + have hab : a + b + 2 = 2 * n := by omega + rcases hr with rfl | rfl + · have hinp : lem_0n n a 1 = n * (n + 1) * 2 + (a + 1) := by + unfold lem_0n + change (if true then 2 * n * (n + 1) + a + 1 else 2 * (n + 1) * (n + 1) + a + 1) = _ + simp only [↓reduceIte] + ring + have hlen : lem_1a l n 1 = l + a + b + 5 := by unfold lem_1a; omega + have hval : lem_1b l n a 1 = 2 ^ (l + a + b) * 32 - 2 ^ (a + b) * 8 - 2 ^ a * 5 - 1 := by + unfold lem_1b lem_1a + have he1 : l + 2 * n + 1 + 2 = (l + a + b) + 5 := by omega + have he2 : 2 * n + 1 = (a + b) + 3 := by omega + rw [he1, he2, Nat.pow_add 2 (l + a + b) 5, Nat.pow_add 2 (a + b) 3] + change 2 ^ (l + a + b) * 32 - 1 * (2 ^ (a + b) * 8) - 5 * 2 ^ a - 1 = _ + omega + rw [hinp] at hbound ⊢ + rw [hlen, hval] + exact lem_24 n a b l hab hbound + · have hinp : lem_0n n a 2 = n * (n + 1) * 2 + ((n * 2 + 1) + (a + 2)) := by + unfold lem_0n + change (if false then 2 * n * (n + 1) + a + 1 else 2 * (n + 1) * (n + 1) + a + 1) = _ + simp only [Bool.false_eq_true, ↓reduceIte] + ring + have hlen : lem_1a l n 2 = l + a + b + 6 := by unfold lem_1a; omega + have hval : lem_1b l n a 2 = 2 ^ (l + a + b) * 64 - 2 ^ (a + b) * 24 - 2 ^ a * 5 - 1 := by + unfold lem_1b lem_1a + have he1 : l + 2 * n + 2 + 2 = (l + a + b) + 6 := by omega + have he2 : 2 * n + 1 = (a + b) + 3 := by omega + rw [he1, he2, Nat.pow_add 2 (l + a + b) 6, Nat.pow_add 2 (a + b) 3] + change 2 ^ (l + a + b) * 64 - 3 * (2 ^ (a + b) * 8) - 5 * 2 ^ a - 1 = _ + omega + rw [hinp] at hbound ⊢ + rw [hlen, hval] + exact lem_25 n a b l hab hbound +theorem lem_27 : + (init [] : Cfg (Fin 2) (Fin 6)) [target_tm]⊢* S' 18 260799 := by + have h1 : (init [] : Cfg (Fin 2) (Fin 6)) [target_tm]⊢⁺ (LC1 0 1 {{B}}> RC 6 57) := by + have hinit : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + have hbw : lem_1E 6 57 = [0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1] := rfl + rw [hinit] + unfold LC1 RC + rw [hbw] + simp only [lem_1v, lem_1w, append_cons, append_nil, lem_1q, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, lem_Dh, lem_Dt] + execute + have hrun : LRun 57 (LC1 0 1) (LC0 8 2) := by + have r1 := lem_1Y 1 + have r2 := lem_1Z 1 + have r3 := lem_1Z 3 + have r4 := lem_1Z 5 + have r5 := lem_1Z 7 + have r6 := lem_1V 7 2 + exact lem_1S r1 (lem_1S r2 (lem_1S r3 (lem_1S r4 (lem_1S r5 r6)))) + have h2 := lem_1U hrun 6 0 (by decide) + rw [Nat.zero_add] at h2 + have h3 := lem_22 6 1 6 + exact lem_Ps (lem_Pt (lem_1s h1 h2) h3) +theorem lem_1p : Weak 31 2144731135 := + ⟨by decide, by decide, by decide, Or.inr (Or.inr (Or.inr (by decide))), by decide⟩ +theorem lem_28 : + ((default : TapeBlank) {{B}}> default) [target_tm]⊢* S' 31 2144731135 := by + have h1 : ((default : TapeBlank) {{B}}> default) [target_tm]⊢⁺ + (LC1 0 1 {{B}}> RC 3 6) := by + have hbw : lem_1E 3 6 = [1, 1, 0, 1, 0, 1] := rfl + unfold LC1 RC + rw [hbw] + simp only [lem_1v, lem_1w, append_cons, append_nil, lem_1q, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, lem_Dh, lem_Dt] + execute + have hrun : LRun 6 (LC1 0 1) (LC1 2 1) := by + have r1 := lem_1Y 1 + have r2 := lem_1X 1 + have r3 := lem_1W 2 1 + exact lem_1S r1 (lem_1S r2 r3) + have h2 := lem_1U hrun 3 0 (by decide) + rw [Nat.zero_add] at h2 + have h3 : (LC1 2 1 {{B}}> RC 3 0) [target_tm]⊢⁺ S' 8 238 := by + have hbw0 : lem_1E 3 0 = [1, 1, 1, 1, 1, 1] := rfl + have hbw8 : lem_1E 8 238 = [1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1] := rfl + unfold LC1 S' LC0 RC + rw [hbw0, hbw8] + simp only [lem_Lp, lem_1v, append_assoc, append_cons, append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] + execute + have h4 := lem_24 10 17 1 8 (by decide) (by decide) + exact lem_Ps + (lem_Pt (lem_Pt (lem_1s h1 h2) h3) h4) +theorem lem_29 {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} + (h : c₁ [M]⊢⁺ c₂) : (step M c₁).isSome := by + rcases h with ⟨n, hn, hms⟩ + cases n with + | zero => omega + | succ n => + rw [Nat.add_comm n 1, lem_Ma, lem_Mo] at hms + cases hstep : step M c₁ with + | none => rw [hstep] at hms; simp at hms + | some c' => rfl +theorem lem_2a (M : Machine Γ Λ) (c : Cfg Γ Λ) (n : Nat) : + multiStep M c (n + 1) = (step M c).bind (fun c' => multiStep M c' n) := by + rw [Nat.add_comm n 1, lem_Ma, lem_Mo] +theorem lem_2b {M : Machine Γ Λ} {c0 c₁ c : Cfg Γ Λ} + {n m : Nat} (h1 : c0 [M]⊢^{n} c₁) (h2 : c0 [M]⊢^{m} c) : + (m <= n /\ c [M]⊢^{n - m} c₁) \/ (n < m /\ c₁ [M]⊢^{m - n} c) := by + induction n generalizing c0 m with + | zero => + simp only [lem_Mz, Option.some.injEq] at h1 + subst h1 + rcases m with _ | m + · simp only [lem_Mz, Option.some.injEq] at h2 + subst h2 + left; exact ⟨by omega, rfl⟩ + · right; exact ⟨by omega, h2⟩ + | succ n ih => + rcases m with _ | m + · simp only [lem_Mz, Option.some.injEq] at h2 + subst h2 + left; exact ⟨by omega, h1⟩ + · rw [lem_2a] at h1 h2 + cases hs : step M c0 with + | none => rw [hs] at h1; simp at h1 + | some c0' => + simp only [hs, Option.bind] at h1 h2 + rcases ih h1 h2 with ⟨hle, h⟩ | ⟨hlt, h⟩ + · left; refine ⟨by omega, ?_⟩; simpa only [Nat.succ_sub_succ_eq_sub] using h + · right; refine ⟨by omega, ?_⟩; simpa only [Nat.succ_sub_succ_eq_sub] using h +theorem lem_2c {M : Machine Γ Λ} {c c' : Cfg Γ Λ} + (h : c [M]⊢* c') (h' : (step M c').isSome) : (step M c).isSome := by + rcases h with ⟨k, hk⟩ + cases k with + | zero => + simp only [lem_Mz, Option.some.injEq] at hk + subst hk; exact h' + | succ k => + exact lem_29 ⟨k + 1, by omega, hk⟩ +theorem lem_2d (l x : Nat) (hinv : Inv l x) : + ∃ l' x', Inv l' x' /\ (S' l x) [target_tm]⊢⁺ (S' l' x') := by + rcases lem_1f l x hinv with ⟨n, a, r, hn, ha, hr, hxeq⟩ + have hw : Weak l (lem_0n n a r) := hxeq ▸ hinv.inv_weak + refine ⟨lem_1a l n r, lem_1b l n a r, lem_1n l n a r hw hn ha hr, ?_⟩ + rw [hxeq]; exact lem_26 l n a r hw hn ha hr +theorem lem_2e (l x : Nat) (hinv : Inv l x) : + (step target_tm (S' l x)).isSome := by + rcases lem_2d l x hinv with ⟨_, _, _, hstep⟩ + exact lem_29 hstep +theorem lem_2f (k : Nat) : + ∀ c l x, Inv l x -> ((S' l x) [target_tm]⊢^{k} c) -> (step target_tm c).isSome := by + induction k using Nat.strong_induction_on with + | h k ih => + intro c l x hinv hreach + rcases lem_2d l x hinv with ⟨l', x', hinv', m, hm_pos, hm⟩ + rcases lem_2b hm hreach with ⟨_, hd⟩ | ⟨hlt, hd⟩ + · exact lem_2c ⟨m - k, hd⟩ (lem_2e l' x' hinv') + · exact ih (k - m) (by omega) c l' x' hinv' hd +theorem lem_2g {c0 : Cfg (Fin 2) (Fin 6)} {l x : Nat} + (h0 : c0 [target_tm]⊢* S' l x) (hinv : Inv l x) : + ∀ cfg, (c0 [target_tm]⊢* cfg) -> (step target_tm cfg).isSome := by + intro cfg ⟨k, hk⟩ + rcases h0 with ⟨m, hm⟩ + rcases lem_2b hm hk with ⟨_, hd⟩ | ⟨_, hd⟩ + · exact lem_2c ⟨m - k, hd⟩ (lem_2e l x hinv) + · exact lem_2f (k - m) cfg l x hinv hd + +theorem is_not_halt_from_0831_tm : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{1}}> default) [target_tm]⊢* cfg) → + (step target_tm cfg).isSome := by + have h1 : ((default : ListBlank (Fin 2)) {{1}}> default) [target_tm]⊢* + S' 31 (lem_0n 32746 64610 1) := lem_28 + have h2 : (S' 31 (lem_0n 32746 64610 1)) [target_tm]⊢⁺ + (S' (lem_1a 31 32746 1) (lem_1b 31 32746 64610 1)) := + lem_26 31 32746 64610 1 lem_1p (by decide) (by decide) (Or.inl rfl) + have hinv : Inv (lem_1a 31 32746 1) (lem_1b 31 32746 64610 1) := + lem_1n 31 32746 64610 1 lem_1p (by decide) (by decide) (Or.inl rfl) + exact lem_2g (lem_St h1 (lem_Ps h2)) hinv + +theorem is_does_not_halt : IsNotHalt target_tm := lem_2g lem_27 lem_1o + +end Solution + +public section + +theorem is_not_halt_from_0831 : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{1}}> default) [target]⊢* cfg) → + (step target cfg).isSome := + Solution.is_not_halt_from_0831_tm + +theorem is_not_halt : IsNotHalt target := Solution.is_does_not_halt + +end + +end BusyBeaver.M_1RB1LC_1LA1RB_1LD0LA_1RE0RF_HHH1RD_0RE1RB diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LC_1RC1LB_1LD0RB_0LE1RD_HHH0LF_0LA1LF.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LC_1RC1LB_1LD0RB_0LE1RD_HHH0LF_0LA1LF.lean new file mode 100644 index 00000000..a121bc3f --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LC_1RC1LB_1LD0RB_0LE1RD_HHH0LF_0LA1LF.lean @@ -0,0 +1,53 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.BB6.NonHalt.M_1RB1LA_1LC0RA_0LD1RC_HHH0LE_0LF1LE_1RF1LB + + +open Mathlib Relation Nat Turing BusyBeaver SixState +open BusyBeaver.M_1RB1LA_1LC0RA_0LD1RC_HHH0LE_0LF1LE_1RF1LB + +namespace BusyBeaver.M_1RB1LC_1RC1LB_1LD0RB_0LE1RD_HHH0LF_0LA1LF + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LC_1RC1LB_1LD0RB_0LE1RD_HHH0LF_0LA1LF" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +public section + +set_option maxHeartbeats 2000000 in +-- Justification: Finite symbolic execution of the 15 elementary stack rules. +theorem is_not_halt : IsNotHalt target := by + refine does_not_halt_of_stack_rules + (mkStackRules target 2 3 5 1 + (fun _ _ => by execute) + (fun _ _ _ => by execute) + (fun _ _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ _ => by execute) + (fun _ _ _ => by execute) + (fun _ _ _ _ => by execute) + (fun _ _ _ => by execute) + (fun _ _ _ _ => by execute) + (fun _ _ _ _ => by execute) + (fun _ => by execute) + (by execute_init) + (by execute_init) + (by execute_init) + (by execute_init)) + +end + +end BusyBeaver.M_1RB1LC_1RC1LB_1LD0RB_0LE1RD_HHH0LF_0LA1LF diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LD_0RC0RB_0LD1RE_0LA1LC_0RB0RF_1LCHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LD_0RC0RB_0LD1RE_0LA1LC_0RB0RF_1LCHHH.lean new file mode 100644 index 00000000..b99dff12 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LD_0RC0RB_0LD1RE_0LA1LC_0RB0RF_1LCHHH.lean @@ -0,0 +1,1906 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter + +open Mathlib Relation Nat Turing BusyBeaver SixState + +@[expose] public section + +namespace BusyBeaver.M_1RB1LD_0RC0RB_0LD1RE_0LA1LC_0RB0RF_1LCHHH + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LD_0RC0RB_0LD1RE_0LA1LC_0RB0RF_1LCHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end BusyBeaver.M_1RB1LD_0RC0RB_0LD1RE_0LA1LC_0RB0RF_1LCHHH + +end + +namespace BusyBeaver.M_1RB1LD_0RC0RB_0LD1RE_0LA1LC_0RB0RF_1LCHHH + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + + +variable {Γ' Λ' α β γ : Type*} [Inhabited Γ'] [Inhabited Λ'] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +variable {Γ' Λ' : Type*} [Inhabited Γ'] [Inhabited Λ'] +local notation "TapeBlank" => ListBlank (Fin 2) +local notation "FinWord" => List (Fin 2) +@[simp] theorem lem_Mz (M : Machine Γ' Λ') (config : Cfg Γ' Λ') : multiStep M config 0 = + some config := rfl +@[simp] theorem lem_Mo (M : Machine Γ' Λ') (config : Cfg Γ' Λ') : multiStep M config 1 = + step M config := rfl +@[simp] theorem lem_Ms (M : Machine Γ' Λ') (config : Cfg Γ' Λ') (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] +@[simp] theorem lem_00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem lem_Dh : (default : TapeBlank).head = 0 := rfl +@[simp] theorem lem_Dt : (default : TapeBlank).tail = default := rfl +@[simp] theorem append_nil (s : TapeBlank) : ([] : FinWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : FinWord) (s : TapeBlank) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : FinWord) (s : TapeBlank) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append, append_cons, ih] +theorem lem_Sm {Γ' Λ' : Type*} [Inhabited Γ'] [Inhabited Λ'] + (tm : Machine Γ' Λ') (c_1 c_2 : Cfg Γ' Λ') (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem lem_01 {Γ' Λ' : Type*} [Inhabited Γ'] [Inhabited Λ'] + (tm : Machine Γ' Λ') (c_1 c_2 : Cfg Γ' Λ') (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1, by decide, lem_Sm tm c_1 c_2 h⟩ +theorem lem_Ma {Γ' Λ' : Type*} [Inhabited Γ'] [Inhabited Λ'] + (tm : Machine Γ' Λ') (c_1 : Cfg Γ' Λ') (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, lem_Ms, ih, Option.bind_assoc] + simp_rw [lem_Ms] +theorem lem_Mt {Γ' Λ' : Type*} [Inhabited Γ'] [Inhabited Λ'] + (tm : Machine Γ' Λ') (c_1 c_2 c_3 : Cfg Γ' Λ') (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [lem_Ma, h₁]; simp [h₂] +theorem lem_Ps {Γ' Λ' : Type*} [Inhabited Γ'] [Inhabited Λ'] + {tm : Machine Γ' Λ'} {c_1 c_2 : Cfg Γ' Λ'} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ +theorem lem_Pt {Γ' Λ' : Type*} [Inhabited Γ'] [Inhabited Λ'] + {tm : Machine Γ' Λ'} {c_1 c_2 c_3 : Cfg Γ' Λ'} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, by omega, lem_Mt tm c_1 c_2 c_3 n m hn hm⟩ +theorem lem_02 {Γ' Λ' : Type*} [Inhabited Γ'] [Inhabited Λ'] + {tm : Machine Γ' Λ'} {c_1 c_2 c_3 : Cfg Γ' Λ'} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), lem_Mt tm c_1 c_2 c_3 n m hn hm⟩ +theorem lem_03 {Γ' Λ' : Type*} [Inhabited Γ'] [Inhabited Λ'] + {tm : Machine Γ' Λ'} {c_1 c_2 c_3 : Cfg Γ' Λ'} + (h₁ : c_1 [tm]⊢* c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, by omega, lem_Mt tm c_1 c_2 c_3 n m hn hm⟩ +theorem lem_04 {Γ' Λ' : Type*} [Inhabited Γ'] [Inhabited Λ'] + {tm : Machine Γ' Λ'} {c_1 c_2 c_3 : Cfg Γ' Λ'} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + lem_02 (lem_01 tm c_1 c_2 h₁) h₂ +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine lem_Ps ?_) <;> + refine lem_04 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, + Turing.ListBlank.head_cons, lem_Dh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, + Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, + lem_00, lem_Dh, lem_Dt]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) +abbrev Q_A : Fin 6 := 5 +abbrev Q_B : Fin 6 := 2 +abbrev Q_C : Fin 6 := 3 +abbrev Q_D : Fin 6 := 0 +abbrev Q_E : Fin 6 := 1 +abbrev Q_F : Fin 6 := 4 +def lem_CR (l : TapeBlank) (q : Fin 6) (r : TapeBlank) : Cfg (Fin 2) (Fin 6) := + (l {{q}}> r) +def lem_CL (l : TapeBlank) (q : Fin 6) (r : TapeBlank) : Cfg (Fin 2) (Fin 6) := + (l <{{q}} r) +abbrev Z : FinWord := [1, 1, 0, 0] +abbrev T : FinWord := [1, 0, 1, 0] +abbrev lh : TapeBlank := (0 : Fin 2) >> (1 : Fin 2) >> default +inductive Call where + | hb + | hc +def lem_Cs : Call -> Fin 6 + | .hb => Q_B + | .hc => Q_C +def lem_05 (c : Call) (r1 r2 : TapeBlank) : Prop := + ∀ l, (lem_CR l Q_B r1) [target_tm]⊢⁺ (lem_CL l (lem_Cs c) r2) +inductive Side : List Call -> TapeBlank -> TapeBlank -> Prop where + | nil (r : TapeBlank) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : TapeBlank} : + lem_05 c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : FinWord) : Prop := + ∀ r1 r2, Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem lem_06 {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem lem_Lp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem lem_Lp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem lem_07 {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem lem_08 {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm, lem_Lp, lem_Lp, ih, List.append_assoc] +theorem lem_09 {α : Type*} (l : List α) (n : Nat) : l ^ n ++ l = l ++ l ^ n := by + induction n with + | zero => simp + | succ n ih => + rw [lem_Lp, List.append_assoc, ih] +theorem lem_09' {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ^ n ++ l := by + rw [lem_Lp] + exact (lem_09 l n).symm +theorem lem_0a {ls1 ls2 : List Call} {r1 r2 r3 : TapeBlank} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem lem_0b {ls1 ls2 : List Call} {r1 r3 : TapeBlank} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2, Side ls1 r1 r2 /\ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1, Side.nil r1, h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc, hrest⟩ + rcases ih hrest with ⟨r2, h1, h2⟩ + exact ⟨r2, Side.cons hc h1, h2⟩ +theorem lem_0c {ls : List Call} {r : TapeBlank} + (h : Side ls r r) (k : Nat) : Side (ls ^ k) r r := by + induction k with + | zero => exact Side.nil r + | succ k ih => exact lem_0a h ih +theorem lem_0d (w : FinWord) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem lem_0e (ls : List Call) : Seg ls ls [] [] := by + intro r1 r2 h; exact h +theorem lem_S0 {ls1 ls2 ls3 : List Call} {w1 w2 u1 u2 : FinWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls2 ls3 u1 u2) : + Seg ls1 ls3 (w1 ++ u1) (w2 ++ u2) := by + intro r1 r2 h + simp only [append_assoc] + exact h1 _ _ (h2 r1 r2 h) +theorem lem_Sc {ls1 ls2 : List Call} {w1 w2 : FinWord} {r1 r2 : TapeBlank} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem lem_Sg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : FinWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases lem_0b h with ⟨r2, ha, hb⟩ + exact lem_0a (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem lem_0f {ls1 ls2 : List Call} {w : FinWord} + (h : Seg ls1 ls2 w w) (n : Nat) : Seg (ls1 ^ n) (ls2 ^ n) w w := by + induction n with + | zero => exact lem_0d w + | succ n ih => exact lem_Sg h ih +theorem lem_S4 {c : Call} {w1 w2 : FinWord} + (h1 : ∀ l r, (lem_CR l Q_B (w1 +> r)) [target_tm]⊢⁺ (lem_CL l (lem_Cs c) (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem lem_S2 {c_out c_in : Call} {w1 w2 mid : FinWord} + (h1 : ∀ l r, (lem_CR l Q_B (w1 +> r)) [target_tm]⊢⁺ (lem_CR (mid +> l) Q_B r)) + (h2 : ∀ l r, (lem_CL (mid +> l) (lem_Cs c_out) r) [target_tm]⊢⁺ (lem_CL l (lem_Cs c_in) (w2 +> + r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1, hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact lem_Pt (h1 l r1) (lem_Pt (hc1 (mid +> l)) (h2 l r2)) +theorem lem_S5 {c1 c2 c_in : Call} {w1 w2 mid1 mid2 : FinWord} + (h1 : ∀ l r, (lem_CR l Q_B (w1 +> r)) [target_tm]⊢⁺ (lem_CR (mid1 +> l) Q_B r)) + (h2 : ∀ l r, (lem_CL (mid1 +> l) (lem_Cs c1) r) [target_tm]⊢⁺ (lem_CR (mid2 +> l) Q_B r)) + (h3 : ∀ l r, (lem_CL (mid2 +> l) (lem_Cs c2) r) [target_tm]⊢⁺ (lem_CL l (lem_Cs c_in) (w2 +> + r))) : + Seg [c_in] [c1, c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1, hrest⟩ + rcases hrest with _ | ⟨hc2, hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact lem_Pt (h1 l r1) + (lem_Pt (hc1 (mid1 +> l)) + (lem_Pt (h2 l _) + (lem_Pt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem lem_0g : Seg [.hb] [] Z T := + lem_S4 (fun l r => + by unfold lem_CR lem_CL lem_Cs Z T; simp only [append_cons, append_nil]; execute) +theorem lem_0h : Seg [.hb] [.hb] T Z := + lem_S2 (mid := [0, 0, 0, 1]) + (fun l r => by unfold lem_CR T; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold lem_CL lem_Cs Z; simp only [append_cons, append_nil]; execute) +theorem lem_0i : Seg [.hb] [.hc, .hb] T T := + lem_S5 (mid1 := [0, 0, 0, 1]) (mid2 := [0, 1, 0, 1]) + (fun l r => by unfold lem_CR T; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold lem_CL lem_CR lem_Cs; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold lem_CL lem_Cs T; simp only [append_cons, append_nil]; execute) +theorem lem_0j : Seg [.hc] [.hc, .hc] T T := + lem_S5 (mid1 := [0, 0, 0, 1]) (mid2 := [0, 1, 0, 1]) + (fun l r => by unfold lem_CR T; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold lem_CL lem_CR lem_Cs; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold lem_CL lem_Cs T; simp only [append_cons, append_nil]; execute) +theorem lem_0k : Seg [.hc] [.hb] [1, 0, 0] [1, 0, 0] := + lem_S2 (mid := [0, 0, 1]) + (fun l r => by unfold lem_CR; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold lem_CL lem_Cs; simp only [append_cons, append_nil]; execute) +theorem lem_0l : Seg [.hb] [.hc, .hc] [1, 0, 0] [1, 1, 0] := + lem_S5 (mid1 := [0, 0, 1]) (mid2 := [0, 1, 1]) + (fun l r => by unfold lem_CR; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold lem_CL lem_CR lem_Cs; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold lem_CL lem_Cs; simp only [append_cons, append_nil]; execute) +theorem lem_0m : Seg [.hb] [] [1, 1, 0] [1, 0, 1] := + lem_S4 (fun l r => by unfold lem_CR lem_CL lem_Cs; simp only [append_cons, append_nil]; execute) +theorem lem_0n : Seg [.hc] [] [0] [0] := + lem_S4 (fun l r => by unfold lem_CR lem_CL lem_Cs; simp only [append_cons, append_nil]; execute) +theorem lem_0o : Seg [.hc] [.hb] [1, 0, 1, 1, 0] [1, 0, 1, 0, 0] := + lem_S2 (mid := [0, 0, 0, 0, 1]) + (fun l r => by unfold lem_CR; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold lem_CL lem_Cs; simp only [append_cons, append_nil]; execute) +theorem lem_0p : Seg [.hb, .hb] [.hb] T T := + lem_Sg lem_0h lem_0g +theorem lem_0q : Seg [.hb] [.hb] [1, 0, 1, 1, 0, 0] [1, 1, 0, 1, 0, 0] := + lem_S2 (mid := [0, 0, 1, 0, 1, 1]) + (fun l r => by unfold lem_CR; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold lem_CL lem_Cs; simp only [append_cons, append_nil]; execute) +theorem lem_0r : Seg [.hb] [] [1, 1, 0, 1, 0, 0] [1, 0, 1, 1, 0, 0] := + lem_S4 (fun l r => by unfold lem_CR lem_CL lem_Cs; simp only [append_cons, append_nil]; execute) +theorem lem_0s : Seg [.hb, .hb] [.hb] [1, 0, 1, 1, 0, 0] [1, 0, 1, 1, 0, 0] := + lem_Sg lem_0q lem_0r +theorem lem_0t : Seg [.hb] [.hc, .hc] [1, 0, 1, 1, 0, 0] [1, 0, 1, 1, 1, 0] := + lem_S5 (mid1 := [0, 0, 1, 0, 1, 1]) (mid2 := [0, 1, 1, 0, 1, 1]) + (fun l r => by unfold lem_CR; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold lem_CL lem_CR lem_Cs; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold lem_CL lem_Cs; simp only [append_cons, append_nil]; execute) +theorem lem_0u : Seg [.hc] [.hb] [1, 0, 1, 1, 1, 0, 0] [1, 0, 1, 0, 1, 0, 0] := + lem_S2 (mid := [0, 0, 1, 0, 1, 0, 1]) + (fun l r => by unfold lem_CR; simp only [append_cons, append_nil]; execute) + (fun l r => by unfold lem_CL lem_Cs; simp only [append_cons, append_nil]; execute) +theorem lem_0v (r : TapeBlank) : + (lem_CL lh Q_B r) [target_tm]⊢⁺ (lem_CR lh Q_B ([0, 1, 0] +> r)) := by + unfold lem_CL lem_CR lh; simp only [append_cons, append_nil]; execute +theorem lem_0w (r : TapeBlank) : + (lem_CL lh Q_C r) [target_tm]⊢⁺ (lem_CR lh Q_B ([1, 0] +> r)) := by + unfold lem_CL lem_CR lh; simp only [append_cons, append_nil]; execute +theorem E10 (l r : TapeBlank) : + (lem_CR l Q_E ([1, 0] +> r)) [target_tm]⊢⁺ (lem_CR ([0, 0] +> l) Q_B r) := by + unfold lem_CR; simp only [append_cons, append_nil]; execute +theorem lem_0x (l r : TapeBlank) : + (lem_CL ([0, 0, 0, 1, 0, 1, 0, 1] +> l) Q_C r) [target_tm]⊢⁺ + (lem_CR ([0, 1, 0, 1, 0, 1, 0, 1] +> l) Q_B r) := by + unfold lem_CL lem_CR; simp only [append_cons, append_nil]; execute +theorem lem_0y (l r : TapeBlank) : + (lem_CL ([0, 1, 0, 1, 0, 1, 0, 1] +> l) Q_C r) [target_tm]⊢⁺ + (lem_CL l Q_C (T +> (T +> r))) := by + unfold lem_CL T; simp only [append_cons, append_nil]; execute +theorem lem_0z (l r : TapeBlank) : + (lem_CL ([0, 1, 0, 1, 0, 1, 0, 1] +> l) Q_B r) [target_tm]⊢⁺ + (lem_CL l Q_B (T +> (T +> r))) := by + unfold lem_CL T; simp only [append_cons, append_nil]; execute +theorem lem_0A (l r : TapeBlank) : + (lem_CL ([0, 0, 0, 1, 0, 1, 1] +> l) Q_B r) [target_tm]⊢⁺ + (lem_CL l Q_B ([1, 0, 1, 1, 1, 0, 0] +> r)) := by + unfold lem_CL; simp only [append_cons, append_nil]; execute +theorem lem_0B {r r' : TapeBlank} (h : Side [.hc] r r') (l : TapeBlank) : + (lem_CR l Q_B r) [target_tm]⊢⁺ (lem_CL l Q_C r') := by + rcases h with _ | ⟨hc1, hnil⟩; cases hnil; exact hc1 l +theorem lem_0C {r r' : TapeBlank} (h : Side [.hb] r r') (l : TapeBlank) : + (lem_CR l Q_B r) [target_tm]⊢⁺ (lem_CL l Q_B r') := by + rcases h with _ | ⟨hc1, hnil⟩; cases hnil; exact hc1 l +theorem lem_0D {r : TapeBlank} (h : Side [.hc] r r) (l : TapeBlank) : + (lem_CR l Q_B ([1, 0, 1, 1, 1, 0] +> r)) [target_tm]⊢⁺ + (lem_CR ([0, 1, 0, 1, 0, 1] +> l) Q_E r) := by + have s1 : (lem_CR l Q_B ([1, 0, 1, 1, 1, 0] +> r)) [target_tm]⊢⁺ + (lem_CR ([0, 0, 0, 0, 0, 1] +> l) Q_B r) := by + unfold lem_CR; simp only [append_cons, append_nil]; execute + have s2 : (lem_CL ([0, 0, 0, 0, 0, 1] +> l) Q_C r) [target_tm]⊢⁺ + (lem_CR ([0, 1, 0, 0, 0, 1] +> l) Q_B r) := by + unfold lem_CL lem_CR; simp only [append_cons, append_nil]; execute + have s3 : (lem_CL ([0, 1, 0, 0, 0, 1] +> l) Q_C r) [target_tm]⊢⁺ + (lem_CR ([0, 1, 0, 1, 0, 1] +> l) Q_E r) := by + unfold lem_CL lem_CR; simp only [append_cons, append_nil]; execute + exact lem_Pt s1 + (lem_Pt (lem_0B h _) + (lem_Pt s2 + (lem_Pt (lem_0B h _) s3))) +theorem lem_0E {r : TapeBlank} (h : Side [.hc] r r) (l : TapeBlank) : + (lem_CR l Q_B ([1, 0, 1, 1, 0, 1, 0, 1, 0] +> r)) [target_tm]⊢⁺ + (lem_CR ([0, 0, 0, 1, 0, 1, 1] +> l) Q_B ([1, 0] +> r)) := by + have s1 : (lem_CR l Q_B ([1, 0, 1, 1, 0, 1, 0, 1, 0] +> r)) [target_tm]⊢⁺ + (lem_CR ([0, 0, 0, 1, 0, 0, 0, 0, 1] +> l) Q_B r) := by + unfold lem_CR; simp only [append_cons, append_nil]; execute + have s2 : (lem_CL ([0, 0, 0, 1, 0, 0, 0, 0, 1] +> l) Q_C r) [target_tm]⊢⁺ + (lem_CR ([0, 1, 0, 1, 0, 0, 0, 0, 1] +> l) Q_B r) := by + unfold lem_CL lem_CR; simp only [append_cons, append_nil]; execute + have s3 : (lem_CL ([0, 1, 0, 1, 0, 0, 0, 0, 1] +> l) Q_C r) [target_tm]⊢⁺ + (lem_CR ([0, 0, 0, 1, 0, 1, 0, 0, 1] +> l) Q_B r) := by + unfold lem_CL lem_CR; simp only [append_cons, append_nil]; execute + have s4 : (lem_CL ([0, 0, 0, 1, 0, 1, 0, 0, 1] +> l) Q_C r) [target_tm]⊢⁺ + (lem_CR ([0, 1, 0, 1, 0, 1, 0, 0, 1] +> l) Q_B r) := by + unfold lem_CL lem_CR; simp only [append_cons, append_nil]; execute + have s5 : (lem_CL ([0, 1, 0, 1, 0, 1, 0, 0, 1] +> l) Q_C r) [target_tm]⊢⁺ + (lem_CR ([0, 0, 0, 1, 0, 1, 1] +> l) Q_B ([1, 0] +> r)) := by + unfold lem_CL lem_CR; simp only [append_cons, append_nil]; execute + exact lem_Pt s1 + (lem_Pt (lem_0B h _) + (lem_Pt s2 + (lem_Pt (lem_0B h _) + (lem_Pt s3 + (lem_Pt (lem_0B h _) + (lem_Pt s4 + (lem_Pt (lem_0B h _) s5))))))) +inductive Num : Nat -> Nat -> Nat -> FinWord -> Prop where + | nil : Num 0 0 0 [] + | Z {d a b w} : Num d a b w -> Num (1 + d) (a * 2) b (Z ++ w) + | T {d a b w} : Num d a b w -> Num (1 + d) (1 + a * 2) (2 ^ d + b) (T ++ w) +theorem lem_Pp (d : Nat) : 0 < 2 ^ d := by + induction d with + | zero => decide + | succ d ih => rw [Nat.pow_succ]; omega +theorem lem_P2 (d : Nat) : 2 ^ (1 + d) = 2 ^ d + 2 ^ d := by + rw [Nat.add_comm, Nat.pow_succ]; omega +theorem lem_0F (d : Nat) : 2 ^ (2 + d) = 4 * 2 ^ d := by + have h : 2 + d = 1 + (1 + d) := by omega + rw [h, lem_P2 (1 + d), lem_P2 d]; omega +theorem lem_0G (d : Nat) : 2 ^ (3 + d) = 8 * 2 ^ d := by + have h : 3 + d = 1 + (2 + d) := by omega + rw [h, lem_P2 (2 + d), lem_0F d]; omega +theorem lem_0H {d a b : Nat} {w : FinWord} (h : Num d a b w) : + a < 2 ^ d /\ b < 2 ^ d := by + induction h with + | nil => simp + | @Z d a b w _ ih => + rw [lem_P2] + (try omega) + | @T d a b w _ ih => + rw [lem_P2] + (try omega) +theorem lem_0I (d : Nat) : Num d 0 0 (Z ^ d) := by + induction d with + | zero => exact Num.nil + | succ d ih => + have h := Num.Z ih + rwa [Nat.add_comm 1 d] at h +theorem lem_0J (d b : Nat) (hb : b < 2 ^ d) : ∃ a w, Num d a b w := by + induction d generalizing b with + | zero => + have hb0 : b = 0 := by simpa using! hb + subst hb0 + exact ⟨0, [], Num.nil⟩ + | succ d ih => + rw [Nat.add_comm d 1, lem_P2] at hb + by_cases hlt : b < 2 ^ d + · rcases ih b hlt with ⟨a, w, hw⟩ + have h := Num.Z hw + rw [Nat.add_comm 1 d] at h + exact ⟨a * 2, Z ++ w, h⟩ + · have hsub : b - 2 ^ d < 2 ^ d := by omega + rcases ih (b - 2 ^ d) hsub with ⟨a, w, hw⟩ + have h := Num.T hw + have heq : 2 ^ d + (b - 2 ^ d) = b := by omega + rw [Nat.add_comm 1 d, heq] at h + exact ⟨1 + a * 2, T ++ w, h⟩ +theorem lem_0K (n : Nat) : + Seg ([Call.hb] ^ (n * 2) ++ [Call.hc]) ([Call.hb] ^ n ++ [Call.hc, Call.hc]) T T := by + induction n with + | zero => exact lem_0j + | succ n ih => + have h_eq1 : (n + 1) * 2 = 2 + n * 2 := by omega + have h_eq2 : ([Call.hb] ^ ((n + 1) * 2) ++ [Call.hc]) = + [Call.hb, Call.hb] ++ ([Call.hb] ^ (n * 2) ++ [Call.hc]) := by + rw [h_eq1, lem_08]; rfl + have h_eq3 : ([Call.hb] ^ (n + 1) ++ [Call.hc, Call.hc]) = + [Call.hb] ++ ([Call.hb] ^ n ++ [Call.hc, Call.hc]) := by + rw [Nat.add_comm n 1, lem_08]; rfl + rw [h_eq2, h_eq3] + exact lem_Sg lem_0p ih +theorem lem_0L (n : Nat) : + Seg ([Call.hb] ^ (1 + n * 2) ++ [Call.hc]) ([Call.hb] ^ n ++ [Call.hc, Call.hc]) Z T := by + have h_eq1 : ([Call.hb] ^ (1 + n * 2) ++ [Call.hc]) = + [Call.hb] ++ ([Call.hb] ^ (n * 2) ++ [Call.hc]) := by + rw [lem_08]; rfl + have h_eq2 : ([Call.hb] ^ n ++ [Call.hc, Call.hc]) = + [] ++ ([Call.hb] ^ n ++ [Call.hc, Call.hc]) := rfl + rw [h_eq1, h_eq2] + exact lem_Sg lem_0g (lem_0K n) +theorem T_C (d : Nat) : Seg [Call.hc] ([Call.hc] ^ (2 ^ d)) (T ^ d) (T ^ d) := by + induction d with + | zero => exact lem_0e [Call.hc] + | succ d ih => + have h_pow : 2 ^ (d + 1) = 2 ^ d + 2 ^ d := by rw [Nat.pow_succ]; omega + rw [h_pow, lem_08] + have h_cc : [Call.hc, Call.hc] = [Call.hc] ++ [Call.hc] := rfl + have h_step := lem_S0 lem_0j (by rw [h_cc]; exact lem_Sg ih ih) + exact h_step +theorem lem_0M (k : Nat) (r : TapeBlank) : + Side [Call.hc] ((T ^ k) +> ([0] +> r)) ((T ^ k) +> ([0] +> r)) := by + refine lem_Sc (T_C k) ?_ + refine lem_0c ?_ (2 ^ k) + exact lem_Sc lem_0n (Side.nil r) +def lem_0N (n k : Nat) (t r : TapeBlank) : Prop := + Side ([Call.hb] ^ n ++ [Call.hc]) r ((T ^ k) +> ([0] +> t)) +theorem lem_0O {n k : Nat} {t r : TapeBlank} (c : Nat) (h : lem_0N n k t r) : + Side ([Call.hb] ^ n ++ [Call.hc] ^ (1 + c)) r ((T ^ k) +> ([0] +> t)) := by + rw [lem_08, <- List.append_assoc] + exact lem_0a h (lem_0c (lem_0M k t) c) +theorem lem_0P {n k : Nat} {t r : TapeBlank} (h : lem_0N n k t r) : + lem_0N (1 + n * 2) (1 + k) t (Z +> r) := by + unfold lem_0N + have h_tk : (T ^ (1 + k)) +> ([0] +> t) = T +> ((T ^ k) +> ([0] +> t)) := by + rw [lem_Lp', append_assoc] + rw [h_tk] + exact lem_Sc (lem_0L n) (lem_0O 1 h) +theorem lem_0Q {n k : Nat} {t r : TapeBlank} (h : lem_0N n k t r) : + lem_0N (n * 2) (1 + k) t (T +> r) := by + unfold lem_0N + have h_tk : (T ^ (1 + k)) +> ([0] +> t) = T +> ((T ^ k) +> ([0] +> t)) := by + rw [lem_Lp', append_assoc] + rw [h_tk] + exact lem_Sc (lem_0K n) (lem_0O 1 h) +theorem lem_0R {d a b : Nat} {w : FinWord} (h : Num d a b w) : + ∀ {n k : Nat} {t r : TapeBlank}, + lem_0N n k t r -> lem_0N ((n + 1) * 2 ^ d - 1 - a) (d + k) t (w +> r) := by + induction h with + | nil => + intro n k t r hN + have heq : (n + 1) * 2 ^ 0 - 1 - 0 = n := by omega + rw [heq, Nat.zero_add, append_nil] + exact hN + | @Z d a b w hNum ih => + intro n k t r hN + have hbnd := lem_0H hNum + have hstep := lem_0P (ih hN) + rw [append_assoc] + have hle : 2 ^ d <= (n + 1) * 2 ^ d := by nlinarith + have heq1 : 1 + (((n + 1) * 2 ^ d - 1 - a) * 2) = (n + 1) * 2 ^ (1 + d) - 1 - a * 2 := by + rw [lem_P2, Nat.mul_add]; omega + have heq2 : 1 + (d + k) = (1 + d) + k := by omega + rwa [heq1, heq2] at hstep + | @T d a b w hNum ih => + intro n k t r hN + have hbnd := lem_0H hNum + have hstep := lem_0Q (ih hN) + rw [append_assoc] + have hle : 2 ^ d <= (n + 1) * 2 ^ d := by nlinarith + have heq1 : ((n + 1) * 2 ^ d - 1 - a) * 2 = (n + 1) * 2 ^ (1 + d) - 1 - (1 + a * 2) := by + rw [lem_P2, Nat.mul_add]; omega + have heq2 : 1 + (d + k) = (1 + d) + k := by omega + rwa [heq1, heq2] at hstep +theorem lem_0S (d : Nat) : + Seg [Call.hc] ([Call.hb] ^ (2 ^ d)) (T ^ d ++ [1, 0, 0]) (T ^ d ++ [1, 0, 0]) := by + induction d with + | zero => exact lem_0k + | succ d ih => + have hpow : 2 ^ (d + 1) = 2 ^ d + 2 ^ d := by rw [Nat.pow_succ]; omega + rw [hpow, lem_08] + have h_eq : T ^ (d + 1) ++ [1, 0, 0] = T ++ (T ^ d ++ [1, 0, 0]) := by + rw [lem_Lp, List.append_assoc] + rw [h_eq] + have h_cc : [Call.hc, Call.hc] = [Call.hc] ++ [Call.hc] := rfl + exact lem_S0 lem_0j (by rw [h_cc]; exact lem_Sg ih ih) +theorem lem_0T {d a b : Nat} {w : FinWord} (h : Num d a b w) : + Seg [Call.hb] ([Call.hb] ^ b ++ [Call.hc, Call.hc]) (T ^ d ++ [1, 0, 0]) (w ++ [1, 1, 0]) := by + induction h with + | nil => exact lem_0l + | @Z d a b w hNum ih => + have h_eq1 : T ^ (1 + d) ++ [1, 0, 0] = T ++ (T ^ d ++ [1, 0, 0]) := by + rw [lem_Lp', List.append_assoc] + have h_eq2 : (Z ++ w) ++ [1, 1, 0] = Z ++ (w ++ [1, 1, 0]) := List.append_assoc _ _ _ + rw [h_eq1, h_eq2] + exact lem_S0 lem_0h ih + | @T d a b w hNum ih => + have h_eq1 : T ^ (1 + d) ++ [1, 0, 0] = T ++ (T ^ d ++ [1, 0, 0]) := by + rw [lem_Lp', List.append_assoc] + have h_eq2 : (T ++ w) ++ [1, 1, 0] = T ++ (w ++ [1, 1, 0]) := List.append_assoc _ _ _ + have h_eq3 : [Call.hb] ^ (2 ^ d + b) ++ [Call.hc, Call.hc] = + [Call.hb] ^ (2 ^ d) ++ ([Call.hb] ^ b ++ [Call.hc, Call.hc]) := by + rw [lem_08, List.append_assoc] + rw [h_eq1, h_eq2, h_eq3] + have h_cb : [Call.hc, Call.hb] = [Call.hc] ++ [Call.hb] := rfl + exact lem_S0 lem_0i (by rw [h_cb]; exact lem_Sg (lem_0S d) ih) +theorem lem_0U (n : Nat) : ([1, 0] : FinWord) ++ T ^ n = T ^ n ++ [1, 0] := by + induction n with + | zero => rfl + | succ n ih => + change [1, 0] ++ ([1, 0, 1, 0] ++ T ^ n) = ([1, 0, 1, 0] ++ T ^ n) ++ [1, 0] + have h1 : ([1, 0] : FinWord) ++ ([1, 0, 1, 0] ++ T ^ n) = + [1, 0, 1, 0] ++ ([1, 0] ++ T ^ n) := rfl + rw [h1, ih, List.append_assoc] +theorem lem_0V {d a b n : Nat} {w : FinWord} {t r : TapeBlank} + (hN : Num d a b w) (hR : lem_0N b n t r) : + lem_0N 1 1 (w +> ([1, 1, 0] +> ((T ^ n) +> ([0] +> t)))) + ([1, 1, 0] +> ((T ^ (1 + d)) +> ([0] +> r))) := by + unfold lem_0N + have h_in : [Call.hb] ^ 1 ++ [Call.hc] = [Call.hb] ++ [Call.hc] := rfl + rw [h_in] + refine lem_0a (lem_Sc lem_0m (Side.nil _)) ?_ + have h_mid : ([1, 0, 1] : FinWord) +> ((T ^ (1 + d)) +> ([0] +> r)) = + [1, 0, 1, 1, 0] +> ((T ^ d ++ [1, 0, 0]) +> r) := by + have h_rot : ([1, 0] : FinWord) ++ T ^ d = T ^ d ++ [1, 0] := lem_0U d + calc ([1, 0, 1] : FinWord) +> ((T ^ (1 + d)) +> ([0] +> r)) + _ = [1, 0, 1, 1, 0] +> (([1, 0] ++ T ^ d) +> ([0] +> r)) := by + rw [lem_Lp']; simp only [T, append_assoc, append_cons, append_nil] + _ = [1, 0, 1, 1, 0] +> ((T ^ d ++ [1, 0, 0]) +> r) := by + rw [h_rot]; simp only [append_assoc, append_cons, append_nil] + rw [h_mid] + have h_out : (T ^ 1) +> ([0] +> (w +> ([1, 1, 0] +> ((T ^ n) +> ([0] +> t))))) = + [1, 0, 1, 0, 0] +> ((w ++ [1, 1, 0]) +> ((T ^ n) +> ([0] +> t))) := by + simp only [lem_07, T, append_assoc, append_cons, append_nil] + rw [h_out] + exact lem_Sc lem_0o (lem_Sc (lem_0T hN) (lem_0O 1 hR)) +theorem lem_0W {d a b : Nat} {w : FinWord} (h : Num d a b w) (hb : b = 0) : + a = 0 /\ w = Z ^ d := by + induction h with + | nil => exact ⟨rfl, rfl⟩ + | @Z d a b w hNum ih => + rcases ih hb with ⟨rfl, rfl⟩ + exact ⟨rfl, (lem_Lp' Z d).symm⟩ + | @T d a b w hNum _ => + have hpos := lem_Pp d + (try omega) +inductive RC : Nat -> Nat -> TapeBlank -> Prop where + | base (d : Nat) : RC d (2 ^ d - 1) ((Z ^ d) +> default) + | node {d a b h k q : Nat} {w : FinWord} {r : TapeBlank} : + Num d a b w -> RC k q r -> k < h -> h <= d -> + RC (1 + d) (2 ^ (1 + d) - 1 - a) (w +> ([1, 1, 0] +> ((T ^ h) +> ([0] +> r)))) +theorem lem_0X {k q : Nat} {r : TapeBlank} (h : RC k q r) : + q < 2 ^ k /\ (0 < k -> 2 ^ (k - 1) <= q) := by + cases h with + | base => + have hpos := lem_Pp k + refine ⟨by omega, fun hk => ?_⟩ + cases k with + | zero => omega + | succ k => + have hpow : 2 ^ (k + 1) = 2 ^ k + 2 ^ k := by rw [Nat.pow_succ]; omega + simp only [Nat.add_sub_cancel]; omega + | @node d a b h k q w r hNum _ _ _ => + have hbnd := lem_0H hNum + have hpow := lem_P2 d + refine ⟨by omega, fun _ => ?_⟩ + have hsub : 1 + d - 1 = d := by omega + rw [hsub]; omega +theorem lem_0Y {q : Nat} {r : TapeBlank} (h : RC 0 q r) : q = 0 /\ r = default := by + generalize hk : (0 : Nat) = k at h + cases h with + | base => + subst hk + exact ⟨rfl, rfl⟩ + | node => + (try omega) +theorem lem_0Z {d a q k k' q' : Nat} {w : FinWord} {r t : TapeBlank} + (hN : Num d a q w) (hR : RC k q r) (hT : RC k' q' t) + (hk : (k = 0 /\ k' = 0) \/ k' < k) (hd : k <= d) : + RC (1 + d) (2 ^ (1 + d) - 1 - a) (w +> ([1, 1, 0] +> ((T ^ k) +> ([0] +> t)))) := by + cases k with + | zero => + rcases lem_0Y hR with ⟨rfl, rfl⟩ + have hk'0 : k' = 0 := by omega + subst hk'0 + rcases lem_0Y hT with ⟨rfl, rfl⟩ + rcases lem_0W hN rfl with ⟨rfl, rfl⟩ + have h_z : ([1, 1, 0] : FinWord) +> ((T ^ 0) +> ([0] +> default)) = Z +> default := rfl + rw [h_z, <- append_assoc, <- lem_09' Z d] + have h_base := RC.base (1 + d) + have h_eq1 : 1 + d = d + 1 := by omega + have h_eq2 : 2 ^ (1 + d) - 1 - 0 = 2 ^ (1 + d) - 1 := by omega + rw [h_eq2] + rwa [<- h_eq1] + | succ k => + have hk' : k' < k + 1 := by omega + exact RC.node hN hT hk' hd +theorem lem_10 {a b : Nat} (h : a <= b) : 2 ^ a <= 2 ^ b := + Nat.pow_le_pow_right (by decide) h +theorem lem_11 {a b : Nat} (h : a < b) : 2 ^ a < 2 ^ b := + Nat.pow_lt_pow_right (by decide) h +theorem lem_12 {k q : Nat} {r : TapeBlank} (h : RC k q r) : + ∃ k' q' t, RC k' q' t /\ ((k = 0 /\ k' = 0) \/ k' < k) /\ lem_0N q k t r := by + induction h with + | base d => + refine ⟨0, 0, default, RC.base 0, by omega, ?_⟩ + have hN := lem_0R (lem_0I d) (n := 0) (k := 0) (t := default) (r := default) ?_ + · have heq1 : (0 + 1) * 2 ^ d - 1 - 0 = 2 ^ d - 1 := by omega + have heq2 : d + 0 = d := by omega + rwa [heq1, heq2] at hN + · unfold lem_0N + have h_fc := lem_0M 0 default + simpa [lem_00] using! h_fc + | @node d a b h k q w r hNum hRC hkh hhd ih => + rcases ih with ⟨k', q', t, hT, hk, hN⟩ + cases h with + | zero => omega + | succ h => + have h_rc_bnd := lem_0X hRC + have h_pow_le : 2 ^ k <= 2 ^ h := lem_10 (by omega) + have hq_lt : q < 2 ^ h := by omega + rcases lem_0J h q hq_lt with ⟨a', w', hw'⟩ + refine ⟨1 + h, 2 ^ (1 + h) - 1 - a', w' +> ([1, 1, 0] +> ((T ^ k) +> ([0] +> t))), + lem_0Z hw' hRC hT hk (by omega), by omega, ?_⟩ + have h_mn := lem_0V hw' hN + have h_step := lem_0R hNum h_mn + have hbnd := lem_0H hNum + have heq1 : (1 + 1) * 2 ^ d - 1 - a = 2 ^ (1 + d) - 1 - a := by + rw [lem_P2]; omega + have heq2 : d + 1 = 1 + d := by omega + have heq3 : 1 + h = h + 1 := by omega + rwa [heq1, heq2, heq3] at h_step +def lem_13 (w : FinWord) (h : Nat) (r : TapeBlank) : Cfg (Fin 2) (Fin 6) := + lem_CR lh Q_B ([0, 1, 0] +> (w +> ([1, 1, 0] +> ((T ^ h) +> ([0] +> r))))) +theorem lem_14 {n m k : Nat} {t r : TapeBlank} (h : lem_0N (n + m) k t r) : + ∃ r', Side ([Call.hb] ^ n) r r' /\ lem_0N m k t r' := by + unfold lem_0N at h ⊢ + rw [lem_08, List.append_assoc] at h + exact lem_0b h +theorem lem_15 {i : Nat} {r r' : TapeBlank} (h : Side ([Call.hb] ^ (2 ^ i)) r r') : + (lem_CR lh Q_B ((T ^ i) +> ([0] +> r))) [target_tm]⊢⁺ + (lem_CR lh Q_B ((T ^ (1 + i)) +> ([0] +> r'))) := by + have s1 := lem_0B (lem_0M i r) lh + have s2 := lem_0w ((T ^ i) +> ([0] +> r)) + have h_mid1 : ([1, 0] : FinWord) +> ((T ^ i) +> ([0] +> r)) = (T ^ i ++ [1, 0, 0]) +> r := by + have h_rot := lem_0U i + calc ([1, 0] : FinWord) +> ((T ^ i) +> ([0] +> r)) + _ = ([1, 0] ++ T ^ i) +> ([0] +> r) := by simp only [append_assoc] + _ = (T ^ i ++ [1, 0, 0]) +> r := by + rw [h_rot]; simp only [append_assoc, append_cons, append_nil] + have s3 := lem_0B (lem_Sc (lem_0S i) h) lh + rw [<- h_mid1] at s3 + have s4 := lem_0w ((T ^ i ++ [1, 0, 0]) +> r') + have h_mid2 : ([1, 0] : FinWord) +> ((T ^ i ++ [1, 0, 0]) +> r') = + (T ^ (1 + i)) +> ([0] +> r') := by + have h_rot := lem_0U i + have h1 : ([1, 0] : FinWord) +> ((T ^ i ++ [1, 0, 0]) +> r') = + (([1, 0] ++ T ^ i) ++ [1, 0]) +> ([0] +> r') := by + simp only [append_assoc, append_cons, append_nil] + have h2 : (T ^ (1 + i)) +> ([0] +> r') = + (T ^ i ++ ([1, 0] ++ [1, 0])) +> ([0] +> r') := by + rw [Nat.add_comm 1 i, lem_08, lem_07] + simp only [T, append_assoc, append_cons, append_nil] + rw [h1, h2, h_rot, List.append_assoc] + rw [h_mid2] at s4 + exact lem_Pt s1 (lem_Pt s2 (lem_Pt s3 s4)) +theorem lem_16 {i a b k : Nat} {w : FinWord} {t r : TapeBlank} + (hN : Num i a b w) (hR : lem_0N b k t r) : + (lem_CR lh Q_B ((T ^ i) +> ([0] +> r))) [target_tm]⊢⁺ lem_13 w k t := by + have s1 := lem_0B (lem_0M i r) lh + have s2 := lem_0w ((T ^ i) +> ([0] +> r)) + have h_mid1 : ([1, 0] : FinWord) +> ((T ^ i) +> ([0] +> r)) = (T ^ i ++ [1, 0, 0]) +> r := by + have h_rot := lem_0U i + calc ([1, 0] : FinWord) +> ((T ^ i) +> ([0] +> r)) + _ = ([1, 0] ++ T ^ i) +> ([0] +> r) := by simp only [append_assoc] + _ = (T ^ i ++ [1, 0, 0]) +> r := by + rw [h_rot]; simp only [append_assoc, append_cons, append_nil] + have s3 := lem_0C (lem_Sc (lem_0T hN) (lem_0O 1 hR)) lh + rw [<- h_mid1] at s3 + have s4 := lem_0v ((w ++ [1, 1, 0]) +> ((T ^ k) +> ([0] +> t))) + have s14 := lem_Pt s1 (lem_Pt s2 (lem_Pt s3 s4)) + simpa only [lem_13, append_assoc] using! s14 +theorem lem_17 (n : Nat) : + ∀ {i a b q k : Nat} {w : FinWord} {t r : TapeBlank}, + Num (n + i) a b w -> q + 2 ^ i = 2 ^ (n + i) + b -> lem_0N q k t r -> + (lem_CR lh Q_B ((T ^ i) +> ([0] +> r))) [target_tm]⊢⁺ lem_13 w k t := by + induction n with + | zero => + intro i a b q k w t r hN hq hR + rw [Nat.zero_add] at hN hq + have hqb : q = b := by omega + subst hqb + exact lem_16 hN hR + | succ n ih => + intro i a b q k w t r hN hq hR + have hpow : 2 ^ (1 + i) <= 2 ^ (n + 1 + i) := lem_10 (by omega) + have hpow_succ := lem_P2 i + have hq_split : q = 2 ^ i + (q - 2 ^ i) := by omega + rw [hq_split] at hR + rcases lem_14 hR with ⟨r', h1, h2⟩ + have s1 := lem_15 h1 + have heq_ni : n + 1 + i = n + (1 + i) := by omega + rw [heq_ni] at hN hq + have s2 := ih hN (q := q - 2 ^ i) (by omega) h2 + exact lem_Pt s1 s2 +theorem lem_18 (n : Nat) : + Seg ([Call.hb] ^ (1 + n * 2)) ([Call.hb] ^ n ++ [Call.hc, Call.hc]) + [1, 0, 1, 1, 0, 0] [1, 0, 1, 1, 1, 0] := by + induction n with + | zero => exact lem_0t + | succ n ih => + have heq1 : 1 + (n + 1) * 2 = 2 + (1 + n * 2) := by omega + have heq2 : [Call.hb] ^ (1 + (n + 1) * 2) = [Call.hb, Call.hb] ++ [Call.hb] ^ (1 + n * 2) := by + rw [heq1, lem_08]; rfl + have heq3 : [Call.hb] ^ (n + 1) ++ [Call.hc, Call.hc] = + [Call.hb] ++ ([Call.hb] ^ n ++ [Call.hc, Call.hc]) := by + rw [Nat.add_comm n 1, lem_08]; rfl + rw [heq2, heq3] + exact lem_Sg lem_0s ih +theorem lem_19 (s : Nat) (r l : TapeBlank) : + (lem_CR l Q_B ([1, 0, 1, 1, 1, 0] +> ((T ^ (1 + s)) +> ([0] +> r)))) [target_tm]⊢⁺ + (lem_CR ([0, 0, 0, 1, 0, 1, 0, 1] +> l) Q_B ((T ^ s ++ [1, 0, 0]) +> r)) := by + have s1 := lem_0D (lem_0M (1 + s) r) l + have h_ts : (T ^ (1 + s)) +> ([0] +> r) = [1, 0] +> ((T ^ s ++ [1, 0, 0]) +> r) := by + have h_rot := lem_0U s + calc (T ^ (1 + s)) +> ([0] +> r) + _ = [1, 0] +> (([1, 0] ++ T ^ s) +> ([0] +> r)) := by + rw [lem_Lp']; simp only [T, append_assoc, append_cons, append_nil] + _ = [1, 0] +> ((T ^ s ++ [1, 0, 0]) +> r) := by + rw [h_rot]; simp only [append_assoc, append_cons, append_nil] + have s2 := E10 ([0, 1, 0, 1, 0, 1] +> l) ((T ^ s ++ [1, 0, 0]) +> r) + rw [<- h_ts] at s2 + have s12 := lem_Pt s1 s2 + simpa only [append_assoc, append_cons, append_nil] using! s12 +theorem lem_1a (s : Nat) {r r' : TapeBlank} + (h : Side ([Call.hb] ^ (2 ^ s)) r r') : + Side [Call.hc] ([1, 0, 1, 1, 1, 0] +> ((T ^ s) +> ([0] +> r))) + ((T ^ (1 + s)) +> ([1, 0, 0] +> r')) := by + cases s with + | zero => + have h1 := lem_Sc lem_0u h + simpa only [lem_06, lem_07, T, append_assoc, append_cons, append_nil] using! h1 + | succ s => + have hpow : 2 ^ (s + 1) = 2 ^ s + 2 ^ s := by rw [Nat.pow_succ]; omega + rw [hpow, lem_08] at h + rcases lem_0b h with ⟨r1, h1, h2⟩ + refine Side.cons (fun l => ?_) (Side.nil _) + have heq_s : s + 1 = 1 + s := by omega + rw [heq_s] + have s1 := lem_19 s r l + have s2 := lem_0B (lem_Sc (lem_0S s) h1) ([0, 0, 0, 1, 0, 1, 0, 1] +> l) + have s3 := lem_0x l ((T ^ s ++ [1, 0, 0]) +> r1) + have s4 := lem_0B (lem_Sc (lem_0S s) h2) ([0, 1, 0, 1, 0, 1, 0, 1] +> l) + have s5 := lem_0y l ((T ^ s ++ [1, 0, 0]) +> r') + have h_end : T +> (T +> ((T ^ s ++ [1, 0, 0]) +> r')) = + (T ^ (1 + (1 + s))) +> ([1, 0, 0] +> r') := by + simp only [lem_Lp', T, append_assoc, append_cons, append_nil] + rw [h_end] at s5 + exact lem_Pt s1 + (lem_Pt s2 + (lem_Pt s3 + (lem_Pt s4 s5))) +theorem lem_1b {n k : Nat} {t r r' : TapeBlank} + (h1 : Side [Call.hb] r r') (h2 : lem_0N n k t r') : lem_0N (1 + n) k t r := by + unfold lem_0N at h2 ⊢ + rw [lem_08, List.append_assoc] + exact lem_0a h1 h2 +theorem lem_1c {α : Type*} (l : List α) (m n : Nat) : l ^ (m * n) = (l ^ n) ^ m := by + induction m with + | zero => simp + | succ m ih => + have heq : (m + 1) * n = n + m * n := by rw [Nat.add_mul, Nat.one_mul, Nat.add_comm] + rw [heq, lem_08, lem_Lp, ih] +theorem lem_1d (j n : Nat) : + Seg ([Call.hc] ^ n) ([Call.hb] ^ (n * 2 ^ j)) (T ^ j ++ [1, 0, 0]) (T ^ j ++ [1, 0, 0]) := by + rw [lem_1c] + exact lem_0f (lem_0S j) n +theorem lem_1e {j a b k : Nat} {w : FinWord} {t r u : TapeBlank} + (hN : Num j a b w) (hR : lem_0N b k t r) + (hM : lem_0N 1 1 u ([1, 1, 0] +> ((T ^ k) +> ([0] +> t)))) : + lem_0N (2 ^ (1 + j) - a) (1 + j) u ((T ^ j ++ [1, 0, 0]) +> r) := by + have hbnd := lem_0H hN + have h1 := lem_Sc (lem_0T hN) (lem_0O 1 hR) + rw [append_assoc w [1, 1, 0]] at h1 + have h2 := lem_1b h1 (lem_0R hN hM) + have heq1 : 1 + ((1 + 1) * 2 ^ j - 1 - a) = 2 ^ (1 + j) - a := by + rw [lem_P2]; omega + have heq2 : j + 1 = 1 + j := by omega + rwa [heq1, heq2] at h2 +theorem lem_1f {s m a b k : Nat} {w : FinWord} {t r u : TapeBlank} + (hN : Num (1 + s) a b w) + (hR : lem_0N (2 ^ s + m * 2 ^ (1 + s) + b) k t r) + (hM : lem_0N 1 1 u ([1, 1, 0] +> ((T ^ k) +> ([0] +> t)))) : + Side ([Call.hc] ^ (1 + m) ++ ([Call.hb] ^ (2 ^ (2 + s) - a) ++ [Call.hc])) + ([1, 0, 1, 1, 1, 0] +> ((T ^ s) +> ([0] +> r))) ((T ^ (2 + s)) +> ([0] +> u)) := by + have heq_split : 2 ^ s + m * 2 ^ (1 + s) + b = 2 ^ s + (m * 2 ^ (1 + s) + b) := by omega + rw [heq_split] at hR + rcases lem_14 hR with ⟨r1, h1, h23⟩ + rcases lem_14 h23 with ⟨r2, h2, h3⟩ + have heq_hc : [Call.hc] ^ (1 + m) ++ ([Call.hb] ^ (2 ^ (2 + s) - a) ++ [Call.hc]) = + [Call.hc] ++ ([Call.hc] ^ m ++ ([Call.hb] ^ (2 ^ (2 + s) - a) ++ [Call.hc])) := by + rw [lem_08, List.append_assoc]; rfl + rw [heq_hc] + refine lem_0a (lem_1a s h1) ?_ + rw [<- append_assoc (T ^ (1 + s)) [1, 0, 0]] + refine lem_0a (lem_Sc (lem_1d (1 + s) m) h2) ?_ + have h_fin := lem_1e hN h3 hM + have heq_s : 1 + (1 + s) = 2 + s := by omega + rwa [heq_s] at h_fin +theorem lem_1g {s a b k : Nat} {w : FinWord} {t r : TapeBlank} + (hN : Num s a b w) (hR : lem_0N (2 ^ s + b) k t r) : + Side [Call.hb] ([1, 0, 1, 1, 1, 0] +> ((T ^ (1 + s)) +> ([0] +> r))) + (T +> (T +> (w +> ([1, 1, 0] +> ((T ^ k) +> ([0] +> t)))))) := by + rcases lem_14 hR with ⟨r1, h1, h2⟩ + refine Side.cons (fun l => ?_) (Side.nil _) + have s1 := lem_19 s r l + have s2 := lem_0B (lem_Sc (lem_0S s) h1) ([0, 0, 0, 1, 0, 1, 0, 1] +> l) + have s3 := lem_0x l ((T ^ s ++ [1, 0, 0]) +> r1) + have s4 := lem_0C (lem_Sc (lem_0T hN) (lem_0O 1 h2)) ([0, 1, 0, 1, 0, 1, 0, 1] +> l) + have s5 := lem_0z l ((w ++ [1, 1, 0]) +> ((T ^ k) +> ([0] +> t))) + have s15 := lem_Pt s1 + (lem_Pt s2 + (lem_Pt s3 + (lem_Pt s4 s5))) + simpa only [lem_Cs, append_assoc] using! s15 +theorem lem_1h {s a b k : Nat} {w : FinWord} {t r u : TapeBlank} + (hN : Num s a b w) (hR : lem_0N (2 ^ s + b) k t r) + (hM : lem_0N 1 1 u ([1, 1, 0] +> ((T ^ k) +> ([0] +> t)))) : + lem_0N (2 ^ (3 + s) - 3 - a * 4) (3 + s) u + ([1, 0, 1, 1, 1, 0] +> ((T ^ (1 + s)) +> ([0] +> r))) := by + have hbnd := lem_0H hN + have hstep := lem_1b (lem_1g hN hR) (lem_0Q (lem_0Q (lem_0R hN hM))) + have hpow3 := lem_0G s + have heq1 : 1 + (((1 + 1) * 2 ^ s - 1 - a) * 2 * 2) = 2 ^ (3 + s) - 3 - a * 4 := by + (try omega) + have heq2 : 1 + (1 + (s + 1)) = 3 + s := by omega + rwa [heq1, heq2] at hstep +theorem T_B (n : Nat) : Seg ([Call.hb] ^ (n * 2)) ([Call.hb] ^ n) T T := by + induction n with + | zero => exact lem_0d T + | succ n ih => + have heq1 : (n + 1) * 2 = 2 + n * 2 := by omega + have heq2 : [Call.hb] ^ ((n + 1) * 2) = [Call.hb, Call.hb] ++ [Call.hb] ^ (n * 2) := by + rw [heq1, lem_08]; rfl + have heq3 : [Call.hb] ^ (n + 1) = [Call.hb] ++ [Call.hb] ^ n := by + rw [Nat.add_comm n 1, lem_08]; rfl + rw [heq2, heq3] + exact lem_Sg lem_0p ih +theorem Z_B (n : Nat) : Seg ([Call.hb] ^ (1 + n * 2)) ([Call.hb] ^ n) Z T := by + have heq1 : [Call.hb] ^ (1 + n * 2) = [Call.hb] ++ [Call.hb] ^ (n * 2) := by + rw [lem_08]; rfl + have heq2 : [Call.hb] ^ n = [] ++ [Call.hb] ^ n := rfl + rw [heq1, heq2] + exact lem_Sg lem_0g (T_B n) +theorem lem_1i {d a b : Nat} {w : FinWord} (h : Num d a b w) (n : Nat) : + Seg ([Call.hb] ^ ((n + 1) * 2 ^ d - 1 - a)) ([Call.hb] ^ n) w (T ^ d) := by + induction h with + | nil => + have heq : (n + 1) * 2 ^ 0 - 1 - 0 = n := by omega + rw [heq] + exact lem_0e ([Call.hb] ^ n) + | @Z d a b w hNum ih => + have hbnd := lem_0H hNum + have hstep := lem_S0 (Z_B ((n + 1) * 2 ^ d - 1 - a)) ih + have hle : 2 ^ d <= (n + 1) * 2 ^ d := by nlinarith + have heq1 : 1 + ((n + 1) * 2 ^ d - 1 - a) * 2 = (n + 1) * 2 ^ (1 + d) - 1 - a * 2 := by + rw [lem_P2, Nat.mul_add]; omega + rw [lem_Lp' T d] + rwa [heq1] at hstep + | @T d a b w hNum ih => + have hbnd := lem_0H hNum + have hstep := lem_S0 (T_B ((n + 1) * 2 ^ d - 1 - a)) ih + have hle : 2 ^ d <= (n + 1) * 2 ^ d := by nlinarith + have heq1 : ((n + 1) * 2 ^ d - 1 - a) * 2 = (n + 1) * 2 ^ (1 + d) - 1 - (1 + a * 2) := by + rw [lem_P2, Nat.mul_add]; omega + rw [lem_Lp' T d] + rwa [heq1] at hstep +theorem lem_1j (j n : Nat) : Seg ([Call.hb] ^ (n * 2 ^ j)) ([Call.hb] ^ n) (T ^ j) (T ^ j) := by + induction j generalizing n with + | zero => + have heq : n * 2 ^ 0 = n := by omega + rw [heq] + exact lem_0e ([Call.hb] ^ n) + | succ j ih => + have hstep := lem_S0 (T_B (n * 2 ^ j)) (ih n) + have heq1 : n * 2 ^ j * 2 = n * 2 ^ (j + 1) := by rw [Nat.pow_succ, Nat.mul_assoc] + have heq2 : T ++ T ^ j = T ^ (j + 1) := rfl + rwa [heq1, heq2] at hstep +theorem lem_1k {j a b : Nat} {w : FinWord} (h : Num j a b w) : + Seg [Call.hb] ([Call.hc] ^ b ++ [Call.hb]) (T ^ j) w := by + induction h with + | nil => exact lem_0e [Call.hb] + | @Z d a b w hNum ih => + rw [lem_Lp' T d] + exact lem_S0 lem_0h ih + | @T d a b w hNum ih => + rw [lem_Lp' T d] + have heq : [Call.hc] ^ (2 ^ d + b) ++ [Call.hb] = + [Call.hc] ^ (2 ^ d) ++ ([Call.hc] ^ b ++ [Call.hb]) := by + rw [lem_08, List.append_assoc] + rw [heq] + have h_cb : [Call.hc, Call.hb] = [Call.hc] ++ [Call.hb] := rfl + exact lem_S0 lem_0i (by rw [h_cb]; exact lem_Sg (T_C d) ih) +theorem lem_1l {j a b : Nat} {w : FinWord} (n : Nat) (h : Num j a b w) : + Seg ([Call.hb] ^ ((1 + n) * 2 ^ j - a)) ([Call.hc] ^ b ++ + [Call.hb] ^ (1 + n)) (T ^ j) (T ^ j) := by + have hbnd := lem_0H h + have hle : 2 ^ j <= (n + 1) * 2 ^ j := by nlinarith + have heq1 : (1 + n) * 2 ^ j - a = 1 + ((n + 1) * 2 ^ j - 1 - a) := by + rw [Nat.add_comm 1 n]; omega + have heq2 : [Call.hb] ^ ((1 + n) * 2 ^ j - a) = + [Call.hb] ++ [Call.hb] ^ ((n + 1) * 2 ^ j - 1 - a) := by + rw [heq1, lem_08]; rfl + have heq3 : [Call.hc] ^ b ++ [Call.hb] ^ (1 + n) = + ([Call.hc] ^ b ++ [Call.hb]) ++ [Call.hb] ^ n := by + rw [lem_08, List.append_assoc]; rfl + rw [heq2, heq3] + exact lem_Sg (lem_1k h) (lem_1i h n) +theorem lem_1m {j a b : Nat} {w : FinWord} (p n : Nat) (h : Num j a b w) : + Seg ([Call.hb] ^ ((p + 1 + n) * 2 ^ j - a) ++ [Call.hc]) + ([Call.hb] ^ p ++ [Call.hc] ^ b ++ [Call.hb] ^ (1 + n) ++ + [Call.hc] ^ (2 ^ j)) (T ^ j) (T ^ j) := by + have hbnd := lem_0H h + have h1 := lem_Sg (lem_1j j p) (lem_Sg (lem_1l n h) (T_C j)) + have heq_in : [Call.hb] ^ (p * 2 ^ j) ++ ([Call.hb] ^ ((1 + n) * 2 ^ j - a) ++ [Call.hc]) = + [Call.hb] ^ ((p + 1 + n) * 2 ^ j - a) ++ [Call.hc] := by + rw [<- List.append_assoc, <- lem_08] + congr 1; congr 1 + have hle : 2 ^ j <= (1 + n) * 2 ^ j := by nlinarith + have : (p + 1 + n) * 2 ^ j = p * 2 ^ j + (1 + n) * 2 ^ j := by + rw [Nat.add_assoc p 1 n, Nat.add_mul] + (try omega) + have heq_out : [Call.hb] ^ p ++ (([Call.hc] ^ b ++ [Call.hb] ^ (1 + n)) ++ [Call.hc] ^ (2 ^ j)) = + [Call.hb] ^ p ++ [Call.hc] ^ b ++ [Call.hb] ^ (1 + n) ++ [Call.hc] ^ (2 ^ j) := by + simp only [List.append_assoc] + rwa [heq_in, heq_out] at h1 +theorem lem_1n {d a b : Nat} {w : FinWord} (h : Num d a b w) : + Num (1 + d) a (b * 2) (w ++ Z) := by + induction h with + | nil => exact Num.Z Num.nil + | @Z d a b w hNum ih => + have h1 := Num.Z ih + rwa [List.append_assoc] + | @T d a b w hNum ih => + have h1 := Num.T ih + rw [List.append_assoc] + have heq : 2 ^ (1 + d) + b * 2 = (2 ^ d + b) * 2 := by rw [lem_P2]; omega + rwa [heq] at h1 +theorem lem_1o {d a b : Nat} {w : FinWord} (h : Num d a b w) : + Num (1 + d) (2 ^ d + a) (1 + b * 2) (w ++ T) := by + induction h with + | nil => exact Num.T Num.nil + | @Z d a b w hNum ih => + have h1 := Num.Z ih + rw [List.append_assoc] + have heq : (2 ^ d + a) * 2 = 2 ^ (1 + d) + a * 2 := by rw [lem_P2]; omega + rwa [heq] at h1 + | @T d a b w hNum ih => + have h1 := Num.T ih + rw [List.append_assoc] + have heq1 : 1 + (2 ^ d + a) * 2 = 2 ^ (1 + d) + (1 + a * 2) := by rw [lem_P2]; omega + have heq2 : 2 ^ (1 + d) + (1 + b * 2) = 1 + (2 ^ d + b) * 2 := by rw [lem_P2]; omega + rwa [heq1, heq2] at h1 +theorem lem_1p {d a b : Nat} {w : FinWord} (h : Num d a b w) : + ∃ w', Num d b a w' := by + induction h with + | nil => exact ⟨[], Num.nil⟩ + | @Z d a b w _ ih => + rcases ih with ⟨w', hw'⟩ + exact ⟨w' ++ Z, lem_1n hw'⟩ + | @T d a b w _ ih => + rcases ih with ⟨w', hw'⟩ + exact ⟨w' ++ T, lem_1o hw'⟩ +theorem lem_1q {d a b : Nat} {w : FinWord} (h : Num d a b w) : + ∃ w', Num d (2 ^ d - 1 - a) (2 ^ d - 1 - b) w' := by + induction h with + | nil => exact ⟨[], Num.nil⟩ + | @Z d a b w hNum ih => + rcases ih with ⟨w', hw'⟩ + have hbnd := lem_0H hNum + have h1 := Num.T hw' + have heq1 : 1 + (2 ^ d - 1 - a) * 2 = 2 ^ (1 + d) - 1 - a * 2 := by rw [lem_P2]; omega + have heq2 : 2 ^ d + (2 ^ d - 1 - b) = 2 ^ (1 + d) - 1 - b := by rw [lem_P2]; omega + rw [heq1, heq2] at h1 + exact ⟨T ++ w', h1⟩ + | @T d a b w hNum ih => + rcases ih with ⟨w', hw'⟩ + have hbnd := lem_0H hNum + have h1 := Num.Z hw' + have heq1 : (2 ^ d - 1 - a) * 2 = 2 ^ (1 + d) - 1 - (1 + a * 2) := by rw [lem_P2]; omega + have heq2 : 2 ^ d - 1 - b = 2 ^ (1 + d) - 1 - (2 ^ d + b) := by rw [lem_P2]; omega + rw [heq1, heq2] at h1 + exact ⟨Z ++ w', h1⟩ +theorem lem_1r {p n k : Nat} {t r r' : TapeBlank} + (h1 : Side ([Call.hb] ^ p) r r') (h2 : lem_0N n k t r') : + lem_0N (p + n) k t r := by + unfold lem_0N at h2 ⊢ + rw [lem_08, List.append_assoc] + exact lem_0a h1 h2 +theorem lem_1s {s a b q e : Nat} {w we : FinWord} {r v t u : TapeBlank} + (hN : Num s a b w) (hQ : Num s e q we) + (hM : lem_0N 1 1 v ([1, 1, 0] +> ((T ^ (1 + s)) +> ([0] +> r)))) + (hR : lem_0N (2 ^ (1 + s) - 1 - e) (1 + s) t v) + (hM' : lem_0N 1 1 u ([1, 1, 0] +> ((T ^ (1 + s)) +> ([0] +> t)))) : + lem_0N (2 ^ (3 + s) - a * 2 + q * 4) (3 + s) u + ([1, 0] +> (Z +> (w +> ([1, 1, 0] +> ((T ^ (1 + s)) +> ([0] +> r)))))) := by + rcases lem_1p hQ with ⟨wq, hq⟩ + rcases lem_1q hq with ⟨wq', hq'⟩ + have hbndN := lem_0H hN + have hbndQ := lem_0H hQ + have hR' : lem_0N (2 ^ s + (2 ^ s - 1 - e)) (1 + s) t v := by + have heq : 2 ^ s + (2 ^ s - 1 - e) = 2 ^ (1 + s) - 1 - e := by rw [lem_P2]; omega + rwa [heq] + have hP := lem_0O 1 (lem_0R hN hM) + have hpre := lem_Sc (lem_18 ((1 + 1) * 2 ^ s - 1 - a)) hP + have h_in : ([1, 0, 1, 1, 0, 0] : FinWord) +> (w +> ([1, 1, + 0] +> ((T ^ (1 + s)) +> ([0] +> r)))) = + [1, 0] +> (Z +> (w +> ([1, 1, 0] +> ((T ^ (1 + s)) +> ([0] +> r))))) := rfl + rw [h_in] at hpre + have hpost := lem_1h hq' hR' hM' + have h_s1 : s + 1 = 1 + s := by omega + rw [h_s1] at hpre + have hcomb := lem_1r hpre hpost + have hpow3 := lem_0G s + have heq : (1 + ((1 + 1) * 2 ^ s - 1 - a) * 2) + (2 ^ (3 + s) - 3 - (2 ^ s - 1 - q) * 4) = + 2 ^ (3 + s) - a * 2 + q * 4 := by + (try omega) + rwa [heq] at hcomb +theorem lem_1t (h : Nat) (r l : TapeBlank) : + (lem_CR l Q_B ([1, 0] +> ([1, 1, 0] +> ((T ^ (1 + h)) +> ([0] +> r))))) [target_tm]⊢⁺ + (lem_CR ([0, 0, 0, 1, 0, 1, 1] +> l) Q_B ((T ^ h ++ [1, 0, 0]) +> r)) := by + have s1 := lem_0E (lem_0M h r) l + have h_in : ([1, 0, 1, 1, 0, 1, 0, 1, 0] : FinWord) +> ((T ^ h) +> ([0] +> r)) = + [1, 0] +> ([1, 1, 0] +> ((T ^ (1 + h)) +> ([0] +> r))) := by + rw [lem_Lp']; simp only [T, append_assoc, append_cons, append_nil] + rw [h_in] at s1 + have h_out : ([1, 0] : FinWord) +> ((T ^ h) +> ([0] +> r)) = (T ^ h ++ [1, 0, 0]) +> r := by + have h_rot := lem_0U h + calc ([1, 0] : FinWord) +> ((T ^ h) +> ([0] +> r)) + _ = ([1, 0] ++ T ^ h) +> ([0] +> r) := by simp only [append_assoc] + _ = (T ^ h ++ [1, 0, 0]) +> r := by + rw [h_rot]; simp only [append_assoc, append_cons, append_nil] + rwa [h_out] at s1 +theorem lem_1u {h a q k : Nat} {w : FinWord} {t r : TapeBlank} + (hN : Num h a q w) (hR : lem_0N q k t r) : + Side [Call.hb] ([1, 0] +> ([1, 1, 0] +> ((T ^ (1 + h)) +> ([0] +> r)))) + ([1, 0, 1, 1, 1, 0, 0] +> (w +> ([1, 1, 0] +> ((T ^ k) +> ([0] +> t))))) := by + refine Side.cons (fun l => ?_) (Side.nil _) + have s1 := lem_1t h r l + have s2 := lem_0C (lem_Sc (lem_0T hN) (lem_0O 1 hR)) ([0, 0, 0, 1, 0, 1, 1] +> l) + have s3 := lem_0A l ((w ++ [1, 1, 0]) +> ((T ^ k) +> ([0] +> t))) + have s13 := lem_Pt s1 (lem_Pt s2 s3) + simpa only [lem_Cs, append_assoc] using! s13 +theorem lem_1v {hs : List Call} {k : Nat} {t r : TapeBlank} (c : Nat) + (h : Side (hs ++ [Call.hc]) r ((T ^ k) +> ([0] +> t))) : + Side (hs ++ [Call.hc] ^ (1 + c)) r ((T ^ k) +> ([0] +> t)) := by + rw [lem_08, <- List.append_assoc] + exact lem_0a h (lem_0c (lem_0M k t) c) +theorem lem_1w {j a b p n k : Nat} {w : FinWord} {t r : TapeBlank} + (hN : Num j a b w) + (hR : Side ([Call.hb] ^ p ++ [Call.hc] ^ b ++ [Call.hb] ^ (1 + n) ++ [Call.hc]) r ((T ^ k) +> + ([0] +> t))) : + lem_0N ((p + 1 + n) * 2 ^ j - a) (j + k) t ((T ^ j) +> r) := by + unfold lem_0N + rw [lem_08, append_assoc] + refine lem_Sc (lem_1m p n hN) ?_ + have hpos := lem_Pp j + have h_more := lem_1v (2 ^ j - 1) hR + have heq : 1 + (2 ^ j - 1) = 2 ^ j := by omega + rwa [heq] at h_more +theorem lem_1x {d a b d' a' b' : Nat} {w w' : FinWord} + (h : Num d a b w) (h' : Num d' a' b' w') (hd : d = d') (ha : a = a') : b = b' /\ w = w' := by + induction h generalizing d' a' b' w' with + | nil => + cases h' with + | nil => exact ⟨rfl, rfl⟩ + | Z => omega + | T => omega + | @Z d a b w hNum ih => + cases h' with + | nil => omega + | @Z d1 a1 b0 w0 h0 => + rcases ih h0 (by omega) (by omega) with ⟨rfl, rfl⟩ + exact ⟨rfl, rfl⟩ + | @T d1 a1 b0 w0 h0 => + (try omega) + | @T d a b w hNum ih => + cases h' with + | nil => omega + | @Z d1 a1 b0 w0 h0 => + (try omega) + | @T d1 a1 b0 w0 h0 => + have hd1 : d1 = d := by omega + subst d1 + rcases ih h0 rfl (by omega) with ⟨rfl, rfl⟩ + exact ⟨rfl, rfl⟩ +theorem lem_1y {d a b b' : Nat} {w w' : FinWord} + (h : Num d a b w) (h' : Num d a b' w') : b = b' /\ w = w' := + lem_1x h h' rfl rfl +theorem lem_1z {d a b : Nat} {w : FinWord} (h : Num d a b w) (ha : a + 1 < 2 ^ d) : + ∃ e b' w', e < d /\ Num d (1 + a) b' w' /\ + b' + 2 ^ d = b + 3 * 2 ^ e /\ 2 ^ e <= b' /\ b' < 2 ^ (1 + e) := by + induction h with + | nil => + simp at ha + | @Z d a b w hNum _ => + have hbnd := lem_0H hNum + have hpow := lem_P2 d + refine ⟨d, 2 ^ d + b, T ++ w, by omega, Num.T hNum, by omega, by omega, by omega⟩ + | @T d a b w hNum ih => + have hpow := lem_P2 d + rcases ih (by omega) with ⟨e, b', w', he, hN', hsum, hle, hlt⟩ + have hZ := Num.Z hN' + have heq : (1 + a) * 2 = 1 + (1 + a * 2) := by omega + rw [heq] at hZ + refine ⟨e, b', Z ++ w', by omega, hZ, by omega, hle, hlt⟩ +theorem lem_1A {j c z : Nat} {w : FinWord} (hN : Num j c z w) (hz : 0 < z) : + ∃ e f wf, 0 < e /\ e <= j /\ 2 ^ (e - 1) <= z /\ z < 2 ^ e /\ + Num (1 + j) f (2 ^ (1 + j) - c) wf /\ f + z * 2 + 1 = 3 * 2 ^ e := by + have hbnd := lem_0H hN + have hc_pos : 0 < c := by + by_contra h0 + have hc0 : c = 0 := by omega + subst hc0 + rcases lem_1y (lem_0I j) hN with ⟨rfl, _⟩ + (try omega) + rcases lem_1q (lem_1n hN) with ⟨w', hcomp⟩ + have hpow_j := lem_P2 j + rcases lem_1z hcomp (by omega) with ⟨e, f, wf, he, hf, hsum, hle, hlt⟩ + rcases lem_1p hf with ⟨wf', hf'⟩ + have he_pos : 0 < e := by + cases e with + | zero => + simp only [Nat.pow_zero, Nat.add_zero] at hle hlt hsum + (try omega) + | succ e => omega + have heq_c : 1 + (2 ^ (1 + j) - 1 - c) = 2 ^ (1 + j) - c := by omega + rw [heq_c] at hf' + have hpow_e : 2 ^ e = 2 ^ (e - 1) + 2 ^ (e - 1) := by + cases e with + | zero => omega + | succ e => + simp only [Nat.add_sub_cancel] + rw [Nat.add_comm e 1, lem_P2] + have hpow_e1 := lem_P2 e + refine ⟨e, f, wf', he_pos, by omega, by omega, by omega, hf', by omega⟩ +theorem lem_1B {j c z : Nat} {w : FinWord} (hN : Num j c z w) : + ∃ wf, Num (1 + j) (2 ^ (1 + j) - 1 - z * 2) (2 ^ (1 + j) - 1 - c) wf := by + rcases lem_1q (lem_1n hN) with ⟨w', h⟩ + exact lem_1p h +theorem lem_1C : lem_0N 0 0 default default := by + unfold lem_0N + have h := lem_0M 0 default + simpa [lem_00] using! h +theorem lem_1D {d k q : Nat} {r : TapeBlank} (hR : RC k q r) (hd : k <= d) : + ∃ a w k' q' t, + Num d a q w /\ RC k' q' t /\ ((k = 0 /\ k' = 0) \/ k' < k) /\ + lem_0N q k t r /\ + RC (1 + d) (2 ^ (1 + d) - 1 - a) (w +> ([1, 1, 0] +> ((T ^ k) +> ([0] +> t)))) /\ + lem_0N 1 1 (w +> ([1, 1, 0] +> ((T ^ k) +> ([0] +> t)))) ([1, 1, + 0] +> ((T ^ (1 + d)) +> ([0] +> + r))) := by + rcases lem_12 hR with ⟨k', q', t, hT, hk, hN⟩ + have h_bnd := lem_0X hR + have h_pow := lem_10 hd + have hq : q < 2 ^ d := by omega + rcases lem_0J d q hq with ⟨a, w, hw⟩ + exact ⟨a, w, k', q', t, hw, hT, hk, hN, lem_0Z hw hR hT hk hd, lem_0V hw hN⟩ +theorem lem_1E {d a q k k' q' : Nat} {w : FinWord} {r t : TapeBlank} + (hN : Num d a q w) (hR : RC k q r) (hT : RC k' q' t) + (hk : (k = 0 /\ k' = 0) \/ k' < k) (hd : k <= d) : + ∃ q2 u, RC k q2 u /\ + lem_0N (2 ^ (1 + d) - 1 - a) (1 + d) u (w +> ([1, 1, 0] +> ((T ^ k) +> ([0] +> t)))) := by + cases k with + | zero => + have hk'0 : k' = 0 := by omega + subst hk'0 + rcases lem_0Y hT with ⟨rfl, rfl⟩ + refine ⟨0, default, RC.base 0, ?_⟩ + have h_z : ([1, 1, 0] : FinWord) +> ((T ^ 0) +> ([0] +> default)) = Z +> default := rfl + rw [h_z] + have hstep := lem_0R hN (lem_0P lem_1C) + have hbnd := lem_0H hN + have heq1 : (1 + 0 * 2 + 1) * 2 ^ d - 1 - a = 2 ^ (1 + d) - 1 - a := by rw [lem_P2]; omega + have heq2 : d + (1 + 0) = 1 + d := by omega + rwa [heq1, heq2] at hstep + | succ k => + have hk' : k' <= k := by omega + rcases lem_1D hT hk' with ⟨a2, w2, k2, q2, t2, hN2, hT2, hk2, hchild, hU, hM⟩ + have heq_k : 1 + k = k + 1 := by omega + rw [heq_k] at hU hM + refine ⟨2 ^ (k + 1) - 1 - a2, w2 +> ([1, 1, 0] +> ((T ^ k') +> ([0] +> t2))), hU, ?_⟩ + have hstep := lem_0R hN hM + have hbnd := lem_0H hN + have heq1 : (1 + 1) * 2 ^ d - 1 - a = 2 ^ (1 + d) - 1 - a := by rw [lem_P2]; omega + have heq2 : d + 1 = 1 + d := by omega + rwa [heq1, heq2] at hstep +theorem lem_1F {d a b : Nat} {w : FinWord} (hN : Num (1 + d) a b w) (hb : b < 2 ^ d) : + ∃ n, 2 ^ (2 + d) - 1 - a = 1 + n * 2 := by + generalize hd : 1 + d = d0 at hN + cases hN with + | nil => omega + | @Z d1 a0 b0 w0 h0 => + have hd1 : d1 = d := by omega + subst d1 + have hbnd := lem_0H h0 + have hpow1 := lem_P2 d + have hpow2 := lem_0F d + exact ⟨2 ^ (1 + d) - 1 - a0, by omega⟩ + | @T d1 a0 b0 w0 h0 => + have hd1 : d1 = d := by omega + subst d1 + (try omega) +theorem lem_1G {j a b p n k : Nat} {w : FinWord} {t r r' : TapeBlank} + (hN : Num j a b w) + (hP : Side ([Call.hb] ^ p) r r') + (hR : Side ([Call.hc] ^ b ++ [Call.hb] ^ (1 + n) ++ [Call.hc]) r' ((T ^ k) +> ([0] +> t))) : + lem_0N ((p + 1 + n) * 2 ^ j - a) (j + k) t ((T ^ j) +> r) := by + refine lem_1w hN ?_ + have h1 := lem_0a hP hR + simpa only [List.append_assoc] using! h1 +theorem lem_1H (a b : Nat) : 2 ^ (a + b) = 2 ^ a * 2 ^ b := Nat.pow_add 2 a b +theorem lem_1I {j s b z e v p k : Nat} {wb we : FinWord} {t r r0 u : TapeBlank} + (hZ : Num (1 + j) b z wb) (hV : Num s e v we) (hz : 0 < z) + (hR : lem_0N (2 ^ (2 + j + s) - 1 - e - 2 ^ s * b) k t r) + (hM : lem_0N 1 1 u ([1, 1, 0] +> ((T ^ k) +> ([0] +> t)))) + (hP : Side ([Call.hb] ^ p) r0 ([1, 0, 1, 1, 1, 0] +> ((T ^ s) +> ([0] +> r)))) : + ∃ f Q, 0 < f /\ f <= 1 + j /\ 2 ^ (f - 1) <= z /\ z < 2 ^ f /\ + lem_0N Q (3 + j + s) u ((T ^ (1 + j)) +> r0) /\ + Q + 3 * 2 ^ f = (p + 2 ^ (1 + s) + 2 + v * 2) * 2 ^ (1 + j) + z * 2 + 1 := by + have hVb := lem_0H hV + rcases lem_1q hV with ⟨wc, hC⟩ + generalize hj : 1 + j = j0 at hZ + cases hZ with + | nil => omega + | @Z j1 a b0 w0 hZ0 => + have hj1 : j1 = j := by omega + subst j1 + have hZb := lem_0H hZ0 + rcases lem_1A hZ0 hz with ⟨f, b', wf, hf, hfj, hfz1, hfz2, hF, hE⟩ + rcases lem_1p (lem_1n hC) with ⟨wr, hrem⟩ + have hR' : lem_0N (2 ^ s + (2 ^ (1 + j) - a - 1) * 2 ^ (1 + s) + (2 ^ s - 1 - e)) k t r := by + have heq : 2 ^ s + (2 ^ (1 + j) - a - 1) * 2 ^ (1 + s) + (2 ^ s - 1 - e) = + 2 ^ (2 + j + s) - 1 - e - 2 ^ s * (a * 2) := by + have h1 : (2 ^ (1 + j) - a - 1) * 2 ^ (1 + s) + 2 ^ s * (a * 2) + 2 ^ s + 2 ^ s = + 2 ^ (2 + j + s) := by + have h2 : 2 + j + s = (1 + j) + (1 + s) := by omega + rw [h2, lem_1H (1 + j) (1 + s), lem_P2 s] + have h3 : 2 ^ (1 + j) - a - 1 + a + 1 = 2 ^ (1 + j) := by have := lem_P2 j; omega + nlinarith + (try omega) + rwa [heq] + have hD := lem_1f hrem hR' hM + have hD' : Side ([Call.hc] ^ (2 ^ (1 + j) - a) ++ [Call.hb] ^ (1 + (2 ^ (1 + s) + 1 + v * 2)) ++ + [Call.hc]) + ([1, 0, 1, 1, 1, 0] +> ((T ^ s) +> ([0] +> r))) ((T ^ (2 + s)) +> ([0] +> u)) := by + have heq1 : 1 + (2 ^ (1 + j) - a - 1) = 2 ^ (1 + j) - a := by rw [lem_P2]; omega + have heq2 : 2 ^ (2 + s) - (2 ^ s - 1 - v) * 2 = 1 + (2 ^ (1 + s) + 1 + v * 2) := by + have : 2 + s = 1 + (1 + s) := by omega + rw [this, lem_P2 (1 + s), lem_P2 s]; omega + rw [<- List.append_assoc] at hD + rwa [heq1, heq2] at hD + have hH := lem_1G hF hP hD' + have hFb := lem_0H hF + refine ⟨f, (p + 1 + (2 ^ (1 + s) + 1 + v * 2)) * 2 ^ (1 + j) - b', + hf, by omega, hfz1, hfz2, ?_, ?_⟩ + · have heq : (1 + j) + (2 + s) = 3 + j + s := by omega + rwa [heq] at hH + · have h1 : (p + 1 + (2 ^ (1 + s) + 1 + v * 2)) * 2 ^ (1 + j) = + (p + 2 ^ (1 + s) + 1 + v * 2) * 2 ^ (1 + j) + 2 ^ (1 + j) := by nlinarith + have h2 : (p + 2 ^ (1 + s) + 2 + v * 2) * 2 ^ (1 + j) = + (p + 2 ^ (1 + s) + 1 + v * 2) * 2 ^ (1 + j) + 2 ^ (1 + j) := by nlinarith + (try omega) + | @T j1 a b0 w0 hZ0 => + have hj1 : j1 = j := by omega + subst j1 + have hZb := lem_0H hZ0 + rcases lem_1B hZ0 with ⟨wf, hF⟩ + rcases lem_1p (lem_1o hC) with ⟨wr, hrem⟩ + have hR' : lem_0N (2 ^ s + (2 ^ (1 + j) - a - 2) * 2 ^ (1 + s) + (2 ^ s + (2 ^ s - 1 - e))) k t + r := by + have heq : 2 ^ s + (2 ^ (1 + j) - a - 2) * 2 ^ (1 + s) + (2 ^ s + (2 ^ s - 1 - e)) = + 2 ^ (2 + j + s) - 1 - e - 2 ^ s * (1 + a * 2) := by + have h1 : (2 ^ (1 + j) - a - 2) * 2 ^ (1 + s) + 2 ^ s * (1 + a * 2) + 2 ^ s + 2 ^ s + 2 ^ s + = 2 ^ (2 + j + s) := by + have h2 : 2 + j + s = (1 + j) + (1 + s) := by omega + rw [h2, lem_1H (1 + j) (1 + s), lem_P2 s] + have h3 : 2 ^ (1 + j) - a - 2 + a + 2 = 2 ^ (1 + j) := by have := lem_P2 j; omega + nlinarith + (try omega) + rwa [heq] + have hD := lem_1f hrem hR' hM + have hD' : Side ([Call.hc] ^ (2 ^ (1 + j) - 1 - a) ++ [Call.hb] ^ (1 + (2 ^ (1 + s) + v * 2)) ++ + [Call.hc]) + ([1, 0, 1, 1, 1, 0] +> ((T ^ s) +> ([0] +> r))) ((T ^ (2 + s)) +> ([0] +> u)) := by + have heq1 : 1 + (2 ^ (1 + j) - a - 2) = 2 ^ (1 + j) - 1 - a := by rw [lem_P2]; omega + have heq2 : 2 ^ (2 + s) - (1 + (2 ^ s - 1 - v) * 2) = 1 + (2 ^ (1 + s) + v * 2) := by + have : 2 + s = 1 + (1 + s) := by omega + rw [this, lem_P2 (1 + s), lem_P2 s]; omega + rw [<- List.append_assoc] at hD + rwa [heq1, heq2] at hD + have hH := lem_1G hF hP hD' + have hFb := lem_0H hF + refine ⟨1 + j, (p + 1 + (2 ^ (1 + s) + v * 2)) * 2 ^ (1 + j) - (2 ^ (1 + j) - 1 - b0 * 2), + by omega, by omega, ?_, ?_, ?_, ?_⟩ + · have heq : 1 + j - 1 = j := by omega + rw [heq]; omega + · rw [lem_P2 j]; omega + · have heq : (1 + j) + (2 + s) = 3 + j + s := by omega + rwa [heq] at hH + · have h1 : (p + 2 ^ (1 + s) + 2 + v * 2) * 2 ^ (1 + j) = + (p + 1 + (2 ^ (1 + s) + v * 2)) * 2 ^ (1 + j) + 2 ^ (1 + j) := by nlinarith + have h2 : (p + 1 + (2 ^ (1 + s) + v * 2)) * 2 ^ (1 + j) = + (p + (2 ^ (1 + s) + v * 2)) * 2 ^ (1 + j) + 2 ^ (1 + j) := by nlinarith + have h3 := lem_P2 j + (try omega) +theorem lem_1J {d a b : Nat} {w : FinWord} (h : Num d a b w) : + ∀ {r v : TapeBlank}, + lem_0N 1 1 v r -> Side [Call.hb] ([1, 0] +> r) ([1, 0, 1, 1, 1, 0, 0] +> v) -> + ∃ j s p r0, d = j + s /\ + ([1, 0] : FinWord) +> (w +> r) = (T ^ j) +> r0 /\ + p * 2 ^ j + a + 1 = 2 ^ (1 + d) /\ + (j < d -> a + 2 ^ j < 2 ^ d) /\ + (a + 1 < 2 ^ d -> j < d) /\ + (j = 0 -> ∃ m, a = m * 2) /\ + Side ([Call.hb] ^ p) r0 ([1, 0, 1, 1, 1, 0] +> ((T ^ s) +> ([0] +> v))) := by + induction h with + | nil => + intro r v hM hB + refine ⟨0, 0, 1, [1, 0] +> r, rfl, rfl, by omega, by omega, by omega, fun _ => ⟨0, rfl⟩, ?_⟩ + simpa only [lem_06, lem_07, List.append_nil, append_cons, append_nil] using! hB + | @Z d a b w hNum _ => + intro r v hM hB + have hbnd := lem_0H hNum + have hpow1 := lem_P2 d + have hpow2 := lem_P2 (1 + d) + refine ⟨0, 1 + d, 1 + ((1 + 1) * 2 ^ d - 1 - a) * 2, [1, 0, 1, 1, 0, 0] +> (w +> r), + by omega, rfl, by omega, by omega, by omega, fun _ => ⟨a, rfl⟩, ?_⟩ + have hP := lem_Sc (lem_18 ((1 + 1) * 2 ^ d - 1 - a)) (lem_0O 1 (lem_0R hNum hM)) + have heq : d + 1 = 1 + d := by omega + rwa [heq] at hP + | @T d a b w hNum ih => + intro r v hM hB + rcases ih hM hB with ⟨j, s, p, r0, hd, hw, hp, ha, hj, hpar, hP⟩ + have hpow_d := lem_P2 d + have hpow_1d := lem_P2 (1 + d) + have hpow_j := lem_P2 j + refine ⟨1 + j, s, p, r0, by omega, ?_, ?_, ?_, ?_, by omega, hP⟩ + · calc ([1, 0] : FinWord) +> ((T ++ w) +> r) + _ = T +> ([1, 0] +> (w +> r)) := by simp only [T, append_assoc, append_cons, append_nil] + _ = (T ^ (1 + j)) +> r0 := by rw [hw, lem_Lp', append_assoc] + · nlinarith + · intro hj' + have h1 := ha (by omega) + (try omega) + · omega +theorem lem_1K {d k q : Nat} {r : TapeBlank} (hR : RC k q r) (hd : k <= d) : + ∃ a w v q2 t qu u, + Num d a q w /\ RC (1 + d) (2 ^ (1 + d) - 1 - a) v /\ + lem_0N 1 1 v ([1, 1, 0] +> ((T ^ (1 + d)) +> ([0] +> r))) /\ + Side [Call.hb] ([1, 0] +> ([1, 1, + 0] +> ((T ^ (1 + d)) +> ([0] +> r)))) ([1, 0, 1, 1, 1, 0, 0] +> v) /\ + RC k q2 t /\ lem_0N (2 ^ (1 + d) - 1 - a) (1 + d) t v /\ + RC (1 + d) qu u /\ lem_0N 1 1 u ([1, 1, 0] +> ((T ^ (1 + d)) +> ([0] +> t))) /\ + (k < d -> ∃ m, qu = 1 + m * 2) := by + rcases lem_1D hR hd with ⟨a, w, k', q', t', hN, hT, hk, hNR, hV, hM⟩ + rcases lem_1E hN hR hT hk hd with ⟨q2, t, hT2, hNV⟩ + rcases lem_1D hT2 hd with ⟨a2, w2, k2, q3, t2, hN2, hT3, hk2, hNT, hU, hM2⟩ + refine ⟨a, w, _, q2, t, _, _, hN, hV, hM, lem_1u hN hNR, hT2, hNV, hU, hM2, ?_⟩ + intro hkd + cases d with + | zero => omega + | succ d => + have heq_d : d + 1 = 1 + d := by omega + rw [heq_d] at hN2 + have h_bnd := lem_0X hT2 + have h_pow := lem_10 (a := k) (b := d) (by omega) + have h_mark := lem_1F hN2 (by omega) + have heq_2d : 2 + d = 1 + (d + 1) := by omega + rwa [<- heq_2d] +theorem lem_1L (n : Nat) : + ∀ {d a b : Nat} {w : FinWord}, Num (n + d) a b w -> + ∃ a1 b1 w1 a2 b2 w2, Num n a1 b1 w1 /\ Num d a2 b2 w2 /\ + a = a1 + 2 ^ n * a2 /\ b = b1 * 2 ^ d + b2 /\ w = w1 ++ w2 := by + induction n with + | zero => + intro d a b w h + rw [Nat.zero_add] at h + exact ⟨0, 0, [], a, b, w, Num.nil, h, by omega, by omega, rfl⟩ + | succ n ih => + intro d a b w h + have heq : n + 1 + d = 1 + (n + d) := by omega + rw [heq] at h + generalize hnd : 1 + (n + d) = nd at h + cases h with + | nil => omega + | @Z nd0 a0 b0 w0 h0 => + have hnd0 : nd0 = n + d := by omega + subst nd0 + rcases ih h0 with ⟨a1, b1, w1, a2, b2, w2, h1, h2, ha, hb, hw⟩ + have hZ := Num.Z h1 + rw [Nat.add_comm 1 n] at hZ + have hpow := lem_P2 n + rw [Nat.add_comm 1 n] at hpow + refine ⟨a1 * 2, b1, Z ++ w1, a2, b2, w2, hZ, h2, by nlinarith, hb, by rw [hw, + List.append_assoc]⟩ + | @T nd0 a0 b0 w0 h0 => + have hnd0 : nd0 = n + d := by omega + subst nd0 + rcases ih h0 with ⟨a1, b1, w1, a2, b2, w2, h1, h2, ha, hb, hw⟩ + have hT := Num.T h1 + rw [Nat.add_comm 1 n] at hT + have hpow := lem_P2 n + rw [Nat.add_comm 1 n] at hpow + have hpow_nd := lem_1H n d + refine ⟨1 + a1 * 2, 2 ^ n + b1, T ++ + w1, a2, b2, w2, hT, h2, by nlinarith, by nlinarith, by rw [hw, List.append_assoc]⟩ +def lem_1M (d a q Q : Nat) : Prop := + ∃ j f z v, + j <= d /\ 0 < f /\ f <= j /\ 2 ^ (f - 1) <= z /\ z < 2 ^ f /\ + q = v * 2 ^ j + z /\ Q + a + 3 * 2 ^ f = 2 ^ (2 + d) + q * 2 + 2 ^ (1 + j) /\ + (j < d -> a + 2 ^ j < 2 ^ d) /\ (a + 1 < 2 ^ d -> j < d) +theorem lem_1N {d a b k q : Nat} {w : FinWord} {r : TapeBlank} + (hN : Num d (1 + a * 2) b w) (hR : RC k (1 + q * 2) r) (hd : k <= d) : + ∃ Q qu u, RC (1 + d) qu u /\ + lem_0N Q (2 + d) u ([1, 0] +> (w +> ([1, 1, 0] +> ((T ^ (1 + d)) +> ([0] +> r))))) /\ + lem_1M d (1 + a * 2) (1 + q * 2) Q /\ (k < d -> ∃ m, qu = 1 + m * 2) := by + rcases lem_1K hR hd with ⟨e, we, v, q2, t, qu, u, hE, hV, hM, hB, hT, hNV, hU, hM2, hpar⟩ + rcases lem_1J hN hM hB with ⟨j, s, p, r0, hds, hword, hp, ha, hj, hpar', hP⟩ + cases j with + | zero => + rcases hpar' rfl with ⟨m, hm⟩ + (try omega) + | succ j => + have heq_j : j + 1 = 1 + j := by omega + rw [heq_j] at hds hword hp ha hj + have hE' : Num (s + (1 + j)) e (1 + q * 2) we := by + have heq : s + (1 + j) = d := by omega + rwa [heq] + rcases lem_1L s hE' with ⟨e0, v0, w0, b0, z, wz, hE0, hZ, he, hq, hw⟩ + have hz : 0 < z := by + have hpow : v0 * 2 ^ (1 + j) = (v0 * 2 ^ j) * 2 := by + rw [lem_P2 j, Nat.mul_add]; omega + (try omega) + have hNV' : lem_0N (2 ^ (2 + j + s) - 1 - e0 - 2 ^ s * b0) (1 + d) t v := by + have heq : 2 ^ (2 + j + s) - 1 - e0 - 2 ^ s * b0 = 2 ^ (1 + d) - 1 - e := by + have h1 : 2 + j + s = 1 + d := by omega + rw [h1, he]; omega + rwa [heq] + rcases lem_1I hZ hE0 hz hNV' hM2 hP with ⟨f, Q, hf, hfj, hfz1, hfz2, hnormal, hQ⟩ + refine ⟨Q, qu, u, hU, ?_, ?_, hpar⟩ + · rw [<- hword] at hnormal + have heq : 3 + j + s = 2 + d := by omega + rwa [heq] at hnormal + · refine ⟨1 + j, f, z, v0, by omega, hf, hfj, hfz1, hfz2, hq, ?_, ha, hj⟩ + have h1 : 2 + d = (2 + s) + (1 + j) := by omega + have h2 : 1 + d = (1 + s) + (1 + j) := by omega + rw [h1, lem_1H (2 + s) (1 + j)] + rw [h2, lem_1H (1 + s) (1 + j)] at hp + have h3 : 2 ^ (2 + s) = 2 * 2 ^ (1 + s) := by + have : 2 + s = 1 + (1 + s) := by omega + rw [this, lem_P2 (1 + s)]; omega + have h4 := lem_P2 (1 + j) + rw [h3, h4] + nlinarith +theorem lem_1O {s a b k q : Nat} {w : FinWord} {r : TapeBlank} + (hN : Num s a b w) (hR : RC k q r) (hk : k <= s) : + ∃ qu u, RC (1 + s) qu u /\ + lem_0N (2 ^ (3 + s) - a * 2 + q * 4) (3 + s) u + ([1, 0] +> (Z +> (w +> ([1, 1, 0] +> ((T ^ (1 + s)) +> ([0] +> r)))))) /\ + (k < s -> ∃ m, qu = 1 + m * 2) := by + rcases lem_1K hR hk with ⟨e, we, v, q2, t, qu, u, hE, hV, hM, hB, hT, hNV, hU, hM2, hpar⟩ + exact ⟨qu, u, hU, lem_1s hN hE hM hNV hM2, hpar⟩ +theorem lem_1P {d a q Q : Nat} (ha : a < 2 ^ d) (hq : q < 2 ^ d) (hC : lem_1M d a q Q) : + 3 * 2 ^ d < Q + 1 /\ Q + 1 < 6 * 2 ^ d := by + rcases hC with ⟨j, f, z, v, hjd, hf, hfj, hz1, hz2, hqv, hQ, ha', hj'⟩ + have hpj : 2 ^ f <= 2 ^ j := lem_10 hfj + have hpz : 2 ^ f <= z * 2 := by + cases f with + | zero => omega + | succ f => + simp only [Nat.add_sub_cancel] at hz1 + rw [Nat.add_comm f 1, lem_P2]; omega + have hdl : d = j + (d - j) := by omega + have hpow_d : 2 ^ d = 2 ^ j * 2 ^ (d - j) := by rw [<- lem_1H, <- hdl] + have hv_lt : v < 2 ^ (d - j) := by nlinarith + have hcap : q + 2 ^ j <= 2 ^ d + z := by nlinarith + have hpow2 := lem_0F d + have hpow_j := lem_P2 j + (try omega) +theorem lem_1Q {d a q Q : Nat} (hC : lem_1M d (1 + a * 2) q Q) : + ∃ m, Q = 1 + m * 2 := by + rcases hC with ⟨j, f, z, v, hjd, hf, hfj, hz1, hz2, hqv, hQ, ha', hj'⟩ + cases f with + | zero => omega + | succ f => + have hpow_f : 2 ^ (f + 1) = 2 ^ f * 2 := by rw [Nat.pow_succ] + have hpow_d := lem_0F d + have hpow_j := lem_P2 j + exact ⟨Q / 2, by omega⟩ +theorem lem_1R {d a q Q : Nat} (hd : 0 < d) (ha : a + 1 < 2 ^ d) (hq : 2 ^ (d - 1) <= q) + (hC : lem_1M d a q Q) : 2 ^ (2 + d) < Q := by + rcases hC with ⟨j, f, z, v, hjd, hf, hfj, hz1, hz2, hqv, hQ, ha', hj'⟩ + have ha_lt := ha' (hj' ha) + have hpj : 2 ^ f <= 2 ^ j := lem_10 hfj + have hqd : 2 ^ d <= q * 2 := by + cases d with + | zero => omega + | succ d => + simp only [Nat.add_sub_cancel] at hq + rw [Nat.add_comm d 1, lem_P2]; omega + have hpow_j := lem_P2 j + (try omega) +theorem lem_1S {d a m : Nat} {w : FinWord} (hd : 0 < d) (h : Num d a (m * 2) w) : + a + 1 < 2 ^ d := by + rcases lem_1p h with ⟨w', h'⟩ + generalize hm : m * 2 = m2 at h' + cases h' with + | nil => omega + | @Z d0 a0 b0 w0 h0 => + have hbnd := lem_0H h0 + rw [lem_P2] + (try omega) + | @T d0 a0 b0 w0 h0 => + (try omega) +inductive Inv : Cfg (Fin 2) (Fin 6) -> Prop where + | E {s a b k q : Nat} {w : FinWord} {r : TapeBlank} : + Num s a b w -> RC k q r -> k <= s -> + Inv (lem_13 (Z ++ w) (1 + s) r) + | O {s a b k q : Nat} {w : FinWord} {r : TapeBlank} : + Num s a b w -> RC k (1 + q * 2) r -> k <= 1 + s -> + (k = 1 + s -> a + 1 < 2 ^ s) -> + Inv (lem_13 (T ++ w) (2 + s) r) +theorem lem_1T {d Q k q : Nat} {r t : TapeBlank} + (hd : 0 < d) (hN : lem_0N Q (2 + d) t r) (hR : RC k q t) (hk : k <= 1 + d) + (hQ1 : 3 * 2 ^ d < Q + 1) (hQ2 : Q + 1 < 6 * 2 ^ d) + (hlow : Q + 1 < 2 ^ (2 + d) -> (∃ m, q = 1 + m * 2) /\ (k = 1 + d -> ∃ m, Q = 1 + m * 2)) : + ∃ c, ((lem_CR lh Q_B ([0] +> r)) [target_tm]⊢⁺ c) /\ Inv c := by + have hpow1 := lem_P2 d + have hpow2 := lem_0F d + have h_2d : 2 + d = 1 + (1 + d) := by omega + by_cases hH : 2 ^ (2 + d) <= Q + 1 + · have hb : Q + 1 - 2 ^ (2 + d) < 2 ^ (1 + d) := by omega + rcases lem_0J (1 + d) (Q + 1 - 2 ^ (2 + d)) hb with ⟨a, w, hW⟩ + refine ⟨lem_13 (Z ++ w) (2 + d) t, ?_, ?_⟩ + · have hZ : Num (2 + d + 0) (a * 2) (Q + 1 - 2 ^ (2 + d)) (Z ++ w) := by + have hZ0 := Num.Z hW + have heq_d : 1 + (1 + d) = 2 + d + 0 := by omega + rwa [heq_d] at hZ0 + have h_ret := lem_17 (2 + d) (i := 0) hZ (q := Q) (by rw [Nat.add_zero]; omega) hN + simpa only [lem_06, append_nil] using! h_ret + · have h_inv := Inv.E hW hR hk + rwa [<- h_2d] at h_inv + · rcases hlow (by omega) with ⟨⟨m, rfl⟩, hodd⟩ + have hb : Q + 1 - 3 * 2 ^ d < 2 ^ d := by omega + rcases lem_0J d (Q + 1 - 3 * 2 ^ d) hb with ⟨a, w, hW⟩ + refine ⟨lem_13 (T ++ w) (2 + d) t, ?_, ?_⟩ + · have hT : Num (1 + d + 0) (1 + a * 2) (2 ^ d + (Q + 1 - 3 * 2 ^ d)) (T ++ w) := by + have hT0 := Num.T hW + have heq_d : 1 + d = 1 + d + 0 := by omega + rwa [heq_d] at hT0 + have h_ret := lem_17 (1 + d) (i := 0) hT (q := Q) (by rw [Nat.add_zero]; omega) hN + simpa only [lem_06, append_nil] using! h_ret + · refine Inv.O hW hR hk (fun heq => ?_) + rcases hodd heq with ⟨v, hv⟩ + have h_even : Q + 1 - 3 * 2 ^ d = (Q + 1 - 3 * 2 ^ d) / 2 * 2 := by + cases d with + | zero => omega + | succ d => + have : 2 ^ (d + 1) = 2 ^ d * 2 := Nat.pow_succ 2 d + (try omega) + rw [h_even] at hW + exact lem_1S hd hW +theorem lem_1U {d k q : Nat} {r : TapeBlank} (h : RC k q r) (hd : k <= d) : + q < 2 ^ d := by + have hbnd := lem_0X h + have hpow := lem_10 hd + (try omega) +theorem lem_1V (c : Cfg (Fin 2) (Fin 6)) (h : Inv c) : + ∃ c', (c [target_tm]⊢⁺ c') /\ Inv c' := by + cases h with + | @E s a b k q w r hN hR hk => + rcases lem_1O hN hR hk with ⟨qu, u, hU, hM, hpar⟩ + have hNb := lem_0H hN + have hRb := lem_1U hR hk + have hpow1 := lem_P2 s + have hpow2 := lem_0F s + have hpow3 := lem_0G s + have hpow_21s := lem_0F (1 + s) + have hM' : lem_0N (2 ^ (3 + s) - a * 2 + q * 4) (2 + (1 + s)) u + ([1, 0] +> (Z +> (w +> ([1, 1, 0] +> ((T ^ (1 + s)) +> ([0] +> r)))))) := by + have h_3s : 3 + s = 2 + (1 + s) := by omega + exact Eq.mp (by rw [h_3s]) hM + have h_next := lem_1T (d := 1 + s) (by omega) hM' hU (by omega) + (by omega) (by omega) ?_ + · rcases h_next with ⟨c', hc', hinv'⟩ + refine ⟨c', ?_, hinv'⟩ + unfold lem_13 + simpa only [append_assoc, append_cons, append_nil] using! hc' + · intro hlow + have hks : k < s := by + by_contra hge + have hkeq : k = s := by omega + subst k + have hbnd := lem_0X hR + cases s with + | zero => omega + | succ s => + have hq_ge := hbnd.2 (by omega) + simp only [Nat.add_sub_cancel] at hq_ge + have : 2 ^ (s + 1) = 2 ^ s + 2 ^ s := by rw [Nat.pow_succ]; omega + (try omega) + exact ⟨hpar hks, by omega⟩ + | @O s a b k q w r hN hR hk ha => + have hW := Num.T hN + rcases lem_1N hW hR hk with ⟨Q, qu, u, hU, hM, hC, hpar⟩ + have hWb := lem_0H hW + have hRb := lem_1U hR hk + rcases lem_1P hWb.1 hRb hC with ⟨hQ1, hQ2⟩ + have h_next := lem_1T (d := 1 + s) (by omega) hM hU (by omega) + hQ1 hQ2 ?_ + · rcases h_next with ⟨c', hc', hinv'⟩ + refine ⟨c', ?_, hinv'⟩ + have h_2s : 2 + s = 1 + (1 + s) := by omega + unfold lem_13 + rw [h_2s] + simpa only [append_assoc, append_cons, append_nil] using! hc' + · intro hlow + have hks : k < 1 + s := by + by_contra hge + have hkeq : k = 1 + s := by omega + subst k + have ha_lt := ha rfl + have hbnd := lem_0X hR + have hpow_s := lem_P2 s + have h_large := lem_1R (d := 1 + s) (by omega) (by omega) (hbnd.2 (by omega)) hC + (try omega) + exact ⟨hpar hks, fun _ => lem_1Q hC⟩ +theorem lem_1W : + (init []) [target_tm]⊢⁺ (((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank)) {{0}}> ((1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (default : TapeBlank))) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{0}}> default) := rfl + rw [h_init] + execute +theorem lem_1X : + (((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank)) {{0}}> ((1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank))) [target_tm]⊢⁺ (((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank)) {{4}}> ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank))) := by + execute +theorem lem_1Y : + (((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (default : TapeBlank)) {{4}}> ((0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (default : TapeBlank))) [target_tm]⊢⁺ (((1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (default : TapeBlank)) {{1}}> ((0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (default : TapeBlank))) := by + execute +theorem lem_1Z : + (((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank)) {{1}}> ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank))) [target_tm]⊢⁺ lem_13 (Z ++ T) 2 default := by + unfold lem_13 lem_CR lh Z T + simp only [lem_Lp, lem_06, List.cons_append, List.nil_append, append_cons, append_nil] + execute +theorem lem_20 : + (init []) [target_tm]⊢⁺ lem_13 (Z ++ T) 2 default := + lem_Pt lem_1W (lem_Pt lem_1X (lem_Pt lem_1Y lem_1Z)) +theorem lem_Im {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d) = some c') : + (multiStep target_tm c j).isSome := by + rw [lem_Ma] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +theorem lem_21 (m : Nat) : + ∃ N ≥ m, ∃ c, multiStep target_tm (init []) N = some c /\ Inv c := by + induction m with + | zero => + rcases lem_20 with ⟨k, _, hk⟩ + have hT : Num 1 1 1 T := Num.T Num.nil + have hRC : RC 0 0 default := RC.base 0 + have h_inv := Inv.E hT hRC (by omega) + exact ⟨k, Nat.zero_le k, _, hk, h_inv⟩ + | succ m ih => + rcases ih with ⟨N, hN, c, h_ms, h_inv⟩ + rcases lem_1V c h_inv with ⟨c', ⟨k, hk_pos, h_step_k⟩, h_inv'⟩ + exact ⟨N + k, Nat.add_le_add hN hk_pos, c', lem_Mt target_tm _ _ _ N k h_ms h_step_k, h_inv'⟩ + +theorem lem_1W_0715 : + ((default : TapeBlank) {{5}}> default) [target_tm]⊢⁺ (((1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank)) <{{1}} (default)) := by + execute +theorem lem_1X_0715 : + (((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank)) <{{1}} (default)) [target_tm]⊢⁺ (((1 : Fin 2) >> (0 : Fin 2) >> + (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (default : TapeBlank)) <{{3}} ((1 : Fin 2) >> + (default : TapeBlank))) := by + execute +theorem lem_1Y_0715 : + (((1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank)) <{{3}} ((1 : Fin 2) >> + (default : TapeBlank))) [target_tm]⊢⁺ (((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (default : TapeBlank)) <{{1}} ((1 : Fin 2) >> (0 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (default : TapeBlank))) := by + execute +theorem lem_1Z_0715 : + (((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank)) <{{1}} ((1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (default : TapeBlank))) [target_tm]⊢⁺ (((0 : Fin 2) >> (0 : Fin 2) >> + (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (default : TapeBlank)) <{{2}} ((1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (default : TapeBlank))) := by + execute +theorem lem_20_0715 : + (((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank)) <{{2}} ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank))) [target_tm]⊢⁺ (((1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (default : TapeBlank)) <{{2}} ((0 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (default : TapeBlank))) := by + execute +theorem lem_21_0715 : + (((1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank)) <{{2}} ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank))) [target_tm]⊢⁺ (((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank)) <{{2}} ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (default : TapeBlank))) := by + execute +theorem lem_22_0715 : + (((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (default : TapeBlank)) <{{2}} ((1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (default : TapeBlank))) [target_tm]⊢⁺ (((0 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (default : TapeBlank)) <{{2}} ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (default : TapeBlank))) := by + execute +theorem lem_23_0715 : + (((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (default : TapeBlank)) <{{2}} ((1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank))) [target_tm]⊢⁺ (((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank)) <{{1}} ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (default : TapeBlank))) := by + execute +theorem lem_24_0715 : + (((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (default : TapeBlank)) <{{1}} ((1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank))) [target_tm]⊢⁺ (((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (default : TapeBlank)) <{{4}} ((1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (default : TapeBlank))) := by + execute +theorem lem_25_0715 : + (((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank)) <{{4}} ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (default : TapeBlank))) [target_tm]⊢⁺ lem_13 (Z ++ (T ++ Z)) 3 (Z +> default) := by + unfold lem_13 lem_CR lh Z T + simp only + [lem_Lp, lem_06, List.cons_append, List.nil_append, append_cons, + append_nil] + execute +theorem lem_26_0715 : + ((default : TapeBlank) {{5}}> default) [target_tm]⊢⁺ lem_13 (Z ++ (T ++ Z)) 3 (Z +> default) := + lem_Pt lem_1W_0715 + (lem_Pt lem_1X_0715 + (lem_Pt lem_1Y_0715 + (lem_Pt lem_1Z_0715 + (lem_Pt lem_20_0715 + (lem_Pt lem_21_0715 + (lem_Pt lem_22_0715 + (lem_Pt lem_23_0715 + (lem_Pt lem_24_0715 lem_25_0715)))))))) + +theorem lem_27_0715 (m : Nat) : + ∃ N ≥ m, ∃ c, + multiStep target_tm ((default : TapeBlank) {{5}}> default) N = some c /\ Inv c := by + induction m with + | zero => + rcases lem_26_0715 with ⟨k, _, hk⟩ + have hTZ : Num 2 1 2 (T ++ Z) := Num.T (Num.Z Num.nil) + have hRC : RC 1 1 (Z +> default) := RC.base 1 + have h_inv := Inv.E hTZ hRC (by omega) + exact ⟨k, Nat.zero_le k, _, hk, h_inv⟩ + | succ m ih => + rcases ih with ⟨N, hN, c, h_ms, h_inv⟩ + rcases lem_1V c h_inv with ⟨c', ⟨k, hk_pos, h_step_k⟩, h_inv'⟩ + exact ⟨N + k, Nat.add_le_add hN hk_pos, c', lem_Mt target_tm _ _ _ N k h_ms h_step_k, h_inv'⟩ + +theorem is_not_halt_from_0715_tm : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{5}}> default) [target_tm]⊢* cfg) → + (step target_tm cfg).isSome := by + intro cfg h_reach + rcases h_reach with ⟨n, hn⟩ + rcases lem_27_0715 (n + 1) with ⟨N, hN, c', h_N, _⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := lem_Im h_N + rw [lem_Ms, hn] at h_some + exact h_some + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n, hn⟩ + rcases lem_21 (n + 1) with ⟨N, hN, c', h_N, _⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := lem_Im h_N + rw [lem_Ms, hn] at h_some + exact h_some + +end Solution + +public section + +theorem is_not_halt_from_0715 : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{5}}> default) [target]⊢* cfg) → + (step target cfg).isSome := + Solution.is_not_halt_from_0715_tm + +theorem is_not_halt : IsNotHalt target := Solution.is_does_not_halt + +end + +end BusyBeaver.M_1RB1LD_0RC0RB_0LD1RE_0LA1LC_0RB0RF_1LCHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LD_0RC1RC_1LA1RE_HHH1LE_1RF0RC_0RB0LF.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LD_0RC1RC_1LA1RE_HHH1LE_1RF0RC_0RB0LF.lean new file mode 100644 index 00000000..796acc1f --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LD_0RC1RC_1LA1RE_HHH1LE_1RF0RC_0RB0LF.lean @@ -0,0 +1,197 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.SharedDonorsA + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RB1LD_0RC1RC_1LA1RE_HHH1LE_1RF0RC_0RB0LF + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LD_0RC1RC_1LA1RE_HHH1LE_1RF0RC_0RB0LF" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +open BusyBeaver.Counter +open TM1Donor + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +set_option maxRecDepth 2000000 +-- 5. Stem `init [] ⊢* Kr 979 17 34 22 9`, Transient to `Ev 6431 20`, and Goal +-- ============================================================================ + +def symInit : SymState := ⟨.q0, .right, [], [], false⟩ + +def stem_mid0 : SymState := + mkSymKr (List.append gToks [SymTok.b1, SymTok.b1, SymTok.b1, SymTok.pow .w11 8 .v0, SymTok.b0, + SymTok.b1, SymTok.pow .w11 1 .v0, SymTok.b0, SymTok.b1, SymTok.pow .w11 1 .v0]) + +theorem stem_cert0 : checkSym false 6303 symInit stem_mid0 = true := by + decide + +def symKr979 : SymState := + mkSymKr ( + segConst (G ++ [1]) 979 ++ + segConst [0] 17 ++ + segConst [0, 1, 1, 0] 34 ++ + segConst [0, 0, 0, 0, 0, 0, 1] 22 ++ + segConst [0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0] 9 ++ + krTailToks) + +def stem_mid1 : SymState := + mkSymKr (List.append gToks [SymTok.b1, SymTok.b1, SymTok.b1, SymTok.pow .w11 186 .v0, SymTok.b0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 5 .v0, SymTok.b0, SymTok.b0, + SymTok.pow .w11 13 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b0, SymTok.pow .w11 6 .v0, SymTok.b0, SymTok.b1, + SymTok.b1]) + +def stem_mid2 : SymState := + mkSymKr (List.append gToks [SymTok.pow .w11 311 .v0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.pow .w11 2 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.b1, SymTok.pow .w11 17 .v0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, + SymTok.pow .w11 19 .v0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.pow .w11 1 .v0]) + +def stem_mid3 : SymState := + mkSymKr (List.append gToks [SymTok.pow .w11 435 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b1, + SymTok.pow .w11 37 .v0, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b1, + SymTok.pow .w11 9 .v0]) + +def stem_mid4 : SymState := + mkSymKr (List.append gToks [SymTok.b1, SymTok.b1, SymTok.b1, SymTok.pow .w11 558 .v0, SymTok.b0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 16 .v0, SymTok.b0, SymTok.b0, + SymTok.pow .w11 22 .v0, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 10 .v0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 6 .v0, + SymTok.b0, SymTok.b0, SymTok.pow .w11 1 .v0, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, + SymTok.pow .w11 1 .v0, SymTok.b0, SymTok.b1, SymTok.b1]) + +def stem_mid5 : SymState := + mkSymKr (List.append gToks [SymTok.pow .w11 681 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b1, + SymTok.pow .w11 65 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.pow .w11 3 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.b1, SymTok.b1, SymTok.pow .w11 2 .v0, SymTok.b0, SymTok.b0, SymTok.pow .w11 1 .v0, + SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 1 .v0, SymTok.b0, SymTok.b1, + SymTok.b1]) + +def stem_mid6 : SymState := + mkSymKr (List.append gToks [SymTok.b1, SymTok.b1, SymTok.b1, SymTok.pow .w11 792 .v0, SymTok.b0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 46 .v0, SymTok.b0, SymTok.b0, + SymTok.pow .w11 2 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.b1, SymTok.pow .w11 17 .v0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, + SymTok.pow .w11 10 .v0, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 9 .v0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.pow .w11 2 .v0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 1 .v0, + SymTok.b0, SymTok.b1, SymTok.b1]) + +def stem_mid7 : SymState := + mkSymKr (List.append gToks [SymTok.pow .w11 885 .v0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.pow .w11 32 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.b1, SymTok.b1, SymTok.pow .w11 24 .v0, SymTok.b0, SymTok.b0, SymTok.pow .w11 1 .v0, + SymTok.b0, SymTok.b0, SymTok.pow .w11 24 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.pow .w11 1 .v0, SymTok.b0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.pow .w11 6 .v0, SymTok.b0, SymTok.b1, SymTok.b1]) + +def stem_mid8 : SymState := + mkSymKr (List.append gToks [SymTok.b1, SymTok.b1, SymTok.pow .w11 970 .v0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 16 .v0, SymTok.b0, + SymTok.b0, SymTok.pow .w11 36 .v0, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, + SymTok.pow .w11 21 .v0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.pow .w11 2 .v0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.pow .w11 2 .v0, SymTok.b0, SymTok.b0, + SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.pow .w11 9 .v0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, + SymTok.pow .w11 1 .v0]) + +theorem stem_cert1 : checkMid true 8499 stem_mid0 stem_mid1 = true := by + decide + +theorem stem_cert2 : checkMid true 8465 stem_mid1 stem_mid2 = true := by + decide + +theorem stem_cert3 : checkMid true 8493 stem_mid2 stem_mid3 = true := by + decide + +theorem stem_cert4 : checkMid true 8477 stem_mid3 stem_mid4 = true := by + decide + +theorem stem_cert5 : checkMid true 8431 stem_mid4 stem_mid5 = true := by + decide + +theorem stem_cert6 : checkMid true 8422 stem_mid5 stem_mid6 = true := by + decide + +theorem stem_cert7 : checkMid true 8286 stem_mid6 stem_mid7 = true := by + decide + +theorem stem_cert8 : checkMid true 8494 stem_mid7 stem_mid8 = true := by + decide + +theorem stem_cert_end : checkSym true 226 stem_mid8 symKr979 = true := by + decide + + +theorem init_to_kr979 : (init []) [tm1]⊢* Kr 979 17 34 22 9 := by + have h := + stepPlus_stepStar (stepStar_stepPlus_trans (stepPlus_stepStar (checkSym_sound 0 0 0 0 0 + stem_cert0)) (stepStar_stepPlus_trans (checkMid_sound 0 0 0 0 0 stem_cert1) + (stepStar_stepPlus_trans (checkMid_sound 0 0 0 0 0 stem_cert2) (stepStar_stepPlus_trans + (checkMid_sound 0 0 0 0 0 stem_cert3) (stepStar_stepPlus_trans (checkMid_sound 0 0 0 0 0 + stem_cert4) (stepStar_stepPlus_trans (checkMid_sound 0 0 0 0 0 stem_cert5) + (stepStar_stepPlus_trans (checkMid_sound 0 0 0 0 0 stem_cert6) (stepStar_stepPlus_trans + (checkMid_sound 0 0 0 0 0 stem_cert7) (stepStar_stepPlus_trans (checkMid_sound 0 0 0 0 0 + stem_cert8) (checkSym_sound 0 0 0 0 0 stem_cert_end)))))))))) + have h1 : evalState 0 0 0 0 0 symInit = init [] := rfl + have h2 : evalState 0 0 0 0 0 symKr979 = Kr 979 17 34 22 9 := by + simp only [symKr979, mkSymKr, krTailToks_eq, Kr, krRightList, evalState, evalQ, cfg_of, + List.append_assoc, evalHalf_segConst, evalHalf_map_bit_end, evalHalf, + listblank_append_assoc] + rwa [h1, h2] at h + +theorem kr979_to_ev : (Kr 979 17 34 22 9) [tm1]⊢* Ev 6431 20 := + stepStar_trans (S_iter 4 979 0 31 19 8) <| + stepStar_trans (stepPlus_stepStar (TO 1075 1 4 8)) <| + stepStar_trans (S_iter 4 1369 2 45 14 8) <| + stepStar_trans (stepPlus_stepStar (T6 1465 15 0 8)) <| + stepStar_trans (S_iter 6 1761 3 45 14 8) <| + stepStar_trans (stepPlus_stepStar (T8 1905 16 11)) <| + stepStar_trans (S_iter 5 2175 2 40 41 8) <| + stepStar_trans (stepPlus_stepStar (T6 2295 12 27 10)) <| + stepStar_trans (S_iter 12 2591 3 47 14 8) <| + stepStar_trans (stepPlus_stepStar (T8 2879 30 23)) <| + stepStar_trans (S_iter 9 3149 0 40 53 8) <| + stepStar_trans (stepPlus_stepStar (TO 3365 20 38 18)) <| + stepStar_trans (S_iter 17 3659 3 55 14 8) <| + stepStar_trans (stepPlus_stepStar (T8 4067 48 33)) <| + stepStar_trans (S_iter 13 4337 2 40 63 8) <| + stepStar_trans (stepPlus_stepStar (T6 4649 28 49 26)) <| + stepStar_trans (S_iter 22 4945 1 63 14 8) <| + stepStar_trans (stepPlus_stepStar (TE 5473 66 43)) <| + stepStar_trans (S_iter 16 5751 2 38 75 8) <| + stepPlus_stepStar (T6 6135 32 61 32) + +theorem init_to_ev : (init []) [target_tm]⊢* Ev 6431 20 := + stepStar_trans init_to_kr979 kr979_to_ev + + +theorem is_does_not_halt : IsNotHalt target_tm := by + refine IsNotHalt.of_reachesPlus_invariant (P := Inv) init_to_ev ⟨6431, 20, rfl⟩ ?_ + rintro _ ⟨N, X, rfl⟩ + exact ⟨Ev (48 * X + 716 + N) (4 + X), DC N X, 48 * X + 716 + N, 4 + X, rfl⟩ + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1LD_0RC1RC_1LA1RE_HHH1LE_1RF0RC_0RB0LF diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LD_1LC1RA_0LD0LC_0RE1RB_1RD0RF_0RBHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LD_1LC1RA_0LD0LC_0RE1RB_1RD0RF_0RBHHH.lean new file mode 100644 index 00000000..8db20512 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LD_1LC1RA_0LD0LC_0RE1RB_1RD0RF_0RBHHH.lean @@ -0,0 +1,1857 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1LD_1LC1RA_0LD0LC_0RE1RB_1RD0RF_0RBHHH + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +local macro "normalize" : tactic => `(tactic| ( + try simp only [ListBlank.append_cons, ListBlank.append_nil, + ListBlank.head_cons, ListBlank.tail_cons, + ListBlank.head_default, ListBlank.head_default_fin, ListBlank.tail_default, + ListBlank.cons_zero_default, ListBlank.cons_default_default, + list_pow_zero, list_pow_succ, + List.nil_append, List.cons_append, List.append_nil, + Nat.mul_zero, Nat.mul_add, Nat.mul_one])) +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LD_1LC1RA_0LD0LC_0RE1RB_1RD0RF_0RBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +private abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +namespace Solution + +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = + some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = + step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem pow_zero_list (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ + ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x + :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +@[simp] +theorem listblank_append_append (s : ListBlank Γ) (l₁ l₂ : List Γ) : + (s <+ l₁) <+ l₂ = s <+ (l₂ ++ l₁) := by + unfold ListBlank.append + split + · split + · next h => simp_all + · simp_all + · rename_i _ l₂ l₁ + refine (congr_arg _ ?_).symm + exact ListBlank.append_assoc l₁ _ s + +theorem list_pow_append_one (u : List (Fin 2)) (k : Nat) : + u^k ++ u = u^(k + 1) := by + have h := list_pow_add_comm u k 1 + dsimp -failIfUnchanged [HPow.hPow] at h ⊢ + rw [List.append_nil] at h + exact h + +theorem cons_eq_singleton_append (x : Fin 2) (r : ListBlank (Fin 2)) : + x >> r = [x] +> r := rfl + +theorem pow_add_append_right (u : List (Fin 2)) (m n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (m + n)) +> r = (u ^ m) +> ((u ^ n) +> r) := by + rw [list_pow_add, ← listblank_append_append] + +theorem pow_succ_append_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (n + 1)) +> r = u +> ((u ^ n) +> r) := by + rw [pow_succ_list, ← listblank_append_append] + +theorem pow_add_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (m n : Nat) : + s <+ (u ^ (m + n)) = (s <+ (u ^ m)) <+ (u ^ n) := by + rw [listblank_append_append, ← list_pow_add, add_comm] + +theorem pow_succ_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (m : Nat) : + (s <+ (u ^ m)) <+ u = s <+ (u ^ (m + 1)) := by + rw [listblank_append_append, ← pow_succ_list] + +theorem step_multiStep {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢^{1} c₂ := by simp [h] + +theorem step_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢* c₂ := ⟨1, step_multiStep tm c₁ c₂ h⟩ + +theorem step_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢⁺ c₂ := ⟨1, by decide, step_multiStep tm c₁ c₂ h⟩ + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus h₁ (stepPlus_stepStar h₂) + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + + +@[simp] theorem init_nil : (init ([] : List (Fin 2))) = (default {{A}}> default) := rfl + +macro "finish" : tactic => + `(tactic| (refine ⟨0, ?_⟩; simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, init_nil, + multiStep_zero, pow_zero_list, pow_succ_list, cons_append_list, append_nil_list, + listblank_append_nil, listblank_append_cons, zero_cons_default]; rfl)) +macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, + BusyBeaver.Cfg.headLeft, init_nil, pow_zero_list, pow_succ_list, cons_append_list, + append_nil_list, listblank_append_nil, listblank_append_cons, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons, default_head, default_tail]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, init_nil, pow_zero_list, + pow_succ_list, cons_append_list, append_nil_list, listblank_append_nil, + listblank_append_cons, Turing.Tape.move, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail]) +macro "execute" : tactic => + `(tactic| (iterate 25 (all_goals (first | exact ⟨0, rfl⟩ | step)))) + + +-- ============================================================================ +-- Section 6: PairCounter Arithmetic & Symbolic Counter Closure (BECv10.v) +-- ============================================================================ + +namespace PairCounter + +theorem pow2_succ (k : Nat) : 2 ^ (k + 1) = 2 ^ k * 2 := by ring +theorem pow2_one_add (k : Nat) : 2 ^ (1 + k) = 2 * 2 ^ k := by ring +theorem pow2_two_add (k : Nat) : 2 ^ (2 + k) = 4 * 2 ^ k := by ring +theorem pow4_succ (k : Nat) : 4 ^ (k + 1) = 4 ^ k * 4 := by ring +theorem pow4_one_add (k : Nat) : 4 ^ (1 + k) = 4 * 4 ^ k := by ring +theorem pow2_pos (k : Nat) : 0 < 2 ^ k := Nat.two_pow_pos k +theorem pow4_pos (k : Nat) : 0 < 4 ^ k := by positivity + +inductive H : Nat → Nat → Prop where + | even (n : Nat) : H (n * 2) (1 + n * 2) + | carry (j : Nat) {x y : Nat} : H x y → H (x * 2 ^ (2 + j) + (2 ^ (1 + j) - 1)) (y * 2 ^ (2 + j)) + +inductive Steps : Nat → Nat → Nat → Prop where + | zero (x : Nat) : Steps 0 x x + | next {n x y z : Nat} : H x y → Steps n y z → Steps (1 + n) x z + +theorem steps_one {x y : Nat} (h : H x y) : Steps 1 x y := + Steps.next h (Steps.zero y) + +theorem steps_trans {n m x y z : Nat} (h1 : Steps n x y) (h2 : Steps m y z) : Steps (n + m) x z := + by + induction h1 with + | zero x => + simpa only [Nat.zero_add] using h2 + | @next n' x' y' z' hxy _ ih => + have heq : 1 + n' + m = 1 + (n' + m) := by omega + rw [heq] + exact Steps.next hxy (ih h2) + +theorem H_even_inv_aux {u y : Nat} (h : H u y) : ∀ x, u = x * 2 → y = 1 + x * 2 := by + cases h with + | even n => + intro x hx; omega + | @carry j x' y' _ => + intro x hx + have h1 : x' * 2 ^ (2 + j) = (x' * 2 ^ j) * 4 := by rw [pow2_two_add]; ring + have h2 : 2 ^ (1 + j) = 2 * 2 ^ j := pow2_one_add j + have hp : 0 < 2 ^ j := pow2_pos j + rw [h1, h2] at hx + omega + +theorem H_even_inv {x y : Nat} (h : H (x * 2) y) : y = 1 + x * 2 := + H_even_inv_aux h x rfl + +theorem steps_drop_even_aux {a u y : Nat} (h : Steps a u y) : + 0 < a → ∀ x, u = x * 2 → Steps (a - 1) (1 + x * 2) y := by + cases h with + | zero => intro ha; omega + | @next n x' u' y' hxy hstep => + intro _ x hx + subst hx + have hu : u' = 1 + x * 2 := H_even_inv hxy + subst hu + have hn : 1 + n - 1 = n := by omega + rw [hn] + exact hstep + +theorem steps_drop_even {a x y : Nat} (ha : 0 < a) (h : Steps a (x * 2) y) : + Steps (a - 1) (1 + x * 2) y := + steps_drop_even_aux h ha x rfl + +theorem H_four {x y : Nat} (h : H x y) : H (1 + x * 4) (y * 4) := by + have hc := H.carry 0 h + have h1 : x * 2 ^ (2 + 0) + (2 ^ (1 + 0) - 1) = 1 + x * 4 := by + change x * 4 + 1 = 1 + x * 4; omega + have h2 : y * 2 ^ (2 + 0) = y * 4 := rfl + rw [h1, h2] at hc + exact hc + +theorem H_eight {x y : Nat} (h : H x y) : H (3 + x * 8) (y * 8) := by + have hc := H.carry 1 h + have h1 : x * 2 ^ (2 + 1) + (2 ^ (1 + 1) - 1) = 3 + x * 8 := by + change x * 8 + 3 = 3 + x * 8; omega + have h2 : y * 2 ^ (2 + 1) = y * 8 := rfl + rw [h1, h2] at hc + exact hc + +theorem H_zero4 (x : Nat) : H (x * 4) (1 + x * 4) := by + have he := H.even (x * 2) + have h1 : x * 2 * 2 = x * 4 := by omega + rw [h1] at he + exact he + +theorem pair_zero {x y : Nat} (h : H x y) : Steps 2 (x * 4) (y * 4) := + Steps.next (H_zero4 x) (steps_one (H_four h)) + +theorem pair_two {x y : Nat} (h : H x y) : Steps 2 (2 + x * 8) (y * 2 * 4) := by + have he := H.even (1 + x * 4) + have h1 : (1 + x * 4) * 2 = 2 + x * 8 := by omega + have h2 : 1 + (2 + x * 8) = 3 + x * 8 := by omega + rw [h1, h2] at he + have h8 := steps_one (H_eight h) + have h3 : y * 8 = y * 2 * 4 := by omega + rw [h3] at h8 + exact Steps.next he h8 + +theorem steps_four {n x y : Nat} (h : Steps n x y) : Steps (n * 2) (x * 4) (y * 4) := by + induction h with + | zero x => exact Steps.zero (x * 4) + | @next n' x' y' z' hxy _ ih => + have htr := steps_trans (pair_zero hxy) ih + have heq : 2 + n' * 2 = (1 + n') * 2 := by omega + rw [heq] at htr + exact htr + +theorem steps_zeros (k : Nat) {n x y : Nat} (h : Steps n x y) : + Steps (n * 2 ^ k) (x * 4 ^ k) (y * 4 ^ k) := by + induction k with + | zero => + simpa only [Nat.pow_zero, Nat.mul_one] using h + | succ k ih => + have hf := steps_four ih + have h1 : n * 2 ^ k * 2 = n * 2 ^ (k + 1) := by rw [pow2_succ]; ring + have h2 : x * 4 ^ k * 4 = x * 4 ^ (k + 1) := by rw [pow4_succ]; ring + have h3 : y * 4 ^ k * 4 = y * 4 ^ (k + 1) := by rw [pow4_succ]; ring + rw [h1, h2, h3] at hf + exact hf + +inductive Field : Nat → Nat → Nat → Nat → Prop where + | nil (w : Nat) : Field 0 0 w w + | zero {k z w x : Nat} : Field k z w x → Field (1 + k) (z * 2) w (x * 4) + | one {k z w x : Nat} : Field k z w x → Field (1 + k) (1 + z * 2) w (1 + x * 4) + +theorem field_bound {k z w x : Nat} (h : Field k z w x) : z < 2 ^ k := by + induction h with + | nil w => decide + | @zero k' z' w' x' _ ih => + rw [pow2_one_add]; omega + | @one k' z' w' x' _ ih => + rw [pow2_one_add]; omega + +theorem field_zeros (k w : Nat) : Field k 0 w (w * 4 ^ k) := by + induction k with + | zero => + simpa only [Nat.pow_zero, Nat.mul_one] using Field.nil w + | succ k ih => + have hz := Field.zero ih + have h1 : 1 + k = k + 1 := by omega + have h2 : w * 4 ^ k * 4 = w * 4 ^ (k + 1) := by rw [pow4_succ]; ring + rw [h1, Nat.zero_mul, h2] at hz + exact hz + +theorem field_exists (k z w : Nat) (hz : z < 2 ^ k) : ∃ x, Field k z w x := by + induction k generalizing z with + | zero => + have hz0 : z = 0 := by change z < 1 at hz; omega + subst hz0 + exact ⟨w, Field.nil w⟩ + | succ k ih => + rw [pow2_succ] at hz + rcases (by omega : z = (z / 2) * 2 ∨ z = 1 + (z / 2) * 2) with hpar | hpar + · obtain ⟨x, hx⟩ := ih (z / 2) (by omega) + refine ⟨x * 4, ?_⟩ + have h1 : k + 1 = 1 + k := by omega + rw [h1, hpar] + exact Field.zero hx + · obtain ⟨x, hx⟩ := ih (z / 2) (by omega) + refine ⟨1 + x * 4, ?_⟩ + have h1 : k + 1 = 1 + k := by omega + rw [h1, hpar] + exact Field.one hx + +theorem field_unique_aux {k1 zv1 w1 x : Nat} (h1 : Field k1 zv1 w1 x) : + ∀ {k2 zv2 y : Nat}, Field k2 zv2 w1 y → k1 = k2 → zv1 = zv2 → x = y := by + induction h1 with + | nil w => + intro k2 zv2 y h2 hk hz + cases h2 with + | nil => rfl + | zero => omega + | one => omega + | @zero k1' zv1' w1' x1' _ ih => + intro k2 zv2 y h2 hk hz + cases h2 with + | nil => omega + | @zero k2' zv2' _ y' h2' => + rw [ih h2' (by omega) (by omega)] + | one => omega + | @one k1' zv1' w1' x1' _ ih => + intro k2 zv2 y h2 hk hz + cases h2 with + | nil => omega + | zero => omega + | @one k2' zv2' _ y' h2' => + rw [ih h2' (by omega) (by omega)] + +theorem field_unique {k z w x y : Nat} (h1 : Field k z w x) (h2 : Field k z w y) : x = y := + field_unique_aux h1 h2 rfl rfl + +theorem field_compose {k z w x j v y : Nat} + (h1 : Field k z w x) (h2 : Field j v x y) : + Field (k + j) (z * 2 ^ j + v) w y := by + induction h2 with + | nil x0 => + simpa only [Nat.add_zero, Nat.pow_zero, Nat.mul_one] using h1 + | @zero j' v' x' y' _ ih => + have hz := Field.zero (ih h1) + have h1_eq : 1 + (k + j') = k + (1 + j') := by omega + have h2_eq : (z * 2 ^ j' + v') * 2 = z * 2 ^ (1 + j') + v' * 2 := by + rw [pow2_one_add]; ring + rw [h1_eq, h2_eq] at hz + exact hz + | @one j' v' x' y' _ ih => + have ho := Field.one (ih h1) + have h1_eq : 1 + (k + j') = k + (1 + j') := by omega + have h2_eq : 1 + (z * 2 ^ j' + v') * 2 = z * 2 ^ (1 + j') + (1 + v' * 2) := by + rw [pow2_one_add]; ring + rw [h1_eq, h2_eq] at ho + exact ho + +theorem field_fill {k z w x : Nat} (h : Field k z w x) : Steps z (w * 4 ^ k) x := by + induction h with + | nil w => + simpa only [Nat.pow_zero, Nat.mul_one] using Steps.zero w + | @zero k' z' w' x' _ ih => + have hf := steps_four ih + have h1 : w' * 4 ^ k' * 4 = w' * 4 ^ (1 + k') := by rw [pow4_one_add]; ring + rw [h1] at hf + exact hf + | @one k' z' w' x' _ ih => + have hf := steps_trans (steps_four ih) (steps_one (H_zero4 x')) + have h1 : z' * 2 + 1 = 1 + z' * 2 := by omega + have h2 : w' * 4 ^ k' * 4 = w' * 4 ^ (1 + k') := by rw [pow4_one_add]; ring + rw [h1, h2] at hf + exact hf + +theorem field_inc {k z w x : Nat} (h : Field k z w x) (hb : 1 + z < 2 ^ k) : + ∃ y, Field k (1 + z) w y ∧ H x y := by + induction h with + | nil w => + change 1 + 0 < 1 at hb; omega + | @zero k' z' w' x' h' _ => + exact ⟨1 + x' * 4, Field.one h', H_zero4 x'⟩ + | @one k' z' w' x' h' ih => + rw [pow2_one_add] at hb + obtain ⟨y, hy, hh⟩ := ih (by omega) + refine ⟨y * 4, ?_, H_four hh⟩ + have hf := Field.zero hy + have heq : (1 + z') * 2 = 1 + (1 + z' * 2) := by omega + rw [heq] at hf + exact hf + +theorem field_carry {k z w x y : Nat} (h : Field k z w x) (hb : 1 + z = 2 ^ k) (hw : H w y) : + H x (y * 4 ^ k) := by + induction h with + | nil w => + simpa only [Nat.pow_zero, Nat.mul_one] using hw + | @zero k' z' w' x' _ _ => + rw [pow2_one_add] at hb; omega + | @one k' z' w' x' _ ih => + rw [pow2_one_add] at hb + have hh := H_four (ih (by omega) hw) + have heq : y * 4 ^ k' * 4 = y * 4 ^ (1 + k') := by rw [pow4_one_add]; ring + rw [heq] at hh + exact hh + +theorem field_inv_zero {k1 z w x : Nat} (hf : Field k1 z w x) (hk : k1 = 0) : z = 0 ∧ x = w := by + cases hf with + | nil => exact ⟨rfl, rfl⟩ + | zero => omega + | one => omega + +theorem field_inv_succ {k1 z w x : Nat} (hf : Field k1 z w x) (k : Nat) (hk : k1 = k + 1) : + (∃ zv0 x0, z = zv0 * 2 ∧ x = x0 * 4 ∧ Field k zv0 w x0) ∨ + (∃ zv0 x0, z = 1 + zv0 * 2 ∧ x = 1 + x0 * 4 ∧ Field k zv0 w x0) := by + cases hf with + | nil => omega + | @zero k0 zv0 _ x0 hf0 => + have hk0 : k0 = k := by omega + subst hk0 + exact Or.inl ⟨zv0, x0, rfl, rfl, hf0⟩ + | @one k0 zv0 _ x0 hf0 => + have hk0 : k0 = k := by omega + subst hk0 + exact Or.inr ⟨zv0, x0, rfl, rfl, hf0⟩ + +theorem normalize (k : Nat) : ∀ {z w x y : Nat}, + Field k z w x → 0 < z → H w y → Steps ((2 ^ k - z) * 2) (x * 2) (y * 2 * 4 ^ k) := by + induction k with + | zero => + intro z w x y hf hz _ + obtain ⟨rfl, _⟩ := field_inv_zero hf rfl + omega + | succ k ih => + intro z w x y hf hz hw + rcases field_inv_succ hf k rfl with ⟨zv0, x0, rfl, rfl, hf0⟩ | ⟨zv0, x0, rfl, rfl, hf0⟩ + · have hs := steps_four (ih hf0 (by omega) hw) + have h1 : (2 ^ (k + 1) - zv0 * 2) * 2 = (2 ^ k - zv0) * 2 * 2 := by + have hb0 := field_bound hf0 + rw [pow2_succ]; omega + have h2 : x0 * 4 * 2 = x0 * 2 * 4 := by omega + have h3 : y * 2 * 4 ^ (k + 1) = y * 2 * 4 ^ k * 4 := by rw [pow4_succ]; ring + rw [h1, h2, h3] + exact hs + · have hb0 := field_bound hf0 + rcases (by omega : 1 + zv0 = 2 ^ k ∨ 1 + zv0 ≠ 2 ^ k) with he | he + · have hp := pair_two (field_carry hf0 he hw) + have h1 : (2 ^ (k + 1) - (1 + zv0 * 2)) * 2 = 2 := by rw [pow2_succ]; omega + have h2 : (1 + x0 * 4) * 2 = 2 + x0 * 8 := by omega + have h3 : y * 2 * 4 ^ (k + 1) = y * 4 ^ k * 2 * 4 := by rw [pow4_succ]; ring + rw [h1, h2, h3] + exact hp + · obtain ⟨u, hu, hhu⟩ := field_inc hf0 (by omega) + have hp := steps_trans (pair_two hhu) (steps_four (ih hu (by omega) hw)) + have h1 : (2 ^ (k + 1) - (1 + zv0 * 2)) * 2 = 2 + (2 ^ k - (1 + zv0)) * 2 * 2 := by + rw [pow2_succ]; omega + have h2 : (1 + x0 * 4) * 2 = 2 + x0 * 8 := by omega + have h3 : y * 2 * 4 ^ (k + 1) = y * 2 * 4 ^ k * 4 := by rw [pow4_succ]; ring + rw [h1, h2, h3] + exact hp + +theorem packed_positive {k z w x y n q r y' : Nat} + (hf : Field k z w x) (hz : 0 < z) (hw : H w y) (hq : Steps q (y * 2) y') + (hn : n = (2 ^ k - z) * 2 + q * 2 ^ k + r) (hr : r < 2 ^ k) : + ∃ x', Field k r y' x' ∧ Steps n (x * 2) x' := by + obtain ⟨x', hfx'⟩ := field_exists k r y' hr + refine ⟨x', hfx', ?_⟩ + subst hn + exact steps_trans (steps_trans (normalize k hf hz hw) (steps_zeros k hq)) (field_fill hfx') + +theorem packed_short {w k z x a h : Nat} + (hf : Field k z w x) (hz : 0 < z) (hw : H w h) + (hb : 2 * 2 ^ k ≤ a + z * 2) (hc : a + z * 2 < 4 * 2 ^ k) : + ∃ q r u, q ≤ 1 ∧ r < 2 ^ k ∧ a + z * 2 = (2 + q) * 2 ^ k + r ∧ + Field k r (h * 2 + q) u ∧ Steps a (x * 2) u := by + have hzb := field_bound hf + rcases (by omega : 3 * 2 ^ k ≤ a + z * 2 ∨ ¬ (3 * 2 ^ k ≤ a + z * 2)) with hle | hle + · obtain ⟨u, hfu, hsu⟩ := packed_positive hf hz hw (steps_one (H.even h)) + (n := a) (q := 1) (r := a + z * 2 - 3 * 2 ^ k) (by omega) (by omega) + refine ⟨1, a + z * 2 - 3 * 2 ^ k, u, by omega, by omega, by omega, ?_, hsu⟩ + have heq : 1 + h * 2 = h * 2 + 1 := by omega + rw [heq] at hfu + exact hfu + · obtain ⟨u, hfu, hsu⟩ := packed_positive hf hz hw (Steps.zero (h * 2)) + (n := a) (q := 0) (r := a + z * 2 - 2 * 2 ^ k) (by omega) (by omega) + refine ⟨0, a + z * 2 - 2 * 2 ^ k, u, by omega, by omega, by omega, ?_, hsu⟩ + simpa only [Nat.add_zero] using hfu + +theorem field_low {k z w x : Nat} (hf : Field k z w x) (hz : 0 < z) : + ∃ t j v y, k = t + 1 + j ∧ z = (1 + v * 2) * 2 ^ t ∧ x = (1 + y * 4) * 4 ^ t ∧ Field j v w y := + by + induction hf with + | nil w => omega + | @zero k' z' w' x' hf' ih => + obtain ⟨t, j, v, y, hk, hze, hxe, hfj⟩ := ih (by omega) + refine ⟨1 + t, j, v, y, by omega, ?_, ?_, hfj⟩ + · rw [hze, pow2_one_add]; ring + · rw [hxe, pow4_one_add]; ring + | @one k' z' w' x' hf' _ => + exact ⟨0, k', z', x', by omega, by simp, by simp, hf'⟩ + +inductive Normal : Bool → Nat → Nat → Prop where + | D : Normal false 0 0 + | E2 : Normal true 2 2 + | E3 : Normal true 3 3 + | zero {e : Bool} {n x : Nat} : Normal e n x → Normal e (n * 2) (x * 4) + | one {e : Bool} {n x : Nat} : Normal e n x → Normal e (1 + n * 2) (1 + x * 4) + +theorem normal_step {e : Bool} {n x : Nat} (hn : Normal e n x) : + ∃ y, Normal e (1 + n) y ∧ H x y := by + induction hn with + | D => exact ⟨1, Normal.one Normal.D, H.even 0⟩ + | E2 => exact ⟨3, Normal.E3, H.even 1⟩ + | E3 => + refine ⟨8, Normal.zero Normal.E2, ?_⟩ + simpa using H_eight (H.even 0) + | @zero e' n' x' hn' _ => + exact ⟨1 + x' * 4, Normal.one hn', H_zero4 x'⟩ + | @one e' n' x' _ ih => + obtain ⟨y, hny, hhy⟩ := ih + refine ⟨y * 4, ?_, H_four hhy⟩ + have hz := Normal.zero hny + have heq : (1 + n') * 2 = 1 + (1 + n' * 2) := by omega + rw [heq] at hz + exact hz + +theorem normal_steps {e : Bool} {n x : Nat} (a : Nat) (hn : Normal e n x) : + ∃ y, Normal e (n + a) y ∧ Steps a x y := by + induction a generalizing n x with + | zero => + exact ⟨x, hn, Steps.zero x⟩ + | succ a ih => + obtain ⟨y, hny, hhy⟩ := normal_step hn + obtain ⟨z, hnz, hsz⟩ := ih hny + refine ⟨z, ?_, ?_⟩ + · have heq : 1 + n + a = n + (a + 1) := by omega + rw [heq] at hnz + exact hnz + · have heq : 1 + a = a + 1 := by omega + rw [← heq] + exact Steps.next hhy hsz + +theorem field_normal {k z w x : Nat} (hf : Field k z w x) {e : Bool} {n : Nat} + (hn : Normal e n w) : Normal e (n * 2 ^ k + z) x := by + induction hf with + | nil w => + simpa only [Nat.pow_zero, Nat.mul_one, Nat.add_zero] using hn + | @zero k' z' w' x' _ ih => + have hz := Normal.zero (ih hn) + have heq : (n * 2 ^ k' + z') * 2 = n * 2 ^ (1 + k') + z' * 2 := by + rw [pow2_one_add]; ring + rw [heq] at hz + exact hz + | @one k' z' w' x' _ ih => + have ho := Normal.one (ih hn) + have heq : 1 + (n * 2 ^ k' + z') * 2 = n * 2 ^ (1 + k') + (1 + z' * 2) := by + rw [pow2_one_add]; ring + rw [heq] at ho + exact ho + +theorem packed_normal {k z w x y j u : Nat} {e : Bool} {v a : Nat} + (hf : Field k z w x) (hz : 0 < z) (hw : H w y) (hj : Steps j (y * 2) u) + (hn : Normal e v u) (hb : (2 ^ k - z) * 2 + j * 2 ^ k ≤ a) : + ∃ x', Normal e (v * 2 ^ k + (a - ((2 ^ k - z) * 2 + j * 2 ^ k))) x' ∧ Steps a (x * 2) x' := by + obtain ⟨x', hnx', hsx'⟩ := normal_steps (a - ((2 ^ k - z) * 2 + j * 2 ^ k)) + (field_normal (field_zeros k u) hn) + refine ⟨x', ?_, ?_⟩ + · simpa only [Nat.add_zero] using hnx' + · have htr := steps_trans (steps_trans (normalize k hf hz hw) (steps_zeros k hj)) hsx' + have heq : (2 ^ k - z) * 2 + j * 2 ^ k + (a - ((2 ^ k - z) * 2 + j * 2 ^ k)) = a := by omega + rw [heq] at htr + exact htr + +theorem packed_zero {k w j u : Nat} {e : Bool} {v a : Nat} + (hj : Steps j (w * 2) u) (hn : Normal e v u) (hb : j * 2 ^ k ≤ a) : + ∃ x', Normal e (v * 2 ^ k + (a - j * 2 ^ k)) x' ∧ Steps a (w * 4 ^ k * 2) x' := by + obtain ⟨x', hnx', hsx'⟩ := normal_steps (a - j * 2 ^ k) (field_normal (field_zeros k u) hn) + refine ⟨x', ?_, ?_⟩ + · simpa only [Nat.add_zero] using hnx' + · have htr := steps_trans (steps_zeros k hj) hsx' + have h1 : j * 2 ^ k + (a - j * 2 ^ k) = a := by omega + have h2 : w * 2 * 4 ^ k = w * 4 ^ k * 2 := by ring + rw [h1, h2] at htr + exact htr + +theorem packed_zero_affine {k w j u : Nat} {e : Bool} {v a : Nat} + (hj : Steps j (w * 2) u) (hn : Normal e (v + j) u) (hb : j * 2 ^ k ≤ a) : + ∃ x', Normal e (a + v * 2 ^ k) x' ∧ Steps a (w * 4 ^ k * 2) x' := by + obtain ⟨x', hnx', hsx'⟩ := packed_zero hj hn hb + refine ⟨x', ?_, hsx'⟩ + have heq : (v + j) * 2 ^ k + (a - j * 2 ^ k) = a + v * 2 ^ k := by + have : (v + j) * 2 ^ k = v * 2 ^ k + j * 2 ^ k := by ring + omega + rw [heq] at hnx' + exact hnx' + +theorem packed_positive_affine {k z w x y j u : Nat} {e : Bool} {v a : Nat} + (hf : Field k z w x) (hz : 0 < z) (hw : H w y) (hj : Steps j (y * 2) u) + (hn : Normal e (v + j + 2) u) (hb : (j + 2) * 2 ^ k ≤ a + z * 2) : + ∃ x', Normal e (a + z * 2 + v * 2 ^ k) x' ∧ Steps a (x * 2) x' := by + have hzb := field_bound hf + have h1 : (j + 2) * 2 ^ k = j * 2 ^ k + 2 ^ k * 2 := by ring + obtain ⟨x', hnx', hsx'⟩ := packed_normal hf hz hw hj hn (a := a) (by omega) + refine ⟨x', ?_, hsx'⟩ + have heq : (v + j + 2) * 2 ^ k + (a - ((2 ^ k - z) * 2 + j * 2 ^ k)) = a + z * 2 + v * 2 ^ k := by + have : (v + j + 2) * 2 ^ k = v * 2 ^ k + j * 2 ^ k + 2 ^ k * 2 := by ring + omega + rw [heq] at hnx' + exact hnx' + +theorem normal_zero_value_aux {e : Bool} {m x : Nat} (hn : Normal e m x) (hm : m = 0) : e = false ∧ + x = 0 := by + induction hn with + | D => exact ⟨rfl, rfl⟩ + | E2 => omega + | E3 => omega + | @zero e' n' x' _ ih => + obtain ⟨he, hx⟩ := ih (by omega) + exact ⟨he, by omega⟩ + | one => omega + +theorem normal_zero_value {e : Bool} {x : Nat} (hn : Normal e 0 x) : e = false ∧ x = 0 := + normal_zero_value_aux hn rfl + +theorem normal_top {e : Bool} {n x : Nat} (hn : Normal e n x) (hp : 0 < n) : + ∃ k z w, Field k z w x ∧ n = w * 2 ^ k + z ∧ + ((e = false ∧ w = 1) ∨ (e = true ∧ (w = 2 ∨ w = 3))) := by + induction hn with + | D => omega + | E2 => exact ⟨0, 0, 2, Field.nil 2, by simp, Or.inr ⟨rfl, Or.inl rfl⟩⟩ + | E3 => exact ⟨0, 0, 3, Field.nil 3, by simp, Or.inr ⟨rfl, Or.inr rfl⟩⟩ + | @zero e' n' x' _ ih => + obtain ⟨k, z, w, hf, hne, htop⟩ := ih (by omega) + refine ⟨1 + k, z * 2, w, Field.zero hf, ?_, htop⟩ + rw [hne, pow2_one_add]; ring + | @one e' n' x' hn' ih => + rcases (by omega : n' = 0 ∨ n' ≠ 0) with hn0 | hn0 + · subst hn0 + obtain ⟨he, hx⟩ := normal_zero_value hn' + subst he hx + exact ⟨0, 0, 1, Field.nil 1, by simp, Or.inl ⟨rfl, rfl⟩⟩ + · obtain ⟨k, z, w, hf, hne, htop⟩ := ih (by omega) + refine ⟨1 + k, 1 + z * 2, w, Field.one hf, ?_, htop⟩ + rw [hne, pow2_one_add]; ring + +inductive View : Bool → Nat → Nat → Prop where + | low {e : Bool} (v x t : Nat) : Normal e v x → View e ((1 + v * 2) * 2 ^ t) ((1 + x * 4) * 4 ^ t) + | two (t : Nat) : View true (2 * 2 ^ t) (2 * 4 ^ t) + | three (t : Nat) : View true (3 * 2 ^ t) (3 * 4 ^ t) + +theorem normal_view {e : Bool} {n x : Nat} (hn : Normal e n x) (hp : 0 < n) : View e n x := by + induction hn with + | D => omega + | E2 => simpa using View.two 0 + | E3 => simpa using View.three 0 + | @zero e' n' x' _ ih => + rcases ih (by omega) with ⟨v0, x0, t, hnv⟩ | ⟨t⟩ | ⟨t⟩ + · have hv := View.low v0 x0 (1 + t) hnv + have h1 : (1 + v0 * 2) * 2 ^ (1 + t) = (1 + v0 * 2) * 2 ^ t * 2 := by rw [pow2_one_add]; ring + have h2 : (1 + x0 * 4) * 4 ^ (1 + t) = (1 + x0 * 4) * 4 ^ t * 4 := by rw [pow4_one_add]; ring + rw [h1, h2] at hv + exact hv + · have hv := View.two (1 + t) + have h1 : 2 * 2 ^ (1 + t) = 2 * 2 ^ t * 2 := by rw [pow2_one_add]; ring + have h2 : 2 * 4 ^ (1 + t) = 2 * 4 ^ t * 4 := by rw [pow4_one_add]; ring + rw [h1, h2] at hv + exact hv + · have hv := View.three (1 + t) + have h1 : 3 * 2 ^ (1 + t) = 3 * 2 ^ t * 2 := by rw [pow2_one_add]; ring + have h2 : 3 * 4 ^ (1 + t) = 3 * 4 ^ t * 4 := by rw [pow4_one_add]; ring + rw [h1, h2] at hv + exact hv + | @one e' n' x' hn' _ => + simpa using View.low n' x' 0 hn' + +inductive Return : Nat → Nat → Nat → Nat → Nat → Prop where + | odd (t : Nat) {x y : Nat} (a : Nat) : H x y → Return ((1 + x * 2) * 4 ^ t) a y (a + t) 0 + | power (t a : Nat) : Return (2 * 4 ^ t) a 1 1 (a + t) + +theorem field_return {k z w x : Nat} (a : Nat) (hf : Field k z w x) (hz : 0 < z) : + ∃ t j v y, Field j v w y ∧ k = t + 1 + j ∧ z = (1 + v * 2) * 2 ^ t ∧ + Return x a (1 + y * 2) (a + t) 0 := by + obtain ⟨t, j, v, y, hk, hze, hxe, hfj⟩ := field_low hf hz + refine ⟨t, j, v, y, hfj, hk, hze, ?_⟩ + subst hxe + have hr := Return.odd t a (H.even y) + have heq : (1 + y * 2 * 2) * 4 ^ t = (1 + y * 4) * 4 ^ t := by ring + rw [heq] at hr + exact hr + +def Round (x a b y a' b' : Nat) : Prop := + ∃ u, Steps (a - 1) x u ∧ Return u (a + b + 1) y a' b' + +def Budget (a v : Nat) : Prop := + v < a ∧ (a % 2 = 1 → v * 2 < a) + +inductive Safe : Nat → Nat → Nat → Prop where + | main {e : Bool} {v x a : Nat} : Normal e v x → Budget a v → Safe (1 + x * 2) a 0 + | high {w k z x a : Nat} : (w = 6 ∨ + w = 7) → Field k z w x → Budget a (w * 2 ^ k + z) → Safe (1 + x * 2) a 0 + | raw {x a : Nat} : (x = 4 ∨ x = 8 ∨ x = 16) → 0 < a → Safe x a 0 + | weak {e : Bool} {v x : Nat} : Normal e v x → 0 < v → Safe (1 + x * 2) (v * 2 - 1) 0 + | near {w k z x a : Nat} : (w = 10 ∨ + w = 11) → Field k z w x → 8 * 2 ^ k ≤ a → Safe (1 + x * 2) a 0 + | reset {a b : Nat} : 0 < a → 0 < b → Safe 1 a b + +theorem budget_strong {a v : Nat} (h : v * 2 < a) : Budget a v := + ⟨by omega, fun _ => h⟩ + +theorem safe_positive {x a b : Nat} (hs : Safe x a b) : 0 < a := by + cases hs with + | main _ hb => exact Nat.lt_of_le_of_lt (Nat.zero_le _) hb.1 + | high _ _ hb => exact Nat.lt_of_le_of_lt (Nat.zero_le _) hb.1 + | raw _ ha => exact ha + | weak _ hv => omega + | @near w k _ _ _ _ _ ha => + have hp := pow2_pos k + omega + | reset ha _ => exact ha + +theorem budget_return {a n t v : Nat} (hn : n = (1 + v * 2) * 2 ^ t) + (hcases : (a % 2 = 1 ∧ n % 2 = 1 ∧ n ≤ a * 2 + 1) ∨ + (a % 2 = 0 ∧ n % 2 = 0 ∧ n ≤ a * 3 - 2)) : + Budget (a + 1 + t) v := by + subst hn + rcases hcases with ⟨ha, hn_odd, hle⟩ | ⟨ha, hn_even, hle⟩ + · cases t with + | zero => + simp only [Nat.pow_zero, Nat.mul_one] at hle ⊢ + exact ⟨by omega, fun _ => by omega⟩ + | succ t => + have hmul : (1 + v * 2) * 2 ^ (t + 1) = ((1 + v * 2) * 2 ^ t) * 2 := by + rw [pow2_succ]; ring + rw [hmul] at hn_odd + omega + · rcases t with _ | _ | t + · simp only [Nat.pow_zero, Nat.mul_one] at hn_even + omega + · change (1 + v * 2) * 2 ≤ a * 3 - 2 at hle + exact ⟨by omega, fun hodd => by omega⟩ + · have hp : 0 < 2 ^ t := pow2_pos t + have hpow : (1 + v * 2) * 2 ^ (t + 2) = (1 + v * 2) * 4 * 2 ^ t := by + rw [pow2_succ, pow2_succ]; ring + have hge : (1 + v * 2) * 4 * 1 ≤ (1 + v * 2) * 4 * 2 ^ t := + Nat.mul_le_mul_left ((1 + v * 2) * 4) hp + rw [hpow] at hle + exact ⟨by omega, fun _ => by omega⟩ + +theorem normal_return {e : Bool} {n x : Nat} (a : Nat) (hn : Normal e n x) (hp : 0 < n) + (hb : ∀ t v, n = (1 + v * 2) * 2 ^ t → Budget (a + 1 + t) v) : + ∃ y b c, Return x (a + 1) y b c ∧ Safe y b c := by + rcases normal_view hn hp with ⟨v0, u0, t, hnv⟩ | ⟨t⟩ | ⟨t⟩ + · refine ⟨1 + u0 * 2, a + 1 + t, 0, ?_, Safe.main hnv (hb t v0 rfl)⟩ + have hr := Return.odd t (a + 1) (H.even u0) + have heq : (1 + u0 * 2 * 2) * 4 ^ t = (1 + u0 * 4) * 4 ^ t := by ring + rw [heq] at hr + exact hr + · exact ⟨1, 1, a + 1 + t, Return.power t (a + 1), Safe.reset (by omega) (by omega)⟩ + · refine ⟨4, a + 1 + t, 0, ?_, Safe.raw (Or.inl rfl) (by omega)⟩ + have hr := Return.odd t (a + 1) (H_four (H.even 0)) + simpa using hr + +theorem normal_return_strong {e : Bool} {n x a : Nat} + (hn : Normal e n x) (hp : 0 < n) (hle : n ≤ a + 1) : + ∃ y b c, Return x (a + 1) y b c ∧ Safe y b c := by + refine normal_return a hn hp (fun t v heq => budget_strong ?_) + have hp2 : 0 < 2 ^ t := pow2_pos t + have hge : (1 + v * 2) * 1 ≤ (1 + v * 2) * 2 ^ t := Nat.mul_le_mul_left (1 + v * 2) hp2 + omega + +theorem reset_closed {a b : Nat} (ha : 0 < a) (hb : 0 < b) : + ∃ y a' b', Round 1 a b y a' b' ∧ Safe y a' b' := by + obtain ⟨u, hnu, hsu⟩ := normal_steps (a - 1) (Normal.one Normal.D) + obtain ⟨y, a', b', hr, hs⟩ := normal_return_strong (a := a + b) hnu (by omega) (by omega) + exact ⟨y, a', b', ⟨u, hsu, hr⟩, hs⟩ + +theorem normal_raw_return {e : Bool} {n x a : Nat} + (hn : Normal e n x) (he : n = a + 3) (ha : 0 < a) : + ∃ y b c, Return x (a + 1) y b c ∧ Safe y b c := by + rcases normal_view hn (by omega) with ⟨v0, u0, t, hnv⟩ | ⟨t⟩ | ⟨t⟩ + · refine ⟨1 + u0 * 2, a + 1 + t, 0, ?_, ?_⟩ + · have hr := Return.odd t (a + 1) (H.even u0) + have heq : (1 + u0 * 2 * 2) * 4 ^ t = (1 + u0 * 4) * 4 ^ t := by ring + rw [heq] at hr + exact hr + · cases t with + | zero => + simp only [Nat.pow_zero, Nat.mul_one] at he + have hw := Safe.weak hnv (by omega) + have heq : v0 * 2 - 1 = a + 1 + 0 := by omega + rw [heq] at hw + exact hw + | succ t => + rw [pow2_succ] at he + have hp2 : 0 < 2 ^ t := pow2_pos t + have hge : (1 + v0 * 2) * 1 ≤ (1 + v0 * 2) * 2 ^ t := Nat.mul_le_mul_left (1 + v0 * 2) hp2 + have hmul : (1 + v0 * 2) * (2 ^ t * 2) = ((1 + v0 * 2) * 2 ^ t) * 2 := by ring + rw [hmul] at he + refine Safe.main hnv (budget_strong ?_) + omega + · exact ⟨1, 1, a + 1 + t, Return.power t (a + 1), Safe.reset (by omega) (by omega)⟩ + · refine ⟨4, a + 1 + t, 0, ?_, Safe.raw (Or.inl rfl) (by omega)⟩ + have hr := Return.odd t (a + 1) (H_four (H.even 0)) + simpa using hr + +theorem raw_closed {x a : Nat} (hx : x = 4 ∨ x = 8 ∨ x = 16) (ha : 0 < a) : + ∃ y a' b', Round x a 0 y a' b' ∧ Safe y a' b' := by + rcases hx with rfl | rfl | rfl + · obtain ⟨u, hnu, hsu⟩ := normal_steps (a - 1) (Normal.zero (Normal.one Normal.D)) + obtain ⟨y, a', b', hr, hs⟩ := normal_return_strong (a := a) hnu (by omega) (by omega) + exact ⟨y, a', b', ⟨u, hsu, hr⟩, hs⟩ + · obtain ⟨u, hnu, hsu⟩ := normal_steps (a - 1) (Normal.zero Normal.E2) + obtain ⟨y, a', b', hr, hs⟩ := normal_raw_return (a := a) hnu (by omega) ha + exact ⟨y, a', b', ⟨u, hsu, hr⟩, hs⟩ + · obtain ⟨u, hnu, hsu⟩ := normal_steps (a - 1) (Normal.zero (Normal.zero (Normal.one Normal.D))) + obtain ⟨y, a', b', hr, hs⟩ := normal_raw_return (a := a) hnu (by omega) ha + exact ⟨y, a', b', ⟨u, hsu, hr⟩, hs⟩ + +theorem two22 : Steps 2 22 64 := by + refine Steps.next (H.even 11) (steps_one ?_) + simpa using H.carry 2 (H_four (H.even 0)) + +theorem two6 : Steps 2 6 16 := by + refine Steps.next (H.even 3) (steps_one ?_) + simpa using H.carry 2 (H.even 0) + +theorem two14 : Steps 2 14 32 := by + refine Steps.next (H.even 7) (steps_one ?_) + simpa using H.carry 3 (H.even 0) + +theorem weak_count {e : Bool} {v x : Nat} (hn : Normal e v x) (hv : 0 < v) : + ∃ n y, Normal (!e) n y ∧ Steps (v * 2 - 1) (x * 2) y ∧ + 0 < n ∧ n ≤ v * 4 - 1 ∧ n % 2 = 1 := by + obtain ⟨k, z, w, hf, hve, htop⟩ := normal_top hn hv + have hzb := field_bound hf + have hN2 : Normal false 2 4 := Normal.zero (Normal.one Normal.D) + have hN4 : Normal false 4 16 := Normal.zero hN2 + rcases htop with ⟨rfl, rfl⟩ | ⟨rfl, rfl | rfl⟩ + · rcases (by omega : z = 0 ∨ z ≠ 0) with hz | hz + · subst hz + rw [field_unique hf (field_zeros k 1)] + obtain ⟨y, hny, hsy⟩ := packed_zero_affine (k := k) (w := 1) (j := 0) (u := 2) + (e := true) (v := 2) (a := v * 2 - 1) (Steps.zero 2) Normal.E2 (by omega) + exact ⟨v * 2 - 1 + 2 * 2 ^ k, y, hny, hsy, by omega, by omega, by omega⟩ + · obtain ⟨y, hny, hsy⟩ := packed_positive_affine (k := k) (z := z) (w := 1) (x := x) + (y := 4) (j := 0) (u := 8) (e := true) (v := 2) (a := v * 2 - 1) + hf (by omega) (H_four (H.even 0)) (Steps.zero 8) (Normal.zero Normal.E2) (by omega) + exact ⟨v * 2 - 1 + z * 2 + 2 * 2 ^ k, y, hny, hsy, by omega, by omega, by omega⟩ + · rcases (by omega : z = 0 ∨ z ≠ 0) with hz | hz + · subst hz + rw [field_unique hf (field_zeros k 2)] + obtain ⟨y, hny, hsy⟩ := packed_zero_affine (k := k) (w := 2) (j := 0) (u := 4) + (e := false) (v := 2) (a := v * 2 - 1) (Steps.zero 4) hN2 (by omega) + exact ⟨v * 2 - 1 + 2 * 2 ^ k, y, hny, hsy, by omega, by omega, by omega⟩ + · obtain ⟨y, hny, hsy⟩ := packed_positive_affine (k := k) (z := z) (w := 2) (x := x) + (y := 3) (j := 2) (u := 16) (e := false) (v := 0) (a := v * 2 - 1) + hf (by omega) (H.even 1) two6 hN4 (by omega) + refine ⟨v * 2 - 1 + z * 2, y, ?_, hsy, by omega, by omega, by omega⟩ + change Normal false (v * 2 - 1 + z * 2) y + simpa only [Nat.zero_mul, Nat.add_zero] using hny + · rcases (by omega : z = 0 ∨ z ≠ 0) with hz | hz + · subst hz + rw [field_unique hf (field_zeros k 3)] + obtain ⟨y, hny, hsy⟩ := packed_zero_affine (k := k) (w := 3) (j := 2) (u := 16) + (e := false) (v := 2) (a := v * 2 - 1) two6 hN4 (by omega) + exact ⟨v * 2 - 1 + 2 * 2 ^ k, y, hny, hsy, by omega, by omega, by omega⟩ + · obtain ⟨y, hny, hsy⟩ := packed_positive_affine (k := k) (z := z) (w := 3) (x := x) + (y := 8) (j := 0) (u := 16) (e := false) (v := 2) (a := v * 2 - 1) + hf (by omega) (H_eight (H.even 0)) (Steps.zero 16) hN4 (by omega) + exact ⟨v * 2 - 1 + z * 2 + 2 * 2 ^ k, y, hny, hsy, by omega, by omega, by omega⟩ + +theorem weak_closed {e : Bool} {v x : Nat} (hn : Normal e v x) (hv : 0 < v) : + ∃ y a' b', Round (1 + x * 2) (v * 2 - 1) 0 y a' b' ∧ Safe y a' b' := by + obtain ⟨n, u, hnu, hsu, hnp, hnb, hno⟩ := weak_count hn hv + obtain ⟨y, a', b', hr, hs⟩ := normal_return (v * 2 - 1) hnu hnp (fun t w heq => + budget_return heq (Or.inl ⟨by omega, hno, by omega⟩)) + refine ⟨y, a', b', ⟨u, steps_drop_even (by omega) hsu, hr⟩, hs⟩ + +theorem normal_count_closed {v x a : Nat} {e : Bool} {n u : Nat} + (hb : Budget a v) (hn : Normal e n u) (hs : Steps a (x * 2) u) + (hp : 0 < n) (hu : n ≤ a + v * 2) (ho : n % 2 = a % 2) : + ∃ y a' b', Round (1 + x * 2) a 0 y a' b' ∧ Safe y a' b' := by + obtain ⟨hb1, hb2⟩ := hb + obtain ⟨y, a', b', hr, hsafe⟩ := normal_return a hn hp (fun t w heq => by + refine budget_return heq ?_ + rcases (by omega : a % 2 = 0 ∨ a % 2 = 1) with ha | ha1 + · exact Or.inr ⟨ha, by omega, by omega⟩ + · have hlt := hb2 ha1 + exact Or.inl ⟨ha1, by omega, by omega⟩) + exact ⟨y, a', b', ⟨u, steps_drop_even (by omega) hs, hr⟩, hsafe⟩ + +theorem main_regular_count {w k z x a : Nat} + (hw : w = 1 ∨ w = 2 ∨ w = 3 ∨ w = 6 ∨ w = 7) + (hf : Field k z w x) (hb : Budget a (w * 2 ^ k + z)) + (hp1 : w = 1 → 0 < z → 2 * 2 ^ k ≤ a + z * 2) + (hp2 : w = 2 → 0 < z → 4 * 2 ^ k ≤ a + z * 2) : + ∃ e n y, Normal e n y ∧ Steps a (x * 2) y ∧ + a ≤ n ∧ n ≤ a + (w * 2 ^ k + z) * 2 ∧ n % 2 = a % 2 := by + have hzb := field_bound hf + obtain ⟨hb1, hb2⟩ := hb + have hN2 : Normal false 2 4 := Normal.zero (Normal.one Normal.D) + have hN4 : Normal false 4 16 := Normal.zero hN2 + have hE4 : Normal true 4 8 := Normal.zero Normal.E2 + have hE6 : Normal true 6 12 := Normal.zero Normal.E3 + have hE8 : Normal true 8 32 := Normal.zero hE4 + rcases (by omega : z = 0 ∨ z ≠ 0) with hz | hz + · subst hz + rw [field_unique hf (field_zeros k w)] + rcases hw with rfl | rfl | rfl | rfl | rfl + · obtain ⟨y, hny, hsy⟩ := packed_zero_affine (k := k) (w := 1) (j := 0) (u := 2) + (e := true) (v := 2) (a := a) (Steps.zero 2) Normal.E2 (by omega) + exact ⟨true, a + 2 * 2 ^ k, y, hny, hsy, by omega, by omega, by omega⟩ + · obtain ⟨y, hny, hsy⟩ := packed_zero_affine (k := k) (w := 2) (j := 0) (u := 4) + (e := false) (v := 2) (a := a) (Steps.zero 4) hN2 (by omega) + exact ⟨false, a + 2 * 2 ^ k, y, hny, hsy, by omega, by omega, by omega⟩ + · obtain ⟨y, hny, hsy⟩ := packed_zero_affine (k := k) (w := 3) (j := 2) (u := 16) + (e := false) (v := 2) (a := a) two6 hN4 (by omega) + exact ⟨false, a + 2 * 2 ^ k, y, hny, hsy, by omega, by omega, by omega⟩ + · obtain ⟨y, hny, hsy⟩ := packed_zero_affine (k := k) (w := 6) (j := 0) (u := 12) + (e := true) (v := 6) (a := a) (Steps.zero 12) hE6 (by omega) + exact ⟨true, a + 6 * 2 ^ k, y, hny, hsy, by omega, by omega, by omega⟩ + · obtain ⟨y, hny, hsy⟩ := packed_zero_affine (k := k) (w := 7) (j := 2) (u := 32) + (e := true) (v := 6) (a := a) two14 hE8 (by omega) + exact ⟨true, a + 6 * 2 ^ k, y, hny, hsy, by omega, by omega, by omega⟩ + · rcases hw with rfl | rfl | rfl | rfl | rfl + · obtain ⟨y, hny, hsy⟩ := packed_positive_affine (k := k) (z := z) (w := 1) (x := x) + (y := 4) (j := 0) (u := 8) (e := true) (v := 2) (a := a) + hf (by omega) (H_four (H.even 0)) (Steps.zero 8) hE4 (hp1 rfl (by omega)) + exact ⟨true, a + z * 2 + 2 * 2 ^ k, y, hny, hsy, by omega, by omega, by omega⟩ + · obtain ⟨y, hny, hsy⟩ := packed_positive_affine (k := k) (z := z) (w := 2) (x := x) + (y := 3) (j := 2) (u := 16) (e := false) (v := 0) (a := a) + hf (by omega) (H.even 1) two6 hN4 (hp2 rfl (by omega)) + refine ⟨false, a + z * 2, y, ?_, hsy, by omega, by omega, by omega⟩ + simpa only [Nat.zero_mul, Nat.add_zero] using hny + · obtain ⟨y, hny, hsy⟩ := packed_positive_affine (k := k) (z := z) (w := 3) (x := x) + (y := 8) (j := 0) (u := 16) (e := false) (v := 2) (a := a) + hf (by omega) (H_eight (H.even 0)) (Steps.zero 16) hN4 (by omega) + exact ⟨false, a + z * 2 + 2 * 2 ^ k, y, hny, hsy, by omega, by omega, by omega⟩ + · obtain ⟨y, hny, hsy⟩ := packed_positive_affine (k := k) (z := z) (w := 6) (x := x) + (y := 7) (j := 2) (u := 32) (e := true) (v := 4) (a := a) + hf (by omega) (H.even 3) two14 hE8 (by omega) + exact ⟨true, a + z * 2 + 4 * 2 ^ k, y, hny, hsy, by omega, by omega, by omega⟩ + · have hj7 : H 7 16 := by simpa using H.carry 2 (H.even 0) + obtain ⟨y, hny, hsy⟩ := packed_positive_affine (k := k) (z := z) (w := 7) (x := x) + (y := 16) (j := 0) (u := 32) (e := true) (v := 6) (a := a) + hf (by omega) hj7 (Steps.zero 32) hE8 (by omega) + exact ⟨true, a + z * 2 + 6 * 2 ^ k, y, hny, hsy, by omega, by omega, by omega⟩ + +theorem main_regular_closed {w k z x a : Nat} + (hw : w = 1 ∨ w = 2 ∨ w = 3 ∨ w = 6 ∨ w = 7) + (hf : Field k z w x) (hb : Budget a (w * 2 ^ k + z)) + (hp1 : w = 1 → 0 < z → 2 * 2 ^ k ≤ a + z * 2) + (hp2 : w = 2 → 0 < z → 4 * 2 ^ k ≤ a + z * 2) : + ∃ y a' b', Round (1 + x * 2) a 0 y a' b' ∧ Safe y a' b' := by + obtain ⟨e, n, u, hnu, hsu, hle, hub, hmod⟩ := main_regular_count hw hf hb hp1 hp2 + have ha : 0 < a := Nat.lt_of_le_of_lt (Nat.zero_le _) hb.1 + exact normal_count_closed hb hnu hsu (by omega) hub hmod + +theorem high_return {w k z u a v : Nat} + (hw : w = 6 ∨ w = 7) (hf : Field k z w u) (hz : 0 < z) + (hb : Budget a v) (hu : w * 2 ^ k + z ≤ a + v * 2) (hp : (w * 2 ^ k + z) % 2 = a % 2) : + ∃ y b c, Return u (a + 1) y b c ∧ Safe y b c := by + obtain ⟨t, j, v', y, hfj, hk, hze, hr⟩ := field_return (a + 1) hf hz + refine ⟨1 + y * 2, a + 1 + t, 0, hr, Safe.high hw hfj ?_⟩ + obtain ⟨hb1, hb2⟩ := hb + refine budget_return (n := w * 2 ^ k + z) ?_ ?_ + · rw [hk, hze] + have : 2 ^ (t + 1 + j) = 2 ^ j * 2 * 2 ^ t := by + rw [Nat.add_assoc, Nat.pow_add, Nat.pow_add]; ring + rw [this]; ring + · rcases (by omega : a % 2 = 0 ∨ a % 2 = 1) with ha | ha1 + · exact Or.inr ⟨ha, by omega, by omega⟩ + · have hlt := hb2 ha1 + exact Or.inl ⟨ha1, by omega, by omega⟩ + +theorem main_short2 {k z x a : Nat} + (hf : Field k z 2 x) (hz : 0 < z) (hb : Budget a (2 * 2 ^ k + z)) + (hp : a + z * 2 < 4 * 2 ^ k) : + ∃ y a' b', Round (1 + x * 2) a 0 y a' b' ∧ Safe y a' b' := by + have hzb := field_bound hf + obtain ⟨hb1, hb2⟩ := hb + have ha_even : a % 2 = 0 := by + rcases (by omega : a % 2 = 1 ∨ a % 2 = 0) with ha1 | ha0 + · have := hb2 ha1; omega + · exact ha0 + obtain ⟨q, r, u, hq, hr, he, hfu, hsu⟩ := packed_short hf hz (H.even 1) (by omega) hp + have hv : (6 + q) * 2 ^ k + r = a + (2 * 2 ^ k + z) * 2 := by + have : (2 + q) * 2 ^ k = 2 * 2 ^ k + q * 2 ^ k := by ring + have : (6 + q) * 2 ^ k = 6 * 2 ^ k + q * 2 ^ k := by ring + omega + have hw : 6 + q = 6 ∨ 6 + q = 7 := by omega + rcases (by omega : r = 0 ∨ r ≠ 0) with hr0 | hr0 + · subst hr0 + have hq1 : q = 1 := by + rcases (by omega : q = 0 ∨ q = 1) with rfl | rfl + · exfalso; omega + · rfl + subst hq1 + rw [field_unique hfu (field_zeros k 7)] at hsu + refine ⟨8, a + 1 + k, 0, ⟨7 * 4 ^ k, steps_drop_even (by omega) hsu, ?_⟩, + Safe.raw (Or.inr (Or.inl rfl)) (by omega)⟩ + have hret := Return.odd k (a + 1) (H_eight (H.even 0)) + simpa using hret + · obtain ⟨y, a', b', hret, hsafe⟩ := high_return hw hfu (by omega) ⟨hb1, hb2⟩ + (by omega) (by omega) + exact ⟨y, a', b', ⟨u, steps_drop_even (by omega) hsu, hret⟩, hsafe⟩ + +theorem near_return {w k z u a : Nat} + (hw : w = 10 ∨ w = 11) (hf : Field k z w u) (hz : 0 < z) + (hp : z % 2 = 0) (hb : 2 * 2 ^ k < a) : + ∃ y b c, Return u (a + 1) y b c ∧ Safe y b c := by + obtain ⟨t, j, v, y, hfj, hk, hze, hr⟩ := field_return (a + 1) hf hz + refine ⟨1 + y * 2, a + 1 + t, 0, hr, Safe.near hw hfj ?_⟩ + cases t with + | zero => + simp only [Nat.pow_zero, Nat.mul_one] at hze + omega + | succ t => + have hpow : 2 ^ k = 2 ^ t * (4 * 2 ^ j) := by + rw [hk, Nat.add_assoc, Nat.pow_add, Nat.pow_add, pow2_succ]; ring + have hp2 : 0 < 2 ^ t := pow2_pos t + have hge : 1 * (4 * 2 ^ j) ≤ 2 ^ t * (4 * 2 ^ j) := Nat.mul_le_mul_right (4 * 2 ^ j) hp2 + rw [hpow] at hb + omega + +theorem main_short1 {k z x a : Nat} + (hf : Field k z 1 x) (hz : 0 < z) (hb : Budget a (2 ^ k + z)) + (hp : a + z * 2 < 2 * 2 ^ k) : + ∃ y a' b', Round (1 + x * 2) a 0 y a' b' ∧ Safe y a' b' := by + have hzb := field_bound hf + obtain ⟨hb1, hb2⟩ := hb + have ha_even : a % 2 = 0 := by + rcases (by omega : a % 2 = 1 ∨ a % 2 = 0) with ha1 | ha0 + · have := hb2 ha1; omega + · exact ha0 + cases k with + | zero => + change z < 1 at hzb; omega + | succ k => + rw [pow2_succ] at hb1 hb2 hp hzb + obtain ⟨x', hfx'⟩ := field_exists k z 4 (by omega) + have hxx' : x = x' := by + refine field_unique hf ?_ + have hc := field_compose (Field.zero (Field.nil 1)) hfx' + have h1 : 1 + 0 + k = k + 1 := by omega + have h2 : 0 * 2 * 2 ^ k + z = z := by ring + rw [h1, h2] at hc + exact hc + subst hxx' + obtain ⟨q, r, u, hq, hr, he, hfu, hsu⟩ := packed_short hfx' hz (H.even 2) (a := a) + (by omega) (by omega) + have hw : 10 + q = 10 ∨ 10 + q = 11 := by omega + rcases (by omega : r = 0 ∨ r ≠ 0) with hr0 | hr0 + · subst hr0 + have hq1 : q = 1 := by + rcases (by omega : q = 0 ∨ q = 1) with rfl | rfl + · exfalso; omega + · rfl + subst hq1 + rw [field_unique hfu (field_zeros k 11)] at hsu + refine ⟨16, a + 1 + k, 0, ⟨11 * 4 ^ k, steps_drop_even (by omega) hsu, ?_⟩, + Safe.raw (Or.inr (Or.inr rfl)) (by omega)⟩ + have hret := Return.odd k (a + 1) (H_four (H_four (H.even 0))) + simpa using hret + · have hr_even : r % 2 = 0 := by + cases k with + | zero => change r < 1 at hr; omega + | succ k' => + have hmul : (2 + q) * 2 ^ (k' + 1) = ((2 + q) * 2 ^ k') * 2 := by + rw [pow2_succ]; ring + rw [hmul] at he + omega + have ha_gt : 2 * 2 ^ k < a := by + have hmul : (2 + q) * 2 ^ k = 2 * 2 ^ k + q * 2 ^ k := by ring + omega + obtain ⟨y, a', b', hret, hsafe⟩ := near_return hw hfu (by omega) hr_even ha_gt + exact ⟨y, a', b', ⟨u, steps_drop_even (by omega) hsu, hret⟩, hsafe⟩ + +theorem near_count {w k z x a : Nat} + (hw : w = 10 ∨ w = 11) (hf : Field k z w x) (hb : 8 * 2 ^ k ≤ a) : + ∃ n y, Normal false n y ∧ Steps a (x * 2) y ∧ + a ≤ n ∧ n < a + 8 * 2 ^ k ∧ n % 2 = a % 2 := by + have hzb := field_bound hf + have hN8 : Normal false 8 64 := Normal.zero (Normal.zero (Normal.zero (Normal.one Normal.D))) + have hN6 : Normal false 6 20 := Normal.zero (Normal.one (Normal.one Normal.D)) + rcases (by omega : z = 0 ∨ z ≠ 0) with hz | hz + · subst hz + rw [field_unique hf (field_zeros k w)] + rcases hw with rfl | rfl + · obtain ⟨y, hny, hsy⟩ := packed_zero_affine (k := k) (w := 10) (j := 0) (u := 20) + (e := false) (v := 6) (a := a) (Steps.zero 20) hN6 (by omega) + exact ⟨a + 6 * 2 ^ k, y, hny, hsy, by omega, by omega, by omega⟩ + · obtain ⟨y, hny, hsy⟩ := packed_zero_affine (k := k) (w := 11) (j := 2) (u := 64) + (e := false) (v := 6) (a := a) two22 hN8 (by omega) + exact ⟨a + 6 * 2 ^ k, y, hny, hsy, by omega, by omega, by omega⟩ + · rcases hw with rfl | rfl + · obtain ⟨y, hny, hsy⟩ := packed_positive_affine (k := k) (z := z) (w := 10) (x := x) + (y := 11) (j := 2) (u := 64) (e := false) (v := 4) (a := a) + hf (by omega) (H.even 5) two22 hN8 (by omega) + exact ⟨a + z * 2 + 4 * 2 ^ k, y, hny, hsy, by omega, by omega, by omega⟩ + · have hj11 : H 11 32 := by simpa using H_eight (H_four (H.even 0)) + obtain ⟨y, hny, hsy⟩ := packed_positive_affine (k := k) (z := z) (w := 11) (x := x) + (y := 32) (j := 0) (u := 64) (e := false) (v := 6) (a := a) + hf (by omega) hj11 (Steps.zero 64) hN8 (by omega) + exact ⟨a + z * 2 + 6 * 2 ^ k, y, hny, hsy, by omega, by omega, by omega⟩ + +theorem near_closed {w k z x a : Nat} + (hw : w = 10 ∨ w = 11) (hf : Field k z w x) (hb : 8 * 2 ^ k ≤ a) : + ∃ y a' b', Round (1 + x * 2) a 0 y a' b' ∧ Safe y a' b' := by + obtain ⟨n, u, hnu, hsu, hle, hub, hmod⟩ := near_count hw hf hb + have hp2 : 0 < 2 ^ k := pow2_pos k + obtain ⟨y, a', b', hr, hsafe⟩ := normal_return a hnu (by omega) (fun t v heq => by + refine budget_return heq ?_ + rcases (by omega : a % 2 = 0 ∨ a % 2 = 1) with ha | ha1 + · exact Or.inr ⟨ha, by omega, by omega⟩ + · exact Or.inl ⟨ha1, by omega, by omega⟩) + exact ⟨y, a', b', ⟨u, steps_drop_even (by omega) hsu, hr⟩, hsafe⟩ + +theorem main_closed {w k z x a : Nat} + (hw : w = 1 ∨ w = 2 ∨ w = 3 ∨ w = 6 ∨ w = 7) + (hf : Field k z w x) (hb : Budget a (w * 2 ^ k + z)) : + ∃ y a' b', Round (1 + x * 2) a 0 y a' b' ∧ Safe y a' b' := by + rcases (by omega : z = 0 ∨ z ≠ 0) with hz | hz + · subst hz + exact main_regular_closed hw hf hb (fun _ h => by omega) (fun _ h => by omega) + · rcases (by omega : w = 1 ∨ w ≠ 1) with hw1 | hw1 + · subst hw1 + rcases (by omega : 2 * 2 ^ k ≤ a + z * 2 ∨ ¬ (2 * 2 ^ k ≤ a + z * 2)) with hle | hle + · exact main_regular_closed (Or.inl rfl) hf hb (fun _ _ => hle) (fun h _ => by omega) + · have h1 : 1 * 2 ^ k + z = 2 ^ k + z := by ring + rw [h1] at hb + exact main_short1 hf (by omega) hb (by omega) + · rcases (by omega : w = 2 ∨ w ≠ 2) with hw2 | hw2 + · subst hw2 + rcases (by omega : 4 * 2 ^ k ≤ a + z * 2 ∨ ¬ (4 * 2 ^ k ≤ a + z * 2)) with hle | hle + · exact main_regular_closed (Or.inr (Or.inl rfl)) hf hb (fun h _ => by omega) (fun _ _ => + hle) + · exact main_short2 hf (by omega) hb (by omega) + · exact main_regular_closed hw hf hb (fun h _ => False.elim (hw1 h)) (fun h _ => + False.elim (hw2 h)) + +theorem closed {x a b : Nat} (hs : Safe x a b) : + ∃ y a' b', Round x a b y a' b' ∧ Safe y a' b' := by + cases hs with + | @main e v x a hnv hb => + rcases (by omega : v = 0 ∨ v ≠ 0) with hv | hv + · subst hv + obtain ⟨rfl, rfl⟩ := normal_zero_value hnv + obtain ⟨u, hnu, hsu⟩ := normal_steps a Normal.D + have hnu' : Normal false a u := by simpa only [Nat.zero_add] using hnu + have ha : 0 < a := hb.1 + exact normal_count_closed (v := 0) (x := 0) (a := a) hb hnu' hsu ha (by omega) rfl + · obtain ⟨k, z, w, hf, hve, htop⟩ := normal_top hnv (by omega) + rw [hve] at hb + have hw : w = 1 ∨ w = 2 ∨ w = 3 ∨ w = 6 ∨ w = 7 := by + rcases htop with ⟨_, rfl⟩ | ⟨_, rfl | rfl⟩ <;> omega + exact main_closed hw hf hb + | high hw hf hb => exact main_closed (by rcases hw with rfl | rfl <;> omega) hf hb + | raw hx ha => exact raw_closed hx ha + | weak hnv hv => exact weak_closed hnv hv + | near hw hf hb => exact near_closed hw hf hb + | reset ha hb => exact reset_closed ha hb + +-- ============================================================================ +-- Section 7: Tape Number Representation (`Num`) & Generic `Rules` Engine +-- ============================================================================ + +inductive Num : Nat → ListBlank (Fin 2) → Prop where + | nil : Num 0 default + | zero {n : Nat} {l : ListBlank (Fin 2)} : Num n l → Num (n * 2) (l <+ ([0] : List (Fin 2))) + | one {n : Nat} {l : ListBlank (Fin 2)} : Num n l → Num (1 + n * 2) (l <+ ([1] : List (Fin 2))) + +theorem default_append_zero : (default : ListBlank (Fin 2)) <+ ([0] : List (Fin 2)) = default := + zero_cons_default + +theorem Num_even_aux {m : Nat} {l : ListBlank (Fin 2)} (h : Num m l) : + ∀ n, m = n * 2 → ∃ s, l = s <+ ([0] : List (Fin 2)) ∧ Num n s := by + cases h with + | nil => + intro n hm + have hn : n = 0 := by omega + subst hn + exact ⟨default, default_append_zero.symm, Num.nil⟩ + | @zero n' s hn' => + intro n hm + have hn : n' = n := by omega + subst hn + exact ⟨s, rfl, hn'⟩ + | one => + intro n hm; omega + +theorem Num_even {n : Nat} {l : ListBlank (Fin 2)} (h : Num (n * 2) l) : + ∃ s, l = s <+ ([0] : List (Fin 2)) ∧ Num n s := + Num_even_aux h n rfl + +theorem Num_odd_aux {m : Nat} {l : ListBlank (Fin 2)} (h : Num m l) : + ∀ n, m = 1 + n * 2 → ∃ s, l = s <+ ([1] : List (Fin 2)) ∧ Num n s := by + cases h with + | nil => intro n hm; omega + | zero => intro n hm; omega + | @one n' s hn' => + intro n hm + have hn : n' = n := by omega + subst hn + exact ⟨s, rfl, hn'⟩ + +theorem Num_odd {n : Nat} {l : ListBlank (Fin 2)} (h : Num (1 + n * 2) l) : + ∃ s, l = s <+ ([1] : List (Fin 2)) ∧ Num n s := + Num_odd_aux h n rfl + +theorem Num_zeros (k : Nat) {n : Nat} {l : ListBlank (Fin 2)} (h : Num n l) : + Num (n * 2 ^ k) (l <+ (([0] : List (Fin 2)) ^ k)) := by + induction k with + | zero => + simpa only [Nat.pow_zero, Nat.mul_one, pow_zero_list, listblank_append_nil] using h + | succ k ih => + have hz := Num.zero ih + have h1 : n * 2 ^ k * 2 = n * 2 ^ (k + 1) := by rw [pow2_succ]; ring + rw [h1, pow_succ_append_left] at hz + exact hz + +theorem Num_zero_inv_aux {m : Nat} {l : ListBlank (Fin 2)} (h : Num m l) (hm : m = 0) : l = + default := by + induction h with + | nil => rfl + | @zero n' s _ ih => + rw [ih (by omega), default_append_zero] + | one => omega + +theorem Num_zero_inv {l : ListBlank (Fin 2)} (h : Num 0 l) : l = default := + Num_zero_inv_aux h rfl + +theorem Num_unique {n : Nat} {l s : ListBlank (Fin 2)} (h1 : Num n l) (h2 : Num n s) : l = s := by + induction h1 generalizing s with + | nil => exact (Num_zero_inv h2).symm + | @zero n' l' _ ih => + obtain ⟨s', rfl, hs'⟩ := Num_even h2 + rw [ih hs'] + | @one n' l' _ ih => + obtain ⟨s', rfl, hs'⟩ := Num_odd h2 + rw [ih hs'] + +theorem Num_pairs (k : Nat) : ∀ {n : Nat} {l : ListBlank (Fin 2)}, + Num (n * 4 ^ k) l → ∃ s, Num n s ∧ l = s <+ (([0, 0] : List (Fin 2)) ^ k) := by + induction k with + | zero => + intro n l hn + simp only [Nat.pow_zero, Nat.mul_one] at hn + exact ⟨l, hn, rfl⟩ + | succ k ih => + intro n l hn + have h1 : n * 4 ^ (k + 1) = n * 4 ^ k * 2 * 2 := by rw [pow4_succ]; ring + rw [h1] at hn + obtain ⟨u, rfl, hu⟩ := Num_even hn + obtain ⟨v, rfl, hv⟩ := Num_even hu + obtain ⟨s, hs, rfl⟩ := ih hv + refine ⟨s, hs, ?_⟩ + rw [listblank_append_append] + change (s <+ (([0, 0] : List (Fin 2)) ^ k)) <+ ([0, 0] : List (Fin 2)) = + s <+ (([0, 0] : List (Fin 2)) ^ (k + 1)) + exact pow_succ_append_left s ([0, 0] : List (Fin 2)) k + +theorem Num_run (j : Nat) : ∀ {n : Nat} {l : ListBlank (Fin 2)}, + Num (n * 2 ^ (1 + j) + (2 ^ j - 1)) l → + ∃ s, l = (s <+ ([0] : List (Fin 2))) <+ (([1] : List (Fin 2)) ^ j) ∧ Num n s := by + induction j with + | zero => + intro n l hn + have heq : n * 2 ^ (1 + 0) + (2 ^ 0 - 1) = n * 2 := by simp + rw [heq] at hn + obtain ⟨s, rfl, hs⟩ := Num_even hn + exact ⟨s, rfl, hs⟩ + | succ j ih => + intro n l hn + have hp : 0 < 2 ^ j := pow2_pos j + have heq : n * 2 ^ (1 + (j + 1)) + (2 ^ (j + 1) - 1) = + 1 + (n * 2 ^ (1 + j) + (2 ^ j - 1)) * 2 := by + have h1 : n * 2 ^ (1 + (j + 1)) = (n * 2 ^ (1 + j)) * 2 := by + rw [pow2_one_add, pow2_succ, pow2_one_add]; ring + have h2 : 2 ^ (j + 1) = 2 ^ j * 2 := pow2_succ j + rw [h1, h2]; omega + rw [heq] at hn + obtain ⟨l', rfl, hl'⟩ := Num_odd hn + obtain ⟨s, rfl, hs⟩ := ih hl' + refine ⟨s, ?_, hs⟩ + rw [pow_succ_append_left] + +structure Rules (tm : Machine (Fin 2) (Fin 6)) (q h g : Fin 6) : Prop where + left_zero : ∀ (l r : ListBlank (Fin 2)), + ((l <+ ([0] : List (Fin 2))) <{{h}} r) [tm]⊢* ((l <+ ([1] : List (Fin 2))) {{q}}> r) + left_carry : ∀ (l r : ListBlank (Fin 2)) (j : Nat), + (((l <+ ([0] : List (Fin 2))) <+ (([1] : List (Fin 2)) ^ (1 + j))) <{{h}} r) [tm]⊢* + (l <{{h}} ((([1] : List (Fin 2)) ^ (2 + j)) +> r)) + scan_right : ∀ (l r : ListBlank (Fin 2)) (j : Nat), + (l {{q}}> ((([1] : List (Fin 2)) ^ j) +> r)) [tm]⊢* + ((l <+ (([0] : List (Fin 2)) ^ j)) {{q}}> r) + right_inc : ∀ (l r : ListBlank (Fin 2)) (n : Nat), + (l {{q}}> (([1] : List (Fin 2)) +> ((([1, + 0] : List (Fin 2)) ^ (2 + n)) +> (([0] : List (Fin 2)) +> r)))) [tm]⊢* + (l <{{h}} (([1] : List (Fin 2)) +> ((([1, 0] : List (Fin 2)) ^ (1 + n)) +> (([0, 1, + 0] : List (Fin 2)) +> r)))) + right_overflow : ∀ (l r : ListBlank (Fin 2)), + (l {{q}}> (([1, 1, 0, 0] : List (Fin 2)) +> r)) [tm]⊢⁺ + (l <{{g}} (([1, 0, 1, 0] : List (Fin 2)) +> r)) + scan_overflow : ∀ (l r : ListBlank (Fin 2)) (j : Nat), + ((l <+ (([0, 0] : List (Fin 2)) ^ j)) <{{g}} r) [tm]⊢* + (l <{{g}} ((([1, 0] : List (Fin 2)) ^ j) +> r)) + overflow_one : ∀ (l r : ListBlank (Fin 2)), + ((l <+ ([1] : List (Fin 2))) <{{g}} r) [tm]⊢* + (l <{{h}} (([1] : List (Fin 2)) +> r)) + overflow_two : ∀ (l r : ListBlank (Fin 2)), + ((l <+ ([0, 1, 0] : List (Fin 2))) <{{g}} r) [tm]⊢* + (l <{{h}} (([0, 0, 0] : List (Fin 2)) +> r)) + overflow_resume : ∀ (l r : ListBlank (Fin 2)), + (l {{q}}> (([0, 0, 0] : List (Fin 2)) +> r)) [tm]⊢* + (l <{{g}} (([1, 0, 0] : List (Fin 2)) +> r)) + +theorem H_spec {tm : Machine (Fin 2) (Fin 6)} {q h g : Fin 6} (rules : Rules tm q h g) + {x y : Nat} (hxy : H x y) : + ∀ {l : ListBlank (Fin 2)}, Num x l → + ∃ l', Num y l' ∧ ∀ r, (l <{{h}} r) [tm]⊢* (l' {{q}}> r) := by + induction hxy with + | even n => + intro l hn + obtain ⟨s, rfl, hs⟩ := Num_even hn + exact ⟨s <+ ([1] : List (Fin 2)), Num.one hs, fun r => rules.left_zero s r⟩ + | @carry j x' y' _ ih => + intro l hn + have h2j : 2 + j = 1 + (1 + j) := by omega + rw [h2j] at hn + obtain ⟨s, rfl, hs⟩ := Num_run (1 + j) hn + obtain ⟨s', hs', hstep⟩ := ih hs + refine ⟨s' <+ (([0] : List (Fin 2)) ^ (2 + j)), ?_, fun r => ?_⟩ + · exact Num_zeros (2 + j) hs' + · exact stepStar_trans (rules.left_carry s r j) + (stepStar_trans (hstep ((([1] : List (Fin 2)) ^ (2 + j)) +> r)) + (rules.scan_right s' r (2 + j))) + +def right_tape (a b : Nat) : ListBlank (Fin 2) := + ([1] : List (Fin 2)) +> ((([1, 0] : List (Fin 2)) ^ a) +> (([0] : List (Fin 2)) +> ((([1, + 0] : List (Fin 2)) ^ b) +> default))) + +theorem count_spec {tm : Machine (Fin 2) (Fin 6)} {q h g : Fin 6} (rules : Rules tm q h g) + {n x y : Nat} (hsteps : Steps n x y) : + ∀ {l : ListBlank (Fin 2)}, Num x l → + ∃ l', Num y l' ∧ ∀ a b, + (l {{q}}> right_tape (1 + n + a) b) [tm]⊢* (l' {{q}}> right_tape (1 + a) (n + b)) := by + induction hsteps with + | zero x => + intro l hn + refine ⟨l, hn, fun a b => ?_⟩ + have h1 : 1 + 0 + a = 1 + a := by omega + have h2 : 0 + b = b := by omega + rw [h1, h2] + try exact ⟨0, rfl⟩ + | @next n' x' y' z' hxy _ ih => + intro l hn + obtain ⟨l', hl', hstep1⟩ := H_spec rules hxy hn + obtain ⟨l'', hl'', hstep2⟩ := ih hl' + refine ⟨l'', hl'', fun a b => ?_⟩ + have hinc := rules.right_inc l ((([1, 0] : List (Fin 2)) ^ b) +> default) (n' + a) + have h1 : 2 + (n' + a) = 1 + (1 + n') + a := by omega + have h1' : 1 + (n' + a) = 1 + n' + a := by omega + rw [h1, h1'] at hinc + have hinc' : (l {{q}}> right_tape (1 + (1 + n') + a) b) [tm]⊢* + (l <{{h}} right_tape (1 + n' + a) (1 + b)) := by + unfold right_tape + have hrew : (([0, 1, 0] : List (Fin 2)) +> ((([1, 0] : List (Fin 2)) ^ b) +> default)) = + (([0] : List (Fin 2)) +> ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> default)) := by + have : (1 + b) = b + 1 := by omega + rw [this, pow_succ_append_right] + rfl + rw [← hrew] + exact hinc + have h2 := hstep1 (right_tape (1 + n' + a) (1 + b)) + have h3 := hstep2 a (1 + b) + have h4 : n' + (1 + b) = 1 + n' + b := by omega + rw [h4] at h3 + exact stepStar_trans hinc' (stepStar_trans h2 h3) + +theorem overflow_spec {tm : Machine (Fin 2) (Fin 6)} {q h g : Fin 6} (rules : Rules tm q h g) + {n x y : Nat} (hsteps : Steps n x y) {l : ListBlank (Fin 2)} (hn : Num x l) : + ∃ l', Num y l' ∧ ∀ b, + (l {{q}}> right_tape (1 + n) b) [tm]⊢⁺ (l' <{{g}} ((([1, + 0] : List (Fin 2)) ^ (2 + n + b)) +> default)) := by + obtain ⟨l', hl', hcount⟩ := count_spec rules hsteps hn + refine ⟨l', hl', fun b => ?_⟩ + have hc := hcount 0 b + have h1 : 1 + n + 0 = 1 + n := by omega + rw [h1] at hc + have hov := rules.right_overflow l' ((([1, 0] : List (Fin 2)) ^ (n + b)) +> default) + have hrt : right_tape 1 (n + b) = (([1, 1, 0, 0] : List (Fin 2)) +> ((([1, + 0] : List (Fin 2)) ^ (n + b)) +> default)) := rfl + have hpow : (([1, 0, 1, 0] : List (Fin 2)) +> ((([1, 0] : List (Fin 2)) ^ (n + b)) +> default)) = + ((([1, 0] : List (Fin 2)) ^ (2 + n + b)) +> default) := by + have : 2 + n + b = (n + b) + 1 + 1 := by omega + rw [this, pow_succ_append_right, pow_succ_append_right] + rfl + rw [← hrt, hpow] at hov + exact stepStar_stepPlus_stepPlus hc hov + +theorem right_tape_zero (m : Nat) : + (([1] : List (Fin 2)) +> ((([1, 0] : List (Fin 2)) ^ m) +> default)) = right_tape m 0 := by + unfold right_tape + simp only [pow_zero_list, listblank_append_nil] + have h0 : (([0] : List (Fin 2)) +> default) = default := zero_cons_default + rw [h0] + +theorem return_odd {tm : Machine (Fin 2) (Fin 6)} {q h g : Fin 6} (rules : Rules tm q h g) + (t : Nat) {x y : Nat} (hxy : H x y) {l : ListBlank (Fin 2)} (hn : Num ((1 + x * 2) * 4 ^ t) l) : + ∃ l', Num y l' ∧ ∀ a, + (l <{{g}} ((([1, + 0] : List (Fin 2)) ^ a) +> default)) [tm]⊢* (l' {{q}}> right_tape (a + t) 0) := by + obtain ⟨s, hs, rfl⟩ := Num_pairs t hn + obtain ⟨s', rfl, hs'⟩ := Num_odd hs + obtain ⟨s'', hs'', hstep⟩ := H_spec rules hxy hs' + refine ⟨s'', hs'', fun a => ?_⟩ + have h1 := + rules.scan_overflow (s' <+ ([1] : List (Fin 2))) ((([1, 0] : List (Fin 2)) ^ a) +> default) t + have h2 := + rules.overflow_one s' ((([1, 0] : List (Fin 2)) ^ t) +> ((([1, + 0] : List (Fin 2)) ^ a) +> default)) + have h3 := + hstep (([1] : List (Fin 2)) +> ((([1, 0] : List (Fin 2)) ^ t) +> ((([1, + 0] : List (Fin 2)) ^ a) +> default))) + have h123 := stepStar_trans h1 (stepStar_trans h2 h3) + have hmerge : ((([1, 0] : List (Fin 2)) ^ t) +> ((([1, 0] : List (Fin 2)) ^ a) +> default)) = + ((([1, 0] : List (Fin 2)) ^ (a + t)) +> default) := by + rw [Nat.add_comm a t, pow_add_append_right] + rw [hmerge, right_tape_zero] at h123 + exact h123 + +theorem return_power {tm : Machine (Fin 2) (Fin 6)} {q h g : Fin 6} (rules : Rules tm q h g) + (t a : Nat) {l : ListBlank (Fin 2)} (hn : Num (2 * 4 ^ t) l) : + (l <{{g}} ((([1, 0] : List (Fin 2)) ^ a) +> default)) [tm]⊢* + ((default <+ ([1] : List (Fin 2))) {{q}}> right_tape 1 (a + t)) := by + obtain ⟨s, hs, rfl⟩ := Num_pairs t hn + have hs_eq : s = (default <+ ([1] : List (Fin 2))) <+ ([0] : List (Fin 2)) := + Num_unique hs (Num.zero (Num.one Num.nil)) + subst hs_eq + let R := ((([1, 0] : List (Fin 2)) ^ t) +> ((([1, 0] : List (Fin 2)) ^ a) +> default)) + have h1 := rules.scan_overflow ((default <+ ([1] : List (Fin 2))) <+ ([0] : List (Fin 2))) + ((([1, 0] : List (Fin 2)) ^ a) +> default) t + have hs_pal : ((default <+ ([1] : List (Fin 2))) <+ ([0] : List (Fin 2))) = + default <+ ([0, 1, 0] : List (Fin 2)) := by + change (0 : Fin 2) >> (1 : Fin 2) >> default = (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + default + rw [zero_cons_default] + have h2 := rules.overflow_two default R + rw [← hs_pal] at h2 + have h3 := rules.left_zero default (([0, 0, 0] : List (Fin 2)) +> R) + rw [default_append_zero] at h3 + have h4 := rules.overflow_resume (default <+ ([1] : List (Fin 2))) R + have h5 := rules.overflow_one default (([1, 0, 0] : List (Fin 2)) +> R) + have h6 := rules.left_zero default (([1] : List (Fin 2)) +> (([1, 0, 0] : List (Fin 2)) +> R)) + rw [default_append_zero] at h6 + have h123456 := + stepStar_trans h1 (stepStar_trans h2 (stepStar_trans h3 (stepStar_trans h4 (stepStar_trans h5 + h6)))) + have hR_eq : (([1] : List (Fin 2)) +> (([1, 0, 0] : List (Fin 2)) +> R)) = right_tape 1 (a + t) := + by + unfold R right_tape + rw [Nat.add_comm a t, pow_add_append_right] + rfl + rw [hR_eq] at h123456 + exact h123456 + +theorem Return_spec {tm : Machine (Fin 2) (Fin 6)} {q h g : Fin 6} (rules : Rules tm q h g) + {x a y b c : Nat} (hret : Return x a y b c) {l : ListBlank (Fin 2)} (hn : Num x l) : + ∃ l', Num y l' ∧ + (l <{{g}} ((([1, 0] : List (Fin 2)) ^ a) +> default)) [tm]⊢* (l' {{q}}> right_tape b c) := by + cases hret with + | odd t a hxy => + obtain ⟨l', hl', hstep⟩ := return_odd rules t hxy hn + exact ⟨l', hl', hstep a⟩ + | power t a => + exact ⟨default <+ ([1] : List (Fin 2)), Num.one Num.nil, return_power rules t a hn⟩ + +theorem Round_spec {tm : Machine (Fin 2) (Fin 6)} {q h g : Fin 6} (rules : Rules tm q h g) + {x a b y a' b' : Nat} (hrnd : Round x a b y a' b') (ha : 0 < a) + {l : ListBlank (Fin 2)} (hn : Num x l) : + ∃ l', Num y l' ∧ + (l {{q}}> right_tape a b) [tm]⊢⁺ (l' {{q}}> right_tape a' b') := by + obtain ⟨u, hsteps, hret⟩ := hrnd + obtain ⟨s, hs, hov⟩ := overflow_spec rules hsteps hn + obtain ⟨l', hl', hret_step⟩ := Return_spec rules hret hs + refine ⟨l', hl', ?_⟩ + have hov_b := hov b + have h1 : 1 + (a - 1) = a := by omega + have h2 : 2 + (a - 1) + b = a + b + 1 := by omega + rw [h1, h2] at hov_b + exact stepPlus_stepStar_stepPlus hov_b hret_step + +theorem nonhalt_from {tm : Machine (Fin 2) (Fin 6)} {q h g : Fin 6} (rules : Rules tm q h g) + {x a b : Nat} {l : ListBlank (Fin 2)} + (hinit : (init []) [tm]⊢* (l {{q}}> right_tape a b)) + (hsafe : Safe x a b) (hnum : Num x l) : + IsDoesNotHalt tm := by + have hreach : ∀ k : Nat, ∃ l' x' a' b', Num x' l' ∧ Safe x' a' b' ∧ + ∃ m ≥ k, multiStep tm (init []) m = some (l' {{q}}> right_tape a' b') := by + intro k + induction k with + | zero => + obtain ⟨m, hm⟩ := hinit + exact ⟨l, x, a, b, hnum, hsafe, m, Nat.zero_le m, hm⟩ + | succ k ih => + obtain ⟨l0, x0, a0, b0, hn0, hs0, m, hge, hm⟩ := ih + obtain ⟨y, a', b', hrnd, hs'⟩ := closed hs0 + obtain ⟨l', hn', ⟨d, hd_pos, hd⟩⟩ := Round_spec rules hrnd (safe_positive hs0) hn0 + refine ⟨l', y, a', b', hn', hs', m + d, by omega, ?_⟩ + exact multiStep_trans tm (init []) (l0 {{q}}> right_tape a0 b0) (l' {{q}}> right_tape a' b') m + d hm hd + intro cfg ⟨n, hn⟩ + rw [Option.isSome_iff_ne_none] + intro hnone + obtain ⟨l', x', a', b', _, _, m, hge, hm⟩ := hreach (n + 1) + have hm_eq : m = n + (1 + (m - n - 1)) := by omega + rw [hm_eq, multiStep_add tm (init []) n (1 + (m - n - 1)), hn] at hm + simp only [Option.bind] at hm + rw [multiStep_add tm cfg 1 (m - n - 1), multiStep_one, hnone] at hm + simp only [Option.bind] at hm + cases hm + + +theorem mk_scan_right {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (h_step : ∀ l r, (l {{q}}> (([1] : List (Fin 2)) +> r)) [tm]⊢* + ((l <+ ([0] : List (Fin 2))) {{q}}> r)) + (l r : ListBlank (Fin 2)) (j : Nat) : + (l {{q}}> ((([1] : List (Fin 2)) ^ j) +> r)) [tm]⊢* + ((l <+ (([0] : List (Fin 2)) ^ j)) {{q}}> r) := by + induction j generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ j ih => + rw [pow_succ_append_right] + have h1 := h_step l ((([1] : List (Fin 2)) ^ j) +> r) + have h2 := ih (l <+ ([0] : List (Fin 2))) r + have hrew : ((l <+ ([0] : List (Fin 2))) <+ (([0] : List (Fin 2)) ^ j)) = + (l <+ (([0] : List (Fin 2)) ^ (j + 1))) := by + rw [listblank_append_append, list_pow_append_one] + rw [hrew] at h2 + exact stepStar_trans h1 h2 + +theorem mk_scan_overflow {tm : Machine (Fin 2) (Fin 6)} {g : Fin 6} + (h_step : ∀ l r, ((l <+ ([0, 0] : List (Fin 2))) <{{g}} r) [tm]⊢* + (l <{{g}} (([1, 0] : List (Fin 2)) +> r))) + (l r : ListBlank (Fin 2)) (j : Nat) : + ((l <+ (([0, 0] : List (Fin 2)) ^ j)) <{{g}} r) [tm]⊢* + (l <{{g}} ((([1, 0] : List (Fin 2)) ^ j) +> r)) := by + induction j generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ j ih => + rw [pow_succ_list, ← listblank_append_append] + have h1 := h_step (l <+ (([0, 0] : List (Fin 2)) ^ j)) r + have h2 := ih l (([1, 0] : List (Fin 2)) +> r) + have hrew : ((([1, 0] : List (Fin 2)) ^ j) +> (([1, 0] : List (Fin 2)) +> r)) = + ((([1, 0] : List (Fin 2)) ^ (j + 1)) +> r) := by + rw [listblank_append_append, list_pow_append_one] + rw [hrew] at h2 + exact stepStar_trans h1 h2 + +theorem mk_shift_inc_right {tm : Machine (Fin 2) (Fin 6)} {g : Fin 6} + (h_step : ∀ l r, ((l <+ ([0, 0] : List (Fin 2))) {{g}}> (([1, 0] : List (Fin 2)) +> r)) [tm]⊢* + (((l <+ ([1, 0] : List (Fin 2))) <+ ([0, 0] : List (Fin 2))) {{g}}> r)) + (j : Nat) (l r : ListBlank (Fin 2)) : + ((l <+ ([0, 0] : List (Fin 2))) {{g}}> ((([1, 0] : List (Fin 2)) ^ j) +> r)) [tm]⊢* + (((l <+ (([1, 0] : List (Fin 2)) ^ j)) <+ ([0, 0] : List (Fin 2))) {{g}}> r) := by + induction j generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ j ih => + rw [pow_succ_append_right] + have h1 := h_step l ((([1, 0] : List (Fin 2)) ^ j) +> r) + have h2 := ih (l <+ ([1, 0] : List (Fin 2))) r + have hrew : ((l <+ ([1, 0] : List (Fin 2))) <+ (([1, 0] : List (Fin 2)) ^ j)) = + (l <+ (([1, 0] : List (Fin 2)) ^ (j + 1))) := by + rw [listblank_append_append, list_pow_append_one] + rw [hrew] at h2 + exact stepStar_trans h1 h2 + +theorem mk_shift_inc_left {tm : Machine (Fin 2) (Fin 6)} {h : Fin 6} + (h_step : ∀ l r, ((l <+ ([1, 0] : List (Fin 2))) <{{h}} r) [tm]⊢* + (l <{{h}} (([1, 1] : List (Fin 2)) +> r))) + (j : Nat) (l r : ListBlank (Fin 2)) : + ((l <+ (([1, 0] : List (Fin 2)) ^ j)) <{{h}} r) [tm]⊢* + (l <{{h}} ((([1, 1] : List (Fin 2)) ^ j) +> r)) := by + induction j generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ j ih => + rw [pow_succ_list, ← listblank_append_append] + have h1 := h_step (l <+ (([1, 0] : List (Fin 2)) ^ j)) r + have h2 := ih l (([1, 1] : List (Fin 2)) +> r) + have hrew : ((([1, 1] : List (Fin 2)) ^ j) +> (([1, 1] : List (Fin 2)) +> r)) = + ((([1, 1] : List (Fin 2)) ^ (j + 1)) +> r) := by + rw [listblank_append_append, list_pow_append_one] + rw [hrew] at h2 + exact stepStar_trans h1 h2 + +theorem mk_scan_right_pair {tm : Machine (Fin 2) (Fin 6)} {q : Fin 6} + (h_step : ∀ l r, (l {{q}}> (([1, 1] : List (Fin 2)) +> r)) [tm]⊢* + ((l <+ ([0, 0] : List (Fin 2))) {{q}}> r)) + (j : Nat) (l r : ListBlank (Fin 2)) : + (l {{q}}> ((([1, 1] : List (Fin 2)) ^ j) +> r)) [tm]⊢* + ((l <+ (([0, 0] : List (Fin 2)) ^ j)) {{q}}> r) := by + induction j generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ j ih => + rw [pow_succ_append_right] + have h1 := h_step l ((([1, 1] : List (Fin 2)) ^ j) +> r) + have h2 := ih (l <+ ([0, 0] : List (Fin 2))) r + have hrew : ((l <+ ([0, 0] : List (Fin 2))) <+ (([0, 0] : List (Fin 2)) ^ j)) = + (l <+ (([0, 0] : List (Fin 2)) ^ (j + 1))) := by + rw [listblank_append_append, list_pow_append_one] + rw [hrew] at h2 + exact stepStar_trans h1 h2 + +theorem mkRules {tm : Machine (Fin 2) (Fin 6)} {q h g : Fin 6} + (h_left_zero : ∀ l r, ((l <+ ([0] : List (Fin 2))) <{{h}} r) [tm]⊢* + ((l <+ ([1] : List (Fin 2))) {{q}}> r)) + (h_left_carry : ∀ l r j, + (((l <+ ([0] : List (Fin 2))) <+ (([1] : List (Fin 2)) ^ (1 + j))) <{{h}} r) [tm]⊢* + (l <{{h}} ((([1] : List (Fin 2)) ^ (2 + j)) +> r))) + (h_scan_r1 : ∀ l r, (l {{q}}> (([1] : List (Fin 2)) +> r)) [tm]⊢* + ((l <+ ([0] : List (Fin 2))) {{q}}> r)) + (h_scan_ov1 : ∀ l r, ((l <+ ([0, 0] : List (Fin 2))) <{{g}} r) [tm]⊢* + (l <{{g}} (([1, 0] : List (Fin 2)) +> r))) + (h_shift_r1 : ∀ l r, + ((l <+ ([0, 0] : List (Fin 2))) {{g}}> (([1, 0] : List (Fin 2)) +> r)) [tm]⊢* + (((l <+ ([1, 0] : List (Fin 2))) <+ ([0, 0] : List (Fin 2))) {{g}}> r)) + (h_shift_l1 : ∀ l r, ((l <+ ([1, 0] : List (Fin 2))) <{{h}} r) [tm]⊢* + (l <{{h}} (([1, 1] : List (Fin 2)) +> r))) + (h_scan_pair1 : ∀ l r, (l {{q}}> (([1, 1] : List (Fin 2)) +> r)) [tm]⊢* + ((l <+ ([0, 0] : List (Fin 2))) {{q}}> r)) + (h_inc1 : ∀ l r, + (l {{q}}> (([1] : List (Fin 2)) +> (([1, 0] : List (Fin 2)) +> r))) [tm]⊢* + (((l <+ ([0] : List (Fin 2))) <+ ([0, 0] : List (Fin 2))) {{g}}> r)) + (h_inc3 : ∀ l r, + (((l <+ ([1, 0] : List (Fin 2))) <+ ([0, 0] : List (Fin 2))) {{g}}> + (([0] : List (Fin 2)) +> r)) [tm]⊢* + (l <{{h}} (([0, 0, 0, 1, 0] : List (Fin 2)) +> r))) + (h_inc7 : ∀ l r, + (l {{q}}> (([0, 0, 0, 1, 0] : List (Fin 2)) +> r)) [tm]⊢* + (l <{{g}} (([1, 0, 0, 1, 0] : List (Fin 2)) +> r))) + (h_right_overflow : ∀ l r, + (l {{q}}> (([1, 1, 0, 0] : List (Fin 2)) +> r)) [tm]⊢⁺ + (l <{{g}} (([1, 0, 1, 0] : List (Fin 2)) +> r))) + (h_overflow_one : ∀ l r, + ((l <+ ([1] : List (Fin 2))) <{{g}} r) [tm]⊢* + (l <{{h}} (([1] : List (Fin 2)) +> r))) + (h_overflow_two : ∀ l r, + ((l <+ ([0, 1, 0] : List (Fin 2))) <{{g}} r) [tm]⊢* + (l <{{h}} (([0, 0, 0] : List (Fin 2)) +> r))) + (h_overflow_resume : ∀ l r, + (l {{q}}> (([0, 0, 0] : List (Fin 2)) +> r)) [tm]⊢* + (l <{{g}} (([1, 0, 0] : List (Fin 2)) +> r))) : + Rules tm q h g where + left_zero := h_left_zero + left_carry := h_left_carry + scan_right := mk_scan_right h_scan_r1 + right_inc := by + intro l r n + have h2n : 2 + n = (n + 1) + 1 := by omega + rw [h2n, pow_succ_append_right] + have s1 := h_inc1 l ((([1, 0] : List (Fin 2)) ^ (n + 1)) +> (([0] : List (Fin 2)) +> r)) + have s2 := mk_shift_inc_right h_shift_r1 (n + 1) + (l <+ ([0] : List (Fin 2))) (([0] : List (Fin 2)) +> r) + rw [pow_succ_list, ← listblank_append_append] at s2 + have s3 := h_inc3 ((l <+ ([0] : List (Fin 2))) <+ (([1, 0] : List (Fin 2)) ^ n)) r + have s4 := mk_shift_inc_left h_shift_l1 n + (l <+ ([0] : List (Fin 2))) (([0, 0, 0, 1, 0] : List (Fin 2)) +> r) + have s5 := + h_left_zero l ((([1, 1] : List (Fin 2)) ^ n) +> (([0, 0, 0, 1, 0] : List (Fin 2)) +> r)) + have s6 := mk_scan_right_pair h_scan_pair1 n + (l <+ ([1] : List (Fin 2))) (([0, 0, 0, 1, 0] : List (Fin 2)) +> r) + have s7 := h_inc7 ((l <+ ([1] : List (Fin 2))) <+ (([0, 0] : List (Fin 2)) ^ n)) r + have s8 := mk_scan_overflow h_scan_ov1 + (l <+ ([1] : List (Fin 2))) (([1, 0, 0, 1, 0] : List (Fin 2)) +> r) n + have s9 := + h_overflow_one l ((([1, 0] : List (Fin 2)) ^ n) +> (([1, 0, 0, 1, 0] : List (Fin 2)) +> r)) + have hrew : ((([1, 0] : List (Fin 2)) ^ n) +> (([1, 0, 0, 1, 0] : List (Fin 2)) +> r)) = + ((([1, 0] : List (Fin 2)) ^ (1 + n)) +> (([0, 1, 0] : List (Fin 2)) +> r)) := by + have h1n : 1 + n = n + 1 := by omega + have hsplit : (([1, 0, 0, 1, 0] : List (Fin 2)) +> r) = + (([1, 0] : List (Fin 2)) +> (([0, 1, 0] : List (Fin 2)) +> r)) := rfl + rw [hsplit, listblank_append_append, list_pow_append_one, h1n] + rw [hrew] at s8 s9 + exact stepStar_trans s1 (stepStar_trans s2 (stepStar_trans s3 + (stepStar_trans s4 (stepStar_trans s5 (stepStar_trans s6 + (stepStar_trans s7 (stepStar_trans s8 s9))))))) + right_overflow := h_right_overflow + scan_overflow := mk_scan_overflow h_scan_ov1 + overflow_one := h_overflow_one + overflow_two := h_overflow_two + overflow_resume := h_overflow_resume + +end PairCounter + +private def tm_coq : Machine (Fin 2) (Fin 6) + | 0, 0 => some (some 1, Stmt.write 1 Dir.left) + | 0, 1 => some (some 3, Stmt.write 1 Dir.right) + | 1, 0 => some (some 2, Stmt.write 1 Dir.right) + | 1, 1 => some (some 0, Stmt.write 1 Dir.left) + | 2, 0 => some (some 3, Stmt.write 0 Dir.right) + | 2, 1 => some (some 2, Stmt.write 0 Dir.right) + | 3, 0 => some (some 4, Stmt.write 0 Dir.left) + | 3, 1 => some (some 1, Stmt.write 1 Dir.left) + | 4, 0 => some (some 3, Stmt.write 1 Dir.left) + | 4, 1 => some (some 5, Stmt.write 0 Dir.left) + | 5, 0 => some (some 1, Stmt.write 0 Dir.left) + | 5, 1 => none + +private def mirrorTape (T : Tape (Fin 2)) : Tape (Fin 2) := ⟨T.head, T.right, T.left⟩ + +private def mirrorCfg (c : Cfg (Fin 2) (Fin 6)) : Cfg (Fin 2) (Fin 6) := + ⟨c.q, mirrorTape c.tape⟩ + +private theorem step_mirror (c : Cfg (Fin 2) (Fin 6)) : + step tm_coq (mirrorCfg c) = (step target_tm c).map mirrorCfg := by + rcases c with ⟨_ | q, ⟨hd, l, r⟩⟩ + · rfl + · match q, hd with + | 0, 0 | 0, 1 | 1, 0 | 1, 1 | 2, 0 | 2, 1 + | 3, 0 | 3, 1 | 4, 0 | 4, 1 | 5, 0 | 5, 1 => rfl + +private theorem multiStep_mirror (c : Cfg (Fin 2) (Fin 6)) (n : Nat) : + multiStep tm_coq (mirrorCfg c) n = (multiStep target_tm c n).map mirrorCfg := by + induction n generalizing c with + | zero => rfl + | succ n ih => + have hn1 : n + 1 = 1 + n := by omega + rw [hn1, multiStep_add tm_coq _ 1 n, multiStep_add target_tm _ 1 n] + rw [multiStep_one, multiStep_one, step_mirror] + cases step target_tm c with + | none => rfl + | some c' => exact ih c' + +private theorem nonhalt_mirror (h : IsDoesNotHalt tm_coq) : IsDoesNotHalt target_tm := by + intro cfg ⟨n, hn⟩ + have hinit_mir : mirrorCfg (init ([] : List (Fin 2))) = init ([] : List (Fin 2)) := rfl + have hm := multiStep_mirror (init ([] : List (Fin 2))) n + rw [hinit_mir, hn] at hm + have hstep := h (mirrorCfg cfg) ⟨n, hm⟩ + rw [step_mirror] at hstep + cases hq : step target_tm cfg with + | none => rw [hq] at hstep; cases hstep + | some c' => rfl + +private theorem shift_B_left (j : Nat) (l r : ListBlank (Fin 2)) : + (((l <+ ([1] : List (Fin 2))) <+ (([1] : List (Fin 2)) ^ j)) <{{B}} r) [tm_coq]⊢* + ((l <+ ([1] : List (Fin 2))) <{{B}} ((([1] : List (Fin 2)) ^ j) +> r)) := by + induction j generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ j ih => + rw [← list_pow_append_one, ← listblank_append_append] + have h1 : ((((l <+ ([1] : List (Fin 2))) <+ ([1] : List (Fin 2))) <+ + (([1] : List (Fin 2)) ^ j)) <{{B}} r) [tm_coq]⊢* + (((l <+ ([1] : List (Fin 2))) <+ ([1] : List (Fin 2))) <{{B}} + ((([1] : List (Fin 2)) ^ j) +> r)) := + ih (l <+ ([1] : List (Fin 2))) r + have h2 : (((l <+ ([1] : List (Fin 2))) <+ ([1] : List (Fin 2))) <{{B}} + ((([1] : List (Fin 2)) ^ j) +> r)) [tm_coq]⊢* + ((l <+ ([1] : List (Fin 2))) <{{B}} + (([1] : List (Fin 2)) +> ((([1] : List (Fin 2)) ^ j) +> r))) := by execute + have hrew : (([1] : List (Fin 2)) +> ((([1] : List (Fin 2)) ^ j) +> r)) = + ((([1] : List (Fin 2)) ^ (j + 1)) +> r) := by + rw [← pow_succ_append_right] + rw [hrew] at h2 + rw [list_pow_append_one] + exact stepStar_trans h1 h2 + +private theorem rule_left_carry (l r : ListBlank (Fin 2)) (j : Nat) : + (((l <+ ([0] : List (Fin 2))) <+ (([1] : List (Fin 2)) ^ (1 + j))) <{{B}} r) [tm_coq]⊢* + (l <{{B}} ((([1] : List (Fin 2)) ^ (2 + j)) +> r)) := by + have hj : 1 + j = j + 1 := by omega + rw [hj, ← list_pow_append_one, ← listblank_append_append] + have h1 := shift_B_left j (l <+ ([0] : List (Fin 2))) r + have h2 : (((l <+ ([0] : List (Fin 2))) <+ ([1] : List (Fin 2))) <{{B}} + ((([1] : List (Fin 2)) ^ j) +> r)) [tm_coq]⊢* + (l <{{B}} (([1] : List (Fin 2)) +> + (([1] : List (Fin 2)) +> ((([1] : List (Fin 2)) ^ j) +> r)))) := by execute + have hrew : (([1] : List (Fin 2)) +> (([1] : List (Fin 2)) +> + ((([1] : List (Fin 2)) ^ j) +> r))) = + ((([1] : List (Fin 2)) ^ (2 + j)) +> r) := by + have : 2 + j = (j + 1) + 1 := by omega + rw [this, pow_succ_append_right, pow_succ_append_right] + rw [hrew] at h2 + exact stepStar_trans h1 h2 + +private theorem tm380_rules : PairCounter.Rules tm_coq C B D := + PairCounter.mkRules + (fun _ _ => by execute) + rule_left_carry + (fun _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ => by execute) + +private theorem tm380_init : + (init []) [tm_coq]⊢* ((default <+ ([1] : List (Fin 2))) {{C}}> PairCounter.right_tape 1 1) := by + unfold PairCounter.right_tape + execute + +end Solution + +open Solution in +private theorem is_does_not_halt : IsNotHalt target_tm := by + apply nonhalt_mirror + refine PairCounter.nonhalt_from tm380_rules tm380_init ?_ (PairCounter.Num.one + PairCounter.Num.nil) + exact PairCounter.Safe.reset (by decide) (by decide) + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end BusyBeaver.M_1RB1LD_1LC1RA_0LD0LC_0RE1RB_1RD0RF_0RBHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LD_1RC0RB_1LA0RE_1LC1LE_1LF0LA_0REHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LD_1RC0RB_1LA0RE_1LC1LE_1LF0LA_0REHHH.lean new file mode 100644 index 00000000..191783d7 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LD_1RC0RB_1LA0RE_1LC1LE_1LF0LA_0REHHH.lean @@ -0,0 +1,2821 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1LD_1RC0RB_1LA0RE_1LC1LE_1LF0LA_0REHHH + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LD_1RC0RB_1LA0RE_1LC1LE_1LF0LA_0REHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def D : Fin 6 := 3 +def E : Fin 6 := 4 + +local notation3 l " |{" q "}> " r => (r <{{q}} l : Cfg (Fin 2) (Fin 6)) +local notation3 l " <{" q "}| " r => (r {{q}}> l : Cfg (Fin 2) (Fin 6)) + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : + multiStep M config 0 = some config := rfl + +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : + multiStep M config 1 = step M config := rfl + +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +theorem multiStep_add (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n + m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem multiStep_step {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} {n : Nat} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢^{n} c₃) : c₁ [tm]⊢^{n + 1} c₃ := by + have := multiStep_trans tm c₁ c₂ c₃ 1 n h₁ h₂ + rwa [Nat.add_comm 1 n] at this + +theorem stepStar_refl (c : Cfg (Fin 2) (Fin 6)) : c [target_tm]⊢* c := ⟨0, rfl⟩ + +theorem stepPlus_to_stepStar {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢⁺ c₂) : + c₁ [target_tm]⊢* c₂ := by + rcases h with ⟨n, _, hn⟩; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [target_tm]⊢⁺ c₂) (h₂ : c₂ [target_tm]⊢* c₃) : c₁ [target_tm]⊢⁺ c₃ := by + rcases h₁ with ⟨n, hn_pos, hn⟩; rcases h₂ with ⟨m, hm⟩ + exact ⟨n + m, Nat.add_pos_left hn_pos m, multiStep_trans target_tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [target_tm]⊢* c₂) (h₂ : c₂ [target_tm]⊢⁺ c₃) : c₁ [target_tm]⊢⁺ c₃ := by + rcases h₁ with ⟨n, hn⟩; rcases h₂ with ⟨m, hm_pos, hm⟩ + exact ⟨n + m, Nat.add_pos_right n hm_pos, multiStep_trans target_tm c₁ c₂ c₃ n m hn hm⟩ + +omit [Inhabited Γ] in +@[simp] theorem pow_zero_list (l : List Γ) : l ^ (0 : Nat) = [] := rfl + +omit [Inhabited Γ] in +theorem pow_succ_list (l : List Γ) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl + +omit [Inhabited Γ] in +@[simp] theorem list_pow_add (l : List Γ) (n m : Nat) : l ^ (n + m) = l ^ n ++ l ^ m := by + induction n with + | zero => simp [pow_zero_list] + | succ n ih => + rw [Nat.succ_add, pow_succ_list, pow_succ_list, ih, List.append_assoc] + +omit [Inhabited Γ] in +theorem pow_succ_right (l : List Γ) (n : Nat) : l ^ (n + 1) = l ^ n ++ l := by + rw [list_pow_add]; simp [pow_succ_list, pow_zero_list] + +@[simp] theorem listblank_append_nil (s : ListBlank Γ) : ([] : List Γ) +> s = s := rfl + +@[simp] theorem listblank_append_cons (a : Γ) (l : List Γ) (s : ListBlank Γ) : + (a :: l) +> s = a >> (l +> s) := rfl + +@[simp] theorem listblank_append_assoc (l₁ l₂ : List Γ) (s : ListBlank Γ) : + (l₁ ++ l₂) +> s = l₁ +> (l₂ +> s) := + Turing.ListBlank.append_assoc l₁ l₂ s + +theorem left_pow_add (l : ListBlank (Fin 2)) (u : List (Fin 2)) (n m : Nat) : + l <+ u ^ (n + m) = l <+ u ^ m <+ u ^ n := by + rw [list_pow_add, listblank_append_assoc] + +theorem left_pow_succ (l : ListBlank (Fin 2)) (u : List (Fin 2)) (n : Nat) : + l <+ u ^ (n + 1) = l <+ u ^ n <+ u := by + rw [pow_succ_list, listblank_append_assoc] + +theorem left_pow_succ_right (l : ListBlank (Fin 2)) (u : List (Fin 2)) (n : Nat) : + l <+ u ^ (n + 1) = l <+ u <+ u ^ n := by + rw [pow_succ_right, listblank_append_assoc] + +theorem right_pow_add (u : List (Fin 2)) (n m : Nat) (r : ListBlank (Fin 2)) : + u ^ (n + m) +> r = u ^ n +> (u ^ m +> r) := by + rw [list_pow_add, listblank_append_assoc] + +theorem right_pow_succ (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + u ^ (n + 1) +> r = u +> (u ^ n +> r) := by + rw [pow_succ_list, listblank_append_assoc] + +theorem right_pow_succ_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + u ^ (n + 1) +> r = u ^ n +> (u +> r) := by + rw [pow_succ_right, listblank_append_assoc] + +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +@[simp] theorem zero_cons_default : (0 : Fin 2) >> (default : ListBlank (Fin 2)) = default := by + change ListBlank.cons default default = default + exact ListBlank.cons_head_tail default + +@[simp] theorem init_nil : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = + ⟨some A, ⟨0, default, default⟩⟩ := rfl + +def ones : List (Fin 2) := [1] +def ld0 : List (Fin 2) := [0, 1, 1, 0, 1, 1] +def ld1 : List (Fin 2) := [0, 1, 1, 1, 1, 1] +def ldh : ListBlank (Fin 2) := default <+ [1] +def rd0 : List (Fin 2) := [0, 0, 0] +def rd1 : List (Fin 2) := [1, 0, 0] +def Half (b : Fin 2) : List (Fin 2) := [b, 1, 1] +def Opp (b : Fin 2) : Fin 2 := if b = 0 then 1 else 0 +def Marked : List (Fin 2) → List (Fin 2) + | [] => [] + | b :: bs => Half b ++ Half 1 ++ Marked bs +def s_tag : List (Fin 2) := [1, 0, 1, 1] +def t_tag : List (Fin 2) := [1, 1, 1, 1] +def cut_tag : List (Fin 2) := [0, 1, 1, 1] + +theorem fin2_cases (b : Fin 2) : b = 0 ∨ b = 1 := by + rcases b with ⟨_ | ⟨_ | n⟩, hlt⟩ + · left; rfl + · right; rfl + · omega + +macro "step1" : tactic => `(tactic| ( + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, init_nil, ones, ld0, ld1, ldh, rd0, rd1, Half, Opp, s_tag, t_tag, cut_tag, + pow_succ_list, pow_zero_list, + List.singleton_append, List.nil_append, List.cons_append, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail] + refine multiStep_step (by rfl) ?_ + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Tape.write, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail])) + +macro "run_steps" n:num : tactic => `(tactic| ( + iterate $n step1 + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, ones, ld0, ld1, ldh, rd0, rd1, Half, Opp, s_tag, t_tag, cut_tag, + pow_succ_list, pow_zero_list, + List.singleton_append, List.nil_append, List.cons_append, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail, multiStep_zero] + rfl)) + +-- ============================================================================ +-- Section 1: Word & Power Commutation Identities +-- ============================================================================ + +theorem left_ld0_eq (l : ListBlank (Fin 2)) : l <+ ld0 = l <+ Half 0 <+ Half 0 := rfl +theorem left_ld1_eq (l : ListBlank (Fin 2)) : l <+ ld1 = l <+ Half 1 <+ Half 0 := rfl + +theorem half0_pairs (n : Nat) : (Half 0) ^ (n * 2) = ld0 ^ n := by + induction n with + | zero => rfl + | succ n ih => + rw [show (n + 1) * 2 = 2 + n * 2 by omega, list_pow_add, ih] + rfl + +theorem half0_pairs_two_mul (n : Nat) : (Half 0) ^ (2 * n) = ld0 ^ n := by + rw [Nat.mul_comm 2 n, half0_pairs] + +theorem half0_comm_ld0_pow (n : Nat) (l : ListBlank (Fin 2)) : + l <+ ld0 ^ n <+ Half 0 = l <+ Half 0 <+ ld0 ^ n := by + induction n generalizing l with + | zero => rfl + | succ n ih => + rw [left_pow_succ_right l ld0 n, ih (l <+ ld0), left_pow_succ_right (l <+ Half 0) ld0 n] + rfl + +theorem one_comm_half1_pow (n : Nat) (l : ListBlank (Fin 2)) : + l <+ (Half 1) ^ n <+ [1] = l <+ [1] <+ (Half 1) ^ n := by + induction n generalizing l with + | zero => rfl + | succ n ih => + rw [left_pow_succ_right l (Half 1) n, ih (l <+ Half 1), left_pow_succ_right (l <+ [1]) (Half 1) n] + rfl + +theorem one_comm_ones_pow (n : Nat) (r : ListBlank (Fin 2)) : + ones ^ n +> ([1] +> r) = [1] +> (ones ^ n +> r) := by + change ones ^ n +> (ones +> r) = ones +> (ones ^ n +> r) + rw [← right_pow_succ_right, ← right_pow_succ] + +-- ============================================================================ +-- Section 2: Constant-Step & Inductive Machine Rules (TM4) +-- ============================================================================ + +theorem LInc_zero (l r : ListBlank (Fin 2)) : + ((l <+ ld0) <{B}| r) [target_tm]⊢⁺ ((l <+ ld1) |{A}> r) := + ⟨9, by omega, by run_steps 9⟩ + +theorem RInc_zero (l r : ListBlank (Fin 2)) : + (l |{A}> ([0] +> r)) [target_tm]⊢⁺ (l <{B}| ([1] +> r)) := + ⟨1, by omega, by run_steps 1⟩ + +theorem ECarry (l r : ListBlank (Fin 2)) (b : Fin 2) : + ((l <+ Half 1 <+ Half b) <{E}| ([0] +> r)) [target_tm]⊢⁺ + (l <{E}| ([0] +> (ones ^ 6 +> r))) := by + rcases fin2_cases b with rfl | rfl + · exact ⟨14, by omega, by run_steps 14⟩ + · exact ⟨12, by omega, by run_steps 12⟩ + +theorem EStop (l r : ListBlank (Fin 2)) (b : Fin 2) : + ((l <+ Half 0 <+ Half b) <{E}| ([0] +> r)) [target_tm]⊢⁺ + ((l <+ Half 1 <+ s_tag) |{D}> r) := by + rcases fin2_cases b with rfl | rfl + · exact ⟨14, by omega, by run_steps 14⟩ + · exact ⟨12, by omega, by run_steps 12⟩ + +theorem SOnes_step (l r : ListBlank (Fin 2)) : + ((l <+ s_tag) |{D}> (ones ^ 6 +> r)) [target_tm]⊢⁺ + ((l <+ ld0 <+ s_tag) |{D}> r) := + ⟨6, by omega, by run_steps 6⟩ + +theorem SOnes (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ s_tag) |{D}> (ones ^ (n * 6) +> r)) [target_tm]⊢* + ((l <+ ld0 ^ n <+ s_tag) |{D}> r) := by + induction n generalizing l with + | zero => try exact stepStar_refl _ + | succ n ih => + rw [show (n + 1) * 6 = 6 + n * 6 by omega, right_pow_add ones 6 (n * 6) r, + left_pow_succ_right l ld0 n] + exact stepStar_trans (stepPlus_to_stepStar (SOnes_step l (ones ^ (n * 6) +> r))) (ih (l <+ ld0)) + +theorem S100 (l r : ListBlank (Fin 2)) : + ((l <+ s_tag) |{D}> ([1, 0, 0] +> r)) [target_tm]⊢⁺ + ((l <+ Half 1 <+ s_tag) |{D}> r) := + ⟨15, by omega, by run_steps 15⟩ + +theorem T100 (l r : ListBlank (Fin 2)) : + ((l <+ t_tag) |{D}> ([1, 0, 0] +> r)) [target_tm]⊢⁺ + (l <{E}| ([0] +> (ones ^ 6 +> r))) := + ⟨15, by omega, by run_steps 15⟩ + +theorem S000 (l r : ListBlank (Fin 2)) (b : Fin 2) : + ((l <+ Half b <+ s_tag) |{D}> ([0, 0, 0] +> r)) [target_tm]⊢⁺ + (l <{E}| ([0] +> (ones ^ 5 +> ([Opp b, 0, 0, 1] +> r)))) := by + rcases fin2_cases b with rfl | rfl + · exact ⟨26, by omega, by run_steps 26⟩ + · exact ⟨16, by omega, by run_steps 16⟩ + +theorem S000_end (l r : ListBlank (Fin 2)) (b : Fin 2) : + ((l <+ s_tag) |{D}> (ones ^ 5 +> ([Opp b, 0, 0, 1] +> r))) [target_tm]⊢⁺ + ((l <+ Half 0 <+ Half b <+ Half 0 <+ t_tag) |{D}> r) := by + rcases fin2_cases b with rfl | rfl + · exact ⟨9, by omega, by run_steps 9⟩ + · exact ⟨19, by omega, by run_steps 19⟩ + +theorem MarkedCarry (l r : ListBlank (Fin 2)) (bs : List (Fin 2)) : + ((l <+ Marked bs) <{E}| ([0] +> r)) [target_tm]⊢* + (l <{E}| ([0] +> (ones ^ (bs.length * 6) +> r))) := by + induction bs generalizing l r with + | nil => try exact stepStar_refl _ + | cons b bs ih => + have hM : l <+ Marked (b :: bs) = l <+ Marked bs <+ Half 1 <+ Half b := by + simp [Marked, List.append_assoc] + rw [hM, List.length_cons, show (bs.length + 1) * 6 = bs.length * 6 + 6 by omega, + right_pow_add ones (bs.length * 6) 6 r] + exact stepStar_trans (stepPlus_to_stepStar (ECarry (l <+ Marked bs) r b)) (ih l (ones ^ 6 +> r)) + +theorem ECarry_ld1 (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ ld1 ^ n) <{E}| ([0] +> r)) [target_tm]⊢* + (l <{E}| ([0] +> (ones ^ (n * 6) +> r))) := by + induction n generalizing r with + | zero => try exact stepStar_refl _ + | succ n ih => + rw [left_pow_succ l ld1 n, left_ld1_eq, show (n + 1) * 6 = n * 6 + 6 by omega, + right_pow_add ones (n * 6) 6 r] + exact stepStar_trans (stepPlus_to_stepStar (ECarry (l <+ ld1 ^ n) r 0)) (ih (ones ^ 6 +> r)) + +theorem ECarry_half1_pair (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ (Half 1) ^ (n * 2)) <{E}| ([0] +> r)) [target_tm]⊢* + (l <{E}| ([0] +> (ones ^ (n * 6) +> r))) := by + induction n generalizing r with + | zero => try exact stepStar_refl _ + | succ n ih => + rw [show (n + 1) * 2 = 2 + n * 2 by omega, left_pow_add l (Half 1) 2 (n * 2), + show (Half 1) ^ 2 = Half 1 ++ Half 1 by rfl, listblank_append_assoc, + show (n + 1) * 6 = n * 6 + 6 by omega, right_pow_add ones (n * 6) 6 r] + exact stepStar_trans (stepPlus_to_stepStar (ECarry (l <+ (Half 1) ^ (n * 2)) r 1)) (ih (ones ^ 6 +> r)) + +theorem TStart (l r : ListBlank (Fin 2)) : + ((l <+ t_tag) |{D}> ([0, 0, 0] +> r)) [target_tm]⊢⁺ + ((l <+ Half 1 <+ Half 1) <{B}| ([1] +> r)) := + ⟨3, by omega, by run_steps 3⟩ + +theorem LOnes_step (l r : ListBlank (Fin 2)) : + ((l <+ Half 1) <{B}| r) [target_tm]⊢⁺ + (l <{B}| (rd0 +> r)) := + ⟨3, by omega, by run_steps 3⟩ + +theorem LOnes (l r : ListBlank (Fin 2)) (h : Nat) : + ((l <+ (Half 1) ^ h) <{B}| r) [target_tm]⊢* + (l <{B}| (rd0 ^ h +> r)) := by + induction h generalizing r with + | zero => try exact stepStar_refl _ + | succ h ih => + rw [left_pow_succ l (Half 1) h, right_pow_succ_right rd0 h r] + exact stepStar_trans (stepPlus_to_stepStar (LOnes_step (l <+ (Half 1) ^ h) r)) (ih (rd0 +> r)) + +theorem TZeroEntry (l r : ListBlank (Fin 2)) (h : Nat) : + ((l <+ Half 0 <+ (Half 1) ^ h <+ t_tag) |{D}> ([0, 0, 0] +> r)) [target_tm]⊢⁺ + ((l <+ Half 0) <{B}| (rd0 ^ (h + 2) +> ([1] +> r))) := by + have s1 := TStart (l <+ Half 0 <+ (Half 1) ^ h) r + have s2 := LOnes (l <+ Half 0) ([1] +> r) (h + 2) + have heq : l <+ Half 0 <+ (Half 1) ^ (h + 2) = + l <+ Half 0 <+ (Half 1) ^ h <+ Half 1 <+ Half 1 := by + rw [show h + 2 = 2 + h by omega, left_pow_add (l <+ Half 0) (Half 1) 2 h, + show (Half 1) ^ 2 = Half 1 ++ Half 1 by rfl, listblank_append_assoc] + rw [heq] at s2 + exact stepPlus_stepStar_trans s1 s2 + +theorem LBAtoE (l r : ListBlank (Fin 2)) : + ((l <+ Half 1 <+ Half 0) <{B}| r) [target_tm]⊢⁺ + (l <{E}| ([0] +> (ones ^ 5 +> r))) := + ⟨10, by omega, by run_steps 10⟩ + +theorem SFive (l r : ListBlank (Fin 2)) : + ((l <+ s_tag) |{D}> (ones ^ 5 +> r)) [target_tm]⊢⁺ + ((l <+ Half 0 <+ Half 0 <+ Half 0) |{A}> r) := + ⟨5, by omega, by run_steps 5⟩ + +theorem R100Scan_step (l r : ListBlank (Fin 2)) : + (l |{A}> (rd1 +> r)) [target_tm]⊢⁺ + ((l <+ Half 1) |{A}> r) := + ⟨3, by omega, by run_steps 3⟩ + +theorem R100Scan (l r : ListBlank (Fin 2)) (n : Nat) : + (l |{A}> (rd1 ^ n +> r)) [target_tm]⊢* + ((l <+ (Half 1) ^ n) |{A}> r) := by + induction n generalizing l with + | zero => try exact stepStar_refl _ + | succ n ih => + rw [right_pow_succ rd1 n r, left_pow_succ_right l (Half 1) n] + exact stepStar_trans (stepPlus_to_stepStar (R100Scan_step l (rd1 ^ n +> r))) (ih (l <+ Half 1)) + +theorem RExit_step (l r : ListBlank (Fin 2)) : + ((l <+ Half 1) |{A}> ([1] +> r)) [target_tm]⊢⁺ + ((l <+ t_tag) |{D}> r) := + ⟨1, by omega, by run_steps 1⟩ + +theorem RExit (l r : ListBlank (Fin 2)) (h : Nat) : + (l |{A}> (rd1 ^ (h + 2) +> ([1] +> r))) [target_tm]⊢⁺ + ((l <+ (Half 1) ^ (h + 1) <+ t_tag) |{D}> r) := by + have s1 := R100Scan l ([1] +> r) (h + 2) + rw [left_pow_succ l (Half 1) (h + 1)] at s1 + exact stepStar_stepPlus_trans s1 (RExit_step (l <+ (Half 1) ^ (h + 1)) r) + +theorem R111Scan_step (l r : ListBlank (Fin 2)) : + (l |{A}> ([1, 1, 1] +> r)) [target_tm]⊢⁺ + ((l <+ Half 0) |{A}> r) := + ⟨3, by omega, by run_steps 3⟩ + +theorem R111Scan (l r : ListBlank (Fin 2)) (n : Nat) : + (l |{A}> (ones ^ (n * 3) +> r)) [target_tm]⊢* + ((l <+ (Half 0) ^ n) |{A}> r) := by + induction n generalizing l with + | zero => try exact stepStar_refl _ + | succ n ih => + rw [show (n + 1) * 3 = 3 + n * 3 by omega, right_pow_add ones 3 (n * 3) r, + show ones ^ 3 = [1, 1, 1] by rfl, left_pow_succ_right l (Half 0) n] + exact stepStar_trans (stepPlus_to_stepStar (R111Scan_step l (ones ^ (n * 3) +> r))) (ih (l <+ Half 0)) + +theorem RInc_rule (l r : ListBlank (Fin 2)) (n : Nat) : + (l |{A}> (rd1 ^ n +> ([0] +> r))) [target_tm]⊢⁺ + (l <{B}| (rd0 ^ n +> ([1] +> r))) := by + have s1 := R100Scan l ([0] +> r) n + have s2 := RInc_zero (l <+ (Half 1) ^ n) r + have s3 := LOnes l ([1] +> r) n + exact stepStar_stepPlus_trans s1 (stepPlus_stepStar_trans s2 s3) + +theorem EEven_entry (r : ListBlank (Fin 2)) : + (ldh <{E}| ([0] +> r)) [target_tm]⊢⁺ + (ldh |{A}> ([1, 1] +> r)) := + ⟨4, by omega, by run_steps 4⟩ + +theorem EEven (r : ListBlank (Fin 2)) (n : Nat) : + (ldh <{E}| ([0] +> (ones ^ (n * 6 + 5) +> r))) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (n + 1)) |{A}> ([1] +> r)) := by + have s1 := EEven_entry (ones ^ (n * 6 + 5) +> r) + have h1 : ([1, 1] : List (Fin 2)) +> (ones ^ (n * 6 + 5) +> r) = + ones ^ (((n + 1) * 2) * 3) +> ([1] +> r) := by + change ones ^ 2 +> (ones ^ (n * 6 + 5) +> r) = + ones ^ (((n + 1) * 2) * 3) +> (ones +> r) + rw [← right_pow_add, ← right_pow_succ_right] + have : 2 + (n * 6 + 5) = (n + 1) * 2 * 3 + 1 := by omega + rw [this] + rw [h1] at s1 + have s2 := R111Scan ldh ([1] +> r) ((n + 1) * 2) + rw [half0_pairs (n + 1)] at s2 + exact stepPlus_stepStar_trans s1 s2 + +theorem LOv (r : ListBlank (Fin 2)) (n : Nat) : + ((ldh <+ ld1 ^ (1 + n)) <{B}| r) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (1 + n)) |{A}> ([1] +> r)) := by + rw [Nat.add_comm 1 n, left_pow_succ ldh ld1 n, left_ld1_eq] + have s1 := LBAtoE (ldh <+ ld1 ^ n) r + have s2 := ECarry_ld1 ldh (ones ^ 5 +> r) n + rw [← right_pow_add] at s2 + exact stepPlus_trans s1 (stepStar_stepPlus_trans s2 (EEven r n)) + +theorem R1100Turn (l r : ListBlank (Fin 2)) : + (l |{A}> ([1, 1, 0, 0] +> r)) [target_tm]⊢⁺ + ((l <+ Half 0) <{B}| ([1] +> r)) := + ⟨6, by omega, by run_steps 6⟩ + +theorem ROvOddRecover (l r : ListBlank (Fin 2)) (a m : Nat) : + ((l <+ ld0 <+ ld1 ^ a) |{A}> (rd1 ^ (m * 2 + 1) +> ([1, 1, 0, 0] +> r))) [target_tm]⊢⁺ + ((l <+ ld1 <+ ld0 ^ (m + a + 1)) |{A}> ([1] +> r)) := by + have s1 := R100Scan (l <+ ld0 <+ ld1 ^ a) ([1, 1, 0, 0] +> r) (m * 2 + 1) + have s2 := R1100Turn (l <+ ld0 <+ ld1 ^ a <+ (Half 1) ^ (m * 2 + 1)) r + rw [left_pow_succ (l <+ ld0 <+ ld1 ^ a) (Half 1) (m * 2)] at s2 + have s3 := LBAtoE (l <+ ld0 <+ ld1 ^ a <+ (Half 1) ^ (m * 2)) ([1] +> r) + have s4 := ECarry_half1_pair (l <+ ld0 <+ ld1 ^ a) (ones ^ 5 +> ([1] +> r)) m + have s5 := ECarry_ld1 (l <+ ld0) (ones ^ (m * 6) +> (ones ^ 5 +> ([1] +> r))) a + have h_ones : ones ^ (a * 6) +> (ones ^ (m * 6) +> (ones ^ 5 +> ([1] +> r))) = + ones ^ ((m + a) * 6) +> (ones ^ 5 +> ([1] +> r)) := by + rw [← right_pow_add, show a * 6 + m * 6 = (m + a) * 6 by omega] + rw [h_ones] at s5 + have s6 := EStop l (ones ^ ((m + a) * 6) +> (ones ^ 5 +> ([1] +> r))) 0 + rw [← left_ld0_eq] at s6 + have s7 := SOnes (l <+ Half 1) (ones ^ 5 +> ([1] +> r)) (m + a) + have s8 := SFive (l <+ Half 1 <+ ld0 ^ (m + a)) ([1] +> r) + have heq : l <+ Half 1 <+ ld0 ^ (m + a) <+ Half 0 <+ Half 0 <+ Half 0 = + l <+ ld1 <+ ld0 ^ (m + a + 1) := by + rw [half0_comm_ld0_pow (m + a) (l <+ Half 1), ← left_ld1_eq, ← left_ld0_eq, ← left_pow_succ (l <+ ld1) ld0 (m + a)] + rw [heq] at s8 + exact stepStar_stepPlus_trans s1 + (stepPlus_trans s2 + (stepPlus_trans s3 + (stepStar_stepPlus_trans s4 + (stepStar_stepPlus_trans s5 + (stepPlus_trans s6 + (stepStar_stepPlus_trans s7 s8)))))) + +theorem ROvEven_entry (l r : ListBlank (Fin 2)) : + (l |{A}> ([1, 1, 0, 0] +> r)) [target_tm]⊢⁺ + ((l <+ [1]) <{E}| ([0] +> ([1, 1] +> r))) := + ⟨8, by omega, by run_steps 8⟩ + +theorem E01_exit (l r : ListBlank (Fin 2)) : + ((l <+ [1, 0]) <{E}| ([0] +> r)) [target_tm]⊢⁺ + ((l <+ [1]) |{A}> ([1, 1] +> r)) := + ⟨4, by omega, by run_steps 4⟩ + +theorem B_four_ones_to_s (l r : ListBlank (Fin 2)) : + (l |{A}> ([1, 1, 1, 1] +> r)) [target_tm]⊢⁺ + ((l <+ s_tag) |{D}> r) := + ⟨4, by omega, by run_steps 4⟩ + +theorem ROvEvenAux (l r : ListBlank (Fin 2)) (m : Nat) : + ((l <+ [0]) |{A}> (rd1 ^ (m * 2) +> ([1, 1, 0, 0] +> r))) [target_tm]⊢⁺ + ((l <+ [1] <+ ld0 ^ m <+ s_tag) |{D}> r) := by + have s1 := R100Scan (l <+ [0]) ([1, 1, 0, 0] +> r) (m * 2) + have s2 := ROvEven_entry (l <+ [0] <+ (Half 1) ^ (m * 2)) r + have h1 : l <+ [0] <+ (Half 1) ^ (m * 2) <+ [1] = + l <+ [1, 0] <+ (Half 1) ^ (m * 2) := by + rw [one_comm_half1_pow (m * 2) (l <+ [0])] + rfl + rw [h1] at s2 + have s3 := ECarry_half1_pair (l <+ [1, 0]) ([1, 1] +> r) m + have s4 := E01_exit l (ones ^ (m * 6) +> ([1, 1] +> r)) + have h2 : ([1, 1] : List (Fin 2)) +> (ones ^ (m * 6) +> ([1, 1] +> r)) = + ones ^ ((m * 2) * 3) +> ([1, 1, 1, 1] +> r) := by + change ones ^ 2 +> (ones ^ (m * 6) +> (ones ^ 2 +> r)) = + ones ^ ((m * 2) * 3) +> (ones ^ 4 +> r) + rw [← right_pow_add, ← right_pow_add, ← right_pow_add] + have : 2 + m * 6 + 2 = m * 2 * 3 + 4 := by omega + rw [this] + rw [h2] at s4 + have s5 := R111Scan (l <+ [1]) ([1, 1, 1, 1] +> r) (m * 2) + rw [half0_pairs m] at s5 + have s6 := B_four_ones_to_s (l <+ [1] <+ ld0 ^ m) r + exact stepStar_stepPlus_trans s1 + (stepPlus_trans s2 + (stepStar_stepPlus_trans s3 + (stepPlus_trans s4 + (stepStar_stepPlus_trans s5 s6)))) + +theorem ROv101Odd_entry (l r : ListBlank (Fin 2)) : + ((l <+ Half 1) |{A}> ([1, 0, 1] +> r)) [target_tm]⊢⁺ + ((l <+ [1]) <{E}| ([0] +> ([1, 1, 1, 1] +> r))) := + ⟨11, by omega, by run_steps 11⟩ + +theorem ROv101Odd (l r : ListBlank (Fin 2)) (m : Nat) : + ((l <+ [0]) |{A}> (rd1 ^ (m * 2 + 1) +> ([1, 0, 1] +> r))) [target_tm]⊢⁺ + ((l <+ [1] <+ ld0 ^ (m + 1)) |{A}> r) := by + have s1 := R100Scan (l <+ [0]) ([1, 0, 1] +> r) (m * 2 + 1) + rw [left_pow_succ (l <+ [0]) (Half 1) (m * 2)] at s1 + have s2 := ROv101Odd_entry (l <+ [0] <+ (Half 1) ^ (m * 2)) r + have h1 : l <+ [0] <+ (Half 1) ^ (m * 2) <+ [1] = + l <+ [1, 0] <+ (Half 1) ^ (m * 2) := by + rw [one_comm_half1_pow (m * 2) (l <+ [0])] + rfl + rw [h1] at s2 + have s3 := ECarry_half1_pair (l <+ [1, 0]) ([1, 1, 1, 1] +> r) m + have s4 := E01_exit l (ones ^ (m * 6) +> ([1, 1, 1, 1] +> r)) + have h2 : ([1, 1] : List (Fin 2)) +> (ones ^ (m * 6) +> ([1, 1, 1, 1] +> r)) = + ones ^ (((m + 1) * 2) * 3) +> r := by + change ones ^ 2 +> (ones ^ (m * 6) +> (ones ^ 4 +> r)) = _ + rw [← right_pow_add, ← right_pow_add] + have : 2 + m * 6 + 4 = (m + 1) * 2 * 3 := by omega + rw [this] + rw [h2] at s4 + have s5 := R111Scan (l <+ [1]) r ((m + 1) * 2) + rw [half0_pairs (m + 1)] at s5 + exact stepStar_stepPlus_trans s1 + (stepPlus_trans s2 + (stepStar_stepPlus_trans s3 + (stepPlus_stepStar_trans s4 s5))) + +theorem saturated_one (r : ListBlank (Fin 2)) : + ((ldh <+ ld0) |{A}> ([1] +> (rd0 +> (rd1 +> r)))) [target_tm]⊢⁺ + ((default <+ cut_tag <+ ld1) |{A}> ([1, 1, 1, 0, 0] +> r)) := + ⟨52, by omega, by run_steps 52⟩ + +theorem Cap_entry (l r : ListBlank (Fin 2)) : + (l |{A}> ([1, 1, 1, 0, 0] +> r)) [target_tm]⊢⁺ + ((l <+ [1]) <{E}| ([0] +> ([1, 1, 0] +> r))) := + ⟨6, by omega, by run_steps 6⟩ + +theorem OddCap_exit (l r : ListBlank (Fin 2)) : + ((l <+ ld1 <+ [1]) <{E}| ([0, 1] +> r)) [target_tm]⊢⁺ + ((l <+ [1, 1, 1] <+ ld1) |{A}> r) := + ⟨7, by omega, by run_steps 7⟩ + +theorem odd_capacity_entry (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ ld1) |{A}> (rd1 ^ (n * 2) +> ([1, 1, 1, 0, 0] +> r))) [target_tm]⊢⁺ + ((l <+ [1, 1, 1] <+ ld1 <+ ld0 ^ n) |{A}> ([1, 0] +> r)) := by + have s1 := R100Scan (l <+ ld1) ([1, 1, 1, 0, 0] +> r) (n * 2) + have s2 := Cap_entry (l <+ ld1 <+ (Half 1) ^ (n * 2)) r + rw [one_comm_half1_pow (n * 2) (l <+ ld1)] at s2 + have s3 := ECarry_half1_pair (l <+ ld1 <+ [1]) ([1, 1, 0] +> r) n + have h1 : ([0] : List (Fin 2)) +> (ones ^ (n * 6) +> ([1, 1, 0] +> r)) = + [0, 1] +> (ones ^ ((n * 2) * 3) +> ([1, 0] +> r)) := by + have : ones ^ (n * 6) +> ([1] +> ([1, 0] +> r)) = + [1] +> (ones ^ ((n * 2) * 3) +> ([1, 0] +> r)) := by + rw [one_comm_ones_pow (n * 6) ([1, 0] +> r), show n * 6 = n * 2 * 3 by omega] + simpa using! congrArg ((0 : Fin 2) >> ·) this + rw [h1] at s3 + have s4 := OddCap_exit l (ones ^ ((n * 2) * 3) +> ([1, 0] +> r)) + have s5 := R111Scan (l <+ [1, 1, 1] <+ ld1) ([1, 0] +> r) (n * 2) + rw [half0_pairs n] at s5 + exact stepStar_stepPlus_trans s1 + (stepPlus_trans s2 + (stepStar_stepPlus_trans s3 + (stepPlus_stepStar_trans s4 s5))) + +theorem EvenCap_mid (l r : ListBlank (Fin 2)) : + ((l <+ Half 1 <+ [1]) <{E}| ([0] +> r)) [target_tm]⊢⁺ + (l <{E}| ([0] +> ([1, 1, 1, 1] +> r))) := + ⟨8, by omega, by run_steps 8⟩ + +theorem EvenCap_exit (r : ListBlank (Fin 2)) : + ((default <+ cut_tag) <{E}| ([0] +> r)) [target_tm]⊢⁺ + (ldh |{A}> (ones ^ 6 +> r)) := + ⟨16, by omega, by run_steps 16⟩ + +theorem even_capacity_cleanup (n : Nat) (r : ListBlank (Fin 2)) : + ((default <+ cut_tag <+ ld1 ^ (2 + n * 2)) |{A}> + (rd1 ^ (1 + n * 2) +> ([1, 1, 1, 0, 0] +> r))) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (4 + n * 3)) |{A}> ([0] +> r)) := by + have s1 := R100Scan (default <+ cut_tag <+ ld1 ^ (2 + n * 2)) ([1, 1, 1, 0, 0] +> r) (1 + n * 2) + have s2 := Cap_entry (default <+ cut_tag <+ ld1 ^ (2 + n * 2) <+ (Half 1) ^ (1 + n * 2)) r + have h1 : default <+ cut_tag <+ ld1 ^ (2 + n * 2) <+ (Half 1) ^ (1 + n * 2) <+ [1] = + default <+ cut_tag <+ ld1 ^ (2 + n * 2) <+ Half 1 <+ [1] <+ (Half 1) ^ (n * 2) := by + rw [show 1 + n * 2 = n * 2 + 1 by omega, left_pow_succ_right, + one_comm_half1_pow (n * 2) (default <+ cut_tag <+ ld1 ^ (2 + n * 2) <+ Half 1)] + rw [h1] at s2 + have s3 := ECarry_half1_pair (default <+ cut_tag <+ ld1 ^ (2 + n * 2) <+ Half 1 <+ [1]) ([1, 1, 0] +> r) n + have s4 := EvenCap_mid (default <+ cut_tag <+ ld1 ^ (2 + n * 2)) (ones ^ (n * 6) +> ([1, 1, 0] +> r)) + have s5 := ECarry_ld1 (default <+ cut_tag) ([1, 1, 1, 1] +> (ones ^ (n * 6) +> ([1, 1, 0] +> r))) (2 + n * 2) + have s6 := EvenCap_exit (ones ^ ((2 + n * 2) * 6) +> ([1, 1, 1, 1] +> (ones ^ (n * 6) +> ([1, 1, 0] +> r)))) + have h2 : ones ^ 6 +> + (ones ^ ((2 + n * 2) * 6) +> ([1, 1, 1, 1] +> (ones ^ (n * 6) +> ([1, 1, 0] +> r)))) = + ones ^ (((4 + n * 3) * 2) * 3) +> ([0] +> r) := by + have h110 : ([1, 1, 0] : List (Fin 2)) +> r = ones ^ 2 +> ([0] +> r) := rfl + have h1111 : ([1, 1, 1, 1] : List (Fin 2)) = ones ^ 4 := rfl + rw [h110, h1111, ← right_pow_add, ← right_pow_add, ← right_pow_add, ← right_pow_add] + have : 6 + (2 + n * 2) * 6 + 4 + n * 6 + 2 = (4 + n * 3) * 2 * 3 := by omega + rw [this] + rw [h2] at s6 + have s7 := R111Scan ldh ([0] +> r) ((4 + n * 3) * 2) + rw [half0_pairs (4 + n * 3)] at s7 + exact stepStar_stepPlus_trans s1 + (stepPlus_trans s2 + (stepStar_stepPlus_trans s3 + (stepPlus_trans s4 + (stepStar_stepPlus_trans s5 + (stepPlus_stepStar_trans s6 s7))))) + +theorem SZeroEntry (l r : ListBlank (Fin 2)) : + ((l <+ s_tag) |{D}> ([0, 0, 0] +> r)) [target_tm]⊢⁺ + ((l <+ Half 0) <{B}| ([0, 0, 0, 1] +> r)) := + ⟨6, by omega, by run_steps 6⟩ + +theorem R11Bit (l r : ListBlank (Fin 2)) (b : Fin 2) : + (l |{A}> ([1, 1, b, 0, 0] +> r)) [target_tm]⊢⁺ + ((l <+ Half 0) <{B}| ([1, 0] +> r)) := by + rcases fin2_cases b with rfl | rfl + · exact ⟨6, by omega, by run_steps 6⟩ + · exact ⟨4, by omega, by run_steps 4⟩ + +theorem EHalfBoundary (r : ListBlank (Fin 2)) (b : Fin 2) : + ((ldh <+ Half b) <{E}| ([0] +> r)) [target_tm]⊢⁺ + (ldh |{A}> (ones ^ 6 +> r)) := by + rcases fin2_cases b with rfl | rfl + · exact ⟨16, by omega, by run_steps 16⟩ + · exact ⟨14, by omega, by run_steps 14⟩ + +theorem EOdd (r : ListBlank (Fin 2)) (n : Nat) (b : Fin 2) : + ((ldh <+ Half b) <{E}| ([0] +> (ones ^ (n * 6 + 5) +> r))) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (n + 1) <+ Half 0) |{A}> ([1, 1] +> r)) := by + have s1 := EHalfBoundary (ones ^ (n * 6 + 5) +> r) b + have h1 : ones ^ 6 +> (ones ^ (n * 6 + 5) +> r) = + ones ^ (((n + 1) * 2 + 1) * 3) +> ([1, 1] +> r) := by + have h11 : ([1, 1] : List (Fin 2)) +> r = ones ^ 2 +> r := rfl + rw [h11, ← right_pow_add, ← right_pow_add] + have : 6 + (n * 6 + 5) = ((n + 1) * 2 + 1) * 3 + 2 := by omega + rw [this] + rw [h1] at s1 + have s2 := R111Scan ldh ([1, 1] +> r) ((n + 1) * 2 + 1) + rw [left_pow_succ, half0_pairs (n + 1)] at s2 + exact stepPlus_stepStar_trans s1 s2 + +theorem LSingle (r : ListBlank (Fin 2)) : + ((ldh <+ Half 0) <{B}| r) [target_tm]⊢⁺ + ((ldh <+ Half 0) |{A}> ([1, 1] +> r)) := + ⟨15, by omega, by run_steps 15⟩ + +theorem LZeroEven (r : ListBlank (Fin 2)) (bs : List (Fin 2)) : + ((ldh <+ Marked bs <+ Half 1 <+ Half 0) <{B}| r) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (bs.length + 1)) |{A}> ([1] +> r)) := by + have s1 := LBAtoE (ldh <+ Marked bs) r + have s2 := MarkedCarry ldh (ones ^ 5 +> r) bs + rw [← right_pow_add] at s2 + exact stepPlus_trans s1 (stepStar_stepPlus_trans s2 (EEven r bs.length)) + +theorem LZeroOdd (r : ListBlank (Fin 2)) (bs : List (Fin 2)) (b : Fin 2) : + ((ldh <+ Half b <+ Marked bs <+ Half 1 <+ Half 0) <{B}| r) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (bs.length + 1) <+ Half 0) |{A}> ([1, 1] +> r)) := by + have s1 := LBAtoE (ldh <+ Half b <+ Marked bs) r + have s2 := MarkedCarry (ldh <+ Half b) (ones ^ 5 +> r) bs + rw [← right_pow_add] at s2 + exact stepPlus_trans s1 (stepStar_stepPlus_trans s2 (EOdd r bs.length b)) + +theorem R101Even_entry (l r : ListBlank (Fin 2)) : + (l |{A}> ([1, 0, 1, 0, 0] +> r)) [target_tm]⊢⁺ + (l <{E}| ([0] +> ([1, 1, 0, 0] +> r))) := + ⟨7, by omega, by run_steps 7⟩ + +theorem E0_to_C (l r : ListBlank (Fin 2)) : + ((l <+ [0]) <{E}| ([0] +> r)) [target_tm]⊢⁺ + ((l <+ [0]) <{B}| ([1] +> r)) := + ⟨4, by omega, by run_steps 4⟩ + +theorem R101EvenEntry (l r : ListBlank (Fin 2)) (m : Nat) : + ((l <+ [0]) |{A}> (rd1 ^ (m * 2) +> ([1, 0, 1, 0, 0] +> r))) [target_tm]⊢⁺ + ((l <+ [0]) <{B}| (ones ^ (m * 6 + 3) +> ([0, 0] +> r))) := by + have s1 := R100Scan (l <+ [0]) ([1, 0, 1, 0, 0] +> r) (m * 2) + have s2 := R101Even_entry (l <+ [0] <+ (Half 1) ^ (m * 2)) r + have s3 := ECarry_half1_pair (l <+ [0]) ([1, 1, 0, 0] +> r) m + have s4 := E0_to_C l (ones ^ (m * 6) +> ([1, 1, 0, 0] +> r)) + have h1 : ([1] : List (Fin 2)) +> (ones ^ (m * 6) +> ([1, 1, 0, 0] +> r)) = + ones ^ (m * 6 + 3) +> ([0, 0] +> r) := by + have h1100 : ([1, 1, 0, 0] : List (Fin 2)) +> r = ones ^ 2 +> ([0, 0] +> r) := rfl + have h1_pow : ([1] : List (Fin 2)) +> (ones ^ (m * 6) +> (ones ^ 2 +> ([0, 0] +> r))) = + ones ^ 1 +> (ones ^ (m * 6) +> (ones ^ 2 +> ([0, 0] +> r))) := rfl + rw [h1100, h1_pow, ← right_pow_add, ← right_pow_add] + have : 1 + m * 6 + 2 = m * 6 + 3 := by omega + rw [this] + rw [h1] at s4 + exact stepStar_stepPlus_trans s1 + (stepPlus_trans s2 + (stepStar_stepPlus_trans s3 s4)) + +theorem init_to_seed : + (init []) [target_tm]⊢* + ((ldh <+ ld0 ^ 1) |{A}> ([1] +> (rd0 +> (rd1 +> default)))) := + ⟨64, by run_steps 64⟩ + + +-- ============================================================================ +-- Section 3: Right Counter (Pair45Right) +-- ============================================================================ + +@[simp] theorem rd0_append_default : rd0 +> (default : ListBlank (Fin 2)) = default := by + simp [rd0] + +inductive RC : Nat → ListBlank (Fin 2) → Prop + | zero : RC 0 default + | d0 (n : Nat) (r : ListBlank (Fin 2)) : RC n r → RC (n * 2) (rd0 +> r) + | d1 (n : Nat) (r : ListBlank (Fin 2)) : RC n r → RC (1 + n * 2) (rd1 +> r) + +inductive FC (tail : ListBlank (Fin 2)) : Nat → Nat → ListBlank (Fin 2) → Prop + | nil : FC tail 0 0 tail + | d0 (k n : Nat) (r : ListBlank (Fin 2)) : FC tail k n r → FC tail (k + 1) (n * 2) (rd0 +> r) + | d1 (k n : Nat) (r : ListBlank (Fin 2)) : FC tail k n r → FC tail (k + 1) (1 + n * 2) (rd1 +> r) + +theorem RC_eq {n m : Nat} {r s : ListBlank (Fin 2)} (h : RC n r) (hn : n = m) (hr : r = s) : + RC m s := by + subst hn; subst hr; exact h + +theorem FC_eq {tail : ListBlank (Fin 2)} {k k' n n' : Nat} {r r' : ListBlank (Fin 2)} + (h : FC tail k n r) (hk : k = k') (hn : n = n') (hr : r = r') : + FC tail k' n' r' := by + subst hk; subst hn; subst hr; exact h + +theorem RC_zero_unique {r : ListBlank (Fin 2)} (h : RC 0 r) : r = default := by + generalize hn : (0 : Nat) = n at h + induction h with + | zero => rfl + | d0 n r _ ih => + have hn0 : n = 0 := by omega + rw [ih hn0.symm, rd0_append_default] + | d1 _ _ _ _ => omega + +theorem RC_inv_d0 {n : Nat} {s : ListBlank (Fin 2)} (hs : RC (n * 2) s) : + (n = 0 ∧ s = default) ∨ ∃ s0, s = rd0 +> s0 ∧ RC n s0 := by + generalize hm : n * 2 = m at hs + cases hs with + | zero => exact Or.inl ⟨by omega, rfl⟩ + | d0 n0 s0 hs0 => + have hn : n0 = n := by omega + subst hn + exact Or.inr ⟨s0, rfl, hs0⟩ + | d1 _ _ _ => omega + +theorem RC_inv_d1 {n : Nat} {s : ListBlank (Fin 2)} (hs : RC (1 + n * 2) s) : + ∃ s0, s = rd1 +> s0 ∧ RC n s0 := by + generalize hm : 1 + n * 2 = m at hs + cases hs with + | zero => omega + | d0 _ _ _ => omega + | d1 n0 s0 hs0 => + have hn : n0 = n := by omega + subst hn + exact ⟨s0, rfl, hs0⟩ + +theorem FC_inv_nil {tail : ListBlank (Fin 2)} {n : Nat} {s : ListBlank (Fin 2)} + (hs : FC tail 0 n s) : s = tail := by + generalize hk : (0 : Nat) = k at hs + cases hs with + | nil => rfl + | d0 _ _ _ _ => omega + | d1 _ _ _ _ => omega + +theorem FC_inv_d0 {tail : ListBlank (Fin 2)} {k n : Nat} {s : ListBlank (Fin 2)} + (hs : FC tail (k + 1) (n * 2) s) : ∃ s0, s = rd0 +> s0 ∧ FC tail k n s0 := by + generalize hk : k + 1 = K, hm : n * 2 = m at hs + cases hs with + | nil => omega + | d0 k0 n0 s0 hs0 => + have hk0 : k0 = k := by omega + have hn0 : n0 = n := by omega + subst hk0; subst hn0 + exact ⟨s0, rfl, hs0⟩ + | d1 _ _ _ _ => omega + +theorem FC_inv_d1 {tail : ListBlank (Fin 2)} {k n : Nat} {s : ListBlank (Fin 2)} + (hs : FC tail (k + 1) (1 + n * 2) s) : ∃ s0, s = rd1 +> s0 ∧ FC tail k n s0 := by + generalize hk : k + 1 = K, hm : 1 + n * 2 = m at hs + cases hs with + | nil => omega + | d0 _ _ _ _ => omega + | d1 k0 n0 s0 hs0 => + have hk0 : k0 = k := by omega + have hn0 : n0 = n := by omega + subst hk0; subst hn0 + exact ⟨s0, rfl, hs0⟩ + +theorem RC_unique {n : Nat} {r s : ListBlank (Fin 2)} (hr : RC n r) (hs : RC n s) : r = s := by + induction hr generalizing s with + | zero => exact (RC_zero_unique hs).symm + | d0 n r hr ih => + rcases RC_inv_d0 hs with ⟨rfl, rfl⟩ | ⟨s0, rfl, hs0⟩ + · rw [RC_zero_unique hr, rd0_append_default] + · rw [ih hs0] + | d1 n r _ ih => + rcases RC_inv_d1 hs with ⟨s0, rfl, hs0⟩ + rw [ih hs0] + +theorem FC_unique {tail : ListBlank (Fin 2)} {k n : Nat} {r s : ListBlank (Fin 2)} + (hr : FC tail k n r) (hs : FC tail k n s) : r = s := by + induction hr generalizing s with + | nil => exact (FC_inv_nil hs).symm + | d0 k n r _ ih => + rcases FC_inv_d0 hs with ⟨s0, rfl, hs0⟩ + rw [ih hs0] + | d1 k n r _ ih => + rcases FC_inv_d1 hs with ⟨s0, rfl, hs0⟩ + rw [ih hs0] + +theorem pow2_pos (k : Nat) : 0 < 2 ^ k := Nat.two_pow_pos k + +theorem nat_even_or_odd (n : Nat) : (∃ m, n = 2 * m) ∨ (∃ m, n = 2 * m + 1) := by + induction n with + | zero => exact Or.inl ⟨0, rfl⟩ + | succ n ih => + rcases ih with ⟨m, rfl⟩ | ⟨m, rfl⟩ + · exact Or.inr ⟨m, rfl⟩ + · exact Or.inl ⟨m + 1, by omega⟩ + +theorem FC_zero (tail : ListBlank (Fin 2)) (k : Nat) : FC tail k 0 (rd0 ^ k +> tail) := by + induction k with + | zero => exact FC.nil + | succ k ih => + rw [right_pow_succ rd0 k tail] + exact FC_eq (FC.d0 k 0 (rd0 ^ k +> tail) ih) rfl (by omega) rfl + +theorem FC_full (tail : ListBlank (Fin 2)) (k : Nat) : FC tail k (2 ^ k - 1) (rd1 ^ k +> tail) := by + induction k with + | zero => exact FC.nil + | succ k ih => + have hp := pow2_pos k + rw [right_pow_succ rd1 k tail] + exact FC_eq (FC.d1 k (2 ^ k - 1) (rd1 ^ k +> tail) ih) rfl (by rw [Nat.pow_succ]; omega) rfl + +theorem FC_full_unique {tail : ListBlank (Fin 2)} {k : Nat} {r : ListBlank (Fin 2)} + (h : FC tail k (2 ^ k - 1) r) : r = rd1 ^ k +> tail := + FC_unique h (FC_full tail k) + +theorem FC_RC {tail : ListBlank (Fin 2)} {k n : Nat} {r : ListBlank (Fin 2)} {m : Nat} + (hf : FC tail k n r) (hr : RC m tail) : RC (n + 2 ^ k * m) r := by + induction hf with + | nil => + exact RC_eq hr (by omega) rfl + | d0 k n r _ ih => + exact RC_eq (RC.d0 (n + 2 ^ k * m) r ih) (by rw [Nat.pow_succ]; ring) rfl + | d1 k n r _ ih => + exact RC_eq (RC.d1 (n + 2 ^ k * m) r ih) (by rw [Nat.pow_succ]; ring) rfl + +theorem RC_zeros {n : Nat} {r : ListBlank (Fin 2)} (k : Nat) (hr : RC n r) : + RC (2 ^ k * n) (rd0 ^ k +> r) := by + simpa using! FC_RC (FC_zero r k) hr + +theorem RC_carry {n : Nat} {r : ListBlank (Fin 2)} (h : RC n r) : + ∃ (k : Nat) (s : ListBlank (Fin 2)), r = rd1 ^ k +> (rd0 +> s) ∧ RC (n + 1) (rd0 ^ k +> (rd1 +> s)) := by + induction h with + | zero => + refine ⟨(0 : Nat), default, ?_, ?_⟩ + · simp + · exact RC_eq (RC.d1 0 default RC.zero) (by omega) rfl + | d0 n r hr _ => + exact ⟨(0 : Nat), r, rfl, RC_eq (RC.d1 n r hr) (by omega) rfl⟩ + | d1 n r _ ih => + rcases ih with ⟨k, s, rfl, hs⟩ + refine ⟨k + 1, s, ?_, ?_⟩ + · rw [right_pow_succ rd1 k (rd0 +> s)] + · rw [right_pow_succ rd0 k (rd1 +> s)] + exact RC_eq (RC.d0 (n + 1) (rd0 ^ k +> (rd1 +> s)) hs) (by omega) rfl + +theorem RC_positive_split {n : Nat} {r : ListBlank (Fin 2)} (h : RC n r) (hn : 0 < n) : + ∃ t q s, r = rd0 ^ t +> (rd1 +> s) ∧ RC q s ∧ n = 2 ^ t * (1 + q * 2) ∧ q < n := by + induction h with + | zero => omega + | d0 n r _ ih => + rcases ih (by omega) with ⟨t, q, s, rfl, hs, heq, hlt⟩ + refine ⟨t + 1, q, s, ?_, hs, ?_, by omega⟩ + · rw [right_pow_succ rd0 t (rd1 +> s)] + · rw [Nat.pow_succ, heq]; ring + | d1 n r hr _ => + exact ⟨0, n, r, rfl, hr, by omega, by omega⟩ + +theorem FC_carry {tail : ListBlank (Fin 2)} {k n : Nat} {r : ListBlank (Fin 2)} + (h : FC tail k n r) (hb : n + 1 < 2 ^ k) : + ∃ j s, j < k ∧ r = rd1 ^ j +> (rd0 +> s) ∧ FC tail k (n + 1) (rd0 ^ j +> (rd1 +> s)) := by + induction h with + | nil => simp at hb + | d0 k n r hr _ => + exact ⟨0, r, by omega, rfl, FC_eq (FC.d1 k n r hr) rfl (by omega) rfl⟩ + | d1 k n r _ ih => + have hb' : n + 1 < 2 ^ k := by rw [Nat.pow_succ] at hb; omega + rcases ih hb' with ⟨j, s, hj, rfl, hs⟩ + refine ⟨j + 1, s, by omega, ?_, ?_⟩ + · rw [right_pow_succ rd1 j (rd0 +> s)] + · rw [right_pow_succ rd0 j (rd1 +> s)] + exact FC_eq (FC.d0 k (n + 1) (rd0 ^ j +> (rd1 +> s)) hs) rfl (by omega) rfl + +theorem RC_tail {n : Nat} {r : ListBlank (Fin 2)} (h : RC n r) : + ∃ (b : Fin 2) (s : ListBlank (Fin 2)), RC (n / 2) s ∧ r = [b, 0, 0] +> s := by + cases h with + | zero => exact ⟨0, default, RC.zero, rd0_append_default.symm⟩ + | d0 n s hs => exact ⟨0, s, RC_eq hs (by omega) rfl, rfl⟩ + | d1 n s hs => exact ⟨1, s, RC_eq hs (by omega) rfl, rfl⟩ + +theorem RScan (l r : ListBlank (Fin 2)) (k : Nat) : + (l |{A}> (rd1 ^ k +> (rd0 +> r))) [target_tm]⊢⁺ + (l <{B}| (rd0 ^ k +> (rd1 +> r))) := by + simpa [rd0, rd1] using! RInc_rule l ([0, 0] +> r) k + +theorem RInc_ex {n : Nat} {r : ListBlank (Fin 2)} (h : RC n r) : + ∃ s, RC (n + 1) s ∧ ∀ l, (l |{A}> r) [target_tm]⊢⁺ (l <{B}| s) := by + rcases RC_carry h with ⟨k, s, rfl, hs⟩ + exact ⟨rd0 ^ k +> (rd1 +> s), hs, fun l => RScan l s k⟩ + +theorem FiniteRInc_ex {tail : ListBlank (Fin 2)} {k n : Nat} {r : ListBlank (Fin 2)} + (h : FC tail k n r) (hb : n + 1 < 2 ^ k) : + ∃ s, FC tail k (n + 1) s ∧ ∀ l, (l |{A}> r) [target_tm]⊢⁺ (l <{B}| s) := by + rcases FC_carry h hb with ⟨j, s, _, rfl, hs⟩ + exact ⟨rd0 ^ j +> (rd1 +> s), hs, fun l => RScan l s j⟩ + +-- ============================================================================ +-- Section 4: HalfCounter Model (Num, Borrow, LInc, Pairs, TZero) +-- ============================================================================ + +def digit (b : Bool) : List (Fin 2) := Half (if b then 0 else 1) + +def l_tape : List Bool → List (Fin 2) + | [] => [] + | b :: w => digit b ++ l_tape w + +@[simp] theorem l_tape_nil : l_tape [] = [] := rfl +@[simp] theorem l_tape_cons (b : Bool) (w : List Bool) : + l_tape (b :: w) = digit b ++ l_tape w := rfl + +inductive Num : Nat → Nat → Nat → List Bool → Prop + | nil : Num 0 0 0 [] + | A (n e o : Nat) (w : List Bool) : Num n e o w → Num (1 + n) (1 + o * 2) e (true :: w) + | B (n e o : Nat) (w : List Bool) : Num n e o w → Num (1 + n) (o * 2) e (false :: w) + +theorem Num_eq {n n' e e' o o' : Nat} {w w' : List Bool} + (h : Num n e o w) (hn : n = n') (he : e = e') (ho : o = o') (hw : w = w') : + Num n' e' o' w' := by + subst hn; subst he; subst ho; subst hw; exact h + +theorem Num_length {n e o : Nat} {w : List Bool} (h : Num n e o w) : w.length = n := by + induction h with + | nil => rfl + | A _ _ _ _ _ ih => simp [ih]; omega + | B _ _ _ _ _ ih => simp [ih]; omega + +theorem Num_bounds {n e o : Nat} {w : List Bool} (h : Num n e o w) : + e < 2 ^ ((n + 1) / 2) ∧ o < 2 ^ (n / 2) := by + induction h with + | nil => simp + | A n e o w _ ih => + rcases ih with ⟨he, ho⟩ + have h1 : (1 + n + 1) / 2 = (n / 2) + 1 := by omega + have h2 : (1 + n) / 2 = (n + 1) / 2 := by omega + rw [h1, h2, Nat.pow_succ] + omega + | B n e o w _ ih => + rcases ih with ⟨he, ho⟩ + have h1 : (1 + n + 1) / 2 = (n / 2) + 1 := by omega + have h2 : (1 + n) / 2 = (n + 1) / 2 := by omega + rw [h1, h2, Nat.pow_succ] + omega + +theorem Num_inv_nil {n e o : Nat} (h : Num n e o []) : n = 0 ∧ e = 0 ∧ o = 0 := by + generalize hw : ([] : List Bool) = w at h + cases h with + | nil => exact ⟨rfl, rfl, rfl⟩ + | A _ _ _ _ _ => cases hw + | B _ _ _ _ _ => cases hw + +theorem Num_inv_true {n e o : Nat} {w : List Bool} (h : Num n e o (true :: w)) : + ∃ n0 o0, n = 1 + n0 ∧ e = 1 + o0 * 2 ∧ Num n0 o o0 w := by + generalize hw : true :: w = u at h + cases h with + | nil => cases hw + | A n0 e0 o0 w0 h0 => + injection hw with _ hw0; subst hw0 + exact ⟨n0, o0, rfl, rfl, h0⟩ + | B _ _ _ _ _ => cases hw + +theorem Num_inv_false {n e o : Nat} {w : List Bool} (h : Num n e o (false :: w)) : + ∃ n0 o0, n = 1 + n0 ∧ e = o0 * 2 ∧ Num n0 o o0 w := by + generalize hw : false :: w = u at h + cases h with + | nil => cases hw + | A _ _ _ _ _ => cases hw + | B n0 e0 o0 w0 h0 => + injection hw with _ hw0; subst hw0 + exact ⟨n0, o0, rfl, rfl, h0⟩ + +theorem Num_inv_cons {n e o : Nat} {b : Bool} {w : List Bool} (h : Num n e o (b :: w)) : + ∃ n0 o0, n = 1 + n0 ∧ e = (if b then 1 + o0 * 2 else o0 * 2) ∧ Num n0 o o0 w := by + cases b + · rcases Num_inv_false h with ⟨n0, o0, hn, he, h0⟩ + exact ⟨n0, o0, hn, he, h0⟩ + · rcases Num_inv_true h with ⟨n0, o0, hn, he, h0⟩ + exact ⟨n0, o0, hn, he, h0⟩ + +inductive Borrow : List Bool → List Bool → Prop + | stop (b : Bool) (w : List Bool) : Borrow (b :: true :: w) (false :: w) + | carry (b : Bool) (w w' : List Bool) : Borrow w w' → Borrow (b :: false :: w) (true :: true :: w') + +theorem Borrow_num {w w' : List Bool} (hb : Borrow w w') : + ∀ {n e o : Nat}, Num n e (1 + o) w → ∃ e', Num n e' o (true :: w') ∧ e ≤ e' := by + induction hb with + | stop b w => + intro n e o h + rcases Num_inv_cons h with ⟨n0, o0, rfl, rfl, h0⟩ + rcases Num_inv_true h0 with ⟨n1, o1, rfl, ho, h1⟩ + refine ⟨1 + o0 * 2, ⟨Num_eq (Num.A _ _ _ _ (Num.B _ _ _ _ h1)) rfl rfl (by omega) rfl, ?_⟩⟩ + cases b <;> (simp; try omega) + | carry b w w' _ ih => + intro n e o h + rcases Num_inv_cons h with ⟨n0, o0, rfl, rfl, h0⟩ + rcases Num_inv_false h0 with ⟨n1, o1, rfl, ho, h1⟩ + have h1' : Num n1 o0 (1 + (o1 - 1)) w := Num_eq h1 rfl rfl (by omega) rfl + rcases ih h1' with ⟨e', hn', hle⟩ + refine ⟨1 + e' * 2, ⟨Num_eq (Num.A _ _ _ _ (Num.A _ _ _ _ hn')) rfl rfl (by omega) rfl, ?_⟩⟩ + cases b <;> (simp; try omega) + +theorem Borrow_ex : ∀ (n : Nat) {e o : Nat} {w : List Bool}, + Num n e (1 + o) w → ∃ w', Borrow w w' := by + intro n + induction n using Nat.strong_induction_on with + | h n ih => + intro e o w hn + rcases w with _ | ⟨b, _ | ⟨c, w1⟩⟩ + · rcases Num_inv_nil hn with ⟨_, _, _⟩; omega + · rcases Num_inv_cons hn with ⟨n0, o0, rfl, rfl, h0⟩ + rcases Num_inv_nil h0 with ⟨_, _, _⟩; omega + · rcases Num_inv_cons hn with ⟨n0, o0, rfl, rfl, h0⟩ + cases c + · rcases Num_inv_false h0 with ⟨n1, o1, rfl, ho, h1⟩ + have h1' : Num n1 o0 (1 + (o1 - 1)) w1 := Num_eq h1 rfl rfl (by omega) rfl + rcases ih n1 (by omega) h1' with ⟨w', hw'⟩ + exact ⟨true :: true :: w', Borrow.carry b w1 w' hw'⟩ + · exact ⟨false :: w1, Borrow.stop b w1⟩ + +theorem Borrow_spec {w w' : List Bool} (hb : Borrow w w') (l r : ListBlank (Fin 2)) : + ((l <+ l_tape w) <{E}| ([0] +> r)) [target_tm]⊢⁺ + ((l <+ l_tape w' <+ s_tag) |{D}> r) := by + induction hb generalizing l r with + | stop b w => + have ht : l <+ l_tape (b :: true :: w) = l <+ l_tape w <+ Half 0 <+ Half (if b then 0 else 1) := by + simp [l_tape, digit] + have ht' : l <+ l_tape (false :: w) = l <+ l_tape w <+ Half 1 := by + simp [l_tape, digit] + rw [ht, ht'] + exact EStop (l <+ l_tape w) r (if b then 0 else 1) + | carry b w w' _ ih => + have ht : l <+ l_tape (b :: false :: w) = l <+ l_tape w <+ Half 1 <+ Half (if b then 0 else 1) := by + simp [l_tape, digit] + have ht' : l <+ l_tape (true :: true :: w') = l <+ l_tape w' <+ ld0 ^ 1 := by + simp [l_tape, digit, ld0, Half, pow_succ_list, pow_zero_list] + rw [ht, ht'] + have s1 := ECarry (l <+ l_tape w) r (if b then 0 else 1) + have s2 := ih l (ones ^ 6 +> r) + have s3 := SOnes (l <+ l_tape w') r 1 + exact stepPlus_trans s1 (stepPlus_stepStar_trans s2 s3) + +theorem L_borrow_spec {w w' : List Bool} (hb : Borrow (true :: w) w') (l r : ListBlank (Fin 2)) : + ((l <+ l_tape (true :: w)) <{B}| r) [target_tm]⊢⁺ + ((l <+ l_tape (true :: w')) |{A}> r) := by + cases hb with + | stop _ v => + have ht : l <+ l_tape (true :: true :: v) = l <+ l_tape v <+ ld0 := by + simp [l_tape, digit, ld0, Half] + have ht' : l <+ l_tape (true :: false :: v) = l <+ l_tape v <+ ld1 := by + simp [l_tape, digit, ld1, Half] + rw [ht, ht'] + exact LInc_zero (l <+ l_tape v) r + | carry _ v u hv => + have ht : l <+ l_tape (true :: false :: v) = l <+ l_tape v <+ Half 1 <+ Half 0 := by + simp [l_tape, digit] + have ht' : l <+ l_tape (true :: true :: true :: u) = + l <+ l_tape u <+ Half 0 <+ Half 0 <+ Half 0 := by + simp [l_tape, digit] + rw [ht, ht'] + exact stepPlus_trans (LBAtoE (l <+ l_tape v) r) + (stepPlus_trans (Borrow_spec hv l (ones ^ 5 +> r)) (SFive (l <+ l_tape u) r)) + +theorem LInc_num {n e o : Nat} {w : List Bool} (hn : Num n e (1 + o) (true :: w)) : + ∃ e' w', Num n e' o (true :: w') ∧ e ≤ e' ∧ ∀ l r, + ((l <+ l_tape (true :: w)) <{B}| r) [target_tm]⊢⁺ + ((l <+ l_tape (true :: w')) |{A}> r) := by + rcases Borrow_ex n hn with ⟨w', hb⟩ + rcases Borrow_num hb hn with ⟨e', hn', hle⟩ + exact ⟨e', w', hn', hle, L_borrow_spec hb⟩ + +theorem RC_pairs (q : Nat) {n e o : Nat} {w : List Bool} {z : Nat} {r : ListBlank (Fin 2)} + (hn : Num n e (q + o) (true :: w)) (hr : RC z r) : + ∃ e' w' r', Num n e' o (true :: w') ∧ e ≤ e' ∧ RC (z + q) r' ∧ ∀ l, + ((l <+ l_tape (true :: w)) <{B}| r) [target_tm]⊢* + ((l <+ l_tape (true :: w')) <{B}| r') := by + induction q generalizing e w z r with + | zero => + exact ⟨e, w, r, Num_eq hn rfl rfl (by omega) rfl, Nat.le_refl e, + RC_eq hr (by omega) rfl, fun l => stepStar_refl _⟩ + | succ q ih => + have hn1 : Num n e (1 + (q + o)) (true :: w) := Num_eq hn rfl rfl (by omega) rfl + rcases LInc_num hn1 with ⟨e1, w1, hn_w1, hle1, hL⟩ + rcases RInc_ex hr with ⟨r1, hr1, hR⟩ + rcases ih hn_w1 hr1 with ⟨e2, w2, r2, hn_w2, hle2, hr2, hS⟩ + refine ⟨e2, w2, r2, hn_w2, by omega, RC_eq hr2 (by omega) rfl, fun l => ?_⟩ + exact stepStar_trans (stepPlus_to_stepStar (hL l r)) + (stepStar_trans (stepPlus_to_stepStar (hR (l <+ l_tape (true :: w1)))) (hS l)) + +theorem FC_pairs (tail : ListBlank (Fin 2)) (k q : Nat) {n e o : Nat} {w : List Bool} + {z : Nat} {r : ListBlank (Fin 2)} + (hn : Num n e (q + o) (true :: w)) (hr : FC tail k z r) (hb : z + q < 2 ^ k) : + ∃ e' w' r', Num n e' o (true :: w') ∧ e ≤ e' ∧ FC tail k (z + q) r' ∧ ∀ l, + ((l <+ l_tape (true :: w)) <{B}| r) [target_tm]⊢* + ((l <+ l_tape (true :: w')) <{B}| r') := by + induction q generalizing e w z r with + | zero => + exact ⟨e, w, r, Num_eq hn rfl rfl (by omega) rfl, Nat.le_refl e, + FC_eq hr rfl (by omega) rfl, fun l => stepStar_refl _⟩ + | succ q ih => + have hn1 : Num n e (1 + (q + o)) (true :: w) := Num_eq hn rfl rfl (by omega) rfl + rcases LInc_num hn1 with ⟨e1, w1, hn_w1, hle1, hL⟩ + rcases FiniteRInc_ex hr (by omega) with ⟨r1, hr1, hR⟩ + rcases ih hn_w1 hr1 (by omega) with ⟨e2, w2, r2, hn_w2, hle2, hr2, hS⟩ + refine ⟨e2, w2, r2, hn_w2, by omega, FC_eq hr2 rfl (by omega) rfl, fun l => ?_⟩ + exact stepStar_trans (stepPlus_to_stepStar (hL l r)) + (stepStar_trans (stepPlus_to_stepStar (hR (l <+ l_tape (true :: w1)))) (hS l)) + +theorem TZero {n e o : Nat} {w : List Bool} (h : Nat) (l r : ListBlank (Fin 2)) + (hn : Num n e (2 ^ (h + 2) + o) (true :: w)) : + ∃ e' w', Num n e' o (true :: w') ∧ e ≤ e' ∧ + ((l <+ l_tape (true :: w) <+ (Half 1) ^ h <+ t_tag) |{D}> (rd0 +> r)) [target_tm]⊢⁺ + ((l <+ l_tape (true :: w') <+ (Half 1) ^ (h + 1) <+ t_tag) |{D}> r) := by + have hp := pow2_pos (h + 2) + have hn' : Num n e ((2 ^ (h + 2) - 1) + (1 + o)) (true :: w) := + Num_eq hn rfl rfl (by omega) rfl + rcases FC_pairs ([1] +> r) (h + 2) (2 ^ (h + 2) - 1) hn' (FC_zero ([1] +> r) (h + 2)) (by omega) + with ⟨e1, w1, r1, h1, hle1, hr1, hS⟩ + rcases LInc_num h1 with ⟨e2, w2, h2, hle2, hL⟩ + have hr1_eq : r1 = rd1 ^ (h + 2) +> ([1] +> r) := + FC_full_unique (FC_eq hr1 rfl (by omega) rfl) + subst hr1_eq + refine ⟨e2, w2, h2, by omega, ?_⟩ + have ht : l <+ l_tape (true :: w) = l <+ l_tape w <+ Half 0 := by simp [l_tape, digit] + have s1 := TZeroEntry (l <+ l_tape w) r h + rw [← ht] at s1 + have s2 := hS l + have s3 := hL l (rd1 ^ (h + 2) +> ([1] +> r)) + have s4 := RExit (l <+ l_tape (true :: w2)) r h + exact stepPlus_trans s1 + (stepStar_stepPlus_trans s2 + (stepPlus_trans s3 s4)) + +-- ============================================================================ +-- Section 5: HalfNormal +-- ============================================================================ + +inductive Normal : Nat → Nat → List Bool → Prop + | nil : Normal 0 0 [] + | one (n k : Nat) (w : List Bool) : Normal n k w → Normal (n + 1) (1 + 2 * k) (true :: true :: w) + | zero (n k : Nat) (w : List Bool) : Normal n k w → Normal (n + 1) (2 * k) (true :: false :: w) + +theorem Normal_eq {n n' k k' : Nat} {w w' : List Bool} + (h : Normal n k w) (hn : n = n') (hk : k = k') (hw : w = w') : + Normal n' k' w' := by + subst hn; subst hk; subst hw; exact h + +theorem normal_num {n k : Nat} {w : List Bool} (h : Normal n k w) : + Num (2 * n) (2 ^ n - 1) k w := by + induction h with + | nil => exact Num.nil + | one n k w _ ih => + have hp := pow2_pos n + exact Num_eq (Num.A _ _ _ _ (Num.A _ _ _ _ ih)) (by omega) (by rw [Nat.pow_succ]; omega) (by omega) rfl + | zero n k w _ ih => + have hp := pow2_pos n + exact Num_eq (Num.A _ _ _ _ (Num.B _ _ _ _ ih)) (by omega) (by rw [Nat.pow_succ]; omega) (by omega) rfl + +theorem normal_bound {n k : Nat} {w : List Bool} (h : Normal n k w) : k < 2 ^ n := by + induction h with + | nil => simp + | one n k w _ ih => rw [Nat.pow_succ]; omega + | zero n k w _ ih => rw [Nat.pow_succ]; omega + +theorem normal_length {n k : Nat} {w : List Bool} (h : Normal n k w) : w.length = 2 * n := + Num_length (normal_num h) + +theorem normal_head {n k : Nat} {w : List Bool} (h : Normal n k w) (hn : 0 < n) : + ∃ v, w = true :: v := by + cases h with + | nil => omega + | one _ _ w _ => exact ⟨true :: w, rfl⟩ + | zero _ _ w _ => exact ⟨false :: w, rfl⟩ + +theorem num_normal : ∀ (n : Nat) {k : Nat} {w : List Bool}, + Num (2 * n) (2 ^ n - 1) k w → Normal n k w := by + intro n + induction n with + | zero => + intro k w h + have hl := Num_length h + rcases w with _ | ⟨b, w⟩ + · rcases Num_inv_nil h with ⟨_, _, rfl⟩ + exact Normal.nil + · simp at hl + | succ n ih => + intro k w h + have hp := pow2_pos n + have hp1 : 2 ^ (n + 1) - 1 = 1 + (2 ^ n - 1) * 2 := by rw [Nat.pow_succ]; omega + have hl := Num_length h + rcases w with _ | ⟨b, _ | ⟨c, w1⟩⟩ + · simp at hl + · simp at hl; omega + · rcases Num_inv_cons h with ⟨n0, o0, hn0, he0, h0⟩ + cases b + · simp at he0; omega + · simp at he0 + rcases Num_inv_cons h0 with ⟨n1, o1, hn1, he1, h1⟩ + have h1' : Num (2 * n) (2 ^ n - 1) o1 w1 := + Num_eq h1 (by omega) (by omega) rfl rfl + cases c + · simp at he1 + exact Normal_eq (Normal.zero n o1 w1 (ih h1')) rfl (by omega) rfl + · simp at he1 + exact Normal_eq (Normal.one n o1 w1 (ih h1')) rfl (by omega) rfl + +theorem normal_full_tape {n k : Nat} {w : List Bool} (h : Normal n k w) (hk : k = 2 ^ n - 1) : + l_tape w = ld0 ^ n := by + induction h with + | nil => rfl + | one n k w _ ih => + have hp := pow2_pos n + have hk' : k = 2 ^ n - 1 := by rw [Nat.pow_succ] at hk; omega + simp [l_tape, digit, Half, ld0, pow_succ_list, ih hk'] + | zero n k w _ _ => + have hp := pow2_pos n + rw [Nat.pow_succ] at hk + omega + +theorem normal_zero_tape {n k : Nat} {w : List Bool} (h : Normal n k w) (hk : k = 0) : + l_tape w = ld1 ^ n := by + induction h with + | nil => rfl + | one _ _ _ _ _ => omega + | zero n k w _ ih => + have hk' : k = 0 := by omega + simp [l_tape, digit, Half, ld1, pow_succ_list, ih hk'] + +theorem normal_full (n : Nat) : Normal n (2 ^ n - 1) (List.replicate (2 * n) true) := by + induction n with + | zero => exact Normal.nil + | succ n ih => + have hp := pow2_pos n + have hrep : List.replicate (2 * (n + 1)) true = true :: true :: List.replicate (2 * n) true := by + rw [show 2 * (n + 1) = (2 * n) + 2 by omega] + rfl + rw [hrep] + exact Normal_eq (Normal.one n (2 ^ n - 1) (List.replicate (2 * n) true) ih) + rfl (by rw [Nat.pow_succ]; omega) rfl + +theorem normal_zero (n : Nat) : ∃ w, Normal n 0 w := by + induction n with + | zero => exact ⟨[], Normal.nil⟩ + | succ n ih => + rcases ih with ⟨w, hw⟩ + exact ⟨true :: false :: w, Normal_eq (Normal.zero n 0 w hw) rfl (by omega) rfl⟩ + +theorem l_tape_append (u v : List Bool) : l_tape (u ++ v) = l_tape u ++ l_tape v := by + induction u with + | nil => rfl + | cons b u ih => simp [l_tape, ih, List.append_assoc] + +theorem l_tape_replicate_true (m : Nat) (w : List Bool) : + l_tape (List.replicate m true ++ w) = (Half 0) ^ m ++ l_tape w := by + induction m with + | zero => rfl + | succ m ih => + rw [List.replicate_succ, List.cons_append, l_tape_cons, ih, pow_succ_list] + simp [digit, List.append_assoc] + +theorem l_tape_replicate_false (m : Nat) (w : List Bool) : + l_tape (List.replicate m false ++ w) = (Half 1) ^ m ++ l_tape w := by + induction m with + | zero => rfl + | succ m ih => + rw [List.replicate_succ, List.cons_append, l_tape_cons, ih, pow_succ_list] + simp [digit, List.append_assoc] + +theorem Num_AA {n e o : Nat} {w : List Bool} (m : Nat) (h : Num n e o w) : + Num (n + 2 * m) ((e + 1) * 2 ^ m - 1) ((o + 1) * 2 ^ m - 1) (List.replicate (2 * m) true ++ w) := by + induction m with + | zero => + exact Num_eq h (by omega) (by omega) (by omega) rfl + | succ m ih => + have hp := pow2_pos m + have hrep : List.replicate (2 * (m + 1)) true ++ w = + true :: true :: (List.replicate (2 * m) true ++ w) := by + rw [show 2 * (m + 1) = 2 + 2 * m by omega, List.replicate_add] + rfl + rw [hrep] + have h1 : 1 + ((e + 1) * 2 ^ m - 1) * 2 = (e + 1) * 2 ^ (m + 1) - 1 := by + have hmul : (e + 1) * 2 ^ (m + 1) = ((e + 1) * 2 ^ m) * 2 := by rw [Nat.pow_succ]; ring + have hpos : 1 ≤ (e + 1) * 2 ^ m := Nat.mul_pos (by omega) hp + rw [hmul]; omega + have h2 : 1 + ((o + 1) * 2 ^ m - 1) * 2 = (o + 1) * 2 ^ (m + 1) - 1 := by + have hmul : (o + 1) * 2 ^ (m + 1) = ((o + 1) * 2 ^ m) * 2 := by rw [Nat.pow_succ]; ring + have hpos : 1 ≤ (o + 1) * 2 ^ m := Nat.mul_pos (by omega) hp + rw [hmul]; omega + exact Num_eq (Num.A _ _ _ _ (Num.A _ _ _ _ ih)) (by omega) h1 h2 rfl + +theorem Num_Aodd {n e o : Nat} {w : List Bool} (m : Nat) (h : Num n e o w) : + Num (n + 2 * m + 1) ((o + 1) * 2 ^ (m + 1) - 1) ((e + 1) * 2 ^ m - 1) + (List.replicate (2 * m + 1) true ++ w) := by + have hp := pow2_pos m + have hAA := Num_AA m h + have hrep : List.replicate (2 * m + 1) true ++ w = + true :: (List.replicate (2 * m) true ++ w) := by + rw [show 2 * m + 1 = 1 + 2 * m by omega, List.replicate_add] + rfl + rw [hrep] + have h1 : 1 + ((o + 1) * 2 ^ m - 1) * 2 = (o + 1) * 2 ^ (m + 1) - 1 := by + have hmul : (o + 1) * 2 ^ (m + 1) = ((o + 1) * 2 ^ m) * 2 := by rw [Nat.pow_succ]; ring + have hpos : 1 ≤ (o + 1) * 2 ^ m := Nat.mul_pos (by omega) hp + rw [hmul]; omega + exact Num_eq (Num.A _ _ _ _ hAA) (by omega) h1 rfl rfl + +theorem normal_LInc {n k : Nat} {w : List Bool} (h : Normal n (1 + k) w) : + ∃ w', Normal n k w' ∧ ∀ l r, + ((l <+ l_tape w) <{B}| r) [target_tm]⊢⁺ + ((l <+ l_tape w') |{A}> r) := by + have hb := normal_bound h + have hn : 0 < n := by + cases n with + | zero => simp at hb + | succ n => omega + rcases normal_head h hn with ⟨v, rfl⟩ + rcases LInc_num (normal_num h) with ⟨e', v', hN, hle, hS⟩ + rcases Num_bounds hN with ⟨hmax, _⟩ + have hdiv : (2 * n + 1) / 2 = n := by omega + rw [hdiv] at hmax + have he' : e' = 2 ^ n - 1 := by omega + subst he' + exact ⟨true :: v', num_normal n hN, hS⟩ + +-- ============================================================================ +-- Section 6: HalfZero & HalfDrain +-- ============================================================================ + +theorem zero_pair {n e : Nat} {b c : Bool} {w : List Bool} (h : Num (2 + n) e 0 (b :: c :: w)) : + c = false ∧ ∃ e', Num n e' 0 w := by + rcases Num_inv_cons h with ⟨n0, o0, hn0, _, h0⟩ + rcases Num_inv_cons h0 with ⟨n1, o1, hn1, he1, h1⟩ + cases c + · simp at he1 + exact ⟨rfl, o0, Num_eq h1 (by omega) rfl (by omega) rfl⟩ + · simp at he1; omega + +theorem zero_even : ∀ (m : Nat) {e : Nat} {w : List Bool}, + Num (2 * m) e 0 w → ∃ bs : List (Fin 2), bs.length = m ∧ l_tape w = Marked bs := by + intro m + induction m with + | zero => + intro e w h + have hl := Num_length h + rcases w with _ | ⟨b, w⟩ + · exact ⟨[], rfl, rfl⟩ + · simp at hl + | succ m ih => + intro e w h + have hl := Num_length h + rcases w with _ | ⟨b, _ | ⟨c, w⟩⟩ + · simp at hl + · simp at hl; omega + · have h' : Num (2 + 2 * m) e 0 (b :: c :: w) := Num_eq h (by omega) rfl rfl rfl + rcases zero_pair h' with ⟨rfl, e', hw⟩ + rcases ih hw with ⟨bs, hbs, ht⟩ + refine ⟨(if b then 0 else 1) :: bs, by simp [hbs], ?_⟩ + simp [l_tape, digit, Marked, ht, List.append_assoc] + +theorem zero_odd : ∀ (m : Nat) {e : Nat} {w : List Bool}, + Num (2 * m + 1) e 0 w → + ∃ (bs : List (Fin 2)) (b : Fin 2), bs.length = m ∧ l_tape w = Marked bs ++ Half b := by + intro m + induction m with + | zero => + intro e w h + have hl := Num_length h + rcases w with _ | ⟨b, _ | ⟨c, w⟩⟩ + · simp at hl + · refine ⟨[], if b then 0 else 1, rfl, ?_⟩ + simp [l_tape, digit, Marked] + · simp at hl + | succ m ih => + intro e w h + have hl := Num_length h + rcases w with _ | ⟨b, _ | ⟨c, w⟩⟩ + · simp at hl + · simp at hl + · have h' : Num (2 + (2 * m + 1)) e 0 (b :: c :: w) := Num_eq h (by omega) rfl rfl rfl + rcases zero_pair h' with ⟨rfl, e', hw⟩ + rcases ih hw with ⟨bs, d, hbs, ht⟩ + refine ⟨(if b then 0 else 1) :: bs, d, by simp [hbs], ?_⟩ + simp [l_tape, digit, Marked, ht, List.append_assoc] + +theorem zero_even_A {m e : Nat} {w : List Bool} (h : Num (2 * m) e 0 (true :: w)) : + ∃ bs : List (Fin 2), bs.length + 1 = m ∧ l_tape (true :: w) = Half 0 ++ Half 1 ++ Marked bs := by + cases m with + | zero => + have hl := Num_length h + simp at hl + | succ m => + have hl := Num_length h + rcases w with _ | ⟨c, w⟩ + · simp at hl; omega + · have h' : Num (2 + 2 * m) e 0 (true :: c :: w) := Num_eq h (by omega) rfl rfl rfl + rcases zero_pair h' with ⟨rfl, e', hw⟩ + rcases zero_even m hw with ⟨bs, hbs, ht⟩ + refine ⟨bs, by omega, ?_⟩ + simp [l_tape, digit, ht, List.append_assoc] + +theorem zero_odd_A {m e : Nat} {w : List Bool} (h : Num (2 * m + 1) e 0 (true :: w)) : + (m = 0 ∧ w = []) ∨ + ∃ (bs : List (Fin 2)) (b : Fin 2), bs.length + 1 = m ∧ + l_tape (true :: w) = Half 0 ++ Half 1 ++ Marked bs ++ Half b := by + cases m with + | zero => + have hl := Num_length h + rcases w with _ | ⟨c, w⟩ + · exact Or.inl ⟨rfl, rfl⟩ + · simp at hl + | succ m => + have hl := Num_length h + rcases w with _ | ⟨c, w⟩ + · simp at hl + · have h' : Num (2 + (2 * m + 1)) e 0 (true :: c :: w) := Num_eq h (by omega) rfl rfl rfl + rcases zero_pair h' with ⟨rfl, e', hw⟩ + rcases zero_odd m hw with ⟨bs, b, hbs, ht⟩ + refine Or.inr ⟨bs, b, by omega, ?_⟩ + simp [l_tape, digit, ht, List.append_assoc] + +theorem LZeroEven_num {m e : Nat} {w : List Bool} (r : ListBlank (Fin 2)) + (h : Num (2 * m) e 0 (true :: w)) : + ((ldh <+ l_tape (true :: w)) <{B}| r) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ m) |{A}> ([1] +> r)) := by + rcases zero_even_A h with ⟨bs, rfl, ht⟩ + have heq : ldh <+ l_tape (true :: w) = ldh <+ Marked bs <+ Half 1 <+ Half 0 := by + rw [ht]; simp [listblank_append_assoc] + rw [heq] + exact LZeroEven r bs + +theorem LZeroOdd_num {m e : Nat} {w : List Bool} (r : ListBlank (Fin 2)) + (h : Num (2 * m + 1) e 0 (true :: w)) : + ((ldh <+ l_tape (true :: w)) <{B}| r) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ m <+ Half 0) |{A}> ([1, 1] +> r)) := by + rcases zero_odd_A h with ⟨rfl, rfl⟩ | ⟨bs, b, rfl, ht⟩ + · simpa [l_tape, digit] using! LSingle r + · have heq : ldh <+ l_tape (true :: w) = ldh <+ Half b <+ Marked bs <+ Half 1 <+ Half 0 := by + rw [ht]; simp [listblank_append_assoc] + rw [heq] + exact LZeroOdd r bs b + +theorem S_even_bound (m e o : Nat) (w : List Bool) (h : Num (2 * (1 + m)) e o w) : + 2 * ((2 + e) / 2) + 1 ≤ 2 ^ (2 + m) - 1 := by + rcases Num_bounds h with ⟨he, _⟩ + have hdiv : (2 * (1 + m) + 1) / 2 = 1 + m := by omega + rw [hdiv] at he + have hp0 := pow2_pos m + have hp1 : 2 ≤ 2 ^ (1 + m) := by rw [Nat.add_comm 1 m, Nat.pow_succ]; omega + have hp : 2 ^ (2 + m) = 2 * 2 ^ (1 + m) := by + rw [show 2 + m = (1 + m) + 1 by omega, Nat.pow_succ] + omega + rw [hp] + omega + +theorem S_odd_bound (m e o : Nat) (w : List Bool) (h : Num (2 * m + 1) e o w) : + 2 + e ≤ 2 ^ (1 + m) + 1 := by + rcases Num_bounds h with ⟨he, _⟩ + have hdiv : (2 * m + 1 + 1) / 2 = 1 + m := by omega + rw [hdiv] at he + omega + +theorem Drain_even {m e o : Nat} {w : List Bool} {z : Nat} {r : ListBlank (Fin 2)} + (hn : Num (2 * m) e o (true :: w)) (hr : RC z r) : + ∃ r', RC (z + o) r' ∧ + ((ldh <+ l_tape (true :: w)) <{B}| r) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ m) |{A}> ([1] +> r')) := by + have hn' : Num (2 * m) e (o + 0) (true :: w) := Num_eq hn rfl rfl (by omega) rfl + rcases RC_pairs o hn' hr with ⟨e', w', r', hn1, _, hr1, hS⟩ + exact ⟨r', hr1, stepStar_stepPlus_trans (hS ldh) (LZeroEven_num r' hn1)⟩ + +theorem Drain_odd {m e o : Nat} {w : List Bool} {z : Nat} {r : ListBlank (Fin 2)} + (hn : Num (2 * m + 1) e o (true :: w)) (hr : RC z r) : + ∃ r', RC ((z + o) / 2) r' ∧ + ((ldh <+ l_tape (true :: w)) <{B}| r) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (1 + m)) <{B}| ([1, 0] +> r')) := by + have hn' : Num (2 * m + 1) e (o + 0) (true :: w) := Num_eq hn rfl rfl (by omega) rfl + rcases RC_pairs o hn' hr with ⟨e', w', s, hn1, _, hs, hS⟩ + rcases RC_tail hs with ⟨b, r', hr', rfl⟩ + refine ⟨r', hr', ?_⟩ + have s1 := hS ldh + have s2 := LZeroOdd_num ([b, 0, 0] +> r') hn1 + have s3 := R11Bit (ldh <+ ld0 ^ m <+ Half 0) r' b + have heq : ldh <+ ld0 ^ m <+ Half 0 <+ Half 0 = ldh <+ ld0 ^ (1 + m) := by + rw [← left_ld0_eq, Nat.add_comm 1 m, left_pow_succ ldh ld0 m] + rw [heq] at s3 + exact stepStar_stepPlus_trans s1 (stepPlus_trans s2 s3) + +theorem Drain_S_even {m e o : Nat} {w : List Bool} (hn : Num (2 * m) e o w) : + ∃ r', RC ((2 + e) / 2) r' ∧ + ((ldh <+ l_tape w <+ s_tag) |{D}> default) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (1 + m)) <{B}| ([1, 0] +> r')) := by + have hn' : Num (2 * m + 1) (1 + o * 2) e (true :: w) := + Num_eq (Num.A _ _ _ _ hn) (by omega) rfl rfl rfl + have hr2 : RC 2 ([0, 0, 0, 1] +> default) := by + have h0 : RC 2 (rd0 +> (rd1 +> default)) := + RC_eq (RC.d0 1 (rd1 +> default) (RC_eq (RC.d1 0 default RC.zero) (by omega) rfl)) (by omega) rfl + have heq : rd0 +> (rd1 +> (default : ListBlank (Fin 2))) = [0, 0, 0, 1] +> default := by + simp [rd0, rd1] + rwa [heq] at h0 + rcases Drain_odd hn' hr2 with ⟨r', hr', hS⟩ + refine ⟨r', hr', ?_⟩ + have s1 := SZeroEntry (ldh <+ l_tape w) default + have h000 : ([0, 0, 0] : List (Fin 2)) +> (default : ListBlank (Fin 2)) = default := + rd0_append_default + rw [h000] at s1 + have ht : ldh <+ l_tape (true :: w) = ldh <+ l_tape w <+ Half 0 := by simp [l_tape, digit] + rw [ht] at hS + exact stepPlus_trans s1 hS + +theorem Drain_S_odd {m e o : Nat} {w : List Bool} (hn : Num (2 * m + 1) e o w) : + ∃ r', RC (2 + e) r' ∧ + ((ldh <+ l_tape w <+ s_tag) |{D}> default) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (1 + m)) |{A}> ([1] +> r')) := by + have hn' : Num (2 * (1 + m)) (1 + o * 2) e (true :: w) := + Num_eq (Num.A _ _ _ _ hn) (by omega) rfl rfl rfl + have hr2 : RC 2 ([0, 0, 0, 1] +> default) := by + have h0 : RC 2 (rd0 +> (rd1 +> default)) := + RC_eq (RC.d0 1 (rd1 +> default) (RC_eq (RC.d1 0 default RC.zero) (by omega) rfl)) (by omega) rfl + have heq : rd0 +> (rd1 +> (default : ListBlank (Fin 2))) = [0, 0, 0, 1] +> default := by + simp [rd0, rd1] + rwa [heq] at h0 + rcases Drain_even hn' hr2 with ⟨r', hr', hS⟩ + refine ⟨r', hr', ?_⟩ + have s1 := SZeroEntry (ldh <+ l_tape w) default + have h000 : ([0, 0, 0] : List (Fin 2)) +> (default : ListBlank (Fin 2)) = default := + rd0_append_default + rw [h000] at s1 + have ht : ldh <+ l_tape (true :: w) = ldh <+ l_tape w <+ Half 0 := by simp [l_tape, digit] + rw [ht] at hS + exact stepPlus_trans s1 hS + +-- ============================================================================ +-- Section 7: HalfST & STClosure +-- ============================================================================ + +theorem S000_borrow {n e o : Nat} {b : Bool} {v : List Bool} (h : Num n (2 + e) o (b :: v)) : + ∃ e' u, Borrow v u ∧ Num (n + 1) e' e (true :: b :: true :: u) ∧ 2 * o + 1 ≤ e' := by + rcases Num_inv_cons h with ⟨n0, o0, rfl, he0, h0⟩ + have h0' : Num n0 o (1 + (o0 - 1)) v := by + refine Num_eq h0 rfl rfl ?_ rfl + cases b <;> simp at he0 <;> omega + rcases Borrow_ex n0 h0' with ⟨u, hb⟩ + rcases Borrow_num hb h0' with ⟨e', hN, hle⟩ + refine ⟨1 + e' * 2, u, hb, ?_, by omega⟩ + cases b + · simp at he0 + exact Num_eq (Num.A _ _ _ _ (Num.B _ _ _ _ hN)) (by omega) rfl (by omega) rfl + · simp at he0 + exact Num_eq (Num.A _ _ _ _ (Num.A _ _ _ _ hN)) (by omega) rfl (by omega) rfl + +theorem ST_S100 {n e o : Nat} {w : List Bool} (h : Num n e o w) : + Num (n + 1) (2 * o) e (false :: w) ∧ ∀ l r, + ((l <+ l_tape w <+ s_tag) |{D}> (rd1 +> r)) [target_tm]⊢⁺ + ((l <+ l_tape (false :: w) <+ s_tag) |{D}> r) := by + refine ⟨Num_eq (Num.B _ _ _ _ h) (by omega) (by omega) rfl rfl, fun l r => ?_⟩ + simpa [l_tape, digit, rd1] using! S100 (l <+ l_tape w) r + +theorem ST_T100 {n e o : Nat} {w : List Bool} (h : Num n e (1 + o) w) : + ∃ e' w', Num (n + 1) (1 + 2 * o) e' (true :: w') ∧ e ≤ e' ∧ ∀ l r, + ((l <+ l_tape w <+ t_tag) |{D}> (rd1 +> r)) [target_tm]⊢⁺ + ((l <+ l_tape (true :: w') <+ s_tag) |{D}> r) := by + rcases Borrow_ex n h with ⟨u, hb⟩ + rcases Borrow_num hb h with ⟨e', hN, hle⟩ + refine ⟨e', true :: u, Num_eq (Num.A _ _ _ _ hN) (by omega) (by omega) rfl rfl, hle, fun l r => ?_⟩ + have s1 := T100 (l <+ l_tape w) r + have s2 := Borrow_spec hb l (ones ^ 6 +> r) + have s3 := SOnes (l <+ l_tape u) r 1 + have ht : l <+ l_tape (true :: true :: u) = l <+ l_tape u <+ ld0 ^ 1 := by + simp [l_tape, digit, ld0, Half, pow_succ_list, pow_zero_list] + rw [ht] + exact stepPlus_trans s1 (stepPlus_stepStar_trans s2 s3) + +theorem ST_S000 {n e o : Nat} {w : List Bool} (h : Num n (2 + e) o w) : + ∃ e' w', Num (n + 1) e' e (true :: w') ∧ 2 * o + 1 ≤ e' ∧ ∀ l r, + ((l <+ l_tape w <+ s_tag) |{D}> (rd0 +> r)) [target_tm]⊢⁺ + ((l <+ l_tape (true :: w') <+ t_tag) |{D}> r) := by + rcases w with _ | ⟨b, v⟩ + · rcases Num_inv_nil h with ⟨_, _, _⟩; omega + · rcases S000_borrow h with ⟨e', u, hb, hN, hle⟩ + refine ⟨e', b :: true :: u, hN, hle, fun l r => ?_⟩ + have ht1 : l <+ l_tape (b :: v) = l <+ l_tape v <+ Half (if b then 0 else 1) := by + simp [l_tape, digit] + have ht2 : l <+ l_tape (true :: b :: true :: u) = + l <+ l_tape u <+ Half 0 <+ Half (if b then 0 else 1) <+ Half 0 := by + simp [l_tape, digit] + rw [ht1, ht2] + have s1 := S000 (l <+ l_tape v) r (if b then 0 else 1) + have s2 := Borrow_spec hb l (ones ^ 5 +> ([Opp (if b then 0 else 1), 0, 0, 1] +> r)) + have s3 := S000_end (l <+ l_tape u) r (if b then 0 else 1) + exact stepPlus_trans s1 (stepPlus_trans s2 s3) + +def SC (w : List Bool) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ((ldh <+ l_tape w <+ s_tag) |{D}> r) + +def TC (w : List Bool) (h : Nat) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ((ldh <+ l_tape (true :: w) <+ (Half 1) ^ h <+ t_tag) |{D}> r) + +theorem TC_word (w : List Bool) (h : Nat) (r : ListBlank (Fin 2)) : + TC w h r = ((ldh <+ l_tape (List.replicate h false ++ true :: w) <+ t_tag) |{D}> r) := by + simp [TC, l_tape_replicate_false, listblank_append_assoc] + +theorem Num_B_lower (h : Nat) {n e o : Nat} {w : List Bool} (k : Nat) + (hn : Num n e o w) (he : k ≤ e) (ho : k ≤ o) : + ∃ E O, Num (n + h) E O (List.replicate h false ++ w) ∧ k ≤ E ∧ k ≤ O := by + induction h with + | zero => exact ⟨e, o, Num_eq hn (by omega) rfl rfl rfl, he, ho⟩ + | succ h ih => + rcases ih with ⟨E, O, hN, hE, hO⟩ + refine ⟨O * 2, E, ?_, by omega, hE⟩ + rw [List.replicate_succ, List.cons_append] + exact Num_eq (Num.B _ _ _ _ hN) (by omega) rfl rfl rfl + +inductive STAllowed : Nat → Cfg (Fin 2) (Fin 6) → Prop + | S (n e o : Nat) (w : List Bool) (z : Nat) (r : ListBlank (Fin 2)) : + Num n e o w → 2 ≤ n → 2 * z ≤ e → z ≤ o → RC z r → + STAllowed z (SC w r) + | T (n e o : Nat) (w : List Bool) (h z : Nat) (r : ListBlank (Fin 2)) : + Num n e o (true :: w) → 2 ≤ n → 0 < z → + 2 ^ (h + 2) * z + 1 ≤ e → 2 ^ (h + 2) * (z - 1) + 2 ≤ o → RC z r → + STAllowed z (TC w h r) + +theorem ST_zero_shape {c : Cfg (Fin 2) (Fin 6)} (h : STAllowed 0 c) : + ∃ n e o w, Num n e o w ∧ 2 ≤ n ∧ c = SC w default := by + generalize hz : (0 : Nat) = z at h + cases h with + | S n e o w _ r hn hl _ _ hr => + subst hz + rw [RC_zero_unique hr] + exact ⟨n, e, o, w, hn, hl, rfl⟩ + | T _ _ _ _ _ _ _ _ _ hpos _ _ _ => omega + +theorem ST_positive_step {z : Nat} {c : Cfg (Fin 2) (Fin 6)} (h : STAllowed z c) (hz : 0 < z) : + ∃ c', STAllowed (z / 2) c' ∧ c [target_tm]⊢⁺ c' := by + cases h with + | S n e o w z r hn hl he ho hr => + cases hr with + | zero => omega + | d0 q s hrc => + have hdiv : q * 2 / 2 = q := by omega + rw [hdiv] + have hn' : Num n (2 + (e - 2)) o w := Num_eq hn rfl (by omega) rfl rfl + rcases ST_S000 hn' with ⟨e', w', hN, hle, hS⟩ + refine ⟨TC w' 0 s, ?_, hS ldh s⟩ + exact STAllowed.T (n + 1) e' (e - 2) w' 0 q s hN (by omega) (by omega) (by omega) (by omega) hrc + | d1 q s hrc => + have hdiv : (1 + q * 2) / 2 = q := by omega + rw [hdiv] + rcases ST_S100 hn with ⟨hN, hS⟩ + refine ⟨SC (false :: w) s, ?_, hS ldh s⟩ + exact STAllowed.S (n + 1) (2 * o) e (false :: w) q s hN (by omega) (by omega) (by omega) hrc + | T n e o w h z r hn hl hpos he ho hr => + have hp := pow2_pos (h + 2) + cases hr with + | zero => omega + | d0 q s hrc => + have hdiv : q * 2 / 2 = q := by omega + rw [hdiv] + have hq : 0 < q := by omega + have hb : 2 ^ (h + 2) ≤ o := by + have : 2 ^ (h + 2) * 1 ≤ 2 ^ (h + 2) * (q * 2 - 1) := + Nat.mul_le_mul_left _ (by omega) + omega + have hn' : Num n e (2 ^ (h + 2) + (o - 2 ^ (h + 2))) (true :: w) := + Num_eq hn rfl rfl (by omega) rfl + rcases TZero h ldh s hn' with ⟨e', w', hN, hle, hS⟩ + refine ⟨TC w' (h + 1) s, ?_, hS⟩ + have hcap : 2 ^ (h + 1 + 2) = 2 ^ (h + 2) * 2 := by + rw [show h + 1 + 2 = (h + 2) + 1 by omega, Nat.pow_succ] + have he' : 2 ^ (h + 1 + 2) * q + 1 ≤ e' := by + rw [hcap] + have : 2 ^ (h + 2) * 2 * q = 2 ^ (h + 2) * (q * 2) := by ring + omega + have ho' : 2 ^ (h + 1 + 2) * (q - 1) + 2 ≤ o - 2 ^ (h + 2) := by + rw [hcap] + have : 2 ^ (h + 2) * (q * 2 - 1) = 2 ^ (h + 2) * 2 * (q - 1) + 2 ^ (h + 2) := by + have hq1 : q * 2 - 1 = 2 * (q - 1) + 1 := by omega + rw [hq1]; ring + omega + exact STAllowed.T n e' (o - 2 ^ (h + 2)) w' (h + 1) q s hN hl hq he' ho' hrc + | d1 q s hrc => + have hdiv : (1 + q * 2) / 2 = q := by omega + rw [hdiv] + have hke : q + 1 ≤ e := by + have : 1 * (1 + q * 2) ≤ 2 ^ (h + 2) * (1 + q * 2) := + Nat.mul_le_mul_right _ (by omega) + omega + have hko : q + 1 ≤ o := by + have : 1 * (q * 2) ≤ 2 ^ (h + 2) * (1 + q * 2 - 1) := by + rw [show 1 + q * 2 - 1 = q * 2 by omega] + exact Nat.mul_le_mul_right _ (by omega) + omega + rcases Num_B_lower h (q + 1) hn hke hko with ⟨E, O, hN, hE, hO⟩ + have hN' : Num (n + h) E (1 + (O - 1)) (List.replicate h false ++ true :: w) := + Num_eq hN rfl rfl (by omega) rfl + rcases ST_T100 hN' with ⟨e', w', hN2, hle, hS⟩ + refine ⟨SC (true :: w') s, ?_, ?_⟩ + · exact STAllowed.S (n + h + 1) (1 + 2 * (O - 1)) e' (true :: w') q s + hN2 (by omega) (by omega) (by omega) hrc + · rw [TC_word] + exact hS ldh s + +theorem ST_to_zero : ∀ (z : Nat) {c : Cfg (Fin 2) (Fin 6)}, + STAllowed z c → ∃ c', STAllowed 0 c' ∧ c [target_tm]⊢* c' := by + intro z + induction z using Nat.strong_induction_on with + | h z ih => + intro c hA + rcases Nat.eq_zero_or_pos z with rfl | hz + · exact ⟨c, hA, stepStar_refl _⟩ + · rcases ST_positive_step hA hz with ⟨c1, hA1, hS1⟩ + rcases ih (z / 2) (by omega) hA1 with ⟨c2, hA2, hS2⟩ + exact ⟨c2, hA2, stepStar_trans (stepPlus_to_stepStar hS1) hS2⟩ + +-- ============================================================================ +-- Section 8: HalfTen & TenClosure +-- ============================================================================ + +theorem two_zeros_comm_rd0_pow (t : Nat) (s : ListBlank (Fin 2)) : + ([0, 0] : List (Fin 2)) +> (rd0 ^ t +> s) = rd0 ^ t +> ([0, 0] +> s) := by + induction t with + | zero => rfl + | succ t ih => + rw [right_pow_succ rd0 t s, right_pow_succ rd0 t ([0, 0] +> s), ← ih] + rfl + +theorem ten_prefix (t : Nat) (r : ListBlank (Fin 2)) : + ([1, 0] : List (Fin 2)) +> (rd0 ^ (1 + t) +> (rd1 +> r)) = + rd1 +> (rd0 ^ t +> ([0, 0, 1, 0, 0] +> r)) := by + rw [Nat.add_comm 1 t, right_pow_succ rd0 t (rd1 +> r)] + change rd1 +> (([0, 0] : List (Fin 2)) +> (rd0 ^ t +> (rd1 +> r))) = + rd1 +> (rd0 ^ t +> (([0, 0] : List (Fin 2)) +> (rd1 +> r))) + rw [two_zeros_comm_rd0_pow t (rd1 +> r)] + +theorem A_head {k : Nat} (w : List Bool) (hk : 0 < k) : + ∃ v, List.replicate k true ++ w = true :: v := by + cases k with + | zero => omega + | succ k => exact ⟨List.replicate k true ++ w, rfl⟩ + +theorem flip_A {n e o : Nat} {w : List Bool} (h : Num n e o (true :: w)) : + Num n (e - 1) o (false :: w) ∧ 1 ≤ e := by + rcases Num_inv_true h with ⟨n0, o0, rfl, rfl, h0⟩ + exact ⟨Num_eq (Num.B _ _ _ _ h0) rfl (by omega) rfl rfl, by omega⟩ + +theorem Ten_pre {n e o : Nat} {w : List Bool} (t : Nat) (l r : ListBlank (Fin 2)) + (hn : Num n e (2 ^ (1 + t) - 1 + o) (true :: w)) : + ∃ e' w', Num n e' o (true :: w') ∧ e ≤ e' ∧ + ((l <+ l_tape (true :: w)) <{B}| ([1, 0] +> (rd0 ^ t +> (rd1 +> r)))) [target_tm]⊢⁺ + ((l <+ l_tape (true :: w')) |{A}> (rd1 ^ t +> ([1, 0, 1, 0, 0] +> r))) := by + cases t with + | zero => + have hn' : Num n e (1 + o) (true :: w) := Num_eq hn rfl rfl (by simp) rfl + rcases LInc_num hn' with ⟨e', w', h', hle, hS⟩ + exact ⟨e', w', h', hle, hS l ([1, 0, 1, 0, 0] +> r)⟩ + | succ t => + have hp := pow2_pos t + have hp1 : 2 ≤ 2 ^ (1 + t) := by rw [Nat.add_comm 1 t, Nat.pow_succ]; omega + have hn' : Num n e ((2 ^ (1 + t) - 2) + (2 ^ (1 + t) + o + 1)) (true :: w) := + Num_eq hn rfl rfl (by rw [show 1 + (t + 1) = (1 + t) + 1 by omega, Nat.pow_succ]; omega) rfl + have hr : FC ([0, 0, 1, 0, 0] +> r) (1 + t) 1 (rd1 +> (rd0 ^ t +> ([0, 0, 1, 0, 0] +> r))) := + FC_eq (FC.d1 t 0 (rd0 ^ t +> ([0, 0, 1, 0, 0] +> r)) (FC_zero ([0, 0, 1, 0, 0] +> r) t)) + (by omega) (by omega) rfl + rcases FC_pairs ([0, 0, 1, 0, 0] +> r) (1 + t) (2 ^ (1 + t) - 2) hn' hr (by omega) + with ⟨e1, w1, r1, h1, hle1, hr1, hS1⟩ + have h1' : Num n e1 (1 + (2 ^ (1 + t) + o)) (true :: w1) := + Num_eq h1 rfl rfl (by omega) rfl + rcases LInc_num h1' with ⟨e2, w2, h2, hle2, hL2⟩ + have hr1_eq : r1 = rd1 ^ (1 + t) +> ([0, 0, 1, 0, 0] +> r) := + FC_full_unique (FC_eq hr1 rfl (by omega) rfl) + subst hr1_eq + have h2' : Num n e2 ((2 ^ (1 + t) - 1) + (1 + o)) (true :: w2) := + Num_eq h2 rfl rfl (by omega) rfl + rcases FC_pairs ([1, 0, 1, 0, 0] +> r) (1 + t) (2 ^ (1 + t) - 1) h2' + (FC_zero ([1, 0, 1, 0, 0] +> r) (1 + t)) (by omega) + with ⟨e3, w3, r3, h3, hle3, hr3, hS3⟩ + rcases LInc_num h3 with ⟨e4, w4, h4, hle4, hL4⟩ + have hr3_eq : r3 = rd1 ^ (1 + t) +> ([1, 0, 1, 0, 0] +> r) := + FC_full_unique (FC_eq hr3 rfl (by omega) rfl) + subst hr3_eq + refine ⟨e4, w4, h4, by omega, ?_⟩ + rw [show t + 1 = 1 + t by omega, ten_prefix t r] + have s1 := hS1 l + have s2 := hL2 l (rd1 ^ (1 + t) +> ([0, 0, 1, 0, 0] +> r)) + have s3 := RInc_rule (l <+ l_tape (true :: w2)) ([0, 1, 0, 0] +> r) (1 + t) + have heq3 : ([0] : List (Fin 2)) +> ([0, 1, 0, 0] +> r) = [0, 0, 1, 0, 0] +> r := rfl + have heq3' : ([1] : List (Fin 2)) +> ([0, 1, 0, 0] +> r) = [1, 0, 1, 0, 0] +> r := rfl + rw [heq3, heq3'] at s3 + have s4 := hS3 l + have s5 := hL4 l (rd1 ^ (1 + t) +> ([1, 0, 1, 0, 0] +> r)) + exact stepStar_stepPlus_trans s1 + (stepPlus_trans s2 + (stepPlus_trans s3 + (stepStar_stepPlus_trans s4 s5))) + +theorem Ten_even_exit {n e o : Nat} {w : List Bool} (m : Nat) (l r : ListBlank (Fin 2)) + (h : Num n e (1 + o) (true :: w)) : + ∃ n' e' o' v, Num n' e' o' (true :: v) ∧ n ≤ n' ∧ + 2 * o + 1 ≤ e' ∧ e ≤ o' ∧ + ((l <+ l_tape (true :: w)) |{A}> (rd1 ^ (m * 2) +> ([1, 0, 1, 0, 0] +> r))) [target_tm]⊢⁺ + ((l <+ l_tape (true :: v)) <{B}| ([1, 0] +> r)) := by + rcases LInc_num h with ⟨e1, w1, h1, hle, hL⟩ + have hN := Num_Aodd m h1 + rcases A_head (true :: w1) (show 0 < 2 * m + 1 by omega) with ⟨v, hv⟩ + have ht := l_tape_replicate_true (2 * m + 1) (true :: w1) + rw [hv] at hN ht + have hp := pow2_pos m + have hp2 : 2 ≤ 2 ^ (m + 1) := by rw [Nat.pow_succ]; omega + refine ⟨n + 2 * m + 1, (o + 1) * 2 ^ (m + 1) - 1, (e1 + 1) * 2 ^ m - 1, v, + hN, by omega, ?_, ?_, ?_⟩ + · have : 2 * o + 2 ≤ (o + 1) * 2 ^ (m + 1) := by + have : (o + 1) * 2 ≤ (o + 1) * 2 ^ (m + 1) := Nat.mul_le_mul_left _ hp2 + omega + omega + · have : e + 1 ≤ (e1 + 1) * 2 ^ m := by + have : (e1 + 1) * 1 ≤ (e1 + 1) * 2 ^ m := Nat.mul_le_mul_left _ hp + omega + omega + · have ht0 : l <+ l_tape (true :: w) = l <+ l_tape w <+ [1, 1] <+ [0] := by + simp [l_tape, digit, Half] + have s1 := R101EvenEntry (l <+ l_tape w <+ [1, 1]) r m + rw [← ht0] at s1 + have s2 := hL l (ones ^ (m * 6 + 3) +> ([0, 0] +> r)) + have hmul : m * 6 + 3 = (2 * m + 1) * 3 := by omega + rw [hmul] at s1 s2 + have s3 := R111Scan (l <+ l_tape (true :: w1)) ([0, 0] +> r) (2 * m + 1) + have ht_v : l <+ l_tape (true :: v) = l <+ l_tape (true :: w1) <+ (Half 0) ^ (2 * m + 1) := by + rw [ht, listblank_append_assoc] + rw [← ht_v] at s3 + have s4 := RInc_rule (l <+ l_tape (true :: v)) ([0] +> r) 0 + have heq4 : rd1 ^ 0 +> ([0] +> ([0] +> r)) = [0, 0] +> r := rfl + have heq4' : rd0 ^ 0 +> ([1] +> ([0] +> r)) = [1, 0] +> r := rfl + rw [heq4, heq4'] at s4 + exact stepPlus_trans s1 + (stepPlus_trans s2 + (stepStar_stepPlus_trans s3 s4)) + +theorem Ten_odd_exit {n e o : Nat} {w : List Bool} (m : Nat) (l r : ListBlank (Fin 2)) + (h : Num n e o (true :: w)) : + ∃ n' e' o' v, Num n' e' o' (true :: v) ∧ n ≤ n' ∧ + 2 * e - 1 ≤ e' ∧ 2 * o + 1 ≤ o' ∧ + ((l <+ l_tape (true :: w)) |{A}> (rd1 ^ (m * 2 + 1) +> ([1, 0, 1, 0, 0] +> r))) [target_tm]⊢⁺ + ((l <+ l_tape (true :: v)) <{B}| ([1, 0] +> r)) := by + rcases flip_A h with ⟨hF, he⟩ + have hN := Num_AA (m + 1) hF + rcases A_head (false :: w) (show 0 < 2 * (m + 1) by omega) with ⟨v, hv⟩ + have ht := l_tape_replicate_true (2 * (m + 1)) (false :: w) + rw [hv, half0_pairs_two_mul (m + 1)] at ht + rw [hv] at hN + have hp := pow2_pos m + have hp2 : 2 ≤ 2 ^ (m + 1) := by rw [Nat.pow_succ]; omega + refine ⟨n + 2 * (m + 1), (e - 1 + 1) * 2 ^ (m + 1) - 1, (o + 1) * 2 ^ (m + 1) - 1, v, + hN, by omega, ?_, ?_, ?_⟩ + · have : e * 2 ≤ (e - 1 + 1) * 2 ^ (m + 1) := by + rw [show e - 1 + 1 = e by omega] + exact Nat.mul_le_mul_left e hp2 + omega + · have : 2 * o + 2 ≤ (o + 1) * 2 ^ (m + 1) := by + have : (o + 1) * 2 ≤ (o + 1) * 2 ^ (m + 1) := Nat.mul_le_mul_left _ hp2 + omega + omega + · have ht0 : l <+ l_tape (true :: w) = l <+ l_tape w <+ [1, 1] <+ [0] := by + simp [l_tape, digit, Half] + have s1 := ROv101Odd (l <+ l_tape w <+ [1, 1]) ([0, 0] +> r) m + have heq1 : ([1, 0, 1] : List (Fin 2)) +> ([0, 0] +> r) = [1, 0, 1, 0, 0] +> r := rfl + rw [← ht0, heq1] at s1 + have ht_v : l <+ l_tape (true :: v) = l <+ l_tape w <+ [1, 1] <+ [1] <+ ld0 ^ (m + 1) := by + rw [ht]; simp [l_tape, digit, Half, listblank_append_assoc] + rw [← ht_v] at s1 + have s2 := RInc_rule (l <+ l_tape (true :: v)) ([0] +> r) 0 + have heq2 : rd1 ^ 0 +> ([0] +> ([0] +> r)) = [0, 0] +> r := rfl + have heq2' : rd0 ^ 0 +> ([1] +> ([0] +> r)) = [1, 0] +> r := rfl + rw [heq2, heq2'] at s2 + exact stepPlus_trans s1 s2 + +def JC (w : List Bool) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ((ldh <+ l_tape (true :: w)) <{B}| ([1, 0] +> r)) + +inductive TenAllowed : Nat → Cfg (Fin 2) (Fin 6) → Prop + | J (n e o : Nat) (w : List Bool) (z : Nat) (r : ListBlank (Fin 2)) : + Num n e o (true :: w) → 4 ≤ n → RC z r → + (z = 0 ∨ (2 * z + 1 ≤ e ∧ 2 * z + 1 ≤ o)) → + TenAllowed z (JC w r) + +theorem Ten_zero_shape {c : Cfg (Fin 2) (Fin 6)} (h : TenAllowed 0 c) : + ∃ n e o w, Num n e o (true :: w) ∧ 4 ≤ n ∧ c = JC w default := by + cases h with + | J n e o w _ r hn hl hr _ => + rw [RC_zero_unique hr] + exact ⟨n, e, o, w, hn, hl, rfl⟩ + +theorem Ten_reserve (t q e o : Nat) + (he : 2 * (2 ^ t * (1 + q * 2)) + 1 ≤ e) + (ho : 2 * (2 ^ t * (1 + q * 2)) + 1 ≤ o) : + 2 ^ (1 + t) - 1 ≤ o ∧ 2 * q + 2 ≤ o - (2 ^ (1 + t) - 1) ∧ 2 * q + 1 ≤ e := by + have hp := pow2_pos t + have hp1 : 2 ^ (1 + t) = 2 * 2 ^ t := by rw [Nat.add_comm 1 t, Nat.pow_succ]; ring + have h1 : 2 * (2 ^ t * (1 + q * 2)) = 2 ^ (1 + t) + 2 ^ (1 + t) * q * 2 := by + rw [hp1]; ring + have h2 : 1 * q * 2 ≤ 2 ^ (1 + t) * q * 2 := by + have : 1 ≤ 2 ^ (1 + t) := pow2_pos (1 + t) + exact Nat.mul_le_mul_right 2 (Nat.mul_le_mul_right q this) + omega + +theorem Ten_positive_step {z : Nat} {c : Cfg (Fin 2) (Fin 6)} (hA : TenAllowed z c) (hz : 0 < z) : + ∃ q c', q < z ∧ TenAllowed q c' ∧ c [target_tm]⊢⁺ c' := by + cases hA with + | J n e o w z r hn hl hr hg => + rcases hg with rfl | ⟨he, ho⟩ + · omega + · rcases RC_positive_split hr hz with ⟨t, q, s, rfl, hs, hez, hqz⟩ + have he' : 2 * (2 ^ t * (1 + q * 2)) + 1 ≤ e := by rw [← hez]; exact he + have ho' : 2 * (2 ^ t * (1 + q * 2)) + 1 ≤ o := by rw [← hez]; exact ho + rcases Ten_reserve t q e o he' ho' with ⟨hb, hbq, heq⟩ + set b := o - (2 ^ (1 + t) - 1) + have hn' : Num n e (2 ^ (1 + t) - 1 + b) (true :: w) := + Num_eq hn rfl rfl (by omega) rfl + rcases Ten_pre t ldh s hn' with ⟨e1, w1, h1, hle1, hS1⟩ + rcases nat_even_or_odd t with ⟨m, rfl⟩ | ⟨m, rfl⟩ + · have h1' : Num n e1 (1 + (b - 1)) (true :: w1) := + Num_eq h1 rfl rfl (by omega) rfl + rcases Ten_even_exit m ldh s h1' with ⟨n2, e2, o2, w2, h2, hlen, hE, hO, hS2⟩ + refine ⟨q, JC w2 s, hqz, ?_, ?_⟩ + · exact TenAllowed.J n2 e2 o2 w2 q s h2 (by omega) hs (Or.inr ⟨by omega, by omega⟩) + · rw [Nat.mul_comm 2 m] at hS1 ⊢ + exact stepPlus_trans hS1 hS2 + · rcases Ten_odd_exit m ldh s h1 with ⟨n2, e2, o2, w2, h2, hlen, hE, hO, hS2⟩ + refine ⟨q, JC w2 s, hqz, ?_, ?_⟩ + · exact TenAllowed.J n2 e2 o2 w2 q s h2 (by omega) hs (Or.inr ⟨by omega, by omega⟩) + · rw [show 2 * m + 1 = m * 2 + 1 by omega] at hS1 ⊢ + exact stepPlus_trans hS1 hS2 + +theorem Ten_to_zero : ∀ (z : Nat) {c : Cfg (Fin 2) (Fin 6)}, + TenAllowed z c → ∃ c', TenAllowed 0 c' ∧ c [target_tm]⊢* c' := by + intro z + induction z using Nat.strong_induction_on with + | h z ih => + intro c hA + rcases Nat.eq_zero_or_pos z with rfl | hz + · exact ⟨c, hA, stepStar_refl _⟩ + · rcases Ten_positive_step hA hz with ⟨q, c1, hq, hA1, hS1⟩ + rcases ih q hq hA1 with ⟨c2, hA2, hS2⟩ + exact ⟨c2, hA2, stepStar_trans (stepPlus_to_stepStar hS1) hS2⟩ + +-- ============================================================================ +-- Section 9: HalfI, HalfTBoundary, PairUnion, NormalReturn, IClosure, +-- PairSpecial, Saturated, PairClosure +-- ============================================================================ + +theorem one_zero_comm_rd0_pow (t : Nat) (s : ListBlank (Fin 2)) : + ([0] : List (Fin 2)) +> (rd0 ^ t +> s) = rd0 ^ t +> ([0] +> s) := by + induction t with + | zero => rfl + | succ t ih => + rw [right_pow_succ rd0 t s, right_pow_succ rd0 t ([0] +> s), ← ih] + rfl + +theorem FC_insert_one (r : ListBlank (Fin 2)) (t : Nat) : + FC ([0, 1, 0, 0] +> r) (t + 1) 1 ([1] +> (rd0 ^ (t + 1) +> (rd1 +> r))) := by + have h0 := FC.d1 t 0 (rd0 ^ t +> ([0, 1, 0, 0] +> r)) (FC_zero ([0, 1, 0, 0] +> r) t) + have heq : rd1 +> (rd0 ^ t +> ([0, 1, 0, 0] +> r)) = + [1] +> (rd0 ^ (t + 1) +> (rd1 +> r)) := by + rw [right_pow_succ rd0 t (rd1 +> r)] + change rd1 +> (rd0 ^ t +> (([0] : List (Fin 2)) +> (rd1 +> r))) = + rd1 +> (([0] : List (Fin 2)) +> (rd0 ^ t +> (rd1 +> r))) + rw [one_zero_comm_rd0_pow t (rd1 +> r)] + exact FC_eq h0 rfl (by omega) heq + +theorem normal_split {n k : Nat} {w : List Bool} (h : Normal n k w) (hk : 0 < k) : + ∃ (v : List Bool) (a : Nat) (u : List Bool), Normal n (k - 1) v ∧ + l_tape w = ld1 ^ a ++ ld0 ++ l_tape u ∧ + l_tape v = ld0 ^ a ++ ld1 ++ l_tape u := by + induction h with + | nil => omega + | one n k w h ih => + refine ⟨true :: false :: w, (0 : Nat), w, ?_, ?_, ?_⟩ + · exact Normal_eq (Normal.zero n k w h) rfl (by omega) rfl + · simp [l_tape, digit, ld0, Half] + · simp [l_tape, digit, ld1, Half] + | zero n k w h ih => + rcases ih (by omega) with ⟨v, a, u, hv, hw_eq, hv_eq⟩ + refine ⟨true :: true :: v, a + 1, u, ?_, ?_, ?_⟩ + · exact Normal_eq (Normal.one n (k - 1) v hv) rfl (by omega) rfl + · simp [l_tape, digit, ld1, Half, pow_succ_list, hw_eq, List.append_assoc] + · simp [l_tape, digit, ld0, Half, pow_succ_list, hv_eq, List.append_assoc] + +theorem normal_AA {n k : Nat} {w : List Bool} (m : Nat) (h : Normal n k w) : + Normal (n + m) ((k + 1) * 2 ^ m - 1) (List.replicate (2 * m) true ++ w) := by + have hp := pow2_pos n + have hpm := pow2_pos m + have hN := Num_AA m (normal_num h) + have h1 : (2 ^ n - 1 + 1) * 2 ^ m - 1 = 2 ^ (n + m) - 1 := by + rw [Nat.sub_add_cancel hp, Nat.pow_add] + exact num_normal (n + m) (Num_eq hN (by omega) h1 rfl rfl) + +theorem Num_flip {n e o : Nat} {w : List Bool} (h : Num n e o (true :: w)) : + Num n (e - 1) o (false :: w) := + (flip_A h).1 + +theorem normal_FC_Rpairs (tail : ListBlank (Fin 2)) (h q : Nat) {n b : Nat} {w : List Bool} + {z : Nat} {r : ListBlank (Fin 2)} + (hn : Normal n (q + b) w) (hr : FC tail h z r) (hb : z + q < 2 ^ h) : + ∃ w' r', Normal n b w' ∧ FC tail h (z + q) r' ∧ ∀ l, + ((l <+ l_tape w) |{A}> r) [target_tm]⊢* + ((l <+ l_tape w') |{A}> r') := by + induction q generalizing b w z r with + | zero => + exact ⟨w, r, Normal_eq hn rfl (by omega) rfl, FC_eq hr rfl (by omega) rfl, + fun l => stepStar_refl _⟩ + | succ q ih => + rcases FiniteRInc_ex hr (by omega) with ⟨r1, hr1, hR⟩ + have hn' : Normal n (1 + (q + b)) w := Normal_eq hn rfl (by omega) rfl + rcases normal_LInc hn' with ⟨w1, h1, hL⟩ + rcases ih h1 hr1 (by omega) with ⟨w2, r2, h2, hr2, hS⟩ + refine ⟨w2, r2, h2, FC_eq hr2 rfl (by omega) rfl, fun l => ?_⟩ + exact stepStar_trans (stepPlus_to_stepStar (hR (l <+ l_tape w))) + (stepStar_trans (stepPlus_to_stepStar (hL l r1)) (hS l)) + +theorem I_pre {n b : Nat} {w : List Bool} (t : Nat) (l r : ListBlank (Fin 2)) + (hn : Normal n (2 ^ (1 + t) - 2 + b) w) (_hb : 1 ≤ b) : + ∃ w', Normal n b w' ∧ + ((l <+ l_tape w) |{A}> ([1] +> (rd0 ^ t +> (rd1 +> r)))) [target_tm]⊢* + ((l <+ l_tape w') |{A}> (rd1 ^ t +> ([1, 1, 0, 0] +> r))) := by + cases t with + | zero => + refine ⟨w, Normal_eq hn rfl (by simp) rfl, ?_⟩ + try exact stepStar_refl _ + | succ t => + have hp := pow2_pos t + have hp1 : 2 ≤ 2 ^ (t + 1) := by rw [Nat.pow_succ]; omega + have hn' : Normal n ((2 ^ (t + 1) - 2) + (2 ^ (t + 1) + b)) w := + Normal_eq hn rfl (by rw [show 1 + (t + 1) = (t + 1) + 1 by omega, Nat.pow_succ]; omega) rfl + rcases normal_FC_Rpairs ([0, 1, 0, 0] +> r) (t + 1) (2 ^ (t + 1) - 2) hn' (FC_insert_one r t) (by omega) + with ⟨w1, r1, h1, hr1, hS1⟩ + have hr1_eq : r1 = rd1 ^ (t + 1) +> ([0, 1, 0, 0] +> r) := + FC_full_unique (FC_eq hr1 rfl (by omega) rfl) + subst hr1_eq + have h1' : Normal n (1 + ((2 ^ (t + 1) - 1) + b)) w1 := + Normal_eq h1 rfl (by omega) rfl + rcases normal_LInc h1' with ⟨w2, h2, hL⟩ + rcases normal_FC_Rpairs ([1, 1, 0, 0] +> r) (t + 1) (2 ^ (t + 1) - 1) h2 + (FC_zero ([1, 1, 0, 0] +> r) (t + 1)) (by omega) + with ⟨w3, r3, h3, hr3, hS3⟩ + have hr3_eq : r3 = rd1 ^ (t + 1) +> ([1, 1, 0, 0] +> r) := + FC_full_unique (FC_eq hr3 rfl (by omega) rfl) + subst hr3_eq + refine ⟨w3, h3, ?_⟩ + have s1 := hS1 l + have s2 := RInc_rule (l <+ l_tape w1) ([1, 0, 0] +> r) (t + 1) + have heq2 : ([0] : List (Fin 2)) +> ([1, 0, 0] +> r) = [0, 1, 0, 0] +> r := rfl + have heq2' : ([1] : List (Fin 2)) +> ([1, 0, 0] +> r) = [1, 1, 0, 0] +> r := rfl + rw [heq2, heq2'] at s2 + have s3 := hL l (rd0 ^ (t + 1) +> ([1, 1, 0, 0] +> r)) + have s4 := hS3 l + exact stepStar_trans s1 + (stepStar_trans (stepPlus_to_stepStar s2) + (stepStar_trans (stepPlus_to_stepStar s3) s4)) + +theorem I_odd_exit {n b : Nat} {w : List Bool} (m : Nat) (l r : ListBlank (Fin 2)) + (hn : Normal n b w) (hb : 0 < b) : + ∃ w', Normal (n + m + 1) (b * 2 ^ (m + 1) - 1) w' ∧ + ((l <+ l_tape w) |{A}> (rd1 ^ (m * 2 + 1) +> ([1, 1, 0, 0] +> r))) [target_tm]⊢⁺ + ((l <+ l_tape w') |{A}> ([1] +> r)) := by + rcases normal_split hn hb with ⟨v, a, u, hv, hw_eq, hv_eq⟩ + refine ⟨List.replicate (2 * (m + 1)) true ++ v, ?_, ?_⟩ + · exact Normal_eq (normal_AA (m + 1) hv) (by omega) (by rw [Nat.sub_add_cancel hb]) rfl + · have ht1 : l <+ l_tape w = l <+ l_tape u <+ ld0 <+ ld1 ^ a := by + rw [hw_eq]; simp [listblank_append_assoc] + have ht2 : l <+ l_tape (List.replicate (2 * (m + 1)) true ++ v) = + l <+ l_tape u <+ ld1 <+ ld0 ^ (m + a + 1) := by + rw [l_tape_append, normal_full_tape (normal_full (m + 1)) rfl, hv_eq, + show m + a + 1 = (m + 1) + a by omega, list_pow_add] + simp [listblank_append_assoc] + rw [ht1, ht2] + exact ROvOddRecover (l <+ l_tape u) r a m + +theorem I_odd {n b : Nat} {w : List Bool} (m : Nat) (l r : ListBlank (Fin 2)) + (hn : Normal n (2 ^ (1 + (m * 2 + 1)) - 2 + b) w) (hb : 1 ≤ b) : + ∃ w', Normal (n + m + 1) (b * 2 ^ (m + 1) - 1) w' ∧ + ((l <+ l_tape w) |{A}> ([1] +> (rd0 ^ (m * 2 + 1) +> (rd1 +> r)))) [target_tm]⊢⁺ + ((l <+ l_tape w') |{A}> ([1] +> r)) := by + rcases I_pre (m * 2 + 1) l r hn hb with ⟨v, hv, hP⟩ + rcases I_odd_exit m l r hv (by omega) with ⟨u, hu, hU⟩ + exact ⟨u, hu, stepStar_stepPlus_trans hP hU⟩ + +theorem I_even_exit {n b : Nat} {w : List Bool} (m : Nat) (l r : ListBlank (Fin 2)) + (hn : Normal n b w) (hb : 0 < b) : + ∃ w', Num (2 * (n + m)) ((2 ^ n - 1) * 2 ^ m - 1) ((b + 1) * 2 ^ m - 1) w' ∧ + ((l <+ l_tape w) |{A}> (rd1 ^ (m * 2) +> ([1, 1, 0, 0] +> r))) [target_tm]⊢⁺ + ((l <+ l_tape w' <+ s_tag) |{D}> r) := by + have hbound := normal_bound hn + have hpos : 0 < n := by + cases n with + | zero => simp at hbound; omega + | succ n => omega + have hpow : 2 ≤ 2 ^ n := by + cases n with + | zero => omega + | succ n => + have := pow2_pos n + rw [Nat.pow_succ]; omega + rcases normal_head hn hpos with ⟨v, rfl⟩ + refine ⟨List.replicate (2 * m) true ++ false :: v, ?_, ?_⟩ + · have hAA := Num_AA m (Num_flip (normal_num hn)) + have h1 : (2 ^ n - 1 - 1 + 1) * 2 ^ m - 1 = (2 ^ n - 1) * 2 ^ m - 1 := by + rw [show 2 ^ n - 1 - 1 + 1 = 2 ^ n - 1 by omega] + exact Num_eq hAA (by omega) h1 rfl rfl + · have ht1 : l <+ l_tape (true :: v) = l <+ l_tape v <+ [1, 1] <+ [0] := by + simp [l_tape, digit, Half] + have ht2 : l <+ l_tape (List.replicate (2 * m) true ++ false :: v) = + l <+ l_tape v <+ [1, 1] <+ [1] <+ ld0 ^ m := by + rw [l_tape_append, normal_full_tape (normal_full m) rfl] + simp [l_tape, digit, Half, listblank_append_assoc] + rw [ht1, ht2] + exact ROvEvenAux (l <+ l_tape v <+ [1, 1]) r m + +theorem I_even {n b : Nat} {w : List Bool} (m : Nat) (l r : ListBlank (Fin 2)) + (hn : Normal n (2 ^ (1 + m * 2) - 2 + b) w) (hb : 1 ≤ b) : + ∃ w', Num (2 * (n + m)) ((2 ^ n - 1) * 2 ^ m - 1) ((b + 1) * 2 ^ m - 1) w' ∧ + ((l <+ l_tape w) |{A}> ([1] +> (rd0 ^ (m * 2) +> (rd1 +> r)))) [target_tm]⊢⁺ + ((l <+ l_tape w' <+ s_tag) |{D}> r) := by + rcases I_pre (m * 2) l r hn hb with ⟨v, hv, hP⟩ + rcases I_even_exit m l r hv (by omega) with ⟨u, hu, hU⟩ + exact ⟨u, hu, stepStar_stepPlus_trans hP hU⟩ + +theorem geometric_step (h k o : Nat) : + 2 ^ (h + 2) * (2 ^ (k + 1) - 1) + o = + 2 ^ (h + 2) + (2 ^ (h + 1 + 2) * (2 ^ k - 1) + o) := by + have hp := pow2_pos k + have h1 : 2 ^ (h + 1 + 2) = 2 ^ (h + 2) * 2 := by + rw [show h + 1 + 2 = (h + 2) + 1 by omega, Nat.pow_succ] + have h2 : 2 ^ (k + 1) - 1 = 1 + 2 * (2 ^ k - 1) := by + rw [Nat.pow_succ]; omega + rw [h1, h2] + ring + +theorem TZeros (k : Nat) {n e o : Nat} {w : List Bool} (h : Nat) (l r : ListBlank (Fin 2)) + (hn : Num n e (2 ^ (h + 2) * (2 ^ k - 1) + o) (true :: w)) : + ∃ e' w', Num n e' o (true :: w') ∧ e ≤ e' ∧ + ((l <+ l_tape (true :: w) <+ (Half 1) ^ h <+ t_tag) |{D}> (rd0 ^ k +> r)) [target_tm]⊢* + ((l <+ l_tape (true :: w') <+ (Half 1) ^ (h + k) <+ t_tag) |{D}> r) := by + induction k generalizing e w h r with + | zero => + have hn' : Num n e o (true :: w) := Num_eq hn rfl rfl (by simp) rfl + exact ⟨e, w, hn', Nat.le_refl e, stepStar_refl _⟩ + | succ k ih => + rw [geometric_step h k o] at hn + rcases TZero h l (rd0 ^ k +> r) hn with ⟨e1, w1, h1, hle1, hS1⟩ + rcases ih (h + 1) r h1 with ⟨e2, w2, h2, hle2, hS2⟩ + refine ⟨e2, w2, h2, by omega, ?_⟩ + rw [right_pow_succ rd0 k r, show h + (k + 1) = h + 1 + k by omega] + exact stepStar_trans (stepPlus_to_stepStar hS1) hS2 + +theorem RPairs (l r : ListBlank (Fin 2)) (k : Nat) : + (l |{A}> (ones ^ (k * 6) +> r)) [target_tm]⊢* + ((l <+ ld0 ^ k) |{A}> r) := by + rw [show k * 6 = (k * 2) * 3 by omega, ← half0_pairs k] + exact R111Scan l r (k * 2) + +theorem T100_zero_odd {m e : Nat} {w : List Bool} (r : ListBlank (Fin 2)) + (hn : Num (2 * m + 1) e 0 w) : + ((ldh <+ l_tape w <+ t_tag) |{D}> (rd1 +> r)) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (m + 2)) |{A}> r) := by + rcases zero_odd m hn with ⟨bs, b, rfl, ht⟩ + have heq : ldh <+ l_tape w = ldh <+ Half b <+ Marked bs := by + rw [ht, listblank_append_assoc] + rw [heq] + have s1 := T100 (ldh <+ Half b <+ Marked bs) r + have s2 := MarkedCarry (ldh <+ Half b) (ones ^ 6 +> r) bs + have s3 := EHalfBoundary (ones ^ (bs.length * 6) +> (ones ^ 6 +> r)) b + have h_ones : ones ^ 6 +> (ones ^ (bs.length * 6) +> (ones ^ 6 +> r)) = + ones ^ ((bs.length + 2) * 6) +> r := by + rw [← right_pow_add, ← right_pow_add, show 6 + bs.length * 6 + 6 = (bs.length + 2) * 6 by omega] + rw [h_ones] at s3 + have s4 := RPairs ldh r (bs.length + 2) + exact stepPlus_trans s1 + (stepStar_stepPlus_trans s2 + (stepPlus_stepStar_trans s3 s4)) + +def IC (w : List Bool) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ((ldh <+ l_tape w) |{A}> ([1] +> r)) + +def IGuard (n k z : Nat) : Prop := + z = 0 ∨ (∃ d, z < 2 ^ d ∧ d ≤ n ∧ 2 ^ d - 1 ≤ k) ∨ (k = 2 ^ n - 1 ∧ z ≤ 2 ^ n + 1) + +inductive IAllowed : Cfg (Fin 2) (Fin 6) → Prop + | intro (n k : Nat) (w : List Bool) (z : Nat) (r : ListBlank (Fin 2)) : + Normal n k w → 1 ≤ n → RC z r → IGuard n k z → + IAllowed (IC w r) + +inductive Allowed : Cfg (Fin 2) (Fin 6) → Prop + | Ordinary (c : Cfg (Fin 2) (Fin 6)) : IAllowed c → Allowed c + | Ten (z : Nat) (c : Cfg (Fin 2) (Fin 6)) : TenAllowed z c → Allowed c + | Signal (z : Nat) (c : Cfg (Fin 2) (Fin 6)) : STAllowed z c → Allowed c + +theorem I_full (n z : Nat) (r : ListBlank (Fin 2)) + (hn : 1 ≤ n) (hz : z ≤ 2 ^ n + 1) (hr : RC z r) : + IAllowed ((ldh <+ ld0 ^ n) |{A}> ([1] +> r)) := by + rw [← normal_full_tape (normal_full n) rfl] + exact IAllowed.intro n (2 ^ n - 1) (List.replicate (2 * n) true) z r + (normal_full n) hn hr (Or.inr (Or.inr ⟨rfl, hz⟩)) + +theorem J_full (n z : Nat) (r : ListBlank (Fin 2)) + (hn : 2 ≤ n) (hr : RC z r) (hg : z = 0 ∨ 2 * z + 1 ≤ 2 ^ n - 1) : + TenAllowed z ((ldh <+ ld0 ^ n) <{B}| ([1, 0] +> r)) := by + rcases normal_head (normal_full n) (by omega) with ⟨w, hw⟩ + have hN := normal_num (normal_full n) + have ht := normal_full_tape (normal_full n) rfl + rw [hw] at hN ht + rw [← ht] + exact TenAllowed.J (2 * n) (2 ^ n - 1) (2 ^ n - 1) w z r hN (by omega) hr + (hg.elim Or.inl (fun h => Or.inr ⟨h, h⟩)) + +theorem J_odd_bound (m e o : Nat) (w : List Bool) (h : Num (2 * (1 + m) + 1) e o w) : + 2 * ((1 + o) / 2) + 1 ≤ 2 ^ (2 + m) - 1 := by + rcases Num_bounds h with ⟨_, ho⟩ + have hdiv : (2 * (1 + m) + 1) / 2 = 1 + m := by omega + rw [hdiv] at ho + have hp : 2 ^ (2 + m) = 2 * 2 ^ (1 + m) := by + rw [show 2 + m = (1 + m) + 1 by omega, Nat.pow_succ] + omega + rw [hp] + omega + +theorem S_zero {c : Cfg (Fin 2) (Fin 6)} (h : STAllowed 0 c) : + ∃ c', Allowed c' ∧ c [target_tm]⊢⁺ c' := by + rcases ST_zero_shape h with ⟨n, e, o, w, hN, hl, rfl⟩ + rcases nat_even_or_odd n with ⟨m, rfl⟩ | ⟨m, rfl⟩ + · rcases Drain_S_even hN with ⟨r', hr', hS⟩ + refine ⟨((ldh <+ ld0 ^ (1 + m)) <{B}| ([1, 0] +> r')), ?_, hS⟩ + refine Allowed.Ten ((2 + e) / 2) _ (J_full (1 + m) ((2 + e) / 2) r' (by omega) hr' (Or.inr ?_)) + have hN' : Num (2 * (1 + (m - 1))) e o w := Num_eq hN (by omega) rfl rfl rfl + have hb := S_even_bound (m - 1) e o w hN' + rw [show 2 + (m - 1) = 1 + m by omega] at hb + exact hb + · rcases Drain_S_odd hN with ⟨r', hr', hS⟩ + refine ⟨((ldh <+ ld0 ^ (1 + m)) |{A}> ([1] +> r')), ?_, hS⟩ + exact Allowed.Ordinary _ (I_full (1 + m) (2 + e) r' (by omega) (S_odd_bound m e o w hN) hr') + +theorem J_zero {c : Cfg (Fin 2) (Fin 6)} (h : TenAllowed 0 c) : + ∃ c', Allowed c' ∧ c [target_tm]⊢⁺ c' := by + rcases Ten_zero_shape h with ⟨n, e, o, w, hN, hl, rfl⟩ + have hr1 : RC 1 ([1, 0] +> default) := by + have h0 : RC 1 (rd1 +> default) := RC_eq (RC.d1 0 default RC.zero) (by omega) rfl + have heq : rd1 +> (default : ListBlank (Fin 2)) = [1, 0] +> default := by simp [rd1] + rwa [heq] at h0 + rcases nat_even_or_odd n with ⟨m, rfl⟩ | ⟨m, rfl⟩ + · rcases Drain_even hN hr1 with ⟨r', hr', hS⟩ + refine ⟨((ldh <+ ld0 ^ m) |{A}> ([1] +> r')), ?_, hS⟩ + rcases Num_bounds hN with ⟨_, ho⟩ + have hdiv : 2 * m / 2 = m := by omega + rw [hdiv] at ho + exact Allowed.Ordinary _ (I_full m (1 + o) r' (by omega) (by omega) hr') + · rcases Drain_odd hN hr1 with ⟨r', hr', hS⟩ + refine ⟨((ldh <+ ld0 ^ (1 + m)) <{B}| ([1, 0] +> r')), ?_, hS⟩ + refine Allowed.Ten ((1 + o) / 2) _ (J_full (1 + m) ((1 + o) / 2) r' (by omega) hr' (Or.inr ?_)) + have hN' : Num (2 * (1 + (m - 1)) + 1) e o (true :: w) := Num_eq hN (by omega) rfl rfl rfl + have hb := J_odd_bound (m - 1) e o (true :: w) hN' + rw [show 2 + (m - 1) = 1 + m by omega] at hb + exact hb + +theorem even_R_return {n e o : Nat} {w : List Bool} {z : Nat} {r : ListBlank (Fin 2)} + (hn : Num (2 * n) e o (true :: w)) (hlen : 1 ≤ n) (hr : RC z r) (hz : z ≤ 1) : + ∃ c', Allowed c' ∧ ((ldh <+ l_tape (true :: w)) |{A}> r) [target_tm]⊢⁺ c' := by + rcases Num_bounds hn with ⟨_, hb⟩ + have hdiv : 2 * n / 2 = n := by omega + rw [hdiv] at hb + rcases RInc_ex hr with ⟨s, hs, hR⟩ + rcases Drain_even hn hs with ⟨s', hs', hL⟩ + refine ⟨((ldh <+ ld0 ^ n) |{A}> ([1] +> s')), ?_, stepPlus_trans (hR (ldh <+ l_tape (true :: w))) hL⟩ + exact Allowed.Ordinary _ (I_full n (z + 1 + o) s' hlen (by omega) hs') + +theorem R_return {n k : Nat} {w : List Bool} {z : Nat} {r : ListBlank (Fin 2)} + (hn : Normal n k w) (hlen : 1 ≤ n) (hr : RC z r) (hz : z ≤ 1) : + ∃ c', Allowed c' ∧ ((ldh <+ l_tape w) |{A}> r) [target_tm]⊢⁺ c' := by + rcases normal_head hn (by omega) with ⟨v, rfl⟩ + exact even_R_return (normal_num hn) hlen hr hz + +theorem R_zero_full (n : Nat) (hn : 1 ≤ n) : + ∃ c', Allowed c' ∧ ((ldh <+ ld0 ^ n) |{A}> default) [target_tm]⊢⁺ c' := by + rcases R_return (normal_full n) hn RC.zero (by omega) with ⟨c', hA, hS⟩ + rw [normal_full_tape (normal_full n) rfl] at hS + exact ⟨c', hA, hS⟩ + +theorem I_zero {n k : Nat} {w : List Bool} {r : ListBlank (Fin 2)} + (hn : Normal n k w) (hl : 1 ≤ n) (hr : RC 0 r) : + ∃ c', Allowed c' ∧ (IC w r) [target_tm]⊢⁺ c' := by + rw [RC_zero_unique hr] + have hr1 : RC 1 ([1] +> default) := by + have h0 : RC 1 (rd1 +> default) := RC_eq (RC.d1 0 default RC.zero) (by omega) rfl + have heq : rd1 +> (default : ListBlank (Fin 2)) = [1] +> default := by simp [rd1] + rwa [heq] at h0 + exact R_return hn hl hr1 (by omega) + +theorem small_bounds (n k d t q : Nat) + (hz : 2 ^ t * (1 + q * 2) < 2 ^ d) (hd : d ≤ n) (hk : 2 ^ d - 1 ≤ k) : + ∃ b s, k = 2 ^ (1 + t) - 2 + b ∧ 1 ≤ b ∧ q < 2 ^ s ∧ s ≤ n ∧ 2 ^ s ≤ b ∧ 2 * q + 2 ≤ 2 ^ n := by + have hpt := pow2_pos t + have htd : t < d := by + rcases Nat.lt_or_ge t d with hlt | hge + · exact hlt + · have hle : 2 ^ d ≤ 2 ^ t := Nat.pow_le_pow_right (by omega) hge + have : 2 ^ t * 1 ≤ 2 ^ t * (1 + q * 2) := Nat.mul_le_mul_left _ (by omega) + omega + set s := d - (1 + t) + have hds : d = (1 + t) + s := by omega + have hP : 2 ^ d = 2 ^ (1 + t) * 2 ^ s := by rw [hds, Nat.pow_add] + have hP2 : 2 ^ (1 + t) = 2 ^ t * 2 := by rw [Nat.add_comm 1 t, Nat.pow_succ] + have hps := pow2_pos s + have hdn : 2 ^ d ≤ 2 ^ n := Nat.pow_le_pow_right (by omega) hd + have hqs : q < 2 ^ s := by + rcases Nat.lt_or_ge q (2 ^ s) with hlt | hge + · exact hlt + · have hmul : 2 ^ t * (2 * 2 ^ s) ≤ 2 ^ t * (1 + q * 2) := + Nat.mul_le_mul_left _ (by omega) + have : 2 ^ d = 2 ^ t * (2 * 2 ^ s) := by rw [hP, hP2]; ring + omega + have hcost : 2 ^ (1 + t) - 2 ≤ k := by + have : 2 ^ (1 + t) * 1 ≤ 2 ^ (1 + t) * 2 ^ s := Nat.mul_le_mul_left _ hps + omega + set b := k - (2 ^ (1 + t) - 2) + have hbnd : 2 ^ s ≤ b := by + have h3 : 2 ^ (1 + t) * (2 ^ s - 1) ≥ 2 * (2 ^ s - 1) := + Nat.mul_le_mul_right _ (by omega) + have h4 : 2 ^ (1 + t) * 2 ^ s = 2 ^ (1 + t) + 2 ^ (1 + t) * (2 ^ s - 1) := by + have hs1 : 2 ^ s = 1 + (2 ^ s - 1) := by omega + conv_lhs => rw [hs1] + ring + omega + have h2q : 2 * q + 2 ≤ 2 ^ n := by + have : 2 * q + 1 ≤ 2 ^ t * (1 + q * 2) := by + have : 1 * (1 + q * 2) ≤ 2 ^ t * (1 + q * 2) := Nat.mul_le_mul_right _ hpt + omega + omega + exact ⟨b, s, by omega, by omega, hqs, by omega, hbnd, h2q⟩ + +theorem IClosure_small {n k : Nat} {w : List Bool} {z : Nat} {r : ListBlank (Fin 2)} (d : Nat) + (hn : Normal n k w) (hlen : 1 ≤ n) (hr : RC z r) + (hz : 0 < z) (hcap : z < 2 ^ d) (hd : d ≤ n) (hbudget : 2 ^ d - 1 ≤ k) : + ∃ c', Allowed c' ∧ (IC w r) [target_tm]⊢⁺ c' := by + rcases RC_positive_split hr hz with ⟨t, q, s, rfl, hs, hez, hqz⟩ + have hcap' : 2 ^ t * (1 + q * 2) < 2 ^ d := by rw [← hez]; exact hcap + rcases small_bounds n k d t q hcap' hd hbudget with ⟨b, d', hk, hb, hq, hwidth, hbb, h2q⟩ + rcases nat_even_or_odd t with ⟨m, rfl⟩ | ⟨m, rfl⟩ + · rw [Nat.mul_comm 2 m] at hk ⊢ + have hn' : Normal n (2 ^ (1 + m * 2) - 2 + b) w := Normal_eq hn rfl hk rfl + rcases I_even m ldh s hn' hb with ⟨w', hN, hS⟩ + refine ⟨SC w' s, ?_, hS⟩ + have hpm := pow2_pos m + have he' : 2 * q ≤ (2 ^ n - 1) * 2 ^ m - 1 := by + have : (2 ^ n - 1) * 1 ≤ (2 ^ n - 1) * 2 ^ m := Nat.mul_le_mul_left _ hpm + omega + have ho' : q ≤ (b + 1) * 2 ^ m - 1 := by + have : (b + 1) * 1 ≤ (b + 1) * 2 ^ m := Nat.mul_le_mul_left _ hpm + omega + exact Allowed.Signal q _ (STAllowed.S (2 * (n + m)) _ _ w' q s hN (by omega) he' ho' hs) + · rw [show 2 * m + 1 = m * 2 + 1 by omega] at hk ⊢ + have hn' : Normal n (2 ^ (1 + (m * 2 + 1)) - 2 + b) w := Normal_eq hn rfl hk rfl + rcases I_odd m ldh s hn' hb with ⟨w', hN, hS⟩ + refine ⟨IC w' s, ?_, hS⟩ + have hpm1 := pow2_pos (m + 1) + have hbud' : 2 ^ d' - 1 ≤ b * 2 ^ (m + 1) - 1 := by + have : b * 1 ≤ b * 2 ^ (m + 1) := Nat.mul_le_mul_left _ hpm1 + omega + exact Allowed.Ordinary _ (IAllowed.intro (n + m + 1) _ w' q s hN (by omega) hs + (Or.inr (Or.inl ⟨d', hq, by omega, hbud'⟩))) + +theorem Num_BB {n e o : Nat} {w : List Bool} (m : Nat) (h : Num n e o w) : + Num (n + 2 * m) (e * 2 ^ m) (o * 2 ^ m) (List.replicate (2 * m) false ++ w) := by + induction m with + | zero => exact Num_eq h (by omega) (by omega) (by omega) rfl + | succ m ih => + have hrep : List.replicate (2 * (m + 1)) false ++ w = + false :: false :: (List.replicate (2 * m) false ++ w) := by + rw [show 2 * (m + 1) = 2 + 2 * m by omega, List.replicate_add] + rfl + rw [hrep] + exact Num_eq (Num.B _ _ _ _ (Num.B _ _ _ _ ih)) + (by omega) (by rw [Nat.pow_succ]; ring) (by rw [Nat.pow_succ]; ring) rfl + +theorem Num_Bodd {n e o : Nat} {w : List Bool} (m : Nat) (h : Num n e o w) : + Num (n + 2 * m + 1) (o * 2 ^ (m + 1)) (e * 2 ^ m) (List.replicate (2 * m + 1) false ++ w) := by + have hBB := Num_BB m h + have hrep : List.replicate (2 * m + 1) false ++ w = + false :: (List.replicate (2 * m) false ++ w) := by + rw [show 2 * m + 1 = 1 + 2 * m by omega, List.replicate_add] + rfl + rw [hrep] + exact Num_eq (Num.B _ _ _ _ hBB) (by omega) (by rw [Nat.pow_succ]; ring) rfl rfl + +theorem Num_A_positive {n e o : Nat} {w : List Bool} (h : Num n e o (true :: w)) : 0 < e := by + rcases Num_inv_true h with ⟨_, _, _, rfl, _⟩; omega + +theorem plus_one_tape (k : Nat) {r : ListBlank (Fin 2)} (h : RC (2 ^ (k + 1) + 1) r) : + r = rd1 +> (rd0 ^ k +> (rd1 +> default)) := by + have h0 : RC (2 ^ (k + 1) + 1) (rd1 +> (rd0 ^ k +> (rd1 +> default))) := by + have h1 := RC.d1 (2 ^ k * 1) (rd0 ^ k +> (rd1 +> default)) + (RC_zeros k (RC_eq (RC.d1 0 default RC.zero) (by omega) rfl)) + exact RC_eq h1 (by rw [Nat.pow_succ]; omega) rfl + exact RC_unique h h0 + +theorem Special_entry (n : Nat) (r : ListBlank (Fin 2)) (hn : 1 ≤ n) : + ∃ w, Num (2 * n) (2 ^ n - 2) (2 ^ n - 1) w ∧ + ((ldh <+ ld0 ^ n) |{A}> ([1] +> (rd1 +> r))) [target_tm]⊢⁺ SC w r := by + have hpow : 2 ≤ 2 ^ n := by + cases n with + | zero => omega + | succ n => have := pow2_pos n; rw [Nat.pow_succ]; omega + rcases I_even_exit 0 ldh r (normal_full n) (by omega) with ⟨w, hN, hS⟩ + rw [normal_full_tape (normal_full n) rfl] at hS + have hN' : Num (2 * n) (2 ^ n - 2) (2 ^ n - 1) w := + Num_eq hN (by omega) (by simp; omega) (by simp) rfl + have heq : rd1 ^ (0 * 2) +> ([1, 1, 0, 0] +> r) = [1] +> (rd1 +> r) := rfl + rw [heq] at hS + exact ⟨w, hN', hS⟩ + +theorem Special_one {r : ListBlank (Fin 2)} (hr : RC (2 ^ 1 + 1) r) : + ∃ c', Allowed c' ∧ ((ldh <+ ld0 ^ 1) |{A}> ([1] +> r)) [target_tm]⊢⁺ c' := by + rw [plus_one_tape 0 hr] + rcases Special_entry 1 (rd1 +> default) (by omega) with ⟨w, hN, hS⟩ + rcases ST_S100 hN with ⟨hN', hS'⟩ + refine ⟨SC (false :: w) default, ?_, stepPlus_trans hS (hS' ldh default)⟩ + exact Allowed.Signal 0 _ (STAllowed.S (2 * 1 + 1) _ _ (false :: w) 0 default + hN' (by omega) (by omega) (by omega) RC.zero) + +theorem Special_to_T_one (k : Nat) {r : ListBlank (Fin 2)} (hr : RC (2 ^ (k + 2) + 1) r) : + ∃ e w, Num (2 * (k + 2) + 1) e 0 (true :: w) ∧ + ((ldh <+ ld0 ^ (k + 2)) |{A}> ([1] +> r)) [target_tm]⊢⁺ + TC w k (rd1 +> default) := by + have hr' : RC (2 ^ ((k + 1) + 1) + 1) r := hr + rw [plus_one_tape (k + 1) hr', right_pow_succ rd0 k (rd1 +> default)] + rcases Special_entry (k + 2) (rd0 +> (rd0 ^ k +> (rd1 +> default))) (by omega) with ⟨v, hN, hS⟩ + have hp := pow2_pos k + have hP : 2 ^ (k + 2) = 4 * 2 ^ k := by rw [Nat.pow_add]; ring + have hN' : Num (2 * (k + 2)) (2 + (2 ^ (k + 2) - 4)) (2 ^ (k + 2) - 1) v := + Num_eq hN rfl (by omega) rfl rfl + rcases ST_S000 hN' with ⟨e1, w1, h1, hle1, hS1⟩ + have h1' : Num (2 * (k + 2) + 1) e1 (2 ^ (0 + 2) * (2 ^ k - 1) + 0) (true :: w1) := + Num_eq h1 rfl rfl (by omega) rfl + rcases TZeros k 0 ldh (rd1 +> default) h1' with ⟨e2, w2, h2, hle2, hS2⟩ + refine ⟨e2, w2, h2, ?_⟩ + rw [Nat.zero_add k] at hS2 + exact stepPlus_trans hS (stepPlus_stepStar_trans (hS1 ldh (rd0 ^ k +> (rd1 +> default))) hS2) + +theorem Special_odd (k : Nat) {r : ListBlank (Fin 2)} (hr : RC (2 ^ (2 * k + 3) + 1) r) : + ∃ c', Allowed c' ∧ ((ldh <+ ld0 ^ (2 * k + 3)) |{A}> ([1] +> r)) [target_tm]⊢⁺ c' := by + have hr' : RC (2 ^ ((2 * k + 1) + 2) + 1) r := hr + rcases Special_to_T_one (2 * k + 1) hr' with ⟨e, w, hN, hS⟩ + have hpos := Num_A_positive hN + have hp := pow2_pos k + have hB := Num_Bodd k hN + have hB' : Num (2 * (2 * k + 1 + 2) + 1 + 2 * k + 1) (0 * 2 ^ (k + 1)) (1 + (e * 2 ^ k - 1)) + (List.replicate (2 * k + 1) false ++ true :: w) := + Num_eq hB rfl rfl (by have : 1 ≤ e * 2 ^ k := Nat.mul_pos hpos hp; omega) rfl + rcases ST_T100 hB' with ⟨e', w', hN', hle, hT⟩ + refine ⟨SC (true :: w') default, ?_, ?_⟩ + · exact Allowed.Signal 0 _ (STAllowed.S _ _ _ (true :: w') 0 default + hN' (by omega) (by omega) (by omega) RC.zero) + · rw [TC_word] at hS + exact stepPlus_trans hS (hT ldh default) + +theorem Special_even_R_zero (k : Nat) {r : ListBlank (Fin 2)} (hr : RC (2 ^ (2 * k + 2) + 1) r) : + ((ldh <+ ld0 ^ (2 * k + 2)) |{A}> ([1] +> r)) [target_tm]⊢⁺ + ((ldh <+ ld0 ^ (3 * k + 4)) |{A}> default) := by + rcases Special_to_T_one (2 * k) hr with ⟨e, w, hN, hS⟩ + have hB := Num_BB k hN + have hB' : Num (2 * (3 * k + 2) + 1) (e * 2 ^ k) 0 (List.replicate (2 * k) false ++ true :: w) := + Num_eq hB (by omega) rfl (by omega) rfl + have hT := T100_zero_odd default hB' + rw [show 3 * k + 2 + 2 = 3 * k + 4 by omega] at hT + rw [TC_word] at hS + exact stepPlus_trans hS hT + +theorem cap_plus_one (n : Nat) {r : ListBlank (Fin 2)} (hn : 1 ≤ n) (hr : RC (2 ^ n + 1) r) : + ∃ c', Allowed c' ∧ ((ldh <+ ld0 ^ n) |{A}> ([1] +> r)) [target_tm]⊢⁺ c' := by + rcases n with _ | _ | k + · omega + · exact Special_one hr + · rcases nat_even_or_odd k with ⟨m, rfl⟩ | ⟨m, rfl⟩ + · rcases R_zero_full (3 * m + 4) (by omega) with ⟨c', hA, hS⟩ + exact ⟨c', hA, stepPlus_trans (Special_even_R_zero m hr) hS⟩ + · exact Special_odd m hr + +def cut (n : Nat) : Cfg (Fin 2) (Fin 6) := + ((default <+ cut_tag <+ ld1 ^ n) |{A}> (rd1 ^ (n - 1) +> ([1, 1, 1, 0, 0] +> default))) + +theorem Num_total (w : List Bool) : ∃ e o, Num w.length e o w := by + induction w with + | nil => exact ⟨0, 0, Num.nil⟩ + | cons b w ih => + rcases ih with ⟨e, o, h⟩ + cases b + · exact ⟨o * 2, e, Num_eq (Num.B _ _ _ _ h) (by simp; omega) rfl rfl rfl⟩ + · exact ⟨1 + o * 2, e, Num_eq (Num.A _ _ _ _ h) (by simp; omega) rfl rfl rfl⟩ + +theorem odd_word (m : Nat) : + ∃ w e o, Num (2 * (3 * m + 2)) e o (true :: w) ∧ + ldh <+ l_tape (true :: w) = + default <+ cut_tag <+ ld1 ^ (m * 2) <+ [1, 1, 1] <+ ld1 <+ ld0 ^ m := by + rcases normal_zero (m * 2) with ⟨z, hz⟩ + have hl := normal_length hz + have ht := normal_zero_tape hz rfl + set u := List.replicate (2 * m) true ++ true :: false :: false :: (z ++ [true]) + have hu : u.length = 2 * (3 * m + 2) := by + simp [u, hl]; omega + have hhead : ∃ w, u = true :: w := by + cases m with + | zero => exact ⟨false :: false :: (z ++ [true]), rfl⟩ + | succ m => + have : 2 * (m + 1) = (2 * m + 1) + 1 := by omega + rw [show u = (List.replicate (2 * (m + 1)) true) ++ true :: false :: false :: (z ++ [true]) by rfl, + this, List.replicate_succ, List.cons_append] + exact ⟨_, rfl⟩ + rcases hhead with ⟨w, hw⟩ + rcases Num_total u with ⟨e, o, hN⟩ + refine ⟨w, e, o, ?_, ?_⟩ + · rw [← hu] + exact Num_eq hN rfl rfl rfl hw + · rw [← hw] + simp only [u, l_tape_append, l_tape_cons, l_tape_nil, + normal_full_tape (normal_full m) rfl, ht] + simp [ldh, cut_tag, digit, Half, ld1, listblank_append_assoc] + +theorem FC_head_one (r : ListBlank (Fin 2)) (t : Nat) : + FC ([0] +> r) (t + 1) 1 ([1] +> (rd0 ^ (t + 1) +> r)) := by + have h0 := FC.d1 t 0 (rd0 ^ t +> ([0] +> r)) (FC_zero ([0] +> r) t) + have heq : rd1 +> (rd0 ^ t +> ([0] +> r)) = [1] +> (rd0 ^ (t + 1) +> r) := by + rw [right_pow_succ rd0 t r] + change rd1 +> (rd0 ^ t +> (([0] : List (Fin 2)) +> r)) = + rd1 +> (([0] : List (Fin 2)) +> (rd0 ^ t +> r)) + rw [one_zero_comm_rd0_pow t r] + exact FC_eq h0 rfl (by omega) heq + +theorem cut_even (m : Nat) : ∃ c', Allowed c' ∧ (cut (2 + m * 2)) [target_tm]⊢⁺ c' := by + rcases R_zero_full (4 + m * 3) (by omega) with ⟨c', hA, hS⟩ + refine ⟨c', hA, ?_⟩ + have s1 := even_capacity_cleanup m default + have heq0 : ([0] : List (Fin 2)) +> (default : ListBlank (Fin 2)) = default := zero_cons_default + rw [heq0] at s1 + have hcut : cut (2 + m * 2) = + ((default <+ cut_tag <+ ld1 ^ (2 + m * 2)) |{A}> (rd1 ^ (1 + m * 2) +> ([1, 1, 1, 0, 0] +> default))) := by + simp [cut, show 2 + m * 2 - 1 = 1 + m * 2 by omega] + rw [hcut] + exact stepPlus_trans s1 hS + +theorem cut_odd (m : Nat) : ∃ c', Allowed c' ∧ (cut (1 + m * 2)) [target_tm]⊢⁺ c' := by + rcases odd_word m with ⟨w, e, o, hN, ht⟩ + have hr1 : RC 1 ([1, 0] +> default) := by + have h0 : RC 1 (rd1 +> default) := RC_eq (RC.d1 0 default RC.zero) (by omega) rfl + have heq : rd1 +> (default : ListBlank (Fin 2)) = [1, 0] +> default := by simp [rd1] + rwa [heq] at h0 + rcases even_R_return hN (by omega) hr1 (by omega) with ⟨c', hA, hS⟩ + refine ⟨c', hA, ?_⟩ + have s1 := odd_capacity_entry (default <+ cut_tag <+ ld1 ^ (m * 2)) default m + have hcut : cut (1 + m * 2) = + ((default <+ cut_tag <+ ld1 ^ (m * 2) <+ ld1) |{A}> (rd1 ^ (m * 2) +> ([1, 1, 1, 0, 0] +> default))) := by + dsimp [cut] + rw [show 1 + m * 2 - 1 = m * 2 by omega, + show 1 + m * 2 = m * 2 + 1 by omega, + left_pow_succ (default <+ cut_tag) ld1 (m * 2)] + rw [hcut] + rw [ht] at hS + exact stepPlus_trans s1 hS + +theorem cut_return (n : Nat) (hn : 1 ≤ n) : ∃ c', Allowed c' ∧ (cut n) [target_tm]⊢⁺ c' := by + rcases nat_even_or_odd n with ⟨m, rfl⟩ | ⟨m, rfl⟩ + · cases m with + | zero => omega + | succ m => + rw [show 2 * (m + 1) = 2 + m * 2 by omega] + exact cut_even m + · rw [show 2 * m + 1 = 1 + m * 2 by omega] + exact cut_odd m + +theorem two_batches {n b : Nat} {w : List Bool} (t : Nat) (l r : ListBlank (Fin 2)) + (hn : Normal n (2 ^ (1 + (t + 1)) - 2 + b) w) : + ∃ w', Normal n b w' ∧ + ((l <+ l_tape w) |{A}> ([1] +> (rd0 ^ (t + 1) +> ([1] +> r)))) [target_tm]⊢* + ((l <+ l_tape w') |{A}> (rd1 ^ (t + 1) +> ([1, 1] +> r))) := by + have hp := pow2_pos t + have hp1 : 2 ≤ 2 ^ (t + 1) := by rw [Nat.pow_succ]; omega + have hn' : Normal n ((2 ^ (t + 1) - 2) + (2 ^ (t + 1) + b)) w := + Normal_eq hn rfl (by rw [show 1 + (t + 1) = (t + 1) + 1 by omega, Nat.pow_succ]; omega) rfl + rcases normal_FC_Rpairs ([0, 1] +> r) (t + 1) (2 ^ (t + 1) - 2) hn' (FC_head_one ([1] +> r) t) (by omega) + with ⟨w1, r1, h1, hr1, hS1⟩ + have hr1_eq : r1 = rd1 ^ (t + 1) +> ([0, 1] +> r) := + FC_full_unique (FC_eq hr1 rfl (by omega) rfl) + subst hr1_eq + have h1' : Normal n (1 + ((2 ^ (t + 1) - 1) + b)) w1 := + Normal_eq h1 rfl (by omega) rfl + rcases normal_LInc h1' with ⟨w2, h2, hL⟩ + rcases normal_FC_Rpairs ([1, 1] +> r) (t + 1) (2 ^ (t + 1) - 1) h2 + (FC_zero ([1, 1] +> r) (t + 1)) (by omega) + with ⟨w3, r3, h3, hr3, hS3⟩ + have hr3_eq : r3 = rd1 ^ (t + 1) +> ([1, 1] +> r) := + FC_full_unique (FC_eq hr3 rfl (by omega) rfl) + subst hr3_eq + refine ⟨w3, h3, ?_⟩ + have s1 := hS1 l + have s2 := RInc_rule (l <+ l_tape w1) ([1] +> r) (t + 1) + have heq2 : ([0] : List (Fin 2)) +> ([1] +> r) = [0, 1] +> r := rfl + have heq2' : ([1] : List (Fin 2)) +> ([1] +> r) = [1, 1] +> r := rfl + rw [heq2, heq2'] at s2 + have s3 := hL l (rd0 ^ (t + 1) +> ([1, 1] +> r)) + have s4 := hS3 l + exact stepStar_trans s1 + (stepStar_trans (stepPlus_to_stepStar s2) + (stepStar_trans (stepPlus_to_stepStar s3) s4)) + +theorem ldh_ld0_pow_half0 (k : Nat) : + ldh <+ ld0 ^ k <+ Half 0 = default <+ cut_tag <+ ld0 ^ k := by + induction k with + | zero => rfl + | succ k ih => + rw [left_pow_succ ldh ld0 k, left_pow_succ (default <+ cut_tag) ld0 k, ← ih] + rfl + +theorem Saturated_front (n : Nat) : + ((ldh <+ ld0 ^ (n + 1)) |{A}> ([1] +> (rd0 ^ (n + 1) +> (rd1 +> default)))) [target_tm]⊢⁺ + ((default <+ cut_tag <+ ld0 ^ (n + 1)) <{B}| ([1] +> (rd0 ^ n +> ([1, 1, 0, 0] +> default)))) := by + have hp := pow2_pos n + have hp1 : 2 ≤ 2 ^ (n + 1) := by rw [Nat.pow_succ]; omega + have hn : Normal (n + 1) ((2 ^ (n + 1) - 2) + 1) (List.replicate (2 * (n + 1)) true) := + Normal_eq (normal_full (n + 1)) rfl (by omega) rfl + rcases normal_FC_Rpairs ([0, 1, 0, 0] +> default) (n + 1) (2 ^ (n + 1) - 2) hn + (FC_insert_one default n) (by omega) with ⟨w1, r1, h1, hr1, hS1⟩ + have hr1_eq : r1 = rd1 ^ (n + 1) +> ([0, 1, 0, 0] +> default) := + FC_full_unique (FC_eq hr1 rfl (by omega) rfl) + subst hr1_eq + have h1' : Normal (n + 1) (1 + 0) w1 := Normal_eq h1 rfl (by omega) rfl + rcases normal_LInc h1' with ⟨w2, h2, hL⟩ + have s1 := hS1 ldh + rw [normal_full_tape (normal_full (n + 1)) rfl] at s1 + have s2 := RInc_rule (ldh <+ l_tape w1) ([1, 0, 0] +> default) (n + 1) + have heq2 : ([0] : List (Fin 2)) +> ([1, 0, 0] +> (default : ListBlank (Fin 2))) = [0, 1, 0, 0] +> default := rfl + have heq2' : ([1] : List (Fin 2)) +> ([1, 0, 0] +> (default : ListBlank (Fin 2))) = [1, 1, 0, 0] +> default := rfl + rw [heq2, heq2'] at s2 + have s3 := hL ldh (rd0 ^ (n + 1) +> ([1, 1, 0, 0] +> default)) + rw [normal_zero_tape h2 rfl] at s3 + have s4 := RInc_rule (ldh <+ ld1 ^ (n + 1)) ([0, 0] +> (rd0 ^ n +> ([1, 1, 0, 0] +> default))) 0 + have heq4 : rd1 ^ 0 +> ([0] +> ([0, 0] +> (rd0 ^ n +> ([1, 1, 0, 0] +> default)))) = + rd0 ^ (n + 1) +> ([1, 1, 0, 0] +> default) := by + rw [right_pow_succ rd0 n ([1, 1, 0, 0] +> default)] + rfl + have heq4' : rd0 ^ 0 +> ([1] +> ([0, 0] +> (rd0 ^ n +> ([1, 1, 0, 0] +> default)))) = + rd1 +> (rd0 ^ n +> ([1, 1, 0, 0] +> default)) := rfl + rw [heq4, heq4'] at s4 + have s5 := LOv (rd1 +> (rd0 ^ n +> ([1, 1, 0, 0] +> default))) n + rw [Nat.add_comm 1 n] at s5 + have s6 := R1100Turn (ldh <+ ld0 ^ (n + 1)) (rd0 ^ n +> ([1, 1, 0, 0] +> default)) + have heq6 : ([1] : List (Fin 2)) +> (rd1 +> (rd0 ^ n +> ([1, 1, 0, 0] +> default))) = + [1, 1, 0, 0] +> (rd0 ^ n +> ([1, 1, 0, 0] +> default)) := rfl + have heq6' := ldh_ld0_pow_half0 (n + 1) + rw [← heq6, heq6'] at s6 + exact stepStar_stepPlus_trans s1 + (stepPlus_trans s2 + (stepPlus_trans s3 + (stepPlus_trans s4 + (stepPlus_trans s5 s6)))) + +theorem to_cut (n : Nat) (hlen : 1 ≤ n) : + ((ldh <+ ld0 ^ n) |{A}> ([1] +> (rd0 ^ n +> (rd1 +> default)))) [target_tm]⊢⁺ cut n := by + rcases n with _ | _ | n + · omega + · simpa [cut, rd0, rd1] using! saturated_one default + · have hp := pow2_pos n + have hp1 : 2 ≤ 2 ^ (n + 1 + 1) := by rw [Nat.pow_succ, Nat.pow_succ]; omega + have hn : Normal (n + 1 + 1) (1 + (2 ^ (n + 1 + 1) - 2)) (List.replicate (2 * (n + 1 + 1)) true) := + Normal_eq (normal_full (n + 1 + 1)) rfl (by omega) rfl + rcases normal_LInc hn with ⟨w1, h1, hL⟩ + have h1' : Normal (n + 1 + 1) (2 ^ (1 + (n + 1)) - 2 + 0) w1 := + Normal_eq h1 rfl (by rw [show 1 + (n + 1) = n + 1 + 1 by omega]; omega) rfl + rcases two_batches n (default <+ cut_tag) ([1, 0, 0] +> default) h1' with ⟨w2, h2, hS⟩ + rw [normal_zero_tape h2 rfl] at hS + rw [normal_full_tape (normal_full (n + 1 + 1)) rfl] at hL + have s1 := Saturated_front (n + 1) + have s2 := hL (default <+ cut_tag) ([1] +> (rd0 ^ (n + 1) +> ([1, 1, 0, 0] +> default))) + have heq2 : ([1, 1, 0, 0] : List (Fin 2)) +> (default : ListBlank (Fin 2)) = + [1] +> ([1, 0, 0] +> default) := rfl + have heq3 : ([1, 1] : List (Fin 2)) +> ([1, 0, 0] +> (default : ListBlank (Fin 2))) = + [1, 1, 1, 0, 0] +> default := rfl + rw [heq2] at s2 + rw [heq3] at hS + exact stepPlus_trans s1 (stepPlus_stepStar_trans s2 hS) + +theorem Saturated_full {n : Nat} {w : List Bool} {r : ListBlank (Fin 2)} + (hn : Normal n (2 ^ n - 1) w) (hlen : 1 ≤ n) (hr : RC (2 ^ n) r) : + ∃ c', Allowed c' ∧ (IC w r) [target_tm]⊢⁺ c' := by + rcases cut_return n hlen with ⟨c', hA, hS⟩ + have hr1 : RC 1 (rd1 +> default) := RC_eq (RC.d1 0 default RC.zero) (by omega) rfl + have hr0 : RC (2 ^ n) (rd0 ^ n +> (rd1 +> default)) := + RC_eq (RC_zeros n hr1) (by omega) rfl + have hr_eq : r = rd0 ^ n +> (rd1 +> default) := RC_unique hr hr0 + subst hr_eq + refine ⟨c', hA, ?_⟩ + simp only [IC, normal_full_tape hn rfl] + exact stepPlus_trans (to_cut n hlen) hS + +theorem I_step {c : Cfg (Fin 2) (Fin 6)} (hI : IAllowed c) : + ∃ c', Allowed c' ∧ c [target_tm]⊢⁺ c' := by + cases hI with + | intro n k w z r hN hlen hr hg => + rcases Nat.eq_zero_or_pos z with rfl | hz + · exact I_zero hN hlen hr + · rcases hg with rfl | ⟨d, hd, hdn, hk⟩ | ⟨hk, hb⟩ + · omega + · exact IClosure_small d hN hlen hr hz hd hdn hk + · rcases Nat.lt_or_ge z (2 ^ n) with hlt | hge + · exact IClosure_small n hN hlen hr hz hlt (Nat.le_refl n) (by omega) + · rcases Nat.lt_or_ge (2 ^ n) z with hgt | hle + · have hz1 : z = 2 ^ n + 1 := by omega + subst hz1 + simp only [IC, normal_full_tape hN hk] + exact cap_plus_one n hlen hr + · have heq : z = 2 ^ n := by omega + subst heq; subst hk; exact Saturated_full hN hlen hr + +theorem Allowed_step {c : Cfg (Fin 2) (Fin 6)} (hA : Allowed c) : + ∃ c', Allowed c' ∧ c [target_tm]⊢⁺ c' := by + cases hA with + | Ordinary c hI => exact I_step hI + | Ten z c hJ => + rcases Ten_to_zero z hJ with ⟨c1, hJ0, hS1⟩ + rcases J_zero hJ0 with ⟨c2, hA2, hS2⟩ + exact ⟨c2, hA2, stepStar_stepPlus_trans hS1 hS2⟩ + | Signal z c hS => + rcases ST_to_zero z hS with ⟨c1, hS0, hS1⟩ + rcases S_zero hS0 with ⟨c2, hA2, hS2⟩ + exact ⟨c2, hA2, stepStar_stepPlus_trans hS1 hS2⟩ + +theorem seed_allowed : Allowed ((ldh <+ ld0 ^ 1) |{A}> ([1] +> (rd0 +> (rd1 +> default)))) := by + have hr1 : RC 1 (rd1 +> default) := RC_eq (RC.d1 0 default RC.zero) (by omega) rfl + have hr2 : RC 2 (rd0 +> (rd1 +> default)) := RC_eq (RC.d0 1 (rd1 +> default) hr1) (by omega) rfl + exact Allowed.Ordinary _ (I_full 1 2 (rd0 +> (rd1 +> default)) (by omega) (by omega) hr2) + +theorem multiStep_none_add {c : Cfg (Fin 2) (Fin 6)} {k : Nat} + (h : multiStep target_tm c k = none) (d : Nat) : + multiStep target_tm c (k + d) = none := by + rw [multiStep_add, h]; rfl + +theorem reach_arbitrarily_long : + ∀ m : Nat, ∃ N c, m ≤ N ∧ Allowed c ∧ multiStep target_tm (init []) N = some c + | 0 => by + rcases init_to_seed with ⟨N₀, hN₀⟩ + exact ⟨N₀, _, Nat.zero_le N₀, seed_allowed, hN₀⟩ + | m + 1 => by + rcases reach_arbitrarily_long m with ⟨N, c, h_le, hc, hN⟩ + rcases Allowed_step hc with ⟨c', hc', k, hk_pos, hk⟩ + exact ⟨N + k, c', by omega, hc', multiStep_trans target_tm _ _ _ N k hN hk⟩ + +end Solution + + + +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg ⟨k, hk⟩ + cases h_step : step target_tm cfg with + | some cfg' => rfl + | none => + have h_none : multiStep target_tm (init []) (k + 1) = none := by + rw [multiStep_succ', hk]; exact h_step + rcases reach_arbitrarily_long (k + 1) with ⟨N, _, h_ge, _, hN⟩ + have h_split : N = (k + 1) + (N - (k + 1)) := by omega + have h_none_N : multiStep target_tm (init []) N = none := by + rw [h_split] + exact multiStep_none_add h_none (N - (k + 1)) + rw [h_none_N] at hN + nomatch hN + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1LD_1RC0RB_1LA0RE_1LC1LE_1LF0LA_0REHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LD_1RC0RB_1LA1RE_1LF0LA_1LA0RD_1LCHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LD_1RC0RB_1LA1RE_1LF0LA_1LA0RD_1LCHHH.lean new file mode 100644 index 00000000..db0461b2 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LD_1RC0RB_1LA1RE_1LF0LA_1LA0RD_1LCHHH.lean @@ -0,0 +1,2120 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter + +open Mathlib Relation Nat Turing BusyBeaver SixState + +@[expose] public section + +namespace BusyBeaver.M_1RB1LD_1RC0RB_1LA1RE_1LF0LA_1LA0RD_1LCHHH + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LD_1RC0RB_1LA1RE_1LF0LA_1LA0RD_1LCHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end BusyBeaver.M_1RB1LD_1RC0RB_1LA1RE_1LF0LA_1LA0RD_1LCHHH + +end + +namespace BusyBeaver.M_1RB1LD_1RC0RB_1LA1RE_1LF0LA_1LA0RD_1LCHHH + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + + + +namespace Solution + +-- ============================================================================ +-- Section 1: Basic Utilities & PairWord +-- ============================================================================ + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 + +local notation3 l " |{" q "}> " r => (r <{{q}} l : Cfg (Fin 2) (Fin 6)) +local notation3 l " <{" q "}| " r => (r {{q}}> l : Cfg (Fin 2) (Fin 6)) + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : + multiStep M config 0 = some config := rfl + +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : + multiStep M config 1 = step M config := rfl + +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +theorem multiStep_add (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n + m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem multiStep_step {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} {n : Nat} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢^{n} c₃) : c₁ [tm]⊢^{n + 1} c₃ := by + have := multiStep_trans tm c₁ c₂ c₃ 1 n h₁ h₂ + rwa [Nat.add_comm 1 n] at this + +theorem stepStar_refl (c : Cfg (Fin 2) (Fin 6)) : c [target_tm]⊢* c := ⟨0, rfl⟩ + +theorem stepPlus_to_stepStar {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢⁺ c₂) : + c₁ [target_tm]⊢* c₂ := by + rcases h with ⟨n, _, hn⟩; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [target_tm]⊢⁺ c₂) (h₂ : c₂ [target_tm]⊢* c₃) : c₁ [target_tm]⊢⁺ c₃ := by + rcases h₁ with ⟨n, hn_pos, hn⟩; rcases h₂ with ⟨m, hm⟩ + exact ⟨n + m, Nat.add_pos_left hn_pos m, multiStep_trans target_tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h₁ : c₁ [target_tm]⊢* c₂) (h₂ : c₂ [target_tm]⊢⁺ c₃) : c₁ [target_tm]⊢⁺ c₃ := by + rcases h₁ with ⟨n, hn⟩; rcases h₂ with ⟨m, hm_pos, hm⟩ + exact ⟨n + m, Nat.add_pos_right n hm_pos, multiStep_trans target_tm c₁ c₂ c₃ n m hn hm⟩ + +omit [Inhabited Γ] in +@[simp] theorem pow_zero_list (l : List Γ) : l ^ (0 : Nat) = [] := rfl + +omit [Inhabited Γ] in +theorem pow_succ_list (l : List Γ) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl + +omit [Inhabited Γ] in +@[simp] theorem list_pow_add (l : List Γ) (n m : Nat) : l ^ (n + m) = l ^ n ++ l ^ m := by + induction n with + | zero => simp + | succ n ih => + rw [Nat.succ_add, pow_succ_list, pow_succ_list, ih, List.append_assoc] + +omit [Inhabited Γ] in +theorem pow_succ_right (l : List Γ) (n : Nat) : l ^ (n + 1) = l ^ n ++ l := by + rw [list_pow_add]; simp [pow_succ_list] + +@[simp] theorem listblank_append_nil (s : ListBlank Γ) : ([] : List Γ) +> s = s := rfl + +@[simp] theorem listblank_append_cons (a : Γ) (l : List Γ) (s : ListBlank Γ) : + (a :: l) +> s = a >> (l +> s) := rfl + +@[simp] theorem listblank_append_assoc (l₁ l₂ : List Γ) (s : ListBlank Γ) : + (l₁ ++ l₂) +> s = l₁ +> (l₂ +> s) := + Turing.ListBlank.append_assoc l₁ l₂ s + +theorem left_pow_add (l : ListBlank (Fin 2)) (u : List (Fin 2)) (n m : Nat) : + l <+ u ^ (n + m) = l <+ u ^ m <+ u ^ n := by + rw [list_pow_add, listblank_append_assoc] + +theorem right_pow_succ (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + u ^ (n + 1) +> r = u +> (u ^ n +> r) := by + rw [pow_succ_list, listblank_append_assoc] + +theorem right_pow_succ_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + u ^ (n + 1) +> r = u ^ n +> (u +> r) := by + rw [pow_succ_right, listblank_append_assoc] + +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +@[simp] theorem zero_cons_default : (0 : Fin 2) >> (default : ListBlank (Fin 2)) = default := by + change ListBlank.cons default default = default + exact ListBlank.cons_head_tail default + +@[simp] theorem init_nil : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = + ⟨some A, ⟨0, default, default⟩⟩ := rfl + +def rd1 : List (Fin 2) := [1, 0, 0, 0] +def rds : List (Fin 2) := [0, 0, 0, 1] + +def bit (b : Bool) : Fin 2 := if b then 1 else 0 + +@[simp] theorem bit_false : bit false = 0 := rfl +@[simp] theorem bit_true : bit true = 1 := rfl + +def pairs : List Bool → List (Fin 2) + | [] => [] + | b :: u => bit b :: 1 :: pairs u + +@[simp] theorem pairs_nil : pairs [] = [] := rfl +@[simp] theorem pairs_cons (b : Bool) (u : List Bool) : + pairs (b :: u) = bit b :: 1 :: pairs u := rfl + +def data (w : List Bool) : ListBlank (Fin 2) := + default <+ [1] <+ pairs w + +@[simp] theorem data_cons (b : Bool) (u : List Bool) : + data (b :: u) = data u <+ [bit b, 1] := rfl + +def insert (b : Bool) (r : ListBlank (Fin 2)) : ListBlank (Fin 2) := + if b then [1] +> r else r + +@[simp] theorem insert_false (r : ListBlank (Fin 2)) : insert false r = r := rfl +@[simp] theorem insert_true (r : ListBlank (Fin 2)) : insert true r = [1] +> r := rfl + +def Conf (w : List Bool) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ((data w <+ [0, 1]) |{A}> r) + +def inc : List Bool → List Bool × Bool + | [] => ([false], false) + | false :: u => (true :: u, false) + | [true] => ([false], true) + | true :: false :: u => (false :: true :: u, false) + | [true, true] => ([false, false], true) + | true :: true :: _ :: u => + let (v, e) := inc u + (false :: false :: false :: v, e) + +def push0 (n : Nat) (w : List Bool) : List Bool := + List.replicate n false ++ w + +theorem push0_cons (n : Nat) (v : List Bool) : + push0 n (false :: v) = push0 (n + 1) v := by + induction n with + | zero => rfl + | succ n ih => + dsimp [push0] at ih ⊢ + rw [List.replicate_succ, List.cons_append, ih] + rfl + +theorem pairs_push0 (n : Nat) (w : List Bool) : + pairs (push0 n w) = ([0, 1] : List (Fin 2)) ^ n ++ pairs w := by + induction n with + | zero => rfl + | succ n ih => + dsimp [push0] at ih ⊢ + rw [List.replicate_succ, List.cons_append, pairs_cons, bit_false, ih, pow_succ_list] + rfl + +theorem data_push0 (n : Nat) (w : List Bool) : + data (push0 n w) = data w <+ ([0, 1] : List (Fin 2)) ^ n := by + simp [data, pairs_push0] + +theorem pow_comm_01 (n : Nat) (s : ListBlank (Fin 2)) : + ([0, 1] : List (Fin 2)) ^ n +> ([0, 1] +> s) = + [0, 1] +> (([0, 1] : List (Fin 2)) ^ n +> s) := by + rw [← right_pow_succ_right [0, 1] n s, ← right_pow_succ [0, 1] n s] + +theorem Conf_push0 (m : Nat) (w : List Bool) (r : ListBlank (Fin 2)) : + Conf (push0 m w) r = ((data w <+ ([0, 1] : List (Fin 2)) ^ (m + 1)) |{A}> r) := by + dsimp [Conf] + rw [data_push0, pow_succ_list] + simp + +theorem pairs_ones (n : Nat) (w : List Bool) : + pairs (List.replicate n true ++ w) = ([1, 1] : List (Fin 2)) ^ n ++ pairs w := by + induction n with + | zero => rfl + | succ n ih => + rw [List.replicate_succ, List.cons_append, pairs_cons, bit_true, ih, pow_succ_list] + rfl + +theorem data_ones (n : Nat) (w : List Bool) : + data (List.replicate n true ++ w) = data w <+ ([1, 1] : List (Fin 2)) ^ n := by + simp [data, pairs_ones] + +theorem one_comm_11_pow (n : Nat) (r : ListBlank (Fin 2)) : + ([1] : List (Fin 2)) +> (([1, 1] : List (Fin 2)) ^ n +> r) = + ([1, 1] : List (Fin 2)) ^ n +> ([1] +> r) := by + induction n with + | zero => rfl + | succ n ih => + rw [right_pow_succ [1, 1] n r, right_pow_succ [1, 1] n ([1] +> r), ← ih] + rfl + +theorem insert_scan (b : Bool) (n : Nat) (r : ListBlank (Fin 2)) : + insert b (([1, 1] : List (Fin 2)) ^ n +> r) = + ([1, 1] : List (Fin 2)) ^ n +> insert b r := by + cases b + · rfl + · exact one_comm_11_pow n r + +macro "step1" : tactic => `(tactic| ( + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, init_nil, rd0, rd1, rds, + bit_false, bit_true, + pairs_nil, pairs_cons, data, insert_false, insert_true, + pow_succ_list, pow_zero_list, + List.singleton_append, List.nil_append, List.cons_append, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail] + refine multiStep_step (by rfl) ?_ + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Tape.write, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail])) + +macro "run_steps" n:num : tactic => `(tactic| ( + iterate $n step1 + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, rd0, rd1, rds, bit_false, bit_true, + pairs_nil, pairs_cons, data, insert_false, insert_true, + pow_succ_list, pow_zero_list, + List.singleton_append, List.nil_append, List.cons_append, + listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail, multiStep_zero] + rfl)) + +-- ============================================================================ +-- Section 2: Machine-Specific Rules (A2Words) +-- ============================================================================ + +theorem CScan_step (l r : ListBlank (Fin 2)) : + (l |{A}> (rd1 +> r)) [target_tm]⊢⁺ + ((l <+ ([1, 1] : List (Fin 2)) ^ 2) |{A}> r) := + ⟨4, by omega, by run_steps 4⟩ + +theorem CScan (l r : ListBlank (Fin 2)) (n : Nat) : + (l |{A}> (rd1 ^ n +> r)) [target_tm]⊢* + ((l <+ ([1, 1] : List (Fin 2)) ^ (n * 2)) |{A}> r) := by + induction n generalizing l with + | zero => try exact stepStar_refl _ + | succ n ih => + rw [right_pow_succ rd1 n r, show (n + 1) * 2 = n * 2 + 2 by omega, + left_pow_add l [1, 1] (n * 2) 2] + exact stepStar_trans (stepPlus_to_stepStar (CScan_step l (rd1 ^ n +> r))) + (ih (l <+ ([1, 1] : List (Fin 2)) ^ 2)) + +theorem CZero (l r : ListBlank (Fin 2)) : + (l |{A}> ([0] +> r)) [target_tm]⊢⁺ + (l <{B}| ([1] +> r)) := + ⟨1, by omega, by run_steps 1⟩ + +theorem DScan_step (l r : ListBlank (Fin 2)) : + ((l <+ ([1, 1] : List (Fin 2)) ^ 2) <{B}| r) [target_tm]⊢⁺ + (l <{B}| (rd0 +> r)) := + ⟨4, by omega, by run_steps 4⟩ + +theorem DScan (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ ([1, 1] : List (Fin 2)) ^ (n * 2)) <{B}| r) [target_tm]⊢* + (l <{B}| (rd0 ^ n +> r)) := by + induction n generalizing r with + | zero => try exact stepStar_refl _ + | succ n ih => + rw [show (n + 1) * 2 = 2 + n * 2 by omega, left_pow_add l [1, 1] 2 (n * 2), + right_pow_succ_right rd0 n r] + exact stepStar_trans (stepPlus_to_stepStar (DScan_step (l <+ ([1, + 1] : List (Fin 2)) ^ (n * 2)) r)) + (ih (rd0 +> r)) + +theorem RInc4 (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ [0, 1]) |{A}> (rd1 ^ n +> ([0] +> r))) [target_tm]⊢⁺ + ((l <+ [0, 1]) <{B}| (rd0 ^ n +> ([1] +> r))) := by + have s1 := CScan (l <+ [0, 1]) ([0] +> r) n + have s2 := CZero (l <+ [0, 1] <+ ([1, 1] : List (Fin 2)) ^ (n * 2)) r + have s3 := DScan (l <+ [0, 1]) ([1] +> r) n + exact stepStar_stepPlus_trans s1 (stepPlus_stepStar_trans s2 s3) + +theorem LStart (l r : ListBlank (Fin 2)) : + ((l <+ [0, 1]) <{B}| r) [target_tm]⊢⁺ + (l |{C}> ([1, 1] +> r)) := + ⟨1, by omega, by run_steps 1⟩ + +theorem ZCarryMarked (b : Bool) (l r : ListBlank (Fin 2)) : + ((l <+ [1, 1, 1, 1, bit b, 1]) |{C}> ([1] +> r)) [target_tm]⊢⁺ + (l |{C}> ([1, 1, 1, 1, 1, 1, 1] +> r)) := by + cases b + · exact ⟨14, by omega, by run_steps 14⟩ + · exact ⟨10, by omega, by run_steps 10⟩ + +theorem BScan6_step (l r : ListBlank (Fin 2)) : + ((l <+ ([1, 1] : List (Fin 2)) ^ 3) |{C}> ([1] +> r)) [target_tm]⊢⁺ + (l |{C}> ([1] +> (([1, 1] : List (Fin 2)) ^ 3 +> r))) := + ⟨10, by omega, by run_steps 10⟩ + +theorem BScan6 (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ ([1, 1] : List (Fin 2)) ^ (n * 3)) |{C}> ([1] +> r)) [target_tm]⊢* + (l |{C}> ([1] +> (([1, 1] : List (Fin 2)) ^ (n * 3) +> r))) := by + induction n generalizing r with + | zero => try exact stepStar_refl _ + | succ n ih => + rw [show (n + 1) * 3 = 3 + n * 3 by omega, left_pow_add l [1, 1] 3 (n * 3), + show 3 + n * 3 = n * 3 + 3 by omega, list_pow_add [1, 1] (n * 3) 3, + listblank_append_assoc] + exact stepStar_trans + (stepPlus_to_stepStar (BScan6_step (l <+ ([1, 1] : List (Fin 2)) ^ (n * 3)) r)) + (ih (([1, 1] : List (Fin 2)) ^ 3 +> r)) + +theorem C11_step (l r : ListBlank (Fin 2)) : + (l |{A}> ([1, 1] +> r)) [target_tm]⊢⁺ + ((l <+ [0, 1]) |{A}> r) := + ⟨2, by omega, by run_steps 2⟩ + +theorem CScan11 (l r : ListBlank (Fin 2)) (n : Nat) : + (l |{A}> (([1, 1] : List (Fin 2)) ^ n +> r)) [target_tm]⊢* + ((l <+ ([0, 1] : List (Fin 2)) ^ n) |{A}> r) := by + induction n generalizing l with + | zero => try exact stepStar_refl _ + | succ n ih => + rw [right_pow_succ [1, 1] n r, show n + 1 = n + 1 by rfl, + left_pow_add l [0, 1] n 1] + exact stepStar_trans (stepPlus_to_stepStar (C11_step l (([1, 1] : List (Fin 2)) ^ n +> r))) + (ih (l <+ [0, 1])) + +theorem REleven (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ [0, 1]) |{A}> (rd1 ^ n +> ([1, 1] +> r))) [target_tm]⊢⁺ + ((l <+ [0, 1] <+ ([1, 1] : List (Fin 2)) ^ (n * 2) <+ [0, 1]) |{A}> r) := + stepStar_stepPlus_trans (CScan (l <+ [0, 1]) ([1, 1] +> r) n) + (C11_step (l <+ [0, 1] <+ ([1, 1] : List (Fin 2)) ^ (n * 2)) r) + +theorem ZInc_nil (r : ListBlank (Fin 2)) : + (data [] |{C}> ([1, 1] +> r)) [target_tm]⊢⁺ + ((data [false] <+ [0, 1]) |{A}> insert false r) := + ⟨14, by omega, by run_steps 14⟩ + +theorem ZInc_false (u : List Bool) (r : ListBlank (Fin 2)) : + (data (false :: u) |{C}> ([1, 1] +> r)) [target_tm]⊢⁺ + ((data (true :: u) <+ [0, 1]) |{A}> insert false r) := + ⟨4, by omega, by run_steps 4⟩ + +theorem ZInc_one_true (r : ListBlank (Fin 2)) : + (data [true] |{C}> ([1, 1] +> r)) [target_tm]⊢⁺ + ((data [false] <+ [0, 1]) |{A}> insert true r) := + ⟨11, by omega, by run_steps 11⟩ + +theorem ZInc_true_false (u : List Bool) (r : ListBlank (Fin 2)) : + (data (true :: false :: u) |{C}> ([1, 1] +> r)) [target_tm]⊢⁺ + ((data (false :: true :: u) <+ [0, 1]) |{A}> insert false r) := + ⟨10, by omega, by run_steps 10⟩ + +theorem ZInc_two_true (r : ListBlank (Fin 2)) : + (data [true, true] |{C}> ([1, 1] +> r)) [target_tm]⊢⁺ + ((data [false, false] <+ [0, 1]) |{A}> insert true r) := + ⟨17, by omega, by run_steps 17⟩ + +theorem ZInc_rec_exit (v : List Bool) (e : Bool) (r : ListBlank (Fin 2)) : + ((data v <+ [0, 1]) |{A}> insert e ([1, 1, 1, 1, 1, 1] +> r)) [target_tm]⊢⁺ + ((data (false :: false :: false :: v) <+ [0, 1]) |{A}> insert e r) := by + cases e <;> exact ⟨6, by omega, by run_steps 6⟩ + +theorem ZInc (w : List Bool) (r : ListBlank (Fin 2)) : + (data w |{C}> ([1, 1] +> r)) [target_tm]⊢⁺ + ((data (inc w).1 <+ [0, 1]) |{A}> insert (inc w).2 r) := by + match w with + | [] => exact ZInc_nil r + | false :: u => exact ZInc_false u r + | [true] => exact ZInc_one_true r + | true :: false :: u => exact ZInc_true_false u r + | [true, true] => exact ZInc_two_true r + | true :: true :: b :: u => + have s1 : (data (true :: true :: b :: u) |{C}> ([1, 1] +> r)) [target_tm]⊢⁺ + (data u |{C}> ([1, 1] +> ([1, 1, 1, 1, 1, 1] +> r))) := by + simpa [data, pairs] using ZCarryMarked b (data u) ([1] +> r) + have s2 := ZInc u ([1, 1, 1, 1, 1, 1] +> r) + have s3 := ZInc_rec_exit (inc u).1 (inc u).2 r + have hinc : inc (true :: true :: b :: u) = (false :: false :: false :: (inc u).1, (inc u).2) := + by + simp [inc] + rw [hinc] + exact stepPlus_trans s1 (stepPlus_trans s2 s3) + +theorem LIncWord (w : List Bool) (r : ListBlank (Fin 2)) : + ((data w <+ [0, 1]) <{B}| r) [target_tm]⊢⁺ + ((data (inc w).1 <+ [0, 1]) |{A}> insert (inc w).2 r) := + stepPlus_trans (LStart (data w) r) (ZInc w r) + +theorem RZero (w : List Bool) (r : ListBlank (Fin 2)) (n : Nat) : + ((data w <+ [0, 1]) |{A}> (rd1 ^ n +> ([0] +> r))) [target_tm]⊢⁺ + ((data (inc w).1 <+ [0, 1]) |{A}> insert (inc w).2 (rd0 ^ n +> ([1] +> r))) := + stepPlus_trans (RInc4 (data w) r n) (LIncWord w (rd0 ^ n +> ([1] +> r))) + +theorem C1001_exit (l r : ListBlank (Fin 2)) : + (l |{A}> ([1, 0, 0, 1] +> r)) [target_tm]⊢⁺ + (l |{C}> ([1, 1, 1, 1] +> r)) := + ⟨8, by omega, by run_steps 8⟩ + +theorem B_mod0_turn (l r : ListBlank (Fin 2)) : + ((l <+ [0, 1]) |{C}> ([1, 1] +> r)) [target_tm]⊢⁺ + ((l <+ [1, 1] <+ [0, 1]) |{A}> r) := + ⟨4, by omega, by run_steps 4⟩ + +theorem B_mod2_turn (l r : ListBlank (Fin 2)) : + ((l <+ [0, 1] <+ [1, 1]) |{C}> ([1, 1] +> r)) [target_tm]⊢⁺ + ((l <+ [1, 1] <+ ([0, 1] : List (Fin 2)) ^ 2) |{A}> r) := + ⟨10, by omega, by run_steps 10⟩ + +theorem R1001_mod0 (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ [0, 1]) |{A}> (rd1 ^ (n * 3) +> ([1, 0, 0, 1] +> r))) [target_tm]⊢⁺ + ((l <+ [1, 1] <+ ([0, 1] : List (Fin 2)) ^ (n * 6 + 2)) |{A}> r) := by + have s1 := CScan (l <+ [0, 1]) ([1, 0, 0, 1] +> r) (n * 3) + have s2 := C1001_exit (l <+ [0, 1] <+ ([1, 1] : List (Fin 2)) ^ (n * 3 * 2)) r + have hmul : n * 3 * 2 = (n * 2) * 3 := by omega + have hr1 : ([1, 1, 1, 1] : List (Fin 2)) +> r = [1] +> ([1, 1, 1] +> r) := rfl + rw [hmul] at s1 s2 + rw [hr1] at s2 + have s3 := BScan6 (l <+ [0, 1]) ([1, 1, 1] +> r) (n * 2) + have hr2 : ([1] : List (Fin 2)) +> (([1, 1] : List (Fin 2)) ^ (n * 2 * 3) +> ([1, 1, 1] +> r)) = + [1, 1] +> (([1, 1] : List (Fin 2)) ^ (n * 6 + 1) +> r) := by + rw [show n * 6 + 1 = n * 2 * 3 + 1 by omega, right_pow_succ_right [1, 1] (n * 2 * 3) r] + change ([1] : List (Fin 2)) +> (([1, 1] : List (Fin 2)) ^ (n * 2 * 3) +> ([1] +> ([1, + 1] +> r))) = + [1] +> ([1] +> (([1, 1] : List (Fin 2)) ^ (n * 2 * 3) +> ([1, 1] +> r))) + rw [one_comm_11_pow (n * 2 * 3) ([1, 1] +> r)] + rw [hr2] at s3 + have s4 := B_mod0_turn l (([1, 1] : List (Fin 2)) ^ (n * 6 + 1) +> r) + have s5 := CScan11 (l <+ [1, 1] <+ [0, 1]) r (n * 6 + 1) + have hl : l <+ [1, 1] <+ [0, 1] <+ ([0, 1] : List (Fin 2)) ^ (n * 6 + 1) = + l <+ [1, 1] <+ ([0, 1] : List (Fin 2)) ^ (n * 6 + 2) := by + rw [show n * 6 + 2 = (n * 6 + 1) + 1 by omega, left_pow_add (l <+ [1, 1]) [0, 1] (n * 6 + 1) 1] + rfl + rw [hl] at s5 + exact stepStar_stepPlus_trans s1 + (stepPlus_trans (stepPlus_stepStar_trans s2 s3) (stepPlus_stepStar_trans s4 s5)) + +theorem R1001_mod2 (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ [0, 1]) |{A}> (rd1 ^ (n * 3 + 2) +> ([1, 0, 0, 1] +> r))) [target_tm]⊢⁺ + ((l <+ [1, 1] <+ ([0, 1] : List (Fin 2)) ^ (n * 6 + 6)) |{A}> r) := by + have s1 := CScan (l <+ [0, 1]) ([1, 0, 0, 1] +> r) (n * 3 + 2) + have s2 := C1001_exit (l <+ [0, 1] <+ ([1, 1] : List (Fin 2)) ^ ((n * 3 + 2) * 2)) r + have hmul : l <+ [0, 1] <+ ([1, 1] : List (Fin 2)) ^ ((n * 3 + 2) * 2) = + l <+ [0, 1] <+ [1, 1] <+ ([1, 1] : List (Fin 2)) ^ ((n * 2 + 1) * 3) := by + rw [show (n * 3 + 2) * 2 = (n * 2 + 1) * 3 + 1 by omega, + left_pow_add (l <+ [0, 1]) [1, 1] ((n * 2 + 1) * 3) 1] + rfl + have hr1 : ([1, 1, 1, 1] : List (Fin 2)) +> r = [1] +> ([1, 1, 1] +> r) := rfl + rw [hmul] at s1 s2 + rw [hr1] at s2 + have s3 := BScan6 (l <+ [0, 1] <+ [1, 1]) ([1, 1, 1] +> r) (n * 2 + 1) + have hr2 : ([1] : List (Fin 2)) +> (([1, 1] : List (Fin 2)) ^ ((n * 2 + 1) * 3) +> ([1, 1, + 1] +> r)) = + [1, 1] +> (([1, 1] : List (Fin 2)) ^ (n * 6 + 4) +> r) := by + rw [show n * 6 + 4 = (n * 2 + 1) * 3 + 1 by omega, + right_pow_succ_right [1, 1] ((n * 2 + 1) * 3) r] + change ([1] : List (Fin 2)) +> (([1, 1] : List (Fin 2)) ^ ((n * 2 + 1) * 3) +> ([1] +> ([1, + 1] +> r))) = + [1] +> ([1] +> (([1, 1] : List (Fin 2)) ^ ((n * 2 + 1) * 3) +> ([1, 1] +> r))) + rw [one_comm_11_pow ((n * 2 + 1) * 3) ([1, 1] +> r)] + rw [hr2] at s3 + have s4 := B_mod2_turn l (([1, 1] : List (Fin 2)) ^ (n * 6 + 4) +> r) + have s5 := CScan11 (l <+ [1, 1] <+ ([0, 1] : List (Fin 2)) ^ 2) r (n * 6 + 4) + have hl : l <+ [1, 1] <+ ([0, 1] : List (Fin 2)) ^ 2 <+ ([0, 1] : List (Fin 2)) ^ (n * 6 + 4) = + l <+ [1, 1] <+ ([0, 1] : List (Fin 2)) ^ (n * 6 + 6) := by + rw [show n * 6 + 6 = (n * 6 + 4) + 2 by omega, left_pow_add (l <+ [1, 1]) [0, 1] (n * 6 + 4) 2] + rw [hl] at s5 + exact stepStar_stepPlus_trans s1 + (stepPlus_trans (stepPlus_stepStar_trans s2 s3) (stepPlus_stepStar_trans s4 s5)) + +theorem R1001_call (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ [0, 1]) |{A}> (rd1 ^ (n * 3 + 1) +> ([1, 0, 0, 1] +> r))) [target_tm]⊢⁺ + (l |{C}> ([1, 1] +> (([1, 1] : List (Fin 2)) ^ (n * 6 + 4) +> r))) := by + have s1 := CScan (l <+ [0, 1]) ([1, 0, 0, 1] +> r) (n * 3 + 1) + have s2 := C1001_exit (l <+ [0, 1] <+ ([1, 1] : List (Fin 2)) ^ ((n * 3 + 1) * 2)) r + have hmul : l <+ [0, 1] <+ ([1, 1] : List (Fin 2)) ^ ((n * 3 + 1) * 2) = + l <+ [1, 1, 1, 1, bit false, 1] <+ ([1, 1] : List (Fin 2)) ^ ((n * 2) * 3) := by + rw [show (n * 3 + 1) * 2 = (n * 2) * 3 + 2 by omega, + left_pow_add (l <+ [0, 1]) [1, 1] ((n * 2) * 3) 2] + rfl + have hr1 : ([1, 1, 1, 1] : List (Fin 2)) +> r = [1] +> ([1, 1, 1] +> r) := rfl + rw [hmul] at s1 s2 + rw [hr1] at s2 + have s3 := BScan6 (l <+ [1, 1, 1, 1, bit false, 1]) ([1, 1, 1] +> r) (n * 2) + have s4 := ZCarryMarked false l (([1, 1] : List (Fin 2)) ^ (n * 2 * 3) +> ([1, 1, 1] +> r)) + have hr2 : ([1, 1, 1, 1, 1, 1, 1] : List (Fin 2)) +> + (([1, 1] : List (Fin 2)) ^ (n * 2 * 3) +> ([1, 1, 1] +> r)) = + [1, 1] +> (([1, 1] : List (Fin 2)) ^ (n * 6 + 4) +> r) := by + rw [show n * 6 + 4 = 2 + (n * 2 * 3 + 2) by omega, + list_pow_add [1, 1] 2 (n * 2 * 3 + 2), listblank_append_assoc, + right_pow_succ_right [1, 1] (n * 2 * 3 + 1) r, + right_pow_succ_right [1, 1] (n * 2 * 3) ([1, 1] +> r)] + change [1, 1] +> (([1, 1] : List (Fin 2)) ^ 2 +> ([1] +> + (([1, 1] : List (Fin 2)) ^ (n * 2 * 3) +> ([1] +> ([1, 1] +> r))))) = + [1, 1] +> (([1, 1] : List (Fin 2)) ^ 2 +> + (([1, 1] : List (Fin 2)) ^ (n * 2 * 3) +> ([1, 1] +> ([1, 1] +> r)))) + rw [one_comm_11_pow (n * 2 * 3) ([1] +> ([1, 1] +> r))] + rfl + rw [hr2] at s4 + exact stepStar_stepPlus_trans s1 + (stepPlus_trans (stepPlus_stepStar_trans s2 s3) s4) + +theorem R1001_return (w : List Bool) (r : ListBlank (Fin 2)) (n : Nat) : + (Conf w (rd1 ^ (n * 3 + 1) +> ([1, 0, 0, 1] +> r))) [target_tm]⊢⁺ + (Conf (push0 (n * 6 + 4) (inc w).1) (insert (inc w).2 r)) := by + have s1 := R1001_call (data w) r n + have s2 := ZInc w (([1, 1] : List (Fin 2)) ^ (n * 6 + 4) +> r) + rw [insert_scan (inc w).2 (n * 6 + 4) r] at s2 + have s3 := CScan11 (data (inc w).1 <+ [0, 1]) (insert (inc w).2 r) (n * 6 + 4) + have hl : data (inc w).1 <+ [0, 1] <+ ([0, 1] : List (Fin 2)) ^ (n * 6 + 4) = + data (push0 (n * 6 + 4) (inc w).1) <+ [0, 1] := by + rw [data_push0] + exact pow_comm_01 (n * 6 + 4) (data (inc w).1) + rw [hl] at s3 + exact stepPlus_trans s1 (stepPlus_stepStar_trans s2 s3) + +theorem init5 : + (init []) [target_tm]⊢* Conf [] default := + ⟨5, by run_steps 5⟩ + +-- ============================================================================ +-- Section 3: Right Counter (Pair12Right & PairOrdinary) +-- ============================================================================ + +theorem pow_two_four (t : Nat) : 2 ^ (2 * t) = 4 ^ t := by + induction t with + | zero => rfl + | succ t ih => + rw [show 2 * (t + 1) = 2 * t + 2 by omega, Nat.pow_add, ih, Nat.pow_succ] + ring + +theorem pow4_pos (k : Nat) : 0 < 4 ^ k := by + rw [← pow_two_four] + exact pow2_pos (2 * k) + +theorem FC_leading_one (t : Nat) (r : ListBlank (Fin 2)) : + FC rd1 ([0] +> (rd1 +> r)) (t + 1) 1 ([1] +> (rd0 ^ (t + 1) +> (rd1 +> r))) := by + have h0 := FC.d1 t 0 (rd0 ^ t +> ([0] +> (rd1 +> r))) (FC_zero rd1 ([0] +> (rd1 +> r)) t) + have heq : rd1 +> (rd0 ^ t +> ([0] +> (rd1 +> r))) = + [1] +> (rd0 ^ (t + 1) +> (rd1 +> r)) := by + rw [right_pow_succ rd0 t (rd1 +> r)] + change rd1 +> (rd0 ^ t +> (([0] : List (Fin 2)) +> (rd1 +> r))) = + rd1 +> (([0] : List (Fin 2)) +> (rd0 ^ t +> (rd1 +> r))) + rw [one_zero_comm_rd0_pow t (rd1 +> r)] + exact FC_eq h0 rfl (by omega) heq + +theorem RC_shift3 {n : Nat} {r : ListBlank (Fin 2)} (h : RC rd1 n r) : + RC rds n ([0, 0, 0] +> r) := by + induction h with + | zero => + rw [three_zeros_append_default] + exact RC.zero + | d0 n r _ ih => + have heq : ([0, 0, 0] : List (Fin 2)) +> (rd0 +> r) = rd0 +> ([0, 0, 0] +> r) := rfl + rw [heq] + exact RC.d0 n ([0, 0, 0] +> r) ih + | d1 n r _ ih => + have heq : ([0, 0, 0] : List (Fin 2)) +> (rd1 +> r) = rds +> ([0, 0, 0] +> r) := rfl + rw [heq] + exact RC.d1 n ([0, 0, 0] +> r) ih + +-- ============================================================================ +-- Section 4: PairGuard, PairCarry, PairPrefix, PairOverflow, +-- PairShiftGuard & PairEntryGuard +-- ============================================================================ + +def bit_value (b : Bool) : Nat := if b then 1 else 0 +def zero_bit (b : Bool) : Nat := if b then 0 else 1 + +def digit_plane (f : Bool → Nat) : Nat → List Bool → Nat + | _, [] => 0 + | 0, b :: u => f b + 4 * digit_plane f 2 u + | j + 1, _ :: u => digit_plane f j u + +def width : List Bool → Nat + | [] => 0 + | [_] => 1 + | [_, _] => 2 + | _ :: _ :: _ :: u => 2 + width u + +def value (w : List Bool) : Nat := + digit_plane bit_value 0 w + 2 * digit_plane bit_value 1 w +def gap0 (w : List Bool) : Nat := + 1 + digit_plane zero_bit 0 w + 2 * digit_plane zero_bit 1 w +def gap1 (w : List Bool) : Nat := + 2 + 2 * digit_plane zero_bit 0 w + 4 * digit_plane zero_bit 2 w +def gap2 (w : List Bool) : Nat := + 4 + 4 * digit_plane zero_bit 1 w + 8 * digit_plane zero_bit 2 w + +def guard (n : Nat) (w : List Bool) : Prop := + 2 * n ≤ gap0 w ∧ 2 * n ≤ gap1 w ∧ 2 * n ≤ gap2 w + +theorem gap_bounds (w : List Bool) : 1 ≤ gap0 w ∧ 2 ≤ gap1 w ∧ 4 ≤ gap2 w := by + dsimp [gap0, gap1, gap2]; omega + +theorem gap2_four (w : List Bool) : + gap2 w = 4 * (1 + digit_plane zero_bit 1 w + 2 * digit_plane zero_bit 2 w) := by + dsimp [gap2]; omega + +theorem value_gap0 (w : List Bool) : value w + gap0 w = 2 ^ width w := by + match w with + | [] => rfl + | [a] => cases a <;> rfl + | [a, b] => cases a <;> cases b <;> rfl + | a :: b :: c :: u => + have ih := value_gap0 u + dsimp [value, gap0, digit_plane, width] at ih ⊢ + rw [Nat.add_comm 2 (width u), Nat.pow_add] + cases a <;> cases b <;> dsimp [bit_value, zero_bit] <;> omega + +theorem inc_half (w : List Bool) : + gap1 w ≤ 2 * gap1 (inc w).1 ∧ gap2 w ≤ 2 * gap2 (inc w).1 := by + match w with + | [] => dsimp [inc, gap1, gap2, digit_plane, zero_bit]; omega + | false :: u => dsimp [inc, gap1, gap2, digit_plane, zero_bit]; omega + | [true] => dsimp [inc, gap1, gap2, digit_plane, zero_bit]; omega + | true :: false :: u => dsimp [inc, gap1, gap2, digit_plane, zero_bit]; omega + | [true, true] => dsimp [inc, gap1, gap2, digit_plane, zero_bit]; omega + | true :: true :: b :: u => + have ih := inc_half u + cases b <;> dsimp [inc, gap1, gap2, digit_plane, zero_bit] at ih ⊢ <;> omega + +theorem inc_interior (w : List Bool) (h : 1 < gap0 w) : + (inc w).2 = false ∧ (inc w).1.length = w.length ∧ gap0 (inc w).1 + 1 = gap0 w := by + match w with + | [] => dsimp [gap0, digit_plane] at h; omega + | false :: u => + dsimp [inc, gap0, digit_plane, zero_bit] at h ⊢ + exact ⟨rfl, rfl, by omega⟩ + | [true] => dsimp [gap0, digit_plane, zero_bit] at h; omega + | true :: false :: u => + dsimp [inc, gap0, digit_plane, zero_bit] at h ⊢ + exact ⟨rfl, rfl, by omega⟩ + | [true, true] => dsimp [gap0, digit_plane, zero_bit] at h; omega + | true :: true :: b :: u => + have hu : 1 < gap0 u := by + dsimp [gap0, digit_plane, zero_bit] at h ⊢ + omega + rcases inc_interior u hu with ⟨he, hl, hg⟩ + dsimp [inc, gap0, digit_plane, zero_bit] at hg ⊢ + refine ⟨he, by simp [hl], by omega⟩ + +inductive inc_steps : Nat → List Bool → List Bool → Prop + | zero (w : List Bool) : inc_steps 0 w w + | succ (q : Nat) (w u v : List Bool) : + inc w = (u, false) → inc_steps q u v → inc_steps (q + 1) w v + +theorem inc_steps_interior (q : Nat) (w : List Bool) (h : q < gap0 w) : + ∃ v, inc_steps q w v ∧ v.length = w.length ∧ gap0 v + q = gap0 w := by + induction q generalizing w with + | zero => exact ⟨w, inc_steps.zero w, rfl, by omega⟩ + | succ q ih => + rcases inc_interior w (by omega) with ⟨he, hl, hg⟩ + have hinc : inc w = ((inc w).1, false) := Prod.ext rfl he + rcases ih (inc w).1 (by omega) with ⟨v, hs, hvl, hvg⟩ + exact ⟨v, inc_steps.succ q w (inc w).1 v hinc hs, by omega, by omega⟩ + +theorem inc_steps_trans {p q : Nat} {w u v : List Bool} + (h1 : inc_steps p w u) (h2 : inc_steps q u v) : inc_steps (p + q) w v := by + induction h1 with + | zero => rw [Nat.zero_add]; exact h2 + | succ p w mid _ hinc _ ih => + rw [Nat.succ_add] + exact inc_steps.succ (p + q) w mid v hinc (ih h2) + +theorem inc_steps_add_inv {p q : Nat} {w v : List Bool} (h : inc_steps (p + q) w v) : + ∃ u, inc_steps p w u ∧ inc_steps q u v := by + induction p generalizing w with + | zero => + rw [Nat.zero_add] at h + exact ⟨w, inc_steps.zero w, h⟩ + | succ p ih => + rw [Nat.succ_add] at h + cases h with + | succ _ _ u _ hinc hs => + rcases ih hs with ⟨mid, hp, hq⟩ + exact ⟨mid, inc_steps.succ p w u mid hinc hp, hq⟩ + +theorem value_triple (a b marker : Bool) (w : List Bool) : + value (a :: b :: marker :: w) = bit_value a + 2 * bit_value b + 4 * value w := by + dsimp [value, digit_plane]; omega + +theorem prefix_value_bound (t : Nat) (rho : List Bool) (hlen : rho.length = 3 * t) : + value rho < 4 ^ t := by + induction t generalizing rho with + | zero => + cases rho with + | nil => decide + | cons _ _ => simp at hlen + | succ t ih => + rcases rho with _ | ⟨a, _ | ⟨b, _ | ⟨marker, rho⟩⟩⟩ + · simp at hlen + · simp at hlen; omega + · simp at hlen; omega + · have htail : rho.length = 3 * t := by simp at hlen; omega + have h := ih rho htail + rw [value_triple, Nat.pow_succ] + cases a <;> cases b <;> dsimp [bit_value] <;> omega + +theorem inc_split (t : Nat) (rho u v : List Bool) (hlen : rho.length = 3 * t) + (he : inc (rho ++ u) = (v, false)) : + ∃ rho' u' c, v = rho' ++ u' ∧ rho'.length = 3 * t ∧ + inc_steps c u u' ∧ c ≤ 1 ∧ c * 4 ^ t + value rho' = value rho + 1 := by + induction t generalizing rho v with + | zero => + cases rho with + | nil => + refine ⟨[], v, 1, rfl, rfl, ?_, by omega, ?_⟩ + · exact inc_steps.succ 0 u v v he (inc_steps.zero v) + · dsimp [value, digit_plane] + | cons _ _ => simp at hlen + | succ t ih => + rcases rho with _ | ⟨a, _ | ⟨b, _ | ⟨marker, rho⟩⟩⟩ + · simp at hlen + · simp at hlen; omega + · simp at hlen; omega + · have htail : rho.length = 3 * t := by simp at hlen; omega + cases a with + | false => + dsimp [inc] at he + injection he with hv _ + subst hv + refine ⟨true :: b :: marker :: rho, u, 0, rfl, by simp [htail]; omega, + inc_steps.zero u, by omega, ?_⟩ + rw [value_triple, value_triple] + dsimp [bit_value] + omega + | true => + cases b with + | false => + dsimp [inc] at he + injection he with hv _ + subst hv + refine ⟨false :: true :: marker :: rho, u, 0, rfl, by simp [htail]; omega, + inc_steps.zero u, by omega, ?_⟩ + rw [value_triple, value_triple] + dsimp [bit_value] + omega + | true => + dsimp [inc] at he + have he2 : (inc (rho ++ u)).2 = false := congrArg Prod.snd he + have he0 : inc (rho ++ u) = ((inc (rho ++ u)).1, false) := + Prod.ext rfl he2 + have hv : v = false :: false :: false :: (inc (rho ++ u)).1 := + (congrArg Prod.fst he).symm + subst hv + rcases ih rho (inc (rho ++ u)).1 htail he0 with + ⟨rho', u', c, hrho, hl', hs, hc, hval⟩ + refine ⟨false :: false :: false :: rho', u', c, by simp [hrho], + by simp [hl']; omega, hs, hc, ?_⟩ + rw [value_triple, value_triple, Nat.pow_succ] + dsimp [bit_value] + nlinarith + +theorem inc_steps_split (t q : Nat) (rho u v : List Bool) (hlen : rho.length = 3 * t) + (hs : inc_steps q (rho ++ u) v) : + ∃ rho' u' c, v = rho' ++ u' ∧ rho'.length = 3 * t ∧ + inc_steps c u u' ∧ c * 4 ^ t + value rho' = value rho + q := by + induction q generalizing rho u v with + | zero => + cases hs + exact ⟨rho, u, 0, rfl, hlen, inc_steps.zero u, by omega⟩ + | succ q ih => + cases hs with + | succ _ _ mid _ hinc hrest => + rcases inc_split t rho u mid hlen hinc with + ⟨rho1, u1, c1, hmid, hl1, hs1, _, hv1⟩ + subst hmid + rcases ih rho1 u1 v hl1 hrest with ⟨rho2, u2, c2, hv, hl2, hs2, hv2⟩ + refine ⟨rho2, u2, c1 + c2, hv, hl2, inc_steps_trans hs1 hs2, ?_⟩ + nlinarith + +theorem carry_bound (t : Nat) (rho rho' : List Bool) (c q h : Nat) + (hlen : rho.length = 3 * t) (hval : c * 4 ^ t + value rho' = value rho + q) + (hq : q ≤ h * 4 ^ t) : c ≤ h := by + have hb := prefix_value_bound t rho hlen + have hp := pow4_pos t + nlinarith + +theorem inc_steps_split_bounded (t q h : Nat) (rho u v : List Bool) + (hlen : rho.length = 3 * t) (hs : inc_steps q (rho ++ u) v) (hq : q ≤ h * 4 ^ t) : + ∃ rho' u' c, v = rho' ++ u' ∧ rho'.length = 3 * t ∧ inc_steps c u u' ∧ + c ≤ h ∧ c * 4 ^ t + value rho' = value rho + q := by + rcases inc_steps_split t q rho u v hlen hs with ⟨rho', u', c, hv, hl, hsc, he⟩ + exact ⟨rho', u', c, hv, hl, hsc, carry_bound t rho rho' c q h hlen he hq, he⟩ + +theorem zero_bit_bound (b : Bool) : zero_bit b ≤ 1 := by + cases b <;> decide + +theorem gap_cons (b : Bool) (w : List Bool) : + gap0 (b :: w) + 1 = gap1 w + zero_bit b ∧ + gap1 (b :: w) + 2 = gap2 w + 2 * zero_bit b ∧ + gap2 (b :: w) = 4 * gap0 w := by + dsimp [gap0, gap1, gap2, digit_plane]; omega + +theorem gap_triple (a b c : Bool) (w : List Bool) : + gap0 (a :: b :: c :: w) + 3 = 4 * gap0 w + zero_bit a + 2 * zero_bit b ∧ + gap1 (a :: b :: c :: w) + 6 = 4 * gap1 w + 2 * zero_bit a + 4 * zero_bit c ∧ + gap2 (a :: b :: c :: w) + 12 = 4 * gap2 w + 4 * zero_bit b + 8 * zero_bit c := by + dsimp [gap0, gap1, gap2, digit_plane]; omega + +theorem gap_triple_upper (a b c : Bool) (w : List Bool) : + gap0 (a :: b :: c :: w) ≤ 4 * gap0 w ∧ + gap1 (a :: b :: c :: w) ≤ 4 * gap1 w ∧ + gap2 (a :: b :: c :: w) ≤ 4 * gap2 w := by + have ht := gap_triple a b c w + have ha := zero_bit_bound a + have hb := zero_bit_bound b + have hc := zero_bit_bound c + omega + +theorem prefix_triples_upper (t : Nat) (z w : List Bool) (hl : z.length = 3 * t) : + gap0 (z ++ w) ≤ 4 ^ t * gap0 w ∧ + gap1 (z ++ w) ≤ 4 ^ t * gap1 w ∧ + gap2 (z ++ w) ≤ 4 ^ t * gap2 w := by + induction t generalizing z with + | zero => + cases z with + | nil => simp + | cons _ _ => simp at hl + | succ t ih => + rcases z with _ | ⟨a, _ | ⟨b, _ | ⟨c, z⟩⟩⟩ + · simp at hl + · simp at hl; omega + · simp at hl; omega + · have htail : z.length = 3 * t := by simp at hl; omega + rcases ih z htail with ⟨h0, h1, h2⟩ + rcases gap_triple_upper a b c (z ++ w) with ⟨u0, u1, u2⟩ + simp only [List.cons_append] + rw [Nat.pow_succ] + refine ⟨by nlinarith, by nlinarith, by nlinarith⟩ + +theorem triple_preserve (H : Nat) (a b c : Bool) (w : List Bool) + (hH : 4 ≤ H) (h0 : H ≤ gap0 w) (h1 : H ≤ gap1 w) (h2 : H ≤ gap2 w) : + H ≤ gap0 (a :: b :: c :: w) ∧ H ≤ gap1 (a :: b :: c :: w) ∧ H ≤ gap2 (a :: b :: c :: w) := by + have ht := gap_triple a b c w + omega + +theorem gap_01 (w : List Bool) : + gap0 (false :: true :: w) + 2 = gap2 w ∧ + gap1 (false :: true :: w) = 4 * gap0 w ∧ + gap2 (false :: true :: w) + 4 = 4 * gap1 w := by + dsimp [gap0, gap1, gap2, digit_plane, zero_bit]; omega + +theorem gap_zero4 (w : List Bool) : + gap0 (false :: false :: false :: false :: w) = 4 * gap1 w ∧ + gap1 (false :: false :: false :: false :: w) = 4 * gap2 w ∧ + gap2 (false :: false :: false :: false :: w) = 16 * gap0 w := by + dsimp [gap0, gap1, gap2, digit_plane, zero_bit]; omega + +theorem zero4_eight (w : List Bool) : + 8 ≤ gap0 (false :: false :: false :: false :: w) ∧ + 8 ≤ gap1 (false :: false :: false :: false :: w) ∧ + 8 ≤ gap2 (false :: false :: false :: false :: w) := by + have hz := gap_zero4 w + have hb := gap_bounds w + omega + +theorem long_prefix (H : Nat) (z w : List Bool) (hH : 4 ≤ H) (hl : 7 ≤ z.length) + (h0 : H + 1 ≤ gap0 w) (h1 : H + 1 ≤ gap1 w) (h2 : H + 1 ≤ gap2 w) : + 2 * H ≤ gap0 (z ++ w) ∧ 2 * H ≤ gap1 (z ++ w) ∧ 2 * H ≤ gap2 (z ++ w) := by + match z with + | [] => simp at hl + | [_] => simp at hl + | [_, _] => simp at hl + | a :: b :: c :: z' => + rcases Nat.lt_or_ge z'.length 7 with hlt | hge + · rcases z' with _ | ⟨d, _ | ⟨e, _ | ⟨f, _ | ⟨g, _ | ⟨h, _ | ⟨i, _ | ⟨j, q⟩⟩⟩⟩⟩⟩⟩ + · simp at hl + · simp at hl + · simp at hl + · simp at hl + · dsimp [gap0, gap1, gap2, digit_plane] at h0 h1 h2 ⊢; omega + · dsimp [gap0, gap1, gap2, digit_plane] at h0 h1 h2 ⊢; omega + · dsimp [gap0, gap1, gap2, digit_plane] at h0 h1 h2 ⊢; omega + · simp at hlt; omega + · rcases long_prefix H z' w hH hge h0 h1 h2 with ⟨ih0, ih1, ih2⟩ + exact triple_preserve (2 * H) a b c (z' ++ w) (by omega) ih0 ih1 ih2 + +theorem short_01_guard (H : Nat) (w v : List Bool) (e : Bool) (he : inc w = (v, e)) + (h0 : 4 * H + 2 ≤ gap0 w) (h1 : 4 * H + 2 ≤ gap1 w) (h2 : 4 * H + 2 ≤ gap2 w) : + 2 * H ≤ gap0 (false :: true :: v) ∧ + 2 * H ≤ gap1 (false :: true :: v) ∧ + 2 * H ≤ gap2 (false :: true :: v) := by + have hh := inc_half w + have hi := inc_interior w (by omega) + have hv : (inc w).1 = v := congrArg Prod.fst he + rw [hv] at hh hi + have hf := gap2_four w + have hp := gap_01 v + omega + +theorem zero_marker_bounds (k : Nat) (w : List Bool) (hl : 3 * k ≤ w.length) + (hz : digit_plane bit_value 2 w = 0) : + 4 ^ k + 1 ≤ gap1 w ∧ 2 * 4 ^ k + 2 ≤ gap2 w := by + induction k generalizing w with + | zero => + have hb := gap_bounds w + simp; omega + | succ k ih => + rcases w with _ | ⟨a, _ | ⟨b, _ | ⟨c, w⟩⟩⟩ + · simp at hl + · simp at hl; omega + · simp at hl; omega + · have hc : c = false ∧ digit_plane bit_value 2 w = 0 := by + cases c <;> dsimp [digit_plane, bit_value] at hz + · exact ⟨rfl, by omega⟩ + · omega + rcases hc with ⟨rfl, hzw⟩ + have hl' : 3 * k ≤ w.length := by simp at hl; omega + rcases ih w hl' hzw with ⟨ih1, ih2⟩ + have ht := gap_triple a b false w + dsimp [zero_bit] at ht + rw [Nat.pow_succ] + omega + +theorem width_length (k p : Nat) (w : List Bool) (hp : p ≤ 2) (hl : w.length = 3 * k + p) : + width w = 2 * k + p := by + induction k generalizing w with + | zero => + rcases w with _ | ⟨a, _ | ⟨b, _ | ⟨c, w⟩⟩⟩ <;> dsimp [width] <;> simp at hl <;> omega + | succ k ih => + rcases w with _ | ⟨a, _ | ⟨b, _ | ⟨c, w⟩⟩⟩ + · simp at hl; omega + · simp at hl; omega + · simp at hl; omega + · dsimp [width] + have hl' : w.length = 3 * k + p := by simp at hl; omega + rw [ih w hl'] + omega + +theorem digit_plane_zeros (n i : Nat) : digit_plane bit_value i (List.replicate n false) = 0 := by + induction n generalizing i with + | zero => cases i <;> rfl + | succ n ih => + cases i with + | zero => dsimp [List.replicate_succ, digit_plane, bit_value]; rw [ih 2] + | succ j => dsimp [List.replicate_succ, digit_plane]; exact ih j + +theorem value_zeros (n : Nat) : value (List.replicate n false) = 0 := by + dsimp [value]; rw [digit_plane_zeros, digit_plane_zeros] + +theorem width_zeros (k p : Nat) (hp : p ≤ 2) : + width (List.replicate (3 * k + p) false) = 2 * k + p := + width_length k p _ hp List.length_replicate + +theorem gap0_zeros (k p : Nat) (hp : p ≤ 2) : + gap0 (List.replicate (3 * k + p) false) = 2 ^ (2 * k + p) := by + have h := value_gap0 (List.replicate (3 * k + p) false) + rw [value_zeros, width_zeros k p hp, Nat.zero_add] at h + exact h + +theorem inc_marker_monotone (w : List Bool) : + digit_plane bit_value 2 (inc w).1 ≤ digit_plane bit_value 2 w := by + match w with + | [] => dsimp [inc, digit_plane, bit_value]; omega + | false :: u => dsimp [inc, digit_plane, bit_value]; omega + | [true] => dsimp [inc, digit_plane, bit_value]; omega + | true :: false :: u => dsimp [inc, digit_plane, bit_value]; omega + | [true, true] => dsimp [inc, digit_plane, bit_value]; omega + | true :: true :: c :: u => + have ih := inc_marker_monotone u + cases c <;> dsimp [inc, digit_plane, bit_value] at ih ⊢ <;> omega + +theorem inc_steps_marker_zero {q : Nat} {w v : List Bool} (hs : inc_steps q w v) + (h2 : digit_plane bit_value 2 w = 0) : + digit_plane bit_value 2 v = 0 := by + induction hs with + | zero => exact h2 + | succ _ w u _ hinc _ ih => + have hm := inc_marker_monotone w + have hu : (inc w).1 = u := congrArg Prod.fst hinc + rw [hu] at hm + exact ih (by omega) + +theorem inc_at_capacity (k p : Nat) (w : List Bool) (hp : p ≤ 2) (hl : w.length = 3 * k + p) + (hg : gap0 w = 1) : + inc w = if p = 0 then (List.replicate (3 * k + 1) false, false) + else (List.replicate (3 * k + p) false, true) := by + induction k generalizing w with + | zero => + rcases w with _ | ⟨a, _ | ⟨b, _ | ⟨c, w⟩⟩⟩ + · have hp0 : p = 0 := by simp at hl; omega + subst hp0; rfl + · have hp1 : p = 1 := by simp at hl; omega + subst hp1 + cases a + · dsimp [gap0, digit_plane, zero_bit] at hg; omega + · rfl + · have hp2 : p = 2 := by simp at hl; omega + subst hp2 + cases a <;> cases b <;> dsimp [gap0, digit_plane, zero_bit] at hg + · omega + · omega + · omega + · rfl + · simp at hl; omega + | succ k ih => + rcases w with _ | ⟨a, _ | ⟨b, _ | ⟨c, w⟩⟩⟩ + · simp at hl; omega + · simp at hl; omega + · simp at hl; omega + · have hab : a = true ∧ b = true ∧ gap0 w = 1 := by + cases a <;> cases b <;> dsimp [gap0, digit_plane, zero_bit] at hg ⊢ + · omega + · omega + · omega + · exact ⟨rfl, rfl, by omega⟩ + rcases hab with ⟨rfl, rfl, hg'⟩ + have hl' : w.length = 3 * k + p := by simp at hl; omega + have ihw := ih w hl' hg' + dsimp [inc] + rw [ihw] + split_ifs with hp0 + · have hrep : List.replicate (3 * (k + 1) + 1) false = + false :: false :: false :: List.replicate (3 * k + 1) false := by + rw [show 3 * (k + 1) + 1 = 3 + (3 * k + 1) by omega, List.replicate_add]; rfl + rw [hrep] + · have hrep : List.replicate (3 * (k + 1) + p) false = + false :: false :: false :: List.replicate (3 * k + p) false := by + rw [show 3 * (k + 1) + p = 3 + (3 * k + p) by omega, List.replicate_add]; rfl + rw [hrep] + +theorem first_capacity (k p : Nat) (w : List Bool) (hp : p ≤ 2) (hl : w.length = 3 * k + p) : + ∃ u, inc_steps (gap0 w - 1) w u ∧ u.length = w.length ∧ gap0 u = 1 ∧ + inc u = (if p = 0 then (List.replicate (3 * k + 1) false, false) + else (List.replicate (3 * k + p) false, true)) := by + have hb := (gap_bounds w).1 + rcases inc_steps_interior (gap0 w - 1) w (by omega) with ⟨u, hs, hlen, hgap⟩ + have hu : gap0 u = 1 := by omega + exact ⟨u, hs, hlen, hu, inc_at_capacity k p u hp (by omega) hu⟩ + +theorem inc_steps_gaps (q : Nat) (w v : List Bool) (hs : inc_steps q w v) (hc : q < gap0 w) : + gap0 v + q = gap0 w ∧ gap1 w ≤ 2 ^ q * gap1 v ∧ gap2 w ≤ 2 ^ q * gap2 v := by + induction hs with + | zero w => simp + | succ q w u v hinc _ ih => + have hi := inc_interior w (by omega) + have hh := inc_half w + have hu : (inc w).1 = u := congrArg Prod.fst hinc + rw [hu] at hi hh + rcases ih (by omega) with ⟨g0, g1, g2⟩ + rw [Nat.pow_succ] + refine ⟨by omega, by nlinarith, by nlinarith⟩ + +theorem small_carry_guard (H e c : Nat) (u v : List Bool) + (hH : 1 ≤ H) (he : e ≤ 1) (hc : c ≤ 2 ^ e) (hs : inc_steps c u v) + (h0 : (2 * H + 1) * 2 ^ e ≤ gap0 u) + (h1 : (2 * H + 1) * 2 ^ e ≤ gap1 u) + (h2 : (2 * H + 1) * 2 ^ e ≤ gap2 u) : + H + 1 ≤ gap0 v ∧ H + 1 ≤ gap1 v ∧ H + 1 ≤ gap2 v := by + have hp := pow2_pos e + have hlt : c < gap0 u := by nlinarith + rcases inc_steps_gaps c u v hs hlt with ⟨g0, g1, g2⟩ + rcases Nat.le_one_iff_eq_zero_or_eq_one.mp he with rfl | rfl + · rcases (show c = 0 ∨ c = 1 by omega) with rfl | rfl <;> omega + · rcases (show c = 0 ∨ c = 1 ∨ c = 2 by omega) with rfl | rfl | rfl <;> omega + +theorem gap0_short (t : Nat) (w : List Bool) (hl : w.length ≤ 3 * t) : gap0 w ≤ 4 ^ t := by + induction t generalizing w with + | zero => + cases w with + | nil => decide + | cons _ _ => simp at hl + | succ t ih => + have hp := pow4_pos t + rcases w with _ | ⟨a, _ | ⟨b, _ | ⟨marker, w⟩⟩⟩ + · change 1 ≤ 4 ^ (t + 1); rw [Nat.pow_succ]; omega + · dsimp [gap0, digit_plane]; rw [Nat.pow_succ]; cases a <;> dsimp [zero_bit] <;> omega + · dsimp [gap0, digit_plane]; rw [Nat.pow_succ] + cases a <;> cases b <;> dsimp [zero_bit] <;> omega + · have hl' : w.length ≤ 3 * t := by simp at hl; omega + have ihw := ih w hl' + have hu := (gap_triple_upper a b marker w).1 + rw [Nat.pow_succ] + nlinarith + +theorem preserve_bits (a : Nat) (b : Bool) (H : Nat) (w v : List Bool) + (ha : 1 ≤ a) (hH : 1 ≤ H) (hb1 : a = 1 → b = true) (hb2 : a = 2 → b = false) + (h0 : (2 * H + 1) * 2 ^ a ≤ gap0 w) + (h1 : (2 * H + 1) * 2 ^ a ≤ gap1 w) + (h2 : (2 * H + 1) * 2 ^ a ≤ gap2 w) + (hs : inc_steps (2 ^ a - bit_value b) w v) : + 2 * H ≤ gap0 (List.replicate (2 * a - 1) false ++ b :: v) ∧ + 2 * H ≤ gap1 (List.replicate (2 * a - 1) false ++ b :: v) ∧ + 2 * H ≤ gap2 (List.replicate (2 * a - 1) false ++ b :: v) := by + rcases Nat.eq_or_lt_of_le ha with rfl | ha2 + · have hb := hb1 rfl + subst hb + dsimp [bit_value] at hs + cases hs with + | succ _ _ mid _ hinc hlast => + cases hlast + exact short_01_guard H w v false hinc (by omega) (by omega) (by omega) + · set t := a / 2 + set e := a % 2 + have he : e ≤ 1 := by omega + have hat : a = 2 * t + e := by omega + have ht : 1 ≤ t := by omega + have hp : 2 ^ a = 2 ^ e * 4 ^ t := by + rw [hat, Nat.pow_add, pow_two_four, Nat.mul_comm] + have hf := pow4_pos t + have hep := pow2_pos e + have hl : 3 * t ≤ w.length := by + rcases Nat.lt_or_ge w.length (3 * t) with hlt | hge + · have hshort := gap0_short t w (by omega) + rw [hp, ← Nat.mul_assoc] at h0 + have hge2 : 3 ≤ (2 * H + 1) * 2 ^ e := by nlinarith + nlinarith + · exact hge + set rho := w.take (3 * t) + set u := w.drop (3 * t) + have hw : w = rho ++ u := (List.take_append_drop (3 * t) w).symm + have hlr : rho.length = 3 * t := by simp [rho, hl] + rw [hw] at h0 h1 h2 hs + rcases prefix_triples_upper t rho u hlr with ⟨hu0, hu1, hu2⟩ + have hg0 : (2 * H + 1) * 2 ^ e ≤ gap0 u := by rw [hp] at h0; nlinarith + have hg1 : (2 * H + 1) * 2 ^ e ≤ gap1 u := by rw [hp] at h1; nlinarith + have hg2 : (2 * H + 1) * 2 ^ e ≤ gap2 u := by rw [hp] at h2; nlinarith + have hq : 2 ^ a - bit_value b ≤ 2 ^ e * 4 ^ t := by rw [hp]; omega + rcases inc_steps_split_bounded t (2 ^ a - bit_value b) (2 ^ e) rho u v hlr hs hq with + ⟨rho', u', c, hv, hlr', hc, hcb, _⟩ + rcases small_carry_guard H e c u u' hH he hcb hc hg0 hg1 hg2 with ⟨hg0', hg1', hg2'⟩ + rcases Nat.lt_or_ge H 4 with hh3 | hh4 + · rcases Nat.eq_or_lt_of_le (show 2 ≤ a by omega) with rfl | ha3 + · have hb := hb2 rfl + subst hb + have hz8 := zero4_eight v + change 2 * H ≤ gap0 (false :: false :: false :: false :: v) ∧ + 2 * H ≤ gap1 (false :: false :: false :: false :: v) ∧ + 2 * H ≤ gap2 (false :: false :: false :: false :: v) + omega + · have hrep : List.replicate (2 * a - 1) false ++ b :: v = + false :: false :: false :: false :: (List.replicate (2 * a - 5) false ++ b :: v) := by + rw [show 2 * a - 1 = 4 + (2 * a - 5) by omega, List.replicate_add] + rfl + rw [hrep] + have hz8 := zero4_eight (List.replicate (2 * a - 5) false ++ b :: v) + omega + · subst hv + have hassoc : List.replicate (2 * a - 1) false ++ b :: (rho' ++ u') = + (List.replicate (2 * a - 1) false ++ b :: rho') ++ u' := by + simp [List.append_assoc] + rw [hassoc] + refine long_prefix H (List.replicate (2 * a - 1) false ++ b :: rho') u' hh4 ?_ hg0' hg1' hg2' + simp [hlr'] + omega + +def last_bit (n : Nat) : Bool := !((1 + n) % 3 == 2) + +theorem preserve (a : Nat) (b : Bool) (H : Nat) (w v : List Bool) + (ha : 1 ≤ a) (hH : 1 ≤ H) (hb : b = !((a % 3) == 2)) + (h0 : (2 * H + 1) * 2 ^ a ≤ gap0 w) + (h1 : (2 * H + 1) * 2 ^ a ≤ gap1 w) + (h2 : (2 * H + 1) * 2 ^ a ≤ gap2 w) + (hs : inc_steps (2 ^ a - bit_value b) w v) : + 2 * H ≤ gap0 (List.replicate (2 * a - 1) false ++ b :: v) ∧ + 2 * H ≤ gap1 (List.replicate (2 * a - 1) false ++ b :: v) ∧ + 2 * H ≤ gap2 (List.replicate (2 * a - 1) false ++ b :: v) := by + refine preserve_bits a b H w v ha hH ?_ ?_ h0 h1 h2 hs + · rintro rfl; exact hb + · rintro rfl; exact hb + +theorem ones_triples (t : Nat) (w : List Bool) : + gap0 (List.replicate (3 * t) true ++ w) + 4 ^ t = 4 ^ t * gap0 w + 1 ∧ + gap1 (List.replicate (3 * t) true ++ w) + 2 * 4 ^ t = 4 ^ t * gap1 w + 2 ∧ + gap2 (List.replicate (3 * t) true ++ w) + 4 * 4 ^ t = 4 ^ t * gap2 w + 4 := by + induction t with + | zero => simp + | succ t ih => + have hrep : List.replicate (3 * (t + 1)) true ++ w = + true :: true :: true :: (List.replicate (3 * t) true ++ w) := by + rw [show 3 * (t + 1) = 3 + 3 * t by omega, List.replicate_add] + rfl + rw [hrep] + have hg := gap_triple true true true (List.replicate (3 * t) true ++ w) + dsimp [zero_bit] at hg + rw [Nat.pow_succ] + refine ⟨by nlinarith, by nlinarith, by nlinarith⟩ + +theorem zero_word (w : List Bool) (hv : value w = 0) (hm : digit_plane bit_value 2 w = 0) : + w = List.replicate w.length false := by + match w with + | [] => rfl + | [a] => + cases a + · rfl + · dsimp [value, digit_plane, bit_value] at hv; omega + | [a, b] => + cases a <;> cases b <;> dsimp [value, digit_plane, bit_value] at hv <;> try omega + rfl + | a :: b :: c :: u => + have habc : a = false ∧ b = false ∧ c = false ∧ value u = 0 ∧ digit_plane bit_value 2 u = 0 := + by + cases a <;> cases b <;> cases c <;> dsimp [value, digit_plane, + bit_value] at hv hm ⊢ <;> try omega + exact ⟨rfl, rfl, rfl, by omega, by omega⟩ + rcases habc with ⟨rfl, rfl, rfl, hvu, hmu⟩ + have ih := zero_word u hvu hmu + dsimp [List.length] + rw [show u.length + 1 + 1 + 1 = 3 + u.length by omega, List.replicate_add, ← ih] + rfl + +theorem zero_entry (k p : Nat) (hp : p = 1 ∨ p = 2) : + 4 * 4 ^ k ≤ gap0 (false :: List.replicate (3 * k + p) false) ∧ + 4 * 4 ^ k ≤ gap1 (false :: List.replicate (3 * k + p) false) ∧ + 4 * 4 ^ k ≤ gap2 (false :: List.replicate (3 * k + p) false) := by + induction k with + | zero => + rcases hp with rfl | rfl <;> decide + | succ k ih => + have hrep : false :: List.replicate (3 * (k + 1) + p) false = + false :: false :: false :: (false :: List.replicate (3 * k + p) false) := by + rw [show 3 * (k + 1) + p = 3 + (3 * k + p) by omega, List.replicate_add] + rfl + rw [hrep] + have hg := gap_triple false false false (false :: List.replicate (3 * k + p) false) + dsimp [zero_bit] at hg + rw [Nat.pow_succ] + refine ⟨by nlinarith, by nlinarith, by nlinarith⟩ + +theorem prefix_residue_0 (t : Nat) (E : List Bool) : + let W := List.replicate (3 * t) true ++ false :: E + gap0 W + 4 ^ t = 4 ^ t * gap1 E + 1 ∧ + gap1 W + 2 * 4 ^ t = 4 ^ t * gap2 E + 2 ∧ + gap2 W + 4 * 4 ^ t = 4 * 4 ^ t * gap0 E + 4 := by + dsimp only + rcases ones_triples t (false :: E) with ⟨ht0, ht1, ht2⟩ + rcases gap_cons false E with ⟨h0a, h0b, h0c⟩ + dsimp [zero_bit] at h0a h0b h0c + have e0 : gap0 (false :: E) = gap1 E := by omega + have e1 : gap1 (false :: E) = gap2 E := by omega + have e2 : gap2 (false :: E) = 4 * gap0 E := by omega + rw [e0] at ht0 + rw [e1] at ht1 + rw [e2] at ht2 + refine ⟨ht0, ht1, by linarith⟩ + +theorem prefix_residue_1 (t : Nat) (E : List Bool) : + let W := List.replicate (3 * t + 1) true ++ false :: E + gap0 W + 2 * 4 ^ t = 4 ^ t * gap2 E + 1 ∧ + gap1 W + 4 * 4 ^ t = 4 * 4 ^ t * gap0 E + 2 ∧ + gap2 W + 4 * 4 ^ t = 4 * 4 ^ t * gap1 E + 4 := by + dsimp only + have hrep : List.replicate (3 * t + 1) true ++ false :: E = + List.replicate (3 * t) true ++ (true :: false :: E) := by + rw [List.replicate_add, List.append_assoc]; rfl + rw [hrep] + rcases ones_triples t (true :: false :: E) with ⟨ht0, ht1, ht2⟩ + rcases gap_cons false E with ⟨h0a, h0b, h0c⟩ + rcases gap_cons true (false :: E) with ⟨h1a, h1b, h1c⟩ + dsimp [zero_bit] at h0a h0b h0c h1a h1b h1c + have e0 : gap2 E = gap0 (true :: false :: E) + 1 := by omega + have e1 : 4 * gap0 E = gap1 (true :: false :: E) + 2 := by omega + have e2 : gap2 (true :: false :: E) = 4 * gap1 E := by omega + refine ⟨by rw [e0]; linarith, + by rw [show 4 * 4 ^ t * gap0 E = 4 ^ t * (4 * gap0 E) by ring, e1]; linarith, + by rw [e2] at ht2; linarith⟩ + +theorem prefix_residue_2 (t : Nat) (E : List Bool) : + let W := List.replicate (3 * t + 2) true ++ false :: E + gap0 W + 4 * 4 ^ t = 4 * 4 ^ t * gap0 E + 1 ∧ + gap1 W + 4 * 4 ^ t = 4 * 4 ^ t * gap1 E + 2 ∧ + gap2 W + 8 * 4 ^ t = 4 * 4 ^ t * gap2 E + 4 := by + dsimp only + have hrep : List.replicate (3 * t + 2) true ++ false :: E = + List.replicate (3 * t) true ++ (true :: true :: false :: E) := by + rw [List.replicate_add, List.append_assoc]; rfl + rw [hrep] + rcases ones_triples t (true :: true :: false :: E) with ⟨ht0, ht1, ht2⟩ + rcases gap_cons false E with ⟨h0a, h0b, h0c⟩ + rcases gap_cons true (false :: E) with ⟨h1a, h1b, h1c⟩ + rcases gap_cons true (true :: false :: E) with ⟨h2a, h2b, h2c⟩ + dsimp [zero_bit] at h0a h0b h0c h1a h1b h1c h2a h2b h2c + have e0 : 4 * gap0 E = gap0 (true :: true :: false :: E) + 3 := by omega + have e1 : 4 * gap1 E = gap1 (true :: true :: false :: E) + 2 := by omega + have e2 : 4 * gap2 E = gap2 (true :: true :: false :: E) + 4 := by omega + refine ⟨by rw [show 4 * 4 ^ t * gap0 E = 4 ^ t * (4 * gap0 E) by ring, e0]; linarith, + by rw [show 4 * 4 ^ t * gap1 E = 4 ^ t * (4 * gap1 E) by ring, e1]; linarith, + by rw [show 4 * 4 ^ t * gap2 E = 4 ^ t * (4 * gap2 E) by ring, e2]; linarith⟩ + +theorem strong (k p z : Nat) (E : List Bool) + (hp : p = 1 ∨ p = 2) (hl : E.length = 3 * k + p) + (hm : digit_plane bit_value 2 E = 0) (hv : value E = 2 ^ (z + 1) - 2) (hz : z < 2 * k + p) : + 2 ^ (2 * k + 2 - z) ≤ gap0 (List.replicate (2 * z) true ++ false :: E) ∧ + 2 ^ (2 * k + 2 - z) ≤ gap1 (List.replicate (2 * z) true ++ false :: E) ∧ + 2 ^ (2 * k + 2 - z) ≤ gap2 (List.replicate (2 * z) true ++ false :: E) := by + rcases Nat.eq_zero_or_pos z with rfl | hzp + · have ev : value E = 0 := by rw [hv]; rfl + have hew := zero_word E ev hm + rw [hl] at hew + rw [hew] + simp only [Nat.mul_zero, List.replicate_zero, List.nil_append, Nat.sub_zero] + have hpow : 2 ^ (2 * k + 2) = 4 * 4 ^ k := by + rw [Nat.pow_add, pow_two_four]; ring + rw [hpow] + exact zero_entry k p hp + · have cpos := pow4_pos k + have pz0 := pow2_pos z + have pz : 2 ≤ 2 ^ (z + 1) := by rw [Nat.pow_succ]; omega + have pc : 2 ^ (2 * k + p) = 2 ^ p * 4 ^ k := by + rw [Nat.pow_add, pow_two_four, Nat.mul_comm] + have hg := value_gap0 E + rw [width_length k p E (by omega) hl, hv] at hg + have hgexact : gap0 E + 2 ^ (z + 1) = 2 ^ p * 4 ^ k + 2 := by rw [pc] at hg; omega + rcases zero_marker_bounds k E (by omega) hm with ⟨hg1, hg2⟩ + have hb : 2 ^ (2 * k + 2 - z) ≤ 2 * 4 ^ k := by + have h1 : 2 * 4 ^ k = 2 ^ (2 * k + 1) := by + rw [Nat.pow_succ, pow_two_four]; ring + rw [h1] + exact Nat.pow_le_pow_right (by omega) (by omega) + have hg0 : 4 ^ k + 2 ≤ gap0 E ∨ (2 ≤ gap0 E ∧ 2 ^ (2 * k + 2 - z) ≤ 4) := by + rcases Nat.eq_or_lt_of_le (show z + 1 ≤ 2 * k + p by omega) with he | hlt + · right + refine ⟨?_, ?_⟩ + · rw [he, pc] at hgexact; omega + · rw [show 2 * k + 2 - z = 3 - p by omega] + rcases hp with rfl | rfl <;> decide + · left + have hpower : 2 * 2 ^ (z + 1) ≤ 2 ^ (2 * k + p) := by + have h2 : 2 * 2 ^ (z + 1) = 2 ^ (z + 2) := by rw [Nat.pow_succ (2 : Nat) (z + 1)]; ring + rw [h2] + exact Nat.pow_le_pow_right (by omega) (by omega) + rw [pc] at hpower + rcases hp with rfl | rfl <;> simp at hgexact hpower <;> omega + obtain ⟨t, r, hr, hzr, kbig⟩ : + ∃ t r, (r = 0 ∨ r = 1 ∨ r = 2) ∧ 2 * z = 3 * t + r ∧ (r ≤ 1 → 4 ≤ 4 ^ t) := by + refine ⟨(2 * z) / 3, (2 * z) % 3, by omega, by omega, ?_⟩ + intro hrl + have ht1 : 1 ≤ (2 * z) / 3 := by omega + have h41 : (4 : Nat) = 4 ^ 1 := rfl + rw [h41] + exact Nat.pow_le_pow_right (by omega) ht1 + have kpos : 1 ≤ 4 ^ t := pow4_pos t + have pk1 : 4 ^ k ≤ 4 ^ t * 4 ^ k := by + have := Nat.mul_le_mul_right (4 ^ k) kpos; linarith + have p1 : 4 ^ t * 4 ^ k + 4 ^ t ≤ 4 ^ t * gap1 E := by + have := Nat.mul_le_mul_left (4 ^ t) hg1; linarith + have p2 : 2 * (4 ^ t * 4 ^ k) + 2 * 4 ^ t ≤ 4 ^ t * gap2 E := by + have := Nat.mul_le_mul_left (4 ^ t) hg2; linarith + rcases hr with rfl | rfl | rfl + · have hzr0 : 2 * z = 3 * t := by omega + rw [hzr0] + rcases prefix_residue_0 t E with ⟨hf0, hf1, hf2⟩ + have kb := kbig (by omega) + have pk4 : 4 * 4 ^ k ≤ 4 ^ t * 4 ^ k := Nat.mul_le_mul_right (4 ^ k) kb + rcases hg0 with hg0 | ⟨hg0, hb4⟩ + · have p0 : 4 ^ t * 4 ^ k + 2 * 4 ^ t ≤ 4 ^ t * gap0 E := by + have := Nat.mul_le_mul_left (4 ^ t) hg0; linarith + refine ⟨by linarith, by linarith, by linarith⟩ + · have p0 : 2 * 4 ^ t ≤ 4 ^ t * gap0 E := by + have := Nat.mul_le_mul_left (4 ^ t) hg0; linarith + refine ⟨by linarith, by linarith, by linarith⟩ + · rw [hzr] + rcases prefix_residue_1 t E with ⟨hf0, hf1, hf2⟩ + have kb := kbig (by omega) + have pk4 : 4 * 4 ^ k ≤ 4 ^ t * 4 ^ k := Nat.mul_le_mul_right (4 ^ k) kb + rcases hg0 with hg0 | ⟨hg0, hb4⟩ + · have p0 : 4 ^ t * 4 ^ k + 2 * 4 ^ t ≤ 4 ^ t * gap0 E := by + have := Nat.mul_le_mul_left (4 ^ t) hg0; linarith + refine ⟨by linarith, by linarith, by linarith⟩ + · have p0 : 2 * 4 ^ t ≤ 4 ^ t * gap0 E := by + have := Nat.mul_le_mul_left (4 ^ t) hg0; linarith + refine ⟨by linarith, by linarith, by linarith⟩ + · rw [hzr] + rcases prefix_residue_2 t E with ⟨hf0, hf1, hf2⟩ + rcases hg0 with hg0 | ⟨hg0, hb4⟩ + · have p0 : 4 ^ t * 4 ^ k + 2 * 4 ^ t ≤ 4 ^ t * gap0 E := by + have := Nat.mul_le_mul_left (4 ^ t) hg0; linarith + refine ⟨by linarith, by linarith, by linarith⟩ + · have p0 : 2 * 4 ^ t ≤ 4 ^ t * gap0 E := by + have := Nat.mul_le_mul_left (4 ^ t) hg0; linarith + refine ⟨by linarith, by linarith, by linarith⟩ + +theorem actual (k p z : Nat) (E : List Bool) (H : Nat) + (hp : p = 1 ∨ p = 2) (hl : E.length = 3 * k + p) + (hm : digit_plane bit_value 2 E = 0) (hv : value E = 2 ^ (z + 1) - 2) (hz : z < 2 * k + p) + (ht : 2 ^ z * (1 + 2 * H) ≤ (if p = 1 then 3 else 4) * 4 ^ k) : + 2 * H < gap0 (List.replicate (2 * z) true ++ false :: E) ∧ + 2 * H < gap1 (List.replicate (2 * z) true ++ false :: E) ∧ + 2 * H < gap2 (List.replicate (2 * z) true ++ false :: E) := by + rcases strong k p z E hp hl hm hv hz with ⟨hg0, hg1, hg2⟩ + have hb : 2 ^ (2 * k + 2 - z) * 2 ^ z = 4 * 4 ^ k := by + rw [← Nat.pow_add, show 2 * k + 2 - z + z = 2 * k + 2 by omega, Nat.pow_add, pow_two_four] + ring + have pz := pow2_pos z + rcases hp with rfl | rfl <;> simp at ht <;> refine ⟨by nlinarith, by nlinarith, by nlinarith⟩ + +-- ============================================================================ +-- Section 5: Pair12Right, PairShift, PairRegion, Pair12Entry, PairOrdinary, +-- PairExceptional, PairPostEntry, Pair12Closure & Non-Halting +-- ============================================================================ + +theorem right_step {w v : List Bool} {e : Bool} {n : Nat} {r : ListBlank (Fin 2)} + (he : inc w = (v, e)) (hr : RC rd1 n r) : + ∃ s, RC rd1 (n + 1) s ∧ (Conf w r) [target_tm]⊢⁺ (Conf v (insert e s)) := by + rcases RC_carry hr with ⟨k, s, rfl, hs⟩ + refine ⟨rd0 ^ k +> (rd1 +> s), hs, ?_⟩ + have h := RZero w ([0, 0, 0] +> s) k + rw [he] at h + exact h + +theorem finite_step {w v : List Bool} {n : Nat} {r tail : ListBlank (Fin 2)} {k : Nat} + (he : inc w = (v, false)) (hr : FC rd1 tail k n r) (hb : n + 1 < 2 ^ k) : + ∃ s, FC rd1 tail k (n + 1) s ∧ (Conf w r) [target_tm]⊢⁺ (Conf v s) := by + rcases FC_carry hr hb with ⟨j, s, _, rfl, hs⟩ + refine ⟨rd0 ^ j +> (rd1 +> s), hs, ?_⟩ + have h := RZero w ([0, 0, 0] +> s) j + rw [he] at h + exact h + +theorem right_steps {q : Nat} {w v : List Bool} {n : Nat} {r : ListBlank (Fin 2)} + (hs : inc_steps q w v) (hr : RC rd1 n r) : + ∃ s, RC rd1 (n + q) s ∧ (Conf w r) [target_tm]⊢* (Conf v s) := by + induction hs generalizing n r with + | zero w => + exact ⟨r, RC_eq hr (by omega) rfl, stepStar_refl _⟩ + | succ q w u v hinc _ ih => + rcases right_step hinc hr with ⟨s, hs1, hS1⟩ + rcases ih hs1 with ⟨s', hs2, hS2⟩ + exact ⟨s', RC_eq hs2 (by omega) rfl, stepStar_trans (stepPlus_to_stepStar hS1) hS2⟩ + +theorem finite_steps {q : Nat} {w v : List Bool} {n : Nat} {r tail : ListBlank (Fin 2)} {k : Nat} + (hs : inc_steps q w v) (hr : FC rd1 tail k n r) (hb : n + q < 2 ^ k) : + ∃ s, FC rd1 tail k (n + q) s ∧ (Conf w r) [target_tm]⊢* (Conf v s) := by + induction hs generalizing n r with + | zero w => + exact ⟨r, FC_eq hr rfl (by omega) rfl, stepStar_refl _⟩ + | succ q w u v hinc _ ih => + rcases finite_step hinc hr (by omega) with ⟨s, hs1, hS1⟩ + rcases ih hs1 (by omega) with ⟨s', hs2, hS2⟩ + exact ⟨s', FC_eq hs2 rfl (by omega) rfl, stepStar_trans (stepPlus_to_stepStar hS1) hS2⟩ + +def output (n : Nat) (b : Bool) (v : List Bool) : List Bool := + push0 (2 * n + 1) (b :: v) + +theorem shifted_prefix (n : Nat) {w v : List Bool} (r : ListBlank (Fin 2)) + (h : inc_steps (2 ^ (1 + n) - 1) w v) : + (Conf w (rd0 ^ n +> (rds +> r))) [target_tm]⊢⁺ + (Conf v (rd1 ^ n +> ([1, 0, 0, 1] +> r))) := by + have hp := pow2_pos n + have hsplit : 2 ^ (1 + n) - 1 = (2 ^ n - 1) + (1 + (2 ^ n - 1)) := by + rw [Nat.add_comm 1 n, Nat.pow_succ]; omega + rw [hsplit] at h + rcases inc_steps_add_inv h with ⟨u, hwu, huv⟩ + rw [Nat.add_comm 1 (2 ^ n - 1)] at huv + cases huv with + | succ _ _ u1 _ hinc hu1v => + rcases finite_steps hwu (FC_zero rd1 (rds +> r) n) (by omega) with ⟨s1, hs1, hS1⟩ + have hs1_eq : s1 = rd1 ^ n +> (rds +> r) := FC_full_unique (FC_eq hs1 rfl (by omega) rfl) + subst hs1_eq + rcases finite_steps hu1v (FC_zero rd1 ([1, 0, 0, 1] +> r) n) (by omega) with ⟨s2, hs2, hS2⟩ + have hs2_eq : s2 = rd1 ^ n +> ([1, 0, 0, 1] +> r) := + FC_full_unique (FC_eq hs2 rfl (by omega) rfl) + subst hs2_eq + have hm := RZero u ([0, 0, 1] +> r) n + rw [hinc] at hm + have heq1 : rd1 ^ n +> (rds +> r) = rd1 ^ n +> ([0] +> ([0, 0, 1] +> r)) := rfl + have heq2 : insert false (rd0 ^ n +> ([1] +> ([0, 0, 1] +> r))) = + rd0 ^ n +> ([1, 0, 0, 1] +> r) := rfl + rw [heq1] at hS1 + rw [heq2] at hm + exact stepStar_stepPlus_trans hS1 (stepPlus_stepStar_trans hm hS2) + +theorem finish_signal (n : Nat) (w v : List Bool) (r : ListBlank (Fin 2)) + (h : if last_bit n then w = v else inc w = (v, false)) : + (Conf w (rd1 ^ n +> ([1, 0, 0, 1] +> r))) [target_tm]⊢⁺ + (Conf (output n (last_bit n) v) r) := by + set q := n / 3 + set rem := n % 3 + have hdiv : n = q * 3 + rem := by omega + have hrem : rem = 0 ∨ rem = 1 ∨ rem = 2 := by omega + rcases hrem with hrem0 | hrem1 | hrem2 + · have hlb : last_bit n = true := by + dsimp [last_bit] + have : (1 + n) % 3 = 1 := by omega + rw [this]; rfl + rw [hlb] at h ⊢ + dsimp at h + subst h + have hs := R1001_mod0 (data w) r q + have hn_eq : n = q * 3 := by omega + rw [hn_eq] + have hconf : Conf (output (q * 3) true w) r = + ((data w <+ [1, 1] <+ ([0, 1] : List (Fin 2)) ^ (q * 6 + 2)) |{A}> r) := by + dsimp [output] + rw [Conf_push0, show 2 * (q * 3) + 1 + 1 = q * 6 + 2 by omega] + rfl + rw [hconf] + exact hs + · have hlb : last_bit n = false := by + dsimp [last_bit] + have : (1 + n) % 3 = 2 := by omega + rw [this]; rfl + rw [hlb] at h ⊢ + dsimp at h + have hs := R1001_return w r q + have hn_eq : n = q * 3 + 1 := by omega + rw [h] at hs + rw [hn_eq] + dsimp [output, insert] at hs ⊢ + rw [push0_cons, show 2 * (q * 3 + 1) + 1 + 1 = q * 6 + 4 by omega] + exact hs + · have hlb : last_bit n = true := by + dsimp [last_bit] + have : (1 + n) % 3 = 0 := by omega + rw [this]; rfl + rw [hlb] at h ⊢ + dsimp at h + subst h + have hs := R1001_mod2 (data w) r q + have hn_eq : n = q * 3 + 2 := by omega + rw [hn_eq] + have hconf : Conf (output (q * 3 + 2) true w) r = + ((data w <+ [1, 1] <+ ([0, 1] : List (Fin 2)) ^ (q * 6 + 6)) |{A}> r) := by + dsimp [output] + rw [Conf_push0, show 2 * (q * 3 + 2) + 1 + 1 = q * 6 + 6 by omega] + rfl + rw [hconf] + exact hs + +theorem shifted (n : Nat) {w v : List Bool} (r : ListBlank (Fin 2)) + (h : inc_steps (2 ^ (1 + n) - bit_value (last_bit n)) w v) : + (Conf w (rd0 ^ n +> (rds +> r))) [target_tm]⊢⁺ + (Conf (output n (last_bit n) v) r) := by + cases hlb : last_bit n with + | true => + rw [hlb] at h + dsimp [bit_value] at h + refine stepPlus_trans (shifted_prefix n r h) ?_ + have hf := finish_signal n v v r + rw [hlb] at hf + exact hf (by simp) + | false => + rw [hlb] at h + dsimp [bit_value] at h + have hp := pow2_pos (1 + n) + have hsplit : 2 ^ (1 + n) = (2 ^ (1 + n) - 1) + 1 := by omega + rw [hsplit] at h + rcases inc_steps_add_inv h with ⟨u, hwu, huv⟩ + cases huv with + | succ _ _ mid _ hinc hlast => + cases hlast + refine stepPlus_trans (shifted_prefix n r hwu) ?_ + have hf := finish_signal n u v r + rw [hlb] at hf + exact hf (by simp [hinc]) + +inductive Allowed : Cfg (Fin 2) (Fin 6) → Prop + | Blank (w : List Bool) : Allowed (Conf w default) + | One (w : List Bool) : w ≠ [] → value w % 2 = 0 → Allowed (Conf w ([1] +> default)) + | Shifted (w : List Bool) (n : Nat) (r : ListBlank (Fin 2)) : + 0 < n → RC rds n r → guard n w → Allowed (Conf w r) + +theorem zero_prefix_even (n : Nat) (w : List Bool) (hn : 1 ≤ n) : + value (push0 n w) % 2 = 0 := by + cases n with + | zero => omega + | succ m => + dsimp [push0, List.replicate_succ, value, digit_plane, bit_value] + omega + +theorem push0_ne_nil (n : Nat) (w : List Bool) (hn : 1 ≤ n) : + push0 n w ≠ [] := by + cases n with + | zero => omega + | succ m => simp [push0, List.replicate_succ] + +theorem one_allowed (n : Nat) (w : List Bool) (hn : 1 ≤ n) : + Allowed (Conf (push0 n w) ([1] +> default)) := + Allowed.One (push0 n w) (push0_ne_nil n w hn) (zero_prefix_even n w hn) + +theorem last_bit_false (n : Nat) (h : last_bit n = false) : n % 3 = 1 := by + dsimp [last_bit] at h + have hmod : (1 + n) % 3 = 0 ∨ (1 + n) % 3 = 1 ∨ (1 + n) % 3 = 2 := by omega + rcases hmod with h0 | h1 | h2 + · rw [h0] at h; contradiction + · rw [h1] at h; contradiction + · omega + +theorem last_signal (n : Nat) (w : List Bool) : + ∃ c', Allowed c' ∧ (Conf w (rd1 ^ n +> ([1, 0, 0, 1] +> default))) [target_tm]⊢⁺ c' := by + cases hlb : last_bit n with + | true => + refine ⟨Conf (output n (last_bit n) w) default, Allowed.Blank _, ?_⟩ + exact finish_signal n w w default (by simp [hlb]) + | false => + have hn3 := last_bit_false n hlb + have hn_eq : n = (n / 3) * 3 + 1 := by omega + have hs := R1001_return w default (n / 3) + rw [← hn_eq] at hs + cases h2 : (inc w).2 with + | false => + rw [h2, insert_false] at hs + exact ⟨Conf (push0 (n / 3 * 6 + 4) (inc w).1) default, Allowed.Blank _, hs⟩ + | true => + rw [h2, insert_true] at hs + exact ⟨Conf (push0 (n / 3 * 6 + 4) (inc w).1) ([1] +> default), + one_allowed (n / 3 * 6 + 4) (inc w).1 (by omega), hs⟩ + +theorem last_shift (n : Nat) (w : List Bool) (hg : 2 ^ (1 + n) ≤ gap0 w) : + ∃ c', Allowed c' ∧ (Conf w (rd0 ^ n +> (rds +> default))) [target_tm]⊢⁺ c' := by + have hp := pow2_pos (1 + n) + rcases inc_steps_interior (2 ^ (1 + n) - 1) w (by omega) with ⟨v, hv, _⟩ + rcases last_signal n v with ⟨c', hA, hS⟩ + exact ⟨c', hA, stepPlus_trans (shifted_prefix n default hv) hS⟩ + +theorem bit_value_le_one (b : Bool) : bit_value b ≤ 1 := by + cases b <;> decide + +theorem shifted_step (n : Nat) (w : List Bool) (r : ListBlank (Fin 2)) + (hn : 0 < n) (hr : RC rds n r) (hg : guard n w) : + ∃ c', Allowed c' ∧ (Conf w r) [target_tm]⊢⁺ c' := by + rcases hg with ⟨h0, h1, h2⟩ + rcases RC_positive_split hr hn with ⟨t, q, s, rfl, hs, hen, _⟩ + cases q with + | zero => + rw [RC_zero_unique hs] + refine last_shift t w ?_ + rw [Nat.add_comm 1 t, Nat.pow_succ] + omega + | succ q => + set b := last_bit t + have hb := bit_value_le_one b + have hp := pow2_pos (1 + t) + have hpow : 2 ^ (1 + t) = 2 * 2 ^ t := by rw [Nat.add_comm 1 t, Nat.pow_succ]; ring + have hmul : 2 * n = (2 * (q + 1) + 1) * 2 ^ (1 + t) := by + rw [hen, hpow]; ring + rw [hmul] at h0 h1 h2 + have h3 : 3 * 2 ^ (1 + t) ≤ (2 * (q + 1) + 1) * 2 ^ (1 + t) := + Nat.mul_le_mul_right (2 ^ (1 + t)) (by omega) + have hq : 2 ^ (1 + t) - bit_value b < gap0 w := by + omega + rcases inc_steps_interior (2 ^ (1 + t) - bit_value b) w hq with ⟨v, hv, _⟩ + have hg_next : guard (q + 1) (output t b v) := by + dsimp [guard, output, push0] + rw [show 2 * t + 1 = 2 * (1 + t) - 1 by omega] + exact preserve (1 + t) b (q + 1) w v (by omega) (by omega) rfl h0 h1 h2 hv + exact ⟨Conf (output t b v) s, Allowed.Shifted _ (q + 1) s (by omega) hs hg_next, + shifted t s hv⟩ + +theorem one_cross (z : Nat) {w v : List Bool} (r : ListBlank (Fin 2)) + (hz : 1 ≤ z) (h : inc_steps (2 ^ z - 1) w v) : + (Conf w ([1] +> (rd0 ^ z +> (rd1 +> r)))) [target_tm]⊢⁺ + (Conf v (rd0 ^ z +> ([1, 1, 0, 0, 0] +> r))) := by + cases z with + | zero => omega + | succ t => + have hp0 := pow2_pos t + have hp : 2 ≤ 2 ^ (t + 1) := by rw [Nat.pow_succ]; omega + have hsplit : 2 ^ (t + 1) - 1 = (2 ^ (t + 1) - 2) + 1 := by omega + rw [hsplit] at h + rcases inc_steps_add_inv h with ⟨u, hw, hu⟩ + cases hu with + | succ _ _ mid _ hinc hlast => + cases hlast + rcases finite_steps hw (FC_leading_one t r) (by omega) with ⟨s, hs, hS⟩ + have hs_eq : s = rd1 ^ (t + 1) +> ([0] +> (rd1 +> r)) := + FC_full_unique (FC_eq hs rfl (by omega) rfl) + subst hs_eq + have hc := RZero u (rd1 +> r) (t + 1) + rw [hinc] at hc + exact stepStar_stepPlus_trans hS hc + +theorem prefix_steps (z : Nat) {w v : List Bool} (r : ListBlank (Fin 2)) + (h : inc_steps (2 ^ (z + 1) - 2) w v) : + (Conf w ([1] +> (rd0 ^ z +> (rd1 +> r)))) [target_tm]⊢* + (Conf v (rd1 ^ z +> ([1, 1, 0, 0, 0] +> r))) := by + cases z with + | zero => + cases h + try exact stepStar_refl _ + | succ t => + have hp0 := pow2_pos (t + 1) + have hsplit : 2 ^ (t + 1 + 1) - 2 = (2 ^ (t + 1) - 1) + (2 ^ (t + 1) - 1) := by + rw [Nat.pow_succ]; omega + rw [hsplit] at h + rcases inc_steps_add_inv h with ⟨u, hw, hv⟩ + rcases finite_steps hv (FC_zero rd1 ([1, 1, 0, 0, 0] +> r) (t + 1)) (by omega) with ⟨s, hs, hS⟩ + have hs_eq : s = rd1 ^ (t + 1) +> ([1, 1, 0, 0, 0] +> r) := + FC_full_unique (FC_eq hs rfl (by omega) rfl) + subst hs_eq + exact stepStar_trans (stepPlus_to_stepStar (one_cross (t + 1) r (by omega) hw)) hS + +theorem eleven_word (z : Nat) (w : List Bool) (r : ListBlank (Fin 2)) : + (Conf w (rd1 ^ z +> ([1, 1] +> r))) [target_tm]⊢⁺ + (Conf (List.replicate (2 * z) true ++ false :: w) r) := by + have h := REleven (data w) r z + have hdata : data (List.replicate (2 * z) true ++ false :: w) = + data w <+ [0, 1] <+ ([1, 1] : List (Fin 2)) ^ (z * 2) := by + rw [data_ones, Nat.mul_comm 2 z]; rfl + simpa [Conf, hdata] using h + +theorem ordinary (z : Nat) {w v : List Bool} (r : ListBlank (Fin 2)) + (h : inc_steps (2 ^ (z + 1) - 2) w v) : + (Conf w ([1] +> (rd0 ^ z +> (rd1 +> r)))) [target_tm]⊢⁺ + (Conf (List.replicate (2 * z) true ++ false :: v) ([0, 0, 0] +> r)) := + stepStar_stepPlus_trans (prefix_steps z r h) (eleven_word z v ([0, 0, 0] +> r)) + +theorem eleven0 (w : List Bool) (r : ListBlank (Fin 2)) : + (Conf w ([1, 1] +> r)) [target_tm]⊢⁺ (Conf (push0 1 w) r) := + eleven_word 0 w r + +theorem last_signal_one (n : Nat) (w : List Bool) : + ∃ c', Allowed c' ∧ (Conf w (rd1 ^ n +> ([1, 0, 0, 1] +> ([1] +> default)))) [target_tm]⊢⁺ c' := + by + cases hlb : last_bit n with + | true => + refine ⟨Conf (output n (last_bit n) w) ([1] +> default), ?_, ?_⟩ + · dsimp [output] + exact one_allowed (2 * n + 1) (last_bit n :: w) (by omega) + · exact finish_signal n w w ([1] +> default) (by simp [hlb]) + | false => + have hn3 := last_bit_false n hlb + have hn_eq : n = (n / 3) * 3 + 1 := by omega + have hs := R1001_return w ([1] +> default) (n / 3) + rw [← hn_eq] at hs + cases h2 : (inc w).2 with + | false => + rw [h2, insert_false] at hs + exact ⟨Conf (push0 (n / 3 * 6 + 4) (inc w).1) ([1] +> default), + one_allowed (n / 3 * 6 + 4) (inc w).1 (by omega), hs⟩ + | true => + rw [h2, insert_true] at hs + exact ⟨Conf (push0 1 (push0 (n / 3 * 6 + 4) (inc w).1)) default, + Allowed.Blank _, stepPlus_trans hs (eleven0 (push0 (n / 3 * 6 + 4) (inc w).1) default)⟩ + +theorem last_shift_one (n : Nat) (w : List Bool) (hg : 2 ^ (1 + n) ≤ gap0 w) : + ∃ c', Allowed c' ∧ (Conf w (rd0 ^ n +> (rds +> ([1] +> default)))) [target_tm]⊢⁺ c' := by + have hp := pow2_pos (1 + n) + rcases inc_steps_interior (2 ^ (1 + n) - 1) w (by omega) with ⟨v, hv, _⟩ + rcases last_signal_one n v with ⟨c', hA, hS⟩ + exact ⟨c', hA, stepPlus_trans (shifted_prefix n ([1] +> default) hv) hS⟩ + +theorem RC_power (a : Nat) : RC rd1 (2 ^ a) (rd0 ^ a +> (rd1 +> default)) := by + have h1 : RC rd1 1 (rd1 +> default) := RC_eq (RC.d1 0 default RC.zero) (by omega) rfl + exact RC_eq (RC_zeros a h1) (by omega) rfl + +theorem exceptional (k p : Nat) {r : ListBlank (Fin 2)} (hp : p = 1 ∨ p = 2) + (hr : RC rd1 (2 ^ (2 * k + p)) r) : + ∃ c', Allowed c' ∧ (Conf (List.replicate (3 * k + p) false) ([1] +> r)) [target_tm]⊢⁺ c' := by + have ha : 1 ≤ 2 * k + p := by omega + have hr_eq : r = rd0 ^ (2 * k + p) +> (rd1 +> default) := RC_unique hr (RC_power (2 * k + p)) + subst hr_eq + have hg := gap0_zeros k p (by omega) + have hc := pow2_pos (2 * k + p) + rcases inc_steps_interior (2 ^ (2 * k + p) - 1) (List.replicate (3 * k + p) false) (by omega) + with ⟨v, hv, hl, hg_v⟩ + rw [List.length_replicate] at hl + have hgv1 : gap0 v = 1 := by omega + have hei : inc v = (List.replicate (3 * k + p) false, true) := by + have hcap := inc_at_capacity k p v (by omega) hl hgv1 + have hp0 : p ≠ 0 := by omega + simpa [hp0] using hcap + have hnew : 2 ^ (1 + (2 * k + p - 1)) ≤ gap0 (push0 1 (List.replicate (3 * k + p) false)) := by + rw [show 1 + (2 * k + p - 1) = 2 * k + p by omega] + have hz0 := (zero_entry k p hp).1 + change 2 ^ (2 * k + p) ≤ gap0 (false :: List.replicate (3 * k + p) false) + rw [Nat.pow_add, pow_two_four] + rcases hp with rfl | rfl <;> omega + rcases last_shift_one (2 * k + p - 1) (push0 1 (List.replicate (3 * k + p) false)) hnew + with ⟨c', hA, hS⟩ + refine ⟨c', hA, ?_⟩ + have s1 := one_cross (2 * k + p) default ha hv + have s2 := RZero v ([0, 0, 0] +> (rd0 ^ (2 * k + p - 1) +> ([1, 1] +> default))) 0 + rw [hei] at s2 + dsimp only at s2 + have heq2 : rd0 ^ (2 * k + p) +> ([1, 1, 0, 0, 0] +> (default : ListBlank (Fin 2))) = + rd1 ^ 0 +> ([0] +> ([0, 0, 0] +> (rd0 ^ (2 * k + p - 1) +> ([1, 1] +> default)))) := by + rw [show 2 * k + p = (2 * k + p - 1) + 1 by omega, + right_pow_succ rd0 (2 * k + p - 1) ([1, 1, 0, 0, 0] +> default)] + simp [rd0] + rw [heq2] at s1 + have heq3 : insert true (rd0 ^ 0 +> ([1] +> ([0, 0, 0] +> (rd0 ^ (2 * k + p - 1) +> ([1, + 1] +> default))))) = + [1, 1] +> (rd0 ^ (2 * k + p - 1) +> (rds +> ([1] +> default))) := by + change [1, 1] +> (([0, 0, 0] : List (Fin 2)) +> (rd0 ^ (2 * k + p - 1) +> ([1, + 1] +> default))) = + [1, 1] +> (rd0 ^ (2 * k + p - 1) +> (rds +> ([1] +> default))) + rw [zero3_rd0 (2 * k + p - 1) ([1, 1] +> default)] + rfl + rw [heq3] at s2 + have s3 := eleven0 (List.replicate (3 * k + p) false) + (rd0 ^ (2 * k + p - 1) +> (rds +> ([1] +> default))) + exact stepPlus_trans s1 (stepPlus_trans s2 (stepPlus_trans s3 hS)) + +def limit (k p : Nat) : Nat := (if p = 1 then 3 else 4) * 4 ^ k + +theorem capacity_limit (k p : Nat) (hp : p = 1 ∨ p = 2) : + limit k p < 2 * 2 ^ (2 * k + p) := by + have hc := pow4_pos k + rw [Nat.pow_add, pow_two_four] + rcases hp with rfl | rfl <;> dsimp [limit] <;> omega + +theorem valuation_bound (k p t q : Nat) (hp : p = 1 ∨ p = 2) + (hlim : 2 ^ t * (1 + q * 2) ≤ limit k p) (hne : 2 ^ t * (1 + q * 2) ≠ 2 ^ (2 * k + p)) : + t < 2 * k + p := by + have hcap := capacity_limit k p hp + have ht := pow2_pos t + rcases Nat.lt_or_ge t (2 * k + p) with hlt | hge + · exact hlt + · rcases Nat.eq_or_lt_of_le hge with rfl | hgt + · have hq0 : q = 0 := by nlinarith + subst hq0 + simp at hne + · have hpow : 2 ^ (2 * k + p + 1) ≤ 2 ^ t := + Nat.pow_le_pow_right (by omega) hgt + rw [Nat.pow_succ] at hpow + nlinarith + +theorem zero_gap_order (m : Nat) : + gap0 (List.replicate m false) ≤ gap1 (List.replicate m false) ∧ + gap1 (List.replicate m false) ≤ gap2 (List.replicate m false) ∧ + gap2 (List.replicate m false) ≤ 4 * gap0 (List.replicate m false) := by + induction m with + | zero => decide + | succ m ih => + rw [List.replicate_succ] + have hc := gap_cons false (List.replicate m false) + dsimp [zero_bit] at hc + omega + +theorem even_gap (w : List Bool) (hw : w ≠ []) (hv : value w % 2 = 0) : + gap0 w % 2 = 0 := by + have hg := value_gap0 w + have hpos : 0 < width w := by + rcases w with _ | ⟨a, _ | ⟨b, _ | ⟨c, u⟩⟩⟩ + · contradiction + · dsimp [width]; omega + · dsimp [width]; omega + · dsimp [width]; omega + cases hk : width w with + | zero => omega + | succ k => + rw [hk, Nat.pow_succ] at hg + omega + +theorem RC_odd_inv {n : Nat} {r : ListBlank (Fin 2)} (hr : RC rd1 (1 + n * 2) r) : + ∃ s, RC rd1 n s ∧ r = rd1 +> s := by + rcases RC_inv_d1 hr with ⟨s, rfl, hs⟩ + exact ⟨s, hs, rfl⟩ + +theorem post_first (k p T : Nat) {r : ListBlank (Fin 2)} (hp : p = 1 ∨ p = 2) + (hr : RC rd1 T r) (ht : 0 < T) (hlim : T ≤ limit k p) : + ∃ c', Allowed c' ∧ (Conf (List.replicate (3 * k + p) false) ([1] +> r)) [target_tm]⊢⁺ c' := by + by_cases hne : T = 2 ^ (2 * k + p) + · subst hne + exact exceptional k p hp hr + · rcases RC_positive_split hr ht with ⟨z, q, s, rfl, hs, het, _⟩ + have hz : z < 2 * k + p := by + refine valuation_bound k p z q hp ?_ ?_ + · rw [← het]; exact hlim + · rw [← het]; exact hne + have hg := gap0_zeros k p (by omega) + have hq : 2 ^ (z + 1) - 2 < gap0 (List.replicate (3 * k + p) false) := by + rw [hg] + have hle : 2 ^ (z + 1) ≤ 2 ^ (2 * k + p) := + Nat.pow_le_pow_right (by omega) (by omega) + have hpz := pow2_pos (z + 1) + omega + rcases inc_steps_interior (2 ^ (z + 1) - 2) (List.replicate (3 * k + p) false) hq + with ⟨v, hv, hl, hgap⟩ + have hm : digit_plane bit_value 2 v = 0 := + inc_steps_marker_zero hv (digit_plane_zeros _ _) + rw [List.length_replicate] at hl + have hval : value v = 2 ^ (z + 1) - 2 := by + have hx := value_gap0 v + rw [width_length k p v (by omega) hl] at hx + rw [hg] at hgap + omega + have hact := actual k p z v q hp hl hm hval hz (by + dsimp [limit] at hlim + rw [het] at hlim + nlinarith) + have hs_ord := ordinary z s hv + have hr_shift := RC_shift3 hs + cases q with + | zero => + rw [RC_zero_unique hr_shift] at hs_ord + exact ⟨Conf (List.replicate (2 * z) true ++ false :: v) default, Allowed.Blank _, hs_ord⟩ + | succ q => + refine ⟨Conf (List.replicate (2 * z) true ++ false :: v) ([0, 0, 0] +> s), ?_, hs_ord⟩ + refine Allowed.Shifted _ (q + 1) ([0, 0, 0] +> s) (by omega) hr_shift ?_ + dsimp [guard] + omega + +theorem odd_entry (m n : Nat) {r : ListBlank (Fin 2)} + (hr : RC rd1 (1 + n * 2) r) (hb : 2 * n ≤ gap0 (List.replicate (1 + m) false)) : + ∃ c', Allowed c' ∧ (Conf (List.replicate m false) ([1] +> r)) [target_tm]⊢⁺ c' := by + rcases RC_odd_inv hr with ⟨s, hs, rfl⟩ + have h11 : ([1] : List (Fin 2)) +> (rd1 +> s) = rd1 ^ 0 +> ([1, 1] +> ([0, 0, 0] +> s)) := rfl + rw [h11] + have hs_el := eleven_word 0 (List.replicate m false) ([0, 0, 0] +> s) + have hrep : List.replicate (2 * 0) true ++ false :: List.replicate m false = + List.replicate (1 + m) false := by + rw [Nat.add_comm 1 m, List.replicate_succ] + rfl + rw [hrep] at hs_el + have hr_shift := RC_shift3 hs + cases n with + | zero => + rw [RC_zero_unique hr_shift] at hs_el ⊢ + exact ⟨Conf (List.replicate (1 + m) false) default, Allowed.Blank _, hs_el⟩ + | succ n => + refine ⟨Conf (List.replicate (1 + m) false) ([0, 0, 0] +> s), ?_, hs_el⟩ + refine Allowed.Shifted _ (n + 1) ([0, 0, 0] +> s) (by omega) hr_shift ?_ + have hgo := zero_gap_order (1 + m) + dsimp [guard] + omega + +theorem phase1_zero_gap (k : Nat) : gap0 (List.replicate (3 * k + 1) false) = 2 * 4 ^ k := by + rw [gap0_zeros k 1 (by omega), Nat.pow_add, pow_two_four] + ring + +theorem phase12 (k p : Nat) (w : List Bool) (x : Nat) (r : ListBlank (Fin 2)) + (hp1 : 1 ≤ p) (hp2 : p ≤ 2) (hl : w.length = 3 * k + p) (hr : RC rd1 x r) : + ∃ s, RC rd1 (x + gap0 w) s ∧ + (Conf w r) [target_tm]⊢⁺ (Conf (List.replicate (3 * k + p) false) ([1] +> s)) := by + rcases first_capacity k p w hp2 hl with ⟨u, hs, _, _, he⟩ + have hp_ite : (if p = 0 then (List.replicate (3 * k + 1) false, false) + else (List.replicate (3 * k + p) false, true)) = + (List.replicate (3 * k + p) false, true) := by + rcases (show p = 1 ∨ p = 2 by omega) with rfl | rfl <;> rfl + rw [hp_ite] at he + rcases right_steps hs hr with ⟨s1, hr1, hR1⟩ + rcases right_step he hr1 with ⟨s2, hr2, hR2⟩ + have hb := (gap_bounds w).1 + exact ⟨s2, RC_eq hr2 (by omega) rfl, stepStar_stepPlus_trans hR1 hR2⟩ + +theorem phase0_extend (k : Nat) (w : List Bool) (x : Nat) (r : ListBlank (Fin 2)) + (hl : w.length = 3 * k) (hr : RC rd1 x r) : + ∃ s, RC rd1 (x + gap0 w) s ∧ + (Conf w r) [target_tm]⊢⁺ (Conf (List.replicate (3 * k + 1) false) s) := by + rcases first_capacity k 0 w (by omega) (by omega) with ⟨u, hs, _, _, he⟩ + dsimp at he + rcases right_steps hs hr with ⟨s1, hr1, hR1⟩ + rcases right_step he hr1 with ⟨s2, hr2, hR2⟩ + have hb := (gap_bounds w).1 + exact ⟨s2, RC_eq hr2 (by omega) rfl, stepStar_stepPlus_trans hR1 hR2⟩ + +theorem phase0 (k : Nat) (w : List Bool) (x : Nat) (r : ListBlank (Fin 2)) + (hl : w.length = 3 * k) (hr : RC rd1 x r) : + ∃ s, RC rd1 (x + gap0 w + 2 * 4 ^ k) s ∧ + (Conf w r) [target_tm]⊢⁺ (Conf (List.replicate (3 * k + 1) false) ([1] +> s)) := by + rcases phase0_extend k w x r hl hr with ⟨s1, hr1, hS1⟩ + rcases phase12 k 1 (List.replicate (3 * k + 1) false) (x + gap0 w) s1 + (by omega) (by omega) List.length_replicate hr1 with ⟨s2, hr2, hS2⟩ + rw [phase1_zero_gap] at hr2 + exact ⟨s2, hr2, stepPlus_trans hS1 hS2⟩ + +theorem length_split (w : List Bool) : ∃ k p, p ≤ 2 ∧ w.length = 3 * k + p := + ⟨w.length / 3, w.length % 3, by omega, by omega⟩ + +theorem capacity_bound (k p : Nat) (w : List Bool) (hp : p ≤ 2) (hl : w.length = 3 * k + p) : + gap0 w ≤ 2 ^ p * 4 ^ k := by + have h := value_gap0 w + rw [width_length k p w hp hl, Nat.pow_add, pow_two_four] at h + nlinarith + +theorem right_one : RC rd1 1 ([1] +> default) := by + have h0 : RC rd1 1 (rd1 +> default) := RC_eq (RC.d1 0 default RC.zero) (by omega) rfl + have heq : rd1 +> (default : ListBlank (Fin 2)) = [1] +> default := by simp [rd1] + rwa [heq] at h0 + +theorem blank_step (w : List Bool) : + ∃ c', Allowed c' ∧ (Conf w default) [target_tm]⊢⁺ c' := by + rcases length_split w with ⟨k, p, hp, hl⟩ + have hb := capacity_bound k p w hp hl + have hg := (gap_bounds w).1 + rcases Nat.eq_zero_or_pos p with rfl | hp_pos + · rw [Nat.add_zero] at hl; rw [Nat.pow_zero, Nat.one_mul] at hb + rcases phase0 k w 0 default hl RC.zero with ⟨s, hr, hS⟩ + have hle : 0 + gap0 w + 2 * 4 ^ k ≤ limit k 1 := by dsimp [limit]; omega + rcases post_first k 1 (0 + gap0 w + 2 * 4 ^ k) (Or.inl rfl) hr (by omega) hle + with ⟨c', hA, hT⟩ + exact ⟨c', hA, stepPlus_trans hS hT⟩ + · have hf : p = 1 ∨ p = 2 := by omega + have hb' : 0 + gap0 w ≤ limit k p := by + dsimp [limit] + rcases hf with rfl | rfl <;> simp at hb ⊢ <;> omega + rcases phase12 k p w 0 default hp_pos hp hl RC.zero with ⟨s, hr, hS⟩ + rcases post_first k p (0 + gap0 w) hf hr (by omega) hb' with ⟨c', hA, hT⟩ + exact ⟨c', hA, stepPlus_trans hS hT⟩ + +theorem one_step (w : List Bool) (hw : w ≠ []) (hv : value w % 2 = 0) : + ∃ c', Allowed c' ∧ (Conf w ([1] +> default)) [target_tm]⊢⁺ c' := by + have heg := even_gap w hw hv + set a := gap0 w / 2 + have hga : gap0 w = 2 * a := by omega + rcases length_split w with ⟨k, p, hp, hl⟩ + have hb := capacity_bound k p w hp hl + rcases Nat.eq_zero_or_pos p with rfl | hp_pos + · rw [Nat.add_zero] at hl; rw [Nat.pow_zero, Nat.one_mul] at hb + rcases phase0 k w 1 ([1] +> default) hl right_one with ⟨s, hr, hS⟩ + have hr' : RC rd1 (1 + (a + 4 ^ k) * 2) s := RC_eq hr (by omega) rfl + have hg_bound : 2 * (a + 4 ^ k) ≤ gap0 (List.replicate (1 + (3 * k + 1)) false) := by + have hz := (zero_entry k 1 (Or.inl rfl)).1 + have hrep : List.replicate (1 + (3 * k + 1)) false = + false :: List.replicate (3 * k + 1) false := by + rw [Nat.add_comm 1 (3 * k + 1), List.replicate_succ] + rw [hrep] + omega + rcases odd_entry (3 * k + 1) (a + 4 ^ k) hr' hg_bound with ⟨c', hC, hT⟩ + exact ⟨c', hC, stepPlus_trans hS hT⟩ + · have hf : p = 1 ∨ p = 2 := by omega + have hb' : gap0 w ≤ 4 * 4 ^ k := by + rcases hf with rfl | rfl <;> simp at hb <;> omega + rcases phase12 k p w 1 ([1] +> default) hp_pos hp hl right_one with ⟨s, hr, hS⟩ + have hr' : RC rd1 (1 + a * 2) s := RC_eq hr (by omega) rfl + have hg_bound : 2 * a ≤ gap0 (List.replicate (1 + (3 * k + p)) false) := by + have hz := (zero_entry k p hf).1 + have hrep : List.replicate (1 + (3 * k + p)) false = + false :: List.replicate (3 * k + p) false := by + rw [Nat.add_comm 1 (3 * k + p), List.replicate_succ] + rw [hrep] + omega + rcases odd_entry (3 * k + p) a hr' hg_bound with ⟨c', hC, hT⟩ + exact ⟨c', hC, stepPlus_trans hS hT⟩ + +theorem Allowed_step {c : Cfg (Fin 2) (Fin 6)} (hA : Allowed c) : + ∃ c', Allowed c' ∧ c [target_tm]⊢⁺ c' := by + cases hA with + | Blank w => exact blank_step w + | One w hw hv => exact one_step w hw hv + | Shifted w n r hn hr hg => exact shifted_step n w r hn hr hg + +theorem multiStep_none_add {c : Cfg (Fin 2) (Fin 6)} {k : Nat} + (h : multiStep target_tm c k = none) (d : Nat) : + multiStep target_tm c (k + d) = none := by + rw [multiStep_add, h]; rfl + +theorem init31_F : + ((default : ListBlank (Fin 2)) {{5}}> default) [target_tm]⊢* Conf [false, false] default := + ⟨31, by run_steps 31⟩ + +theorem reach_arbitrarily_long_from {c_init c₀ : Cfg (Fin 2) (Fin 6)} + (h₀ : c_init [target_tm]⊢* c₀) (hA₀ : Allowed c₀) : + ∀ m : Nat, ∃ N c, m ≤ N ∧ Allowed c ∧ multiStep target_tm c_init N = some c + | 0 => by + rcases h₀ with ⟨N₀, hN₀⟩ + exact ⟨N₀, c₀, Nat.zero_le N₀, hA₀, hN₀⟩ + | m + 1 => by + rcases reach_arbitrarily_long_from h₀ hA₀ m with ⟨N, c, h_le, hc, hN⟩ + rcases Allowed_step hc with ⟨c', hc', k, hk_pos, hk⟩ + exact ⟨N + k, c', by omega, hc', multiStep_trans target_tm _ _ _ N k hN hk⟩ + +theorem does_not_halt_of_allowed {c_init c₀ : Cfg (Fin 2) (Fin 6)} + (h₀ : c_init [target_tm]⊢* c₀) (hA₀ : Allowed c₀) : + ∀ cfg : Cfg (Fin 2) (Fin 6), (c_init [target_tm]⊢* cfg) → (step target_tm cfg).isSome := by + intro cfg ⟨k, hk⟩ + cases h_step : step target_tm cfg with + | some _ => rfl + | none => + have h_none : multiStep target_tm c_init (k + 1) = none := by + rw [multiStep_succ', hk]; exact h_step + rcases reach_arbitrarily_long_from h₀ hA₀ (k + 1) with ⟨N, _, h_ge, _, hN⟩ + have h_split : N = (k + 1) + (N - (k + 1)) := by omega + have h_none_N : multiStep target_tm c_init N = none := by + rw [h_split] + exact multiStep_none_add h_none (N - (k + 1)) + rw [h_none_N] at hN + nomatch hN + +end Solution + +open Solution + +public section + +theorem is_not_halt_from_0757 : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{5}}> default) [target]⊢* cfg) → (step target cfg).isSome := + does_not_halt_of_allowed init31_F (Allowed.Blank [false, false]) + +theorem is_not_halt : IsNotHalt target := + does_not_halt_of_allowed init5 (Allowed.Blank []) + +end + +end BusyBeaver.M_1RB1LD_1RC0RB_1LA1RE_1LF0LA_1LA0RD_1LCHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD0LF_1RDHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD0LF_1RDHHH.lean new file mode 100644 index 00000000..02975f77 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD0LF_1RDHHH.lean @@ -0,0 +1,1008 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD0LF_1RDHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD0LF_1RDHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 2000000 +variable {α β γ : Type*} [Inhabited α] [Inhabited β] [Inhabited γ] + +namespace Solution +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 2000000 + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 2000000 + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 2000000 +@[simp] theorem zMz (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : HalfTape).head = 0 := rfl +@[simp] theorem zDt : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem zPs {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem zPt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,by omega,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ +macro "finish" : tactic => + `(tactic| exists 0 <;> rfl) +macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) +abbrev CCfg := Counter.CCfg (Fin 2) (Fin 6) +abbrev z04 (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev z0b (c : CCfg) : Option CCfg := Counter.bstep target_tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep target_tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (z04 c1) [target_tm]⊢⁺ (z04 c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ +abbrev t : BitWord := [1,1,0,0] +abbrev d0 : BitWord := [0,0] +abbrev d1 : BitWord := [1,0] +abbrev one : BitWord := [1] +abbrev lh : HalfTape := [1,0,1] +> default +abbrev w_pre : BitWord := t ++ t ++ one +@[simp] theorem zDd : d0 +> (default : HalfTape) = default := by + simp [d0] +inductive Call where + | ch + | cj + | cp + | ca +def zCs : Call -> Fin 6 + | .ch => A + | .cj => D + | .cp => D + | .ca => D +def zCw : Call -> BitWord + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] + | .ca => [1,1,1,0,1,0] +def zCR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (r <{{zCs c}} (l <+ zCw c)) +def zCL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> r) {{B}}> l) +def zCf (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + zCL lh (w_pre +> r) +def z0f (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l,(zCR l c r1) [target_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + z0f c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem z0g {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z0h {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem z0i {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z0j {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z0k {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0l (w : BitWord) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem z0m (ls : List Call) : Seg ls ls [] [] := by + intro r1 r2 h; exact h +theorem zSc {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases z0k h with ⟨r2,ha,hb⟩ + exact z0j (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS0 {ls1 ls2 ls3 : List Call} {w1 w2 v1 v2 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls2 ls3 v1 v2) : + Seg ls1 ls3 (w1 ++ v1) (w2 ++ v2) := by + intro r1 r2 h + rw [append_assoc,append_assoc] + exact h1 (v1 +> r1) (v2 +> r2) (h2 r1 r2 h) +theorem zS4 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc1 (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [target_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem z0n : Seg [.cp] [.ch] t (t ++ [0]) := + zS2 (mid := [1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0o : Seg [.cj] [.ch] t (t ++ one) := + zS2 (mid := [1,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0p : Seg [.ch] [.cj] (t ++ [0]) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0q : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0r : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0s : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1 d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0t : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0u : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0v : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0w : Seg [.cj] [.cp] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons,append_nil]; execute) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem H_T (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact z0l t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [zLp,h_eq,z0i] + exact zSg z0q ih +theorem zSa {w2 : BitWord} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact z0l w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq,z0i,zLp] + exact zSg hw ih +theorem z0x : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0y : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem z0z (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d0 d0 := + zSa z0x n +theorem z0A (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ n) d0 d1 := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg zH0 (zSa z0y n) +theorem z0B (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d1 d1 := + zSa z0y n +theorem z0C (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ (1 + n)) d1 d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg zH4 (zSa z0x n) +theorem z0D (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0n z0p) (H_T n) +theorem z0E (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0o zH2) (H_T n) +theorem z0F (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0r zH2) (H_T n) +theorem z0G (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0s (H_T n) +theorem z0H (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0t (H_T n) +theorem z0I (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [zLp',List.cons_append,List.nil_append] using zSg z0u (H_T n) +theorem z0J (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0v (zSg zH1 zH3) + have h1 := zSg h0 (zSa z0x n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0K (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0w (zSa z0x n) +theorem z0L : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0v zH1 +theorem z0M (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0v (zSg zH1 (zSg zH3 zH0)) + have h1 := zSg h0 (zSa z0y n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0N (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg [.cj,.ch] [.cp] d1 d1 := zSg z0w zH0 + have h1 := zSg h0 (zSa z0y n) + simpa only [zLp',List.cons_append,List.nil_append] using h1 +theorem z0O : Side [.ch] default (d1 +> default) := by + refine Side.cons (fun l => ?_) (Side.nil _) + unfold zCR zCL zCw zCs d1 + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute +theorem z0P : Seg [.ca] [.ch] t (t ++ t ++ one) := + zS2 + (mid := [1,1,0,1,1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0Q : Seg [.ch,.ca] ([.cj] ++ [.ch] ^ 5) w_pre (w_pre ++ t) := by + have h1 : Seg [.ch,.ca] [.ch,.ch,.ch] t (t ++ t ++ one) := + zSg z0q z0P + have h2 : Seg [.ch,.ch,.ch] ([.cj] ++ [.ch] ^ 5) (t ++ one) t := + zSg zH2 (H_T 2) + have h3 := zS0 h1 h2 + simpa only [w_pre,List.append_assoc,List.cons_append,List.nil_append] using h3 +theorem z0R (r : HalfTape) : + (zCL lh r) [target_tm]⊢⁺ (zCR ([1,1,0,1,0,1] +> default) .ch r) := by + unfold zCL zCR lh zCw zCs + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute +theorem z0S (r : HalfTape) : + (zCL ([1,1,0,1,0,1] +> default) r) [target_tm]⊢⁺ (zCR lh .ca r) := by + unfold zCL zCR lh zCw zCs + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute +open WordCalculus +open WordCalculus.Word +local notation "WordList" => List Word +def z3p_w : WordList := + [Q,V,V,Q,Q,V,K,V,K,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,Q,Q,V] +def z3q_w : WordList := + [K,V,V,K,Q,V,Q,V,Q,V,V,V,K,V,V,V,V,V,V,K,V,V,V,K,V,K,V,K,Q,V] +theorem z3v (n : Nat) : + Copy (31 + 32 * n) (260 + 256 * n) z3p_w z3q_w (9351 + 8192 * n) (58338 + 65536 * n) := by + unfold z3p_w z3q_w + refine copy_step_d11 (n' := 16 + 16 * n) (k' := 128 + 128 * n) (m := 64 + 64 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 33 + 32 * n) (k' := 252 + 256 * n) (m := 125 + 128 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 67 + 64 * n) (k' := 500 + 512 * n) (m := 249 + 256 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 34 + 32 * n) (k' := 248 + 256 * n) (m := 124 + 128 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_d10 (n' := 17 + 16 * n) (k' := 123 + 128 * n) (m := 61 + 64 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 35 + 32 * n) (k' := 242 + 256 * n) (m := 120 + 128 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d01 (n' := 17 + 16 * n) (k' := 121 + 128 * n) (m := 60 + 64 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 35 + 32 * n) (k' := 238 + 256 * n) (m := 118 + 128 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d01 (n' := 17 + 16 * n) (k' := 119 + 128 * n) (m := 59 + 64 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 35 + 32 * n) (k' := 234 + 256 * n) (m := 116 + 128 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 71 + 64 * n) (k' := 464 + 512 * n) (m := 231 + 256 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 143 + 128 * n) (k' := 924 + 1024 * n) (m := 461 + 512 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 72 + 64 * n) (k' := 460 + 512 * n) (m := 230 + 256 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 145 + 128 * n) (k' := 916 + 1024 * n) (m := 457 + 512 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 291 + 256 * n) (k' := 1828 + 2048 * n) (m := 913 + 1024 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 583 + 512 * n) (k' := 3652 + 4096 * n) (m := 1825 + 2048 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 1167 + 1024 * n) (k' := 7300 + 8192 * n) (m := 3649 + 4096 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 2335 + 2048 * n) (k' := 14596 + 16384 * n) (m := 7297 + 8192 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 4671 + 4096 * n) (k' := 29188 + 32768 * n) (m := 14593 + 16384 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 2336 + 2048 * n) (k' := 14592 + 16384 * n) (m := 7296 + 8192 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 4673 + 4096 * n) (k' := 29180 + 32768 * n) (m := 14589 + 16384 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 9347 + 8192 * n) (k' := 58356 + 65536 * n) (m := 29177 + 32768 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 18695 + 16384 * n) (k' := 116708 + 131072 * n) (m := 58353 + 65536 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 9348 + 8192 * n) (k' := 58352 + 65536 * n) (m := 29176 + 32768 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 18697 + 16384 * n) (k' := 116700 + 131072 * n) (m := 58349 + 65536 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 9349 + 8192 * n) (k' := 58348 + 65536 * n) (m := 29174 + 32768 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 18699 + 16384 * n) (k' := 116692 + 131072 * n) (m := 58345 + 65536 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n' := 9350 + 8192 * n) (k' := 58344 + 65536 * n) (m := 29172 + 32768 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_d10 (n' := 4675 + 4096 * n) (k' := 29171 + 32768 * n) (m := 14585 + 16384 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n' := 9351 + 8192 * n) (k' := 58338 + 65536 * n) (m := 29168 + 32768 * n) (by omega) (by omega) (by omega) ?_ + exact Copy.nil _ _ +theorem z3w (q : Nat) (hQ : 5 <= q) : + CopyTwelve (List.replicate q V ++ z3p_w) (List.replicate q V ++ z3q_w) := by + have hPow : 2 ^ q = 32 * 2 ^ (q - 5) := by + have heq : q = 5 + (q - 5) := by omega + conv_lhs => rw [heq,Nat.pow_add] + have hPos := pow_two_pos (q - 5) + have hTs := copy_replicate_V q 0 8 + have hBase := z3v (2 ^ (q - 5) - 1) + have h1 : (1 + 0) * 2 ^ q - 1 = 31 + 32 * (2 ^ (q - 5) - 1) := by omega + have h2 : 4 + 8 * 2 ^ q = 260 + 256 * (2 ^ (q - 5) - 1) := by omega + rw [h1,h2] at hTs + exact ⟨_,_,copy_append hTs hBase⟩ +theorem z3x : isSafePrefix z3q_w = true := by decide +kernel +def z3K_w : WordList := + [K,Q,Q,Q,K,K,Q,Q,K] ++ List.replicate 15 Q +def z3K : WordList := + List.replicate 4 V ++ [Q,V,V,Q,Q,V,K,V,Q,K,K,Q,Q] +def u_5 : WordList := [V,V,V,V,V,V,V,V,V,Q,V,V,Q,Q,V,K,V,K,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,Q,K,V,Q,V,V,V,K,K,K,Q,Q,K,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q] +def z3L : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,Q,V,K,V,K,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,Q,Q,V,K,V,V,V,V,V,Q,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,V,Q,V,V,V,Q,Q,V,K,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,K,V,V,V,V,V,V,V,V,Q,V,V,V,K,V,V,K,K,V,Q,K,Q,K,V,Q,V,K,V,V,V,K,V,V,V,V,Q,Q,V,V,V,V,V,K,V,V,V,Q,Q,V,V,V,V,V,V,V,K,K,K,K,K,Q,Q,Q,K,Q,Q,K,Q,K,K,Q,K,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,K,K,Q,Q,Q,Q,K,Q,K,K,K,K,K,K,K,Q,Q,Q,K,Q,K,Q,Q,K,K,K,K,Q,Q,K,K,Q,Q,Q,K,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def z3M : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,Q,V,K,V,K,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,Q,Q,V,V,V,V,Q,V,V,V,V,V,Q,Q,V,K,V,V,V,V,V,Q,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,V,Q,V,V,V,Q,Q,V,K,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,K,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,V,Q,Q,V,K,V,V,V,V,V,V,Q,V,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,Q,V,Q,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,V,Q,Q,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,Q,V,V,V,V,V,V,V,Q,V,K,V,V,K,Q,V,V,V,V,Q,V,Q,V,Q,V,V,Q,K,V,V,V,Q,V,V,Q,V,K,V,K,Q,V,V,V,Q,V,Q,V,V,V,V,V,Q,Q,K,V,Q,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,K,V,Q,V,V,Q,Q,V,Q,V,Q,Q,V,V,K,K,Q,K,Q,K,Q,K,V,Q,K,K,V,Q,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,K,Q,V,Q,V,K,V,Q,V,V,V,V,V,V,V,Q,K,V,V,V,Q,K,V,V,V,Q,V,V,K,V,K,V,Q,K,V,V,V,Q,V,K,V,V,V,V,V,Q,K,K,V,Q,V,K,V,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,Q,Q,Q,V,V,V,V,K,V,V,V,V,Q,Q,V,V,V,V,V,K,V,V,V,Q,Q,V,Q,V,V,V,V,V,V,V,V,K,K,K,K,K,K,K,K,Q,K,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,K,Q,K,K,K,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,Q,K,Q,K,K,Q,K,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,K,Q,K,Q,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,K,Q,Q,K,Q,K,K,K,Q,K,K,Q,K,Q,K,K,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,K,Q,K,Q,K,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,K,K,K,Q,K,K,K,Q,Q,K,K,Q,Q,Q,K,Q,Q,Q,Q,K,Q,K,K,Q,K,Q,K,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,K,Q,Q,K,Q,Q,K,K,K,K,Q,K,Q,K,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,K,K,Q,Q,Q,Q,K,Q,K,K,K,K,K,K,K,Q,Q,Q,K,Q,K,Q,Q,K,K,K,K,Q,Q,K,K,Q,Q,Q,K,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +theorem z3N : EntrySpec 19 z3p_w z3K_w 12000 := entrySpec_of_checkEntrySpec (by decide +kernel) +set_option maxRecDepth 4000000 in +theorem z3O : evalRounds 5 z3K = some u_5 := by decide +kernel +set_option maxRecDepth 4000000 in +theorem z3P : evalRounds 5 u_5 = some z3L := by decide +kernel +set_option maxRecDepth 4000000 in +theorem z3Q : evalRounds 5 z3L = some z3M := by decide +kernel +set_option maxRecDepth 4000000 in +theorem z3R : checkEntryTwo 19 z3p_w z3K_w 12000 z3M 118572124402667226942787183035401251327472713866885815623334278971049653593343273 9174073771324304005186384064554824126404797020214788052537224621593528352222997552707606800391029695717887 = true := by decide +kernel +theorem z3S : ∃ v,Rounds z3K v /\ AggState z3p_w 16 19 v := by + refine ⟨z3M,?_,good_of_checkEntryTwo 19 z3p_w z3K_w 12000 z3M 118572124402667226942787183035401251327472713866885815623334278971049653593343273 9174073771324304005186384064554824126404797020214788052537224621593528352222997552707606800391029695717887 z3N z3R⟩ + exact rounds_trans (evalRounds_sound 5 z3K u_5 z3O) + (rounds_trans (evalRounds_sound 5 u_5 z3L z3P) + (evalRounds_sound 5 z3L z3M z3Q)) +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) +theorem z3T {k : Nat} (hK : 0 < k) : ∃ hs,Num k [] hs := by + rcases even_or_odd_mul_two k with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · cases a with + | zero => omega + | succ a => + have heq : (a + 1) * 2 = 2 + a * 2 := by omega + rw [heq]; exact ⟨[.cj] ++ [.ch] ^ a,Num.even a⟩ + · exact ⟨[.cp] ++ [.ch] ^ a,Num.odd a⟩ +theorem z3U {k : Nat} {hs hs' : List Call} (h1 : Num k [] hs) (h2 : Num k [] hs') : + hs = hs' := by + cases h1 with + | @odd n => + generalize hk : 1 + n * 2 = k0 at h2 + cases h2 with + | @odd m => + have hnm : n = m := by omega + subst hnm; rfl + | even _ => omega + | @even n => + generalize hk : 2 + n * 2 = k0 at h2 + cases h2 with + | odd _ => omega + | @even m => + have hnm : n = m := by omega + subst hnm; rfl +def z3V (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs,Num k w hs -> Side hs (w +> r) r' +theorem z3W {r r' : HalfTape} (h : z3V 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl +theorem z3X {n : Nat} {r r' : HalfTape} + (hI : z3V (n * 2) r r') : z3V (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := z3W hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0v (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine zSc (z0J n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using hI [] _ hN2 +theorem z3Y {n : Nat} {r r' : HalfTape} + (hI : z3V (n * 2) r r') : z3V (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := z3W hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0L (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine zSc (z0M n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using hI [] _ hN2 +theorem z3Z {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hZ : A = 0) : + evalWords da default = default := by + induction hD with + | nil => rfl + | @zero A H u _ ih => + have hA0 : A = 0 := by omega + dsimp only [evalWords] + rw [ih hA0,zDd] + | one _ => omega +theorem z40 {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hPos : 0 < A) : + z3V ((A - 1) * 2) default (evalWords da default) := by + induction hD with + | nil => omega + | @zero A H u _ ih => + have hA_pos : 0 < A := by omega + have hIH := ih hA_pos + have hs := z3X hIH + rw [zDd] at hs + have heq : (A * 2 - 1) * 2 = 2 + (A - 1) * 4 := by omega + dsimp [evalWords] + rwa [heq] + | @one A H u hDu ih => + cases A with + | zero => + change z3V 0 default (d1 +> evalWords u default) + rw [z3Z hDu rfl] + intro w hs hN + generalize hk : 0 = k0 at hN + cases hN with + | zero => + have hd : d1 +> (default : HalfTape) = one +> default := by simp [d1,one] + rw [hd]; exact Side.nil (one +> default) + | odd _ => omega + | even _ => omega + | succ A => + have hA_pos : 0 < A + 1 := by omega + have hIH := ih hA_pos + have heq_in : (A + 1 - 1) * 2 = A * 2 := by omega + rw [heq_in] at hIH + have hs := z3Y hIH + rw [zDd] at hs + have heq : (1 + (A + 1) * 2 - 1) * 2 = 4 + A * 4 := by omega + dsimp [evalWords] + rwa [heq] +theorem zEd {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ∀ {A H : Nat},DigitVal A H v -> Seg ([Call.ch] ^ n) ([Call.ch] ^ b) (wordsToBits u) (wordsToBits v) := by + induction hI with + | nil n => + intro A H _ + exact z0m ([Call.ch] ^ n) + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | d00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0z _) (ih hD') + | d01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0A _) (ih hD') + | d10 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0B _) (ih hD') + | d11 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0C _) (ih hD') +theorem z41 {n : Nat} {hs hs' : List Call} + (hI : Num (3 + n) [] hs) (hJ : Num (2 + n * 2) [] hs') : + Seg hs ([Call.ch] ++ hs') t t := by + generalize hk1 : 3 + n = k1 at hI + generalize hk2 : 2 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = m * 2 := by omega + subst hq + rw [h1m] + exact z0D m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0E m +theorem z42 {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' (d1 ++ d0) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0F m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + have hq : q = m * 2 := by omega + subst hq + exact z0G m +theorem z43 {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' (d1 ++ d1) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | @odd q => + have hq : q = m * 2 := by omega + subst hq + exact z0H m + | even _ => omega + | @even m => + cases hJ with + | @odd q => + have hq : q = 1 + m * 2 := by omega + subst hq + exact z0I m + | even _ => omega +theorem z44 {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 2 + q * 2 := by omega + subst hm + exact z0J q +theorem z45 {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = q * 2 := by omega + subst hm + exact z0K q + | even _ => omega +theorem z46 {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 3 + q * 2 := by omega + subst hm + exact z0M q +theorem z47 {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = 1 + q * 2 := by omega + subst hm + exact z0N q + | even _ => omega +theorem z48 {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) : + ∀ {u : WordList} {n n' : Nat} {hs hs' : List Call}, + WordEffect n u n' v -> Num k [] hs -> Num k' [] hs' -> + Seg (([Call.ch] ^ n) ++ hs) (([Call.ch] ^ n') ++ hs') (wordsToBits u) (wordsToBits w) := by + induction hI with + | nil k => + intro u n n' hs hs' hE hN hN' + cases hE + rw [z3U hN hN'] + exact z0m (([Call.ch] ^ n) ++ hs') + | @T m _ _ _ _ _ _ ih => + intro u0 n0 n1 hs hs' hE hN hN' + cases hE with + | T hSub => + rcases z3T (by omega : 0 < 2 + m * 2) with ⟨hs0,hN0⟩ + have hIH := ih hSub hN0 hN' + have hStep := zSg (H_T n0) (z41 hN hN0) + have heq : ([Call.ch] ^ (n0 * 2)) ++ ([Call.ch] ++ hs0) = ([Call.ch] ^ (1 + n0 * 2)) ++ hs0 := by + have h1 : 1 + n0 * 2 = n0 * 2 + 1 := by omega + rw [h1,z0i,z0h,List.append_assoc] + rw [heq] at hStep + exact zS0 hStep hIH + | @pair0 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,K] ++ u) at hE + rcases wordEffect_split_output [Q,K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z3T hPos with ⟨hs0,hN0⟩ + have hD10 : DigitVal 1 2 [Q,K] := DigitVal.one (DigitVal.zero DigitVal.nil) + have hStep := zSg (zEd hL hD10) (z42 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @pair1 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,Q] ++ u) at hE + rcases wordEffect_split_output [Q,Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z3T (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD11 : DigitVal 3 2 [Q,Q] := DigitVal.one (DigitVal.one DigitVal.nil) + have hStep := zSg (zEd hL hD11) (z43 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short00 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z3T hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (z44 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short01 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z3T (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (z45 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short10 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z3T hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (z46 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short11 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z3T (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (z47 hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') +theorem z49 {n : Nat} {r r' : HalfTape} + (hI : z3V (n * 2) r r') : z3V (1 + n) (d1 +> (d0 +> r)) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil,<- append_assoc d1 d0 r] + cases m with + | zero => + have hn0 : n * 2 = 0 := by omega + rw [hn0] at hI + have hr' := z3W hI + subst hr' + rw [<- append_assoc t one r] + exact zSc z0r (Side.nil r) + | succ m => + have h1m : m + 1 = 1 + m := by omega + rw [h1m] + refine zSc (z0F m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : n * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil,<- append_assoc d1 d0 r] + refine zSc (z0G m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (m * 2)) := by + have hm : n * 2 = 2 + (m * 2) * 2 := by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 +theorem z4a {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) {u : WordList} {r' : HalfTape} + (hE : WordEffect 0 u 1 v) (hK : 0 < k') (hC : z3V k' (d1 +> default) r') : + z3V k (evalWords u default) (evalWords w r') := by + intro w0 hs hN + have hPosK : 0 < k := phaseScan_pos_of_out_pos hI hK + have hw0 : w0 = [] := by cases hN <;> first | rfl | omega + subst hw0 + rcases z3T hK with ⟨hs',hN'⟩ + have hSeg := z48 hI hE hN hN' + dsimp at hSeg + have hSide := zSc hSeg (z0j z0O (hC [] hs' hN')) + rwa [wordsToBits_append_tape,wordsToBits_append_tape] at hSide +theorem z4b {orig out : WordList} (hS : Step orig out) : + ∃ r,z3V 12 (evalWords orig default) r /\ evalWords out default = t +> r := by + cases hS with + | intro eff k v a b J A da hE hI hDA hSum => + have hposJ := pow_two_pos J + have hPosK : 0 < k := by omega + have hDFull : DigitVal k (J + 1) (da ++ [Q]) := by + have h := digitVal_append hDA (DigitVal.one DigitVal.nil) + have heq : A + 1 * 2 ^ J = k := by omega + rwa [heq] at h + have hC0 : z3V ((k - 1) * 2) default (evalWords (da ++ [Q]) default) := + z40 hDFull hPosK + have hC1 : z3V k (d1 +> default) (evalWords (V :: (da ++ [Q])) default) := by + have h := z49 hC0 + have hk : 1 + (k - 1) = k := by omega + rwa [hk,zDd] at h + have hRun := z4a hI hE hPosK hC1 + rw [<- evalWords_append] at hRun + exact ⟨evalWords (v ++ V :: (da ++ [Q])) default,hRun,rfl⟩ +theorem z4c {r r' : HalfTape} (hI : z3V 12 r r') : + (zCf r) [target_tm]⊢⁺ zCf (t +> r') := by + have h_num : Num 12 [] ([.cj] ++ [.ch] ^ 5) := Num.even 5 + have hC := hI [] ([.cj] ++ [.ch] ^ 5) h_num + have hS := zSc z0Q hC + rcases hS with _ | ⟨hch,hrest⟩ + rcases hrest with _ | ⟨hca,hnil⟩ + cases hnil + have h1 := zPt (z0R (w_pre +> r)) (hch ([1,1,0,1,0,1] +> default)) + have h2 := zPt (z0S _) (hca lh) + have h3 := zPt h1 h2 + rwa [append_assoc] at h3 +theorem z4d {orig out : WordList} (hS : Step orig out) : + (zCf (evalWords orig default)) [target_tm]⊢⁺ zCf (evalWords out default) := by + rcases z4b hS with ⟨r,hC,hEq⟩ + rw [hEq] + exact z4c hC +theorem z4e {u v : WordList} (hR : Rounds u v) : + (zCf (evalWords u default)) [target_tm]⊢* zCf (evalWords v default) := by + induction hR with + | refl u => exact ⟨0,rfl⟩ + | next hS _ ih => + rcases z4d hS with ⟨n1,_,hn1⟩ + rcases ih with ⟨n2,hn2⟩ + exact ⟨n1 + n2,zMt target_tm _ _ _ n1 n2 hn1 hn2⟩ +def z4f : CCfg := ⟨0,0,[],[]⟩ +def z4g : CCfg := ⟨2,1,[1,0,0,0,0,0,0,0,0,0,0,1],[1,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4h : CCfg := ⟨0,1,[1,0,0,1,0,0,0,1,0,1,0,0,0,1],[1,1,0,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,1,0,1,0,1]⟩ +def z4i : CCfg := ⟨1,1,[1,0,1],[1,1,1,0,1,1,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4j : CCfg := ⟨3,1,[0,0,1,0,1,1,0,0,1,1,0,0,1,0,1,0,1,1,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,1],[1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,0,1,0,1]⟩ +def z4k : CCfg := ⟨1,1,[0,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,1,0,1,0,1,1,0,0,0,0,1,1,0,0,1,0,0,0,0,0,1,0,1],[0,1]⟩ +set_option maxRecDepth 4000000 in +theorem z4l : zCm z4f 1000 = some z4g := by decide +set_option maxRecDepth 4000000 in +theorem z4m : zCm z4g 1000 = some z4h := by decide +set_option maxRecDepth 4000000 in +theorem z4n : zCm z4h 1000 = some z4i := by decide +set_option maxRecDepth 4000000 in +theorem z4o : zCm z4i 1000 = some z4j := by decide +set_option maxRecDepth 4000000 in +theorem z4p : zCm z4j 670 = some z4k := by decide +theorem z4q : + (init []) [target_tm]⊢* zCf (evalWords z3K default) := by + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = z04 z4f := rfl + have h2 : z04 z4k = zCf (evalWords z3K default) := by + unfold z04 z4k zCf zCL lh w_pre z3K + simp only [List.replicate,List.cons_append,List.nil_append,evalWords,wordsToBits,t,d1,d0,one,append_cons,append_nil,z00] + rfl + have hPlus : (z04 z4f) [target_tm]⊢⁺ (z04 z4k) := + zPt (zTc (by decide) z4l) + (zPt (zTc (by decide) z4m) + (zPt (zTc (by decide) z4n) + (zPt (zTc (by decide) z4o) + (zTc (by decide) z4p)))) + rw [<- h0,h2] at hPlus + rcases hPlus with ⟨n,_,hn⟩ + exact ⟨n,hn⟩ +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d) = some c') : + (multiStep target_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +theorem z4r (m : Nat) : + ∃ N ≥ m,∃ p q w, + multiStep target_tm (init []) N = some (zCf (evalWords w default)) /\ + AggState z3p_w p q w := by + induction m with + | zero => + rcases z3S with ⟨v0,hRounds,hGood0⟩ + rcases z4q with ⟨k1,hk1⟩ + rcases z4e hRounds with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,16,19,v0, + zMt target_tm _ _ _ k1 k2 hk1 hk2,hGood0⟩ + | succ m ih => + rcases ih with ⟨N,hN,p,q,w,h_ms,h_good⟩ + rcases aggState_step_of_copyTwelve z3p_w z3q_w z3x z3w p q w h_good + with ⟨w',hStep,h_good'⟩ + rcases z4d hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,1 + p,1 + q,w', + zMt target_tm _ _ _ N k h_ms h_step_k,h_good'⟩ + +end Solution + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 2000000 + + + +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases z4r (n + 1) with ⟨N,hN,_,_,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := zIm h_N + rw [zMs,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD0LF_1RDHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_0LDHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_0LDHHH.lean new file mode 100644 index 00000000..5c313d95 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_0LDHHH.lean @@ -0,0 +1,931 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusF +public import BusyBeaver.Calculi.WordCalculusG +public import BusyBeaver.Calculi.WordCalculusH + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_0LDHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_0LDHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +abbrev A : Fin 6 := 1 +abbrev B : Fin 6 := 2 +abbrev C : Fin 6 := 3 +abbrev D : Fin 6 := 4 +abbrev E : Fin 6 := 0 +abbrev F : Fin 6 := 5 +@[reducible] def tm : Machine (Fin 2) (Fin 6) := target_tm +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 8000000 + +open WordVKQ Word + +abbrev evalCCfgVKQ (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev z0b (c : CCfg) : Option CCfg := Counter.bstep tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (evalCCfgVKQ c1) [tm]⊢⁺ (evalCCfgVKQ c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ + +set_option maxRecDepth 200000 +set_option exponentiation.threshold 2048 +abbrev pref_cap : BitWord := [1,1,0,0,1,1,0,1,1,0,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0] + + +def zCs : Call -> Fin 6 + | .ch => E + | .ca => C + +def zCR (w : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (w <{{zCs c}} ([1] +> r)) + +def zCL (w : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> w) {{A}}> r) + +def zCf (w : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> pref_cap +> w) {{A}}> default) +abbrev callStep (c : Call) (w1 w2 : HalfTape) : Prop := + ∀ r, (zCR w1 c r) [tm]⊢⁺ (zCL w2 r) + +abbrev Side := SideP callStep +abbrev Seg := SegP callStep + +theorem seg_ch_V : Seg [.ch] [.ch, .ch] V_u V_u := + segP_of_step_two (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (fun u r => by unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_V : Seg [.ca] [.ch] V_u Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Vp : Seg [.ca] [.ca, .ca] Vp Vp := + segP_of_step_two (mid1 := [0, 1, 1, 1]) (mid2 := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_K : Seg [.ch] [] K_u Q_u := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs K_u Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_Q : Seg [.ch] [.ch] Q_u K_u := + segP_of_step_one (mid := [1, 1]) + (fun u r => by unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL K_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_VpQ : Seg [.ca] [.ca] (Vp ++ Q_u) (Kp ++ Vp) := + segP_of_step_one (mid := [0, 1, 0, 1, 1, 1]) + (fun u r => by unfold zCR zCs Vp Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_KpVp : Seg [.ca] [] (Kp ++ Vp) (Qp ++ Vp) := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs Kp Vp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_QpVp : Seg [.ca] [.ca, .ca] (Qp ++ Vp) (Kp ++ Vp) := + segP_of_step_two (mid1 := [0, 1, 1, 1, 1, 1]) (mid2 := [0, 1, 0, 1, 1, 1]) + (fun u r => by unfold zCR zCs Qp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Kp : Seg [.ca] [] Kp Qp := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs Kp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Qp : Seg [.ca] [.ca] Qp Kp := + segP_of_step_one (mid := [1, 1]) + (fun u r => by unfold zCR zCs Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_KQ : Seg [.ca] [] (K_u ++ Q_u) Vp := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs K_u Q_u Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_QQ : Seg [.ca] [.ca] (Q_u ++ Q_u) Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + + +-- Turnaround zP0..zP6 +abbrev tr1 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1] +abbrev tr2 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1] +abbrev tr3 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1] +abbrev tr4 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1] +abbrev tr5 : BitWord := [0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1] +abbrev tr6 : BitWord := [0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1] + +theorem zP0 (w : HalfTape) : (zCf w) [tm]⊢⁺ (zCR w .ca (tr1 +> default)) := by + unfold zCf zCR zCs pref_cap tr1 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP1 (w : HalfTape) : (zCL w (tr1 +> default)) [tm]⊢⁺ (zCR w .ca (tr2 +> default)) := by + unfold zCL zCR zCs tr1 tr2 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP2 (w : HalfTape) : (zCL w (tr2 +> default)) [tm]⊢⁺ (zCR w .ca (tr3 +> default)) := by + unfold zCL zCR zCs tr2 tr3 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP3 (w : HalfTape) : (zCL w (tr3 +> default)) [tm]⊢⁺ (zCR w .ca (tr4 +> default)) := by + unfold zCL zCR zCs tr3 tr4 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP4 (w : HalfTape) : (zCL w (tr4 +> default)) [tm]⊢⁺ (zCR w .ca (tr5 +> default)) := by + unfold zCL zCR zCs tr4 tr5 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP5 (w : HalfTape) : (zCL w (tr5 +> default)) [tm]⊢⁺ (zCR w .ca (tr6 +> default)) := by + unfold zCL zCR zCs tr5 tr6 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP6 (w : HalfTape) : (zCL w (tr6 +> default)) [tm]⊢⁺ (zCf ([1, 1, 0] +> w)) := by + unfold zCL zCf tr6 pref_cap + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +-- Section 2: Words, Shift Identity, DigitVal, Parse, Scan, Step +theorem segSpec : SegSpec callStep := + ⟨seg_ch_V, seg_ca_V, seg_ca_Vp, seg_ch_K, seg_ch_Q, + seg_ca_VpQ, seg_ca_KpVp, seg_ca_QpVp, seg_ca_Kp, seg_ca_Qp, + seg_ca_KQ, seg_ca_QQ⟩ + +theorem Side_turnaround {w w' : HalfTape} (h : Side ([Call.ca] ^ 6) w w') : + (zCf w) [tm]⊢⁺ (zCf ([1, 1, 0] +> w')) := by + rcases h with _ | ⟨hc1, h⟩ + rcases h with _ | ⟨hc2, h⟩ + rcases h with _ | ⟨hc3, h⟩ + rcases h with _ | ⟨hc4, h⟩ + rcases h with _ | ⟨hc5, h⟩ + rcases h with _ | ⟨hc6, h⟩ + cases h + exact stepPlus_trans_vkq (zP0 w) (stepPlus_trans_vkq (hc1 (tr1 +> default)) (stepPlus_trans_vkq (zP1 _) (stepPlus_trans_vkq (hc2 (tr2 +> default)) (stepPlus_trans_vkq (zP2 _) (stepPlus_trans_vkq (hc3 (tr3 +> default)) (stepPlus_trans_vkq (zP3 _) (stepPlus_trans_vkq (hc4 (tr4 +> default)) (stepPlus_trans_vkq (zP4 _) (stepPlus_trans_vkq (hc5 (tr5 +> default)) (stepPlus_trans_vkq (zP5 _) (stepPlus_trans_vkq (hc6 (tr6 +> default)) (zP6 w')))))))))))) + +theorem Step_exec {u u' : List Word} (h : Step u u') : + (zCf (evalWords u default)) [tm]⊢⁺ (zCf (evalWords u' default)) := by + rcases h with ⟨n, b', v, da, H, g, hScan, hDg, rfl⟩ + have hSeg := Seg_of_Scan segSpec hScan + dsimp at hSeg + have hSide0 := sideP_of_segP hSeg (Side_ca_default segSpec hDg) + rw [wordsToBits_append_tape, evalWords_append, evalWords_replicate_K, wordsToBitsShifted_append_tape, <- evalWordsShifted_append] at hSide0 + have hTurn := Side_turnaround hSide0 + rwa [evalWords_V_shift] at hTurn + +theorem Rounds_exec {u v : List Word} (h : Rounds u v) : + (zCf (evalWords u default)) [tm]⊢* (zCf (evalWords v default)) := by + induction h with + | refl _ => exact ⟨0, rfl⟩ + | next hS _ ih => exact stepStar_of_stepPlus_vkq (stepPlus_stepStar_trans_vkq (Step_exec hS) ih) + +-- Section 3: Universal Parse_V_start, Scan_of_Parse, and Trace Evaluators + +def u_0 : List Word := [K,Q,Q] +def tags_0 : List Nat := [3,5] +def da_0 : List Word := [Q,K,Q] +def n_0 : Nat := 0 +def u_1 : List Word := [V,K,V,Q,K,Q] +def tags_1 : List Nat := [1,0,3,5] +def da_1 : List Word := [Q,Q,Q] +def n_1 : Nat := 0 +def u_2 : List Word := [V,K,V,V,K,V,Q,Q,Q] +def tags_2 : List Nat := [1,0,1,0,4,4] +def da_2 : List Word := [K,Q,K,Q,K,Q] +def n_2 : Nat := 1 +def u_3 : List Word := [V,K,V,V,K,V,V,V,V,K,Q,K,Q,K,Q] +def tags_3 : List Nat := [1,0,1,0,0,0,1,3,4,3,4] +def da_3 : List Word := [K,K,Q,K,K,Q] +def n_3 : Nat := 1 +def u_4 : List Word := [V,K,V,V,K,V,V,V,V,K,V,Q,V,K,V,K,K,Q,K,K,Q] +def tags_4 : List Nat := [1,0,1,0,0,0,1,0,3,1,2,4,3,3,4] +def da_4 : List Word := [K,Q,K,K,K,Q] +def n_4 : Nat := 1 +def u_5 : List Word := [V,K,V,V,K,V,V,V,V,K,V,V,K,K,V,Q,V,V,K,K,V,K,Q,K,K,K,Q] +def tags_5 : List Nat := [1,0,1,0,0,0,1,0,0,5,0,3,0,0,5,0,5,3,3,3,4] +def da_5 : List Word := [K,Q,Q,Q,Q,Q,K,Q,Q,K,K,Q] +def n_5 : Nat := 1 +def u_6 : List Word := [V,K,V,V,K,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,Q,Q,Q,V,K,Q,Q,Q,Q,Q,K,Q,Q,K,K,Q] +def tags_6 : List Nat := [1,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,3,5,0,5,5,5,3,5,3,3,4] +def da_6 : List Word := [K,K,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def n_6 : Nat := 1 +def u_7 : List Word := [V,K,V,V,K,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,Q,V,Q,Q,V,K,K,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def tags_7 : List Nat := [1,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,3,0,3,3,0,5,4,5,5,4,5,3,5,3,3,4] +def da_7 : List Word := [K,K,Q,K,Q,K,K,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def n_7 : Nat := 1 +def u_8 : List Word := [V,K,V,V,K,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,K,V,K,K,V,V,V,V,V,V,V,Q,V,Q,K,V,K,K,Q,K,Q,K,K,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def tags_8 : List Nat := [1,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,5,0,0,0,0,0,0,0,3,0,4,1,4,4,3,3,5,3,5,5,4,5,3,5,3,3,4] +def da_8 : List Word := [K,K,Q,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def n_8 : Nat := 1 +def u_9 : List Word := [V,K,V,V,K,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,Q,V,Q,V,V,V,V,Q,V,Q,K,V,K,K,Q,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def tags_9 : List Nat := [1,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,3,0,3,0,0,0,0,3,0,4,1,4,4,4,5,5,3,4,5,5,3,5,5,4,5,3,5,3,3,4] +def da_9 : List Word := [K,K,Q,K,K,K,K,K,K,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def n_9 : Nat := 1 +def u_10 : List Word := [V,K,V,V,K,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,Q,V,K,V,V,V,V,K,V,V,K,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,K,V,K,K,Q,K,K,K,K,K,K,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def tags_10 : List Nat := [1,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,3,1,0,0,0,1,0,1,0,0,0,0,0,0,3,0,0,0,3,0,0,0,0,3,0,4,1,3,5,4,3,3,3,5,4,5,5,4,5,5,5,3,5,5,3,5,5,4,5,3,5,3,3,4] +def da_10 : List Word := [K,K,Q,K,K,Q,K,Q,Q,K,Q,K,K,Q,K,Q,K,Q,Q,Q,Q,K,K,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def n_10 : Nat := 1 +def u_11 : List Word := [V,K,V,V,K,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,K,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,V,K,V,V,V,V,K,V,V,K,V,Q,V,V,K,K,Q,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,V,Q,K,V,K,K,Q,K,K,Q,K,Q,Q,K,Q,K,K,Q,K,Q,K,Q,Q,Q,Q,K,K,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def tags_11 : List Nat := [1,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,5,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,1,0,3,0,1,5,0,0,0,0,0,0,0,0,3,0,0,3,0,0,0,0,3,0,4,1,3,5,5,3,5,3,5,4,4,3,5,5,3,3,5,3,3,3,3,5,5,5,5,3,5,5,3,5,5,4,5,3,5,3,3,4] +def da_11 : List Word := [K,K,Q,K,K,Q,Q,Q,K,K,Q,K,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,K,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def n_11 : Nat := 1 +def u_12 : List Word := [V,K,V,V,K,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,Q,V,V,Q,V,Q,V,V,V,K,V,V,Q,K,V,Q,Q,K,Q,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,V,Q,K,V,K,K,Q,K,K,Q,Q,Q,K,K,Q,K,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,K,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def tags_12 : List Nat := [1,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,1,0,1,2,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,1,0,3,0,0,3,0,3,0,0,1,0,0,3,3,0,3,3,5,0,0,0,0,3,0,0,3,0,0,0,0,3,0,4,1,4,5,5,3,3,5,3,3,5,5,5,4,5,4,4,4,5,5,3,3,5,3,3,3,5,3,3,5,5,5,5,3,5,5,3,5,5,4,5,3,5,3,3,4] +def da_12 : List Word := [K,K,Q,K,K,Q,Q,K,Q,K,Q,Q,Q,K,K,Q,Q,K,K,Q,Q,K,Q,K,K,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def n_12 : Nat := 1 +def u_13 : List Word := [V,K,V,V,K,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,Q,V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,K,V,V,K,V,V,V,K,Q,V,K,K,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,Q,K,V,Q,K,V,V,V,V,V,V,V,V,V,V,Q,K,V,Q,K,K,V,Q,Q,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,V,Q,K,V,K,K,Q,K,K,Q,Q,K,Q,K,Q,Q,Q,K,K,Q,Q,K,K,Q,Q,K,Q,K,K,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def tags_13 : List Nat := [1,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,1,0,1,0,3,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,1,0,1,0,1,2,0,1,0,0,1,3,1,3,0,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,3,3,0,4,0,0,0,0,0,0,0,0,0,0,3,3,0,4,3,0,3,3,0,0,0,0,3,0,0,3,0,0,0,0,3,0,4,1,4,5,5,3,4,5,4,3,5,3,3,5,3,4,4,4,3,3,5,5,5,5,3,3,3,5,4,4,5,5,3,4,5,5,4,3,3,5,5,5,5,3,5,5,3,5,5,4,5,3,5,3,3,4] +def da_13 : List Word := [K,K,Q,K,K,Q,Q,K,K,K,K,K,Q,K,K,K,K,Q,K,Q,K,Q,Q,K,K,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def n_13 : Nat := 1 +def u_14 : List Word := [V,K,V,V,K,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,Q,V,V,K,V,V,V,K,V,Q,K,V,Q,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,V,K,Q,V,V,V,V,V,V,V,V,V,V,V,V,K,Q,V,V,K,V,K,K,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,Q,V,V,V,K,V,Q,Q,V,Q,V,V,V,K,Q,V,V,V,V,Q,K,K,V,V,V,V,V,Q,V,V,V,V,K,K,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,V,Q,K,V,K,K,Q,K,K,Q,Q,K,K,K,K,K,Q,K,K,K,K,Q,K,Q,K,Q,Q,K,K,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def tags_14 : List Nat := [1,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,3,0,1,0,0,1,0,3,3,0,3,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,1,3,0,0,0,0,0,0,0,0,0,0,0,1,3,0,1,0,5,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,3,0,0,1,0,4,0,3,0,0,1,3,0,0,0,0,3,3,3,0,0,0,0,0,3,0,0,0,0,5,0,0,0,0,3,0,0,3,0,0,0,0,3,0,4,1,4,5,5,3,4,3,4,5,3,3,3,5,3,5,3,3,5,3,3,5,5,5,5,4,3,3,5,3,3,5,5,5,5,4,3,4,5,5,5,5,5,4,4,4,5,5,3,4,5,5,4,3,3,5,5,5,5,3,5,5,3,5,5,4,5,3,5,3,3,4] +def da_14 : List Word := [K,K,Q,K,K,Q,Q,K,K,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,K,Q,K,K,Q,Q,K,K,K,K,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,K,Q,Q,K,K,Q,Q,K,K,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,K,K,Q,Q,K,Q,K,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,K,K,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def n_14 : Nat := 1 +def u_15 : List Word := [V,K,V,V,K,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,K,V,V,V,K,V,V,K,K,V,K,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,Q,V,V,V,V,V,V,V,V,V,V,V,K,V,Q,V,K,V,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,Q,V,V,V,V,K,Q,K,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,Q,V,K,V,V,Q,Q,Q,V,Q,V,Q,Q,V,Q,K,V,V,V,V,V,K,K,V,Q,Q,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,K,K,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,V,Q,K,V,K,K,Q,K,K,Q,Q,K,K,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,K,Q,K,K,Q,Q,K,K,K,K,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,K,Q,Q,K,K,Q,Q,K,K,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,K,K,Q,Q,K,Q,K,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,K,K,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def tags_15 : List Nat := [1,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1,2,0,0,1,0,0,5,2,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,1,0,3,0,0,0,0,0,0,0,0,0,0,1,0,3,1,0,0,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,1,0,1,0,0,0,1,0,1,0,3,0,0,0,1,3,3,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,3,2,0,0,4,3,0,3,0,3,3,0,4,0,0,0,0,0,5,0,4,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,5,0,0,0,0,3,0,0,3,0,0,0,0,3,0,4,1,4,5,5,3,4,3,3,4,5,5,3,4,5,4,3,3,5,3,3,5,3,3,3,3,3,5,5,3,3,4,4,3,5,3,3,5,3,3,5,3,4,4,5,5,5,5,3,5,3,3,5,3,3,5,4,4,5,4,3,4,5,5,5,3,3,3,3,5,4,4,5,5,3,4,5,5,4,3,3,5,5,5,5,3,5,5,3,5,5,4,5,3,5,3,3,4] +def da_15 : List Word := [K,K,Q,K,K,Q,Q,K,K,K,K,K,Q,K,Q,Q,K,Q,Q,Q,K,K,K,K,K,Q,Q,K,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,K,K,K,K,K,K,K,K,Q,Q,Q,K,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,K,Q,K,K,Q,Q,Q,K,K,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,K,Q,Q,K,K,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,K,K,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def n_15 : Nat := 1 +def u_16 : List Word := [V,K,V,V,K,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,Q,V,V,V,K,V,V,V,V,Q,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,K,K,V,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,V,V,K,V,Q,K,V,V,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,V,K,Q,V,V,V,V,K,V,K,V,K,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,Q,V,K,Q,V,V,V,Q,V,V,V,K,K,V,Q,K,V,Q,Q,Q,Q,Q,V,V,Q,K,V,V,K,V,Q,K,V,Q,K,V,Q,V,V,V,V,V,V,Q,V,Q,Q,V,Q,K,V,V,V,V,V,K,V,V,V,V,Q,K,K,Q,V,V,V,V,V,Q,V,V,V,V,K,K,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,V,Q,K,V,K,K,Q,K,K,Q,Q,K,K,K,K,K,Q,K,Q,Q,K,Q,Q,Q,K,K,K,K,K,Q,Q,K,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,K,K,K,K,K,K,K,K,Q,Q,Q,K,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,K,Q,K,K,Q,Q,Q,K,K,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,K,Q,Q,K,K,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,K,K,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def tags_16 : List Nat := [1,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1,0,3,0,0,1,0,0,0,0,3,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,5,0,0,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,1,0,1,0,0,0,1,0,1,0,1,0,0,1,0,3,3,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,1,3,0,0,0,1,2,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,3,0,5,0,0,0,3,0,0,0,5,0,3,3,0,4,4,3,0,0,3,3,0,1,0,3,3,0,3,3,0,3,0,0,0,0,0,0,3,0,3,3,0,3,3,0,0,0,0,1,0,0,0,0,3,3,4,0,0,0,0,0,3,0,0,0,0,5,0,0,0,0,3,0,0,3,0,0,0,0,3,0,4,1,4,5,5,3,4,3,3,5,5,4,3,4,4,3,3,5,3,3,3,3,3,5,5,5,5,5,4,5,5,3,3,3,3,3,3,3,3,3,3,5,3,3,5,3,4,5,5,5,4,5,3,5,4,3,4,5,3,3,5,3,3,5,5,3,4,5,5,5,5,3,5,3,3,5,3,4,3,3,3,5,3,3,3,3,3,5,3,4,5,5,5,3,3,3,3,5,4,4,5,5,3,4,5,5,4,3,3,5,5,5,5,3,5,5,3,5,5,4,5,3,5,3,3,4] +def da_16 : List Word := [K,K,Q,K,K,Q,Q,K,K,K,K,K,Q,Q,K,Q,K,K,Q,K,Q,K,K,K,K,K,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,K,K,K,Q,K,Q,K,K,Q,Q,Q,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,K,K,Q,Q,K,K,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,Q,K,K,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,K,K,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def n_16 : Nat := 1 +def u_17 : List Word := [V,K,V,V,K,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,K,V,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,Q,V,V,V,K,V,Q,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,K,K,V,V,V,K,V,V,K,Q,V,K,V,V,K,K,V,K,K,V,K,V,V,V,V,V,V,K,V,K,K,V,K,Q,V,V,V,V,K,V,V,V,V,V,K,Q,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,Q,V,K,Q,V,V,V,K,V,V,K,Q,V,Q,Q,K,K,K,V,V,V,V,V,V,V,V,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,V,Q,Q,V,Q,V,V,V,V,V,V,Q,V,V,K,V,V,Q,Q,V,Q,Q,V,V,Q,V,V,V,V,V,Q,V,Q,Q,V,Q,V,K,Q,K,V,Q,Q,Q,Q,K,V,Q,V,V,V,V,Q,K,K,Q,V,V,V,V,V,Q,V,V,V,V,K,K,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,V,Q,K,V,K,K,Q,K,K,Q,Q,K,K,K,K,K,Q,Q,K,Q,K,K,Q,K,Q,K,K,K,K,K,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,K,K,K,Q,K,Q,K,K,Q,Q,Q,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,K,K,Q,Q,K,K,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,Q,K,K,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,K,K,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] + +def head_w : List Word := [V,K,V,V,K,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,V] +def tags_head : List Nat := [1,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,1,0,1,0,1,0,0,0,0] +def v_head : List Word := [K,V,V,K,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,V,V] +def a_head : Nat := 36028797018963967 +def b_head : Nat := 87674919322905362 +def A_top : Nat := 342480153605099 + +def s_base : List Word := [V,V,V,V,V,Q,V,V,V,V,K,K,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,V,Q,K,V] +def s_full : List Word := s_base ++ [K,K,Q,K,K,Q,Q,K,K,K,K] +def tags_s : List Nat := [0,0,0,0,0,3,0,0,0,0,5,0,0,0,0,3,0,0,3,0,0,0,0,3,0,4,1,4,5,5,3,4,3] +def v_s : List Word := [V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,Q,V,K] + +def top_base : List Word := [Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,Q] +def top_full : List Word := top_base ++ [K] +def tags_top : List Nat := [5,4,4,5,5,3,4,5,5,4,3,3,5,5,5,5,3,5,5,3,5,5,4,5,3,5,3,3,4] + +def p_init : List Word := [V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,K,V,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,Q,V,V,V,K,V,Q,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,V,K,V,V,V,V,V,K,K,V,V,V,K,V,V,K,Q,V,K,V,V,K,K,V,K,K,V,K,V,V,V,V,V,V,K,V,K,K,V,K,Q,V,V,V,V,K,V,V,V,V,V,K,Q,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,K,V,V,V,V,Q,V,K,Q,V,V,V,K,V,V,K,Q,V,Q,Q,K,K,K,V,V,V,V,V,V,V,V,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,V,Q,Q,V,Q,V,V,V,V,V,V,Q,V,V,K,V,V,Q,Q,V,Q,Q,V,V,Q,V,V,V,V,V,Q,V,Q,Q,V,Q,V,K,Q,K,V,Q,Q,Q,Q,K,V,Q,V,V,V,V,Q,K,K,Q] +def ds_core_init : List Word := [Q,K,Q,K,K,Q,K,Q,K,K,K,K,K,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,K,K,K,Q,K,Q,K,K,Q,Q,Q,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,K,K,Q,Q,K,K,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,Q,K,K,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,K,K,K] +def A_core_init : Nat := 5808871908250397171278560619621236457036654829733 + +def zInitCCfg : CCfg := ⟨0, 0, [], []⟩ +def zHitCCfg : CCfg := ⟨1, 0, [0,1,1,0,0,1,1,0,1,1,0,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,1,0,1], []⟩ + +set_option maxRecDepth 200000 in +theorem zCm_init : zCm zInitCCfg 1694 = some zHitCCfg := by decide + +theorem init_to_u0 : (init []) [tm]⊢* zCf (evalWords u_0 default) := by + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = evalCCfgVKQ zInitCCfg := rfl + have h1 : evalCCfgVKQ zHitCCfg = zCf (evalWords u_0 default) := by + dsimp [evalCCfgVKQ, zHitCCfg, zCf, pref_cap, u_0, evalWords, V_u, K_u, Q_u] + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq, default_head_vkq, default_tail_vkq] + have hPlus := zTc (by decide : 0 < 1694) zCm_init + rw [<- h0, h1] at hPlus + exact stepStar_of_stepPlus_vkq hPlus + +set_option maxRecDepth 200000 in +theorem step_0 : Step u_0 u_1 := checkStep_sound n_0 tags_0 u_0 da_0 u_1 (by decide) +set_option maxRecDepth 200000 in +theorem step_1 : Step u_1 u_2 := checkStep_sound n_1 tags_1 u_1 da_1 u_2 (by decide) +set_option maxRecDepth 200000 in +theorem step_2 : Step u_2 u_3 := checkStep_sound n_2 tags_2 u_2 da_2 u_3 (by decide) +set_option maxRecDepth 200000 in +theorem step_3 : Step u_3 u_4 := checkStep_sound n_3 tags_3 u_3 da_3 u_4 (by decide) +set_option maxRecDepth 200000 in +theorem step_4 : Step u_4 u_5 := checkStep_sound n_4 tags_4 u_4 da_4 u_5 (by decide) +set_option maxRecDepth 200000 in +theorem step_5 : Step u_5 u_6 := checkStep_sound n_5 tags_5 u_5 da_5 u_6 (by decide) +set_option maxRecDepth 200000 in +theorem step_6 : Step u_6 u_7 := checkStep_sound n_6 tags_6 u_6 da_6 u_7 (by decide) +set_option maxRecDepth 200000 in +theorem step_7 : Step u_7 u_8 := checkStep_sound n_7 tags_7 u_7 da_7 u_8 (by decide) +set_option maxRecDepth 200000 in +theorem step_8 : Step u_8 u_9 := checkStep_sound n_8 tags_8 u_8 da_8 u_9 (by decide) +set_option maxRecDepth 200000 in +theorem step_9 : Step u_9 u_10 := checkStep_sound n_9 tags_9 u_9 da_9 u_10 (by decide) +set_option maxRecDepth 200000 in +theorem step_10 : Step u_10 u_11 := checkStep_sound n_10 tags_10 u_10 da_10 u_11 (by decide) +set_option maxRecDepth 200000 in +theorem step_11 : Step u_11 u_12 := checkStep_sound n_11 tags_11 u_11 da_11 u_12 (by decide) +set_option maxRecDepth 200000 in +theorem step_12 : Step u_12 u_13 := checkStep_sound n_12 tags_12 u_12 da_12 u_13 (by decide) +set_option maxRecDepth 200000 in +theorem step_13 : Step u_13 u_14 := checkStep_sound n_13 tags_13 u_13 da_13 u_14 (by decide) +set_option maxRecDepth 200000 in +theorem step_14 : Step u_14 u_15 := checkStep_sound n_14 tags_14 u_14 da_14 u_15 (by decide) +set_option maxRecDepth 200000 in +theorem step_15 : Step u_15 u_16 := checkStep_sound n_15 tags_15 u_15 da_15 u_16 (by decide) +set_option maxRecDepth 200000 in +theorem step_16 : Step u_16 u_17 := checkStep_sound n_16 tags_16 u_16 da_16 u_17 (by decide) + +theorem rounds_0_17 : Rounds u_0 u_17 := + Rounds.next step_0 (Rounds.next step_1 (Rounds.next step_2 (Rounds.next step_3 (Rounds.next step_4 (Rounds.next step_5 (Rounds.next step_6 (Rounds.next step_7 (Rounds.next step_8 (Rounds.next step_9 (Rounds.next step_10 (Rounds.next step_11 (Rounds.next step_12 (Rounds.next step_13 (Rounds.next step_14 (Rounds.next step_15 (Rounds.next step_16 (Rounds.refl u_17))))))))))))))))) + +abbrev Good (u : List Word) : Prop := + ∃ p_w ds_core A_core m, + u = head_w ++ p_w ++ s_base ++ [K,K,Q,K,K,Q,Q,K,K,K,K,K,Q] ++ ds_core ++ top_base ∧ + (∃ p_tail, p_w = V :: p_tail) ∧ + m = 2 + ds_core.length ∧ + 21 <= m ∧ + DigitVal A_core (m - 2) ds_core ∧ + A_core * 256 <= 17 * 2 ^ (m - 2) ∧ + wordScale p_w * ((2 ^ m : Nat) : Rat) = 512 ∧ + wordPot p_w <= 13 / 4 + +set_option maxRecDepth 200000 in +theorem good_u17 : Good u_17 := by + refine ⟨p_init, ds_core_init, A_core_init, 168, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · decide + · exact ⟨p_init.tail, rfl⟩ + · decide + · decide + · exact checkDg_sound A_core_init ds_core_init (by decide) + · decide + · have h := checkScalePow_sound p_init 168 9 (by decide) + norm_num at h + exact h + · have h := checkWordPotLe_sound p_init 13 4 (by decide) + norm_num at h + linarith + +set_option maxRecDepth 200000 in +theorem Scan_head : Scan 0 6 head_w a_head b_head v_head 0 := by + have h := checkAffineScan_sound tags_head 0 0 0 6 head_w 0 a_head 0 b_head v_head 0 0 0 (by decide) + simpa using h + +theorem v_head_eq : V :: v_head = head_w ++ [V] := rfl + +theorem Scan_s (ap bp : Nat) (hbp : 3 <= bp) : + Scan ap bp s_full (4 * ap + 4) (1048576 * (bp - 3) + 984685) v_s 6 := by + have h := checkAffineScan_sound tags_s 1 0 1 3 s_full 4 4 1048576 984685 v_s 6 ap (bp - 3) (by decide) + have h_bp : 1 * (bp - 3) + 3 = bp := by omega + have h_ap : 1 * ap + 0 = ap := by omega + rwa [h_ap, h_bp] at h + +theorem Scan_top (b_top : Nat) (hb : 2 <= b_top) : + Scan (2 ^ 48) b_top top_full 0 (8192 * (b_top - 2) + 4196) s_base 21 := by + have h := checkAffineScan_sound tags_top 0 (2 ^ 48) 1 2 top_full 0 0 8192 4196 s_base 21 0 (b_top - 2) (by decide) + have h_in : 1 * (b_top - 2) + 2 = b_top := by omega + dsimp at h + rwa [h_in] at h + +theorem Parse_s_split {ap a_end g_all : Nat} {rest : List Word} + (h : Parse ap (s_full ++ K :: rest) a_end g_all) : + ∃ g_mid, Parse (4 * (ap + 1)) (K :: rest) a_end g_mid := by + change Parse ap ([V,V,V,V,V,Q,V,V,V,V,K,K,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,V,Q,K,V,K,K,Q,K,K,Q,Q,K,K,K,K,K] ++ rest) a_end g_all at h + simp only [List.cons_append, List.nil_append] at h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + cases h with + | @D _ q1_1 _ _ _ _ _ hq1_1 h => + have hq1_1_eq : q1_1 = 16 + ap * 16 := by dsimp [dVal] at hq1_1; omega + subst hq1_1_eq + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + rcases Parse_VK_inv h with h | h + · -- VK at i=9 + cases h with + | D _ hq1_2 _ => dsimp [dVal] at hq1_2; omega + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + · -- T at i=9 + cases h with + | D _ hq1_3 _ => dsimp [dVal] at hq1_3; omega + | @P _ q2_3 _ _ _ _ _ _ _ hq2_3 h => + have hq2_3_eq : q2_3 = 67 + ap * 64 := by dsimp [dVal] at hq2_3; omega + subst hq2_3_eq + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + cases h with + | @D _ q1_4 _ _ _ _ _ hq1_4 h => + have hq1_4_eq : q1_4 = 544 + ap * 512 := by dsimp [dVal] at hq1_4; omega + subst hq1_4_eq + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + cases h with + | @D _ q1_5 _ _ _ _ _ hq1_5 h => + have hq1_5_eq : q1_5 = 1090 + ap * 1024 := by dsimp [dVal] at hq1_5; omega + subst hq1_5_eq + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + cases h with + | @D _ q1_6 _ _ _ _ _ hq1_6 h => + have hq1_6_eq : q1_6 = 8728 + ap * 8192 := by dsimp [dVal] at hq1_6; omega + subst hq1_6_eq + have h := Parse_VQ_inv h + cases h with + | @D _ q1_7 _ _ _ _ _ hq1_7 h => + have hq1_7_eq : q1_7 = 8729 + ap * 8192 := by dsimp [dVal] at hq1_7; omega + subst hq1_7_eq + cases h with + | D _ hq1_8 _ => dsimp [dVal] at hq1_8; omega + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + | @P _ q2_7 _ _ _ _ _ _ _ hq2_7 h => + have hq2_7_eq : q2_7 = 4364 + ap * 4096 := by dsimp [dVal] at hq2_7; omega + subst hq2_7_eq + rcases Parse_VK_inv h with h | h + · -- VK at i=28 + cases h with + | @D _ q1_9 _ _ _ _ _ hq1_9 h => + have hq1_9_eq : q1_9 = 2182 + ap * 2048 := by dsimp [dVal] at hq1_9; omega + subst hq1_9_eq + cases h with + | D _ hq1_10 _ => dsimp [dVal] at hq1_10; omega + | @P _ q2_10 _ _ _ _ _ _ _ hq2_10 h => + have hq2_10_eq : q2_10 = 545 + ap * 512 := by dsimp [dVal] at hq2_10; omega + subst hq2_10_eq + cases h with + | D _ hq1_11 _ => dsimp [dVal] at hq1_11; omega + | @P _ q2_11 _ _ _ _ _ _ _ hq2_11 h => + have hq2_11_eq : q2_11 = 136 + ap * 128 := by dsimp [dVal] at hq2_11; omega + subst hq2_11_eq + cases h with + | D _ hq1_12 _ => dsimp [dVal] at hq1_12; omega + | P _ _ hq2_12 _ => dsimp [dVal] at hq2_12; omega + | @P _ q2_9 _ _ _ _ _ _ _ hq2_9 h => + have hq2_9_eq : q2_9 = 1091 + ap * 1024 := by dsimp [dVal] at hq2_9; omega + subst hq2_9_eq + cases h with + | D _ hq1_13 _ => dsimp [dVal] at hq1_13; omega + | @P _ q2_13 _ _ _ _ _ _ _ hq2_13 h => + have hq2_13_eq : q2_13 = 272 + ap * 256 := by dsimp [dVal] at hq2_13; omega + subst hq2_13_eq + cases h with + | D _ hq1_14 _ => dsimp [dVal] at hq1_14; omega + | @P _ q2_14 _ _ _ _ _ _ _ hq2_14 h => + have hq2_14_eq : q2_14 = 68 + ap * 64 := by dsimp [dVal] at hq2_14; omega + subst hq2_14_eq + cases h with + | @D _ q1_15 _ _ _ _ _ hq1_15 h => + have hq1_15_eq : q1_15 = 34 + ap * 32 := by dsimp [dVal] at hq1_15; omega + subst hq1_15_eq + cases h with + | @D _ q1_16 _ _ _ _ _ hq1_16 h => + have hq1_16_eq : q1_16 = 17 + ap * 16 := by dsimp [dVal] at hq1_16; omega + subst hq1_16_eq + cases h with + | D _ hq1_17 _ => dsimp [dVal] at hq1_17; omega + | P _ _ hq2_17 _ => dsimp [dVal] at hq2_17; omega + | @P _ q2_16 _ _ _ _ _ _ _ hq2_16 h => + have hq2_16_eq : q2_16 = 8 + ap * 8 := by dsimp [dVal] at hq2_16; omega + subst hq2_16_eq + cases h with + | @D _ q1_18 _ _ _ _ _ hq1_18 h => + have hq1_18_eq : q1_18 = 4 + ap * 4 := by dsimp [dVal] at hq1_18; omega + subst hq1_18_eq + have h_end : 4 + ap * 4 = 4 * (ap + 1) := by omega + rw [h_end] at h + exact ⟨_, h⟩ + | P _ _ hq2_18 _ => dsimp [dVal] at hq2_18; omega + | P _ _ hq2_15 _ => dsimp [dVal] at hq2_15; omega + · -- T at i=28 + cases h with + | D _ hq1_19 _ => dsimp [dVal] at hq1_19; omega + | P _ _ hq2_19 _ => dsimp [dVal] at hq2_19; omega + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + +-- Section 6: Main Invariant Closure and Goal Proof +theorem zDg_top : DigitVal A_top 49 top_base := + checkDg_sound A_top top_base (by decide) + +theorem zDg_bot : DigitVal 4196 13 [K,K,Q,K,K,Q,Q,K,K,K,K,K,Q] := + checkDg_sound 4196 [K,K,Q,K,K,Q,Q,K,K,K,K,K,Q] (by decide) + +theorem digitVal_mid {A_core m : Nat} {ds_core : List Word} + (hm : 21 <= m) (hD : DigitVal A_core (m - 2) ds_core) + (hA_core : A_core * 256 <= 17 * 2 ^ (m - 2)) : + ∃ A_mid, + DigitVal A_mid m ([K,Q] ++ ds_core) ∧ + A_mid <= 2 + 17 * 2 ^ (m - 8) := by + have h_bs : DigitVal 2 2 [K,Q] := checkDg_sound 2 [K,Q] (by decide) + have h1 := digitVal_append h_bs hD + have hlen1 : 2 + (m - 2) = m := by omega + rw [hlen1] at h1 + have h_pow1 : 2 ^ (m - 2) = 64 * 2 ^ (m - 8) := by + have heq : m - 2 = 6 + (m - 8) := by omega + rw [heq, Nat.pow_add] + exact ⟨2 + A_core * 4, h1, by omega⟩ + +theorem force_a_top {p_w ds_mid : List Word} {ap gp m A_mid a_top g_mid : Nat} + (hm : 21 <= m) + (hP_p : Parse a_head p_w ap gp) + (hz13 : wordScale p_w * ((2 ^ m : Nat) : Rat) = 512) + (hzW : wordPot p_w <= 13 / 4) + (hD_mid : DigitVal A_mid m ds_mid) + (hA_hi : A_mid <= 2 + 17 * 2 ^ (m - 8)) + (hP_mid : Parse (4 * (ap + 1)) ds_mid a_top g_mid) : + a_top = 2 ^ 48 := by + rcases Parse_la hP_p with ⟨hla_lo, hla_hi⟩ + have hz12 := wordValQ_nonneg p_w + have hz10_le := two_wordVal_add_wordValQ_le p_w + have h_diff_hi : ((ap : Rat) + 1) * wordScale p_w - ((a_head : Rat) + 1) < 7 := by linarith + have h_powm_pos : (0 : Rat) < ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + have h_mul_lo : ((a_head : Rat) + 1) * ((2 ^ m : Nat) : Rat) <= ((ap : Rat) + 1) * (wordScale p_w * ((2 ^ m : Nat) : Rat)) := by + nlinarith + have h_mul_hi : ((ap : Rat) + 1) * (wordScale p_w * ((2 ^ m : Nat) : Rat)) < (((a_head : Rat) + 1) + 7) * ((2 ^ m : Nat) : Rat) := by + nlinarith + rw [hz13] at h_mul_lo h_mul_hi + have ha_val : a_head + 1 = 2 ^ 55 := by decide + have ha_r : (a_head : Rat) + 1 = ((2 ^ 55 : Nat) : Rat) := by exact_mod_cast ha_val + rw [ha_r] at h_mul_lo h_mul_hi + have h_nat_lo : 2 ^ 55 * 2 ^ m <= (ap + 1) * 512 := by exact_mod_cast h_mul_lo + have h_nat_hi : (ap + 1) * 512 < (2 ^ 55 + 7) * 2 ^ m := by exact_mod_cast h_mul_hi + have h_ep : (ap + 1) * 512 = (4 * (ap + 1)) * 128 := by ring + rw [h_ep] at h_nat_lo h_nat_hi + have h_split1 : 2 ^ 55 * 2 ^ m = (2 ^ 48 * 2 ^ m) * 128 := by + have : (2 ^ 55 : Nat) = 2 ^ 48 * 128 := by decide + rw [this]; ring + have h_split2 : (2 ^ 55 + 7) * 2 ^ m = (2 ^ 48 * 2 ^ m + 7 * 2 ^ (m - 7)) * 128 := by + have h_eh : (2 ^ 55 : Nat) = 2 ^ 48 * 128 := by decide + have hm_de : 2 ^ m = 2 ^ (m - 7) * 128 := by + have h_de : (128 : Nat) = 2 ^ 7 := rfl + rw [h_de, <- Nat.pow_add, Nat.sub_add_cancel (by omega : 7 <= m)] + calc (2 ^ 55 + 7) * 2 ^ m + _ = 2 ^ 55 * 2 ^ m + 7 * 2 ^ m := by ring + _ = (2 ^ 48 * 128) * 2 ^ m + 7 * (2 ^ (m - 7) * 128) := by rw [h_eh, hm_de] + _ = (2 ^ 48 * 2 ^ m + 7 * 2 ^ (m - 7)) * 128 := by ring + rw [h_split1] at h_nat_lo + rw [h_split2] at h_nat_hi + have h_pos_de : 0 < 128 := by decide + have hap_lo : 2 ^ 48 * 2 ^ m <= 4 * (ap + 1) := Nat.le_of_mul_le_mul_right h_nat_lo h_pos_de + have hap_hi : 4 * (ap + 1) < 2 ^ 48 * 2 ^ m + 7 * 2 ^ (m - 7) := Nat.lt_of_mul_lt_mul_right h_nat_hi + have h_pow_mde : 2 ^ (m - 7) = 2 * 2 ^ (m - 8) := by + have heq : m - 7 = 1 + (m - 8) := by omega + rw [heq, Nat.pow_add] + have h_pow_m : 2 ^ m = 256 * 2 ^ (m - 8) := by + have h_dg : (256 : Nat) = 2 ^ 8 := rfl + rw [h_dg, <- Nat.pow_add, Nat.add_sub_of_le (by omega : 8 <= m)] + have h_pow_mdg_ge : 8192 <= 2 ^ (m - 8) := by + have h_le_m : 13 <= m - 8 := by omega + have hle := Nat.pow_le_pow_right (by decide : 1 <= 2) h_le_m + simpa using hle + rcases parse_digitVal_a hP_mid hD_mid with ⟨h_atop_lo, h_atop_hi⟩ + have h_sum_lo : 2 ^ 48 * 2 ^ m <= 4 * (ap + 1) + A_mid := by omega + have h_sum_hi : 4 * (ap + 1) + A_mid < (2 ^ 48 + 1) * 2 ^ m := by + have : (2 ^ 48 + 1) * 2 ^ m = 2 ^ 48 * 2 ^ m + 256 * 2 ^ (m - 8) := by + rw [Nat.add_mul, Nat.one_mul, h_pow_m] + omega + have h_pos_m : 0 < 2 ^ m := pow_two_pos m + have h_lt1 : a_top < 2 ^ 48 + 1 := Nat.lt_of_mul_lt_mul_right (lt_of_le_of_lt h_atop_lo h_sum_hi) + have h_lt2 : 2 ^ 48 < a_top + 1 := Nat.lt_of_mul_lt_mul_right (lt_of_le_of_lt h_sum_lo h_atop_hi) + omega + +theorem bound_b_mid0 {p_w v_p ds_mid : List Word} + {ap bp gp m A_mid b_mid0 : Nat} + (hm : 21 <= m) + (hS_p : Scan a_head b_head p_w ap bp v_p gp) + (hbp : 3 <= bp) + (hz13 : wordScale p_w * ((2 ^ m : Nat) : Rat) = 512) + (hzW : wordPot p_w <= 13 / 4) + (hb_mid0 : b_mid0 = 1048576 * (bp - 3) + 984685) + (hD_mid : DigitVal A_mid m ds_mid) : + 2 + 4 * wordVal ds_mid < (b_mid0 : Rat) := by + have h_delta_p := (Scan_delta hS_p).2 + have h_4wv_p := two_wordVal_add_wordValQ_le_four_wordPotV v_p + have h_cw_p := scan_wordPot_contract7 hS_p + have hc_bh := (cPar77_bounds b_head).2 + have h_wv_p_lt : wordPotV v_p < 4 := by linarith + have h_z13_p := scan_wordScale_eq hS_p + have h_pow_gp_ge1 : (1 : Rat) <= ((2 ^ (3 * gp) : Nat) : Rat) := by exact_mod_cast (pow_two_pos (3 * gp)) + have h_z13_vp_pos := wordScale_pos v_p + have h_z13_vp_le : wordScale v_p <= wordScale p_w := by nlinarith + have h_bh_big : ((2 ^ 56 : Nat) : Rat) + 18 < (b_head : Rat) := by norm_num [b_head] + have h_bp2_pos : (0 : Rat) <= (bp : Rat) - 2 := by + have : (2 : Rat) <= (bp : Rat) := by exact_mod_cast (by omega : 2 <= bp) + linarith + have h_prod_p : ((2 ^ 56 : Nat) : Rat) < ((bp : Rat) - 2) * wordScale p_w := by nlinarith + have h_powm_pos : (0 : Rat) < ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + have h_mul_m : ((2 ^ 56 : Nat) : Rat) * ((2 ^ m : Nat) : Rat) < ((bp : Rat) - 2) * (wordScale p_w * ((2 ^ m : Nat) : Rat)) := by + nlinarith + rw [hz13] at h_mul_m + have h_pow_ebh : ((2 ^ 56 : Nat) : Rat) = ((2 ^ 47 : Nat) : Rat) * 512 := by norm_num + rw [h_pow_ebh] at h_mul_m + have h_bp2_gt : ((2 ^ 47 : Nat) : Rat) * ((2 ^ m : Nat) : Rat) < (bp : Rat) - 2 := by linarith + have h_bmid0_r : (b_mid0 : Rat) = 1048576 * ((bp : Rat) - 3) + 984685 := by + rw [hb_mid0, Nat.cast_add, Nat.cast_mul, Nat.cast_sub hbp]; push_cast; ring + have h_z10_mid := (digitVal_scale_and_val hD_mid).2 + have h_pow_val : ((2 ^ 47 : Nat) : Rat) = 140737488355328 := by norm_num + have h_powm_ge1 : (1 : Rat) <= ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + rw [h_z10_mid, h_bmid0_r] + rw [h_pow_val] at h_bp2_gt + linarith + +theorem bound_zW_p' {p_w v_p ds_mid v_mid : List Word} + {ap bp gp m A_mid b_mid0 b_top g_mid : Nat} + (hm : 21 <= m) + (hS_p : Scan a_head b_head p_w ap bp v_p gp) + (hz13 : wordScale p_w * ((2 ^ m : Nat) : Rat) = 512) + (hzW : wordPot p_w <= 13 / 4) + (hD_mid : DigitVal A_mid m ds_mid) + (hS_mid : Scan (4 * (ap + 1)) b_mid0 ds_mid (2 ^ 48) b_top v_mid g_mid) : + wordPotV (v_p ++ v_s ++ v_mid) <= 13 / 4 := by + have h_cw_p := scan_wordPot_contract7 hS_p + have hc_bh : cPar7 b_head = 2 / 7 := by + unfold cPar7 + have hmod : b_head % 2 = 0 := by decide + rw [hmod]; rfl + rw [hc_bh] at h_cw_p + have hA : wordPotV v_p <= 43 / 14 := by linarith + have h_z13_p := scan_wordScale_eq hS_p + have h_z13_vs : wordScale v_s = 1 / 1048576 := by + have h := checkScalePow_sound v_s 20 0 (by decide) + norm_num at h + linarith + have h_wv_vs : wordPotV v_s <= 9 / 8 := by + have h := checkWordPotVLe_sound v_s 9 8 (by decide) + norm_num at h + linarith + have h_powm_ge : (2 ^ 21 : Nat) <= 2 ^ m := Nat.pow_le_pow_right (by decide) hm + have h_powm_r : ((2 ^ 21 : Nat) : Rat) <= ((2 ^ m : Nat) : Rat) := by exact_mod_cast h_powm_ge + have h_z13_p_le : wordScale p_w <= 1 / 4096 := by + have h_pos_p := wordScale_pos p_w + have h_mul := mul_le_mul_of_nonneg_left h_powm_r (le_of_lt h_pos_p) + rw [hz13] at h_mul + norm_num at h_mul + linarith + have h_pow_gp_ge1 : (1 : Rat) <= ((2 ^ (3 * gp) : Nat) : Rat) := by exact_mod_cast (pow_two_pos (3 * gp)) + have h_z13_vp_pos := wordScale_pos v_p + have h_z13_vp_le : wordScale v_p <= 1 / 4096 := by nlinarith + have hB : wordScale v_p * wordPotV v_s <= 9 / 32768 := by + have h_wv_nn := wordPotV_nonneg v_s + nlinarith + have h_dc_eq := digitVal_scan_dCount hS_mid hD_mid + have h_wv_mid_dc := dCount_bound_WV v_mid + have h_vp_m : wordScale v_p * ((2 ^ m : Nat) : Rat) <= 512 := by + have h_eq : wordScale v_p * ((2 ^ m : Nat) : Rat) * ((2 ^ (3 * gp) : Nat) : Rat) = 512 := by + calc wordScale v_p * ((2 ^ m : Nat) : Rat) * ((2 ^ (3 * gp) : Nat) : Rat) + _ = (wordScale v_p * ((2 ^ (3 * gp) : Nat) : Rat)) * ((2 ^ m : Nat) : Rat) := by ring + _ = wordScale p_w * ((2 ^ m : Nat) : Rat) := by rw [h_z13_p] + _ = 512 := hz13 + have h_pos_m : (0 : Rat) < ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + have h_nn : 0 <= wordScale v_p * ((2 ^ m : Nat) : Rat) := mul_nonneg (le_of_lt h_z13_vp_pos) (le_of_lt h_pos_m) + nlinarith + have h_prod_ps : wordScale v_p * wordScale v_s * ((2 ^ m : Nat) : Rat) <= 1 / 2048 := by + rw [h_z13_vs] + linarith + have hC : wordScale (v_p ++ v_s) * wordPotV v_mid <= 7 / 16384 := by + rw [wordScale_append] + have h_wv_mid_le : wordPotV v_mid <= (7 / 8) * ((2 ^ m : Nat) : Rat) := by + have h_dc_le_m : 2 ^ (dCount v_mid) <= 2 ^ m := Nat.pow_le_pow_right (by decide) (by omega) + have h_dc_r : ((2 ^ (dCount v_mid) : Nat) : Rat) <= ((2 ^ m : Nat) : Rat) := by exact_mod_cast h_dc_le_m + have hm_256 : (256 : Rat) <= ((2 ^ m : Nat) : Rat) := by + have : (2097152 : Rat) <= ((2 ^ 21 : Nat) : Rat) := by norm_num + linarith + linarith + have h_wv_mid_nn := wordPotV_nonneg v_mid + have h_z13_ps_pos : 0 < wordScale v_p * wordScale v_s := mul_pos h_z13_vp_pos (wordScale_pos v_s) + nlinarith + have h_app1 := wordPotV_append_le v_p v_s + have h_app2 := wordPotV_append_le (v_p ++ v_s) v_mid + linarith + +theorem bound_b_end_digitVal {w_all v_w : List Word} {b_top g_w k : Nat} + (hk : 11 <= k) + (hb_top : 2 <= b_top) + (hS_w : Scan a_head b_head w_all (2 ^ 48) b_top v_w g_w) + (hz13_vw : wordScale v_w * ((2 ^ k : Nat) : Rat) = 1) + (hWV_vw : wordPotV v_w <= 13 / 4) : + ∃ A_core' ds_core', + DigitVal A_core' (k + 8) ds_core' ∧ + ds_core'.length = k + 8 ∧ + A_core' * 256 <= 17 * 2 ^ (k + 8) ∧ + DigitVal (8192 * (b_top - 2) + 4196) (k + 70) + ([K,K,Q,K,K,Q,Q,K,K,K,K,K,Q] ++ ds_core' ++ top_base) := by + rcases Scan_delta hS_w with ⟨hd_lo, hd_hi⟩ + have h_4wv := two_wordVal_add_wordValQ_le_four_wordPotV v_w + have hd_hi' : ((b_head : Rat) - 2) - ((b_top : Rat) - 2) * wordScale v_w <= 13 := by linarith + have h_powk_pos : (0 : Rat) < ((2 ^ k : Nat) : Rat) := by exact_mod_cast (pow_two_pos k) + have h_mul_lo : (((b_head : Rat) - 2) - 13) * ((2 ^ k : Nat) : Rat) <= ((b_top : Rat) - 2) * (wordScale v_w * ((2 ^ k : Nat) : Rat)) := by + nlinarith + have h_mul_hi : ((b_top : Rat) - 2) * (wordScale v_w * ((2 ^ k : Nat) : Rat)) <= ((b_head : Rat) - 1) * ((2 ^ k : Nat) : Rat) := by + nlinarith + rw [hz13_vw, mul_one] at h_mul_lo h_mul_hi + have hbh_r : (b_head : Rat) - 2 = (A_top : Rat) * 256 + 16 := by norm_num [b_head, A_top] + have hbh_1_r : (b_head : Rat) - 1 = (A_top : Rat) * 256 + 17 := by norm_num [b_head, A_top] + rw [hbh_r] at h_mul_lo + rw [hbh_1_r] at h_mul_hi + let b_end := 8192 * (b_top - 2) + 4196 + have hb_end_r : (b_end : Rat) = 8192 * ((b_top : Rat) - 2) + 4196 := by + dsimp [b_end] + rw [Nat.cast_add, Nat.cast_mul, Nat.cast_sub hb_top] + push_cast; ring + have h_pow_ksh : ((2 ^ (k + 21) : Nat) : Rat) = 2097152 * ((2 ^ k : Nat) : Rat) := by + have h_sh : ((2 ^ 21 : Nat) : Rat) = 2097152 := by norm_num + rw [Nat.pow_add, Nat.cast_mul, h_sh]; ring + have h_powk_ge1 : (1 : Rat) <= ((2 ^ k : Nat) : Rat) := by exact_mod_cast (pow_two_pos k) + have h_bend_lo_r : (A_top : Rat) * ((2 ^ (k + 21) : Nat) : Rat) < (b_end : Rat) := by + rw [hb_end_r, h_pow_ksh]; linarith + have h_bend_mid_r : (b_end : Rat) <= (A_top : Rat) * ((2 ^ (k + 21) : Nat) : Rat) + 8192 * 17 * ((2 ^ k : Nat) : Rat) + 4196 := by + rw [hb_end_r, h_pow_ksh]; linarith + have h_bend_hi_r : (b_end : Rat) < ((A_top : Rat) + 1) * ((2 ^ (k + 21) : Nat) : Rat) := by + rw [hb_end_r, h_pow_ksh]; linarith + have h_bend_lo : A_top * 2 ^ (k + 21) < b_end := by exact_mod_cast h_bend_lo_r + have h_bend_mid : b_end <= A_top * 2 ^ (k + 21) + 8192 * 17 * 2 ^ k + 4196 := by exact_mod_cast h_bend_mid_r + have h_bend_hi : b_end < (A_top + 1) * 2 ^ (k + 21) := by exact_mod_cast h_bend_hi_r + let A_core' := (b_end / 8192) % (2 ^ (k + 8)) + have h_Acore'_lt : A_core' < 2 ^ (k + 8) := Nat.mod_lt _ (pow_two_pos (k + 8)) + rcases exists_digitVal_of_lt_pow (k + 8) A_core' h_Acore'_lt with ⟨ds_core', hD_core'⟩ + have h_len_core' := length_of_digitVal hD_core' + have h_bot_mid := digitVal_append zDg_bot hD_core' + have h_all := digitVal_append h_bot_mid zDg_top + have h_len_all : (13 + (k + 8)) + 49 = k + 70 := by omega + have h_pow_ksh_eq : 2 ^ (k + 21) = 8192 * 2 ^ (k + 8) := by + have : k + 21 = 13 + (k + 8) := by omega + rw [this, Nat.pow_add] + have h_div_top : b_end / (2 ^ (k + 21)) = A_top := by + have h_pos_ksh : 0 < 2 ^ (k + 21) := pow_two_pos (k + 21) + have h1 := (Nat.le_div_iff_mul_le h_pos_ksh).mpr (le_of_lt h_bend_lo) + have h2 := (Nat.div_lt_iff_lt_mul h_pos_ksh).mpr h_bend_hi + omega + have h_val_all : 4196 + A_core' * 2 ^ 13 + A_top * 2 ^ (13 + (k + 8)) = b_end := by + have h1 : 2 ^ 13 = 8192 := by decide + have h2 : 2 ^ (13 + (k + 8)) = 8192 * 2 ^ (k + 8) := by rw [Nat.pow_add] + rw [h1, h2] + have h_assoc : A_top * (8192 * 2 ^ (k + 8)) = 8192 * (A_top * 2 ^ (k + 8)) := by ring + rw [h_assoc] + dsimp [A_core'] + have h_div_mb : (b_end / 8192) / (2 ^ (k + 8)) = A_top := by + rw [Nat.div_div_eq_div_mul, <- h_pow_ksh_eq, h_div_top] + have h_mod_div := Nat.div_add_mod (b_end / 8192) (2 ^ (k + 8)) + rw [h_div_mb, Nat.mul_comm (2 ^ (k + 8)) A_top] at h_mod_div + have h_mod_mb := Nat.div_add_mod b_end 8192 + omega + have h_Acore'_le_k : A_core' <= 17 * 2 ^ k := by + have h_eq_db : 2 ^ 13 = 8192 := by decide + have h_eq_ksh : 2 ^ (13 + (k + 8)) = 2 ^ (k + 21) := by + have : 13 + (k + 8) = k + 21 := by omega + rw [this] + rw [h_eq_db, h_eq_ksh] at h_val_all + omega + have h_Acore'_dg : A_core' * 256 <= 17 * 2 ^ (k + 8) := by + have h_pow_kdg : 2 ^ (k + 8) = 256 * 2 ^ k := by + have : k + 8 = 8 + k := by omega + rw [this, Nat.pow_add] + omega + rw [h_len_all, h_val_all] at h_all + exact ⟨A_core', ds_core', hD_core', h_len_core', h_Acore'_dg, by simpa [List.append_assoc] using h_all⟩ + +theorem Good_step {u : List Word} (hG : Good u) : + ∃ u', Step u u' ∧ Good u' := by + rcases hG with ⟨p_w, ds_core, A_core, m, rfl, ⟨p_tail, hp_start⟩, hm_def, hm, hD_core, hA_core, hz13, hzW⟩ + have hP_p_ex : ∃ ap gp, Parse a_head p_w ap gp := by + rw [hp_start]; exact Parse_V_start a_head p_tail + rcases hP_p_ex with ⟨ap, gp, hP_p⟩ + have hb_head_ok : 2 + 4 * wordVal p_w < (b_head : Rat) := by + have hz12 := wordValQ_nonneg p_w + have hz10_le := two_wordVal_add_wordValQ_le p_w + have hbh_gt : (15 : Rat) < (b_head : Rat) := by norm_num [b_head] + linarith + rcases Scan_of_Parse hP_p b_head hb_head_ok with ⟨bp, v_p, hS_p, hbp⟩ + have hS_s := Scan_s ap bp hbp + let b_mid0 := 1048576 * (bp - 3) + 984685 + let ds_mid := [K,Q] ++ ds_core + rcases digitVal_mid hm hD_core hA_core with ⟨A_mid, hD_mid, hA_hi⟩ + have hP_s_all : ∃ a_top g_all, Parse ap (s_full ++ ds_mid) a_top g_all := by + change ∃ a_top g_all, Parse ap (V :: (s_full.tail ++ ds_mid)) a_top g_all + exact Parse_V_start ap _ + rcases hP_s_all with ⟨a_top, g_all, hP_all⟩ + have hP_mid_ex : ∃ g_mid, Parse (4 * (ap + 1)) ds_mid a_top g_mid := by + dsimp [ds_mid] at hP_all ⊢ + exact Parse_s_split hP_all + rcases hP_mid_ex with ⟨g_mid, hP_mid⟩ + have hatop_eq := force_a_top hm hP_p hz13 hzW hD_mid hA_hi hP_mid + subst hatop_eq + have hb_mid0_ok := bound_b_mid0 hm hS_p hbp hz13 hzW rfl hD_mid + rcases Scan_of_Parse hP_mid b_mid0 hb_mid0_ok with ⟨b_top, v_mid, hS_mid, hb_top_ge3⟩ + have hb_top : 2 <= b_top := by omega + have hS_top := Scan_top b_top hb_top + let w_all := p_w ++ s_full ++ ds_mid + let v_w := v_p ++ v_s ++ v_mid + let g_w := gp + 6 + g_mid + have h_ap_eq : 4 * ap + 4 = 4 * (ap + 1) := by omega + rw [h_ap_eq] at hS_s + have hS_w : Scan a_head b_head w_all (2 ^ 48) b_top v_w g_w := by + have h23 := Scan_append hS_p hS_s + have h234 := Scan_append h23 hS_mid + simpa [w_all, v_w, g_w, List.append_assoc, Nat.add_assoc] using h234 + have h_u_rep1 : + (head_w ++ p_w ++ s_base ++ [K,K,Q,K,K,Q,Q,K,K,K,K,K,Q] ++ ds_core ++ top_base) ++ List.replicate 1 K = + head_w ++ w_all ++ top_full := by + dsimp [w_all, s_full, ds_mid, top_full, List.replicate] + simp only [List.append_assoc, List.cons_append, List.nil_append] + have hS_full : + Scan 0 6 ((head_w ++ p_w ++ s_base ++ [K,K,Q,K,K,Q,Q,K,K,K,K,K,Q] ++ ds_core ++ top_base) ++ List.replicate 1 K) + 0 (8192 * (b_top - 2) + 4196) (v_head ++ v_w ++ s_base) (0 + g_w + 21) := by + rw [h_u_rep1] + exact Scan_append (Scan_append Scan_head hS_w) hS_top + let k := 11 + 3 * gp + 3 * g_mid + have hk : 11 <= k := by omega + have hWV_vw : wordPotV v_w <= 13 / 4 := + bound_zW_p' hm hS_p hz13 hzW hD_mid hS_mid + have hz13_vw : wordScale v_w * ((2 ^ k : Nat) : Rat) = 1 := by + have h_z13_w := scan_wordScale_eq hS_w + have h_w_eq : wordScale w_all = 128 := by + dsimp only [w_all] + rw [wordScale_append, wordScale_append] + have h_s : wordScale s_full = 1 / 4 := by + have h := checkScalePow_sound s_full 2 0 (by decide) + norm_num at h + linarith + have h_mid := (digitVal_scale_and_val hD_mid).1 + rw [h_s, h_mid] + linarith + rw [h_w_eq] at h_z13_w + have h_3gw : 3 * g_w = k + 7 := by dsimp [g_w, k]; omega + have h_ew : ((2 ^ 7 : Nat) : Rat) = 128 := by norm_num + rw [h_3gw, Nat.pow_add, Nat.cast_mul, h_ew] at h_z13_w + linarith + rcases bound_b_end_digitVal hk hb_top hS_w hz13_vw hWV_vw + with ⟨A_core', ds_core', hD_core', hlen_core', hA_core', hD_bend⟩ + let da := [K,K,Q,K,K,Q,Q,K,K,K,K,K,Q] ++ ds_core' ++ top_base + let u' := V :: (v_head ++ v_w ++ s_base ++ da) + refine ⟨u', ⟨1, 8192 * (b_top - 2) + 4196, v_head ++ v_w ++ s_base, da, k + 70, 0 + g_w + 21, hS_full, hD_bend, rfl⟩, ?_⟩ + let p_w' := V :: v_w + let m' := k + 10 + refine ⟨p_w', ds_core', A_core', m', ?_, ⟨v_w, rfl⟩, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · dsimp only [u', p_w', da, v_head, head_w] + simp only [List.cons_append, List.nil_append, List.append_assoc] + · dsimp [m']; omega + · dsimp [m']; omega + · have h_m'_sub : m' - 2 = k + 8 := by omega + rw [h_m'_sub]; exact hD_core' + · have h_m'_sub : m' - 2 = k + 8 := by omega + rw [h_m'_sub]; exact hA_core' + · dsimp only [p_w', m', wordScale] + have h_m'_split : k + 10 = k + 1 + 9 := by omega + have h1 : ((2 ^ 1 : Nat) : Rat) = 2 := by norm_num + have h_ep : ((2 ^ 9 : Nat) : Rat) = 512 := by norm_num + rw [h_m'_split, Nat.pow_add, Nat.pow_add, Nat.cast_mul, Nat.cast_mul, h1, h_ep] + linarith + · dsimp only [p_w'] + rw [wordPot_cons_V] + exact hWV_vw + +theorem reach_N (m : Nat) : + ∃ N, m <= N ∧ ∃ u, + multiStep tm (init []) N = some (zCf (evalWords u default)) ∧ + Good u := by + induction m with + | zero => + rcases init_to_u0 with ⟨k1, hk1⟩ + rcases Rounds_exec rounds_0_17 with ⟨k2, hk2⟩ + exact ⟨k1 + k2, Nat.zero_le _, u_17, multiStep_trans_vkq tm _ _ _ k1 k2 hk1 hk2, good_u17⟩ + | succ m ih => + rcases ih with ⟨N, hN, u, h_ms, hG⟩ + rcases Good_step hG with ⟨u', hStep, hG'⟩ + rcases Step_exec hStep with ⟨k, hk_pos, h_step_k⟩ + exact ⟨N + k, Nat.add_le_add hN hk_pos, u', multiStep_trans_vkq tm _ _ _ N k h_ms h_step_k, hG'⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n, hn⟩ + rcases reach_N (n + 1) with ⟨N, hN, _, h_N, _⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := multiStep_add_intermediate_vkq h_N + rw [multiStep_succ_vkq, hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_0LDHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_1LAHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_1LAHHH.lean new file mode 100644 index 00000000..38a0eb80 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_1LAHHH.lean @@ -0,0 +1,200 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.BB6.NonHalt.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0LBHHH + +open Mathlib Relation Nat Turing BusyBeaver SixState WordCalculus Word ChoiceE +open BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0LBHHH.Solution + +namespace BusyBeaver.M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_1LAHHH + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_1LAHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +end + +namespace Solution + +def callState_1la : Call -> Fin 6 + | .ch => A + | .cj => D + | .cp => D + | .ca => D + +def cfgR_1la (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (r <{{callState_1la c}} (callWord c +> l)) + +def cfgL_1la (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + ((r <+ [0]) {{B}}> l) + +syntax "run_1la" : tactic +macro_rules + | `(tactic| run_1la) => + `(tactic| ( + dsimp [cfgR_1la, cfgL_1la, callWord, callState_1la, t, d0, d1, one] + try simp only [List.cons_append, List.nil_append, append_cons, append_nil] + execute)) + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Justification: symbolic execution of all 15 elementary segment transitions for target_tm. +theorem segRules_1la : SegRules (CallStep target_tm cfgR_1la cfgL_1la) where + cp_t := seg_step1 (fun _ _ => by run_1la) + cj_t := seg_step2 (mid := [1, 0, 1, 0]) (fun _ _ => by run_1la) (fun _ _ => by run_1la) + ch_t := seg_step3 (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (fun _ _ => by run_1la) (fun _ _ => by run_1la) (fun _ _ => by run_1la) + cp_d1_d0 := seg_step1 (fun _ _ => by run_1la) + ch_t_one := seg_step3 (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (fun _ _ => by run_1la) (fun _ _ => by run_1la) (fun _ _ => by run_1la) + cj_d1_d0 := seg_step2 (mid := [1, 0, 1, 0]) (fun _ _ => by run_1la) (fun _ _ => by run_1la) + cp_d1_d1 := seg_step2 (mid := [1, 0, 1, 0]) (fun _ _ => by run_1la) (fun _ _ => by run_1la) + cj_d1_d1 := seg_step3 (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (fun _ _ => by run_1la) (fun _ _ => by run_1la) (fun _ _ => by run_1la) + cj_d0 := seg_step1 (fun _ _ => by run_1la) + ch_d0_one := seg_step1 (fun _ _ => by run_1la) + ch_d1_one := seg_step2 (mid := [1, 1]) (fun _ _ => by run_1la) (fun _ _ => by run_1la) + cj_d1 := seg_step2 (mid := [1, 1]) (fun _ _ => by run_1la) (fun _ _ => by run_1la) + ch_d0 := seg_step1 (fun _ _ => by run_1la) + ch_d1 := seg_step2 (mid := [1, 1]) (fun _ _ => by run_1la) (fun _ _ => by run_1la) + ca_nil := seg_step3_eq (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (fun _ _ => by + dsimp [cfgR_1la, callWord, callState_1la]; try simp only [append_cons, append_nil]) + (fun _ _ => by run_1la) (fun _ _ => by run_1la) + +theorem cl_to_cf_1la (r : HalfTape) : + (cfgL_1la lh r) [target_tm]⊢⁺ (cfgR_1la lh .ca r) := by + dsimp [cfgL_1la, cfgR_1la, lh, callWord, callState_1la] + try simp only [append_cons, append_nil] + execute + +def r_init_1la : HalfTape := + t +> (t +> (t +> (d0 +> (d1 +> (t +> default))))) + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 8000000 in +-- Justification: symbolic execution of 4-stage initial transition to canonical configuration. +theorem init_to_cf_1la : + (init []) [target_tm]⊢⁺ (cfgR_1la lh .ca r_init_1la) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + have h1 : (init []) [target_tm]⊢⁺ + (([0, 0, 1, 0, 1] +> default) {{B}}> ([0, 1, 1, 1, 0, 1, 0, 1, 0, 1] +> default)) := by + rw [h_init]; simp only [append_cons, append_nil]; execute + have h2 : (([0, 0, 1, 0, 1] +> default) {{B}}> ([0, 1, 1, 1, 0, 1, 0, 1, 0, 1] +> default)) + [target_tm]⊢⁺ + (([0, 1, 0, 0, 0, 0, 1] +> default) {{B}}> + ([1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1] +> default)) := by + simp only [append_cons, append_nil]; execute + have h3 : (([0, 1, 0, 0, 0, 0, 1] +> default) {{B}}> + ([1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1] +> default)) [target_tm]⊢⁺ + (([0, 0, 0, 1, 1] +> default) {{A}}> + ([0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] +> default)) := by + simp only [append_cons, append_nil]; execute + have h4 : (([0, 0, 0, 1, 1] +> default) {{A}}> + ([0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] +> default)) [target_tm]⊢⁺ + (cfgR_1la lh .ca r_init_1la) := by + unfold cfgR_1la r_init_1la lh callWord callState_1la t d0 d1 + simp only [append_cons, append_nil] + execute + exact stepPlus_trans h1 (stepPlus_trans h2 (stepPlus_trans h3 h4)) + +def initWords_1la : WordList := [V, V, V, K, Q, V] + +def initCodes_1la : List CodeE := [ + (.More CT 3 (.More CT 5 (.More CT 9 (.More CS00 4 (.More CS11 1 (.More CT 2 (.More CS10 0 (.Stop + 0)))))))), + (.More CT 3 (.More CT 5 (.More CT 9 (.More CT 17 (.More CS00 8 (.More CS11 3 (.More CT 6 (.More + CS11 2 (.More CP0 4 (.Stop 4)))))))))), + (.More CT 3 (.More CT 5 (.More CT 9 (.More CT 17 (.More CT 33 (.More CS00 16 (.More CS11 7 (.More + CT 14 (.More CS11 6 (.More CT 12 (.More CP0 23 (.More CP0 45 (.Stop 45))))))))))))), + (.More CT 3 (.More CT 5 (.More CT 9 (.More CT 17 (.More CT 33 (.More CT 65 (.More CS00 32 (.More + CS11 15 (.More CT 30 (.More CS11 14 (.More CT 28 (.More CT 55 (.More CT 109 (.More CS00 54 + (.More CP1 107 (.More CP0 214 (.More CP0 427 (.Stop 427)))))))))))))))))), + (.More CT 3 (.More CT 5 (.More CT 9 (.More CT 17 (.More CT 33 (.More CT 65 (.More CT 129 (.More + CS00 64 (.More CS11 31 (.More CT 62 (.More CS11 30 (.More CT 60 (.More CT 119 (.More CT 237 + (.More CS00 118 (.More CT 235 (.More CT 469 (.More CT 937 (.More CS00 468 (.More CS10 233 + (.More CS01 116 (.More CP0 232 (.More CP0 463 (.More CS01 231 (.More CP0 462 (.Stop + 462)))))))))))))))))))))))))), + (.More CT 3 (.More CT 5 (.More CT 9 (.More CT 17 (.More CT 33 (.More CT 65 (.More CT 129 (.More CT + 257 (.More CS00 128 (.More CS11 63 (.More CT 126 (.More CS11 62 (.More CT 124 (.More CT 247 + (.More CT 493 (.More CS00 246 (.More CT 491 (.More CT 981 (.More CT 1961 (.More CS00 980 + (.More CP0 1959 (.More CT 3917 (.More CT 7833 (.More CS00 3916 (.More CT 7831 (.More CS01 3915 + (.More CP1 7830 (.More CP0 15660 (.More CS10 7829 (.More CP1 15657 (.More CP0 31314 (.Stop + 31314)))))))))))))))))))))))))))))))), + (.More CT 3 (.More CT 5 (.More CT 9 (.More CT 17 (.More CT 33 (.More CT 65 (.More CT 129 (.More CT + 257 (.More CT 513 (.More CS00 256 (.More CS11 127 (.More CT 254 (.More CS11 126 (.More CT 252 + (.More CT 503 (.More CT 1005 (.More CS00 502 (.More CT 1003 (.More CT 2005 (.More CT 4009 + (.More CS00 2004 (.More CT 4007 (.More CT 8013 (.More CT 16025 (.More CS00 8012 (.More CT + 16023 (.More CS00 8011 (.More CT 16021 (.More CT 32041 (.More CS01 16020 (.More CT 32040 + (.More CT 64079 (.More CS01 32039 (.More CP0 64078 (.More CS10 32038 (.More CP0 64075 (.More + CP0 128149 (.More CS00 64074 (.More CP0 128147 (.More CS01 64073 (.More CP1 128146 (.More CP0 + 256292 (.Stop 256292))))))))))))))))))))))))))))))))))))))))))), + (.More CT 3 (.More CT 5 (.More CT 9 (.More CT 17 (.More CT 33 (.More CT 65 (.More CT 129 (.More CT + 257 (.More CT 513 (.More CT 1025 (.More CS00 512 (.More CS11 255 (.More CT 510 (.More CS11 254 + (.More CT 508 (.More CT 1015 (.More CT 2029 (.More CS00 1014 (.More CT 2027 (.More CT 4053 + (.More CT 8105 (.More CS00 4052 (.More CT 8103 (.More CT 16205 (.More CT 32409 (.More CS00 + 16204 (.More CT 32407 (.More CS00 16203 (.More CT 32405 (.More CT 64809 (.More CS00 32404 + (.More CT 64807 (.More CT 129613 (.More CS00 64806 (.More CT 129611 (.More CS01 64805 (.More + CT 129610 (.More CT 259219 (.More CS00 129609 (.More CT 259217 (.More CS00 129608 (.More CT + 259215 (.More CT 518429 (.More CP0 1036857 (.More CP0 2073713 (.More CS00 1036856 (.More CP0 + 2073711 (.More CS00 1036855 (.More CP0 2073709 (.More CS00 1036854 (.More CP0 2073707 (.More + CP1 4147413 (.More CP1 8294826 (.More CP0 16589652 (.Stop + 16589652))))))))))))))))))))))))))))))))))))))))))))))))))))))) +] + +def initU_1la : WordList := + [V, V, V, V, V, V, V, V, V, V, V, K, Q, V, Q, V, V, V, K, V, V, V, K, V, V, V, K, V, K, V, V, K, + V, V, K, V, K, V, V, K, V, K, V, V, V, V, K, V, K, V, K, V, V, V, V] + +def initDs_1la : WordList := + [Q, K, Q, K, Q, K, Q, K, Q, Q, K, K, K, Q, K, K, Q, K, Q, Q, Q, Q, Q, Q] + + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 4000000 in +-- Justification: kernel evaluation of 8-round CodeE trace certificate. +theorem init_rounds_1la : + Rounds r_init_1la (evalWords (initU_1la ++ initDs_1la) default) := by + have h1 : Rounds (evalWords initWords_1la default) + (evalWords (initU_1la ++ initDs_1la) default) := by + apply rounds_of_evalCodeList initCodes_1la + decide + simpa [initWords_1la, r_init_1la, evalWords] using h1 + +set_option maxRecDepth 4000000 in +set_option maxHeartbeats 4000000 in +-- Justification: rational arithmetic evaluation of wordMass and wordScale on 79-word list. +theorem init_bgood_1la : + BGood (initU_1la ++ initDs_1la) := by + apply bgood_of_checks initU_1la initDs_1la 10 + · decide + · norm_num [initU_1la, initDs_1la, wordScale] + · decide + · decide + · decide + · decide + · norm_num [initU_1la, initDs_1la, wordMass, wordMassK, wordScale] + +end Solution + +@[expose] public section + +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := + does_not_halt_of_segRules segRules_1la cl_to_cf_1la init_to_cf_1la init_rounds_1la init_bgood_1la + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_1LAHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LE_1LC0RF_1LA0RD_1LC1RC_1LB0LB_HHH1RD.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LE_1LC0RF_1LA0RD_1LC1RC_1LB0LB_HHH1RD.lean new file mode 100644 index 00000000..47b864c3 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LE_1LC0RF_1LA0RD_1LC1RC_1LB0LB_HHH1RD.lean @@ -0,0 +1,1852 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.Longitudinal + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1LE_1LC0RF_1LA0RD_1LC1RC_1LB0LB_HHH1RD + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +local macro "normalize" : tactic => `(tactic| ( + try simp only [ListBlank.append_cons, ListBlank.append_nil, + ListBlank.head_cons, ListBlank.tail_cons, + ListBlank.head_default, ListBlank.head_default_fin, ListBlank.tail_default, + ListBlank.cons_zero_default, ListBlank.cons_default_default, + list_pow_zero, list_pow_succ, + List.nil_append, List.cons_append, List.append_nil, + Nat.mul_zero, Nat.mul_add, Nat.mul_one])) +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LE_1LC0RF_1LA0RD_1LC1RC_1LB0LB_HHH1RD" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open BusyBeaver.Longitudinal + +local notation "Γ" => Fin 2 +local notation "Λ" => Fin 6 + +set_option linter.unusedSectionVars false +set_option maxHeartbeats 2000000 +set_option maxRecDepth 200000 + +abbrev O : Fin 2 := 0 +abbrev I : Fin 2 := 1 + +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 + +/-- `TM13.tm` in `SOBCv13.v` is the left-right mirror of `target_tm`. -/ +abbrev tm : Machine (Fin 2) (Fin 6) := flipTM target_tm + +-- ============================================================================ +-- 1. Bounded Execution Helpers & Tape Words +-- ============================================================================ + +def runSteps (M : Machine (Fin 2) (Fin 6)) : + ℕ → BoundedConfig.BCfg (Fin 2) (Fin 6) → Option (BoundedConfig.BCfg (Fin 2) (Fin 6)) + | 0, x => some x + | n + 1, x => (BoundedConfig.step M x).bind (runSteps M n) + +theorem runSteps_spec (M : Machine (Fin 2) (Fin 6)) (n : ℕ) + (x x' : BoundedConfig.BCfg (Fin 2) (Fin 6)) + (h : runSteps M n x = some x') (l₀ r₀ : ListBlank (Fin 2)) : + (BoundedConfig.toCfg x l₀ r₀) [M]⊢* (BoundedConfig.toCfg x' l₀ r₀) := by + induction n generalizing x with + | zero => cases h; try exact stepStar_refl M _ + | succ n ih => + dsimp [runSteps] at h + rcases hst : BoundedConfig.step M x with _ | y <;> rw [hst] at h + · cases h + · exact stepStar_trans ⟨1, BoundedConfig.step_spec M x hst l₀ r₀⟩ (ih y h) + +theorem runSteps1_spec (M : Machine (Fin 2) (Fin 6)) (n : ℕ) + (x x' : BoundedConfig.BCfg (Fin 2) (Fin 6)) + (h : runSteps M (n + 1) x = some x') (l₀ r₀ : ListBlank (Fin 2)) : + (BoundedConfig.toCfg x l₀ r₀) [M]⊢⁺ (BoundedConfig.toCfg x' l₀ r₀) := by + dsimp [runSteps] at h + rcases hst : BoundedConfig.step M x with _ | y <;> rw [hst] at h + · cases h + · exact stepPlus_stepStar_trans ⟨1, by decide, BoundedConfig.step_spec M x hst l₀ r₀⟩ + (runSteps_spec M n y x' h l₀ r₀) + +theorem SegRLs.congr + {ls₁ ls₁' ls₂ ls₂' : List (DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6))} + {w₁ w₁' w₂ w₂' : List (Fin 2)} + (h : SegRLs tm ls₁ ls₂ w₁ w₂) + (hls₁ : ls₁ = ls₁') (hls₂ : ls₂ = ls₂') (hw₁ : w₁ = w₁') (hw₂ : w₂ = w₂') : + SegRLs tm ls₁' ls₂' w₁' w₂' := by + subst hls₁ hls₂ hw₁ hw₂; exact h + +theorem SegRLs.trans_eq + {ls₁ ls₂ ls₃ ls₄ : List (DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6))} + {w₁ w₂ w₂' w₃ : List (Fin 2)} + (h₁ : SegRLs tm ls₁ ls₂ w₁ w₂) (h₂ : SegRLs tm ls₃ ls₄ w₂' w₃) + (hw : w₂ = w₂') : + SegRLs tm (ls₁ ++ ls₃) (ls₂ ++ ls₄) w₁ w₃ := by + subst hw; exact h₁.trans h₂ + +theorem SideRLs.congr + {ls ls' : List (DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6))} + {r₁ r₁' r₂ r₂' : ListBlank (Fin 2)} + (h : SideRLs tm ls r₁ r₂) (hls : ls = ls') (hr₁ : r₁ = r₁') (hr₂ : r₂ = r₂') : + SideRLs tm ls' r₁' r₂' := by + subst hls hr₁ hr₂; exact h + +theorem stepStar_congr {c₁ c₁' c₂ c₂' : Cfg (Fin 2) (Fin 6)} + (h : c₁ [tm]⊢* c₂) (hc₁ : c₁ = c₁') (hc₂ : c₂ = c₂') : + c₁' [tm]⊢* c₂' := by + subst hc₁ hc₂; exact h + +theorem stepPlus_congr {c₁ c₁' c₂ c₂' : Cfg (Fin 2) (Fin 6)} + (h : c₁ [tm]⊢⁺ c₂) (hc₁ : c₁ = c₁') (hc₂ : c₂ = c₂') : + c₁' [tm]⊢⁺ c₂' := by + subst hc₁ hc₂; exact h + +abbrev aw : List (Fin 2) := [I, O] +abbrev bw : List (Fin 2) := [O, I] +abbrev tw : List (Fin 2) := [O, I, O, I] +abbrev kw : List (Fin 2) := [I, O, I, O] +abbrev zw : List (Fin 2) := [O, I, I, O] +abbrev jw : List (Fin 2) := [O, I, O, O] +abbrev lw : List (Fin 2) := [I, O, O, I] +abbrev mw : List (Fin 2) := [O, O, O, I] +abbrev rw : List (Fin 2) := [O, O, I, O] +abbrev cw : List (Fin 2) := lw ++ rw +abbrev dw : List (Fin 2) := lw ++ mw ++ rw + +def root (q : Fin 6) (n : ℕ) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + default <{{q}} (zw ^ (1 + n) +> (tw +> r)) + +abbrev f_st : Fin 6 := C +abbrev h_st : Fin 6 := E +abbrev p_st : Fin 6 := D + +abbrev fR : DH0 (Fin 2) (Fin 6) := (f_st, [I]) +abbrev fL : DH0 (Fin 2) (Fin 6) := (f_st, [I]) +abbrev hR : DH0 (Fin 2) (Fin 6) := (h_st, [I]) +abbrev hL : DH0 (Fin 2) (Fin 6) := (f_st, [I]) +abbrev hf : List (DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6)) := [(fR, fL)] +abbrev hh : List (DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6)) := [(hR, hL)] +abbrev hg : List (DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6)) := hf ++ hh + +def P (n : ℕ) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := root p_st n r + +-- ============================================================================ +-- 2. Base Kernel Rules for TM13 +-- ============================================================================ + +theorem F_A : SegRLs tm hf [] aw [O, O] := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem F_T : SegRLs tm hf [] tw zw := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem F_11 : SegRLs tm hf [] [I, I] bw := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem H_T : SegRLs tm hh [] tw lw := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem H_Z : SegRLs tm hh [] zw kw := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem H_R : SegRLs tm hh [] rw jw := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem F_J : SegRLs tm hf hf jw tw := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem H_M : SegRLs tm hh hh mw tw := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem H_L : SegRLs tm hh hh lw zw := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem H_K : SegRLs tm hh hf kw tw := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem F_Z : SegRLs tm hf hg zw tw := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +abbrev uw : List Γ := [I, O, I, I] + +private theorem shift_C_zw_step (l r : ListBlank Γ) : + (l {{C}}> (zw +> r)) [tm]⊢* ((uw +> l) {{C}}> r) := + runSteps_spec tm 4 ⟨[], zw, C, .right⟩ ⟨uw, [], C, .right⟩ (by decide) l r + +private theorem shift_C_zw (n : ℕ) (l r : ListBlank Γ) : + (l {{C}}> (zw ^ n +> r)) [tm]⊢* ((uw ^ n +> l) {{C}}> r) := by + induction n generalizing l with + | zero => try exact stepStar_refl tm _ + | succ n ih => + rw [pow_succ_list, append_assoc] + refine stepStar_trans (shift_C_zw_step l (zw ^ n +> r)) ?_ + refine stepStar_congr (ih (uw +> l)) rfl ?_ + rw [← append_assoc, ← pow_succ_list'] + +private theorem shift_D_back_step (l r : ListBlank Γ) : + ((uw +> l) <{{D}} (bw +> r)) [tm]⊢* (l <{{D}} (bw +> (zw +> r))) := by + have h := runSteps_spec tm 10 ⟨bw, uw, D, .left⟩ ⟨bw ++ zw, [], D, .left⟩ (by decide) l r + simpa only [BoundedConfig.toCfg, append_nil, append_assoc] using h + +private theorem shift_D_back (n : ℕ) (l r : ListBlank Γ) : + ((uw ^ n +> l) <{{D}} (bw +> r)) [tm]⊢* (l <{{D}} (bw +> (zw ^ n +> r))) := by + induction n generalizing r with + | zero => try exact stepStar_refl tm _ + | succ n ih => + rw [pow_succ_list, append_assoc] + refine stepStar_trans (shift_D_back_step (uw ^ n +> l) r) ?_ + refine stepStar_congr (ih (zw +> r)) rfl ?_ + rw [← append_assoc (zw ^ n) zw r, ← pow_succ_list'] + +private theorem bounce_D_left (r : ListBlank Γ) : + (([I] +> default) <{{D}} (bw +> r)) [tm]⊢⁺ (default <{{D}} (zw +> r)) := by + have h := runSteps1_spec tm 7 ⟨bw, [I, O], D, .left⟩ ⟨zw, [], D, .left⟩ (by decide) default r + have hd : ([I, O] : List Γ) +> (default : ListBlank Γ) = [I] +> default := by + rw [show ([I, O] : List Γ) = [I] ++ [O] from rfl, append_assoc, + BoundedConfig.all0_spec (a := [O]) (by decide)] + simpa only [BoundedConfig.toCfg, append_nil, hd] using h + +private theorem P_enter (n : ℕ) (r : ListBlank Γ) : + (root D n r) [tm]⊢⁺ + (toDHCfg (fR, .right) ([I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default))) r) := by + have h1 : (root D n r) [tm]⊢⁺ (([I] +> default) {{C}}> (zw ^ (1 + n) +> (tw +> r))) := by + have h := runSteps1_spec tm 0 ⟨[], [O], D, .left⟩ ⟨[I], [], C, .right⟩ (by decide) + default (zw ^ (1 + n) +> (tw +> r)) + have hd : ([O] : List Γ) +> (default : ListBlank Γ) = default := + BoundedConfig.all0_spec (by decide) + simpa only [root, BoundedConfig.toCfg, append_nil, hd] using h + have h2 := shift_C_zw (1 + n) ([I] +> default) (tw +> r) + have h3 : ((uw ^ (1 + n) +> ([I] +> default)) {{C}}> (tw +> r)) [tm]⊢* + ((uw ^ n +> ([I] +> default)) <{{D}} (bw +> (zw +> (aw +> r)))) := by + have h' := runSteps_spec tm 17 ⟨uw, tw, C, .right⟩ ⟨bw ++ zw ++ aw, [], D, .left⟩ (by decide) + (uw ^ n +> ([I] +> default)) r + simpa only [BoundedConfig.toCfg, append_nil, append_assoc, + show (1 + n : ℕ) = n + 1 by omega, pow_succ_list] using h' + have h4 := shift_D_back n ([I] +> default) (zw +> (aw +> r)) + have h5 := bounce_D_left (zw ^ n +> (zw +> (aw +> r))) + have h5' : (default <{{D}} (zw +> (zw ^ n +> (zw +> (aw +> r))))) = + (default <{{D}} (zw ^ (2 + n) +> (aw +> r))) := by + congr 2 + rw [show (2 + n : ℕ) = (n + 1) + 1 by omega, pow_succ_list, pow_succ_list', + append_assoc, append_assoc] + have h6 : (default <{{D}} (zw ^ (2 + n) +> (aw +> r))) [tm]⊢* + (([I] +> default) {{C}}> (zw ^ (2 + n) +> (aw +> r))) := by + have h := runSteps_spec tm 1 ⟨[], [O], D, .left⟩ ⟨[I], [], C, .right⟩ (by decide) + default (zw ^ (2 + n) +> (aw +> r)) + have hd : ([O] : List Γ) +> (default : ListBlank Γ) = default := + BoundedConfig.all0_spec (by decide) + simpa only [BoundedConfig.toCfg, append_nil, hd] using h + have h7 := shift_C_zw (2 + n) ([I] +> default) (aw +> r) + have h8 : ((uw ^ (2 + n) +> ([I] +> default)) {{C}}> (aw +> r)) [tm]⊢* + (toDHCfg (fR, .right) ([I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default))) r) := by + have h := runSteps_spec tm 6 ⟨uw, aw, C, .right⟩ ⟨[I] ++ [I, I, I, I, I], [], C, .right⟩ (by decide) + (uw ^ (1 + n) +> ([I] +> default)) r + have h2n : uw ^ (2 + n) = uw ++ uw ^ (1 + n) := by + rw [show (2 + n : ℕ) = (1 + n) + 1 by omega, pow_succ_list] + simpa only [BoundedConfig.toCfg, toDHCfg, append_nil, append_assoc, h2n] using h + exact stepPlus_stepStar_trans h1 + (stepStar_trans h2 (stepStar_trans h3 (stepStar_trans h4 + (stepStar_trans (stepPlus_to_stepStar (stepPlus_congr h5 rfl h5')) + (stepStar_trans h6 (stepStar_trans h7 h8)))))) + +private theorem P_exit (n : ℕ) (s : ListBlank Γ) : + (toDHCfg (fL, .left) ([I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default))) s) [tm]⊢⁺ + (root D (1 + n) s) := by + have h1 : (toDHCfg (fL, .left) ([I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default))) s) [tm]⊢* + ((uw ^ (1 + n) +> ([I] +> default)) <{{D}} (bw +> (tw +> s))) := by + have h := runSteps_spec tm 5 ⟨[I], [I, I, I, I, I], C, .left⟩ ⟨bw ++ tw, [], D, .left⟩ + (by decide) (uw ^ (1 + n) +> ([I] +> default)) s + simpa only [BoundedConfig.toCfg, toDHCfg, append_nil, append_assoc] using h + have h2 := shift_D_back (1 + n) ([I] +> default) (tw +> s) + have h3 := bounce_D_left (zw ^ (1 + n) +> (tw +> s)) + have h3' : (default <{{D}} (zw +> (zw ^ (1 + n) +> (tw +> s)))) = root D (1 + n) s := by + unfold root + rw [show (1 + (1 + n) : ℕ) = (1 + n) + 1 by omega, pow_succ_list, append_assoc] + exact stepStar_stepPlus_trans h1 (stepStar_stepPlus_trans h2 (stepPlus_congr h3 rfl h3')) + +theorem P_step (n : ℕ) (r s : ListBlank Γ) (H : SideRLs tm hf r s) : + (P n r) [tm]⊢⁺ (P (1 + n) s) := by + unfold P + exact stepPlus_trans (P_enter n r) + (stepPlus_trans (H.elim_single ([I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default)))) + (P_exit n s)) + +private theorem shift_C_jw_step (l r : ListBlank Γ) : + (l {{C}}> (jw +> r)) [tm]⊢* (([I, I, I, I] +> l) {{C}}> r) := + runSteps_spec tm 4 ⟨[], jw, C, .right⟩ ⟨[I, I, I, I], [], C, .right⟩ (by decide) l r + +private theorem shift_C_jw (k : ℕ) (l r : ListBlank Γ) : + (l {{C}}> (jw ^ k +> r)) [tm]⊢* (([I, I, I, I] ^ k +> l) {{C}}> r) := by + induction k generalizing l with + | zero => try exact stepStar_refl tm _ + | succ k ih => + rw [pow_succ_list, append_assoc] + refine stepStar_trans (shift_C_jw_step l (jw ^ k +> r)) ?_ + refine stepStar_congr (ih ([I, I, I, I] +> l)) rfl ?_ + rw [← append_assoc, ← pow_succ_list'] + +private theorem shift_C_IIII_step (l r : ListBlank Γ) : + (([I, I, I, I] +> l) <{{C}} r) [tm]⊢* (l <{{C}} (kw +> r)) := by + have h := runSteps_spec tm 4 ⟨[], [I, I, I, I], C, .left⟩ ⟨kw, [], C, .left⟩ (by decide) l r + simpa only [BoundedConfig.toCfg, append_nil, append_assoc] using h + +private theorem shift_C_IIII (k : ℕ) (l r : ListBlank Γ) : + (([I, I, I, I] ^ k +> l) <{{C}} r) [tm]⊢* (l <{{C}} (kw ^ k +> r)) := by + induction k generalizing r with + | zero => try exact stepStar_refl tm _ + | succ k ih => + rw [pow_succ_list, append_assoc] + refine stepStar_trans (shift_C_IIII_step ([I, I, I, I] ^ k +> l) r) ?_ + refine stepStar_congr (ih (kw +> r)) rfl ?_ + rw [← append_assoc (kw ^ k) kw r, ← pow_succ_list'] + +private theorem shift_C_lw_step (l r : ListBlank Γ) : + ((uw +> l) <{{C}} ([I, O, I, O, I] +> r)) [tm]⊢* + (l <{{C}} ([I, O, I, O, I] +> (lw +> r))) := by + have h := runSteps_spec tm 12 ⟨[I, O, I, O, I], uw, C, .left⟩ + ⟨[I, O, I, O, I] ++ lw, [], C, .left⟩ (by decide) l r + simpa only [BoundedConfig.toCfg, append_nil, append_assoc] using h + +private theorem shift_C_lw (n : ℕ) (l r : ListBlank Γ) : + ((uw ^ n +> l) <{{C}} ([I, O, I, O, I] +> r)) [tm]⊢* + (l <{{C}} ([I, O, I, O, I] +> (lw ^ n +> r))) := by + induction n generalizing r with + | zero => try exact stepStar_refl tm _ + | succ n ih => + rw [pow_succ_list, append_assoc] + refine stepStar_trans (shift_C_lw_step (uw ^ n +> l) r) ?_ + refine stepStar_congr (ih (lw +> r)) rfl ?_ + rw [← append_assoc (lw ^ n) lw r, ← pow_succ_list'] + +private theorem O_kw_pow (k : ℕ) (r : ListBlank Γ) : + ([O] +> (kw ^ k +> r)) = (tw ^ k +> ([O] +> r)) := by + induction k with + | zero => rfl + | succ k ih => + rw [pow_succ_list, append_assoc, ← append_assoc [O] kw, + show ([O] ++ kw : List Γ) = tw ++ [O] from rfl, + append_assoc tw [O], ih, ← append_assoc tw (tw ^ k), ← pow_succ_list] + +private theorem OI_lw_pow (n : ℕ) (r : ListBlank Γ) : + (bw +> (lw ^ n +> r)) = (zw ^ n +> (bw +> r)) := by + induction n with + | zero => rfl + | succ n ih => + rw [pow_succ_list, append_assoc, ← append_assoc bw lw, + show (bw ++ lw : List Γ) = zw ++ bw from rfl, + append_assoc zw bw, ih, ← append_assoc zw (zw ^ n), ← pow_succ_list] + +private theorem IO_zw_pow (n : ℕ) (r : ListBlank Γ) : + (aw +> (zw ^ n +> r)) = (lw ^ n +> (aw +> r)) := by + induction n with + | zero => rfl + | succ n ih => + rw [pow_succ_list, append_assoc, ← append_assoc aw zw, + show (aw ++ zw : List Γ) = lw ++ aw from rfl, + append_assoc lw aw, ih, ← append_assoc lw (lw ^ n), ← pow_succ_list] + +theorem bw_comm_T (n : ℕ) : bw ++ tw ^ n = tw ^ n ++ bw := by + induction n with + | zero => rfl + | succ n ih => + change tw ++ (bw ++ tw ^ n) = tw ++ (tw ^ n ++ bw) + rw [ih] + +private theorem return_tail (n : ℕ) (r_tail : ListBlank Γ) : + (([O, I, I] +> ([I, I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default)))) <{{D}} + (tw +> r_tail)) [tm]⊢* + (root D 0 (tw +> (lw ^ n +> (kw +> (tw +> (aw +> r_tail)))))) := by + have h1 : (([O, I, I] +> ([I, I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default)))) <{{D}} + (tw +> r_tail)) [tm]⊢* + ((uw ^ (1 + n) +> ([I] +> default)) <{{C}} + ([I, O, I, O, I] +> ([O, I, O, I, O, I, I, O] +> r_tail))) := by + have h := runSteps_spec tm 17 ⟨tw, [O, I, I] ++ [I, I, I, I, I, I], D, .left⟩ + ⟨[I, O, I, O, I] ++ [O, I, O, I, O, I, I, O], [], C, .left⟩ (by decide) + (uw ^ (1 + n) +> ([I] +> default)) r_tail + simpa only [BoundedConfig.toCfg, append_nil, append_assoc] using h + have h2 := shift_C_lw (1 + n) ([I] +> default) ([O, I, O, I, O, I, I, O] +> r_tail) + have h2_eq : (([I] +> default) <{{C}} + ([I, O, I, O, I] +> (lw ^ (1 + n) +> ([O, I, O, I, O, I, I, O] +> r_tail)))) = + (([I] +> default) <{{C}} + ([I, O, I, O, I, I, O] +> (zw ^ n +> ([O, I, O, I, O, I, O, I, I, O] +> r_tail)))) := by + congr 1 + have h_lw : lw ^ (1 + n) +> ([O, I, O, I, O, I, I, O] +> r_tail) = + aw +> (zw ^ n +> ([O, I, O, I, O, I, O, I, I, O] +> r_tail)) := by + rw [show (1 + n : ℕ) = n + 1 by omega, pow_succ_list, append_assoc, + show (lw +> (lw ^ n +> ([O, I, O, I, O, I, I, O] +> r_tail))) = + aw +> (bw +> (lw ^ n +> ([O, I, O, I, O, I, I, O] +> r_tail))) from rfl, + OI_lw_pow] + rfl + rw [h_lw] + rfl + have h3 : (([I] +> default) <{{C}} + ([I, O, I, O, I, I, O] +> (zw ^ n +> ([O, I, O, I, O, I, O, I, I, O] +> r_tail)))) [tm]⊢* + (([I, O, I, I, I, I, I, I, I, I, I] +> default) {{C}}> + (zw ^ n +> ([O, I, O, I, O, I, O, I, I, O] +> r_tail))) := by + have h := runSteps_spec tm 32 ⟨[I, O, I, O, I, I, O], [I, O, O, O], C, .left⟩ + ⟨[I, O, I, I, I, I, I, I, I, I, I], [], C, .right⟩ (by decide) + default (zw ^ n +> ([O, I, O, I, O, I, O, I, I, O] +> r_tail)) + have hd : ([I, O, O, O] : List Γ) +> (default : ListBlank Γ) = [I] +> default := by + rw [show ([I, O, O, O] : List Γ) = [I] ++ [O, O, O] from rfl, append_assoc, + BoundedConfig.all0_spec (a := [O, O, O]) (by decide)] + simpa only [BoundedConfig.toCfg, append_nil, hd] using h + have h4 := shift_C_zw n ([I, O, I, I, I, I, I, I, I, I, I] +> default) + ([O, I, O, I, O, I, O, I, I, O] +> r_tail) + have h5 : ((uw ^ n +> ([I, O, I, I, I, I, I, I, I, I, I] +> default)) {{C}}> + ([O, I, O, I, O, I, O, I, I, O] +> r_tail)) [tm]⊢* + ((uw ^ n +> ([I, O, I, I, I, I, I, I, I, I, I] +> default)) <{{D}} + (bw +> ([I, O, O, I, O, I, I, O] +> r_tail))) := by + have h := runSteps_spec tm 7 ⟨[], [O, I, O, I, O, I], C, .right⟩ + ⟨bw ++ [I, O, O, I], [], D, .left⟩ (by decide) + (uw ^ n +> ([I, O, I, I, I, I, I, I, I, I, I] +> default)) + ([O, I, I, O] +> r_tail) + have hr1 : ([O, I, O, I, O, I] : List Γ) +> ([O, I, I, O] +> r_tail) = + [O, I, O, I, O, I, O, I, I, O] +> r_tail := by + rw [← append_assoc]; rfl + have hr2 : ([I, O, O, I] : List Γ) +> ([O, I, I, O] +> r_tail) = + [I, O, O, I, O, I, I, O] +> r_tail := by + rw [← append_assoc]; rfl + simpa only [BoundedConfig.toCfg, append_nil, append_assoc, hr1, hr2] using h + have h6 := shift_D_back n ([I, O, I, I, I, I, I, I, I, I, I] +> default) + ([I, O, O, I, O, I, I, O] +> r_tail) + have h7 : (([I, O, I, I, I, I, I, I, I, I, I] +> default) <{{D}} + (bw +> (zw ^ n +> ([I, O, O, I, O, I, I, O] +> r_tail)))) [tm]⊢* + (root D 0 (tw +> (lw ^ n +> (kw +> (tw +> (aw +> r_tail)))))) := by + have h := runSteps_spec tm 24 ⟨bw, [I, O, I, I, I, I, I, I, I, I, I, O], D, .left⟩ + ⟨zw ++ tw ++ tw ++ aw, [], D, .left⟩ (by decide) + default (zw ^ n +> ([I, O, O, I, O, I, I, O] +> r_tail)) + have hd : ([I, O, I, I, I, I, I, I, I, I, I, O] : List Γ) +> (default : ListBlank Γ) = + [I, O, I, I, I, I, I, I, I, I, I] +> default := by + rw [show ([I, O, I, I, I, I, I, I, I, I, I, O] : List Γ) = + [I, O, I, I, I, I, I, I, I, I, I] ++ [O] from rfl, + append_assoc, BoundedConfig.all0_spec (a := [O]) (by decide)] + have hr : ((zw ++ tw ++ tw ++ aw) +> + (zw ^ n +> ([I, O, O, I, O, I, I, O] +> r_tail))) = + (zw ^ (1 + 0) +> (tw +> (tw +> (lw ^ n +> (kw +> (tw +> (aw +> r_tail))))))) := by + rw [Nat.add_zero, pow_one_list, append_assoc, append_assoc, append_assoc, IO_zw_pow, + ← append_assoc aw [I, O, O, I, O, I, I, O], + show (aw ++ [I, O, O, I, O, I, I, O] : List Γ) = kw ++ tw ++ aw from rfl, + append_assoc, append_assoc] + simpa only [BoundedConfig.toCfg, root, append_nil, hd, hr] using h + exact stepStar_trans h1 (stepStar_trans (stepStar_congr h2 rfl h2_eq) + (stepStar_trans h3 (stepStar_trans h4 (stepStar_trans h5 (stepStar_trans h6 h7))))) + +theorem zero_return (n k : ℕ) (r : ListBlank Γ) : + (P n (zw +> (jw ^ (1 + k) +> ([O, O] +> r)))) [tm]⊢⁺ + (P 0 (tw +> (lw ^ n +> (kw +> (tw +> (aw +> (tw ^ k +> ([I, O, I] +> r)))))))) := by + unfold P + let l_base : ListBlank Γ := [I, I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default)) + have h1 := P_enter n (zw +> (jw ^ (1 + k) +> ([O, O] +> r))) + have h2 : (toDHCfg (fR, .right) ([I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default))) + (zw +> (jw ^ (1 + k) +> ([O, O] +> r)))) [tm]⊢* + ((uw +> l_base) {{C}}> (jw ^ (1 + k) +> ([O, O] +> r))) := + shift_C_zw_step l_base (jw ^ (1 + k) +> ([O, O] +> r)) + have h3 := shift_C_jw (1 + k) (uw +> l_base) ([O, O] +> r) + have h4 : (([I, I, I, I] ^ (1 + k) +> (uw +> l_base)) {{C}}> ([O, O] +> r)) [tm]⊢* + (([I, I, I, I] ^ k +> (uw +> l_base)) <{{C}} ([I, O, I, I, O, I] +> r)) := by + have h := runSteps_spec tm 7 ⟨[I, I, I, I], [O, O], C, .right⟩ + ⟨[I, O, I, I, O, I], [], C, .left⟩ (by decide) + ([I, I, I, I] ^ k +> (uw +> l_base)) r + simpa only [BoundedConfig.toCfg, append_nil, append_assoc, + show (1 + k : ℕ) = k + 1 by omega, pow_succ_list] using h + have h5 := shift_C_IIII k (uw +> l_base) ([I, O, I, I, O, I] +> r) + have h6 : ((uw +> l_base) <{{C}} (kw ^ k +> ([I, O, I, I, O, I] +> r))) [tm]⊢* + (([O, I, I] +> l_base) <{{D}} (tw +> (tw ^ k +> ([I, O, I] +> r)))) := by + have h := runSteps_spec tm 1 ⟨[], [I], C, .left⟩ ⟨[O], [], D, .left⟩ (by decide) + ([O, I, I] +> l_base) (kw ^ k +> ([I, O, I, I, O, I] +> r)) + have hl : ([I] : List Γ) +> ([O, I, I] +> l_base) = uw +> l_base := by + rw [← append_assoc]; rfl + have hr : ([O] +> (kw ^ k +> ([I, O, I, I, O, I] +> r))) = + (tw +> (tw ^ k +> ([I, O, I] +> r))) := by + rw [O_kw_pow, show ([O] +> ([I, O, I, I, O, I] +> r)) = tw +> ([I, O, I] +> r) from rfl, + ← append_assoc, ← pow_succ_list', pow_succ_list, append_assoc] + simpa only [BoundedConfig.toCfg, append_nil, hl, hr] using h + have h7 := return_tail n (tw ^ k +> ([I, O, I] +> r)) + exact stepPlus_stepStar_trans h1 + (stepStar_trans h2 (stepStar_trans h3 (stepStar_trans h4 + (stepStar_trans h5 (stepStar_trans h6 h7))))) + +theorem anchor_return (n k : ℕ) : + (P n (zw +> (jw ^ k +> (zw +> ([I] +> default))))) [tm]⊢⁺ + (P 0 (tw +> (lw ^ n +> (kw +> (tw +> (aw +> (bw +> (tw ^ k +> ([I, O, I] +> default))))))))) := by + unfold P + let l_base : ListBlank Γ := [I, I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default)) + have h1 := P_enter n (zw +> (jw ^ k +> (zw +> ([I] +> default)))) + have h2 : (toDHCfg (fR, .right) ([I, I, I, I, I] +> (uw ^ (1 + n) +> ([I] +> default))) + (zw +> (jw ^ k +> (zw +> ([I] +> default))))) [tm]⊢* + ((uw +> l_base) {{C}}> (jw ^ k +> (zw +> ([I] +> default)))) := + shift_C_zw_step l_base (jw ^ k +> (zw +> ([I] +> default))) + have h3 := shift_C_jw k (uw +> l_base) (zw +> ([I] +> default)) + have h4 := shift_C_zw_step ([I, I, I, I] ^ k +> (uw +> l_base)) ([I] +> default) + have h5 : ((uw +> ([I, I, I, I] ^ k +> (uw +> l_base))) {{C}}> ([I] +> default)) [tm]⊢* + (([I, I, I, I] ^ k +> (uw +> l_base)) <{{C}} ([I, O, I, O, I, I, O, I] +> default)) := by + have h := runSteps_spec tm 15 ⟨uw, [I, O, O, O], C, .right⟩ + ⟨[I, O, I, O, I, I, O, I], [], C, .left⟩ (by decide) + ([I, I, I, I] ^ k +> (uw +> l_base)) default + have hd1 : ([I, O, O, O] : List Γ) +> (default : ListBlank Γ) = [I] +> default := by + rw [show ([I, O, O, O] : List Γ) = [I] ++ [O, O, O] from rfl, append_assoc, + BoundedConfig.all0_spec (a := [O, O, O]) (by decide)] + simpa only [BoundedConfig.toCfg, append_nil, append_assoc, hd1] using h + have h6 := shift_C_IIII k (uw +> l_base) ([I, O, I, O, I, I, O, I] +> default) + have h7 : ((uw +> l_base) <{{C}} (kw ^ k +> ([I, O, I, O, I, I, O, I] +> default))) [tm]⊢* + (([O, I, I] +> l_base) <{{D}} (tw +> (bw +> (tw ^ k +> ([I, O, I] +> default))))) := by + have h := runSteps_spec tm 1 ⟨[], [I], C, .left⟩ ⟨[O], [], D, .left⟩ (by decide) + ([O, I, I] +> l_base) (kw ^ k +> ([I, O, I, O, I, I, O, I] +> default)) + have hl : ([I] : List Γ) +> ([O, I, I] +> l_base) = uw +> l_base := by + rw [← append_assoc]; rfl + have hr : ([O] +> (kw ^ k +> ([I, O, I, O, I, I, O, I] +> default))) = + (tw +> (bw +> (tw ^ k +> ([I, O, I] +> default)))) := by + rw [O_kw_pow, + show ([O] +> ([I, O, I, O, I, I, O, I] +> (default : ListBlank Γ))) = + tw +> (bw +> ([I, O, I] +> default)) from rfl, + ← append_assoc (tw ^ k) tw _, ← pow_succ_list', pow_succ_list, + append_assoc tw (tw ^ k), ← append_assoc (tw ^ k) bw, ← bw_comm_T, append_assoc] + simpa only [BoundedConfig.toCfg, append_nil, hl, hr] using h + have h8 := return_tail n (bw +> (tw ^ k +> ([I, O, I] +> default))) + exact stepPlus_stepStar_trans h1 + (stepStar_trans h2 (stepStar_trans h3 (stepStar_trans h4 + (stepStar_trans h5 (stepStar_trans h6 (stepStar_trans h7 h8)))))) + +theorem init_raw : + (init []) [tm]⊢* (P 0 (tw +> (lw ^ 6 +> (kw +> (tw ^ 3 +> (zw +> ([I] +> default))))))) := by + have h := runSteps_spec tm 1581 ⟨List.replicate 46 O, List.replicate 11 O, A, .right⟩ + ⟨zw ++ tw ++ tw ++ lw ^ 6 ++ kw ++ tw ^ 3 ++ zw ++ [I], [], D, .left⟩ + (by decide) default default + have hl : List.replicate 46 O +> (default : ListBlank Γ) = default := + BoundedConfig.all0_spec (by decide) + have hr : List.replicate 11 O +> (default : ListBlank Γ) = default := + BoundedConfig.all0_spec (by decide) + refine stepStar_congr h ?_ ?_ + · simp only [BoundedConfig.toCfg, hl, hr]; rfl + · simp only [BoundedConfig.toCfg, P, root, Nat.add_zero, pow_one_list, append_nil, append_assoc] + +-- ============================================================================ +-- 3. Common Service Algebra & Closed Reset Family (`SOBCv13.v:79-1183`) +-- ============================================================================ + +theorem F_K : SegRLs tm hf [] kw rw := + F_A.concat (.nil aw) + +theorem F_L : SegRLs tm hf [] lw mw := + F_A.concat (.nil bw) + +theorem G_T : SegRLs tm hg [] tw kw := + F_T.trans H_Z + +theorem G_K : SegRLs tm hg [] kw jw := + F_K.trans H_R + +theorem G_J : SegRLs tm hg hf jw lw := + SegRLs.congr (F_J.trans H_T) rfl rfl rfl rfl + +theorem G_L : SegRLs tm hg hh lw tw := + F_L.trans H_M + +theorem G_Z : SegRLs tm hg hg zw lw := + SegRLs.congr (F_Z.trans H_T) rfl rfl rfl rfl + +theorem G2_J : SegRLs tm (hg ^ 2) hg jw tw := + SegRLs.congr (G_J.trans G_L) (by rfl) rfl rfl rfl + +theorem G4_T : SegRLs tm (hg ^ 4) hg tw tw := + SegRLs.congr (G_T.trans (G_K.trans G2_J)) (by rfl) rfl rfl rfl + +theorem G4_J : SegRLs tm (hg ^ 4) hg jw jw := + SegRLs.congr (G2_J.trans (G_T.trans G_K)) (by rfl) rfl rfl rfl + +theorem F_Js (n : ℕ) : SegRLs tm hf hf (jw ^ n) (tw ^ n) := by + induction n with + | zero => exact SegRLs.empty tm hf + | succ n ih => exact F_J.concat ih + +theorem H_Ms (n : ℕ) : SegRLs tm hh hh (mw ^ n) (tw ^ n) := by + induction n with + | zero => exact SegRLs.empty tm hh + | succ n ih => exact H_M.concat ih + +theorem H_Ls (n : ℕ) : SegRLs tm hh hh (lw ^ n) (zw ^ n) := by + induction n with + | zero => exact SegRLs.empty tm hh + | succ n ih => exact H_L.concat ih + +def q4 : ℕ → ℕ + | 0 => 0 + | k + 1 => 1 + 4 * q4 k + +theorem q4_pow (n : ℕ) : 1 + 3 * q4 n = 4 ^ n := by + induction n with + | zero => rfl + | succ n ih => + dsimp [q4] + rw [Nat.pow_succ] + omega + +theorem q4_add (n m : ℕ) : q4 (n + m) = q4 n + 4 ^ n * q4 m := by + induction n with + | zero => + rw [Nat.zero_add, Nat.pow_zero, Nat.one_mul] + dsimp [q4] + omega + | succ n ih => + rw [Nat.succ_add, q4, q4, ih, Nat.pow_succ] + ring + +theorem service_repeat {hs ks : List (DH0 Γ Λ × DH0 Γ Λ)} {w : List Γ} (n : ℕ) + (H : SegRLs tm hs ks w w) : SegRLs tm (hs ^ n) (ks ^ n) w w := by + induction n with + | zero => exact .nil w + | succ n ih => exact H.trans ih + +theorem F2_T : SegRLs tm (hf ^ 2) hg tw tw := + SegRLs.congr (F_T.trans F_Z) (by rfl) rfl rfl rfl + +theorem G_recycle {w : List Γ} (n : ℕ) (H : SegRLs tm (hg ^ 4) hg w w) : + SegRLs tm (hg ^ (n * 4)) (hg ^ n) w w := by + rw [Nat.mul_comm, pow_mul_list] + exact service_repeat n H + +theorem G_lift {w : List Γ} (a n : ℕ) (H : SegRLs tm (hg ^ 4) hg w w) : + SegRLs tm (hg ^ (n * 4 ^ a)) (hg ^ n) (w ^ a) (w ^ a) := by + induction a generalizing n with + | zero => + rw [Nat.pow_zero, Nat.mul_one] + exact SegRLs.empty tm (hg ^ n) + | succ a ih => + rw [pow_succ_list, + show n * 4 ^ (a + 1) = (n * 4 ^ a) * 4 by rw [Nat.pow_succ]; ring] + exact (G_recycle (n * 4 ^ a) H).concat (ih n) + +theorem G_Ts (a n : ℕ) : SegRLs tm (hg ^ (n * 4 ^ a)) (hg ^ n) (tw ^ a) (tw ^ a) := + G_lift a n G4_T + +theorem G_Js (a n : ℕ) : SegRLs tm (hg ^ (n * 4 ^ a)) (hg ^ n) (jw ^ a) (jw ^ a) := + G_lift a n G4_J + +theorem F_T_calls (a n : ℕ) : + SegRLs tm (hf ^ (2 * n * 4 ^ a)) (hg ^ n) (tw ^ (1 + a)) (tw ^ (1 + a)) := by + have h1 : SegRLs tm (hf ^ (2 * (n * 4 ^ a))) (hg ^ (n * 4 ^ a)) tw tw := by + rw [pow_mul_list] + exact service_repeat (n * 4 ^ a) F2_T + refine SegRLs.congr (h1.concat (G_Ts a n)) ?_ rfl ?_ ?_ + · rw [show 2 * (n * 4 ^ a) = 2 * n * 4 ^ a by ring] + · rw [Nat.add_comm 1 a, pow_succ_list] + · rw [Nat.add_comm 1 a, pow_succ_list] + +theorem G2_T : SegRLs tm (hg ^ 2) [] tw jw := + SegRLs.congr (G_T.trans G_K) (by rfl) rfl rfl rfl + +theorem G_normalize (n : ℕ) : SegRLs tm (hg ^ (2 * q4 n)) [] (tw ^ n) (jw ^ n) := by + induction n with + | zero => exact .nil [] + | succ n ih => + have h1 := G2_T.concat (.nil (tw ^ n)) + have h2 := (G_recycle (2 * q4 n) G4_J).concat ih + refine SegRLs.congr (h1.trans h2) ?_ rfl rfl rfl + rw [← pow_add_list, show 2 + 2 * q4 n * 4 = 2 * q4 (n + 1) by dsimp [q4]; omega] + +theorem F_normalize (n : ℕ) : + SegRLs tm (hf ^ (q4 (1 + n))) [] (tw ^ (1 + n)) (zw ++ jw ^ n) := by + have h1 := (F_T_calls 0 (2 * q4 n)).concat (G_normalize n) + have h2 := F_T.concat (.nil (jw ^ n)) + refine SegRLs.congr (SegRLs.trans_eq h1 h2 (by rfl)) ?_ rfl ?_ rfl + · rw [← pow_succ_list'] + congr 1 + rw [Nat.add_comm 1 n] + dsimp [q4] + omega + · rw [Nat.add_comm 1 n, pow_succ_list] + rfl + +theorem F_outer (n : ℕ) : + SegRLs tm hf hh (zw ++ lw ++ mw ^ n) (tw ^ (2 + n)) := by + have h := F_Z.concat (G_L.concat (H_Ms n)) + refine SegRLs.congr h rfl rfl (by simp only [List.append_assoc]) ?_ + rw [show (2 + n : ℕ) = (n + 1) + 1 by omega, pow_succ_list, pow_succ_list] + +theorem F_postJ (n : ℕ) : + SegRLs tm hf hf (zw ++ jw ^ (1 + n)) (tw ++ lw ++ tw ^ n) := by + have h := F_Z.concat (G_J.concat (F_Js n)) + refine SegRLs.congr h rfl rfl ?_ (by simp only [List.append_assoc]) + rw [Nat.add_comm 1 n, pow_succ_list] + +theorem BIN_borrow (n : ℕ) : + SegRLs tm (hf ^ (8 + 16 * q4 n)) [] + (zw ++ lw ++ mw ^ n ++ tw) (zw ++ lw ++ tw ^ n ++ mw) := by + have h1 := (F_outer n).concat H_T + have h2 := (F_normalize (1 + n)).concat (.nil lw) + have h3 := (F_postJ n).concat F_L + have h4 := F_T.concat (.nil (lw ++ tw ^ n ++ mw)) + have h12 := SegRLs.trans_eq h1 h2 (by rw [show 2 + n = 1 + (1 + n) by omega]) + have h34 := SegRLs.trans_eq h3 h4 (by simp only [List.append_assoc]) + have hall := SegRLs.trans_eq h12 h34 (by simp only [List.append_assoc]) + refine SegRLs.congr hall ?_ rfl (by simp only [List.append_assoc]) + (by simp only [List.append_assoc]) + rw [← List.append_assoc, ← pow_succ_list, ← pow_succ_list', ← pow_succ_list'] + congr 1 + rw [show 1 + (1 + n) = (n + 1) + 1 by omega] + dsimp [q4] + omega + +theorem BIN (n : ℕ) : + SegRLs tm (hf ^ (8 * q4 n)) [] (zw ++ lw ++ tw ^ n) (zw ++ lw ++ mw ^ n) := by + induction n with + | zero => exact .nil _ + | succ n ih => + have h1 : SegRLs tm (hf ^ (8 * q4 n)) [] + (zw ++ lw ++ tw ^ n ++ tw) (zw ++ lw ++ mw ^ n ++ tw) := + ih.concat (.nil tw) + have h2 := BIN_borrow n + have h3 : SegRLs tm (hf ^ (8 * q4 n)) [] + (zw ++ lw ++ tw ^ n ++ mw) (zw ++ lw ++ mw ^ n ++ mw) := + ih.concat (.nil mw) + refine SegRLs.congr ((h1.trans h2).trans h3) ?_ rfl ?_ ?_ + · rw [← pow_add_list, ← pow_add_list] + congr 1 + dsimp [q4] + omega + · rw [pow_succ_list', List.append_assoc] + · rw [pow_succ_list', List.append_assoc] + +theorem G_Zs (n : ℕ) : SegRLs tm hg hg (zw ^ n) (lw ^ n) := by + induction n with + | zero => exact SegRLs.empty tm hg + | succ n ih => exact G_Z.concat ih + +theorem G_Ls (n : ℕ) : SegRLs tm hg hh (lw ^ (1 + n)) (tw ++ zw ^ n) := by + rw [Nat.add_comm 1 n, pow_succ_list] + exact G_L.concat (H_Ls n) + +theorem G_ZT (n : ℕ) : + SegRLs tm (hg ^ 2) hf (zw ^ (1 + n) ++ tw) (tw ++ zw ^ n ++ tw) := by + have h1 := (G_Zs (1 + n)).concat G_T + have h2 := (G_Ls n).concat H_K + exact SegRLs.congr (h1.trans h2) (by rfl) rfl rfl (by simp only [List.append_assoc]) + +theorem G_reduce_Z (n : ℕ) : + SegRLs tm (hg ^ (2 * q4 n)) (hf ^ n) (zw ^ n ++ tw) (tw ^ (1 + n)) := by + induction n with + | zero => exact .nil tw + | succ n ih => + have h1 := G_ZT (n := n) + have h2 := (G_recycle (2 * q4 n) G4_T).concat ih + refine SegRLs.congr (SegRLs.trans_eq h1 h2 (by simp only [List.append_assoc])) + ?_ ?_ (by rw [Nat.add_comm 1 n]) ?_ + · rw [← pow_add_list, show 2 + 2 * q4 n * 4 = 2 * q4 (n + 1) by dsimp [q4]; omega] + · rw [← pow_succ_list] + · rw [show 1 + (n + 1) = (1 + n) + 1 by omega, pow_succ_list] + +theorem G_column_start (n : ℕ) (w : List Γ) : + SegRLs tm hg [] (lw ^ (1 + n) ++ kw ++ tw ++ w) (tw ++ zw ^ n ++ tw ++ zw ++ w) := by + have h := (G_Ls n).concat (H_K.concat (F_T.concat (.nil w))) + exact SegRLs.congr h rfl rfl (by simp only [List.append_assoc]) (by simp only [List.append_assoc]) + +theorem COLUMN (n : ℕ) (w e : List Γ) (hs : List (DH0 Γ Λ × DH0 Γ Λ)) + (H : SegRLs tm (hf ^ n) hs (zw ++ w) e) : + SegRLs tm (hf ^ (2 + 16 * q4 n)) hs + (tw ++ lw ^ (1 + n) ++ kw ++ tw ++ w) (tw ^ (n + 3) ++ e) := by + have h_inner1 := G_column_start n w + have h_inner2 := (G_recycle (2 * q4 n) G4_T).concat ((G_reduce_Z n).concat H) + have h_inner : SegRLs tm (hg ^ (1 + 8 * q4 n)) hs + (lw ^ (1 + n) ++ kw ++ tw ++ w) (tw ++ tw ^ (1 + n) ++ e) := by + refine SegRLs.congr (SegRLs.trans_eq h_inner1 h_inner2 (by simp only [List.append_assoc])) + ?_ (List.nil_append hs) rfl (by simp only [List.append_assoc]) + rw [← pow_succ_list] + congr 1 + omega + have h_outer := (F_T_calls 0 (1 + 8 * q4 n)).concat h_inner + refine SegRLs.congr h_outer ?_ (List.nil_append hs) + (by simp only [pow_zero_list, pow_succ_list, List.append_nil, List.append_assoc]) ?_ + · congr 1 + rw [Nat.pow_zero] + omega + · rw [show (1 + 0 : ℕ) = 1 from rfl, pow_one_list, + show n + 3 = 1 + (1 + (1 + n)) by omega, + Nat.add_comm 1 (1 + (1 + n)), pow_succ_list, + Nat.add_comm 1 (1 + n), pow_succ_list] + simp only [List.append_assoc] + +theorem G3_T : SegRLs tm (hg ^ 3) hf tw lw := + SegRLs.congr (G2_T.trans G_J) (by rfl) rfl rfl rfl + +theorem G_almost (n : ℕ) : + SegRLs tm (hg ^ (3 + 12 * q4 n)) hf (tw ^ (1 + n)) (lw ++ mw ^ n) := by + induction n with + | zero => exact G3_T + | succ n ih => + have h1 := (G_recycle (3 + 12 * q4 n) G4_T).concat ih + have h2 := G3_T.concat (F_L.concat (.nil (mw ^ n))) + refine SegRLs.congr (SegRLs.trans_eq h1 h2 (by simp only [List.append_assoc])) + ?_ rfl ?_ ?_ + · rw [← pow_add_list] + congr 1 + dsimp [q4] + omega + · rw [show 1 + (n + 1) = (1 + n) + 1 by omega, pow_succ_list] + · rw [pow_succ_list] + +theorem G_two_before (n : ℕ) : + SegRLs tm (hg ^ (14 + 48 * q4 n)) hf (tw ^ (2 + n)) (jw ++ lw ++ mw ^ n) := by + have h1 := (G_recycle (3 + 12 * q4 n) G4_T).concat (G_almost n) + have h2 := G2_T.concat (.nil (lw ++ mw ^ n)) + refine SegRLs.congr (h1.trans h2) ?_ rfl ?_ (by simp only [List.append_assoc]) + · rw [← pow_add_list] + congr 1 + omega + · rw [show 2 + n = (1 + n) + 1 by omega, pow_succ_list] + +theorem NEAR_WRAP (n j : ℕ) : + SegRLs tm (hf ^ (29 + 96 * q4 n + 2 * j * 4 ^ (2 + n))) (hg ^ j ++ hf) + (tw ^ (3 + n)) (zw ++ jw ++ lw ++ mw ^ n) := by + have h1 := F_T_calls (2 + n) j + have h2 := SegRLs.trans_eq ((F_T_calls 0 (14 + 48 * q4 n)).concat (G_two_before n)) + (F_T.concat (.nil (jw ++ lw ++ mw ^ n))) (by rfl) + refine SegRLs.congr (SegRLs.trans_eq h1 h2 ?_) ?_ (by simp only [List.append_nil]) + (by rw [show 3 + n = 1 + (2 + n) by omega]) (by simp only [List.append_assoc]) + · rw [show (1 + 0 : ℕ) = 1 from rfl, pow_one_list, + show 1 + (2 + n) = (2 + n) + 1 by omega, pow_succ_list] + · rw [← pow_succ_list', ← pow_add_list] + congr 1 + rw [Nat.pow_zero] + omega + +theorem G_append (n k : ℕ) (u v w : List Γ) + (H : SegRLs tm (hg ^ n) [] u v) + (H' : SegRLs tm (hg ^ k) [] (tw ++ v) w) : + SegRLs tm (hg ^ (4 * n + k)) [] (tw ++ u) w := by + have h1 := (G_recycle n G4_T).concat H + refine SegRLs.congr (h1.trans H') ?_ rfl rfl rfl + rw [← pow_add_list, Nat.mul_comm n 4] + +theorem G7 : SegRLs tm (hg ^ 7) [] (tw ^ 2) cw := + G_append 1 3 tw kw cw G_T (G3_T.concat F_K) + +theorem G125 : SegRLs tm (hg ^ 125) [] (tw ^ 4) (kw ++ dw) := by + have H31 : SegRLs tm (hg ^ 31) [] (tw ^ 3) dw := + G_append 7 3 (tw ^ 2) cw dw G7 + (SegRLs.congr (G3_T.concat (F_L.concat (.nil rw))) rfl rfl rfl rfl) + exact G_append 31 1 (tw ^ 3) dw (kw ++ dw) H31 (G_T.concat (.nil dw)) + +theorem G_prefix7 : SegRLs tm (hg ^ 8061) [] (tw ^ 7) (kw ++ dw ^ 2) := by + have H5 : SegRLs tm (hg ^ 503) [] (tw ^ 5) (cw ++ dw) := + G_append 125 3 (tw ^ 4) (kw ++ dw) (cw ++ dw) G125 + (SegRLs.congr (G3_T.concat (F_K.concat (.nil dw))) rfl rfl rfl rfl) + have H6 : SegRLs tm (hg ^ 2015) [] (tw ^ 6) (dw ++ dw) := + G_append 503 3 (tw ^ 5) (cw ++ dw) (dw ++ dw) H5 + (SegRLs.congr (G3_T.concat (F_L.concat (.nil (rw ++ dw)))) rfl rfl rfl rfl) + exact G_append 2015 1 (tw ^ 6) (dw ++ dw) (kw ++ dw ^ 2) H6 + (SegRLs.congr (G_T.concat (.nil (dw ++ dw))) rfl rfl rfl rfl) + +theorem G_pair13 : SegRLs tm (hg ^ 13) [] (tw ^ 2 ++ kw) (kw ++ cw) := + SegRLs.congr (G_append 3 1 (tw ++ kw) cw (kw ++ cw) (G3_T.concat F_K) (G_T.concat (.nil cw))) + rfl rfl rfl rfl + +theorem G_last61 : SegRLs tm (hg ^ 61) [] (tw ^ 3 ++ kw) (kw ++ dw) := by + have H15 : SegRLs tm (hg ^ 15) [] (tw ^ 2 ++ kw) dw := + SegRLs.congr (G_append 3 3 (tw ++ kw) cw dw (G3_T.concat F_K) + (SegRLs.congr (G3_T.concat (F_L.concat (.nil rw))) rfl rfl rfl rfl)) + rfl rfl rfl rfl + exact SegRLs.congr (G_append 15 1 (tw ^ 2 ++ kw) dw (kw ++ dw) H15 (G_T.concat (.nil dw))) + rfl rfl rfl rfl + +def supply_d : ℕ → ℕ + | 0 => 8061 + | r + 1 => 16 * supply_d r + 13 + +theorem G_supply_pairs (r : ℕ) : + SegRLs tm (hg ^ (supply_d r)) [] (tw ^ (7 + 2 * r)) (kw ++ cw ^ r ++ dw ^ 2) := by + induction r with + | zero => exact G_prefix7 + | succ r ih => + have h1 := (G_Ts 2 (supply_d r)).concat ih + have h2 := G_pair13.concat (.nil (cw ^ r ++ dw ^ 2)) + refine SegRLs.congr (SegRLs.trans_eq h1 h2 (by simp only [List.append_assoc])) ?_ rfl ?_ + (by rw [pow_succ_list cw r]; simp only [List.append_assoc]) + · rw [← pow_add_list] + congr 1 + dsimp [supply_d] + omega + · rw [← pow_add_list] + congr 1 + omega + +theorem G_supply_digits (r : ℕ) : + SegRLs tm (hg ^ (64 * supply_d r + 61)) [] (tw ^ (10 + 2 * r)) + (kw ++ dw ++ cw ^ r ++ dw ^ 2) := by + have h1 := (G_Ts 3 (supply_d r)).concat (G_supply_pairs r) + have h2 := G_last61.concat (.nil (cw ^ r ++ dw ^ 2)) + refine SegRLs.congr (SegRLs.trans_eq h1 h2 (by simp only [List.append_assoc])) ?_ rfl ?_ rfl + · rw [← pow_add_list] + congr 1 + omega + · rw [← pow_add_list] + congr 1 + omega + +theorem G2_KK : SegRLs tm (hg ^ 2) [] (kw ++ kw) cw := + SegRLs.congr ((G_K.concat (.nil kw)).trans (G_J.concat F_K)) (by rfl) rfl rfl rfl + +def supply_g (r : ℕ) : ℕ := 2 * 4 ^ (10 + 2 * r) + 64 * supply_d r + 61 + +theorem pow_add2_eq {α : Type} (l : List α) {a b d : ℕ} (h : a + b = d) : + l ^ a ++ l ^ b = l ^ d := by + subst h + rw [← pow_add_list] + +theorem pow_add3_eq {α : Type} (l : List α) {a b c d : ℕ} (h : a + (b + c) = d) : + l ^ a ++ (l ^ b ++ l ^ c) = l ^ d := by + subst h + rw [← pow_add_list, ← pow_add_list] + +theorem G_SUPPLY (r : ℕ) : + SegRLs tm (hg ^ (supply_g r)) [] (tw ^ (10 + 2 * r) ++ kw ++ kw) + (kw ++ dw ++ cw ^ r ++ dw ^ 2 ++ cw) := by + have h1 := (G_Ts (10 + 2 * r) 2).concat G2_KK + have h2 := (G_supply_digits r).concat (.nil cw) + refine SegRLs.congr (h1.trans h2) ?_ rfl (by simp only [List.append_assoc]) + (by simp only [List.append_assoc]) + exact pow_add2_eq hg (by unfold supply_g; omega) + +def supply_f (r n : ℕ) : ℕ := + 8 * q4 (n + 11 + 2 * r) + 1 + (29 + 96 * q4 n + 2 * supply_g r * 4 ^ (2 + n)) + +theorem SUPPLY (r n : ℕ) : + SegRLs tm (hf ^ (supply_f r n)) [] + (zw ++ lw ++ tw ^ (n + 11 + 2 * r) ++ zw ++ kw) + (zw ++ jw ++ lw ++ mw ^ n ++ rw ++ dw ++ cw ^ r ++ dw ^ 2 ++ cw) := by + have h1 := (BIN (n + 11 + 2 * r)).concat (.nil (zw ++ kw)) + have h2 := (F_outer (n + 11 + 2 * r)).concat (H_Z.concat (.nil kw)) + have h3_right := SegRLs.trans_eq (G_SUPPLY r) (F_K.concat (.nil (dw ++ cw ^ r ++ dw ^ 2 ++ cw))) + (by simp only [List.append_assoc]) + have h3 := (NEAR_WRAP n (supply_g r)).concat h3_right + have h12 := SegRLs.trans_eq h1 h2 (by simp only [List.append_assoc]) + have h123 := SegRLs.trans_eq h12 h3 (by + rw [show 2 + (n + 11 + 2 * r) = (3 + n) + (10 + 2 * r) by omega, pow_add_list] + simp only [List.append_assoc]) + refine SegRLs.congr h123 ?_ rfl (by simp only [List.append_assoc]) + (by simp only [List.append_assoc]) + rw [← pow_succ_list', ← pow_add_list] + rfl + +def q16 : ℕ → ℕ + | 0 => 0 + | k + 1 => 1 + 16 * q16 k + +theorem q16_pow (n : ℕ) : 1 + 15 * q16 n = 16 ^ n := by + induction n with + | zero => rfl + | succ n ih => + dsimp [q16] + rw [Nat.pow_succ] + omega + +theorem pow4_double (n : ℕ) : 4 ^ (2 * n) = 16 ^ n := by + induction n with + | zero => rfl + | succ n ih => + rw [show 2 * (n + 1) = 2 * n + 2 by omega, Nat.pow_add, ih, Nat.pow_succ] + rfl + +theorem EVEN_END : SegRLs tm (hg ^ 8) (hg ++ hh) (tw ++ zw) (tw ^ 2) := by + have h1 := G3_T.concat F_Z + have h2 := G_L.concat H_T + have h3 := G2_T.concat (.nil lw) + have h4 := G_J.concat F_L + have h5 := G_L.concat H_M + exact SegRLs.congr (h1.trans (h2.trans (h3.trans (h4.trans h5)))) + (by rfl) (by rfl) rfl (by rfl) + +theorem ODD_END : SegRLs tm (hg ^ 8) hf (tw ++ zw ++ tw) (tw ^ 3) := by + have h := EVEN_END.concat (G_T.trans H_K) + exact SegRLs.congr h rfl rfl rfl (by rfl) + +theorem SHIFT : SegRLs tm (hg ^ 8) [] (tw ++ zw ++ tw ^ 2) (tw ^ 3 ++ zw) := by + have h := ODD_END.concat F_T + exact SegRLs.congr h rfl rfl rfl rfl + +theorem SHIFTS (r : ℕ) : + SegRLs tm (hg ^ (8 * q16 r)) [] (tw ++ zw ++ tw ^ (2 * r)) (tw ^ (1 + 2 * r) ++ zw) := by + induction r with + | zero => exact .nil (tw ++ zw) + | succ r ih => + have h1 := SHIFT.concat (.nil (tw ^ (2 * r))) + have h2 := (G_Ts 2 (8 * q16 r)).concat ih + refine SegRLs.congr (SegRLs.trans_eq h1 h2 ?_) ?_ rfl ?_ ?_ + · rw [show (3 : ℕ) = 2 + 1 from rfl, pow_add_list, pow_one_list] + simp only [List.append_assoc] + · rw [← pow_add_list] + congr 1 + dsimp [q16] + omega + · rw [show 2 * (r + 1) = 2 + 2 * r by omega, pow_add_list] + simp only [List.append_assoc] + · rw [show 1 + 2 * (r + 1) = 2 + (1 + 2 * r) by omega, pow_add_list tw 2 (1 + 2 * r)] + simp only [List.append_assoc] + +theorem G_Mstart (n : ℕ) : + SegRLs tm (hg ^ 2) hh (zw ++ jw ++ lw ++ mw ^ n) (tw ++ zw ++ tw ^ (1 + n)) := by + have h1 := G_Z.concat (G_J.concat (F_L.concat (.nil (mw ^ n)))) + have h2 := (G_Ls 1).concat (H_Ms (1 + n)) + refine SegRLs.congr (SegRLs.trans_eq h1 h2 (by rw [Nat.add_comm 1 n, pow_succ_list]; rfl)) + (by rfl) rfl (by simp only [List.append_assoc]) (by simp only [pow_one_list, List.append_assoc]) + +theorem M_ODD (r : ℕ) : + SegRLs tm (hg ^ (2 + 8 * q16 (2 + r))) (hh ++ hg ++ hh) + (zw ++ jw ++ lw ++ mw ^ (1 + 2 * r)) (tw ^ (4 + 2 * r)) := by + have h1 := G_Mstart (1 + 2 * r) + have h2 := SHIFTS (1 + r) + have h3 := (G_Ts (2 + 2 * r) 8).concat EVEN_END + have h12 := SegRLs.trans_eq h1 h2 (by rw [show 2 * (1 + r) = 1 + (1 + 2 * r) by omega]) + have h123 := SegRLs.trans_eq h12 h3 (by + rw [show 1 + 2 * (1 + r) = (2 + 2 * r) + 1 by omega, pow_add_list, pow_one_list] + simp only [List.append_assoc]) + refine SegRLs.congr h123 ?_ (by simp only [List.append_assoc, List.nil_append]) rfl + (by rw [show 4 + 2 * r = (2 + 2 * r) + 2 by omega, pow_add_list tw (2 + 2 * r) 2]) + rw [← pow_add_list, ← pow_add_list] + congr 1 + have hpow : 4 ^ (2 + 2 * r) = 16 ^ (1 + r) := by + rw [show 2 + 2 * r = 2 * (1 + r) by omega, pow4_double] + have hq := q16_pow (1 + r) + rw [hpow, show 2 + r = (1 + r) + 1 by omega] + dsimp [q16] + omega + +theorem GH_JC : SegRLs tm (hg ++ hh) [] (jw ++ cw) (zw ++ tw ++ jw) := by + have h1 := G_J.concat (F_L.concat (.nil rw)) + have h2 := H_L.concat (H_M.concat H_R) + exact SegRLs.congr (SegRLs.trans_eq h1 h2 rfl) rfl rfl rfl rfl + +theorem F_JC : SegRLs tm hf [] (jw ++ cw) (tw ++ mw ++ rw) := + SegRLs.congr (F_J.concat (F_L.concat (.nil rw))) rfl rfl rfl rfl + +theorem HGH_F : SegRLs tm (hh ++ hg ++ hh) [] (rw ++ dw) (zw ++ tw ^ 2 ++ jw) := by + have h1 := H_R.concat (.nil dw) + have h2 := G_J.concat (F_L.concat (.nil (mw ++ rw))) + have h3 := H_L.concat (H_M.concat (H_M.concat H_R)) + exact SegRLs.congr (SegRLs.trans_eq h1 (SegRLs.trans_eq h2 h3 rfl) rfl) rfl rfl rfl rfl + +theorem G_packet2 : SegRLs tm (hg ^ 2) [] (zw ++ tw ^ 2) (tw ^ 2 ++ zw) := + SegRLs.congr ((G_ZT 0).concat F_T) rfl rfl rfl rfl + +theorem PACKET162 : + SegRLs tm (hg ^ 162) [] (zw ++ tw ^ 2 ++ jw ++ cw ^ 2) (tw ^ 6 ++ mw ++ rw) := by + have h1 := G_packet2.concat (.nil (jw ++ cw ^ 2)) + have h2 := (G_Ts 1 8).concat (EVEN_END.concat (GH_JC.concat (.nil cw))) + have h3 := (G_Ts 2 8).concat (ODD_END.concat F_JC) + have h12 := SegRLs.trans_eq h1 h2 (by rfl) + have h123 := SegRLs.trans_eq h12 h3 (by rfl) + exact SegRLs.congr h123 (by rw [← pow_add_list, ← pow_add_list]; congr 1) rfl (by rfl) (by rfl) + +theorem PACKET (r : ℕ) : + SegRLs tm (hg ^ 2892) [] (zw ++ tw ^ 2 ++ jw ++ cw ^ (2 + r)) + (jw ^ 6 ++ mw ++ rw ++ cw ^ r) := by + have h1 := PACKET162.concat (.nil (cw ^ r)) + have h2 := (G_normalize 6).concat (.nil (mw ++ rw ++ cw ^ r)) + refine SegRLs.congr (SegRLs.trans_eq h1 h2 (by simp only [List.append_assoc])) + (by rw [← pow_add_list]; congr 1) rfl ?_ (by simp only [List.append_assoc]) + rw [pow_add_list] + simp only [List.append_assoc] + +theorem P_calls (n k : ℕ) (r s : ListBlank Γ) (H : SideRLs tm (hf ^ k) r s) : + (P n r) [tm]⊢* (P (n + k) s) := by + induction k generalizing n r with + | zero => + cases H + rw [Nat.add_zero] + try exact stepStar_refl tm _ + | succ k ih => + rw [pow_succ_list] at H + obtain ⟨r₁, H₁, H₂⟩ := H.split + refine stepStar_trans (stepPlus_to_stepStar (P_step n r r₁ H₁)) ?_ + refine stepStar_congr (ih (1 + n) r₁ H₂) rfl ?_ + rw [show 1 + n + k = n + (k + 1) by omega] + +theorem supply_balance (r : ℕ) : + 6 * supply_d r + 5 = 3 * q16 (2 + r) + 755 * 4 ^ (3 + 2 * r) := by + induction r with + | zero => rfl + | succ r ih => + rw [show 2 + (r + 1) = (2 + r) + 1 by omega, + show 3 + 2 * (r + 1) = (3 + 2 * r) + 2 by omega, Nat.pow_add] + dsimp [supply_d, q16] + omega + +theorem supply_g_balance (r : ℕ) : + 24 * supply_g r = 184 + 768 * q16 (2 + r) + 3827 * 4 ^ (7 + 2 * r) := by + have H := supply_balance r + have P7 : 4 ^ (7 + 2 * r) = 256 * 4 ^ (3 + 2 * r) := by + rw [show 7 + 2 * r = (3 + 2 * r) + 4 by omega, Nat.pow_add] + omega + have P10 : 4 ^ (10 + 2 * r) = 64 * 4 ^ (7 + 2 * r) := by + rw [show 10 + 2 * r = (7 + 2 * r) + 3 by omega, Nat.pow_add] + omega + unfold supply_g + omega + +theorem budget_algebra (a b c d x y g q : ℕ) + (Q0 : 1 + 3 * a = x) (Q1 : 1 + 3 * b = 4 * x) + (Q11 : 1 + 3 * c = 256 * (x * y)) (Q8 : 1 + 3 * d = 4 * (x * y)) + (G : x * (24 * g) = x * (184 + 768 * q + 3827 * y)) : + 1 + (8 * c + 1 + (29 + 96 * a + 2 * g * (16 * x))) = + 2 + 16 * b + 2 * (2 + 8 * q) * (64 * x) + 2 * 2892 * (x * y) + d := by + nlinarith + +theorem supply_budget (r n : ℕ) : + 1 + supply_f r n = + 2 + 16 * q4 (1 + n) + 2 * (2 + 8 * q16 (2 + r)) * 4 ^ (3 + n) + + 2 * 2892 * 4 ^ (7 + n + 2 * r) + q4 (8 + n + 2 * r) := by + have P1 : 4 ^ (1 + n) = 4 * 4 ^ n := by rw [Nat.add_comm 1 n, Nat.pow_succ]; ring + have P2 : 4 ^ (2 + n) = 16 * 4 ^ n := by rw [Nat.add_comm 2 n, Nat.pow_add]; ring + have P3 : 4 ^ (3 + n) = 64 * 4 ^ n := by rw [Nat.add_comm 3 n, Nat.pow_add]; ring + have P7 : 4 ^ (7 + n + 2 * r) = 4 ^ n * 4 ^ (7 + 2 * r) := by + rw [show 7 + n + 2 * r = n + (7 + 2 * r) by omega, Nat.pow_add] + have P8 : 4 ^ (8 + n + 2 * r) = 4 * (4 ^ n * 4 ^ (7 + 2 * r)) := by + rw [show 8 + n + 2 * r = (7 + n + 2 * r) + 1 by omega, Nat.pow_succ, P7]; ring + have P11 : 4 ^ (n + 11 + 2 * r) = 256 * (4 ^ n * 4 ^ (7 + 2 * r)) := by + rw [show n + 11 + 2 * r = (7 + n + 2 * r) + 4 by omega, Nat.pow_add, P7]; ring + have Q0 := q4_pow n + have Q1 := q4_pow (1 + n); rw [P1] at Q1 + have Q11 := q4_pow (n + 11 + 2 * r); rw [P11] at Q11 + have Q8 := q4_pow (8 + n + 2 * r); rw [P8] at Q8 + have G := congrArg (fun z => 4 ^ n * z) (supply_g_balance r) + unfold supply_f + rw [P2, P3, P7] + exact budget_algebra _ _ _ _ _ _ _ _ Q0 Q1 Q11 Q8 G + +def e (a b : ℕ) : ℕ := + 11 + 4 * q4 (24 + 2 * a + 2 * b) + 48 * q4 (7 + 2 * b) + + supply_g (3 + a) * 4 ^ (9 + 2 * b) + +theorem supply_index (a b : ℕ) : supply_f (3 + a) (7 + 2 * b) = 8 + 2 * e a b := by + unfold supply_f e + rw [show 7 + 2 * b + 11 + 2 * (3 + a) = 24 + 2 * a + 2 * b by omega, + show 2 + (7 + 2 * b) = 9 + 2 * b by omega] + ring + +theorem family_budget (a b : ℕ) : + 2 + 16 * q4 (8 + 2 * e a b) + + 2 * (2 + 8 * q16 (5 + b)) * 4 ^ (10 + 2 * e a b) + + 2 * 2892 * 4 ^ (20 + 2 * e a b + 2 * b) + q4 (21 + 2 * e a b + 2 * b) = + 9 + 2 * e b (e a b) := by + have H := supply_budget (3 + b) (7 + 2 * e a b) + rw [supply_index] at H + rw [show 1 + (7 + 2 * e a b) = 8 + 2 * e a b by omega, + show 2 + (3 + b) = 5 + b by omega, + show 3 + (7 + 2 * e a b) = 10 + 2 * e a b by omega, + show 7 + (7 + 2 * e a b) + 2 * (3 + b) = 20 + 2 * e a b + 2 * b by omega, + show 8 + (7 + 2 * e a b) + 2 * (3 + b) = 21 + 2 * e a b + 2 * b by omega] at H + omega + +theorem service_tail {hs : List (DH0 Γ Λ × DH0 Γ Λ)} {u v : List Γ} (w : List Γ) + (H : SegRLs tm hs [] u v) : SegRLs tm hs [] (u ++ w) (v ++ w) := + H.concat (.nil w) + +theorem F_T_service (n k : ℕ) {u v : List Γ} + (H : SegRLs tm (hg ^ k) [] u v) : + SegRLs tm (hf ^ (2 * k * 4 ^ n)) [] (tw ^ (1 + n) ++ u) (tw ^ (1 + n) ++ v) := + (F_T_calls n k).concat H + +def family_word (a b : ℕ) : List Γ := + tw ++ lw ^ (9 + 2 * e a b) ++ kw ++ tw ++ lw ++ + tw ^ (24 + 2 * a + 2 * b) ++ zw ++ kw ++ tw ++ [O, O] + +def family_col (a b : ℕ) : List Γ := + tw ^ (11 + 2 * e a b) ++ zw ++ jw ++ lw ++ mw ^ (7 + 2 * b) ++ + rw ++ dw ++ cw ^ (3 + a) ++ dw ^ 2 ++ cw ++ tw ++ [O, O] + +def family_mid (a b : ℕ) : List Γ := + tw ^ (21 + 2 * e a b + 2 * b) ++ zw ++ tw ^ 2 ++ jw ++ + cw ^ (3 + a) ++ dw ^ 2 ++ cw ++ tw ++ [O, O] + +def family_end (a b : ℕ) : List Γ := + zw ++ jw ^ (26 + 2 * e a b + 2 * b) ++ mw ++ rw ++ + cw ^ (1 + a) ++ dw ^ 2 ++ cw ++ tw ++ [O, O] + +theorem family_column (a b : ℕ) : + SegRLs tm (hf ^ (2 + 16 * q4 (8 + 2 * e a b))) [] + (family_word a b) (family_col a b) := by + have h_sup := service_tail (tw ++ [O, O]) (SUPPLY (3 + a) (7 + 2 * b)) + have h_sup' : SegRLs tm (hf ^ (8 + 2 * e a b)) [] + (zw ++ (lw ++ tw ^ (24 + 2 * a + 2 * b) ++ zw ++ kw ++ tw ++ [O, O])) + (zw ++ jw ++ lw ++ mw ^ (7 + 2 * b) ++ rw ++ dw ++ cw ^ (3 + a) ++ dw ^ 2 ++ cw ++ tw ++ [O, O]) := by + refine SegRLs.congr h_sup (by rw [supply_index a b]) rfl ?_ (by simp only [List.append_assoc]) + rw [show 7 + 2 * b + 11 + 2 * (3 + a) = 24 + 2 * a + 2 * b by omega] + simp only [List.append_assoc] + have h_col := COLUMN (8 + 2 * e a b) + (lw ++ tw ^ (24 + 2 * a + 2 * b) ++ zw ++ kw ++ tw ++ [O, O]) + (zw ++ jw ++ lw ++ mw ^ (7 + 2 * b) ++ rw ++ dw ++ cw ^ (3 + a) ++ dw ^ 2 ++ cw ++ tw ++ [O, O]) + [] h_sup' + unfold family_word family_col + refine SegRLs.congr h_col rfl rfl ?_ ?_ + · rw [show 9 + 2 * e a b = 1 + (8 + 2 * e a b) by omega] + simp only [List.append_assoc] + · rw [show 11 + 2 * e a b = (8 + 2 * e a b) + 3 by omega] + simp only [List.append_assoc] + +theorem M_block (r : ℕ) : + SegRLs tm (hg ^ (2 + 8 * q16 (2 + r))) [] + (zw ++ jw ++ lw ++ mw ^ (1 + 2 * r) ++ rw ++ dw) + (tw ^ (4 + 2 * r) ++ zw ++ tw ^ 2 ++ jw) := by + have h := (M_ODD r).concat HGH_F + exact SegRLs.congr h rfl rfl (by simp only [List.append_assoc]) (by simp only [List.append_assoc]) + +theorem family_m (a b : ℕ) : + SegRLs tm (hf ^ (2 * (2 + 8 * q16 (5 + b)) * 4 ^ (10 + 2 * e a b))) [] + (family_col a b) (family_mid a b) := by + have h_mb := service_tail (cw ^ (3 + a) ++ dw ^ 2 ++ cw ++ tw ++ [O, O]) (M_block (3 + b)) + have h := F_T_service (10 + 2 * e a b) (2 + 8 * q16 (2 + (3 + b))) h_mb + unfold family_col family_mid + refine SegRLs.congr h ?_ rfl ?_ ?_ + · rw [show 2 + (3 + b) = 5 + b by omega] + · rw [show 11 + 2 * e a b = 1 + (10 + 2 * e a b) by omega, + show 7 + 2 * b = 1 + 2 * (3 + b) by omega] + simp only [List.append_assoc] + · rw [show 21 + 2 * e a b + 2 * b = (1 + (10 + 2 * e a b)) + (4 + 2 * (3 + b)) by omega, + pow_add_list tw (1 + (10 + 2 * e a b)) (4 + 2 * (3 + b))] + simp only [List.append_assoc] + +theorem family_finish (a b : ℕ) : + SegRLs tm (hf ^ (2 * 2892 * 4 ^ (20 + 2 * e a b + 2 * b) + q4 (21 + 2 * e a b + 2 * b))) [] + (family_mid a b) (family_end a b) := by + have h1 := F_T_service (20 + 2 * e a b + 2 * b) 2892 + (service_tail (dw ^ 2 ++ cw ++ tw ++ [O, O]) (PACKET (1 + a))) + have h2 := service_tail (jw ^ 6 ++ mw ++ rw ++ cw ^ (1 + a) ++ dw ^ 2 ++ cw ++ tw ++ [O, O]) + (F_normalize (20 + 2 * e a b + 2 * b)) + have h12 := SegRLs.trans_eq h1 h2 (by simp only [List.append_assoc]) + unfold family_mid family_end + refine SegRLs.congr h12 ?_ rfl ?_ ?_ + · exact pow_add2_eq hf (by rw [show 1 + (20 + 2 * e a b + 2 * b) = 21 + 2 * e a b + 2 * b by omega]) + · rw [show 21 + 2 * e a b + 2 * b = 1 + (20 + 2 * e a b + 2 * b) by omega, + show 3 + a = 2 + (1 + a) by omega] + simp only [List.append_assoc] + · rw [show 26 + 2 * e a b + 2 * b = (20 + 2 * e a b + 2 * b) + 6 by omega, + pow_add_list jw (20 + 2 * e a b + 2 * b) 6] + simp only [List.append_assoc] + +theorem family_services (a b : ℕ) : + SegRLs tm (hf ^ (9 + 2 * e b (e a b))) [] (family_word a b) (family_end a b) := by + have h := (family_column a b).trans ((family_m a b).trans (family_finish a b)) + refine SegRLs.congr h ?_ rfl rfl rfl + exact pow_add3_eq hf (by have := family_budget a b; omega) + +def family_prefix (a : ℕ) : List Γ := + [I] ++ rw ++ cw ^ a ++ dw ^ 2 ++ cw ++ tw ++ [O, O] + +def family_after_zero (a b : ℕ) : List Γ := + tw ++ lw ^ (9 + 2 * e b (e a b)) ++ kw ++ tw ++ aw ++ + tw ^ (25 + 2 * e a b + 2 * b) ++ [I, O, I] ++ bw ++ rw ++ + cw ^ (1 + a) ++ dw ^ 2 ++ cw ++ tw ++ [O, O] + +theorem reset_recut (a k : ℕ) : + aw ++ tw ^ (1 + k) ++ [I, O, I] ++ bw ++ rw ++ cw ^ (1 + a) ++ dw ^ 2 ++ cw ++ tw ++ [O, O] = + lw ++ tw ^ k ++ zw ++ kw ++ tw ++ [O, O] ++ family_prefix a := by + unfold family_prefix + rw [Nat.add_comm 1 k, pow_succ_list, Nat.add_comm 1 a, pow_succ_list] + have hbw := bw_comm_T k + have haw : aw ++ tw ++ tw ^ k = lw ++ (bw ++ tw ^ k) := rfl + rw [← List.append_assoc aw tw (tw ^ k), haw, hbw] + simp only [List.append_assoc] + rfl + +theorem family_recut (a b : ℕ) : + family_after_zero a b = family_word b (e a b) ++ family_prefix a := by + unfold family_after_zero family_word + have h := reset_recut a (24 + 2 * b + 2 * e a b) + rw [show 25 + 2 * e a b + 2 * b = 1 + (24 + 2 * b + 2 * e a b) by omega] + simp only [List.append_assoc] at h ⊢ + rw [h] + +theorem P_service (n k : ℕ) (w1 w2 : List Γ) (u : ListBlank Γ) + (H : SegRLs tm (hf ^ k) [] w1 w2) : + (P n (w1 +> u)) [tm]⊢* (P (n + k) (w2 +> u)) := + P_calls n k (w1 +> u) (w2 +> u) (H.sideRLs_concat (.nil u)) + +theorem P_service_zero (k : ℕ) (w1 w2 : List Γ) (u : ListBlank Γ) + (H : SegRLs tm (hf ^ k) [] w1 w2) : + (P 0 (w1 +> u)) [tm]⊢* (P k (w2 +> u)) := by + have h := P_service 0 k w1 w2 u H + rwa [Nat.zero_add] at h + +theorem family_reset (a b : ℕ) (u : ListBlank Γ) : + (P (9 + 2 * e b (e a b)) (family_end a b +> u)) [tm]⊢⁺ + (P 0 (family_word b (e a b) +> (family_prefix a +> u))) := by + have h := zero_return (9 + 2 * e b (e a b)) (25 + 2 * e a b + 2 * b) + ((bw ++ rw ++ cw ^ (1 + a) ++ dw ^ 2 ++ cw ++ tw ++ [O, O]) +> u) + refine stepPlus_congr h ?_ ?_ + · unfold family_end + rw [show 26 + 2 * e a b + 2 * b = 1 + (25 + 2 * e a b + 2 * b) by omega] + simp only [append_assoc] + rfl + · rw [← append_assoc (family_word b (e a b)), ← family_recut a b] + unfold family_after_zero + simp only [append_assoc] + +def Inv (a b : ℕ) (u : ListBlank Γ) : Cfg Γ Λ := + P 0 (family_word a b +> u) + +theorem I_step (a b : ℕ) (u : ListBlank Γ) : + (Inv a b u) [tm]⊢⁺ (Inv b (e a b) (family_prefix a +> u)) := + stepStar_stepPlus_trans + (P_service_zero (9 + 2 * e b (e a b)) (family_word a b) (family_end a b) u + (family_services a b)) + (family_reset a b u) + +theorem tower_budget (a b : ℕ) : + 2 + 16 * q4 (8 + 2 * b) + 2 * (2 + 8 * q16 (5 + a)) * 4 ^ (10 + 2 * b) + + 2 * 2892 * 4 ^ (20 + 2 * a + 2 * b) + q4 (21 + 2 * a + 2 * b) = 9 + 2 * e a b := by + have H := supply_budget (3 + a) (7 + 2 * b) + rw [supply_index] at H + rw [show 1 + (7 + 2 * b) = 8 + 2 * b by omega, + show 2 + (3 + a) = 5 + a by omega, + show 3 + (7 + 2 * b) = 10 + 2 * b by omega, + show 7 + (7 + 2 * b) + 2 * (3 + a) = 20 + 2 * a + 2 * b by omega, + show 8 + (7 + 2 * b) + 2 * (3 + a) = 21 + 2 * a + 2 * b by omega] at H + omega + +def supply_count (n k j : ℕ) : ℕ := + 8 * q4 k + 1 + (4 * 4 ^ (1 + k) + (29 + 96 * q4 n + 2 * j * 4 ^ (2 + n))) + +theorem reset_supply (n k z j : ℕ) (u v w t : List Γ) (E_eq : k + 2 = 3 + n + z) + (H : SegRLs tm hh [] u v) (K : SegRLs tm (hg ^ 2) [] v w) + (L : SegRLs tm (hg ^ j ++ hf) [] (tw ^ z ++ w) t) : + SegRLs tm (hf ^ (supply_count n k j)) [] + (zw ++ lw ++ tw ^ k ++ u) (zw ++ jw ++ lw ++ mw ^ n ++ t) := by + have h1 := service_tail u (BIN k) + have h2 := (F_outer k).concat H + have h3 := F_T_service (1 + k) 2 K + have h4 := (NEAR_WRAP n j).concat L + have h12 := SegRLs.trans_eq h1 h2 (by simp only [List.append_assoc]) + have h123 := SegRLs.trans_eq h12 h3 (by rw [show 2 + k = 1 + (1 + k) by omega]) + have h1234 := SegRLs.trans_eq h123 h4 (by + rw [show 1 + (1 + k) = (3 + n) + z by omega, pow_add_list] + simp only [List.append_assoc]) + refine SegRLs.congr h1234 ?_ rfl (by simp only [List.append_assoc]) + (by simp only [List.append_assoc]) + rw [← pow_succ_list', ← pow_add_list, ← pow_add_list] + congr 1 + unfold supply_count + omega + +-- ============================================================================ +-- 4. Blank-Start Entrance for TM13 (`SOBCv13.v:1867-2440`) +-- ============================================================================ + +theorem entry_F5 : SegRLs tm (hf ^ 5) [] (zw ++ tw ^ 2) (tw ++ lw ++ zw) := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem entry_G4 : SegRLs tm (hg ^ 4) [] (tw ++ lw ++ zw) (tw ^ 2 ++ kw) := + BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide) + +theorem entry_G30 : SegRLs tm (hg ^ 30) [] (tw ++ lw ++ zw) (jw ^ 3) := by + have h1 := entry_G4 + have h2 := (G_Ts 2 1).concat G_K + have h3 := (G_normalize 2).concat (.nil jw) + exact SegRLs.congr (h1.trans (h2.trans h3)) + (by rw [← pow_add_list, ← pow_add_list]; congr 1) rfl rfl (by rfl) + +theorem G_append' (n k m : ℕ) (hm : 4 * n + k = m) (u v w : List Γ) + (H : SegRLs tm (hg ^ n) [] u v) + (H' : SegRLs tm (hg ^ k) [] (tw ++ v) w) : + SegRLs tm (hg ^ m) [] (tw ++ u) w := by + subst hm; exact G_append n k u v w H H' + +def entry10_calls : ℕ := 4 * (4 * (4 * 2431 + 3) + 3) + 2 + +theorem entry_G10 : SegRLs tm (hg ^ entry10_calls) [] (tw ^ 10) + (jw ++ lw ++ mw ^ 4 ++ rw ++ kw ++ jw ++ tw) := by + have H2 := G_append' 0 2 2 rfl tw tw (jw ++ tw) (.nil tw) + (BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide)) + have H3 := G_append' 2 1 9 rfl (tw ^ 2) (jw ++ tw) (kw ++ jw ++ tw) H2 + (BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide)) + have H4 := G_append' 9 1 37 rfl (tw ^ 3) (kw ++ jw ++ tw) (kw ++ kw ++ jw ++ tw) H3 + (BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide)) + have H5 := G_append' 37 3 151 rfl (tw ^ 4) (kw ++ kw ++ jw ++ tw) + (lw ++ rw ++ kw ++ jw ++ tw) H4 + (BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide)) + have H6 := G_append' 151 3 607 rfl (tw ^ 5) + (lw ++ rw ++ kw ++ jw ++ tw) (lw ++ mw ++ rw ++ kw ++ jw ++ tw) H5 + (BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide)) + have H7 := G_append' 607 3 2431 rfl (tw ^ 6) + (lw ++ mw ++ rw ++ kw ++ jw ++ tw) (lw ++ mw ^ 2 ++ rw ++ kw ++ jw ++ tw) H6 + (BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide)) + have H8 := G_append' 2431 3 9727 rfl (tw ^ 7) + (lw ++ mw ^ 2 ++ rw ++ kw ++ jw ++ tw) (lw ++ mw ^ 3 ++ rw ++ kw ++ jw ++ tw) H7 + (BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide)) + have H9 := G_append' 9727 3 38911 rfl (tw ^ 8) + (lw ++ mw ^ 3 ++ rw ++ kw ++ jw ++ tw) (lw ++ mw ^ 4 ++ rw ++ kw ++ jw ++ tw) H8 + (BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide)) + exact G_append' 38911 2 entry10_calls rfl (tw ^ 9) + (lw ++ mw ^ 4 ++ rw ++ kw ++ jw ++ tw) + (jw ++ lw ++ mw ^ 4 ++ rw ++ kw ++ jw ++ tw) H9 + (BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide)) + +def entry_b : List Γ := [I, O, O, I, O, O, O, I, O, I, I, O, O, I, I, O, I] +@[irreducible] def entry_first_calls : ℕ := 8 * q4 9 + 1 + (2 * entry10_calls + 1) + +theorem entry_first_service : SegRLs tm (hf ^ entry_first_calls) [] + (zw ++ lw ++ tw ^ 10 ++ [I, O, I]) + (zw ++ jw ++ lw ++ mw ^ 4 ++ rw ++ aw ++ entry_b) := by + have h1 := (BIN 9).concat (.nil (tw ++ [I, O, I])) + have h2 := (F_outer 9).concat (H_T.concat (.nil [I, O, I])) + have h3 := (F_T_calls 0 entry10_calls).concat (entry_G10.concat (.nil (lw ++ [I, O, I]))) + have h4 := F_T.concat (.nil (jw ++ lw ++ mw ^ 4 ++ rw ++ kw ++ jw ++ tw ++ lw ++ [I, O, I])) + have h12 := SegRLs.trans_eq h1 h2 (by rfl) + have h123 := SegRLs.trans_eq h12 h3 (by rfl) + have h1234 := SegRLs.trans_eq h123 h4 (by rfl) + refine SegRLs.congr h1234 ?_ rfl (by rfl) (by rfl) + rw [← pow_succ_list', ← pow_add_list, ← pow_succ_list'] + congr 1 + unfold entry_first_calls + rw [Nat.pow_zero] + omega + +def entry8_calls : ℕ := 4 * (4 * 1911 + 3) + 1 + +theorem entry_G8 : SegRLs tm (hg ^ entry8_calls) [] (tw ^ 8) (kw ++ dw ++ cw ^ 2) := by + have H2 := G7 + have H3 := G_append' 7 1 29 rfl (tw ^ 2) cw (kw ++ cw) H2 + (BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide)) + have H4 := G_append' 29 3 119 rfl (tw ^ 3) (kw ++ cw) (cw ^ 2) H3 + (BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide)) + have H5 := G_append' 119 1 477 rfl (tw ^ 4) (cw ^ 2) (kw ++ cw ^ 2) H4 + (BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide)) + have H6 := G_append' 477 3 1911 rfl (tw ^ 5) (kw ++ cw ^ 2) (cw ^ 3) H5 + (BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide)) + have H7 := G_append' 1911 3 7647 rfl (tw ^ 6) (cw ^ 3) (dw ++ cw ^ 2) H6 + (BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide)) + exact G_append' 7647 1 entry8_calls rfl (tw ^ 7) + (dw ++ cw ^ 2) (kw ++ dw ++ cw ^ 2) H7 + (BoundedConfig.segRLs_c_spec tm (T := 1000) (by decide)) + +def entry_clean_calls : ℕ := 2 + 8 * q16 2 + 8 * 4 ^ 4 + 2 * q4 8 + +theorem entry_clean : SegRLs tm (hg ^ entry_clean_calls) [] + (zw ++ jw ++ lw ++ mw ^ 4 ++ rw ++ aw) (jw ^ 8 ++ [O, O]) := by + have h1 := (G_Mstart 4).concat (H_R.concat (.nil aw)) + have h2 := (SHIFTS 2).concat (.nil (tw ++ jw ++ aw)) + have h3 := (G_Ts 4 8).concat (ODD_END.concat (F_J.concat F_A)) + have h4 := (G_normalize 8).concat (.nil [O, O]) + have h12 := SegRLs.trans_eq h1 h2 (by rfl) + have h123 := SegRLs.trans_eq h12 h3 (by rfl) + have h1234 := SegRLs.trans_eq h123 h4 (by rfl) + exact SegRLs.congr h1234 + (by rw [← pow_add_list, ← pow_add_list, ← pow_add_list]; rfl) + rfl (by rfl) (by rfl) + +@[irreducible] def entry_m : ℕ := 2 + 16 * q4 5 + 2 * 30 * 4 ^ 7 + q4 8 + +theorem entry_services : SegRLs tm (hf ^ entry_m) [] + (tw ++ lw ^ 6 ++ kw ++ tw ^ 3 ++ zw ++ [I]) (zw ++ jw ^ 10 ++ zw ++ [I]) := by + have h1 := COLUMN 5 (tw ^ 2 ++ zw ++ [I]) (tw ++ lw ++ zw ++ zw ++ [I]) [] + (SegRLs.congr (entry_F5.concat (.nil (zw ++ [I]))) rfl rfl (by rfl) (by rfl)) + have h2 := (F_T_calls 7 30).concat (entry_G30.concat (.nil (zw ++ [I]))) + have h3 := (F_normalize 7).concat (.nil (jw ^ 3 ++ zw ++ [I])) + have h12 := SegRLs.trans_eq h1 h2 (by rfl) + have h123 := SegRLs.trans_eq h12 h3 (by rfl) + refine SegRLs.congr h123 ?_ rfl (by rfl) (by rfl) + rw [show (1 + 7 : ℕ) = 8 from rfl, ← pow_add_list, ← pow_add_list] + unfold entry_m + rfl + +theorem entry_before_anchor : + (init []) [tm]⊢* (P entry_m (zw +> (jw ^ 10 +> (zw +> ([I] +> default))))) := by + refine stepStar_trans init_raw ?_ + have h := P_service_zero entry_m + (tw ++ lw ^ 6 ++ kw ++ tw ^ 3 ++ zw ++ [I]) + (zw ++ jw ^ 10 ++ zw ++ [I]) default entry_services + refine stepStar_congr h ?_ ?_ + · simp only [append_assoc] + · simp only [append_assoc] + +theorem entry_after_anchor : + (init []) [tm]⊢* + (P 0 (tw +> (lw ^ entry_m +> (kw +> (tw +> (aw +> (bw +> (tw ^ 10 +> ([I, O, I] +> default))))))))) := + stepStar_trans entry_before_anchor (stepPlus_to_stepStar (anchor_return entry_m 10)) + +theorem entry_m_count : entry_m = 1 + entry_first_calls := by + unfold entry_m entry_first_calls + decide + +@[irreducible] def entry_a0 : ℕ := 167 + 505 * 1000 + +theorem entry_m_odd : entry_m = 9 + 2 * entry_a0 := by + unfold entry_m entry_a0 + decide + +def entry_H_of (p : ℕ) : ℕ := 2 + 16 * q4 p +def entry_B_of (m p : ℕ) : ℕ := entry_H_of p + 2 * entry_clean_calls * 4 ^ (1 + m) + q4 (2 + m) +local notation "entry_H" => entry_H_of entry_first_calls +local notation "entry_B" => entry_B_of entry_m entry_first_calls + +theorem entry_m_first : entry_m = 1 + entry_first_calls := entry_m_count + +theorem entry_second_services_gen (m p : ℕ) + (hm : m = 1 + p) + (h_first : SegRLs tm (hf ^ p) [] + (zw ++ lw ++ tw ^ 10 ++ [I, O, I]) + (zw ++ jw ++ lw ++ mw ^ 4 ++ rw ++ aw ++ entry_b)) : + SegRLs tm (hf ^ (entry_B_of m p)) [] + (tw ++ lw ^ m ++ kw ++ tw ++ aw ++ bw ++ tw ^ 10 ++ [I, O, I]) + (zw ++ jw ^ (m + 9) ++ [O, O] ++ entry_b) := by + subst hm + unfold entry_B_of entry_H_of + have h1 := COLUMN p (lw ++ tw ^ 10 ++ [I, O, I]) + (zw ++ jw ++ lw ++ mw ^ 4 ++ rw ++ aw ++ entry_b) [] + (SegRLs.congr h_first rfl rfl (by simp only [List.append_assoc]) rfl) + have h2 := (F_T_calls (1 + (1 + p)) entry_clean_calls).concat + (entry_clean.concat (.nil entry_b)) + have h3 := (F_normalize (1 + (1 + p))).concat (.nil (jw ^ 8 ++ [O, O] ++ entry_b)) + have h1' : SegRLs tm (hf ^ (2 + 16 * q4 p)) [] + (tw ++ lw ^ (1 + p) ++ kw ++ tw ++ aw ++ bw ++ tw ^ 10 ++ [I, O, I]) + (tw ^ (1 + p + 2) ++ zw ++ jw ++ lw ++ mw ^ 4 ++ rw ++ aw ++ entry_b) := by + refine SegRLs.congr h1 rfl rfl ?_ ?_ + · have h_aw : aw ++ (bw ++ (tw ^ 10 ++ [I, O, I])) = lw ++ (tw ^ 10 ++ [I, O, I]) := rfl + simp only [List.append_assoc, h_aw] + · rw [show p + 3 = 1 + p + 2 by omega] + simp only [List.append_assoc] + have h2' : SegRLs tm (hf ^ (2 * entry_clean_calls * 4 ^ (1 + (1 + p)))) [] + (tw ^ (1 + p + 2) ++ zw ++ jw ++ lw ++ mw ^ 4 ++ rw ++ aw ++ entry_b) + (tw ^ (1 + p + 2) ++ jw ^ 8 ++ [O, O] ++ entry_b) := by + refine SegRLs.congr h2 rfl rfl ?_ ?_ + · rw [show 1 + (1 + (1 + p)) = 1 + p + 2 by omega] + simp only [List.append_assoc] + · rw [show 1 + (1 + (1 + p)) = 1 + p + 2 by omega] + simp only [List.append_assoc] + have h3' : SegRLs tm (hf ^ q4 (2 + (1 + p))) [] + (tw ^ (1 + p + 2) ++ jw ^ 8 ++ [O, O] ++ entry_b) + (zw ++ jw ^ (1 + p + 9) ++ [O, O] ++ entry_b) := by + refine SegRLs.congr h3 ?_ rfl ?_ ?_ + · rw [show 1 + (1 + (1 + p)) = 2 + (1 + p) by omega] + · rw [show 1 + (1 + (1 + p)) = 1 + p + 2 by omega] + simp only [List.append_assoc] + · rw [show 1 + p + 9 = (1 + (1 + p)) + 8 by omega, + pow_add_list jw (1 + (1 + p)) 8] + simp only [List.append_assoc] + refine SegRLs.congr ((h1'.trans h2').trans h3') ?_ rfl rfl rfl + rw [← pow_add_list, ← pow_add_list] + +theorem entry_second_services : SegRLs tm (hf ^ entry_B) [] + (tw ++ lw ^ entry_m ++ kw ++ tw ++ aw ++ bw ++ tw ^ 10 ++ [I, O, I]) + (zw ++ jw ^ (entry_m + 9) ++ [O, O] ++ entry_b) := + entry_second_services_gen entry_m entry_first_calls entry_m_first entry_first_service + +theorem entry_after_zero_gen (m B : ℕ) + (h_anch : (init []) [tm]⊢* + (P 0 (tw +> (lw ^ m +> (kw +> (tw +> (aw +> (bw +> (tw ^ 10 +> ([I, O, I] +> default)))))))))) + (h_sec : SegRLs tm (hf ^ B) [] + (tw ++ lw ^ m ++ kw ++ tw ++ aw ++ bw ++ tw ^ 10 ++ [I, O, I]) + (zw ++ jw ^ (m + 9) ++ [O, O] ++ entry_b)) : + (init []) [tm]⊢* + (P 0 (tw +> (lw ^ B +> (kw +> (tw +> (aw +> (tw ^ (m + 8) +> + ([I, O, I] +> (entry_b +> default))))))))) := by + have h_bef : (init []) [tm]⊢* + (P B (zw +> (jw ^ (m + 9) +> ([O, O] +> (entry_b +> default))))) := by + refine stepStar_trans h_anch ?_ + have h := P_service_zero B + (tw ++ lw ^ m ++ kw ++ tw ++ aw ++ bw ++ tw ^ 10 ++ [I, O, I]) + (zw ++ jw ^ (m + 9) ++ [O, O] ++ entry_b) default h_sec + refine stepStar_congr h ?_ ?_ + · simp only [append_assoc] + · simp only [append_assoc] + refine stepStar_trans h_bef ?_ + have h := zero_return B (m + 8) (entry_b +> default) + rw [show 1 + (m + 8) = m + 9 by omega] at h + exact stepPlus_to_stepStar h + +theorem entry_after_zero : + (init []) [tm]⊢* + (P 0 (tw +> (lw ^ entry_B +> (kw +> (tw +> (aw +> (tw ^ (entry_m + 8) +> + ([I, O, I] +> (entry_b +> default))))))))) := + entry_after_zero_gen entry_m entry_B entry_after_anchor entry_second_services + +def entry_b0_of (m : ℕ) : ℕ := 501 + 183 * 1000 + (522 + 550 * 1000) * q4 m +local notation "entry_b0" => entry_b0_of entry_m + +theorem q4_succ (n : ℕ) : q4 (1 + n) = 1 + 4 * q4 n := by + rw [Nat.add_comm 1 n] + rfl + +theorem second_budget_identity (m p : ℕ) (hm : m = 1 + p) : + entry_B_of m p = 9 + 2 * entry_b0_of m := by + subst hm + unfold entry_B_of entry_H_of entry_b0_of + have hc : entry_clean_calls = 876 + 45 * 1000 := by decide + rw [hc] + have P4 := q4_pow (1 + p) + have Q2 := q4_add 2 (1 + p) + have hpow : 4 ^ (1 + (1 + p)) = 4 * 4 ^ (1 + p) := by + rw [Nat.add_comm 1 (1 + p), Nat.pow_succ]; ring + have hq2 : q4 2 = 5 := rfl + have hp2 : 4 ^ 2 = 16 := rfl + have hq1 : q4 (1 + p) = 1 + 4 * q4 p := q4_succ p + rw [hq2, hp2] at Q2 + rw [hpow, Q2, hq1] + omega + +theorem entry_B_index : entry_B = 9 + 2 * entry_b0 := + second_budget_identity entry_m entry_first_calls entry_m_first + +def third_u0 : List Γ := zw ++ [I, I] +def third_u1 : List Γ := kw ++ [I, I] +def third_u2 : List Γ := lw ++ bw + +theorem third_H : SegRLs tm hh [] third_u0 third_u1 := + service_tail [I, I] H_Z + +theorem third_G2 : SegRLs tm (hg ^ 2) [] third_u1 third_u2 := + SegRLs.congr ((service_tail [I, I] G_K).trans (G_J.concat F_11)) (by rfl) rfl rfl rfl + +theorem third_G8F : + SegRLs tm (hg ^ entry8_calls ++ hf) [] + (tw ^ 8 ++ third_u2) (rw ++ dw ++ cw ^ 2 ++ third_u2) := by + have h1 := service_tail third_u2 entry_G8 + have h2 := F_K.concat (.nil (dw ++ cw ^ 2 ++ third_u2)) + exact SegRLs.congr (SegRLs.trans_eq h1 h2 (by simp only [List.append_assoc])) + rfl rfl rfl (by simp only [List.append_assoc]) + +def third_f (n : ℕ) : ℕ := + 8 * q4 (n + 9) + (1 + (4 * 4 ^ (n + 10) + (29 + 96 * q4 n + 2 * entry8_calls * 4 ^ (2 + n)))) + +def third_input (n : ℕ) : List Γ := zw ++ lw ++ tw ^ (n + 9) ++ third_u0 +def third_output (n : ℕ) : List Γ := zw ++ jw ++ lw ++ mw ^ n ++ rw ++ dw ++ cw ^ 2 ++ third_u2 + +theorem third_supply (n : ℕ) : + SegRLs tm (hf ^ (third_f n)) [] (third_input n) (third_output n) := by + have h := reset_supply n (n + 9) 8 entry8_calls third_u0 third_u1 third_u2 + (rw ++ dw ++ cw ^ 2 ++ third_u2) (by omega) third_H third_G2 third_G8F + unfold third_f third_input third_output + refine SegRLs.congr h ?_ rfl (by simp only [List.append_assoc]) (by simp only [List.append_assoc]) + congr 1 + unfold supply_count + rw [show 1 + (n + 9) = n + 10 by omega] + ring + +def third_source (a b : ℕ) : List Γ := + tw ++ lw ^ (9 + 2 * b) ++ kw ++ tw ++ lw ++ tw ^ (16 + 2 * a) ++ third_u0 + +def third_col (a b : ℕ) : List Γ := tw ^ (11 + 2 * b) ++ third_output (7 + 2 * a) + +def third_mid (a b : ℕ) : List Γ := + tw ^ (21 + 2 * a + 2 * b) ++ zw ++ tw ^ 2 ++ jw ++ cw ^ 2 ++ third_u2 + +def third_end (a b : ℕ) : List Γ := + zw ++ jw ^ (26 + 2 * a + 2 * b) ++ mw ++ rw ++ third_u2 + +theorem third_column (a b : ℕ) (H : third_f (7 + 2 * a) = 8 + 2 * b) : + SegRLs tm (hf ^ (2 + 16 * q4 (8 + 2 * b))) [] + (third_source a b) (third_col a b) := by + have h_sup : SegRLs tm (hf ^ (8 + 2 * b)) [] + (zw ++ (lw ++ tw ^ (16 + 2 * a) ++ third_u0)) (third_output (7 + 2 * a)) := by + refine SegRLs.congr (third_supply (7 + 2 * a)) (by rw [H]) rfl ?_ rfl + unfold third_input + rw [show 7 + 2 * a + 9 = 16 + 2 * a by omega] + simp only [List.append_assoc] + have h := COLUMN (8 + 2 * b) (lw ++ tw ^ (16 + 2 * a) ++ third_u0) + (third_output (7 + 2 * a)) [] h_sup + unfold third_source third_col + refine SegRLs.congr h rfl rfl ?_ ?_ + · rw [show 9 + 2 * b = 1 + (8 + 2 * b) by omega] + simp only [List.append_assoc] + · rw [show 11 + 2 * b = (8 + 2 * b) + 3 by omega] + +theorem third_m (a b : ℕ) : + SegRLs tm (hf ^ (2 * (2 + 8 * q16 (5 + a)) * 4 ^ (10 + 2 * b))) [] + (third_col a b) (third_mid a b) := by + have h := F_T_service (10 + 2 * b) (2 + 8 * q16 (2 + (3 + a))) + (service_tail (cw ^ 2 ++ third_u2) (M_block (3 + a))) + unfold third_col third_output third_mid + refine SegRLs.congr h ?_ rfl ?_ ?_ + · rw [show 2 + (3 + a) = 5 + a by omega] + · rw [show 11 + 2 * b = 1 + (10 + 2 * b) by omega, + show 7 + 2 * a = 1 + 2 * (3 + a) by omega] + simp only [List.append_assoc] + · rw [show 21 + 2 * a + 2 * b = (1 + (10 + 2 * b)) + (4 + 2 * (3 + a)) by omega, + pow_add_list tw (1 + (10 + 2 * b)) (4 + 2 * (3 + a))] + simp only [List.append_assoc] + +theorem third_finish (a b : ℕ) : + SegRLs tm (hf ^ (2 * 2892 * 4 ^ (20 + 2 * a + 2 * b) + q4 (21 + 2 * a + 2 * b))) [] + (third_mid a b) (third_end a b) := by + have h1 := F_T_service (20 + 2 * a + 2 * b) 2892 (service_tail third_u2 (PACKET 0)) + have h2 := service_tail (jw ^ 6 ++ mw ++ rw ++ third_u2) (F_normalize (20 + 2 * a + 2 * b)) + have h12 := SegRLs.trans_eq h1 h2 (by simp only [pow_zero_list, List.append_nil, List.append_assoc]) + unfold third_mid third_end + refine SegRLs.congr h12 ?_ rfl ?_ ?_ + · exact pow_add2_eq hf (by rw [show 1 + (20 + 2 * a + 2 * b) = 21 + 2 * a + 2 * b by omega]) + · rw [show 21 + 2 * a + 2 * b = 1 + (20 + 2 * a + 2 * b) by omega] + simp only [List.append_assoc] + · rw [show 26 + 2 * a + 2 * b = (20 + 2 * a + 2 * b) + 6 by omega, + pow_add_list jw (20 + 2 * a + 2 * b) 6] + simp only [List.append_assoc] + +theorem third_services (a b : ℕ) (H : third_f (7 + 2 * a) = 8 + 2 * b) : + SegRLs tm (hf ^ (9 + 2 * e a b)) [] (third_source a b) (third_end a b) := by + have h := (third_column a b H).trans ((third_m a b).trans (third_finish a b)) + refine SegRLs.congr h ?_ rfl rfl rfl + exact pow_add3_eq hf (by clear H h; have := tower_budget a b; omega) + +theorem third_recut (k : ℕ) : + aw ++ tw ^ (1 + k) ++ [I, O, I] ++ bw ++ rw ++ lw ++ bw = + lw ++ tw ^ k ++ zw ++ kw ++ tw ++ [O, O] ++ [I, O, I] := by + rw [Nat.add_comm 1 k, pow_succ_list] + have hbw := bw_comm_T k + have haw : aw ++ tw ++ tw ^ k = lw ++ (bw ++ tw ^ k) := rfl + rw [← List.append_assoc aw tw (tw ^ k), haw, hbw] + simp only [List.append_assoc] + rfl + +def third_after_zero (a b : ℕ) : List Γ := + tw ++ lw ^ (9 + 2 * e a b) ++ kw ++ tw ++ aw ++ + tw ^ (25 + 2 * a + 2 * b) ++ [I, O, I] ++ bw ++ rw ++ third_u2 + +theorem third_recut_family (a b : ℕ) : + third_after_zero a b = family_word a b ++ [I, O, I] := by + unfold third_after_zero third_u2 family_word + have h := third_recut (24 + 2 * a + 2 * b) + rw [show 25 + 2 * a + 2 * b = 1 + (24 + 2 * a + 2 * b) by omega] + simp only [List.append_assoc] at h ⊢ + rw [h] + +theorem third_reset (a b : ℕ) (u : ListBlank Γ) : + (P (9 + 2 * e a b) (third_end a b +> u)) [tm]⊢⁺ + (Inv a b ([I, O, I] +> u)) := by + have h := zero_return (9 + 2 * e a b) (25 + 2 * a + 2 * b) + ((bw ++ rw ++ third_u2) +> u) + refine stepPlus_congr h ?_ ?_ + · unfold third_end + rw [show 26 + 2 * a + 2 * b = 1 + (25 + 2 * a + 2 * b) by omega] + simp only [append_assoc] + rfl + · unfold Inv + rw [← append_assoc (family_word a b), ← third_recut_family a b] + unfold third_after_zero + simp only [append_assoc] + +theorem third_run (a b : ℕ) (u : ListBlank Γ) (H : third_f (7 + 2 * a) = 8 + 2 * b) : + (P 0 (third_source a b +> u)) [tm]⊢⁺ (Inv a b ([I, O, I] +> u)) := + stepStar_stepPlus_trans + (P_service_zero (9 + 2 * e a b) (third_source a b) (third_end a b) u + (third_services a b H)) + (third_reset a b u) + +theorem third_index_algebra (q0 q2 q9 x : ℕ) + (H0 : 1 + 3 * q0 = x) (H2 : 1 + 3 * q2 = 16 * x) + (H9 : 1 + 3 * q9 = (4 * 256 * 256) * x) : + 8 * q9 + (1 + (4 * ((16 * 256 * 256) * x) + + (29 + 96 * q0 + 2 * (4 * (4 * 1911 + 3) + 1) * (16 * x)))) = + 8 + 2 * (501 + 183 * 1000 + (522 + 550 * 1000) * q2) := by + omega + +theorem third_index (n : ℕ) : + third_f n = 8 + 2 * (501 + 183 * 1000 + (522 + 550 * 1000) * q4 (n + 2)) := by + have P2 : 4 ^ (n + 2) = 16 * 4 ^ n := by rw [Nat.pow_add]; ring + have P2' : 4 ^ (2 + n) = 16 * 4 ^ n := by rw [Nat.add_comm 2 n, Nat.pow_add]; ring + have P9 : 4 ^ (n + 9) = (4 * 256 * 256) * 4 ^ n := by rw [Nat.pow_add]; ring + have P10 : 4 ^ (n + 10) = (16 * 256 * 256) * 4 ^ n := by rw [Nat.pow_add]; ring + have H0 := q4_pow n + have H2 := q4_pow (n + 2); rw [P2] at H2 + have H9 := q4_pow (n + 9); rw [P9] at H9 + unfold third_f entry8_calls + rw [P10, P2'] + exact third_index_algebra _ _ _ _ H0 H2 H9 + +def entry_v : List Γ := [O, O, I, O, O, O, I, O, I, I, O, O, I, I, O, I] + +theorem entry_recut (k : ℕ) : + aw ++ tw ^ (1 + k) ++ [I, O, I] ++ entry_b = + lw ++ tw ^ k ++ third_u0 ++ entry_v := by + rw [Nat.add_comm 1 k, pow_succ_list] + have hbw := bw_comm_T k + have haw : aw ++ tw ++ tw ^ k = lw ++ (bw ++ tw ^ k) := rfl + rw [← List.append_assoc aw tw (tw ^ k), haw, hbw] + simp only [List.append_assoc] + rfl + +theorem entry_third_guard_gen (m a0 : ℕ) (hm : m = 9 + 2 * a0) : + third_f (7 + 2 * a0) = 8 + 2 * entry_b0_of m := by + subst hm + unfold entry_b0_of + rw [third_index, show 7 + 2 * a0 + 2 = 9 + 2 * a0 by omega] + +theorem entry_third_guard : third_f (7 + 2 * entry_a0) = 8 + 2 * entry_b0 := + entry_third_guard_gen entry_m entry_a0 entry_m_odd + +theorem entry_third_gen (m B a0 b0 : ℕ) + (hm : m = 9 + 2 * a0) + (hB : B = 9 + 2 * b0) + (h_zero : (init []) [tm]⊢* + (P 0 (tw +> (lw ^ B +> (kw +> (tw +> (aw +> (tw ^ (m + 8) +> + ([I, O, I] +> (entry_b +> default)))))))))) : + (init []) [tm]⊢* (P 0 (third_source a0 b0 +> (entry_v +> default))) := by + refine stepStar_congr h_zero rfl ?_ + have hrec := entry_recut (m + 7) + rw [show 1 + (m + 7) = m + 8 by omega] at hrec + have hrec' : (aw +> (tw ^ (m + 8) +> ([I, O, I] +> (entry_b +> (default : ListBlank Γ))))) = + (lw +> (tw ^ (m + 7) +> (third_u0 +> (entry_v +> default)))) := by + simpa only [append_assoc] using congrArg (· +> (default : ListBlank Γ)) hrec + unfold third_source + rw [hB, show 16 + 2 * a0 = m + 7 by omega] + simp only [append_assoc, hrec'] + +theorem entry_third : + (init []) [tm]⊢* (P 0 (third_source entry_a0 entry_b0 +> (entry_v +> default))) := + entry_third_gen entry_m entry_B entry_a0 entry_b0 entry_m_odd entry_B_index entry_after_zero + +theorem init_family : + (init []) [tm]⊢* (Inv entry_a0 entry_b0 ([I, O, I] +> (entry_v +> default))) := + stepStar_trans entry_third + (stepPlus_to_stepStar (third_run entry_a0 entry_b0 (entry_v +> default) entry_third_guard)) + +theorem init_family_target : + (init []) [target_tm]⊢* + flipCfg (Inv entry_a0 entry_b0 ([I, O, I] +> (entry_v +> default))) := by + have h := stepStar_flipTM init_family + rw [flipTM_flipTM] at h + exact h + +theorem I_step_target (a b : ℕ) (u : ListBlank Γ) : + (flipCfg (Inv a b u)) [target_tm]⊢⁺ + (flipCfg (Inv b (e a b) (family_prefix a +> u))) := by + have h := stepPlus_flipTM (I_step a b u) + rw [flipTM_flipTM] at h + exact h + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + refine Counter.does_not_halt_of_invariant + (Inv := fun c => ∃ a b u, c = flipCfg (Inv a b u)) + ⟨flipCfg (Inv entry_a0 entry_b0 ([I, O, I] +> (entry_v +> default))), + init_family_target, + entry_a0, entry_b0, [I, O, I] +> (entry_v +> default), rfl⟩ ?_ + rintro _ ⟨a, b, u, rfl⟩ + exact ⟨flipCfg (Inv b (e a b) (family_prefix a +> u)), + I_step_target a b u, + b, e a b, family_prefix a +> u, rfl⟩ + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1LE_1LC0RF_1LA0RD_1LC1RC_1LB0LB_HHH1RD diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LE_1LC1RD_0LA1LA_HHH1RE_1LF0LA_0LC0RF.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LE_1LC1RD_0LA1LA_HHH1RE_1LF0LA_0LC0RF.lean new file mode 100644 index 00000000..c7a1d718 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LE_1LC1RD_0LA1LA_HHH1RE_1LF0LA_0LC0RF.lean @@ -0,0 +1,270 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.SharedDonorsA + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RB1LE_1LC1RD_0LA1LA_HHH1RE_1LF0LA_0LC0RF + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LE_1LC1RD_0LA1LA_HHH1RE_1LF0LA_0LC0RF" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +open BusyBeaver.Counter +open TM1Donor + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +set_option maxRecDepth 2000000 +def phi : Fin 6 → Fin 6 + | 0 => 2 + | 1 => 0 + | 2 => 1 + | 3 => 3 + | 4 => 4 + | 5 => 5 + +def mirrorCfg (c : Cfg (Fin 2) (Fin 6)) : Cfg (Fin 2) (Fin 6) := + ⟨c.q.map phi, ⟨c.tape.1, c.tape.3, c.tape.2⟩⟩ + +theorem step_mirrorCfg (c : Cfg (Fin 2) (Fin 6)) : + step tm1 (mirrorCfg c) = (step target_tm c).map mirrorCfg := by + rcases c with ⟨_ | ⟨_ | _ | _ | _ | _ | _ | q, hq⟩, ⟨⟨_ | _ | h, hh⟩, l, r⟩⟩ <;> + first | rfl | omega + +theorem multiStep_mirrorCfg (n : Nat) (c : Cfg (Fin 2) (Fin 6)) : + multiStep tm1 (mirrorCfg c) n = (multiStep target_tm c n).map mirrorCfg := by + induction n generalizing c with + | zero => rfl + | succ n ih => + rw [multiStep_succ, multiStep_succ, step_mirrorCfg] + rcases step target_tm c with _ | c' + · rfl + · exact ih c' + +theorem reachesStar_mirrorCfg {c c' : Cfg (Fin 2) (Fin 6)} + (h : c [target_tm]⊢* c') : + (mirrorCfg c) [tm1]⊢* (mirrorCfg c') := by + rcases h with ⟨n, hn⟩ + refine ⟨n, ?_⟩ + rw [multiStep_mirrorCfg, hn] + rfl + +theorem isSome_step_of_mirrorCfg {c : Cfg (Fin 2) (Fin 6)} + (h : (step tm1 (mirrorCfg c)).isSome) : + (step target_tm c).isSome := by + rw [step_mirrorCfg, Option.isSome_map] at h + exact h + +def initC : Cfg (Fin 2) (Fin 6) := + (default : ListBlank (Fin 2)) {{(2 : Fin 6)}}> default + +theorem mirrorCfg_init : mirrorCfg (init []) = initC := + rfl + +-- 5. Stem `initC ⊢* Kr 976 17 34 22 9`, Transient to `Ev 6428 20`, and Goal +-- ============================================================================ + +def symInitC : SymState := ⟨.q2, .right, [], [], false⟩ + +def stem_mid0 : SymState := + mkSymKr (List.append gToks [SymTok.b1, SymTok.b1, SymTok.b1, SymTok.pow .w11 11 .v0, SymTok.b0, + SymTok.pow .w11 4 .v0, SymTok.b0, SymTok.pow .w11 1 .v0, SymTok.b0, SymTok.pow .w11 2 .v0, + SymTok.b0, SymTok.b0, SymTok.pow .w11 2 .v0, SymTok.b0, SymTok.pow .w11 1 .v0]) + +theorem stem_cert0 : checkSym false 5986 symInitC stem_mid0 = true := by + decide + +def symKr976 : SymState := + mkSymKr ( + segConst (G ++ [1]) 976 ++ + segConst [0] 17 ++ + segConst [0, 1, 1, 0] 34 ++ + segConst [0, 0, 0, 0, 0, 0, 1] 22 ++ + segConst [0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0] 9 ++ + krTailToks) + +def stem_mid1 : SymState := + mkSymKr (List.append gToks [SymTok.b1, SymTok.b1, SymTok.pow .w11 167 .v0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 10 .v0, SymTok.b0, + SymTok.b0, SymTok.pow .w11 2 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.b0, SymTok.b1, SymTok.pow .w11 9 .v0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, + SymTok.pow .w11 4 .v0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.pow .w11 1 .v0]) + +def stem_mid2 : SymState := + mkSymKr (List.append gToks [SymTok.b1, SymTok.b1, SymTok.pow .w11 281 .v0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 20 .v0, SymTok.b0, + SymTok.b0, SymTok.pow .w11 14 .v0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.pow .w11 1 .v0, SymTok.b0, SymTok.b1, SymTok.b1]) + +def stem_mid3 : SymState := + mkSymKr (List.append gToks [SymTok.b1, SymTok.b1, SymTok.pow .w11 401 .v0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b0, + SymTok.pow .w11 32 .v0, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 9 .v0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.pow .w11 2 .v0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b1, SymTok.pow .w11 7 .v0, SymTok.b0, SymTok.pow .w11 1 .v0, + SymTok.b0, SymTok.b1, SymTok.b1]) + +def stem_mid4 : SymState := + mkSymKr (List.append gToks [SymTok.b1, SymTok.b1, SymTok.pow .w11 539 .v0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 20 .v0, SymTok.b0, + SymTok.b0, SymTok.pow .w11 2 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.b0, SymTok.b1, SymTok.pow .w11 17 .v0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, + SymTok.pow .w11 11 .v0, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 1 .v0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b0, SymTok.pow .w11 1 .v0, SymTok.b0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 1 .v0, SymTok.b0, SymTok.b1, SymTok.b1]) + +def stem_mid5 : SymState := + mkSymKr (List.append gToks [SymTok.b1, SymTok.b1, SymTok.pow .w11 653 .v0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.pow .w11 3 .v0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, + SymTok.pow .w11 28 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.b1, SymTok.pow .w11 38 .v0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, + SymTok.pow .w11 2 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.pow .w11 3 .v0, SymTok.b0, SymTok.b1, SymTok.b1]) + +def stem_mid6 : SymState := + mkSymKr (List.append gToks [SymTok.b1, SymTok.b1, SymTok.pow .w11 775 .v0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 48 .v0, SymTok.b0, + SymTok.b0, SymTok.pow .w11 20 .v0, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, + SymTok.pow .w11 2 .v0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.pow .w11 9 .v0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.pow .w11 10 .v0]) + +def stem_mid7 : SymState := + mkSymKr (List.append gToks [SymTok.pow .w11 870 .v0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.pow .w11 34 .v0, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 1 .v0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b1, SymTok.pow .w11 23 .v0, SymTok.b0, + SymTok.pow .w11 22 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.pow .w11 3 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.b1, SymTok.pow .w11 4 .v0, SymTok.b0, SymTok.pow .w11 1 .v0, SymTok.b0, SymTok.b1, + SymTok.b1]) + +def stem_mid8 : SymState := + mkSymKr (List.append gToks [SymTok.b1, SymTok.b1, SymTok.pow .w11 955 .v0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 18 .v0, SymTok.b0, + SymTok.b0, SymTok.pow .w11 2 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.b0, SymTok.b1, SymTok.pow .w11 31 .v0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, + SymTok.pow .w11 22 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.pow .w11 3 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.b1, SymTok.pow .w11 9 .v0]) + +theorem stem_cert1 : checkMid true 8266 stem_mid0 stem_mid1 = true := by + decide + +theorem stem_cert2 : checkMid true 8218 stem_mid1 stem_mid2 = true := by + decide + +theorem stem_cert3 : checkMid true 8330 stem_mid2 stem_mid3 = true := by + decide + +theorem stem_cert4 : checkMid true 8520 stem_mid3 stem_mid4 = true := by + decide + +theorem stem_cert5 : checkMid true 8239 stem_mid4 stem_mid5 = true := by + decide + +theorem stem_cert6 : checkMid true 8570 stem_mid5 stem_mid6 = true := by + decide + +theorem stem_cert7 : checkMid true 8210 stem_mid6 stem_mid7 = true := by + decide + +theorem stem_cert8 : checkMid true 8598 stem_mid7 stem_mid8 = true := by + decide + +theorem stem_cert_end : checkSym true 1347 stem_mid8 symKr976 = true := by + decide + +theorem initC_to_kr976 : initC [tm1]⊢* Kr 976 17 34 22 9 := by + have h := + stepPlus_stepStar (stepStar_stepPlus_trans (stepPlus_stepStar (checkSym_sound 0 0 0 0 0 + stem_cert0)) (stepStar_stepPlus_trans (checkMid_sound 0 0 0 0 0 stem_cert1) + (stepStar_stepPlus_trans (checkMid_sound 0 0 0 0 0 stem_cert2) (stepStar_stepPlus_trans + (checkMid_sound 0 0 0 0 0 stem_cert3) (stepStar_stepPlus_trans (checkMid_sound 0 0 0 0 0 + stem_cert4) (stepStar_stepPlus_trans (checkMid_sound 0 0 0 0 0 stem_cert5) + (stepStar_stepPlus_trans (checkMid_sound 0 0 0 0 0 stem_cert6) (stepStar_stepPlus_trans + (checkMid_sound 0 0 0 0 0 stem_cert7) (stepStar_stepPlus_trans (checkMid_sound 0 0 0 0 0 + stem_cert8) (checkSym_sound 0 0 0 0 0 stem_cert_end)))))))))) + have h1 : evalState 0 0 0 0 0 symInitC = initC := rfl + have h2 : evalState 0 0 0 0 0 symKr976 = Kr 976 17 34 22 9 := by + simp only [symKr976, mkSymKr, krTailToks_eq, Kr, krRightList, evalState, evalQ, cfg_of, + List.append_assoc, evalHalf_segConst, evalHalf_map_bit_end, evalHalf, + listblank_append_assoc] + rwa [h1, h2] at h + +theorem kr976_to_ev : (Kr 976 17 34 22 9) [tm1]⊢* Ev 6428 20 := + stepStar_trans (S_iter 4 976 0 31 19 8) <| + stepStar_trans (stepPlus_stepStar (TO 1072 1 4 8)) <| + stepStar_trans (S_iter 4 1366 2 45 14 8) <| + stepStar_trans (stepPlus_stepStar (T6 1462 15 0 8)) <| + stepStar_trans (S_iter 6 1758 3 45 14 8) <| + stepStar_trans (stepPlus_stepStar (T8 1902 16 11)) <| + stepStar_trans (S_iter 5 2172 2 40 41 8) <| + stepStar_trans (stepPlus_stepStar (T6 2292 12 27 10)) <| + stepStar_trans (S_iter 12 2588 3 47 14 8) <| + stepStar_trans (stepPlus_stepStar (T8 2876 30 23)) <| + stepStar_trans (S_iter 9 3146 0 40 53 8) <| + stepStar_trans (stepPlus_stepStar (TO 3362 20 38 18)) <| + stepStar_trans (S_iter 17 3656 3 55 14 8) <| + stepStar_trans (stepPlus_stepStar (T8 4064 48 33)) <| + stepStar_trans (S_iter 13 4334 2 40 63 8) <| + stepStar_trans (stepPlus_stepStar (T6 4646 28 49 26)) <| + stepStar_trans (S_iter 22 4942 1 63 14 8) <| + stepStar_trans (stepPlus_stepStar (TE 5470 66 43)) <| + stepStar_trans (S_iter 16 5748 2 38 75 8) <| + stepPlus_stepStar (T6 6132 32 61 32) + +theorem initC_to_ev : initC [tm1]⊢* Ev 6428 20 := + stepStar_trans initC_to_kr976 kr976_to_ev + + +theorem neverHalts_ev6428 : NeverHaltsFrom tm1 (Ev 6428 20) := by + refine NeverHaltsFrom.of_reachesPlus_invariant (P := Inv) ?_ ⟨6428, 20, rfl⟩ + rintro _ ⟨N, X, rfl⟩ + exact ⟨Ev (48 * X + 716 + N) (4 + X), DC N X, 48 * X + 716 + N, 4 + X, rfl⟩ + +theorem neverHalts_initC : NeverHaltsFrom tm1 initC := by + obtain ⟨k₀, hk₀⟩ := initC_to_ev + intro cfg ⟨k, hk⟩ + rcases Nat.lt_or_ge k k₀ with hlt | hge + · rcases hstep_cfg : step tm1 cfg with _ | _ + · have hnone : (step tm1 cfg).isNone := by simp [hstep_cfg] + have hnone_k₀ : multiStep tm1 initC k₀ = none := by + have hsplit : k₀ = k + (k₀ - k) := by omega + rw [hsplit] + exact multiStep_eq_none_of_isNone hk hnone (by omega) + rw [hnone_k₀] at hk₀ + cases hk₀ + · rfl + · have hsplit : k = k₀ + (k - k₀) := by omega + rw [hsplit, multiStep_add, hk₀, Option.bind_some] at hk + exact neverHalts_ev6428 cfg ⟨k - k₀, hk⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg hreach + apply isSome_step_of_mirrorCfg + have hmir := reachesStar_mirrorCfg hreach + rw [mirrorCfg_init] at hmir + exact neverHalts_initC (mirrorCfg cfg) hmir + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1LE_1LC1RD_0LA1LA_HHH1RE_1LF0LA_0LC0RF diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LF_0RC0RB_0LD1LA_1LC0LE_0LAHHH_1LA1LF.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LF_0RC0RB_0LD1LA_1LC0LE_0LAHHH_1LA1LF.lean new file mode 100644 index 00000000..b7799a93 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LF_0RC0RB_0LD1LA_1LC0LE_0LAHHH_1LA1LF.lean @@ -0,0 +1,99 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.BB6.NonHalt.M_1RB1LD_1LC1RA_0LD0LC_0RE1RB_1RD0RF_0RBHHH + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.M_1RB1LF_0RC0RB_0LD1LA_1LC0LE_0LAHHH_1LA1LF + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LF_0RC0RB_0LD1LA_1LC0LE_0LAHHH_1LA1LF" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +open BusyBeaver.M_1RB1LD_1LC1RA_0LD0LC_0RE1RB_1RD0RF_0RBHHH.Solution + +theorem rule_left_carry (l r : ListBlank (Fin 2)) (j : Nat) : + (((l <+ ([0] : List (Fin 2))) <+ (([1] : List (Fin 2)) ^ (1 + j))) <{{A}} r) [target]⊢* + (l <{{A}} ((([1] : List (Fin 2)) ^ (2 + j)) +> r)) := by + have hj : 1 + j = j + 1 := by omega + rw [hj, pow_succ_list, ← listblank_append_append] + have h1 : ((((l <+ ([0] : List (Fin 2))) <+ (([1] : List (Fin 2)) ^ j)) <+ + ([1] : List (Fin 2))) <{{A}} r) [target]⊢* + (((l <+ ([0] : List (Fin 2))) <+ (([1] : List (Fin 2)) ^ j)) <{{F}} + (([1] : List (Fin 2)) +> r)) := by execute + have h2 : (((l <+ ([0] : List (Fin 2))) <+ (([1] : List (Fin 2)) ^ j)) <{{F}} + (([1] : List (Fin 2)) +> r)) [target]⊢* + ((l <+ ([0] : List (Fin 2))) <{{F}} + ((([1] : List (Fin 2)) ^ j) +> (([1] : List (Fin 2)) +> r))) := by + clear hj h1 + induction j generalizing r with + | zero => exact ⟨0, rfl⟩ + | succ j ih => + rw [pow_succ_list, ← listblank_append_append] + have hs : (((((l <+ ([0] : List (Fin 2))) <+ (([1] : List (Fin 2)) ^ j)) <+ + ([1] : List (Fin 2))) <{{F}} (([1] : List (Fin 2)) +> r))) [target]⊢* + (((l <+ ([0] : List (Fin 2))) <+ (([1] : List (Fin 2)) ^ j)) <{{F}} + (([1] : List (Fin 2)) +> (([1] : List (Fin 2)) +> r))) := by execute + have hi := ih (([1] : List (Fin 2)) +> r) + rw [listblank_append_append (([1] : List (Fin 2)) +> r) ([1] : List (Fin 2)) + (([1] : List (Fin 2)) ^ j), list_pow_append_one] at hi + exact stepStar_trans hs hi + have h3 : ((l <+ ([0] : List (Fin 2))) <{{F}} + ((([1] : List (Fin 2)) ^ j) +> (([1] : List (Fin 2)) +> r))) [target]⊢* + (l <{{A}} (([1] : List (Fin 2)) +> + ((([1] : List (Fin 2)) ^ j) +> (([1] : List (Fin 2)) +> r)))) := by execute + have hrew1 : ((([1] : List (Fin 2)) ^ j) +> (([1] : List (Fin 2)) +> r)) = + ((([1] : List (Fin 2)) ^ (j + 1)) +> r) := by + rw [listblank_append_append r ([1] : List (Fin 2)) (([1] : List (Fin 2)) ^ j), + list_pow_append_one] + have hrew2 : (([1] : List (Fin 2)) +> ((([1] : List (Fin 2)) ^ (j + 1)) +> r)) = + ((([1] : List (Fin 2)) ^ (2 + j)) +> r) := by + have : 2 + j = (j + 1) + 1 := by omega + rw [← pow_succ_append_right, this] + rw [hrew1] at h2 h3 + rw [hrew2] at h3 + exact stepStar_trans h1 (stepStar_trans h2 h3) + +theorem tm249_rules : PairCounter.Rules target B A C := + PairCounter.mkRules + (fun _ _ => by execute) + rule_left_carry + (fun _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ => by execute) + (fun _ _ => by execute) + +theorem tm249_init : + (init []) [target]⊢* ((default <+ ([1] : List (Fin 2))) {{B}}> PairCounter.right_tape 1 0) := by + unfold PairCounter.right_tape + execute + +public section + +theorem is_not_halt : IsNotHalt target := by + refine PairCounter.nonhalt_from tm249_rules tm249_init ?_ (PairCounter.Num.one + PairCounter.Num.nil) + exact PairCounter.Safe.main PairCounter.Normal.D ⟨by decide, fun _ => by decide⟩ + +end + +end BusyBeaver.M_1RB1LF_0RC0RB_0LD1LA_1LC0LE_0LAHHH_1LA1LF diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LF_1LC1RB_1RE1LD_1LB0LC_1LA0RE_1LDHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LF_1LC1RB_1RE1LD_1LB0LC_1LA0RE_1LDHHH.lean new file mode 100644 index 00000000..c30cedee --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LF_1LC1RB_1RE1LD_1LB0LC_1LA0RE_1LDHHH.lean @@ -0,0 +1,4903 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1LF_1LC1RB_1RE1LD_1LB0LC_1LA0RE_1LDHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LF_1LC1RB_1RE1LD_1LB0LC_1LA0RE_1LDHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option linter.unnecessarySimpa false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {zG_ zL_ α β γ : Type*} [Inhabited zG_] [Inhabited zL_] +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +local notation "zB" => ListBlank (Fin 2) +local notation "zF" => List (Fin 2) +def z00 : Machine (Fin 2) (Fin 6) + | 0,0 => some (some 1,Stmt.write 1 Dir.left) + | 0,1 => some (some 5,Stmt.write 1 Dir.right) + | 1,0 => some (some 2,Stmt.write 1 Dir.right) + | 1,1 => some (some 1,Stmt.write 1 Dir.left) + | 2,0 => some (some 4,Stmt.write 1 Dir.left) + | 2,1 => some (some 3,Stmt.write 1 Dir.right) + | 3,0 => some (some 1,Stmt.write 1 Dir.right) + | 3,1 => some (some 2,Stmt.write 0 Dir.right) + | 4,0 => some (some 0,Stmt.write 1 Dir.right) + | 4,1 => some (some 4,Stmt.write 0 Dir.left) + | 5,0 => some (some 3,Stmt.write 1 Dir.right) + | 5,1 => none +@[simp] theorem zMz (M : Machine zG_ zL_) (config : Cfg zG_ zL_) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine zG_ zL_) (config : Cfg zG_ zL_) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine zG_ zL_) (config : Cfg zG_ zL_) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +theorem z01 (M : Machine zG_ zL_) (config : Cfg zG_ zL_) (n : Nat) : + multiStep M config (n + 1) = Option.bind (step M config) (fun c' => multiStep M c' n) := by + induction n generalizing config with + | zero => simp [zMo,zMz] + | succ n ih => + rw [zMs,ih] + cases step M config <;> simp [zMs] +theorem zSm {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + (tm : Machine zG_ zL_) (c_1 c_2 : Cfg zG_ zL_) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z02 {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + (tm : Machine zG_ zL_) (c_1 c_2 : Cfg zG_ zL_) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢* c_2 := ⟨1,zSm tm c_1 c_2 h⟩ +theorem z03 {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + (tm : Machine zG_ zL_) (c_1 c_2 : Cfg zG_ zL_) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide +kernel,zSm tm c_1 c_2 h⟩ +theorem zMa {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + (tm : Machine zG_ zL_) (c_1 : Cfg zG_ zL_) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + (tm : Machine zG_ zL_) (c_1 c_2 c_3 : Cfg zG_ zL_) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem z04 {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} (c : Cfg zG_ zL_) : c [tm]⊢* c := ⟨0,rfl⟩ +theorem zSt {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 c_3 : Cfg zG_ zL_} + (h₁ : c_1 [tm]⊢* c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢* c_3 := by + obtain ⟨n,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem zPt {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 c_3 : Cfg zG_ zL_} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,_,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem zPs {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 : Cfg zG_ zL_} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem z05 {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 c_3 : Cfg zG_ zL_} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z06 {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 c_3 : Cfg zG_ zL_} + (h₁ : c_1 [tm]⊢* c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le m_pos (Nat.le_add_left m n),zMt tm c_1 c_2 c_3 n m hn hm⟩ +@[simp] theorem z07 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : zB).head = 0 := rfl +@[simp] theorem zDt : (default : zB).tail = default := rfl +@[simp] theorem head_cons (a : Fin 2) (s : zB) : (a >> s).head = a := ListBlank.head_cons a s +@[simp] theorem tail_cons (a : Fin 2) (s : zB) : (a >> s).tail = s := ListBlank.tail_cons a s +@[simp] theorem append_nil (s : zB) : ([] : zF) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : zF) (s : zB) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l₁ l₂ : zF) (s : zB) : + (l₁ ++ l₂) +> s = l₁ +> (l₂ +> s) := by + induction l₁ with + | nil => rfl + | cons a l₁ ih => simp [ih] +@[simp] theorem zPz (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem z08 (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +theorem z09 (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => simp [z08,Nat.succ_add,ih,List.append_assoc] +theorem z0a (l : List α) (n : Nat) : l ^ n ++ l = l ^ (n + 1) := by + induction n with + | zero => simp [z08] + | succ n ih => simp [z08,List.append_assoc,ih] +theorem z0b (a b : List α) (n : Nat) : (a ++ b) ^ n ++ a = a ++ (b ++ a) ^ n := by + induction n with + | zero => simp + | succ n ih => + rw [z08,List.append_assoc,ih,z08] + simp only [List.append_assoc] +theorem z0c (a b : zF) (i : Nat) (s : zB) : + a +> ((b ++ a) ^ i) +> (b +> s) = ((a ++ b) ^ (i + 1)) +> s := by + rw [<- append_assoc,<- append_assoc,<- z0b,List.append_assoc,z0a] +theorem z0d (w : List α) (b : Nat) : w ^ (b * 2) = (w ++ w) ^ b := by + induction b with + | zero => rfl + | succ b ih => + have h1 : (b + 1) * 2 = (b * 2 + 1) + 1 := by omega + rw [h1,z08,z08,ih,z08,List.append_assoc] +theorem z0e (w : List α) (b : Nat) : w ^ (b * 3) = (w ++ w ++ w) ^ b := by + induction b with + | zero => rfl + | succ b ih => + have h1 : (b + 1) * 3 = ((b * 3 + 1) + 1) + 1 := by omega + rw [h1,z08,z08,z08,ih,z08] + simp [List.append_assoc] +theorem z0f (w : List α) (b : Nat) : w ^ (b * 6) = (w ^ 6) ^ b := by + induction b with + | zero => rfl + | succ b ih => + have h1 : (b + 1) * 6 = 6 + b * 6 := by omega + rw [h1,z09,ih] + rfl +theorem z0g : ∀ (n : Nat),(([0] : zF) ^ n) +> (default : zB) = default + | 0 => rfl + | n + 1 => by simp [z08,z0g n] +theorem z0h (n : Nat) : 0 < 2 ^ n := Nat.two_pow_pos n +def z0i (d0 d1 : zF) : Nat -> Nat -> zB -> zB + | 0,_,r => r + | len + 1,n,r => (if n % 2 = 0 then d1 else d0) +> z0i d0 d1 len (n / 2) r +def z0j (d0 d1 : zF) : Nat -> zB + | 0 => default + | n + 1 => + let m := n + 1 + (if m % 2 = 0 then d0 else d1) +> z0j d0 d1 (m / 2) +theorem z0k (d0 d1 : zF) (n : Nat) (r : zB) : + z0i d0 d1 0 n r = r := rfl +theorem z0l (d0 d1 : zF) (len n : Nat) (r : zB) : + z0i d0 d1 (len + 1) (n * 2) r = d1 +> z0i d0 d1 len n r := by + simp only [z0i] + have h1 : (n * 2) % 2 = 0 := by omega + have h2 : (n * 2) / 2 = n := by omega + simp [h1,h2] +theorem z0m (d0 d1 : zF) (len n : Nat) (r : zB) : + z0i d0 d1 (len + 1) (n * 2 + 1) r = d0 +> z0i d0 d1 len n r := by + simp only [z0i] + have h1 : (n * 2 + 1) % 2 = 1 := by omega + have h2 : (n * 2 + 1) / 2 = n := by omega + simp [h1,h2] +theorem z0n (d0 d1 : zF) (len : Nat) (r : zB) : + z0i d0 d1 len 0 r = (d1 ^ len) +> r := by + induction len with + | zero => rfl + | succ len ih => + have h := z0l d0 d1 len 0 r + simp only [Nat.zero_mul] at h + rw [h,ih,z08,append_assoc] +theorem z0o (d0 d1 : zF) (len : Nat) (r : zB) : + z0i d0 d1 len (2 ^ len - 1) r = (d0 ^ len) +> r := by + induction len with + | zero => rfl + | succ len ih => + have hp := z0h len + have h1 : 2 ^ (len + 1) - 1 = (2 ^ len - 1) * 2 + 1 := by + rw [Nat.pow_succ]; omega + rw [h1,z0m,ih,z08,append_assoc] +theorem z0p (d0 d1 : zF) (len n i : Nat) (r : zB) : + z0i d0 d1 (len + i) (n * 2 ^ i) r = (d1 ^ i) +> z0i d0 d1 len n r := by + induction i with + | zero => simp + | succ i ih => + have h1 : len + (i + 1) = (len + i) + 1 := by omega + have h2 : n * 2 ^ (i + 1) = (n * 2 ^ i) * 2 := by rw [Nat.pow_succ,<- Nat.mul_assoc] + rw [h1,h2,z0l,ih,z08,append_assoc] +theorem z0q (d0 d1 : zF) (len n i : Nat) (r : zB) : + z0i d0 d1 (len + 1 + i) ((n * 2 + 1) * 2 ^ i - 1) r = + (d0 ^ i) +> d1 +> z0i d0 d1 len n r := by + induction i with + | zero => + have h1 : (n * 2 + 1) * 2 ^ 0 - 1 = n * 2 := by simp + simp [h1,z0l] + | succ i ih => + have hp := z0h i + have hpos : 1 <= (n * 2 + 1) * 2 ^ i := Nat.mul_pos (by omega) hp + have h1 : len + 1 + (i + 1) = (len + 1 + i) + 1 := by omega + have h2 : (n * 2 + 1) * 2 ^ (i + 1) - 1 = ((n * 2 + 1) * 2 ^ i - 1) * 2 + 1 := by + rw [Nat.pow_succ,<- Nat.mul_assoc] + omega + rw [h1,h2,z0m,ih,z08,append_assoc] +theorem z0r (d0 d1 : zF) : z0j d0 d1 0 = default := by simp [z0j] +theorem z0s (d0 d1 : zF) : z0j d0 d1 1 = d1 +> default := by simp [z0j] +theorem z0t {d0 d1 : zF} (hd0 : d0 +> default = default) (n : Nat) : + z0j d0 d1 (n * 2) = d0 +> z0j d0 d1 n := by + cases n with + | zero => simp [z0j,hd0] + | succ k => + conv_lhs => + rw [show (k + 1) * 2 = (k * 2 + 1) + 1 by omega] + unfold z0j + simp only [show (k * 2 + 1 + 1) % 2 = 0 by omega,show (k * 2 + 1 + 1) / 2 = k + 1 by omega,↓reduceIte] +theorem z0u (d0 d1 : zF) (n : Nat) : + z0j d0 d1 (n * 2 + 1) = d1 +> z0j d0 d1 n := by + simp only [z0j] + have h1 : (n * 2 + 1) % 2 = 1 := by omega + have h2 : (n * 2 + 1) / 2 = n := by omega + simp [h1,h2] +theorem z0v {d0 d1 : zF} (hd0 : d0 +> default = default) (n i : Nat) : + z0j d0 d1 (n * 2 ^ i) = (d0 ^ i) +> z0j d0 d1 n := by + induction i with + | zero => simp + | succ i ih => + have h1 : n * 2 ^ (i + 1) = (n * 2 ^ i) * 2 := by rw [Nat.pow_succ,<- Nat.mul_assoc] + rw [h1,z0t hd0,ih,z08,append_assoc] +theorem z0w {d0 d1 : zF} (hd0 : d0 +> default = default) (i : Nat) : + z0j d0 d1 (2 ^ i) = (d0 ^ i) +> d1 +> default := by + have h1 : 2 ^ i = 1 * 2 ^ i := by omega + rw [h1,z0v hd0,z0s] +theorem z0x (d0 d1 : zF) (len n : Nat) (r : zB) + (h : 1 + n < 2 ^ len) : + ∃ (i : Nat) (s : zB), + z0i d0 d1 len (1 + n) r = (d1 ^ i) +> d0 +> s /\ + z0i d0 d1 len n r = (d0 ^ i) +> d1 +> s := by + induction len generalizing n with + | zero => simp at h + | succ len ih => + have hp : 2 ^ (len + 1) = 2 ^ len * 2 := Nat.pow_succ 2 len + let k := n / 2 + rcases Nat.mod_two_eq_zero_or_one n with hn0 | hn1 + · have h_even : n = k * 2 := by omega + have h_odd : 1 + n = k * 2 + 1 := by omega + refine ⟨0,z0i d0 d1 len k r,?_,?_⟩ + · rw [h_odd,z0m]; rfl + · rw [h_even,z0l]; rfl + · have h_odd : n = k * 2 + 1 := by omega + have h_even : 1 + n = (1 + k) * 2 := by omega + have h_lt : 1 + k < 2 ^ len := by omega + rcases ih k h_lt with ⟨i,s,hi1,hi0⟩ + refine ⟨i + 1,s,?_,?_⟩ + · rw [h_even,z0l,hi1,z08,append_assoc] + · rw [h_odd,z0m,hi0,z08,append_assoc] +theorem z0y {d0 d1 : zF} (hd0 : d0 +> default = default) (n : Nat) : + ∃ (i : Nat) (s : zB), + z0j d0 d1 n = (d1 ^ i) +> d0 +> s /\ + z0j d0 d1 (1 + n) = (d0 ^ i) +> d1 +> s := by + induction n using Nat.strong_induction_on with + | h n ih => + let k := n / 2 + rcases Nat.mod_two_eq_zero_or_one n with hn0 | hn1 + · have h_even : n = k * 2 := by omega + have h_odd : 1 + n = k * 2 + 1 := by omega + refine ⟨0,z0j d0 d1 k,?_,?_⟩ + · rw [h_even,z0t hd0]; rfl + · rw [h_odd,z0u]; rfl + · have h_odd : n = k * 2 + 1 := by omega + have h_even : 1 + n = (1 + k) * 2 := by omega + have h_lt : k < n := by omega + rcases ih k h_lt with ⟨i,s,hi0,hi1⟩ + refine ⟨i + 1,s,?_,?_⟩ + · rw [h_odd,z0u,hi0,z08,append_assoc] + · rw [h_even,z0t hd0,hi1,z08,append_assoc] +def z0z' (tm : Machine (Fin 2) (Fin 6)) (p : Bool) (c0 c1 : Cfg (Fin 2) (Fin 6)) : Prop := + if p then c0 [tm]⊢⁺ c1 else c0 [tm]⊢* c1 +theorem z0A (tm : Machine (Fin 2) (Fin 6)) (b1 b2 b3 : Bool) + (c1 c2 c3 : Cfg (Fin 2) (Fin 6)) + (hb : (!b3 || (b1 || b2)) = true) + (h1 : z0z' tm b1 c1 c2) (h2 : z0z' tm b2 c2 c3) : + z0z' tm b3 c1 c3 := by + cases b1 <;> cases b2 <;> cases b3 + · exact zSt h1 h2 + · cases hb + · exact zSt h1 (zPs h2) + · exact z06 h1 h2 + · exact zSt (zPs h1) h2 + · exact z05 h1 h2 + · exact zPs (zPt h1 h2) + · exact zPt h1 h2 +theorem z0B (tm : Machine (Fin 2) (Fin 6)) (q : Fin 6) (l0 w0 w0' : zF) + (H : ∀ l r,((w0 +> l) <{{q}} (l0 +> r)) [tm]⊢* (l <{{q}} (l0 +> w0' +> r))) + (n : Nat) (l r : zB) : + (((w0 ^ n) +> l) <{{q}} (l0 +> r)) [tm]⊢* (l <{{q}} (l0 +> (w0' ^ n) +> r)) := by + induction n generalizing l r with + | zero => exact ⟨0,rfl⟩ + | succ n ih => + rw [z08,append_assoc] + have h1 := H ((w0 ^ n) +> l) r + have h2 := ih l (w0' +> r) + rw [<- append_assoc (w0' ^ n) w0' r,z0a] at h2 + exact zSt h1 h2 +theorem z0C (tm : Machine (Fin 2) (Fin 6)) (q : Fin 6) (l0 w0 w0' : zF) + (H : ∀ l r,((l0 +> l) {{q}}> (w0 +> r)) [tm]⊢* ((l0 +> w0' +> l) {{q}}> r)) + (n : Nat) (l r : zB) : + ((l0 +> l) {{q}}> ((w0 ^ n) +> r)) [tm]⊢* ((l0 +> (w0' ^ n) +> l) {{q}}> r) := by + induction n generalizing l r with + | zero => exact ⟨0,rfl⟩ + | succ n ih => + rw [z08,append_assoc] + have h1 := H l ((w0 ^ n) +> r) + have h2 := ih (w0' +> l) r + rw [<- append_assoc (w0' ^ n) w0' l,z0a] at h2 + exact zSt h1 h2 +@[simp] def dirBeq : Dir -> Dir -> Bool + | .left, .left => true + | .right, .right => true + | _, _ => false +theorem dirBeq_eq_true {a b : Dir} (h : dirBeq a b = true) : a = b := by + cases a <;> cases b <;> cases h <;> rfl +structure z0D where + l : zF + r : zF + s : Fin 6 + sgn : Dir +def z0D.zTcf (x : z0D) (l0 r0 : zB) : Cfg (Fin 2) (Fin 6) := + match x.sgn with + | .left => (x.r +> l0) <{{x.s}} (x.l +> r0) + | .right => (x.l +> l0) {{x.s}}> (x.r +> r0) +def z0D.step (tm : Machine (Fin 2) (Fin 6)) (x : z0D) : Option z0D := + match x.r with + | [] => none + | m :: r0 => + match tm x.s m with + | none => none + | some (some s',Stmt.write m' sgn') => + if dirBeq x.sgn sgn' then + some ⟨m' :: x.l,r0,s',sgn'⟩ + else + some ⟨m' :: r0,x.l,s',sgn'⟩ + | some (none,_) => none +def z0D.steps (tm : Machine (Fin 2) (Fin 6)) : Nat -> z0D -> Option z0D + | 0,x => + match z0D.step tm x with + | none => some x + | some _ => none + | n + 1,x => + match z0D.step tm x with + | none => some x + | some x' => z0D.steps tm n x' +theorem z0D.step_spec (tm : Machine (Fin 2) (Fin 6)) {x x' : z0D} + (h : z0D.step tm x = some x') (l0 r0 : zB) : + (z0D.zTcf x l0 r0) [tm]⊢ (z0D.zTcf x' l0 r0) := by + rcases x with ⟨l,_ | ⟨m,r⟩,s,sgn⟩ + · cases h + · dsimp [z0D.step] at h + cases htm : tm s m with + | none => rw [htm] at h; cases h + | some val => + rcases val with ⟨_ | s',m'd⟩ + · rw [htm] at h; cases h + · rcases m'd with ⟨m',sgn'⟩ + rw [htm] at h + cases sgn <;> cases sgn' <;> + · dsimp at h + injection h with h' + subst h' + simp [z0D.zTcf,BusyBeaver.step,htm,Tape.write,Tape.move] +theorem z0D.steps_spec (tm : Machine (Fin 2) (Fin 6)) : + ∀ (n : Nat) {x x' : z0D}, + z0D.steps tm n x = some x' -> + ∀ (l0 r0 : zB), + (z0D.zTcf x l0 r0) [tm]⊢* (z0D.zTcf x' l0 r0) + | 0,x,x',h,l0,r0 => by + dsimp [z0D.steps] at h + cases hs : z0D.step tm x with + | none => rw [hs] at h; injection h with h'; subst h'; exact ⟨0,rfl⟩ + | some _ => rw [hs] at h; cases h + | n + 1,x,x',h,l0,r0 => by + dsimp [z0D.steps] at h + cases hs : z0D.step tm x with + | none => rw [hs] at h; injection h with h'; subst h'; exact ⟨0,rfl⟩ + | some x1 => + rw [hs] at h + exact zSt + (z02 tm _ _ (z0D.step_spec tm hs l0 r0)) + (z0D.steps_spec tm n h l0 r0) +inductive vside where + | cons (h : Fin 2) (t : vside) + | app (h : zF) (n : Nat) (t : vside) + | zinf + | var (i : Nat) + deriving DecidableEq +inductive vconfig where + | L (l r : vside) (q : Fin 6) + | R (l r : vside) (q : Fin 6) + | mid (l r : vside) (m : Fin 2) (q : Fin 6) + deriving DecidableEq +@[simp] def zTs (nmp : Nat -> Nat) (smp : Nat -> zB) : vside -> zB + | .cons h t => h >> zTs nmp smp t + | .app h n t => (h ^ nmp n) +> zTs nmp smp t + | .zinf => default + | .var i => smp i +@[simp] def zTcf (nmp : Nat -> Nat) (smp : Nat -> zB) : vconfig -> Cfg (Fin 2) (Fin 6) + | .L l r q => (zTs nmp smp l) <{{q}} (zTs nmp smp r) + | .R l r q => (zTs nmp smp l) {{q}}> (zTs nmp smp r) + | .mid l r m q => ⟨some q,⟨m,zTs nmp smp l,zTs nmp smp r⟩⟩ +def z0E : vconfig -> vconfig + | .L (.cons m l) r q => .mid l r m q + | .L .zinf r q => .mid .zinf r 0 q + | .R l (.cons m r) q => .mid l r m q + | .R l .zinf q => .mid l .zinf 0 q + | x => x +theorem z0F (nmp : Nat -> Nat) (smp : Nat -> zB) (x : vconfig) : + zTcf nmp smp (z0E x) = zTcf nmp smp x := by + cases x with + | L l r q => cases l <;> simp [z0E,zTcf,zTs] + | R l r q => cases r <;> simp [z0E,zTcf,zTs] + | mid l r m q => rfl +def z0G (h : Fin 2) (t : vside) : vside := + match t with + | .zinf => if h == 0 then .zinf else .cons h t + | _ => .cons h t +theorem z0H (nmp : Nat -> Nat) (smp : Nat -> zB) (h : Fin 2) (x : vside) : + zTs nmp smp (z0G h x) = h >> zTs nmp smp x := by + cases x with + | zinf => + dsimp [z0G] + rcases h with ⟨_ | _ | h,hh⟩ + · simp [zTs] + · rfl + · omega + | _ => rfl +theorem z0I (h0 : Fin 2) (h1 : zF) (m : Nat) (s : zB) : + ((h0 :: h1) ^ m) +> (h0 >> s) = h0 >> (((h1 ++ [h0]) ^ m) +> s) := by + have h_eq : h0 >> s = [h0] +> s := rfl + rw [h_eq,<- append_assoc,show h0 :: h1 = [h0] ++ h1 from rfl,z0b [h0] h1 m,append_assoc] + rfl +def z0J' (h : zF) (n : Nat) : vside -> vside + | .cons h' t => + match h with + | [] => .app [] n (.cons h' t) + | h0 :: h1 => + if h0 == h' then .cons h0 (z0J' (h1 ++ [h0]) n t) + else .app (h0 :: h1) n (.cons h' t) + | x => .app h n x +theorem z0K (nmp : Nat -> Nat) (smp : Nat -> zB) + (h : zF) (n : Nat) (x : vside) : + zTs nmp smp (z0J' h n x) = zTs nmp smp (.app h n x) := by + induction x generalizing h with + | cons h' t ih => + cases h with + | nil => rfl + | cons h0 h1 => + dsimp [z0J'] + by_cases heq : h0 = h' + · subst heq + simp only [beq_self_eq_true,↓reduceIte,zTs,ih (h1 ++ [h0])] + exact (z0I h0 h1 (nmp n) (zTs nmp smp t)).symm + · have hbeq : (h0 == h') = false := beq_false_of_ne heq + simp [hbeq,zTs] + | _ => rfl +def z0J : vside -> vside + | .cons h t => z0G h (z0J t) + | .app h n t => z0J' h n (z0J t) + | x => x +theorem z0L (nmp : Nat -> Nat) (smp : Nat -> zB) (x : vside) : + zTs nmp smp (z0J x) = zTs nmp smp x := by + induction x with + | cons h t ih => + simp only [z0J,z0H,ih,zTs] + | app h n t ih => + simp only [z0J,z0K,zTs,ih] + | _ => rfl +def z0M : vconfig -> vconfig + | .L l r q => .L (z0J l) (z0J r) q + | .R l r q => .R (z0J l) (z0J r) q + | .mid l r m q => .mid (z0J l) (z0J r) m q +theorem z0N (nmp : Nat -> Nat) (smp : Nat -> zB) (x : vconfig) : + zTcf nmp smp (z0M x) = zTcf nmp smp x := by + cases x <;> simp [z0M,zTcf,z0L] +def z0O (tm : Machine (Fin 2) (Fin 6)) : vconfig -> Option vconfig + | .mid l r m q => + match tm q m with + | none => none + | some (some q',Stmt.write m' .left) => some (.L l (.cons m' r) q') + | some (some q',Stmt.write m' .right) => some (.R (.cons m' l) r q') + | some (none,_) => none + | _ => none +theorem z0P (tm : Machine (Fin 2) (Fin 6)) (nmp : Nat -> Nat) (smp : Nat -> zB) + {x x0 : vconfig} (h : z0O tm x = some x0) : + z0z' tm true (zTcf nmp smp x) (zTcf nmp smp x0) := by + cases x with + | mid l r m q => + dsimp [z0O] at h + cases htm : tm q m with + | none => rw [htm] at h; cases h + | some val => + rcases val with ⟨_ | q',m'd⟩ + · rw [htm] at h; cases h + · rcases m'd with ⟨m',_ | _⟩ + · rw [htm] at h; injection h with h'; subst h' + exact z03 tm _ _ (by simp [zTcf,zTs,step,htm,Tape.write,Tape.move]) + · rw [htm] at h; injection h with h'; subst h' + exact z03 tm _ _ (by simp [zTcf,zTs,step,htm,Tape.write,Tape.move]) + | _ => cases h +def z0Q (tm : Machine (Fin 2) (Fin 6)) : Nat -> vconfig -> vconfig -> Bool -> Option (vconfig × vconfig × Bool) + | 0,x,y,b => some (x,y,b) + | T + 1,x,y,b => + let x0 := z0E x + if (x0 == y) && (!b) then none + else + match z0O tm x0 with + | some x1 => z0Q tm T x1 y false + | none => some (x0,y,b) +theorem z0R (tm : Machine (Fin 2) (Fin 6)) (nmp : Nat -> Nat) (smp : Nat -> zB) : + ∀ (T : Nat) (x y : vconfig) (b : Bool), + match z0Q tm T x y b with + | none => z0z' tm b (zTcf nmp smp x) (zTcf nmp smp y) + | some (x',y',b') => + z0z' tm b' (zTcf nmp smp x') (zTcf nmp smp y') -> + z0z' tm b (zTcf nmp smp x) (zTcf nmp smp y) + | 0,x,y,b => id + | T + 1,x,y,b => by + dsimp only [z0Q] + set x0 := z0E x + have hx0 : zTcf nmp smp x0 = zTcf nmp smp x := z0F nmp smp x + by_cases hcond : ((x0 == y) && (!b)) = true + · simp only [hcond,↓reduceIte] + rw [Bool.and_eq_true,beq_iff_eq,Bool.not_eq_true'] at hcond + rcases hcond with ⟨rfl,rfl⟩ + rw [<- hx0] + exact ⟨0,rfl⟩ + · have hcond_f : ((x0 == y) && (!b)) = false := Bool.eq_false_iff.mpr hcond + simp only [hcond_f,Bool.false_eq_true,↓reduceIte] + cases hs : z0O tm x0 with + | none => + dsimp only + intro h + rwa [<- hx0] + | some x1 => + dsimp only + have hstep := z0P tm nmp smp hs + rw [hx0] at hstep + have ih := z0R tm nmp smp T x1 y false + cases h_rec : z0Q tm T x1 y false with + | none => + rw [h_rec] at ih + exact z0A tm true false b _ _ _ (by cases b <;> rfl) hstep ih + | some res => + rcases res with ⟨x',y',b'⟩ + rw [h_rec] at ih + intro h' + exact z0A tm true false b _ _ _ (by cases b <;> rfl) hstep (ih h') +def z0S : vside -> Nat -> Option (vside × zF) + | x,0 => some (x,[]) + | .cons h t,n + 1 => + match z0S t n with + | some (x0,x1) => some (x0,h :: x1) + | none => none + | .zinf,n + 1 => some (.zinf,([0] : zF) ^ (n + 1)) + | _,_ + 1 => none +def z0T : zF -> vside -> vside + | [],x0 => x0 + | h :: t,x0 => .cons h (z0T t x0) +abbrev vlit (w : zF) (t : vside) : vside := z0T w t +@[simp] theorem z0U (nmp : Nat -> Nat) (smp : Nat -> zB) + (seg : zF) (x0 : vside) : + zTs nmp smp (z0T seg x0) = seg +> zTs nmp smp x0 := by + induction seg with + | nil => rfl + | cons h t ih => simp [z0T,zTs,ih] +theorem z0V (nmp : Nat -> Nat) (smp : Nat -> zB) : + ∀ (n : Nat) (x x1 : vside) (x0 : zF), + z0S x n = some (x1,x0) -> + zTs nmp smp x = x0 +> zTs nmp smp x1 + | 0,x,x1,x0,h => by + cases x <;> { injection h with hpair; cases hpair; rfl } + | n + 1,.cons a t,x1,x0,h => by + dsimp [z0S] at h + cases hs : z0S t n with + | none => rw [hs] at h; cases h + | some pair => + rcases pair with ⟨x1',x0'⟩ + rw [hs] at h + injection h with hpair + cases hpair + have ih := z0V nmp smp n t _ _ hs + simp [zTs,ih] + | n + 1,.zinf,x1,x0,h => by + dsimp [z0S] at h + injection h with hpair + cases hpair + simp only [zTs] + exact (z0g (n + 1)).symm + | _ + 1,.app _ _ _,_,_,h => by cases h + | _ + 1,.var _,_,_,h => by cases h +def z0W (tm : Machine (Fin 2) (Fin 6)) (l0 : zF) (l1 r : vside) (q : Fin 6) (d : Dir) (T : Nat) : Option vconfig := + match r with + | .app r0 i r1 => + match z0D.steps tm T ⟨l0,r0,q,d⟩ with + | some ⟨l0',r0',q',d'⟩ => + if (dirBeq d d') && (q == q') && (r0' == []) && (l0'.take l0.length == l0) then + let l' := z0T l0 (.app (l0'.drop l0.length) i l1) + match d with + | .left => some (.L r1 l' q) + | .right => some (.R l' r1 q) + else none + | none => none + | _ => none +theorem z0X (tm : Machine (Fin 2) (Fin 6)) (nmp : Nat -> Nat) (smp : Nat -> zB) + {l0 : zF} {l1 r : vside} {q : Fin 6} {d : Dir} {T : Nat} {res : vconfig} + (h : z0W tm l0 l1 r q d T = some res) : + (zTcf nmp smp (match d with | .left => .L r (z0T l0 l1) q | .right => .R (z0T l0 l1) r q)) + [tm]⊢* (zTcf nmp smp res) := by + cases r with + | app r0 i r1 => + dsimp only [z0W] at h + cases hs : z0D.steps tm T ⟨l0,r0,q,d⟩ with + | none => rw [hs] at h; cases h + | some cfg' => + rcases cfg' with ⟨l0',r0',q',d'⟩ + rw [hs] at h + dsimp only at h + split_ifs at h with hcond + simp only [Bool.and_eq_true,beq_iff_eq] at hcond + rcases hcond with ⟨⟨⟨hd,rfl⟩,rfl⟩,htake⟩ + cases dirBeq_eq_true hd + have h_steps := z0D.steps_spec tm T hs + have h_split : l0 ++ l0'.drop l0.length = l0' := by + conv_rhs => rw [<- List.take_append_drop l0.length l0',htake] + cases d + · injection h with hres; subst hres + dsimp [zTcf,zTs] + rw [z0U,z0U] + dsimp [zTs] + refine z0B tm q l0 r0 (l0'.drop l0.length) (fun l' r' => ?_) (nmp i) + (zTs nmp smp r1) (zTs nmp smp l1) + have h1 := h_steps l' r' + dsimp [z0D.zTcf] at h1 + rwa [<- h_split,append_assoc] at h1 + · injection h with hres; subst hres + dsimp [zTcf,zTs] + rw [z0U,z0U] + dsimp [zTs] + refine z0C tm q l0 r0 (l0'.drop l0.length) (fun l' r' => ?_) (nmp i) + (zTs nmp smp l1) (zTs nmp smp r1) + have h1 := h_steps l' r' + dsimp [z0D.zTcf] at h1 + rwa [<- h_split,append_assoc] at h1 + | _ => cases h +def z0Y (tm : Machine (Fin 2) (Fin 6)) (l r : vside) (q : Fin 6) (d : Dir) : Nat -> Nat -> Nat -> Option vconfig + | 0,_,_ => none + | n + 1,n',T => + match z0S l n' with + | some (l1,l0) => + match z0W tm l0 l1 r q d T with + | some res => some res + | none => z0Y tm l r q d n (n' + 1) T + | none => none +theorem z0Z (tm : Machine (Fin 2) (Fin 6)) (nmp : Nat -> Nat) (smp : Nat -> zB) + (l r : vside) (q : Fin 6) (d : Dir) : + ∀ (n n' T : Nat) {res : vconfig}, + z0Y tm l r q d n n' T = some res -> + (zTcf nmp smp (match d with | .left => .L r l q | .right => .R l r q)) + [tm]⊢* (zTcf nmp smp res) + | 0,_,_,_,h => by cases h + | n + 1,n',T,res,h => by + dsimp [z0Y] at h + cases hs : z0S l n' with + | none => rw [hs] at h; cases h + | some pair => + rcases pair with ⟨l1,l0⟩ + rw [hs] at h + dsimp only at h + have hsplit := z0V nmp smp n' l l1 l0 hs + cases hc : z0W tm l0 l1 r q d T with + | some res' => + rw [hc] at h; injection h with h'; subst h' + have hchk := z0X tm nmp smp hc + cases d <;> + · dsimp [zTcf] at hchk ⊢ + rw [z0U,<- hsplit] at hchk + exact hchk + | none => + rw [hc] at h + exact z0Z tm nmp smp l r q d n (n' + 1) T h +def z10 (tm : Machine (Fin 2) (Fin 6)) (x : vconfig) (T : Nat) : Option vconfig := + match x with + | .L l r q => z0Y tm r l q .left T 0 T + | .R l r q => z0Y tm l r q .right T 0 T + | .mid _ _ _ _ => none +theorem z11 (tm : Machine (Fin 2) (Fin 6)) (nmp : Nat -> Nat) (smp : Nat -> zB) + {x res : vconfig} {T : Nat} (h : z10 tm x T = some res) : + z0z' tm false (zTcf nmp smp x) (zTcf nmp smp res) := by + cases x with + | L l r q => exact z0Z tm nmp smp r l q .left T 0 T h + | R l r q => exact z0Z tm nmp smp l r q .right T 0 T h + | mid _ _ _ _ => cases h +def z12 (tm : Machine (Fin 2) (Fin 6)) (x y : vconfig) (b : Bool) (T : Nat) : Option (vconfig × vconfig × Bool) := + z0Q tm T (z0M x) y b +theorem z13 (tm : Machine (Fin 2) (Fin 6)) (nmp : Nat -> Nat) (smp : Nat -> zB) + (x y : vconfig) (b : Bool) (T : Nat) : + match z12 tm x y b T with + | none => z0z' tm b (zTcf nmp smp x) (zTcf nmp smp y) + | some (x0,y0,b0) => + z0z' tm b0 (zTcf nmp smp x0) (zTcf nmp smp y0) -> + z0z' tm b (zTcf nmp smp x) (zTcf nmp smp y) := by + unfold z12 + have h := z0R tm nmp smp T (z0M x) y b + rw [z0N] at h + exact h +def z14 (tm : Machine (Fin 2) (Fin 6)) : Nat -> vconfig -> vconfig -> Bool -> Nat -> Nat -> Option (vconfig × vconfig × Bool) + | 0,x,y,b,_,_ => some (x,y,b) + | T_out + 1,x,y,b,T_step,T_sr => + match z12 tm x y b T_step with + | none => none + | some (x0,y0,b0) => + match z10 tm x0 T_sr with + | none => some (x0,y0,b0) + | some x1 => z14 tm T_out x1 y0 b0 T_step T_sr +theorem z15 (tm : Machine (Fin 2) (Fin 6)) (nmp : Nat -> Nat) (smp : Nat -> zB) : + ∀ (T_out : Nat) (x y : vconfig) (b : Bool) (T_step T_sr : Nat), + z14 tm T_out x y b T_step T_sr = none -> + z0z' tm b (zTcf nmp smp x) (zTcf nmp smp y) + | 0,_,_,_,_,_,h => by cases h + | T_out + 1,x,y,b,T_step,T_sr,h => by + dsimp [z14] at h + have her := z13 tm nmp smp x y b T_step + cases he : z12 tm x y b T_step with + | none => rw [he] at her; exact her + | some trip => + rcases trip with ⟨x0,y0,b0⟩ + rw [he] at h her + dsimp only at h her + cases hs : z10 tm x0 T_sr with + | none => rw [hs] at h; cases h + | some x1 => + rw [hs] at h + have hsr := z11 tm nmp smp hs + have ih := z15 tm nmp smp T_out x1 y0 b0 T_step T_sr h + exact her (z0A tm false b0 b0 _ _ _ (by cases b0 <;> rfl) hsr ih) +def z16 (tm : Machine (Fin 2) (Fin 6)) (x y : vconfig) (b : Bool) (T_out T_step T_sr : Nat) : Option (vconfig × vconfig × Bool) := + let y1 := z0E (z0M y) + z14 tm T_out x y1 b T_step T_sr +theorem z17 (tm : Machine (Fin 2) (Fin 6)) (nmp : Nat -> Nat) (smp : Nat -> zB) + (x y : vconfig) (b : Bool) (T_out T_step T_sr : Nat) + (h : z16 tm x y b T_out T_step T_sr = none) : + z0z' tm b (zTcf nmp smp x) (zTcf nmp smp y) := by + have h1 := z15 tm nmp smp T_out x (z0E (z0M y)) b T_step T_sr h + rwa [z0F,z0N] at h1 +abbrev o1 : zF := [1] +abbrev ld0 : zF := [0,1] +abbrev ld1 : zF := [1,1] +abbrev ldh : zB := [1] +> default +abbrev z : zF := [0,0,0] +abbrev d : zF := [1,0,0] +def z18 (l r : zB) : Cfg (Fin 2) (Fin 6) := + l <{{B}} ([1,1,1,0,0] +> r) +def z19 (l r : zB) : Cfg (Fin 2) (Fin 6) := + ([1,1,1,0,1] +> l) {{C}}> r +def z1a (a : Nat) : Nat -> Nat | 0 => a | _ => 0 +def z1b (a b : Nat) : Nat -> Nat | 0 => a | 1 => b | _ => 0 +def z1c (l : zB) : Nat -> zB | 0 => l | _ => default +def z1d (l r : zB) : Nat -> zB | 0 => l | 1 => r | _ => default +theorem z1e (b : Nat) (l : zB) : + (l {{D}}> ((o1 ^ (1 + b * 2)) +> z +> (o1 ^ 4) +> default)) [z00]⊢* + (z18 ((o1 ^ 5) +> (([1,0] ^ b) +> l)) default) := by + have h := z17 z00 (z1a b) (z1c l) + (.R (.var 0) (vlit [1] (.app [1,1] 0 (vlit [0,0,0,1,1,1,1] .zinf))) D) + (.L (vlit [1,1,1,1,1] (.app [1,0] 0 (.var 0))) (vlit [1,1,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1a,z1c,z18,z09,z0d,append_assoc] using h +theorem z1f (b c : Nat) (l : zB) : + (l {{D}}> ((o1 ^ (3 + b * 2)) +> z +> (o1 ^ (6 + c * 2)) +> default)) [z00]⊢* + (z19 ((ld0 ^ (4 + c)) +> [1] +> (([1,0] ^ b) +> l)) default) := by + have h := z17 z00 (z1b b c) (z1c l) + (.R (.var 0) (vlit [1,1,1] (.app [1,1] 0 (vlit [0,0,0,1,1,1,1,1,1] (.app [1,1] 1 .zinf)))) D) + (.R (vlit [1,1,1,0,1] (vlit (ld0 ^ 4) (.app ld0 1 (vlit [1] (.app [1,0] 0 (.var 0)))))) .zinf C) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1b,z1c,z19,z09,z0d,append_assoc] using h +theorem z1g (b c : Nat) (l : zB) : + (l {{D}}> ((o1 ^ (3 + b * 2)) +> z +> (o1 ^ (3 + c * 2)) +> default)) [z00]⊢* + (z18 ((ld0 ^ (2 + c)) +> [1] +> (([1,0] ^ b) +> l)) ([0,0,0,1,0,0] +> default)) := by + have h := z17 z00 (z1b b c) (z1c l) + (.R (.var 0) (vlit [1,1,1] (.app [1,1] 0 (vlit [0,0,0,1,1,1] (.app [1,1] 1 .zinf)))) D) + (.L (vlit (ld0 ^ 2) (.app ld0 1 (vlit [1] (.app [1,0] 0 (.var 0))))) (vlit [1,1,1,0,0,0,0,0,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1b,z1c,z18,z09,z0d,append_assoc] using h +theorem z1h (n : Nat) (l r : zB) : + (z18 ((ld1 ^ n) +> [1,0,1] +> l) r) [z00]⊢* + (((ld1 ^ 2) +> (ld0 ^ (1 + n)) +> ld1 +> l) {{D}}> r) := by + have h := z17 z00 (z1a n) (z1d l r) + (.L (.app ld1 0 (vlit [1,0,1] (.var 0))) (vlit [1,1,1,0,0] (.var 1)) B) + (.R (vlit (ld1 ^ 2) (vlit ld0 (.app ld0 0 (vlit ld1 (.var 0))))) (.var 1) D) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1a,z1d,z18,z09,append_assoc] using h +theorem z1i (h_idx : Nat) (l r : zB) : + (((ld1 ^ 2) +> (ld0 ^ 2) +> l) {{D}}> ((d ^ h_idx) +> z +> r)) [z00]⊢* + (z18 (ld0 +> l) ((z ^ (1 + h_idx)) +> [1] +> r)) := by + have h := z17 z00 (z1a h_idx) (z1d l r) + (.R (vlit (ld1 ^ 2) (vlit (ld0 ^ 2) (.var 0))) (.app d 0 (vlit z (.var 1))) D) + (.L (vlit ld0 (.var 0)) (vlit [1,1,1,0,0] (vlit z (.app z 0 (vlit [1] (.var 1))))) B) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1a,z1d,z18,z09,append_assoc] using h +theorem z1j (b c : Nat) (l : zB) : + (l {{D}}> ((o1 ^ (4 + b * 2)) +> z +> (o1 ^ (4 + c * 2)) +> default)) [z00]⊢* + (z19 ((ld0 ^ (1 + c)) +> ld1 +> [1,0,1,1] +> (([1,0] ^ b) +> l)) default) := by + have h := z17 z00 (z1b b c) (z1c l) + (.R (.var 0) (vlit [1,1,1,1] (.app [1,1] 0 (vlit [0,0,0,1,1,1,1] (.app [1,1] 1 .zinf)))) D) + (.R (vlit [1,1,1,0,1] (vlit ld0 (.app ld0 1 (vlit ld1 (vlit [1,0,1,1] (.app [1,0] 0 (.var 0))))))) .zinf C) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1b,z1c,z19,z09,z0d,append_assoc] using h +theorem z1k (b c : Nat) (l : zB) : + (l {{D}}> ((o1 ^ (4 + b * 2)) +> z +> (o1 ^ (5 + c * 2)) +> default)) [z00]⊢* + (z18 ((ld0 ^ (1 + c)) +> ld1 +> [1,0,1,1] +> (([1,0] ^ b) +> l)) ([0,0,0,1,0,0] +> default)) := by + have h := z17 z00 (z1b b c) (z1c l) + (.R (.var 0) (vlit [1,1,1,1] (.app [1,1] 0 (vlit [0,0,0,1,1,1,1,1] (.app [1,1] 1 .zinf)))) D) + (.L (vlit ld0 (.app ld0 1 (vlit ld1 (vlit [1,0,1,1] (.app [1,0] 0 (.var 0)))))) (vlit [1,1,1,0,0,0,0,0,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1b,z1c,z18,z09,z0d,append_assoc] using h +theorem z1l (b : Nat) (l : zB) : + (l {{D}}> ((o1 ^ (1 + b * 2)) +> [0,0,0,1,1] +> default)) [z00]⊢* + (z18 ((o1 ^ 3) +> (([1,0] ^ b) +> l)) default) := by + have h := z17 z00 (z1a b) (z1c l) + (.R (.var 0) (vlit [1] (.app [1,1] 0 (vlit [0,0,0,1,1] .zinf))) D) + (.L (vlit [1,1,1] (.app [1,0] 0 (.var 0))) (vlit [1,1,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1a,z1c,z18,z09,z0d,append_assoc] using h +theorem z1m (b : Nat) (l : zB) : + (l {{D}}> ((o1 ^ (4 + b * 2)) +> [0,0,0,1,1] +> default)) [z00]⊢* + (z18 (ld0 +> [1,0,1,1] +> (([1,0] ^ b) +> l)) default) := by + have h := z17 z00 (z1a b) (z1c l) + (.R (.var 0) (vlit [1,1,1,1] (.app [1,1] 0 (vlit [0,0,0,1,1] .zinf))) D) + (.L (vlit ld0 (vlit [1,0,1,1] (.app [1,0] 0 (.var 0)))) (vlit [1,1,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1a,z1c,z18,z09,z0d,append_assoc] using h +theorem z1n (a c : Nat) (l : zB) : + (((o1 ^ (4 + a * 2)) +> ld0 +> l) {{D}}> ([1,0,0,0] +> (o1 ^ (2 + c * 2)) +> default)) [z00]⊢* + (z18 ((ld0 ^ (3 + a + c)) +> ld1 +> l) ([0,0,0,1,0,0] +> default)) := by + rcases c with _ | _ | c + · have h := z17 z00 (z1a a) (z1c l) + (.R (vlit [1,1,1,1] (.app [1,1] 0 (vlit ld0 (.var 0)))) (vlit [1,0,0,0,1,1] .zinf) D) + (.L (vlit (ld0 ^ 3) (.app ld0 0 (vlit ld1 (.var 0)))) (vlit [1,1,1,0,0,0,0,0,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1a,z1c,z18,z09,z0d,append_assoc] using h + · have h := z17 z00 (z1a a) (z1c l) + (.R (vlit [1,1,1,1] (.app [1,1] 0 (vlit ld0 (.var 0)))) (vlit [1,0,0,0,1,1,1,1] .zinf) D) + (.L (vlit (ld0 ^ 4) (.app ld0 0 (vlit ld1 (.var 0)))) (vlit [1,1,1,0,0,0,0,0,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + have h1 : 3 + a + 1 = 4 + a := by omega + rw [h1] + simpa [z0z',z1a,z1c,z18,z09,z0d,append_assoc] using h + · have h := z17 z00 (z1b a c) (z1c l) + (.R (vlit [1,1,1,1] (.app [1,1] 0 (vlit ld0 (.var 0)))) (vlit [1,0,0,0,1,1,1,1,1,1] (.app [1,1] 1 .zinf)) D) + (.L (vlit (ld0 ^ 5) (.app ld0 1 (.app ld0 0 (vlit ld1 (.var 0))))) (vlit [1,1,1,0,0,0,0,0,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + have h1 : 2 + (c + 1 + 1) * 2 = 6 + c * 2 := by omega + have h2 : 3 + a + (c + 1 + 1) = 5 + c + a := by omega + rw [h1,h2] + simpa [z0z',z1b,z1c,z18,z09,z0d,append_assoc] using h +theorem z1o (a c : Nat) (l : zB) : + (((o1 ^ (4 + a * 2)) +> ld0 +> l) {{D}}> ([1,0,0,0] +> (o1 ^ (1 + c * 2)) +> default)) [z00]⊢* + (z19 ((ld0 ^ (3 + a + c)) +> ld1 +> l) default) := by + rcases c with _ | _ | c + · have h := z17 z00 (z1a a) (z1c l) + (.R (vlit [1,1,1,1] (.app [1,1] 0 (vlit ld0 (.var 0)))) (vlit [1,0,0,0,1] .zinf) D) + (.R (vlit [1,1,1,0,1] (vlit (ld0 ^ 3) (.app ld0 0 (vlit ld1 (.var 0))))) .zinf C) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1a,z1c,z19,z09,z0d,append_assoc] using h + · have h := z17 z00 (z1a a) (z1c l) + (.R (vlit [1,1,1,1] (.app [1,1] 0 (vlit ld0 (.var 0)))) (vlit [1,0,0,0,1,1,1] .zinf) D) + (.R (vlit [1,1,1,0,1] (vlit (ld0 ^ 4) (.app ld0 0 (vlit ld1 (.var 0))))) .zinf C) + false 15 60 25 (by decide +kernel) + have h1 : 3 + a + 1 = 4 + a := by omega + rw [h1] + simpa [z0z',z1a,z1c,z19,z09,z0d,append_assoc] using h + · have h := z17 z00 (z1b a c) (z1c l) + (.R (vlit [1,1,1,1] (.app [1,1] 0 (vlit ld0 (.var 0)))) (vlit [1,0,0,0,1,1,1,1,1] (.app [1,1] 1 .zinf)) D) + (.R (vlit [1,1,1,0,1] (vlit (ld0 ^ 5) (.app ld0 1 (.app ld0 0 (vlit ld1 (.var 0)))))) .zinf C) + false 15 60 25 (by decide +kernel) + have h1 : 1 + (c + 1 + 1) * 2 = 5 + c * 2 := by omega + have h2 : 3 + a + (c + 1 + 1) = 5 + c + a := by omega + rw [h1,h2] + simpa [z0z',z1b,z1c,z19,z09,z0d,append_assoc] using h +theorem z1p (a c : Nat) (l : zB) : + (((o1 ^ (5 + a * 2)) +> ld0 +> l) {{D}}> ([1,0,0,0] +> (o1 ^ (2 + c * 2)) +> default)) [z00]⊢* + (z19 ((ld0 ^ (4 + a + c)) +> ld1 +> l) default) := by + rcases c with _ | _ | c + · have h := z17 z00 (z1a a) (z1c l) + (.R (vlit [1,1,1,1,1] (.app [1,1] 0 (vlit ld0 (.var 0)))) (vlit [1,0,0,0,1,1] .zinf) D) + (.R (vlit [1,1,1,0,1] (vlit (ld0 ^ 4) (.app ld0 0 (vlit ld1 (.var 0))))) .zinf C) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1a,z1c,z19,z09,z0d,append_assoc] using h + · have h := z17 z00 (z1a a) (z1c l) + (.R (vlit [1,1,1,1,1] (.app [1,1] 0 (vlit ld0 (.var 0)))) (vlit [1,0,0,0,1,1,1,1] .zinf) D) + (.R (vlit [1,1,1,0,1] (vlit (ld0 ^ 5) (.app ld0 0 (vlit ld1 (.var 0))))) .zinf C) + false 15 60 25 (by decide +kernel) + have h1 : 4 + a + 1 = 5 + a := by omega + rw [h1] + simpa [z0z',z1a,z1c,z19,z09,z0d,append_assoc] using h + · have h := z17 z00 (z1b a c) (z1c l) + (.R (vlit [1,1,1,1,1] (.app [1,1] 0 (vlit ld0 (.var 0)))) (vlit [1,0,0,0,1,1,1,1,1,1] (.app [1,1] 1 .zinf)) D) + (.R (vlit [1,1,1,0,1] (vlit (ld0 ^ 6) (.app ld0 1 (.app ld0 0 (vlit ld1 (.var 0)))))) .zinf C) + false 15 60 25 (by decide +kernel) + have h1 : 2 + (c + 1 + 1) * 2 = 6 + c * 2 := by omega + have h2 : 4 + a + (c + 1 + 1) = 6 + c + a := by omega + rw [h1,h2] + simpa [z0z',z1b,z1c,z19,z09,z0d,append_assoc] using h +theorem z1q (a c : Nat) (l : zB) : + (((o1 ^ (5 + a * 2)) +> ld0 +> l) {{D}}> ([1,0,0,0] +> (o1 ^ (1 + c * 2)) +> default)) [z00]⊢* + (z18 ((ld0 ^ (3 + a + c)) +> ld1 +> l) ([0,0,0,1,0,0] +> default)) := by + rcases c with _ | _ | c + · have h := z17 z00 (z1a a) (z1c l) + (.R (vlit [1,1,1,1,1] (.app [1,1] 0 (vlit ld0 (.var 0)))) (vlit [1,0,0,0,1] .zinf) D) + (.L (vlit (ld0 ^ 3) (.app ld0 0 (vlit ld1 (.var 0)))) (vlit [1,1,1,0,0,0,0,0,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1a,z1c,z18,z09,z0d,append_assoc] using h + · have h := z17 z00 (z1a a) (z1c l) + (.R (vlit [1,1,1,1,1] (.app [1,1] 0 (vlit ld0 (.var 0)))) (vlit [1,0,0,0,1,1,1] .zinf) D) + (.L (vlit (ld0 ^ 4) (.app ld0 0 (vlit ld1 (.var 0)))) (vlit [1,1,1,0,0,0,0,0,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + have h1 : 3 + a + 1 = 4 + a := by omega + rw [h1] + simpa [z0z',z1a,z1c,z18,z09,z0d,append_assoc] using h + · have h := z17 z00 (z1b a c) (z1c l) + (.R (vlit [1,1,1,1,1] (.app [1,1] 0 (vlit ld0 (.var 0)))) (vlit [1,0,0,0,1,1,1,1,1] (.app [1,1] 1 .zinf)) D) + (.L (vlit (ld0 ^ 5) (.app ld0 1 (.app ld0 0 (vlit ld1 (.var 0))))) (vlit [1,1,1,0,0,0,0,0,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + have h1 : 1 + (c + 1 + 1) * 2 = 5 + c * 2 := by omega + have h2 : 3 + a + (c + 1 + 1) = 5 + c + a := by omega + rw [h1,h2] + simpa [z0z',z1b,z1c,z18,z09,z0d,append_assoc] using h +theorem z1r (a c : Nat) (l : zB) : + (((o1 ^ (4 + a * 2)) +> ld0 +> l) {{D}}> ([1,1,0,0,0] +> (o1 ^ (4 + c * 2)) +> default)) [z00]⊢* + (z18 ((ld0 ^ (1 + c)) +> ld1 +> [1,0,1] +> (ld0 ^ (1 + a)) +> ld1 +> l) ([0,0,0,1,0,0] +> default)) := by + have h := z17 z00 (z1b a c) (z1c l) + (.R (vlit [1,1,1,1] (.app [1,1] 0 (vlit ld0 (.var 0)))) (vlit [1,1,0,0,0,1,1,1,1] (.app [1,1] 1 .zinf)) D) + (.L (vlit ld0 (.app ld0 1 (vlit ld1 (vlit [1,0,1] (vlit ld0 (.app ld0 0 (vlit ld1 (.var 0)))))))) (vlit [1,1,1,0,0,0,0,0,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1b,z1c,z18,z09,z0d,append_assoc] using h +theorem z1s (a c : Nat) (l : zB) : + (((o1 ^ (4 + a * 2)) +> ld0 +> l) {{D}}> ([1,1,0,0,0] +> (o1 ^ (5 + c * 2)) +> default)) [z00]⊢* + (z19 ((ld0 ^ (2 + c)) +> ld1 +> [1,0,1] +> (ld0 ^ (1 + a)) +> ld1 +> l) default) := by + have h := z17 z00 (z1b a c) (z1c l) + (.R (vlit [1,1,1,1] (.app [1,1] 0 (vlit ld0 (.var 0)))) (vlit [1,1,0,0,0,1,1,1,1,1] (.app [1,1] 1 .zinf)) D) + (.R (vlit [1,1,1,0,1] (vlit (ld0 ^ 2) (.app ld0 1 (vlit ld1 (vlit [1,0,1] (vlit ld0 (.app ld0 0 (vlit ld1 (.var 0))))))))) .zinf C) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1b,z1c,z19,z09,z0d,append_assoc] using h +theorem z1t (a c : Nat) (l : zB) : + (((o1 ^ (5 + a * 2)) +> ld0 +> l) {{D}}> ([1,1,0,0,0] +> (o1 ^ (4 + c * 2)) +> default)) [z00]⊢* + (z19 ((ld0 ^ (1 + c)) +> ld1 +> [1,0,1] +> (ld0 ^ (2 + a)) +> ld1 +> l) default) := by + have h := z17 z00 (z1b a c) (z1c l) + (.R (vlit [1,1,1,1,1] (.app [1,1] 0 (vlit ld0 (.var 0)))) (vlit [1,1,0,0,0,1,1,1,1] (.app [1,1] 1 .zinf)) D) + (.R (vlit [1,1,1,0,1] (vlit ld0 (.app ld0 1 (vlit ld1 (vlit [1,0,1] (vlit (ld0 ^ 2) (.app ld0 0 (vlit ld1 (.var 0))))))))) .zinf C) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1b,z1c,z19,z09,z0d,append_assoc] using h +theorem z1u (a c : Nat) (l : zB) : + (((o1 ^ (5 + a * 2)) +> ld0 +> l) {{D}}> ([1,1,0,0,0] +> (o1 ^ (5 + c * 2)) +> default)) [z00]⊢* + (z18 ((ld0 ^ (1 + c)) +> ld1 +> [1,0,1] +> (ld0 ^ (2 + a)) +> ld1 +> l) ([0,0,0,1,0,0] +> default)) := by + have h := z17 z00 (z1b a c) (z1c l) + (.R (vlit [1,1,1,1,1] (.app [1,1] 0 (vlit ld0 (.var 0)))) (vlit [1,1,0,0,0,1,1,1,1,1] (.app [1,1] 1 .zinf)) D) + (.L (vlit ld0 (.app ld0 1 (vlit ld1 (vlit [1,0,1] (vlit (ld0 ^ 2) (.app ld0 0 (vlit ld1 (.var 0)))))))) (vlit [1,1,1,0,0,0,0,0,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1b,z1c,z18,z09,z0d,append_assoc] using h +theorem z1v (l : zB) : + (([1] +> l) {{D}}> ([1,1] +> default)) [z00]⊢* + (z19 l default) := by + have h := z17 z00 (z1a 0) (z1c l) + (.R (vlit [1] (.var 0)) (vlit [1,1] .zinf) D) + (.R (vlit [1,1,1,0,1] (.var 0)) .zinf C) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1a,z1c,z19,append_assoc] using h +theorem z1w (l : zB) : + (([1] +> l) {{D}}> ([1,1,1] +> default)) [z00]⊢* + (z18 l ([0,0,0,1,0,0] +> default)) := by + have h := z17 z00 (z1a 0) (z1c l) + (.R (vlit [1] (.var 0)) (vlit [1,1,1] .zinf) D) + (.L (.var 0) (vlit [1,1,1,0,0,0,0,0,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1a,z1c,z18,append_assoc] using h +theorem z1x (b : Nat) (l : zB) : + (l {{D}}> ((o1 ^ (4 + b * 2)) +> default)) [z00]⊢* + (z19 ([0] +> (([1,0] ^ b) +> l)) default) := by + have h := z17 z00 (z1a b) (z1c l) + (.R (.var 0) (vlit [1,1,1,1] (.app [1,1] 0 .zinf)) D) + (.R (vlit [1,1,1,0,1,0] (.app [1,0] 0 (.var 0))) .zinf C) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1a,z1c,z19,z09,z0d,append_assoc] using h +theorem z1y (b : Nat) (l : zB) : + (l {{D}}> ((o1 ^ (5 + b * 2)) +> default)) [z00]⊢* + (z18 ([0] +> (([1,0] ^ b) +> l)) ([0,0,0,1,0,0] +> default)) := by + have h := z17 z00 (z1a b) (z1c l) + (.R (.var 0) (vlit [1,1,1,1,1] (.app [1,1] 0 .zinf)) D) + (.L (vlit [0] (.app [1,0] 0 (.var 0))) (vlit [1,1,1,0,0,0,0,0,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1a,z1c,z18,z09,z0d,append_assoc] using h +theorem z1z (n : Nat) (l : zB) : + (((o1 ^ (4 + n * 3)) +> ld0 +> l) {{D}}> ([1] +> default)) [z00]⊢* + (z18 l ((z ^ (2 + n)) +> d +> default)) := by + have h := z17 z00 (z1a n) (z1c l) + (.R (vlit [1,1,1,1] (.app [1,1,1] 0 (vlit ld0 (.var 0)))) (vlit [1] .zinf) D) + (.L (.var 0) (vlit [1,1,1,0,0] (vlit (z ^ 2) (.app z 0 (vlit d .zinf)))) B) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1a,z1c,z18,z09,z0e,append_assoc] using h +theorem z1A (b c : Nat) (l : zB) : + (l {{D}}> ((o1 ^ (3 + b * 2)) +> z +> (o1 ^ (1 + c * 2)) +> z +> d +> default)) [z00]⊢* + (z18 (ld0 +> ld1 +> (ld0 ^ (1 + c)) +> [1] +> (([1,0] ^ b) +> l)) ([0,0,0,1,0,0] +> default)) := by + have h := z17 z00 (z1b b c) (z1c l) + (.R (.var 0) (vlit [1,1,1] (.app [1,1] 0 (vlit [0,0,0,1] (.app [1,1] 1 (vlit [0,0,0,1,0,0] .zinf))))) D) + (.L (vlit ld0 (vlit ld1 (vlit ld0 (.app ld0 1 (vlit [1] (.app [1,0] 0 (.var 0))))))) (vlit [1,1,1,0,0,0,0,0,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1b,z1c,z18,z09,z0d,append_assoc] using h +theorem z1B (b c : Nat) (l : zB) : + (l {{D}}> ((o1 ^ (3 + b * 2)) +> z +> (o1 ^ (2 + c * 2)) +> z +> d +> default)) [z00]⊢* + (z18 (ld1 +> (ld0 ^ (1 + c)) +> [1] +> (([1,0] ^ b) +> l)) ([0,0,0,0,0,0,1,0,0] +> default)) := by + have h := z17 z00 (z1b b c) (z1c l) + (.R (.var 0) (vlit [1,1,1] (.app [1,1] 0 (vlit [0,0,0,1,1] (.app [1,1] 1 (vlit [0,0,0,1,0,0] .zinf))))) D) + (.L (vlit ld1 (vlit ld0 (.app ld0 1 (vlit [1] (.app [1,0] 0 (.var 0)))))) (vlit [1,1,1,0,0,0,0,0,0,0,0,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1b,z1c,z18,z09,z0d,append_assoc] using h +theorem z1C (b c : Nat) (l : zB) : + (l {{D}}> ((o1 ^ (4 + b * 2)) +> z +> (o1 ^ (3 + c * 2)) +> z +> d +> default)) [z00]⊢* + (z18 (ld0 +> ld1 +> (ld0 ^ c) +> ld1 +> [1,0,1,1] +> (([1,0] ^ b) +> l)) ([0,0,0,1,0,0] +> default)) := by + have h := z17 z00 (z1b b c) (z1c l) + (.R (.var 0) (vlit [1,1,1,1] (.app [1,1] 0 (vlit [0,0,0,1,1,1] (.app [1,1] 1 (vlit [0,0,0,1,0,0] .zinf))))) D) + (.L (vlit ld0 (vlit ld1 (.app ld0 1 (vlit ld1 (vlit [1,0,1,1] (.app [1,0] 0 (.var 0))))))) (vlit [1,1,1,0,0,0,0,0,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1b,z1c,z18,z09,z0d,append_assoc] using h +theorem z1D (b c : Nat) (l : zB) : + (l {{D}}> ((o1 ^ (4 + b * 2)) +> z +> (o1 ^ (4 + c * 2)) +> z +> d +> default)) [z00]⊢* + (z18 (ld1 +> (ld0 ^ c) +> ld1 +> [1,0,1,1] +> (([1,0] ^ b) +> l)) ([0,0,0,0,0,0,1,0,0] +> default)) := by + have h := z17 z00 (z1b b c) (z1c l) + (.R (.var 0) (vlit [1,1,1,1] (.app [1,1] 0 (vlit [0,0,0,1,1,1,1] (.app [1,1] 1 (vlit [0,0,0,1,0,0] .zinf))))) D) + (.L (vlit ld1 (.app ld0 1 (vlit ld1 (vlit [1,0,1,1] (.app [1,0] 0 (.var 0)))))) (vlit [1,1,1,0,0,0,0,0,0,0,0,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1b,z1c,z18,z09,z0d,append_assoc] using h +theorem z1E (b : Nat) (l : zB) : + (l {{D}}> ((o1 ^ (3 + b * 2)) +> [0,0,0,1] +> default)) [z00]⊢* + (z18 (ld0 +> [1] +> (([1,0] ^ b) +> l)) ([0,0,0,1,0,0] +> default)) := by + have h := z17 z00 (z1a b) (z1c l) + (.R (.var 0) (vlit [1,1,1] (.app [1,1] 0 (vlit [0,0,0,1] .zinf))) D) + (.L (vlit ld0 (vlit [1] (.app [1,0] 0 (.var 0)))) (vlit [1,1,1,0,0,0,0,0,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1a,z1c,z18,z09,z0d,append_assoc] using h +theorem z1F (b : Nat) (l : zB) : + (l {{D}}> ((o1 ^ (4 + b * 2)) +> [0,0,0,1] +> default)) [z00]⊢* + (z18 ([1] +> (([1,0] ^ b) +> l)) ([0,0,0,0,0,0,1,0,0] +> default)) := by + have h := z17 z00 (z1a b) (z1c l) + (.R (.var 0) (vlit [1,1,1,1] (.app [1,1] 0 (vlit [0,0,0,1] .zinf))) D) + (.L (vlit [1] (.app [1,0] 0 (.var 0))) (vlit [1,1,1,0,0,0,0,0,0,0,0,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1a,z1c,z18,z09,z0d,append_assoc] using h +theorem z1G (b : Nat) (l : zB) : + (l {{D}}> ((o1 ^ (4 + b * 2)) +> [0,0,0,1,1,1] +> default)) [z00]⊢* + (z18 (ld1 +> [1,0,1,1] +> (([1,0] ^ b) +> l)) ([0,0,0,1,0,0] +> default)) := by + have h := z17 z00 (z1a b) (z1c l) + (.R (.var 0) (vlit [1,1,1,1] (.app [1,1] 0 (vlit [0,0,0,1,1,1] .zinf))) D) + (.L (vlit ld1 (vlit [1,0,1,1] (.app [1,0] 0 (.var 0)))) (vlit [1,1,1,0,0,0,0,0,1,0,0] .zinf) B) + false 15 60 25 (by decide +kernel) + simpa [z0z',z1a,z1c,z18,z09,z0d,append_assoc] using h +theorem z1H (l r : zB) (n : Nat) : + (z18 ((ld1 ^ n) +> ld0 +> l) r) [z00]⊢⁺ + (z19 ((ld0 ^ n) +> ld1 +> l) r) := by + have h := z17 z00 (z1a n) (z1d l r) + (.L (.app ld1 0 (vlit ld0 (.var 0))) (vlit [1,1,1,0,0] (.var 1)) B) + (.R (vlit [1,1,1,0,1] (.app ld0 0 (vlit ld1 (.var 0)))) (.var 1) C) + true 15 60 25 (by decide +kernel) + simpa [z0z',z1a,z1d,z18,z19,append_assoc] using h +theorem z1I (l r : zB) (n : Nat) : + (z19 l ((d ^ n) +> [0] +> r)) [z00]⊢⁺ + (z18 l ((z ^ n) +> [1] +> r)) := by + have h := z17 z00 (z1a n) (z1d l r) + (.R (vlit [1,1,1,0,1] (.var 0)) (.app d 0 (vlit [0] (.var 1))) C) + (.L (.var 0) (vlit [1,1,1,0,0] (.app z 0 (vlit [1] (.var 1)))) B) + true 15 60 25 (by decide +kernel) + simpa [z0z',z1a,z1d,z18,z19,append_assoc] using h +theorem LOv (r : zB) (n m : Nat) : + (z18 ((ld1 ^ n) +> ldh) ((d ^ m) +> z +> r)) [z00]⊢⁺ + (z18 ((ld0 ^ n) +> ldh) ((z ^ (m + 1)) +> [1] +> r)) := by + have h := z17 z00 (z1b n m) (z1c r) + (.L (.app ld1 0 (vlit [1] .zinf)) (vlit [1,1,1,0,0] (.app d 1 (vlit z (.var 0)))) B) + (.L (.app ld0 0 (vlit [1] .zinf)) (vlit [1,1,1,0,0] (.app z 1 (vlit z (vlit [1] (.var 0))))) B) + true 15 60 25 (by decide +kernel) + rw [<- z0a z m,append_assoc] + simpa [z0z',z1b,z1c,z18,ldh,append_assoc] using h +theorem z1J (l r : zB) (p i : Nat) : + (z19 l ((d ^ p) +> [1] +> (d ^ i) +> z +> r)) [z00]⊢⁺ + (z18 l ((z ^ (1 + p + i)) +> [1] +> r)) := by + have h := z17 z00 (z1b p i) (z1d l r) + (.R (vlit [1,1,1,0,1] (.var 0)) (.app d 0 (vlit [1] (.app d 1 (vlit z (.var 1))))) C) + (.L (.var 0) (vlit [1,1,1,0,0] (vlit z (.app z 0 (.app z 1 (vlit [1] (.var 1)))))) B) + true 15 60 25 (by decide +kernel) + have hpi : 1 + p + i = 1 + (p + i) := by omega + rw [hpi] + simpa [z0z',z1b,z1d,z18,z19,z09,append_assoc] using h +theorem z1K (l r : zB) (a b : Nat) : + (z19 l ((d ^ (a * 2)) +> [1] +> (d ^ b) +> r)) [z00]⊢⁺ + (((o1 ^ (4 + b * 3 + a * 6)) +> ld0 +> l) {{D}}> r) := by + have h := z17 z00 (z1b a b) (z1d l r) + (.R (vlit [1,1,1,0,1] (.var 0)) (.app (d ++ d) 0 (vlit [1] (.app d 1 (.var 1)))) C) + (.R (vlit [1,1,1,1] (.app [1,1,1] 1 (.app (o1 ^ 6) 0 (vlit ld0 (.var 0))))) (.var 1) D) + true 15 60 25 (by decide +kernel) + simpa [z0z',z1b,z1d,z19,z09,z0d,z0e,z0f,append_assoc] using h +theorem z1L (l r : zB) (a b : Nat) : + (z19 l ((d ^ (1 + a * 2)) +> [1] +> (d ^ b) +> r)) [z00]⊢⁺ + (((o1 ^ (7 + b * 3 + a * 6)) +> ld0 +> l) {{D}}> r) := by + have h := z17 z00 (z1b a b) (z1d l r) + (.R (vlit [1,1,1,0,1] (.var 0)) (vlit d (.app (d ++ d) 0 (vlit [1] (.app d 1 (.var 1))))) C) + (.R (vlit (o1 ^ 7) (.app [1,1,1] 1 (.app (o1 ^ 6) 0 (vlit ld0 (.var 0))))) (.var 1) D) + true 15 60 25 (by decide +kernel) + simpa [z0z',z1b,z1d,z19,z09,z0d,z0e,z0f,append_assoc] using h +theorem z1M (n : Nat) (r : zB) : + (z18 ((ld1 ^ n) +> ldh) ((d ^ n) +> r)) [z00]⊢⁺ + (((o1 ^ (4 + n * 3)) +> ld0 +> (ld0 ^ n) +> ldh) {{D}}> r) := by + have h := z17 z00 (z1a n) (z1c r) + (.L (.app ld1 0 (vlit [1] .zinf)) (vlit [1,1,1,0,0] (.app d 0 (.var 0))) B) + (.R (vlit [1,1,1,1] (.app [1,1,1] 0 (vlit ld0 (.app ld0 0 (vlit [1] .zinf))))) (.var 0) D) + true 15 60 25 (by decide +kernel) + simpa [z0z',z1a,z1c,z18,ldh,z09,z0e,append_assoc] using h +def z1N : zF := d ++ z ++ d ++ z ++ (d ^ 3) +set_option maxRecDepth 4000000 in +theorem z1O : + (init []) [z00]⊢* (z18 ((ld1 ^ 7) +> ldh) (z1N +> default)) := by + have h := z17 z00 (z1a 0) (z1c default) + (.R .zinf .zinf A) + (.L (vlit (o1 ^ 15) .zinf) (vlit ([1,1,1,0,0] ++ z1N) .zinf) B) + false 1 3005 1 (by decide +kernel) + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + have h_lhs : (ld1 ^ 7) +> ldh = (o1 ^ 15) +> default := rfl + rw [h_init,h_lhs] + simpa [z0z',z1a,z1c,z18,append_assoc] using h +def z1P (t u : Nat) : Prop := t * 8 + 9 <= u \/ u * 8 <= t + 5 +theorem z1Q (old current r tail gap : Nat) + (h1 : 16 <= old) (h2 : old * 125 <= current * 8) (h3 : r <= old) + (h4 : tail <= old + 8) (h5 : current * 3 <= gap * 2 + 4) : + (r + tail) * 8 + 9 <= gap := by + omega +theorem z1R (n : Nat) : 2 ^ (n + 1) = 2 ^ n * 2 := Nat.pow_succ 2 n +theorem z1S (a b : Nat) : 2 ^ (a + b) = 2 ^ a * 2 ^ b := Nat.pow_add 2 a b +theorem z1T {a b : Nat} (h : a <= b) : 2 ^ a <= 2 ^ b := + Nat.pow_le_pow_right (by omega) h +theorem z1U : z +> (default : zB) = default := by + simpa using z0g 3 +theorem z1V (l r : zB) (n : Nat) : + (z19 l ((d ^ n) +> z +> r)) [z00]⊢⁺ (z18 l ((z ^ n) +> d +> r)) := by + have h1 : z +> r = [0] +> ([0,0] +> r) := rfl + have h2 : d +> r = [1] +> ([0,0] +> r) := rfl + rw [h1,h2] + exact z1I l ([0,0] +> r) n +inductive zDg : Nat -> Nat -> zF -> Prop + | nil : zDg 0 0 [] + | zero (n v : Nat) (w : zF) : zDg n v w -> zDg (n + 1) (v * 2) (z ++ w) + | one (n v : Nat) (w : zF) : zDg n v w -> zDg (n + 1) (v * 2 + 1) (d ++ w) +theorem z1W {n v : Nat} {w : zF} (h : zDg n v w) : v < 2 ^ n := by + induction h with + | nil => simp + | zero n v w _ ih => + have hp : 2 ^ (n + 1) = 2 ^ n * 2 := Nat.pow_succ 2 n + omega + | one n v w _ ih => + have hp : 2 ^ (n + 1) = 2 ^ n * 2 := Nat.pow_succ 2 n + omega +theorem z1X : ∀ (n : Nat),zDg n 0 (z ^ n) + | 0 => .nil + | n + 1 => by + rw [z08] + exact zDg.zero n 0 (z ^ n) (z1X n) +theorem z1Y : ∀ (n : Nat),zDg n (2 ^ n - 1) (d ^ n) + | 0 => .nil + | n + 1 => by + have hp := z0h n + have h2 : 2 ^ (n + 1) - 1 = (2 ^ n - 1) * 2 + 1 := by rw [Nat.pow_succ]; omega + rw [z08,h2] + exact zDg.one n (2 ^ n - 1) (d ^ n) (z1Y n) +theorem z1Z {n v : Nat} {w : zF} (h : zDg n v w) (hv : v = 2 ^ n - 1) : + w = d ^ n := by + induction h with + | nil => rfl + | zero n v w _ _ => + have hp := z0h n + have hp2 : 2 ^ (n + 1) = 2 ^ n * 2 := Nat.pow_succ 2 n + omega + | one n v w _ ih => + have hp := z0h n + have hp2 : 2 ^ (n + 1) = 2 ^ n * 2 := Nat.pow_succ 2 n + have hv' : v = 2 ^ n - 1 := by omega + rw [z08,ih hv'] +theorem z20 {n v : Nat} {w : zF} (h : zDg n v w) (hv : 1 + v < 2 ^ n) : + ∃ i j m s,n = i + 1 + j /\ v = (m * 2 + 1) * 2 ^ i - 1 /\ + w = (d ^ i) ++ z ++ s /\ zDg j m s := by + induction h with + | nil => simp at hv + | zero n v w h _ => + exact ⟨0,n,v,w,by omega,by omega,rfl,h⟩ + | one n v w h ih => + have hp2 : 2 ^ (n + 1) = 2 ^ n * 2 := Nat.pow_succ 2 n + rcases ih (by omega) with ⟨i,j,m,s,hn,hx,hw,hs⟩ + refine ⟨i + 1,j,m,s,by omega,?_,?_,hs⟩ + · have hpi := z0h i + have hpos : 1 <= (m * 2 + 1) * 2 ^ i := Nat.mul_pos (by omega) hpi + have hpi2 : 2 ^ (i + 1) = 2 ^ i * 2 := Nat.pow_succ 2 i + rw [hpi2,<- Nat.mul_assoc] + omega + · simp [z08,hw,List.append_assoc] +theorem z21 : ∀ (i j m : Nat) (s : zF), + zDg j m s -> zDg (i + j) (m * 2 ^ i) ((z ^ i) ++ s) + | 0,j,m,s,h => by simpa using h + | i + 1,j,m,s,h => by + have ih := z21 i j m s h + have h1 : i + 1 + j = (i + j) + 1 := by omega + have h2 : m * 2 ^ (i + 1) = (m * 2 ^ i) * 2 := by rw [Nat.pow_succ,<- Nat.mul_assoc] + rw [h1,h2,z08,List.append_assoc] + exact zDg.zero (i + j) (m * 2 ^ i) ((z ^ i) ++ s) ih +theorem z22 {n v : Nat} {w : zF} (h : zDg n v w) (hv : 1 + v < 2 ^ n) : + ∃ w',zDg n (1 + v) w' /\ + ∀ l r,(z19 l (w +> r)) [z00]⊢⁺ (z18 l (w' +> r)) := by + rcases z20 h hv with ⟨i,j,m,s,hn,hx,hw,hs⟩ + refine ⟨(z ^ i) ++ d ++ s,?_,?_⟩ + · subst hn hx + have hpi := z0h i + have hpos : 1 <= (m * 2 + 1) * 2 ^ i := Nat.mul_pos (by omega) hpi + have h1 : 1 + ((m * 2 + 1) * 2 ^ i - 1) = (m * 2 + 1) * 2 ^ i := by omega + have h2 : i + 1 + j = i + (j + 1) := by omega + rw [h1,h2,List.append_assoc] + exact z21 i (j + 1) (m * 2 + 1) (d ++ s) (zDg.one j m s hs) + · intro l r + rw [hw,append_assoc,append_assoc,append_assoc,append_assoc] + exact z1V l (s +> r) i +inductive Marked : Nat -> Nat -> zF -> Prop + | mk (p j u m : Nat) (a b : zF) : + zDg p u a -> zDg j m b -> (j = 0 \/ m < 2 ^ (j - 1)) -> + Marked (p + j) ((m * 2 + 1) * 2 ^ p + u) (a ++ [1] ++ b) +theorem z23 (i j m v : Nat) (hv : v = (m * 2 + 1) * 2 ^ i - 1) (htop : v < 2 ^ (i + j)) : + j = 0 \/ m < 2 ^ (j - 1) := by + cases j with + | zero => exact Or.inl rfl + | succ j => + right + have hj : j + 1 - 1 = j := by omega + rw [hj] + have hpi := z0h i + have hpos : 1 <= (m * 2 + 1) * 2 ^ i := Nat.mul_pos (by omega) hpi + have hp : 2 ^ (i + (j + 1)) = (2 ^ j * 2) * 2 ^ i := by + rw [Nat.pow_add,Nat.pow_succ]; ring + rw [hp] at htop + have hle : (m * 2 + 1) * 2 ^ i <= (2 ^ j * 2) * 2 ^ i := by omega + have hlt : m * 2 + 1 <= 2 ^ j * 2 := Nat.le_of_mul_le_mul_right hle hpi + omega +theorem z24 (p j u m : Nat) (hu : u < 2 ^ p) (hm : m < 2 ^ (j - 1)) (hj : 0 < j) : + (m * 2 + 1) * 2 ^ p + u < 2 ^ (p + j) := by + cases j with + | zero => omega + | succ j => + have hj' : j + 1 - 1 = j := by omega + rw [hj'] at hm + have hp : 2 ^ (p + (j + 1)) = (2 ^ j * 2) * 2 ^ p := by + rw [Nat.pow_add,Nat.pow_succ]; ring + have hle : m * 2 + 1 + 1 <= 2 ^ j * 2 := by omega + have hmul : (m * 2 + 1 + 1) * 2 ^ p <= (2 ^ j * 2) * 2 ^ p := + Nat.mul_le_mul_right (2 ^ p) hle + rw [Nat.add_mul,Nat.one_mul] at hmul + omega +theorem z25 {J V : Nat} {w : zF} (h : Marked J V w) (hV : 2 ^ J <= V) : + ∃ u a,V = 2 ^ J + u /\ zDg J u a /\ w = a ++ [1] := by + rcases h with ⟨p,j,u,m,a,b,ha,hb,htop⟩ + cases j with + | zero => + cases hb + refine ⟨u,a,?_,?_,?_⟩ + · simp + · simpa using ha + · simp + | succ j => + have hu := z1W ha + have hm : m < 2 ^ (j + 1 - 1) := by + rcases htop with h0 | hm + · omega + · exact hm + have hlt := z24 p (j + 1) u m hu hm (by omega) + omega +theorem z26 {J V : Nat} {w : zF} (h : Marked J V w) (hv : 1 + V < 2 ^ (J + 1)) : + ∃ w',Marked J (1 + V) w' /\ + ∀ l r,(z19 l (w +> r)) [z00]⊢⁺ (z18 l (w' +> r)) := by + rcases h with ⟨p,j,u,m,a,b,ha,hb,htop⟩ + have hu := z1W ha + by_cases hlow : 1 + u < 2 ^ p + · rcases z22 ha hlow with ⟨a',ha',hr⟩ + refine ⟨a' ++ [1] ++ b,?_,?_⟩ + · have h1 : 1 + ((m * 2 + 1) * 2 ^ p + u) = (m * 2 + 1) * 2 ^ p + (1 + u) := by omega + rw [h1] + exact Marked.mk p j (1 + u) m a' b ha' hb htop + · intro l r + rw [append_assoc,append_assoc,append_assoc,append_assoc] + exact hr l ([1] +> b +> r) + · have huf : u = 2 ^ p - 1 := by omega + have hj : 0 < j := by + cases j with + | zero => + cases hb + have hp : 2 ^ (p + 0 + 1) = 2 ^ p * 2 := by rw [Nat.add_zero,Nat.pow_succ] + have hpp := z0h p + omega + | succ j => omega + have hm_inc : 1 + m < 2 ^ j := by + cases j with + | zero => omega + | succ j => + rcases htop with h0 | hm + · omega + · have hj' : j + 1 - 1 = j := by omega + rw [hj'] at hm + rw [Nat.pow_succ] + omega + rcases z20 hb hm_inc with ⟨i,k,v,s,hjk,hm,hword,hs⟩ + have hnewtop : k = 0 \/ v < 2 ^ (k - 1) := by + apply z23 i k v m hm + have hik : i + k = j - 1 := by omega + rw [hik] + rcases htop with h0 | hlt + · omega + · exact hlt + refine ⟨(z ^ (p + i + 1)) ++ [1] ++ s,?_,?_⟩ + · have hpj : p + j = (p + i + 1) + k := by omega + have hval : 1 + ((m * 2 + 1) * 2 ^ p + u) = (v * 2 + 1) * 2 ^ (p + i + 1) + 0 := by + have hpp := z0h p + have hpi := z0h i + have hpos : 1 <= (v * 2 + 1) * 2 ^ i := Nat.mul_pos (by omega) hpi + have hm1 : m + 1 = (v * 2 + 1) * 2 ^ i := by omega + have hp_split : 2 ^ (p + i + 1) = 2 ^ i * 2 * 2 ^ p := by + rw [Nat.pow_add,Nat.pow_add,Nat.pow_one]; ring + rw [hp_split,huf] + have hdist : (m + 1) * 2 * 2 ^ p = (m * 2 + 1) * 2 ^ p + 2 ^ p := by ring + calc 1 + ((m * 2 + 1) * 2 ^ p + (2 ^ p - 1)) + = (m + 1) * 2 * 2 ^ p := by rw [hdist]; omega + _ = ((v * 2 + 1) * 2 ^ i) * 2 * 2 ^ p := by rw [hm1] + _ = (v * 2 + 1) * (2 ^ i * 2 * 2 ^ p) + 0 := by ring + rw [hpj,hval] + exact Marked.mk (p + i + 1) k 0 v (z ^ (p + i + 1)) s (z1X (p + i + 1)) hs hnewtop + · intro l r + rw [z1Z ha huf,hword] + have hpi : p + i + 1 = 1 + p + i := by omega + rw [hpi] + simpa [append_assoc] using z1J l (s +> r) p i +def LC (len k : Nat) (l : zB) : zB := + z0i ld0 ld1 len k l +theorem z27 (len k : Nat) (l r : zB) (h : 1 + k < 2 ^ len) : + (z18 (LC len (1 + k) l) r) [z00]⊢⁺ (z19 (LC len k l) r) := by + rcases z0x ld0 ld1 len k l h with ⟨i,s,h1,h0⟩ + unfold LC + rw [h1,h0] + exact z1H s r i +theorem z28 (len k c J V : Nat) (w : zF) (l r : zB) + (hk : k + c < 2 ^ len) (hV : V + c < 2 ^ (J + 1)) (hm : Marked J V w) : + ∃ w',Marked J (V + c) w' /\ + (z18 (LC len (k + c) l) (w +> r)) [z00]⊢* (z18 (LC len k l) (w' +> r)) := by + induction c generalizing V w with + | zero => + refine ⟨w,by simpa using hm,by simp; try exact ⟨0,rfl⟩⟩ + | succ c ih => + rcases z26 hm (by omega) with ⟨w1,hm1,hr⟩ + rcases ih (1 + V) w1 (by omega) (by omega) hm1 with ⟨w',hm',hrun⟩ + have hvc : 1 + V + c = V + (c + 1) := by omega + rw [hvc] at hm' + refine ⟨w',hm',?_⟩ + have hkc : k + (c + 1) = 1 + (k + c) := by omega + rw [hkc] + exact zSt (zPs (z27 len (k + c) l (w +> r) (by omega))) + (zSt (zPs (hr (LC len (k + c) l) r)) hrun) +theorem z29 (len k J V : Nat) (w : zF) (l r : zB) + (hk : k < 2 ^ len) (hlo : 2 ^ J <= V + k) (hhi : V + k < 2 ^ (J + 1)) (hm : Marked J V w) : + ∃ a,zDg J (V + k - 2 ^ J) a /\ + (z18 (LC len k l) (w +> r)) [z00]⊢* (z18 (LC len 0 l) (a +> [1] +> r)) := by + rcases z28 len 0 k J V w l r (by omega) hhi hm with ⟨w',hm',hrun⟩ + rcases z25 hm' hlo with ⟨u,a,hV,ha,hw⟩ + have hu : V + k - 2 ^ J = u := by omega + refine ⟨a,by rw [hu]; exact ha,?_⟩ + rw [hw,append_assoc] at hrun + simpa using hrun +theorem z2a (J n : Nat) (h : n * 2 + 1 < 2 ^ J) : n < 2 ^ (J - 1) := by + cases J with + | zero => simp at h + | succ J => + have hj : J + 1 - 1 = J := by omega + rw [hj] + rw [Nat.pow_succ] at h + omega +theorem z2b (len J n : Nat) (w : zF) (r : zB) + (hd : zDg J n w) (hn : n * 2 + 1 < 2 ^ J) : + ∃ w',Marked J (n * 2 + 2) w' /\ + (z18 (LC len 0 ldh) (w +> r)) [z00]⊢⁺ (z18 (LC len (2 ^ len - 1) ldh) (w' +> r)) := by + rcases z20 hd (by omega) with ⟨i,j,m,s,hJ,hn0,hw,hs⟩ + have htop : j = 0 \/ m < 2 ^ (j - 1) := by + apply z23 i j m n hn0 + have hij : i + j = J - 1 := by omega + rw [hij] + exact z2a J n hn + refine ⟨(z ^ (i + 1)) ++ [1] ++ s,?_,?_⟩ + · have hJ' : J = (i + 1) + j := by omega + have hval : n * 2 + 2 = (m * 2 + 1) * 2 ^ (i + 1) + 0 := by + have hpi := z0h i + have hpos : 1 <= (m * 2 + 1) * 2 ^ i := Nat.mul_pos (by omega) hpi + rw [Nat.pow_succ,<- Nat.mul_assoc] + omega + rw [hJ',hval] + exact Marked.mk (i + 1) j 0 m (z ^ (i + 1)) s (z1X (i + 1)) hs htop + · unfold LC + rw [z0n,z0o,hw] + simpa [append_assoc] using LOv (s +> r) len i +theorem z2c (L n : Nat) (w : zF) (r : zB) + (hd : zDg L n w) (hn : n * 2 + 1 < 2 ^ L) : + ∃ a,zDg L (n * 2 + 1) a /\ + (z18 (LC L 0 ldh) (w +> r)) [z00]⊢⁺ (z18 (LC L 0 ldh) (a +> [1] +> r)) := by + rcases z2b L L n w r hd hn with ⟨w',hm,hstart⟩ + have hp := z0h L + have hcap : 2 ^ L - 1 < 2 ^ L := by omega + have hlo : 2 ^ L <= n * 2 + 2 + (2 ^ L - 1) := by omega + have hhi : n * 2 + 2 + (2 ^ L - 1) < 2 ^ (L + 1) := by rw [Nat.pow_succ]; omega + rcases z29 L (2 ^ L - 1) L (n * 2 + 2) w' ldh r hcap hlo hhi hm with ⟨a,ha,hrun⟩ + have hval : n * 2 + 2 + (2 ^ L - 1) - 2 ^ L = n * 2 + 1 := by omega + rw [hval] at ha + exact ⟨a,ha,z05 hstart hrun⟩ +theorem z2d {n v : Nat} {w : zF} (h : zDg n v w) : + zDg (n + 1) v (w ++ z) := by + induction h with + | nil => exact zDg.zero 0 0 [] .nil + | zero n v w _ ih => + rw [List.append_assoc] + exact zDg.zero (n + 1) v (w ++ z) ih + | one n v w _ ih => + rw [List.append_assoc] + exact zDg.one (n + 1) v (w ++ z) ih +theorem z2e {n v : Nat} {w : zF} (h : zDg n v w) : + ∀ j,n = j + 1 -> v < 2 ^ j -> ∃ a,zDg j v a /\ w = a ++ z := by + induction h with + | nil => intro j hn _; omega + | zero n v w h ih => + intro j hn hv + cases j with + | zero => + have hn0 : n = 0 := by omega + subst hn0 + cases h + exact ⟨[],.nil,rfl⟩ + | succ j => + have hp : 2 ^ (j + 1) = 2 ^ j * 2 := Nat.pow_succ 2 j + rcases ih j (by omega) (by omega) with ⟨a,ha,hw⟩ + refine ⟨z ++ a,zDg.zero j v a ha,by rw [hw,List.append_assoc]⟩ + | one n v w h ih => + intro j hn hv + cases j with + | zero => simp at hv + | succ j => + have hp : 2 ^ (j + 1) = 2 ^ j * 2 := Nat.pow_succ 2 j + rcases ih j (by omega) (by omega) with ⟨a,ha,hw⟩ + refine ⟨d ++ a,zDg.one j v a ha,by rw [hw,List.append_assoc]⟩ +theorem z2f (L n : Nat) (w : zF) (r : zB) + (hd : zDg L n w) (hn : 2 ^ L <= n * 2 + 1) : + ∃ a,zDg L (n * 2 + 1 - 2 ^ L) a /\ + (z18 (LC L 0 ldh) (w +> z +> r)) [z00]⊢⁺ (z18 (LC L 0 ldh) (a +> z +> [1] +> r)) := by + have hbound := z1W hd + have hupper : n * 2 + 1 < 2 ^ (L + 1) := by rw [Nat.pow_succ]; omega + rcases z2b L (L + 1) n (w ++ z) r (z2d hd) hupper with ⟨w',hm,hstart⟩ + have hp := z0h L + have hcap : 2 ^ L - 1 < 2 ^ L := by omega + have hlo : 2 ^ (L + 1) <= n * 2 + 2 + (2 ^ L - 1) := by rw [Nat.pow_succ]; omega + have hhi : n * 2 + 2 + (2 ^ L - 1) < 2 ^ (L + 1 + 1) := by rw [Nat.pow_succ,Nat.pow_succ]; omega + rcases z29 L (2 ^ L - 1) (L + 1) (n * 2 + 2) w' ldh r hcap hlo hhi hm with ⟨a,ha,hrun⟩ + have hval : n * 2 + 2 + (2 ^ L - 1) - 2 ^ (L + 1) = n * 2 + 1 - 2 ^ L := by rw [Nat.pow_succ]; omega + rw [hval] at ha + rcases z2e ha L rfl (by omega) with ⟨b,hb,hab⟩ + refine ⟨b,hb,?_⟩ + rw [append_assoc] at hstart + rw [hab,append_assoc] at hrun + exact z05 hstart hrun +theorem z2g (l r : zB) (J b : Nat) : + (z19 l ((d ^ J) +> [1] +> (d ^ b) +> r)) [z00]⊢⁺ + (((o1 ^ (4 + (J + b) * 3)) +> ld0 +> l) {{D}}> r) := by + let a := J / 2 + rcases Nat.mod_two_eq_zero_or_one J with h0 | h1 + · have hJ : J = a * 2 := by omega + have h_exp : 4 + (J + b) * 3 = 4 + b * 3 + a * 6 := by omega + rw [h_exp,hJ] + exact z1K l r a b + · have hJ : J = 1 + a * 2 := by omega + have h_exp : 4 + (J + b) * 3 = 7 + b * 3 + a * 6 := by omega + rw [h_exp,hJ] + exact z1L l r a b +theorem z2h (n : Nat) (r : zB) : + (z18 (LC n 0 ldh) ((d ^ n) +> r)) [z00]⊢⁺ + (((o1 ^ (4 + n * 3)) +> ld0 +> LC n (2 ^ n - 1) ldh) {{D}}> r) := by + unfold LC + rw [z0n,z0o] + exact z1M n r +theorem z2i (J k n : Nat) (w : zF) (r : zB) + (hd : zDg J n w) (hn : n * 2 + 1 < 2 ^ J) (hk : 0 < k) : + (z18 (LC (J + k) 0 ldh) (w +> (d ^ k) +> r)) [z00]⊢⁺ + (((o1 ^ (4 + (J + k) * 3)) +> ld0 +> LC (J + k) (2 ^ (J + k) - 2 ^ (J + 1) + n * 2 + 1) ldh) {{D}}> r) := by + have hp : 2 ^ (J + 1) <= 2 ^ (J + k) := z1T (by omega) + have hpow := z0h J + have hpow1 := z0h (J + 1) + let V := n * 2 + 2 + let c := 2 ^ (J + 1) - 1 - V + let K := 2 ^ (J + k) - 2 ^ (J + 1) + n * 2 + 1 + have hvalue : V + c = 2 ^ (J + 1) - 1 := by + have : 2 ^ (J + 1) = 2 ^ J * 2 := Nat.pow_succ 2 J + omega + have hbudget : K + 1 + c = 2 ^ (J + k) - 1 := by + have : 2 ^ (J + 1) = 2 ^ J * 2 := Nat.pow_succ 2 J + omega + rcases z2b (J + k) J n w ((d ^ k) +> r) hd hn with ⟨s,hm,hstart⟩ + rcases z28 (J + k) (K + 1) c J V s ldh ((d ^ k) +> r) (by omega) (by omega) hm with ⟨s',hm',hrun⟩ + rcases z25 hm' (by have : 2 ^ (J + 1) = 2 ^ J * 2 := Nat.pow_succ 2 J; omega) with ⟨u,a,hu,ha,hs⟩ + have huf : u = 2 ^ J - 1 := by + have : 2 ^ (J + 1) = 2 ^ J * 2 := Nat.pow_succ 2 J + omega + rw [z1Z ha huf] at hs + rw [hbudget] at hrun + have h1 := z05 hstart hrun + rw [hs,append_assoc] at h1 + have hK1 : K + 1 = 1 + K := by omega + rw [hK1] at h1 + have h2 := zPt h1 (z27 (J + k) K ldh ((d ^ J) +> [1] +> (d ^ k) +> r) (by omega)) + exact zPt h2 (z2g (LC (J + k) K ldh) r J k) +theorem z2j {n v : Nat} {w : zF} (h : zDg n v w) (hv : v < 2 ^ n - 1) : + ∃ j u a k,n = j + k /\ 1 <= j /\ u * 2 + 1 < 2 ^ j /\ w = a ++ (d ^ k) /\ + zDg j u a /\ v = 2 ^ n - 2 ^ j + u := by + induction h with + | nil => simp at hv + | zero n v w h ih => + by_cases hsmall : v < 2 ^ n - 1 + · rcases ih hsmall with ⟨j,u,a,k,hn,hj,hu,hw,ha,heq⟩ + have hp : 2 ^ j <= 2 ^ n := z1T (by omega) + have hp1 : 2 ^ (j + 1) = 2 ^ j * 2 := Nat.pow_succ 2 j + have hpn : 2 ^ (n + 1) = 2 ^ n * 2 := Nat.pow_succ 2 n + refine ⟨j + 1,u * 2,z ++ a,k,by omega,by omega,by omega,?_,zDg.zero j u a ha,by omega⟩ + rw [hw,List.append_assoc] + · have hbound := z1W h + have heq : v = 2 ^ n - 1 := by omega + have hpn : 2 ^ (n + 1) = 2 ^ n * 2 := Nat.pow_succ 2 n + have hpn_pos := z0h n + refine ⟨1,0,z,n,by omega,by omega,by simp,?_,zDg.zero 0 0 [] .nil,by omega⟩ + rw [z1Z h heq] + | one n v w h ih => + have hpn : 2 ^ (n + 1) = 2 ^ n * 2 := Nat.pow_succ 2 n + have hpn_pos := z0h n + rcases ih (by omega) with ⟨j,u,a,k,hn,hj,hu,hw,ha,heq⟩ + have hp : 2 ^ j <= 2 ^ n := z1T (by omega) + have hp1 : 2 ^ (j + 1) = 2 ^ j * 2 := Nat.pow_succ 2 j + refine ⟨j + 1,u * 2 + 1,d ++ a,k,by omega,by omega,by omega,?_,zDg.one j u a ha,by omega⟩ + rw [hw,List.append_assoc] +theorem z2k (L n : Nat) (w : zF) (r : zB) + (hd : zDg L n w) (hn : 2 ^ L <= n * 2 + 1) : + (z18 (LC L 0 ldh) (w +> r)) [z00]⊢⁺ + (((o1 ^ (4 + L * 3)) +> ld0 +> LC L (n * 2 + 1 - 2 ^ L) ldh) {{D}}> r) := by + have hbound := z1W hd + by_cases hsmall : n < 2 ^ L - 1 + · rcases z2j hd hsmall with ⟨J,u,a,k,hL,hJ,hu,hw,ha,heq⟩ + have hk : 0 < k := by + rcases k with _ | k + · simp only [Nat.add_zero] at hL; subst hL; omega + · omega + subst hL + have hp : 2 ^ (J + 1) <= 2 ^ (J + k) := z1T (by omega) + have hpJ : 2 ^ J <= 2 ^ (J + k) := z1T (by omega) + have hpJ1 : 2 ^ (J + 1) = 2 ^ J * 2 := Nat.pow_succ 2 J + have hval : n * 2 + 1 - 2 ^ (J + k) = 2 ^ (J + k) - 2 ^ (J + 1) + u * 2 + 1 := by omega + rw [hw,append_assoc,hval] + exact z2i J k u a r ha hu hk + · have heq : n = 2 ^ L - 1 := by omega + have hval : n * 2 + 1 - 2 ^ L = 2 ^ L - 1 := by omega + rw [z1Z hd heq,hval] + exact z2h L r +theorem z2l : + (init []) [z00]⊢* (z18 (LC 7 0 ldh) (z1N +> default)) := by + unfold LC + rw [z0n] + exact z1O +def RC (n : Nat) : zB := z0j z d n +theorem z2m {n v : Nat} {w : zF} (h : zDg n v w) : + ∀ m,w +> RC m = RC (v + 2 ^ n * m) := by + induction h with + | nil => + intro m + simp + | zero n v w _ ih => + intro m + rw [append_assoc,ih] + unfold RC + rw [<- z0t z1U] + have h1 : (v + 2 ^ n * m) * 2 = v * 2 + 2 ^ (n + 1) * m := by + rw [Nat.pow_succ]; ring + rw [h1] + | one n v w _ ih => + intro m + rw [append_assoc,ih] + unfold RC + rw [<- z0u] + have h1 : (v + 2 ^ n * m) * 2 + 1 = v * 2 + 1 + 2 ^ (n + 1) * m := by + rw [Nat.pow_succ]; ring + rw [h1] +theorem z2n : ∀ (n v : Nat),v < 2 ^ n -> ∃ w,zDg n v w + | 0,v,hv => by + have hv0 : v = 0 := by simp at hv; omega + subst hv0 + exact ⟨[],.nil⟩ + | n + 1,v,hv => by + have hp : 2 ^ (n + 1) = 2 ^ n * 2 := Nat.pow_succ 2 n + let k := v / 2 + rcases Nat.mod_two_eq_zero_or_one v with h0 | h1 + · rcases z2n n k (by omega) with ⟨w,hw⟩ + have hv_eq : v = k * 2 := by omega + rw [hv_eq] + exact ⟨z ++ w,zDg.zero n k w hw⟩ + · rcases z2n n k (by omega) with ⟨w,hw⟩ + have hv_eq : v = k * 2 + 1 := by omega + rw [hv_eq] + exact ⟨d ++ w,zDg.one n k w hw⟩ +theorem z2o (n : Nat) (l : zB) : + (z19 l (RC n)) [z00]⊢⁺ (z18 l (RC (1 + n))) := by + rcases z0y z1U n with ⟨i,s,h0,h1⟩ + unfold RC + rw [h0,h1] + exact z1V l s i +theorem z2p (len k c v : Nat) (l : zB) (hk : k + c < 2 ^ len) : + (z18 (LC len (k + c) l) (RC v)) [z00]⊢* (z18 (LC len k l) (RC (v + c))) := by + induction c generalizing v with + | zero => simp; try exact ⟨0,rfl⟩ + | succ c ih => + have hkc : k + (c + 1) = 1 + (k + c) := by omega + rw [hkc] + have h1 := zPs (z27 len (k + c) l (RC v) (by omega)) + have h2 := zPs (z2o v (LC len (k + c) l)) + have h3 := ih (1 + v) (by omega) + have hvc : 1 + v + c = v + (c + 1) := by omega + rw [hvc] at h3 + exact zSt h1 (zSt h2 h3) +theorem z2q (len k v : Nat) (l : zB) (hk : k < 2 ^ len) : + (z19 (LC len k l) (RC v)) [z00]⊢* (z18 (LC len 0 l) (RC (k + v + 1))) := by + have h1 := zPs (z2o v (LC len k l)) + have h2 := z2p len 0 k (1 + v) l (by omega) + have hkv : 0 + k = k := by omega + have hkv2 : 1 + v + k = k + v + 1 := by omega + rw [hkv] at h2 + rw [hkv2] at h2 + exact zSt h1 h2 +theorem z2r (m i : Nat) (l r : zB) : + (z18 ((ld1 ^ (1 + m)) +> [1,0,1] +> l) ((d ^ i) +> z +> r)) [z00]⊢* + (z18 ((ld0 ^ (1 + m)) +> ld1 +> l) ((z ^ (1 + i)) +> [1] +> r)) := by + have h1 := z1h (1 + m) l ((d ^ i) +> z +> r) + have hm : 1 + (1 + m) = 2 + m := by omega + rw [hm,z09 ld0 2 m,append_assoc] at h1 + have h2 := z1i i ((ld0 ^ m) +> ld1 +> l) r + have hld0 : (ld0 ^ 1 : zF) = ld0 := rfl + rw [z09 ld0 1 m,hld0,append_assoc] + exact zSt h1 h2 +theorem z2s (m J v : Nat) (w : zF) (l r : zB) + (hm : 0 < m) (hd : zDg J v w) (hv : v * 2 + 1 < 2 ^ J) : + ∃ w',Marked J (v * 2 + 2) w' /\ + (z18 (LC m 0 ([1,0,1] +> l)) (w +> r)) [z00]⊢* + (z18 (LC m (2 ^ m - 1) (ld1 +> l)) (w' +> r)) := by + rcases z20 hd (by omega) with ⟨i,j,u,s,hJ,hval,hw,hs⟩ + have htop : j = 0 \/ u < 2 ^ (j - 1) := by + apply z23 i j u v hval + have hij : i + j = J - 1 := by omega + rw [hij] + exact z2a J v hv + refine ⟨(z ^ (i + 1)) ++ [1] ++ s,?_,?_⟩ + · have hJ' : J = (i + 1) + j := by omega + have hval2 : v * 2 + 2 = (u * 2 + 1) * 2 ^ (i + 1) + 0 := by + have hpi := z0h i + have hpos : 1 <= (u * 2 + 1) * 2 ^ i := Nat.mul_pos (by omega) hpi + rw [Nat.pow_succ,<- Nat.mul_assoc] + omega + rw [hJ',hval2] + exact Marked.mk (i + 1) j 0 u (z ^ (i + 1)) s (z1X (i + 1)) hs htop + · unfold LC + rw [z0n,z0o,hw] + cases m with + | zero => omega + | succ m' => + have hm' : m' + 1 = 1 + m' := by omega + have hi' : i + 1 = 1 + i := by omega + rw [hm',hi'] + simpa [append_assoc] using z2r m' i l (s +> r) +theorem z2t : ([1] : zF) +> default = RC 1 := by + unfold RC + rw [z0s] + have hd : (d : zF) +> default = [1] +> ([0,0] +> default) := rfl + have hz : ([0,0] : zF) +> default = default := by + simpa using z0g 2 + rw [hd,hz] +theorem z2u (len k J V : Nat) (w : zF) (l : zB) + (hk : k < 2 ^ len) (hV : V < 2 ^ (J + 1)) (hlo : 2 ^ J <= V + k) (hm : Marked J V w) : + (z18 (LC len k l) (w +> default)) [z00]⊢* (z18 (LC len 0 l) (RC (V + k))) := by + let c := 2 ^ J - V + have hc : c <= k := by omega + have hpJ : 2 ^ (J + 1) = 2 ^ J * 2 := Nat.pow_succ 2 J + have hvc_lo : 2 ^ J <= V + c := by omega + have hvc_hi : V + c < 2 ^ (J + 1) := by omega + rcases z28 len (k - c) c J V w l default (by omega) hvc_hi hm with ⟨a,ha,hrun⟩ + rcases z25 ha hvc_lo with ⟨u,b,hu,hb,hab⟩ + have hkc : k - c + c = k := by omega + rw [hkc,hab,append_assoc,z2t,z2m hb 1] at hrun + have h2 := z2p len 0 (k - c) (u + 2 ^ J * 1) l (by omega) + have h0kc : 0 + (k - c) = k - c := by omega + have hval : u + 2 ^ J * 1 + (k - c) = V + k := by omega + rw [h0kc,hval] at h2 + exact zSt hrun h2 +theorem z2v (m J v : Nat) (l : zB) + (hm : 0 < m) (hv : v * 2 + 1 < 2 ^ J) : + ∃ w,Marked J (v * 2 + 2) w /\ + (z18 (LC m 0 ([1,0,1] +> l)) (RC v)) [z00]⊢* + (z18 (LC m (2 ^ m - 1) (ld1 +> l)) (w +> default)) := by + rcases z2n J v (by omega) with ⟨a,ha⟩ + rcases z2s m J v a l default hm ha hv with ⟨w,hw,hrun⟩ + refine ⟨w,hw,?_⟩ + have hrc0 : (default : zB) = RC 0 := by simp [RC,z0r] + have ha_rc : a +> (default : zB) = RC v := by + rw [hrc0,z2m ha 0]; simp + rw [<- ha_rc] + exact hrun +theorem z2w (len k n : Nat) (l : zB) : + (ld0 ^ n) +> ld1 +> LC len k l = LC (len + 1 + n) ((k * 2 + 1) * 2 ^ n - 1) l := by + unfold LC + exact (z0q ld0 ld1 len k n l).symm +theorem z2x (len k n : Nat) (hk : k < 2 ^ len) : + (k * 2 + 1) * 2 ^ n - 1 < 2 ^ (len + 1 + n) := by + have hpn := z0h n + have hpos : 1 <= (k * 2 + 1) * 2 ^ n := Nat.mul_pos (by omega) hpn + have hp : 2 ^ (len + 1 + n) = (2 ^ len * 2) * 2 ^ n := by + rw [Nat.pow_add,Nat.pow_succ] + have hle : (k * 2 + 1) * 2 ^ n <= (2 ^ len * 2) * 2 ^ n := + Nat.mul_le_mul_right (2 ^ n) (by omega) + omega +theorem z2y (len k n v : Nat) (l : zB) (hk : k < 2 ^ len) : + (z18 ((ld0 ^ n) +> ld1 +> LC len k l) (RC v)) [z00]⊢* + (z18 (LC (len + 1 + n) 0 l) (RC ((k * 2 + 1) * 2 ^ n - 1 + v))) := by + rw [z2w] + have h1 := z2p (len + 1 + n) 0 ((k * 2 + 1) * 2 ^ n - 1) v l (by simpa using z2x len k n hk) + have h2 : 0 + ((k * 2 + 1) * 2 ^ n - 1) = (k * 2 + 1) * 2 ^ n - 1 := by omega + have h3 : v + ((k * 2 + 1) * 2 ^ n - 1) = (k * 2 + 1) * 2 ^ n - 1 + v := by omega + rw [h2,h3] at h1 + exact h1 +theorem z2z (len k n v : Nat) (l : zB) (hk : k < 2 ^ len) : + (z19 ((ld0 ^ n) +> ld1 +> LC len k l) (RC v)) [z00]⊢* + (z18 (LC (len + 1 + n) 0 l) (RC ((k * 2 + 1) * 2 ^ n + v))) := by + rw [z2w] + have h1 := z2q (len + 1 + n) ((k * 2 + 1) * 2 ^ n - 1) v l (z2x len k n hk) + have hpn := z0h n + have hpos : 1 <= (k * 2 + 1) * 2 ^ n := Nat.mul_pos (by omega) hpn + have h2 : (k * 2 + 1) * 2 ^ n - 1 + v + 1 = (k * 2 + 1) * 2 ^ n + v := by omega + rw [h2] at h1 + exact h1 +theorem z2A (m v : Nat) (l : zB) (hm : 0 < m) (hv : v * 2 + 1 < 2 ^ m) : + (z18 (LC m 0 ([1,0,1] +> l)) (RC v)) [z00]⊢* + (z18 (LC m 0 (ld1 +> l)) (RC (2 ^ m + v * 2 + 1))) := by + rcases z2v m m v l hm hv with ⟨w,hw,hrun⟩ + have hpm := z0h m + have hpm1 : 2 ^ (m + 1) = 2 ^ m * 2 := Nat.pow_succ 2 m + have h2 := z2u m (2 ^ m - 1) m (v * 2 + 2) w (ld1 +> l) (by omega) (by omega) (by omega) hw + have hval : v * 2 + 2 + (2 ^ m - 1) = 2 ^ m + v * 2 + 1 := by omega + rw [hval] at h2 + exact zSt hrun h2 +theorem z2B (len k n v : Nat) (l : zB) (hv : v < 2 ^ n) : + LC n v (LC len k l) = LC (len + n) (k * 2 ^ n + v) l := by + induction n generalizing v with + | zero => + have hv0 : v = 0 := by simp at hv; omega + subst hv0 + unfold LC + simp [z0i] + | succ n ih => + have hp : 2 ^ (n + 1) = 2 ^ n * 2 := Nat.pow_succ 2 n + let q := v / 2 + have hlen : len + (n + 1) = (len + n) + 1 := by omega + rcases Nat.mod_two_eq_zero_or_one v with h0 | h1 + · have hv_eq : v = q * 2 := by omega + have hval : k * 2 ^ (n + 1) + q * 2 = (k * 2 ^ n + q) * 2 := by rw [Nat.pow_succ]; ring + unfold LC at * + rw [hv_eq,hlen,hval,z0l,z0l,ih q (by omega)] + · have hv_eq : v = q * 2 + 1 := by omega + have hval : k * 2 ^ (n + 1) + (q * 2 + 1) = (k * 2 ^ n + q) * 2 + 1 := by rw [Nat.pow_succ]; ring + unfold LC at * + rw [hv_eq,hlen,hval,z0m,z0m,ih q (by omega)] +theorem z2C (len k m v : Nat) (l : zB) + (hk : k < 2 ^ len) (hm : 0 < m) (hv : v * 2 + 1 < 2 ^ m) : + (z18 (LC m 0 ([1,0,1] +> LC len k l)) (RC v)) [z00]⊢* + (z18 (LC (len + 1 + m) 0 l) (RC (k * 2 ^ (m + 1) + 2 ^ m + v * 2 + 1))) := by + have h1 := z2A m v (LC len k l) hm hv + have h_ld1 : ld1 +> LC len k l = LC (len + 1) (k * 2) l := by + unfold LC; exact (z0l ld0 ld1 len k l).symm + rw [h_ld1,z2B (len + 1) (k * 2) m 0 l (z0h m)] at h1 + have hbound : k * 2 * 2 ^ m + 0 < 2 ^ (len + 1 + m) := by + have hpm := z0h m + have hp : 2 ^ (len + 1 + m) = (2 ^ len * 2) * 2 ^ m := by rw [Nat.pow_add,Nat.pow_succ] + have hle : (k * 2 + 1) * 2 ^ m <= (2 ^ len * 2) * 2 ^ m := + Nat.mul_le_mul_right (2 ^ m) (by omega) + rw [Nat.add_mul,Nat.one_mul] at hle + omega + have h2 := z2p (len + 1 + m) 0 (k * 2 * 2 ^ m + 0) (2 ^ m + v * 2 + 1) l (by omega) + have h0 : 0 + (k * 2 * 2 ^ m + 0) = k * 2 * 2 ^ m + 0 := by omega + have hval : 2 ^ m + v * 2 + 1 + (k * 2 * 2 ^ m + 0) = k * 2 ^ (m + 1) + 2 ^ m + v * 2 + 1 := by + rw [Nat.pow_succ]; ring + rw [h0,hval] at h2 + exact zSt h1 h2 +theorem z2D (len k a m v : Nat) (l : zB) + (hk : k < 2 ^ len) (ha : 1 <= a) (hm : 0 < m) (hv : v * 2 + 1 < 2 ^ (m + 1)) : + (z18 (LC m 0 ([1,0,1] +> (ld0 ^ a) +> ld1 +> LC len k l)) (RC v)) [z00]⊢* + (z18 (LC (len + 1 + a + 1 + m) 0 l) + (RC ((((k * 2 + 1) * 2 ^ a - 1) * 2 + 1) * 2 ^ m - 1 + v * 2 + 2))) := by + rcases z2v m (m + 1) v ((ld0 ^ a) +> ld1 +> LC len k l) hm hv with ⟨w,hw,hrun⟩ + have h_rhs : LC m (2 ^ m - 1) (ld1 +> (ld0 ^ a) +> ld1 +> LC len k l) = + LC (len + 1 + a + 1 + m) ((((k * 2 + 1) * 2 ^ a - 1) * 2 + 1) * 2 ^ m - 1) l := by + have h_full : LC m (2 ^ m - 1) (ld1 +> (ld0 ^ a) +> ld1 +> LC len k l) = + (ld0 ^ m) +> ld1 +> (ld0 ^ a) +> ld1 +> LC len k l := by + unfold LC; rw [z0o] + rw [h_full,z2w len k a l,z2w (len + 1 + a) ((k * 2 + 1) * 2 ^ a - 1) m l] + rw [h_rhs] at hrun + have hbound1 := z2x len k a hk + have hbound2 := z2x (len + 1 + a) ((k * 2 + 1) * 2 ^ a - 1) m hbound1 + have hV_hi : v * 2 + 2 < 2 ^ (m + 1 + 1) := by rw [Nat.pow_succ]; omega + have hlo : 2 ^ (m + 1) <= v * 2 + 2 + ((((k * 2 + 1) * 2 ^ a - 1) * 2 + 1) * 2 ^ m - 1) := by + have hpa : 2 <= 2 ^ a := by + have : 2 ^ 1 <= 2 ^ a := z1T ha + simpa using this + have hpm := z0h m + have h1 : 2 <= (k * 2 + 1) * 2 ^ a := by + have : 1 * 2 <= (k * 2 + 1) * 2 ^ a := Nat.mul_le_mul (by omega) hpa + omega + have h2 : 2 <= ((k * 2 + 1) * 2 ^ a - 1) * 2 + 1 := by omega + have h3 : 2 * 2 ^ m <= (((k * 2 + 1) * 2 ^ a - 1) * 2 + 1) * 2 ^ m := + Nat.mul_le_mul_right (2 ^ m) h2 + rw [Nat.pow_succ] + omega + have h2 := z2u (len + 1 + a + 1 + m) ((((k * 2 + 1) * 2 ^ a - 1) * 2 + 1) * 2 ^ m - 1) + (m + 1) (v * 2 + 2) w l hbound2 hV_hi hlo hw + have hval : v * 2 + 2 + ((((k * 2 + 1) * 2 ^ a - 1) * 2 + 1) * 2 ^ m - 1) = + (((k * 2 + 1) * 2 ^ a - 1) * 2 + 1) * 2 ^ m - 1 + v * 2 + 2 := by omega + rw [hval] at h2 + exact zSt hrun h2 +theorem z2E (n : Nat) (l : zB) : + (ld0 ^ n) +> ld1 +> l = LC (1 + n) (2 ^ n - 1) l := by + have h := z2w 0 0 n l + unfold LC at h ⊢ + simp [z0i] at h + exact h +theorem z2F (len k a c e : Nat) (l : zB) + (hk : k < 2 ^ len) (ha : 1 <= a) (hc : 1 <= c) (he : e <= 1) : + (z18 (LC (1 + c) 0 ([1,0,1] +> (ld0 ^ a) +> ld1 +> LC len k l)) (RC (2 ^ c + e))) [z00]⊢* + (z18 (LC (len + a + c + 3) 0 l) (RC ((k * 2 + 1) * 2 ^ (a + c + 2) + (e * 2 + 1)))) := by + have hpow : 2 <= 2 ^ c := by + have : 2 ^ 1 <= 2 ^ c := z1T hc + simpa using this + have hv : (2 ^ c + e) * 2 + 1 < 2 ^ (1 + c + 1) := by + have : 1 + c + 1 = c + 1 + 1 := by omega + rw [this,Nat.pow_succ,Nat.pow_succ] + omega + have h1 := z2D len k a (1 + c) (2 ^ c + e) l hk ha (by omega) hv + have hlen : len + 1 + a + 1 + (1 + c) = len + a + c + 3 := by omega + have hval : (((k * 2 + 1) * 2 ^ a - 1) * 2 + 1) * 2 ^ (1 + c) - 1 + (2 ^ c + e) * 2 + 2 = + (k * 2 + 1) * 2 ^ (a + c + 2) + (e * 2 + 1) := by + have hpa := z0h a + have hpc := z0h c + have hpos1 : 1 <= (k * 2 + 1) * 2 ^ a := Nat.mul_pos (by omega) hpa + have hp_ac : (k * 2 + 1) * 2 ^ (a + c + 2) = ((k * 2 + 1) * 2 ^ a) * 2 ^ c * 4 := by + have : a + c + 2 = a + c + 1 + 1 := by omega + rw [this,Nat.pow_succ,Nat.pow_succ,Nat.pow_add]; ring + have hp_1c : 2 ^ (1 + c) = 2 ^ c * 2 := by rw [Nat.add_comm 1 c,Nat.pow_succ] + rw [hp_ac,hp_1c] + have hsub : ((k * 2 + 1) * 2 ^ a - 1) * 2 + 1 = (k * 2 + 1) * 2 ^ a * 2 - 1 := by omega + have hmul : ((k * 2 + 1) * 2 ^ a * 2) * (2 ^ c * 2) = ((k * 2 + 1) * 2 ^ a) * 2 ^ c * 4 := by ring + have hge : 2 ^ c <= ((k * 2 + 1) * 2 ^ a) * 2 ^ c := Nat.le_mul_of_pos_left _ hpos1 + rw [hsub,Nat.sub_mul,Nat.one_mul,hmul] + omega + rw [hlen,hval] at h1 + exact h1 +theorem z2G (len k a c : Nat) (l : zB) + (hk : k < 2 ^ len) (ha : 1 <= a) (hc : 1 <= c) : + (z19 ((ld0 ^ c) +> ld1 +> [1,0,1] +> (ld0 ^ a) +> ld1 +> LC len k l) (RC 0)) [z00]⊢* + (z18 (LC (len + a + c + 3) 0 l) (RC ((k * 2 + 1) * 2 ^ (a + c + 2) + 1))) := by + rw [z2E c ([1,0,1] +> (ld0 ^ a) +> ld1 +> LC len k l)] + have hpc := z0h c + have hbound : 2 ^ c - 1 < 2 ^ (1 + c) := by rw [Nat.add_comm 1 c,Nat.pow_succ]; omega + have h1 := z2q (1 + c) (2 ^ c - 1) 0 ([1,0,1] +> (ld0 ^ a) +> ld1 +> LC len k l) hbound + have hval1 : 2 ^ c - 1 + 0 + 1 = 2 ^ c + 0 := by omega + rw [hval1] at h1 + have h2 := z2F len k a c 0 l hk ha hc (by omega) + exact zSt h1 h2 +theorem z2H (len k a c : Nat) (l : zB) + (hk : k < 2 ^ len) (ha : 1 <= a) (hc : 1 <= c) : + (z18 ((ld0 ^ c) +> ld1 +> [1,0,1] +> (ld0 ^ a) +> ld1 +> LC len k l) (RC 2)) [z00]⊢* + (z18 (LC (len + a + c + 3) 0 l) (RC ((k * 2 + 1) * 2 ^ (a + c + 2) + 3))) := by + rw [z2E c ([1,0,1] +> (ld0 ^ a) +> ld1 +> LC len k l)] + have hpc := z0h c + have hbound : 0 + (2 ^ c - 1) < 2 ^ (1 + c) := by rw [Nat.add_comm 1 c,Nat.pow_succ]; omega + have h1 := z2p (1 + c) 0 (2 ^ c - 1) 2 ([1,0,1] +> (ld0 ^ a) +> ld1 +> LC len k l) hbound + have h0 : 0 + (2 ^ c - 1) = 2 ^ c - 1 := by omega + have hval1 : 2 + (2 ^ c - 1) = 2 ^ c + 1 := by omega + rw [h0,hval1] at h1 + have h2 := z2F len k a c 1 l hk ha hc (by omega) + exact zSt h1 h2 +theorem z2I : ([0,0,0,1,0,0] : zF) +> default = RC 2 := by + have h : RC 2 = z +> z0j z d 1 := z0t z1U 1 + rw [h,z0s]; rfl +theorem z2J : ([0,0,0,0,0,0,1,0,0] : zF) +> default = RC 4 := by + have h1 : RC 4 = z +> z0j z d 2 := z0t z1U 2 + have h2 : z0j z d 2 = z +> z0j z d 1 := z0t z1U 1 + rw [h1,h2,z0s]; rfl +theorem z2K : (default : zB) = RC 0 := by + simp [RC,z0r] +theorem z2L (len k a c : Nat) (l : zB) (hk : k < 2 ^ len) : + (((o1 ^ (4 + a * 2)) +> ld0 +> LC len k l) {{D}}> + ([1,0,0,0] +> (o1 ^ (2 + c * 2)) +> default)) [z00]⊢* + (z18 (LC (len + 1 + (3 + a + c)) 0 l) (RC ((k * 2 + 1) * 2 ^ (3 + a + c) + 1))) := by + have h1 := z1n a c (LC len k l) + rw [z2I] at h1 + have h2 := z2y len k (3 + a + c) 2 l hk + have hp := z0h (3 + a + c) + have hpos : 1 <= (k * 2 + 1) * 2 ^ (3 + a + c) := Nat.mul_pos (by omega) hp + have hval : (k * 2 + 1) * 2 ^ (3 + a + c) - 1 + 2 = (k * 2 + 1) * 2 ^ (3 + a + c) + 1 := by omega + rw [hval] at h2 + exact zSt h1 h2 +theorem z2M (len k a c : Nat) (l : zB) (hk : k < 2 ^ len) : + (((o1 ^ (4 + a * 2)) +> ld0 +> LC len k l) {{D}}> + ([1,0,0,0] +> (o1 ^ (1 + c * 2)) +> default)) [z00]⊢* + (z18 (LC (len + 1 + (3 + a + c)) 0 l) (RC ((k * 2 + 1) * 2 ^ (3 + a + c)))) := by + have h1 := z1o a c (LC len k l) + have h2 := z2z len k (3 + a + c) 0 l hk + rw [<- z2K] at h2 + simp only [Nat.add_zero] at h2 + exact zSt h1 h2 +theorem z2N (len k a c : Nat) (l : zB) (hk : k < 2 ^ len) : + (((o1 ^ (5 + a * 2)) +> ld0 +> LC len k l) {{D}}> + ([1,0,0,0] +> (o1 ^ (2 + c * 2)) +> default)) [z00]⊢* + (z18 (LC (len + 1 + (4 + a + c)) 0 l) (RC ((k * 2 + 1) * 2 ^ (4 + a + c)))) := by + have h1 := z1p a c (LC len k l) + have h2 := z2z len k (4 + a + c) 0 l hk + rw [<- z2K] at h2 + simp only [Nat.add_zero] at h2 + exact zSt h1 h2 +theorem z2O (len k a c : Nat) (l : zB) (hk : k < 2 ^ len) : + (((o1 ^ (5 + a * 2)) +> ld0 +> LC len k l) {{D}}> + ([1,0,0,0] +> (o1 ^ (1 + c * 2)) +> default)) [z00]⊢* + (z18 (LC (len + 1 + (3 + a + c)) 0 l) (RC ((k * 2 + 1) * 2 ^ (3 + a + c) + 1))) := by + have h1 := z1q a c (LC len k l) + rw [z2I] at h1 + have h2 := z2y len k (3 + a + c) 2 l hk + have hp := z0h (3 + a + c) + have hpos : 1 <= (k * 2 + 1) * 2 ^ (3 + a + c) := Nat.mul_pos (by omega) hp + have hval : (k * 2 + 1) * 2 ^ (3 + a + c) - 1 + 2 = (k * 2 + 1) * 2 ^ (3 + a + c) + 1 := by omega + rw [hval] at h2 + exact zSt h1 h2 +theorem z2P (len k t s e : Nat) (l : zB) + (hk : k < 2 ^ len) (ht : 0 < t) (he : e <= 1) (hs : len * 3 + t + 7 = s * 2 + e) : + (((o1 ^ (4 + len * 3)) +> ld0 +> LC len k l) {{D}}> + ([1,0,0,0] +> (o1 ^ t) +> default)) [z00]⊢* + (z18 (LC (len + s) 0 l) (RC (k * 2 ^ s + 2 ^ (s - 1) + e))) := by + let a := len / 2 + let c := t / 2 + rcases Nat.mod_two_eq_zero_or_one len with hlen0 | hlen1 <;> + rcases Nat.mod_two_eq_zero_or_one t with ht0 | ht1 + · cases hc_eq : c with + | zero => omega + | succ c' => + have h_len : 4 + len * 3 = 4 + (a * 3) * 2 := by omega + have h_t : t = 2 + c' * 2 := by omega + have he_eq : e = 1 := by omega + have hs_eq : s = 4 + a * 3 + c' := by omega + rw [h_len,h_t] + have h1 := z2L len k (a * 3) c' l hk + have hlen_s : len + 1 + (3 + a * 3 + c') = len + s := by omega + have hval : (k * 2 + 1) * 2 ^ (3 + a * 3 + c') + 1 = k * 2 ^ s + 2 ^ (s - 1) + e := by + have hs1 : s - 1 = 3 + a * 3 + c' := by omega + have hs2 : s = (3 + a * 3 + c') + 1 := by omega + rw [hs1,hs2,he_eq,Nat.pow_succ]; ring + rw [hlen_s,hval] at h1 + exact h1 + · have h_len : 4 + len * 3 = 4 + (a * 3) * 2 := by omega + have h_t : t = 1 + c * 2 := by omega + have he_eq : e = 0 := by omega + have hs_eq : s = 4 + a * 3 + c := by omega + rw [h_len,h_t] + have h1 := z2M len k (a * 3) c l hk + have hlen_s : len + 1 + (3 + a * 3 + c) = len + s := by omega + have hval : (k * 2 + 1) * 2 ^ (3 + a * 3 + c) = k * 2 ^ s + 2 ^ (s - 1) + e := by + have hs1 : s - 1 = 3 + a * 3 + c := by omega + have hs2 : s = (3 + a * 3 + c) + 1 := by omega + rw [hs1,hs2,he_eq,Nat.pow_succ]; ring + rw [hlen_s,hval] at h1 + exact h1 + · cases hc_eq : c with + | zero => omega + | succ c' => + have h_len : 4 + len * 3 = 5 + (1 + a * 3) * 2 := by omega + have h_t : t = 2 + c' * 2 := by omega + have he_eq : e = 0 := by omega + have hs_eq : s = 6 + a * 3 + c' := by omega + rw [h_len,h_t] + have h1 := z2N len k (1 + a * 3) c' l hk + have hlen_s : len + 1 + (4 + (1 + a * 3) + c') = len + s := by omega + have hval : (k * 2 + 1) * 2 ^ (4 + (1 + a * 3) + c') = k * 2 ^ s + 2 ^ (s - 1) + e := by + have hs1 : s - 1 = 4 + (1 + a * 3) + c' := by omega + have hs2 : s = (4 + (1 + a * 3) + c') + 1 := by omega + rw [hs1,hs2,he_eq,Nat.pow_succ]; ring + rw [hlen_s,hval] at h1 + exact h1 + · have h_len : 4 + len * 3 = 5 + (1 + a * 3) * 2 := by omega + have h_t : t = 1 + c * 2 := by omega + have he_eq : e = 1 := by omega + have hs_eq : s = 5 + a * 3 + c := by omega + rw [h_len,h_t] + have h1 := z2O len k (1 + a * 3) c l hk + have hlen_s : len + 1 + (3 + (1 + a * 3) + c) = len + s := by omega + have hval : (k * 2 + 1) * 2 ^ (3 + (1 + a * 3) + c) + 1 = k * 2 ^ s + 2 ^ (s - 1) + e := by + have hs1 : s - 1 = 3 + (1 + a * 3) + c := by omega + have hs2 : s = (3 + (1 + a * 3) + c) + 1 := by omega + rw [hs1,hs2,he_eq,Nat.pow_succ]; ring + rw [hlen_s,hval] at h1 + exact h1 +theorem z2Q (len k t s e : Nat) (l : zB) + (hk : k < 2 ^ len) (ht : 4 <= t) (he : e <= 1) (hs : len * 3 + t + 7 = s * 2 + e) : + (((o1 ^ (4 + len * 3)) +> ld0 +> LC len k l) {{D}}> + ([1,1,0,0,0] +> (o1 ^ t) +> default)) [z00]⊢* + (z18 (LC (len + s) 0 l) (RC (k * 2 ^ s + 2 ^ (s - 1) + e * 2 + 1))) := by + let a := len / 2 + let c0 := t - 4 + let c := c0 / 2 + rcases Nat.mod_two_eq_zero_or_one len with hlen0 | hlen1 <;> + rcases Nat.mod_two_eq_zero_or_one c0 with hc0 | hc1 + · have h_len : 4 + len * 3 = 4 + (a * 3) * 2 := by omega + have h_t : t = 4 + c * 2 := by omega + have he_eq : e = 1 := by omega + have hs_eq : s = 5 + a * 3 + c := by omega + rw [h_len,h_t] + have h1 := z1r (a * 3) c (LC len k l) + rw [z2I] at h1 + have h2 := z2H len k (1 + a * 3) (1 + c) l hk (by omega) (by omega) + have hlen_s : len + (1 + a * 3) + (1 + c) + 3 = len + s := by omega + have hval : (k * 2 + 1) * 2 ^ ((1 + a * 3) + (1 + c) + 2) + 3 = + k * 2 ^ s + 2 ^ (s - 1) + e * 2 + 1 := by + have hs1 : s - 1 = (1 + a * 3) + (1 + c) + 2 := by omega + have hs2 : s = ((1 + a * 3) + (1 + c) + 2) + 1 := by omega + rw [hs1,hs2,he_eq,Nat.pow_succ]; ring + rw [hlen_s,hval] at h2 + exact zSt h1 h2 + · have h_len : 4 + len * 3 = 4 + (a * 3) * 2 := by omega + have h_t : t = 5 + c * 2 := by omega + have he_eq : e = 0 := by omega + have hs_eq : s = 6 + a * 3 + c := by omega + rw [h_len,h_t] + have h1 := z1s (a * 3) c (LC len k l) + have h2 := z2G len k (1 + a * 3) (2 + c) l hk (by omega) (by omega) + rw [<- z2K] at h2 + have hlen_s : len + (1 + a * 3) + (2 + c) + 3 = len + s := by omega + have hval : (k * 2 + 1) * 2 ^ ((1 + a * 3) + (2 + c) + 2) + 1 = + k * 2 ^ s + 2 ^ (s - 1) + e * 2 + 1 := by + have hs1 : s - 1 = (1 + a * 3) + (2 + c) + 2 := by omega + have hs2 : s = ((1 + a * 3) + (2 + c) + 2) + 1 := by omega + rw [hs1,hs2,he_eq,Nat.pow_succ]; ring + rw [hlen_s,hval] at h2 + exact zSt h1 h2 + · have h_len : 4 + len * 3 = 5 + (1 + a * 3) * 2 := by omega + have h_t : t = 4 + c * 2 := by omega + have he_eq : e = 0 := by omega + have hs_eq : s = 7 + a * 3 + c := by omega + rw [h_len,h_t] + have h1 := z1t (1 + a * 3) c (LC len k l) + have h2 := z2G len k (2 + (1 + a * 3)) (1 + c) l hk (by omega) (by omega) + rw [<- z2K] at h2 + have hlen_s : len + (2 + (1 + a * 3)) + (1 + c) + 3 = len + s := by omega + have hval : (k * 2 + 1) * 2 ^ ((2 + (1 + a * 3)) + (1 + c) + 2) + 1 = + k * 2 ^ s + 2 ^ (s - 1) + e * 2 + 1 := by + have hs1 : s - 1 = (2 + (1 + a * 3)) + (1 + c) + 2 := by omega + have hs2 : s = ((2 + (1 + a * 3)) + (1 + c) + 2) + 1 := by omega + rw [hs1,hs2,he_eq,Nat.pow_succ]; ring + rw [hlen_s,hval] at h2 + exact zSt h1 h2 + · have h_len : 4 + len * 3 = 5 + (1 + a * 3) * 2 := by omega + have h_t : t = 5 + c * 2 := by omega + have he_eq : e = 1 := by omega + have hs_eq : s = 7 + a * 3 + c := by omega + rw [h_len,h_t] + have h1 := z1u (1 + a * 3) c (LC len k l) + rw [z2I] at h1 + have h2 := z2H len k (2 + (1 + a * 3)) (1 + c) l hk (by omega) (by omega) + have hlen_s : len + (2 + (1 + a * 3)) + (1 + c) + 3 = len + s := by omega + have hval : (k * 2 + 1) * 2 ^ ((2 + (1 + a * 3)) + (1 + c) + 2) + 3 = + k * 2 ^ s + 2 ^ (s - 1) + e * 2 + 1 := by + have hs1 : s - 1 = (2 + (1 + a * 3)) + (1 + c) + 2 := by omega + have hs2 : s = ((2 + (1 + a * 3)) + (1 + c) + 2) + 1 := by omega + rw [hs1,hs2,he_eq,Nat.pow_succ]; ring + rw [hlen_s,hval] at h2 + exact zSt h1 h2 +def zDb (len k : Nat) (l : zB) : zB := + (o1 ^ (len * 3 + 3)) +> ld0 +> LC len k l +theorem z2R (len k n : Nat) (l : zB) : + (ld1 ^ n) +> ld0 +> LC len k l = LC (len + 1 + n) ((k * 2 + 1) * 2 ^ n) l := by + unfold LC + rw [z0p ld0 ld1 (len + 1) (k * 2 + 1) n l,z0m] +theorem z2S (a k : Nat) (l : zB) : + zDb (a * 2 + 1) k l = LC (a * 2 + 1 + 1 + (a * 3 + 3)) ((k * 2 + 1) * 2 ^ (a * 3 + 3)) l := by + unfold zDb + have h1 : (a * 2 + 1) * 3 + 3 = (a * 3 + 3) * 2 := by omega + have h2 : (o1 ++ o1) = ld1 := rfl + rw [h1,z0d,h2] + exact z2R (a * 2 + 1) k (a * 3 + 3) l +theorem z2T (a k : Nat) (l : zB) : + zDb (a * 2) k l = LC (a * 3 + 1) 0 ([1,0,1] +> LC (a * 2) k l) := by + unfold zDb LC + rw [z0n] + have h1 : a * 2 * 3 + 3 = (a * 3 + 1) * 2 + 1 := by omega + have h2 : (o1 ++ o1) = ld1 := rfl + rw [h1,z09 o1 ((a * 3 + 1) * 2) 1,z0d,h2,append_assoc] + rfl +theorem z2U (a k n v r : Nat) (l : zB) + (hk : k < 2 ^ (a * 2 + 1)) (hv : v < 2 ^ n) : + (z18 (LC n v (zDb (a * 2 + 1) k l)) (RC r)) [z00]⊢* + (z18 (LC (a * 2 + 1 + (a * 3 + 4 + n)) 0 l) + (RC ((k * 2 + 1) * 2 ^ (a * 3 + 3 + n) + v + r))) := by + rw [z2S,z2B _ _ _ _ _ hv] + have hbound : ((k * 2 + 1) * 2 ^ (a * 3 + 3)) * 2 ^ n + v < 2 ^ (a * 2 + 1 + 1 + (a * 3 + 3) + n) := by + have hp : 2 ^ (a * 2 + 1 + 1 + (a * 3 + 3) + n) = + (2 ^ (a * 2 + 1) * 2) * 2 ^ (a * 3 + 3) * 2 ^ n := by + rw [Nat.pow_add,Nat.pow_add,Nat.pow_succ] + have hle1 : k * 2 + 1 + 1 <= 2 ^ (a * 2 + 1) * 2 := by omega + have hle2 : (k * 2 + 1 + 1) * (2 ^ (a * 3 + 3) * 2 ^ n) <= + (2 ^ (a * 2 + 1) * 2) * (2 ^ (a * 3 + 3) * 2 ^ n) := + Nat.mul_le_mul_right _ hle1 + rw [Nat.add_mul,Nat.one_mul,<- Nat.mul_assoc,<- Nat.mul_assoc] at hle2 + have hpos : 0 < 2 ^ (a * 3 + 3) := z0h (a * 3 + 3) + have hv_lt : v < 2 ^ (a * 3 + 3) * 2 ^ n := by + have : 1 * 2 ^ n <= 2 ^ (a * 3 + 3) * 2 ^ n := Nat.mul_le_mul_right (2 ^ n) hpos + omega + omega + have h1 := z2p (a * 2 + 1 + 1 + (a * 3 + 3) + n) 0 + (((k * 2 + 1) * 2 ^ (a * 3 + 3)) * 2 ^ n + v) r l (by omega) + have h0 : 0 + (((k * 2 + 1) * 2 ^ (a * 3 + 3)) * 2 ^ n + v) = + ((k * 2 + 1) * 2 ^ (a * 3 + 3)) * 2 ^ n + v := by omega + have hlen : a * 2 + 1 + 1 + (a * 3 + 3) + n = a * 2 + 1 + (a * 3 + 4 + n) := by omega + have hval : r + (((k * 2 + 1) * 2 ^ (a * 3 + 3)) * 2 ^ n + v) = + (k * 2 + 1) * 2 ^ (a * 3 + 3 + n) + v + r := by + rw [Nat.pow_add]; ring + rw [h0,hlen,hval] at h1 + rw [hlen] + exact h1 +theorem z2V (a k n v r : Nat) (l : zB) + (ha : 0 < a) (hk : k < 2 ^ (a * 2)) (hv : v < 2 ^ n) (hvr : v + r < 2 ^ (n + 2)) : + (z18 (LC n v (zDb (a * 2) k l)) (RC r)) [z00]⊢* + (z18 (LC (a * 2 + (a * 3 + 2 + n)) 0 l) + (RC ((k * 2 + 1) * 2 ^ (a * 3 + 1 + n) + (v + r) * 2 + 1))) := by + rw [z2T,z2B _ _ _ _ _ hv] + have h0v : 0 * 2 ^ n + v = v := by simp + rw [h0v] + have hn_le : 2 ^ n <= 2 ^ (a * 3 + 1 + n) := z1T (by omega) + have h1 := z2p (a * 3 + 1 + n) 0 v r ([1,0,1] +> LC (a * 2) k l) (by omega) + have h0 : 0 + v = v := by omega + rw [h0] at h1 + have hvr_bound : (r + v) * 2 + 1 < 2 ^ (a * 3 + 1 + n) := by + have hp : 2 ^ (n + 2 + 1) <= 2 ^ (a * 3 + 1 + n) := z1T (by omega) + rw [Nat.pow_succ] at hp + omega + have h2 := z2C (a * 2) k (a * 3 + 1 + n) (r + v) l hk (by omega) hvr_bound + have hlen : a * 2 + 1 + (a * 3 + 1 + n) = a * 2 + (a * 3 + 2 + n) := by omega + have hval : k * 2 ^ (a * 3 + 1 + n + 1) + 2 ^ (a * 3 + 1 + n) + (r + v) * 2 + 1 = + (k * 2 + 1) * 2 ^ (a * 3 + 1 + n) + (v + r) * 2 + 1 := by + rw [Nat.pow_succ]; ring + rw [hlen,hval] at h2 + exact zSt h1 h2 +theorem z2W (a b : Nat) (l : zB) : + [1] +> (([1,0] ^ b) +> (o1 ^ (1 + a)) +> l) = + ld1 +> (ld0 ^ b) +> (o1 ^ a) +> l := by + rw [z09 o1 1 a] + have h1 : (o1 ^ 1 : zF) = [1] := rfl + have hrot : (([1,0] : zF) ^ b) +> ([1] +> ((o1 ^ a) +> l)) = + [1] +> ((ld0 ^ b) +> ((o1 ^ a) +> l)) := by + have h10 : ([1,0] : zF) = [1] ++ [0] := rfl + rw [<- append_assoc,h10,z0b [1] [0] b,append_assoc]; rfl + rw [h1,append_assoc,hrot] + rfl +theorem z2X (len b : Nat) (l : zB) : + [1] +> (([1,0] ^ b) +> (o1 ^ (4 + len * 3)) +> l) = + ld1 +> (ld0 ^ b) +> (o1 ^ (len * 3 + 3)) +> l := by + have hlen : 4 + len * 3 = 1 + (len * 3 + 3) := by omega + rw [hlen] + exact z2W (len * 3 + 3) b l +theorem z2Y (b c : Nat) (l : zB) : + (ld0 ^ c) +> ld1 +> (ld0 ^ b) +> l = + LC (b + 1 + c) ((2 ^ (b + 1) - 1) * 2 ^ c - 1) l := by + have hpb := z0h b + have h1 : (2 ^ (b + 1) - 1) * 2 ^ c - 1 = ((2 ^ b - 1) * 2 + 1) * 2 ^ c - 1 := by + rw [Nat.pow_succ] + have : 2 ^ b * 2 - 1 = (2 ^ b - 1) * 2 + 1 := by omega + rw [this] + rw [h1,<- z2w b (2 ^ b - 1) c l] + unfold LC + rw [z0o] +theorem z2Z (b c : Nat) : (2 ^ (b + 1) - 1) * 2 ^ c - 1 < 2 ^ (b + 1 + c) := by + have hpb := z0h (b + 1) + have hpc := z0h c + have hpos : 1 <= (2 ^ (b + 1) - 1) * 2 ^ c := Nat.mul_pos (by omega) hpc + have hp : 2 ^ (b + 1 + c) = 2 ^ (b + 1) * 2 ^ c := Nat.pow_add 2 (b + 1) c + have hle : (2 ^ (b + 1) - 1) * 2 ^ c <= 2 ^ (b + 1) * 2 ^ c := + Nat.mul_le_mul_right (2 ^ c) (by omega) + omega +theorem z30 (len k b c : Nat) (l : zB) : + (((o1 ^ (4 + len * 3)) +> ld0 +> LC len k l) {{D}}> + ((o1 ^ (3 + b * 2)) +> z +> (o1 ^ (3 + c * 2)) +> default)) [z00]⊢* + (z18 (LC (b + 1 + (2 + c)) ((2 ^ (b + 1) - 1) * 2 ^ (2 + c) - 1) (zDb len k l)) (RC 2)) := by + have h1 := z1g b c ((o1 ^ (4 + len * 3)) +> ld0 +> LC len k l) + rw [z2X len b (ld0 +> LC len k l)] at h1 + have hdb : (o1 ^ (len * 3 + 3)) +> ld0 +> LC len k l = zDb len k l := rfl + rw [hdb,z2Y b (2 + c) (zDb len k l),z2I] at h1 + exact h1 +theorem z31 (a q h k n v r : Nat) (l : zB) + (hqh : q + h = 1) (hL : 0 < a * 2 + q) (hk : k < 2 ^ (a * 2 + q)) + (hv : v < 2 ^ n) (hvr : v + r < 2 ^ (n + 2)) : + let s := a * 3 + 2 + q * 2 + n + (z18 (LC n v (zDb (a * 2 + q) k l)) (RC r)) [z00]⊢* + (z18 (LC (a * 2 + q + s) 0 l) + (RC (k * 2 ^ s + 2 ^ (s - 1) + (v + r) * (1 + h) + h))) := by + intro s + rcases q with _ | _ | q + · have hh : h = 1 := by omega + subst hh + have hq0 : a * 2 + 0 = a * 2 := by omega + have hs_eq : s = a * 3 + 2 + n := by omega + rw [hq0] at hk ⊢ + have h1 := z2V a k n v r l (by omega) hk hv hvr + have hlen : a * 2 + (a * 3 + 2 + n) = a * 2 + s := by omega + have hval : (k * 2 + 1) * 2 ^ (a * 3 + 1 + n) + (v + r) * 2 + 1 = + k * 2 ^ s + 2 ^ (s - 1) + (v + r) * (1 + 1) + 1 := by + have hs1 : s - 1 = a * 3 + 1 + n := by omega + have hs2 : s = (a * 3 + 1 + n) + 1 := by omega + rw [hs1,hs2,Nat.pow_succ]; ring + rw [hlen,hval] at h1 + exact h1 + · have hh : h = 0 := by omega + subst hh + have hs_eq : s = a * 3 + 4 + n := by omega + have h1 := z2U a k n v r l hk hv + have hlen : a * 2 + 1 + (a * 3 + 4 + n) = a * 2 + 1 + s := by omega + have hval : (k * 2 + 1) * 2 ^ (a * 3 + 3 + n) + v + r = + k * 2 ^ s + 2 ^ (s - 1) + (v + r) * (1 + 0) + 0 := by + have hs1 : s - 1 = a * 3 + 3 + n := by omega + have hs2 : s = (a * 3 + 3 + n) + 1 := by omega + rw [hs1,hs2,Nat.pow_succ]; ring + rw [hlen,hval] at h1 + exact h1 + · omega +theorem z32 (a q h k b c : Nat) (l : zB) + (hqh : q + h = 1) (hL : 0 < a * 2 + q) (hk : k < 2 ^ (a * 2 + q)) : + let s := a * 3 + 2 + q * 2 + (b + 1 + (2 + c)) + (((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) {{D}}> + ((o1 ^ (3 + b * 2)) +> z +> (o1 ^ (3 + c * 2)) +> default)) [z00]⊢* + (z18 (LC (a * 2 + q + s) 0 l) + (RC (k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ (b + 1) - 1) * 2 ^ (2 + c) + 1) * (1 + h) + h))) := by + intro s + have h1 := z30 (a * 2 + q) k b c l + have hv := z2Z b (2 + c) + have hvr : (2 ^ (b + 1) - 1) * 2 ^ (2 + c) - 1 + 2 < 2 ^ (b + 1 + (2 + c) + 2) := by + have hp := z0h (b + 1 + (2 + c)) + rw [Nat.pow_add 2 (b + 1 + (2 + c)) 2] + omega + have h2 := z31 a q h k (b + 1 + (2 + c)) ((2 ^ (b + 1) - 1) * 2 ^ (2 + c) - 1) 2 l + hqh hL hk hv hvr + have hpb := z0h b + have hpc := z0h (2 + c) + have hpos1 : 2 <= 2 ^ (b + 1) := by rw [Nat.pow_succ]; omega + have hpos2 : 1 <= (2 ^ (b + 1) - 1) * 2 ^ (2 + c) := Nat.mul_pos (by omega) hpc + have hval : (2 ^ (b + 1) - 1) * 2 ^ (2 + c) - 1 + 2 = (2 ^ (b + 1) - 1) * 2 ^ (2 + c) + 1 := by omega + rw [hval] at h2 + exact zSt h1 h2 +theorem z33 (a q h k b c r : Nat) (l : zB) + (hqh : q + h = 1) (hL : 0 < a * 2 + q) (hk : k < 2 ^ (a * 2 + q)) + (hr1 : 1 <= r) (hr2 : r <= 2) : + let s := a * 3 + 2 + q * 2 + (b + 1 + c) + (z18 (LC (b + 1 + c) ((2 ^ (b + 1) - 1) * 2 ^ c - 1) (zDb (a * 2 + q) k l)) (RC r)) [z00]⊢* + (z18 (LC (a * 2 + q + s) 0 l) + (RC (k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ (b + 1) - 1) * 2 ^ c + (r - 1)) * (1 + h) + h))) := by + intro s + have hv := z2Z b c + have hvr : (2 ^ (b + 1) - 1) * 2 ^ c - 1 + r < 2 ^ (b + 1 + c + 2) := by + have hp := z0h (b + 1 + c) + rw [Nat.pow_add 2 (b + 1 + c) 2] + omega + have h1 := z31 a q h k (b + 1 + c) ((2 ^ (b + 1) - 1) * 2 ^ c - 1) r l hqh hL hk hv hvr + have hpb := z0h b + have hpc := z0h c + have hpos1 : 2 <= 2 ^ (b + 1) := by rw [Nat.pow_succ]; omega + have hpos2 : 1 <= (2 ^ (b + 1) - 1) * 2 ^ c := Nat.mul_pos (by omega) hpc + have hval : (2 ^ (b + 1) - 1) * 2 ^ c - 1 + r = (2 ^ (b + 1) - 1) * 2 ^ c + (r - 1) := by omega + rw [hval] at h1 + exact h1 +theorem z34 (a q h k b c : Nat) (l : zB) + (hqh : q + h = 1) (hL : 0 < a * 2 + q) (hk : k < 2 ^ (a * 2 + q)) : + let s := a * 3 + 2 + q * 2 + (b + 1 + (4 + c)) + (((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) {{D}}> + ((o1 ^ (3 + b * 2)) +> z +> (o1 ^ (6 + c * 2)) +> default)) [z00]⊢* + (z18 (LC (a * 2 + q + s) 0 l) + (RC (k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ (b + 1) - 1) * 2 ^ (4 + c)) * (1 + h) + h))) := by + intro s + have h1 := z1f b c ((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) + rw [z2X (a * 2 + q) b (ld0 +> LC (a * 2 + q) k l)] at h1 + have hdb : (o1 ^ ((a * 2 + q) * 3 + 3)) +> ld0 +> LC (a * 2 + q) k l = zDb (a * 2 + q) k l := rfl + rw [hdb,z2Y b (4 + c) (zDb (a * 2 + q) k l)] at h1 + have h2 := zPs (z2o 0 (LC (b + 1 + (4 + c)) ((2 ^ (b + 1) - 1) * 2 ^ (4 + c) - 1) (zDb (a * 2 + q) k l))) + rw [<- z2K] at h2 + have h3 := z33 a q h k b (4 + c) 1 l hqh hL hk (by omega) (by omega) + simp only [Nat.sub_self,Nat.add_zero] at h3 + exact zSt h1 (zSt h2 h3) +theorem z35 (a q h k b : Nat) (l : zB) + (hqh : q + h = 1) (hL : 0 < a * 2 + q) (hk : k < 2 ^ (a * 2 + q)) : + let s := a * 3 + 2 + q * 2 + (b + 1 + 1) + (((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) {{D}}> + ((o1 ^ (3 + b * 2)) +> z +> [1] +> default)) [z00]⊢* + (z18 (LC (a * 2 + q + s) 0 l) + (RC (k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ (b + 1) - 1) * 2 + 1) * (1 + h) + h))) := by + intro s + have h1 := z1E b ((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) + have h_r : (o1 ^ (3 + b * 2)) +> [0,0,0,1] +> (default : zB) = + (o1 ^ (3 + b * 2)) +> z +> [1] +> default := rfl + rw [h_r,z2X (a * 2 + q) b (ld0 +> LC (a * 2 + q) k l)] at h1 + have hdb : (o1 ^ ((a * 2 + q) * 3 + 3)) +> ld0 +> LC (a * 2 + q) k l = zDb (a * 2 + q) k l := rfl + have hld0 : ld0 +> ld1 +> (ld0 ^ b) +> zDb (a * 2 + q) k l = + (ld0 ^ 1) +> ld1 +> (ld0 ^ b) +> zDb (a * 2 + q) k l := rfl + rw [hdb,hld0,z2Y b 1 (zDb (a * 2 + q) k l),z2I] at h1 + have h2 := z33 a q h k b 1 2 l hqh hL hk (by omega) (by omega) + simp only [Nat.pow_one] at h2 + exact zSt h1 h2 +theorem z36 (b c : Nat) (l : zB) : + (ld1 ^ c) +> (ld0 ^ b) +> l = LC (b + c) ((2 ^ b - 1) * 2 ^ c) l := by + unfold LC + rw [z0p,z0o] +theorem z37 (a q h k b c : Nat) (l : zB) + (hqh : q + h = 1) (hL : 0 < a * 2 + q) (hk : k < 2 ^ (a * 2 + q)) : + let s := a * 3 + 2 + q * 2 + (b + c) + (z18 ((ld1 ^ c) +> (ld0 ^ b) +> zDb (a * 2 + q) k l) (RC 0)) [z00]⊢* + (z18 (LC (a * 2 + q + s) 0 l) + (RC (k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ b - 1) * 2 ^ c) * (1 + h) + h))) := by + intro s + rw [z36] + have hpb := z0h b + have hpc := z0h c + have hv : (2 ^ b - 1) * 2 ^ c < 2 ^ (b + c) := by + rw [Nat.pow_add] + have hlt : 2 ^ b - 1 < 2 ^ b := by omega + exact Nat.mul_lt_mul_of_pos_right hlt hpc + have hvr : (2 ^ b - 1) * 2 ^ c + 0 < 2 ^ (b + c + 2) := by + rw [Nat.pow_add 2 (b + c) 2] + have hp := z0h (b + c) + omega + have h1 := z31 a q h k (b + c) ((2 ^ b - 1) * 2 ^ c) 0 l hqh hL hk hv hvr + simp only [Nat.add_zero] at h1 + exact h1 +theorem z38 (a b c : Nat) (l : zB) : + (o1 ^ (1 + c * 2)) +> (([1,0] ^ b) +> (o1 ^ (1 + a)) +> l) = + (ld1 ^ (1 + c)) +> (ld0 ^ b) +> (o1 ^ a) +> l := by + have hc1 : 1 + c * 2 = c * 2 + 1 := by omega + have hc2 : 1 + c = c + 1 := by omega + have hld1 : (o1 ++ o1) = ld1 := rfl + rw [hc1,z09 o1 (c * 2) 1,z0d,hld1] + have ho1 : (o1 ^ 1 : zF) = [1] := rfl + rw [ho1,append_assoc,z2W,<- append_assoc (ld1 ^ c) ld1,z0a,hc2] +theorem z39 (len b c : Nat) (l : zB) : + (o1 ^ (1 + c * 2)) +> (([1,0] ^ b) +> (o1 ^ (4 + len * 3)) +> l) = + (ld1 ^ (1 + c)) +> (ld0 ^ b) +> (o1 ^ (len * 3 + 3)) +> l := by + have hlen : 4 + len * 3 = 1 + (len * 3 + 3) := by omega + rw [hlen] + exact z38 (len * 3 + 3) b c l +theorem z3a (a q h k b : Nat) (l : zB) + (hqh : q + h = 1) (hL : 0 < a * 2 + q) (hk : k < 2 ^ (a * 2 + q)) : + let s := a * 3 + 2 + q * 2 + (b + 2) + (((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) {{D}}> + ((o1 ^ (1 + b * 2)) +> z +> [1,1] +> default)) [z00]⊢* + (z18 (LC (a * 2 + q + s) 0 l) + (RC (k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ b - 1) * 4) * (1 + h) + h))) := by + intro s + have h1 := z1l b ((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) + have hr : (o1 ^ (1 + b * 2)) +> [0,0,0,1,1] +> (default : zB) = + (o1 ^ (1 + b * 2)) +> z +> [1,1] +> default := rfl + have ho3 : (o1 ^ 3 : zF) = o1 ^ (1 + 1 * 2) := rfl + rw [hr,ho3,z39 (a * 2 + q) b 1 (ld0 +> LC (a * 2 + q) k l)] at h1 + have hdb : (o1 ^ ((a * 2 + q) * 3 + 3)) +> ld0 +> LC (a * 2 + q) k l = zDb (a * 2 + q) k l := rfl + rw [hdb] at h1 + have h2 := z37 a q h k b 2 l hqh hL hk + rw [<- z2K] at h2 + exact zSt h1 h2 +theorem z3b (a q h k b : Nat) (l : zB) + (hqh : q + h = 1) (hL : 0 < a * 2 + q) (hk : k < 2 ^ (a * 2 + q)) : + let s := a * 3 + 2 + q * 2 + (b + 3) + (((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) {{D}}> + ((o1 ^ (1 + b * 2)) +> z +> (o1 ^ 4) +> default)) [z00]⊢* + (z18 (LC (a * 2 + q + s) 0 l) + (RC (k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ b - 1) * 8) * (1 + h) + h))) := by + intro s + have h1 := z1e b ((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) + have ho5 : (o1 ^ 5 : zF) = o1 ^ (1 + 2 * 2) := rfl + rw [ho5,z39 (a * 2 + q) b 2 (ld0 +> LC (a * 2 + q) k l)] at h1 + have hdb : (o1 ^ ((a * 2 + q) * 3 + 3)) +> ld0 +> LC (a * 2 + q) k l = zDb (a * 2 + q) k l := rfl + rw [hdb] at h1 + have h2 := z37 a q h k b 3 l hqh hL hk + rw [<- z2K] at h2 + exact zSt h1 h2 +theorem z3c (a b : Nat) (l : zB) : + [0] +> (([1,0] ^ b) +> (o1 ^ (1 + a)) +> l) = + (ld0 ^ (1 + b)) +> (o1 ^ a) +> l := by + rw [z09 o1 1 a] + have h1 : (o1 ^ 1 : zF) = [1] := rfl + have hrot : (([1,0] : zF) ^ b) +> ([1] +> ((o1 ^ a) +> l)) = + [1] +> ((ld0 ^ b) +> ((o1 ^ a) +> l)) := by + have h10 : ([1,0] : zF) = [1] ++ [0] := rfl + rw [<- append_assoc,h10,z0b [1] [0] b,append_assoc]; rfl + have hb : 1 + b = b + 1 := by omega + rw [h1,append_assoc,hrot,hb,z08,append_assoc] + rfl +theorem z3d (a j : Nat) (l : zB) : + (((o1 ^ (1 + a)) +> l) {{D}}> ((o1 ^ (2 + j * 2)) +> default)) [z00]⊢* + (z19 ((ld0 ^ j) +> (o1 ^ a) +> l) (RC 0)) := by + cases j with + | zero => + rw [z09 o1 1 a] + have h1 : (o1 ^ 1 : zF) = [1] := rfl + have h2 : (o1 ^ (2 + 0 * 2) : zF) = [1,1] := rfl + rw [h1,h2,append_assoc,<- z2K] + simpa using z1v ((o1 ^ a) +> l) + | succ j => + have hj : 2 + (j + 1) * 2 = 4 + j * 2 := by omega + rw [hj] + have h1 := z1x j ((o1 ^ (1 + a)) +> l) + rw [z3c a j l] at h1 + have hj1 : 1 + j = j + 1 := by omega + rw [hj1] at h1 + rw [<- z2K] + exact h1 +theorem z3e (a j : Nat) (l : zB) : + (((o1 ^ (1 + a)) +> l) {{D}}> ((o1 ^ (3 + j * 2)) +> default)) [z00]⊢* + (z18 ((ld0 ^ j) +> (o1 ^ a) +> l) (RC 2)) := by + cases j with + | zero => + rw [z09 o1 1 a] + have h1 : (o1 ^ 1 : zF) = [1] := rfl + have h2 : (o1 ^ (3 + 0 * 2) : zF) = [1,1,1] := rfl + rw [h1,h2,append_assoc,<- z2I] + simpa using z1w ((o1 ^ a) +> l) + | succ j => + have hj : 3 + (j + 1) * 2 = 5 + j * 2 := by omega + rw [hj] + have h1 := z1y j ((o1 ^ (1 + a)) +> l) + rw [z3c a j l,z2I] at h1 + have hj1 : 1 + j = j + 1 := by omega + rw [hj1] at h1 + exact h1 +theorem z3f (len k j p : Nat) (l : zB) (hp : p <= 1) : + (((o1 ^ (4 + len * 3)) +> ld0 +> LC len k l) {{D}}> + ((o1 ^ (2 + j * 2 + p)) +> default)) [z00]⊢* + (z18 (LC j (2 ^ j - 1) (zDb len k l)) (RC (1 + p))) := by + have hfull : LC j (2 ^ j - 1) (zDb len k l) = (ld0 ^ j) +> (o1 ^ (len * 3 + 3)) +> ld0 +> LC len k l := by + unfold zDb + rw [LC,z0o] + rw [hfull] + have hlen : 4 + len * 3 = 1 + (len * 3 + 3) := by omega + rw [hlen] + rcases p with _ | _ | p + · simp only [Nat.add_zero] + have h1 := z3d (len * 3 + 3) j (ld0 +> LC len k l) + have h2 := zPs (z2o 0 ((ld0 ^ j) +> (o1 ^ (len * 3 + 3)) +> ld0 +> LC len k l)) + exact zSt h1 h2 + · have hp1 : 2 + j * 2 + 1 = 3 + j * 2 := by omega + rw [hp1] + exact z3e (len * 3 + 3) j (ld0 +> LC len k l) + · omega +theorem z3g (a q h k j p : Nat) (l : zB) + (hqh : q + h = 1) (hL : 0 < a * 2 + q) (hk : k < 2 ^ (a * 2 + q)) (hp : p <= 1) : + let s := a * 3 + 2 + q * 2 + j + (((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) {{D}}> + ((o1 ^ (2 + j * 2 + p)) +> default)) [z00]⊢* + (z18 (LC (a * 2 + q + s) 0 l) + (RC (k * 2 ^ s + 2 ^ (s - 1) + (2 ^ j + p) * (1 + h) + h))) := by + intro s + have h1 := z3f (a * 2 + q) k j p l hp + have hpj := z0h j + have hv : 2 ^ j - 1 < 2 ^ j := by omega + have hvr : 2 ^ j - 1 + (1 + p) < 2 ^ (j + 2) := by + rw [Nat.pow_add 2 j 2]; omega + have h2 := z31 a q h k j (2 ^ j - 1) (1 + p) l hqh hL hk hv hvr + have hval : 2 ^ j - 1 + (1 + p) = 2 ^ j + p := by omega + rw [hval] at h2 + exact zSt h1 h2 +theorem z3h (len k : Nat) (l : zB) (hk : k < 2 ^ len) : + (((o1 ^ (4 + len * 3)) +> ld0 +> LC len k l) {{D}}> ([1] +> default)) [z00]⊢* + (z18 (LC len 0 l) (RC (k + 2 ^ (len + 2)))) := by + have h1 := z1z len (LC len k l) + have hlen : 2 + len = len + 2 := by omega + have hrc_pow : (z ^ (len + 2)) +> d +> default = RC (2 ^ (len + 2)) := by + unfold RC + exact (z0w z1U (len + 2)).symm + rw [hlen,hrc_pow] at h1 + have h2 := z2p len 0 k (2 ^ (len + 2)) l (by omega) + have h0 : 0 + k = k := by omega + have hval : 2 ^ (len + 2) + k = k + 2 ^ (len + 2) := by omega + rw [h0,hval] at h2 + exact zSt h1 h2 +theorem z3i (len k : Nat) (w : zF) (l : zB) + (hw : zDg len k w) : + (((o1 ^ (4 + len * 3)) +> ld0 +> LC len k l) {{D}}> ([1] +> default)) [z00]⊢* + (z18 (LC len 0 l) (w +> RC 4)) := by + have hk := z1W hw + have h1 := z3h len k l hk + have h2 := z2m hw 4 + have hval : k + 2 ^ len * 4 = k + 2 ^ (len + 2) := by + rw [Nat.pow_add] + rw [hval] at h2 + rw [<- h2] at h1 + exact h1 +theorem z3j (a q h k b : Nat) (l : zB) + (hqh : q + h = 1) (hL : 0 < a * 2 + q) (hk : k < 2 ^ (a * 2 + q)) : + let s := a * 3 + 2 + q * 2 + (b + 1) + (((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) {{D}}> + ((o1 ^ (4 + b * 2)) +> z +> [1] +> default)) [z00]⊢* + (z18 (LC (a * 2 + q + s) 0 l) + (RC (k * 2 ^ s + 2 ^ (s - 1) + (2 ^ (b + 1) + 2) * (1 + h) + h))) := by + intro s + have h1 := z1F b ((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) + have hr : (o1 ^ (4 + b * 2)) +> [0,0,0,1] +> (default : zB) = + (o1 ^ (4 + b * 2)) +> z +> [1] +> default := rfl + rw [hr,z2X (a * 2 + q) b (ld0 +> LC (a * 2 + q) k l)] at h1 + have hdb : (o1 ^ ((a * 2 + q) * 3 + 3)) +> ld0 +> LC (a * 2 + q) k l = zDb (a * 2 + q) k l := rfl + have hld1 : ld1 +> (ld0 ^ b) +> zDb (a * 2 + q) k l = + (ld1 ^ 1) +> (ld0 ^ b) +> zDb (a * 2 + q) k l := rfl + rw [hdb,hld1,z36 b 1 (zDb (a * 2 + q) k l),z2J] at h1 + have hpb := z0h b + have hv : (2 ^ b - 1) * 2 ^ 1 < 2 ^ (b + 1) := by rw [Nat.pow_succ]; omega + have hvr : (2 ^ b - 1) * 2 ^ 1 + 4 < 2 ^ (b + 1 + 2) := by + rw [Nat.pow_add 2 (b + 1) 2,Nat.pow_succ]; omega + have h2 := z31 a q h k (b + 1) ((2 ^ b - 1) * 2 ^ 1) 4 l hqh hL hk hv hvr + have hval : (2 ^ b - 1) * 2 ^ 1 + 4 = 2 ^ (b + 1) + 2 := by rw [Nat.pow_succ]; omega + rw [hval] at h2 + exact zSt h1 h2 +theorem z3k (n k m J v : Nat) (l : zB) + (hk : k < 2 ^ n) (hm : 0 < m) (hv : v * 2 + 1 < 2 ^ J) + (hsum : 2 ^ J <= ((k * 2 + 1) * 2 ^ m - 1) + (v * 2 + 2)) : + (z18 (LC m 0 ([1,0,1] +> LC n k l)) (RC v)) [z00]⊢* + (z18 (LC (n + 1 + m) 0 l) (RC ((k * 2 + 1) * 2 ^ m - 1 + v * 2 + 2))) := by + rcases z2v m J v (LC n k l) hm hv with ⟨w,hw,hrun⟩ + have hfull : LC m (2 ^ m - 1) (ld1 +> LC n k l) = (ld0 ^ m) +> ld1 +> LC n k l := by + unfold LC; rw [z0o] + rw [hfull,z2w n k m l] at hrun + have hbound := z2x n k m hk + have hV_hi : v * 2 + 2 < 2 ^ (J + 1) := by rw [Nat.pow_succ]; omega + have hlo : 2 ^ J <= (v * 2 + 2) + ((k * 2 + 1) * 2 ^ m - 1) := by omega + have h2 := z2u (n + 1 + m) ((k * 2 + 1) * 2 ^ m - 1) J (v * 2 + 2) w l hbound hV_hi hlo hw + have hval : (v * 2 + 2) + ((k * 2 + 1) * 2 ^ m - 1) = (k * 2 + 1) * 2 ^ m - 1 + v * 2 + 2 := by omega + rw [hval] at h2 + exact zSt hrun h2 +theorem z3l (b c e : Nat) (l : zB) + (he : e <= 1) (hc : 1 <= c \/ e = 0) : + (z18 (LC (1 + c) 0 ([1,0,1] +> ld1 +> (ld0 ^ b) +> l)) (RC (2 ^ c + e))) [z00]⊢* + (z18 (LC (b + c + 3) 0 l) (RC ((2 ^ (b + 1) - 1) * 2 ^ (c + 2) + (e * 2 + 1)))) := by + have hld1 : [1,0,1] +> ld1 +> (ld0 ^ b) +> l = [1,0,1] +> (ld1 ^ 1) +> (ld0 ^ b) +> l := rfl + rw [hld1,z36 b 1 l] + have hpb := z0h b + have hpc := z0h c + have hk : (2 ^ b - 1) * 2 ^ 1 < 2 ^ (b + 1) := by rw [Nat.pow_succ]; omega + have hsmall : (2 ^ c + e) * 2 + 1 < 2 ^ (c + 2) := by + rw [Nat.pow_add 2 c 2] + rcases hc with hc1 | he0 + · have : 2 <= 2 ^ c := by + have hle := z1T hc1 + simpa using hle + omega + · omega + have hsum : 2 ^ (c + 2) <= (((2 ^ b - 1) * 2 ^ 1 * 2 + 1) * 2 ^ (1 + c) - 1) + ((2 ^ c + e) * 2 + 2) := by + have h1 : 1 <= ((2 ^ b - 1) * 2 ^ 1 * 2 + 1) * 2 ^ (1 + c) := by + have hp1c := z0h (1 + c) + exact Nat.mul_pos (by omega) hp1c + have h2 : 1 * 2 ^ (1 + c) <= ((2 ^ b - 1) * 2 ^ 1 * 2 + 1) * 2 ^ (1 + c) := + Nat.mul_le_mul_right (2 ^ (1 + c)) (by omega) + have hp1c_eq : 2 ^ (1 + c) = 2 ^ c * 2 := by rw [Nat.add_comm 1 c,Nat.pow_succ] + have hpc2_eq : 2 ^ (c + 2) = 2 ^ c * 4 := by rw [Nat.pow_add] + omega + have h1 := z3k (b + 1) ((2 ^ b - 1) * 2 ^ 1) (1 + c) (c + 2) (2 ^ c + e) l + hk (by omega) hsmall hsum + have hlen : b + 1 + 1 + (1 + c) = b + c + 3 := by omega + have hval : ((2 ^ b - 1) * 2 ^ 1 * 2 + 1) * 2 ^ (1 + c) - 1 + (2 ^ c + e) * 2 + 2 = + (2 ^ (b + 1) - 1) * 2 ^ (c + 2) + (e * 2 + 1) := by + have hp1c_eq : 2 ^ (1 + c) = 2 ^ c * 2 := by rw [Nat.add_comm 1 c,Nat.pow_succ] + have hpc2_eq : 2 ^ (c + 2) = 2 ^ c * 4 := by rw [Nat.pow_add] + have hpb1_eq : 2 ^ (b + 1) = 2 ^ b * 2 := Nat.pow_succ 2 b + rw [hp1c_eq,hpc2_eq,hpb1_eq] + have hsub : (2 ^ b - 1) * 2 ^ 1 * 2 + 1 = 2 ^ b * 4 - 3 := by omega + have hmul1 : (2 ^ b * 4) * (2 ^ c * 2) = (2 ^ b * 2 ^ c) * 8 := by ring + have hmul2 : (2 ^ b * 2) * (2 ^ c * 4) = (2 ^ b * 2 ^ c) * 8 := by ring + have hbc : 2 ^ c <= 2 ^ b * 2 ^ c := Nat.le_mul_of_pos_left _ hpb + rw [hsub,Nat.sub_mul,Nat.sub_mul,hmul1,hmul2] + omega + rw [hlen,hval] at h1 + exact h1 +theorem z3m (b c : Nat) (l : zB) : + (z19 ((ld0 ^ c) +> ld1 +> [1,0,1] +> ld1 +> (ld0 ^ b) +> l) (RC 0)) [z00]⊢* + (z18 (LC (b + c + 3) 0 l) (RC ((2 ^ (b + 1) - 1) * 2 ^ (c + 2) + 1))) := by + rw [z2E c ([1,0,1] +> ld1 +> (ld0 ^ b) +> l)] + have hpc := z0h c + have hbound : 2 ^ c - 1 < 2 ^ (1 + c) := by rw [Nat.add_comm 1 c,Nat.pow_succ]; omega + have h1 := z2q (1 + c) (2 ^ c - 1) 0 ([1,0,1] +> ld1 +> (ld0 ^ b) +> l) hbound + have hval1 : 2 ^ c - 1 + 0 + 1 = 2 ^ c + 0 := by omega + rw [hval1] at h1 + have h2 := z3l b c 0 l (by omega) (Or.inr rfl) + exact zSt h1 h2 +theorem z3n (b c : Nat) (l : zB) (hc : 1 <= c) : + (z18 ((ld0 ^ c) +> ld1 +> [1,0,1] +> ld1 +> (ld0 ^ b) +> l) (RC 2)) [z00]⊢* + (z18 (LC (b + c + 3) 0 l) (RC ((2 ^ (b + 1) - 1) * 2 ^ (c + 2) + 3))) := by + rw [z2E c ([1,0,1] +> ld1 +> (ld0 ^ b) +> l)] + have hpc := z0h c + have hbound : 0 + (2 ^ c - 1) < 2 ^ (1 + c) := by rw [Nat.add_comm 1 c,Nat.pow_succ]; omega + have h1 := z2p (1 + c) 0 (2 ^ c - 1) 2 ([1,0,1] +> ld1 +> (ld0 ^ b) +> l) hbound + have h0 : 0 + (2 ^ c - 1) = 2 ^ c - 1 := by omega + have hval1 : 2 + (2 ^ c - 1) = 2 ^ c + 1 := by omega + rw [h0,hval1] at h1 + have h2 := z3l b c 1 l (by omega) (Or.inl hc) + exact zSt h1 h2 +theorem z3o (a b : Nat) (l : zB) : + [1,0,1,1] +> (([1,0] ^ b) +> (o1 ^ (1 + a)) +> l) = + [1,0,1] +> ld1 +> (ld0 ^ b) +> (o1 ^ a) +> l := by + have h1 : ([1,0,1,1] : zF) = [1,0,1] ++ [1] := rfl + rw [h1,append_assoc,z2W] +theorem z3p (len b : Nat) (l : zB) : + [1,0,1,1] +> (([1,0] ^ b) +> (o1 ^ (4 + len * 3)) +> l) = + [1,0,1] +> ld1 +> (ld0 ^ b) +> (o1 ^ (len * 3 + 3)) +> l := by + have hlen : 4 + len * 3 = 1 + (len * 3 + 3) := by omega + rw [hlen] + exact z3o (len * 3 + 3) b l +theorem z3q (b c e : Nat) (he : e <= 1) : + (2 ^ (b + 1) - 1) * 2 ^ (c + 2) + (e * 2 + 1) < 2 ^ (b + c + 3 + 2) := by + have hpb := z0h b + have hpc := z0h c + have hp1 : 2 ^ (b + 1) = 2 ^ b * 2 := Nat.pow_succ 2 b + have hp2 : 2 ^ (c + 2) = 2 ^ c * 4 := by rw [Nat.pow_add] + have hp3 : 2 ^ (b + c + 3 + 2) = (2 ^ b * 2) * (2 ^ c * 4) * 4 := by + have : b + c + 3 + 2 = (b + 1) + (c + 2) + 2 := by omega + rw [this,Nat.pow_add,Nat.pow_add,hp1,hp2] + rw [hp3,hp1,hp2] + have hle : (2 ^ b * 2 - 1) * (2 ^ c * 4) + 4 <= (2 ^ b * 2) * (2 ^ c * 4) := by + rw [Nat.sub_mul,Nat.one_mul] + have : 4 <= (2 ^ b * 2) * (2 ^ c * 4) := by + have : 2 * 4 <= (2 ^ b * 2) * (2 ^ c * 4) := Nat.mul_le_mul (by omega) (by omega) + omega + omega + omega +theorem z3r (a q h k b c e : Nat) (l : zB) + (hqh : q + h = 1) (hL : 0 < a * 2 + q) (hk : k < 2 ^ (a * 2 + q)) (he : e <= 1) : + let s := a * 3 + 2 + q * 2 + (b + c + 3) + (z18 (LC (b + c + 3) 0 (zDb (a * 2 + q) k l)) (RC ((2 ^ (b + 1) - 1) * 2 ^ (c + 2) + (e * 2 + 1)))) [z00]⊢* + (z18 (LC (a * 2 + q + s) 0 l) + (RC (k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ (b + 1) - 1) * 2 ^ (c + 2) + (e * 2 + 1)) * (1 + h) + h))) := by + intro s + have hv : 0 < 2 ^ (b + c + 3) := z0h (b + c + 3) + have hvr : 0 + ((2 ^ (b + 1) - 1) * 2 ^ (c + 2) + (e * 2 + 1)) < 2 ^ (b + c + 3 + 2) := by + simpa using z3q b c e he + have h1 := z31 a q h k (b + c + 3) 0 ((2 ^ (b + 1) - 1) * 2 ^ (c + 2) + (e * 2 + 1)) l + hqh hL hk hv hvr + simp only [Nat.zero_add] at h1 + exact h1 +theorem z3s (a q h k b c : Nat) (l : zB) + (hqh : q + h = 1) (hL : 0 < a * 2 + q) (hk : k < 2 ^ (a * 2 + q)) : + let s := a * 3 + 2 + q * 2 + (b + (1 + c) + 3) + (((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) {{D}}> + ((o1 ^ (4 + b * 2)) +> z +> (o1 ^ (4 + c * 2)) +> default)) [z00]⊢* + (z18 (LC (a * 2 + q + s) 0 l) + (RC (k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ (b + 1) - 1) * 2 ^ (1 + c + 2) + 1) * (1 + h) + h))) := by + intro s + have h1 := z1j b c ((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) + rw [z3p (a * 2 + q) b (ld0 +> LC (a * 2 + q) k l)] at h1 + have hdb : (o1 ^ ((a * 2 + q) * 3 + 3)) +> ld0 +> LC (a * 2 + q) k l = zDb (a * 2 + q) k l := rfl + rw [hdb] at h1 + have h2 := z3m b (1 + c) (zDb (a * 2 + q) k l) + rw [<- z2K] at h2 + have h3 := z3r a q h k b (1 + c) 0 l hqh hL hk (by omega) + exact zSt h1 (zSt h2 h3) +theorem z3t (a q h k b c : Nat) (l : zB) + (hqh : q + h = 1) (hL : 0 < a * 2 + q) (hk : k < 2 ^ (a * 2 + q)) : + let s := a * 3 + 2 + q * 2 + (b + (1 + c) + 3) + (((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) {{D}}> + ((o1 ^ (4 + b * 2)) +> z +> (o1 ^ (5 + c * 2)) +> default)) [z00]⊢* + (z18 (LC (a * 2 + q + s) 0 l) + (RC (k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ (b + 1) - 1) * 2 ^ (1 + c + 2) + 3) * (1 + h) + h))) := by + intro s + have h1 := z1k b c ((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) + rw [z3p (a * 2 + q) b (ld0 +> LC (a * 2 + q) k l)] at h1 + have hdb : (o1 ^ ((a * 2 + q) * 3 + 3)) +> ld0 +> LC (a * 2 + q) k l = zDb (a * 2 + q) k l := rfl + rw [hdb,z2I] at h1 + have h2 := z3n b (1 + c) (zDb (a * 2 + q) k l) (by omega) + have h3 := z3r a q h k b (1 + c) 1 l hqh hL hk (by omega) + exact zSt h1 (zSt h2 h3) +theorem z3u (l : zB) : ld0 +> l = LC 1 1 l := by + unfold LC; rfl +theorem z3v (l : zB) : ld1 +> l = LC 1 0 l := by + unfold LC; rfl +theorem z3w (a q h k b : Nat) (l : zB) + (hqh : q + h = 1) (hL : 0 < a * 2 + q) (hk : k < 2 ^ (a * 2 + q)) : + let s := a * 3 + 2 + q * 2 + (b + 0 + 3) + (((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) {{D}}> + ((o1 ^ (4 + b * 2)) +> z +> [1,1] +> default)) [z00]⊢* + (z18 (LC (a * 2 + q + s) 0 l) + (RC (k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ (b + 1) - 1) * 4 + 1) * (1 + h) + h))) := by + intro s + have h1 := z1m b ((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) + have hr : (o1 ^ (4 + b * 2)) +> [0,0,0,1,1] +> (default : zB) = + (o1 ^ (4 + b * 2)) +> z +> [1,1] +> default := rfl + rw [hr,z3p (a * 2 + q) b (ld0 +> LC (a * 2 + q) k l)] at h1 + have hdb : (o1 ^ ((a * 2 + q) * 3 + 3)) +> ld0 +> LC (a * 2 + q) k l = zDb (a * 2 + q) k l := rfl + rw [hdb] at h1 + have h2 := z2p 1 0 1 0 ([1,0,1] +> ld1 +> (ld0 ^ b) +> zDb (a * 2 + q) k l) (by decide +kernel) + rw [<- z3u,<- z2K] at h2 + have h3 := z3l b 0 0 (zDb (a * 2 + q) k l) (by omega) (Or.inr rfl) + have h4 := z3r a q h k b 0 0 l hqh hL hk (by omega) + exact zSt h1 (zSt h2 (zSt h3 h4)) +theorem z3x (b : Nat) (l : zB) (hb : 1 <= b) : + (z18 (LC 1 0 ([1,0,1] +> ld1 +> (ld0 ^ b) +> l)) (RC 2)) [z00]⊢* + (z18 (LC (b + 3) 0 l) (RC ((2 ^ (b + 1) - 1) * 4 + 3))) := by + have hld1 : [1,0,1] +> ld1 +> (ld0 ^ b) +> l = [1,0,1] +> (ld1 ^ 1) +> (ld0 ^ b) +> l := rfl + rw [hld1,z36 b 1 l] + have hpb : 2 <= 2 ^ b := by + have := z1T hb + simpa using this + have hk : (2 ^ b - 1) * 2 ^ 1 < 2 ^ (b + 1) := by rw [Nat.pow_succ]; omega + have hsum : 2 ^ 3 <= (((2 ^ b - 1) * 2 ^ 1 * 2 + 1) * 2 ^ 1 - 1) + (2 * 2 + 2) := by omega + have h1 := z3k (b + 1) ((2 ^ b - 1) * 2 ^ 1) 1 3 2 l hk (by omega) (by decide +kernel) hsum + have hlen : b + 1 + 1 + 1 = b + 3 := by omega + have hval : ((2 ^ b - 1) * 2 ^ 1 * 2 + 1) * 2 ^ 1 - 1 + 2 * 2 + 2 = (2 ^ (b + 1) - 1) * 4 + 3 := by + rw [Nat.pow_succ]; omega + rw [hlen,hval] at h1 + exact h1 +theorem z3y (a q h k b : Nat) (l : zB) + (hqh : q + h = 1) (hL : 0 < a * 2 + q) (hk : k < 2 ^ (a * 2 + q)) (hb : 1 <= b) : + let s := a * 3 + 2 + q * 2 + (b + 0 + 3) + (((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) {{D}}> + ((o1 ^ (4 + b * 2)) +> z +> [1,1,1] +> default)) [z00]⊢* + (z18 (LC (a * 2 + q + s) 0 l) + (RC (k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ (b + 1) - 1) * 4 + 3) * (1 + h) + h))) := by + intro s + have h1 := z1G b ((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) + have hr : (o1 ^ (4 + b * 2)) +> [0,0,0,1,1,1] +> (default : zB) = + (o1 ^ (4 + b * 2)) +> z +> [1,1,1] +> default := rfl + rw [hr,z3p (a * 2 + q) b (ld0 +> LC (a * 2 + q) k l)] at h1 + have hdb : (o1 ^ ((a * 2 + q) * 3 + 3)) +> ld0 +> LC (a * 2 + q) k l = zDb (a * 2 + q) k l := rfl + rw [hdb,z2I] at h1 + have h2 := z3x b (zDb (a * 2 + q) k l) hb + rw [<- z3v] at h2 + have h3 := z3r a q h k b 0 1 l hqh hL hk (by omega) + exact zSt h1 (zSt h2 h3) +theorem z3z (n k : Nat) (l : zB) : + ld1 +> LC n k l = LC (n + 1) (k * 2) l := by + unfold LC + exact (z0l ld0 ld1 n k l).symm +theorem z3A (n k r : Nat) (hn : 1 <= n) (hk : k < 2 ^ n) (hr : r <= 4) : + k + r < 2 ^ (n + 2) := by + have hp : 2 <= 2 ^ n := by + have := z1T hn + simpa using this + rw [Nat.pow_add 2 n 2] + omega +theorem z3B (a q h k b c : Nat) (l : zB) + (hqh : q + h = 1) (hL : 0 < a * 2 + q) (hk : k < 2 ^ (a * 2 + q)) : + let n := b + 1 + (1 + c) + let s := a * 3 + 2 + q * 2 + (n + 1 + 1) + (((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) {{D}}> + ((o1 ^ (3 + b * 2)) +> z +> (o1 ^ (1 + c * 2)) +> z +> d +> default)) [z00]⊢* + (z18 (LC (a * 2 + q + s) 0 l) + (RC (k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ (b + 1) - 1) * 2 ^ (1 + c + 2) - 1) * (1 + h) + h))) := by + intro n s + have h1 := z1A b c ((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) + rw [z2X (a * 2 + q) b (ld0 +> LC (a * 2 + q) k l)] at h1 + have hdb : (o1 ^ ((a * 2 + q) * 3 + 3)) +> ld0 +> LC (a * 2 + q) k l = zDb (a * 2 + q) k l := rfl + rw [hdb,z2Y b (1 + c) (zDb (a * 2 + q) k l)] at h1 + let v := (2 ^ (b + 1) - 1) * 2 ^ (1 + c) - 1 + have hv : v < 2 ^ n := z2Z b (1 + c) + have hld0 : ld0 +> ld1 +> LC n v (zDb (a * 2 + q) k l) = + (ld0 ^ 1) +> ld1 +> LC n v (zDb (a * 2 + q) k l) := rfl + rw [hld0,z2w n v 1 (zDb (a * 2 + q) k l),z2I] at h1 + have hv2 := z2x n v 1 hv + have hvr := z3A (n + 1 + 1) ((v * 2 + 1) * 2 ^ 1 - 1) 2 (by omega) hv2 (by omega) + have h2 := z31 a q h k (n + 1 + 1) ((v * 2 + 1) * 2 ^ 1 - 1) 2 l hqh hL hk hv2 hvr + have hval : (v * 2 + 1) * 2 ^ 1 - 1 + 2 = (2 ^ (b + 1) - 1) * 2 ^ (1 + c + 2) - 1 := by + have hpb := z0h b + have hpc := z0h (1 + c) + have hpos1 : 2 <= 2 ^ (b + 1) := by rw [Nat.pow_succ]; omega + have hpos2 : 1 <= (2 ^ (b + 1) - 1) * 2 ^ (1 + c) := Nat.mul_pos (by omega) hpc + have hp_c2 : 2 ^ (1 + c + 2) = 2 ^ (1 + c) * 4 := by rw [Nat.pow_add] + rw [hp_c2,<- Nat.mul_assoc] + dsimp [v] + omega + rw [hval] at h2 + exact zSt h1 h2 +theorem z3C (a q h k b c : Nat) (l : zB) + (hqh : q + h = 1) (hL : 0 < a * 2 + q) (hk : k < 2 ^ (a * 2 + q)) : + let n := b + 1 + (1 + c) + let s := a * 3 + 2 + q * 2 + (n + 1) + (((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) {{D}}> + ((o1 ^ (3 + b * 2)) +> z +> (o1 ^ (2 + c * 2)) +> z +> d +> default)) [z00]⊢* + (z18 (LC (a * 2 + q + s) 0 l) + (RC (k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ (b + 1) - 1) * 2 ^ (1 + c + 1) + 2) * (1 + h) + h))) := by + intro n s + have h1 := z1B b c ((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) + rw [z2X (a * 2 + q) b (ld0 +> LC (a * 2 + q) k l)] at h1 + have hdb : (o1 ^ ((a * 2 + q) * 3 + 3)) +> ld0 +> LC (a * 2 + q) k l = zDb (a * 2 + q) k l := rfl + rw [hdb,z2Y b (1 + c) (zDb (a * 2 + q) k l),z3z,z2J] at h1 + let v := (2 ^ (b + 1) - 1) * 2 ^ (1 + c) - 1 + have hv : v < 2 ^ n := z2Z b (1 + c) + have hv2 : v * 2 < 2 ^ (n + 1) := by rw [Nat.pow_succ]; omega + have hvr := z3A (n + 1) (v * 2) 4 (by omega) hv2 (by omega) + have h2 := z31 a q h k (n + 1) (v * 2) 4 l hqh hL hk hv2 hvr + have hval : v * 2 + 4 = (2 ^ (b + 1) - 1) * 2 ^ (1 + c + 1) + 2 := by + have hpb := z0h b + have hpc := z0h (1 + c) + have hpos1 : 2 <= 2 ^ (b + 1) := by rw [Nat.pow_succ]; omega + have hpos2 : 1 <= (2 ^ (b + 1) - 1) * 2 ^ (1 + c) := Nat.mul_pos (by omega) hpc + rw [Nat.pow_succ 2 (1 + c),<- Nat.mul_assoc] + dsimp [v] + omega + rw [hval] at h2 + exact zSt h1 h2 +theorem z3D (c : Nat) (l : zB) : + ld0 +> ld1 +> (ld0 ^ c) +> ld1 +> l = LC (c + 3) ((2 ^ c - 1) * 4 + 1) l := by + have hld0 : ld0 +> ld1 +> (ld0 ^ c) +> ld1 +> l = (ld0 ^ 1) +> ld1 +> ((ld0 ^ c) +> ld1 +> l) := rfl + rw [hld0,z2E c l,z2w (1 + c) (2 ^ c - 1) 1 l] + have h1 : 1 + c + 1 + 1 = c + 3 := by omega + have hpc := z0h c + have h2 : ((2 ^ c - 1) * 2 + 1) * 2 ^ 1 - 1 = (2 ^ c - 1) * 4 + 1 := by omega + rw [h1,h2] +theorem z3E (c : Nat) (l : zB) : + ld1 +> (ld0 ^ c) +> ld1 +> l = LC (c + 2) ((2 ^ c - 1) * 2) l := by + rw [z2E c l,z3z (1 + c) (2 ^ c - 1) l] + have h1 : 1 + c + 1 = c + 2 := by omega + rw [h1] +theorem z3F (b c : Nat) (l : zB) : + (z18 (LC (c + 3) 0 ([1,0,1] +> ld1 +> (ld0 ^ b) +> l)) (RC (2 ^ (c + 2) - 1))) [z00]⊢* + (z18 (LC (b + c + 5) 0 l) (RC ((2 ^ (b + 1) - 1) * 2 ^ (c + 4) - 1))) := by + have hld1 : [1,0,1] +> ld1 +> (ld0 ^ b) +> l = [1,0,1] +> (ld1 ^ 1) +> (ld0 ^ b) +> l := rfl + rw [hld1,z36 b 1 l] + have hpb := z0h b + have hpc := z0h c + have hk : (2 ^ b - 1) * 2 ^ 1 < 2 ^ (b + 1) := by rw [Nat.pow_succ]; omega + have hv : (2 ^ (c + 2) - 1) * 2 + 1 < 2 ^ (c + 3) := by + have hp2 : 2 ^ (c + 2) = 2 ^ c * 4 := by rw [Nat.pow_add] + have hp3 : 2 ^ (c + 3) = 2 ^ c * 8 := by rw [Nat.pow_add] + rw [hp2,hp3]; omega + have hsum : 2 ^ (c + 3) <= (((2 ^ b - 1) * 2 ^ 1 * 2 + 1) * 2 ^ (c + 3) - 1) + ((2 ^ (c + 2) - 1) * 2 + 2) := by + have hp := z0h (c + 3) + have hp2 := z0h (c + 2) + have h1 : 1 * 2 ^ (c + 3) <= ((2 ^ b - 1) * 2 ^ 1 * 2 + 1) * 2 ^ (c + 3) := + Nat.mul_le_mul_right (2 ^ (c + 3)) (by omega) + omega + have h1 := z3k (b + 1) ((2 ^ b - 1) * 2 ^ 1) (c + 3) (c + 3) (2 ^ (c + 2) - 1) l + hk (by omega) hv hsum + have hlen : b + 1 + 1 + (c + 3) = b + c + 5 := by omega + have hval : ((2 ^ b - 1) * 2 ^ 1 * 2 + 1) * 2 ^ (c + 3) - 1 + (2 ^ (c + 2) - 1) * 2 + 2 = + (2 ^ (b + 1) - 1) * 2 ^ (c + 4) - 1 := by + have hp_c3 : 2 ^ (c + 3) = 2 ^ c * 8 := by rw [Nat.pow_add] + have hp_c4 : 2 ^ (c + 4) = 2 ^ c * 16 := by rw [Nat.pow_add] + have hp_c2 : 2 ^ (c + 2) = 2 ^ c * 4 := by rw [Nat.pow_add] + have hp_b1 : 2 ^ (b + 1) = 2 ^ b * 2 := Nat.pow_succ 2 b + rw [hp_c3,hp_c4,hp_c2,hp_b1] + have hsub1 : (2 ^ b - 1) * 2 ^ 1 * 2 + 1 = 2 ^ b * 4 - 3 := by omega + have hmul1 : (2 ^ b * 4) * (2 ^ c * 8) = (2 ^ b * 2 ^ c) * 32 := by ring + have hmul2 : (2 ^ b * 2) * (2 ^ c * 16) = (2 ^ b * 2 ^ c) * 32 := by ring + have hbc : 2 ^ c <= 2 ^ b * 2 ^ c := Nat.le_mul_of_pos_left _ hpb + rw [hsub1,Nat.sub_mul,Nat.sub_mul,Nat.sub_mul,hmul1,hmul2] + omega + rw [hlen,hval] at h1 + exact h1 +theorem z3G (b c : Nat) (l : zB) (hb : 1 <= b) : + (z18 (LC (c + 2) 0 ([1,0,1] +> ld1 +> (ld0 ^ b) +> l)) (RC (2 ^ (c + 1) + 2))) [z00]⊢* + (z18 (LC (b + c + 4) 0 l) (RC ((2 ^ (b + 1) - 1) * 2 ^ (c + 3) + 5))) := by + have hld1 : [1,0,1] +> ld1 +> (ld0 ^ b) +> l = [1,0,1] +> (ld1 ^ 1) +> (ld0 ^ b) +> l := rfl + rw [hld1,z36 b 1 l] + have hpb : 2 <= 2 ^ b := by + have := z1T hb + simpa using this + have hpc := z0h c + have hk : (2 ^ b - 1) * 2 ^ 1 < 2 ^ (b + 1) := by rw [Nat.pow_succ]; omega + have hv : (2 ^ (c + 1) + 2) * 2 + 1 < 2 ^ (c + 4) := by + have hp4 : 2 ^ (c + 4) = 2 ^ c * 16 := by rw [Nat.pow_add] + have hp1 : 2 ^ (c + 1) = 2 ^ c * 2 := by rw [Nat.pow_add] + rw [hp4,hp1]; omega + have hsum : 2 ^ (c + 4) <= (((2 ^ b - 1) * 2 ^ 1 * 2 + 1) * 2 ^ (c + 2) - 1) + ((2 ^ (c + 1) + 2) * 2 + 2) := by + have hp4 : 2 ^ (c + 4) = 2 ^ c * 16 := by rw [Nat.pow_add] + have hp2 : 2 ^ (c + 2) = 2 ^ c * 4 := by rw [Nat.pow_add] + have hp1 : 2 ^ (c + 1) = 2 ^ c * 2 := by rw [Nat.pow_add] + rw [hp4,hp2,hp1] + have h1 : 5 * (2 ^ c * 4) <= ((2 ^ b - 1) * 2 ^ 1 * 2 + 1) * (2 ^ c * 4) := + Nat.mul_le_mul_right (2 ^ c * 4) (by omega) + omega + have h1 := z3k (b + 1) ((2 ^ b - 1) * 2 ^ 1) (c + 2) (c + 4) (2 ^ (c + 1) + 2) l + hk (by omega) hv hsum + have hlen : b + 1 + 1 + (c + 2) = b + c + 4 := by omega + have hval : ((2 ^ b - 1) * 2 ^ 1 * 2 + 1) * 2 ^ (c + 2) - 1 + (2 ^ (c + 1) + 2) * 2 + 2 = + (2 ^ (b + 1) - 1) * 2 ^ (c + 3) + 5 := by + have hp_c2 : 2 ^ (c + 2) = 2 ^ c * 4 := by rw [Nat.pow_add] + have hp_c3 : 2 ^ (c + 3) = 2 ^ c * 8 := by rw [Nat.pow_add] + have hp_c1 : 2 ^ (c + 1) = 2 ^ c * 2 := by rw [Nat.pow_add] + have hp_b1 : 2 ^ (b + 1) = 2 ^ b * 2 := Nat.pow_succ 2 b + rw [hp_c2,hp_c3,hp_c1,hp_b1] + have hsub1 : (2 ^ b - 1) * 2 ^ 1 * 2 + 1 = 2 ^ b * 4 - 3 := by omega + have hmul1 : (2 ^ b * 4) * (2 ^ c * 4) = (2 ^ b * 2 ^ c) * 16 := by ring + have hmul2 : (2 ^ b * 2) * (2 ^ c * 8) = (2 ^ b * 2 ^ c) * 16 := by ring + have hbc : 2 ^ c <= 2 ^ b * 2 ^ c := Nat.le_mul_of_pos_left _ (by omega) + rw [hsub1,Nat.sub_mul,Nat.sub_mul,hmul1,hmul2] + omega + rw [hlen,hval] at h1 + exact h1 +theorem z3H (a q h k b c : Nat) (l : zB) + (hqh : q + h = 1) (hL : 0 < a * 2 + q) (hk : k < 2 ^ (a * 2 + q)) : + let s := a * 3 + 2 + q * 2 + (b + c + 5) + (((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) {{D}}> + ((o1 ^ (4 + b * 2)) +> z +> (o1 ^ (3 + c * 2)) +> z +> d +> default)) [z00]⊢* + (z18 (LC (a * 2 + q + s) 0 l) + (RC (k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ (b + 1) - 1) * 2 ^ (c + 4) - 1) * (1 + h) + h))) := by + intro s + have h1 := z1C b c ((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) + rw [z3p (a * 2 + q) b (ld0 +> LC (a * 2 + q) k l)] at h1 + have hdb : (o1 ^ ((a * 2 + q) * 3 + 3)) +> ld0 +> LC (a * 2 + q) k l = zDb (a * 2 + q) k l := rfl + rw [hdb,z3D c ([1,0,1] +> ld1 +> (ld0 ^ b) +> zDb (a * 2 + q) k l),z2I] at h1 + have hpc := z0h c + have hbound : 0 + ((2 ^ c - 1) * 4 + 1) < 2 ^ (c + 3) := by + have : 2 ^ (c + 3) = 2 ^ c * 8 := by rw [Nat.pow_add] + rw [this]; omega + have h2 := z2p (c + 3) 0 ((2 ^ c - 1) * 4 + 1) 2 ([1,0,1] +> ld1 +> (ld0 ^ b) +> zDb (a * 2 + q) k l) hbound + have h0 : 0 + ((2 ^ c - 1) * 4 + 1) = (2 ^ c - 1) * 4 + 1 := by omega + have hval1 : 2 + ((2 ^ c - 1) * 4 + 1) = 2 ^ (c + 2) - 1 := by + have : 2 ^ (c + 2) = 2 ^ c * 4 := by rw [Nat.pow_add] + rw [this]; omega + rw [h0,hval1] at h2 + have h3 := z3F b c (zDb (a * 2 + q) k l) + have hv : 0 < 2 ^ (b + c + 5) := z0h (b + c + 5) + have hvr : 0 + ((2 ^ (b + 1) - 1) * 2 ^ (c + 4) - 1) < 2 ^ (b + c + 5 + 2) := by + have hpb := z0h b + have hp1 : 2 ^ (b + 1) = 2 ^ b * 2 := Nat.pow_succ 2 b + have hp2 : 2 ^ (c + 4) = 2 ^ c * 16 := by rw [Nat.pow_add] + have hp3 : 2 ^ (b + c + 5 + 2) = (2 ^ b * 2) * (2 ^ c * 16) * 4 := by + have : b + c + 5 + 2 = (b + 1) + (c + 4) + 2 := by omega + rw [this,Nat.pow_add,Nat.pow_add,hp1,hp2] + rw [hp3,hp1,hp2] + have hpos : 0 < (2 ^ b * 2) * (2 ^ c * 16) := Nat.mul_pos (by omega) (by omega) + have hle : (2 ^ b * 2 - 1) * (2 ^ c * 16) <= (2 ^ b * 2) * (2 ^ c * 16) := + Nat.mul_le_mul_right _ (by omega) + omega + have h4 := z31 a q h k (b + c + 5) 0 ((2 ^ (b + 1) - 1) * 2 ^ (c + 4) - 1) l hqh hL hk hv hvr + simp only [Nat.zero_add] at h4 + exact zSt h1 (zSt h2 (zSt h3 h4)) +theorem z3I (a q h k b c : Nat) (l : zB) + (hqh : q + h = 1) (hL : 0 < a * 2 + q) (hk : k < 2 ^ (a * 2 + q)) (hb : 1 <= b) : + let s := a * 3 + 2 + q * 2 + (b + c + 4) + (((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) {{D}}> + ((o1 ^ (4 + b * 2)) +> z +> (o1 ^ (4 + c * 2)) +> z +> d +> default)) [z00]⊢* + (z18 (LC (a * 2 + q + s) 0 l) + (RC (k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ (b + 1) - 1) * 2 ^ (c + 3) + 5) * (1 + h) + h))) := by + intro s + have h1 := z1D b c ((o1 ^ (4 + (a * 2 + q) * 3)) +> ld0 +> LC (a * 2 + q) k l) + rw [z3p (a * 2 + q) b (ld0 +> LC (a * 2 + q) k l)] at h1 + have hdb : (o1 ^ ((a * 2 + q) * 3 + 3)) +> ld0 +> LC (a * 2 + q) k l = zDb (a * 2 + q) k l := rfl + rw [hdb,z3E c ([1,0,1] +> ld1 +> (ld0 ^ b) +> zDb (a * 2 + q) k l),z2J] at h1 + have hpc := z0h c + have hbound : 0 + (2 ^ c - 1) * 2 < 2 ^ (c + 2) := by + have : 2 ^ (c + 2) = 2 ^ c * 4 := by rw [Nat.pow_add] + rw [this]; omega + have h2 := z2p (c + 2) 0 ((2 ^ c - 1) * 2) 4 ([1,0,1] +> ld1 +> (ld0 ^ b) +> zDb (a * 2 + q) k l) hbound + have h0 : 0 + (2 ^ c - 1) * 2 = (2 ^ c - 1) * 2 := by omega + have hval1 : 4 + (2 ^ c - 1) * 2 = 2 ^ (c + 1) + 2 := by + have : 2 ^ (c + 1) = 2 ^ c * 2 := by rw [Nat.pow_add] + rw [this]; omega + rw [h0,hval1] at h2 + have h3 := z3G b c (zDb (a * 2 + q) k l) hb + have hv : 0 < 2 ^ (b + c + 4) := z0h (b + c + 4) + have hvr : 0 + ((2 ^ (b + 1) - 1) * 2 ^ (c + 3) + 5) < 2 ^ (b + c + 4 + 2) := by + have hpb := z0h b + have hp1 : 2 ^ (b + 1) = 2 ^ b * 2 := Nat.pow_succ 2 b + have hp2 : 2 ^ (c + 3) = 2 ^ c * 8 := by rw [Nat.pow_add] + have hp3 : 2 ^ (b + c + 4 + 2) = (2 ^ b * 2) * (2 ^ c * 8) * 4 := by + have : b + c + 4 + 2 = (b + 1) + (c + 3) + 2 := by omega + rw [this,Nat.pow_add,Nat.pow_add,hp1,hp2] + rw [hp3,hp1,hp2] + have hle : (2 ^ b * 2 - 1) * (2 ^ c * 8) + 8 <= (2 ^ b * 2) * (2 ^ c * 8) := by + rw [Nat.sub_mul,Nat.one_mul] + have : 8 <= (2 ^ b * 2) * (2 ^ c * 8) := by + have : 2 * 8 <= (2 ^ b * 2) * (2 ^ c * 8) := Nat.mul_le_mul (by omega) (by omega) + omega + omega + omega + have h4 := z31 a q h k (b + c + 4) 0 ((2 ^ (b + 1) - 1) * 2 ^ (c + 3) + 5) l hqh hL hk hv hvr + simp only [Nat.zero_add] at h4 + exact zSt h1 (zSt h2 (zSt h3 h4)) +namespace Queue +abbrev cell := Nat × Nat +def danger : cell := (0,1) +def main (p : cell) : Prop := 3 <= p.1 /\ p.1 * 8 + 9 <= p.2 +def allowed (p : cell) : Prop := 0 < p.2 /\ (p.1 = 0 \/ z1P p.1 p.2) +def link (p : cell) (l : List cell) : Prop := + p = danger -> match l with | [] => True | q :: _ => main q +inductive good : List cell -> Prop + | nil : good [] + | cons (p : cell) (l : List cell) : allowed p -> link p l -> good l -> good (p :: l) +theorem z3J (p : cell) (h : main p) : allowed p /\ p ≠ danger := by + rcases p with ⟨t,u⟩ + rcases h with ⟨ht,hu⟩ + refine ⟨⟨by omega,Or.inr (Or.inl hu)⟩,?_⟩ + intro heq + injection heq with ht0 hu1 + omega +theorem z3K {p : cell} {l : List cell} (h : good (p :: l)) : good l := by + cases h with + | cons _ _ _ _ hl => exact hl +theorem z3L (l : List cell) (p : cell) (r : List cell) + (hl : good l) (hp : main p) (hr : good r) : good (l ++ p :: r) := by + rcases z3J p hp with ⟨ha,hne⟩ + induction hl with + | nil => + refine good.cons p r ha ?_ hr + intro heq + exact False.elim (hne heq) + | cons q l hq hlink _ ih => + refine good.cons q (l ++ p :: r) hq ?_ ih + intro heq + have hm := hlink heq + cases l with + | nil => exact hp + | cons q' l' => exact hm +def weight (p : cell) : Nat := p.1 + p.2 + 1 +def mass : List cell -> Nat + | [] => 0 + | p :: r => weight p + mass r +theorem mass_app (l r : List cell) : mass (l ++ r) = mass l + mass r := by + induction l with + | nil => simp [mass] + | cons p l ih => simp only [List.cons_append,mass,ih]; omega +theorem length_mass (l : List cell) : l.length <= mass l := by + induction l with + | nil => simp [mass] + | cons p l ih => simp only [List.length_cons,mass,weight]; omega +theorem z3M : ∀ (n : Nat) (l : List cell),mass (l.drop n) <= mass l + | 0,_ => by simp + | _ + 1,[] => by simp [mass] + | n + 1,p :: l => by + simp only [List.drop_succ_cons,mass] + have := z3M n l + omega +theorem z3N : ∀ (n : Nat) (l : List cell),n < l.length -> mass (l.take n) < mass l + | _,[],h => by simp at h + | 0,p :: l,_ => by + simp only [List.take_zero,mass,weight] + omega + | n + 1,p :: l,h => by + simp only [List.length_cons] at h + simp only [List.take_succ_cons,mass] + have := z3N n l (by omega) + omega +inductive cut : List cell -> List cell -> Nat -> Nat -> Prop + | one (p : cell) (l : List cell) : allowed p -> p ≠ danger -> cut (p :: l) l (weight p) 1 + | two (p : cell) (l : List cell) : main p -> cut (danger :: p :: l) l (2 + weight p) 2 +theorem z3O (l : List cell) (hl : good l) (hlen : 2 <= l.length) : + ∃ r n k,cut l r n k := by + cases hl with + | nil => simp at hlen + | cons p l ha hlink hgood => + by_cases hd : p = danger + · subst hd + cases l with + | nil => simp at hlen + | cons q l' => + have hmain : main q := hlink rfl + exact ⟨l',2 + weight q,2,cut.two q l' hmain⟩ + · exact ⟨l,weight p,1,cut.one p l ha hd⟩ +theorem z3P {l r : List cell} {n k : Nat} (hl : good l) (hc : cut l r n k) : good r := by + cases hc with + | one _ _ _ _ => exact z3K hl + | two _ _ _ => exact z3K (z3K hl) +theorem z3Q {l r : List cell} {n k : Nat} (hc : cut l r n k) : + 1 <= k /\ k <= 2 /\ r = l.drop k /\ n = mass (l.take k) := by + cases hc with + | one p l _ _ => + simp [mass] + | two p l _ => + simp [mass,danger,weight] +def advance (l r : List cell) : Prop := + ∃ k a,k <= 2 /\ r = l.drop k ++ a +inductive path : Nat -> List cell -> List cell -> Prop + | zero (l : List cell) : path 0 l l + | next (n : Nat) (l r s : List cell) : path n l r -> advance r s -> path (n + 1) l s +theorem z3R : ∀ (n k : Nat) (l r a : List cell),n + k <= l.length -> + (l.drop n ++ r).drop k ++ a = l.drop (n + k) ++ (r ++ a) + | 0,k,l,r,a,h => by + simp only [Nat.zero_add,List.drop_zero] at h ⊢ + induction k generalizing l with + | zero => simp [List.append_assoc] + | succ k ih => + cases l with + | nil => simp at h + | cons p l => + simp only [List.length_cons] at h + simp only [List.cons_append,List.drop_succ_cons] + exact ih l (by omega) + | n + 1,k,[],r,a,h => by simp at h + | n + 1,k,p :: l,r,a,h => by + simp only [List.length_cons] at h + simp only [List.drop_succ_cons,Nat.succ_add] + exact z3R n k l r a (by omega) +theorem z3S : ∀ (k : Nat) (l1 l2 : List cell),k <= l1.length -> + (l1 ++ l2).take k = l1.take k + | 0,_,_,_ => by simp + | k + 1,[],_,h => by simp at h + | k + 1,p :: l1,l2,h => by + simp only [List.length_cons] at h + simp only [List.cons_append,List.take_succ_cons] + rw [z3S k l1 l2 (by omega)] +theorem z3T {n : Nat} {l r : List cell} (hp : path n l r) (hlen : n * 2 <= l.length) : + ∃ k a,k <= n * 2 /\ r = l.drop k ++ a := by + induction hp with + | zero l => + exact ⟨0,[],by omega,by simp⟩ + | next n l r s hp ha ih => + rcases ih (by omega) with ⟨k,a,hk,hr⟩ + rcases ha with ⟨j,b,hj,hs⟩ + refine ⟨k + j,a ++ b,by omega,?_⟩ + rw [hs,hr,z3R k j l a b (by omega)] +theorem z3U {l r s : List cell} {n k : Nat} + (hp : path 3 l r) (hlen : 9 <= l.length) (hc : cut r s n k) : + n < mass l := by + rcases z3T hp (by omega) with ⟨d,a,hd,hr⟩ + rcases z3Q hc with ⟨hk1,hk2,_,hn⟩ + have hlen_drop : (l.drop d).length = l.length - d := List.length_drop + have hshort : k < (l.drop d).length := by omega + rw [hn,hr,z3S k (l.drop d) a (by omega)] + have h1 := z3N k (l.drop d) hshort + have h2 := z3M d l + omega +theorem z3V (a b c d : Nat) + (h1 : a * 5 <= b * 2) (h2 : b * 5 <= c * 2) (h3 : c * 5 <= d * 2) : + a * 125 <= d * 8 := by + omega +theorem z3W {l r : List cell} {n k : Nat} {p : cell} {a : List cell} + (hl : good l) (hc : cut l r n k) (hp : main p) (ha : good a) (hsize : k <= 1 + a.length) : + good (r ++ p :: a) /\ l.length <= (r ++ p :: a).length := by + refine ⟨z3L r p a (z3P hl hc) hp ha,?_⟩ + cases hc with + | one q r' _ _ => + simp only [List.length_append,List.length_cons] + omega + | two q r' _ => + simp only [List.length_append,List.length_cons] + omega +theorem z3X {l r : List cell} {n k : Nat} (hc : cut l r n k) : 3 <= n := by + cases hc with + | one p l ha hne => + rcases p with ⟨t,u⟩ + rcases ha with ⟨hu,ht | hsep⟩ + · subst ht + have hu2 : 2 <= u := by + rcases u with _ | _ | u + · omega + · exfalso; exact hne rfl + · omega + simp only [weight]; omega + · rcases hsep with h1 | h2 <;> (simp only [weight]; omega) + | two p l hp => + rcases p with ⟨t,u⟩ + rcases hp with ⟨ht,hu⟩ + simp only [weight]; omega +structure frame where + cells : List cell + trailing : Nat +def width (f : frame) : Nat := mass f.cells + f.trailing - 1 +def edge (f g : frame) : Prop := + advance f.cells g.cells /\ width f * 5 <= width g * 2 /\ f.cells.length <= g.cells.length +structure history (f0 f1 f2 f3 : frame) : Prop where + edge01 : edge f0 f1 + edge12 : edge f1 f2 + edge23 : edge f2 f3 + old_width : 16 <= width f0 + old_count : 9 <= f0.cells.length + tail_bound : f3.trailing <= width f0 + 8 + current_good : good f3.cells +def z3Y (f g : frame) : Prop := + ∃ r n k gap a, + cut f.cells r n k /\ + g.cells = r ++ (n + f.trailing,gap) :: a /\ + good a /\ + k <= 1 + a.length /\ + width f * 5 <= width g * 2 /\ + width f * 3 <= gap * 2 + 4 /\ + g.trailing <= n + 8 +theorem z3Z (f : frame) : mass f.cells <= width f + 1 := by + unfold width; omega +theorem z40 {f0 f1 f2 f3 : frame} (h : history f0 f1 f2 f3) : + path 3 f0.cells f3.cells := by + have h0 : path 0 f0.cells f0.cells := path.zero f0.cells + have h1 : path 1 f0.cells f1.cells := path.next 0 f0.cells f0.cells f1.cells h0 h.edge01.1 + have h2 : path 2 f0.cells f2.cells := path.next 1 f0.cells f1.cells f2.cells h1 h.edge12.1 + exact path.next 2 f0.cells f2.cells f3.cells h2 h.edge23.1 +theorem z41 {f0 f1 f2 f3 : frame} {r : List cell} {n k : Nat} + (h : history f0 f1 f2 f3) (hc : cut f3.cells r n k) : + n <= width f0 := by + have hlt := z3U (z40 h) h.old_count hc + have hm := z3Z f0 + omega +theorem history_next {f0 f1 f2 f3 f4 : frame} + (h : history f0 f1 f2 f3) (hem : z3Y f3 f4) : + history f1 f2 f3 f4 := by + rcases hem with ⟨r,n,k,gap,a,hcut,hcells,ha,hsize,hg,hgap,htail⟩ + have hprefix := z41 h hcut + have hmain : main (n + f3.trailing,gap) := by + refine ⟨?_,?_⟩ + · have := z3X hcut; dsimp; omega + · dsimp + apply z1Q (width f0) (width f3) n f3.trailing gap + h.old_width + (z3V (width f0) (width f1) (width f2) (width f3) h.edge01.2.1 h.edge12.2.1 h.edge23.2.1) + hprefix h.tail_bound hgap + rcases z3W h.current_good hcut hmain ha hsize with ⟨hgood4,hcount4⟩ + have hg4 : good f4.cells := by rw [hcells]; exact hgood4 + have hn4 : f3.cells.length <= f4.cells.length := by rw [hcells]; exact hcount4 + rcases z3Q hcut with ⟨hk1,hk2,hr,_⟩ + have hadv : advance f3.cells f4.cells := ⟨k,(n + f3.trailing,gap) :: a,hk2,by rw [hcells,hr]⟩ + have hw0 := h.old_width + have hc0 := h.old_count + have he01_w := h.edge01.2.1 + have he01_c := h.edge01.2.2 + exact { + edge01 := h.edge12 + edge12 := h.edge23 + edge23 := ⟨hadv,hg,hn4⟩ + old_width := by omega + old_count := by omega + tail_bound := by omega + current_good := hg4 + } +theorem history_ready {f0 f1 f2 f3 : frame} (h : history f0 f1 f2 f3) : + good f3.cells /\ 9 <= f3.cells.length := by + have hc0 := h.old_count + have c01 := h.edge01.2.2 + have c12 := h.edge12.2.2 + have c23 := h.edge23.2.2 + exact ⟨h.current_good,by omega⟩ +def zSi (extra : Bool) (t u : Nat) : Prop := + if extra then main (t,u) else allowed (t,u) /\ (t,u) ≠ danger +inductive block : Bool -> Nat -> Nat -> Nat -> Nat -> List cell -> Nat -> Prop + | zero2 (l q h : Nat) : q + h = 1 -> + block false (l * 2 + q) 0 2 ((l + q) * 3 - 1) [] (1 + h) + | zero3 (l q h : Nat) : q + h = 1 -> + block false (l * 2 + q) 0 3 ((l + q) * 3 - 2) [danger] h + | zero5 (l q h : Nat) : q + h = 1 -> + block false (l * 2 + q) 0 5 ((l + q) * 3 - 1) [] (2 + h) + | zero (l q h j p : Nat) : q + h = 1 -> p <= 1 -> 1 + p <= j -> + block false (l * 2 + q) 0 (j * 2 + 2 + p) ((l + q) * 3 - 1) [(0,j - p)] (p + h) + | short (L t u s e : Nat) : 0 < t -> (u = 1 \/ u = 2) -> e <= 1 -> L * 3 + t + 7 = s * 2 + e -> + block false L t u (s - 1 - (e + u - 1)) [] (e + u - 1) + | one_odd (l q h b : Nat) : q + h = 1 -> + block false (l * 2 + q) 1 (b * 2 + 1) ((l + q) * 3) [] (b + 1 + h) + | one_even (l q h j : Nat) : q + h = 1 -> + block false (l * 2 + q) 1 (j * 2 + 2) ((l + q) * 3 - 1) [(0,j - 2),danger] h + | full (l q h a b p e : Nat) : q + h = 1 -> p <= 1 -> e <= 1 -> 1 <= a -> 1 <= b -> a + p = e -> + block false (l * 2 + q) (a * 2 + e) (b * 2 + 2 - p) ((l + q) * 3) [] (b + a + 1 + h) + | split (l q h a b p e : Nat) : q + h = 1 -> p <= 1 -> e <= 1 -> 1 <= a -> 1 <= b -> e < a + p -> + block false (l * 2 + q) (a * 2 + e) (b * 2 + 2 - p) ((l + q) * 3) [(b - 1,a + p - e)] (1 - p + e + h) + | extra_odd (l q h a b p : Nat) : q + h = 1 -> p <= 1 -> + block true (l * 2 + q) (a * 2 + 1) (b * 2 + 2 - p) ((l + q) * 3) [(b - 2,1)] (a + 3 + h) + | extra_even_odd (l q h a b : Nat) : q + h = 1 -> + block true (l * 2 + q) (a * 2) (b * 2 + 1) ((l + q) * 3) [(b - 1,a - 1),danger] h + | extra_four (l q h b : Nat) : q + h = 1 -> + block true (l * 2 + q) 4 (b * 2 + 2) ((l + q) * 3) [(b,1)] (1 + h) + | extra_even_even (l q h a b : Nat) : q + h = 1 -> 3 <= a -> + block true (l * 2 + q) (a * 2) (b * 2 + 2) ((l + q) * 3) [(b - 1,a - 2),danger] (1 + h) +theorem z42 {extra : Bool} {L t u gap : Nat} {a : List cell} {E : Nat} + (hb : block extra L t u gap a E) (hL : 16 <= L) (hsafe : zSi extra t u) : + 0 < gap /\ L * 3 <= gap * 2 + 4 /\ L * 3 <= (gap + mass a + E + 1) * 2 /\ + E <= t + u + (if extra then 11 else 9) /\ (if extra then 1 else 0) <= a.length := by + revert hL hsafe + induction hb <;> + intro hL hsafe <;> + simp [zSi,main,allowed,z1P,mass,weight,danger] at hL hsafe ⊢ <;> + omega +theorem z43 (t u : Nat) (hu : 0 < u) (hs : t = 0 \/ z1P t u) : good [(t,u)] := by + refine good.cons (t,u) [] ⟨hu,hs⟩ (fun _ => trivial) good.nil +theorem z44 (t u : Nat) (hu : 0 < u) (hs : t = 0 \/ z1P t u) (hne : (t,u) ≠ danger) : + good [(t,u),danger] := by + refine good.cons (t,u) [danger] ⟨hu,hs⟩ (fun heq => False.elim (hne heq)) ?_ + exact z43 0 1 (by omega) (Or.inl rfl) +theorem z45 {extra : Bool} {L t u gap : Nat} {a : List cell} {E : Nat} + (hb : block extra L t u gap a E) (hsafe : zSi extra t u) : good a := by + revert hsafe + induction hb with + | zero2 _ _ _ _ => intro _; exact good.nil + | zero3 _ _ _ _ => intro _; exact z43 0 1 (by omega) (Or.inl rfl) + | zero5 _ _ _ _ => intro _; exact good.nil + | zero l q h j p hqh hp hj => + intro _ + exact z43 0 (j - p) (by omega) (Or.inl rfl) + | short _ _ _ _ _ _ _ _ _ => intro _; exact good.nil + | one_odd _ _ _ _ _ => intro _; exact good.nil + | one_even l q h j hqh => + intro hsafe + simp [zSi,allowed,z1P,danger] at hsafe + refine z44 0 (j - 2) (by omega) (Or.inl rfl) ?_ + intro heq + injection heq with _ h2 + omega + | full _ _ _ _ _ _ _ _ _ _ _ _ _ => intro _; exact good.nil + | split l q h a b p e hqh hp he ha hb hlt => + intro hsafe + simp [zSi,allowed,z1P,danger] at hsafe + exact z43 (b - 1) (a + p - e) (by omega) (by unfold z1P at *; omega) + | extra_odd l q h a b p hqh hp => + intro hsafe + simp [zSi,main] at hsafe + exact z43 (b - 2) 1 (by omega) (by unfold z1P; omega) + | extra_even_odd l q h a b hqh => + intro hsafe + simp [zSi,main] at hsafe + refine z44 (b - 1) (a - 1) (by omega) (by unfold z1P; omega) ?_ + intro heq + injection heq with h1 h2 + omega + | extra_four l q h b hqh => + intro hsafe + simp [zSi,main] at hsafe + exact z43 b 1 (by omega) (by unfold z1P; omega) + | extra_even_even l q h a b hqh ha => + intro hsafe + simp [zSi,main] at hsafe + refine z44 (b - 1) (a - 2) (by omega) (by unfold z1P; omega) ?_ + intro heq + injection heq with h1 h2 + omega +theorem z46 {l r : List cell} {n k : Nat} (hc : cut l r n k) : mass l = n + mass r := by + cases hc with + | one p l _ _ => simp [mass] + | two p l _ => simp [mass,danger,weight]; omega +theorem z47 (f : frame) (r : List cell) (n k gap : Nat) (a : List cell) (E : Nat) + (hc : cut f.cells r n k) : + width ⟨r ++ (n + f.trailing,gap) :: a,E⟩ = width f + gap + mass a + E + 1 := by + have hm := z46 hc + have hl := z3X hc + simp only [width,mass_app,mass,weight] + omega +theorem z48 (f : frame) (r : List cell) (n k : Nat) (extra : Bool) (t u gap : Nat) + (a : List cell) (E : Nat) + (hcut : cut f.cells r n k) + (hn : n = t + u + (if extra then 3 else 1)) + (hk : k = (if extra then 2 else 1)) + (hL : 16 <= width f) + (hsafe : zSi extra t u) + (hb : block extra (width f) t u gap a E) : + z3Y f ⟨r ++ (n + f.trailing,gap) :: a,E⟩ := by + rcases z42 hb hL hsafe with ⟨hpos,hgap,hg,hE,hcount⟩ + refine ⟨r,n,k,gap,a,hcut,rfl,z45 hb hsafe,?_,?_,hgap,?_⟩ + · cases extra <;> (simp only [ Bool.false_eq_true,↓reduceIte] at hk hcount ⊢; omega) + · rw [z47 f r n k gap a E hcut] + omega + · dsimp + cases extra <;> (simp only [Bool.false_eq_true,↓reduceIte] at hn hE ⊢; omega) +theorem z49 (n : Nat) : ∃ a e,n = a * 2 + e /\ e <= 1 := + ⟨n / 2,n % 2,by omega,by omega⟩ +theorem z4a (n : Nat) (hn : 0 < n) : ∃ b p,n = b * 2 + 2 - p /\ p <= 1 := by + rcases z49 (n - 1) with ⟨b,e,he,hbit⟩ + exact ⟨b,1 - e,by omega,by omega⟩ +theorem z4b (extra : Bool) (L t u : Nat) (hsafe : zSi extra t u) : + ∃ gap a E,block extra L t u gap a E := by + rcases z49 L with ⟨l,q,hL_eq,hq⟩ + subst hL_eq + have hpad : q + (1 - q) = 1 := by omega + cases extra with + | true => + simp [zSi,main] at hsafe + rcases z49 t with ⟨a,e,ht_eq,he⟩ + rcases z4a u (by omega) with ⟨b,p,hu_eq,hp⟩ + rcases e with _ | _ | e + · have ht0 : t = a * 2 := by omega + subst ht0 + rcases p with _ | _ | p + · have hu0 : u = b * 2 + 2 := by omega + subst hu0 + by_cases ha2 : a = 2 + · subst ha2 + exact ⟨(l + q) * 3,[(b,1)],1 + (1 - q),block.extra_four l q (1 - q) b hpad⟩ + · exact ⟨(l + q) * 3,[(b - 1,a - 2),danger],1 + (1 - q), + block.extra_even_even l q (1 - q) a b hpad (by omega)⟩ + · have hu1 : u = b * 2 + 1 := by omega + subst hu1 + exact ⟨(l + q) * 3,[(b - 1,a - 1),danger],1 - q, + block.extra_even_odd l q (1 - q) a b hpad⟩ + · omega + · have ht1 : t = a * 2 + 1 := by omega + rw [ht1,hu_eq] + exact ⟨(l + q) * 3,[(b - 2,1)],a + 3 + (1 - q), + block.extra_odd l q (1 - q) a b p hpad hp⟩ + · omega + | false => + simp [zSi,allowed,z1P,danger] at hsafe + by_cases ht0 : t = 0 + · subst ht0 + simp at hsafe + have hu2 : 2 <= u := by omega + by_cases hu_eq2 : u = 2 + · subst hu_eq2 + exact ⟨(l + q) * 3 - 1,[],1 + (1 - q),block.zero2 l q (1 - q) hpad⟩ + · by_cases hu_eq3 : u = 3 + · subst hu_eq3 + exact ⟨(l + q) * 3 - 2,[danger],1 - q,block.zero3 l q (1 - q) hpad⟩ + · by_cases hu_eq5 : u = 5 + · subst hu_eq5 + exact ⟨(l + q) * 3 - 1,[],2 + (1 - q),block.zero5 l q (1 - q) hpad⟩ + · rcases z49 (u - 2) with ⟨j,p,hu_eq,hp⟩ + have hu_rw : u = j * 2 + 2 + p := by omega + rw [hu_rw] + exact ⟨(l + q) * 3 - 1,[(0,j - p)],p + (1 - q), + block.zero l q (1 - q) j p hpad hp (by omega)⟩ + · by_cases hu_le2 : u <= 2 + · rcases z49 ((l * 2 + q) * 3 + t + 7) with ⟨s,e,hs,he⟩ + exact ⟨s - 1 - (e + u - 1),[],e + u - 1, + block.short (l * 2 + q) t u s e (by omega) (by omega) he hs⟩ + · rcases z4a u (by omega) with ⟨b,p,hu_eq,hp⟩ + by_cases ht1 : t = 1 + · subst ht1 + rcases p with _ | _ | p + · have hu0 : u = b * 2 + 2 := by omega + subst hu0 + exact ⟨(l + q) * 3 - 1,[(0,b - 2),danger],1 - q, + block.one_even l q (1 - q) b hpad⟩ + · have hu1 : u = b * 2 + 1 := by omega + subst hu1 + exact ⟨(l + q) * 3,[],b + 1 + (1 - q), + block.one_odd l q (1 - q) b hpad⟩ + · omega + · rcases z49 t with ⟨a,e,ht_eq,he⟩ + rw [ht_eq,hu_eq] + by_cases hape : a + p = e + · exact ⟨(l + q) * 3,[],b + a + 1 + (1 - q), + block.full l q (1 - q) a b p e hpad hp he (by omega) (by omega) hape⟩ + · exact ⟨(l + q) * 3,[(b - 1,a + p - e)],1 - p + e + (1 - q), + block.split l q (1 - q) a b p e hpad hp he (by omega) (by omega) (by omega)⟩ +inductive consume : Bool -> Nat -> Nat -> List cell -> List cell -> Prop + | one (t u : Nat) (r : List cell) : consume false t u ((t,u) :: r) r + | two (t u : Nat) (r : List cell) : consume true t u (danger :: (t,u) :: r) r +theorem z4c {extra : Bool} {t u : Nat} {l r : List cell} + (hc : consume extra t u l r) (hsafe : zSi extra t u) : + cut l r (t + u + (if extra then 3 else 1)) (if extra then 2 else 1) := by + cases hc with + | one t u r => + simp only [Bool.false_eq_true,↓reduceIte] + exact cut.one (t,u) r hsafe.1 hsafe.2 + | two t u r => + simp only [↓reduceIte] + have hw : t + u + 3 = 2 + weight (t,u) := by simp [weight]; omega + rw [hw] + exact cut.two (t,u) r hsafe +theorem z4d (l : List cell) (hl : good l) (hlen : 2 <= l.length) : + ∃ extra t u r,consume extra t u l r /\ zSi extra t u := by + rcases z3O l hl hlen with ⟨r,n,k,hcut⟩ + cases hcut with + | one p r hp hne => + rcases p with ⟨t,u⟩ + exact ⟨false,t,u,r,consume.one t u r,⟨hp,hne⟩⟩ + | two p r hp => + rcases p with ⟨t,u⟩ + exact ⟨true,t,u,r,consume.two t u r,hp⟩ +def block_step (f g : frame) : Prop := + ∃ extra t u r gap a E, + consume extra t u f.cells r /\ + zSi extra t u /\ + block extra (width f) t u gap a E /\ + g = ⟨r ++ (t + u + (if extra then 3 else 1) + f.trailing,gap) :: a,E⟩ +theorem z4e (f : frame) (hgood : good f.cells) (hlen : 2 <= f.cells.length) : + ∃ g,block_step f g := by + rcases z4d f.cells hgood hlen with ⟨extra,t,u,r,hc,hsafe⟩ + rcases z4b extra (width f) t u hsafe with ⟨gap,a,E,hb⟩ + exact ⟨_,extra,t,u,r,gap,a,E,hc,hsafe,hb,rfl⟩ +theorem z4f {f g : frame} (hbs : block_step f g) (hL : 16 <= width f) : + z3Y f g := by + rcases hbs with ⟨extra,t,u,r,gap,a,E,hc,hsafe,hb,rfl⟩ + exact z48 f r (t + u + (if extra then 3 else 1)) (if extra then 2 else 1) + extra t u gap a E (z4c hc hsafe) rfl rfl hL hsafe hb +theorem history_width {f0 f1 f2 f3 : frame} (h : history f0 f1 f2 f3) : 16 <= width f3 := by + have hw0 := h.old_width + have h01 := h.edge01.2.1 + have h12 := h.edge12.2.1 + have h23 := h.edge23.2.1 + omega +theorem history_progress {f0 f1 f2 f3 : frame} (h : history f0 f1 f2 f3) : + ∃ f4,block_step f3 f4 /\ history f1 f2 f3 f4 := by + rcases history_ready h with ⟨hgood,hlen⟩ + rcases z4e f3 hgood (by omega) with ⟨f4,hstep⟩ + exact ⟨f4,hstep,history_next h (z4f hstep (history_width h))⟩ +end Queue +theorem z4g {n v : Nat} {w : zF} (h : zDg n v w) : + ∀ {a : zF},zDg n v a -> w = a := by + induction h with + | nil => + intro a ha + cases ha + rfl + | zero n v w h ih => + intro a ha + generalize hv : v * 2 = x at ha + cases ha with + | zero _ v' a' ha' => + have hv' : v' = v := by omega + subst hv' + rw [ih ha'] + | one _ v' a' ha' => omega + | one n v w h ih => + intro a ha + generalize hv : v * 2 + 1 = x at ha + cases ha with + | zero _ v' a' ha' => omega + | one _ v' a' ha' => + have hv' : v' = v := by omega + subst hv' + rw [ih ha'] +theorem z4h {n v : Nat} {w : zF} {j u : Nat} {a : zF} + (h : zDg n v w) (ha : zDg j u a) : + zDg (n + j) (v + 2 ^ n * u) (w ++ a) := by + induction h with + | nil => + simp only [Nat.zero_add,Nat.pow_zero,Nat.one_mul,List.nil_append] + exact ha + | zero n v w _ ih => + have hlen : n + 1 + j = (n + j) + 1 := by omega + have hval : v * 2 + 2 ^ (n + 1) * u = (v + 2 ^ n * u) * 2 := by + rw [Nat.pow_succ]; ring + rw [hlen,hval,List.append_assoc] + exact zDg.zero (n + j) (v + 2 ^ n * u) (w ++ a) ih + | one n v w _ ih => + have hlen : n + 1 + j = (n + j) + 1 := by omega + have hval : v * 2 + 1 + 2 ^ (n + 1) * u = (v + 2 ^ n * u) * 2 + 1 := by + rw [Nat.pow_succ]; ring + rw [hlen,hval,List.append_assoc] + exact zDg.one (n + j) (v + 2 ^ n * u) (w ++ a) ih +theorem z4i {n v : Nat} {w : zF} (h : zDg n v w) : + zDg (n + 1) (v + 2 ^ n) (w ++ d) := by + have h1 : v + 2 ^ n = v + 2 ^ n * 1 := by omega + rw [h1] + exact z4h h (zDg.one 0 0 [] .nil) +theorem z4j {n v : Nat} {w : zF} (r : zB) (h : zDg n v w) : + (z18 (LC (n + 1) 0 ldh) (w +> z +> r)) [z00]⊢⁺ + (z18 (LC (n + 1) 0 ldh) (d +> w +> [1] +> r)) := by + have hv := z1W h + have hlt : v * 2 + 1 < 2 ^ (n + 1) := by rw [Nat.pow_succ]; omega + rcases z2c (n + 1) v (w ++ z) r (z2d h) hlt with ⟨a,ha,hrun⟩ + have heq : a = d ++ w := z4g ha (zDg.one n v w h) + rw [heq] at hrun + simpa [append_assoc] using hrun +theorem z4k {n v : Nat} {w : zF} (r : zB) (h : zDg n v w) : + (z18 (LC (n + 1) 0 ldh) (w +> d +> z +> r)) [z00]⊢⁺ + (z18 (LC (n + 1) 0 ldh) (d +> w +> z +> [1] +> r)) := by + have hv := z1W h + have hge : 2 ^ (n + 1) <= (v + 2 ^ n) * 2 + 1 := by rw [Nat.pow_succ]; omega + rcases z2f (n + 1) (v + 2 ^ n) (w ++ d) r (z4i h) hge with ⟨a,ha,hrun⟩ + have hval : (v + 2 ^ n) * 2 + 1 - 2 ^ (n + 1) = v * 2 + 1 := by rw [Nat.pow_succ]; omega + rw [hval] at ha + have heq : a = d ++ w := z4g ha (zDg.one n v w h) + rw [heq] at hrun + simpa [append_assoc] using hrun +theorem z4l {n v : Nat} {w : zF} (r : zB) (h : zDg n v w) : + (z18 (LC (n + 1) 0 ldh) (w +> d +> r)) [z00]⊢⁺ + (((o1 ^ (4 + (n + 1) * 3)) +> ld0 +> LC (n + 1) (v * 2 + 1) ldh) {{D}}> r) := by + have hge : 2 ^ (n + 1) <= (v + 2 ^ n) * 2 + 1 := by rw [Nat.pow_succ]; omega + have hrun := z2k (n + 1) (v + 2 ^ n) (w ++ d) r (z4i h) hge + have hval : (v + 2 ^ n) * 2 + 1 - 2 ^ (n + 1) = v * 2 + 1 := by rw [Nat.pow_succ]; omega + rw [hval,append_assoc] at hrun + exact hrun +theorem z4m : ∀ (t n v : Nat) (w : zF) (r : zB), + zDg n v w -> + (z18 (LC (n + t) 0 ldh) (w +> (d ^ t) +> z +> r)) [z00]⊢* + (z18 (LC (n + t) 0 ldh) ((d ^ t) +> w +> z +> (o1 ^ t) +> r)) + | 0,n,v,w,r,_ => by simp; try exact ⟨0,rfl⟩ + | t + 1,n,v,w,r,h => by + have htop := z4i h + have hrun := z4m t (n + 1) (v + 2 ^ n) (w ++ d) r htop + have hlen1 : n + 1 + t = n + (t + 1) := by omega + rw [hlen1] at hrun + simp only [append_assoc] at hrun + have hlow := z4h (z1Y t) h + have hstep := zPs (z4k ((o1 ^ t) +> r) hlow) + have hlen2 : t + n + 1 = n + (t + 1) := by omega + rw [hlen2] at hstep + simp only [append_assoc] at hstep + have h1 : (d ^ (t + 1) : zF) +> z +> r = d +> (d ^ t) +> z +> r := by + rw [z08,append_assoc] + have h2 : (d ^ (t + 1) : zF) +> w +> z +> (o1 ^ (t + 1)) +> r = + d +> (d ^ t) +> w +> z +> [1] +> (o1 ^ t) +> r := by + rw [z08 d t,z08 o1 t,append_assoc,append_assoc] + rw [h1,h2] + exact zSt hrun hstep +theorem z4n : ∀ (u n v : Nat) (w : zF) (r : zB), + zDg n v w -> + (z18 (LC (n + u) 0 ldh) (w +> (z ^ u) +> r)) [z00]⊢* + (z18 (LC (n + u) 0 ldh) ((d ^ u) +> w +> (o1 ^ u) +> r)) + | 0,n,v,w,r,_ => by simp; try exact ⟨0,rfl⟩ + | u + 1,n,v,w,r,h => by + have htop := z2d h + have hrun := z4n u (n + 1) v (w ++ z) r htop + have hlen1 : n + 1 + u = n + (u + 1) := by omega + rw [hlen1] at hrun + simp only [append_assoc] at hrun + have hlow := z4h (z1Y u) h + have hstep := zPs (z4j ((o1 ^ u) +> r) hlow) + have hlen2 : u + n + 1 = n + (u + 1) := by omega + rw [hlen2] at hstep + simp only [append_assoc] at hstep + have h1 : (z ^ (u + 1) : zF) +> r = z +> (z ^ u) +> r := by + rw [z08,append_assoc] + have h2 : (d ^ (u + 1) : zF) +> w +> (o1 ^ (u + 1)) +> r = + d +> (d ^ u) +> w +> [1] +> (o1 ^ u) +> r := by + rw [z08 d u,z08 o1 u,append_assoc,append_assoc] + rw [h1,h2] + exact zSt hrun hstep +theorem z4o (t u j v : Nat) (w : zF) (r : zB) (h : zDg j v w) : + let L := j + 1 + u + t + let K := (v + 1) * 2 ^ (1 + u + t) - 1 + (z18 (LC L 0 ldh) (w +> d +> (z ^ u) +> (d ^ t) +> z +> r)) [z00]⊢⁺ + (((o1 ^ (4 + L * 3)) +> ld0 +> LC L K ldh) {{D}}> ((o1 ^ u) +> z +> (o1 ^ t) +> r)) := by + intro L K + have hwd := z4i h + have hmid := z4h hwd (z1X u) + have hfirst := z4m t (j + 1 + u) (v + 2 ^ j + 2 ^ (j + 1) * 0) (w ++ d ++ (z ^ u)) r hmid + simp only [append_assoc] at hfirst + have hprefix := z4h (z1Y t) hwd + have hsecond := z4n u (t + (j + 1)) (2 ^ t - 1 + 2 ^ t * (v + 2 ^ j)) + ((d ^ t) ++ (w ++ d)) (z +> (o1 ^ t) +> r) hprefix + have hlen2 : t + (j + 1) + u = L := by omega + rw [hlen2] at hsecond + simp only [append_assoc] at hsecond + have hlow := z4h (z1Y (u + t)) h + have hlast := z4l ((o1 ^ u) +> z +> (o1 ^ t) +> r) hlow + have hlen3 : u + t + j + 1 = L := by omega + have hval3 : (2 ^ (u + t) - 1 + 2 ^ (u + t) * v) * 2 + 1 = K := by + dsimp only [K] + have hp := z0h (u + t) + have hp1 : 2 ^ (1 + u + t) = 2 ^ (u + t) * 2 := by + rw [show 1 + u + t = (u + t) + 1 by omega,Nat.pow_succ] + have hcalc1 : (2 ^ (u + t) - 1 + 2 ^ (u + t) * v) * 2 = + (2 ^ (u + t) - 1) * 2 + 2 ^ (u + t) * v * 2 := by ring + have hcalc2 : (v + 1) * (2 ^ (u + t) * 2) = + 2 ^ (u + t) * 2 + 2 ^ (u + t) * v * 2 := by ring + rw [hp1,hcalc1,hcalc2] + omega + rw [hlen3,hval3,z09 d u t,append_assoc,append_assoc] at hlast + exact z06 hfirst (z06 hsecond hlast) +theorem z4p (r j v : Nat) (w : zF) (h : zDg j v w) : + zDg (j + r) ((v + 1) * 2 ^ r - 1) ((d ^ r) ++ w) := by + have hlen : j + r = r + j := by omega + have hpr := z0h r + have hval : (v + 1) * 2 ^ r - 1 = 2 ^ r - 1 + 2 ^ r * v := by + rw [Nat.add_mul,Nat.one_mul,Nat.mul_comm v (2 ^ r)] + omega + rw [hlen,hval] + exact z4h (z1Y r) h +theorem z4q : z +> (default : zB) = default := z1U +theorem z4r (t u j v : Nat) (w : zF) (h : zDg j v w) : + let L := j + 1 + u + t + let K := (v + 1) * 2 ^ (1 + u + t) - 1 + (z18 (LC L 0 ldh) (w +> d +> (z ^ u) +> (d ^ t) +> default)) [z00]⊢⁺ + (((o1 ^ (4 + L * 3)) +> ld0 +> LC L K ldh) {{D}}> ((o1 ^ u) +> z +> (o1 ^ t) +> default)) := by + intro L K + have hrun := z4o t u j v w default h + rw [z4q] at hrun + exact hrun +theorem z4s (j v : Nat) (w : zF) (h : zDg j v w) : + (z18 (LC (j + 2) 0 ldh) (w +> d +> z +> default)) [z00]⊢⁺ + (z18 (LC (j + 2) 0 ldh) ((d ^ 2) +> w +> RC 4)) := by + have hfirst := z4r 0 1 j v w h + dsimp only at hfirst + have hlen : j + 1 + 1 + 0 = j + 2 := by omega + have hr1 : (z ^ 1 : zF) +> (d ^ 0) +> (default : zB) = z +> default := rfl + have hr2 : (o1 ^ 1 : zF) +> z +> (o1 ^ 0) +> (default : zB) = [1] +> default := by + have : (o1 ^ 1 : zF) = [1] := rfl + have : (o1 ^ 0 : zF) = [] := rfl + simp + rw [hlen,hr1,hr2] at hfirst + have hK := z4p 2 j v w h + have hlast := z3i (j + 2) ((v + 1) * 2 ^ 2 - 1) ((d ^ 2) ++ w) ldh hK + rw [append_assoc] at hlast + exact z05 hfirst hlast +theorem z4t (t u j v : Nat) (w : zF) (h : zDg j v w) : + let L := j + 3 + u + t + let K := (v + 1) * 2 ^ (3 + u + t) - 1 + (z18 (LC L 0 ldh) (w +> d +> (z ^ u) +> (d ^ t) +> d +> z +> default)) [z00]⊢⁺ + (((o1 ^ (4 + L * 3)) +> ld0 +> LC L K ldh) {{D}}> ((o1 ^ u) +> z +> (o1 ^ t) +> z +> d +> default)) := by + intro L K + have hmid := z4h (z4i h) (z1X u) + have hhigh := z4h hmid (z1Y t) + have hfirst := z4s (j + 1 + u + t) _ ((w ++ d ++ (z ^ u)) ++ (d ^ t)) hhigh + have hlen1 : j + 1 + u + t + 2 = L := by omega + rw [hlen1] at hfirst + simp only [append_assoc] at hfirst + have hlast := z4o t u (j + 2) ((v + 1) * 2 ^ 2 - 1) ((d ^ 2) ++ w) (z +> d +> default) + (z4p 2 j v w h) + dsimp only at hlast + have hlen2 : j + 2 + 1 + u + t = L := by omega + have hval2 : ((v + 1) * 2 ^ 2 - 1 + 1) * 2 ^ (1 + u + t) - 1 = K := by + dsimp only [K] + have hpos : 1 <= (v + 1) * 2 ^ 2 := by omega + have hsub : (v + 1) * 2 ^ 2 - 1 + 1 = (v + 1) * 2 ^ 2 := by omega + have hp : 2 ^ (3 + u + t) = 2 ^ 2 * 2 ^ (1 + u + t) := by + rw [show 3 + u + t = 2 + (1 + u + t) by omega,Nat.pow_add] + rw [hsub,hp,Nat.mul_assoc] + have hrc4 : (RC 4 : zB) = z +> z +> d +> default := by + rw [<- z2J]; rfl + rw [hlen2,hval2,append_assoc] at hlast + rw [hrc4] at hfirst + exact zPt hfirst hlast +def zRw : List Queue.cell -> Nat -> zF + | [],E => d ^ E + | (t,u) :: r,E => zRw r E ++ (z ^ u) ++ (d ^ (t + 1)) +def zRv : List Queue.cell -> Nat -> Nat + | [],E => 2 ^ E - 1 + | (t,u) :: r,E => zRv r E + 2 ^ (Queue.mass r + E + u) * (2 ^ (t + 1) - 1) +def zFw (f : Queue.frame) : zF := + match f.cells with + | [] => d ^ (f.trailing - 1) + | (t,u) :: r => zRw r f.trailing ++ (z ^ u) ++ (d ^ t) +def config (f : Queue.frame) : Cfg (Fin 2) (Fin 6) := + z18 (LC (Queue.width f) 0 ldh) (zFw f +> default) +theorem z4u {n v : Nat} {w : zF} (u t : Nat) (h : zDg n v w) : + zDg (n + u + t) (v + 2 ^ (n + u) * (2 ^ t - 1)) (w ++ (z ^ u) ++ (d ^ t)) := by + have hz := z4h h (z1X u) + simp only [Nat.mul_zero,Nat.add_zero] at hz + exact z4h hz (z1Y t) +theorem z4v : ∀ (l : List Queue.cell) (E : Nat), + zDg (Queue.mass l + E) (zRv l E) (zRw l E) + | [],E => by + simp only [Queue.mass,Nat.zero_add,zRv,zRw] + exact z1Y E + | (t,u) :: r,E => by + simp only [Queue.mass,Queue.weight,zRv,zRw] + have h := z4u u (t + 1) (z4v r E) + have hlen : Queue.mass r + E + u + (t + 1) = t + u + 1 + Queue.mass r + E := by omega + rw [hlen] at h + exact h +theorem z4w (l : List Queue.cell) (E : Nat) : + ∃ v,zDg (Queue.mass l + E) v (zRw l E) := + ⟨zRv l E,z4v l E⟩ +theorem z4x (f : Queue.frame) (hne : f.cells ≠ []) : + ∃ v,zDg (Queue.width f) v (zFw f) := by + rcases f with ⟨_ | ⟨⟨t,u⟩,r⟩,E⟩ + · contradiction + · rcases z4w r E with ⟨v,hv⟩ + refine ⟨v + 2 ^ (Queue.mass r + E + u) * (2 ^ t - 1),?_⟩ + have h := z4u u t hv + have hlen : Queue.mass r + E + u + t = Queue.width ⟨(t,u) :: r,E⟩ := by + simp only [Queue.width,Queue.mass,Queue.weight]; omega + rw [<- hlen] + exact h +theorem z4y (l : List Queue.cell) (E : Nat) (hne : l ≠ []) : + zRw l E = zFw ⟨l,E⟩ ++ d := by + rcases l with _ | ⟨⟨t,u⟩,r⟩ + · contradiction + · simp only [zRw,zFw] + rw [show t + 1 = t + 1 by rfl,<- z0a d t] + simp [List.append_assoc] +theorem z4z (t u : Nat) (r : List Queue.cell) (E : Nat) (hr : r ≠ []) : + zFw ⟨(t,u) :: r,E⟩ = zFw ⟨r,E⟩ ++ d ++ (z ^ u) ++ (d ^ t) := by + change zRw r E ++ (z ^ u) ++ (d ^ t) = zFw ⟨r,E⟩ ++ d ++ (z ^ u) ++ (d ^ t) + rw [z4y r E hr] +theorem z4A (t u : Nat) (r : List Queue.cell) (E : Nat) (hr : r ≠ []) : + zFw ⟨Queue.danger :: (t,u) :: r,E⟩ = + zFw ⟨r,E⟩ ++ d ++ (z ^ u) ++ (d ^ t) ++ d ++ z := by + unfold Queue.danger + rw [z4z 0 1 ((t,u) :: r) E (by simp),z4z t u r E hr] + have hd0 : (d ^ 0 : zF) = [] := rfl + have hz1 : (z ^ 1 : zF) = z := rfl + rw [hd0,hz1,List.append_nil] +theorem z4B : ∀ (l r : List Queue.cell) (E : Nat), + zRw (l ++ r) E = zRw r E ++ zRw l 0 + | [],r,E => by simp [zRw] + | (t,u) :: l,r,E => by + simp only [List.cons_append,zRw,z4B l r E,List.append_assoc] +theorem z4C : ∀ (l : List Queue.cell) (E : Nat), + zRw l E = (d ^ E) ++ zRw l 0 + | [],E => by simp [zRw] + | (t,u) :: l,E => by + simp only [zRw] + rw [z4C l E] + simp [List.append_assoc] +theorem z4D (l r : List Queue.cell) (E : Nat) (hl : l ≠ []) : + zFw ⟨l ++ r,E⟩ = zRw r E ++ zFw ⟨l,0⟩ := by + rcases l with _ | ⟨⟨t,u⟩,l⟩ + · contradiction + · simp only [List.cons_append,zFw,z4B,List.append_assoc] +theorem z4E (l : List Queue.cell) (E : Nat) (hl : l ≠ []) : + zFw ⟨l,E⟩ = (d ^ E) ++ zFw ⟨l,0⟩ := by + rcases l with _ | ⟨⟨t,u⟩,l⟩ + · contradiction + · simp only [zFw] + rw [z4C l E] + simp [List.append_assoc] +def z4F (gap : Nat) (a : List Queue.cell) (E : Nat) : zF := + zRw a E ++ (z ^ gap) ++ d +def zPw (gap : Nat) (a : List Queue.cell) (E : Nat) : Nat := + gap + Queue.mass a + E + 1 +def zPv (gap : Nat) (a : List Queue.cell) (E : Nat) : Nat := + zRv a E + 2 ^ (Queue.mass a + E + gap) +theorem z4G (gap : Nat) (a : List Queue.cell) (E : Nat) : + zDg (zPw gap a E) (zPv gap a E) (z4F gap a E) := by + have h := z4u gap 1 (z4v a E) + have hd1 : (d ^ 1 : zF) = d := rfl + have hlen : Queue.mass a + E + gap + 1 = zPw gap a E := by + unfold zPw; omega + have hval : zRv a E + 2 ^ (Queue.mass a + E + gap) * (2 ^ 1 - 1) = zPv gap a E := by + unfold zPv; omega + rw [hd1,hlen,hval] at h + exact h +theorem z4H (gap : Nat) (a : List Queue.cell) (E k : Nat) : + z4F gap a E +> RC k = RC (k * 2 ^ (zPw gap a E) + zPv gap a E) := by + rw [z2m (z4G gap a E) k] + congr 1 + ring +theorem z4I (r : List Queue.cell) (E n gap : Nat) (a : List Queue.cell) (E' : Nat) + (hr : r ≠ []) : + zFw ⟨r ++ (n + E,gap) :: a,E'⟩ = + z4F gap a E' ++ (d ^ n) ++ zFw ⟨r,E⟩ := by + rw [z4D r ((n + E,gap) :: a) E' hr] + unfold z4F + simp only [zRw] + rw [z4E r E hr] + have hpow : (d ^ (n + E + 1) : zF) = d ++ (d ^ n) ++ (d ^ E) := by + rw [show n + E + 1 = 1 + n + E by omega,z09,z09] + rfl + rw [hpow] + simp [List.append_assoc] +theorem z4J {extra : Bool} {t u : Nat} {l r : List Queue.cell} (E : Nat) + (hc : Queue.consume extra t u l r) (hr : r ≠ []) : + Queue.width ⟨l,E⟩ = Queue.width ⟨r,E⟩ + t + u + (if extra then 3 else 1) := by + cases hc <;> + · rcases r with _ | ⟨⟨x,y⟩,r⟩ + · contradiction + · simp only [Queue.width,Queue.mass,Queue.weight,Queue.danger,Bool.false_eq_true,↓reduceIte]; omega +def zDc (extra : Bool) (L k t u : Nat) : Cfg (Fin 2) (Fin 6) := + (((o1 ^ (4 + L * 3)) +> ld0 +> LC L k ldh) {{D}}> + ((o1 ^ u) +> z +> (o1 ^ t) +> (if extra then z +> d +> default else default))) +theorem z4K {extra : Bool} {t u : Nat} {l r : List Queue.cell} (E v : Nat) + (hc : Queue.consume extra t u l r) (hr : r ≠ []) + (hd : zDg (Queue.width ⟨r,E⟩) v (zFw ⟨r,E⟩)) : + (config ⟨l,E⟩) [z00]⊢⁺ + (zDc extra (Queue.width ⟨l,E⟩) ((v + 1) * 2 ^ (t + u + (if extra then 3 else 1)) - 1) t u) := by + have hw := z4J E hc hr + cases hc with + | one t u r => + unfold config zDc + rw [z4z t u r E hr] + simp only [append_assoc,Bool.false_eq_true,↓reduceIte] at hw ⊢ + have h1 := z4r t u (Queue.width ⟨r,E⟩) v (zFw ⟨r,E⟩) hd + dsimp only at h1 + have hlen : Queue.width ⟨r,E⟩ + 1 + u + t = Queue.width ⟨(t,u) :: r,E⟩ := by omega + have hexp : 1 + u + t = t + u + 1 := by omega + rw [hlen,hexp] at h1 + exact h1 + | two t u r => + unfold config zDc + rw [z4A t u r E hr] + simp only [append_assoc,↓reduceIte] at hw ⊢ + have h1 := z4t t u (Queue.width ⟨r,E⟩) v (zFw ⟨r,E⟩) hd + dsimp only at h1 + have hlen : Queue.width ⟨r,E⟩ + 3 + u + t = Queue.width ⟨Queue.danger :: (t,u) :: r,E⟩ := by omega + have hexp : 3 + u + t = t + u + 3 := by omega + rw [hlen,hexp] at h1 + exact h1 +def zDr (extra : Bool) (L t u gap : Nat) (a : List Queue.cell) (E : Nat) : Prop := + ∀ k,k < 2 ^ L -> + (zDc extra L k t u) [z00]⊢* + (z18 (LC (L + zPw gap a E) 0 ldh) (z4F gap a E +> RC k)) +theorem z4L {extra : Bool} {t u : Nat} {l r : List Queue.cell} + (E gap : Nat) (a : List Queue.cell) (E' : Nat) + (hc : Queue.consume extra t u l r) (hr : r ≠ []) : + Queue.width ⟨r ++ (t + u + (if extra then 3 else 1) + E,gap) :: a,E'⟩ = + Queue.width ⟨l,E⟩ + zPw gap a E' := by + have hw := z4J E hc hr + have hm : 0 < Queue.mass r := by + have := Queue.length_mass r + rcases r with _ | ⟨p,r⟩ + · contradiction + · simp at this; omega + simp only [Queue.width,Queue.mass_app,Queue.mass,Queue.weight,zPw] at hw ⊢ + omega +theorem z4M {extra : Bool} {t u : Nat} {l r : List Queue.cell} + (E gap : Nat) (a : List Queue.cell) (E' : Nat) + (hc : Queue.consume extra t u l r) (hr : r ≠ []) + (hreturn : zDr extra (Queue.width ⟨l,E⟩) t u gap a E') : + (config ⟨l,E⟩) [z00]⊢⁺ + (config ⟨r ++ (t + u + (if extra then 3 else 1) + E,gap) :: a,E'⟩) := by + rcases z4x ⟨r,E⟩ hr with ⟨v,hv⟩ + have hw := z4J E hc hr + let n := t + u + (if extra then 3 else 1) + have hw' : Queue.width ⟨r,E⟩ + n = Queue.width ⟨l,E⟩ := by dsimp [n]; omega + have hK := z4p n (Queue.width ⟨r,E⟩) v (zFw ⟨r,E⟩) hv + rw [hw'] at hK + have h1 := z4K E v hc hr hv + have h2 := hreturn ((v + 1) * 2 ^ n - 1) (z1W hK) + have hword := z2m hK 0 + simp only [Nat.mul_zero,Nat.add_zero,append_assoc] at hword + rw [<- z2K] at hword + rw [<- hword] at h2 + have hg := z4L E gap a E' hc hr + have hcfg : config ⟨r ++ (n + E,gap) :: a,E'⟩ = + z18 (LC (Queue.width ⟨l,E⟩ + zPw gap a E') 0 ldh) + (z4F gap a E' +> (d ^ n) +> zFw ⟨r,E⟩ +> default) := by + unfold config + rw [hg,z4I r E n gap a E' hr,append_assoc,append_assoc] + rw [hcfg] + exact z05 h1 h2 +theorem z4N (extra : Bool) (L t u gap : Nat) (a : List Queue.cell) (E s v : Nat) + (hs : s = zPw gap a E) + (hv : zPv gap a E = 2 ^ (s - 1) + v) + (hrun : ∀ k,k < 2 ^ L -> + (zDc extra L k t u) [z00]⊢* + (z18 (LC (L + s) 0 ldh) (RC (k * 2 ^ s + 2 ^ (s - 1) + v)))) : + zDr extra L t u gap a E := by + subst hs + intro k hk + rw [z4H,hv] + have hassoc : k * 2 ^ zPw gap a E + (2 ^ (zPw gap a E - 1) + v) = + k * 2 ^ zPw gap a E + 2 ^ (zPw gap a E - 1) + v := by omega + rw [hassoc] + exact hrun k hk +theorem z4O (l q h k j p : Nat) + (hqh : q + h = 1) (hL : 0 < l * 2 + q) (hk : k < 2 ^ (l * 2 + q)) (hp : p <= 1) : + let s := l * 3 + 2 + q * 2 + j + (zDc false (l * 2 + q) k 0 (2 + j * 2 + p)) [z00]⊢* + (z18 (LC (l * 2 + q + s) 0 ldh) (RC (k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ j + p) * (1 + h) + h)))) := by + intro s + unfold zDc + have hr : z +> (o1 ^ 0) +> (if false then z +> d +> default else (default : zB)) = default := by + simp + rw [hr] + have hrun := z3g l q h k j p ldh hqh hL hk hp + dsimp only at hrun + have hval : k * 2 ^ s + 2 ^ (s - 1) + (2 ^ j + p) * (1 + h) + h = + k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ j + p) * (1 + h) + h) := by omega + rw [<- hval] + exact hrun +theorem z4P (l q h : Nat) (hqh : q + h = 1) (hL : 16 <= l * 2 + q) : + zDr false (l * 2 + q) 0 2 ((l + q) * 3 - 1) [] (1 + h) := by + refine z4N false (l * 2 + q) 0 2 ((l + q) * 3 - 1) [] (1 + h) + (l * 3 + 2 + q * 2 + 0) ((2 ^ 0 + 0) * (1 + h) + h) ?_ ?_ ?_ + · simp [zPw,Queue.mass]; omega + · simp only [zPv,zRv,Queue.mass] + have hexp : 0 + (1 + h) + ((l + q) * 3 - 1) = l * 3 + 2 + q * 2 + 0 - 1 := by omega + rw [hexp] + rcases h with _ | _ | h <;> omega + · intro k hk + exact z4O l q h k 0 0 hqh (by omega) hk (by omega) +theorem z4Q (l q h : Nat) (hqh : q + h = 1) (hL : 16 <= l * 2 + q) : + zDr false (l * 2 + q) 0 3 ((l + q) * 3 - 2) [Queue.danger] h := by + refine z4N false (l * 2 + q) 0 3 ((l + q) * 3 - 2) [Queue.danger] h + (l * 3 + 2 + q * 2 + 0) ((2 ^ 0 + 1) * (1 + h) + h) ?_ ?_ ?_ + · simp [zPw,Queue.danger,Queue.mass,Queue.weight]; omega + · simp only [zPv,Queue.danger,zRv,Queue.mass,Queue.weight] + have hexp : (0 + 1 + 1 + 0) + h + ((l + q) * 3 - 2) = l * 3 + 2 + q * 2 + 0 - 1 := by omega + rw [hexp] + rcases h with _ | _ | h <;> omega + · intro k hk + exact z4O l q h k 0 1 hqh (by omega) hk (by omega) +theorem z4R (l q h : Nat) (hqh : q + h = 1) (hL : 16 <= l * 2 + q) : + zDr false (l * 2 + q) 0 5 ((l + q) * 3 - 1) [] (2 + h) := by + refine z4N false (l * 2 + q) 0 5 ((l + q) * 3 - 1) [] (2 + h) + (l * 3 + 2 + q * 2 + 1) ((2 ^ 1 + 1) * (1 + h) + h) ?_ ?_ ?_ + · simp [zPw,Queue.mass]; omega + · simp only [zPv,zRv,Queue.mass] + have hexp : 0 + (2 + h) + ((l + q) * 3 - 1) = l * 3 + 2 + q * 2 + 1 - 1 := by omega + rw [hexp] + rcases h with _ | _ | h <;> omega + · intro k hk + exact z4O l q h k 1 1 hqh (by omega) hk (by omega) +theorem z4S (l q h j p : Nat) (hqh : q + h = 1) (hL : 16 <= l * 2 + q) + (hp : p <= 1) (hj : 1 + p <= j) : + zDr false (l * 2 + q) 0 (j * 2 + 2 + p) ((l + q) * 3 - 1) [(0,j - p)] (p + h) := by + refine z4N false (l * 2 + q) 0 (j * 2 + 2 + p) ((l + q) * 3 - 1) [(0,j - p)] (p + h) + (l * 3 + 2 + q * 2 + j) ((2 ^ j + p) * (1 + h) + h) ?_ ?_ ?_ + · simp [zPw,Queue.mass,Queue.weight]; omega + · simp only [zPv,zRv,Queue.mass,Queue.weight] + have hexp1 : (0 + (j - p) + 1 + 0) + (p + h) + ((l + q) * 3 - 1) = l * 3 + 2 + q * 2 + j - 1 := by omega + have hexp2 : 0 + (p + h) + (j - p) = j + h := by omega + have hpow : 2 ^ (j + h) = 2 ^ j * 2 ^ h := Nat.pow_add 2 j h + rw [hexp1,hexp2,hpow] + rcases p with _ | _ | p <;> rcases h with _ | _ | h <;> + (simp only [Nat.reduceAdd,Nat.reducePow,Nat.reduceSub]; omega) + · intro k hk + have hu : j * 2 + 2 + p = 2 + j * 2 + p := by omega + rw [hu] + exact z4O l q h k j p hqh (by omega) hk hp +theorem z4T (L t u s e : Nat) (hL : 0 < L) (hshort : u = 2 -> 4 <= t) + (ht : 0 < t) (hu : u = 1 \/ u = 2) (he : e <= 1) (hs : L * 3 + t + 7 = s * 2 + e) : + zDr false L t u (s - 1 - (e + u - 1)) [] (e + u - 1) := by + refine z4N false L t u (s - 1 - (e + u - 1)) [] (e + u - 1) + s (2 ^ (e + u - 1) - 1) ?_ ?_ ?_ + · rcases hu with rfl | rfl <;> (simp [zPw,Queue.mass]; omega) + · simp only [zPv,zRv,Queue.mass] + have hexp : 0 + (e + u - 1) + (s - 1 - (e + u - 1)) = s - 1 := by + rcases hu with rfl | rfl <;> omega + rw [hexp]; omega + · intro k hk + rcases hu with rfl | rfl + · rcases e with _ | _ | e + · unfold zDc + have hr : (o1 ^ 1 : zF) +> z +> (o1 ^ t) +> + (if false then z +> d +> default else (default : zB)) = + [1,0,0,0] +> (o1 ^ t) +> default := rfl + rw [hr] + exact z2P L k t s 0 ldh hk ht (by omega) hs + · unfold zDc + have hr : (o1 ^ 1 : zF) +> z +> (o1 ^ t) +> + (if false then z +> d +> default else (default : zB)) = + [1,0,0,0] +> (o1 ^ t) +> default := rfl + rw [hr] + exact z2P L k t s 1 ldh hk ht (by omega) hs + · omega + · have hv : 2 ^ (e + 2 - 1) - 1 = e * 2 + 1 := by + rcases e with _ | _ | e <;> omega + have hassoc : k * 2 ^ s + 2 ^ (s - 1) + (e * 2 + 1) = k * 2 ^ s + 2 ^ (s - 1) + e * 2 + 1 := by omega + rw [hv,hassoc] + unfold zDc + have hr : (o1 ^ 2 : zF) +> z +> (o1 ^ t) +> + (if false then z +> d +> default else (default : zB)) = + [1,1,0,0,0] +> (o1 ^ t) +> default := rfl + rw [hr] + exact z2Q L k t s e ldh hk (hshort rfl) he hs +theorem z4U (l q h b : Nat) (hqh : q + h = 1) (hL : 16 <= l * 2 + q) : + zDr false (l * 2 + q) 1 (3 + b * 2) ((l + q) * 3) [] (b + 2 + h) := by + let s := l * 3 + 2 + q * 2 + (b + 1 + 1) + refine z4N false (l * 2 + q) 1 (3 + b * 2) ((l + q) * 3) [] (b + 2 + h) + s (((2 ^ (b + 1) - 1) * 2 + 1) * (1 + h) + h) ?_ ?_ ?_ + · simp [zPw,Queue.mass,s]; omega + · simp only [zPv,zRv,Queue.mass] + have hexp : 0 + (b + 2 + h) + (l + q) * 3 = s - 1 := by dsimp [s]; omega + rw [hexp] + have hpb := z0h (b + 1) + rcases h with _ | _ | h + · have : b + 2 + 0 = (b + 1) + 1 := by omega + rw [this,Nat.pow_succ]; omega + · have : b + 2 + 1 = (b + 1) + 2 := by omega + rw [this,Nat.pow_add]; omega + · omega + · intro k hk + have hassoc : k * 2 ^ s + 2 ^ (s - 1) + (((2 ^ (b + 1) - 1) * 2 + 1) * (1 + h) + h) = + k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ (b + 1) - 1) * 2 + 1) * (1 + h) + h := by omega + rw [hassoc] + unfold zDc + have hr : (o1 ^ (3 + b * 2) : zF) +> z +> (o1 ^ 1) +> + (if false then z +> d +> default else (default : zB)) = + (o1 ^ (3 + b * 2)) +> z +> [1] +> default := rfl + rw [hr] + exact z35 l q h k b ldh hqh (by omega) hk +theorem z4V (l q h b : Nat) (hqh : q + h = 1) (hL : 16 <= l * 2 + q) (hb : 1 <= b) : + zDr false (l * 2 + q) 1 (4 + b * 2) ((l + q) * 3 - 1) [(0,b - 1),Queue.danger] h := by + let s := l * 3 + 2 + q * 2 + (b + 1) + refine z4N false (l * 2 + q) 1 (4 + b * 2) ((l + q) * 3 - 1) + [(0,b - 1),Queue.danger] h s ((2 ^ (b + 1) + 2) * (1 + h) + h) ?_ ?_ ?_ + · simp [zPw,Queue.danger,Queue.mass,Queue.weight,s]; omega + · simp only [zPv,Queue.danger,zRv,Queue.mass,Queue.weight] + have hexp1 : (0 + (b - 1) + 1 + (0 + 1 + 1 + 0)) + h + ((l + q) * 3 - 1) = s - 1 := by + dsimp [s]; omega + have hexp2 : (0 + 1 + 1 + 0) + h + (b - 1) = b + 1 + h := by omega + rw [hexp1,hexp2] + rcases h with _ | _ | h + · simp; omega + · rw [Nat.pow_succ]; simp; omega + · omega + · intro k hk + have hassoc : k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ (b + 1) + 2) * (1 + h) + h) = + k * 2 ^ s + 2 ^ (s - 1) + (2 ^ (b + 1) + 2) * (1 + h) + h := by omega + rw [hassoc] + unfold zDc + have hr : (o1 ^ (4 + b * 2) : zF) +> z +> (o1 ^ 1) +> + (if false then z +> d +> default else (default : zB)) = + (o1 ^ (4 + b * 2)) +> z +> [1] +> default := rfl + rw [hr] + exact z3j l q h k b ldh hqh (by omega) hk +theorem z4W (extra : Bool) (L k t u s v h t' u' s' v' : Nat) + (ht : t = t') (hu : u = u') (hs : s = s') (hv : v = v') + (hrun : (zDc extra L k t' u') [z00]⊢* + (z18 (LC (L + s') 0 ldh) (RC (k * 2 ^ s' + 2 ^ (s' - 1) + v' * (1 + h) + h)))) : + (zDc extra L k t u) [z00]⊢* + (z18 (LC (L + s) 0 ldh) (RC (k * 2 ^ s + 2 ^ (s - 1) + v * (1 + h) + h))) := by + subst ht; subst hu; subst hs; subst hv; exact hrun +theorem z4X (l q h k a b p e : Nat) + (hqh : q + h = 1) (hL : 0 < l * 2 + q) (hk : k < 2 ^ (l * 2 + q)) + (hp : p <= 1) (he : e <= 1) (ha : 1 <= a) (hb : 1 <= b) + (hex : a = 1 -> e = 1 -> p = 0 -> 2 <= b) : + let s := l * 3 + 2 + q * 2 + (a + b + 1) + (zDc false (l * 2 + q) k (a * 2 + e) (b * 2 + 2 - p)) [z00]⊢* + (z18 (LC (l * 2 + q + s) 0 ldh) + (RC (k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ b - 1) * 2 ^ (a + 1) + (2 ^ (1 - p + e) - 1)) * (1 + h) + h))) := by + intro s + rcases p with _ | _ | p <;> rcases e with _ | _ | e <;> try omega + · rcases a with _ | a; · omega + rcases b with _ | b; · omega + rcases a with _ | a + · refine z4W false (l * 2 + q) k _ _ s _ h + 2 (4 + b * 2) (l * 3 + 2 + q * 2 + (b + 0 + 3)) ((2 ^ (b + 1) - 1) * 4 + 1) + (by omega) (by omega) (by dsimp [s]; omega) rfl ?_ + unfold zDc + have hr : (o1 ^ (4 + b * 2) : zF) +> z +> (o1 ^ 2) +> + (if false then z +> d +> default else (default : zB)) = + (o1 ^ (4 + b * 2)) +> z +> [1,1] +> default := rfl + rw [hr] + exact z3w l q h k b ldh hqh hL hk + · refine z4W false (l * 2 + q) k _ _ s _ h + (4 + a * 2) (4 + b * 2) (l * 3 + 2 + q * 2 + (b + (1 + a) + 3)) + ((2 ^ (b + 1) - 1) * 2 ^ (1 + a + 2) + 1) + (by omega) (by omega) (by dsimp [s]; omega) ?_ ?_ + · rw [show 1 + a + 2 = a + 1 + 1 + 1 by omega]; rfl + · unfold zDc + exact z3s l q h k b a ldh hqh hL hk + · rcases a with _ | a; · omega + rcases b with _ | b; · omega + rcases a with _ | a + · have hb1 : 1 <= b := by have := hex rfl rfl rfl; omega + refine z4W false (l * 2 + q) k _ _ s _ h + 3 (4 + b * 2) (l * 3 + 2 + q * 2 + (b + 0 + 3)) ((2 ^ (b + 1) - 1) * 4 + 3) + (by omega) (by omega) (by dsimp [s]; omega) rfl ?_ + unfold zDc + have hr : (o1 ^ (4 + b * 2) : zF) +> z +> (o1 ^ 3) +> + (if false then z +> d +> default else (default : zB)) = + (o1 ^ (4 + b * 2)) +> z +> [1,1,1] +> default := rfl + rw [hr] + exact z3y l q h k b ldh hqh hL hk hb1 + · refine z4W false (l * 2 + q) k _ _ s _ h + (5 + a * 2) (4 + b * 2) (l * 3 + 2 + q * 2 + (b + (1 + a) + 3)) + ((2 ^ (b + 1) - 1) * 2 ^ (1 + a + 2) + 3) + (by omega) (by omega) (by dsimp [s]; omega) ?_ ?_ + · rw [show 1 + a + 2 = a + 1 + 1 + 1 by omega]; rfl + · unfold zDc + exact z3t l q h k b a ldh hqh hL hk + · rcases a with _ | a; · omega + rcases b with _ | b; · omega + rcases a with _ | _ | a + · refine z4W false (l * 2 + q) k _ _ s _ h + 2 (1 + (b + 1) * 2) (l * 3 + 2 + q * 2 + ((b + 1) + 2)) ((2 ^ (b + 1) - 1) * 4) + (by omega) (by omega) (by dsimp [s]; omega) (by simp) ?_ + unfold zDc + have hr : (o1 ^ (1 + (b + 1) * 2) : zF) +> z +> (o1 ^ 2) +> + (if false then z +> d +> default else (default : zB)) = + (o1 ^ (1 + (b + 1) * 2)) +> z +> [1,1] +> default := rfl + rw [hr] + exact z3a l q h k (b + 1) ldh hqh hL hk + · refine z4W false (l * 2 + q) k _ _ s _ h + 4 (1 + (b + 1) * 2) (l * 3 + 2 + q * 2 + ((b + 1) + 3)) ((2 ^ (b + 1) - 1) * 8) + (by omega) (by omega) (by dsimp [s]; omega) (by simp) ?_ + unfold zDc + exact z3b l q h k (b + 1) ldh hqh hL hk + · refine z4W false (l * 2 + q) k _ _ s _ h + (6 + a * 2) (3 + b * 2) (l * 3 + 2 + q * 2 + (b + 1 + (4 + a))) + ((2 ^ (b + 1) - 1) * 2 ^ (4 + a)) + (by omega) (by omega) (by dsimp [s]; omega) ?_ ?_ + · rw [show 4 + a = a + 1 + 1 + 1 + 1 by omega]; simp + · unfold zDc + exact z34 l q h k b a ldh hqh hL hk + · rcases a with _ | a; · omega + rcases b with _ | b; · omega + refine z4W false (l * 2 + q) k _ _ s _ h + (3 + a * 2) (3 + b * 2) (l * 3 + 2 + q * 2 + (b + 1 + (2 + a))) + ((2 ^ (b + 1) - 1) * 2 ^ (2 + a) + 1) + (by omega) (by omega) (by dsimp [s]; omega) ?_ ?_ + · rw [show 2 + a = a + 1 + 1 by omega]; rfl + · unfold zDc + exact z32 l q h k b a ldh hqh hL hk +theorem z4Y (b x f h : Nat) (hh : h <= 1) : + 2 ^ (f + h) - 1 + 2 ^ (x + h) * (2 ^ b - 1) = + ((2 ^ b - 1) * 2 ^ x + (2 ^ f - 1)) * (1 + h) + h := by + have hpf := z0h f + have hpb := z0h b + rcases h with _ | _ | h + · simp [Nat.mul_comm]; omega + · rw [Nat.pow_succ,Nat.pow_succ] + have h1 : 2 ^ f * 2 - 1 = (2 ^ f - 1) * 2 + 1 := by omega + rw [h1] + ring + · omega +theorem z4Z (l q h a b p e : Nat) + (hqh : q + h = 1) (hL : 16 <= l * 2 + q) + (hp : p <= 1) (he : e <= 1) (ha : 1 <= a) (hb : 1 <= b) (hfull : a + p = e) + (hsafe : a = 1 -> e = 1 -> p = 0 -> 2 <= b) : + zDr false (l * 2 + q) (a * 2 + e) (b * 2 + 2 - p) ((l + q) * 3) [] (b + a + 1 + h) := by + have ha1 : a = 1 := by omega + have hp0 : p = 0 := by omega + have he1 : e = 1 := by omega + subst ha1; subst hp0; subst he1 + let s := l * 3 + 2 + q * 2 + (1 + b + 1) + refine z4N false (l * 2 + q) (1 * 2 + 1) (b * 2 + 2 - 0) ((l + q) * 3) [] + (b + 1 + 1 + h) s (((2 ^ b - 1) * 2 ^ (1 + 1) + (2 ^ (1 - 0 + 1) - 1)) * (1 + h) + h) ?_ ?_ ?_ + · simp [zPw,Queue.mass,s]; omega + · simp only [zPv,zRv,Queue.mass] + have hexp : 0 + (b + 1 + 1 + h) + (l + q) * 3 = s - 1 := by dsimp [s]; omega + rw [hexp] + have hpb := z0h b + rcases h with _ | _ | h + · have : b + 1 + 1 + 0 = b + 2 := by omega + rw [this,Nat.pow_add]; omega + · have : b + 1 + 1 + 1 = b + 3 := by omega + rw [this,Nat.pow_add]; omega + · omega + · intro k hk + have hassoc : k * 2 ^ s + 2 ^ (s - 1) + (((2 ^ b - 1) * 2 ^ (1 + 1) + (2 ^ (1 - 0 + 1) - 1)) * (1 + h) + h) = + k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ b - 1) * 2 ^ (1 + 1) + (2 ^ (1 - 0 + 1) - 1)) * (1 + h) + h := by omega + rw [hassoc] + exact z4X l q h k 1 b 0 1 hqh (by omega) hk (by omega) (by omega) (by omega) hb hsafe +theorem z50 (l q h a b p e : Nat) + (hqh : q + h = 1) (hL : 16 <= l * 2 + q) + (hp : p <= 1) (he : e <= 1) (ha : 1 <= a) (hb : 1 <= b) (hsplit : e < a + p) + (hsafe : a = 1 -> e = 1 -> p = 0 -> 2 <= b) : + zDr false (l * 2 + q) (a * 2 + e) (b * 2 + 2 - p) ((l + q) * 3) + [(b - 1,a + p - e)] (1 - p + e + h) := by + let s := l * 3 + 2 + q * 2 + (a + b + 1) + refine z4N false (l * 2 + q) (a * 2 + e) (b * 2 + 2 - p) ((l + q) * 3) + [(b - 1,a + p - e)] (1 - p + e + h) s + (((2 ^ b - 1) * 2 ^ (a + 1) + (2 ^ (1 - p + e) - 1)) * (1 + h) + h) ?_ ?_ ?_ + · simp [zPw,Queue.mass,Queue.weight,s]; omega + · simp only [zPv,zRv,Queue.mass,Queue.weight] + have hb1 : b - 1 + 1 = b := by omega + have hexp1 : (b - 1 + (a + p - e) + 1 + 0) + (1 - p + e + h) + (l + q) * 3 = s - 1 := by + dsimp [s]; omega + have hexp2 : 0 + (1 - p + e + h) + (a + p - e) = a + 1 + h := by omega + have hexp3 : 1 - p + e + h = (1 - p + e) + h := by omega + rw [hb1,hexp1,hexp2,hexp3,z4Y b (a + 1) (1 - p + e) h (by omega)] + omega + · intro k hk + have hassoc : k * 2 ^ s + 2 ^ (s - 1) + (((2 ^ b - 1) * 2 ^ (a + 1) + (2 ^ (1 - p + e) - 1)) * (1 + h) + h) = + k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ b - 1) * 2 ^ (a + 1) + (2 ^ (1 - p + e) - 1)) * (1 + h) + h := by omega + rw [hassoc] + exact z4X l q h k a b p e hqh (by omega) hk hp he ha hb hsafe +theorem z51 (l q h k a b p : Nat) + (hqh : q + h = 1) (hL : 0 < l * 2 + q) (hk : k < 2 ^ (l * 2 + q)) + (ha : 1 <= a) (hb : 1 <= b) (hp : p <= 1) : + let s := l * 3 + 2 + q * 2 + (a + b + 3) + (zDc true (l * 2 + q) k (a * 2 + 1) (b * 2 + 2 - p)) [z00]⊢* + (z18 (LC (l * 2 + q + s) 0 ldh) + (RC (k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ b - 1) * 2 ^ (a + 3) - 1) * (1 + h) + h))) := by + intro s + rcases a with _ | a; · omega + rcases b with _ | b; · omega + rcases p with _ | _ | p <;> try omega + · refine z4W true (l * 2 + q) k _ _ s _ h + (3 + a * 2) (4 + b * 2) (l * 3 + 2 + q * 2 + (b + a + 5)) + ((2 ^ (b + 1) - 1) * 2 ^ (a + 4) - 1) + (by omega) (by omega) (by dsimp [s]; omega) ?_ ?_ + · rw [show a + 1 + 3 = a + 4 by omega] + · unfold zDc + exact z3H l q h k b a ldh hqh hL hk + · refine z4W true (l * 2 + q) k _ _ s _ h + (1 + (a + 1) * 2) (3 + b * 2) (l * 3 + 2 + q * 2 + (b + 1 + (1 + (a + 1)) + 1 + 1)) + ((2 ^ (b + 1) - 1) * 2 ^ (1 + (a + 1) + 2) - 1) + (by omega) (by omega) (by dsimp [s]; omega) ?_ ?_ + · rw [show 1 + (a + 1) + 2 = a + 1 + 3 by omega] + · unfold zDc + exact z3B l q h k b (a + 1) ldh hqh hL hk +theorem z52 (l q h a b p : Nat) + (hqh : q + h = 1) (hL : 16 <= l * 2 + q) (ha : 1 <= a) (hb : 2 <= b) (hp : p <= 1) : + zDr true (l * 2 + q) (a * 2 + 1) (b * 2 + 2 - p) ((l + q) * 3) [(b - 2,1)] (a + 3 + h) := by + let s := l * 3 + 2 + q * 2 + (a + b + 3) + refine z4N true (l * 2 + q) (a * 2 + 1) (b * 2 + 2 - p) ((l + q) * 3) + [(b - 2,1)] (a + 3 + h) s (((2 ^ b - 1) * 2 ^ (a + 3) - 1) * (1 + h) + h) ?_ ?_ ?_ + · simp [zPw,Queue.mass,Queue.weight,s]; omega + · simp only [zPv,zRv,Queue.mass,Queue.weight] + have hb2 : b - 2 + 1 = b - 1 := by omega + have hexp1 : (b - 2 + 1 + 1 + 0) + (a + 3 + h) + (l + q) * 3 = s - 1 := by + dsimp [s]; omega + have hexp2 : 0 + (a + 3 + h) + 1 = (a + 3 + 1) + h := by omega + have hpa := z0h (a + 3) + have hpb1 := z0h (b - 1) + have hb_pow : 2 ^ b = 2 ^ (b - 1) * 2 := by + calc 2 ^ b = 2 ^ ((b - 1) + 1) := by congr 1; omega + _ = 2 ^ (b - 1) * 2 := Nat.pow_succ 2 (b - 1) + have hsub : 2 ^ b - 1 = (2 ^ (b - 1) - 1) * 2 + 1 := by omega + have hp1 : 2 ^ (a + 3 + 1) = 2 ^ (a + 3) * 2 := Nat.pow_succ 2 (a + 3) + have hring : (2 ^ (b - 1) - 1) * (2 ^ (a + 3) * 2) + 2 ^ (a + 3) = + (2 ^ b - 1) * 2 ^ (a + 3) := by + rw [hsub]; ring + have hbase : (2 ^ (b - 1) - 1) * 2 ^ (a + 3 + 1) + (2 ^ (a + 3) - 1) = + (2 ^ b - 1) * 2 ^ (a + 3) - 1 := by + rw [hp1]; omega + rw [hexp1,hb2,hexp2,z4Y (b - 1) (a + 3 + 1) (a + 3) h (by omega),hbase] + omega + · intro k hk + have hassoc : k * 2 ^ s + 2 ^ (s - 1) + ((((2 ^ b - 1) * 2 ^ (a + 3) - 1) * (1 + h) + h)) = + k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ b - 1) * 2 ^ (a + 3) - 1) * (1 + h) + h := by omega + rw [hassoc] + exact z51 l q h k a b p hqh (by omega) hk ha (by omega) hp +theorem z53 (l q h a b : Nat) + (hqh : q + h = 1) (hL : 16 <= l * 2 + q) (ha : 1 <= a) (hb : 1 <= b) : + zDr true (l * 2 + q) (a * 2) (b * 2 + 1) ((l + q) * 3) [(b - 1,a - 1),Queue.danger] h := by + let s := l * 3 + 2 + q * 2 + (a + b + 1) + refine z4N true (l * 2 + q) (a * 2) (b * 2 + 1) ((l + q) * 3) + [(b - 1,a - 1),Queue.danger] h s (((2 ^ b - 1) * 2 ^ (a + 1) + 2) * (1 + h) + h) ?_ ?_ ?_ + · simp [zPw,Queue.danger,Queue.mass,Queue.weight,s]; omega + · simp only [zPv,Queue.danger,zRv,Queue.mass,Queue.weight] + have hb1 : b - 1 + 1 = b := by omega + have hexp1 : (b - 1 + (a - 1) + 1 + (0 + 1 + 1 + 0)) + h + (l + q) * 3 = s - 1 := by + dsimp [s]; omega + have hexp2 : (0 + 1 + 1 + 0) + h + (a - 1) = a + 1 + h := by omega + rw [hb1,hexp1,hexp2] + rcases h with _ | _ | h + · simp; ring + · rw [show a + 1 + 1 = (a + 1) + 1 by omega,Nat.pow_succ] + simp; ring + · omega + · intro k hk + have hassoc : k * 2 ^ s + 2 ^ (s - 1) + ((((2 ^ b - 1) * 2 ^ (a + 1) + 2) * (1 + h) + h)) = + k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ b - 1) * 2 ^ (a + 1) + 2) * (1 + h) + h := by omega + rw [hassoc] + refine z4W true (l * 2 + q) k _ _ s _ h + (2 + (a - 1) * 2) (3 + (b - 1) * 2) (l * 3 + 2 + q * 2 + ((b - 1) + 1 + (1 + (a - 1)) + 1)) + ((2 ^ ((b - 1) + 1) - 1) * 2 ^ (1 + (a - 1) + 1) + 2) + (by omega) (by omega) (by dsimp [s]; omega) ?_ ?_ + · rw [show (b - 1) + 1 = b by omega,show 1 + (a - 1) + 1 = a + 1 by omega] + · unfold zDc + exact z3C l q h k (b - 1) (a - 1) ldh hqh (by omega) hk +theorem z54 (l q h b : Nat) + (hqh : q + h = 1) (hL : 16 <= l * 2 + q) (hb : 2 <= b) : + zDr true (l * 2 + q) 4 (b * 2 + 2) ((l + q) * 3) [(b,1)] (1 + h) := by + let s := l * 3 + 2 + q * 2 + (b + 3) + refine z4N true (l * 2 + q) 4 (b * 2 + 2) ((l + q) * 3) + [(b,1)] (1 + h) s (((2 ^ b - 1) * 8 + 5) * (1 + h) + h) ?_ ?_ ?_ + · simp [zPw,Queue.mass,Queue.weight,s]; omega + · simp only [zPv,zRv,Queue.mass,Queue.weight] + have hexp1 : (b + 1 + 1 + 0) + (1 + h) + (l + q) * 3 = s - 1 := by + dsimp [s]; omega + rw [hexp1,Nat.pow_succ 2 b] + have hpb := z0h b + rcases h with _ | _ | h + · simp; omega + · simp; omega + · omega + · intro k hk + have hassoc : k * 2 ^ s + 2 ^ (s - 1) + ((((2 ^ b - 1) * 8 + 5) * (1 + h) + h)) = + k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ b - 1) * 8 + 5) * (1 + h) + h := by omega + rw [hassoc] + refine z4W true (l * 2 + q) k _ _ s _ h + (4 + 0 * 2) (4 + (b - 1) * 2) (l * 3 + 2 + q * 2 + ((b - 1) + 0 + 4)) + ((2 ^ ((b - 1) + 1) - 1) * 2 ^ (0 + 3) + 5) + (by omega) (by omega) (by dsimp [s]; omega) ?_ ?_ + · rw [show (b - 1) + 1 = b by omega]; rfl + · unfold zDc + exact z3I l q h k (b - 1) 0 ldh hqh (by omega) hk (by omega) +theorem z55 (l q h a b : Nat) + (hqh : q + h = 1) (hL : 16 <= l * 2 + q) (ha : 3 <= a) (hb : 2 <= b) : + zDr true (l * 2 + q) (a * 2) (b * 2 + 2) ((l + q) * 3) [(b - 1,a - 2),Queue.danger] (1 + h) := by + let s := l * 3 + 2 + q * 2 + (a + b + 1) + refine z4N true (l * 2 + q) (a * 2) (b * 2 + 2) ((l + q) * 3) + [(b - 1,a - 2),Queue.danger] (1 + h) s (((2 ^ b - 1) * 2 ^ (a + 1) + 5) * (1 + h) + h) ?_ ?_ ?_ + · simp [zPw,Queue.danger,Queue.mass,Queue.weight,s]; omega + · simp only [zPv,Queue.danger,zRv,Queue.mass,Queue.weight] + have hb1 : b - 1 + 1 = b := by omega + have hexp1 : (b - 1 + (a - 2) + 1 + (0 + 1 + 1 + 0)) + (1 + h) + (l + q) * 3 = s - 1 := by + dsimp [s]; omega + have hexp2 : (0 + 1 + 1 + 0) + (1 + h) + (a - 2) = a + 1 + h := by omega + rw [hb1,hexp1,hexp2] + rcases h with _ | _ | h + · simp; ring + · rw [show a + 1 + 1 = (a + 1) + 1 by omega,Nat.pow_succ] + simp; ring + · omega + · intro k hk + have hassoc : k * 2 ^ s + 2 ^ (s - 1) + ((((2 ^ b - 1) * 2 ^ (a + 1) + 5) * (1 + h) + h)) = + k * 2 ^ s + 2 ^ (s - 1) + ((2 ^ b - 1) * 2 ^ (a + 1) + 5) * (1 + h) + h := by omega + rw [hassoc] + refine z4W true (l * 2 + q) k _ _ s _ h + (4 + (a - 2) * 2) (4 + (b - 1) * 2) (l * 3 + 2 + q * 2 + ((b - 1) + (a - 2) + 4)) + ((2 ^ ((b - 1) + 1) - 1) * 2 ^ ((a - 2) + 3) + 5) + (by omega) (by omega) (by dsimp [s]; omega) ?_ ?_ + · rw [show (b - 1) + 1 = b by omega,show (a - 2) + 3 = a + 1 by omega] + · unfold zDc + exact z3I l q h k (b - 1) (a - 2) ldh hqh (by omega) hk (by omega) +def zLi (extra : Bool) (t u : Nat) : Prop := + if extra then 3 <= t /\ 6 <= u else + 0 < u /\ (u = 1 -> 0 < t) /\ (u = 2 -> t = 0 \/ 4 <= t) /\ + (t = 1 -> 3 <= u /\ u ≠ 4) /\ (t = 3 -> u ≠ 4) +theorem z56 (extra : Bool) (t u : Nat) (h : Queue.zSi extra t u) : + zLi extra t u := by + cases extra with + | true => + simp only [Queue.zSi,Queue.main,zLi,↓reduceIte] at h ⊢ + omega + | false => + simp only [Queue.zSi,Queue.allowed,z1P,Queue.danger,zLi,Bool.false_eq_true,↓reduceIte] at h ⊢ + rcases h with ⟨⟨hu,ht0 | hsep⟩,hne⟩ + · subst ht0 + have hu2 : 2 <= u := by + rcases u with _ | _ | u + · omega + · exfalso; exact hne rfl + · omega + omega + · omega +theorem block_returns_local {extra : Bool} {L t u gap : Nat} {a : List Queue.cell} {E : Nat} + (hblock : Queue.block extra L t u gap a E) (hL : 16 <= L) (hsafe : zLi extra t u) : + zDr extra L t u gap a E := by + revert hL hsafe + induction hblock with + | zero2 l q h hqh => + intro hL _ + exact z4P l q h hqh hL + | zero3 l q h hqh => + intro hL _ + exact z4Q l q h hqh hL + | zero5 l q h hqh => + intro hL _ + exact z4R l q h hqh hL + | zero l q h j p hqh hp hj => + intro hL _ + exact z4S l q h j p hqh hL hp hj + | short L t u s e ht hu he hs => + intro hL hsafe + simp [zLi] at hsafe + exact z4T L t u s e (by omega) (by omega) ht hu he hs + | one_odd l q h b hqh => + intro hL hsafe + simp [zLi] at hsafe + have hb : 1 <= b := by omega + have h1 : b * 2 + 1 = 3 + (b - 1) * 2 := by omega + have h2 : b + 1 + h = (b - 1) + 2 + h := by omega + rw [h1,h2] + exact z4U l q h (b - 1) hqh hL + | one_even l q h j hqh => + intro hL hsafe + simp [zLi] at hsafe + have hj : 2 <= j := by omega + have h1 : j * 2 + 2 = 4 + (j - 1) * 2 := by omega + have h2 : j - 2 = (j - 1) - 1 := by omega + rw [h1,h2] + exact z4V l q h (j - 1) hqh hL (by omega) + | full l q h a b p e hqh hp he ha hb hfull => + intro hL hsafe + simp [zLi] at hsafe + exact z4Z l q h a b p e hqh hL hp he ha hb hfull (by omega) + | split l q h a b p e hqh hp he ha hb hsplit => + intro hL hsafe + simp [zLi] at hsafe + exact z50 l q h a b p e hqh hL hp he ha hb hsplit (by omega) + | extra_odd l q h a b p hqh hp => + intro hL hsafe + simp [zLi] at hsafe + exact z52 l q h a b p hqh hL (by omega) (by omega) hp + | extra_even_odd l q h a b hqh => + intro hL hsafe + simp [zLi] at hsafe + exact z53 l q h a b hqh hL (by omega) (by omega) + | extra_four l q h b hqh => + intro hL hsafe + simp [zLi] at hsafe + exact z54 l q h b hqh hL (by omega) + | extra_even_even l q h a b hqh ha => + intro hL hsafe + simp [zLi] at hsafe + exact z55 l q h a b hqh hL ha (by omega) +theorem block_returns {extra : Bool} {L t u gap : Nat} {a : List Queue.cell} {E : Nat} + (hblock : Queue.block extra L t u gap a E) (hL : 16 <= L) (hsafe : Queue.zSi extra t u) : + zDr extra L t u gap a E := + block_returns_local hblock hL (z56 extra t u hsafe) +theorem block_step_spec {f g : Queue.frame} + (hbs : Queue.block_step f g) (hL : 16 <= Queue.width f) (hlen : 3 <= f.cells.length) : + (config f) [z00]⊢⁺ (config g) := by + rcases f with ⟨l,E⟩ + rcases hbs with ⟨extra,t,u,r,gap,a,E',hc,hsafe,hblock,rfl⟩ + have hr : r ≠ [] := by + intro hr0 + subst hr0 + cases hc <;> simp at hlen + exact z4M E gap a E' hc hr (block_returns hblock hL hsafe) +def z57 (M : Machine zG_ zL_) (c : Cfg zG_ zL_) : Prop := + ∀ k,∃ c',multiStep M c k = some c' +theorem z58 {M : Machine zG_ zL_} {c_1 c_3 : Cfg zG_ zL_} (k m : Nat) + (h : multiStep M c_1 (k + m) = some c_3) : + ∃ c_2,multiStep M c_1 k = some c_2 := by + rw [zMa] at h + cases h1 : multiStep M c_1 k with + | none => rw [h1] at h; simp at h + | some c_2 => exact ⟨c_2,rfl⟩ +theorem z59 {M : Machine zG_ zL_} {c_1 c_2 : Cfg zG_ zL_} + (h12 : c_1 [M]⊢* c_2) (h2 : z57 M c_2) : z57 M c_1 := by + rcases h12 with ⟨m,hm⟩ + intro k + rcases h2 k with ⟨c_3,hc₃⟩ + have hmk : multiStep M c_1 (k + m) = some c_3 := by + rw [Nat.add_comm,zMa,hm] + exact hc₃ + exact z58 k m hmk +theorem z5a {α : Type*} {M : Machine zG_ zL_} (P : α -> Prop) (cfg_of : α -> Cfg zG_ zL_) + (hstep : ∀ x,P x -> ∃ y,P y /\ ((cfg_of x) [M]⊢⁺ (cfg_of y))) : + ∀ (k : Nat) (x : α),P x -> ∃ y m,k <= m /\ P y /\ multiStep M (cfg_of x) m = some (cfg_of y) + | 0,x,hx => ⟨x,0,Nat.le_refl 0,hx,rfl⟩ + | k + 1,x,hx => by + rcases z5a P cfg_of hstep k x hx with ⟨y₁,m₁,hm₁,hy₁,hrun₁⟩ + rcases hstep y₁ hy₁ with ⟨y₂,hy₂,d,hd_pos,hrun₂⟩ + refine ⟨y₂,m₁ + d,by omega,hy₂,?_⟩ + exact zMt M (cfg_of x) (cfg_of y₁) (cfg_of y₂) m₁ d hrun₁ hrun₂ +theorem z5b {α : Type*} {M : Machine zG_ zL_} (P : α -> Prop) (cfg_of : α -> Cfg zG_ zL_) + (hstep : ∀ x,P x -> ∃ y,P y /\ ((cfg_of x) [M]⊢⁺ (cfg_of y))) + (x : α) (hx : P x) : z57 M (cfg_of x) := by + intro k + rcases z5a P cfg_of hstep k x hx with ⟨y,m,hm,_,hrun⟩ + have hkm : m = k + (m - k) := by omega + rw [hkm] at hrun + exact z58 k (m - k) hrun +theorem history_nonhalt {f0 f1 f2 f3 : Queue.frame} (h : Queue.history f0 f1 f2 f3) : + z57 z00 (config f3) := by + refine z5b (fun f => ∃ a b c,Queue.history a b c f) config ?_ f3 ⟨f0,f1,f2,h⟩ + intro f ⟨a,b,c,hhist⟩ + rcases Queue.history_progress hhist with ⟨g,hstep,hnext⟩ + refine ⟨g,⟨b,c,f,hnext⟩,?_⟩ + rcases Queue.history_ready hhist with ⟨_,hlen⟩ + exact block_step_spec hstep (Queue.history_width hhist) (by omega) +def z5c : Queue.frame := ⟨[(3,1),Queue.danger],1⟩ +def z5d : Queue.frame := ⟨[Queue.danger,(6,13)],1⟩ +def z5e : Queue.frame := ⟨[(23,33),(5,2),Queue.danger],1⟩ +theorem z5f : (init []) [z00]⊢* (config z5c) := z2l +theorem z5g : (config z5c) [z00]⊢⁺ (config z5d) := by + refine z4M 1 13 [] 1 (Queue.consume.one 3 1 [Queue.danger]) (by simp) ?_ + exact z4T 7 3 1 15 1 (by omega) (by omega) (by omega) (Or.inl rfl) (by omega) (by omega) +theorem z5h : (config z5d) [z00]⊢⁺ (config z5e) := by + have hfirst := z4t 6 13 0 0 [] .nil + dsimp only at hfirst + have h_init1 : config z5d = + z18 (LC (0 + 3 + 13 + 6) 0 ldh) ([] +> d +> (z ^ 13) +> (d ^ 6) +> d +> z +> default) := by + simp only [<- append_assoc] + rfl + rw [<- h_init1] at hfirst + have hlen : 0 + 3 + 13 + 6 = 22 := rfl + have hval : (0 + 1) * 2 ^ (3 + 13 + 6) - 1 = 2 ^ 22 - 1 := rfl + rw [hlen,hval] at hfirst + have hr : zDr true 22 6 13 33 [(5,2),Queue.danger] 1 := + z53 11 0 1 3 6 (by omega) (by omega) (by omega) (by omega) + have h2 := hr (2 ^ 22 - 1) (z1W (z1Y 22)) + have hw := z2m (z1Y 22) 0 + simp only [Nat.mul_zero,Nat.add_zero] at hw + rw [<- z2K] at hw + rw [<- hw] at h2 + have h_init2 : z18 (LC (22 + zPw 33 [(5,2),Queue.danger] 1) 0 ldh) + (z4F 33 [(5,2),Queue.danger] 1 +> (d ^ 22) +> default) = config z5e := by + unfold config z5e + simp only [<- append_assoc] + rfl + rw [h_init2] at h2 + exact z05 hfirst h2 +theorem init_two_frames : (init []) [z00]⊢* (config z5e) := + zSt z5f + (zSt (zPs z5g) (zPs z5h)) +namespace Check +inductive certificate where + | Zero2 (l q h : Nat) + | Zero3 (l q h : Nat) + | Zero5 (l q h : Nat) + | Zero (l q h j p : Nat) + | Short (L t u s e : Nat) + | OneOdd (l q h b : Nat) + | OneEven (l q h j : Nat) + | Full (l q h a b p e : Nat) + | Split (l q h a b p e : Nat) + | ExtraOdd (l q h a b p : Nat) + | ExtraEvenOdd (l q h a b : Nat) + | ExtraFour (l q h b : Nat) + | ExtraEvenEven (l q h a b : Nat) +structure claim where + extra : Bool + old_width : Nat + ones : Nat + zeros : Nat + gap : Nat + residual : List Queue.cell + tail : Nat + guard : Bool +def z5i (c : certificate) : claim := + match c with + | .Zero2 l q h => ⟨false,l * 2 + q,0,2,(l + q) * 3 - 1,[],1 + h,decide (q + h = 1)⟩ + | .Zero3 l q h => ⟨false,l * 2 + q,0,3,(l + q) * 3 - 2,[(0,1)],h,decide (q + h = 1)⟩ + | .Zero5 l q h => ⟨false,l * 2 + q,0,5,(l + q) * 3 - 1,[],2 + h,decide (q + h = 1)⟩ + | .Zero l q h j p => ⟨false,l * 2 + q,0,j * 2 + 2 + p,(l + q) * 3 - 1,[(0,j - p)],p + h, + decide (q + h = 1) && decide (p <= 1) && decide (1 + p <= j)⟩ + | .Short w t u s e => ⟨false,w,t,u,s - 1 - (e + u - 1),[],e + u - 1, + decide (0 < t) && (decide (u = 1) || decide (u = 2)) && decide (e <= 1) && decide (w * 3 + t + 7 = s * 2 + e)⟩ + | .OneOdd l q h b => ⟨false,l * 2 + q,1,b * 2 + 1,(l + q) * 3,[],b + 1 + h,decide (q + h = 1)⟩ + | .OneEven l q h j => ⟨false,l * 2 + q,1,j * 2 + 2,(l + q) * 3 - 1,[(0,j - 2),(0,1)],h,decide (q + h = 1)⟩ + | .Full l q h a b p e => ⟨false,l * 2 + q,a * 2 + e,b * 2 + 2 - p,(l + q) * 3,[],b + a + 1 + h, + decide (q + h = 1) && decide (p <= 1) && decide (e <= 1) && decide (1 <= a) && decide (1 <= b) && decide (a + p = e)⟩ + | .Split l q h a b p e => ⟨false,l * 2 + q,a * 2 + e,b * 2 + 2 - p,(l + q) * 3,[(b - 1,a + p - e)],1 - p + e + h, + decide (q + h = 1) && decide (p <= 1) && decide (e <= 1) && decide (1 <= a) && decide (1 <= b) && decide (e < a + p)⟩ + | .ExtraOdd l q h a b p => ⟨true,l * 2 + q,a * 2 + 1,b * 2 + 2 - p,(l + q) * 3,[(b - 2,1)],a + 3 + h, + decide (q + h = 1) && decide (p <= 1)⟩ + | .ExtraEvenOdd l q h a b => ⟨true,l * 2 + q,a * 2,b * 2 + 1,(l + q) * 3,[(b - 1,a - 1),(0,1)],h,decide (q + h = 1)⟩ + | .ExtraFour l q h b => ⟨true,l * 2 + q,4,b * 2 + 2,(l + q) * 3,[(b,1)],1 + h,decide (q + h = 1)⟩ + | .ExtraEvenEven l q h a b => ⟨true,l * 2 + q,a * 2,b * 2 + 2,(l + q) * 3,[(b - 1,a - 2),(0,1)],1 + h, + decide (q + h = 1) && decide (3 <= a)⟩ +theorem z5j (c : certificate) (h : (z5i c).guard = true) : + Queue.block (z5i c).extra (z5i c).old_width (z5i c).ones (z5i c).zeros + (z5i c).gap (z5i c).residual (z5i c).tail := by + cases c <;> + simp only [z5i,Bool.and_eq_true,Bool.or_eq_true,decide_eq_true_eq] at h ⊢ + · exact Queue.block.zero2 _ _ _ h + · exact Queue.block.zero3 _ _ _ h + · exact Queue.block.zero5 _ _ _ h + · exact Queue.block.zero _ _ _ _ _ h.1.1 h.1.2 h.2 + · exact Queue.block.short _ _ _ _ _ h.1.1.1 h.1.1.2 h.1.2 h.2 + · exact Queue.block.one_odd _ _ _ _ h + · exact Queue.block.one_even _ _ _ _ h + · exact Queue.block.full _ _ _ _ _ _ _ h.1.1.1.1.1 h.1.1.1.1.2 h.1.1.1.2 h.1.1.2 h.1.2 h.2 + · exact Queue.block.split _ _ _ _ _ _ _ h.1.1.1.1.1 h.1.1.1.1.2 h.1.1.1.2 h.1.1.2 h.1.2 h.2 + · exact Queue.block.extra_odd _ _ _ _ _ _ h.1 h.2 + · exact Queue.block.extra_even_odd _ _ _ _ _ h + · exact Queue.block.extra_four _ _ _ _ h + · exact Queue.block.extra_even_even _ _ _ _ _ h.1 h.2 +def z5k (x : Bool) (L t u : Nat) : certificate := + let l := L / 2 + let q := L % 2 + let h := 1 - q + let a := t / 2 + let b := (u - 1) / 2 + let p := u % 2 + let e := t % 2 + if x then + if decide (e = 1) then .ExtraOdd l q h a b p else + if decide (p = 1) then .ExtraEvenOdd l q h a b else + if decide (a = 2) then .ExtraFour l q h b else .ExtraEvenEven l q h a b + else if decide (t = 0) then + if decide (u = 2) then .Zero2 l q h else + if decide (u = 3) then .Zero3 l q h else + if decide (u = 5) then .Zero5 l q h else .Zero l q h ((u - 2) / 2) p + else if decide (u <= 2) then .Short L t u ((L * 3 + t + 7) / 2) ((L * 3 + t + 7) % 2) + else if decide (t = 1) then + if decide (p = 1) then .OneOdd l q h b else .OneEven l q h ((u - 2) / 2) + else if decide (a + p = e) then .Full l q h a b p e else .Split l q h a b p e +def z5l (x : Bool) (t u : Nat) : Bool := + if x then decide (3 <= t) && decide (6 <= u) else + decide (0 < u) && (decide (u ≠ 1) || decide (0 < t)) && + (decide (u ≠ 2) || decide (t = 0) || decide (4 <= t)) && + (decide (t ≠ 1) || (decide (3 <= u) && decide (u ≠ 4))) && + (decide (t ≠ 3) || decide (u ≠ 4)) +theorem z5m (x : Bool) (t u : Nat) (h : z5l x t u = true) : + zLi x t u := by + cases x <;> + simp only [z5l,zLi,Bool.and_eq_true,Bool.or_eq_true,decide_eq_true_eq, + Bool.false_eq_true,↓reduceIte] at h ⊢ <;> + omega +def z5n (x : Bool) (t u : Nat) (r : List Queue.cell) (f : Queue.frame) (c : certificate) : + Option Queue.frame := + let v := z5i c + if v.guard && decide (x = v.extra) && decide (Queue.width f = v.old_width) && + decide (t = v.ones) && decide (u = v.zeros) && decide (16 <= Queue.width f) && z5l x t u then + some ⟨r ++ (t + u + (if x then 3 else 1) + f.trailing,v.gap) :: v.residual,v.tail⟩ + else none +theorem z5o (x : Bool) (t u : Nat) (r : List Queue.cell) (f : Queue.frame) + (c : certificate) (g : Queue.frame) + (hc : Queue.consume x t u f.cells r) (hr : r ≠ []) + (ha : z5n x t u r f c = some g) : + (config f) [z00]⊢⁺ (config g) := by + unfold z5n at ha + dsimp only at ha + split at ha + · next hcond => + injection ha with hg + subst hg + simp only [Bool.and_eq_true,decide_eq_true_eq] at hcond + rcases hcond with ⟨⟨⟨⟨⟨⟨hguard,hx⟩,hw⟩,ht⟩,hu⟩,h16⟩,hloc⟩ + subst hx + have hloc_in := z5m (z5i c).extra t u hloc + refine z4M f.trailing (z5i c).gap (z5i c).residual (z5i c).tail hc hr ?_ + rw [hw,ht,hu] + exact block_returns_local (z5j c hguard) (by omega) (by rw [<- ht,<- hu]; exact hloc_in) + · cases ha +def next (f : Queue.frame) : Option Queue.frame := + match f.cells with + | [] => none + | (t,u) :: r => + if decide (t = 0) && decide (u = 1) then + match r with + | (t',u') :: p :: r' => z5n true t' u' (p :: r') f (z5k true (Queue.width f) t' u') + | _ => none + else match r with + | [] => none + | _ :: _ => z5n false t u r f (z5k false (Queue.width f) t u) +theorem z5p (f g : Queue.frame) (h : next f = some g) : + (config f) [z00]⊢⁺ (config g) := by + unfold next at h + rcases hf : f.cells with _ | ⟨⟨t,u⟩,r⟩ + · rw [hf] at h; cases h + · rw [hf] at h + dsimp only at h + split at h + · next hdanger => + simp only [Bool.and_eq_true,decide_eq_true_eq] at hdanger + rcases hdanger with ⟨rfl,rfl⟩ + rcases r with _ | ⟨⟨t',u'⟩,_ | ⟨p,r'⟩⟩ + · cases h + · cases h + · refine z5o true t' u' (p :: r') f _ g ?_ (by simp) h + rw [hf] + exact Queue.consume.two t' u' (p :: r') + · rcases r with _ | ⟨p,r'⟩ + · cases h + · refine z5o false t u (p :: r') f _ g ?_ (by simp) h + rw [hf] + exact Queue.consume.one t u (p :: r') +def z5q (p : Queue.cell) : Bool := + decide (3 <= p.1) && decide (p.1 * 8 + 9 <= p.2) +def z5r (p : Queue.cell) : Bool := + decide (0 < p.2) && + (decide (p.1 = 0) || decide (p.1 * 8 + 9 <= p.2) || decide (p.2 * 8 <= p.1 + 5)) +def z5s (p : Queue.cell) (xs : List Queue.cell) : Bool := + if decide (p.1 = 0) && decide (p.2 = 1) then + match xs with | [] => true | q :: _ => z5q q + else true +def z5t : List Queue.cell -> Bool + | [] => true + | p :: r => z5r p && z5s p r && z5t r +theorem z5u (p : Queue.cell) (h : z5q p = true) : Queue.main p := by + simp only [z5q,Queue.main,Bool.and_eq_true,decide_eq_true_eq] at h ⊢ + exact h +theorem z5v (p : Queue.cell) (h : z5r p = true) : Queue.allowed p := by + simp only [z5r,Queue.allowed,z1P,Bool.and_eq_true,Bool.or_eq_true,decide_eq_true_eq] at h ⊢ + omega +theorem z5w (p : Queue.cell) (xs : List Queue.cell) (h : z5s p xs = true) : + Queue.link p xs := by + rcases p with ⟨t,u⟩ + unfold z5s at h + intro heq + injection heq with ht hu + subst ht; subst hu + simp only [decide_true,Bool.and_self,↓reduceIte] at h + cases xs with + | nil => trivial + | cons q xs => exact z5u q h +theorem z5x : ∀ (xs : List Queue.cell),z5t xs = true -> Queue.good xs + | [],_ => Queue.good.nil + | p :: xs,h => by + simp only [z5t,Bool.and_eq_true] at h + exact Queue.good.cons p xs (z5v p h.1.1) (z5w p xs h.1.2) (z5x xs h.2) +def z5y : List Queue.cell -> List Queue.cell -> Bool + | [],_ => true + | (t,u) :: xs,(a,b) :: ys => decide (t = a) && decide (u = b) && z5y xs ys + | _,_ => false +theorem z5z : ∀ (xs ys : List Queue.cell),z5y xs ys = true -> ∃ a,ys = xs ++ a + | [],ys,_ => ⟨ys,rfl⟩ + | (t,u) :: xs,[],h => by cases h + | (t,u) :: xs,(a,b) :: ys,h => by + simp only [z5y,Bool.and_eq_true,decide_eq_true_eq] at h + rcases h with ⟨⟨rfl,rfl⟩,hpref⟩ + rcases z5z xs ys hpref with ⟨r,rfl⟩ + exact ⟨r,rfl⟩ +def z5A (xs ys : List Queue.cell) : Bool := + z5y (xs.drop 1) ys || z5y (xs.drop 2) ys +theorem z5B (xs ys : List Queue.cell) (h : z5A xs ys = true) : + Queue.advance xs ys := by + simp only [z5A,Bool.or_eq_true] at h + rcases h with h1 | h2 + · rcases z5z (xs.drop 1) ys h1 with ⟨a,rfl⟩ + exact ⟨1,a,by omega,rfl⟩ + · rcases z5z (xs.drop 2) ys h2 with ⟨a,rfl⟩ + exact ⟨2,a,by omega,rfl⟩ +def z5C (f g : Queue.frame) : Bool := + z5A f.cells g.cells && decide (Queue.width f * 5 <= Queue.width g * 2) && + decide (f.cells.length <= g.cells.length) +theorem z5D (f g : Queue.frame) (h : z5C f g = true) : Queue.edge f g := by + simp only [z5C,Bool.and_eq_true,decide_eq_true_eq] at h + exact ⟨z5B f.cells g.cells h.1.1,h.1.2,h.2⟩ +def z5E (f0 f1 f2 f3 : Queue.frame) : Bool := + z5C f0 f1 && z5C f1 f2 && z5C f2 f3 && + decide (16 <= Queue.width f0) && decide (9 <= f0.cells.length) && + decide (f3.trailing <= Queue.width f0 + 8) && z5t f3.cells +theorem z5F (f0 f1 f2 f3 : Queue.frame) (h : z5E f0 f1 f2 f3 = true) : + Queue.history f0 f1 f2 f3 := by + simp only [z5E,Bool.and_eq_true,decide_eq_true_eq] at h + exact { + edge01 := z5D f0 f1 h.1.1.1.1.1.1 + edge12 := z5D f1 f2 h.1.1.1.1.1.2 + edge23 := z5D f2 f3 h.1.1.1.1.2 + old_width := h.1.1.1.2 + old_count := h.1.1.2 + tail_bound := h.1.2 + current_good := z5x f3.cells h.2 + } +def run : Nat -> Queue.frame -> Queue.frame -> Queue.frame -> Queue.frame -> Bool + | 0,f0,f1,f2,f3 => z5E f0 f1 f2 f3 + | fuel + 1,_f0,f1,f2,f3 => + match next f3 with + | some f4 => run fuel f1 f2 f3 f4 + | none => false +theorem run_spec : ∀ (fuel : Nat) (f0 f1 f2 f3 : Queue.frame), + run fuel f0 f1 f2 f3 = true -> z57 z00 (config f3) + | 0,f0,f1,f2,f3,h => history_nonhalt (z5F f0 f1 f2 f3 h) + | fuel + 1,_f0,f1,f2,f3,h => by + unfold run at h + cases hnext : next f3 with + | none => rw [hnext] at h; cases h + | some f4 => + rw [hnext] at h + exact z59 (zPs (z5p f3 f4 hnext)) + (run_spec fuel f1 f2 f3 f4 h) +def z5G : Queue.frame := z5e +set_option maxRecDepth 4000000 in +theorem seed_nonhalt : z57 z00 (config z5G) := + run_spec 216 z5G z5G z5G z5G (by decide +kernel) +end Check +theorem tm51_nonhalt : z57 z00 (init []) := + z59 init_two_frames Check.seed_nonhalt +def z5H : Dir -> Dir + | .left => .right + | .right => .left +def z5I (T : Tape (Fin 2)) : Tape (Fin 2) := + ⟨T.1,T.right,T.left⟩ +def z5J (c : Cfg (Fin 2) (Fin 6)) : Cfg (Fin 2) (Fin 6) := + ⟨c.q,z5I c.tape⟩ +theorem z5K (q : Fin 6) (s : Fin 2) : + target_tm q s = + (z00 q s).map (fun ⟨q',Stmt.write a d⟩ => ⟨q',Stmt.write a (z5H d)⟩) := by + match q, s with + | 0, 0 | 0, 1 | 1, 0 | 1, 1 | 2, 0 | 2, 1 | 3, 0 | 3, 1 | 4, 0 | 4, 1 | 5, 0 | 5, 1 => rfl +theorem z5L (T : Tape (Fin 2)) (a : Fin 2) : + (z5I T).write a = z5I (T.write a) := rfl +theorem z5M (T : Tape (Fin 2)) (d : Dir) : + (z5I T).move (z5H d) = z5I (T.move d) := by + cases d <;> rfl +theorem z5N (c : Cfg (Fin 2) (Fin 6)) : + step target_tm (z5J c) = (step z00 c).map z5J := by + rcases c with ⟨_ | q,T⟩ + · rfl + · dsimp [z5J,step] + have htm := z5K q T.1 + have hhead : (z5I T).1 = T.1 := rfl + rw [hhead,htm] + cases z00 q T.1 with + | none => rfl + | some val => + rcases val with ⟨q',⟨a,d⟩⟩ + dsimp [Option.map,z5J] + rw [z5L,z5M] +theorem z5O : ∀ (n : Nat) (c : Cfg (Fin 2) (Fin 6)), + multiStep target_tm (z5J c) n = (multiStep z00 c n).map z5J + | 0,c => rfl + | n + 1,c => by + rw [zMs,zMs,z5O n c] + cases multiStep z00 c n with + | none => rfl + | some c' => + dsimp [Option.map,Option.bind] + exact z5N c' + +end Solution + + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg ⟨n,hn⟩ + have hinit : (init [] : Cfg (Fin 2) (Fin 6)) = z5J (init []) := rfl + rcases tm51_nonhalt (n + 1) with ⟨c',hc'⟩ + have hstep : multiStep target_tm (init []) (n + 1) = some (z5J c') := by + rw [hinit,z5O (n + 1) (init []),hc'] + rfl + rw [zMs,hn] at hstep + dsimp [Option.bind] at hstep + rw [hstep] + rfl + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1LF_1LC1RB_1RE1LD_1LB0LC_1LA0RE_1LDHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LA_1LA0LE.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LA_1LA0LE.lean new file mode 100644 index 00000000..bd7eec38 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LA_1LA0LE.lean @@ -0,0 +1,443 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusH +public import BusyBeaver.Calculi.WordCalculusI + + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LA_1LA0LE + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LA_1LA0LE" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +open WordCalculus Word WordCanonBR WordCanonBR.BRIncs WordCanonBR.Choice +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +local notation "WordList" => List Word + +def z29_0813 : WordList := [V, V, V, V, V, V, V, K, V, V, Q, V, V, Q, K, V, V, V, K, V, Q, Q, + Q, V, K, Q, Q, K, Q, Q, K, K, K, K, K, K, Q] + +def z2a_0813 : List (List Choice) := [ + [CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CP0, CT, CT, (COC0 0), + (CSC0 0), CSP1, CP1, (COC1 0), CSP0, CS11, CP0, CS11, CP0, CS10, CS10, CS00, CS10, CS10, + CP0], + [CT, (COC1 0), CSP1, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, + CT, CT, (COC0 0), CSP0, CS10, CT, CT, (COC0 0), CSP1, (COC1 0), CSP1, (COC1 0), CSP1, + (COC1 0), CSP1, CP0, CP1, (COC0 0), CSP0, CS10, CS10, CP0, CP1, CP0, CS10, CP1, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, + (COC1 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, (COC0 0), (CSC0 0), + CSP1, (COC1 0), CSP1, (COC1 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CP1, CT, CT, (COC0 0), + CSP1, CT, CT, CT, CP0, CP1, CP0, CS10, CS11, CP0, CP0, CP0, CS01, CP1, CP0, CP0, CS01, + CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, + (COC0 0), CSP0, CS10, CT, (COC1 0), CSP1, (COC1 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CT, + CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CP1, CT, CT, (COC0 0), CSP0, CT, CT, + (COC0 0), CSP0, CT, CT, CP0, CP1, CP0, CS11, CP1, CP0, CP0, CP0, CP0, CP1, CP0, CP0, CP0, + CS01, CP1, CP0, CS10, CP0, CS01, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, CT, CT, + CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), + CSP1, CT, (COC0 0), (CSC0 0), CSP1, (COC1 0), CSP1, (COC1 0), CSP1, CT, CT, (COC0 0), + CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), + CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, CT, + CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, (COC1 0), CSP0, CT, CT, CP0, CS10, CP0, CS00, + CS00, CS10, CS00, CP1, CP0, CS10, CP0, CS00, CS00, CP0, CS00, CS10, CS00, CS00, CS10, + CS10, CP0, CS01, CP0, CS10, CP0, CP1, CP0, CP0, CP0, CP1, CP0, CS10, CS10, CS00, CP0, + CS01, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, + CT, CT, (COC0 0), CSP0, CS11, CT, CT, (COC0 0), CSP0, CS10, CT, (COC1 0), CSP1, (COC1 0), + CSP1, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, + CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, + CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, (COC1 0), CSP1, CT, + CT, CT, (COC0 0), CSP1, (COC1 0), CSP0, CS10, CP0, CT, (COC1 0), CSP1, (COC1 0), CSP0, + (CEC 0), CSP0, CP0, CS00, CP1, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP1, (COC1 1), CSP0, CT, CT, CP0, CS10, CS10, CS10, CS00, CS11, CP0, CS10, + CP1, CP0, CS10, CS10, CS10, CS11, CP1, CP1, CP1, CP0, CS10, CS01, CP0, CS10, CP0, CP1, + CP0, CP0, CP0, CP1, CP0, CS10, CP1, CP0, CS10, CS11, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), + CSP1, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, (COC0 0), (CSC0 0), CSP1, + (COC1 0), CSP1, (COC1 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, + CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), + CSP1, (COC1 0), CSP1, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP1, CT, (COC0 0), + CSP1, (COC1 0), CSP1, CT, CT, CT, (COC0 0), (CSC1 0), CSP0, CS11, CT, CT, CT, CT, CT, CT, + CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, CT, CP1, CP0, CS11, (COC0 0), CSP1, CT, CT, + CP1, CP1, CT, CT, CT, CT, (COC0 1), CSP1, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, CT, CT, + CP1, CT, CT, CP0, CS10, CS11, CP0, CS10, CS10, CP0, CS00, CS10, CP0, CP0, CS00, CS10, + CP1, CP1, CP0, CS11, CP1, CP0, CS10, CP1, CP0, CS10, CS10, CS00, CS01, CP1, CP1, CP1, + CP0, CS10, CS01, CP0, CS10, CP0, CP1, CP0, CP0, CP0, CS01, CP1, CP0, CP0, CS01, CP0, + CS10, CS11, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), + CSP0, CT, (COC1 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, (COC0 0), + CSP0, CS10, CT, (COC1 0), CSP1, (COC1 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), + CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, + CT, (COC1 0), CSP1, (COC1 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, + CT, (COC0 0), (CSC0 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, CT, + CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, CT, CT, CT, CT, CP0, CT, + CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, + CT, CT, CT, CT, CT, CT, CT, CP1, CT, CP1, (COC1 0), CSP0, CS11, CT, (COC0 0), CSP0, CS11, + CT, CT, (COC0 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP1, CP0, CS10, CT, CT, CT, + CT, (COC0 1), CSP1, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CP1, CT, + CT, CP0, CS10, CP0, CS00, CS00, CP0, CS00, CS10, CS01, CP0, CS11, CP1, CP0, CS11, CP1, + CP0, CP0, CS00, CS01, CP1, CP1, CP0, CP0, CP1, CP1, CP1, CP0, CP1, CP1, CP0, CS11, CP1, + CP0, CS10, CP1, CP0, CS10, CS10, CS00, CS01, CP1, CP1, CP1, CP0, CS10, CS01, CP0, CS10, + CP0, CP1, CP0, CP0, CP0, CS01, CP1, CP0, CS10, CP0, CS01, CP0, CS10, CS01, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, CT, CT, + CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), + CSP1, CT, (COC0 0), (CSC0 0), CSP1, (COC1 0), CSP1, (COC1 0), CSP1, CT, CT, (COC0 0), + CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), + CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, + CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, (COC1 0), CSP1, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, (COC1 0), CSP0, CT, (COC1 0), CSP0, CS10, CT, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, (COC1 0), CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, + CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, + (COC1 0), CSP1, (COC1 0), (CSC1 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP1, (COC1 0), + CSP0, (CEC 0), (CSC0 1), CSP1, CT, (COC0 0), CSP1, CT, CT, (COC0 0), CSP0, CS10, CT, CT, + CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP1, + CP0, CS10, CT, CT, CT, CT, (COC0 1), CSP1, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), + CSP1, (COC1 0), CSP0, CT, CP0, CT, CT, CP0, CS10, CS10, CS10, CS00, CP0, CS00, CS00, + CS01, CP0, CS10, CP1, CP0, CS10, CS10, CP1, CP0, CS11, CP0, CP1, CP0, CP1, CP0, CP0, + CS01, CP1, CP1, CP0, CS10, CP1, CP1, CP0, CS10, CS01, CP1, CP1, CP0, CS10, CS00, CS00, + CS00, CS00, CS10, CS00, CS00, CS10, CS00, CS10, CS11, CP1, CP0, CP0, CS00, CP0, CS00, + CS10, CS10, CS00, CP1, CP1, CP0, CS10, CP1, CP0, CS10, CS10, CS00, CS01, CP1, CP1, CP1, + CP0, CS10, CS01, CP0, CS10, CP0, CP1, CP0, CP0, CP0, CP1, CP0, CS10, CS10, CS00, CP0, + CS01, CP0, CS10, CS01, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, (COC1 0), + CSP1, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CS11, CT, CT, (COC0 0), CSP0, CS10, CT, (COC1 0), CSP1, (COC1 0), CSP1, + CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, + CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, + CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, (COC1 0), CSP1, CT, CT, + CT, (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, CT, (COC0 0), CSP1, (COC1 0), CSP1, CT, CT, + CT, (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, + CS11, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), + CSP0, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), (CSC1 0), CSP1, CT, CP1, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, + (COC0 0), CSP1, CT, (COC0 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, + (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), (CSC0 0), CSP1, CT, CT, CT, + CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, + (COC1 0), CSP1, (COC1 0), CSP1, CT, CT, CT, CT, CT, CT, CP1, (COC1 1), CSP0, CS10, + (CEC 0), CSP1, CT, CT, CP1, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, + CT, (COC0 0), CSP1, CT, CT, CT, CP0, CT, CT, CT, CP0, CS10, CS10, CS00, CP0, CS00, CP0, + CP1, CT, CT, (COC0 0), (CSC1 0), CSP0, CS11, CP0, CT, CT, (COC0 0), CSP1, CT, (COC0 0), + CSP1, CP0, CS10, CT, CT, CT, CT, (COC0 1), CSP1, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, + (COC1 1), CSP0, CT, CP0, CT, CT, CP0, CP1, CP0, CS10, CS10, CP1, CP0, CS11, CP0, CP1, + CP0, CP1, CP1, CP1, CP0, CP1, CP0, CP0, CP0, CP0, CS00, CS10, CS00, CP1, CP0, CS10, CS11, + CP0, CP0, CS00, CP0, CP0, CP1, CP1, CP0, CS10, CP1, CP1, CP0, CS10, CS01, CP1, CP1, CP1, + CP1, CP1, CP1, CP1, CP0, CP0, CS01, CP0, CS10, CS10, CS10, CS10, CP0, CS01, CP1, CP0, + CS11, CP1, CP0, CS10, CP1, CP0, CS10, CS10, CS00, CS01, CP1, CP1, CP1, CP0, CS10, CS01, + CP0, CS10, CP0, CP1, CP0, CP0, CP0, CP1, CP0, CS10, CP1, CP0, CS10, CS11, CP0, CS10, + CS01, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, (COC1 0), + CSP1, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, + CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, (COC0 0), (CSC0 0), CSP1, (COC1 0), CSP1, + (COC1 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, + CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, + (COC1 0), CSP1, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP0, CT, (COC1 0), + (CSC1 0), CSP1, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP0, CT, CT, CT, CT, CT, + CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, + CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CT, + CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), + CSP0, CS11, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, + CS10, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, + (COC0 0), CSP1, CT, (COC0 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, (COC1 0), CSP1, (COC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, (COC0 0), + CSP1, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, + (COC1 1), CSP0, CT, CT, CT, (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, CT, CT, (COC0 0), + CSP0, CT, (COC1 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, + CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, CT, CT, CP1, CT, + (COC0 0), CSP1, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CP0, CT, CT, + CP1, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP1, CT, CT, CT, CP0, CT, CT, CT, CT, + CT, CT, CT, CT, (COC0 0), CSP0, CT, CP1, CP1, (COC1 0), CSP0, CT, (COC1 0), CSP1, CT, + (COC0 0), CSP1, CT, (COC0 0), CSP1, CP0, CS10, CT, CT, CT, CT, (COC0 1), CSP1, CT, CT, + CT, CT, CT, CT, (COC0 0), CSP1, CT, CT, CP1, CT, CP0, CT, CT, CP0, CS10, CP0, CS00, CS00, + CP0, CS00, CP0, CS01, CP1, CP1, CP1, CP0, CS10, CS00, CS01, CP0, CP0, CS01, CP0, CP0, + CS00, CP0, CP0, CS01, CP1, CP0, CP1, CP0, CS11, CP1, CP1, CP0, CP0, CP1, CP0, CS10, CS10, + CS01, CP1, CP0, CS10, CS00, CS00, CP0, CS00, CS00, CP1, CP1, CP0, CS10, CS00, CS11, CP0, + CS10, CS01, CP0, CP0, CS00, CS00, CP1, CP1, CP1, CP0, CS11, CP0, CS10, CS10, CS10, CP0, + CP0, CS00, CS10, CS00, CP1, CP0, CS10, CS11, CP0, CS10, CS10, CP0, CS00, CS10, CS01, CP0, + CS11, CP1, CP1, CP0, CS10, CP1, CP1, CP0, CS10, CS01, CP1, CP1, CP1, CP1, CP1, CP1, CP1, + CP1, CP0, CP1, CP0, CP0, CS00, CP0, CS00, CS10, CS00, CS10, CP1, CP1, CP0, CS10, CP1, + CP0, CS10, CS10, CS00, CS01, CP1, CP1, CP1, CP0, CS10, CS01, CP0, CS10, CP0, CP1, CP0, + CP0, CP0, CS01, CP1, CP0, CP0, CS01, CP0, CS10, CS11, CP0, CS10, CS01, CP1, CP0] +] + +def z2b_0813 : WordList := [V, V, V, V, V, V, V, K, V, V, Q, V, V, V, V, V, V, K, Q, V, V, V, + K, K, V, V, Q, V, Q, V, V, V, K, V, V, V, V, V, K, V, V, V, V, V, V, V, V, V, V, V, K, V, + V, V, K, V, V, V, V, V, V, K, V, V, V, V, V, V, V, V, V, K, V, V, Q, V, Q, V, V, V, V, K, + Q, V, V, Q, V, V, Q, Q, V, V, V, V, V, K, Q, V, V, Q, V, V, V, V, V, V, V, K, Q, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, K, V, V, V, V, V, V, V, V, K, V, V, V, V, + V, V, V, V, V, V, V, K, V, Q, V, V, V, V, V, K, V, V, Q, V, V, K, V, V, Q, V, V, V, V, K, + V, V, V, V, V, V, K, V, V, V, K, V, V, V, V, V, V, K, V, Q, V, V, K, V, V, V, V, K, V, V, + V, K, V, Q, V, V, V, V, V, V, V, V, V, V, K, V, V, Q, V, V, K, V, V, K, V, V, V, V, K, V, + V, V, V, V, V, K, V, V, Q, V, Q, V, V, V, V, V, V, V, V, K, V, V, K, V, V, V, V, V, V, K, + V, V, V, V, V, V, K, V, V, V, K, V, V, V, V, V, V, V, V, V, K, V, Q, V, V, V, V, V, K, V, + Q, V, K, V, V, V, K, V, V, Q, V, V, Q, V, V, V, V, K, V, V, V, V, V, V, V, V, K, Q, V, V, + V, V, V, V, V, V, V, V, V, V, V, K, V, V, V, V, V, V, V, V, V, V, V, V, K, V, V, V, V, V, + V, K, V, V, V, V, V, K, V, V, V, V, V, V, V, V, V, V, V, V, V, K, V, V, V, V, Q, V, V, Q, + V, V, K, V, V, K, V, V, Q, V, V, V, V, K, V, V, V, V, V, V, V, V, K, V, V, V, V, V, V, V, + V, V, Q, V, K, K, V, K, V, K, V, V, V, V, Q, K, K, V, V, K, V, V, K, V, V, K, V, V, V, V, + Q, V, V, V, V, V, V, Q, Q, K, V, V, Q, K, K, V, K, K, V, V, V, Q, K, Q, V, Q, K, V, V, K, + K, V, V, V, V, Q, V, Q, Q, Q, V, V, K, Q, K, V, V, Q, Q, V, Q, Q, V, K, Q, K, V, Q, V, V, + V, Q, V, V, V, Q, K, V, V, V, V, V, V, V, V, V, V, V, V, K, V, K, Q, K, Q, V, V, V, Q, V, + V, Q, Q, K, K, V, V, V, V, Q, K, V, Q, V, V, V, V, V, K, V, V, V, K, V, Q, Q, V, Q, K, V, V] + +def z2c_low_0813 : WordList := [Q, K, K, K, K, K, Q, K, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, + K, Q, K, K, Q, K, K, K, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, K, Q, Q, Q, K, Q, K, K, Q, Q, Q, Q, + Q, Q, K, K, K, K, K, Q, Q, Q, K, K, K, K, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, K, K, + K, K, K, K, K, K, K, K, Q, Q, K, Q, Q, Q, K, K, Q, Q, K, Q, K, K, K, Q, Q, Q, K, K, Q, Q, + Q, Q, Q, K, K, K, K, Q, Q, Q, K, K, Q, Q, Q, Q, K, K, Q, Q, Q, Q, Q, Q, K, K, K, Q, Q, K, + K, Q, Q, K, K, K, Q, K, Q, Q, Q, Q, Q, Q, Q, K, K, Q, K, K, K, Q, Q, K, Q, K, K, K, K, Q, + Q, Q, K, K, Q, K, K, Q, Q, K, K, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, K, K, Q, Q, Q, Q, Q, K, + K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, K, Q, Q, K, K, K, K, K, Q, K, Q, + Q, Q, Q, K, Q, Q, Q, Q, K, K, Q, Q, Q, K, K, K, K, Q, Q, Q, Q, Q, Q, Q, Q, K, K, Q, Q, K, + K, Q, K, Q, Q, Q, K] + +def z2c_top_0813 : WordList := [Q,K,Q,K,Q,Q,Q,Q,K,K,Q,K,Q,Q,K,K] + +def z2c_0813 : WordList := z2c_low_0813 ++ z2c_top_0813 + +theorem z2d_0813 : + CanonRounds (evalWords z29_0813 default) + (evalWords (prefix33Words ++ (z2b_0813 ++ (z2c_0813 ++ tail8Words))) default) := + evalCanonRounds_sound z2a_0813 z29_0813 + (prefix33Words ++ (z2b_0813 ++ (z2c_0813 ++ tail8Words))) + (by decide +kernel) + +theorem z2e_0813 : + BGood (z2b_0813 ++ (z2c_0813 ++ tail8Words)) := by + apply bGood_of_check z2b_0813 z2c_low_0813 z2c_top_0813 <;> decide +kernel + +def zPre_0813 : WordList := [V, V, V, V, V, V, V, K, V, V, Q, V, V, Q, K, V, V, V, K, V, Q, Q, + Q, V, K, Q, Q, K, Q, Q, K, K, K, K, K, K, K] + +def zCk0_0813 : CCfg := ⟨B,0,[],[]⟩ + +def zCk1_0813 : CCfg := ⟨C,1, + [1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, + 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, + 0, 1, 0, 0, 1], + [1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1]⟩ + +def zCk2_0813 : CCfg := ⟨C,1, + [0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, + 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 0, 0, 1], + [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1]⟩ + +def zCk3_0813 : CCfg := ⟨C,1, + [0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 1], + [0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, + 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]⟩ + +def zCk4_0813 : CCfg := ⟨E,0, + [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 0, 0, 1], + [1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, + 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, + 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1]⟩ + +def zCk5_0813 : CCfg := ⟨B,1, + [1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, + 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, + 0, 1], + [1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, + 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1]⟩ + +def zCk6_0813 : CCfg := ⟨D,1, + [0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1], + [1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 1, 0, 1]⟩ + +def zCk7_0813 : CCfg := ⟨C,1, + [1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, + 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1], + [0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, + 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1]⟩ + +def zCk8_0813 : CCfg := ⟨C,1, + [1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, + 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 0, 1], + [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]⟩ + +def zCk9_0813 : CCfg := ⟨C,1, + [0, 1], + [0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, + 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, + 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, + 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, + 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1]⟩ + +private theorem zCk_step1 : (c_to_cfg zCk0_0813) [canon_tm]⊢⁺ (c_to_cfg zCk1_0813) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk0_0813 10000 = some zCk1_0813) + +private theorem zCk_step2 : (c_to_cfg zCk1_0813) [canon_tm]⊢⁺ (c_to_cfg zCk2_0813) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk1_0813 10000 = some zCk2_0813) + +private theorem zCk_step3 : (c_to_cfg zCk2_0813) [canon_tm]⊢⁺ (c_to_cfg zCk3_0813) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk2_0813 10000 = some zCk3_0813) + +private theorem zCk_step4 : (c_to_cfg zCk3_0813) [canon_tm]⊢⁺ (c_to_cfg zCk4_0813) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk3_0813 10000 = some zCk4_0813) + +private theorem zCk_step5 : (c_to_cfg zCk4_0813) [canon_tm]⊢⁺ (c_to_cfg zCk5_0813) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk4_0813 10000 = some zCk5_0813) + +private theorem zCk_step6 : (c_to_cfg zCk5_0813) [canon_tm]⊢⁺ (c_to_cfg zCk6_0813) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk5_0813 10000 = some zCk6_0813) + +private theorem zCk_step7 : (c_to_cfg zCk6_0813) [canon_tm]⊢⁺ (c_to_cfg zCk7_0813) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk6_0813 10000 = some zCk7_0813) + +private theorem zCk_step8 : (c_to_cfg zCk7_0813) [canon_tm]⊢⁺ (c_to_cfg zCk8_0813) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk7_0813 10000 = some zCk8_0813) + +private theorem zCk_step9 : (c_to_cfg zCk8_0813) [canon_tm]⊢⁺ (c_to_cfg zCk9_0813) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk8_0813 7731 = some zCk9_0813) + +private theorem zPre_side_0813 : + Side ([Call.ch] ^ 16) (evalWords zPre_0813 default) (evalWords z29_0813 default) := + evalChPow_sound zPre_0813 16 z29_0813 (by decide +kernel) + +theorem z0E_0813 : (c_to_cfg zCk0_0813) [canon_tm]⊢⁺ (cfgCanon (evalWords z29_0813 default)) := by + have h_all := stepPlus_trans_canon zCk_step1 + (stepPlus_trans_canon zCk_step2 + (stepPlus_trans_canon zCk_step3 + (stepPlus_trans_canon zCk_step4 + (stepPlus_trans_canon zCk_step5 + (stepPlus_trans_canon zCk_step6 + (stepPlus_trans_canon zCk_step7 + (stepPlus_trans_canon zCk_step8 zCk_step9))))))) + have heq : c_to_cfg zCk9_0813 = cfgLeft lh (w_pre +> evalWords zPre_0813 default) := by + simp only [c_to_cfg, C, WordCanonBR.C, zCk9_0813, zCL, cfgLeft, lh, w_pre, w_pre_rest, + w_pre5_rest, w_pre3_rest, w_word, + zPre_0813, evalWords, t, d0, d1, one, List.cons_append, List.nil_append, append_cons, + append_nil, z00, zero_cons_default_canon, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] + rw [heq] at h_all + exact stepPlus_trans_canon h_all (stepPlus_word_pre_full zPre_side_0813) + +theorem z2s_0813 (m : Nat) : + ∃ N ≥ m,∃ w,multiStep canon_tm (c_to_cfg zCk0_0813) N = + some (cfgCanon (evalWords (prefix33Words ++ w) default)) /\ BGood w := by + induction m with + | zero => + rcases z0E_0813 with ⟨k1,_,hk1⟩ + rcases stepStar_of_canonRounds z2d_0813 with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,z2b_0813 ++ (z2c_0813 ++ tail8Words), + multiStep_trans_canon canon_tm _ _ _ k1 k2 hk1 hk2,z2e_0813⟩ + | succ m ih => + rcases ih with ⟨N,hN,w,h_ms,h_good⟩ + rcases bGood_progress h_good with ⟨w',hStep,h_good'⟩ + rcases stepPlus_of_bStep hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,w', + multiStep_trans_canon canon_tm _ _ _ N k h_ms h_step_k,h_good'⟩ + +def zStMap_0813 : Fin 6 -> Fin 6 + | 0 => 5 + | 1 => 0 + | 2 => 1 + | 3 => 2 + | 4 => 4 + | 5 => 3 + +def zCfgMap_0813 (c : Cfg (Fin 2) (Fin 6)) : Cfg (Fin 2) (Fin 6) := + ⟨c.q.map zStMap_0813,⟨c.tape.head,c.tape.right,c.tape.left⟩⟩ + +theorem zStepMap_0813 (c : Cfg (Fin 2) (Fin 6)) : + step target_tm (zCfgMap_0813 c) = (step canon_tm c).map zCfgMap_0813 := by + rcases c with ⟨_ | ⟨_ | _ | _ | _ | _ | _ | q,hq⟩,⟨h,l,r⟩⟩ <;> + rcases h with ⟨_ | _ | a,ha⟩ <;> + first | omega | rfl + +theorem zMultiStepMap_0813 (c : Cfg (Fin 2) (Fin 6)) (n : Nat) : + multiStep target_tm (zCfgMap_0813 c) n = (multiStep canon_tm c n).map zCfgMap_0813 := by + induction n with + | zero => rfl + | succ n ih => + rw [multiStep_succ_canon,multiStep_succ_canon,ih] + cases multiStep canon_tm c n with + | none => rfl + | some c' => exact zStepMap_0813 c' + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases z2s_0813 (n + 1) with ⟨N,hN,_,h_N,_⟩ + have h_init : zCfgMap_0813 (c_to_cfg zCk0_0813) = init [] := rfl + have h_map := zMultiStepMap_0813 (c_to_cfg zCk0_0813) N + rw [h_init,h_N] at h_map + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_map + have h_some := multiStep_add_Intermediate h_map + rw [multiStep_succ_canon,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LA_1LA0LE diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LE_1LA0LE.lean b/BusyBeaver/BB6/NonHalt/M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LE_1LA0LE.lean new file mode 100644 index 00000000..9f41ca02 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LE_1LA0LE.lean @@ -0,0 +1,966 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LE_1LA0LE + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LE_1LA0LE" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +abbrev holdout_0420_tm : Machine (Fin 2) (Fin 6) := target_tm +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 2000000 +set_option maxRecDepth 2000000 +@[simp] theorem zMz (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : HalfTape).head = 0 := rfl +@[simp] theorem zDt : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem zPs {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem zPt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,by omega,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ +local macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +local macro "gstep" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt]) +local macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | gstep))) +abbrev t : BitWord := [1,1,0,0] +abbrev d0 : BitWord := [0,0] +abbrev d1 : BitWord := [1,0] +abbrev one : BitWord := [1] +abbrev lh : HalfTape := [1,0,1] +> default +abbrev w_word : BitWord := t ++ one +abbrev w_pre : BitWord := w_word +@[simp] theorem zDd : d0 +> (default : HalfTape) = default := by + simp [d0] +inductive Call where + | ch + | cj + | cp + | ca +def zCs : Call -> Fin 6 + | .ch => A + | .cj => F + | .cp => F + | .ca => A +def zCw : Call -> BitWord + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] + | .ca => [1,1,1,0,1,1] +def zCR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (r <{{zCs c}} (l <+ zCw c)) +def zCL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> r) {{B}}> l) +def zCf (q : Nat) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + zCL lh ((w_pre ++ (t ^ (2 + q) ++ (d1 ++ one))) +> r) +def z04 (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l,(zCR l c r1) [holdout_0420_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + z04 c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem z05 {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z06 {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem z07 {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z08 {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z09 {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0a (w : BitWord) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem z0b (ls : List Call) : Seg ls ls [] [] := by + intro r1 r2 h; simpa using! h +theorem zSc {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases z09 h with ⟨r2,ha,hb⟩ + exact z08 (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS0 {ls1 ls2 ls3 : List Call} {u1 u2 v1 v2 : BitWord} + (h1 : Seg ls1 ls2 u1 u2) (h2 : Seg ls2 ls3 v1 v2) : + Seg ls1 ls3 (u1 ++ v1) (u2 ++ v2) := by + intro r1 r2 h + rw [append_assoc u1 v1 r1,append_assoc u2 v2 r2] + exact h1 (v1 +> r1) (v2 +> r2) (h2 r1 r2 h) +theorem zS4 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [holdout_0420_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [holdout_0420_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [holdout_0420_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc1 (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [holdout_0420_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [holdout_0420_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [holdout_0420_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem z0c : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons,append_nil]; execute) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0d : Seg [.cp] [.ch] t (t ++ [0]) := + zS2 (mid := [1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0e : Seg [.ch] [.cj] (t ++ [0]) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0f : Seg [.cj] [.ch] t (t ++ one) := + zS2 (mid := [1,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0g : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0h : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1 d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0i : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0j : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0k : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0l : Seg [.cj] [.cp] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0m : Seg [.ca] [.cj,.ch] w_word (w_word ++ t) := + zS5 (mid1 := [1,0,1,1,1,1,0,1,1]) (mid2 := [1,0,1,0,1,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs w_word t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL w_word t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0n (r : HalfTape) : + (zCL lh r) [holdout_0420_tm]⊢⁺ (zCR lh .ca r) := by + unfold zCL zCR lh zCw zCs + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute +theorem H_T (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact z0a t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [zLp,h_eq,z07] + exact zSg z0c ih +theorem zSa {w2 : BitWord} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact z0a w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq,z07,zLp] + exact zSg hw ih +theorem z0o : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0p : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem z0q (n : Nat) : Seg ([.ch] ^ (n * 2)) ([.ch] ^ n) d0 d0 := + zSa z0o n +theorem z0r (n : Nat) : Seg ([.ch] ^ (1 + n * 2)) ([.ch] ^ n) d0 d1 := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg zH0 (zSa z0p n) +theorem z0s (n : Nat) : Seg ([.ch] ^ (n * 2)) ([.ch] ^ n) d1 d1 := + zSa z0p n +theorem z0t (n : Nat) : Seg ([.ch] ^ (1 + n * 2)) ([.ch] ^ (1 + n)) d1 d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg zH4 (z0q n) +theorem z0u (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0d z0e) (H_T n) +theorem z0v (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0f zH2) (H_T n) +theorem z0w (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0g zH2) (H_T n) +theorem z0x (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0h (H_T n) +theorem z0y (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0i (H_T n) +theorem z0z (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [zLp',List.cons_append,List.nil_append] using! zSg z0j (H_T n) +theorem z0A (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0k (zSg zH1 zH3) + have h1 := zSg h0 (z0q n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using! h1 +theorem z0B (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0l (z0q n) +theorem z0C : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0k zH1 +theorem z0D (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0k (zSg zH1 (zSg zH3 zH0)) + have h1 := zSg h0 (z0s n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using! h1 +theorem z0E (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg [.cj,.ch] [.cp] d1 d1 := zSg z0l zH0 + have h1 := zSg h0 (z0s n) + simpa only [zLp',List.cons_append,List.nil_append] using! h1 +theorem z0F (n : Nat) : Seg ([.ch] ^ n ++ [.cj,.ch]) ([.ch] ^ (1 + n * 2) ++ [.cj,.ch]) t t := by + have h1 := zSg (H_T n) (z0v 0) + have heq : 1 + n * 2 = n * 2 + 1 := by omega + rw [heq,z07] + simpa only [z06,List.append_assoc,List.cons_append,List.nil_append] using! h1 +theorem z0G (n : Nat) : Seg ([.ch] ^ (1 + n * 2)) ([.cj] ++ [.ch] ^ n) (d1 ++ one) d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg zH3 (z0q n) +theorem z0H (n : Nat) : Seg ([.ch] ^ (1 + n * 2) ++ [.cj,.ch]) ([.cj] ++ [.ch] ^ n) + (d1 ++ one) (d1 ++ one) := by + simpa only [List.append_nil] using! zSg (z0G n) z0C +theorem z0I (q : Nat) : ∀ n,Seg ([.ch] ^ n ++ [.cj,.ch]) + ([.ch] ^ ((1 + n) * 2 ^ q - 1) ++ [.cj,.ch]) (t ^ q) (t ^ q) := by + induction q with + | zero => + intro n + have heq : (1 + n) * 2 ^ 0 - 1 = n := by omega + rw [heq]; exact z0b _ + | succ q ih => + intro n + have heq : (1 + n) * 2 ^ (q + 1) - 1 = (1 + (1 + n * 2)) * 2 ^ q - 1 := by + rw [Nat.pow_succ]; ring_nf + rw [zLp,heq] + exact zS0 (z0F n) (ih (1 + n * 2)) +open WordCalculus Word ChoiceE +local notation "WordList" => List Word +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) +theorem loc_z2t {k : Nat} (hK : 0 < k) : ∃ hs,Num k [] hs := by + rcases even_or_odd_mul_two k with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · cases a with + | zero => omega + | succ a => + have heq : (a + 1) * 2 = 2 + a * 2 := by omega + rw [heq]; exact ⟨[.cj] ++ [.ch] ^ a,Num.even a⟩ + · exact ⟨[.cp] ++ [.ch] ^ a,Num.odd a⟩ +theorem loc_z2u {k : Nat} {hs hs' : List Call} (h1 : Num k [] hs) (h2 : Num k [] hs') : + hs = hs' := by + cases h1 with + | @odd n => + generalize hk : 1 + n * 2 = k0 at h2 + cases h2 with + | @odd m => + have hnm : n = m := by omega + subst hnm; rfl + | even _ => omega + | @even n => + generalize hk : 2 + n * 2 = k0 at h2 + cases h2 with + | odd _ => omega + | @even m => + have hnm : n = m := by omega + subst hnm; rfl +def loc_z2v (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs,Num k w hs -> Side hs (w +> r) r' +theorem loc_z2w {r r' : HalfTape} (h : loc_z2v 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl +theorem loc_z2x {n : Nat} {r r' : HalfTape} + (hI : loc_z2v (n * 2) r r') : loc_z2v (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2w hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0k (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine zSc (z0A n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using! hI [] _ hN2 +theorem loc_z2y {n : Nat} {r r' : HalfTape} + (hI : loc_z2v (n * 2) r r') : loc_z2v (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2w hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0C (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine zSc (z0D n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using! hI [] _ hN2 +theorem loc_z2z {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hZ : A = 0) : + evalWords da default = default := by + induction hD with + | nil => rfl + | @zero A H u _ ih => + have hA0 : A = 0 := by omega + rw [evalWords,ih hA0,zDd] + | one _ => omega +theorem loc_z2A {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hPos : 0 < A) : + loc_z2v ((A - 1) * 2) default (evalWords da default) := by + induction hD with + | nil => omega + | @zero A H u _ ih => + have hA_pos : 0 < A := by omega + have hIH := ih hA_pos + have hs := loc_z2x hIH + rw [zDd] at hs + have heq : (A * 2 - 1) * 2 = 2 + (A - 1) * 4 := by omega + rw [evalWords] + rwa [heq] + | @one A H u hDu ih => + cases A with + | zero => + have h_side : evalWords (Q :: u) default = one +> default := by + rw [evalWords,loc_z2z hDu rfl] + simp [d1,one] + rw [h_side] + intro w hs hN + have hk0 : (1 + 0 * 2 - 1) * 2 = 0 := rfl + rw [hk0] at hN + generalize hk : (0 : Nat) = k0 at hN + cases hN with + | zero => exact Side.nil (one +> default) + | odd _ => omega + | even _ => omega + | succ A => + have hA_pos : 0 < A + 1 := by omega + have hIH := ih hA_pos + have heq_in : (A + 1 - 1) * 2 = A * 2 := by omega + rw [heq_in] at hIH + have hs := loc_z2y hIH + rw [zDd] at hs + have heq : (1 + (A + 1) * 2 - 1) * 2 = 4 + A * 4 := by omega + rw [evalWords] + rwa [heq] +theorem zEd {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ∀ {A H : Nat},DigitVal A H v -> Seg ([Call.ch] ^ n) ([Call.ch] ^ b) (wordsToBits u) (wordsToBits v) := by + induction hI with + | nil n => + intro A H _ + exact z0b _ + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | d00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0q _) (ih hD') + | d01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0r _) (ih hD') + | d10 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0s _) (ih hD') + | d11 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0t _) (ih hD') +theorem loc_z2B {n : Nat} {hs hs' : List Call} + (hI : Num (3 + n) [] hs) (hJ : Num (2 + n * 2) [] hs') : + Seg hs ([Call.ch] ++ hs') t t := by + generalize hk1 : 3 + n = k1 at hI + generalize hk2 : 2 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = m * 2 := by omega + subst hq + rw [h1m] + exact z0u m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0v m +theorem loc_z2C {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' (d1 ++ d0) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0w m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + have hq : q = m * 2 := by omega + subst hq + exact z0x m +theorem loc_z2D {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' (d1 ++ d1) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | @odd q => + have hq : q = m * 2 := by omega + subst hq + exact z0y m + | even _ => omega + | @even m => + cases hJ with + | @odd q => + have hq : q = 1 + m * 2 := by omega + subst hq + exact z0z m + | even _ => omega +theorem loc_z2E {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 2 + q * 2 := by omega + subst hm + exact z0A q +theorem loc_z2F {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = q * 2 := by omega + subst hm + exact z0B q + | even _ => omega +theorem loc_z2G {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 3 + q * 2 := by omega + subst hm + exact z0D q +theorem loc_z2H {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = 1 + q * 2 := by omega + subst hm + exact z0E q + | even _ => omega +theorem loc_z2I {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) : + ∀ {u : WordList} {n n' : Nat} {hs hs' : List Call}, + WordEffect n u n' v -> Num k [] hs -> Num k' [] hs' -> + Seg (([Call.ch] ^ n) ++ hs) (([Call.ch] ^ n') ++ hs') (wordsToBits u) (wordsToBits w) := by + induction hI with + | nil k => + intro u n n' hs hs' hE hN hN' + cases hE + rw [loc_z2u hN hN'] + exact z0b _ + | @T m _ _ _ _ _ _ ih => + intro u0 n0 n1 hs hs' hE hN hN' + cases hE with + | T hSub => + rcases loc_z2t (by omega : 0 < 2 + m * 2) with ⟨hs0,hN0⟩ + have hIH := ih hSub hN0 hN' + have hStep := zSg (H_T n0) (loc_z2B hN hN0) + have heq : ([Call.ch] ^ (n0 * 2)) ++ ([Call.ch] ++ hs0) = ([Call.ch] ^ (1 + n0 * 2)) ++ hs0 := by + have h1 : 1 + n0 * 2 = n0 * 2 + 1 := by omega + rw [h1,z07,z06,List.append_assoc] + rw [heq] at hStep + exact zS0 hStep hIH + | @pair0 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,K] ++ u) at hE + rcases wordEffect_split_output [Q,K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD10 : DigitVal 1 2 [Q,K] := DigitVal.one (DigitVal.zero DigitVal.nil) + have hStep := zSg (zEd hL hD10) (loc_z2C hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @pair1 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,Q] ++ u) at hE + rcases wordEffect_split_output [Q,Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD11 : DigitVal 3 2 [Q,Q] := DigitVal.one (DigitVal.one DigitVal.nil) + have hStep := zSg (zEd hL hD11) (loc_z2D hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short00 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (loc_z2E hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short01 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (loc_z2F hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short10 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (loc_z2G hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short11 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (loc_z2H hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') +theorem loc_z2J {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) {u : WordList} {r r' : HalfTape} + (hE : WordEffect 0 u 0 v) (hK : 0 < k') (hC : loc_z2v k' r r') : + loc_z2v k (evalWords u r) (evalWords w r') := by + intro w0 hs hN + have hPosK : 0 < k := phaseScan_pos_of_out_pos hI hK + have hw0 : w0 = [] := by + cases hN with + | zero => omega + | odd _ => rfl + | even _ => rfl + subst hw0 + rcases loc_z2t hK with ⟨hs',hN'⟩ + have hSeg := loc_z2I hI hE hN hN' + dsimp at hSeg + have hSide := zSc hSeg (hC [] hs' hN') + rwa [wordsToBits_append_tape,wordsToBits_append_tape] at hSide +theorem loc_z2K {q : Nat} {orig out : WordList} (hS : EStep q orig out) : + loc_z2v (4 * 2 ^ q) (evalWords orig default) (evalWords out default) := by + rcases hS with ⟨eff,n,v,a0,b0,J,da,hE,hI,hPos,hDA⟩ + have hBlank : evalWords [K] default = default := by simp [evalWords,d0] + have hC : loc_z2v (n * 2) default (evalWords da default) := by + have heq : n * 2 = ((1 + n) - 1) * 2 := by omega + rw [heq] + exact loc_z2A hDA (by omega) + have hRun := loc_z2J hI hE (by omega : 0 < n * 2) hC + rwa [evalWords_append,hBlank,<- evalWords_append] at hRun +theorem loc_z2L (q : Nat) : + Seg [.cj,.ch] ([.cj] ++ [.ch] ^ (2 ^ q - 1)) (t ^ (1 + q) ++ (d1 ++ one)) (t ^ (1 + q) ++ (d1 ++ one)) := by + have hpos := pow_two_pos q + have hT := z0I (1 + q) 0 + have heq : (1 + 0) * 2 ^ (1 + q) - 1 = 1 + (2 ^ q - 1) * 2 := by + rw [pow_two_one_add]; omega + rw [heq] at hT + dsimp at hT + exact zS0 hT (z0H (2 ^ q - 1)) +theorem loc_z2M (q : Nat) : + Seg [.ca] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) + (w_pre ++ (t ^ (2 + q) ++ (d1 ++ one))) + (w_pre ++ (t ^ (2 + (q + 1)) ++ (d1 ++ one))) := by + have h1 := zS0 z0m (loc_z2L (1 + q)) + have heq1 : 1 + (1 + q) = 2 + q := by omega + have heq2 : (w_pre ++ t) ++ (t ^ (2 + q) ++ (d1 ++ one)) = w_pre ++ (t ^ (2 + (q + 1)) ++ (d1 ++ one)) := by + have h3 : 2 + (q + 1) = 1 + (2 + q) := by omega + rw [h3,zLp'] + simp only [List.append_assoc] + rw [heq1] at h1 + rwa [heq2] at h1 +theorem loc_z2N (q : Nat) {r r' : HalfTape} (hI : loc_z2v (4 * 2 ^ q) r r') : + (zCf q r) [holdout_0420_tm]⊢⁺ zCf (q + 1) r' := by + have hpos := pow_two_pos q + have h_num : Num (4 * 2 ^ q) [] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) := by + have heq : 4 * 2 ^ q = 2 + (2 ^ (1 + q) - 1) * 2 := by rw [pow_two_one_add]; omega + rw [heq]; exact Num.even (2 ^ (1 + q) - 1) + have hC := hI [] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) h_num + have hS := zSc (loc_z2M q) hC + rcases hS with _ | ⟨hca,hnil⟩ + cases hnil + exact zPt (z0n _) (hca lh) +theorem loc_z2O {q : Nat} {orig out : WordList} (hS : EStep q orig out) : + (zCf q (evalWords orig default)) [holdout_0420_tm]⊢⁺ zCf (q + 1) (evalWords out default) := + loc_z2N q (loc_z2K hS) +theorem loc_z2P {h : Nat} {u : WordList} {j : Nat} {v : WordList} (hR : ERounds h u j v) : + (zCf h (evalWords u default)) [holdout_0420_tm]⊢* zCf j (evalWords v default) := by + induction hR with + | refl _ _ => exact ⟨0,rfl⟩ + | next hS _ ih => + rcases loc_z2O hS with ⟨n,_,hn⟩ + rcases ih with ⟨m,hm⟩ + exact ⟨n + m,zMt holdout_0420_tm _ _ _ n m hn hm⟩ +def loc_z2Q : WordList := [V,V,V,K,K,K,Q,Q,Q] +abbrev CCfg := Counter.CCfg (Fin 2) (Fin 6) +abbrev CCfg.head (c : CCfg) : Fin 2 := c.cur +abbrev CCfg.left (c : CCfg) : List (Fin 2) := c.l +abbrev CCfg.right (c : CCfg) : List (Fin 2) := c.r +abbrev loc_z2R (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev loc_z2Y (c : CCfg) : Option CCfg := Counter.bstep holdout_0420_tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep holdout_0420_tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (loc_z2R c1) [holdout_0420_tm]⊢⁺ (loc_z2R c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ +def loc_z31 : CCfg := + ⟨A,0,[],[]⟩ +def loc_z32 : CCfg := + ⟨B,1,[0,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,1,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,1,0,1,0,1],[0,1]⟩ +def z31_1 : CCfg := ⟨B,1,[1,1,0,0,1,0,1],[1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def z31_2 : CCfg := ⟨B,0,[0,0,0,0,1,0,1],[1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def z31_3 : CCfg := ⟨C,1,[1,0,0,0,0,1,0,0,0,0,1],[1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def z31_4 : CCfg := ⟨C,1,[1,0,0,1,0,0,0,1,0,0,1],[0,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def z31_5 : CCfg := ⟨E,0,[1,0,0,0,0,0,0,0,0,1,1],[0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def z31_6 : CCfg := ⟨F,0,[0,1,0,0,1,0,1,1,0,0,0,1,1],[1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def z31_7 : CCfg := ⟨B,1,[0,1],[1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def z31_8 : CCfg := ⟨F,0,[0,0,1],[1,0,1,1,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def z31_9 : CCfg := ⟨B,1,[1],[1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def z31_10 : CCfg := ⟨B,1,[1,1,0,0,0,0,1,0,0,0,1],[1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def z31_11 : CCfg := ⟨F,1,[0,1,0,0,1,0,1,0,1,0,1],[1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def z31_12 : CCfg := ⟨B,1,[0,0,1,0,0,0,0,0,1],[1,0,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def z31_13 : CCfg := ⟨F,0,[0,0,1,0,1,0,0,0,1],[1,0,1,1,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def z31_14 : CCfg := ⟨E,0,[0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,1,0,1],[0,1,1,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def z31_15 : CCfg := ⟨F,1,[0,0,1,1,0,0,1,1,0,0,0,0,0,0,1,0,1,0,1],[1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def z31_16 : CCfg := ⟨F,1,[0,1,0,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1],[1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def z31_17 : CCfg := ⟨B,0,[0,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,1],[1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def z31_18 : CCfg := ⟨B,0,[0,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,1],[1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def z31_19 : CCfg := ⟨F,1,[0,0,1,1,0,0,0,0,1,0,0,0,1,0,0,0,1],[1,0,1,0,1,1,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def z31_20 : CCfg := ⟨F,0,[1,0,1,0,1,0,0,0,1],[1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def z31_21 : CCfg := ⟨F,0,[0,0,0,0,0,0,0,0,1,0,1],[1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def z31_22 : CCfg := ⟨B,0,[0,0,0,0,1,0,1,0,0,0,1,0,1],[1,0,1,0,1,1,1,0,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def z31_23 : CCfg := ⟨E,0,[1,0,0,0,0,1,1,1,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,1,0,1,0,1],[0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +theorem z33_0 : (loc_z2R loc_z31) [holdout_0420_tm]⊢⁺ (loc_z2R z31_1) := zTc (by decide : 0 < 100) (by decide : zCm loc_z31 100 = some z31_1) +theorem z33_1 : (loc_z2R z31_1) [holdout_0420_tm]⊢⁺ (loc_z2R z31_2) := zTc (by decide : 0 < 100) (by decide : zCm z31_1 100 = some z31_2) +theorem z33_2 : (loc_z2R z31_2) [holdout_0420_tm]⊢⁺ (loc_z2R z31_3) := zTc (by decide : 0 < 100) (by decide : zCm z31_2 100 = some z31_3) +theorem z33_3 : (loc_z2R z31_3) [holdout_0420_tm]⊢⁺ (loc_z2R z31_4) := zTc (by decide : 0 < 100) (by decide : zCm z31_3 100 = some z31_4) +theorem z33_4 : (loc_z2R z31_4) [holdout_0420_tm]⊢⁺ (loc_z2R z31_5) := zTc (by decide : 0 < 100) (by decide : zCm z31_4 100 = some z31_5) +theorem z33_5 : (loc_z2R z31_5) [holdout_0420_tm]⊢⁺ (loc_z2R z31_6) := zTc (by decide : 0 < 100) (by decide : zCm z31_5 100 = some z31_6) +theorem z33_6 : (loc_z2R z31_6) [holdout_0420_tm]⊢⁺ (loc_z2R z31_7) := zTc (by decide : 0 < 100) (by decide : zCm z31_6 100 = some z31_7) +theorem z33_7 : (loc_z2R z31_7) [holdout_0420_tm]⊢⁺ (loc_z2R z31_8) := zTc (by decide : 0 < 100) (by decide : zCm z31_7 100 = some z31_8) +theorem z33_8 : (loc_z2R z31_8) [holdout_0420_tm]⊢⁺ (loc_z2R z31_9) := zTc (by decide : 0 < 100) (by decide : zCm z31_8 100 = some z31_9) +theorem z33_9 : (loc_z2R z31_9) [holdout_0420_tm]⊢⁺ (loc_z2R z31_10) := zTc (by decide : 0 < 100) (by decide : zCm z31_9 100 = some z31_10) +theorem z33_10 : (loc_z2R z31_10) [holdout_0420_tm]⊢⁺ (loc_z2R z31_11) := zTc (by decide : 0 < 100) (by decide : zCm z31_10 100 = some z31_11) +theorem z33_11 : (loc_z2R z31_11) [holdout_0420_tm]⊢⁺ (loc_z2R z31_12) := zTc (by decide : 0 < 100) (by decide : zCm z31_11 100 = some z31_12) +theorem z33_12 : (loc_z2R z31_12) [holdout_0420_tm]⊢⁺ (loc_z2R z31_13) := zTc (by decide : 0 < 100) (by decide : zCm z31_12 100 = some z31_13) +theorem z33_13 : (loc_z2R z31_13) [holdout_0420_tm]⊢⁺ (loc_z2R z31_14) := zTc (by decide : 0 < 100) (by decide : zCm z31_13 100 = some z31_14) +theorem z33_14 : (loc_z2R z31_14) [holdout_0420_tm]⊢⁺ (loc_z2R z31_15) := zTc (by decide : 0 < 100) (by decide : zCm z31_14 100 = some z31_15) +theorem z33_15 : (loc_z2R z31_15) [holdout_0420_tm]⊢⁺ (loc_z2R z31_16) := zTc (by decide : 0 < 100) (by decide : zCm z31_15 100 = some z31_16) +theorem z33_16 : (loc_z2R z31_16) [holdout_0420_tm]⊢⁺ (loc_z2R z31_17) := zTc (by decide : 0 < 100) (by decide : zCm z31_16 100 = some z31_17) +theorem z33_17 : (loc_z2R z31_17) [holdout_0420_tm]⊢⁺ (loc_z2R z31_18) := zTc (by decide : 0 < 100) (by decide : zCm z31_17 100 = some z31_18) +theorem z33_18 : (loc_z2R z31_18) [holdout_0420_tm]⊢⁺ (loc_z2R z31_19) := zTc (by decide : 0 < 100) (by decide : zCm z31_18 100 = some z31_19) +theorem z33_19 : (loc_z2R z31_19) [holdout_0420_tm]⊢⁺ (loc_z2R z31_20) := zTc (by decide : 0 < 100) (by decide : zCm z31_19 100 = some z31_20) +theorem z33_20 : (loc_z2R z31_20) [holdout_0420_tm]⊢⁺ (loc_z2R z31_21) := zTc (by decide : 0 < 100) (by decide : zCm z31_20 100 = some z31_21) +theorem z33_21 : (loc_z2R z31_21) [holdout_0420_tm]⊢⁺ (loc_z2R z31_22) := zTc (by decide : 0 < 100) (by decide : zCm z31_21 100 = some z31_22) +theorem z33_22 : (loc_z2R z31_22) [holdout_0420_tm]⊢⁺ (loc_z2R z31_23) := zTc (by decide : 0 < 100) (by decide : zCm z31_22 100 = some z31_23) +theorem z33_23 : (loc_z2R z31_23) [holdout_0420_tm]⊢⁺ (loc_z2R loc_z32) := zTc (by decide : 0 < 53) (by decide : zCm z31_23 53 = some loc_z32) +theorem loc_z34 : (loc_z2R loc_z31) [holdout_0420_tm]⊢⁺ (loc_z2R loc_z32) := + zPt z33_0 (zPt z33_1 (zPt z33_2 (zPt z33_3 (zPt z33_4 (zPt z33_5 + (zPt z33_6 (zPt z33_7 (zPt z33_8 (zPt z33_9 (zPt z33_10 (zPt z33_11 + (zPt z33_12 (zPt z33_13 (zPt z33_14 (zPt z33_15 (zPt z33_16 (zPt z33_17 + (zPt z33_18 (zPt z33_19 (zPt z33_20 (zPt z33_21 (zPt z33_22 z33_23)))))))))))))))))))))) +theorem loc_z35 : + (init []) [holdout_0420_tm]⊢⁺ zCf 3 (evalWords loc_z2Q default) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = loc_z2R loc_z31 := rfl + have h_end : loc_z2R loc_z32 = zCf 3 (evalWords loc_z2Q default) := by + simp [loc_z2R,loc_z32,zCf,zCL,lh,w_word,t,d0,d1,one,loc_z2Q,evalWords] + rw [h_init,<- h_end] + exact loc_z34 +def loc_z36 : List CodeE := [ + (.More CT 29 (.More CT 57 (.More CT 113 (.More CS11 56 (.More CP1 112 (.More CP1 224 (.More CP0 448 (.Stop 448)))))))), + (.More CT 61 (.More CT 121 (.More CT 241 (.More CS10 120 (.More CT 237 (.More CT 473 (.More CT 945 (.More CS10 472 (.More CS10 235 (.More CS00 117 (.More CP0 233 (.More CS01 116 (.More CP1 232 (.More CP0 464 (.Stop 464))))))))))))))), + (.More CT 125 (.More CT 249 (.More CT 497 (.More CS10 248 (.More CT 493 (.More CT 985 (.More CT 1969 (.More CS10 984 (.More CP0 1967 (.More CT 3931 (.More CS11 1965 (.More CT 3928 (.More CT 7855 (.More CS10 3927 (.More CS00 1963 (.More CS00 981 (.More CP0 1961 (.More CS01 980 (.More CP1 1960 (.More CP0 3920 (.Stop 3920))))))))))))))))))))), + (.More CT 253 (.More CT 505 (.More CT 1009 (.More CS10 504 (.More CT 1005 (.More CT 2009 (.More CT 4017 (.More CS10 2008 (.More CT 4013 (.More CT 8025 (.More CS10 4012 (.More CT 8021 (.More CT 16041 (.More CS10 8020 (.More CS10 4009 (.More CS01 2004 (.More CT 4006 (.More CS01 2003 (.More CT 4004 (.More CT 8007 (.More CS10 4003 (.More CS00 2001 (.More CS00 1000 (.More CP0 1999 (.More CP0 3997 (.More CP1 7993 (.More CP1 15986 (.More CP0 31972 (.Stop 31972))))))))))))))))))))))))))))), + (.More CT 509 (.More CT 1017 (.More CT 2033 (.More CS10 1016 (.More CT 2029 (.More CT 4057 (.More CT 8113 (.More CS10 4056 (.More CT 8109 (.More CT 16217 (.More CS10 8108 (.More CT 16213 (.More CT 32425 (.More CS10 16212 (.More CP1 32423 (.More CT 64844 (.More CS01 32422 (.More CT 64842 (.More CT 129683 (.More CS10 64841 (.More CS00 32420 (.More CS10 16209 (.More CT 32415 (.More CT 64829 (.More CT 129657 (.More CT 259313 (.More CT 518625 (.More CS10 259312 (.More CS10 129655 (.More CP0 259309 (.More CS00 129654 (.More CS11 64826 (.More CP0 129652 (.More CS10 64825 (.More CS01 32412 (.More CP1 64824 (.More CP1 129648 (.More CP0 259296 (.Stop 259296))))))))))))))))))))))))))))))))))))))), + (.More CT 1021 (.More CT 2041 (.More CT 4081 (.More CS10 2040 (.More CT 4077 (.More CT 8153 (.More CT 16305 (.More CS10 8152 (.More CT 16301 (.More CT 32601 (.More CS10 16300 (.More CT 32597 (.More CT 65193 (.More CS10 32596 (.More CT 65189 (.More CT 130377 (.More CS11 65188 (.More CT 130374 (.More CT 260747 (.More CS10 130373 (.More CS00 65186 (.More CS11 32592 (.More CT 65182 (.More CT 130363 (.More CT 260725 (.More CT 521449 (.More CT 1042897 (.More CS10 521448 (.More CS11 260723 (.More CT 521444 (.More CP1 1042889 (.More CT 2085776 (.More CS00 1042888 (.More CS11 521443 (.More CT 1042884 (.More CT 2085767 (.More CT 4171533 (.More CS10 2085766 (.More CS10 1042882 (.More CS10 521440 (.More CP0 1042879 (.More CS01 521439 (.More CP0 1042878 (.More CS10 521438 (.More CP0 1042875 (.More CP1 2085749 (.More CP1 4171498 (.More CP1 8342996 (.More CP0 16685992 (.Stop 16685992)))))))))))))))))))))))))))))))))))))))))))))))))), + (.More CT 2045 (.More CT 4089 (.More CT 8177 (.More CS10 4088 (.More CT 8173 (.More CT 16345 (.More CT 32689 (.More CS10 16344 (.More CT 32685 (.More CT 65369 (.More CS10 32684 (.More CT 65365 (.More CT 130729 (.More CS10 65364 (.More CT 130725 (.More CT 261449 (.More CS10 130724 (.More CT 261445 (.More CT 522889 (.More CS10 261444 (.More CS10 130721 (.More CS00 65360 (.More CT 130717 (.More CT 261433 (.More CT 522865 (.More CT 1045729 (.More CT 2091457 (.More CS10 1045728 (.More CS11 522863 (.More CT 1045724 (.More CT 2091447 (.More CT 4182893 (.More CP0 8365787 (.More CT 16731571 (.More CT 33463141 (.More CT 66926281 (.More CS10 33463140 (.More CP1 66926279 (.More CT 133852556 (.More CS01 66926278 (.More CT 133852554 (.More CS00 66926277 (.More CT 133852551 (.More CT 267705101 (.More CT 535410201 (.More CT 1070820401 (.More CT 2141640801 (.More CS10 1070820400 (.More CS10 535410199 (.More CS00 267705099 (.More CP0 535410197 (.More CS00 267705098 (.More CP0 535410195 (.More CS00 267705097 (.More CP1 535410193 (.More CP0 1070820386 (.More CS10 535410192 (.More CP0 1070820383 (.More CS01 535410191 (.More CP1 1070820382 (.More CP1 2141640764 (.More CP1 4283281528 (.More CP0 8566563056 (.Stop 8566563056)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))), + (.More CT 4093 (.More CT 8185 (.More CT 16369 (.More CS10 8184 (.More CT 16365 (.More CT 32729 (.More CT 65457 (.More CS10 32728 (.More CT 65453 (.More CT 130905 (.More CS10 65452 (.More CT 130901 (.More CT 261801 (.More CS10 130900 (.More CT 261797 (.More CT 523593 (.More CS10 261796 (.More CT 523589 (.More CT 1047177 (.More CS10 523588 (.More CP1 1047175 (.More CT 2094348 (.More CT 4188695 (.More CT 8377389 (.More CT 16754777 (.More CT 33509553 (.More CS10 16754776 (.More CS11 8377387 (.More CT 16754772 (.More CT 33509543 (.More CT 67019085 (.More CT 134038169 (.More CT 268076337 (.More CT 536152673 (.More CT 1072305345 (.More CS10 536152672 (.More CT 1072305341 (.More CT 2144610681 (.More CS11 1072305340 (.More CT 2144610678 (.More CS01 1072305339 (.More CT 2144610676 (.More CT 4289221351 (.More CT 8578442701 (.More CT 17156885401 (.More CT 34313770801 (.More CS10 17156885400 (.More CP0 34313770799 (.More CT 68627541595 (.More CS11 34313770797 (.More CT 68627541592 (.More CS01 34313770796 (.More CT 68627541590 (.More CT 137255083179 (.More CS10 68627541589 (.More CT 137255083175 (.More CS11 68627541587 (.More CT 137255083172 (.More CT 274510166343 (.More CT 549020332685 (.More CT 1098040665369 (.More CS10 549020332684 (.More CS10 274510166341 (.More CS00 137255083170 (.More CS10 68627541584 (.More CS10 34313770791 (.More CP0 68627541581 (.More CS00 34313770790 (.More CS10 17156885394 (.More CP0 34313770787 (.More CS00 17156885393 (.More CS00 8578442696 (.More CP0 17156885391 (.More CP1 34313770781 (.More CP0 68627541562 (.More CP0 137255083123 (.More CS00 68627541561 (.More CP0 137255083121 (.More CP1 274510166241 (.More CP1 549020332482 (.More CP1 1098040664964 (.More CP1 2196081329928 (.More CP0 4392162659856 (.Stop 4392162659856)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +] +def loc_z37 : WordList := [V,V,V,Q,V,V,V,Q,V,V,Q,V,V,Q,V,V,Q,V,V,Q,V,V,V,V,V,V,Q,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,K,V,V,V,V,V,Q,V,V,Q,V,K,V,V,Q,V,Q,V,V,V,V,Q,Q,K,Q,Q,V,K,Q,V,K,K,V,V,V,V,K,V,V,V,V,V,V] +def loc_z38 : WordList := [Q,K,K,K,Q,K,K,K,K,Q,Q,Q,K,K,K,Q,Q,Q,K,Q,K,K,Q,K,Q,K,K,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def loc_z39 : WordList := [K,K,K,K,Q,K,K,K,K,Q,K,K,K,K,Q,Q,Q,Q,K,K,Q,K,Q,Q,K,K,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +set_option maxRecDepth 500000 in +theorem loc_z3a : + ERounds 3 loc_z2Q 11 (loc_z37 ++ loc_z38) := by + have h1 : ERounds 3 loc_z2Q (3 + loc_z36.length) (loc_z37 ++ loc_z38) := by + apply evalERounds_sound loc_z36 + decide + simpa using! h1 +set_option maxRecDepth 500000 in +theorem loc_z3b : + EGood 11 (loc_z37 ++ loc_z38) := by + apply eGood_of_check 11 loc_z37 loc_z38 loc_z39 + · decide + · exact EGuard.T 0 _ + · decide + · decide + · decide + · decide + · decide + · decide + · decide + · norm_num [loc_z37,loc_z39,wordMass,wordMassK,wordScale] +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep holdout_0420_tm c (j + d) = some c') : + (multiStep holdout_0420_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep holdout_0420_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +theorem loc_z3c (m : Nat) : + ∃ N ≥ m,∃ h w,multiStep holdout_0420_tm (init []) N = some (zCf h (evalWords w default)) /\ EGood h w := by + induction m with + | zero => + rcases loc_z35 with ⟨k1,_,hk1⟩ + rcases loc_z2P loc_z3a with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,11,loc_z37 ++ loc_z38, + zMt holdout_0420_tm _ _ _ k1 k2 hk1 hk2,loc_z3b⟩ + | succ m ih => + rcases ih with ⟨N,hN,h,w,h_ms,h_good⟩ + rcases eGood_progress h_good with ⟨w',hStep,h_good'⟩ + rcases loc_z2O hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,h + 1,w', + zMt holdout_0420_tm _ _ _ N k h_ms h_step_k,h_good'⟩ +theorem holdout_0420_nonhalt : + IsDoesNotHalt holdout_0420_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases loc_z3c (n + 1) with ⟨N,hN,_,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := zIm h_N + rw [zMs,hn] at h_some + exact h_some + + + +theorem is_does_not_halt : IsNotHalt target_tm := holdout_0420_nonhalt + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LE_1LA0LE diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH.lean new file mode 100644 index 00000000..110020df --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH.lean @@ -0,0 +1,353 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge + +open Mathlib Relation Nat Turing BusyBeaver SixState + +@[expose] public section + +namespace BusyBeaver.M_1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end BusyBeaver.M_1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH + +end + +namespace BusyBeaver.M_1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + + +def target_tm : Machine (Fin 2) (Fin 6) + | 0, 0 => some (some 1, Stmt.write 1 Dir.right) + | 0, 1 => some (some 0, Stmt.write 1 Dir.right) + | 1, 0 => some (some 2, Stmt.write 1 Dir.left) + | 1, 1 => some (some 4, Stmt.write 1 Dir.left) + | 2, 0 => some (some 3, Stmt.write 0 Dir.left) + | 2, 1 => some (some 1, Stmt.write 0 Dir.left) + | 3, 0 => some (some 0, Stmt.write 0 Dir.right) + | 3, 1 => some (some 5, Stmt.write 0 Dir.right) + | 4, 0 => some (some 2, Stmt.write 0 Dir.left) + | 4, 1 => some (some 0, Stmt.write 0 Dir.right) + | 5, 0 => some (some 3, Stmt.write 1 Dir.right) + | 5, 1 => none + +theorem target_eq : target = target_tm := by + funext q s + fin_cases q <;> fin_cases s <;> rfl + + +@[simp] private theorem multiStep_zero_simp (c : Cfg (Fin 2) (Fin 6)) : + multiStep target_tm c 0 = some c := rfl + +@[simp] private theorem multiStep_succ_simp (c : Cfg (Fin 2) (Fin 6)) (n : ℕ) : + multiStep target_tm c (n + 1) = (step target_tm c).bind (fun c' => multiStep target_tm c' n) := + by + rw [multiStep, Function.iterate_succ_apply] + change ((fun x => Option.bind x (step target_tm))^[n] (step target_tm c)) = _ + cases hs : step target_tm c with + | none => + have hnone : ∀ k, ((fun x => Option.bind x (step target_tm))^[k] none) = none := by + intro k; induction k with + | zero => rfl + | succ k ih => rw [Function.iterate_succ_apply]; exact ih + simp [hnone] + | some c' => rfl + +@[simp] private theorem lb_head_cons_fin2 (a : Fin 2) (s : ListBlank (Fin 2)) : + (a >> s).head = a := ListBlank.head_cons a s + +@[simp] private theorem lb_tail_cons_fin2 (a : Fin 2) (s : ListBlank (Fin 2)) : + (a >> s).tail = s := ListBlank.tail_cons a s + +@[simp] private theorem pow_succ_zero (k : ℕ) (s : ListBlank (Fin 2)) : + (([0] : List (Fin 2)) ^ (k + 1)) +> s = (0 : Fin 2) >> ((([0] : List (Fin 2)) ^ k) +> s) := rfl + +@[simp] private theorem pow_zero_zero (s : ListBlank (Fin 2)) : + (([0] : List (Fin 2)) ^ 0) +> s = s := rfl + +@[simp] private theorem head_default_fin2 : + ((default : ListBlank (Fin 2)).head) = (0 : Fin 2) := rfl + +@[simp] private theorem tail_default_fin2 : + ((default : ListBlank (Fin 2)).tail) = default := rfl + +@[simp] private theorem cons_zero_default_fin2 : + (0 : Fin 2) >> (default : ListBlank (Fin 2)) = default := by + apply ListBlank.ext + intro n + cases n <;> rfl + +private def encL : List ℕ → ListBlank (Fin 2) + | [] => (1 : Fin 2) >> default + | 0 :: w => (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> encL w + | (n + 1) :: w => (1 : Fin 2) >> ((([0] : List (Fin 2)) ^ (n + 1)) +> encL w) + +@[simp] private theorem encL_head (w : List ℕ) : (encL w).head = (1 : Fin 2) := by + cases w with + | nil => simp [encL] + | cons x w' => cases x <;> simp [encL] + +private def bumpW : List ℕ → List ℕ + | [] => [] + | 0 :: w => 1 :: 1 :: w + | (n + 1) :: w => (n + 2) :: w + +@[simp] private theorem encL_bumpW (w : List ℕ) : + (1 : Fin 2) >> ((0 : Fin 2) >> (encL w).tail) = encL (bumpW w) := by + cases w with + | nil => simp [encL, bumpW] + | cons x w' => + cases x with + | zero => simp [encL, bumpW] + | succ n => simp [encL, bumpW] + +private def encR : List (Fin 3) → ListBlank (Fin 2) + | [] => default + | 0 :: v => (0 : Fin 2) >> encR v + | 1 :: v => (1 : Fin 2) >> (0 : Fin 2) >> encR v + | 2 :: v => (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> encR v + +private inductive GoodVA : ℕ → List (Fin 3) → Prop + | zero : GoodVA 0 [0] + | z001 {a v} : GoodVA a (0 :: v) → GoodVA 0 (0 :: 0 :: 1 :: v) + | z01 {a v} : GoodVA a (0 :: v) → GoodVA (a + 1) (0 :: 1 :: v) + | z02 {a v} : GoodVA a (0 :: v) → GoodVA 0 (0 :: 2 :: v) + +private inductive GoodCD : ℕ → List (Fin 3) → Prop + | nil : GoodCD 0 [] + | z01 {a v} : GoodVA a (0 :: v) → GoodCD 0 (0 :: 1 :: v) + | z1 {b v} : GoodCD b v → GoodCD (b + 1) (1 :: v) + +private theorem GoodVA_cons0 {b : ℕ} {v : List (Fin 3)} : GoodCD b v → GoodVA b (0 :: v) + | .nil => .zero + | .z01 hv => .z001 hv + | .z1 hv => .z01 (GoodVA_cons0 hv) + +private inductive SafeW : ℕ → List ℕ → Prop + | nil {b} : SafeW b [] + | z0 {b w} : SafeW 0 w → SafeW b (0 :: w) + | z1 {b w} : SafeW (b + 1) w → SafeW b (1 :: w) + | z2 {b w} : SafeW b w → SafeW b (2 :: w) + | z3 {b k w} : SafeW b ((k + 2) :: w) → SafeW (b + 1) ((k + 3) :: w) + +private theorem SafeW_mono_aux {b : ℕ} {w : List ℕ} (hw : SafeW b w) : ∀ d, b ≤ d → SafeW d w := by + induction hw with + | nil => intro d _; exact .nil + | z0 hw0 => intro d _; exact .z0 hw0 + | z1 _ ih => intro d hd; exact .z1 (ih (d + 1) (by omega)) + | z2 _ ih => intro d hd; exact .z2 (ih d hd) + | z3 _ ih => + intro d hd + obtain ⟨d', rfl⟩ : ∃ d', d = d' + 1 := ⟨d - 1, by omega⟩ + exact .z3 (ih d' (by omega)) + +private theorem SafeW_mono {b b' : ℕ} (h : b ≤ b') {w : List ℕ} (hw : SafeW b w) : SafeW b' w := + SafeW_mono_aux hw b' h + +private theorem bumpW_safe {b : ℕ} {w : List ℕ} (hw : SafeW b w) : SafeW (b + 1) (bumpW w) := by + cases hw with + | nil => exact .nil + | z0 hw0 => exact .z1 (.z1 (SafeW_mono (by omega) hw0)) + | z1 hw1 => exact .z2 hw1 + | z2 hw2 => exact .z3 (k := 0) (.z2 hw2) + | @z3 b₀ k u hw3 => exact .z3 (k := k + 1) (.z3 hw3) + +private inductive SafeWA : ℕ → List ℕ → Prop + | nil {a} : SafeWA a [] + | z0 {a w} : SafeW 0 w → SafeWA a (0 :: w) + | z1 {a w} : SafeW a w → SafeWA a (1 :: w) + +private theorem SafeWA_succ_to_SafeW {a : ℕ} {w : List ℕ} (hw : SafeWA (a + 1) w) : SafeW a w := by + cases hw with + | nil => exact .nil + | z0 hw0 => exact .z0 hw0 + | z1 hw1 => exact .z1 hw1 + +private theorem SafeWA_zero_to_SafeW0 {w : List ℕ} (hw : SafeWA 0 w) : SafeW 0 w := by + cases hw with + | nil => exact .nil + | z0 hw0 => exact .z0 hw0 + | z1 hw1 => exact .z1 (SafeW_mono (by omega) hw1) + +private inductive SymMode where + | modeC | modeD | modeA + +private def evalSym : SymMode → List ℕ → List (Fin 3) → Cfg (Fin 2) (Fin 6) + | .modeC, w, v => (encL w) <{{2}} (encR v) + | .modeD, w, v => ((1 : Fin 2) >> encL w) <{{3}} ((0 : Fin 2) >> encR v) + | .modeA, w, v => (encL w) {{0}}> (encR v) + +private inductive GoodSym : Cfg (Fin 2) (Fin 6) → Prop + | mkC {b w v} : SafeW b w → GoodCD b v → GoodSym (evalSym .modeC w v) + | mkD {b w v} : SafeW (b + 1) w → GoodCD b v → GoodSym (evalSym .modeD w v) + | mkA {a w v} : SafeWA a w → GoodVA a v → GoodSym (evalSym .modeA w v) + +private theorem step_sym_closed (cfg : Cfg (Fin 2) (Fin 6)) (h : GoodSym cfg) : + ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ GoodSym cfg' := by + cases h with + | @mkC b w v hw hv => + cases hw with + | nil => + refine ⟨evalSym .modeA [] (0 :: v), ⟨8, by omega, ?_⟩, .mkA .nil (GoodVA_cons0 hv)⟩ + simp [step, target_tm, Tape.move, Tape.write, evalSym, encL, encR] + | @z0 _ w' hw' => + refine ⟨evalSym .modeC w' (0 :: 1 :: v), ⟨3, by omega, ?_⟩, .mkC hw' (.z01 (GoodVA_cons0 hv))⟩ + simp [step, target_tm, Tape.move, Tape.write, evalSym, encL, encR] + | @z1 _ w' hw' => + refine ⟨evalSym .modeC w' (1 :: v), ⟨2, by omega, ?_⟩, .mkC hw' (.z1 hv)⟩ + simp [step, target_tm, Tape.move, Tape.write, evalSym, encL, encR] + | @z2 _ w' hw' => + refine ⟨evalSym .modeD (bumpW w') v, ⟨5, by omega, ?_⟩, .mkD (bumpW_safe hw') hv⟩ + simp [step, target_tm, Tape.move, Tape.write, evalSym, encL] + | @z3 b₀ k w' hw' => + cases hv with + | @z1 _ vt hvt => + refine ⟨evalSym .modeA (1 :: (k + 2) :: w') (0 :: vt), ⟨12, by omega, ?_⟩, + .mkA (.z1 hw') (GoodVA_cons0 hvt)⟩ + simp [step, target_tm, Tape.move, Tape.write, evalSym, encL, encR] + | @mkD b w v hw hv => + cases hv with + | nil => + refine ⟨evalSym .modeC (1 :: w) [1, 1], ⟨7, by omega, ?_⟩, + .mkC (.z1 (SafeW_mono (by omega) hw)) (.z1 (.z1 .nil))⟩ + simp [step, target_tm, Tape.move, Tape.write, evalSym, encL, encR] + | @z01 a vt hvt => + refine ⟨evalSym .modeA (1 :: 1 :: w) (0 :: vt), ⟨4, by omega, ?_⟩, + .mkA (.z1 (SafeW_mono (by omega) (.z1 hw))) hvt⟩ + simp [step, target_tm, Tape.move, Tape.write, evalSym, encL, encR] + | @z1 b' vt hvt => + refine ⟨evalSym .modeD (1 :: w) vt, ⟨2, by omega, ?_⟩, .mkD (.z1 hw) hvt⟩ + simp [step, target_tm, Tape.move, Tape.write, evalSym, encL, encR] + | @mkA a w v hw hv => + cases hv with + | @z01 a₀ vt hvt => + refine ⟨evalSym .modeA (1 :: w) (0 :: vt), ⟨4, by omega, ?_⟩, + .mkA (.z1 (SafeWA_succ_to_SafeW hw)) hvt⟩ + simp [step, target_tm, Tape.move, Tape.write, evalSym, encL, encR] + | @z02 a₀ vt hvt => + refine ⟨evalSym .modeA (0 :: w) (0 :: vt), ⟨5, by omega, ?_⟩, + .mkA (.z0 (SafeWA_zero_to_SafeW0 hw)) hvt⟩ + simp [step, target_tm, Tape.move, Tape.write, evalSym, encL, encR] + | zero => + cases hw with + | nil => + refine ⟨evalSym .modeA [] [0, 2, 1], ⟨17, by omega, ?_⟩, + .mkA .nil (.z02 (.z01 .zero))⟩ + simp [step, target_tm, Tape.move, Tape.write, evalSym, encL, encR] + | @z0 w' hw' => + refine ⟨evalSym .modeA (1 :: 2 :: w') [0], ⟨10, by omega, ?_⟩, + .mkA (.z1 (.z2 hw')) .zero⟩ + simp [step, target_tm, Tape.move, Tape.write, evalSym, encL, encR] + | @z1 w' hw' => + refine ⟨evalSym .modeC w' [0, 1, 1], ⟨5, by omega, ?_⟩, + .mkC hw' (.z01 (.z01 .zero))⟩ + simp [step, target_tm, Tape.move, Tape.write, evalSym, encL, encR] + | @z001 a₀ vt hvt => + cases hw with + | nil => + refine ⟨evalSym .modeA [] (0 :: 2 :: 2 :: vt), ⟨17, by omega, ?_⟩, + .mkA .nil (.z02 (.z02 hvt))⟩ + simp [step, target_tm, Tape.move, Tape.write, evalSym, encL, encR] + | @z0 w' hw' => + refine ⟨evalSym .modeA (0 :: 2 :: w') (0 :: vt), ⟨11, by omega, ?_⟩, + .mkA (.z0 (.z2 hw')) hvt⟩ + simp [step, target_tm, Tape.move, Tape.write, evalSym, encL, encR] + | @z1 w' hw' => + refine ⟨evalSym .modeC w' (0 :: 1 :: 2 :: vt), ⟨5, by omega, ?_⟩, + .mkC hw' (.z01 (.z02 hvt))⟩ + simp [step, target_tm, Tape.move, Tape.write, evalSym, encL, encR] + +private theorem init_reaches_sym : + multiStep target_tm (init []) 2 = some (evalSym .modeC [] [1]) := by + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = ⟨some 0, ⟨0, default, default⟩⟩ := rfl + rw [h0] + simp [step, target_tm, Tape.move, Tape.write, evalSym, encL, encR] + +private theorem _ms_succ (c : Cfg (Fin 2) (Fin 6)) (n : Nat) : + multiStep target_tm c (n + 1) = (multiStep target_tm c n).bind (step target_tm) := + Function.iterate_succ_apply' _ n (some c) + +private theorem _ms_add (c : Cfg (Fin 2) (Fin 6)) (m k : Nat) : + multiStep target_tm c (m + k) = (multiStep target_tm c m).bind (fun c' => + multiStep target_tm c' k) := by + induction k with + | zero => rw [Nat.add_zero]; cases multiStep target_tm c m <;> rfl + | succ k ih => + rw [← Nat.add_assoc, _ms_succ, ih] + cases multiStep target_tm c m with + | none => rfl + | some c' => exact (_ms_succ c' k).symm + +private theorem init_1_reaches_sym : + multiStep target_tm ((default : ListBlank (Fin 2)) {{1}}> default) 7 = + some (evalSym .modeA [] [0]) := by + simp [step, target_tm, Tape.move, Tape.write, evalSym, encL, encR] + +private theorem init_5_reaches_sym : + multiStep target_tm ((default : ListBlank (Fin 2)) {{5}}> default) 6 = + some (evalSym .modeC [] [1, 1]) := by + simp [step, target_tm, Tape.move, Tape.write, evalSym, encL, encR] + +private theorem _closed_not_halt {c_init : Cfg (Fin 2) (Fin 6)} + (P : Cfg (Fin 2) (Fin 6) → Prop) + (h_step : ∀ c, P c → ∃ c', (c [target_tm]⊢⁺ c') ∧ P c') + (c₀ : Cfg (Fin 2) (Fin 6)) + {N₀ : ℕ} (h_init : multiStep target_tm c_init N₀ = some c₀) + (h₀ : P c₀) : + ∀ cfg : Cfg (Fin 2) (Fin 6), (c_init [target_tm]⊢* cfg) → (step target_tm cfg).isSome := by + have h_unb : ∀ K : ℕ, ∃ M ≥ K, ∃ c, multiStep target_tm c_init M = some c ∧ P c := by + intro K + induction K with + | zero => exact ⟨N₀, Nat.zero_le N₀, c₀, h_init, h₀⟩ + | succ K ih => + rcases ih with ⟨M, _, c, hMc, hc⟩ + rcases h_step c hc with ⟨c', ⟨k, hk_pos, h_ck⟩, hc'⟩ + refine ⟨M + k, by omega, c', ?_, hc'⟩ + rw [_ms_add c_init M k, hMc] + exact h_ck + intro cfg ⟨N, hN⟩ + rcases h_unb (N + 1) with ⟨M, hMN, c, hMc, _⟩ + obtain ⟨d, rfl⟩ : ∃ d, M = (N + 1) + d := ⟨M - (N + 1), by omega⟩ + rw [_ms_add c_init (N + 1) d, _ms_succ c_init N, hN] at hMc + cases hst : step target_tm cfg with + | none => + change Option.bind (step target_tm cfg) (fun c' => multiStep target_tm c' d) = some c at hMc + rw [hst] at hMc; cases hMc + | some _ => rfl + +public section + +theorem is_not_halt_from_0682 : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{1}}> default) [target]⊢* cfg) → (step target cfg).isSome := + by + rw [target_eq] + exact _closed_not_halt GoodSym step_sym_closed (evalSym .modeA [] [0]) + init_1_reaches_sym (.mkA .nil .zero) + +theorem is_not_halt_from_0713 : + ∀ cfg : Cfg (Fin 2) (Fin 6), + (((default : ListBlank (Fin 2)) {{5}}> default) [target]⊢* cfg) → (step target cfg).isSome := + by + rw [target_eq] + exact _closed_not_halt GoodSym step_sym_closed (evalSym .modeC [] [1, 1]) + init_5_reaches_sym (.mkC .nil (.z1 (.z1 .nil))) + +theorem is_not_halt : IsNotHalt target := by + rw [target_eq] + exact _closed_not_halt GoodSym step_sym_closed (evalSym .modeC [] [1]) + init_reaches_sym (.mkC .nil (.z1 .nil)) + +end + +end BusyBeaver.M_1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RA_1LC1LE_1RF1LD_1RE0LD_0LB0RA_HHH0RC.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RA_1LC1LE_1RF1LD_1RE0LD_0LB0RA_HHH0RC.lean new file mode 100644 index 00000000..1af17e9b --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RA_1LC1LE_1RF1LD_1RE0LD_0LB0RA_HHH0RC.lean @@ -0,0 +1,1056 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.Longitudinal + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1RA_1LC1LE_1RF1LD_1RE0LD_0LB0RA_HHH0RC + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RA_1LC1LE_1RF1LD_1RE0LD_0LB0RA_HHH0RC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +local notation "zB" => ListBlank (Fin 2) +local notation "zF" => List (Fin 2) + +set_option linter.unusedSectionVars false +set_option maxHeartbeats 2000000 + +@[simp] theorem zMz (M : Machine (Fin 2) (Fin 6)) (config : Cfg (Fin 2) (Fin 6)) : + multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine (Fin 2) (Fin 6)) (config : Cfg (Fin 2) (Fin 6)) : + multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine (Fin 2) (Fin 6)) (config : Cfg (Fin 2) (Fin 6)) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] +@[simp] theorem z00 : Turing.ListBlank.cons (0 : Fin 2) default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : zB).head = 0 := rfl +@[simp] theorem zDt : (default : zB).tail = default := rfl +@[simp] theorem append_nil (s : zB) : ([] : zF) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : zF) (s : zB) : + (a :: l) +> s = Turing.ListBlank.cons a (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : zF) (s : zB) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append, append_cons, ih] + +theorem zSm (tm : Machine (Fin 2) (Fin 6)) (c_1 c_2 : Cfg (Fin 2) (Fin 6)) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 (tm : Machine (Fin 2) (Fin 6)) (c_1 c_2 : Cfg (Fin 2) (Fin 6)) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1, by decide, zSm tm c_1 c_2 h⟩ +theorem zMa (tm : Machine (Fin 2) (Fin 6)) (c_1 : Cfg (Fin 2) (Fin 6)) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, zMs, ih, Option.bind_assoc] + simp_rw [zMs] +theorem zMt (tm : Machine (Fin 2) (Fin 6)) (c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa, h₁]; simp [h₂] +theorem zPs {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 : Cfg (Fin 2) (Fin 6)} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ +theorem zPt {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, by omega, zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem zSp {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢* c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, by omega, zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem zSt {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢* c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢* c_3 := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ + +macro "finish" : tactic => + `(tactic| try exact ⟨0, rfl⟩) +macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, z00, zDh, zDt]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | exact ⟨0, rfl⟩ | step))) + +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 + +/-- Words on the tape (`BECv10.v:2858–2861`). +Note that on the left tape, Coq `<[1;0]` is `U = [0, 1]` and Coq `<[0;1]` is `V = [1, 0]`. -/ +abbrev Z : zF := [0, 0] +abbrev U : zF := [0, 1] +abbrev V : zF := [1, 0] +abbrev O : zF := [1, 1] + +@[simp] theorem zZd : Z +> (default : zB) = default := by simp [Z] + +open BusyBeaver.Longitudinal (DH0 toDHCfg SideRLs SegRLs) +open BusyBeaver.Longitudinal.BoundedConfig (segRLs_c_spec) + +abbrev Call := DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6) +abbrev ch : Call := ((A, []), (D, [])) +abbrev Side := SideRLs target_tm +abbrev Seg := SegRLs target_tm + +@[simp] theorem z05 {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z06 {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l + +theorem zLp_add {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := + BusyBeaver.Longitudinal.pow_add_list l m n + +theorem zLp_shift {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ^ n ++ l := by + rw [Nat.add_comm 1 n, BusyBeaver.Longitudinal.pow_succ_list'] + +theorem z07 (l : zF) (n : Nat) (s : zB) : (l ^ (1 + n)) +> s = l +> ((l ^ n) +> s) := by + rw [zLp', append_assoc] + +theorem z09 (l : zF) (n : Nat) (s : zB) : (l ^ n) +> (l +> s) = (l ^ (1 + n)) +> s := by + rw [zLp_shift, append_assoc] + +theorem rot_U_V (k : Nat) (r : zB) : + ([1] : zF) +> ((U ^ k) +> r) = (V ^ k) +> ([1] +> r) := by + induction k with + | zero => rfl + | succ k ih => + have hk : k + 1 = 1 + k := by omega + rw [hk, z07 U k r, z07 V k ([1] +> r)] + simp only [U, V, append_cons, append_nil] at ih ⊢ + rw [ih] + +theorem rot_Z (k : Nat) (r : zB) : + ([0] : zF) +> ((Z ^ k) +> r) = (Z ^ k) +> ([0] +> r) := by + induction k with + | zero => rfl + | succ k ih => + have hk : k + 1 = 1 + k := by omega + rw [hk, z07 Z k r, z07 Z k ([0] +> r)] + simp only [Z, append_cons, append_nil] at ih ⊢ + rw [ih] + +theorem rot_O (k : Nat) (r : zB) : + ([1] : zF) +> ((O ^ k) +> r) = (O ^ k) +> ([1] +> r) := by + induction k with + | zero => rfl + | succ k ih => + have hk : k + 1 = 1 + k := by omega + rw [hk, z07 O k r, z07 O k ([1] +> r)] + simp only [O, append_cons, append_nil] at ih ⊢ + rw [ih] + +theorem mod2 (n : Nat) : (∃ k, n = k * 2) ∨ (∃ k, n = 1 + k * 2) := by + rcases Nat.even_or_odd' n with ⟨k, rfl | rfl⟩ + · exact Or.inl ⟨k, by omega⟩ + · exact Or.inr ⟨k, by omega⟩ + +theorem zSc {ls1 ls2 : List Call} {w1 w2 : zF} {r1 r2 : zB} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1.sideRLs_concat h2 + +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : zF} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := + h1.trans h2 + +/-- Binary number representation on the right half-tape (`BECv10.v:2864`). -/ +inductive Num : Nat → zB → Prop where + | nil : Num 0 default + | zero {n : Nat} {r : zB} : Num n r → Num (n * 2) (Z +> r) + | one {n : Nat} {r : zB} : Num n r → Num (1 + n * 2) (O +> r) + +theorem Num_eq {n m : Nat} {r s : zB} (h : Num n r) (hn : n = m) (hr : r = s) : Num m s := by + subst hn; subst hr; exact h + +theorem Num_even (n : Nat) {r : zB} (h : Num (n * 2) r) : ∃ s, r = Z +> s ∧ Num n s := by + generalize hm : n * 2 = m at h + cases h with + | nil => + have hn : n = 0 := by omega + subst hn + exact ⟨default, by simp [Z], Num.nil⟩ + | @zero n0 s h0 => + have hn : n0 = n := by omega + subst hn + exact ⟨s, rfl, h0⟩ + | @one n0 s _ => omega + +theorem Num_odd (n : Nat) {r : zB} (h : Num (1 + n * 2) r) : ∃ s, r = O +> s ∧ Num n s := by + generalize hm : 1 + n * 2 = m at h + cases h with + | nil => omega + | @zero n0 s _ => omega + | @one n0 s h0 => + have hn : n0 = n := by omega + subst hn + exact ⟨s, rfl, h0⟩ + +theorem carry : Seg [ch] [ch] O Z := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem seg_Z_O : Seg [ch] [] Z O := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem seg_100_011 : Seg [ch] [] [1, 0, 0] [0, 1, 1] := + segRLs_c_spec target_tm (T := 200) (by decide) + +theorem increment {n : Nat} {r : zB} (h : Num n r) : ∃ s, Num (1 + n) s ∧ Side [ch] r s := by + induction h with + | nil => + refine ⟨O +> default, Num.one Num.nil, ?_⟩ + simpa only [zZd] using zSc seg_Z_O (SideRLs.nil default) + | @zero n r hn _ => + exact ⟨O +> r, Num.one hn, zSc seg_Z_O (SideRLs.nil r)⟩ + | @one n r _ ih => + rcases ih with ⟨s, hs, hSide⟩ + exact ⟨Z +> s, Num_eq (Num.zero hs) (by omega) rfl, zSc carry hSide⟩ + +-- Tape-sweep helper lemmas for `es` / `es'` + +theorem shiftL_E_U_step (l r : zB) : + ((U +> l) <{{E}} r) [target_tm]⊢* (l <{{E}} (V +> r)) := by + simp only [U, V, append_cons, append_nil] + execute + +theorem shiftL_E_U (q : Nat) (l r : zB) : + (((U ^ q) +> l) <{{E}} r) [target_tm]⊢* (l <{{E}} ((V ^ q) +> r)) := by + induction q generalizing r with + | zero => + simp only [z05, append_nil] + finish + | succ q ih => + have hq : q + 1 = 1 + q := by omega + rw [hq, z07 U q l] + refine zSt (shiftL_E_U_step ((U ^ q) +> l) r) ?_ + simpa only [z09 V q r] using ih (V +> r) + +theorem shiftR_F_V_step (l r : zB) : + (l {{F}}> (V +> r)) [target_tm]⊢* ((V +> l) {{F}}> r) := by + simp only [V, append_cons, append_nil] + execute + +theorem shiftR_F_V (q : Nat) (l r : zB) : + (l {{F}}> ((V ^ q) +> r)) [target_tm]⊢* (((V ^ q) +> l) {{F}}> r) := by + induction q generalizing l with + | zero => + simp only [z05, append_nil] + finish + | succ q ih => + have hq : q + 1 = 1 + q := by omega + rw [hq, z07 V q r] + refine zSt (shiftR_F_V_step l ((V ^ q) +> r)) ?_ + simpa only [z09 V q l] using ih (V +> l) + +theorem shiftL_B_V_step (l r : zB) : + ((V +> l) <{{B}} r) [target_tm]⊢* (l <{{B}} (U +> r)) := by + simp only [V, U, append_cons, append_nil] + execute + +theorem shiftL_B_V (d : Nat) (l r : zB) : + (((V ^ d) +> l) <{{B}} r) [target_tm]⊢* (l <{{B}} ((U ^ d) +> r)) := by + induction d generalizing r with + | zero => + simp only [z05, append_nil] + finish + | succ d ih => + have hd : d + 1 = 1 + d := by omega + rw [hd, z07 V d l] + refine zSt (shiftL_B_V_step ((V ^ d) +> l) r) ?_ + simpa only [z09 U d r] using ih (U +> r) + +theorem shiftR_A_U_step (l r : zB) : + (l {{A}}> (U +> r)) [target_tm]⊢* ((V +> l) {{A}}> r) := by + simp only [U, V, append_cons, append_nil] + execute + +theorem shiftR_A_U (d : Nat) (l r : zB) : + (l {{A}}> ((U ^ d) +> r)) [target_tm]⊢* (((V ^ d) +> l) {{A}}> r) := by + induction d generalizing l with + | zero => + simp only [z05, append_nil] + finish + | succ d ih => + have hd : d + 1 = 1 + d := by omega + rw [hd, z07 U d r] + refine zSt (shiftR_A_U_step l ((U ^ d) +> r)) ?_ + simpa only [z09 V d l] using ih (V +> l) + +theorem scanO_step (l r : zB) : + (l {{A}}> (O +> r)) [target_tm]⊢* ((O +> l) {{A}}> r) := by + simp only [O, append_cons, append_nil] + execute + +theorem scanO (j : Nat) (l r : zB) : + (l {{A}}> ((O ^ j) +> r)) [target_tm]⊢* (((O ^ j) +> l) {{A}}> r) := by + induction j generalizing l with + | zero => + simp only [z05, append_nil] + finish + | succ j ih => + have hj : j + 1 = 1 + j := by omega + rw [hj, z07 O j r] + refine zSt (scanO_step l ((O ^ j) +> r)) ?_ + simpa only [z09 O j l] using ih (O +> l) + +-- Two ordinary right calls, including the intervening left return (`BECv10.v:2899–2908`) + +theorem pair_base (l s : zB) : + ((U +> l) <{{D}} (Z +> s)) [target_tm]⊢* (l <{{E}} (V +> (O +> s))) := by + simp only [U, Z, V, O, append_cons, append_nil] + execute + +theorem pair (n : Nat) {r : zB} (h : Num (1 + n * 2) r) : + ∃ s, Num (1 + n) s ∧ ∀ l q, + (((U ^ (1 + q)) +> l) {{A}}> r) [target_tm]⊢⁺ + (l <{{E}} ((V ^ (1 + q)) +> (O +> s))) := by + rcases increment h with ⟨r', hN', hSide⟩ + have hN'_eq : Num ((1 + n) * 2) r' := Num_eq hN' (by omega) rfl + rcases Num_even (1 + n) hN'_eq with ⟨s, rfl, hs⟩ + refine ⟨s, hs, fun l q => ?_⟩ + have h1 : (((U ^ (1 + q)) +> l) {{A}}> r) [target_tm]⊢⁺ + (((U ^ (1 + q)) +> l) <{{D}} (Z +> s)) := + hSide.elim_single ((U ^ (1 + q)) +> l) + refine z02 h1 ?_ + rw [z07 U q l] + refine zSt (pair_base ((U ^ q) +> l) s) ?_ + simpa only [z09 V q (O +> s)] using shiftL_E_U q l (V +> (O +> s)) + +def S0 (l : zB) (a q : Nat) (r : zB) : Cfg (Fin 2) (Fin 6) := + ((U ^ q) +> ((V ^ a) +> l)) {{A}}> r + +def S1 (l : zB) (a q : Nat) (r : zB) : Cfg (Fin 2) (Fin 6) := + ((U ^ q) +> (Z +> ((V ^ a) +> l))) {{A}}> r + +theorem scanV_step (l r : zB) : + (l {{A}}> (V +> ([1] +> r))) [target_tm]⊢* ((U +> l) {{A}}> ([1] +> r)) := by + simp only [V, U, append_cons, append_nil] + execute + +theorem scanV (q : Nat) (l r : zB) : + (l {{A}}> ((V ^ q) +> ([1] +> r))) [target_tm]⊢* (((U ^ q) +> l) {{A}}> ([1] +> r)) := by + induction q generalizing l with + | zero => + simp only [z05, append_nil] + finish + | succ q ih => + cases q with + | zero => + simp only [Nat.zero_add, z06] + exact scanV_step l r + | succ q' => + have hq : q' + 1 + 1 = 1 + (q' + 1) := by omega + rw [hq] + have h1 : (l {{A}}> ((V ^ (1 + (q' + 1))) +> ([1] +> r))) [target_tm]⊢* + ((U +> l) {{A}}> ((V ^ (q' + 1)) +> ([1] +> r))) := by + rw [z07 V (q' + 1) ([1] +> r), zLp V q', append_assoc] + simpa only [V, append_cons, append_nil] using scanV_step l ([0] +> ((V ^ q') +> ([1] +> r))) + refine zSt h1 ?_ + simpa only [z09 U (q' + 1) l] using ih (U +> l) + +theorem resume0_step (l r : zB) : + ((V +> l) <{{E}} r) [target_tm]⊢* ((Z +> l) {{A}}> r) := by + simp only [V, Z, append_cons, append_nil] + execute + +theorem resume0 (a q : Nat) (l r : zB) : + (((V ^ (1 + a)) +> l) <{{E}} ((V ^ q) +> ([1] +> r))) [target_tm]⊢* + (((U ^ q) +> (Z +> ((V ^ a) +> l))) {{A}}> ([1] +> r)) := by + rw [z07 V a l] + exact zSt (resume0_step ((V ^ a) +> l) ((V ^ q) +> ([1] +> r))) + (scanV q (Z +> ((V ^ a) +> l)) r) + +theorem resume1_step (l r : zB) : + ((Z +> (V +> l)) <{{E}} r) [target_tm]⊢* ((U +> l) {{A}}> (V +> r)) := by + simp only [Z, V, U, append_cons, append_nil] + execute + +theorem resume1 (a q : Nat) (l r : zB) : + ((Z +> ((V ^ (1 + a)) +> l)) <{{E}} ((V ^ q) +> ([1] +> r))) [target_tm]⊢* + (((U ^ (2 + q)) +> ((V ^ a) +> l)) {{A}}> ([1] +> r)) := by + rw [z07 V a l] + refine zSt (resume1_step ((V ^ a) +> l) ((V ^ q) +> ([1] +> r))) ?_ + have h2 := scanV (1 + q) (U +> ((V ^ a) +> l)) r + rw [z07 V q ([1] +> r), z09 U (1 + q) ((V ^ a) +> l)] at h2 + have h2_eq : (1 : Nat) + (1 + q) = 2 + q := by omega + rwa [h2_eq] at h2 + +theorem O_eq_1_1 (s : zB) : O +> s = [1] +> ([1] +> s) := rfl + +theorem count0 (l : zB) (a q n : Nat) {r : zB} (h : Num (1 + n * 2) r) : + ∃ s, Num (3 + n * 2) s ∧ (S0 l (1 + a) (1 + q) r) [target_tm]⊢⁺ (S1 l a (1 + q) s) := by + rcases pair n h with ⟨s, hs, hPair⟩ + refine ⟨O +> s, Num_eq (Num.one hs) (by omega) rfl, ?_⟩ + unfold S0 S1 + refine z02 (hPair ((V ^ (1 + a)) +> l) q) ?_ + rw [O_eq_1_1 s] + exact resume0 a (1 + q) l ([1] +> s) + +theorem count1 (l : zB) (a q n : Nat) {r : zB} (h : Num (1 + n * 2) r) : + ∃ s, Num (3 + n * 2) s ∧ (S1 l (1 + a) (1 + q) r) [target_tm]⊢⁺ (S0 l a (3 + q) s) := by + rcases pair n h with ⟨s, hs, hPair⟩ + refine ⟨O +> s, Num_eq (Num.one hs) (by omega) rfl, ?_⟩ + unfold S1 S0 + refine z02 (hPair (Z +> ((V ^ (1 + a)) +> l)) q) ?_ + have hr := resume1 a (1 + q) l ([1] +> s) + have hq : 2 + (1 + q) = 3 + q := by omega + rw [hq] at hr + rw [O_eq_1_1 s] + exact hr + +theorem counts (l : zB) (a a0 q n : Nat) {r : zB} (h : Num (1 + n * 2) r) : + ∃ s, Num (1 + n * 2 + a * 4) s ∧ + (S0 l (a * 2 + a0) (1 + q) r) [target_tm]⊢* (S0 l a0 (1 + q + a * 2) s) := by + induction a generalizing q n r with + | zero => + refine ⟨r, Num_eq h (by omega) rfl, ?_⟩ + have ha : 0 * 2 + a0 = a0 := by omega + have hq : 1 + q + 0 * 2 = 1 + q := by omega + rw [ha, hq] + finish + | succ a ih => + rcases count0 l (1 + (a * 2 + a0)) q n h with ⟨r1, hN1, h1⟩ + have hN1' : Num (1 + (1 + n) * 2) r1 := Num_eq hN1 (by omega) rfl + rcases count1 l (a * 2 + a0) q (1 + n) hN1' with ⟨r2, hN2, h2⟩ + have hN2' : Num (1 + (2 + n) * 2) r2 := Num_eq hN2 (by omega) rfl + rcases ih (2 + q) (2 + n) hN2' with ⟨s, hNs, hs⟩ + refine ⟨s, Num_eq hNs (by omega) rfl, ?_⟩ + have ha : (a + 1) * 2 + a0 = 1 + (1 + (a * 2 + a0)) := by omega + have hq1 : 1 + (2 + q) = 3 + q := by omega + have hq2 : 3 + q + a * 2 = 1 + q + (a + 1) * 2 := by omega + rw [ha] + rw [hq1] at hs + rw [hq2] at hs + exact zSt (zPs h1) (zSt (zPs h2) hs) + +def K (b : Nat) (r : zB) : Cfg (Fin 2) (Fin 6) := S0 default 0 b r + +theorem overflow_start (r : zB) : + (default <{{E}} r) [target_tm]⊢* ((V +> default) {{F}}> (V +> r)) := by + simp only [V, append_cons, append_nil, z00] + execute + +theorem overflow_end (l s : zB) : + (l {{F}}> (O +> s)) [target_tm]⊢* ((U +> l) {{A}}> s) := by + simp only [O, U, append_cons, append_nil] + execute + +theorem overflow (b n : Nat) {r : zB} (h : Num (1 + n * 2) r) : + ∃ s, Num (1 + n) s ∧ (K (1 + b) r) [target_tm]⊢⁺ (S0 default (3 + b) 1 s) := by + rcases pair n h with ⟨s, hs, hPair⟩ + refine ⟨s, hs, ?_⟩ + unfold K S0 + simp only [z05, z06, append_nil] + refine z02 (hPair default b) ?_ + refine zSt (overflow_start ((V ^ (1 + b)) +> (O +> s))) ?_ + rw [← z07 V (1 + b) (O +> s)] + have hSweep := shiftR_F_V (1 + (1 + b)) (V +> default) (O +> s) + rw [z09 V (1 + (1 + b)) default] at hSweep + have hb : 1 + (1 + (1 + b)) = 3 + b := by omega + rw [hb] at hSweep + exact zSt hSweep (overflow_end ((V ^ (3 + b)) +> default) s) + +theorem S1_0_to_K (b : Nat) (s : zB) : + S1 default 0 b s = K b s := by + unfold S1 K S0 + simp only [z05, append_nil, zZd] + +theorem counts_end (a q n : Nat) {r : zB} (h : Num (1 + n * 2) r) : + ∃ b s, Num (1 + n * 2 + a * 2) s ∧ a + q ≤ b ∧ 1 ≤ b ∧ + (S0 default a (1 + q) r) [target_tm]⊢* (K b s) := by + rcases mod2 a with ⟨k, rfl⟩ | ⟨k, rfl⟩ + · rcases counts default k 0 q n h with ⟨s, hNs, hs⟩ + refine ⟨1 + q + k * 2, s, Num_eq hNs (by omega) rfl, by omega, by omega, ?_⟩ + unfold K + simpa only [Nat.add_zero] using hs + · have hk : 1 + k * 2 = k * 2 + 1 := by omega + rw [hk] + rcases counts default k 1 q n h with ⟨s, hNs, hs⟩ + have hNs' : Num (1 + (n + k * 2) * 2) s := Num_eq hNs (by omega) rfl + rcases count0 default 0 (q + k * 2) (n + k * 2) hNs' with ⟨t, hNt, ht⟩ + refine ⟨1 + q + k * 2, t, Num_eq hNt (by omega) rfl, by omega, by omega, ?_⟩ + have hq : 1 + (q + k * 2) = 1 + q + k * 2 := by omega + rw [hq, S1_0_to_K] at ht + exact zSt hs (zPs ht) + +inductive Bits : Nat → Nat → zF → Prop where + | nil : Bits 0 0 [] + | zero {j n : Nat} {w : zF} : Bits j n w → Bits (1 + j) (n * 2) (Z ++ w) + | one {j n : Nat} {w : zF} : Bits j n w → Bits (1 + j) (1 + n * 2) (O ++ w) + +theorem Bits_eq {j j' n n' : Nat} {w w' : zF} + (h : Bits j n w) (hj : j = j') (hn : n = n') (hw : w = w') : Bits j' n' w' := by + subst hj; subst hn; subst hw; exact h + +theorem finite_increment {j n : Nat} {w : zF} (h : Bits j n w) (hb : 1 + n < 2 ^ j) : + ∃ w', Bits j (1 + n) w' ∧ Seg [ch] [] (1 :: w) (0 :: w') := by + induction h with + | nil => omega + | @zero j n w h ih => + refine ⟨O ++ w, Bits.one h, ?_⟩ + change Seg [ch] [] ([1, 0, 0] ++ w) ([0, 1, 1] ++ w) + exact seg_100_011.concat (SegRLs.nil w) + | @one j n w h ih => + have hb' : 1 + n < 2 ^ j := by + have hp : 2 ^ (1 + j) = 2 * 2 ^ j := by rw [Nat.add_comm 1 j, Nat.pow_succ]; omega + omega + rcases ih hb' with ⟨w', hBits', hSeg'⟩ + refine ⟨Z ++ w', Bits_eq (Bits.zero hBits') rfl (by omega) rfl, ?_⟩ + change Seg [ch] [] (O ++ (1 :: w)) (Z ++ (0 :: w')) + exact carry.concat hSeg' + +theorem wrap_base (l r : zB) : + ((V +> (V +> l)) <{{D}} ([0] +> r)) [target_tm]⊢* + (l <{{B}} (U +> (U +> ([1] +> r)))) := by + simp only [V, U, append_cons, append_nil] + execute + +theorem wrap (d : Nat) (l r : zB) : + (((V ^ (2 + d)) +> l) <{{D}} ([0] +> r)) [target_tm]⊢* + (l <{{B}} ((U ^ (2 + d)) +> ([1] +> r))) := by + have hd : 2 + d = 1 + (1 + d) := by omega + rw [hd, z07 V (1 + d) l, z07 V d l] + refine zSt (wrap_base ((V ^ d) +> l) r) ?_ + have hShift := shiftL_B_V d l (U +> (U +> ([1] +> r))) + rwa [z09 U d (U +> ([1] +> r)), z09 U (1 + d) ([1] +> r)] at hShift + +theorem internal_inc {j n : Nat} {w : zF} (h : Bits j n w) (hb : 1 + n < 2 ^ j) : + ∃ w', Bits j (1 + n) w' ∧ ∀ l d r, + (((V ^ (2 + d)) +> l) {{A}}> ([1] +> (w +> ([0] +> r)))) [target_tm]⊢⁺ + (l <{{B}} ((U ^ (2 + d)) +> ([1] +> (w' +> ([0] +> r))))) := by + rcases finite_increment h hb with ⟨w', hBits', hSeg⟩ + refine ⟨w', hBits', fun l d r => ?_⟩ + have hSide : Side [ch] ((1 :: w) +> ([0] +> r)) ((0 :: w') +> ([0] +> r)) := + zSc hSeg (SideRLs.nil ([0] +> r)) + have h1 := hSide.elim_single ((V ^ (2 + d)) +> l) + have h_in : ((1 :: w) +> ([0] +> r)) = [1] +> (w +> ([0] +> r)) := rfl + have h_out : ((0 :: w') +> ([0] +> r)) = [0] +> (w' +> ([0] +> r)) := rfl + simp only [toDHCfg, append_nil, h_in, h_out] at h1 + exact z02 h1 (wrap d l (w' +> ([0] +> r))) + +theorem resumeB2_base (l r : zB) : + ((U +> (U +> l)) <{{B}} r) [target_tm]⊢* ((V +> (O +> l)) {{A}}> r) := by + simp only [U, V, O, append_cons, append_nil] + execute + +theorem resumeB2 (d : Nat) (l r : zB) : + (((U ^ 2) +> l) <{{B}} ((U ^ d) +> r)) [target_tm]⊢* + (((V ^ (1 + d)) +> (O +> l)) {{A}}> r) := by + have h2 : (U ^ 2) +> l = U +> (U +> l) := by simp [zLp, append_assoc] + rw [h2] + refine zSt (resumeB2_base l ((U ^ d) +> r)) ?_ + simpa only [z09 V d (O +> l)] using shiftR_A_U d (V +> (O +> l)) r + +theorem resumeBO_base (l r : zB) : + ((O +> l) <{{B}} r) [target_tm]⊢* ((V +> l) {{A}}> r) := by + simp only [O, V, append_cons, append_nil] + execute + +theorem resumeBO (d : Nat) (l r : zB) : + ((O +> l) <{{B}} ((U ^ d) +> r)) [target_tm]⊢* + (((V ^ (1 + d)) +> l) {{A}}> r) := by + refine zSt (resumeBO_base l ((U ^ d) +> r)) ?_ + simpa only [z09 V d l] using shiftR_A_U d (V +> l) r + +def Internal (l : zB) (c d : Nat) (w : zF) (r : zB) : Cfg (Fin 2) (Fin 6) := + ((V ^ d) +> ((U ^ c) +> l)) {{A}}> ([1] +> (w +> ([0] +> r))) + +theorem internal_pair {j n : Nat} {w : zF} (h : Bits j n w) (hb : 2 + n < 2 ^ j) : + ∃ w', Bits j (2 + n) w' ∧ ∀ l c d r, + (Internal l (2 + c) (2 + d) w r) [target_tm]⊢⁺ (Internal l c (4 + d) w' r) := by + rcases internal_inc h (by omega) with ⟨w1, hN1, h1⟩ + rcases internal_inc hN1 (by omega) with ⟨w2, hN2, h2⟩ + refine ⟨w2, Bits_eq hN2 rfl (by omega) rfl, fun l c d r => ?_⟩ + unfold Internal + have hc : (U ^ (2 + c)) +> l = (U ^ 2) +> ((U ^ c) +> l) := by + rw [zLp_add U 2 c, append_assoc] + rw [hc] + refine z02 (h1 ((U ^ 2) +> ((U ^ c) +> l)) d r) ?_ + refine zSt (resumeB2 (2 + d) ((U ^ c) +> l) ([1] +> (w1 +> ([0] +> r)))) ?_ + have hd1 : 1 + (2 + d) = 2 + (1 + d) := by omega + rw [hd1] + refine zPs (z02 (h2 (O +> ((U ^ c) +> l)) (1 + d) r) ?_) + have hd2 : 2 + (1 + d) = 3 + d := by omega + have hd3 : 1 + (3 + d) = 4 + d := by omega + rw [hd2] + simpa only [hd3] using resumeBO (3 + d) ((U ^ c) +> l) ([1] +> (w2 +> ([0] +> r))) + +theorem internal_pairs (k : Nat) {j n : Nat} {w : zF} (h : Bits j n w) (hb : n + k * 2 < 2 ^ j) : + ∃ w', Bits j (n + k * 2) w' ∧ ∀ l c d r, + (Internal l (k * 2 + c) (2 + d) w r) [target_tm]⊢* (Internal l c (2 + d + k * 2) w' r) := by + induction k generalizing n w with + | zero => + refine ⟨w, Bits_eq h rfl (by omega) rfl, fun l c d r => ?_⟩ + have hc : 0 * 2 + c = c := by omega + have hd : 2 + d + 0 * 2 = 2 + d := by omega + rw [hc, hd] + finish + | succ k ih => + rcases internal_pair h (by omega) with ⟨w1, hN1, h1⟩ + rcases ih hN1 (by omega) with ⟨w2, hN2, h2⟩ + refine ⟨w2, Bits_eq hN2 rfl (by omega) rfl, fun l c d r => ?_⟩ + have hc : (k + 1) * 2 + c = 2 + (k * 2 + c) := by omega + have hd1 : 4 + d = 2 + (2 + d) := by omega + have hd2 : 2 + (2 + d) + k * 2 = 2 + d + (k + 1) * 2 := by omega + rw [hc] + have step1 := h1 l (k * 2 + c) d r + have step2 := h2 l c (2 + d) r + rw [hd1] at step1 + rw [hd2] at step2 + exact zSt (zPs step1) step2 + +theorem Bits_zeros (j : Nat) : Bits j 0 (Z ^ j) := by + induction j with + | zero => exact Bits.nil + | succ j ih => + rw [zLp] + exact Bits_eq (Bits.zero ih) (by omega) (by omega) rfl + +theorem Bits_ones (j : Nat) {w : zF} (h : Bits j (2 ^ j - 1) w) : w = O ^ j := by + generalize hn : 2 ^ j - 1 = n at h + induction h with + | nil => rfl + | @zero j0 n0 w0 _ _ => + have hp : 0 < 2 ^ j0 := Nat.two_pow_pos j0 + have hp2 : 2 ^ (1 + j0) = 2 * 2 ^ j0 := by rw [Nat.add_comm 1 j0, Nat.pow_succ]; omega + omega + | @one j0 n0 w0 h0 ih => + have hp : 0 < 2 ^ j0 := Nat.two_pow_pos j0 + have hp2 : 2 ^ (1 + j0) = 2 * 2 ^ j0 := by rw [Nat.add_comm 1 j0, Nat.pow_succ]; omega + have hn0 : 2 ^ j0 - 1 = n0 := by omega + rw [ih hn0, zLp'] + +-- Entry, internal transition, and exit lemmas (`BECv10.v:3081–3186`) + +theorem side_O_pow_Z (k : Nat) (r : zB) : + Side [ch] ((O ^ k) +> (Z +> r)) ((Z ^ k) +> (O +> r)) := by + induction k with + | zero => + simp only [z05, append_nil] + exact zSc seg_Z_O (SideRLs.nil r) + | succ k ih => + rw [zLp, append_assoc, zLp, append_assoc] + exact zSc carry ih + +theorem enter_mid1 (l r : zB) : + ((U +> l) {{A}}> (Z +> r)) [target_tm]⊢* ((V +> (O +> l)) {{A}}> r) := by + simp only [U, Z, V, O, append_cons, append_nil] + execute + +theorem enter_mid2 (l r : zB) : + ((V +> (O +> l)) <{{D}} (Z +> (Z +> r))) [target_tm]⊢* + ((V +> l) <{{B}} (U +> (O +> (V +> r)))) := by + simp only [V, O, Z, U, append_cons, append_nil] + execute + +theorem enter (b j : Nat) (r : zB) : + (K (1 + b) (O +> (O +> (Z +> ((O ^ (1 + j)) +> (Z +> r)))))) [target_tm]⊢⁺ + (default <{{B}} ((U ^ (5 + b)) +> (O +> (V +> ((Z ^ j) +> (O +> r)))))) := by + have hSide1 : Side [ch] + (O +> (O +> (Z +> ((O ^ (1 + j)) +> (Z +> r))))) + (Z +> (Z +> (O +> ((O ^ (1 + j)) +> (Z +> r))))) := + zSc carry (zSc carry (zSc seg_Z_O (SideRLs.nil ((O ^ (1 + j)) +> (Z +> r))))) + unfold K S0 + simp only [z05, append_nil] + have h1 := hSide1.elim_single ((U ^ (1 + b)) +> default) + simp only [toDHCfg, append_nil] at h1 + refine z02 h1 ?_ + rw [z07 U b default] + refine zSt (pair_base ((U ^ b) +> default) (Z +> (O +> ((O ^ (1 + j)) +> (Z +> r))))) ?_ + have hShift1 := shiftL_E_U b default (V +> (O +> (Z +> (O +> ((O ^ (1 + j)) +> (Z +> r)))))) + rw [z09 V b] at hShift1 + refine zSt hShift1 ?_ + refine zSt (overflow_start ((V ^ (1 + b)) +> (O +> (Z +> (O +> ((O ^ (1 + j)) +> (Z +> r))))))) ?_ + rw [← z07 V (1 + b)] + have hSweep := shiftR_F_V (1 + (1 + b)) (V +> default) (O +> (Z +> (O +> ((O ^ (1 + j)) +> (Z +> r))))) + rw [z09 V (1 + (1 + b)) default] at hSweep + have hb3 : 1 + (1 + (1 + b)) = 3 + b := by omega + rw [hb3] at hSweep + refine zSt hSweep ?_ + refine zSt (overflow_end ((V ^ (3 + b)) +> default) (Z +> (O +> ((O ^ (1 + j)) +> (Z +> r))))) ?_ + refine zSt (enter_mid1 ((V ^ (3 + b)) +> default) (O +> ((O ^ (1 + j)) +> (Z +> r)))) ?_ + rw [← z07 O (1 + j) (Z +> r)] + have hSide2 := (side_O_pow_Z (1 + (1 + j)) r).elim_single (V +> (O +> ((V ^ (3 + b)) +> default))) + simp only [toDHCfg, append_nil] at hSide2 + rw [z07 Z (1 + j) (O +> r), z07 Z j (O +> r)] at hSide2 + refine zSt (zPs hSide2) ?_ + refine zSt (enter_mid2 ((V ^ (3 + b)) +> default) ((Z ^ j) +> (O +> r))) ?_ + rw [← z07 V (3 + b) default] + have hShiftB := shiftL_B_V (1 + (3 + b)) default (U +> (O +> (V +> ((Z ^ j) +> (O +> r))))) + rw [z09 U (1 + (3 + b))] at hShiftB + have hb5 : 1 + (1 + (3 + b)) = 5 + b := by omega + rwa [hb5] at hShiftB + +theorem sweep_B_U (d : Nat) (r : zB) : + (default <{{B}} ((U ^ d) +> r)) [target_tm]⊢* + (([1] +> ((U ^ d) +> default)) {{F}}> ([1] +> r)) := by + have h1 : (default <{{B}} ((U ^ d) +> r)) [target_tm]⊢* + (([1] +> default) {{F}}> ([1] +> ((U ^ d) +> r))) := by + simp only [append_cons, append_nil, z00] + execute + refine zSt h1 ?_ + rw [rot_U_V d r, rot_U_V d default] + exact shiftR_F_V d ([1] +> default) ([1] +> r) + +theorem start_internal_tail (l r : zB) : + (([1] +> l) {{F}}> ([1] +> (O +> (V +> (Z +> r))))) [target_tm]⊢* + ((V +> (V +> l)) {{A}}> (O +> (V +> r))) := by + simp only [O, V, Z, append_cons, append_nil] + execute + +theorem start_internal (b j : Nat) (r : zB) : + (default <{{B}} ((U ^ (5 + b)) +> (O +> (V +> ((Z ^ (1 + j)) +> (O +> r)))))) [target_tm]⊢* + (Internal default (5 + b) 2 (O ++ (Z ^ j)) (O +> r)) := by + refine zSt (sweep_B_U (5 + b) (O +> (V +> ((Z ^ (1 + j)) +> (O +> r))))) ?_ + rw [z07 Z j (O +> r)] + have hTail := start_internal_tail ((U ^ (5 + b)) +> default) ((Z ^ j) +> (O +> r)) + have hEq : ((V +> (V +> ((U ^ (5 + b)) +> default))) {{A}}> (O +> (V +> ((Z ^ j) +> (O +> r))))) = + Internal default (5 + b) 2 (O ++ (Z ^ j)) (O +> r) := by + unfold Internal + have hV2 : (V ^ 2) +> ((U ^ (5 + b)) +> default) = V +> (V +> ((U ^ (5 + b)) +> default)) := by + simp [zLp, append_assoc] + have hR : O +> (V +> ((Z ^ j) +> (O +> r))) = [1] +> ((O ++ (Z ^ j)) +> ([0] +> (O +> r))) := by + rw [append_assoc O (Z ^ j) ([0] +> (O +> r)), ← rot_Z j (O +> r)] + rfl + rw [hV2, hR] + rwa [hEq] at hTail + +theorem clear_one_step (l r : zB) : + ((O +> l) <{{E}} r) [target_tm]⊢* ((U +> l) {{A}}> r) := by + simp only [O, U, append_cons, append_nil] + execute + +theorem clear_one (n : Nat) {r : zB} (h : Num (1 + n * 2) r) : + ∃ s, Num (3 + n * 2) s ∧ ∀ l q, + (((U ^ (1 + q)) +> (O +> l)) {{A}}> r) [target_tm]⊢⁺ + (((U ^ (2 + q)) +> l) {{A}}> s) := by + rcases pair n h with ⟨s, hs, hPair⟩ + refine ⟨O +> s, Num_eq (Num.one hs) (by omega) rfl, fun l q => ?_⟩ + refine z02 (hPair (O +> l) q) ?_ + refine zSt (clear_one_step l ((V ^ (1 + q)) +> (O +> s))) ?_ + have hScan := scanV (1 + q) (U +> l) ([1] +> s) + rw [z09 U (1 + q) l] at hScan + have hq : 1 + (1 + q) = 2 + q := by omega + rw [hq] at hScan + rw [O_eq_1_1 s] + exact hScan + +theorem clear_ones (j n : Nat) {r : zB} (h : Num (1 + n * 2) r) : + ∃ s, Num (1 + n * 2 + j * 2) s ∧ ∀ l q, + (((U ^ (1 + q)) +> ((O ^ j) +> l)) {{A}}> r) [target_tm]⊢* + (((U ^ (1 + q + j)) +> l) {{A}}> s) := by + induction j generalizing n r with + | zero => + refine ⟨r, Num_eq h (by omega) rfl, fun l q => ?_⟩ + simp only [z05, append_nil, Nat.add_zero] + finish + | succ j ih => + rcases clear_one n h with ⟨r1, hN1, h1⟩ + have hN1' : Num (1 + (1 + n) * 2) r1 := Num_eq hN1 (by omega) rfl + rcases ih (1 + n) hN1' with ⟨s, hNs, hs⟩ + refine ⟨s, Num_eq hNs (by omega) rfl, fun l q => ?_⟩ + rw [zLp O j, append_assoc] + refine zSt (zPs (h1 ((O ^ j) +> l) q)) ?_ + have step2 := hs l (1 + q) + have hq1 : 1 + (1 + q) = 2 + q := by omega + have hq2 : 2 + q + j = 1 + q + (j + 1) := by omega + rw [hq1] at step2 + rw [hq2] at step2 + exact step2 + +def Safe (b : Nat) (r : zB) : Prop := + 1 ≤ b ∧ ∃ n, Num (1 + n * 2) r ∧ n ≤ b * 2 + +def Returns (b : Nat) (r : zB) : Prop := + ∃ b' r', Safe b' r' ∧ (K b r) [target_tm]⊢⁺ (K b' r') + +theorem branch1 (b m : Nat) (r : zB) (hN : Num (1 + m * 4) r) (hB : m ≤ 1 + b) : + Returns (1 + b) r := by + have hN' : Num (1 + (m * 2) * 2) r := Num_eq hN (by omega) rfl + rcases overflow b (m * 2) hN' with ⟨s, hNs, hs⟩ + rcases counts_end (3 + b) 0 m hNs with ⟨b', t, hNt, hB1, hB2, ht⟩ + refine ⟨b', t, ⟨hB2, m + 3 + b, Num_eq hNt (by omega) rfl, by omega⟩, z02 hs ht⟩ + +theorem bridge2 (l : zB) (a : Nat) (r : zB) : + (S0 l a 1 (Z +> (Z +> r))) [target_tm]⊢* (S0 l a 2 (O +> r)) := by + unfold S0 + simp only [z06, zLp, z05, append_nil, append_assoc, Z, O, U, append_cons] + execute + +theorem bridge3 (l : zB) (a : Nat) (r : zB) : + (S0 l a 1 (Z +> (O +> (Z +> r)))) [target_tm]⊢* (S0 l (2 + a) 1 (O +> r)) := by + unfold S0 + have ha : (V ^ (2 + a)) +> l = V +> (V +> ((V ^ a) +> l)) := by + have h2 : 2 + a = 1 + (1 + a) := by omega + rw [h2, z07 V (1 + a) l, z07 V a l] + rw [ha] + simp only [z06, Z, O, U, V, append_cons, append_nil] + execute + +theorem branch2 (b m : Nat) (r : zB) (hN : Num (7 + m * 8) r) (hB : m ≤ 1 + b) : + Returns (1 + b) r := by + have hN' : Num (1 + (3 + m * 4) * 2) r := Num_eq hN (by omega) rfl + rcases overflow b (3 + m * 4) hN' with ⟨s, hNs, hs⟩ + have hNs' : Num ((2 + m * 2) * 2) s := Num_eq hNs (by omega) rfl + rcases Num_even (2 + m * 2) hNs' with ⟨s1, rfl, hN1⟩ + have hN1' : Num ((1 + m) * 2) s1 := Num_eq hN1 (by omega) rfl + rcases Num_even (1 + m) hN1' with ⟨s2, rfl, hN2⟩ + rcases counts_end (3 + b) 1 (1 + m) (Num.one hN2) with ⟨b', t, hNt, hB1, hB2, ht⟩ + refine ⟨b', t, ⟨hB2, m + 4 + b, Num_eq hNt (by omega) rfl, by omega⟩, ?_⟩ + exact z02 hs (zSt (bridge2 default (3 + b) s2) ht) + +theorem branch3 (b m : Nat) (r : zB) (hN : Num (3 + m * 16) r) (hB : m ≤ 1 + b) : + Returns (1 + b) r := by + have hN' : Num (1 + (1 + m * 8) * 2) r := Num_eq hN (by omega) rfl + rcases overflow b (1 + m * 8) hN' with ⟨s, hNs, hs⟩ + have hNs' : Num ((1 + m * 4) * 2) s := Num_eq hNs (by omega) rfl + rcases Num_even (1 + m * 4) hNs' with ⟨s1, rfl, hN1⟩ + have hN1' : Num (1 + (m * 2) * 2) s1 := Num_eq hN1 (by omega) rfl + rcases Num_odd (m * 2) hN1' with ⟨s2, rfl, hN2⟩ + rcases Num_even m hN2 with ⟨s3, rfl, hN3⟩ + rcases counts_end (5 + b) 0 m (Num.one hN3) with ⟨b', t, hNt, hB1, hB2, ht⟩ + refine ⟨b', t, ⟨hB2, m + 5 + b, Num_eq hNt (by omega) rfl, by omega⟩, ?_⟩ + have hb : 2 + (3 + b) = 5 + b := by omega + have hBr := bridge3 default (3 + b) s3 + rw [hb] at hBr + exact z02 hs (zSt hBr ht) + +theorem zeros_after_one (j : Nat) (r : zB) : + ([1] : zF) +> ((O ^ j) +> ([0] +> r)) = (O ^ j) +> (V +> r) := by + rw [rot_O] + rfl + +theorem exit_internal (j : Nat) (l r : zB) : + (l {{A}}> ([1] +> ((O ^ j) +> ([0] +> (O +> r))))) [target_tm]⊢* + ((U +> ((O ^ j) +> l)) {{A}}> (O +> r)) := by + rw [zeros_after_one] + refine zSt (scanO j l (V +> (O +> r))) ?_ + have hScan := scanV 1 ((O ^ j) +> l) ([1] +> r) + simp only [z06] at hScan + rwa [O_eq_1_1 r] + +theorem start_zero_tail (l r : zB) : + (([1] +> l) {{F}}> ([1] +> (O +> (V +> (O +> r))))) [target_tm]⊢* + ((U +> (V +> (O +> l))) {{A}}> (O +> r)) := by + simp only [O, V, U, append_cons, append_nil] + execute + +theorem start_zero (b : Nat) (r : zB) : + (default <{{B}} ((U ^ (5 + b)) +> (O +> (V +> (O +> r))))) [target_tm]⊢* + (S0 (O +> ((U ^ (5 + b)) +> default)) 1 1 (O +> r)) := by + refine zSt (sweep_B_U (5 + b) (O +> (V +> (O +> r)))) ?_ + unfold S0 + simp only [z06] + exact start_zero_tail ((U ^ (5 + b)) +> default) r + +theorem cleanup (l r : zB) : + ((Z +> (O +> (U +> l))) <{{E}} (V +> (O +> r))) [target_tm]⊢* + (S0 l 2 2 (O +> r)) := by + unfold S0 + simp only [zLp, z05, append_nil, append_assoc, Z, O, U, V, append_cons] + execute + +theorem fourth_zero (b m : Nat) {r : zB} (hN : Num m r) (hB : m + 4 ≤ (8 + b) * 2) : + Returns (1 + b) (O +> (O +> (Z +> (O +> (Z +> r))))) := by + rcases count0 (O +> ((U ^ (5 + b)) +> default)) 0 0 m (Num.one hN) with ⟨s, hNs, hs⟩ + have hNs' : Num (1 + (1 + m) * 2) s := Num_eq hNs (by omega) rfl + rcases pair (1 + m) hNs' with ⟨t, hNt, ht⟩ + have hNt' : Num (1 + (2 + m) * 2) (O +> t) := Num_eq (Num.one hNt) (by omega) rfl + rcases counts ((U ^ (4 + b)) +> default) 1 0 1 (2 + m) hNt' with ⟨s', hNs', hs'⟩ + refine ⟨8 + b, s', ⟨by omega, 4 + m, Num_eq hNs' (by omega) rfl, by omega⟩, ?_⟩ + have hEnter : (K (1 + b) (O +> (O +> (Z +> (O +> (Z +> r)))))) [target_tm]⊢⁺ + (default <{{B}} ((U ^ (5 + b)) +> (O +> (V +> (O +> r))))) := enter b 0 r + refine z02 hEnter ?_ + refine zSt (start_zero b r) ?_ + refine zSt (zPs hs) ?_ + unfold S1 + simp only [z05, append_nil] + refine zSt (zPs (ht (Z +> (O +> ((U ^ (5 + b)) +> default))) 0)) ?_ + have h54 : (U ^ (5 + b)) +> default = U +> ((U ^ (4 + b)) +> default) := by + have hb5 : 5 + b = 1 + (4 + b) := by omega + rw [hb5, z07 U (4 + b) default] + rw [h54] + refine zSt (cleanup ((U ^ (4 + b)) +> default) t) ?_ + refine zSt hs' ?_ + have hEq : S0 ((U ^ (4 + b)) +> default) 0 4 s' = K (8 + b) s' := by + unfold K S0 + simp only [z05, append_nil] + rw [← append_assoc, ← zLp_add U 4 (4 + b)] + have hb8 : 4 + (4 + b) = 8 + b := by omega + rw [hb8] + rw [hEq] + finish + +theorem index_power (j : Nat) : j ≤ 2 ^ j := by + induction j with + | zero => omega + | succ j ih => + have hp : 0 < 2 ^ j := Nat.two_pow_pos j + rw [Nat.pow_succ] + omega + +theorem fourth_positive (b j m : Nat) {r : zB} (hN : Num m r) + (hB : 4 * 2 ^ (1 + j) * (1 + m * 2) ≤ 2 + b) : + Returns (1 + b) (O +> (O +> (Z +> ((O ^ (2 + j)) +> (Z +> r))))) := by + have hP : 0 < 2 ^ j := Nat.two_pow_pos j + have hP1 : 2 ^ (1 + j) = 2 ^ j * 2 := by rw [Nat.add_comm 1 j, Nat.pow_succ] + have hJ : j ≤ 2 ^ j := index_power j + have hM1 : 2 ^ (1 + j) ≤ 2 ^ (1 + j) * (1 + m * 2) := + Nat.le_mul_of_pos_right (2 ^ (1 + j)) (by omega) + have hM2 : 1 + m * 2 ≤ 2 ^ (1 + j) * (1 + m * 2) := + Nat.le_mul_of_pos_left (1 + m * 2) (by omega) + have hB' : 4 * (2 ^ (1 + j) * (1 + m * 2)) ≤ 2 + b := by + rwa [← Nat.mul_assoc] + have hBudget : 2 ^ j * 2 ≤ 7 + b := by omega + have hBits0 : Bits (1 + j) 1 (O ++ (Z ^ j)) := + Bits_eq (Bits.one (Bits_zeros j)) rfl (by omega) rfl + rcases internal_pairs (2 ^ j - 1) hBits0 (by omega) with ⟨w, hNw, hw⟩ + have hNw' : Bits (1 + j) (2 ^ (1 + j) - 1) w := Bits_eq hNw rfl (by omega) rfl + have hEw : w = O ^ (1 + j) := Bits_ones (1 + j) hNw' + subst hEw + rcases clear_ones (1 + j) m (Num.one hN) with ⟨s, hNs, hs⟩ + have hNs' : Num (1 + (m + 1 + j) * 2) s := Num_eq hNs (by omega) rfl + rcases counts ((U ^ (7 + b - 2 ^ (1 + j))) +> default) (2 ^ j) 0 (1 + j) (m + 1 + j) hNs' + with ⟨t, hNt, ht⟩ + refine ⟨9 + b + j, t, ⟨by omega, m + 1 + j + 2 ^ (1 + j), + Num_eq hNt (by omega) rfl, by omega⟩, ?_⟩ + have hj2 : 2 + j = 1 + (1 + j) := by omega + rw [hj2] + refine z02 (enter b (1 + j) r) ?_ + refine zSt (start_internal b j r) ?_ + have hw_step := hw default (7 + b - 2 ^ (1 + j)) 0 (O +> r) + have hc_eq : (2 ^ j - 1) * 2 + (7 + b - 2 ^ (1 + j)) = 5 + b := by omega + have hd_eq : 2 + 0 + (2 ^ j - 1) * 2 = 2 ^ j * 2 := by omega + rw [hc_eq, Nat.add_zero] at hw_step + rw [hd_eq] at hw_step + refine zSt hw_step ?_ + unfold Internal + refine zSt (exit_internal (1 + j) + ((V ^ (2 ^ j * 2)) +> ((U ^ (7 + b - 2 ^ (1 + j))) +> default)) r) ?_ + have hs_step := hs ((V ^ (2 ^ j * 2)) +> ((U ^ (7 + b - 2 ^ (1 + j))) +> default)) 0 + simp only [Nat.add_zero, z06] at hs_step + refine zSt hs_step ?_ + have ht_eq1 : 2 ^ j * 2 + 0 = 2 ^ j * 2 := by omega + unfold S0 at ht + rw [ht_eq1] at ht + refine zSt ht ?_ + have hEq : (((U ^ (1 + (1 + j) + 2 ^ j * 2)) +> + ((V ^ 0) +> ((U ^ (7 + b - 2 ^ (1 + j))) +> default))) {{A}}> t) = + K (9 + b + j) t := by + unfold K S0 + simp only [z05, append_nil] + rw [← append_assoc, ← zLp_add U (1 + (1 + j) + 2 ^ j * 2) (7 + b - 2 ^ (1 + j))] + have hb9 : 1 + (1 + j) + 2 ^ j * 2 + (7 + b - 2 ^ (1 + j)) = 9 + b + j := by omega + rw [hb9] + rw [hEq] + finish + +theorem Num_run {n : Nat} {r : zB} (h : Num n r) : + ∃ j m s, r = (O ^ j) +> (Z +> s) ∧ Num m s ∧ 1 + n = 2 ^ j * (1 + m * 2) := by + induction h with + | nil => + exact ⟨0, 0, default, by simp [z05, Z], Num.nil, by omega⟩ + | @zero n r hN _ => + exact ⟨0, n, r, by simp [z05], hN, by omega⟩ + | @one n r _ ih => + rcases ih with ⟨j, m, s, rfl, hNs, hEq⟩ + refine ⟨1 + j, m, s, by rw [z07 O j (Z +> s)], hNs, ?_⟩ + have hp : 2 ^ (1 + j) = 2 * 2 ^ j := by rw [Nat.add_comm 1 j, Nat.pow_succ]; omega + calc + 1 + (1 + n * 2) = 2 * (1 + n) := by omega + _ = 2 * (2 ^ j * (1 + m * 2)) := by rw [hEq] + _ = (2 * 2 ^ j) * (1 + m * 2) := by ring + _ = 2 ^ (1 + j) * (1 + m * 2) := by rw [← hp] + +theorem closed {b : Nat} {r : zB} (h : Safe b r) : Returns b r := by + rcases h with ⟨hB, n, hN, hVb⟩ + cases b with + | zero => omega + | succ b => + have hb1 : b + 1 = 1 + b := by omega + rw [hb1] at hVb ⊢ + rcases mod2 n with ⟨m, rfl⟩ | ⟨k, rfl⟩ + · exact branch1 b m r (Num_eq hN (by omega) rfl) (by omega) + · rcases mod2 k with ⟨u, rfl⟩ | ⟨m, rfl⟩ + · rcases mod2 u with ⟨m, rfl⟩ | ⟨v, rfl⟩ + · exact branch3 b m r (Num_eq hN (by omega) rfl) (by omega) + · rcases Num_odd (1 + (1 + v * 2) * 2 * 2) hN with ⟨r1, rfl, hN1⟩ + rcases Num_odd ((1 + v * 2) * 2) hN1 with ⟨r2, rfl, hN2⟩ + rcases Num_even (1 + v * 2) hN2 with ⟨r3, rfl, hN3⟩ + rcases Num_odd v hN3 with ⟨r4, rfl, hN4⟩ + rcases Num_run hN4 with ⟨j, m, s, rfl, hNs, hF⟩ + cases j with + | zero => + simp only [z05, append_nil] + have hPow0 : 2 ^ 0 = 1 := rfl + rw [hPow0, Nat.one_mul] at hF + exact fourth_zero b m hNs (by omega) + | succ j => + have hj1 : j + 1 = 1 + j := by omega + rw [hj1] at hF + have hj2 : O +> ((O ^ (j + 1)) +> (Z +> s)) = (O ^ (2 + j)) +> (Z +> s) := by + rw [hj1, ← z07 O (1 + j) (Z +> s)] + have h11 : 1 + (1 + j) = 2 + j := by omega + rw [h11] + rw [hj2] + refine fourth_positive b j m hNs ?_ + have hEq : 4 * 2 ^ (1 + j) * (1 + m * 2) = 4 * (1 + v) := by + rw [Nat.mul_assoc, ← hF] + omega + · exact branch2 b m r (Num_eq hN (by omega) rfl) (by omega) + +theorem start_to_K1 : (init []) [target_tm]⊢* K 1 (O +> default) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + unfold K S0 + simp only [z05, z06, append_nil, U, O, append_cons] + execute + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + refine Counter.does_not_halt_of_invariant + (Inv := fun c => ∃ b r, c = K b r ∧ Safe b r) + ⟨K 1 (O +> default), start_to_K1, 1, O +> default, rfl, le_refl 1, 0, Num.one Num.nil, by omega⟩ ?_ + rintro _ ⟨b, r, rfl, hSafe⟩ + rcases closed hSafe with ⟨b', r', hSafe', hStep⟩ + exact ⟨K b' r', hStep, b', r', rfl, hSafe'⟩ + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1RA_1LC1LE_1RF1LD_1RE0LD_0LB0RA_HHH0RC diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RA_1LC1RE_0LD0LD_0LE1LF_1LA0RA_HHH1LC.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RA_1LC1RE_0LD0LD_0LE1LF_1LA0RA_HHH1LC.lean new file mode 100644 index 00000000..a1d8352a --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RA_1LC1RE_0LD0LD_0LE1LF_1LA0RA_HHH1LC.lean @@ -0,0 +1,49 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.BB6.NonHalt.M_1RB0LB_1LC1LB_1RD1LA_0RE0RE_0RA1RF_HHH1RD + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RB1RA_1LC1RE_0LD0LD_0LE1LF_1LA0RA_HHH1LC + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RA_1LC1RE_0LD0LD_0LE1LF_1LA0RA_HHH1LC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +def stateMap_m0608 : Fin 6 → Fin 6 + | 0 => 4 -- m0608 state A + | 1 => 0 -- m0608 state B + | 2 => 1 -- m0608 state C + | 3 => 2 -- m0608 state D + | 4 => 3 -- m0608 state E + | 5 => 5 -- m0608 state F + +public section + +theorem is_not_halt : IsNotHalt target := by + exact Counter.does_not_halt_of_conj_stem + (M_tgt := target) + (M_src := BusyBeaver.M_1RB0LB_1LC1LB_1RD1LA_0RE0RE_0RA1RF_HHH1RD.target) + (σ := stateMap_m0608) (f := true) + (c₁ := (default : ListBlank (Fin 2)) {{1}}> default) + (by decide) (Counter.init_reaches_conjCfg_default rfl) + BusyBeaver.M_1RB0LB_1LC1LB_1RD1LA_0RE0RE_0RA1RF_HHH1RD.is_not_halt_from_0608 + +end + +end BusyBeaver.M_1RB1RA_1LC1RE_0LD0LD_0LE1LF_1LA0RA_HHH1LC diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RA_1RC0RA_1LD0LA_1LE0LD_1LF0LB_1REHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RA_1RC0RA_1LD0LA_1LE0LD_1LF0LB_1REHHH.lean new file mode 100644 index 00000000..14095de2 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RA_1RC0RA_1LD0LA_1LE0LD_1LF0LB_1REHHH.lean @@ -0,0 +1,2936 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1RA_1RC0RA_1LD0LA_1LE0LD_1LF0LB_1REHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RA_1RC0RA_1LD0LA_1LE0LD_1LF0LB_1REHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 80000000 +set_option maxRecDepth 200000 +@[simp] theorem zMz (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : HalfTape).head = 0 := rfl +@[simp] theorem zDt : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem zPs {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem zPt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,by omega,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ + + +@[simp] theorem lb_append_nil (s : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> s = s := rfl +@[simp] theorem lb_append_cons (a : Fin 2) (l : List (Fin 2)) (s : ListBlank (Fin 2)) : + (a :: l) +> s = a >> (l +> s) := rfl + +def lbApp : List (Fin 2) → ListBlank (Fin 2) → ListBlank (Fin 2) + | [], s => s + | a :: as, s => a >> lbApp as s + +inductive CHead where + | H (v : Fin 2) + | L + | R + +def toCfg (q : Fin 6) (hd : CHead) (wl : List (Fin 2)) (l : ListBlank (Fin 2)) (wr : List (Fin 2)) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + match hd with + | .H v => ⟨some q, ⟨v, lbApp wl l, lbApp wr r⟩⟩ + | .L => (lbApp wl l) <{{q}} (lbApp wr r) + | .R => (lbApp wl l) {{q}}> (lbApp wr r) + +def normHead (bl br : Bool) (hd : CHead) (wl wr : List (Fin 2)) : Option (Fin 2 × List (Fin 2) × List (Fin 2)) := + match hd with + | .H v => some (v, wl, wr) + | .L => match wl with + | a :: wl' => some (a, wl', wr) + | [] => if bl then some (0, [], wr) else none + | .R => match wr with + | b :: wr' => some (b, wl, wr') + | [] => if br then some (0, wl, []) else none + +def cstep1 (bl br : Bool) : (Fin 6 × CHead × List (Fin 2) × List (Fin 2)) → Option (Fin 6 × CHead × List (Fin 2) × List (Fin 2)) + | (q, hd, wl, wr) => + match normHead bl br hd wl wr with + | none => none + | some (v, wl1, wr1) => + match target_tm q v with + | some (some q', Stmt.write w Dir.right) => some (q', .R, w :: wl1, wr1) + | some (some q', Stmt.write w Dir.left) => some (q', .L, wl1, w :: wr1) + | _ => none + +def csteps (bl br : Bool) : Nat → (Fin 6 × CHead × List (Fin 2) × List (Fin 2)) → Option (Fin 6 × CHead × List (Fin 2) × List (Fin 2)) + | 0, st => some st + | n + 1, st => match cstep1 bl br st with + | some st' => csteps bl br n st' + | none => none + +theorem normHead_sound (bl br : Bool) (q : Fin 6) (l r : ListBlank (Fin 2)) + (hl : bl = true → l = default) (hr : br = true → r = default) + (hd : CHead) (wl wr : List (Fin 2)) (v : Fin 2) (wl1 wr1 : List (Fin 2)) + (h : normHead bl br hd wl wr = some (v, wl1, wr1)) : + toCfg q hd wl l wr r = toCfg q (.H v) wl1 l wr1 r := by + cases hd with + | H v0 => + cases h; rfl + | L => + cases wl with + | cons a wl' => + cases h + simp only [toCfg, lbApp, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] + | nil => + cases bl with + | false => cases h + | true => + cases h; rw [hl rfl] + simp only [toCfg, lbApp, zDh, zDt] + | R => + cases wr with + | cons b wr' => + cases h + simp only [toCfg, lbApp, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] + | nil => + cases br with + | false => cases h + | true => + cases h; rw [hr rfl] + simp only [toCfg, lbApp, zDh, zDt] + +theorem cstep1_sound (bl br : Bool) (l r : ListBlank (Fin 2)) + (hl : bl = true → l = default) (hr : br = true → r = default) + (st st' : Fin 6 × CHead × List (Fin 2) × List (Fin 2)) + (h : cstep1 bl br st = some st') : + (toCfg st.1 st.2.1 st.2.2.1 l st.2.2.2 r) [target_tm]⊢ (toCfg st'.1 st'.2.1 st'.2.2.1 l st'.2.2.2 r) := by + rcases st with ⟨q, hd, wl, wr⟩ + dsimp only [cstep1] at h + cases hnh : normHead bl br hd wl wr with + | none => rw [hnh] at h; cases h + | some triple => + rw [hnh] at h + rcases triple with ⟨v, wl1, wr1⟩ + dsimp only at h + rw [normHead_sound bl br q l r hl hr hd wl wr v wl1 wr1 hnh] + dsimp only [step, toCfg] + cases htm : target_tm q v with + | none => rw [htm] at h; cases h + | some val => + rw [htm] at h + rcases val with ⟨oq', stmt⟩ + cases oq' with + | none => cases h + | some q' => + rcases stmt with ⟨w, dir⟩ + cases dir <;> { cases h; rfl } + +theorem csteps_sound (bl br : Bool) (l r : ListBlank (Fin 2)) + (hl : bl = true → l = default) (hr : br = true → r = default) + (n : Nat) : + ∀ st st', csteps bl br n st = some st' → + multiStep target_tm (toCfg st.1 st.2.1 st.2.2.1 l st.2.2.2 r) n = some (toCfg st'.1 st'.2.1 st'.2.2.1 l st'.2.2.2 r) := by + induction n with + | zero => intro st st' h; cases h; rfl + | succ n ih => + intro st st' h + dsimp only [csteps] at h + cases hs : cstep1 bl br st with + | none => rw [hs] at h; cases h + | some mid => + rw [hs] at h + have h1 := cstep1_sound bl br l r hl hr st mid hs + have h2 := ih mid st' h + simpa only [Nat.add_comm 1 n] using zMt target_tm _ _ _ 1 n (zSm target_tm _ _ h1) h2 + +abbrev toCfgFast := toCfg + +macro "finish" : tactic => + `(tactic| refine ⟨0, by simp <;> fail⟩) +macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt]) +macro "execute" : tactic => + `(tactic| iterate 50 (try (any_goals (first | finish | step)))) +abbrev t : BitWord := [1,1,0,0] +abbrev d0 : BitWord := [0,0] +abbrev d1 : BitWord := [1,0] +abbrev one : BitWord := [1] +abbrev lh : HalfTape := (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default +abbrev w_pre : BitWord := t ++ one +@[simp] theorem zDd : d0 +> (default : HalfTape) = default := by + simp [d0] +inductive Call where + | ch + | cj + | cp + | ca +def zCs : Call -> Fin 6 + | .ch => C + | .cj => B + | .cp => B + | .ca => C +def zCw : Call -> BitWord + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] + | .ca => [1,1,1,0,1,0] +@[irreducible] def zCR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + ((l <+ zCw c) {{zCs c}}> r) +@[irreducible] def zCL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (l <{{D}} ([0] +> r)) +abbrev w_init : BitWord := t ++ (t ++ one) +def zCf (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + zCL lh (w_init +> r) +def z04 (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l,(zCR l c r1) [target_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + z04 c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem z05 {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z06 {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem z07 {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z08 {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z09 {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0a (w : BitWord) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem z0b (ls : List Call) : Seg ls ls [] [] := by + intro r1 r2 h; exact h +theorem zSc {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases z09 h with ⟨r2,ha,hb⟩ + exact z08 (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS0 {ls1 ls2 ls3 : List Call} {w1 w2 v1 v2 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls2 ls3 v1 v2) : + Seg ls1 ls3 (w1 ++ v1) (w2 ++ v2) := by + intro r1 r2 h + rw [append_assoc,append_assoc] + exact h1 (v1 +> r1) (v2 +> r2) (h2 r1 r2 h) +theorem zS4 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc1 (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [target_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem csteps_fast (bl br : Bool) (l r : ListBlank (Fin 2)) + (hl : bl = true → l = default) (hr : br = true → r = default) + (n : Nat) (st st' : Fin 6 × CHead × List (Fin 2) × List (Fin 2)) + (h : csteps bl br n st = some st') + {c1 c2 : Cfg (Fin 2) (Fin 6)} + (hc1 : toCfgFast st.1 st.2.1 st.2.2.1 l st.2.2.2 r = c1 := by simp only [toCfgFast, toCfg, lbApp, lb_append_cons, lb_append_nil, List.cons_append, List.nil_append, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, zDh, zDt, z00, z05, zLp, z06, A, B, C, D, E, F, t, d0, d1, one, lh, w_pre, zCs, zCw, zCR, zCL, w_init, zCf, z04, Seg]) + (hc2 : toCfgFast st'.1 st'.2.1 st'.2.2.1 l st'.2.2.2 r = c2 := by simp only [toCfgFast, toCfg, lbApp, lb_append_cons, lb_append_nil, List.cons_append, List.nil_append, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, zDh, zDt, z00, z05, zLp, z06, A, B, C, D, E, F, t, d0, d1, one, lh, w_pre, zCs, zCw, zCR, zCL, w_init, zCf, z04, Seg]) + (hn : 0 < n := by decide) : + c1 [target_tm]⊢⁺ c2 := by + subst hc1; subst hc2 + refine ⟨n, hn, ?_⟩ + exact csteps_sound bl br l r hl hr n st st' h + +theorem z0c : Seg [.cp] [.ch] t (t ++ [0]) := + zS2 (mid := [1,1,0,1,0]) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 4 (1, .R, ([1, 0] : List (Fin 2)), ([1, 1, 0, 0] : List (Fin 2))) (2, .R, ([1, 1, 1, 0, 1, 0] : List (Fin 2)), ([] : List (Fin 2))) rfl)) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 7 (3, .L, ([1, 1, 0, 1, 0] : List (Fin 2)), ([0] : List (Fin 2))) (3, .L, ([] : List (Fin 2)), ([0, 1, 1, 0, 0, 0] : List (Fin 2))) rfl)) +theorem z0d : Seg [.cj] [.ch] t (t ++ one) := + zS2 (mid := [1,1,0,1,1]) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 4 (1, .R, ([1, 1] : List (Fin 2)), ([1, 1, 0, 0] : List (Fin 2))) (2, .R, ([1, 1, 1, 0, 1, 1] : List (Fin 2)), ([] : List (Fin 2))) rfl)) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 17 (3, .L, ([1, 1, 0, 1, 1] : List (Fin 2)), ([0] : List (Fin 2))) (3, .L, ([] : List (Fin 2)), ([0, 1, 1, 0, 0, 1] : List (Fin 2))) rfl)) +theorem z0e : Seg [.ch] [.cj] (t ++ [0]) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 19 (2, .R, ([1] : List (Fin 2)), ([1, 1, 0, 0, 0] : List (Fin 2))) (1, .R, ([1, 1, 1, 0, 1, 0] : List (Fin 2)), ([] : List (Fin 2))) rfl)) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 6 (3, .L, ([1, 0, 1, 0] : List (Fin 2)), ([0] : List (Fin 2))) (3, .L, ([] : List (Fin 2)), ([0, 1, 1, 0, 0] : List (Fin 2))) rfl)) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 9 (2, .R, ([1] : List (Fin 2)), ([1, 1, 0, 0, 1] : List (Fin 2))) (1, .R, ([1, 1, 1, 0, 1, 1] : List (Fin 2)), ([] : List (Fin 2))) rfl)) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 8 (3, .L, ([1, 0, 1, 1] : List (Fin 2)), ([0] : List (Fin 2))) (2, .R, ([1, 1, 0, 1, 0] : List (Fin 2)), ([] : List (Fin 2))) rfl)) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 6 (3, .L, ([1, 0, 1, 0] : List (Fin 2)), ([0] : List (Fin 2))) (3, .L, ([] : List (Fin 2)), ([0, 1, 1, 0, 0] : List (Fin 2))) rfl)) +theorem z0f : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 6 (2, .R, ([1] : List (Fin 2)), ([1, 1, 0, 0] : List (Fin 2))) (2, .R, ([1, 1, 0, 1, 1] : List (Fin 2)), ([] : List (Fin 2))) rfl)) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 8 (3, .L, ([1, 0, 1, 1] : List (Fin 2)), ([0] : List (Fin 2))) (2, .R, ([1, 1, 0, 1, 0] : List (Fin 2)), ([] : List (Fin 2))) rfl)) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 6 (3, .L, ([1, 0, 1, 0] : List (Fin 2)), ([0] : List (Fin 2))) (3, .L, ([] : List (Fin 2)), ([0, 1, 1, 0, 0] : List (Fin 2))) rfl)) +theorem z0g : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 11 (1, .R, ([1, 0] : List (Fin 2)), ([1, 0, 0, 0] : List (Fin 2))) (3, .L, ([] : List (Fin 2)), ([0, 1, 1, 0, 0, 1] : List (Fin 2))) rfl)) +theorem z0h : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 16 (1, .R, ([1, 1] : List (Fin 2)), ([1, 0, 0, 0] : List (Fin 2))) (1, .R, ([1, 1, 1, 0, 1, 0] : List (Fin 2)), ([] : List (Fin 2))) rfl)) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 6 (3, .L, ([1, 0, 1, 0] : List (Fin 2)), ([0] : List (Fin 2))) (3, .L, ([] : List (Fin 2)), ([0, 1, 1, 0, 0] : List (Fin 2))) rfl)) +theorem z0i : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 4 (1, .R, ([1, 0] : List (Fin 2)), ([1, 0, 1, 0] : List (Fin 2))) (1, .R, ([1, 0, 1, 0, 1, 0] : List (Fin 2)), ([] : List (Fin 2))) rfl)) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 6 (3, .L, ([1, 0, 1, 0] : List (Fin 2)), ([0] : List (Fin 2))) (3, .L, ([] : List (Fin 2)), ([0, 1, 1, 0, 0] : List (Fin 2))) rfl)) +theorem z0j : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 4 (1, .R, ([1, 1] : List (Fin 2)), ([1, 0, 1, 0] : List (Fin 2))) (1, .R, ([1, 0, 1, 0, 1, 1] : List (Fin 2)), ([] : List (Fin 2))) rfl)) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 8 (3, .L, ([1, 0, 1, 1] : List (Fin 2)), ([0] : List (Fin 2))) (2, .R, ([1, 1, 0, 1, 0] : List (Fin 2)), ([] : List (Fin 2))) rfl)) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 6 (3, .L, ([1, 0, 1, 0] : List (Fin 2)), ([0] : List (Fin 2))) (3, .L, ([] : List (Fin 2)), ([0, 1, 1, 0, 0] : List (Fin 2))) rfl)) +theorem z0k : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 5 (1, .R, ([1, 1] : List (Fin 2)), ([0, 0] : List (Fin 2))) (3, .L, ([] : List (Fin 2)), ([0, 0, 0, 1] : List (Fin 2))) rfl)) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 2 (2, .R, ([1] : List (Fin 2)), ([0, 0, 1] : List (Fin 2))) (3, .L, ([] : List (Fin 2)), ([0, 1, 0, 1] : List (Fin 2))) rfl)) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid := [1,1]) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 7 (2, .R, ([1] : List (Fin 2)), ([1, 0, 1] : List (Fin 2))) (1, .R, ([1, 1, 1, 1] : List (Fin 2)), ([] : List (Fin 2))) rfl)) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 2 (3, .L, ([1, 1] : List (Fin 2)), ([0] : List (Fin 2))) (3, .L, ([] : List (Fin 2)), ([0, 0, 0] : List (Fin 2))) rfl)) +theorem z0l : Seg [.cj] [.cp] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 2 (1, .R, ([1, 1] : List (Fin 2)), ([1, 0] : List (Fin 2))) (1, .R, ([1, 0, 1, 1] : List (Fin 2)), ([] : List (Fin 2))) rfl)) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 2 (3, .L, ([1, 1] : List (Fin 2)), ([0] : List (Fin 2))) (3, .L, ([] : List (Fin 2)), ([0, 0, 0] : List (Fin 2))) rfl)) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 2 (2, .R, ([1] : List (Fin 2)), ([0, 0] : List (Fin 2))) (3, .L, ([] : List (Fin 2)), ([0, 1, 0] : List (Fin 2))) rfl)) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 4 (2, .R, ([1] : List (Fin 2)), ([1, 0] : List (Fin 2))) (2, .R, ([1, 1, 1] : List (Fin 2)), ([] : List (Fin 2))) rfl)) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 2 (3, .L, ([1, 1] : List (Fin 2)), ([0] : List (Fin 2))) (3, .L, ([] : List (Fin 2)), ([0, 0, 0] : List (Fin 2))) rfl)) +theorem H_T (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact z0a t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [zLp,h_eq,z07] + exact zSg z0f ih +theorem zSa {w2 : BitWord} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact z0a w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq,z07,zLp] + exact zSg hw ih +theorem z0m : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0n : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem z0o (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d0 d0 := + zSa z0m n +theorem z0p (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ n) d0 d1 := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg zH0 (zSa z0n n) +theorem z0q (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d1 d1 := + zSa z0n n +theorem z0r (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ (1 + n)) d1 d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg zH4 (zSa z0m n) +theorem z0s (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0c z0e) (H_T n) +theorem z0t (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0d zH2) (H_T n) +theorem z0u (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0g zH2) (H_T n) +theorem z0v (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0h (H_T n) +theorem z0w (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0i (H_T n) +theorem z0x (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [zLp',List.cons_append,List.nil_append] using zSg z0j (H_T n) +theorem z0y (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0k (zSg zH1 zH3) + have h1 := zSg h0 (zSa z0m n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0z (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0l (zSa z0m n) +theorem z0A : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0k zH1 +theorem z0B (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0k (zSg zH1 (zSg zH3 zH0)) + have h1 := zSg h0 (zSa z0n n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0C (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg [.cj,.ch] [.cp] d1 d1 := zSg z0l zH0 + have h1 := zSg h0 (zSa z0n n) + simpa only [zLp',List.cons_append,List.nil_append] using h1 +theorem z0D : Side [.ch] default (d1 +> default) := by + refine Side.cons (fun l => ?_) (Side.nil _) + unfold zCR zCL zCw zCs d1 + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + exact (csteps_fast false true l default (fun h => nomatch h) (by intro h; first | exact False.elim (Bool.noConfusion h) | rfl) 2 (2, .R, ([1] : List (Fin 2)), ([] : List (Fin 2))) (3, .L, ([] : List (Fin 2)), ([0, 1] : List (Fin 2))) rfl) +theorem z0E : Seg [.ca] [.ch,.ch] t ((t ++ [0]) ++ t) := + zS5 + (mid1 := [1,0,1,1,1,1,0,1,0]) + (mid2 := [1,0,1,0,1,1,0,1,0]) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 6 (2, .R, ([1, 1, 1, 0, 1, 0] : List (Fin 2)), ([1, 1, 0, 0] : List (Fin 2))) (2, .R, ([1, 1, 0, 1, 1, 1, 1, 0, 1, 0] : List (Fin 2)), ([] : List (Fin 2))) rfl)) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 8 (3, .L, ([1, 0, 1, 1, 1, 1, 0, 1, 0] : List (Fin 2)), ([0] : List (Fin 2))) (2, .R, ([1, 1, 0, 1, 0, 1, 1, 0, 1, 0] : List (Fin 2)), ([] : List (Fin 2))) rfl)) + (fun l r => by exact (csteps_fast false false l r (fun h => nomatch h) (fun h => nomatch h) 13 (3, .L, ([1, 0, 1, 0, 1, 1, 0, 1, 0] : List (Fin 2)), ([0] : List (Fin 2))) (3, .L, ([] : List (Fin 2)), ([0, 1, 1, 0, 0, 0, 1, 1, 0, 0] : List (Fin 2))) rfl)) +theorem z0F : Seg [.ca,.ch] ([.cj] ++ [.ch] ^ 5) w_init (w_init ++ t) := by + have h1a : Seg [.ch,.ch] [.cj,.ch,.ch,.ch] (t ++ one) t := + zSg zH2 z0f + have h1 : Seg [.ca] [.cj,.ch,.ch,.ch] (t ++ (t ++ one)) (((t ++ [0]) ++ t) ++ t) := + zS0 z0E h1a + have h2 : Seg [.ch] [.ch,.ch] (((t ++ [0]) ++ t) ++ t) ((t ++ (t ++ one)) ++ t) := + zS0 (zS0 z0e z0d) z0f + exact zSg h1 h2 +theorem z0G (r : HalfTape) : + (zCL lh r) [target_tm]⊢⁺ (zCR ([1] +> default) .ca r) := by + unfold zCL zCR lh zCw zCs + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + exact (csteps_fast true false default r (by intro h; first | exact False.elim (Bool.noConfusion h) | rfl) (fun h => nomatch h) 18 (3, .L, ([1, 0, 1] : List (Fin 2)), ([0] : List (Fin 2))) (2, .R, ([1, 1, 1, 0, 1, 0, 1, 0] : List (Fin 2)), ([] : List (Fin 2))) rfl) +theorem z0H (r : HalfTape) : + (zCL ([1] +> default) r) [target_tm]⊢⁺ (zCR lh .ch r) := by + unfold zCL zCR lh zCw zCs + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + exact (csteps_fast true false default r (by intro h; first | exact False.elim (Bool.noConfusion h) | rfl) (fun h => nomatch h) 10 (3, .L, ([1] : List (Fin 2)), ([0] : List (Fin 2))) (2, .R, ([1, 1, 0, 1, 0] : List (Fin 2)), ([] : List (Fin 2))) rfl) +open WordCalculus Word +local notation "WordList" => List Word +theorem loc_z1L {n : Nat} {ds : WordList} {A H B : Nat} + (hD : DigitVal A H ds) (hSum : A + n = B + 2 ^ H) (hBound : B < 2 ^ H) : + ∃ v,DigitVal B H v /\ WordEffect n (ds ++ [Q]) 1 (v ++ [K]) := by + rcases exists_wordEffect ds n with ⟨b,v,hE⟩ + rcases wordEffect_digitVal hE hD with ⟨C,hV,hEq⟩ + have hCb := lt_pow_of_digitVal hV + have hb1 : b = 1 := by + rcases b with _ | _ | b' + · omega + · rfl + · rw [Nat.add_mul,Nat.add_mul,Nat.one_mul] at hEq + omega + subst hb1 + have hCB : C = B := by omega + subst hCB + exact ⟨v,hV,wordEffect_append hE (@WordEffect.d11 0 [] 1 [] (WordEffect.nil 1))⟩ +theorem loc_z1M {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ((1 + n : Nat) : Rat) <= ((1 + b : Nat) : Rat) * wordScale u /\ + ((1 + b : Nat) : Rat) * wordScale u <= ((1 + n : Nat) : Rat) + 2 * wordMass u := by + have hBud := wordEffect_budget_eq hI + have hW := wordEffect_preserves_scale_and_mass hI + have hSu := wordMass_eq_add u + have hSv := wordMass_eq_add v + have hNu := wordMass_nonneg u + have hNv := wordMass_nonneg v + refine ⟨by linarith,by linarith⟩ +theorem loc_z1N (u : WordList) (A H : Nat) (ds : WordList) + (hD : DigitVal A H ds) + (hHeight : wordScale u * ((2 ^ H : Nat) : Rat) = 1) + (hCut : notEndsWithQ u = true) + (hNe : u ≠ []) + (hBound : wordMass u + wordScale u * (1 + wordMassK ds) <= 1 / 128) : + ∃ k v a b,PhaseScan 12 (u ++ ds ++ [K]) k v a b /\ 4 < k := by + have hWu := wordMass_nonneg u + have hWd := wordMass_nonneg ds + have hSu := wordScale_pos u + have hEx_in : 8 * wordMass u < ((6 * 2 : Nat) : Rat) - 4 := by + push_cast; nlinarith + rcases exists_phaseScan_of_mass_lt u 6 hEx_in with ⟨k,v,a,b,hI,hK⟩ + rcases phaseScan_even_out_of_notEndsWithQ hI hCut hNe with ⟨n,rfl⟩ + have hBudget := phaseScan_budget_eq hI + have hLoss := phaseScan_loss_bounds hI + have hSv := phaseScan_scale_le hI + have hPv := wordScale_pos v + have hCarry : 7 < (((n * 2 : Nat) : Rat) - 4) * wordScale v := by + push_cast at hBudget ⊢; nlinarith + rcases digitVal_scale_and_mass hD with ⟨hSd,hMd,_⟩ + have hRest : 2 * (wordMass (ds ++ [K]) + wordMassK (ds ++ [K])) * wordScale v < 7 := by + rw [wordMass_append,wordMassK_append] + dsimp [wordMass,wordMassK] + have h1 : wordScale u * wordMassK ds <= 1 / 128 := by nlinarith + have h2 : wordScale u * wordScale ds = 1 := by rwa [hSd] + have h3 : wordScale v * wordScale ds <= 1 := by nlinarith + have h4 : wordScale v * wordMass ds <= 1 := by nlinarith + have h5 : wordScale v * wordMassK ds <= 1 / 128 := by nlinarith + nlinarith + have hTail1 : 2 * (wordMass (ds ++ [K]) + wordMassK (ds ++ [K])) < ((n * 2 : Nat) : Rat) := by + nlinarith + have hTail2 : 8 * (1 + 2 * wordMassK ds) < ((n * 2 : Nat) : Rat) - 4 := by + have h1 : wordScale v * wordMassK ds <= 1 / 128 := by nlinarith + have h2 : 8 * (1 + 2 * wordMassK ds) * wordScale v < 1 := by nlinarith + nlinarith + rcases scan_tailDefect_step_bound (ds ++ [K]) (wordMassK ds) n (tailDefect_append_K_of_digitVal hD) hTail1 hTail2 + with ⟨k',w,c,d,hJ,hK'⟩ + rcases phaseScan_append hI hJ with ⟨a',b',hIJ,_,_⟩ + refine ⟨k',v ++ w,a',b',?_,hK'⟩ + simpa [List.append_assoc] using hIJ +theorem loc_z1O (n : Nat) : (0 : Rat) < ((2 ^ n : Nat) : Rat) := by + exact_mod_cast pow_two_pos n +theorem loc_z1P (n : Nat) : + wordMass (List.replicate n V) = 0 /\ + wordScale (List.replicate n V) * ((2 ^ n : Nat) : Rat) = 1 := by + induction n with + | zero => simp [wordMass,wordScale] + | succ n ih => + dsimp [List.replicate,wordMass,wordScale] + refine ⟨by linarith [ih.1],?_⟩ + have hpow : ((2 ^ (n + 1) : Nat) : Rat) = ((2 ^ n : Nat) : Rat) * 2 := by + rw [Nat.pow_succ]; push_cast; ring + rw [hpow] + linarith [ih.2] +theorem loc_z1Q (n : Nat) (x : Rat) : + wordScale (List.replicate n V) * x * ((2 ^ n : Nat) : Rat) = x := by + have h := (loc_z1P n).2 + calc wordScale (List.replicate n V) * x * ((2 ^ n : Nat) : Rat) + _ = x * (wordScale (List.replicate n V) * ((2 ^ n : Nat) : Rat)) := by ring + _ = x * 1 := by rw [h] + _ = x := by ring +theorem loc_z1R {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) : + ∀ (p q : WordList),u = p ++ q -> SplitCond p q -> + ∃ c x y s t0,Scan a p c x s /\ Scan c q b y t0 /\ + v = x ++ y /\ l = s + wordScale x * t0 := by + induction h with + | nil k => + intro p q hE _ + cases p with + | nil => + simp at hE; subst hE + exact ⟨k,[],[],0,0,Scan.nil k,Scan.nil k,rfl,by simp [wordScale]⟩ + | cons _ _ => simp at hE + | T hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,_,Scan.nil _,Scan.T hI,rfl,by simp [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + rcases ih p q hE (splitCond_of_cons V p q hP) with ⟨c,x,y,s1,t1,hJ,hK,rfl,hL⟩ + exact ⟨c,V :: x,y,s1 * (1 / 2),t1,Scan.T hJ,hK,rfl,by dsimp [wordScale]; rw [hL]; ring⟩ + | pair0 hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,_,Scan.nil _,Scan.pair0 hI,rfl,by simp [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + cases p with + | nil => + simp at hE; subst hE + rcases hP with hP | ⟨r,hP⟩ <;> nomatch hP + | cons s2 p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + have hP' := splitCond_of_cons K p q (splitCond_of_cons Q (K :: p) q hP) + rcases ih p q hE hP' with ⟨c,x,y,s1,t1,hJ,hK,rfl,hL⟩ + exact ⟨c,V :: x,y,(1 + s1) * (1 / 2),t1,Scan.pair0 hJ,hK,rfl,by dsimp [wordScale]; rw [hL]; ring⟩ + | pair1 hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,_,Scan.nil _,Scan.pair1 hI,rfl,by simp [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + cases p with + | nil => + simp at hE; subst hE + rcases hP with hP | ⟨r,hP⟩ <;> nomatch hP + | cons s2 p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + have hP' := splitCond_of_cons Q p q (splitCond_of_cons Q (Q :: p) q hP) + rcases ih p q hE hP' with ⟨c,x,y,s1,t1,hJ,hK,rfl,hL⟩ + exact ⟨c,V :: x,y,(1 / 4) + s1 * (1 / 2),t1,Scan.pair1 hJ,hK,rfl,by dsimp [wordScale]; rw [hL]; ring⟩ + | short00 hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,_,Scan.nil _,Scan.short00 hI,rfl,by simp [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + rcases ih p q hE (splitCond_of_cons K p q hP) with ⟨c,x,y,s1,t1,hJ,hK,rfl,hL⟩ + exact ⟨c,K :: x,y,1 + s1 * 2,t1,Scan.short00 hJ,hK,rfl,by dsimp [wordScale]; rw [hL]; ring⟩ + | short01 hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,_,Scan.nil _,Scan.short01 hI,rfl,by simp [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + rcases ih p q hE (splitCond_of_cons Q p q hP) with ⟨c,x,y,s1,t1,hJ,hK,rfl,hL⟩ + exact ⟨c,K :: x,y,s1 * 2,t1,Scan.short01 hJ,hK,rfl,by dsimp [wordScale]; rw [hL]; ring⟩ + | short10 hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,_,Scan.nil _,Scan.short10 hI,rfl,by simp [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + rcases ih p q hE (splitCond_of_cons K p q hP) with ⟨c,x,y,s1,t1,hJ,hK,rfl,hL⟩ + exact ⟨c,Q :: x,y,1 + s1 * 2,t1,Scan.short10 hJ,hK,rfl,by dsimp [wordScale]; rw [hL]; ring⟩ + | short11 hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,_,Scan.nil _,Scan.short11 hI,rfl,by simp [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + rcases ih p q hE (splitCond_of_cons Q p q hP) with ⟨c,x,y,s1,t1,hJ,hK,rfl,hL⟩ + exact ⟨c,Q :: x,y,s1 * 2,t1,Scan.short11 hJ,hK,rfl,by dsimp [wordScale]; rw [hL]; ring⟩ +theorem loc_z1S (r a b : Nat) (v : WordList) (l : Rat) (u : WordList) (z : Rat) + (hI : Scan a ((List.replicate (1 + r * 2) Q ++ [K]) ++ u) b v l) + (hZ : TailDefect u z) : + wordMass v * ((2 ^ (1 + r) : Nat) : Rat) <= 1 + 2 * z /\ + (l - 1 / 2) * ((2 ^ (1 + r) : Nat) : Rat) <= 1 + 2 * z := by + have hCut : SplitCond (List.replicate (1 + r * 2) Q ++ [K]) u := by + left; rw [notEndsWithQ_append_singleton]; rfl + rcases loc_z1R hI (List.replicate (1 + r * 2) Q ++ [K]) u rfl hCut + with ⟨c,x,y,s,t0,hJ,hK,rfl,hL⟩ + rcases scan_odd_Q_K_inv r a c x s hJ with ⟨rfl,_,rfl⟩ + rcases scan_tailDefect_bound hK hZ with ⟨hMy,hLy,_⟩ + rcases loc_z1P (1 + r) with ⟨hMx,hSx⟩ + have hF1 := loc_z1Q (1 + r) (wordMass y) + have hF2 := loc_z1Q (1 + r) t0 + have hPos := loc_z1O (1 + r) + rw [wordMass_append] + refine ⟨by nlinarith,by nlinarith⟩ +theorem loc_z1T (r a b : Nat) (v : WordList) (l : Rat) (u : WordList) (z : Rat) + (hI : Scan a ((List.replicate (2 + r * 2) Q ++ [K]) ++ u) b v l) + (hZ : TailDefect u z) : + (wordMass v - 1) * ((2 ^ r : Nat) : Rat) <= 1 + 2 * z /\ + (l - 1) * ((2 ^ r : Nat) : Rat) <= 1 + 2 * z := by + have hCut : SplitCond (List.replicate (2 + r * 2) Q ++ [K]) u := by + left; rw [notEndsWithQ_append_singleton]; rfl + rcases loc_z1R hI (List.replicate (2 + r * 2) Q ++ [K]) u rfl hCut + with ⟨c,x,y,s,t0,hJ,hK,rfl,hL⟩ + rcases scan_even_Q_K_inv r a c x s hJ with ⟨d,n,rfl,_,rfl⟩ + rcases scan_tailDefect_bound hK hZ with ⟨hMy,hLy,_⟩ + rcases loc_z1P (1 + r) with ⟨hMx,hSx⟩ + have hF1 := loc_z1Q (1 + r) (wordMass y) + have hF2 := loc_z1Q (1 + r) t0 + have hPos := loc_z1O r + have hWy := wordMass_nonneg y + have hPow1 : ((2 ^ (1 + r) : Nat) : Rat) = 2 * ((2 ^ r : Nat) : Rat) := by + rw [pow_two_one_add]; push_cast; ring + cases d <;> ( + dsimp [List.cons_append,wordMass,wordScale] at hL ⊢ + rw [wordMass_append] + rw [hPow1] at hF1 hF2 + refine ⟨by nlinarith,by nlinarith⟩ + ) +theorem loc_z1U (c a b : Nat) (v : WordList) (l : Rat) (u : WordList) (z : Rat) + (hI : Scan a ((List.replicate c Q ++ [K]) ++ u) b v l) + (hZ : TailDefect u z) (hC : 0 < c) : + wordMass v * ((2 ^ (c + c / 2) : Nat) : Rat) <= ((2 ^ (c + c / 2) : Nat) : Rat) + 2 * ((2 ^ c : Nat) : Rat) * (1 + 2 * z) /\ + l * ((2 ^ (c + c / 2) : Nat) : Rat) <= ((2 ^ (c + c / 2) : Nat) : Rat) + 2 * ((2 ^ c : Nat) : Rat) * (1 + 2 * z) := by + have hZn := tailDefect_nonneg hZ + rcases even_or_odd_mul_two c with ⟨a0,rfl⟩ | ⟨a0,rfl⟩ + · cases a0 with + | zero => omega + | succ r => + have heq : (r + 1) * 2 = 2 + r * 2 := by omega + rw [heq] at hI ⊢ + rcases loc_z1T r a b v l u z hI hZ with ⟨hM,hL⟩ + have hP : 2 + r * 2 + (2 + r * 2) / 2 = (2 + r * 2) + r + 1 := by omega + have hPow : ((2 ^ (2 + r * 2 + (2 + r * 2) / 2) : Nat) : Rat) = + ((2 ^ (2 + r * 2) : Nat) : Rat) * ((2 ^ r : Nat) : Rat) * 2 := by + rw [hP,Nat.pow_add,Nat.pow_add] + push_cast; ring + have hp1 := loc_z1O (2 + r * 2) + have hp2 := loc_z1O r + rw [hPow] + refine ⟨by nlinarith,by nlinarith⟩ + · rcases loc_z1S a0 a b v l u z hI hZ with ⟨hM,hL⟩ + have hP : 1 + a0 * 2 + (1 + a0 * 2) / 2 = (1 + a0 * 2) + a0 := by omega + have hPow : ((2 ^ (1 + a0 * 2 + (1 + a0 * 2) / 2) : Nat) : Rat) = + ((2 ^ (1 + a0 * 2) : Nat) : Rat) * ((2 ^ a0 : Nat) : Rat) := by + rw [hP,Nat.pow_add]; push_cast; ring + have hPow1 : ((2 ^ (1 + a0) : Nat) : Rat) = 2 * ((2 ^ a0 : Nat) : Rat) := by + rw [pow_two_one_add]; push_cast; ring + rw [hPow1] at hM hL + have hp1 := loc_z1O (1 + a0 * 2) + have hp2 := loc_z1O a0 + rw [hPow] + refine ⟨by nlinarith,by nlinarith⟩ +theorem loc_z1V (c : Nat) : + ∀ (u : WordList) (z : Rat),TailDefect (List.replicate c Q ++ u) z -> + ∃ z',TailDefect u z' /\ z = ((2 ^ c : Nat) : Rat) * z' := by + induction c with + | zero => + intro u z hI + exact ⟨z,hI,by simp⟩ + | succ c ih => + intro u z hI + dsimp [List.replicate] at hI + rcases tailDefect_cons_Q_inv hI with ⟨y,hJ,rfl⟩ + rcases ih u y hJ with ⟨x,hK,rfl⟩ + refine ⟨x,hK,?_⟩ + rw [Nat.pow_succ]; push_cast; ring +theorem loc_z1W (x z p q : Rat) (hp : 0 < p) (hpq : p <= q) (hz : 0 <= z) + (h : x * q <= q + 2 * z) : x * p <= p + 2 * z := by + rcases le_or_gt x 1 with hle | hgt + · nlinarith + · nlinarith +theorem loc_z1X (s c : Nat) (u : WordList) (A H a b : Nat) (v : WordList) (l : Rat) + (hD : DigitVal A H (List.replicate c Q ++ K :: u)) + (hI : Scan a ((List.replicate c Q ++ K :: u) ++ [K]) b v l) + (hC : 0 < c) (hSC : s <= c) : + wordMass v * ((2 ^ (s + s / 2) : Nat) : Rat) <= ((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK (List.replicate c Q ++ K :: u) /\ + l * ((2 ^ (s + s / 2) : Nat) : Rat) <= ((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK (List.replicate c Q ++ K :: u) := by + have hZ := tailDefect_append_K_of_digitVal hD + rw [List.append_assoc] at hZ + rcases loc_z1V c (K :: u ++ [K]) (wordMassK (List.replicate c Q ++ K :: u)) hZ with ⟨x,hU,hX⟩ + rcases tailDefect_cons_K_inv hU with ⟨hNil,_⟩ | ⟨z,hV,rfl⟩ + · simp at hNil + · have hE : (List.replicate c Q ++ K :: u) ++ [K] = + (List.replicate c Q ++ [K]) ++ (u ++ [K]) := by + simp [List.append_assoc] + rw [hE] at hI + rcases loc_z1U c a b v l (u ++ [K]) z hI hV hC with ⟨hM,hL⟩ + have hPos := loc_z1O (s + s / 2) + have hMono_nat : 2 ^ (s + s / 2) <= 2 ^ (c + c / 2) := + Nat.pow_le_pow_right (by decide) (by omega) + have hMono : ((2 ^ (s + s / 2) : Nat) : Rat) <= ((2 ^ (c + c / 2) : Nat) : Rat) := by + exact_mod_cast hMono_nat + have hW := (wordMass_nonneg (List.replicate c Q ++ K :: u)).2.1 + refine ⟨loc_z1W (wordMass v) (wordMassK (List.replicate c Q ++ K :: u)) _ _ hPos hMono hW (by linarith), + loc_z1W l (wordMassK (List.replicate c Q ++ K :: u)) _ _ hPos hMono hW (by linarith)⟩ +theorem loc_z1Y (s : Nat) (ds : WordList) (A H k k' : Nat) (v : WordList) (a b : Rat) + (hD : DigitVal A H ds) + (hI : PhaseScan k (ds ++ [K]) k' v a b) + (hLow : ∃ c u,(0 < c /\ s <= c) /\ ds = List.replicate c Q ++ K :: u) : + wordMass v * ((2 ^ (s + s / 2) : Nat) : Rat) <= ((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK ds /\ + a * ((2 ^ (s + s / 2) : Nat) : Rat) <= 4 * (((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK ds) /\ + b * ((2 ^ (s + s / 2) : Nat) : Rat) <= 3 * (((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK ds) := by + rcases hLow with ⟨c,u,⟨hC,hSC⟩,rfl⟩ + have hFull := digitVal_append hD (DigitVal.zero DigitVal.nil) + rcases phaseScan_digitVal_loss_bound hI hFull with ⟨l,hJ,hP,hN⟩ + rcases loc_z1X s c u A H k k' v l hD hJ hC hSC with ⟨hM,hL⟩ + have hPos := loc_z1O (s + s / 2) + refine ⟨hM,by nlinarith,by nlinarith⟩ +theorem loc_z1Z (r J k b A B : Nat) + (hR : r <= J) + (hK : ∃ n,k = n * 2 ^ r) + (hB : ∃ n,1 + b = n * 2 ^ r) + (hAsum : A + 2 ^ J = k) + (hBsum : B + 2 ^ J = A + b) : + ∃ n,1 + B = n * 2 ^ r := by + rcases hK with ⟨n,rfl⟩ + rcases hB with ⟨m,hM⟩ + have hP : 2 ^ J = 2 ^ (J - r) * 2 ^ r := by + rw [<- Nat.pow_add,Nat.sub_add_cancel hR] + refine ⟨n + m - 2 * 2 ^ (J - r),?_⟩ + rw [Nat.sub_mul,Nat.add_mul] + have h2 : 2 * 2 ^ (J - r) * 2 ^ r = 2 ^ J + 2 ^ J := by + calc 2 * 2 ^ (J - r) * 2 ^ r + _ = 2 * (2 ^ (J - r) * 2 ^ r) := by ring + _ = 2 * 2 ^ J := by rw [<- hP] + _ = 2 ^ J + 2 ^ J := by ring + omega +theorem loc_z20 (s : Nat) : + ∀ (B H : Nat) (ds : WordList), + DigitVal B H ds -> s <= H -> (∃ n,1 + B = n * 2 ^ s) -> + ∃ u,ds = List.replicate s Q ++ u := by + induction s with + | zero => + intro B H ds _ _ _ + exact ⟨ds,rfl⟩ + | succ s ih => + intro B H ds hD hSH ⟨n,hN⟩ + have hN2 : 1 + B = (n * 2 ^ s) * 2 := by rw [Nat.pow_succ] at hN; linarith + cases hD with + | nil => omega + | zero _ => omega + | @one A' H' u' hSub => + rcases ih A' H' u' hSub (by omega) ⟨n,by omega⟩ with ⟨w,rfl⟩ + exact ⟨w,rfl⟩ +theorem loc_z21 (p : Nat) : + ∀ (n : Nat) (u : WordList) (b : Nat) (v : WordList), + WordEffect n (List.replicate p V ++ u) b v -> + ∃ q w,v = List.replicate p V ++ w /\ 1 + q = (1 + n) * 2 ^ p /\ WordEffect q u b w := by + induction p with + | zero => + intro n u b v hI + exact ⟨n,v,rfl,by simp,hI⟩ + | succ p ih => + intro n u b v hI + dsimp [List.replicate] at hI + cases hI with + | T hSub => + rcases ih (1 + n * 2) u b _ hSub with ⟨q,w,rfl,hEq,hJ⟩ + refine ⟨q,w,rfl,?_,hJ⟩ + rw [Nat.pow_succ]; ring_nf at hEq ⊢; omega +theorem loc_z22 (n : Nat) (w : Word) : + List.replicate (1 + n) w = w :: List.replicate n w := by + rw [Nat.add_comm 1 n,List.replicate_succ] +theorem loc_z23 (p : Nat) (u : WordList) (b : Nat) (v : WordList) + (hI : WordEffect 0 (List.replicate (1 + p) V ++ Q :: u) b v) : + ∃ w,v = List.replicate (1 + p) V ++ K :: w /\ WordEffect (2 ^ p) u b w := by + rcases loc_z21 (1 + p) 0 (Q :: u) b v hI with ⟨q,w0,rfl,hEq,hJ⟩ + have hp := pow_two_pos p + have hpow : 2 ^ (1 + p) = 2 ^ p + 2 ^ p := pow_two_one_add p + generalize hq0 : q = q0 at hJ + generalize hu0 : Q :: u = u0 at hJ + cases hJ with + | nil _ => nomatch hu0 + | T _ => nomatch hu0 + | d00 _ => nomatch hu0 + | d01 _ => nomatch hu0 + | d10 _ => omega + | @d11 m u' _ w hSub => + injection hu0 with _ hu'; subst hu' + have hm : 1 + m = 2 ^ p := by omega + rw [hm] at hSub + exact ⟨w,rfl,hSub⟩ +theorem loc_z24 (p : Nat) (u : WordList) (k : Nat) (v : WordList) (a b : Rat) + (hI : PhaseScan 12 (List.replicate p V ++ K :: u) k v a b) : + ∃ w a' b',v = List.replicate p V ++ Q :: w /\ + PhaseScan (4 * 2 ^ p) u k w a' b' /\ + a = wordScale (List.replicate p V) * (4 + 2 * a') /\ + b = wordScale (List.replicate p V) * (2 * b') := by + rcases phaseScan_split_of_splitCond hI (List.replicate p V) (K :: u) rfl (Or.inl (notEndsWithQ_replicate_V p)) + with ⟨m,x,y,a1,b1,a2,b2,hJ,hK,rfl,hA,hB⟩ + rcases phaseScan_replicate_V_inv p 12 m x a1 b1 hJ with ⟨rfl,hEq,rfl,rfl⟩ + have hp := pow_two_pos p + generalize hm0 : m = m0 at hK + generalize hu0 : K :: u = u0 at hK + cases hK with + | nil _ => nomatch hu0 + | T _ => nomatch hu0 + | pair0 _ => nomatch hu0 + | pair1 _ => nomatch hu0 + | short01 _ => nomatch hu0 + | short11 _ => nomatch hu0 + | short00 _ => omega + | @short10 n u' _ w a' b' hSub => + injection hu0 with _ hu'; subst hu' + have hn : n * 2 = 4 * 2 ^ p := by omega + rw [hn] at hSub + refine ⟨w,a',b',rfl,hSub,by linarith,by linarith⟩ +theorem loc_z25 (r k : Nat) (u : WordList) (k' : Nat) (v : WordList) (a b : Rat) + (carry : Nat) (eff : WordList) (A B J : Nat) (ds : WordList) + (hI : PhaseScan k (u ++ List.replicate (1 + r * 2) Q ++ [K]) k' v a b) + (hE : WordEffect 0 (V :: (v ++ [V])) carry eff) + (hD : DigitVal B J ds) (hR : 1 + r <= J) + (hAsum : A + 2 ^ J = k') (hBsum : B + 2 ^ J = A + carry) : + ∃ w,ds = List.replicate (1 + r) Q ++ w := by + rcases phaseScan_append_odd_Q_K_inv r k u k' v a b hI with ⟨w,n,rfl,hK⟩ + have hEq : V :: ((w ++ List.replicate (1 + r) V) ++ [V]) = + (V :: w) ++ List.replicate (2 + r) V := by + have h1 : 2 + r = (1 + r) + 1 := by omega + rw [h1,replicate_succ_append]; simp [List.append_assoc] + rw [hEq] at hE + rcases wordEffect_append_replicate_V_inv (V :: w) (2 + r) 0 carry eff hE with ⟨x,m,_,hC⟩ + apply loc_z20 (1 + r) B J ds hD hR + refine loc_z1Z (1 + r) J k' carry A B hR ⟨n,hK⟩ ⟨m * 2,?_⟩ hAsum hBsum + have h2 : 2 + r = (1 + r) + 1 := by omega + rw [h2,Nat.pow_succ] at hC + linarith +theorem loc_z26 (x p q s f : Rat) (hp : 0 < p) (hs : 0 <= s) + (h1 : x * p <= q) (h2 : s * q <= f * p) : s * x <= f := by + nlinarith +theorem loc_z27 (s : Nat) (ds : WordList) (A H k k' : Nat) (v : WordList) (a b sigma f : Rat) + (hD : DigitVal A H ds) (hI : PhaseScan k (ds ++ [K]) k' v a b) + (hLow : ∃ c u,(0 < c /\ s <= c) /\ ds = List.replicate c Q ++ K :: u) + (hSig : 0 <= sigma) + (hBound : sigma * (((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK ds) <= f * ((2 ^ (s + s / 2) : Nat) : Rat)) : + sigma * wordMass v <= f /\ sigma * a <= 4 * f /\ sigma * b <= 3 * f := by + rcases loc_z1Y s ds A H k k' v a b hD hI hLow with ⟨hM,hP,hN⟩ + have hPos := loc_z1O (s + s / 2) + refine ⟨loc_z26 (wordMass v) _ _ sigma f hPos hSig hM hBound, + loc_z26 a _ _ sigma (4 * f) hPos hSig hP (by linarith), + loc_z26 b _ _ sigma (3 * f) hPos hSig hN (by linarith)⟩ +theorem le_of_mul_le_mul_pos_right {a b u : Rat} (hu : 0 < u) (h : a * u <= b * u) : a <= b := by + by_contra hlt + have : b < a := not_le.mp hlt + nlinarith +theorem lt_of_mul_lt_mul_pos_right {a b u : Rat} (hu : 0 < u) (h : a * u < b * u) : a < b := by + by_contra hle + have : b <= a := not_lt.mp hle + nlinarith +theorem loc_z28 (a b : Nat) : ((2 ^ (a + b) : Nat) : Rat) = ((2 ^ a : Nat) : Rat) * ((2 ^ b : Nat) : Rat) := by + rw [Nat.pow_add,Nat.cast_mul] +theorem loc_z29 : ((2 ^ 2 : Nat) : Rat) = 4 := by norm_num +theorem loc_z2a : ((2 ^ 10 : Nat) : Rat) = 1024 := by norm_num +theorem loc_z2b (p : Nat) (u ds : WordList) (A H k : Nat) (v : WordList) (a b : Rat) (s : Nat) (e f : Rat) + (hI : PhaseScan 12 (List.replicate p V ++ K :: (u ++ ds ++ [K])) k v a b) + (hD : DigitVal A H ds) (hCut : notEndsWithQ u = true) + (hLow : ∃ c w,(0 < c /\ s <= c) /\ ds = List.replicate c Q ++ K :: w) + (hError : e = 2 * wordScale (List.replicate p V) * wordMass u) + (hBound : (2 * wordScale (List.replicate p V) * wordScale u) * (((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK ds) <= f * ((2 ^ (s + s / 2) : Nat) : Rat)) : + ∃ w,v = List.replicate p V ++ Q :: w /\ + wordMass (V :: (v ++ [V])) <= wordScale (List.replicate p V) * (1 / 2) + (e + f) * (1 / 2) /\ + 4 * wordScale (List.replicate p V) - e * (1 / 4) - 3 * f <= a - b /\ + a - b <= 4 * wordScale (List.replicate p V) + 4 * e + 4 * f := by + rcases loc_z24 p (u ++ ds ++ [K]) k v a b hI with ⟨w,c,d,rfl,hJ,hPos,hNeg⟩ + have hEq_u : u ++ ds ++ [K] = u ++ (ds ++ [K]) := by simp [List.append_assoc] + rw [hEq_u] at hJ + rcases phaseScan_split_of_splitCond hJ u (ds ++ [K]) rfl (Or.inl hCut) + with ⟨m,x,y,a1,b1,a2,b2,hK,hL,rfl,hC,hDlt⟩ + have hBounds := phaseScan_loss_bounds hK + have hTailBounds := phaseScan_loss_bounds hL + have hScale := phaseScan_scale_le hK + have hSu := wordScale_pos u + have hSx := wordScale_pos x + have hSp := wordScale_pos (List.replicate p V) + have hWds := wordMass_nonneg ds + have hPow := loc_z1O (s + s / 2) + have h1 : 2 * wordScale (List.replicate p V) * wordScale x <= 2 * wordScale (List.replicate p V) * wordScale u := by nlinarith + have h2 : 0 <= ((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK ds := by linarith + have hF : (2 * wordScale (List.replicate p V) * wordScale x) * (((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK ds) <= + f * ((2 ^ (s + s / 2) : Nat) : Rat) := by + nlinarith + rcases loc_z27 s ds A H m k y a2 b2 (2 * wordScale (List.replicate p V) * wordScale x) f hD hL hLow (by positivity) hF + with ⟨hMt,hPt,hNt⟩ + have hPa : 0 <= (2 * wordScale (List.replicate p V) * wordScale x) * a2 := by + have : 0 <= a2 := hTailBounds.2.1 + positivity + have hPb : 0 <= (2 * wordScale (List.replicate p V) * wordScale x) * b2 := by + have : 0 <= b2 := hTailBounds.2.2.2.1 + positivity + have hA1 : 0 <= 2 * wordScale (List.replicate p V) * a1 := by + have : 0 <= a1 := hBounds.2.1 + positivity + have hA1u : 2 * wordScale (List.replicate p V) * a1 <= 4 * e := by + have : a1 <= 4 * wordMass u := hBounds.2.2.1 + nlinarith + have hB1 : 0 <= 2 * wordScale (List.replicate p V) * b1 := by + have : 0 <= b1 := hBounds.2.2.2.1 + positivity + have hB1u : 2 * wordScale (List.replicate p V) * b1 <= e * (1 / 4) := by + have : b1 <= wordMass u * (1 / 4) := hBounds.2.2.2.2 + nlinarith + have hMx : 2 * wordScale (List.replicate p V) * wordMass x <= e := by + have : wordMass x <= wordMass u := hBounds.1 + nlinarith + have hMassP := (loc_z1P p).1 + have hAb_eq : a - b = 4 * wordScale (List.replicate p V) + + 2 * wordScale (List.replicate p V) * a1 + + (2 * wordScale (List.replicate p V) * wordScale x) * a2 - + 2 * wordScale (List.replicate p V) * b1 - + (2 * wordScale (List.replicate p V) * wordScale x) * b2 := by + rw [hPos,hNeg,hC,hDlt]; ring + refine ⟨x ++ y,rfl,?_,?_,?_⟩ + · have hE1 : wordMass (V :: ((List.replicate p V ++ Q :: (x ++ y)) ++ [V])) = + wordScale (List.replicate p V) * (1 / 2) + + (2 * wordScale (List.replicate p V) * wordMass x + (2 * wordScale (List.replicate p V) * wordScale x) * wordMass y) * (1 / 2) := by + simp only [List.cons_append,List.append_assoc,wordMass,wordMass_append,wordScale,hMassP] + ring + rw [hE1] + linarith + · rw [hAb_eq]; linarith + · rw [hAb_eq]; linarith +theorem loc_z2c (p : Nat) (u : WordList) (b : Nat) (v : WordList) + (hI : WordEffect 0 (List.replicate (1 + p) V ++ Q :: u) b v) : + 2 * wordScale (List.replicate (1 + p) V) <= + ((1 + b : Nat) : Rat) * wordScale (List.replicate (1 + p) V ++ Q :: u) - 1 /\ + ((1 + b : Nat) : Rat) * wordScale (List.replicate (1 + p) V ++ Q :: u) - 1 <= + 2 * wordMass (List.replicate (1 + p) V ++ Q :: u) := by + rcases loc_z23 p u b v hI with ⟨w,rfl,hE⟩ + rcases loc_z1M hE with ⟨hLo,hHi⟩ + have hSp := wordScale_pos (List.replicate (1 + p) V) + rcases loc_z1P (1 + p) with ⟨hM,hS⟩ + have hS' : wordScale (List.replicate (1 + p) V) * (2 * ((2 ^ p : Nat) : Rat)) = 1 := by + rw [pow_two_one_add,Nat.cast_add] at hS + linarith + have htmp : ((1 + 2 ^ p : Nat) : Rat) = 1 + ((2 ^ p : Nat) : Rat) := by + rw [Nat.cast_add,Nat.cast_one] + rw [htmp] at hLo hHi + have h1 : ((1 + b : Nat) : Rat) * wordScale (List.replicate (1 + p) V ++ Q :: u) = + 2 * wordScale (List.replicate (1 + p) V) * (((1 + b : Nat) : Rat) * wordScale u) := by + rw [wordScale_append]; dsimp [wordScale]; ring + have h2 : 2 * wordMass (List.replicate (1 + p) V ++ Q :: u) = + 2 * wordScale (List.replicate (1 + p) V) * (1 + 2 * wordMass u) := by + rw [wordMass_append,hM]; dsimp [wordMass]; ring + rw [h1,h2] + refine ⟨by nlinarith,by nlinarith⟩ +theorem loc_z2d (alpha e f unit delta R e' : Rat) + (_ : 0 < alpha) (_ : 0 <= e) (_ : 0 <= f) (_ : 0 <= unit) + (_ : e <= alpha * (3 / 64)) (_ : f <= alpha * (1 / 128)) (_ : unit <= alpha * (1 / 1024)) + (_ : 0 <= e') (_ : e' <= (e + f) * (1 / 2)) (_ : alpha <= R) (_ : R <= alpha + 2 * e') + (_ : 4 * alpha - e * (1 / 4) - 3 * f <= delta) (_ : delta <= 4 * alpha + 4 * e + 4 * f) : + (3 / 4) * alpha <= delta * (1 / 2) - 4 * unit - R /\ + delta * (1 / 2) - 4 * unit - R <= (5 / 4) * alpha := by + exact ⟨by linarith,by linarith⟩ +theorem loc_z2e {u : WordList} {k : Nat} {v : WordList} {a b : Rat} + (hI : PhaseScan 12 u k v a b) : + (k : Rat) * wordScale (V :: (v ++ [V])) = + 2 + 4 * wordScale (V :: (v ++ [V])) - (a - b) * (1 / 2) := by + have hEq := phaseScan_budget_eq hI + push_cast at hEq + dsimp [wordScale] + rw [wordScale_append] + dsimp [wordScale] + linarith +theorem loc_z2f {u : WordList} {k : Nat} {v : WordList} {a b : Rat} {J A B carry : Nat} + (hI : PhaseScan 12 u k v a b) + (hHeight : wordScale (V :: (v ++ [V])) * ((2 ^ J : Nat) : Rat) = 1) + (hAsum : A + 2 ^ J = k) + (hBsum : B + 2 ^ J = A + carry) : + 1 - ((1 + B : Nat) : Rat) * wordScale (V :: (v ++ [V])) = + (a - b) * (1 / 2) - 4 * wordScale (V :: (v ++ [V])) - + (((1 + carry : Nat) : Rat) * wordScale (V :: (v ++ [V])) - 1) := by + have hBudget := loc_z2e hI + have hSum : B + 2 ^ J + 2 ^ J = k + carry := by omega + have hQsum : ((B + 2 ^ J + 2 ^ J : Nat) : Rat) = ((k + carry : Nat) : Rat) := by exact_mod_cast hSum + rw [Nat.cast_add,Nat.cast_add,Nat.cast_add] at hQsum + have hQ_u : ((B : Rat) + ((2 ^ J : Nat) : Rat) + ((2 ^ J : Nat) : Rat)) * wordScale (V :: (v ++ [V])) = + ((k : Rat) + (carry : Rat)) * wordScale (V :: (v ++ [V])) := by rw [hQsum] + rw [Nat.cast_add,Nat.cast_one,Nat.cast_add,Nat.cast_one] + linarith +theorem loc_z2g (J k carry : Nat) (alpha unit delta R : Rat) + (hPos : 0 < alpha) (hSmall : alpha <= 1 / 32) (hUnit : 0 < unit) (hTiny : unit <= alpha * (1 / 1024)) + (hHeight : unit * ((2 ^ J : Nat) : Rat) = 1) + (hDl : (15 / 4) * alpha <= delta) (hDu : delta <= (17 / 4) * alpha) + (hRl : alpha <= R) (hRu : R <= (5 / 4) * alpha) + (hK : (k : Rat) * unit = 2 + 4 * unit - delta * (1 / 2)) + (hC : ((1 + carry : Nat) : Rat) * unit = 1 + R) : + ∃ A B,A + 2 ^ J = k /\ B + 2 ^ J = A + carry /\ + 2 ^ J <= A * 2 /\ A < 2 ^ J /\ 2 ^ J <= B * 2 /\ B < 2 ^ J := by + rw [Nat.cast_add,Nat.cast_one] at hC + have hH' : ((2 ^ J : Nat) : Rat) * unit = 1 := by linarith + have hK_u : ((2 ^ J : Nat) : Rat) * unit <= (k : Rat) * unit := by linarith + have hK_q : ((2 ^ J : Nat) : Rat) <= (k : Rat) := le_of_mul_le_mul_pos_right hUnit hK_u + have hKnat : 2 ^ J <= k := by exact_mod_cast hK_q + have hB_u : (((2 ^ J + 2 ^ J : Nat) : Rat)) * unit <= ((k + carry : Nat) : Rat) * unit := by + rw [Nat.cast_add,Nat.cast_add]; linarith + have hB_q : ((2 ^ J + 2 ^ J : Nat) : Rat) <= ((k + carry : Nat) : Rat) := le_of_mul_le_mul_pos_right hUnit hB_u + have hBnat : 2 ^ J + 2 ^ J <= k + carry := by exact_mod_cast hB_q + refine ⟨k - 2 ^ J,k + carry - (2 ^ J + 2 ^ J),by omega,by omega,?_,?_,?_,?_⟩ + · have hq_u : ((2 ^ J : Nat) : Rat) * unit <= (((k - 2 ^ J) * 2 : Nat) : Rat) * unit := by + rw [Nat.cast_mul,Nat.cast_sub hKnat,Nat.cast_ofNat]; linarith + have hq := le_of_mul_le_mul_pos_right hUnit hq_u + exact_mod_cast hq + · have hq_u : ((k - 2 ^ J : Nat) : Rat) * unit < ((2 ^ J : Nat) : Rat) * unit := by + rw [Nat.cast_sub hKnat]; linarith + have hq := lt_of_mul_lt_mul_pos_right hUnit hq_u + exact_mod_cast hq + · have hq_u : ((2 ^ J : Nat) : Rat) * unit <= (((k + carry - (2 ^ J + 2 ^ J)) * 2 : Nat) : Rat) * unit := by + rw [Nat.cast_mul,Nat.cast_sub hBnat,Nat.cast_add,Nat.cast_add,Nat.cast_ofNat]; linarith + have hq := le_of_mul_le_mul_pos_right hUnit hq_u + exact_mod_cast hq + · have hq_u : ((k + carry - (2 ^ J + 2 ^ J) : Nat) : Rat) * unit < ((2 ^ J : Nat) : Rat) * unit := by + rw [Nat.cast_sub hBnat,Nat.cast_add,Nat.cast_add]; linarith + have hq := lt_of_mul_lt_mul_pos_right hUnit hq_u + exact_mod_cast hq +inductive loc_Reserve : Nat -> Rat -> Prop where + | even (n : Nat) (tau : Rat) : tau * ((2 ^ n : Nat) : Rat) = 8 -> loc_Reserve (n * 2) tau + | odd (n : Nat) (tau : Rat) : tau * ((2 ^ n : Nat) : Rat) = 6 -> loc_Reserve (1 + n * 2) tau +theorem loc_z2h {p : Nat} {tau : Rat} (hI : loc_Reserve p tau) : + ∃ tau',loc_Reserve (1 + p) tau' /\ tau' <= (3 / 4) * tau := by + cases hI with + | @even n tau hEq => + exact ⟨(3 / 4) * tau,loc_Reserve.odd n ((3 / 4) * tau) (by linarith),by linarith⟩ + | @odd n tau hEq => + have hpos := loc_z1O n + have htau : 0 <= tau := by nlinarith + refine ⟨(2 / 3) * tau,?_,by linarith⟩ + have heq : 1 + (1 + n * 2) = (1 + n) * 2 := by omega + rw [heq] + refine loc_Reserve.even (1 + n) ((2 / 3) * tau) ?_ + rw [pow_two_one_add,Nat.cast_add]; linarith +theorem loc_z2i {p : Nat} {tau : Rat} (hI : loc_Reserve p tau) (hP : 16 <= p) : + 0 < tau /\ tau <= 1 / 32 := by + cases hI with + | @even n tau hEq => + have hpos := loc_z1O n + have hBound_nat : 2 ^ 8 <= 2 ^ n := Nat.pow_le_pow_right (by decide) (by omega) + have hBound : (256 : Rat) <= ((2 ^ n : Nat) : Rat) := by exact_mod_cast hBound_nat + exact ⟨by nlinarith,by nlinarith⟩ + | @odd n tau hEq => + have hpos := loc_z1O n + have hBound_nat : 2 ^ 8 <= 2 ^ n := Nat.pow_le_pow_right (by decide) (by omega) + have hBound : (256 : Rat) <= ((2 ^ n : Nat) : Rat) := by exact_mod_cast hBound_nat + exact ⟨by nlinarith,by nlinarith⟩ +theorem loc_z2j (p n H s : Nat) + (hN : 8 <= n) (hP : p = n * 2 \/ p = 1 + n * 2) + (hS : s = (p - 2) / 2) (hH : p + p / 2 + 9 <= H) : + 4 * ((2 ^ n : Nat) : Rat) <= ((2 ^ (s + s / 2) : Nat) : Rat) /\ + 4 * ((2 ^ p : Nat) : Rat) * ((2 ^ n : Nat) : Rat) <= ((2 ^ H : Nat) : Rat) := by + refine ⟨?_,?_⟩ + · have hle : 2 ^ (2 + n) <= 2 ^ (s + s / 2) := + Nat.pow_le_pow_right (by decide) (by omega) + have hq : ((2 ^ (2 + n) : Nat) : Rat) <= ((2 ^ (s + s / 2) : Nat) : Rat) := by exact_mod_cast hle + rw [loc_z28 2 n,loc_z29] at hq + linarith + · have hle : 2 ^ (2 + p + n) <= 2 ^ H := + Nat.pow_le_pow_right (by decide) (by omega) + have hq : ((2 ^ (2 + p + n) : Nat) : Rat) <= ((2 ^ H : Nat) : Rat) := by exact_mod_cast hle + rw [loc_z28 (2 + p) n,loc_z28 2 p,loc_z29] at hq + linarith +theorem loc_z2k (alpha unit f t0 q tau : Rat) + (ht0 : 0 < t0) (_ : 0 <= alpha) (_ : 0 <= unit) + (hGap : 4 * t0 * unit <= alpha) (hLow : 4 * t0 <= q) + (hF : f * q <= unit * q + 5 * alpha) (hTau : 6 <= tau * t0) : + f <= alpha * tau * (1 / 4) := by + rcases le_or_gt f unit with hle | hgt + · have h1 : alpha * 6 <= alpha * (tau * t0) := by nlinarith + have h2 : unit * (4 * t0) <= (alpha * tau * (1 / 4)) * (4 * t0) := by linarith + have h3 : unit <= alpha * tau * (1 / 4) := le_of_mul_le_mul_pos_right (by linarith) h2 + linarith + · have h1 : (f - unit) * (4 * t0) <= (f - unit) * q := by nlinarith + have h2 : alpha * 6 <= alpha * (tau * t0) := by nlinarith + have h3 : f * (4 * t0) <= (alpha * tau * (1 / 4)) * (4 * t0) := by linarith + exact le_of_mul_le_mul_pos_right (by linarith) h3 +theorem loc_z2l (t0 q h alpha unit : Rat) + (hQ : 0 < q) (_ : 0 <= unit) + (hAq : alpha * q = 1) (hUh : unit * h = 1) + (hLe : 4 * q * t0 <= h) : + 4 * t0 * unit <= alpha := by + have h1 : (4 * q * t0) * unit <= h * unit := by nlinarith + have h2 : (4 * t0 * unit) * q <= alpha * q := by linarith + exact le_of_mul_le_mul_pos_right hQ h2 +theorem loc_z2m (p H s : Nat) (alpha unit tau f : Rat) + (hI : loc_Reserve p tau) (hP : 16 <= p) (hH : p + p / 2 + 9 <= H) (hS : s = (p - 2) / 2) + (hA : 0 < alpha) (hU : 0 < unit) + (hAp : alpha * ((2 ^ p : Nat) : Rat) = 1) (hUh : unit * ((2 ^ H : Nat) : Rat) = 1) + (hF : f * ((2 ^ (s + s / 2) : Nat) : Rat) <= unit * ((2 ^ (s + s / 2) : Nat) : Rat) + 5 * alpha) : + f <= alpha * tau * (1 / 4) := by + cases hI with + | @even n tau hTau => + rcases loc_z2j (n * 2) n H s (by omega) (Or.inl rfl) hS hH with ⟨hLow,hHigh⟩ + have hpos := loc_z1O n + have hposP := loc_z1O (n * 2) + have hGap := loc_z2l ((2 ^ n : Nat) : Rat) ((2 ^ (n * 2) : Nat) : Rat) ((2 ^ H : Nat) : Rat) + alpha unit hposP (by linarith) hAp hUh (by linarith) + exact loc_z2k alpha unit f ((2 ^ n : Nat) : Rat) ((2 ^ (s + s / 2) : Nat) : Rat) tau + hpos (by linarith) (by linarith) hGap hLow hF (by linarith) + | @odd n tau hTau => + rcases loc_z2j (1 + n * 2) n H s (by omega) (Or.inr rfl) hS hH with ⟨hLow,hHigh⟩ + have hpos := loc_z1O n + have hposP := loc_z1O (1 + n * 2) + have hGap := loc_z2l ((2 ^ n : Nat) : Rat) ((2 ^ (1 + n * 2) : Nat) : Rat) ((2 ^ H : Nat) : Rat) + alpha unit hposP (by linarith) hAp hUh (by linarith) + exact loc_z2k alpha unit f ((2 ^ n : Nat) : Rat) ((2 ^ (s + s / 2) : Nat) : Rat) tau + hpos (by linarith) (by linarith) hGap hLow hF (by linarith) +theorem loc_z2n (p : Nat) (hP : 16 <= p) : + (p + 1) + (p + 1) / 2 + 9 <= 1 + 3 * (((p - 2) / 2 + 1) / 2) + 3 * ((p - 1) / 2) := by + omega +theorem loc_z2o (alpha tau tau' e f e' : Rat) + (_ : 0 <= alpha) (_ : tau' <= (3 / 4) * tau) + (_ : e <= alpha * ((3 / 64) - tau)) (_ : f <= alpha * tau * (1 / 4)) + (_ : e' <= (e + f) * (1 / 2)) : + e' <= (alpha * (1 / 2)) * ((3 / 64) - tau') := by + nlinarith +theorem loc_z2p {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (hI : PhaseScan k u k' v a b) : + ∃ g,wordScale u = wordScale v * ((8 ^ g : Nat) : Rat) /\ u.length = v.length + g := by + induction hI with + | nil _ => exact ⟨0,by simp [wordScale],rfl⟩ + | T _ ih => + rcases ih with ⟨g,hE,hL⟩ + exact ⟨g,by dsimp [wordScale]; rw [hE]; ring,by dsimp; omega⟩ + | pair0 _ ih => + rcases ih with ⟨g,hE,hL⟩ + refine ⟨1 + g,?_,by dsimp; omega⟩ + have h8 : ((8 ^ (1 + g) : Nat) : Rat) = 8 * ((8 ^ g : Nat) : Rat) := by + rw [Nat.add_comm 1 g,Nat.pow_succ]; push_cast; ring + dsimp [wordScale]; rw [h8,hE]; ring + | pair1 _ ih => + rcases ih with ⟨g,hE,hL⟩ + refine ⟨1 + g,?_,by dsimp; omega⟩ + have h8 : ((8 ^ (1 + g) : Nat) : Rat) = 8 * ((8 ^ g : Nat) : Rat) := by + rw [Nat.add_comm 1 g,Nat.pow_succ]; push_cast; ring + dsimp [wordScale]; rw [h8,hE]; ring + | short00 _ ih => + rcases ih with ⟨g,hE,hL⟩ + exact ⟨g,by dsimp [wordScale]; rw [hE]; ring,by dsimp; omega⟩ + | short01 _ ih => + rcases ih with ⟨g,hE,hL⟩ + exact ⟨g,by dsimp [wordScale]; rw [hE]; ring,by dsimp; omega⟩ + | short10 _ ih => + rcases ih with ⟨g,hE,hL⟩ + exact ⟨g,by dsimp [wordScale]; rw [hE]; ring,by dsimp; omega⟩ + | short11 _ ih => + rcases ih with ⟨g,hE,hL⟩ + exact ⟨g,by dsimp [wordScale]; rw [hE]; ring,by dsimp; omega⟩ +theorem loc_z2q {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (hI : PhaseScan k u k' v a b) : v.length <= u.length := by + rcases loc_z2p hI with ⟨g,_,hL⟩ + omega +theorem loc_z2r (c k k' : Nat) (v : WordList) (l : Rat) + (hC : 0 < c) (hI : Scan k (List.replicate c Q ++ [K]) k' v l) : + v.length + (c + 1) / 2 = c + 1 := by + rcases even_or_odd_mul_two c with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · cases r with + | zero => omega + | succ r => + have heq : (r + 1) * 2 = 2 + r * 2 := by omega + rw [heq] at hI + rcases scan_even_Q_K_inv r k k' v l hI with ⟨d,n,rfl,_,_⟩ + simp; try omega + · rcases scan_odd_Q_K_inv r k k' v l hI with ⟨rfl,_,_⟩ + simp; try omega +theorem loc_z2s (c k k' : Nat) (v : WordList) (a b : Rat) + (hC : 0 < c) (hI : PhaseScan k (List.replicate c Q ++ [K]) k' v a b) : + v.length + (c + 1) / 2 = c + 1 := by + have hD := digitVal_append (digitVal_replicate_Q c) (DigitVal.zero DigitVal.nil) + rcases phaseScan_digitVal_loss_bound hI hD with ⟨l,hJ,_,_⟩ + exact loc_z2r c k k' v l hC hJ +theorem loc_z2t (k : Nat) (u : WordList) (c : Nat) (mid : WordList) (t0 k' : Nat) (v : WordList) (a b : Rat) + (hC : 0 < c) (hT : 0 < t0) (hU : notEndsWithQ u = true) (hM : notEndsWithQ mid = true) + (hI : PhaseScan k (u ++ List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ [K])) k' v a b) : + ∃ g,wordScale (u ++ List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ [K])) = + wordScale v * ((8 ^ g : Nat) : Rat) /\ (c + 1) / 2 + (t0 + 1) / 2 <= g := by + rcases loc_z2p hI with ⟨g,hG,hL⟩ + refine ⟨g,hG,?_⟩ + have hE0 : u ++ List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ [K]) = + u ++ (List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ [K])) := by + simp [List.append_assoc] + rw [hE0] at hI + rcases phaseScan_split_of_splitCond hI u _ rfl (Or.inl hU) with ⟨m,x,y,_,_,_,_,hJ,hK,hV,_,_⟩ + have hSplit : List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ [K]) = + (List.replicate c Q ++ [K]) ++ (mid ++ (List.replicate t0 Q ++ [K])) := by + simp [List.append_assoc] + have hCut1 : SplitCond (List.replicate c Q ++ [K]) (mid ++ (List.replicate t0 Q ++ [K])) := by + left; rw [notEndsWithQ_append_singleton]; rfl + rcases phaseScan_split_of_splitCond hK _ _ hSplit hCut1 with ⟨m1,x1,y1,_,_,_,_,hJ1,hK1,hV1,_,_⟩ + rcases phaseScan_split_of_splitCond hK1 mid (List.replicate t0 Q ++ [K]) rfl (Or.inl hM) + with ⟨m2,x2,y2,_,_,_,_,hJ2,hK2,hV2,_,_⟩ + have hL_x := loc_z2q hJ + have hL_x2 := loc_z2q hJ2 + have hL_x1 := loc_z2s c m m1 x1 _ _ hC hJ1 + have hL_y2 := loc_z2s t0 m2 k' y2 _ _ hT hK2 + rw [hV,hV1,hV2] at hL + simp only [List.length_append,List.length_cons,List.length_replicate,List.length_nil] at hL hL_x1 hL_y2 + omega +theorem loc_z2u (n : Nat) : 8 ^ n = 2 ^ (3 * n) := by + induction n with + | zero => rfl + | succ n ih => + have heq : 3 * (n + 1) = 3 * n + 3 := by omega + rw [Nat.pow_succ,heq,Nat.pow_add,ih] +theorem loc_z2v (u ds : WordList) (A H k k' : Nat) (v : WordList) (a b : Rat) + (p c : Nat) (mid : WordList) (t0 : Nat) + (hD : DigitVal A H ds) (hHeight : wordScale u * ((2 ^ H : Nat) : Rat) = 1) + (hI : PhaseScan k (u ++ ds ++ [K]) k' v a b) + (hU : notEndsWithQ u = true) (hM : notEndsWithQ mid = true) + (hDs : ds = List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q)) + (hP : 16 <= p) (hC : (p - 2) / 2 <= c) (hT : p - 2 <= t0) : + ∃ J,(p + 1) + (p + 1) / 2 + 9 <= J /\ wordScale (V :: (v ++ [V])) * ((2 ^ J : Nat) : Rat) = 1 := by + have hEq : u ++ ds ++ [K] = u ++ List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ [K]) := by + rw [hDs]; simp [List.append_assoc] + have hI' : PhaseScan k (u ++ List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ [K])) k' v a b := by + rwa [<- hEq] + rcases loc_z2t k u c mid t0 k' v a b (by omega) (by omega) hU hM hI' with ⟨g,hGain,hCount⟩ + rw [<- hEq] at hGain + refine ⟨1 + 3 * g,?_,?_⟩ + · have hArith := loc_z2n p hP + omega + · have hWidth := (digitVal_scale_and_mass hD).1 + have hG1 : wordScale (u ++ ds ++ [K]) = wordScale u * wordScale ds * 2 := by + rw [wordScale_append,wordScale_append]; dsimp [wordScale]; ring + rw [hG1] at hGain + have hG2 : wordScale (V :: (v ++ [V])) = wordScale v * (1 / 4) := by + dsimp [wordScale]; rw [wordScale_append]; dsimp [wordScale]; ring + rw [hG2,pow_two_one_add,<- loc_z2u,Nat.cast_add] + calc wordScale v * (1 / 4) * (((8 ^ g : Nat) : Rat) + ((8 ^ g : Nat) : Rat)) + _ = (wordScale v * ((8 ^ g : Nat) : Rat)) * (1 / 2) := by ring + _ = (wordScale u * wordScale ds * 2) * (1 / 2) := by rw [<- hGain] + _ = wordScale u * wordScale ds := by ring + _ = wordScale u * ((2 ^ H : Nat) : Rat) := by rw [hWidth] + _ = 1 := hHeight +theorem loc_z2w (p H : Nat) (alpha unit : Rat) + (hPH : p + 10 <= H) (hA : 0 < alpha) (hU : 0 < unit) + (hAp : alpha * ((2 ^ p : Nat) : Rat) = 1) (hUh : unit * ((2 ^ H : Nat) : Rat) = 1) : + unit <= alpha * (1 / 1024) := by + have hHigh_nat : 2 ^ (p + 10) <= 2 ^ H := Nat.pow_le_pow_right (by decide) hPH + have hHigh_q : ((2 ^ (p + 10) : Nat) : Rat) <= ((2 ^ H : Nat) : Rat) := by exact_mod_cast hHigh_nat + rw [loc_z28 p 10,loc_z2a] at hHigh_q + have h1 : unit * (((2 ^ p : Nat) : Rat) * 1024) <= unit * ((2 ^ H : Nat) : Rat) := by nlinarith + have h2 : unit * ((2 ^ p : Nat) : Rat) <= (alpha * (1 / 1024)) * ((2 ^ p : Nat) : Rat) := by linarith + exact le_of_mul_le_mul_pos_right (loc_z1O p) h2 +theorem loc_z2x (p J : Nat) (alpha unit : Rat) + (hP : 16 <= p) (hJ : (p + 1) + (p + 1) / 2 + 9 <= J) + (hA : 0 < alpha) (hU : 0 < unit) + (hAp : alpha * ((2 ^ p : Nat) : Rat) = 1) (hUj : unit * ((2 ^ J : Nat) : Rat) = 1) : + unit <= alpha * (1 / 1024) := + loc_z2w p J alpha unit (by omega) hA hU hAp hUj +theorem loc_z2y (p H : Nat) (alpha unit : Rat) + (hPH : p <= H) (hA : alpha * ((2 ^ p : Nat) : Rat) = 1) (hU : unit * ((2 ^ H : Nat) : Rat) = 1) : + unit * ((2 ^ (H - p) : Nat) : Rat) = alpha := by + have hPos := loc_z1O p + have hEq : 2 ^ H = 2 ^ (H - p) * 2 ^ p := by rw [<- Nat.pow_add,Nat.sub_add_cancel hPH] + have hEq_q : ((2 ^ H : Nat) : Rat) = ((2 ^ (H - p) : Nat) : Rat) * ((2 ^ p : Nat) : Rat) := by + rw [hEq,Nat.cast_mul] + rw [hEq_q] at hU + have hle1 := le_of_mul_le_mul_pos_right hPos (show (unit * ((2 ^ (H - p) : Nat) : Rat)) * ((2 ^ p : Nat) : Rat) <= alpha * ((2 ^ p : Nat) : Rat) by linarith) + have hle2 := le_of_mul_le_mul_pos_right hPos (show alpha * ((2 ^ p : Nat) : Rat) <= (unit * ((2 ^ (H - p) : Nat) : Rat)) * ((2 ^ p : Nat) : Rat) by linarith) + linarith +theorem loc_z2z (n t0 B : Nat) (ds : WordList) + (hD : DigitVal B (n + t0) ds) (hL : 2 ^ (n + t0) <= B + 2 ^ n) : + ∃ u,ds = u ++ List.replicate t0 Q := by + have hBound := lt_pow_of_digitVal hD + have hPos := pow_two_pos t0 + rw [Nat.pow_add] at hL hBound + let a := B - (2 ^ t0 - 1) * 2 ^ n + have hSum : a + (2 ^ t0 - 1) * 2 ^ n = B := by + have : (2 ^ t0 - 1) * 2 ^ n + 2 ^ n = 2 ^ n * 2 ^ t0 := by + have h1 : (2 ^ t0 - 1) + 1 = 2 ^ t0 := by omega + calc (2 ^ t0 - 1) * 2 ^ n + 2 ^ n + _ = ((2 ^ t0 - 1) + 1) * 2 ^ n := by ring + _ = 2 ^ t0 * 2 ^ n := by rw [h1] + _ = 2 ^ n * 2 ^ t0 := by ring + omega + have ha_lt : a < 2 ^ n := by + have : (2 ^ t0 - 1) * 2 ^ n + 2 ^ n = 2 ^ n * 2 ^ t0 := by + have h1 : (2 ^ t0 - 1) + 1 = 2 ^ t0 := by omega + calc (2 ^ t0 - 1) * 2 ^ n + 2 ^ n + _ = ((2 ^ t0 - 1) + 1) * 2 ^ n := by ring + _ = 2 ^ t0 * 2 ^ n := by rw [h1] + _ = 2 ^ n * 2 ^ t0 := by ring + omega + rcases exists_digitVal_of_lt_pow n a ha_lt with ⟨u,hU⟩ + refine ⟨u,digitVal_unique hD ?_⟩ + rw [<- hSum] + exact digitVal_append hU (digitVal_replicate_Q t0) +theorem loc_z2A (p H B : Nat) (ds : WordList) (alpha unit : Rat) + (hD : DigitVal B H ds) (hP : 2 <= p) (hPH : p <= H) + (_ : 0 < alpha) (hU : 0 < unit) (_ : unit <= alpha) + (hAp : alpha * ((2 ^ p : Nat) : Rat) = 1) (hUh : unit * ((2 ^ H : Nat) : Rat) = 1) + (hDeficit : unit * wordMassK ds <= (5 / 2) * alpha) : + ∃ u,ds = u ++ List.replicate (p - 2) Q := by + have hShift : unit * ((2 ^ (H - (p - 2)) : Nat) : Rat) = 4 * alpha := by + have heq : H - (p - 2) = (H - p) + 2 := by omega + rw [heq,loc_z28 (H - p) 2,loc_z29] + have hd := loc_z2y p H alpha unit hPH hAp hUh + linarith + have hZ := digitVal_wordMassK_eq hD + have hH_split : (H - (p - 2)) + (p - 2) = H := by omega + have hD' : DigitVal B ((H - (p - 2)) + (p - 2)) ds := by rwa [hH_split] + apply loc_z2z (H - (p - 2)) (p - 2) B ds hD' + have hZ_u : (B : Rat) * unit + unit + unit * wordMassK ds = 1 := by + calc (B : Rat) * unit + unit + unit * wordMassK ds + _ = unit * (wordMassK ds + (B : Rat) + 1) := by ring + _ = unit * ((2 ^ H : Nat) : Rat) := by rw [hZ] + _ = 1 := hUh + have hL_u : ((2 ^ H : Nat) : Rat) * unit <= ((B + 2 ^ (H - (p - 2)) : Nat) : Rat) * unit := by + rw [Nat.cast_add]; linarith + have hL_q : ((2 ^ ((H - (p - 2)) + (p - 2)) : Nat) : Rat) <= ((B + 2 ^ (H - (p - 2)) : Nat) : Rat) := by + rw [hH_split] + exact le_of_mul_le_mul_pos_right hU hL_u + exact_mod_cast hL_q +theorem loc_z2B {B H : Nat} {ds : WordList} (hI : DigitVal B H ds) (hZ : 0 < wordMassK ds) : + ∃ c w,ds = List.replicate c Q ++ K :: w := by + induction hI with + | nil => dsimp [wordMassK] at hZ; linarith + | @zero A H u _ _ => exact ⟨0,u,rfl⟩ + | @one A H u _ ih => + dsimp [wordMassK] at hZ + rcases ih (by linarith) with ⟨c,w,rfl⟩ + exact ⟨c + 1,w,rfl⟩ +theorem loc_z2C (c : Nat) : + ∀ (s : Nat) (u v : WordList), + List.replicate s Q ++ u = List.replicate c Q ++ K :: v -> s <= c := by + induction c with + | zero => + intro s u v hE + cases s with + | zero => omega + | succ s => nomatch hE + | succ c ih => + intro s u v hE + cases s with + | zero => omega + | succ s => + dsimp [List.replicate] at hE + injection hE with _ hE' + have h := ih s u v hE' + omega +theorem loc_z2D (u v : WordList) (c s : Nat) + (hC : notEndsWithQ u = true) + (hE : u ++ List.replicate c Q = v ++ List.replicate s Q) : s <= c := by + by_contra hGt + have hlt : c < s := by omega + have h_eq : s = (s - c) + c := by omega + rw [h_eq,List.replicate_add,<- List.append_assoc] at hE + have hU := List.append_inj_left' hE rfl + subst hU + rcases Nat.exists_eq_succ_of_ne_zero (by omega : s - c ≠ 0) with ⟨n,hn⟩ + rw [hn,replicate_succ_append,<- List.append_assoc,notEndsWithQ_append_singleton] at hC + contradiction +theorem loc_z2E (u v : WordList) (h : notEndsWithQ (u ++ v) = true) : notEndsWithQ v = true := by + induction u with + | nil => exact h + | cons w u ih => exact ih (notEndsWithQ_of_cons w (u ++ v) h) +theorem loc_z2F {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) (hEnd : ∃ w,u = w ++ [V]) : + ∃ w,v = w ++ [V] := by + rcases hEnd with ⟨w,rfl⟩ + rcases wordEffect_append_replicate_V_inv w 1 n b v hI with ⟨x,m,hE,_⟩ + exact ⟨x,hE⟩ +theorem loc_z2G (p : Nat) (u : WordList) : + wordMass (List.replicate p V ++ Q :: u) = wordScale (List.replicate p V) * (1 + 2 * wordMass u) := by + rw [wordMass_append] + dsimp [wordMass] + have h := (loc_z1P p).1 + linarith +theorem loc_z2H (p : Nat) (hP : 16 <= p) : + wordScale (List.replicate p V) <= 1 / 65536 := by + have h1 := (loc_z1P p).2 + have h2 := wordScale_pos (List.replicate p V) + have hle : 2 ^ 16 <= 2 ^ p := Nat.pow_le_pow_right (by decide) (by omega) + have hq : (65536 : Rat) <= ((2 ^ p : Nat) : Rat) := by exact_mod_cast hle + nlinarith +inductive Good : Nat -> WordList -> Prop where + | intro (p H : Nat) (u : WordList) (A : Nat) (da : WordList) (carry : Nat) (eff : WordList) + (B : Nat) (db : WordList) (tau : Rat) : + 16 <= p -> p + p / 2 + 9 <= H -> + (∃ rest,u = List.replicate p V ++ Q :: rest) -> + (∃ rest,u = rest ++ [V]) -> + wordScale u * ((2 ^ H : Nat) : Rat) = 1 -> + DigitVal A H da -> + WordEffect 0 u carry eff -> + A + carry = B + 2 ^ H -> + DigitVal B H db -> + loc_Reserve p tau -> + wordMass u <= wordScale (List.replicate p V) * (1 + (3 / 64) - tau) -> + (3 / 2) * wordScale (List.replicate p V) <= wordScale u * wordMassK db -> + wordScale u * wordMassK db <= (5 / 2) * wordScale (List.replicate p V) -> + (∃ rest,db = List.replicate ((p - 2) / 2) Q ++ rest) -> + Good p (u ++ da ++ [Q]) +inductive loc_Step : WordList -> WordList -> Prop where + | intro (orig eff : WordList) (k : Nat) (v : WordList) (a b : Rat) (J A : Nat) (da : WordList) : + WordEffect 0 orig 1 eff -> + PhaseScan 12 eff k v a b -> + DigitVal A J da -> + A + 2 ^ J = k -> + loc_Step orig (V :: (v ++ V :: (da ++ [Q]))) +theorem loc_z2I (c : Nat) (mid : WordList) (hM : notEndsWithQ mid = true) : + notEndsWithQ (List.replicate c Q ++ K :: mid) = true := by + cases mid with + | nil => rw [notEndsWithQ_append_singleton]; rfl + | cons x xs => + induction c with + | zero => exact hM + | succ c ih => + cases c with + | zero => exact hM + | succ c' => exact ih +theorem loc_z2J {B H : Nat} {ds : WordList} {s t0 : Nat} + (hD : DigitVal B H ds) (hZ : 0 < wordMassK ds) + (hLo : ∃ u,ds = List.replicate s Q ++ u) + (hHi : ∃ u,ds = u ++ List.replicate t0 Q) : + ∃ c mid n,ds = List.replicate c Q ++ K :: (mid ++ List.replicate n Q) /\ + notEndsWithQ mid = true /\ s <= c /\ t0 <= n := by + rcases hLo with ⟨lo,hLo_eq⟩ + rcases hHi with ⟨hi,hHi_eq⟩ + rcases loc_z2B hD hZ with ⟨c,w,hE⟩ + rcases split_trailing_Q w with ⟨mid,n,rfl,hM⟩ + refine ⟨c,mid,n,hE,hM,?_,?_⟩ + · apply loc_z2C c s lo (mid ++ List.replicate n Q) + rw [<- hLo_eq,hE] + · apply loc_z2D (List.replicate c Q ++ K :: mid) hi n t0 (loc_z2I c mid hM) + have h1 : (List.replicate c Q ++ K :: mid) ++ List.replicate n Q = + List.replicate c Q ++ K :: (mid ++ List.replicate n Q) := by + simp [List.append_assoc] + rw [h1,<- hE,hHi_eq] +theorem loc_z2K (p : Nat) (u : WordList) (carry : Nat) (eff : WordList) + (hP : 0 < p) (hE : WordEffect 0 (List.replicate p V ++ Q :: u) carry eff) : + ∃ v,eff = List.replicate p V ++ K :: v := by + cases p with + | zero => omega + | succ p => + have heq : p + 1 = 1 + p := by omega + rw [heq] at hE ⊢ + rcases loc_z23 p u carry eff hE with ⟨v,hV,_⟩ + exact ⟨v,hV⟩ +theorem loc_z2L {p : Nat} {orig : WordList} (hI : Good p orig) : + ∃ out,loc_Step orig out /\ Good (1 + p) out := by + rcases hI with ⟨H,u,A,da,carry,eff,B,db,tau, + hP,hHbound,⟨rest,hStart⟩,hEnd,hHeight,hDA,hEff,hSum,hDB,hRes,hM,hDlo,hDhi,hLow⟩ + let alpha := wordScale (List.replicate p V) + let unit := wordScale u + have hAlpha : 0 < alpha := wordScale_pos (List.replicate p V) + have hUnit : 0 < unit := wordScale_pos u + have hAp : alpha * ((2 ^ p : Nat) : Rat) = 1 := (loc_z1P p).2 + have hAsmall : alpha <= 1 / 65536 := loc_z2H p hP + rcases loc_z2i hRes hP with ⟨hTau,hTauSmall⟩ + have hUsmall : unit <= alpha * (1 / 1024) := + loc_z2w p H alpha unit (by omega) hAlpha hUnit hAp hHeight + rcases wordEffect_preserves_scale_and_mass hEff with ⟨hEffScale,hEffMass⟩ + rcases loc_z2F hEff hEnd with ⟨last,hElast⟩ + have hCut : notEndsWithQ eff = true := by rw [hElast,notEndsWithQ_append_singleton]; rfl + have hNe : eff ≠ [] := by rw [hElast]; simp + have hEffHeight : wordScale eff * ((2 ^ H : Nat) : Rat) = 1 := by rw [hEffScale]; exact hHeight + have hEffBound : wordMass eff + wordScale eff * (1 + wordMassK db) <= 1 / 128 := by + rw [hEffScale,hEffMass] + change wordMass u + unit * (1 + wordMassK db) <= 1 / 128 + have : unit * wordMassK db <= (5 / 2) * alpha := hDhi + have : wordMass u <= alpha * (1 + (3 / 64) - tau) := hM + nlinarith + rcases loc_z1N eff B H db hDB hEffHeight hCut hNe hEffBound with ⟨k,v,a,b,hIscan,hK⟩ + have hZ : 0 < wordMassK db := by + have : (3 / 2) * alpha <= unit * wordMassK db := hDlo + nlinarith + rcases loc_z2A p H B db alpha unit hDB (by omega) (by omega) + hAlpha hUnit (by linarith) hAp hHeight hDhi with ⟨hi,hHi⟩ + rcases loc_z2J hDB hZ hLow ⟨hi,hHi⟩ with ⟨c,mid,t0,hSplit,hMidCut,hC,hT⟩ + rcases loc_z2v eff db B H 12 k v a b p c mid t0 hDB hEffHeight hIscan + hCut hMidCut hSplit hP hC hT with ⟨J,hJbound,hJheight⟩ + let new := V :: (v ++ [V]) + let nu := wordScale new + have hNu : 0 < nu := wordScale_pos new + have hNuSmall : nu <= alpha * (1 / 1024) := + loc_z2x p J alpha nu hP hJbound hAlpha hNu hAp hJheight + have hEffStart : ∃ w,eff = List.replicate p V ++ K :: w := by + rw [hStart] at hEff + exact loc_z2K p rest carry eff (by omega) hEff + rcases hEffStart with ⟨w,hEstart⟩ + have hWcut : notEndsWithQ w = true := by + rw [hEstart] at hCut + exact notEndsWithQ_of_cons K w (loc_z2E (List.replicate p V) (K :: w) hCut) + let e := wordMass u - alpha + have hEeq : e = 2 * alpha * wordMass w := by + have h1 : wordMass eff = wordMass u := hEffMass + rw [hEstart,wordMass_append] at h1 + dsimp [wordMass] at h1 + have h2 := (loc_z1P p).1 + change wordMass u - alpha = 2 * alpha * wordMass w + linarith + have hWw := wordMass_nonneg w + have hMw : 0 <= wordMass w := hWw.1 + have hEpos : 0 <= e := by rw [hEeq]; positivity + have hEbound : e <= alpha * ((3 / 64) - tau) := by + change wordMass u - alpha <= alpha * ((3 / 64) - tau) + linarith + let s := (p - 2) / 2 + let pow := ((2 ^ (s + s / 2) : Nat) : Rat) + have hPow : 0 < pow := loc_z1O (s + s / 2) + let f := unit + 2 * unit * wordMassK db / pow + have hFeq : f * pow = unit * pow + 2 * unit * wordMassK db := by + change (unit + 2 * unit * wordMassK db / pow) * pow = unit * pow + 2 * unit * wordMassK db + have hne : pow ≠ 0 := ne_of_gt hPow + rw [add_mul,div_mul_cancel₀ _ hne] + have hWdb := wordMass_nonneg db + have hZdb : 0 <= wordMassK db := hWdb.2.1 + have hFpos : 0 <= f := + le_of_mul_le_mul_pos_right hPow (by nlinarith [hFeq,hPow,hUnit,hZdb]) + have hFbound : f <= alpha * tau * (1 / 4) := by + apply loc_z2m p H s alpha unit tau f hRes hP hHbound rfl hAlpha hUnit hAp hHeight + change f * pow <= unit * pow + 5 * alpha + have : unit * wordMassK db <= (5 / 2) * alpha := hDhi + linarith + have hLow' : ∃ c w0,(0 < c /\ s <= c) /\ db = List.replicate c Q ++ K :: w0 := + ⟨c,mid ++ List.replicate t0 Q,⟨by omega,hC⟩,hSplit⟩ + have hFactor : 2 * alpha * wordScale w = unit := by + have h1 : wordScale eff = unit := hEffScale + rw [hEstart,wordScale_append] at h1 + dsimp [wordScale] at h1 + change 2 * alpha * wordScale w = unit + have : wordScale (List.replicate p V) = alpha := rfl + linarith + have hScanStart : PhaseScan 12 (List.replicate p V ++ K :: (w ++ db ++ [K])) k v a b := by + rw [hEstart] at hIscan + simpa [List.append_assoc] using hIscan + have hStageBound : (2 * alpha * wordScale w) * (pow + 2 * wordMassK db) <= f * pow := by + rw [hFactor]; linarith + rcases loc_z2b p w db B H k v a b s e f hScanStart hDB hWcut hLow' hEeq hStageBound + with ⟨tail,hVstart,hMnext,hDl,hDu⟩ + rcases exists_wordEffect new 0 with ⟨carry',eff',hEff'⟩ + have hNewStart : new = List.replicate (1 + p) V ++ Q :: (tail ++ [V]) := by + change V :: (v ++ [V]) = List.replicate (1 + p) V ++ Q :: (tail ++ [V]) + rw [hVstart,loc_z22]; simp [List.append_assoc] + have hEff'_start : WordEffect 0 (List.replicate (1 + p) V ++ Q :: (tail ++ [V])) carry' eff' := by + rwa [<- hNewStart] + rcases loc_z2c p (tail ++ [V]) carry' eff' hEff'_start with ⟨hRlo0,hRhi0⟩ + rw [<- hNewStart] at hRlo0 hRhi0 + let R := ((1 + carry' : Nat) : Rat) * nu - 1 + have hScale1p : wordScale (List.replicate (1 + p) V) = alpha * (1 / 2) := by + rw [loc_z22]; rfl + have hRlo : alpha <= R := by + rw [hScale1p] at hRlo0 + change 2 * (alpha * (1 / 2)) <= R at hRlo0 + linarith + have hRhi : R <= 2 * wordMass new := hRhi0 + have hEnew : 0 <= wordMass new - alpha * (1 / 2) := by + rw [hNewStart,loc_z2G,hScale1p] + have hWt := wordMass_nonneg (tail ++ [V]) + nlinarith + have hFtiny : f <= alpha * (1 / 128) := by nlinarith + have hEtiny : e <= alpha * (3 / 64) := by nlinarith + have hBudget := loc_z2e hIscan + have hMnext' : wordMass new <= alpha * (1 / 2) + (e + f) * (1 / 2) := hMnext + rcases loc_z2g J k carry' alpha nu (a - b) R hAlpha (by linarith) + hNu hNuSmall hJheight (by linarith) (by linarith) hRlo (by linarith) hBudget (by change ((1 + carry' : Nat) : Rat) * nu = 1 + (((1 + carry' : Nat) : Rat) * nu - 1); ring) + with ⟨A',B',hAsum,hBsum,hAl,hAu,hBl,hBu⟩ + rcases exists_digitVal_of_lt_pow J A' hAu with ⟨da',hDA'⟩ + rcases exists_digitVal_of_lt_pow J B' hBu with ⟨db',hDB'⟩ + rcases loc_z2h hRes with ⟨tau',hRes',hTauStep⟩ + have hMkeep := loc_z2o alpha tau tau' e f (wordMass new - alpha * (1 / 2)) + (by linarith) hTauStep hEbound hFbound (by linarith) + rcases loc_z2d alpha e f nu (a - b) R (wordMass new - alpha * (1 / 2)) + hAlpha hEpos hFpos (by linarith) hEtiny hFtiny hNuSmall hEnew (by linarith) + hRlo (by linarith) hDl hDu with ⟨hDkeepL,hDkeepU⟩ + have hDef := loc_z2f hIscan hJheight hAsum hBsum + have hZnew := digitVal_wordMassK_eq hDB' + have hDnew : nu * wordMassK db' = (a - b) * (1 / 2) - 4 * nu - R := by + have h1 : 1 - ((1 + B' : Nat) : Rat) * nu = (a - b) * (1 / 2) - 4 * nu - R := hDef + rw [Nat.cast_add,Nat.cast_one] at h1 + have h2 : nu * (wordMassK db' + (B' : Rat) + 1) = 1 := by + rw [hZnew]; exact hJheight + linarith + have hLowNew : ∃ rest',db' = List.replicate (((1 + p) - 2) / 2) Q ++ rest' := by + let r := ((1 + p) - 2) / 2 - 1 + have hHr1 : 1 + r = ((1 + p) - 2) / 2 := by omega + have hHr2 : 1 + r * 2 <= p - 2 := by omega + have hHighEnd : ∃ z,db = z ++ List.replicate (1 + r * 2) Q := by + refine ⟨hi ++ List.replicate ((p - 2) - (1 + r * 2)) Q,?_⟩ + have heq_p : (p - 2) - (1 + r * 2) + (1 + r * 2) = p - 2 := by omega + rw [hHi,List.append_assoc,<- List.replicate_add,heq_p] + rcases hHighEnd with ⟨z,hHZ⟩ + have hSC : PhaseScan 12 ((eff ++ z) ++ List.replicate (1 + r * 2) Q ++ [K]) k v a b := by + rw [hHZ] at hIscan + simpa [List.append_assoc] using hIscan + rcases loc_z25 r 12 (eff ++ z) k v a b carry' eff' A' B' J db' + hSC hEff' hDB' (by omega) hAsum hBsum with ⟨z',hL⟩ + rw [hHr1] at hL + exact ⟨z',hL⟩ + refine ⟨new ++ da' ++ [Q],?_,?_⟩ + · have hOut_eq : new ++ da' ++ [Q] = V :: (v ++ V :: (da' ++ [Q])) := by + change V :: (v ++ [V]) ++ da' ++ [Q] = V :: (v ++ V :: (da' ++ [Q])) + simp [List.append_assoc] + rw [hOut_eq] + rcases loc_z1L hDA hSum (lt_pow_of_digitVal hDB) with ⟨d,hDD,hEE⟩ + have hd_eq : d = db := digitVal_unique hDD hDB + subst d + have hFull : WordEffect 0 (u ++ da ++ [Q]) 1 (eff ++ db ++ [K]) := by + simpa only [List.append_assoc] using wordEffect_append hEff hEE + exact loc_Step.intro (u ++ da ++ [Q]) (eff ++ db ++ [K]) k v a b J A' da' hFull hIscan hDA' hAsum + · refine Good.intro (1 + p) J new A' da' carry' eff' B' db' tau' + (by omega) (by omega) ⟨tail ++ [V],hNewStart⟩ ⟨V :: v,rfl⟩ hJheight hDA' hEff' + (by omega) hDB' hRes' ?_ ?_ ?_ hLowNew + · rw [hScale1p] + linarith + · rw [hScale1p] + change (3 / 2) * (alpha * (1 / 2)) <= nu * wordMassK db' + linarith + · rw [hScale1p] + change nu * wordMassK db' <= (5 / 2) * (alpha * (1 / 2)) + linarith +theorem ne_of_beq_eq_false {a b : Nat} (h : (a == b) = false) : a ≠ b := by + intro heq; subst heq; rw [beq_self_eq_true] at h; contradiction +def loc_z2M : Word -> Bool + | V => false + | _ => true +theorem loc_z2N (ds : WordList) (h : ds.all loc_z2M = true) : + ∃ A,DigitVal A ds.length ds := by + induction ds with + | nil => exact ⟨0,DigitVal.nil⟩ + | cons w ds ih => + cases w + · contradiction + · dsimp [List.all,loc_z2M] at h + rcases ih h with ⟨A,hI⟩ + have heq : (K :: ds).length = 1 + ds.length := by simp [Nat.add_comm] + rw [heq]; exact ⟨A * 2,DigitVal.zero hI⟩ + · dsimp [List.all,loc_z2M] at h + rcases ih h with ⟨A,hI⟩ + have heq : (Q :: ds).length = 1 + ds.length := by simp [Nat.add_comm] + rw [heq]; exact ⟨1 + A * 2,DigitVal.one hI⟩ +theorem loc_z2O {A H : Nat} {u : WordList} (hI : DigitVal A H u) : + u.all loc_z2M = true := by + induction hI with + | nil => rfl + | zero _ ih => exact ih + | one _ ih => exact ih +def loc_z2P (e : Bool) (n : Nat) : Nat := if e then 1 + n * 2 else n * 2 +def loc_z2Q (e : Bool) : Word := if e then Q else K +def loc_z2R (w : Word) (n : Nat) : Word × Nat := + match w with + | V => (V,1 + n * 2) + | K => (if n % 2 == 0 then K else Q,n / 2) + | Q => + let m := n + 1 + (if m % 2 == 0 then K else Q,m / 2) +theorem loc_z2S (w : Word) (n : Nat) (d : Word) (m : Nat) + (hE : loc_z2R w n = (d,m)) : + ∀ {u : WordList} {b : Nat} {v : WordList}, + WordEffect m u b v -> WordEffect n (w :: u) b (d :: v) := by + intro u b v hI + cases w with + | V => + dsimp [loc_z2R] at hE + injection hE with hd hm; subst hd hm + exact WordEffect.T hI + | K => + dsimp [loc_z2R] at hE + injection hE with hd hm; subst hd hm + rcases Nat.mod_two_eq_zero_or_one n with hmod | hmod + · have hcond : (n % 2 == 0) = true := beq_iff_eq.mpr hmod + rw [hcond] + have h1 := WordEffect.d00 hI + have heq : (n / 2) * 2 = n := by omega + rwa [heq] at h1 + · have hcond : (n % 2 == 0) = false := beq_false_of_ne (by omega) + rw [hcond] + have h1 := WordEffect.d01 hI + have heq : 1 + (n / 2) * 2 = n := by omega + rwa [heq] at h1 + | Q => + dsimp [loc_z2R] at hE + injection hE with hd hm; subst hd hm + rcases Nat.mod_two_eq_zero_or_one n with hmod | hmod + · have hcond : ((n + 1) % 2 == 0) = false := beq_false_of_ne (by omega) + rw [hcond] + have hm_eq : (n + 1) / 2 = n / 2 := by omega + rw [hm_eq] at hI + have h1 := WordEffect.d10 hI + have heq : (n / 2) * 2 = n := by omega + rwa [heq] at h1 + · have hcond : ((n + 1) % 2 == 0) = true := beq_iff_eq.mpr (by omega) + rw [hcond] + have hm_eq : (n + 1) / 2 = 1 + n / 2 := by omega + rw [hm_eq] at hI + have h1 := WordEffect.d11 hI + have heq : 1 + (n / 2) * 2 = n := by omega + rwa [heq] at h1 +def loc_z2T : WordList -> Nat -> WordList -> Nat × WordList + | [],n,acc => (n,acc.reverseAux []) + | w :: u,n,acc => + let (d,m) := loc_z2R w n + loc_z2T u m (d :: acc) +theorem loc_z2U (u : WordList) : + ∀ (n : Nat) (acc : WordList) (b : Nat) (out : WordList), + loc_z2T u n acc = (b,out) -> + ∃ v,out = acc.reverseAux v /\ WordEffect n u b v := by + induction u with + | nil => + intro n acc b out hE + dsimp [loc_z2T] at hE + injection hE with hb hout; subst hb hout + exact ⟨[],rfl,WordEffect.nil n⟩ + | cons w u ih => + intro n acc b out hE + dsimp [loc_z2T] at hE + generalize hC : loc_z2R w n = dm at hE + rcases dm with ⟨d,m⟩ + rcases ih m (d :: acc) b out hE with ⟨v,rfl,hI⟩ + exact ⟨d :: v,rfl,loc_z2S w n d m hC hI⟩ +def loc_z2V (e : Bool) (k : Nat) : Option (Word × Nat) := + if k == 0 then none + else if k % 2 == 0 then + if k % 4 == 2 then + some (K,loc_z2P e (k / 4)) + else + some (Q,loc_z2P e (k / 4 - 1)) + else none +theorem loc_z2W (e : Bool) (k : Nat) (d : Word) (k' : Nat) (u : WordList) (c : Nat) (v : WordList) (a b : Rat) + (hS : loc_z2V e k = some (d,k')) (hI : PhaseScan k' u c v a b) : + ∃ x y,PhaseScan k (loc_z2Q e :: u) c (d :: v) x y := by + dsimp [loc_z2V] at hS + cases hk0 : (k == 0) with + | true => rw [hk0] at hS; contradiction + | false => + rw [hk0] at hS; dsimp at hS + have hk0' : k ≠ 0 := ne_of_beq_eq_false hk0 + cases hk2 : (k % 2 == 0) with + | false => rw [hk2] at hS; contradiction + | true => + rw [hk2] at hS; dsimp at hS + have hk2' : k % 2 = 0 := beq_iff_eq.mp hk2 + cases hk4 : (k % 4 == 2) with + | true => + rw [hk4] at hS; dsimp at hS + injection hS with hS1; injection hS1 with hS1 hS2; subst hS1 hS2 + have hk4' : k % 4 = 2 := beq_iff_eq.mp hk4 + have hk_eq : k = 2 + (k / 4) * 4 := by omega + rw [hk_eq] + cases e + · exact ⟨3 + a * 2,b * 2,PhaseScan.short00 hI⟩ + · exact ⟨2 + a * 2,b * 2,PhaseScan.short01 hI⟩ + | false => + rw [hk4] at hS; dsimp at hS + injection hS with hS1; injection hS1 with hS1 hS2; subst hS1 hS2 + have hk4' : k % 4 ≠ 2 := ne_of_beq_eq_false hk4 + have hk_eq : k = 4 + (k / 4 - 1) * 4 := by omega + rw [hk_eq] + cases e + · exact ⟨4 + a * 2,b * 2,PhaseScan.short10 hI⟩ + · exact ⟨3 + a * 2,b * 2,PhaseScan.short11 hI⟩ +def loc_z2X : WordList -> Bool + | [] => true + | K :: _ => true + | V :: _ => false + | Q :: u => !loc_z2X u +def loc_z2Y : WordList -> WordList -> Nat -> WordList -> Option (Nat × WordList) + | [],_,_,_ => none + | _ :: fuel,[],k,acc => some (k,acc.reverseAux []) + | _ :: fuel,w :: u,k,acc => + if k == 0 then none + else match w with + | V => + if 3 <= k then loc_z2Y fuel u (2 + (k - 3) * 2) (V :: acc) + else none + | K => + match loc_z2V false k with + | some (d,k') => loc_z2Y fuel u k' (d :: acc) + | none => none + | Q => + if (k % 2 == 0) && loc_z2X (Q :: u) then + match loc_z2V true k with + | some (d,k') => loc_z2Y fuel u k' (d :: acc) + | none => none + else + match u with + | K :: v => loc_z2Y fuel v ((k - 1) * 2) (V :: acc) + | Q :: v => loc_z2Y fuel v (1 + (k - 1) * 2) (V :: acc) + | _ => none +theorem loc_z2Z (fuel : WordList) : + ∀ (u : WordList) (k : Nat) (acc : WordList) (k' : Nat) (out : WordList), + loc_z2Y fuel u k acc = some (k',out) -> + ∃ v a b,out = acc.reverseAux v /\ PhaseScan k u k' v a b := by + induction fuel with + | nil => intro u k acc k' out hE; contradiction + | cons _ fuel ih => + intro u k acc k' out hE + cases u with + | nil => + dsimp [loc_z2Y] at hE + injection hE with hE1; injection hE1 with hk hout; subst hk hout + exact ⟨[],0,0,rfl,PhaseScan.nil k⟩ + | cons w u => + dsimp [loc_z2Y] at hE + cases hk0 : (k == 0) with + | true => rw [hk0] at hE; contradiction + | false => + rw [hk0] at hE; dsimp at hE + have hk0' : k ≠ 0 := ne_of_beq_eq_false hk0 + cases w with + | V => + dsimp at hE + by_cases h3 : 3 <= k + · rw [if_pos h3] at hE + rcases ih u (2 + (k - 3) * 2) (V :: acc) k' out hE with ⟨v,a,b,rfl,hI⟩ + have hk_eq : k = 3 + (k - 3) := by omega + rw [hk_eq] + exact ⟨V :: v,a * (1 / 2),b * (1 / 2),rfl,PhaseScan.T hI⟩ + · rw [if_neg h3] at hE; contradiction + | K => + dsimp at hE + cases hS : loc_z2V false k with + | none => rw [hS] at hE; contradiction + | some dk => + rcases dk with ⟨d,m⟩ + rw [hS] at hE; dsimp at hE + rcases ih u m (d :: acc) k' out hE with ⟨v,a,b,rfl,hI⟩ + rcases loc_z2W false k d m u k' v a b hS hI with ⟨x,y,hSub⟩ + exact ⟨d :: v,x,y,rfl,hSub⟩ + | Q => + dsimp at hE + cases hcond : ((k % 2 == 0) && loc_z2X (Q :: u)) with + | true => + rw [hcond] at hE; dsimp at hE + cases hS : loc_z2V true k with + | none => rw [hS] at hE; contradiction + | some dk => + rcases dk with ⟨d,m⟩ + rw [hS] at hE; dsimp at hE + rcases ih u m (d :: acc) k' out hE with ⟨v,a,b,rfl,hI⟩ + rcases loc_z2W true k d m u k' v a b hS hI with ⟨x,y,hSub⟩ + exact ⟨d :: v,x,y,rfl,hSub⟩ + | false => + rw [hcond] at hE; dsimp at hE + cases u with + | nil => contradiction + | cons w2 v0 => + cases w2 with + | V => contradiction + | K => + dsimp at hE + rcases ih v0 ((k - 1) * 2) (V :: acc) k' out hE with ⟨v,a,b,rfl,hI⟩ + have hk_eq : k = 1 + (k - 1) := by omega + rw [hk_eq] + exact ⟨V :: v,a * (1 / 2),(1 + b) * (1 / 2),rfl,PhaseScan.pair0 hI⟩ + | Q => + dsimp at hE + rcases ih v0 (1 + (k - 1) * 2) (V :: acc) k' out hE with ⟨v,a,b,rfl,hI⟩ + have hk_eq : k = 1 + (k - 1) := by omega + rw [hk_eq] + exact ⟨V :: v,a * (1 / 2),(3 / 4) + b * (1 / 2),rfl,PhaseScan.pair1 hI⟩ +def loc_zPf : WordList -> Nat -> Option (WordList) + | [],_ => none + | _ :: fuel,k => + if k == 0 then none + else if k == 1 then some [Q] + else match loc_zPf fuel (k / 2) with + | none => none + | some ws => some ((if k % 2 == 0 then K else Q) :: ws) +theorem loc_z30 (fuel : WordList) : + ∀ (k : Nat) (ws : WordList),loc_zPf fuel k = some ws -> + ∃ A H da,ws = da ++ [Q] /\ DigitVal A H da /\ A + 2 ^ H = k := by + induction fuel with + | nil => intro k ws h; contradiction + | cons _ fuel ih => + intro k ws h + dsimp [loc_zPf] at h + cases hk0 : (k == 0) with + | true => rw [hk0] at h; contradiction + | false => + rw [hk0] at h; dsimp at h + have hk0' : k ≠ 0 := ne_of_beq_eq_false hk0 + cases hk1 : (k == 1) with + | true => + rw [hk1] at h; dsimp at h + injection h with h; subst h + have rfl_k : k = 1 := beq_iff_eq.mp hk1 + subst rfl_k + exact ⟨0,0,[],rfl,DigitVal.nil,rfl⟩ + | false => + rw [hk1] at h; dsimp at h + have hk1' : k ≠ 1 := ne_of_beq_eq_false hk1 + cases hrec : loc_zPf fuel (k / 2) with + | none => rw [hrec] at h; contradiction + | some ws' => + rw [hrec] at h; dsimp at h + injection h with h; subst h + rcases ih (k / 2) ws' hrec with ⟨A,H,da,rfl,hD,hSum⟩ + rcases Nat.mod_two_eq_zero_or_one k with hmod | hmod + · have hcond : (k % 2 == 0) = true := beq_iff_eq.mpr hmod + rw [hcond] + refine ⟨A * 2,1 + H,K :: da,rfl,DigitVal.zero hD,?_⟩ + rw [pow_two_one_add]; omega + · have hcond : (k % 2 == 0) = false := beq_false_of_ne (by omega) + rw [hcond] + refine ⟨1 + A * 2,1 + H,Q :: da,rfl,DigitVal.one hD,?_⟩ + rw [pow_two_one_add]; omega +def loc_z31 (u : WordList) : Option (WordList) := + let (carry,eff) := loc_z2T u 0 [] + if carry == 1 then + let fuel := V :: V :: V :: V :: eff + match loc_z2Y fuel eff 12 [] with + | some (k,v) => + match loc_zPf fuel k with + | some ws => some (V :: (v ++ V :: ws)) + | none => none + | none => none + else none +theorem loc_z32 (u out : WordList) (hR : loc_z31 u = some out) : loc_Step u out := by + dsimp [loc_z31] at hR + generalize hE : loc_z2T u 0 [] = ce at hR + rcases ce with ⟨carry,eff⟩ + dsimp at hR + cases hC : (carry == 1) with + | false => rw [hC] at hR; contradiction + | true => + rw [hC] at hR; dsimp at hR + have rfl_c : carry = 1 := beq_iff_eq.mp hC + subst rfl_c + cases hS : loc_z2Y (V :: V :: V :: V :: eff) eff 12 [] with + | none => rw [hS] at hR; contradiction + | some kv => + rcases kv with ⟨k,v⟩ + rw [hS] at hR; dsimp at hR + cases hP : loc_zPf (V :: V :: V :: V :: eff) k with + | none => rw [hP] at hR; contradiction + | some ws => + rw [hP] at hR; dsimp at hR + injection hR with hR; subst hR + rcases loc_z2U u 0 [] 1 eff hE with ⟨w1,rfl,hEff⟩ + rcases loc_z2Z (V :: V :: V :: V :: eff) eff 12 [] k v hS with ⟨w2,a,b,rfl,hScan⟩ + rcases loc_z30 (V :: V :: V :: V :: eff) k ws hP with ⟨A,J,da,rfl,hDA,hSum⟩ + exact loc_Step.intro u eff k v a b J A da hEff hScan hDA hSum +def loc_zSw : WordList -> WordList -> Option (WordList) + | [],u => some u + | V :: p,V :: u => loc_zSw p u + | K :: p,K :: u => loc_zSw p u + | Q :: p,Q :: u => loc_zSw p u + | _,_ => none +theorem loc_z33 (p : WordList) : + ∀ (u v : WordList),loc_zSw p u = some v -> u = p ++ v := by + induction p with + | nil => intro u v h; injection h + | cons w p ih => + intro u v h + cases u with + | nil => cases w <;> contradiction + | cons x u => + cases w <;> cases x <;> try contradiction + all_goals + dsimp [loc_zSw] at h + rw [ih u v h]; rfl +theorem loc_z34 (u pre rest : WordList) + (hE : loc_zSw pre (u.reverseAux []) = some rest) : + u = rest.reverseAux pre.reverse := by + have h1 := loc_z33 pre u.reverse rest hE + have h2 := congrArg List.reverse h1 + simp [List.reverseAux_eq] at h2 ⊢ + exact h2 +def loc_zHn : WordList -> Nat -> Option Nat + | [],h => some h + | V :: u,h => loc_zHn u (h + 1) + | _ :: _,0 => none + | _ :: u,h + 1 => loc_zHn u h +theorem loc_z35 (u : WordList) : + ∀ (h H : Nat),loc_zHn u h = some H -> + wordScale u * ((2 ^ H : Nat) : Rat) = ((2 ^ h : Nat) : Rat) := by + induction u with + | nil => + intro h H hE + injection hE with hE; subst hE + simp [wordScale] + | cons w u ih => + intro h H hE + cases w + · dsimp [loc_zHn,wordScale] at hE ⊢ + have hih := ih (h + 1) H hE + rw [Nat.pow_succ] at hih + push_cast at hih ⊢; linarith + · cases h with + | zero => contradiction + | succ h => + dsimp [loc_zHn,wordScale] at hE ⊢ + have hih := ih h H hE + rw [Nat.pow_succ] + push_cast at hih ⊢; linarith + · cases h with + | zero => contradiction + | succ h => + dsimp [loc_zHn,wordScale] at hE ⊢ + have hih := ih h H hE + rw [Nat.pow_succ] + push_cast at hih ⊢; linarith +def loc_z36 : WordList -> WordList -> Option (WordList × WordList) + | [],_ => none + | V :: u,ds => some (u.reverseAux [V],ds) + | w :: u,ds => loc_z36 u (w :: ds) +theorem loc_z37 (u : WordList) : + ∀ (ds p tail : WordList),loc_z36 u ds = some (p,tail) -> + ds.all loc_z2M = true -> + u.reverseAux ds = p ++ tail /\ tail.all loc_z2M = true /\ (∃ v,p = v ++ [V]) := by + induction u with + | nil => intro ds p tail hE _; contradiction + | cons w u ih => + intro ds p tail hE hD + cases w + · dsimp [loc_z36] at hE + injection hE with h1; injection h1 with h1 h2; subst h1 h2 + refine ⟨by simp [List.reverseAux_eq],hD,u.reverse,by simp [List.reverseAux_eq]⟩ + · dsimp [loc_z36] at hE + have hD' : (K :: ds).all loc_z2M = true := by simp [loc_z2M,hD] + exact ih (K :: ds) p tail hE hD' + · dsimp [loc_z36] at hE + have hD' : (Q :: ds).all loc_z2M = true := by simp [loc_z2M,hD] + exact ih (Q :: ds) p tail hE hD' +def loc_z38 (u : WordList) : Option (WordList × WordList) := + loc_z36 (u.reverseAux []) [] +theorem loc_z39 (u p ds : WordList) (hE : loc_z38 u = some (p,ds)) : + u = p ++ ds /\ ds.all loc_z2M = true /\ (∃ v,p = v ++ [V]) := by + rcases loc_z37 (u.reverseAux []) [] p ds hE rfl with ⟨hU,hD,hEnd⟩ + simp [List.reverseAux_eq] at hU + exact ⟨hU,hD,hEnd⟩ +def loc_z3a (n : Nat) : Nat := (n + 1) / 2 +theorem loc_z3b (n : Nat) : (n : Rat) <= 2 * ((loc_z3a n : Nat) : Rat) := by + have h : n <= (loc_z3a n) * 2 := by unfold loc_z3a; omega + have hq : (n : Rat) <= (((loc_z3a n) * 2 : Nat) : Rat) := by exact_mod_cast h + push_cast at hq + linarith +def loc_z3c (c0 c1 : Nat) : WordList -> Nat -> Nat + | [],n => n + | V :: u,n => loc_z3c c0 c1 u (loc_z3a n) + | K :: u,n => loc_z3c c0 c1 u (n * 2 + c0) + | Q :: u,n => loc_z3c c0 c1 u (n * 2 + c1) +theorem loc_z3d (c0 c1 : Nat) (u : WordList) : + ∀ (n : Nat), + (c0 : Rat) * wordMassK u.reverse + (c1 : Rat) * wordMassQ u.reverse + wordScale u.reverse * (n : Rat) <= + ((loc_z3c c0 c1 u n : Nat) : Rat) := by + induction u with + | nil => + intro n + simp [wordMassK,wordMassQ,wordScale,loc_z3c] + | cons w u ih => + intro n + have hsp := wordScale_pos u.reverse + cases w + · dsimp [loc_z3c] + rw [List.reverse_cons,wordMassK_append,wordMassQ_append,wordScale_append] + dsimp [wordMassK,wordMassQ,wordScale] + have hhu := loc_z3b n + have hih := ih (loc_z3a n) + nlinarith + · dsimp [loc_z3c] + rw [List.reverse_cons,wordMassK_append,wordMassQ_append,wordScale_append] + dsimp [wordMassK,wordMassQ,wordScale] + have hih := ih (n * 2 + c0) + push_cast at hih + nlinarith + · dsimp [loc_z3c] + rw [List.reverse_cons,wordMassK_append,wordMassQ_append,wordScale_append] + dsimp [wordMassK,wordMassQ,wordScale] + have hih := ih (n * 2 + c1) + push_cast at hih + nlinarith +theorem loc_z3e (c0 c1 : Nat) (u : WordList) (n : Nat) : + (c0 : Rat) * wordMassK u + (c1 : Rat) * wordMassQ u + wordScale u * (n : Rat) <= + ((loc_z3c c0 c1 (u.reverseAux []) n : Nat) : Rat) := by + have h := loc_z3d c0 c1 u.reverse n + simpa [List.reverseAux_eq,List.reverse_reverse] using h +def loc_z3f : WordList := [Q,Q,K] ++ List.replicate 14 Q +theorem loc_z3g : + wordMassK loc_z3f = 4 /\ wordScale loc_z3f * wordScale (List.replicate 16 V) = 2 := by + constructor + · norm_num [loc_z3f,List.replicate,wordMassK] + · norm_num [loc_z3f,List.replicate,wordScale] +theorem loc_z3h {B H : Nat} {db u : WordList} + (hD : DigitVal B H db) + (hHeight : wordScale u * ((2 ^ H : Nat) : Rat) = 1) + (hHi : ∃ lo,db = lo ++ loc_z3f) : + (3 / 2) * wordScale (List.replicate 16 V) <= wordScale u * wordMassK db /\ + wordScale u * wordMassK db <= (5 / 2) * wordScale (List.replicate 16 V) := by + rcases hHi with ⟨lo,rfl⟩ + have hDig := loc_z2O hD + rw [List.all_append] at hDig + rcases Bool.and_eq_true_iff.mp hDig with ⟨hDigLo,_⟩ + rcases loc_z2N lo hDigLo with ⟨A,hDA⟩ + rcases digitVal_scale_and_mass hDA with ⟨hLs,hLm,_⟩ + rcases digitVal_scale_and_mass hD with ⟨hDs,_,_⟩ + have hSplitLo := wordMass_eq_add lo + have hWlo := wordMass_nonneg lo + have hSu := wordScale_pos u + have hSlo := wordScale_pos lo + have hSh := wordScale_pos loc_z3f + have hS16 := wordScale_pos (List.replicate 16 V) + rcases loc_z3g with ⟨hZ,hS⟩ + rw [wordScale_append] at hDs + let x := wordScale u * wordScale lo + have hX : x * wordScale loc_z3f = 1 := by + change (wordScale u * wordScale lo) * wordScale loc_z3f = 1 + nlinarith + have hXa : 2 * x = wordScale (List.replicate 16 V) := by nlinarith + rw [wordMassK_append,hZ] + have hZlo_le : wordMassK lo <= wordScale lo - 1 := by linarith + refine ⟨by nlinarith,by nlinarith⟩ +def loc_z3i (rest : WordList) : Bool := + decide (loc_z3c 65536 65536 (rest.reverseAux []) 0 <= 16) +theorem loc_z3j (rest : WordList) (hE : loc_z3i rest = true) : + wordMass rest <= 1 / 4096 := by + have hle : loc_z3c 65536 65536 (rest.reverseAux []) 0 <= 16 := of_decide_eq_true hE + have hle_q : ((loc_z3c 65536 65536 (rest.reverseAux []) 0 : Nat) : Rat) <= 16 := by exact_mod_cast hle + have hR := loc_z3e 65536 65536 rest 0 + have hSplit := wordMass_eq_add rest + push_cast at hR + linarith +def loc_z3k (orig : WordList) : Bool := + match loc_z38 orig with + | none => false + | some (u,tail) => + match loc_zSw [Q] (tail.reverseAux []) with + | none => false + | some rd => + let da := rd.reverseAux [] + match loc_zSw (List.replicate 16 V ++ [Q]) u,loc_zHn u 0 with + | some rest,some H => + if 33 <= H && H == da.length then + let (carry,_) := loc_z2T u 0 [] + let (last,db) := loc_z2T da carry [] + if last == 1 then + match loc_zSw (List.replicate 7 Q) db, + loc_zSw loc_z3f.reverse (db.reverseAux []) with + | some _,some _ => loc_z3i rest + | _,_ => false + else false + else false + | _,_ => false +theorem loc_z3l (orig : WordList) (hCheck : loc_z3k orig = true) : + Good 16 orig := by + unfold loc_z3k at hCheck + cases hC : loc_z38 orig with + | none => rw [hC] at hCheck; contradiction + | some utail => + rcases utail with ⟨u,tail⟩ + rw [hC] at hCheck; dsimp only [] at hCheck + cases hTop : loc_zSw [Q] (tail.reverseAux []) with + | none => rw [hTop] at hCheck; contradiction + | some rd => + rw [hTop] at hCheck; dsimp only [] at hCheck + cases hStart : loc_zSw (List.replicate 16 V ++ [Q]) u with + | none => rw [hStart] at hCheck; contradiction + | some rest => + rw [hStart] at hCheck + cases hHeight : loc_zHn u 0 with + | none => rw [hHeight] at hCheck; contradiction + | some H => + rw [hHeight] at hCheck; dsimp only [] at hCheck + cases hCondH : (decide (33 <= H) && (H == (rd.reverseAux []).length)) with + | false => rw [hCondH] at hCheck; contradiction + | true => + rw [hCondH] at hCheck + rcases Bool.and_eq_true_iff.mp hCondH with ⟨hH33,hWidth⟩ + have hHbound : 33 <= H := of_decide_eq_true hH33 + have hWidth_eq : H = (rd.reverseAux []).length := beq_iff_eq.mp hWidth + generalize hE : loc_z2T u 0 [] = ce at hCheck + rcases ce with ⟨carry,eff⟩ + generalize hF : loc_z2T (rd.reverseAux []) carry [] = ldb at hCheck + rcases ldb with ⟨last,db⟩ + cases hLast : (last == 1) with + | false => rw [hLast] at hCheck; contradiction + | true => + rw [hLast] at hCheck + have rfl_last : last = 1 := beq_iff_eq.mp hLast + subst rfl_last + cases hLow : loc_zSw (List.replicate 7 Q) db with + | none => rw [hLow] at hCheck; contradiction + | some lo => + rw [hLow] at hCheck + cases hHigh : loc_zSw loc_z3f.reverse (db.reverseAux []) with + | none => rw [hHigh] at hCheck; contradiction + | some hi => + rw [hHigh] at hCheck + have hMass := loc_z3j rest hCheck + rcases loc_z39 orig u tail hC with ⟨hOrig,hDig,hEnd⟩ + have hTail : tail = rd.reverseAux [] ++ [Q] := by + have h1 := loc_z34 tail [Q] rd hTop + simpa [List.reverseAux_eq] using h1 + rw [hTail,List.all_append] at hDig + rcases Bool.and_eq_true_iff.mp hDig with ⟨hDigDa,_⟩ + rcases loc_z2N (rd.reverseAux []) hDigDa with ⟨A,hDA⟩ + rw [<- hWidth_eq] at hDA + rcases loc_z2U u 0 [] carry eff hE with ⟨v1,rfl,hEff⟩ + rcases loc_z2U (rd.reverseAux []) carry [] 1 db hF with ⟨v2,rfl,hEffD⟩ + rcases wordEffect_digitVal hEffD hDA with ⟨B,hDB,hSum⟩ + have hStart_eq := loc_z33 (List.replicate 16 V ++ [Q]) u rest hStart + simp only [List.append_assoc,List.singleton_append] at hStart_eq + have hHeight_eq := loc_z35 u 0 H hHeight + have hHigh' : ∃ x,db = x ++ loc_z3f := by + have h1 := loc_z34 db loc_z3f.reverse hi hHigh + refine ⟨hi.reverse,?_⟩ + simpa [List.reverseAux_eq] using h1 + rcases loc_z3h hDB hHeight_eq hHigh' with ⟨hDlo,hDhi⟩ + rw [hOrig,hTail,<- List.append_assoc] + refine Good.intro 16 H u A (rd.reverseAux []) carry eff B db (1 / 32) + (by decide) hHbound ⟨rest,hStart_eq⟩ hEnd hHeight_eq hDA hEff (by omega) hDB + (loc_Reserve.even 8 (1 / 32) (by norm_num)) ?_ hDlo hDhi + ⟨lo,loc_z33 (List.replicate 7 Q) db lo hLow⟩ + rw [hStart_eq,loc_z2G] + have hSp := wordScale_pos (List.replicate 16 V) + nlinarith +inductive loc_Rounds : WordList -> WordList -> Prop where + | refl (u : WordList) : loc_Rounds u u + | next {u v w : WordList} : loc_Step u v -> loc_Rounds v w -> loc_Rounds u w +def loc_z3m : Nat -> WordList -> Bool + | 0,u => loc_z3k u + | n + 1,u => + match loc_z31 u with + | none => false + | some v => loc_z3m n v +theorem loc_z3n (n : Nat) : + ∀ (u : WordList),loc_z3m n u = true -> + ∃ v,loc_Rounds u v /\ Good 16 v := by + induction n with + | zero => + intro u hE + exact ⟨u,loc_Rounds.refl u,loc_z3l u hE⟩ + | succ n ih => + intro u hE + dsimp [loc_z3m] at hE + cases hV : loc_z31 u with + | none => rw [hV] at hE; contradiction + | some v => + rw [hV] at hE + rcases ih v hE with ⟨w,hR,hG⟩ + exact ⟨w,loc_Rounds.next (loc_z32 u v hV) hR,hG⟩ +def loc_z3o : WordList := [V,V,Q,V,V,V,V,K,Q,K,Q,K,Q] +private def w_step_1 : WordList := [V,V,V,Q,V,V,V,V,V,K,K,V,V,K,K,K,K,K,K,Q,Q] +private def w_step_2 : WordList := [V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,K,Q,Q,Q,K,Q,Q,Q,K,K,K,K,K,K,Q,Q,Q] +private def w_step_3 : WordList := [V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,V,V,Q,Q,Q,K,V,V,V,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q] +private def w_step_4 : WordList := [V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q] +private def w_step_5 : WordList := [V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,K,K,V,V,V,V,V,V,V,Q,V,V,V,K,K,K,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q] +private def w_step_6 : WordList := [V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,Q,K,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,K,K,K,K,K,K,Q,Q,V,K,K,Q,V,V,V,V,V,V,V,V,V,V,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q] +private def w_step_7 : WordList := [V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,K,K,V,K,V,V,V,K,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,Q,K,K,K,V,V,V,V,V,V,Q,V,V,V,V,K,K,K,K,Q,Q,Q,Q,Q,Q,K,K,K,K,K,K,K,K,K,K,Q,K,K,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q] +private def w_step_8 : WordList := [V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,K,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,Q,Q,K,K,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,K,K,K,K,K,K,K,V,K,V,K,V,V,V,V,V,V,V,V,V,Q,K,K,Q,V,V,V,V,V,V,V,V,V,V,V,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,K,K,Q,K,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q] +private def w_step_9 : WordList := [V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,K,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,Q,V,K,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,K,V,V,V,V,V,V,V,V,V,Q,Q,K,K,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,K,V,V,K,K,V,V,V,K,V,V,V,V,V,V,V,V,K,V,V,V,Q,V,V,V,V,V,Q,K,K,Q,V,V,V,V,V,V,Q,V,V,V,V,V,K,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q] +private def w_step_10 : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,K,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,Q,K,K,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,K,Q,Q,K,Q,Q,K,Q,V,V,V,Q,Q,V,K,Q,K,K,V,V,V,V,V,V,K,K,V,V,V,V,V,V,K,V,V,K,V,V,V,Q,V,V,V,V,V,Q,K,K,Q,V,V,V,V,V,V,V,V,V,V,V,V,K,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,K,K,K,Q,K,K,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,K,K,Q,Q,K,Q,Q,Q,Q,K,Q,Q,K,Q,Q,K,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +private def w_step_11 : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,K,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,Q,K,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,K,V,K,Q,K,Q,V,V,Q,K,Q,K,V,V,V,V,V,K,Q,Q,Q,Q,V,V,V,V,V,V,V,V,Q,K,V,Q,V,V,Q,V,V,V,Q,Q,V,Q,K,V,V,V,V,V,Q,V,V,V,K,V,V,V,Q,V,V,V,V,V,Q,K,K,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,K,K,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,K,K,K,K,K,K,K,K,K,K,K,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,K,K,K,K,K,K,K,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +private def w_step_12 : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,K,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,K,V,Q,V,V,Q,K,V,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,Q,Q,V,Q,V,V,Q,V,V,V,Q,Q,V,K,Q,V,V,V,V,V,Q,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,Q,K,K,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,K,K,Q,Q,K,Q,K,Q,Q,V,K,K,K,Q,V,V,V,K,K,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,K,Q,K,Q,K,K,V,V,V,V,V,Q,V,V,K,V,V,V,V,V,Q,Q,Q,Q,V,V,V,V,Q,K,V,V,V,V,V,K,V,V,Q,V,V,V,V,V,K,K,V,V,V,V,V,V,K,V,V,K,V,V,V,Q,V,V,V,V,V,Q,K,K,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,K,K,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,Q,K,K,Q,Q,Q,K,Q,Q,Q,Q,Q,K,Q,K,Q,Q,K,Q,K,K,K,K,K,K,Q,Q,K,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +private def w_step_13 : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,K,V,V,Q,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,Q,Q,V,K,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,K,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,Q,K,V,K,V,V,V,V,K,Q,V,V,V,Q,V,V,V,V,V,V,Q,Q,Q,Q,V,Q,V,Q,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,Q,Q,V,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,Q,K,K,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,Q,V,K,V,V,K,V,Q,Q,Q,Q,K,Q,V,Q,V,V,K,V,V,V,V,V,V,V,Q,V,V,K,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,K,V,V,V,V,V,Q,Q,Q,Q,V,V,V,V,V,V,V,V,V,V,K,V,V,Q,V,V,V,V,V,K,K,V,V,V,V,V,V,K,V,V,K,V,V,V,Q,V,V,V,V,V,Q,K,K,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,K,K,K,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,K,Q,Q,K,Q,K,K,K,K,K,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,K,Q,K,Q,Q,Q,K,K,K,K,K,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,K,Q,K,Q,Q,Q,K,K,Q,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +private def w_step_14 : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,Q,V,V,Q,K,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,Q,Q,V,K,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,Q,Q,V,V,K,V,Q,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,Q,Q,V,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,Q,V,K,V,K,V,V,Q,V,V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,Q,K,K,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,Q,V,Q,V,V,V,V,Q,K,Q,V,V,V,V,Q,V,V,V,Q,K,V,V,V,V,V,V,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,V,K,Q,K,Q,V,V,V,K,K,K,K,K,V,V,V,V,V,V,V,V,Q,Q,K,V,Q,Q,K,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,K,V,Q,V,Q,Q,K,K,V,V,V,V,V,V,Q,K,V,K,V,V,V,V,V,V,Q,V,V,V,K,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,K,V,V,V,V,V,Q,Q,Q,Q,V,V,V,V,V,V,V,V,V,V,K,V,V,Q,V,V,V,V,V,K,K,V,V,V,V,V,V,K,V,V,K,V,V,V,Q,V,V,V,V,V,Q,K,K,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,K,K,K,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,K,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,K,Q,K,Q,Q,K,Q,K,K,K,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,K,K,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,K,Q,Q,Q,K,K,K,K,K,Q,Q,K,K,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,Q,K,K,Q,K,Q,Q,K,K,Q,Q,K,K,K,Q,Q,Q,K,K,K,K,K,Q,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,K,K,Q,Q,Q,K,Q,K,Q,K,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +private theorem z3p_step_1 : loc_z31 loc_z3o = some w_step_1 := by decide +private theorem z3p_step_2 : loc_z31 w_step_1 = some w_step_2 := by decide +private theorem z3p_step_3 : loc_z31 w_step_2 = some w_step_3 := by decide +private theorem z3p_step_4 : loc_z31 w_step_3 = some w_step_4 := by decide +private theorem z3p_step_5 : loc_z31 w_step_4 = some w_step_5 := by decide +private theorem z3p_step_6 : loc_z31 w_step_5 = some w_step_6 := by decide +private theorem z3p_step_7 : loc_z31 w_step_6 = some w_step_7 := by decide +private theorem z3p_step_8 : loc_z31 w_step_7 = some w_step_8 := by decide +private theorem z3p_step_9 : loc_z31 w_step_8 = some w_step_9 := by decide +private theorem z3p_step_10 : loc_z31 w_step_9 = some w_step_10 := by decide +private theorem z3p_step_11 : loc_z31 w_step_10 = some w_step_11 := by decide +private theorem z3p_step_12 : loc_z31 w_step_11 = some w_step_12 := by decide +private theorem z3p_step_13 : loc_z31 w_step_12 = some w_step_13 := by decide +private theorem z3p_step_14 : loc_z31 w_step_13 = some w_step_14 := by decide +private theorem z3p_end : loc_z3k w_step_14 = true := by decide +theorem z3p : loc_z3m 14 loc_z3o = true := by + simp only [loc_z3m, z3p_step_1, z3p_step_2, z3p_step_3, z3p_step_4, z3p_step_5, z3p_step_6, z3p_step_7, z3p_step_8, z3p_step_9, z3p_step_10, z3p_step_11, z3p_step_12, z3p_step_13, z3p_step_14, z3p_end] +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) +theorem z3q {k : Nat} (hK : 0 < k) : ∃ hs,Num k [] hs := by + rcases even_or_odd_mul_two k with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · cases a with + | zero => omega + | succ a => + have heq : (a + 1) * 2 = 2 + a * 2 := by omega + rw [heq]; exact ⟨[.cj] ++ [.ch] ^ a,Num.even a⟩ + · exact ⟨[.cp] ++ [.ch] ^ a,Num.odd a⟩ +theorem z3r {k : Nat} {hs hs' : List Call} (h1 : Num k [] hs) (h2 : Num k [] hs') : + hs = hs' := by + cases h1 with + | @odd n => + generalize hk : 1 + n * 2 = k0 at h2 + cases h2 with + | @odd m => + have hnm : n = m := by omega + subst hnm; rfl + | even _ => omega + | @even n => + generalize hk : 2 + n * 2 = k0 at h2 + cases h2 with + | odd _ => omega + | @even m => + have hnm : n = m := by omega + subst hnm; rfl +def z3s (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs,Num k w hs -> Side hs (w +> r) r' +theorem z3t {r r' : HalfTape} (h : z3s 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl +theorem z3u {n : Nat} {r r' : HalfTape} + (hI : z3s (n * 2) r r') : z3s (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := z3t hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0k (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine zSc (z0y n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using hI [] _ hN2 +theorem z3v {n : Nat} {r r' : HalfTape} + (hI : z3s (n * 2) r r') : z3s (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := z3t hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0A (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine zSc (z0B n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using hI [] _ hN2 +theorem z3w {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hZ : A = 0) : + evalWords da default = default := by + induction hD with + | nil => rfl + | @zero A H u _ ih => + have hA0 : A = 0 := by omega + dsimp only [evalWords] + rw [ih hA0,zDd] + | one _ => omega +theorem z3x {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hPos : 0 < A) : + z3s ((A - 1) * 2) default (evalWords da default) := by + induction hD with + | nil => omega + | @zero A H u _ ih => + have hA_pos : 0 < A := by omega + have hIH := ih hA_pos + have hs := z3u hIH + rw [zDd] at hs + have heq : (A * 2 - 1) * 2 = 2 + (A - 1) * 4 := by omega + dsimp [evalWords] + rwa [heq] + | @one A H u hDu ih => + cases A with + | zero => + change z3s 0 default (d1 +> evalWords u default) + rw [z3w hDu rfl] + intro w hs hN + generalize hk : 0 = k0 at hN + cases hN with + | zero => + have hd : d1 +> (default : HalfTape) = one +> default := by simp [d1,one] + rw [hd]; exact Side.nil (one +> default) + | odd _ => omega + | even _ => omega + | succ A => + have hA_pos : 0 < A + 1 := by omega + have hIH := ih hA_pos + have heq_in : (A + 1 - 1) * 2 = A * 2 := by omega + rw [heq_in] at hIH + have hs := z3v hIH + rw [zDd] at hs + have heq : (1 + (A + 1) * 2 - 1) * 2 = 4 + A * 4 := by omega + dsimp [evalWords] + rwa [heq] +theorem zEd {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ∀ {A H : Nat},DigitVal A H v -> Seg ([Call.ch] ^ n) ([Call.ch] ^ b) (wordsToBits u) (wordsToBits v) := by + induction hI with + | nil n => + intro A H _ + exact z0b ([Call.ch] ^ n) + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | d00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0o _) (ih hD') + | d01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0p _) (ih hD') + | d10 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0q _) (ih hD') + | d11 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0r _) (ih hD') +theorem z3y {n : Nat} {hs hs' : List Call} + (hI : Num (3 + n) [] hs) (hJ : Num (2 + n * 2) [] hs') : + Seg hs ([Call.ch] ++ hs') t t := by + generalize hk1 : 3 + n = k1 at hI + generalize hk2 : 2 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = m * 2 := by omega + subst hq + rw [h1m] + exact z0s m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0t m +theorem loc_z3z {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' (d1 ++ d0) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0u m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + have hq : q = m * 2 := by omega + subst hq + exact z0v m +theorem loc_z3A {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' (d1 ++ d1) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | @odd q => + have hq : q = m * 2 := by omega + subst hq + exact z0w m + | even _ => omega + | @even m => + cases hJ with + | @odd q => + have hq : q = 1 + m * 2 := by omega + subst hq + exact z0x m + | even _ => omega +theorem loc_z3B {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 2 + q * 2 := by omega + subst hm + exact z0y q +theorem loc_z3C {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = q * 2 := by omega + subst hm + exact z0z q + | even _ => omega +theorem loc_z3D {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 3 + q * 2 := by omega + subst hm + exact z0B q +theorem loc_z3E {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = 1 + q * 2 := by omega + subst hm + exact z0C q + | even _ => omega +theorem loc_z3F {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) : + ∀ {u : WordList} {n n' : Nat} {hs hs' : List Call}, + WordEffect n u n' v -> Num k [] hs -> Num k' [] hs' -> + Seg (([Call.ch] ^ n) ++ hs) (([Call.ch] ^ n') ++ hs') (wordsToBits u) (wordsToBits w) := by + induction hI with + | nil k => + intro u n n' hs hs' hE hN hN' + cases hE + rw [z3r hN hN'] + exact z0b (([Call.ch] ^ n) ++ hs') + | @T m _ _ _ _ _ _ ih => + intro u0 n0 n1 hs hs' hE hN hN' + cases hE with + | T hSub => + rcases z3q (by omega : 0 < 2 + m * 2) with ⟨hs0,hN0⟩ + have hIH := ih hSub hN0 hN' + have hStep := zSg (H_T n0) (z3y hN hN0) + have heq : ([Call.ch] ^ (n0 * 2)) ++ ([Call.ch] ++ hs0) = ([Call.ch] ^ (1 + n0 * 2)) ++ hs0 := by + have h1 : 1 + n0 * 2 = n0 * 2 + 1 := by omega + rw [h1,z07,z06,List.append_assoc] + rw [heq] at hStep + exact zS0 hStep hIH + | @pair0 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,K] ++ u) at hE + rcases wordEffect_split_output [Q,K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z3q hPos with ⟨hs0,hN0⟩ + have hD10 : DigitVal 1 2 [Q,K] := DigitVal.one (DigitVal.zero DigitVal.nil) + have hStep := zSg (zEd hL hD10) (loc_z3z hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @pair1 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,Q] ++ u) at hE + rcases wordEffect_split_output [Q,Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z3q (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD11 : DigitVal 3 2 [Q,Q] := DigitVal.one (DigitVal.one DigitVal.nil) + have hStep := zSg (zEd hL hD11) (loc_z3A hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short00 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z3q hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (loc_z3B hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short01 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z3q (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (loc_z3C hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short10 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z3q hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (loc_z3D hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short11 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z3q (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (loc_z3E hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') +theorem loc_z3G {n : Nat} {r r' : HalfTape} + (hI : z3s (n * 2) r r') : z3s (1 + n) (d1 +> (d0 +> r)) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil,<- append_assoc d1 d0 r] + cases m with + | zero => + have hn0 : n * 2 = 0 := by omega + rw [hn0] at hI + have hr' := z3t hI + subst hr' + rw [<- append_assoc t one r] + exact zSc z0g (Side.nil r) + | succ m => + have h1m : m + 1 = 1 + m := by omega + rw [h1m] + refine zSc (z0u m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : n * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil,<- append_assoc d1 d0 r] + refine zSc (z0v m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (m * 2)) := by + have hm : n * 2 = 2 + (m * 2) * 2 := by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 +theorem loc_z3H {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) {u : WordList} {r' : HalfTape} + (hE : WordEffect 0 u 1 v) (hK : 0 < k') (hC : z3s k' (d1 +> default) r') : + z3s k (evalWords u default) (evalWords w r') := by + intro w0 hs hN + have hPosK : 0 < k := phaseScan_pos_of_out_pos hI hK + have hw0 : w0 = [] := by + cases hN with + | zero => omega + | odd _ => rfl + | even _ => rfl + subst hw0 + rcases z3q hK with ⟨hs',hN'⟩ + have hSeg := loc_z3F hI hE hN hN' + dsimp at hSeg + have hSide_out : Side ([Call.ch] ++ hs') (d0 +> default) r' := by + rw [zDd] + exact z08 z0D (hC [] hs' hN') + have hSide := zSc hSeg hSide_out + rw [zDd] at hSide + rwa [wordsToBits_append_tape,wordsToBits_append_tape] at hSide +theorem loc_z3I {orig out : WordList} (hS : loc_Step orig out) : + ∃ r,z3s 12 (evalWords orig default) r /\ evalWords out default = t +> r := by + rcases hS with ⟨eff,k,v,a,b,J,A,da,hE,hI,hDA,hSum⟩ + have hDA1 : DigitVal (A + 2 ^ J) (J + 1) (da ++ [Q]) := by + have h1 := digitVal_append hDA (DigitVal.one DigitVal.nil) + simpa using h1 + rw [hSum] at hDA1 + have hK_pos : 0 < k := by + have hp := pow_two_pos J + omega + have hC0 : z3s ((k - 1) * 2) default (evalWords (da ++ [Q]) default) := + z3x hDA1 hK_pos + have hC1 : z3s (1 + (k - 1)) (d1 +> (d0 +> default)) (t +> evalWords (da ++ [Q]) default) := + loc_z3G hC0 + have hk_eq : 1 + (k - 1) = k := by omega + rw [hk_eq,zDd] at hC1 + have hRun := loc_z3H hI hE hK_pos hC1 + refine ⟨evalWords v (t +> evalWords (da ++ [Q]) default),hRun,?_⟩ + simp [evalWords,evalWords_append] +theorem loc_z3J {r r' : HalfTape} (hI : z3s 12 r r') : + (zCf r) [target_tm]⊢⁺ zCf (t +> r') := by + have h_num : Num 12 [] ([.cj] ++ [.ch] ^ 5) := Num.even 5 + have hC := hI [] ([.cj] ++ [.ch] ^ 5) h_num + have hS := zSc z0F hC + rcases hS with _ | ⟨hca,hrest⟩ + rcases hrest with _ | ⟨hch,hnil⟩ + cases hnil + have h1 := zPt (z0G (w_init +> r)) (hca ([1] +> default)) + have h2 := zPt (z0H _) (hch lh) + have h3 := zPt h1 h2 + have heq : (w_init ++ t) +> r' = w_init +> (t +> r') := append_assoc w_init t r' + unfold zCf + rwa [heq] at h3 +theorem z3K {orig out : WordList} (hS : loc_Step orig out) : + (zCf (evalWords orig default)) [target_tm]⊢⁺ zCf (evalWords out default) := by + rcases loc_z3I hS with ⟨r,hC,hOut⟩ + rw [hOut] + exact loc_z3J hC +theorem z3L {u v : WordList} (hR : loc_Rounds u v) : + (zCf (evalWords u default)) [target_tm]⊢* zCf (evalWords v default) := by + induction hR with + | refl _ => exact ⟨0,rfl⟩ + | next hS _ ih => + rcases z3K hS with ⟨n,_,hn⟩ + rcases ih with ⟨m,hm⟩ + exact ⟨n + m,zMt target_tm _ _ _ n m hn hm⟩ +abbrev CCfg := Counter.CCfg (Fin 2) (Fin 6) +abbrev z3M (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev z3T (c : CCfg) : Option CCfg := Counter.bstep target_tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep target_tm n c +def z3X : CCfg := + ⟨A,0,[],[]⟩ +def z3Y : CCfg := + ⟨D,1,[0,1],[0,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,1,0,0,0,1]⟩ +private def c_step_515 : CCfg := ⟨C,0,[1,1,0,1],[1,0,0,1,1,0,0,1,1,1,0,0,1,0,1,1,0,0,0,0,0,0,1,1]⟩ +private def c_step_1030 : CCfg := ⟨D,0,[1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1],[0,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,1]⟩ +private def c_step_1545 : CCfg := ⟨E,1,[0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,0,1,0,1],[1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,1,0,1]⟩ +private theorem z3Z_1 : zCm z3X 515 = some c_step_515 := by decide +private theorem z3Z_2 : zCm c_step_515 515 = some c_step_1030 := by decide +private theorem loc_z3Z_3 : zCm c_step_1030 515 = some c_step_1545 := by decide +private theorem z3Z_4 : zCm c_step_1545 515 = some z3Y := by decide +private theorem z40_1 : (z3M z3X) [target_tm]⊢^{515} (z3M c_step_515) := + Counter.bmultiStep_sound 515 z3X c_step_515 z3Z_1 +private theorem z40_2 : (z3M c_step_515) [target_tm]⊢^{515} (z3M c_step_1030) := + Counter.bmultiStep_sound 515 c_step_515 c_step_1030 z3Z_2 +private theorem loc_z40_3 : (z3M c_step_1030) [target_tm]⊢^{515} (z3M c_step_1545) := + Counter.bmultiStep_sound 515 c_step_1030 c_step_1545 loc_z3Z_3 +private theorem z40_4 : (z3M c_step_1545) [target_tm]⊢^{515} (z3M z3Y) := + Counter.bmultiStep_sound 515 c_step_1545 z3Y z3Z_4 +theorem z40 : (z3M z3X) [target_tm]⊢^{2060} (z3M z3Y) := by + have h1 := zMt target_tm _ _ _ 515 515 z40_1 z40_2 + have h2 := zMt target_tm _ _ _ 1030 515 h1 loc_z40_3 + exact zMt target_tm _ _ _ 1545 515 h2 z40_4 +theorem z41 : + (init []) [target_tm]⊢* zCf (evalWords loc_z3o default) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = z3M z3X := rfl + have h_end : z3M z3Y = zCf (evalWords loc_z3o default) := by + simp [z3M,z3Y,zCf,zCL,lh,w_init,t,d0,d1,one,loc_z3o,evalWords] + refine ⟨2060,?_⟩ + rw [h_init,<- h_end] + exact z40 +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d) = some c') : + (multiStep target_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +theorem z42 (m : Nat) : + ∃ N ≥ m,∃ p w,multiStep target_tm (init []) N = some (zCf (evalWords w default)) /\ Good p w := by + induction m with + | zero => + rcases z41 with ⟨k1,hk1⟩ + rcases loc_z3n 14 loc_z3o z3p with ⟨v,hR,hG⟩ + rcases z3L hR with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,16,v, + zMt target_tm _ _ _ k1 k2 hk1 hk2,hG⟩ + | succ m ih => + rcases ih with ⟨N,hN,p,w,h_ms,h_good⟩ + rcases loc_z2L h_good with ⟨w',hStep,h_good'⟩ + rcases z3K hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,1 + p,w', + zMt target_tm _ _ _ N k h_ms h_step_k,h_good'⟩ + +end Solution +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + + + +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases z42 (n + 1) with ⟨N,hN,_,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := zIm h_N + rw [zMs,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1RA_1RC0RA_1LD0LA_1LE0LD_1LF0LB_1REHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RA_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RA_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH.lean new file mode 100644 index 00000000..55415c3a --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RA_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH.lean @@ -0,0 +1,1025 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1RA_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RA_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +set_option maxRecDepth 2000000 +@[simp] theorem _vault_listblank_mk_empty {Γ : Type*} [Inhabited Γ] : + Turing.ListBlank.mk ([] : List Γ) = default := by + ext n; cases n <;> rfl +@[simp] theorem _vault_listblank_mk_cons {Γ : Type*} [Inhabited Γ] (x : Γ) (xs : List Γ) : + Turing.ListBlank.mk (x :: xs) = Turing.ListBlank.cons x (Turing.ListBlank.mk xs) := by + ext n; cases n <;> rfl + + +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +abbrev holdout_0596_tm : Machine (Fin 2) (Fin 6) := target_tm +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 2000000 +set_option maxRecDepth 2000000 +@[simp] theorem zMz (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : HalfTape).head = 0 := rfl +@[simp] theorem zDt : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem zPs {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem zPt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,by omega,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ +local macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +local macro "gstep" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt]) +local macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | gstep))) +abbrev t : BitWord := [1,1,0,0] +abbrev d0 : BitWord := [0,0] +abbrev d1 : BitWord := [1,0] +abbrev one : BitWord := [1] +abbrev w_pre : BitWord := t ++ one +abbrev lh : HalfTape := (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default +@[simp] theorem zDd : d0 +> (default : HalfTape) = default := by + simp [d0] +inductive Call where + | ch + | cj + | cp + | ca +def zCs : Call -> Fin 6 + | .ch => C + | .cj => B + | .cp => B + | .ca => C +def zCw : Call -> BitWord + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] + | .ca => [1,1,1,0,1,1] +def zCR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + ((l <+ zCw c) {{zCs c}}> r) +def zCL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (l <{{D}} ([0] +> r)) +def zCf (q : Nat) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + zCR lh .ca ((w_pre ++ t ^ (2 + q) ++ (d1 ++ one)) +> r) +def z04 (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l,(zCR l c r1) [holdout_0596_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + z04 c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem z05 {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z06 {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem z07 {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z08 {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z09 {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0a (w : BitWord) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem z0b (ls : List Call) : Seg ls ls [] [] := by + intro r1 r2 h; exact h +theorem zSc {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases z09 h with ⟨r2,ha,hb⟩ + exact z08 (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS0 {ls1 ls2 ls3 : List Call} {w1 w2 u1 u2 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls2 ls3 u1 u2) : + Seg ls1 ls3 (w1 ++ u1) (w2 ++ u2) := by + intro r1 r2 h + rw [append_assoc w1 u1 r1,append_assoc w2 u2 r2] + exact h1 (u1 +> r1) (u2 +> r2) (h2 r1 r2 h) +theorem zS4 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [holdout_0596_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [holdout_0596_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [holdout_0596_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc1 (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [holdout_0596_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [holdout_0596_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [holdout_0596_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem z0c : Seg [.cp] [.ch] t (t ++ [0]) := + zS2 (mid := [1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0d : Seg [.cj] [.ch] t (t ++ one) := + zS2 (mid := [1,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0e : Seg [.ch] [.cj] (t ++ [0]) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0f : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0g : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0h : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1 d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0i : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0j : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0k : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0l : Seg [.cj] [.cp] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons,append_nil]; execute) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem zS3 (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact z0a t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [zLp,h_eq,z07] + exact zSg z0f ih +theorem zSa {w2 : BitWord} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact z0a w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq,z07,zLp] + exact zSg hw ih +theorem z0m : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0n : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem H_T (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := + zS3 n +theorem z0o (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d0 d0 := + zSa z0m n +theorem z0p (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ n) d0 d1 := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg zH0 (zSa z0n n) +theorem z0q (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d1 d1 := + zSa z0n n +theorem z0r (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ (1 + n)) d1 d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg zH4 (zSa z0m n) +theorem z0s : Side [.ch] default (d1 +> default) := by + refine Side.cons (fun l => ?_) (Side.nil _) + unfold zCR zCL zCw zCs d1 + simp only [append_cons,append_nil,z00] + execute +theorem z0t (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.ch] ++ [.cj] ++ [.ch] ^ (n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0c z0e) (zS3 n) +theorem z0u (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n)) ([.ch] ++ [.cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0d zH2) (zS3 n) +theorem z0v (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0g zH2) (zS3 n) +theorem z0w (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0h (zS3 n) +theorem z0x (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0i (zS3 n) +theorem z0y (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [zLp',List.cons_append,List.nil_append] using! zSg z0j (zS3 n) +theorem z0z (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0k (zSg zH1 zH3) + have h1 := zSg h0 (zSa z0m n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using! h1 +theorem z0A (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0l (zSa z0m n) +theorem z0B : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0k zH1 +theorem z0C (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0k (zSg zH1 (zSg zH3 zH0)) + have h1 := zSg h0 (zSa z0n n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using! h1 +theorem z0D (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg [.cj,.ch] [.cp] d1 d1 := zSg z0l zH0 + have h1 := zSg h0 (zSa z0n n) + simpa only [zLp',List.cons_append,List.nil_append] using! h1 +theorem z0E (n : Nat) : Seg ([.ch] ^ n ++ [.cj,.ch]) ([.ch] ^ (1 + n * 2) ++ [.cj,.ch]) t t := by + have h0 := zSg (H_T n) (z0u 0) + have heq : 1 + n * 2 = n * 2 + 1 := by omega + rw [heq,z07] + simpa only [z05,z06,List.append_nil,List.append_assoc,List.cons_append,List.nil_append] using! h0 +theorem z0F (n : Nat) : Seg ([.ch] ^ (1 + n * 2)) ([.cj] ++ [.ch] ^ n) (d1 ++ one) d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg zH3 (zSa z0m n) +theorem z0G (n : Nat) : Seg ([.ch] ^ (1 + n * 2) ++ [.cj,.ch]) ([.cj] ++ [.ch] ^ n) (d1 ++ one) (d1 ++ one) := by + simpa only [List.append_nil] using! zSg (z0F n) z0B +theorem z0H (q : Nat) : + ∀ n,Seg (([Call.ch] ^ n) ++ [.cj,.ch]) (([Call.ch] ^ ((1 + n) * 2 ^ q - 1)) ++ [.cj,.ch]) (t ^ q) (t ^ q) := by + induction q with + | zero => + intro n + have heq : (1 + n) * 2 ^ 0 - 1 = n := by simp + rw [heq] + exact z0b _ + | succ q ih => + intro n + have h1 := zS0 (z0E n) (ih (1 + n * 2)) + have heq : (1 + (1 + n * 2)) * 2 ^ q - 1 = (1 + n) * 2 ^ (q + 1) - 1 := by + rw [Nat.pow_succ]; ring_nf + rw [heq] at h1 + exact h1 +theorem z0I : Seg [.ca] [.cj,.ch] w_pre (w_pre ++ t) := + zS5 (mid1 := [1,0,1,1,1,1,0,1,1]) (mid2 := [1,0,1,0,1,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs w_pre t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL w_pre t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0J (r : HalfTape) : + (zCL lh r) [holdout_0596_tm]⊢⁺ (zCR lh .ca r) := by + unfold zCL zCR lh zCw zCs + simp only [append_cons,append_nil,z00] + execute +open WordCalculus Word ChoiceE +local notation "WordList" => List Word +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) +theorem loc_z2u {k : Nat} (hK : 0 < k) : ∃ hs,Num k [] hs := by + rcases even_or_odd_mul_two k with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · cases a with + | zero => omega + | succ a => + have heq : (a + 1) * 2 = 2 + a * 2 := by omega + rw [heq]; exact ⟨[.cj] ++ [.ch] ^ a,Num.even a⟩ + · exact ⟨[.cp] ++ [.ch] ^ a,Num.odd a⟩ +theorem loc_z2v {k : Nat} {hs hs' : List Call} (h1 : Num k [] hs) (h2 : Num k [] hs') : + hs = hs' := by + cases h1 with + | @odd n => + generalize hk : 1 + n * 2 = k0 at h2 + cases h2 with + | @odd m => + have hnm : n = m := by omega + subst hnm; rfl + | even _ => omega + | @even n => + generalize hk : 2 + n * 2 = k0 at h2 + cases h2 with + | odd _ => omega + | @even m => + have hnm : n = m := by omega + subst hnm; rfl +def loc_z2w (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs,Num k w hs -> Side hs (w +> r) r' +theorem loc_z2x {r r' : HalfTape} (h : loc_z2w 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl +theorem loc_z2y {n : Nat} {r r' : HalfTape} + (hI : loc_z2w (n * 2) r r') : loc_z2w (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2x hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0k (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine zSc (z0z n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using! hI [] _ hN2 +theorem loc_z2z {n : Nat} {r r' : HalfTape} + (hI : loc_z2w (n * 2) r r') : loc_z2w (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2x hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0B (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine zSc (z0C n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using! hI [] _ hN2 +theorem loc_z2A {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hZ : A = 0) : + evalWords da default = default := by + induction hD with + | nil => rfl + | @zero A H u _ ih => + have hA0 : A = 0 := by omega + rw [evalWords,ih hA0,zDd] + | one _ => omega +theorem loc_z2B {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hPos : 0 < A) : + loc_z2w ((A - 1) * 2) default (evalWords da default) := by + induction hD with + | nil => omega + | @zero A H u _ ih => + have hA_pos : 0 < A := by omega + have hIH := ih hA_pos + have hs := loc_z2y hIH + rw [zDd] at hs + have heq : (A * 2 - 1) * 2 = 2 + (A - 1) * 4 := by omega + rw [evalWords] + rwa [heq] + | @one A H u hDu ih => + cases A with + | zero => + have h_side : evalWords (Q :: u) default = one +> default := by + rw [evalWords,loc_z2A hDu rfl] + simp [d1,one] + rw [h_side] + intro w hs hN + have hk0 : (1 + 0 * 2 - 1) * 2 = 0 := rfl + rw [hk0] at hN + generalize hk : (0 : Nat) = k0 at hN + cases hN with + | zero => exact Side.nil (one +> default) + | odd _ => omega + | even _ => omega + | succ A => + have hA_pos : 0 < A + 1 := by omega + have hIH := ih hA_pos + have heq_in : (A + 1 - 1) * 2 = A * 2 := by omega + rw [heq_in] at hIH + have hs := loc_z2z hIH + rw [zDd] at hs + have heq : (1 + (A + 1) * 2 - 1) * 2 = 4 + A * 4 := by omega + rw [evalWords] + rwa [heq] +theorem zEd {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ∀ {A H : Nat},DigitVal A H v -> Seg ([Call.ch] ^ n) ([Call.ch] ^ b) (wordsToBits u) (wordsToBits v) := by + induction hI with + | nil n => + intro A H _ + exact z0b _ + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | d00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0o _) (ih hD') + | d01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0p _) (ih hD') + | d10 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0q _) (ih hD') + | d11 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0r _) (ih hD') +theorem loc_z2C {n : Nat} {hs hs' : List Call} + (hI : Num (3 + n) [] hs) (hJ : Num (2 + n * 2) [] hs') : + Seg hs ([Call.ch] ++ hs') t t := by + generalize hk1 : 3 + n = k1 at hI + generalize hk2 : 2 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = m * 2 := by omega + subst hq + rw [h1m] + exact z0t m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0u m +theorem loc_z2D {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' (d1 ++ d0) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0v m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + have hq : q = m * 2 := by omega + subst hq + exact z0w m +theorem loc_z2E {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' (d1 ++ d1) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | @odd q => + have hq : q = m * 2 := by omega + subst hq + exact z0x m + | even _ => omega + | @even m => + cases hJ with + | @odd q => + have hq : q = 1 + m * 2 := by omega + subst hq + exact z0y m + | even _ => omega +theorem loc_z2F {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 2 + q * 2 := by omega + subst hm + exact z0z q +theorem loc_z2G {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = q * 2 := by omega + subst hm + exact z0A q + | even _ => omega +theorem loc_z2H {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 3 + q * 2 := by omega + subst hm + exact z0C q +theorem loc_z2I {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = 1 + q * 2 := by omega + subst hm + exact z0D q + | even _ => omega +theorem loc_z2J {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) : + ∀ {u : WordList} {n n' : Nat} {hs hs' : List Call}, + WordEffect n u n' v -> Num k [] hs -> Num k' [] hs' -> + Seg (([Call.ch] ^ n) ++ hs) (([Call.ch] ^ n') ++ hs') (wordsToBits u) (wordsToBits w) := by + induction hI with + | nil k => + intro u n n' hs hs' hE hN hN' + cases hE + rw [loc_z2v hN hN'] + exact z0b _ + | @T m _ _ _ _ _ _ ih => + intro u0 n0 n1 hs hs' hE hN hN' + cases hE with + | T hSub => + rcases loc_z2u (by omega : 0 < 2 + m * 2) with ⟨hs0,hN0⟩ + have hIH := ih hSub hN0 hN' + have hStep := zSg (H_T n0) (loc_z2C hN hN0) + have heq : ([Call.ch] ^ (n0 * 2)) ++ ([Call.ch] ++ hs0) = ([Call.ch] ^ (1 + n0 * 2)) ++ hs0 := by + have h1 : 1 + n0 * 2 = n0 * 2 + 1 := by omega + rw [h1,z07,z06,List.append_assoc] + rw [heq] at hStep + exact zS0 hStep hIH + | @pair0 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,K] ++ u) at hE + rcases wordEffect_split_output [Q,K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2u hPos with ⟨hs0,hN0⟩ + have hD10 : DigitVal 1 2 [Q,K] := DigitVal.one (DigitVal.zero DigitVal.nil) + have hStep := zSg (zEd hL hD10) (loc_z2D hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @pair1 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,Q] ++ u) at hE + rcases wordEffect_split_output [Q,Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2u (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD11 : DigitVal 3 2 [Q,Q] := DigitVal.one (DigitVal.one DigitVal.nil) + have hStep := zSg (zEd hL hD11) (loc_z2E hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short00 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2u hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (loc_z2F hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short01 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2u (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (loc_z2G hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short10 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2u hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (loc_z2H hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short11 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2u (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (loc_z2I hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') +theorem loc_z2K {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) {u : WordList} {r r' : HalfTape} + (hE : WordEffect 0 u 0 v) (hK : 0 < k') (hC : loc_z2w k' r r') : + loc_z2w k (evalWords u r) (evalWords w r') := by + intro w0 hs hN + have hPosK : 0 < k := phaseScan_pos_of_out_pos hI hK + have hw0 : w0 = [] := by + cases hN with + | zero => omega + | odd _ => rfl + | even _ => rfl + subst hw0 + rcases loc_z2u hK with ⟨hs',hN'⟩ + have hSeg := loc_z2J hI hE hN hN' + dsimp at hSeg + have hSide := zSc hSeg (hC [] hs' hN') + rwa [wordsToBits_append_tape,wordsToBits_append_tape] at hSide +theorem loc_z2L {q : Nat} {orig out : WordList} (hS : EStep q orig out) : + loc_z2w (4 * 2 ^ q) (evalWords orig default) (evalWords out default) := by + rcases hS with ⟨eff,n,v,a0,b0,J,da,hE,hI,hPos,hDA⟩ + have hBlank : evalWords [K] default = default := by simp [evalWords,d0] + have hC : loc_z2w (n * 2) default (evalWords da default) := by + have heq : n * 2 = ((1 + n) - 1) * 2 := by omega + rw [heq] + exact loc_z2B hDA (by omega) + have hRun := loc_z2K hI hE (by omega : 0 < n * 2) hC + rwa [evalWords_append,hBlank,<- evalWords_append] at hRun +theorem loc_z2M (q : Nat) : + Seg [.cj,.ch] ([.cj] ++ [.ch] ^ (2 ^ q - 1)) (t ^ (1 + q) ++ (d1 ++ one)) (t ^ (1 + q) ++ (d1 ++ one)) := by + have hpos := pow_two_pos q + have hT := z0H (1 + q) 0 + have heq : (1 + 0) * 2 ^ (1 + q) - 1 = 1 + (2 ^ q - 1) * 2 := by + rw [pow_two_one_add]; omega + rw [heq] at hT + dsimp at hT + exact zS0 hT (z0G (2 ^ q - 1)) +theorem loc_z2N (q : Nat) : + Seg [.ca] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) + (w_pre ++ (t ^ (2 + q) ++ (d1 ++ one))) + (w_pre ++ (t ^ (2 + (q + 1)) ++ (d1 ++ one))) := by + have h1 := zS0 z0I (loc_z2M (1 + q)) + have heq1 : 1 + (1 + q) = 2 + q := by omega + have heq2 : (w_pre ++ t) ++ (t ^ (2 + q) ++ (d1 ++ one)) = w_pre ++ (t ^ (2 + (q + 1)) ++ (d1 ++ one)) := by + have h3 : 2 + (q + 1) = 1 + (2 + q) := by omega + rw [h3,zLp'] + simp only [List.append_assoc] + rw [heq1] at h1 + rwa [heq2] at h1 +theorem loc_z2O (q : Nat) {r r' : HalfTape} (hI : loc_z2w (4 * 2 ^ q) r r') : + (zCf q r) [holdout_0596_tm]⊢⁺ zCf (q + 1) r' := by + have hpos := pow_two_pos q + have h_num : Num (4 * 2 ^ q) [] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) := by + have heq : 4 * 2 ^ q = 2 + (2 ^ (1 + q) - 1) * 2 := by rw [pow_two_one_add]; omega + rw [heq]; exact Num.even (2 ^ (1 + q) - 1) + have hC := hI [] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) h_num + have hS := zSc (loc_z2N q) hC + rcases hS with _ | ⟨hca,hnil⟩ + cases hnil + have h_step := zPt (hca lh) (z0J _) + simpa only [zCf,List.append_assoc] using! h_step +theorem loc_z2P {q : Nat} {orig out : WordList} (hS : EStep q orig out) : + (zCf q (evalWords orig default)) [holdout_0596_tm]⊢⁺ zCf (q + 1) (evalWords out default) := + loc_z2O q (loc_z2L hS) +theorem loc_z2Q {h : Nat} {u : WordList} {j : Nat} {v : WordList} (hR : ERounds h u j v) : + (zCf h (evalWords u default)) [holdout_0596_tm]⊢* zCf j (evalWords v default) := by + induction hR with + | refl _ _ => exact ⟨0,rfl⟩ + | next hS _ ih => + rcases loc_z2P hS with ⟨n,_,hn⟩ + rcases ih with ⟨m,hm⟩ + exact ⟨n + m,zMt holdout_0596_tm _ _ _ n m hn hm⟩ +def loc_z2R : WordList := [Q,K,K,Q,K,K,K,Q] +def loc_z2S : List CodeE := [ + (.More CP0 63 (.More CS00 31 (.More CP0 61 (.More CS00 30 (.More CS10 14 (.More CP0 27 (.Stop 27))))))), + (.More CT 125 (.More CS11 62 (.More CT 122 (.More CP1 245 (.More CT 488 (.More CP0 977 (.More CP1 1953 (.More CP0 3906 (.Stop 3906))))))))), + (.More CT 253 (.More CS10 126 (.More CT 249 (.More CT 497 (.More CT 993 (.More CT 1985 (.More CT 3969 (.More CT 7937 (.More CS10 3968 (.More CP0 7935 (.More CS00 3967 (.More CS00 1983 (.More CS00 991 (.More CS01 495 (.More CP1 990 (.More CP1 1980 (.More CP0 3960 (.Stop 3960)))))))))))))))))), + (.More CT 509 (.More CS10 254 (.More CT 505 (.More CT 1009 (.More CT 2017 (.More CT 4033 (.More CT 8065 (.More CT 16129 (.More CS10 8064 (.More CT 16125 (.More CP0 32251 (.More CS00 16125 (.More CS00 8062 (.More CT 16121 (.More CT 32241 (.More CT 64481 (.More CS10 32240 (.More CS10 16119 (.More CS00 8059 (.More CS00 4029 (.More CS00 2014 (.More CS10 1006 (.More CS11 502 (.More CP1 1004 (.More CP1 2008 (.More CP0 4016 (.Stop 4016))))))))))))))))))))))))))), + (.More CT 1021 (.More CS10 510 (.More CT 1017 (.More CT 2033 (.More CT 4065 (.More CT 8129 (.More CT 16257 (.More CT 32513 (.More CS10 16256 (.More CT 32509 (.More CT 65017 (.More CP1 130035 (.More CT 260068 (.More CT 520135 (.More CT 1040269 (.More CS10 520134 (.More CP0 1040267 (.More CP0 2080533 (.More CP1 4161065 (.More CT 8322128 (.More CT 16644255 (.More CT 33288509 (.More CS10 16644254 (.More CS10 8322126 (.More CS10 4161062 (.More CS11 2080530 (.More CP0 4161060 (.More CS11 2080529 (.More CP1 4161058 (.More CP1 8322116 (.More CP0 16644232 (.Stop 16644232)))))))))))))))))))))))))))))))), + (.More CT 2045 (.More CS10 1022 (.More CT 2041 (.More CT 4081 (.More CT 8161 (.More CT 16321 (.More CT 32641 (.More CT 65281 (.More CS10 32640 (.More CT 65277 (.More CT 130553 (.More CT 261105 (.More CT 522209 (.More CT 1044417 (.More CT 2088833 (.More CS10 1044416 (.More CT 2088829 (.More CT 4177657 (.More CT 8355313 (.More CT 16710625 (.More CT 33421249 (.More CT 66842497 (.More CS10 33421248 (.More CS11 16710623 (.More CP1 33421246 (.More CT 66842490 (.More CS00 33421245 (.More CT 66842487 (.More CT 133684973 (.More CT 267369945 (.More CS10 133684972 (.More CS10 66842485 (.More CS00 33421242 (.More CP1 66842483 (.More CP0 133684966 (.More CP0 267369931 (.More CS00 133684965 (.More CS01 66842482 (.More CP1 133684964 (.More CP1 267369928 (.More CP0 534739856 (.More CP1 1069479711 (.More CP1 2138959422 (.More CP1 4277918844 (.More CP0 8555837688 (.Stop 8555837688)))))))))))))))))))))))))))))))))))))))))))))), + (.More CT 4093 (.More CS10 2046 (.More CT 4089 (.More CT 8177 (.More CT 16353 (.More CT 32705 (.More CT 65409 (.More CT 130817 (.More CS10 65408 (.More CT 130813 (.More CT 261625 (.More CT 523249 (.More CT 1046497 (.More CT 2092993 (.More CT 4185985 (.More CS10 2092992 (.More CT 4185981 (.More CT 8371961 (.More CT 16743921 (.More CT 33487841 (.More CT 66975681 (.More CT 133951361 (.More CS10 66975680 (.More CS11 33487839 (.More CT 66975676 (.More CT 133951351 (.More CS11 66975675 (.More CT 133951348 (.More CT 267902695 (.More CT 535805389 (.More CS10 267902694 (.More CP0 535805387 (.More CT 1071610771 (.More CT 2143221541 (.More CT 4286443081 (.More CP1 8572886163 (.More CT 17145772324 (.More CT 34291544647 (.More CT 68583089293 (.More CT 137166178585 (.More CT 274332357169 (.More CT 548664714337 (.More CT 1097329428673 (.More CS10 548664714336 (.More CS10 274332357167 (.More CS00 137166178583 (.More CP1 274332357165 (.More CP1 548664714330 (.More CP1 1097329428660 (.More CP0 2194658857320 (.More CS11 1097329428659 (.More CP0 2194658857318 (.More CS11 1097329428658 (.More CP1 2194658857316 (.More CP0 4389317714632 (.More CP1 8778635429263 (.More CP1 17557270858526 (.More CP0 35114541717052 (.More CS11 17557270858525 (.More CP1 35114541717050 (.More CP1 70229083434100 (.More CP1 140458166868200 (.More CP0 280916333736400 (.Stop 280916333736400)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +] +def loc_z2T : WordList := [V,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,Q,Q,V,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,Q,K,V,V,V,V,Q,V,Q,V,V,V,V,V,Q,V,V,V,V] +def loc_z2U : WordList := [Q,K,K,K,Q,K,Q,Q,Q,K,K,K,Q,Q,K,Q,K,K,K,Q,K,K,Q,K,K,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q] +def loc_z2V : WordList := [K,K,K,K,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,K,K,K,Q,Q,K,K,K,Q,Q,Q,K,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q] +set_option maxRecDepth 500000 in +theorem loc_z2W : + ERounds 4 loc_z2R 11 (loc_z2T ++ loc_z2U) := by + have h1 : ERounds 4 loc_z2R (4 + loc_z2S.length) (loc_z2T ++ loc_z2U) := by + apply evalERounds_sound loc_z2S + decide + simpa using! h1 +set_option maxRecDepth 500000 in +theorem loc_z2X : + EGood 11 (loc_z2T ++ loc_z2U) := by + apply eGood_of_check 11 loc_z2T loc_z2U loc_z2V + · decide + · exact EGuard.T 1 _ + · decide + · decide + · decide + · decide + · decide + · decide + · decide + · norm_num [loc_z2T,loc_z2V,wordMass,wordMassK,wordScale] +def loc_z2Y : Cfg (Fin 2) (Fin 6) := + (([1,0,1,1,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,1] +> default) {{D}}> ([1,1] +> default)) +def loc_z2Z : Cfg (Fin 2) (Fin 6) := + (([1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1] +> default) {{B}}> ([0,0,1,0,0,0,0,1,0,1] +> default)) +def loc_z30 : Cfg (Fin 2) (Fin 6) := + (([1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1] +> default) {{B}}> ([1,0,1,0,0,1,1,0,0,0,0,0,0,0,0,1] +> default)) +def loc_z31 : Cfg (Fin 2) (Fin 6) := + (([1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1] +> default) {{D}}> ([1,1,1,0,0,0,0,0,0,1,0,1] +> default)) +def loc_z32 : Cfg (Fin 2) (Fin 6) := + (([1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1] +> default) {{C}}> ([0,1,0,0,0,0,1,1,0,0,1] +> default)) +def loc_z33 : Cfg (Fin 2) (Fin 6) := + (([1,0,1] +> default) {{D}}> ([1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,0,1] +> default)) +def loc_z34 : Cfg (Fin 2) (Fin 6) := + (([0,1,0,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1] +> default) {{A}}> ([0,0,1,1,0,0,0,0,1,1,0,0,1,0,0,0,1] +> default)) +def loc_z35 : Cfg (Fin 2) (Fin 6) := + (([1,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1] +> default) {{D}}> ([1,0,0,0,1] +> default)) +def loc_z36 : Cfg (Fin 2) (Fin 6) := + (([1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1] +> default) {{E}}> ([1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,0,1,0,0,0,1] +> default)) +def loc_z37 : Cfg (Fin 2) (Fin 6) := + (([1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1] +> default) {{D}}> ([1,0,1,0,1,0,1] +> default)) +def loc_z38 : Cfg (Fin 2) (Fin 6) := + (([0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1] +> default) {{D}}> ([1,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,1] +> default)) +def loc_z39 : Cfg (Fin 2) (Fin 6) := + (([1,1,1,1,0,1,1,1,0,1] +> default) {{D}}> ([0,0,0,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,0,1,0,0,0,0,0,1] +> default)) +def loc_z3a : Cfg (Fin 2) (Fin 6) := + (([1,1,0,1,0,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1] +> default) {{C}}> ([1,0,1,1,0,0,1,0,0,0,1,0,0,0,1] +> default)) +def loc_z3b : Cfg (Fin 2) (Fin 6) := + (([0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1] +> default) {{E}}> ([1,1,0,0,1,0,0,0,0,0,1,0,1] +> default)) +def loc_z3c : Cfg (Fin 2) (Fin 6) := + (([1,1,1,0,1,0,1,1,0,1,1,1,0,1] +> default) {{D}}> ([0,0,0,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,0,1,0,0,0,1,0,1] +> default)) +def loc_z3d : Cfg (Fin 2) (Fin 6) := + (([0,1,1,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1] +> default) {{A}}> ([0,0,1,0,0,0,1,0,1,0,1] +> default)) +def loc_z3e : Cfg (Fin 2) (Fin 6) := + (([1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1] +> default) {{C}}> ([1] +> default)) +def loc_z3f : Cfg (Fin 2) (Fin 6) := + (([1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1] +> default) {{B}}> ([1,0,0,1,1,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,1] +> default)) +theorem loc_z3g : (init []) [holdout_0596_tm]⊢⁺ loc_z2Y := by + unfold init loc_z2Y + simp only [append_cons,append_nil,z00] + execute +theorem loc_z3h : (loc_z2Y) [holdout_0596_tm]⊢⁺ loc_z2Z := by + unfold loc_z2Y loc_z2Z + simp only [append_cons,append_nil,z00] + execute +theorem loc_z3i : (loc_z2Z) [holdout_0596_tm]⊢⁺ loc_z30 := by + unfold loc_z2Z loc_z30 + simp only [append_cons,append_nil,z00] + execute +theorem loc_z3j : (loc_z30) [holdout_0596_tm]⊢⁺ loc_z31 := by + unfold loc_z30 loc_z31 + simp only [append_cons,append_nil,z00] + execute +theorem loc_z3k : (loc_z31) [holdout_0596_tm]⊢⁺ loc_z32 := by + unfold loc_z31 loc_z32 + simp only [append_cons,append_nil,z00] + execute +theorem loc_z3l : (loc_z32) [holdout_0596_tm]⊢⁺ loc_z33 := by + unfold loc_z32 loc_z33 + simp only [append_cons,append_nil,z00] + execute +theorem loc_z3m : (loc_z33) [holdout_0596_tm]⊢⁺ loc_z34 := by + unfold loc_z33 loc_z34 + simp only [append_cons,append_nil,z00] + execute +theorem loc_z3n : (loc_z34) [holdout_0596_tm]⊢⁺ loc_z35 := by + unfold loc_z34 loc_z35 + simp only [append_cons,append_nil,z00] + execute +theorem loc_z3o : (loc_z35) [holdout_0596_tm]⊢⁺ loc_z36 := by + unfold loc_z35 loc_z36 + simp only [append_cons,append_nil,z00] + execute +theorem z3p : (loc_z36) [holdout_0596_tm]⊢⁺ loc_z37 := by + unfold loc_z36 loc_z37 + simp only [append_cons,append_nil,z00] + execute +theorem z3q : (loc_z37) [holdout_0596_tm]⊢⁺ loc_z38 := by + unfold loc_z37 loc_z38 + simp only [append_cons,append_nil,z00] + execute +theorem z3r : (loc_z38) [holdout_0596_tm]⊢⁺ loc_z39 := by + unfold loc_z38 loc_z39 + simp only [append_cons,append_nil,z00] + execute +theorem z3s : (loc_z39) [holdout_0596_tm]⊢⁺ loc_z3a := by + unfold loc_z39 loc_z3a + simp only [append_cons,append_nil,z00] + execute +theorem z3t : (loc_z3a) [holdout_0596_tm]⊢⁺ loc_z3b := by + unfold loc_z3a loc_z3b + simp only [append_cons,append_nil,z00] + execute +theorem z3u : (loc_z3b) [holdout_0596_tm]⊢⁺ loc_z3c := by + unfold loc_z3b loc_z3c + simp only [append_cons,append_nil,z00] + execute +theorem z3v : (loc_z3c) [holdout_0596_tm]⊢⁺ loc_z3d := by + unfold loc_z3c loc_z3d + simp only [append_cons,append_nil,z00] + execute +theorem z3w : (loc_z3d) [holdout_0596_tm]⊢⁺ loc_z3e := by + unfold loc_z3d loc_z3e + simp only [append_cons,append_nil,z00] + execute +theorem z3x : (loc_z3e) [holdout_0596_tm]⊢⁺ loc_z3f := by + unfold loc_z3e loc_z3f + simp only [append_cons,append_nil,z00] + execute +theorem z3y : loc_z3f [holdout_0596_tm]⊢⁺ zCf 4 (evalWords loc_z2R default) := by + have h_target : zCf 4 (evalWords loc_z2R default) = (([1,1,1,0,1,1,1,0,1] +> default) {{C}}> ([1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1] +> default)) := by + unfold zCf zCR lh zCw zCs w_pre t d1 one loc_z2R + simp only [evalWords,d0,d1,t,one,zLp,z05,List.cons_append,List.nil_append,append_cons,append_nil,z00] + rw [h_target] + unfold loc_z3f + simp only [append_cons,append_nil,z00] + execute +theorem loc_z3z : (init []) [holdout_0596_tm]⊢⁺ zCf 4 (evalWords loc_z2R default) := + (zPt loc_z3g (zPt loc_z3h (zPt loc_z3i (zPt loc_z3j (zPt loc_z3k (zPt loc_z3l (zPt loc_z3m (zPt loc_z3n (zPt loc_z3o (zPt z3p (zPt z3q (zPt z3r (zPt z3s (zPt z3t (zPt z3u (zPt z3v (zPt z3w (zPt z3x z3y)))))))))))))))))) +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep holdout_0596_tm c (j + d) = some c') : + (multiStep holdout_0596_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep holdout_0596_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +theorem loc_z3A (m : Nat) : + ∃ N ≥ m,∃ q w,multiStep holdout_0596_tm (init []) N = some (zCf q (evalWords w default)) /\ EGood q w := by + induction m with + | zero => + rcases loc_z3z with ⟨k1,_,hk1⟩ + rcases loc_z2Q loc_z2W with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,11,loc_z2T ++ loc_z2U, + zMt holdout_0596_tm _ _ _ k1 k2 hk1 hk2,loc_z2X⟩ + | succ m ih => + rcases ih with ⟨N,hN,q,w,h_ms,h_good⟩ + rcases eGood_progress h_good with ⟨w',hStep,h_good'⟩ + rcases loc_z2P hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,q + 1,w', + zMt holdout_0596_tm _ _ _ N k h_ms h_step_k,h_good'⟩ +theorem holdout_0596_nonhalt : + IsDoesNotHalt holdout_0596_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases loc_z3A (n + 1) with ⟨N,hN,_,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := zIm h_N + rw [zMs,hn] at h_some + exact h_some + + + +theorem is_does_not_halt : IsNotHalt target_tm := holdout_0596_nonhalt + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1RA_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RA_1RC1LB_0LD0RA_1RF1LE_HHH1LF_1LC0LF.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RA_1RC1LB_0LD0RA_1RF1LE_HHH1LF_1LC0LF.lean new file mode 100644 index 00000000..7d6bb3f1 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RA_1RC1LB_0LD0RA_1RF1LE_HHH1LF_1LC0LF.lean @@ -0,0 +1,281 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.SharedDonorsA + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RB1RA_1RC1LB_0LD0RA_1RF1LE_HHH1LF_1LC0LF + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RA_1RC1LB_0LD0RA_1RF1LE_HHH1LF_1LC0LF" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +open BusyBeaver.Excursion +open M240 + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +theorem fixed64 (Lrem : T) : + (K qA (([0, 1, 1] : List (Fin 2)) ^ 4 +> Lrem) 0 default) [tm]⊢^{64} + K qB (([1] : List (Fin 2)) ^ 10 +> Lrem) 1 (([1] : List (Fin 2)) ^ 4 +> default) := by + run_steps 64 + +theorem bev3_nil_to_bodd0 : + (Bev 3 [] 3 [4]) [tm]⊢⁺ Bodd 0 [] 9 [] := by + unfold Bev Bodd + rw [encL_nil, show (([1] : List (Fin 2)) ^ (2 * 3 + 1) +> (default : T)) = + ([1] : List (Fin 2)) ^ (2 * 3 + 1) +> + ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> default) by simp] + refine sp_trans (b1_three_zeros 6 default (([1] : List (Fin 2)) ^ 3 +> encS [4])) ?_ + refine ss_sp_trans (a0_cascade 3 ((0 : Fin 2) >> default) (encS [4])) ?_ + simp only [z_cons_def, encS_cons, encS_nil] + exact stepN_to_sp (n := 82) (by decide) (by run_steps 82) + +theorem bounce7_to_beq0 : + (Bounce 7 [] [8]) [tm]⊢⁺ Beq 0 [(5, 7)] := by + unfold Bounce Beq + rw [encL_nil, encL_cons, encL_nil, encS_cons, encS_nil] + exact stepN_to_sp (n := 14) (by decide) (by run_steps 14) + +theorem beq0_to_bev0 : + (Beq 0 [(5, 7)]) [tm]⊢⁺ Bev 0 [(3, 7)] 4 [] := by + unfold Beq Bev + rw [encL_cons, encL_cons, encL_nil, encS_nil] + exact stepN_to_sp (n := 19) (by decide) (by run_steps 19) + +theorem amega_to_bev0 (z w : ℕ) (l : List (ℕ × ℕ)) : + (Amega z w l 4 []) [tm]⊢⁺ Bev 0 ((z, w) :: l) 3 [] := by + unfold Amega Bev + rw [encL_cons, zeros1, ones1 3, encS_nil] + exact stepN_to_sp (n := 1) (by decide) (by run_steps 1) + +theorem bev3_to_beq4 (z w : ℕ) (l' : List (ℕ × ℕ)) : + (Bev 3 ((z + 2, w) :: l') 3 []) [tm]⊢⁺ Beq 4 ((z, w) :: l') := by + unfold Bev Beq + rw [encL_cons, encL_cons, zeros3, zeros1, encS_nil] + refine sp_trans (b1_three_zeros 6 _ _) ?_ + refine ss_sp_trans (a0_cascade 3 _ default) ?_ + exact stepN_to_sp (n := 64) (by decide) (fixed64 _) + +theorem beq4_to_bev0 (z w : ℕ) (l' : List (ℕ × ℕ)) : + (Beq 4 ((z + 2, w) :: l')) [tm]⊢⁺ Bev 0 ((z, w) :: l') 12 [4] := by + unfold Beq Bev + rw [encL_cons, encL_cons, zeros3, zeros1, encS_cons, encS_nil] + have e0 : 2 * 4 + 2 = 9 + 1 := rfl + rw [e0] + refine sp_trans (b1_three_zeros 9 _ _) ?_ + have e1 : 9 + 1 = (2 * 3 + 1) + 3 := rfl + rw [e1, zeros3'] + rw [show (4 : ℕ) = 3 + 1 from rfl] + set Y : T := + (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (([0] : List (Fin 2)) ^ z +> + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (([0, 1, + 1] : List (Fin 2)) ^ (w + 5) +> encL l'))) with hY + refine sp_trans (a0_odd_zeros 3 0 ((0 : Fin 2) >> (0 : Fin 2) >> Y) default) ?_ + refine sp_trans (ebounce_zero 3 ((0 : Fin 2) >> Y) default) ?_ + refine ss_sp_trans (a0_cascade 3 ((0 : Fin 2) >> (0 : Fin 2) >> Y) default) ?_ + refine ss_sp_trans (stepN_to_ss (fixed64 _)) ?_ + rw [hY] + have h := + b1_two_zeros_one 10 ((1 : Fin 2) >> (0 : Fin 2) >> (([0] : List (Fin 2)) ^ z +> + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (([0, 1, + 1] : List (Fin 2)) ^ (w + 5) +> encL l')))) (([1] : List (Fin 2)) ^ 4 +> default) + simp only [Nat.mul_zero, Nat.zero_add, ones_one] + exact h + +theorem bounce8_to_beq0 (l : List (ℕ × ℕ)) : + (Bounce 8 l [4]) [tm]⊢⁺ Beq 0 ((1, 8) :: l) := by + unfold Bounce Beq + rw [encL_cons, encS_cons, encS_nil] + exact stepN_to_sp (n := 10) (by decide) (by run_steps 10) + +theorem bodd_s0_eq_nil (k : ℕ) (l : List (ℕ × ℕ)) (m : ℕ) : + Bodd k l m [0] = Bodd k l m [] := by + unfold Bodd + rw [encS_cons, encS_nil, p_zero_list, lb_append_nil, z_cons_def] + +def c0_756 : Cfg (Fin 2) (Fin 6) := K qD default 0 default + +theorem entry_756_part1 : c0_756 [tm]⊢⁺ Bodd 8 [] 18 [4] := by + have h50 : c0_756 [tm]⊢^{50} Bev 0 [] 3 [4] := by + unfold c0_756 Bev; rw [encL_nil, encS_cons, encS_nil]; run_steps 50 + refine sp_trans (stepN_to_sp (by decide) h50) ?_ + refine ss_sp_trans (R4nil_iter 3 0 0 [4]) ?_ + refine sp_trans bev3_nil_to_bodd0 ?_ + refine sp_trans (R8nil 0 4 []) ?_ + refine sp_trans (bev0_nil_bounce 7 [8]) ?_ + refine sp_trans bounce7_to_beq0 ?_ + refine sp_trans beq0_to_bev0 ?_ + refine sp_trans (R4 0 3 1 7 [] []) ?_ + exact R7 1 4 7 [] [] + +theorem entry_756_part2 : (Bodd 8 [] 18 [4]) [tm]⊢⁺ Bodd 27 [] 42 [4] := by + refine sp_trans (R8nil 8 5 [4]) ?_ + refine sp_trans (bev0_nil_bounce 23 [17, 4]) ?_ + refine sp_trans (R15 23 14 4 [] []) ?_ + refine sp_trans (amega_to_bev0 14 23 []) ?_ + refine ss_sp_trans (R4_iter 3 0 0 8 23 [] []) ?_ + refine sp_trans (bev3_to_beq4 6 23 []) ?_ + refine sp_trans (beq4_to_bev0 4 23 []) ?_ + refine ss_sp_trans (R4_iter 2 0 10 0 23 [] [4]) ?_ + exact R6 2 12 23 [] [4] + +theorem entry_756_part3 : (Bodd 27 [] 42 [4]) [tm]⊢⁺ Bodd 9 [(2, 61)] 18 [] := by + refine sp_trans (R8nil 27 10 [4]) ?_ + refine sp_trans (bev0_nil_bounce 61 [41, 4]) ?_ + refine sp_trans (R15 61 38 4 [] []) ?_ + refine sp_trans (amega_to_bev0 38 61 []) ?_ + refine ss_sp_trans (R4_iter 3 0 0 32 61 [] []) ?_ + refine sp_trans (bev3_to_beq4 30 61 []) ?_ + refine sp_trans (beq4_to_bev0 28 61 []) ?_ + refine ss_sp_trans (R4_iter 12 0 0 4 61 [] [4]) ?_ + refine sp_trans (R5 8 2 61 [] [4]) ?_ + refine sp_trans (bounce8_to_beq0 [(2, 61)]) ?_ + rw [← bodd_s0_eq_nil 9 [(2, 61)] 18] + exact R3 0 8 [(2, 61)] + +theorem entry_756_part4 : (Bodd 9 [(2, 61)] 18 []) [tm]⊢⁺ Beq 5 [(2, 33), (118, 275)] := by + refine sp_trans (R8 9 4 0 61 [] []) ?_ + refine sp_trans (R6 0 29 61 [] [17]) ?_ + refine sp_trans (R8nil 63 29 [17]) ?_ + refine sp_trans (bev0_nil_bounce 133 [96, 17]) ?_ + refine sp_trans (R15 133 93 17 [] []) ?_ + refine sp_trans (R9 12 59 133 [] []) ?_ + refine sp_trans (R12 12 [(59, 133)]) ?_ + refine sp_trans (R1 12 57 133 []) ?_ + refine ss_sp_trans (R4_iter 28 0 10 1 133 [] [17]) ?_ + refine sp_trans (R7 28 38 133 [] [17]) ?_ + refine sp_trans (R8nil 134 59 [38, 17]) ?_ + refine sp_trans (bev0_nil_bounce 275 [197, 38, 17]) ?_ + refine sp_trans (R15 275 194 38 [] [17]) ?_ + refine sp_trans (R9 33 118 275 [] [17]) ?_ + exact R14 33 2 [(118, 275)] + +theorem entry_756 : c0_756 [tm]⊢⁺ Beq 5 [(2, 33), (118, 275)] := + sp_trans entry_756_part1 (sp_trans entry_756_part2 (sp_trans entry_756_part3 entry_756_part4)) + +-- E1 Table Isomorphism Bridge from `target_tm` (#756) to `tm` (#240) +def sigma756 : Fin 6 → Fin 6 + | 0 => 3 + | 1 => 4 + | 2 => 1 + | 3 => 2 + | 4 => 5 + | 5 => 0 + +def flipTape (t : Tape (Fin 2)) : Tape (Fin 2) := + ⟨t.1, t.3, t.2⟩ + +def mapCfg756 (c : Cfg (Fin 2) (Fin 6)) : Cfg (Fin 2) (Fin 6) := + ⟨c.q.map sigma756, flipTape c.tape⟩ + +theorem mapCfg756_init : mapCfg756 (init ([] : List (Fin 2))) = c0_756 := rfl + +theorem fin6_cases (P : Fin 6 → Prop) + (h0 : P 0) (h1 : P 1) (h2 : P 2) (h3 : P 3) (h4 : P 4) (h5 : P 5) : + ∀ q : Fin 6, P q + | ⟨0, _⟩ => h0 + | ⟨1, _⟩ => h1 + | ⟨2, _⟩ => h2 + | ⟨3, _⟩ => h3 + | ⟨4, _⟩ => h4 + | ⟨5, _⟩ => h5 + | ⟨n + 6, h⟩ => by omega + +theorem fin2_cases (P : Fin 2 → Prop) (h0 : P 0) (h1 : P 1) : ∀ a : Fin 2, P a + | ⟨0, _⟩ => h0 + | ⟨1, _⟩ => h1 + | ⟨n + 2, h⟩ => by omega + +theorem step_mapCfg756 (c c' : Cfg (Fin 2) (Fin 6)) (h : c [target_tm]⊢ c') : + (mapCfg756 c) [tm]⊢ (mapCfg756 c') := by + rcases c with ⟨_ | q, ⟨hd, l, r⟩⟩ + · cases h + · revert h + refine fin6_cases (fun q => + (⟨some q, ⟨hd, l, r⟩⟩ [target_tm]⊢ c') → + ((mapCfg756 ⟨some q, ⟨hd, l, r⟩⟩) [tm]⊢ (mapCfg756 c'))) ?_ ?_ ?_ ?_ ?_ ?_ q + all_goals + refine fin2_cases (fun hd => + (⟨some _, ⟨hd, l, r⟩⟩ [target_tm]⊢ c') → + ((mapCfg756 ⟨some _, ⟨hd, l, r⟩⟩) [tm]⊢ (mapCfg756 c'))) ?_ ?_ hd + all_goals + intro h; cases h <;> rfl + +theorem multiStep_mapCfg756 (n : ℕ) : ∀ (c c' : Cfg (Fin 2) (Fin 6)), + (c [target_tm]⊢^{n} c') → ((mapCfg756 c) [tm]⊢^{n} (mapCfg756 c')) := by + induction n with + | zero => + intro c c' h + rw [ms_zero] at h ⊢ + cases h; rfl + | succ n ih => + intro c c' h + rw [ms_succ, Option.bind_eq_some_iff] at h + rcases h with ⟨c_mid, h1, h2⟩ + exact ms_trans tm _ _ _ n 1 (ih c c_mid h1) (step_mapCfg756 c_mid c' h2) + +theorem stepStar_mapCfg756 {c c' : Cfg (Fin 2) (Fin 6)} (h : c [target_tm]⊢* c') : + (mapCfg756 c) [tm]⊢* (mapCfg756 c') := by + rcases h with ⟨n, hn⟩ + exact ⟨n, multiStep_mapCfg756 n c c' hn⟩ + +theorem step_isNone_mapCfg756 (c : Cfg (Fin 2) (Fin 6)) + (h : (step target_tm c).isNone) : (step tm (mapCfg756 c)).isNone := by + rcases c with ⟨_ | q, ⟨hd, l, r⟩⟩ + · rfl + · revert h + refine fin6_cases (fun q => + (step target_tm ⟨some q, ⟨hd, l, r⟩⟩).isNone → + (step tm (mapCfg756 ⟨some q, ⟨hd, l, r⟩⟩)).isNone) ?_ ?_ ?_ ?_ ?_ ?_ q + all_goals + refine fin2_cases (fun hd => + (step target_tm ⟨some _, ⟨hd, l, r⟩⟩).isNone → + (step tm (mapCfg756 ⟨some _, ⟨hd, l, r⟩⟩)).isNone) ?_ ?_ hd + all_goals + intro h; first | rfl | cases h + + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + have h_inv0 : RootInv (Beq 5 [(2, 33), (118, 275)]) := + root_of_5 (validL_cons (by omega) (validL_cons (by omega) validL_nil)) + intro cfg ⟨n, hn⟩ + cases h_step : step target_tm cfg with + | some _ => rfl + | none => + have h_ms : c0_756 [tm]⊢^{n} mapCfg756 cfg := by + rw [← mapCfg756_init] + exact multiStep_mapCfg756 n (init []) cfg hn + have h_halt_c0 : BusyBeaver.Excursion.HaltsIn tm c0_756 n := + ⟨mapCfg756 cfg, h_ms, step_isNone_mapCfg756 cfg (by simp [h_step])⟩ + rcases BusyBeaver.Excursion.haltsIn_reduce_stepStar + (sp_to_ss entry_756) h_halt_c0 with ⟨m, _, h_halt_m⟩ + exact False.elim (BusyBeaver.Excursion.not_haltsIn_of_advances + root_advances m _ h_inv0 h_halt_m) + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1RA_1RC1LB_0LD0RA_1RF1LE_HHH1LF_1LC0LF diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RA_1RC1LB_1LD0RA_1LA0LE_HHH0LF_0RC0LB.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RA_1RC1LB_1LD0RA_1LA0LE_HHH0LF_0RC0LB.lean new file mode 100644 index 00000000..da8d5c50 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RA_1RC1LB_1LD0RA_1LA0LE_HHH0LF_0RC0LB.lean @@ -0,0 +1,922 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1RA_1RC1LB_1LD0RA_1LA0LE_HHH0LF_0RC0LB + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +local macro "normalize" : tactic => `(tactic| ( + try simp only [ListBlank.append_cons, ListBlank.append_nil, + ListBlank.head_cons, ListBlank.tail_cons, + ListBlank.head_default, ListBlank.head_default_fin, ListBlank.tail_default, + ListBlank.cons_zero_default, ListBlank.cons_default_default, + list_pow_zero, list_pow_succ, + List.nil_append, List.cons_append, List.append_nil, + Nat.mul_zero, Nat.mul_add, Nat.mul_one])) +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RA_1RC1LB_1LD0RA_1LA0LE_HHH0LF_0RC0LB" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {zG_ zL_ α β γ : Type*} [Inhabited zG_] [Inhabited zL_] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (c : Cfg Γ Λ) : multiStep M c 0 = some c := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (c : Cfg Γ Λ) : multiStep M c 1 = step M c := rfl + +theorem multiStep_succ (M : Machine Γ Λ) (c : Cfg Γ Λ) (n : ℕ) : + multiStep M c (n + 1) = (multiStep M c n).bind (step M) := by + simp only [multiStep, Function.iterate_succ_apply'] + +theorem multiStep_add (M : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : ℕ) : + multiStep M c₁ (n + m) = (multiStep M c₁ n).bind (fun c₂ => multiStep M c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans (M : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : ℕ) + (h₁ : c₁ [M]⊢^{n} c₂) (h₂ : c₂ [M]⊢^{m} c₃) : + c₁ [M]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +@[simp] theorem pow_zero_list (u : List (Fin 2)) : u ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (u : List (Fin 2)) (n : Nat) : u ^ (n + 1) = u ++ u ^ n := rfl +@[simp] theorem nil_append_list (l : List (Fin 2)) : ([] : List (Fin 2)) ++ l = l := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : + (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl +@[simp] theorem init_nil : (init ([] : List (Fin 2))) = ⟨some A, ⟨0, default, default⟩⟩ := rfl + +omit [Inhabited Γ] in +@[simp] +theorem listblank_append_pow_add (s : ListBlank (Fin 2)) (n m : ℕ) : + (s <+ (([1] : List (Fin 2)) ^ n)) <+ (([1] : List (Fin 2)) ^ m) = + s <+ (([1] : List (Fin 2)) ^ (n + m)) := by + rw [listblank_append_append, list_pow_add_comm, ← list_pow_add] + +theorem listblank_right_pow_add (s : ListBlank (Fin 2)) (n m : ℕ) : + (([1] : List (Fin 2)) ^ n) +> ((([1] : List (Fin 2)) ^ m) +> s) = + (([1] : List (Fin 2)) ^ (n + m)) +> s := by + rw [← listblank_append_right_assoc, ← list_pow_add] + +-- ============================================================================ +-- Section 6: 2nd-Order Digit-Stack Encodings & Inner Walk Lemmas +-- ============================================================================ + +/-- Left digit stack (inside-out order: head `a` is closest to the TM head). + Each digit `a : ℕ` encodes a separator `0` followed by `1^{a+1}`. -/ +def encLeft : List ℕ → ListBlank (Fin 2) + | [] => default + | a :: L => ((encLeft L).cons 0) <+ (([1] : List (Fin 2)) ^ (a + 1)) + +/-- Right digit stack (inside-out order: head `d` is closest to the TM head). + Each digit `d : ℕ` encodes `1^{d+1}` followed by a `00` separator. -/ +def encRight : List ℕ → ListBlank (Fin 2) + | [] => default + | d :: R => (([1] : List (Fin 2)) ^ (d + 1)) +> (((encRight R).cons 0).cons 0) + +@[simp] theorem encLeft_nil : encLeft [] = default := rfl +@[simp] theorem encLeft_cons (a : ℕ) (L : List ℕ) : + encLeft (a :: L) = ((encLeft L).cons 0) <+ (([1] : List (Fin 2)) ^ (a + 1)) := rfl +@[simp] theorem encRight_nil : encRight [] = default := rfl +@[simp] theorem encRight_cons (d : ℕ) (R : List ℕ) : + encRight (d :: R) = (([1] : List (Fin 2)) ^ (d + 1)) +> (((encRight R).cons 0).cons 0) := rfl + +/-- Increment the head digit of a stack (or push `0` if empty), corresponding to `.cons 1`. -/ +def bumpHead : List ℕ → List ℕ + | [] => [0] + | b :: L => (b + 1) :: L + +@[simp] theorem encLeft_cons_one (L : List ℕ) : + (1 : Fin 2) >> encLeft L = encLeft (bumpHead L) := by + cases L with + | nil => simp [bumpHead, encLeft] + | cons b L' => rfl + +@[simp] theorem encRight_cons_one (R : List ℕ) : + (1 : Fin 2) >> encRight R = encRight (bumpHead R) := by + cases R with + | nil => simp [bumpHead, encRight] + | cons d R' => rfl + +/-- Head digit of a right stack under `.tail` (`0` if empty, `d` if `d :: _`), so `(1 : Fin 2) >> (encRight R).tail = encRight (tailWeight R :: R.tail)`. -/ +def tailWeight : List ℕ → ℕ + | [] => 0 + | d :: _ => d + +@[simp] theorem encRight_tail_cons_one (R : List ℕ) : + (1 : Fin 2) >> (encRight R).tail = encRight (tailWeight R :: R.tail) := by + cases R with + | nil => simp [tailWeight, encRight] + | cons d R' => dsimp [tailWeight, List.tail]; simp + +macro "finish" : tactic => `(tactic| (refine ⟨0, ?_⟩; simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, zero_cons_default, encLeft_nil, encRight_nil, encLeft_cons_one, encRight_cons_one, encRight_tail_cons_one, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, multiStep_zero]; try rfl)) +macro "step" : tactic => `(tactic| ( + try refine stepPlus_stepStar ?_ + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, listblank_append_cons, listblank_append_nil, Turing.ListBlank.head_cons, default_head] + apply step_stepStar_stepPlus (by rfl) + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, + zero_cons_default, default_head, default_tail])) +macro "execute" n:num : tactic => `(tactic| ( + iterate $n step + finish)) + +/-- State `B` separator configuration: state `B` scanning the `0` separator between `L` and `R`. -/ +def cfg_B (L R : List ℕ) : Cfg (Fin 2) (Fin 6) := + ⟨some B, ⟨0, encLeft L, encRight R⟩⟩ + +/-- Unified state-`C` separator configuration: state `C` scanning the `0` separator between `L` and `(encRight R).tail`. -/ +def cfg_CR (L R : List ℕ) : Cfg (Fin 2) (Fin 6) := + ⟨some C, ⟨0, encLeft L, (encRight R).tail⟩⟩ + +/-- State `C` separator configuration: state `C` scanning the `0` separator between `L` and `R`. -/ +def cfg_C (L R : List ℕ) : Cfg (Fin 2) (Fin 6) := + ⟨some C, ⟨0, encLeft L, encRight R⟩⟩ + +/-- Specialization of `cfg_CR` to `0 :: R` (triple-zero `000` separator before `encRight R`). -/ +def cfg_C000 (L R : List ℕ) : Cfg (Fin 2) (Fin 6) := + cfg_CR L (0 :: R) + +/-- Canonical B-turnaround configuration at the right blank (`R = []`), with rightmost digit `a`. -/ +def cfg_TurnB (L : List ℕ) (a : ℕ) : Cfg (Fin 2) (Fin 6) := + cfg_B (a :: L) [] + +/-- Complete 2nd-order stack configuration space `(mode, L, R)`. -/ +inductive StackMode + | B + | CR + +def evalStackCfg : StackMode → List ℕ → List ℕ → Cfg (Fin 2) (Fin 6) + | .B, L, R => cfg_B L R + | .CR, L, R => cfg_CR L R + +def IsInStackSystem (cfg : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ m L R, cfg = evalStackCfg m L R + +/-- State `A` walks right across `1^k` (`A, 1 -> 1RA`). -/ +theorem a_walk_right (k : ℕ) (l r : ListBlank (Fin 2)) : + (l {{A}}> ((([1] : List (Fin 2)) ^ k) +> r)) [target_tm]⊢* + ((l <+ (([1] : List (Fin 2)) ^ k)) {{A}}> r) := by + induction k generalizing l r with + | zero => + dsimp [HPow.hPow] + try exact ⟨0, rfl⟩ + | succ k ih => + have h_split : k + 1 = 1 + k := by omega + rw [h_split, list_pow_add, listblank_append_right_assoc] + have h1 : (l {{A}}> (([1] : List (Fin 2)) ^ 1 +> (([1] : List (Fin 2)) ^ k +> r))) + [target_tm]⊢⁺ + ((l <+ (([1] : List (Fin 2)) ^ 1)) {{A}}> (([1] : List (Fin 2)) ^ k +> r)) := by + dsimp [HPow.hPow] + execute 1 + refine stepStar_trans (stepPlus_stepStar h1) ?_ + refine stepStar_trans (ih (l <+ (([1] : List (Fin 2)) ^ 1)) r) ?_ + rw [← listblank_append_right_assoc, list_pow_add_comm] + try exact ⟨0, rfl⟩ + +/-- State `B` walks left across `1^k` (`B, 1 -> 1LB`). -/ +theorem b_walk_left (k : ℕ) (l r : ListBlank (Fin 2)) : + ((l <+ (([1] : List (Fin 2)) ^ k)) <{{B}} r) [target_tm]⊢* + (l <{{B}} ((([1] : List (Fin 2)) ^ k) +> r)) := by + induction k generalizing l r with + | zero => + dsimp [HPow.hPow] + try exact ⟨0, rfl⟩ + | succ k ih => + have h_split : k + 1 = 1 + k := by omega + rw [h_split, list_pow_add, listblank_append_right_assoc] + have h1 : (((l <+ (([1] : List (Fin 2)) ^ k)) <+ (([1] : List (Fin 2)) ^ 1)) <{{B}} r) + [target_tm]⊢⁺ + ((l <+ (([1] : List (Fin 2)) ^ k)) <{{B}} (([1] : List (Fin 2)) ^ 1 +> r)) := by + dsimp [HPow.hPow] + execute 1 + refine stepStar_trans (stepPlus_stepStar h1) ?_ + refine stepStar_trans (ih l (([1] : List (Fin 2)) ^ 1 +> r)) ?_ + rw [← listblank_append_right_assoc, list_pow_add_comm] + try exact ⟨0, rfl⟩ + +-- ============================================================================ +-- Section 6B: Complete Local Separator Rules (8 Rules across 2 Modes) +-- ============================================================================ + +-- 1. Mode B rules (2 Rules) + +/-- From `cfg_B L []`, the TM increments the head of `L` and enters `cfg_CR (bumpHead L) []` in 1 step. -/ +theorem rule_B_nil (L : List ℕ) : + (cfg_B L []) [target_tm]⊢⁺ (cfg_CR (bumpHead L) []) := by + unfold cfg_B cfg_CR + rw [encRight_nil] + execute 1 + +/-- Helper: from state `C` on `1` with `encLeft K` on the left and `1^d 00 encRight R` on the right, + the TM walks right across `1^d` and enters `cfg_B (d :: K) R`. -/ +theorem c_sweep_right (K R : List ℕ) (d : ℕ) : + (⟨some C, ⟨1, encLeft K, (([1] : List (Fin 2)) ^ d) +> (((encRight R).cons 0).cons 0)⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ (cfg_B (d :: K) R) := by + unfold cfg_B + have h_pre : (⟨some C, ⟨1, encLeft K, (([1] : List (Fin 2)) ^ d) +> (((encRight R).cons 0).cons 0)⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + (((encLeft K).cons 0) {{A}}> ((([1] : List (Fin 2)) ^ d) +> (((encRight R).cons 0).cons 0))) := by + execute 1 + refine stepPlus_stepStar_stepPlus h_pre ?_ + refine stepStar_trans (a_walk_right d ((encLeft K).cons 0) (((encRight R).cons 0).cons 0)) ?_ + have h_post : ((((encLeft K).cons 0) <+ (([1] : List (Fin 2)) ^ d)) {{A}}> (((encRight R).cons 0).cons 0)) + [target_tm]⊢⁺ + (⟨some B, ⟨0, (((encLeft K).cons 0) <+ (([1] : List (Fin 2)) ^ d)) <+ (([1] : List (Fin 2)) ^ 1), encRight R⟩⟩ : Cfg (Fin 2) (Fin 6)) := by + dsimp [HPow.hPow] + execute 1 + refine stepStar_trans (stepPlus_stepStar h_post) ?_ + rw [listblank_append_pow_add, ← encLeft_cons d K] + try exact ⟨0, rfl⟩ + +/-- From `cfg_B L (d :: R)`, the TM increments the head of `L`, shifts `d` onto `L`, and enters `cfg_B (d :: bumpHead L) R`. -/ +theorem rule_B_cons (L R : List ℕ) (d : ℕ) : + (cfg_B L (d :: R)) [target_tm]⊢⁺ (cfg_B (d :: bumpHead L) R) := by + unfold cfg_B + rw [encRight_cons d R] + have h_split : d + 1 = 1 + d := by omega + rw [h_split, list_pow_add, listblank_append_right_assoc] + have h_step1 : (⟨some B, ⟨0, encLeft L, (([1] : List (Fin 2)) ^ 1) +> ((([1] : List (Fin 2)) ^ d) +> (((encRight R).cons 0).cons 0))⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + (⟨some C, ⟨1, encLeft (bumpHead L), (([1] : List (Fin 2)) ^ d) +> (((encRight R).cons 0).cons 0)⟩⟩ : Cfg (Fin 2) (Fin 6)) := by + dsimp [HPow.hPow] + execute 1 + exact stepPlus_trans h_step1 (c_sweep_right (bumpHead L) R d) + +-- 2. Mode CR rules (6 Unified Rules) + +/-- From `cfg_CR [] R`, the TM bounces off the left blank and enters `cfg_B [] ((tailWeight R + 2) :: R.tail)` in 5 steps. -/ +theorem rule_CR_nil (R : List ℕ) : + (cfg_CR [] R) [target_tm]⊢⁺ (cfg_B [] ((tailWeight R + 2) :: R.tail)) := by + unfold cfg_CR cfg_B + have h_pre : (⟨some C, ⟨0, encLeft [], (encRight R).tail⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + (⟨some D, ⟨0, default, encRight (tailWeight R :: R.tail)⟩⟩ : Cfg (Fin 2) (Fin 6)) := by + rw [encLeft_nil] + execute 1 + refine stepPlus_trans h_pre ?_ + rw [encLeft_nil, encRight_cons (tailWeight R) R.tail, encRight_cons (tailWeight R + 2) R.tail] + dsimp [HPow.hPow] + execute 4 + +/-- Halting configuration reached when `cfg_CR (0 :: L) R` steps left across `1` onto `0` in 2 steps. -/ +def cfg_Halt_CR_zero (L R : List ℕ) : Cfg (Fin 2) (Fin 6) := + ⟨some E, ⟨0, encLeft L, (0 : Fin 2) >> encRight (tailWeight R :: R.tail)⟩⟩ + +/-- From `cfg_CR (0 :: L) R`, the TM halts in 2 steps at state `E` on `0`. -/ +theorem rule_CR_zero (L R : List ℕ) : + ((cfg_CR (0 :: L) R) [target_tm]⊢⁺ (cfg_Halt_CR_zero L R)) ∧ + (step target_tm (cfg_Halt_CR_zero L R)).isNone := by + refine ⟨?_, rfl⟩ + unfold cfg_CR cfg_Halt_CR_zero + rw [encLeft_cons 0 L] + dsimp [HPow.hPow] + execute 2 + +/-- From `cfg_CR [1] R`, the TM bounces at the left boundary and enters `cfg_B [0] ((tailWeight R + 3) :: R.tail)` in 18 steps. -/ +theorem rule_CR_one_nil (R : List ℕ) : + (cfg_CR [1] R) [target_tm]⊢⁺ (cfg_B [0] ((tailWeight R + 3) :: R.tail)) := by + unfold cfg_CR cfg_B + have h_pre : (⟨some C, ⟨0, encLeft [1], (encRight R).tail⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + (⟨some D, ⟨0, default, (1 : Fin 2) >> (0 : Fin 2) >> encRight (tailWeight R :: R.tail)⟩⟩ : Cfg (Fin 2) (Fin 6)) := by + rw [encLeft_cons 1 [], encLeft_nil] + dsimp [HPow.hPow] + execute 5 + refine stepPlus_trans h_pre ?_ + rw [encLeft_cons 0 [], encLeft_nil, encRight_cons (tailWeight R) R.tail, encRight_cons (tailWeight R + 3) R.tail] + dsimp [HPow.hPow] + execute 13 + +/-- From `cfg_CR (1 :: b :: L) R`, the TM merges `1` and `b` across the separator and walks left in state `B`, + entering `cfg_B L ((b + tailWeight R + 4) :: R.tail)` in `b + 15` steps. -/ +theorem rule_CR_one_cons (b : ℕ) (L R : List ℕ) : + (cfg_CR (1 :: b :: L) R) [target_tm]⊢⁺ (cfg_B L ((b + tailWeight R + 4) :: R.tail)) := by + unfold cfg_CR cfg_B + have h_pre : (⟨some C, ⟨0, encLeft (1 :: b :: L), (encRight R).tail⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + (⟨some A, ⟨0, (((encLeft L).cons 0) <+ (([1] : List (Fin 2)) ^ b)) <+ (([1] : List (Fin 2)) ^ 3), encRight (tailWeight R :: R.tail)⟩⟩ : Cfg (Fin 2) (Fin 6)) := by + rw [encLeft_cons 1 (b :: L), encLeft_cons b L] + dsimp [HPow.hPow] + execute 9 + refine stepPlus_stepStar_stepPlus h_pre ?_ + have h_mid : (⟨some A, ⟨0, (((encLeft L).cons 0) <+ (([1] : List (Fin 2)) ^ b)) <+ (([1] : List (Fin 2)) ^ 3), encRight (tailWeight R :: R.tail)⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + (((((encLeft L).cons 0) <+ (([1] : List (Fin 2)) ^ b)) <+ (([1] : List (Fin 2)) ^ 4)) <{{B}} encRight (tailWeight R :: R.tail)) := by + rw [encRight_cons (tailWeight R) R.tail] + dsimp [HPow.hPow] + execute 2 + refine stepStar_trans (stepPlus_stepStar h_mid) ?_ + rw [listblank_append_pow_add] + refine stepStar_trans (b_walk_left (b + 4) ((encLeft L).cons 0) (encRight (tailWeight R :: R.tail))) ?_ + rw [encRight_cons (tailWeight R) R.tail, listblank_right_pow_add] + have h_add : (b + 4) + (tailWeight R + 1) = (b + tailWeight R + 4) + 1 := by omega + rw [h_add, ← encRight_cons (b + tailWeight R + 4) R.tail] + finish + +/-- From `cfg_CR (2 :: L) R`, the TM increments the head of `L`, normalizes `R` with a leading `0`, + and enters `cfg_CR (bumpHead L) (0 :: tailWeight R :: R.tail)` in 5 steps. -/ +theorem rule_CR_two (L R : List ℕ) : + (cfg_CR (2 :: L) R) [target_tm]⊢⁺ (cfg_CR (bumpHead L) (0 :: tailWeight R :: R.tail)) := by + unfold cfg_CR + rw [encLeft_cons 2 L, encRight_cons 0 (tailWeight R :: R.tail)] + dsimp [HPow.hPow] + execute 5 + +/-- General helper for `L = (a + 3) :: L'` in state `C` with arbitrary right tape `r`. -/ +theorem c_ge3_gen (L : List ℕ) (a : ℕ) (r : ListBlank (Fin 2)) : + (⟨some C, ⟨0, encLeft ((a + 3) :: L), r⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + (⟨some C, ⟨0, encLeft ((a + 1) :: bumpHead L), (1 : Fin 2) >> r⟩⟩ : Cfg (Fin 2) (Fin 6)) := by + rw [encLeft_cons (a + 3) L] + have h_split : a + 3 + 1 = 3 + (a + 1) := by omega + rw [h_split, list_pow_add, listblank_append_right_assoc] + have h_pre : (⟨some C, ⟨0, (((encLeft L).cons 0) <+ (([1] : List (Fin 2)) ^ (a + 1))) <+ (([1] : List (Fin 2)) ^ 3), r⟩⟩ : Cfg (Fin 2) (Fin 6)) + [target_tm]⊢⁺ + ((((encLeft L).cons 0) <+ (([1] : List (Fin 2)) ^ (a + 1))) <{{B}} ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> r)) := by + dsimp [HPow.hPow] + execute 4 + refine stepPlus_stepStar_stepPlus h_pre ?_ + refine stepStar_trans (b_walk_left (a + 1) ((encLeft L).cons 0) ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> r)) ?_ + have h_split2 : a + 1 = 1 + a := by omega + rw [h_split2, list_pow_add, listblank_append_right_assoc] + have h_mid : (((encLeft L).cons 0) <{{B}} ((([1] : List (Fin 2)) ^ 1) +> ((([1] : List (Fin 2)) ^ a) +> ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> r)))) + [target_tm]⊢⁺ + (((encLeft (bumpHead L)).cons 0) {{A}}> ((([1] : List (Fin 2)) ^ a) +> ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> r))) := by + dsimp [HPow.hPow] + execute 2 + refine stepStar_trans (stepPlus_stepStar h_mid) ?_ + refine stepStar_trans (a_walk_right a ((encLeft (bumpHead L)).cons 0) ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> r)) ?_ + have h_post : ((((encLeft (bumpHead L)).cons 0) <+ (([1] : List (Fin 2)) ^ a)) {{A}}> ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> r)) + [target_tm]⊢⁺ + (⟨some C, ⟨0, (((encLeft (bumpHead L)).cons 0) <+ (([1] : List (Fin 2)) ^ a)) <+ (([1] : List (Fin 2)) ^ 2), (1 : Fin 2) >> r⟩⟩ : Cfg (Fin 2) (Fin 6)) := by + dsimp [HPow.hPow] + execute 2 + refine stepStar_trans (stepPlus_stepStar h_post) ?_ + rw [listblank_append_pow_add] + have h_add : a + 2 = (1 + a) + 1 := by omega + rw [h_add, ← encLeft_cons (1 + a) (bumpHead L)] + try exact ⟨0, rfl⟩ + +/-- From `cfg_CR ((a + 3) :: L) R`, the TM decrements the top block by 2, increments the next block of `L`, + and increments the top block of `R`. -/ +theorem rule_CR_ge3 (L R : List ℕ) (a : ℕ) : + (cfg_CR ((a + 3) :: L) R) [target_tm]⊢⁺ + (cfg_CR ((a + 1) :: bumpHead L) ((tailWeight R + 1) :: R.tail)) := by + unfold cfg_CR + have h_eq : (1 : Fin 2) >> (encRight R).tail = (encRight ((tailWeight R + 1) :: R.tail)).tail := by + rw [encRight_tail_cons_one] + unfold encRight + simp only [pow_succ_list, cons_append_list, nil_append_list, listblank_append_cons, Turing.ListBlank.tail_cons] + rw [← h_eq] + exact c_ge3_gen L a (encRight R).tail + +-- ============================================================================ +-- Section 6C: Initial Reachability & 2nd-Order Stack Cryptid Closure +-- ============================================================================ + +theorem init_to_cfg_B : + (init []) [target_tm]⊢⁺ (cfg_B [3, 1] []) := by + unfold cfg_B + rw [encLeft_cons, encLeft_cons, encLeft_nil, encRight_nil] + dsimp [HPow.hPow] + execute 26 + +theorem init_reaches_stack_system : + ∃ cfg₀, ((init []) [target_tm]⊢⁺ cfg₀) ∧ IsInStackSystem cfg₀ := by + refine ⟨cfg_B [3, 1] [], init_to_cfg_B, ?_⟩ + exact ⟨.B, [3, 1], [], rfl⟩ + +theorem bumpHead_eq_cons (S : List ℕ) : bumpHead S = tailWeight (bumpHead S) :: S.tail := by + cases S <;> rfl + +/-- Inductive peel contraction: `k` iterations of `rule_CR_ge3` peel `2 * k` from the top block of `L`, + adding `k` to the second block of `L` and `k` to the top block of `R`. -/ +theorem rule_CR_peel_all (L R : List ℕ) (a b d k : ℕ) : + (cfg_CR ((a + 1 + 2 * k) :: b :: L) (d :: R)) [target_tm]⊢* + (cfg_CR ((a + 1) :: (b + k) :: L) ((d + k) :: R)) := by + induction k generalizing a b d with + | zero => + simp only [Nat.mul_zero, Nat.add_zero] + try exact ⟨0, rfl⟩ + | succ k ih => + have h_split : a + 1 + 2 * (k + 1) = (a + 2 * k) + 3 := by omega + rw [h_split] + refine stepStar_trans (stepPlus_stepStar (rule_CR_ge3 (b :: L) (d :: R) (a + 2 * k))) ?_ + dsimp [bumpHead, tailWeight, List.tail] + have h_next : a + 2 * k + 1 = a + 1 + 2 * k := by omega + rw [h_next] + refine stepStar_trans (ih a (b + 1) (d + 1)) ?_ + have hb : b + 1 + k = b + (k + 1) := by omega + have hd : d + 1 + k = d + (k + 1) := by omega + rw [hb, hd] + try exact ⟨0, rfl⟩ + +/-- Complete 2nd-order stack cryptid closure theorem (`stack_system_closed`). -/ +theorem stack_system_closed (cfg : Cfg (Fin 2) (Fin 6)) (h : IsInStackSystem cfg) : + ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ + (IsInStackSystem cfg' ∨ (step target_tm cfg').isNone) := by + rcases h with ⟨m, L, R, rfl⟩ + cases m with + | B => + cases R with + | nil => + exact ⟨cfg_CR (bumpHead L) [], rule_B_nil L, Or.inl ⟨.CR, bumpHead L, [], rfl⟩⟩ + | cons d R' => + exact ⟨cfg_B (d :: bumpHead L) R', rule_B_cons L R' d, + Or.inl ⟨.B, d :: bumpHead L, R', rfl⟩⟩ + | CR => + cases L with + | nil => + exact ⟨cfg_B [] ((tailWeight R + 2) :: R.tail), rule_CR_nil R, + Or.inl ⟨.B, [], (tailWeight R + 2) :: R.tail, rfl⟩⟩ + | cons a L' => + rcases a with _ | _ | _ | a + · -- a = 0 + obtain ⟨hstep, hnone⟩ := rule_CR_zero L' R + exact ⟨cfg_Halt_CR_zero L' R, hstep, Or.inr hnone⟩ + · -- a = 1 + cases L' with + | nil => + exact ⟨cfg_B [0] ((tailWeight R + 3) :: R.tail), rule_CR_one_nil R, + Or.inl ⟨.B, [0], (tailWeight R + 3) :: R.tail, rfl⟩⟩ + | cons b L'' => + exact ⟨cfg_B L'' ((b + tailWeight R + 4) :: R.tail), rule_CR_one_cons b L'' R, + Or.inl ⟨.B, L'', (b + tailWeight R + 4) :: R.tail, rfl⟩⟩ + · -- a = 2 + exact ⟨cfg_CR (bumpHead L') (0 :: tailWeight R :: R.tail), rule_CR_two L' R, + Or.inl ⟨.CR, bumpHead L', 0 :: tailWeight R :: R.tail, rfl⟩⟩ + · -- a + 3 + have h_div : a = (a % 2) + 2 * (a / 2) := (Nat.mod_add_div a 2).symm + rw [h_div] + have h1 := rule_CR_ge3 L' R ((a % 2) + 2 * (a / 2)) + have h_add : (a % 2) + 2 * (a / 2) + 1 = (a % 2) + 1 + 2 * (a / 2) := by omega + rw [h_add, bumpHead_eq_cons L'] at h1 + have h2 := rule_CR_peel_all L'.tail R.tail (a % 2) (tailWeight (bumpHead L')) (tailWeight R + 1) (a / 2) + exact ⟨cfg_CR (((a % 2) + 1) :: (tailWeight (bumpHead L') + a / 2) :: L'.tail) ((tailWeight R + 1 + a / 2) :: R.tail), + stepPlus_stepStar_stepPlus h1 h2, + Or.inl ⟨.CR, ((a % 2) + 1) :: (tailWeight (bumpHead L') + a / 2) :: L'.tail, (tailWeight R + 1 + a / 2) :: R.tail, rfl⟩⟩ + +/-- Multi-block chain split contraction in `cfg_C000`: + `cfg_C000 (2 :: (1^k ++ b :: L)) R ⊢* cfg_C000 ((b + 1) :: L) (0^(k+1) ++ R)`. -/ +theorem rule_C000_ones_all (L R : List ℕ) (b k : ℕ) : + (cfg_C000 (2 :: (List.replicate k 1 ++ b :: L)) R) [target_tm]⊢* + (cfg_C000 ((b + 1) :: L) (List.replicate (k + 1) 0 ++ R)) := by + induction k generalizing R with + | zero => + simp only [List.replicate, List.nil_append, List.singleton_append] + exact stepPlus_stepStar (rule_CR_two (b :: L) (0 :: R)) + | succ k ih => + rw [List.replicate_succ, List.cons_append] + refine stepStar_trans (stepPlus_stepStar (rule_CR_two (1 :: (List.replicate k 1 ++ b :: L)) (0 :: R))) ?_ + dsimp [bumpHead, tailWeight, List.tail] + refine stepStar_trans (ih (0 :: R)) ?_ + have h_rep : List.replicate (k + 1 + 1) 0 ++ R = List.replicate (k + 1) 0 ++ (0 :: R) := by + rw [List.replicate_succ', List.append_assoc, List.singleton_append] + rw [← h_rep] + try exact ⟨0, rfl⟩ + +/-- Universal odd-CR turnaround helper: + `cfg_CR ((2 * k + 3) :: b :: L) [] ⊢⁺ cfg_B ((b + 2 * k + 6) :: bumpHead L) []`. -/ +theorem cr_odd_turnaround (L : List ℕ) (b k : ℕ) : + (cfg_CR ((2 * k + 3) :: b :: L) []) [target_tm]⊢⁺ + (cfg_B ((b + 2 * k + 6) :: bumpHead L) []) := by + have h_cr0 : cfg_CR ((2 * k + 3) :: b :: L) [] = cfg_CR ((2 * k + 3) :: b :: L) [0] := by + simp [cfg_CR, encRight] + rw [h_cr0] + have h1 : 2 * k + 3 = 0 + 1 + 2 * (k + 1) := by omega + rw [h1] + refine stepStar_stepPlus_stepPlus (rule_CR_peel_all L [] 0 b 0 (k + 1)) ?_ + simp only [Nat.zero_add] + refine stepPlus_trans (rule_CR_one_cons (b + (k + 1)) L [k + 1]) ?_ + dsimp [tailWeight, List.tail] + have hk : b + (k + 1) + (k + 1) + 4 = b + 2 * k + 6 := by omega + rw [hk] + exact rule_B_cons L [] (b + 2 * k + 6) + +/-- Universal even-block turnaround theorem: + `cfg_TurnB (b :: L) (2 * k + 2) ⊢⁺ cfg_TurnB (bumpHead L) (b + 2 * k + 6)`. -/ +theorem turnaround_even_gen (L : List ℕ) (b k : ℕ) : + (cfg_TurnB (b :: L) (2 * k + 2)) [target_tm]⊢⁺ + (cfg_TurnB (bumpHead L) (b + 2 * k + 6)) := by + unfold cfg_TurnB + exact stepPlus_trans (rule_B_nil ((2 * k + 2) :: b :: L)) (cr_odd_turnaround L b k) + +/-- Canonical 3-block `B`-turnaround cycle configuration `cfg_CapB k := cfg_B [2k+4, 2k+8, 0] []`. -/ +def cfg_CapB (k : ℕ) : Cfg (Fin 2) (Fin 6) := + cfg_B [2 * k + 4, 2 * k + 8, 0] [] + +/-- Canonical 2-block `CR`-turnaround cycle configuration `cfg_CapCR k := cfg_CR [4k+5, 1] []`. -/ +def cfg_CapCR (k : ℕ) : Cfg (Fin 2) (Fin 6) := + cfg_CR [4 * k + 5, 1] [] + +/-- First half of the asymptotic cycle: `cfg_CapCR k ⊢⁺ cfg_CapB k`. -/ +theorem cap_cr_to_cap_b (k : ℕ) : + (cfg_CapCR k) [target_tm]⊢⁺ (cfg_CapB k) := by + unfold cfg_CapCR cfg_CapB + have h_start : 4 * k + 5 = 2 * (2 * k + 1) + 3 := by omega + rw [h_start] + have h1 := cr_odd_turnaround [] 1 (2 * k + 1) + dsimp [bumpHead] at h1 + have h_mid1 : 1 + 2 * (2 * k + 1) + 6 = 4 * k + 9 := by omega + rw [h_mid1] at h1 + refine stepPlus_trans h1 ?_ + refine stepPlus_trans (rule_B_nil [4 * k + 9, 0]) ?_ + dsimp [bumpHead] + have h_cr0 : cfg_CR [4 * k + 9 + 1, 0] [] = cfg_CR [4 * k + 9 + 1, 0] [0] := by + simp [cfg_CR, encRight] + rw [h_cr0] + have h2 : 4 * k + 9 + 1 = 1 + 1 + 2 * (2 * k + 4) := by omega + rw [h2] + refine stepStar_stepPlus_stepPlus (rule_CR_peel_all [] [] 1 0 0 (2 * k + 4)) ?_ + simp only [Nat.zero_add] + refine stepPlus_trans (rule_CR_two [2 * k + 4] [2 * k + 4]) ?_ + dsimp [bumpHead, tailWeight, List.tail] + have h3 : 2 * k + 4 + 1 = (2 * k + 2) + 3 := by omega + rw [h3] + refine stepPlus_trans (rule_CR_ge3 [] [0, 2 * k + 4] (2 * k + 2)) ?_ + dsimp [bumpHead, tailWeight, List.tail] + have h4 : 2 * k + 2 + 1 = 0 + 1 + 2 * (k + 1) := by omega + rw [h4] + refine stepStar_stepPlus_stepPlus (rule_CR_peel_all [] [2 * k + 4] 0 0 1 (k + 1)) ?_ + simp only [Nat.zero_add] + refine stepPlus_trans (rule_CR_one_cons (k + 1) [] [1 + (k + 1), 2 * k + 4]) ?_ + dsimp [tailWeight, List.tail] + have h5 : (k + 1) + (1 + (k + 1)) + 4 = 2 * k + 7 := by omega + rw [h5] + refine stepPlus_trans (rule_B_cons [] [2 * k + 4] (2 * k + 7)) ?_ + dsimp [bumpHead] + refine stepPlus_stepStar_stepPlus (rule_B_cons [2 * k + 7, 0] [] (2 * k + 4)) ?_ + dsimp [bumpHead] + have h6 : 2 * k + 7 + 1 = 2 * k + 8 := by omega + rw [h6] + try exact ⟨0, rfl⟩ + +/-- Second half of the asymptotic cycle: `cfg_CapB k ⊢⁺ cfg_CapCR (k + 3)`. -/ +theorem cap_b_to_cap_cr (k : ℕ) : + (cfg_CapB k) [target_tm]⊢⁺ (cfg_CapCR (k + 3)) := by + unfold cfg_CapB cfg_CapCR + have h_turn := turnaround_even_gen [0] (2 * k + 8) (k + 1) + unfold cfg_TurnB at h_turn + dsimp [bumpHead] at h_turn + have h1 : 2 * (k + 1) + 2 = 2 * k + 4 := by omega + have h2 : (2 * k + 8) + 2 * (k + 1) + 6 = 4 * (k + 3) + 4 := by omega + rw [h1, h2] at h_turn + refine stepPlus_trans h_turn ?_ + have h_nil := rule_B_nil [4 * (k + 3) + 4, 1] + dsimp [bumpHead] at h_nil + exact h_nil + +/-- Closed 2-block `CR` cycle recurrence: `cfg_CapCR k ⊢⁺ cfg_CapCR (k + 3)`. -/ +theorem cap_cr_step (k : ℕ) : + (cfg_CapCR k) [target_tm]⊢⁺ (cfg_CapCR (k + 3)) := + stepPlus_trans (cap_cr_to_cap_b k) (cap_b_to_cap_cr k) + +/-- Closed 3-block `B` cycle recurrence: `cfg_CapB k ⊢⁺ cfg_CapB (k + 3)`. -/ +theorem cap_b_step (k : ℕ) : + (cfg_CapB k) [target_tm]⊢⁺ (cfg_CapB (k + 3)) := + stepPlus_trans (cap_b_to_cap_cr k) (cap_cr_to_cap_b (k + 3)) + +-- Call-by-value kernel evaluator for the finite prefix `cfg_CR [4, 1] [] ⊢* cfg_CapCR 38379` + +def strictNat {α : Type} (n : ℕ) (k : ℕ → α) : α := + Nat.casesOn (Nat.add n 1) (k 0) (fun m => k m) + +@[simp] theorem strictNat_eq {α : Type} (n : ℕ) (k : ℕ → α) : + strictNat n k = k n := rfl + +def bumpHeadS (L : List ℕ) : List ℕ := + List.casesOn L [0] (fun b L' => strictNat (Nat.add b 1) (fun b1 => b1 :: L')) + +@[simp] theorem bumpHeadS_eq (L : List ℕ) : bumpHeadS L = bumpHead L := by + cases L <;> rfl + +def tailWeightS (R : List ℕ) : ℕ := + List.casesOn R 0 (fun d _ => d) + +@[simp] theorem tailWeightS_eq (R : List ℕ) : tailWeightS R = tailWeight R := by + cases R <;> rfl + +def tailS (R : List ℕ) : List ℕ := + List.casesOn R [] (fun _ R' => R') + +@[simp] theorem tailS_eq (R : List ℕ) : tailS R = R.tail := by + cases R <;> rfl + +def sweepB : List ℕ → List ℕ → List ℕ + | L, [] => L + | L, d :: R => sweepB (d :: bumpHead L) R + +def sweepBS (L R : List ℕ) : List ℕ := + List.rec + (fun L => L) + (fun d _ ih L => ih (d :: bumpHeadS L)) + R L + +@[simp] theorem sweepBS_eq (R L : List ℕ) : sweepBS L R = sweepB L R := by + induction R generalizing L with + | nil => rfl + | cons d R' ih => + change sweepBS (d :: bumpHeadS L) R' = sweepB (d :: bumpHead L) R' + rw [bumpHeadS_eq] + exact ih (d :: bumpHead L) + +theorem rule_B_sweep_all (R L : List ℕ) : + (cfg_B L R) [target_tm]⊢⁺ (cfg_CR (bumpHead (sweepB L R)) []) := by + induction R generalizing L with + | nil => exact rule_B_nil L + | cons d R' ih => exact stepPlus_trans (rule_B_cons L R' d) (ih (d :: bumpHead L)) + +inductive CRRes + | next (L R : List ℕ) + | err + +def stepCRBase (L R : List ℕ) : CRRes := + List.casesOn L .err (fun a L' => + Nat.casesOn a .err (fun a1 => + Nat.casesOn a1 + (List.casesOn L' + (strictNat (Nat.add (tailWeightS R) 3) (fun d => + .next (bumpHeadS (sweepBS [0] (d :: tailS R))) [])) + (fun b L'' => + strictNat (Nat.add (Nat.add b (tailWeightS R)) 4) (fun d => + .next (bumpHeadS (sweepBS L'' (d :: tailS R))) []))) + (fun a2 => + Nat.casesOn a2 + (.next (bumpHeadS L') (0 :: tailWeightS R :: tailS R)) + (fun _ => .err)))) + +def stepCR (L R : List ℕ) : CRRes := + List.casesOn L .err (fun a L' => + Nat.casesOn a .err (fun a1 => + Nat.casesOn a1 + (stepCRBase (1 :: L') R) + (fun a2 => + Nat.casesOn a2 + (stepCRBase (2 :: L') R) + (fun a₀ => + let bL := bumpHeadS L' + strictNat (Nat.div a₀ 2) (fun q => + strictNat (Nat.add (Nat.mod a₀ 2) 1) (fun rem1 => + strictNat (Nat.add (tailWeightS bL) q) (fun b1 => + strictNat (Nat.add (Nat.add (tailWeightS R) 1) q) (fun d1 => + stepCRBase (rem1 :: b1 :: tailS L') (d1 :: tailS R))))))))) + +def CRResValid (L R : List ℕ) : CRRes → Prop + | .next L' R' => (cfg_CR L R) [target_tm]⊢* (cfg_CR L' R') + | .err => False + +theorem crResValid_of_stepStar {L₁ R₁ L₂ R₂ : List ℕ} {res : CRRes} + (h₁ : (cfg_CR L₁ R₁) [target_tm]⊢* (cfg_CR L₂ R₂)) + (h₂ : CRResValid L₂ R₂ res) : + CRResValid L₁ R₁ res := by + cases res with + | next L₃ R₃ => exact stepStar_trans h₁ h₂ + | err => exact h₂ + +theorem stepCRBase_sound (L R : List ℕ) (h : stepCRBase L R ≠ .err) : + CRResValid L R (stepCRBase L R) := by + rcases L with _ | ⟨_ | _ | _ | a₀, L'⟩ + · exfalso; exact h rfl + · exfalso; exact h rfl + · cases L' with + | nil => + change (cfg_CR [1] R) [target_tm]⊢* + (cfg_CR (bumpHeadS (sweepBS [0] ((tailWeightS R + 3) :: tailS R))) []) + simp only [bumpHeadS_eq, sweepBS_eq, tailWeightS_eq, tailS_eq] + exact stepPlus_stepStar (stepPlus_trans (rule_CR_one_nil R) + (rule_B_sweep_all ((tailWeight R + 3) :: R.tail) [0])) + | cons b L'' => + change (cfg_CR (1 :: b :: L'') R) [target_tm]⊢* + (cfg_CR (bumpHeadS (sweepBS L'' ((b + tailWeightS R + 4) :: tailS R))) []) + simp only [bumpHeadS_eq, sweepBS_eq, tailWeightS_eq, tailS_eq] + exact stepPlus_stepStar (stepPlus_trans (rule_CR_one_cons b L'' R) + (rule_B_sweep_all ((b + tailWeight R + 4) :: R.tail) L'')) + · change (cfg_CR (2 :: L') R) [target_tm]⊢* + (cfg_CR (bumpHeadS L') (0 :: tailWeightS R :: tailS R)) + simp only [bumpHeadS_eq, tailWeightS_eq, tailS_eq] + exact stepPlus_stepStar (rule_CR_two L' R) + · exfalso; exact h rfl + +theorem cr_ge3_contract (L' R : List ℕ) (a₀ : ℕ) : + (cfg_CR ((a₀ + 3) :: L') R) [target_tm]⊢⁺ + (cfg_CR (((a₀ % 2) + 1) :: (tailWeight (bumpHead L') + a₀ / 2) :: L'.tail) + ((tailWeight R + 1 + a₀ / 2) :: R.tail)) := by + have h1 := rule_CR_ge3 L' R a₀ + have h_add : a₀ + 1 = (a₀ % 2) + 1 + 2 * (a₀ / 2) := by omega + rw [h_add, bumpHead_eq_cons L'] at h1 + have h2 := rule_CR_peel_all L'.tail R.tail (a₀ % 2) (tailWeight (bumpHead L')) (tailWeight R + 1) (a₀ / 2) + exact stepPlus_stepStar_stepPlus h1 h2 + +theorem stepCR_sound (L R : List ℕ) (h : stepCR L R ≠ .err) : + CRResValid L R (stepCR L R) := by + rcases L with _ | ⟨_ | _ | _ | a₀, L'⟩ + · exfalso; exact h rfl + · exfalso; exact h rfl + · exact stepCRBase_sound (1 :: L') R h + · exact stepCRBase_sound (2 :: L') R h + · change stepCRBase (((a₀ % 2) + 1) :: (tailWeightS (bumpHeadS L') + a₀ / 2) :: tailS L') + ((tailWeightS R + 1 + a₀ / 2) :: tailS R) ≠ .err at h + change CRResValid ((a₀ + 3) :: L') R + (stepCRBase (((a₀ % 2) + 1) :: (tailWeightS (bumpHeadS L') + a₀ / 2) :: tailS L') + ((tailWeightS R + 1 + a₀ / 2) :: tailS R)) + simp only [bumpHeadS_eq, tailWeightS_eq, tailS_eq] at h ⊢ + have hbase := stepCRBase_sound _ _ h + exact crResValid_of_stepStar (stepPlus_stepStar (cr_ge3_contract L' R a₀)) hbase + +def runCRChunk (n : ℕ) (L R : List ℕ) : CRRes := + Nat.rec + (fun L R => .next L R) + (fun _ ih L R => + CRRes.casesOn (stepCR L R) + (fun L' R' => ih L' R') + .err) + n L R + +theorem runCRChunk_succ (n : ℕ) (L R : List ℕ) : + runCRChunk (n + 1) L R = + CRRes.casesOn (stepCR L R) + (fun L' R' => runCRChunk n L' R') + .err := rfl + +theorem runCRChunk_sound : ∀ (n : ℕ) (L R : List ℕ), + runCRChunk n L R ≠ .err → + CRResValid L R (runCRChunk n L R) + | 0, _, _, _ => ⟨0, rfl⟩ + | n + 1, L, R, hne => by + rw [runCRChunk_succ] at hne ⊢ + cases hs : stepCR L R with + | next L' R' => + rw [hs] at hne + dsimp only at hne ⊢ + have hv := stepCR_sound L R (by rw [hs]; nofun) + rw [hs] at hv + exact crResValid_of_stepStar hv (runCRChunk_sound n L' R' hne) + | err => + rw [hs] at hne + dsimp only at hne + exfalso; exact hne rfl + +def runCRChunks (chunks chunkSize : ℕ) (L R : List ℕ) : CRRes := + Nat.rec + (fun L R => .next L R) + (fun _ ih L R => + CRRes.casesOn (runCRChunk chunkSize L R) + (fun L' R' => ih L' R') + .err) + chunks L R + +theorem runCRChunks_succ (chunks chunkSize : ℕ) (L R : List ℕ) : + runCRChunks (chunks + 1) chunkSize L R = + CRRes.casesOn (runCRChunk chunkSize L R) + (fun L' R' => runCRChunks chunks chunkSize L' R') + .err := rfl + +theorem runCRChunks_sound : ∀ (chunks chunkSize : ℕ) (L R : List ℕ), + runCRChunks chunks chunkSize L R ≠ .err → + CRResValid L R (runCRChunks chunks chunkSize L R) + | 0, _, _, _, _ => ⟨0, rfl⟩ + | chunks + 1, chunkSize, L, R, hne => by + rw [runCRChunks_succ] at hne ⊢ + cases hc : runCRChunk chunkSize L R with + | next L' R' => + rw [hc] at hne + dsimp only at hne ⊢ + have hv := runCRChunk_sound chunkSize L R (by rw [hc]; nofun) + rw [hc] at hv + exact crResValid_of_stepStar hv (runCRChunks_sound chunks chunkSize L' R' hne) + | err => + rw [hc] at hne + dsimp only at hne + exfalso; exact hne rfl + +def runCRTwo (c1 s1 s2 : ℕ) (L R : List ℕ) : CRRes := + CRRes.casesOn (runCRChunks c1 s1 L R) + (fun L' R' => runCRChunk s2 L' R') + .err + +theorem runCRTwo_sound (c1 s1 s2 : ℕ) (L R : List ℕ) (hne : runCRTwo c1 s1 s2 L R ≠ .err) : + CRResValid L R (runCRTwo c1 s1 s2 L R) := by + unfold runCRTwo at hne ⊢ + cases hc : runCRChunks c1 s1 L R with + | next L' R' => + rw [hc] at hne + dsimp only at hne ⊢ + have hv := runCRChunks_sound c1 s1 L R (by rw [hc]; nofun) + rw [hc] at hv + exact crResValid_of_stepStar hv (runCRChunk_sound s2 L' R' hne) + | err => + rw [hc] at hne + dsimp only at hne + exfalso; exact hne rfl + +theorem runCRTwo_reach {c1 s1 s2 : ℕ} {L R L' R' : List ℕ} + (heq : runCRTwo c1 s1 s2 L R = .next L' R') : + (cfg_CR L R) [target_tm]⊢* (cfg_CR L' R') := by + have hne : runCRTwo c1 s1 s2 L R ≠ .err := by + rw [heq]; intro h; nomatch h + have hv := runCRTwo_sound c1 s1 s2 L R hne + rw [heq] at hv + exact hv + +set_option maxRecDepth 400000 in +set_option maxHeartbeats 400000000 in +theorem runCRTwo_to_cap : + runCRTwo 180 500 355 [4, 1] [] = .next [4 * 38379 + 5, 1] [] := rfl + +/-- Blank tape reaches the closed cycle entry `cfg_CapCR 38379` (`cfg_CR [153521, 1] []`). -/ +theorem init_reaches_cap_cr : + (init []) [target_tm]⊢⁺ (cfg_CapCR 38379) := + stepPlus_stepStar_stepPlus + (stepPlus_trans init_to_cfg_B (rule_B_nil [3, 1])) + (runCRTwo_reach runCRTwo_to_cap) + +theorem multiStep_none_add {c : Cfg (Fin 2) (Fin 6)} {k : ℕ} + (h : multiStep target_tm c k = none) (d : ℕ) : + multiStep target_tm c (k + d) = none := by + rw [multiStep_add, h]; rfl + +/-- For every `m : ℕ`, `init []` runs for at least `m` steps and reaches `cfg_CapCR (38379 + 3 * m)`. -/ +theorem reach_arbitrarily_long : + ∀ m : ℕ, ∃ N : ℕ, m ≤ N ∧ + multiStep target_tm (init []) N = some (cfg_CapCR (38379 + 3 * m)) + | 0 => by + rcases init_reaches_cap_cr with ⟨N₀, hN₀_pos, hN₀⟩ + exact ⟨N₀, Nat.zero_le N₀, hN₀⟩ + | m + 1 => by + rcases reach_arbitrarily_long m with ⟨N, h_le, hN⟩ + rcases cap_cr_step (38379 + 3 * m) with ⟨k, hk_pos, hk⟩ + have h_idx : 38379 + 3 * m + 3 = 38379 + 3 * (m + 1) := by omega + rw [h_idx] at hk + exact ⟨N + k, by omega, multiStep_trans target_tm _ _ _ N k hN hk⟩ + +end Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + + + +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg ⟨k, hk⟩ + cases h_step : step target_tm cfg with + | some cfg' => rfl + | none => + have h_none : multiStep target_tm (init []) (k + 1) = none := by + rw [multiStep_succ', hk]; exact h_step + rcases reach_arbitrarily_long (k + 1) with ⟨N, h_ge, hN⟩ + have h_split : N = (k + 1) + (N - (k + 1)) := by omega + have h_none_N : multiStep target_tm (init []) N = none := by + rw [h_split] + exact multiStep_none_add h_none (N - (k + 1)) + rw [h_none_N] at hN + nomatch hN + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1RA_1RC1LB_1LD0RA_1LA0LE_HHH0LF_0RC0LB diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RC_0LA1RF_1RD0LE_1LC0RB_0RA0LC_0RDHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RC_0LA1RF_1RD0LE_1LC0RB_0RA0LC_0RDHHH.lean new file mode 100644 index 00000000..cf930d46 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RC_0LA1RF_1RD0LE_1LC0RB_0RA0LC_0RDHHH.lean @@ -0,0 +1,87 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Basic +import BusyBeaver.Calculi.Longitudinal +import BusyBeaver.Calculi.LongitudinalCascade + +open Mathlib Relation Nat Turing BusyBeaver SixState +open BusyBeaver.Longitudinal +open BusyBeaver.LongitudinalCascade + +namespace BusyBeaver.M_1RB1RC_0LA1RF_1RD0LE_1LC0RB_0RA0LC_0RDHHH + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RC_0LA1RF_1RD0LE_1LC0RB_0RA0LC_0RDHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +theorem init_raw : + (init ([] : List Sym)) [target]⊢* + NatCfg.toCfg (K := 6) ⟨4, 0, 0, 22414810863322⟩ := by + rw [← toCfg_zero (K := 6)] + exact ⟨4091, stepsNat_sound target 4091 ⟨0, 0, 0, 0⟩ ⟨4, 0, 0, 22414810863322⟩ + (by decide +kernel) (by decide)⟩ + +def statePerm : Q → Q + | 0 => 2 | 1 => 3 | 2 => 4 | 3 => 0 | 4 => 1 | 5 => 5 + +theorem step_statePerm (c : Cfg Sym Q) : + step target (mapCfg statePerm c) = (step tm1 c).map (mapCfg statePerm) := by + rcases c with ⟨_ | ⟨_ | _ | _ | _ | _ | _ | q, hq⟩, ⟨⟨_ | _ | h, hh⟩, l, r⟩⟩ <;> + (try rfl) <;> + omega + +theorem multiStep_statePerm (c : Cfg Sym Q) (n : Nat) : + multiStep target (mapCfg statePerm c) n = (multiStep tm1 c n).map (mapCfg statePerm) := by + induction n generalizing c with + | zero => rfl + | succ n ih => + rw [BusyBeaver.multiStep_succ', BusyBeaver.multiStep_succ', ih] + rcases multiStep tm1 c n with _ | c' + · rfl + · exact step_statePerm c' + +theorem nonHaltFrom_statePerm {c : Cfg Sym Q} (h : NonHaltFrom tm1 c) : + NonHaltFrom target (mapCfg statePerm c) := by + intro c' ⟨n, hn⟩ + rw [multiStep_statePerm, Option.map_eq_some_iff] at hn + rcases hn with ⟨d, hd, rfl⟩ + rw [step_statePerm, Option.isSome_map] + exact h d ⟨n, hd⟩ + +theorem toCfg_eq : + NatCfg.toCfg (K := 6) ⟨4, 0, 0, 22414810863322⟩ = + mapCfg statePerm (cfg (prefix_word 3 +> (word 2 5 +> ([0, 0, 1, 0, 1, 0] +> default)))) := by + have h1 : NatCfg.toCfg (K := 6) ⟨4, 0, 0, 22414810863322⟩ = + Cfg.headRight E (decodeHalf 0) (decodeHalf (2 * 22414810863322)) := + toCfg_headRight (K := 6) E 0 (2 * 22414810863322) + have h2 : decodeHalf (2 * 22414810863322) = + ([0, 0, 1, 0] ++ prefix_word 3 ++ word 2 5 ++ [0, 0, 1, 0, 1, 0]) +> + (default : ListBlank Sym) := by + rw [← decodeHalf_zero, decodeHalf_encodeList] + congr 1 + rw [h1, h2, decodeHalf_zero] + simp only [cfg, mapCfg, statePerm, Option.map_some, Cfg.headRight, append_assoc] + +public section + +theorem is_not_halt : IsNotHalt target := by + have h_reach : (init ([] : List Sym)) [target]⊢* + mapCfg statePerm (cfg (prefix_word 3 +> (word 2 5 +> ([0, 0, 1, 0, 1, 0] +> default)))) := by + rw [← toCfg_eq] + exact init_raw + exact nonHaltFrom_of_stepStar h_reach + (nonHaltFrom_statePerm (normal_nonhalt (Or.inl initial3_root))) + +end + +end BusyBeaver.M_1RB1RC_0LA1RF_1RD0LE_1LC0RB_0RA0LC_0RDHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RC_1LC0LE_0RA1RD_1RF1LB_1LD0LA_HHH0RC.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RC_1LC0LE_0RA1RD_1RF1LB_1LD0LA_HHH0RC.lean new file mode 100644 index 00000000..eb046553 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RC_1LC0LE_0RA1RD_1RF1LB_1LD0LA_HHH0RC.lean @@ -0,0 +1,79 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.SharedDonorsA + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RB1RC_1LC0LE_0RA1RD_1RF1LB_1LD0LA_HHH0RC + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RC_1LC0LE_0RA1RD_1RF1LB_1LD0LA_HHH0RC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +open BusyBeaver.Counter +open TM311Donor + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +theorem init_reaches_inv : + ∃ c, ((init []) [donor311_tm]⊢⁺ c) ∧ Inv c := by + -- init [] -> (0, []) -> (3, []) -> (2, [3]) + have h0 : (init []) [donor311_tm]⊢⁺ cfg_modeC (encL 0 []) default := init_reaches_modeC + have h1 : (cfg_modeC (encL 0 []) default) [donor311_tm]⊢⁺ cfg_modeC (encL 3 []) default := by + have ha := step_modeC_nil (encL 0 []) + have hb : (cfg_modeE0_first (encL 0 [])) [donor311_tm]⊢⁺ cfg_modeC (encL 0 []) (prepend01 3 + default) := + step_modeE0_first_base + have hc := modeC_prepend01_star 3 0 [] default + rw [Nat.zero_add] at hc + exact stepPlus_stepPlus_stepPlus ha (stepPlus_stepStar_stepPlus hb hc) + have h2 : (cfg_modeC (encL 3 []) default) [donor311_tm]⊢⁺ cfg_modeC (encL 2 [3]) default := by + have ha := step_modeC_nil (encL 3 []) + have hb := step_modeE0_first_b10 (encL 2 []) + have hc : (cfg_modeE0_loop (encL 2 []) default) [donor311_tm]⊢⁺ + cfg_modeE0_loop (encL 0 []) (prepend11_01 1 default) := + step_modeE0_loop_b10_b10 (encL 0 []) default + have hd := step_modeE0_loop_base (prepend11_01 1 default) + have he := step_modeC_b01 (encL 0 [0]) (prepend11_01 1 default) + have hf := modeC_consume_11_01_nonempty 1 1 [0] default (by simp) trivial + simp only [add_last, Nat.zero_add, Nat.mul_one] at hf + exact stepPlus_stepPlus_stepPlus ha + (stepPlus_stepPlus_stepPlus hb + (stepPlus_stepPlus_stepPlus hc + (stepPlus_stepPlus_stepPlus hd + (stepPlus_stepStar_stepPlus he hf)))) + have h_inv : InvNil 2 [3] := Or.inr ⟨by simp, by simp [GoodKS]⟩ + exact ⟨cfg_modeC (encL 2 [3]) default, + stepPlus_stepPlus_stepPlus h0 (stepPlus_stepPlus_stepPlus h1 h2), + ⟨2, [3], rfl, h_inv⟩⟩ + +theorem donor311_nonhalt : + IsDoesNotHalt donor311_tm := by + rcases init_reaches_inv with ⟨c, h_plus, h_inv⟩ + exact does_not_halt_of_invariant Inv ⟨c, stepPlus_stepStar h_plus, h_inv⟩ inv_step + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + exact donor311_nonhalt + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1RC_1LC0LE_0RA1RD_1RF1LB_1LD0LA_HHH0RC diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RC_1LC0RA_1RA0LD_0RE0LF_0LBHHH_0RF0RE.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RC_1LC0RA_1RA0LD_0RE0LF_0LBHHH_0RF0RE.lean new file mode 100644 index 00000000..8471a72d --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RC_1LC0RA_1RA0LD_0RE0LF_0LBHHH_0RF0RE.lean @@ -0,0 +1,3553 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1RC_1LC0RA_1RA0LD_0RE0LF_0LBHHH_0RF0RE + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RC_1LC0RA_1RA0LD_0RE0LF_0LBHHH_0RF0RE" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +variable {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +abbrev holdout_0641_tm : Machine (Fin 2) (Fin 6) := target_tm +set_option maxHeartbeats 8000000 +set_option maxRecDepth 200000 +inductive BTree (α : Type) where + | leaf (val : α) + | node (l r : BTree α) +def qZ {α : Type} : BTree α -> Nat -> α + | .leaf v,_ => v + | .node l r,n => if n % 2 == 0 then qZ l (n / 2) else qZ r (n / 2) +local notation "X" a:arg b:arg => BTree.node a b +local notation "L" a:arg => BTree.leaf a +local notation "Z" => BTree.leaf ([] : List Nat) +inductive Letter where + | Odd + | Even + | Gap + deriving DecidableEq +abbrev Letter.O:=Letter.Odd +abbrev Letter.E:=Letter.Even +abbrev Letter.G:=Letter.Gap +local notation "H" => (none : Option Letter) +local notation "I" => some Letter.Odd +local notation "K" => some Letter.Even +local notation "P" => some Letter.Gap +local notation "U" => false +local notation "V" => true +local notation "W" => [] +def qU (a b : Letter) : Bool := + match a,b with + | .Odd,.Odd | .Even,.Even | .Gap,.Gap => true + | _,_ => false +theorem qam (a b : Letter) : (qU a b=true) ↔ a=b:= by + cases a <;> cases b <;> decide +def qau (even : Bool) (g : Nat) (s : Nat) : Option Nat := + let u:=(s / 2) * 2 + let r:=g / 3 + let j:=g % 3 + if even then + match g with + | 0 => some (2 * u + 2) + | 1 => some (2 * u + 1) + | _ => + if j == 2 then + if 2 <= s then some (2 ^ (r + 1) * u - 1) else none + else some (2 ^ (r + 1) * (u + 1) - 1) + else + match g with + | 0 => if 3 <= s then some (s - 3) else none + | 1 => some (2 * u) + | 2 => if 2 <= s then some (2 * u - 1) else none + | _ => + if j == 0 then + if 2 <= s then some (2 ^ r * u - 3) else none + else some (2 ^ (r + 1) * (u + 1) - 3) +theorem qat (b : Bool) (g s s' t : Nat) + (h : qau b g s=some s') (hst : s <= t) : + ∃ t',qau b g t=some t' /\ s' <= t':= by + have hu : (s / 2) * 2 <= (t / 2) * 2:= by omega + have hp1 : 2 ^ (g / 3) * ((s / 2) * 2) <= 2 ^ (g / 3) * ((t / 2) * 2) := + Nat.mul_le_mul_left _ hu + have hp2 : 2 ^ (g / 3 + 1) * ((s / 2) * 2) <= 2 ^ (g / 3 + 1) * ((t / 2) * 2) := + Nat.mul_le_mul_left _ hu + have hp3 : 2 ^ (g / 3 + 1) * ((s / 2) * 2 + 1) <= 2 ^ (g / 3 + 1) * ((t / 2) * 2 + 1) := + Nat.mul_le_mul_left _ (by omega) + unfold qau at h ⊢ + cases b <;> ( + rcases g with _ | _ | _ | g + · simp only at h ⊢; split_ifs at h ⊢ <;> + (try contradiction) <;> (try omega) <;> + (injection h with h; refine ⟨_,rfl,by omega⟩) + · simp only at h ⊢; split_ifs at h ⊢ <;> + (try contradiction) <;> (try omega) <;> + (injection h with h; refine ⟨_,rfl,by omega⟩) + · simp only at h ⊢; split_ifs at h ⊢ <;> + (try contradiction) <;> (try omega) <;> + (injection h with h; refine ⟨_,rfl,by omega⟩) + · simp only at h ⊢; split_ifs at h ⊢ <;> + (try contradiction) <;> (try omega) <;> + (injection h with h; refine ⟨_,rfl,by omega⟩) + ) +theorem atom_large (b : Bool) (g s : Nat) (hg : 4 <= g) (hs : 2 <= s) : + ∃ v,qau b g s=some v /\ 8 * (s / 2) - (if b then 1 else 3) <= v:= by + rcases g with _ | _ | _ | g + · omega + · omega + · omega + · have hg3 : g + 1 + 1 + 1=g + 3:=rfl + rw [hg3] + have hr1 : 2 <= (g + 3) / 3 + 1:= by omega + have hp1 : 4 <= 2 ^ ((g + 3) / 3 + 1):= by + have h4 : 4=2 ^ 2:=rfl + rw [h4] + exact Nat.pow_le_pow_right (by omega) hr1 + have hmul1 : 4 * ((s / 2) * 2) <= 2 ^ ((g + 3) / 3 + 1) * ((s / 2) * 2) := + Nat.mul_le_mul_right _ hp1 + have hmul2 : 4 * ((s / 2) * 2 + 1) <= 2 ^ ((g + 3) / 3 + 1) * ((s / 2) * 2 + 1) := + Nat.mul_le_mul_right _ hp1 + unfold qau + cases b + · simp only [Bool.false_eq_true,↓reduceIte] + by_cases hj : ((g + 3) % 3 == 0)=true + · rw [hj,if_pos rfl,if_pos hs] + have hj0 : (g + 3) % 3=0:=beq_iff_eq.mp hj + have hr0 : 2 <= (g + 3) / 3:= by omega + have hp0 : 4 <= 2 ^ ((g + 3) / 3):= by + have h4 : 4=2 ^ 2:=rfl + rw [h4] + exact Nat.pow_le_pow_right (by omega) hr0 + have hmul0 : 4 * ((s / 2) * 2) <= 2 ^ ((g + 3) / 3) * ((s / 2) * 2) := + Nat.mul_le_mul_right _ hp0 + exact ⟨_,rfl,by omega⟩ + · rw [if_neg hj] + exact ⟨_,rfl,by omega⟩ + · simp only [↓reduceIte] + by_cases hj : ((g + 3) % 3 == 2)=true + · rw [hj,if_pos rfl,if_pos hs] + exact ⟨_,rfl,by omega⟩ + · rw [if_neg hj] + exact ⟨_,rfl,by omega⟩ +def qq (b : Bool) (g s : Nat) : Option Nat := + if g < 4 then qau b g s + else if 2 <= s then some (8 * (s / 2) - (if b then 1 else 3)) else none +theorem qbj (b : Bool) (g s v t : Nat) + (h : qq b (min 4 g) s=some v) (hst : s <= t) : + ∃ v',qau b g t=some v' /\ v <= v':= by + by_cases hg : g < 4 + · have hmin : min 4 g=g:= by omega + rw [hmin] at h + unfold qq at h + rw [if_pos hg] at h + exact qat b g s v t h hst + · have hg4 : 4 <= g:= by omega + have hmin : min 4 g=4:= by omega + rw [hmin] at h + unfold qq at h + simp only [show ¬(4 < 4) by omega,↓reduceIte] at h + by_cases hs : 2 <= s + · rw [if_pos hs] at h + injection h with hv + rcases atom_large b g s hg4 hs with ⟨v0,hv0,hle0⟩ + rcases qat b g s v0 t hv0 hst with ⟨v',hv',hle'⟩ + exact ⟨v',hv',by omega⟩ + · rw [if_neg hs] at h + contradiction +structure CapRow where + edges : List (Letter × Nat) + final : Bool + b0 : Nat + b1 : Nat + b2 : Nat + b3 : Nat + b4 : Nat +def getBoundRow (r : CapRow) : Nat -> Nat + | 0 => r.b0 + | 1 => r.b1 + | 2 => r.b2 + | 3 => r.b3 + | 4 => r.b4 + | _ => 0 +def memEdge (es : List (Letter × Nat)) (c : Letter) (q : Nat) : Bool := + es.any (fun e => qU e.1 c && (e.2 == q)) +theorem qaZ (es : List (Letter × Nat)) (c : Letter) (q : Nat) : + memEdge es c q=true ↔ (c,q) ∈ es:= by + unfold memEdge + simp only [List.any_eq_true,Bool.and_eq_true,qam,beq_iff_eq,Prod.exists] + constructor + · rintro ⟨a,b,hmem,rfl,rfl⟩; exact hmem + · intro hmem; exact ⟨c,q,hmem,rfl,rfl⟩ +def g0 : BTree CapRow:=L ⟨W,U,0,0,0,0,0⟩ +def g1 : BTree CapRow:=X (X (L ⟨[(.E,1),(.O,80)],U,12,0,0,0,0⟩) (L ⟨[(.E,488)],U,1,0,0,0,0⟩)) (X (L ⟨[(.E,10),(.E,272),(.E,334),(.E,341)],U,7,0,0,0,0⟩) g0) +def g2 : BTree CapRow:=X (X (X (L ⟨[(.G,62)],U,0,22,0,0,0⟩) g0) (X (L ⟨[(.G,328)],U,0,7,0,0,0⟩) g0)) (X (X (L ⟨[(.G,270)],U,0,22,0,0,0⟩) g0) (X (L ⟨[(.E,449)],U,1,0,0,0,0⟩) g0)) +def g3 : BTree CapRow:=X (L ⟨[(.E,327),(.G,21),(.G,40),(.G,56),(.G,66),(.G,91),(.G,97),(.G,100),(.G,111),(.G,116),(.G,167),(.G,172),(.G,177),(.G,213),(.G,214),(.G,243),(.G,252),(.G,280),(.G,283),(.G,286),(.G,290),(.G,296),(.G,300),(.G,304),(.G,316),(.G,320),(.G,344),(.G,346),(.G,347),(.G,366),(.G,382),(.G,385),(.G,386),(.G,396),(.G,414),(.G,421),(.G,436),(.O,10),(.O,16),(.O,30),(.O,32),(.O,53),(.O,71),(.O,159),(.O,164),(.O,169),(.O,193),(.O,203),(.O,255),(.O,272),(.O,277),(.O,310),(.O,341),(.O,408)],U,21,42,30,0,0⟩) g0 +def g4 : BTree CapRow:=X (X (X (L ⟨[(.O,350)],U,9,0,0,0,0⟩) (L ⟨[(.E,546)],U,1,0,0,0,0⟩)) (X (L ⟨[(.G,285)],U,0,9,0,0,0⟩) g0)) (X (X (L ⟨[(.E,159)],U,1,0,0,0,0⟩) g0) g3) +def g5 : BTree CapRow:=X (X (X (L ⟨[(.G,84)],U,0,0,19,0,0⟩) g0) (X (L ⟨[(.G,347)],U,0,16,0,0,0⟩) g0)) (X (X (L ⟨[(.E,235)],U,1,0,0,0,0⟩) g0) (X (L ⟨[(.E,482)],U,1,0,0,0,0⟩) g0)) +def g6 : BTree CapRow:=X (X (X g1 (X (X (L ⟨[(.G,99)],U,0,22,0,0,0⟩) g0) (X (L ⟨[(.E,257)],U,9,0,0,0,0⟩) g0))) g2) (X g4 g5) +def g7 : BTree CapRow:=X (X (L ⟨[(.E,17)],U,5,0,0,0,0⟩) g0) (X (L ⟨[(.G,34),(.G,55),(.G,75),(.G,108),(.G,206),(.G,279)],U,0,0,0,19,21⟩) g0) +def g8 : BTree CapRow:=X (X (X (L ⟨[(.O,292)],U,9,0,0,0,0⟩) (L ⟨[(.E,537)],U,3,0,0,0,0⟩)) (X (L ⟨[(.O,271)],U,9,0,0,0,0⟩) g0)) g7 +def g9 : BTree CapRow:=X (X (L ⟨[(.E,73),(.E,176),(.E,370),(.O,170),(.O,188),(.O,367),(.O,420)],U,19,0,0,0,0⟩) g0) (X (L ⟨[(.E,465)],U,1,0,0,0,0⟩) g0) +def g10 : BTree CapRow:=X (X (X (L ⟨[(.E,397)],U,11,0,0,0,0⟩) g0) (X (L ⟨[(.G,286)],U,0,12,0,0,0⟩) g0)) (X (X (L ⟨[(.E,208)],U,9,0,0,0,0⟩) g0) (X (L ⟨[(.O,437)],U,27,0,0,0,0⟩) g0)) +def g11 : BTree CapRow:=X (L ⟨[(.E,240),(.G,7),(.G,11),(.G,21),(.G,23),(.G,31),(.G,42),(.G,62),(.G,65),(.G,72),(.G,77),(.G,82),(.G,97),(.G,103),(.G,120),(.G,150),(.G,160),(.G,172),(.G,183),(.G,192),(.G,196),(.G,197),(.G,204),(.G,215),(.G,216),(.G,217),(.G,246),(.G,254),(.G,267),(.G,276),(.G,280),(.G,284),(.G,293),(.G,304),(.G,311),(.G,316),(.G,333),(.G,344),(.G,352),(.G,379),(.G,380),(.G,387),(.G,389),(.G,410),(.G,421),(.G,435),(.O,78),(.O,167),(.O,226),(.O,244),(.O,286),(.O,296),(.O,328),(.O,331),(.O,343),(.O,351),(.O,383),(.O,396),(.O,414),(.O,429)],U,33,24,42,0,0⟩) g0 +def g12 : BTree CapRow:=X (X (X (L ⟨[(.G,302)],U,0,0,0,0,42⟩) g0) (X (L ⟨[(.E,335)],U,3,0,0,0,0⟩) g0)) (X g11 (X (L ⟨[(.E,510)],U,1,0,0,0,0⟩) g0)) +def g13 : BTree CapRow:=X (X g8 (X (X (X (L ⟨[(.E,292),(.G,384)],U,9,9,0,0,0⟩) g0) (X (L ⟨[(.G,188)],U,0,0,0,0,23⟩) g0)) g9)) (X g10 g12) +def g14 : BTree CapRow:=X (X (L ⟨[(.E,301)],U,7,0,0,0,0⟩) (L ⟨[(.G,527)],U,0,1,0,0,0⟩)) (X (L ⟨[(.E,6),(.E,266),(.E,270),(.E,329)],U,11,0,0,0,0⟩) g0) +def g15 : BTree CapRow:=X (X (X (L ⟨[(.E,71)],U,5,0,0,0,0⟩) g0) (X (L ⟨[(.E,275)],U,7,0,0,0,0⟩) g0)) (X (X (L ⟨[(.E,53),(.E,310),(.O,165)],U,24,0,0,0,0⟩) g0) (X (L ⟨[(.E,457)],U,1,0,0,0,0⟩) g0)) +def g16 : BTree CapRow:=X (X (X (L ⟨[(.O,60)],U,6,0,0,0,0⟩) (L ⟨[(.O,520)],U,1,0,0,0,0⟩)) (X (L ⟨[(.E,188)],U,7,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,179)],U,0,1,0,0,0⟩) g0) (X (L ⟨[(.G,423)],U,0,7,0,0,0⟩) g0)) +def g17 : BTree CapRow:=X (X (X (L ⟨[(.E,69)],U,9,0,0,0,0⟩) g0) (X (L ⟨[(.E,358)],U,3,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,195)],U,0,0,0,0,39⟩) g0) (X (L ⟨[(.E,490)],U,1,0,0,0,0⟩) g0)) +def g18 : BTree CapRow:=X (X (X g14 (X (X (L ⟨[(.E,227)],U,1,0,0,0,0⟩) g0) (X (L ⟨[(.O,391)],U,3,0,0,0,0⟩) g0))) g15) (X g16 g17) +def g19 : BTree CapRow:=X (X (X (L ⟨[(.G,372)],U,0,0,0,0,42⟩) (L ⟨[(.G,554)],U,0,1,0,0,0⟩)) (X (L ⟨[(.E,272)],U,5,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,89)],U,0,0,0,0,39⟩) g0) (X (L ⟨[(.O,406)],U,3,0,0,0,0⟩) g0)) +def g20 : BTree CapRow:=X (X (X (L ⟨[(.G,85)],U,0,11,0,0,0⟩) g0) (X (L ⟨[(.E,341)],U,7,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,40)],U,0,6,0,0,0⟩) g0) (X (L ⟨[(.E,473)],U,1,0,0,0,0⟩) g0)) +def g21 : BTree CapRow:=X (X (X (L ⟨[(.E,52)],U,3,0,0,0,0⟩) g0) (X (L ⟨[(.G,301)],U,0,13,0,0,0⟩) g0)) (X (X (L ⟨[(.E,167)],U,15,0,0,0,0⟩) g0) (X (L ⟨[(.E,441)],U,3,0,0,0,0⟩) g0)) +def g22 : BTree CapRow:=X (X (X (L ⟨[(.G,111)],U,0,42,0,0,0⟩) g0) (X (L ⟨[(.E,377)],U,15,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,241)],U,0,0,33,24,42⟩) g0) (X (L ⟨[(.E,506)],U,1,0,0,0,0⟩) g0)) +def g23 : BTree CapRow:=X (X (X (L ⟨[(.E,314)],U,9,0,0,0,0⟩) (L ⟨[(.E,529)],U,3,0,0,0,0⟩)) (X (L ⟨[(.E,256)],U,3,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,133)],U,0,0,0,1,0⟩) g0) (X (L ⟨[(.G,367)],U,0,0,0,0,42⟩) g0)) +def g24 : BTree CapRow:=X (X (X (L ⟨[(.E,41),(.E,195),(.O,180)],U,23,0,0,0,0⟩) g0) (X (L ⟨[(.E,127)],U,3,0,0,0,0⟩) g0)) (X (X (L ⟨[(.E,32)],U,5,0,0,0,0⟩) g0) (X (L ⟨[(.G,463)],U,0,0,0,1,0⟩) g0)) +def g25 : BTree CapRow:=X (X (X (L ⟨[(.E,37)],U,3,0,0,0,0⟩) (L ⟨[(.E,530)],U,1,0,0,0,0⟩)) (X (L ⟨[(.G,278)],U,0,15,0,0,0⟩) g0)) (X (X (L ⟨[(.O,194)],U,7,0,0,0,0⟩) g0) (X (L ⟨[(.G,3)],U,0,0,0,24,23⟩) g0)) +def g26 : BTree CapRow:=X (X (X (L ⟨[(.O,104)],U,12,0,0,0,0⟩) g0) (X (L ⟨[(.G,353)],U,0,13,0,0,0⟩) g0)) (X (X (L ⟨[(.E,229)],U,3,0,0,0,0⟩) g0) (X (L ⟨[(.E,486)],U,1,0,0,0,0⟩) g0)) +def g27 : BTree CapRow:=X (X (X (L ⟨[(.G,435)],U,0,16,0,0,0⟩) (L ⟨[(.G,533)],U,0,0,0,1,0⟩)) (X (L ⟨[(.E,255)],U,5,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,125)],U,0,0,0,0,42⟩) g0) (X (L ⟨[(.E,176)],U,5,0,0,0,0⟩) g0)) +def g28 : BTree CapRow:=X (X (X (L ⟨[(.G,83)],U,0,19,0,0,0⟩) g0) (X (L ⟨[(.G,338)],U,0,19,13,21,0⟩) g0)) (X (X (L ⟨[(.E,293)],U,11,0,0,0,0⟩) g0) (X (L ⟨[(.E,470)],U,1,0,0,0,0⟩) g0)) +def g29 : BTree CapRow:=X (X (X (L ⟨[(.O,51)],U,7,0,0,0,0⟩) g0) (X (L ⟨[(.E,23)],U,9,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,165)],U,0,21,42,30,42⟩) g0) (X (L ⟨[(.E,154)],U,11,0,0,0,0⟩) g0)) +def g30 : BTree CapRow:=X (X (X (L ⟨[(.O,262)],U,10,0,0,0,0⟩) g0) (X (L ⟨[(.G,365)],U,0,0,0,0,42⟩) g0)) (X (X (L ⟨[(.E,87),(.O,241)],U,23,0,0,0,0⟩) g0) (X (L ⟨[(.O,502)],U,3,0,0,0,0⟩) g0)) +def g31 : BTree CapRow:=X (X (X (L ⟨[(.G,10)],U,0,5,0,0,0⟩) (L ⟨[(.E,525)],U,1,0,0,0,0⟩)) (X (L ⟨[(.G,168)],U,0,0,1,0,0⟩) g0)) (X (X (L ⟨[(.G,115)],U,0,26,36,23,42⟩) g0) (X (L ⟨[(.E,367),(.O,73)],U,14,0,0,0,0⟩) g0)) +def g32 : BTree CapRow:=X (X (X (L ⟨[(.E,62)],U,11,0,0,0,0⟩) g0) (X (L ⟨[(.E,66)],U,5,0,0,0,0⟩) g0)) (X (X (L ⟨[(.E,203)],U,7,0,0,0,0⟩) g0) (X (L ⟨[(.E,461)],U,1,0,0,0,0⟩) g0)) +def g33 : BTree CapRow:=X (X (X (L ⟨[(.G,58)],U,0,14,0,0,0⟩) g0) (X (L ⟨[(.G,351)],U,0,14,0,0,0⟩) g0)) (X (X (L ⟨[(.G,167)],U,0,30,0,0,0⟩) g0) (X (L ⟨[(.G,415)],U,0,9,0,0,0⟩) g0)) +def g34 : BTree CapRow:=X (X (X (L ⟨[(.G,93)],U,0,0,7,0,0⟩) g0) (X (L ⟨[(.O,74)],U,5,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,86)],U,0,15,0,0,0⟩) g0) (X (L ⟨[(.E,493)],U,1,0,0,0,0⟩) g0)) +def g35 : BTree CapRow:=X (X (X (L ⟨[(.G,400)],U,0,0,0,0,21⟩) (L ⟨[(.E,541)],U,1,0,0,0,0⟩)) (X (L ⟨[(.G,283)],U,0,12,0,0,0⟩) g0)) (X (X (L ⟨[(.E,42)],U,5,0,0,0,0⟩) g0) (X (L ⟨[(.E,401)],U,5,0,0,0,0⟩) g0)) +def g36 : BTree CapRow:=X (X (X (L ⟨[(.O,83)],U,22,0,0,0,0⟩) g0) (X (L ⟨[(.G,362)],U,0,3,0,0,0⟩) g0)) (X (X (L ⟨[(.O,219)],U,7,0,0,0,0⟩) g0) (X (L ⟨[(.E,442)],U,1,0,0,0,0⟩) g0)) +def g37 : BTree CapRow:=X (X (X (L ⟨[(.E,8)],U,3,0,0,0,0⟩) g0) (X (L ⟨[(.G,296)],U,0,7,0,0,0⟩) g0)) (X (X (L ⟨[(.G,413)],U,0,0,0,23,22⟩) g0) (X (L ⟨[(.E,445)],U,1,0,0,0,0⟩) g0)) +def g38 : BTree CapRow:=X (X (L ⟨[(.E,6),(.E,99),(.E,145),(.E,162),(.E,205),(.E,251),(.E,266),(.E,329),(.E,401)],U,11,0,0,0,0⟩) g0) (X (L ⟨[(.E,310),(.O,165)],U,24,0,0,0,0⟩) g0) +def g39 : BTree CapRow:=X (X g35 g36) (X g37 (X g38 (X (X (L ⟨[(.E,334)],U,5,0,0,0,0⟩) g0) (X (L ⟨[(.E,509)],U,1,0,0,0,0⟩) g0)))) +def g40 : BTree CapRow:=X (X (X (X g23 g24) (X g25 g26)) (X (X g27 g28) (X g29 g30))) (X (X (X g31 g32) (X g33 g34)) g39) +def g41 : BTree CapRow:=X (X (X (L ⟨[(.G,371)],U,0,0,27,21,39⟩) (L ⟨[(.E,479)],U,1,0,0,0,0⟩)) (X (L ⟨[(.G,18)],U,0,0,13,0,0⟩) g0)) (X (X (L ⟨[(.E,111)],U,21,0,0,0,0⟩) g0) (X (L ⟨[(.O,390)],U,6,0,0,0,0⟩) g0)) +def g42 : BTree CapRow:=X (X (X (L ⟨[(.O,98)],U,10,0,0,0,0⟩) g0) (X (L ⟨[(.O,79)],U,27,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,433)],U,0,13,0,0,0⟩) g0) (X (L ⟨[(.E,451)],U,1,0,0,0,0⟩) g0)) +def g43 : BTree CapRow:=X (X (X (L ⟨[(.G,27)],U,0,0,13,0,0⟩) (L ⟨[(.E,547)],U,1,0,0,0,0⟩)) (X (L ⟨[(.G,383)],U,0,16,0,0,0⟩) g0)) (X (X (L ⟨[(.E,17),(.E,124)],U,5,0,0,0,0⟩) g0) (X (L ⟨[(.E,373)],U,7,0,0,0,0⟩) g0)) +def g44 : BTree CapRow:=X (X (X (L ⟨[(.E,26)],U,7,0,0,0,0⟩) g0) (X (L ⟨[(.G,74)],U,0,0,9,0,0⟩) g0)) (X (X (L ⟨[(.E,152),(.E,291),(.O,140)],U,19,0,0,0,0⟩) g0) (X (L ⟨[(.E,483)],U,1,0,0,0,0⟩) g0)) +def g45 : BTree CapRow:=X (X (X (L ⟨[(.G,337)],U,0,13,0,0,0⟩) (L ⟨[(.E,545)],U,1,0,0,0,0⟩)) (X (L ⟨[(.G,291)],U,0,11,0,0,0⟩) g0)) (X (X (L ⟨[(.O,168)],U,1,0,0,0,0⟩) g0) (X (L ⟨[(.G,180)],U,0,0,21,42,42⟩) g0)) +def g46 : BTree CapRow:=X (L ⟨[(.E,140),(.G,10),(.G,16),(.G,32),(.G,53),(.G,54),(.G,88),(.G,113),(.G,151),(.G,169),(.G,255),(.G,272),(.G,341),(.G,348),(.G,393),(.G,408),(.O,152),(.O,275),(.O,291)],U,19,13,21,0,0⟩) g0 +def g47 : BTree CapRow:=X (X (X (L ⟨[(.G,66)],U,0,10,0,0,0⟩) g0) g46) (X (X (L ⟨[(.G,68)],U,0,23,0,0,0⟩) g0) (X (L ⟨[(.E,467)],U,1,0,0,0,0⟩) g0)) +def g48 : BTree CapRow:=X (X (X (L ⟨[(.E,396)],U,7,0,0,0,0⟩) g0) (X (L ⟨[(.G,305)],U,0,3,0,0,0⟩) g0)) (X (X (L ⟨[(.G,175)],U,0,15,0,0,0⟩) g0) (X (L ⟨[(.G,416)],U,0,21,42,30,0⟩) g0)) +def g49 : BTree CapRow:=X (L ⟨[(.E,9),(.E,155),(.E,236),(.E,271),(.E,292),(.E,340),(.E,350),(.E,406),(.G,15),(.G,45),(.G,47),(.G,50),(.G,52),(.G,85),(.G,90),(.G,110),(.G,130),(.G,184),(.G,186),(.G,201),(.G,247),(.G,260),(.G,263),(.G,274),(.G,295),(.G,303),(.G,317),(.G,332),(.G,361),(.G,398),(.G,427),(.O,57),(.O,200),(.O,381)],U,27,21,15,0,39⟩) g0 +def g50 : BTree CapRow:=X (X (X (L ⟨[(.E,405)],U,3,0,0,0,0⟩) g0) g49) (X (X (L ⟨[(.E,145)],U,9,0,0,0,0⟩) g0) (X (L ⟨[(.E,499)],U,1,0,0,0,0⟩) g0)) +def g51 : BTree CapRow:=X (X (X (L ⟨[(.O,9)],U,5,0,0,0,0⟩) (L ⟨[(.E,543)],U,1,0,0,0,0⟩)) (X (L ⟨[(.O,269)],U,20,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,123)],U,0,39,15,11,39⟩) g0) (X (L ⟨[(.G,323)],U,0,23,22,22,0⟩) g0)) +def g52 : BTree CapRow:=X (X (X (L ⟨[(.G,430)],U,0,9,0,0,0⟩) g0) (X (L ⟨[(.O,313)],U,5,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,199)],U,0,19,13,21,0⟩) g0) (X (L ⟨[(.E,459)],U,1,0,0,0,0⟩) g0)) +def g53 : BTree CapRow:=X (X (X (L ⟨[(.O,118)],U,10,0,0,0,0⟩) (L ⟨[(.E,528)],U,1,0,0,0,0⟩)) (X (L ⟨[(.G,248)],U,0,0,0,33,42⟩) g0)) (X (X (L ⟨[(.G,191)],U,0,0,0,26,42⟩) g0) (X (L ⟨[(.E,423)],U,3,0,0,0,0⟩) g0)) +def g54 : BTree CapRow:=X (X (X (L ⟨[(.O,105)],U,5,0,0,0,0⟩) g0) (X (L ⟨[(.E,256),(.E,315)],U,3,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,230)],U,0,0,0,27,0⟩) g0) (X (L ⟨[(.E,491)],U,1,0,0,0,0⟩) g0)) +def g55 : BTree CapRow:=X (L ⟨[(.E,40),(.E,66),(.E,100),(.E,111),(.E,116),(.E,167),(.E,214),(.E,283),(.E,286),(.E,296),(.E,346),(.E,347),(.E,386),(.E,396),(.E,414),(.E,436)],U,21,0,0,0,0⟩) g0 +def g56 : BTree CapRow:=X (X (X (L ⟨[(.E,438)],U,13,0,0,0,0⟩) (L ⟨[(.E,518)],U,1,0,0,0,0⟩)) (X (L ⟨[(.E,259)],U,1,0,0,0,0⟩) g0)) (X g55 (X (L ⟨[(.E,408)],U,1,0,0,0,0⟩) g0)) +def g57 : BTree CapRow:=X (X (X (L ⟨[(.E,296)],U,3,0,0,0,0⟩) g0) (X (L ⟨[(.O,415)],U,12,0,0,0,0⟩) g0)) (X (X (L ⟨[(.E,199)],U,13,0,0,0,0⟩) g0) (X (L ⟨[(.E,475)],U,3,0,0,0,0⟩) g0)) +def g58 : BTree CapRow:=X (X (X (L ⟨[(.O,48)],U,14,0,0,0,0⟩) g0) (X (L ⟨[(.E,238),(.E,245)],U,19,0,0,0,0⟩) g0)) (X (X (L ⟨[(.E,116)],U,5,0,0,0,0⟩) g0) (X (L ⟨[(.E,454)],U,1,0,0,0,0⟩) g0)) +def g59 : BTree CapRow:=X (X (X (L ⟨[(.G,121)],U,0,39,15,11,39⟩) g0) (X (L ⟨[(.E,378)],V,29,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,140)],U,0,0,26,36,42⟩) g0) (X (L ⟨[(.E,507)],U,1,0,0,0,0⟩) g0)) +def g60 : BTree CapRow:=X (X (X (X g41 g42) (X g43 g44)) (X (X g45 g47) (X g48 g50))) (X (X (X g51 g52) (X g53 g54)) (X (X g56 g57) (X g58 g59))) +def g61 : BTree CapRow:=X (X (X (L ⟨[(.O,8)],U,10,0,0,0,0⟩) (L ⟨[(.E,555)],U,1,0,0,0,0⟩)) (X (L ⟨[(.E,433)],U,7,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,136)],U,0,1,0,0,0⟩) g0) (X (L ⟨[(.E,118)],U,3,0,0,0,0⟩) g0)) +def g62 : BTree CapRow:=X (X (X (L ⟨[(.G,69)],U,0,19,0,0,0⟩) g0) (X (L ⟨[(.G,139)],U,0,13,0,0,0⟩) g0)) (X (X (L ⟨[(.G,197)],U,0,22,0,0,0⟩) g0) (X (L ⟨[(.E,464)],U,1,0,0,0,0⟩) g0)) +def g63 : BTree CapRow:=X (X (X (L ⟨[(.G,434)],U,0,0,21,42,30⟩) (L ⟨[(.E,551)],U,1,0,0,0,0⟩)) (X (L ⟨[(.E,289)],U,3,0,0,0,0⟩) g0)) (X (X (L ⟨[(.E,147)],U,3,0,0,0,0⟩) g0) (X (L ⟨[(.G,420)],U,0,0,0,0,24⟩) g0)) +def g64 : BTree CapRow:=X (X (X (L ⟨[(.G,364)],U,0,5,0,0,0⟩) g0) (X (L ⟨[(.O,356)],U,7,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,222)],U,0,0,27,0,0⟩) g0) (X (L ⟨[(.E,136)],U,1,0,0,0,0⟩) g0)) +def g65 : BTree CapRow:=X (X (L ⟨[(.E,6)],U,5,0,0,0,0⟩) (L ⟨[(.G,552)],U,0,1,0,0,0⟩)) (X (L ⟨[(.E,370),(.O,170)],U,15,0,0,0,0⟩) g0) +def g66 : BTree CapRow:=X (X (X (L ⟨[(.O,188)],U,15,0,0,0,0⟩) g0) (X (L ⟨[(.G,341)],U,0,13,0,0,0⟩) g0)) (X (X (L ⟨[(.O,218)],U,16,0,0,0,0⟩) g0) (X (L ⟨[(.E,471)],U,1,0,0,0,0⟩) g0)) +def g67 : BTree CapRow:=X (X (L ⟨[(.G,52)],U,0,7,0,0,0⟩) g0) (X (L ⟨[(.G,2),(.G,34),(.G,55),(.G,75),(.G,94),(.G,108),(.G,206),(.G,279),(.G,354),(.G,363)],U,0,0,0,27,39⟩) g0) +def g68 : BTree CapRow:=X (L ⟨[(.E,13),(.E,239),(.E,288),(.E,313),(.E,356),(.E,371),(.G,33),(.G,39),(.G,139),(.G,364),(.G,373),(.O,174),(.O,336),(.O,388),(.O,422)],U,15,15,0,0,21⟩) g0 +def g69 : BTree CapRow:=X (X (X (L ⟨[(.E,337)],U,7,0,0,0,0⟩) g0) g68) (X (X (L ⟨[(.E,277)],U,3,0,0,0,0⟩) g0) (X (L ⟨[(.G,503)],U,0,0,0,1,0⟩) g0)) +def g70 : BTree CapRow:=X (X (X g65 (X (X (L ⟨[(.G,116)],U,0,10,0,0,0⟩) g0) (X (L ⟨[(.G,404)],U,0,5,0,0,0⟩) g0))) g66) (X (X g67 (X (X (L ⟨[(.E,343),(.O,43)],U,36,0,0,0,0⟩) g0) (X (L ⟨[(.G,437)],U,0,24,22,23,0⟩) g0))) g69) +def g71 : BTree CapRow:=X (X (X (L ⟨[(.E,409)],U,7,0,0,0,0⟩) (L ⟨[(.E,535)],U,1,0,0,0,0⟩)) (X (L ⟨[(.O,208)],U,22,0,0,0,0⟩) g0)) (X (X (L ⟨[(.E,73),(.O,367)],U,19,0,0,0,0⟩) g0) (X (L ⟨[(.E,386)],U,3,0,0,0,0⟩) g0)) +def g72 : BTree CapRow:=X (X (X (L ⟨[(.O,397)],U,26,0,0,0,0⟩) g0) (X (L ⟨[(.O,237)],U,11,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,202)],U,0,0,19,13,21⟩) g0) (X (L ⟨[(.E,305)],U,1,0,0,0,0⟩) g0)) +def g73 : BTree CapRow:=X (X (X (L ⟨[(.G,124)],U,0,11,0,0,0⟩) g0) (X (L ⟨[(.G,298)],U,0,0,0,0,42⟩) g0)) (X (X (L ⟨[(.G,170)],U,0,0,0,0,42⟩) g0) (X (L ⟨[(.E,83)],U,9,0,0,0,0⟩) g0)) +def g74 : BTree CapRow:=X (X (X (L ⟨[(.E,100)],U,7,0,0,0,0⟩) g0) (X (L ⟨[(.G,429)],U,0,30,0,0,0⟩) g0)) (X (X (L ⟨[(.E,89),(.E,314),(.O,115)],U,29,0,0,0,0⟩) g0) (X (L ⟨[(.O,498)],U,4,0,0,0,0⟩) g0)) +def g75 : BTree CapRow:=X (X (X (L ⟨[(.O,27)],U,7,0,0,0,0⟩) (L ⟨[(.E,522)],U,1,0,0,0,0⟩)) (X (L ⟨[(.O,176)],U,12,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,162)],U,0,5,0,0,0⟩) g0) (X (L ⟨[(.E,420)],U,7,0,0,0,0⟩) g0)) +def g76 : BTree CapRow:=X (X (X (L ⟨[(.G,439)],U,0,0,23,21,15⟩) g0) (X (L ⟨[(.G,211)],U,0,15,0,0,0⟩) g0)) (X (X (L ⟨[(.G,322)],U,0,27,0,0,0⟩) g0) (X (L ⟨[(.G,485)],U,0,3,0,0,0⟩) g0)) +def g77 : BTree CapRow:=X (X (X (L ⟨[(.O,69)],U,22,0,0,0,0⟩) g0) (X (L ⟨[(.G,101)],U,0,5,0,0,0⟩) g0)) (X (X (L ⟨[(.G,224)],U,0,1,0,0,0⟩) g0) (X (L ⟨[(.E,447)],U,1,0,0,0,0⟩) g0)) +def g78 : BTree CapRow:=X (X (X (L ⟨[(.E,125),(.O,122)],U,21,0,0,0,0⟩) g0) (X (L ⟨[(.G,78)],U,0,26,0,0,0⟩) g0)) (X (X (L ⟨[(.G,256)],U,0,7,0,0,0⟩) g0) (X (L ⟨[(.E,511)],U,1,0,0,0,0⟩) g0)) +def g79 : BTree CapRow:=X (X (X (X g61 g62) (X g63 g64)) g70) (X (X (X g71 g72) (X g73 g74)) (X (X g75 g76) (X g77 g78))) +def g80 : BTree CapRow:=X (X (L ⟨[(.G,234)],U,0,0,0,0,27⟩) (L ⟨[(.E,514)],U,1,0,0,0,0⟩)) (X (L ⟨[(.E,359),(.O,374)],U,18,0,0,0,0⟩) g0) +def g81 : BTree CapRow:=X (X (X (L ⟨[(.E,16)],U,5,0,0,0,0⟩) g0) (X (L ⟨[(.G,324)],U,0,3,0,0,0⟩) g0)) (X (X (L ⟨[(.O,171)],U,9,0,0,0,0⟩) g0) (X (L ⟨[(.E,450)],U,1,0,0,0,0⟩) g0)) +def g82 : BTree CapRow:=X (X (X (L ⟨[(.O,439)],U,13,0,0,0,0⟩) (L ⟨[(.E,550)],U,1,0,0,0,0⟩)) (X (L ⟨[(.O,288)],U,5,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,145)],U,0,18,0,0,0⟩) g0) (X (L ⟨[(.G,127)],U,0,7,0,0,0⟩) g0)) +def g83 : BTree CapRow:=X (X (X (L ⟨[(.G,396)],U,0,14,0,0,0⟩) g0) (X (L ⟨[(.E,338)],U,13,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,205)],U,0,18,0,0,0⟩) g0) (X (L ⟨[(.G,505)],U,0,1,0,0,0⟩) g0)) +def g84 : BTree CapRow:=X (X (X g80 (X (X (L ⟨[(.E,126)],U,11,0,0,0,0⟩) g0) (X (L ⟨[(.E,362)],U,1,0,0,0,0⟩) g0))) g81) (X g82 g83) +def g85 : BTree CapRow:=X (X (L ⟨[(.E,23),(.E,42),(.E,62),(.E,197),(.E,293),(.E,435)],U,11,0,0,0,0⟩) (L ⟨[(.G,531)],U,0,3,0,0,0⟩)) (X (L ⟨[(.G,272)],U,0,9,0,0,0⟩) g0) +def g86 : BTree CapRow:=X (X (L ⟨[(.G,92)],U,0,22,0,0,0⟩) g0) (X (L ⟨[(.E,26),(.E,118),(.E,149),(.E,199),(.E,433)],U,13,0,0,0,0⟩) g0) +def g87 : BTree CapRow:=X (X g85 (X (X (L ⟨[(.O,211)],U,18,0,0,0,0⟩) g0) (X (L ⟨[(.O,404)],U,8,0,0,0,0⟩) g0))) (X g86 (X (X (L ⟨[(.E,99)],U,11,0,0,0,0⟩) g0) (X (L ⟨[(.E,466)],U,1,0,0,0,0⟩) g0))) +def g88 : BTree CapRow:=X (X (X (L ⟨[(.G,33)],U,0,13,0,0,0⟩) g0) (X (L ⟨[(.E,375)],U,3,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,331)],U,0,12,0,0,0⟩) g0) (X (L ⟨[(.E,394)],U,13,0,0,0,0⟩) g0)) +def g89 : BTree CapRow:=X (X (X (L ⟨[(.E,57)],U,3,0,0,0,0⟩) g0) (X (L ⟨[(.E,330)],U,3,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,240)],U,0,33,24,42,0⟩) g0) (X (L ⟨[(.E,501)],U,1,0,0,0,0⟩) g0)) +def g90 : BTree CapRow:=X (X (X (L ⟨[(.G,8)],U,0,7,0,0,0⟩) (L ⟨[(.E,523)],U,1,0,0,0,0⟩)) (X (L ⟨[(.G,251)],U,0,18,0,0,0⟩) g0)) (X (X (L ⟨[(.G,141)],U,0,4,0,0,0⟩) g0) (X (L ⟨[(.E,381)],U,3,0,0,0,0⟩) g0)) +def g91 : BTree CapRow:=X (L ⟨[(.E,27),(.E,70),(.E,93),(.E,171),(.E,194),(.E,202),(.G,10),(.G,131),(.G,272),(.G,334),(.G,341)],U,11,13,0,0,19⟩) g0 +def g92 : BTree CapRow:=X (X g91 (X (L ⟨[(.O,338)],U,22,0,0,0,0⟩) g0)) (X (X (L ⟨[(.E,286)],U,7,0,0,0,0⟩) g0) (X (L ⟨[(.E,458)],U,1,0,0,0,0⟩) g0)) +def g93 : BTree CapRow:=X (X (X (L ⟨[(.E,68)],U,11,0,0,0,0⟩) (L ⟨[(.E,526)],U,1,0,0,0,0⟩)) (X (L ⟨[(.E,205)],U,9,0,0,0,0⟩) g0)) (X (X (L ⟨[(.O,155)],U,11,0,0,0,0⟩) g0) (X (L ⟨[(.G,293)],U,0,20,0,0,0⟩) g0)) +def g94 : BTree CapRow:=X (X (X (L ⟨[(.G,104)],U,0,9,0,0,0⟩) g0) (X (L ⟨[(.E,347)],U,9,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,334)],U,0,11,0,0,0⟩) g0) (X (L ⟨[(.E,512)],U,1,0,0,0,0⟩) g0)) +def g95 : BTree CapRow:=X (L ⟨[(.E,5),(.E,106),(.E,126),(.E,147),(.E,175),(.E,220),(.E,259),(.E,289),(.E,330),(.E,355),(.E,358),(.E,392),(.E,399),(.E,405),(.E,409),(.E,423)],U,11,0,0,0,0⟩) g0 +def g96 : BTree CapRow:=X (X (X (L ⟨[(.G,23)],U,0,16,0,0,0⟩) (L ⟨[(.G,534)],U,0,0,1,0,0⟩)) (X (L ⟨[(.E,266)],U,11,0,0,0,0⟩) g0)) (X g95 (X (L ⟨[(.E,388),(.O,13)],U,13,0,0,0,0⟩) g0)) +def g97 : BTree CapRow:=X (X (X (L ⟨[(.G,143),(.G,258)],U,0,0,0,39,39⟩) g0) (X (L ⟨[(.E,329)],U,11,0,0,0,0⟩) g0)) (X (X (L ⟨[(.E,193)],U,5,0,0,0,0⟩) g0) (X (L ⟨[(.E,474)],U,1,0,0,0,0⟩) g0)) +def g98 : BTree CapRow:=X (X (L ⟨[(.E,10),(.E,16),(.E,32),(.E,159),(.E,169),(.E,255),(.E,272),(.E,341),(.E,408)],U,7,0,0,0,0⟩) g0) (X (L ⟨[(.G,176)],U,0,9,0,0,0⟩) g0) +def g99 : BTree CapRow:=X (L ⟨[(.E,13),(.E,105),(.E,117),(.E,122),(.E,219),(.E,239),(.E,288),(.E,313),(.E,356),(.E,371),(.E,391),(.E,411),(.E,428),(.G,22),(.G,33),(.G,35),(.G,76),(.G,95),(.G,139),(.G,156),(.G,163),(.G,175),(.G,207),(.G,209),(.G,212),(.G,232),(.G,242),(.G,253),(.G,281),(.G,297),(.G,299),(.G,308),(.G,309),(.G,324),(.G,330),(.G,335),(.G,345),(.G,355),(.G,364),(.G,373),(.G,409),(.G,412),(.G,423),(.O,125),(.O,153),(.O,174),(.O,238),(.O,245),(.O,336),(.O,388),(.O,422)],U,39,15,11,0,39⟩) g0 +def g100 : BTree CapRow:=X (X g99 (X (L ⟨[(.E,378)],V,29,0,0,0,0⟩) g0)) (X (X (L ⟨[(.E,245)],U,19,0,0,0,0⟩) g0) (X (L ⟨[(.E,489)],U,1,0,0,0,0⟩) g0)) +def g101 : BTree CapRow:=X (X g96 g97) (X (X g98 (X (X (L ⟨[(.E,89),(.O,187)],U,29,0,0,0,0⟩) g0) (X (L ⟨[(.G,452)],U,0,0,0,0,1⟩) g0))) g100) +def g102 : BTree CapRow:=X (X (X (L ⟨[(.O,428)],U,5,0,0,0,0⟩) (L ⟨[(.E,519)],U,1,0,0,0,0⟩)) (X (L ⟨[(.E,355)],U,3,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,134)],U,0,0,1,0,0⟩) g0) (X (L ⟨[(.G,346)],U,0,12,0,0,0⟩) g0)) +def g103 : BTree CapRow:=X (X (X (L ⟨[(.E,123),(.O,119)],U,19,0,0,0,0⟩) g0) (X (L ⟨[(.E,324)],U,1,0,0,0,0⟩) g0)) (X (X (L ⟨[(.O,199)],U,22,0,0,0,0⟩) g0) (X (L ⟨[(.E,455)],U,1,0,0,0,0⟩) g0)) +def g104 : BTree CapRow:=X (X (L ⟨[(.E,37),(.G,137),(.G,141),(.O,132)],U,3,4,4,0,0⟩) (L ⟨[(.E,179)],U,1,0,0,0,0⟩)) (X (L ⟨[(.O,149)],U,20,0,0,0,0⟩) g0) +def g105 : BTree CapRow:=X (L ⟨[(.E,29),(.E,327),(.G,21),(.G,24),(.G,40),(.G,56),(.G,66),(.G,91),(.G,97),(.G,100),(.G,111),(.G,112),(.G,116),(.G,167),(.G,172),(.G,177),(.G,213),(.G,214),(.G,243),(.G,252),(.G,280),(.G,283),(.G,286),(.G,290),(.G,296),(.G,300),(.G,304),(.G,316),(.G,320),(.G,344),(.G,346),(.G,347),(.G,366),(.G,382),(.G,385),(.G,386),(.G,396),(.G,414),(.G,421),(.G,436),(.O,10),(.O,16),(.O,30),(.O,32),(.O,53),(.O,71),(.O,159),(.O,164),(.O,169),(.O,193),(.O,203),(.O,255),(.O,272),(.O,277),(.O,310),(.O,341),(.O,408)],U,21,42,30,0,42⟩) g0 +def g106 : BTree CapRow:=X (X (X (L ⟨[(.E,264),(.E,319)],U,5,0,0,0,0⟩) g0) (X (L ⟨[(.G,335)],U,0,7,0,0,0⟩) g0)) (X (X (L ⟨[(.E,229),(.G,305),(.G,306),(.O,305)],U,6,3,3,0,0⟩) g0) (X (L ⟨[(.E,494)],U,3,0,0,0,0⟩) g0)) +def g107 : BTree CapRow:=X (L ⟨[(.E,67),(.G,12),(.G,30),(.G,71),(.G,164),(.G,193),(.G,203),(.G,233),(.G,273),(.G,277),(.G,342),(.O,87)],U,17,13,13,0,0⟩) g0 +def g108 : BTree CapRow:=X (X (X (L ⟨[(.E,10)],U,3,0,0,0,0⟩) (L ⟨[(.G,536)],U,0,0,1,0,0⟩)) (X (L ⟨[(.O,93)],U,5,0,0,0,0⟩) g0)) (X g107 (X (L ⟨[(.O,117)],U,5,0,0,0,0⟩) g0)) +def g109 : BTree CapRow:=X (X (X (L ⟨[(.O,84)],U,11,0,0,0,0⟩) g0) (X (L ⟨[(.O,340)],U,13,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,226)],U,0,19,0,0,0⟩) g0) (X (L ⟨[(.G,472)],U,0,1,0,0,0⟩) g0)) +def g110 : BTree CapRow:=X (L ⟨[(.E,115),(.G,6),(.G,14),(.G,44),(.G,63),(.G,81),(.G,99),(.G,144),(.G,145),(.G,181),(.G,205),(.G,210),(.G,231),(.G,251),(.G,261),(.G,266),(.G,307),(.G,318),(.G,325),(.G,329),(.G,339),(.G,368),(.G,369),(.G,401),(.G,418),(.G,426),(.O,5),(.O,89),(.O,106),(.O,126),(.O,147),(.O,175),(.O,220),(.O,259),(.O,289),(.O,314),(.O,330),(.O,355),(.O,358),(.O,392),(.O,399),(.O,405),(.O,409),(.O,423)],U,24,22,23,0,0⟩) g0 +def g111 : BTree CapRow:=X (X (X (L ⟨[(.E,200)],U,13,0,0,0,0⟩) g0) (X (L ⟨[(.E,251)],U,9,0,0,0,0⟩) g0)) (X (X (L ⟨[(.E,175)],U,7,0,0,0,0⟩) g0) g110) +def g112 : BTree CapRow:=X (X (X (L ⟨[(.G,98)],U,0,7,0,0,0⟩) g0) (X (L ⟨[(.E,372),(.O,371)],U,15,0,0,0,0⟩) g0)) (X (X (L ⟨[(.E,343),(.O,240)],U,36,0,0,0,0⟩) g0) (X (L ⟨[(.E,504)],U,1,0,0,0,0⟩) g0)) +def g113 : BTree CapRow:=X (X (X g102 g103) (X (X g104 (X g105 (X (L ⟨[(.G,414)],U,0,7,0,0,0⟩) g0))) g106)) (X (X g108 g109) (X g111 g112)) +def g114 : BTree CapRow:=X (L ⟨[(.E,241),(.G,12),(.G,30),(.G,71),(.G,164),(.G,193),(.G,203),(.G,233),(.G,273),(.G,277),(.G,342),(.O,87)],U,17,13,13,0,0⟩) g0 +def g115 : BTree CapRow:=X (L ⟨[(.E,48),(.E,180),(.G,5),(.G,46),(.G,49),(.G,102),(.G,106),(.G,126),(.G,147),(.G,157),(.G,175),(.G,178),(.G,220),(.G,223),(.G,249),(.G,259),(.G,287),(.G,289),(.G,321),(.G,326),(.G,330),(.G,349),(.G,355),(.G,357),(.G,358),(.G,392),(.G,399),(.G,405),(.G,407),(.G,409),(.G,423),(.G,424),(.G,431),(.O,41),(.O,195),(.O,264),(.O,319)],U,23,21,15,0,0⟩) g0 +def g116 : BTree CapRow:=X (X (X (L ⟨[(.G,73)],U,0,11,13,0,19⟩) (L ⟨[(.E,539)],U,1,0,0,0,0⟩)) g114) (X (X (L ⟨[(.O,136)],U,4,0,0,0,0⟩) g0) g115) +def g117 : BTree CapRow:=X (X (X (L ⟨[(.E,53)],U,7,0,0,0,0⟩) g0) (X (L ⟨[(.G,329)],U,0,22,0,0,0⟩) g0)) (X (X (L ⟨[(.O,86)],U,18,0,0,0,0⟩) g0) (X (L ⟨[(.E,462)],U,1,0,0,0,0⟩) g0)) +def g118 : BTree CapRow:=X (X (X (L ⟨[(.E,214)],U,9,0,0,0,0⟩) g0) (X (L ⟨[(.E,8),(.E,269),(.E,338)],U,13,0,0,0,0⟩) g0)) (X (X (L ⟨[(.O,323)],U,26,0,0,0,0⟩) g0) (X (L ⟨[(.E,365),(.O,370)],U,30,0,0,0,0⟩) g0)) +def g119 : BTree CapRow:=X (X (X (L ⟨[(.G,67)],U,0,0,33,24,42⟩) g0) (X (L ⟨[(.G,250)],U,0,0,0,26,42⟩) g0)) (X (X (L ⟨[(.G,208)],U,0,19,0,0,0⟩) g0) (X (L ⟨[(.E,495)],U,1,0,0,0,0⟩) g0)) +def g120 : BTree CapRow:=X (X (L ⟨[(.E,29),(.G,135),(.G,190),(.G,224)],U,3,1,1,0,0⟩) (L ⟨[(.E,542)],U,1,0,0,0,0⟩)) (X (L ⟨[(.E,269)],U,9,0,0,0,0⟩) g0) +def g121 : BTree CapRow:=X (X (X (L ⟨[(.G,118)],U,0,7,0,0,0⟩) g0) (X (L ⟨[(.G,330)],U,0,5,0,0,0⟩) g0)) (X (X (L ⟨[(.E,220)],U,3,0,0,0,0⟩) g0) (X (L ⟨[(.O,478)],U,3,0,0,0,0⟩) g0)) +def g122 : BTree CapRow:=X (X (X (L ⟨[(.G,42)],U,0,10,0,0,0⟩) g0) (X (L ⟨[(.E,315)],U,3,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,187)],U,0,26,36,22,42⟩) g0) (X (L ⟨[(.E,446)],U,1,0,0,0,0⟩) g0)) +def g123 : BTree CapRow:=X (X (L ⟨[(.G,119)],U,0,0,0,0,42⟩) g0) (X (L ⟨[(.E,30),(.E,71),(.E,164),(.E,193),(.E,203),(.E,277)],U,7,0,0,0,0⟩) g0) +def g124 : BTree CapRow:=X (X (X g120 (X (X (L ⟨[(.G,17)],U,0,11,0,0,0⟩) g0) (X (L ⟨[(.G,394)],U,0,0,23,22,22⟩) g0))) g121) (X g122 (X g123 (X (X (L ⟨[(.G,264)],U,0,11,0,0,0⟩) g0) (X (L ⟨[(.E,487)],U,1,0,0,0,0⟩) g0)))) +def g125 : BTree CapRow:=X (X (X g84 (X g87 (X g88 g89))) (X (X (X g90 g92) (X g93 g94)) g101)) (X g113 (X (X (X g116 g117) (X g118 g119)) g124)) +def g126 : BTree CapRow:=X (X (X (L ⟨[(.G,438)],U,0,0,24,22,23⟩) (L ⟨[(.O,516)],U,6,0,0,0,0⟩)) (X (L ⟨[(.O,239)],U,3,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,87)],U,0,0,0,0,19⟩) g0) (X (L ⟨[(.G,386)],U,0,6,0,0,0⟩) g0)) +def g127 : BTree CapRow:=X (L ⟨[(.E,240),(.G,7),(.G,23),(.G,42),(.G,62),(.G,192),(.G,197),(.G,267),(.G,293),(.G,333),(.G,435),(.O,343)],U,23,22,22,0,0⟩) g0 +def g128 : BTree CapRow:=X (X (X (L ⟨[(.G,43)],U,0,33,24,42,0⟩) g0) g127) (X (X (L ⟨[(.G,310)],U,0,0,0,0,39⟩) g0) (X (L ⟨[(.E,453)],U,1,0,0,0,0⟩) g0)) +def g129 : BTree CapRow:=X (X (L ⟨[(.G,41)],U,0,11,0,0,0⟩) (L ⟨[(.E,548)],U,1,0,0,0,0⟩)) (X (L ⟨[(.E,226),(.E,244)],U,11,0,0,0,0⟩) g0) +def g130 : BTree CapRow:=X (X (X (L ⟨[(.O,142)],U,22,0,0,0,0⟩) g0) (X (L ⟨[(.E,336)],U,7,0,0,0,0⟩) g0)) (X (X (L ⟨[(.E,228)],U,1,0,0,0,0⟩) g0) (X (L ⟨[(.E,484)],U,1,0,0,0,0⟩) g0)) +def g131 : BTree CapRow:=X (X g126 g128) (X (X g129 (X (X (L ⟨[(.E,162)],U,3,0,0,0,0⟩) g0) (X (L ⟨[(.E,399)],U,3,0,0,0,0⟩) g0))) g130) +def g132 : BTree CapRow:=X (L ⟨[(.E,78),(.E,167),(.E,286),(.E,296),(.E,328),(.E,331),(.E,351),(.E,383),(.E,396),(.E,414),(.E,429)],U,15,0,0,0,0⟩) g0 +def g133 : BTree CapRow:=X (X (X (L ⟨[(.E,5)],U,3,0,0,0,0⟩) (L ⟨[(.O,532)],U,3,0,0,0,0⟩)) g132) (X (X (L ⟨[(.O,411)],U,5,0,0,0,0⟩) g0) (X (L ⟨[(.G,401)],U,0,8,0,0,0⟩) g0)) +def g134 : BTree CapRow:=X (X (L ⟨[(.E,73),(.E,370),(.E,430),(.O,298),(.O,365)],U,19,0,0,0,0⟩) g0) (X (L ⟨[(.E,139)],U,7,0,0,0,0⟩) g0) +def g135 : BTree CapRow:=X (X (X (L ⟨[(.G,48)],U,0,11,0,0,0⟩) g0) (X (L ⟨[(.E,364)],U,3,0,0,0,0⟩) g0)) (X (X (L ⟨[(.E,36)],U,1,0,0,0,0⟩) g0) (X (L ⟨[(.O,433)],U,16,0,0,0,0⟩) g0)) +def g136 : BTree CapRow:=X (L ⟨[(.E,115),(.G,4),(.G,6),(.G,7),(.G,14),(.G,19),(.G,20),(.G,25),(.G,44),(.G,61),(.G,63),(.G,64),(.G,81),(.G,99),(.G,107),(.G,114),(.G,128),(.G,129),(.G,144),(.G,145),(.G,148),(.G,158),(.G,161),(.G,166),(.G,173),(.G,181),(.G,182),(.G,185),(.G,198),(.G,205),(.G,210),(.G,221),(.G,225),(.G,231),(.G,251),(.G,261),(.G,265),(.G,266),(.G,267),(.G,282),(.G,294),(.G,307),(.G,318),(.G,325),(.G,329),(.G,333),(.G,339),(.G,360),(.G,368),(.G,369),(.G,395),(.G,401),(.G,403),(.G,417),(.G,418),(.G,419),(.G,425),(.G,426),(.G,432),(.O,5),(.O,6),(.O,58),(.O,68),(.O,89),(.O,92),(.O,101),(.O,106),(.O,126),(.O,147),(.O,175),(.O,220),(.O,259),(.O,266),(.O,270),(.O,289),(.O,314),(.O,329),(.O,330),(.O,355),(.O,358),(.O,392),(.O,399),(.O,405),(.O,409),(.O,423)],U,26,36,23,0,42⟩) g0 +def g137 : BTree CapRow:=X (X g136 (X (L ⟨[(.G,370)],U,0,27,21,15,39⟩) g0)) (X (X (L ⟨[(.G,244)],U,0,23,0,0,0⟩) g0) (X (L ⟨[(.E,500)],U,1,0,0,0,0⟩) g0)) +def g138 : BTree CapRow:=X (X g133 (X g134 (X (X (L ⟨[(.O,420)],U,15,0,0,0,0⟩) g0) (X (L ⟨[(.E,468)],U,1,0,0,0,0⟩) g0)))) (X g135 g137) +def g139 : BTree CapRow:=X (X (X (L ⟨[(.E,164)],U,3,0,0,0,0⟩) (L ⟨[(.E,524)],U,1,0,0,0,0⟩)) (X (L ⟨[(.G,266)],U,0,20,0,0,0⟩) g0)) (X (X (L ⟨[(.E,302),(.O,13)],U,13,0,0,0,0⟩) g0) (X (L ⟨[(.E,392)],U,1,0,0,0,0⟩) g0)) +def g140 : BTree CapRow:=X (X (X (L ⟨[(.G,70)],U,0,0,19,0,0⟩) g0) (X (L ⟨[(.O,430)],U,12,0,0,0,0⟩) g0)) (X (X (L ⟨[(.O,202)],U,13,0,0,0,0⟩) g0) (X (L ⟨[(.E,460)],U,1,0,0,0,0⟩) g0)) +def g141 : BTree CapRow:=X (L ⟨[(.G,11),(.G,21),(.G,31),(.G,65),(.G,72),(.G,77),(.G,82),(.G,97),(.G,103),(.G,120),(.G,150),(.G,160),(.G,172),(.G,183),(.G,196),(.G,204),(.G,215),(.G,216),(.G,217),(.G,246),(.G,254),(.G,276),(.G,280),(.G,284),(.G,304),(.G,311),(.G,316),(.G,344),(.G,352),(.G,379),(.G,380),(.G,387),(.G,389),(.G,410),(.G,421),(.O,78),(.O,167),(.O,226),(.O,244),(.O,286),(.O,296),(.O,328),(.O,331),(.O,351),(.O,383),(.O,396),(.O,414),(.O,429)],U,33,24,42,0,0⟩) (L ⟨[(.E,517)],U,1,0,0,0,0⟩) +def g142 : BTree CapRow:=X (X g141 (X (L ⟨[(.G,319)],U,0,11,0,0,0⟩) g0)) (X (X (L ⟨[(.G,149)],U,0,17,13,13,0⟩) g0) (X (L ⟨[(.E,414)],U,3,0,0,0,0⟩) g0)) +def g143 : BTree CapRow:=X (X (X (L ⟨[(.E,106)],U,3,0,0,0,0⟩) g0) (X (L ⟨[(.G,13)],U,0,0,11,13,19⟩) g0)) (X (X (L ⟨[(.G,268)],U,0,0,0,1,0⟩) g0) (X (L ⟨[(.E,492)],U,1,0,0,0,0⟩) g0)) +def g144 : BTree CapRow:=X (X (X (L ⟨[(.G,26)],U,0,13,0,0,0⟩) (L ⟨[(.E,540)],U,1,0,0,0,0⟩)) (X (L ⟨[(.O,285)],U,12,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,142)],U,0,19,0,0,0⟩) g0) (X (L ⟨[(.G,262)],U,0,7,0,0,0⟩) g0)) +def g145 : BTree CapRow:=X (X (X (L ⟨[(.E,85)],U,5,0,0,0,0⟩) g0) (X (L ⟨[(.O,353)],U,16,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,218)],U,0,13,0,0,0⟩) g0) (X (L ⟨[(.O,476)],U,4,0,0,0,0⟩) g0)) +def g146 : BTree CapRow:=X (L ⟨[(.G,4),(.G,7),(.G,14),(.G,19),(.G,20),(.G,25),(.G,61),(.G,64),(.G,107),(.G,114),(.G,128),(.G,129),(.G,148),(.G,158),(.G,161),(.G,166),(.G,173),(.G,181),(.G,182),(.G,185),(.G,198),(.G,221),(.G,225),(.G,261),(.G,265),(.G,267),(.G,282),(.G,294),(.G,333),(.G,360),(.G,369),(.G,395),(.G,403),(.G,417),(.G,419),(.G,425),(.G,426),(.G,432),(.O,6),(.O,58),(.O,68),(.O,92),(.O,101),(.O,266),(.O,270),(.O,329)],U,26,36,22,0,42⟩) g0 +def g147 : BTree CapRow:=X (X (X (L ⟨[(.G,51)],U,0,0,11,0,0⟩) g0) (X (L ⟨[(.E,52),(.E,85),(.E,362)],U,5,0,0,0,0⟩) g0)) (X g146 (X (L ⟨[(.E,444)],U,1,0,0,0,0⟩) g0)) +def g148 : BTree CapRow:=X (L ⟨[(.E,13),(.E,69),(.E,105),(.E,117),(.E,122),(.E,219),(.E,239),(.E,288),(.E,313),(.E,356),(.E,371),(.E,391),(.E,411),(.E,428),(.G,22),(.G,33),(.G,35),(.G,76),(.G,95),(.G,139),(.G,156),(.G,163),(.G,175),(.G,207),(.G,209),(.G,212),(.G,232),(.G,242),(.G,253),(.G,281),(.G,297),(.G,299),(.G,308),(.G,309),(.G,324),(.G,330),(.G,335),(.G,345),(.G,355),(.G,364),(.G,373),(.G,409),(.G,412),(.G,423),(.O,125),(.O,153),(.O,174),(.O,238),(.O,245),(.O,336),(.O,388),(.O,422)],U,39,15,11,0,39⟩) g0 +def g149 : BTree CapRow:=X (X g148 (X (L ⟨[(.G,436)],U,0,11,0,0,0⟩) g0)) (X (X (L ⟨[(.O,278)],U,18,0,0,0,0⟩) g0) (X (L ⟨[(.E,508)],U,1,0,0,0,0⟩) g0)) +def g150 : BTree CapRow:=X (X (X (L ⟨[(.G,6)],U,0,10,0,0,0⟩) (L ⟨[(.E,521)],U,1,0,0,0,0⟩)) (X (L ⟨[(.G,152)],U,0,0,0,0,39⟩) g0)) (X (X (L ⟨[(.G,146)],U,0,1,0,0,0⟩) g0) (X (L ⟨[(.G,390)],U,0,3,0,0,0⟩) g0)) +def g151 : BTree CapRow:=X (L ⟨[(.E,327),(.G,21),(.G,24),(.G,40),(.G,56),(.G,66),(.G,91),(.G,97),(.G,100),(.G,111),(.G,112),(.G,116),(.G,167),(.G,172),(.G,177),(.G,213),(.G,214),(.G,243),(.G,252),(.G,280),(.G,283),(.G,286),(.G,290),(.G,296),(.G,300),(.G,304),(.G,316),(.G,320),(.G,344),(.G,346),(.G,347),(.G,366),(.G,382),(.G,385),(.G,386),(.G,396),(.G,414),(.G,421),(.G,436),(.O,10),(.O,16),(.O,30),(.O,32),(.O,53),(.O,71),(.O,159),(.O,164),(.O,169),(.O,193),(.O,203),(.O,255),(.O,272),(.O,277),(.O,310),(.O,341),(.O,408)],U,21,42,30,0,42⟩) g0 +def g152 : BTree CapRow:=X (L ⟨[(.E,189),(.G,10),(.G,16),(.G,32),(.G,53),(.G,54),(.G,88),(.G,113),(.G,151),(.G,169),(.G,255),(.G,272),(.G,341),(.G,348),(.G,393),(.G,408),(.O,152),(.O,275),(.O,291)],U,19,13,21,0,0⟩) g0 +def g153 : BTree CapRow:=X (X (X (L ⟨[(.G,28)],U,0,0,0,0,21⟩) (L ⟨[(.E,553)],U,1,0,0,0,0⟩)) (X (L ⟨[(.E,283)],U,7,0,0,0,0⟩) g0)) (X (X (L ⟨[(.E,170),(.O,370)],U,30,0,0,0,0⟩) g0) (X (L ⟨[(.E,422)],U,7,0,0,0,0⟩) g0)) +def g154 : BTree CapRow:=X (X (X (L ⟨[(.G,100)],U,0,12,0,0,0⟩) g0) (X (L ⟨[(.G,38)],U,0,0,0,21,42⟩) g0)) (X (X (L ⟨[(.E,124)],U,5,0,0,0,0⟩) g0) (X (L ⟨[(.E,496)],U,1,0,0,0,0⟩) g0)) +def g155 : BTree CapRow:=X (X g150 (X (X (X (L ⟨[(.O,70)],U,11,0,0,0,0⟩) g0) g151) (X g152 (X (L ⟨[(.E,456)],U,1,0,0,0,0⟩) g0)))) (X g153 g154) +def g156 : BTree CapRow:=X (X (X (L ⟨[(.O,26)],U,16,0,0,0,0⟩) (L ⟨[(.E,549)],U,1,0,0,0,0⟩)) (X (L ⟨[(.G,171)],U,0,0,17,13,13⟩) g0)) (X (X (L ⟨[(.G,154)],U,0,21,0,0,0⟩) g0) (X (L ⟨[(.G,373)],U,0,15,0,0,0⟩) g0)) +def g157 : BTree CapRow:=X (X (X (L ⟨[(.G,343)],U,0,0,0,0,19⟩) g0) (X (L ⟨[(.G,59),(.G,96)],U,0,0,0,19,0⟩) g0)) (X (X (L ⟨[(.G,214)],U,0,16,0,0,0⟩) g0) (X (L ⟨[(.E,443)],U,1,0,0,0,0⟩) g0)) +def g158 : BTree CapRow:=X (X (X (L ⟨[(.G,194)],U,0,0,13,0,0⟩) g0) (X (L ⟨[(.G,315)],U,0,5,0,0,0⟩) g0)) (X (X (L ⟨[(.E,169)],U,5,0,0,0,0⟩) g0) (X (L ⟨[(.G,397)],U,0,23,21,15,0⟩) g0)) +def g159 : BTree CapRow:=X (X (X (L ⟨[(.G,402)],U,0,0,0,21,42⟩) g0) (X (L ⟨[(.E,376)],U,7,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,275)],U,0,15,0,0,0⟩) g0) (X (L ⟨[(.G,481)],U,0,0,1,0,0⟩) g0)) +def g160 : BTree CapRow:=X (X (X (L ⟨[(.E,436)],U,5,0,0,0,0⟩) (L ⟨[(.E,538)],U,1,0,0,0,0⟩)) (X (L ⟨[(.G,269)],U,0,17,13,13,0⟩) g0)) (X (X (L ⟨[(.G,138)],U,0,0,39,15,39⟩) g0) (X (L ⟨[(.E,153)],U,5,0,0,0,0⟩) g0)) +def g161 : BTree CapRow:=X (L ⟨[(.E,187),(.G,6),(.G,14),(.G,44),(.G,63),(.G,81),(.G,99),(.G,144),(.G,145),(.G,181),(.G,205),(.G,210),(.G,231),(.G,251),(.G,261),(.G,266),(.G,307),(.G,318),(.G,325),(.G,329),(.G,339),(.G,368),(.G,369),(.G,401),(.G,418),(.G,426),(.O,5),(.O,89),(.O,106),(.O,126),(.O,147),(.O,175),(.O,220),(.O,259),(.O,289),(.O,314),(.O,330),(.O,355),(.O,358),(.O,392),(.O,399),(.O,405),(.O,409),(.O,423)],U,24,22,23,0,0⟩) g0 +def g162 : BTree CapRow:=X (X g161 (X (L ⟨[(.O,312)],U,7,0,0,0,0⟩) g0)) (X (X (L ⟨[(.E,197)],U,11,0,0,0,0⟩) g0) (X (L ⟨[(.G,469)],U,0,0,1,0,0⟩) g0)) +def g163 : BTree CapRow:=X (X (X (L ⟨[(.E,346)],U,7,0,0,0,0⟩) g0) (X (L ⟨[(.E,40)],U,3,0,0,0,0⟩) g0)) (X (X (L ⟨[(.E,174),(.O,371)],U,15,0,0,0,0⟩) g0) (X (L ⟨[(.G,409)],U,0,13,0,0,0⟩) g0)) +def g164 : BTree CapRow:=X (X (X (L ⟨[(.E,119),(.O,121)],U,42,0,0,0,0⟩) g0) (X (L ⟨[(.G,109)],U,0,0,0,33,42⟩) g0)) (X (X (L ⟨[(.G,60)],U,0,3,0,0,0⟩) g0) (X (L ⟨[(.E,497)],U,1,0,0,0,0⟩) g0)) +def g165 : BTree CapRow:=X (X (X (L ⟨[(.E,30)],U,3,0,0,0,0⟩) (L ⟨[(.E,544)],U,1,0,0,0,0⟩)) (X (L ⟨[(.E,238)],U,15,0,0,0,0⟩) g0)) (X (X (L ⟨[(.E,57),(.E,381)],U,3,0,0,0,0⟩) g0) (X (L ⟨[(.E,149)],U,9,0,0,0,0⟩) g0)) +def g166 : BTree CapRow:=X (X (X (L ⟨[(.E,435)],U,9,0,0,0,0⟩) g0) (X (L ⟨[(.E,298),(.O,73)],U,14,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,355)],U,0,7,0,0,0⟩) g0) (X (L ⟨[(.E,480)],U,1,0,0,0,0⟩) g0)) +def g167 : BTree CapRow:=X (X (X (L ⟨[(.E,33)],U,7,0,0,0,0⟩) g0) (X (L ⟨[(.E,58),(.E,92),(.E,101)],U,11,0,0,0,0⟩) g0)) (X (X (L ⟨[(.G,189)],U,0,0,26,36,42⟩) g0) (X (L ⟨[(.E,448)],U,1,0,0,0,0⟩) g0)) +def g168 : BTree CapRow:=X (L ⟨[(.E,33),(.E,139),(.E,175),(.E,324),(.E,330),(.E,335),(.E,355),(.E,364),(.E,373),(.E,409),(.E,423)],U,7,0,0,0,0⟩) g0 +def g169 : BTree CapRow:=X (X g168 (X (L ⟨[(.O,301)],U,16,0,0,0,0⟩) g0)) (X (X (L ⟨[(.O,236)],U,9,0,0,0,0⟩) g0) (X (L ⟨[(.E,513)],U,1,0,0,0,0⟩) g0)) +def g170 : BTree CapRow:=X (X g155 (X (X g156 g157) (X g158 g159))) (X (X (X g160 g162) (X g163 g164)) (X (X g165 g166) (X g167 g169))) +def g171 : BTree CapRow:=X g125 (X (X (X g131 g138) (X (X (X g139 g140) (X g142 g143)) (X (X g144 g145) (X g147 g149)))) g170) +def coreGraphTree : BTree CapRow:=X (X (X (X (X g6 g13) (X g18 (X (X g19 g20) (X g21 g22)))) g40) (X g60 g79)) g171 +def q7 : Nat:=556 +def node (q : Nat) : CapRow:=qZ coreGraphTree q +def qA (q g : Nat) : Nat:=getBoundRow (node q) g +def qz (q : Nat) : Bool:=q == 378 +inductive Path : Nat -> List Letter -> Nat -> Prop where + | nil (q : Nat) : Path q [] q + | cons (q : Nat) (c : Letter) (q' : Nat) (w : List Letter) (q'' : Nat) : + (c,q') ∈ (node q).edges -> Path q' w q'' -> Path q (c :: w) q'' +def qy (q : Nat) (c : Letter) (q' g : Nat) : Bool := + if qA q' g == 0 then true else + match c with + | .Gap => (0 < qA q (min 4 (g + 1))) && (qA q' g <= qA q (min 4 (g + 1))) + | .Even => (0 < qA q 0) && + match qq true g (qA q 0 - 1) with + | some t => qA q' g <= t + 1 + | none => false + | .Odd => (0 < qA q 0) && + match qq false g (qA q 0 - 1) with + | some t => qA q' g <= t + 1 + | none => false +def qbo (q : Nat) (e : Letter × Nat) : Bool := + (e.2 < q7) && + qy q e.1 e.2 0 && + qy q e.1 e.2 1 && + qy q e.1 e.2 2 && + qy q e.1 e.2 3 && + qy q e.1 e.2 4 +def qa7 (r : CapRow) : Bool := + r.edges.any (fun e => qU e.1 .Even && qz e.2) +def qV (q : Nat) : Bool := + ((node q).final == qa7 (node q)) && + (if (node q).final then 29 <= qA q 0 else true) && + (node q).edges.all (qbo q) +def qag : Bool := + (List.range q7).all qV +theorem qaM : qag=true:= by decide +theorem qa9 (q : Nat) (hq : q < q7) : qV q=true:= by + have h:=qaM + unfold qag at h + rw [List.all_eq_true] at h + exact h q (List.mem_range.mpr hq) +theorem qaL (q : Nat) (hq : q < q7) : + (node q).final=qa7 (node q):= by + have h:=qa9 q hq + unfold qV at h + simp only [Bool.and_eq_true,beq_iff_eq] at h + exact h.1.1 +theorem checked_final (q : Nat) (hq : q < q7) (hf : (node q).final=true) : + 29 <= qA q 0:= by + have h:=qa9 q hq + unfold qV at h + simp only [Bool.and_eq_true,hf,↓reduceIte,decide_eq_true_eq] at h + exact h.1.2 +theorem qG (q : Nat) (c : Letter) (q' : Nat) + (hq : q < q7) (he : (c,q') ∈ (node q).edges) : + q' < q7 /\ ∀ g,g < 5 -> qy q c q' g=true:= by + have h:=qa9 q hq + unfold qV at h + simp only [Bool.and_eq_true] at h + have hall:=h.2 + rw [List.all_eq_true] at hall + have hedge:=hall (c,q') he + unfold qbo at hedge + simp only [Bool.and_eq_true,decide_eq_true_eq] at hedge + refine ⟨hedge.1.1.1.1.1,?_⟩ + intro g hg + rcases g with _ | _ | _ | _ | _ | g + · exact hedge.1.1.1.1.2 + · exact hedge.1.1.1.2 + · exact hedge.1.1.2 + · exact hedge.1.2 + · exact hedge.2 + · omega +theorem checked_gap (q q' g : Nat) (hq : q < q7) + (he : (.G,q') ∈ (node q).edges) (hg : g < 5) (hb : 0 < qA q' g) : + qA q' g <= qA q (min 4 (g + 1)):= by + have h:=(qG q .Gap q' hq he).2 g hg + unfold qy at h + have hne : (qA q' g == 0)=false:= by + rw [beq_eq_false_iff_ne]; omega + rw [hne] at h + simp only [Bool.false_eq_true,↓reduceIte,Bool.and_eq_true,decide_eq_true_eq] at h + exact h.2 +theorem checked_gaps (q n : Nat) (w : List Letter) (f : Nat) + (hq : q < q7) (hp : Path q (List.replicate n .Gap ++ w) f) : + ∃ q',q' < q7 /\ Path q' w f /\ + (0 < qA q' 0 -> qA q' 0 <= qA q (min 4 n)):= by + induction n generalizing q with + | zero => + exact ⟨q,hq,hp,fun _ => Nat.le_refl _⟩ + | succ n ih => + simp only [List.replicate_succ,List.cons_append] at hp + cases hp with + | cons _ _ q1 _ _ he hr => + have hq1:=(qG q .Gap q1 hq he).1 + rcases ih q1 hq1 hr with ⟨q',hq',hr',hb⟩ + refine ⟨q',hq',hr',fun hpos => ?_⟩ + have hb1:=hb hpos + have hg1:=checked_gap q q1 (min 4 n) hq he (by omega) (by omega) + have hmin : min 4 (min 4 n + 1)=min 4 (n + 1):= by omega + rw [hmin] at hg1 + omega +theorem checked_digit (q q' : Nat) (b : Bool) (g : Nat) + (hq : q < q7) + (he : ((if b then Letter.Even else Letter.Odd),q') ∈ (node q).edges) + (hb : 0 < qA q' (min 4 g)) : + 0 < qA q 0 /\ ∀ s,qA q 0 - 1 <= s -> + ∃ t,qau b g s=some t /\ qA q' (min 4 g) - 1 <= t:= by + have h:=(qG q (if b then .Even else .Odd) q' hq he).2 (min 4 g) (by omega) + unfold qy at h + have hne : (qA q' (min 4 g) == 0)=false:= by + rw [beq_eq_false_iff_ne]; omega + rw [hne] at h + cases b <;> ( + simp only [Bool.false_eq_true,↓reduceIte,Bool.and_eq_true,decide_eq_true_eq] at h + rcases h with ⟨hpos,h⟩ + cases ha : qq _ (min 4 g) (qA q 0 - 1) with + | none => rw [ha] at h; contradiction + | some t0 => + rw [ha] at h + simp only [decide_eq_true_eq] at h + refine ⟨hpos,fun s hs => ?_⟩ + rcases qbj _ g (qA q 0 - 1) t0 s ha hs with ⟨t',ht',hle'⟩ + exact ⟨t',ht',by omega⟩ + ) +def qaP : List Nat -> List Nat -> Bool + | [],_ => true + | _ :: _,[] => false + | x :: xs,y :: ys => + if x == y then qaP xs ys else qaP (x :: xs) ys +theorem qax {xs ys : List Nat} (h : qaP xs ys=true) {q : Nat} (hq : q ∈ xs) : + q ∈ ys:= by + induction ys generalizing xs with + | nil => + cases xs with + | nil => contradiction + | cons x xs' => contradiction + | cons y ys' ih => + cases xs with + | nil => contradiction + | cons x xs' => + unfold qaP at h + split_ifs at h with heq + · have hx : x=y:=beq_iff_eq.mp heq + rcases List.mem_cons.mp hq with rfl | hq' + · rw [hx]; exact List.Mem.head _ + · exact List.Mem.tail _ (ih h hq') + · exact List.Mem.tail _ (ih h hq) +structure Mask where + vertices : List Nat + sub_none : List Nat + sub_odd : List Nat + sub_even : List Nat + sub_gap : List Nat + odd_img : List Nat + odd_src : List Nat + even_img : List Nat + even_src : List Nat + gap_img : List Nat + gap_src : List Nat + accepting : Bool +def mask_sub (m : Mask) : Option Letter -> List Nat + | none => m.sub_none + | some .O => m.sub_odd + | some .E => m.sub_even + | some .G => m.sub_gap +def mask_img (m : Mask) : Letter -> List Nat + | .Odd => m.odd_img + | .Even => m.even_img + | .Gap => m.gap_img +def mask_src (m : Mask) : Letter -> List Nat + | .Odd => m.odd_src + | .Even => m.even_src + | .Gap => m.gap_src +structure TransRow where + trans_edges : List (Option Letter × Option Letter × Nat) + trans_final : Bool +def x0 : BTree TransRow:=X (X (L ⟨[(H,K,1),(H,I,12)],U⟩) (L ⟨[(P,H,33)],U⟩)) (X (L ⟨[(H,P,0)],U⟩) (L ⟨[(H,P,14)],U⟩)) +def x1 : BTree TransRow:=X (X (L ⟨[(H,P,10)],U⟩) (L ⟨[(P,H,41)],U⟩)) (X (L ⟨[(P,H,25)],U⟩) (L ⟨[(P,H,59)],U⟩)) +def x2 : BTree TransRow:=X (X (L ⟨[(P,H,5)],U⟩) (L ⟨[(H,I,27)],U⟩)) (X (L ⟨[(H,K,15),(H,I,14)],U⟩) (L ⟨[(H,K,53)],U⟩)) +def x3 : BTree TransRow:=X (L ⟨[(K,H,23),(K,H,39),(K,H,51),(K,H,6),(K,H,61),(K,H,9),(I,H,11),(I,H,17),(I,H,21),(I,H,31),(I,H,37),(I,H,46)],U⟩) (L ⟨[(P,H,50)],U⟩) +def x4 : BTree TransRow:=X (X (L ⟨[(P,H,3)],U⟩) (L ⟨[(H,I,45)],U⟩)) (X (L ⟨[(P,H,19)],U⟩) (L ⟨[(P,H,34)],U⟩)) +def x5 : BTree TransRow:=X (X (L ⟨[(H,P,45)],U⟩) (L ⟨[(P,H,43)],U⟩)) (X (L ⟨[(H,P,27)],U⟩) (L ⟨[(H,P,52)],U⟩)) +def x6 : BTree TransRow:=X (X (L ⟨[(P,H,7)],U⟩) (L ⟨[(P,H,40)],U⟩)) (X (L ⟨[(P,H,24)],U⟩) (L ⟨[(H,K,55)],U⟩)) +def x7 : BTree TransRow:=X x6 (X (X (L ⟨[(H,P,12)],U⟩) (L ⟨[(H,P,49)],U⟩)) (X (L ⟨[(H,K,27)],U⟩) (L ⟨W,U⟩))) +def x8 : BTree TransRow:=X (X (X x0 x1) (X x2 (X x3 (X (L ⟨[(P,H,29)],U⟩) (L ⟨[(H,K,45)],U⟩))))) (X (X x4 x5) x7) +def x9 : BTree TransRow:=X (X (L ⟨[(I,H,47)],U⟩) (L ⟨[(P,H,35)],U⟩)) (X (L ⟨[(P,H,18)],U⟩) (L ⟨[(H,P,15)],U⟩)) +def x10 : BTree TransRow:=X (X (L ⟨[(P,H,16)],U⟩) (L ⟨[(P,H,42)],U⟩)) (X (L ⟨[(H,P,26)],U⟩) (L ⟨[(H,K,57)],V⟩)) +def x11 : BTree TransRow:=X (X (L ⟨[(H,P,60)],U⟩) (L ⟨[(P,H,38)],U⟩)) (X (L ⟨[(P,H,22)],U⟩) (L ⟨[(H,K,54)],U⟩)) +def x12 : BTree TransRow:=X (X (L ⟨[(H,K,14),(H,I,15)],U⟩) (L ⟨[(P,H,56),(H,K,1),(H,I,12)],U⟩)) (X (L ⟨[(P,H,30)],U⟩) (L ⟨[(P,H,2)],U⟩)) +def x13 : BTree TransRow:=X (X (L ⟨[(P,H,4)],U⟩) (L ⟨[(P,H,36)],U⟩)) (X (L ⟨[(H,P,20)],U⟩) (L ⟨[(H,P,52),(H,P,58),(H,I,52)],U⟩)) +def x14 : BTree TransRow:=X (X (L ⟨[(P,H,13)],U⟩) (L ⟨[(H,P,30)],U⟩)) (X (L ⟨[(P,H,28),(H,K,15),(H,I,14)],U⟩) (L ⟨[(P,H,60)],U⟩)) +def x15 : BTree TransRow:=X (X (L ⟨[(P,H,8)],U⟩) (L ⟨[(P,H,44)],U⟩)) (X (L ⟨[(H,K,12),(H,I,1)],U⟩) (L ⟨[(H,K,57)],U⟩)) +def x16 : BTree TransRow:=X x15 (X (X (L ⟨[(H,P,1)],U⟩) (L ⟨[(H,P,48)],U⟩)) (X (L ⟨[(P,H,32)],U⟩) (L ⟨W,U⟩))) +def transTree : BTree TransRow:=X x8 (X (X (X x9 x10) (X x11 x12)) (X (X x13 x14) x16)) +def m0 : BTree Mask:=X (L ⟨[0,440,477,515],W,[2],[1],W,[80,478,516],[0,477,515],[1,441],[0,440],W,W,U⟩) (L ⟨[519],[256],[3],[257],[3],W,W,[521],[519],W,W,U⟩) +def m1 : BTree Mask:=L ⟨W,W,W,W,W,W,W,W,W,W,W,U⟩ +def m2 : BTree Mask:=X (L ⟨[6,23,40,42,62,66,99,100,111,116,127,145,162,167,174,197,205,214,251,256,266,283,286,293,296,302,315,329,336,346,347,372,386,388,396,401,414,422,435,436],W,W,[130],W,[8,26,60,69,73,86,98,104,118,121,142,149,176,199,211,218,262,269,278,285,338,353,370,390,404,415,433],[6,23,40,62,396,205,66,100,42,111,99,293,286,197,145,214,116,266,251,283,329,347,167,386,401,346,435],[10,17,33,52,85,119,124,139,154,170,175,188,272,324,330,334,335,341,355,362,364,367,373,409,420,423],[256,162,127,315,315,111,162,127,436,167,127,296,256,127,127,256,127,256,127,315,127,396,127,127,414,127],[170,188,298,365,367,420],[174,336,302,372,388,422],U⟩) m1 +def m3 : BTree Mask:=X (L ⟨[9,13,51,74,84,237,271,312,313,340,371,439],W,W,W,W,W,W,W,W,[8,48,73,83,176,208,269,301,338,370,397,430],[9,51,13,84,313,237,271,312,340,371,439,74],U⟩) m1 +def m4 : BTree Mask:=X (L ⟨[73,140,176,241,301,370],[32,103],[23,3],[96,43,3,60],[39,89],[57,200,381],[370,370,370],[8,9,27,70,93,155,171,194,202,208,236,269,271,292,338,340,350,406],[301,370,73,73,73,370,73,73,73,176,370,301,370,370,301,370,370,370],[10,15,45,47,50,52,85,90,110,115,130,131,184,186,201,240,247,260,263,272,274,295,303,317,332,334,341,361,398,427],[73,370,370,370,370,370,370,370,370,140,370,73,370,370,370,241,370,370,370,73,370,370,370,370,370,73,73,370,370,370],U⟩) (L ⟨[10,40,52,57,66,85,100,111,116,119,154,167,170,188,200,214,256,272,283,286,296,315,334,341,346,347,362,367,381,386,396,414,420,436],W,W,[290],W,[9,51,60,73,84,98,104,121,165,176,218,237,262,271,285,340,353,370,390,415],[10,52,40,396,85,66,100,111,200,286,214,334,116,272,283,341,347,167,386,346],[10,16,30,32,40,52,53,66,71,85,100,111,116,119,154,159,164,167,169,170,188,193,203,214,255,256,272,277,283,286,296,310,315,334,341,346,347,362,367,386,396,408,414,420,436],[57,57,381,57,154,315,200,154,381,315,154,154,154,111,436,57,381,154,57,167,296,381,381,154,57,362,57,381,154,154,154,200,362,256,57,154,154,315,396,154,154,57,154,414,154],[3,109,191,402,413],[420,367,170,119,188],U⟩) +def m5 : BTree Mask:=X (L ⟨[5,10,15,45,46,47,49,50,52,85,90,102,106,110,115,126,130,131,147,157,175,178,184,186,201,220,223,240,247,249,259,260,263,272,274,287,289,295,303,317,321,326,330,332,334,341,349,355,357,358,361,392,398,399,405,407,409,423,424,427,431],W,[191],[186],[155],[5,6,9,13,51,58,68,78,84,89,92,101,105,106,117,122,126,147,167,175,219,220,226,237,239,244,259,266,270,271,286,288,289,296,313,314,328,329,330,331,340,343,351,355,356,358,371,383,391,392,396,399,405,409,411,414,423,428,429],[115,115,10,409,52,115,115,240,85,115,115,115,106,115,405,126,115,115,240,115,220,115,240,334,259,240,115,115,115,272,240,289,115,240,330,115,240,115,115,240,341,240,240,115,358,115,175,240,392,115,240,115,115,115,147,240,115,5,240],[40,66,100,111,115,116,125,153,167,174,214,238,240,245,256,283,286,296,315,336,346,347,386,388,396,414,422,436],[303,332,110,130,115,186,126,399,184,175,45,287,240,249,260,295,201,90,317,355,47,361,398,409,50,427,423,15],[4,6,7,11,14,17,19,20,21,23,25,31,33,42,44,61,62,63,64,65,72,77,81,82,87,97,99,103,107,114,120,124,128,129,139,144,145,148,150,152,158,160,161,166,172,173,175,181,182,183,185,192,196,197,198,204,205,210,215,216,217,221,225,231,246,251,254,261,265,266,267,275,276,280,282,284,291,293,294,304,307,311,316,318,324,325,329,330,333,335,339,344,352,355,360,364,368,369,373,379,380,387,389,395,401,403,409,410,417,418,419,421,423,425,426,432,435],[115,115,115,240,115,157,115,115,240,240,115,240,49,240,115,115,240,115,115,240,240,240,115,240,131,240,115,240,115,115,240,46,115,115,326,115,115,115,240,263,115,240,115,115,240,115,178,115,115,240,115,240,240,240,115,240,115,115,240,240,240,115,115,115,240,115,240,115,115,115,115,247,240,240,115,240,274,240,115,240,115,240,240,115,321,115,115,349,115,357,115,240,240,223,115,102,115,115,407,240,240,240,240,115,115,115,431,240,115,115,115,240,424,115,115,115,240],U⟩) m1 +def m6 : BTree Mask:=X (L ⟨[9,27,70,93,155,171,194,202,236,271,292,340,350,406],W,W,W,[69,62],W,W,W,W,[8,26,69,86,118,142,149,199,211,269,278,338,404,433],[9,27,70,236,93,155,171,202,350,271,292,340,406,194],U⟩) m1 +def m7 : BTree Mask:=X (X (X m0 m2) (X (X (L ⟨[400],[64],W,W,[65],W,W,W,W,[34,55,75,108,206,279],[400,400,400,400,400,400],U⟩) m1) m3)) (X (X m4 m5) (X m6 (X (L ⟨[513],[224],[3],[225],[3],W,W,[514],[513],W,W,U⟩) m1))) +def m8 : BTree Mask:=X (L ⟨[5,10,15,45,46,47,49,50,52,85,90,102,106,110,126,130,131,147,157,175,178,184,186,201,220,223,247,249,259,260,263,272,274,287,289,295,303,317,321,326,330,332,334,341,349,355,357,358,361,392,398,399,405,407,409,423,424,427,431],W,[44,53,3],[40,54,77,97,3],[34,24],[9,13,51,84,105,117,122,219,237,239,271,288,313,340,356,371,391,411,428],[10,409,52,85,106,405,126,220,334,259,272,289,330,341,358,175,392,147,5],[40,66,100,111,116,125,153,167,174,214,238,245,256,283,286,296,315,336,346,347,386,388,396,414,422,436],[303,332,110,130,186,126,399,184,175,45,287,249,260,295,201,90,317,355,47,361,398,409,50,427,423,15],[17,33,87,124,139,152,175,275,291,324,330,335,355,364,373,409,423],[157,49,131,46,326,263,178,247,274,321,349,357,223,102,407,431,424],U⟩) (L ⟨[9,10,16,27,30,32,53,70,71,87,93,119,152,155,159,164,169,170,171,188,193,194,202,203,236,255,271,272,275,277,291,292,310,340,341,350,367,406,408,420],W,W,[276],W,[9,27,70,93,155,171,194,202,236,271,292,340,350,406],[10,30,71,277,169,193,164,203,255,272,16,341,32,408],[57,78,167,200,226,244,286,296,328,331,351,381,383,396,414,429],[159,275,275,53,291,291,275,275,275,275,275,159,275,275,275,275],[2,3,8,26,34,55,69,75,86,89,94,108,109,118,142,149,191,199,206,211,269,278,279,338,343,354,363,402,404,413,433],[310,420,9,27,310,310,70,310,236,152,310,310,367,93,155,171,170,202,310,350,271,292,310,340,87,310,310,119,406,188,194],U⟩) +def m9 : BTree Mask:=X (X (L ⟨[89,343],[80,163],W,W,[41,133,3],W,W,W,W,[59,96,143,258],[343,343,89,89],U⟩) m1) (X (L ⟨[305,306],W,W,W,[203],W,W,[375],[305],[305],[306],U⟩) m1) +def m10 : BTree Mask:=X (L ⟨[21,40,56,66,91,97,100,111,116,167,172,177,213,214,243,252,280,283,286,290,296,300,304,316,320,344,346,347,366,382,385,386,396,414,421,436],W,[9,72],[49,68,101,29],[61],[60,73,98,104,121,176,218,262,285,353,370,390,415],[40,396,66,100,111,286,214,116,283,347,167,386,346],[10,52,85,119,154,170,188,272,334,341,362,367,420],[21,56,91,111,436,167,296,280,252,344,385,396,414],[78,167,226,244,286,296,328,331,351,383,396,414,429],[382,172,213,243,304,316,320,177,300,290,97,421,366],U⟩) m1 +def m11 : BTree Mask:=X (L ⟨[5,6,10,16,17,30,32,33,53,58,68,71,78,87,89,92,101,106,124,126,139,147,152,159,164,167,169,170,175,188,193,203,220,226,244,255,259,266,270,272,275,277,286,289,291,296,298,310,314,324,328,329,330,331,335,341,343,351,355,358,364,365,367,373,383,392,396,399,405,408,409,414,420,423,429],W,W,[173],W,[8,9,13,27,48,70,73,74,83,93,105,117,122,140,155,171,176,180,194,202,208,219,236,239,241,269,271,288,292,301,312,313,338,340,350,356,370,371,391,397,406,411,428,430,439],[6,10,139,30,58,71,351,364,92,277,106,405,126,226,169,193,286,68,164,203,270,220,255,259,244,266,272,289,16,383,335,330,329,341,32,358,167,175,392,78,408,147,5,331,33],[6,23,41,42,57,62,78,87,99,125,127,145,152,153,162,167,170,174,188,195,197,200,205,226,238,244,245,251,264,266,275,286,291,293,296,298,302,319,328,329,331,336,351,365,367,372,381,383,388,396,401,414,420,422,429,435],[124,17,68,17,159,17,275,244,124,126,324,124,226,399,124,275,167,175,296,68,17,53,124,291,314,291,314,124,101,124,328,275,226,17,275,351,139,101,275,124,275,355,275,429,396,373,159,275,409,275,124,275,414,423,275,17],[2,3,34,55,59,75,89,94,96,108,109,143,191,206,248,250,258,279,343,354,363,413],[310,420,310,310,343,310,152,310,343,310,367,89,170,310,298,365,89,310,87,310,310,188],U⟩) m1 +def m12 : BTree Mask:=X (X (L ⟨[3,89,109,191,343,413],W,W,W,[109],W,W,W,W,[59,67,96,143,189,258,394,438],[343,109,343,89,191,89,413,3],U⟩) m1) (X (L ⟨[503],W,W,W,[239],W,W,W,W,[481],[503],U⟩) m1) +def m13 : BTree Mask:=X m7 (X (X (X m8 (X (L ⟨[234,452],W,W,W,[143],W,W,W,W,[230,463],[234,452],U⟩) m1)) m9) (X (X m10 m11) m12)) +def m14 : BTree Mask:=X (L ⟨[2,34,55,75,94,108,206,279,354,363],W,W,W,[74,134,3],W,W,W,W,[13,27,70,74,93,171,194,202,371,439],[363,34,75,354,108,279,55,206,2,94],U⟩) (L ⟨[540],[264],[3],[266],[3],W,W,[541],[540],W,W,U⟩) +def m15 : BTree Mask:=X (L ⟨[60,73,176,285,353,370],[72],[23,3],[96,43],[89,3],[57,200,381],[370,370,370],[8,9,27,70,93,155,171,194,202,208,236,269,271,292,338,340,350,406],[60,370,73,73,73,370,73,73,73,176,370,285,370,370,353,370,370,370],[10,15,45,47,50,52,85,90,110,130,131,184,186,201,247,260,263,272,274,295,303,317,332,334,341,361,398,427],[73,370,370,370,370,370,370,370,370,370,73,370,370,370,370,370,370,73,370,370,370,370,370,73,73,370,370,370],U⟩) m1 +def m16 : BTree Mask:=X (X m14 (X (L ⟨[33,39,139,364,373],W,[134],[135,3],[139],[13,74,371,439],[139,364,373,33],[302,372],[139,373],[28],[39],U⟩) m1)) (X m15 (X (L ⟨[227],[200],[3],[201],[3],W,W,[228],[227],W,W,U⟩) m1)) +def m17 : BTree Mask:=X (L ⟨[40,66,100,111,116,167,214,256,283,286,296,315,346,347,386,396,414,436],[40],[9,72,3],[49,68,29,101],[3],[60,73,98,104,121,176,218,262,285,353,370,390,415],[40,396,66,100,111,286,214,116,283,347,167,386,346],[10,52,85,119,154,170,188,272,334,341,362,367,420],[256,315,315,111,436,167,296,256,256,256,315,396,414],W,W,U⟩) m1 +def m18 : BTree Mask:=X (L ⟨[10,16,30,32,53,57,71,125,153,159,164,165,169,174,193,200,203,238,245,255,272,277,310,336,341,381,388,408,422],W,W,[171],W,[9,10,16,27,30,32,53,70,71,93,115,155,159,164,165,169,171,193,194,202,203,236,240,255,271,272,277,292,310,340,341,350,406,408],[10,165,165,30,165,165,165,71,165,277,238,169,165,165,200,165,193,165,164,203,165,255,245,165,272,165,165,16,165,341,165,32,408,165],[5,10,16,29,30,32,53,57,71,89,106,126,147,159,164,169,175,193,200,203,220,255,259,272,277,289,310,314,327,330,341,343,355,358,381,392,399,405,408,409,423],[153,57,57,165,381,57,200,159,381,238,153,153,153,57,381,57,153,381,53,381,153,57,153,57,381,153,200,238,165,153,57,245,153,153,159,153,153,153,57,153,153],[2,21,24,34,40,55,56,66,75,91,94,97,100,108,111,112,116,119,167,170,172,177,188,206,213,214,243,252,279,280,283,286,290,296,300,304,316,320,344,346,347,354,363,366,367,382,385,386,396,414,420,421,436],[310,165,165,310,165,310,165,165,310,165,310,165,165,310,165,165,165,125,165,174,165,165,336,310,165,165,165,165,310,165,165,165,165,165,165,165,165,165,165,165,165,310,310,165,388,165,165,165,165,165,422,165,165],U⟩) m1 +def m19 : BTree Mask:=X (L ⟨[152,275,291],[104],[3],[61],[163],W,W,[78,167,226,244,286,296,328,331,351,383,396,414,429],[275,275,291,291,275,275,275,275,275,275,275,275,275],[89],[152],U⟩) m1 +def m20 : BTree Mask:=X (L ⟨[17,33,87,124,139,152,175,275,291,324,330,335,355,364,373,409,423],[24,104],[3],[61,7,123,3],[80],[13,74,312,313,371,439],[139,364,335,330,175,33],[6,23,42,62,78,99,127,145,162,167,174,197,205,226,244,251,266,286,293,296,302,328,329,331,336,351,372,383,388,396,401,414,422,429,435],[124,17,17,17,275,124,324,124,124,275,175,17,124,291,291,124,124,275,17,275,139,275,124,275,355,275,373,275,409,275,124,275,423,275,17],[89,343],[152,87],U⟩) (L ⟨[8,9,10,13,16,26,27,30,32,40,53,66,67,69,70,71,73,93,100,105,111,116,117,118,122,123,140,149,155,159,164,167,169,171,176,189,193,194,199,202,203,208,214,219,236,239,241,255,256,269,271,272,277,283,286,288,292,296,301,310,313,315,337,338,340,341,346,347,350,356,370,371,386,391,394,396,406,408,411,414,428,433,436,438],W,W,[282],W,[9,27,57,60,70,73,87,93,98,104,119,121,125,152,153,155,170,171,174,176,188,194,200,202,218,236,238,245,262,271,275,285,291,292,336,340,350,353,367,370,381,388,390,406,415,420,422],[10,30,370,40,71,396,149,277,66,100,69,111,123,199,123,169,208,193,123,286,208,164,370,203,214,255,123,123,116,272,199,283,199,16,123,341,32,347,208,167,370,123,386,408,346,208,123],[8,9,10,13,26,27,52,57,67,69,70,73,85,93,105,117,118,119,122,123,140,149,154,155,170,171,176,188,189,194,199,200,202,208,219,236,239,241,269,271,272,288,292,301,313,334,337,338,340,341,350,356,362,367,370,371,381,391,394,406,411,420,428,433,438],[301,370,256,123,337,73,315,159,149,123,73,208,315,73,123,123,337,111,123,69,338,337,436,370,167,73,208,296,199,73,337,53,73,176,123,370,123,269,301,370,256,123,370,8,123,256,118,301,370,256,370,123,315,396,208,123,159,123,433,370,123,414,123,337,26],[2,8,10,12,15,16,22,26,30,32,33,34,35,43,45,47,50,52,53,54,55,60,69,71,73,75,76,85,86,88,90,94,95,98,104,108,110,113,115,118,121,130,131,139,142,149,151,156,163,164,169,175,176,184,186,187,193,199,201,203,206,207,209,211,212,218,232,233,240,242,247,253,255,260,262,263,269,272,273,274,277,278,279,281,285,295,297,299,303,308,309,317,323,324,330,332,334,335,338,341,342,345,348,353,354,355,361,363,364,370,373,390,393,398,404,408,409,412,415,423,427,433,437],[310,9,73,149,370,199,123,27,149,199,123,310,123,67,370,370,370,370,199,199,310,239,70,149,13,310,123,370,236,199,370,310,123,117,105,310,370,199,140,93,122,370,73,123,155,171,199,123,123,149,199,123,313,370,370,189,149,202,370,149,310,123,123,350,123,219,123,149,241,123,370,123,199,370,411,370,271,73,149,370,149,292,310,123,288,370,123,123,370,123,123,370,394,123,123,370,73,123,340,73,149,123,199,356,310,123,370,310,123,371,123,391,199,370,406,199,123,123,428,123,370,194,438],U⟩) +def m21 : BTree Mask:=X (X (L ⟨[3,109,191,413],W,W,W,[85],W,W,W,W,[67,189,394,438],[109,191,413,3],U⟩) m1) (X (L ⟨[507],[216],[3],[217],[3],W,W,[508],[507],W,W,U⟩) m1) +def m22 : BTree Mask:=X (X (L ⟨[58,68,92,101],[56],[137],[66,3],[3],[48,83,180],[58,92,68],[41,195,264,319],[68,68,101,101],W,W,U⟩) m1) (X (L ⟨[257,494],W,[73],[140],W,[374,498],[257,494],[359],[257],W,W,U⟩) m1) +def m23 : BTree Mask:=X (L ⟨[10,52,85,119,154,170,188,235,272,334,341,362,367,420],[120],W,[40],[149],[9,51,84,237,271,340],[10,52,85,334,272,341],[40,66,100,111,116,167,214,256,283,286,296,315,346,347,386,396,414,436],[154,154,154,154,154,154,154,362,154,154,154,362,154,154,154,154,154,154],[3,109,191,268,402,413],[420,367,170,235,119,188],U⟩) m1 +def m24 : BTree Mask:=X (X (X m20 (X (L ⟨[179],[152],[3],[179],[3],W,W,[36],[179],W,W,U⟩) m1)) m21) (X m22 (X m23 (X (L ⟨[535],[248],[3],[150],[3],W,W,[549],[535],W,W,U⟩) m1))) +def m25 : BTree Mask:=X (X (L ⟨[292,529],W,W,W,[190],W,W,W,W,[278,531],[292,529],U⟩) (L ⟨[546],[260],[3],[269],[3],W,W,[547],[546],W,W,U⟩)) (X (L ⟨[18,138],W,W,W,[10],W,W,W,W,[123,337],[138,18],U⟩) m1) +def m26 : BTree Mask:=X (X (L ⟨[170,188,367,420],[68],W,W,[88],W,W,W,W,[3,109,191,413],[420,367,170,188],U⟩) m1) (X (L ⟨[134],W,W,W,[195],W,W,W,W,[136],[134],U⟩) m1) +def m27 : BTree Mask:=X (L ⟨[6,58,68,92,101,266,270,329],[36,56],[42,126,146],[66,3],[3],[8,48,83,180,208,269,338],[6,58,92,68,270,266,329],[41,195,264,319],[68,68,101,101],W,W,U⟩) m1 +def m28 : BTree Mask:=X (L ⟨[29,57,67,73,123,140,176,189,200,241,301,327,337,370,381,394,438],[164],[63,168],[116],[169],[10,16,30,32,53,57,71,125,153,159,164,165,169,174,193,200,203,238,245,255,272,277,310,336,341,381,388,408,422],[327,327,327,327,327,370,327,123,123,327,327,200,327,123,327,370,327,123,123,327,327,327,327,123,327,370,123,327,123],[8,9,10,13,16,26,27,29,30,32,53,69,70,71,93,105,117,118,122,149,155,159,164,169,171,193,194,199,202,203,208,219,236,239,255,269,271,272,277,288,292,310,313,327,338,340,341,350,356,371,391,406,408,411,428,433],[301,370,57,123,57,337,73,29,381,57,200,123,73,381,73,123,123,337,123,337,370,57,381,57,73,381,73,337,73,381,176,123,370,123,57,301,370,57,381,123,370,200,123,327,301,370,57,370,123,123,123,370,57,123,123,337],[10,15,21,22,24,33,35,40,43,45,47,50,52,56,66,76,85,90,91,95,97,100,110,111,112,115,116,130,131,135,139,156,163,167,172,175,177,184,186,187,190,201,207,209,212,213,214,224,232,240,242,243,247,252,253,260,263,272,274,280,281,283,286,290,295,296,297,299,300,303,304,308,309,316,317,320,323,324,330,332,334,335,341,344,345,346,347,355,361,364,366,373,382,385,386,396,398,409,412,414,421,423,427,436,437],[73,370,327,123,327,123,123,327,67,370,370,370,370,327,327,123,370,370,327,123,327,327,370,327,327,140,327,370,73,29,123,123,123,327,327,123,327,370,370,189,29,370,123,123,123,327,327,29,123,241,123,327,370,327,123,370,370,73,370,327,123,327,327,327,370,327,123,123,327,370,327,123,123,327,370,327,394,123,123,370,73,123,73,327,123,327,327,123,370,123,327,123,327,327,327,327,370,123,123,327,327,123,370,327,438],U⟩) m1 +def m29 : BTree Mask:=X (L ⟨[10,52,85,115,119,154,170,188,240,272,334,341,362,367,420],W,W,[98],W,[5,6,9,51,58,68,78,84,89,92,101,106,126,147,167,175,220,226,237,244,259,266,270,271,286,289,296,314,328,329,330,331,340,343,351,355,358,383,392,396,399,405,409,414,423,429],[115,115,10,52,115,115,240,85,115,115,115,115,115,115,240,115,115,240,334,240,115,115,115,272,240,115,240,115,240,115,115,240,341,240,240,115,115,240,115,240,115,115,115,240,115,240],[40,66,100,111,115,116,167,214,240,256,283,286,296,315,346,347,386,396,414,436],[154,154,154,154,115,154,154,154,240,362,154,154,154,362,154,154,154,154,154,154],[3,4,6,7,11,14,19,20,21,23,25,31,42,44,61,62,63,64,65,72,77,81,82,97,99,103,107,109,114,120,128,129,144,145,148,150,158,160,161,166,172,173,181,182,183,185,191,192,196,197,198,204,205,210,215,216,217,221,225,231,246,251,254,261,265,266,267,276,280,282,284,293,294,304,307,311,316,318,325,329,333,339,344,352,360,368,369,379,380,387,389,395,401,402,403,410,413,417,418,419,421,425,426,432,435],[420,115,115,115,240,115,115,115,240,240,115,240,240,115,115,240,115,115,240,240,240,115,240,240,115,240,115,367,115,240,115,115,115,115,115,240,115,240,115,115,240,115,115,115,240,115,170,240,240,240,115,240,115,115,240,240,240,115,115,115,240,115,240,115,115,115,115,240,240,115,240,240,115,240,115,240,240,115,115,115,115,115,240,240,115,115,115,240,240,240,240,115,115,119,115,240,188,115,115,115,240,115,115,115,240],U⟩) m1 +def m30 : BTree Mask:=X (L ⟨[165],[20],[21,63],[19,3,71],[17,48],[10,16,30,32,53,71,159,164,169,193,203,255,272,277,310,341,408],[165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165],[29,327],[165,165],[21,24,40,56,66,91,97,100,111,112,116,167,172,177,213,214,243,252,280,283,286,290,296,300,304,316,320,344,346,347,366,382,385,386,396,414,421,436],[165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165],U⟩) (L ⟨[57,78,167,200,226,244,286,296,328,331,351,381,383,396,414,429],W,W,[279],W,[73,140,165,176,241,301,370,397,430],[351,226,200,286,244,383,167,78,331],[10,16,30,32,53,71,87,152,159,164,169,170,188,193,203,255,272,275,277,291,298,310,341,365,367,408,420],[57,57,381,57,200,381,244,226,57,381,57,167,296,381,381,57,57,328,381,226,351,200,57,429,396,57,414],W,W,U⟩) +def m31 : BTree Mask:=X (L ⟨[3,89,109,191,248,250,343,413],[80,163],W,W,[161],W,W,W,W,[59,67,96,140,143,189,241,258,394,438],[343,109,343,250,89,191,248,89,413,3],U⟩) m1 +def m32 : BTree Mask:=X (X (L ⟨[140,241],W,W,W,[15,3],W,W,W,W,[115,240],[140,241],U⟩) m1) (X (L ⟨[497],[212],[3],[213],[3],W,W,[501],[497],W,W,U⟩) m1) +def m33 : BTree Mask:=X (L ⟨[67,123,189,337,394,438],[52,10],[54,3,77],[53,33,3],[6,14,45,81],[125,153,174,238,245,336,388,422],[123,123,123,123,123,123,123,123],[13,26,69,105,117,118,122,149,199,219,239,288,313,356,371,391,411,428,433],[123,337,123,123,123,337,123,337,337,123,123,123,123,123,123,123,123,123,337],[22,33,35,43,76,95,139,156,163,175,187,207,209,212,232,242,253,281,297,299,308,309,323,324,330,335,345,355,364,373,409,412,423,437],[123,123,123,67,123,123,123,123,123,123,189,123,123,123,123,123,123,123,123,123,123,123,394,123,123,123,123,123,123,123,123,123,123,438],U⟩) m1 +def m34 : BTree Mask:=X (L ⟨[8,9,10,13,16,26,27,29,30,32,53,69,70,71,93,105,117,118,122,149,155,159,164,169,171,193,194,199,202,203,208,219,236,239,255,269,271,272,277,288,292,310,313,327,338,340,341,350,356,371,391,406,408,411,428,433],[116],[21,272],[19,164],[17,274],[9,10,16,27,30,32,53,70,71,87,93,119,152,155,159,164,169,170,171,188,193,194,202,203,236,255,271,272,275,277,291,292,310,340,341,350,367,406,408,420],[10,327,327,30,327,327,327,71,327,149,277,69,199,169,327,327,327,208,193,208,327,164,203,327,255,327,272,327,199,327,199,16,327,341,327,32,208,408,327,208],[29,57,67,73,123,140,176,189,200,241,301,327,337,370,381,394,438],[29,159,149,208,69,338,208,199,53,269,8,327,118,208,159,433,26],[2,8,10,12,16,21,24,26,30,32,34,40,53,54,55,56,60,66,69,71,73,75,86,88,91,94,97,98,100,104,108,111,112,113,116,118,121,135,142,149,151,164,167,169,172,176,177,190,193,199,203,206,211,213,214,218,224,233,243,252,255,262,269,272,273,277,278,279,280,283,285,286,290,296,300,304,316,320,338,341,342,344,346,347,348,353,354,363,366,370,382,385,386,390,393,396,404,408,414,415,421,433,436],[310,9,199,149,199,327,327,27,149,199,310,327,199,199,310,327,239,327,70,149,13,310,236,199,327,310,327,117,327,105,310,327,327,199,327,93,122,29,155,171,199,149,327,199,327,313,327,29,149,202,149,310,350,327,327,219,29,149,327,327,199,411,271,199,149,149,292,310,327,327,288,327,327,327,327,327,327,327,340,199,149,327,327,327,199,356,310,310,327,371,327,327,327,391,199,327,406,199,327,428,327,194,327],U⟩) m1 +def m35 : BTree Mask:=X (X m33 (X (L ⟨[37],[180],[181],[180],[182,183],[132],[37],[37],[37],[137,141],[37,37],U⟩) m1)) (X m34 (X (L ⟨[537],[244],[3],[3],[245],W,W,W,W,[534],[537],U⟩) m1)) +def m36 : BTree Mask:=X (X (X m25 m26) (X (X m27 m28) (X m29 (X (L ⟨[482],[228],[3],[229],[3],W,W,[483],[482],W,W,U⟩) m1)))) (X (X (X m30 m31) m32) m35) +def m37 : BTree Mask:=X (L ⟨[43,165,187,323,437],[12,45,81,20],[3,36,35,80,90,56],[3,15],[22,47],[5,6,10,16,30,32,53,58,68,71,78,89,92,101,106,126,147,159,164,167,169,175,193,203,220,226,244,255,259,266,270,272,277,286,289,296,310,314,328,329,330,331,341,343,351,355,358,383,392,396,399,405,408,409,414,423,429],[437,187,165,165,165,165,165,187,187,165,43,437,187,187,437,437,437,165,165,43,165,437,165,165,437,43,43,165,437,187,187,165,165,43,437,43,165,437,43,187,437,43,165,323,43,437,437,43,437,43,437,437,165,437,43,437,43],[29,115,240,327],[165,437,323,165],[4,6,7,11,14,19,20,21,23,24,25,31,40,42,44,56,61,62,63,64,65,66,72,77,81,82,91,97,99,100,103,107,111,112,114,116,120,128,129,144,145,148,150,158,160,161,166,167,172,173,177,181,182,183,185,192,196,197,198,204,205,210,213,214,215,216,217,221,225,231,243,246,251,252,254,261,265,266,267,276,280,282,283,284,286,290,293,294,296,300,304,307,311,316,318,320,325,329,333,339,344,346,347,352,360,366,368,369,379,380,382,385,386,387,389,395,396,401,403,410,414,417,418,419,421,425,426,432,435,436],[187,437,187,43,187,187,187,43,323,165,187,43,165,323,437,165,187,323,437,187,43,165,43,43,437,43,165,43,437,165,43,187,165,165,187,165,43,187,187,437,437,187,43,187,43,187,187,165,43,187,165,187,187,43,187,323,43,323,187,43,437,437,165,165,43,43,43,187,187,437,165,43,437,165,43,187,187,437,187,43,43,187,165,43,165,165,323,187,165,165,43,437,43,43,437,165,437,437,187,437,43,165,165,43,187,165,437,187,43,43,165,165,165,43,43,187,165,437,187,43,165,187,437,187,43,187,187,187,323,165],U⟩) (L ⟨[522],[268],[3],[249],[3],W,W,[543],[522],W,W,U⟩) +def m38 : BTree Mask:=X (L ⟨[78,167,226,244,286,296,302,328,331,351,372,383,396,414,429],W,[110],[26],[67,3],[73,140,176,241,301,370,397,430],[351,226,286,244,383,167,78,331],[87,152,170,188,275,291,298,365,367,420],[244,226,167,296,328,226,351,429,396,414],[298,365],[302,372],U⟩) m1 +def m39 : BTree Mask:=X (X m37 (X (L ⟨[359],[140],W,W,[141],W,W,W,W,[38],[359],U⟩) m1)) (X m38 (X (L ⟨[375],W,W,[205],W,W,W,[376],[375],W,W,U⟩) m1)) +def m40 : BTree Mask:=X (L ⟨[6,10,23,40,42,52,62,66,85,99,100,111,115,116,119,127,145,154,162,167,170,174,188,197,205,214,235,240,251,256,266,272,283,286,293,296,302,315,329,334,336,341,346,347,362,367,372,386,388,396,401,414,420,422,435,436],W,W,[175],W,[5,6,8,9,26,51,58,60,68,69,73,78,84,86,89,92,98,101,104,106,118,121,126,142,147,149,167,175,176,199,211,218,220,226,237,244,259,262,266,269,270,271,278,285,286,289,296,314,328,329,330,331,338,340,343,351,353,355,358,370,383,390,392,396,399,404,405,409,414,415,423,429,433],[115,115,6,10,23,52,115,40,115,62,396,240,85,205,115,115,66,115,100,115,42,111,115,99,115,293,240,115,286,197,145,214,115,240,334,240,115,116,115,266,115,272,251,283,240,115,240,115,240,115,115,240,329,341,240,240,347,115,115,167,240,386,115,240,115,401,115,115,240,346,115,240,435],[10,17,33,40,52,66,85,100,111,115,116,119,124,139,154,167,170,175,188,214,240,256,272,283,286,296,315,324,330,334,335,341,346,347,355,362,364,367,373,386,396,409,414,420,423,436],[256,162,127,154,315,154,315,154,154,115,154,111,162,127,436,154,167,127,296,154,240,362,256,154,154,154,362,127,127,256,127,256,154,154,127,315,127,396,127,154,154,127,154,414,127,154],[3,4,6,7,11,14,19,20,21,23,25,31,42,44,61,62,63,64,65,72,77,81,82,97,99,103,107,109,114,120,128,129,144,145,148,150,158,160,161,166,170,172,173,181,182,183,185,188,191,192,196,197,198,204,205,210,215,216,217,221,225,231,246,251,254,261,265,266,267,268,276,280,282,284,293,294,298,304,307,311,316,318,325,329,333,339,344,352,360,365,367,368,369,379,380,387,389,395,401,402,403,410,413,417,418,419,420,421,425,426,432,435],[420,115,115,115,240,115,115,115,240,240,115,240,240,115,115,240,115,115,240,240,240,115,240,240,115,240,115,367,115,240,115,115,115,115,115,240,115,240,115,115,174,240,115,115,115,240,115,336,170,240,240,240,115,240,115,115,240,240,240,115,115,115,240,115,240,115,115,115,115,235,240,240,115,240,240,115,302,240,115,240,240,115,115,115,115,115,240,240,115,372,388,115,115,240,240,240,240,115,115,119,115,240,188,115,115,115,422,240,115,115,115,240],U⟩) m1 +def m41 : BTree Mask:=X (X (L ⟨[67,140,189,241,394,438],W,W,W,[15,45,145],W,W,W,W,[43,115,187,240,323,437],[67,140,189,241,394,438],U⟩) m1) (X (L ⟨[495],[236],[3],[212],[3],W,W,[497],[495],W,W,U⟩) m1) +def m42 : BTree Mask:=X m39 (X (X (X (L ⟨[9,51,84,237,271,340],W,W,W,[42],W,W,W,W,[8,48,83,208,269,338],[9,51,84,237,271,340],U⟩) m1) m40) m41) +def m43 : BTree Mask:=X (L ⟨[4,6,7,11,14,19,20,21,23,25,31,42,44,61,62,63,64,65,72,77,81,82,87,97,99,103,107,114,120,128,129,144,145,148,150,152,158,160,161,166,172,173,181,182,183,185,192,196,197,198,204,205,210,215,216,217,221,225,231,246,251,254,261,265,266,267,275,276,280,282,284,291,293,294,304,307,311,316,318,325,329,333,339,344,352,360,368,369,379,380,387,389,395,401,403,410,417,418,419,421,425,426,432,435],[28,104],[3],[61,21,3],[80],[8,26,43,69,86,118,142,149,165,187,199,211,269,278,323,338,404,433,437],[6,23,182,62,205,42,99,293,380,185,197,145,266,251,173,329,401,435,432],[5,10,16,17,30,32,33,53,71,78,89,106,124,126,139,147,159,164,167,169,175,193,203,220,226,244,255,259,272,277,286,289,296,310,314,324,328,330,331,335,341,343,351,355,358,364,373,383,392,396,399,405,408,409,414,423,429],[19,21,65,144,31,196,63,77,72,275,185,107,231,129,339,166,160,11,275,183,181,217,204,221,291,291,276,282,280,246,275,294,275,380,4,325,275,369,275,368,344,182,275,261,360,307,418,275,395,275,419,114,410,14,275,426,275],[6,23,40,42,58,62,66,68,89,92,99,100,101,111,116,125,127,145,162,167,197,205,214,251,256,266,270,283,286,293,296,315,329,343,346,347,386,396,401,414,435,436],[7,25,216,61,44,64,82,210,152,81,128,103,318,120,150,148,417,161,158,172,198,225,215,265,254,267,192,284,304,425,316,311,333,87,389,352,387,97,403,421,20,379],U⟩) (L ⟨[8,10,12,16,26,30,32,53,54,69,71,86,88,113,118,142,149,151,164,165,169,193,199,203,211,233,255,269,272,273,277,278,338,341,342,348,393,404,408,433],[284],[272],[164],[286],[9,10,16,27,30,32,53,70,71,87,93,119,152,155,159,164,169,170,171,188,193,194,202,203,236,255,271,272,275,277,291,292,310,340,341,350,367,406,408,420],[10,165,165,30,165,165,165,71,165,149,277,69,199,169,165,165,165,278,193,86,165,164,203,165,255,165,272,165,199,165,199,16,165,341,165,32,142,408,165,211],[29,57,67,73,123,140,176,189,200,241,301,327,337,370,381,394,438],[165,113,149,142,69,338,404,199,53,269,8,165,118,278,393,433,26],[10,12,16,21,24,30,32,40,52,53,54,56,66,71,85,88,91,97,100,111,112,113,116,151,154,164,167,169,172,177,193,203,213,214,233,243,252,255,272,273,277,280,283,286,290,296,300,304,316,320,334,341,342,344,346,347,348,362,366,382,385,386,393,396,408,414,421,436],[12,149,199,165,165,149,199,165,54,199,199,165,165,149,88,199,165,165,165,165,165,199,165,199,151,149,165,199,165,165,149,149,165,165,149,165,165,199,199,149,149,165,165,165,165,165,165,165,165,165,233,199,149,165,165,165,199,348,165,165,165,165,199,165,199,165,165,165],U⟩) +def m44 : BTree Mask:=X (L ⟨[3,89,109,191,248,250,268,343,413],W,W,W,[153],W,W,W,W,[59,67,96,140,143,168,189,241,258,394,438],[343,109,343,250,89,268,191,248,89,413,3],U⟩) m1 +def m45 : BTree Mask:=X (L ⟨[41,87,125,152,153,170,174,188,195,238,245,264,275,291,298,319,336,365,367,388,420,422],W,W,[90],W,[115,240],[238,245],[5,6,58,68,78,89,92,101,106,126,147,167,175,220,226,244,259,266,270,286,289,296,314,328,329,330,331,343,351,355,358,383,392,396,399,405,409,414,423,429],[153,264,319,41,275,238,319,319,153,153,153,275,153,153,291,291,153,264,264,275,153,275,238,275,264,153,275,245,275,153,153,275,153,275,153,153,153,275,153,275],[3,89,109,119,170,188,191,248,250,310,343,367,413,420],[420,152,367,125,174,336,170,298,365,195,87,388,188,422],U⟩) m1 +def m46 : BTree Mask:=X (L ⟨[5,10,52,85,89,106,115,119,126,147,154,170,175,188,220,240,259,272,289,314,330,334,341,343,355,358,362,367,392,399,405,409,420,423],W,W,[186],W,[5,6,9,13,51,58,68,78,84,89,92,101,105,106,117,122,126,147,167,175,219,220,226,237,239,244,259,266,270,271,286,288,289,296,313,314,328,329,330,331,340,343,351,355,356,358,371,383,391,392,396,399,405,409,411,414,423,428,429],[115,115,10,409,52,115,115,240,85,115,115,115,106,115,405,126,115,115,240,115,220,115,240,334,259,240,115,115,115,272,240,289,115,240,330,115,240,115,115,240,341,240,240,115,358,115,175,240,392,115,240,115,115,115,147,240,115,5,240],[40,66,100,111,115,116,125,153,167,174,214,238,240,245,256,283,286,296,315,336,346,347,386,388,396,414,422,436],[154,154,154,154,115,154,126,399,154,175,154,314,240,314,362,154,154,154,362,355,154,154,154,409,154,154,423,154],[3,4,6,7,11,14,19,20,21,23,25,31,42,44,59,61,62,63,64,65,72,77,81,82,96,97,99,103,107,109,114,120,128,129,143,144,145,148,150,158,160,161,166,172,173,181,182,183,185,191,192,196,197,198,204,205,210,215,216,217,221,225,231,246,251,254,258,261,265,266,267,276,280,282,284,293,294,304,307,311,316,318,325,329,333,339,344,352,360,368,369,379,380,387,389,395,401,402,403,410,413,417,418,419,421,425,426,432,435],[420,115,115,115,240,115,115,115,240,240,115,240,240,115,343,115,240,115,115,240,240,240,115,240,343,240,115,240,115,367,115,240,115,115,89,115,115,115,240,115,240,115,115,240,115,115,115,240,115,170,240,240,240,115,240,115,115,240,240,240,115,115,115,240,115,240,89,115,115,115,115,240,240,115,240,240,115,240,115,240,240,115,115,115,115,115,240,240,115,115,115,240,240,240,240,115,115,119,115,240,188,115,115,115,240,115,115,115,240],U⟩) m1 +def m47 : BTree Mask:=X (L ⟨[6,10,16,30,32,53,58,68,71,92,101,159,164,169,193,203,255,266,270,272,277,310,329,341,408],W,W,[122],W,[8,9,27,48,70,83,93,155,171,180,194,202,208,236,269,271,292,338,340,350,406],[6,10,30,58,71,92,277,169,193,68,164,203,270,255,266,272,16,329,341,32,408],[41,57,195,200,264,319,381],[68,159,68,53,101,101,159],[2,34,55,75,94,108,206,279,354,363],[310,310,310,310,310,310,310,310,310,310],U⟩) m1 +def m48 : BTree Mask:=X (X (X (L ⟨[27,70,93,171,194,202],W,W,W,[33],W,W,W,W,[26,69,118,149,199,433],[27,70,93,171,202,194],U⟩) m1) m46) (X m47 (X (L ⟨[555],[252],[3],[255],[3],W,W,[517],[555],W,W,U⟩) m1)) +def m49 : BTree Mask:=X (X m13 (X (X m16 (X (X m17 m18) (X m19 (X (L ⟨[490],[232],[3],[233],[3],W,W,[491],[490],W,W,U⟩) m1)))) m24)) (X m36 (X m42 (X (X (X m43 m44) (X m45 (X (L ⟨[496],[220],[3],[221],[3],W,W,[510],[496],W,W,U⟩) m1))) m48))) +def m50 : BTree Mask:=X (L ⟨[80,478,516],[2],[3],[4],[3,5],W,W,[292,529],[80,516],[384,485],[80,478],U⟩) (L ⟨[523],[258],[3],[259],[3],W,W,[524],[523],W,W,U⟩) +def m51 : BTree Mask:=X (L ⟨[10,17,33,52,85,119,124,139,154,170,175,188,272,324,330,334,335,341,355,362,364,367,373,409,420,423],W,W,[128],W,[9,13,51,74,84,237,271,312,313,340,371,439],[10,139,52,364,85,334,272,335,330,341,175,33],[6,23,40,42,62,66,99,100,111,116,127,145,162,167,174,197,205,214,251,256,266,283,286,293,296,302,315,329,336,346,347,372,386,388,396,401,414,422,435,436],[124,17,154,17,17,154,124,154,154,154,324,124,124,154,175,17,124,154,124,362,124,154,154,17,154,139,362,124,355,154,154,373,154,409,154,124,154,423,17,154],[3,109,191,402,413],[420,367,170,119,188],U⟩) m1 +def m52 : BTree Mask:=X (X (L ⟨[41,195,264,319],[66],[3],[36,3,56],[63],W,W,[6,58,68,92,101,266,270,329],[264,319,41,319,319,264,264,264],[310],[195],U⟩) m1) (X (L ⟨[486],[194],[3],[195],[3],W,W,[136],[486],W,W,U⟩) m1) +def m53 : BTree Mask:=X (L ⟨[17,33,124,139,175,324,330,335,355,364,373,409,423],[34],[18,134],[7,77,135],[3],[13,74,312,313,371,439],[139,364,335,330,175,33],[6,23,42,62,99,127,145,162,174,197,205,251,266,293,302,329,336,372,388,401,422,435],[124,17,17,17,124,324,124,124,175,17,124,124,124,17,139,124,355,373,409,124,423,17],W,W,U⟩) (L ⟨[10,16,30,32,40,52,53,66,71,85,100,111,116,119,154,159,164,167,169,170,188,193,203,214,255,256,272,277,283,286,296,310,315,334,341,346,347,362,367,386,396,408,414,420,436],W,W,[288],W,[9,27,51,60,70,73,84,93,98,104,121,155,171,176,194,202,218,236,237,262,271,285,292,340,350,353,370,390,406,415],[10,30,52,40,71,396,85,277,66,100,111,169,193,286,164,203,214,255,334,116,272,283,16,341,32,347,167,386,408,346],[10,40,52,57,66,85,100,111,116,119,154,167,170,188,200,214,256,272,283,286,296,315,334,341,346,347,362,367,381,386,396,414,420,436],[256,154,315,159,154,315,154,154,154,111,436,154,167,296,53,154,362,256,154,154,154,362,256,256,154,154,315,396,159,154,154,154,414,154],[2,3,34,55,75,94,108,109,191,206,279,354,363,402,413],[310,420,310,310,310,310,310,367,170,310,310,310,310,119,188],U⟩) +def m54 : BTree Mask:=X (L ⟨[40,66,100,111,115,116,167,214,240,256,283,286,296,315,346,347,386,396,414,436],W,W,[100],W,[5,6,58,60,68,73,78,89,92,98,101,104,106,121,126,147,167,175,176,218,220,226,244,259,262,266,270,285,286,289,296,314,328,329,330,331,343,351,353,355,358,370,383,390,392,396,399,405,409,414,415,423,429],[115,115,115,40,115,396,240,115,115,66,115,100,115,111,115,115,240,115,286,214,115,240,240,115,116,115,115,283,240,115,240,115,240,115,115,240,240,240,347,115,115,167,240,386,115,240,115,115,115,240,346,115,240],[10,52,85,115,119,154,170,188,240,272,334,341,362,367,420],[256,315,315,115,111,436,167,296,240,256,256,256,315,396,414],[4,6,7,11,14,19,20,21,23,25,31,42,44,61,62,63,64,65,72,77,81,82,97,99,103,107,114,120,128,129,144,145,148,150,158,160,161,166,172,173,181,182,183,185,192,196,197,198,204,205,210,215,216,217,221,225,231,246,251,254,261,265,266,267,276,280,282,284,293,294,304,307,311,316,318,325,329,333,339,344,352,360,368,369,379,380,387,389,395,401,403,410,417,418,419,421,425,426,432,435],[115,115,115,240,115,115,115,240,240,115,240,240,115,115,240,115,115,240,240,240,115,240,240,115,240,115,115,240,115,115,115,115,115,240,115,240,115,115,240,115,115,115,240,115,240,240,240,115,240,115,115,240,240,240,115,115,115,240,115,240,115,115,115,115,240,240,115,240,240,115,240,115,240,240,115,115,115,115,115,240,240,115,115,115,240,240,240,240,115,115,115,240,115,115,115,240,115,115,115,240],U⟩) m1 +def m55 : BTree Mask:=X (X m53 (X (L ⟨[473],[162],W,W,[3],W,W,[474],[473],W,W,U⟩) m1)) (X m54 (X (L ⟨[479],[226],[3],[227],[3],W,W,[480],[479],W,W,U⟩) m1)) +def m56 : BTree Mask:=X (L ⟨[13,74,312,313,371,439],W,W,W,[11,31],W,W,W,W,[73,176,301,370,397,430],[13,313,312,371,439,74],U⟩) (L ⟨[2,8,10,12,16,21,24,26,30,32,34,40,53,54,55,56,60,66,69,71,73,75,86,88,91,94,97,98,100,104,108,111,112,113,116,118,121,135,142,149,151,164,167,169,172,176,177,190,193,199,203,206,211,213,214,218,224,233,243,252,255,262,269,272,273,277,278,279,280,283,285,286,290,296,300,304,316,320,338,341,342,344,346,347,348,353,354,363,366,370,382,385,386,390,393,396,404,408,414,415,421,433,436],W,W,[277],[273],[9,27,57,60,70,73,87,93,98,104,119,121,125,152,153,155,170,171,174,176,188,194,200,202,218,236,238,245,262,271,275,285,291,292,336,340,350,353,367,370,381,388,390,406,415,420,422],[10,30,370,40,71,396,149,277,66,100,69,111,121,199,121,169,278,193,121,286,86,164,370,203,214,255,121,121,116,272,199,283,199,16,121,341,32,347,142,167,370,121,386,408,346,211,121],[8,9,10,13,26,27,52,57,67,69,70,73,85,93,105,117,118,119,122,123,140,149,154,155,170,171,176,188,189,194,199,200,202,208,219,235,236,239,241,269,271,272,288,292,301,313,334,337,338,340,341,350,356,362,367,370,371,381,391,394,406,411,420,428,433,438],[60,370,21,121,98,73,56,113,149,104,73,142,91,73,121,121,390,111,121,69,338,415,436,370,167,73,404,296,199,73,218,53,73,176,121,224,370,121,269,285,370,280,121,370,8,121,252,118,353,370,344,370,121,385,396,278,121,393,121,433,370,121,414,121,262,26],[10,12,13,15,16,22,27,30,32,33,35,45,47,50,52,53,54,70,71,74,76,78,85,88,90,93,95,110,113,130,131,139,146,151,154,156,163,164,167,169,171,175,184,186,193,194,201,202,203,207,209,212,224,226,232,233,242,244,247,253,255,260,263,272,273,274,277,281,286,295,296,297,299,302,303,308,309,317,324,328,330,331,332,334,335,341,342,345,348,351,355,361,362,364,371,372,373,383,393,396,398,408,409,412,414,423,427,429,439],[12,149,363,370,199,121,34,149,199,121,121,370,370,370,54,199,199,75,149,354,121,382,88,199,370,108,121,370,199,370,73,121,135,199,151,121,121,149,172,199,279,121,370,370,149,55,370,206,149,121,121,121,190,213,121,149,121,243,370,121,199,370,370,73,149,370,149,121,304,370,316,121,121,112,370,121,121,370,121,320,121,177,370,73,121,73,149,121,199,300,121,370,348,121,2,24,121,290,199,97,370,199,121,121,421,121,370,366,94],U⟩) +def m57 : BTree Mask:=X (L ⟨[26,69,73,118,149,199,370,397,430,433],[82,11],[86,27,131,25],[85,107,10],[30],[41,57,87,119,152,195,200,264,275,291,319,381],[397,370,149,69,199,397,370,397,199,199,397,370],[9,27,48,67,70,83,93,123,155,171,180,189,194,202,236,271,292,337,340,350,394,406,438],[370,73,397,149,73,430,73,69,370,73,397,199,73,73,370,370,370,118,370,370,433,370,26],[5,10,12,15,16,30,32,45,46,47,49,50,52,53,54,71,85,88,90,102,106,110,113,126,130,131,147,151,157,164,169,175,178,184,186,193,201,203,220,223,233,247,249,255,259,260,263,272,273,274,277,287,289,295,303,317,321,326,330,332,334,341,342,348,349,355,357,358,361,392,393,398,399,405,407,408,409,423,424,427,431],[397,73,149,370,199,149,199,370,397,370,397,370,370,199,199,149,370,199,370,397,397,370,199,397,370,73,397,199,397,149,199,397,397,370,370,149,370,149,397,397,149,370,397,199,397,370,370,73,149,370,149,397,397,370,370,370,397,397,397,370,73,73,149,199,397,397,397,397,370,397,199,370,397,397,397,199,397,397,397,370,397],U⟩) m1 +def m58 : BTree Mask:=X (X m56 (X (L ⟨[180],W,W,W,[20],W,W,W,W,[165],[180],U⟩) m1)) (X m57 (X (L ⟨[505],[210],[3],[211],[3],W,W,[489],[505],W,W,U⟩) m1)) +def m59 : BTree Mask:=X (L ⟨[416],[50],[21,63],[71],[48],[10,16,30,32,53,71,159,164,169,193,203,255,272,277,310,341,408],[416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416],[327],[416],[21,40,56,66,91,97,100,111,116,167,172,177,213,214,243,252,280,283,286,290,296,300,304,316,320,344,346,347,366,382,385,386,396,414,421,436],[416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416],U⟩) m1 +def m60 : BTree Mask:=X (X (L ⟨[51,84],W,W,W,[113],W,W,W,W,[48,83],[51,84],U⟩) m1) (X (L ⟨[550],[242],[3],[243],[3],W,W,[551],[550],W,W,U⟩) m1) +def m61 : BTree Mask:=X (X (X (X m50 m51) m52) m55) (X m58 (X (X m59 (X (L ⟨[528],[178],[3],[244],[3],W,W,[537],[528],W,W,U⟩) m1)) m60)) +def m62 : BTree Mask:=X (L ⟨[123,337],[10],[3,54],[83,53,3],[6],[125,153,174,238,245,336,388,422],[123,123,123,123,123,123,123,123],[13,26,69,105,117,118,122,149,199,219,239,288,313,356,371,391,411,428,433],[123,337,123,123,123,337,123,337,337,123,123,123,123,123,123,123,123,123,337],[22,33,35,76,95,139,156,163,175,207,209,212,232,242,253,281,297,299,308,309,324,330,335,345,355,364,373,409,412,423],[123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123],U⟩) (L ⟨[541],[266],[3],[267],[3],W,W,[542],[541],W,W,U⟩) +def m63 : BTree Mask:=X (L ⟨[13,27,70,74,93,171,194,202,371,439],W,W,W,[11,82],W,W,W,W,[26,69,73,118,149,199,370,397,430,433],[27,70,13,93,171,202,371,439,74,194],U⟩) m1 +def m64 : BTree Mask:=X (X m62 (X (L ⟨[434],W,W,W,[50],W,W,W,W,[416],[434],U⟩) m1)) (X m63 (X (L ⟨[229],[202],[203],[202],[203,208],[305],[229],[229],[229],[305,306],[229,229],U⟩) m1)) +def m65 : BTree Mask:=X (L ⟨[8,48,83,208,269,338],[42],[67,86,106,59,68],[11,84,31,32],[30],[87,152,170,188,275,291,298,365,367,420],[269,338,208,208,338,338,83,83,208,208],[73,140,176,241,301,370,397,430],[83,338,208,269,8,83,48,83],[10,12,16,30,32,53,54,71,88,113,151,164,169,193,203,233,255,272,273,277,341,342,348,393,408],[338,269,338,269,338,338,338,269,338,338,338,269,338,269,269,269,338,338,269,269,338,269,338,338,338],U⟩) m1 +def m66 : BTree Mask:=X (L ⟨[5,6,10,16,17,30,32,33,53,58,68,71,78,87,89,92,101,106,124,126,139,147,152,159,164,167,169,170,175,188,193,203,220,226,235,244,255,259,266,270,272,275,277,286,289,291,296,298,310,314,324,328,329,330,331,335,341,343,351,355,358,364,365,367,373,383,392,396,399,405,408,409,414,420,423,429],W,W,[173],W,[8,9,13,27,48,70,73,74,83,93,105,117,122,140,155,171,176,180,194,202,208,219,236,239,241,269,271,288,292,301,312,313,338,340,350,356,370,371,391,397,406,411,428,430,439],[6,10,139,30,58,71,351,364,92,277,106,405,126,226,169,193,286,68,164,203,270,220,255,259,244,266,272,289,16,383,335,330,329,341,32,358,167,175,392,78,408,147,5,331,33],[6,23,41,42,57,62,78,87,99,125,127,145,152,153,162,167,170,174,188,195,197,200,205,226,238,244,245,251,264,266,275,286,291,293,296,298,302,319,328,329,331,336,351,365,367,372,381,383,388,396,401,414,420,422,429,435],[124,17,68,17,159,17,275,244,124,126,324,124,226,399,124,275,167,175,296,68,17,53,124,291,314,291,314,124,101,124,328,275,226,17,275,351,139,101,275,124,275,355,275,429,396,373,159,275,409,275,124,275,414,423,275,17],[2,3,34,55,59,75,89,94,96,108,109,143,191,206,248,250,258,268,279,343,354,363,413],[310,420,310,310,343,310,152,310,343,310,367,89,170,310,298,365,89,235,310,87,310,310,188],U⟩) m1 +def m67 : BTree Mask:=X (X (L ⟨[170,188,298,365,367,420],[106],W,W,[111],W,W,W,W,[3,109,191,248,250,413],[420,367,170,298,365,188],U⟩) m1) (X (L ⟨[492],[234],[3],[235],[3],W,W,[493],[492],W,W,U⟩) m1) +def m68 : BTree Mask:=X (L ⟨[87,152,170,188,275,291,298,365,367,420],[26,104],[3],[61,3],[80,148],W,W,[78,167,226,244,286,296,328,331,351,383,396,414,429],[275,275,291,291,275,275,275,275,275,275,275,275,275],[3,89,109,191,248,250,343,413],[420,152,367,170,298,365,87,188],U⟩) (L ⟨[8,9,10,13,26,27,52,57,67,69,70,73,85,93,105,117,118,119,122,123,140,149,154,155,170,171,176,188,189,194,199,200,202,208,219,236,239,241,269,271,272,288,292,301,313,334,337,338,340,341,350,356,362,367,370,371,381,391,394,406,411,420,428,433,438],W,W,[280],W,[9,51,57,84,87,119,125,152,153,165,170,174,188,200,237,238,245,271,275,291,336,340,367,381,388,420,422],[10,52,370,85,149,69,123,199,123,200,208,123,208,370,334,123,123,272,199,199,123,341,208,370,123,208,123],[8,9,10,13,16,26,27,30,32,40,53,66,67,69,70,71,73,93,100,105,111,116,117,118,122,123,140,149,155,159,164,167,169,171,176,189,193,194,199,202,203,208,214,219,236,239,241,255,256,269,271,272,277,283,286,288,292,296,301,310,313,315,337,338,340,341,346,347,350,356,370,371,386,391,394,396,406,408,411,414,428,433,436,438],[301,370,57,123,57,337,73,381,57,154,200,154,149,123,73,381,208,73,154,123,154,154,123,337,123,69,338,337,370,57,381,154,57,73,208,199,381,73,337,73,381,176,154,123,370,123,269,57,362,301,370,57,381,154,154,123,370,154,8,200,123,362,118,301,370,57,154,154,370,123,208,123,154,123,433,154,370,57,123,154,123,337,154,26],[3,8,10,12,15,16,22,26,30,32,33,35,43,45,47,50,52,53,54,60,69,71,73,76,85,86,88,90,95,98,104,109,110,113,115,118,121,130,131,139,142,149,151,156,163,164,169,175,176,184,186,187,191,193,199,201,203,207,209,211,212,218,232,233,240,242,247,253,255,260,262,263,269,272,273,274,277,278,281,285,295,297,299,303,308,309,317,323,324,330,332,334,335,338,341,342,345,348,353,355,361,364,370,373,390,393,398,402,404,408,409,412,413,415,423,427,433,437],[420,9,73,149,370,199,123,27,149,199,123,123,67,370,370,370,370,199,199,239,70,149,13,123,370,236,199,370,123,117,105,367,370,199,140,93,122,370,73,123,155,171,199,123,123,149,199,123,313,370,370,189,170,149,202,370,149,123,123,350,123,219,123,149,241,123,370,123,199,370,411,370,271,73,149,370,149,292,123,288,370,123,123,370,123,123,370,394,123,123,370,73,123,340,73,149,123,199,356,123,370,123,371,123,391,199,370,119,406,199,123,123,188,428,123,370,194,438],U⟩) +def m69 : BTree Mask:=X (L ⟨[5,6,58,68,78,89,92,101,106,126,147,167,175,220,226,244,259,266,270,286,289,296,314,328,329,330,331,343,351,355,358,383,392,396,399,405,409,414,423,429],W,W,[92],W,[8,13,48,73,83,105,117,122,140,176,180,208,219,239,241,269,288,301,313,338,356,370,371,391,397,411,428,430],[6,409,58,351,92,106,405,126,226,286,68,270,220,259,244,266,289,383,330,329,358,167,175,392,78,147,5,331],[41,87,125,152,153,170,174,188,195,238,245,264,275,291,298,319,336,365,367,388,420,422],[68,244,126,226,399,167,175,296,68,314,314,101,328,226,351,101,355,429,396,409,414,423],[59,96,143,258],[343,343,89,89],U⟩) m1 +def m70 : BTree Mask:=X (X m68 (X (L ⟨[67,168,180,189,394,438],W,W,W,[152],W,W,W,W,[43,165,179,187,323,437],[67,180,168,189,394,438],U⟩) m1)) (X m69 (X (L ⟨[509],[218],[3],[219],[3],W,W,[487],[509],W,W,U⟩) m1)) +def m71 : BTree Mask:=X (L ⟨[79],[58],[55],[81],[78],[5,89,106,126,147,175,220,259,289,314,330,355,358,392,399,405,409,423],[79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79],[187],[79],[6,14,44,63,81,99,144,145,181,205,210,231,251,261,266,307,318,325,329,339,368,369,401,418,426],[79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79],U⟩) m1 +def m72 : BTree Mask:=X (L ⟨[40,66,100,111,115,116,125,153,167,174,214,238,240,245,256,283,286,296,315,336,346,347,386,388,396,414,422,436],W,W,[188],W,[5,6,58,60,68,73,78,89,92,98,101,104,106,115,121,126,147,167,175,176,218,220,226,240,244,259,262,266,270,285,286,289,296,314,328,329,330,331,343,351,353,355,358,370,383,390,392,396,399,405,409,414,415,423,429],[115,115,115,40,115,396,240,115,115,66,115,100,115,238,111,115,115,240,115,286,214,115,240,245,240,115,116,115,115,283,240,115,240,115,240,115,115,240,240,240,347,115,115,167,240,386,115,240,115,115,115,240,346,115,240],[5,10,52,85,89,106,115,119,126,147,154,170,175,188,220,240,259,272,289,314,330,334,341,343,355,358,362,367,392,399,405,409,420,423],[153,256,315,315,238,153,115,111,153,153,436,167,153,296,153,240,153,256,153,238,153,256,256,245,153,153,315,396,153,153,153,153,414,153],[4,6,7,11,14,19,20,21,23,25,31,42,44,61,62,63,64,65,72,77,81,82,97,99,103,107,114,119,120,128,129,144,145,148,150,158,160,161,166,170,172,173,181,182,183,185,188,192,196,197,198,204,205,210,215,216,217,221,225,231,246,251,254,261,265,266,267,276,280,282,284,293,294,304,307,311,316,318,325,329,333,339,344,352,360,367,368,369,379,380,387,389,395,401,403,410,417,418,419,420,421,425,426,432,435],[115,115,115,240,115,115,115,240,240,115,240,240,115,115,240,115,115,240,240,240,115,240,240,115,240,115,115,125,240,115,115,115,115,115,240,115,240,115,115,174,240,115,115,115,240,115,336,240,240,240,115,240,115,115,240,240,240,115,115,115,240,115,240,115,115,115,115,240,240,115,240,240,115,240,115,240,240,115,115,115,115,115,240,240,115,388,115,115,240,240,240,240,115,115,115,240,115,115,115,422,240,115,115,115,240],U⟩) m1 +def m73 : BTree Mask:=X (L ⟨[41,57,195,200,264,319,381],W,[20],[124,63],[63],[165],[200],[6,10,16,30,32,53,58,68,71,92,101,159,164,169,193,203,255,266,270,272,277,310,329,341,408],[264,57,57,381,57,200,319,41,381,319,319,57,381,57,381,381,57,264,264,57,381,200,264,57,57],[310],[195],U⟩) m1 +def m74 : BTree Mask:=X (X m64 (X (X m65 m66) m67)) (X m70 (X (X m71 m72) (X m73 (X (L ⟨[544],[250],[3],[260],[3],W,W,[546],[544],W,W,U⟩) m1)))) +def m75 : BTree Mask:=X (L ⟨[22,33,35,76,95,139,156,163,175,207,209,212,232,242,253,281,297,299,308,309,324,330,335,345,355,364,373,409,412,423],W,[18,134],[7,77,3,135],[66],[13,74,312,313,371,439],[139,364,335,330,175,33],[6,23,42,62,99,127,145,162,174,197,205,251,266,293,302,329,336,372,388,401,422,435],[22,308,156,76,209,324,242,163,175,207,297,309,281,212,139,345,355,373,409,412,423,95],[41,195,264,319],[35,232,253,299],U⟩) (L ⟨[539],[262],[3],[264],[3],W,W,[540],[539],W,W,U⟩) +def m76 : BTree Mask:=X (L ⟨[9,27,48,70,83,93,155,171,180,194,202,236,271,292,340,350,406],[70],[67],[11],[79],[298,365],[83,83],[73,370,397,430],[83,83,48,83],[8,26,69,86,118,142,149,165,199,211,269,278,338,404,433],[9,27,70,236,93,155,171,180,202,350,271,292,340,406,194],U⟩) m1 +def m77 : BTree Mask:=X (X m75 (X (L ⟨[13,74,371,439],W,W,W,[11],W,W,W,W,[73,370,397,430],[13,371,439,74],U⟩) m1)) (X m76 (X (L ⟨[189,536],W,W,W,[46],W,W,W,W,[187,554],[189,536],U⟩) m1)) +def m78 : BTree Mask:=X (L ⟨[10,15,22,33,35,45,47,50,52,76,85,90,95,110,130,131,139,156,163,175,184,186,201,207,209,212,232,242,247,253,260,263,272,274,281,295,297,299,303,308,309,317,324,330,332,334,335,341,345,355,361,364,373,398,409,412,423,427],W,[44,192],[40,128],[27,66],[9,13,51,74,84,237,271,312,313,340,371,439],[10,139,52,364,85,334,272,335,330,341,175,33],[6,23,40,42,62,66,99,100,111,116,127,145,162,167,174,197,205,214,251,256,266,283,286,293,296,302,315,329,336,346,347,372,386,388,396,401,414,422,435,436],[22,308,303,156,76,332,209,110,130,186,324,242,163,184,175,207,297,45,309,260,281,295,201,212,90,139,317,345,355,47,361,373,398,409,50,412,427,423,95,15],[41,87,152,195,264,275,291,319],[35,131,263,232,253,247,274,299],U⟩) m1 +def m79 : BTree Mask:=X (L ⟨[57,125,153,174,200,238,245,336,381,388,422],W,[20],[63,187],W,[115,165,240],[238,200,245],[5,10,16,30,32,53,71,89,106,126,147,159,164,169,175,193,203,220,255,259,272,277,289,310,314,330,341,343,355,358,392,399,405,408,409,423],[153,57,57,381,57,200,381,238,153,153,153,57,381,57,153,381,381,153,57,153,57,381,153,200,238,153,57,245,153,153,153,153,153,57,153,153],[119,170,188,367,420],[125,174,336,388,422],U⟩) m1 +def m80 : BTree Mask:=X (X (L ⟨[3,109,191,402,413],W,W,W,[107],W,W,W,W,[67,180,189,394,438],[109,402,191,413,3],U⟩) m1) (X (L ⟨[484],[230],[3],[194],[3],W,W,[486],[484],W,W,U⟩) m1) +def m81 : BTree Mask:=X (L ⟨[4,6,7,11,14,19,20,21,23,25,31,42,44,61,62,63,64,65,72,77,81,82,97,99,103,107,114,120,128,129,144,145,148,150,158,160,161,166,172,173,181,182,183,185,192,196,197,198,204,205,210,215,216,217,221,225,231,246,251,254,261,265,266,267,276,280,282,284,293,294,304,307,311,316,318,325,329,333,339,344,352,360,368,369,379,380,387,389,395,401,403,410,417,418,419,421,425,426,432,435],W,[20,33,69,12,62,209],[21,34,3,93,35,80,63],[40,37,36],[8,26,43,69,86,118,142,149,165,187,199,211,269,278,323,338,404,433,437],[6,23,182,62,205,42,99,293,380,185,197,145,266,251,173,329,401,435,432],[5,10,16,17,30,32,33,53,71,89,106,124,126,139,147,159,164,169,175,193,203,220,255,259,272,277,289,310,314,324,330,335,341,343,355,358,364,373,392,399,405,408,409,423],[19,21,65,144,31,196,63,77,72,185,107,231,129,339,166,160,11,183,181,217,204,221,276,282,280,246,294,380,4,325,369,368,344,182,261,360,307,418,395,419,114,410,14,426],[6,23,40,42,58,62,66,68,92,99,100,101,111,116,125,127,145,162,167,197,205,214,251,256,266,270,283,286,293,296,315,329,346,347,386,396,401,414,435,436],[7,25,216,61,44,64,82,210,81,128,103,318,120,150,148,417,161,158,172,198,225,215,265,254,267,192,284,304,425,316,311,333,389,352,387,97,403,421,20,379],U⟩) (L ⟨[10,16,17,30,32,33,52,53,71,78,85,119,124,139,154,159,164,167,169,170,175,188,193,203,226,244,255,272,277,286,296,310,324,328,330,331,334,335,341,351,355,362,364,367,373,383,396,408,409,414,420,423,429],W,W,[281],W,[9,13,27,51,70,73,74,84,93,140,155,171,176,194,202,236,237,241,271,292,301,312,313,340,350,370,371,397,406,430,439],[10,139,30,52,71,351,364,85,277,226,169,193,286,164,203,255,334,244,272,16,383,335,330,341,32,167,175,78,408,331,33],[6,23,40,42,57,62,66,87,99,100,111,116,127,145,152,162,167,170,174,188,197,200,205,214,251,256,266,275,283,286,291,293,296,298,302,315,329,336,346,347,365,367,372,381,386,388,396,401,414,420,422,435,436],[124,17,154,17,159,17,154,244,124,154,154,154,324,124,226,124,154,167,175,296,17,53,124,154,124,362,124,328,154,154,226,17,154,351,139,362,124,355,154,154,429,396,373,159,154,409,154,124,154,414,423,17,154],[2,3,34,55,75,94,108,109,191,206,279,354,363,402,413],[310,420,310,310,310,310,310,367,170,310,310,310,310,119,188],U⟩) +def m82 : BTree Mask:=X (L ⟨[87,152,275,291],W,W,[61],[80],W,W,[78,167,226,244,286,296,328,331,351,383,396,414,429],[275,275,291,291,275,275,275,275,275,275,275,275,275],[89,343],[152,87],U⟩) m1 +def m83 : BTree Mask:=X (X m81 (X (L ⟨[549],[150],[3],[152],[3],W,W,[179],[549],W,W,U⟩) m1)) (X m82 (X (L ⟨[504],[214],[3],[215],[3],W,W,[506],[504],W,W,U⟩) m1)) +def m84 : BTree Mask:=X (L ⟨[125,153,174,238,245,336,388,422],[54],[15],[55,35,80],[49],[115,240],[238,245],[5,89,106,126,147,175,220,259,289,314,330,343,355,358,392,399,405,409,423],[153,238,153,153,153,153,153,153,153,238,153,245,153,153,153,153,153,153,153],[119,170,188,367,420],[125,174,336,388,422],U⟩) m1 +def m85 : BTree Mask:=X (L ⟨[21,24,40,56,66,91,97,100,111,112,116,135,167,172,177,190,213,214,224,243,252,280,283,286,290,296,300,304,316,320,344,346,347,366,382,385,386,396,414,421,436],W,[9],[120],[117],[60,73,98,104,121,176,218,262,285,353,370,390,415],[40,396,66,100,111,286,214,116,283,347,167,386,346],[10,52,85,119,154,170,188,235,272,334,341,362,367,420],[21,56,91,111,436,167,296,224,280,252,344,385,396,414],[78,146,167,224,226,244,286,296,302,328,331,351,372,383,396,414,429],[382,135,172,190,213,243,304,316,112,320,177,300,24,290,97,421,366],U⟩) m1 +def m86 : BTree Mask:=X (X m84 (X (L ⟨[141],W,[195],[3],[3],[136],[141],W,W,W,W,U⟩) m1)) (X m85 (X (L ⟨[553],[246],[3],[247],[3],W,W,[526],[553],W,W,U⟩) m1)) +def m87 : BTree Mask:=X (L ⟨[22,33,35,43,76,95,139,156,163,175,187,207,209,212,232,242,253,281,297,299,308,309,323,324,330,335,345,355,364,373,409,412,423,437],[14,45,81],[3,36,35,80,90,56],[3,15],[22,47],[5,6,13,58,68,74,78,89,92,101,106,126,147,167,175,220,226,244,259,266,270,286,289,296,312,313,314,328,329,330,331,343,351,355,358,371,383,392,396,399,405,409,414,423,429,439],[437,187,139,187,187,364,43,437,187,187,437,437,437,43,437,437,43,43,437,187,187,43,437,43,335,330,437,43,187,437,43,323,43,437,437,175,43,437,43,437,437,437,43,437,43,33],[6,23,42,62,99,115,127,145,162,174,197,205,240,251,266,293,302,329,336,372,388,401,422,435],[22,308,156,76,209,437,324,242,163,175,207,297,323,309,281,212,139,345,355,373,409,412,423,95],[4,6,7,11,14,19,20,21,23,25,31,41,42,44,61,62,63,64,65,72,77,81,82,97,99,103,107,114,120,128,129,144,145,148,150,158,160,161,166,172,173,181,182,183,185,192,195,196,197,198,204,205,210,215,216,217,221,225,231,246,251,254,261,264,265,266,267,276,280,282,284,293,294,304,307,311,316,318,319,325,329,333,339,344,352,360,368,369,379,380,387,389,395,401,403,410,417,418,419,421,425,426,432,435],[187,437,187,43,187,187,187,43,323,187,43,35,323,437,187,323,437,187,43,43,43,437,43,43,437,43,187,187,43,187,187,437,437,187,43,187,43,187,187,43,187,187,187,43,187,323,232,43,323,187,43,437,437,43,43,43,187,187,437,43,437,43,187,253,187,437,187,43,43,187,43,323,187,43,437,43,43,437,299,437,437,187,437,43,43,187,437,187,43,43,43,43,187,437,187,43,187,437,187,43,187,187,187,323],U⟩) (L ⟨[548],[270],[3],[271],[3],W,W,[530],[548],W,W,U⟩) +def m88 : BTree Mask:=X (L ⟨[6,14,44,63,81,99,144,145,181,205,210,231,251,261,266,307,318,325,329,339,368,369,401,418,426],W,[62],[34,3],[56],[8,86,142,211,269,278,338,404],[6,205,99,145,266,251,329,401],[17,33,124,139,175,324,330,335,355,364,373,409,423],[144,63,231,339,181,325,369,368,261,307,418,14,426],[58,68,92,101],[44,210,81,318],U⟩) m1 +def m89 : BTree Mask:=X (X m87 (X (L ⟨[222,469],[142],[3],[3],[193,3],W,W,W,W,[322,472],[222,469],U⟩) m1)) (X m88 (X (L ⟨[377],W,W,[207],W,W,W,[378],[377],W,W,U⟩) m1)) +def m90 : BTree Mask:=X (L ⟨[187,554],[46,81],[3,36,56],[3,178],[47],[6,58,68,92,101,266,270,329],[187,187,187,187,187,187,187,187],[528],[554],[4,7,14,19,20,25,61,64,107,114,128,129,148,158,161,166,173,181,182,185,198,221,225,261,265,267,282,294,333,360,369,395,403,417,419,425,426,432],[187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187],U⟩) m1 +def m91 : BTree Mask:=X (L ⟨[10,16,29,30,32,53,57,71,125,153,159,164,169,174,193,200,203,238,245,255,272,277,310,327,336,341,381,388,408,422],W,W,[171],W,[9,10,16,27,30,32,53,70,71,93,115,155,159,164,165,169,171,193,194,202,203,236,240,255,271,272,277,292,310,340,341,350,406,408],[10,327,327,30,327,327,327,71,327,277,238,169,327,327,200,327,193,327,164,203,327,255,245,327,272,327,327,16,327,341,327,32,408,327],[5,10,16,29,30,32,53,57,71,89,106,126,147,159,164,169,175,193,200,203,220,255,259,272,277,289,310,314,327,330,341,343,355,358,381,392,399,405,408,409,423],[153,57,57,29,381,57,200,159,381,238,153,153,153,57,381,57,153,381,53,381,153,57,153,57,381,153,200,238,327,153,57,245,153,153,159,153,153,153,57,153,153],[2,21,24,34,40,55,56,66,75,91,94,97,100,108,111,112,116,119,135,167,170,172,177,188,190,206,213,214,224,243,252,279,280,283,286,290,296,300,304,316,320,344,346,347,354,363,366,367,382,385,386,396,414,420,421,436],[310,327,327,310,327,310,327,327,310,327,310,327,327,310,327,327,327,125,29,327,174,327,327,336,29,310,327,327,29,327,327,310,327,327,327,327,327,327,327,327,327,327,327,327,310,310,327,388,327,327,327,327,327,422,327,327],U⟩) m1 +def m92 : BTree Mask:=X (L ⟨[73,140,176,241,301,370,397,430],[110],[122],[165],[15,160],[41,57,195,200,264,319,381],[397,370,397,370,397,397,370],[8,9,27,48,70,83,93,155,171,180,194,202,208,236,269,271,292,338,340,350,406],[301,370,73,397,73,430,73,370,73,397,73,73,176,370,301,370,370,301,370,370,370],[5,10,15,45,46,47,49,50,52,85,90,102,106,110,115,126,130,131,147,157,175,178,184,186,201,220,223,240,247,249,259,260,263,272,274,287,289,295,303,317,321,326,330,332,334,341,349,355,357,358,361,392,398,399,405,407,409,423,424,427,431],[397,73,370,370,397,370,397,370,370,370,370,397,397,370,140,397,370,73,397,397,397,397,370,370,370,397,397,241,370,397,397,370,370,73,370,397,397,370,370,370,397,397,397,370,73,73,397,397,397,397,370,397,370,397,397,397,397,397,397,370,397],U⟩) m1 +def m93 : BTree Mask:=X (L ⟨[10,12,16,30,32,53,54,71,88,113,151,164,169,193,203,233,255,272,273,277,341,342,348,393,408],W,[60,96,115,3],[23,3],[29],[9,27,70,93,155,171,194,202,236,271,292,340,350,406],[10,30,71,277,169,193,164,203,255,272,16,341,32,408],[57,200,381],[113,53,393],[10,52,85,154,272,334,341,362],[12,54,88,151,273,233,342,348],U⟩) (L ⟨[10,12,16,21,24,30,32,40,52,53,54,56,66,71,85,88,91,97,100,111,112,113,116,151,154,164,167,169,172,177,193,203,213,214,233,243,252,255,272,273,277,280,283,286,290,296,300,304,316,320,334,341,342,344,346,347,348,362,366,382,385,386,393,396,408,414,421,436],W,W,[288],[285],[9,27,51,60,70,73,84,93,98,104,121,155,171,176,194,202,218,236,237,262,271,285,292,340,350,353,370,390,406,415],[10,30,52,40,71,396,85,277,66,100,111,169,193,286,164,203,214,255,334,116,272,283,16,341,32,347,167,386,408,346],[10,40,52,57,66,85,100,111,116,119,154,167,170,188,200,214,256,272,283,286,296,315,334,341,346,347,362,367,381,386,396,414,420,436],[21,154,56,113,154,91,154,154,154,111,436,154,167,296,53,154,362,280,154,154,154,362,252,344,154,154,385,396,393,154,154,154,414,154],[10,52,78,85,154,167,226,244,272,286,296,302,328,331,334,341,351,362,372,383,396,414,429],[12,54,382,88,151,172,213,243,273,304,316,112,320,177,233,342,300,348,24,290,97,421,366],U⟩) +def m94 : BTree Mask:=X (L ⟨[5,6,10,16,17,23,30,32,33,42,53,62,71,78,89,99,106,124,126,127,139,145,147,159,162,164,167,169,174,175,193,197,203,205,220,226,244,251,255,259,266,272,277,286,289,293,296,302,310,314,324,328,329,330,331,335,336,341,343,351,355,358,364,372,373,383,388,392,396,399,401,405,408,409,414,422,423,429,435],W,W,W,W,[8,9,13,26,27,69,70,73,74,86,93,105,117,118,122,140,142,149,155,171,176,194,199,202,211,219,236,239,241,269,271,278,288,292,301,312,313,338,340,350,356,370,371,391,397,404,406,411,428,430,433,439],[6,10,139,23,30,62,71,351,364,205,277,106,405,42,126,226,99,293,169,193,286,164,197,203,145,220,255,259,244,266,272,251,289,16,383,335,330,329,341,32,358,167,175,392,78,401,408,147,5,331,435,33],[6,17,23,33,42,57,62,87,99,124,125,127,139,145,152,153,162,170,174,175,188,197,200,205,238,245,251,266,275,291,293,298,302,324,329,330,335,336,355,364,365,367,372,373,381,388,401,409,420,422,423,435],[124,162,17,127,17,159,17,244,124,162,126,324,127,124,226,399,124,167,175,127,296,17,53,124,314,314,124,124,328,226,17,351,139,127,124,127,127,355,127,127,429,396,373,127,159,409,124,127,414,423,127,17],[2,34,55,59,75,94,96,108,143,170,188,206,258,279,298,354,363,365,367,420],[310,310,310,343,310,310,343,310,89,174,336,310,89,310,302,310,310,372,388,422],U⟩) m1 +def m95 : BTree Mask:=X (L ⟨[6,23,40,42,58,62,66,68,92,99,100,101,111,116,127,145,162,167,174,197,205,214,251,256,266,270,283,286,293,296,302,315,329,336,346,347,372,386,388,396,401,414,422,435,436],W,W,[91],W,[8,26,48,60,69,73,83,86,98,104,118,121,142,149,176,180,199,208,211,218,262,269,278,285,338,353,370,390,404,415,433],[6,23,58,40,62,396,92,205,66,100,42,111,99,293,286,68,197,270,145,214,116,266,251,283,329,347,167,386,401,346,435],[10,17,33,41,52,85,119,124,139,154,170,175,188,195,264,272,319,324,330,334,335,341,355,362,364,367,373,409,420,423],[256,162,127,68,315,315,111,162,127,436,167,127,296,68,101,256,101,127,127,256,127,256,127,315,127,396,127,127,414,127],[170,188,298,365,367,420],[174,336,302,372,388,422],U⟩) m1 +def m96 : BTree Mask:=X (L ⟨[8,86,142,211,269,278,338,404],[62],[59],[32,84],[30,3],[87,152,170,188,275,291,367,420],[269,338,278,86,338,338,142,211],[73,140,176,241,301,370],[142,338,404,269,8,278],[10,12,16,30,32,53,54,71,88,113,151,164,169,193,203,233,255,272,273,277,341,342,348,393,408],[338,269,338,269,338,338,338,269,338,338,338,269,338,269,269,269,338,338,269,269,338,269,338,338,338],U⟩) m1 +def m97 : BTree Mask:=X (L ⟨[8,48,83,180,208,269,338],W,W,W,[20],[87,152,170,188,275,291,298,365,367,420],[269,338,208,208,338,338,83,83,208,208],[73,140,176,241,301,370,397,430],[83,338,208,269,8,83,48,83],[10,12,16,30,32,53,54,71,88,113,151,164,165,169,193,203,233,255,272,273,277,341,342,348,393,408],[338,269,338,269,338,338,338,269,338,338,338,269,180,338,269,269,269,338,338,269,269,338,269,338,338,338],U⟩) m1 +def m98 : BTree Mask:=X (X m96 (X (L ⟨[278,531],[190],[189,3],[103],[3],[170,532],[278,531],[370],[278],W,W,U⟩) m1)) (X m97 (X (L ⟨[538],[254],[3],[251],[3],W,W,[518],[538],W,W,U⟩) m1)) +def m99 : BTree Mask:=X (X m89 (X (X m90 m91) (X m92 (X (L ⟨[502],[238],W,W,[240],W,W,W,W,[503],[502],U⟩) m1)))) (X (X (X m93 m94) (X m95 (X (L ⟨[511],[222],[3],[224],[3],W,W,[513],[511],W,W,U⟩) m1))) m98) +def m100 : BTree Mask:=X (L ⟨[41,87,152,170,188,195,264,275,291,298,319,365,367,420],W,W,[127],W,W,W,[6,58,68,78,92,101,167,226,244,266,270,286,296,328,329,331,351,383,396,414,429],[264,319,41,275,319,319,275,291,291,264,264,275,275,275,264,275,275,275,275,275,275],[3,89,109,191,248,250,310,343,413],[420,152,367,170,298,365,195,87,188],U⟩) m1 +def m101 : BTree Mask:=X (X (L ⟨[1,441],[1],W,W,[144],W,W,W,W,[234,452],[1,441],U⟩) (L ⟨[521],[257],[3],[258],[3],W,W,[523],[521],W,W,U⟩)) m100 +def m102 : BTree Mask:=X (X (L ⟨[34,55,75,108,206,279],W,W,W,[60,3],W,W,W,W,[27,70,93,171,194,202],[34,75,108,279,55,206],U⟩) m1) (X (L ⟨[322,472],W,[58],[162],[3],[79],[322],[473],[472],W,W,U⟩) m1) +def m103 : BTree Mask:=X (L ⟨[26,69,118,149,199,433],[33],[25,131],[52,10],[30],[87,119,152,275,291],[149,69,199,199,199],[67,123,189,337,394,438],[149,69,199,118,433,26],[10,12,16,30,32,53,54,71,88,113,151,164,169,193,203,233,255,272,273,277,341,342,348,393,408],[199,149,199,149,199,199,199,149,199,199,199,149,199,149,149,149,199,199,149,149,199,149,199,199,199],U⟩) (L ⟨[10,52,78,85,119,154,167,170,188,226,244,272,286,296,328,331,334,341,351,362,367,383,396,414,420,429],W,W,[287],W,[9,51,73,84,140,176,237,241,271,301,340,370,397,430],[10,52,351,85,226,286,334,244,272,383,341,167,78,331],[40,66,87,100,111,116,152,167,170,188,214,256,275,283,286,291,296,298,315,346,347,365,367,386,396,414,420,436],[154,154,244,154,154,154,226,154,167,296,154,362,328,154,154,226,154,351,362,154,154,429,396,154,154,154,414,154],[3,109,191,402,413],[420,367,170,119,188],U⟩) +def m104 : BTree Mask:=X (L ⟨[59,67,96,140,143,189,241,258,394,438],W,W,W,[3],W,W,W,W,[18,43,51,84,115,138,187,240,323,437],[258,67,59,96,140,143,189,241,394,438],U⟩) m1 +def m105 : BTree Mask:=X (L ⟨[40,66,100,111,116,125,153,167,174,214,238,245,256,283,286,296,315,336,346,347,386,388,396,414,422,436],W,W,[99,35],W,[60,73,98,104,115,121,176,218,240,262,285,353,370,390,415],[40,396,66,100,238,111,286,214,245,116,283,347,167,386,346],[5,10,52,85,89,106,119,126,147,154,170,175,188,220,259,272,289,314,330,334,341,343,355,358,362,367,392,399,405,409,420,423],[153,256,315,315,238,153,111,153,153,436,167,153,296,153,153,256,153,238,153,256,256,245,153,153,315,396,153,153,153,153,414,153],[119,170,188,367,420],[125,174,336,388,422],U⟩) m1 +def m106 : BTree Mask:=X (L ⟨[21,24,40,56,66,91,97,100,111,112,116,167,172,177,213,214,243,252,280,283,286,290,296,300,304,316,320,344,346,347,366,382,385,386,396,414,421,436],W,[72,9,3],[68,29,49,101,3],[76,61,135],[60,73,98,104,121,176,218,262,285,353,370,390,415],[40,396,66,100,111,286,214,116,283,347,167,386,346],[10,52,85,119,154,170,188,272,334,341,362,367,420],[21,56,91,111,436,167,296,280,252,344,385,396,414],[78,167,226,244,286,296,302,328,331,351,372,383,396,414,429],[382,172,213,243,304,316,112,320,177,300,24,290,97,421,366],U⟩) (L ⟨[10,12,13,15,16,22,27,30,32,33,35,45,47,50,52,53,54,70,71,74,76,78,85,88,90,93,95,110,113,130,131,139,146,151,154,156,163,164,167,169,171,175,184,186,193,194,201,202,203,207,209,212,224,226,232,233,242,244,247,253,255,260,263,272,273,274,277,281,286,295,296,297,299,302,303,308,309,317,324,328,330,331,332,334,335,341,342,345,348,351,355,361,362,364,371,372,373,383,393,396,398,408,409,412,414,423,427,429,439],W,W,[275],W,[9,13,27,51,70,73,74,84,93,140,155,168,171,176,194,202,236,237,241,271,292,301,312,313,340,350,370,371,397,406,430,439],[10,139,30,52,71,351,364,85,277,226,169,146,193,286,164,203,255,334,244,272,16,383,335,330,341,32,167,175,78,408,331,33],[6,23,40,42,57,62,66,87,99,100,111,116,127,145,152,162,167,170,174,188,197,200,205,214,235,251,256,266,275,283,286,291,293,296,298,302,315,329,336,346,347,365,367,372,381,386,388,396,401,414,420,422,435,436],[22,308,154,156,113,76,154,244,209,110,130,154,324,242,226,163,154,167,175,296,207,53,297,45,224,309,260,281,328,154,154,226,212,90,351,139,317,345,355,47,154,429,396,373,393,154,409,50,412,154,414,423,95,15],[10,26,41,52,69,73,85,87,118,149,152,154,195,199,264,272,275,291,298,319,334,341,362,365,370,397,430,433],[12,27,35,54,70,13,88,131,93,171,263,151,232,202,253,273,247,274,302,299,233,342,348,372,371,439,74,194],U⟩) +def m107 : BTree Mask:=X (L ⟨[43,115,187,240,323,437],[15],W,W,W,[5,6,58,68,78,89,92,101,106,126,147,167,175,220,226,244,259,266,270,286,289,296,314,328,329,330,331,343,351,355,358,383,392,396,399,405,409,414,423,429],[115,115,115,115,43,115,115,115,115,115,115,43,115,115,43,43,115,115,115,43,115,43,115,43,115,115,43,240,43,115,115,43,115,43,115,115,115,43,115,43],[115,240],[115,240],[4,6,7,11,14,19,20,21,23,25,31,42,44,61,62,63,64,65,72,77,81,82,97,99,103,107,114,120,128,129,144,145,148,150,158,160,161,166,172,173,181,182,183,185,192,196,197,198,204,205,210,215,216,217,221,225,231,246,251,254,261,265,266,267,276,280,282,284,293,294,304,307,311,316,318,325,329,333,339,344,352,360,368,369,379,380,387,389,395,401,403,410,417,418,419,421,425,426,432,435],[115,115,115,43,115,115,115,43,240,115,43,240,115,115,240,115,115,43,43,43,115,43,43,115,43,115,115,43,115,115,115,115,115,43,115,43,115,115,43,115,115,115,43,115,240,43,240,115,43,115,115,43,43,43,115,115,115,43,115,43,115,115,115,115,43,43,115,43,240,115,43,115,43,43,115,115,115,115,115,43,43,115,115,115,43,43,43,43,115,115,115,43,115,115,115,43,115,115,115,240],U⟩) m1 +def m108 : BTree Mask:=X (L ⟨[187],[81],[3,36],[3],[47,3],[6,58,68,92,101,266,270,329],[187,187,187,187,187,187,187,187],W,W,[4,7,14,19,20,25,61,64,107,114,128,129,148,158,161,166,173,181,182,185,198,221,225,261,265,267,282,294,333,360,369,395,403,417,419,425,426,432],[187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187],U⟩) m1 +def m109 : BTree Mask:=X (L ⟨[8,26,43,69,86,118,142,149,165,187,199,211,269,278,323,338,404,433,437],W,W,W,[22],[5,6,10,16,30,32,53,58,68,71,78,87,89,92,101,106,119,126,147,152,159,164,167,169,170,175,188,193,203,220,226,244,255,259,266,270,272,275,277,286,289,291,296,310,314,328,329,330,331,341,343,351,355,358,367,383,392,396,399,405,408,409,414,420,423,429],[437,187,165,165,165,165,165,187,187,165,43,149,437,187,187,437,69,437,437,199,165,165,43,165,278,437,86,165,165,437,43,43,165,437,187,187,165,199,165,43,437,199,43,165,437,43,187,437,43,165,323,43,437,437,142,43,437,43,437,437,165,437,43,211,437,43],[29,67,73,115,123,140,176,189,240,241,301,327,337,370,394,438],[165,149,142,437,69,338,404,199,323,269,8,165,118,278,433,26],[4,6,7,10,11,12,14,16,19,20,21,23,24,25,30,31,32,40,42,44,53,54,56,61,62,63,64,65,66,71,72,77,81,82,88,91,97,99,100,103,107,111,112,113,114,116,120,128,129,144,145,148,150,151,158,160,161,164,166,167,169,172,173,177,181,182,183,185,192,193,196,197,198,203,204,205,210,213,214,215,216,217,221,225,231,233,243,246,251,252,254,255,261,265,266,267,272,273,276,277,280,282,283,284,286,290,293,294,296,300,304,307,311,316,318,320,325,329,333,339,341,342,344,346,347,348,352,360,366,368,369,379,380,382,385,386,387,389,393,395,396,401,403,408,410,414,417,418,419,421,425,426,432,435,436],[187,437,187,199,43,149,187,199,187,187,43,323,165,187,149,43,199,165,323,437,199,199,165,187,323,437,187,43,165,149,43,43,437,43,199,165,43,437,165,43,187,165,165,199,187,165,43,187,187,437,437,187,43,199,187,43,187,149,187,165,199,43,187,165,187,187,43,187,323,149,43,323,187,149,43,437,437,165,165,43,43,43,187,187,437,149,165,43,437,165,43,199,187,187,437,187,199,149,43,149,43,187,165,43,165,165,323,187,165,165,43,437,43,43,437,165,437,437,187,437,199,149,43,165,165,199,43,187,165,437,187,43,43,165,165,165,43,43,199,187,165,437,187,199,43,165,187,437,187,43,187,187,187,323,165],U⟩) m1 +def m110 : BTree Mask:=X (L ⟨[6,10,23,40,42,52,62,66,85,99,100,111,115,116,119,127,145,154,162,167,170,174,188,197,205,214,240,251,256,266,272,283,286,293,296,302,315,329,334,336,341,346,347,362,367,372,386,388,396,401,414,420,422,435,436],W,W,[175],W,[5,6,8,9,26,51,58,60,68,69,73,78,84,86,89,92,98,101,104,106,118,121,126,142,147,149,167,175,176,199,211,218,220,226,237,244,259,262,266,269,270,271,278,285,286,289,296,314,328,329,330,331,338,340,343,351,353,355,358,370,383,390,392,396,399,404,405,409,414,415,423,429,433],[115,115,6,10,23,52,115,40,115,62,396,240,85,205,115,115,66,115,100,115,42,111,115,99,115,293,240,115,286,197,145,214,115,240,334,240,115,116,115,266,115,272,251,283,240,115,240,115,240,115,115,240,329,341,240,240,347,115,115,167,240,386,115,240,115,401,115,115,240,346,115,240,435],[10,17,33,40,52,66,85,100,111,115,116,119,124,139,154,167,170,175,188,214,240,256,272,283,286,296,315,324,330,334,335,341,346,347,355,362,364,367,373,386,396,409,414,420,423,436],[256,162,127,154,315,154,315,154,154,115,154,111,162,127,436,154,167,127,296,154,240,362,256,154,154,154,362,127,127,256,127,256,154,154,127,315,127,396,127,154,154,127,154,414,127,154],[3,4,6,7,11,14,19,20,21,23,25,31,42,44,61,62,63,64,65,72,77,81,82,97,99,103,107,109,114,120,128,129,144,145,148,150,158,160,161,166,170,172,173,181,182,183,185,188,191,192,196,197,198,204,205,210,215,216,217,221,225,231,246,251,254,261,265,266,267,276,280,282,284,293,294,298,304,307,311,316,318,325,329,333,339,344,352,360,365,367,368,369,379,380,387,389,395,401,402,403,410,413,417,418,419,420,421,425,426,432,435],[420,115,115,115,240,115,115,115,240,240,115,240,240,115,115,240,115,115,240,240,240,115,240,240,115,240,115,367,115,240,115,115,115,115,115,240,115,240,115,115,174,240,115,115,115,240,115,336,170,240,240,240,115,240,115,115,240,240,240,115,115,115,240,115,240,115,115,115,115,240,240,115,240,240,115,302,240,115,240,240,115,115,115,115,115,240,240,115,372,388,115,115,240,240,240,240,115,115,119,115,240,188,115,115,115,422,240,115,115,115,240],U⟩) m1 +def m111 : BTree Mask:=X (X (L ⟨[48,83],W,W,W,W,[298,365],[83,83],[73,370,397,430],[83,83,48,83],W,W,U⟩) m1) (X (L ⟨[545],[241],[3],[242],[3],W,W,[550],[545],W,W,U⟩) m1) +def m112 : BTree Mask:=X (X (X (L ⟨[119,170,188,367,420],[49,131],W,W,[102],W,W,W,W,[3,109,191,402,413],[420,367,170,119,188],U⟩) m1) m110) m111 +def m113 : BTree Mask:=X (X (X m101 m102) (X (X m103 m104) (X m105 (X (L ⟨[514],[225],[3],[226],[3],W,W,[479],[514],W,W,U⟩) m1)))) (X (X (X m106 m107) (X m108 m109)) m112) +def m114 : BTree Mask:=X (L ⟨[60,73,98,104,121,176,218,262,285,353,370,390,415],[9,103,72],[23,54,3,77,166],[53,33,43,96,83,3,60,185],[6,38,3],[57,125,153,174,200,238,245,336,381,388,422],[370,121,121,121,370,121,121,121,370,121,121],[8,9,13,26,27,69,70,93,105,117,118,122,149,155,171,194,199,202,208,219,236,239,269,271,288,292,313,338,340,350,356,371,391,406,411,428,433],[60,370,121,98,73,104,73,73,121,121,390,121,415,370,73,73,218,73,176,121,370,121,285,370,121,370,121,353,370,370,121,121,121,370,121,121,262],[10,15,22,33,35,45,47,50,52,76,85,90,95,110,130,131,139,156,163,175,184,186,201,207,209,212,232,242,247,253,260,263,272,274,281,295,297,299,303,308,309,317,324,330,332,334,335,341,345,355,361,364,373,398,409,412,423,427],[73,370,121,121,121,370,370,370,370,121,370,370,121,370,370,73,121,121,121,121,370,370,370,121,121,121,121,121,370,121,370,370,73,370,121,370,121,121,370,121,121,370,121,121,370,73,121,73,121,121,370,121,121,370,121,121,121,370],U⟩) (L ⟨[520],W,W,W,[253],W,W,W,W,[527],[520],U⟩) +def m115 : BTree Mask:=X (L ⟨[374,498],[73],[77],[75],[136],[174,336,388,422],[374,374,374,374],[13,239,288,313,356,371,499],[374,374,374,374,374,374,498],[33,39,139,364,373],[374,374,374,374,374],U⟩) m1 +def m116 : BTree Mask:=X (X m114 (X (L ⟨[48,83,180],[137],[67],[11],[20],[298,365],[83,83],[73,370,397,430],[83,83,48,83],[165],[180],U⟩) m1)) (X m115 (X (L ⟨[228],[201],[3],[202],[3],W,W,[229],[228],W,W,U⟩) m1)) +def m117 : BTree Mask:=X (L ⟨[10,15,21,22,24,33,35,40,43,45,47,50,52,56,66,76,85,90,91,95,97,100,110,111,112,115,116,130,131,135,139,156,163,167,172,175,177,184,186,187,190,201,207,209,212,213,214,224,232,240,242,243,247,252,253,260,263,272,274,280,281,283,286,290,295,296,297,299,300,303,304,308,309,316,317,320,323,324,330,332,334,335,341,344,345,346,347,355,361,364,366,373,382,385,386,396,398,409,412,414,421,423,427,436,437],W,W,[172],[167],[5,6,9,13,51,58,60,68,73,74,78,84,89,92,98,101,104,106,121,126,147,167,175,176,218,220,226,237,244,259,262,266,270,271,285,286,289,296,312,313,314,328,329,330,331,340,343,351,353,355,358,370,371,383,390,392,396,399,405,409,414,415,423,429,439],[115,115,10,139,52,115,40,115,396,364,43,85,115,115,66,115,100,115,111,115,115,43,115,286,214,115,43,334,43,115,116,115,115,272,283,43,115,43,335,330,115,43,115,115,43,341,240,43,347,115,115,167,175,43,386,115,43,115,115,115,43,346,115,43,33],[6,10,23,40,42,52,62,66,85,99,100,111,115,116,119,127,145,154,162,167,170,174,188,197,205,214,235,240,251,256,266,272,283,286,293,296,302,315,329,334,336,341,346,347,362,367,372,386,388,396,401,414,420,422,435,436],[22,21,308,303,156,56,76,332,91,209,110,130,115,186,111,324,242,436,163,184,167,175,296,207,297,45,224,240,309,260,281,280,295,201,212,90,139,317,345,252,355,344,47,361,385,396,373,398,409,50,412,427,414,423,95,15],[4,6,7,11,14,19,20,21,23,25,31,41,42,44,61,62,63,64,65,72,77,78,81,82,87,97,99,103,107,114,120,128,129,144,145,146,148,150,152,158,160,161,166,167,172,173,181,182,183,185,192,195,196,197,198,204,205,210,215,216,217,221,224,225,226,231,244,246,251,254,261,264,265,266,267,275,276,280,282,284,286,291,293,294,296,302,304,307,311,316,318,319,325,328,329,331,333,339,344,351,352,360,368,369,372,379,380,383,387,389,395,396,401,403,410,414,417,418,419,421,425,426,429,432,435],[115,115,115,43,115,115,115,43,240,115,43,35,240,115,115,240,115,115,43,43,43,382,115,43,131,43,115,43,115,115,43,115,115,115,115,135,115,43,263,115,43,115,115,172,43,115,115,115,43,115,240,232,43,240,115,43,115,115,43,43,43,115,190,115,213,115,243,43,115,43,115,253,115,115,115,247,43,43,115,43,304,274,240,115,316,112,43,115,43,43,115,299,115,320,115,177,115,115,43,300,43,115,115,115,24,43,43,290,43,43,115,97,115,115,43,421,115,115,115,43,115,115,366,115,240],U⟩) m1 +def m118 : BTree Mask:=X (L ⟨[15,45,47,50,52,85,90,110,130,184,186,201,247,260,263,274,295,303,317,332,361,398,427],W,[114],[40],[104],[51,84],[52,85],[40,66,100,111,116,167,214,256,283,286,296,315,346,347,386,396,414,436],[303,332,110,130,186,184,45,260,295,201,90,317,47,361,398,50,427,15],[152,275,291],[263,247,274],U⟩) m1 +def m119 : BTree Mask:=X (X (X (L ⟨[59,96,143,258],W,W,W,[121,3],W,W,W,W,[18,51,84,138],[258,59,96,143],U⟩) m1) m117) (X m118 (X (L ⟨[491],[233],[3],[234],[3],W,W,[492],[491],W,W,U⟩) m1)) +def m120 : BTree Mask:=X (L ⟨[87,119,152,275,291],[25,104],[3],[61,3],[80],W,W,[78,167,226,244,286,296,328,331,351,383,396,414,429],[275,275,291,291,275,275,275,275,275,275,275,275,275],[89,343,402],[152,87,119],U⟩) (L ⟨[6,23,40,42,57,62,66,87,99,100,111,116,127,145,152,162,167,170,174,188,197,200,205,214,251,256,266,275,283,286,291,293,296,298,302,315,329,336,346,347,365,367,372,381,386,388,396,401,414,420,422,435,436],W,W,[278],W,[8,26,60,69,73,86,98,104,118,121,142,149,165,176,199,211,218,262,269,278,285,338,353,370,390,404,415,433],[6,23,40,62,396,205,66,100,42,111,99,293,200,286,197,145,214,116,266,251,283,329,347,167,386,401,346,435],[10,16,17,30,32,33,52,53,71,78,85,119,124,139,154,159,164,167,169,170,175,188,193,203,226,244,255,272,277,286,296,310,324,328,330,331,334,335,341,351,355,362,364,367,373,383,396,408,409,414,420,423,429],[57,57,162,381,57,127,315,200,381,275,315,111,162,127,436,57,381,275,57,167,127,296,381,381,291,291,57,57,381,275,275,200,127,275,127,275,256,127,57,275,127,315,127,396,127,275,275,57,127,275,414,127,275],[3,89,109,170,188,191,248,250,298,343,365,367,413,420],[420,152,367,174,336,170,298,365,302,87,372,388,188,422],U⟩) +def m121 : BTree Mask:=X (L ⟨[59,67,96,140,143,168,189,241,258,394,438],W,W,W,[152,283],W,W,W,W,[18,43,51,84,115,138,179,187,240,323,437],[258,67,59,96,140,143,168,189,241,394,438],U⟩) m1 +def m122 : BTree Mask:=X (L ⟨[10,15,45,47,50,52,85,90,110,130,131,184,186,201,247,260,263,272,274,295,303,317,332,334,341,361,398,427],W,[44],[40],[86],[9,51,84,237,271,340],[10,52,85,334,272,341],[40,66,100,111,116,167,214,256,283,286,296,315,346,347,386,396,414,436],[303,332,110,130,186,184,45,260,295,201,90,317,47,361,398,50,427,15],[87,152,275,291],[131,263,247,274],U⟩) m1 +def m123 : BTree Mask:=X (L ⟨[6,23,42,62,99,125,127,145,162,197,205,251,266,293,329,401,435],[57],[69,62],[34,3],[131],[8,26,69,86,118,142,149,199,211,269,278,338,404,433],[6,23,62,205,42,99,293,197,145,266,251,329,401,435],[17,33,124,139,175,324,330,335,355,364,373,409,423],[162,127,162,127,127,127,127,127,127,127,127,127,127],[119],[125],U⟩) m1 +def m124 : BTree Mask:=X (L ⟨[8,9,13,26,27,69,70,93,105,117,118,122,149,155,171,194,199,202,208,219,236,239,269,271,288,292,313,338,340,350,356,371,391,406,411,428,433],W,W,W,W,[87,119,152,170,188,275,291,367,420],[149,69,199,208,208,199,199,208,208],[67,73,123,140,176,189,241,301,337,370,394,438],[149,208,69,338,208,199,269,8,118,208,433,26],[8,10,12,16,26,30,32,53,54,60,69,71,73,86,88,98,104,113,118,121,142,149,151,164,169,176,193,199,203,211,218,233,255,262,269,272,273,277,278,285,338,341,342,348,353,370,390,393,404,408,415,433],[9,199,149,199,27,149,199,199,199,239,70,149,13,236,199,117,105,199,93,122,155,171,199,149,199,313,149,202,149,350,219,149,199,411,271,199,149,149,292,288,340,199,149,199,356,371,391,199,406,199,428,194],U⟩) m1 +def m125 : BTree Mask:=X (X (L ⟨[18,51,84,138],W,W,W,[51,3],W,W,W,W,[48,83,123,337],[51,84,138,18],U⟩) m1) (X (L ⟨[543],[249],[3],[250],[3],W,W,[544],[543],W,W,U⟩) m1) +def m126 : BTree Mask:=X (X (X m120 m121) (X m122 (X (L ⟨[508],[217],[3],[218],[3],W,W,[509],[508],W,W,U⟩) m1))) (X (X m123 m124) m125) +def m127 : BTree Mask:=X (X (L ⟨[384,485],W,[3],[184],[3],W,W,[257,494],[384,485],W,W,U⟩) (L ⟨[525],[261],[3],[262],[3],W,W,[539],[525],W,W,U⟩)) (X (L ⟨[143,258],W,W,W,[132],W,W,W,W,[18,138],[258,143],U⟩) m1) +def m128 : BTree Mask:=X (L ⟨[8,26,69,86,118,142,149,199,211,269,278,338,404,433],[69,33],[68,59,86,49,25,131],[32,84,108,10,85],[30,3],[87,119,152,170,188,275,291,367,420],[149,69,199,278,86,199,199,142,211],[67,73,123,140,176,189,241,301,337,370,394,438],[149,142,69,338,404,199,269,8,118,278,433,26],[10,12,16,30,32,53,54,71,88,113,151,164,169,193,203,233,255,272,273,277,341,342,348,393,408],[199,149,199,149,199,199,199,149,199,199,199,149,199,149,149,149,199,199,149,149,199,149,199,199,199],U⟩) m1 +def m129 : BTree Mask:=X (L ⟨[6,23,40,42,58,62,66,68,92,99,100,101,111,116,125,127,145,162,167,197,205,214,251,256,266,270,283,286,293,296,315,329,346,347,386,396,401,414,435,436],[37,57,36],[69],[34,91,3],[131],[8,26,48,60,69,73,83,86,98,104,118,121,142,149,176,180,199,208,211,218,262,269,278,285,338,353,370,390,404,415,433],[6,23,58,40,62,396,92,205,66,100,42,111,99,293,286,68,197,270,145,214,116,266,251,283,329,347,167,386,401,346,435],[10,17,33,41,52,85,119,124,139,154,170,175,188,195,264,272,319,324,330,334,335,341,355,362,364,367,373,409,420,423],[256,162,127,68,315,315,111,162,127,436,167,127,296,68,101,256,101,127,127,256,127,256,127,315,127,396,127,127,414,127],[119],[125],U⟩) m1 +def m130 : BTree Mask:=X (L ⟨[8,9,27,48,70,83,93,155,171,180,194,202,208,236,269,271,292,338,340,350,406],W,W,W,[20,284],[87,152,170,188,275,291,298,365,367,420],[269,338,208,208,338,338,83,83,208,208],[73,140,176,241,301,370,397,430],[83,338,208,269,8,83,48,83],[8,10,12,16,26,30,32,53,54,69,71,86,88,113,118,142,149,151,164,165,169,193,199,203,211,233,255,269,272,273,277,278,338,341,342,348,393,404,408,433],[9,338,269,338,27,269,338,338,338,70,269,236,338,338,93,155,171,338,269,180,338,269,202,269,350,269,338,271,338,269,269,292,340,338,269,338,338,406,338,194],U⟩) m1 +def m131 : BTree Mask:=X (L ⟨[10,52,85,119,154,170,188,272,334,341,362,367,420],W,W,[40],[102],[9,51,84,237,271,340],[10,52,85,334,272,341],[40,66,100,111,116,167,214,256,283,286,296,315,346,347,386,396,414,436],[154,154,154,154,154,154,154,362,154,154,154,362,154,154,154,154,154,154],[3,109,191,402,413],[420,367,170,119,188],U⟩) m1 +def m132 : BTree Mask:=X (X m127 (X m128 (X (L ⟨[133],W,W,W,[196],W,W,W,W,[134],[133],U⟩) m1))) (X (X m129 m130) (X m131 (X (L ⟨[483],[229],[3],[230],[3],W,W,[484],[483],W,W,U⟩) m1))) +def m133 : BTree Mask:=X (L ⟨[10,16,30,32,53,71,159,164,169,193,203,255,272,277,310,341,408],[21,63],[60,96,115,3],[23,3],[8],[9,27,70,93,155,171,194,202,236,271,292,340,350,406],[10,30,71,277,169,193,164,203,255,272,16,341,32,408],[57,200,381],[159,53,159],[2,34,55,75,94,108,206,279,354,363],[310,310,310,310,310,310,310,310,310,310],U⟩) (L ⟨[8,9,10,13,26,27,52,57,67,69,70,73,85,93,105,117,118,119,122,123,140,149,154,155,170,171,176,188,189,194,199,200,202,208,219,235,236,239,241,269,271,272,288,292,301,313,334,337,338,340,341,350,356,362,367,370,371,381,391,394,406,411,420,428,433,438],W,W,[280],W,[9,51,57,84,87,119,125,152,153,165,170,174,188,200,237,238,245,271,275,291,336,340,367,381,388,420,422],[10,52,370,85,149,69,123,199,123,200,208,123,208,370,334,123,123,272,199,199,123,341,208,370,123,208,123],[8,9,10,13,16,26,27,30,32,40,53,66,67,69,70,71,73,93,100,105,111,116,117,118,122,123,140,149,155,159,164,167,169,171,176,189,193,194,199,202,203,208,214,219,236,239,241,255,256,269,271,272,277,283,286,288,292,296,301,310,313,315,337,338,340,341,346,347,350,356,370,371,386,391,394,396,406,408,411,414,428,433,436,438],[301,370,57,123,57,337,73,381,57,154,200,154,149,123,73,381,208,73,154,123,154,154,123,337,123,69,338,337,370,57,381,154,57,73,208,199,381,73,337,73,381,176,154,123,370,123,269,57,362,301,370,57,381,154,154,123,370,154,8,200,123,362,118,301,370,57,154,154,370,123,208,123,154,123,433,154,370,57,123,154,123,337,154,26],[3,8,10,12,15,16,22,26,30,32,33,35,43,45,47,50,52,53,54,60,69,71,73,76,85,86,88,90,95,98,104,109,110,113,115,118,121,130,131,139,142,149,151,156,163,164,169,175,176,184,186,187,191,193,199,201,203,207,209,211,212,218,232,233,240,242,247,253,255,260,262,263,268,269,272,273,274,277,278,281,285,295,297,299,303,308,309,317,323,324,330,332,334,335,338,341,342,345,348,353,355,361,364,370,373,390,393,398,402,404,408,409,412,413,415,423,427,433,437],[420,9,73,149,370,199,123,27,149,199,123,123,67,370,370,370,370,199,199,239,70,149,13,123,370,236,199,370,123,117,105,367,370,199,140,93,122,370,73,123,155,171,199,123,123,149,199,123,313,370,370,189,170,149,202,370,149,123,123,350,123,219,123,149,241,123,370,123,199,370,411,370,235,271,73,149,370,149,292,123,288,370,123,123,370,123,123,370,394,123,123,370,73,123,340,73,149,123,199,356,123,370,123,371,123,391,199,370,119,406,199,123,123,188,428,123,370,194,438],U⟩) +def m134 : BTree Mask:=X (X (L ⟨[67,189,394,438],W,W,W,[45],W,W,W,W,[43,187,323,437],[67,189,394,438],U⟩) m1) (X (L ⟨[501],[213],[3],[214],[3],W,W,[504],[501],W,W,U⟩) m1) +def m135 : BTree Mask:=X (X m133 (X (L ⟨[3,109,191,268,402,413],W,W,W,[154],W,W,W,W,[67,168,180,189,394,438],[109,268,402,191,413,3],U⟩) m1)) m134 +def m136 : BTree Mask:=X (L ⟨[13,105,117,122,219,239,288,313,356,371,391,411,428],W,W,W,[9,72],W,W,W,W,[60,73,98,104,121,176,218,262,285,353,370,390,415],[239,13,117,105,122,313,219,411,288,356,371,391,428],U⟩) m1 +def m137 : BTree Mask:=X (L ⟨[78,146,167,224,226,244,286,296,302,328,331,351,372,383,396,414,429],W,[151],[119],[67],[73,140,168,176,241,301,370,397,430],[351,226,146,286,244,383,167,78,331],[87,152,170,188,235,275,291,298,365,367,420],[244,226,167,296,224,328,226,351,429,396,414],[298,365],[302,372],U⟩) m1 +def m138 : BTree Mask:=X (X m136 (X (L ⟨[132],[181],W,[3],[197],W,W,W,W,[133],[132],U⟩) m1)) (X m137 (X (L ⟨[534],W,[3],[3],[263],W,W,W,W,[552],[534],U⟩) m1)) +def m139 : BTree Mask:=X (L ⟨[18,43,51,84,138,187,323,437],[13,45,81],[3,36,35,80,90,56],[3,15],[22,47],[5,6,58,68,78,89,92,101,106,126,147,167,175,220,226,244,259,266,270,286,289,296,314,328,329,330,331,343,351,355,358,383,392,396,399,405,409,414,423,429],[437,187,187,187,43,437,187,187,437,437,437,43,437,437,43,43,437,187,187,43,437,43,437,43,187,437,43,323,43,437,437,43,437,43,437,437,437,43,437,43],[115,240],[437,323],[4,6,7,11,14,19,20,21,23,25,31,42,44,48,61,62,63,64,65,72,77,81,82,83,97,99,103,107,114,120,123,128,129,144,145,148,150,158,160,161,166,172,173,181,182,183,185,192,196,197,198,204,205,210,215,216,217,221,225,231,246,251,254,261,265,266,267,276,280,282,284,293,294,304,307,311,316,318,325,329,333,337,339,344,352,360,368,369,379,380,387,389,395,401,403,410,417,418,419,421,425,426,432,435],[187,437,187,43,187,187,187,43,323,187,43,323,437,51,187,323,437,187,43,43,43,437,43,84,43,437,43,187,187,43,138,187,187,437,437,187,43,187,43,187,187,43,187,187,187,43,187,323,43,323,187,43,437,437,43,43,43,187,187,437,43,437,43,187,187,437,187,43,43,187,43,323,187,43,437,43,43,437,437,437,187,18,437,43,43,187,437,187,43,43,43,43,187,437,187,43,187,437,187,43,187,187,187,323],U⟩) (L ⟨[547],[269],[3],[270],[3],W,W,[548],[547],W,W,U⟩) +def m140 : BTree Mask:=X (X (L ⟨[174,336,388,422],W,W,[3],[68],W,W,W,W,[170,188,367,420],[174,336,388,422],U⟩) m1) (X (L ⟨[376],W,W,[206],W,W,W,[377],[376],W,W,U⟩) m1) +def m141 : BTree Mask:=X (L ⟨[43,187,323,437],[45,81],[35,55,61,80,90,3,56],[15,3],[22,47,78],[5,6,58,68,78,89,92,101,106,126,147,167,175,220,226,244,259,266,270,286,289,296,314,328,329,330,331,343,351,355,358,383,392,396,399,405,409,414,423,429],[437,187,187,187,43,437,187,187,437,437,437,43,437,437,43,43,437,187,187,43,437,43,437,43,187,437,43,323,43,437,437,43,437,43,437,437,437,43,437,43],[115,240],[437,323],[4,6,7,11,14,19,20,21,23,25,31,42,44,61,62,63,64,65,72,77,81,82,97,99,103,107,114,120,128,129,144,145,148,150,158,160,161,166,172,173,181,182,183,185,192,196,197,198,204,205,210,215,216,217,221,225,231,246,251,254,261,265,266,267,276,280,282,284,293,294,304,307,311,316,318,325,329,333,339,344,352,360,368,369,379,380,387,389,395,401,403,410,417,418,419,421,425,426,432,435],[187,437,187,43,187,187,187,43,323,187,43,323,437,187,323,437,187,43,43,43,437,43,43,437,43,187,187,43,187,187,437,437,187,43,187,43,187,187,43,187,187,187,43,187,323,43,323,187,43,437,437,43,43,43,187,187,437,43,437,43,187,187,437,187,43,43,187,43,323,187,43,437,43,43,437,437,437,187,437,43,43,187,437,187,43,43,43,43,187,437,187,43,187,437,187,43,187,187,187,323],U⟩) m1 +def m142 : BTree Mask:=X (L ⟨[6,23,41,42,57,62,78,87,99,125,127,145,152,153,162,167,170,174,188,195,197,200,205,226,238,244,245,251,264,266,275,286,291,293,296,298,302,319,328,329,331,336,351,365,367,372,381,383,388,396,401,414,420,422,429,435],W,W,[176],W,[8,26,69,73,86,115,118,140,142,149,165,176,199,211,240,241,269,278,301,338,370,397,404,430,433],[6,23,62,351,205,238,42,226,99,293,200,286,197,145,245,244,266,251,383,329,167,78,401,331,435],[5,6,10,16,17,30,32,33,53,58,68,71,78,87,89,92,101,106,124,126,139,147,152,159,164,167,169,170,175,188,193,203,220,226,244,255,259,266,270,272,275,277,286,289,291,296,298,310,314,324,328,329,330,331,335,341,343,351,355,358,364,365,367,373,383,392,396,399,405,408,409,414,420,423,429],[153,264,57,57,162,381,57,127,200,319,41,381,275,244,238,319,319,153,162,153,127,153,226,57,381,275,57,167,127,296,381,381,153,291,291,57,153,264,264,57,328,381,275,153,226,275,351,200,238,127,275,264,127,275,127,57,245,275,127,153,127,429,396,127,275,153,275,153,153,57,127,275,414,127,275],[3,89,109,119,170,188,191,248,250,298,310,343,365,367,413,420],[420,152,367,125,174,336,170,298,365,302,195,87,372,388,188,422],U⟩) m1 +def m143 : BTree Mask:=X (L ⟨[59,67,96,143,189,258,394,438],W,W,W,[13,45,81],W,W,W,W,[18,43,51,84,138,187,323,437],[258,67,59,96,143,189,394,438],U⟩) m1 +def m144 : BTree Mask:=X (X (X m139 (X (L ⟨[38],W,W,W,[138],W,W,W,W,[434],[38],U⟩) m1)) m140) (X (X m141 m142) (X m143 (X (L ⟨[500],[237],[238,3],[3],[3],[502],[500],W,W,W,W,U⟩) m1))) +def m145 : BTree Mask:=X (L ⟨[10,52,85,154,272,334,341,362],[29],[44],[40,3],[3],[9,51,84,237,271,340],[10,52,85,334,272,341],[40,66,100,111,116,167,214,256,283,286,296,315,346,347,386,396,414,436],[154,154,154,154,154,154,154,362,154,154,154,362,154,154,154,154,154,154],W,W,U⟩) (L ⟨[10,52,78,85,154,167,226,244,272,286,296,302,328,331,334,341,351,362,372,383,396,414,429],W,W,[287],W,[9,51,73,84,140,176,237,241,271,301,340,370,397,430],[10,52,351,85,226,286,334,244,272,383,341,167,78,331],[40,66,87,100,111,116,152,167,170,188,214,256,275,283,286,291,296,298,315,346,347,365,367,386,396,414,420,436],[154,154,244,154,154,154,226,154,167,296,154,362,328,154,154,226,154,351,362,154,154,429,396,154,154,154,414,154],[298,365],[302,372],U⟩) +def m146 : BTree Mask:=X (L ⟨[5,10,15,45,46,47,49,50,52,85,90,102,106,110,115,126,130,131,147,157,175,178,179,184,186,201,220,223,240,247,249,259,260,263,272,274,287,289,295,303,317,321,326,330,332,334,341,349,355,357,358,361,392,398,399,405,407,409,423,424,427,431],W,W,W,[155],[5,6,9,13,51,58,68,78,84,89,92,101,105,106,117,122,126,147,167,175,219,220,226,237,239,244,259,266,270,271,286,288,289,296,313,314,328,329,330,331,340,343,351,355,356,358,371,383,391,392,396,399,405,409,411,414,423,428,429],[115,115,10,409,52,115,115,240,85,115,115,115,106,115,405,126,115,115,240,115,220,115,240,334,259,240,115,115,115,272,240,289,115,240,330,115,240,115,115,240,341,240,240,115,358,115,175,240,392,115,240,115,115,115,147,240,115,5,240],[36,40,66,100,111,115,116,125,153,167,174,214,238,240,245,256,283,286,296,315,336,346,347,386,388,396,414,422,436],[179,303,332,110,130,115,186,126,399,184,175,45,287,240,249,260,295,201,90,317,355,47,361,398,409,50,427,423,15],[4,6,7,11,14,17,19,20,21,23,25,31,33,42,44,61,62,63,64,65,72,77,81,82,87,97,99,103,107,114,120,124,128,129,139,144,145,148,150,152,158,160,161,166,172,173,175,181,182,183,185,192,196,197,198,204,205,210,215,216,217,221,225,231,246,251,254,261,265,266,267,275,276,280,282,284,291,293,294,304,307,311,316,318,324,325,329,330,333,335,339,344,352,355,360,364,368,369,373,379,380,387,389,395,401,403,409,410,417,418,419,421,423,425,426,432,435],[115,115,115,240,115,157,115,115,240,240,115,240,49,240,115,115,240,115,115,240,240,240,115,240,131,240,115,240,115,115,240,46,115,115,326,115,115,115,240,263,115,240,115,115,240,115,178,115,115,240,115,240,240,240,115,240,115,115,240,240,240,115,115,115,240,115,240,115,115,115,115,247,240,240,115,240,274,240,115,240,115,240,240,115,321,115,115,349,115,357,115,240,240,223,115,102,115,115,407,240,240,240,240,115,115,115,431,240,115,115,115,240,424,115,115,115,240],U⟩) m1 +def m147 : BTree Mask:=X (L ⟨[5,10,16,17,30,32,33,53,71,89,106,124,126,139,147,159,164,169,175,193,203,220,255,259,272,277,289,310,314,324,330,335,341,343,355,358,364,373,392,399,405,408,409,423],W,W,[95],W,[9,13,27,70,74,93,105,117,122,155,171,194,202,219,236,239,271,288,292,312,313,340,350,356,371,391,406,411,428,439],[10,139,30,71,364,277,106,405,126,169,193,164,203,220,255,259,272,289,16,335,330,341,32,358,175,392,408,147,5,33],[6,23,42,57,62,99,125,127,145,153,162,174,197,200,205,238,245,251,266,293,302,329,336,372,381,388,401,422,435],[124,17,17,159,17,124,126,324,124,399,124,175,17,53,124,314,314,124,124,17,139,124,355,373,159,409,124,423,17],[2,34,55,59,75,94,96,108,143,206,258,279,354,363],[310,310,310,343,310,310,343,310,89,310,89,310,310,310],U⟩) m1 +def m148 : BTree Mask:=X (L ⟨[78,167,226,244,286,296,328,331,351,383,396,414,429],[61],[11,31,110,84],[67,26,106,59,68],[3],[73,140,176,241,301,370,397,430],[351,226,286,244,383,167,78,331],[87,152,170,188,275,291,298,365,367,420],[244,226,167,296,328,226,351,429,396,414],W,W,U⟩) m1 +def m149 : BTree Mask:=X (L ⟨[17,33,87,124,139,152,170,175,188,275,291,298,324,330,335,355,364,365,367,373,409,420,423],W,W,[123],W,[13,74,312,313,371,439],[139,364,335,330,175,33],[6,23,42,62,78,99,127,145,162,167,174,197,205,226,244,251,266,286,293,296,302,328,329,331,336,351,372,383,388,396,401,414,422,429,435],[124,17,17,17,275,124,324,124,124,275,175,17,124,291,291,124,124,275,17,275,139,275,124,275,355,275,373,275,409,275,124,275,423,275,17],[3,89,109,191,248,250,343,413],[420,152,367,170,298,365,87,188],U⟩) m1 +def m150 : BTree Mask:=X (X m148 (X (L ⟨[170,532],[189],W,W,[199],W,W,W,W,[191,533],[170,532],U⟩) m1)) (X m149 (X (L ⟨[527],[253],[3],[254],[3],W,W,[538],[527],W,W,U⟩) m1)) +def m151 : BTree Mask:=X (X m132 (X m135 m138)) (X m144 (X (X (X m145 m146) (X m147 (X (L ⟨[510],[221],[3],[222],[3],W,W,[511],[510],W,W,U⟩) m1))) m150)) +def m152 : BTree Mask:=X (X (L ⟨W,[3],[3],[3],[3],W,W,W,W,W,W,U⟩) (L ⟨[524],[259],[3],[261],[3],W,W,[525],[524],W,W,U⟩)) (X (L ⟨[119],[131],W,W,[147],W,W,W,W,[402],[119],U⟩) m1) +def m153 : BTree Mask:=X (X (L ⟨[298,365],[67],W,[3],[87],W,W,W,W,[248,250],[298,365],U⟩) m1) (X (L ⟨[136],[195],[3],[200],[3],W,W,[227],[136],W,W,U⟩) m1) +def m154 : BTree Mask:=X (L ⟨[5,89,106,126,147,175,220,259,289,314,330,343,355,358,392,399,405,409,423],[35,80,163],[53,3],[54,77,3],[41],[13,105,117,122,219,239,288,313,356,371,391,411,428],[409,106,405,126,220,259,289,330,358,175,392,147,5],[125,153,174,238,245,336,388,422],[126,399,175,314,314,355,409,423],[59,96,143,258],[343,343,89,89],U⟩) m1 +def m155 : BTree Mask:=X (L ⟨[5,10,52,85,89,106,119,126,147,154,170,175,188,220,259,272,289,314,330,334,341,343,355,358,362,367,392,399,405,409,420,423],W,W,[97],W,[9,13,51,84,105,117,122,219,237,239,271,288,313,340,356,371,391,411,428],[10,409,52,85,106,405,126,220,334,259,272,289,330,341,358,175,392,147,5],[40,66,100,111,116,125,153,167,174,214,238,245,256,283,286,296,315,336,346,347,386,388,396,414,422,436],[154,154,154,154,154,126,399,154,175,154,314,314,362,154,154,154,362,355,154,154,154,409,154,154,423,154],[3,59,96,109,143,191,258,402,413],[420,343,343,367,89,170,89,119,188],U⟩) m1 +def m156 : BTree Mask:=X (X m154 (X (L ⟨[89],[163],W,W,[133],W,W,W,W,[143,258],[89,89],U⟩) m1)) (X m155 (X (L ⟨[480],[227],[3],[228],[3],W,W,[482],[480],W,W,U⟩) m1)) +def m157 : BTree Mask:=X (L ⟨[29,327],[19,71],[21,63],[19,71],[17,48,118],[10,16,30,32,53,71,159,164,169,193,203,255,272,277,310,341,408],[327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327],[29,327],[29,327],[21,24,40,56,66,91,97,100,111,112,116,135,167,172,177,190,213,214,224,243,252,280,283,286,290,296,300,304,316,320,344,346,347,366,382,385,386,396,414,421,436],[327,327,327,327,327,327,327,327,327,327,327,29,327,327,327,29,327,327,29,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327],U⟩) (L ⟨[6,23,40,42,57,62,66,87,99,100,111,116,127,145,152,162,167,170,174,188,197,200,205,214,235,251,256,266,275,283,286,291,293,296,298,302,315,329,336,346,347,365,367,372,381,386,388,396,401,414,420,422,435,436],W,W,[278],W,[8,26,60,69,73,86,98,104,118,121,142,149,165,176,199,211,218,262,269,278,285,338,353,370,390,404,415,433],[6,23,40,62,396,205,66,100,42,111,99,293,200,286,197,145,214,116,266,251,283,329,347,167,386,401,346,435],[10,16,17,30,32,33,52,53,71,78,85,119,124,139,154,159,164,167,169,170,175,188,193,203,226,244,255,272,277,286,296,310,324,328,330,331,334,335,341,351,355,362,364,367,373,383,396,408,409,414,420,423,429],[57,57,162,381,57,127,315,200,381,275,315,111,162,127,436,57,381,275,57,167,127,296,381,381,291,291,57,57,381,275,275,200,127,275,127,275,256,127,57,275,127,315,127,396,127,275,275,57,127,275,414,127,275],[3,89,109,170,188,191,248,250,268,298,343,365,367,413,420],[420,152,367,174,336,170,298,365,235,302,87,372,388,188,422],U⟩) +def m158 : BTree Mask:=X (L ⟨[13,26,69,105,117,118,122,149,199,219,239,288,313,356,371,391,411,428,433],[83,33],[86,25,131],[85,52,10],[30],[87,119,152,275,291],[149,69,199,199,199],[67,123,189,337,394,438],[149,69,199,118,433,26],[10,12,16,30,32,53,54,60,71,73,88,98,104,113,121,151,164,169,176,193,203,218,233,255,262,272,273,277,285,341,342,348,353,370,390,393,408,415],[199,149,199,149,199,199,199,239,149,13,199,117,105,199,122,199,149,199,313,149,149,219,149,199,411,199,149,149,288,199,149,199,356,371,391,199,199,428],U⟩) m1 +def m159 : BTree Mask:=X (X m157 (X (L ⟨[402],W,W,W,[146],W,W,W,W,[180],[402],U⟩) m1)) (X m158 (X (L ⟨[489],[211],[3],[223],[3],W,W,[512],[489],W,W,U⟩) m1)) +def m160 : BTree Mask:=X (L ⟨[48,83,123,337],[51,10],[54,3,77,67],[53,33,11,3],[6],[125,153,174,238,245,298,336,365,388,422],[123,123,123,123,123,83,123,83,123,123],[13,26,69,73,105,117,118,122,149,199,219,239,288,313,356,370,371,391,397,411,428,430,433],[123,337,123,83,123,123,337,123,337,337,123,123,123,123,123,83,123,123,48,123,123,83,337],[22,33,35,76,95,139,156,163,175,207,209,212,232,242,253,281,297,299,308,309,324,330,335,345,355,364,373,409,412,423],[123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123],U⟩) m1 +def m161 : BTree Mask:=X (L ⟨[9,155,236,271,292,340,350,406],W,W,W,[62],W,W,W,W,[8,86,142,211,269,278,338,404],[9,236,155,350,271,292,340,406],U⟩) m1 +def m162 : BTree Mask:=X (X m160 (X (L ⟨[36],[179],[3],[180],[3],W,W,[37],[36],W,W,U⟩) m1)) (X m161 (X (L ⟨[551],[243],[3],[246],[3],W,W,[553],[551],W,W,U⟩) m1)) +def m163 : BTree Mask:=X (L ⟨[73,370,397,430],[11,103],[23,66,3,122],[60,96,70,146,137,3],[16,89],[41,57,195,200,264,319,381],[397,370,397,370,397,397,370],[9,27,48,70,83,93,155,171,180,194,202,236,271,292,340,350,406],[370,73,397,73,430,73,370,73,397,73,73,370,370,370,370,370,370],[5,10,15,45,46,47,49,50,52,85,90,102,106,110,126,130,131,147,157,175,178,184,186,201,220,223,247,249,259,260,263,272,274,287,289,295,303,317,321,326,330,332,334,341,349,355,357,358,361,392,398,399,405,407,409,423,424,427,431],[397,73,370,370,397,370,397,370,370,370,370,397,397,370,397,370,73,397,397,397,397,370,370,370,397,397,370,397,397,370,370,73,370,397,397,370,370,370,397,397,397,370,73,73,397,397,397,397,370,397,370,397,397,397,397,397,397,370,397],U⟩) (L ⟨[542],[267],[3],[268],[3],W,W,[522],[542],W,W,U⟩) +def m164 : BTree Mask:=X (X (L ⟨[13,239,288,313,356,371,499],[75],[3],[237],[72,3],W,W,[500],[499],[60,73,176,285,353,370],[239,13,313,288,356,371],U⟩) m1) (X (L ⟨[305],W,W,[204],W,W,W,[375],[305],W,W,U⟩) m1) +def m165 : BTree Mask:=X (L ⟨[8,9,27,70,93,155,171,194,202,208,236,269,271,292,338,340,350,406],[43],[68,59,86],[32,84],[30],[87,152,170,188,275,291,367,420],[269,338,208,208,338,338,208,208],[73,140,176,241,301,370],[208,338,208,269,8,208],[8,10,12,16,26,30,32,53,54,69,71,86,88,113,118,142,149,151,164,169,193,199,203,211,233,255,269,272,273,277,278,338,341,342,348,393,404,408,433],[9,338,269,338,27,269,338,338,338,70,269,236,338,338,93,155,171,338,269,338,269,202,269,350,269,338,271,338,269,269,292,340,338,269,338,338,406,338,194],U⟩) m1 +def m166 : BTree Mask:=X (L ⟨[5,10,16,29,30,32,53,57,71,89,106,126,147,159,164,169,175,193,200,203,220,255,259,272,277,289,310,314,327,330,341,343,355,358,381,392,399,405,408,409,423],W,W,[174],W,[9,10,13,16,27,30,32,53,70,71,93,105,117,122,155,159,164,165,169,171,193,194,202,203,219,236,239,255,271,272,277,288,292,310,313,340,341,350,356,371,391,406,408,411,428],[10,327,409,327,30,327,327,327,71,327,277,106,405,126,169,327,327,200,327,193,327,164,203,327,220,255,259,327,272,327,327,289,16,327,330,341,327,32,358,175,392,408,327,147,5],[10,16,29,30,32,53,57,71,125,153,159,164,169,174,193,200,203,238,245,255,272,277,310,327,336,341,381,388,408,422],[57,57,29,381,57,200,159,381,126,399,57,381,57,175,381,53,381,314,314,57,57,381,200,327,355,57,159,409,57,423],[2,21,24,34,40,55,56,59,66,75,91,94,96,97,100,108,111,112,116,135,143,167,172,177,190,206,213,214,224,243,252,258,279,280,283,286,290,296,300,304,316,320,344,346,347,354,363,366,382,385,386,396,414,421,436],[310,327,327,310,327,310,327,343,327,310,327,310,343,327,327,310,327,327,327,29,89,327,327,327,29,310,327,327,29,327,327,89,310,327,327,327,327,327,327,327,327,327,327,327,327,310,310,327,327,327,327,327,327,327,327],U⟩) m1 +def m167 : BTree Mask:=X (X (L ⟨[67,180,189,394,438],W,W,W,[12,20,45,81],W,W,W,W,[43,165,187,323,437],[67,180,189,394,438],U⟩) m1) (X (L ⟨[493],[235],[3],[236],[3],W,W,[495],[493],W,W,U⟩) m1) +def m168 : BTree Mask:=X (L ⟨[41,87,152,195,264,275,291,319],[27,104],[3],[61,127,3],[80,3],W,W,[6,58,68,78,92,101,167,226,244,266,270,286,296,328,329,331,351,383,396,414,429],[264,319,41,275,319,319,275,291,291,264,264,275,275,275,264,275,275,275,275,275,275],[89,310,343],[152,195,87],U⟩) (L ⟨[18,43,51,84,115,138,179,187,240,323,437],W,W,W,W,[5,6,58,68,78,89,92,101,106,126,147,167,175,220,226,244,259,266,270,286,289,296,314,328,329,330,331,343,351,355,358,383,392,396,399,405,409,414,423,429],[115,115,115,115,43,115,115,115,115,115,115,43,115,115,43,43,115,115,115,43,115,43,115,43,115,115,43,240,43,115,115,43,115,43,115,115,115,43,115,43],[36,115,240],[179,115,240],[4,6,7,11,14,19,20,21,23,25,31,42,44,48,61,62,63,64,65,72,77,81,82,83,97,99,103,107,114,120,123,128,129,144,145,148,150,158,160,161,166,172,173,181,182,183,185,192,196,197,198,204,205,210,215,216,217,221,225,231,246,251,254,261,265,266,267,276,280,282,284,293,294,304,307,311,316,318,325,329,333,337,339,344,352,360,368,369,379,380,387,389,395,401,403,410,417,418,419,421,425,426,432,435],[115,115,115,43,115,115,115,43,240,115,43,240,115,51,115,240,115,115,43,43,43,115,43,84,43,115,43,115,115,43,138,115,115,115,115,115,43,115,43,115,115,43,115,115,115,43,115,240,43,240,115,43,115,115,43,43,43,115,115,115,43,115,43,115,115,115,115,43,43,115,43,240,115,43,115,43,43,115,115,115,115,18,115,43,43,115,115,115,43,43,43,43,115,115,115,43,115,115,115,43,115,115,115,240],U⟩) +def m169 : BTree Mask:=X (L ⟨[4,6,7,11,14,17,19,20,21,23,25,31,33,42,44,61,62,63,64,65,72,77,81,82,87,97,99,103,107,114,120,124,128,129,139,144,145,148,150,152,158,160,161,166,172,173,175,181,182,183,185,192,196,197,198,204,205,210,215,216,217,221,225,231,246,251,254,261,265,266,267,275,276,280,282,284,291,293,294,304,307,311,316,318,324,325,329,330,333,335,339,344,352,355,360,364,368,369,373,379,380,387,389,395,401,403,409,410,417,418,419,421,423,425,426,432,435],[155],[3],[158,187],[3,159],[8,13,26,43,69,74,86,118,142,149,165,187,199,211,269,278,312,313,323,338,371,404,433,437,439],[6,139,23,182,62,364,205,42,99,293,380,185,197,145,266,251,335,330,173,329,175,401,435,432,33],[5,6,10,16,17,23,30,32,33,42,53,62,71,78,89,99,106,124,126,127,139,145,147,159,162,164,167,169,174,175,193,197,203,205,220,226,244,251,255,259,266,272,277,286,289,293,296,302,310,314,324,328,329,330,331,335,336,341,343,351,355,358,364,372,373,383,388,392,396,399,401,405,408,409,414,422,423,429,435],[19,124,21,65,144,17,31,196,63,17,77,17,72,275,185,124,107,231,129,324,339,124,166,160,124,11,275,183,175,181,217,17,204,124,221,291,291,124,276,282,124,280,246,275,294,17,275,139,380,4,325,275,124,369,275,368,355,344,182,275,261,360,307,373,418,275,409,395,275,419,124,114,410,14,275,423,426,275,17],[6,23,40,42,58,62,66,68,89,92,99,100,101,111,116,125,127,145,162,167,197,205,214,251,256,266,270,283,286,293,296,315,329,343,346,347,386,396,401,414,435,436],[7,25,216,61,44,64,82,210,152,81,128,103,318,120,150,148,417,161,158,172,198,225,215,265,254,267,192,284,304,425,316,311,333,87,389,352,387,97,403,421,20,379],U⟩) m1 +def m170 : BTree Mask:=X (L ⟨[10,17,33,41,52,85,119,124,139,154,170,175,188,195,264,272,319,324,330,334,335,341,355,362,364,367,373,409,420,423],W,W,[94],W,[9,13,51,74,84,237,271,312,313,340,371,439],[10,139,52,364,85,334,272,335,330,341,175,33],[6,23,40,42,58,62,66,68,92,99,100,101,111,116,127,145,162,167,174,197,205,214,251,256,266,270,283,286,293,296,302,315,329,336,346,347,372,386,388,396,401,414,422,435,436],[124,17,154,17,319,17,154,41,319,124,154,319,154,154,324,124,124,154,175,17,124,154,124,362,124,264,154,154,17,154,139,362,124,355,154,154,373,154,409,154,124,154,423,17,154],[3,109,191,310,402,413],[420,367,170,195,119,188],U⟩) m1 +def m171 : BTree Mask:=X (L ⟨[87,152,170,188,275,291,367,420],[59,104],[3],[3,61],[112,80],W,W,[78,167,226,244,286,296,328,331,351,383,396,414,429],[275,275,291,291,275,275,275,275,275,275,275,275,275],[3,89,109,191,343,413],[420,152,367,170,87,188],U⟩) m1 +def m172 : BTree Mask:=X (L ⟨[5,10,16,30,32,53,71,89,106,126,147,159,164,169,175,193,203,220,255,259,272,277,289,310,314,330,341,343,355,358,392,399,405,408,409,423],W,W,[166],W,[9,13,27,70,93,105,117,122,155,171,194,202,219,236,239,271,288,292,313,340,350,356,371,391,406,411,428],[10,409,30,71,277,106,405,126,169,193,164,203,220,255,259,272,289,16,330,341,32,358,175,392,408,147,5],[57,125,153,174,200,238,245,336,381,388,422],[159,126,399,175,53,314,314,355,159,409,423],[2,34,55,59,75,94,96,108,143,206,258,279,354,363],[310,310,310,343,310,310,343,310,89,310,89,310,310,310],U⟩) m1 +def m173 : BTree Mask:=X (L ⟨[6,23,42,62,78,99,127,145,162,167,174,197,205,226,244,251,266,286,293,296,302,328,329,331,336,351,372,383,388,396,401,414,422,429,435],W,W,[125],W,[8,26,69,73,86,118,140,142,149,176,199,211,241,269,278,301,338,370,397,404,430,433],[6,23,62,351,205,42,226,99,293,286,197,145,244,266,251,383,329,167,78,401,331,435],[17,33,87,124,139,152,170,175,188,275,291,298,324,330,335,355,364,365,367,373,409,420,423],[162,127,244,162,127,226,167,127,296,328,226,351,127,127,127,127,127,429,396,127,127,414,127],[170,188,298,365,367,420],[174,336,302,372,388,422],U⟩) m1 +def m174 : BTree Mask:=X (X (X m168 m169) (X m170 (X (L ⟨[487],[219],[3],[220],[3],W,W,[496],[487],W,W,U⟩) m1))) (X (X m171 m172) (X m173 (X (L ⟨[518],[251],[3],[252],[3],W,W,[555],[518],W,W,U⟩) m1))) +def m175 : BTree Mask:=X (X (X (X m152 m153) m156) (X m159 m162)) (X (X (X (X m163 (X (L ⟨[28],W,W,[3],[64],W,W,W,W,[400],[28],U⟩) m1)) m164) (X (X m165 m166) m167)) m174) +def m176 : BTree Mask:=X (L ⟨[6,23,42,62,99,127,145,162,174,197,205,251,266,293,302,329,336,372,388,401,422,435],[7],[33,69,62],[34,3],[106,67],[8,26,69,86,118,142,149,199,211,269,278,338,404,433],[6,23,62,205,42,99,293,197,145,266,251,329,401,435],[17,33,124,139,175,324,330,335,355,364,373,409,423],[162,127,162,127,127,127,127,127,127,127,127,127,127],[170,188,298,365,367,420],[174,336,302,372,388,422],U⟩) (L ⟨[552],W,[265],[3],[3],[520],[552],W,W,W,W,U⟩) +def m177 : BTree Mask:=X (L ⟨[327],[71],W,W,[17],[10,16,30,32,53,71,159,164,169,193,203,255,272,277,310,341,408],[327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327],[327],[327],[21,24,40,56,66,91,97,100,111,112,116,167,172,177,213,214,243,252,280,283,286,290,296,300,304,316,320,344,346,347,366,382,385,386,396,414,421,436],[327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327],U⟩) m1 +def m178 : BTree Mask:=X (X m176 (X (L ⟨[302,372],W,W,W,[67],W,W,W,W,[298,365],[302,372],U⟩) m1)) (X m177 (X (L ⟨[191,533],W,W,W,[198],W,W,W,W,[189,536],[191,533],U⟩) m1)) +def m179 : BTree Mask:=X (L ⟨[10,15,45,47,50,52,85,90,110,115,130,131,184,186,201,240,247,260,263,272,274,295,303,317,332,334,341,361,398,427],W,[44],[40,98],[28],[5,6,9,51,58,68,78,84,89,92,101,106,126,147,167,175,220,226,237,244,259,266,270,271,286,289,296,314,328,329,330,331,340,343,351,355,358,383,392,396,399,405,409,414,423,429],[115,115,10,52,115,115,240,85,115,115,115,115,115,115,240,115,115,240,334,240,115,115,115,272,240,115,240,115,240,115,115,240,341,240,240,115,115,240,115,240,115,115,115,240,115,240],[40,66,100,111,115,116,167,214,240,256,283,286,296,315,346,347,386,396,414,436],[303,332,110,130,115,186,184,45,240,260,295,201,90,317,47,361,398,50,427,15],[4,6,7,11,14,19,20,21,23,25,31,42,44,61,62,63,64,65,72,77,81,82,87,97,99,103,107,114,120,128,129,144,145,148,150,152,158,160,161,166,172,173,181,182,183,185,192,196,197,198,204,205,210,215,216,217,221,225,231,246,251,254,261,265,266,267,275,276,280,282,284,291,293,294,304,307,311,316,318,325,329,333,339,344,352,360,368,369,379,380,387,389,395,401,403,410,417,418,419,421,425,426,432,435],[115,115,115,240,115,115,115,240,240,115,240,240,115,115,240,115,115,240,240,240,115,240,131,240,115,240,115,115,240,115,115,115,115,115,240,263,115,240,115,115,240,115,115,115,240,115,240,240,240,115,240,115,115,240,240,240,115,115,115,240,115,240,115,115,115,115,247,240,240,115,240,274,240,115,240,115,240,240,115,115,115,115,115,240,240,115,115,115,240,240,240,240,115,115,115,240,115,115,115,240,115,115,115,240],U⟩) m1 +def m180 : BTree Mask:=X (L ⟨[4,6,7,11,14,19,20,21,23,25,31,41,42,44,61,62,63,64,65,72,77,78,81,82,87,97,99,103,107,114,120,128,129,144,145,146,148,150,152,158,160,161,166,167,172,173,181,182,183,185,192,195,196,197,198,204,205,210,215,216,217,221,224,225,226,231,244,246,251,254,261,264,265,266,267,275,276,280,282,284,286,291,293,294,296,302,304,307,311,316,318,319,325,328,329,331,333,339,344,351,352,360,368,369,372,379,380,383,387,389,395,396,401,403,410,414,417,418,419,421,425,426,429,432,435],W,W,[170],W,[8,26,43,69,73,86,118,140,142,149,165,168,176,187,199,211,241,269,278,301,323,338,370,397,404,430,433,437],[6,23,182,62,351,205,42,226,99,293,380,146,286,185,197,145,244,266,251,383,173,329,167,78,401,331,435,432],[5,6,10,16,17,30,32,33,53,58,68,71,78,87,89,92,101,106,124,126,139,147,152,159,164,167,169,170,175,188,193,203,220,226,235,244,255,259,266,270,272,275,277,286,289,291,296,298,310,314,324,328,329,330,331,335,341,343,351,355,358,364,365,367,373,383,392,396,399,405,408,409,414,420,423,429],[19,264,21,65,144,31,196,63,77,319,41,72,275,244,185,319,319,107,231,129,339,166,226,160,11,275,183,167,181,296,217,204,221,291,224,291,276,282,264,264,280,328,246,275,294,226,275,351,380,4,325,275,264,369,275,368,344,182,275,261,360,307,429,396,418,275,395,275,419,114,410,14,275,414,426,275],[6,23,40,42,58,62,66,68,89,92,99,100,101,111,116,125,127,145,162,167,197,205,214,251,256,266,270,283,286,293,296,298,310,315,329,343,346,347,365,386,396,401,414,435,436],[7,25,216,61,44,64,82,210,152,81,128,103,318,120,150,148,417,161,158,172,198,225,215,265,254,267,192,284,304,425,316,302,195,311,333,87,389,352,372,387,97,403,421,20,379],U⟩) m1 +def m181 : BTree Mask:=X (L ⟨[370],[103],[23],[115],[105],[57,200,381],[370,370,370],[9,155,236,271,292,340,350,406],[370,370,370,370,370,370,370,370],[15,45,47,50,52,85,90,110,130,184,186,201,247,260,263,274,295,303,317,332,361,398,427],[370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370],U⟩) m1 +def m182 : BTree Mask:=X (L ⟨[57,200,381],[23],[20],[21,63],[3],[165],[200],[10,16,30,32,53,71,159,164,169,193,203,255,272,277,310,341,408],[57,57,381,57,200,381,57,381,57,381,381,57,57,381,200,57,57],W,W,U⟩) (L ⟨[10,16,30,32,53,71,87,152,159,164,169,170,188,193,203,255,272,275,277,291,298,310,341,365,367,408,420],W,W,[276],W,[9,27,70,93,155,171,194,202,236,271,292,340,350,406],[10,30,71,277,169,193,164,203,255,272,16,341,32,408],[57,78,167,200,226,244,286,296,328,331,351,381,383,396,414,429],[159,275,275,53,291,291,275,275,275,275,275,159,275,275,275,275],[2,3,34,55,75,89,94,108,109,191,206,248,250,279,343,354,363,413],[310,420,310,310,310,152,310,310,367,170,310,298,365,310,87,310,310,188],U⟩) +def m183 : BTree Mask:=X (L ⟨[73,140,168,176,241,301,370,397,430],[151],[122],[165],[152,157],[41,57,195,200,264,319,381],[397,370,397,370,397,397,370],[8,9,27,48,70,83,93,155,171,180,194,202,208,236,269,271,292,338,340,350,406],[301,370,73,397,73,430,73,370,73,397,73,73,176,370,301,370,370,301,370,370,370],[5,10,15,45,46,47,49,50,52,85,90,102,106,110,115,126,130,131,147,157,175,178,179,184,186,201,220,223,240,247,249,259,260,263,272,274,287,289,295,303,317,321,326,330,332,334,341,349,355,357,358,361,392,398,399,405,407,409,423,424,427,431],[397,73,370,370,397,370,397,370,370,370,370,397,397,370,140,397,370,73,397,397,397,397,168,370,370,370,397,397,241,370,397,397,370,370,73,370,397,397,370,370,370,397,397,397,370,73,73,397,397,397,397,370,397,370,397,397,397,397,397,397,370,397],U⟩) m1 +def m184 : BTree Mask:=X (X (L ⟨[248,250],W,W,W,[84],W,W,W,W,[140,241],[250,248],U⟩) m1) (X (L ⟨[506],[215],[3],[216],[3],W,W,[507],[506],W,W,U⟩) m1) +def m185 : BTree Mask:=X (L ⟨[5,89,106,126,147,175,220,259,289,314,330,355,358,392,399,405,409,423],[55],[53,3],[54,77,3],[133],[13,105,117,122,219,239,288,313,356,371,391,411,428],[409,106,405,126,220,259,289,330,358,175,392,147,5],[125,153,174,238,245,336,388,422],[126,399,175,314,314,355,409,423],[143,258],[89,89],U⟩) m1 +def m186 : BTree Mask:=X (L ⟨[87,152,170,188,235,275,291,298,365,367,420],[119],W,[61],[3,156],W,W,[78,167,226,244,286,296,328,331,351,383,396,414,429],[275,275,291,291,275,275,275,275,275,275,275,275,275],[3,89,109,191,248,250,268,343,413],[420,152,367,170,298,365,235,87,188],U⟩) m1 +def m187 : BTree Mask:=X (X m185 (X (L ⟨[137,141],W,[195],[3],[182],[136],[141],W,W,[141],[137],U⟩) m1)) (X m186 (X (L ⟨[526],[247],[3],[248],[3],W,W,[535],[526],W,W,U⟩) m1)) +def m188 : BTree Mask:=X (X m178 (X (X m179 m180) (X m181 (X (L ⟨[488],[231],[3],[232],[3],W,W,[490],[488],W,W,U⟩) m1)))) (X (X (X m182 m183) m184) m187) +def m189 : BTree Mask:=X (L ⟨[115,240],[15],[35,55,61,80,90,3,36,56],[15,3],[22,47,78,3],[5,6,58,68,78,89,92,101,106,126,147,167,175,220,226,244,259,266,270,286,289,296,314,328,329,330,331,343,351,355,358,383,392,396,399,405,409,414,423,429],[115,115,115,115,240,115,115,115,115,115,115,240,115,115,240,240,115,115,115,240,115,240,115,240,115,115,240,240,240,115,115,240,115,240,115,115,115,240,115,240],[115,240],[115,240],[4,6,7,11,14,19,20,21,23,25,31,42,44,61,62,63,64,65,72,77,81,82,97,99,103,107,114,120,128,129,144,145,148,150,158,160,161,166,172,173,181,182,183,185,192,196,197,198,204,205,210,215,216,217,221,225,231,246,251,254,261,265,266,267,276,280,282,284,293,294,304,307,311,316,318,325,329,333,339,344,352,360,368,369,379,380,387,389,395,401,403,410,417,418,419,421,425,426,432,435],[115,115,115,240,115,115,115,240,240,115,240,240,115,115,240,115,115,240,240,240,115,240,240,115,240,115,115,240,115,115,115,115,115,240,115,240,115,115,240,115,115,115,240,115,240,240,240,115,240,115,115,240,240,240,115,115,115,240,115,240,115,115,115,115,240,240,115,240,240,115,240,115,240,240,115,115,115,115,115,240,240,115,115,115,240,240,240,240,115,115,115,240,115,115,115,240,115,115,115,240],U⟩) (L ⟨[530],[271],[3],[241],[3],W,W,[545],[530],W,W,U⟩) +def m190 : BTree Mask:=X (L ⟨[8,26,69,86,118,142,149,165,199,211,269,278,338,404,433],W,W,[3],[30],[10,16,30,32,53,71,87,119,152,159,164,169,170,188,193,203,255,272,275,277,291,310,341,367,408,420],[165,165,165,165,165,165,149,69,199,165,165,165,278,86,165,165,165,165,199,165,199,165,165,142,165,211],[29,67,73,123,140,176,189,241,301,327,337,370,394,438],[165,149,142,69,338,404,199,269,8,165,118,278,433,26],[10,12,16,21,24,30,32,40,53,54,56,66,71,88,91,97,100,111,112,113,116,151,164,167,169,172,177,193,203,213,214,233,243,252,255,272,273,277,280,283,286,290,296,300,304,316,320,341,342,344,346,347,348,366,382,385,386,393,396,408,414,421,436],[199,149,199,165,165,149,199,165,199,199,165,165,149,199,165,165,165,165,165,199,165,199,149,165,199,165,165,149,149,165,165,149,165,165,199,199,149,149,165,165,165,165,165,165,165,165,165,199,149,165,165,165,199,165,165,165,165,199,165,199,165,165,165],U⟩) m1 +def m191 : BTree Mask:=X (X m189 (X (L ⟨[230,463],W,W,W,[142],W,W,W,W,[222,469],[230,463],U⟩) m1)) (X m190 (X (L ⟨[378],W,W,[207],W,W,W,[378],[378],W,W,V⟩) m1)) +def m192 : BTree Mask:=X (L ⟨[4,7,14,19,20,25,61,64,107,114,128,129,148,158,161,166,173,181,182,185,198,221,225,261,265,267,282,294,333,360,369,395,403,417,419,425,426,432],W,[45,81],[35,55,80],[57,3],[43,187,323,437],[182,185,173,432],[5,89,106,126,147,175,220,259,289,314,330,343,355,358,392,399,405,409,423],[19,185,107,129,166,181,221,282,294,4,369,182,261,360,395,419,114,14,426],[6,23,42,62,99,125,127,145,162,197,205,251,266,293,329,401,435],[7,25,61,64,128,148,417,161,158,198,225,265,267,425,333,403,20],U⟩) m1 +def m193 : BTree Mask:=X (L ⟨[10,17,33,40,52,66,85,100,111,115,116,119,124,139,154,167,170,175,188,214,240,256,272,283,286,296,315,324,330,334,335,341,346,347,355,362,364,367,373,386,396,409,414,420,423,436],W,W,[177],W,[5,6,9,13,51,58,60,68,73,74,78,84,89,92,98,101,104,106,121,126,147,167,175,176,218,220,226,237,244,259,262,266,270,271,285,286,289,296,312,313,314,328,329,330,331,340,343,351,353,355,358,370,371,383,390,392,396,399,405,409,414,415,423,429,439],[115,115,10,139,52,115,40,115,396,364,240,85,115,115,66,115,100,115,111,115,115,240,115,286,214,115,240,334,240,115,116,115,115,272,283,240,115,240,335,330,115,240,115,115,240,341,240,240,347,115,115,167,175,240,386,115,240,115,115,115,240,346,115,240,33],[6,10,23,40,42,52,62,66,85,99,100,111,115,116,119,127,145,154,162,167,170,174,188,197,205,214,240,251,256,266,272,283,286,293,296,302,315,329,334,336,341,346,347,362,367,372,386,388,396,401,414,420,422,435,436],[124,256,17,154,17,315,17,154,315,124,154,154,115,154,111,324,124,436,124,154,167,175,296,17,124,154,240,124,362,124,256,154,154,17,154,139,362,124,256,355,256,154,154,315,396,373,154,409,154,124,154,414,423,17,154],[3,4,6,7,11,14,19,20,21,23,25,31,42,44,61,62,63,64,65,72,77,81,82,97,99,103,107,109,114,120,128,129,144,145,148,150,158,160,161,166,172,173,181,182,183,185,191,192,196,197,198,204,205,210,215,216,217,221,225,231,246,251,254,261,265,266,267,276,280,282,284,293,294,304,307,311,316,318,325,329,333,339,344,352,360,368,369,379,380,387,389,395,401,402,403,410,413,417,418,419,421,425,426,432,435],[420,115,115,115,240,115,115,115,240,240,115,240,240,115,115,240,115,115,240,240,240,115,240,240,115,240,115,367,115,240,115,115,115,115,115,240,115,240,115,115,240,115,115,115,240,115,170,240,240,240,115,240,115,115,240,240,240,115,115,115,240,115,240,115,115,115,115,240,240,115,240,240,115,240,115,240,240,115,115,115,115,115,240,240,115,115,115,240,240,240,240,115,115,119,115,240,188,115,115,115,240,115,115,115,240],U⟩) m1 +def m194 : BTree Mask:=X (X (L ⟨[3,109,191,248,250,413],W,W,W,[108],W,W,W,W,[67,140,189,241,394,438],[109,250,191,248,413,3],U⟩) m1) (X (L ⟨[481],W,W,W,[210],W,W,W,W,[505],[481],U⟩) m1) +def m195 : BTree Mask:=X (L ⟨[73,176,301,370,397,430],[31,103,11],[23,3,66],[42,96,3],[16,89],[41,57,195,200,264,319,381],[397,370,397,370,397,397,370],[8,9,27,48,70,83,93,155,171,180,194,202,208,236,269,271,292,338,340,350,406],[301,370,73,397,73,430,73,370,73,397,73,73,176,370,301,370,370,301,370,370,370],[5,10,15,45,46,47,49,50,52,85,90,102,106,110,126,130,131,147,157,175,178,184,186,201,220,223,247,249,259,260,263,272,274,287,289,295,303,317,321,326,330,332,334,341,349,355,357,358,361,392,398,399,405,407,409,423,424,427,431],[397,73,370,370,397,370,397,370,370,370,370,397,397,370,397,370,73,397,397,397,397,370,370,370,397,397,370,397,397,370,370,73,370,397,397,370,370,370,397,397,397,370,73,73,397,397,397,397,370,397,370,397,397,397,397,397,397,370,397],U⟩) (L ⟨[40,66,87,100,111,116,152,167,170,188,214,256,275,283,286,291,296,298,315,346,347,365,367,386,396,414,420,436],W,W,[289],W,[60,73,98,104,121,176,218,262,285,353,370,390,415],[40,396,66,100,111,286,214,116,283,347,167,386,346],[10,52,78,85,119,154,167,170,188,226,244,272,286,296,328,331,334,341,351,362,367,383,396,414,420,429],[256,315,275,315,111,436,275,167,296,291,291,256,275,275,275,275,256,256,275,315,396,275,275,275,414,275],[3,89,109,191,248,250,343,413],[420,152,367,170,298,365,87,188],U⟩) +def m196 : BTree Mask:=X (L ⟨[6,23,40,42,58,62,66,68,89,92,99,100,101,111,116,125,127,145,162,167,197,205,214,251,256,266,270,283,286,293,296,315,329,343,346,347,386,396,401,414,435,436],W,W,W,W,[8,26,48,60,69,73,83,86,98,104,118,121,142,149,176,180,199,208,211,218,262,269,278,285,338,353,370,390,404,415,433],[6,23,58,40,62,396,92,205,66,100,42,111,99,293,286,68,197,270,145,214,116,266,251,283,329,347,167,386,401,346,435],[10,17,33,41,52,85,119,124,139,154,170,175,188,195,264,272,319,324,330,334,335,341,355,362,364,367,373,409,420,423],[256,162,127,68,315,315,111,162,127,436,167,127,296,68,101,256,101,127,127,256,127,256,127,315,127,396,127,127,414,127],[59,96,119,143,258],[343,343,125,89,89],U⟩) m1 +def m197 : BTree Mask:=X (L ⟨[6,23,42,57,62,99,125,127,145,153,162,174,197,200,205,238,245,251,266,293,302,329,336,372,381,388,401,422,435],W,W,[93],W,[8,26,69,86,115,118,142,149,165,199,211,240,269,278,338,404,433],[6,23,62,205,238,42,99,293,200,197,145,245,266,251,329,401,435],[5,10,16,17,30,32,33,53,71,89,106,124,126,139,147,159,164,169,175,193,203,220,255,259,272,277,289,310,314,324,330,335,341,343,355,358,364,373,392,399,405,408,409,423],[153,57,57,162,381,57,127,200,381,238,153,162,153,127,153,57,381,57,127,381,381,153,57,153,57,381,153,200,238,127,127,127,57,245,127,153,127,127,153,153,153,57,127,127],[119,170,188,298,365,367,420],[125,174,336,302,372,388,422],U⟩) m1 +def m198 : BTree Mask:=X (L ⟨[5,6,9,13,51,58,68,78,84,89,92,101,105,106,117,122,126,147,167,175,219,220,226,237,239,244,259,266,270,271,286,288,289,296,313,314,328,329,330,331,340,343,351,355,356,358,371,383,391,392,396,399,405,409,411,414,423,428,429],W,W,W,W,[8,13,48,73,83,105,117,122,140,176,180,208,219,239,241,269,288,301,313,338,356,370,371,391,397,411,428,430],[6,409,58,351,92,106,405,126,226,286,68,270,220,259,244,266,289,383,330,329,358,167,175,392,78,147,5,331],[41,87,125,152,153,170,174,188,195,238,245,264,275,291,298,319,336,365,367,388,420,422],[68,244,126,226,399,167,175,296,68,314,314,101,328,226,351,101,355,429,396,409,414,423],[8,48,59,60,73,83,96,98,104,121,143,176,208,218,258,262,269,285,338,353,370,390,415],[9,51,343,239,13,84,343,117,105,122,89,313,237,219,89,411,271,288,340,356,371,391,428],U⟩) m1 +def m199 : BTree Mask:=X (X (L ⟨[310],[63],W,W,[65,8],W,W,W,W,[2,34,55,75,94,108,206,279,354,363],[310,310,310,310,310,310,310,310,310,310],U⟩) m1) m198 +def m200 : BTree Mask:=X (L ⟨[6,58,68,78,92,101,167,226,244,266,270,286,296,328,329,331,351,383,396,414,429],W,W,[129],W,[8,48,73,83,140,176,180,208,241,269,301,338,370,397,430],[6,58,351,92,226,286,68,270,244,266,383,329,167,78,331],[41,87,152,170,188,195,264,275,291,298,319,365,367,420],[68,244,226,167,296,68,101,328,226,351,101,429,396,414],W,W,U⟩) m1 +def m201 : BTree Mask:=X (X (X m195 m196) (X m197 (X (L ⟨[512],[223],[3],[231],[3],W,W,[488],[512],W,W,U⟩) m1))) (X m199 (X m200 (X (L ⟨[517],[255],[3],[256],[3],W,W,[519],[517],W,W,U⟩) m1))) +def m202 : BTree Mask:=X (X (X m113 (X (X m116 m119) m126)) m151) (X m175 (X m188 (X (X m191 (X (X m192 m193) m194)) m201))) +def masksTree : BTree Mask:=X (X m49 (X (X m61 m74) (X (X (X m77 (X (X m78 m79) m80)) (X m83 m86)) m99))) m202 +def y0 : BTree (List Nat):=X Z (X (X (L [2]) Z) Z) +def y1 : BTree (List Nat):=X (X (X (X (X (X (L [0]) Z) Z) Z) y0) Z) (X (X (X (X (X (L [1]) Z) Z) Z) Z) Z) +def y2 : BTree (List Nat):=X (X Z (X Z (X Z (L [5])))) (X (X (X (L [2]) Z) (X Z (L [3]))) Z) +def y3 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [2]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [2])))) +def y4 : BTree (List Nat):=X (X (X Z (X Z (L [2]))) Z) (X (X (X Z (L [2])) (X (L [2]) (L [3]))) Z) +def y5 : BTree (List Nat):=X (X (X Z (X (X Z (X Z (L [3]))) (X (X (L [4]) Z) Z))) y2) (X y3 y4) +def y6 : BTree (List Nat):=L [19,20] +def y7 : BTree (List Nat):=L [9,10] +def y8 : BTree (List Nat):=L [31,9,32] +def y9 : BTree (List Nat):=L [24,25,26,27,28] +def y10 : BTree (List Nat):=X (X (X (X (L [6]) y6) (X y7 Z)) (X (X (L [11]) (L [15])) (X (L [15]) (L [35])))) (X (X (X Z y8) (X (L [22]) Z)) (X (X (L [17,18]) y7) (X y9 (L [37,22,7])))) +def y11 : BTree (List Nat):=X (X Z y6) (X y6 Z) +def y12 : BTree (List Nat):=X (X (X (X y7 Z) (X y6 (L [11]))) (X (X (L [16]) y8) Z)) (X y11 (X (X (L [20,19]) Z) (X (L [30,21]) Z))) +def y13 : BTree (List Nat):=L [12,13,14,15] +def y14 : BTree (List Nat):=X (X (X (X (L [7,8]) (L [15])) Z) Z) (X (X (X y13 Z) Z) (X (X y6 (L [34])) (X (L [29]) Z))) +def y15 : BTree (List Nat):=X (X (X (X (L [11]) Z) (X (L [15]) Z)) (X (X Z (L [33])) (X (L [23]) (L [36])))) (X (X (X y7 Z) Z) (X (X (L [21]) Z) Z)) +def y16 : BTree (List Nat):=X (X y10 y12) (X y14 y15) +def y17 : BTree (List Nat):=L [16,38,39] +def y18 : BTree (List Nat):=L [15,45] +def y19 : BTree (List Nat):=L [11,9,32] +def y20 : BTree (List Nat):=L [42,33,43] +def y21 : BTree (List Nat):=L [14,12,13,15,46] +def y22 : BTree (List Nat):=X (X (X (X y17 y18) (X y19 Z)) (X (X y20 y21) (X y21 Z))) (X (X Z (X (L [47]) Z)) (X (X (L [44,22]) y19) Z)) +def y23 : BTree (List Nat):=X (X Z y18) (X y18 Z) +def y24 : BTree (List Nat):=X (X (X (X y19 Z) (X y18 y20)) (X (X (L [30]) Z) Z)) (X y23 (X (X y18 Z) Z)) +def y25 : BTree (List Nat):=X (X (X (X y20 Z) (X y21 Z)) Z) (X (X (X y19 Z) Z) (X (X (L [35]) Z) Z)) +def y26 : BTree (List Nat):=X (X y22 y24) (X (X (X (X (X (L [40,41]) y21) Z) Z) (X Z (X (X y18 (L [29])) Z))) y25) +def y27 : BTree (List Nat):=L [51,52,9] +def y28 : BTree (List Nat):=L [19,20,50] +def y29 : BTree (List Nat):=X (X y18 (L [11])) (X (L [11]) (L [23])) +def y30 : BTree (List Nat):=L [15,45,58] +def y31 : BTree (List Nat):=X (X (X (X (L [48]) y27) (X y28 Z)) y29) (X (X (X Z y30) (X (L [16]) Z)) (X (X (L [9]) y28) (X (L [56]) (L [16,38,39,29])))) +def y32 : BTree (List Nat):=X (X (X (X y28 Z) (X y27 y18)) (X (X (L [22]) y30) Z)) (X (X (X Z y27) (X y27 Z)) (X (X (L [53]) Z) (X (L [54,47]) Z))) +def y33 : BTree (List Nat):=X (X (X (L [49]) (L [11])) Z) Z +def y34 : BTree (List Nat):=X (X y18 Z) (X (L [11]) Z) +def y35 : BTree (List Nat):=L [25,24,27,28,59] +def y36 : BTree (List Nat):=X (X y34 (X (X Z y21) (X (L [55]) y35))) (X (X (X y28 Z) Z) (X (X (L [54]) Z) Z)) +def y37 : BTree (List Nat):=X (X y31 y32) (X (X y33 (X (X (X y19 Z) Z) (X (X y27 (L [40])) (X (L [7,57]) Z)))) y36) +def y38 : BTree (List Nat):=L [42,43,62] +def y39 : BTree (List Nat):=X (X (X (X (L [22]) (L [11])) (X (L [15]) (L [65]))) (X (X Z y38) (X y38 (L [54])))) (X (X (X Z y6) (X (L [30]) (L [66,6,54]))) (X (X (L [33]) (L [15])) (X (L [61]) (L [34,6])))) +def y40 : BTree (List Nat):=X (X (L [15]) Z) (X (L [11]) Z) +def y41 : BTree (List Nat):=X (X y40 (X (X Z y6) (X Z (L [6])))) (X (X (X y27 (L [11])) (X (L [11]) (L [66,34,54]))) (X (X (L [60]) y28) (X (L [22,23]) Z))) +def y42 : BTree (List Nat):=X (X (X (X (L [3]) y38) (X y28 (L [48]))) (X (X y27 Z) (X Z (L [36,66,7,34,35,54])))) (X (X (X y7 y28) (X y28 (L [36,7,35]))) (X (X (L [11]) (L [7])) (X (L [40]) y27))) +def y43 : BTree (List Nat):=X (X (X Z (X y38 y27)) (X (X y28 (L [15])) (X (L [21]) (L [66])))) (X (X (X (L [15]) y27) (X y27 (L [36,7,35]))) (X (X (L [23,61]) (L [63,64])) (X y28 Z))) +def y44 : BTree (List Nat):=X (X y39 y41) (X y42 y43) +def y45 : BTree (List Nat):=L [51,52,9,73] +def y46 : BTree (List Nat):=L [51,52,9,11] +def y47 : BTree (List Nat):=X (X (L [19,20,15,45,50]) y46) (X y46 (L [40,23])) +def y48 : BTree (List Nat):=L [11,32,72] +def y49 : BTree (List Nat):=X (X y18 (X (L [6,16]) (L [66,6,29,30,67,79,59]))) (X (X y48 y6) (X (L [36,55]) (L [25,24,27,28,16,38,39,29,59]))) +def y50 : BTree (List Nat):=L [51,69,42,70,43] +def y51 : BTree (List Nat):=L [20,71] +def y52 : BTree (List Nat):=X (X (X (X y6 y18) (X y45 (L [19,20,15,45,50]))) (X (X (L [22,48]) y18) (X (L [16]) (L [6,30,79])))) (X (X (X y50 y45) (X y45 (L [3]))) (X (X (L [53,74,18,75]) y51) (X (L [7,54,57,47,78]) Z))) +def y53 : BTree (List Nat):=X (X (X (X (L [67,68]) y46) (X y51 (L [17]))) (X (X y50 (L [11])) (X (L [11]) (L [3])))) (X (X (X y19 y51) (X y51 (L [3]))) (X (X y45 (L [40,61])) (X (L [7,57,56]) y50))) +def y54 : BTree (List Nat):=X (X (X (L [19,20,15,45,50]) (L [11])) (X y46 y50)) (X (X y51 (L [15,45,46,58])) (X (L [35,34]) (L [25,24,27,28,23,59]))) +def y55 : BTree (List Nat):=X y53 (X y54 (X (X (X y6 y50) (X y50 (L [3]))) (X (X (L [76,77]) (L [63])) (X y51 Z)))) +def y56 : BTree (List Nat):=X (X (X (X (X (X (L [17]) y45) (X y6 (L [8]))) y47) y49) y52) y55 +def y57 : BTree (List Nat):=L [42,82,43,83,69] +def y58 : BTree (List Nat):=L [15,81] +def y59 : BTree (List Nat):=X Z (X Z (L [37,90,22])) +def y60 : BTree (List Nat):=L [94,90,95] +def y61 : BTree (List Nat):=X (X (X (X y58 Z) (X y57 Z)) (X Z (X Z (L [22])))) (X (X (X y18 y57) (X y57 y60)) (X (X (L [84,85]) y48) Z)) +def y62 : BTree (List Nat):=X (X (X (X (X (L [47]) y57) (X y58 (L [87,88]))) Z) (X y59 (X (X y18 y58) Z))) y61 +def y63 : BTree (List Nat):=X (X y18 Z) (X Z (L [91,92,94,93,90,95])) +def y64 : BTree (List Nat):=L [91,92,93] +def y65 : BTree (List Nat):=X (X (X (X (L [80]) Z) (X y48 (L [89]))) y63) (X (X (X Z y48) (X y48 y64)) (X (X y57 Z) (X Z y18))) +def y66 : BTree (List Nat):=X (X (X Z (X Z y18)) (X (X y48 Z) Z)) (X (X (X y58 y18) (X y18 y64)) (X (X (L [86]) (L [67,68])) (X y48 Z))) +def y67 : BTree (List Nat):=X y62 (X y65 y66) +def y68 : BTree (List Nat):=X (X Z (X Z (L [3]))) Z +def y69 : BTree (List Nat):=X y68 (X (X Z (X Z (L [57,36,47]))) (X (X (L [3]) Z) Z)) +def y70 : BTree (List Nat):=X Z (X Z (X Z (L [47]))) +def y71 : BTree (List Nat):=L [34,66,35] +def y72 : BTree (List Nat):=X (X (X (X (L [3]) Z) (X y57 (L [30]))) (X (X y58 Z) (X Z (L [34,66,7,35,36,54])))) (X (X (X Z y57) (X y57 y71)) (X Z (X Z y58))) +def y73 : BTree (List Nat):=X (X (X Z (X Z y58)) (X (X y57 Z) Z)) (X (X (X Z y58) (X y58 y71)) (X (X (L [29]) (L [3])) (X y57 Z))) +def y74 : BTree (List Nat):=X (X y69 (X y70 (X (X (X y58 Z) (X Z (L [7,36,54]))) (X (X (L [3]) y57) Z)))) (X y72 y73) +def y75 : BTree (List Nat):=X (X (X (L [22]) y48) (X y18 (L [8]))) (X (X y58 (L [11,42,33,32,43,72,62])) (X (L [11,42,33,32,43,72,62]) (L [7,54,57]))) +def y76 : BTree (List Nat):=X (X (X y58 y6) (X (L [89,30]) (L [24,16,28,66,23,39,54,6]))) (X (X y57 y18) (X (L [21,61]) (L [34,66,6]))) +def y77 : BTree (List Nat):=L [31,9,32,10] +def y78 : BTree (List Nat):=X (X (X y77 y48) (X y48 (L [99,66,23,100,54,34]))) (X (X (L [44,96,74]) y6) (X (L [22,17,40,23]) Z)) +def y79 : BTree (List Nat):=X (X y75 y76) (X (X (X (X y18 y58) (X y48 y58)) (X (X (L [47]) y6) (X (L [30]) (L [16,39,6])))) y78) +def y80 : BTree (List Nat):=X (X (X (L [3]) (L [11,42,33,32,43,72,62])) (X y6 (L [17]))) (X (X y77 y57) (X y57 (L [36,21,98,35,66,7,23,100,54,34]))) +def y81 : BTree (List Nat):=X y80 (X (X (X y7 y6) (X y6 (L [97,36,21,98,35,7]))) (X (X y48 (L [7,57,36])) (X (L [61,40]) y77))) +def y82 : BTree (List Nat):=L [15,19,20] +def y83 : BTree (List Nat):=X (X (X (X y58 y57) (X (L [11,42,33,32,43,72,62]) y77)) (X (X y6 y82) (X (L [29,21]) (L [66,54])))) (X (X (X y18 y77) (X y77 (L [97,36,21,98,35,7]))) (X (X (L [40,76,23]) (L [63])) (X y6 Z))) +def y84 : BTree (List Nat):=X y79 (X y81 y83) +def y85 : BTree (List Nat):=X (X Z y18) (X (L [16]) Z) +def y86 : BTree (List Nat):=X (X (X (X (L [17]) y27) (X y6 Z)) y29) (X y85 (X (X (L [9]) y6) (X (L [36]) (L [16,38,39,29])))) +def y87 : BTree (List Nat):=X (X (X (X y6 Z) (X y27 y18)) (X (X (L [22]) y18) Z)) (X (X (X Z y27) (X y27 Z)) (X (X (L [53]) Z) (X (L [54,47]) Z))) +def y88 : BTree (List Nat):=X (X (X y6 Z) Z) (X (X (L [54]) Z) Z) +def y89 : BTree (List Nat):=X (X y33 (X (X (X y19 Z) Z) (X (X y27 (L [40])) (X (L [7,57]) Z)))) (X (X y34 (X (X Z y21) (X (L [35]) y35))) y88) +def y90 : BTree (List Nat):=X (X y86 y87) y89 +def y91 : BTree (List Nat):=X (X Z y6) (X (L [30]) Z) +def y92 : BTree (List Nat):=X (X (X (X (L [22]) y48) (X y18 Z)) (X (X y58 y57) (X y57 (L [54])))) (X y91 (X (X (L [69]) y18) (X (L [61]) (L [34,6])))) +def y93 : BTree (List Nat):=X (X (L [96]) Z) (X (L [22,23]) Z) +def y94 : BTree (List Nat):=X (X (X (X y18 Z) (X y48 y58)) (X (X (L [47]) y6) Z)) (X (X (X Z y48) (X y48 Z)) y93) +def y95 : BTree (List Nat):=X (X (X (X (L [3]) y57) Z) Z) (X (X (X y7 Z) Z) (X (X y48 (L [7,57])) (X (L [40]) Z))) +def y96 : BTree (List Nat):=X (X Z (L [15])) (X (L [21]) (L [66])) +def y97 : BTree (List Nat):=X (X (X (X y58 Z) (X y57 Z)) y96) (X (X (X y18 Z) Z) (X (X (L [23]) Z) Z)) +def y98 : BTree (List Nat):=X (X y92 y94) (X y95 y97) +def y99 : BTree (List Nat):=X (X Z (X Z (L [3]))) (X (X y7 y6) (X y6 (L [34]))) +def y100 : BTree (List Nat):=X (X (L [3]) Z) (X (L [23]) (L [36])) +def y101 : BTree (List Nat):=X (X Z (L [11])) (X Z y7) +def y102 : BTree (List Nat):=X (X y21 Z) (X Z (L [7,36,54])) +def qa2 : BTree (List Nat):=L [42,33,43,62] +def y104 : BTree (List Nat):=X (X y101 (X (X (L [6]) Z) (X (L [22]) (L [47])))) (X y102 (X (X (L [3]) qa2) (X (L [16,29,38,39]) Z))) +def y105 : BTree (List Nat):=X (X (X (X (L [3]) y6) (X qa2 (L [30]))) (X (X y21 (L [15])) (X (L [15]) (L [34,66,7,35,36,54])))) (X (X (X Z qa2) (X qa2 y71)) (X (X Z (L [66])) (X y9 y21))) +def y106 : BTree (List Nat):=X (X Z y21) (X y21 y71) +def y107 : BTree (List Nat):=X (X (X (X y7 (L [15])) (X y6 y21)) (X (X qa2 y8) (X (L [40]) (L [35])))) (X y106 (X (X (L [29]) (L [3])) (X qa2 Z))) +def y108 : BTree (List Nat):=X (X (X y99 (X (X (X (L [11]) Z) (X (L [17]) (L [57,36,47]))) y100)) y104) (X y105 y107) +def y109 : BTree (List Nat):=X (X (X (X (L [48]) y45) (X y28 Z)) y29) (X (X (X Z y30) (X (L [16]) Z)) (X (X (L [72]) y28) (X (L [56]) (L [16,38,39,29])))) +def y110 : BTree (List Nat):=X (X (X (X y28 Z) (X y45 y18)) (X (X (L [22]) y30) Z)) (X (X (X Z y45) (X y45 Z)) (X (X (L [53,75]) Z) (X (L [54,47]) Z))) +def y111 : BTree (List Nat):=X (X (X (X (L [68]) (L [11])) Z) Z) (X (X (X y19 Z) Z) (X (X y45 (L [40])) (X (L [7,57]) Z))) +def y112 : BTree (List Nat):=X (X y34 (X (X Z y21) (X (L [55]) y35))) (X (X (X y28 Z) Z) (X (X (L [77]) Z) Z)) +def y113 : BTree (List Nat):=X (X y109 y110) (X y111 y112) +def y114 : BTree (List Nat):=X (X (X (X (L [78]) y19) (X y30 Z)) (X (X y21 qa2) (X qa2 (L [54])))) (X y91 (X (X (L [62]) y30) (X (L [61]) (L [34,6])))) +def y115 : BTree (List Nat):=X (X (X (X y30 Z) (X y19 y21)) (X (X (L [47]) y6) Z)) (X (X (X Z y19) (X y19 Z)) y93) +def y116 : BTree (List Nat):=X (X (X (X (L [3]) qa2) Z) Z) (X (X (X y7 Z) Z) (X (X y19 (L [7,57])) (X (L [40]) Z))) +def y117 : BTree (List Nat):=X (X (X (X y21 Z) (X qa2 Z)) y96) (X (X (X y30 Z) Z) (X (X (L [23]) Z) Z)) +def qba : BTree (List Nat):=X (X y114 y115) (X y116 y117) +def qa0 : BTree (List Nat):=L [82,83,69] +def y120 : BTree (List Nat):=X (X (X (X (L [22]) y48) (X y18 (L [8]))) (X (X y58 y57) (X y57 (L [54])))) (X (X (X Z y6) (X (L [30]) (L [66,54,6]))) (X (X qa0 y18) (X (L [61]) (L [34,6])))) +def y121 : BTree (List Nat):=L [66,54,34] +def y122 : BTree (List Nat):=X (X (X (X y18 Z) (X y48 y58)) (X (X (L [47]) y6) (X Z (L [6])))) (X (X (X y7 y48) (X y48 y121)) (X (X (L [96,74]) y6) (X (L [22,23]) Z))) +def y123 : BTree (List Nat):=X (X (X (X (L [3]) y57) (X y6 (L [17]))) (X (X y7 Z) (X Z (L [36,35,66,7,54,34])))) (X (X (X y7 y6) (X y6 (L [36,35,7]))) (X (X y48 (L [7,57])) (X (L [40]) y7))) +def y124 : BTree (List Nat):=X (X (X (X y58 Z) (X y57 y7)) (X (X y6 (L [15])) (X (L [21]) (L [66])))) (X (X (X y18 y7) (X y7 (L [36,35,7]))) (X (X (L [76,23]) (L [63])) (X y6 Z))) +def y125 : BTree (List Nat):=X (X y120 y122) (X y123 y124) +def y126 : BTree (List Nat):=X (X Z (X (X (L [15]) (L [11])) (X (L [11]) (L [7])))) (X (X Z (X (L [16]) (L [86,23,89]))) (X (X (L [42,43]) Z) (X (L [21]) (L [66])))) +def qai : BTree (List Nat):=L [31,32,72] +def y128 : BTree (List Nat):=L [26,23,101] +def y129 : BTree (List Nat):=X (X (X Z (X Z (L [15]))) (X (X (L [22]) Z) (X (L [30]) (L [89])))) (X (X (X qai Z) (X Z y128)) (X (X (L [44]) Z) (X (L [40,17]) Z))) +def y130 : BTree (List Nat):=X (X (X (X (L [3]) (L [11])) Z) (X (X qai y38) (X y38 (L [61,21,26,40,23,101])))) (X (X Z (X Z (L [61,21,40]))) (X (X Z (L [36])) (X (L [61]) qai))) +def y131 : BTree (List Nat):=X (X (X (X (L [15]) y38) (X (L [11]) qai)) (X (X Z y6) (X (L [29]) (L [54])))) (X (X (X Z qai) (X qai (L [61,21,40]))) (X (X (L [40]) Z) Z)) +def y132 : BTree (List Nat):=X (X y126 y129) (X y130 y131) +def y133 : BTree (List Nat):=X (X Z (X (X y27 y28) (X y28 (L [34])))) (X (X (X (L [11]) Z) (X (L [48]) Z)) (X (X (L [3]) Z) (X (L [23]) (L [56])))) +def y134 : BTree (List Nat):=X (X (X (X Z (L [11])) (X Z y27)) (X (X (L [6]) Z) (X (L [22]) Z))) (X Z (X (X (L [9]) Z) (X (L [16,38,39,29]) Z))) +def y135 : BTree (List Nat):=X (X (X (X y27 y18) (X y28 Z)) (X (X Z y19) (X (L [40]) (L [55])))) (X Z (X (X (L [101]) Z) Z)) +def y136 : BTree (List Nat):=X (X (X (X (X (L [102,36]) y28) Z) y23) (X Z (X (X Z (L [66])) (X y35 Z)))) y135 +def y137 : BTree (List Nat):=X (X y133 y134) y136 +def y138 : BTree (List Nat):=X (X (L [17]) y7) (X y6 Z) +def y139 : BTree (List Nat):=X (X (X (X y6 Z) (X y7 y18)) (X (X (L [22]) y18) Z)) (X (X (X Z y7) (X y7 Z)) (X (X (L [53]) Z) (X (L [54,47]) Z))) +def y140 : BTree (List Nat):=X (X y33 (X (X (X (L [103]) Z) Z) (X (X y7 (L [40])) (X (L [7,57]) Z)))) (X (X y34 (X (X Z y21) (X (L [35]) (L [104])))) y88) +def y141 : BTree (List Nat):=X (X (X (X y138 y29) (X y85 (X (X (L [9]) y6) (X (L [36]) (L [29,105]))))) y139) y140 +def qB : BTree (List Nat):=L [14,12,13,15] +def y143 : BTree (List Nat):=X (X (X (X (L [22]) y8) (X y13 Z)) (X (X qB (L [33])) (X (L [33]) (L [54])))) (X (X (X Z y28) (X (L [30]) Z)) (X (X (L [69]) y13) (X (L [61]) (L [6,34])))) +def y144 : BTree (List Nat):=X (X (X (X y13 Z) (X y8 qB)) (X (X (L [22]) y28) Z)) (X (X (X Z y8) (X y8 Z)) (X (X (L [96]) Z) (X (L [23,22]) Z))) +def y145 : BTree (List Nat):=L [37,7] +def y146 : BTree (List Nat):=X (X (X (X (L [3]) (L [33])) Z) Z) (X (X (X y27 Z) Z) (X (X y8 y145) (X (L [40]) Z))) +def y147 : BTree (List Nat):=X (X (X (X qB Z) (X (L [33]) Z)) (X (X Z y18) (X (L [21]) (L [66])))) (X (X (X y13 Z) Z) (X (X (L [23]) Z) Z)) +def y148 : BTree (List Nat):=X (X y143 y144) (X y146 y147) +def y149 : BTree (List Nat):=L [9,31,32] +def y150 : BTree (List Nat):=X (X y18 (X (L [6,16]) (L [29,30,59]))) (X (X y149 y6) (X (L [36,55]) (L [25,24,27,28,16,38,39,59,29]))) +def qav : BTree (List Nat):=L [69,42,43] +def y152 : BTree (List Nat):=X (X (X qav y27) (X y27 (L [101,21,26]))) (X (X (L [53,18]) Z) (X (L [7,54,57,47,78]) Z)) +def y153 : BTree (List Nat):=X (X (X (X y6 y18) (X y27 (L [19,20,15,45,50]))) (X (X (L [22,48]) y18) (X (L [16]) (L [30])))) y152 +def y154 : BTree (List Nat):=X (X qav (L [11])) (X (L [11]) (L [40,101,23,21,61,26])) +def y155 : BTree (List Nat):=L [40,23,61] +def y156 : BTree (List Nat):=X (X (X (X (L [49,106,59]) y46) Z) y154) (X (X (X y19 Z) (X Z y155)) (X (X y27 (L [40,61])) (X (L [7,57,56]) qav))) +def y157 : BTree (List Nat):=X (X (X (L [19,20,15,45,50]) (L [11])) (X y46 qav)) (X (X Z (L [15,45,46,58])) (X (L [35,34]) (L [25,24,27,28,23,59]))) +def y158 : BTree (List Nat):=X (X (X (X (X (X (L [17]) y27) (X y6 Z)) y47) y150) y153) (X y156 (X y157 (X (X (X y6 qav) (X qav y155)) (X (X (L [54,7]) Z) Z)))) +def y159 : BTree (List Nat):=X (X y138 (X (X (L [15]) (L [11])) (X (L [11]) (L [23])))) (X (X (X Z y13) (X (L [16]) Z)) (X (X (L [9]) y6) (X (L [36]) (L [16,29,38,39])))) +def y160 : BTree (List Nat):=X (X (X (X y6 Z) (X y7 (L [15]))) (X (X (L [22]) y13) Z)) (X (X (X Z y7) (X y7 Z)) (X (X (L [53]) Z) (X (L [22,54]) Z))) +def y161 : BTree (List Nat):=X (X y33 (X (X (X y8 Z) Z) (X (X y7 (L [40])) (X y145 Z)))) (X (X y40 (X (X Z qB) (X (L [35]) y9))) y88) +def y162 : BTree (List Nat):=X (X y159 y160) y161 +def y163 : BTree (List Nat):=X (X (X (X (L [22]) qa0) (X y18 (L [102,111,112]))) (X Z (X Z (L [66])))) (X (X (X y7 (L [15])) (X Z (L [37,90,22]))) (X (X y13 y18) (X (L [40]) (L [35,16])))) +def y164 : BTree (List Nat):=X (X Z (L [15])) (X (L [17]) (L [22])) +def y165 : BTree (List Nat):=X (X (X (X y18 y7) (X qa0 Z)) y164) (X (X (X qB qa0) (X qa0 y60)) (X (X (L [107,108,109,52,110]) y149) (X (L [104]) Z))) +def y166 : BTree (List Nat):=X (X (X (X (L [80]) Z) (X y149 (L [38,16,39]))) (X (X qB y6) (X y6 (L [91,92,94,93,90,95])))) (X (X (X (L [11]) y149) (X y149 y64)) (X (X qa0 (L [54])) (X (L [23]) qB))) +def y167 : BTree (List Nat):=X (X (X (X Z y6) (X Z qB)) (X (X y149 Z) (X (L [61]) (L [34])))) (X (X (X y18 qB) (X qB y64)) (X (X (L [27,24,28,25,26]) (L [49,106,59])) (X y149 Z))) +def y168 : BTree (List Nat):=X (X y163 y165) (X y166 y167) +def y169 : BTree (List Nat):=X (X y101 (X (X (L [6]) Z) (L [22]))) (X (X (X y18 Z) (X Z y60)) (X (X (L [3]) qa0) (X (L [29,105]) Z))) +def y170 : BTree (List Nat):=X (X (X (X (L [3]) y6) (X qa0 (L [30]))) (X (X y18 (L [15])) (X (L [15]) (L [91,92,94,93,90,95])))) (X (X (X Z qa0) (X qa0 y64)) (X (X Z (L [66])) (X (L [104]) y18))) +def y171 : BTree (List Nat):=X (X Z y18) (X y18 y64) +def y172 : BTree (List Nat):=X (X (L [29]) (L [3])) (X qa0 Z) +def y173 : BTree (List Nat):=X (X (X (X y7 (L [15])) (X y6 y18)) (X (X qa0 (L [103])) (X (L [40]) (L [35])))) (X y171 y172) +def y174 : BTree (List Nat):=X (X (X y99 (X (X (X (L [11]) Z) (X (L [17]) (L [37,90,22]))) y100)) y169) (X y170 y173) +def y175 : BTree (List Nat):=X (X Z (L [103])) (X (L [103]) Z) +def y176 : BTree (List Nat):=X (X (X Z y175) (X (X Z (X (L [105]) Z)) (X (X (L [113]) Z) Z))) (X Z (X Z (X (X (L [114]) Z) Z))) +def y177 : BTree (List Nat):=X (X (X (X (X (L [3]) (L [103])) Z) Z) Z) (X (X (X Z (X (L [103]) Z)) Z) (X Z (X (X (L [40]) Z) Z))) +def y178 : BTree (List Nat):=X y176 y177 +def y179 : BTree (List Nat):=X Z (X (X Z (X Z (L [76,21,17]))) (X (X (L [19]) Z) Z)) +def y180 : BTree (List Nat):=X Z (X Z (X Z (L [17]))) +def y181 : BTree (List Nat):=X (X (X (X (L [21]) Z) Z) (X (X y6 Z) (X Z (L [26,23,61,101,21,40])))) (X (X Z (X Z y128)) (X Z (X Z y6))) +def y182 : BTree (List Nat):=X (X y179 (X y180 (X (X (X y6 Z) (X Z (L [61,21,40]))) Z))) (X y181 (X (X (X Z (X Z y6)) Z) (X (X (X Z y6) (X y6 y128)) Z))) +def y183 : BTree (List Nat):=X (X (X (X (L [22]) (L [103])) (X y13 Z)) (X (X qB (L [33,11])) (X (L [33,11]) (L [7,54])))) (X (X (X Z y28) (X (L [30,16]) (L [86,23,89]))) (X (X y38 y13) (X (L [21,61]) (L [6,66,34])))) +def y184 : BTree (List Nat):=X (X (X qai (L [103])) (X (L [103]) y128)) (X (X (L [44,115]) Z) (X (L [40,23,22,17]) Z)) +def y185 : BTree (List Nat):=X y183 (X (X (X (X y13 Z) (X (L [103]) qB)) (X (X (L [22]) y28) (X (L [30]) (L [89])))) y184) +def y186 : BTree (List Nat):=X (X (X (X (L [3]) (L [33,11])) Z) (X (X qai y38) (X y38 (L [61,21,26,40,23,101])))) (X (X (X y27 Z) (X Z (L [61,21,40]))) (X (X (L [103]) (L [36,7])) (X (L [61,40]) qai))) +def y187 : BTree (List Nat):=X (X (X qB y38) (X (L [33,11]) qai)) (X (X Z (L [15,19,45,20])) (X (L [21,29]) (L [54,66]))) +def y188 : BTree (List Nat):=X (X (L [40,23]) Z) Z +def y189 : BTree (List Nat):=X y185 (X y186 (X y187 (X (X (X y13 qai) (X qai (L [61,21,40]))) y188))) +def y190 : BTree (List Nat):=X (X (X (X (L [6]) y6) (X y7 Z)) (X (X (L [11]) (L [15])) (X (L [15]) (L [35])))) (X (X (X Z (L [103])) (X (L [22]) Z)) (X (X (L [18,17]) y7) (X (L [104]) (L [37,22,7])))) +def y191 : BTree (List Nat):=X (X (X (X y7 Z) (X y6 (L [11]))) (X (X (L [16]) (L [103])) Z)) (X y11 (X (X y6 Z) (X (L [30,21]) Z))) +def y192 : BTree (List Nat):=X (X y190 y191) (X y14 y15) +def y193 : BTree (List Nat):=X (X (X (X (L [21]) Z) Z) (X (X (L [116,20]) Z) (X Z (L [26,23,61,101,21,40])))) (X (X Z (X Z y128)) (X Z (X Z (L [116,20])))) +def y194 : BTree (List Nat):=X (X (X Z (X Z (L [116,20]))) Z) (X (X (X Z (L [116,20])) (X (L [116,20]) y128)) Z) +def y195 : BTree (List Nat):=X (X y179 (X y180 (X (X (X (L [116,20]) Z) (X Z (L [61,21,40]))) Z))) (X y193 y194) +def y196 : BTree (List Nat):=X (X Z (X Z (X Z (L [118])))) (X (X (X (L [19]) Z) (X Z (L [61,21,40]))) Z) +def y197 : BTree (List Nat):=X (X (X (X (L [21]) Z) Z) (X (X (L [19]) Z) (X Z (L [26,23,61,101,21,40])))) (X (X Z (X Z (L [119,23,120]))) (X Z (X Z (L [19])))) +def y198 : BTree (List Nat):=X (X (X Z (X Z (L [19]))) Z) (X (X (X Z (L [19])) (X (L [19]) y128)) Z) +def y199 : BTree (List Nat):=X (X (X Z (X (X Z (X Z (L [117,21,118]))) (X (X (L [19]) Z) Z))) y196) (X y197 y198) +def y200 : BTree (List Nat):=X (X (X (X (L [105]) Z) (X (L [103]) Z)) Z) (X Z (X (X (L [114]) (L [103])) Z)) +def y201 : BTree (List Nat):=X (X (X (X (X (L [40]) Z) Z) Z) Z) (X Z (X (X (X (L [103]) Z) Z) Z)) +def y202 : BTree (List Nat):=X (X y200 (X (X (X (X (L [103]) Z) Z) Z) Z)) y201 +def y203 : BTree (List Nat):=X (X (X (X (X Z (L [103])) Z) Z) (X Z (X (X (L [62]) Z) Z))) (X (X (X Z (X (L [103]) Z)) Z) (X y175 (X (X (L [115]) Z) Z))) +def y204 : BTree (List Nat):=X (X (X (L [3]) Z) Z) Z +def y205 : BTree (List Nat):=X Z (X (X (L [103]) Z) Z) +def y206 : BTree (List Nat):=X y203 (X (X y204 y205) (X Z (X Z (X (X (L [23]) Z) Z)))) +def y207 : BTree (List Nat):=X (X (X y18 y13) (X (L [6,16]) (L [29,59,30]))) (X (X y8 y6) (X (L [36,35]) (L [25,29,24,27,28,59,105]))) +def y208 : BTree (List Nat):=X (X (X (X y6 y18) (X y7 (L [19,15,20]))) (X (X (L [17,22]) y13) (X (L [16]) (L [30])))) (X (X (X y38 y7) (X y7 (L [101,26,21]))) (X (X (L [53,18]) Z) (X (L [7,54,22,57]) Z))) +def y209 : BTree (List Nat):=X (X y38 (L [11])) (X (L [11]) (L [40,61,101,23,26,21])) +def y210 : BTree (List Nat):=L [40,61,23] +def y211 : BTree (List Nat):=X (X (X (X (L [106,49,59]) y46) Z) y209) (X (X (X (L [103]) Z) (X Z y210)) (X (X y7 (L [61,40])) (X (L [7,36]) y38))) +def y212 : BTree (List Nat):=X (X (X (X (L [19,15,20]) (L [11])) (X y46 y38)) (X (X Z y18) (X (L [35,34]) (L [23,104])))) (X (X (X y6 y38) (X y38 y210)) (X (X (L [7,54]) Z) Z)) +def y213 : BTree (List Nat):=X (X (X (X y138 (X (X (L [19,15,20]) y46) (X y46 (L [40,23])))) y207) y208) (X y211 y212) +def y214 : BTree (List Nat):=L [51,42,70] +def y215 : BTree (List Nat):=X (X (X Z (X Z (L [41]))) (X (X y13 y8) (X y8 y145))) (X (X (X qB Z) (X y17 (L [24,122,16]))) (X (X y214 Z) (X (L [21]) (L [66])))) +def y216 : BTree (List Nat):=X (X (L [11]) Z) (X Z (L [125,122,99])) +def y217 : BTree (List Nat):=X (X (X (X Z qB) (X Z y13)) (X (X (L [22]) Z) (X (L [30]) (L [16])))) (X y216 (X (X (L [121,44]) (L [15])) (X (L [40,48]) Z))) +def y218 : BTree (List Nat):=X (X (X (L [3]) y8) (X (L [15]) (L [22]))) (X (X (L [11]) (L [33])) (X (L [33]) (L [123,124,125,97,122,99]))) +def y219 : BTree (List Nat):=X (X (X Z (L [15])) (X (L [15]) (L [123,124,97]))) (X (X Z (L [36])) (X (L [61]) (L [11]))) +def y220 : BTree (List Nat):=X (X (X Z (L [11])) (X (L [11]) (L [123,124,97]))) (X (X (L [40]) (L [80])) (X (L [15]) Z)) +def y221 : BTree (List Nat):=X (X y218 y219) (X (X (X (X y13 (L [33])) (X y8 (L [11]))) (X (X (L [15]) y28) (X (L [29]) (L [54])))) y220) +def y222 : BTree (List Nat):=X (X y215 y217) y221 +def y223 : BTree (List Nat):=X (X (X (X (L [22]) Z) (X y13 (L [102]))) (X Z (X Z (L [25,24,27,59,28])))) (X (X (X y19 y21) Z) (X (X (L [20]) y13) (X (L [57]) (L [30])))) +def y224 : BTree (List Nat):=X (X (X (X y13 y19) Z) (X (X Z y21) (X (L [22]) Z))) (X Z (X (X (L [107,126]) (L [9])) Z)) +def y225 : BTree (List Nat):=X (X (X (X (L [63]) Z) (X (L [9]) (L [38]))) y23) (X (X (X y20 (L [9])) (X (L [9]) Z)) (X (X Z (L [23])) Z)) +def y226 : BTree (List Nat):=X (X (X (X Z y18) Z) (X (X (L [9]) Z) (X (L [36]) (L [29])))) (X (X (X y13 Z) Z) (X (X (L [66]) (L [49])) (X (L [9]) Z))) +def y227 : BTree (List Nat):=X (X y223 y224) (X y225 y226) +def y228 : BTree (List Nat):=X (X (X (X (L [17]) y45) (X y6 Z)) y29) (X y85 (X (X (L [72]) y6) (X (L [36]) (L [16,38,39,29])))) +def y229 : BTree (List Nat):=X (X (X (X y6 Z) (X y45 y18)) (X (X (L [22]) y18) Z)) (X (X (X Z y45) (X y45 Z)) (X (X (L [53,75]) Z) (X (L [54,47]) Z))) +def y230 : BTree (List Nat):=X (X y34 (X (X Z y21) (X (L [35]) y35))) (X (X (X y6 Z) Z) (X (X (L [77]) Z) Z)) +def y231 : BTree (List Nat):=X (X y228 y229) (X y111 y230) +def y232 : BTree (List Nat):=X (X (X (X (L [22]) (L [11])) (X (L [15]) Z)) (X (X Z y38) (X y38 (L [54])))) (X y91 (X (X (L [69]) (L [15])) (X (L [61]) (L [34,6])))) +def y233 : BTree (List Nat):=X y232 (X (X y40 (X (X Z y6) Z)) (X (X (X Z (L [11])) (X (L [11]) Z)) y93)) +def y234 : BTree (List Nat):=X (X (X (X (L [3]) y38) Z) Z) (X (X (X y7 Z) Z) (X (X (L [11]) (L [7])) (X (L [40]) Z))) +def y235 : BTree (List Nat):=X (X (X Z (X y38 Z)) y96) (X (X (X (L [15]) Z) Z) (X (X (L [23]) Z) Z)) +def y236 : BTree (List Nat):=X y233 (X y234 y235) +def y237 : BTree (List Nat):=X (X (X (X Z y38) (X Z (L [87]))) (X Z (X Z (L [66])))) (X (X (X y27 y18) (X Z (L [90,37,22]))) (X (X (L [15]) Z) (X (L [40]) (L [16,35])))) +def y238 : BTree (List Nat):=X (X (X (X Z y27) (X y38 Z)) (X (X Z y18) (X (L [17]) (L [22])))) (X (X (X (L [15]) y38) (X y38 (L [95,94,90]))) (X (X (L [84]) (L [11])) (X y35 Z))) +def y239 : BTree (List Nat):=X (X (L [80]) Z) (X (L [11]) (L [16])) +def y240 : BTree (List Nat):=X (X y239 (X (X (L [15]) y6) (X y6 (L [93,95,91,92,94,90])))) (X (X (L [11]) (X (L [11]) (L [93,91,92]))) (X (X y38 (L [54])) (X (L [23]) (L [15])))) +def y241 : BTree (List Nat):=X (X (L [24,59]) (L [67])) (X (L [11]) Z) +def y242 : BTree (List Nat):=X (X (X (X Z y6) (X Z (L [15]))) (X (X (L [11]) Z) (X (L [61]) (L [34])))) (X (X (X Z (L [15])) (X (L [15]) (L [93,91,92]))) y241) +def y243 : BTree (List Nat):=X (X y237 y238) (X y240 y242) +def y244 : BTree (List Nat):=X (X (X Z (X Z (L [3]))) (X (X y27 y6) (X y6 (L [34])))) (X (X (X (L [11]) Z) (X (L [17]) Z)) y100) +def y245 : BTree (List Nat):=X (X (X (X Z (L [11])) (X Z y27)) (X (X (L [6]) Z) (X (L [22]) Z))) (X Z (X (X (L [3]) y38) (X (L [16,38,39,29]) Z))) +def y246 : BTree (List Nat):=X (X (X (X (L [3]) y6) (X y38 (L [30]))) y23) (X (X (X Z y38) (X y38 Z)) (X (X Z (L [66])) (X y35 Z))) +def y247 : BTree (List Nat):=X (X (X (X y27 y18) (X y6 Z)) (X (X y38 y19) (X (L [40]) (L [35])))) (X Z (X (X (L [29]) (L [3])) (X y38 Z))) +def y248 : BTree (List Nat):=X (X y244 y245) (X y246 y247) +def y249 : BTree (List Nat):=X (X (X (L [78]) y19) (X y30 Z)) (X (X (L [15,45,46]) (L [42,11,33,32,43,72,62])) (X (L [42,11,33,32,43,72,62]) (L [7,54,57]))) +def y250 : BTree (List Nat):=X (X (X y58 y6) (X (L [89,30]) (L [24,16,27,28,38,23,39]))) (X (X y38 y30) (X (L [61,21]) (L [34,66,6]))) +def y251 : BTree (List Nat):=X (X (X y8 y19) (X y19 (L [125,99,129,130,23,100]))) (X (X (L [44,96]) Z) (X (L [22,23,17,40]) Z)) +def y252 : BTree (List Nat):=X (X y249 y250) (X (X (X (X y30 y58) (X y19 (L [15,45,46]))) (X (X (L [47]) y6) (X (L [30]) y17))) y251) +def y253 : BTree (List Nat):=X (X (X (L [3]) (L [42,11,33,32,43,72,62])) Z) (X (X y8 y57) (X y57 (L [123,125,97,99,127,129,128,21,98,130,23,100]))) +def y254 : BTree (List Nat):=L [123,97,127,128,21,98] +def y255 : BTree (List Nat):=X (X (X (L [15,45,46]) y57) (X (L [42,11,33,32,43,72,62]) y8)) (X (X Z y82) (X (L [29,21]) (L [66,54]))) +def y256 : BTree (List Nat):=X (X y253 (X (X (X y7 Z) (X Z y254)) (X (X y19 (L [7,57,36])) (X (L [40,61]) y8)))) (X y255 (X (X (X y30 y8) (X y8 y254)) y188)) +def y257 : BTree (List Nat):=X y252 y256 +def y258 : BTree (List Nat):=X (X y138 (X (X (L [15]) (L [11])) (X (L [11]) (L [23])))) (X (X (X Z y13) (X (L [16]) Z)) (X (X (L [9]) y6) (X (L [36]) (L [29,105])))) +def y259 : BTree (List Nat):=X (X y33 (X (X (X (L [103]) Z) Z) (X (X y7 (L [40])) (X y145 Z)))) (X (X y40 (X (X Z qB) (X (L [35]) (L [104])))) y88) +def y260 : BTree (List Nat):=X (X y258 y160) y259 +def y261 : BTree (List Nat):=X (X (X Z (X Z (L [133]))) Z) (X (X Z (X Z (L [29,25,30]))) (X (X (L [10]) Z) Z)) +def y262 : BTree (List Nat):=X Z (X Z (X Z (L [30]))) +def y263 : BTree (List Nat):=X y261 (X y262 (X (X (X qa0 Z) (X Z (L [101,26,21]))) (X (X (L [132]) y58) Z))) +def y264 : BTree (List Nat):=X (X (X (L [131]) Z) (X y58 (L [47]))) (X (X qa0 Z) (X Z (L [40,61,101,23,26,21]))) +def y265 : BTree (List Nat):=X (X (X Z (X Z qa0)) (X (X y58 Z) Z)) (X (X (X Z qa0) (X qa0 y210)) (X (X (L [57]) (L [80,55])) (X y58 Z))) +def y266 : BTree (List Nat):=X y263 (X (X y264 (X (X (X Z y58) (X y58 y210)) (X Z (X Z qa0)))) y265) +def y267 : BTree (List Nat):=X (X (X y18 Z) (X (L [6,136]) (L [29,66,30,6,67,79]))) (X (X (L [11]) Z) (X (L [35]) y35)) +def y268 : BTree (List Nat):=X (X (X (X Z y18) (X Z y6)) (X (X (L [17]) Z) (X (L [16]) (L [30,6,79])))) (X (X (X y214 Z) (X Z (L [3]))) (X (X (L [134]) y51) (X (L [7,22,57]) Z))) +def y269 : BTree (List Nat):=X (X (X (X (L [67]) y45) (X y51 (L [17]))) (X (X y214 (L [11])) (X (L [11]) (L [3])))) (X (X (X Z y51) (X y51 (L [3]))) (X (X Z (L [61])) (X (L [36]) y214))) +def y270 : BTree (List Nat):=X (X (X (X y6 (L [11])) (X y45 y214)) (X (X y51 y18) (X (L [34]) (L [23])))) (X (X (X Z y214) (X y214 (L [3]))) (X (X (L [135]) (L [63])) (X y51 Z))) +def y271 : BTree (List Nat):=X (X (X (X (X Z (X Z (L [8]))) (X (X y6 y45) (X y45 (L [40])))) y267) y268) (X y269 y270) +def y272 : BTree (List Nat):=X (X (X (X (L [6]) y6) (X y27 Z)) (X (X (L [11]) y18) (X y18 (L [35])))) (X (X (X Z y19) (X (L [22]) Z)) (X (X (L [18,17]) y27) (X y35 (L [7,22,57])))) +def y273 : BTree (List Nat):=X (X (X (X y27 Z) (X y6 (L [11]))) (X (X (L [16]) y19) Z)) (X y11 (X (X y6 Z) (X (L [21,30]) Z))) +def y274 : BTree (List Nat):=X (X (X (X (L [7,8]) y18) Z) Z) (X (X (X y18 Z) Z) (X (X y6 (L [34])) (X (L [29]) Z))) +def y275 : BTree (List Nat):=X (X (X (X (L [11]) Z) (X y18 Z)) (X (X Z qa2) (X (L [23]) (L [36])))) (X (X (X y27 Z) Z) (X (X (L [21]) Z) Z)) +def y276 : BTree (List Nat):=X (X y272 y273) (X y274 y275) +def y277 : BTree (List Nat):=X (X (X (X (L [47]) (L [33])) (X y21 (L [111,102,112]))) Z) (X Z (X (X (L [45]) y21) Z)) +def y278 : BTree (List Nat):=X (X (X (X y21 Z) (X (L [33]) Z)) Z) (X (X (X Z (L [33])) (X (L [33]) Z)) (X (X (L [108,52,107,109]) y8) Z)) +def y279 : BTree (List Nat):=X (X (X (X (L [80]) Z) (X y8 y17)) Z) (X (X (X Z y8) (X y8 Z)) (X (X (L [33]) Z) Z)) +def y280 : BTree (List Nat):=X (X Z (X (X y8 Z) Z)) (X (X (X y21 Z) Z) (X (X (L [24,25,27,28]) (L [106,49,59])) (X y8 Z))) +def y281 : BTree (List Nat):=X (X y277 y278) (X y279 y280) +def y282 : BTree (List Nat):=X (X Z (X (X y19 y18) (X y18 (L [29])))) (X (X (X y20 Z) (X (L [22]) (L [37,90,22]))) (X (X (L [3]) Z) Z)) +def y283 : BTree (List Nat):=X (X y13 Z) (X Z (L [95,94,90])) +def y284 : BTree (List Nat):=X (X (X (X Z y20) (X Z y19)) (X (X y17 Z) (X (L [47]) (L [22])))) (X y283 (X (X (L [69]) Z) Z)) +def y285 : BTree (List Nat):=X (X (X (X (L [3]) y18) Z) (X (X y13 y21) (X y21 (L [93,91,95,92,94,90])))) (X (X Z (X Z (L [93,91,92]))) (X (X Z (L [25,24,27,59,28])) (X Z y13))) +def y286 : BTree (List Nat):=X (X (X (X y19 y21) (X y18 y13)) (X Z (X (L [57]) Z))) (X (X (X Z y13) (X y13 (L [93,91,92]))) (X (X (L [34]) Z) Z)) +def y287 : BTree (List Nat):=X (X y282 y284) (X y285 y286) +def y288 : BTree (List Nat):=X (X (X (X (L [47]) qa2) (X y21 (L [87,102,112]))) (X Z (X Z (L [66])))) (X (X (X y7 (L [15])) (X Z (L [37,90,22]))) (X (X y18 y21) (X (L [40]) (L [35,16])))) +def y289 : BTree (List Nat):=X (X (X (X y21 y7) (X qa2 Z)) y164) (X (X (X y18 qa2) (X qa2 y60)) (X (X (L [52,84,107,109]) y19) (X y9 Z))) +def y290 : BTree (List Nat):=X (X (X (X (L [80]) Z) (X y19 y17)) (X (X y18 y6) (X y6 (L [91,92,94,93,90,95])))) (X (X (X (L [11]) y19) (X y19 y64)) (X (X qa2 (L [54])) (X (L [23]) y18))) +def y291 : BTree (List Nat):=X (X (X (X Z y6) (X Z y18)) (X (X y19 Z) (X (L [61]) (L [34])))) (X (X (X y21 y18) (X y18 y64)) (X (X y35 (L [49,67,59])) (X y19 Z))) +def y292 : BTree (List Nat):=X (X y288 y289) (X y290 y291) +def y293 : BTree (List Nat):=X (X y101 (X (X (L [6]) Z) (X (L [22]) Z))) (X Z (X (X (L [3]) y38) (X (L [16,29,38,39]) Z))) +def y294 : BTree (List Nat):=X (X (X (X (L [3]) y6) (X y38 (L [30]))) (X (X Z (L [15])) (X (L [15]) Z))) (X (X (X Z y38) (X y38 Z)) (X (X Z (L [66])) (X y9 Z))) +def y295 : BTree (List Nat):=X (X (X (X y7 (L [15])) (X y6 Z)) (X (X y38 y8) (X (L [40]) (L [35])))) (X Z (X (X (L [29]) (L [3])) (X y38 Z))) +def y296 : BTree (List Nat):=X (X (X y99 (X (X (X (L [11]) Z) (X (L [17]) Z)) y100)) y293) (X y294 y295) +def y297 : BTree (List Nat):=X (X (X (L [15]) Z) (X (L [6]) (L [29,66,30,6,17,67,20]))) (X (X (L [11]) Z) (X (L [35]) (L [104]))) +def y298 : BTree (List Nat):=X (X Z (L [15])) (X Z y6) +def y299 : BTree (List Nat):=L [42,51,137] +def y300 : BTree (List Nat):=X (X y298 (X (X (L [17]) Z) (X (L [16]) (L [30,6,20])))) (X (X (X y299 Z) (X Z (L [3]))) (X (X (L [74,18]) y6) (X (L [37,22,7]) Z))) +def y301 : BTree (List Nat):=X (X (X (X (L [67]) y7) (X y6 (L [17]))) (X (X y299 (L [11])) (X (L [11]) (L [3])))) (X (X (X Z y6) (X y6 (L [3]))) (X (X Z (L [61])) (X (L [36]) y299))) +def y302 : BTree (List Nat):=X (X (X (X y6 (L [11])) (X y7 y299)) (X (X y6 y13) (X (L [34]) (L [23])))) (X (X (X Z y299) (X y299 (L [3]))) (X (X (L [76,7]) (L [63])) (X y6 Z))) +def y303 : BTree (List Nat):=X (X (X (X (X Z (X Z (L [8]))) (X (X y6 y7) (X y7 (L [40])))) y297) y300) (X y301 y302) +def y304 : BTree (List Nat):=X (X (X (X Z (X Z (L [141]))) Z) (X Z (X (X (L [50]) Z) Z))) (X Z (X Z (X (X (L [138]) (L [73])) Z))) +def y305 : BTree (List Nat):=X (X (X (X (L [64]) Z) (X (L [73]) (L [136]))) Z) (X (X (X Z (L [73])) (X (L [73]) Z)) Z) +def y306 : BTree (List Nat):=X (X Z (X (X (L [73]) Z) Z)) (X Z (X (X (L [139]) (L [140])) (X (L [73]) Z))) +def y307 : BTree (List Nat):=X y304 (X y305 y306) +def y308 : BTree (List Nat):=X (X (X (X Z (X Z (L [144]))) Z) (X Z (X (X (L [142]) Z) Z))) (X Z (X Z (X (X (L [143]) (L [2])) Z))) +def y309 : BTree (List Nat):=X (X (X (X (L [3]) Z) (X (L [2]) (L [5]))) Z) (X (X (X Z (L [2])) (X (L [2]) Z)) Z) +def y310 : BTree (List Nat):=X y308 (X y309 (X y0 (X Z (X (X (L [3]) (L [1])) (X (L [2]) Z))))) +def y311 : BTree (List Nat):=X (X (X (X y58 Z) (X qa0 Z)) Z) (X (X (X Z qa0) (X qa0 Z)) (X (X (L [85]) qai) Z)) +def y312 : BTree (List Nat):=X (X (X (X (X (L [47]) qa0) (X y58 (L [88]))) Z) (X Z (X (X (L [45]) y58) Z))) y311 +def y313 : BTree (List Nat):=X (X (X (X (L [80]) Z) (X qai (L [89]))) Z) (X (X (X Z qai) (X qai Z)) (X (X qa0 Z) Z)) +def y314 : BTree (List Nat):=X (X Z (X (X qai Z) Z)) (X (X (X y58 Z) Z) (X (X (L [86]) (L [68])) (X qai Z))) +def y315 : BTree (List Nat):=X y312 (X y313 y314) +def y316 : BTree (List Nat):=X (X (X Z (X Z (L [41]))) (X (X y18 y19) (X y19 (L [7,57])))) (X (X (X y21 Z) (X y17 (L [24,122,16]))) (X (X (L [42,70,51]) Z) (X (L [21]) (L [66])))) +def y317 : BTree (List Nat):=X (X (X (X Z y21) (X Z y18)) (X (X (L [22]) Z) (X (L [30]) (L [16])))) (X y216 (X (X (L [44,121]) y18) (X (L [40,17]) Z))) +def y318 : BTree (List Nat):=X (X (X (X (L [3]) y19) (X y18 (L [22]))) (X (X (L [11]) qa2) (X qa2 (L [123,124,125,97,122,99])))) (X (X (X Z y18) (X y18 (L [123,124,97]))) (X (X Z (L [36])) (X (L [61]) (L [11])))) +def y319 : BTree (List Nat):=X (X (X (X y18 qa2) (X y19 (L [11]))) (X (X y18 y6) (X (L [29]) (L [54])))) (X (X (X Z (L [11])) (X (L [11]) (L [123,124,97]))) (X (X (L [40]) (L [80])) (X y18 Z))) +def y320 : BTree (List Nat):=X (X y316 y317) (X y318 y319) +def y321 : BTree (List Nat):=X (X (X (X (L [16]) y18) (X (L [11]) (L [65]))) (X Z (X Z (L [56])))) (X (X (X y30 qa2) (X Z (L [66,6,54]))) (X (X (L [3]) (L [11])) (X (L [29]) (L [54,47])))) +def y322 : BTree (List Nat):=X (X (X (X (L [11]) y30) (X y18 Z)) (X (X Z qa2) (X y17 (L [6])))) (X (X (X y27 y18) (X y18 (L [66,34,54]))) (X (X (L [3]) y28) (X (L [61]) Z))) +def y323 : BTree (List Nat):=X (X (X (X (L [3]) Z) (X y28 (L [48]))) (X (X y27 y19) (X y19 (L [36,66,7,34,35,54])))) (X (X (X y21 y28) (X y28 (L [36,7,35]))) (X (X y18 (L [55])) (X (L [21]) y27))) +def y324 : BTree (List Nat):=X (X (X (X Z y19) (X Z y27)) (X (X y28 Z) (X y35 (L [7,57])))) (X (X (X (L [11]) y27) (X y27 (L [36,7,35]))) (X (X (L [61]) (L [63,64])) (X y28 Z))) +def y325 : BTree (List Nat):=X (X y321 y322) (X y323 y324) +def y326 : BTree (List Nat):=X (X (X (X (L [22]) (L [33])) (X qB (L [111,102,112]))) Z) (X Z (X (X (L [145,14,12,13]) qB) Z)) +def y327 : BTree (List Nat):=X (X (X (X qB Z) (X (L [33]) Z)) Z) (X (X (X Z (L [33])) (X (L [33]) Z)) (X (X (L [108,52,107,109]) y8) Z)) +def y328 : BTree (List Nat):=X (X Z (X (X y8 Z) Z)) (X (X (X qB Z) Z) (X (X (L [24,25,27,28]) (L [106,49,59])) (X y8 Z))) +def y329 : BTree (List Nat):=X (X y326 y327) (X y279 y328) +def y330 : BTree (List Nat):=X (X y18 (X (L [6,16]) (L [29,30,59]))) (X (X qai y6) (X (L [36,55]) (L [25,24,27,28,16,38,39,29,59]))) +def y331 : BTree (List Nat):=X (X (X qav y45) (X y45 (L [101,21,26]))) (X (X (L [53,18,75]) Z) (X (L [7,54,57,47,78]) Z)) +def y332 : BTree (List Nat):=X (X (X (X y6 y18) (X y45 (L [19,20,15,45,50]))) (X (X (L [22,48]) y18) (X (L [16]) (L [30])))) y331 +def y333 : BTree (List Nat):=X (X (X (X (L [68]) y46) Z) y154) (X (X (X y19 Z) (X Z y155)) (X (X y45 (L [40,61])) (X (L [7,57,56]) qav))) +def y334 : BTree (List Nat):=X (X (X (X (X (X (L [17]) y45) (X y6 Z)) y47) y330) y332) (X y333 (X y157 (X (X (X y6 qav) (X qav y155)) (X (X (L [77]) Z) Z)))) +def y335 : BTree (List Nat):=X (X Z (X Z (X Z (L [22])))) (X (X (X qB Z) (X Z y60)) (X (X (L [3]) (L [33])) Z)) +def y336 : BTree (List Nat):=X (X (X (L [3]) Z) (X (L [33]) (L [30]))) (X (X qB Z) (X Z (L [91,92,94,93,90,95]))) +def y337 : BTree (List Nat):=X (X (X Z (X Z qB)) (X (X (L [33]) Z) Z)) (X (X (X Z qB) (X qB y64)) (X (X (L [29]) (L [3])) (X (L [33]) Z))) +def y338 : BTree (List Nat):=X (X (X y68 (X y59 (X (X (L [3]) Z) Z))) y335) (X (X y336 (X (X (X Z (L [33])) (X (L [33]) y64)) (X Z (X Z qB)))) y337) +def y339 : BTree (List Nat):=X (X (X (X (L [22]) (L [11])) (X y18 (L [147]))) (X Z (X Z (L [24,59])))) (X (X (X (L [11]) Z) (X Z (L [76,21,17]))) (X (X y6 y18) (X (L [7]) (L [21,30])))) +def y340 : BTree (List Nat):=L [51,52] +def y341 : BTree (List Nat):=X (X (X (X y18 (L [11])) (X (L [11]) Z)) (X Z (X (L [22]) (L [17])))) (X (X (X y6 (L [11])) (X (L [11]) (L [61,21,40]))) (X (X (L [146]) y340) (X (L [66]) Z))) +def y342 : BTree (List Nat):=X (X (X (L [63]) Z) (X y340 (L [6]))) (X (X y6 (L [15])) (X (L [15]) (L [26,23,61,101,21,40]))) +def y343 : BTree (List Nat):=X (X y298 (X (X y340 Z) (X (L [36]) (L [29])))) (X (X (X y18 y6) (X y6 y128)) (X (X (L [66]) (L [131])) (X y340 Z))) +def y344 : BTree (List Nat):=X (X y342 (X (X (X y38 y340) (X y340 y128)) (X (X (L [11]) (L [23])) (X (L [54]) y6)))) y343 +def y345 : BTree (List Nat):=X (X y339 y341) y344 +def y346 : BTree (List Nat):=X (X (X y28 (L [11])) (X Z (L [24,16,27,28,38,23,39]))) (X (X (L [3]) (L [33])) (X (L [34]) (L [23,22]))) +def y347 : BTree (List Nat):=X (X (X (X (L [33]) y28) (X qB Z)) (X (X Z (L [11])) (X (L [6]) y17))) (X (X (X y8 qB) (X qB (L [125,99,129,130,23,100]))) (X (X (L [3]) y13) (X (L [56]) Z))) +def y348 : BTree (List Nat):=X (X (X (L [3]) Z) (X y13 (L [22]))) (X (X y8 y27) (X y27 (L [123,125,97,99,127,129,128,21,98,130,23,100]))) +def y349 : BTree (List Nat):=X (X (X (X Z y27) (X Z y8)) (X (X y13 Z) (X (L [66]) (L [40])))) (X (X (X (L [33]) y8) (X y8 y254)) (X (X (L [36]) (L [80])) (X y13 Z))) +def y350 : BTree (List Nat):=X (X (X (X (X (X (L [30]) qB) (X (L [33]) (L [41]))) (X Z (X Z (L [61])))) y346) y347) (X (X y348 (X (X (X y18 y13) (X y13 y254)) (X (X qB (L [21])) (X (L [55]) y8)))) y349) +def y351 : BTree (List Nat):=X (X Z (X Z (X Z (L [66])))) (X (X (X y27 y18) (X Z (L [37,90,22]))) (X (X (L [15]) Z) (X (L [40]) (L [16,55])))) +def y352 : BTree (List Nat):=X (X (X (X Z y27) Z) (X (X Z y18) (X (L [48]) (L [22])))) (X y283 (X (X (L [110]) Z) (X y35 Z))) +def y353 : BTree (List Nat):=X (X (X (X (L [148,35]) Z) Z) (X (X y13 y28) (X y28 (L [93,91,95,92,94,90])))) (X (X (X (L [11]) Z) (X Z (L [93,91,92]))) (X (X Z (L [54])) (X (L [23]) y13))) +def y354 : BTree (List Nat):=X (X (X (X Z y28) (X Z y13)) (X Z (X (L [61]) (L [34])))) (X (X (X Z y13) (X y13 (L [93,91,92]))) (X (X (L [26]) Z) Z)) +def y355 : BTree (List Nat):=X (X y351 y352) (X y353 y354) +def y356 : BTree (List Nat):=X (X (X Z (X Z (L [41]))) (X (X y28 y27) (X y27 (L [40])))) (X (X (X y18 Z) (X (L [6]) (L [29,25,30]))) (X (X (L [51,52,31]) Z) (X (L [55]) y35))) +def y357 : BTree (List Nat):=X (X (X (L [33]) Z) (X Z (L [101,26,21]))) (X (X (L [121,18]) qB) (X (L [7,57,78]) Z)) +def y358 : BTree (List Nat):=X y356 (X (X (X (X Z y18) (X Z y28)) (X (X (L [48]) Z) (X (L [16]) (L [30])))) y357) +def y359 : BTree (List Nat):=X (X (X (L [131,106]) y27) (X qB (L [22]))) (X (X (L [33]) (L [11])) (X (L [11]) (L [40,61,101,23,26,21]))) +def y360 : BTree (List Nat):=X (X (X (X y28 (L [11])) (X y27 (L [33]))) (X (X qB y30) (X (L [34]) (L [23])))) (X (X (X Z (L [33])) (X (L [33]) y210)) (X (X y145 (L [80])) (X qB Z))) +def y361 : BTree (List Nat):=X (X y359 (X (X (X Z qB) (X qB y210)) (X (X Z (L [61])) (X (L [56]) (L [33]))))) y360 +def y362 : BTree (List Nat):=X y358 y361 +def y363 : BTree (List Nat):=X (X Z (X (X y28 y27) (X y27 (L [40])))) (X (X (X y18 Z) (X (L [6]) (L [29,30,59]))) (X (X (L [31,32]) Z) (X (L [55]) y35))) +def y364 : BTree (List Nat):=X (X (X (X Z y18) (X Z y28)) (X (X (L [48]) Z) (X (L [16]) (L [30])))) (X (X (X qav Z) (X Z (L [101,21,26]))) (X (X (L [18]) Z) (X (L [7,57,78]) Z))) +def y365 : BTree (List Nat):=X (X (X (X (L [106,59]) y27) Z) y154) (X (X Z (X Z y155)) (X (X Z (L [61])) (X (L [56]) qav))) +def y366 : BTree (List Nat):=X (X (X (X y28 (L [11])) (X y27 qav)) (X (X Z y30) (X (L [34]) (L [23])))) (X (X (X Z qav) (X qav y155)) (X (X (L [7]) Z) Z)) +def y367 : BTree (List Nat):=X (X y363 y364) (X y365 y366) +def y368 : BTree (List Nat):=X (X (X (X (L [22]) y19) (X y18 Z)) (X (X y21 qa2) (X qa2 (L [54])))) (X y91 (X (X (L [69]) y18) (X (L [61]) (L [34,6])))) +def y369 : BTree (List Nat):=X (X (X (X y18 Z) (X y19 y21)) (X (X (L [47]) y6) Z)) (X (X (X Z y19) (X y19 Z)) y93) +def y370 : BTree (List Nat):=X (X (X (X y21 Z) (X qa2 Z)) y96) (X (X (X y18 Z) Z) (X (X (L [23]) Z) Z)) +def y371 : BTree (List Nat):=X (X y368 y369) (X y116 y370) +def y372 : BTree (List Nat):=X (X (X (X Z (X Z (L [8]))) Z) (X Z (X (X (L [82]) Z) Z))) (X Z (X Z (X (X (L [74]) (L [19])) Z))) +def y373 : BTree (List Nat):=X (X Z (L [19])) (X (L [19]) Z) +def y374 : BTree (List Nat):=X Z (X (X (L [19]) Z) Z) +def y375 : BTree (List Nat):=X (X (X (X (X (L [67]) Z) (X (L [19]) (L [118]))) Z) (X y373 Z)) (X y374 (X Z (X (X (L [117]) (L [21])) (X (L [19]) Z)))) +def y376 : BTree (List Nat):=X y372 y375 +def y377 : BTree (List Nat):=X (X (X (X (X Z (L [19])) Z) Z) (X Z (X (X (L [118]) Z) Z))) (X (X (X Z (X (L [19]) Z)) Z) (X y373 (X (X (L [19]) Z) Z))) +def y378 : BTree (List Nat):=X (X (X (X (X (L [8]) Z) Z) Z) y374) (X Z (X Z (X (X (L [21]) Z) Z))) +def y379 : BTree (List Nat):=X y377 y378 +def y380 : BTree (List Nat):=X (X (X Z y373) (X (X Z (X (L [118]) Z)) (X (X (L [38]) Z) Z))) (X Z (X Z (X (X (L [9]) Z) Z))) +def y381 : BTree (List Nat):=X (X (X (X (X (L [149]) (L [19])) Z) Z) Z) (X (X (X Z (X (L [19]) Z)) Z) (X Z (X (X (L [120]) Z) Z))) +def y382 : BTree (List Nat):=X y380 y381 +def y383 : BTree (List Nat):=X (X (X y6 Z) Z) Z +def y384 : BTree (List Nat):=X (X (X (X (X (L [17]) Z) (X y6 Z)) Z) (X Z (X (X (L [9]) y6) Z))) (X y383 Z) +def y385 : BTree (List Nat):=X y384 (X (X (X (X (X (L [101]) Z) Z) Z) Z) (X Z y383)) +def y386 : BTree (List Nat):=X (X (X Z (X Z (L [156,149]))) Z) (X (X Z (X Z (L [3]))) (X (X (L [152]) Z) Z)) +def y387 : BTree (List Nat):=L [151,9] +def y388 : BTree (List Nat):=X (X Z (X Z (X (L [118]) (L [3])))) (X (X (X (L [150]) Z) (X Z (L [3]))) (X (X (L [153,151,154]) y387) Z)) +def y389 : BTree (List Nat):=X (X (X (X (L [3]) Z) (X y387 (L [157,38]))) (X (X (L [150]) (L [19])) (X (L [19]) (L [3])))) (X (X (X Z y387) (X y387 (L [3]))) (X Z (X Z (L [150])))) +def y390 : BTree (List Nat):=X (X (X Z (L [150])) (X (L [150]) (L [3]))) (X (X (L [155,119,27]) (L [119,120])) (X y387 Z)) +def y391 : BTree (List Nat):=X (X (X (X Z (L [19])) (X Z (L [150]))) (X (X y387 Z) (X (L [117]) Z))) y390 +def y392 : BTree (List Nat):=X (X y386 y388) (X y389 y391) +def y393 : BTree (List Nat):=X (X (X (X (L [118]) Z) (X (L [19]) Z)) Z) (X Z (X (X (L [9]) (L [19])) Z)) +def y394 : BTree (List Nat):=X (X (X (L [19]) Z) Z) Z +def y395 : BTree (List Nat):=X (X y393 (X y394 Z)) (X (X (X (X (X (L [120]) Z) Z) Z) Z) (X Z y394)) +def y396 : BTree (List Nat):=X (X (X Z (X Z (L [87]))) (X (X (L [11]) (L [15])) (X (L [15]) (L [29])))) (X (X (X y38 Z) (X (L [22]) (L [37,90,22]))) (X (X (L [3]) Z) (X (L [54]) (L [61])))) +def y397 : BTree (List Nat):=X (X (X (X Z y38) (X Z (L [11]))) (X (X (L [16]) Z) (X Z (L [22])))) (X (X (X y18 Z) (X Z y60)) (X (X (L [69,84]) (L [11])) (X (L [34,6]) Z))) +def y398 : BTree (List Nat):=X (X Z (L [11])) (X (L [11]) y64) +def y399 : BTree (List Nat):=X (X (X (X (L [3]) (L [15])) (X (L [11]) (L [16]))) y63) (X y398 (X (X Z (L [24,59])) (X (L [66]) y18))) +def y400 : BTree (List Nat):=X (X (X (X (L [11]) Z) (X (L [15]) y18)) (X (X (L [11]) y7) (X (L [7]) (L [21])))) (X y171 (X (X (L [34]) (L [67])) (X (L [11]) Z))) +def y401 : BTree (List Nat):=X (X y396 y397) (X y399 y400) +def y402 : BTree (List Nat):=X (X (X (X (L [118]) Z) (X (L [19]) Z)) (X (X (L [19]) Z) Z)) (X Z (X (X y387 (L [19])) Z)) +def y403 : BTree (List Nat):=X y402 (X (X (X (X (L [19]) Z) (X Z (L [19]))) (X (X (L [118]) Z) Z)) Z) +def y404 : BTree (List Nat):=X (X (X (X (X (L [119,120]) Z) Z) Z) (X Z (X (X Z (L [117])) Z))) (X y394 y394) +def y405 : BTree (List Nat):=X y403 y404 +def y406 : BTree (List Nat):=X (X (X (X (L [6]) y28) (X y27 Z)) (X (X (L [11]) y18) (X y18 (L [55])))) (X (X (X Z y19) (X (L [22]) Z)) (X (X (L [17,18]) y27) (X y35 (L [7,57,78])))) +def y407 : BTree (List Nat):=X (X (X (X y27 Z) (X y28 (L [11]))) (X (X (L [16]) y19) Z)) (X (X (X Z y28) (X y28 Z)) (X (X y51 Z) (X (L [21,30]) Z))) +def y408 : BTree (List Nat):=X (X (X (X (L [8,7]) y18) Z) Z) (X (X (X y30 Z) Z) (X (X y28 (L [34])) (X (L [29]) Z))) +def y409 : BTree (List Nat):=X (X (X (X (L [11]) Z) (X y18 Z)) (X (X Z qa2) (X (L [23]) (L [56])))) (X (X (X y27 Z) Z) (X (X (L [21]) Z) Z)) +def y410 : BTree (List Nat):=X (X y406 y407) (X y408 y409) +def y411 : BTree (List Nat):=X (X (X Z (X (X y6 Z) Z)) (X Z (X (X (L [110]) Z) Z))) (X (X (X Z (X Z y6)) (X (X (L [17]) Z) Z)) Z) +def y412 : BTree (List Nat):=X (X (X (X (X (L [26]) Z) Z) Z) (X Z (X (X Z (L [76])) Z))) (X y383 Z) +def y413 : BTree (List Nat):=X y411 y412 +def y414 : BTree (List Nat):=X (X (X Z (X Z (L [41]))) (X (X y30 y19) (X y19 (L [7,57])))) (X (X (X y21 Z) (X y17 (L [24,122,16]))) (X (X y299 Z) (X (L [21]) (L [66])))) +def y415 : BTree (List Nat):=X (X (X (X Z y21) (X Z y30)) (X (X (L [78]) Z) (X (L [30]) (L [16])))) (X y216 (X (X (L [44,121]) y18) (X (L [40,17]) Z))) +def y416 : BTree (List Nat):=X (X (X (X (L [3]) y19) (X y18 (L [22]))) (X (X (L [11]) qa2) (X qa2 (L [123,124,125,97,122,99])))) (X (X (X Z y18) (X y18 (L [123,124,97]))) (X (X Z (L [56])) (X (L [61]) (L [11])))) +def y417 : BTree (List Nat):=X (X (X (X y30 qa2) (X y19 (L [11]))) (X (X y18 y6) (X (L [29]) (L [54])))) (X (X (X Z (L [11])) (X (L [11]) (L [123,124,97]))) (X (X (L [40]) (L [80])) (X y18 Z))) +def y418 : BTree (List Nat):=X (X y414 y415) (X y416 y417) +def y419 : BTree (List Nat):=X (X (X Z (X Z (L [41]))) Z) (X (X Z (X Z (L [29,25,30]))) (X (X y340 Z) Z)) +def y420 : BTree (List Nat):=X y419 (X y262 (X (X (X (L [33]) Z) (X Z (L [101,26,21]))) (X (X (L [121]) qB) Z))) +def y421 : BTree (List Nat):=X (X (X (L [131]) Z) (X qB (L [22]))) (X (X (L [33]) Z) (X Z (L [40,61,101,23,26,21]))) +def y422 : BTree (List Nat):=X (X (X Z (X Z (L [33]))) (X (X qB Z) Z)) (X (X (X Z (L [33])) (X (L [33]) y210)) (X (X (L [37]) (L [80])) (X qB Z))) +def y423 : BTree (List Nat):=X y420 (X (X y421 (X (X (X Z qB) (X qB y210)) (X Z (X Z (L [33]))))) y422) +def y424 : BTree (List Nat):=X (X (X y58 Z) (X (L [89]) (L [24,16,27,28,38,23,39]))) (X (X (L [42,43]) Z) (X (L [21]) (L [66]))) +def y425 : BTree (List Nat):=X (X (X y8 Z) (X Z (L [125,99,129,130,23,100]))) (X (X (L [44]) Z) (X (L [17,40]) Z)) +def y426 : BTree (List Nat):=X (X (X Z (X (X y18 y48) (X y48 (L [7,57])))) y424) (X (X (X (X Z y58) (X Z y18)) (X (X (L [22]) Z) (X (L [30]) y17))) y425) +def y427 : BTree (List Nat):=X (X (X (X (L [3]) y48) Z) (X (X y8 y57) (X y57 (L [123,125,97,99,127,129,128,21,98,130,23,100])))) (X (X Z (X Z y254)) (X (X Z (L [36])) (X (L [61]) y8))) +def y428 : BTree (List Nat):=X (X (X (X y18 y57) (X y48 y8)) (X (X Z y6) (X (L [29]) (L [54])))) (X (X (X Z y8) (X y8 y254)) (X (X (L [40]) Z) Z)) +def y429 : BTree (List Nat):=X y426 (X y427 y428) +def y430 : BTree (List Nat):=X (X (X (X (L [3]) Z) (X qa0 (L [30]))) (X (X y58 Z) (X Z (L [34,66,7,35,36,54])))) (X (X (X Z qa0) (X qa0 y71)) (X Z (X Z y58))) +def y431 : BTree (List Nat):=X (X (X Z (X Z y58)) (X (X qa0 Z) Z)) (X (X (X Z y58) (X y58 y71)) y172) +def y432 : BTree (List Nat):=X (X y69 (X y70 (X (X (X y58 Z) (X Z (L [7,36,54]))) (X (X (L [3]) qa0) Z)))) (X y430 y431) +def y433 : BTree (List Nat):=X (X (X Z (X Z (L [8]))) Z) (X (X Z (X Z (L [66,54,6]))) (X (X (L [82,83]) Z) Z)) +def y434 : BTree (List Nat):=X (X Z (X Z (X Z (L [6])))) (X (X (X y7 Z) (X Z y121)) (X (X (L [74]) y6) Z)) +def y435 : BTree (List Nat):=X (X (X (X (L [67,54]) Z) (X y6 (L [17]))) (X (X y7 Z) (X Z (L [36,35,66,7,54,34])))) (X (X (X Z y6) (X y6 (L [36,35,7]))) (X Z (X Z y7))) +def y436 : BTree (List Nat):=X (X (X Z (X Z y7)) (X (X y6 Z) Z)) (X (X (X Z y7) (X y7 (L [36,35,7]))) (X (X (L [76]) (L [63])) (X y6 Z))) +def y437 : BTree (List Nat):=X (X y433 y434) (X y435 y436) +def y438 : BTree (List Nat):=X (X (X (X (L [22]) (L [11])) (X (L [15]) (L [147]))) (X Z (X Z y9))) (X (X (X y8 qB) Z) (X (X (L [20]) (L [15])) (X y145 (L [30,21])))) +def y439 : BTree (List Nat):=X (X (X (X (L [15]) y8) (X (L [11]) Z)) (X (X Z qB) (X (L [22]) Z))) (X (X (X Z (L [11])) (X (L [11]) Z)) (X (X (L [146]) y7) (X (L [66]) Z))) +def y440 : BTree (List Nat):=X (X (X (X (L [63]) Z) (X y7 (L [6]))) (X (X Z y13) (X y13 Z))) (X (X (X (L [33]) y7) (X y7 Z)) (X (X (L [11]) (L [23])) (X (L [54]) Z))) +def y441 : BTree (List Nat):=X (X (X (X Z y13) Z) (X (X y7 Z) (X (L [36]) (L [29])))) (X (X (X (L [15]) Z) Z) (X (X (L [66]) (L [131])) (X y7 Z))) +def y442 : BTree (List Nat):=X (X y438 y439) (X y440 y441) +def y443 : BTree (List Nat):=X (X (X y18 y13) (X (L [16,6]) (L [66,6,17,67,20,29,59,30]))) (X (X y19 y6) (X (L [36,35]) (L [29,104,105]))) +def y444 : BTree (List Nat):=X (X (X (X (L [17]) y7) (X y6 (L [8]))) (X (X y82 (L [9,11,10])) (X (L [9,11,10]) (L [40,23])))) y443 +def y445 : BTree (List Nat):=L [42,51,43,137,62] +def y446 : BTree (List Nat):=X (X (X (X y6 y18) (X y7 y82)) (X (X (L [22,17]) y13) (X (L [16]) (L [6,20,30])))) (X (X (X y445 y7) (X y7 (L [3]))) (X (X (L [53,74,18]) y6) (X (L [7,54,22,57]) Z))) +def y447 : BTree (List Nat):=X (X (X (X (L [49,67,59]) (L [9,11,10])) (X y6 (L [17]))) (X (X y445 (L [11])) (X (L [11]) (L [3])))) (X (X (X (L [103]) y6) (X y6 (L [3]))) (X (X y7 (L [61,40])) (X (L [7,36]) y445))) +def y448 : BTree (List Nat):=X (X (X (X y82 (L [11])) (X (L [9,11,10]) y445)) (X (X y6 y18) (X (L [35,34]) (L [104,23])))) (X (X (X y6 y445) (X y445 (L [3]))) (X (X (L [76,7,54]) (L [63])) (X y6 Z))) +def y449 : BTree (List Nat):=X (X y444 y446) (X y447 y448) +def y450 : BTree (List Nat):=L [110,9] +def y451 : BTree (List Nat):=X Z (X (X (L [3]) Z) Z) +def y452 : BTree (List Nat):=X (X (X Z (X Z y450)) (X (X (L [160,38]) Z) Z)) (X Z (X (X (L [161]) (L [110])) Z)) +def y453 : BTree (List Nat):=X (X (X (X (L [158,127,159]) Z) (X (L [110]) (L [160]))) Z) (X (X (X Z (L [110])) (X (L [110]) Z)) (X (X Z (L [155,27])) Z)) +def y454 : BTree (List Nat):=X (X (X (X y450 Z) Z) (X (X (L [110]) Z) Z)) (X Z (X (X (L [155]) (L [26])) (X (L [110]) Z))) +def y455 : BTree (List Nat):=X (X (X (X (X Z (X Z (L [148]))) (X (X y450 Z) Z)) y451) y452) (X y453 y454) +def y456 : BTree (List Nat):=X (X (X (X (L [30]) y21) (X y20 (L [3]))) Z) (X (X Z (X Z (L [24,16,27,28,38,23,39]))) (X (X (L [3]) y20) Z)) +def y457 : BTree (List Nat):=X (X (X (X y20 Z) (X y21 Z)) (X Z (X Z y17))) (X (X (X y19 y21) (X y21 (L [125,99,129,130,23,100]))) (X (X (L [3]) y30) Z)) +def y458 : BTree (List Nat):=X (X (X (L [3]) Z) (X y30 (L [78]))) (X (X y19 Z) (X Z (L [123,125,97,127,99,129,128,21,98,130,23,100]))) +def y459 : BTree (List Nat):=X (X (X Z (X Z y19)) (X (X y30 Z) Z)) (X (X (X y20 y19) (X y19 y254)) (X (X (L [56]) (L [80,162])) (X y30 Z))) +def y460 : BTree (List Nat):=X (X y456 y457) (X (X y458 (X (X (X Z y30) (X y30 y254)) (X (X y21 Z) (X Z y19)))) y459) +def y461 : BTree (List Nat):=X (X (X Z (X Z (L [133]))) Z) (X (X Z (X Z (L [29,25,30,59]))) (X (X (L [32,10]) Z) Z)) +def y462 : BTree (List Nat):=X (X (X (L [59,131]) Z) (X y21 (L [47]))) (X (X y20 Z) (X Z (L [40,101,23,21,61,26]))) +def y463 : BTree (List Nat):=X (X (X Z (X Z y20)) (X (X y21 Z) Z)) (X (X (X Z y20) (X y20 y155)) (X (X (L [57]) (L [163])) (X y21 Z))) +def y464 : BTree (List Nat):=X (X y461 (X y262 (X (X (X y20 Z) (X Z (L [101,21,26]))) (X (X (L [132]) y21) Z)))) (X (X y462 (X (X (X Z y21) (X y21 y155)) (X Z (X Z y20)))) y463) +def y465 : BTree (List Nat):=X (X (X (L [22]) y19) (X y13 (L [65]))) (X (X qB (L [42,33,11,43,62])) (X (L [42,33,11,43,62]) (L [7,54]))) +def y466 : BTree (List Nat):=X (X (X Z y28) (X (L [16,30]) (L [66,6,54,86,23,89]))) (X (X y20 y13) (X (L [21,61]) (L [66,6,34]))) +def y467 : BTree (List Nat):=L [51,52,31,32,72] +def y468 : BTree (List Nat):=X (X (X y467 y19) (X y19 (L [66,34,54,26,23,101]))) (X (X (L [44,60]) y28) (X (L [40,23,22,17]) Z)) +def y469 : BTree (List Nat):=X (X y465 y466) (X (X (X (X y13 Z) (X y19 qB)) (X (X (L [22]) y28) (X (L [30]) (L [6,89])))) y468) +def y470 : BTree (List Nat):=X (X (X (L [3]) (L [42,33,11,43,62])) (X y28 (L [48]))) (X (X y467 y38) (X y38 (L [36,66,7,34,35,54,61,21,26,40,23,101]))) +def y471 : BTree (List Nat):=X y470 (X (X (X y7 y28) (X y28 (L [36,7,35,61,21,40]))) (X (X y19 (L [36,7])) (X (L [61,40]) y467))) +def y472 : BTree (List Nat):=X (X (X qB y38) (X (L [42,33,11,43,62]) y467)) (X (X y28 (L [15,19,45,20])) (X (L [21,29]) (L [54,66]))) +def y473 : BTree (List Nat):=X y472 (X (X (X y13 y467) (X y467 (L [36,7,35,61,21,40]))) (X (X y155 (L [63,64])) (X y28 Z))) +def y474 : BTree (List Nat):=X y469 (X y471 y473) +def y475 : BTree (List Nat):=X (X (X (X y21 Z) (X y20 Z)) (X Z (X Z (L [22])))) (X (X (X y18 y20) (X y20 y60)) (X (X (L [52,84,107,109]) y19) Z)) +def y476 : BTree (List Nat):=X (X (X (X (X (L [47]) y20) (X y21 (L [87,102,112]))) Z) (X y59 (X (X y18 y21) Z))) y475 +def y477 : BTree (List Nat):=X (X (X (X (L [80]) Z) (X y19 y17)) y63) (X (X (X Z y19) (X y19 y64)) (X (X y20 Z) (X Z y18))) +def y478 : BTree (List Nat):=X (X (X Z (X Z y18)) (X (X y19 Z) Z)) (X (X (X y21 y18) (X y18 y64)) (X (X (L [25,24,27,59,28]) (L [49,67,59])) (X y19 Z))) +def y479 : BTree (List Nat):=X y476 (X y477 y478) +def y480 : BTree (List Nat):=X (X (X (X Z (L [110])) Z) (X Z (X Z (L [155,27])))) (X (X (X y450 Z) (X Z (L [167,168,169]))) (X (X (L [116,20]) Z) Z)) +def y481 : BTree (List Nat):=X (X (X (X Z y450) (X (L [110]) Z)) (X Z (X Z (L [169])))) (X (X (X (L [164]) (L [110])) (X (L [110]) (L [173,174,175]))) (X (X (L [165]) Z) Z)) +def y482 : BTree (List Nat):=X (X (X (X (L [63]) Z) Z) (X (X (L [164]) Z) (X Z (L [176,171,173,177,174,175])))) (X (X Z (X Z (L [170,171,172]))) (X (X (L [110]) (L [122,166])) (X Z (L [164])))) +def y483 : BTree (List Nat):=X (X (X Z (X Z (L [164]))) Z) (X (X (X Z (L [164])) (X (L [164]) (L [176,171,177]))) (X (X (L [122]) Z) Z)) +def y484 : BTree (List Nat):=X (X y480 y481) (X y482 y483) +def y485 : BTree (List Nat):=X (X (X Z (X Z (L [87]))) (X (X y8 y13) (X y13 (L [29])))) (X (X (X (L [33]) Z) (X (L [22]) (L [90,37,22]))) (X (X (L [3]) Z) (X (L [54]) (L [61])))) +def y486 : BTree (List Nat):=X (X (X (L [15]) Z) (X Z (L [95,94,90]))) (X (X (L [69,84]) (L [11])) (X (L [6,34]) Z)) +def y487 : BTree (List Nat):=X (X (X (X (L [3]) y13) (X (L [11]) (L [16]))) (X (X (L [15]) qB) (X qB (L [93,95,91,92,94,90])))) (X (X (X Z (L [11])) (X (L [11]) (L [93,91,92]))) (X (X Z y9) (X (L [66]) (L [15])))) +def y488 : BTree (List Nat):=X (X (X Z (L [15])) (X (L [15]) (L [93,91,92]))) (X (X (L [34]) (L [67])) (X (L [11]) Z)) +def y489 : BTree (List Nat):=X (X y485 (X (X (X (X Z (L [33])) (X Z y8)) (X (X y17 Z) (L [22]))) y486)) (X y487 (X (X (X (X y8 qB) (X y13 (L [15]))) (X (X (L [11]) y27) (X y145 (L [21])))) y488)) +def y490 : BTree (List Nat):=X (X (X (X (L [22]) Z) (X y13 (L [102]))) (X Z (X Z (L [25,24,27,59,28])))) (X (X (X y19 y21) (X Z (L [61,21,48]))) (X (X y51 y13) (X (L [57]) (L [30])))) +def y491 : BTree (List Nat):=X (X (X (X y13 y19) Z) (X (X Z y21) (X (L [78]) (L [48])))) (X (X (X (L [50]) Z) (X Z (L [61,21,40]))) (X (X (L [107,137]) (L [9])) Z)) +def y492 : BTree (List Nat):=X (X (X (L [63]) Z) (X (L [9]) (L [38]))) (X (X (L [50]) y30) (X y30 (L [26,23,61,101,21,40]))) +def y493 : BTree (List Nat):=X (X (X (X Z y30) (X Z (L [50]))) (X (X (L [9]) Z) (X (L [56]) (L [29])))) (X (X (X y13 (L [50])) (X (L [50]) y128)) (X (X (L [66]) (L [49])) (X (L [9]) Z))) +def y494 : BTree (List Nat):=X (X y492 (X (X (X y20 (L [9])) (X (L [9]) y128)) (X (X Z (L [23])) (X Z (L [50]))))) y493 +def y495 : BTree (List Nat):=X (X y490 y491) y494 +def y496 : BTree (List Nat):=X (X (X (X (L [30]) y21) (X y20 (L [41]))) Z) (X (X Z (X Z (L [24,16,27,28,38,23,39]))) (X (X (L [3]) y20) Z)) +def y497 : BTree (List Nat):=X (X (X (X y20 Z) (X y21 Z)) (X Z (X Z y17))) (X (X (X y19 y21) (X y21 (L [125,99,129,130,23,100]))) (X (X (L [15,121,178]) y18) Z)) +def y498 : BTree (List Nat):=X (X (X (L [3]) Z) (X y18 (L [22]))) (X (X y19 Z) (X Z (L [123,125,97,127,99,129,128,21,98,130,23,100]))) +def y499 : BTree (List Nat):=X (X (X Z (X Z y19)) (X (X y18 Z) Z)) (X (X (X y20 y19) (X y19 y254)) (X (X (L [36]) (L [80])) (X y18 Z))) +def y500 : BTree (List Nat):=X (X y496 y497) (X (X y498 (X (X (X Z y18) (X y18 y254)) (X (X y21 Z) (X Z y19)))) y499) +def y501 : BTree (List Nat):=X (X Z (X (X y19 y30) (X y30 (L [29])))) (X (X (X y20 Z) (X (L [78]) (L [37,90,22]))) (X (X (L [3]) Z) Z)) +def y502 : BTree (List Nat):=X (X (X (X Z y20) (X Z y19)) (X (X y17 Z) (X (L [47]) (L [22])))) (X y283 (X (X (L [62]) Z) Z)) +def y503 : BTree (List Nat):=X (X (X (X (L [3]) y30) Z) (X (X y13 y21) (X y21 (L [93,91,95,92,94,90])))) (X (X Z (X Z (L [93,91,92]))) (X (X Z (L [25,24,27,59,28])) (X Z y13))) +def y504 : BTree (List Nat):=X (X (X (X y19 y21) (X y30 y13)) (X Z (X (L [57]) Z))) (X (X (X Z y13) (X y13 (L [93,91,92]))) (X (X (L [34]) Z) Z)) +def y505 : BTree (List Nat):=X (X y501 y502) (X y503 y504) +def y506 : BTree (List Nat):=X (X (X (X y17 y30) (X y19 Z)) (X (X y20 y21) (X y21 Z))) (X (X Z (X (L [47]) Z)) (X (X (L [44,47]) y19) Z)) +def y507 : BTree (List Nat):=X (X (X (X y19 Z) (X y30 y20)) (X (X (L [30]) Z) Z)) (X (X (X Z y30) (X y30 Z)) (X (X y58 Z) Z)) +def y508 : BTree (List Nat):=X (X (X (X y20 Z) (X y21 Z)) Z) (X (X (X y19 Z) Z) (X (X (L [55]) Z) Z)) +def y509 : BTree (List Nat):=X (X y506 y507) (X (X (X (X (X (L [40,133]) y21) Z) Z) (X Z (X (X y30 (L [29])) Z))) y508) +def y510 : BTree (List Nat):=L [42,69,43] +def y511 : BTree (List Nat):=X (X (X Z (X y510 Z)) (X Z (X Z (L [22])))) (X (X (X y18 y510) (X y510 y60)) (X (X (L [84]) (L [11])) Z)) +def y512 : BTree (List Nat):=X (X (X (X (X Z y510) (X Z (L [87]))) Z) (X y59 (X (X (L [15]) Z) Z))) y511 +def y513 : BTree (List Nat):=X (X (X y239 y63) (X y398 (X (X y510 Z) (X Z y18)))) (X (X (X Z (X Z y18)) (X (X (L [11]) Z) Z)) (X y171 y241)) +def y514 : BTree (List Nat):=X y512 y513 +def qt : BTree (List Nat):=X Z (X Z (X Z (L [3]))) +def y516 : BTree (List Nat):=X (X qt (X (X (X (L [2]) Z) Z) (X (X (L [3]) Z) Z))) (X (X (X (X Z (L [2])) Z) Z) Z) +def y517 : BTree (List Nat):=X y516 (X (X y204 (X Z (X (X Z (L [3])) Z))) Z) +def y518 : BTree (List Nat):=X (X (X (X (L [17]) Z) (X y6 Z)) (X (X y6 Z) Z)) (X Z (X (X y450 y6) Z)) +def y519 : BTree (List Nat):=X (X (X (X (X (L [26,101]) Z) Z) Z) (X Z (X (X Z (L [76])) Z))) (X y383 y383) +def y520 : BTree (List Nat):=X (X y518 (X (X (X (X y6 Z) (X Z y6)) (X (X (L [17]) Z) Z)) Z)) y519 +def y521 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [179]) Z) Z))) (X qt (X (X (X (L [152]) Z) (X Z (L [3]))) Z)) +def y522 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [152]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [152])))) +def y523 : BTree (List Nat):=X (X (X Z (X Z (L [152]))) Z) (X (X (X Z (L [152])) (X (L [152]) (L [3]))) Z) +def y524 : BTree (List Nat):=X y521 (X y522 y523) +def y525 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [180]) Z) Z))) (X qt (X (X (X (L [179]) Z) (X Z (L [3]))) Z)) +def y526 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [179]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [179])))) +def y527 : BTree (List Nat):=X (X (X Z (X Z (L [179]))) Z) (X (X (X Z (L [179])) (X (L [179]) (L [3]))) Z) +def y528 : BTree (List Nat):=X y525 (X y526 y527) +def y529 : BTree (List Nat):=X (X Z (X Z (X Z (L [183])))) (X (X (X (L [180]) Z) (X Z (L [3]))) Z) +def y530 : BTree (List Nat):=X (X (X (X (L [181]) Z) Z) (X (X (L [180]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [180])))) +def y531 : BTree (List Nat):=X (X (X Z (X Z (L [180]))) Z) (X (X (X Z (L [180])) (X (L [180]) (L [3]))) Z) +def y532 : BTree (List Nat):=X (X (X Z (X (X Z (X Z (L [182,181]))) (X (X (L [180]) Z) Z))) y529) (X y530 y531) +def y533 : BTree (List Nat):=X (X y204 (X Z (X (X Z (L [3])) Z))) (X (X (X (X (L [2]) Z) Z) Z) Z) +def y534 : BTree (List Nat):=X (X (X y0 y451) (X (X (X Z (X Z (L [2]))) (X (X (L [5]) Z) Z)) Z)) y533 +def y535 : BTree (List Nat):=X (X (X (X (L [5]) Z) (X (L [2]) Z)) Z) (X Z (X (X (L [3]) (L [2])) Z)) +def y536 : BTree (List Nat):=X (X (X (X (X (L [184]) Z) Z) Z) Z) (X Z (X (X (X (L [2]) Z) Z) Z)) +def y537 : BTree (List Nat):=X (X y535 (X (X (X (X (L [2]) Z) Z) Z) Z)) y536 +def y538 : BTree (List Nat):=X (X Z (X Z (X Z (L [160,38])))) (X (X (X y450 Z) (X Z (L [122,188,129,166,130]))) Z) +def y539 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [155,122,160,27,166,38]))) (X (X (L [165,185]) Z) Z))) y538 +def y540 : BTree (List Nat):=X (X (X (L [122,166]) Z) Z) (X (X y450 Z) (X Z (L [124,186,127,122,188,187,129,128,166,130]))) +def y541 : BTree (List Nat):=X (X (X Z (X Z y450)) Z) (X (X (X Z y450) (X y450 (L [124,186,127,187,128]))) Z) +def y542 : BTree (List Nat):=X y539 (X (X y540 (X (X Z (X Z (L [124,186,127,187,128]))) (X Z (X Z y450)))) y541) +def y543 : BTree (List Nat):=X (X (X (X (L [3]) Z) (X y510 (L [30]))) Z) (X (X (X Z y510) (X y510 Z)) Z) +def y544 : BTree (List Nat):=X y543 (X (X Z (X (X y510 Z) Z)) (X Z (X (X (L [29]) (L [3])) (X y510 Z)))) +def y545 : BTree (List Nat):=X (X (X y68 y451) (X Z (X Z (X (X (L [3]) y510) Z)))) y544 +def y546 : BTree (List Nat):=X (X (X (L [3]) Z) (X (L [33]) (L [30]))) (X (X y21 Z) (X Z (L [34,66,7,35,36,54]))) +def y547 : BTree (List Nat):=X (X (X Z (X Z y21)) (X (X (L [33]) Z) Z)) (X y106 (X (X (L [29]) (L [3])) (X (L [33]) Z))) +def y548 : BTree (List Nat):=X (X y69 (X y70 (X y102 (X (X (L [3]) (L [33])) Z)))) (X (X y546 (X (X (X Z (L [33])) (X (L [33]) y71)) (X Z (X Z y21)))) y547) +def y549 : BTree (List Nat):=X (X (X (X (L [16]) (L [15])) (X (L [11]) Z)) (X (X y38 Z) (X Z (L [21])))) (X (X (X Z y7) Z) (X (X (L [22,44]) (L [11])) (X (L [66]) (L [40,17])))) +def y550 : BTree (List Nat):=X (X (X (X (L [11]) Z) (X (L [15]) y38)) (X (X (L [30]) y7) Z)) (X (X (X Z (L [15])) (X (L [15]) Z)) (X (X (L [15]) Z) (X (L [35,16]) Z))) +def y551 : BTree (List Nat):=X (X (X (X (L [41,40]) Z) Z) Z) (X (X (X y6 Z) Z) (X (X (L [15]) (L [29])) (X (L [34]) Z))) +def y552 : BTree (List Nat):=X (X (X (X y38 Z) Z) (X (X Z (L [11])) (X (L [54]) (L [61])))) (X (X (X (L [11]) Z) Z) (X (X (L [35]) Z) Z)) +def y553 : BTree (List Nat):=X (X y549 y550) (X y551 y552) +def y554 : BTree (List Nat):=X (X Z (X (X y6 y27) (X y27 (L [40])))) (X (X (X y18 Z) (X (L [6]) (L [29,59,30]))) (X (X (L [31,32]) Z) (X (L [35]) y35))) +def y555 : BTree (List Nat):=X (X (X (X Z y18) (X Z y6)) (X (X (L [17]) Z) (X (L [16]) (L [30])))) (X (X (X y38 Z) (X Z (L [101,26,21]))) (X (X (L [18]) Z) (X (L [7,22,57]) Z))) +def y556 : BTree (List Nat):=X (X (X (X (L [106,59]) y27) Z) y209) (X (X Z (X Z y210)) (X (X Z (L [61])) (X (L [36]) y38))) +def y557 : BTree (List Nat):=X (X (X (X y6 (L [11])) (X y27 y38)) (X (X Z y18) (X (L [34]) (L [23])))) (X (X (X Z y38) (X y38 y210)) (X (X (L [7]) Z) Z)) +def y558 : BTree (List Nat):=X (X y554 y555) (X y556 y557) +def y559 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [103]) Z) Z))) (X qt (X (X (X (L [190]) Z) (X Z (L [3]))) Z)) +def y560 : BTree (List Nat):=X (X (X (X (L [189]) Z) Z) (X (X (L [190]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [190])))) +def y561 : BTree (List Nat):=X (X (X Z (X Z (L [190]))) Z) (X (X (X Z (L [190])) (X (L [190]) (L [3]))) Z) +def y562 : BTree (List Nat):=X y559 (X y560 y561) +def y563 : BTree (List Nat):=X (X (X (X (L [160,38]) Z) (X y450 Z)) Z) (X Z (X (X (L [191,192]) y450) Z)) +def y564 : BTree (List Nat):=X (X (X (X (X (L [186,128]) Z) Z) Z) Z) (X Z (X (X (X y450 Z) Z) Z)) +def y565 : BTree (List Nat):=X (X y563 (X (X (X (X y450 Z) Z) Z) Z)) y564 +def y566 : BTree (List Nat):=X (X (X Z (X Z (L [8]))) (X (X y6 y27) (X y27 (L [40])))) (X (X (X y18 Z) (X (L [6]) (L [29,66,30,6,67,79]))) (X (X (L [11]) Z) (X (L [35]) y35))) +def y567 : BTree (List Nat):=X (X (X (X Z y18) (X Z y6)) (X (X (L [17]) Z) (X (L [16]) (L [30,6,79])))) (X (X (X y214 Z) (X Z (L [3]))) (X (X (L [18,74]) y51) (X (L [7,22,57]) Z))) +def y568 : BTree (List Nat):=X (X (X (X (L [67]) y27) (X y51 (L [17]))) (X (X y214 (L [11])) (X (L [11]) (L [3])))) (X (X (X Z y51) (X y51 (L [3]))) (X (X Z (L [61])) (X (L [36]) y214))) +def y569 : BTree (List Nat):=X (X (X (X y6 (L [11])) (X y27 y214)) (X (X y51 y18) (X (L [34]) (L [23])))) (X (X (X Z y214) (X y214 (L [3]))) (X (X (L [7,76]) (L [63])) (X y51 Z))) +def y570 : BTree (List Nat):=X (X y566 y567) (X y568 y569) +def y571 : BTree (List Nat):=L [15,81,142] +def y572 : BTree (List Nat):=X (X (X (X (L [47,193]) qa0) (X y571 (L [88]))) Z) (X Z (X (X (L [45,58]) y571) Z)) +def y573 : BTree (List Nat):=X (X (X (X y571 Z) (X qa0 Z)) Z) (X (X (X Z qa0) (X qa0 Z)) (X (X (L [85]) qai) Z)) +def y574 : BTree (List Nat):=X (X (X (X (L [80,162]) Z) (X qai (L [89]))) Z) (X (X (X Z qai) (X qai Z)) (X (X qa0 Z) Z)) +def y575 : BTree (List Nat):=X (X Z (X (X qai Z) Z)) (X (X (X y571 Z) Z) (X (X (L [86]) (L [68])) (X qai Z))) +def y576 : BTree (List Nat):=X (X y572 y573) (X y574 y575) +def y577 : BTree (List Nat):=X (X Z (X Z (X Z (L [47,193])))) (X (X (X y571 Z) (X Z (L [3]))) (X (X (L [3]) qa0) Z)) +def y578 : BTree (List Nat):=X (X (X (X (L [3]) Z) (X qa0 (L [30]))) (X (X y571 Z) (X Z (L [3])))) (X (X (X Z qa0) (X qa0 (L [3]))) (X Z (X Z y571))) +def y579 : BTree (List Nat):=X (X (X Z (X Z y571)) (X (X qa0 Z) Z)) (X (X (X Z y571) (X y571 (L [3]))) y172) +def y580 : BTree (List Nat):=X (X (X y68 (X (X Z (X Z (L [3]))) (X (X (L [3]) Z) Z))) y577) (X y578 y579) +def y581 : BTree (List Nat):=X (X (X (X (L [30]) Z) (X y38 (L [41]))) (X Z (X Z (L [61])))) (X (X (X y6 (L [11])) (X Z (L [24,122,16]))) (X (X (L [3]) y38) (X (L [34]) (L [22,23])))) +def y582 : BTree (List Nat):=X (X (X (X y38 y6) Z) (X (X Z (L [11])) (X (L [6]) (L [16])))) (X y216 (X (X (L [3]) (L [15])) (X (L [36]) Z))) +def y583 : BTree (List Nat):=X (X (X (L [3]) Z) (X (L [15]) (L [22]))) (X (X (L [11]) y7) (X y7 (L [123,124,125,97,122,99]))) +def y584 : BTree (List Nat):=X (X (X (X Z y7) (X Z (L [11]))) (X (X (L [15]) Z) (X (L [66]) (L [40])))) (X (X (X y38 (L [11])) (X (L [11]) (L [123,124,97]))) (X (X (L [36]) (L [80])) (X (L [15]) Z))) +def y585 : BTree (List Nat):=X (X y583 (X (X (L [15]) (X (L [15]) (L [123,124,97]))) (X (X Z (L [21])) (X (L [35]) (L [11]))))) y584 +def y586 : BTree (List Nat):=X (X y581 y582) y585 +def y587 : BTree (List Nat):=X (X (X Z (X qav Z)) (X Z (X Z (L [22])))) (X (X (X y18 qav) (X qav y60)) (X (X (L [84]) (L [11])) Z)) +def y588 : BTree (List Nat):=X (X (X (X (X Z qav) (X Z (L [87]))) Z) (X y59 (X (X (L [15]) Z) Z))) y587 +def y589 : BTree (List Nat):=X (X (X y239 y63) (X y398 (X (X qav Z) (X Z y18)))) (X (X (X Z (X Z y18)) (X (X (L [11]) Z) Z)) (X y171 y241)) +def y590 : BTree (List Nat):=X y588 y589 +def y591 : BTree (List Nat):=X (X Z (X (X y6 y7) (X y7 (L [40])))) (X (X (X (L [15]) Z) (X (L [6]) (L [29,59,30]))) (X (X (L [31,32]) Z) (X (L [35]) y9))) +def y592 : BTree (List Nat):=X (X y298 (X (X (L [17]) Z) (X (L [16]) (L [30])))) (X (X (X y38 Z) (X Z (L [101,26,21]))) (X (X (L [18]) Z) (X (L [37,22,7]) Z))) +def y593 : BTree (List Nat):=X (X (X (X (L [106,59]) y7) Z) y209) (X (X Z (X Z y210)) (X (X Z (L [61])) (X (L [36]) y38))) +def y594 : BTree (List Nat):=X (X (X (X y6 (L [11])) (X y7 y38)) (X (X Z y13) (X (L [34]) (L [23])))) (X (X (X Z y38) (X y38 y210)) (X (X (L [7]) Z) Z)) +def y595 : BTree (List Nat):=X (X y591 y592) (X y593 y594) +def y596 : BTree (List Nat):=X (X (X (X (L [183]) Z) (X (L [180]) (L [197]))) (X (X (L [180]) Z) Z)) (X (X Z (X Z (L [3]))) (X (X (L [195]) (L [180])) Z)) +def y597 : BTree (List Nat):=X (X (X (X (L [180]) Z) (X Z (L [180]))) (X (X (L [183]) Z) (X Z (L [3])))) (X (X (X (L [194]) Z) (X Z (L [3]))) (X (X (L [196]) (L [180])) Z)) +def y598 : BTree (List Nat):=X (X (X (X (L [3]) Z) (X (L [180]) (L [183]))) (X (X (L [194]) Z) (X Z (L [3])))) (X (X (X Z (L [180])) (X (L [180]) (L [3]))) (X (X Z (L [182])) (X Z (L [194])))) +def y599 : BTree (List Nat):=X (X (X (X (L [180]) Z) (X Z (L [194]))) (X (X (L [180]) Z) Z)) (X (X (X (L [180]) (L [194])) (X (L [194]) (L [3]))) (X (X (L [182]) (L [181])) (X (L [180]) Z))) +def y600 : BTree (List Nat):=X (X y596 y597) (X y598 y599) +def y601 : BTree (List Nat):=X (X (X (X (L [183]) Z) (X (L [180]) Z)) Z) (X Z (X (X (L [195]) (L [180])) Z)) +def y602 : BTree (List Nat):=X (X y601 (X (X (X (X (L [180]) Z) Z) Z) Z)) (X (X y204 Z) (X Z (X (X (X (L [180]) Z) Z) Z))) +def y603 : BTree (List Nat):=X (X (X (X (L [16]) (L [15])) (X (L [11]) (L [8]))) (X Z (X Z (L [36])))) (X (X (X y13 (L [33])) (X Z (L [66,54,6]))) (X (X (L [3]) (L [11])) (X (L [29]) (L [22,54])))) +def y604 : BTree (List Nat):=X (X (X (X (L [11]) y13) (X (L [15]) Z)) (X (X Z (L [33])) (X y17 (L [6])))) (X (X (X y7 (L [15])) (X (L [15]) y121)) (X (X (L [3]) y6) (X (L [61]) Z))) +def y605 : BTree (List Nat):=X (X (X (X (L [3]) Z) (X y6 (L [17]))) (X (X y7 y8) (X y8 (L [36,35,66,7,54,34])))) (X (X (X qB y6) (X y6 (L [36,35,7]))) (X (X (L [15]) (L [35])) (X (L [21]) y7))) +def y606 : BTree (List Nat):=X (X (X (X Z y8) (X Z y7)) (X (X y6 Z) (X y9 y145))) (X (X (X (L [11]) y7) (X y7 (L [36,35,7]))) (X (X (L [61]) (L [63])) (X y6 Z))) +def y607 : BTree (List Nat):=X (X y603 y604) (X y605 y606) +def y608 : BTree (List Nat):=X (X (X (X (L [3]) Z) (X qav (L [30]))) Z) (X (X (X Z qav) (X qav Z)) Z) +def y609 : BTree (List Nat):=X y608 (X (X Z (X (X qav Z) Z)) (X Z (X (X (L [29]) (L [3])) (X qav Z)))) +def y610 : BTree (List Nat):=X (X (X y68 y451) (X Z (X Z (X (X (L [3]) qav) Z)))) y609 +def y611 : BTree (List Nat):=X (X (X (X (L [3]) Z) (X y20 (L [30]))) (X (X y21 Z) (X Z (L [34,66,7,35,36,54])))) (X (X (X Z y20) (X y20 y71)) (X Z (X Z y21))) +def y612 : BTree (List Nat):=X (X (X Z (X Z y21)) (X (X y20 Z) Z)) (X y106 (X (X (L [29]) (L [3])) (X y20 Z))) +def y613 : BTree (List Nat):=X (X y69 (X y70 (X y102 (X (X (L [3]) y20) Z)))) (X y611 y612) +def y614 : BTree (List Nat):=X (X (X Z (X Z (L [65]))) Z) (X (X Z (X Z (L [66,6,54]))) (X (X (L [33]) Z) Z)) +def y615 : BTree (List Nat):=X (X Z (X Z (X Z (L [6])))) (X (X (X y27 Z) (X Z (L [66,34,54]))) (X (X (L [60]) y28) Z)) +def y616 : BTree (List Nat):=X (X (X (X (L [3]) Z) (X y28 (L [48]))) (X (X y27 Z) (X Z (L [36,66,7,34,35,54])))) (X (X (X Z y28) (X y28 (L [36,7,35]))) (X Z (X Z y27))) +def y617 : BTree (List Nat):=X (X (X Z (X Z y27)) (X (X y28 Z) Z)) (X (X (X Z y27) (X y27 (L [36,7,35]))) (X (X (L [61]) (L [63,64])) (X y28 Z))) +def y618 : BTree (List Nat):=X (X y614 y615) (X y616 y617) +def y619 : BTree (List Nat):=X (X (X (X (L [140]) Z) Z) Z) (X (X (X (L [2]) Z) Z) (X (X Z (L [184])) Z)) +def y620 : BTree (List Nat):=X (X (X qt (X Z (X (X (L [73]) Z) (X Z (L [5]))))) Z) (X y619 (X qt Z)) +def y621 : BTree (List Nat):=X (X (X Z y28) (X (L [30,16]) (L [86,23,89]))) (X (X qav y13) (X (L [21,61]) (L [6,66,34]))) +def y622 : BTree (List Nat):=X (X (X (X (L [22]) y8) (X y13 Z)) (X (X qB (L [33,11])) (X (L [33,11]) (L [7,54])))) y621 +def y623 : BTree (List Nat):=X (X (X (X y13 Z) (X y8 qB)) (X (X (L [22]) y28) (X (L [30]) (L [89])))) (X (X (X qai y8) (X y8 y128)) (X (X (L [96,44]) Z) (X (L [40,23,22,17]) Z))) +def y624 : BTree (List Nat):=X (X (X (X (L [3]) (L [33,11])) Z) (X (X qai y38) (X y38 (L [61,21,26,40,23,101])))) (X (X (X y27 Z) (X Z (L [61,21,40]))) (X (X y8 (L [36,7])) (X (L [61,40]) qai))) +def y625 : BTree (List Nat):=X (X y622 y623) (X y624 (X y187 (X (X (X y13 qai) (X qai (L [61,21,40]))) y188))) +def y626 : BTree (List Nat):=X (X (X (L [22]) y19) (X y18 Z)) (X (X (L [15,45,46]) (L [42,11,33,32,43,72,62])) (X (L [42,11,33,32,43,72,62]) (L [7,54,57]))) +def y627 : BTree (List Nat):=X (X (X y58 y6) (X (L [89,30]) (L [24,16,27,28,38,23,39]))) (X (X y510 y18) (X (L [61,21]) (L [34,66,6]))) +def y628 : BTree (List Nat):=X (X y626 y627) (X (X (X (X y18 y58) (X y19 (L [15,45,46]))) (X (X (L [47]) y6) (X (L [30]) y17))) y251) +def y629 : BTree (List Nat):=X (X y253 (X (X (X y7 Z) (X Z y254)) (X (X y19 (L [7,57,36])) (X (L [40,61]) y8)))) (X y255 (X (X (X y18 y8) (X y8 y254)) y188)) +def y630 : BTree (List Nat):=X y628 y629 +def y631 : BTree (List Nat):=X (X (X (X (L [16]) y18) (X (L [11]) (L [8]))) (X Z (X Z (L [36])))) (X (X (X y18 qa2) (X Z (L [66,6,54]))) (X (X (L [3]) (L [11])) (X (L [29]) (L [54,47])))) +def y632 : BTree (List Nat):=X (X (X (X (L [11]) y18) (X y18 Z)) (X (X Z qa2) (X y17 (L [6])))) (X (X (X y27 y18) (X y18 (L [66,34,54]))) (X (X (L [3]) y6) (X (L [61]) Z))) +def y633 : BTree (List Nat):=X (X (X (X (L [3]) Z) (X y6 (L [17]))) (X (X y27 y19) (X y19 (L [36,66,7,34,35,54])))) (X (X (X y21 y6) (X y6 (L [36,7,35]))) (X (X y18 (L [35])) (X (L [21]) y27))) +def y634 : BTree (List Nat):=X (X (X (X Z y19) (X Z y27)) (X (X y6 Z) (X y35 (L [7,57])))) (X (X (X (L [11]) y27) (X y27 (L [36,7,35]))) (X (X (L [61]) (L [63])) (X y6 Z))) +def y635 : BTree (List Nat):=X (X y631 y632) (X y633 y634) +def y636 : BTree (List Nat):=X (X Z (X Z (X Z (L [105])))) (X (X (X (L [103]) Z) (X Z y128)) Z) +def y637 : BTree (List Nat):=X (X (X (X (L [23]) Z) Z) (X (X (L [103]) Z) (X Z (L [61,21,26,40,23,101])))) (X (X Z (X Z (L [61,21,40]))) (X Z (X Z (L [103])))) +def y638 : BTree (List Nat):=X (X (X Z (X Z (L [103]))) Z) (X (X (X Z (L [103])) (X (L [103]) (L [61,21,40]))) Z) +def y639 : BTree (List Nat):=X (X (X Z (X (X Z (X Z (L [104,23,105]))) (X (X (L [115]) Z) Z))) y636) (X y637 y638) +def y640 : BTree (List Nat):=X (X (X (X (L [47]) qa2) (X y21 (L [87,102,112]))) (X Z (X Z (L [66])))) (X (X (X y7 (L [15])) (X Z (L [56,55,78]))) (X (X y58 y21) (X (L [40]) (L [35,16])))) +def y641 : BTree (List Nat):=X (X (X (X y21 y7) (X qa2 Z)) (X (X Z (L [15])) (X (L [17]) (L [78])))) (X (X (X y30 qa2) (X qa2 (L [36,35,7]))) (X (X (L [52,84,107,109]) y19) (X y9 Z))) +def y642 : BTree (List Nat):=X (X (X (X (L [80,55]) Z) (X y19 y17)) (X (X y30 y6) (X y6 (L [66,54,36,34,35,7])))) (X (X (X (L [11]) y19) (X y19 y121)) (X (X qa2 (L [54])) (X (L [23]) y30))) +def y643 : BTree (List Nat):=X (X (X (X Z y6) (X Z y30)) (X (X y19 Z) (X (L [61]) (L [34])))) (X (X (X y21 y30) (X y30 y121)) (X (X y35 (L [49,67,59])) (X y19 Z))) +def y644 : BTree (List Nat):=X (X y640 y641) (X y642 y643) +def y645 : BTree (List Nat):=X (X (X (X Z (X Z (L [199]))) Z) (X Z (X (X (L [46]) Z) Z))) (X Z (X Z (X (X (L [198]) (L [103])) Z))) +def y646 : BTree (List Nat):=X (X (X (X (X (L [163]) Z) (X (L [103]) (L [105]))) Z) (X y175 Z)) (X y205 (X Z (X (X (L [104]) (L [189])) (X (L [103]) Z)))) +def y647 : BTree (List Nat):=X y645 y646 +def y648 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [200]) Z) Z))) (X qt (X (X (X (L [195]) Z) (X Z (L [3]))) Z)) +def y649 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [195]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [195])))) +def y650 : BTree (List Nat):=X (X (X Z (X Z (L [195]))) Z) (X (X (X Z (L [195])) (X (L [195]) (L [3]))) Z) +def y651 : BTree (List Nat):=X y648 (X y649 y650) +def y652 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [201]) Z) Z))) (X qt (X (X (X (L [200]) Z) (X Z (L [3]))) Z)) +def y653 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [200]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [200])))) +def y654 : BTree (List Nat):=X (X (X Z (X Z (L [200]))) Z) (X (X (X Z (L [200])) (X (L [200]) (L [3]))) Z) +def y655 : BTree (List Nat):=X y652 (X y653 y654) +def y656 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [202]) Z) Z))) (X qt (X (X (X (L [201]) Z) (X Z (L [3]))) Z)) +def y657 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [201]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [201])))) +def y658 : BTree (List Nat):=X (X (X Z (X Z (L [201]))) Z) (X (X (X Z (L [201])) (X (L [201]) (L [3]))) Z) +def y659 : BTree (List Nat):=X y656 (X y657 y658) +def y660 : BTree (List Nat):=X (X Z (X Z (X Z (L [208])))) (X (X (X (L [202]) Z) (X Z (L [205]))) Z) +def y661 : BTree (List Nat):=X (X (X (X (L [203]) Z) Z) (X (X (L [202]) Z) (X Z (L [207])))) (X (X Z (X Z (L [204]))) (X Z (X Z (L [202])))) +def y662 : BTree (List Nat):=X (X (X Z (X Z (L [202]))) Z) (X (X (X Z (L [202])) (X (L [202]) (L [206]))) Z) +def y663 : BTree (List Nat):=X (X (X Z (X (X Z (X Z (L [203]))) (X (X (L [202]) Z) Z))) y660) (X y661 y662) +def y664 : BTree (List Nat):=X (X (X Z (X (L [2]) Z)) Z) (X (X (X Z (L [2])) (X (L [2]) Z)) (X (X (L [4]) Z) Z)) +def y665 : BTree (List Nat):=X (X (X (X (X Z (L [2])) Z) Z) (X Z (X (X (L [190]) Z) Z))) y664 +def y666 : BTree (List Nat):=X y665 (X (X y204 y0) (X Z y451)) +def y667 : BTree (List Nat):=X (X (X (X Z y38) (X Z (L [87]))) (X Z (X Z (L [66])))) (X (X (X y7 (L [15])) (X Z (L [90,37,22]))) (X (X (L [15]) Z) (X (L [40]) (L [35,16])))) +def y668 : BTree (List Nat):=X (X (X (X Z y7) (X y38 Z)) y164) (X (X (X (L [15]) y38) (X y38 (L [94,95,90]))) (X (X (L [84]) (L [11])) (X y9 Z))) +def y669 : BTree (List Nat):=X (X y239 (X (X (L [15]) y6) (X y6 (L [91,94,93,92,95,90])))) (X (X (L [11]) (X (L [11]) (L [91,93,92]))) (X (X y38 (L [54])) (X (L [23]) (L [15])))) +def y670 : BTree (List Nat):=X (X (X (X Z y6) (X Z (L [15]))) (X (X (L [11]) Z) (X (L [61]) (L [34])))) (X (X (X Z (L [15])) (X (L [15]) (L [91,93,92]))) y241) +def y671 : BTree (List Nat):=X (X y667 y668) (X y669 y670) +def y672 : BTree (List Nat):=X (X (X (X Z (L [103])) Z) (X Z (X (L [104]) Z))) (X Z (X (X (L [61]) Z) Z)) +def y673 : BTree (List Nat):=X (X (X Z y451) (X (X Z (X Z (X (L [105]) Z))) y451)) (X (X (X (X (X (L [3]) Z) Z) y175) Z) y672) +def y674 : BTree (List Nat):=X (X (X (X y17 y13) (X y8 Z)) (X (X (L [33]) qB) (X qB (L [21])))) (X (X (X Z y27) (X (L [22]) Z)) (X (X (L [44,22]) y8) (X (L [66]) (L [40,48])))) +def y675 : BTree (List Nat):=X (X (X (X y8 Z) (X y13 (L [33]))) (X (X (L [30]) y27) Z)) (X (X (X Z y13) (X y13 Z)) (X (X (L [209,15]) Z) (X (L [16,55]) Z))) +def y676 : BTree (List Nat):=X (X (X (X (L [40,41]) qB) Z) Z) (X (X (X y28 Z) Z) (X (X y13 (L [29])) (X (L [34]) Z))) +def y677 : BTree (List Nat):=X (X (X (X (L [33]) Z) (X qB Z)) (X (X Z (L [11])) (X (L [54]) (L [61])))) (X (X (X y8 Z) Z) (X (X (L [35]) Z) Z)) +def y678 : BTree (List Nat):=X (X y674 y675) (X y676 y677) +def y679 : BTree (List Nat):=X (X Z (X Z (X Z (L [104])))) (X (X (X (L [103]) Z) Z) (X (X (L [20]) Z) Z)) +def y680 : BTree (List Nat):=X (X (X (X (X (L [21]) Z) Z) Z) (X Z (X (X Z (L [23])) Z))) Z +def y681 : BTree (List Nat):=X (X y679 (X (X (X (X Z (L [103])) Z) Z) Z)) y680 +def y682 : BTree (List Nat):=X (X (X (X (X (L [61]) Z) Z) Z) (X Z (X (X Z (L [104])) Z))) (X (X (X (X (L [103]) Z) Z) Z) Z) +def y683 : BTree (List Nat):=X (X (X y205 y451) (X (X (X Z (X Z (L [103]))) (X (X (L [105]) Z) Z)) Z)) y682 +def y684 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [211]) Z) Z))) (X qt (X (X (X (L [210]) Z) (X Z (L [3]))) Z)) +def y685 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [210]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [210])))) +def y686 : BTree (List Nat):=X (X (X Z (X Z (L [210]))) Z) (X (X (X Z (L [210])) (X (L [210]) (L [3]))) Z) +def y687 : BTree (List Nat):=X y684 (X y685 y686) +def y688 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [213]) Z) Z))) (X qt (X (X (X (L [212]) Z) (X Z (L [3]))) Z)) +def y689 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [212]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [212])))) +def y690 : BTree (List Nat):=X (X (X Z (X Z (L [212]))) Z) (X (X (X Z (L [212])) (X (L [212]) (L [3]))) Z) +def y691 : BTree (List Nat):=X y688 (X y689 y690) +def y692 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [214]) Z) Z))) (X qt (X (X (X (L [213]) Z) (X Z (L [3]))) Z)) +def y693 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [213]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [213])))) +def y694 : BTree (List Nat):=X (X (X Z (X Z (L [213]))) Z) (X (X (X Z (L [213])) (X (L [213]) (L [3]))) Z) +def y695 : BTree (List Nat):=X y692 (X y693 y694) +def y696 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [215]) Z) Z))) (X qt (X (X (X (L [214]) Z) (X Z (L [3]))) Z)) +def y697 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [214]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [214])))) +def y698 : BTree (List Nat):=X (X (X Z (X Z (L [214]))) Z) (X (X (X Z (L [214])) (X (L [214]) (L [3]))) Z) +def y699 : BTree (List Nat):=X y696 (X y697 y698) +def y700 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [216]) Z) Z))) (X qt (X (X (X (L [215]) Z) (X Z (L [3]))) Z)) +def y701 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [215]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [215])))) +def y702 : BTree (List Nat):=X (X (X Z (X Z (L [215]))) Z) (X (X (X Z (L [215])) (X (L [215]) (L [3]))) Z) +def y703 : BTree (List Nat):=X y700 (X y701 y702) +def y704 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [217]) Z) Z))) (X qt (X (X (X (L [216]) Z) (X Z (L [3]))) Z)) +def y705 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [216]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [216])))) +def y706 : BTree (List Nat):=X (X (X Z (X Z (L [216]))) Z) (X (X (X Z (L [216])) (X (L [216]) (L [3]))) Z) +def y707 : BTree (List Nat):=X y704 (X y705 y706) +def y708 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [218]) Z) Z))) (X qt (X (X (X (L [217]) Z) (X Z (L [3]))) Z)) +def y709 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [217]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [217])))) +def y710 : BTree (List Nat):=X (X (X Z (X Z (L [217]))) Z) (X (X (X Z (L [217])) (X (L [217]) (L [3]))) Z) +def y711 : BTree (List Nat):=X y708 (X y709 y710) +def y712 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [219]) Z) Z))) (X qt (X (X (X (L [218]) Z) (X Z (L [3]))) Z)) +def y713 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [218]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [218])))) +def y714 : BTree (List Nat):=X (X (X Z (X Z (L [218]))) Z) (X (X (X Z (L [218])) (X (L [218]) (L [3]))) Z) +def y715 : BTree (List Nat):=X y712 (X y713 y714) +def y716 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [220]) Z) Z))) (X qt (X (X (X (L [219]) Z) (X Z (L [3]))) Z)) +def y717 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [219]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [219])))) +def y718 : BTree (List Nat):=X (X (X Z (X Z (L [219]))) Z) (X (X (X Z (L [219])) (X (L [219]) (L [3]))) Z) +def y719 : BTree (List Nat):=X y716 (X y717 y718) +def y720 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [221]) Z) Z))) (X qt (X (X (X (L [220]) Z) (X Z (L [3]))) Z)) +def y721 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [220]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [220])))) +def y722 : BTree (List Nat):=X (X (X Z (X Z (L [220]))) Z) (X (X (X Z (L [220])) (X (L [220]) (L [3]))) Z) +def y723 : BTree (List Nat):=X y720 (X y721 y722) +def y724 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [222]) Z) Z))) (X qt (X (X (X (L [221]) Z) (X Z (L [3]))) Z)) +def y725 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [221]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [221])))) +def y726 : BTree (List Nat):=X (X (X Z (X Z (L [221]))) Z) (X (X (X Z (L [221])) (X (L [221]) (L [3]))) Z) +def y727 : BTree (List Nat):=X y724 (X y725 y726) +def y728 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [223]) Z) Z))) (X qt (X (X (X (L [211]) Z) (X Z (L [3]))) Z)) +def y729 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [211]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [211])))) +def y730 : BTree (List Nat):=X (X (X Z (X Z (L [211]))) Z) (X (X (X Z (L [211])) (X (L [211]) (L [3]))) Z) +def y731 : BTree (List Nat):=X y728 (X y729 y730) +def y732 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [224]) Z) Z))) (X qt (X (X (X (L [222]) Z) (X Z (L [3]))) Z)) +def y733 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [222]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [222])))) +def y734 : BTree (List Nat):=X (X (X Z (X Z (L [222]))) Z) (X (X (X Z (L [222])) (X (L [222]) (L [3]))) Z) +def y735 : BTree (List Nat):=X y732 (X y733 y734) +def y736 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [225]) Z) Z))) (X qt (X (X (X (L [224]) Z) (X Z (L [3]))) Z)) +def y737 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [224]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [224])))) +def y738 : BTree (List Nat):=X (X (X Z (X Z (L [224]))) Z) (X (X (X Z (L [224])) (X (L [224]) (L [3]))) Z) +def y739 : BTree (List Nat):=X y736 (X y737 y738) +def y740 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [226]) Z) Z))) (X qt (X (X (X (L [225]) Z) (X Z (L [3]))) Z)) +def y741 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [225]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [225])))) +def y742 : BTree (List Nat):=X (X (X Z (X Z (L [225]))) Z) (X (X (X Z (L [225])) (X (L [225]) (L [3]))) Z) +def y743 : BTree (List Nat):=X y740 (X y741 y742) +def y744 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [227]) Z) Z))) (X qt (X (X (X (L [226]) Z) (X Z (L [3]))) Z)) +def y745 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [226]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [226])))) +def y746 : BTree (List Nat):=X (X (X Z (X Z (L [226]))) Z) (X (X (X Z (L [226])) (X (L [226]) (L [3]))) Z) +def y747 : BTree (List Nat):=X y744 (X y745 y746) +def y748 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [228]) Z) Z))) (X qt (X (X (X (L [227]) Z) (X Z (L [3]))) Z)) +def y749 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [227]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [227])))) +def y750 : BTree (List Nat):=X (X (X Z (X Z (L [227]))) Z) (X (X (X Z (L [227])) (X (L [227]) (L [3]))) Z) +def y751 : BTree (List Nat):=X y748 (X y749 y750) +def y752 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [229]) Z) Z))) (X qt (X (X (X (L [228]) Z) (X Z (L [3]))) Z)) +def y753 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [228]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [228])))) +def y754 : BTree (List Nat):=X (X (X Z (X Z (L [228]))) Z) (X (X (X Z (L [228])) (X (L [228]) (L [3]))) Z) +def y755 : BTree (List Nat):=X y752 (X y753 y754) +def y756 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [230]) Z) Z))) (X qt (X (X (X (L [229]) Z) (X Z (L [3]))) Z)) +def y757 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [229]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [229])))) +def y758 : BTree (List Nat):=X (X (X Z (X Z (L [229]))) Z) (X (X (X Z (L [229])) (X (L [229]) (L [3]))) Z) +def y759 : BTree (List Nat):=X y756 (X y757 y758) +def y760 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [194]) Z) Z))) (X qt (X (X (X (L [230]) Z) (X Z (L [3]))) Z)) +def y761 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [230]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [230])))) +def y762 : BTree (List Nat):=X (X (X Z (X Z (L [230]))) Z) (X (X (X Z (L [230])) (X (L [230]) (L [3]))) Z) +def y763 : BTree (List Nat):=X y760 (X y761 y762) +def y764 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [231]) Z) Z))) (X qt (X (X (X (L [223]) Z) (X Z (L [3]))) Z)) +def y765 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [223]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [223])))) +def y766 : BTree (List Nat):=X (X (X Z (X Z (L [223]))) Z) (X (X (X Z (L [223])) (X (L [223]) (L [3]))) Z) +def y767 : BTree (List Nat):=X y764 (X y765 y766) +def y768 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [232]) Z) Z))) (X qt (X (X (X (L [231]) Z) (X Z (L [3]))) Z)) +def y769 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [231]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [231])))) +def y770 : BTree (List Nat):=X (X (X Z (X Z (L [231]))) Z) (X (X (X Z (L [231])) (X (L [231]) (L [3]))) Z) +def y771 : BTree (List Nat):=X y768 (X y769 y770) +def y772 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [233]) Z) Z))) (X qt (X (X (X (L [232]) Z) (X Z (L [3]))) Z)) +def y773 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [232]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [232])))) +def y774 : BTree (List Nat):=X (X (X Z (X Z (L [232]))) Z) (X (X (X Z (L [232])) (X (L [232]) (L [3]))) Z) +def y775 : BTree (List Nat):=X y772 (X y773 y774) +def y776 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [234]) Z) Z))) (X qt (X (X (X (L [233]) Z) (X Z (L [3]))) Z)) +def y777 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [233]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [233])))) +def y778 : BTree (List Nat):=X (X (X Z (X Z (L [233]))) Z) (X (X (X Z (L [233])) (X (L [233]) (L [3]))) Z) +def y779 : BTree (List Nat):=X y776 (X y777 y778) +def y780 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [235]) Z) Z))) (X qt (X (X (X (L [234]) Z) (X Z (L [3]))) Z)) +def y781 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [234]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [234])))) +def y782 : BTree (List Nat):=X (X (X Z (X Z (L [234]))) Z) (X (X (X Z (L [234])) (X (L [234]) (L [3]))) Z) +def y783 : BTree (List Nat):=X y780 (X y781 y782) +def y784 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [236]) Z) Z))) (X qt (X (X (X (L [235]) Z) (X Z (L [3]))) Z)) +def y785 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [235]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [235])))) +def y786 : BTree (List Nat):=X (X (X Z (X Z (L [235]))) Z) (X (X (X Z (L [235])) (X (L [235]) (L [3]))) Z) +def y787 : BTree (List Nat):=X y784 (X y785 y786) +def y788 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [212]) Z) Z))) (X qt (X (X (X (L [236]) Z) (X Z (L [3]))) Z)) +def y789 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [236]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [236])))) +def y790 : BTree (List Nat):=X (X (X Z (X Z (L [236]))) Z) (X (X (X Z (L [236])) (X (L [236]) (L [3]))) Z) +def y791 : BTree (List Nat):=X y788 (X y789 y790) +def y792 : BTree (List Nat):=X (X Z (X Z (X Z (L [136])))) (X (X (X (L [73]) Z) (X Z (L [3]))) Z) +def y793 : BTree (List Nat):=X (X (X (X (L [77]) Z) Z) (X (X (L [73]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [73])))) +def y794 : BTree (List Nat):=X (X (X Z (X Z (L [73]))) Z) (X (X (X Z (L [73])) (X (L [73]) (L [3]))) Z) +def y795 : BTree (List Nat):=X (X (X Z (X (X Z (X Z (L [139,77,136]))) (X (X (L [75]) Z) Z))) y792) (X y793 y794) +def y796 : BTree (List Nat):=X (X Z (X Z (X Z (L [72])))) (X (X (X (L [75]) Z) (X Z (L [3]))) Z) +def y797 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [75]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [75])))) +def y798 : BTree (List Nat):=X (X (X Z (X Z (L [75]))) Z) (X (X (X Z (L [75])) (X (L [75]) (L [3]))) Z) +def y799 : BTree (List Nat):=X (X (X Z (X (X Z (X Z (L [3]))) (X (X (L [237]) Z) Z))) y796) (X y797 y798) +def y800 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [3]) Z) Z))) (X qt (X (X (X (L [237]) Z) (X Z (L [3]))) Z)) +def y801 : BTree (List Nat):=X (X (X (X (L [238]) Z) Z) (X (X (L [237]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [237])))) +def y802 : BTree (List Nat):=X (X (X Z (X Z (L [237]))) Z) (X (X (X Z (L [237])) (X (L [237]) (L [3]))) Z) +def y803 : BTree (List Nat):=X y800 (X y801 y802) +def y804 : BTree (List Nat):=X (X (X (X Z (X Z (L [240]))) Z) (X Z (X (X (L [210]) Z) Z))) (X Z (X Z (X (X (L [239]) (L [3])) Z))) +def y805 : BTree (List Nat):=X (X (X (X (L [3]) Z) (L [3])) Z) (X (X (X Z (L [3])) (X (L [3]) Z)) Z) +def y806 : BTree (List Nat):=X y804 (X y805 (X y451 (X Z (X (X (L [3]) (L [238])) (X (L [3]) Z))))) +def y807 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [242]) Z) Z))) (X qt (X (X (X (L [241]) Z) (X Z (L [3]))) Z)) +def y808 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [241]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [241])))) +def y809 : BTree (List Nat):=X (X (X Z (X Z (L [241]))) Z) (X (X (X Z (L [241])) (X (L [241]) (L [3]))) Z) +def y810 : BTree (List Nat):=X y807 (X y808 y809) +def y811 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [243]) Z) Z))) (X qt (X (X (X (L [242]) Z) (X Z (L [3]))) Z)) +def y812 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [242]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [242])))) +def y813 : BTree (List Nat):=X (X (X Z (X Z (L [242]))) Z) (X (X (X Z (L [242])) (X (L [242]) (L [3]))) Z) +def y814 : BTree (List Nat):=X y811 (X y812 y813) +def y815 : BTree (List Nat):=X (X Z (L [244])) (X (L [244]) Z) +def y816 : BTree (List Nat):=X (X (X Z y815) (X (X Z (X (L [245]) Z)) (X (X (L [3]) Z) Z))) (X Z y451) +def y817 : BTree (List Nat):=X (X (X (X (X (L [3]) (L [244])) Z) Z) Z) (X (X (X Z (X (L [244]) Z)) Z) y451) +def y818 : BTree (List Nat):=X y816 y817 +def y819 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [246]) Z) Z))) (X qt (X (X (X (L [243]) Z) (X Z (L [3]))) Z)) +def y820 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [243]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [243])))) +def y821 : BTree (List Nat):=X (X (X Z (X Z (L [243]))) Z) (X (X (X Z (L [243])) (X (L [243]) (L [3]))) Z) +def y822 : BTree (List Nat):=X y819 (X y820 y821) +def y823 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [247]) Z) Z))) (X qt (X (X (X (L [246]) Z) (X Z (L [3]))) Z)) +def y824 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [246]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [246])))) +def y825 : BTree (List Nat):=X (X (X Z (X Z (L [246]))) Z) (X (X (X Z (L [246])) (X (L [246]) (L [3]))) Z) +def y826 : BTree (List Nat):=X y823 (X y824 y825) +def y827 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [248]) Z) Z))) (X qt (X (X (X (L [247]) Z) (X Z (L [3]))) Z)) +def y828 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [247]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [247])))) +def y829 : BTree (List Nat):=X (X (X Z (X Z (L [247]))) Z) (X (X (X Z (L [247])) (X (L [247]) (L [3]))) Z) +def y830 : BTree (List Nat):=X y827 (X y828 y829) +def y831 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [150]) Z) Z))) (X qt (X (X (X (L [248]) Z) (X Z (L [3]))) Z)) +def y832 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [248]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [248])))) +def y833 : BTree (List Nat):=X (X (X Z (X Z (L [248]))) Z) (X (X (X Z (L [248])) (X (L [248]) (L [3]))) Z) +def y834 : BTree (List Nat):=X y831 (X y832 y833) +def y835 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [250]) Z) Z))) (X qt (X (X (X (L [249]) Z) (X Z (L [3]))) Z)) +def y836 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [249]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [249])))) +def y837 : BTree (List Nat):=X (X (X Z (X Z (L [249]))) Z) (X (X (X Z (L [249])) (X (L [249]) (L [3]))) Z) +def y838 : BTree (List Nat):=X y835 (X y836 y837) +def y839 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [252]) Z) Z))) (X qt (X (X (X (L [251]) Z) (X Z (L [3]))) Z)) +def y840 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [251]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [251])))) +def y841 : BTree (List Nat):=X (X (X Z (X Z (L [251]))) Z) (X (X (X Z (L [251])) (X (L [251]) (L [3]))) Z) +def y842 : BTree (List Nat):=X y839 (X y840 y841) +def y843 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [254]) Z) Z))) (X qt (X (X (X (L [253]) Z) (X Z (L [3]))) Z)) +def y844 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [253]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [253])))) +def y845 : BTree (List Nat):=X (X (X Z (X Z (L [253]))) Z) (X (X (X Z (L [253])) (X (L [253]) (L [3]))) Z) +def y846 : BTree (List Nat):=X y843 (X y844 y845) +def y847 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [255]) Z) Z))) (X qt (X (X (X (L [252]) Z) (X Z (L [3]))) Z)) +def y848 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [252]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [252])))) +def y849 : BTree (List Nat):=X (X (X Z (X Z (L [252]))) Z) (X (X (X Z (L [252])) (X (L [252]) (L [3]))) Z) +def y850 : BTree (List Nat):=X y847 (X y848 y849) +def y851 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [256]) Z) Z))) (X qt (X (X (X (L [255]) Z) (X Z (L [3]))) Z)) +def y852 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [255]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [255])))) +def y853 : BTree (List Nat):=X (X (X Z (X Z (L [255]))) Z) (X (X (X Z (L [255])) (X (L [255]) (L [3]))) Z) +def y854 : BTree (List Nat):=X y851 (X y852 y853) +def y855 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [257]) Z) Z))) (X qt (X (X (X (L [256]) Z) (X Z (L [3]))) Z)) +def y856 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [256]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [256])))) +def y857 : BTree (List Nat):=X (X (X Z (X Z (L [256]))) Z) (X (X (X Z (L [256])) (X (L [256]) (L [3]))) Z) +def y858 : BTree (List Nat):=X y855 (X y856 y857) +def y859 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [258]) Z) Z))) (X qt (X (X (X (L [257]) Z) (X Z (L [3]))) Z)) +def y860 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [257]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [257])))) +def y861 : BTree (List Nat):=X (X (X Z (X Z (L [257]))) Z) (X (X (X Z (L [257])) (X (L [257]) (L [3]))) Z) +def y862 : BTree (List Nat):=X y859 (X y860 y861) +def y863 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [259]) Z) Z))) (X qt (X (X (X (L [258]) Z) (X Z (L [3]))) Z)) +def y864 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [258]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [258])))) +def y865 : BTree (List Nat):=X (X (X Z (X Z (L [258]))) Z) (X (X (X Z (L [258])) (X (L [258]) (L [3]))) Z) +def y866 : BTree (List Nat):=X y863 (X y864 y865) +def y867 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [260]) Z) Z))) (X qt (X (X (X (L [250]) Z) (X Z (L [3]))) Z)) +def y868 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [250]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [250])))) +def y869 : BTree (List Nat):=X (X (X Z (X Z (L [250]))) Z) (X (X (X Z (L [250])) (X (L [250]) (L [3]))) Z) +def y870 : BTree (List Nat):=X y867 (X y868 y869) +def y871 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [261]) Z) Z))) (X qt (X (X (X (L [259]) Z) (X Z (L [3]))) Z)) +def y872 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [259]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [259])))) +def y873 : BTree (List Nat):=X (X (X Z (X Z (L [259]))) Z) (X (X (X Z (L [259])) (X (L [259]) (L [3]))) Z) +def y874 : BTree (List Nat):=X y871 (X y872 y873) +def y875 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [57,36,47]))) (X (X (L [178]) Z) Z))) (X y70 (X (X (X (L [46]) Z) (X Z (L [7,36,54]))) Z)) +def y876 : BTree (List Nat):=X (X (X (X (L [36]) Z) Z) (X (X (L [46]) Z) (X Z (L [34,66,7,35,36,54])))) (X (X Z (X Z y71)) (X Z (X Z (L [46])))) +def y877 : BTree (List Nat):=X (X (X Z (X Z (L [46]))) Z) (X (X (X Z (L [46])) (X (L [46]) y71)) Z) +def y878 : BTree (List Nat):=X y875 (X y876 y877) +def y879 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [244]) Z) Z))) (X qt (X (X (X (L [178]) Z) (X Z (L [3]))) Z)) +def y880 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [178]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [178])))) +def y881 : BTree (List Nat):=X (X (X Z (X Z (L [178]))) Z) (X (X (X Z (L [178])) (X (L [178]) (L [3]))) Z) +def y882 : BTree (List Nat):=X y879 (X y880 y881) +def y883 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [262]) Z) Z))) (X qt (X (X (X (L [261]) Z) (X Z (L [3]))) Z)) +def y884 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [261]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [261])))) +def y885 : BTree (List Nat):=X (X (X Z (X Z (L [261]))) Z) (X (X (X Z (L [261])) (X (L [261]) (L [3]))) Z) +def y886 : BTree (List Nat):=X y883 (X y884 y885) +def y887 : BTree (List Nat):=X (X Z (X (X (L [244]) Z) Z)) (X Z (X (X (L [263]) (L [3])) (X (L [244]) Z))) +def y888 : BTree (List Nat):=X (X (X y68 y451) (X Z (X Z (X (X (L [3]) (L [244])) Z)))) (X (X (X (X (X (L [3]) Z) (X (L [244]) (L [245]))) Z) (X y815 Z)) y887) +def y889 : BTree (List Nat):=X (X (X (X (X Z (L [244])) Z) Z) y451) (X (X (X Z (X (L [244]) Z)) Z) (X y815 (X (X (L [3]) Z) Z))) +def y890 : BTree (List Nat):=X y889 (X (X y204 (X Z (X (X (L [244]) Z) Z))) (X Z y451)) +def y891 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [264]) Z) Z))) (X qt (X (X (X (L [262]) Z) (X Z (L [3]))) Z)) +def y892 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [262]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [262])))) +def y893 : BTree (List Nat):=X (X (X Z (X Z (L [262]))) Z) (X (X (X Z (L [262])) (X (L [262]) (L [3]))) Z) +def y894 : BTree (List Nat):=X y891 (X y892 y893) +def y895 : BTree (List Nat):=X (X Z (X Z (X (X (L [253]) Z) Z))) (X (X Z (X Z (X (L [245]) Z))) (X Z (X (X (L [265]) Z) Z))) +def y896 : BTree (List Nat):=X (X (X (X (X (L [3]) Z) Z) y815) Z) (X (X (X (X Z (L [244])) Z) (X Z (X (L [263]) Z))) y451) +def y897 : BTree (List Nat):=X y895 y896 +def y898 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [266]) Z) Z))) (X qt (X (X (X (L [264]) Z) (X Z (L [3]))) Z)) +def y899 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [264]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [264])))) +def y900 : BTree (List Nat):=X (X (X Z (X Z (L [264]))) Z) (X (X (X Z (L [264])) (X (L [264]) (L [3]))) Z) +def y901 : BTree (List Nat):=X y898 (X y899 y900) +def y902 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [267]) Z) Z))) (X qt (X (X (X (L [266]) Z) (X Z (L [3]))) Z)) +def y903 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [266]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [266])))) +def y904 : BTree (List Nat):=X (X (X Z (X Z (L [266]))) Z) (X (X (X Z (L [266])) (X (L [266]) (L [3]))) Z) +def y905 : BTree (List Nat):=X y902 (X y903 y904) +def y906 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [268]) Z) Z))) (X qt (X (X (X (L [267]) Z) (X Z (L [3]))) Z)) +def y907 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [267]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [267])))) +def y908 : BTree (List Nat):=X (X (X Z (X Z (L [267]))) Z) (X (X (X Z (L [267])) (X (L [267]) (L [3]))) Z) +def y909 : BTree (List Nat):=X y906 (X y907 y908) +def y910 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [249]) Z) Z))) (X qt (X (X (X (L [268]) Z) (X Z (L [3]))) Z)) +def y911 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [268]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [268])))) +def y912 : BTree (List Nat):=X (X (X Z (X Z (L [268]))) Z) (X (X (X Z (L [268])) (X (L [268]) (L [3]))) Z) +def y913 : BTree (List Nat):=X y910 (X y911 y912) +def y914 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [269]) Z) Z))) (X qt (X (X (X (L [260]) Z) (X Z (L [3]))) Z)) +def y915 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [260]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [260])))) +def y916 : BTree (List Nat):=X (X (X Z (X Z (L [260]))) Z) (X (X (X Z (L [260])) (X (L [260]) (L [3]))) Z) +def y917 : BTree (List Nat):=X y914 (X y915 y916) +def y918 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [270]) Z) Z))) (X qt (X (X (X (L [269]) Z) (X Z (L [3]))) Z)) +def y919 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [269]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [269])))) +def y920 : BTree (List Nat):=X (X (X Z (X Z (L [269]))) Z) (X (X (X Z (L [269])) (X (L [269]) (L [3]))) Z) +def y921 : BTree (List Nat):=X y918 (X y919 y920) +def y922 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [251]) Z) Z))) (X qt (X (X (X (L [254]) Z) (X Z (L [3]))) Z)) +def y923 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [254]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [254])))) +def y924 : BTree (List Nat):=X (X (X Z (X Z (L [254]))) Z) (X (X (X Z (L [254])) (X (L [254]) (L [3]))) Z) +def y925 : BTree (List Nat):=X y922 (X y923 y924) +def y926 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [271]) Z) Z))) (X qt (X (X (X (L [270]) Z) (X Z (L [3]))) Z)) +def y927 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [270]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [270])))) +def y928 : BTree (List Nat):=X (X (X Z (X Z (L [270]))) Z) (X (X (X Z (L [270])) (X (L [270]) (L [3]))) Z) +def y929 : BTree (List Nat):=X y926 (X y927 y928) +def y930 : BTree (List Nat):=X (X Z (X (X Z (X Z (L [3]))) (X (X (L [241]) Z) Z))) (X qt (X (X (X (L [271]) Z) (X Z (L [3]))) Z)) +def y931 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [271]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [271])))) +def y932 : BTree (List Nat):=X (X (X Z (X Z (L [271]))) Z) (X (X (X Z (L [271])) (X (L [271]) (L [3]))) Z) +def y933 : BTree (List Nat):=X y930 (X y931 y932) +def y934 : BTree (List Nat):=X (X Z (X Z (X Z (L [169])))) (X (X (X (L [164]) Z) (X Z (L [173,174,175]))) Z) +def y935 : BTree (List Nat):=X (X (X (X (L [168]) Z) Z) (X (X (L [164]) Z) (X Z (L [176,171,173,177,174,175])))) (X (X Z (X Z (L [170,171,172]))) (X Z (X Z (L [164])))) +def y936 : BTree (List Nat):=X (X (X Z (X Z (L [164]))) Z) (X (X (X Z (L [164])) (X (L [164]) (L [176,171,177]))) Z) +def y937 : BTree (List Nat):=X (X (X Z (X (X Z (X Z (L [167,168,169]))) (X (X (L [116]) Z) Z))) y934) (X y935 y936) +def y938 : BTree (List Nat):=X (X Z (X Z (X Z (L [274])))) (X (X (X (L [116]) Z) (X Z (L [278,279,280]))) Z) +def y939 : BTree (List Nat):=X (X (X (X (L [272]) Z) Z) (X (X (L [116]) Z) (X Z (L [281,276,278,282,279,280])))) (X (X Z (X Z (L [275,276,277]))) (X Z (X Z (L [116])))) +def y940 : BTree (List Nat):=X (X (X Z (X Z (L [116]))) Z) (X (X (X Z (L [116])) (X (L [116]) (L [281,276,282]))) Z) +def y941 : BTree (List Nat):=X (X (X Z (X (X Z (X Z (L [273,272,274]))) (X (X (L [164]) Z) Z))) y938) (X y939 y940) +def y942 : BTree (List Nat):=X (X (X (X Z (X Z (L [156]))) Z) (X Z (X (X (L [283]) Z) Z))) (X Z (X Z (X (X (L [153]) (L [151])) Z))) +def y943 : BTree (List Nat):=X (X (X (X (L [159]) Z) (X (L [151]) (L [157]))) Z) (X (X (X Z (L [151])) (X (L [151]) Z)) Z) +def y944 : BTree (List Nat):=X Z (X (X (L [151]) Z) Z) +def y945 : BTree (List Nat):=X y942 (X y943 (X y944 (X Z (X (X (L [155]) (L [119])) (X (L [151]) Z))))) +def y946 : BTree (List Nat):=X (X (X Z (X (L [151]) Z)) Z) (X (X (X Z (L [151])) (X (L [151]) Z)) (X (X (L [165]) Z) Z)) +def y947 : BTree (List Nat):=X (X (X (X (X Z (L [151])) Z) Z) (X Z (X (X (L [284]) Z) Z))) y946 +def y948 : BTree (List Nat):=X (X (X (X (X (L [63]) Z) Z) Z) y944) (X Z (X Z (X (X (L [122]) Z) Z))) +def y949 : BTree (List Nat):=X y947 y948 +def y950 : BTree (List Nat):=X (X (X (X (L [21]) Z) Z) (X (X (L [20]) Z) (X Z (L [26,23,61,101,21,40])))) (X (X Z (X Z y128)) (X Z (X Z (L [20])))) +def y951 : BTree (List Nat):=X (X (X Z (X Z (L [20]))) Z) (X (X (X Z (L [20])) (X (L [20]) y128)) Z) +def y952 : BTree (List Nat):=X (X y179 (X y180 (X (X (X (L [20]) Z) (X Z (L [61,21,40]))) Z))) (X y950 y951) +def y953 : BTree (List Nat):=X (X Z (X Z (X Z (L [193])))) (X (X (X (L [142]) Z) (X Z (L [3]))) Z) +def y954 : BTree (List Nat):=X (X (X (X (L [3]) Z) Z) (X (X (L [142]) Z) (X Z (L [3])))) (X (X Z (X Z (L [3]))) (X Z (X Z (L [142])))) +def y955 : BTree (List Nat):=X (X (X Z (X Z (L [142]))) Z) (X (X (X Z (L [142])) (X (L [142]) (L [3]))) Z) +def y956 : BTree (List Nat):=X (X (X Z (X (X Z (X Z (L [3]))) (X (X (L [3]) Z) Z))) y953) (X y954 y955) +def y957 : BTree (List Nat):=X (X (X (X (L [193]) Z) (X (L [142]) Z)) Z) (X Z (X (X (L [58]) (L [142])) Z)) +def y958 : BTree (List Nat):=X (X (X (X (X (L [162]) Z) Z) Z) Z) (X Z (X (X (X (L [142]) Z) Z) Z)) +def y959 : BTree (List Nat):=X (X y957 (X (X (X (X (L [142]) Z) Z) Z) Z)) y958 +def y960 : BTree (List Nat):=X (X Z (L [58])) (X (L [58]) Z) +def y961 : BTree (List Nat):=X (X Z (X (X (L [58]) Z) Z)) (X Z (X (X (L [56]) (L [162])) (X (L [58]) Z))) +def y962 : BTree (List Nat):=X (X (X y68 y451) (X Z (X Z (X (X (L [3]) (L [58])) Z)))) (X (X (X (X (X (L [3]) Z) (X (L [58]) (L [78]))) Z) (X y960 Z)) y961) +def y963 : BTree (List Nat):=X (X (X (X (X Z (L [58])) Z) Z) (X Z (X (X (L [47]) Z) Z))) (X (X (X Z (X (L [58]) Z)) Z) (X y960 (X (X (L [81]) Z) Z))) +def y964 : BTree (List Nat):=X (X (X (X (X (L [133]) Z) Z) Z) (X Z (X (X (L [58]) Z) Z))) (X Z (X Z (X (X (L [55]) Z) Z))) +def y965 : BTree (List Nat):=X y963 y964 +def y966 : BTree (List Nat):=X (X (X Z y960) (X (X Z (X (L [78]) Z)) (X (X (L [30]) Z) Z))) (X Z (X Z (X (X (L [62]) Z) Z))) +def y967 : BTree (List Nat):=X (X (X (X (X (L [3]) (L [58])) Z) Z) Z) (X (X (X Z (X (L [58]) Z)) Z) (X Z (X (X (L [34]) Z) Z))) +def y968 : BTree (List Nat):=X y966 y967 +def y969 : BTree (List Nat):=X (X Z (X Z (X Z (L [286])))) (X (X (X (L [284]) Z) (X Z (L [289,279,290]))) Z) +def y970 : BTree (List Nat):=X (X (X (X (L [272]) Z) Z) (X (X (L [284]) Z) (X Z (L [287,276,289,288,279,290])))) (X (X Z (X Z (L [287,276,288]))) (X Z (X Z (L [284])))) +def y971 : BTree (List Nat):=X (X (X Z (X Z (L [284]))) Z) (X (X (X Z (L [284])) (X (L [284]) (L [287,276,288]))) Z) +def y972 : BTree (List Nat):=X (X (X Z (X (X Z (X Z (L [285,272,286]))) (X (X (L [164]) Z) Z))) y969) (X y970 y971) +def y973 : BTree (List Nat):=X (X (X (X (X (L [119]) Z) Z) Z) (X Z (X (X Z (L [117])) Z))) (X y394 Z) +def y974 : BTree (List Nat):=X (X (X y374 y944) (X (X (X Z (X Z (L [19]))) (X (X (L [118]) Z) Z)) Z)) y973 +def y975 : BTree (List Nat):=X (X Z (X Z (X (X (L [20]) Z) Z))) (X (X Z (X Z (X (L [78]) Z))) (X Z (X (X (L [137]) Z) Z))) +def y976 : BTree (List Nat):=X (X (X (X Z (L [58])) Z) (X Z (X (L [56]) Z))) (X Z (X (X (L [66]) Z) Z)) +def y977 : BTree (List Nat):=X y975 (X (X (X (X (X (L [63]) Z) Z) y960) Z) y976) +def rowCellTree : BTree (BTree (List Nat)):=X (X (X (X (X (X (X (X (X (X (L y1) (L y925)) (X (L y558) (L Z))) (X (X (L y37) (L Z)) (X (L y666) (L Z)))) (X (X (X (L y37) (L Z)) (X (L y260) (L Z))) (X (X (L y90) (L Z)) (X (L y711) (L Z))))) (X (X (X (X (L y125) (L y937)) (X (L y548) (L Z))) (X (X (L y90) (L Z)) (X (L y681) (L Z)))) (X (X (X (L y276) (L Z)) (X (L y90) (L Z))) (X (X (L y520) (L Z)) (X (L y814) (L Z)))))) (X (X (X (X (X (L y125) (L y952)) (X (L y84) (L Z))) (X (X (L y231) (L Z)) (X (L y673) (L Z)))) (X (X (X (L y310) (L Z)) (X (L y464) (L Z))) (X (X (L y514) (L Z)) (X (L y767) (L Z))))) (X (X (X (X (L y243) (L Z)) (X (L y141) (L Z))) (X (X (L y479) (L Z)) (X (L y37) (L Z)))) (X (X (X (L y162) (L Z)) (X (L y231) (L Z))) (X (X (L y345) (L Z)) (X (L y870) (L Z))))))) (X (X (X (X (X (X (L y67) (L y945)) (X (L y222) (L Z))) (X (X (L y392) (L Z)) (X (L y44) (L Z)))) (X (X (X (L y90) (L Z)) (X (L y303) (L Z))) (X (X (L y266) (L Z)) (X (L y739) (L Z))))) (X (X (X (X (L y213) (L y974)) (X (L y449) (L Z))) (X (X (L y455) (L Z)) (X (L y236) (L Z)))) (X (X (X (L y329) (L Z)) (X (L y37) (L Z))) (X (X (L y148) (L Z)) (X (L y842) (L Z)))))) (X (X (X (X (X (L y162) (L y968)) (X (L y141) (L Z))) (X (X (L y418) (L Z)) (X (L y125) (L Z)))) (X (X (X (L y98) (L Z)) (X (L y141) (L Z))) (X (X (L y90) (L Z)) (X (L y620) (L Z))))) (X (X (X (X (L y260) (L Z)) (X (L y610) (L Z))) (X (X (L qba) (L Z)) (X (L y1) (L Z)))) (X (X (X (L y90) (L Z)) (X (L y655) (L Z))) (X (X (L y553) (L Z)) (X (L y894) (L Z)))))))) (X (X (X (X (X (X (X (L y37) (L y310)) (X (L qba) (L Z))) (X (X (L y376) (L Z)) (X (L y464) (L Z)))) (X (X (X (L y271) (L Z)) (X (L y625) (L Z))) (X (X (L y90) (L Z)) (X (L y537) (L Z))))) (X (X (X (X (L y195) (L y941)) (X (L y580) (L Z))) (X (X (L y125) (L Z)) (X (L y500) (L Z)))) (X (X (X (L y213) (L Z)) (X (L y548) (L Z))) (X (X (L y528) (L Z)) (X (L y830) (L Z)))))) (X (X (X (X (X (L y37) (L y962)) (X (L y90) (L Z))) (X (X (L y37) (L Z)) (X (L y315) (L Z)))) (X (X (X (L y248) (L Z)) (X (L y74) (L Z))) (X (X (L y148) (L Z)) (X (L y783) (L Z))))) (X (X (X (X (L y257) (L Z)) (X (L y148) (L Z))) (X (X (L y489) (L Z)) (X (L y213) (L Z)))) (X (X (X (L y213) (L Z)) (X (L y595) (L Z))) (X (X (L y303) (L Z)) (X (L y882) (L Z))))))) (X (X (X (X (X (X (L y98) (L y937)) (X (L y565) (L Z))) (X (X (L y401) (L Z)) (X (L y449) (L Z)))) (X (X (X (L y148) (L Z)) (X (L qba) (L Z))) (X (X (L y90) (L Z)) (X (L y755) (L Z))))) (X (X (X (X (L y231) (L Z)) (X (L y260) (L Z))) (X (X (L y141) (L Z)) (X (L y338) (L Z)))) (X (X (X (L y192) (L Z)) (X (L y189) (L Z))) (X (X (L y432) (L Z)) (X (L y858) (L Z)))))) (X (X (X (X (X (L y178) (L y941)) (X (L y90) (L Z))) (X (X (L y148) (L Z)) (X (L y148) (L Z)))) (X (X (X (L y271) (L Z)) (X (L y98) (L Z))) (X (X (L y44) (L Z)) (X (L y806) (L Z))))) (X (X (X (X (L y281) (L Z)) (X (L y141) (L Z))) (X (X (L y500) (L Z)) (X (L y695) (L Z)))) (X (X (X (L y132) (L Z)) (X (L y90) (L Z))) (X (X (L y260) (L Z)) (X (L y909) (L Z))))))))) (X (X (X (X (X (X (X (X (L y16) (L y933)) (X (L y410) (L Z))) (X (X (L qba) (L Z)) (X (L y213) (L Z)))) (X (X (X (L y213) (L Z)) (X (L y620) (L Z))) (X (X (L y174) (L Z)) (X (L y719) (L Z))))) (X (X (X (X (L y192) (L y941)) (X (L y260) (L Z))) (X (X (L y367) (L Z)) (X (L y231) (L Z)))) (X (X (X (L y329) (L Z)) (X (L y16) (L Z))) (X (X (L y303) (L Z)) (X (L y822) (L Z)))))) (X (X (X (X (X (L y137) (L y937)) (X (L qba) (L Z))) (X (X (L y413) (L Z)) (X (L y678) (L Z)))) (X (X (X (L y90) (L Z)) (X (L y67) (L Z))) (X (X (L y231) (L Z)) (X (L y775) (L Z))))) (X (X (X (X (L qba) (L Z)) (X (L y602) (L Z))) (X (X (L y236) (L Z)) (X (L y683) (L Z)))) (X (X (X (L y37) (L Z)) (X (L y644) (L Z))) (X (X (L y148) (L Z)) (X (L y647) (L Z))))))) (X (X (X (X (X (X (L y84) (L y937)) (X (L y56) (L Z))) (X (X (L y137) (L Z)) (X (L y287) (L Z)))) (X (X (X (L y296) (L Z)) (X (L y474) (L Z))) (X (X (L y174) (L Z)) (X (L y747) (L Z))))) (X (X (X (X (L y158) (L y977)) (X (L y586) (L Z))) (X (X (L y460) (L Z)) (X (L y113) (L Z)))) (X (X (X (L y44) (L Z)) (X (L y429) (L Z))) (X (X (L y537) (L Z)) (X (L y850) (L Z)))))) (X (X (X (X (X (L y168) (L y972)) (X (L y37) (L Z))) (X (X (L y429) (L Z)) (X (L y90) (L Z)))) (X (X (X (L qba) (L Z)) (X (L y213) (L Z))) (X (X (L y329) (L Z)) (X (L y799) (L Z))))) (X (X (X (X (L y271) (L Z)) (X (L y618) (L Z))) (X (X (L qba) (L Z)) (X (L y687) (L Z)))) (X (X (X (L y338) (L Z)) (X (L y663) (L Z))) (X (X (L y553) (L Z)) (X (L y901) (L Z)))))))) (X (X (X (X (X (X (X (L y56) (L y937)) (X (L y329) (L Z))) (X (X (L y382) (L Z)) (X (L y329) (L Z)))) (X (X (X (L y174) (L Z)) (X (L y236) (L Z))) (X (X (L y37) (L Z)) (X (L y731) (L Z))))) (X (X (X (X (L y202) (L y937)) (X (L y37) (L Z))) (X (X (L y37) (L Z)) (X (L y464) (L Z)))) (X (X (X (L y236) (L Z)) (X (L y44) (L Z))) (X (X (L y534) (L Z)) (X (L y834) (L Z)))))) (X (X (X (X (X (L y148) (L y395)) (X (L y576) (L Z))) (X (X (L y90) (L Z)) (X (L y432) (L Z)))) (X (X (X (L y315) (L Z)) (X (L y98) (L Z))) (X (X (L y213) (L Z)) (X (L y787) (L Z))))) (X (X (X (X (L y98) (L Z)) (X (L y607) (L Z))) (X (X (L y37) (L Z)) (X (L y287) (L Z)))) (X (X (X (L y168) (L Z)) (X (L y647) (L Z))) (X (X (L y90) (L Z)) (X (L y888) (L Z))))))) (X (X (X (X (X (X (L y113) (L y941)) (X (L y570) (L Z))) (X (X (L y315) (L Z)) (X (L qba) (L Z)))) (X (X (X (L y303) (L Z)) (X (L y630) (L Z))) (X (X (L y192) (L Z)) (X (L y763) (L Z))))) (X (X (X (X (L y236) (L Z)) (X (L y595) (L Z))) (X (X (L y464) (L Z)) (X (L y671) (L Z)))) (X (X (X (L qba) (L Z)) (X (L y260) (L Z))) (X (X (L y423) (L Z)) (X (L y562) (L Z)))))) (X (X (X (X (X (L y125) (L y941)) (X (L y449) (L Z))) (X (X (L y37) (L Z)) (X (L y449) (L Z)))) (X (X (X (L y16) (L Z)) (X (L y432) (L Z))) (X (X (L y517) (L Z)) (X (L y310) (L Z))))) (X (X (X (X (L y158) (L Z)) (X (L y231) (L Z))) (X (X (L y385) (L Z)) (X (L y703) (L Z)))) (X (X (X (L y44) (L Z)) (X (L y260) (L Z))) (X (X (L y90) (L Z)) (X (L y917) (L Z)))))))))) (X (X (X (X (X (X (X (X (X (L y5) (L y929)) (X (L y562) (L Z))) (X (X (L y37) (L Z)) (X (L y260) (L Z)))) (X (X (X (L y90) (L Z)) (X (L y236) (L Z))) (X (X (L y125) (L Z)) (X (L y715) (L Z))))) (X (X (X (X (L y189) (L y941)) (X (L y44) (L Z))) (X (X (L y37) (L Z)) (X (L y37) (L Z)))) (X (X (X (L y141) (L Z)) (X (L y281) (L Z))) (X (X (L y37) (L Z)) (X (L y818) (L Z)))))) (X (X (X (X (X (L y132) (L y956)) (X (L y98) (L Z))) (X (X (L y334) (L Z)) (X (L y334) (L Z)))) (X (X (X (L y231) (L Z)) (X (L y355) (L Z))) (X (X (L y148) (L Z)) (X (L y771) (L Z))))) (X (X (X (X (L y236) (L Z)) (X (L y600) (L Z))) (X (X (L y260) (L Z)) (X (L y168) (L Z)))) (X (X (X (L y98) (L Z)) (X (L y113) (L Z))) (X (X (L y401) (L Z)) (X (L y874) (L Z))))))) (X (X (X (X (X (X (L y74) (L y937)) (X (L y37) (L Z))) (X (X (L y395) (L Z)) (X (L y98) (L Z)))) (X (X (X (L y292) (L Z)) (X (L y56) (L Z))) (X (X (L qba) (L Z)) (X (L y743) (L Z))))) (X (X (X (X (L y222) (L y937)) (X (L y148) (L Z))) (X (X (L y125) (L Z)) (X (L y37) (L Z)))) (X (X (X (L y338) (L Z)) (X (L qba) (L Z))) (X (X (L y98) (L Z)) (X (L y846) (L Z)))))) (X (X (X (X (X (L y37) (L y199)) (X (L y148) (L Z))) (X (X (L y423) (L Z)) (X (L y474) (L Z)))) (X (X (X (L y325) (L Z)) (X (L y148) (L Z))) (X (X (L y90) (L Z)) (X (L y795) (L Z))))) (X (X (X (X (L y266) (L Z)) (X (L y613) (L Z))) (X (X (L y37) (L Z)) (X (L y5) (L Z)))) (X (X (X (L y329) (L Z)) (X (L y659) (L Z))) (X (X (L y236) (L Z)) (X (L y897) (L Z)))))))) (X (X (X (X (X (X (X (L y44) (L y937)) (X (L y113) (L Z))) (X (X (L y379) (L Z)) (X (L y90) (L Z)))) (X (X (X (L y168) (L Z)) (X (L y231) (L Z))) (X (X (L y158) (L Z)) (X (L y727) (L Z))))) (X (X (X (X (L y199) (L y941)) (X (L y158) (L Z))) (X (X (L y442) (L Z)) (X (L y141) (L Z)))) (X (X (X (L y271) (L Z)) (X (L y236) (L Z))) (X (X (L y532) (L Z)) (X (L y666) (L Z)))))) (X (X (X (X (X (L y141) (L y965)) (X (L y125) (L Z))) (X (X (L y168) (L Z)) (X (L y44) (L Z)))) (X (X (X (L y257) (L Z)) (X (L y84) (L Z))) (X (X (L y260) (L Z)) (X (L y517) (L Z))))) (X (X (X (X (L y125) (L Z)) (X (L y148) (L Z))) (X (X (L y113) (L Z)) (X (L y227) (L Z)))) (X (X (X (L y338) (L Z)) (X (L y189) (L Z))) (X (X (L y423) (L Z)) (X (L y886) (L Z))))))) (X (X (X (X (X (X (L y108) (L y941)) (X (L y67) (L Z))) (X (X (L y405) (L Z)) (X (L y671) (L Z)))) (X (X (X (L y90) (L Z)) (X (L y37) (L Z))) (X (X (L y334) (L Z)) (X (L y759) (L Z))))) (X (X (X (X (L qba) (L Z)) (X (L y590) (L Z))) (X (X (L y37) (L Z)) (X (L y303) (L Z)))) (X (X (X (L y26) (L Z)) (X (L y586) (L Z))) (X (X (L y545) (L Z)) (X (L y862) (L Z)))))) (X (X (X (X (X (L y182) (L y937)) (X (L y281) (L Z))) (X (X (L y236) (L Z)) (X (L y26) (L Z)))) (X (X (X (L y174) (L Z)) (X (L y236) (L Z))) (X (X (L y37) (L Z)) (X (L y1) (L Z))))) (X (X (X (X (L y37) (L Z)) (X (L qba) (L Z))) (X (X (L y505) (L Z)) (X (L y699) (L Z)))) (X (X (X (L y362) (L Z)) (X (L y266) (L Z))) (X (X (L y148) (L Z)) (X (L y913) (L Z))))))))) (X (X (X (X (X (X (X (X (L y26) (L y1)) (X (L y44) (L Z))) (X (X (L y371) (L Z)) (X (L y90) (L Z)))) (X (X (X (L y287) (L Z)) (X (L y227) (L Z))) (X (X (L y222) (L Z)) (X (L y723) (L Z))))) (X (X (X (X (L y148) (L y937)) (X (L y418) (L Z))) (X (X (L y148) (L Z)) (X (L y37) (L Z)))) (X (X (X (L y334) (L Z)) (X (L y474) (L Z))) (X (X (L y524) (L Z)) (X (L y826) (L Z)))))) (X (X (X (X (X (L y37) (L y959)) (X (L y418) (L Z))) (X (X (L y44) (L Z)) (X (L y37) (L Z)))) (X (X (X (L y243) (L Z)) (X (L y231) (L Z))) (X (X (L y315) (L Z)) (X (L y779) (L Z))))) (X (X (X (X (L y248) (L Z)) (X (L y231) (L Z))) (X (X (L y484) (L Z)) (X (L y158) (L Z)))) (X (X (X (L y345) (L Z)) (X (L y108) (L Z))) (X (X (L y260) (L Z)) (X (L y878) (L Z))))))) (X (X (X (X (X (X (L y90) (L y941)) (X (L y37) (L Z))) (X (X (L y189) (L Z)) (X (L y37) (L Z)))) (X (X (X (L y192) (L Z)) (X (L y303) (L Z))) (X (X (L y125) (L Z)) (X (L y751) (L Z))))) (X (X (X (X (L y227) (L y941)) (X (L y148) (L Z))) (X (X (L y174) (L Z)) (X (L qba) (L Z)))) (X (X (X (L y37) (L Z)) (X (L y16) (L Z))) (X (X (L y542) (L Z)) (X (L y854) (L Z)))))) (X (X (X (X (X (L y174) (L y937)) (X (L y213) (L Z))) (X (X (L y432) (L Z)) (X (L y338) (L Z)))) (X (X (X (L y260) (L Z)) (X (L y213) (L Z))) (X (X (L y338) (L Z)) (X (L y803) (L Z))))) (X (X (X (X (L y276) (L Z)) (X (L y558) (L Z))) (X (X (L y495) (L Z)) (X (L y691) (L Z)))) (X (X (X (L y355) (L Z)) (X (L y90) (L Z))) (X (X (L y334) (L Z)) (X (L y905) (L Z)))))))) (X (X (X (X (X (X (X (L y37) (L y941)) (X (L qba) (L Z))) (X (X (L y385) (L Z)) (X (L y338) (L Z)))) (X (X (X (L y125) (L Z)) (X (L y182) (L Z))) (X (X (L y168) (L Z)) (X (L y735) (L Z))))) (X (X (X (X (L y206) (L y941)) (X (L qba) (L Z))) (X (X (L y449) (L Z)) (X (L y474) (L Z)))) (X (X (X (L y90) (L Z)) (X (L y639) (L Z))) (X (X (L y231) (L Z)) (X (L y838) (L Z)))))) (X (X (X (X (X (L y158) (L y937)) (X (L y192) (L Z))) (X (X (L y98) (L Z)) (X (L y236) (L Z)))) (X (X (X (L y320) (L Z)) (X (L y635) (L Z))) (X (X (L y90) (L Z)) (X (L y791) (L Z))))) (X (X (X (X (L y192) (L Z)) (X (L y90) (L Z))) (X (X (L y90) (L Z)) (X (L y296) (L Z)))) (X (X (X (L y350) (L Z)) (X (L y651) (L Z))) (X (X (L qba) (L Z)) (X (L y890) (L Z))))))) (X (X (X (X (X (X (L qba) (L y949)) (X (L y74) (L Z))) (X (X (L y410) (L Z)) (X (L y44) (L Z)))) (X (X (X (L y307) (L Z)) (X (L y625) (L Z))) (X (X (L y148) (L Z)) (X (L y534) (L Z))))) (X (X (X (X (L qba) (L Z)) (X (L qba) (L Z))) (X (X (L y474) (L Z)) (X (L y236) (L Z)))) (X (X (X (L y213) (L Z)) (X (L y500) (L Z))) (X (X (L y548) (L Z)) (X (L y866) (L Z)))))) (X (X (X (X (X (L y90) (L y941)) (X (L y236) (L Z))) (X (X (L y437) (L Z)) (X (L y329) (L Z)))) (X (X (X (L y148) (L Z)) (X (L y303) (L Z))) (X (X (L y236) (L Z)) (X (L y810) (L Z))))) (X (X (X (X (L y231) (L Z)) (X (L y222) (L Z))) (X (X (L y509) (L Z)) (X (L y707) (L Z)))) (X (X (X (L y367) (L Z)) (X (L y303) (L Z))) (X (X (L y125) (L Z)) (X (L y921) (L Z)))))))))) +def qa4 : Nat:=62 +def qE : Nat:=291 +def tnode (v : Nat) : TransRow:=qZ transTree v +def qe (k : Nat) : Mask:=qZ masksTree k +def cell (u v : Nat) : List Nat:=qZ (qZ rowCellTree u) v +def qay (u : Nat) (c : Letter) : List Nat := + ((node u).edges.filter (fun e => qU e.1 c)).map Prod.snd +def qbl (u : Nat) : Option Letter -> List Nat + | none => [u] + | some c => qay u c +theorem qaX (u : Nat) (c : Letter) (v : Nat) : + v ∈ qay u c ↔ (c,v) ∈ (node u).edges:= by + unfold qay + simp only [List.mem_map,List.mem_filter,qam,Prod.exists] + constructor + · rintro ⟨a,b,⟨hmem,rfl⟩,rfl⟩; exact hmem + · intro hmem; exact ⟨c,v,⟨hmem,rfl⟩,rfl⟩ +def qas (vs : List Nat) (c : Letter) : List Nat -> List Nat -> Bool + | [],[] => true + | q :: qs,p :: ps => + vs.any (fun x => x == p) && memEdge (node p).edges c q && qas vs c qs ps + | _,_ => false +theorem qbi (vs : List Nat) (c : Letter) (qs ps : List Nat) + (h : qas vs c qs ps=true) {q : Nat} (hq : q ∈ qs) : + ∃ p,p ∈ vs /\ (c,q) ∈ (node p).edges:= by + induction qs generalizing ps with + | nil => contradiction + | cons q0 qs' ih => + cases ps with + | nil => contradiction + | cons p0 ps' => + unfold qas at h + simp only [Bool.and_eq_true,List.any_eq_true,beq_iff_eq] at h + rcases List.mem_cons.mp hq with rfl | hq' + · rcases h.1.1 with ⟨x,hx,rfl⟩ + exact ⟨x,hx,(qaZ _ _ _).mp h.1.2⟩ + · exact ih ps' h.2 hq' +def qF (m : Mask) (c : Letter) : Bool := + qas m.vertices c (mask_img m c) (mask_src m c) && + (mask_sub m (some c)).all (fun k' => qaP (qe k').vertices (mask_img m c)) +def qT (k : Nat) : Bool := + let m:=qe k + m.sub_none.all (fun k' => qaP (qe k').vertices m.vertices) && + qF m .Odd && + qF m .Even && + qF m .Gap && + ((!m.accepting) || m.vertices.any (fun u => qz u)) +def qb0 : Bool := + (List.range qE).all qT +theorem masks_checked : qb0=true:= by decide +theorem qa8 (k : Nat) (hk : k < qE) : qT k=true:= by + have h:=masks_checked + unfold qb0 at h + rw [List.all_eq_true] at h + exact h k (List.mem_range.mpr hk) +theorem qal (k k' p : Nat) (hk : k < qE) + (hk' : k' ∈ (qe k).sub_none) (hp : p ∈ (qe k').vertices) : + p ∈ (qe k).vertices:= by + have hm:=qa8 k hk + unfold qT at hm + simp only [Bool.and_eq_true] at hm + have h1:=hm.1.1.1.1 + rw [List.all_eq_true] at h1 + exact qax (h1 k' hk') hp +theorem qak (k : Nat) (c : Letter) (k' q : Nat) (hk : k < qE) + (hk' : k' ∈ mask_sub (qe k) (some c)) (hq : q ∈ (qe k').vertices) : + ∃ p,p ∈ (qe k).vertices /\ (c,q) ∈ (node p).edges:= by + have hm:=qa8 k hk + unfold qT at hm + simp only [Bool.and_eq_true] at hm + have hc : qF (qe k) c=true:= by + cases c with + | Odd => exact hm.1.1.1.2 + | Even => exact hm.1.1.2 + | Gap => exact hm.1.2 + unfold qF at hc + simp only [Bool.and_eq_true] at hc + have hsub:=hc.2 + rw [List.all_eq_true] at hsub + exact qbi _ c _ _ hc.1 (qax (hsub k' hk') hq) +theorem qb1 (k : Nat) (hk : k < qE) + (hf : (qe k).accepting=true) : + ∃ p,p ∈ (qe k).vertices /\ qz p=true:= by + have hm:=qa8 k hk + unfold qT at hm + simp only [Bool.and_eq_true] at hm + have hacc:=hm.2 + rw [hf] at hacc + simp only [Bool.not_true,Bool.false_or,List.any_eq_true] at hacc + exact hacc +def qb7 (xs ys : List Nat) : Bool := + xs.any (fun x => (x < qE) && ys.any (fun y => x == y)) +theorem qbg {xs ys : List Nat} (h : qb7 xs ys=true) : + ∃ k,k < qE /\ k ∈ xs /\ k ∈ ys:= by + unfold qb7 at h + simp only [List.any_eq_true,Bool.and_eq_true,decide_eq_true_eq,beq_iff_eq] at h + rcases h with ⟨k,hk_xs,hk_lt,y,hy_ys,rfl⟩ + exact ⟨k,hk_lt,hk_xs,hy_ys⟩ +def covers (u' v' : Nat) (ks : List Nat) : Bool := + qb7 (cell u' v') ks +def qbm (u k : Nat) (e : Option Letter × Option Letter × Nat) : Bool := + let (i,o,v'):=e + (v' < qa4) && + (qbl u i).all (fun u' => (u' < q7) && covers u' v' (mask_sub (qe k) o)) +def qae (u v : Nat) : Bool := + (cell u v).all (fun k => + (k < qE) && + (tnode v).trans_edges.all (qbm u k) && + if qz u && (tnode v).trans_final then (qe k).accepting else true) +def qar : Bool := + (List.range q7).all (fun u => (List.range qa4).all (qae u)) +theorem qb9 : qar=true:= by decide +theorem qaG (u v : Nat) (hu : u < q7) (hv : v < qa4) : + qae u v=true:= by + have h:=qb9 + unfold qar at h + rw [List.all_eq_true] at h + have hu':=h u (List.mem_range.mpr hu) + rw [List.all_eq_true] at hu' + exact hu' v (List.mem_range.mpr hv) +def emit : Option Letter -> List Letter + | none => [] + | some c => [c] +inductive TransPath : Nat -> List Letter -> List Letter -> Nat -> Prop where + | nil (v : Nat) : TransPath v [] [] v + | cons (v : Nat) (i o : Option Letter) (v' : Nat) (xs ys : List Letter) (v'' : Nat) : + (i,o,v') ∈ (tnode v).trans_edges -> TransPath v' xs ys v'' -> + TransPath v (emit i ++ xs) (emit o ++ ys) v'' +theorem q8 {u : Nat} {xs ys : List Letter} {v : Nat} {xs' ys' : List Letter} {w : Nat} + (h1 : TransPath u xs ys v) (h2 : TransPath v xs' ys' w) : + TransPath u (xs ++ xs') (ys ++ ys') w:= by + induction h1 with + | nil _ => simpa using! h2 + | cons v0 i o v1 xs1 ys1 v2 he _ ih => + simp only [List.append_assoc] + exact TransPath.cons v0 i o v1 (xs1 ++ xs') (ys1 ++ ys') w he (ih h2) +def qaE (es : List (Option Letter × Option Letter × Nat)) + (e : Option Letter × Option Letter × Nat) : Bool := + es.any (fun e' => e' == e) +def qah : Nat -> List (Option Letter × Option Letter × Nat) -> Bool + | _,[] => true + | q,(i,o,q') :: es => + qaE (tnode q).trans_edges (i,o,q') && qah q' es +def qaO : List (Option Letter × Option Letter × Nat) -> List Letter + | [] => [] + | (i,_,_) :: es => emit i ++ qaO es +def qaC : List (Option Letter × Option Letter × Nat) -> List Letter + | [] => [] + | (_,o,_) :: es => emit o ++ qaC es +def trace_end : Nat -> List (Option Letter × Option Letter × Nat) -> Nat + | q,[] => q + | _,(_,_,q') :: es => trace_end q' es +theorem q2 (q : Nat) (es : List (Option Letter × Option Letter × Nat)) + (h : qah q es=true) : + TransPath q (qaO es) (qaC es) (trace_end q es):= by + induction es generalizing q with + | nil => exact TransPath.nil q + | cons e es ih => + rcases e with ⟨i,o,q'⟩ + unfold qah at h + simp only [Bool.and_eq_true] at h + have hmem : (i,o,q') ∈ (tnode q).trans_edges:= by + unfold qaE at h + simp only [List.any_eq_true,beq_iff_eq] at h + rcases h.1 with ⟨e',he',rfl⟩ + exact he' + exact TransPath.cons q i o q' _ _ _ hmem (ih q' h.2) +theorem input_path (u : Nat) (i : Option Letter) (xs : List Letter) (q : Nat) + (hp : Path u (emit i ++ xs) q) : + ∃ u',u' ∈ qbl u i /\ Path u' xs q:= by + cases i with + | none => + exact ⟨u,List.Mem.head _,hp⟩ + | some c => + simp only [emit,List.singleton_append] at hp + cases hp with + | cons _ _ u' _ _ he hr => + exact ⟨u',(qaX u c u').mpr he,hr⟩ +theorem closure_sound {v : Nat} {xs ys : List Letter} {v' : Nat} + (ht : TransPath v xs ys v') (hf : (tnode v').trans_final=true) : + ∀ u q k,u < q7 -> v < qa4 -> k ∈ cell u v -> + Path u xs q -> qz q=true -> + ∃ p q',p ∈ (qe k).vertices /\ Path p ys q' /\ qz q'=true:= by + induction ht with + | nil v0 => + intro u q k hu hv hk hp hq + cases hp with + | nil _ => + have hc:=qaG u v0 hu hv + unfold qae at hc + rw [List.all_eq_true] at hc + have hk_ok:=hc k hk + simp only [Bool.and_eq_true,decide_eq_true_eq,hq,hf,↓reduceIte] at hk_ok + rcases qb1 k hk_ok.1.1 hk_ok.2 with ⟨p,hp_mem,hp_fin⟩ + exact ⟨p,p,hp_mem,Path.nil p,hp_fin⟩ + | cons v0 i o v1 xs1 ys1 v2 he _ ih => + intro u q k hu hv hk hp hq + have hc:=qaG u v0 hu hv + unfold qae at hc + rw [List.all_eq_true] at hc + have hk_ok:=hc k hk + simp only [Bool.and_eq_true,decide_eq_true_eq] at hk_ok + have hk_lt:=hk_ok.1.1 + have hedges:=hk_ok.1.2 + rw [List.all_eq_true] at hedges + have hedge:=hedges (i,o,v1) he + unfold qbm at hedge + simp only [Bool.and_eq_true,decide_eq_true_eq] at hedge + have hv1:=hedge.1 + have hin:=hedge.2 + rw [List.all_eq_true] at hin + rcases input_path u i xs1 q hp with ⟨u',hu'_in,hp'⟩ + have hu'_ok:=hin u' hu'_in + simp only [Bool.and_eq_true,decide_eq_true_eq] at hu'_ok + rcases qbg hu'_ok.2 with ⟨k',_,hk'_cell,hk'_sub⟩ + rcases ih hf u' q k' hu'_ok.1 hv1 hk'_cell hp' hq with ⟨p',q',hp'_mem,hpath_ys,hq'⟩ + cases o with + | none => + exact ⟨p',q',qal k k' p' hk_lt hk'_sub hp'_mem,hpath_ys,hq'⟩ + | some c => + rcases qak k c k' p' hk_lt hk'_sub hp'_mem with ⟨p,hp_mem,hedge_p⟩ + exact ⟨p,q',hp_mem,Path.cons p c p' ys1 q' hedge_p hpath_ys,hq'⟩ +def starts : List Nat:=[0,440,477,515] +def qv : Nat:=0 +def qI (w : List Letter) : Prop := + ∃ u q,u ∈ starts /\ Path u w q /\ qz q=true +def qao : Bool := + qaP (qe 0).vertices starts && + starts.all (fun u => (u < q7) && (qv < qa4) && + (cell u qv).any (fun k => k == 0)) +theorem qb6 : qao=true:= by decide +theorem qb5 {xs ys : List Letter} {v' : Nat} + (ht : TransPath qv xs ys v') + (hf : (tnode v').trans_final=true) + (hl : qI xs) : qI ys:= by + rcases hl with ⟨u,q,hu_st,hp,hq⟩ + have hi:=qb6 + unfold qao at hi + simp only [Bool.and_eq_true] at hi + have hsub:=hi.1 + have hall:=hi.2 + rw [List.all_eq_true] at hall + have hu_ok:=hall u hu_st + simp only [Bool.and_eq_true,decide_eq_true_eq,List.any_eq_true,beq_iff_eq] at hu_ok + rcases hu_ok.2 with ⟨k0,hk0_cell,rfl⟩ + rcases closure_sound ht hf u q 0 hu_ok.1.1 hu_ok.1.2 hk0_cell hp hq with ⟨p,q',hp_mem,hp_ys,hq'⟩ + exact ⟨p,q',qax hsub hp_mem,hp_ys,hq'⟩ +theorem path_core (w : List Letter) (u f : Nat) (hu : u < q7) + (hp : Path u (w ++ [.Even]) f) (hfin : qz f=true) : + ∃ v,Path u w v /\ (node v).final=true:= by + induction w generalizing u with + | nil => + simp only [List.nil_append] at hp + cases hp with + | cons _ _ q' _ _ he hr => + cases hr with + | nil _ => + refine ⟨u,Path.nil u,?_⟩ + rw [qaL u hu] + unfold qa7 + rw [List.any_eq_true] + exact ⟨(.E,f),he,by simp [qU,hfin]⟩ + | cons c w ih => + simp only [List.cons_append] at hp + cases hp with + | cons _ _ q' _ _ he hr => + have hq':=(qG u c q' hu he).1 + rcases ih q' hq' hr with ⟨v,hp_v,hv_fin⟩ + exact ⟨v,Path.cons u c q' w v he hp_v,hv_fin⟩ +def qx : Bool := + starts.all (fun q => (q < q7) && (0 < qA q 0) && (qA q 0 <= 12)) +theorem qap : qx=true:= by decide +def qa6 (flip : Bool) : Nat:=if flip then 1 else 12 +def qO (flip : Bool) (d : Letter) : Letter := + if flip then + match d with + | .Odd => .Even + | .Even => .Odd + | .Gap => .Gap + else d +theorem start_path (f : Bool) : TransPath 0 [] [qO f .Odd] (qa6 f):= by + cases f + · exact q2 0 [(none,some .O,12)] (by decide) + · exact q2 0 [(none,some .E,1)] (by decide) +theorem bare_path (f : Bool) : TransPath (qa6 (!f)) [.Odd] [.Gap,.Gap,.Gap] (qa6 f):= by + cases f + · exact q2 1 [(some .O,none,47),(none,some .G,48),(none,some .G,14),(none,some .G,12)] (by decide) + · exact q2 12 [(some .O,none,46),(none,some .G,49),(none,some .G,15),(none,some .G,1)] (by decide) +theorem p0_path (f : Bool) : TransPath 12 [.Even] ([] ++ [qO f .Even] ++ []) (qa6 f):= by + cases f + · exact q2 12 [(some .E,none,23),(none,some .E,12)] (by decide) + · exact q2 12 [(some .E,none,23),(none,some .O,1)] (by decide) +theorem p1_path (f : Bool) : TransPath 12 [.Even,.Gap] ([.Gap] ++ [qO f .Odd] ++ []) (qa6 f):= by + cases f + · exact q2 12 [(some .E,none,9),(some .G,none,16),(none,some .G,0),(none,some .O,12)] (by decide) + · exact q2 12 [(some .E,none,9),(some .G,none,16),(none,some .G,0),(none,some .E,1)] (by decide) +theorem q1_path (f : Bool) : TransPath 12 [.Odd,.Gap] ([] ++ [qO f .Even] ++ [.Gap]) (qa6 f):= by + cases f + · exact q2 12 [(some .O,none,11),(some .G,none,13),(none,some .E,14),(none,some .G,12)] (by decide) + · exact q2 12 [(some .O,none,11),(some .G,none,13),(none,some .O,15),(none,some .G,1)] (by decide) +theorem q2_path (f : Bool) : TransPath 12 [.Odd,.Gap,.Gap] ([.Gap] ++ [qO f .Odd] ++ [.Gap]) (qa6 f):= by + cases f + · exact q2 12 [(some .O,none,17),(some .G,none,18),(some .G,none,19),(none,some .G,20),(none,some .O,14),(none,some .G,12)] (by decide) + · exact q2 12 [(some .O,none,17),(some .G,none,18),(some .G,none,19),(none,some .G,20),(none,some .E,15),(none,some .G,1)] (by decide) +theorem p2_prefix : TransPath 12 [.Even,.Gap,.Gap] [.Gap,.Gap] 45 := + q2 12 [(some .E,none,6),(some .G,none,7),(some .G,none,8),(none,some .G,10),(none,some .G,45)] (by decide) +theorem p3_prefix : TransPath 12 [.Even,.Gap,.Gap,.Gap] [.Odd] 45 := + q2 12 [(some .E,none,39),(some .G,none,44),(some .G,none,50),(some .G,none,34),(none,some .O,45)] (by decide) +theorem p4_prefix : TransPath 12 [.Even,.Gap,.Gap,.Gap,.Gap] [.Gap,.Even] 45 := + q2 12 [(some .E,none,61),(some .G,none,2),(some .G,none,3),(some .G,none,4),(some .G,none,5),(none,some .G,60),(none,some .E,45)] (by decide) +theorem q3_prefix : TransPath 12 [.Odd,.Gap,.Gap,.Gap] [.Gap,.Gap] 27 := + q2 12 [(some .O,none,21),(some .G,none,22),(some .G,none,24),(some .G,none,25),(none,some .G,26),(none,some .G,27)] (by decide) +theorem q4_prefix : TransPath 12 [.Odd,.Gap,.Gap,.Gap,.Gap] [.Odd] 27 := + q2 12 [(some .O,none,31),(some .G,none,32),(some .G,none,33),(some .G,none,35),(some .G,none,36),(none,some .O,27)] (by decide) +theorem q5_prefix : TransPath 12 [.Odd,.Gap,.Gap,.Gap,.Gap,.Gap] [.Gap,.Even] 27 := + q2 12 [(some .O,none,37),(some .G,none,38),(some .G,none,40),(some .G,none,41),(some .G,none,42),(some .G,none,43),(none,some .G,30),(none,some .E,27)] (by decide) +theorem p_loop : TransPath 45 [.Gap,.Gap,.Gap] [.Even] 45 := + q2 45 [(some .G,none,56),(some .G,none,59),(some .G,none,60),(none,some .E,45)] (by decide) +theorem p_suffix (f : Bool) : TransPath 45 [] ([qO f .Odd] ++ []) (qa6 f):= by + cases f + · exact q2 45 [(none,some .O,12)] (by decide) + · exact q2 45 [(none,some .E,1)] (by decide) +theorem q_loop : TransPath 27 [.Gap,.Gap,.Gap] [.Even] 27 := + q2 27 [(some .G,none,28),(some .G,none,29),(some .G,none,30),(none,some .E,27)] (by decide) +theorem q_suffix (f : Bool) : TransPath 27 [] ([qO f .Odd] ++ [.Gap]) (qa6 f):= by + cases f + · exact q2 27 [(none,some .O,14),(none,some .G,12)] (by decide) + · exact q2 27 [(none,some .E,15),(none,some .G,1)] (by decide) +theorem tail0_prefix : TransPath 12 [.Even] [.Odd,.Even,.Even,.Even,.Even] 57 := + q2 12 [(some .E,none,51),(none,some .O,52),(none,some .E,53),(none,some .E,54),(none,some .E,55),(none,some .E,57)] (by decide) +theorem tail1_prefix : TransPath 12 [.Even] [.Gap,.Even,.Even,.Even,.Even] 57 := + q2 12 [(some .E,none,51),(none,some .G,52),(none,some .E,53),(none,some .E,54),(none,some .E,55),(none,some .E,57)] (by decide) +theorem tail2_prefix : TransPath 12 [.Even] [.Gap,.Gap,.Even,.Even,.Even,.Even] 57 := + q2 12 [(some .E,none,51),(none,some .G,58),(none,some .G,52),(none,some .E,53),(none,some .E,54),(none,some .E,55),(none,some .E,57)] (by decide) +theorem tail_loop : TransPath 57 [] [.Even] 57 := + q2 57 [(none,some .E,57)] (by decide) +theorem pump (k n : Nat) (h : TransPath k [.Gap,.Gap,.Gap] [.Even] k) : + TransPath k (List.replicate (n * 3) .Gap) (List.replicate n .Even) k:= by + induction n with + | zero => exact TransPath.nil k + | succ n ih => + have heq : (n + 1) * 3=3 + n * 3:= by omega + rw [heq,List.replicate_add,List.replicate_succ] + exact q8 h ih +theorem qbp (c : Letter) (g : Nat) (pre : List Letter) (k : Nat) (suf : List Letter) (n q : Nat) + (hpre : TransPath 12 (c :: List.replicate g .Gap) pre k) + (hloop : TransPath k [.Gap,.Gap,.Gap] [.Even] k) + (hsuf : TransPath k [] suf q) : + TransPath 12 (c :: List.replicate (g + n * 3) .Gap) (pre ++ List.replicate n .Even ++ suf) q:= by + rw [List.replicate_add,<- List.cons_append,List.append_assoc] + refine q8 hpre ?_ + have h1:=q8 (pump k n hloop) hsuf + simpa using! h1 +inductive Block where + | BP0 | BP1 | BP2 (n : Nat) | BP3 (n : Nat) | BP4 (n : Nat) + | BQ0 | BQ1 | BQ2 | BQ3 (n : Nat) | BQ4 (n : Nat) | BQ5 (n : Nat) + deriving DecidableEq +def q3 : Block -> Bool + | .BP0 | .BP1 | .BP2 _ | .BP3 _ | .BP4 _ => true + | _ => false +def symbol (b : Block) : Letter:=if q3 b then .Even else .Odd +def gaps : Block -> Nat + | .BP0 | .BQ0 => 0 + | .BP1 | .BQ1 => 1 + | .BQ2 => 2 + | .BP2 n => 2 + n * 3 + | .BP3 n | .BQ3 n => 3 + n * 3 + | .BP4 n | .BQ4 n => 4 + n * 3 + | .BQ5 n => 5 + n * 3 +def qi (b : Block) : List Letter:=symbol b :: List.replicate (gaps b) .Gap +def qa : Block -> Letter + | .BP0 | .BQ1 => .Even + | _ => .Odd +def qaz : Block -> List Letter + | .BP1 | .BQ2 => [.Gap] + | .BP2 n | .BQ3 n => [.Gap,.Gap] ++ List.replicate n .Even + | .BP3 n | .BQ4 n => .Odd :: List.replicate n .Even + | .BP4 n | .BQ5 n => [.Gap,.Even] ++ List.replicate n .Even + | _ => [] +def back (b : Block) : List Letter:=if q3 b then [] else [.Gap] +def q4 (b : Block) (f : Bool) : List Letter := + qaz b ++ [qO f (qa b)] ++ back b +theorem block_path (b : Block) (f : Bool) (h : b ≠ .BQ0) : + TransPath 12 (qi b) (q4 b f) (qa6 f):= by + cases b with + | BP0 => exact p0_path f + | BP1 => exact p1_path f + | BP2 n => + simpa [q4,qaz,qa,back,q3,List.append_assoc] using! + qbp .Even 2 [.Gap,.Gap] 45 ([qO f .Odd] ++ []) n (qa6 f) p2_prefix p_loop (p_suffix f) + | BP3 n => + simpa [q4,qaz,qa,back,q3,List.append_assoc] using! + qbp .Even 3 [.Odd] 45 ([qO f .Odd] ++ []) n (qa6 f) p3_prefix p_loop (p_suffix f) + | BP4 n => + simpa [q4,qaz,qa,back,q3,List.append_assoc] using! + qbp .Even 4 [.Gap,.Even] 45 ([qO f .Odd] ++ []) n (qa6 f) p4_prefix p_loop (p_suffix f) + | BQ0 => contradiction + | BQ1 => exact q1_path f + | BQ2 => exact q2_path f + | BQ3 n => + simpa [q4,qaz,qa,back,q3,List.append_assoc] using! + qbp .Odd 3 [.Gap,.Gap] 27 ([qO f .Odd] ++ [.Gap]) n (qa6 f) q3_prefix q_loop (q_suffix f) + | BQ4 n => + simpa [q4,qaz,qa,back,q3,List.append_assoc] using! + qbp .Odd 4 [.Odd] 27 ([qO f .Odd] ++ [.Gap]) n (qa6 f) q4_prefix q_loop (q_suffix f) + | BQ5 n => + simpa [q4,qaz,qa,back,q3,List.append_assoc] using! + qbp .Odd 5 [.Gap,.Even] 27 ([qO f .Odd] ++ [.Gap]) n (qa6 f) q5_prefix q_loop (q_suffix f) +def qb : List Block -> List Letter + | [] => [] + | b :: xs => qi b ++ qb xs +def q6 : List Block -> Bool + | .BQ0 :: xs => !(q6 xs) + | _ => false +def qM : List Block -> List Letter + | [] => [] + | .BQ0 :: xs => [.Gap,.Gap,.Gap] ++ qM xs + | b :: xs => q4 b (q6 xs) ++ qM xs +theorem blocks_path (xs : List Block) : + TransPath (qa6 (q6 xs)) (qb xs) (qM xs) 12:= by + induction xs with + | nil => exact TransPath.nil 12 + | cons b xs ih => + by_cases h : b=.BQ0 + · subst h; exact q8 (bare_path (q6 xs)) ih + · have hnf : q6 (b :: xs)=false:= by cases b <;> first | contradiction | rfl + have hout : qM (b :: xs)=q4 b (q6 xs) ++ qM xs:= by + cases b <;> first | contradiction | rfl + rw [hnf,qb,hout] + exact q8 (block_path b (q6 xs) h) ih +def qu (j : Nat) : List Letter := + match j with + | 0 => [.Odd] + | 1 => [.Gap] + | _ => [.Gap,.Gap] +def q9 (j q : Nat) : Nat := + q + match j with | 0 => 0 | _ => 1 +theorem tail_repeats (n : Nat) : TransPath 57 [] (List.replicate n .Even) 57:= by + induction n with + | zero => exact TransPath.nil 57 + | succ n ih => + simpa using! q8 tail_loop ih +theorem tail_path (j n : Nat) (hj : j < 3) : + TransPath 12 [.Even] (qu j ++ List.replicate (4 + n) .Even) 57:= by + rw [List.replicate_add,<- List.append_assoc] + have hpre : TransPath 12 [.Even] (qu j ++ List.replicate 4 .Even) 57:= by + rcases j with _ | _ | _ | j + · exact tail0_prefix + · exact tail1_prefix + · exact tail2_prefix + · omega + simpa using! q8 hpre (tail_repeats n) +def qL (xs : List Block) : List Letter := + qO (q6 xs) .Odd :: qM xs +theorem boundary_path (xs : List Block) (j n : Nat) (hj : j < 3) : + TransPath qv (qb xs ++ [.Even]) + (qL xs ++ qu j ++ List.replicate (4 + n) .Even) 57:= by + unfold qL qv + have h1:=start_path (q6 xs) + have h2:=blocks_path xs + have h3:=tail_path j n hj + have h23:=q8 h2 h3 + have h123:=q8 h1 h23 + simpa [List.append_assoc] using! h123 +theorem macro_closed (xs : List Block) (j n : Nat) (hj : j < 3) + (hl : qI (qb xs ++ [.Even])) : + qI (qL xs ++ qu j ++ List.replicate (4 + n) .Even) := + qb5 (boundary_path xs j n hj) (by decide) hl +inductive BlocksRun : Nat -> List Block -> Nat -> Prop where + | nil (s : Nat) : BlocksRun s [] s + | cons (s : Nat) (b : Block) (s' : Nat) (xs : List Block) (s'' : Nat) : + qau (q3 b) (gaps b) s=some s' -> + BlocksRun s' xs s'' -> + BlocksRun s (b :: xs) s'' +theorem qbh (xs : List Block) (u q : Nat) + (hu : u < q7) (hp : Path u (qb xs) q) (hf : (node q).final=true) : + 0 < qA u 0 /\ ∀ s,qA u 0 - 1 <= s -> + ∃ t,BlocksRun s xs t /\ 28 <= t:= by + induction xs generalizing u with + | nil => + cases hp with + | nil _ => + have hfin:=checked_final _ hu hf + exact ⟨by omega,fun s hs => ⟨s,BlocksRun.nil s,by omega⟩⟩ + | cons b xs ih => + simp only [qb,qi,List.cons_append] at hp + cases hp with + | cons _ _ v _ _ he hr => + have hv:=(qG u (symbol b) v hu he).1 + rcases checked_gaps v (gaps b) (qb xs) q hv hr with ⟨z,hz,hp_z,hb_z⟩ + rcases ih z hz hp_z with ⟨hb0,hs_z⟩ + have hb_v:=hb_z hb0 + have he' : ((if q3 b then Letter.Even else Letter.Odd),v) ∈ (node u).edges:=he + rcases checked_digit u v (q3 b) (gaps b) hu he' (by omega) with ⟨hu0,hstep⟩ + refine ⟨hu0,fun s hs => ?_⟩ + rcases hstep s hs with ⟨s',ha,hs'⟩ + rcases hs_z s' (by omega) with ⟨t,hrun,ht⟩ + exact ⟨t,BlocksRun.cons s b s' xs t ha hrun,ht⟩ +theorem qaB (xs : List Block) + (hl : qI (qb xs ++ [.Even])) : + ∃ t,BlocksRun 11 xs t /\ 28 <= t:= by + rcases hl with ⟨u,f,hu_st,hp,hfin⟩ + have hcap:=qap + unfold qx at hcap + rw [List.all_eq_true] at hcap + have hu_ok:=hcap u hu_st + simp only [Bool.and_eq_true,decide_eq_true_eq] at hu_ok + rcases path_core (qb xs) u f hu_ok.1.1 hp hfin with ⟨q,hp_q,hq_fin⟩ + rcases qbh xs u q hu_ok.1.1 hp_q hq_fin with ⟨_,hs⟩ + exact hs 11 (by omega) +def qbn (p : Bool) (g : Nat) : Block := + if p then + match g with + | 0 => .BP0 | 1 => .BP1 | 2 => .BP2 0 + | _ => match g % 3 with | 0 => .BP3 (g / 3 - 1) | 1 => .BP4 (g / 3 - 1) | _ => .BP2 (g / 3) + else + match g with + | 0 => .BQ0 | 1 => .BQ1 | 2 => .BQ2 + | _ => match g % 3 with | 0 => .BQ3 (g / 3 - 1) | 1 => .BQ4 (g / 3 - 1) | _ => .BQ5 (g / 3 - 1) +theorem qQ (p : Bool) (g : Nat) : + qi (qbn p g)=(if p then .Even else .Odd) :: List.replicate g .Gap:= by + cases p <;> ( + rcases g with _ | _ | _ | g + · rfl + · rfl + · rfl + · unfold qbn + simp only [↓reduceIte,Bool.false_eq_true] + have hmod : (g + 3) % 3=0 \/ (g + 3) % 3=1 \/ (g + 3) % 3=2:= by omega + rcases hmod with h0 | h1 | h2 + · rw [h0]; simp only [qi,symbol,q3,↓reduceIte,Bool.false_eq_true,gaps]; congr 2; omega + · rw [h1]; simp only [qi,symbol,q3,↓reduceIte,Bool.false_eq_true,gaps]; congr 2; omega + · rw [h2]; simp only [qi,symbol,q3,↓reduceIte,Bool.false_eq_true,gaps]; congr 2; omega + ) +theorem words_blocks (w : List Letter) : + ∃ g xs,w=List.replicate g .Gap ++ qb xs:= by + induction w with + | nil => exact ⟨0,[],rfl⟩ + | cons c w ih => + rcases ih with ⟨g,xs,rfl⟩ + cases c with + | Odd => + refine ⟨0,qbn false g :: xs,?_⟩ + simp only [List.replicate_zero,List.nil_append,qb,qQ,↓reduceIte,Bool.false_eq_true,List.cons_append] + | Even => + refine ⟨0,qbn true g :: xs,?_⟩ + simp only [List.replicate_zero,List.nil_append,qb,qQ,↓reduceIte,List.cons_append] + | Gap => + exact ⟨g + 1,xs,by simp [List.replicate_succ]⟩ +theorem digit_blocks (d : Letter) (w : List Letter) (hd : d ≠ .Gap) : + ∃ xs,qb xs=d :: w:= by + rcases words_blocks w with ⟨g,xs,rfl⟩ + cases d with + | Odd => + refine ⟨qbn false g :: xs,?_⟩ + simp only [qb,qQ,↓reduceIte,Bool.false_eq_true,List.cons_append] + | Even => + refine ⟨qbn true g :: xs,?_⟩ + simp only [qb,qQ,↓reduceIte,List.cons_append] + | Gap => contradiction +def qS : List Block := + [.BP4 0,.BP0,.BP0,.BP0,.BQ0] ++ List.replicate 31 .BP0 +def qaF : List Letter:=qb qS ++ [.Even] +def qac : Nat -> List Letter -> List Nat -> Nat -> Bool + | u,[],[],q => u == q + | u,c :: cs,u' :: us,q => + memEdge (node u).edges c u' && qac u' cs us q + | _,_,_,_ => false +theorem qaI (u : Nat) (w : List Letter) (us : List Nat) (q : Nat) + (h : qac u w us q=true) : Path u w q:= by + induction w generalizing u us with + | nil => + cases us with + | nil => + unfold qac at h + rw [beq_iff_eq] at h + subst h + exact Path.nil u + | cons _ _ => contradiction + | cons c cs ih => + cases us with + | nil => contradiction + | cons u' us' => + unfold qac at h + simp only [Bool.and_eq_true] at h + exact Path.cons u c u' cs q ((qaZ _ _ _).mp h.1) (ih u' us' h.2) +theorem qbe : qI qaF:= by + refine ⟨440,378,by decide,?_,by decide⟩ + exact qaI 440 qaF [441,452,463,469,472,473,474,475,476,442,454,464,465,466,467,468,470,471,443,444,445,446,447,448,449,450,451,453,455,456,457,458,459,460,461,462,305,375,376,377,378] 378 (by decide) +@[simp] theorem zMz (M : Machine Γ Λ) (qd : Cfg Γ Λ) : multiStep M qd 0=some qd:=rfl +@[simp] theorem zMo (M : Machine Γ Λ) (qd : Cfg Γ Λ) : multiStep M qd 1=step M qd:=rfl +@[simp] theorem zMs (M : Machine Γ Λ) (qd : Cfg Γ Λ) (n : Nat) : + multiStep M qd (n + 1)=Option.bind (multiStep M qd n) (step M):= by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem zZcd : (0 : Fin 2) >> default=default:= by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : ListBlank (Fin 2)).head=0:=rfl +@[simp] theorem zDt : (default : ListBlank (Fin 2)).tail=default:=rfl +@[simp] theorem append_nil (s : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> s=s:=rfl +@[simp] theorem append_cons (a : Fin 2) (l : List (Fin 2)) (s : ListBlank (Fin 2)) : + (a :: l) +> s=a >> (l +> s):=rfl +@[simp] theorem append_assoc (l1 l2 : List (Fin 2)) (s : ListBlank (Fin 2)) : + (l1 ++ l2) +> s=l1 +> (l2 +> s):= by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem qb2 (l : List (Fin 2)) : l ^ (0 : Nat)=[]:=rfl +theorem zLp (l : List (Fin 2)) (n : Nat) : l ^ (n + 1)=l ++ l ^ n:=rfl +theorem qD (l : List (Fin 2)) (m n : Nat) : l ^ (m + n)=l ^ m ++ l ^ n:= by + induction m with + | zero => simp [qb2] + | succ m ih => rw [Nat.succ_add,zLp,zLp,ih,List.append_assoc] +theorem zLp' (l : List (Fin 2)) (n : Nat) : l ^ (n + 1)=l ^ n ++ l:= by + rw [qD,zLp,qb2,List.append_nil] +theorem zSm {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢^{1} c₂:= by simp [h] +theorem zSp2 {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢⁺ c₂:=⟨1,by decide,zSm tm c₁ c₂ h⟩ +theorem zMa {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m)=(multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m):= by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃:= by + rw [zMa,h₁]; simp [h₂] +theorem qaj {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} (c : Cfg Γ Λ) : c [tm]⊢* c:=⟨0,rfl⟩ +theorem zSt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃:= by + rcases h₁ with ⟨n,hn⟩; rcases h₂ with ⟨m,hm⟩ + exact ⟨n + m,zMt tm c₁ c₂ c₃ n m hn hm⟩ +theorem zPs {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂:= by obtain ⟨n,_,hn⟩:=h; exact ⟨n,hn⟩ +theorem zPsp {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃:= by + obtain ⟨n,n_pos,hn⟩:=h₁; obtain ⟨m,hm⟩:=h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c₁ c₂ c₃ n m hn hm⟩ +theorem zSsp {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + zPsp (zSp2 tm c₁ c₂ h₁) h₂ +local macro "norm_tape" : tactic => + `(tactic| simp only [Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,append_cons,append_nil,zLp,qb2,List.cons_append,List.nil_append,zZcd,zDh,zDt]) +local macro "finish" : tactic => + `(tactic| (try norm_tape) <;> exists 0 <;> fail) +local macro "gstep" : tactic => + `(tactic| (try norm_tape) <;> (try refine zPs ?_) <;> + refine zSsp (by (try norm_tape); rfl) ?_ <;> + norm_tape) +local macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | gstep))) +def e1 : List (Fin 2):=[1,1,1,0,1,0] +def e2 : List (Fin 2):=[1,1,1,1,1,0] +def e3 : List (Fin 2):=[1,1,1,1,0,0] +def e4 : List (Fin 2):=[1,1,1,1,1,1] +def gap (n : Nat) : List (Fin 2):=([1,0] : List (Fin 2)) ^ n +def q5 : List (Fin 2):=[0,0,1,0,0,1] +def qg : List (Fin 2):=[0,1,1,0,0,1] +theorem qn (l : ListBlank (Fin 2)) (v : List (Fin 2)) (n : Nat) : + l <+ v ^ (n + 1)=(l <+ v ^ n) <+ v:= by + change v ^ (n + 1) +> l=v +> (v ^ n +> l) + rw [zLp,append_assoc] +theorem ql (l : ListBlank (Fin 2)) (v : List (Fin 2)) (n : Nat) : + l <+ v ^ (n + 1)=(l <+ v) <+ v ^ n:= by + change v ^ (n + 1) +> l=v ^ n +> (v +> l) + rw [zLp',append_assoc] +def J (l l' : ListBlank (Fin 2)) : Prop := + ∀ r,(l <{{C}} ((1 : Fin 2) >> r)) [holdout_0641_tm]⊢* (l' {{B}}> ((1 : Fin 2) >> r)) +theorem J_from_B {l l' : ListBlank (Fin 2)} (h : J l l') (r : ListBlank (Fin 2)) : + (l {{B}}> ((0 : Fin 2) >> r)) [holdout_0641_tm]⊢⁺ (l' {{B}}> ((1 : Fin 2) >> r)) := + zSsp (by norm_tape; rfl) (h r) +theorem qJ {l l' : ListBlank (Fin 2)} (h : J l l') (r : ListBlank (Fin 2)) : + (l {{B}}> ((0 : Fin 2) >> r)) [holdout_0641_tm]⊢* (l' {{B}}> ((1 : Fin 2) >> r)) := + zPs (J_from_B h r) +theorem J1 (l : ListBlank (Fin 2)) : J (l <+ e1) (l <+ e2):= by + intro r; unfold e1 e2; execute +theorem J2 (l : ListBlank (Fin 2)) : J (l <+ e2) (l <+ e3):= by + intro r; unfold e2 e3; execute +theorem J3 (l : ListBlank (Fin 2)) : J (l <+ e3) (l <+ e4):= by + intro r; unfold e3 e4; execute +theorem qb3 (l r : ListBlank (Fin 2)) : + ((l <+ e4) <{{C}} ((1 : Fin 2) >> r)) [holdout_0641_tm]⊢* (l {{B}}> ((0 : Fin 2) >> (q5 +> r))):= by + unfold e4 q5; execute +theorem qb4 (l r : ListBlank (Fin 2)) : + ((l <+ e4) {{B}}> ((0 : Fin 2) >> r)) [holdout_0641_tm]⊢* (l {{B}}> ((0 : Fin 2) >> (q5 +> r))) := + zSt (zPs (zSp2 _ _ _ (by norm_tape; rfl))) (qb3 l r) +theorem qaH (l r : ListBlank (Fin 2)) : + (l {{B}}> ((1 : Fin 2) >> (q5 +> r))) [holdout_0641_tm]⊢* (l {{B}}> ((0 : Fin 2) >> (qg +> r))):= by + unfold q5 qg; execute +theorem carry_return (l r : ListBlank (Fin 2)) : + (l {{B}}> ((1 : Fin 2) >> (qg +> r))) [holdout_0641_tm]⊢* ((l <+ e1) {{B}}> ((1 : Fin 2) >> r)):= by + unfold qg e1; execute +theorem J4 {l l' l'' : ListBlank (Fin 2)} (h1 : J l l') (h2 : J l' l'') : + J (l <+ e4) (l'' <+ e1):= by + intro r + refine zSt (qb3 l r) ?_ + refine zSt (qJ h1 (q5 +> r)) ?_ + refine zSt (qaH l' r) ?_ + refine zSt (qJ h2 (qg +> r)) ?_ + exact carry_return l'' r +theorem qaK (l r : ListBlank (Fin 2)) : + ((l <+ ([1,0] : List (Fin 2))) <{{C}} ((1 : Fin 2) >> r)) [holdout_0641_tm]⊢* (l {{B}}> ((0 : Fin 2) >> (([0,1] : List (Fin 2)) +> r))):= by + execute +theorem qbd (l r : ListBlank (Fin 2)) : + ((l <+ ([1,0] : List (Fin 2))) {{B}}> ((0 : Fin 2) >> r)) [holdout_0641_tm]⊢* (l {{B}}> ((0 : Fin 2) >> (([0,1] : List (Fin 2)) +> r))):= by + execute +theorem qan (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ gap n) {{B}}> ((0 : Fin 2) >> r)) [holdout_0641_tm]⊢* + (l {{B}}> ((0 : Fin 2) >> (([0,1] : List (Fin 2)) ^ n +> r))):= by + induction n generalizing r with + | zero => finish + | succ n ih => + unfold gap at ih ⊢ + rw [qn] + refine zSt (qbd (l <+ ([1,0] : List (Fin 2)) ^ n) r) ?_ + have h:=ih (([0,1] : List (Fin 2)) +> r) + rw [<- append_assoc,<- zLp'] at h + exact h +theorem qaU (l r : ListBlank (Fin 2)) : + (l {{B}}> ((1 : Fin 2) >> (([0,1] : List (Fin 2)) +> r))) [holdout_0641_tm]⊢* ((l <+ ([1,0] : List (Fin 2))) {{B}}> ((1 : Fin 2) >> r)):= by + execute +theorem qbk (l r : ListBlank (Fin 2)) (n : Nat) : + (l {{B}}> ((1 : Fin 2) >> (([0,1] : List (Fin 2)) ^ n +> r))) [holdout_0641_tm]⊢* + ((l <+ gap n) {{B}}> ((1 : Fin 2) >> r)):= by + induction n generalizing l with + | zero => finish + | succ n ih => + unfold gap at ih ⊢ + rw [zLp,append_assoc] + refine zSt (qaU l (([0,1] : List (Fin 2)) ^ n +> r)) ?_ + have h:=ih (l <+ ([1,0] : List (Fin 2))) + rw [<- ql] at h + exact h +theorem J_gaps {l l' : ListBlank (Fin 2)} (n : Nat) (h : J l l') : + J (l <+ gap n) (l' <+ gap n):= by + intro r + cases n with + | zero => exact h r + | succ n => + have h1 : ((l <+ gap (n + 1)) <{{C}} ((1 : Fin 2) >> r)) [holdout_0641_tm]⊢* + (l {{B}}> ((0 : Fin 2) >> (([0,1] : List (Fin 2)) ^ (n + 1) +> r))):= by + unfold gap + rw [qn] + refine zSt (qaK (l <+ ([1,0] : List (Fin 2)) ^ n) r) ?_ + have hg:=qan l (([0,1] : List (Fin 2)) +> r) n + unfold gap at hg + rw [<- append_assoc,<- zLp'] at hg + exact hg + refine zSt h1 ?_ + refine zSt (qJ h (([0,1] : List (Fin 2)) ^ (n + 1) +> r)) ?_ + exact qbk l' r (n + 1) +theorem left_three (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ e3) {{B}}> ((0 : Fin 2) >> (([0,1] : List (Fin 2)) ^ n +> (q5 +> r)))) [holdout_0641_tm]⊢* + (l {{B}}> ((0 : Fin 2) >> (q5 +> (([0,1] : List (Fin 2)) ^ n +> (qg +> r))))):= by + refine zSt (qJ (J3 l) (([0,1] : List (Fin 2)) ^ n +> (q5 +> r))) ?_ + refine zSt (qbk (l <+ e4) (q5 +> r) n) ?_ + refine zSt (qaH ((l <+ e4) <+ gap n) r) ?_ + refine zSt (qan (l <+ e4) (qg +> r) n) ?_ + exact qb4 l (([0,1] : List (Fin 2)) ^ n +> (qg +> r)) +theorem header (r : ListBlank (Fin 2)) : + ((default : ListBlank (Fin 2)) {{B}}> ((0 : Fin 2) >> (q5 +> (q5 +> (q5 +> (([0,1] : List (Fin 2)) ^ 2 +> (q5 +> r))))))) + [holdout_0641_tm]⊢* + ((((((((default : ListBlank (Fin 2)) <+ e4) <+ e2) <+ e4) <+ gap 2) <+ e1) <+ gap 2) {{C}}> r):= by + unfold q5 e1 e2 e4 gap; execute +def qr (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6):=(l <+ gap 2) {{C}}> r +theorem atom_P0 (l r : ListBlank (Fin 2)) : + (qr l (q5 +> r)) [holdout_0641_tm]⊢* (qr (l <+ e2) r):= by + unfold qr q5 e2 gap; execute +theorem atom_P1 (l r : ListBlank (Fin 2)) : + (qr l (([0,1] : List (Fin 2)) +> (q5 +> r))) [holdout_0641_tm]⊢* (qr ((l <+ gap 1) <+ e3) r):= by + unfold qr q5 e3 gap; execute +theorem atom_Q1 (l r : ListBlank (Fin 2)) : + (qr l (([0,1] : List (Fin 2)) +> (qg +> r))) [holdout_0641_tm]⊢* (qr ((l <+ e4) <+ gap 1) r):= by + unfold qr qg e4 gap; execute +theorem atom_Q0_s1 (l r : ListBlank (Fin 2)) : + (qr l (qg +> r)) [holdout_0641_tm]⊢* (l <{{C}} ((1 : Fin 2) >> (([0,1,0,1,0,0,0,0,1] : List (Fin 2)) +> r))):= by + unfold qr qg gap; execute +theorem atom_Q0_s2 (l' r : ListBlank (Fin 2)) : + (l' {{B}}> ((1 : Fin 2) >> (([0,1,0,1,0,0,0,0,1] : List (Fin 2)) +> r))) [holdout_0641_tm]⊢* + (l' <{{C}} ((1 : Fin 2) >> (([0,1,0,1,0,1,0,0,1] : List (Fin 2)) +> r))):= by + execute +theorem atom_Q0_s3 (l'' r : ListBlank (Fin 2)) : + (l'' {{B}}> ((1 : Fin 2) >> (([0,1,0,1,0,1,0,0,1] : List (Fin 2)) +> r))) [holdout_0641_tm]⊢* + (l'' <{{C}} ((1 : Fin 2) >> (([0,1,0,1,0,1,0,1,1] : List (Fin 2)) +> r))):= by + execute +theorem atom_Q0_s4 (l''' r : ListBlank (Fin 2)) : + (l''' {{B}}> ((1 : Fin 2) >> (([0,1,0,1,0,1,0,1,1] : List (Fin 2)) +> r))) [holdout_0641_tm]⊢* + (qr (l''' <+ gap 3) r):= by + unfold qr gap; execute +theorem atom_Q0 {l l' l'' l''' : ListBlank (Fin 2)} (Jl : J l l') (Jl' : J l' l'') (Jl'' : J l'' l''') (r : ListBlank (Fin 2)) : + (qr l (qg +> r)) [holdout_0641_tm]⊢* (qr (l''' <+ gap 3) r):= by + refine zSt (atom_Q0_s1 l r) ?_ + refine zSt (Jl (([0,1,0,1,0,0,0,0,1] : List (Fin 2)) +> r)) ?_ + refine zSt (atom_Q0_s2 l' r) ?_ + refine zSt (Jl' (([0,1,0,1,0,1,0,0,1] : List (Fin 2)) +> r)) ?_ + refine zSt (atom_Q0_s3 l'' r) ?_ + refine zSt (Jl'' (([0,1,0,1,0,1,0,1,1] : List (Fin 2)) +> r)) ?_ + exact atom_Q0_s4 l''' r +theorem atom_Q2_s1 (l r : ListBlank (Fin 2)) : + (qr l (([0,1] : List (Fin 2)) ^ 2 +> (qg +> r))) [holdout_0641_tm]⊢* + (l <{{C}} ((1 : Fin 2) >> (([0,1,0,0,1,0,0,1,0,1,0,1,1] : List (Fin 2)) +> r))):= by + unfold qr qg gap; execute +theorem atom_Q2_s2 (l' r : ListBlank (Fin 2)) : + (l' {{B}}> ((1 : Fin 2) >> (([0,1,0,0,1,0,0,1,0,1,0,1,1] : List (Fin 2)) +> r))) [holdout_0641_tm]⊢* + (l' <{{C}} ((1 : Fin 2) >> (([0,1,0,1,1,0,0,1,0,1,0,1,1] : List (Fin 2)) +> r))):= by + execute +theorem atom_Q2_s3 (l'' r : ListBlank (Fin 2)) : + (l'' {{B}}> ((1 : Fin 2) >> (([0,1,0,1,1,0,0,1,0,1,0,1,1] : List (Fin 2)) +> r))) [holdout_0641_tm]⊢* + (qr (((l'' <+ gap 1) <+ e1) <+ gap 1) r):= by + unfold qr e1 gap; execute +theorem atom_Q2 {l l' l'' : ListBlank (Fin 2)} (Jl : J l l') (Jl' : J l' l'') (r : ListBlank (Fin 2)) : + (qr l (([0,1] : List (Fin 2)) ^ 2 +> (qg +> r))) [holdout_0641_tm]⊢* + (qr (((l'' <+ gap 1) <+ e1) <+ gap 1) r):= by + refine zSt (atom_Q2_s1 l r) ?_ + refine zSt (Jl (([0,1,0,0,1,0,0,1,0,1,0,1,1] : List (Fin 2)) +> r)) ?_ + refine zSt (atom_Q2_s2 l' r) ?_ + refine zSt (Jl' (([0,1,0,1,1,0,0,1,0,1,0,1,1] : List (Fin 2)) +> r)) ?_ + exact atom_Q2_s3 l'' r +theorem qaT (l r : ListBlank (Fin 2)) : + (l {{C}}> (([0,1] : List (Fin 2)) +> r)) [holdout_0641_tm]⊢* ((l <+ ([1,1] : List (Fin 2))) {{C}}> r):= by + execute +theorem qa5 (l r : ListBlank (Fin 2)) : + (l {{C}}> (([0,1] : List (Fin 2)) ^ 2 +> r)) [holdout_0641_tm]⊢* ((l <+ ([1,1,1,1] : List (Fin 2))) {{C}}> r):= by + execute +theorem qH (l r : ListBlank (Fin 2)) : + (l {{C}}> (([0,1] : List (Fin 2)) ^ 3 +> r)) [holdout_0641_tm]⊢* ((l <+ e4) {{C}}> r):= by + unfold e4; execute +theorem qaD (l r : ListBlank (Fin 2)) : + (l {{C}}> (([0,1] : List (Fin 2)) ^ 4 +> r)) [holdout_0641_tm]⊢* (((l <+ e4) <+ ([1,1] : List (Fin 2))) {{C}}> r):= by + unfold e4; execute +theorem qh (l r : ListBlank (Fin 2)) (n : Nat) : + (l {{C}}> (([0,1] : List (Fin 2)) ^ (n * 3) +> r)) [holdout_0641_tm]⊢* ((l <+ e4 ^ n) {{C}}> r):= by + induction n generalizing l with + | zero => finish + | succ n ih => + have heq : (n + 1) * 3=3 + n * 3:= by omega + rw [heq,qD,append_assoc] + refine zSt (qH l (([0,1] : List (Fin 2)) ^ (n * 3) +> r)) ?_ + have h:=ih (l <+ e4) + rw [<- ql] at h + exact h +theorem turn_P (l r : ListBlank (Fin 2)) : + (l {{C}}> (q5 +> r)) [holdout_0641_tm]⊢* (l {{D}}> (([1,0,1] : List (Fin 2)) +> (([0,1,1] : List (Fin 2)) +> r))):= by + unfold q5; execute +theorem turn_Q1 (l r : ListBlank (Fin 2)) : + (l {{C}}> (([0,1] : List (Fin 2)) +> (qg +> r))) [holdout_0641_tm]⊢* (l {{D}}> (([1,0,1] : List (Fin 2)) +> (([0,0,0,0,1] : List (Fin 2)) +> r))):= by + unfold qg; execute +theorem qaQ (l r : ListBlank (Fin 2)) : + ((l <+ e4) {{D}}> (([1,0,1] : List (Fin 2)) +> r)) [holdout_0641_tm]⊢* (l {{D}}> (([1,0,1] : List (Fin 2)) +> (q5 +> r))):= by + unfold e4 q5; execute +theorem qK (l r : ListBlank (Fin 2)) (n : Nat) : + ((l <+ e4 ^ n) {{D}}> (([1,0,1] : List (Fin 2)) +> r)) [holdout_0641_tm]⊢* (l {{D}}> (([1,0,1] : List (Fin 2)) +> (q5 ^ n +> r))):= by + induction n generalizing r with + | zero => finish + | succ n ih => + rw [qn] + refine zSt (qaQ (l <+ e4 ^ n) r) ?_ + have h:=ih (q5 +> r) + rw [<- append_assoc (q5 ^ n) q5 r,<- zLp'] at h + exact h +theorem bounce_D2_s1 (l r : ListBlank (Fin 2)) : + (((l <+ gap 2) <+ ([1,1,1,1] : List (Fin 2))) {{D}}> (([1,0,1] : List (Fin 2)) +> r)) [holdout_0641_tm]⊢* + (l <{{C}} ((1 : Fin 2) >> (([0,1,0,1,0,0,1,0,0,1] : List (Fin 2)) +> r))):= by + unfold gap; execute +theorem bounce_D2_s2 (l' r : ListBlank (Fin 2)) : + (l' {{B}}> ((1 : Fin 2) >> (([0,1,0,1,0,0,1,0,0,1] : List (Fin 2)) +> r))) [holdout_0641_tm]⊢* + (l' <{{C}} ((1 : Fin 2) >> (([0,1,0,1,0,1,1,0,0,1] : List (Fin 2)) +> r))):= by + execute +theorem bounce_D2_s3 (l'' r : ListBlank (Fin 2)) : + (l'' {{B}}> ((1 : Fin 2) >> (([0,1,0,1,0,1,1,0,0,1] : List (Fin 2)) +> r))) [holdout_0641_tm]⊢* + (qr (l'' <+ gap 2) (([0,0,1] : List (Fin 2)) +> r)):= by + unfold qr gap; execute +theorem bounce_D2 {l l' l'' : ListBlank (Fin 2)} (Jl : J l l') (Jl' : J l' l'') (r : ListBlank (Fin 2)) : + (((l <+ gap 2) <+ ([1,1,1,1] : List (Fin 2))) {{D}}> (([1,0,1] : List (Fin 2)) +> r)) [holdout_0641_tm]⊢* + (qr (l'' <+ gap 2) (([0,0,1] : List (Fin 2)) +> r)):= by + refine zSt (bounce_D2_s1 l r) ?_ + refine zSt (Jl (([0,1,0,1,0,0,1,0,0,1] : List (Fin 2)) +> r)) ?_ + refine zSt (bounce_D2_s2 l' r) ?_ + refine zSt (Jl' (([0,1,0,1,0,1,1,0,0,1] : List (Fin 2)) +> r)) ?_ + exact bounce_D2_s3 l'' r +theorem bounce_D3 (l r : ListBlank (Fin 2)) : + (((l <+ gap 2) <+ e4) {{D}}> (([1,0,1] : List (Fin 2)) +> r)) [holdout_0641_tm]⊢* + (qr (l <+ e3) (([0,0,1] : List (Fin 2)) +> r)):= by + unfold qr e3 e4 gap; execute +theorem bounce_D4 (l r : ListBlank (Fin 2)) : + ((((l <+ gap 2) <+ e4) <+ ([1,1] : List (Fin 2))) {{D}}> (([1,0,1] : List (Fin 2)) +> r)) [holdout_0641_tm]⊢* + (qr ((l <+ gap 1) <+ e4) (([0,0,1] : List (Fin 2)) +> r)):= by + unfold qr e4 gap; execute +theorem qk (n : Nat) (r : ListBlank (Fin 2)) : + ([0,0,1] : List (Fin 2)) +> (q5 ^ n +> r)=q5 ^ n +> (([0,0,1] : List (Fin 2)) +> r):= by + induction n with + | zero => rfl + | succ n ih => + have h1 : ([0,0,1] : List (Fin 2)) +> (q5 +> (q5 ^ n +> r)) = + q5 +> (([0,0,1] : List (Fin 2)) +> (q5 ^ n +> r)):=rfl + rw [zLp,append_assoc,append_assoc,h1,ih] +theorem qab (l r : ListBlank (Fin 2)) (n : Nat) : + (qr l (q5 ^ n +> r)) [holdout_0641_tm]⊢* (qr (l <+ e2 ^ n) r):= by + induction n generalizing l with + | zero => finish + | succ n ih => + rw [zLp,append_assoc] + refine zSt (atom_P0 l (q5 ^ n +> r)) ?_ + have h:=ih (l <+ e2) + rw [<- ql] at h + exact h +theorem finish_P (l r : ListBlank (Fin 2)) : + (qr l (([0,0,1] : List (Fin 2)) +> (([0,1,1] : List (Fin 2)) +> r))) [holdout_0641_tm]⊢* (qr (l <+ e1) r):= by + unfold qr e1 gap; execute +theorem finish_Q (l r : ListBlank (Fin 2)) : + (qr l (([0,0,1] : List (Fin 2)) +> (([0,0,0,0,1] : List (Fin 2)) +> r))) [holdout_0641_tm]⊢* (qr ((l <+ e3) <+ gap 1) r):= by + unfold qr e3 gap; execute +theorem atom_P2 {l l' l'' : ListBlank (Fin 2)} (Jl : J l l') (Jl' : J l' l'') (r : ListBlank (Fin 2)) (n : Nat) : + (qr l (([0,1] : List (Fin 2)) ^ (2 + n * 3) +> (q5 +> r))) [holdout_0641_tm]⊢* + (qr (((l'' <+ gap 2) <+ e2 ^ n) <+ e1) r):= by + unfold qr + rw [qD,append_assoc] + refine zSt (qa5 (l <+ gap 2) (([0,1] : List (Fin 2)) ^ (n * 3) +> (q5 +> r))) ?_ + refine zSt (qh ((l <+ gap 2) <+ ([1,1,1,1] : List (Fin 2))) (q5 +> r) n) ?_ + refine zSt (turn_P (((l <+ gap 2) <+ ([1,1,1,1] : List (Fin 2))) <+ e4 ^ n) r) ?_ + refine zSt (qK ((l <+ gap 2) <+ ([1,1,1,1] : List (Fin 2))) (([0,1,1] : List (Fin 2)) +> r) n) ?_ + refine zSt (bounce_D2 Jl Jl' (q5 ^ n +> (([0,1,1] : List (Fin 2)) +> r))) ?_ + rw [qk] + refine zSt (qab (l'' <+ gap 2) (([0,0,1] : List (Fin 2)) +> (([0,1,1] : List (Fin 2)) +> r)) n) ?_ + exact finish_P ((l'' <+ gap 2) <+ e2 ^ n) r +theorem atom_P3 (l r : ListBlank (Fin 2)) (n : Nat) : + (qr l (([0,1] : List (Fin 2)) ^ (3 + n * 3) +> (q5 +> r))) [holdout_0641_tm]⊢* + (qr (((l <+ e3) <+ e2 ^ n) <+ e1) r):= by + unfold qr + rw [qD,append_assoc] + refine zSt (qH (l <+ gap 2) (([0,1] : List (Fin 2)) ^ (n * 3) +> (q5 +> r))) ?_ + refine zSt (qh ((l <+ gap 2) <+ e4) (q5 +> r) n) ?_ + refine zSt (turn_P (((l <+ gap 2) <+ e4) <+ e4 ^ n) r) ?_ + refine zSt (qK ((l <+ gap 2) <+ e4) (([0,1,1] : List (Fin 2)) +> r) n) ?_ + refine zSt (bounce_D3 l (q5 ^ n +> (([0,1,1] : List (Fin 2)) +> r))) ?_ + rw [qk] + refine zSt (qab (l <+ e3) (([0,0,1] : List (Fin 2)) +> (([0,1,1] : List (Fin 2)) +> r)) n) ?_ + exact finish_P ((l <+ e3) <+ e2 ^ n) r +theorem atom_P4 (l r : ListBlank (Fin 2)) (n : Nat) : + (qr l (([0,1] : List (Fin 2)) ^ (4 + n * 3) +> (q5 +> r))) [holdout_0641_tm]⊢* + (qr ((((l <+ gap 1) <+ e4) <+ e2 ^ n) <+ e1) r):= by + unfold qr + rw [qD,append_assoc] + refine zSt (qaD (l <+ gap 2) (([0,1] : List (Fin 2)) ^ (n * 3) +> (q5 +> r))) ?_ + refine zSt (qh (((l <+ gap 2) <+ e4) <+ ([1,1] : List (Fin 2))) (q5 +> r) n) ?_ + refine zSt (turn_P ((((l <+ gap 2) <+ e4) <+ ([1,1] : List (Fin 2))) <+ e4 ^ n) r) ?_ + refine zSt (qK (((l <+ gap 2) <+ e4) <+ ([1,1] : List (Fin 2))) (([0,1,1] : List (Fin 2)) +> r) n) ?_ + refine zSt (bounce_D4 l (q5 ^ n +> (([0,1,1] : List (Fin 2)) +> r))) ?_ + rw [qk] + refine zSt (qab ((l <+ gap 1) <+ e4) (([0,0,1] : List (Fin 2)) +> (([0,1,1] : List (Fin 2)) +> r)) n) ?_ + exact finish_P (((l <+ gap 1) <+ e4) <+ e2 ^ n) r +theorem atom_Q3 {l l' l'' : ListBlank (Fin 2)} (Jl : J l l') (Jl' : J l' l'') (r : ListBlank (Fin 2)) (n : Nat) : + (qr l (([0,1] : List (Fin 2)) ^ (3 + n * 3) +> (qg +> r))) [holdout_0641_tm]⊢* + (qr ((((l'' <+ gap 2) <+ e2 ^ n) <+ e3) <+ gap 1) r):= by + unfold qr + have heq : 3 + n * 3=2 + (n * 3 + 1):= by omega + rw [heq,qD _ 2 (n * 3 + 1),zLp' _ (n * 3),append_assoc,append_assoc] + refine zSt (qa5 (l <+ gap 2) (([0,1] : List (Fin 2)) ^ (n * 3) +> (([0,1] : List (Fin 2)) +> (qg +> r)))) ?_ + refine zSt (qh ((l <+ gap 2) <+ ([1,1,1,1] : List (Fin 2))) (([0,1] : List (Fin 2)) +> (qg +> r)) n) ?_ + refine zSt (turn_Q1 (((l <+ gap 2) <+ ([1,1,1,1] : List (Fin 2))) <+ e4 ^ n) r) ?_ + refine zSt (qK ((l <+ gap 2) <+ ([1,1,1,1] : List (Fin 2))) (([0,0,0,0,1] : List (Fin 2)) +> r) n) ?_ + refine zSt (bounce_D2 Jl Jl' (q5 ^ n +> (([0,0,0,0,1] : List (Fin 2)) +> r))) ?_ + rw [qk] + refine zSt (qab (l'' <+ gap 2) (([0,0,1] : List (Fin 2)) +> (([0,0,0,0,1] : List (Fin 2)) +> r)) n) ?_ + exact finish_Q ((l'' <+ gap 2) <+ e2 ^ n) r +theorem atom_Q4 (l r : ListBlank (Fin 2)) (n : Nat) : + (qr l (([0,1] : List (Fin 2)) ^ (4 + n * 3) +> (qg +> r))) [holdout_0641_tm]⊢* + (qr ((((l <+ e3) <+ e2 ^ n) <+ e3) <+ gap 1) r):= by + unfold qr + have heq : 4 + n * 3=3 + (n * 3 + 1):= by omega + rw [heq,qD _ 3 (n * 3 + 1),zLp' _ (n * 3),append_assoc,append_assoc] + refine zSt (qH (l <+ gap 2) (([0,1] : List (Fin 2)) ^ (n * 3) +> (([0,1] : List (Fin 2)) +> (qg +> r)))) ?_ + refine zSt (qh ((l <+ gap 2) <+ e4) (([0,1] : List (Fin 2)) +> (qg +> r)) n) ?_ + refine zSt (turn_Q1 (((l <+ gap 2) <+ e4) <+ e4 ^ n) r) ?_ + refine zSt (qK ((l <+ gap 2) <+ e4) (([0,0,0,0,1] : List (Fin 2)) +> r) n) ?_ + refine zSt (bounce_D3 l (q5 ^ n +> (([0,0,0,0,1] : List (Fin 2)) +> r))) ?_ + rw [qk] + refine zSt (qab (l <+ e3) (([0,0,1] : List (Fin 2)) +> (([0,0,0,0,1] : List (Fin 2)) +> r)) n) ?_ + exact finish_Q ((l <+ e3) <+ e2 ^ n) r +theorem atom_Q5 (l r : ListBlank (Fin 2)) (n : Nat) : + (qr l (([0,1] : List (Fin 2)) ^ (5 + n * 3) +> (qg +> r))) [holdout_0641_tm]⊢* + (qr (((((l <+ gap 1) <+ e4) <+ e2 ^ n) <+ e3) <+ gap 1) r):= by + unfold qr + have heq : 5 + n * 3=4 + (n * 3 + 1):= by omega + rw [heq,qD _ 4 (n * 3 + 1),zLp' _ (n * 3),append_assoc,append_assoc] + refine zSt (qaD (l <+ gap 2) (([0,1] : List (Fin 2)) ^ (n * 3) +> (([0,1] : List (Fin 2)) +> (qg +> r)))) ?_ + refine zSt (qh (((l <+ gap 2) <+ e4) <+ ([1,1] : List (Fin 2))) (([0,1] : List (Fin 2)) +> (qg +> r)) n) ?_ + refine zSt (turn_Q1 ((((l <+ gap 2) <+ e4) <+ ([1,1] : List (Fin 2))) <+ e4 ^ n) r) ?_ + refine zSt (qK (((l <+ gap 2) <+ e4) <+ ([1,1] : List (Fin 2))) (([0,0,0,0,1] : List (Fin 2)) +> r) n) ?_ + refine zSt (bounce_D4 l (q5 ^ n +> (([0,0,0,0,1] : List (Fin 2)) +> r))) ?_ + rw [qk] + refine zSt (qab ((l <+ gap 1) <+ e4) (([0,0,1] : List (Fin 2)) +> (([0,0,0,0,1] : List (Fin 2)) +> r)) n) ?_ + exact finish_Q (((l <+ gap 1) <+ e4) <+ e2 ^ n) r +theorem qaA (l : ListBlank (Fin 2)) (n : Nat) : + (l <+ e4 ^ n) <+ ([1,1] : List (Fin 2))=(l <+ ([1,1] : List (Fin 2))) <+ e4 ^ n:= by + induction n generalizing l with + | zero => rfl + | succ n ih => + have h1 : (l <+ e4) <+ ([1,1] : List (Fin 2))=(l <+ ([1,1] : List (Fin 2))) <+ e4:=rfl + rw [ql,ih (l <+ e4),h1,<- ql] +theorem tail_end (l : ListBlank (Fin 2)) : + (l {{C}}> default) [holdout_0641_tm]⊢* ((l <+ ([1,1] : List (Fin 2))) {{B}}> default):= by + execute +theorem tail0 (l : ListBlank (Fin 2)) (n : Nat) : + (qr l (([0,1] : List (Fin 2)) ^ (n * 3) +> default)) [holdout_0641_tm]⊢* + (((l <+ e1) <+ e4 ^ n) {{B}}> default):= by + unfold qr + refine zSt (qh (l <+ gap 2) default n) ?_ + have h:=tail_end ((l <+ gap 2) <+ e4 ^ n) + have heq : (l <+ gap 2) <+ ([1,1] : List (Fin 2))=l <+ e1:=rfl + rw [qaA,heq] at h + exact h +theorem tail1 (l : ListBlank (Fin 2)) (n : Nat) : + (qr l (([0,1] : List (Fin 2)) ^ (1 + n * 3) +> default)) [holdout_0641_tm]⊢* + ((((l <+ gap 1) <+ e2) <+ e4 ^ n) {{B}}> default):= by + unfold qr + rw [Nat.one_add,zLp,append_assoc] + refine zSt (qaT (l <+ gap 2) (([0,1] : List (Fin 2)) ^ (n * 3) +> default)) ?_ + refine zSt (qh ((l <+ gap 2) <+ ([1,1] : List (Fin 2))) default n) ?_ + have h:=tail_end (((l <+ gap 2) <+ ([1,1] : List (Fin 2))) <+ e4 ^ n) + have heq : ((l <+ gap 2) <+ ([1,1] : List (Fin 2))) <+ ([1,1] : List (Fin 2))=(l <+ gap 1) <+ e2:=rfl + rw [qaA,heq] at h + exact h +theorem tail2 (l : ListBlank (Fin 2)) (n : Nat) : + (qr l (([0,1] : List (Fin 2)) ^ (2 + n * 3) +> default)) [holdout_0641_tm]⊢* + (((l <+ gap 2) <+ e4 ^ (1 + n)) {{B}}> default):= by + unfold qr + rw [qD,append_assoc] + refine zSt (qa5 (l <+ gap 2) (([0,1] : List (Fin 2)) ^ (n * 3) +> default)) ?_ + refine zSt (qh ((l <+ gap 2) <+ ([1,1,1,1] : List (Fin 2))) default n) ?_ + have h:=tail_end (((l <+ gap 2) <+ ([1,1,1,1] : List (Fin 2))) <+ e4 ^ n) + have heq1 : ((l <+ gap 2) <+ ([1,1,1,1] : List (Fin 2))) <+ ([1,1] : List (Fin 2))=(l <+ gap 2) <+ e4:=rfl + rw [qaA,heq1,<- ql,Nat.add_comm n 1] at h + exact h +def qf : List Letter -> List Letter + | [] => [] + | .Odd :: w => .Even :: w + | .Even :: w => .Odd :: w + | .Gap :: w => .Gap :: qf w +theorem qP (w : List Letter) : qf (qf w)=w:= by + induction w with + | nil => rfl + | cons c w ih => cases c <;> simp [qf,ih] +theorem toggle_gaps (n : Nat) (w : List Letter) : + qf (List.replicate n .Gap ++ w)=List.replicate n .Gap ++ qf w:= by + induction n with + | zero => rfl + | succ n ih => simp [List.replicate_succ,qf,ih] +theorem gaps_cons (n : Nat) (w : List Letter) : + List.replicate n .Gap ++ .Gap :: w=List.replicate (n + 1) .Gap ++ w:= by + rw [List.replicate_succ',List.append_assoc,List.singleton_append] +inductive Counter : List Letter -> Nat -> ListBlank (Fin 2) -> Prop where + | c0 : Counter [] 0 default + | c1 {w s l} : Counter w s l -> Counter (.Odd :: w) (4 * (s / 2) + 3) (l <+ e1) + | c2 {w s l} : Counter w s l -> Counter (.Even :: w) (4 * (s / 2) + 2) (l <+ e2) + | c3 {w s l} : Counter w s l -> Counter (.Odd :: w) (4 * (s / 2) + 1) (l <+ e3) + | c4 {w s l} : Counter w s l -> Counter (.Even :: w) (4 * (s / 2)) (l <+ e4) + | c_gap {w s l} (n : Nat) : Counter w s l -> Counter (List.replicate n .Gap ++ w) s (l <+ gap n) +theorem qb8 (m : Nat) : + ∀ w s l,Counter w s l -> s < m -> 0 < s -> + ∃ l',Counter (qf w) (s - 1) l' /\ J l l':= by + induction m with + | zero => intro _ _ _ _ hs _; omega + | succ m ihm => + intro w s l hc + induction hc with + | c0 => intro _ hp; omega + | @c1 w s l hc _ => + intro _ _ + refine ⟨l <+ e2,?_,J1 l⟩ + have heq : 4 * (s / 2) + 3 - 1=4 * (s / 2) + 2:= by omega + rw [heq]; exact Counter.c2 hc + | @c2 w s l hc _ => + intro _ _ + refine ⟨l <+ e3,?_,J2 l⟩ + have heq : 4 * (s / 2) + 2 - 1=4 * (s / 2) + 1:= by omega + rw [heq]; exact Counter.c3 hc + | @c3 w s l hc _ => + intro _ _ + refine ⟨l <+ e4,?_,J3 l⟩ + have heq : 4 * (s / 2) + 1 - 1=4 * (s / 2):= by omega + rw [heq]; exact Counter.c4 hc + | @c4 w s l hc _ => + intro hb hp + have hs2 : 2 <= s:= by omega + have hsm : s < m:= by omega + rcases ihm w s l hc hsm (by omega) with ⟨l',hc',hj⟩ + rcases ihm (qf w) (s - 1) l' hc' (by omega) (by omega) with ⟨l'',hc'',hj'⟩ + rw [qP] at hc'' + refine ⟨l'' <+ e1,?_,J4 hj hj'⟩ + have heq : 4 * (s / 2) - 1=4 * ((s - 1 - 1) / 2) + 3:= by omega + rw [heq]; exact Counter.c1 hc'' + | @c_gap w s l n hc ih => + intro hb hp + rcases ih hb hp with ⟨l',hc',hj⟩ + refine ⟨l' <+ gap n,?_,J_gaps n hj⟩ + rw [toggle_gaps]; exact Counter.c_gap n hc' +theorem qaq {w : List Letter} {s : Nat} {l : ListBlank (Fin 2)} + (hc : Counter w s l) (hs : 0 < s) : + ∃ l',Counter (qf w) (s - 1) l' /\ J l l' := + qb8 (s + 1) w s l hc (by omega) hs +def qd (l : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6):=l {{B}}> default +theorem qaJ (l : ListBlank (Fin 2)) : + (l {{B}}> ((1 : Fin 2) >> default)) [holdout_0641_tm]⊢* ((l <+ gap 1) {{B}}> default):= by + unfold gap; execute +theorem qaW {w : List Letter} {s : Nat} {l : ListBlank (Fin 2)} + (hc : Counter w (s + 1) l) : + ∃ l',Counter (.Gap :: qf w) s l' /\ (qd l) [holdout_0641_tm]⊢⁺ (qd l'):= by + rcases qaq hc (by omega) with ⟨l',hc',hj⟩ + refine ⟨l' <+ gap 1,?_,?_⟩ + · have hc1:=Counter.c_gap 1 hc' + simpa using! hc1 + · unfold qd + have hstep:=J_from_B hj default + rw [zZcd] at hstep + exact zPsp hstep (qaJ l') +theorem qaa (s : Nat) (w : List Letter) : + List.replicate s .Gap ++ (if s % 2 == 1 then qf (.Gap :: qf w) else .Gap :: qf w) = + List.replicate (s + 1) .Gap ++ (if (s + 1) % 2 == 1 then qf w else w):= by + by_cases h : (s % 2 == 1)=true + · have h1 : ((s + 1) % 2 == 1)=false:= by + rw [beq_iff_eq] at h; rw [beq_eq_false_iff_ne]; omega + rw [h,h1] + simp only [↓reduceIte,Bool.false_eq_true,qf,qP] + exact gaps_cons s w + · have hf : (s % 2 == 1)=false:=Bool.eq_false_iff.mpr h + have h1 : ((s + 1) % 2 == 1)=true:= by + rw [beq_eq_false_iff_ne] at hf; rw [beq_iff_eq]; omega + rw [hf,h1] + simp only [Bool.false_eq_true,↓reduceIte] + exact gaps_cons s (qf w) +theorem qY (s : Nat) : + ∀ w l,Counter w s l -> + ∃ l',Counter (List.replicate s .Gap ++ (if s % 2 == 1 then qf w else w)) 0 l' /\ + (qd l) [holdout_0641_tm]⊢* (qd l'):= by + induction s with + | zero => + intro w l hc + exact ⟨l,hc,qaj _⟩ + | succ s ih => + intro w l hc + rcases qaW hc with ⟨l1,hc1,hstep⟩ + rcases ih (.Gap :: qf w) l1 hc1 with ⟨l2,hc2,hsteps⟩ + rw [qaa] at hc2 + exact ⟨l2,hc2,zSt (zPs hstep) hsteps⟩ +theorem qa1 {s : Nat} {w : List Letter} {l : ListBlank (Fin 2)} + (hc : Counter w s l) (hs : 0 < s) : + ∃ l',Counter (List.replicate s .Gap ++ (if s % 2 == 1 then qf w else w)) 0 l' /\ + (qd l) [holdout_0641_tm]⊢⁺ (qd l'):= by + cases s with + | zero => omega + | succ s => + rcases qaW hc with ⟨l1,hc1,hstep⟩ + rcases qY s (.Gap :: qf w) l1 hc1 with ⟨l2,hc2,hsteps⟩ + rw [qaa] at hc2 + exact ⟨l2,hc2,zPsp hstep hsteps⟩ +def qR : List Letter -> Bool + | [] => false + | .Odd :: _ => true + | .Even :: _ => false + | .Gap :: w => qR w +theorem low_odd_gaps (n : Nat) (w : List Letter) : + qR (List.replicate n .Gap ++ w)=qR w:= by + induction n with + | zero => rfl + | succ n ih => simp [List.replicate_succ,qR,ih] +theorem counter_odd {w : List Letter} {s : Nat} {l : ListBlank (Fin 2)} + (hc : Counter w s l) : (s % 2 == 1)=qR w:= by + induction hc with + | c0 => rfl + | @c1 w s l _ _ => + simp only [qR,beq_iff_eq]; omega + | @c2 w s l _ _ => + simp only [qR,beq_eq_false_iff_ne]; omega + | @c3 w s l _ _ => + simp only [qR,beq_iff_eq]; omega + | @c4 w s l _ _ => + simp only [qR,beq_eq_false_iff_ne]; omega + | @c_gap w s l n _ ih => + rw [low_odd_gaps]; exact ih +theorem qC {w : List Letter} {s : Nat} {l : ListBlank (Fin 2)} (n : Nat) + (hc : Counter w s l) : + ∃ t,Counter (List.replicate n .Even ++ w) t (l <+ e2 ^ n) /\ + t / 2 + 1=2 ^ n * (s / 2 + 1):= by + induction n with + | zero => exact ⟨s,hc,by simp⟩ + | succ n ih => + rcases ih with ⟨t,ht,he⟩ + refine ⟨4 * (t / 2) + 2,?_,?_⟩ + · rw [List.replicate_succ,List.cons_append,qn] + exact Counter.c2 ht + · have hdiv : (4 * (t / 2) + 2) / 2 + 1=2 * (t / 2 + 1):= by omega + rw [hdiv,he,Nat.pow_succ',Nat.mul_assoc] +theorem qad {w : List Letter} {s : Nat} {l : ListBlank (Fin 2)} + (hc : Counter w s l) (hs : 2 <= s) : + ∃ l1 l2,Counter w (s - 2) l2 /\ J l l1 /\ J l1 l2:= by + rcases qaq hc (by omega) with ⟨l1,h1,j1⟩ + rcases qaq h1 (by omega) with ⟨l2,h2,j2⟩ + rw [qP] at h2 + have heq : s - 1 - 1=s - 2:= by omega + rw [heq] at h2 + exact ⟨l1,l2,h2,j1,j2⟩ +theorem counter_J3 {w : List Letter} {s : Nat} {l : ListBlank (Fin 2)} + (hc : Counter w s l) (hs : 3 <= s) : + ∃ l1 l2 l3,Counter (qf w) (s - 3) l3 /\ J l l1 /\ J l1 l2 /\ J l2 l3:= by + rcases qad hc (by omega) with ⟨l1,l2,h2,j1,j2⟩ + rcases qaq h2 (by omega) with ⟨l3,h3,j3⟩ + have heq : s - 2 - 1=s - 3:= by omega + rw [heq] at h3 + exact ⟨l1,l2,l3,h3,j1,j2,j3⟩ +theorem qX {w : List Letter} {s : Nat} {l : ListBlank (Fin 2)} (n : Nat) + (hc : Counter w s l) (hs : 4 <= s) : + ∃ t,Counter (List.replicate n .Even ++ w) t (l <+ e4 ^ n) /\ s <= t:= by + induction n with + | zero => exact ⟨s,hc,le_rfl⟩ + | succ n ih => + rcases ih with ⟨t,ht,hle⟩ + refine ⟨4 * (t / 2),?_,by omega⟩ + rw [List.replicate_succ,List.cons_append,qn] + exact Counter.c4 ht +def qa3 (b : Block) (w : List Letter) : List Letter := + match b with + | .BQ0 => [.Gap,.Gap,.Gap] ++ qf w + | _ => (q4 b false).reverse ++ w +def qaw : List Block -> List Letter -> List Letter + | [],w => w + | b :: xs,w => qaw xs (qa3 b w) +theorem toggle_output (b : Block) (f : Bool) (w : List Letter) (h : b ≠ .BQ0) : + qf ((q4 b f).reverse ++ w)=(q4 b (!f)).reverse ++ w:= by + unfold q4 + simp only [List.reverse_append,List.append_assoc] + cases b <;> cases f <;> first | contradiction | rfl +theorem qaN (xs : List Block) (w : List Letter) : + qaw xs w=(qM xs).reverse ++ (if q6 xs then qf w else w):= by + induction xs generalizing w with + | nil => rfl + | cons b xs ih => + by_cases h : b=.BQ0 + · subst h + rw [qaw,qa3,ih,qM,q6,List.reverse_append,List.append_assoc] + rcases hflip : q6 xs with _ | _ <;> simp [hflip,qf,qP] + · have hnf : q6 (b :: xs)=false:= by cases b <;> first | contradiction | rfl + have hout : qM (b :: xs)=q4 b (q6 xs) ++ qM xs:= by + cases b <;> first | contradiction | rfl + have hup : qa3 b w=(q4 b false).reverse ++ w:= by + cases b <;> first | contradiction | rfl + rw [qaw,hup,ih,hnf,hout,List.reverse_append,List.append_assoc] + cases hflip : q6 xs + · rfl + · simp only [↓reduceIte,Bool.false_eq_true] + rw [toggle_output b false w h] + rfl +theorem updated_seed (xs : List Block) (prefix_w : List Letter) : + qaw xs (.Odd :: prefix_w)=(qL xs).reverse ++ prefix_w:= by + rw [qaN] + unfold qL + rw [List.reverse_cons,List.append_assoc] + cases q6 xs <;> rfl +def qo (b : Block) : List (Fin 2):=if q3 b then q5 else qg +def qw : List Block -> ListBlank (Fin 2) -> ListBlank (Fin 2) + | [],r => r + | b :: xs,r => (([0,1] : List (Fin 2)) ^ (gaps b)) +> (qo b +> qw xs r) +theorem qaY (a b : Nat) : (a * 2) * (b * 2)=4 * (a * b):= by + calc (a * 2) * (b * 2)=a * (2 * (b * 2)):= by rw [Nat.mul_assoc] + _ = a * (4 * b):= by congr 1; omega + _ = (a * 4) * b:= by rw [<- Nat.mul_assoc] + _ = (4 * a) * b:= by rw [Nat.mul_comm a 4] + _ = 4 * (a * b):= by rw [Nat.mul_assoc] +theorem qW (a b : Nat) : (a * 2 * 2) * (b * 2 + 1)=4 * (a * (2 * b + 1)):= by + calc (a * 2 * 2) * (b * 2 + 1)=(4 * a) * (2 * b + 1):= by congr 1 <;> omega + _ = 4 * (a * (2 * b + 1)):= by rw [Nat.mul_assoc] +theorem atom_BP2 (n s s' : Nat) (h : qau true (2 + n * 3) s=some s') : + 2 <= s /\ s'=4 * (2 ^ n * (s / 2)) - 1:= by + have hg : 2 + n * 3=n * 3 + 2:= by omega + have hdiv : (n * 3 + 2) / 3=n:= by omega + have hmod : ((n * 3 + 2) % 3 == 2)=true:= by rw [beq_iff_eq]; omega + rw [hg] at h + unfold qau at h + dsimp at h + rw [hdiv,hmod] at h + simp only [↓reduceIte] at h + split_ifs at h with hs + · injection h with h + have hp : 2 ^ (n + 1) * ((s / 2) * 2)=4 * (2 ^ n * (s / 2)):= by + rw [Nat.pow_succ]; exact qaY (2 ^ n) (s / 2) + rw [hp] at h + exact ⟨hs,h.symm⟩ +theorem atom_BP3 (n s s' : Nat) (h : qau true (3 + n * 3) s=some s') : + s'=4 * (2 ^ n * (2 * (s / 2) + 1)) - 1:= by + have hg : 3 + n * 3=n * 3 + 3:= by omega + have hdiv : (n * 3 + 3) / 3=n + 1:= by omega + have hmod : ((n * 3 + 3) % 3 == 2)=false:= by rw [beq_eq_false_iff_ne]; omega + rw [hg] at h + unfold qau at h + dsimp at h + rw [hdiv,hmod] at h + simp only [Bool.false_eq_true,↓reduceIte,Option.some.injEq] at h + have hp : 2 ^ (n + 1 + 1) * ((s / 2) * 2 + 1)=4 * (2 ^ n * (2 * (s / 2) + 1)):= by + rw [Nat.pow_succ,Nat.pow_succ]; exact qW (2 ^ n) (s / 2) + rw [hp] at h + exact h.symm +theorem atom_BP4 (n s s' : Nat) (h : qau true (4 + n * 3) s=some s') : + s'=4 * (2 ^ n * (2 * (s / 2) + 1)) - 1:= by + have hg : 4 + n * 3=n * 3 + 4:= by omega + have hdiv : (n * 3 + 4) / 3=n + 1:= by omega + have hmod : ((n * 3 + 4) % 3 == 2)=false:= by rw [beq_eq_false_iff_ne]; omega + rw [hg] at h + unfold qau at h + dsimp at h + rw [hdiv,hmod] at h + simp only [Bool.false_eq_true,↓reduceIte,Option.some.injEq] at h + have hp : 2 ^ (n + 1 + 1) * ((s / 2) * 2 + 1)=4 * (2 ^ n * (2 * (s / 2) + 1)):= by + rw [Nat.pow_succ,Nat.pow_succ]; exact qW (2 ^ n) (s / 2) + rw [hp] at h + exact h.symm +theorem atom_BQ0_val (s s' : Nat) (h : qau false 0 s=some s') : + 3 <= s /\ s'=s - 3:= by + unfold qau at h + simp only [Bool.false_eq_true, ↓reduceIte] at h + split_ifs at h with hs + · injection h with h; exact ⟨hs,h.symm⟩ +theorem atom_BQ2_val (s s' : Nat) (h : qau false 2 s=some s') : + 2 <= s /\ s'=4 * ((s - 2) / 2) + 3:= by + unfold qau at h + simp only [Bool.false_eq_true, ↓reduceIte] at h + split_ifs at h with hs + · injection h with h; exact ⟨hs,by omega⟩ +theorem atom_BQ3 (n s s' : Nat) (h : qau false (3 + n * 3) s=some s') : + 2 <= s /\ s'=4 * (2 ^ n * (s / 2)) - 3:= by + have hg : 3 + n * 3=n * 3 + 3:= by omega + have hdiv : (n * 3 + 3) / 3=n + 1:= by omega + have hmod : ((n * 3 + 3) % 3 == 0)=true:= by rw [beq_iff_eq]; omega + rw [hg] at h + unfold qau at h + dsimp at h + rw [hdiv,hmod] at h + simp only [↓reduceIte] at h + split_ifs at h with hs + · injection h with h + have hp : 2 ^ (n + 1) * ((s / 2) * 2)=4 * (2 ^ n * (s / 2)):= by + rw [Nat.pow_succ]; exact qaY (2 ^ n) (s / 2) + rw [hp] at h + exact ⟨hs,h.symm⟩ +theorem atom_BQ4 (n s s' : Nat) (h : qau false (4 + n * 3) s=some s') : + s'=4 * (2 ^ n * (2 * (s / 2) + 1)) - 3:= by + have hg : 4 + n * 3=n * 3 + 4:= by omega + have hdiv : (n * 3 + 4) / 3=n + 1:= by omega + have hmod : ((n * 3 + 4) % 3 == 0)=false:= by rw [beq_eq_false_iff_ne]; omega + rw [hg] at h + unfold qau at h + dsimp at h + rw [hdiv,hmod] at h + simp only [Bool.false_eq_true,↓reduceIte,Option.some.injEq] at h + have hp : 2 ^ (n + 1 + 1) * ((s / 2) * 2 + 1)=4 * (2 ^ n * (2 * (s / 2) + 1)):= by + rw [Nat.pow_succ,Nat.pow_succ]; exact qW (2 ^ n) (s / 2) + rw [hp] at h + exact h.symm +theorem atom_BQ5 (n s s' : Nat) (h : qau false (5 + n * 3) s=some s') : + s'=4 * (2 ^ n * (2 * (s / 2) + 1)) - 3:= by + have hg : 5 + n * 3=n * 3 + 5:= by omega + have hdiv : (n * 3 + 5) / 3=n + 1:= by omega + have hmod : ((n * 3 + 5) % 3 == 0)=false:= by rw [beq_eq_false_iff_ne]; omega + rw [hg] at h + unfold qau at h + dsimp at h + rw [hdiv,hmod] at h + simp only [Bool.false_eq_true,↓reduceIte,Option.some.injEq] at h + have hp : 2 ^ (n + 1 + 1) * ((s / 2) * 2 + 1)=4 * (2 ^ n * (2 * (s / 2) + 1)):= by + rw [Nat.pow_succ,Nat.pow_succ]; exact qW (2 ^ n) (s / 2) + rw [hp] at h + exact h.symm +theorem block_step (b : Block) {w : List Letter} {s : Nat} {l : ListBlank (Fin 2)} {s' : Nat} + (hc : Counter w s l) (hs : qau (q3 b) (gaps b) s=some s') : + ∃ l',Counter (qa3 b w) s' l' /\ + ∀ r,(qr l ((([0,1] : List (Fin 2)) ^ (gaps b)) +> (qo b +> r))) [holdout_0641_tm]⊢* (qr l' r):= by + cases b with + | BP0 => + unfold q3 gaps qau at hs + dsimp only at hs + injection hs with hs + refine ⟨l <+ e2,?_,fun r => atom_P0 l r⟩ + have heq : s'=4 * (s / 2) + 2:= by omega + rw [heq]; exact Counter.c2 hc + | BP1 => + unfold q3 gaps qau at hs + dsimp only at hs + injection hs with hs + refine ⟨(l <+ gap 1) <+ e3,?_,fun r => ?_⟩ + · have heq : s'=4 * (s / 2) + 1:= by omega + rw [heq] + exact Counter.c3 (Counter.c_gap 1 hc) + · simpa [gaps,qo,q3] using! atom_P1 l r + | BP2 n => + rcases atom_BP2 n s s' hs with ⟨hs2,hs'⟩ + rcases qad hc hs2 with ⟨l1,l2,h2,j1,j2⟩ + have hgap:=Counter.c_gap 2 h2 + rcases qC n hgap with ⟨t,ht,he⟩ + have hdiv : (s - 2) / 2 + 1=s / 2:= by omega + rw [hdiv] at he + refine ⟨((l2 <+ gap 2) <+ e2 ^ n) <+ e1,?_,fun r => atom_P2 j1 j2 r n⟩ + have hts : s'=4 * (t / 2) + 3:= by omega + rw [hts] + have hc1:=Counter.c1 ht + simpa [qa3,q4,qaz,qa,back,q3,qO,List.reverse_replicate,List.append_assoc] using! hc1 + | BP3 n => + have hs':=atom_BP3 n s s' hs + have h3:=Counter.c3 hc + rcases qC n h3 with ⟨t,ht,he⟩ + have hdiv : (4 * (s / 2) + 1) / 2 + 1=2 * (s / 2) + 1:= by omega + rw [hdiv] at he + refine ⟨((l <+ e3) <+ e2 ^ n) <+ e1,?_,fun r => atom_P3 l r n⟩ + have hts : s'=4 * (t / 2) + 3:= by omega + rw [hts] + have hc1:=Counter.c1 ht + simpa [qa3,q4,qaz,qa,back,q3,qO,List.reverse_replicate,List.append_assoc] using! hc1 + | BP4 n => + have hs':=atom_BP4 n s s' hs + have h4:=Counter.c4 (Counter.c_gap 1 hc) + rcases qC n h4 with ⟨t,ht,he⟩ + have hdiv : (4 * (s / 2)) / 2 + 1=2 * (s / 2) + 1:= by omega + rw [hdiv] at he + refine ⟨(((l <+ gap 1) <+ e4) <+ e2 ^ n) <+ e1,?_,fun r => atom_P4 l r n⟩ + have hts : s'=4 * (t / 2) + 3:= by omega + rw [hts] + have hc1:=Counter.c1 ht + simpa [qa3,q4,qaz,qa,back,q3,qO,List.reverse_replicate,List.append_assoc] using! hc1 + | BQ0 => + rcases atom_BQ0_val s s' hs with ⟨hs3,hs'⟩ + rcases counter_J3 hc hs3 with ⟨l1,l2,l3,h3,j1,j2,j3⟩ + refine ⟨l3 <+ gap 3,?_,fun r => atom_Q0 j1 j2 j3 r⟩ + rw [hs'] + exact Counter.c_gap 3 h3 + | BQ1 => + unfold q3 gaps qau at hs + dsimp only at hs + injection hs with hs + refine ⟨(l <+ e4) <+ gap 1,?_,fun r => ?_⟩ + · have heq : s'=4 * (s / 2):= by omega + rw [heq] + exact Counter.c_gap 1 (Counter.c4 hc) + · simpa [gaps,qo,q3] using! atom_Q1 l r + | BQ2 => + rcases atom_BQ2_val s s' hs with ⟨hs2,hs'⟩ + rcases qad hc hs2 with ⟨l1,l2,h2,j1,j2⟩ + refine ⟨((l2 <+ gap 1) <+ e1) <+ gap 1,?_,fun r => atom_Q2 j1 j2 r⟩ + rw [hs'] + exact Counter.c_gap 1 (Counter.c1 (Counter.c_gap 1 h2)) + | BQ3 n => + rcases atom_BQ3 n s s' hs with ⟨hs2,hs'⟩ + rcases qad hc hs2 with ⟨l1,l2,h2,j1,j2⟩ + have hgap:=Counter.c_gap 2 h2 + rcases qC n hgap with ⟨t,ht,he⟩ + have hdiv : (s - 2) / 2 + 1=s / 2:= by omega + rw [hdiv] at he + refine ⟨(((l2 <+ gap 2) <+ e2 ^ n) <+ e3) <+ gap 1,?_,fun r => atom_Q3 j1 j2 r n⟩ + have hts : s'=4 * (t / 2) + 1:= by omega + rw [hts] + have hc3:=Counter.c_gap 1 (Counter.c3 ht) + simpa [qa3,q4,qaz,qa,back,q3,qO,List.reverse_replicate,List.append_assoc] using! hc3 + | BQ4 n => + have hs':=atom_BQ4 n s s' hs + have h3:=Counter.c3 hc + rcases qC n h3 with ⟨t,ht,he⟩ + have hdiv : (4 * (s / 2) + 1) / 2 + 1=2 * (s / 2) + 1:= by omega + rw [hdiv] at he + refine ⟨(((l <+ e3) <+ e2 ^ n) <+ e3) <+ gap 1,?_,fun r => atom_Q4 l r n⟩ + have hts : s'=4 * (t / 2) + 1:= by omega + rw [hts] + have hc3:=Counter.c_gap 1 (Counter.c3 ht) + simpa [qa3,q4,qaz,qa,back,q3,qO,List.reverse_replicate,List.append_assoc] using! hc3 + | BQ5 n => + have hs':=atom_BQ5 n s s' hs + have h4:=Counter.c4 (Counter.c_gap 1 hc) + rcases qC n h4 with ⟨t,ht,he⟩ + have hdiv : (4 * (s / 2)) / 2 + 1=2 * (s / 2) + 1:= by omega + rw [hdiv] at he + refine ⟨((((l <+ gap 1) <+ e4) <+ e2 ^ n) <+ e3) <+ gap 1,?_,fun r => atom_Q5 l r n⟩ + have hts : s'=4 * (t / 2) + 1:= by omega + rw [hts] + have hc3:=Counter.c_gap 1 (Counter.c3 ht) + simpa [qa3,q4,qaz,qa,back,q3,qO,List.reverse_replicate,List.append_assoc] using! hc3 +theorem blocks_steps {s : Nat} {xs : List Block} {s' : Nat} (hr : BlocksRun s xs s') : + ∀ w l,Counter w s l -> ∃ l',Counter (qaw xs w) s' l' /\ + ∀ r,(qr l (qw xs r)) [holdout_0641_tm]⊢* (qr l' r):= by + induction hr with + | nil s => + intro w l hc + exact ⟨l,hc,fun _ => qaj _⟩ + | cons s b s1 xs s2 ha _ ih => + intro w l hc + rcases block_step b hc ha with ⟨l1,hc1,hstep⟩ + rcases ih (qa3 b w) l1 hc1 with ⟨l2,hc2,hsteps⟩ + exact ⟨l2,hc2,fun r => zSt (hstep (qw xs r)) (hsteps r)⟩ +theorem finish_tail {w : List Letter} {s : Nat} {l : ListBlank (Fin 2)} (q j : Nat) + (hc : Counter w s l) (hs : 28 <= s) (hj : j < 3) : + ∃ l' t, + Counter ((qu j ++ List.replicate (q9 j q) Letter.Even).reverse ++ w) t l' /\ + 28 <= t /\ + (qr l ((([0,1] : List (Fin 2)) ^ (j + q * 3)) +> default)) [holdout_0641_tm]⊢* (qd l'):= by + rcases j with _ | _ | _ | j + · have h1:=Counter.c1 hc + rcases qX q h1 (by omega) with ⟨t,ht,hle⟩ + refine ⟨(l <+ e1) <+ e4 ^ q,t,?_,by omega,?_⟩ + · simpa [qu,q9,List.reverse_replicate,List.append_assoc] using! ht + · simpa [qd] using! tail0 l q + · have h2:=Counter.c2 (Counter.c_gap 1 hc) + rcases qX q h2 (by omega) with ⟨t,ht,hle⟩ + refine ⟨((l <+ gap 1) <+ e2) <+ e4 ^ q,t,?_,by omega,tail1 l q⟩ + have heq : (qu 1 ++ List.replicate (q9 1 q) Letter.Even).reverse ++ w = + List.replicate q Letter.Even ++ Letter.Even :: Letter.Gap :: w:= by + change ([Letter.Gap] ++ List.replicate (q + 1) Letter.Even).reverse ++ w=_ + rw [List.reverse_append,List.reverse_replicate,List.replicate_succ'] + simp [List.append_assoc] + rw [heq] + exact ht + · have hgap:=Counter.c_gap 2 hc + rcases qX (1 + q) hgap (by omega) with ⟨t,ht,hle⟩ + refine ⟨(l <+ gap 2) <+ e4 ^ (1 + q),t,?_,by omega,tail2 l q⟩ + have hq1 : q + 1=1 + q:= by omega + have heq : (qu 2 ++ List.replicate (q9 2 q) Letter.Even).reverse ++ w = + List.replicate (1 + q) Letter.Even ++ (List.replicate 2 Letter.Gap ++ w):= by + change ([Letter.Gap,Letter.Gap] ++ List.replicate (q + 1) Letter.Even).reverse ++ w=_ + rw [List.reverse_append,List.reverse_replicate,hq1] + simp [List.replicate_succ,List.append_assoc] + rw [heq] + exact ht + · omega +def qj : List Letter -> Nat -> ListBlank (Fin 2) -> ListBlank (Fin 2) + | [],g,r => (([0,1] : List (Fin 2)) ^ g) +> (q5 +> r) + | .Gap :: w,g,r => qj w (g + 1) r + | .Odd :: w,g,r => qj w 0 ((([0,1] : List (Fin 2)) ^ g) +> (qg +> r)) + | .Even :: w,g,r => qj w 0 ((([0,1] : List (Fin 2)) ^ g) +> (q5 +> r)) +theorem qaf (n : Nat) (w : List Letter) (g : Nat) (r : ListBlank (Fin 2)) : + qj (List.replicate n .Gap ++ w) g r=qj w (n + g) r:= by + induction n generalizing g with + | zero => simp + | succ n ih => + simp only [List.replicate_succ,List.cons_append,qj,ih] + have heq : n + (g + 1)=(n + 1) + g:= by omega + rw [heq] +theorem qbb {w : List Letter} {s : Nat} {l : ListBlank (Fin 2)} + (hc : Counter w s l) (hs : s <= 1) (g : Nat) (r : ListBlank (Fin 2)) : + (l {{B}}> ((0 : Fin 2) >> ((([0,1] : List (Fin 2)) ^ g) +> (q5 +> r)))) [holdout_0641_tm]⊢* + ((default : ListBlank (Fin 2)) {{B}}> ((0 : Fin 2) >> qj w g r)):= by + induction hc generalizing g r with + | c0 => finish + | c1 _ => omega + | c2 _ => omega + | @c3 w s l _ ih => + refine zSt (left_three l r g) ?_ + exact ih (by omega) 0 ((([0,1] : List (Fin 2)) ^ g) +> (qg +> r)) + | @c4 w s l _ ih => + refine zSt (qb4 l ((([0,1] : List (Fin 2)) ^ g) +> (q5 +> r))) ?_ + exact ih (by omega) 0 ((([0,1] : List (Fin 2)) ^ g) +> (q5 +> r)) + | @c_gap w s l n _ ih => + refine zSt (qan l ((([0,1] : List (Fin 2)) ^ g) +> (q5 +> r)) n) ?_ + rw [qaf,<- append_assoc,<- qD] + exact ih hs (n + g) r +def qp : List Letter -> ListBlank (Fin 2) -> ListBlank (Fin 2) + | [],r => r + | .Gap :: w,r => qp w (([0,1] : List (Fin 2)) +> r) + | .Even :: w,r => qj w 0 r + | .Odd :: _,r => r +theorem qm (n : Nat) (w : List Letter) (r : ListBlank (Fin 2)) : + qp (List.replicate n .Gap ++ w) r = + qp w ((([0,1] : List (Fin 2)) ^ n) +> r):= by + induction n generalizing r with + | zero => rfl + | succ n ih => + simp only [List.replicate_succ,List.cons_append,qp,ih,<- append_assoc,<- zLp'] +theorem qaS {w : List Letter} {s : Nat} {l : ListBlank (Fin 2)} + (hc : Counter w s l) (hs : s=0) (r : ListBlank (Fin 2)) : + (l {{B}}> ((0 : Fin 2) >> r)) [holdout_0641_tm]⊢* + ((default : ListBlank (Fin 2)) {{B}}> ((0 : Fin 2) >> qp w r)):= by + induction hc generalizing r with + | c0 => finish + | c1 _ => omega + | c2 _ => omega + | c3 _ => omega + | @c4 w s l hc _ => + refine zSt (qb4 l r) ?_ + exact qbb hc (by omega) 0 r + | @c_gap w s l n _ ih => + refine zSt (qan l r n) ?_ + rw [qm] + exact ih hs ((([0,1] : List (Fin 2)) ^ n) +> r) +def qc : List Letter:=[.Gap,.Gap,.Even,.Even,.Even] +def qN : ListBlank (Fin 2) := + (((((default : ListBlank (Fin 2)) <+ e4) <+ e2) <+ e4) <+ gap 2) <+ e1 +theorem qbf : Counter (.Odd :: qc) 11 qN := + Counter.c1 (Counter.c_gap 2 (Counter.c4 (Counter.c2 (Counter.c4 Counter.c0)))) +theorem scan_block (b : Block) (w : List Letter) (r : ListBlank (Fin 2)) : + qj ((qi b).reverse ++ w) 0 r = + qj w 0 ((([0,1] : List (Fin 2)) ^ (gaps b)) +> (qo b +> r)):= by + unfold qi + rw [List.reverse_cons,List.reverse_replicate,List.append_assoc,qaf,Nat.add_zero] + unfold symbol qo + cases q3 b <;> rfl +theorem scan_blocks (xs : List Block) (w : List Letter) (r : ListBlank (Fin 2)) : + qj ((qb xs).reverse ++ w) 0 r=qj w 0 (qw xs r):= by + induction xs generalizing w r with + | nil => rfl + | cons b xs ih => + simp only [qb,List.reverse_append,List.append_assoc,ih,scan_block,qw] +theorem qbc (xs : List Block) (n : Nat) (l : ListBlank (Fin 2)) + (hc : Counter (List.replicate n .Gap ++ .Even :: ((qb xs).reverse ++ qc)) 0 l) : + (qd l) [holdout_0641_tm]⊢* + (qr qN (qw xs ((([0,1] : List (Fin 2)) ^ n) +> default))):= by + unfold qd + have h1:=qaS hc rfl default + rw [zZcd] at h1 + refine zSt h1 ?_ + rw [qm,qp,scan_blocks] + exact header (qw xs ((([0,1] : List (Fin 2)) ^ n) +> default)) +theorem repeat_snoc (a : Letter) (n : Nat) : + List.replicate n a ++ [a]=List.replicate (n + 1) a := + List.replicate_succ'.symm +theorem cycle (xs : List Block) (s : Nat) (l : ListBlank (Fin 2)) + (hc : Counter (.Even :: ((qb xs).reverse ++ qc)) s l) + (hs : 12 <= s) + (hl : qI (qb xs ++ [.Even])) : + ∃ xs' s' l', + Counter (.Even :: ((qb xs').reverse ++ qc)) s' l' /\ + 12 <= s' /\ + qI (qb xs' ++ [.Even]) /\ + (qd l) [holdout_0641_tm]⊢⁺ (qd l'):= by + have hodd:=counter_odd hc + simp only [qR] at hodd + rcases qa1 hc (by omega) with ⟨l0,hc0,hbatch⟩ + rw [hodd] at hc0 + simp only [Bool.false_eq_true,↓reduceIte] at hc0 + have hstart:=qbc xs s l0 hc0 + rcases qaB xs hl with ⟨t,hblocks,ht⟩ + rcases blocks_steps hblocks (.Odd :: qc) qN qbf with ⟨l1,hc1,hsteps⟩ + rw [updated_seed] at hc1 + let q:=s / 3 + let j:=s % 3 + have hj : j < 3:= by omega + have hq : 4 <= q:= by omega + have hs_eq : s=j + q * 3:= by omega + rcases finish_tail q j hc1 ht hj with ⟨l2,s2,hc2,hs2,htail⟩ + have hcount : 4 <= q9 j q:= by + unfold q9; rcases j with _ | _ | _ <;> omega + have hd_ne : qO (q6 xs) .Odd ≠ .Gap:= by + cases q6 xs <;> decide + rcases digit_blocks (qO (q6 xs) .Odd) + (qM xs ++ qu j ++ List.replicate (q9 j q - 1) Letter.Even) hd_ne with ⟨xs',hxs'⟩ + have hword : qb xs' ++ [.Even]=qL xs ++ qu j ++ List.replicate (q9 j q) Letter.Even:= by + rw [hxs'] + unfold qL + simp only [List.cons_append,List.append_assoc] + have hrep : List.replicate (q9 j q - 1) Letter.Even ++ [Letter.Even] = + List.replicate (q9 j q) Letter.Even:= by + rw [repeat_snoc] + congr 1; omega + rw [hrep] + have hl':=macro_closed xs j (q9 j q - 4) hj hl + have htc : 4 + (q9 j q - 4)=q9 j q:= by omega + rw [htc,<- hword] at hl' + have hc' : Counter (.Even :: ((qb xs').reverse ++ qc)) s2 l2:= by + have hrev : Letter.Even :: ((qb xs').reverse ++ qc) = + (qb xs' ++ [Letter.Even]).reverse ++ qc:= by + simp [List.reverse_append,List.append_assoc] + rw [hrev,hword] + simpa [List.reverse_append,List.append_assoc] using! hc2 + refine ⟨xs',s2,l2,hc',by omega,hl',?_⟩ + refine zPsp hbatch ?_ + refine zSt hstart ?_ + refine zSt (hsteps ((([0,1] : List (Fin 2)) ^ s) +> default)) ?_ + rw [hs_eq] + exact htail +def qaR : ListBlank (Fin 2) := + ((((((((default : ListBlank (Fin 2)) <+ e4 ^ 2) <+ e2) <+ gap 2) <+ e2) <+ gap 4) <+ e2 ^ 3) <+ e1) <+ e4 ^ 32 +def seed : Cfg (Fin 2) (Fin 6):=qd qaR +theorem seed_counter : + ∃ s,Counter (.Even :: ((qb qS).reverse ++ qc)) s qaR /\ 12 <= s:= by + have hc0:=Counter.c0 + have hc1:=Counter.c4 (Counter.c4 hc0) + have hc2:=Counter.c2 hc1 + have hc3:=Counter.c_gap 2 hc2 + have hc4:=Counter.c2 hc3 + have hc5:=Counter.c_gap 4 hc4 + have hc6:=Counter.c2 (Counter.c2 (Counter.c2 hc5)) + have hc7:=Counter.c1 hc6 + rcases qX 32 hc7 (by omega) with ⟨s,hs,hle⟩ + refine ⟨s,?_,by omega⟩ + exact hs +def l_p1 : ListBlank (Fin 2) := + ((((default : ListBlank (Fin 2)) <+ e4) <+ e2) <+ e1) <+ e4 +theorem init_phase1 : (init []) [holdout_0641_tm]⊢* (qd l_p1):= by + unfold init qd l_p1 e1 e2 e4 + execute +theorem hc_p1 : Counter [.Even,.Odd,.Even,.Even] 12 l_p1 := + Counter.c4 (Counter.c1 (Counter.c2 (Counter.c4 Counter.c0))) +def l_p3 : ListBlank (Fin 2) := + (((((((((default : ListBlank (Fin 2)) <+ e4) <+ e4) <+ e1) <+ gap 3) <+ e1) <+ e4) <+ e4) <+ e4) <+ e4 +theorem init_phase2 : + ((default : ListBlank (Fin 2)) {{B}}> + ((0 : Fin 2) >> (q5 +> (q5 +> (q5 +> (qg +> ((([0,1] : List (Fin 2)) ^ 12) +> default))))))) + [holdout_0641_tm]⊢* (qd l_p3):= by + unfold qd l_p3 e1 e4 gap q5 qg + execute +theorem hc_p3 : Counter [.Even,.Even,.Even,.Even,.Odd,.Gap,.Gap,.Gap,.Odd,.Even,.Even] 96 l_p3 := + Counter.c4 (Counter.c4 (Counter.c4 (Counter.c4 (Counter.c1 (Counter.c_gap 3 (Counter.c1 (Counter.c4 (Counter.c4 Counter.c0)))))))) +theorem init_phase3a (r : ListBlank (Fin 2)) : + ((default : ListBlank (Fin 2)) {{B}}> + ((0 : Fin 2) >> (q5 +> (q5 +> (q5 +> ((([0,1] : List (Fin 2)) ^ 3) +> (qg +> r))))))) + [holdout_0641_tm]⊢* + (((((((default : ListBlank (Fin 2)) <+ e4) <+ e2) <+ e4) <+ gap 2) <+ e3) {{B}}> (([1,0,1,0,1,1] : List (Fin 2)) +> r)):= by + unfold e2 e3 e4 gap q5 qg + execute +theorem init_phase3b (r : ListBlank (Fin 2)) : + (((((((default : ListBlank (Fin 2)) <+ e4) <+ e2) <+ e4) <+ gap 2) <+ e3) {{B}}> + (([1,0,1,0,1,1] : List (Fin 2)) +> (qg +> (q5 +> (q5 +> (q5 +> r)))))) + [holdout_0641_tm]⊢* + (qr (((((((default : ListBlank (Fin 2)) <+ e4 ^ 2) <+ e2) <+ gap 2) <+ e2) <+ gap 4) <+ e2 ^ 3) r):= by + unfold qr e2 e3 e4 gap q5 qg + execute +theorem init_to_seed : (init []) [holdout_0641_tm]⊢* seed:= by + refine zSt init_phase1 ?_ + rcases qY 12 _ _ hc_p1 with ⟨l_p2,hc_p2,hbatch1⟩ + refine zSt hbatch1 ?_ + have hscan1:=qaS hc_p2 rfl default + rw [zZcd] at hscan1 + refine zSt hscan1 ?_ + rw [qm] + change ((default : ListBlank (Fin 2)) {{B}}> + ((0 : Fin 2) >> (q5 +> (q5 +> (q5 +> (qg +> ((([0,1] : List (Fin 2)) ^ 12) +> default))))))) + [holdout_0641_tm]⊢* seed + refine zSt init_phase2 ?_ + rcases qY 96 _ _ hc_p3 with ⟨l_p4,hc_p4,hbatch2⟩ + refine zSt hbatch2 ?_ + have hscan2:=qaS hc_p4 rfl default + rw [zZcd] at hscan2 + refine zSt hscan2 ?_ + rw [qm] + change ((default : ListBlank (Fin 2)) {{B}}> + ((0 : Fin 2) >> (q5 +> (q5 +> (q5 +> ((([0,1] : List (Fin 2)) ^ 3) +> + (qg +> (qg +> (q5 +> (q5 +> (q5 +> ((([0,1] : List (Fin 2)) ^ 96) +> default)))))))))))) + [holdout_0641_tm]⊢* seed + refine zSt (init_phase3a _) ?_ + refine zSt (init_phase3b _) ?_ + exact tail0 (((((((default : ListBlank (Fin 2)) <+ e4 ^ 2) <+ e2) <+ gap 2) <+ e2) <+ gap 4) <+ e2 ^ 3) 32 +def CycleInv (xs : List Block) (s : Nat) (l : ListBlank (Fin 2)) : Prop := + Counter (.Even :: ((qb xs).reverse ++ qc)) s l /\ + 12 <= s /\ + qI (qb xs ++ [.Even]) +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep holdout_0641_tm c (j + d)=some c') : + (multiStep holdout_0641_tm c j).isSome:= by + rw [zMa] at h + cases h_j : multiStep holdout_0641_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +theorem qaV (m : Nat) : + ∃ N ≥ m,∃ xs s l,multiStep holdout_0641_tm (init []) N=some (qd l) /\ CycleInv xs s l:= by + induction m with + | zero => + rcases init_to_seed with ⟨k0,hk0⟩ + rcases seed_counter with ⟨s0,hc0,hs0⟩ + exact ⟨k0,Nat.zero_le _,qS,s0,qaR,hk0,hc0,hs0,qbe⟩ + | succ m ih => + rcases ih with ⟨N,hN,xs,s,l,h_ms,hc,hs,hl⟩ + rcases cycle xs s l hc hs hl with ⟨xs',s',l',hc',hs',hl',k,hk_pos,h_step⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,xs',s',l', + zMt holdout_0641_tm _ _ _ N k h_ms h_step,hc',hs',hl'⟩ +theorem holdout_0641_nonhalt : + IsDoesNotHalt holdout_0641_tm:= by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases qaV (n + 1) with ⟨N,hN,_,_,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1))=N:=Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some:=zIm h_N + rw [zMs,hn] at h_some + exact h_some + + + +theorem is_does_not_halt : IsNotHalt target_tm := holdout_0641_nonhalt + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1RC_1LC0RA_1RA0LD_0RE0LF_0LBHHH_0RF0RE diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RC_1LC0RF_1RE0LD_1LB0LD_HHH1RF_0LF0RA.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RC_1LC0RF_1RE0LD_1LB0LD_HHH1RF_0LF0RA.lean new file mode 100644 index 00000000..b6b3808a --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RC_1LC0RF_1RE0LD_1LB0LD_HHH1RF_0LF0RA.lean @@ -0,0 +1,3437 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1RC_1LC0RF_1RE0LD_1LB0LD_HHH1RF_0LF0RA + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RC_1LC0RF_1RE0LD_1LB0LD_HHH1RF_0LF0RA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +def target_tm : Machine (Fin 2) (Fin 6) + | 0, 0 => some (some 1, Stmt.write 1 Dir.right) + | 0, 1 => some (some 2, Stmt.write 1 Dir.right) + | 1, 0 => some (some 2, Stmt.write 1 Dir.left) + | 1, 1 => some (some 5, Stmt.write 0 Dir.right) + | 2, 0 => some (some 4, Stmt.write 1 Dir.right) + | 2, 1 => some (some 3, Stmt.write 0 Dir.left) + | 3, 0 => some (some 1, Stmt.write 1 Dir.left) + | 3, 1 => some (some 3, Stmt.write 0 Dir.left) + | 4, 0 => none + | 4, 1 => some (some 5, Stmt.write 1 Dir.right) + | 5, 0 => some (some 5, Stmt.write 0 Dir.left) + | 5, 1 => some (some 0, Stmt.write 0 Dir.right) + +theorem target_eq : target = target_tm := by + funext q s + fin_cases q <;> fin_cases s <;> rfl +set_option Elab.async false +set_option maxRecDepth 200000 +set_option maxHeartbeats 4000000 + +namespace M23 +open List + +inductive St | A | B | C | D | E | F | H + deriving DecidableEq, Repr + +structure Cfg where + st : St + L : List Bool + h : Bool + R : List Bool + deriving DecidableEq, Repr + +def mR (s : St) (w : Bool) (c : Cfg) : Cfg := ⟨s, w :: c.L, c.R.headD false, c.R.tail⟩ +def mL (s : St) (w : Bool) (c : Cfg) : Cfg := ⟨s, c.L.tail, c.L.headD false, w :: c.R⟩ + +def step (c : Cfg) : Cfg := + match c.st, c.h with + | .A, false => mR .B true c + | .A, true => mR .C true c + | .B, false => mL .C true c + | .B, true => mR .F false c + | .C, false => mR .E true c + | .C, true => mL .D false c + | .D, false => mL .B true c + | .D, true => mL .D false c + | .E, false => { c with st := .H } + | .E, true => mR .F true c + | .F, false => mL .F false c + | .F, true => mR .A false c + | .H, _ => c + +def run : Nat → Cfg → Cfg + | 0, c => c + | n + 1, c => run n (step c) + +theorem run_add (m n : Nat) (c : Cfg) : run (m + n) c = run n (run m c) := by + induction m generalizing c with + | zero => simp [run] + | succ m ih => + rw [Nat.succ_add] + simp only [run] + exact ih (step c) + +def pw : Nat → List Bool → List Bool + | 0, _ => [] + | k + 1, u => u ++ pw k u + +@[simp] theorem pw_zero (u : List Bool) : pw 0 u = [] := rfl +@[simp] theorem pw_succ (k : Nat) (u : List Bool) : pw (k + 1) u = u ++ pw k u := rfl + +theorem pw_comm (k : Nat) (u : List Bool) : u ++ pw k u = pw k u ++ u := by + induction k with + | zero => simp + | succ k ih => rw [pw_succ, List.append_assoc, ← ih] + +theorem pw_succ' (k : Nat) (u : List Bool) : pw (k + 1) u = pw k u ++ u := by + rw [pw_succ, pw_comm] + +theorem pw_add (a b : Nat) (u : List Bool) : pw (a + b) u = pw a u ++ pw b u := by + induction a with + | zero => simp + | succ a ih => rw [Nat.succ_add, pw_succ, pw_succ, ih, List.append_assoc] + +abbrev U : List Bool := [true, true, false] + +def ckpt (n : Nat) (W : List Bool) : Cfg := ⟨.C, [], false, pw n U ++ W⟩ + +def mvDir : St → Bool → Option Bool + | .A, _ => some true + | .B, false => some false + | .B, true => some true + | .C, false => some true + | .C, true => some false + | .D, _ => some false + | .E, false => none + | .E, true => some true + | .F, false => some false + | .F, true => some true + | .H, _ => none + +def stepB (c : Cfg) : Option Cfg := + match mvDir c.st c.h with + | some true => if c.R.isEmpty then none else some (step c) + | some false => if c.L.isEmpty then none else some (step c) + | none => some (step c) + +def runB : Nat → Cfg → Option Cfg + | 0, c => some c + | n + 1, c => (stepB c).bind (runB n) + +theorem runB_add (m n : Nat) : ∀ {c c1 c2 : Cfg}, + runB m c = some c1 → runB n c1 = some c2 → runB (m + n) c = some c2 := by + induction m with + | zero => + intro c c1 c2 h1 h2 + simp only [runB, Option.some.injEq] at h1 + subst h1 + simpa using h2 + | succ m ih => + intro c c1 c2 h1 h2 + simp only [runB, Option.bind_eq_some_iff] at h1 + obtain ⟨c', hc', hm⟩ := h1 + rw [Nat.succ_add] + simp only [runB, hc', Option.bind_some] + exact ih hm h2 + +def ext (c : Cfg) (Lt Rt : List Bool) : Cfg := ⟨c.st, c.L ++ Lt, c.h, c.R ++ Rt⟩ + +theorem stepB_frame {c c' : Cfg} (Lt Rt : List Bool) (h : stepB c = some c') : + step (ext c Lt Rt) = ext c' Lt Rt := by + obtain ⟨s, L, x, R⟩ := c + cases s <;> cases x <;> simp only [stepB, mvDir] at h <;> + first + | (cases R with + | nil => simp at h + | cons r rs => simp at h; subst h; simp [ext, step, mR]) + | (cases L with + | nil => simp at h + | cons l ls => simp at h; subst h; simp [ext, step, mL]) + | (simp at h; subst h; simp [ext, step]) + +theorem runB_frame (n : Nat) (Lt Rt : List Bool) : + ∀ {c c' : Cfg}, runB n c = some c' → run n (ext c Lt Rt) = ext c' Lt Rt := by + induction n with + | zero => intro c c' h; simp [runB] at h; subst h; rfl + | succ n ih => + intro c c' h + simp only [runB, Option.bind_eq_some_iff] at h + obtain ⟨c1, h1, h2⟩ := h + show run n (step (ext c Lt Rt)) = _ + rw [stepB_frame Lt Rt h1] + exact ih h2 + +abbrev X : List Bool := [false, false, true] +abbrev Y : List Bool := [true, false, false] +abbrev Z : List Bool := [true, false, true] + +theorem rot (x : Bool) (l : List Bool) (k : Nat) (T : List Bool) : + x :: (pw k (l ++ [x]) ++ T) = pw k (x :: l) ++ x :: T := by + induction k with + | zero => simp + | succ k ih => simp [ih] + +theorem rotX (k : Nat) (T : List Bool) : true :: (pw k X ++ T) = pw k Y ++ true :: T := + rot true [false, false] k T + +theorem rotZ (k : Nat) (T : List Bool) : true :: (pw k Z ++ T) = pw k U ++ true :: T := + rot true [true, false] k T + +theorem splitZ (k : Nat) (T : List Bool) : + pw (k + 1) Z ++ T = true :: false :: (pw k U ++ true :: T) := by + rw [pw_succ, ← rotZ]; simp + +theorem rsweep (k : Nat) (L R : List Bool) : + run (3 * k) ⟨.A, L, false, pw k U ++ R⟩ = ⟨.A, pw k X ++ L, false, R⟩ := by + induction k generalizing L with + | zero => rfl + | succ k ih => + rw [show 3 * (k + 1) = 3 + 3 * k by omega, run_add] + have h3 : run 3 ⟨.A, L, false, pw (k + 1) U ++ R⟩ = ⟨.A, X ++ L, false, pw k U ++ R⟩ := by + simp [run, step, mR] + rw [h3, ih, pw_succ', append_assoc] + +theorem lsweep (k : Nat) (L R : List Bool) : + run (3 * k) ⟨.B, pw k Y ++ L, false, R⟩ = ⟨.B, L, false, pw k Z ++ R⟩ := by + induction k generalizing R with + | zero => rfl + | succ k ih => + rw [show 3 * (k + 1) = 3 + 3 * k by omega, run_add] + have h3 : run 3 ⟨.B, pw (k + 1) Y ++ L, false, R⟩ = ⟨.B, pw k Y ++ L, false, Z ++ R⟩ := by + simp [run, step, mL] + rw [h3, ih, pw_succ', append_assoc] + +theorem start (R : List Bool) : + run 3 ⟨.C, [], false, U ++ R⟩ = ⟨.A, [false, true, true], false, R⟩ := by + simp [run, step, mR] + +theorem bounce1 (L W' : List Bool) : + run 4 ⟨.A, X ++ L, false, false :: W'⟩ = ⟨.B, true :: L, false, Z ++ W'⟩ := by + simp [run, step, mR, mL] + +theorem leftEnd1 (R : List Bool) : + run 5 ⟨.B, [true, false, true, true], false, true :: false :: R⟩ + = ⟨.A, [false, false, true], false, U ++ R⟩ := by + simp [run, step, mR, mL] + +theorem leftEnd2 (R : List Bool) : + run 4 ⟨.B, [true], false, R⟩ = ⟨.C, [], false, U ++ true :: R⟩ := by + simp [run, step, mR, mL] + +def wordHyp (W' : List Bool) (a J J' : Nat) (V : List Bool) : Prop := + runB a ⟨.A, pw J X, false, true :: W'⟩ = some ⟨.B, true :: pw J' X, false, V⟩ + +def evSteps (k a m : Nat) : Nat := 3 + 3 * (k + 1) + 4 + 3 * k + 5 + 3 * (k + 1) + a + 3 * m + 4 + +theorem event (k J J' a : Nat) (W' V : List Bool) (hJ : J ≤ k + 2) + (hw : wordHyp W' a J J' V) : + run (evSteps k a (J' + (k + 2 - J))) (ckpt (k + 2) (false :: W')) + = ckpt (J' + (k + 2 - J) + 1) (true :: V) := by + have e1 : run 3 (ckpt (k + 2) (false :: W')) + = ⟨.A, [false, true, true], false, pw (k + 1) U ++ false :: W'⟩ := by + rw [ckpt, pw_succ, append_assoc, start] + have e2 := rsweep (k + 1) [false, true, true] (false :: W') + have e3 : run 4 ⟨.A, pw (k + 1) X ++ [false, true, true], false, false :: W'⟩ + = ⟨.B, pw k Y ++ [true, false, true, true], false, Z ++ W'⟩ := by + rw [pw_succ, append_assoc, bounce1, rotX] + have e4 := lsweep k [true, false, true, true] (Z ++ W') + have e5 : run 5 ⟨.B, [true, false, true, true], false, pw k Z ++ (Z ++ W')⟩ + = ⟨.A, [false, false, true], false, pw (k + 1) U ++ true :: W'⟩ := by + rw [← append_assoc, ← pw_succ', splitZ, leftEnd1, pw_succ, append_assoc] + have e6 := rsweep (k + 1) [false, false, true] (true :: W') + have e7 : run a ⟨.A, pw (k + 1) X ++ [false, false, true], false, true :: W'⟩ + = ⟨.B, pw (J' + (k + 2 - J)) Y ++ [true], false, V⟩ := by + have hsplit : pw (k + 1) X ++ [false, false, true] = pw J X ++ pw (k + 2 - J) X := by + rw [← pw_succ', ← pw_add]; congr 1; omega + have hf := runB_frame a (pw (k + 2 - J) X) [] hw + simp only [ext, append_nil] at hf + rw [hsplit, hf, ← rotX, pw_add, append_nil, cons_append] + have e8 := lsweep (J' + (k + 2 - J)) [true] V + have e9 : run 4 ⟨.B, [true], false, pw (J' + (k + 2 - J)) Z ++ V⟩ + = ckpt (J' + (k + 2 - J) + 1) (true :: V) := by + rw [leftEnd2, rotZ, ckpt, pw_succ, append_assoc] + simp only [evSteps, run_add] + rw [e1, e2, e3, e4, e5, e6, e7, e8, e9] + +def isRetFast : List Bool → Option Nat + | [true] => some 0 + | [true, false, false, true, false, false, true] => some 2 + | _ => none + +theorem isRetFast_sound {L : List Bool} {j : Nat} (h : isRetFast L = some j) : + L = true :: pw j X := by + unfold isRetFast at h + split at h + · simp only [Option.some.injEq] at h; subst h; rfl + · simp only [Option.some.injEq] at h; subst h; rfl + · cases h + +def stepB1 (c : Cfg) : Option Cfg := + match c.st, c.h with + | .A, false => match c.R with | r :: rs => some ⟨.B, true :: c.L, r, rs⟩ | [] => none + | .A, true => match c.R with | r :: rs => some ⟨.C, true :: c.L, r, rs⟩ | [] => none + | .B, false => match c.L with | l :: ls => some ⟨.C, ls, l, true :: c.R⟩ | [] => none + | .B, true => match c.R with | r :: rs => some ⟨.F, false :: c.L, r, rs⟩ | [] => none + | .C, false => match c.R with | r :: rs => some ⟨.E, true :: c.L, r, rs⟩ | [] => none + | .C, true => match c.L with | l :: ls => some ⟨.D, ls, l, false :: c.R⟩ | [] => none + | .D, false => match c.L with | l :: ls => some ⟨.B, ls, l, true :: c.R⟩ | [] => none + | .D, true => match c.L with | l :: ls => some ⟨.D, ls, l, false :: c.R⟩ | [] => none + | .E, false => some ⟨.H, c.L, false, c.R⟩ + | .E, true => match c.R with | r :: rs => some ⟨.F, true :: c.L, r, rs⟩ | [] => none + | .F, false => match c.L with | l :: ls => some ⟨.F, ls, l, false :: c.R⟩ | [] => none + | .F, true => match c.R with | r :: rs => some ⟨.A, false :: c.L, r, rs⟩ | [] => none + | .H, h => some ⟨.H, c.L, h, c.R⟩ + +theorem stepB1_eq (c : Cfg) : stepB1 c = stepB c := by + obtain ⟨st, L, h, R⟩ := c + cases st <;> cases h <;> first + | (cases R <;> rfl) + | (cases L <;> rfl) + | rfl + +def stepFastA (L R : List Bool) : Option Cfg := + match R with + | true :: true :: false :: true :: true :: false :: R' => + some ⟨.A, false :: false :: true :: false :: false :: true :: L, false, R'⟩ + | true :: true :: false :: R' => + some ⟨.A, false :: false :: true :: L, false, R'⟩ + | true :: true :: true :: false :: R' => + some ⟨.C, true :: false :: false :: true :: L, false, R'⟩ + | false :: R' => + some ⟨.B, true :: L, false, R'⟩ + | _ => stepB1 ⟨.A, L, false, R⟩ + +theorem stepFastA_sound (L R : List Bool) {c' : Cfg} (h : stepFastA L R = some c') : + ∃ k, runB k ⟨.A, L, false, R⟩ = some c' := by + unfold stepFastA at h + split at h + · simp only [Option.some.injEq] at h; subst h; exact ⟨6, rfl⟩ + · simp only [Option.some.injEq] at h; subst h; exact ⟨3, rfl⟩ + · simp only [Option.some.injEq] at h; subst h; exact ⟨4, rfl⟩ + · simp only [Option.some.injEq] at h; subst h; exact ⟨1, rfl⟩ + · rw [stepB1_eq] at h; exact ⟨1, by simp [runB, h]⟩ + +def stepFastC (L R : List Bool) : Option Cfg := + match R with + | true :: true :: false :: true :: true :: false :: R' => + some ⟨.A, false :: false :: true :: false :: true :: true :: L, false, R'⟩ + | true :: true :: false :: R' => + some ⟨.A, false :: true :: true :: L, false, R'⟩ + | true :: true :: true :: false :: R' => + some ⟨.C, true :: false :: true :: true :: L, false, R'⟩ + | true :: false :: false :: R' => + some ⟨.B, true :: false :: true :: L, false, R'⟩ + | _ => stepB1 ⟨.C, L, false, R⟩ + +theorem stepFastC_sound (L R : List Bool) {c' : Cfg} (h : stepFastC L R = some c') : + ∃ k, runB k ⟨.C, L, false, R⟩ = some c' := by + unfold stepFastC at h + split at h + · simp only [Option.some.injEq] at h; subst h; exact ⟨6, rfl⟩ + · simp only [Option.some.injEq] at h; subst h; exact ⟨3, rfl⟩ + · simp only [Option.some.injEq] at h; subst h; exact ⟨4, rfl⟩ + · simp only [Option.some.injEq] at h; subst h; exact ⟨5, rfl⟩ + · rw [stepB1_eq] at h; exact ⟨1, by simp [runB, h]⟩ + +def stepFastB (L R : List Bool) : Option Cfg := + match L with + | true :: false :: false :: true :: false :: false :: L' => + some ⟨.B, L', false, true :: false :: true :: true :: false :: true :: R⟩ + | true :: false :: false :: L' => + some ⟨.B, L', false, true :: false :: true :: R⟩ + | true :: true :: false :: false :: L' => + some ⟨.B, L', false, true :: false :: false :: true :: R⟩ + | true :: true :: true :: false :: false :: L' => + some ⟨.B, L', false, true :: false :: false :: false :: true :: R⟩ + | _ => stepB1 ⟨.B, L, false, R⟩ + +theorem stepFastB_sound (L R : List Bool) {c' : Cfg} (h : stepFastB L R = some c') : + ∃ k, runB k ⟨.B, L, false, R⟩ = some c' := by + unfold stepFastB at h + split at h + · simp only [Option.some.injEq] at h; subst h; exact ⟨6, rfl⟩ + · simp only [Option.some.injEq] at h; subst h; exact ⟨3, rfl⟩ + · simp only [Option.some.injEq] at h; subst h; exact ⟨4, rfl⟩ + · simp only [Option.some.injEq] at h; subst h; exact ⟨5, rfl⟩ + · rw [stepB1_eq] at h; exact ⟨1, by simp [runB, h]⟩ + +def stepFast (c : Cfg) : Option Cfg := + match c.st, c.h with + | .A, false => stepFastA c.L c.R + | .C, false => stepFastC c.L c.R + | .B, false => stepFastB c.L c.R + | _, _ => stepB1 c + +theorem stepFast_sound (c : Cfg) {c' : Cfg} (h : stepFast c = some c') : + ∃ k, runB k c = some c' := by + obtain ⟨st, L, x, R⟩ := c + cases st <;> cases x <;> simp only [stepFast] at h + · exact stepFastA_sound L R h + · rw [stepB1_eq] at h; exact ⟨1, by simp [runB, h]⟩ + · exact stepFastB_sound L R h + · rw [stepB1_eq] at h; exact ⟨1, by simp [runB, h]⟩ + · exact stepFastC_sound L R h + all_goals (rw [stepB1_eq] at h; exact ⟨1, by simp [runB, h]⟩) + +def seekFast : Nat → Cfg → Option (Nat × List Bool) + | 0, _ => none + | f + 1, c => + match c.st, c.h, isRetFast c.L with + | .B, false, some j => some (j, c.R) + | _, _, _ => + match stepFast c with + | some c' => seekFast f c' + | none => none + +theorem seekFast_sound (f : Nat) : ∀ {c : Cfg} {j : Nat} {V : List Bool}, + seekFast f c = some (j, V) → ∃ a, runB a c = some ⟨.B, true :: pw j X, false, V⟩ := by + induction f with + | zero => intro c j V h; simp [seekFast] at h + | succ f ih => + intro c j V h + obtain ⟨s, L, x, R⟩ := c + simp only [seekFast] at h + split at h + · rename_i jj hj + simp only [Option.some.injEq, Prod.mk.injEq] at h + obtain ⟨rfl, rfl⟩ := h + rw [isRetFast_sound hj] + try exact ⟨0, rfl⟩ + · split at h + · rename_i c' hc' + obtain ⟨k, hk⟩ := stepFast_sound _ hc' + obtain ⟨a, ha⟩ := ih h + exact ⟨k + a, runB_add k a hk ha⟩ + · cases h + +def win (W' : List Bool) : Cfg := ⟨.A, pw 2 X, false, true :: W'⟩ + +def wordMapFast (fuel : Nat) (W' : List Bool) : Option (Nat × List Bool) := + seekFast fuel (win W') + +theorem event_map_fast (k fuel J' : Nat) (W' V : List Bool) + (h : wordMapFast fuel W' = some (J', V)) : + ∃ a, run (evSteps k a (J' + k)) (ckpt (k + 2) (false :: W')) = ckpt (J' + k + 1) (true :: V) := by + obtain ⟨a, ha⟩ := seekFast_sound fuel h + refine ⟨a, ?_⟩ + have := event k 2 J' a W' V (by omega) ha + simpa using this + + +theorem stepB_ext {c c' : Cfg} (Lt Rt : List Bool) (h : stepB c = some c') : + stepB (ext c Lt Rt) = some (ext c' Lt Rt) := by + obtain ⟨s, L, x, R⟩ := c + cases s <;> cases x <;> simp only [stepB, mvDir, ext] at h ⊢ <;> + first + | (cases R with + | nil => simp at h + | cons r rs => simp at h; subst h; simp [step, mR]) + | (cases L with + | nil => simp at h + | cons l ls => simp at h; subst h; simp [step, mL]) + | (simp at h; subst h; simp [step]) + +theorem runB_ext (n : Nat) (Lt Rt : List Bool) : + ∀ {c c' : Cfg}, runB n c = some c' → runB n (ext c Lt Rt) = some (ext c' Lt Rt) := by + induction n with + | zero => intro c c' h; simp [runB] at h ⊢; subst h; rfl + | succ n ih => + intro c c' h + simp only [runB, Option.bind_eq_some_iff] at h ⊢ + obtain ⟨c1, h1, h2⟩ := h + exact ⟨ext c1 Lt Rt, stepB_ext Lt Rt h1, ih h2⟩ + +def seekToC : Nat → Cfg → Option (List Bool) + | 0, _ => none + | f + 1, c => + match c.st, c.h, c.R with + | .C, false, [] => some c.L + | _, _, _ => + match stepFast c with + | some c' => seekToC f c' + | none => none + +theorem seekToC_sound (f : Nat) : ∀ {c : Cfg} {L_P : List Bool}, + seekToC f c = some L_P → ∃ a, runB a c = some ⟨.C, L_P, false, []⟩ := by + induction f with + | zero => intro c L_P h; simp [seekToC] at h + | succ f ih => + intro c L_P h + obtain ⟨s, L, x, R⟩ := c + simp only [seekToC] at h + split at h + · simp only [Option.some.injEq] at h; subst h; try exact ⟨0, rfl⟩ + · split at h + · rename_i c' hc' + obtain ⟨k, hk⟩ := stepFast_sound _ hc' + obtain ⟨a, ha⟩ := ih h + exact ⟨k + a, runB_add k a hk ha⟩ + · cases h + +def seekToB0 : Nat → Cfg → Option (List Bool) + | 0, _ => none + | f + 1, c => + match c.st, c.h, c.L with + | .B, false, [true] => some c.R + | _, _, _ => + match stepFast c with + | some c' => seekToB0 f c' + | none => none + +theorem seekToB0_sound (f : Nat) : ∀ {c : Cfg} {V : List Bool}, + seekToB0 f c = some V → ∃ a, runB a c = some ⟨.B, [true], false, V⟩ := by + induction f with + | zero => intro c V h; simp [seekToB0] at h + | succ f ih => + intro c V h + obtain ⟨s, L, x, R⟩ := c + simp only [seekToB0] at h + split at h + · simp only [Option.some.injEq] at h; subst h; try exact ⟨0, rfl⟩ + · split at h + · rename_i c' hc' + obtain ⟨k, hk⟩ := stepFast_sound _ hc' + obtain ⟨a, ha⟩ := ih h + exact ⟨k + a, runB_add k a hk ha⟩ + · cases h + +def ValidCPrefix (P : List Bool) : Prop := + ∃ a1 a3 L_P R_back, + runB a1 ⟨.A, [], false, true :: P⟩ = some ⟨.C, L_P, false, []⟩ ∧ + runB a3 ⟨.B, true :: L_P, false, []⟩ = some ⟨.B, [true], false, R_back⟩ ∧ + R_back ++ [true, false] = [true, false, false] ++ P + +theorem validCPrefix_base : ValidCPrefix [true, true, false] := + ⟨4, 4, [true, false, false, true], [true, false, false, true], rfl, rfl, rfl⟩ + +def ValidCSeg (B : List Bool) : Prop := + ∃ b1 b3 L_B R_B, + runB b1 ⟨.C, [], false, B⟩ = some ⟨.C, L_B, false, []⟩ ∧ + runB b3 ⟨.B, true :: L_B, false, []⟩ = some ⟨.B, [true], false, R_B⟩ ∧ + R_B ++ [true, false] = [true, false] ++ B + +def checkCSeg (B : List Bool) : Bool := + match seekToC 400 ⟨.C, [], false, B⟩ with + | some L_B => + match seekToB0 400 ⟨.B, true :: L_B, false, []⟩ with + | some R_B => decide (R_B ++ [true, false] = [true, false] ++ B) + | none => false + | none => false + +theorem checkCSeg_sound {B : List Bool} (h : checkCSeg B = true) : ValidCSeg B := by + unfold checkCSeg at h + split at h + · rename_i L_B h1 + split at h + · rename_i R_B h2 + simp only [decide_eq_true_eq] at h + obtain ⟨b1, hb1⟩ := seekToC_sound 400 h1 + obtain ⟨b3, hb3⟩ := seekToB0_sound 400 h2 + exact ⟨b1, b3, L_B, R_B, hb1, hb3, h⟩ + · cases h + · cases h + +theorem validCPrefix_append {P B : List Bool} (hP : ValidCPrefix P) (hB : ValidCSeg B) : + ValidCPrefix (P ++ B) := by + obtain ⟨a1, a3, L_P, R_back, ha1, ha3, heqP⟩ := hP + obtain ⟨b1, b3, L_B, R_B, hb1, hb3, heqB⟩ := hB + refine ⟨a1 + b1, b3 + a3, L_B ++ L_P, R_back ++ R_B, ?_, ?_, ?_⟩ + · have e1 := runB_ext a1 [] B ha1 + simp only [ext, append_nil] at e1 + have e2 := runB_ext b1 L_P [] hb1 + simp only [ext, append_nil] at e2 + exact runB_add a1 b1 e1 e2 + · have e1 := runB_ext b3 L_P [] hb3 + simp only [ext, append_nil, cons_append] at e1 + have e2 := runB_ext a3 [] R_B ha3 + simp only [ext, append_nil] at e2 + exact runB_add b3 a3 e1 e2 + · rw [append_assoc, heqB, ← append_assoc, heqP, append_assoc] + +theorem wordHyp_prefix {P S S_raw : List Bool} {a2 : Nat} (hP : ValidCPrefix P) + (hS : runB a2 ⟨.C, [], false, S⟩ = some ⟨.B, [true], false, true :: false :: S_raw⟩) : + ∃ a V, wordHyp (P ++ S) a 2 2 V ∧ true :: V = U ++ (false :: P ++ S_raw) := by + obtain ⟨a1, a3, L_P, R_back, ha1, ha3, heqP⟩ := hP + refine ⟨(a1 + a2) + a3, R_back ++ (true :: false :: S_raw), ?_, ?_⟩ + · unfold wordHyp + have e1 := runB_ext a1 (pw 2 X) S ha1 + simp only [ext, nil_append] at e1 + have e2 := runB_ext a2 (L_P ++ pw 2 X) [] hS + simp only [ext, nil_append, append_nil, cons_append] at e2 + have e3 := runB_ext a3 (pw 2 X) (true :: false :: S_raw) ha3 + simp only [ext, nil_append, cons_append] at e3 + exact runB_add (a1 + a2) a3 (runB_add a1 a2 e1 e2) e3 + · have h1 : R_back ++ (true :: false :: S_raw) = (R_back ++ [true, false]) ++ S_raw := by simp + rw [h1, heqP] + simp [U] +end M23 + + +namespace Cert + +abbrev Machine := Nat → Bool → Option (Bool × Bool × Nat) + +structure Cfg where + q : Nat + L : List Bool + h : Bool + R : List Bool + deriving DecidableEq, Repr + +abbrev halted (M : Machine) (c : Cfg) : Prop := M c.q c.h = none + + +def step (M : Machine) (c : Cfg) : Cfg := + match M c.q c.h with + | none => c + | some (w, true, s) => ⟨s, w :: c.L, c.R.headD false, c.R.tail⟩ + | some (w, false, s) => ⟨s, c.L.tail, c.L.headD false, w :: c.R⟩ + +def run (M : Machine) : Nat → Cfg → Cfg + | 0, c => c + | n + 1, c => run M n (step M c) + +def blank (q : Nat) : Cfg := ⟨q, [], false, []⟩ + +theorem run_add (M : Machine) (m n : Nat) (c : Cfg) : + run M (m + n) c = run M n (run M m c) := by + induction m generalizing c with + | zero => simp [run] + | succ m ih => rw [Nat.succ_add]; simp only [run]; exact ih _ + +theorem step_of_halted {M : Machine} {c : Cfg} (h : halted M c) : step M c = c := by + unfold halted at h; simp [step, h] + +theorem run_of_halted {M : Machine} {c : Cfg} (h : halted M c) : ∀ n, run M n c = c := by + intro n; induction n with + | zero => rfl + | succ n ih => simp only [run, step_of_halted h, ih] + +theorem halted_mono {M : Machine} {c : Cfg} {n n' : Nat} (hn : n ≤ n') + (h : halted M (run M n c)) : halted M (run M n' c) := by + obtain ⟨d, rfl⟩ := Nat.exists_eq_add_of_le hn + rw [run_add, run_of_halted h]; exact h + +def strip : List Bool → List Bool + | [] => [] + | true :: xs => true :: strip xs + | false :: xs => + match strip xs with + | [] => [] + | y :: ys => false :: y :: ys + +abbrev eqv (x y : List Bool) : Prop := strip x = strip y + +theorem strip_headD (x : List Bool) : (strip x).headD false = x.headD false := by + cases x with + | nil => rfl + | cons b xs => + cases b + · simp only [strip]; split <;> rfl + · rfl + +theorem strip_tail (x : List Bool) : (strip x).tail = strip x.tail := by + cases x with + | nil => rfl + | cons b xs => + cases b + · simp only [strip, List.tail_cons]; split + · rename_i h; simp [h] + · rename_i y ys h; simp [h] + · rfl + +theorem eqv_headD {x y : List Bool} (h : eqv x y) : x.headD false = y.headD false := by + rw [← strip_headD x, h, strip_headD] + +theorem eqv_tail {x y : List Bool} (h : eqv x y) : eqv x.tail y.tail := by + unfold eqv; rw [← strip_tail, ← strip_tail, h] + +theorem eqv_cons {x y : List Bool} (w : Bool) (h : eqv x y) : eqv (w :: x) (w :: y) := by + unfold eqv at *; cases w <;> simp only [strip, h] + +theorem strip_strip (x : List Bool) : strip (strip x) = strip x := by + induction x with + | nil => rfl + | cons b ys ih => + cases b + · dsimp only [strip] + cases h : strip ys with + | nil => rfl + | cons y ys' => + have ih' : strip (y :: ys') = y :: ys' := by rw [← h, ih] + simp only [strip, ih'] + · simp only [strip, ih] + +theorem strip_append (x y : List Bool) : strip (x ++ y) = strip (x ++ strip y) := by + induction x with + | nil => simp [strip_strip] + | cons b xs ih => cases b <;> simp only [List.cons_append, strip, ih] + +theorem strip_replicate (k : Nat) : strip (List.replicate k false) = [] := by + induction k with + | zero => rfl + | succ k ih => simp [List.replicate_succ, strip, ih] + +theorem eqv_pad (x : List Bool) (k : Nat) : eqv (x ++ List.replicate k false) x := by + unfold eqv; rw [strip_append, strip_replicate, List.append_nil] + +theorem eqv_append {x y y' : List Bool} (h : eqv y y') : eqv (x ++ y) (x ++ y') := by + unfold eqv at *; rw [strip_append, h, ← strip_append] + +theorem eqv_strip (x : List Bool) : eqv (strip x) x := strip_strip x + +abbrev eqvC (c d : Cfg) : Prop := c.q = d.q ∧ c.h = d.h ∧ eqv c.L d.L ∧ eqv c.R d.R + + +theorem eqvC_refl (c : Cfg) : eqvC c c := ⟨rfl, rfl, rfl, rfl⟩ + +theorem eqvC_trans {c d e : Cfg} (h1 : eqvC c d) (h2 : eqvC d e) : eqvC c e := by + obtain ⟨a1, b1, c1, d1⟩ := h1; obtain ⟨a2, b2, c2, d2⟩ := h2 + exact ⟨a1.trans a2, b1.trans b2, Eq.trans c1 c2, Eq.trans d1 d2⟩ + +theorem step_eqvC (M : Machine) {c d : Cfg} (h : eqvC c d) : eqvC (step M c) (step M d) := by + obtain ⟨q, L, x, R⟩ := c + obtain ⟨q', L', x', R'⟩ := d + obtain ⟨hq, hh, hL, hR⟩ := h + simp only at hq hh; subst hq; subst hh + unfold step + cases M q x with + | none => exact ⟨rfl, rfl, hL, hR⟩ + | some t => + obtain ⟨w, d, s⟩ := t + cases d + · exact ⟨rfl, eqv_headD hL, eqv_tail hL, eqv_cons _ hR⟩ + · exact ⟨rfl, eqv_headD hR, eqv_cons _ hL, eqv_tail hR⟩ + +theorem run_eqvC (M : Machine) (n : Nat) : ∀ {c d : Cfg}, eqvC c d → eqvC (run M n c) (run M n d) := by + induction n with + | zero => intro c d h; exact h + | succ n ih => intro c d h; exact ih (step_eqvC M h) + +def M : Machine + | 0, false => some (true, true, 1) + | 0, true => some (true, true, 2) + | 1, false => some (true, false, 2) + | 1, true => some (false, true, 5) + | 2, false => some (true, true, 4) + | 2, true => some (false, false, 3) + | 3, false => some (true, false, 1) + | 3, true => some (false, false, 3) + | 4, false => none + | 4, true => some (true, true, 5) + | 5, false => some (false, false, 5) + | 5, true => some (false, true, 0) + | _, _ => none + +def stIdx : M23.St → Nat + | .A => 0 | .B => 1 | .C => 2 | .D => 3 | .E => 4 | .F => 5 | .H => 4 + +def fC (c : M23.Cfg) : Cfg := ⟨stIdx c.st, c.L, c.h, c.R⟩ + +def goodC (c : M23.Cfg) : Prop := c.st = .H → c.h = false + +theorem step_f (c : M23.Cfg) (hg : goodC c) : + fC (M23.step c) = step M (fC c) ∧ goodC (M23.step c) := by + obtain ⟨s, L, x, R⟩ := c + unfold goodC at * + cases s <;> cases x <;> simp_all [M23.step, M23.mR, M23.mL, step, M, fC, stIdx] + +theorem run_f (n : Nat) : ∀ (c : M23.Cfg), goodC c → fC (M23.run n c) = run M n (fC c) := by + induction n with + | zero => intro c _; rfl + | succ n ih => + intro c hg + obtain ⟨h1, h2⟩ := step_f c hg + simp only [M23.run, run]; rw [ih _ h2, h1] + +def ck (n : Nat) (W : List Bool) : Cfg := ⟨2, [], false, M23.pw n M23.U ++ W⟩ + +theorem ck_f (n : Nat) (W : List Bool) : fC (M23.ckpt n W) = ck n W := rfl + +def units : List Bool → Nat × List Bool + | true :: true :: false :: r => + match units r with + | (u, rest) => (u + 1, rest) + | l => (0, l) + +theorem units_spec (l : List Bool) : M23.pw (units l).1 M23.U ++ (units l).2 = l := by + induction l using units.induct with + | case1 r u rest h_eq ih => + unfold units + rw [h_eq] + simp only [M23.pw_succ, List.append_assoc] + have h1 : (units r).1 = u := by rw [h_eq] + have h2 : (units r).2 = rest := by rw [h_eq] + rw [← h1, ← h2, ih] + rfl + | case2 l h => + unfold units; split + · rename_i r; exact absurd rfl (h r) + · rfl + +def PAD : Nat := 12 + +def evStep (p : Nat × List Bool) : Option (Nat × List Bool) := + match p.2 with + | false :: W' => + if 2 ≤ p.1 then + match M23.wordMapFast 450 (W' ++ List.replicate PAD false) with + | some (J', V) => some (J' + (p.1 - 2) + 1 + (units (true :: V)).1, + strip (units (true :: V)).2) + | none => none + else none + | _ => none + +theorem evStep_sound {p p' : Nat × List Bool} (h : evStep p = some p') : + ∃ m, eqvC (run M m (ck p.1 p.2)) (ck p'.1 p'.2) := by + obtain ⟨n, W⟩ := p + rcases W with _ | ⟨b, W'⟩ + · simp [evStep] at h + cases b + case true => simp [evStep] at h + by_cases hn : 2 ≤ n + case neg => simp [evStep, hn] at h + cases hw : M23.wordMapFast 450 (W' ++ List.replicate PAD false) with + | none => simp [evStep, hn, hw] at h + | some r => + obtain ⟨J', V⟩ := r + simp only [evStep, hn, if_true, hw, Option.some.injEq] at h + subst h + obtain ⟨k, rfl⟩ : ∃ k, n = k + 2 := ⟨n - 2, by omega⟩ + obtain ⟨a, ev⟩ := M23.event_map_fast k 450 J' (W' ++ List.replicate PAD false) V hw + have hr := run_f (M23.evSteps k a (J' + k)) (M23.ckpt (k + 2) (false :: (W' ++ List.replicate PAD false))) (by unfold goodC M23.ckpt; intro h; cases h) + rw [ev, ck_f, ck_f] at hr + refine ⟨M23.evSteps k a (J' + k), ?_⟩ + have e1 : eqvC (ck (k + 2) (false :: W')) + (ck (k + 2) (false :: (W' ++ List.replicate PAD false))) := by + refine ⟨rfl, rfl, rfl, ?_⟩ + show eqv _ _ + apply eqv_append + show strip _ = strip _ + rw [← List.cons_append]; exact (eqv_pad _ _).symm + have e2 := run_eqvC M (M23.evSteps k a (J' + k)) e1 + rw [← hr] at e2 + refine eqvC_trans e2 ⟨rfl, rfl, rfl, ?_⟩ + show eqv _ _ + have hu := units_spec (true :: V) + simp only [ck] + rw [show k + 2 - 2 = k by omega] + have e3 : M23.pw (J' + k + 1) M23.U ++ (true :: V) + = M23.pw (J' + k + 1 + (units (true :: V)).1) M23.U ++ (units (true :: V)).2 := by + rw [M23.pw_add (J' + k + 1), List.append_assoc, hu] + rw [e3] + exact eqv_append (eqv_strip _).symm + +inductive NatTree where + | leaf (v : Nat) + | node (sz : Nat) (l r : NatTree) + +inductive ListTree where + | leaf (dir : Nat) (data : Nat) + | node (sz : Nat) (l r : ListTree) + +def unpackListAcc : Nat → Nat → List Nat → List Nat + | 0, _, acc => acc + | len + 1, v, acc => unpackListAcc len (v >>> 12) ((v &&& 4095) :: acc) + +def NatTree.get0 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 16)) &&& 65535 + | .node _ _ _ => 0 +def NatTree.get1 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 16)) &&& 65535 + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get0 l i + | false => NatTree.get0 r (i - sz) +def NatTree.get2 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 16)) &&& 65535 + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get1 l i + | false => NatTree.get1 r (i - sz) +def NatTree.get3 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 16)) &&& 65535 + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get2 l i + | false => NatTree.get2 r (i - sz) +def NatTree.get4 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 16)) &&& 65535 + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get3 l i + | false => NatTree.get3 r (i - sz) +def NatTree.getRow0 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 224)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node _ _ _ => 0 +def NatTree.getRow1 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 224)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRow0 l i + | false => NatTree.getRow0 r (i - sz) +def NatTree.getRow2 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 224)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRow1 l i + | false => NatTree.getRow1 r (i - sz) +def NatTree.getRow3 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 224)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRow2 l i + | false => NatTree.getRow2 r (i - sz) +def NatTree.getRow4 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 224)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRow3 l i + | false => NatTree.getRow3 r (i - sz) +def NatTree.getRow5 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 224)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRow4 l i + | false => NatTree.getRow4 r (i - sz) +def NatTree.getRow6 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 224)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRow5 l i + | false => NatTree.getRow5 r (i - sz) +def NatTree.getRow7 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 224)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRow6 l i + | false => NatTree.getRow6 r (i - sz) +def NatTree.get96_0 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 96)) &&& 0xffffffffffffffffffffffff + | .node _ _ _ => 0 +def NatTree.get96_1 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 96)) &&& 0xffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get96_0 l i + | false => NatTree.get96_0 r (i - sz) +def NatTree.get96_2 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 96)) &&& 0xffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get96_1 l i + | false => NatTree.get96_1 r (i - sz) +def NatTree.get96_3 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 96)) &&& 0xffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get96_2 l i + | false => NatTree.get96_2 r (i - sz) +def NatTree.get96_4 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 96)) &&& 0xffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get96_3 l i + | false => NatTree.get96_3 r (i - sz) +def NatTree.get96_5 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 96)) &&& 0xffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get96_4 l i + | false => NatTree.get96_4 r (i - sz) +def NatTree.get96_6 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 96)) &&& 0xffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get96_5 l i + | false => NatTree.get96_5 r (i - sz) +def NatTree.get96_7 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 96)) &&& 0xffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.get96_6 l i + | false => NatTree.get96_6 r (i - sz) +def unpack0 (_ : Nat) (acc : List Nat) : List Nat := acc +def unpack1 (s : Nat) (acc : List Nat) : List Nat := + match s == 0 with + | true => acc + | false => unpack0 (s >>> 12) (((s &&& 4095) - 1) :: acc) +def unpack2 (s : Nat) (acc : List Nat) : List Nat := + match s == 0 with + | true => acc + | false => unpack1 (s >>> 12) (((s &&& 4095) - 1) :: acc) +def unpack3 (s : Nat) (acc : List Nat) : List Nat := + match s == 0 with + | true => acc + | false => unpack2 (s >>> 12) (((s &&& 4095) - 1) :: acc) +def unpack4 (s : Nat) (acc : List Nat) : List Nat := + match s == 0 with + | true => acc + | false => unpack3 (s >>> 12) (((s &&& 4095) - 1) :: acc) +def unpack5 (s : Nat) (acc : List Nat) : List Nat := + match s == 0 with + | true => acc + | false => unpack4 (s >>> 12) (((s &&& 4095) - 1) :: acc) +def unpack6 (s : Nat) (acc : List Nat) : List Nat := + match s == 0 with + | true => acc + | false => unpack5 (s >>> 12) (((s &&& 4095) - 1) :: acc) +def unpack7 (s : Nat) (acc : List Nat) : List Nat := + match s == 0 with + | true => acc + | false => unpack6 (s >>> 12) (((s &&& 4095) - 1) :: acc) +def NatTree.getRPre0 (t : NatTree) (i : Nat) : List Nat := + match t with + | .leaf v => unpack7 ((v >>> (i * 84)) &&& 0xFFFFFFFFFFFFFFFFFFFFF) [] + | .node _ _ _ => [] +def NatTree.getRPre1 (t : NatTree) (i : Nat) : List Nat := + match t with + | .leaf v => unpack7 ((v >>> (i * 84)) &&& 0xFFFFFFFFFFFFFFFFFFFFF) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRPre0 l i + | false => NatTree.getRPre0 r (i - sz) +def NatTree.getRPre2 (t : NatTree) (i : Nat) : List Nat := + match t with + | .leaf v => unpack7 ((v >>> (i * 84)) &&& 0xFFFFFFFFFFFFFFFFFFFFF) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRPre1 l i + | false => NatTree.getRPre1 r (i - sz) +def NatTree.getRPre3 (t : NatTree) (i : Nat) : List Nat := + match t with + | .leaf v => unpack7 ((v >>> (i * 84)) &&& 0xFFFFFFFFFFFFFFFFFFFFF) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRPre2 l i + | false => NatTree.getRPre2 r (i - sz) +def NatTree.getRPre4 (t : NatTree) (i : Nat) : List Nat := + match t with + | .leaf v => unpack7 ((v >>> (i * 84)) &&& 0xFFFFFFFFFFFFFFFFFFFFF) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRPre3 l i + | false => NatTree.getRPre3 r (i - sz) +def NatTree.getRPre5 (t : NatTree) (i : Nat) : List Nat := + match t with + | .leaf v => unpack7 ((v >>> (i * 84)) &&& 0xFFFFFFFFFFFFFFFFFFFFF) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRPre4 l i + | false => NatTree.getRPre4 r (i - sz) +def NatTree.getRPre6 (t : NatTree) (i : Nat) : List Nat := + match t with + | .leaf v => unpack7 ((v >>> (i * 84)) &&& 0xFFFFFFFFFFFFFFFFFFFFF) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getRPre5 l i + | false => NatTree.getRPre5 r (i - sz) +def NatTree.getMask0 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 1616)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node _ _ _ => 0 +def NatTree.getMask1 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 1616)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getMask0 l i + | false => NatTree.getMask0 r (i - sz) +def NatTree.getMask2 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 1616)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getMask1 l i + | false => NatTree.getMask1 r (i - sz) +def NatTree.getMask3 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 1616)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getMask2 l i + | false => NatTree.getMask2 r (i - sz) +def NatTree.getMask4 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 1616)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getMask3 l i + | false => NatTree.getMask3 r (i - sz) +def NatTree.getMask5 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 1616)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getMask4 l i + | false => NatTree.getMask4 r (i - sz) +def NatTree.getMask6 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 1616)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getMask5 l i + | false => NatTree.getMask5 r (i - sz) +def NatTree.getMask7 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 1616)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getMask6 l i + | false => NatTree.getMask6 r (i - sz) +def NatTree.getMask8 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 1616)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getMask7 l i + | false => NatTree.getMask7 r (i - sz) +def NatTree.getMask9 (t : NatTree) (i : Nat) : Nat := + match t with + | .leaf v => (v >>> (i * 1616)) &&& 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => NatTree.getMask8 l i + | false => NatTree.getMask8 r (i - sz) +def ListTree.get0 (t : ListTree) (i : Nat) : List Nat := + match t with + | .leaf dir data => + let info := (dir >>> (i * 24)) &&& 0xFFFFFF + unpackListAcc (info >>> 12) (data >>> ((info &&& 0xFFF) * 12)) [] + | .node _ _ _ => [] +def ListTree.get1 (t : ListTree) (i : Nat) : List Nat := + match t with + | .leaf dir data => + let info := (dir >>> (i * 24)) &&& 0xFFFFFF + unpackListAcc (info >>> 12) (data >>> ((info &&& 0xFFF) * 12)) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => ListTree.get0 l i + | false => ListTree.get0 r (i - sz) +def ListTree.get2 (t : ListTree) (i : Nat) : List Nat := + match t with + | .leaf dir data => + let info := (dir >>> (i * 24)) &&& 0xFFFFFF + unpackListAcc (info >>> 12) (data >>> ((info &&& 0xFFF) * 12)) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => ListTree.get1 l i + | false => ListTree.get1 r (i - sz) +def ListTree.get3 (t : ListTree) (i : Nat) : List Nat := + match t with + | .leaf dir data => + let info := (dir >>> (i * 24)) &&& 0xFFFFFF + unpackListAcc (info >>> 12) (data >>> ((info &&& 0xFFF) * 12)) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => ListTree.get2 l i + | false => ListTree.get2 r (i - sz) +def ListTree.get4 (t : ListTree) (i : Nat) : List Nat := + match t with + | .leaf dir data => + let info := (dir >>> (i * 24)) &&& 0xFFFFFF + unpackListAcc (info >>> 12) (data >>> ((info &&& 0xFFF) * 12)) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => ListTree.get3 l i + | false => ListTree.get3 r (i - sz) +def ListTree.get5 (t : ListTree) (i : Nat) : List Nat := + match t with + | .leaf dir data => + let info := (dir >>> (i * 24)) &&& 0xFFFFFF + unpackListAcc (info >>> 12) (data >>> ((info &&& 0xFFF) * 12)) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => ListTree.get4 l i + | false => ListTree.get4 r (i - sz) +def ListTree.get6 (t : ListTree) (i : Nat) : List Nat := + match t with + | .leaf dir data => + let info := (dir >>> (i * 24)) &&& 0xFFFFFF + unpackListAcc (info >>> 12) (data >>> ((info &&& 0xFFF) * 12)) [] + | .node sz l r => + match Nat.ble (i + 1) sz with + | true => ListTree.get5 l i + | false => ListTree.get5 r (i - sz) + +def left_row_tree : NatTree := (NatTree.node 704 (NatTree.node 352 (NatTree.node 176 (NatTree.node 80 (NatTree.node 32 (NatTree.node 16 (NatTree.leaf 0x53a00000000000000000353000000000000000000000000000500110000000000000000000000000000000003c404d300000000000500100000000000000000000000000000000004d30354000000000005000f000000000000000000000000040500000000000000000377000e000500000000000000000000000002fc00000000000000000405000d000502d3000000000000000004060000000000000000000000000005000c0406000000000000000002ac0000000000000000000000000005000b0000000000000000000000000000000002ae03c5000000000005000a0000000000000000000000000000000003c502ad00000000000500090000000000000000000000000320000000000000000002420008000500000000000000000000000000000000000000000000000000050005000000000000000000000000027c000000000000000003200007000501860000000000000000032100000000000000000000000000050006032100000000000000000201000000000000000000000000000500040000000001520000000000000000000002d40202000000000003000200000000000000000000015101bc0114000001520000000000010000) + (NatTree.leaf 0x58000000000000000000d60024000500000000000000000000000000df0000000000000000005800230005000001b90000000000000000005d00de081503a4000000000016002200000000000000000000000000d6000000000000000001b90021000500000000000000000000000006f3000000000000000007910020000500d9000000000000000000590000000000000000000000000005001f0059000000000000000000b50000000000000000000000000005001e0111000000000000005e00d90355000000000000000006f3001d001c05b1000000000000000006490000000000000000000000000005001b0000000000db00000000000000000000005b00b700000000001a001906490000000000000000037500000000000000db00000000000500180000000000000000000000000000000004b606040000000000050017000000000000000000000000005d00de060403760000000000160015000000000000000000000000057200000000000000000476001400050000000000000000005e0000031f000000000000000005720013000503e70000000000000000053a00000000000000000000000000050012)) + (NatTree.node 16 (NatTree.leaf 0x6a30000003f0000000003c3000000000022014a000000000033003203c3000000000000000003a2000000000000003f00000000000500310000000000000000000000000180023c00000000000000000030000500000000000000000000000000000000000001800000000000050005000000000680000000000000014c004103a302f900000000002f002e000000000000000001810000000000000000000001b30000002d000500000000000000000000000000d700000000000000000181002c0005000001b900000000014f0000027b0681081503a400000000002b002201b5000000000000000001120000000000000000000000000005002a0112000000000000000000da000000000000000000000000000500290111000000000000035100d90355000000000000059006f30028001c0000000000000000000000000000000001b70057000000000005002700000000000000000000000000000000005700dc0000000000050026080a01b700000000000003e600000000000000db000000000005002500000000000000000000000000000000000001b7000000000005000500000000000000000000000000000000053908150000000000050017) + (NatTree.node 16 (NatTree.leaf 0x1f02cc000000000005004506030034000000000000045b0000000000000000000000000005004400000000000000000000000000000000000000340000000000050005000000000000000001f900000040000000000000027400b60043000500000000000000000000000001b10000000000000000027800420005000000000000000000000000002000000000000000000038004100050000023b000000000000000000000000086805710000000000050040000000000000000000000000017c00000000000000000277003f0005000000360000000000000000000000000571045c000000000005003e000000000000000000000000003800000000000000000036003d0005034e000000000000000001fb0000000000000000000000000005003c01fb0000000000000000017e0000000000000000000000000005003b003c000000000000000000210000000000000000000000000005003a01b20000000000000000014704030000000000000000079000390038003a0000000000000000003c045e00000000000000000403003700360000000003500000000000000000000000d4017f0000000000350034) + (NatTree.leaf 0x790000000000000000005a005900050000000000000000003700000000000000000000002e00000058000500000000000000000145000004d1083004f4027a00000000005700560000000000000000000000000039000000000000000000370055000500000000000000000036000000b802fb027a0692000000000054005300000000039e00000000000000000000014001f6000000000052005100b30000000000000000005c00000000000000000000000000050050005c0000000000000000007a0000000000000000000000000005004f00320000000000000000003b0000000000000000000000000005004e0000000000000000051400000241000000000000079b045d004d0005003b0000000000000000003d0000000000000000000000000005004c00000000000000000113000004d200000000000002ab0648004b000500000000000000000000000001f8031c00b4003e00000000004a004900000000000000000000000000000000003e02cd0000000000050048000000000000000000000000000000000034001f00000000000500470840027600000000000004b500000000000000000000000000050046)))) + (NatTree.node 48 (NatTree.node 16 (NatTree.leaf 0x352000000000000000000e00000000000000032000000000005006a00e00000000000000000015000000000000000000000000000050069002c0000000000000000002e0279000000000000000003c1006800670000000000000000010c000000a4000000000000013e02320066000500000000000000000000000002730000000000000000023700650005000000000000000000000000007800b0000000000000000000640005000000000000000000000000000000000000007800000000000500050000000000000000000000000035002a000000000000000000630005023b000008a9000000000055014400d305550512000000000062006104f3000000000000000002d100000000000000ab0000000000050060000000000000000000000000000000000000003500000000000500050000000002fa0000000000000034000000e100e200000000005f005e02d1000000000000000001ff0000000000000032000000000005005d039d000000000000000002390000000000000000000000000005005c0239000000000000000001f40000000000000000000000000005005b0000000000000000005a0000000000000000000000b20000005a0005) + (NatTree.node 16 (NatTree.leaf 0x1b00000000000000435013f05360000000000000691080900820081000000000000000000000000000000000275006e0000000000050080009f000000000000000000d1064700000000000000000736007f007e0000010b000000000000000000000000061d0515000000000005007d00000000000000000000000000a80000000000000000010b007c0005002c0000000000000000002e00dd00000000000000000404007b00670000000000000000000000000185000000000000000000dd007a0005000000af0000000000000000000000000515031e0000000000050079000000000000000000000000002a000000000000000000af00780005000000000000000000000000010a0238023100a200000000007700760000000000000000000000000000000000a202f100000000000500750000000001fe000000000000000000000030007700000000007400730000000000ad00000000000000000000001e003300000000007200710893027600d200000000061c00000000004f0142000000000070006f061c0000000000000000055600530000000000d200000276006e006d010d000000000000000000a903c10000000000000000058e006c006b) + (NatTree.leaf 0x9c000000000000000000000000067e0737000000000005009100000000000000000000000000d00000000000000000009c00900005056f0143000000000000058f0000000000000000000000000005008f00000000000000000000000000000000000001430000000000050005000000af00000000000000000000000005de0183000000000005008e0000000000000000000000000000000001830184000000000005008d066700ad000000000000031d0000000000000000000000000005008c00000000000000000000000000000000000000ad00000000000500050000000002360000000000000000000000a7010900000000008b008a023000000000000000000105000000000000000000000000000500890105000000000000000001770000000000000000000000000005008801fd00000000000000000056000000000000000000000000000500870056000000000000000000760000000000000000000000000005008600ab0000000000000000002d00000000000000000000000000050085002d0000000000000000002f0000000000000000000000000005008400d10000000000000000004d00000000000000000000000000050083))) + (NatTree.node 16 (NatTree.leaf 0x2a700000513000000000000039f02a500a2000505f100ad00000000000001bb000000000000000000000000000500a101bb00000000000000000182000000000000000000000000000500a000000000000000000074000002f60000000000000200067f009f00050234000000000000000000a60000000000000000000000000005009e00a6000000000000000001080000000000000000000000000005009d0000000000000000010400000000000000000000022e0000009c0005000000000000000000000000017500000000000000000104009b0005000000000000000000d50000000000000000000001fc0000009a00050000000000000000000000000073000000000000000000d500990005000000000000000000720000000000000000000000a9000000980005000000000000000000000000002b0000000000000000007200970005000000000000000000000000004c000000000000000000d0009600050000010b000000000145000003c00738085e067e000000000095009400000000000000000000000001af000000000000000001ad0093000502740000000000000000006c00000000000000000000000000050092) + (NatTree.node 16 (NatTree.leaf 0xaf0000003102d2051104020000000000b000af00000000000000000000000000a40000000000000000023200ae00050000000000000000000000000179000000000000000000a400ad00050000000000000000000000000174022c000000000000000000ac000500000000000000000000000000000000000001740000000000050005000000000000000000000000014d01fa000000000000000000ab0005000000000000000000000000000000000000014d0000000000050005000000000000000000000000007100a8000000000000000000aa0005000000000000000000000000000000000000007100000000000500050000000000000000000000000000000000cf004b00000000000500a9010b000007d000000000001d014400d3045904010000000000a800a708260143000000000000053500000000000000ab00000000000500a600000000000000000000000000000000004b027200000000000500a5000000000000000000000000006b0000000000000000031c00a4000506de00cf00000000000004d0000000000000000000000000000500a300000000000000000000000000000000000000cf0000000000050005) + (NatTree.leaf 0x5100000000000000000017b00000000000000ab00000000000500c200000000000000000000000000000000023100a200000000000500760000000000000000000000000000000000a20178000000000005007500000000034b00000000000000000000009801730000000000c100c00000000003a10000000000000000000000aa014b0000000000bf00be00000000014300000000000000000000005400700000000000bd00bc00ce000000000000000000a0000000000000000000000000000500bb077e014300d200000000053800000000004f014200000000007000ba05380000000000000000045a001c0000000000d20000014300b900b8010d000000000000049100a902ee00000000000006ea04ee00b7006b00a0000000000000000000a1000000000000000000000000000500b600000000000000000000000000000000039e0140000000000005005200000000000000000233000004ef00000000000003fd064600b5000500000000000000000052000001f70474040005110000000000b400b3000000000000000001ba000000d80000000000000475037400b2000500000000000000000000000002aa000000000000000002f800b10005))))) + (NatTree.node 80 (NatTree.node 32 (NatTree.node 16 (NatTree.leaf 0x3a00000000000000000017d000000000000000000000000000500d7017d00000000000000000148000000000000000000000000000500d601410000000000000000010e000000000000000000000000000500d5010e0000000000000000006f000000000000000000000000000500d40000000000000000009d0000000000000000000000cc000000d3000501b000000000000002a7013f0492000000000000039f073500d20081000000000000000000000000000000000141001b00000000000500d1009f000000000000000000d104f00000000000000000061a00d0007e0000010b0000000000520000047007aa067c039a0000000000cf00ce000000000000000000000000009e0000000000000000009d00cd00050000000000000000009c0000010604b3039a067d0000000000cc00cb000000000473000000000000005100d302ca01f50000000000ca00c905370000000000000000051000000000000000d200000000000500c8000000000000000000af000001b804f203e501100000000000c700c600000000000000000000000000000000011003c200000000000500c50000000002d000000000000000ad000000b100750000000000c400c3) + (NatTree.leaf 0x1360000085400000000004a005100d304cf046f0000000000e900e805dc014300000000000005ab000000000000000000000000000500e7000000000000000000000000000000000000009b00000000000500050000000004b200000000000000cf0000013d01760000000000e600e505ab000000000000000002ef00000000000000ce00000000000500e40472000000d200000000034d00000000004f005000000000007000e3034d000000000000000001f300000000000000d200000000000500e2009f000000000000000000d105b0000000000000000006d100e1007e010b0000062e00000000001d00ad000001b402400000000000e000df03e40000000000000000010f00000000000000ab00000000000500de010f0000000000000000014e000000000000000000000000000500dd02cf000000000000000000ae00000000000000ab00000000000500dc00ae000000000000000000d5000000000000000000000000000500db010d000000000000000000a9017a000000000000000005b000da006b034900000000000000000101000000000000000000000000000500d9010100000000000000000172000000000000000000000000000500d8)) + (NatTree.node 16 (NatTree.leaf 0x2a8000000000000000002a9001c0000000000000000014300b900f9010d000000000000000000a90149000000000000000003e300f8006b00000000000000000000000001b60000000000000000014900f70005010d000000000000000000a900ac000000000000000002ce00f6006b000000000000000000000000014d000000000000000000ac00f500050000010b00000000000000000000000006ba02cb00000000000500f4000000000000000001aa000000000000000000000348000000f300050000000000000000000000000170000000000000000001aa00f20005000000000000000002a700000000000000000000039f000000f100050000000000000000000000000146000000000000000002a700f000050000000000000000010c00000000000000000000013e000000ef0005000000000000000000000000006d0000000000000000010c00ee0005000000000000000000000000009b00ca000000000000000000ed00050000010b000000000052000001f70474079a05f00000000000b400ec013e0000000000000000001a000000000000000000000000000500eb0000009c00000000000000000000000005f005af00000000000500ea) + (NatTree.node 16 (NatTree.leaf 0x10a0238000000000000000000770005000000000000000000000000000000000000010a000000000005000500000000016f000000000000000000000048009a00000000010b010a0734014300000000000004710000000000000000000000000005010900000000000000000000000000190000000000000000023801080005066600cf00000000000003e1000000000000000000000000000501070863016f00d200000000056c00000000004f00500000000000700106056c0000000000000000048e00470000000000d20000016f01050104000000000000000002a70000058a000000000000039f04b00103000505320000000000000000013b00000000000000ce0000000000050102013b000000000000000002a1000000000000000000000000000501010095000000000000000000cc02ed000000000000000006d0010000ff004d0000000000000000004e03e00000000000000000061900fe00fd009f000000000000000000d102a4000000000000000003e000fc007e0000009c000000000000000000000000058b06ba00000000000500fb058d014300000000000002a800000000000000ab00000000000500fa) + (NatTree.leaf 0xca00000000000000000136011700050000000000000000000000000000000005ad056e000000000005011600000000000000000000000000a50000000000000000004c011500050000009c000000000000000000000000056e02a3000000000005011405dd00cf00000000000003bc00000000000000000000000000050113010d00000000000002a700a900ac000000000000039f02ce0112006b00000000000000000000000002f700000000000000000373011100050000010b0000000000000000000000000570023e000000000005011000000000000000000000000000000000023e023f000000000005010f0000010b000000000000000000000000049400aa000000000005010e0000000000000000000000000000000000aa014b00000000000500be061b014300000000000003bd0000000000000000000000000005010d000000000000000000000000026e03460000000000000000010c0005000000000000000000000000000000000000026e000000000005000500000000000000000052000001f70474000000000000000000b4000500000000000000000000000000000000000002a60000000000050005)))) + (NatTree.node 48 (NatTree.node 16 (NatTree.leaf 0x4340000000000000000023d0000000000000000000000000005012603a00143000000000000017d000000000000000000000000000500d7000000000000000002a7000002f0000000000000039f050f012500050000000004cc000000000000000000000135026d0000000001240123016e000000000000000000960000000000000000000000000005012200960000000000000000009700000000000000000000000000050121000000000000000004b40000013c00000000000006f2013a0120000500000000000000000000000000000000023600a7000000000005008b00000000000000000233000003bb00000000000003fd05ae011f0005004d0000000000000317004e050d000000000000060207f3011e00fd00000000000000000000000000000000016e0064000000000005011d009f000000000000000000d105c5000000000000000006b9011c007e00000000000000000052000001f70474046e06650000000000b4011b0095000000000000000000cc0138000000000000000005ef011a00ff00000000000000000000000002ec000000000000000001380119000500000136000000000000000000000000066504580000000000050118) + (NatTree.node 16 (NatTree.leaf 0x9c0000010604b30139056d0000000000cc013300000000000000000136000002c806a107eb06640000000001320131016d00000000000000000063000000000000000000000000000501300000009c0000000000000000000000000664068f000000000005012f04ce0000000000000000055400000000000000d2000000000005012e00000136000000000000000000000000075302c9000000000005012d0000000000000000000000000000000002c902eb000000000005012c0690016f00000000000001f10000000000000000000000000005012b000000000000000000000000000000000000016f000000000005000505ac0000000000000000031b0000000000000000000000000005012a00000000000000000000000000000000004b00a300000000000500a5058c00cf00000000000002a200000000000000000000000000050129000000000000000002330000039c00000000000003fd050e012800050000010b000000000052000001f70474049400aa0000000000b4010e0000000000000000000000000000000000aa03e200000000000500be04930143000000000000043400000000000000000000000000050127) + (NatTree.leaf 0x67a00cf000000000000048c00000000000000000000000000050143009f000000000000000000d1067b000000000000000005520142007e076a016f00000000000003190000000000000000000000000005014103190000000000000000031a0000000000000000000000000005014000000000000000000137000001ac0000000000000315067b013f0005000000000000000002a10000013c0000000000000532013a013e0005000000000000000002330000027000000000000003fd03df013d00050000000000000000009c0000010604b3013905340000000000cc0133000000000000000002a7000002f5000000000000039f0107013c0005000000000000000000000000023a000000000000000004f1013b000500000000000000000052000001f70474053403fe0000000000b4013a04cb0000000000000000029e00000000000000000000000000050139029e0000000000000000026c00000000000000000000000000050138000000000000000000ff00000000000000000000016d0000013700050000000000000000000000000094000000000000000000ff01360005000000000000000000520000049007b401f201390000000001350134))) + (NatTree.node 16 (NatTree.leaf 0x13600000049043206790318000000000154015300000000000000000000000002ec05ef01f2013900000000015201340000000000000000009c0000010604b30139039b0000000000cc013300000000000000000052000001f7047402f202f40000000000b401510000000000000000000000000000000002f4034f00000000000501500533000000000000000002710000000000000000000000000005014f000000000000000003b80000000000000000000004ca0000014e0005000000000000000000000000026b000000000000000003b8014d000500000000000000000000000000fd016c0000000000000000014c000500000000000000000000000000000000000000fd000000000005000501360000085d00000000004a005100d304ed048f00000000014b014a01f00000000000000000022f00000000000000000000000000050149022f0000000000000000006800000000000000ce000000000005014801ea00000799000000000029016f0000029f034a000000000147014607ea0000000000000000048b000000000000016e000000000005014500000000000000000000000000620000000000000000016c01440005) + (NatTree.node 16 (NatTree.leaf 0x2a100000067000000000000053200660165000500000000000000000092000002e805a900000000000000000164000500000000000000000000000000000000000003b7000000000005000500000000026a00000000000000000000009300fb00000000015901630867016f00d200000000058900000000004f005000000000007001620589000000000000000004b100470000000000d20000016f010501610000000000000000000000000371000000000000000003ba016000050095000000000000000000cc006600000000000000000371015f00ff06f1026a0000000000000399000000000000016e000000000005015e0399000000000000000003de00280000000000000000026a015d015c01ec00000000000002a1016d036e0000000000000532062d015b015a00000000000000000000000000000000026a0093000000000005015900000000000000000233000004cd00000000000003fd0551015800050000009c000000000000000000000000068e067900000000000501570000000000000000034c00000171000000000000061804eb0156000500000000000000000000000004330000000000000000048d01550005) + (NatTree.leaf 0x13600000000000000000000000004af0103000000000005017701ec0000000000000397016d00fc00000000000004ad042f0176015a0000000000000000000000000000000002690027000000000005017500000000000000000000000004570000000000000000048901740005000001ea000000000000000002ec05ef077d046d0000000001520173000000000000000000000000016c000000000000000001ea017200050269000000000000000001ed000000000000000000000000000501710000000000000000009c0000010604b3046d05ee0000000000cc0170075200cf00000000000006780000000000000000000000000005016f00000000000000000136000002ea06b8056b01a900000000016e016d0000000000000000000000000000000001a90553000000000005016c000000000431000000000000016f0000010000cb00000000016b016a067800000000000000000370000000000000016e000000000005016901360000075300000000004a0000000002c902eb00000000012d01680372000000000000000002f300000000000000d2000000000005016702f30000000000000000006a00000000000000000000000000050166)))))) + (NatTree.node 176 (NatTree.node 80 (NatTree.node 32 (NatTree.node 16 (NatTree.leaf 0x2330000066300000000000003fd07e40188000501ea000007a8000000000029016f000002c7036f0000000001870186056a000000000000000001a7000000000000016e000000000005018501a70000000000000000026f000000000000000000000000000501840430000000000000000000fe000000000000016e000000000005018300fe000000000000000001aa0000000000000000000000000005018201ec0000000000000000016d03fc000000000000000007290181015a03190000000000000000031a00470000000000000000016f01050140009f000000000000000000d103bf000000000000000003ff0180007e0000000000000000000000000069000000000000000003bf017f000500000000000000000000000002ec05ef01030065000000000152017e0000000005a80000000000000091016b039502e700000000017d017c01ed000000000000000000fa0000000000000000000000000005017b004d000000000000034c004e050d000000000000061807f3017a00fd009f000000000000000000d105db000000000000000006cf0179007e0000000000000000000000000000000001ab04af0000000000050178) + (NatTree.leaf 0x3be01ae00000000000501960102000000000000000000990000000000000000000000000005019505a70000016a00000000045600000000008f009000000000019401930456000000000000000002e6000000000000016a000000000005019200000000000000000000000000f9000000000000000001eb0191000500000000000000000136000002ea06b807eb066400000000016e01310000009c000000000000000000000000066406a2000000000005012f01a8000000000000000003150000000000000000000000000005019004ec016f00000000000001020000000000000000000000000005018f000001ea000000000092000002c605870601013500000000018e018d0267000000000000000000260000000000000000000000000005018c0000000000000000000000000000000001350550000000000005012306dc026a00000000000006b70000000000000000000000000005018b000000000000000000000000000000000000026a0000000000050005000000000000000001eb0000000000000000000002670000018a000506b7000000000000000003fa00000000000000ce0000000000050189)) + (NatTree.node 16 (NatTree.leaf 0x137000000cd0000000000000315043201a400050000000005850000000000000091016b036902c50000000001a301a204cb026a000000000000029e0000000000000000000000000005013900000000000000000000000000250000000000000000034501a10005000000000000000003b80000064500000000000004ca050b01a0000500000000000000000000000001e903450000000000000000019f00050095000000000000000000cc03f9000000000000000007a9019e00ff0000000000000000009c0000010604b3013907f80000000000cc01330704026a00000000000003b9000000000000016e000000000005019d03b9000000000000000003fb00280000000000000000026a015d019c01ec0000000000000000016d01ef00000000000000000569019b015a00000000000000000000000002e9000000000000000001ef019a000501ec0000000000000000016d00fc0000000000000000042f0199015a000000000000000000000000026e000000000000000000fc01980005000001ea00000000000000000000000007f8050c00000000000501970000009c000000000000000000000000058b03be00000000000500fb) + (NatTree.node 16 (NatTree.leaf 0x34400000000000000000000013401e80000000001b401b30000013600000000000000000000000006f0056700000000000501b201ec00000000000003b8016d00fc00000000000004ca042f01b1015a000000000000000000000000046c000000000000000004ae01b00005000001ea00000000000000000000000006dd034700000000000501af000000000000000000000000000000000347036d00000000000501ae000001ea00000000000000000000000006010135000000000005018d000000000000000000000000000000000135026d0000000000050123077c026a000000000000048a000000000000000000000000000501ad03bc00000000000000000235000000000000000000000000000501ac000000000000000000000000022d000000000000000002a001ab000501680000000000000000008d000000000000000000000000000501aa008d0000000000000000008e050a0000000000000000073301a901a8012c0000000000000000016803960000000000000000050a01a701a600000000000000000000000000000000000001e900000000000500050000000000000000000000000432000000000000000001a601a50005) + (NatTree.leaf 0x5ed026a00000000000005aa000000000000000000000000000501c105aa0000000000000000036c000000000000000000000000000501c00000000000000000058800000067000000000000077b006601bf000500000000000000000000000002f00000000000000000050f01be00050000000000000000000000000000000001000316000000000005016a000000000000000000000000008c0000000000000000016701bd00050000000000000000000000000000000006cd069f00000000000501bc00000000000000000000000001320000000000000000008c01bb000500000129000000000000000000000000069f039400000000000501ba00000000000000000000000001670000000000000000012901b900050000000000000000000000000000000001ee043100000000000501b80000000000000000013600000049043204310100000000000154016b05840000016a00000000042b00000000008f009000000000019401b7042b000000000000000002c4000000000000016a00000000000501b6000000000000000000000000000000000344013400000000000501b400000000000000000092000002e805a9052f06f000000000016401b5)))) + (NatTree.node 48 (NatTree.node 16 (NatTree.leaf 0x92000005310814010300650000000001cd017e00000000000000000000000000000000053403fe000000000005013a000000000000000000000000000000000166008b00000000000501cc06cc00000000000000000429000000000000000000000000000501cb00000000000000000000000000000000008b013000000000000501ca06b601660000000000000393000000000000000000000000000501c900000000000000000000000000000000000001660000000000050005039800000000000000000430000000000000000000000000000501c8008d0000000000000000008e04e70000000000000000072801c701a8012c00000000000000000168036a000000000000000004e701c601a605c400000000000000000617000000000000016a00000000000501c5034300000000000000000133000000000000000000000000000501c40133000000000000000001e7000000000000000000000000000501c3071a016f0000000000000268000000000000000000000000000501c2000001ea000000000092000002e805a906010135000000000164018d00000000000000000000000000000000013505680000000000050123) + (NatTree.node 16 (NatTree.leaf 0x92000002e805a903dd042d00000000016401de00000000000000000000000000000000042d048800000000000501dd01360000088300000000004a0091016b058605300000000001dc01db01640000000000000000012d000000000000000000000000000501da00000000000000000392000001a3000000000000067601a101d90005012d0000000000000000012e000000000000000000000000000501d80000000000000000031300000364000000000000052e04e501d70005000000000000000000000000042f000000000000000005da01d600050000000000000000000000000000000006b5068d00000000000501d500000129000000000000000000000000068d036800000000000501d4012c0000000000000000016807190000000000000000064401d301a600000000000000000000000001310000000000000000034101d20005000000000000000000000000029d0000000000000000013101d10005000000000000000001370000022b0000000000000315071901d00005000000000000000003b80000042e00000000000004ca01a501cf0005000000000000000000000000036b0000000000000000067701ce0005) + (NatTree.leaf 0x7170000000000000000042a000000000000016e00000000000501ef04870000000000000000042c000000000000016a00000000000501ee042c000000000000000000c9000000000000000000000000000501ed088b016f016a00000000062c00000000008f009000000000019401ec062c0000000000000000054f004700000000016a0000016f010501eb0000000000000000012a000000000000000000000162000001ea000500000000000000000000000003f60715029701a00000000001e901e8000000000000000000000000012b0000000000000000012a01e70005000000000000000001290000016905eb01a004ac0000000001e601e50000000000000000000000000000000000000601000000000005000506b4000000000000000003f7000000000000000000000000000501e406a001660000000000000367000000000000000000000000000501e3000001290000000000000000000000000769071800000000000501e2000000000000000000000000000000000340012f00000000000501e100000000000000000000000000000000012f029b00000000000501e000000000000000000136000000490432071803b600000000015401df))) + (NatTree.node 16 (NatTree.leaf 0x1ec0000000000000000016d04e6000000000000000007cf0200015a012c0000000000000000016804ea0000000000000000054d01ff01a600000000000000000000000000c8000000000000000004ea01fe0005008d000000000000034c008e06000000000000000618086601fd01a8012c0000000000000000016806620000000000000000075101fc01a600000000000000000000000001280160000000000000000001fb000501e3000008250000000000610000000003b403f50000000001fa01f90295000000000000000002e5000000000000000000000000000501f8000000000000000000000000000000000000012800000000000500050000000005e90000000000000166000001a4022a0000000001f701f602e50000000000000000008a000000000000016400000000000501f500000000000000000365000001a3000000000000065d01a101f400050000000000000000031300000342000000000000052e04c801f3000507fd01660000000000000717000000000000000000000000000501f2033f000000000000000001e6000000000000000000000000000501f101e60000000000000000029a000000000000000000000000000501f0) + (NatTree.node 16 (NatTree.leaf 0x12900000000000000000000000006ce04e900000000000502120000000000000000000000000000000004e9029c000000000005021100000000000000000136000002ea06b80853074800000000016e02100000012900000000000000000000000007480703000000000005020f000000000227000000000000000000000086012700000000020e020d083e022700000000000004250000000000000000000000000005020c042500000000000000000455005f00000000000000000227020b020a0000000000000000000000000454000000000000000004c7020900050676000000000000000001a20000000000000164000000000005020801a200000000000000000392000000000000000000000000000502070121000000000000000001620088000000000000000004540206020500000000000000000000000003dc06ff029701a000000000020401e8000000000000000001290000016905eb01a004860000000001e601e50000000000000000031300000701000000000000052e083f02030005000000000000000001e500000000000000000000033e0000020200050000000000000000000000000299000000000000000001e502010005) + (NatTree.leaf 0x7500166000000000000054e00000000000000000000000000050221022600000000000000000122000000000000000000000000000502200122000000000000000001240000000000000000000000000005021f0000000000000000046b00000228000000000000072705fd021e00050000000000000000000000000000000002260085000000000005021d0000000000000000000000000565000000000000000005d9021c000500000000000000000000000000000000026605c2000000000005021b012100000000000000000162019f00000000000000000715021a020500000000000000000000000003f60000000000000000019f02190005000001e300000000000000000000000005c2016500000000000502180000000000000000000000000160000000000000000001e30217000501e30000081d00000000006100000000039103db0000000002160215000000000000000001290000016905eb01a0085c0000000001e601e50000000000000000000000000298033d00000000000000000214000500000000000000000000000000000000000002980000000000050005000001ea000000000000000000000000085c06160000000000050213))))) + (NatTree.node 80 (NatTree.node 32 (NatTree.node 16 (NatTree.leaf 0x1200000000000000000019e02310005000000000000000001e3000003da07a406740265000000000230022f0225000000000000000000840000000000000000000000000005022e0000000000000000000000000000000002650675000000000005022d0264000000000000000003f10000000000000000000000000005022c000001e3000000000000000000000000082503b400000000000501fa0000000000000000000000000000000003b403f5000000000005022b05ff022700000000000001630000000000000000000000000005022a000000000000000000000000000000000000022700000000000500050837022700000000000003f40000000000000000000000000005022903f400000000000000000426005f00000000000000000227020b02280000000004240000000000000000000001260296000000000227022607fc026a000000000000054c000000000000000000000000000502250702016600000000000004e80000000000000000000000000005022404e80000000000000000031400000000000000000000000000050223085200000000000000000566000000000000016e0000000000050222) + (NatTree.leaf 0x6730000000000000000026300000000000002260000000000050240000000000000000000000000008300000000000000000224023f000502630000000000000000033c0000000000000000000000000005023e000000000000000000000000052d00000000000000000262023d00050425000000000000000004550000000000000000000000000005020a000000000000000002290000012500000000000003f1052d023c00050000000000000000045300000228000000000000071305fd023b0005000000000000000000000000054a000000000000000005c3023a00050423000000000000000001e40000000000000000000000000005023901e400000000000000000293000000000000000000000000000502380000000000000000061500000089000000000000080800880237000500000000000000000313000004c9000000000000052e062b0236000500000000000000000000000003f8000000000000000006610235000501ec0000000000000392016d03b5000000000000067606600234015a0000000000000000031300000583000000000000052e0614023300050000000000000000019e000000000000000000000225000002320005)) + (NatTree.node 16 (NatTree.leaf 0x31200f7000000000005025000000000000000000000000003d900000000000000000290024f00050000000000000000000000000000000002c2052b000000000005024e000000000000000001e300000060052d052b016100000000024d024c000000000000000001e3000003b307980674026500000000024b022f000000000000000000000000000000000265065c000000000005022d000000000000000002910000000000000000000004210000024a00050000000000000000000000000292000000000000000002910249000500000000000000000092000005ec0873016500870000000002480247000000000000000001290000016905eb01a0065f0000000001e601e500000000000000000000000000000000065f054b0000000000050246000001ea000000000000000003f6071507a704ab0000000001e90245000000000000000001290000016905eb04ab069e0000000001e60244000000000000000000000000019d0224000000000000000002430005000000000000000000000000000000000000019d000000000005000502be0000085b00000000004602270000038f04690000000002420241) + (NatTree.node 16 (NatTree.leaf 0x420046800000000000502630484000000000000000005290000000000000000000000000005026200000000052b000000000000022700000161012300000000024c026105290000000000000000015f0000000000000226000000000005026002be00000851000000000046022700000363045200000000025f025e000000000000000000000000033b041f0000000000000000025d0005000000000000000000000000000000000000033b000000000005000501e3000008b90000000000610091016b061305ea00000000025c025b0163000000000000000000f80000000000000000000000000005025a065e00000000000000000366000000000000000000000000000502590700026a00000000000006ef0000000000000000000000000005025806ef00000000000000000428000000000000016400000000000502570000000003120000000000000000000000f7019c000000000250025607e2031200000000000004aa0000000000000226000000000005025504aa0000000000000000052a0045000000000000000003120254025302c00000000000000000022502900000000000000000067202520251) + (NatTree.leaf 0x7ce0312000000000000048500000000000002260000000000050274048500000000000000000509004500000000000000000312025402730000000005bf0000000000000000000001e2033a000000000272027108be0227016a0000000006ca00000000008f0090000000000194027006ca00000000000000000612005f00000000016a00000227020b026f00000000000000000000000002e400000000000000000390026e0005000000000000000003920000008900000000000006760088026d0005000000000000000003b8000006cb00000000000004ca05e8026c00050121000000000000000001620427000000000000000007e9026b020502c10000000000000000019b0000000000000000000000000005026a02c000000000000004a90225015e00000000000005bd0528026902510000000000000000000000000000000003110044000000000005026800000000000000000000000005a4000000000000000005c002670005000002be00000000000000000000000007b2042000000000000502660000000000000000000000000224000000000000000002be026500050311000000000000000002c100000000000000000000000000050264)))) + (NatTree.node 48 (NatTree.node 16 (NatTree.leaf 0x12c000000000000000001680716000000000000000007e3028101a600000000000000000000000000000000016103f2000000000005026100000000000000000000000003f60715016500870000000001e9024700000000000000000092000002e805a90582077a0000000001640280000001e3000000000000000000000000077a05a6000000000005027f000000000000000000000000019a000000000000000002bf027e0005000002be0000000000f6000003b2065706ee01e200000000027d027c030f000000000000000000430000000000000000000000000005027b0000000000000000000000000000000001e2068b000000000005027106da031200000000000006b20000000000000000000000000005027a00000000000000000000000000000000000003120000000000050005000000000000000002bf00000000000000000000030f00000279000506b200000000000000000467000000000000000000000000000502780000000000000000000000000528000000000000000006db02770005015f000000000000000002910000000000000000000000000005027602c000000000000000000225015e0000000000000000052802750251) + (NatTree.node 16 (NatTree.leaf 0x7a6022700000000000002c30000000000000000000000000005028e00000000000000000000000000000000000002bd000000000005000500000000065600000000000000f501df045003b100000000028d028c05be03120000000000000362000000000000000000000000000502840000000000000000000000000042000000000000000003d8028b0005000000000000000004a90000050600000000000005bd0261028a000500000000000000000000000002bd03d800000000000000000289000500000000000000000000000004660000000000000000075a0288000500000000000000000000000000000000000006ee0000000000050005000000000000000000000000033b0000000000000000015e02870005000002be00000000000000000000000006ee01e2000000000005027c02c000000000000004830225015e00000000000005a20528028602510000000000000000000000000581000000000000000005a50285000505be000000000000000003620000000000000000000000000005028403620000000000000000033900000000000000000000000000050283008d000000000000046b008e06430000000000000727088a028201a8) + (NatTree.leaf 0x12c00000000000000000168078f0000000000000000068c029d01a6000000000000000002290000029400000000000003f1078f029c00050655000001dd0000000005490000000000f300f400000000029b029a0549000000000000000003b000000000000001dd00000000000502990000000000000000000000000000000003d701e10000000000050297000000000000000000f6000003b2065704a7050500000000027d02980000000003d70000000000000000000001e102bc000000000297029600000000000000000000000000000000050505a300000000000502950000000000000000000000000000000001e2033a0000000000050271000002be0000000000f60000038e064206ee01e2000000000294027c0000000000000000000000000000000001e206710000000000050271000000000000000004a90000000000000000000005bd0000029300050000000000000000000000000338000000000000000004a902920005000000000000000001e3000003da07a408820768000000000230029100000129000000000000000000000000076807b3000000000005029005fe0000000000000000069d000000000000016a000000000005028f))) + (NatTree.node 16 (NatTree.leaf 0x2c00000000000000392022504220000000000000676072602ae02510000000000000000031300000611000000000000052e065b02ad00050000012900000000000000000000000007a5078e00000000000502ac000000000000000001e300000060052d078e03f300000000024d02ab01db000000000000000000f1000000000000000000000000000502aa00f1000000000000000000f2060f000000000000000007dd02a902a80196000000000000000001db04510000000000000000060f02a702a605a10000000000000000050400000000000001dd00000000000502a503d5000000000000000001e0000000000000000000000000000502a401e0000000000000000002bb000000000000000000000000000502a305040000000000000000011f000000000000000000000000000502a200000000064100000000000000f501df041d038d0000000002a102a0000000000000000000f6000003b206570000000000000000027d000500000000000000000000000000000000000004a800000000000500050881000000000000000005c10000000000000226000000000005029f0779016600000000000005d80000000000000000000000000005029e) + (NatTree.node 16 (NatTree.leaf 0x196000000000000000001db041e000000000000000005fc02be02a6000002be000000000000000003f60715083605640000000001e902bd000000000000000001290000016905eb056407140000000001e602bc083d0166000000000000078d000000000000000000000000000502bb078d0000000000000000046a000000000000022600000000000502ba00000000000000000000000000f0000000000000000001da02b9000500000000000000000000000000000000078a077600000000000502b80000000000000000000000000199000000000000000000f002b70005000001930000000000000000000000000776044f00000000000502b600000000000000000000000001da0000000000000000019302b500050196000000000000000001db05bc0000000000000000065402b402a600000000000000000000000001de000000000000000003d302b300050000000000000000000000000337000000000000000001de02b20005000000000000000000000000011e000000000000000005bc02b10005063f000001dd0000000005270000000000f300f400000000029b02b005270000000000000000038c00000000000001dd00000000000502af) + (NatTree.leaf 0x775076700000000000502cd000001930000000000000000000000000767041c00000000000502cc07a2031200000000000007a3000000000000000000000000000502cb07a300000000000000000508000000000000016400000000000502ca0000000000000000031300000778000000000000052e087902c9000502c000000000000000000225052c0000000000000000081c02c802510000000000000000000000000000000001d900ef00000000000502c7078900000000000000000502000000000000000000000000000502c60000000000000000000000000000000000ef019800000000000502c5078c01d9000000000000044e000000000000000000000000000502c400000000000000000000000000000000000001d900000000000500050000019300000000000000000000000007a105bb00000000000502c30000000000000000000000000000000003d201dc00000000000502c20000000000000000000000000000000001dc033500000000000502c10000000000000000000000000000000005bb033600000000000502c000f1000000000000000000f205fc000000000000000007cb02bf02a8))))))) + (NatTree.node 352 (NatTree.node 176 (NatTree.node 80 (NatTree.node 32 (NatTree.node 16 (NatTree.leaf 0x3330000000000000000028e02dc000500000000000000000000000004e40000000000000000072502db00050774000000000000000004e3000000000000000000000000000502da077701d9000000000000041b000000000000000000000000000502d9000000000000000004a90000073200000000000005bd062a02d8000501210000000000000000016205070000000000000000085a02d70205000000000000000001290000016905eb01a008890000000001e601e5000002be0000000000000000000000000889065a00000000000502d601d700000000000000000195000000000000000000000000000502d5000000000000000004650000025f0000000000000745025d02d40005019500000000000000000197000000000000000000000000000502d3000000000000000003d400000419000000000000060e05e602d2000507de01d900000000000005ba000000000000000000000000000502d103d10000000000000000028f000000000000000000000000000502d0028f00000000000000000334000000000000000000000000000502cf05ba000000000000000003d6000000000000000000000000000502ce) + (NatTree.leaf 0x3af000000000000000000c700000000000001d700000000000502ec000000000000000001930000022306c8025c07240000000002e002df000000000000000000000000033203cf000000000000000002eb000500000000000000000000000000000000000003320000000000050005000000000000000000000000000000000724063d00000000000502ea0000000000000000044d0000025f0000000000000731025d02e90005000000000000000003d4000003f0000000000000060e05d602e80005000000000000000000f6000003b20657061007cd00000000027d02e7000001e300000000000000000000000007cd067000000000000502e60846031200000000000005d7000000000000000000000000000502e5000000000000000001920000000000000000000001d4000002e4000500000000000000000000000004e207c90331025c0000000002e302e200000000000000000000000001940000000000000000019202e10005000000000000000001930000022306c8025c059f0000000002e002df000000000000000003d4000005a0000000000000060e070f02de00050000000000000000028e0000000000000000000003d0000002dd0005)) + (NatTree.node 16 (NatTree.leaf 0x523000000000000000005d502fe000507450000000000000000025e00000000000001d700000000000502fd025e00000000000000000465000000000000000000000000000502fc018c000000000000000001d400c50000000000000000052302fb02fa0000000004a30000000000000000000001d603300000000002f902f807230000000000000000041a000000000000000000000000000502f700000000000000000000000004c607c20331025c0000000002f602e2000000000000000001930000022306c8025c05800000000002e002df06c90000000000000000071200000000000001dd00000000000502f507f202270000000000000310000000000000000000000000000502f4000000000000000006b3000000890000000000000849008802f30005000000000000000000000000019101d2000000000000000002f20005025a0000087f0000000000820000000004a604e10000000002f102f0032f000000000000000003af000000000000000000000000000502ef000000000000000000000000000000000000019100000000000500050000000006c700000000000001d90000026002e20000000002ee02ed) + (NatTree.node 16 (NatTree.leaf 0x652000000000000000006b10311000500000000000000000000000000000000030e06870000000000050310018c000000000000000001d4025b000000000000000007c9030f02fa00000000000000000000000004e20000000000000000025b030e00050000025a000000000000000000000000068701d8000000000005030d00000000000000000000000001d20000000000000000025a030c000504a10000000000000000028d0000000000000000000000000005030b028d0000000000000000032d0000000000000000000000000005030a00000000000000000465000000c6000000000000074500c503090005025a0000087c00000000008200000000048004c500000000030803070196000000000000000001db07e100000000000000000746030602a600000000000000000229000002e300000000000003f107e103050005000000000000000000f600000659089001650087000000000304024700000000028c0000000000000000000000ee01900000000003030302088d028c00000000000005010000000000000000000000000005030105010000000000000000054800800000000000000000028c030002ff) + (NatTree.leaf 0x25a000000000000000000000000087f04a600000000000502f10000000000000000000000000000000004a604e1000000000005032006c6028c00000000000001d50000000000000000000000000005031f000000000000000000000000000000000000028c00000000000500050000000000000000030d0000000000000000000004a00000031e0005000000000000000000000000032c0000000000000000030d031d000500000000000000000000000004e207c901d800c40000000002e3031c0887028c00000000000004e00000000000000000000000000005031b04e00000000000000000052400800000000000000000028c0300031a00000193000000000000000000000000083407e00000000000050319000000000000000001e300000060052d07e0048200000000024d031801e3000008c400000000006100f501df068906580000000003170316028b0000000000000000018b00000000000000000000000000050315018b0000000000000000018e0000000000000000000000000005031400000000000000000522000002e100000000000007b806ae0313000500000000000000000000000000000000028b00c30000000000050312)))) + (NatTree.node 48 (NatTree.node 16 (NatTree.leaf 0x2ba0000018f00000000000004a405d40330000500000000000000000000000003ce049f0000000000000000032f000500000000000000000000000000000000000003ce000000000005000501d50000000000000000015d0000000000000000000000000005032e00000000000000000500000002e100000000000007b106ae032d0005000000000000000000000000063c0000000000000000069b032c0005088801d900000000000007df0000000000000000000000000005032b07df000000000000000005030000000000000226000000000005032a08ca022701dd0000000007470000000000f300f400000000029b032907470000000000000000068a005f0000000001dd00000227020b032800000000000000000222000000000000000000000289000003270005000000000000000000000000018a00000000000000000222032600050000000000000000025a0000047f081b070d030c00000000032503240289000000000000000000c20000000000000000000000000005032300000000000000000000000000000000030c07300000000000050322030b000000000000000004a400000000000000000000000000050321) + (NatTree.node 16 (NatTree.leaf 0x60c00000000000000000000028a03cd00000000033f033e000000000000000000000000038b0000000000000000044c033d00050000000000000000025a00000464080f070d030c00000000033c032400000000000000000000000000000000030c07220000000000050322000000000000000003d4000007cc000000000000060e08a5033b000502c00000000000000000022505e70000000000000000086b033a025100f1000000000000046b00f206fe000000000000072708b3033902a80196000000000000000001db075900000000000000000835033802a6000000000000000000000000022102880000000000000000033700050000000000000000000000000000000000000221000000000005000503060000088600000000007f028c0000044b05210000000003360335070c0000000000000000030a000000000000028b000000000005033400000000000000000000000000c10000000000000000028803330005030a000000000000000003ef0000000000000000000000000005033200000000000000000000000005d40000000000000000030903310005050100000000000000000548000000000000000000000000000502ff) + (NatTree.leaf 0x60b000000000000000003cb0000000000000000000000000005035203cb000000000000000003cc000000000000000000000000000503510000000000000000000000000000000001d304a5000000000005035003060000088400000000007f028c0000041804ff00000000034f034e000000000000000001930000022306c8025c08b00000000002e002df000002be00000000000000000000000008b00711000000000005034d000000000000000001e3000003da07a408af0807000000000230034c00000193000000000000000000000000080707e8000000000005034b00000000036000000000000000000000015c0220000000000344034a083203600000000000000545000000000000028b00000000000503490545000000000000000005e5007e0000000000000000036003480347030800000000000000000289032b0000000000000000070b03460345000000000000000000000000000000000360015c000000000005034400000000000000000000000004a20000000000000000032b0343000500000000000000000000000000000000038a05d300000000000503420000000000000000025a0000008105d405d301d30000000003410340))) + (NatTree.node 16 (NatTree.leaf 0x82e03600000000000000520000000000000028b00000000000503610520000000000000000005d2007e000000000000000003600348036008780312000000000000063e0000000000000000000000000005035f08ae000000000000000006530000000000000226000000000005035e081301d900000000000006400000000000000000000000000005035d03070000000000000000021f0000000000000000000000000005035c0308000000000000051e028901d0000000000000060a05d0035b034500000000000000000000000000000000035f007d000000000005035a0000000000000000000000000651000000000000000006390359000500000306000000000000000000000000080504df000000000005035800000000000000000000000002880000000000000000030603570005035f00000000000000000307000000000000000000000000000503560000000000000000000000000000000004df05460000000000050355051f000000000000000005d1000000000000000000000000000503540000000005d3000000000000028c000001d3018d000000000340035005d1000000000000000001d1000000000000028b0000000000050353) + (NatTree.node 16 (NatTree.leaf 0x710000000c6000000000000088000c50370000502c00000000000000465022504810000000000000745074f036f0251000000000000000003d400000688000000000000060e06fd036e0005000000000000000000000000021e00000000000000000305036d00050000030600000000011d0000041706ad074d028a00000000036c036b035e0000000000000000007c0000000000000000000000000005036a00000000000000000000000000000000028a0709000000000005033e07410360000000000000072100000000000000000000000000050369000000000000000000000000000000000000036000000000000500050000000000000000030500000000000000000000035e0000036800050721000000000000000005440000000000000000000000000005036700000000000000000000000005d00000000000000000072f0366000503080000000000000000028901d0000000000000000005d0036503450000000000000000051e00000000000000000000060a00000364000500000000000000000000000003ca0000000000000000051e0363000501d10000000000000000030d00000000000000000000000000050362) + (NatTree.leaf 0x2be000000000000000004e207c9085005b90000000002e3037b000000000000000001930000022306c805b9078b0000000002e0037a000000000000000000000000000000000000030400000000000500050000000006ab000000000000011c021d049d04160000000003790378060b036000000000000003cb00000000000000000000000000050352000000000000000000000000007b00000000000000000414037700050000000000000000054300000563000000000000060a02e003760005000000000000000000000000030404140000000000000000037500050000000000000000000000000542000000000000000007c003740005000000000000000000000000000000000000074d000000000005000500000306000000000000000000000000074d028a000000000005036b0000000000000000011d0000041706ad0000000000000000036c0005000000000000000000000000000000000000051d000000000005000500000000000000000000000003ce000000000000000001d003730005030800000000000004fd028901d000000000000005fb05d003720345000000000000000000000000063a0000000000000000062903710005))))) + (NatTree.node 80 (NatTree.node 32 (NatTree.node 16 (NatTree.leaf 0x258000000000000000003020000000000000000000000000005038d0561000000000000000001890000000000000000000000000005038c000000000699000000000000011c021d047d03ed00000000038b038a025a000008cf00000000008200f501df06fc06e8000000000389038807ca031200000000000007dc0000000000000000000000000005038707dc0000000000000000052600000000000001d7000000000005038606aa0000021c0000000005b800000000011a011b000000000385038405b800000000000000000415000000000000021c0000000000050383000000000000000000000000000000000413025900000000000503800000000000000000011d0000044a06c504fb056200000000038203810000000004130000000000000000000002590303000000000380037f0000000000000000000000000000000005620638000000000005037e00000000000000000000000000000000028a03cd000000000005033e0000030600000000011d000003ee069a074d028a00000000037d036b00000000000000000000000000000000028a06fa000000000005033e000000000000000000f6000006e908b701d800c400000000037c031c) + (NatTree.leaf 0x1c80000000000000000021b05fa000000000000000006a903a00392000000000000000000000000025700000000000000000411039f0005000000000000000000000000038800000000000000000257039e00050000000000000000000000000188000000000000000005fa039d000506980000021c00000000059e00000000011a011b000000000385039c059e000000000000000003ec000000000000021c000000000005039b08d0028c01dd0000000007a00000000000f300f400000000029b039a07a00000000000000000070e00800000000001dd0000028c03000399000000000000000004a90000079700000000000005bd06e703980005018c000000000000000001d4052500000000000000000876039702fa021b0000000000000000011800000000000000000000000000050396011800000000000000000119066e0000000000000000080c0395039401c80000000000000000021b049e0000000000000000066e039303920000000006c4000000000000011c021d04c20449000000000391039005f800000000000000000561000000000000021c000000000005038f0412000000000000000002580000000000000000000000000005038e)) + (NatTree.node 16 (NatTree.leaf 0x410025600000000000503b0000000000000000000000000000000000256038600000000000503af0000000000000000000000000000000005f9038700000000000503ae01180000000000000000011906500000000000000000080403ad039401c80000000000000000021b047e0000000000000000065003ac039200f1000000000000052200f2074400000000000007b808bf03ab02a80196000000000000000001db07db0000000000000000087003aa02a6000000000000000000f6000003b20657066f082400000000027d03a90000025a0000000000000000000000000824069c00000000000503a800000000000000000000000001170000000000000000021a03a700050000000000000000000000000000000007c407c600000000000503a600000000000000000000000001cf0000000000000000011703a50005000001c600000000000000000000000007c6049c00000000000503a4000000000000000000000000021a000000000000000001c603a3000506c30000021c0000000005cf00000000011a011b00000000038503a205cf00000000000000000448000000000000021c00000000000503a1) + (NatTree.node 16 (NatTree.leaf 0x2df00000000000000000385000000000000000000000000000503bf05f700000000000000000447000000000000000000000000000503be0000000000000000000000000000000007bd07be00000000000503bd000001c600000000000000000000000007be047c00000000000503bc0000000000000000025a0000047f081b08bd082f00000000032503bb00000193000000000000000000000000082f084500000000000503ba06fb0000000000000000075800000000000001dd00000000000503b9083c028c0000000000000361000000000000000000000000000503b8000000000000000000000000000000000219011600000000000503b707c30000000000000000057f000000000000000000000000000503b600000000000000000000000000000000011601ce00000000000503b507c70219000000000000049b000000000000000000000000000503b40000000000000000000000000000000000000219000000000005000501180000000000000000011906850000000000000000081903b3039401c80000000000000000021b04c30000000000000000068503b20392000001c600000000000000000000000007f105f900000000000503b1) + (NatTree.leaf 0x384000000000000000002de03cf000500000000000000000000000005410000000000000000076603ce000507bc00000000000000000560000000000000000000000000000503cd07bf0219000000000000047b000000000000000000000000000503cc08bc000000000000000006af000000000000028b00000000000503cb083301d900000000000006b0000000000000000000000000000503ca0196000000000000000001db08120000000000000000077303c902a6000000000000000002ba0000032e00000000000004a4081203c800050217000000000000000001cc000000000000000000000000000503c7000000000000000004de000002860000000000000795028503c6000501cc000000000000000001cd000000000000000000000000000503c500000000000000000446000004790000000000000684064e03c400050000000000000000000000000000000007d707d800000000000503c3000001c600000000000000000000000007d804c100000000000503c2080d021900000000000005f7000000000000000000000000000503c1040f000000000000000002df000000000000000000000000000503c0)))) + (NatTree.node 48 (NatTree.node 16 (NatTree.leaf 0x383000000000005000500000000000000000000000000000000076506c100000000000503e0000000000000000004bf000002860000000000000786028503df000500000000000000000446000004630000000000000684063703de000503080000000000000465028904fe000000000000074507c103dd0345000000000000000003d4000006ed000000000000060e074303dc0005000001930000000000000000000000000859081100000000000503db0000000000000000025a0000008105d4081104c400000000034103da000000000000000001ca000000000000000000000214000003d90005000000000000000000000000055f080b038202840000000003d803d700000000000000000000000001cb000000000000000001ca03d60005000000000000000001c600000287071f028406090000000003d503d407d60000000000000000059c000000000000000000000000000503d307d9021900000000000004c0000000000000000000000000000503d200000000000000000446000005e20000000000000684075703d10005000000000000000002de00000000000000000000040e000003d00005) + (NatTree.node 16 (NatTree.leaf 0x5400802038202840000000003ef03d7000000000000000001c600000287071f028405f40000000003d503d400000306000000000000000004e207c90877063b0000000002e303ee000000000000000001930000022306c8063b07da0000000002e003ed089901d90000000000000810000000000000000000000000000503ec081000000000000000000547000000000000028b00000000000503eb00000000000000000000000001c90212000000000000000003ea000502830000089b0000000000c000000000053e055e0000000003e903e80380000000000000000003eb000000000000000000000000000503e700000000000000000000000000000000000001c9000000000005000500000000071d0000000000000219000002b9032a0000000003e603e503eb000000000000000000ed000000000000021700000000000503e4000000000000000004fa00000286000000000000079e028503e30005000000000000000004460000049a0000000000000684066d03e20005000000000000000001c600000287071f028407650000000003d503d40000000000000000000000000383040d000000000000000003e10005) + (NatTree.leaf 0x283000008970000000000c000000000051b053f0000000004030402080e0360000000000000081a00000000000000000000000000050401081a000000000000000005e400000000000001d70000000000050400000000000000000003d400000806000000000000060e08b503ff0005030800000000000000000289060d0000000000000000087b03fe03450000000002b600000000000000000000011501c70000000003fd03fc08ab02b6000000000000059b000000000000000000000000000503fb059b000000000000000005ce00bf000000000000000002b603fa03f9000000000000000000000000057b0000000000000000062703f80005079e000000000000000002b8000000000000021700000000000503f702b8000000000000000004fa000000000000000000000000000503f601bf0000000000000000021400eb0000000000000000057b03f503f4000000000000000000000000057e0818038202840000000003f303d7000000000000000001c600000287071f028406280000000003d503d40000000004dd00000000000000000000025303810000000003f203f107630000000000000000047a000000000000000000000000000503f0))) + (NatTree.node 16 (NatTree.leaf 0x1930000022306c8025c08b80000000002e002df0000030600000000000000000000000008b80742000000000005041302b5000000000000000001c40000000000000000000000000005041201c4000000000000000001c5000000000000000000000000000504110000000000000000059a0000035d00000000000007f506f8041000050000000000000000000000000000000002b500ea000000000005040f00000000000000000000000006d80000000000000000071c040e000500000000000000000000000000000000035c06bf000000000005040d01bf0000000000000000021402b700000000000000000818040c03f4000000000000000000000000057e000000000000000002b7040b00050000028300000000000000000000000006bf0218000000000005040a000000000000000000000000021200000000000000000283040900050283000008a10000000000c000000000055d057d000000000408040704db000000000000000002dd0000000000000000000000000005040602dd0000000000000000037f00000000000000000000000000050405000000000000000004bf000000ec000000000000078600eb04040005) + (NatTree.node 16 (NatTree.leaf 0x2b4000000000000000000e80000000000000000000000000005042100000000000000000000000000000000037c07940000000000050420035a000000000000000004f90000000000000000000000000005041f0000028300000000000000000000000008a1055d000000000005040800000000000000000000000000000000055d057d000000000005041e06f902b600000000000002160000000000000000000000000005041d00000000000000000000000000000000000002b6000000000005000508ac02b600000000000005b60000000000000000000000000005041c05b6000000000000000005e100bf000000000000000002b603fa041b0000000000000000035b0000000000000000000004d90000041a0005000000000000000000000000037e0000000000000000035b0419000500000000000000000000000005400802025500e90000000003ef041808a802b6000000000000057c00000000000000000000000000050417057c000000000000000005b700bf000000000000000002b603fa041600000000000000000543000007b7000000000000060a070604150005018c000000000000000001d405e300000000000000000892041402fa) + (NatTree.leaf 0x608000000000000000003590430000505b6000000000000000005e10000000000000000000000000005041b00000000000000000301000001c200000000000004f90608042f0005000000000000000005b50000035d00000000000007fb06f8042e000500000000000000000000000006e50000000000000000072d042d0005000000000000000000000000040c04d80000000000000000042c0005000000000000000000000000000000000000040c00000000000500050252000000000000000001c10000000000000000000000000005042b0000000000000000057a0000035d00000000000007f006f8042a000500000000000000000000000006c000000000000000000705042900050000000000000000011d0000044a06c506ac083b00000000038204280000025a000000000000000000000000083b0708000000000005042708850360000000000000068600000000000000000000000000050426000000000000000002540000000000000000000002b400000425000500000000000000000000000001c3000000000000000002540424000500000000000000000283000004dc084d0761037c0000000004230422)))))) + (NatTree.node 176 (NatTree.node 80 (NatTree.node 32 (NatTree.node 16 (NatTree.leaf 0x283000000be062606070215000000000440043f00000000000000000283000004f708560761037c00000000043e042200000000000000000000000000000000037c079d00000000000504200000000006350000000000000000000002dc040b00000000043d043c00000000000000000000000003ea000000000000000004be043b000500000000000000000283000004bd08480761037c00000000043a042200000000000000000000000000000000037c07850000000000050420073f00000000000000000788000000000000021c0000000000050439084f028c00000000000003ae000000000000000000000000000504380000000000000000074e000000c6000000000000088f00c504370005000000000000000000000000025102b3000000000000000004360005000000000000000000000000000000000000025100000000000500050324000008a00000000000bd02b6000004bc0579000000000435043407600000000000000000037b00000000000002b5000000000005043300000000000000000000000000e7000000000000000002b304320005037b0000000000000000049900000000000000000000000000050431) + (NatTree.leaf 0x6060000000000000000021300000000000002b500000000000504540324000008a40000000000bd02b6000004da059900000000045304520634000000000000000004090000000000000000000000000005045104090000000000000000040a0000000000000000000000000005045000000000000000000000000000000000025004f8000000000005044f03240000089a0000000000bd02b600000498055c00000000044e044d01c80000000000000000021b082d000000000000000007b0044c0392000000000000000002ba0000038900000000000004a4082d044b00050000000000000000011d0000070a08bb01d800c400000000044a031c00000000037a000000000000000000000187024f0000000004430449085f037a00000000000005b300000000000002b5000000000005044805b30000000000000000064c00bc0000000000000000037a044704460326000000000000000002b403ac0000000000000000075f0445044400000000000000000000000000000000037a01870000000000050443000000000000000000000000053d000000000000000003ac044200050000000000000000000000000000000003e906070000000000050441)) + (NatTree.node 16 (NatTree.leaf 0x24e0000000000000000037d000000000000000000000000000504650855037a000000000000059800000000000002b5000000000005046405980000000000000000063600bc0000000000000000037a04470463000001c60000000000000000000000000875082c00000000000504620000000000000000025a0000008105d4082c04fc0000000003410461025a000008d1000000000082011c021d072e0707000000000460045f03290000000000000000024d0000000000000000000000000005045e0326000000000000055a02b4024c00000000000006330623045d044400000000000000000000000000000000037900bb000000000005045c00000000000000000000000006be00000000000000000697045b0005000003240000000000000000000000000839055b000000000005045a00000000000000000000000002b300000000000000000324045900050379000000000000000003290000000000000000000000000005045800000000000000000000000000000000055b05cd00000000000504570577000000000000000006060000000000000000000000000005045600000000062500000000000002b60000025001c0000000000455044f) + (NatTree.node 16 (NatTree.leaf 0x7c800000000000000000740008000000000021c0000028c03000475000000000000000000000000024b00000000000000000328047400050000032400000000015b0000044006d60784030000000000047304720378000000000000000000ba00000000000000000000000000050471000000000000000000000000000000000300075400000000000504700783037a000000000000076f0000000000000000000000000005046f000000000000000000000000000000000000037a0000000000050005000000000000000003280000000000000000000003780000046e0005076f000000000000000005cb0000000000000000000000000005046d000000000000000000000000060500000000000000000755046c000506240000000000000000024e00000000000002b5000000000005046b0326000000000000000002b4021100000000000000000605046a04440865037a00000000000005cc00000000000002b5000000000005046905cc0000000000000000066b00bc0000000000000000037a044704680000000000000000055a00000000000000000000063300000467000500000000000000000000000004080000000000000000055a04660005) + (NatTree.leaf 0x5b200000597000000000000064a0322048200050000000000000000000000000327043d00000000000000000481000500000000000000000000000005ca000000000000000007fa04800005000000000000000000000000000000000000076e00000000000500050326000000000000000002b4024c00000000000000000623047f044400000324000000000000000000000000076e02dc000000000005047e0326000000000000057602b4024c000000000000064a0623047d044400000000000000000000000006d7000000000000000006a6047c00050000000000000000015b0000044006d60000000000000000047300050000000000000000000000000000000000000559000000000005000500000000000000000000000004450000000000000000024c047b00050326000000000000053c02b4024c00000000000006220623047a044400000000000000000000000006a7000000000000000006830479000508ad0219000000000000082b00000000000000000000000000050478082b0000000000000000059d000000000000028b000000000005047708d2028c021c0000000007c800000000011a011b0000000003850476)))) + (NatTree.node 48 (NatTree.node 16 (NatTree.leaf 0x3240000000000000000000000000784030000000000000504720634037a0000000000000409000000000000000000000000000504510000032400000000015b0000046206e30784030000000000048d0472000000000000000000000000000000000300075e0000000000050470000000000000000000000000000000000300044400000000000504700000032400000000015b0000041706bd0784030000000000048c0472000000000000000000000000000000000300074b00000000000504700000000000000000044600000823000000000000068408ba048b0005030800000000000000000289064f0000000000000000088e048a0345011800000000000005220119077200000000000007b808c80489039401c80000000000000000021b07f70000000000000000087a04880392000000000000000000000000000000000000032700000000000500050000000006d5000000000000015a024a04d6043f0000000004870486064b037a00000000000004420000000000000000000000000005048500000000000000000000000000b90000000000000000043d0484000504420000000000000000044300000000000000000000000000050483) + (NatTree.node 16 (NatTree.leaf 0x28100000000000000000323000000000000000000000000000504a00595000000000000000001be0000000000000000000000000005049f0000000006e2000000000000015a024a04f6046100000000049e049d0000000006bc000000000000015a024a04ba041600000000049c049b000000000000000001c600000287071f028408c10000000003d503d40000030600000000000000000000000008c10796000000000005049a0000000000000000025a0000047f081b08c708610000000003250499000001c600000000000000000000000008610858000000000005049806d4000002490000000005e00000000001580159000000000497049605e00000000000000000043e000000000000024900000000000504950000000000000000057600000000000000000000064a00000494000500000000000000000000000000000000043c02820000000000050490000000000000000000000000044100000000000000000576049300050000000000000000015b0000049706f705570596000000000492049100000000043c0000000000000000000002820325000000000490048f00000000000000000000000000000000059606a5000000000005048e) + (NatTree.leaf 0x1bd0000000000000000062104b1000506e1000002490000000005f3000000000158015900000000049704b005f300000000000000000460000000000000024900000000000504af06bb000002490000000005c9000000000158015900000000049704ae05c900000000000000000415000000000000024900000000000504ad0898036000000000000006c2000000000000000000000000000504ac08c6000000000000000006ec000000000000028b00000000000504ab0862021900000000000006e6000000000000000000000000000504aa024800000000000000000156000000000000000000000000000504a901560000000000000000015706960000000000000000082004a804a7020c0000000000000000024804bb0000000000000000069604a604a50000000000000000015b0000046206e30000000000000000048d0005000000000000000000000000000000000000057500000000000500050000000006f5000000000000015a024a053b04960000000004a404a3063200000000000000000595000000000000024900000000000504a2043b00000000000000000281000000000000000000000000000504a1))) + (NatTree.node 16 (NatTree.leaf 0x20c0000000000000000024804d7000000000000000006a404c004a501560000000000000000015706820000000000000000081704bf04a7020c00000000000000000248049e0000000000000000068204be04a500000000000000000771000000ec00000000000008a200eb04bd0005030800000000000004de0289051c000000000000079507c504bc034500000000000000000446000007200000000000000684078704bb000500000000000000000000000001550000000000000000024704ba00050000000000000000000000000000000007c407e500000000000503a600000000000000000000000002100000000000000000015504b900050000020900000000000000000000000007e504b900000000000504b800000000000000000000000002470000000000000000020904b7000506f40000024900000000061f000000000158015900000000049704b6061f00000000000000000495000000000000024900000000000504b5020c000000000000000002480621000000000000000006e004b404a500000000000000000000000002800000000000000000043a04b3000500000000000000000000000003ab0000000000000000028004b20005) + (NatTree.node 16 (NatTree.leaf 0x7c407d300000000000503a60000020900000000000000000000000007d3049c00000000000504ce0000000000000000011d0000073e08c5025500e90000000004cd0418000003060000000000000000055f080b087e064d0000000003d804cc000000000000000001c600000287071f064d08030000000003d504cb000000000000000000000000000000000246015400000000000504ca000000000000000000000000000000000154020f00000000000504c907d4024600000000000004b8000000000000000000000000000504c80000000000000000000000000000000000000246000000000005000501560000000000000000015706d30000000000000000083804c704a7020c000000000000000002480519000000000000000006d304c604a50000020900000000000000000000000007ff062000000000000504c5000000000000000000000000000000000439027f00000000000504c400000000000000000000000000000000027f03aa00000000000504c300000000000000000000000000000000062003c700000000000504c201560000000000000000015706a40000000000000000082804c104a7) + (NatTree.leaf 0x7e6024600000000000004d4000000000000000000000000000504de07c70246000000000000049b000000000000000000000000000503b40283000008d30000000000c0011c021d0764073d0000000004dd04dc08220360000000000000082a000000000000000000000000000504db082a000000000000000005f6000000000000021700000000000504da02450000000000000000020d000000000000000000000000000504d9020d0000000000000000020e000000000000000000000000000504d80000000000000000045f000004790000000000000694064e04d700050000000000000000000000000000000007ed07f900000000000504d60000020900000000000000000000000007f9051800000000000504d5081f0246000000000000061e000000000000000000000000000504d40438000000000000000002ff000000000000000000000000000504d302ff000000000000000003a9000000000000000000000000000504d2061e00000000000000000478000000000000000000000000000504d10000000000000000000000000000000007d207ee00000000000504d00000020900000000000000000000000007ee04d500000000000504cf))))) + (NatTree.node 96 (NatTree.node 48 (NatTree.node 16 (NatTree.leaf 0x4de000002b1000000000000079c028504ee000500000000000000000477000004790000000000000694066804ed000508d502b6021c0000000007f600000000011a011b00000000038504ec07f60000000000000000077000bf00000000021c000002b603fa04eb00000000000000000543000007d5000000000000060a074c04ea000501bf0000000000000000021405f50000000000000000089c04e903f40000000000000000020a000000000000000000000244000004e80005000000000000000000000000020b0000000000000000020a04e700050000000000000000020900000287072b028406090000000004e603d407ec000000000000000005c8000000000000000000000000000504e507f402460000000000000517000000000000000000000000000504e400000000000000000477000005e20000000000000694075b04e30005000000000000000002de000000120000000000000437000004e200050000000000000000001800000384000000000000000002fe04e1000500000000000000000000000005740000000000000000077f04e0000507d100000000000000000594000000000000000000000000000504df) + (NatTree.node 16 (NatTree.leaf 0xc00000000000000000000000000000000000d00000000000504ff000000000000000000000000055f081603a802b00000000004fe04fd00000000000000000209000002b2073b02b006090000000004f404f30118000000000000057a0119079f00000000000007f008cd04fc039401c80000000000000000021b08210000000000000000089104fb03920000000000000000011d0000044a06c506d9084e00000000038204fa00000283000000000000000000000000084e071e00000000000504f900000000000000000000000002080243000000000000000004f800050000000000000000000000000000000000000208000000000005000500000000072a0000000000000246000002b9032a0000000004f703e500000000000000000516000002b100000000000007b5028504f6000500000000000000000477000004b70000000000000694069304f5000500000000000000000209000002b2073b02b007650000000004f404f300000000000000000000000003830436000e000f0000000004f204f100000000000000000000000000170010000f03830000000004f004ef00000000000000000000000000000000076506df00000000000503e0) + (NatTree.leaf 0x80000000000000000000a0000000000000000000000090514051302af0000089d0000000000e600000000053e055e000000000512051103a7000000000000000004070000000000000000000000000005051000000000000000000283000004bd084808cc086d00000000043a050f000001c6000000000000000000000000086d0872000000000005050e0756000000000000000007af000000000000021c000000000005050d086a02b600000000000003c90000000000000000000000000005050c0000000002d8000000000000000000000153020700000000050b050a07ac000000000000000002b8000000000000024500000000000505090000000000000000000000000593082703a802b000000000050804fd00000000000000000209000002b2073b02b006310000000004f404f300000000073a0000000000000246000002db035800000000050705060407000000000000000000ed000000000000024500000000000505050006000004f500000000000b00000000025303810000000005040503000b0000000000000000000c0000000000000000000000000005050200000000000d00000000000000000000001500160000000005010500))) + (NatTree.node 16 (NatTree.leaf 0x8cb0000000000000000071b00000000000002b50000000000050525086c0219000000000000072c0000000000000000000000000005052401c80000000000000000021b0844000000000000000007bb0523039200000000000000000301000003ad00000000000004f908440522000502d700000000000000000205000000000000000000000000000505210205000000000000000002060000000000000000000000000005052002030000000000000000024402b70000000000000000081e051f051902af000008a60000000000e6000000000573059200000000051e051d07b5000000000000000002da0000000000000245000000000005051c02da000000000000000005160000000000000000000000000005051b02030000000000000000024400eb00000000000000000591051a051904db000500000000000002dd0000000000000000000000000005040602dd0000000000000008037f0000000000000000000000050518040500000000000000000000000000090000000000000000000805170005000a000000000000000000130000000000000000000000000005051600130000000000000000001400000000000000000000000000050515) + (NatTree.node 16 (NatTree.leaf 0x2af00000000000000000000000008a3055d000000000005053408b102d800000000000005c70000000000000000000000000005053305c7000000000000000805f200bf000000000000000002d80527053202030000000000000000024402d900000000000000000827053105190000000000000000000000000593000000000000000002d905300005000002af00000000000000000000000006d20218000000000005052f0000000000000000000000000243000000000000000002af052e0005000000000000000000060000000000050004000000000000052d052c00000000000000000000000000000000000000060000000000050005000000000000000000000000001100000000000000000007052b0005000000000000000000000000001200000000000000000011052a0005000000060000000000000000000000000006000000000000000505290000000000000000000000000007000000000000000000060528000508ab02d8000000000000059b000000000000000000000000000503fb059b000000000000000805ce00bf000000000000000002d8052703f900000000000000000000000005910000000000000000063005260005) + (NatTree.leaf 0x6f902d800000000000002160000000000000000000000000005041d00000000000000000000000000000000000002d80000000000050005000000000004000000000000000500000000000000000000052c00050003000000000000000000000000000000000004000000000005053d000000000000000000000000000000000005000e000000000005053c00000000000000000000000000000000000e000f00000000000504f100000005000000000000000000000000000000000000000000050005000000000000000000000000000000000000000500000000000500050000000000000000000600000000000502d700ea00000000052d053b00000000000000000000000000000000035c06d2000000000005040d032600000000000004de02b4057800000000000007950801053a04440000000000000000044600000762000000000000068407ae05390005000001c6000000000000000000000000087d0843000000000005053800000000000000000283000000be06260843051a00000000044005370000000000000000027e0000000000000000000002d600000536000500000000000000000000000002040000000000000000027e05350005)))) + (NatTree.node 48 (NatTree.node 16 (NatTree.leaf 0x37c07ab000000000005042005c7000000000000000005f2000000000000000000000000000505320001000000000000000000030000000000000000000000020549054800040000000000000000000b0000000000000000000000000005054702d6000000000000000000e800000000000000040000000000050546000003240000000000000000055f080b089406a80000000003d80545000000000000000001c600000287071f06a808310000000003d5054408b402190000000000000842000000000000000000000000000505430842000000000000000005b400000000000002b50000000000050542000000000000000000060000025102fd00040000000000000541052c000000000000000000000000000000000000027d000000000005000508ac02d800000000000005b60000000000000000000000000005041c000000000000000005c60000035d00000000000007fe06f80540000500000000000000000000000006eb00000000000000000739053f0005000002af00000000000000000000000008a60573000000000005051e0000000000000000000000000000000005730592000000000005053e) + (NatTree.node 16 (NatTree.leaf 0x1c600000287071f028408c30000000003d503d40000032400000000000000000000000008c307ad000000000005055a03a6000100000000000003290000000000000004000000000005055903290000000000000000024d0002000000000000000000010554045e0356000008aa0000000000e502d8000004da05990000000005580557076c0000000000000000037b00000000000002d7000000000005055600000001000000000000000000000000000100000000000000050555000000000000000000000000000200000000000000000001055400050000000000000000000800000000000000000000000300000553000500010000000000000000000300e7000000000000000002d5055205480847037a00000000000008570000000000000000000000000005055108570000000000000000066a00000000000002170000000000050550000000000000000004460000083a000000000000068408c0054f00050326000000000000000002b4066c00000000000000000896054e04440001000003c6000000000003000500000187024f00000000054d054c000000000000000002af000004f70864076d037c00000000054b054a) + (NatTree.leaf 0x2d5000000000000000003560568000500010000002300000000000300050000000000000000000005670548037900010000000000000329000000000000000000000000000504580000000000000000015b0000049706f706f608600000000004920566000002830000000000000000000000000860075d0000000000050565089f037a00000000000006e40000000000000000000000000005056400010000000000000328000300000000000000000378000205630548086903a500000000000005cc00000000000002d7000000000005056205cc0000000000000000066b00e4000000000000000003a5056104680357000000000000000002d603ac0000000000000000076b0560055f0000000100000000000000000000000000000000000000000005000500000000000000000000000000000000000000010000000000050005000000000000000000060000000000240004000000000000055e052c0000000100000000000000000000000003a50187000000000005055d000000000000000005b2000007ef000000000000064a075c055c000501bf000000000000000002140669000000000000000008b2055b03f4))) + (NatTree.node 16 (NatTree.leaf 0x283000008d40000000000c0015a024a078107490000000005730572064b03a5000000000000044200000000000000000000000000050485020c00000000000000000248084c000000000000000007e7057104a500000000000000000301000003c800000000000004f9084c057000050000000000000000015b0000074a08c9025500e900000000056f04180000035600000000015b0000046206e30792030000000000048d056e078303a5000000000000076f0000000000000000000000000005046f00000000000000000000000000000000000003a500000000000500050003000100000000000000000000000000000004000000000005053d0780000000000000000007ba0000000000000249000000000005056d086f02b600000000000003e80000000000000000000000000005056c00000000000000000793000000ec00000000000008a700eb056b00050000000100000000000000000327043d0001000000000000048105550357000000000000057602d6024c000000000000064a062f056a055f00000000000000000000000000000000037900e3000000000005045c000003560000000000000000000000000841055b0000000000050569) + (NatTree.node 16 (NatTree.leaf 0x45f00000762000000000000069407ae05800005086e0246000000000000073c0000000000000000000000000005057f00000000000000000209000002b2073b02b008c30000000004f404f30000032400000000000000000000000008c307b9000000000005055a00000000000000000283000004bd084808cc087100000000043a050f0000020900000000000000000000000008710874000000000005057e000000000000000004770000083a000000000000069408c2057d00050326000000000000000002b406950000000000000000089e057c04440156000000000000057a015707b600000000000007f008ce057b04a7020c00000000000000000248082900000000000000000895057a04a508b60246000000000000084a00000000000000000000000000050579084a000000000000000005df00000000000002b5000000000005057808d602b602490000000008000000000001580159000000000497057708000000000000000000078200bf000000000249000002b603fa057600000209000000000000000000000000088c084b000000000005057500000000000000000283000000be0626084b05580000000004400574) + (NatTree.leaf 0x20900000287072b06a808310000000004e60544)))))))) +def right_tree : NatTree := (NatTree.node 1536 (NatTree.node 768 (NatTree.node 256 (NatTree.leaf 0x8d0003008c0003008b0003008a00890003008800030087008600030085000300840003000300830082000300810003007a00800003007f0003007e0078007d007c0003007b0003007a000300030079007800770076000300750003000300740073007200710070006f0003006e0003006d0003006c006b006a0003000300690068006700660003006000030003000300030065004e006400030063006200030003006100600003005f0003005e0003005d0003005c0003005b005a005900030058000300570003005600030055000300030054004e00530003005200510003005000030003004f004e004d0003004c004b004a0049000300480003000300470046004500440043004200030003004100400003003f0003003e0003002d00030003003d003c000300030003003b0003003a00030039000300380003003700030036000300350003000300340003003300030032000300310030002f0003002e00030003002d0003002c0003002b0003002a0029002800030027000300260003002500030024000300230003002200030003000300210003000300200003001f0003001e001d001c001b00030003001a00190018001700160003001500140013001200030011000300100003000f0003000e0003000d00030003000c0003000b0003000a00090008000700060005000300030003000400030003000200010000) + (NatTree.node 256 (NatTree.leaf 0x10d0003010c0003010b000301050003010a000301090003010801070106000301050104010301020101000301000003000300ff00fc00fe000300fd00fc00fb00fa000300f9000300030003000300f800f700f600f50003000300f400f300f200f100f0000300ef00ee000300ed000300ec00eb000300ea00e9000300e8000300e7000300e60003000300e5000300e400e3000300e2000300e1000300e0000300df000300de000300dd000300dc000300db000300da0003000300d9000300d800c700b9000300d7000300d600d5000300d40003000300d3000300d20003000300d1000300d0000300ab00cf00ab000300ce000300cd0003000300cc00af00cb0091000300ca000300ab00a900c9000300c8000300c7000300c6000300c5000300c4000300a9000300c3000300c2000300c100c000bf000300af00b700be000300bd000300bc00030003000300bb0003000300ba000300b9000300b900b800b700b60003000300b500af00b400b3000300910003000300b200a900b1000300b000af00ae00ad0003000300ac00ab00aa00a900a8000300a700a600a500a4000300a3000300a2000300a1000300a0009f00030080008e007f0003009e00910003009d009c009b0003009a0003009900030091000300030098007800970096000300950003009400030093009200910003009000030003007f008f0003008e0003) + (NatTree.leaf 0x17e000301940003019300030185019200030191018e01900003018f018e018d018c0003016d018b018a0003000301890003018801870186018501840183000300030182018101800003017f017e016a016f0003017d0003017c0003017b017a0179017801770003017601490003014700030175017400030173017200030149015e01470171000300030170016f0003015d0003016e0003016d016c016b00030003016a013200030169000301680003015d00030003014701670003015d000300030166016501640163012b01620003016100030160015f015e0003015d0003015c0003015b0003015a0003015900030003015801570003015600030003015501540003015300030152000301510003014a000301500003014f014e014d00030003014c014b0003014a014901480147000301460003014501440003014300030142000300030141014000030003013f013b013e013d00030003013c013b013a010e000301390003013800030137000300030136013501340133000301320131013000030003012f012e0003012d0003012c012b0003012a01290128012700030126000300030125012400fe0123012201210003012000030003011f011e0003011d00030003011c011b0003011a0003011900030111000300030118000301170116011501140003000301130112000301110003011000030003010f010e0003))) + (NatTree.node 256 (NatTree.leaf 0x2100003020f020e0003020d0208020c020b000301e6019b020a000300030209020802070003020602050003020402030202020100030200000301ff01fd01fe01fd01fc01fb000301b301fa000301f901f801f701f60003000301f501f4000301f3000301f1000301f2000301f1000301e601d401f0000301e9000301ef000301e90003000301ee01ed000301ec000301c2000301eb000301ea000301e9000301e8000301e7000301e6000301e5000301e4000301c301e301e2000301e1000301e0000301df000301de000301dd019901dc000301db000301da0003000301d901d80003000301d701b2019b000301d6000301d5000301d4000301d301d2000301c20003000301d1000301d0000301cf000301ce01cd000301ac019d01ab019b018501cc000301cb000301ca000301c90003019d01c80003000301c701c6000301b301c501b3000301c4000301c301c201c1000301c0019501bf000301be000301bd000301bc000301bb0003000301ba01b901b801b7000301b6017a01b5000301b4000301b3018501b2000301b1000301b0000301af000301ae00030185000301ad000301ac000301ab0003018101aa000301a9018e019901a8000301a7000301a60003019e000301a5000301a401a301a2016a01a1000301a00003019f0003019e019d019c019b0003019b019a019900030003019800030003019701960195) + (NatTree.node 256 (NatTree.leaf 0x29500030003029402930003027e0003029200030291000302900003028f0003027e000300030267028e0003028d028c0003028b028a00030289000302880003027e00030003028702860285028402830282000302810280027f0003027e0003027d0003027c0003027b00030003027a0003027902780003026a00030277000302760003027500030274000302730003000302720003027102700003026f0267026e026d026c0003026b0003026a026902680267000302660003026502640003026300030003026202610260025f00030003025e025d0003025c0003025b0003025a024a00030259025402580257000302560003022000030003025502540253025200030251024d02500003024f0003022a0003024e024d0003024c024b024a00030249000302120248000302470003024602450244000302250212000302430213024202410240023f0003023e00030003023d0003023c023b0003023a000302390003023800030237000302020236000302350234000302330003022b000300030232020f02310230022f022e00030003022d022c0003022b0003022a000300030229022800030227000302260003021b0003022500030224000302230003021b0222022002120221000302200215021f021e021d0003021c0003021b021a0219021502180003021700030003021602130215000302140213021202110003) + (NatTree.leaf 0x3100003030f0003030e0003030d0003030c0003030b0003030a0003030900030308000302e60307000303060305000303040003030300030302000302c80003030100030003030002ff0003000302fe02d702c0000302fd000302fc000302fb000302fa000302f9000302f8000302f702f6000302e5000302f50003000302f4000302f302f2000302ce02c202cd02c0000302f102b902f0000302ef000302c202ee0003000302ed02ec000302d802eb02d8000302ea000302e9000302e8000302e7000302e602e502e4000302e302b502e2000302e1000302e0000302df0003000302de02dd02dc02db02da02d9000302d802aa02d7000302d6000302d5000302d4000302d3000302aa000302d2000302b902be02d1000302c3000302d0000302cf000302ce000302cd000302b202cc000302cb000302ca02c9000302c802c002c702c602c5000302c4000302c302c202c102c0000302c002bf02be0003000302bd0003000302bc02aa02bb000302ba02b902b8000302b702b602b5029f000302b4000302b3000302b202a1000302b102ac02b002af000302ae0003026f0003000302ad02ac02ab02aa02a902a80003000302a702a602a30293000302a5000302a402a302a202a1000302a0029f028b029e0003025a0003029d0003029c029b029a0003027402690003026700030299026102980297029600030269027f0267)))) + (NatTree.node 768 (NatTree.node 256 (NatTree.leaf 0x3039700030396039500030394000300030393038f03920391000300030390038f038e0003038d038c038b038a03860389000303880003038703860003038503810384038300030003038203810380037f0003037e037a037d0003037c000303570003037b037a00030379037803770376037503740003000303730003034c03720003037100030370036f036e0003036d036c036b0003036a0003000303690003036803670003036600030365000303640003036300030362000303610003033703600003035f035e000303500003035d0003035800030003035c035b00030003035a0359000303580003035700030003035603550003035400030353000303470003034a0003034a034c03520003034703510350034c034f0003034e00030003034d033f034c034b0003034a034103490327034800030347034603450341034400030343000300030342033f034100030340033f033e033b033d0003033c033b033a03390003033800030337033600030335033103340333000300030332033103300003032f032e0003032d032c032b032a03230329032803270003032600030325032400030323032203210003000302f40320031f031e00030003031d031c0003031b0003031a00030310000303190003031700030318000303170003030a02f803160003031500030310000300030314031300030312000303110003) + (NatTree.node 256 (NatTree.leaf 0x4140003041300030403000304020003041200030411000300030410040f0003040e03db040d0003040c0003040b0003040a00030409000303db00030408000303eb03f204070003040600030405000303f7000303fa000304040003040303f6040203f403e5040100030400000303ff000303fe03fd03fc03fb000303fa03f403f903d003f8000303f703f603f503f4000303f403f303f20003000303f10003000303f003db03ef000303ee03eb03ed000303ec03eb03ea000303e903e803e703ce000303e6000303e503e203e4000303e303e2000303e103dd03e003df0003000303de03dd03dc03db03da03d90003000303d803d703d403c3000303d6000303d503d403d303d203d103d0000303cf03ce03b903cd000303cc0003038a000303cb000303ca03c903c8000303c703c60003039a03b1039803c50003000303c403c3000303b0000303c2000303c1000303c0000303bf000303b000030003039803be000303bd000303bc03bb03ba0003000303b903b8000303b7000303a5000303b6000303b00003000303b503b4000303b303b203b1000303b0000303af000303ae000303ad0003000303ac000303ab03aa000303a9000303a8000303a70003039b0003039e000303a6000303a5039a00030398000303a403a30003000303a2000303a103a00003039f0003039e0398039d0375039c0003039b039a03990398) + (NatTree.leaf 0x4900003048f00030466048e0003048d048c0003047e0003048b00030003048a04890003000304880487000304860003048500030003048404830003048200030481000304760003047900030479047a048000030476047f047e047a047d0003047c00030003047b046e047a0479047004780457047700030476047504740470047300030472000300030471046e04700003046f046e046d046a046c0003046b046a0469046800030467000304660465046104640463000300030462046104600003045f045e0003045d045c045b045a0451045904580457000304560003045504540003045104530452000304510450044f00030003044e044d0003044c0003044b000304420003044a0003044800030449000304480003043c042b044700030446000304420003000304450444000304430003044200030441000304400003043f0003043e0003043d0003043c0003043b0003043a000304190439000304380003042d04370003043600030435000304340003000304330432000300030431040d03f4000304300003042f0003042e000304260003042d0003042c0003042b0003042a0429000304280003041800030427000300030426000304250424000300030423000303f6042200030003042104200003040e041f040e0003041e0003041d0003041c0003041b0003041a00030419041804170003041603fc04150003))) + (NatTree.node 512 (NatTree.node 256 (NatTree.leaf 0x50400030003051c051b051a0003051905180517051600030515000305140003051305100512000305110510050f050e0003050d050c050b050a0003050905080507000300030506050505010504000305030003050205010003050004ff000304fe04fd04fc04fb000304fa04f904f804f7000304f6000304b6000304f5000304f404c604f304f2000304c604f104c404f00003000304ef04ee000304e9000304ed000304ec000304eb000304ea000304e90003000304e804e7000304e6000304e504e404e30003000304e204e1000304e0000304cf000304df04b704de000304dd04dc04db000304da000304d9000304d8000304d70003000304d6000304d504d4000304d3000304d2000304d1000304c7000304c5000304d0000304cf04c6000304c4000304ce04cd0003000304cc000304cb04ca000304c1000304a304c904c8000304c704c604c504c4000304c3000304c204c1000304c00003000304bf04bb04be04bd0003000304bc04bb04ba000304b904b804b704b604b204b5000304b4000304b304b204b1000304b00003000304af04ae04ad04ac000304ab04a704aa000304a900030485000304a804a7000304a604a504a404a304a204a10003000304a00003047a049f0003049e00030003049d049c0003049b049a049900030498000300030497000304960495000304940003049300030492000304910003) + (NatTree.leaf 0x3058f042200030003058e058d0003058c000304420003058b0003058a000305890003054e05880587056300030586058500030584000305830003058200030442000305810003057e052805800003057f0003057e0003057d0003057c0003057b0003057a000305790003057800030577000305760003054e0575057400030003057300030572000305650571000300030570056f00030003056e0545056d0003056c056b05280003056a056900030003056800030567000305660003055c000305650003056400030563056203fc0561000305600003055f0003055e0003055d00030003055c0003052a00030528055b00030003055a0559000305580003055700030545055605550003000305540553000305090003055200030551000305500003054f0003054e054d0513054c054b03fc0003054a0549000305480003054700030535000304f90003054600030545054405430003054200030541000305400524053f0003053e0003053d0003053c0003053b0003053a0003051b052405390003053800030003000305370003052b000305290003053600030535052a0402052805340003051305330532000300030531000305300003052f052e03fc0003052d04f904e2052c0003052b052a0529052805090527000305260525052400030003052300030003052200030521050905200003051f051b051e051d0003)) + (NatTree.node 256 (NatTree.leaf 0x60b000306030003060a04c606090003000306080003060706060003060505c006040003060304c606020003060100030600000305fe04be05ff0003000305e105fe04ba05fd04b704b605f705fc000305fb000305fa0003000305f905ab05f804b305f7000305c005f604ad04ab05f205f5000305f4000305f3000304a805f2000305f105cf000305f0000304a505ef04a305ee05ed0003000305ec05eb000305ea05c005e9000305e8000305e7000305ab05e6049b05e505e40003000305e3000305e2000305e105e0000305df000305de000305dd05b805dc000305db000305da000305d90003000305d805ab05d705d6000305d5000305d4000305c6000305d3000305d2000305d1000305d0000305cf000305ce000305cd000305cc0003000305cb05a305ca05c9000305bc000305bc05c005c80003047605c705c605c005c5000305c40003000305c3000305c2000305c1046e05c005bf000305be0003047605bd05bc05b805bb000305ba05b8000305b9046e05b805b7000305b60003000305b5046e05b405b105b3000305b205b105b005af000305ae000305ad000305ac000305ab05aa000305a9000305a805a705a6000305a505a305a405a305a205a1000305a00003059f059e0594059d059c059b0003059a00030599059805630448000305970003059600030595000305940593059200030591000305900003) + (NatTree.leaf 0x63e0003000305c2063e05630003058e0003064805ad000306470003054e0646057f0003064500030644000306430563064200030641000306400528063f0003063e0528054e063d0003063c063b03fc0545063a000306390545063806370003063600030513063506340003063300030632000306100003063103fc06300003062f0003062e0524062d0003062c0524062b00030513062a000306290628000305090627000306260509062500030624061f000306230003062200030003062106200003061f0003061e0003061d0003061c0003061b04f8061a00030619000300030607061804c40617000306160003061500030003061404e5061300030612061100030605000305fb000306100003060a000304dd060f0003060e0003060d0003060c))))) +def rpre_tree : NatTree := (NatTree.node 1600 (NatTree.node 768 (NatTree.node 384 (NatTree.node 192 (NatTree.node 64 (NatTree.leaf 0x1900000000000000000000000000000000000000001800000000000000000001700000000000000000000000000000000000000000000000000000000000001700000000000000000001600000000000000000000000000000000000000000000000000000000000001500000000000000000001400000000000000000000000000000000000000000000000000000000000001400000000000000000001300000000000000000000000000000000000000000000000000000000000001300000000000000000000000000000000000000001200000000000000000001100000000000000000000000000000000000000000000000000000000000001100000000000000000001000000000000000000000000000000000000000000f00000000000000000000000000000000000000000e00000000000000000000000000000000000000000d00000000000000000000000000000000000000000c00000000000000000000000000000000000000000b00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000009000000000000000000000000000000000000000008000000000000000000007000000000000000000000000000000000000000000000000000000000000007000000000000000000006000000000000000000000000000000000000000000000000000000000000006000000000000000000005000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000001000000000000000000000000000000000000000000000000000000000000001) + (NatTree.node 64 (NatTree.leaf 0x3b00000000000000000000000000000000000000003a00000000000000000000000000000000000000000000000000000000000003800000000000000000003700000000000000000000000000000000000000003500000000000000000000000000000000000000003400000000000000000000000000000000000000003300000000000000000000000000000000000000003200000000000000000000000000000000000000003100000000000000000000000000000000000000003000000000000000000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000002d00000000000000000000000000000000000000002c00000000000000000000000000000000000000002b00000000000000000002a00000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000002900000000000000003902700000000000000000000000000000000000000002600000000000000000000000000000000000000002500000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000002400000000000000000002300000000000000000000000000000000000000002200000000000000000000000000000000000000002100000000000000000000000000000000000000002000000000000000000000000000000000000000001f00000000000000000000000000000000000000001e00000000000000000000000000000000000000001d00000000000000000000000000000000000000001b00000000000000000000000000000000000000000000000000000000000001a) + (NatTree.leaf 0x5600000000000000000000000000000000000000005500000000000000000000000000000000000000005400000000000000000000000000000000000000005300000000000000000000000000000000000000005200000000000000000000000000000000000000000000000000000000000005200000000000000000005100000000000000000000000000000000000000005000000000000000000000000000000000000000004f00000000000000000000000000000000000000004e00000000000000000000000000000000000000004d00000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000004b00000000000000000000000000000000000000004a00000000000000000004900000000000000000000000000000000000000004800000000000000000000000000000000000000000000000000000000000004700000000000005b04b04600000000000000000000000000000000000000000000000000000000000004600000000000000000000000000000000000000004500000000000000000004400000000000000000000000000000000000000000000000000000000000004400000000000000000004300000000000000000000000000000000000000004200000000000000000000000000000000000000000000000000000000000004100000000000000000004000000000000000000000000000000000000000000000000000000000000004000000000000000000003f00000000000000000000000000000000000000000000000000000000000003f00000000000000000003e00000000000000000000000000000000000000000000000000000000000003d00000000000000000003c000000000000000000000))) + (NatTree.node 64 (NatTree.leaf 0x9308307300000000000000000000000000000000000000007200000000000000000000000000000000000000007100000000000000000007000000000000000000000000000000000000000006f00000000000000000000000000000000000007406e00000000000000000000000000000000000000000000000000000000000006d00000000000008a07106c00000000000000000000000000000000000000000000000000000000000006c00000000000000000006b00000000000000000000000000000000000000006a00000000000000000000000000000000000000000000000000000000000006900000000000000000006800000000000000000000000000000000000000000000000000000000000006800000000000000000006700000000000000000000000000000000000000000000000000000000000006700000000000000000006600000000000000000000000000000000000000006500000000000000000000000000000000000000006400000000000000000000000000000000000000006300000000000000000000000000000000000000000000000000000000000006300000000000000000006200000000000000000000000000000000000000000000000000000000000006100000000000000000006000000000000000000000000000000000000000000000000000000000000006000000000000000000005f00000000000000000000000000000000000000000000000000000000000005c00000000000000000000000000000000000000005b00000000000000000000000000000000000000005a00000000000000000005900000000000000000000000000000000000000000000000000000000000005800000000000000005e057000000000000000000000) + (NatTree.node 64 (NatTree.leaf 0x9500000000000000000000000000000000000000009200000000000000000009000000000000000000000000000000000000000000000000000000000000009000000000000000000008f00000000000000000000000000000000000000008e00000000000000000000000000000000000000008d00000000000000000000000000000000000000000000000000000000000008b00000000000000000000000000000000000000008a0000000000000000000890000000000000000000000000000000000000000880000000000000000000000000000000000000000870000000000000000000000000000000000000000860000000000000000000000000000000000000000000000000000000000000860000000c00a409108c08500000000000000000000000000000000000000008400000000000000000000000000000000000000008200000000000000000000000000000000000009308100000000000000000000000000000000000000008000000000000000000000000000000000000000007f00000000000000000000000000000000000000007e00000000000000000000000000000000000000007d00000000000000000000000000000000000000000000000000000000000007d00000000000000000000000000000000000000007c00000000000000000000000000000000000000007b00000000000000000007a000000000000000000000000000000000000000079000000000000000000000000000000000000000078000000000000000000000000000000000000000000000000000000000000077000000000000000000076000000000000000000000000000000000000000075000000000000000000000000000000000000000000000000000000000094074) + (NatTree.leaf 0xb30000000000000000000000000000000000000000b10000000000000000000000000000000000000000b00000000000000000000000000000000000000000af0000000000000000000000000000000000000000ad0000000000000000000000000000000000000000000000000000000000000ac0000000000000000000000000000000000d00ab0aa0000000000000000000a90000000000000000000000000000000000000000000000000000000000b20a90000000000000000000a80000000000000000000000000000000000000000000000000000000000000a70000000000000000000000000000000000000000a60000000000000000000a50000000000000000000000000000000000000000000000000000000000000a30000000000000000000000000000000000000000a20000000000000000000000000000000000000000a10000000000c10b20a60a00000000000000000000000000000000000000000000000000000000000000a000000000000000000009f00000000000000000000000000000000000000000000000000000000000009e0000000000c60c50be09d00000000000000000000000000000000000000000000000000000000000009d0000000000000b70a209c0000000000000000000be00000000000000000000000000000000000000009c00000000000000000000000000000000000000009b00000000000000000009a00000000000000000000000000000000000000000000000000000000000009a000000000000000000099000000000000000000000000000000000000000098000000000000000000000000000000000000000097000000000000000000000000000000000000000096000000000000000000000000000000000000000095000000000000000000000)))) + (NatTree.node 192 (NatTree.node 64 (NatTree.leaf 0xd80000000000000000000000000000000000000000d70000000000000000000000000000000000000000d60000000000000000000000000000000000000000d50000000000000000000000000000000000000000d40000000000000000000000000000000000000000d30000000000000000000000000000000000000000000000000000000000000d20000000000000000000000000000000000000000d10000000000000000000000000000000000000000cf0000000000000000000000000000000000000000ce0000000000000000000cd0000000000000000000000000000000000000000cc0000000000000000000000000000000000000000000000000000000000000cb0000000000000000000000000000000000000000ca0000000000000000000c80000000000000000000000000000000000000000c70000000000000000000000000000000000000000000000000000000000000c60000000000000000000c40000000000000000000000000000000000000000c30000000000000000000000000000000000000000000000000000000000000c20000000000000000000000000000000000000000c10000000000000000000bf0000000000000000000000000000000000000000bd0000000000000000000000000000000000000000bc0000000000000000000000000000000000000d00bb0000000000000000000000000000000000000000ba0000000000000000000000000000000000000000b90000000000000000000000000000000000000000b80000000000000000000000000000000000000000b60000000000000000000000000000000000000000b50000000000000000000000000000000000000000b40000000000000000000000000000000000000000000000000000000000000b4) + (NatTree.node 64 (NatTree.leaf 0xf40000000000000000000000000000000000001160f30000000000000000000000000000000000000000f20000000000000000f30f10000000000000000000000000000000000000000000000000000000000000f10000000000000000000f00000000000000000000000000000000000000000ef0000000000000000000000000000000000000000000000000000000000000ed0000000000000000000ec0000000000000000000000000000000000000000000000000000000000000ec0000000000000000000eb0000000000000000000000000000000000000000000000000000000000000ea0000000000000000000e90000000000000000000000000000000000000000000000000000000000000e90000000000000000000e80000000000000000000000000000000000000000000000000000000000000e80000000000000000000000000000000000000000e70000000000000000000e60000000000000000000000000000000000000000e50000000000000000000000000000000000000000e40000000000000000000000000000000000000000000000000000000000000e40000000000000000000000000000000000000000e30000000000000000000e20000000000000000000000000000000000000000e10000000000000000000000000000000000000000e00000000000000000000000000000000000000000df0000000000000000000000000000000000000000000000000000000000000de0000000000000000000000000000000000000000dd0000000000000000000dc0000000000000000000000000000000000000000db0000000000000000000000000000000000000000da0000000000000000000000000000000000000000d9000000000000000000000) + (NatTree.leaf 0x11200000000000000000011100000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000010f00000000000000000010e00000000000000000000000000000000000000010d00000000000000000000000000000000000000010c00000000000000000000000000000000000000000000000000000000000010a00000000000000000000000000000000000000010900000000000000000010800000000000000000000000000000000000000000000000000000000000010800000000000000000010700000000000000000000000000000000000000000000000000000000000010600000000000000000010500000000000000000000000000000000000010b1040000000000000000000000000000000000000001030000000000000000000000000000000000000000000000000000000000001020000000000000001281010000000000000000000000000000000000000001000000000000000000000000000000000000000000ff0000000000000000000000000000000000000000fe0000000000000000000000000000000000000000fc0000000000000000000000000000000000000000fb0000000000000000000000000000000000000000fa0000000000000000000000000000000000000000000000000000000000000fa0000000000000000000f90000000000000000000000000000000000000fd0f80000000000000000000000000000000000000000000000000000000000000f80000000000000000000f70000000000000000000000000000000000000000000000000000000000000f70000000000000000000f60000000000000000000000000000000000000000f5000000000000000000000))) + (NatTree.node 64 (NatTree.leaf 0x12d00000000000000000000000000000000000000012c00000000000000000012b00000000000000000000000000000000000000000000000000000000000012a00000000000000012c12900000000000000000000000000000000000000000000000000000000000012900000000000000000012700000000000000000000000000000000000000012600000000000000000000000000000000000000012500000000000000000000000000000000000000000000000000000000000012400000000000000000012300000000000000000000000000000000000000000000000000000000000012300000000000000000012200000000000000000000000000000000000015712100000000000000000000000000000000000000000000000000000000000012100000000000000000012000000000000000000000000000000000000000000000000000000000000011f00000000000000000011e00000000000000000000000000000000000000011d00000000000000000000000000000000000000011c00000000000000000000000000000000000000000000000000000000014e11c00000000000000000000000000000000000000011b00000000000000000011a00000000000000000000000000000000000000000000000000000000000011a000000000000000000119000000000000000000000000000000000000000118000000000000000000000000000000000000000000000000000000000000117000000000000000000116000000000000000000000000000000000000000115000000000000000000000000000000000000000000000000000000000000115000000000000000000114000000000000000000000000000000000000000113000000000000000000000) + (NatTree.node 64 (NatTree.leaf 0x14b00000000000000016014a00000000000000000000000000000015c15415114900000000000000000000000000000000000000014800000000000000000000000000000000000000014700000000000000000000000000000000000000014600000000000000000000000000000000000000014500000000000000000000000000000000000000000000000000000000000014400000000000000000014300000000000000000000000000000000000000014200000000000000000000000000000000000000000000000000000000000014100000000000000000014000000000000000000000000000000000000000013f00000000000000000000000000000000000000013e00000000000000000000000000000000000000013d00000000000000000000000000000000000000013b00000000000000000000000000000000000000013a00000000000000000000000000000000000000000000000000000000000013a00000000000000000013900000000000000000000000000000000000000000000000000000000000013800000000000000000013700000000000000000000000000000000000013c13600000000000000000000000000000000000000000000000000000016616113600000000000000000013500000000000000000000000000000000000000000000000000016516015313500000000000000000000000000000000000000013400000000000000000000000000000000000000013300000000000000000013200000000000000000000000000000000000000013100000000000000000000000000000000000000013000000000000000000000000000000000000000000000000000000000000012f00000000000000000012e000000000000000000000) + (NatTree.leaf 0x16e00000000000000018016d00000000000000000000000000000000000000016b00000000000000000000000000000000000000016a0000000000000000000000000000000000000001690000000000000000000000000000000000000000000000000000000001a216900000000000000000016800000000000000000000000000000000000000000000000000000000000016800000000000000000016700000000000000000000000000000000000000016600000000000000000000000000000000000000000000000000000000000016400000000000000000016300000000000000000000000000000000000000016200000000000000000000000000000000000000000000000000000000000016200000000000000000015f00000000000000000000000000000000000000000000000000000000000015e00000000000000016c15d00000000000000000000000000000000000000015b00000000000000000000000000000000000017715a00000000000000000000000000000000000000000000000000000000000015a00000000000000000015900000000000000000000000000000000000000000000000000000018c16d15800000000000000000015600000000000000000000000000000000000000015500000000000000000000000000000000000000015200000000000000000000000000000000000000000000000000000000000015000000000000000000014f00000000000000000000000000000000000000000000000000000000000014f00000000000000000014e00000000000000000000000000000000000000014d00000000000000000000000000000000000000014c00000000000000000000000000000000000000014b000000000000000000000))))) + (NatTree.node 384 (NatTree.node 192 (NatTree.node 64 (NatTree.leaf 0x18900000000000000000000000000000000000018f1880000000000000000000000000000000000000000000000000000001ba1b41880000000000000000001870000000000000000000000000000000000000000000000001fb1c61b91871860000000000000000001850000000000000000000000000000000000000000000000000000001cd1931850000000000000000001830000000000000000000000000000000000000000000000000000000000001820000000000000000001810000000000000000000000000000000000000000000000000000000001ab18100000000000000000017f00000000000000000000000000000000000000017e00000000000000000000000000000000000000000000000000000000000017d00000000000000000000000000000000000000017c00000000000000000000000000000000000000017b00000000000000000000000000000000000000017a00000000000019317b1790000000000000000000000000000000000000000000000000000000000001790000000000000000001780000000000000000000000000000000000000000000000000000000000001770000000000000000001760000000000000000000000000000000000000000000000000000000000001750000000000000000000000000000000000000001740000000000000000001730000000000000000000000000000000000000000000000000000000000001730000000001b819917d17200000000000000000019f00000000000000000000000000000000000000017200000000000000000017100000000000000000000000000000000000000000000000000000000000017000000000000000019516f00000000000000000000000000000000000000000000000000000000000016f) + (NatTree.node 64 (NatTree.leaf 0x1aa0000000000000000000000000000000000000001a90000000000000000000000000000000000000001a80000000000000000000000000000000000000001a70000000000000000000000000000000000000001a60000000000000000000000000000000000000000000000000000000000001a50000000000000000001a40000000000000000000000000000000000000000000000000000000000001a40000000000000000001a30000000000000000000000000000000000000001a20000000000000000000000000000000000000001a10000000000000000000000000000000000000001a00000000000000000000000000000001ee1b01af19f0000000000000000000000000000000000001c619e00000000000000000000000000000000000000019d00000000000000000000000000000000000000019c00000000000000000000000000000000000000019b00000000000000000000000000000000000000019a0000000000000000000000000000000000000001980000000000000000000000000000000000001ba1970000000000000000000000000000000000001b919600000000000000000000000000000000000000000000000000000000000019500000000000000000000000000000000000000019400000000000000000019200000000000000000000000000000000000000019100000000000000000000000000000000000000019000000000000000000000000000000000000000018e00000000000000000000000000000000000000018d00000000000000000000000000000000000000000000000000000000000018d00000000000000000018c00000000000000000000000000000000000000018b00000000000000000000000000000000000000018a000000000000000000000) + (NatTree.leaf 0x1cf0000000000000000000000000000000000000001ce0000000000000000000000000000000000000001cd0000000000000000000000000000000000000001cc0000000000000000000000000000000000000001cb0000000000000000000000000000000000000001ca0000000000000000000000000000000000000000000000000000000000001c90000000000000000001c80000000000000000000000000000000000000000000000000000000000001c70000000000000000000000000000000000000001c50000000000000000000000000000000000000001c40000000000000000000000000000000000001e41c30000000000000000000000000000000000000001c20000000000000000001c10000000000000000000000000000000000000000000000000000000000001bf0000000000000000000000000000000000000001be0000000000000000000000000000000000000001bd0000000000000000000000000000000000000001bc0000000000000000001bb0000000000000000000000000000000000000000000000000000000000001b80000000000000000000000000000000000000001b70000000000000000000000000000000000000001b60000000000000000000000000000000000000001b50000000000000000001b30000000000000000000000000000000000000000000000000000000000001b20000000000000000001b10000000000000000000000000000000000000000000000000000000000001b00000000000000000001ae0000000000000000000000000000000000001d31ad0000000000000000000000000000000000001dc1c00000000000000000001ad0000000000000000001ac0000000000000000000000000000000000000001ab000000000000000000000))) + (NatTree.node 64 (NatTree.leaf 0x1f20000000000000000000000000000000000000001f10000000000000001f11f00000000000000000000000000000000000000000000000000000000000001f00000000000000000001ef0000000000000000000000000000000000000000000000000000000000001ee0000000000000000000000000000000000000001ed0000000000000000001ec0000000000000000000000000000000000000000000000000000000000001ec0000000000000000001eb0000000000000000000000000000000000000000000000000000000000001ea0000000000000000001e90000000000000000000000000000000000000001e80000000000000000000000000000000000000001e60000000000000000000000000000000000001e71e50000000000000000000000000000000000000001e30000000000000000000000000000000000000001e10000000000000000000000000000000000000000000000000000000000001df0000000000000000001de0000000000000000000000000000000000000001dd0000000000000000000000000000000000000001db0000000000000000000000000000000000000001da0000000000000000000000000000000001e21e01d90000000000000000000000000000000000000001d80000000000000000000000000000000000000001d70000000000000000000000000000000001fb1e41d60000000000000000000000000000000000000001d50000000000000000000000000000000000000001d40000000000000000000000000000000000000000000000000000000000001d30000000000000000001d20000000000000000000000000000000000000001d10000000000000000000000000000000000000001d0000000000000000000000) + (NatTree.node 64 (NatTree.leaf 0x20c00000000000000000000000000000000000000000000000000000000000020c00000000000000000020b00000000000000000000000000000000000000020a00000000000000000000000000000000021421020900000000000000000000000000000000000000000000000000000000000020900000000000000000020800000000000000000000000000000000000000020700000000000000000000000000000000000000020600000000000000000000000000000000000000000000000000000000000020500000000000000000000000000000000020d20820400000000000000000000000000000000000000020300000000000023020420200000000000000000000000000000000000000000000000000023723220f20200000000000000000020100000000000000000000000000000000000000020000000000000000000000000000000000000021f1ff0000000000000000000000000000000000000000000000000000000000001ff0000000000000000000000000000000000000001fe0000000000000000000000000000000000000001fd0000000000000000001fc0000000000000000000000000000000000000001fa0000000000000000000000000000000000000000000000000000000000001f90000000000000001fd1f80000000000000000000000000000000000000000000000000000000000001f80000000000000000000000000000000000000001f70000000000000000001f60000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000000001f50000000000000002251f40000000000000000000000000000000000000000000000000000000000001f40000000000000000000000000000000000000001f3) + (NatTree.leaf 0x22e00000000000000000000000000000000000000022d00000000000000000000000000000000000000000000000000000000000022c00000000000000000000000000000000000000022b00000000000000000022a00000000000000000000000000000000000000022900000000000000000000000000000000000000022800000000000000000000000000000000000000022700000000000000000000000000000000000000022600000000000000000000000000000000000000000000000000000000000022500000000000000000000000000000000000000022400000000000000000022300000000000000000000000000000000000000022200000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000021f00000000000000000021e00000000000000000000000000000000000000000000000000000000000021e00000000000000000021d00000000000000000000000000000000000000000000000000000000000021c00000000000000000021b00000000000000000000000000000000000022121a00000000000000000000000000000000000023c21900000000000000000000000000000000000000000000000000000000000021800000000000000000021700000000000000000000000000000000000000021600000000000000000000000000000000000000021500000000000000000000000000000000000023221300000000000000000000000000000000000000021200000000000000000000000000000000000000021100000000000000000000000000000000000000000000000000000000000021000000000000000000020e00000000000000000000000000000000024320f20d000000000000000000000)))) + (NatTree.node 192 (NatTree.node 64 (NatTree.leaf 0x24d00000000000000000000000000000000000000000000000000000000000024c00000000000000000024b00000000000000000000000000000000000000024a00000000000000000000000000000000000000024900000000000000000000000000000000000028b24800000000000000000000000000000000000000000000000000000000000024700000000000000000000000000000000000000024600000000000000000024500000000000000000000000000000000000000024400000000000000000000000000000000000000000000000000000000000024200000000000000024624100000000000000000000000000000000000000000000000000000000000024100000000000000000024000000000000000000000000000000000000000023f00000000000000000000000000000000000000023e00000000000000000000000000000000000000023d00000000000000000000000000000000000000023b00000000000000000000000000000000000000000000000000000000023f23b00000000000000000000000000000000000000023a00000000000000000023900000000000000000000000000000000000000000000000000000000024823900000000000000000000000000000000000000023800000000000000000023600000000000000000000000000000000000000023500000000000000000000000000000000000000023400000000000000000000000000000000000000000000000000000000000023400000000000000000023300000000000000000000000000000000000000000000000000000000000023100000000000000000000000000000000000000023000000000000000000022f00000000000000000000000000000000000000000000000000000000000022f) + (NatTree.node 64 (NatTree.leaf 0x28126a00000000000000000000000000000027d27827026900000000000000000000000000000000000000026800000000000000000000000000000000000000026700000000000000000000000000000000000000026600000000000000000000000000000000000000000000000000000000000026500000000000000000000000000000000000000026400000000000000000026300000000000000000000000000000000000000026100000000000000000000000000000000000000026000000000000000000000000000000000000000025f00000000000000000000000000000000000028725e00000000000000000000000000000000000000025d00000000000000000000000000000000000000000000000000000000000025c00000000000000000000000000000000000000025b00000000000000000025a00000000000000000000000000000000000029925900000000000000000000000000000000000000025800000000000000000000000000000000000000000000000000000000000025800000000000000000025700000000000000000000000000000000000000025600000000000000000000000000000000000026225500000000000000000000000000000000000000000000000000000028728225500000000000000000025400000000000000000000000000000000000000000000000028628127725925400000000000000000000000000000000000000025300000000000000000000000000000000000000025200000000000000000025100000000000000000000000000000000000000025000000000000000000000000000000000000000000000000000000000000024f00000000000000028424e00000000000000000000000000000000000000000000000000000000000024e) + (NatTree.leaf 0x2a128d00000000000000000000000000000000000000028c00000000000000000000000000000000000000028a00000000000000000000000000000000000000028900000000000000000000000000000000000000000000000000000000000028900000000000000000028800000000000000000000000000000000000000000000000000000000000028500000000000000000000000000000000000000028400000000000000000028300000000000000000000000000000000000000000000000000000000000028300000000000000000028000000000000000000000000000000000000000000000000000000000000027f00000000000000029227e00000000000000000000000000000000000000027c00000000000000000000000000000000000000027b00000000000000000000000000000000000000027a00000000000000000000000000000000000000027900000000000000000000000000000000000000027600000000000000000000000000000000000000027500000000000000000000000000000000000000000000000000000000000027500000000000000000000000000000000000028d27400000000000000000027300000000000000000000000000000000000000027200000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000026f00000000000000000026e00000000000000000000000000000000000000000000000000000000000026e00000000000000000026d00000000000000000000000000000000000000000000000000000000000026d00000000000000000026c00000000000000000000000000000000000000026b00000000000000000000000000000000000000000000000000000000000026b))) + (NatTree.node 128 (NatTree.node 64 (NatTree.leaf 0x2aa0000000000000000000000000000000000000000000000000000000002bc2aa0000000000000000002a80000000000000000000000000000000000000000000000000000000000002a70000000000000000000000000000000000000002a60000000000000000000000000000000000000002a50000000000002db2bc2a40000000000000000000000000000000000000000000000000000000000002a40000000000000000000000000000000000000002a30000000000000000002a20000000000000000000000000000000000000000000000000000000002cd2a20000000000000000002a000000000000000000000000000000000000000029f0000000000000000000000000000000000002b529e00000000000000000000000000000000000000000000000000000000000029d00000000000000000000000000000000000000029c00000000000000000029b00000000000000000000000000000000000000029a00000000000000000000000000000000000000000000000000000000000029800000000000000029c2970000000000000000000000000000000000000000000000000000000000002970000000000002be2a62960000000000000000002c400000000000000000000000000000000000000029600000000000000000029500000000000000000000000000000000000000000000000000000000000029400000000000000000029300000000000000000000000000000000000000029100000000000000000000000000000000000000029000000000000000000000000000000000000000000000000000000000029329000000000000000000028f00000000000000000000000000000000000000000000000000000000029e28f00000000000000000000000000000000000000028e) + (NatTree.leaf 0x2c90000000000000000000000000000000000000000000000000000000000002c80000000000000000002c70000000000000000000000000000000000000000000000000000000000002c70000000000000000002c60000000000000000000000000000000000000000000000000000000000002c60000000000000000002c50000000000000000000000000000000002d52d42c40000000000000000000000000000000000002ec2c30000000000000000000000000000000000000002c20000000000000000000000000000000000000002c10000000000000000000000000000000000000002c00000000000000000000000000000000000000002bf0000000000000000000000000000000000000002bd0000000000000000000000000000000000000002bb0000000000000000000000000000000000000002b90000000000000000000000000000000000000002b80000000000000000000000000000000000002de2b70000000000000000000000000000000000002dd2b60000000000000000000000000000000000000000000000000000000000002b50000000000000000000000000000000000000002b40000000000000000000000000000000000000002b30000000000000000002b20000000000000000000000000000000000002f12b10000000000000000000000000000000000000002b00000000000000000000000000000000000000000000000000000000000002b00000000000000000002af0000000000000000000000000000000000000002ae0000000000000000000000000000000000002ba2ad0000000000000000000000000000000000000000000000000000002de2d92ad0000000000000000002ac0000000000000000000000000000000000000000000000002ec2dd2b12ac2ab)) + (NatTree.node 64 (NatTree.leaf 0x2ee0000000000000000000000000000000000000000000000000000000000002ed0000000000000000000000000000000000000002eb0000000000000000000000000000000000000002ea0000000000000000000000000000000000000002e90000000000000000000000000000000000000002e80000000000000000000000000000000000000002e70000000000000000000000000000000000003082e60000000000000000000000000000000000000002e50000000000000000002e40000000000000000000000000000000000000002e20000000000000000000000000000000000000000000000000000000003142e10000000000000000000000000000000000000002e00000000000000000002df0000000000000000000000000000000000000000000000000000000000002dc0000000000000000000000000000000000000002db0000000000000000000000000000000000000002da0000000000000000002d80000000000000000000000000000000000000000000000000000000000002d70000000000000000002d60000000000000000000000000000000000000000000000000000000000002d50000000000000000002d30000000000000000000000000000000000000002d20000000000000000000000000000000000000002d10000000000000000000000000000000000000002d00000000000000000000000000000000000002f72cf0000000000000000000000000000000000000002e30000000000000000002cf0000000000000000002ce0000000000000000000000000000000000000002cd0000000000000000000000000000000000000002cc0000000000000000000000000000000000000002cb0000000000000000000000000000000000000002ca000000000000000000000) + (NatTree.leaf 0x31300000000000000000031200000000000000000000000000000000000000000000000000000000000031100000000000000000031000000000000000000000000000000000000000030f00000000000000000000000000000000000000030e00000000000000000000000000000000000000030c00000000000000000000000000000000000000030a00000000000000000000000000000000000030b30900000000000000000000000000000000000000030700000000000000000000000000000000000000030600000000000000000000000000000000000000000000000000000000000030400000000000000000030300000000000000000000000000000000000000030200000000000000000000000000000000000000030100000000000000000000000000000000030d3053000000000000000000000000000000000000000002ff0000000000000000000000000000000000000002fe0000000000000000000000000000000000000002fd0000000000000000000000000000000000000002fc0000000000000000000000000000000000000002fb0000000000000000000000000000000000003082fa0000000000000000000000000000000000000002f90000000000000000000000000000000000000002f80000000000000000000000000000000000000000000000000000000000002f70000000000000000000000000000000000000002f60000000000000000002f50000000000000000000000000000000000000002f40000000000000000000000000000000000000002f30000000000000000000000000000000000000002f20000000000000000000000000000000000000002f00000000000000000000000000000000000000000000000000000000000002ef)))))) + (NatTree.node 832 (NatTree.node 384 (NatTree.node 192 (NatTree.node 64 (NatTree.leaf 0x33732d32b00000000000000000000000000000000000000000000000000000000000032b00000000000000000000000000000000000000032a00000000000000000000000000000000000000032900000000000000032a32800000000000000000000000000000000000000000000000000000000000032800000000000000000032700000000000000000000000000000000000000032600000000000000000000000000000000000035032500000000000000000000000000000000000000000000000000000000000032500000000000000000000000000000000000000032400000000000000000000000000000000000000032300000000000000000032200000000000000000000000000000000000000000000000000000000000032100000000000000032332000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000031f00000000000000000031e00000000000000000000000000000000000000031d00000000000000000000000000000000000000000000000000000000000031d00000000000000000031c00000000000000000000000000000000000000000000000000000000000031c00000000000000000000000000000000000000031b00000000000000000031a00000000000000000000000000000000000000000000000000000000033431a00000000000000000000000000000000000000031900000000000000000000000000000000000000031800000000000000000031700000000000000000000000000000000000031b316000000000000000000000000000000000000000000000000000000000000316000000000000000000315000000000000000000000000000000000000000313000000000000000000000) + (NatTree.node 64 (NatTree.leaf 0x34f00000000000000000034e00000000000000000000000000000000000000034c00000000000000000000000000000000000000000000000000000000000034a00000000000000000034900000000000000000000000000000000000000000000000000000000000034800000000000000000034700000000000000000000000000000000000034b34600000000000000000000000000000000000036834500000000000000000000000000000000000000000000000000000000000034400000000000000000034300000000000000000000000000000000000000034200000000000000000000000000000000000000034100000000000000000000000000000000000000033d00000000000000000000000000000000000000000000000000000000000033c00000000000000034d33b00000000000000000000000000000000000000033a00000000000000000000000000000000000000033900000000000000000000000000000000000000000000000000000000000033800000000000000000000000000000036133e33b33700000000000000000033600000000000000000000000000000000033f33e33500000000000000000000000000000000000000033400000000000000000000000000000000000000033300000000000000000000000000000000034033c33200000000000000000000000000000000000000000000000000000000000033200000000000000000033100000000000000000000000000000000000000033000000000000000000000000000000000000000032f00000000000000000000000000000000000000000000000000000000000032e00000000000000000000000000000000033533132d00000000000000000000000000000000000000032c) + (NatTree.leaf 0x36c00000000000000000000000000000000000000036b00000000000000000000000000000000000000036a00000000000000000000000000000000000000036900000000000000000000000000000000000000036700000000000000000000000000000000000000000000000000000000036b36700000000000000000000000000000000000000036600000000000000000036500000000000000000000000000000000000000000000000000000000000036500000000000000000036400000000000000000000000000000000000000000000000000000000038436400000000000000000036300000000000000000000000000000000000000000000000000000000000036200000000000000000036000000000000000000000000000000000000000035f00000000000000000000000000000000000000035e00000000000000000000000000000000000000000000000000000000000035e00000000000000000035d00000000000000000000000000000000000000035c00000000000000000000000000000000000000000000000000000000000035c00000000000000000035b00000000000000000000000000000000000000035a000000000000000000000000000000000000000000000000000000000000359000000000000000000000000000000000000000358000000000000000000357000000000000000000000000000000000000000356000000000000000000000000000000000000000355000000000000000000000000000000000000000354000000000000000000000000000000000000000353000000000000000000000000000000000000000352000000000000000000000000000000000000000351000000000000000000000000000000000000000000000000000000000000350))) + (NatTree.node 64 (NatTree.leaf 0x38600000000000000000000000000000000000038f3850000000000000000000000000000000000000003840000000000000000000000000000000000000003830000000000000000000000000000000000003903820000000000000000000000000000000000000000000000000000003b438d3820000000000000000003810000000000000000000000000000000000000000000000003b33a938c38538100000000000000000000000000000000000000038000000000000000000000000000000000000000037f00000000000000000037e00000000000000000000000000000000000000037d00000000000000000000000000000000000000000000000000000000000037c00000000000000000000000000000000000000037b00000000000000000037a00000000000000000000000000000000000000000000000000000000000037900000000000000037b3780000000000000000000000000000000000000000000000000000000000003780000000000000000000000000000000000000003770000000000000000003760000000000000000000000000000000000000000000000000000000000003760000000000000003b937500000000000000000000000000000000000000037400000000000000000000000000000000000000037300000000000000000000000000000000000000037200000000000000000000000000000000000000000000000000000000037537200000000000000000000000000000000000000037100000000000000000000000000000000000000037000000000000000000036f00000000000000000000000000000000000000000000000000000000000036e00000000000000037036d00000000000000000000000000000000000000000000000000000000000036d) + (NatTree.node 64 (NatTree.leaf 0x3ab0000000000000000000000000000000000000003a80000000000000000000000000000000000000003a70000000000000000000000000000000000000003a60000000000000000000000000000000000000000000000000000000000003a60000000000000000003a50000000000000000000000000000000000000000000000000000000003bc3a40000000000000000003a30000000000000000000000000000000000000003a20000000000000000000000000000000000000003a000000000000000000000000000000000000000000000000000000000000039e00000000000000000039d00000000000000000000000000000000000000039c00000000000000000000000000000000000000000000000000000000000039c0000000000000003b339b0000000000000000000000000000003af3aa39f39a00000000000000000000000000000000000000039900000000000000000000000000000000000000039800000000000000000000000000000000000000039700000000000000000000000000000000000000000000000000000000000039600000000000000000000000000000000000000039500000000000000000039400000000000000000000000000000000000000039300000000000000000000000000000000000000039200000000000000000000000000000000000000039100000000000000000000000000000000000000038e0000000000000000000000000000000000003a138d00000000000000000000000000000000000000000000000000000000000038b00000000000000000038a000000000000000000000000000000000000000000000000000000000000389000000000000000000000000000000000000000388000000000000000000387000000000000000000000) + (NatTree.leaf 0x3c90000000000000000000000000000000000000000000000000000000000003c80000000000000003ca3c70000000000000000000000000000000000000000000000000000000000003c70000000000003f23d73c60000000000000000003f80000000000000000000000000000000000000003c60000000000000000003c50000000000000000000000000000000000000000000000000000000000003c40000000000000000003c30000000000000000000000000000000000000003c10000000000000000000000000000000000000003c00000000000000000000000000000000000000000000000000000000003c33c00000000000000000003bf0000000000000000000000000000000000000000000000000000000000003bf0000000000000000003be0000000000000000000000000000000000000000000000000000000003e03be0000000000000000000000000000000000000003bd0000000000000003d03bc0000000000000000000000000000000000000003bb0000000000000000000000000000000000000003ba0000000000000000000000000000000000000003b80000000000000000000000000000000000000003b70000000000000000000000000000000000000000000000000000000000003b70000000000000000003b60000000000000000000000000000000000000003b50000000000000000000000000000000000000000000000000000000000003b50000000000000000003b20000000000000000000000000000000000000000000000000000000000003b10000000000000003c23b00000000000000000000000000000000000000003ae0000000000000000000000000000000000000003ad0000000000000000000000000000000000000003ac000000000000000000000)))) + (NatTree.node 192 (NatTree.node 64 (NatTree.leaf 0x3e50000000000000000000000000000000000000003e40000000000000000003e300000000000000000000000000000000000000000063662b54d5345114023e30000000000000000003e20000000000000000000000000000000000003eb3e10000000000000000000000000000000000000003e00000000000000000000000000000000000000003df0000000000000000000000000000000000003ec3de00000000000000000000000000000000000000000000000000000040f3e93de0000000000000000003dd0000000000000000000000000000000000000000000000004203e83e13dd3dc0000000000000000003db0000000000000000000000000000000000000000000000000000000003f03db0000000000000000003d90000000000000000000000000000000000000000000000000000000000003d80000000000000000000000000000000000000003d70000000000000000000000000000000000000003d60000000000000000000000000000000000000003d50000000000000000000000000000000000000003d40000000000003f03d53d30000000000000000000000000000000000000000000000000000000000003d30000000000000000000000000000000000000003d20000000000000000003d10000000000000000000000000000000000000000000000000000000000003d10000000000000000003cf0000000000000000000000000000000000003e73ce0000000000000000000000000000000000000003cd0000000000000000000000000000000000000003cc0000000000000000000000000000000000000000000000000000000003ce3cc0000000000000000000000000000000000000003cb0000000000000000000000000000000000000003ca) + (NatTree.node 64 (NatTree.leaf 0x40b00000000000000000040900000000000000000000000000000000000000040800000000000000000000000000000000000000040700000000000000000000000000000000000000040600000000000000000000000000000000000000040500000000000000000000000000000000000042a4040000000000000000000000000000000000000004150000000000000000004040000000000000000004030000000000000000000000000000000000000004020000000000000000000000000000000000000004010000000000000000000000000000000000000004000000000000000000000000000000000000000003ff0000000000000000000000000000000000000003fc0000000000000000000000000000000000000003fb0000000000000000000000000000000000000000000000000000000000003fa0000000000000000003f900000000000000000000000000000000040b40a3f80000000000000000000000000000000000004203f70000000000000000000000000000000000000003f60000000000000000000000000000000000000003f50000000000000000000000000000000000000003f40000000000000000000000000000000000000003f30000000000000000000000000000000000000003f10000000000000000000000000000000000000003ef0000000000000000000000000000000000000003ee0000000000000000000000000000000000000003ed0000000000000000000000000000000000000003ea0000000000000000000000000000000000003fe3e90000000000000000000000000000000005183fd3e80000000000000000000000000000000000000000000000000000000000003e70000000000000000000000000000000000000003e6) + (NatTree.leaf 0x43000000000000000000000000000000000000000042f00000000000000000000000000000000000000042e00000000000000000000000000000000000043a42d00000000000000000000000000000000000000042c00000000000000000000000000000000000000042b00000000000000000000000000000000000000000000000000000000000042a00000000000000000000000000000000000000042900000000000000000042700000000000000000000000000000000000000042600000000000000000000000000000000000000042500000000000000000000000000000000000000042400000000000000000000000000000000000000000000000000000000000042300000000000000000042200000000000000000000000000000000000000000000000000000000000042100000000000000000000000000000000000000041f00000000000000000000000000000000000000041e00000000000000000000000000000000000000041d00000000000000000000000000000000000042841b00000000000000000000000000000000000000041a00000000000000000000000000000000000043a41900000000000000000000000000000000000000041800000000000000000041700000000000000000000000000000000000000041600000000000000000000000000000000000000041400000000000000000000000000000000000000000000000000000000041c41300000000000000000000000000000000000000041200000000000000000041100000000000000000000000000000000000000000000000000000000000041000000000000000057f40e00000000000000000000000000000000000000000000000000000000000040d00000000000000000040c000000000000000000000))) + (NatTree.node 128 (NatTree.node 64 (NatTree.leaf 0x45000000000000000000044f00000000000000000000000000000000000000044e00000000000000000000000000000000000000000000000000000000000044e00000000000000000044d00000000000000000000000000000000000000000000000000000000000044d00000000000000000000000000000000000000044c00000000000000000044b00000000000000000000000000000000000000000000000000000000046444b00000000000000000000000000000000000000044a00000000000000000000000000000000000000044900000000000000000044800000000000000000000000000000000000000000000000000000000000044700000000000000000044600000000000000000000000000000000044c44744500000000000000000000000000000000000000000000000000000000000044500000000000000000044400000000000000000000000000000000000000000000000000000000000044300000000000000000044200000000000000000000000000000000000000044100000000000000000000000000000000000000044000000000000000000000000000000000000000043e00000000000000000000000000000000000000043c00000000000000000000000000000000058843d43b00000000000000000000000000000000000000043900000000000000000000000000000000000000043800000000000000000000000000000000000000000000000000000000000043600000000000000000043500000000000000000000000000000000000000043400000000000000000000000000057b57043f437433000000000000000000000000000000000000000432000000000000000000000000000000000000000431000000000000000000000) + (NatTree.leaf 0x46b00000000000000047b46a00000000000000000000000000000000000000046900000000000000000000000000000000000000046800000000000000000000000000000000000000000000000000000000000046700000000000000000000000000000048f46d46a46600000000000046e46d4650000000000000000000000000000000000000004640000000000000000000000000000000000000004630000000000000000000000000005b25a846f46b46200000000000000000000000000000000000000000000000000000000000046200000000000000000046100000000000000000000000000000000000000046000000000000000000000000000000000000000045f00000000000000000000000000000000000000000000000000000000000045e00000000000000000000000000000000046546145d00000000000000000000000000000000000000045c0005ab5a359f46645d45b00000000000000000000000000000000000000000000000000000000000045b00000000000000000000000000000000000000045a00000000000000000000000000000000000000045900000000000000045a45800000000000000000000000000000000000000000000000000000000000045800000000000000000045700000000000000000000000000000000000000045600000000000000000000000000000000000047e455000000000000000000000000000000000000000000000000000000000000455000000000000000000000000000000000000000454000000000000000000453000000000000000000000000000000000000000000000000000000000000452000000000000000454451000000000000000000000000000000000000000000000000000000000000451)) + (NatTree.node 64 (NatTree.leaf 0x48e00000000000000000000000000000000000000048d00000000000000000000000000000000000000000000000000000000000048c00000000000000000048b0000000000000000000000000000000000005d348a00000000000000000000000000000000000000000000000000000000000048a00000000000000000048900000000000000000000000000000000000000048800000000000000000000000000000000000000000000000000000000000048700000000000000000000000000000000000000048600000000000000000048500000000000000000000000000000000000000048400000000000000000000000000000000000000048300000000000000000000000000000000000000048200000000000000000000000000000000000000048100000000000000000000000000000000000000048000000000000000000000000000000000000000047f00000000000000000000000000000000000000000000000000000000000047e00000000000000000000000000000000000000047d00000000000000000047c00000000000000000000000000000000000000047a00000000000000000000000000000000000000000000000000000000000047900000000000000000047800000000000000000000000000000000000000000000000000000000000047700000000000000000047600000000000000000000000000000000000000047500000000000000000000000000000000000049647400000000000000000000000000000000000000000000000000000000000047300000000000000000047200000000000000000000000000000000000000047100000000000000000000000000000000000000047000000000000000000000000000000000000000046c000000000000000000000) + (NatTree.leaf 0x4a90000000000000000000000000000000000005f34a80000000000000000004a70000000000000000000000000000000000000000000000000000000000004a60000000000000004a84a50000000000000000000000000000000000000000000000000000000005f04a50000000000000000000000000000000000000004a40000000000000000004a30000000000000000000000000000000000000000000000000000005ef4ca4a30000000000005ee4e24a20000000000000000000000000000000000000004a10000000000000000000000000000000000000004a00000000000000000000000000000000000005e849f0000000000000000000000000000000000000000000000000000000004a249f00000000000000000049e00000000000000000000000000000000000000049d00000000000000000000000000000000000000000000000000000000000049c00000000000000000049b0000000000000000000000000000000000000000000000000000000005e649b00000000000000000049a0000000000000000000000000000000000005e54990000000000000000000000000000000000000004980000000000000000000000000000000000000004970000000000000000000000000000000000005e14950000000000000000000000000000000000000000000000000000000004994950000000000000000000000000000000000000004940000000000000005dd4930000000000000000000000000000000000000000000000000000000000004930000000000005dc4b1492000000000000000000000000000000000000000000000000000000000000492000000000000000000491000000000000000000000000000000000000000000000000000000000000490))))) + (NatTree.node 384 (NatTree.node 192 (NatTree.node 64 (NatTree.leaf 0x4ca0000000000000000000000000000000000000004c90000000000000000000000000000000000006044c80000000000000000000000000000000000000000000000000000000000004c80000000000000000004c70000000000000000000000000000000000000004c60000000000000000000000000000000000000004c50000000000000000000000000000000000000004c40000000000000000000000000000000000000004c30000000000000000000000000000000000000000000000000000000000004c20000000000000000000000000000000000000004c10000000000000000004c00000000000000000000000000000000000000004bf0000000000000000000000000000000000000004be0000000000000000000000000000000000000004bd0000000000000000000000000000000000000004ba0000000000000000000000000000000000004cb4b90000000000000000000000000000000000000000000000000000000000004b70000000000000000004b60000000000000000000000000000000000000000000000000000000000004b50000000000000000000000000000000000000004b40000000000000000004b30000000000000000000000000000000000000000000000000000000000004b10000000000000000004b00000000000000000000000000000000000004bc4af0000000000000000000000000000000000000000000005fe5f74e04de4b94af0000000000000004bb4ae0000000000000000000000000000000000000000000000000006104dd4b84ae0000000000000000000000000000000000000004ad0000000000000000000000000000000000000004ac0000000000000004b24ab0000000000000000000000000000000000000004aa000000000000000000000) + (NatTree.node 64 (NatTree.leaf 0x4e90000000000000000000000000000000000000004e80000000000000000000000000000000000000000000000000000000000004e80000000000000000004e70000000000000000000000000000000000000000000000000000000000004e70000000000000000000000000000000000000004e600000000000052e50f4e50000000000000000000000000000000000000000000000000000000006144e50000000000000000004e40000000000000000000000000000000000000004e30000000000000000000000000000000000000004e10000000000000000000000000000000000000004e00000000000000000000000000000000000000004df0000000000000000000000000000000000000000000000000000000000004df0000000000000000004dd0000000000000000000000000000000000000004dc0000000000000000000000000000000000000000000000000000000000004db0000000000000000004da0000000000000000000000000000000000000004d80000000000000000000000000000000000000004d70000000000000000000000000000000000000004d60000000000000000000000000000000000000004d50000000000000000000000000000000000004d94d40000000000000000000000000000000000000000000000000000000000004d30000000000000000004d20000000000000000000000000000000000000004d100000000000000000000000000000000000060b4d00000000000000000000000000000000000000000000000000000000000004d00000000000000000004cf00000000000000000000000000000000000000000000000000000000050f4ce0000000000000000004cd0000000000000000000000000000000000000004cc000000000000000000000) + (NatTree.leaf 0x5030000000000000000000000000000000000000005020000000000000000005010000000000000000000000000000000000000000000000000000000000004ff0000000000005215024fe0000000000000000000000000000000000000000000000000000000000004fe0000000000000000000000000000000000000004fd0000000000000000004fc0000000000000000000000000000000000000000000000000000000000004fc0000000000000000004fb0000000000000000000000000000000000000004fa0000000000000000000000000000000000000004f90000000000000000000000000006306245355164f80000000000000000000000000000000000000004f70000000000000000000000000000000000000004f60000000000000000000000000000000000000000000000000000000004f84f60000000000000000004f50000000000000000000000000000000000000000000000000000000000004f50000000000000000000000000000000000000004f40000000000000000004f30000000000000000000000000000000000000000000000000000000000004f30000000000000000004f200000000000000000000000062161f53b50b5044f10000000000000000000000000000000000000000000000000000000000004f10000000000000000004f00000000000000000000000000000000000000000000000000000000000004ef0000000000000000004ee0000000000000000000000000000000000005004ed0000000000000000000000000000000000000004ec0000000000000000000000000000000000000004eb0000000000000000000000000000000000000000000000000000000004ee4eb0000000000000000000000000000000000000004ea))) + (NatTree.node 64 (NatTree.leaf 0x52700000000000000000000000000000000000000052600000000000000000000000000000000000000052500000000000000000000000000000000000000052400000000000000000000000000000000000000052300000000000000000000000000000000000000052200000000000000000000000000000000000000052000000000000000000000000000000000000000051f00000000000000000000000000000000000000051d00000000000000000000000000000000000000051a00000000000000000000000000000000000052f51900000000000000000000000000000000000000051700000000000000000000000000000000000000000000000000000000000051600000000000000000051500000000000000000000000000000000000000000000000000000000000051400000000000000000000000000000000000000051300000000000000000000000000000000000000051200000000000000000051100000000000000000000000000000000000000000000000000000000000051000000000000000000050e00000000000000000000000000000000000051c50d00000000000000000000000000000000000000000000000000000054651950d00000000000000051b50c00000000000000000000000000000000000000000063b63956e55754551850c00000000000000000000000000000000000000050b00000000000000000000000000000000000000050a000000000000000000509000000000000000000000000000000000000000000000000628626528521509000000000000000000507000000000000000000000000000000000000000000000000000000000000506000000000000000000000000000000000000000505000000000000000000000000000000000000000504) + (NatTree.node 64 (NatTree.leaf 0x54a00000000000000000000000000000000000000054900000000000000000000000000000000000000054800000000000000000000000000000000000000000000000000000000055154700000000000000000054400000000000000000000000000000000000000000000000000000000000054300000000000000000054200000000000000000000000000000000000000054100000000000000000000000000000000000000054000000000000000000000000000000000000000000000000000000000000053f00000000000000000053e00000000000000000000000000000000000000000000000000000000000053d00000000000000000053c00000000000000000000000000000000000000053a00000000000000000000000000000000000000053900000000000000000000000000000000000000053800000000000000000000000000000000000000053700000000000000000000000000064263857756253600000000000000000000000000000000000000000000000000000000000053600000000000000000000000000000000000000053500000000000000000053400000000000000000000000000000000000000000000000000000000000053300000000000000000053200000000000000000000000000000000000000053100000000000000000000000000000000000000053000000000000000000000000000000000000000052d00000000000000000000000000063563355953f52c00000000000000000000000000000000000000000000000000000000000052c00000000000000000052b00000000000000000000000000000000000000052a000000000000000000000000000000000000000529000000000000000000000000000000000000000528000000000000000000000) + (NatTree.leaf 0x64156c00000000000000000000000000000000000056e56b00000000000000000000000000000000000000056a00000000000000000000000000000000000000056900000000000000000000000000000000000000056800000000000000000000000000000000000000056700000000000000000000000000000000000000056600000000000000000000000000000000000000056500000000000000000000000000000000000000056400000000000000000000000000000000000000056300000000000000000000000000000000000000000000000000000000000056200000000000000000056100000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000055f00000000000000000055d00000000000000000000000000000000000000000000000000000000000055c00000000000000000055b00000000000000000000000000000000000000000000000000000000000055a00000000000000000000000000000000000000055900000000000000000000000000000000000000055800000000000000000055700000000000000000000000000000000000000000000000000000000000055600000000000000000055500000000000000000000000000000000000000000000000000000000000055400000000000000000000000000000000000000055300000000000000000000000000000000000000055200000000000000000000000000000000000055e55000000000000000000000000000000000000000054f00000000000000000000000000064763e58957654e00000000000000000054d00000000000000000000000000000000000000054c00000000000000000000000000000000000000054b000000000000000000000)))) + (NatTree.node 192 (NatTree.node 64 (NatTree.leaf 0x58e00000000000000000000000000000000000000000000000000000000000058e00000000000000000000000000000000000000058d00000000000000000058c00000000000000000000000000000000000000000000000000000000000058c00000000000000000000000000000000000000058b00000000000000000000000000000000000000058a00000000000000000058900000000000000000000000000000000000000058700000000000000000000000000000000000000058600000000000000000000000000000000000000058500000000000000000000000000000000000058d58400000000000000000000000000000000000000000000000000000000000058400000000000000000058300000000000000000000000000000000000000058200000000000000000000000000000000000000058100000000000000000000000000000000000000000000000000000000000058000000000000000000000000000000000000064657e00000000000000000057d00000000000000000000000000000000000000057c00000000000000000000000000000000000000057a00000000000000000000000000000000000000057900000000000000000000000000000000000000057800000000000000000000000000000000000000000000000000000000000057700000000000000000057600000000000000000000000000000000000000000000000000000000000057500000000000000000057400000000000000000000000000000000000000057300000000000000000000000000000000000000057200000000000000000000000000000000000000057100000000000000000000000000000000000000056f00000000000000000000000000000000000000056d000000000000000000000) + (NatTree.node 64 (NatTree.leaf 0x5aa0000000000000000000000000000000000000005a90000000000000000000000000000000000000000000000000000000000005a80000000000005b55b45a70000000000000000000000000000000000000005a60000000000000000000000000000000000000005a50000000000000000000000000000000000000000000000000000000000005a40000000000000000000000000000005cb5a75a55a30000000000000000005a20000000000000000000000000000000000000005a10000000000000000000000000000000000000000000000000000000000005a000000000000000000000000000000000000000059f00000000000000000000000000000000000000059e00000000000000000000000000000000000000059d00000000000000059e59c00000000000000000000000000000000000000000000000000000000000059c00000000000000000059b00000000000000000000000000000000000000059a0000000000000000000000000000000000006445990000000000000000000000000000000000000005980000000000000000000000000000005e95d45c55970000000000000000000000000000000000000000000000000000000000005970000000000000000000000000000000000000005960000000000000000000000000000000000000005950000000000000000005940000000000000000000000000000000000000000000000000000000000005940000000000000000000000000000000000000005930000000000000000000000000000000000000005920000000000005b759259100000000000000000000000000000000000000000000000000000000000059100000000000000000059000000000000000000000000000000000000000058f000000000000000000000) + (NatTree.leaf 0x5cd0000000000000000000000000000000000000005cc0000000000000000000000000000000000000005cb0000000000000000000000000000000000000005ca0000000000000000000000000000000000000005c90000000000000000000000000000000000000005c80000000000000000000000000000000000000005c70000000000000000000000000000000000000000000000000000000000005c60000000000000000000000000000000000000005c50000000000000000005c40000000000000000000000000000000000000005c30000000000000000000000000000000000000005c20000000000000000000000000000000000000005c00000000000000000000000000000000000000005bf0000000000000000000000000000000000000005be0000000000000000000000000000000000000005bd0000000000000000000000000000000000005df5bc0000000000000000000000000000000000000005bb0000000000000000000000000000000000000005ba0000000000000000000000000000000000000005b90000000000000000000000000000000000000000000000000000000000005b80000000000000000000000000000000000000005b70000000000000000005b60000000000000000000000000000000000000005b30000000000000000000000000000000000000000000000000000000000005b20000000000000005c15b10000000000000000000000000000000000000005b00000000000000000000000000000000000000005af0000000000000000000000000000000000000000000000000000000000005ae0000000000000000000000000000000000006485ad0000000000000000000000000000000000000005ac0000000000000000000000005f95e75d85b45b15ab))) + (NatTree.node 128 (NatTree.node 64 (NatTree.leaf 0x5f20000000000000000000000000000000000005f35f00000000000000000000000000000000000000005ef0000000000000000000000000000000000000005ed0000000000000000000000000000000000006075ec0000000000000000000000000000000000000005eb0000000000000000000000000000000000000000000000000000000000005ea0000000000000000000000000000000000000005e90000000000000000000000000000000000005ee5e80000000000000000005e60000000000000000000000000000000000000005e40000000000000000000000000000000000000005e30000000000000000000000000000000000000005e20000000000000000000000000000000000000000000000000000000005e55e10000000000000000000000000000000000000005e00000000000000000005de0000000000000000000000000000000000000000000000000000000000005dd0000000000000000000000000000000000000005dc0000000000000000005db0000000000000000000000000000000000000000000000000000000000005da0000000000000000005d90000000000000000000000000000000000000005d80000000000000000000000000000000000000005d70000000000000000000000000000000000000005d60000000000000000000000000000000000000005d50000000000000000000000000000000000000000000000000000000000005d40000000000000000000000000000000000000005d30000000000000000005d20000000000000000000000000000000000000000000000000000000000005d10000000000000000000000000000000000000005d00000000000000000000000000000000000005f15cf0000000000000000005ce000000000000000000000) + (NatTree.leaf 0x61d61800000000000000000000000000000000000000061700000000000000000000000000000000000000061600000000000000000000000000000000000000061500000000000000000000000000000000000000061400000000000000000000000000000000000000061300000000000000000000000000000000000000061200000000000000000000000000000000000000061000000000000000000000000000000000000000060f00000000000000000000000000000000000000060e00000000000000000000000000000000000000060d00000000000000000000000000000000000000000000000000000000000060c00000000000000000000000000000000000000060b00000000000000000000000000000000000000060a00000000000000000060900000000000000000000000000000000000062c6060000000000000000000000000000000000000000000000000000000000006040000000000000000000000000000000000000006030000000000000000000000000000000000000006020000000000000000000000000000000000000006010000000000000000006000000000000000000000000000000000000006055fe0000000000000000000000000000000000000005fd0000000000000000000000000000000000000000000000000000000000005fc0000000000000000000000000000000000006115fb0000000000000000005fa0000000000000000000000000000000000006085f90000000000000000000000000000000000000005f80000000000000000000000000000000000005ff5f70000000000000000000000000000000000000005f60000000000000000000000000000000000000005f50000000000000000000000000000000000000005f4000000000000000000000)) + (NatTree.node 64 (NatTree.leaf 0x63a00000000000000000000000000000000064964763900000000000000000000000000000000000000000000000000000000000063800000000000000000000000000000000000000063700000000000000000063600000000000000000000000000000000000000000000000000000000000063500000000000000000000000000000000000000063400000000000000000000000000000000000000063300000000000000000063200000000000000000000000000000000000000063100000000000000000000000000000000000000000000000000000000000063000000000000000000062f00000000000000000000000000000000000000062e00000000000000000000000000000000000000062d00000000000000000000000000000000000000062b00000000000000000000000000000000000000062a00000000000000000000000000000000000000062900000000000000000000000000000000000000062800000000000000000000000000000000000000062700000000000000000000000000000000000000062600000000000000000000000000000000000000062500000000000000000000000000000000000000000000000000000000000062400000000000000000000000000000000000000062300000000000000000062200000000000000000000000000000000000000000000000000000000000062100000000000000000000000000000000000000062000000000000000000000000000000000000000061f00000000000000000000000000000000000000061e00000000000000000061c00000000000000000000000000000000000000061b00000000000000000000000000000000000000000000000000000000000061a000000000000000000619000000000000000000000) + (NatTree.leaf 0x64500000000000000000064300000000000000000000000000000000000000000000000000000000000064200000000000000000064000000000000000000000000000000000000000063f00000000000000000000000000000000000000063e00000000000000000000000000000000000000063d00000000000000000000000000000000000000063c00000000000000000000000000000000000000063b000000000000000000000))))))) +def basetg_tree : NatTree := (NatTree.node 1120 (NatTree.node 544 (NatTree.node 256 (NatTree.node 128 (NatTree.node 64 (NatTree.node 32 (NatTree.leaf 0x3b08d70020000000000000002d08d708d800000000000008d703e3023f0000000000000570023e0000001d0000000004930143001c000000000000039f0107001b00000000000002f202f40000001a0000000008d70017028203a900000000001608d70574001800000000001408d70017000000000000001308d7000000000000000008d700120016020d0000000008d700110015000000000000000f08d7020b001400000000000e000f0000001300000000000d08d70247020900000000000c08d70012000000000000000b08d70011000000000000000a08d7001000000000000008d70009000f00000000000008d70008000e00000000000008d70007000d000000000000000608d70000000c0000000008d700060000000b00000000000508d70000000a0000000008d700050009000800000000000408d70007000600000000000308d7000500000000000008d700020004000000000000000108d7000000030000000008d700010002000100000000000000000000000000000000) + (NatTree.leaf 0x3c08d70041000000000000005c08d7004000000000001f08d7023208d900000000000008d70038003f00000000000008d70037001f00000000000008d70036000008df0000000000b4003e0000003d000000000034001f0000003c0000000008d7003508de003b0000000008d7003402f0003a0000000000b308d70039003700000000003208d7003800360000000000b208d70035000000000000002e08d7003400000000000008dd08d708dc08db00000000005608d700dd00000000001e08d700b0003300000000000008d7002a003200000000000008d70072001e00000000000008d700af000008da0000000001fe08d70000002f0000000000ad08d70000002e0000000000000000056b00000000001d00000000000000290000001c00000000002800000000001b00000000002700000000001a03dd042d0000002600000019002308d70000000000050002000300010000000000040001002108d7001900000000000008d700200022000000000000001f08d90000002100000000)) + (NatTree.node 32 (NatTree.leaf 0x6100000047000000000000035300000000000000000000005e0000000008d7005a003e00000000003b005908d7000000000000002208d7007800e2005c0000003708d70058005b000000000021005700dc0000005900000020011208d700580000001f001e08d700d5003000000000002d08d7058e031e00000000001d010e08d708e800000000000000000000000000550000001c08d708e708e608e500000000014108d708e4005200000000013e08d70051000000000000004d08d7001900000000002208d70238005000000000000008d7004c004f000000000021004b00a30000004d0000002000a008d7004c00000000001f08d702a0010300000000000008e308d7022d08e200000031009608d7013800000000001e010003160000004a0000000000000000067400000000002900000000000000460000002800000000004500000000002700000000004400000000002604a705050000004300000025003f08d7000002f300000000003e08e1000008e000000020) + (NatTree.leaf 0x70d000000000046000000000000007f0000004500000000007e00000000004400000000007d00000000004304fb05620000007c0000004208d7050f08e100000000003d08f608f50000007a0000003902fa08d70079005a00000035035208d7007800000000003308d70404007700000000002f08f408f3003100000000000008f208f1000008da0000002c05de08d7000000760000002b08d700710075002d0000000008f008d7002b00720000000008ef08d7007100000000000008d708ee007000000000000000000000005300000000001b08ed08d70000006f0000000000000000006e00000000001a000000000000006c00000019039f0107034f00000000001a02f202f40000006a0000001908d7006608ec000000000000013908d7034208eb00000000010300650000006800000000022f08d7006700000000000000fe08d7004700000000000008d700fc00640000000000000135026d000000630000000008d70390016500000000004a08ea08d703ea08e900000049))) + (NatTree.node 64 (NatTree.node 32 (NatTree.leaf 0x8d7009c000009040000003a023100a2000000a10000003908d7009b017600a00000003708d700cf02f0009f00000036023008d7009e009d00000035090308d7009b00000000003308d703710065000000000000010108d7013800000030004808d70902009a00000000002f08d700ff004800000000002d08d70136000001020000002c090108d7000000970000002b01ed08d7006200000000005408d7090008ff08fe0000005208fd08d708fc009200000051026708d70091000000000050008d08d7002500000000004f08d708fb009000000000004e08d7008c008f00000000004d008b01300000008d0000004c012d08d7008c00000000004b08d7008808fa00000000006801a008d7034208f900000067016500870000008a0000006602e508d70089000000000065012208d7019f000000000048015f08d7005f00000000006408d7015e008500000000006301e2033a000000840000006208d7044c01d800000000006108f808d703ea08f70000006000000000000000820000005f) + (NatTree.leaf 0xc000000080090a08d703ea09090000008100000000076100000000007f00000000000000bd0000007e0000000000bc00000000007d0000000000bb00000000007c05570596000000ba0000007b09080034090701130000000000000000005d00000000000000b4003e000003bc003900380000000000b700000000003700b308d7039c00000035003400b208d7000000000033003208d700b000000000002f002e00ae08d7090600000000000001fe08d700000000002b002a08d700ad0905002c0000000008d700ac00b100000000000000ab08d7002a00af0000000000aa014b000000ae0000000000a908d700ad000000000000017d08d700ac00000000005408d700a800ab000000000000014308d7000000a90000000000a608d7001900000000004f08d700a400a700000000004d023608d70000004e0000000000a20178000000a60040004c023408d700a5000000000000010508d700a40000003e004b08d7023200a300000000003d08d7009d004b00000000003b)) + (NatTree.node 32 (NatTree.leaf 0xb50000003500db08d7000000000041003401830184000000e0000000000000000000df00000000003300d908d700de0000003f00320000000000dc0000003d002f08d700d600db0000003c002e011003c2000001bb0000000000000000000000da0039002b01b70057000000d90038002a08d7014d007500560000007201fb08d700000000001e005400d208d7000002f30000004100d108d700d300000000003f08d700d000d200000000003c00cf004b000000d10000003800ce08d700d0009c0000003400cc08d700cf00000000003201000316000001020000004708d700ca00ce00000000002e0315016f0049000000000075016f08d7000000cc0000002a00000000048800000026006a03dd042d000000c90025006908d700c5090d00000000008a090c08d703f0090b0000008901d800c4000000c70000008803af08d700c600000000008701d108d7008000000000008508d701d000c3000000000084028a03cd000000c20000008308d704be0255000000000082) + (NatTree.leaf 0x8d700fd00cb00960000007208d700fc01000000006300ae091a08d7009400ff000000710135026d000000fe006200ac034808d700fd00000000007008d7091900fb00000000006f091808d7000000fa0000006d08d70454008700000000009902c108d7008300000000009308d709170916091500000092091408d7091300f600000091030f08d700f500000000009000f108d7004200000000008f08d7091200f400000000008e08d700f000f300000000008d00ef0198000000f10000008c019508d700f000000000008b018b08d7025b00000000008608d702b709110000000000c7091008d70463090f000000c6025500e9000000ed000000c5024e08d700bf0000000000c303eb08d700ec0000000000c408d7024c00ea0000000000c203000444000000e8000000c10000000003a80000000b00c000000000076d0000000300bd00000000000000e5000200bc0000000000e40000000100bb02ab090e00b800000000000000e008d7000000000000000008d700dd00e1000000000000)))) + (NatTree.node 128 (NatTree.node 64 (NatTree.node 32 (NatTree.leaf 0x5a30000004300c904a705050000011f004200c808d7092104080920000000f6035f08d7091f011d000000f5035e08d7011c0000000000f4011808d700000000000000f308d70414011b0000000000f208d70117011a0000000000f1011601ce00000118000000f001cc08d701170000000000ef01c408d702b70000000000ee015208d70000015100000000091e091d000008df0000003a08d7018100570000003b002d08d701b900000000003a002c010f08d700d80000000000b108d7014901100000000000ae08d7010c005400000000000008d7010b000000000000000008d7010a023e010e0000005208d7014302ce010d0000005202f408d7006d010c0000005102f308d7010a00000000005008d703bf010900000000004e02f202f40000000000000069091c00cf091b0233000000b808d7010400a20000005c00a008d7017401760105005a009d010208d7006600000000000008d702a0010300000000004a08d701aa009800000056009600fe08d700cd0000006400b1) + (NatTree.leaf 0x1420000004e00a908d7023802f400000000004e013b08d700000000000000e10139092d0000092c0000006708d70138013d0000006800e001f201390000000000000066022f08d7013c00000000006502c902eb0000013b006600dd01000316000001020074009508d7016f022d0095000000af029e08d700fc000000aa0093013308d70025000000a7008f08d701310134000000a6008d092b08d70000008e000000a5012f029b0000013300a4008c092a08d701320000000000a301e608d70131000000a2008b08d7092901300000000000a108d7012a008b0000000000a008d70129000003670000009f092809270000012e0000009e08d70128022a012d0000009d08d701660926012c0000009c092508d7012b012a0000009b092408d7012800000000009a01e408d702b70000009800860000000000000163005f00cd08d70923012700000000009706c6028c00600000000000cb08d7019e008600000000009608d701e30000016300000095092208d70000012400000094)) + (NatTree.node 32 (NatTree.leaf 0x8d7015e01610000008400fe01e2033a0000015f008300fc08d7052300c40000000000f8030708d700c10000000000f708d70937040809360000011d037908d70935015b0000011c037808d7015a00000000011b015608d7000000000000011a08d7043d015900000000011908d7015501580000000001180154020f0000015600000117020d08d70155000000000116020508d700000000000e0115018608d7011400000000000008d70242015200000000000008d7018500e209340000005a08d701b700000933003600af07f006f803c20000000000d5093208d7007300d50000007101b508d700d6014f003400ad093108d7014d00000000007001b308d7014c0000003200ab023e023f0000010f000000ac08d70930014b00000000006f0180023c014a0000002e00a9092f08d7000001480000006d08d702760000092e005200af0000000000000145005100ad014108d700a8010b000000510000000001440000005000ab013e08d702f5000000000050023908d7006b0000005400a7) + (NatTree.leaf 0x18000000033007000000000017f0000002f006f08d702a700aa00000000010e035008d700000147002a00a80000000004020000006a00ae040005110000017b006900ac03be08d700000108000000a503bc08d701790000000000a308d7050f01780000007a00a103fd093c01060000000000e2053403fe000001770079009e04b208d7017501040078009b093b08d7017400000077009a08d705ef017300000076009701a9093a0000093900d800cd075308d70000017200730094016e08d700ca0136000000ad016d08d7016f0000000000ab08d7016c016e0000000000a9026a08d70000016d000000a8016a08d700000000000000d3016808d7016b0000000000d2077701d9093803130000010608d70167016a0000000000d10166008b00000168000000d0016408d701670129000000cf016308d70088000000000103016208d701660000000000ce08d70390016500000061010208d7016001640000000000cc015f08d70125000000850100022708d700000162000000ca))) + (NatTree.node 64 (NatTree.node 32 (NatTree.leaf 0x3b403f5000001a20088013808d7019d01230122000000ff094708d70120019e000000fd042108d7019d0000000000fb08d70946019c0000000000fa094508d70000019b000000f9094408d7000000f200000132094308d7019900000000013008d70942019800000000012e08d701930000041b0000012c08d7019200ef00000000012d03d201dc000001970000012b08d701d9068201960000012908d7019102e201950000012a094108d70194019200000128094008d7019100000000012700000000000001d50080012508d7093f019000000000012406c6028c008100000000012308d7025a000001d50000012108d7022200ee000000000122093e08d70000018e0000012000000000063800000000011f00000000000001890000011e032908d700e700000000015c08d70242000000000000015102fa08d7093d015000000078035208d7018500000000007701bb08d700dd00000000003008d70404018400000000007608d7018000000112003700720000000000d7018100350071) + (NatTree.leaf 0x8d70283000002160000018c0000000006a500000000018900000000000001be0000018802ae03c5000001510000011408d702f80183000000000056011003c2000001bb007400d508d701b7000001110000014f05f100ad02aa01ba0031014d01b508d700d601b90000014c03e501100000014e0000014d01b308d7000000000000014a02a808d70536000000b100aa0180023c000000000000014708d7027700000000002c010d000000000000017e002b006d08d701ad00000000004d010d000000000000013f00a800a5034d08d700690000000000a7004b027200000000004c010b00000000000001f1006900cd01a808d7000000000000010008d7026e00cb010100d500ff01a708d7017100000110010008d701a600000000000000fe08d701ef01a90000010f00fe01ee043100000000000000fc03dd042d0000000000c8010701a208d7000000000000013d01a0065f000003f70089013c08d7019f01a40000008a013b029701a0000000000088013a02e508d701a3000000870139)) + (NatTree.node 32 (NatTree.leaf 0x1dd08d7000000000000016b01dc0335000001e000f0013101db08d701df00000000016a028f08d701de000000ef012f08d701da01dd00000000016801d900ef000001db0000016701d708d701da01930000016601d508d700c500000000016501d408d701d9000000000164028d08d702b7000000ee012608d7044c01d800000082016308d701d201d700000000016201d108d7018f000000c30161028c08d7000001d40000016008d701d001d3000000c2015f028a03cd000001d100c1015e041308d70000011900000199041208d701cf00000000019808d7041101ce00000000019708d701ca011600000000019504100256000001cd0000019408d701c9032a01cc00000192040f08d701cb01ca0000019108d701c60000047b00000196040e08d701c900000000019008d70219068201c80000019308d7040d01c700000000018e08d70254011500000000018b04dd08d7000001c50000018a00000000000002160000018f08d7057b00e900000000015d0000000000be00000000018d) + (NatTree.node 32 (NatTree.leaf 0x69200000000014e01fd08d700000200007100ad01fc08d702d20000007000ab08d701fa02d00000006f00a908d7027800d40000002d010e03a108d7000002cf006d00a8003e02cd000001fb0072010c0000000001b101f90071010a02f408d7014602a70000010a0000000001f800000070010902f308d701f70000000001090000000001f60000006f010808d703bf01f500000000010801f008d700000000000001030000000004580000006a010208d703ba00000000000001020347036d000001a700fc0149039808d7000000000000013508d701eb009300000000010e08d701ea000000000000010d08d701e904df01ed0092010c08d7026a042f01ec0092010b094808d700f901eb0091010a056108d701e900000090010908d705fa01e80000008e010808d701e5012f00000105012d08d70298032a01e60104012a08d70291012600000101012208d7022702e4012100000136036208d7015e000000f7013501e008d70042000000f3013408d701de01e1000000f10133) + (NatTree.leaf 0x8d7094b022000000000019b094a08d70000021f0000019a021c08d700000000000001df021b08d7021d0000000001dd08d7021a021c0000000001db021901160000021b000001da021708d7021a01c6000001d9025208d700eb0000000001d8021408d702190000000001d708d704be02180000000001d5024e08d701c20000000001d308d7021202170000000001d408d7024c02150000000001d102b608d700000214000001d20300044400000213000001d0043c08d700000157000001cf043b08d702100000000001ce08d7043a020f0000000001cd08d7020a01540000000001cc08d70209000004b8000001c80439027f0000020e000001cb08d702080000020d001401ca08d702460682020c000001c600000000020b020a001201c90000000002080000000f01c70000000002070000000c01c508d7027e01530000000b01c40000000000000206000901c308d702af00000000000801bf02d308d701bc00000000015208d70377020200000000015108d702d20949000000af00d5)))))) + (NatTree.node 288 (NatTree.node 128 (NatTree.node 64 (NatTree.node 32 (NatTree.leaf 0x3e408d701b600000000014b043408d701490000000000aa08d703e3023f0000001d0148035008d7000000000041017c08d70276000001b2010b01450570023e0000023d001c014608d702370140000000a6010e023608d7000002f300a500d300a202f10000000000a4010c023408d703bf000000a300d208d703e001ae0000000000a608d7023203be000000a100d1053403fe00000904009f0113023100a2000003bc00b600d0023008d70000000000b400cf022e08d70000000000b300ce08d7037101390000000000990174022c0000000000b200cc04af08d70000009900000049034b08d70000000000b000ca000000000000026800c801ac000000000169000000000176016103f2000001630137012100000000000003f401250171022608d7016001e30000016f022508d7022700000000016e08d70224022600000000016d031208d7000002250000016c077701d9093803d40000016908d70221018d018b0000019e094c08d7018a02220000019d04a008d7022100000000019c) + (NatTree.leaf 0x4e300c601a308d7025b0260000000c701a20331025c0000000000c501a103af08d7025f000000c401a004a604e10000025e00c5019f08d7028c0000018c000001e3025808d7007b0000000001e108d7025702590000000001e00256038600000258000001de02df08d702570000000001dc025208d702b700000000021808d7025101c001c40000022202dd08d702b70000000001d608d704be051b000000c0021604db08d701c3025400000221024e08d7035d000000ea021504d908d7025100000000022008d7024c0250000000e8021308d704d8024f00000000021f030004440000024e00e70211063508d70000024d0000021e024908d7000000000000021d024808d7024a00000000021c08d70247024900000000021b02460154000002480000021a024508d70247020900100219024408d702460000000d02170208024302450000000a021402d808d7000002440007021202ae03c500000000000001bc027a0692000004b5000000d8079b045d01b800000075014b)) + (NatTree.node 32 (NatTree.leaf 0x2ff08d7028000000016025608d7027d000002050008025400000000020400000006025103c404d300000201000001bc080a01b706f30351003100b802d108d7024100000000011004f4027a000001ff000001b6003e02cd00000000004001f9001f02cc000000000020023b027508d7017c023b00ad0143027408d70000000000ab014108d7031c0000000000a9013e00000000000001f4006d0179039d08d701af000000a3014303fd03df03fe000000000105053403fe000002a20000017507f006f8093a0000014e01aa043108d7017001aa00fd014d043008d7026e000000fb014b08d705d0026d000000fa0148074d08d70000026c00f90146026908d7016c01ea00910143026708d7042e000000900141000000000567000000c901f108d70345042d0000008e013e026408d700000000016101ab026308d702280000016101a908d7026200000000015f01a808d7029002650000015f01a702c2052b00000000015e01a604a7050500000000011e01a5025e08d700000000000001a4) + (NatTree.leaf 0x39908d700000000010001b408d703b801350000017d01ed05f908d7000001e701320179059e08d700c80000013401ae05f708d7029d00000130017808d70766029b0000012e0177000000000000029a012b0175091008d7029901e501280174029508d700000000016501f2078608d7029800000127017308d704c700000000016301f000000000000002c30125022b08d708020296000001240172089708d7000002930120017008d7033b012301e401aa019e0420046800000263015e01ef08d7028e01dc0000019501e608d70332032a028f019201e508d7030d01d60000018b01e4028b08d701d2025a00000227028908d7028c00000000022603cb08d701d00000015c01e208d70288028b000000000225036008d7000002890000022407bf02190541044600000223000000000000056000ec025f038202840000000000eb025d03eb08d70286000000e9025c08d702b6000001bf0000025a028108d700b900000000025908d702800282000000180258027f03aa0000028100170257))) + (NatTree.node 64 (NatTree.node 32 (NatTree.leaf 0x8d702bd04df02c100f601eb08d70312000002c000f601ea094808d7019a02bf00f501e9056108d702bd000000f401e808d705fa02bc000000f201e701d304a5000001d5018c022902b808d7000000000000026008d702b702b9000000ed025e055d057d000002b800eb025b02b508d7021202830000028c02b408d702b600000000028b08d702b302b5000000000289037a08d7000002b400000288000000000000047700170287000000000000059400120286040708d702b10000000f028408d702d8000002030006028302d308d7000000000000020203e708d7027c00000000020208d7047602ad00000000020108d702fb000000000036015005de08d7000001820031007301b804f20240000000d5014808d7037301b4000000ae017d08d702a6023e017d0000010c03a0014301460000005201f704000511000000000107017a03be08d7000001f30000017903bc08d702a400000000017808d7050f02a300000000017708d702ec0176027101040150010003160000000000cd0137) + (NatTree.leaf 0x8d702de025600000000028f08d70383032a02df0000028e08d7035b025300000000028d040908d7021100000000028a02da08d700000000001502b908d702d902db0000001302b805730592000002da001102b702d708d7024302af000502b602d608d702d80000000402b508d702d502d70000000302b403a508d7000002d6000202b3032108d7032000000000000008d70377000000000186020102d008d700000200014d01fe08d703c1027a00000000010f02cf08d702d20000014b01fd08d702ce02d00000014801fc049408d7000002cf014601fa0000000001b10000000001f8034e08d7017c00000000027600000000017a000000aa01ae034d08d700000000000001ae031908d70138000000980183076a016f04330317004901b803b908d7000000000093029f042d08d7026b0397000001f7042c08d702c60000000001f508d7094d02c50000000001f30000000005a6000001630268048408d70000000001ee01e208d702bf00f70000000001ed08d702be00000000000001ec)) + (NatTree.node 32 (NatTree.leaf 0x8d702fe027f0000001402df000f038300000000001202de03c608d700000000000502d504b60604000002ac0000027c02fa08d7039c000000b40185035208d70000000000b30184059006f3027b0000007500e2011003c20000000000d801ba062e08d7000002a9014d0146000000000000031d0053023a02f408d702ce0434014301f702f308d702f50000014101f508d703bf02f40000013e01f3037208d700000000000002ca0000000002730000010a0178056e02a300000235000000a400000000067d00000068023d039a067d0000094e0149013c00000000000002ef0066023a04b208d7027002a101850174093b08d702ec000001840173076a016f0433034c00fd02c8070d030c0000026f01b6026e042d08d7026b03b8009102c6042c08d702e80000009002c508d7094d02e70000008e02c408d7045401a0000000f8022f05c208d7000000f80060022d0000000000000310011e029400000000022300000000022a00000000000004e0018f022804fb056200000000007b0261) + (NatTree.node 32 (NatTree.leaf 0x4b6060400000353000002fc04f308d7027900000000023f08d7058e031e00000055023d039e08d70000000000a8023803fd03df056e00000000027108d705ef02eb00000099017208d7048d02c90000010101bb04ce08d701ac0000010001ae01a9093a00000939013701ba04ec016f022d000000cb013608d7043204af000001aa020008d70650029c0000013302350950094f00000367012c0233031108d7022402be00f5026a030f08d70000000000f402690000000006700000011f02c308d703d80000000000f20267030b08d70000000001d3026608d703ce018d028d02220291030a08d702e1000001d3026508d703090000000001d1026408d7032b030c000001d10263038a05d30000000001d0026208d7030600000000000002c008d70305015c0000000002c108d7036000000308011d02be08d7030404df0307000002bf094808d7021e0305000002bd056108d703040000000002bc08d705fa03030000000002bb025004f80000021601bf02ba044208d7024c0000018702dc) + (NatTree.leaf 0x33e08d700000000012702300298033d000000000124022e042408d7000000000120022c07f006f8065c0000026f0291052b08d702920291019d026e052908d7033b0000019c026d08d705d0033a0000019b026c074d08d700000339019a026b05f908d7000002bb0199029d059e08d7011e000001e1029c05f708d7033700000198029b08d70766033500000197029a000000000000033401940299091008d70333028e01910298032f08d70000000001d80297078608d7033200000190029608d705d50000000001d502950000000000000361018f02e308d7080203300000018e0293089708d70000032d018a029204df05460000030a01d002900000000002870000000002e208d70328018700000000030708d703270000032900000305063408d7024b03280000030408d703240000000000000308059508d7032700000000030308d7037a00000326015b030608d706210325000000000302055705960000000000b902e008d7032002d400000000000003c502ad0000032100000000))))) + (NatTree.node 128 (NatTree.node 64 (NatTree.node 32 (NatTree.leaf 0x35e08d700000000011b031108d70414000000000119030f000000000000057c00bf02e1035a08d7000000000250030e08d7040c01c002dd0000030d08d7035900000000024e030b03e9060700000000024c03090000000002b200000016032a08d70356000000000001032608d703a5000003570001032404b60604000003750000031f05b108d702fc0000000002ad08d7079103540000000002ac08d704040000000000b2018205390815000003e600740113034e08d700000000003f02cc04930143023a0000001b02a6027400b600000000003c027508d703e002ca00000000023501a905530000031900ff0317034908d700000315016f01fe0000000002c8000000cb0240034808d704320000016e01fd08d7034604310000016d01fc05aa08d701ef00000135023e04cc08d700000430016c01fa034408d70000042c01320238034308d704ea00000130023608d7034104e90000012e02340952095100000367000002700340012f000004e8012b0232033f08d70000000001280231) + (NatTree.leaf 0x8d70802038100000000032d089708d70000037f0000032c08d7060801c000000254035b037b08d7035d00000250030c08d703ac037c0000024e030a037908d702b30324015a0360037808d7000000000159035f08d7043d000000000157035e03c404d3000000000242027c05b108d7031f00000000035408d70791037600000000035303e501100000000001b602d200aa03e20000000000ac02a708d703ff000000000000034d04af01030000022f0000022d08d705520318000000fe02350000000002ea000000fb034a000000000000048b01ef02ee056a08d702e90000023f026d08d7070b036d0000023d026c080504df0000036c023a026b095608d7000002c4000002a4042b08d700000000000002ca095508d7036a0000000002a308d7095403680000000002a206840637054b000001e6027108d703dc022a0953000002a10952095100000393012b0342048508d700000000016102c708d704a901e20000029e02c100000000069c000001d50310035f08d702880306011c0312)) + (NatTree.node 32 (NatTree.leaf 0x1f7047400000000000002f3039d08d70000000002360272013e02320000000001410234053403fe000003bc02320270053308d702700000000002ec05ab08d702ee00000139023e08d70489029f000000fe02a808d705da0000000001ec029e08d7095903470958000002a7095608d7000002e60132036a045608d700000000008f0369095508d7039600000130036808d7095403940000012e036708d703f6022a0366012a036503f408d7019f0000016502c9016103f200000000022902a004aa08d70000000000f70363050508d703380483000002e8050408d7038e0000000002e708d70957038d0000000002e6068708d70000015d008102e4051f08d700000000028a02c200000000000003ae0188032e05f908d70000030200000337059e08d7018800000000033605f708d7038800000000033508d707660386000000000334000000000000038500000333091008d7038402de00000332038008d70000000002550331078608d7038300000000033008d70627000000000252032f) + (NatTree.leaf 0x3be08d7000002f3023802a403bc08d703bf0000023602a308d7095a02cb0000017d023508d7050f03be0000023402a200000000000003e10146027001ab04af00000000000002a008d704ae02c7000001ed039908d703b70347029e0092039707410360026b0000009202e800000000022b0000029c0318000000000000056601a3036e042508d7019f0000008603910000000000000453006002ea050508d7033804a900f5038e050408d703b2000000f4038d08d7095703b1000000f2038c08d70523025c0000015d02e500000000070800000189036100000000000003c901c20389055b05cd0000037b024c032b062008d70000032300000388061e08d703ab00000000038608d7077f03aa00000000038503a708d700000000000e038208d7063000000000000b03800378000200000000000303790379000102d503560001037a05b108d7035500000000037603c308d700000000005b00e1027b068102f9000000d5015003a008d702ce0000000002f5039f08d700000000000002f4))) + (NatTree.node 64 (NatTree.node 32 (NatTree.leaf 0x139039b00000000013c02a102c806a1034a000001aa02a9048708d70000000002f20395095b08d703420365008902ec065d08d703dc0000008702eb000000000000046b019d03b3070d030c0000033c02e9033b03d708d7000000000199034503d508d7000000000198034408d706500336000001e0031408d703d300000000019703430950094f0000041b0196031303d201dc000000000194034103d108d7000000000191034003d008d7000000000190033f033203cf00000000018e033e04a308d700000000018a033d05d308d7032c030d0221033b05d108d703ce00000220033a08d705d003cd0000021f033908d7051e028a000003070362074d08d7000003cc021e033800000000071e0000021603ae00000000000003e801bd03ad05e008d701bd00000000038703a6000100000000000403a5040608d703200000000002d403e708d70000000002ae02ad08d7040303a30000005900e005f100ad02aa000000af01b80515031e000002d100310149000000000000043501b801f7) + (NatTree.leaf 0x58b03be00000000000003e0058c00cf02f00000009c010608d704b30000000002ab02a1000000000000037000fc02f002c806a1036f000000fa03de0000000005ee00000068036c00000000000003fa0066036b07be047c00000314013102f0052e04c8068d00000000031b05e908d703640392012803dc065d08d703f60000012703db08d705c303910000016303190000000002940000016103b605ff022702e4000001e3031608d7052d05c20000029103150724063d0000041b0000036407f006f807220000030d033c060b08d703ca04fd000003b2056108d703ee0000000003b108d705fa03ed0000000003b008d7057b0284000001c103af06bf08d7000001c100be038b057708d7000000000300038a00000000075d000001be03c908d704760000000002ac02d308d7079103a400000000037503e408d700000000023f02d008d703e300000000023d02cf0570023e00000000023a02ce058d014302f70000014b02a60000000005af0000014802a2056e02a30000034d000002f0)) + (NatTree.node 32 (NatTree.leaf 0x5bf08d700000529019a0346096108d70000038c00000396052708d70000000000000395096008d7041e00000000039408d7095f041c00000000039306840637063d0000028f03660724063d0000044e019403f0052008d70000000001d3038f060b08d703ca051e030403ee056108d704170000030303ed08d705fa04160000030203ec041308d70000000001cf03d8041208d70000000001ce03d708d704110000000001cd03d5041002560000000001cb03d3040f08d70000000001c903d2040e08d70000000001c703d10383040d0000000001c503d004dd08d70000000001c303cf095e08d7037e035b000003ce060608d7040c0000000003cd08d7095d040b0000000003cc08d7055a02dc0000000003cb095c08d70000040a000003ca08d7059102b00000000c03eb08d7040503c500000000032104d30354000004060000032005de08d70000000000b002aa0571045c000003c3004000dd0000000002f6000000b1034f0000000003c0000001f50240053708d70000000000aa02f2) + (NatTree.node 32 (NatTree.leaf 0x59508d7044000000000041608d70962043f000000000415043c08d70000000002100414043b08d700000000020f041308d7043a00000000020e04120439027f00000000020b0411043808d70000000000120410043708d700000000000f040f0383043600000000000c040e04f508d7000000000009040d067e07370000061c01ba02a708d704f1023e0000017d02a7075308d70000031a017002aa043108d70000031502d2034b043008d70432000002d0034908d7042f0431000002cf0348060101350000043002ce0346042d08d7042f05aa026a02e8042c08d7042e0000026902e708d704ea042d0000026702e608d704e7036900000000034d0000000003b6000003140370060e05d6069f0000012d03f700000000069e0000008a03fa0000000000000428008803f908d706ff03db000000f8031a08d705d903b40000012203f4042308d7000003f1019d034b042108d7052d0000019c034900000000000005c1029003b508d7041f052b0000019b034806b208d70290000001e20347) + (NatTree.leaf 0x76506df000004b8020c0446068008d7000003a2014d018504f4027a000000000279037406a308d7045e0000014b018408d70790045c000001480182000000000401000001f302a9053808d70000000001b402ca0000000002ed00000103034f079908d7000003de026e02f708d7050a03950000008d042b08d706ff03f500000124042605c20165000002e502e403710265065c000003f40229034c0000000003b300000123036f096108d7000003b00199041e054908d70000000000f3041d096008d7045100000198041c08d7095f044f00000197041b08d704c602e209650000039201d304a50000000002ba0390054508d700000000015c0418060b08d709640543011c0417060a08d7044a0000011b0416070a08bb044900000119041508d7065003870000000003d6076506c10000047b01c803d4060708d70000037d0251040c060608d704450000024f040b08d7060504440000024d040a08d705760300000003290409076e02dc00000443024b0408096308d70408055a00000417))))))) + (NatTree.node 576 (NatTree.node 288 (NatTree.node 128 (NatTree.node 64 (NatTree.node 32 (NatTree.leaf 0x5220221046405f908d7000003ec00000451059e08d7000000000387045005f708d7047e00000000044f08d70766047c00000000044e0684063706c100000000041a000000000000049b0384046308d7069603c7000000000447076506df000004d40018045f04b60604000000000355037701b804f200000000020002cf047308d700000000000003bf047208d700000000000003be08d7061900000000000003bc0000000005f00000017d031b0826014309660491018501f7077b006604700000018401f504ce08d70000000002f2031806b708d7036e00000347039a079908d7000003fb00f904570000000000000425019e04530000000003f30000015f042a0000000003da0000019c0452070c08d703d90000033a036d08d7070b046800000339036c080504df000004670338036b08d704e202e2041a0192044d0000000000000500008103da000000000000047b00000419063408d705ca057603270440059508d7046200000325043f08d70621046100000323043e) + (NatTree.leaf 0x60c08d700000000021e041f05f908d7000004150388047e05b808d7000000000259047d05f708d7049e00000386047c08d70766049c00000385047b00000000000004c001cb047907f006f807850000037d03ef059808d7000000000250044b0783037a05ca05b2015a0462064a0322049700000159046100000000049600000157046003a0014305b00000010b03a1039f010700000000006a03a005f0096c0000053800ac03e00139096b0000096a015002a70000000003bb04b4009b0470077b006604900000009a046f047007aa046f0000018201f301a90553000000000171034c00000000068f0000026f02a2000000000664000001a7031b00000000050c00000271029e013505500000000000fc039707410360036b0000034f03b708d7054d0000000003720456096908d703420000039b03dc08d705a503630000015f03b908d706db000000000362039808d7096804200967000003b80000000002e30000033603f30000000000000653025f042204e008d7025b000001d803b4)) + (NatTree.node 32 (NatTree.leaf 0x8d70540032a047a00000465025004f8000000000301044c000000000000057a00be047f05b308d70000000002dc0498097008d70000043e0000049e05c908d7000000000000049d096f08d704bb00000000049c08d7096e04b900000000049b0000000000000517020b049a05b108d70000000003a403c402ab064805710000011201bb0139056d0000096d009d049104b208d7039c000002fb02ec053208d70000000002fa02eb047007aa048f00000097048e046e066500000000010703ba04ec016f037100000000031601350568000000000092048902c605870000000002e6039f06b408d7036400000128048606ef08d703b5000001a0046d08d705c0038f000002c1048508d704a80420036200f60483050509170338000000f603b205a108d70000000003dd0450050108d7025b000000ee048006c6028c038b0000018d03f208d705d406870000030d03f104a108d70000000002210424070d030c000003ef03d903ce04a008d7000000000220042303ce049f00000000021f0421) + (NatTree.leaf 0x72108d7032b0000028a04200287071f032a057f02de04bf04db08d700000000025104a3000000000000059a040c04bd04d908d700000000024f04a105cc08d700000000018704bc040c04d800000000024d04a0063508d700000000024b049f062008d70000046003ab04bb05e008d70000000003c704ba061e08d704d7000003aa04b908d7077f04d5000003a904b8053a08d704050000000003c5086805710000045b014602aa0840027604d20514018501b80000000007370000007a02a9056c08d700000000018302ca08d705520000000003720370000000000000048c027002e904cb08d7042f000003a1042e04ca08d70000000003a0042d02e805a900000000026704ad065f054b000004e80341039c01a0048600000000036503df026605c200000000039003ba090c08d703f0044d00c603f6073108d704c6000000c403f500000000032e000001d3048208d108d70000044801cf049e05cf08d700000000011a049d08d2028c04c3000001ce049c07b808c804c1000001cd049b))) + (NatTree.node 64 (NatTree.node 32 (NatTree.leaf 0x4640000018d046900000000000006af032b048108d7097204df0971000004a90000000003890000038704c405f808d70000000004a7049d0287071f032a059c01ca04de00be062606bf0000037d04a406f902b603ea000000be04a500000000000005b5025104dc05f308d700000000028204d604db000500000000000604dd04f308d700000000031e03e508d7058e00000000031d03e4062e08d70000000002ce02f702f4034f0000000002a702f5000000000000045a02a402f7085e067e000004d0007902f7067c039a00000000013a03e3058908d700000000004804cf031504320000000000cb0315056b01a9000000000374043204e9029c0000042c034503bf04e808d704ea0000034403be08d7066104e90000034303bc068d03680000042b000003e0000000000000042a00fc03f801a004ac00000000012a04c807be047c000003d601de03f8060e05d6076700000000042906c708d704190465019104c6073108d704e20000019004c508d7069b0480000001d50425) + (NatTree.leaf 0x8d7072f0000000003cb048408d7051d04df03cb030504fd0634037a03ca0000041704a800000000000006ec00ec04fe057c08d702b70000025504a60000000003ad0000021504fc0000000000000495021004d70000000005190000020f04d50000000005180000020e04d400000000035805c8001404fa066700ad03c1000000af023e027a0692000004b5015001ba051104020000058f02d202f5079b045d04d1000001840240051008d70513000002d002f408d705b00511000002cf02f3053403fe000000000233039c0139053400000000013c03fd0664068f0000056c017103e00000000003fc0000013503fe052f06f00000000001a504b0069f039400000456008c04e703b3079804520000029103fb0000000007140000008a046700000000000005080088046605be08d7052806b203b2042e050408d70506000003b1042d08d705bc0505000003b0042c000000000482000003d6046a0000000007760000019504e308d706b104a60000018b04e000000000000004e002ba046b)) + (NatTree.node 32 (NatTree.leaf 0x78608d70540000000e904e1059b08d702b700000253051b0761037c00000499044504a208d70559000009730000051e061f08d700000000015804f608d7057204d300000000040605b108d700000000000004b608d7061a04590000034d03bd08d706d100000000037203bd067e07370000061c00ac00d803fd0646067e0000005c02a8053308d7039c0000039b04b30532006600000000006804b208d705ef00000000031a0352000000000000058802e80490077b00660531000002e7048f05c408d70000000003dd046e08d705eb00000000039203fd052b08d7000003f104320424000000000000046a015e04e6052908d7052d00000431042303b3079804690000019b050908d70528052b00000430042106ee01e200000529042f041f08d705fc041d00000000045600000000078b000000c70508000000000000052600c5050708d707c204c50000015d0455068701d8000003af038b045400000000000005010222050000000000047f0000022004ff08d706290418000001d104aa) + (NatTree.node 32 (NatTree.leaf 0x71d08d7000004de03830540078608d7055f00000381053f05b608d702b700000115053e0000000004bd000001c00521076f08d703ac0000030004df08d70559000004090000053c0634037a04080000015b051d0000000003c8000003c7051a063208d70000000004a704f604d1083005120000018202a9061c08d700000000018301b40315067b0665000002f30315076a016f0433000002ea03c2068e06790000000001a60492046d05ee0000000001ef03df06f1026a04570000026d03e2000000000530000002e604b100000000070300000393048c06ce04e90000000003ff050a00000000061600000366048a07bf021903f80000012903fe081d08d70000042602e4043308d7060f0450000000f1052708d707c204e10000018e05240000000004c4000001d10503070c08d704a2000003cd046808d70639044b00000307052008d7070b0546000003cc046708d7097400000721011d051e080504df0000054403ca046607be047c00000447000004e4091008d7046304bf00ec04e2) + (NatTree.leaf 0x7c6000002df0560071d08d7000004fa01c9055f079e08d7057e000001c7055e08d70705051b00000252050106bf0218000003eb03ea0523000000000000057c030105220000000004dc0000040b055c000000000000071b03ac051c08d70755000000000442051f08d70575000004420328055a0634037a044100000327055907e504b9000004780000054105c708d702d90000000e055d060403760000053a00000405060300340403000000b801830493014300000000034f0494039f02a50000000000ae0493058c00cf03e00000000003fe0000000003bb0000039b049008d706b904cf000001bb034d056a08d70000000003e5043108d705690000000003e4043006dd03470000000003e3042f06f1026a046c0000009105500000000003f900000103048800000000074800000429048b081d08d7000004550120054a07a308d704220000042004ab000000000000072104170506056108d7056300000416050508d705fa05620000041505040000000007be0000047a0502))))) + (NatTree.node 128 (NatTree.node 64 (NatTree.node 32 (NatTree.leaf 0x97508d7041900000191058008d70650047d0000044705490000000004fc0000044705470000000007d8000001cc057f08d7071c053e000002dd057c000000000000059b035b057a0000000004f70000024f057908d7068304980000024e0545000000000000076f04620563059508d7059700000461056208d7062105960000046005610000000007ee00000014057f00000000000005160012057e0000000005930000000f057d06d20218000004070009057b027b06810000000002ab03a20200067f0515000002000434061d051500000000007403e3039f02ce0000000002cf03a003fd03df000000000176031b05dd00cf000000000000056e06650458000005ab02f5037108d706cf04ed00000096056c000000000000048a03b804b4058508d70000000003960474062c08d700000000039504ed058408d7000000000394047308d707280000000003930472000000000000054e036404cd05fe08d7000000000266052f085108d700000509033b046c097508d703f00000048604c6) + (NatTree.leaf 0x5be08d70528000004cc050605bd08d70000000004cb050503b2065700000000030f05a205bb033600000504045104ea05ba08d705bc0000044f04e908d7072505bb0000044e04e807dc08d704810000025c056408d7066e049d00000258059e08d70802053f000001c1054808d7072d055d000001c4059b00000000000005b60254059a00000000051a00000213059d08d7069704bc000004090598059606a50000076f015b057608d707910000000003e703e606ba08d70000051002ce03bf0000000004f0000002a303e20139056d00000000013c04b405ac08d700000000000005340532013a000000000000053308d706d0039a0000022f043408d706770347000003b8043405a808d700000000016b058705a708d700000000016a058508d70733000000000168058400000000042700000165056701e2067100000000048304ae085108d70000052a019a05810741036004660000048804a8038e06420000000003b004ca08d7065400000000048705490724063d000005ba041904c9)) + (NatTree.node 32 (NatTree.leaf 0x5580000047805b405f100ad0000000002d203c203fd050e00000000009f058c039f04b00000000001f00493085408d7000004b1009405c508d706010000000001ec03b80265067500000000019e05c30000000007b30000033c054e00000000065a00000362054c025c058000000000044d04e5030e068700000000044c04c705d308d7000004a403ce052d05d108d705d4000003cd052b0464080f04ff0000030d052a08d705d005d3000003cc0529074d028a000005d103ca052808d7068504c20000011805b808d70802055e0000037f05b7076008d7053d00000444054608d706a604da0000032905b308d7075f05cd0000044305440839055b000005cb0441054208d7068204ba0000000005b80000000007f90000020d059408d7073905730000000b05b600000000000005c7000805b5085408d70000048e02aa02a408d7064400000000048704ce0265065c000000000453048d05ff02270454000003f204af00000000076800000263056601e2068b0000000000f605a5) + (NatTree.leaf 0x3f1052d0000000003f104ec08d7068c00000000026405c4067402650000000004eb052d0767041c000005270000050a03ee069a00000000041505bd05f9038700000561049e05bc05f708d705fa0000049c05bb08d706a90000000005a105b808d7076605f90000049b05ba000000000803000000ed05e400000000000005f600eb05e3076308d7046300000540059f08d706a404f60000001805e00000000005920000000c05e10475037400000000020002d0066600cf0492000000aa056e075308d7000000000404043307ea08d704cd0000036d039b04ca01a500000000049304cb000000000000061503f6053105e908d704c9000003f604b30000000005ec000003f50530067608d70000000003f504b20582077a0000000004c7050b000000000000050304e4052c025c059f00000000019205d60464080f05210000021f05d20000000007da000000c7054400000000000005e400c5054200000000000005f7047905a000000000057d000001c505ce08d7069604d60000047805c9))) + (NatTree.node 64 (NatTree.node 32 (NatTree.leaf 0x8d706d3053b0000015605f308d7077f0620000004d405f7056f01430000000000b1057008d707360555000001bb02a8039f050f0000000003a003bc05f005af0000000002a7049205ad056e000000000000050f02ea06b800000000016d06020000000006f00000042c05540000000004e600000135054b000000000000054c0392058804ab069e0000000004e5055106ca08d70000000003b405860000000005ea00000455054f00000000000005d803d9058306c908d70000000004a705820776044f0000054900f005fc022306c8000000000465052e000000000000054701d005e7060b08d700000000044a05bf060a08d700000000044905be041706ad00000000011905fb076308d704790000038305f4060708d7000004f9044505d4060608d706080000044405d308d7060506070000044305d1076e02dc00000606044105d0064908d705720000000004d302ab06480000000000e204b502c806a10000000003fb047504cb026a042f000001ea04cc000000000000062c0171050a) + (NatTree.leaf 0x8d707cb00000000044e05a70000000007110000041a05d707bf021904e4000001dc054b087c08d700000524038b0565081a08d704fe000004df05b9088408d7000005d203ce05a4028a070900000000030506290741036005420000044a05a3028405f40000000004bf05e604bd0848055c0000037d05e5063408d7000000000462060c063308d7000000000461060b044006d6000000000323062208d706e00000000005a105f30000000004b7000000120628035c06d20000000000080627079203000000000000020623058d01430000000002d00494077d046d00000000013a056908d70751058600000456058901a0065f0000000001a3052e061007cd00000000026105e8028a06fa0000000004fd05c008c608d7049a000001c90609035c06bf0000000004be05d5062508d70000000002b60608062408d70000000002b5060708d706230000000002b40606078403000000000002b30605041706bd00000000043e060a062003c70000059504d705fa061e08d70621000004d505f9)) + (NatTree.node 32 (NatTree.leaf 0x65e08d704c90000048605eb0676008800000000008a05e908d706ff000000000455053208370227054a000003f2055305640714000000000290061400000000052c000001e2061600000000000006b303b205ec000000000659000003b105ea065608d70000000001df0642065508d70000000001dd064108d707dd0000000001db063f07a105bb00000000054d060f0000000008070000050205c1087c08d700000548018a063c088408d7000005e5021e063a07be047c0000059e0541060f000000000000059d0541060d028406090000000002de0637082a08d7051c000000e9063b04bd084805790000040a0636064a08d70000000001590634046206e3000000000157063308d706f3060400000000053a027a0692000000000241051408a908d70000055602aa02f7039a067d0000000002ee049100000000000006b7042e058a076907180000000001a6054d00000000000006ca02280600064108d700000000045105a9063f08d700000000044f05a80000000007e80000044e05d8) + (NatTree.node 32 (NatTree.leaf 0x51104020000000002a7051306de00cf05360000010601b40826014304ef0000023f047005dc01430000000001f20570067903180000055403bf043203fd05510000000001a7058c067808d7067b000003be043108d707290679000003bc0430042d048800000000042e04f108d70715000000000162065d0837022705650000019d065c067308d700000000052b056b08d70672000000000529056a07b20420000000000528056907ce031205810000033a05680000000005070000016505a306fb08d700000000030e061007c6049c000005b802570650028406280000000001ca064e00000000000005b40211064f0000000005990000024d064c000000000831000005cb05f6000000000000066a05ca05f502b00609000000000012064e0200067f000000000075058f03fd05ae00000000017d058c0690016f058a000002f404af067a00cf050d000001a9056e07f8050c00000678039c042f000000000000054f039605db065f054b0000000004c9050f07a704ab0000000001a1062d) + (NatTree.leaf 0x6b60166050a0000008b068d000000000583000004ac05ee00000000077a000003f10617000000000525000001d80670030c072200000000044c05d9069908d700000000049e0657069808d700000000049c065608d7080400000000049b06550300075400000000055a068307e504b9000005e00574068200000000000005df0574066c0287072b000000000014068402b0063100000000020a06680840027604d2000003c204d103c0073800000000020005100315067b0000000004ec05540863016f05c5000002a303c2075200cf0000000001ee05f006a0016604e700000129056e07a5078e000000000262064407ce031205a4000000f50671000000000658000003b00612074708d7000000000450061300000000000006400419061106c6028c0523000004a505c2000000000742000003cb063e07d804c1000005cf0117066e0287071f0000000004fa060e0300074b00000000024c063907d3049c000005c90000066e068008d70000000002fb045e06a308d70000000002fa045c)))))) + (NatTree.node 288 (NatTree.node 128 (NatTree.node 64 (NatTree.node 32 (NatTree.leaf 0x6f902b6057b000004f80687089a08d70000064c040806a706bc08d70000000004bb06ad06bb08d70000000004b906ab08d708170000000004b806aa061b014305b0000003be04940664068f000000000317050d07a808d700000000016c06a108d707a9046d0000022f05aa052e04e500000000012d06a006b408d70000000004ac05ad065d01a10000000003f505ac00000000000005d704a9061508d7075a0420000004a905aa030c0730000000000222069b000000000845000003ef064000000000082f0000030a0653070d030c0000000004a205fd06ab08d70000000001cf069a073f08d700000000049d066f06aa08d70000000001ce069908d7080c0000000001cd069807f105f9000000000654066e085708d705780000055b064d089a08d700000636044506510300075e00000000032806970783037a05ca00000497063807ee04d5000005f30017069608d70790000000000352045b0863016f05db000000fd068f079908d700000000046c04f2052e04c80000000003f7058c) + (NatTree.leaf 0x86e024605740000001706c103fd0646000000000176053505ed026a000000000570060104ca050b0000000001f005ed08d706ee0000000004a905da05bd02610000000005be05ed075608d700000000025006ac089708d7000005ce037e06c0000000000000066b024b06be06d508d70000000003ab06bd06d408d70000000003aa06bc08d708200000000003a906bb07f905180000061f015506a406f902d805910000000606bf058b06ba0000000002a703ff066504580000000002a7058a066406a20000000000ff06b90702016600000000058b069f06cc08d700000000016606b5067601a100000000016406b400000000000006ef0454064508d707e3061300000425062c08d707460000000005a105fe06c708d705a0000004e205eb074508d70000000004e105e904a405d40000000004a405ff06c408d700000000021d06ad06c308d700000000021c06ab08d7081900000000021b06aa0000000007960000047a068607bf0219054100000287063d089708d7000005b703ea0652)) + (NatTree.node 32 (NatTree.leaf 0x81d08d700000000056505ef0000000000000747060f064305b9078b0000000005e6065b07a008d70000000004a6068908d7077300000000030b06c9082e0360063a000003cd068b04f9060800000000037d06c60761037c00000000053d06ae06f508d700000000024a06e3078008d70000000004f606d906f408d700000000024906e208d7083800000000024806e1081503a40000064900000572049007b40000000000cc06ea04ad042f000000000430058d071a016f06450000042d066508d707e904ab000002e506b705be03120528000005bf060100000000000006b004a206880000000008610000057f06af00000000000005f2000906e5047007aa00000000035204b1000000000000071004e206590000000006e9000004e10658066f08240000000005d5062a0000000008580000049b06b000000000000005e101c306d80000000007ad0000040906c206e208d700000000021006d606e108d700000000020f06d508d7082800000000020e06d407ff062000000000065406a4) + (NatTree.leaf 0x71d08d700000000057e06c80000000005f5000002180708079e08d700000000057d06c7037c079400000000035b070500000000086d0000037b06ec0315071900000000042c0690071803b60000061704ea067b071708d70719000004e9067908d707cf0718000004e80678000000000000061205650662082508d700000000016006ff00000000061100000468069e03b3079800000000052a06180000000007cd00000504069d0000000005e70000063d065a000000000000063e046506b3025c07240000000005e6062b0000000006e800000548068a070c08d7000000000546067408d7070b0000000005440673080504df0000000005420672000000000000074e041706e9082e036006510000030406fa0000000005e300000638069c00000000070a0000041606e806ac083b0000000002e006e7037c07850000000004be06b104ca042f00000000026906f10000000006620000039406a2052e062b00000000012c06b6000000000000071704c9066304ca05e800000000029506dc))) + (NatTree.node 64 (NatTree.node 32 (NatTree.leaf 0x8d707b00000000005b806fb00000000000007710540070a00000000073e0000053f0707000000000874000004b8072c073a08d7000000000010072b07b508d700000000000d072a037c07ab000000000008072d07d008d70000000002d205b0089302760647000003c203e2067e07370000000004350536079a05f00000000002ce061906f2013a0000000003a005ac06cd069f000000000167072800000000000007a3050606cb08d707c200000000054806760887028c065200000221072208d7074d00000000054306db07c808d700000000049d06fc037c079d000000000254071c0000000008720000049906e6072a08d7000000000012071f07ac08d700000000000f071d07f8050c000000000233066306b5068d000000000364061903da07a40000000002250713083605640000000001a106720724063d0000000005a00661072308d705a00000058006c8074500c50000000000c706c70887028c063c000004a5067508d707c004df0000051e06b200000000000006e6047906ed) + (NatTree.leaf 0x839055b0000000005ca070b0000000006d7000003270754000000000669000006a5071e06f60860000000000322074c02b007650000000000120757050505a30000000004a80677000000000000068a04510716000000000824000004a407120284076500000000064e070f08d707bb00000000024e073f08d7076e000000000576072f0855037a06be00000440074b076a016f00000000055305de03fd07e400000000039806660748070300000000050a06cf052e06140000000001a706b6085005b900000000025d07260000000000000686051e0710060b036005d00000044a06ee06d9084e0000000004be07060855037a06a700000444070900000000000007930440073e00000000074a0000043f073d075001660600000001a9069f08d7083506890000054906ca083407e0000000000654068c08d707c90000000001d4073100000000000007a002e106fe063b07da00000000032b06fd00000000060d0000028a0711060a02e000000000044906da00000000070700000415070e)) + (NatTree.node 32 (NatTree.leaf 0x76506df0000000004770766039f07350000000002cf061b06dc026a0000000001f206dd077b00660000000005330530053108140000000004ca06f207a6022706cb000005c206f0052e065b0000000002630750000000000000078d05280701060e05d60000000004e306b6078c01d9060f000000ef0767077408d700000000059f06cd0731025d0000000004e106cc08590811000000000309074600000000000007c8066e074400000000000006c204bf074e00000000073d000005b7074008d707fa055b0000044207210634037a060500000575074d076c08d7000000000004076108d7076b00000000000307600841055b000000000002075f061804eb0000000004ec05f107fd01660000000001ee06ce077901660643000002650748077701d905fc00000223069f076506c10000000004460725076308d705e200000609072407f608d700000000051b072e078600eb00000000055e0723000000000000072c053d0720076008d70000000005cd070d08d7075f0000000005cb070c) + (NatTree.node 32 (NatTree.leaf 0x7f6035d077208d7081800000000021407950000000006e500000251079408d7081600000000000c079504d1083000000000047505560734014300000000049405ad06f1026a000000000568062e085108d70000000005a406b800000000000007dc0523073200000000064f000006c1074208d7080b0000000001c5078608a802b606d80000040c078500000000000006e4055a0771064b03a500000000000107840539081500000000035104760868057100000000040404d2078e03f30000069d052d0719078d08d7078f0000052b071808d7081c078e000005290717060e05e600000000019507770000000006880000059f0714078908d70000000001d907750745025d0000000001d7077400000000083b000004150758064d080300000000064e074308d708020000000005ce074508a802b606c0000004f80730064b037a00000000015a076e064a032200000000049607410000000007490000043e0770080008d70000000003c7076408d707e70000000005f30756) + (NatTree.leaf 0x684063700000000047a078c07bf02190650000006c1077607bc08d7000000000609078a078602850000000007630789087d084300000000024c07b00000000008600000046007af000000000695000006df07ad047f081b00000000028907b1000000000000081a0417079700000000000008000574079f08d7082700000000000a07ac085d08d70000000000ca07aa00000000071600000675070306da03120000000006dd06ee0464080f0000000005e507270875082c00000000066e077300000000084e0000037d078806a808310000000003ac078700000000066c000002dc079608d7081e000000000214079c0000000006eb00000006079d085408d700000000047405db06f0056700000000067706d00704026a00000000026a07990700026a000000000297077d03f1078f0000000005ff071a083d01660000000002c20769085b08d7000000000224079808d7085a0564000006b206ef05bd062a0000000006da070007de01d90000000006ce077608d7087006fc000005010747))))) + (NatTree.node 128 (NatTree.node 64 (NatTree.node 32 (NatTree.leaf 0x8d7086b07e0000005ba078d060e070f000000000702078c078a07760000000001da07cb08d7087605b9000003af07a3000000000000070e065207590000000006ed00000546078b0684066d0000000001cc07c707d9021906850000011607c607d608d700000000021907c4079e028500000000021707c3000000000000082a03ea07b70694064e00000000001607c707c7024606820000020907c607d108d700000000001207c4079c028500000000000f07c3077e01430000000002d006ba085c0616000000000661072905a20528000000000529070407f20227073200000505077a00000000000007df05a00778077507670000000003d4073305bd06e700000000032f07a2087f08d70000000001d207c208d7087a072e000005b807a00684064e0000000002df07bf07c70219066e0000025607be087e064d0000000000eb07c107c308d70000000001c907bd079502850000000001c707bc087c08d700000000065207150877063b00000000070b074f05620638000000000543075a) + (NatTree.leaf 0x81f02460000000007a107ee04f7086400000000000307fb052e083f00000000070207520808008800000000065e077c04f708560000000002b407f5059606a50000000005b207c007f4024606d30000015407ee077c026a06630000053406010000000000000740049e07db08d7089107640000057c07c804dc084d00000000024d07f00694069300000000020d07e607eb06640000000004eb061903f107e100000000050407a6080d02190000000007a107c604bd084800000000064c07b80000000000000857046207d507e6024606a40000001607e507ec08d700000000024607d207b5028500000000024507d107ea08d70000000005ad05ee0532062d00000000056a05ac077a05a600000000045407a90000000007590000044f07b3088c084b0000000006a407bb0694066800000000001407d407d4024606960000001707d3013907f800000000050e05da076807b30000000005d9075105bd052800000000031107ce07e004820000071205bc078f07df08d707e1000005bb078e)) + (NatTree.node 32 (NatTree.leaf 0x694075b0000000007e6080d08a308d700000000021208160837022700000000067507530889065a00000000052807cf088608d7000000000288080f08d70892063b0000072107dc07d707d800000000021a080c08a108d7000000000212080b07c407d300000000020c080c089d08d7000000000009080b080a01b706f30000027b0604088308d70000000005a907b4060e06fd000000000263078c081104c40000075805d407e1081008d70812000005d307e008d7087b0811000005d107df088408d700000000065107a4060a070600000000074107ca068407570000000007c707de07c407c60000000001cb0804089b08d70000000001c30802059006f30000000002f90649085e067e0000000004f204ef05ec0873000000000676077b081301d906fe000002650776000000000000081005d007cc0741036000000000063807b207bd07be00000000076607dd0000000007200000060907da089708d70000000006d807c9089406a800000000075f07c508d7089507810000047807f6) + (NatTree.leaf 0x1a0085c00000000062b07e4072705fd0000000002260837052e087900000000048407fd04a408120000000006c607f2084f028c07b70000041608240000000000000842044108230783037a0000000006a5080507ed07f90000000002470828071305fd0000000005ff076a07a2031200000000029707b2080707e800000000060f07e3088801d90000000002c207a1060e074300000000030a0813060a05d000000000011b082e000000000762000005cd080308a908d70000000004f20647083301d907440000030c080705fb05d00000000005d107e2082c04fc00000788049e0812082b08d7082d0000049c081108d7088e082c0000049b081008d7089c064d000001c1081a000000000000078204bb082107d207ee00000000020b082008a608d7000000000007081e06ea04ee0000000002eb058d083e0227000000000227081d083c028c07970000068707cd000000000000082b04790806060a074c000000000252080e000000000000077006c007f707c407e50000000000180817))) + (NatTree.node 64 (NatTree.node 32 (NatTree.leaf 0x633062300000000032508550826014300000000062e067d0867016f00000000016f085407fc026a07010000065f07f807e20312000000000312085107cd067000000000075a07e9089901d900000000038a08340000000007f70000049c084508d708b206a80000076f082a08a408d70000000002b3084d0622062300000000062408320863016f0000000005de06a2085208d70000000006cd07eb067606600000000006cc07ea07ce031200000000068b07a807ca0312000000000331083604a4082d000000000415083c086a02b607d5000004f8083b08a008d700000000024b0848084b0558000007ba04d70844084a08d7084c000004d5084308d7089e084b000004d40842065908900000000005bd0808089a08d70000000006be081b064a075c0000000007830822084900880000000005be07fc0000000007db0000073007e80843051a000007af0445082d084208d7084400000444082c08d70896084300000443082b078303a50000000000010839079b045d00000000051205f1) + (NatTree.leaf 0x88d028c00000000028c087c08220360000000000255087708b4021900000000030008750887028c000000000730082508b807420000000005d0086b0861085800000000066e087001a008890000000006db083f088000c50000000007230846080e036000000000080508500824069c000000000523085a08ad02190000000007c60859000000000829000004b9087208b908d70000000007150814000000000821000007850858086e024607b6000006df086d082f08450000000006b1083504f9084c000000000460086a069407ae000000000016086c086c0219079f0000037c0861068407ae00000000037b086208b00711000000000725081c04f908440000000006f9084f064a062f0000000000030865084002760000000005de0692061807f300000000016e08630853074800000000073307f3064a0623000000000159085f08aa08d70000000000240856060207f300000000047205f1068407870000000007c70833086202190772000007c6082f086f02b607ef00000461084e)) + (NatTree.node 32 (NatTree.leaf 0x8a700eb000000000461089808c307b9000000000477089608ab02d8000000000006089b084e071e0000000003ea089208ab02b600000000025108970855037a0000000007540886060e08b500000000051f088808a200eb000000000763088508a802b6000000000794087f08c307ad000000000441088e0871087400000000057408910847037a000000000839087e0691080900000000058d05f1083b07080000000007c00876086d0872000000000705087a08c408d70000000006570873070a08bb000000000448088008c10796000000000766087b07b806ae00000000028b088708b602460000000007ee087d061808660000000005a70867088207680000000005fd0866084603120778000006ee085c060e08a50000000007de083d07b106ae0000000006c6083e0832036000000000011c0884088f00c50000000004490878082e0360000000000709085b088b016f0000000005a8085d088108d7000000000674085306760726000000000673085206e908b70000000007450849) + (NatTree.node 32 (NatTree.leaf 0x8bd082f0000000006ae08b30727088a00000000083e088b08bc08d700000000070d08af074507c100000000070c08ae08d108d70000000004c308b7028408c100000000064e08b508be022700000000082508830885036008060000074d08b008cf08d70000000007c90890069408c20000000007e608b4025c08b800000000072f08a5068408c000000000044208ad08af08070000000007dd088a0860075d0000000007fa089c07fe06f800000000000408ac0878031207cc00000724088908ae08d700000000078a08820745074f0000000007890881068408ba0000000007c7089907fb06f80000000002b508ab07f506f800000000024f08a8086903a500000000002308a40893027600000000062e073707f006f8000000000499088d074a08c900000000046008a208b102d800000000000508a3025c08b000000000070f08790865037a00000000015a08a008ac02d80000000002b6089d073e08c50000000005ce088f08ac02b60000000002b6089b085f037a000000000327089a) + (NatTree.leaf 0x7f008ce0000000004d408d507f008cd0000000008a808d208d602b60000000004d508d308d502b600000000079408d107b808c80000000004c008d008d2028c0000000004c108cf07b808bf00000000088d08ca08d0028c00000000087f08c408cc087100000000047708cd08cc086d00000000053d08c808cb08d700000000076108c70795080100000000076008c6072708b300000000065508be08d408d70000000004d708c508c7086100000000080c08bf08c608d700000000062808bd079507c50000000007c308bc08d308d70000000006d808bb08ca022700000000065608b9089f037a083a0000057508c102b008c300000000001208c00898036008230000060908b8028408c300000000057608ba)))))))) +def delta_tree : ListTree := (ListTree.node 1152 (ListTree.node 576 (ListTree.node 256 (ListTree.node 128 (ListTree.node 64 (ListTree.leaf 0x204f00104e00204c00204a00204800204600204400204200204000203e00203c00203a00203800203600203400103300203100202f00202d00202b00202900202700102600102500102400102300102200002200002200102100102000101f00101e00101d00101c00101b00101a00101900101800101700101600101500101400101300101200101100101000100f00100e00100d00100c00100b00100a001009001008001007001006001005001004001003001002001001001000000000 0x52c53653850d51c50d51950b51a50b5174f34fe4f34fc4f24fd4f24fb4de4e74de4e64c84d14c84d04c76034d34af4bc4af4b94ad4ba4ad4b749b4a549b4a335634332e31d31056f55a5425294c548447245e44e44202902301d01b01601501201101000f00e00d00c00b00a009008007006005004002001000) + (ListTree.leaf 0x209800209600209400209200209000208e00208c00208a00208800208600408200208000207e00407a00407600407200406e00306b00406700306400306100305e00305b00405700405300404f00404b00404700404300403f00103e00103d00103c00303900303600103500203300103200203000202e00102d00102c00202a00302700202500302200301f00301c00201a00301700201500201300201100300e00100d00200b003008001007001006001005001004001003002001001000 0x10f1181011090f50fa0ea0ef0e20e651f5225025054ea4ed4d44d74bf4c24ae4bb5f65fe4dc60f4a84ab49a4a45e55ef4894925d25dc4774815be5c946246f5a85b54aa4b15f545145b59459f49749d5e348648b5d043357058f42255b57f3d85065216263c54f050a6203c34ee50461f3b14db4f161837d4aa4b15f536949749d5e335848648b5d027a26a26454459360f52b58360351e5075f55014ef5e34da5d05bc4be4d660e4744795bc4c160245045359344444658343443757143243642342655c42142540c4113f53fa3ac4d660e39b39939e3954c16022292172051f51e954654f551)) + (ListTree.node 64 (ListTree.leaf 0x109f00109e00109d00109c00109b00109a00109900509400508f00208d00308a00208800208600208400507f00207d00507800507300506e00506900506400206200505d00505800205600205400504f00104e00504900104800304500304200303f00303c00303900303600303300303000502b00102a00302700302400302100301e00201c00201a00201800201600201400201200201000200e00200c00100b00100a001009001008002006001005001004001003001002001001001000 0xa208505204904203d03752b53e55863263450c51b5715f65fe50251155c5e55ef4ea4f54d44e04bf4cb4aa4b14bd5f55ff4a84b349a4a24c95e55ee49749d4a65e35f14894914b05d25db48648b4935d05df47748049c5be5c84825cc46246b48a5a85b245145847859459c43e57a42e56640f41241b54655041c3f83fb40552c5374063de3e13ec3dc3e03ea3dc3e03e73c73ca3d33c63c93d23c63c93d03b43b63be39c39f3a739a3b24c64dc60f3a938238539038038438e38038438b36d37037834534a31f3223123153013052ff3042ef2f42ed2f32d62df2c12c82a729529327f26826f25023d22b15814a143) + (ListTree.leaf 0x309000108f00308c00108b00308800308500308200208000207e00207c00207a00207800207600207400207200207000206e00206c00106b00106a00106900106800106700106600106500006500006500006500006500605f00605900605300404f00204d00604700404300204100203f00203d00603700203500203300203100202f00402b00402700402300401f00401b00401700301400401000200e00400a001009001008001007001006001005001004001003001002001001001000 0x36c36f37737935b35d36436534834b35333233534032032332b2692802192201f71fc1eb1ef1da1e01d81df1c91cf1c71ce1b11bb19c1a51481500a709b09a09608e08807b50c51b52554062c62e50751d52353a62b62d4ef5005065216246265465505d25dc5d25db4da4e94ee50461d61f52c5375be5c95be5c85a85b55a85b24ac4c14d260060260b59459f59459c4a75f256f57a40f41241a4353f83fb4044243de3e13e94103c73ca3d13f93b43b63bd3df39c39f3a63c83a84d260b38238538d3b538138f36d37037639d3002ee18217116f15e13011f1110b2))) + (ListTree.node 128 (ListTree.node 64 (ListTree.leaf 0xa300509e00209c00409800109700409300408f00108e00108d00308a00108900108800108700308400108300308000107f00307c00307900307600307300307000306d00306a00306700106600106500306200206000305d00305a00305700105600105500105400105300105200105100105000104f00104e00104d00104c00704500504000303d00303a00203800203600702f00702800402400402000401c00401800401400301100200f00100e00100d007006004002001001001000 0x42d42f4455655673d93f13e65155346233c43e45125326223ce4f951661b3b03b236c36f37535430c2fb2d92e03132e82c42c93022d02ad2b12f12ab2b02f02ab2b02dc29729c2db29629b2da29629b2c62822882c526b2702ae2772762552592992542612532582982532582852412462841d91c81070f90ee0ed0e50e40dc0d40a35b65f060061061d63364554455656d63863a5a65b35b45a65b05b34995f34885e146046446c46d5a65b35b446046446946c5a65b05b345945a59d59e45745959b59d44b44c58c58d43f44057b57c42f43056756844858a5ad3f740a3ed3d43af3c14d94ec4ff61761c3984c44e8614392391) + (ListTree.leaf 0x309300309000208e00208c00008c00008c00408800408400208200307f00207d00207b00207900207700107600207400407000406c00406800406400306100305e00205c00305900305600305300205100304e00104d00304a00104900304600104500104400204200204000103f00103e00103d00103c00103b00103a00103900103800003800803000802800502300102200202000401c00101b00401700101600301300400f00100e00400a00000a00000a005005000005005000000000 0x57157b57c55c5675684705b854655041d41e55255340740853953b3ee3f03dd3eb3f33d53d73bf3c23aa3ad39339637f37b37e35b35d36338334834b35236e33233533c35c3203233283492d92e03032c42c92f22c32d42ad2b12de29729c2c72822882af27d29126b27029a26725525928725f24124626e24c23914915f10310a04303e03903503202e0280225a05dd5f360561562b62d63f58e5ca5e160760c6246266395085205276256275934965e24944985e05e45834834875cd5d15714765ce5f04714755b95bd55c45d4615a35a744a44b46358b58c43d43f45257957b)) + (ListTree.node 64 (ListTree.leaf 0x108400108300108200307f00707800007800207600007600207400207200207000007000206e00106d00406900006900006900506400006400006400306100106000105f00305c00105b00305800105700205500105400105300105200105100105000304d00304a00304700304400304100203f00203d00203b00203900203700203500203300203100202f00202d00102c00202a00202800202600202400202200202000201e00101d00101c00501700501200700b005006003003003000 0x7203402d57d5ce61f4c34c44d64e860c60e61459b59d58b58c4855cf57957b56556755a54655055255340d54356b57e6403894b55fc37a36b3734a05ec35a36148f5d93172a82bd2b42942b329f27e24024528322e23326c21c22125620920d2431f81fd2301b41bc19f1a618818f1861b818618d1731791721a317217816116714b15115213613c13513b13416413413a1231290d90ef0d10e606e5f84f050350a61e6204db4eb4f16166184d84d94ec4ff61561761c4c64d54dc60d60f59359d59e58358c58d) + (ListTree.node 64 (ListTree.leaf 0x306f00406b00406700406300206100405d00005d00005d00405900005900405500005500405100404d00004d00404900104800304500404100403d00203b00203900203700203500203300103200103100103000302d00102c00102b00102a00202800102700202500102400202200202000201e00201c00201a00101900101800201600101500201300101200101100101000100f00100e00100d00100c00100b00100a001009001008001007001006001005001004001003002001001000 0x50652162649449e5e05e748348c5cd5d447147b5b95c155a56645d4665a35ab44d5905915b64415805815a043156c56e58e3cc4f651461a3b94e24f861234735047e5c633033433d33e33033433a33d32932a32732931a31b30d30e2fc2fd2b82a326024024526d2271e11d01b41de1bd19f1cd1a71881ba1731a416118c15c16b14b17715314713616613d12314f12a11a0dd0d50cc0cb0c10c00b30aa0a409c09809708a082080092078) + (ListTree.leaf 0x407d00707600307300207100007100306e00006e00406a00006a00406600705f00405b00205900305600305300305000704900304600903d00303a00003a00303700103600103500303200302f00302c00302900302600202400202200202000201e00201c00101b00101a00101900101800101700101600101500101400101300101200101100101000100f00100e00100d00100c00100b00100a001009000009001008000008000008000008000008000008000008003005003002002000 0x4734955bb5de46146a46e5a75b15ba5dd45f5a55cb55255d44f5925b741d42755255d4074135395473f641f52a55656a56d63a3ee3fe51f52f3db41f3d33d53e33be3bf3cb3a73aa3b73bb3cf4e44fa50e52d6133903933a138138c3b34ae4b84dd4df5f65fd37837b3872ac2b92bf28025222e23325721c22124420920d2321f81fd21f19e1af1ed12212811411910610b0f80fd0ec0f10c80bb0ac09d08f08d08107f07507406906806002b02401e01c0180170135695ba6175545a460e4b25f7))))) + (ListTree.node 256 (ListTree.node 128 (ListTree.node 64 (ListTree.leaf 0x5f00005f00005f00305c00605600605000304d00004d00004d00004d00004d00004d00004d00004d00604700404300104200204000203e00203c00203a00303700303400003400303100103000102f00102e00102d00102c00102b00302800202600202400202200202000201e00201c00201a00201800201600201400101300101200201000001000100f00000f00100e00000e00100d00000d00100c00100b00100a001009001008000008000008000008000008002006006000000000 0x53c59160258358c58d5905915b64db4f14f951661861b4ee50461f3da3f25085245276273db50953c63336836636a35535934234632d33131931a33330b30d3212fa2fc31425c23f24922d2371f11831981db1941b71701ca1931b517e1a215d1b512214e0da0de0d20d60c90cd0bc0c20bf08908408b07c06f06505b02702101a0145e85fa4f050a515534620623) + (ListTree.leaf 0x206900206700206500206300206100106000205e00105d00105c00105b00105a00105900105800005800005800005800005800305500305200304f00504a00804200004200004200703b00003b00203900503400502f00502a00202800002800202600102500202300102200202000201e00201c00201a00101900201700101600001600201400201200101100101000100f00100e00100d00200b002009001008002006002004002002000002000002000002001001001000000000000000 0x1fe22f1fe21e1f021d1e220a1d11f915f0ad0b609e09105f05504c0445d55ea61c5235815f550656e5e351053354c62a6354ae4b84c04dd4df5f65fd60145c4604645a25a45a65ca48f5d942055755957d64540b53f54156963f3f45265285546393da3ef34a3543412e92ea2d72d12d22ba2bc2a42a628f29229e27827b28b26226524e25124d21b19017a13e11413910612610c0f81170ec1080bd0c5067030)) + (ListTree.node 64 (ListTree.leaf 0x8900008900008900308600508100507c00607600007600007600207400207200207000206e00106d00006d00b06200006200006200006200206000205e00005e00105d00005d00005d00005d00205b00305800005800405400205200105100204f00204d00204b00204900004900004900004900004900004900004900004900f03a00303700203500802d00202b00202900202700402300202100002100501c00301900401500001500401100400d004009000009001008004004004000 0x4ee5595d04f751553462362f4e34f951661b62857157b57c5805815a04d260b45459644758543857343a3dd3e840a40e50c51853e5455555586343c53d63b13c035728c2a025428128618718e19a1dd1331740d10ae0b409f0a507707d05605d5a15d65de5f460661161662862c62e63163b63e6406435c25d76144a15ed4c64dc4e44fa50e52d60f6134905da47f5c746a5b152c53753953b52c53743c5785875986433ae3af3c135d36436636a31531a31b31c30530d30e30f2f42fc2fd2fe22520720c20e24220720c20e231) + (ListTree.leaf 0x308f00308c00308900108800208600208400208200208000207e00107d00207b00207900207700207500207300207100206f00006f00206d00206b00206900206700106600106500106400106300106200006200106100106001104f01103e00103d00503800303500003500403100302e00302b00002b00302800302500202300202100201f00201d00201b00001b00201900201700101600201400201200201000200e00200c00200a001009002007002005002003002001001000000000 0x27527829a25e26228724b24e26e23c23a23e22822c21621a2042081be1ec1b21a81dc1911cb17b1b61681a117d1a015418a16a18913f17512c1631051370af0b806405a05104a04804102d58f5c35cb5e25f960860d62162562762a63563863a63d64664857f5ad5b75cf5e95fb60161961e62062362f63263463764164460b4d94ec4ff61761c4c44e861440153354c62a3ab4d560d3973983ac36f37737a39b4c76033753862c22eb2aa2eb1f020b1e21fb1d11ee14216212b12116212f14c11314c11e1370f61150f60fb0eb0eb0f00e30e70db0df0d30d7092))) + (ListTree.node 128 (ListTree.node 64 (ListTree.leaf 0x208a00208800008800108700108600008600008600008600408200108100108000207e00007e00107d00707600007600007600007600207400207200207000506b00406700506200505d00205b00505600005600205400105300005300105200105100105000204e00004e00204c00004c00004c00004c00004c00004c00104b00404700404300703c00703500203300303000302d00602700002700302400402000301d00301a00301700301400301100300e00300b005006003003003000 0x7907e06c07106a0615ac5c460b6475ff5f14b45fb42a3a53bc4cf4e54f450f60a34436732f35631e3432e02e92ea2ec3132d730430a30c2c92d12d22d53022b12ba2bc2c02f12a92be29b2a32a92bb2da2202272150e30db0d307608206b0705df4d95415bc61c4c45285a66144ce4e44fa50e52d61362159359d59e5a25a45a65ca5395474435825a151c51f52f42c43956457558863d36436637134b35335535935335535e34034234d33133b33f32b32d3372e72e93032cf2d12f22b72ba2de29c2a42a62aa2db2a22a42c728e28f2af) + (ListTree.leaf 0x206c00206a00006a00206800006800706100006100006100006100006100006100006100405d00005d00005d00005d00305a00005a00005a00105900105800105700105600005600005600005600005600105500c04900604300403f00403b00403700003700003700203500403100003100402d00302a00602400002400002400002400002400002400302100201f00001f00401b00401700401300301000200e00000e00200c00200a002008002006002004002002000002002000000000 0x42855f4155494005313a33bb4cd4e450e60961323323a23e26c16c17f18b05703c03602f5cc4b14bd54356b57857a57e5875985ff64064355c56756856c56e58e47d5c45d35e84685ae5bf5d54565995a95c23e55133f152353a62d33433d33e34134c47a5c032232932a32c33033426f27727c2642761ef1f01f421d1e01e21e820a1cf1d11d71f91351601651101240ca0ce0c70de0be0c30b00b50a00a609409908608c)) + (ListTree.node 64 (ListTree.leaf 0x109d00b09200308f00008f00008f00008f00008f00408b00608500008500008500408100008100307e00207c00407800207600207400207200207000007000206e00006e00006e00406a00306700306400306100305e00005e00005e00605800005800405400105300504e00504900004900104800204600204400204200204000303d00203b00203900203700203500203300203100202f00202d00102c00202a00002a00002a00202800002800602200401e00d01100600b00b000000000 0x4173f33f53fa40640952552953853d54062e3d03e24012ac2d42d82dd2a92b02b82be2cc2f025826026629825426126a24a26d17917b1851b611c14e0e70e80df0e00d70d80730935865995f163c5b35b45b849f5eb60648d5d85f947c5c55e941942954e56157663733534034234630828828f2922a52c527027827b2902ae22a1be1de1a81cd19d1c51911ba1851c51fa17b1a416818c15417713f16612c14f11b14d10d1380ff1250fe0f311602603856b5985bb5eb61861b5975ae5ff64249d4a652a55656456656a56d5755885f163a63d4a94ae4bb5f45f65fe4ae4b84cf4dd4df4e54f450f5f65fd60a) + (ListTree.node 64 (ListTree.leaf 0x107f00107e00007e00007e00007e00007e00007e00007e00007e00007e00007e00407a00507500207300207100206f00206d00306a00306700306400605e00005e00005e00005e00005e00505900005900305600305300005300305000304d00304a00404600404200403e00403a00203800003800203600003600003600003600103500103400103300103200103100103000102f00102e00202c00202a00202800202600202400002400601e00601800701100f002000002000002002000 0x3a03345746559b5aa38138c39439b3b336a37435936234635133133b3244545963164475853064385732c22eb2f32f92fb30725926226527929923823a25722622824421421623220820f21320220421f1bc1be1c61ec1b21df1e11e61a61a81b01dc18f19119b1cb18419910a10c0ca0be0b00a009408607906c06206605805e04f05404d05304604b5565885a55d860f61353e5765925c560360a4b64cf4e54f450f60a61948b49350c51853e54554e5555585615765d05df63463747e5c6) + (ListTree.leaf 0x6c00206a00006a00206800206600306300006300206100006100305e00005e00505900505400504f00004f00604900604300304000004000004000004000004000004000203e00203c00203a00003a00303700203500003500003500003500003500802d00302a00802200801a00001a00001a00001a00401600001600001600201400301100400d00000d00000d00000d00000d005008002006000006000006000006000006003003002001000001000001000001000001000001001000 0xce0d00c30c60b50b90a80b40b70200315745896364495895955ac64743b57758459764242b56357258663c3b63be3bf3c23c53d639f3a73aa3ad3b13c03894b55fc21823b2062291f621711911b14d0a60a954655055255355755957d64551253262252c53753953b53f54156963f50d51c51f52252652855463932332b32d33127428d24524d28322122822c25617817a1841921cc1431520ba0cf0d60a90cf03f)))))) + (ListTree.node 576 (ListTree.node 256 (ListTree.node 128 (ListTree.node 64 (ListTree.leaf 0x306500206300106200006200106100106000105f00105e00005e00305b00d04e00004e00504900504400004400004400b03900003900303600003600003600003600003600003600103500003500303200203000202e00202c00202a00202800202600002600002600002600002600002600202400102300002300002300002300002300302000002000501b00001b00001b00701400001400001400001400001400001400201200101100101000400c00200a006004000004000004004000 0xa50a80b10820a206602c02602501f56057763046446c46d47050851e52452753354c5b862762a3bd3cb3cd3df3e63a63b73ba3c83ce38c3a03a54b84ca4cf4df4f45fd60460a2fa3063261e412214a14e13114e11b13910e13910d1260ff1170f310806306705d45559a5c33c93d23d43da3ef38539039339639a3ab3b231132e2f72bd20c20e2152422122311fc1fe20320720c22f15015315b1a0) + (ListTree.leaf 0x308a00008a00308700008700008700008700008700208500008500008500008500308200307f00707800007800007800a06e00006e00006e00706700206500306200305f00305c00805400005400005400405000604a00004a00004a00404600304300004300104200004200104100004100104000103f00003f00003f00003f00003f00803700703000a02600b01b00501600301300001300101200101100001100300e00200c00200a005005005000000000000000000000000000000000 0x10b10d1380f00f21150670784f651461a4e24f861249149e4a14b05db5e75ed3ca3d33d53d73db48550953c5cf63338c3a04b84ca4df5fd6043573882ea2ec2f52d22d52e12bc2c02ca2ac2d42d82dd2df2e62e82f61871af1b31b918418d1901991aa1cc13a13e1461890f70fc12406205804f0465255625825af5f65fd5fe6044f34fe50250550953c63344644b44c44d58358c58d5905915b63e13ec3ee3f03f44965265285545e263939e3a93ae3af3c13734a05ec34f3392a62aa2b22952b427328c16716817c1a11b715115416918a1a2)) + (ListTree.node 64 (ListTree.leaf 0x209500009500209300109200009200908900408500508000407c01506700f05800005800005800605200005200005200005200304f00204d00004d00204b00004b00204900204700704000004000004000503b00303800003800003800203600203400003400103300003300203100003100003100003100003100003100e02300d01600001600a00c00000c00000c00000c00000c00000c00000c00000c00000c004008000008000008002006002004002002000002000002000002002000 0x8c09505905f04a50854c57059a5e55ee5ef5f25f75145c65fc61a49749d4a65e35f146947a5b05c03dd3e840a40e41141941c42950c51853e54254554e5515555585615766346373da3e03ea3ed3f240148850852452753354c5e162762a38d3a13a43b53bb3cf2a12c62cc23e24722c23421a22220820f19d1c51ce1d01d51e31fa13c13f15517518b15916d1760fb0fe10211510708b0904ae4b84bb4c74ca4cf4df4f45f65fd5fe60360460a45345945a45c46046459359d59e5a25a45a65ca43743f44044157157b57c5805815a020d21621a2431f320b1e71fb1d61ee12812b) + (ListTree.leaf 0x8a00008a00008a00208800008800108700008700008700008700008700008700208500008500b07a01406600306300206100b05600305300604d00304a00304700304400004400004400004400004400004400004400004400004400004400004400004400004400104300104200104100104000004000004000a03600e02800002800602200102100002100601b00001b00001b00101a00001a00701300500e00000e00000e00000e00300b00000b003008000008003005003002002000 0x7d08307001902a4f053455b58a5d25db5dc5e05e45e75ed4794824f24fb52552953553853d54054b5615625765bc5cc62e6316376414675af5d64a05ec40341642953554b56156257663163764145045359338438e3923973983ac34436737232f35635f31e34334e05e04e04503f42642f43043155c56756856c56e58e40d43643c43e54356b56f57857a57e58759864064336c36f37537c38138f41731531a31b31c31f3222e42bf2c12c32c82d02d32d424624e2512632841001261270f41171180e91081090ab0c50cd0990a1))) + (ListTree.node 128 (ListTree.node 64 (ListTree.leaf 0x105200105100005100204f00204d00204b00004b00004b00204900004900004900004900004900004900804100004100004100004100403d00403900003900503400003400003400003400003400203200003200203000202e00102d00202b00002b00002b00002b00002b00002b00002b00002b00102a00002a00002a00002a00002a00002a00002a00002a00902100002100901800001800900f00100e00000e00000e00000e00300b00000b003008003005000005000005004001001000 0x2242111c41de1ad1cd1971ba07e0874f854a5635b05c05ec6126294145485606303ff53054a62932733633d33e34122b2391ea2051d62001d31811a40534a24b25655735995a95c25ee5f74c14cd4d24e450e60260960b6133e83fd41651852e54b56263163b4022e72f53182cf2e13092b72ca2f81fd204208230198) + (ListTree.leaf 0x406800006800206600905d00005d00005d00005d00005d00005d00005d00005d00105c00005c00005c00d04f00004f00604900004900304600004600404200004200403e00003e00003e00003e00003e00003e00003e00003e00003e00003e00003e00a03400103300003300003300b02800002800002800002800302500402100201f00201d00301a00201800201600001600001600201400001400201200201000100f00000f00000f00000f009006000006003003003000000000000000 0x25425d26128622a25b1871af1b31b91bb1bd1c31d21ed0b64964ae4b84bb4ca4cc4df5e25f65fd5fe60460837638738a39d3a53bc30031d32528e29d2af2b427528929a29f4b84ca4cf4df4e14f45fd60460a6113fc32733636045746548e59b5aa5d75e65f81711941b715716c17418b1201391121260fd0ff1251041170f710805005504704c04004402037037837b37e38138c39439b3b325226427625d274286)) + (ListTree.node 64 (ListTree.leaf 0x204c00004c00704500504000004000303d00003d00303a00103900103800003800003800003800003800003800003800003800003800003800003800003800003800203600003600003600003600003600003600003600003600003600003600003600003600203401102300002300002300a01900001900001900001900001900001900001900001900001900001900001900301600001600001600001600001600001600001600001600001600001600b00b006005005000000000000000 0x1971d417219a19e1a31ae1af1ed12912c1401631760f10f31160e10fa10709b05411111a4b55fc3f641f42542c42e43952a55655a56456656a56d57558863a63d41843954d55e57457558863663d6461801a31aa4db5165435785be5c85c95cd5d15d45da51852e54b56263163b33c34d351375386) + (ListTree.node 64 (ListTree.leaf 0x6801c04c00704500004500004500004500004500004500703e00003e00003e00303b00303800303500602f00002f00002f00002f00002f00002f00002f00002f00002f00002f00502a00002a00002a00002a00002a00002a00402600002600002600002600402200501d00001d00001d00001d00001d00001d00001d00001d00101c00001c00001c00001c00001c00001c00001c00001c00001c00001c00001c00b01100001100d004000004000004000004000004002002002000000000 0x3c63c93d03f33fa4034064094164294994f24fb52552953553853d54054b5615625765f362e6316376413f145045352353a59362d31f32232932a32c33033421823b2482062292351f62172231ef1f01f41f71fc21d4b84ca4df5fd6042ab2b02dc2eb25e27128c2a023323a23e24f26c1c14c64fa52a5645a85b25b55b95bd5c15c741241b41d41e42054655055255355755957d6451c41f21ad1e5) + (ListTree.leaf 0x7000007000007000007000007000007000007000007000007000007000406c00506700006700506200006200006200006200206000006000006000006000006000006000006000105f00005f00205d00005d00d05000005000704900604300004300004300004300004300403f00003f00003f00003f00003f00003f00003f00003f00003f00603900403500003500b02a00102900902000002000002000002000002000002000401c00001c00001c00001c00101b00101a00d00d00d000 0x28e29d2b42e227528929f2a72cb20120e21521e24212012e04b03b04346b47b47f51952f5315635725865b25c15c763c32833733b3633713743832ac2b62b92bf2dd2e312812b13317445045352353a59362d4565995a95c235d36436636a36c36f37537c38138f39b4022bf2c32c82ce2d02d32d42e32f614415916517604a01949149e4a154f55d55f5895955ac5db5e75ed64748048c4905365475495775845975c85d45da642))))) + (ListTree.node 256 (ListTree.node 128 (ListTree.node 64 (ListTree.leaf 0x406200006200006200006200006200305f00105e00005e00005e00005e00005e00005e01204c00004c00804400004400004400404000004000004000004000e03200003200003200003200003200003200003200003200003200003200003200103100902800302500002500502000301d00001d00001d00001d00001d00001d00001d00001d00001d00c01100001100001100101000001000001000001000001000001000300d00300a004006000006000006000006000006004002002000 0x24b25a27428d0e70e81070784ae4b84dd4df4e550c51854554e59459c59f5a35a75ab5b15f65fd30130530b30d30e30f3163391f71fc1fe21e38d3a13a43bb3cf42d4384454565655735995a95c20133e83fd41651852e54b56263163b31132e33820120e21e2312361d91f51ff45746546946c48e59b5aa5b05b35d75e65f82cd16e18c19415a17717e13513b14416509c0b80c20c407107a) + (ListTree.leaf 0x3d00003d00003d00003d00003d00003d00003d00503800d02b00002b00002b00002b00002b00002b00302800002800102700002700002700002700002700002700002700801f00001f00001f00401b00001b00001b00501600301300001300101200001200101100001100001100001100001100001100001100001100001100001100400d00000d00000d00000d00300a00000a002008002006002004000004000004000004000004000004002002000002000002002000000000000000 0x4495895955ac6473fb40540740840b52c53753953b53f54156963f14516c17f0f62a22ab2b02b22dc2e52eb3071861b81c51fa11911b12d14d1650f60fb0fe08f08121422224a26d1801a31aa11211d10410f0f71010700762b53fc)) + (ListTree.node 64 (ListTree.leaf 0x5800505300005300d04600004600004600004600004600703f00003f00403b00503600003600003600003600003600303300003300003300003300003300b02800002800002800a01e00201c00001c00001c00101b00001b00101a001019001018000018000018000018000018007011000011000011000011000011000011000011008009003006000006000006000006000006002004000004001003000003000003000003000003000003000003000003000003000003003000000000 0x42b56357258663c30b31632133943d4474524685795855ae5bf5d518718e19619a1b91c01dd16e1941bf1db15a17e1821a91ca04504a05a34834b35235335535935e36236836e3a217219a1a31a51a71ac1ae1c01d21dd0a00a60a705c0520491f31fe20320720b20c22f36337137438338c3a03a53b83e73fc5170eb1070430d90ea0ef) + (ListTree.leaf 0x206400006400006400006400006400006400006400006400006400006400006400006400006400306100305e00005e00005e00005e00005e00005e00005e00e05000005000005000005000005000005000005000005000005000104f00004f00004f00004f00004f00004f01203d00003d00903400502f00002f00002f00002f00002f00002f00002f01201d018005000005000005000005000005000005000005000005000005000005000005003002000002002000000000000000000000 0xaf0b81ea20521010413114e37638738a3a53bc4a34b34b64cf4e54f450f60a6191ab42342d4384564b94cb4ce4e44fa50e52d5655735995a95c261362131932432732934f35235e36236e20220f2382472574e453254d57558859b5aa5b05b35d75d95e65f860961362263d64645846646a4fc50b51151351754454d55655e56d57457558859c5ab5b163663863a63d64606606d07303403d))) + (ListTree.node 128 (ListTree.node 64 (ListTree.leaf 0x2c00002c00002c00002c00002c00202a00002a00002a00002a00002a00002a00002a00002a00002a00002a00002a00002a00002a00002a00002a00f01b00001b00001b00001b00001b00001b00001b00001b00001b00001b00001b00001b00001b00201900001900001900001900001900001900001900001900001900001900001900001900001900001900501400001400700d00000d00000d007006000006000006000006000006000006000006000006000006003003000003003000 0x3f05135235e36236e37248048c49049c49f5c85d45da5eb6061951b843b5775845976421da1e01e21e71e820a21117317917b1811b61c21e313215916d0e30e70e8) + (ListTree.leaf 0x8a00008a00008a00008a00008a00008a00108900008900908000008000008000008000008000008000008001506b00006b00306800006800006800006800006800006800006800006801a04e00004e00004e00004e00004e00004e00004e00004e00004e00604800004800004800004800004800004800004800004801603200003200003200003200003200003200302f00002f00002f00002f00002f00f02001e002000002000002000002002000000000000000000000000000000000 0x4221c22122622822c23423c25627240f41a4274284494a34b34b64cf4e54f450f54f55d55f5895955ac60a6196470db0df0e03a63b73ba3ce3d83ff45f48448d4d04e04e34f950651652153054a5a55cb5d85f961b62662862923824725d27428628a49a4a24c94cf4f24fb53556157658b59359659b59d5c45d35e55e85ee60a6376410f71201394b84ca51852e54b5625795855ae5bf5d55fd60463163b3c73d13dc3e03e33e53e741841f4394b44fc50b51151351754454d55655e56d5745755885fb63663863a63d6460eb0f5)) + (ListTree.node 64 (ListTree.leaf 0x7500007500007500507000007000007000007000007000007000007000007000007000007000007000007000007000007000007000007000007000007000007000007001705900005900005900005900005901404500004500004500004500004501303200003200003200003200003200003200003200003200003200103101301e00001e00001e007017000017000017000017000017000017000017000017000017001016000016000016000016000016000016000016000016016000 0x12014415615917644444a45445745947d4e64f54f751553454856058b59659b59d5c45d35e862362f63034834b35235335535935e36236836c36f37537737a38138638c38f3a03a23b43bd3cb3cd3e641449f4e64f54f75155345485605eb60662362f63003a36337137438c3a03a53b840441341542443b5365475495775845976421f31fe21e22422623424405f43443d4474684d04e04e34f950651652153054a5795855ae5bf5d561b626628629) + (ListTree.node 64 (ListTree.leaf 0x4400004400004400004400004400004400004400004400004400004400004400004400004400004400004400004400004400004400004400004400004400004401d02700302400002400002400002400002400002400002400002400002400002400002400002400002400002400102300002300002300002300002300002300002301900a00000a00000a00000a00000a00000a00000a00000a00000a00000a00000a00000a007003000003000003003000000000000000000000000000 0x3f840441341543b49149e4a14b04b84ca4cf4df4e14f45365475495775845975db5e75ed5fd60460a61164205805e0780553de3e13e93ec3ee3f03f43fe40042b50d51951c51f52252652852f53155456357258663963c10610b10d11211c1381410eb112126) + (ListTree.leaf 0 0))))))) +def rmask_tree : NatTree := (NatTree.node 1208 (NatTree.node 600 (NatTree.node 296 (NatTree.node 144 (NatTree.node 72 (NatTree.node 32 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100)) + (NatTree.node 8 (NatTree.leaf 0x80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000) + (NatTree.leaf 0x200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x400000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x100080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x2004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000804000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000201000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x401000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x400000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000804000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))))) + (NatTree.node 32 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x80000000000000000000000000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000021000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000004200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x1000000000000000000000000000000000000200000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004400200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000002100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x400000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000800000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000800000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000440008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000800000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002200400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000400000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000004000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x10000000000000000000000000000000000000000000000000000000000000000000004000001000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000001000004000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000200000800000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000204000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000020800000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000008400000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x20010000000000000000000000000000000000000000000000000000000000000000000000000000008004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000002040000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008010000000000000000000000000000000000000000000000000000000000000000000000000000008020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000002080000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000840000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000010000000000000000000000000000000000000000000000000000000000000000000000004000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000800000000000000000000000000000000000000000000000000000000000000000000040000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000004000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x920100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000049000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004040000000000000000000000000000000000000000000000000000000000000000000000000000008004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000010000000008020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000092008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802000000000000000000000000000000000000000000000000000000000000000000000000000000010040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100400000000000000000000000000000000000000000000000000000000000000000000000000000004020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020040000000000000000000000000000000000000000000000000000000000000000000000000000002008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x1000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000001008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000002020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000004200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000490002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000244008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002480400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x100000000000000000000000000000000000000000000000000000000000000000000000002000008000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000004200000000000000000000000000000000000000000000000000000000000000000000000000810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000020400000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000002080000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000840000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x80000000000000000000000000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000000000000000000000000000000000000001080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000001080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000000000000000008200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000021000000000000000000000000000000000000000000000000000000000000000000000000000804000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000000000000010200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000040000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000004000001000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000001000004000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)))))) + (NatTree.node 72 (NatTree.node 32 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x100080000000000000000000000000000000000000000000000000000000000000000000000100240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400200000000000000000000000000000000000000000000000000000000000000000000000401100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802000000000000000000000000000000000000000000000000000000000000000000000000811000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200800000000000000000000000000000000000000000000000000000000000000000000000101200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000021000000000000000000000000000000000000000000000000000000000000000000000000004200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000000000000000000000000000000000000004800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x8008000000000000000000000000000000000000000000000000000000000000000000000000811000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040080000000000000000000000000000000000000000000000000000000000000000000000080480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200400000000000000000000000000000000000000000000000000000000000000000000000402400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000804000000000000000000000000000000000000000000000000000000000000000000000001024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080400000000000000000000000000000000000000000000000000000000000000000000000405000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002010000000000000000000000000000000000000000000000000000000000000000000000008090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000010000040000000000000000000000000000000000000000000000000000000000000000000040000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800200000000000000000000000000000000000000000000000000000000000000000000002004200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x40080000000000000000000000000000000000000000000000000000000000000000000000000004044000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004004000000000000000000000000000000000000000000000000000000000000000000000000004022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100400000000000000000000000000000000000000000000000000000000000000000000000000804800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000400000000000000000000000000000000000000000000000000000000000000000000000010021000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008010000000000000000000000000000000000000000000000000000000000000000000000000200900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100020000000000000000000000000000000000000000000000000000000000000000000000004004200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100020000000000000000000000000000000000000000000000000000000000000000000000010024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400080000000000000000000000000000000000000000000000000000000000000000000000040110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x4020000000000000000000000000000000000000000000000000000000000000000000000200000000040400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200080000000000000000000000000000000000000000000000000000000000000000000000000000004020800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008040000000000000000000000000000000000000000000000000000000000000000000000010000000202000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800100000000000000000000000000000000000000000000000000000000000000000000000000000008084000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010040000000000000000000000000000000000000000000000000000000000000000000000010000001008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100000000000000000000000000000000000000000000000000000000000000000000000000000040210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004010000000000000000000000000000000000000000000000000000000000000000000000040000000804000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101000000000000000000000000000000000000000000000000000000000000000000000010000000102000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x4040000000000000000000000000000000020000000000000000000008001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200045008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080200000000000000000000000000000000010000000000000000000000020040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002004c040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001001301000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080092008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080200000000000000000000000000000000000000000000000000000000000000000000000000000200204000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008012808000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x400000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000100800000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000202000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000008400000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000440000000000000000000000000000000000000000008000000000000000000014000000000000000000000000000000000000000000000000000001000000400008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x400000000000000000000000000000000000000000000000000000000000000002000000400000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000040000010000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000010000040000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000002000008000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000002040000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000208000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000400000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x4040000000000000000000000000000000000000000000000000000000000000008000000020500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101000000000000000000000000000000000000000000000000000000000000000100000000409000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008040000000000000000000000000000000000000000000000000000000000000000000000000004000200000000000000000000000000000000000000000000000000000000000000000000010000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020080000000000000000000000000000000000000000000000000000000000000200000000020240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000404000000000000000000000000000000000000000000000000000000000000000000000000000000800400000000000000000000000000000000000000000000000000000000000000000000000800200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008080000000000000000000000000000000000000000000000000000000000000020000000004120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000100000000000000000000000000000000000000000000000000000000000000000000000040000008000000000000000000000000000000000000000000000000000000000000000000002000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000008000000000000000000000000000000000000000000000000000000000000000000000400000004000000000000000000000000000000000000000000000000000000000000000000010000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x80100000000000000000000000000000000000004008000000000000000000200800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101000000000000000000000000000000000000010080000000000000000000808000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004802000000000000000000000000000000000000000000000000000000000000000000000000000000090040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000040080000000000000000000000000000000000000000020000000000000000002100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008040000000000000000000000000000000000000000000000000000000000000000000200000040480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040100000000000000000000000000000000000000000000000000000000000000000100000001009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020020000000000000000000000000000000000000000000000000000000000000010000000002024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010080000000000000000000000000000000000000000000000000000000000000200000000020480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))))) + (NatTree.node 40 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x100400000000000000000000000000000001004000000000000000000000008040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000804000000000000000000000000000000008040000000000000000000000040400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000010000042000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002004000000000000000000000000000000000801000000000000000000000020100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010040000000000000000000000000000000004010000000000000000000000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002001000000000000000000000000000000000010002000000000000000000010008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004010000000000000000000000000000000000020020000000000000000000020080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000805000000000000000000000000000000000000000000000000000000000000000000000000000400020000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x100000000000000000000000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000800000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000400000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000100800000000000000000000000000000000000000000000004000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000202000000000000000000000000000000000000000000000200000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000040000000000000001000000005000000000000000000000000000000000000000000000000000000000010000002008001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000004000008200000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000020000004100008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x200000000000000000000000000000000000000000000000000000000000000000000000000042000000000000000000000000000000000000000000000000000000000000000000000000001020000000000000000000000000000000000000000000000000000000000000000000000201000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000004200000000000000000000000000000000000000000000000000000000000000000000000000810000000000000000000000000000000000000000000000000000000000000000000001010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000040000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000004000001000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000001000004000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000020400000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000400000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000002000008000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000020800000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000010000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x1000000000000000000000000000000000000000000000000000000000000000000000000000000002100000000000000000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000000000001020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000000000000000000000000000000000010800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000000000000088000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000000000000104000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000440000000000000000000000000000000000000000000000000000000000000000000000000010800000000000000000000000000000000000000000000000000000000000000000000000810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000000000000000000000000000000000000010800000000000000000000000000000000000000000000000000000000000000000000000820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000000000000000082000000000000000000000000000000000000000000000000000000000000000000000004080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000210000000000000000000000000000000000000000000000000000000000000000000000000008040000000000000000000000000000000000000000000000000000000000000000000000802000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x8020000000000000000000000000000000000000000000000000000000000000000000000000000000100400000000000000000000000000000000000000000000000000000000000000000000000080900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200080000000000000000000000000000000000000000000000000000000000000000000000000000004020800000000000000000000000000000000000000000000000000000000000000000000002000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010040000000000000000000000000000000000000000000000000000000000000000000000000000000402000000000000000000000000000000000000000000000000000000000000000000000000102800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800100000000000000000000000000000000000000000000000000000000000000000000000000000008084000000000000000000000000000000000000000000000000000000000000000000000002001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020040000000000000000000000000000000000000000000000000000000000000000000000000000002008000000000000000000000000000000000000000000000000000000000000000000000000809000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002001000000000000000000000000000000000000000000000000000000000000000000000000000000800400000000000000000000000000000000000000000000000000000000000000000000000100240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080100000000000000000000000000000000000000000000000000000000000000000000000000000080200000000000000000000000000000000000000000000000000000000000000000000000008090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000100000400000000000000000000000000000000000000000000000000000000000000000000400000400000000000000000000000000000000000000000000000000000000000000000000010000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x200000000400800000000800000000000000000000000000000000000000000000000000000000000000000001040000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000001000000400008000000000000000000000000000000000000000000000000000000000000000000000004000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044000800000000000000000000000000000000000000000000000000000000000000000000002401100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022004000000000000000000000000000000000000000000000000000000000000000000000014024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010800000000000000000000000000000000000000000000000000000000000000000000080001000020000000000000000000000000000000000000000000000000000000000000000000002000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001040000000000000000000000000000000000000000000000000000000000000000000000001000040001000000000000000000000000000000000000000000000000000000000000000000000100001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000440020000000000000000000000000000000000000000000000000000000000000000000000440110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802000000000000000000000000000000000000000000000000000000000000000000000000000002002040000000000000000000000000000000000000000000000000000000000000000000002000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x2000a000000000000000000000000000000000000000000000000000000000000000000000000000000402080010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180040000000000000000000000000000000000000000000000000000000000000000000000000000030110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900400000000000000000000000000000000000000000000000000000000000000000000000000000121100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060080000000000000000000000000000000000000000000000000000000000000000000000000000060900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000280800000000000000000000000000000000000000000000000000000000000000000000000000000289000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300800000000000000000000000000000000000000000000000000000000000000000000000000001850000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180200000000000000000000000000000000000000000000000000000000000000000000000000018090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018010000000000000000000000000000000000000000000000000000000000000000000000000018048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x400000000000000000000000000000000000000000000000000000000000000000000000000021000000000000000000000000000000000000000000000000000000000000000000000000000804000000000000000000000000000000000000000000000000000000000000000000000080200000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000000000000010200000000000000000000000000000000000000000000000000000000000000000000002010000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000042000000000000000000000000000000000000000000000000000000000000000000000000008100000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000800000000000000000000000000000000000000000020000800002001000100010000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000200000400010000000000080080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001800400000000000000000000000000000000004000800000000000000000004002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009004000000000000000000000000000000000008008000000000000000000008020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802800000000000000000000000000000000000000000000000000000000000000000000000000002002040002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x8000000100000000000000000000000000000000000000000000000000000000000000000000000040000008000000000000000000000000000000000000000000000000000000000000000000002000000100000000000000000000000000000000000000000000000000000000000000000020000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000008000000000000000000000000000000000000000000000000000000000000000000000400000004000000000000000000000000000000000000000000000000000000000000000000010000000040000000000000000000000000000000000000000000000000000000000000000200000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000000000000000000000000000000000000004800000000000000000000000000000000000000000000000000000000000000000000000108000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000000000000000880000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000000000001040000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000000000000000108000000000000000000000000000000000000000000000000000000000000000000000008100000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000004800000000000000000000000000000000000000000000000000000000000000000000000000108000000000000000000000000000000000000000000000000000000000000000000000008200000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000000000000000820000000000000000000000000000000000000000000000000000000000000000000000040800000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x20100000000000000000000000000000000000000000000000000000000000000000000000080900000000000000000000000000000000000000000000000000000000000400000000000000108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800200000000000000000000000000000000000000000000000000000000000000000000002004200000000000000000000000000000000000000000000000000000000000000000000000080810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008040000000000000000000000000000000000000000000000000000000000000000000000000004000200000000000000000000000000000000000000000000000000000000000000000000010000200000000000000000000000000000000000000000000000000000000000000000000000400010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100080000000000000000000000000000000000000000000000000000000000000000000000100240000000000000000000000000000000000000000000000000000000002000000000000000220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000404000000000000000000000000000000000000000000000000000000000000000000000000000000800400000000000000000000000000000000000000000000000000000000000000000000000800200000000000000000000000000000000000000000000000000000000000000000000000200100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004002000000000000000000000000000000000000000000000000000000000000000000000004011000000000000000000000000000000000000000000000000000000000100000000000000010800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008020000000000000000000000000000000000000000000000000000000000000000000000008110000000000000000000000000000000000000000000000000000000000000020000000000108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002008000000000000000000000000000000000000000000000000000000000000000000000001012000000000000000000000000000000000000000000000000000000000100000000000000042000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))))))) + (NatTree.node 152 (NatTree.node 72 (NatTree.node 32 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x1000200000000000000000000000000000000000000000000000000000000000000000000000040042000000000000000000000000000000000000000000000000000000000000000000000000101020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000200000000000000000000000000000000000000000000000000000000000000000000000100240000000000000000000000000000000000000000000000000000000000200000000000000022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000800000000000000000000000000000000000000000000000000000000000000000000000401100000000000000000000000000000000000000000000000000000000001000000000000000108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008008000000000000000000000000000000000000000000000000000000000000000000000000811000000000000000000000000000000000000000000000000000000000000000100000000001080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040080000000000000000000000000000000000000000000000000000000000000000000000080480000000000000000000000000000000000000000000000000000000000800000000000000108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200400000000000000000000000000000000000000000000000000000000000000000000000402400000000000000000000000000000000000000000000000000000000004000000000000000840000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000804000000000000000000000000000000000000000000000000000000000000000000000001024000000000000000000000000000000000000000000000000000000000000000400000000008400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080400000000000000000000000000000000000000000000000000000000000000000000000405000000000000000000000000000000000000000000000000000000000002000000000000001040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x800000000000000000000000000000000000000000000000000000000000000000000000000010000000008020000000000000000000000000000000000000000000000000000000000000040000000008110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040200000000000000000000000000000000000000000000000000000000000000000000002000000000404000000000000000000000000000000000000000000000000000000000000000000000000209000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100000000000000000000000000000000000000000000000000000000000000000000000000000040210000000000000000000000000000000000000000000000000000000000000000000000010042000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040080000000000000000000000000000000000000000000000000000000000000000000000000004044000000000000000000000000000000000000000000000000000000000000000000000000101080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004004000000000000000000000000000000000000000000000000000000000000000000000000004022000000000000000000000000000000000000000000000000000000000000000000000000080820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100400000000000000000000000000000000000000000000000000000000000000000000000000804800000000000000000000000000000000000000000000000000000000000000800000000000102000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000400000000000000000000000000000000000000000000000000000000000000000000000010021000000000000000000000000000000000000000000000000000000000000000000000000100804000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008010000000000000000000000000000000000000000000000000000000000000000000000000200900000000000000000000000000000000000000000000000000000000000004000000000000021000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x401000000000000000000100000000000000000000000000000000000000000000000000004000000080400000000000000480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a01000000000000000000000000000000000000000000000000000000000000000000000200000a0480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000004000008200000800000000000000000000000000000000000000000000000000000000000000000000200000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000001000000020040000010000000000000000000000000000000000000000000000000000000000000000004000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000000200000041000080000000000000000000000000000000000000000000000000000000000000000000010000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000040000000400100000400000000000000000000000000000000000000000000000000000000000000000100000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000040000002020000080000000000000000000000000000000000000000000000000000000000000000004000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000001000004200040000000000000000000000000000000000000000000000000000000000000000000008000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x40100000000000000000010000000000000000000000000000000000000000200800000000400000008040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000888010000000000000000000000000000000000000000000000000000000000000000000000000000228020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004020000000000000000000080000000000000000000000000000000000000000000000000200000000040400000000000000000900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000804000000000000000000080000000000000000000000000000000000000000000000000001000000020200000000000000005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180800000000000000000000000000000000000000000000000000000000000000000000000800000c50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001004000000000000000000200000000000000000000000000000000000000000000000000001000000100800000000000000090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a020000000000000000000000000000000000000000000000000000000000000000000000040000a090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000400800000000000000000000000000000000000000000000000000000000000021000000000000040440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x402000000000000000000008000000000000000000000000000000000000080400000000020000000004040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000048024000000000000000000000000000000000000000000000000000000000000000000000000000000900440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111004000000000000000000000000000000000000000000000000000000000000000000000000000001140200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008040000000000000000000800000000000000000000000000000000000000404000000000010000000202000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000222004000000000000000000000000000000000000000000000000000000000000000000000000000008a008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100400000000000000000020000000000000000000000000000000000000001010000000000100000010080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000800140000000000000000000000000000000000000000000000000000000000000000000000000000008084000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022200100000000000000000000000000000000000000000000000000000000000000000000000000002280040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x100000000000000000000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000000000000000000000000000000000000010800000000000000000000000000000000000000000000000000000000000000000000000820000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000000000000000082000000000000000000000000000000000000000000000000000000000000000000000004080000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000210000000000000000000000000000000000000000000000000000000000000000000000000008040000000000000000000000000000000000000000000000000000000000000000000000802000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000004200000000000000000000000000000000000000000000000000000000000000000000000000102000000000000000000000000000000000000000000000000000000000000000000000020100000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000000000000081000000000000000000000000000000000000000000000000000000000000000000000101000000000000000000000000000000000000000008000000000000000000000000000000000000400000008000280000200020000800002000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000050000010800000000200000400000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000810000010220040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x20008000000000000000000000000000000000000000000000000000000000000000000000000000000402080000000000000000000000000000000000000000000000000000000000000000000000200020000000000000000000000000000000000000000000000000000000000000000000000100020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008001000000000000000000000000000000000000000000000000000000000000000000000000000000080840000000000000000000000000000000000000000000000000000000000000000000000020010000000000000000000000000000000000000000000000000000000000000000000000020008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000001000004000000000000000000000000000000000000000000000000000000000000000000004000004000000000000000000000000000000000000000000000000000000000000000000000100000200000000000000000000000000000000000000000000000000000000000000000080000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000002100000000000000000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000000000001020000000000000000000000000000000000000000000000000000000000000000000408000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000000000000000000000000000000000010800000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000000000000088000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000000000000104000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000440000000000000000000000000000000000000000000000000000000000000000000000000010800000000000000000000000000000000000000000000000000000000000000000000000810000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000020000000000000) + (NatTree.node 8 (NatTree.leaf 0x1008000000000000000000000000000000000000000000000000000000000000020000000002048000000000000000000000000000000000000000000000000000000000000000800000000010800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040400000000000000000000000000000000000000000000000000000000000000080000000205000000000000000000000000000000000000000000000000000000000000000008000000001040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000108000000000000000000000000000000000000000000000000000000000000000000000800010000200000000000000000000000000000000000000000000000000000000000000000000020000800000000000000000000000000000000000000000000000000000000000000000000002000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000010000000040900000000000000000000000000000000000000000000000000000000000000004000000000108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000104000000000000000000000000000000000000000000000000000000000000000000000000100004000100000000000000000000000000000000000000000000000000000000000000000000010000100000000000000000000000000000000000000000000000000000000000000000000000400008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002008000000000000000000000000000000000000000000000000000000000000020000000002024000000000000000000000000000000000000000000000000000000000000008000000000022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080200000000000000000000000000000000000000000000000000000000000000000000000000000200204000000000000000000000000000000000000000000000000000000000000000000000200002000000000000000000000000000000000000000000000000000000000000000000000008001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000808000000000000000000000000000000000000000000000000000000000000002000000000412000000000000000000000000000000000000000000000000000000000000000400000000042000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x80400000000000000000000000000000000000000000000000000000000000000000000000100000002020000000000000000000000000000000000000000000000000000000000000000080000000828000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010040000000000000000000000000000000000000000000000000000000000000000000000010000001008000000000000000000000000000000000000000000000000000000000000000004000000409000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000401000000000000000000000000000000000000000000000000000000000000000000000004000000080400000000000000000000000000000000000000000000000000000000000000001000000010240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000000000001000000010200000000000000000000000000000000000000000000000000000000000000000200000001090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008040000000000000000000000000000000000000000000000000000000000000000000200000040480000000000000000000000000000000000000000000000000000000000000000008000000010200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040100000000000000000000000000000000000000000000000000000000000000000100000001009000000000000000000000000000000000000000000000000000000000000000004000000000210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000100000040000800000000000000000000000000000000000000000000000000000000000000000000000400008000000000000000000000000000000000000000000000000000000000000000000000001000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200200000000000000000000000000000000000000000000000000000000000000100000000020240000000000000000000000000000000000000000000000000000000000000004000000000022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))))) + (NatTree.node 40 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x490002000000000000000000000000000000000000000000000000000000000000000000000015002400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000100000020080010000000000000000000000000000000000000000000000000000000000000000000000808002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002440080000000000000000000000000000000000000000000000000000000000000000000000a8048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002480400000000000000000000000000000000000000000000000000000000000000000000004c0500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009201000000000000000000000000000000000000000000000000000000000000000000000024809000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000490008000000000000000000000000000000000000000000000000000000000000000000000490024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080500000000000000000000000000000000000000000000000000000000000000000000000000040002000010000000000000000000000000000000000000000000000000000000000000000100002000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000092008000000000000000000000000000000000000000000000000000000000000000000000049012000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x200400000000000000018020000000000000000000000000000000000000002010000000000000000020080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020010000000000000001801000000000000000000000000000000000000000100080000000000000008004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001180040000000000000000000000000000000000000000000000000000000000000000000000000000130110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010000000000000000100400000000000000000000000000000000000000008080000000100000001020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020008000000000000000000008000000100000000000000000000000000000000000000000000000000402080000000000000000040000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008001000000000000000000008000000008000000000000000000000000000000000000000000000000080840000000000000000400000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d0040000000000000000000000000000000000000000000000000000000000000000000000000680480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a8010000000000000000000000000000000000000000000000000000000000000000000000001a00900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x1000000000000000000000000000000000000000000000000000000000000000000000000000000002100000000000000000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000000000001020000000000000000000000000000000000000000000000000000000000000000000408000000000000000000000000000000000000400000000000000000000000000000000200005000001080010000020000040000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000000408000124804000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000000002080008920100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010a000000000000000000000000000000000000000000000000000000000000000000000800010000308002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000001020004490008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008020000000000000000060080000000000000000000000000000000000002004000000000000000000100400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001004000000000000000030080000000000000000000000000000000000000080400000000000000000040200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x80400000000000000000000000000000000000000000000000000000000000000000000000000040002000000000000000000000000000000000000000000000000000000000000000000000100002000000000000000000000000000000000000000000000000000000000000000000000004000100000000000000000000000000000000000000000000000000000000000000000000400080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000800000000000000000000000000000000000000000000000000000000000000000000001002400000000000000000000000000000000000000000000000000000000020000000000000002200000000000000000000000000000000000000000000000000000000000000000000010400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004040000000000000000000000000000000000000000000000000000000000000000000000000000008004000000000000000000000000000000000000000000000000000000000000000000000008002000000000000000000000000000000000000000000000000000000000000000000000002001000000000000000000000000000000000000000000000000000000000000000000000082000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008020000000000000000000000000000000000000000000000000000000000000000000000008110000000000000000000000000000000000000000000000000000000000000020000000000108000000000000000000000000000000000000000000000000000000000010000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400200000000000000000000000000000000000000000000000000000000000000000000000401100000000000000000000000000000000000000000000000000000000010000000000000001080000000000000000000000000000000000000000000000000000000000000000000004100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020080000000000000000000000000000000000000000000000000000000000000000000000010120000000000000000000000000000000000000000000000000000000001000000000000000420000000000000000000000000000000000000000000000000000000000000000000002080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000100000000000000000000000000000000000000000000000000000000000000000000000040000008000000000000000000000000000000000000000000000000000000000000000000002000000100000000000000000000000000000000000000000000000000000000000000000020000002000000000000000000000000000000000000000000000000000000000080000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000008000000000000000000000000000000000000000000000000000000000000000000000400000004000000000000000000000000000000000000000000000000000000000000000000010000000040000000000000000000000000000000000000000000000000000000000000000200000001000000000000000000000000000000000000000000000000000000004000020000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x100020000000000000000000000000000000000000000000000000000000000000000000000010024000000000000000000000000000000000000000000000000000000000020000000000000002200000000000000000000000000000000000000000000000000000000000000000000000810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080080000000000000000000000000000000000000000000000000000000000000000000000008110000000000000000000000000000000000000000000000000000000000000001000000000010800000000000000000000000000000000000000000000000000000000000100000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000800000000000000000000000000000000000000000000000000000000000000000000000401100000000000000000000000000000000000000000000000000000000001000000000000000108000000000000000000000000000000000000000000000000000000000000000000000020400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004008000000000000000000000000000000000000000000000000000000000000000000000008048000000000000000000000000000000000000000000000000000000000080000000000000010800000000000000000000000000000000000000000000000000000000000000000000002080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008040000000000000000000000000000000000000000000000000000000000000000000000010240000000000000000000000000000000000000000000000000000000000000004000000000084000000000000000000000000000000000000000000000000000000000000800000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200400000000000000000000000000000000000000000000000000000000000000000000000402400000000000000000000000000000000000000000000000000000000004000000000000000840000000000000000000000000000000000000000000000000000000000000000000000104000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008040000000000000000000000000000000000000000000000000000000000000000000000040500000000000000000000000000000000000000000000000000000000000200000000000000104000000000000000000000000000000000000000000000000000000000000000000000082000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000201000000000000000000000000000000000000000000000000000000000000000000000000809000000000000000000000000000000000000000000000000000000000004000000000000001080000000000000000000000000000000000000000000000000000000000000000000002080000000000000000000000000000000000000000000000000000000000000000000000000000000000)))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0xa000000000000000000000000000000000000000000000000000000000000000000000100000420004000000000000000000000000000000000000000000000000000000000000000000000800010000000000000000000000000000000000000000000000000000000000000000000000080000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080200000000000000000000000000000000000000000000000000000000000000000000000000000001004000000000000000000000000000000000000000000000000000000000000000000000000809000000000000000000000000000000000000000000000000000000000080000000000000021000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010040000000000000000000000000000000000000000000000000000000000000000000000000000000402000000000000000000000000000000000000000000000000000000000000000000000000102800000000000000000000000000000000000000000000000000000000001000000000000008400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002004000000000000000000000000000000000000000000000000000000000000000000000000000000200800000000000000000000000000000000000000000000000000000000000000000000000080900000000000000000000000000000000000000000000000000000000000040000000000002100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200100000000000000000000000000000000000000000000000000000000000000000000000000000080040000000000000000000000000000000000000000000000000000000000000000000000010024000000000000000000000000000000000000000000000000000000000008000000000000220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008010000000000000000000000000000000000000000000000000000000000000000000000000000008020000000000000000000000000000000000000000000000000000000000000000000000000809000000000000000000000000000000000000000000000000000000000001000000000000210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001004000000000000000000000000000000000000000000000000000000000000000000000000008048000000000000000000000000000000000000000000000000000000000000008000000000001020000000000000000000000000000000000000000000000000000000000000000000000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008010000000000000000000000000000000000000000000000000000000000000000000000000200900000000000000000000000000000000000000000000000000000000000004000000000000021000000000000000000000000000000000000000000000000000000000000000000000004080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x2000a000000000000000000000000000000000000000000000000000000000000000000000000000000402080010000000000000000000000000000000000000000000000000000000000000000000200020004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008201000000000000000000000000000000000000000000000000000000000000000000000000000000088840000000000000000000000000000000000000000000000000000000000000000000000022010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000040080000000080000000000000000000000000000000000000000000000000000000000000000000104000000040000000000000000000000000000000000000000000000000000000000000000008100000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000004000008200000800000000000000000000000000000000000000000000000000000000000000000000200000200000000000000000000000000000000000000000000000000000000000000000000002000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000001000000020040000010000000000000000000000000000000000000000000000000000000000000000004000000020000000000000000000000000000000000000000000000000000000000000000000100000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000000200000041000080000000000000000000000000000000000000000000000000000000000000000000010000100000000000000000000000000000000000000000000000000000000000000000000000800010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000040000000400100000400000000000000000000000000000000000000000000000000000000000000000100000000800000000000000000000000000000000000000000000000000000000000000000008000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000040000002020000080000000000000000000000000000000000000000000000000000000000000000004000000200000000000000000000000000000000000000000000000000000000000000000000800000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x10100000000000000001004000000000000000000000000000000000000000000000000001000000010200000000000008048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000004400880000000008000000000000000000000000000000000000000000000000000000000000000040440000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002808000000000000000000040000000000000000000000000000000000000000000000000000000002890000000000000002100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080400000000000000000000000000000000800000000800000000000000000000000000000000040002000000000000000000000000000000040000000400000000000000000000000000000100002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000902000000000000000000000000000000000000000000000000000000000000000000000000000002022040000000000000000000000000000000000000000000000000000000000000000000002020020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004802000000000000000000000000000000000000000000000000000000000000000000000000000000090040000000000000000000000000000000000000000000000000000000000000000000000048090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080280000000000000000000000000000000000000000000000000000000000000000000000000000200204000200000000000000000000000000000000000000000000000000000000000000000200002000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000210080000000000000000000000000000000000000000000000000000000000000000000000000000004120800000000000000000000000000000000000000000000000000000000000000000000002080200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x8040000000000000000180800000000000000000000000000000000000000404000000000010000000202000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011100480000000000000000000000000000000000000000000000000000000000000000000000000000114022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010040000000000000000a02000000000000000000000000000000000000000101000000000010000001008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008020000000001000100000000000000000000000000000000000000000000000000000000000000020020400000000040210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004010000000000000000a01000000000000000000000000000000000000000020080000000040000000804000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090040000000000000000004000000000000000000000000000000000000000080200000000000000012110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008010000000000000000d004000000000000000000000000000000000000000200800000000000000080200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090040000000000000000004000000000000000000000000000000000000000000000000000000000012110000000000000022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x802000000000000000000000000000000000000000000000000000000000000000000000000811000000000000000000000000000000000000000000000000000000000000002000000000010800000000000000000000000000000000000000000000000000000000001000000000001000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000008000000100000000000000000000000000000000000000000000000000000000000000000000000040000008000000000000000000000000000000000000000000000000000000000000000000002000000100000000000000000000000000000000000000000000000000000000000000000020000002000000000000000000000000000000000000000000000000000000000080000200000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000008000000008000000000000000000000000000000000000000000000000000000000000000000000400000004000000000000000000000000000000000000000000000000000000000000000000010000000040000000000000000000000000000000000000000000000000000000000000000200000001000000000000000000000000000000000000000000000000000000004000020000000000000000000000000000000000000000200000000000002000080000a001000100010000000040000040000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000105000000000000000000000000000000000000000000000000000000000000000000000000100004000184400200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000004802000000000000000000000000000000000000000000000000000000000000000001000000000802090040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004020000000000000000028080000000000000000000000000000000000000804000000000200000000040400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000111004000000000000000000000000000000000000000000000000000000000000000000800000000001140200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)))))) + (NatTree.node 72 (NatTree.node 32 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x20100000000000000000000000000000000000000000000000000000000000000000000000080900000000000000000000000000000000000000000000000000000000000400000000000000108000000000000000000000000000000000000000000000000000000000000000000000208000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008040000000000000000000000000000000000000000000000000000000000000000000000010240000000000000000000000000000000000000000000000000000000000000004000000000084000000000000000000000000000000000000000000000000000000000000800000000000400000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010008000000000000000000000000000000000000000000000000000000000000000000000010024000000000000000000000000000000000000000000000000000000000200000000000000022000000000000000000000000000000000000000000000000000000000000000000000104000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040020000000000000000000000000000000000000000000000000000000000000000000000040110000000000000000000000000000000000000000000000000000000001000000000000000108000000000000000000000000000000000000000000000000000000000000000000000410000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002008000000000000000000000000000000000000000000000000000000000000000000000001012000000000000000000000000000000000000000000000000000000000100000000000000042000000000000000000000000000000000000000000000000000000000000000000000208000000000000000000000000000000000000040000000000000000000000000000000000000000000000000008040000000000000000000000000000000000000000000000000000000000000000000000000004000200000000000000000000000000000000000000000000000000000000000000000000010000200000000000000000000000000000000000000000000000000000000000000000000000400010000000000000000000000000000000000000000000000000000000000000000000040008000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000010000040000000000000000000000000000000000000000000000000000000000000000000040000040000000000000000000000000000000000000000000000000000000000000000000001000002000000000000000000000000000000000000000000000000000000000000000000800002000000000000000000000000000000000000000000000400010000000000000000000000000000000000000000000000000000404000000000000000000000000000000000000000000000000000000000000000000000000000000800400000000000000000000000000000000000000000000000000000000000000000000000800200000000000000000000000000000000000000000000000000000000000000000000000200100000000000000000000000000000000000000000000000000000000000000000000008200000000000000000000000000000000000000000000001000000000000000000000000000000) + (NatTree.leaf 0x1004000000000000000000000000000000000000000000000000000000000000000000000000008048000000000000000000000000000000000000000000000000000000000000008000000000001020000000000000000000000000000000000000000000000000000000000000000000000101000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008010000000000000000000000000000000000000000000000000000000000000000000000000200900000000000000000000000000000000000000000000000000000000000004000000000000021000000000000000000000000000000000000000000000000000000000000000000000004080000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010002000000000000000000000000000000000000000000000000000000000000000000000001002400000000000000000000000000000000000000000000000000000000002000000000000000220000000000000000000000000000000000000000000000000000000000000000000000081000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040008000000000000000000000000000000000000000000000000000000000000000000000004011000000000000000000000000000000000000000000000000000000000010000000000000001080000000000000000000000000000000000000000000000000000000000000000000000204000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040080000000000000000000000000000000000000000000000000000000000000000000000080480000000000000000000000000000000000000000000000000000000000800000000000000108000000000000000000000000000000000000000000000000000000000000000000000020800000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200400000000000000000000000000000000000000000000000000000000000000000000000402400000000000000000000000000000000000000000000000000000000004000000000000000840000000000000000000000000000000000000000000000000000000000000000000000104000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008040000000000000000000000000000000000000000000000000000000000000000000000040500000000000000000000000000000000000000000000000000000000000200000000000000104000000000000000000000000000000000000000000000000000000000000000000000082000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080080000000000000000000000000000000000000000000000000000000000000000000000008110000000000000000000000000000000000000000000000000000000000000001000000000010800000000000000000000000000000000000000000000000000000000000100000000000040000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x10100000000000000000000000000000000000000000000000000000000000000010000000040900000000000000000000000000000000000000000000000000000000000000004000000000108000000000000000000000000000000000000000000000000000000000000800000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800200000000000000000000000000000000000000000000000000000000000000000000002004200000000000000000000000000000000000000000000000000000000000000000000000080810000000000000000000000000000000000000000000000000000000000000000000009010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001040000000000000000000000000000000000000000000000000000000000000000000000001000040001000000000000000000000000000000000000000000000000000000000000000000000100001000000000000000000000000000000000000000000000000000000000000000000000004000080000000000000000000000000000000000000000000000000000000000000000001000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020080000000000000000000000000000000000000000000000000000000000000200000000020240000000000000000000000000000000000000000000000000000000000000080000000000220000000000000000000000000000000000000000000000000000000000040000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802000000000000000000000000000000000000000000000000000000000000000000000000000002002040000000000000000000000000000000000000000000000000000000000000000000002000020000000000000000000000000000000000000000000000000000000000000000000000080010000000000000000000000000000000000000000000000000000000000000000000020010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008080000000000000000000000000000000000000000000000000000000000000020000000004120000000000000000000000000000000000000000000000000000000000000004000000000420000000000000000000000000000000000000000000000000000000000008000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020008000000000000000000000000000000000000000000000000000000000000000000000000000000402080000000000000000000000000000000000000000000000000000000000000000000000200020000000000000000000000000000000000000000000000000000000000000000000000100020000000000000000000000000000000000000000000000000000000000000000000040080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008001000000000000000000000000000000000000000000000000000000000000000000000000000000080840000000000000000000000000000000000000000000000000000000000000000000000020010000000000000000000000000000000000000000000000000000000000000000000000020008000000000000000000000000000000000000000000000000000000000000000000040200000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x804000000000000000000000000000000000000000000000000000000000000000000020000004048000000000000000000000000000000000000000000000000000000000000000000800000001020000000000000000000000000000000000000000000000000000000000000040000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020004000000000000000000000000000000000000000000000000000000000000000000000000100210000000000000000000000000000000000000000000000000000000000000000000000001008040000000000000000000000000000000000000000000000000000000000000000000002802000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040100000000000000000000000000000000000000000000000000000000000000000100000001009000000000000000000000000000000000000000000000000000000000000000004000000000210000000000000000000000000000000000000000000000000000000000000200000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000200000000000000000000000000000000000000000000000000000000000000000000000040042000000000000000000000000000000000000000000000000000000000000000000000000101020000000000000000000000000000000000000000000000000000000000000000000000a01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200200000000000000000000000000000000000000000000000000000000000000100000000020240000000000000000000000000000000000000000000000000000000000000004000000000022000000000000000000000000000000000000000000000000000000000000400000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100800000000000000000000000000000000000000000000000000000000000002000000000204800000000000000000000000000000000000000000000000000000000000000080000000001080000000000000000000000000000000000000000000000000000000000010000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004040000000000000000000000000000000000000000000000000000000000000008000000020500000000000000000000000000000000000000000000000000000000000000000800000000104000000000000000000000000000000000000000000000000000000000000100000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010800000000000000000000000000000000000000000000000000000000000000000000080001000020000000000000000000000000000000000000000000000000000000000000000000002000080000000000000000000000000000000000000000000000000000000000000000000000200002000000000000000000000000000000000000000000000000000000000000000000008001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x1801000000000000000000000000000000000000000000000000000000000000000000000000001804800000000000000000000000000000000000000000000000000000000000000000000000030108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004400080000000000000000000000000000000000000000000000000000000000000000000000240110000000000000000000000000000000000000000000000000000000000100000000000001010800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002200400000000000000000000000000000000000000000000000000000000000000000000001402400000000000000000000000000000000000000000000000000000000004000000000000080840000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000440020000000000000000000000000000000000000000000000000000000000000000000000440110000000000000000000000000000000000000000000000000000000001000000000000010108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040200000000000000000000000000000000000000000000000000000000000000000000002000000000404000000000000000000000000000000000000000000000000000000000000000000000000209000000000000000000000000000000000000000000000000000000000000000200000000021000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100000000000000000000000000000000000000000000000000000000000000000000000000000040210000000000000000000000000000000000000000000000000000000000000000000000010042000000000000000000000000000000000000000000000000000000000000000000000008102000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040080000000000000000000000000000000000000000000000000000000000000000000000000004044000000000000000000000000000000000000000000000000000000000000000000000000101080000000000000000000000000000000000000000000000000000000000000000000000281000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004004000000000000000000000000000000000000000000000000000000000000000000000000004022000000000000000000000000000000000000000000000000000000000000000000000000080820000000000000000000000000000000000000000000000000000000000000000000000140800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x10000800140000000000000000000000000000000000000000000000000000000000000000000000000000008084000400000000000000000000000000000000000000000000000000000000000000000002001000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000104010000000000000000000000000000000000000000000000000000000000000000000000000000004421000000000000000000000000000000000000000000000000000000000000000000000001104200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001800400000000000000000000000000000000000000000000000000000000000000000000000000000301100000000000000000000000000000000000000000000000000000000000000000000000060110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009004000000000000000000000000000000000000000000000000000000000000000000000000000001211000000000000000000000000000000000000000000000000000000000000000000000000241100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600800000000000000000000000000000000000000000000000000000000000000000000000000000609000000000000000000000000000000000000000000000000000000000000000000000000060480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002808000000000000000000000000000000000000000000000000000000000000000000000000000002890000000000000000000000000000000000000000000000000000000000000000000000000284800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003008000000000000000000000000000000000000000000000000000000000000000000000000000018500000000000000000000000000000000000000000000000000000000000000000000000000c24000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001802000000000000000000000000000000000000000000000000000000000000000000000000000180900000000000000000000000000000000000000000000000000000000000000000000000006022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x40000000033008000000000000000000000000000000000000000000000000000000000000000000000000000038500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020040000000000000001802000000000000000000000000000000000000000000000000000000000002008000000000000180900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000318020000000000000000000000000000000000000000000000000000000000000000000000000003809000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020010000000000000001801000000000000000000000000000000000000000000000000000000000008004000000000001804800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000518010000000000000000000000000000000000000000000000000000000000000000000000000038048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000148000000000000000000000000000000000000000000000000000000000000000100000804010000200000000000000000000000000000000000000000000000000000000000000000010020000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010400000000000000000000000000000008000000100000000000000000000000000000000010000400010000000000000000000000000000040000008000000000000000000000000000000001000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000144000000000000000000000000000000000000000000000000000000000000000000001000104004000100000000000000000000000000000000000000000000000000000000000000000020010000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x4000000000000480240000000000000000000000000000000000000000000000020000004000000000000000000000009004400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008118040000000000000000000000000000000000000000000000000000000000000000000000010000401602000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001023004000000000000000000000000000000000000000000000000000000000000000000000001000100b0080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020224010000000000000000000000000000000000000000000000000000000000000000000000040008028804000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180040000000000000004004000000000000000000000000000000000000000400200000000000000030110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008089010000000000000000000000000000000000000000000000000000000000000000000000100004029020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008020000000000000000060080000000000000000000000000000000000000000000000000000000000100400000000000000060900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001004000000000000000030080000000000000000000000000000000000000000000000000000000000040200000000000000185000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x2010000000000000000000000000000000000000000000000000000000000000000000000008090000000000000000000000000000000000000000000000000000000000040000000000000010800000000000000000000000000000000000000000000000000000000000000000000020800000000000000000000000000000000000000001000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100080000000000000000000000000000000000000000000000000000000000000000000000100240000000000000000000000000000000000000000000000000000000002000000000000000220000000000000000000000000000000000000000000000000000000000000000000001040000000000000000000000000000000000000010000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400200000000000000000000000000000000000000000000000000000000000000000000000401100000000000000000000000000000000000000000000000000000000010000000000000001080000000000000000000000000000000000000000000000000000000000000000000004100000000000000000000000000000000000000080000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020080000000000000000000000000000000000000000000000000000000000000000000000010120000000000000000000000000000000000000000000000000000000001000000000000000420000000000000000000000000000000000000000000000000000000000000000000002080000000000000000000000000000000000000400000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008020000000000000000000000000000000000000000000000000000000000000000000000008110000000000000000000000000000000000000000000000000000000000000020000000000108000000000000000000000000000000000000000000000000000000000010000000000010000000000000000000000000000000000000000000000004000000000000000000000000010000008000280000a0002000080000200000000400000100000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200005000005080000000020000040000000010000040000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084c0200000000000000000000000000000000000000000000000000000000000000000000002000004009404000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))))) + (NatTree.node 40 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x801000000000000000000000000000000000000000000000000000000000000000000000000020090000000000000000000000000000000000000000000000000000000000000400000000000002100000000000000000000000000000000000000000000000000000000000000000000000408000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000001000200000000000000000000000000000000000000000000000000000000000000000000000100240000000000000000000000000000000000000000000000000000000000200000000000000022000000000000000000000000000000000000000000000000000000000000000000000008100000000000000000000000000000000000000000000001000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000004000800000000000000000000000000000000000000000000000000000000000000000000000401100000000000000000000000000000000000000000000000000000000001000000000000000108000000000000000000000000000000000000000000000000000000000000000000000020400000000000000000000000000000000000000000000008000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000008008000000000000000000000000000000000000000000000000000000000000000000000000811000000000000000000000000000000000000000000000000000000000000000100000000001080000000000000000000000000000000000000000000000000000000000010000000000004000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040080000000000000000000000000000000000000000000000000000000000000000000000080480000000000000000000000000000000000000000000000000000000000800000000000000108000000000000000000000000000000000000000000000000000000000000000000000020800000000000000000000000000000000000000000002000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200400000000000000000000000000000000000000000000000000000000000000000000000402400000000000000000000000000000000000000000000000000000000004000000000000000840000000000000000000000000000000000000000000000000000000000000000000000104000000000000000000000000000000000000000000010000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000804000000000000000000000000000000000000000000000000000000000000000000000001024000000000000000000000000000000000000000000000000000000000000000400000000008400000000000000000000000000000000000000000000000000000000000080000000000040000000000000000000000000000000000000000000000000000100000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080400000000000000000000000000000000000000000000000000000000000000000000000405000000000000000000000000000000000000000000000000000000000002000000000000001040000000000000000000000000000000000000000000000000000000000000000000000820000000000000000000000000000000000000000000800000000000000000000000000000000000000040000) + (NatTree.leaf 0x10100000000000000000000000000000000000000000000000000000000000000010000000040900000000000000000000000000000000000000000000000000000000000000004000000000108000000000000000000000000000000000000000000000000000000000000800000000008000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000104000000000000000000000000000000000000000000000000000000000000000000000000100004000100000000000000000000000000000000000000000000000000000000000000000000010000100000000000000000000000000000000000000000000000000000000000000000000000400008000000000000000000000000000000000000000000000000000000000000000000100008000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000008020000000000000000000000000000000000000000000000000000000000000000000000000000020020400000000000000000000000000000000000000000000000000000000000000000000020000200000000000000000000000000000000000000000000000000000000000000000000000800100000000000000000000000000000000000000000000000000000000000000000000200100000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020080000000000000000000000000000000000000000000000000000000000000200000000020240000000000000000000000000000000000000000000000000000000000000080000000000220000000000000000000000000000000000000000000000000000000000040000000000040000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000200080000000000000000000000000000000000000000000000000000000000000000000000000000004020800000000000000000000000000000000000000000000000000000000000000000000002000200000000000000000000000000000000000000000000000000000000000000000000001000200000000000000000000000000000000000000000000000000000000000000000000400800000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008080000000000000000000000000000000000000000000000000000000000000020000000004120000000000000000000000000000000000000000000000000000000000000004000000000420000000000000000000000000000000000000000000000000000000000008000000000080000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000800100000000000000000000000000000000000000000000000000000000000000000000000000000008084000000000000000000000000000000000000000000000000000000000000000000000002001000000000000000000000000000000000000000000000000000000000000000000000002000800000000000000000000000000000000000000000000000000000000000000000004020000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000010040000000000000000000000000000000000000000000000000000000000000000000000000080480000000000000000000000000000000000000000000000000000000000000080000000000010200000000000000000000000000000000000000000000000000000000000000000000001010000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000080000000000)) + (NatTree.node 8 (NatTree.leaf 0x20010000000000000000000000000000000000000000000000000000000000000000000000000000008004000000000000000000000000000000000000000000000000000000000000000000000001002400000000000000000000000000000000000000000000000000000000000800000000000022000000000000000000000000000000000000000000000000000000000000000000210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000801000000000000000000000000000000000000000000000000000000000000000000000000000000802000000000000000000000000000000000000000000000000000000000000000000000000080900000000000000000000000000000000000000000000000000000000000100000000000021000000000000000000000000000000000000000000000000000000000000000002100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080400000000000000000000000000000000000000000000000000000000000000000002000000404800000000000000000000000000000000000000000000000000000000000000000080000000102000000000000000000000000000000000000000000000000000000000000004000000000100000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000401000000000000000000000000000000000000000000000000000000000000000001000000010090000000000000000000000000000000000000000000000000000000000000000040000000002100000000000000000000000000000000000000000000000000000000000002000000000008000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200200000000000000000000000000000000000000000000000000000000000000100000000020240000000000000000000000000000000000000000000000000000000000000004000000000022000000000000000000000000000000000000000000000000000000000000400000000000100000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100800000000000000000000000000000000000000000000000000000000000002000000000204800000000000000000000000000000000000000000000000000000000000000080000000001080000000000000000000000000000000000000000000000000000000000010000000000008000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004040000000000000000000000000000000000000000000000000000000000000008000000020500000000000000000000000000000000000000000000000000000000000000000800000000104000000000000000000000000000000000000000000000000000000000000100000000002000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000010800000000000000000000000000000000000000000000000000000000000000000000080001000020000000000000000000000000000000000000000000000000000000000000000000002000080000000000000000000000000000000000000000000000000000000000000000000000200002000000000000000000000000000000000000000000000000000000000000000000008001000000000000000000000000000000000000000000000000000200000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x80400000000000000000000000000000000000000000000000000000000000000000000000100000002020000000000000000000000000000000000000000000000000000000000000000080000000828000000000000000000000000000000000000000000000000000000000000000080000000084000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010040000000000000000000000000000000000000000000000000000000000000000000000010000001008000000000000000000000000000000000000000000000000000000000000000004000000409000000000000000000000000000000000000000000000000000000000000000010000000021000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000401000000000000000000000000000000000000000000000000000000000000000000000004000000080400000000000000000000000000000000000000000000000000000000000000001000000010240000000000000000000000000000000000000000000000000000000000000004000000002200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000000000001000000010200000000000000000000000000000000000000000000000000000000000000000200000001090000000000000000000000000000000000000000000000000000000000000000800000002100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000001000000400008000000000000000000000000000000000000000000000000000000000000000000000004000080000000000000000000000000000000000000000000000000000000000000000000000010000800000000000000000000000000000000000000000000000000002000000000000000800040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802000000000000000000000000000000000000000000000000000000000000000000000000000000010040000000000000000000000000000000000000000000000000000000000000000000000008090000000000000000000000000000000000000000000000000000000000800000000000000210000000000000000000000000000000000000000000000000000000000000000000001040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100400000000000000000000000000000000000000000000000000000000000000000000000000000004020000000000000000000000000000000000000000000000000000000000000000000000001028000000000000000000000000000000000000000000000000000000000010000000000000084000000000000000000000000000000000000000000000000000000000000000000002100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020040000000000000000000000000000000000000000000000000000000000000000000000000000002008000000000000000000000000000000000000000000000000000000000000000000000000809000000000000000000000000000000000000000000000000000000000000400000000000021000000000000000000000000000000000000000000000000000000000000000000008400000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x880000000000000000000000000000000000000000000000000000000200000004000040000101000004000000000000000000000000000000000000000000000000000000000000080000804000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800920080000000000000000000000000000000000000000000000000000000000000200002000920240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008204000000000000000000000000000000000000000000000000000000000000000000000a000008001004000000000000000000000000000000000000000000000000000000000000008000008001002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000801280800000000000000000000000000000000000000000000000000000000000000200000800941200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000804000000000000000000000000000000008000000008000000000000000000000000000000000400020000000000000000000000000000000400000004000000000000000000000000000001000020000000000000000000000000000000010000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000010000002008001000000000000000000000000000000000000000000000000000000000000000000000080800200000000000000000000000000000000000000000000000000000000000000000000000820010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000010000000008020000000000000000000000000000000000000000000000000000000000000040000000008110000000000000000000000000000000000000000000000000000000000000021000000000108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000805000000000000000000000000000000000000000000000000000000000000000000000000000400020000100000000000000000000000000000000000000000000000000000000000000001000020000080000000000000000000000000000000000000000000000000000000000000000040001000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x6008000000000000000200040000000000000000000000000000000000000000000000000000000006090000000000001002100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008002c010000000000000000000000000000000000000000000000000000000000000000010000800b00900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000002440044000000000040000000000000000000000000000000000000000000000000000000000000040228000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000920020000000000000000000000000000000000000000000000000000000000000010000400052024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000200000400010000000000080080000000000000000000000000000000000000000000000000000000000800000000000008118000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020004500800000000000000000000000000000000000000000000000000000000000002000008002a0480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002004c0400000000000000000000000000000000000000000000000000000000000000080000800e0500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001001301000000000000000000000000000000000000000000000000000000000000000100008004c09000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x400222004800000000000000000000000000000000000000000000000000000000000000000000000020008a008800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020001000140200800000000000000000000000000000000000000000000000000000000000000000000000040210440200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008002220012000000000000000000000000000000000000000000000000000000000000000000000001000228004800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101000000000000020058040000000000000000000000000000000000000000808000000010000000102000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000402000000000000000002808000000000000000000000000000000000000000000000000020000000004040000000000000002890000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080008880140000000000000000000000000000000000000000000000000000000000000000000000040002280280000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180040000000000000004004000000000000000000000000000000000000000000000000000000000030110000000000004022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200580400000000000000000000000000000000000000000000000000000000000000000002000802c0480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x1008000000000000000000000000000000000000000000000000000000000000020000000002048000000000000000000000000000000000000000000000000000000000000000800000000010800000000000000000000000000000000000000000000000000000000000100000000000080000000000000000000000000000000000000000000000000000200000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040400000000000000000000000000000000000000000000000000000000000000080000000205000000000000000000000000000000000000000000000000000000000000000008000000001040000000000000000000000000000000000000000000000000000000000001000000000020000000000000000000000000000000000000000000000000000800000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010000000000000000000000000000000000000000000000000000000000000001000000004090000000000000000000000000000000000000000000000000000000000000000400000000010800000000000000000000000000000000000000000000000000000000000080000000000800000000000000000000000000000000000000000000000002000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020080000000000000000000000000000000000000000000000000000000000000200000000020240000000000000000000000000000000000000000000000000000000000000080000000000220000000000000000000000000000000000000000000000000000000000040000000000040000000000000000000000000000000000000000000000010000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000808000000000000000000000000000000000000000000000000000000000000002000000000412000000000000000000000000000000000000000000000000000000000000000400000000042000000000000000000000000000000000000000000000000000000000000800000000008000000000000000000000000000000000000000000000100000000000000000000000080002000080000a0010001040101000000400000400000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000008050000000000000000000000000000000000000000000000000010000000200400000100000004000200001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040400000000222004000000000000000000000000000000000000000000000000000000000000000080040000000008a008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x2004000000000000000000000000000000000000000000000000000000000000000000000000000000200800000000000000000000000000000000000000000000000000000000000000000000000080900000000000000000000000000000000000000000000000000000000000040000000000002100000000000000000000000000000000000000000000000000000000000000000000840000000000000000000000000000000000000800000000000000000000000000000000000000000000000000200080000000000000000000000000000000000000000000000000000000000000000000000000000004020800000000000000000000000000000000000000000000000000000000000000000000002000200000000000000000000000000000000000000000000000000000000000000000000001000200000000000000000000000000000000000000000000000000000000000000000000400800000000000000000000000000000000000010000000200000000000000000000000000000000000000000000000000000000000000002001000000000000000000000000000000000000000000000000000000000000000000000000000000800400000000000000000000000000000000000000000000000000000000000000000000000100240000000000000000000000000000000000000000000000000000000000080000000000002200000000000000000000000000000000000000000000000000000000000000000021000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000800100000000000000000000000000000000000000000000000000000000000000000000000000000008084000000000000000000000000000000000000000000000000000000000000000000000002001000000000000000000000000000000000000000000000000000000000000000000000002000800000000000000000000000000000000000000000000000000000000000000000004020000000000000000000000000000000000000800000100000000000000000000000000000000000000000000000000000000000000000000801000000000000000000000000000000000000000000000000000000000000000000000000000000802000000000000000000000000000000000000000000000000000000000000000000000000080900000000000000000000000000000000000000000000000000000000000100000000000021000000000000000000000000000000000000000000000000000000000000000002100000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000080400000000000000000000000000000000000000000000000000000000000000000002000000404800000000000000000000000000000000000000000000000000000000000000000080000000102000000000000000000000000000000000000000000000000000000000000004000000000100000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000401000000000000000000000000000000000000000000000000000000000000000001000000010090000000000000000000000000000000000000000000000000000000000000000040000000002100000000000000000000000000000000000000000000000000000000000002000000000008000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000200200000000000000000000000000000000000000000000000000000000000000100000000020240000000000000000000000000000000000000000000000000000000000000004000000000022000000000000000000000000000000000000000000000000000000000000400000000000100000000000000000000000000000000000000000000000000000010000000000000000000000000000000000004000000) + (NatTree.leaf 0x200040000000000000000000000000000000000000000000000000000000000000000000000001002100000000000000000000000000000000000000000000000000000000000000000000000010080400000000000000000000000000000000000000000000000000000000000000000000028020000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000200000000000000000000000000000000000000000000000000000000000000000000000040042000000000000000000000000000000000000000000000000000000000000000000000000101020000000000000000000000000000000000000000000000000000000000000000000000a010000000000000000000000000000000000000000000000000000004100000000000000000000000000000000000000000000000000000000000108000000000000000000000000000000000000000000000000000000000000000000000800010000200000000000000000000000000000000000000000000000000000000000000000000020000800000000000000000000000000000000000000000000000000000000000000000000002000020000000000000000000000000000000000000000000000000000000000000000000080010000000000000000000000000000000000000008000000000002000000000000000000000000000000000000000000000000000000000008020000000000000000000000000000000000000000000000000000000000000000000000000000000100400000000000000000000000000000000000000000000000000000000000000000000000080900000000000000000000000000000000000000000000000000000000008000000000000002100000000000000000000000000000000000000000000000000000000000000000000010400000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800200000000000000000000000000000000000000000000000000000000000000000000002004200000000000000000000000000000000000000000000000000000000000000000000000080810000000000000000000000000000000000000000000000000000000000000000000009010000000000000000000000000000000000000000000000081000000000000000000000000000000000000000000000001040000000000000000000000000000000000000000000000000000000000000000000000001000040001000000000000000000000000000000000000000000000000000000000000000000000100001000000000000000000000000000000000000000000000000000000000000000000000004000080000000000000000000000000000000000000000000000000000000000000000001000080000000000000000000000000000000000004000000000000800000000000000000000000000000000000000000000000000000000000100400000000000000000000000000000000000000000000000000000000000000000000000000000004020000000000000000000000000000000000000000000000000000000000000000000000001028000000000000000000000000000000000000000000000000000000000010000000000000084000000000000000000000000000000000000000000000000000000000000000000002100000000000000000000000000000000000001000000000000000000000000000000000000000000000000000802000000000000000000000000000000000000000000000000000000000000000000000000000002002040000000000000000000000000000000000000000000000000000000000000000000002000020000000000000000000000000000000000000000000000000000000000000000000000080010000000000000000000000000000000000000000000000000000000000000000000020010000000000000000000000000000000000000040000000200000000000000000000000000000)))))))) + (NatTree.node 304 (NatTree.node 152 (NatTree.node 72 (NatTree.node 32 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x900000000000000000000000000000000000000000000000000000000001000000020040000010000000000000000000000000000000000000000000000000000000000000000004000000020000000000000000000000000000000000000000000000000000000000000000000100000002000000000000000000000000000000000000000000000000000000080000000100000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000000200000041000080000000000000000000000000000000000000000000000000000000000000000000010000100000000000000000000000000000000000000000000000000000000000000000000000800010000000000000000000000000000000000000000000000000040000000000000000040001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000040000000400100000400000000000000000000000000000000000000000000000000000000000000000100000000800000000000000000000000000000000000000000000000000000000000000000008000000080000000000000000000000000000000000000000000000000000002000000008000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000040000002020000080000000000000000000000000000000000000000000000000000000000000000004000000200000000000000000000000000000000000000000000000000000000000000000000800000008000000000000000000000000000000000000000000000000000000400000000400000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000001000004200040000000000000000000000000000000000000000000000000000000000000000000008000100000000000000000000000000000000000000000000000000000000000000000000000800004000000000000000000000000000000000000000000000000020000000000000000080002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000402000000000000000000000000000000000000000000000000000000000000000000000020000000004040000000000000000000000000000000000000000000000000000000000000000000000002090000000000000000000000000000000000000000000000000000000000000002000000000210000000000000000000000000000000000000000000000000000000000004000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040080000000000000000000000000000000000000000000000000000000000000000000000000004044000000000000000000000000000000000000000000000000000000000000000000000000101080000000000000000000000000000000000000000000000000000000000000000000000281000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004004000000000000000000000000000000000000000000000000000000000000000000000000004022000000000000000000000000000000000000000000000000000000000000000000000000080820000000000000000000000000000000000000000000000000000000000000000000000140800000000000000000000000000000000000000000000000000000000000440000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0xa01000000000000000000000000000000000000000000000000000000000000000000000200000a048000000000000000000000000000000000000000000000000000000000000000000100000141080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009020000000000000000000000000000000000000000000000000000000000000000000000000000020220400000000000000000000000000000000000000000000000000000000000000000000020200200000000000000000000000000000000000000000000000000000000000000000000000900100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080280000000000000000000000000000000000000000000000000000000000000000000000000000200204000200000000000000000000000000000000000000000000000000000000000000000200002000080000000000000000000000000000000000000000000000000000000000000000008001000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000210080000000000000000000000000000000000000000000000000000000000000000000000000000004120800000000000000000000000000000000000000000000000000000000000000000000002080200000000000000000000000000000000000000000000000000000000000000000000001200200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000a0000000000000000000000000000000000000000000000000000000000000000000000000000004020800100000000000000000000000000000000000000000000000000000000000000000002000200040000000000000000000000000000000000000000000000000000000000000000001000200020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000082010000000000000000000000000000000000000000000000000000000000000000000000000000000888400000000000000000000000000000000000000000000000000000000000000000000000220100000000000000000000000000000000000000000000000000000000000000000000000280080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000400800000000800000000000000000000000000000000000000000000000000000000000000000001040000000400000000000000000000000000000000000000000000000000000000000000000081000000004000000000000000000000000000000000000000000000000000000000000002020000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000040000082000008000000000000000000000000000000000000000000000000000000000000000000002000002000000000000000000000000000000000000000000000000000000000000000000000020000100000000000000000000000000000000000000000000000000080000000000000001000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x480240000000000000000000000000000000000000000000000000000000000000000000000000000009004400000000000000000000000000000000000000000000000000000000000000000000004809100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001110040000000000000000000000000000000000000000000000000000000000000000000000000000011402000000000000000000000000000000000000000000000000000000000000000000000004502800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000222004000000000000000000000000000000000000000000000000000000000000000000000000000008a0080000000000000000000000000000000000000000000000000000000000000000000000228090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002220010000000000000000000000000000000000000000000000000000000000000000000000000000228004000000000000000000000000000000000000000000000000000000000000000000000045002400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088801000000000000000000000000000000000000000000000000000000000000000000000000000022802000000000000000000000000000000000000000000000000000000000000000000000002280900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180800000000000000000000000000000000000000000000000000000000000000000000000800000c500000000000000000000000000000000000000000000000000000000000000000000800000624000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a020000000000000000000000000000000000000000000000000000000000000000000000040000a090000000000000000000000000000000000000000000000000000000000000000000020000282200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000104000000000000000000000000000000080000001000000000000000000000000000000000100004000100000000000000000000000000000400000080000000000000000000000000000000010000100000000000000000000000000000020000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x40200000000000000000280800000000000000000004000000000000000000000000000002000000000404000000000000000289000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008040000000000000000180800000000000000000000000000000000000000000000000000010000000202000000000800000c500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010040000000000000000a020000000000000000000000000000000000000000000000000000100000010080000000040000a09000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004010000000000000000a01000000000000000000000000000000000000000000000000000040000000804000000200000a048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008010000000000000000d0040000000000000000000000000000000000000000000000000000000000802000000000000680480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180800000000000000000080100000000000000000000000000000000000000000000000000800000c50000000000000002009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000090440009000000000000000000000000000000000000000000000000000000000000000000000424011400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000100000000000022440080000000000000000000000000000000000000000000000000000000000000000000008a80480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x1000200000000000000000000000000000000000000000000000000000000000000000000000040042000000000000000000000000000000000000000000000000000000000000000000000000101020000000000000000000000000000000000000000000000000000000000000000000000a0100000000000000000000000000000000000000000000000000000041000000000000000000000000000000000000000200000000000000000000000000000008020000000000000000000000000000000000000000000000000000000000000000000000000000000100400000000000000000000000000000000000000000000000000000000000000000000000080900000000000000000000000000000000000000000000000000000000008000000000000002100000000000000000000000000000000000000000000000000000000000000000000010400000000000000000000000000000000000002000000000000000000000000000000010000000000000000000000000000001004000000000000000000000000000000000000000000000000000000000000000000000000000000040200000000000000000000000000000000000000000000000000000000000000000000000010280000000000000000000000000000000000000000000000000000000000100000000000000840000000000000000000000000000000000000000000000000000000000000000000021000000000000000000000000000000000000010000000000000000000000000000040002000080000a001000500010000000040000040000000020000200000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000008000000000000000000400000000330080000000001000000400008000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000008028000000000000000000000000000000000000000000000000000000400000020200000800000020020400020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000011100480000000000000000000000000000000000000000000000000100000400000000000000000000114022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080200000000000000000600800000000000000020004000000000000000000000000000000000000001004000000000000000609000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x1400000000000000000000000000000000000000000000000000000100000040000800000000000000000000000000000000000000000000000000000000000000000000000400008000000000000000000000000000000000000000000000000000000000000000000000001000080000000000000000000000000000000000000000000000000000200000000000000080004000000000000000000000000000000000000000000000000000002020000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000001000000020040000010000000000000000000000000000000000000000000000000000000000000000004000000020000000000000000000000000000000000000000000000000000000000000000000100000002000000000000000000000000000000000000000000000000000000080000000100000000200000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000004800000000000000000000000000000000000000000000000000000000004000000040010000040000000000000000000000000000000000000000000000000000000000000000010000000080000000000000000000000000000000000000000000000000000000000000000000800000008000000000000000000000000000000000000000000000000000000200000000800000000800000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000004000000202000008000000000000000000000000000000000000000000000000000000000000000000400000020000000000000000000000000000000000000000000000000000000000000000000080000000800000000000000000000000000000000000000000000000000000040000000040000000400000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000040200000000000000000000000000000000000000000000000000000000000000000000002000000000404000000000000000000000000000000000000000000000000000000000000000000000000209000000000000000000000000000000000000000000000000000000000000000200000000021000000000000000000000000000000000000000000000000000000000000400000000004000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000004008000000000000000000000000000000000000000000000000000000000000000000000000000404400000000000000000000000000000000000000000000000000000000000000000000000010108000000000000000000000000000000000000000000000000000000000000000000000028100000000000000000000000000000000000000000000000000000000000000440000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000400400000000000000000000000000000000000000000000000000000000000000000000000000402200000000000000000000000000000000000000000000000000000000000000000000000008082000000000000000000000000000000000000000000000000000000000000000000000014080000000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000020004000000000000000000000000000000000000000000000000000000000000000000000000100210000000000000000000000000000000000000000000000000000000000000000000000001008040000000000000000000000000000000000000000000000000000000000000000000002802000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000800000000)) + (NatTree.node 8 (NatTree.leaf 0x440008000000000000000000000000000000000000000000000000000000000000000000000024011000000000000000000000000000000000000000000000000000000000010000000000000101080000000000000000000000000000000000000000000000000000000000000000000001204000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000220040000000000000000000000000000000000000000000000000000000000000000000000140240000000000000000000000000000000000000000000000000000000000400000000000008084000000000000000000000000000000000000000000000000000000000000000000000050400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044002000000000000000000000000000000000000000000000000000000000000000000000044011000000000000000000000000000000000000000000000000000000000100000000000001010800000000000000000000000000000000000000000000000000000000000000000000441000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080400000000000000000000000000000000000000000000000000000000000000000000000100000002020000000000000000000000000000000000000000000000000000000000000000080000000828000000000000000000000000000000000000000000000000000000000000000080000000084000000000000000000000000000000000000000000000000000000000000200000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010040000000000000000000000000000000000000000000000000000000000000000000000010000001008000000000000000000000000000000000000000000000000000000000000000004000000409000000000000000000000000000000000000000000000000000000000000000010000000021000000000000000000000000000000000000000000000000000000000000040000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100000000000000000000000000000000000000000000000000000000000000000000000000000040210000000000000000000000000000000000000000000000000000000000000000000000010042000000000000000000000000000000000000000000000000000000000000000000000008102000000000000000000000000000000000000000000000000000000000000000000140800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004010000000000000000000000000000000000000000000000000000000000000000000000040000000804000000000000000000000000000000000000000000000000000000000000000010000000102400000000000000000000000000000000000000000000000000000000000000040000000022000000000000000000000000000000000000000000000000000000000000800000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101000000000000000000000000000000000000000000000000000000000000000000000010000000102000000000000000000000000000000000000000000000000000000000000000002000000010900000000000000000000000000000000000000000000000000000000000000008000000021000000000000000000000000000000000000000000000000000000000001000000100000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x1480000000000000000000000000000000000000000000000000000000000000001000008040100002000000000000000000000000000000000000000000000000000000000000000000100200008000000000000000000000000000000000000000000000000000000000000000000040020000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009201000000000000000000000000000000000000000000000000000000000000000000000024809000000000000000000000000000000000000000000000000000000000004000000000000901080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001440000000000000000000000000000000000000000000000000000000000000000000010001040040001000000000000000000000000000000000000000000000000000000000000000000200100001000000000000000000000000000000000000000000000000000000000000000000080004000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080400000000000000000000000000000000800000000800000000000000000000000000000000040002000000000000000000000000000000040000000400000000000000000000000000000100002000000000000000000000000000000001000000004000000000000000000000000000004000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000049000800000000000000000000000000000000000000000000000000000000000000000000049002400000000000000000000000000000000000000000000000000000000020000000000002402200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000920080000000000000000000000000000000000000000000000000000000000000000000000490120000000000000000000000000000000000000000000000000000000001000000000000240420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000048020000000000000000000000000000000000000000000000000000000000000000000000000000000900400000000000000000000000000000000000000000000000000000000000000000000000480900000000000000000000000000000000000000000000000000000000008000000000000202100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100008001400000000000000000000000000000000000000000000000000000000000000000000000000000080840004000000000000000000000000000000000000000000000000000000000000000000020010000800000000000000000000000000000000000000000000000000000000000000000020008000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x80200000000010001000000000000000000000000000000000000000000000000000000000000000200204000000000402100000000000000000000000000000000000000000000000000000000200002000000000100400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001180040000000000000000000000000000000000000000000000000000000000000000000000000000130110000000000000000000000000000000000000000000000000000000000000000000000026011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d004000000000000000000000000000000000000000000000000000000000000000000000000068048000000000000000000000000000000000000000000000000000000000000008000000000601020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000004400880000000008000000000000000000000000000000000000000000000000000000000000000040440000000020000000000000000000000000000000000000000000000000000000000000001010800000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a8010000000000000000000000000000000000000000000000000000000000000000000000001a009000000000000000000000000000000000000000000000000000000000000040000000000060210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004900020000000000000000000000000000000000000000000000000000000000000000000000150024000000000000000000000000000000000000000000000000000000000020000000000001402200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002440080000000000000000000000000000000000000000000000000000000000000000000000a8048000000000000000000000000000000000000000000000000000000000080000000000005010800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002480400000000000000000000000000000000000000000000000000000000000000000000004c05000000000000000000000000000000000000000000000000000000000002000000000000481040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))))) + (NatTree.node 40 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x4000000005460080000000000000000000000000000000000000000000000000000000000000000000000000011160900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000b3008000000000000000000000000000000000000000000000000000000000000000000000000000938500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008201000000002000000004008000000008000000000000000000000000000000000000000000000000088840000000000000010400000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000020000000028d0040000000000000000000000000000000000000000000000000000000000000000000000001680480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000200000000028a8010000000000000000000000000000000000000000000000000000000000000000000000009a00900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000001000000000014490002000000000000000000000000000000000000000000000000000000000000000000000115002400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000081000001022004000000000000000000000000000000000000000000000000000000000000000080000414024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008804000000000000000000000000000000000000000000000000000000000000000000000000100400020080200000000000000000000000000000000000000000000000000000000000000401000020081100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x4020000000000000000000000000000000000000000000000000000000000000000000000200000000040400000000000000000000000000000000000000000000000000000000000000000000000020900000000000000000000000000000000000000000000000000000000000000020000000002100000000000000000000000000000000000000000000000000000000000040000000000400000000000000000000000000000000000000000000008000000000000000000000004000008000280010a0002000080400202000000400000100000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000280000a00020002800002000000004000001000000020000020000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000050000050800000000a00000400000000100000400000004000001000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002004a0000000000000000000000000000000000000000000000000000010000008008100010102280400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a204000000000000000000000000000000000000000000000000000000000000000000000a000008101004920080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000048020000000002220010000000000000000000000000000000000000000000000000000000000000000900400000000228004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200080000000001180040000000000000000000000000000000000000000000000000000000000000004020800000000130110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0xa000000000000000000000000000000000000000000000000000000000000000000000100000420004000000000000000000000000000000000000000000000000000000000000000000000800010000000000000000000000000000000000000000000000000000000000000000000000080000400000000000000000000000000000000000000000000000002000000000000000008000200000000000000000000000000000000000000000000000040200000000000000000000000000000000000000000000000000000000000000000804000000000000000000000000000000000000000000000000000000000000000000000001000000020200000000000000000000000000000000000000000000000000000000000000000800000008280000000000000000000000000000000000000000000000000000000000000000800000000840000000000000000000000000000000000000000000000000000000000002000000001000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000100400000000000000000000000000000000000000000000000000000000000000000000000100000010080000000000000000000000000000000000000000000000000000000000000000040000004090000000000000000000000000000000000000000000000000000000000000000100000000210000000000000000000000000000000000000000000000000000000000000400000004000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000004010000000000000000000000000000000000000000000000000000000000000000000000040000000804000000000000000000000000000000000000000000000000000000000000000010000000102400000000000000000000000000000000000000000000000000000000000000040000000022000000000000000000000000000000000000000000000000000000000000800000010000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000101000000000000000000000000000000000000000000000000000000000000000000000010000000102000000000000000000000000000000000000000000000000000000000000000002000000010900000000000000000000000000000000000000000000000000000000000000008000000021000000000000000000000000000000000000000000000000000000000001000000100000000000000000000000000000000000000000100000000000000000000000140000000000000000000000000000000000000000000000000000010000004000080000000000000000000000000000000000000000000000000000000000000000000000040000800000000000000000000000000000000000000000000000000000000000000000000000100008000000000000000000000000000000000000000000000000000020000000000000008000400000000000000000000000000000000000000000000000000000202000000000000000000000000000000000000008000000000000000000090000000000000000000000000000000000000000000000000000000000100000002004000001000000000000000000000000000000000000000000000000000000000000000000400000002000000000000000000000000000000000000000000000000000000000000000000010000000200000000000000000000000000000000000000000000000000000008000000010000000020000000000000000000000000000000000000000000000000000080000000000000000000000000000000004000000000000000009000000000000000000000000000000000000000000000000000000000000000040000002020000080000000000000000000000000000000000000000000000000000000000000000004000000200000000000000000000000000000000000000000000000000000000000000000000800000008000000000000000000000000000000000000000000000000000000400000000400000004000000000000000000000000000000000000000000000000000400000000000000000000000000000008000) + (NatTree.node 8 (NatTree.leaf 0x600800000000000000000000000000000000000000000000000000000000000000000000000000000609000000000000000000000000000000000000000000000000000000000000000000000000060480000000000000000000000000000000000000000000000000000000000080000000000050800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002808000000000000000000000000000000000000000000000000000000000000000000000000000002890000000000000000000000000000000000000000000000000000000000000000000000000284800000000000000000000000000000000000000000000000000000000000000040000000508000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003008000000000000000000000000000000000000000000000000000000000000000000000000000018500000000000000000000000000000000000000000000000000000000000000000000000000c2400000000000000000000000000000000000000000000000000000000000020000000000188000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180200000000000000000000000000000000000000000000000000000000000000000000000000018090000000000000000000000000000000000000000000000000000000000000000000000000602200000000000000000000000000000000000000000000000000000000000004000000000504000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018010000000000000000000000000000000000000000000000000000000000000000000000000018048000000000000000000000000000000000000000000000000000000000000000000000000301080000000000000000000000000000000000000000000000000000000000002000000000282000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000001000000000802000000000000000000000000000000000000000000000000000000000000004000000000811000000000000000000000000000000000000000000000000000000000000002100000000010800000000000000000000000000000000000000000000000000000000001080000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000004000008200000800000000000000000000000000000000000000000000000000000000000000000000200000200000000000000000000000000000000000000000000000000000000000000000000002000010000000000000000000000000000000000000000000000000008000000000000000100000800000000000000000000000000000000000000000000000000402000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000020000004100008000000000000000000000000000000000000000000000000000000000000000000001000010000000000000000000000000000000000000000000000000000000000000000000000080001000000000000000000000000000000000000000000000000004000000000000000004000100000000000000000000000000000000000000000000000000804000000000000000000000000000000000000000) + (NatTree.leaf 0x8020000000001000100000000000000000000000000000000000000000000000000000000000000020020400000000040210000000000000000000000000000000000000000000000000000000020000200000000010042000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000033008000000000000000000000000000000000000000000000000000000000000000000000000000038500000000000000000000000000000000000000000000000000000000000000000000000001c2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000003180200000000000000000000000000000000000000000000000000000000000000000000000000038090000000000000000000000000000000000000000000000000000000000000000000000000e020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000005180100000000000000000000000000000000000000000000000000000000000000000000000000380480000000000000000000000000000000000000000000000000000000000000000000000007010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010400000000000000000000000000000008000000100000000000000000000000000000000010000400010000000000000000000000000000040000008000000000000000000000000000000001000010000000000000000000000000000002000000100000000000000000000000000000000040000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000104010000000000000000000000000000000000000000000000000000000000000000000000000000004421000000000000000000000000000000000000000000000000000000000000000000000001104200000000000000000000000000000000000000000000000000000000000000000000000a102000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018004000000000000000000000000000000000000000000000000000000000000000000000000000003011000000000000000000000000000000000000000000000000000000000000000000000000601100000000000000000000000000000000000000000000000000000000000400000000000050800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090040000000000000000000000000000000000000000000000000000000000000000000000000000012110000000000000000000000000000000000000000000000000000000000000000000000002411000000000000000000000000000000000000000000000000000000000000000200000000508000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x822224010000000000000000000000000000000000000000000000000000000000000000000000040088228804000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020888901000000000000000000000000000000000000000000000000000000000000000000000010004422902000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010040000000000000000300800000000000000000a8010000000000000000000000000000000000000040200000000000000185000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008040000000000000000180800000000000000000080100000000000000000000000000000010000000202000000000800000c5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000001000100000000000000044008800000000080000000000000000000000000000000000000000000000040210000000000000404400000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000001000080450088000000000800000000000000000000000000000000000000000000000000000000000000005044000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010a000000000000000000000000000000000000000000000000000000000000000000000800010000308002000000000000000000000000000000000000000000000000000000000000000020000c200420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000111004000000000000000000000000000000000000000000000000000000000000000000800000000001140200000000000000000000000000000000000000000000000000000000000800000000000450200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x100400000000000000000000000000000000000000000000000000000000000000000000000100000010080000000000000000000000000000000000000000000000000000000000000000040000004090000000000000000000000000000000000000000000000000000000000000000100000000210000000000000000000000000000000000000000000000000000000000000400000004000000000000000000000000000000000000000000020000000000000000000100000000000000000000000000000000000000004010000000000000000000000000000000000000000000000000000000000000000000000040000000804000000000000000000000000000000000000000000000000000000000000000010000000102400000000000000000000000000000000000000000000000000000000000000040000000022000000000000000000000000000000000000000000000000000000000000800000010000000000000000000000000000000000000000001000000000000000000400000000000000000000000000000000000000000000101000000000000000000000000000000000000000000000000000000000000000000000010000000102000000000000000000000000000000000000000000000000000000000000000002000000010900000000000000000000000000000000000000000000000000000000000000008000000021000000000000000000000000000000000000000000000000000000000001000000100000000000000000000000000000000000000000100000000000000002000948025100004200400010000040400000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000500010508001000002008004040000001000004000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020911804000000000000000000000000000000000000000000000000000000000000000000000001000241160200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000880000002000a00000000000000000000000000000000000000000000200000004000040000101000004000000040208001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041223004000000000000000000000000000000000000000000000000000000000000000000000001001108b008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x44000800000000000000000000000000000000000000000000000000000000000000000000002401100000000000000000000000000000000000000000000000000000000001000000000000010108000000000000000000000000000000000000000000000000000000000000000000000120400000000000000000000000000000000000000000000000000010400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022004000000000000000000000000000000000000000000000000000000000000000000000014024000000000000000000000000000000000000000000000000000000000040000000000000808400000000000000000000000000000000000000000000000000000000000000000000005040000000000000000000000000000000000000000000000000020800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004400200000000000000000000000000000000000000000000000000000000000000000000004401100000000000000000000000000000000000000000000000000000000010000000000000101080000000000000000000000000000000000000000000000000000000000000000000044100000000000000000000000000000000000000000000020800000000000000000000000000000000000000000000000000000000000001000100000000000000000000000000000000000000000000000000000000000000000000000000000040210000000000000000000000000000000000000000000000000000000000000000000000010042000000000000000000000000000000000000000000000000000000000000000000000008102000000000000000000000000000000000000000000000000000000000000000000140800000000000000000000000000000000000000002040000000000000000000000000000028000000000000000000000000000000000000000000000000000000000004000008200000800000000000000000000000000000000000000000000000000000000000000000000200000200000000000000000000000000000000000000000000000000000000000000000000002000010000000000000000000000000000000000000000000000000008000000000000000100000800000000000000000000000000000000000000000000000000402000000000000000000000000000000000000800000000000000005000000000000000000000000000000000000000000000000000000000000000020000004100008000000000000000000000000000000000000000000000000000000000000000000001000010000000000000000000000000000000000000000000000000000000000000000000000080001000000000000000000000000000000000000000000000000004000000000000000004000100000000000000000000000000000000000000000000000000804000000000000000000000000000000000200000000000000000a000000000000000000000000000000000000000000000000000000000000000000000100000420004000000000000000000000000000000000000000000000000000000000000000000000800010000000000000000000000000000000000000000000000000000000000000000000000080000400000000000000000000000000000000000000000000000002000000000000000008000200000000000000000000000000000000000000000000000040200000000000000000000000000000002000000000000000000000000000000000804000000000000000000000000000000000000000000000000000000000000000000000001000000020200000000000000000000000000000000000000000000000000000000000000000800000008280000000000000000000000000000000000000000000000000000000000000000800000000840000000000000000000000000000000000000000000000000000000000002000000001000000000000000000000000000000000000000000000800000000000000000000020) + (NatTree.node 8 (NatTree.leaf 0x100000003180200000000000000000000000000000000000000000000000000000000000000000000000000038090000000000000000000000000000000000000000000000000000000000000000000000000e022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000005180100000000000000000000000000000000000000000000000000000000000000000000000000380480000000000000000000000000000000000000000000000000000000000000000000000007010800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008800000000000000000000000000000000000000000000000000000002000000040000400001010000040000000000000000000000000000000000000000000000000000000000000800008040000040000000000000000000000000000000000000000000000000000000000000100001001000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008204000000000000000000000000000000000000000000000000000000000000000000000a0000080010040000000000000000000000000000000000000000000000000000000000000080000080010020000000000000000000000000000000000000000000000000000000000000042000004000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000804000000000000000000000000000000008000000008000000000000000000000000000000000400020000000000000000000000000000000400000004000000000000000000000000000001000020000000000000000000000000000000010000000040000000000000000000000000000040001000000000000000000000000000000200000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000010000002008001000000000000000000000000000000000000000000000000000000000000000000000080800200000000000000000000000000000000000000000000000000000000000000000000000820010000000000000000000000000000000000000000000000000002000000000000000040040800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080500000000000000000000000000000000000000000000000000000000000000000000000000040002000010000000000000000000000000000000000000000000000000000000000000000100002000008000000000000000000000000000000000000000000000000000000000000000004000100004000000000000000000000000000000000000000000000000000000100000000400080008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000004008000000008000000000000000000000000000000000000000000000000000000000000000000010400000004000000000000000000000000000000000000000000000000000000000000000000810000000040000000000000000000000000000000000000000000000000000000000000020200000001000000000000000000000000000000000000000000000000000000004400020000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x4000000000000000000000080022200120000000000000000000000000000000020000004000000000000000000000000000000010002280048000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000001000080014000000000000000000000000000000000000010000000200400000100000000000000000000000808400040000000000000000000000000000000000040000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000080008880140000000000000000000000000000000000100000400000000000000000000000000000040002280280000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000040800012480400000000000000000000000000000000000000000000000000000000000000000400024c050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000000002080008920100000000000000000000000000000000000000000000000000000000000000000100022480900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000111004000000000000000000000000000000000000000000000000000000000000000000800000000001140200000000000000000000000000000000000000000000000000000000000800000000000450280000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001110048000000000000000000000000000000000000000000000000000000000000000000000000000011402200000000000000000000000000000000000000000000000000000000000000000000004502880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000033008000000000000000000000000000000000000000000000000000000000000000000000000000038500000000000000000000000000000000000000000000000000000000000000000000000001c240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)))))) + (NatTree.node 72 (NatTree.node 32 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x11100400000000008880100000000000000000000000000000000000000000000000000000000000000114020000000002280200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000804000000000000000000800088801400000000000000000000000000000000000000000000000400020000000000000000000400022802800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000043380800000000000000000000000000000000000000000000000000000000000000000000000800103c500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000231a020000000000000000000000000000000000000000000000000000000000000000000000040083a09000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000851a01000000000000000000000000000000000000000000000000000000000000000000000200103a04800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000010000804500880000000008000000000000000000000000000000000000000000000000000000000000000054440000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300800000000000000000a8010000000000000000000000000000000000000000000000000000000185000000000000001a0090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000001220024400000000100100000000000000000000000000000000000000000000000000000000000100254000000010020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x44000800000000000000000000000000000000000000000000000000000000000000000000002401100000000000000000000000000000000000000000000000000000000001000000000000010108000000000000000000000000000000000000000000000000000000000000000000000120400000000000000000000000000000000000000000000000000010400000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022004000000000000000000000000000000000000000000000000000000000000000000000014024000000000000000000000000000000000000000000000000000000000040000000000000808400000000000000000000000000000000000000000000000000000000000000000000005040000000000000000000000000000000000000000000000000020800000000000000000000000000000000004000000000000000000000000000000000000000000000000101000000000000000000000000000000000000000000000000000000000000000000000010000000102000000000000000000000000000000000000000000000000000000000000000002000000010900000000000000000000000000000000000000000000000000000000000000008000000021000000000000000000000000000000000000000000000000000000000001000000100000000000000000000000000000000000000000100000000000000022002000080000a001000500010000000140000040000000020000200000000200000010000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800940000000000000000000000000000000000000000000000000000000001000000020040800a124c0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100094000000000000000000000000000000000000000000000000000000000000000400000020208090893010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050000000000040400000000000000000000100000003180200000000000100000020080010000000000000000000080040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008805000480200000000000000000000000000000000000000000000000000000000000000000100400020080309004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x18004000000000000000000000000000000000000000000000000000000000000000000000000000003011000000000000000000000000000000000000000000000000000000000000000000000000601100000000000000000000000000000000000000000000000000000000000400000000000050800000000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000280800000000000000000000000000000000000000000000000000000000000000000000000000000289000000000000000000000000000000000000000000000000000000000000000000000000028480000000000000000000000000000000000000000000000000000000000000004000000050800000000000000000000000000000000000000000000000000000000000800000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006008000000000000000000000000000000000000000000000000000000000000000000000000000006090000000000000000000000000000000000000000000000000000000000000000000000000604800000000000000000000000000000000000000000000000000000000000800000000000508000000000000000000000000000000000000000000000000000000000000000010800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003008000000000000000000000000000000000000000000000000000000000000000000000000000018500000000000000000000000000000000000000000000000000000000000000000000000000c24000000000000000000000000000000000000000000000000000000000000200000000001880000000000000000000000000000000000000000000000000000000000000000880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001802000000000000000000000000000000000000000000000000000000000000000000000000000180900000000000000000000000000000000000000000000000000000000000000000000000006022000000000000000000000000000000000000000000000000000000000000040000000005040000000000000000000000000000000000000000000000000000000000000088000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180100000000000000000000000000000000000000000000000000000000000000000000000000180480000000000000000000000000000000000000000000000000000000000000000000000003010800000000000000000000000000000000000000000000000000000000000020000000002820000000000000000000000000000000000000000000000000000000000008800000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000010000000008020000000000000000000000000000000000000000000000000000000000000040000000008110000000000000000000000000000000000000000000000000000000000000021000000000108000000000000000000000000000000000000000000000000000000000010800000000010000000000000000000000000000000000000000400000004000000000000000000000000000000000000000000000000000000000000100010000000000000000000000000000000000000000000000000000000000000000000000000000004021000000000000000000000000000000000000000000000000000000000000000000000001004200000000000000000000000000000000000000000000000000000000000000000000000810200000000000000000000000000000000000000000000000000000000000000000014080000000000000000000000000000000000004000204000000000000000000000) + (NatTree.leaf 0xa01000000000000000000000000000000000000000000000000000000000000000000000200000a04800000000000000000000000000000000000000000000000000000000000000000010000014108000000000000000000000000000000000000000000000000000000000000000400000028200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000902000000000000000000000000000000000000000000000000000000000000000000000000000002022040000000000000000000000000000000000000000000000000000000000000000000002020020000000000000000000000000000000000000000000000000000000000000000000000090010000000000000000000000000000000000000000000000000000000000040000000420010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004802000000000000000000000000000000000000000000000000000000000000000000000000000000090040000000000000000000000000000000000000000000000000000000000000000000000048090000000000000000000000000000000000000000000000000000000000800000000000020210000000000000000000000000000000000000000000000000000000000000000000009040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080280000000000000000000000000000000000000000000000000000000000000000000000000000200204000200000000000000000000000000000000000000000000000000000000000000000200002000080000000000000000000000000000000000000000000000000000000000000000008001000080000000000000000000000000000000000000000000000000000004000000002001000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000210080000000000000000000000000000000000000000000000000000000000000000000000000000004120800000000000000000000000000000000000000000000000000000000000000000000002080200000000000000000000000000000000000000000000000000000000000000000000001200200000000000000000000000000000000000000000000000000000000000100000008400800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000a00000000000000000000000000000000000000000000000000000000000000000000000000000040208001000000000000000000000000000000000000000000000000000000000000000000020002000400000000000000000000000000000000000000000000000000000000000000000010002000200000000000000000000000000000000000000000000000000000001000000004008008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000820100000000000000000000000000000000000000000000000000000000000000000000000000000008884000000000000000000000000000000000000000000000000000000000000000000000002201000000000000000000000000000000000000000000000000000000000000000000000002800800000000000000000000000000000000000000000000000000000000000080000044020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090040000000000000000000000000000000000000000000000000000000000000000000000000000012110000000000000000000000000000000000000000000000000000000000000000000000002411000000000000000000000000000000000000000000000000000000000000000200000000508000000000000000000000000000000000000000000000000000000000002000000040000000000000000000000000000000000000000000000000000000000000))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x800000048020000000000000000000000000000000000000000000000000000000000000000010000000008020900400000000000000000000000000000000000000000000000000000000040000000008110480800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008404040200000000000000000000000000000000000000000000000000000000000000000000002800800400404000000000000000000000000000000000000000000000000000000000000000800800200209000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084c0200000000000000000000000000000000000000000000000000000000000000000000002000004009404000000000000000000000000000000000000000000000000000000000000000000004004a090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000024400440000000000400000000000000000000000000000000000000000000000000000000000000402280000000004000000000000000000000000000000000000000000000000000000000000008082800000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000200000400010000000000080080000000000000000000000000000000000000000000000000000000000800000000000008118000000000000000000000000000000000000000000000000000000000008001000000000010c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180800000000000000000000000000000000000000000000000000000000000000000000000800000c500000000000000000000000000000000000000000000000000000000000000000000800000624000000000000000000000000000000000000000000000000000000000000000008000001880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a020000000000000000000000000000000000000000000000000000000000000000000000040000a090000000000000000000000000000000000000000000000000000000000000000000020000282200000000000000000000000000000000000000000000000000000000000000000800000504000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000104000000000000000000000000000000080000001000000000000000000000000000000000100004000100000000000000000000000000000400000080000000000000000000000000000000010000100000000000000000000000000000020000001000000000000000000000000000000000400008000000000000000000000000000200000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x2000080000a00108050001000000014000004000000002000020000000020000001000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001080000000000000400222004800000000000000000000000000000000000000000000008000100002000000000000000020008a00880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000104000000000000000080022200120000000000000000000000000000000000000000000000100004000100000000000000010002280048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010000000000000200580400000000000000000000000000000000000000000000000000100000001020000002000802c0480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000000000000000010000008009044000900000000000000000000000000000000000000000000000000000000000000000200042401140000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000001020004490008000000000000000000000000000000000000000000000000000000000000004080004490024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000000000000000000010000400018440020000000000000000000000000000000000000000000000000000000000000001000018440110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000802000000000000000000000000000004400880000000008000000000000000000000000000000002002040000000000000000000000000040440000000020000000000000000000000000000002000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x3008000000000000000000000000000000000000000000000000000000000000000000000000000018500000000000000000000000000000000000000000000000000000000000000000000000000c24000000000000000000000000000000000000000000000000000000000000200000000001880000000000000000000000000000000000000000000000000000000000000000880000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000090040000000000000000000000000000000000000000000000000000000000000000000000000000012110000000000000000000000000000000000000000000000000000000000000000000000002411000000000000000000000000000000000000000000000000000000000000000200000000508000000000000000000000000000000000000000000000000000000000002000000040000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000018020000000000000000000000000000000000000000000000000000000000000000000000000001809000000000000000000000000000000000000000000000000000000000000000000000000060220000000000000000000000000000000000000000000000000000000000000400000000050400000000000000000000000000000000000000000000000000000000000000880000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000028080000000000000000000000000000000000000000000000000000000000000000000000000000028900000000000000000000000000000000000000000000000000000000000000000000000002848000000000000000000000000000000000000000000000000000000000000000400000005080000000000000000000000000000000000000000000000000000000000080000008000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000018010000000000000000000000000000000000000000000000000000000000000000000000000018048000000000000000000000000000000000000000000000000000000000000000000000000301080000000000000000000000000000000000000000000000000000000000002000000000282000000000000000000000000000000000000000000000000000000000000880000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000020000000040080000000080000000000000000000000000000000000000000000000000000000000000000000104000000040000000000000000000000000000000000000000000000000000000000000000008100000000400000000000000000000000000000000000000000000000000000000000000202000000010000000000000000000000000000000000000000000000000000000044000200000000000000000000000000000000000000802000000000000140252004a20000210002000004000008080000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000120094800942000002080002000000800000802000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x14400000000000000000000000000000000000000000000000000000000000000000000100010400400010000000000000000000000000000000000000000000000000000000000000000002001000010000000000000000000000000000000000000000000000000000000000000000000800040000800000000000000000000000000000000000000000000000000000020000000400010000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000804000000000000000000000000000000008000000008000000000000000000000000000000000400020000000000000000000000000000000400000004000000000000000000000000000001000020000000000000000000000000000000010000000040000000000000000000000000000040001000000000000000000000000000000200000001000000000000000000000000000004000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000490008000000000000000000000000000000000000000000000000000000000000000000000490024000000000000000000000000000000000000000000000000000000000200000000000024022000000000000000000000000000000000000000000000000000000020000000000000904000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009200800000000000000000000000000000000000000000000000000000000000000000000004901200000000000000000000000000000000000000000000000000000000010000000000002404200000000000000000000000000000000000000000000000000000008000000000000120800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100008001400000000000000000000000000000000000000000000000000000000000000000000000000000080840004000000000000000000000000000000000000000000000000000000000000000000020010000800000000000000000000000000000000000000000000000000000000000000000020008000800000000000000000000000000000000000000000000000000000000800000040200200000000000000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000010000002008001000000000000000000000000000000000000000000000000000000000000000000000080800200000000000000000000000000000000000000000000000000000000000000000000000820010000000000000000000000000000000000000000000000000002000000000000000040040800000000000000000000000000000000000000000000000000100800000000000000000000000000000000000000000000000000000000000000000000000000000000018004000000000000000000000000000000000000000000000000000000000000000000000000000003011000000000000000000000000000000000000000000000000000000000000000000000000601100000000000000000000000000000000000000000000000000000000000400000000000050800000000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000600800000000000000000000000000000000000000000000000000000000000000000000000000000609000000000000000000000000000000000000000000000000000000000000000000000000060480000000000000000000000000000000000000000000000000000000000080000000000050800000000000000000000000000000000000000000000000000000000000000001080000000000000000000000000000000000040000000000000000000000) + (NatTree.leaf 0xd004000000000000000000000000000000000000000000000000000000000000000000000000068048000000000000000000000000000000000000000000000000000000000000008000000000601020000000000000000000000000000000000000000000000000000000000100000000000501000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000004400880000000008000000000000000000000000000000000000000000000000000000000000000040440000000020000000000000000000000000000000000000000000000000000000000000001010800000000080000000000000000000000000000000000000000000000000000000000002810000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a8010000000000000000000000000000000000000000000000000000000000000000000000001a009000000000000000000000000000000000000000000000000000000000000040000000000060210000000000000000000000000000000000000000000000000000000001000000000000140800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004900020000000000000000000000000000000000000000000000000000000000000000000000150024000000000000000000000000000000000000000000000000000000000020000000000001402200000000000000000000000000000000000000000000000000000000800000000000002810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002440080000000000000000000000000000000000000000000000000000000000000000000000a804800000000000000000000000000000000000000000000000000000000008000000000000501080000000000000000000000000000000000000000000000000000000400000000000000a080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002480400000000000000000000000000000000000000000000000000000000000000000000004c050000000000000000000000000000000000000000000000000000000000020000000000004810400000000000000000000000000000000000000000000000000000002000000000000018200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001480000000000000000000000000000000000000000000000000000000000000001000008040100002000000000000000000000000000000000000000000000000000000000000000000100200008000000000000000000000000000000000000000000000000000000000000000000040020000200000000000000000000000000000000000000000000000000000010000000020000800100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009201000000000000000000000000000000000000000000000000000000000000000000000024809000000000000000000000000000000000000000000000000000000000004000000000000901080000000000000000000000000000000000000000000000000000000400000000000012080000000000000000000000000000000000000000000000000000000000000000000000000000000000))))) + (NatTree.node 40 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x1001301000000000000000000000000000000000000000000000000000000000000000100008004c09000000000000000000000000000000000000000000000000000000000004000040000000121080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080092008000000000000000000000000000000000000000000000000000000000000020000200092024000000000000000000000000000000000000000000000000000000000200008000000004422000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000801280800000000000000000000000000000000000000000000000000000000000000200000800941200000000000000000000000000000000000000000000000000000000010000040000000484200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000480240000000000000000000000000000000000000000000000000000000000000000000000000000009004400000000000000000000000000000000000000000000000000000000000000000000004809100000000000000000000000000000000000000000000000000000000080000000000002021100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001110040000000000000000000000000000000000000000000000000000000000000000000000000000011402000000000000000000000000000000000000000000000000000000000000000000000004502800000000000000000000000000000000000000000000000000000000001000000000004408400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000222004000000000000000000000000000000000000000000000000000000000000000000000000000008a0080000000000000000000000000000000000000000000000000000000000000000000000228090000000000000000000000000000000000000000000000000000000000004000000000110210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002220010000000000000000000000000000000000000000000000000000000000000000000000000000228004000000000000000000000000000000000000000000000000000000000000000000000045002400000000000000000000000000000000000000000000000000000000000800000000044022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088801000000000000000000000000000000000000000000000000000000000000000000000000000022802000000000000000000000000000000000000000000000000000000000000000000000002280900000000000000000000000000000000000000000000000000000000000100000000011021000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x200010001402008000000000000000000000000000000000000000000000000000000000000000000000000402104402000000000000000000000000000000000000000000000000000000000000000000100420880200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000808901000000000000000000000000000000000000000000000000000000000000000000000010000402902000000000000000000000000000000000000000000000000000000000000000002000080290900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200580400000000000000000000000000000000000000000000000000000000000000000002000802c04800000000000000000000000000000000000000000000000000000000000000800080000028102000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008002c010000000000000000000000000000000000000000000000000000000000000000010000800b009000000000000000000000000000000000000000000000000000000000000040004000000028210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000920020000000000000000000000000000000000000000000000000000000000000010000400052024000000000000000000000000000000000000000000000000000000000020000400000000482200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000100000000000022440080000000000000000000000000000000000000000000000000000000000000000000008a80480000000000000000000000000000000000000000000000000000000000800000000000450100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020004500800000000000000000000000000000000000000000000000000000000000002000008002a0480000000000000000000000000000000000000000000000000000000000800008000000014108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002004c0400000000000000000000000000000000000000000000000000000000000000080000800e050000000000000000000000000000000000000000000000000000000000020000080000000c1040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x400002000b300c000000000000000000000000000000000000000000000000000000000000000000000000400938580000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010040000000000000000a020000000000000000800092002000000000000000000000000000100000010080000000040000a09000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000100002024500440000000000400000000000000000000000000000000000000000000000000000000000200502280000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000480200000000000000000000000000000000000000000000000000000000000000000100000000080209004000000000000000000000000000000000000000000000000000000000400000000081104809000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008118040000000000000000000000000000000000000000000000000000000000000000000000010000401602000000000000000000000000000000000000000000000000000000000000000008000200582800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040400000000222004000000000000000000000000000000000000000000000000000000000000000080040000000008a0080000000000000000000000000000000000000000000000000000000008002000000000228080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001023004000000000000000000000000000000000000000000000000000000000000000000000001000100b008000000000000000000000000000000000000000000000000000000000000000004000402c0900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000202240100000000000000000000000000000000000000000000000000000000000000000000000400080288040000000000000000000000000000000000000000000000000000000000000000100020051024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x9004000000000000000000000000000000000000000000000000000000000000000000000000000001211000000000000000000000000000000000000000000000000000000000000000000000000241100000000000000000000000000000000000000000000000000000000000000020000000050800000000000000000000000000000000000000000000000000000000000200000004000000000000000000000000000000000000000000400000000000000000100000000000000000000000000000000000000000000280800000000000000000000000000000000000000000000000000000000000000000000000000000289000000000000000000000000000000000000000000000000000000000000000000000000028480000000000000000000000000000000000000000000000000000000000000004000000050800000000000000000000000000000000000000000000000000000000000800000080000000000000000000000000000000000000000080000000000000001002000080000a001080500010000800140000040000000020000200000000200000010000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000280010a00020002800002000000014000001000000020000020000000002000000080000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000050001050800000000a00000400000000500000400000004000001000000000010000000040000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020008a000000000000000000000000000000000000000000000000000000020000000400004000010102048449200800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005000000000080000000000000000400000000546008000000002000004000100000000000800800000000001000000000802000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080400000000000000001808000000000000008002c0100000000000000000000000000000010000000202000000000800000c5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0xa020000000000000000000000000000000000000000000000000000000000000000000000040000a09000000000000000000000000000000000000000000000000000000000000000000002000028220000000000000000000000000000000000000000000000000000000000000000080000050400000000000000000000000000000000000000000000000000000000004000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a01000000000000000000000000000000000000000000000000000000000000000000000200000a048000000000000000000000000000000000000000000000000000000000000000000100000141080000000000000000000000000000000000000000000000000000000000000004000000282000000000000000000000000000000000000000000000000000000002000080000000000000000000000000000000000000000000000000000000000000000000008050000000000000000000000000000000000000000000000000000000000000000000000000004000200001000000000000000000000000000000000000000000000000000000000000000010000200000800000000000000000000000000000000000000000000000000000000000000000400010000400000000000000000000000000000000000000000000000000000010000000040008000800000000000000000000000000000000000400000004004000000000000000000000000000000000000000000000000090200000000000000000000000000000000000000000000000000000000000000000000000000000202204000000000000000000000000000000000000000000000000000000000000000000000202002000000000000000000000000000000000000000000000000000000000000000000000009001000000000000000000000000000000000000000000000000000000000004000000042001000000000000000000000000000000000000004000000020000000000000000000000000000000000000000000000000000480200000000000000000000000000000000000000000000000000000000000000000000000000000009004000000000000000000000000000000000000000000000000000000000000000000000004809000000000000000000000000000000000000000000000000000000000080000000000002021000000000000000000000000000000000000000000000000000000000000000000000904000000000000000000000000000000000000000000010800000000000000000000000000000000000000000000000002100800000000000000000000000000000000000000000000000000000000000000000000000000000041208000000000000000000000000000000000000000000000000000000000000000000000020802000000000000000000000000000000000000000000000000000000000000000000000012002000000000000000000000000000000000000000000000000000000000001000000084008000000000000000000000000000000000000100000002000000000000000000000000000000000000000000000000000000820100000000000000000000000000000000000000000000000000000000000000000000000000000008884000000000000000000000000000000000000000000000000000000000000000000000002201000000000000000000000000000000000000000000000000000000000000000000000002800800000000000000000000000000000000000000000000000000000000000080000044020000000000000000000000000000000000000800000100000000000000000000000000000000500000000000000000000000000000000000000000000000000000000001000000200800100000000000000000000000000000000000000000000000000000000000000000000008080020000000000000000000000000000000000000000000000000000000000000000000000082001000000000000000000000000000000000000000000000000000200000000000000004004080000000000000000000000000000000000000000000000000010080000000000000000000000000000000000020000000)))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x20000000000000000000000000000000000000000000000000000000010000000000144900020000000000000000000000000000000000000000000000000000000000000000000001150024000000000000000000000000000000000000000000000000000000000020000000000011402000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000904400090000000000000000000000000000000000000000000000000000000000000000000004240114000000000000000000000000000000000000000000000000000000000100000000000041010a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000081000001022004000000000000000000000000000000000000000000000000000000000000000080000414024000000000000000000000000000000000000000000000000000000000040000000800020808000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000100000000000022440080000000000000000000000000000000000000000000000000000000000000000000008a80480000000000000000000000000000000000000000000000000000000000800000000000450108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008020000000001000100000000000000000000000000000000000000000000000000000000000000020020400000000040210000000000000000000000000000000000000000000000000000000020000200000000010042000000000000000000000000000000000000000000000000000000000800100000000008100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000118004000000000000000000000000000000000000000000000000000000000000000000000000000013011000000000000000000000000000000000000000000000000000000000000000000000002601100000000000000000000000000000000000000000000000000000000000400000000002050800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000104000000000000000000000000000000080000001000000000000000000000000000000000100004000100000000000000000000000000000400000080000000000000000000000000000000010000100000000000000000000000000000020000001000000000000000000000000000000000400008000000000000000000000000000200000020000000000000000000000000000000100008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180800000000000000000000000000000000000000000000000000000000000000000000000800000c5000000000000000000000000000000000000000000000000000000000000000000008000006240000000000000000000000000000000000000000000000000000000000000000080000018800000000000000000000000000000000000000000000000000000000000200000800000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x40400000000222004000000000000000000000000000000000000000000000000000000000000000080040000000008a008000000000000000000000000000000000000000000000000000000000800200000000022809000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000001000080014000000000000000000000000000000000000010000000200400000100000000000000000000000808400040000000000000000000000000000000000040000000200000000000000000000000200100008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400222004800000000000000000000000000000000000000000000000000000000000000000000000020008a0088000000000000000000000000000000000000000000000000000000000000000000800228091000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008002220012000000000000000000000000000000000000000000000000000000000000000000000001000228004800000000000000000000000000000000000000000000000000000000000000000400045002480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800088801400000000000000000000000000000000000000000000000000000000000000000000000400022802800000000000000000000000000000000000000000000000000000000000000000080002280940000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000020000000028d004000000000000000000000000000000000000000000000000000000000000000000000000168048000000000000000000000000000000000000000000000000000000000000008000000001601000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000010000804500880000000008000000000000000000000000000000000000000000000000000000000000000050440000000020000000000000000000000000000000000000000000000000000000000000001410000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000200000000028a8010000000000000000000000000000000000000000000000000000000000000000000000009a00900000000000000000000000000000000000000000000000000000000000004000000000026020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0xa000080000a001080504010100000040100040100000020000200000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000280010a00020802800002000000014000001000000020000020000000002000000080000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000050001050800002000a000004000000005000004000000040000010000000000100000000400000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080020911804800000000000000000000000000000000000000000000000000000000000000000000011000241160220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080010400000000546008000000000000000000000000000000000000000000000000000000000000000808400000001116090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000100002024500440000000000400000000000000000000000000000000000000000000000000000000000200542280000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000408204000000000000000000000000000000000000000000000000000000000800000100020a0008080010040000000000000000000000000000000000000000000000000000000000010080020080010020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000200080000000000000000000000000000244004400000000004000000000000000000000000000000004020800000000000000000000000004022800000000040000000000000000000000000000002000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x49000800000000000000000000000000000000000000000000000000000000000000000000049002400000000000000000000000000000000000000000000000000000000020000000000002402200000000000000000000000000000000000000000000000000000002000000000000090400000000000000000000000000000000000000000000042000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000920080000000000000000000000000000000000000000000000000000000000000000000000490120000000000000000000000000000000000000000000000000000000001000000000000240420000000000000000000000000000000000000000000000000000000800000000000012080000000000000000000000000000000000000000000210000000000000000000000000000000000000000000000000048020000000000000000000000000000000000000000000000000000000000000000000000000000000900400000000000000000000000000000000000000000000000000000000000000000000000480900000000000000000000000000000000000000000000000000000000008000000000000202100000000000000000000000000000000000000000000000000000000000000000000090400000000000000000000000000000000000002000001080000000000000000000000000000000000000000000000802800000000000000000000000000000000000000000000000000000000000000000000000000002002040002000000000000000000000000000000000000000000000000000000000000000002000020000800000000000000000000000000000000000000000000000000000000000000000080010000800000000000000000000000000000000000000000000000000000040000000020010002000000000000000000000000000000000040000000200400000000000000000000000000000000000000000000000002000a0000000000000000000000000000000000000000000000000000000000000000000000000000004020800100000000000000000000000000000000000000000000000000000000000000000002000200040000000000000000000000000000000000000000000000000000000000000000001000200020000000000000000000000000000000000000000000000000000000100000000400800800000000000000000000000000000000010000000202000000000000000000000000000000000000000000000000000000000000000000000000180800000000000000000000000000000000000000000000000000000000000000000000000800000c500000000000000000000000000000000000000000000000000000000000000000000800000624000000000000000000000000000000000000000000000000000000000000000008000001880000000000000000000000000000000000000000000000000000000000020000080000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000a020000000000000000000000000000000000000000000000000000000000000000000000040000a09000000000000000000000000000000000000000000000000000000000000000000002000028220000000000000000000000000000000000000000000000000000000000000000080000050400000000000000000000000000000000000000000000000000000000004000080000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000a01000000000000000000000000000000000000000000000000000000000000000000000200000a048000000000000000000000000000000000000000000000000000000000000000000100000141080000000000000000000000000000000000000000000000000000000000000004000000282000000000000000000000000000000000000000000000000000000002000080000000000000000000000000000000000000004000000000000) + (NatTree.leaf 0x10000000000000000000000000000000000000000000000004400880000000008000000000000000000000000000000000000000000000000000000000000000040440000000020000000000000000000000000000000000000000000000000000000000000001010800000000080000000000000000000000000000000000000000000000000000000000002810000000004000000000000000000000000000000000000000000000000000040000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a8010000000000000000000000000000000000000000000000000000000000000000000000001a009000000000000000000000000000000000000000000000000000000000000040000000000060210000000000000000000000000000000000000000000000000000000001000000000000140800000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004900020000000000000000000000000000000000000000000000000000000000000000000000150024000000000000000000000000000000000000000000000000000000000020000000000001402200000000000000000000000000000000000000000000000000000000800000000000002810000000000000000000000000000000000000000000000000000210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002440080000000000000000000000000000000000000000000000000000000000000000000000a804800000000000000000000000000000000000000000000000000000000008000000000000501080000000000000000000000000000000000000000000000000000000400000000000000a080000000000000000000000000000000000000000000000000041000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002480400000000000000000000000000000000000000000000000000000000000000000000004c05000000000000000000000000000000000000000000000000000000000002000000000000481040000000000000000000000000000000000000000000000000000000200000000000001820000000000000000000000000000000000000000000000000210000000000000000000000000000000000000000000000000148000000000000000000000000000000000000000000000000000000000000000100000804010000200000000000000000000000000000000000000000000000000000000000000000010020000800000000000000000000000000000000000000000000000000000000000000000004002000020000000000000000000000000000000000000000000000000000001000000002000080010000000000000000000000000000000000000008000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000920100000000000000000000000000000000000000000000000000000000000000000000002480900000000000000000000000000000000000000000000000000000000000400000000000090108000000000000000000000000000000000000000000000000000000040000000000001208000000000000000000000000000000000000000000000010400000000000000000000000000000000000000000000000144000000000000000000000000000000000000000000000000000000000000000000001000104004000100000000000000000000000000000000000000000000000000000000000000000020010000100000000000000000000000000000000000000000000000000000000000000000008000400008000000000000000000000000000000000000000000000000000000200000004000100008000000000000000000000000000000000000400000000000080000000000000000000000000000000))))))) + (NatTree.node 152 (NatTree.node 72 (NatTree.node 32 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x8020000000001000100000000000000000000000000000000000000000000000000000000000000020020400000000040210000000000000000000000000000000000000000000000000000000020000200000000010042000000000000000000000000000000000000000000000000000000000800100000000008102000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000033008000000000000000000000000000000000000000000000000000000000000000000000000000038500000000000000000000000000000000000000000000000000000000000000000000000001c2400000000000000000000000000000000000000000000000000000000000020000000001180000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000003180200000000000000000000000000000000000000000000000000000000000000000000000000038090000000000000000000000000000000000000000000000000000000000000000000000000e0220000000000000000000000000000000000000000000000000000000000000400000001050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000051801000000000000000000000000000000000000000000000000000000000000000000000000003804800000000000000000000000000000000000000000000000000000000000000000000000070108000000000000000000000000000000000000000000000000000000000000200000000828000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008204000000000000000000000000000000000000000000000000000000000000000000000a0000080010040000000000000000000000000000000000000000000000000000000000000080000080010020000000000000000000000000000000000000000000000000000000000000042000004000010000000000000000000000000000000000000000000000000000000000021000004000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000104010000000000000000000000000000000000000000000000000000000000000000000000000000004421000000000000000000000000000000000000000000000000000000000000000000000001104200000000000000000000000000000000000000000000000000000000000000000000000a1020000000000000000000000000000000000000000000000000000000000001000011408000000000000000000000000000000000000000000000000000000000000000000000000000000000804000000000000000000000000000000008000000008000000000000000000000000000000000400020000000000000000000000000000000400000004000000000000000000000000000001000020000000000000000000000000000000010000000040000000000000000000000000000040001000000000000000000000000000000200000001000000000000000000000000000004000800000000000000000000004000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d0040000000000000000000000000000000000000000000000000000000000000000000000000680480000000000000000000000000000000000000000000000000000000000000080000000006010200000000000000000000000000000000000000000000000000000000001000000000005010000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x40000000054600800000000000000000000000000000000000000000000000000000000000000000000000000111609000000000000000000000000000000000000000000000000000000000000000000000011160400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000020000000028d004000000000000000000000000000000000000000000000000000000000000000000000000168048000000000000000000000000000000000000000000000000000000000000008000000001601020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000010000804500880000000008000000000000000000000000000000000000000000000000000000000000000050440000000020000000000000000000000000000000000000000000000000000000000000001410800000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000200000000028a8010000000000000000000000000000000000000000000000000000000000000000000000009a00900000000000000000000000000000000000000000000000000000000000004000000000026021000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000001000000000014490002000000000000000000000000000000000000000000000000000000000000000000000115002400000000000000000000000000000000000000000000000000000000002000000000001140220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000081000001022004000000000000000000000000000000000000000000000000000000000000000080000414024000000000000000000000000000000000000000000000000000000000040000000800020808400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010a000000000000000000000000000000000000000000000000000000000000000000000800010000308002000000000000000000000000000000000000000000000000000000000000000020000c200420000000000000000000000000000000000000000000000000000000000000000020000308080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008804000000000000000000000000000000000000000000000000000000000000000000000000100400020080200000000000000000000000000000000000000000000000000000000000000401000020081100000000000000000000000000000000000000000000000000000000000000210040001001080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x40000020002004000000851a01000000000000000000000000000000000000000000000000000000000000000004000200103a0480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001808000000000000008002c0100000000000000000000000000000000000000000000000000800000c5000000010000800b0090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a020000000000000000800092002000000000000000000000000000000000000000000000040000a09000000001000040005202400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000010000000000a022450080000000000000000000000000000000000000000000000000000000000000200002808aa048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200140000000000000000000000000000000000000000000000000000000040000080000040800012480400000000000000000000000000000000000000000000000000000000002000000400024c05000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000000000020001000140200800000000000000000000000000000000000400000020200000800000000000000000000040210440200000000000000000000000000000000000040000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020008000000000118004000000000000000000000000000000000000000000000000000000000000000402080000000013011000000000000000000000000000000000000000000000000000000000200020000000002601000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101190040000000000000000000000000000000000000000000000000000000000000000000000000040132110000000000000000000000000000000000000000000000000000000000000000000010026411000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x14400000000000000000000000000000000000000000000000000000000000000000000100010400400010000000000000000000000000000000000000000000000000000000000000000002001000010000000000000000000000000000000000000000000000000000000000000000000800040000800000000000000000000000000000000000000000000000000000020000000400010000800000000000000000000000000000000000040000000000008000000000000000000000000000080000000000000000000000000000000000000000000000000000000a020000000000000000000000000000000000000000000000000000000000000000000000040000a0900000000000000000000000000000000000000000000000000000000000000000000200002822000000000000000000000000000000000000000000000000000000000000000008000005040000000000000000000000000000000000000000000000000000000000400008000000000000000000000000000000000000000200000000000004000000000000000000000000000000000000000000000000180800000000000000000000000000000000000000000000000000000000000000000000000800000c500000000000000000000000000000000000000000000000000000000000000000000800000624000000000000000000000000000000000000000000000000000000000000000008000001880000000000000000000000000000000000000000000000000000000000020000080000000000000000000000000000000000000000400000000000000100008000280010a00020802800002000100014000001000000020000020000000002000000080000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900002800000000008020000000000000000000000100008045008800000000080400000820000080000000000000000020020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000480200000000000000000000040000000518010000000000000810000010220040000000000000000009004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000080010004000000043380800000000000000000000000000000000000000000000000000000000000000002000000800103c500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000080004001000000231a020000000000000000000000000000000000000000000000000000000000000000010000040083a0900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x88000000000000000000000000000000000000000000000000000000020000000400004000010100000400000000000000000000000000000000000000000000000000000000000008000080400000400000000000000000000000000000000000000000000000000000000000001000010010000020000000000000000000000000000000000000000000000000000000800800010008000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001040000000000000000000000000000000800000010000000000000000000000000000000001000040001000000000000000000000000000004000000800000000000000000000000000000000100001000000000000000000000000000000200000010000000000000000000000000000000004000080000000000000000000000000002000000200000000000000000000000000000001000080000000000000000000008000020000000000000000000000000000000000000000000000000000000000000000000000080400000000000000000000000000000000800000000800000000000000000000000000000000040002000000000000000000000000000000040000000400000000000000000000000000000100002000000000000000000000000000000001000000004000000000000000000000000000004000100000000000000000000000000000020000000100000000000000000000000000000400080000000000000000000000400002000000000000000000040000000000000000000000000000000000000000000000000000000100008001400000000000000000000000000000000000000000000000000000000000000000000000000000080840004000000000000000000000000000000000000000000000000000000000000000000020010000800000000000000000000000000000000000000000000000000000000000000000020008000800000000000000000000000000000000000000000000000000000000800000040200200000000000000000000000000000000008000001008000000000000000000000000000000000000000000000000000000000000000000000000000000000000d0040000000000000000000000000000000000000000000000000000000000000000000000000680480000000000000000000000000000000000000000000000000000000000000080000000006010200000000000000000000000000000000000000000000000000000000001000000000005010000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000a8010000000000000000000000000000000000000000000000000000000000000000000000001a009000000000000000000000000000000000000000000000000000000000000040000000000060210000000000000000000000000000000000000000000000000000000001000000000000140800000000000000000000000000000000000000000000000000000084000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000004900020000000000000000000000000000000000000000000000000000000000000000000000150024000000000000000000000000000000000000000000000000000000000020000000000001402200000000000000000000000000000000000000000000000000000000800000000000002810000000000000000000000000000000000000000000000000000210000000000000000000000000000000080000000000000000000000014800000000000000000000000000000000000000000000000000000000000000010000080401000020000000000000000000000000000000000000000000000000000000000000000001002000080000000000000000000000000000000000000000000000000000000000000000000400200002000000000000000000000000000000000000000000000000000000100000000200008001000000000000000000000000000000000000000800000000000200000000000000000000000000000004000) + (NatTree.leaf 0x400000000b3008000000000000000000000000000000000000000000000000000000000000000000000000000938500000000000000000000000000000000000000000000000000000000000000000000000049c240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000008020000000000000000000000000000044008800000000080000000000000000000000000000000020020400000000000000000000000000404400000000200000000000000000000000000000020000200000000000000000000000000010108000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000000010000800140000000000000000000000000000000000000100000002004000001000000000000000000000008084000400000000000000000000000000000000000400000002000000000000000000000002001000080000000000000000000000000000000000010000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010a000000000000000000000000000000000000000000000000000000000000000000000800010000308002000000000000000000000000000000000000000000000000000000000000000020000c2004200000000000000000000000000000000000000000000000000000000000000000200003080810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000001110040000000000000000000000000000000000000000000000000000000000000000008000000000011402000000000000000000000000000000000000000000000000000000000008000000000004502800000000000000000000000000000000000000000000000000000000001400000000004408000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000033008000000000000000000000000000000000000000000000000000000000000000000000000000038500000000000000000000000000000000000000000000000000000000000000000000000001c2400000000000000000000000000000000000000000000000000000000000020000000001188000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000003180200000000000000000000000000000000000000000000000000000000000000000000000000038090000000000000000000000000000000000000000000000000000000000000000000000000e02200000000000000000000000000000000000000000000000000000000000004000000010504000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000518010000000000000000000000000000000000000000000000000000000000000000000000000038048000000000000000000000000000000000000000000000000000000000000000000000000701080000000000000000000000000000000000000000000000000000000000002000000008282000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x2000000000000000000000000000000000000000000000000020000000a28d80400000000000000000000000000000000000000000000000000000000000000000002001816c0480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000200000002828ac010000000000000000000000000000000000000000000000000000000000000000010002809b00900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000011800400000000000002440044000000000040000000000000000000000000000000000000000000001301100000000000040228000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000010000000028144920020000000000000000000000000000000000000000000000000000000000000010001401152024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000088801000000000000000000000100000000000022440080000000000000000000000000000000000022802000000000000000000000000000008a8048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088a040000000000000000000000000000000000000000000000000000000000004000000000101004200200802000000000000000000000000000000000000000000000000000000000000804010800200811000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020008000000000118004000000000000000000000000000000000000000000000000000000000000000402080000000013011000000000000000000000000000000000000000000000000000000000200020000000002601100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000054600800000000000000000000000000000000000000000000000000000000000000000000000000111609000000000000000000000000000000000000000000000000000000000000000000000011160480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x10000000000000000000000000000000000000000000000004400880000000008000000000000000000000000000000000000000000000000000000000000000040440000000020000000000000000000000000000000000000000000000000000000000000001010800000000080000000000000000000000000000000000000000000000000000000000002810000000004000000000000000000000000000000000000000000000000000040000080000000000000000000000000000000000100004000000000000000000000000000000000000000000000000000000000180800000000000000000000000000000000000000000000000000000000000000000000000800000c50000000000000000000000000000000000000000000000000000000000000000000080000062400000000000000000000000000000000000000000000000000000000000000000800000188000000000000000000000000000000000000000000000000000000000002000008000000000000000000000000000000000000000040000000000000110009480251000942004000100800404000000800000201000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000048000280010a00020802804002020000004004001008000020000020000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000050000000000002000800000000000000000000010000202450044000000000040200000041000080000000000000000040200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000840504031100400000000000000000000000000000000000000000000000000000000000000000280080042040514020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000408204100008001400000000000000000000000000000000000000000000000800000100020a0008080010040000008084000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000111004000000400000000330080000000000000000000000000000000000000000000000800000000001140200000000000000385000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x8012808000000000000000000000000000000000000000000000000000000000000002000008009412000000000000000000000000000000000000000000000000000000000100000400000004842000000000000000000000000000000000000000000000000000000000000800000001208000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001110040000000000000000000000000000000000000000000000000000000000000000000000000000011402000000000000000000000000000000000000000000000000000000000000000000000004502800000000000000000000000000000000000000000000000000000000001000000000004408400000000000000000000000000000000000000000000000000000002000000000000a10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000222004000000000000000000000000000000000000000000000000000000000000000000000000000008a0080000000000000000000000000000000000000000000000000000000000000000000000228090000000000000000000000000000000000000000000000000000000000004000000000110210000000000000000000000000000000000000000000000000000000010000000000284000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002220010000000000000000000000000000000000000000000000000000000000000000000000000000228004000000000000000000000000000000000000000000000000000000000000000000000045002400000000000000000000000000000000000000000000000000000000000800000000044022000000000000000000000000000000000000000000000000000000002000000000a100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011800400000000000000000000000000000000000000000000000000000000000000000000000000001301100000000000000000000000000000000000000000000000000000000000000000000000260110000000000000000000000000000000000000000000000000000000000040000000000205080000000000000000000000000000000000000000000000000000000000000000048400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008880100000000000000000000000000000000000000000000000000000000000000000000000000002280200000000000000000000000000000000000000000000000000000000000000000000000228090000000000000000000000000000000000000000000000000000000000010000000001102100000000000000000000000000000000000000000000000000000000400000000a1000000000000000000000000000000000000000000000000000000000000000000000000010400000000000000000000000000000008000000100000000000000000000000000000000010000400010000000000000000000000000000040000008000000000000000000000000000000001000010000000000000000000000000000002000000100000000000000000000000000000000040000800000000000000000000000000020000002000000000000000000000000000000010000800000000000000000000080000200000000000000000000008000000000000000000000000000000000000000000000000804000000000000000000000000000000008000000008000000000000000000000000000000000400020000000000000000000000000000000400000004000000000000000000000000000001000020000000000000000000000000000000010000000040000000000000000000000000000040001000000000000000000000000000000200000001000000000000000000000000000004000800000000000000000000004000020000000000000000000400000000000000000000200000000000))))) + (NatTree.node 40 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x8002c010000000000000000000000000000000000000000000000000000000000000000010000800b0090000000000000000000000000000000000000000000000000000000000000400040000000282100000000000000000000000000000000000000000000000000000000000002000000001408000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000244004400000000004000000000000000000000000000000000000000000000000000000000000004022800000000040000000000000000000000000000000000000000000000000000000000000080828000000000400000000000000000000000000000000000000000000000000000000000140a000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000920020000000000000000000000000000000000000000000000000000000000000010000400052024000000000000000000000000000000000000000000000000000000000020000400000000482200000000000000000000000000000000000000000000000000000000000040000000002810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000200000400010000000000080080000000000000000000000000000000000000000000000000000000000800000000000008118000000000000000000000000000000000000000000000000000000000008001000000000010c00000000000000000000000000000000000000000004000000000000200100000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020004500800000000000000000000000000000000000000000000000000000000000002000008002a04800000000000000000000000000000000000000000000000000000000008000080000000141080000000000000000000000000000000000000000000000000000000000010000000000a0800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002004c0400000000000000000000000000000000000000000000000000000000000000080000800e050000000000000000000000000000000000000000000000000000000000020000080000000c104000000000000000000000000000000000000000000000000000000000000100000000182000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001001301000000000000000000000000000000000000000000000000000000000000000100008004c0900000000000000000000000000000000000000000000000000000000000400004000000012108000000000000000000000000000000000000000000000000000000000000800000001208000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008009200800000000000000000000000000000000000000000000000000000000000002000020009202400000000000000000000000000000000000000000000000000000000020000800000000442200000000000000000000000000000000000000000000000000000000000400000000090400000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0xa900000000000000000000000000000000000000000000000000000000001000810020050220050000000000000000000000000000000000000000000000000000000000000000804004140260000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004802000000000222001000000000000000000000000000000000000000000000000000000000000000090040000000022800400000000000000000000000000000000000000000000000000000000048090000000004500200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000001000080450088000000000800000000000000000000000000000000000000000000000000000000000000005444000000002000000000000000000000000000000000000000000000000000000000000000151080000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000040800012480400000000000000000000000000000000000000000000000000000000000000000400024c05000000000000000000000000000000000000000000000000000000000002000000020002481000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000000000000208000892010000000000000000000000000000000000000000000000000000000000000000010002248090000000000000000000000000000000000000000000000000000000000040000001000089010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000011100400000000000000000000000000000000000000000000000000000000000000000080000000000114020000000000000000000000000000000000000000000000000000000000080000000000045028000000000000000000000000000000000000000000000000000000000014000000000044084000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111004800000000000000000000000000000000000000000000000000000000000000000000000000001140220000000000000000000000000000000000000000000000000000000000000000000000450288000000000000000000000000000000000000000000000000000000000100000000000440844000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200580400000000000000000000000000000000000000000000000000000000000000000002000802c0480000000000000000000000000000000000000000000000000000000000000080008000002810200000000000000000000000000000000000000000000000000000000000000400000005010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x12000050001050800102000a0080040400000010020040400000400000100000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000050001050800002000a00000400011800500000400000004000001000000000010000000040000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000800441223004800000000000000000000000000000000000000000000000000000000000000000000009021108b008800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000001000882222401200000000000000000000000000000000000000000000000000000000000000000000024108822880480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000200082088890140000000000000000000000000000000000000000000000000000000000000000000011040442290280000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002220040400000000b3008000000000000000000000000000000000000000000000000000000000000008a0080000000093850000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000002220010000000000000000000010000000000144900020000000000000000000000000000000000000228004000000000000000000000000001150024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000000000040000201224024400000000100100000000000000000000000000000000000000000000000000000000200120254000000010020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x4802400000000000000000000000000000000000000000000000000000000000000000000000000000090044000000000000000000000000000000000000000000000000000000000000000000000048091000000000000000000000000000000000000000000000000000000000800000000000020211000000000000000000000000000000000000000000000000000000000004000000009041000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000033008000000000000000000000000000000000000000000000000000000000000000000000000000038500000000000000000000000000000000000000000000000000000000000000000000000001c2400000000000000000000000000000000000000000000000000000000000020000000001188000000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000003180200000000000000000000000000000000000000000000000000000000000000000000000000038090000000000000000000000000000000000000000000000000000000000000000000000000e022000000000000000000000000000000000000000000000000000000000000040000000105040000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000005180100000000000000000000000000000000000000000000000000000000000000000000000000380480000000000000000000000000000000000000000000000000000000000000000000000007010800000000000000000000000000000000000000000000000000000000000020000000082820000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000000008800000000000000000000000000000000000000000000000000000002000000040000400001010000040000000000000000000000000000000000000000000000000000000000000800008040000040000000000000000000000000000000000000000000000000000000000000100001001000002000000000000000000000000000000000000000000000000000000080080001000800002000000000000000000000000000000000000000000000400010000000000000000000000000000000000000000000000000008204000000000000000000000000000000000000000000000000000000000000000000000a0000080010040000000000000000000000000000000000000000000000000000000000000080000080010020000000000000000000000000000000000000000000000000000000000000042000004000010000000000000000000000000000000000000000000000000000000000021000004000020000000000000000000000000000000000000000800200008000000000000000000000000000000000000000000000000000000000000104010000000000000000000000000000000000000000000000000000000000000000000000000000004421000000000000000000000000000000000000000000000000000000000000000000000001104200000000000000000000000000000000000000000000000000000000000000000000000a1020000000000000000000000000000000000000000000000000000000000001000011408000000000000000000000000000000000000400020400000000000000000000000000000000000104000000000000000000000000000000080000001000000000000000000000000000000000100004000100000000000000000000000000000400000080000000000000000000000000000000010000100000000000000000000000000000020000001000000000000000000000000000000000400008000000000000000000000000000200000020000000000000000000000000000000100008000000000000000000000800002000000000000000000000080000000000000000010000000000000) + (NatTree.leaf 0x4800000000000000000000000000000000000000000000000000000100000080090440009000000000000000000000000000000000000000000000000000000000000000002000424011400000000000000000000000000000000000000000000000000000000010000000010004101020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000040800012480400000000000000000000000000000000000000000000000000000000000000000400024c05000000000000000000000000000000000000000000000000000000000002000000020002481040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000000000000208000892010000000000000000000000000000000000000000000000000000000000000000010002248090000000000000000000000000000000000000000000000000000000000040000001000089010800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000000000000000000010000400018440020000000000000000000000000000000000000000000000000000000000000001000018440110000000000000000000000000000000000000000000000000000000001000000040000c1010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000080200000000000000000000000000000440088000000000800000000000000000000000000000000200204000000000000000000000000004044000000002000000000000000000000000000000200002000000000000000000000000000101080000000008000000000000000000000000000008001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008404040200000000000000000000000000000000000000000000000000000000000000000000002800800400404000000000000000000000000000000000000000000000000000000000000000800800200209000000000000000000000000000000000000000000000000000000000000000240200100021000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084c0200000000000000000000000000000000000000000000000000000000000000000000002000004009404000000000000000000000000000000000000000000000000000000000000000000004004a0900000000000000000000000000000000000000000000000000000000008000020000000242100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000100000000000022440080000000000000000000000000000000000000000000000000000000000000000000008a804800000000000000000000000000000000000000000000000000000000008000000000004501080000000000000000000000000000000000000000000000000000000400000000000200a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x900000000000000000000000000000000000000000000000400002012240244000000001001000000000000000000000000000000000000000000000000000000002001282540000000100200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001440000000000000000000000000000000000000000000000000000100000161000a2000000000080400000000000000000000000000000000000000000000000000000000064004a80000000102400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002004a000000000000000000000000000000000000000000000000000001000000800810001010228040000000000000000000000000000000000000000000000000000000000020000800404150240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000080010000000000000000000000000000012200244000000001001000000000000000000000000000000808400000000000000000000000001002540000000100200000000000000000000000000000200100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000048020000000002220010000000000000000000000000000000000000000000000000000000000000000900400000000228004000000000000000000000000000000000000000000000000000000000480900000000045002400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000080022200120000000000000000000000000000000020000004000000000000000000000000000000010002280048000000000000000000000000000000001000000000000000000000000000000004000450024800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000008000888014000000000000000000000000000000000010000040000000000000000000000000000004000228028000000000000000000000000000000000080000000000000000000000000000000800022809400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000122002440000000010010000000000000000000000000000000000000000000000000000000000010025400000001002000000000000000000000000000000000000000000000000000000000000100a150000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x880000000000000000000000000000000000000000000000000000000200000004000040000101000004000000000000000000000000000000000000000000000000000000000000080000804000004000000000000000000000000000000000000000000000000000000000000010000100100000200000000000000000000000000000000000000000000000000000008008000100080000200000000000000000000000000000000000000000000040001000000000000000000000000000010000140252004a20008a1000200000401000808000000200000810000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012009480094200040a0800020000008020008020000004000080400000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200040a204000000000000000000000000000000000000000000000000000000000800000100020a00080810148492808000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900000a000000000000000800100000000000000000000004000020122402440000000010010100000420004000000000000000008080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802000000000000000400002000b300c00000000000000000000000000000000000000000000000020020400000000000000000040093858000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040400000000222004000000100000003180200000000000000000000000000000000000000000000080040000000008a00800000000000038090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000104010000000010000804500880000000008000000000000000000000000000000000000000000000004421000000000000054440000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x1001301000000000000000000000000000000000000000000000000000000000000000100008004c090000000000000000000000000000000000000000000000000000000000040000400000001210800000000000000000000000000000000000000000000000000000000000080000000120800000000000000000000000000000000000000001000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800920080000000000000000000000000000000000000000000000000000000000000200002000920240000000000000000000000000000000000000000000000000000000002000080000000044220000000000000000000000000000000000000000000000000000000000040000000009040000000000000000000000000000000000000010000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008012808000000000000000000000000000000000000000000000000000000000000002000008009412000000000000000000000000000000000000000000000000000000000100000400000004842000000000000000000000000000000000000000000000000000000000000800000001208000000000000000000000000000000000000040000001000000000000000000000000000000000000000000000000000001110040000000000000000000000000000000000000000000000000000000000000000000000000000011402000000000000000000000000000000000000000000000000000000000000000000000004502800000000000000000000000000000000000000000000000000000000001000000000004408400000000000000000000000000000000000000000000000000000002000000000000a10000000000000000000000000000000000000000000440000000000000000000000000000000000000000000000000000000222004000000000000000000000000000000000000000000000000000000000000000000000000000008a0080000000000000000000000000000000000000000000000000000000000000000000000228090000000000000000000000000000000000000000000000000000000000004000000000110210000000000000000000000000000000000000000000000000000000010000000000284000000000000000000000000000000000000000004100000000000000000000000000000000000000000000000000000000002220010000000000000000000000000000000000000000000000000000000000000000000000000000228004000000000000000000000000000000000000000000000000000000000000000000000045002400000000000000000000000000000000000000000000000000000000000800000000044022000000000000000000000000000000000000000000000000000000002000000000a100000000000000000000000000000000000000001080000000000000000000000000000000000000000000000000000000011800400000000000000000000000000000000000000000000000000000000000000000000000000001301100000000000000000000000000000000000000000000000000000000000000000000000260110000000000000000000000000000000000000000000000000000000000040000000000205080000000000000000000000000000000000000000000000000000000000000000048400000000000000000000000000000000000000008200000000000000000000000000000000000000000000000000000000000008880100000000000000000000000000000000000000000000000000000000000000000000000000002280200000000000000000000000000000000000000000000000000000000000000000000000228090000000000000000000000000000000000000000000000000000000000010000000001102100000000000000000000000000000000000000000000000000000000400000000a100000000000000000000000000000000000000008400000000000000000) + (NatTree.node 8 (NatTree.leaf 0x40000000033008000000000000000000000000000000000000000000000000000000000000000000000000000038500000000000000000000000000000000000000000000000000000000000000000000000001c2400000000000000000000000000000000000000000000000000000000000020000000001188000000000000000000000000000000000000000000000000000000000000000188000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000003180200000000000000000000000000000000000000000000000000000000000000000000000000038090000000000000000000000000000000000000000000000000000000000000000000000000e02200000000000000000000000000000000000000000000000000000000000004000000010504000000000000000000000000000000000000000000000000000000000000018800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000518010000000000000000000000000000000000000000000000000000000000000000000000000038048000000000000000000000000000000000000000000000000000000000000000000000000701080000000000000000000000000000000000000000000000000000000000002000000008282000000000000000000000000000000000000000000000000000000000001880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200580400000000000000000000000000000000000000000000000000000000000000000002000802c04800000000000000000000000000000000000000000000000000000000000000800080000028102000000000000000000000000000000000000000000000000000000000000004000000050100000000000000000000000000000000000000000000000000000200004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008002c010000000000000000000000000000000000000000000000000000000000000000010000800b0090000000000000000000000000000000000000000000000000000000000000400040000000282100000000000000000000000000000000000000000000000000000000000002000000001408000000000000000000000000000000000000000000000000020000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080009200200000000000000000000000000000000000000000000000000000000000000100004000520240000000000000000000000000000000000000000000000000000000000200004000000004822000000000000000000000000000000000000000000000000000000000000400000000028100000000000000000000000000000000000000000000001000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020004500800000000000000000000000000000000000000000000000000000000000002000008002a04800000000000000000000000000000000000000000000000000000000008000080000000141080000000000000000000000000000000000000000000000000000000000010000000000a0800000000000000000000000000000000000000000002000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002004c0400000000000000000000000000000000000000000000000000000000000000080000800e050000000000000000000000000000000000000000000000000000000000020000080000000c1040000000000000000000000000000000000000000000000000000000000001000000001820000000000000000000000000000000000000000000800000010000000000000000000000000000000000000) + (NatTree.leaf 0x808901000000000000000000000000000000000000000000000000000000000000000000000010000402902000000000000000000000000000000000000000000000000000000000000000002000080290900000000000000000000000000000000000000000000000000000000000100008000001421000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000020000000028d004000000000000000000000000000000000000000000000000000000000000000000000000168048000000000000000000000000000000000000000000000000000000000000008000000001601020000000000000000000000000000000000000000000000000000000000100000000040500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000010000804500880000000008000000000000000000000000000000000000000000000000000000000000000050440000000020000000000000000000000000000000000000000000000000000000000000001410800000000080000000000000000000000000000000000000000000000000000000000042800000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000200000000028a8010000000000000000000000000000000000000000000000000000000000000000000000009a009000000000000000000000000000000000000000000000000000000000000040000000000260210000000000000000000000000000000000000000000000000000000001000000000010140000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000010000000000144900020000000000000000000000000000000000000000000000000000000000000000000001150024000000000000000000000000000000000000000000000000000000000020000000000011402200000000000000000000000000000000000000000000000000000000800000000000802800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000904400090000000000000000000000000000000000000000000000000000000000000000000004240114000000000000000000000000000000000000000000000000000000000100000000000041010a0000000000000000000000000000000000000000000000000000000000000000000201205000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000100000000000022440080000000000000000000000000000000000000000000000000000000000000000000008a804800000000000000000000000000000000000000000000000000000000008000000000004501080000000000000000000000000000000000000000000000000000000400000000000200a080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802000000000100010000000000000000000000000000000000000000000000000000000000000002002040000000004021000000000000000000000000000000000000000000000000000000002000020000000001004200000000000000000000000000000000000000000000000000000000080010000000000810200000000000000000000000000000000000000000000000000000020010000000014000000000000000000000000000000000000000000000000000000000000000000)))))) + (NatTree.node 72 (NatTree.node 32 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x800000000000000000000000008000888014000000000000000000000000000000000010000040000000000000000000000000000004000228028000000000000000000000000000000000080000000000000000000000000000000800022809400000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000001020004490008000000000000000000000000000000000000000000000000000000000000004080004490024000000000000000000000000000000000000000000000000000000000200000102000224020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000000000000000000010000400018440020000000000000000000000000000000000000000000000000000000000000001000018440110000000000000000000000000000000000000000000000000000000001000000040000c101080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008118040000000000000000000000000000000000000000000000000000000000000000000000010000401602000000000000000000000000000000000000000000000000000000000000000008000200582800000000000000000000000000000000000000000000000000000000001000008000000508400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001023004000000000000000000000000000000000000000000000000000000000000000000000001000100b008000000000000000000000000000000000000000000000000000000000000000004000402c09000000000000000000000000000000000000000000000000000000000000400010000001421000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000001000080014000000000000000000000000000000000000010000000200400000100000000000000000000000808400040000000000000000000000000000000000040000000200000000000000000000000200100008000000000000000000000000000000000001000000020000000000000000000000200080008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020224010000000000000000000000000000000000000000000000000000000000000000000000040008028804000000000000000000000000000000000000000000000000000000000000000010002005102400000000000000000000000000000000000000000000000000000000000800040000005022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000100014020080000000000000000000000000000000000000000000000000000000000000000000000004021044020000000000000000000000000000000000000000000000000000000000000000001004208802000000000000000000000000000000000000000000000000000000000000000000810208810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x20888901000000000000000000000000000000000000000000000000000000000000000000000010004422902000000000000000000000000000000000000000000000000000000000000000002000882290900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000043380800000000000000000000000000000000000000000000000000000000000000000000000800103c500000000000000000000000000000000000000000000000000000000000000000000800101e24000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000231a020000000000000000000000000000000000000000000000000000000000000000000000040083a090000000000000000000000000000000000000000000000000000000000000000000020040e8220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000851a01000000000000000000000000000000000000000000000000000000000000000000000200103a048000000000000000000000000000000000000000000000000000000000000000000100040741080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000010000202450044000000000040000000000000000000000000000000000000000000000000000000000020050228000000000400000000000000000000000000000000000000000000000000000000000800a08080000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000020008000000000000000000000000000024400440000000000400000000000000000000000000000000402080000000000000000000000000402280000000004000000000000000000000000000000200020000000000000000000000000008082800000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000001000000800904400090000000000000000000000000000000000000000000000000000000000000000020004240114000000000000000000000000000000000000000000000000000000000100000000100041010a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000080022200120000000000000000000000000000000020000004000000000000000000000000000000010002280048000000000000000000000000000000001000000000000000000000000000000004000450024800000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x80092008000000000000000000000000000000000000000000000000000000000000020000200092024000000000000000000000000000000000000000000000000000000000200008000000004422000000000000000000000000000000000000000000000000000000000004000000000904000000000000000000000000000000000000001000000020000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000801280800000000000000000000000000000000000000000000000000000000000000200000800941200000000000000000000000000000000000000000000000000000000010000040000000484200000000000000000000000000000000000000000000000000000000000080000000120800000000000000000000000000000000000004000000100000000000000000000000020000000000000000008000000480200000040000000054600800000000000000000000000000000000000000000000100000000080209004000000000000111609000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400011804546808000000000000000000000000000000000000000000000000000000000000000000000001303116890000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a204000000000000000000000000000000000000000000000000000000000000000000000a00000810100492008000000000000000000000000000000000000000000000000000000000800000810100249012000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000209118040000000000000000000000000000000000000000000000000000000000000000000000010002411602000000000000000000000000000000000000000000000000000000000000000008001204582800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041223004000000000000000000000000000000000000000000000000000000000000000000000001001108b008000000000000000000000000000000000000000000000000000000000000000004004422c0900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008222240100000000000000000000000000000000000000000000000000000000000000000000000400882288040000000000000000000000000000000000000000000000000000000000000000100220451024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x100000003180200000000000000000000000000000000000000000000000000000000000000000000000000038090000000000000000000000000000000000000000000000000000000000000000000000000e02200000000000000000000000000000000000000000000000000000000000004000000010504000000000000000000000000000000000000000000000000000000000000018800000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000040000000518010000000000000000000000000000000000000000000000000000000000000000000000000038048000000000000000000000000000000000000000000000000000000000000000000000000701080000000000000000000000000000000000000000000000000000000000002000000008282000000000000000000000000000000000000000000000000000000000001880000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000200580400000000000000000000000000000000000000000000000000000000000000000002000802c04800000000000000000000000000000000000000000000000000000000000000800080000028102000000000000000000000000000000000000000000000000000000000000004000000050100000000000000000000000000000000000000000000000000000200004000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000008002c010000000000000000000000000000000000000000000000000000000000000000010000800b0090000000000000000000000000000000000000000000000000000000000000400040000000282100000000000000000000000000000000000000000000000000000000000002000000001408000000000000000000000000000000000000000000000000020000040000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000080009200200000000000000000000000000000000000000000000000000000000000000100004000520240000000000000000000000000000000000000000000000000000000000200004000000004822000000000000000000000000000000000000000000000000000000000000400000000028100000000000000000000000000000000000000000000001000000100000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000020004500800000000000000000000000000000000000000000000000000000000000002000008002a04800000000000000000000000000000000000000000000000000000000008000080000000141080000000000000000000000000000000000000000000000000000000000010000000000a0800000000000000000000000000000000000000000002000000010000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002004c0400000000000000000000000000000000000000000000000000000000000000080000800e050000000000000000000000000000000000000000000000000000000000020000080000000c104000000000000000000000000000000000000000000000000000000000000100000000182000000000000000000000000000000000000000000080000001000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001001301000000000000000000000000000000000000000000000000000000000000000100008004c09000000000000000000000000000000000000000000000000000000000004000040000000121080000000000000000000000000000000000000000000000000000000000008000000012080000000000000000000000000000000000000000100000004000000000000000000000000000008000))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x400000000000000000000000000000000000000000000000000244004400000000004000000000000000000000000000000000000000000000000000000000000004022800000000040000000000000000000000000000000000000000000000000000000000000080828000000000400000000000000000000000000000000000000000000000000000000000140a0000000002000000000000000000000000000000000000000000000000040800004000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000200000400010000000000080080000000000000000000000000000000000000000000000000000000000800000000000008118000000000000000000000000000000000000000000000000000000000008001000000000010c00000000000000000000000000000000000000000004000000000000200100000000000060000000000000000000000000000000000000000000008000000006000000000000000000000000000000000000000000000000000000000000000000001110040000000000000000000000000000000000000000000000000000000000000000000000000000011402000000000000000000000000000000000000000000000000000000000000000000000004502800000000000000000000000000000000000000000000000000000000001000000000004408400000000000000000000000000000000000000000000000000000002000000000000a10000000000000000000000000000000000000100000440000000000000000000000000000000000000000000000000000000222004000000000000000000000000000000000000000000000000000000000000000000000000000008a0080000000000000000000000000000000000000000000000000000000000000000000000228090000000000000000000000000000000000000000000000000000000000004000000000110210000000000000000000000000000000000000000000000000000000010000000000284000000000000000000000000000000000000080004100000000000000000000000000000000000000000000000000000000002220010000000000000000000000000000000000000000000000000000000000000000000000000000228004000000000000000000000000000000000000000000000000000000000000000000000045002400000000000000000000000000000000000000000000000000000000000800000000044022000000000000000000000000000000000000000000000000000000002000000000a100000000000000000000000000000000000020001080000000000000000000000000000000000000000000000000000000011800400000000000000000000000000000000000000000000000000000000000000000000000000001301100000000000000000000000000000000000000000000000000000000000000000000000260110000000000000000000000000000000000000000000000000000000000040000000000205080000000000000000000000000000000000000000000000000000000000000000048400000000000000000000000000000000000100008200000000000000000000000000000000000000000000000000000000000008880100000000000000000000000000000000000000000000000000000000000000000000000000002280200000000000000000000000000000000000000000000000000000000000000000000000228090000000000000000000000000000000000000000000000000000000000010000000001102100000000000000000000000000000000000000000000000000000000400000000a1000000000000000000000000000000000000800084000000000000000000000000000000000000000000000000000000040000000033008000000000000000000000000000000000000000000000000000000000000000000000000000038500000000000000000000000000000000000000000000000000000000000000000000000001c240000000000000000000000000000000000000000000000000000000000002000000000118800000000000000000000000000000000000000000000000000000000000000018800000000000000000000000000000000000000008000000000000000) + (NatTree.leaf 0x80000000000000000000000000000000000000000000000000000200000000028a8010000000000000000000000000000000000000000000000000000000000000000000000009a00900000000000000000000000000000000000000000000000000000000000004000000000026021000000000000000000000000000000000000000000000000000000000100000000001014080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000001000000000014490002000000000000000000000000000000000000000000000000000000000000000000000115002400000000000000000000000000000000000000000000000000000000002000000000001140220000000000000000000000000000000000000000000000000000000080000000000080281000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000081000001022004000000000000000000000000000000000000000000000000000000000000000080000414024000000000000000000000000000000000000000000000000000000000040000000800020808400000000000000000000000000000000000000000000000001000000000000004001005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008804000000000000000000000000000000000000000000000000000000000000000000000000100400020080200000000000000000000000000000000000000000000000000000000000000401000020081100000000000000000000000000000000000000000000000000000000000000210040001001080000000000000000000000000000000000000000000000000000000000108004000800100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008020000000001000100000000000000000000000000000000000000000000000000000000000000020020400000000040210000000000000000000000000000000000000000000000000000000020000200000000010042000000000000000000000000000000000000000000000000000000000800100000000008102000000000000000000000000000000000000000000000000000000200100000000140800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000033008000000000000000000000000000000000000000000000000000000000000000000000000000038500000000000000000000000000000000000000000000000000000000000000000000000001c2400000000000000000000000000000000000000000000000000000000000020000000001188000000000000000000000000000000000000000000000000000000000002000188000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000003180200000000000000000000000000000000000000000000000000000000000000000000000000038090000000000000000000000000000000000000000000000000000000000000000000000000e02200000000000000000000000000000000000000000000000000000000000004000000010504000000000000000000000000000000000000000000000000000000000040018800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000518010000000000000000000000000000000000000000000000000000000000000000000000000038048000000000000000000000000000000000000000000000000000000000000000000000000701080000000000000000000000000000000000000000000000000000000000002000000008282000000000000000000000000000000000000000000000000000000002001880000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x111004000000000088801000000000000000000000000000000000000000000000000000000000000001140200000000022802000000000000000000000000000000000000000000000000000000000450280000000002280800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000010000202450044000000000040000000000000000000000000000000000000000000000000000000000020050228000000000400000000000000000000000000000000000000000000000000000000000800a08280000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000010200044900080000000000000000000000000000000000000000000000000000000000000040800044900240000000000000000000000000000000000000000000000000000000002000001020002240220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000408204000000000000000000000000000000000000000000000000000000000800000100020a00080800100400000000000000000000000000000000000000000000000000000000000100800200800100200000000000000000000000000000000000000000000000000000000000020420010040000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000004802000000000000000000000000000000000000000000000000000000000000000001000000000802090040000000000000000000000000000000000000000000000000000000004000000000811048090000000000000000000000000000000000000000000000000000000002900000000010820200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040400000000222004000000000000000000000000000000000000000000000000000000000000000080040000000008a008000000000000000000000000000000000000000000000000000000000800200000000022809000000000000000000000000000000000000000000000000000000000200500000000011020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000020000000028d004000000000000000000000000000000000000000000000000000000000000000000000000168048000000000000000000000000000000000000000000000000000000000000008000000001601020000000000000000000000000000000000000000000000000000000000100000000040501000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000010000804500880000000008000000000000000000000000000000000000000000000000000000000000000050440000000020000000000000000000000000000000000000000000000000000000000000001410800000000080000000000000000000000000000000000000000000000000000000000042810000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x500000000000000000000000000000000000000000000000000200000400010000000000080080000000000000000000000000000000000000000000000000000000000800000000000008118000000000000000000000000000000000000000000000000000000000008001000000000010c00000000000000000000000000000000000000000004000000000000200100000000000060000000000000000000000000000000000000000000008000000006000000000000000000000000000000000001000000002000000001400000000000001110040000000000000000000020000000028d004000000000000004080001248040000000000000000114020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000480000000080020911804800000000000000000000000000000000000000400000004001000004000000000000011000241160220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000014000000000000000022200400000000000000000000200000000028a801000000000000002080008920100000000000000008a0080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000a000000000000000000022200100000000000000000000100000000001449000200000000000102000449000800000000000002280040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004802000000000222001000000400000005180100000000000000000000000000000000000000000000090040000000022800400000000000380480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000080200000000010001000000001000080450088000000000800000000000000000000000000000000200204000000000402100000000000005044000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010800000000000000000000000400002000b300c0000000000000000000000000000000080001000020000000000000000000000000000004009385800000000000000000000000000000002000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x80022200120000000000000000000000000000000000000000000000000000000000000000000000010002280048000000000000000000000000000000000000000000000000000000000000000004000450024800000000000000000000000000000000000000000000000000000000008000002000440224000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000888014000000000000000000000000000000000000000000000000000000000000000000000004000228028000000000000000000000000000000000000000000000000000000000000000000800022809400000000000000000000000000000000000000000000000000000000001000000800110214000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000810000010220040000000000000000000000000000000000000000000000000000000000000000800004140240000000000000000000000000000000000000000000000000000000000400000008000208084000000000000000000000000000000000000000000000000010000000000000040010050400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000001110040000000000000000000000000000000000000000000000000000000000000000008000000000011402000000000000000000000000000000000000000000000000000000000008000000000004502800000000000000000000000000000000000000000000000000000000001400000000004408400000000000000000000000000000000000000000000000000000002400000000000a000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000100000000000022440080000000000000000000000000000000000000000000000000000000000000000000008a804800000000000000000000000000000000000000000000000000000000008000000000004501080000000000000000000000000000000000000000000000000000000400000000000200a08000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000000000000000000000040000000033008000000000000000000000000000000000000000000000000000000000000000000000000000038500000000000000000000000000000000000000000000000000000000000000000000000001c2400000000000000000000000000000000000000000000000000000000000020000000001188000000000000000000000000000000000000000000000000000000000000000188000000000000000000000000000000000002000080000000000000000000000000000000000000000000000000000000000100000003180200000000000000000000000000000000000000000000000000000000000000000000000000038090000000000000000000000000000000000000000000000000000000000000000000000000e02200000000000000000000000000000000000000000000000000000000000004000000010504000000000000000000000000000000000000000000000000000000000000018800000000000000000000000000000000000100040000000000000000000000000000000000000000000000000000000000000040000000518010000000000000000000000000000000000000000000000000000000000000000000000000038048000000000000000000000000000000000000000000000000000000000000000000000000701080000000000000000000000000000000000000000000000000000000000002000000008282000000000000000000000000000000000000000000000000000000000001880000000000000000000000000000000000020008000000000000))))) + (NatTree.node 40 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x140000000000000000000000000000100000003180200000000000000000000000000000002080008920100000000000000000000000000000000038090000000000000000000000000000100022480800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000000000000902000000000000000000000010000804500880000000008000000000000000000000000000000002022040000000000000000000000000054440000000020000000000000000000000000000002020020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000000000020001000140200800000000000000000000000000000000000400000020200000800000000000000000000040210440200000000000000000000000000000000000040000002000000000000000000000010042088020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011100400000000008880100000000000000000000000000000000000000000000000000000000000000114020000000002280200000000000000000000000000000000000000000000000000000000045028000000000228090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000480200000000000000000000000000000000000000000000000000000000000000000100000000080209004000000000000000000000000000000000000000000000000000000000400000000081104809000000000000000000000000000000000000000000000000000000000290000000001082021000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000002000800000000000000000000000000002440044000000000040000000000000000000000000000000040208000000000000000000000000040228000000000400000000000000000000000000000020002000000000000000000000000000808280000000004000000000000000000000000000010002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040400000000222004000000000000000000000000000000000000000000000000000000000000000080040000000008a0080000000000000000000000000000000000000000000000000000000008002000000000228090000000000000000000000000000000000000000000000000000000002005000000000110210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400222004800000000000000000000000000000000000000000000000000000000000000000000000020008a008800000000000000000000000000000000000000000000000000000000000000000080022809100000000000000000000000000000000000000000000000000000000000400000080011021100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x500000000000000000000000000000000000000000000000000200000400010000000000080080000000000000000000000000000000000000000000000000000000000800000000000008118000000000000000000000000000000000000000000000000000000000008001000000000010c0000000000000000000000000000000000000000000400000000000020010000000000006000000000000000000000000000000000000000000000800000000600000000000000000000000000000002000100000000a000480000a0010805040101008001401000401000000202002010000002000000100000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084c020000000822224010000000000000000000000000000000000000000000000000000000200000400940400040088228804000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000010000020020020000000a28d80400000000000000000000000000000000000000000000000000000000000000200002001816c0480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000080001000800200000002828ac010000000000000000000000000000000000000000000000000000000000008000010002809b00900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000004000040008001000000002814492002000000000000000000000000000000000000000000000000000000008000001000140115202400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004800000000000000000000000000118004000000000000000000000100000080090440009000000000000000000000000000000000000013011000000000000000000000002000424011400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000400000000330080000000000000000000000000000040800012480400000000000000000000000000000000000385000000000000000000000000000400024c04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x80000001110040000000000000000000000000000000000000000000000000000000000000000008000000000011402000000000000000000000000000000000000000000000000000000000008000000000004502800000000000000000000000000000000000000000000000000000000001400000000004408400000000000000000000000000000000000000000000000000000002400000000000a1000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000020000000028d004000000000000000000000000000000000000000000000000000000000000000000000000168048000000000000000000000000000000000000000000000000000000000000008000000001601020000000000000000000000000000000000000000000000000000000000100000000040501000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000010000804500880000000008000000000000000000000000000000000000000000000000000000000000000050440000000020000000000000000000000000000000000000000000000000000000000000001410800000000080000000000000000000000000000000000000000000000000000000000042810000000004000000000000000000000000000000000000000000000000000040000080000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000200000000028a8010000000000000000000000000000000000000000000000000000000000000000000000009a009000000000000000000000000000000000000000000000000000000000000040000000000260210000000000000000000000000000000000000000000000000000000001000000000010140800000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000010000000000144900020000000000000000000000000000000000000000000000000000000000000000000001150024000000000000000000000000000000000000000000000000000000000020000000000011402200000000000000000000000000000000000000000000000000000000800000000000802810000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000904400090000000000000000000000000000000000000000000000000000000000000000000004240114000000000000000000000000000000000000000000000000000000000100000000000041010a0000000000000000000000000000000000000000000000000000000000000000000201205000000000000000000000000000000000000000000000000000900100000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000100000000000022440080000000000000000000000000000000000000000000000000000000000000000000008a804800000000000000000000000000000000000000000000000000000000008000000000004501080000000000000000000000000000000000000000000000000000000400000000000200a080000000000000000000000000000000000000000000000000241000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000244004400000000004000000000000000000000000000000000000000000000000000000000000004022800000000040000000000000000000000000000000000000000000000000000000000000080828000000000400000000000000000000000000000000000000000000000000000000000140a00000000020000000000000000000000000000000000000000000000000408000040000000000000000000000000000000002000100000000) + (NatTree.node 8 (NatTree.leaf 0x24000000000000000000000000000000000000000000010000202450044000000000040000000000000000000000000000000000000000000000000000000000020054228000000000400000000000000000000000000000000000000000000000000000000000800a882800000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200140000000000000000000000000000000000000000000000000000000040000080000040800012480400000000000000000000000000000000000000000000000000000000002000000400024c05000000000000000000000000000000000000000000000000000000000002020000020002481000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000800000000011800400000000000000000000000000000000000000000000000000000000000000040208000000001301100000000000000000000000000000000000000000000000000000000020002000000000260110000000000000000000000000000000000000000000000000000000010042000000000205000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010119004000000000000000000000000000000000000000000000000000000000000000000000000004013211000000000000000000000000000000000000000000000000000000000000000000001002641100000000000000000000000000000000000000000000000000000000000400020000002450800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000054600800000000000000000000000000000000000000000000000000000000000000000000000000111609000000000000000000000000000000000000000000000000000000000000000000000011160480000000000000000000000000000000000000000000000000000000000080000000108850000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000008020000000000000000000000000000044008800000000080000000000000000000000000000000020020400000000000000000000000000404400000000200000000000000000000000000000020000200000000000000000000000000010108000000000800000000000000000000000000000800100000000000000000000000000028100000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000000010000800140000000000000000000000000000000000000100000002004000001000000000000000000000008084000400000000000000000000000000000000000400000002000000000000000000000002001000080000000000000000000000000000000000010000000200000000000000000000002000800080000000000000000000000008000000010000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010a000000000000000000000000000000000000000000000000000000000000000000000800010000308002000000000000000000000000000000000000000000000000000000000000000020000c2004200000000000000000000000000000000000000000000000000000000000000000200003080810000000000000000000000000000000000000000000000000100000000000008001809000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x14000000000000000000000000000010000000318020000000000000000000000000000000208000892010000000000000000000000000000000003809000000000000000000000000000010002248090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000400000005180100000000000000000000000000000001020004490008000000000000000000000000000000380480000000000000000000000000004080004490020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000880500048020000000000000000000000000000000000000000000000000000000000000000010040002008030900400000000000000000000000000000000000000000000000000000000040100002008118480900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000480240000000000000000000000000000000000100000000001449000200000000000000000000000009004400000000000000000000000000000000000000011500240000000000000000000000004809100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000480000000000002000a0000000000000000000000000000000000001000000800904400090000000000000000000000004020800100000000000000000000000000000000020004240114000000000000000000000002000200040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000011800400000000000000000000000000000009044000900000000000000000000000000000000000001301100000000000000000000000000042401140000000000000000000000000000000000000260110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800104000000005460080000000000000000000000000000000000000000000000000000000000000008084000000011160900000000000000000000000000000000000000000000000000000000002001000000001116040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400002000b300c000000000000000000000000000000000000000000000000000000000000000000000000400938580000000000000000000000000000000000000000000000000000000000000000000040049c260000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x40000000033008000000000000000000000000000000000000000000000000000000000000000000000000000038500000000000000000000000000000000000000000000000000000000000000000000000001c24000000000000000000000000000000000000000000000000000000000000200000000011880000000000000000000000000000000000000000000000000000000000020001880000000000000000000000000000000000020000c0000000000000000000000000000000000000000000000000000000000100000003180200000000000000000000000000000000000000000000000000000000000000000000000000038090000000000000000000000000000000000000000000000000000000000000000000000000e0220000000000000000000000000000000000000000000000000000000000000400000001050400000000000000000000000000000000000000000000000000000000004001880000000000000000000000000000000000010006000000000000000000000000000000000000000000000000000000000000004000000051801000000000000000000000000000000000000000000000000000000000000000000000000003804800000000000000000000000000000000000000000000000000000000000000000000000070108000000000000000000000000000000000000000000000000000000000000200000000828200000000000000000000000000000000000000000000000000000000200188000000000000000000000000000000000002000c00000000000000000000000000000000000001000008001000400000284b380800000000000000000000000000000000000000000000000000000000000000002000000802993c500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000880004001040080231a030000000000000000000000000000000000000000000000000000000000000000010000244083a0980000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000000000080010000000000000000000000400002012240244000000001001000000000000000000000000000000808400000000000000000000002001202540000000100200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000004000000005460080000000000000000000000000081000001022004000000000000000000000000000000000011160900000000000000000000000080000414020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000400000000330080000000000000000000000000000040800012480400000000000000000000000000000000000385000000000000000000000000000400024c05000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x80890100000000000000000000000000000000000000000000000000000000000000000000001000040290200000000000000000000000000000000000000000000000000000000000000000200008029090000000000000000000000000000000000000000000000000000000000010000800000142100000000000000000000000000000000000000000000000000000000000100000a100000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000020000000028d004000000000000000000000000000000000000000000000000000000000000000000000000168048000000000000000000000000000000000000000000000000000000000000008000000001601020000000000000000000000000000000000000000000000000000000000100000000040501000000000000000000000000000000000000000000000000000000001440000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000010000804500880000000008000000000000000000000000000000000000000000000000000000000000000050440000000020000000000000000000000000000000000000000000000000000000000000001410800000000080000000000000000000000000000000000000000000000000000000000042810000000004000000000000000000000000000000000000000000000000000044000080000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000200000000028a8010000000000000000000000000000000000000000000000000000000000000000000000009a009000000000000000000000000000000000000000000000000000000000000040000000000260210000000000000000000000000000000000000000000000000000000001000000000010140800000000000000000000000000000000000000000000000000000484000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000010000000000144900020000000000000000000000000000000000000000000000000000000000000000000001150024000000000000000000000000000000000000000000000000000000000020000000000011402200000000000000000000000000000000000000000000000000000000800000000000802810000000000000000000000000000000000000000000000000002210000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000100000000000022440080000000000000000000000000000000000000000000000000000000000000000000008a804800000000000000000000000000000000000000000000000000000000008000000000004501080000000000000000000000000000000000000000000000000000000400000000000200a08000000000000000000000000000000000000000000020000024100000000000000000000000000000000000000000000000000000000000000048024000000000000000000000000000000000000000000000000000000000000000000000000000000900440000000000000000000000000000000000000000000000000000000000000000000000480910000000000000000000000000000000000000000000000000000000008000000000000202110000000000000000000000000000000000000000000000000000000000040000000090410000000000000000000000000000000000002000001088800000000000000000000000000000000000000000000802000000000100010000000000000000000000000000000000000000000000000000000000000002002040000000004021000000000000000000000000000000000000000000000000000000002000020000000001004200000000000000000000000000000000000000000000000000000000080010000000000810200000000000000000000000000000000000000000000000000000020010000000014080000000000000000000000000040000000200000200000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x9000000000000000000000000000000000000000001000080450088000000000800000000000000000000000000000000000000000000000000000000000000005444000000002000000000000000000000000000000000000000000000000000000000000000151080000000008000000000000000000000000000000000000000000000000000000000005281000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010a000000000000000000000000000000000000000000000000000000000000000000000800010000308002000000000000000000000000000000000000000000000000000000000000000020000c200420000000000000000000000000000000000000000000000000000000000000000020000308081000000000000000000000000000000000000000000000000010000000000000800180901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008404040200000000000000000000000000000000000000000000000000000000000000000000002800800400404000000000000000000000000000000000000000000000000000000000000000800800200209000000000000000000000000000000000000000000000000000000000000000240200100021000000000000000000000000000000000000000000000000000000000000440008200004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084c0200000000000000000000000000000000000000000000000000000000000000000000002000004009404000000000000000000000000000000000000000000000000000000000000000000004004a09000000000000000000000000000000000000000000000000000000000080000200000002421000000000000000000000000000000000000000000000000000000000000400000020904000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008118040000000000000000000000000000000000000000000000000000000000000000000000010000401602000000000000000000000000000000000000000000000000000000000000000008000200582800000000000000000000000000000000000000000000000000000000001000008000000508400000000000000000000000000000000000000000000000000000000000020000000a1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001110048000000000000000000000000000000000000000000000000000000000000000000000000000011402200000000000000000000000000000000000000000000000000000000000000000000004502880000000000000000000000000000000000000000000000000000000001000000000004408440000000000000000000000000000000000000000000000000000002000020000000a10400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001023004000000000000000000000000000000000000000000000000000000000000000000000001000100b008000000000000000000000000000000000000000000000000000000000000000004000402c090000000000000000000000000000000000000000000000000000000000004000100000014210000000000000000000000000000000000000000000000000000000000000400000284000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020224010000000000000000000000000000000000000000000000000000000000000000000000040008028804000000000000000000000000000000000000000000000000000000000000000010002005102400000000000000000000000000000000000000000000000000000000000800040000005022000000000000000000000000000000000000000000000000000000000000800000a100000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x418604040200000000000000000000000000000000000000000000000000000000000100000800086800900400404000000000000000000000000000000000000000000000000000000000000210800900200209000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080010400000000546008000000000000000000000000000000000000000000000000000000000000000808400000001116090000000000000000000000000000000000000000000000000000000000200100000000111604800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000020002004000000851a01000000000000000000000000000000000000000000000000000000000000000004000200103a04800000000000000000000000000000000000000000000000000000000000000400000004074108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200140000000000000000000000000000000000000000000000000000000040000080000040800012480400000000000000000000000000000000000000000000000000000000002000000400024c0500000000000000000000000000000000000000000000000000000000000202000002000248104000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000002000100014020080000000000000000000000000000000000040000002020000080000000000000000000004021044020000000000000000000000000000000000004000000200000000000000000000001004208802000000000000000000000000000000000000800000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000800000000011800400000000000000000000000000000000000000000000000000000000000000040208000000001301100000000000000000000000000000000000000000000000000000000020002000000000260110000000000000000000000000000000000000000000000000000000010042000000000205080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000005460080000000000000000000000000000000000000000000000000000000000000000000000000011160900000000000000000000000000000000000000000000000000000000000000000000001116048000000000000000000000000000000000000000000000000000000000008000000010885080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000b3008000000000000000000000000000000000000000000000000000000000000000000000000000938500000000000000000000000000000000000000000000000000000000000000000000000049c240000000000000000000000000000000000000000000000000000000000002000000010918800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x8000000000000000000000000000000000000000000000000000000000000100000000000022440080000000000000000000000000000000000000000000000000000000000000000000008a804800000000000000000000000000000000000000000000000000000000008000000000004501080000000000000000000000000000000000000000000000000000000400000000000200a080000000000000000000000000000000000000000000200000241000000000000000000000000000000000080000000048001280010a00020802804002020100014004001008000020080020100000002000000080000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000480001050000000000000000000011800400000000000000000000010000008009044000900000001000040001844002000000000000001301000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000004000000005460080000000000000000000000000081000001022004000000000000000000000000000000000011160900000000000000000000000080000414024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800940000000000000000000000000000000000000000000000000000000001000000020040800a124c0400000000000000000000000000000000000000000000000000000000000004080402824e0500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010009400000000000000000000000000000000000000000000000000000000000000040000002020809089301000000000000000000000000000000000000000000000000000000000000004101048224c090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000004000000051801000000000000000000000000000000010200044900080000000000000000000000000000003804800000000000000000000000000040800044900240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088a04000000000000000000002000000004008000000008000000000000000000400000000010100420020080200000000000000000000000010400000004000000000000000000000000080401080020081100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))))))))) + (NatTree.node 608 (NatTree.node 304 (NatTree.node 152 (NatTree.node 72 (NatTree.node 32 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0xa00000000000000000000000000000000000000000000000000000000000000081000001022004000000000000000000000000000000000000000000000000000000000000000080000414024000000000000000000000000000000000000000000000000000000000040000000800020808400000000000000000000000000000000000000000000000001000000000000004001005040000000000000000000000000000000000000000000000020120000000000000000000000000000000000000000000000000000000008804000000000000000000000000000000000000000000000000000000000000000000000000100400020080200000000000000000000000000000000000000000000000000000000000000401000020081100000000000000000000000000000000000000000000000000000000000000210040001001080000000000000000000000000000000000000000000000000000000000108004000800100000000000000000000000000000000000040004000400040000000000000000000000000000000000000000000000080000001110040000000000000000000000000000000000000000000000000000000000000000008000000000011402000000000000000000000000000000000000000000000000000000000008000000000004502800000000000000000000000000000000000000000000000000000000001400000000004408400000000000000000000000000000000000000000000000000000002400000000000a100000000000000000000000000000000000200000004000000000000000000000000000000000000000000000802000000000100010000000000000000000000000000000000000000000000000000000000000002002040000000004021000000000000000000000000000000000000000000000000000000002000020000000001004200000000000000000000000000000000000000000000000000000000080010000000000810200000000000000000000000000000000000000000000000000000020010000000014080000000000000000000000000040000000200000204000000000000000000000002000000000000000000000000000000000000000000000000020000000028d004000000000000000000000000000000000000000000000000000000000000000000000000168048000000000000000000000000000000000000000000000000000000000000008000000001601020000000000000000000000000000000000000000000000000000000000100000000040501000000000000000000000000000000000000000000000000000000001440000000000000000000000000000000000000010000000000000090000000000000000000000000000000000000000010000804500880000000008000000000000000000000000000000000000000000000000000000000000000050440000000020000000000000000000000000000000000000000000000000000000000000001410800000000080000000000000000000000000000000000000000000000000000000000042810000000004000000000000000000000000000000000000000000000000000044000080000000000000000000000000000000000000004000000000000080000000000000000000000000000000000000000000000000000200000000028a8010000000000000000000000000000000000000000000000000000000000000000000000009a0090000000000000000000000000000000000000000000000000000000000000400000000002602100000000000000000000000000000000000000000000000000000000010000000000101408000000000000000000000000000000000000000000000000000004840000000000000000000000000000000000000200000000000000200000000000000000000000000000000000000000000000000000000100000000001449000200000000000000000000000000000000000000000000000000000000000000000000011500240000000000000000000000000000000000000000000000000000000000200000000000114022000000000000000000000000000000000000000000000000000000008000000000008028100000000000000000000000000000000000000000000000000022100000000000000000000000000000000000080000000) + (NatTree.leaf 0x88a0400000000000000000000000000000000000000000000000000000000000040000000001010042002008020000000000000000000000000000000000000000000000000000000000008040108002008110000000000000000000000000000000000000000000000000000000000001021004800100108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000040800012480400000000000000000000000000000000000000000000000000000000000000000400024c050000000000000000000000000000000000000000000000000000000000020000000200024810400000000000000000000000000000000000000000000000000800002000000001002018000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000000002080008920100000000000000000000000000000000000000000000000000000000000000000100022480900000000000000000000000000000000000000000000000000000000000400000010000890108000000000000000000000000000000000000000000000000040000040000000200401200000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000802000000000000000000000000000004400880000000008000000000000000000000000000000002002040000000000000000000000000040440000000020000000000000000000000000000002000020000000000000000000000000001010800000000080000000000000000000000000000080010000000000000000000000000002810000000004000000000000000000000000000020010000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000020000000028d004000000000000000000000000000000000000000000000000000000000000000000000000168048000000000000000000000000000000000000000000000000000000000000008000000001601020000000000000000000000000000000000000000000000000000000000100000000040501000000000000000000000000000000000000000000000000000002001440000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000010000804500880000000008000000000000000000000000000000000000000000000000000000000000000050440000000020000000000000000000000000000000000000000000000000000000000000001410800000000080000000000000000000000000000000000000000000000000000000000042810000000004000000000000000000000000000000000000000000000000200044000080000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000200000000028a8010000000000000000000000000000000000000000000000000000000000000000000000009a0090000000000000000000000000000000000000000000000000000000000000400000000002602100000000000000000000000000000000000000000000000000000000010000000000101408000000000000000000000000000000000000000000000000020004840000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000100000000001449000200000000000000000000000000000000000000000000000000000000000000000000011500240000000000000000000000000000000000000000000000000000000000200000000000114022000000000000000000000000000000000000000000000000000000008000000000008028100000000000000000000000000000000000000000000001000022100000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x90000000010a000000000000000000000000000000100008045008800000000080000000000000000800010000308002000000000000000000000000000000000504400000000200000000000000000020000c20040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000021008000000000000000000000100002024500440000000000400000000000000000000000000000000412080000000000000000000000200542280000000004000000000000000000000000000000208020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000111004800000000000000000000000000000000000100000000000022440080000000000000000000001140220000000000000000000000000000000000000000008a80480000000000000000000000450288000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000080010004000000043380800000000000000000000000000000000000000000000000000000000000000002000000800103c500000000000000000000000000000000000000000000000000000000000008000000800101e24000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000080004001000000231a020000000000000000000000000000000000000000000000000000000000000000010000040083a090000000000000000000000000000000000000000000000000000000000000020000020040e8220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000020002004000000851a01000000000000000000000000000000000000000000000000000000000000000004000200103a0480000000000000000000000000000000000000000000000000000000000000040001000407410800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000010000000000a022450080000000000000000000000000000000000000000000000000000000000000200002808aa04800000000000000000000000000000000000000000000000000000000008000080000404541080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a900000000000000000000000000000000000000000000000000000000001000810020050220050000000000000000000000000000000000000000000000000000000000000000804004140260000000000000000000000000000000000000000000000000000000000400000008100208082000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x2000000000000000000000000000000000000000000000000020000000028d004000000000000000000000000000000000000000000000000000000000000000000000000168048000000000000000000000000000000000000000000000000000000000000008000000001601020000000000000000000000000000000000000000000000000000000000100000000040501000000000000000000000000000000000000000000000000000000001440000000000000000000000000000000000100010000000000000090000000000000000000000000000000000000000010000804500880000000008000000000000000000000000000000000000000000000000000000000000000050440000000020000000000000000000000000000000000000000000000000000000000000001410800000000080000000000000000000000000000000000000000000000000000000000042810000000004000000000000000000000000000000000000000000000000000044000080000000000000000000000000000000000100004000000000000080000000000000000000000000000000000000000000000000000200000000028a8010000000000000000000000000000000000000000000000000000000000000000000000009a0090000000000000000000000000000000000000000000000000000000000000400000000002602100000000000000000000000000000000000000000000000000000000010000000000101408000000000000000000000000000000000000000000000000000004840000000000000000000000000000000004000200000000000000200000000000000000000000000000000000000000000000000000000100000000001449000200000000000000000000000000000000000000000000000000000000000000000000011500240000000000000000000000000000000000000000000000000000000000200000000000114022000000000000000000000000000000000000000000000000000000008000000000008028100000000000000000000000000000000000000000000000000022100000000000000000000000000000000800080000000000948025100094200506050080040400000080080020100000400000804000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000a204000000000000000000088801000000000000000000000100000000000022440080000a000008101004920080000000000000228020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000800000011100400000040000000033008000000000000000000000000000004080001248040000080000000000114020000000000000038400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000480240000000022200100000000000000000000100000000001449000200000000000000000000000009004400000002280040000000000000000000000000011500200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x20001000140200800000000000000000000000000000000000000000000000000000000000000000000000040210440200000000000000000000000000000000000000000000000000000000000000000010042088020000000000000000000000000000000000000000000000000000000000000000008102088100000000000000000000000000000000000000000000000000000000100000140810800000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000810000010220040000000000000000000000000000000000000000000000000000000000000000800004140240000000000000000000000000000000000000000000000000000000000400000008000208084000000000000000000000000000000000000000000000000010000000000000040010050400000000000000000000000000000000000000000000000201208000000000000000000000000000000000000000000000000000000000000000008118040000000000000000000000000000000000000000000000000000000000000000000000010000401602000000000000000000000000000000000000000000000000000000000000000008000200582800000000000000000000000000000000000000000000000000000000001000008000000508400000000000000000000000000000000000000000000000000000000000020000000a1000000000000000000000000000000000000010000004000000000000000000000000000000000000000000080000001110040000000000000000000000000000000000000000000000000000000000000000008000000000011402000000000000000000000000000000000000000000000000000000000008000000000004502800000000000000000000000000000000000000000000000000000000001400000000004408400000000000000000000000000000000000000000000000000000002400000000000a10000000000000000000000000000000000020000000440000000000000000000000000000000000000000000000000000001023004000000000000000000000000000000000000000000000000000000000000000000000001000100b008000000000000000000000000000000000000000000000000000000000000000004000402c09000000000000000000000000000000000000000000000000000000000000400010000001421000000000000000000000000000000000000000000000000000000000000040000028400000000000000000000000000000000000008000010000000000000000000000000000000000000000008020000000001000100000000000000000000000000000000000000000000000000000000000000020020400000000040210000000000000000000000000000000000000000000000000000000020000200000000010042000000000000000000000000000000000000000000000000000000000800100000000008102000000000000000000000000000000000000000000000000000000200100000000140800000000000000000000000000400000002040002040000000000000000000000000000000000000000000000000000000020224010000000000000000000000000000000000000000000000000000000000000000000000040008028804000000000000000000000000000000000000000000000000000000000000000010002005102400000000000000000000000000000000000000000000000000000000000800040000005022000000000000000000000000000000000000000000000000000000000000800000a1000000000000000000000000000000000000200000800000000000000000000000000000000000000000000000000000000000080890100000000000000000000000000000000000000000000000000000000000000000000001000040290200000000000000000000000000000000000000000000000000000000000000000200008029090000000000000000000000000000000000000000000000000000000000010000800000142100000000000000000000000000000000000000000000000000000000000100000a100000000000000000000000000000000000080000400000000000000000) + (NatTree.leaf 0x9000000000000000000000000000000000000000000000004000020122402440000000010010000000000000000000000000000000000000000000000000000000020012025400000001002000000000000000000000000000000000000000000000000000000000400140a1100000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000800100000000000000000000000000000122002440000000010010000000000000000000000000000008084000000000000000000000000010025400000001002000000000000000000000000000002001000000000000000000000000000100a1500000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a9000000000000000000000000000000000000000000000000000000000010008100200502200500000000000000000000000000000000000000000000000000000000000000008040041402600000000000000000000000000000000000000000000000000000000004000000081002080860000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000122002440000000010010000000000000000000000000000000000000000000000000000000000010025400000001002000000000000000000000000000000000000000000000000000000000000100a150000000001000000000000000000000000000000000000000000000000000000000002a0a80000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000001000000800904400090000000000000000000000000000000000000000000000000000000000000000020004240114000000000000000000000000000000000000000000000000000000000100000000100041010a0000000000000000000000000000000000000000000000000000001000000004000201201000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000040800012480400000000000000000000000000000000000000000000000000000000000000000400024c05000000000000000000000000000000000000000000000000000000000002000000020002481040000000000000000000000000000000000000000000000000080000200000000100201820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000000000000208000892010000000000000000000000000000000000000000000000000000000000000000010002248090000000000000000000000000000000000000000000000000000000000040000001000089010800000000000000000000000000000000000000000000000004000004000000020040120800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000000000000000000010000400018440020000000000000000000000000000000000000000000000000000000000000001000018440110000000000000000000000000000000000000000000000000000000001000000040000c10108000000000000000000000000000000000000000000000000020000000000010000c044000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x8000000000000000000111004800000000088801000000000000000000000100000000000022440080000000000000000000001140220000000022802000000000000000000000000000008a804000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000048000000000000200000000200082088890140000000000000000000000040000000400100000400000000000000000000000000011040442290280000000000000000000000000100000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000010a000000000000000000000000000000100008045008800000000080000000000000000800010000308002000000000000000000000000000000000504400000000200000000000000000020000c20042000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001060c4c0200000000000000000000000000000000000000000000000000000000000000000800006000904409404000000000000000000000000000000000000000000000000000000000000010000904204a0900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080020911804800000000000000000000000000000000000000000000000000000000000000000000011000241160220000000000000000000000000000000000000000000000000000000000000010800120458288000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000020000000a28d80400000000000000000000000000000000000000000000000000000000000000000002001816c0480000000000000000000000000000000000000000000000000000000000000080008002016810200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000200000002828ac010000000000000000000000000000000000000000000000000000000000000000010002809b0090000000000000000000000000000000000000000000000000000000000000400040002002682100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000100000000281449200200000000000000000000000000000000000000000000000000000000000000100014011520240000000000000000000000000000000000000000000000000000000000200004000040114822000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x80000001110040000000000000000000000000000000000000000000000000000000000000000008000000000011402000000000000000000000000000000000000000000000000000000000008000000000004502800000000000000000000000000000000000000000000000000000000001400000000004408400000000000000000000000000000000000000000000000000000002400000000000a100000000000000000000000000000000000201000004400000000000000000000000000090000000000000000000000000000000000000000010000804500880000000008000000000000000000000000000000000000000000000000000000000000000050440000000020000000000000000000000000000000000000000000000000000000000000001410800000000080000000000000000000000000000000000000000000000000000000000042810000000004000000000000000000000000000000000000000000000000000044000080000000000000000000000000000000000101004000000000000000000000000000000000008118040000000000000000000000000000000000000000000000000000000000000000000000010000401602000000000000000000000000000000000000000000000000000000000000000008000200582800000000000000000000000000000000000000000000000000000000001000008000000508400000000000000000000000000000000000000000000000000000000000020000000a10000000000000000000000000000000000000100000040000000000000000000000400000000000001480004000000800441223004800000000000000000000000000000000000000001000008040100002000000000000009021108b008800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001440000200000001000882222401200000000000000000000000000000000000000000010001040040001000000000000024108822880480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002091180400000002088890100000000000000000000000000000000000000000000000000000000100024116020001000442290200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000400054604b380800000000000000000000000000000000000000000000000000000000000000000000001916193c5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000001110040000000000888010000020000000028d0040000000000000000000000000000000000000000001140200000000022802000000000001680480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x40400000000222004000000000000000000000000000000000000000000000000000000000000000080040000000008a008000000000000000000000000000000000000000000000000000000000800200000000022809000000000000000000000000000000000000000000000000000000000200500000000011021000000000000000000000000000000000000000000000000000000009200000000028000000000000000000000000000000000000000000000000000000000000000000000000000009000000000001000080014000000000000000000000000000000000000010000000200400000100000000000000000000000808400040000000000000000000000000000000000040000000200000000000000000000000200100008000000000000000000000000000000000001000000020000000000000000000000200080008000000000000000000000000800000001000000002000000000000008000000402002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000005460080000000000000000000000000000000000000000000000000000000000000000000000000011160900000000000000000000000000000000000000000000000000000000000000000000001116048000000000000000000000000000000000000000000000000000000000008000000010885080000000000000000000000000000000000000000000000000000000200000000500000000000000000000000000000000000000000000000000000000000000010000000000000000802000000000000000000000000000004400880000000008000000000000000000000000000000002002040000000000000000000000000040440000000020000000000000000000000000000002000020000000000000000000000000001010800000000080000000000000000000000000000080010000000000000000000000000002810000000004000000000000000000000000000020010000000000000000000040000080000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000100008045008800000000080000000000000000000000000000000000000000000000000000000000000000544400000000200000000000000000000000000000000000000000000000000000000000000015108000000000800000000000000000000000000000000000000000000000000000000000528100000000040000000000000000000000000000000000000000000000000000440000800000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000810000010220040000000000000000000000000000000000000000000000000000000000000000800004140240000000000000000000000000000000000000000000000000000000000400000008000208084000000000000000000000000000000000000000000000000010000000000000040010050400000000000000000000000000000000000000000001000201208000000000000000000000000000000000000000000000000000000000000084c0200000000000000000000000000000000000000000000000000000000000000000000002000004009404000000000000000000000000000000000000000000000000000000000000000000004004a0900000000000000000000000000000000000000000000000000000000008000020000000242100000000000000000000000000000000000000000000000000000000000040000002090400000000000000000000000000000000000002000001080000000000000000000000000000000000000000000008404040200000000000000000000000000000000000000000000000000000000000000000000002800800400404000000000000000000000000000000000000000000000000000000000000000800800200209000000000000000000000000000000000000000000000000000000000000000240200100021000000000000000000000000000000000000000000000000000000000000440008200004000000000000000000000000000000000000002001000080000000000000000000000000))))) + (NatTree.node 40 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x80000000000000000000000000800088801400000000000000000000000000000000001000004000000000000000000000000000000400022802800000000000000000000000000000000008000000000000000000000000000000080002280940000000000000000000000000000000000800000000000000000000000100000080011021400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000043380800000000000000000000000000000000000000000000000000000000000000000000000800103c500000000000000000000000000000000000000000000000000000000000000000000800101e24000000000000000000000000000000000000000000000000000000000000200008000019880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000231a020000000000000000000000000000000000000000000000000000000000000000000000040083a090000000000000000000000000000000000000000000000000000000000000000000020040e8220000000000000000000000000000000000000000000000000000000000000400080001850400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000851a01000000000000000000000000000000000000000000000000000000000000000000000200103a04800000000000000000000000000000000000000000000000000000000000000000010004074108000000000000000000000000000000000000000000000000000000000000200400000c28200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000200080000000000000000000000000000244004400000000004000000000000000000000000000000004020800000000000000000000000004022800000000040000000000000000000000000000002000200000000000000000000000000080828000000000400000000000000000000000000001000200000000000000000000000000140a0000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000001000000800904400090000000000000000000000000000000000000000000000000000000000000000020004240114000000000000000000000000000000000000000000000000000000000100000000100041010a000000000000000000000000000000000000000000000000000000100000000400020120500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000000000000000000010000400018440020000000000000000000000000000000000000000000000000000000000000001000018440110000000000000000000000000000000000000000000000000000000001000000040000c10108000000000000000000000000000000000000000000000000020000000000010000c04410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000480200000000000000000000000000000000000000000000000000000000000000000100000000080209004000000000000000000000000000000000000000000000000000000000400000000081104809000000000000000000000000000000000000000000000000000000000290000000001082021000000000000000000000000000000000000000000000000000000108000000000100900000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x50800000000000000000000000000000000000000000000000020000040001010000000008a0a245008000000000000000000000000000000000000000000000000000080000000020000a918aa04800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002004a900000000000000000000000000000000000000000000000000001000001800810021050228050000000000000000000000000000000000000000000000000000000000020000804404150260000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900000000008050000000000000000000000000000000000400002012240244000000001001000000000000004000200001000000000000000000000000000000002001202540000000100200000000000010000200000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001440000000000000000000000010001000000000000000000000000100000161000a2000000000080400000000000000000000000000040210000000000000000000000000064004a800000001024000000000000000000000000000100420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088a040000000000000000000020000000040080000000080000000000000000004000000000101004200200802000000000000000000000000104000000040000000000000000000000000804010800200811000000000000000000000000008100000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000004000020122402440000000010010000000000000000000000000000000000000000000000000000000020012025400000001002000000000000000000000000000000000000000000000000000000000400140a1500000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000048020000000002220010000000000000000000000000000000000000000000000000000000000000000900400000000228004000000000000000000000000000000000000000000000000000000000480900000000045002400000000000000000000000000000000000000000008000000000000202900000000044020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000080022200120000000000000000000000000000000020000004000000000000000000000000000000010002280048000000000000000000000000000000001000000000000000000000000000000004000450024800000000000000000000000000000000080000000000000000000000008000002000440224000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x2000000000000000000000000000000000000000000000000000000001000000000014490002000000000000000000000000000000000000000000000000000000000000000000000115002400000000000000000000000000000000000000000000000000000000002000000000001140220000000000000000000000000000000000000000000000000000000080000000000080281000000000000000000000000000000000000000000000010000221000000000000000000000000000000008000c00000000000000000a000000000000000000000000000000000000000000000000000000000000000810000010220040000000000000000000000000000000000000000000000000000000000000000800004140240000000000000000000000000000000000000000000000000000000000400000008000208084000000000000000000000000000000000000000000000000010000000000000040010050400000000000000000000000000000000000000000001000201208000000000000000000000000000000000400000000000000000000004186040402020001000140200800000000000000000000000000000000000000000001000008000868009004004040000040210440200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000008000000480200000040000000054600800000000000000000000000000810000010220040000100000000080209004000000000000111608000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000209118040000004000000043380800000000000000000000000000000000000000000000000000010002411602000000000800103c50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000040400000000222004000000100000003180200000000000000000000000000000002080008920100080040000000008a00800000000000038080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000412230040000001000000231a0200000000000000000000000000000000000000000000000000001001108b0080000000040083a09000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822224010000004000000851a01000000000000000000000000000000000000000000000000000040088228804000000200103a048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x1011900400000000000000000000000000000000000000000000000000000000000000000000000000401321100000000000000000000000000000000000000000000000000000000000000000000100264110000000000000000000000000000000000000000000000000000000000040002000000245080000000000000000000000000000000000000000000000000000000000020000448400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000005460080000000000000000000000000000000000000000000000000000000000000000000000000011160900000000000000000000000000000000000000000000000000000000000000000000001116048000000000000000000000000000000000000000000000000000000000008000000010885080000000000000000000000000000000000000000000000000000000200000000508000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000b3008000000000000000000000000000000000000000000000000000000000000000000000000000938500000000000000000000000000000000000000000000000000000000000000000000000049c2400000000000000000000000000000000000000000000000000000000000020000000109188000000000000000000000000000000000000000000000000000000008000000188000000000000000000000000000000000000000000000000000000000000000000090000000000010000800140000000000000000000000000000000000000100000002004000001000000000000000000000008084000400000000000000000000000000000000000400000002000000000000000000000002001000080000000000000000000000000000000000010000000200000000000000000000002000800080000000000000000000000008000000010000000020000000000000080000004020020000000000000000000000000080000000000000000000000000000000000000000000000000010a000000000000000000000000000000000000000000000000000000000000000000000800010000308002000000000000000000000000000000000000000000000000000000000000000020000c200420000000000000000000000000000000000000000000000000000000000000000020000308081000000000000000000000000000000000000000000000000010000000000000800180901000000000000000000000000000000000080000000000128000000000000000000000000000000000000010000000000000000802000000000000000000000000000004400880000000008000000000000000000000000000000002002040000000000000000000000000040440000000020000000000000000000000000000002000020000000000000000000000000001010800000000080000000000000000000000000000080010000000000000000000000000002810000000004000000000000000000000000000020010000000000000000000040000080000000000000000000200000000000000000000000000000002000000000000000000000000000000000000000000000000020000000028d0040000000000000000000000000000000000000000000000000000000000000000000000001680480000000000000000000000000000000000000000000000000000000000000080000000016010200000000000000000000000000000000000000000000000000000000001000000000405010000000000000000000000000000000000000000000000000000020014400000000000000000000000000000000001000180000000000000080000000000000000000000000000000000000000000000000000200000000028a8010000000000000000000000000000000000000000000000000000000000000000000000009a00900000000000000000000000000000000000000000000000000000000000004000000000026021000000000000000000000000000000000000000000000000000000000100000000001014080000000000000000000000000000000000000000000000000200048400000000000000000000000000000000040003000000000) + (NatTree.leaf 0x24000000000000000000000000000000000000000000010000202450044000000000040000000000000000000000000000000000000000000000000000000000020050228000000000400000000000000000000000000000000000000000000000000000000000800a082800000000040000000000000000000000000000000000000000000000000400000800214020000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000080022200120000000000000000000000000000000020000004000000000000000000000000000000010002280048000000000000000000000000000000001000000000000000000000000000000004000450024800000000000000000000000000000000080000000000000000000000008000002000440224000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000008000888014000000000000000000000000000000000010000040000000000000000000000000000004000228028000000000000000000000000000000000080000000000000000000000000000000800022809400000000000000000000000000000000008000000000000000000000001000000800110214000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000010200044900080000000000000000000000000000000000000000000000000000000000000040800044900240000000000000000000000000000000000000000000000000000000002000001020002240220000000000000000000000000000000000000000000000000080000200000802002009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000408204000000000000000000000000000000000000000000000000000000000800000100020a00080800100400000000000000000000000000000000000000000000000000000000000100800200800100200000000000000000000000000000000000000000000000000000000000020420010040000100000000000000000000000000000000000000000000000000000004020210200040000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000004802000000000000000000000000000000000000000000000000000000000000000001000000000802090040000000000000000000000000000000000000000000000000000000004000000000811048090000000000000000000000000000000000000000000000000000000002900000000010820210000000000000000000000000000000000000000000000000000001080000000001009040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040400000000222004000000000000000000000000000000000000000000000000000000000000000080040000000008a00800000000000000000000000000000000000000000000000000000000080020000000002280900000000000000000000000000000000000000000000000000000000020050000000001102100000000000000000000000000000000000000000000000000000000920000000002840000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200080000000001180040000000000000000000000000000000000000000000000000000000000000004020800000000130110000000000000000000000000000000000000000000000000000000002000200000000026011000000000000000000000000000000000000000000000000000000001004200000000020508000000000000000000000000000000000000000000000000000000400800000004800000000000000000000000000000000000000000000000000000000000000)))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x900000000000000009020000000000000000000000100008045008800000000080000000000000000000000000000000020220400000000000000000000000000544400000000200000000000000000000000000000020200200000000000000000000000000015108000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002004a00000000000000000000000000000000000000000000000000000100000080081000101022804000000000000000000000000000000000000000000000000000000000002000080040415024000000000000000000000000000000000000000000000000000000000040010400800020a084000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000209118040000000000000000000000000000000000000000000000000000000000000000000000010002411602000000000000000000000000000000000000000000000000000000000000000008001204582800000000000000000000000000000000000000000000000000000000001000008000804508400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000800100000000000000000000000000000122002440000000010010000000000000000000000000000008084000000000000000000000000010025400000001002000000000000000000000000000002001000000000000000000000000000100a1500000000010000000000000000000000000000200080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041223004000000000000000000000000000000000000000000000000000000000000000000000001001108b008000000000000000000000000000000000000000000000000000000000000000004004422c09000000000000000000000000000000000000000000000000000000000000400010001011421000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004802000000000222001000000000000000000000000000000000000000000000000000000000000000090040000000022800400000000000000000000000000000000000000000000000000000000048090000000004500240000000000000000000000000000000000000000000800000000000020290000000004402200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822224010000000000000000000000000000000000000000000000000000000000000000000000040088228804000000000000000000000000000000000000000000000000000000000000000010022045102400000000000000000000000000000000000000000000000000000000000800040004045022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020888901000000000000000000000000000000000000000000000000000000000000000000000010004422902000000000000000000000000000000000000000000000000000000000000000002000882290900000000000000000000000000000000000000000000000000000000000100008000811421000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x240000000000000000000000000000010119004000000100002024500440000000000400000000000000000000000000000000000000000004013211000000000200542280000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000000805000000008001000000000000000000000040000201224024400000000100100000000000000400020000100000080840000000000000000000000200120244000000010020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000480000000000002000a000000000118004000000000000000000000100000080090440009000000000000000000000000402080010000013011000000000000000000000002000424010400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00940000000000000000000000000000000000000000000000000000000041000080020040800a124c0400000000000000000000000000000000000000000000000000000000002004080402824e0500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014009400000000000000000000000000000000000000000000000000000000000020040004002020809089301000000000000000000000000000000000000000000000000000000000001004101048224c090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020008a00000000000000000000000000000000000000000000000000000002000000040000400001010204844920080000000000000000000000000000000000000000000000000000000800008240812044920240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000400000000330080000000000000000000000000000040800012480400000000000000000000000000000000000385000000000000000000000000000400024c0500000000000000000000000000000000000001c2400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000100000003180200000000000000000000000000000002080008920100000000000000000000000000000000038090000000000000000000000000000100022480900000000000000000000000000000000000e022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x140000000000000000000000000000000000000000000000000000000000000000000000002080008920100000000000000000000000000000000000000000000000000000000000000000100022480900000000000000000000000000000000000000000000000000000000000400000010000890108000000000000000000000000000000000000000000000000040000040000000200401208000000000000000000000000000000000000000000002050000000000000000000000000000000000000000000000010a000000000000000000000000000000000000000000000000000000000000000000000800010000308002000000000000000000000000000000000000000000000000000000000000000020000c2004200000000000000000000000000000000000000000000000000000000000000000200003080810000000000000000000000000000000000000000000000000100000000000008001809010000000000000000000000000000000000800000000001281000000000000000000000000000000000000000000000000000000000001110048000000000000000000000000000000000000000000000000000000000000000000000000000011402200000000000000000000000000000000000000000000000000000000000000000000004502880000000000000000000000000000000000000000000000000000000001000000000004408440000000000000000000000000000000000000000000000000000002000020000000a104000000000000000000000000000000000001000004482000000000000000000000000000000000000000000000000000000040000000054600800000000000000000000000000000000000000000000000000000000000000000000000000111609000000000000000000000000000000000000000000000000000000000000000000000011160480000000000000000000000000000000000000000000000000000000000080000000108850800000000000000000000000000000000000000000000000000000002000000005080000000000000000000000000000000000000004000000000000000000000900000000000000000000000000000000000000000100008045008800000000080000000000000000000000000000000000000000000000000000000000000000504400000000200000000000000000000000000000000000000000000000000000000000000014108000000000800000000000000000000000000000000000000000000000000000000000428100000000040000000000000000000000000000000000000000000000002000440000800000000000000000000000000000000001210040000000000140252004a20008a1000284c024010008080000002004008100000100000040100000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000048001280014a0002090280400202010401400400100800002008002010000000200000008001000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002400000000000000000200080000000001180040000001000020245004400000000004000000000000000000000000000000004020800000000130110000000002005022800000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x400000000000000000200080000000000000000000000000000244004400000000004000000000000000000000000000000004020800000000000000000000000004022800000000040000000000000000000000000000002000200000000000000000000000000080828000000000400000000000000000000000000001000200000000000000000000000000140a000000000200000000000000000000000000004008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400222004800000000000000000000000000000000000000000000000000000000000000000000000020008a0088000000000000000000000000000000000000000000000000000000000000000000800228091000000000000000000000000000000000000000000000000000000000004000000800110211000000000000000000000000000000000000000000000000000000010000c0000028410000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000800000000011800400000000000000000000000000000000000000000000000000000000000000040208000000001301100000000000000000000000000000000000000000000000000000000020002000000000260110000000000000000000000000000000000000000000000000000000010042000000000205080000000000000000000000000000000000000000000000000000004008000000048400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008002220012000000000000000000000000000000000000000000000000000000000000000000000001000228004800000000000000000000000000000000000000000000000000000000000000000400045002480000000000000000000000000000000000000000000000000000000000800000200044022400000000000000000000000000000000000000000000000000000002001800000a110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000546008000000000000000000000000000000000000000000000000000000000000000000000000001116090000000000000000000000000000000000000000000000000000000000000000000000111604800000000000000000000000000000000000000000000000000000000000800000001088508000000000000000000000000000000000000000000000000000000020008000050800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080008880140000000000000000000000000000000000000000000000000000000000000000000000040002280280000000000000000000000000000000000000000000000000000000000000000008000228094000000000000000000000000000000000000000000000000000000000010000008001102140000000000000000000000000000000000000000000000000000000400300000a1200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000122002440000000010010000000000000000000000000000000000000000000000000000000000010025400000001002000000000000000000000000000000000000000000000000000000000000100a150000000001000000000000000000000000000000000000000000000000000000000002a0a80000000008000000000000000000000000000000000000000000000202000000800000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000040800012480400000000000000000000000000000000000000000000000000000000000000000400024c05000000000000000000000000000000000000000000000000000000000002000000020002481040000000000000000000000000000000000000000000000000080000200000000100201820000000000000000000000000000000000000000000000020a00000000000000000000000000000000000000) + (NatTree.leaf 0xa000000000000000000000000000000040000000518010000000000000000000000000000000102000449000800000000000000000000000000000038048000000000000000000000000000408000449002400000000000000000000000000000000701080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000004802400000000000000000000000000000000001000000000014490002000000000000000000000000090044000000000000000000000000000000000000000115002400000000000000000000000048091000000000000000000000000000002000000000001140220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000004000020122402440000000010010000000000000000000000000000000000000000000000000000000020012825400000001002000000000000000000000000000000000000000000000000000000000400150a15000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000001180040000000000000000000000000000000904400090000000000000000000000000000000000000130110000000000000000000000000004240114000000000000000000000000000000000000026011000000000000000100000000000041010a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001440000000000000000000000000000000000000000000000000000100000161000a2000000000080400000000000000000000000000000000000000000000000000000000064004a8000000010240000000000000000000000000000000000000000000000000000000000019014a800000000840000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a204000000000000000000000000000000000000000000000000000000000000000000000a00000810100492008000000000000000000000000000000000000000000000000000000000800000810100249012000000000000000000000000000000000000000000000000000000000520000040800124040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000010000202450044000000000040000000000000000000000000000000000000000000000000000000000020050228000000000400000000000000000000000000000000000000000000000000000000000800a0828000000000400000000000000000000000000000000000000000000000004000008002140a000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000102000449000800000000000000000000000000000000000000000000000000000000000000408000449002400000000000000000000000000000000000000000000000000000000020000010200022402200000000000000000000000000000000000000000000000000800002000008020020090400000000000000000000000000000000000000000000000000000000000000000000000000000)))))) + (NatTree.node 72 (NatTree.node 32 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x900000000000000000000000000000000000000000100008045008800000000080000000000000000000000000000000000000000000000000000000000000000544400000000200000000000000000000000000000000000000000000000000000000000000015108000000000800000000000000000000000000000000000000000000000000000000000528100000000040000000000000000000000000000000000000000000000000000440000800000000000000000000000000000000001010040000000000000000000000000a00000048020000000002220010000004000000051801000000000000000000000000000000010200044900080900400000000228004000000000003804000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000010a00000802000000000100010000000010000804500880000000008000000000000000080001000030800202002040000000004021000000000000050400000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084c020000000000000000000004000000851a01000000000000000000000000000000000000200000400940400000000000000000000200103a048000000000000000000000000000000000000004004a0900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008405040311004000000000000000000000000000000000000000000000000000000000000000002800800420405140200000000000000000000000000000000000000000000000000000000000800800210209450280000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000000000082010000000000000000000000400002012240244000000001001000000000000000000000000000000888400000000000000000000002001282540000000100200000000000000000000000000000220100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a90000000000010000800140000000000000000000000000000000000000100081002005022005000000000000000000000008084000400000000000000000000000000000000080400414026000000000000000000000002001000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002220040400000000b3008000000000000000000000000000000000000000000000000000000000000008a00800000000938500000000000000000000000000000000000000000000000000000000002280900000000049c200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x140000000000000000000000000000000000000000000000000000000000000000000040800012480400000000000000000000000000000000000000000000000000000000000000000400024c05000000000000000000000000000000000000000000000000000000000002000000020002481040000000000000000000000000000000000000000000000000080000200000000100201820000000000000000000000000000000000000000000000020a100000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000000002080008920100000000000000000000000000000000000000000000000000000000000000000100022480900000000000000000000000000000000000000000000000000000000000400000010000890108000000000000000000000000000000000000000000000000040000040000000200401208000000000000000000000000000000000000000000002050400000000000000000000000000000000000000000000010a000000000000000000000000000000000000000000000000000000000000000000000800010000308002000000000000000000000000000000000000000000000000000000000000000020000c20042000000000000000000000000000000000000000000000000000000000000000002000030808100000000000000000000000000000000000000000000000001000000000000080018090100000000000000000000000000000000008000000800012810000000000000000000000000000000000000000000000000000040400000000222004000000000000000000000000000000000000000000000000000000000000000080040000000008a008000000000000000000000000000000000000000000000000000000000800200000000022809000000000000000000000000000000000000000000000000000000000200500000000011021000000000000000000000000000000000000000000000000000000009200000000028400000000000000000000000000000000001000000400000000000000000000000000000000000000000000000000020001000140200800000000000000000000000000000000000000000000000000000000000000000000000040210440200000000000000000000000000000000000000000000000000000000000000000010042088020000000000000000000000000000000000000000000000000000000000000000008102088100000000000000000000000000000000000000000000000000000000100000140810800000000000000000000000000000000040002040400000000000000000000000000000000000000000000000000004000000005460080000000000000000000000000000000000000000000000000000000000000000000000000011160900000000000000000000000000000000000000000000000000000000000000000000001116048000000000000000000000000000000000000000000000000000000000008000000010885080000000000000000000000000000000000000000000000000000000200000000508000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000400000000b3008000000000000000000000000000000000000000000000000000000000000000000000000000938500000000000000000000000000000000000000000000000000000000000000000000000049c24000000000000000000000000000000000000000000000000000000000000200000001091880000000000000000000000000000000000000000000000000000000080000001880000000000000000000000000000000000000008800000000000000000010000000000000000802000000000000000000000000000004400880000000008000000000000000000000000000000002002040000000000000000000000000040440000000020000000000000000000000000000002000020000000000000000000000000001010800000000080000000000000000000000000000080010000000000000000000000000002810000000004000000000000000000000000000020010000000000000000000040000080000000000000000000200000000000000100004000000000)) + (NatTree.node 8 (NatTree.leaf 0x10800000000000000000000000400002000b300c000000000000000000000000000000008000100002000000000000000000000000000000400938580000000000000000000000000000000200008000000000000000000000000000000040049c260000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000480000000000002000a0000000000000000000000000000000000001000000800904400090000000000000000000000004020800100000000000000000000000000000000020004240114000000000000000000000002000200040000000000000000000000000100000000100041010a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a204000000000000000000000000000000000000000000000000000000000000000000000a0000081010049200800000000000000000000000000000000000000000000000000000000080000081010024901200000000000000000000000000000000000000000000000000000000052000004080012404200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000002000100014020080000000000000000000000000000000000040000002020000080000000000000000000004021044020000000000000000000000000000000000004000000200000000000000000000001004208802000000000000000000000000000000000000800000008000000000000000000000810208810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000043380800000000000000000000000000000000000000000000000000000000000000000000000800103c500000000000000000000000000000000000000000000000000000000000000000000800101e24000000000000000000000000000000000000000000000000000000000000200008000019880000000000000000000000000000000000000000000000000000000000000001880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000231a020000000000000000000000000000000000000000000000000000000000000000000000040083a090000000000000000000000000000000000000000000000000000000000000000000020040e8220000000000000000000000000000000000000000000000000000000000000400080001850400000000000000000000000000000000000000000000000000000000000001880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000851a01000000000000000000000000000000000000000000000000000000000000000000000200103a04800000000000000000000000000000000000000000000000000000000000000000010004074108000000000000000000000000000000000000000000000000000000000000200400000c28200000000000000000000000000000000000000000000000000000000000188000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000001000000800904400090000000000000000000000000000000000000000000000000000000000000000020004240114000000000000000000000000000000000000000000000000000000000100000000100041010a00000000000000000000000000000000000000000000000000000010000000040002012050000000000000000000000000000000000000000000000000009001000000000000000000000000000000000000000000) + (NatTree.leaf 0x210080020000880004001040080231a030000000000000000000000000000000000000000000000000041208000000000010000244083a09800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002009640000000000000000000000000000000000000000000004000060100080161200a2000000000080400000000000000000000000000000000000000000000000002000040064804a800000001024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200140000000000000000000000000400000000b30080000000000000000040000080000040800012480400000000000000000000000000000000009385000000000000000000002000000400024c05000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000001050000000000000000000000000000000010000202450044000000000040000000000000001000040001844002000000000000000000000000000020050228000000000400000000000000000100001844010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000800441223004800000000000000000000000000000000000000000000000000000000000000000000009021108b008800000000000000000000000000000000000000000000000000000000000000044084422c09100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000001000882222401200000000000000000000000000000000000000000000000000000000000000000000024108822880480000000000000000000000000000000000000000000000000000000000000009042204510248000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000200082088890140000000000000000000000000000000000000000000000000000000000000000000011040442290280000000000000000000000000000000000000000000000000000000000000004208088229094000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002220040400000000b3008000000000000000000000000000000000000000000000000000000000000008a00800000000938500000000000000000000000000000000000000000000000000000000002280900000000049c240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x1011900400000000000000000000000000000000000000000000000000000000000000000000000000401321100000000000000000000000000000000000000000000000000000000000000000000100264110000000000000000000000000000000000000000000000000000000000040002000000245080000000000000000000000000000000000000000000000000000000000020000448400000000000000000000000000000000000100008200000000000000000000000000000000000000000000000000004000000005460080000000000000000000000000000000000000000000000000000000000000000000000000011160900000000000000000000000000000000000000000000000000000000000000000000001116048000000000000000000000000000000000000000000000000000000000008000000010885080000000000000000000000000000000000000000000000000000000200000000508000000000000000000000000000000000004000420000000000000000000000000000000000000000000000000000000400000000b3008000000000000000000000000000000000000000000000000000000000000000000000000000938500000000000000000000000000000000000000000000000000000000000000000000000049c2400000000000000000000000000000000000000000000000000000000000020000000109188000000000000000000000000000000000000000000000000000000008000000188000000000000000000000000000000000002000880000000000000000000001000000000000000000000000000000000000000000000000000000122002440000000010010000000000000000000000000000000000000000000000000000000000010025400000001002000000000000000000000000000000000000000000000000000000000000100a150000000001000000000000000000000000000000000000000000000000000000000002a0a80000000008000000000000000000000000000000000000000000000202000000800000000000000000000000000000004000200000000000000000010a000000000000000000000000000000000000000000000000000000000000000000000800010000308002000000000000000000000000000000000000000000000000000000000000000020000c20042000000000000000000000000000000000000000000000000000000000000000002000030808100000000000000000000000000000000000000000000000001000000000000080018090100000000000000000000000000000000008000000800012810000000000000000000000000000040000012009480094200040a08002291180480200080200000040400804000000800000040100000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020096400010a0000000000000000010001000000000000000004000060100080161200a20000000008804100003080020000000000000000402000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000048001000408002284b380c00000000000000000000000000000000000000000000000000000000000000002000008842993c5800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x48000000000000000000000000000000000000000000000000000001000000800904400090000000000000000000000000000000000000000000000000000000000000000020004240114000000000000000000000000000000000000000000000000000000000100000000100041010a0000000000000000000000000000000000000000000000000000001000000004000201205000000000000000000000000000000000000000000000000000904100000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000040800012480400000000000000000000000000000000000000000000000000000000000000000400024c05000000000000000000000000000000000000000000000000000000000002000000020002481040000000000000000000000000000000000000000000000000080000200000000100201820000000000000000000000000000000000000000000800020a10000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000000000000208000892010000000000000000000000000000000000000000000000000000000000000000010002248090000000000000000000000000000000000000000000000000000000000040000001000089010800000000000000000000000000000000000000000000000004000004000000020040120800000000000000000000000000000000000000001000205040000000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000000000000000000010000400018440020000000000000000000000000000000000000000000000000000000000000001000018440110000000000000000000000000000000000000000000000000000000001000000040000c10108000000000000000000000000000000000000000000000000020000000000010000c0441000000000000000000000000000000004000000000008a000000000000000000000000000000000000000000000000408204000000000000000000000000000000000000000000000000000000000800000100020a00080800100400000000000000000000000000000000000000000000000000000000000100800200800100200000000000000000000000000000000000000000000000000000000000020420010040000100000000000000000000000000000000000000000000000000000004020210200040000200000000000000000000000000000000000000008002000080000000000000000000000000000000000000000000080000004802000000000000000000000000000000000000000000000000000000000000000001000000000802090040000000000000000000000000000000000000000000000000000000004000000000811048090000000000000000000000000000000000000000000000000000000002900000000010820210000000000000000000000000000000000000000000000000000001080000000001009040000000000000000000000000000000000040000000500000000000000000000000000000000000000000000000040400000000222004000000000000000000000000000000000000000000000000000000000000000080040000000008a00800000000000000000000000000000000000000000000000000000000080020000000002280900000000000000000000000000000000000000000000000000000000020050000000001102100000000000000000000000000000000000000000000000000000000920000000002840000000000000000000000000000000000100000041000000000000000000000000000000000900000000000100008001400000000000000000000000000000000000001000000020040000010000000000000000000000080840004000000000000000000000000000000000004000000020000000000000000000000020010000800000000000000000000000000000000000100000002000000000000000000000020008000800000000000000000000000080000000100000000200000000000000800000040200200000000000000000000000000800000008000001008000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0xa000000000000000000000000000000000000010000020020020000000a28d80400000000000000000000000000000000000000000000000000000000000000200002001816c048000000000000000000000000000000000000000000000000000000000000108000000201681020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000010a000000000000000000000000000000100008045008800000000080000000000000000800010000308002000000000000000000000000000000000504400000000200000000000000000020000c2004200000000000000000000000000000000001410800000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000080001000800200000002828ac010000000000000000000000000000000000000000000000000000000000008000010002809b009000000000000000000000000000000000000000000000000000000000002040000000200268210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000040000400080010000000028144920020000000000000000000000000000000000000000000000000000000080000010001401152024000000000000000000000000000000000000000000000000000000001020000000004011482200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000111004800000000000000000000000000000000000100000000000022440080000000000000000000001140220000000000000000000000000000000000000000008a80480000000000000000000000450288000000000000000000000000000000800000000000450108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000009020000000000000000000000100008045008800000000080000000000000000000000000000000020220400000000000000000000000000544400000000200000000000000000000000000000020200200000000000000000000000000015108000000000800000000000000000000000000000900100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011100400000000008880100000000000000000000000000000000000000000000000000000000000000114020000000002280200000000000000000000000000000000000000000000000000000000045028000000000228090000000000000000000000000000000000000000000010000000000044094000000001102000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200140000000000000000000000000000000000000000000000000000000040000080000040800012480400000000000000000000000000000000000000000000000000000000002000000400024c05000000000000000000000000000000000000000000000000000000000002020000020002481040000000000000000000000000000000000000000000000000080000201000000100201800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x84c020000004000118045468080000000000000000000000000000000000000000000000000200000400940400000000013031168900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088a04000002000000002000820888901400000000000000000000000000000000400000000010100420020080200000000000110404422902800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200082a2244101000000231a020000000000000000000000000000000000000000000000000000000004008822890400040083a090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802548000000000000000000000000000000000000000000000000400001801000840b04d0019000000000000000000000000000000000000000000000000000000000000400002200c2d01340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002009640000000000000000000000000000000000000000000004000060100080161200a2000000000080400000000000000000000000000000000000000000000000002000040064c04a800000001024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000408204000000000000000400000004338080000000000000000000000000000800000100020a000808001004000000000000000000800103c5000000000000000000000000000000000100800200800100200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000001050000000000000000000000000000000010000202450044000000000040000000000000001000040001844002000000000000000000000000000020050228000000000400000000000000000100001844011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000040000000054600800000000000000000000000000810000010220040000000000000000000000000000000000111609000000000000000000000000800004140240000000000000000000000000000000000011160480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x4000000043380800000000000000000000000000000000000000000000000000000000000000000000000800103c500000000000000000000000000000000000000000000000000000000000000000000800101e24000000000000000000000000000000000000000000000000000000000000200008000019880000000000000000000000000000000000000000000000000000000000000001880000000000000000000000000000000000020000800000000000000000000000000000000000000000000000000000000001000000231a020000000000000000000000000000000000000000000000000000000000000000000000040083a090000000000000000000000000000000000000000000000000000000000000000000020040e8220000000000000000000000000000000000000000000000000000000000000400080001850400000000000000000000000000000000000000000000000000000000000001880000000000000000000000000000000000010004000000000000000000000000000000000000000000000000000000000000004000000851a01000000000000000000000000000000000000000000000000000000000000000000000200103a04800000000000000000000000000000000000000000000000000000000000000000010004074108000000000000000000000000000000000000000000000000000000000000200400000c28200000000000000000000000000000000000000000000000000000000000188000000000000000000000000000000000002000800000000000000000000048000000000000000000000000000000000000000000000000000001000000800904400090000000000000000000000000000000000000000000000000000000000000000020004240114000000000000000000000000000000000000000000000000000000000100000000100041010a0000000000000000000000000000000000000000000000000000001000000004000201205000000000000000000000000000000000000000000000000000904100000000000000000000000000000000000040000000000000000140000000000000000000000000000000000000000000000000000000000000000000040800012480400000000000000000000000000000000000000000000000000000000000000000400024c05000000000000000000000000000000000000000000000000000000000002000000020002481040000000000000000000000000000000000000000000000000080000200000000100201820000000000000000000000000000000000000000000800020a100000000000000000000000000000000400000000000000000140000000000000000000000000000000000000000000000000000000000000000000000002080008920100000000000000000000000000000000000000000000000000000000000000000100022480900000000000000000000000000000000000000000000000000000000000400000010000890108000000000000000000000000000000000000000000000000040000040000000200401208000000000000000000000000000000000000000010002050400000000000000000000000000000800000000000000000000408204000000000000000000000000000000000000000000000000000000000800000100020a000808001004000000000000000000000000000000000000000000000000000000000001008002008001002000000000000000000000000000000000000000000000000000000000000204200100400001000000000000000000000000000000000000000000000000000000040202102000400002000000000000000000000000000000000000000080020000800000000000000000000000002000000002004a0000000000084c020000000040000020002004000000851a010001000000800810001010228040000000000000004009404000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))))) + (NatTree.node 40 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x200140000000000000000000000000000000000000000000000000000000040000080000040800012480400000000000000000000000000000000000000000000000000000000002000000400024c05000000000000000000000000000000000000000000000000000000000002020000020002481040000000000000000000000000000000000000000000000000080000201000000100201820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000010000202450044000000000040000000000000000000000000000000000000000000000000000000000020050228000000000400000000000000000000000000000000000000000000000000000000000800a0828000000000400000000000000000000000000000000000000000000000004000008002140a0000000002000000000000000000000000000000000000000000000000040800004000000000000000000000000000000000000000000000000000400000000000000000200080000000000000000000000000000244004400000000004000000000000000000000000000000004020800000000000000000000000004022800000000040000000000000000000000000000002000200000000000000000000000000080828000000000400000000000000000000000000001000200000000000000000000000000140a0000000002000000000000000000000000000040080000000000000000040800004000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000001000000800904400090000000000000000000000000000000000000000000000000000000000000000020004240114000000000000000000000000000000000000000000000000000000000100000000100041010a000000000000000000000000000000000000000000000000000000100000000400020120500000000000000000000000000000000000000000000008000090410000000000000000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000000000000000000010000400018440020000000000000000000000000000000000000000000000000000000000000001000018440110000000000000000000000000000000000000000000000000000000001000000040000c10108000000000000000000000000000000000000000000000000020000000000010000c0441000000000000000000000000000000004000000000008a0800000000000000000000000000000000000000000000080000004802000000000000000000000000000000000000000000000000000000000000000001000000000802090040000000000000000000000000000000000000000000000000000000004000000000811048090000000000000000000000000000000000000000000000000000000002900000000010820210000000000000000000000000000000000000000000000000000001080000000001009040000000000000000000000000000000000040000000508000000000000000000000000000000000000000000000040400000000222004000000000000000000000000000000000000000000000000000000000000000080040000000008a00800000000000000000000000000000000000000000000000000000000080020000000002280900000000000000000000000000000000000000000000000000000000020050000000001102100000000000000000000000000000000000000000000000000000000920000000002840000000000000000000000000000000000100800041000000000000000000000000000000000000000000000200080000000001180040000000000000000000000000000000000000000000000000000000000000004020800000000130110000000000000000000000000000000000000000000000000000000002000200000000026011000000000000000000000000000000000000000000000000000000001004200000000020508000000000000000000000000000000000000000000000000000000400800000004840000000000000000000000000010000000200000800000000000000000000) + (NatTree.leaf 0x120000000000000000000000000000000000000000000040000400080010000000028144920020000000000000000000000000000000000000000000000000000000080000010001401152024000000000000000000000000000000000000000000000000000000001020000400004011482200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010800000000000000000000000400002000b300c000000000000000000000000000000008000100002000000000000000000000000000000400938580000000000000000000000000000000200008000000000000000000000000000000040049c260000000000000000000000000000000200002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080010400000000546008000000000000000000000000000000000000000000000000000000000000000808400000001116090000000000000000000000000000000000000000000000000000000000200100000000111604800000000000000000000000000000000000000000000000000000000200880000001088500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011100400000000008880100000000000000000000000000000000000000000000000000000000000000114020000000002280200000000000000000000000000000000000000000000000000000000045028000000000228090000000000000000000000000000000000000000000010000000000044094000000001102100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400002000b300c000000000000000000000000000000000000000000000000000000000000000000000000400938580000000000000000000000000000000000000000000000000000000000000000000040049c260000000000000000000000000000000000000000000000000000000000002000002010918c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000020002004000000851a01000000000000000000000000000000000000000000000000000000000000000004000200103a04800000000000000000000000000000000000000000000000000000000000000400010004074108000000000000000000000000000000000000000000000000000000000010200000000c282000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000010000202450044000000000040000000000000000000000000000000000000000000000000000000000020054228000000000400000000000000000000000000000000000000000000000000000000000800a8828000000000400000000000000000000000000000000000000000000000004000008002940a000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000010000000000a022450080000000000000000000000000000000000000000000000000000000000000200002808aa04800000000000000000000000000000000000000000000000000000000008000080000404541080000000000000000000000000000000000000000000000000000000400010000000220a0800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x8000000000000000000000000002220040400000000b300800000200000000028a801000000000000000000000000000000000000000008a008000000009385000000000000009a009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a90000000000000000000004000000005460080000000000000000000000100081002005022005000000000000000000000000000000000011160900000000000000000000000080400414026000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a00940000000000000000000000000000000000000000000000100000100041000080020040800a124c0400000000000000000000000000000000000000000000000001000000002004080402824e0500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034009400000000000000000000000000000000000000000000000000400000100020040004002020809089301000000000000000000000000000000000000000000000000008000000001004101048224c09000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000880000000000000000400011804546808000000000000000000000000200000004000040000101000004000000000000000000001303116890000000000000000000000000000000080000804000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000118045468080000000000000000000000000000000000000000000000000000000000000000000000013031168900000000000000000000000000000000000000000000000000000000000000000002605116848000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000010000020020020000000a28d80400000000000000000000000000000000000000000000000000000000000000200002001816c0480000000000000000000000000000000000000000000000000000000000001080008002016810200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000080001000800200000002828ac010000000000000000000000000000000000000000000000000000000000008000010002809b00900000000000000000000000000000000000000000000000000000000000204000400020026821000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0xa0000000000000000000000000000000000000000000000000000000000000000000000000001020004490008000000000000000000000000000000000000000000000000000000000000004080004490024000000000000000000000000000000000000000000000000000000000200000102000224022000000000000000000000000000000000000000000000000008000020000080200200904000000000000000000000000000000000000000040081400000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000000000000000000010000400018440020000000000000000000000000000000000000000000000000000000000000001000018440110000000000000000000000000000000000000000000000000000000001000000040000c10108000000000000000000000000000000000000000000000000020000000000010000c0441000000000000000000000000000000004000000800008a08000000000000000000000000000000000000000000000800000048020000000000000000000000000000000000000000000000000000000000000000010000000008020900400000000000000000000000000000000000000000000000000000000040000000008110480900000000000000000000000000000000000000000000000000000000029000000000108202100000000000000000000000000000000000000000000000000000010800000000010090400000000000000000000000000000000000402000005080000000000000000000000000000000400000000000000000200080000000000000000000000000000244004400000000004000000000000000000000000000000004020800000000000000000000000004022800000000040000000000000000000000000000002000200000000000000000000000000080828000000000400000000000000000000000000001000200000000000000000000000000140a000000000200000000000000000000000000004008000000000000000004080000400000000000000000002000000000000000000000000000000000000000000000000020008000000000118004000000000000000000000000000000000000000000000000000000000000000402080000000013011000000000000000000000000000000000000000000000000000000000200020000000002601100000000000000000000000000000000000000000000000000000000100420000000002050800000000000000000000000000000000000000000000000000000040080000000484000000000000000000000000001000000020000082000000000000000000000000000000000000000000000000000040000000054600800000000000000000000000000000000000000000000000000000000000000000000000000111609000000000000000000000000000000000000000000000000000000000000000000000011160480000000000000000000000000000000000000000000000000000000000080000000108850800000000000000000000000000000000000000000000000000000002000800005080000000000000000000000000000000000040004280000000000000000000012000250001450800102100a0080040501190050020040400000400800100400000001000000004001000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000208889010000020000000a28d80400000000000000000000000000000000000000000000000000100044229020000002001816c0480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x10000080010004000000043380800000000000000000000000000000000000000000000000000000000000000002000000800103c500000000000000000000000000000000000000000000000000000000000008000000800101e24000000000000000000000000000000000000000000000000000000000010200008000019880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000080004001000000231a020000000000000000000000000000000000000000000000000000000000000000010000040083a090000000000000000000000000000000000000000000000000000000000000020000020040e8220000000000000000000000000000000000000000000000000000000000020400080001850400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000020002004000000851a01000000000000000000000000000000000000000000000000000000000000000004000200103a04800000000000000000000000000000000000000000000000000000000000000400010004074108000000000000000000000000000000000000000000000000000000000010200400000c282000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000020000000a28d80400000000000000000000000000000000000000000000000000000000000000000002001816c0480000000000000000000000000000000000000000000000000000000000000080008002016810200000000000000000000000000000000000000000000000000000000001000400000505010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000200000002828ac010000000000000000000000000000000000000000000000000000000000000000010002809b009000000000000000000000000000000000000000000000000000000000000040004000200268210000000000000000000000000000000000000000000000000000000001000200000012140800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000010000000028144920020000000000000000000000000000000000000000000000000000000000000010001401152024000000000000000000000000000000000000000000000000000000000020000400004011482200000000000000000000000000000000000000000000000000000000800040000000882810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000002000100014020080000000000000000000000000000000000040000002020000080000000000000000000004021044020000000000000000000000000000000000004000000200000000000000000000001004208802000000000000000000000000000000000000800000008000000000000000000000810208810000000000000000000000000400000000400000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000010000202450044000000000040000000000000000000000000000000000000000000000000000000000020050228000000000400000000000000000000000000000000000000000000000000000000000800a0828000000000400000000000000000000000000000000000000000000000004000008002140a00000000020000000000000000000000000000000000000000000000000448000040000000000000000000000000000000000000000000000)))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x10500000000000000000000000000000000000000000000000000000000000000000000000010000400018440020000000000000000000000000000000000000000000000000000000000000001000018440110000000000000000000000000000000000000000000000000000000001000000040000c10108000000000000000000000000000000000000000000000000020000000000010000c0441000000000000000000000000000000004000000800008a0800000000000000000000000000800000000000000000080000004802000000000000000000000000000000000000000000000000000000000000000001000000000802090040000000000000000000000000000000000000000000000000000000004000000000811048090000000000000000000000000000000000000000000000000000000002900000000010820210000000000000000000000000000000000000000000000000000001080000000001009040000000000000000000000000000000000040200000508000000000000000000000001000020000000000000000a2040000000000000000000000000000020000000028d0040000000000000000000000000a00000810100492008000000000000000000000000000001680480000000000000000000000800000810100249010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000002100800000000000000000000010000202450044000000000040000000000000000000000000000000041208000000000000000000000020054228000000000400000000000000000000000000000020802000000000000000000000000800a8828000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088050004802000000000000000000000000000000000000000000000000000000000000000001004000200803090040000000000000000000000000000000000000000000000000000000004010000200811848090000000000000000000000000000000000000000000000000000000002900400010010c202000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000418604040200000000000000000000000000000000000000000000000000000000000100000800086800900400404000000000000000000000000000000000000000000000000000000000000210800900200209000000000000000000000000000000000000000000000000000000000400010240220100021000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000480000000000002000a0000000000000000000000000000000000001000000800904400090000000000000000000000004020800100000000000000000000000000000000020004240114000000000000000000000002000200040000000000000000000000000100000000100041010a0000000000000000000000100020002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008001040000000054600800000000000000000000000000000000000000000000000000000000000000080840000000111609000000000000000000000000000000000000000000000000000000000020010000000011160480000000000000000000000000000000000000000000000000000000020088000000108850800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x24000000000000000000000000000000000000000000010000202450044000000000040000000000000000000000000000000000000000000000000000000000020050228000000000400000000000000000000000000000000000000000000000000000000000800a0828000000000400000000000000000000000000000000000000000000000004000008002140a000000000200000000000000000000000000000000000000000000010004480000400000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000001020004490008000000000000000000000000000000000000000000000000000000000000004080004490024000000000000000000000000000000000000000000000000000000000200000102000224022000000000000000000000000000000000000000000000000008000020000080200200904000000000000000000000000000000000000000040081420000000000000000000000000000000000000000000000000000000000400222004800000000000000000000000000000000000000000000000000000000000000000000000020008a0088000000000000000000000000000000000000000000000000000000000000000000800228091000000000000000000000000000000000000000000000000000000000004000000800110211000000000000000000000000000000000000000000000000000000010000c0000028410000000000000000000000000000000000008000412100000000000000000000000000000000000000000002000800000000011800400000000000000000000000000000000000000000000000000000000000000040208000000001301100000000000000000000000000000000000000000000000000000000020002000000000260110000000000000000000000000000000000000000000000000000000010042000000000205080000000000000000000000000000000000000000000000000000004008000000048400000000000000000000000000100000002100008200000000000000000000000000000000000000000000000000008002220012000000000000000000000000000000000000000000000000000000000000000000000001000228004800000000000000000000000000000000000000000000000000000000000000000400045002480000000000000000000000000000000000000000000000000000000000800000200044022400000000000000000000000000000000000000000000000000000002001800000a1100000000000000000000000000000000000200010908000000000000000000000000000000000000000000000000000000080008880140000000000000000000000000000000000000000000000000000000000000000000000040002280280000000000000000000000000000000000000000000000000000000000000000008000228094000000000000000000000000000000000000000000000000000000000010000008001102140000000000000000000000000000000000000000000000000000000400300000a120000000000000000000000000000000000080008510000000000000000000024000000000000000000000000000000000000000000010000202450044000000000040000000000000000000000000000000000000000000000000000000000020050228000000000400000000000000000000000000000000000000000000000000000000000800a0828000000000400000000000000000000000000000000000000000000000004000008002140a0000000002000000000000000000000000000000000000000000000000044800004000000000000000000000000000000000000010000000000000000048000000000000000000000000000000000000000000000000000001000000800904400090000000000000000000000000000000000000000000000000000000000000000020004240114000000000000000000000000000000000000000000000000000000000100000000100041010a00000000000000000000000000000000000000000000000000000010000000040002012050000000000000000000000000000000000000000000000800009041000000000000000000000000000000000010400000)) + (NatTree.node 8 (NatTree.leaf 0x8000000000000000000000000001180040000000000000000000000000000000904400090000000000000000000000000000000000000130110000000000000000000000000004240114000000000000000000000000000000000000026011000000000000000100000000000041010a000000000000000000000000040000000000205080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a90000000000000000000000000000000000000000000000000000000000100081002005022005000000000000000000000000000000000000000000000000000000000000000080400414026000000000000000000000000000000000000000000000000000000000040000000810020808600000000000000000000000000000000000000000000000001000008000000014001005020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088a04000000000000000000000000000000000000000000000000000000000000400000000010100420020080200000000000000000000000000000000000000000000000000000000000080401080020081100000000000000000000000000000000000000000000000000000000000010210048001001080000000000000000000000000000000000000000000000000800001010108084000800100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000209118040000000000000000000000000000000000000000000000000000000000000000000000010002411602000000000000000000000000000000000000000000000000000000000000000008001204582800000000000000000000000000000000000000000000000000000000001000008000804508400000000000000000000000000000000000000000000000000000002000020000010a10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041223004000000000000000000000000000000000000000000000000000000000000000000000001001108b008000000000000000000000000000000000000000000000000000000000000000004004422c090000000000000000000000000000000000000000000000000000000000004000100010114210000000000000000000000000000000000000000000000000000000010000400004284000000000000000000000000000000000000000000000000000000000000000000000000000000000000000048020000000002220010000000000000000000000000000000000000000000000000000000000000000900400000000228004000000000000000000000000000000000000000000000000000000000480900000000045002400000000000000000000000000000000000000000008000000000000202900000000044022000000000000000000000000000000000000000000000000000000092400000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822224010000000000000000000000000000000000000000000000000000000000000000000000040088228804000000000000000000000000000000000000000000000000000000000000000010022045102400000000000000000000000000000000000000000000000000000000000800040004045022000000000000000000000000000000000000000000000000000000002000800010a1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002088890100000000000000000000000000000000000000000000000000000000000000000000001000442290200000000000000000000000000000000000000000000000000000000000000000200088229090000000000000000000000000000000000000000000000000000000000010000800081142100000000000000000000000000000000000000000000000000000000400100008a100000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x400000000000000000200080000000000000000000000000000244004400000000004000000000000000000000000000000004020800000000000000000000000004022800000000040000000000000000000000000000002000200000000000000000000000000080828000000000400000000000000000000000000001000200000000000000000000000000140a0000000002000000000000000000000000000040080000000000000000040800004000000000000000000020000000000000200010000000000000000000000020418605060b1180400000000000000000000000000000000000000000000000000000010000280008680090142064516020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802548000000000000000000000000000000000000000000000000400001801000840b04d8019000000000000000000000000000000000000000000000000000000000000400002300c2d813400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000144000000000000020000880004001040080231a030000000000000000000000000000010001040040001000000000000000000000010000244083a09800000000000000000000000000000200100001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000a2040000000000000000000000000000020000000028d0040000000000000000000000000a0000081010049200800000000000000000000000000000168048000000000000000000000080000081010024901200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000400080040000090454680800000000000000000000000000000000000000000000000000000000000000004000000012311689000000000000000000000000000000000000000000000000000000000001000000002451168480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088050004802000000000000000000000000000000000000000000000000000000000000000001004000200803090040000000000000000000000000000000000000000000000000000000004010000200811848090000000000000000000000000000000000000000000000000000000002900400010010c202100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000480240000000000000000000000000000000000100000000001449000200000000000000000000000009004400000000000000000000000000000000000000011500240000000000000000000000004809100000000000000000000000000000200000000000114022000000000080000000000002021100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x1000000000000000000000800100000000000000000000000000000122002440000000010010000000000000000000000000000008084000000000000000000000000010025400000001002000000000000000000000000000002001000000000000000000000000000100a150000000001000000000000000000000000000020008000000000000000000000000002a0a8000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a9000000000000000000000000000000000000000000000000000000000010008100200502200500000000000000000000000000000000000000000000000000000000000000008040041402600000000000000000000000000000000000000000000000000000000004000000081002080860000000000000000000000000000000000000000000000000100000800000001400100506000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000048020000000002220010000000000000000000000000000000000000000000000000000000000000000900400000000228004000000000000000000000000000000000000000000000000000000000480900000000045002400000000000000000000000000000000000000000008000000000000202900000000044022000000000000000000000000000000000000000000000000000000092400000000a1000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000008002220012000000000000000000000000000000002000000400000000000000000000000000000001000228004800000000000000000000000000000000100000000000000000000000000000000400045002480000000000000000000000000000000008000000000000000000000000800000200044022400000000000000000000000000000000400000000000000000000002001800000a1100000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000080008880140000000000000000000000000000000000100000400000000000000000000000000000040002280280000000000000000000000000000000000800000000000000000000000000000008000228094000000000000000000000000000000000080000000000000000000000010000008001102140000000000000000000000000000000008000000000000000000000400300000a1200000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000010000000000a022450080000000000000000000000000000000000000000000000000000000000000200002808aa04800000000000000000000000000000000000000000000000000000000008000080000404541080000000000000000000000000000000000000000000000000000000400010000000220a08000000000000000000000000000000000000000000000000024100000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000102000449000800000000000000000000000000000000000000000000000000000000000000408000449002400000000000000000000000000000000000000000000000000000000020000010200022402200000000000000000000000000000000000000000000000000800002000008020020090400000000000000000000000000000000000000104008142000000000000000000000000000000000024000000000000000000000000000000000000000000010000202450044000000000040000000000000000000000000000000000000000000000000000000000020050228000000000400000000000000000000000000000000000000000000000000000000000800a0828000000000400000000000000000000000000000000000000000000000004000008002140a00000000020000000000000000000000000000000000000000000000000448000040000000000000000000000000000000002000100000000))))))) + (NatTree.node 152 (NatTree.node 72 (NatTree.node 32 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x200040a204000000000000000000000000000000000000000000000000000000000800000100020a000808101484928080000000000000000000000000000000000000000000000000000001008002028101482494120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020014000000000000000400222004800000000000000000000000000000004000008000004080001248040000000000000000020008a008800000000000000000000000000000002000000400024c0500000000000000000008002280910000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000880004001040080231a030000000000000000000000000000000000000000000000000000000000000000010000244083a098000000000000000000000000000000000000000000000000000000000000020000222040e82300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000400000000330080000000000000000000000000000040800012480400000000000000000000000000000000000385000000000000000000000000000400024c0500000000000000000000000000000000000001c24000000000000000000200000002000248104000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800940000000000000000000000000000000000000000000000000000000001000000020040800a124c0400000000000000000000000000000000000000000000000000000000000004080402824e050000000000000000000000000000000000000000000000000000000000020001080202024c10400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000100000003180200000000000000000000000000000002080008920100000000000000000000000000000000038090000000000000000000000000000100022480900000000000000000000000000000000000e02200000000000000000000400000010000890108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010009400000000000000000000000000000000000000000000000000000000000000040000002020809089301000000000000000000000000000000000000000000000000000000000000004101048224c0900000000000000000000000000000000000000000000000000000000000400084010200892108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088a04000000000000000000002000000004008000000008000000000000000000400000000010100420020080200000000000000000000000010400000004000000000000000000000000080401080020081100000000000000000000000000810000000040000000000000000000000010210048001001080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x2000000000000000000000000000000000000000000000000000000001000000002814492002000000000000000000000000000000000000000000000000000000000000001000140115202400000000000000000000000000000000000000000000000000000000002000040000401148220000000000000000000000000000000000000000000000000000000080004000000088281000000000000000000000000000000000000000000000000000221000000000000000000000000000000000000000000000000000000400000000000000000000008002220012000000000000000000000000000000002000000400000000000000000000000000000001000228004800000000000000000000000000000000100000000000000000000000000000000400045002480000000000000000000000000000000008000000000000000000000000800000200044022400000000000000000000000000000000400000000000000000000002001800000a1100000000000000000008000000000000000000000000000000000000000000000000000008000000000000000000000000080008880140000000000000000000000000000000000100000400000000000000000000000000000040002280280000000000000000000000000000000000800000000000000000000000000000008000228094000000000000000000000000000000000080000000000000000000000010000008001102140000000000000000000000000000000008000000000000000000000400300000a12000000000000000000040000000000000000000000000000000000000000000000200140000000000000000000000000000000000000000000000000000000040000080000040800012480400000000000000000000000000000000000000000000000000000000002000000400024c05000000000000000000000000000000000000000000000000000000000002020000020002481040000000000000000000000000000000000000000000000000080000201000000100201820000000000000000000000000000000000000000004000020a00000000000000000000000000000000000000000024000000000000000000000000000000000000000000010000202450044000000000040000000000000000000000000000000000000000000000000000000000020050228000000000400000000000000000000000000000000000000000000000000000000000800a0828000000000400000000000000000000000000000000000000000000000004000008002140a000000000200000000000000000000000000000000000000000000000004480000400000000000000000000000000000000020201000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000001020004490008000000000000000000000000000000000000000000000000000000000000004080004490024000000000000000000000000000000000000000000000000000000000200000102000224022000000000000000000000000000000000000000000000000008000020000080200200904000000000000000000000000000000000000001040081420000000000000000000000000010000000000000000000011060c4c024041223004000000000000000000000000000000000000000000000000000000080001600090440941441108b0080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002009640000000000000000000000010001000000000000000004000060100080161200a2000000000080400000000000000000000000000040210000000000000000002000040064804a8000000010240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x1060c4c0200000000000000000000000000000000000000000000000000000000000000000800006000904409404000000000000000000000000000000000000000000000000000000000000010000904204a09000000000000000000000000000000000000000000000000000000000480000200220102421000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000002100800000000000000000000010000202450044000000000040000000000000000000000000000000041208000000000000000000000020054228000000000400000000000000000000000000000020802000000000000000000000000800a8828000000000400000000000000000000000000001200200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800209118048000000000000000000000000000000000000000000000000000000000000000000000110002411602200000000000000000000000000000000000000000000000000000000000000108001204582880000000000000000000000000000000000000000000000000000000001000088000804508440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000004000020122402440000000010010000000000000000000000000000000000000000000000000000000020012025400000001002000000000000000000000000000000000000000000000000000000000400140a150000000001000000000000000000000000000000000000000000000002000000400082a088000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000020002004000000851a01000000000000000000000000000000000000000000000000000000000000000004000200103a04800000000000000000000000000000000000000000000000000000000000000400010004074108000000000000000000000000000000000000000000000000000000000010200400000c282000000000000000000000000000000000000000000000000000000000001880000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000020000000a28d80400000000000000000000000000000000000000000000000000000000000000000002001816c0480000000000000000000000000000000000000000000000000000000000000080008002016810200000000000000000000000000000000000000000000000000000000001000400000505010000000000000000000000000000000000000000000000000000000014400000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000200000002828ac010000000000000000000000000000000000000000000000000000000000000000010002809b00900000000000000000000000000000000000000000000000000000000000004000400020026821000000000000000000000000000000000000000000000000000000000100020000001214080000000000000000000000000000000000000000000000000000048400000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000010000202450044000000000040000000000000000000000000000000000000000000000000000000000020054228000000000400000000000000000000000000000000000000000000000000000000000800a8828000000000400000000000000000000000000000000000000000000000004000008002940a00000000020000000000000000000000000000000000000000000000000448000040000000000000000000000000000000000000000000000) + (NatTree.leaf 0x41223004000000000000000000000000000000000000000000000000000000000000000000000001001108b008000000000000000000000000000000000000000000000000000000000000000004004422c090000000000000000000000000000000000000000000000000000000000004000100010114210000000000000000000000000000000000000000000000000000000010000400004284000000000000000000000000000000000000080004100000000000000000000000000000000000000000000000000000000822224010000000000000000000000000000000000000000000000000000000000000000000000040088228804000000000000000000000000000000000000000000000000000000000000000010022045102400000000000000000000000000000000000000000000000000000000000800040004045022000000000000000000000000000000000000000000000000000000002000800010a1000000000000000000000000000000000000200010800000000000000000000000000000000000000000000000000000000002088890100000000000000000000000000000000000000000000000000000000000000000000001000442290200000000000000000000000000000000000000000000000000000000000000000200088229090000000000000000000000000000000000000000000000000000000000010000800081142100000000000000000000000000000000000000000000000000000000400100008a1000000000000000000000000000000000000800084000000000000000000009480251000942005060500800445223004800800201000004010008040000000800000020004000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802548000105000000000000000000001180040000000000000000400001801000840b04d00190000000100004000184400200000000000000130100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084c0200000008222240100000000000000000000000000000000000000000000000000000002000004009404000400882288040000000000000000000000000000000000000000000000000000004004a0900000022045102400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000008001000400000284b380800000000000000000000000000000000000000000000000000000000000000002000000802993c500000000000000000000000000000000000000000000000000000000000008000000802949e2400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000080500000000000000000000000000000000004000020122402440000000010010000000000000040002000010000000000000000000000000000000020012025400000001002000000000000100002000008000000000000000000000000000000000400140a150000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x9000000000000000000000000000000000000000000000004000020122402440000000010010000000000000000000000000000000000000000000000000000000020012025400000001002000000000000000000000000000000000000000000000000000000000400140a150000000001000000000000000000000000000000000000000000000002000000400082a0a8000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002004a00000000000000000000000000000000000000000000000000000100000080081000101022804000000000000000000000000000000000000000000000000000000000002000080040415024000000000000000000000000000000000000000000000000000000000040010400800020a0840000000000000000000000000000000000000000000000000100000000408000400110504000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000800100000000000000000000000000000122002440000000010010000000000000000000000000000008084000000000000000000000000010025400000001002000000000000000000000000000002001000000000000000000000000000100a150000000001000000000000000000000000000020008000000000000000000000000002a0a800000000080000000000000000000000000040200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000080010004000000043380800000000000000000000000000000000000000000000000000000000000000002000000800103c500000000000000000000000000000000000000000000000000000000000008000000800101e24000000000000000000000000000000000000000000000000000000000010200008000019880000000000000000000000000000000000000000000000000000000000020001880000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000080004001000000231a020000000000000000000000000000000000000000000000000000000000000000010000040083a090000000000000000000000000000000000000000000000000000000000000020000020040e8220000000000000000000000000000000000000000000000000000000000020400080001850400000000000000000000000000000000000000000000000000000000004001880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000020002004000000851a01000000000000000000000000000000000000000000000000000000000000000004000200103a04800000000000000000000000000000000000000000000000000000000000000400010004074108000000000000000000000000000000000000000000000000000000000010200400000c28200000000000000000000000000000000000000000000000000000000200188000000000000000000000000000000000000000000000000000000000000200140000000000000000000000000000000000000000000000000000000040000080000040800012480400000000000000000000000000000000000000000000000000000000002000000400024c05000000000000000000000000000000000000000000000000000000000002020000020002481040000000000000000000000000000000000000000000000000080000201000000100201820000000000000000000000000000000000000000004000020a10000000000000000000000000000000000000000000000000000000000000209118040000000000000000000000000000000000000000000000000000000000000000000000010002411602000000000000000000000000000000000000000000000000000000000000000008001204582800000000000000000000000000000000000000000000000000000000001000008000804508400000000000000000000000000000000000000000000000000000002000020000010a1000000000000000000000000000000000000010000044000000000000000000000000) + (NatTree.leaf 0x84c020000000000000000000004000000851a01000000000000000000000000000000000000200000400940400000000000000000000200103a048000000000000000000000000000000000000004004a090000000000000000000001000407410800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001440000000000000000000000010001000000000000000000000000100000161000a2000000000080400000000000000000000000000040210000000000000000000000000064004a8000000010240000000000000000000000000001004200000000000000000000000000019014a800000000840000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000400000000546008000000000000000000000000008100000102200400000000000000000000000000000000001116090000000000000000000000008000041402400000000000000000000000000000000000111604800000000000000004000000080002080840000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a90000000000010000800140000000000000000000000000000000000000100081002005022005000000000000000000000008084000400000000000000000000000000000000080400414026000000000000000000000002001000080000000000000000000000000040000000810020808600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000010a000000000000000000000000000000100008045008800000000080000000000000000800010000308002000000000000000000000000000000000504400000000200000000000000000020000c20042000000000000000000000000000000000014108000000000800000000000000002000030808100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000004000000051801000000000000000000000000000000010200044900080000000000000000000000000000003804800000000000000000000000000040800044900240000000000000000000000000000000070108000000000000000000002000001020002240220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000111004800000000000000000000000000000000000100000000000022440080000000000000000000001140220000000000000000000000000000000000000000008a8048000000000000000000000045028800000000000000000000000000000080000000000045010800000000010000000000044084400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000000000000902000000000000000000000010000804500880000000008000000000000000000000000000000002022040000000000000000000000000054440000000020000000000000000000000000000002020020000000000000000000000000001510800000000080000000000000000000000000000090010000000000000000000000000052810000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x24000000000000000000000000000000000000000000010000202450044000000000040000000000000000000000000000000000000000000000000000000000020050228000000000400000000000000000000000000000000000000000000000000000000000800a0828000000000400000000000000000000000000000000000000000000000004000008002140a000000000200000000000000000000000000000000000000000000010004480000400000000000000000000000000000000024201000000000000020000000000000000000000000000000000000000000000000000000010000000028144920020000000000000000000000000000000000000000000000000000000000000010001401152024000000000000000000000000000000000000000000000000000000000020000400004011482200000000000000000000000000000000000000000000000000000000800040000000882810000000000000000000000000000000000000000000000000002210000000000000000000000000000000080008000000000000000000000000000902001000048001000408002284b380c00000000000000000000000000000000000000000000000020220400000000002000008842993c58000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000010500000020008000000000118004000000100002024500440000000000400000000000000010000400018440020402080000000013011000000000200502080000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000020000080004001000000231a020000001000000002814492002000000000000000000000000000000000000000010000040083a0900000000100014011520240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000000000080010400000000546008000000400002012240244000000001001000000000000000000000000000000808400000001116090000000002001202540000000100200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040254800000000000000000000000000000000000000000100003020004040201010000000008a0a245008000000000000000000000000000000000000000000000200000081000000020000a918aa0480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084c0200000008222240100000000000000000000000000000000000000000000000000000002000004009404000400882288040000000000000000000000000000000000000000000000000000004004a09000100220451024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x88a04000000000000000000000000000000000000000000000000000000000000400000000010100420020080200000000000000000000000000000000000000000000000000000000000080401080020081100000000000000000000000000000000000000000000000000000000000010210048001001080000000000000000000000000000000000000000000000000800001010108084000800100000000000000000000000000000000000040004000400040000000000000000000000000000000000000000000000000000209118040000000000000000000000000000000000000000000000000000000000000000000000010002411602000000000000000000000000000000000000000000000000000000000000000008001204582800000000000000000000000000000000000000000000000000000000001000008000804508400000000000000000000000000000000000000000000000000000002000020000010a10000000000000000000000000000000000000100000448000000000000000000000000000000000000000000000000000041223004000000000000000000000000000000000000000000000000000000000000000000000001001108b008000000000000000000000000000000000000000000000000000000000000000004004422c090000000000000000000000000000000000000000000000000000000000004000100010114210000000000000000000000000000000000000000000000000000000010000400004284000000000000000000000000000000000000080004120000000000000000000000000000000000000000000000000000000822224010000000000000000000000000000000000000000000000000000000000000000000000040088228804000000000000000000000000000000000000000000000000000000000000000010022045102400000000000000000000000000000000000000000000000000000000000800040004045022000000000000000000000000000000000000000000000000000000002000800010a1000000000000000000000000000000000000200010900000000000000000000000000000000000000000000000000000000002088890100000000000000000000000000000000000000000000000000000000000000000000001000442290200000000000000000000000000000000000000000000000000000000000000000200088229090000000000000000000000000000000000000000000000000000000000010000800081142100000000000000000000000000000000000000000000000000000000400100008a1000000000000000000000000000000000000800085000000000000000000000000000000000000000000000000000040000020002004000000851a01000000000000000000000000000000000000000000000000000000000000000004000200103a04800000000000000000000000000000000000000000000000000000000000000400010004074108000000000000000000000000000000000000000000000000000000000010200400000c282000000000000000000000000000000000000000000000000000000002001880000000000000000000000000000000000000008000000000000002000000000000000000000000000000000000000000000000020000000a28d80400000000000000000000000000000000000000000000000000000000000000000002001816c0480000000000000000000000000000000000000000000000000000000000000080008002016810200000000000000000000000000000000000000000000000000000000001000400000505010000000000000000000000000000000000000000000000000000000014400000000000000000000000000000000001000100000000000000080000000000000000000000000000000000000000000000000000200000002828ac010000000000000000000000000000000000000000000000000000000000000000010002809b00900000000000000000000000000000000000000000000000000000000000004000400020026821000000000000000000000000000000000000000000000000000000000100020000001214080000000000000000000000000000000000000000000000000000048400000000000000000000000000000000040002000000000) + (NatTree.leaf 0x2088890100000000000000000000000000000000000000000000000000000000000000000000001000442290200000000000000000000000000000000000000000000000000000000000000000200088229090000000000000000000000000000000000000000000000000000000000010000800081142100000000000000000000000000000000000000000000000000000000400100008a1000000000000000000000000000000000000800085000000000000000020000000000000000000000000100041a231040400000284b3808000000000000000000000000000000000000000000000000000000001001108b2080000802993c500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000480000000000002000000002000820888901400000000000000000000000400000004001000004000000000000000000000000000110404422902800000000000000000000000001000000008000000000000000000000000000042080882290940000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000001050000000000000000000000000000000010000202450044000000000040000000000000001000040001844002000000000000000000000000000020050228000000000400000000000000000100001844011000000000000000000000000000000800a08280000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002004a90000000000000000000000000000000000000000000000000000100000180081002105022805000000000000000000000000000000000000000000000000000000000002000080440415026000000000000000000000000000000000000000000000000000000000040010400810020a08600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088a040000000000000000000020000000040080000000080000000000000000004000000000101004200200802000000000000000000000000104000000040000000000000000000000000804010800200811000000000000000000000000008100000000400000000000000000000000102100480010010800000000000000000000000202000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800104000000005460080000000000000000000000000000000000000000000000000000000000000008084000000011160900000000000000000000000000000000000000000000000000000000002001000000001116048000000000000000000000000000000000000000000000000000000002008800000010885080000000000000000000000000000000000000000000000000000004220000000500000000000000000000000000000000000000000000000000000000000000000000200140000000000000000000000000000000000000000000000000000000040000080000040800012480400000000000000000000000000000000000000000000000000000000002000000400024c05000000000000000000000000000000000000000000000000000000000002020000020002481040000000000000000000000000000000000000000000000000080000201000000100201820000000000000000000000000000000000000000004800020a10000000000000000000000000000000000000))))) + (NatTree.node 40 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0xa9000000000000000000000000000000000000000000000000000000000010008100200502200500000000000000000000000000000000000000000000000000000000000000008040041402600000000000000000000000000000000000000000000000000000000004000000081002080860000000000000000000000000000000000000000000000000100000800000001400100506000000000000000000000000000000000000000000000002012008000000000000000000000000000000000000000000000000000000000000048020000000002220010000000000000000000000000000000000000000000000000000000000000000900400000000228004000000000000000000000000000000000000000000000000000000000480900000000045002400000000000000000000000000000000000000000008000000000000202900000000044022000000000000000000000000000000000000000000000000000000092400000000a100000000000000000000000000020000010800001000000000000000000000000000000000000000000000010000080010004000000043380800000000000000000000000000000000000000000000000000000000000000002000000800103c500000000000000000000000000000000000000000000000000000000000008000000800101e24000000000000000000000000000000000000000000000000000000000010200008000019880000000000000000000000000000000000000000000000000000000000020001880000000000000000000000000000000000020000800000000000000000000000000000000000000000000020000080004001000000231a020000000000000000000000000000000000000000000000000000000000000000010000040083a090000000000000000000000000000000000000000000000000000000000000020000020040e8220000000000000000000000000000000000000000000000000000000000020400080001850400000000000000000000000000000000000000000000000000000000004001880000000000000000000000000000000000010004000000000000000000000000000000000000000000000000040000020002004000000851a01000000000000000000000000000000000000000000000000000000000000000004000200103a04800000000000000000000000000000000000000000000000000000000000000400010004074108000000000000000000000000000000000000000000000000000000000010200400000c282000000000000000000000000000000000000000000000000000000002001880000000000000000000000000000000000020008000000000000000024000000000000000000000000000000000000000000010000202450044000000000040000000000000000000000000000000000000000000000000000000000020054228000000000400000000000000000000000000000000000000000000000000000000000800a8828000000000400000000000000000000000000000000000000000000000004000008002940a0000000002000000000000000000000000000000000000000000000000044800004000000000000000000000000000000000202010000000000000000200140000000000000000000000000000000000000000000000000000000040000080000040800012480400000000000000000000000000000000000000000000000000000000002000000400024c05000000000000000000000000000000000000000000000000000000000002020000020002481040000000000000000000000000000000000000000000000000080000201000000100201820000000000000000000000000000000000000000004800020a1000000000000000000000000000000004000000000000000000088a04000000000000000000000000000000000000000000000000000000000000400000000010100420020080200000000000000000000000000000000000000000000000000000000000080401080020081100000000000000000000000000000000000000000000000000000000000010210048001001080000000000000000000000000000000000000000000000000800001010108084000800100000000000000000000000000000000000040004000400040000000000000000000000000100) + (NatTree.leaf 0x120000000000000000000000000000000000000000000040000400080010000000028144920020000000000000000000000000000000000000000000000000000000080000010001401152024000000000000000000000000000000000000000000000000000000001020000400004011482200000000000000000000000000000000000000000000000000000100800000000000882810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000001180040000000000000000000000000000000904400090000000000000000000000000000000000000130110000000000000000000000000004240114000000000000000000000000000000000000026011000000000000000100000000000041010a000000000000000000000000040000000000205080000000000000000000000000020120500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001440000000000000000000000000000000000000000000000000000100000161000a2000000000080400000000000000000000000000000000000000000000000000000000064004a8000000010240000000000000000000000000000000000000000000000000000000000019014a80000000084000000000000000000000000000000000000000002000000000000000c0a8540000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a204000000000000000000000000000000000000000000000000000000000000000000000a0000081010049200800000000000000000000000000000000000000000000000000000000080000081010024901200000000000000000000000000000000000000000000000000000000052000004080012404200000000000000000000000000000000000000000000000000400029000004010020120000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000002000100014020080000000000000000000000000000000000040000002020000080000000000000000000004021044020000000000000000000000000000000000004000000200000000000000000000001004208802000000000000000000000000000000000000800000008000000000000000000000810208810000000000000000000000000400000000400000004000000000000010000014081080000000000000000000000000000000000000000000000000000000000000000000000000000000000000001110040000000000888010000000000000000000000000000000000000000000000000000000000000011402000000000228020000000000000000000000000000000000000000000000000000000004502800000000022809000000000000000000000000000000000000000000001000000000004409400000000110210000000000000000000000000000000000000000002000000000000a500000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800104000000005460080000000000000000000000000000000000000000000000000000000000000008084000000011160900000000000000000000000000000000000000000000000000000000002001000000001116048000000000000000000000000000000000000000000000000000000002008800000010885080000000000000000000000000000000000000000000000000000004220000000508000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400002000b300c000000000000000000000000000000000000000000000000000000000000000000000000400938580000000000000000000000000000000000000000000000000000000000000000000040049c260000000000000000000000000000000000000000000000000000000000002000002010918c00000000000000000000000000000000000000000000000000000000800600018a00000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x20000000000000000a2040001110040000000000888010000020000000028d0040000000000000000000000000a000008101004920091402000000000228020000000000016804000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a90000000000010000800144000000005460080000000000000000000000100081002005022005000000000000000000000008084000400011160900000000000000000000000080400414022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000408204000000000000000400000004338080000000000000000000000000000800000100020a000808001004000000000000000000800103c500000000000000000000000000000000010080020080010020000000000000000000800101e2400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000820100000000000000000000004000020122402440000000010010000000000000000000000000000008884000000000000000000000020012825400000001002000000000000000000000000000002201000000000000000000000000400150a1500000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000080500000000000000000000000000000000004000020122402440000000010010000000000000040002000010000000000000000000000000000000020012025400000001002000000000000100002000008000000000000000000000000000000000400140a15000000000100000000000004000100004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000010000020020020000000a28d80400000000000000000000000000000000000000000000000000000000000000200002001816c0480000000000000000000000000000000000000000000000000000000000001080008002016810200000000000000000000000000000000000000000000000000000000041000000000505010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000080001000800200000002828ac010000000000000000000000000000000000000000000000000000000000008000010002809b0090000000000000000000000000000000000000000000000000000000000020400040002002682100000000000000000000000000000000000000000000000000000002010000000000121408000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000480240000000000000000000000000000000000100000000001449000200000000000000000000000009004400000000000000000000000000000000000000011500240000000000000000000000004809100000000000000000000000000000200000000000114022000000000080000000000002021100000000000000000000000000008000000000008028100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x1000000000000000000000800100000000000000000000000000000122002440000000010010000000000000000000000000000008084000000000000000000000000010025400000001002000000000000000000000000000002001000000000000000000000000000100a150000000001000000000000000000000000000020008000000000000000000000000002a0a8000000000800000000000000000000000000402000000000000000020200000080000000000000000000000000000000000000000000000000000a900000000000000000000000000000000000000000000000000000000001000810020050220050000000000000000000000000000000000000000000000000000000000000000804004140260000000000000000000000000000000000000000000000000000000000400000008100208086000000000000000000000000000000000000000000000000010000080000000140010050600000000000000000000000000000000000000000000000201208800000000000000000000000000000000000000000000000000090000000000000020001000140200800000000000000000000000000000000000400000020200000800000000000000000000040210440200000000000000000000000000000000000040000002000000000000000000000010042088020000000000000000000000000000000000008000000080000000000000000000008102088100000000000000000000000004000000004000000040000000000000100000140810800000000000000000000000004000000000000000000000000000000000000000000000000000000000048020000000002220010000000000000000000000000000000000000000000000000000000000000000900400000000228004000000000000000000000000000000000000000000000000000000000480900000000045002400000000000000000000000000000000000000000008000000000000202900000000044022000000000000000000000000000000000000000000000000000000092400000000a10000000000000000000000000002000001080000108000000000000000000000000000000000000000000000000020000080004001000000231a020000000000000000000000000000000000000000000000000000000000000000010000040083a090000000000000000000000000000000000000000000000000000000000000020000020040e8220000000000000000000000000000000000000000000000000000000000020400080001850400000000000000000000000000000000000000000000000000000000004001880000000000000000000000000000000000010006000000000000000000000000000000000000000000000000040000020002004000000851a01000000000000000000000000000000000000000000000000000000000000000004000200103a04800000000000000000000000000000000000000000000000000000000000000400010004074108000000000000000000000000000000000000000000000000000000000010200400000c28200000000000000000000000000000000000000000000000000000000200188000000000000000000000000000000000002000c0000000000000140252004a20008a1000284c0240100088a222401200400810000010010004010000000040000000100040000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a900008805000480200000040000000054600800000000000000000000001000810020050220050000100400020080309004000000000000111608000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0xa000000000000000000000000000000000000010000020020020000000a28d80400000000000000000000000000000000000000000000000000000000000000200002001816c0480000000000000000000000000000000000000000000000000000000000001080008002016810200000000000000000000000000000000000000000000000000000000041000400000505010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000080001000800200000002828ac010000000000000000000000000000000000000000000000000000000000008000010002809b00900000000000000000000000000000000000000000000000000000000000204000400020026821000000000000000000000000000000000000000000000000000000020100020000001214080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000004000040008001000000002814492002000000000000000000000000000000000000000000000000000000008000001000140115202400000000000000000000000000000000000000000000000000000000102000040000401148220000000000000000000000000000000000000000000000000000010080004000000088281000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000004000020122402440000000010010000000000000000000000000000000000000000000000000000000020012825400000001002000000000000000000000000000000000000000000000000000000000400150a1500000000010000000000000000000000000000000000000000000000020000004000a2a0a800000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000480000000000002000a0000000000000000000000000000000000001000000800904400090000000000000000000000004020800100000000000000000000000000000000020004240114000000000000000000000002000200040000000000000000000000000100000000100041010a000000000000000000000010002000200000000000000000000000100000000400020120500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a204000000000000000000000000000000000000000000000000000000000000000000000a00000810100492008000000000000000000000000000000000000000000000000000000000800000810100249012000000000000000000000000000000000000000000000000000000000520000040800124042000000000000000000000000000000000000000000000000004000290000040100201208000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001110040000000000888010000000000000000000000000000000000000000000000000000000000000011402000000000228020000000000000000000000000000000000000000000000000000000004502800000000022809000000000000000000000000000000000000000000001000000000004409400000000110210000000000000000000000000000000000000000002000000000000a500000000a1000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000004000020122402440000000010010000000000000000000000000000000000000000000000000000000020012025400000001002000000000000000000000000000000000000000000000000000000000400140a150000000001000000000000000000000000000000000000000000000002000000400082a0a800000000080000000000000000000000000000000000000000000002020000008000000000000000000000000000000000000000000)))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0xa00940000000000000000000000000000000000000000000000000000000041000080020040800a124c0400000000000000000000000000000000000000000000000000000000002004080402824e050000000000000000000000000000000000000000000000000000000000020201080202024c104000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014009400000000000000000000000000000000000000000000000000000000000020040004002020809089301000000000000000000000000000000000000000000000000000000000001004101048224c090000000000000000000000000000000000000000000000000000000000040808401020089210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020008a000000000000000000000000000000000000000000000000000000020000000400004000010102048449200800000000000000000000000000000000000000000000000000000008000082408120449202400000000000000000000000000000000000000000000000000000001020010010202022442200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084050403110040000000000000000000000000000000000000000000000000000000000000000028008004204051402000000000000000000000000000000000000000000000000000000000008008002102094502800000000000000000000000000000000000000000000000000000000003402001080214408000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a9000000000001000080014000000000000000000000000000000000000010008100200502200500000000000000000000000808400040000000000000000000000000000000008040041402600000000000000000000000200100008000000000000000000000000004000000081002080860000000000000000000000200080008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001440000000000000000000000010001000000000000000000000000100000161000a2000000000080400000000000000000000000000040210000000000000000000000000064004a8000000010240000000000000000000000000001004200000000000000000000000000019014a8000000008400000000000000000000000000081020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000400000000330080000000000000000000000000000040800012480400000000000000000000000000000000000385000000000000000000000000000400024c0500000000000000000000000000000000000001c2400000000000000000020000000200024810400000000000000000000000020000000001188000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000100000003180200000000000000000000000000000002080008920100000000000000000000000000000000038090000000000000000000000000000100022480900000000000000000000000000000000000e022000000000000000000004000000100008901080000000000000000000000040000000105040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x1060c4c020000004000118045468080000000000000000000000000000000000000000000080000600090440940400000000013031168900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802548000000000000000000000000001180040000000000000000400001801000840b04d0019000000000000000000000000000000000000013011000000000000000000400002200c2d013400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000418604040200000000000000001000000231a020000000000000000000000000000001000008000868009004004040000000000000000040083a09000000000000000000000000000000000002108009002002090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002009640000000000080280000000000000000000000000000004000060100080161200a2000000000080400000000000020020400020000000000000000000000000002000040064804a80000000102400000000000020000200008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000002088890100000000000000000000010000000000a022450080000000000000000000000000000010004422902000000000000000000000200002808aa04800000000000000000000000000000020008822909000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000a2040000000000000000000000000000020000000028d0040000000000000000000000000a000008101004920080000000000000000000000000000016804800000000000000000000008000008101002490120000000000000000000000800000000160102000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050800000000000000000000000000000000000000000000000020000040001010000000008a0a245008000000000000000000000000000000000000000000000000000080000000020000a918aa0480000000000000000000000000000000000000000000000000000008001800008000050c5410800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000480000000000002000000002000820888901400000000000000000000000400000004001000004000000000000000000000000000110404422902800000000000000000000000001000000008000000000000000000000000000042080882290940000000000000000000000000080000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x900000000000000009020000000000000000000000100008045008800000000080000000000000000000000000000000020220400000000000000000000000000544400000000200000000000000000000000000000020200200000000000000000000000000015108000000000800000000000000000000000000000900100000000000000000000000000528100000000040000000000000000000400000004200100000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000004000020122402440000000010010000000000000000000000000000000000000000000000000000000020012025400000001002000000000000000000000000000000000000000000000000000000000400140a150000000001000000000000000000000000000000000000000000000002000000400082a0a8000000000800000000000000000000000000000000000000000000022200000080000000000000000000000000000000000000000000000000000a9000000000000000000000000000000000000000000000000000000000010008100200502200500000000000000000000000000000000000000000000000000000000000000008040041402600000000000000000000000000000000000000000000000000000000004000000081002080860000000000000000000000000000000000000000000000000100000800000001400100506000000000000000000000000000000000000000000010002012088000000000000000000000000000000000000000000001000000000000000000000800100000000000000000000000000000122002440000000010010000000000000000000000000000008084000000000000000000000000010025400000001002000000000000000000000000000002001000000000000000000000000000100a150000000001000000000000000000000000000020008000000000000000000000000002a0a8000000000800000000000000000000000000402000000000000000020200000080000000000000000010000000000000000000000000000000000000000000000048020000000002220010000000000000000000000000000000000000000000000000000000000000000900400000000228004000000000000000000000000000000000000000000000000000000000480900000000045002400000000000000000000000000000000000000000008000000000000202900000000044022000000000000000000000000000000000000000000000000000000092400000000a1000000000000000000000000000200000108200010800000000000000000000000000000400000000000000000000008002220012000000000000000000000000000000002000000400000000000000000000000000000001000228004800000000000000000000000000000000100000000000000000000000000000000400045002480000000000000000000000000000000008000000000000000000000000800000200044022400000000000000000000000000000000400000000000000000000002001800000a1100000000000000000008000000000000000200010908000000000000000000000000000008000000000000000000000000080008880140000000000000000000000000000000000100000400000000000000000000000000000040002280280000000000000000000000000000000000800000000000000000000000000000008000228094000000000000000000000000000000000080000000000000000000000010000008001102140000000000000000000000000000000008000000000000000000000400300000a1200000000000000000004000000000000000800085100000000000000000000000000a900000000000000000000000000000000000000000000000000000000001000810020050220050000000000000000000000000000000000000000000000000000000000000000804004140260000000000000000000000000000000000000000000000000000000000400000008100208086000000000000000000000000000000000000000000000000010000080000000140010050600000000000000000000000000000000000000000000000201208800000000000000000000000000000000040000) + (NatTree.node 8 (NatTree.leaf 0x40000400054604b380800000000000000000000000000000000000000000000000000000000000000000000001916193c500000000000000000000000000000000000000000000000000000000000000000001916149e2400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020008a000000000000000000000000000000000000000000000000000000020000000400004000010102048449200800000000000000000000000000000000000000000000000000000008000082408120449202400000000000000000000000000000000000000000000000000000001020010810202022442200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084050403110040000000000000000000000000000000000000000000000000000000000000000028008004204051402000000000000000000000000000000000000000000000000000000000008008002102094502800000000000000000000000000000000000000000000000000000000003402001080214408400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000800441223004800000000000000000000000000000000000000000000000000000000000000000000009021108b008800000000000000000000000000000000000000000000000000000000000000044084422c09100000000000000000000000000000000000000000000000000000000000400110081011421100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000001000882222401200000000000000000000000000000000000000000000000000000000000000000000024108822880480000000000000000000000000000000000000000000000000000000000000009042204510248000000000000000000000000000000000000000000000000000000000080024020404502240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000200082088890140000000000000000000000000000000000000000000000000000000000000000000011040442290280000000000000000000000000000000000000000000000000000000000000004208088229094000000000000000000000000000000000000000000000000000000000010008808081142140000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002220040400000000b3008000000000000000000000000000000000000000000000000000000000000008a00800000000938500000000000000000000000000000000000000000000000000000000002280900000000049c24000000000000000000000000000000000000000000000040000000001102300000001091800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010800000000000000000000000400002000b300c000000000000000000000000000000008000100002000000000000000000000000000000400938580000000000000000000000000000000200008000000000000000000000000000000040049c260000000000000000000000000000000200002000000000000000000000002000002010918c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x20911804040000400054604b380800000000000000000000000000000000000000000000000000010002411602000000001916193c50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002009640000000000080280000000010001000000000000000004000060100080161200a20000000000804000000000000200204000200000402100000000000000000020000400648048800000001024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200140000000000000004002220048400000000b3008000000000000000004000008000004080001248040000000000000000020008a008800000009385000000000000000000002000000400024c0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014800000000001000048001000408002284b380c00000000000000000000000000100000804010000200000000000000000000002000008842993c5800000000000000000000000000001002000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000209118040000000000000000000020000000a28d80400000000000000000000000000000000000010002411602000000000000000000002001816c0480000000000000000000000000000000000800120458280000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008025480000000000002000a0000000000000000000000000000000400001801000840b04d0019000000000000000000000000402080010000000000000000000000000000400002200c2d0134000000000000000000000002000200040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000004122300400000000000000000000200000002828ac01000000000000000000000000000000000001001108b008000000000000000000010002809b00900000000000000000000000000000000004004422c0900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000008222240100000000000000000000100000000281449200200000000000000000000000000000000400882288040000000000000000000100014011520240000000000000000000000000000000100220451024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)))))) + (NatTree.node 72 (NatTree.node 32 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x41860404020000000000000000000000000000000000000000000000000000000000010000080008680090040040400000000000000000000000000000000000000000000000000000000000021080090020020900000000000000000000000000000000000000000000000000000000040001024022010002100000000000000000000000000000000000000000000000000400020020044100820000400000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000001180040000000000000000000000000000000904400090000000000000000000000000000000000000130110000000000000000000000000004240114000000000000000000000000000000000000026011000000000000000100000000000041010a000000000000000000000000040000000000205080000000000000000000000000020120500000000000000000000000000000000048400000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000004000020122402440000000010010000000000000000000000000000000000000000000000000000000020012025400000001002000000000000000000000000000000000000000000000000000000000400140a150000000001000000000000000000000000000000000000000000000002000000400082a0a8000000000800000000000000000000000000000000000000000100022200000080000000000000000000000000000000000000000000000002004a00000000000000000000000000000000000000000000000000000100000080081000101022804000000000000000000000000000000000000000000000000000000000002000080040415024000000000000000000000000000000000000000000000000000000000040010400800020a084000000000000000000000000000000000000000000000000010000000040800040011050400000000000000000000000000000000000000000001000201208000000000000000000000000000000000000000000000000000000000000000000080010400000000546008000000000000000000000000000000000000000000000000000000000000000808400000001116090000000000000000000000000000000000000000000000000000000000200100000000111604800000000000000000000000000000000000000000000000000000000200880000001088508000000000000000000000000000000000000000000000000000000422000000050800000000000000000000000000080000010000040000000000000000000000009000000000000000000000000000000000000000000000004000020122402440000000010010000000000000000000000000000000000000000000000000000000020012025400000001002000000000000000000000000000000000000000000000000000000000400140a150000000001000000000000000000000000000000000000000000000002000000400082a0a80000000008000000000000000000000000000000000000000000000222000000800000000000000000000000000000000000200000000a000008009400000000000209118040000000010000020020020000000a28d8040001000000020040800a124c0400000000000000241160200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000480000100094000000000000004122300400000000080001000800200000002828ac01000004000000202080908930100000000000001108b008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x80000000000000084050403110040000000000000000000000000200000000028a8010000000000000000000000002800800420405140200000000000000000000000000000009a009000000000000000000000008008002102094502000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002009640000000000000000000000010401000000000000000004000060100080161200a2000000000080400000000000000000000000000044210000000000000000002000040064c04a80000000102400000000000000000000000000011042000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002009640000000000000000000000000000000000000000000004000060100080161200a2000000000080400000000000000000000000000000000000000000000000002000040064804a80000000102400000000000000000000000000000000000000000000000000040000800194148800000000840000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000820100000000000000000000004000020122402440000000010010000000000000000000000000000008884000000000000000000000020012825400000001002000000000000000000000000000002201000000000000000000000000400150a15000000000100000000000000000000000000002800800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002220040400000000b3008000000000000000000000000000000000000000000000000000000000000008a00800000000938500000000000000000000000000000000000000000000000000000000002280900000000049c2400000000000000000000000000000000000000000000004000000000110230000000109188000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000004000000051801000000000000000000000000000000010200044900080000000000000000000000000000003804800000000000000000000000000040800044900240000000000000000000000000000000070108000000000000000000002000001020002240220000000000000000000000200000000828200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000010a000000000000000000000000000000100008045008800000000080000000000000000800010000308002000000000000000000000000000000000504400000000200000000000000000020000c200420000000000000000000000000000000000141080000000008000000000000000020000308081000000000000000000000000000000004281000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000111004800000000000000000000000000000000000100000000000022440080000000000000000000001140220000000000000000000000000000000000000000008a804800000000000000000000004502880000000000000000000000000000008000000000004501080000000001000000000004408440000000000000000000000000000400000000000200a0800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x80010400000000546008000000000000000000000000000000000000000000000000000000000000000808400000001116090000000000000000000000000000000000000000000000000000000000200100000000111604800000000000000000000000000000000000000000000000000000000200880000001088508000000000000000000000000000000000000000000000000000000422000000050800000000000000000000000000080000010000042000000000000000000000009000000000000000000000000000000000000000000000004000020122402440000000010010000000000000000000000000000000000000000000000000000000020012025400000001002000000000000000000000000000000000000000000000000000000000400140a150000000001000000000000000000000000000000000000000000000002000000400082a0a8000000000800000000000000000000000000000000000000000000022200000080000000000000000000000000000000400020000000000001000000000000000000000800100000000000000000000000000000122002440000000010010000000000000000000000000000008084000000000000000000000000010025400000001002000000000000000000000000000002001000000000000000000000000000100a150000000001000000000000000000000000000020008000000000000000000000000002a0a8000000000800000000000000000000000000402000000000000000020200000080000000000000000010000000000000400020000000000002004a00000000000000000000000000000000000000000000000000000100000080081000101022804000000000000000000000000000000000000000000000000000000000002000080040415024000000000000000000000000000000000000000000000000000000000040010400800020a0840000000000000000000000000000000000000000000000000100000000408000400110504000000000000000000000000000000000000000000010002012080000000000000000000000000000000004000000000000000a90000000000000000000000000000000000000000000000000000000000100081002005022005000000000000000000000000000000000000000000000000000000000000000080400414026000000000000000000000000000000000000000000000000000000000040000000810020808600000000000000000000000000000000000000000000000001000008000000014001005060000000000000000000000000000000000000000000100020120880000000000000000000000000000000044000000000000200140000008405040311004000000400000000b30080000000000000000040000080000040800012480400002800800420405140200000000000009384000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084c020000000862224030002004000000851a01000000000000000000000000000000000000200000400940400040088228804004000200103a0480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001060c4c020000000000000000000004000000851a01000000000000000000000000000000080000600090440940400000000000000000000200103a048000000000000000000000000000000010000904204a09000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x2009640000000000000000000000000000000000000000000004000060100080161200a2000000000080400000000000000000000000000000000000000000000000002000040064804a8000000010240000000000000000000000000000000000000000000000000004000080019414a800000000840000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020014000000000000000400222004800000000000000000000000000000004000008000004080001248040000000000000000020008a008800000000000000000000000000000002000000400024c05000000000000000000080022809100000000000000000000000000000002020000020002481040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084c020000000000000000000004000000851a01000000000000000000000000000000000000200000400940400000000000000000000200103a048000000000000000000000000000000000000004004a0900000000000000000000010004074108000000000000000000000000008000020000000242100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010800000000000000000000000400002000b300c000000000000000000000000000000008000100002000000000000000000000000000000400938580000000000000000000000000000000200008000000000000000000000000000000040049c260000000000000000000000000000000200002000000000000000000000002000002010918c00000000000000000000000000000008001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088050004802000000000000000000000000000000000000000000000000000000000000000001004000200803090040000000000000000000000000000000000000000000000000000000004010000200811848090000000000000000000000000000000000000000000000000000000002900400010010c202100000000000000000000000000000000000000000000000000100010800400080018090000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000010000020020020000000a28d80400000000000000000000000000000000000000000000000000000000000000200002001816c0480000000000000000000000000000000000000000000000000000000000001080008002016810200000000000000000000000000000000000000000000000000000000041000400000505010000000000000000000000000000000000000000000000000000000014400000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000080001000800200000002828ac010000000000000000000000000000000000000000000000000000000000008000010002809b0090000000000000000000000000000000000000000000000000000000000020400040002002682100000000000000000000000000000000000000000000000000000002010002000000121408000000000000000000000000000000000000000000000000000004840000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000400004000800100000000281449200200000000000000000000000000000000000000000000000000000000800000100014011520240000000000000000000000000000000000000000000000000000000010200004000040114822000000000000000000000000000000000000000000000000000001008000400000008828100000000000000000000000000000000000000000000000000022100000000000000000000000000000000000000000000))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x1110040000000000888010000000000000000000000000000000000000000000000000000000000000011402000000000228020000000000000000000000000000000000000000000000000000000004502800000000022809000000000000000000000000000000000000000000001000000000004409400000000110210000000000000000000000000000000000000000002000000000000a500000000a1000000000000000000000000000100000440000080000000000000000000000000000000000000000000000800104000000005460080000000000000000000000000000000000000000000000000000000000000008084000000011160900000000000000000000000000000000000000000000000000000000002001000000001116048000000000000000000000000000000000000000000000000000000002008800000010885080000000000000000000000000000000000000000000000000000004220000000508000000000000000000000000000800000104000420000000000000000000000000000000000000000000000000000000400002000b300c000000000000000000000000000000000000000000000000000000000000000000000000400938580000000000000000000000000000000000000000000000000000000000000000000040049c260000000000000000000000000000000000000000000000000000000000002000002010918c00000000000000000000000000000000000000000000000000000000800600018a0000000000000000000000000000000000020008c8000000000000000000009000000000000000000000000000000000000000000000004000020122402440000000010010000000000000000000000000000000000000000000000000000000020012025400000001002000000000000000000000000000000000000000000000000000000000400140a150000000001000000000000000000000000000000000000000000000002000000400082a0a8000000000800000000000000000000000000000000000000000000022200000080000000000000000000000000000000408020000000000120000020008a0000000000000000082222401000000004000040008001000000002a1449200600004000010102048449200800000000000882288040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000084050403110040000000000000000000000000200000000028a8010000000000000000000000002800800420405140200000000000000000000000000000009a009000000000000000000000008008002102094502800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002091180400000002088890100000000000000000000000000000000000000000000000000000000100024116020001000442290200000000000000000000000000000000000000000000000000080012045828000000088229090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802548000000000000000000000000000000000000000000000000400001801000840b04d0019000000000000000000000000000000000000000000000000000000000000400002200c2d01340000000000000000000000000000000000000000000000000000000001000820001000c3411200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x480000000000002000a0000000000000000000000000000000000001000000800904400090000000000000000000000004020800100000000000000000000000000000000020004240114000000000000000000000002000200040000000000000000000000000100000000100041010a00000000000000000000001000200020000000000000000000000010000000040002012050000000000000100000000400800800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800209118048000000000000000000000000000000000000000000000000000000000000000000000110002411602200000000000000000000000000000000000000000000000000000000000000108001204582880000000000000000000000000000000000000000000000000000000001000088000804508440000000000000000000000000000000000000000000000000000002000020040010a104000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000010000020020020000000a28d80400000000000000000000000000000000000000000000000000000000000000200002001816c048000000000000000000000000000000000000000000000000000000000000108000800201681020000000000000000000000000000000000000000000000000000000004100040000050501000000000000000000000000000000000000000000000000000002001440000000000000000000000000000000000000000000000000000090000000000000000902000000000000000000000010000804500880000000008000000000000000000000000000000002022040000000000000000000000000054440000000020000000000000000000000000000002020020000000000000000000000000001510800000000080000000000000000000000000000090010000000000000000000000000052810000000004000000000000000000040000000420010000000000000000000044000080000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000080001000800200000002828ac010000000000000000000000000000000000000000000000000000000000008000010002809b00900000000000000000000000000000000000000000000000000000000000204000400020026821000000000000000000000000000000000000000000000000000000020100020000001214080000000000000000000000000000000000000000000000000200048400000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000004000040008001000000002814492002000000000000000000000000000000000000000000000000000000008000001000140115202400000000000000000000000000000000000000000000000000000000102000040000401148220000000000000000000000000000000000000000000000000000010080004000000088281000000000000000000000000000000000000000000000010000221000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000004000020122402440000000010010000000000000000000000000000000000000000000000000000000020012825400000001002000000000000000000000000000000000000000000000000000000000400150a1500000000010000000000000000000000000000000000000000000000020000004000a2a0a80000000008000000000000000000000000000000000000000000000222000000800000000000000000000000000000000000000000000000000000009000000000000002000100014020080000000000000000000000000000000000040000002020000080000000000000000000004021044020000000000000000000000000000000000004000000200000000000000000000001004208802000000000000000000000000000000000000800000008000000000000000000000810208810000000000000000000000000400000000400000004000000000000010000014081080000000000000000000000000400000004000204040000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x8800000000000000004000118045468080000000000000000000000002000000040000400001010000040000000000000000000013031168900000000000000000000000000000000800008040000040000000000000000000002605116848000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802548000000000000000000000000000000000000000000000000400001801000840b04d0019000000000000000000000000000000000000000000000000000000000000400002200c2d01340000000000000000000000000000000000000000000000000000000001000820001000c3411a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a00940000000000000000000000000000000000000000000000100000100041000080020040800a124c0400000000000000000000000000000000000000000000000001000000002004080402824e050000000000000000000000000000000000000000000000000000400000020201000202024c104000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034009400000000000000000000000000000000000000000000000000400000100020040004002020809089301000000000000000000000000000000000000000000000000008000000001004101048224c090000000000000000000000000000000000000000000000000000800000040808001020089210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000004000000005460080000000000000000000000000081000001022004000000000000000000000000000000000011160900000000000000000000000080000414024000000000000000000000000000000000001116048000000000000000040000000800020808400000000000000000000000008000000010885080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040001180454680800000000000000000000000000000000000000000000000000000000000000000000000130311689000000000000000000000000000000000000000000000000000000000000000000026051168480000000000000000000000000000000000000000000000000000004000080004020508a50800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088050004802000000000000000000000000000000000000000000000000000000000000000001004000200803090040000000000000000000000000000000000000000000000000000000004010000200811848090000000000000000000000000000000000000000000000000000000002900400010010c202100000000000000000000000000000000000000000000000000100010800400080018090400000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000480240000000000000000000000000000000000100000000001449000200000000000000000000000009004400000000000000000000000000000000000000011500240000000000000000000000004809100000000000000000000000000000200000000000114022000000000080000000000002021100000000000000000000000000008000000000008028100000000000000400000000904100000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x418604040200000000000000000000000000000000000000000000000000000000000100000800086800900400404000000000000000000000000000000000000000000000000000000000000210800900200209000000000000000000000000000000000000000000000000000000000400010240220100021000000000000000000000000000000000000000000000000004000200200441008200004000000000000000000000000000000000000002001000080000000000000000000000000000000000000000000000000001110040000000000888010000000000000000000000000000000000000000000000000000000000000011402000000000228020000000000000000000000000000000000000000000000000000000004502800000000022809000000000000000000000000000000000000000000001000000000004409400000000110210000000000000000000000000000000000000000002000000000000a500000000a10000000000000000000000000001000004400000840000000000000000000a000000000000000000000000000000000000010000020020020000000a28d80400000000000000000000000000000000000000000000000000000000000000200002001816c0480000000000000000000000000000000000000000000000000000000000001080008002016810200000000000000000000000000000000000000000000000000000000041000400000505010000000000000000000000000000000000000000000000000000020014400000000000000000000000000000000000000100000000000000480000000000000000000000000000000000000000080001000800200000002828ac010000000000000000000000000000000000000000000000000000000000008000010002809b009000000000000000000000000000000000000000000000000000000000002040004000200268210000000000000000000000000000000000000000000000000000000201000200000012140800000000000000000000000000000000000000000000000002000484000000000000000000000000000000000000020000000000000120000000000000000000000000000000000000000000040000400080010000000028144920020000000000000000000000000000000000000000000000000000000080000010001401152024000000000000000000000000000000000000000000000000000000001020000400004011482200000000000000000000000000000000000000000000000000000100800040000000882810000000000000000000000000000000000000000000000100002210000000000000000000000000000000000008000000000008000000000000000000001000008001000400000284b380800000200000002828ac0100000000000000000000000000000000000000000002000000802993c5000000010002809b009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000880500048020000000000000000000000000004000020122402440000000010010000000000010040002008030900400000000000000000000000000020012025400000001002000000000040100002008118480800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020911804000000020888901000000000000000000000000000000000000000000000000000000001000241160200010004422902000000000000000000000000000000000000000000000000000800120458280002000882290900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x10009400000000000000000000000000000000000000000000000000000000000000040000002020809089301000000000000000000000000000000000000000000000000000000000000004101048224c090000000000000000000000000000000000000000000000000000000000040008401020089210800000000000000000000000000000000000000000000000004000004004080020044120800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001060c4c0200000000000000000000000000000000000000000000000000000000000000000800006000904409404000000000000000000000000000000000000000000000000000000000000010000904204a0900000000000000000000000000000000000000000000000000000000048000020022010242100000000000000000000000000000000000000000000000000000020000040100822090400000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000010000020020020000000a28d80400000000000000000000000000000000000000000000000000000000000000200002001816c0480000000000000000000000000000000000000000000000000000000000001080008002016810200000000000000000000000000000000000000000000000000000000041000400000505010000000000000000000000000000000000000000000000000000020014500000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000080001000800200000002828ac010000000000000000000000000000000000000000000000000000000000008000010002809b009000000000000000000000000000000000000000000000000000000000002040004000200268210000000000000000000000000000000000000000000000000000000201000200000012140800000000000000000000000000000000000000000000000002000484800000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000040000400080010000000028144920020000000000000000000000000000000000000000000000000000000080000010001401152024000000000000000000000000000000000000000000000000000000001020000400004011482200000000000000000000000000000000000000000000000000000100800040000000882810000000000000000000000000000000000000000000000100002211000000000000000000000000000000000000000000000000000008000000000000000000000000001180040000000000000000000000000000000904400090000000000000000000000000000000000000130110000000000000000000000000004240114000000000000000000000000000000000000026011000000000000000100000000000041010a000000000000000000000000040000000000205080000000000000000000000000020120500000000000000000000000000000000048400000000000000090010000000000000000000000000000000000000000000000001440000000000000000000000000000000000000000000000000000100000161000a2000000000080400000000000000000000000000000000000000000000000000000000064004a8000000010240000000000000000000000000000000000000000000000000000000000019014a80000000084000000000000000000000000000000000000000002000000000000000c0a8540000000004000000000000000000000000000000000000000000342100000010000000000000000000000000000000000000000000000000000000000a204000000000000000000000000000000000000000000000000000000000000000000000a000008101004920080000000000000000000000000000000000000000000000000000000008000008101002490120000000000000000000000000000000000000000000000000000000005200000408001240420000000000000000000000000000000000000000000000000040002900000401002012080000000000000000000000000000000000080020040a0000000000000000000000000000))))) + (NatTree.node 40 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x900000000088050004802000000000000000000000000000400002012240244000000001001000000000001004000200803090040000000000000000000000000002001202540000000100200000000004010000200811848090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002009640000000000000000000000000000000000000000000004000060100080161200a2000000000080400000000000000000000000000000000000000000000000002000040064c04a8000000010240000000000000000000000000000000000000000000000000004000080019614a8000000008400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a00940000000000000000000000000000000000000000000000100000100041000080020040800a124c0400000000000000000000000000000000000000000000000001000000002004080402824e050000000000000000000000000000000000000000000000000000400000020201080202024c104000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034009400000000000000000000000000000000000000000000000000400000100020040004002020809089301000000000000000000000000000000000000000000000000008000000001004101048224c0900000000000000000000000000000000000000000000000000008000000408084010200892108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000408204000000000000000400000004338080000000000000000000000000000800000100020a000808001004000000000000000000800103c500000000000000000000000000000000010080020080010020000000000000000000800101e240000000000000000000000000000000020420010040000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000001050000000000000000000000000000000010000202450044000000000040000000000000001000040001844002000000000000000000000000000020050228000000000400000000000000000100001844011000000000000000000000000000000800a082800000000040000000001000000040000c101080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000002100800000000000000000000010000202450044000000000040000000000000000000000000000000041208000000000000000000000020054228000000000400000000000000000000000000000020802000000000000000000000000800a8828000000000400000000000000000000000000001200200000000000000004000008002940a0000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800940000000000000000000000000000000000000000000000000000000001000000020040800a124c0400000000000000000000000000000000000000000000000000000000000004080402824e050000000000000000000000000000000000000000000000000000000000020001080202024c1040000000000000000000000000000000000000000000000000080000200101000100241820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x1110040000000000888010000000000000000000000000000000000000000000000000000000000000011402000000000228020000000000000000000000000000000000000000000000000000000004502800000000022809000000000000000000000000000000000000000000001000000000004409400000000110210000000000000000000000000000000000000000002000000000000a500000000a10000000000000000000000000001000004408000840000000000000000000a000000000000000000000000000000000000010000020020020000000a28d80400000000000000000000000000000000000000000000000000000000000000200002001816c0480000000000000000000000000000000000000000000000000000000000001080008002016810200000000000000000000000000000000000000000000000000000000041000400000505010000000000000000000000000000000000000000000000000000020014400000000000000000000000000000000001000100000000000000480000000000000000000000000000000000000000080001000800200000002828ac010000000000000000000000000000000000000000000000000000000000008000010002809b00900000000000000000000000000000000000000000000000000000000000204000400020026821000000000000000000000000000000000000000000000000000000020100020000001214080000000000000000000000000000000000000000000000000200048400000000000000000000000000000000040002000000000000012000000000000000000000000000000000000000000004000040008001000000002814492002000000000000000000000000000000000000000000000000000000008000001000140115202400000000000000000000000000000000000000000000000000000000102000040000401148220000000000000000000000000000000000000000000000000000010080004000000088281000000000000000000000000000000000000000000000010000221000000000000000000000000000000008000800000000000009000000000000000000000000000000000000000000000004000020122402440000000010010000000000000000000000000000000000000000000000000000000020012025400000001002000000000000000000000000000000000000000000000000000000000400140a150000000001000000000000000000000000000000000000000000000002000000400082a0a800000000080000000000000000000000000000000000000000010002220000008000000000000000000000000000000050802000000000000000000000004186040402000000000000000000000000000000000000000000000000000000000001000008000868009004004040000000000000000000000000000000000000000000000000000000000002108009002002090000000000000000000000000000000000000000000000000000000004000102402201000210000000000000000000000000000000000000000000000000040002002004410082000040000000000000000000000000000000000000020010000800000000000000000000000400000009000000000000001000040008004000009045468080000004000020122402440000000010010000000000000000000000000000000400000001231168900000000020012825400000001002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000408204000000000040000400054604b38080000000000000000000000000000800000100020a000808001004000000000000000001916193c5000000000000000000000000000000000100800200800100200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x1440000000000000000000000000000000000000000000000000000100000161000a2000000000080400000000000000000000000000000000000000000000000000000000064004a8000000010240000000000000000000000000000000000000000000000000000000000019014a80000000084000000000000000000000000000000000000000002000000000000000c0a854000000000400000000000000000000000000000000000000000034210000001000000000000000000000000000000800080000000008025480000000000002000a0000000001180040000000000000000400001801000840b04d0019000000000000000000000000402080010000013011000000000000000000400002200c2d012400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000048001000408002284b380c00000000000000000000000000000000000000000000000000000000000000002000008842993c580000000000000000000000000000000000000000000000000000000000008000010842949e26000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000144000000000000020000880004001040080231a030000000000000000000000000000010001040040001000000000000000000000010000244083a098000000000000000000000000000002001000010000000000000000000000020000222040e82300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000400080040000090454680800000000000000000000000000000000000000000000000000000000000000004000000012311689000000000000000000000000000000000000000000000000000000000001000000002451168480000000000000000000000000000000000000000000000000000000004280004000508a5080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000880004001040080231a030000000000000000000000000000000000000000000000000000000000000000010000244083a098000000000000000000000000000000000000000000000000000000000000020000222040e823000000000000000000000000000000000000000000000000000000000002040088200185060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000009020000000000000000000000100008045008800000000080000000000000000000000000000000020220400000000000000000000000000544400000000200000000000000000000000000000020200200000000000000000000000000015108000000000800000000000000000000000000000900100000000000000000000000000528100000000040000000000000000000400000004200100000000000000000000440000800000000000400000002000000000000000000000000000000000000000000000000a204000000000000000000000000000000000000000000000000000000000000000000000a000008101004920080000000000000000000000000000000000000000000000000000000008000008101002490120000000000000000000000000000000000000000000000000000000005200000408001240420000000000000000000000000000000000000000000000000040002900000401002012080000000000000000000000000000000000080020040a1000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x88a04000000000000000000002000000004008000000008000000000000000000400000000010100420020080200000000000000000000000010400000004000000000000000000000000080401080020081100000000000000000000000000810000000040000000000000000000000010210048001001080000000000000000000000020200000001000000000000000800001010108084000800100000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000004802400000000000000000000000000000000001000000000014490002000000000000000000000000090044000000000000000000000000000000000000000115002400000000000000000000000048091000000000000000000000000000002000000000001140220000000000800000000000020211000000000000000000000000000080000000000080281000000000000004000000009041000000000000000000000000221000000000000000000000000000000000000000000000000000000000000000a204000000000000000000000000000000000000000000000000000000000000000000000a000008101004920080000000000000000000000000000000000000000000000000000000008000008101002490120000000000000000000000000000000000000000000000000000000005200000408001240420000000000000000000000000000000000000000000000000040002900000401002012080000000000000000000000000000000000080420040a100000000000000000000000000000000000008000000000000000000000000001180040000000000000000000000000000000904400090000000000000000000000000000000000000130110000000000000000000000000004240114000000000000000000000000000000000000026011000000000000000100000000000041010a0000000000000000000000000400000000002050800000000000000000000000000201205000000000000000000000000000000000484000000000000000900100000000000000000000082000000000000000000000a000000000000000000000000000000000000010000020020020000000a28d80400000000000000000000000000000000000000000000000000000000000000200002001816c0480000000000000000000000000000000000000000000000000000000000001080008002016810200000000000000000000000000000000000000000000000000000000041000400000505010000000000000000000000000000000000000000000000000000020014400000000000000000000000000000000001000180000000000000480000000000000000000000000000000000000000080001000800200000002828ac010000000000000000000000000000000000000000000000000000000000008000010002809b00900000000000000000000000000000000000000000000000000000000000204000400020026821000000000000000000000000000000000000000000000000000000020100020000001214080000000000000000000000000000000000000000000000000200048400000000000000000000000000000000040003000000000000012000000000000000000000000000000000000000000004000040008001000000002814492002000000000000000000000000000000000000000000000000000000008000001000140115202400000000000000000000000000000000000000000000000000000000102000040000401148220000000000000000000000000000000000000000000000000000010080004000000088281000000000000000000000000000000000000000000000010000221000000000000000000000000000000008000c00000000000009000000000000000000000000000000000000000000000004000020122402440000000010010000000000000000000000000000000000000000000000000000000020012825400000001002000000000000000000000000000000000000000000000000000000000400150a1500000000010000000000000000000000000000000000000000000000020000004000a2a0a800000000080000000000000000000000000000000000000000000002220000008000000000000000000000000000000040802000000) + (NatTree.leaf 0x8800000000000000004000118045468080000000000000000000000002000000040000400001010000040000000000000000000013031168900000000000000000000000000000000800008040000040000000000000000000002605116848000000000000000000000000000000100001001000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000008001000400000284b380800000000000000000000000000000000000000000000000000000000000000002000000802993c500000000000000000000000000000000000000000000000000000000000008000000802949e24000000000000000000000000000000000000000000000000000000000010600008005099880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000111004800000000000000000000000000000000000100000000000022440080000000000000000000001140220000000000000000000000000000000000000000008a804800000000000000000000004502880000000000000000000000000000008000000000004501080000000001000000000004408440000000000000000000000000000400000000000200a08000000002000020000000a1040000000000000000000000000000000000000000000000000000000000000000000000000000480000000000002000a0000000000000000000000000000000000001000000800904400090000000000000000000000004020800100000000000000000000000000000000020004240114000000000000000000000002000200040000000000000000000000000100000000100041010a000000000000000000000010002000200000000000000000000000100000000400020120500000000000001000000004008008000000000000000000000090410000000000000000000000000000000000000000000000000000000000000a204000000000000000000000000000000000000000000000000000000000000000000000a000008101004920080000000000000000000000000000000000000000000000000000000008000008101002490120000000000000000000000000000000000000000000000000000000005200000408001240420000000000000000000000000000000000000000000000000040002900000401002012080000000000000000000000000000000000080420040a10000000000000000000000002000000000000020008a00000000000000000040000020002004000000851a01000000000002000000040000400001010204844920080000000000000000000004000200103a04800000000000000000000800008040812044920240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000400000000330080000000000000000000000000000040800012480400000000000000000000000000000000000385000000000000000000000000000400024c0500000000000000000000000000000000000001c2400000000000000000020000000200024810400000000000000000000000020000000001188000000000000800002000000001002018200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000100000003180200000000000000000000000000000002080008920100000000000000000000000000000000038090000000000000000000000000000100022480900000000000000000000000000000000000e022000000000000000000004000000100008901080000000000000000000000040000000105040000000000000400000400000002004012080000000000000000000000000000000000000000000000000000000000000000000000000000000000)))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0xa000000000000000000000000000000000000010000020020020000000a28d80400000000000000000000000000000000000000000000000000000000000000200002001816c048000000000000000000000000000000000000000000000000000000000000108000800201681020000000000000000000000000000000000000000000000000000000004100040000050501000000000000000000000000000000000000000000000000000002001450000000000000000000000000000000000100018800000000000090000000000000000902000000000000000000000010000804500880000000008000000000000000000000000000000002022040000000000000000000000000054440000000020000000000000000000000000000002020020000000000000000000000000001510800000000080000000000000000000000000000090010000000000000000000000000052810000000004000000000000000000040000000420010000000000000000000044000080000000000040000000200000000000000101004000000000000480000000000000000000000000000000000000000080001000800200000002828ac010000000000000000000000000000000000000000000000000000000000008000010002809b00900000000000000000000000000000000000000000000000000000000000204000400020026821000000000000000000000000000000000000000000000000000000020100020000001214080000000000000000000000000000000000000000000000000200048480000000000000000000000000000000040003200000000000012000000000000000000000000000000000000000000004000040008001000000002814492002000000000000000000000000000000000000000000000000000000008000001000140115202400000000000000000000000000000000000000000000000000000000102000040000401148220000000000000000000000000000000000000000000000000000010080004000000088281000000000000000000000000000000000000000000000010000221100000000000000000000000000000008000c40000000012009480094200040a284022911804802000822888901404008040000008004020401000000100100000010020a000000001004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020008a00000000000000000040000020002004000000851a01000000000002000000040000400001010204844920080000000000000000000004000200103a048000000000000000000008000082408120449202400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200082a2244101000000231a020000000000000000000000000000000000000000000000000000000004008822890400040083a090000000000000000000000000000000000000000000000000000010022045122400000040e82200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000418604040200000000000000001000000231a020000000000000000000000000000001000008000868009004004040000000000000000040083a090000000000000000000000000000000000021080090020020900000000000000000020040e822000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x200040a204000000000000000000000000000000000000000000000000000000000800000100020a000808101484928080000000000000000000000000000000000000000000000000000001008002028101482494120000000000000000000000000000000000000000000000000000000205200100408041248420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000080500000000000000000000000000000000004000020122402440000000010010000000000000040002000010000000000000000000000000000000020012025400000001002000000000000100002000008000000000000000000000000000000000400140a150000000001000000000000040001000040000000000000000000000002000000400082a0a8000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a90000000000010000800140000000000000000000000000000000000000100081002005022005000000000000000000000008084000400000000000000000000000000000000080400414026000000000000000000000002001000080000000000000000000000000040000000810020808600000000000000000000002000800080000000000000000001000008000000014001005060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090000000010a000000000000000000000000000000100008045008800000000080000000000000000800010000308002000000000000000000000000000000000504400000000200000000000000000020000c2004200000000000000000000000000000000001410800000000080000000000000000200003080810000000000000000000000000000000042810000000004000100000000000008001809010000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000002100800000000000000000000010000202450044000000000040000000000000000000000000000000041208000000000000000000000020054228000000000400000000000000000000000000000020802000000000000000000000000800a8828000000000400000000000000000000000000001200200000000000000004000008002940a0000000002000000000000000000010000000840080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002220040400000000b3008000000000000000000000000000000000000000000000000000000000000008a00800000000938500000000000000000000000000000000000000000000000000000000002280900000000049c240000000000000000000000000000000000000000000000400000000011023000000010918800000000000000000000000000000000000000000001000000000028c000000180000000000000000000000000000000000000000000000000000000000000000000000000001060c4c0200000000000000000000000000000000000000000000000000000000000000000800006000904409404000000000000000000000000000000000000000000000000000000000000010000904204a09000000000000000000000000000000000000000000000000000000000480000200220102421000000000000000000000000000000000000000000000000000000200000401008220904000000000000000000000000000000000000020001010800000000000000000000000000000000000000000000000800209118048000000000000000000000000000000000000000000000000000000000000000000000110002411602200000000000000000000000000000000000000000000000000000000000000108001204582880000000000000000000000000000000000000000000000000000000001000088000804508440000000000000000000000000000000000000000000000000000002000020040010a1040000000000000000000000000000000000010000044820000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x140000000000000000000000000000100000003180200000000000000000000000000000002080008920100000000000000000000000000000000038090000000000000000000000000000100022480900000000000000000000000000000000000e02200000000000000000000400000010000890108000000000000000000000004000000010504000000000000040000040000000200401208000000000000000000000000018800000000000000000000000000000000000000000000000000000000000000000000088a04000000000000000000002000000004008000000008000000000000000000400000000010100420020080200000000000000000000000010400000004000000000000000000000000080401080020081100000000000000000000000000810000000040000000000000000000000010210048001001080000000000000000000000020200000001000000000000000800001010108084000800100000000000000000004400020000000000000000000000000000000000000000000000000000000000000000000088050004802000000000000000000000000000000000000000000000000000000000000000001004000200803090040000000000000000000000000000000000000000000000000000000004010000200811848090000000000000000000000000000000000000000000000000000000002900400010010c2021000000000000000000000000000000000000000000000000001000108004000800180904000000000000000000000000000000040004000400450000000000000000000000000000000000000000000000000000000000200082a2244101000000231a020000000000000000000000000000000000000000000000000000000004008822890400040083a090000000000000000000000000000000000000000000000000000010022045122400020040e822000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000084050403110040000000000000000000000000200000000028a8010000000000000000000000002800800420405140200000000000000000000000000000009a0090000000000000000000000080080021020945028000000000000000000000400000000002602100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802548000000000000000000000000000000000000000000000000400001801000840b04d8019000000000000000000000000000000000000000000000000000000000000400002300c2d81340000000000000000000000000000000000000000000000000000000001000830001000c3611a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000002088890100000000000000000000010000000000a022450080000000000000000000000000000010004422902000000000000000000000200002808aa048000000000000000000000000000000200088229090000000000000000080000800004045410800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000144000000000000020000880004001040080231a030000000000000000000000000000010001040040001000000000000000000000010000244083a098000000000000000000000000000002001000010000000000000000000000020000222040e823000000000000000000000000000008000400008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x2004a90000000000000000000000000000000000000000000000000000100000180081002105022805000000000000000000000000000000000000000000000000000000000002000080440415026000000000000000000000000000000000000000000000000000000000040010400810020a0860000000000000000000000000000000000000000000000000100000800408001400110506000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000400000005180100000000000000000000000000000001020004490008000000000000000000000000000000380480000000000000000000000000004080004490024000000000000000000000000000000007010800000000000000000000200000102000224022000000000000000000000020000000082820000000000000008000020000080200200904000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000800441223004800000000000000000000000000000000000000000000000000000000000000000000009021108b008800000000000000000000000000000000000000000000000000000000000000044084422c091000000000000000000000000000000000000000000000000000000000004001100810114211000000000000000000000000000000000000000000000000000000010000c02004284100000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000010008822224012000000000000000000000000000000000000000000000000000000000000000000000241088228804800000000000000000000000000000000000000000000000000000000000000090422045102480000000000000000000000000000000000000000000000000000000000800240204045022400000000000000000000000000000000000000000000000000000002001808010a1100000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000200082088890140000000000000000000000000000000000000000000000000000000000000000000011040442290280000000000000000000000000000000000000000000000000000000000000004208088229094000000000000000000000000000000000000000000000000000000000010008808081142140000000000000000000000000000000000000000000000000000000400302008a12000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000400000000330080000000000000000000000000000040800012480400000000000000000000000000000000000385000000000000000000000000000400024c0500000000000000000000000000000000000001c24000000000000000000200000002000248104000000000000000000000000200000000011880000000000008000020000000010020182000000000000000000000000000001880000000000000000000000000000000000000000000000000000000000000000000000000000000000000002220040400000000b3008000000000000000000000000000000000000000000000000000000000000008a00800000000938500000000000000000000000000000000000000000000000000000000002280900000000049c240000000000000000000000000000000000000000000000400000000011023000000010918800000000000000000000000000000000000000000001000000000028c0000001880000000000000000000000000000000000000000000000000000000000000000000010800000000000000000000000400002000b300c000000000000000000000000000000008000100002000000000000000000000000000000400938580000000000000000000000000000000200008000000000000000000000000000000040049c260000000000000000000000000000000200002000000000000000000000002000002010918c00000000000000000000000000000008001000000000000000000000800600018a00000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x2000000000000000000000000000082222401000000000000000000001000000002814492002000000000000000000000000000000004008822880400000000000000000001000140115202400000000000000000000000000000001002204510240000000000000002000040000401148220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000a2040000000000000000000000000000020000000028d0040000000000000000000000000a000008101004920080000000000000000000000000000016804800000000000000000000008000008101002490120000000000000000000000800000000160102000000000000000000005200000408001240420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200040a204000000000000000000000000000000000000000000000000000000000800000100020a000808101484928080000000000000000000000000000000000000000000000000000001008002028101482494120000000000000000000000000000000000000000000000000000000205200104408041248420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020014000000000000000400222004800000000000000000000000000000004000008000004080001248040000000000000000020008a008800000000000000000000000000000002000000400024c05000000000000000000080022809100000000000000000000000000000002020000020002481040000000000400000080011021100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084c0200000008222240100000000000000000000000000000000000000000000000000000002000004009404000400882288040000000000000000000000000000000000000000000000000000004004a09000100220451024000000000000000000000000000000000000000000080000200000002429000000040450220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084c020000000000000000000004000000851a01000000000000000000000000000000000000200000400940400000000000000000000200103a048000000000000000000000000000000000000004004a0900000000000000000000010004074108000000000000000000000000008000020000000242100000000000000000200400000c2820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001440000000000000000000000010001000000000000000000000000100000161000a2000000000080400000000000000000000000000040210000000000000000000000000064004a8000000010240000000000000000000000000001004200000000000000000000000000019014a80000000084000000000000000000000000000810200000000002000000000000000c0a8540000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000040000000054600800000000000000000000000000810000010220040000000000000000000000000000000000111609000000000000000000000000800004140240000000000000000000000000000000000011160480000000000000000400000008000208084000000000000000000000000080000000108850800000000010000000000000040010050400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)))))))) + (NatTree.node 304 (NatTree.node 152 (NatTree.node 72 (NatTree.node 32 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x800940000000000000000000000000000000000000000000000000000000001000000020040800a124c0400000000000000000000000000000000000000000000000000000000000004080402824e050000000000000000000000000000000000000000000000000000000000020001080202024c1040000000000000000000000000000000000000000000000000080000200101000100241820000000000000000000000000000000000000000000800020a1080000000000000000000000000000000000000000000000010800000000000000000000000400002000b300c000000000000000000000000000000008000100002000000000000000000000000000000400938580000000000000000000000000000000200008000000000000000000000000000000040049c260000000000000000000000000000000200002000000000000000000000002000002010918c00000000000000000000000000000008001000000000000000000000800600018a0000000000000000000020000000000000000000000000000000000000000000010009400000000000000000000000000000000000000000000000000000000000000040000002020809089301000000000000000000000000000000000000000000000000000000000000004101048224c09000000000000000000000000000000000000000000000000000000000004000840102008921080000000000000000000000000000000000000000000000000400000400408002004412080000000000000000000000000000000000000000100020504200000000000000000000000000000000000000000000000088050004802000000000000000000000000000000000000000000000000000000000000000001004000200803090040000000000000000000000000000000000000000000000000000000004010000200811848090000000000000000000000000000000000000000000000000000000002900400010010c2021000000000000000000000000000000000000000000000000001000108004000800180904000000000000000000000000000000040004000400450800000000000000000000000000000000000480000000000002000a0000000000000000000000000000000000001000000800904400090000000000000000000000004020800100000000000000000000000000000000020004240114000000000000000000000002000200040000000000000000000000000100000000100041010a000000000000000000000010002000200000000000000000000000100000000400020120500000000000001000000004008008000000000000000000000090410000000100000002020000000000000000000000000000000000000000001060c4c020000000000000000000004000000851a01000000000000000000000000000000080000600090440940400000000000000000000200103a048000000000000000000000000000000010000904204a09000000000000000000000100040741080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000209118040000000000000000000020000000a28d80400000000000000000000000000000000000010002411602000000000000000000002001816c0480000000000000000000000000000000000800120458280000000000000000080008002016810200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000004122300400000000000000000000200000002828ac01000000000000000000000000000000000001001108b008000000000000000000010002809b00900000000000000000000000000000000004004422c09000000000000000004000400020026821000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x84c0200000008222240100000000000000000000000000000000000000000000000000000002000004009404000400882288040000000000000000000000000000000000000000000000000000004004a09000100220451024000000000000000000000000000000000000000000080000200000002429000400040450220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004800000000000020000000020008208889014000000000000000000000004000000040010000040000000000000000000000000001104044229028000000000000000000000000010000000080000000000000000000000000000420808822909400000000000000000000000000800000008000000000000000000000001000880808114214000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050800000000000000000000000000000000000000000000000020000040001010000000008a0a245008000000000000000000000000000000000000000000000000000080000000020000a918aa0480000000000000000000000000000000000000000000000000000008001800008000050c541080000000000000000000000000000000000000040000000000002001400010000000620a080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00940000000000000000000000000000000000000000000000000000000041000080020040800a124c0400000000000000000000000000000000000000000000000000000000002004080402824e050000000000000000000000000000000000000000000000000000000000020201080202024c104000000000000000000000000000000000000000000000000008000020110100010024182000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014009400000000000000000000000000000000000000000000000000000000000020040004002020809089301000000000000000000000000000000000000000000000000000000000001004101048224c09000000000000000000000000000000000000000000000000000000000004080840102008921080000000000000000000000000000000000000000000000000400000404408002004412080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084050403110040000000000000000000000000000000000000000000000000000000000000000028008004204051402000000000000000000000000000000000000000000000000000000000008008002102094502800000000000000000000000000000000000000000000000000000000003402001080214408400000000000000000000000000000000000000000000000002000006400082020040a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040001180454680800000000000000000000000000000000000000000000000000000000000000000000000130311689000000000000000000000000000000000000000000000000000000000000000000026051168480000000000000000000000000000000000000000000000000000004000080004020508a5080000000000000000000000000000000000000000000000000000000200000484508000000000000000000000000000000000000000000000000000000000000000008000000000000000000111004800000000000000000000000000000000000100000000000022440080000000000000000000001140220000000000000000000000000000000000000000008a804800000000000000000000004502880000000000000000000000000000008000000000004501080000000001000000000004408440000000000000000000000000000400000000000200a08000000002000020000000a1040000000000000000000000002410000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x10000400080040000090454680800000000000000000000000000000000000000000000000000000000000000004000000012311689000000000000000000000000000000000000000000000000000000000001000000002451168480000000000000000000000000000000000000000000000000000000004280004000508a5080000000000000000000000000000000000000000000000000000000200080004508000000000000000000000000000000000000000000000000000000000000090000000010a000000000000000000000000000000100008045008800000000080000000000000000800010000308002000000000000000000000000000000000504400000000200000000000000000020000c2004200000000000000000000000000000000001410800000000080000000000000000200003080810000000000000000000000000000000042810000000004000100000000000008001809010000000000000000000000000044000080000000000000000000000000000000000000000000000000000000000000000088050004802000000000000000000000000000000000000000000000000000000000000000001004000200803090040000000000000000000000000000000000000000000000000000000004010000200811848090000000000000000000000000000000000000000000000000000000002900400010010c20210000000000000000000000000000000000000000000000000010001080040008001809040000000000000000000000000000000400040204004508000000000000000000000000000000020000000000000000048024000000000000000000000000000000000010000000000144900020000000000000000000000000900440000000000000000000000000000000000000001150024000000000000000000000000480910000000000000000000000000000020000000000011402200000000008000000000000202110000000000000000000000000000800000000000802810000000000000040000000090410000000000000000000000002210000000002000001088800000000000000000000000000000000800940000000000000000000000000000000000000000000000000000000001000000020040800a124c0400000000000000000000000000000000000000000000000000000000000004080402824e050000000000000000000000000000000000000000000000000000000000020001080202024c1040000000000000000000000000000000000000000000000000080000200101000100241820000000000000000000000000000000000000000000800020a1080000000000000000000000000000004000000000000010009400000000000000000000000000000000000000000000000000000000000000040000002020809089301000000000000000000000000000000000000000000000000000000000000004101048224c090000000000000000000000000000000000000000000000000000000000040008401020089210800000000000000000000000000000000000000000000000004000004004080020044120800000000000000000000000000000000000000001000205042000000000000000000000000000080000000050800000000000000000000000000000002088890100000000020000040001010000000008a0a245008000000000000000000000000000001000442290200000000000080000000020000a918aa04800000000000000000000000000000020008822909000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040254800000000000000000000000000000000000000000100003020004040201010000000008a0a245008000000000000000000000000000000000000000000000200000081000000020000a918aa0480000000000000000000000000000000000000000000000080000008201800000000050c54108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x8000000000000008405040311006220040400000000b300800000200000000028a801000000000000000000000000280080042040514028a008000000009385000000000000009a00800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900000000088050004802080010400000000546008000000400002012240244000000001001000000000001004000200803090040808400000001116090000000002001202440000000100200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040254800000000000000000000000000000002088890100100003020004040201010000000008a0a245008000000000000000000000000000001000442290200000200000081000000020000a918aa048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034009400000000000000020000080004001000000231a020000000004000001000200400040020208090893010000000000000000000000010000040083a0900000000000008000000001004101048224c090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040254800000000000000000000000000000000000000000100003020004040201010000000008a0a245008000000000000000000000000000000000000000000000200000081000000020000a918aa0480000000000000000000000000000000000000000000000080000008201800008000050c5410800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000408204000000000000000400000004338080000000000000000000000000000800000100020a000808001004000000000000000000800103c500000000000000000000000000000000010080020080010020000000000000000000800101e2400000000000000000000000000000000204200100400001000000000000020000800001988000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020008a000000000000000000000000000000000000000000000000000000020000000400004000010102048449200800000000000000000000000000000000000000000000000000000008000082408120449202400000000000000000000000000000000000000000000000000000001020010810202022442200000000000000000000000000000000000000000000000000800802010008020022090400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084050403110040000000000000000000000000000000000000000000000000000000000000000028008004204051402000000000000000000000000000000000000000000000000000000000008008002102094502800000000000000000000000000000000000000000000000000000000003402001080214408400000000000000000000000000000000000000000000000002000006400082020040a1000000000000000000000000000000000000000000000000000000000000000000000))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x24000000000000000002100800000000000000000000010000202450044000000000040000000000000000000000000000000041208000000000000000000000020054228000000000400000000000000000000000000000020802000000000000000000000000800a8828000000000400000000000000000000000000001200200000000000000004000008002940a0000000002000000000000000000010000000840080000000000000000044800004000000000000000000000000000000000000000000000000000000000140000000000000000000000000400000000330080000000000000000000000000000040800012480400000000000000000000000000000000000385000000000000000000000000000400024c0500000000000000000000000000000000000001c240000000000000000002000000020002481040000000000000000000000002000000000118800000000000080000200000000100201820000000000000000000000000000018800000000000000020a000000000000000000000000000000000000000000000000000140000000000000000000000000000100000003180200000000000000000000000000000002080008920100000000000000000000000000000000038090000000000000000000000000000100022480900000000000000000000000000000000000e0220000000000000000000040000001000089010800000000000000000000000400000001050400000000000004000004000000020040120800000000000000000000000001880000000000000000205000000000000000000000000000000000000000020000000000000000048024000000000000000000000000000000000010000000000144900020000000000000000000000000900440000000000000000000000000000000000000001150024000000000000000000000000480910000000000000000000000000000020000000000011402200000000008000000000000202110000000000000000000000000000800000000000802810000000000000040000000090410000000000000000000000002210000000002000001088800000000000000008000000000000000800940000000000000000000000000000000000000000000000000000000001000000020040800a124c0400000000000000000000000000000000000000000000000000000000000004080402824e050000000000000000000000000000000000000000000000000000000000020001080202024c1040000000000000000000000000000000000000000000000000080000200101000100241820000000000000000000000000000000000000000000800020a1080000000000000000000000000000005000000000000010009400000000000000000000000000000000000000000000000000000000000000040000002020809089301000000000000000000000000000000000000000000000000000000000000004101048224c0900000000000000000000000000000000000000000000000000000000000400084010200892108000000000000000000000000000000000000000000000000040000040040800200441208000000000000000000000000000000000000000010002050420000000000000000000000000000a000000000000000000088050004802000000000000000000000000000000000000000000000000000000000000000001004000200803090040000000000000000000000000000000000000000000000000000000004010000200811848090000000000000000000000000000000000000000000000000000000002900400010010c202100000000000000000000000000000000000000000000000000100010800400080018090400000000000000000000000000000004000402040045080000000000000000000000010000a000000000000000000000209118040000000218889030020020000000a28d80400000000000000000000000000000000000010002411602000100044229020200002001816c0480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x24000000001050000000000000000000000000000000010000202450044000000000040000000000000001000040001844002000000000000000000000000000020050228000000000400000000000000000100001844011000000000000000000000000000000800a082800000000040000000001000000040000c101080000000000000000000004000008002140a000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000820100000000000000000000004000020122402440000000010010000000000000000000000000000008884000000000000000000000020012825400000001002000000000000000000000000000002201000000000000000000000000400150a1500000000010000000000000000000000000000280080000000000000020000004000a2a0a8000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020008a0000000000000000000000000000000000000000000000000000000200000004000040000101020484492008000000000000000000000000000000000000000000000000000000080000824081204492024000000000000000000000000000000000000000000000000000000010200108102020224422000000000000000000000000000000000000000000000000008008020104080200220904000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000080500000000000000000000000000000000004000020122402440000000010010000000000000040002000010000000000000000000000000000000020012025400000001002000000000000100002000008000000000000000000000000000000000400140a150000000001000000000000040001000040000000000000000000000002000000400082a0a8000000000800010000000040008000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000a9000000000001000080014000000000000000000000000000000000000010008100200502200500000000000000000000000808400040000000000000000000000000000000008040041402600000000000000000000000200100008000000000000000000000000004000000081002080860000000000000000000000200080008000000000000000000100000800000001400100506000000000000008000000402002000000000000000000000000000000000000000000000000000000000000000000000001440000000000000000000000010001000000000000000000000000100000161000a2000000000080400000000000000000000000000040210000000000000000000000000064004a8000000010240000000000000000000000000001004200000000000000000000000000019014a80000000084000000000000000000000000000810200000000002000000000000000c0a85400000000040000000000000000000000001408000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000880004001040080231a030000000000000000000000000000000000000000000000000000000000000000010000244083a098000000000000000000000000000000000000000000000000000000000000020000222040e823000000000000000000000000000000000000000000000000000000000002040088200185060000000000000000000000000000000000000000000000000000000000c4018a0000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000040000000518010000000000000000000000000000000102000449000800000000000000000000000000000038048000000000000000000000000000408000449002400000000000000000000000000000000701080000000000000000000020000010200022402200000000000000000000002000000008282000000000000000800002000008020020090400000000000000000000001880000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x4800000000000020000000020008208889014000000000000000000000004000000040010000040000000000000000000000000001104044229028000000000000000000000000010000000080000000000000000000000000000420808822909400000000000000000000000000800000008000000000000000000000001000880808114214000000000000000200000000800000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000004000000005460080000000000000000000000000081000001022004000000000000000000000000000000000011160900000000000000000000000080000414024000000000000000000000000000000000001116048000000000000000040000000800020808400000000000000000000000008000000010885080000000001000000000000004001005040000000000000000000000200000000508000000000000000000000000000000000000000000000000000000000000000000000000000000000001000008001000400000284b380800000000000000000000000000000000000000000000000000000000000000002000000802993c500000000000000000000000000000000000000000000000000000000000008000000802949e24000000000000000000000000000000000000000000000000000000000010600008005099880000000000000000000000000000000000000000000000000000000080020009880000000000000000000000000000000000000000000000000000000000000000000000088a0400000000000000000000200000000400800000000800000000000000000040000000001010042002008020000000000000000000000001040000000400000000000000000000000008040108002008110000000000000000000000000081000000004000000000000000000000001021004800100108000000000000000000000002020000000100000000000000080000101010808400080010000000000000000000440002000000000004000400040004000000000000000000000000000000000000000000000000000000000002220040400000000b3008000000000000000000000000000000000000000000000000000000000000008a00800000000938500000000000000000000000000000000000000000000000000000000002280900000000049c240000000000000000000000000000000000000000000000400000000011023000000010918800000000000000000000000000000000000000000001000000000028c0000001880000000000000000000000000000800041000008000000000000000000000000000140000000000000000000000000400000000330080000000000000000000000000000040800012480400000000000000000000000000000000000385000000000000000000000000000400024c0500000000000000000000000000000000000001c240000000000000000002000000020002481040000000000000000000000002000000000118800000000000080000200000000100201820000000000000000000000000000018800000000000000020a000000000000000000000080000000000000000000000000000140000000000000000000000000000100000003180200000000000000000000000000000002080008920100000000000000000000000000000000038090000000000000000000000000000100022480900000000000000000000000000000000000e0220000000000000000000040000001000089010800000000000000000000000400000001050400000000000004000004000000020040120800000000000000000000000001880000000000000000205000000000000000000004000000000000000002009640000000000080280000000000000000000000000000004000060100080161200a2000000000080400000000000020020400020000000000000000000000000002000040064804a8000000010240000000000002000020000800000000000000000000000000004000080019414a80000000084000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x2004a90000000000000000000000000000000000000000000000000000100000180081002105022805000000000000000000000000000000000000000000000000000000000002000080440415026000000000000000000000000000000000000000000000000000000000040010400810020a086000000000000000000000000000000000000000000000000010000080040800140011050600000000000000000000000000000000000000000000000201208800000000000000000000000000000000000000000024000000000000000002100800000000000000000000010000202450044000000000040000000000000000000000000000000041208000000000000000000000020054228000000000400000000000000000000000000000020802000000000000000000000000800a8828000000000400000000000000000000000000001200200000000000000004000008002940a0000000002000000000000000000010000000840080000000000000000044800004000000000001000000020000000000000000000000000000000000000000000000010000400080040000090454680800000000000000000000000000000000000000000000000000000000000000004000000012311689000000000000000000000000000000000000000000000000000000000001000000002451168480000000000000000000000000000000000000000000000000000000004280004000508a5080000000000000000000000000000000000000000000000000000000200080004508000000000000000000000000000000000004000420000000000000000000000000000000000000000000000002220040400000000b3008000000000000000000000000000000000000000000000000000000000000008a00800000000938500000000000000000000000000000000000000000000000000000000002280900000000049c240000000000000000000000000000000000000000000000400000000011023000000010918800000000000000000000000000000000000000000001000000000028c0000001880000000000000000000000000000800041000008800000000000000000000000000000020418605060b11804000000000000000000000000000000000000000000000000000000100002800086800901420645160200000000000000000000000000000000000000000000000000010000210800900a1032945828000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802548000000000000000000000000101190040000000000000000400001801000840b04d8019000000000000000000000000000000000004013211000000000000000000400002300c2d81340000000000000000000000000000000000100264110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000880500048020000000000000000000000000004000020122402440000000010010000000000010040002008030900400000000000000000000000000020012025400000001002000000000040100002008118480900000000000000000000000000000400140a150000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008025480000000000002000a0000000000000000000000000000000400001801000840b04d0019000000000000000000000000402080010000000000000000000000000000400002200c2d01340000000000000000000000020002000400000000000000000000000001000820001000c3411a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x200000000200082088890140000000000000000000000000000000000000000000000000000000000000000000011040442290280000000000000000000000000000000000000000000000000000000000000004208088229094000000000000000000000000000000000000000000000000000000000010008808081142140000000000000000000000000000000000000000000000000000000400302008a12000000000000000000000000000000000008000a51000000000000000000000000000000000000000000000002220040400000000b3008000000000000000000000000000000000000000000000000000000000000008a00800000000938500000000000000000000000000000000000000000000000000000000002280900000000049c240000000000000000000000000000000000000000000000400000000011023000000010918800000000000000000000000000000000000000000001000000000028c0000001880000000000000000000000000000800041020008800000000000000000000000000010800000000000000000000000400002000b300c000000000000000000000000000000008000100002000000000000000000000000000000400938580000000000000000000000000000000200008000000000000000000000000000000040049c260000000000000000000000000000000200002000000000000000000000002000002010918c00000000000000000000000000000008001000000000000000000000800600018a0000000000000000000020000000000000020008c80000000000000000000000000000088a040000000000000000000020000000040080000000080000000000000000004000000000101004200200802000000000000000000000000104000000040000000000000000000000000804010800200811000000000000000000000000008100000000400000000000000000000000102100480010010800000000000000000000000202000000010000000000000008000010101080840008001000000000000000000044000200000000000400040004000400000000000000802000000000000000002004a90000000000000000000000000000000000000000000000000000100000180081002105022805000000000000000000000000000000000000000000000000000000000002000080440415026000000000000000000000000000000000000000000000000000000000040010400810020a08600000000000000000000000000000000000000000000000001000008004080014001105060000000000000000000000000000000000000000000000020120880000000000000000000000000000000004000000000000000000000000000000000000040000400054604b380800000000000000000000000000000000000000000000000000000000000000000000001916193c500000000000000000000000000000000000000000000000000000000000000000001916149e2400000000000000000000000000000000000000000000000000000000800020001888509988000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000a2040000000000000000000000000000020000000028d0040000000000000000000000000a00000810100492008000000000000000000000000000001680480000000000000000000000800000810100249012000000000000000000000080000000016010200000000000000000000520000040800124042000000000000000000001000000000405010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084c020000000000000000000004000000851a01000000000000000000000000000000000000200000400940400000000000000000000200103a048000000000000000000000000000000000000004004a0900000000000000000000010004074108000000000000000000000000008000020000000242100000000000000000200400000c282000000000000000000000000000000400000020904000000000000000000000000000000000000000000000000000000000000000000000000))))) + (NatTree.node 40 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x2009640000000000000000000000000000000000000000000004000060100080161200a2000000000080400000000000000000000000000000000000000000000000002000040064804a8000000010240000000000000000000000000000000000000000000000000004000080019414a80000000084000000000000000000000000000000000000000002000200400010000d0a8440000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050800000000000000000000000000000000000000000000000020000040001010000000008a0a245008000000000000000000000000000000000000000000000000000080000000020000a918aa0480000000000000000000000000000000000000000000000000000008001800008000050c541080000000000000000000000000000000000000040000000000002001400010000000620a080000000000000000000000000000000000000000800000000641000000000000000000000000000000000000000000000000a00940000000000000000000000000000000000000000000000000000000041000080020040800a124c0400000000000000000000000000000000000000000000000000000000002004080402824e050000000000000000000000000000000000000000000000000000000000020201080202024c1040000000000000000000000000000000000000000000000000080000201101000100241820000000000000000000000000000000000000000004000020a1000000000000000000000000000000000000000090000000010a000000000000000000000000000000100008045008800000000080000000000000000800010000308002000000000000000000000000000000000504400000000200000000000000000020000c200420000000000000000000000000000000000141080000000008000000000000000020000308081000000000000000000000000000000004281000000000400010000000000000800180901000000000000000000000000004400008080000000000128000000000000000000000000000000000000000000014009400000000000000000000000000000000000000000000000000000000000020040004002020809089301000000000000000000000000000000000000000000000000000000000001004101048224c0900000000000000000000000000000000000000000000000000000000000408084010200892108000000000000000000000000000000000000000000000000040000040440800200441208000000000000000000000000000000000000000080002050400000000000000000000000000000000000000008000000000000000000111004800000000000000000000000000000000000100000000000022440080000000000000000000001140220000000000000000000000000000000000000000008a804800000000000000000000004502880000000000000000000000000000008000000000004501080000000001000000000004408440000000000000000000000000000400000000000200a08000000002000020000000a10400000000000000000000000024100000000100000448200000000000000000000000000000000000000004000000800441223004800000000000000000000000000000000000000000000000000000000000000000000009021108b008800000000000000000000000000000000000000000000000000000000000000044084422c091000000000000000000000000000000000000000000000000000000000004001100810114211000000000000000000000000000000000000000000000000000000010000c02004284100000000000000000000000000000000000080005121000000000000000000000000000000000000000002000000010008822224012000000000000000000000000000000000000000000000000000000000000000000000241088228804800000000000000000000000000000000000000000000000000000000000000090422045102480000000000000000000000000000000000000000000000000000000000800240204045022400000000000000000000000000000000000000000000000000000002001808010a110000000000000000000000000000000000020001490800000000000000000) + (NatTree.leaf 0x40001180454680800000000000000000000000000000000000000000000000000000000000000000000000130311689000000000000000000000000000000000000000000000000000000000000000000026051168480000000000000000000000000000000000000000000000000000004000080004020508a5080000000000000000000000000000000000000000000000000000000200000484508000000000000000000000000000000001004082420000000000000000000000000000000000000000001000008001000400000284b380800000000000000000000000000000000000000000000000000000000000000002000000802993c500000000000000000000000000000000000000000000000000000000000008000000802949e2400000000000000000000000000000000000000000000000000000000001060000800509988000000000000000000000000000000000000000000000000000000008002000988000000000000000000000000000000000002000880000000000000000000000000000000004000000800441223004800000000000000000000000000000000000000000000000000000000000000000000009021108b008800000000000000000000000000000000000000000000000000000000000000044084422c091000000000000000000000000000000000000000000000000000000000004001100810114211000000000000000000000000000000000000000000000000000000010000c02004284100000000000000000000000000000000000080005121000000000000000000100000000000000000000002000000010008822224012000000000000000000000000000000000000000000000000000000000000000000000241088228804800000000000000000000000000000000000000000000000000000000000000090422045102480000000000000000000000000000000000000000000000000000000000800240204045022400000000000000000000000000000000000000000000000000000002001808010a1100000000000000000000000000000000000200014908000000000000000040000000000000000000000000200000000200082088890140000000000000000000000000000000000000000000000000000000000000000000011040442290280000000000000000000000000000000000000000000000000000000000000004208088229094000000000000000000000000000000000000000000000000000000000010008808081142140000000000000000000000000000000000000000000000000000000400302008a12000000000000000000000000000000000008000a5100000000000000020000000000000000011060c4c024041223004000000000000000000000000000000000000000000000000000000080001600090440941441108b008000000000000000000000000000000000000000000000000000050000904204a0d104422c090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002009640000000000000000000000010401000000000000000004000060100080161200a2000000000080400000000000000000000000000044210000000000000000002000040064c04a8000000010240000000000000000000000000001104200000000000000000004000080019614a800000000840000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002009640000000000080280000000000000000000000000000004000060100080161200a2000000000080400000000000020020400020000000000000000000000000002000040064804a8000000010240000000000002000020000800000000000000000000000000004000080019414a80000000084000000000000080010000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x802548000000000000000000000000000000000000000000000000400001801000840b04d0019000000000000000000000000000000000000000000000000000000000000400002200c2d01340000000000000000000000000000000000000000000000000000000001000820001000c3411a000000000000000000000000000000000000000000000000002000100102000400064160900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002009640000000000000000000000000000000000000000000004000060100080161200a2000000000080400000000000000000000000000000000000000000000000002000040064804a8000000010240000000000000000000000000000000000000000000000000004000080019414a80000000084000000000000000000000000000000000000000002000200400010000d0a85400000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a00940000000000000000000000000000000000000000000000100000100041000080020040800a124c0400000000000000000000000000000000000000000000000001000000002004080402824e050000000000000000000000000000000000000000000000000000400000020201080202024c104000000000000000000000000000000000000000008000000808000020110000010024182000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034009400000000000000000000000000000000000000000000000000400000100020040004002020809089301000000000000000000000000000000000000000000000000008000000001004101048224c090000000000000000000000000000000000000000000000000000800000040808401020089210800000000000000000000000000000000000000040000000204000004044000020044120800000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000820100000000000000000000004000020122402440000000010010000000000000000000000000000008884000000000000000000000020012825400000001002000000000000000000000000000002201000000000000000000000000400150a1500000000010000000000000000000000000000280080000000000000020000004000a2a0a8000000000800000000000000000008000004402000000000000000000000000000000000000000000000000000000000000000000000000009000000000080500000000000000000000000000000000004000020122402440000000010010000000000000040002000010000000000000000000000000000000020012025400000001002000000000000100002000008000000000000000000000000000000000400140a150000000001000000000000040001000040000000000000000000000002000000400082a0a8000000000800010000000040008000800000000000000000000000022200000080000000000000000000000000000000000000000000000000000a0000000000000000000000400000000546008000000000000000000000000008100000102200400000000000000000000000000000000001116090000000000000000000000008000041402400000000000000000000000000000000000111604800000000000000004000000080002080840000000000000000000000000800000001088508000000000100000000000000400100504000000000000000000000020000000050800000000000002012000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000040000000518010000000000000000000000000000000102000449000800000000000000000000000000000038048000000000000000000000000000408000449002400000000000000000000000000000000701080000000000000000000020000010200022402200000000000000000000002000000008282000000000000000800002000008020020090400000000000000000000001880000000000000004008140000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x50800000000000000000000000000000000000000000000000020000040001010000000008a0a245008000000000000000000000000000000000000000000000000000080000000020000a918aa0480000000000000000000000000000000000000000000000000000008001800008000050c541080000000000000000000000000000000000000040000000000002001400010000000620a0800000000000000000000000000000000000000008000000006410000000000000000000000000000020001000000000012000000000000000000000000200082a2244101000000631a060008001000000002814492002000000000000000000000000000000004008822890400040083a090080000010001401152024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014800000000001000048001000408002284b380c00000000000000000000000000100000804010000200000000000000000000002000008842993c580000000000000000000000000000100200008000000000000000000000008000010842949e26000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014009400000000000000020000080004001000000231a020000000000000000000200400040020208090893010000000000000000000000010000040083a0900000000000000000000001004101048224c0900000000000000000000000020000020040e8220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020008a00000000000000000040000020002004000000851a01000000000002000000040000400001010204844920080000000000000000000004000200103a04800000000000000000000800008240812044920240000000000000000000000400010004074108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000418604040200000000000000001000000231a020000000000000000000000000000001000008000868009004004040000000000000000040083a090000000000000000000000000000000000021080090020020900000000000000000020040e822000000000000000000000000000000400010240220100021000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008025480000000000002000a0000000000000000000000000000000400001801000840b04d0019000000000000000000000000402080010000000000000000000000000000400002200c2d01340000000000000000000000020002000400000000000000000000000001000820001000c3411a000000000000000000000010002000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000002088890100000000000000000000010000000000a022450080000000000000000000000000000010004422902000000000000000000000200002808aa0480000000000000000000000000000002000882290900000000000000000800008000040454108000000000000000000000000100008000811421000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0xa9000000000001000080014000000000000000000000000000000000000010008100200502200500000000000000000000000808400040000000000000000000000000000000008040041402600000000000000000000000200100008000000000000000000000000004000000081002080860000000000000000000000200080008000000000000000000100000800000001400100506000000000000008000000402002000000000000000000002012088000000000000000000000000000000000000000000000000020008a000000000000000000000000000000000000000000000000000000020000000400004000010102048449200800000000000000000000000000000000000000000000000000000008000082408120449202400000000000000000000000000000000000000000000000000000001020010810202022442200000000000000000000000000000000000000000000000000800802010408020022090400000000000000000000000000000000000000004008142000000000000000000000000000000000000000000000000084050403110040000000000000000000000000000000000000000000000000000000000000000028008004204051402000000000000000000000000000000000000000000000000000000000008008002102094502800000000000000000000000000000000000000000000000000000000003402001080214408400000000000000000000000000000000000000000000000002000006400082020040a10000000000000000000000000000000000020010820c000000000000000000000000000000000000000000000000001000008001000400000284b380800000000000000000000000000000000000000000000000000000000000000002000000802993c500000000000000000000000000000000000000000000000000000000000008000000802949e24000000000000000000000000000000000000000000000000000000000010600008005099880000000000000000000000000000000000000000000000000000000080020009880000000000000000000000000000000000020008c00000000000000000000000000000000000000000000020000880004001040080231a030000000000000000000000000000000000000000000000000000000000000000010000244083a098000000000000000000000000000000000000000000000000000000000000020000222040e823000000000000000000000000000000000000000000000000000000000002040088200185060000000000000000000000000000000000000000000000000000000000c4018a0000000000000000000000000000000000010026100000000000000000000000000000a00000000000000000000000000000004000000051801000000000000000000000000000000010200044900080000000000000000000000000000003804800000000000000000000000000040800044900240000000000000000000000000000000070108000000000000000000002000001020002240220000000000000000000000200000000828200000000000000080000200000802002009040000000000000000000000188000000000000000400814000000000000000000800000000000000090000000010a000000000000000000000000000000100008045008800000000080000000000000000800010000308002000000000000000000000000000000000504400000000200000000000000000020000c2004200000000000000000000000000000000001410800000000080000000000000000200003080810000000000000000000000000000000042810000000004000100000000000008001809010000000000000000000000000044000080800000000001280000000000000000000100004000000000000024000000000000000002100800000000000000000000010000202450044000000000040000000000000000000000000000000041208000000000000000000000020054228000000000400000000000000000000000000000020802000000000000000000000000800a8828000000000400000000000000000000000000001200200000000000000004000008002940a00000000020000000000000000000100000008400800000000000000000448000040000000000010000000200000000000002020100000000)))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x2000000000000000000000209118040000000000000000000020000000a28d80400000000000000000000000000000000000010002411602000000000000000000002001816c0480000000000000000000000000000000000800120458280000000000000000080008002016810200000000000000000000000000100000800080450840000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000004122300400000000000000000000200000002828ac01000000000000000000000000000000000001001108b008000000000000000000010002809b00900000000000000000000000000000000004004422c090000000000000000040004000200268210000000000000000000000000004000100010114210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000822224010000000000000000000010000000028144920020000000000000000000000000000000040088228804000000000000000000010001401152024000000000000000000000000000000010022045102400000000000000020000400004011482200000000000000000000000000800040004045022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802548000000000000000000000000000000000000000000000000400001801000840b04d0019000000000000000000000000000000000000000000000000000000000000400002200c2d01340000000000000000000000000000000000000000000000000000000001000820001000c3411a000000000000000000000000000000000000000000000000002000100102000400064160d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020014000000000000000400222004800000000000000000000000000000004000008000004080001248040000000000000000020008a008800000000000000000000000000000002000000400024c0500000000000000000008002280910000000000000000000000000000000202000002000248104000000000040000008001102110000000000000000000000008000020100000010020182000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a00940000000000000000000000000000000000000000000000100000100041000080020040800a124c0400000000000000000000000000000000000000000000000001000000002004080402824e050000000000000000000000000000000000000000000000000000400000020201080202024c104000000000000000000000000000000000000000008000000808000020110100010024182000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034009400000000000000000000000000000000000000000000000000400000100020040004002020809089301000000000000000000000000000000000000000000000000008000000001004101048224c09000000000000000000000000000000000000000000000000000080000004080840102008921080000000000000000000000000000000000000004000000020400000404408002004412080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084c020000000000000000000004000000851a01000000000000000000000000000000000000200000400940400000000000000000000200103a048000000000000000000000000000000000000004004a0900000000000000000000010004074108000000000000000000000000008000020000000242100000000000000000200400000c282000000000000000000000000000000400000020904000000000000000001880000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x408204000000000000000400000004338080000000000000000000000000000800000100020a000808001004000000000000000000800103c500000000000000000000000000000000010080020080010020000000000000000000800101e2400000000000000000000000000000000204200100400001000000000000020000800001988000000000000000000000000000040202102000400002000000000000000000000000000000000000000000000000000000000000000000000000000000000001440000000000000000000000010001000000000000000000000000100000161000a2000000000080400000000000000000000000000040210000000000000000000000000064004a8000000010240000000000000000000000000001004200000000000000000000000000019014a80000000084000000000000000000000000000810200000000002000000000000000c0a8540000000004000000000000000000000000140800000000000000342100000010000000000000000000000000000000000000000000000000020008a000000000000000000000000000000000000000000000000000000020000000400004000010102048449200800000000000000000000000000000000000000000000000000000008000082408120449202400000000000000000000000000000000000000000000000000000001020010810202022442200000000000000000000000000000000000000000000000000800802010408020022090400000000000000000000000000000000000000104008142000000000000000000000000000000000000000000000000084050403110040000000000000000000000000000000000000000000000000000000000000000028008004204051402000000000000000000000000000000000000000000000000000000000008008002102094502800000000000000000000000000000000000000000000000000000000003402001080214408400000000000000000000000000000000000000000000000002000006400082020040a10000000000000000000000000000000000020010820c40000000000000000000000000000000000a00000000000000000000004000000005460080000000000000000000000000081000001022004000000000000000000000000000000000011160900000000000000000000000080000414024000000000000000000000000000000000001116048000000000000000040000000800020808400000000000000000000000008000000010885080000000001000000000000004001005040000000000000000000000200000000508000000000000020120000000000000000000000420000000000000000000000000000000000000000001000008001000400000284b380800000000000000000000000000000000000000000000000000000000000000002000000802993c500000000000000000000000000000000000000000000000000000000000008000000802949e24000000000000000000000000000000000000000000000000000000000010600008005099880000000000000000000000000000000000000000000000000000000080020009880000000000000000000000000000000000020008c00000000000000100e025480004a0098a05050101408281441000491454680a030020302000024020101004000000800800000040101000000000802000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040254800000200040a20400000000000000002088890100100003020004040201010000000008a8a2450180020a00080810148492808000000000004422902000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x9000000000080500000000000000000000000000000000004000020122402440000000010010000000000000040002000010000000000000000000000000000000020012025400000001002000000000000100002000008000000000000000000000000000000000400140a150000000001000000000000040001000040000000000000000000000002000000400082a0a8000000000800010000000040008000800000000000000000000000022200000080400000004004000000000000000000000000000000000000000020008a000000000000000000000000000000000000000000000000000000020000000400004000010102048449200800000000000000000000000000000000000000000000000000000008000082408120449202400000000000000000000000000000000000000000000000000000001020010810202022442200000000000000000000000000000000000000000000000000800802010408020022090400000000000000000000000000000000000000104008142100000000000000000000000000000000000000000000000084050403110040000000000000000000000000000000000000000000000000000000000000000028008004204051402000000000000000000000000000000000000000000000000000000000008008002102094502800000000000000000000000000000000000000000000000000000000003402001080214408400000000000000000000000000000000000000000000000002000006400082020040a10000000000000000000000000000000000020110820c40000000000000000000000000000000000020008a0000000000000000000000000000000000000000000000000000000200000004000040000101020484492008000000000000000000000000000000000000000000000000000000080000824081204492024000000000000000000000000000000000000000000000000000000010200108102020224422000000000000000000000000000000000000000000000000008008020104080200220904000000000000000000000000000000000000001040081420000000000000000000000000010000000000000020008a0000084c020000000862224030002004000000851a01000000000002000000040000400001010204a44920480940400040088228804004000000103a04800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a00940000000000001000008001000400000284b38080000000100000100041000080020040800a124c04000000000000000000000002000000802993c5000000000001000000002004080402824e050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100041a231040400000284b3808000000000000000000000000000000000000000000000000000000001001108b2080000802993c5000000000000000000000000000000000000000000000000000004004422c8900000002949e24000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020911804000000020888901000000000000000000000000000000000000000000000000000000001000241160200010004422902000000000000000000000000000000000000000000000000000800120458280002000882290900000000000000000000000000000000000000000000100000800080450940000000811421000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x14800000000001000048001000408002284b380c00000000000000000000000000100000804010000200000000000000000000002000008842993c580000000000000000000000000000100200008000000000000000000000008000010842949e2600000000000000000000000000004002000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001060c4c020000000000000000000004000000851a01000000000000000000000000000000080000600090440940400000000000000000000200103a048000000000000000000000000000000010000904204a090000000000000000000001000407410800000000000000000000000004800002002201024210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002009640000000000000000000000010401000000000000000004000060100080161200a2000000000080400000000000000000000000000044210000000000000000002000040064c04a8000000010240000000000000000000000000001104200000000000000000004000080019614a80000000084000000000000000000000000000a102000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002091180400000002088890100000000000000000000000000000000000000000000000000000000100024116020001000442290200000000000000000000000000000000000000000000000000080012045828000200088229090000000000000000000000000000000000000000000010000080008045094000800081142100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088000000000000000040001180454680800000000000000000000000020000000400004000010100000400000000000000000000130311689000000000000000000000000000000008000080400000400000000000000000000026051168480000000000000000000000000000001000010010000020000000004000080004020508a5080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000144000000000000020000880004001040080231a030000000000000000000000000000010001040040001000000000000000000000010000244083a098000000000000000000000000000002001000010000000000000000000000020000222040e8230000000000000000000000000000080004000080000000000000000000020400882001850600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002009640000000000000000000000000000000000000000000004000060100080161200a2000000000080400000000000000000000000000000000000000000000000002000040064c04a8000000010240000000000000000000000000000000000000000000000000004000080019614a80000000084000000000000000000000000000000000000000002000200400010000d8a854000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000001050000000000000000000000000000000010000202450044000000000040000000000000001000040001844002000000000000000000000000000020050228000000000400000000000000000100001844011000000000000000000000000000000800a082800000000040000000001000000040000c101080000000000000000000004000008002140a0000000002000020000000000010000c044100000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x84c020000000000000000000004000000851a01000000000000000000000000000000000000200000400940400000000000000000000200103a048000000000000000000000000000000000000004004a0900000000000000000000010004074108000000000000000000000000008000020000000242100000000000000000200400000c2820000000000000000000000000000004000000209040000000000000000018800000000000000000200000108000000000000000000000000000000000000a9000000000001000080014000000000000000000000000000000000000010008100200502200500000000000000000000000808400040000000000000000000000000000000008040041402600000000000000000000000200100008000000000000000000000000004000000081002080860000000000000000000000200080008000000000000000000100000800000001400100506000000000000008000000402002000000000000000000002012088000000080000010080000000000000000000000000001440000000000000000000000010001000000000000000000000000100000161000a2000000000080400000000000000000000000000040210000000000000000000000000064004a8000000010240000000000000000000000000001004200000000000000000000000000019014a80000000084000000000000000000000000000810200000000002000000000000000c0a8540000000004000000000000000000000000140800000000000000342100000010000000000000002040000000000000000000000000000000020008a000000000000000000000000000000000000000000000000000000020000000400004000010102048449200800000000000000000000000000000000000000000000000000000008000082408120449202400000000000000000000000000000000000000000000000000000001020010810202022442200000000000000000000000000000000000000000000000000800802010408020022090400000000000000000000000000000000000000104008142100000000000000000000000001000000000000000000000084050403110040000000000000000000000000000000000000000000000000000000000000000028008004204051402000000000000000000000000000000000000000000000000000000000008008002102094502800000000000000000000000000000000000000000000000000000000003402001080214408400000000000000000000000000000000000000000000000002000006400082020040a10000000000000000000000000000000000020110820c400000000000000000000004000a0000000000200040a2040000000000000000010000020020020000000a28d8040000000000000800000100020a000808101484928080000000000000000000200002001816c048000000000000000000010080020081014824941200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000408204000000000040000400054604b38080000000000000000000000000000800000100020a000808001004000000000000000001916193c500000000000000000000000000000000010080020080010020000000000000000001916149e2400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100041a231040400000284b3808000000000000000000000000000000000000000000000000000000001001108b2080000802993c5000000000000000000000000000000000000000000000000000004004422c8900000802949e240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)))))) + (NatTree.node 72 (NatTree.node 32 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x408204000000000000000400000004338080000000000000000000000000000800000100020a000808001004000000000000000000800103c500000000000000000000000000000000010080020080010020000000000000000000800101e2400000000000000000000000000000000204200100400001000000000000020000800001988000000000000000000000000000040202102000400002000000000000000000188000000000000000000000000000000000000000000000000000000000000009000000000080500000000000000000000000000000000004000020122402440000000010010000000000000040002000010000000000000000000000000000000020012025400000001002000000000000100002000008000000000000000000000000000000000400140a150000000001000000000000040001000040000000000000000000000002000000400082a0a8000000000800010000000040008000800000000000000000000000022200000080400000004004000000000000000000400020000000000000000020008a00000000000000000000000000000000000000000000000000000002000000040000400001010204844920080000000000000000000000000000000000000000000000000000000800008240812044920240000000000000000000000000000000000000000000000000000000102001081020202244220000000000000000000000000000000000000000000000000080080201040802002209040000000000000000000000000000000000000010400814210000000000000000000000000140000a0000000000200040a2040000000000000000010000020020020000000a28d8040000000000000800000100020a000808101484928080000000000000000000200002001816c0480000000000000000000100800202810148249412000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000084050403110040000000000000000000000000200000000028a8010000000000000000000000002800800420405140200000000000000000000000000000009a0090000000000000000000000080080021020945028000000000000000000000400000000002602100000000000000000000034020010802144084000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000048001000408002284b380c00000000000000000000000000000000000000000000000000000000000000002000008842993c580000000000000000000000000000000000000000000000000000000000008000010842949e260000000000000000000000000000000000000000000000000000000000106001082050998c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084c0200000008222240100000000000000000000000000000000000000000000000000000002000004009404000400882288040000000000000000000000000000000000000000000000000000004004a0900010022045102400000000000000000000000000000000000000000008000020000000242900040004045022000000000000000000000000000000000000000000000040000002092400000010a1000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000820100000000000000000000004000020122402440000000010010000000000000000000000000000008884000000000000000000000020012825400000001002000000000000000000000000000002201000000000000000000000000400150a1500000000010000000000000000000000000000280080000000000000020000004000a2a0a800000000080000000000000000000800000440200000000000000002220000008000000000000000000000000000000000000000000) + (NatTree.leaf 0x802548000000000000000000000000000000000000000000000000400001801000840b04d0019000000000000000000000000000000000000000000000000000000000000400002200c2d01340000000000000000000000000000000000000000000000000000000001000820001000c3411a000000000000000000000000000000000000000000000000002000100102000400064160d00000000000000000000000000000000000000000000000000190810000000000000000000000000000000000000000000002009640000000000000000000000000000000000000000000004000060100080161200a2000000000080400000000000000000000000000000000000000000000000002000040064804a8000000010240000000000000000000000000000000000000000000000000004000080019414a80000000084000000000000000000000000000000000000000002000200400010000d0a85400000000040000000000000000000000000000000000000000003421000000100000000000000000000000000000000000000000000001a00940000000000000000000000000000000000000000000000100000100041000080020040800a124c0400000000000000000000000000000000000000000000000001000000002004080402824e050000000000000000000000000000000000000000000000000000400000020201080202024c1040000000000000000000000000000000000000000080000008080000201101000100241820000000000000000000000000000000000000000004000020a1000000000000000000000000000000000000000000000034009400000000000000000000000000000000000000000000000000400000100020040004002020809089301000000000000000000000000000000000000000000000000008000000001004101048224c090000000000000000000000000000000000000000000000000000800000040808401020089210800000000000000000000000000000000000000040000000204000004044080020044120800000000000000000000000000000000000000008000205040000000000000000000000000000000000000009000000000000000000000820100000000000000000000004000020122402440000000010010000000000000000000000000000008884000000000000000000000020012825400000001002000000000000000000000000000002201000000000000000000000000400150a1500000000010000000000000000000000000000280080000000000000020000004000a2a0a800000000080000000000000000000800000440200000000000000002220000008000000000008000001000000000000000000000000000000000000000000000084c020000000000000000000004000000851a01000000000000000000000000000000000000200000400940400000000000000000000200103a048000000000000000000000000000000000000004004a0900000000000000000000010004074108000000000000000000000000008000020000000242100000000000000000200400000c2820000000000000000000000000000004000000209040000000000000000018800000000000000000200000108000000000200080000000000000000001440000000000000000000000010001000000000000000000000000100000161000a2000000000080400000000000000000000000000040210000000000000000000000000064004a8000000010240000000000000000000000000001004200000000000000000000000000019014a80000000084000000000000000000000000000810200000000002000000000000000c0a854000000000400000000000000000000000014080000000000000034210000001000000000000000204000000000000800080000000000000000000000000084c0200000008222240100000000000000000000000000000000000000000000000000000002000004009404000400882288040000000000000000000000000000000000000000000000000000004004a0900010022045102400000000000000000000000000000000000000000008000020000000242900040004045022000000000000000000000000000000000000000000000040000002092400800010a100000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x802548000000000000000000000000000000000000000000000000400001801000840b04d0019000000000000000000000000000000000000000000000000000000000000400002200c2d01340000000000000000000000000000000000000000000000000000000001000820001000c3411a000000000000000000000000000000000000000000000000002000100102000400064160d00000000000000000000000000000000000000000000000000190c10000000000000000000000000000000000000000000002009640000000000000000000000000000000000000000000004000060100080161200a2000000000080400000000000000000000000000000000000000000000000002000040064804a8000000010240000000000000000000000000000000000000000000000000004000080019414a80000000084000000000000000000000000000000000000000002000200400010000d0a8540000000004000000000000000000000000000000000000000000343100000010000000000000000000000000000000000000000000000000048000000000000200000000200082088890140000000000000000000000040000000400100000400000000000000000000000000011040442290280000000000000000000000000100000000800000000000000000000000000004208088229094000000000000000000000000008000000080000000000000000000000010008808081142140000000000000002000000008000000008000000000000000000000400302008a12000000000000000000040000000000000000000000000000000000000000000001a00940000000000000000000000000000000000000000000000100000100041000080020040800a124c0400000000000000000000000000000000000000000000000001000000002004080402824e050000000000000000000000000000000000000000000000000000400000020201080202024c1040000000000000000000000000000000000000000080000008080000201101000100241820000000000000000000000000000000000000000004800020a1000000000000000000000000000000000000000000000034009400000000000000000000000000000000000000000000000000400000100020040004002020809089301000000000000000000000000000000000000000000000000008000000001004101048224c090000000000000000000000000000000000000000000000000000800000040808401020089210800000000000000000000000000000000000000040000000204000004044080020044120800000000000000000000000000000000000000009000205040000000000000000000000000000000000000000000000200040a204000000000000000000000000000000000000000000000000000000000800000100020a000808101484928080000000000000000000000000000000000000000000000000000001008002028101482494120000000000000000000000000000000000000000000000000000000205200104408041248420000000000000000000000000000000000000000000000000040202902000401002412080000000000000000000000000000000000000000000000000000000000000000000000000000000000048000000000000200000000200082088890140000000000000000000000040000000400100000400000000000000000000000000011040442290280000000000000000000000000100000000800000000000000000000000000004208088229094000000000000000000000000008000000080000000000000000000000010008808081142140000000000000002000000008000000008000000000000000000000400302008a12000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000400054604b380800000000000000000000000000000000000000000000000000000000000000000000001916193c500000000000000000000000000000000000000000000000000000000000000000001916149e240000000000000000000000000000000000000000000000000000000080002000188850998800000000000000000000000000000000000000000000000000002000800005098800000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x50800000000000000000000000000000002088890100000000020000040001010000000008a0a245008000000000000000000000000000001000442290200000000000080000000020000a918aa0480000000000000000000000000000002000882290900000000000008001800008000050c54108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200082a2244101000000231a020000000000000000000000000000000000000000000000000000000004008822890400040083a090000000000000000000000000000000000000000000000000000010022045122400020040e82200000000000000000000000000000000000000000000000800040004045226000000018504000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000418604040200000000000000001000000231a020000000000000000000000000000001000008000868009004004040000000000000000040083a090000000000000000000000000000000000021080090020020900000000000000000020040e8220000000000000000000000000000004000102402201000210000000000000400080001850400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000002088890100000000000000000000010000000000a022450080000000000000000000000000000010004422902000000000000000000000200002808aa04800000000000000000000000000000020008822909000000000000000008000080000404541080000000000000000000000001000080008114210000000000000000400010000000220a08000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040254800000000000000000000000000000000000000000100003020004040201010000000008a0a245008000000000000000000000000000000000000000000000200000081000000020000a918aa0480000000000000000000000000000000000000000000000080000008201800008000050c541080000000000000000000000000000000000000040000080000002401400000000000620a080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000144000000000000020000880004001040080231a030000000000000000000000000000010001040040001000000000000000000000010000244083a098000000000000000000000000000002001000010000000000000000000000020000222040e8230000000000000000000000000000080004000080000000000000000000020400882001850600000000000000000002000000040001000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200040a204000000000000000000000000000000000000000000000000000000000800000100020a00080810148492808000000000000000000000000000000000000000000000000000000100800202810148249412000000000000000000000000000000000000000000000000000000020520010440804124842000000000000000000000000000000000000000000000000004020290200840100241208000000000000000000000000000000000000000000000000000000000000000000000000000024000000001050000000000000000000000000000000010000202450044000000000040000000000000001000040001844002000000000000000000000000000020050228000000000400000000000000000100001844011000000000000000000000000000000800a082800000000040000000001000000040000c101080000000000000000000004000008002140a0000000002000020000000000010000c044100000000000000000000000448000040000000000000000000000000000000000000000000000))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x1a00940000000000000000000000000000000000000000000000100000100041000080020040800a124c0400000000000000000000000000000000000000000000000001000000002004080402824e050000000000000000000000000000000000000000000000000000400000020201080202024c1040000000000000000000000000000000000000000080000008080000201101000100241820000000000000000000000000000000000000000004800020a1080000000000000000000000000000000000000000000034009400000000000000000000000000000000000000000000000000400000100020040004002020809089301000000000000000000000000000000000000000000000000008000000001004101048224c0900000000000000000000000000000000000000000000000000008000000408084010200892108000000000000000000000000000000000000000400000002040000040440800200441208000000000000000000000000000000000000000090002050420000000000000000000000000000000000000000000000000408204000000000000000400000004338080000000000000000000000000000800000100020a000808001004000000000000000000800103c500000000000000000000000000000000010080020080010020000000000000000000800101e24000000000000000000000000000000002042001004000010000000000000200008000019880000000000000000000000000000402021020004000020000000000000000001880000000000000000000800200008000000000000000000000000000000000802548000000000000000000000000000000000000000000000000400001801000840b04d0019000000000000000000000000000000000000000000000000000000000000400002200c2d01340000000000000000000000000000000000000000000000000000000001000820001000c3411a000000000000000000000000000000000000000000000000002000100102000400064160d00000000000000000000000000000000000000000000000000190c10000000000000000000000000000000000200000000002009640000000000000000000000000000000000000000000004000060100080161200a2000000000080400000000000000000000000000000000000000000000000002000040064804a8000000010240000000000000000000000000000000000000000000000000004000080019414a80000000084000000000000000000000000000000000000000002000200400010000d0a85400000000040000000000000000000000000000000000000000003431000000100000000000000000000000000000000008000000000001a00940000000000000000000000000000000000000000000000100000100041000080020040800a124c0400000000000000000000000000000000000000000000000001000000002004080402824e050000000000000000000000000000000000000000000000000000400000020201080202024c1040000000000000000000000000000000000000000080000008080000201101000100241820000000000000000000000000000000000000000004800020a1000000000000000000000000000000004000000000000034009400000000000000000000000000000000000000000000000000400000100020040004002020809089301000000000000000000000000000000000000000000000000008000000001004101048224c090000000000000000000000000000000000000000000000000000800000040808401020089210800000000000000000000000000000000000000040000000204000004044080020044120800000000000000000000000000000000000000009000205040000000000000000000000000000080000004800000000000000000000100041a23104040000028cb381800800200000002828ac01000000000000000000000000000000000001001108b2080000802993c5008000010002809b00900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x20000000000000000000000000000822224010000000000000000000010000000028144920020000000000000000000000000000000040088228804000000000000000000010001401152024000000000000000000000000000000010022045102400000000000000020000400004011482200000000000000000000000000800040004045022000000000000000800040000000882810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802548000000000000000000000000000000000000000000000000400001801000840b04d8019000000000000000000000000000000000000000000000000000000000000400002300c2d81340000000000000000000000000000000000000000000000000000000001000830001000c3611a000000000000000000000000000000000000000000000000002000100103000400066160d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040254800000000000000000000000000000000000000000100003020004040201010000000008a0a245008000000000000000000000000000000000000000000000200000081000000020000a918aa0480000000000000000000000000000000000000000000000080000008201800008000050c541080000000000000000000000000000000000000040000080000002401400010000000620a080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088000000000000000040001180454680800000000000000000000000020000000400004000010100000400000000000000000000130311689000000000000000000000000000000008000080400000400000000000000000000026051168480000000000000000000000000000001000010010000020000000004000080004020508a508000000000000000000000000008008000100080000200000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000a2040000000000000000000000000000020000000028d0040000000000000000000000000a000008101004920080000000000000000000000000000016804800000000000000000000008000008101002490120000000000000000000000800000000160102000000000000000000005200000408001240420000000000000000000010000000004050100000000000000040002900000401002012080000000000000000000000000000000000000000000000000000000000000000000000000000000020014000000000000000400222004800000000000000000000000000000004000008000004080001248040000000000000000020008a008800000000000000000000000000000002000000400024c050000000000000000000800228091000000000000000000000000000000020200000200024810400000000004000000800110211000000000000000000000000800002010000001002018200000000010000c000002841000000000000000000000000000000000000000000000000000000000000000000000802548000000000000000000000000000000000000000000000000400001801000840b04d0019000000000000000000000000000000000000000000000000000000000000400002200c2d01340000000000000000000000000000000000000000000000000000000001000820001000c3411a000000000000000000000000000000000000000000000000002000100102000400064160d00000000000000000000000000000000000000000000008000190c10000000000000000000000000000000000000000000002009640000000000000000000000000000000000000000000004000060100080161200a2000000000080400000000000000000000000000000000000000000000000002000040064804a8000000010240000000000000000000000000000000000000000000000000004000080019414a80000000084000000000000000000000000000000000000000002000200400010000d0a854000000000400000000000000000000000000000000000000100034310000001000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x9000000000000000000000820100000000000000000000004000020122402440000000010010000000000000000000000000000008884000000000000000000000020012825400000001002000000000000000000000000000002201000000000000000000000000400150a1500000000010000000000000000000000000000280080000000000000020000004000a2a0a80000000008000000000000000000080000044020000000000000000222000000800000000000800000100000000000004080200000000000802548000000000000000000000000000000000000000000000000400001801000840b04d0019000000000000000000000000000000000000000000000000000000000000400002200c2d01340000000000000000000000000000000000000000000000000000000001000820001000c3411a000000000000000000000000000000000000000000000000002000100102000400064160d00000000000000000000000000000000000000000000000000190c10000000000000000000000000000000000204000000002009640000000000000000000000000000000000000000000004000060100080161200a2000000000080400000000000000000000000000000000000000000000000002000040064804a8000000010240000000000000000000000000000000000000000000000000004000080019414a80000000084000000000000000000000000000000000000000002000200400010000d0a8540000000004000000000000000000000000000000000000000000343100000010000000000000000000000000000008000800000000002004a9000000000100004000800400000904546808000000000000000010000018008100210502280500000000000000000000000040000000123116890000000000000000000200008044041502600000000000000000000000010000000024511684800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000880500048020000000000000000000000000004000020122402440000000010010000000000010040002008030900400000000000000000000000000020012025400000001002000000000040100002008118480900000000000000000000000000000400140a1500000000010000000002900400010010c2021000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200082a2244101000000231a020000000000000000000000000000000000000000000000000000000004008822890400040083a090000000000000000000000000000000000000000000000000000010022045122400020040e822000000000000000000000000000000000000000000000008000400040452260008000185040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000209118040000000000000000000020000000a28d80400000000000000000000000000000000000010002411602000000000000000000002001816c0480000000000000000000000000000000000800120458280000000000000000080008002016810200000000000000000000000000100000800080450840000000000000001000400000505010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000004122300400000000000000000000200000002828ac01000000000000000000000000000000000001001108b008000000000000000000010002809b00900000000000000000000000000000000004004422c09000000000000000004000400020026821000000000000000000000000000400010001011421000000000000000100020000001214080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x408204000000000000000400000004338080000000000000000000000000000800000100020a000808001004000000000000000000800103c500000000000000000000000000000000010080020080010020000000000000000000800101e2400000000000000000000000000000000204200100400001000000000000020000800001988000000000000000000000000000040202102000400002000000000000000000188000000000000000000080020000800000002000080000000000000000002009640000000000000000000000000000000000000000000004000060100080161200a2000000000080400000000000000000000000000000000000000000000000002000040064804a8000000010240000000000000000000000000000000000000000000000000004000080019414a80000000084000000000000000000000000000000000000000002000200400010000d0a85400000000040000000000000000000000000000000000000000003431000000100000000000000000000000000000082008000000000001a00940000000000000000000000000000000000000000000000100000100041000080020040800a124c0400000000000000000000000000000000000000000000000001000000002004080402824e050000000000000000000000000000000000000000000000000000400000020201080202024c1040000000000000000000000000000000000000000080000008080000201101000100241820000000000000000000000000000000000000000004800020a1080000000000000000000000000000005000000000000034009400000000000000000000000000000000000000000000000000400000100020040004002020809089301000000000000000000000000000000000000000000000000008000000001004101048224c0900000000000000000000000000000000000000000000000000008000000408084010200892108000000000000000000000000000000000000000400000002040000040440800200441208000000000000000000000000000000000000000090002050420000000000000000000000000000a00000000001a00940000040000008004412230048000000000000000000000100000100041000080020040800a124c040000000000000009021108b008800000000000000000000001000000002004080402824e05000000000000000044084422c0910000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034009400000020000000100088222240120000000000000000000000400000100020040004002020809089301000000000000002410882288048000000000000000000000008000000001004101048224c0900000000000000090422045102480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000408204000000000040000400054604b38080000000000000000000000000000800000100020a000808001004000000000000000001916193c500000000000000000000000000000000010080020080010020000000000000000001916149e240000000000000000000000000000000020420010040000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000084050403110040000000000000000000000000200000000028a8010000000000000000000000002800800420405140200000000000000000000000000000009a00900000000000000000000000800800210209450280000000000000000000004000000000026021000000000000000000000340200108021440840000000000000000000100000000001014080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x20000000000000000a2040000000000000000000000000000020000000028d0040000000000000000000000000a00000810100492008000000000000000000000000000001680480000000000000000000000800000810100249012000000000000000000000080000000016010200000000000000000000520000040800124042000000000000000000001000000000405010000000000000004000290000040100201208000000000000000000014400000000000000000000000000000000000000000000000000000024000000001050000000000000000000000000000000010000202450044000000000040000000000000001000040001844002000000000000000000000000000020050228000000000400000000000000000100001844011000000000000000000000000000000800a082800000000040000000001000000040000c101080000000000000000000004000008002140a0000000002000020000000000010000c0441000000000000000000000004480000404000000000008a0000000000000000000000000000000000000000000000000000084c0200000008222240100000000000000000000000000000000000000000000000000000002000004009404000400882288040000000000000000000000000000000000000000000000000000004004a0900010022045102400000000000000000000000000000000000000000008000020000000242900040004045022000000000000000000000000000000000000000000000040000002092400800010a10000000000000000000000000002000001082000108000000000000000000000000802548000000000000000000000000000000000000000000000000400001801000840b04d0019000000000000000000000000000000000000000000000000000000000000400002200c2d01340000000000000000000000000000000000000000000000000000000001000820001000c3411a000000000000000000000000000000000000000000000000002000100102000400064160d00000000000000000000000000000000000000000000008000190c10000000000000000000000000000000000304000000040254800000000000008002091180480000000000000000100003020004040201010000000008a0a245008000000000000001100024116022000000000000000000200000081000000020000a918aa04800000000000000108001204582880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001060c4c020000000000000000000004000000851a01000000000000000000000000000000080000600090440940400000000000000000000200103a048000000000000000000000000000000010000904204a0900000000000000000000010004074108000000000000000000000000048000020022010242100000000000000000200400000c2820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002009640000000000000000000000000000000000000000000004000060100080161200a2000000000080400000000000000000000000000000000000000000000000002000040064c04a8000000010240000000000000000000000000000000000000000000000000004000080019614a80000000084000000000000000000000000000000000000000002000200400010000d8a854000000000400000000000000000000000000000000000000000034310000001000000000000000000000000000000000000000000000000000000000000084c0200000008222240100000000000000000000000000000000000000000000000000000002000004009404000400882288040000000000000000000000000000000000000000000000000000004004a0900010022045102400000000000000000000000000000000000000000008000020000000242900040004045022000000000000000000000000000000000000000000000040000002092400800010a100000000000000000000000000020000010800001080000000000000000000))))) + (NatTree.node 40 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x2009640000000000000000000000000000000000000000000004000060100080161200a2000000000080400000000000000000000000000000000000000000000000002000040064c04a8000000010240000000000000000000000000000000000000000000000000004000080019614a80000000084000000000000000000000000000000000000000002000200400010000d8a854000000000400000000000000000000000000000000000000000034310000001000000000000000000000000000000820080000000000000000000000000084c0200000008222240100000000000000000000000000000000000000000000000000000002000004009404000400882288040000000000000000000000000000000000000000000000000000004004a0900010022045102400000000000000000000000000000000000000000008000020000000242900040004045022000000000000000000000000000000000000000000000040000002092400800010a10000000000000000000000000002000001082000109000000000000000000400000802548000000000000000000000000101190040000000000000000400001801000840b04d8019000000000000000000000000000000000004013211000000000000000000400002300c2d81340000000000000000000000000000000000100264110000000000000001000830001000c3611a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014009400000000000000020000080004001000000231a020000000000000000000200400040020208090893010000000000000000000000010000040083a0900000000000000000000001004101048224c0900000000000000000000000020000020040e822000000000000000000004080840102008921080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084c0200000008222240100000000000000000000000000000000000000000000000000000002000004009404000400882288040000000000000000000000000000000000000000000000000000004004a0900010022045102400000000000000000000000000000000000000000008000020000000242900040004045022000000000000000000000000000000000000000000000040000002092400800010a10000000000000000000000000002000001082000109000000000000000000000000000000000000000000000000000040000400054604b380800000000000000000000000000000000000000000000000000000000000000000000001916193c500000000000000000000000000000000000000000000000000000000000000000001916149e2400000000000000000000000000000000000000000000000000000000800020001888509988000000000000000000000000000000000000000000000000000020008000050988000000000000000000000000000000000402042880000000000000000002009640000000000000000000000000000000000000000000004000060100080161200a2000000000080400000000000000000000000000000000000000000000000002000040064804a8000000010240000000000000000000000000000000000000000000000000004000080019414a80000000084000000000000000000000000000000000000000002000200400010000d0a854000000000400000000000000000000000000000000000000100034310000001000000000000000000000000000000c2008000000000000a00940000000000001000008001000400000284b38080000000000000000041000080020040800a124c04000000000000000000000002000000802993c5000000000000000000002004080402824e0500000000000000000000000008000000802949e240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x2009640000000000080280000000000000000000000000000004000060100080161200a2000000000080400000000000020020400020000000000000000000000000002000040064804a8000000010240000000000002000020000800000000000000000000000000004000080019414a80000000084000000000000080010000800000000000000000002000200400010000d0a8540000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000002088890100000000000000000000010000000000a022450080000000000000000000000000000010004422902000000000000000000000200002808aa04800000000000000000000000000000020008822909000000000000000008000080000404541080000000000000000000000001000080008114210000000000000000400010000000220a080000000000000000000000400100008a10000000000000000000000000000000000000000000000000000000000000000000000000000000000001000048001000408002284b380c00000000000000000000000000000000000000000000000000000000000000002000008842993c580000000000000000000000000000000000000000000000000000000000008000010842949e260000000000000000000000000000000000000000000000000000000000106001082050998c00000000000000000000000000000000000000000000000000000000800620098a000000000000000000000000000000000000000000000000000000000040254800000000000000000000000000000000000000000100003020004040201010000000008a0a245008000000000000000000000000000000000000000000000200000081000000020000a918aa0480000000000000000000000000000000000000000000000080000008201800008000050c541080000000000000000000000000000000000000040000080000002401400010000000620a08000000000000000000000000000000000000000080000000064100000000000000000000000000000000000000000000000020014000000000000000400222004800000000000000000000000000000004000008000004080001248040000000000000000020008a008800000000000000000000000000000002000000400024c050000000000000000000800228091000000000000000000000000000000020200000200024810400000000004000000800110211000000000000000000000000800002010000001002018200000000010000c0000028410000000000000000004000020a100000000000000000000000000000000000000000000000000200040a204000000000000000000000000000000000000000000000000000000000800000100020a000808101484928080000000000000000000000000000000000000000000000000000001008002028101482494120000000000000000000000000000000000000000000000000000000205200104408041248420000000000000000000000000000000000000000000000000040202902008401002412080000000000000000000000000000000000080020040a10000000000000000000000000000000000000048000000000000200000000200082088890140000000000000000000000040000000400100000400000000000000000000000000011040442290280000000000000000000000000100000000800000000000000000000000000004208088229094000000000000000000000000008000000080000000000000000000000010008808081142140000000000000002000000008000000008000000000000000000000400302008a12000000000000000000040000000000000008000a510000000000000000000024000000001050000000000000000000000000000000010000202450044000000000040000000000000001000040001844002000000000000000000000000000020050228000000000400000000000000000100001844011000000000000000000000000000000800a082800000000040000000001000000040000c101080000000000000000000004000008002140a0000000002000020000000000010000c0441000000000000000000000004480000404000000000008a0000000000000000002000100000000)) + (NatTree.node 8 (NatTree.leaf 0x209118040000000208889010000000000000000000000000000000000000000000000000000000010002411602000100044229020000000000000000000000000000000000000000000000000008001204582800020008822909000000000000000000000000000000000000000000001000008000804509400080008114210000000000000000000000000000000000000000002000020000010a500000008a10000000000000000000000000000000000000000000000000000000000000000000000000144000000000000020000880004001040080231a030000000000000000000000000000010001040040001000000000000000000000010000244083a098000000000000000000000000000002001000010000000000000000000000020000222040e823000000000000000000000000000008000400008000000000000000000002040088200185060000000000000000000200000004000100008000000000000000000000c4018a00000000000000000000000000000000000000000000000000000000000802548000000000000000000000000000000000000000000000000400001801000840b04d8019000000000000000000000000000000000000000000000000000000000000400002300c2d81340000000000000000000000000000000000000000000000000000000001000830001000c3611a000000000000000000000000000000000000000000000000002000100103000400066160d00000000000000000000000000000000000000000000000000190c10000000000000000000000000000000000000000000040254800000000000000000000000000000000000000000100003020004040201010000000008a0a245008000000000000000000000000000000000000000000000200000081000000020000a918aa0480000000000000000000000000000000000000000000000080000008201800008000050c541080000000000000000000000000000000000000040000080000002401400010000000620a08000000000000000000000000000000000000000080020000064100000000000000000000000000000000000000000000000000000200040a204000000000000000000000000000000000000000000000000000000000800000100020a000808101484928080000000000000000000000000000000000000000000000000000001008002028101482494120000000000000000000000000000000000000000000000000000000205200104408041248420000000000000000000000000000000000000000000000000040202902008401002412080000000000000000000000000000000000080420040a100000000000000000000000000001402d2254a20008a11062c4c0240120088aa2244121040081231a030014004018010000442009001100040000000000044009004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040254800000000000008002091180480000002088890100100003020004040201010000000008a0a245008000000000000001100024116022001000442290200000200000081000000000000a918aa04800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020008a00000000000000000040000020002004000000851a01000000000002000000040000400001010204844920080000000000000000000004000200103a048000000000000000000008000082408120449202400000000000000000000004000100040741080000000000000000001020010810202022442200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x40254800000000000000000000000000000000000000000100003020004040201010000000008a0a245008000000000000000000000000000000000000000000000200000081000000020000a918aa0480000000000000000000000000000000000000000000000080000008201800008000050c541080000000000000000000000000000000000000040000080000002401400010000000620a08000000000000000000000000000000000000000080020000064100000000000000000000000000000000010000000000000000000200040a204000000000000000000000000000000000000000000000000000000000800000100020a000808101484928080000000000000000000000000000000000000000000000000000001008002028101482494120000000000000000000000000000000000000000000000000000000205200104408041248420000000000000000000000000000000000000000000000000040202902008401002412080000000000000000000000000000000000080420040a1000000000000000000000000200000b489651000942045860504920445a231048408002294b380c014008060100000840200820004000000804000008008280000000040400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000200040a2040000000000000000010000020020020000000a28d8040000000000000800000100020a000808101484928080000000000000000000200002001816c0480000000000000000000100800202810148249412000000000000000000001080008002016810200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008025480000000000002000a0000000000000000000000000000000400001801000840b04d0019000000000000000000000000402080010000000000000000000000000000400002200c2d01340000000000000000000000020002000400000000000000000000000001000820001000c3411a000000000000000000000010002000200000000000000000002000100102000400064160d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000209118040000000000000000000020000000a28d80400000000000000000000000000000000000010002411602000000000000000000002001816c04800000000000000000000000000000000008001204582800000000000000000800080020168102000000000000000000000000001000008000804508400000000000000010004000005050100000000000000000000000002000020000010a1000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000004122300400000000000000000000200000002828ac01000000000000000000000000000000000001001108b008000000000000000000010002809b00900000000000000000000000000000000004004422c090000000000000000040004000200268210000000000000000000000000004000100010114210000000000000001000200000012140800000000000000000000000010000400004284000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000822224010000000000000000000010000000028144920020000000000000000000000000000000040088228804000000000000000000010001401152024000000000000000000000000000000010022045102400000000000000020000400004011482200000000000000000000000000800040004045022000000000000000800040000000882810000000000000000000000002000800010a100000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x802548000000000000000000000000000000000000000000000000400001801000840b04d8019000000000000000000000000000000000000000000000000000000000000400002300c2d81340000000000000000000000000000000000000000000000000000000001000830001000c3611a000000000000000000000000000000000000000000000000002000100103000400066160d00000000000000000000000000000000000000000000000000190c10000000000000000000000000000000000204000000000000000000200040a204000000000000000000000000000000000000000000000000000000000800000100020a000808101484928080000000000000000000000000000000000000000000000000000001008002028101482494120000000000000000000000000000000000000000000000000000000205200104408041248420000000000000000000000000000000000000000000000000040202902008401002412080000000000000000000000000000000000080420040a110000000000000000000000020000000000000000020418605060b11804000000000000000000000000000000000000000000000000000000100002800086800901420645160200000000000000000000000000000000000000000000000000010000210800900a103294582800000000000000000000000000000000000000000000000000044000103402201080a14508400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050800000000000000000000000000000002088890100000000020000040001010000000008a0a245008000000000000000000000000000001000442290200000000000080000000020000a918aa0480000000000000000000000000000002000882290900000000000008001800008000050c54108000000000000000000000000100008000811421000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000209118040000000208889010000000000000000000000000000000000000000000000000000000010002411602000100044229020000000000000000000000000000000000000000000000000008001204582800020008822909000000000000000000000000000000000000000000001000008000804509400080008114210000000000000000000000000000000000000000002000020000010a500100008a10000000000000000000000000000000000000000000000000000000000000000000000000088000000000000000040001180454680800000000000000000000000020000000400004000010100000400000000000000000000130311689000000000000000000000000000000008000080400000400000000000000000000026051168480000000000000000000000000000001000010010000020000000004000080004020508a508000000000000000000000000008008000100080000200000000000020000048450800000000000000000000000000000000000000000000000000000000000040254800000000000000000000000000000000000000000100003020004040201010000000008a0a245008000000000000000000000000000000000000000000000200000081000000020000a918aa0480000000000000000000000000000000000000000000000080000008201800008000050c541080000000000000000000000000000000000000040000080000002401400010000000620a08000000000000000000000000000000000000000080020000064120000000000000000000000000000000000000000000000000000200040a204000000000000000000000000000000000000000000000000000000000800000100020a000808101484928080000000000000000000000000000000000000000000000000000001008002028101482494120000000000000000000000000000000000000000000000000000000205200104408041248420000000000000000000000000000000000000000000000000040202902008401002412080000000000000000000000000000000000080420040a1100000000000000000000000000)))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x200040a204000000000000000000000000000000000000000000000000000000000800000100020a000808101484928080000000000000000000000000000000000000000000000000000001008002028101482494120000000000000000000000000000000000000000000000000000000205200104408041248420000000000000000000000000000000000000000000000000040202902008401002412080000000000000000000000000000000000080420040a1100000000000000000000000280000000000340094000000200000001200882a2244121000000231a020000000004000001000200400040020208090893010000000000000024108822890480040083a0900000000000008000000001004001048224c0900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020418605060b11804000000000000000000000000000000000000000000000000000000100002800086800901420645160200000000000000000000000000000000000000000000000000010000210800900a103294582800000000000000000000000000000000000000000000000000044000103402209080a145084000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000418604040200000000000000001000000231a020000000000000000000000000000001000008000868009004004040000000000000000040083a090000000000000000000000000000000000021080090020020900000000000000000020040e8220000000000000000000000000000004000102402201000210000000000000400080001850400000000000000000000000040002002004410082000040000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000002088890100000000000000000000010000000000a022450080000000000000000000000000000010004422902000000000000000000000200002808aa04800000000000000000000000000000020008822909000000000000000008000080000404541080000000000000000000000001000080008114210000000000000000400010000000220a080000000000000000000000400100008a10000000000000000241000000000000000000000000000000000000000000000000000000144000000000000020000880004001040080231a030000000000000000000000000000010001040040001000000000000000000000010000244083a098000000000000000000000000000002001000010000000000000000000000020000222040e823000000000000000000000000000008000400008000000000000000000002040088200185060000000000000000000200000004000100008000000000000000000000c4018a0000000004000000000000800000000000000000000000000000000020000000000000000a2040000000000000000000000000000020000000028d0040000000000000000000000000a000008101004920080000000000000000000000000000016804800000000000000000000008000008101002490120000000000000000000000800000000160102000000000000000000005200000408001240420000000000000000000010000000004050100000000000000040002900000401002012080000000000000000000144000000000000080020040a00000000000000000000000000000040254800000000000000000000000000000000000000000100003020004040201010000000008a0a245008000000000000000000000000000000000000000000000200000081000000020000a918aa0480000000000000000000000000000000000000000000000080000008201800008000050c541080000000000000000000000000000000000000040000080000002401400010000000620a0800000000000000000000000000000000000000008002000006410000000000000000000000000000020001000000) + (NatTree.leaf 0x2009640000000000080280000000000000000000000000000004000060100080161200a2000000000080400000000000020020400020000000000000000000000000002000040064804a8000000010240000000000002000020000800000000000000000000000000004000080019414a80000000084000000000000080010000800000000000000000002000200400010000d0a854000000000400040000000020010002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200082a2244101000000231a020000000000000000000000000000000000000000000000000000000004008822890400040083a090000000000000000000000000000000000000000000000000000010022045122400020040e82200000000000000000000000000000000000000000000000800040004045226000800018504000000000000000000000000000000000000000000002000800010a100000188000000000000000000000000000000000000000000000000000000002000000000000000000000209118040000000000000000000020000000a28d80400000000000000000000000000000000000010002411602000000000000000000002001816c04800000000000000000000000000000000008001204582800000000000000000800080020168102000000000000000000000000001000008000804508400000000000000010004000005050100000000000000000000000002000020000010a1000000000000000014400000000000000000000000000000000000000000000000000000080000000000000000000000004122300400000000000000000000200000002828ac01000000000000000000000000000000000001001108b008000000000000000000010002809b00900000000000000000000000000000000004004422c090000000000000000040004000200268210000000000000000000000000004000100010114210000000000000001000200000012140800000000000000000000000010000400004284000000000000000484000000000000000000000000000000000000000000000000000020000000000000000000000000000822224010000000000000000000010000000028144920020000000000000000000000000000000040088228804000000000000000000010001401152024000000000000000000000000000000010022045102400000000000000020000400004011482200000000000000000000000000800040004045022000000000000000800040000000882810000000000000000000000002000800010a10000000000000002210000000000000000000000000000000000000000000000000000000000088000000000000000040001180454680800000000000000000000000020000000400004000010100000400000000000000000000130311689000000000000000000000000000000008000080400000400000000000000000000026051168480000000000000000000000000000001000010010000020000000004000080004020508a508000000000000000000000000008008000100080000200000000000020000048450800000000000000000000040001000000000000000000000000000000000020000000000000000a2040000000000000000000000000000020000000028d0040000000000000000000000000a000008101004920080000000000000000000000000000016804800000000000000000000008000008101002490120000000000000000000000800000000160102000000000000000000005200000408001240420000000000000000000010000000004050100000000000000040002900000401002012080000000000000000000144000000000000080020040a00000000000000001000000000000040254800000000000000000000000000000000000000000100003020004040201010000000008a0a245008000000000000000000000000000000000000000000000200000081000000020000a918aa0480000000000000000000000000000000000000000000000080000008201800008000050c541080000000000000000000000000000000000000040000080000002401400010000000620a0800000000000000000000000000000000000000008002000006410000000000000000000000000000020001800000)) + (NatTree.node 8 (NatTree.leaf 0x11060c4c024041223004000000000000000000000000000000000000000000000000000000080001600090440941441108b008000000000000000000000000000000000000000000000000000050000904204a0d104422c0900000000000000000000000000000000000000000000000048000420022050242110101142100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014800000000001000048001000408002284b380c00000000000000000000000000100000804010000200000000000000000000002000008842993c580000000000000000000000000000100200008000000000000000000000008000010842949e260000000000000000000000000000400200002000000000000000000000106001082050998c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000880500048020000000000000000000000000004000020122402440000000010010000000000010040002008030900400000000000000000000000000020012025400000001002000000000040100002008118480900000000000000000000000000000400140a1500000000010000000002900400010010c2021000000000000000000002000000400082a0a8000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002009640000000000000000000000010401000000000000000004000060100080161200a2000000000080400000000000000000000000000044210000000000000000002000040064c04a8000000010240000000000000000000000000001104200000000000000000004000080019614a80000000084000000000000000000000000000a10200000000002000200400010000d8a854000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008025480000000000002000a0000000000000000000000000000000400001801000840b04d0019000000000000000000000000402080010000000000000000000000000000400002200c2d01340000000000000000000000020002000400000000000000000000000001000820001000c3411a000000000000000000000010002000200000000000000000002000100102000400064160d0000000000000100000000400800800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200082a2244101000000231a020000000000000000000000000000000000000000000000000000000004008822890400040083a090000000000000000000000000000000000000000000000000000010022045122400020040e82200000000000000000000000000000000000000000000000800040004045226000800018504000000000000000000000000000000000000000000002000800010a1004001880000000000000000000000000000000000000000000000000000000000000020014000000000000000400222004800000000000000000000000000000004000008000004080001248040000000000000000020008a008800000000000000000000000000000002000000400024c050000000000000000000800228091000000000000000000000000000000020200000200024810400000000004000000800110211000000000000000000000000800002010000001002018200000000010000c0000028410000000000000000004000020a1000000000800041210000000000000000000000a0000000000200040a2040209118040000000218889030020020000000a28d8040000000000000800000100020a00080810149492a491602000100044229020200000001816c0480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x2004a90000000001000040008004000009045468080000000000000000100000180081002105022805000000000000000000000000400000001231168900000000000000000002000080440415026000000000000000000000000100000000245116848000000000000000040010400810020a0860000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011060c4c024041223004000000000000000000000000000000000000000000000000000000080001600090440941441108b008000000000000000000000000000000000000000000000000000050000904204a0d104422c0900000000000000000000000000000000000000000000000048000420022050243110101142100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802548000000000000000000000000101190040000000000000000400001801000840b04d8019000000000000000000000000000000000004013211000000000000000000400002300c2d81340000000000000000000000000000000000100264110000000000000001000830001000c3611a000000000000000000000000040002000000245080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001060c4c020000000000000000000004000000851a01000000000000000000000000000000080000600090440940400000000000000000000200103a048000000000000000000000000000000010000904204a0900000000000000000000010004074108000000000000000000000000048000020022010242100000000000000000200400000c28200000000000000000000000020000040100822090400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000418604040200000000000000001000000231a020000000000000000000000000000001000008000868009004004040000000000000000040083a090000000000000000000000000000000000021080090020020900000000000000000020040e8220000000000000000000000000000004000102402201000210000000000000400080001850400000000000000000000000040002002004410082000040000000000000001880000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000002088890100000000000000000000010000000000a022450080000000000000000000000000000010004422902000000000000000000000200002808aa04800000000000000000000000000000020008822909000000000000000008000080000404541080000000000000000000000001000080008114210000000000000000400010000000220a080000000000000000000000400100008a10000000000000000241000000000000000008000840000000000000000000000000000000000000000001000048001000408002284b380c00000000000000000000000000000000000000000000000000000000000000002000008842993c580000000000000000000000000000000000000000000000000000000000008000010842949e260000000000000000000000000000000000000000000000000000000000106001082050998c00000000000000000000000000000000000000000000000000000000800620098a000000000000000000000000000000000002000cc8000000000000000040254800000000000000000000000000000000000000000100003020004040201010000000008a0a245008000000000000000000000000000000000000000000000200000081000000020000a918aa0480000000000000000000000000000000000000000000000080000008201800008000050c541080000000000000000000000000000000000000040000080000002401400010000000620a0800000000000000000000000000000000000000008002000006412000000000000000000000000000020001900000) + (NatTree.leaf 0x144000000000000020000880004001040080231a030000000000000000000000000000010001040040001000000000000000000000010000244083a098000000000000000000000000000002001000010000000000000000000000020000222040e823000000000000000000000000000008000400008000000000000000000002040088200185060000000000000000000200000004000100008000000000000000000000c4018a00000000040000000000008000000000000100261000000000000000000000014009400000000000000020000080004001000000231a020000000000000000000200400040020208090893010000000000000000000000010000040083a0900000000000000000000001004101048224c0900000000000000000000000020000020040e822000000000000000000004080840102008921080000000000000000000002040008000185040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000084050403110040000000000000000000000000200000000028a8010000000000000000000000002800800420405140200000000000000000000000000000009a009000000000000000000000008008002102094502800000000000000000000040000000000260210000000000000000000003402001080214408400000000000000000001000000000010140800000000000002000006400082020040a1000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000209118040000000000000000000020000000a28d80400000000000000000000000000000000000010002411602000000000000000000002001816c04800000000000000000000000000000000008001204582800000000000000000800080020168102000000000000000000000000001000008000804508400000000000000010004000005050100000000000000000000000002000020000010a1000000000000000014400000000000000000010000044000000000000000000000000000080000000000000000000000004122300400000000000000000000200000002828ac01000000000000000000000000000000000001001108b008000000000000000000010002809b00900000000000000000000000000000000004004422c090000000000000000040004000200268210000000000000000000000000004000100010114210000000000000001000200000012140800000000000000000000000010000400004284000000000000000484000000000000000000080004100000000000000000000000000020000000000000000000000000000822224010000000000000000000010000000028144920020000000000000000000000000000000040088228804000000000000000000010001401152024000000000000000000000000000000010022045102400000000000000020000400004011482200000000000000000000000000800040004045022000000000000000800040000000882810000000000000000000000002000800010a10000000000000002210000000000000000002000108000000000000000000000000000000000000000000001000048001000408002284b380c00000000000000000000000000000000000000000000000000000000000000002000008842993c580000000000000000000000000000000000000000000000000000000000008000010842949e260000000000000000000000000000000000000000000000000000000000106001082050998c00000000000000000000000000000000000000000000000000000000800620098a000000000000000000000000000000000002000cc8000000000000010000000003400940011060c4c02404322300c0004001000000231a0200000000040000010002004000400202080988931700090440941441108b0080010000000083a0900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))))))) + (NatTree.node 152 (NatTree.node 72 (NatTree.node 32 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x1060c4c020000000000000000000004000000851a01000000000000000000000000000000080000600090440940400000000000000000000200103a048000000000000000000000000000000010000904204a0900000000000000000000010004074108000000000000000000000000048000020022010242100000000000000000200400000c28200000000000000000000000020000040100822090400000000000000000188000000000000000000000000000000000000000000000000000000000000000000000418604040200000000000000001000000231a020000000000000000000000000000001000008000868009004004040000000000000000040083a090000000000000000000000000000000000021080090020020900000000000000000020040e822000000000000000000000000000000400010240220100021000000000000040008000185040000000000000000000000004000200200441008200004000000000000000188000000000000000000002001000080000000000000000000000000000000000000000000000000209118040000000208889010000000000000000000000000000000000000000000000000000000010002411602000100044229020000000000000000000000000000000000000000000000000008001204582800020008822909000000000000000000000000000000000000000000001000008000804509400080008114210000000000000000000000000000000000000000002000020000010a500100008a100000000000000000000000000010000044880008400000000000000000002000000000000000000000209118040000000000000000000020000000a28d80400000000000000000000000000000000000010002411602000000000000000000002001816c04800000000000000000000000000000000008001204582800000000000000000800080020168102000000000000000000000000001000008000804508400000000000000010004000005050100000000000000000000000002000020000010a1000000000000000014400000000000000000010000044000000001000100000000000000080000000000000000000000004122300400000000000000000000200000002828ac01000000000000000000000000000000000001001108b008000000000000000000010002809b00900000000000000000000000000000000004004422c090000000000000000040004000200268210000000000000000000000000004000100010114210000000000000001000200000012140800000000000000000000000010000400004284000000000000000484000000000000000000080004100000000400020000000000000020000000000000000000000000000822224010000000000000000000010000000028144920020000000000000000000000000000000040088228804000000000000000000010001401152024000000000000000000000000000000010022045102400000000000000020000400004011482200000000000000000000000000800040004045022000000000000000800040000000882810000000000000000000000002000800010a1000000000000000221000000000000000000200010800000008000800000000000000000020008a00000000000000000040000020002004000000851a01000000000002000000040000400001010204844920080000000000000000000004000200103a04800000000000000000000800008240812044920240000000000000000000000400010004074108000000000000000000102001081020202244220000000000000000000010200400000c282000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000209118040000000208889010000000000000000000000000000000000000000000000000000000010002411602000100044229020000000000000000000000000000000000000000000000000008001204582800020008822909000000000000000000000000000000000000000000001000008000804509400080008114210000000000000000000000000000000000000000002000020000010a500100008a100000000000000000000000000010000044800008400000000000000000) + (NatTree.leaf 0x88000000000000000040001180454680800000000000000000000000020000000400004000010100000400000000000000000000130311689000000000000000000000000000000008000080400000400000000000000000000026051168480000000000000000000000000000001000010010000020000000004000080004020508a50800000000000000000000000000800800010008000020000000000002000004845080000000000000000000004000100000010040824200000000000000000000000000000000000000000209118040000000208889010000000000000000000000000000000000000000000000000000000010002411602000100044229020000000000000000000000000000000000000000000000000008001204582800020008822909000000000000000000000000000000000000000000001000008000804509400080008114210000000000000000000000000000000000000000002000020000010a500100008a100000000000000000000000000010000044880008500000000000000000000000000000000000000000000000200082a2244101000000231a020000000000000000000000000000000000000000000000000000000004008822890400040083a090000000000000000000000000000000000000000000000000000010022045122400020040e82200000000000000000000000000000000000000000000000800040004045226000800018504000000000000000000000000000000000000000000002000800010a10040018800000000000000000000000000002000109000040000000000000000048000000000020418605060b118040000000000000080001000800200000002828ac010000000000000100002800086800901420645160200000000000000000008000010002809b0090000000000000001000021080090021032945828000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a00940000040000008004412230048000000000000000000000100000100041000080020040800a124c040000000000000009021108b008800000000000000000000001000000002004080402824e05000000000000000044084422c091000000000000000000000000400000020201080202024c104000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034009400000020000000100088222240120000000000000000000000400000100020040004002020809089301000000000000002410882288048000000000000000000000008000000001004101048224c090000000000000009042204510248000000000000000000000000800000040808401020089210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100041a231040400000284b3808000000000000000000000000000000000000000000000000000000001001108b2080000802993c5000000000000000000000000000000000000000000000000000004004422c8900000802949e24000000000000000000000000000000000000000000000040001000101152700000005099880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014800000000001000048001000408002284b380c00000000000000000000000000100000804010000200000000000000000000002000008842993c580000000000000000000000000000100200008000000000000000000000008000010842949e260000000000000000000000000000400200002000000000000000000000106001082050998c00000000000000000100000000200008001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x200082a2244101000000231a020000000000000000000000000000000000000000000000000000000004008822890400040083a090000000000000000000000000000000000000000000000000000010022045122400020040e82200000000000000000000000000000000000000000000000800040004045226000800018504000000000000000000000000000000000000000000002000800010a10040018800000000000000000000000000002000109100040000000000000000000001a0094000004000000900441a231048400000284b38080000000100000100041000080020040800a124c040000000000000009021108b2088000802993c5000000000001000000002004000402824e0500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000048000000000020418605060b118040000000000000080001000800200000002828ac010000000000000100002800086800901420645160200000000000000000008000010002809b00900000000000000010000210800900a1032945828000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00940000000000001000008001000400000284b38080000000000000000041000080020040800a124c04000000000000000000000002000000802993c5000000000000000000002004080402824e0500000000000000000000000008000000802949e2400000000000000000020201080202024c10400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100041a231040400000284b3808000000000000000000000000000000000000000000000000000000001001108b2080000802993c5000000000000000000000000000000000000000000000000000004004422c8900000802949e24000000000000000000000000000000000000000000000040001000101152700008005099880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000408204000000000040000400054604b38080000000000000000000000000000800000100020a000808001004000000000000000001916193c500000000000000000000000000000000010080020080010020000000000000000001916149e2400000000000000000000000000000000204200100400001000000000800020001888509988000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002009640000000000000000000000010401000000000000000004000060100080161200a2000000000080400000000000000000000000000044210000000000000000002000040064c04a8000000010240000000000000000000000000001104200000000000000000004000080019614a80000000084000000000000000000000000000a10200000000002000200400010000d8a854000000000400000000000000000010000114080000000000000000000000000000000000000000000000000000000000000000000080000000000000084050403110040000000000000000000000000200000000028a8010000000000000000000000002800800420405140200000000000000000000000000000009a009000000000000000000000008008002102094502800000000000000000000040000000000260210000000000000000000003402001080214408400000000000000000001000000000010140800000000000002000006400082020040a1000000000000000000048400000000000000000000000000000000000000000000000) + (NatTree.leaf 0x120000000000011060c4c024041223004000000000000040000400080010000000028144920020000000000080001600090440941441108b008000000000000000000800000100014011520240000000000000050000904204a0d104422c090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040254800000000000008002091180480000000000000000100003020004040201010000000008a0a245008000000000000001100024116022000000000000000000200000081000000020000a918aa0480000000000000010800120458288000000000000000000080000008201800008000050c54108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200082a2244101000000231a020000000000000000000000000000000000000000000000000000000004008822890400040083a090000000000000000000000000000000000000000000000000000010022045122400020040e82200000000000000000000000000000000000000000000000800040004045226000800018504000000000000000000000000000000000000000000002000800010a100400188000000000000000000000000000020001091000600000000000000000000000000000000000000209118040000000208889010000000000000000000000000000000000000000000000000000000010002411602000100044229020000000000000000000000000000000000000000000000000008001204582800020008822909000000000000000000000000000000000000000000001000008000804509400080008114210000000000000000000000000000000000000000002000020000010a500100008a1000000000000000000000000000100000448800085000000000000000220000120000000000011060c4c024041223004000000000000040000400080010000000028144920020000000000080001600090440941441108b008000000000000000000800000100014011520240000000000000050000904204a09104422c09000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008025480000000000002000a0000000000000000000000000000000400001801000840b04d0019000000000000000000000000402080010000000000000000000000000000400002200c2d01340000000000000000000000020002000400000000000000000000000001000820001000c3411a000000000000000000000010002000200000000000000000002000100102000400064160d00000000000001000000004008008000000000000000000000190c10000000000000000000000000000000000000000000002009640000000000080280000000000000000000000000000004000060100080161200a2000000000080400000000000020020400020000000000000000000000000002000040064804a8000000010240000000000002000020000800000000000000000000000000004000080019414a80000000084000000000000080010000800000000000000000002000200400010000d0a85400000000040004000000002001000200000000000000000000003431000000100000000000000000000000000000000000000000000000000000000418604040200000000000000001000000231a020000000000000000000000000000001000008000868009004004040000000000000000040083a090000000000000000000000000000000000021080090020020900000000000000000020040e822000000000000000000000000000000400010240220100021000000000000040008000185040000000000000000000000004000200200441008200004000000000000000188000000000000000000002001000080000001000400000000000000))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x1060c4c020000000000000000000004000000851a01000000000000000000000000000000080000600090440940400000000000000000000200103a048000000000000000000000000000000010000904204a0900000000000000000000010004074108000000000000000000000000048000020022010242100000000000000000200400000c282000000000000000000000000200000401008220904000000000000000001880000000000000000020001010800000000020008000000000000000008025480000000000002000a0000000000000000000000000000000400001801000840b04d0019000000000000000000000000402080010000000000000000000000000000400002200c2d01340000000000000000000000020002000400000000000000000000000001000820001000c3411a000000000000000000000010002000200000000000000000002000100102000400064160d00000000000001000000004008008000000000000000000000190c10000000100000002020000000000000000200000000002009640000000000080280000000000000000000000000000004000060100080161200a2000000000080400000000000020020400020000000000000000000000000002000040064804a8000000010240000000000002000020000800000000000000000000000000004000080019414a80000000084000000000000080010000800000000000000000002000200400010000d0a854000000000400040000000020010002000000000000000000000034310000001040000000200400000000000000000000000000000008025480000000000002000a0000000000000000000000000000000400001801000840b04d0019000000000000000000000000402080010000000000000000000000000000400002200c2d01340000000000000000000000020002000400000000000000000000000001000820001000c3411a000000000000000000000010002000200000000000000000002000100102000400064160d00000000000001000000004008008000000000000000000000190c10000000100000002020000000000000000000000000000050800000000000000000000000000000002088890100000000020000040001010000000008a0a245008000000000000000000000000000001000442290200000000000080000000020000a918aa0480000000000000000000000000000002000882290900000000000008001800008000050c541080000000000000000000000001000080008114250000000000002001400010000000620a08000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001060c4c020000000000000000000004000000851a01000000000000000000000000000000080000600090440940400000000000000000000200103a048000000000000000000000000000000010000904204a0900000000000000000000010004074108000000000000000000000000048000020022010242100000000000000000200400000c282000000000000000000000000200000401008220904000000000000000001880000000000000000020001010800000000000000000000000000000000000000000000000000000000200082a2244101000000231a020000000000000000000000000000000000000000000000000000000004008822890400040083a090000000000000000000000000000000000000000000000000000010022045122400020040e82200000000000000000000000000000000000000000000000800040004045226000800018504000000000000000000000000000000000000000000002000800010a10040018800000000000000000000000000002000109100060000000000000400000001a00940020418605061b1180c001000400000284b38080000000100000100041000080020040800b124c2c000868009014206451602002000000002993c5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x14800000000001000048001000408002284b380c00000000000000000000000000100000804010000200000000000000000000002000008842993c580000000000000000000000000000100200008000000000000000000000008000010842949e260000000000000000000000000000400200002000000000000000000000106001082050998c00000000000000000100000000200008001000000000000000000000800620098a0000000000000000000000000000000000000000000000000000000000000000000000000408204000000000040000400054604b38080000000000000000000000000000800000100020a000808001004000000000000000001916193c500000000000000000000000000000000010080020080010020000000000000000001916149e2400000000000000000000000000000000204200100400001000000000800020001888509988000000000000000000000000000040202102000400002000000000000000000000000000000000000000000000000000000000000000000000000000000002009640000000000000000000000010401000000000000000004000060100080161200a2000000000080400000000000000000000000000044210000000000000000002000040064c04a8000000010240000000000000000000000000001104200000000000000000004000080019614a80000000084000000000000000000000000000a10200000000002000200400010000d8a854000000000400000000000000000010000114080000000000000034310000001000000000000000000000000000000000000000000080000000000000084050403110040000000000000000000000000200000000028a8010000000000000000000000002800800420405140200000000000000000000000000000009a009000000000000000000000008008002102094502800000000000000000000040000000000260210000000000000000000003402001080214408400000000000000000001000000000010140800000000000002000006400082020040a10000000000000000000484000000000000020010820c000000000000000200000000000a0000000000200040a2040000000000000000010000020020020000000a28d8040000000000000800000100020a000808101484928080000000000000000000200002001816c0480000000000000000000100800202810148249412000000000000000000001080008002016810200000000000000000020520010440804124842000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000084050403110040000000000000000000000000200000000028a8010000000000000000000000002800800420405140200000000000000000000000000000009a009000000000000000000000008008002102094502800000000000000000000040000000000260210000000000000000000003402001080214408400000000000000000001000000000010140800000000000002000006400082020040a10000000000000000000484000000000000020010820c00000000000000000000000000002009640000000000080280000000000000000000000000000004000060100080161200a2000000000080400000000000020020400020000000000000000000000000002000040064804a8000000010240000000000002000020000800000000000000000000000000004000080019414a80000000084000000000000080010000800000000000000000002000200400010000d0a8540000000004000400000000200100020000000000000000000000343100000010400000002004000000000000000008000800000000009000000000880500048020000000000000000000000000004000020122402440000000010010000000000010040002008030900400000000000000000000000000020012025400000001002000000000040100002008118480900000000000000000000000000000400140a1500000000010000000002900400010010c2021000000000000000000002000000400082a0a800000000080001000108004000800180904000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x20418605060b11804000000000000000000000000000000000000000000000000000000100002800086800901420645160200000000000000000000000000000000000000000000000000010000210800900a103294582800000000000000000000000000000000000000000000000000044000103402209080a145084000000000000000000000000000000000000000000000400020024064100a2020050a100000000000000000000000000000000000000000000000000000000000000000000000000000000014800000000001000048001000408002284b380c00000000000000000000000000100000804010000200000000000000000000002000008842993c580000000000000000000000000000100200008000000000000000000000008000010842949e260000000000000000000000000000400200002000000000000000000000106001082050998c00000000000000000100000000200008001000000000000000000000800620098a000000008000000000002000000000000000000000000000000000000002009640000000000000000000000010401000000000000000004000060100080161200a2000000000080400000000000000000000000000044210000000000000000002000040064c04a8000000010240000000000000000000000000001104200000000000000000004000080019614a80000000084000000000000000000000000000a10200000000002000200400010000d8a85400000000040000000000000000001000011408000000000000003431000000100000000000400020400000000000000000000000000000000000020418605060b11804000000000000000000000000000000000000000000000000000000100002800086800901420645160200000000000000000000000000000000000000000000000000010000210800900a103294582800000000000000000000000000000000000000000000000000044000103402209080a14508400000000000000000000000000000000000000000000040002002406410082020050a10000000000000000000000000000000000000000000000000000000000000000000000000050800000000000000000000000000000002088890100000000020000040001010000000008a0a245008000000000000000000000000000001000442290200000000000080000000020000a918aa0480000000000000000000000000000002000882290900000000000008001800008000050c541080000000000000000000000001000080008114250000000000002001400010000000620a080000000000000000000000400100008a1000000000000000000000000000000000000000000000000000000000000000009000000000880500048020000000000000000000000000004000020122402440000000010010000000000010040002008030900400000000000000000000000000020012025400000001002000000000040100002008118480900000000000000000000000000000400140a1500000000010000000002900400010010c2021000000000000000000002000000400082a0a8000000000800010001080040008001809040000000000000000000022200000080000000000000000000000000000000000000000000000002004a90000000001000040008004000009045468080000000000000000100000180081002105022805000000000000000000000000400000001231168900000000000000000002000080440415026000000000000000000000000100000000245116848000000000000000040010400810020a086000000000000000000000004280004000508a5080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014009400000000000000020000080004001000000231a020000000000000000000200400040020208090893010000000000000000000000010000040083a0900000000000000000000001004101048224c0900000000000000000000000020000020040e822000000000000000000004080840102008921080000000000000000000002040008000185040000000000000400000404408002004412080000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x11060c4c024041223004000000000000000000000000000000000000000000000000000000080001600090440941441108b008000000000000000000000000000000000000000000000000000050000904204a0d104422c090000000000000000000000000000000000000000000000004800042002205024311010114210000000000000000000000000000000000000000000002000004012092209041004284000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100041a231040400000284b3808000000000000000000000000000000000000000000000000000000001001108b2080000802993c5000000000000000000000000000000000000000000000000000004004422c8900000802949e240000000000000000000000000000000000000000000000400010001011527000080050998800000000000000000000000000000000000000000001000040000428c0020009880000000000000000000000000000000000000000000000000000000000000000014009400000000000000020000080004001000000231a020000000000000000000200400040020208090893010000000000000000000000010000040083a0900000000000000000000001004101048224c0900000000000000000000000020000020040e8220000000000000000000040808401020089210800000000000000000000020400080001850400000000000004000004044080020044120800000000000000000000004001880000000000000000000000000000000000000000000000000000000000000000000000000000000100041a231040400000284b3808000000000000000000000000000000000000000000000000000000001001108b2080000802993c5000000000000000000000000000000000000000000000000000004004422c8900000802949e240000000000000000000000000000000000000000000000400010001011527000080050998800000000000000000000000000000000000000000001000040000428c0000009880000000000000000000000000000000000000000000000000000000000048000000000020418605060b118040000000000000080001000800200000002828ac010000000000000100002800086800901420645160200000000000000000008000010002809b00900000000000000010000210800900a1032945828000000000000000000020400040002002682100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a00940000040000008004412230048000000000000000000000100000100041000080020040800a124c040000000000000009021108b008800000000000000000000001000000002004080402824e05000000000000000044084422c091000000000000000000000000400000020201080202024c104000000000040011008101142110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034009400000020000000100088222240120000000000000000000000400000100020040004002020809089301000000000000002410882288048000000000000000000000008000000001004101048224c090000000000000009042204510248000000000000000000000000800000040808401020089210800000000080024020404502240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020008a00000000000000000040000020002004000000851a01000000000002000000040000400001010204844920080000000000000000000004000200103a04800000000000000000000800008240812044920240000000000000000000000400010004074108000000000000000000102001081020202244220000000000000000000010200400000c282000000000000000800802010408020022090400000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x20008a00000000000000000040000020002004000000851a01000000000002000000040000400001010204844920080000000000000000000004000200103a04800000000000000000000800008240812044920240000000000000000000000400010004074108000000000000000000102001081020202244220000000000000000000010200400000c2820000000000000008008020104080200220904000000000000000000020018800000000000000000000000000000000000000000000000000000000050800000000000000000000000000000002088890100000000020000040001010000000008a0a245008000000000000000000000000000001000442290200000000000080000000020000a918aa0480000000000000000000000000000002000882290900000000000008001800008000050c541080000000000000000000000001000080008114250000000000002001400010000000620a080000000000000000000000400100008a1000000080000000064100000000000000000000000000000000000000000000000000000000011060c4c024041223004000000000000000000000000000000000000000000000000000000080001600090440941441108b008000000000000000000000000000000000000000000000000000050000904204a0d104422c090000000000000000000000000000000000000000000000004800042002205024311010114210000000000000000000000000000000000000000000002000004012092209441004284000000000000000000000000000000000000000000000000000000000000000000002009640000000000000000000000010401000000000000000004000060100080161200a2000000000080400000000000000000000000000044210000000000000000002000040064c04a8000000010240000000000000000000000000001104200000000000000000004000080019614a80000000084000000000000000000000000000a10200000000002000200400010000d8a8540000000004000000000000000000100001140800000000000000343100000010000000000040002040000000000008200800000000120000000000011060c4c024041223004000000000000040000400080010000000028144920020000000000080001600090440941441108b008000000000000000000800000100014011520240000000000000050000904204a0d104422c090000000000000000000102000040000401148220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040254800000000000008002091180480000000000000000100003020004040201010000000008a0a245008000000000000001100024116022000000000000000000200000081000000020000a918aa0480000000000000010800120458288000000000000000000080000008201800008000050c5410800000000010000880008045084400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00940000000000001000008001000400000284b38080000000000000000041000080020040800a124c04000000000000000000000002000000802993c5000000000000000000002004080402824e0500000000000000000000000008000000802949e2400000000000000000020201080202024c104000000000000000000000010600008005099880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802548000000000000000000000000101190040000000000000000400001801000840b04d8019000000000000000000000000000000000004013211000000000000000000400002300c2d81340000000000000000000000000000000000100264110000000000000001000830001000c3611a000000000000000000000000040002000000245080000000002000100103000400066160d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))))) + (NatTree.node 40 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x20418605060b11804000000000000000000000000000000000000000000000000000000100002800086800901420645160200000000000000000000000000000000000000000000000000010000210800900a103294582800000000000000000000000000000000000000000000000000044000103402209080a145084000000000000000000000000000000000000000000000400020024064100a2020050a10000000000000000000000000000000000020010820c40000000000000000000000000000050800000000000000000000000000000002088890100000000020000040001010000000008a0a245008000000000000000000000000000001000442290200000000000080000000020000a918aa0480000000000000000000000000000002000882290900000000000008001800008000050c541080000000000000000000000001000080008114250000000000002001400010000000620a080000000000000000000000400100008a1000000080000000064100000000000000000800084000000000000000000000009000000000880500048020000000000000000000000000004000020122402440000000010010000000000010040002008030900400000000000000000000000000020012025400000001002000000000040100002008118480900000000000000000000000000000400140a1500000000010000000002900400010010c2021000000000000000000002000000400082a0a80000000008000100010800400080018090400000000000000000000222000000804000400040045000000000000000004000200000000000000000014800000000001000048001000408002284b380c00000000000000000000000000100000804010000200000000000000000000002000008842993c580000000000000000000000000000100200008000000000000000000000008000010842949e260000000000000000000000000000400200002000000000000000000000106001082050998c00000000000000000100000000200008001000000000000000000000800620098a000000008000000000002000000000000002000cc8000000000000000000120000000000011060c4c02404322382e2244101000000631a0600080010000000028144920020000000000080001600090440941441148b88a2890400040083a090080000000001401152024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000408204000000000040000400054604b38080000000000000000000000000000800000100020a000808001004000000000000000001916193c500000000000000000000000000000000010080020080010020000000000000000001916149e2400000000000000000000000000000000204200100400001000000000800020001888509988000000000000000000000000000040202102000400002000000020008000050988000000000000000000000000000000000000000000000000000000000000009000000000880500048020000000000000000000000000004000020122402440000000010010000000000010040002008030900400000000000000000000000000020012025400000001002000000000040100002008118480900000000000000000000000000000400140a1500000000010000000002900400010010c2021000000000000000000002000000400082a0a80000000008000100010800400080018090400000000000000000000222000000804000400040045000000000000000000000000000000a0000000000200040a2040000000000000000010000020020020000000a28d8040000000000000800000100020a000808101484928080000000000000000000200002001816c0480000000000000000000100800202810148249412000000000000000000001080008002016810200000000000000000020520010440804124842000000000000000000041000400000505010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x14009400000000000000020000080004001000000231a020000000000000000000200400040020208090893010000000000000000000000010000040083a0900000000000000000000001004101048224c0900000000000000000000000020000020040e8220000000000000000000040808401020089210800000000000000000000020400080001850400000000000004000004044080020044120800000000000000000000004001880000000000008000205040000000000000010004000000000000000000050800000000000000000000000000000002088890100000000020000040001010000000008a0a245008000000000000000000000000000001000442290200000000000080000000020000a918aa0480000000000000000000000000000002000882290900000000000008001800008000050c541080000000000000000000000001000080008114250000000000002001400010000000620a080000000000000000000000400100008a10000000800000000641000000000000000008000840000002000100000000000000000000020418605060b11804000000000000000000000000000000000000000000000000000000100002800086800901420645160200000000000000000000000000000000000000000000000000010000210800900a103294582800000000000000000000000000000000000000000000000000044000103402209080a145084000000000000000000000000000000000000000000000400020024064100a2020050a10000000000000000000000000000000000020110820c400000000000000000000004000000000000000000408204000000000040000400054604b38080000000000000000000000000000800000100020a000808001004000000000000000001916193c500000000000000000000000000000000010080020080010020000000000000000001916149e24000000000000000000000000000000002042001004000010000000008000200018885099880000000000000000000000000000402021020004000020000000200080000509880000000000000000000800200008000000000000000000000000000000000000000000020418605060b11804000000000000000000000000000000000000000000000000000000100002800086800901420645160200000000000000000000000000000000000000000000000000010000210800900a103294582800000000000000000000000000000000000000000000000000044000103402209080a145084000000000000000000000000000000000000000000000400020024064100a2020050a10000000000000000000000000000000000020110820c40000000000000000000000000000000000000000000000000100041a231040400000284b3808000000000000000000000000000000000000000000000000000000001001108b2080000802993c5000000000000000000000000000000000000000000000000000004004422c8900000802949e240000000000000000000000000000000000000000000000400010001011527000080050998800000000000000000000000000000000000000000001000040000428c0020009880000000000000000000000000000800041200008800000000000000000000802548000000000000000000000000101190040000000000000000400001801000840b04d8019000000000000000000000000000000000004013211000000000000000000400002300c2d81340000000000000000000000000000000000100264110000000000000001000830001000c3611a000000000000000000000000040002000000245080000000002000100103000400066160d000000000000000000000000000200004484000000000000000000000000000000000000000000000000000000000000000000000014009400000000000000020000080004001000000231a020000000000000000000200400040020208090893010000000000000000000000010000040083a0900000000000000000000001004101048224c0900000000000000000000000020000020040e822000000000000000000004080840102008921080000000000000000000002040008000185040000000000000400000404408002004412080000000000000000000000400188000000000000800020504000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x20008a00000000000000000040000020002004000000851a01000000000002000000040000400001010204844920080000000000000000000004000200103a04800000000000000000000800008240812044920240000000000000000000000400010004074108000000000000000000102001081020202244220000000000000000000010200400000c28200000000000000080080201040802002209040000000000000000000200188000000000000000400814200000000000002000800000000000000000000000000020418605060b11804000000000000000000000000000000000000000000000000000000100002800086800901420645160200000000000000000000000000000000000000000000000000010000210800900a103294582800000000000000000000000000000000000000000000000000044000103402209080a145084000000000000000000000000000000000000000000000400020024064100a2020050a10000000000000000000000000000000000020110820c48000000000000000000000600000002004a90000000001000040008004000009045468080000000000000000100000180081002105022805000000000000000000000000400000001231168900000000000000000002000080440415026000000000000000000000000100000000245116848000000000000000040010400810020a086000000000000000000000004280004000508a508000000000100000800408001400110506000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100041a231040400000284b3808000000000000000000000000000000000000000000000000000000001001108b2080000802993c5000000000000000000000000000000000000000000000000000004004422c8900000802949e240000000000000000000000000000000000000000000000400010001011527000080050998800000000000000000000000000000000000000000001000040000428c0020009880000000000000000000000000000800041220008c00000000000000000000000000000020418605060b11804000000000000000000000000000000000000000000000000000000100002800086800901420645160200000000000000000000000000000000000000000000000000010000210800900a103294582800000000000000000000000000000000000000000000000000044000103402209080a145084000000000000000000000000000000000000000000000400020024064100a2020050a10000000000000000000000000000000000020110820c48000000000000000000000400000000000020008a00000000000000000040000020002004000000851a01000000000002000000040000400001010204844920080000000000000000000004000200103a04800000000000000000000800008240812044920240000000000000000000000400010004074108000000000000000000102001081020202244220000000000000000000010200400000c28200000000000000080080201040802002209040000000000000000000200188000000000000000400814200000000000000000000000000000000000000000000020418605060b11804000000000000000000000000000000000000000000000000000000100002800086800901420645160200000000000000000000000000000000000000000000000000010000210800900a103294582800000000000000000000000000000000000000000000000000044000103402209080a145084000000000000000000000000000000000000000000000400020024064100a2020050a10000000000000000000000000000000000020110820c48000000000000000000000000000000000000000000000000100041a231040400000284b3808000000000000000000000000000000000000000000000000000000001001108b2080000802993c5000000000000000000000000000000000000000000000000000004004422c8900000802949e240000000000000000000000000000000000000000000000400010001011527000080050998800000000000000000000000000000000000000000001000040000428c00200098800000000000000000000000000008000412200088000000000000000) + (NatTree.node 8 (NatTree.leaf 0x1a00940000040000008004412230048000000000000000000000100000100041000080020040800a124c040000000000000009021108b008800000000000000000000001000000002004080402824e05000000000000000044084422c091000000000000000000000000400000020201080202024c104000000000040011008101142110000000000000008000000808000020110100010024182000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034009400000020000000100088222240120000000000000000000000400000100020040004002020809089301000000000000002410882288048000000000000000000000008000000001004101048224c0900000000000000090422045102480000000000000000000000008000000408084010200892108000000000800240204045022400000000000000400000002040000040440800200441208000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802548000000000000000000000000101190040000000000000000400001801000840b04d8019000000000000000000000000000000000004013211000000000000000000400002300c2d81340000000000000000000000000000000000100264110000000000000001000830001000c3611a000000000000000000000000040002000000245080000000002000100103000400066160d00000000000000000000000000020000448400000000000000190c10000000000000000000000000000000000000000000000000000000000011060c4c024041223004000000000000000000000000000000000000000000000000000000080001600090440941441108b008000000000000000000000000000000000000000000000000000050000904204a0d104422c090000000000000000000000000000000000000000000000004800042002205024311010114210000000000000000000000000000000000000000000002000004012092209441004284000000000000000000000000000000200010188884120000000000000000000000000000000000000011060c4c024041223004000000000000000000000000000000000000000000000000000000080001600090440941441108b008000000000000000000000000000000000000000000000000000050000904204a0d104422c090000000000000000000000000000000000000000000000004800042002205024311010114210000000000000000000000000000000000000000000002000004012092209441004284000000000000000000000000000000200010188884100000000000000000000000000000000000000000000000100041a231040400000284b3808000000000000000000000000000000000000000000000000000000001001108b2080000802993c5000000000000000000000000000000000000000000000000000004004422c8900000802949e240000000000000000000000000000000000000000000000400010001011527000080050998800000000000000000000000000000000000000000001000040000428c0020009880000000000000000000000000000800041220008c00000000000001100048000000000020418605061b11c1e23104040000028cb381800800200000002828ac01000000000000010000280008680090142065517128b2080000802993c5008000000002809b009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011060c4c024041223004000000000000000000000000000000000000000000000000000000080001600090440941441108b008000000000000000000000000000000000000000000000000000050000904204a0d104422c09000000000000000000000000000000000000000000000000480004200220502431101011421000000000000000000000000000000000000000000000200000401209220944100428400000000000000000000000000000020001010888410000000000000000000000) + (NatTree.leaf 0xa0000000000200040a2040000000000000000010000020020020000000a28d8040000000000000800000100020a000808101484928080000000000000000000200002001816c048000000000000000000010080020281014824941200000000000000000000108000800201681020000000000000000002052001044080412484200000000000000000004100040000050501000000000000000402029020084010024120800000000000000000000000000000000000000000000000000000000000000000000000000000802548000000000000000000000000101190040000000000000000400001801000840b04d8019000000000000000000000000000000000004013211000000000000000000400002300c2d81340000000000000000000000000000000000100264110000000000000001000830001000c3611a000000000000000000000000040002000000245080000000002000100103000400066160d00000000000000000000000000020000448400000000000000190c10000000000000000100008200000000000204000000000002004a90000000001000040008004000009045468080000000000000000100000180081002105022805000000000000000000000000400000001231168900000000000000000002000080440415026000000000000000000000000100000000245116848000000000000000040010400810020a086000000000000000000000004280004000508a5080000000001000008004080014001105060000000000000000000000200080004508000000000000000000000000000000000000000000000000000000000000000802548000000000000000000000000101190040000000000000000400001801000840b04d8019000000000000000000000000000000000004013211000000000000000000400002300c2d81340000000000000000000000000000000000100264110000000000000001000830001000c3611a000000000000000000000000040002000000245080000000002000100103000400066160d00000000000000000000000000020000448400000000000000190c10000000000000000100008200000000000000000000040254800000000000008002091180480000000000000000100003020004040201010000000008a0a245008000000000000001100024116022000000000000000000200000081000000020000a918aa0480000000000000010800120458288000000000000000000080000008201800008000050c541080000000001000088000804508440000000000040000080000002401400010000000620a080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000408204000000000040000400054604b38080000000000000000000000000000800000100020a000808001004000000000000000001916193c500000000000000000000000000000000010080020080010020000000000000000001916149e2400000000000000000000000000000000204200100400001000000000800020001888509988000000000000000000000000000040202102000400002000000020008000050988000000000000000000080020000800000402042880000000000000000000000000000000011060c4c024041223004000000000000000000000000000000000000000000000000000000080001600090440941441108b008000000000000000000000000000000000000000000000000000050000904204a0d104422c0900000000000000000000000000000000000000000000000048000420022050243110101142100000000000000000000000000000000000000000000020000040120922094410042840000000000000000000000000000002000101888841200000000000000000001000000000a00940000000000001000008001000400000284b38080000000000000000041000080020040800a124c04000000000000000000000002000000802993c5000000000000000000002004080402824e0500000000000000000000000008000000802949e2400000000000000000020201080202024c1040000000000000000000000106000080050998800000000000080000201101000100241820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x40254800000000000008002091180480000000000000000100003020004040201010000000008a0a245008000000000000001100024116022000000000000000000200000081000000020000a918aa0480000000000000010800120458288000000000000000000080000008201800008000050c541080000000001000088000804508440000000000040000080000002401400010000000620a08000000002000020040010a10400000000000000000000000000000000000000000000000000000000000000000000000120000000000011060c4c024041223004000000000000040000400080010000000028144920020000000000080001600090440941441108b008000000000000000000800000100014011520240000000000000050000904204a0d104422c0900000000000000000001020000400004011482200000000048000420022050243110101142100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a00940000040000008004412230048000000000000000000000100000100041000080020040800a124c040000000000000009021108b008800000000000000000000001000000002004080402824e05000000000000000044084422c091000000000000000000000000400000020201080202024c10400000000004001100810114211000000000000000800000080800002011010001002418200000000010000c020042841000000000000000000000000000000000000000000000000000000000000000000000000034009400000020000000100088222240120000000000000000000000400000100020040004002020809089301000000000000002410882288048000000000000000000000008000000001004101048224c0900000000000000090422045102480000000000000000000000008000000408084010200892108000000000800240204045022400000000000000400000002040000040440800200441208000000002001808010a11000000000000000000000000000000000000000000000000000000000000000a0000000000200040a2040000000000000000010000020020020000000a28d8040000000000000800000100020a000808101484928080000000000000000000200002001816c04800000000000000000001008002028101482494120000000000000000000010800080020168102000000000000000000205200104408041248420000000000000000000410004000005050100000000000000040202902008401002412080000000000000000200144000000000000000000000000000000000000000000000000000000002004a90000000001000040008004000009045468080000000000000000100000180081002105022805000000000000000000000000400000001231168900000000000000000002000080440415026000000000000000000000000100000000245116848000000000000000040010400810020a086000000000000000000000004280004000508a5080000000001000008004080014001105060000000000000000000000200080004508000000000000020120880000000000000000000000000000000000000000048000000000020418605060b118040000000000000080001000800200000002828ac010000000000000100002800086800901420645160200000000000000000008000010002809b00900000000000000010000210800900a103294582800000000000000000002040004000200268210000000000000044000103402209080a145084000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00940000000000001000008001000400000284b38080000000000000000041000080020040800a124c04000000000000000000000002000000802993c5000000000000000000002004080402824e0500000000000000000000000008000000802949e2400000000000000000020201080202024c1040000000000000000000000106000080050998800000000000080000201101000100241820000000000000000000000800200098800000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x1a00940000040000008004412230048000000000000000000000100000100041000080020040800a124c040000000000000009021108b008800000000000000000000001000000002004080402824e05000000000000000044084422c091000000000000000000000000400000020201080202024c10400000000004001100810114211000000000000000800000080800002011010001002418200000000010000c0200428410000000000000000004800020a1000000000000000000000000000000000000000000000034009400000020000000100088222240120000000000000000000000400000100020040004002020809089301000000000000002410882288048000000000000000000000008000000001004101048224c0900000000000000090422045102480000000000000000000000008000000408084010200892108000000000800240204045022400000000000000400000002040000040440800200441208000000002001808010a11000000000000000000090002050400000000000000000000000000000000000a0000000000200040a2040000000000000000010000020020020000000a28d8040000000000000800000100020a000808101484928080000000000000000000200002001816c04800000000000000000001008002028101482494120000000000000000000010800080020168102000000000000000000205200104408041248420000000000000000000410004000005050100000000000000040202902008401002412080000000000000000200144000000000000080020040a100000000000000000000000000000048000000000020418605060b118040000000000000080001000800200000002828ac010000000000000100002800086800901420645160200000000000000000008000010002809b00900000000000000010000210800900a103294582800000000000000000002040004000200268210000000000000044000103402209080a145084000000000000000002010002000000121408000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00940000000000001000008001000400000284b38080000000000000000041000080020040800a124c04000000000000000000000002000000802993c5000000000000000000002004080402824e0500000000000000000000000008000000802949e2400000000000000000020201080202024c1040000000000000000000000106000080050998800000000000080000201101000100241820000000000000000000000800200098800000000004000020a100000000000000002000880000000000000000000002004a90000000001000040008004000009045468080000000000000000100000180081002105022805000000000000000000000000400000001231168900000000000000000002000080440415026000000000000000000000000100000000245116848000000000000000040010400810020a086000000000000000000000004280004000508a5080000000001000008004080014001105060000000000000000000000200080004508000000000000020120880000000000000004000420000000000004000000000000a00940000000000001000008001000400000284b38080000000000000000041000080020040800a124c04000000000000000000000002000000802993c5000000000000000000002004080402824e0500000000000000000000000008000000802949e2400000000000000000020201080202024c1040000000000000000000000106000080050998800000000000080000201101000100241820000000000000000000000800200098800000000004000020a100000000000000000000000000000000000000000002004a90000000001000040008004000009045468080000000000000000100000180081002105022805000000000000000000000000400000001231168900000000000000000002000080440415026000000000000000000000000100000000245116848000000000000000040010400810020a086000000000000000000000004280004000508a50800000000010000080040800140011050600000000000000000000002000800045080000000000000201208800000000000000040004200000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x48000000000020418605060b118040000000000000080001000800200000002828ac010000000000000100002800086800901420645160200000000000000000008000010002809b00900000000000000010000210800900a103294582800000000000000000002040004000200268210000000000000044000103402209080a145084000000000000000002010002000000121408000000000400020024064100a2020050a10000000000000000000000000000000000000000000000000000000000000000000000040254800000000000008002091180480000000000000000100003020004040201010000000008a0a245008000000000000001100024116022000000000000000000200000081000000020000a918aa0480000000000000010800120458288000000000000000000080000008201800008000050c541080000000001000088000804508440000000000040000080000002401400010000000620a08000000002000020040010a10400000000000000080020000064100000000100000448200000000000200010000000040254800000000000008002091180480000000000000000100003020004040201010000000008a0a245008000000000000001100024116022000000000000000000200000081000000020000a918aa0480000000000000010800120458288000000000000000000080000008201800008000050c541080000000001000088000804508440000000000040000080000002401400010000000620a08000000002000020040010a104000000000000000800200000641000000001000004482000000000000000000000000000001a00940000040000008004412230048000000000000000000000100000100041000080020040800a124c040000000000000009021108b008800000000000000000000001000000002004080402824e05000000000000000044084422c091000000000000000000000000400000020201080202024c10400000000004001100810114211000000000000000800000080800002011010001002418200000000010000c0200428410000000000000000004800020a1000000000800051210000000000000000000000000000034009400000020000000100088222240120000000000000000000000400000100020040004002020809089301000000000000002410882288048000000000000000000000008000000001004101048224c0900000000000000090422045102480000000000000000000000008000000408084010200892108000000000800240204045022400000000000000400000002040000040440800200441208000000002001808010a1100000000000000000009000205040000000200014908000000000000000000000120000000000011060c4c024041223004000000000000040000400080010000000028144920020000000000080001600090440941441108b008000000000000000000800000100014011520240000000000000050000904204a0d104422c0900000000000000000001020000400004011482200000000048000420022050243110101142100000000000000000100800040000000882810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000200040a2040000000000000000010000020020020000000a28d8040000000000000800000100020a000808101484928080000000000000000000200002001816c04800000000000000000001008002028101482494120000000000000000000010800080020168102000000000000000000205200104408041248420000000000000000000410004000005050100000000000000040202902008401002412080000000000000000200144000000000000080020040a10000000000010001000000000000040254800000000000008002091180480000000000000000100003020004040201010000000008a0a245008000000000000001100024116022000000000000000000200000081000000020000a918aa0480000000000000010800120458288000000000000000000080000008201800008000050c541080000000001000088000804508440000000000040000080000002401400010000000620a08000000002000020040010a1040000000000000008002000006410000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x120000000000011060c4c024041223004000000000000040000400080010000000028144920020000000000080001600090440941441108b008000000000000000000800000100014011520240000000000000050000904204a0d104422c090000000000000000000102000040000401148220000000004800042002205024311010114210000000000000000010080004000000088281000000002000004012092209441004284000000000000010000221000000000200010108884100000000008000800000000000120000000000011060c4c024041223004000000000000040000400080010000000028144920020000000000080001600090440941441108b008000000000000000000800000100014011520240000000000000050000904204a0d104422c0900000000000000000001020000400004011482200000000048000420022050243110101142100000000000000000100800040000000882810000000020000040120922094410042840000000000000100002210000000002000101088841000000000000000000000000048000000000020418605060b118040000000000000080001000800200000002828ac010000000000000100002800086800901420645160200000000000000000008000010002809b00900000000000000010000210800900a103294582800000000000000000002040004000200268210000000000000044000103402209080a145084000000000000000002010002000000121408000000000400020024064100a2020050a10000000000000002000484000000000000020010820c400000000004000200000000000048000000000020418605060b118040000000000000080001000800200000002828ac010000000000000100002800086800901420645160200000000000000000008000010002809b00900000000000000010000210800900a103294582800000000000000000002040004000200268210000000000000044000103402209080a145084000000000000000002010002000000121408000000000400020024064100a2020050a10000000000000002000484000000000000020010820c40000000000000000000000000000120000000000011060c4c024041223004000000000000040000400080010000000028144920020000000000080001600090440941441108b008000000000000000000800000100014011520240000000000000050000904204a0d104422c0900000000000000000001020000400004011482200000000048000420022050243110101142100000000000000000100800040000000882810000000020000040120922094410042840000000000000100002210000000000000000000000000000000000000000000000048000000000020418605060b118040000000000000080001000800200000002828ac010000000000000100002800086800901420645160200000000000000000008000010002809b00900000000000000010000210800900a103294582800000000000000000002040004000200268210000000000000044000103402209080a145084000000000000000002010002000000121408000000000400020024064100a2020050a10000000000000002000484000000000000000000000000000000000000000000000000000120000000000011060c4c024041223004000000000000040000400080010000000028144920020000000000080001600090440941441108b008000000000000000000800000100014011520240000000000000050000904204a0d104422c09000000000000000000010200004000040114822000000000480004200220502431101011421000000000000000001008000400000008828100000000200000401209220944100428400000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x200000000000000000000000000000000000000000000000000000000100000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001060404020000000000000000000000000000000000000000000000000000000000000000000000400090040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008204000000000000000000000000000000000000000000000000000000000000000000000a0000000010040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001040000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000801000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)))))) + (NatTree.node 72 (NatTree.node 32 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x100800000000000000000000000000000000000000000000000000000000000000000000000000000850000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001060404020000000000000000000000000000000000000000000000000000000000000000080000600090040040400000000000000000000000000000000000000000000000000000000000001000090020020900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a801000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x20224010000000000000000000000000000000000000000000000000000000000000000000000000008028804000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000808901000000000000000000000000000000000000000000000000000000000000000000000000000402902000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000080010004000000043380800000000000000000000000000000000000000000000000000000000000000002000000000103c50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000004000008000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000800000010000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000106040402000000000000000000000000000000000000000000000000000000000000000008000060009004004040000000000000000000000000000000000000000000000000000000000000100009002002090000000000000000000000000000000000000000000000000000000004000002002201000210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000840000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x800000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00940000000000000000000000000000000000000000000000000000000041000080020040800a124c0400000000000000000000000000000000000000000000000000000000002004000402824e050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001440000000000000000000000000000000000000000000000000000100000161000a200000000008040000000000000000000000000000000000000000000000000000000006400488000000010240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084c02000000000000000000000000000000000000000000000000000000000000000000000000000040094040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084040402000000000000000000000000000000000000000000000000000000000000000000000028000000004040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001023004000000000000000000000000000000000000000000000000000000000000000000000000000100b008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x800000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a020000000000000000000000000000000000000000000000000000000000000000000000040000a090000000000000000000000000000000000000000000000000000000000000000000000000282200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200580400000000000000000000000000000000000000000000000000000000000000000002000802c0480000000000000000000000000000000000000000000000000000000000000080000000002810200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000400000800000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000080000001000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010604040200000000000000000000000000000000000000000000000000000000000000000800006000900400404000000000000000000000000000000000000000000000000000000000000010000900200209000000000000000000000000000000000000000000000000000000000400000200220100021000000000000000000000000000000000000000000000000000000200000401008200004000000000000000000000000000000000000000000000000000000000000000000000000))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x1000000000000000000000000000000000000000000000000000000000002040000000010010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000804000000000000000000000000000000000000000000000000000000000000000000000000000400020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000082040000000000000000000000000000000000000000000000000000000000000000000008000008001004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000010000000000144900020000000000000000000000000000000000000000000000000000000000000000000001150020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008009200800000000000000000000000000000000000000000000000000000000000000000020009202400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080128080000000000000000000000000000000000000000000000000000000000000000000080094120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000081180400000000000000000000000000000000000000000000000000000000000000000000000100004016020000000000000000000000000000000000000000000000000000000000000000000002005828000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010080000000000000000000000000000000000000000000000000000000000000000000000000000085000000000000000000000000000000000000000000000000000000000000000000000000004240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x8000000000000000000000000000000000000000000000000000000000000000800000010000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000010000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000004000008000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010009400000000000000000000000000000000000000000000000000000000000000040000002020809089301000000000000000000000000000000000000000000000000000000000000004101048224c0900000000000000000000000000000000000000000000000000000000000400084010200892108000000000000000000000000000000000000000000000000040000040040000200441208000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000800000010000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000106040402000000000000000000000000000000000000000000000000000000000000000008000060009004004040000000000000000000000000000000000000000000000000000000000000100009002002090000000000000000000000000000000000000000000000000000000004000002002201000210000000000000000000000000000000000000000000000000000002000004010082000040000000000000000000000000000000000000000010000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000802548000000000000000000000000000000000000000000000000400001801000040200900110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x10080000000000000000000000000000000000000000000000000000000000000000000000000000085000000000000000000000000000000000000000000000000000000000000000000000000004240000000000000000000000000000000000000000000000000000000000000000000000018800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000000000000010800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a020000000000000000000000000000000000000000000000000000000000000000000000040000a090000000000000000000000000000000000000000000000000000000000000000000020000282200000000000000000000000000000000000000000000000000000000000000000000000504000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000000000000021000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200580400000000000000000000000000000000000000000000000000000000000000000002000802c04800000000000000000000000000000000000000000000000000000000000000800080000028102000000000000000000000000000000000000000000000000000000000000000000000050100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000004000008000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000010009400000000000000000000000000000000000000000000000000000000000000040000002020809089301000000000000000000000000000000000000000000000000000000000000004101048224c09000000000000000000000000000000000000000000000000000000000004000840102008921080000000000000000000000000000000000000000000000000400000400408002004412080000000000000000000000000000000000000000000020504000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x1000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000000000000021000000000000000000000000000000000000000000000000000000000001000000100000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001440000000000000000000000000000000000000000000000000000100000040000820000000000804000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802548000000000000000000000000000000000000000000000000400001801000840b04d0019000000000000000000000000000000000000000000000000000000000000400002200c2d0124000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000012200244000000001001000000000000000000000000000000000000000000000000000000000001002440000000100200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001023004000000000000000000000000000000000000000000000000000000000000000000000001000100b008000000000000000000000000000000000000000000000000000000000000000000000402c0900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000808901000000000000000000000000000000000000000000000000000000000000000000000010000402902000000000000000000000000000000000000000000000000000000000000000000000080290900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000080010004000000043380800000000000000000000000000000000000000000000000000000000000000002000000800103c500000000000000000000000000000000000000000000000000000000000008000000000101e240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x100020000000000000000000000000000000000000000000000000000000000000000000000004004200000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000122002440000000010010000000000000000000000000000000000000000000000000000000000010025400000001002000000000000000000000000000000000000000000000000000000000000100a11000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001001301000000000000000000000000000000000000000000000000000000000000000100008004c090000000000000000000000000000000000000000000000000000000000040000000000001210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800920080000000000000000000000000000000000000000000000000000000000000200002000920240000000000000000000000000000000000000000000000000000000002000000000000044220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008012808000000000000000000000000000000000000000000000000000000000000002000008009412000000000000000000000000000000000000000000000000000000000100000000000004842000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008118040000000000000000000000000000000000000000000000000000000000000000000000010000401602000000000000000000000000000000000000000000000000000000000000000008000200582800000000000000000000000000000000000000000000000000000000001000000000000508400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001008000000000000000000000000000000000000000000000000000000000000000000000000000008500000000000000000000000000000000000000000000000000000000000000000000000000424000000000000000000000000000000000000000000000000000000000000000000000001880000000000000000000000000000000000000000000000000000000000020000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000108000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000))))) + (NatTree.node 40 (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x1000008001000400000284b380800000000000000000000000000000000000000000000000000000000000000002000000002993c50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000008020000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200140000000000000000000000000000000000000000000000000000000040000080000040800012480400000000000000000000000000000000000000000000000000000000002000000400024c04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000000000000000010000008009044000900000000000000000000000000000000000000000000000000000000000000000200042401040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008002c010000000000000000000000000000000000000000000000000000000000000000010000800b0090000000000000000000000000000000000000000000000000000000000000400000000000282100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080009200200000000000000000000000000000000000000000000000000000000000000100004000520240000000000000000000000000000000000000000000000000000000000200000000000004822000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020004500800000000000000000000000000000000000000000000000000000000000002000008002a0480000000000000000000000000000000000000000000000000000000000800000000000014108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002004c0400000000000000000000000000000000000000000000000000000000000000080000800e050000000000000000000000000000000000000000000000000000000000020000000000000c1040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x10080000000000000000000000000000000000000000000000000000000000000000000000000000085000000000000000000000000000000000000000000000000000000000000000000000000004240000000000000000000000000000000000000000000000000000000000000000000000018800000000000000000000000000000000000000000000000000000000000200000800000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000001080000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000000000000000000000000000000000002100000000000000000000000000000000000000000000000000000000000100000010000000000000000000000000000000000000000010000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000904400090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000800800000000000000000000802000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041223004000000000000000000000000000000000000000000000000000000000000000000000000001108b0080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822224010000000000000000000000000000000000000000000000000000000000000000000000000088228804000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020888901000000000000000000000000000000000000000000000000000000000000000000000000004422902000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x8012808000000000000000000000000000000000000000000000000000000000000002000008009412000000000000000000000000000000000000000000000000000000000100000400000004842000000000000000000000000000000000000000000000000000000000000000000001208000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008118040000000000000000000000000000000000000000000000000000000000000000000000010000401602000000000000000000000000000000000000000000000000000000000000000008000200582800000000000000000000000000000000000000000000000000000000001000008000000508400000000000000000000000000000000000000000000000000000000000000000000a1000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000001000000000000224400800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a9000000000000000000000000000000000000000000000000000000000010008100200502200500000000000000000000000000000000000000000000000000000000000000008040041402200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020008a00000000000000000000000000000000000000000000000000000002000000040000400001010204844920080000000000000000000000000000000000000000000000000000000800008040812044920240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008405040311004000000000000000000000000000000000000000000000000000000000000000002800800420405140200000000000000000000000000000000000000000000000000000000000800800210209450200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001050000000000000000000000000000000000000000000000000000000000000000000000001000040001844002000000000000000000000000000000000000000000000000000000000000000100001844010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000122002440000000010010000000000000000000000000000000000000000000000000000000000010025400000001002000000000000000000000000000000000000000000000000000000000000100a150000000001000000000000000000000000000000000000000000000000000000000002a08800000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x1023004000000000000000000000000000000000000000000000000000000000000000000000001000100b008000000000000000000000000000000000000000000000000000000000000000004000402c0900000000000000000000000000000000000000000000000000000000000040000000000142100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000808901000000000000000000000000000000000000000000000000000000000000000000000010000402902000000000000000000000000000000000000000000000000000000000000000002000080290900000000000000000000000000000000000000000000000000000000000100000000001421000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000080010004000000043380800000000000000000000000000000000000000000000000000000000000000002000000800103c500000000000000000000000000000000000000000000000000000000000008000000800101e2400000000000000000000000000000000000000000000000000000000001020000000001988000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008002c010000000000000000000000000000000000000000000000000000000000000000010000800b0090000000000000000000000000000000000000000000000000000000000000400040000000282100000000000000000000000000000000000000000000000000000000000000000000001408000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080009200200000000000000000000000000000000000000000000000000000000000000100004000520240000000000000000000000000000000000000000000000000000000000200004000000004822000000000000000000000000000000000000000000000000000000000000000000000028100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020004500800000000000000000000000000000000000000000000000000000000000002000008002a04800000000000000000000000000000000000000000000000000000000008000080000000141080000000000000000000000000000000000000000000000000000000000000000000000a080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001001301000000000000000000000000000000000000000000000000000000000000000100008004c0900000000000000000000000000000000000000000000000000000000000400004000000012108000000000000000000000000000000000000000000000000000000000000000000001208000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008009200800000000000000000000000000000000000000000000000000000000000002000020009202400000000000000000000000000000000000000000000000000000000020000800000000442200000000000000000000000000000000000000000000000000000000000000000000090400000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x1440000000000000000000000000000000000000000000000000000100000161000a2000000000080400000000000000000000000000000000000000000000000000000000064004a8000000010240000000000000000000000000000000000000000000000000000000000019014a80000000084000000000000000000000000000000000000000002000000000000000c0a844000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000480000000000002000a0000000000000000000000000000000000001000000800904400090000000000000000000000004020800100000000000000000000000000000000020004240104000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000020000000a28d80400000000000000000000000000000000000000000000000000000000000000000002001816c04800000000000000000000000000000000000000000000000000000000000000800000020168102000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001023004000000000000000000000000000000000000000000000000000000000000000000000001000100b008000000000000000000000000000000000000000000000000000000000000000004000402c090000000000000000000000000000000000000000000000000000000000004000100000014210000000000000000000000000000000000000000000000000000000000000000000284000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080890100000000000000000000000000000000000000000000000000000000000000000000001000040290200000000000000000000000000000000000000000000000000000000000000000200008029090000000000000000000000000000000000000000000000000000000000010000800000142100000000000000000000000000000000000000000000000000000000000000000a100000000000000000000000000000000000000000000000000000000000000000000000000000000000010000080010004000000043380800000000000000000000000000000000000000000000000000000000000000002000000800103c500000000000000000000000000000000000000000000000000000000000008000000800101e2400000000000000000000000000000000000000000000000000000000001020000800001988000000000000000000000000000000000000000000000000000000000000000188000000000000000000000000000000000000000000000000000000000000000000000000041860404020000000000000000000000000000000000000000000000000000000000010000080008680090040040400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000080004001000000231a020000000000000000000000000000000000000000000000000000000000000000010000040083a090000000000000000000000000000000000000000000000000000000000000020000020040e822000000000000000000000000000000000000000000000000000000000002040008000185040000000000000000000000000000000000000000000000000000000000000188000000000000000000000000000000000000000000000000000000)))) + (NatTree.node 16 (NatTree.node 8 (NatTree.leaf 0x2000000000000000000000000000000000000000000000000020000000a28d80400000000000000000000000000000000000000000000000000000000000000000002001816c0480000000000000000000000000000000000000000000000000000000000000080008002016810200000000000000000000000000000000000000000000000000000000001000000000505010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000200000002828ac010000000000000000000000000000000000000000000000000000000000000000010002809b00900000000000000000000000000000000000000000000000000000000000004000000020026821000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000001000000002814492002000000000000000000000000000000000000000000000000000000000000001000140115202400000000000000000000000000000000000000000000000000000000002000000000401148220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050800000000000000000000000000000000000000000000000020000040001010000000008a0a245008000000000000000000000000000000000000000000000000000080000000020000a918aa0480000000000000000000000000000000000000000000000000000008001800000000050c541080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000090440009000000000000000000000000000000000000000000000000000000000000000000000424011400000000000000000000000000000000000000000000000000000000010000000000004101020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00940000000000000000000000000000000000000000000000000000000041000080020040800a124c0400000000000000000000000000000000000000000000000000000000002004080402824e050000000000000000000000000000000000000000000000000000000000020201000202024c10400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001440000000000000000000000000000000000000000000000000000100000161000a2000000000080400000000000000000000000000000000000000000000000000000000064004a800000001024000000000000000000000000000000000000000000000000000000000001901488000000008400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00940000000000000000000000000000000000000000000000000000000041000080020040800a124c0400000000000000000000000000000000000000000000000000000000002004080402824e050000000000000000000000000000000000000000000000000000000000020201080202024c1040000000000000000000000000000000000000000000000000080000201100000100241820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x50800000000000000000000000000000000000000000000000020000040001010000000008a0a245008000000000000000000000000000000000000000000000000000080000000020000a918aa0480000000000000000000000000000000000000000000000000000008001800008000050c541080000000000000000000000000000000000000040000000000002001400000000000620a08000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041223004000000000000000000000000000000000000000000000000000000000000000000000001001108b008000000000000000000000000000000000000000000000000000000000000000004004422c090000000000000000000000000000000000000000000000000000000000004000100010114210000000000000000000000000000000000000000000000000000000010000400004284000000000000000000000000000000000000000004100000000000000000000000000000000000000000000000000000000000002088890100000000000000000000000000000000000000000000000000000000000000000000001000442290200000000000000000000000000000000000000000000000000000000000000000200088229090000000000000000000000000000000000000000000000000000000000010000800081142100000000000000000000000000000000000000000000000000000000400100008a10000000000000000000000000000000000000000840000000000000000000000000000000000000000001000008001000400000284b380800000000000000000000000000000000000000000000000000000000000000002000000802993c500000000000000000000000000000000000000000000000000000000000008000000802949e24000000000000000000000000000000000000000000000000000000000010600008005099880000000000000000000000000000000000000000000000000000000080020009880000000000000000000000000000000000000008800000000000000000000000010009400000000000000000000000000000000000000000000000000000000000000040000002020809089301000000000000000000000000000000000000000000000000000000000000004101048224c090000000000000000000000000000000000000000000000000000000000040008001020089210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000004000000005460080000004000020122402440000000010010000000000000000000000000000000000000000011160900000000020012025400000001002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000b3008000000000000000000000000000000000000000000000000000000000000000000000000000938500000000000000000000000000000000000000000000000000000000000000000000000049c20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001180040000000000000000000000000000000000000000000000000000000000000000000000000000130110000000000000000000000000000000000000000000000000000000000000000000000026010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) + (NatTree.node 8 (NatTree.leaf 0x118004000000000000000000000000000000000000000000000000000000000000000000000000000013011000000000000000000000000000000000000000000000000000000000000000000000002601100000000000000000000000000000000000000000000000000000000000400000000002050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000088801000000000000000000000100000000000022440080000000000000000000000000000000000022802000000000000000000000000000008a8040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000904400090000000000000000000000000000000000000000000000000000000000000000000004240114000000000000000000000000000000000000000000000000000000000100000000000041010a000000000000000000000000000000000000000000000000000000000000000000020120100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008880100000000000000000000000000000000000000000000000000000000000000000000000000002280200000000000000000000000000000000000000000000000000000000000000000000000228090000000000000000000000000000000000000000000000000000000000010000000001102100000000000000000000000000000000000000000000000000000000400100000a10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000080004001000000231a020000000000000000000000000000000000000000000000000000000000000000010000040083a090000000000000000000000000000000000000000000000000000000000000020000020040e822000000000000000000000000000000000000000000000000000000000002040008000185040000000000000000000000000000000000000000000000000000000000400188000000000000000000000000000000000000000400000000000000002000000000000000000000000000000000000000000000000020000000a28d80400000000000000000000000000000000000000000000000000000000000000000002001816c0480000000000000000000000000000000000000000000000000000000000000080008002016810200000000000000000000000000000000000000000000000000000000001000400000505010000000000000000000000000000000000000000000000000000000014400000000000000000000000000000000000000100000000000000080000000000000000000000000000000000000000000000000000200000002828ac010000000000000000000000000000000000000000000000000000000000000000010002809b0090000000000000000000000000000000000000000000000000000000000000400040002002682100000000000000000000000000000000000000000000000000000000010000000000121408000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000100000000281449200200000000000000000000000000000000000000000000000000000000000000100014011520240000000000000000000000000000000000000000000000000000000000200004000040114822000000000000000000000000000000000000000000000000000000008000000000008828100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.node 8 (NatTree.leaf 0x2000000000000000000000000000000000000000000000000000000001000000002814492002000000000000000000000000000000000000000000000000000000000000001000140115202400000000000000000000000000000000000000000000000000000000002000040000401148220000000000000000000000000000000000000000000000000000000080004000000088281000000000000000000000000000000000000000000000000000221000000000000000000000000000000000000800000000000050800000000000000000000000000000000000000000000000020000040001010000000008a0a245008000000000000000000000000000000000000000000000000000080000000020000a918aa0480000000000000000000000000000000000000000000000000000008001800008000050c541080000000000000000000000000000000000000040000000000002001400010000000620a080000000000000000000000000000000000000000800000000641000000000000000000000000000000000100000000000000008000000000000000000000000001180040000000000000000000000000000000904400090000000000000000000000000000000000000130110000000000000000000000000004240114000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000022200400000000000000000000200000000028a801000000000000000000000000000000000000000008a008000000000000000000000000009a0090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200140000000000000000000000000400000000b30080000000000000000040000080000040800012480400000000000000000000000000000000009385000000000000000000002000000400024c040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000118004000000000000000000000000000000090440009000000000000000000000000000000000000013011000000000000000000000000000424010400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014009400000000000000000000000000000000000000000000000000000000000020040004002020809089301000000000000000000000000000000000000000000000000000000000001004101048224c0900000000000000000000000000000000000000000000000000000000000408080010200892108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000b3008000000000000000000000000000000000000000000000000000000000000000000000000000938500000000000000000000000000000000000000000000000000000000000000000000000049c240000000000000000000000000000000000000000000000000000000000002000000010918000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + (NatTree.leaf 0x14009400000000000000000000000000000000000000000000000000000000000020040004002020809089301000000000000000000000000000000000000000000000000000000000001004101048224c0900000000000000000000000000000000000000000000000000000000000408084010200892108000000000000000000000000000000000000000000000000040000040440000200441208000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000b3008000000000000000000000000000000000000000000000000000000000000000000000000000938500000000000000000000000000000000000000000000000000000000000000000000000049c2400000000000000000000000000000000000000000000000000000000000020000000109188000000000000000000000000000000000000000000000000000000008002000188000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000118004000000000000000000000000000000000000000000000000000000000000000000000000000013011000000000000000000000000000000000000000000000000000000000000000000000002601100000000000000000000000000000000000000000000000000000000000400000000002050800000000000000000000000000000000000000000000000000000000000000000484000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000400000000b3008000000000000000000000000000000000000000000000000000000000000000000000000000938500000000000000000000000000000000000000000000000000000000000000000000000049c24000000000000000000000000000000000000000000000000000000000000200000001091880000000000000000000000000000000000000000000000000000000080000001800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001180040000000000000000000000000000000000000000000000000000000000000000000000000000130110000000000000000000000000000000000000000000000000000000000000000000000026011000000000000000000000000000000000000000000000000000000000004000000000020508000000000000000000000000000000000000000000000000000000000000000004800000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000200000002828ac010000000000000000000000000000000000000000000000000000000000000000010002809b00900000000000000000000000000000000000000000000000000000000000004000400020026821000000000000000000000000000000000000000000000000000000000100020000001214080000000000000000000000000000000000000000000000000000048400000000000000000000000000000000000002000000000)))))))))) + + +def listToMask : List Nat → Nat + | [] => 0 + | x :: xs => (2 ^ x) ||| listToMask xs + +def getLeftRowAux : Nat → Nat + | 0 => 0 + | qL + 1 => + match Nat.ble (qL + 1) 1409 with + | true => left_row_tree.getRow7 qL + | false => 0x50005 + +def getLeftRow (qL : Nat) : Nat := getLeftRowAux (qL + 1) + +def lstepFromRow (row : Nat) (b : Bool) : Nat := + match b with + | false => row &&& 65535 + | true => (row >>> 16) &&& 65535 + +def getMidFromRow (row s : Nat) (h : Bool) : Nat := + (row >>> ((2 + s * 2 + h.toNat) * 16)) &&& 65535 + +def lstep (q : Nat) (b : Bool) : Nat := + lstepFromRow (getLeftRow q) b + +def getMid (qL s : Nat) (h : Bool) : Nat := + match Nat.ble (s + 1) 6 with + | true => getMidFromRow (getLeftRow qL) s h + | false => 0 + +def rstepAux : Nat → Nat + | 0 => 3 + | idx + 1 => + match Nat.ble (idx + 1) 3218 with + | true => right_tree.get4 idx + | false => 3 + +def rstep (q : Nat) (b : Bool) : Nat := rstepAux (2 * q + b.toNat + 1) + +def rpreAux : Nat → List Nat + | 0 => [] + | idx + 1 => + match Nat.ble (idx + 1) 3218 with + | true => rpre_tree.getRPre6 idx + | false => [] + +def rpre (qR : Nat) (b : Bool) : List Nat := rpreAux (2 * qR + b.toNat + 1) + +def getBaseTarget96Aux : Nat → Nat + | 0 => 0 + | k + 1 => + match Nat.ble (k + 1) 2263 with + | true => basetg_tree.get96_7 k + | false => 0 + +def getBaseTarget96 (k : Nat) : Nat := getBaseTarget96Aux (k + 1) + +def j1From96 (btg : Nat) : Nat := btg &&& 65535 +def j2From96 (btg : Nat) : Nat := (btg >>> 16) &&& 65535 + +def stepTargetFrom96 (btg : Nat) (w : Bool) : Nat := + match w with + | false => (btg >>> 32) &&& 65535 + | true => (btg >>> 48) &&& 65535 + +def preTargetFrom96 (btg : Nat) (b : Bool) : Nat := + match b with + | false => (btg >>> 64) &&& 65535 + | true => (btg >>> 80) &&& 65535 + +def getJ1 (k : Nat) : Nat := j1From96 (getBaseTarget96 k) +def getJ2 (k : Nat) : Nat := j2From96 (getBaseTarget96 k) +def getStepTarget (k : Nat) (w : Bool) : Nat := stepTargetFrom96 (getBaseTarget96 k) w +def getPreTarget (k : Nat) (b : Bool) : Nat := preTargetFrom96 (getBaseTarget96 k) b + +def getDeltaAux : Nat → List Nat + | 0 => [] + | k + 1 => + match Nat.ble (k + 1) 2263 with + | true => delta_tree.get6 k + | false => [] + +def getDelta (k : Nat) : List Nat := getDeltaAux (k + 1) + +def getRMaskAux : Nat → Nat + | 0 => 0 + | k + 1 => + match Nat.ble (k + 1) 2422 with + | true => rmask_tree.getMask9 k + | false => 0 + +def getRMask (k : Nat) : Nat := getRMaskAux (k + 1) + +def allUpTo (f : Nat → Bool) : Nat → Bool + | 0 => true + | n + 1 => f n && allUpTo f n + +def subMask (j_sub t_sub t_sup mask_sup : Nat) : Bool := + (j_sub == 0) || (t_sub == t_sup) || + ((t_sub != 0) && ((getRMask t_sub ||| mask_sup) == mask_sup)) + +def allBitsIn (m : Nat) : List Nat → Bool + | [] => true + | x :: xs => Nat.testBit m x && allBitsIn m xs + +def deltaStep (w : Bool) (mtk : Nat) : List Nat → Bool + | [] => true + | qR :: rest => Nat.testBit mtk (rstep qR w) && deltaStep w mtk rest + +def deltaPre (b : Bool) (mtk : Nat) : List Nat → Bool + | [] => true + | qR :: rest => (qR != 3) && allBitsIn mtk (rpre qR b) && deltaPre b mtk rest + +def checkStep (w : Bool) (j1 j2 t1 t2 tk : Nat) (delta : List Nat) : Bool := + (tk == 0) || + (let mtk := getRMask tk + (((j1 == 0 || t1 == tk) && (j2 == 0 || t2 == tk)) || + (subMask j1 t1 tk mtk && subMask j2 t2 tk mtk)) && + deltaStep w mtk delta) + +def checkPre (b : Bool) (j1 j2 t1 t2 tk : Nat) (delta : List Nat) : Bool := + (tk == 0) || + (let mtk := getRMask tk + (((j1 == 0 || t1 == tk) && (j2 == 0 || t2 == tk)) || + (subMask j1 t1 tk mtk && subMask j2 t2 tk mtk)) && + deltaPre b mtk delta) + +def decompStepPreAt (k : Nat) : Bool := + (k == 0 && getRMask 0 == 0 && getBaseTarget96 0 == 0) || + ((k != 0) && + (let btg := getBaseTarget96 k + let j1 := j1From96 btg + let j2 := j2From96 btg + let btg1 := getBaseTarget96 j1 + let btg2 := getBaseTarget96 j2 + let delta := getDelta k + Nat.ble (j1 + 1) k && Nat.ble (j2 + 1) k && + (getRMask k == (getRMask j1 ||| (getRMask j2 ||| listToMask delta))) && + checkStep false j1 j2 (stepTargetFrom96 btg1 false) (stepTargetFrom96 btg2 false) (stepTargetFrom96 btg false) delta && + checkStep true j1 j2 (stepTargetFrom96 btg1 true) (stepTargetFrom96 btg2 true) (stepTargetFrom96 btg true) delta && + checkPre false j1 j2 (preTargetFrom96 btg1 false) (preTargetFrom96 btg2 false) (preTargetFrom96 btg false) delta && + checkPre true j1 j2 (preTargetFrom96 btg1 true) (preTargetFrom96 btg2 true) (preTargetFrom96 btg true) delta)) + +def subMaskIdx (t_sub t_sup : Nat) : Bool := + (t_sub == t_sup) || + (let m_sup := getRMask t_sup + (getRMask t_sub ||| m_sup) == m_sup) + +def rightMoveStep (row row' : Nat) (s : Nat) (h : Bool) (s' : Nat) : Bool := + let k := getMidFromRow row s h + (k == 0) || + (let btg := getBaseTarget96 k + let tpF := preTargetFrom96 btg false + let tpT := preTargetFrom96 btg true + Nat.ble (k + 1) 2263 && + (tpF != 0) && (tpT != 0) && + subMaskIdx tpF (getMidFromRow row' s' false) && + subMaskIdx tpT (getMidFromRow row' s' true)) + +def leftMoveStep (row_qL row_qL' : Nat) (s : Nat) (h w : Bool) (s' : Nat) (b : Bool) : Bool := + let k := getMidFromRow row_qL s h + (k == 0) || + (let ts := getStepTarget k w + Nat.ble (k + 1) 2263 && + (ts != 0) && + subMaskIdx ts (getMidFromRow row_qL' s' b)) + +def transOKAt (q : Nat) : Bool := + let row := getLeftRow q + let rowF := getLeftRow (lstepFromRow row false) + let rowT := getLeftRow (lstepFromRow row true) + (getMidFromRow row 4 false == 0) && + rightMoveStep row rowT 0 false 1 && + rightMoveStep row rowT 0 true 2 && + rightMoveStep row rowF 1 true 5 && + rightMoveStep row rowT 2 false 4 && + rightMoveStep row rowT 4 true 5 && + rightMoveStep row rowF 5 true 0 && + leftMoveStep rowF row 1 false true 2 false && + leftMoveStep rowF row 2 true false 3 false && + leftMoveStep rowF row 3 false true 1 false && + leftMoveStep rowF row 3 true false 3 false && + leftMoveStep rowF row 5 false false 5 false && + leftMoveStep rowT row 1 false true 2 true && + leftMoveStep rowT row 2 true false 3 true && + leftMoveStep rowT row 3 false true 1 true && + leftMoveStep rowT row 3 true false 3 true && + leftMoveStep rowT row 5 false false 5 true + +def lrun : List Bool → Nat + | [] => 0 + | b :: xs => lstep (lrun xs) b + +def rrun : List Bool → Nat + | [] => 0 + | b :: xs => rstep (rrun xs) b + +theorem lstep_zero : lstep 0 false = 0 := by decide +kernel + +theorem rstep_zero : rstep 0 false = 0 := by decide +kernel + +theorem rmask_zero : getRMask 0 = 0 := by decide +kernel + +theorem lstep_bound_ok : + allUpTo (fun q => decide (lstep q false < 1409) && decide (lstep q true < 1409)) 1409 = true := by decide +kernel + +theorem rstep_bound_ok : + allUpTo (fun q => decide (rstep q false < 1609) && decide (rstep q true < 1609)) 1609 = true := by decide +kernel + +theorem rpre_ok : + allUpTo (fun qR' => + (rstep qR' false == 3 || (rpre (rstep qR' false) false).elem qR') && + (rstep qR' true == 3 || (rpre (rstep qR' true) true).elem qR')) 1609 = true := by decide +kernel + +theorem transOK_true : allUpTo transOKAt 1409 = true := by decide +kernel + +theorem decompStepPre_ok : allUpTo decompStepPreAt 2263 = true := by decide +kernel + +section Soundness + +theorem lrun_headD_tail (L : List Bool) : lstep (lrun L.tail) (L.headD false) = lrun L := by + cases L with + | nil => exact lstep_zero + | cons b xs => rfl + +theorem rrun_headD_tail (R : List Bool) : rstep (rrun R.tail) (R.headD false) = rrun R := by + cases R with + | nil => exact rstep_zero + | cons b xs => rfl + +theorem allUpTo_sound {f : Nat → Bool} : + ∀ (n i : Nat), i < n → allUpTo f n = true → f i = true + | 0, i, hi, _ => by omega + | n + 1, i, hi, h => by + simp only [allUpTo, Bool.and_eq_true] at h + rcases Nat.eq_or_lt_of_le (Nat.le_of_lt_succ hi) with rfl | hlt + · exact h.1 + · exact allUpTo_sound n i hlt h.2 + +theorem lstep_lt {q : Nat} (hq : q < 1409) (b : Bool) : lstep q b < 1409 := by + have h := allUpTo_sound 1409 q hq lstep_bound_ok + simp only [Bool.and_eq_true, decide_eq_true_eq] at h + cases b + · exact h.1 + · exact h.2 + +theorem rstep_lt {q : Nat} (hq : q < 1609) (b : Bool) : rstep q b < 1609 := by + have h := allUpTo_sound 1609 q hq rstep_bound_ok + simp only [Bool.and_eq_true, decide_eq_true_eq] at h + cases b + · exact h.1 + · exact h.2 + +theorem lrun_lt (L : List Bool) : lrun L < 1409 := by + induction L with + | nil => decide + | cons b xs ih => exact lstep_lt ih b + +theorem rrun_lt (R : List Bool) : rrun R < 1609 := by + induction R with + | nil => decide + | cons b xs ih => exact rstep_lt ih b + +theorem elem_rpre {qR' : Nat} (hq : qR' < 1609) (b : Bool) (hne : rstep qR' b ≠ 3) : + (rpre (rstep qR' b) b).elem qR' = true := by + have h := allUpTo_sound 1609 qR' hq rpre_ok + simp only [Bool.and_eq_true, Bool.or_eq_true, beq_iff_eq] at h + cases b + · rcases h.1 with h3 | he + · exact False.elim (hne h3) + · exact he + · rcases h.2 with h3 | he + · exact False.elim (hne h3) + · exact he + +theorem allBitsIn_of_elem {m : Nat} : + ∀ (l : List Nat) (x : Nat), allBitsIn m l = true → l.elem x = true → Nat.testBit m x = true + | [], _, _, he => by cases he + | a :: as, x, hall, he => by + simp only [allBitsIn, Bool.and_eq_true] at hall + simp only [List.elem] at he + split at he + · next h => + rw [beq_iff_eq] at h + subst h + exact hall.1 + · exact allBitsIn_of_elem as x hall.2 he + +theorem deltaStep_of_testBit {w : Bool} {mtk : Nat} : + ∀ (l : List Nat) (qR : Nat), + deltaStep w mtk l = true → Nat.testBit (listToMask l) qR = true → + Nat.testBit mtk (rstep qR w) = true + | [], qR, _, hbit => by simp [listToMask] at hbit + | x :: xs, qR, hds, hbit => by + simp only [deltaStep, Bool.and_eq_true] at hds + simp only [listToMask, Nat.testBit_or, Bool.or_eq_true] at hbit + rcases hbit with hbit | hbit + · rw [Nat.testBit_two_pow, decide_eq_true_eq] at hbit + subst hbit + exact hds.1 + · exact deltaStep_of_testBit xs qR hds.2 hbit + +theorem deltaPre_of_testBit {b : Bool} {mtk : Nat} : + ∀ (l : List Nat) (qR : Nat), + deltaPre b mtk l = true → Nat.testBit (listToMask l) qR = true → + qR ≠ 3 ∧ allBitsIn mtk (rpre qR b) = true + | [], qR, _, hbit => by simp [listToMask] at hbit + | x :: xs, qR, hdp, hbit => by + simp only [deltaPre, Bool.and_eq_true, bne_iff_ne] at hdp + simp only [listToMask, Nat.testBit_or, Bool.or_eq_true] at hbit + rcases hbit with hbit | hbit + · rw [Nat.testBit_two_pow, decide_eq_true_eq] at hbit + subst hbit + exact ⟨hdp.1.1, hdp.1.2⟩ + · exact deltaPre_of_testBit xs qR hdp.2 hbit + +theorem testBit_of_or_eq {A B i : Nat} (hor : (A ||| B) = B) (ha : Nat.testBit A i = true) : + Nat.testBit B i = true := by + rw [← hor, Nat.testBit_or, ha, Bool.true_or] + +theorem subMask_sound {j_sub t_sub t_sup : Nat} + (h : subMask j_sub t_sub t_sup (getRMask t_sup) = true) + (hj : j_sub ≠ 0) (ht_sup : t_sup ≠ 0) : + t_sub ≠ 0 ∧ ∀ x, Nat.testBit (getRMask t_sub) x = true → Nat.testBit (getRMask t_sup) x = true := by + unfold subMask at h + have hjf : (j_sub == 0) = false := beq_false_of_ne hj + rw [hjf, Bool.false_or] at h + simp only [Bool.or_eq_true, Bool.and_eq_true, beq_iff_eq, bne_iff_ne] at h + rcases h with rfl | ⟨hne, hor⟩ + · exact ⟨ht_sup, fun _ hx => hx⟩ + · exact ⟨hne, fun _ hx => testBit_of_or_eq hor hx⟩ + +theorem subMask_of_fast {j_sub t_sub t_sup mask_sup : Nat} + (h : (j_sub == 0 || t_sub == t_sup) = true) : + subMask j_sub t_sub t_sup mask_sup = true := by + unfold subMask + rw [h, Bool.true_or] + +theorem subMaskIdx_sound {t_sub t_sup : Nat} + (h : subMaskIdx t_sub t_sup = true) + {x : Nat} (hx : Nat.testBit (getRMask t_sub) x = true) : + Nat.testBit (getRMask t_sup) x = true := by + dsimp only [subMaskIdx] at h + simp only [Bool.or_eq_true, beq_iff_eq] at h + rcases h with rfl | hor + · exact hx + · exact testBit_of_or_eq hor hx + +theorem checkStep_sound {w : Bool} {j1 j2 t1 t2 tk : Nat} {delta : List Nat} + (hc : checkStep w j1 j2 t1 t2 tk delta = true) (htk : tk ≠ 0) : + subMask j1 t1 tk (getRMask tk) = true ∧ + subMask j2 t2 tk (getRMask tk) = true ∧ + deltaStep w (getRMask tk) delta = true := by + dsimp only [checkStep] at hc + have htkf : (tk == 0) = false := beq_false_of_ne htk + rw [htkf, Bool.false_or, Bool.and_eq_true, Bool.or_eq_true] at hc + rcases hc with ⟨hfast | hsub, hds⟩ + · rw [Bool.and_eq_true] at hfast + exact ⟨subMask_of_fast hfast.1, subMask_of_fast hfast.2, hds⟩ + · rw [Bool.and_eq_true] at hsub + exact ⟨hsub.1, hsub.2, hds⟩ + +theorem checkPre_sound {b : Bool} {j1 j2 t1 t2 tk : Nat} {delta : List Nat} + (hc : checkPre b j1 j2 t1 t2 tk delta = true) (htk : tk ≠ 0) : + subMask j1 t1 tk (getRMask tk) = true ∧ + subMask j2 t2 tk (getRMask tk) = true ∧ + deltaPre b (getRMask tk) delta = true := by + dsimp only [checkPre] at hc + have htkf : (tk == 0) = false := beq_false_of_ne htk + rw [htkf, Bool.false_or, Bool.and_eq_true, Bool.or_eq_true] at hc + rcases hc with ⟨hfast | hsub, hdp⟩ + · rw [Bool.and_eq_true] at hfast + exact ⟨subMask_of_fast hfast.1, subMask_of_fast hfast.2, hdp⟩ + · rw [Bool.and_eq_true] at hsub + exact ⟨hsub.1, hsub.2, hdp⟩ + +theorem decomp_unpack {k : Nat} (hk : k < 2263) (hk0 : k ≠ 0) : + getJ1 k < k ∧ + getJ2 k < k ∧ + getRMask k = (getRMask (getJ1 k) ||| (getRMask (getJ2 k) ||| listToMask (getDelta k))) ∧ + (∀ w, checkStep w (getJ1 k) (getJ2 k) (getStepTarget (getJ1 k) w) (getStepTarget (getJ2 k) w) (getStepTarget k w) (getDelta k) = true) ∧ + (∀ b, checkPre b (getJ1 k) (getJ2 k) (getPreTarget (getJ1 k) b) (getPreTarget (getJ2 k) b) (getPreTarget k b) (getDelta k) = true) := by + have hd := allUpTo_sound 2263 k hk decompStepPre_ok + dsimp only [decompStepPreAt] at hd + have hkf : (k == 0) = false := beq_false_of_ne hk0 + have hkt : (k != 0) = true := bne_iff_ne.mpr hk0 + simp only [hkf, Bool.false_and, Bool.false_or, hkt, Bool.true_and, Bool.and_eq_true, Nat.ble_eq, beq_iff_eq] at hd + obtain ⟨⟨⟨⟨⟨⟨hj1, hj2⟩, hrm⟩, hsF⟩, hsT⟩, hpF⟩, hpT⟩ := hd + refine ⟨hj1, hj2, hrm, ?_, ?_⟩ + · intro w; cases w + · exact hsF + · exact hsT + · intro b; cases b + · exact hpF + · exact hpT + +theorem ne_zero_of_testBit_rmask {j x : Nat} (h : Nat.testBit (getRMask j) x = true) : j ≠ 0 := by + intro rfl + rw [rmask_zero, Nat.zero_testBit] at h + cases h + +theorem stepTarget_sound (w : Bool) (k : Nat) : + k < 2263 → getStepTarget k w ≠ 0 → + ∀ (qR : Nat), Nat.testBit (getRMask k) qR = true → + Nat.testBit (getRMask (getStepTarget k w)) (rstep qR w) = true := by + induction k using Nat.strong_induction_on with + | h k ih => + intro hk htk qR hbit + have hk0 : k ≠ 0 := ne_zero_of_testBit_rmask hbit + obtain ⟨hj1, hj2, hrm, hcs_all, _⟩ := decomp_unpack hk hk0 + have ⟨hsub1, hsub2, hds⟩ := checkStep_sound (hcs_all w) htk + rw [hrm, Nat.testBit_or, Nat.testBit_or, Bool.or_eq_true, Bool.or_eq_true] at hbit + rcases hbit with hbit1 | hbit2 | hbitd + · have hj1_ne : getJ1 k ≠ 0 := ne_zero_of_testBit_rmask hbit1 + obtain ⟨ht1, himp1⟩ := subMask_sound hsub1 hj1_ne htk + exact himp1 _ (ih (getJ1 k) hj1 (Nat.lt_trans hj1 hk) ht1 qR hbit1) + · have hj2_ne : getJ2 k ≠ 0 := ne_zero_of_testBit_rmask hbit2 + obtain ⟨ht2, himp2⟩ := subMask_sound hsub2 hj2_ne htk + exact himp2 _ (ih (getJ2 k) hj2 (Nat.lt_trans hj2 hk) ht2 qR hbit2) + · exact deltaStep_of_testBit (getDelta k) qR hds hbitd + +theorem preTarget_sound (b : Bool) (k : Nat) : + k < 2263 → getPreTarget k b ≠ 0 → + ∀ (qR' : Nat), qR' < 1609 → Nat.testBit (getRMask k) (rstep qR' b) = true → + Nat.testBit (getRMask (getPreTarget k b)) qR' = true := by + induction k using Nat.strong_induction_on with + | h k ih => + intro hk htk qR' hqR' hbit + have hk0 : k ≠ 0 := ne_zero_of_testBit_rmask hbit + obtain ⟨hj1, hj2, hrm, _, hcp_all⟩ := decomp_unpack hk hk0 + have ⟨hsub1, hsub2, hdp⟩ := checkPre_sound (hcp_all b) htk + rw [hrm, Nat.testBit_or, Nat.testBit_or, Bool.or_eq_true, Bool.or_eq_true] at hbit + rcases hbit with hbit1 | hbit2 | hbitd + · have hj1_ne : getJ1 k ≠ 0 := ne_zero_of_testBit_rmask hbit1 + obtain ⟨ht1, himp1⟩ := subMask_sound hsub1 hj1_ne htk + exact himp1 _ (ih (getJ1 k) hj1 (Nat.lt_trans hj1 hk) ht1 qR' hqR' hbit1) + · have hj2_ne : getJ2 k ≠ 0 := ne_zero_of_testBit_rmask hbit2 + obtain ⟨ht2, himp2⟩ := subMask_sound hsub2 hj2_ne htk + exact himp2 _ (ih (getJ2 k) hj2 (Nat.lt_trans hj2 hk) ht2 qR' hqR' hbit2) + · obtain ⟨hne3, hall⟩ := deltaPre_of_testBit (getDelta k) (rstep qR' b) hdp hbitd + exact allBitsIn_of_elem _ qR' hall (elem_rpre hqR' b hne3) + +def inMid (qL s : Nat) (h : Bool) (qR : Nat) : Bool := + Nat.testBit (getRMask (getMid qL s h)) qR + +def Inv (c : Cfg) : Prop := + inMid (lrun c.L) c.q c.h (rrun c.R) = true + +theorem getMid_ne_zero {qL s : Nat} {h : Bool} {qR : Nat} + (hm : inMid qL s h qR = true) : getMid qL s h ≠ 0 := + ne_zero_of_testBit_rmask hm + +theorem getMid_eq_row {qL s : Nat} (hs : s < 6) (h : Bool) : + getMid qL s h = getMidFromRow (getLeftRow qL) s h := by + unfold getMid + have hb : Nat.ble (s + 1) 6 = true := Nat.ble_eq.mpr hs + rw [hb] + +theorem s_lt_of_inMid {qL s : Nat} {h : Bool} {qR : Nat} + (hm : inMid qL s h qR = true) : s < 6 := by + have hne := getMid_ne_zero hm + unfold getMid at hne + cases hb : Nat.ble (s + 1) 6 + · rw [hb] at hne; exact False.elim (hne rfl) + · exact Nat.ble_eq.mp hb + +theorem not_halted_of_Inv {c : Cfg} (hi : Inv c) : ¬ halted M c := by + rcases c with ⟨q, L, h, R⟩ + have hs := s_lt_of_inMid hi + have hqL : lrun L < 1409 := lrun_lt L + have htr := allUpTo_sound 1409 (lrun L) hqL transOK_true + dsimp only [transOKAt] at htr + simp only [Bool.and_eq_true, beq_iff_eq] at htr + have h4f : getMidFromRow (getLeftRow (lrun L)) 4 false = 0 := htr.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1 + intro hh + match q, h with + | 0, false | 0, true | 1, false | 1, true | 2, false | 2, true + | 3, false | 3, true | 4, true | 5, false | 5, true => + cases hh + | 4, false => + have hne := getMid_ne_zero hi + change getMid (lrun L) 4 false ≠ 0 at hne + rw [getMid_eq_row (by decide)] at hne + exact hne h4f + | q + 6, _ => + change q + 6 < 6 at hs; omega + +theorem rightMoveStep_sound (qL : Nat) (R : List Bool) (w : Bool) {s s' : Nat} {h : Bool} + (hs : s < 6) (hs' : s' < 6) + (hrs : rightMoveStep (getLeftRow qL) (getLeftRow (lstep qL w)) s h s' = true) + (hm : inMid qL s h (rrun R) = true) : + inMid (lstep qL w) s' (R.headD false) (rrun R.tail) = true := by + have hne := getMid_ne_zero hm + rw [getMid_eq_row hs] at hne + dsimp only [rightMoveStep] at hrs + have hkf : (getMidFromRow (getLeftRow qL) s h == 0) = false := beq_false_of_ne hne + rw [hkf, Bool.false_or] at hrs + simp only [Bool.and_eq_true, Nat.ble_eq, bne_iff_ne] at hrs + obtain ⟨⟨⟨⟨hk, htpF⟩, htpT⟩, hsubF⟩, hsubT⟩ := hrs + rw [← getMid_eq_row hs] at hk htpF htpT hsubF hsubT + have hbit : Nat.testBit (getRMask (getMid qL s h)) (rstep (rrun R.tail) (R.headD false)) = true := by + rw [rrun_headD_tail R]; exact hm + have hqR' : rrun R.tail < 1609 := rrun_lt R.tail + unfold inMid + rw [getMid_eq_row hs'] + cases hrb : R.headD false <;> rw [hrb] at hbit + · have hpre := preTarget_sound false (getMid qL s h) hk htpF (rrun R.tail) hqR' hbit + exact subMaskIdx_sound hsubF hpre + · have hpre := preTarget_sound true (getMid qL s h) hk htpT (rrun R.tail) hqR' hbit + exact subMaskIdx_sound hsubT hpre + +theorem leftMoveStep_sound (qL' qR : Nat) (w b : Bool) {s s' : Nat} {h : Bool} + (hs : s < 6) (hs' : s' < 6) + (hls : leftMoveStep (getLeftRow (lstep qL' b)) (getLeftRow qL') s h w s' b = true) + (hm : inMid (lstep qL' b) s h qR = true) : + inMid qL' s' b (rstep qR w) = true := by + have hne := getMid_ne_zero hm + rw [getMid_eq_row hs] at hne + dsimp only [leftMoveStep] at hls + have hkf : (getMidFromRow (getLeftRow (lstep qL' b)) s h == 0) = false := beq_false_of_ne hne + rw [hkf, Bool.false_or] at hls + simp only [Bool.and_eq_true, Nat.ble_eq, bne_iff_ne] at hls + obtain ⟨⟨hk, hts⟩, hsub⟩ := hls + rw [← getMid_eq_row hs] at hk hts hsub + have hstep := stepTarget_sound w (getMid (lstep qL' b) s h) hk hts qR hm + unfold inMid + rw [getMid_eq_row hs'] + exact subMaskIdx_sound hsub hstep + + +theorem Inv_step {c : Cfg} (hi : Inv c) : Inv (step M c) := by + rcases c with ⟨q, L, h, R⟩ + have hs := s_lt_of_inMid hi + have hnh := not_halted_of_Inv hi + unfold Inv at hi + have htr := allUpTo_sound 1409 (lrun L) (lrun_lt L) transOK_true + dsimp only [transOKAt] at htr + simp only [Bool.and_eq_true] at htr + obtain ⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨_, hr0F⟩, hr0T⟩, hr1T⟩, hr2F⟩, hr4T⟩, hr5T⟩, + hl1F_F⟩, hl2T_F⟩, hl3F_F⟩, hl3T_F⟩, hl5F_F⟩, + hl1F_T⟩, hl2T_T⟩, hl3F_T⟩, hl3T_T⟩, hl5F_T⟩ := htr + have htr' := allUpTo_sound 1409 (lrun L.tail) (lrun_lt L.tail) transOK_true + dsimp only [transOKAt] at htr' + simp only [Bool.and_eq_true] at htr' + obtain ⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨⟨_, _⟩, _⟩, _⟩, _⟩, _⟩, _⟩, + hl1F_F'⟩, hl2T_F'⟩, hl3F_F'⟩, hl3T_F'⟩, hl5F_F'⟩, + hl1F_T'⟩, hl2T_T'⟩, hl3F_T'⟩, hl3T_T'⟩, hl5F_T'⟩ := htr' + have hmL : inMid (lstep (lrun L.tail) (L.headD false)) q h (rrun R) = true := by + rw [lrun_headD_tail L]; exact hi + match q, h with + | 0, false => + change inMid (lstep (lrun L) true) 1 (R.headD false) (rrun R.tail) = true + exact rightMoveStep_sound (lrun L) R true (by decide) (by decide) hr0F hi + | 0, true => + change inMid (lstep (lrun L) true) 2 (R.headD false) (rrun R.tail) = true + exact rightMoveStep_sound (lrun L) R true (by decide) (by decide) hr0T hi + | 1, false => + change inMid (lrun L.tail) 2 (L.headD false) (rstep (rrun R) true) = true + cases hb : L.headD false <;> rw [hb] at hmL + · exact leftMoveStep_sound (lrun L.tail) (rrun R) true false (by decide) (by decide) hl1F_F' hmL + · exact leftMoveStep_sound (lrun L.tail) (rrun R) true true (by decide) (by decide) hl1F_T' hmL + | 1, true => + change inMid (lstep (lrun L) false) 5 (R.headD false) (rrun R.tail) = true + exact rightMoveStep_sound (lrun L) R false (by decide) (by decide) hr1T hi + | 2, false => + change inMid (lstep (lrun L) true) 4 (R.headD false) (rrun R.tail) = true + exact rightMoveStep_sound (lrun L) R true (by decide) (by decide) hr2F hi + | 2, true => + change inMid (lrun L.tail) 3 (L.headD false) (rstep (rrun R) false) = true + cases hb : L.headD false <;> rw [hb] at hmL + · exact leftMoveStep_sound (lrun L.tail) (rrun R) false false (by decide) (by decide) hl2T_F' hmL + · exact leftMoveStep_sound (lrun L.tail) (rrun R) false true (by decide) (by decide) hl2T_T' hmL + | 3, false => + change inMid (lrun L.tail) 1 (L.headD false) (rstep (rrun R) true) = true + cases hb : L.headD false <;> rw [hb] at hmL + · exact leftMoveStep_sound (lrun L.tail) (rrun R) true false (by decide) (by decide) hl3F_F' hmL + · exact leftMoveStep_sound (lrun L.tail) (rrun R) true true (by decide) (by decide) hl3F_T' hmL + | 3, true => + change inMid (lrun L.tail) 3 (L.headD false) (rstep (rrun R) false) = true + cases hb : L.headD false <;> rw [hb] at hmL + · exact leftMoveStep_sound (lrun L.tail) (rrun R) false false (by decide) (by decide) hl3T_F' hmL + · exact leftMoveStep_sound (lrun L.tail) (rrun R) false true (by decide) (by decide) hl3T_T' hmL + | 4, false => + exfalso; exact hnh rfl + | 4, true => + change inMid (lstep (lrun L) true) 5 (R.headD false) (rrun R.tail) = true + exact rightMoveStep_sound (lrun L) R true (by decide) (by decide) hr4T hi + | 5, false => + change inMid (lrun L.tail) 5 (L.headD false) (rstep (rrun R) false) = true + cases hb : L.headD false <;> rw [hb] at hmL + · exact leftMoveStep_sound (lrun L.tail) (rrun R) false false (by decide) (by decide) hl5F_F' hmL + · exact leftMoveStep_sound (lrun L.tail) (rrun R) false true (by decide) (by decide) hl5F_T' hmL + | 5, true => + change inMid (lstep (lrun L) false) 0 (R.headD false) (rrun R.tail) = true + exact rightMoveStep_sound (lrun L) R false (by decide) (by decide) hr5T hi + | q + 6, _ => + change q + 6 < 6 at hs; omega + +theorem lrun_strip (L : List Bool) : lrun (strip L) = lrun L := by + induction L with + | nil => rfl + | cons b xs ih => + cases b + · dsimp only [strip] + cases h : strip xs with + | nil => + change 0 = lstep (lrun xs) false + rw [← ih, h] + exact lstep_zero.symm + | cons y ys => + change lstep (lrun (y :: ys)) false = lstep (lrun xs) false + rw [← h, ih] + · simp only [strip, lrun, ih] + +theorem rrun_strip (R : List Bool) : rrun (strip R) = rrun R := by + induction R with + | nil => rfl + | cons b xs ih => + cases b + · dsimp only [strip] + cases h : strip xs with + | nil => + change 0 = rstep (rrun xs) false + rw [← ih, h] + exact rstep_zero.symm + | cons y ys => + change rstep (rrun (y :: ys)) false = rstep (rrun xs) false + rw [← h, ih] + · simp only [strip, rrun, ih] + +theorem lrun_eqv {x y : List Bool} (h : eqv x y) : lrun x = lrun y := by + rw [← lrun_strip x, ← lrun_strip y, h] + +theorem rrun_eqv {x y : List Bool} (h : eqv x y) : rrun x = rrun y := by + rw [← rrun_strip x, ← rrun_strip y, h] + +theorem Inv_of_eqvC {c d : Cfg} (he : eqvC c d) (hi : Inv c) : Inv d := by + obtain ⟨hq, hh, hL, hR⟩ := he + unfold Inv at hi ⊢ + rw [← hq, ← hh, ← lrun_eqv hL, ← rrun_eqv hR] + exact hi + +theorem Inv_run (n : Nat) : ∀ {c : Cfg}, Inv c → Inv (run M n c) := by + induction n with + | zero => intro c hi; exact hi + | succ n ih => intro c hi; exact ih (Inv_step hi) + +theorem nonhalt_of_start {q : Nat} (h : ∃ m, Inv (run M m (blank q))) : + ∀ n, ¬ halted M (run M n (blank q)) := by + obtain ⟨m, hm⟩ := h + intro n hn + by_cases hnm : m ≤ n + · have : n = m + (n - m) := by omega + rw [this, run_add] at hn + exact not_halted_of_Inv (Inv_run (n - m) hm) hn + · have := halted_mono (show n ≤ m + 0 by omega) hn + rw [run_add] at this + exact not_halted_of_Inv hm this + +end Soundness + +theorem evStep_shift (d : Nat) {n n' : Nat} {W W' : List Bool} + (h : evStep (n, W) = some (n', W')) : + evStep (n + d, W) = some (n' + d, W') := by + rcases W with _ | ⟨b, Ws⟩ + · simp [evStep] at h + cases b + case true => simp [evStep] at h + by_cases hn : 2 ≤ n + case neg => simp [evStep, hn] at h + have hnd : 2 ≤ n + d := by omega + cases hw : M23.wordMapFast 450 (Ws ++ List.replicate PAD false) with + | none => simp [evStep, hn, hw] at h + | some r => + obtain ⟨J', V⟩ := r + simp only [evStep, hn, hnd, if_true, hw, Option.some.injEq, Prod.mk.injEq] at h ⊢ + obtain ⟨rfl, rfl⟩ := h + refine ⟨?_, rfl⟩ + omega + +def suffixStep (S : List Bool) : Option (List Bool) := + match M23.seekToB0 450 ⟨.C, [], false, S ++ List.replicate PAD false⟩ with + | some (true :: false :: S_raw) => some (strip S_raw) + | _ => none + +theorem suffixStep_sound {P S S' : List Bool} (n : Nat) (hn : 2 ≤ n) + (hP : M23.ValidCPrefix P) (hS : suffixStep S = some S') : + ∃ m, eqvC (run M m (ck n (false :: (P ++ S)))) (ck (n + 2) (false :: (P ++ S'))) := by + unfold suffixStep at hS + split at hS + · rename_i S_raw hseek + simp only [Option.some.injEq] at hS + subst hS + obtain ⟨a2, ha2⟩ := M23.seekToB0_sound 450 hseek + obtain ⟨a, V, hw, hV⟩ := M23.wordHyp_prefix hP ha2 + obtain ⟨k, rfl⟩ : ∃ k, n = k + 2 := ⟨n - 2, by omega⟩ + have hw' : M23.wordHyp ((P ++ S) ++ List.replicate PAD false) a 2 2 V := by + simpa [List.append_assoc] using hw + have ev := M23.event k 2 2 a ((P ++ S) ++ List.replicate PAD false) V (by omega) hw' + have hsub : 2 + (k + 2 - 2) = k + 2 := by omega + rw [hsub] at ev + have hr := run_f (M23.evSteps k a (k + 2)) + (M23.ckpt (k + 2) (false :: ((P ++ S) ++ List.replicate PAD false))) + (by unfold goodC M23.ckpt; intro h; cases h) + rw [ev, ck_f, ck_f] at hr + refine ⟨M23.evSteps k a (k + 2), ?_⟩ + have e1 : eqvC (ck (k + 2) (false :: (P ++ S))) + (ck (k + 2) (false :: ((P ++ S) ++ List.replicate PAD false))) := by + refine ⟨rfl, rfl, rfl, ?_⟩ + show eqv _ _ + apply eqv_append + show strip _ = strip _ + rw [← List.cons_append]; exact (eqv_pad _ _).symm + have e2 := run_eqvC M (M23.evSteps k a (k + 2)) e1 + rw [← hr] at e2 + refine eqvC_trans e2 ⟨rfl, rfl, rfl, ?_⟩ + show eqv _ _ + simp only [ck, hV] + have e3 : M23.pw (k + 2 + 1) M23.U ++ (M23.U ++ (false :: P ++ S_raw)) + = M23.pw (k + 2 + 2) M23.U ++ (false :: (P ++ S_raw)) := by + rw [M23.pw_succ' (k + 2 + 1), List.append_assoc] + simp + rw [e3] + apply eqv_append + exact eqv_cons false (eqv_append (eqv_strip S_raw).symm) + · cases hS + +def suffixIter : Nat → List Bool → Option (List Bool) + | 0, S => some S + | k + 1, S => (suffixStep S).bind (suffixIter k) + +theorem suffixIter_sound (k : Nat) {P : List Bool} (hP : M23.ValidCPrefix P) : + ∀ {S S' : List Bool} (n : Nat), 2 ≤ n → suffixIter k S = some S' → + ∃ m, eqvC (run M m (ck n (false :: (P ++ S)))) (ck (n + 2 * k) (false :: (P ++ S'))) := by + induction k with + | zero => + intro S S' n _ h + simp only [suffixIter, Option.some.injEq] at h + subst h + exact ⟨0, eqvC_refl _⟩ + | succ k ih => + intro S S' n hn h + simp only [suffixIter, Option.bind_eq_some_iff] at h + obtain ⟨S1, h1, h2⟩ := h + obtain ⟨m1, e1⟩ := suffixStep_sound n hn hP h1 + obtain ⟨m2, e2⟩ := ih (n + 2) (by omega) h2 + refine ⟨m1 + m2, ?_⟩ + rw [run_add] + have e3 := eqvC_trans (run_eqvC M m2 e1) e2 + have h_add : n + 2 + 2 * k = n + 2 * (k + 1) := by omega + rw [h_add] at e3 + exact e3 + +inductive TArr (α : Type) where + | leaf (v : α) + | node (sz : Nat) (l r : TArr α) + +def TArr.get {α : Type} : TArr α → Nat → α → α + | .leaf v, 0, _ => v + | .leaf _, _, d => d + | .node sz l r, i, d => + if i < sz then l.get i d else r.get (i - sz) d + +def sNat {α : Type} (n : Nat) (f : Nat → α) : α := + match n + 1 with + | 0 => f 0 + | m + 1 => f m + +theorem sNat_eq {α : Type} (n : Nat) (f : Nat → α) : sNat n f = f n := by + unfold sNat + split + · omega + · rename_i m hm + have : m = n := by omega + subst this; rfl + +def eqLB : List Bool → List Bool → Bool + | [], [] => true + | x :: xs, y :: ys => (x == y) && eqLB xs ys + | _, _ => false + +theorem eqLB_iff {xs ys : List Bool} : eqLB xs ys = true ↔ xs = ys := by + induction xs generalizing ys with + | nil => cases ys <;> simp [eqLB] + | cons x xs ih => + cases ys with + | nil => simp [eqLB] + | cons y ys => + simp only [eqLB, Bool.and_eq_true, beq_iff_eq, ih, List.cons.injEq] + +def eqOptLB : Option (List Bool) → List Bool → Bool + | some xs, ys => eqLB xs ys + | none, _ => false + +theorem eqOptLB_iff {o : Option (List Bool)} {ys : List Bool} : + eqOptLB o ys = true ↔ o = some ys := by + cases o with + | none => simp [eqOptLB] + | some xs => simp only [eqOptLB, eqLB_iff, Option.some.injEq] + +def eqOptPair : Option (Nat × List Bool) → Nat → List Bool → Bool + | some (n, xs), m, ys => (n == m) && eqLB xs ys + | none, _, _ => false + +theorem eqOptPair_iff {o : Option (Nat × List Bool)} {m : Nat} {ys : List Bool} : + eqOptPair o m ys = true ↔ o = some (m, ys) := by + cases o with + | none => simp [eqOptPair] + | some p => + obtain ⟨n, xs⟩ := p + simp only [eqOptPair, Bool.and_eq_true, beq_iff_eq, eqLB_iff, Option.some.injEq, Prod.mk.injEq] + +def segTable : TArr (List Bool) := (.node 7 (.node 3 (.node 1 (.leaf + [true, true, false, true, true, true, false]) (.node 1 (.leaf + [true, true, true, false]) (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false]))) + (.node 2 (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, true, false])) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false])))) + (.node 3 (.node 1 (.leaf + [true, true, false, true, true, false, true, true, true, false]) (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, false, true, true, false]) + (.leaf [true, true, false, false, true, true, false]))) (.node 2 (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false])) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false]))))) + +def segBits (i : Nat) : List Bool := segTable.get i [] + +def stateTable : TArr (List Bool) := (.node 79 (.node 39 (.node 19 (.node 9 (.node 4 + (.node 2 (.node 1 (.leaf + [true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, false, false, true, true, false, true, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]))) + (.node 2 (.node 1 (.leaf + [true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]))))) + (.node 5 (.node 2 (.node 1 (.leaf + [true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true])))) + (.node 2 (.node 1 (.leaf + [true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, false, true, true, false, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true])))))) + (.node 10 (.node 5 (.node 2 (.node 1 (.leaf + [true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true])))) + (.node 2 (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]))))) + (.node 5 (.node 2 (.node 1 (.leaf + [true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.node 1 (.leaf + [true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true])))) + (.node 2 (.node 1 (.leaf + [true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]))))))) + (.node 20 (.node 10 (.node 5 (.node 2 (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, true, true, false, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true])))) + (.node 2 (.node 1 (.leaf + [true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]))))) + (.node 5 (.node 2 (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true])))) + (.node 2 (.node 1 (.leaf + [true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true])))))) + (.node 10 (.node 5 (.node 2 (.node 1 (.leaf + [true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true])))) + (.node 2 (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]))))) + (.node 5 (.node 2 (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true])))) + (.node 2 (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true])))))))) + (.node 40 (.node 20 (.node 10 (.node 5 (.node 2 (.node 1 (.leaf + [true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true])))) + (.node 2 (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]))))) + (.node 5 (.node 2 (.node 1 (.leaf + [true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [true, true, true, false, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true])))) + (.node 2 (.node 1 (.leaf + [true, true, false, true, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true])))))) + (.node 10 (.node 5 (.node 2 (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, true, false, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true])))) + (.node 2 (.node 1 (.leaf + [true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]))))) + (.node 5 (.node 2 (.node 1 (.leaf + [true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.node 1 (.leaf + [true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true])))) + (.node 2 (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true])) + (.node 1 (.leaf + [true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true]))))))) + (.node 20 (.node 10 (.node 5 (.node 2 (.node 1 (.leaf + [true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true])))) + (.node 2 (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]))))) + (.node 5 (.node 2 (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true])))) + (.node 2 (.node 1 (.leaf + [true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true])))))) + (.node 10 (.node 5 (.node 2 (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true])))) + (.node 2 (.node 1 (.leaf + [true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true])) + (.node 1 (.leaf + [true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [true, true, true, false, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]))))) + (.node 5 (.node 2 (.node 1 (.leaf + [true, true, false, true, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, false, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [true, true, false, true, true, false, true, true, false, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true])))) + (.node 2 (.node 1 (.leaf + [true, true, false, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true]))))))))) + +def stateBits (i : Nat) : List Bool := stateTable.get i [] + +def fbTable : TArr (List Bool) := (.node 13 (.node 6 (.node 3 (.node 1 (.leaf + [false, false, true, true, false, true, true, true, false, true]) (.node 1 (.leaf + [false, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [false, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]))) + (.node 1 (.leaf + [false, true, true, false, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [false, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [false, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true])))) + (.node 3 (.node 1 (.leaf + [false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [false, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [false, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]))) + (.node 2 (.node 1 (.leaf + [false, true, true, false, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [false, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [false, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.leaf + [false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]))))) + (.node 7 (.node 3 (.node 1 (.leaf + [false, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, true, true, false, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [false, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [false, true, true, false, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]))) + (.node 2 (.node 1 (.leaf + [false, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [false, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true])) + (.node 1 (.leaf + [false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true]) + (.leaf + [false, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true])))) + (.node 3 (.node 1 (.leaf + [false, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.node 1 (.leaf + [false, true, true, false, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [false, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]))) + (.node 2 (.node 1 (.leaf + [false, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true])) + (.node 1 (.leaf + [false, true, true, false, true, true, false, false, false, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, true]) + (.leaf + [false, false, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, false, true, true, false, true])))))) + +def fbBits (i : Nat) : List Bool := fbTable.get i [] + +inductive CAct where + | push (seg : Nat) (s_rem : Nat) + | mac (k : Nat) (s_end : Nat) + | popExit (pops : List (Nat × Nat)) (w_exit : Option Nat) + | none + +inductive FbAct where + | fb (dn : Nat) (is_c : Bool) (out_id : Nat) + | none + +def cActTable : TArr CAct := (.node 79 (.node 39 (.node 19 (.node 9 (.node 4 (.node 2 + (.node 1 (.leaf (.mac 2 1)) (.leaf (.popExit [] (some 1)))) (.node 1 (.leaf + (.mac 2 3)) (.leaf (.popExit [] (some 3))))) (.node 2 (.node 1 (.leaf (.mac 12 5)) + (.leaf (.popExit [(3, 25), (6, 39)] (some 5)))) (.node 1 (.leaf (.mac 32 7)) (.node 1 + (.leaf + (.popExit [(0, 11), (1, 17), (4, 27), (5, 48), (7, 41), (10, 68), (12, 84)] (some 7))) + (.leaf (.mac 2 9)))))) (.node 5 (.node 2 (.node 1 (.leaf (.push 0 10)) (.leaf + (.mac 29 7))) (.node 1 (.leaf (.mac 1 12)) (.node 1 (.leaf + (.popExit [(0, 29), (1, 43), (8, 50), (11, 70), (13, 86)] (some 9))) (.leaf + (.push 0 14))))) (.node 2 (.node 1 (.leaf (.mac 14 15)) (.leaf (.push 1 16))) (.node 1 + (.leaf (.mac 17 7)) (.node 1 (.leaf (.mac 1 18)) (.leaf + (.popExit [(0, 19), (1, 35)] none))))))) (.node 10 (.node 5 (.node 2 (.node 1 (.leaf + (.mac 5 20)) (.leaf (.push 2 21))) (.node 1 (.leaf (.mac 6 22)) (.node 1 (.leaf + (.popExit [(2, 23), (5, 37)] none)) (.leaf (.mac 8 24))))) (.node 2 (.node 1 (.leaf + (.push 3 4)) (.leaf (.mac 2 26))) (.node 1 (.leaf (.push 4 6)) (.node 1 (.leaf + (.mac 2 28)) (.leaf (.push 0 8)))))) (.node 5 (.node 2 (.node 1 (.leaf (.mac 1 30)) + (.leaf (.popExit [(3, 72), (6, 88), (9, 52)] (some 11)))) (.node 1 (.leaf + (.push 0 32)) (.node 1 (.leaf (.mac 2 33)) (.leaf (.push 1 34))))) (.node 2 (.node 1 + (.leaf (.mac 12 15)) (.leaf (.mac 5 36))) (.node 1 (.leaf (.push 5 21)) (.node 1 + (.leaf (.mac 8 38)) (.leaf (.push 6 4)))))))) (.node 20 (.node 10 (.node 5 (.node 2 + (.node 1 (.leaf (.mac 2 40)) (.leaf (.push 7 6))) (.node 1 (.leaf (.mac 2 42)) (.node + 1 (.leaf (.push 1 8)) (.leaf (.mac 1 44))))) (.node 2 (.node 1 (.leaf + (.popExit [(0, 45), (2, 65), (5, 82)] none)) (.leaf (.mac 1 46))) (.node 1 (.leaf + (.push 5 47)) (.node 1 (.leaf (.mac 30 7)) (.leaf (.mac 2 49)))))) (.node 5 (.node 2 + (.node 1 (.leaf (.push 8 8)) (.leaf (.mac 2 51))) (.node 1 (.leaf (.push 9 13)) (.node + 1 (.leaf (.mac 1 53)) (.leaf + (.popExit [(0, 57), (1, 61), (4, 74), (5, 97), (7, 90), (10, 123), (12, 139)] (some 13)))))) + (.node 2 (.node 1 (.leaf (.push 0 55)) (.leaf (.push 0 56))) (.node 1 (.leaf + (.mac 1 33)) (.node 1 (.leaf (.mac 1 58)) (.leaf + (.popExit [(0, 76), (1, 92), (8, 99), (11, 125), (13, 141)] (some 15)))))))) (.node 10 + (.node 5 (.node 2 (.node 1 (.leaf (.push 0 60)) (.leaf (.push 1 55))) (.node 1 (.leaf + (.mac 1 62)) (.node 1 (.leaf (.popExit [(0, 63), (1, 80)] none)) (.leaf + (.mac 1 64))))) (.node 2 (.node 1 (.leaf (.push 2 33)) (.leaf (.mac 1 66))) (.node 1 + (.leaf (.push 10 67)) (.node 1 (.leaf (.mac 31 7)) (.leaf (.mac 2 69)))))) (.node 5 + (.node 2 (.node 1 (.leaf (.push 11 8)) (.leaf (.mac 2 71))) (.node 1 (.leaf + (.push 3 13)) (.node 1 (.leaf (.mac 2 73)) (.leaf (.push 4 31))))) (.node 2 (.node 1 + (.leaf (.mac 2 75)) (.leaf (.push 0 54))) (.node 1 (.leaf (.mac 1 77)) (.node 1 (.leaf + (.popExit [(3, 127), (6, 143), (9, 101)] (some 17))) (.leaf (.push 0 79))))))))) + (.node 40 (.node 20 (.node 10 (.node 5 (.node 2 (.node 1 (.leaf (.push 1 60)) (.leaf + (.mac 1 81))) (.node 1 (.leaf (.push 5 33)) (.node 1 (.leaf (.mac 1 83)) (.leaf + (.push 12 67))))) (.node 2 (.node 1 (.leaf (.mac 2 85)) (.leaf (.push 13 8))) (.node 1 + (.leaf (.mac 2 87)) (.node 1 (.leaf (.push 6 13)) (.leaf (.mac 2 89)))))) (.node 5 + (.node 2 (.node 1 (.leaf (.push 7 31)) (.leaf (.mac 2 91))) (.node 1 (.leaf + (.push 1 54)) (.node 1 (.leaf (.mac 1 93)) (.leaf + (.popExit [(0, 94), (2, 121), (5, 137)] none))))) (.node 2 (.node 1 (.leaf + (.mac 1 95)) (.leaf (.push 5 96))) (.node 1 (.leaf (.push 0 33)) (.node 1 (.leaf + (.mac 2 98)) (.leaf (.push 8 54))))))) (.node 10 (.node 5 (.node 2 (.node 1 (.leaf + (.mac 2 100)) (.leaf (.push 9 59))) (.node 1 (.leaf (.mac 1 102)) (.node 1 (.leaf + (.popExit [(0, 107), (1, 111), (4, 129), (5, 152), (7, 145)] (some 19))) (.leaf + (.push 0 104))))) (.node 2 (.node 1 (.leaf (.push 0 105)) (.leaf (.push 1 106))) + (.node 1 (.leaf (.push 1 96)) (.node 1 (.leaf (.mac 1 108)) (.leaf + (.popExit [(0, 131), (1, 147), (8, 154)] (some 21))))))) (.node 5 (.node 2 (.node 1 + (.leaf (.push 0 110)) (.leaf (.push 1 104))) (.node 1 (.leaf (.mac 1 112)) (.node 1 + (.leaf (.popExit [(0, 113), (1, 135)] none)) (.leaf (.mac 1 114))))) (.node 2 (.node 1 + (.leaf (.push 2 115)) (.leaf (.push 1 116))) (.node 1 (.leaf (.push 1 117)) (.node 1 + (.leaf (.push 0 118)) (.leaf (.mac 2 119)))))))) (.node 20 (.node 10 (.node 5 (.node 2 + (.node 1 (.leaf (.push 1 120)) (.leaf (.mac 9 15))) (.node 1 (.leaf (.mac 1 122)) + (.node 1 (.leaf (.push 10 55)) (.leaf (.mac 2 124))))) (.node 2 (.node 1 (.leaf + (.push 11 54)) (.leaf (.mac 2 126))) (.node 1 (.leaf (.push 3 59)) (.node 1 (.leaf + (.mac 2 128)) (.leaf (.push 4 78)))))) (.node 5 (.node 2 (.node 1 (.leaf (.mac 2 130)) + (.leaf (.push 0 103))) (.node 1 (.leaf (.mac 1 132)) (.node 1 (.leaf + (.popExit [(9, 156)] (some 23))) (.leaf (.push 0 134))))) (.node 2 (.node 1 (.leaf + (.push 1 110)) (.leaf (.mac 1 136))) (.node 1 (.leaf (.push 5 115)) (.node 1 (.leaf + (.mac 1 138)) (.leaf (.push 12 55))))))) (.node 10 (.node 5 (.node 2 (.node 1 (.leaf + (.mac 2 140)) (.leaf (.push 13 54))) (.node 1 (.leaf (.mac 2 142)) (.node 1 (.leaf + (.push 6 59)) (.leaf (.mac 2 144))))) (.node 2 (.node 1 (.leaf (.push 7 78)) (.leaf + (.mac 2 146))) (.node 1 (.leaf (.push 1 103)) (.node 1 (.leaf (.mac 1 148)) (.leaf + (.popExit [(0, 149)] none)))))) (.node 5 (.node 2 (.node 1 (.leaf (.mac 1 150)) (.leaf + (.push 5 151))) (.node 1 (.leaf (.push 0 115)) (.node 1 (.leaf (.mac 2 153)) (.leaf + (.push 8 103))))) (.node 2 (.node 1 (.leaf (.mac 2 155)) (.leaf (.push 9 109))) (.node + 1 (.leaf (.mac 1 157)) (.node 1 (.leaf (.popExit [] (some 25))) (.leaf + (.popExit [] none)))))))))) + +def fbActTable : TArr FbAct := (.node 13 (.node 6 (.node 3 (.node 1 (.leaf (.fb 0 true 0)) (.node 1 (.leaf (.fb 2 false 2)) (.leaf (.fb 0 true 2)))) (.node 1 (.leaf (.fb 2 false 4)) (.node 1 (.leaf (.fb 0 true 4)) (.leaf (.fb 2 false 6))))) (.node 3 (.node 1 (.leaf (.fb 0 true 6)) (.node 1 (.leaf (.fb 2 false 8)) (.leaf (.fb 0 true 8)))) (.node 2 (.node 1 (.leaf (.fb 2 false 10)) (.leaf (.fb 0 true 13))) (.node 1 (.leaf (.fb 2 false 12)) (.leaf (.fb 0 true 31)))))) (.node 7 (.node 3 (.node 1 (.leaf (.fb 2 false 14)) (.node 1 (.leaf (.fb 0 true 54)) (.leaf (.fb 2 false 16)))) (.node 2 (.node 1 (.leaf (.fb 0 true 59)) (.leaf (.fb 2 false 18))) (.node 1 (.leaf (.fb 0 true 78)) (.leaf (.fb 2 false 20))))) (.node 3 (.node 1 (.leaf (.fb 0 true 103)) (.node 1 (.leaf (.fb 2 false 22)) (.leaf (.fb 0 true 109)))) (.node 2 (.node 1 (.leaf (.fb 2 false 24)) (.leaf (.fb 0 true 133))) (.node 1 (.leaf (.fb 2 false 26)) (.leaf (.fb 0 true 158))))))) + +def lookupPop : List (Nat × Nat) → Nat → Option Nat + | [], _ => none + | (seg, s_comb) :: rest, target => + if seg == target then some s_comb else lookupPop rest target + +def checkPopList (s : Nat) : List (Nat × Nat) → Bool + | [] => true + | (seg, s_comb) :: rest => + eqLB (segBits seg ++ stateBits s) (stateBits s_comb) && + checkPopList s rest + +theorem lookupPop_sound {s seg s_comb : Nat} {pops : List (Nat × Nat)} + (hc : checkPopList s pops = true) (hl : lookupPop pops seg = some s_comb) : + segBits seg ++ stateBits s = stateBits s_comb := by + induction pops with + | nil => simp [lookupPop] at hl + | cons hd tl ih => + obtain ⟨seg', s_comb'⟩ := hd + simp only [checkPopList, Bool.and_eq_true, eqLB_iff] at hc + simp only [lookupPop] at hl + split at hl + · rename_i heq + simp only [beq_iff_eq] at heq + simp only [Option.some.injEq] at hl + subst heq; subst hl + exact hc.1 + · exact ih hc.2 hl + +def checkCAct (s : Nat) : CAct → Bool + | .push seg s_rem => + decide (seg < 14) && eqLB (stateBits s) (segBits seg ++ stateBits s_rem) + | .mac k s_end => + eqOptLB (suffixIter k (stateBits s)) (stateBits s_end) + | .popExit pops w_exit => + checkPopList s pops && + match w_exit with + | some w => eqLB (false :: ([true, true, false] ++ stateBits s)) (fbBits w) + | none => true + | .none => true + +def validCAct (s : Nat) : Bool := checkCAct s (cActTable.get s .none) + +def checkFbAct (w : Nat) : FbAct → Bool + | .fb dn true s_out => + eqOptPair (evStep (2, fbBits w)) (2 + dn) (false :: ([true, true, false] ++ stateBits s_out)) + | .fb dn false w_out => + eqOptPair (evStep (2, fbBits w)) (2 + dn) (fbBits w_out) + | .none => true + +def validFbAct (w : Nat) : Bool := checkFbAct w (fbActTable.get w .none) + +theorem validCSeg_all : (List.range 14).all (fun i => M23.checkCSeg (segBits i)) = true := by decide +kernel + +theorem validCSeg_of_lt {i : Nat} (h : i < 14) : M23.ValidCSeg (segBits i) := by + have hall := validCSeg_all + rw [List.all_eq_true] at hall + exact M23.checkCSeg_sound (hall i (List.mem_range.mpr h)) + +theorem validCAct_0 : (List.range 53).all validCAct = true := by decide +kernel +theorem validCAct_1 : (List.range 53).all (fun i => validCAct (i + 53)) = true := by decide +kernel +theorem validCAct_2 : (List.range 53).all (fun i => validCAct (i + 106)) = true := by decide +kernel + +theorem validCAct_of_lt {s : Nat} (h : s < 159) : validCAct s = true := by + by_cases h1 : s < 53 + · have hall := validCAct_0; rw [List.all_eq_true] at hall + exact hall s (List.mem_range.mpr h1) + · by_cases h2 : s < 106 + · have hall := validCAct_1; rw [List.all_eq_true] at hall + have := hall (s - 53) (List.mem_range.mpr (by omega)) + rwa [Nat.sub_add_cancel (by omega)] at this + · have hall := validCAct_2; rw [List.all_eq_true] at hall + have := hall (s - 106) (List.mem_range.mpr (by omega)) + rwa [Nat.sub_add_cancel (by omega)] at this + +theorem validFbAct_all : (List.range 27).all validFbAct = true := by decide +kernel + +theorem validFbAct_of_lt {w : Nat} (h : w < 27) : validFbAct w = true := by + have hall := validFbAct_all + rw [List.all_eq_true] at hall + exact hall w (List.mem_range.mpr h) + +inductive PdaCfg where + | cmode (n : Nat) (segs : List Nat) (s : Nat) + | fmode (n : Nat) (w : Nat) + deriving DecidableEq, Repr + +def evalSegs : List Nat → List Bool + | [] => [true, true, false] + | seg :: rest => evalSegs rest ++ segBits seg + +def wfSegs : List Nat → Prop + | [] => True + | seg :: rest => seg < 14 ∧ wfSegs rest + +theorem wfSegs_valid {segs : List Nat} (h : wfSegs segs) : M23.ValidCPrefix (evalSegs segs) := by + induction segs with + | nil => exact M23.validCPrefix_base + | cons seg rest ih => + exact M23.validCPrefix_append (ih h.2) (validCSeg_of_lt h.1) + +def wfCfg : PdaCfg → Prop + | .cmode _ segs _ => wfSegs segs + | .fmode _ _ => True + +def toPair : PdaCfg → Nat × List Bool + | .cmode n segs s => (n, false :: (evalSegs segs ++ stateBits s)) + | .fmode n w => (n, fbBits w) + +def applyCAct (n : Nat) (segs : List Nat) : CAct → Option PdaCfg + | .push seg s_rem => some (.cmode n (seg :: segs) s_rem) + | .mac k s_end => + if 2 ≤ n then sNat (n + 2 * k) fun n' => some (.cmode n' segs s_end) + else none + | .popExit pops w_exit => + match segs with + | [] => + match w_exit with + | some w => some (.fmode n w) + | none => none + | seg :: rest => + match lookupPop pops seg with + | some s_comb => some (.cmode n rest s_comb) + | none => none + | .none => none + +def applyFbAct (n : Nat) : FbAct → Option PdaCfg + | .fb dn true s_out => + if 2 ≤ n then sNat (n + dn) fun n' => some (.cmode n' [] s_out) + else none + | .fb dn false w_out => + if 2 ≤ n then sNat (n + dn) fun n' => some (.fmode n' w_out) + else none + | .none => none + +def pdaStep : PdaCfg → Option PdaCfg + | .cmode n segs s => + if s < 159 then applyCAct n segs (cActTable.get s .none) else none + | .fmode n w => + if w < 27 then applyFbAct n (fbActTable.get w .none) else none + +theorem pdaStep_sound {c c' : PdaCfg} (hwf : wfCfg c) (h : pdaStep c = some c') : + wfCfg c' ∧ ∃ m, eqvC (run M m (ck (toPair c).1 (toPair c).2)) (ck (toPair c').1 (toPair c').2) := by + cases c with + | cmode n segs s => + simp only [pdaStep] at h + split at h + · rename_i hs + have hv := validCAct_of_lt hs + unfold validCAct at hv + generalize cActTable.get s .none = act at h hv + cases act with + | push seg s_rem => + simp only [applyCAct, checkCAct, Bool.and_eq_true, decide_eq_true_eq, eqLB_iff, Option.some.injEq] at hv h + subst h + refine ⟨⟨hv.1, hwf⟩, 0, ?_⟩ + simp only [toPair, evalSegs, List.append_assoc, ← hv.2, run] + exact eqvC_refl _ + | mac k s_end => + simp only [applyCAct, checkCAct, eqOptLB_iff] at hv h + split at h + · rename_i hn + rw [sNat_eq] at h + simp only [Option.some.injEq] at h + subst h + refine ⟨hwf, ?_⟩ + exact suffixIter_sound k (wfSegs_valid hwf) n hn hv + · cases h + | popExit pops w_exit => + simp only [applyCAct, checkCAct, Bool.and_eq_true] at hv h + cases segs with + | nil => + cases w_exit with + | none => cases h + | some w => + simp only [eqLB_iff, Option.some.injEq] at hv h + subst h + refine ⟨trivial, 0, ?_⟩ + simp only [toPair, evalSegs, hv.2, run] + exact eqvC_refl _ + | cons seg rest => + simp only at h + split at h + · rename_i s_comb hl + simp only [Option.some.injEq] at h + subst h + have heq := lookupPop_sound hv.1 hl + refine ⟨hwf.2, 0, ?_⟩ + simp only [toPair, evalSegs, List.append_assoc, heq, run] + exact eqvC_refl _ + · cases h + | none => cases h + · cases h + | fmode n w => + simp only [pdaStep] at h + split at h + · rename_i hw + have hv := validFbAct_of_lt hw + unfold validFbAct at hv + generalize fbActTable.get w .none = act at h hv + cases act with + | fb dn is_c out_id => + cases is_c + · simp only [applyFbAct, checkFbAct, eqOptPair_iff] at hv h + split at h + · rename_i hn + rw [sNat_eq] at h + simp only [Option.some.injEq] at h + subst h + refine ⟨trivial, ?_⟩ + have hsh := evStep_shift (n - 2) hv + rw [show 2 + (n - 2) = n by omega, show 2 + dn + (n - 2) = n + dn by omega] at hsh + exact evStep_sound hsh + · cases h + · simp only [applyFbAct, checkFbAct, eqOptPair_iff] at hv h + split at h + · rename_i hn + rw [sNat_eq] at h + simp only [Option.some.injEq] at h + subst h + refine ⟨trivial, ?_⟩ + have hsh := evStep_shift (n - 2) hv + rw [show 2 + (n - 2) = n by omega, show 2 + dn + (n - 2) = n + dn by omega] at hsh + exact evStep_sound hsh + · cases h + | none => cases h + · cases h + +def pdaIter : Nat → PdaCfg → Option PdaCfg + | 0, c => some c + | k + 1, c => (pdaStep c).bind (pdaIter k) + +theorem pdaIter_sound (k : Nat) : ∀ {c c' : PdaCfg}, wfCfg c → pdaIter k c = some c' → + ∃ m, eqvC (run M m (ck (toPair c).1 (toPair c).2)) (ck (toPair c').1 (toPair c').2) := by + induction k with + | zero => + intro c c' _ h + simp only [pdaIter, Option.some.injEq] at h + subst h + exact ⟨0, eqvC_refl _⟩ + | succ k ih => + intro c c' hwf h + simp only [pdaIter, Option.bind_eq_some_iff] at h + obtain ⟨c1, h1, h2⟩ := h + obtain ⟨hwf1, m1, e1⟩ := pdaStep_sound hwf h1 + obtain ⟨m2, e2⟩ := ih hwf1 h2 + exact ⟨m1 + m2, by rw [run_add]; exact eqvC_trans (run_eqvC M m2 e1) e2⟩ + + +def cp_0 : Nat × List Bool := (3, [false, false, true, true, false, true, true, true, false, true]) +def cp_15 : Nat × List Bool := (111101, [false, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, true, true, false, true, true, false, true, true, true, false, true, true, false, true, true, false, true, true, false, true, true, false, true, false, true, true, false, true, true, true, false, true]) + +theorem pda_A_all : pdaIter 13274 (.fmode 5 0) = some (.cmode 111103 [] 158) := by + decide +kernel + +theorem toPair_start_A : toPair (.fmode 5 0) = (cp_0.1 + 2, cp_0.2) := by decide +kernel +theorem toPair_end_A : toPair (.cmode 111103 [] 158) = (cp_15.1 + 2, cp_15.2) := by decide +kernel + +theorem reach_A_all : ∃ m, eqvC (run M m (ck (cp_0.1 + 2) cp_0.2)) (ck (cp_15.1 + 2) cp_15.2) := by + have hwf : wfCfg (.fmode 5 0) := trivial + have h := pdaIter_sound 13274 hwf pda_A_all + rwa [toPair_start_A, toPair_end_A] at h + +theorem rrun_U_1552 : rstep (rstep (rstep 1552 false) true) true = 1552 := by + decide +kernel + +theorem rrun_pw_U (k : Nat) (R : List Bool) (hR : rrun R = 1552) : + rrun (M23.pw k M23.U ++ R) = 1552 := by + induction k with + | zero => exact hR + | succ k ih => + rw [M23.pw_succ] + change rstep (rstep (rstep (rrun (M23.pw k M23.U ++ R)) false) true) true = 1552 + rw [ih] + exact rrun_U_1552 + +theorem rrun_base_8 : rrun (M23.pw 8 M23.U ++ cp_15.2) = 1552 := by + decide +kernel + +theorem inMid_seed : inMid 0 2 false 1552 = true := by + decide +kernel + +theorem Inv_ck_cp15 (k : Nat) : Inv (ck (k + 8) cp_15.2) := by + unfold Inv ck + simp only [lrun] + rw [M23.pw_add k 8 M23.U, List.append_assoc, rrun_pw_U k _ rrun_base_8] + exact inMid_seed + +theorem eqvC_symm {c d : Cfg} (h : eqvC c d) : eqvC d c := + ⟨h.1.symm, h.2.1.symm, h.2.2.1.symm, h.2.2.2.symm⟩ + +theorem init_A_eqv : eqvC (run M 247 (blank 0)) (ck (cp_0.1 + 2) cp_0.2) := by + decide +kernel + +theorem startA_inv : ∃ m, Inv (run M m (blank 0)) := by + obtain ⟨m, hm⟩ := reach_A_all + refine ⟨247 + m, ?_⟩ + rw [run_add] + have he := eqvC_trans (run_eqvC M m init_A_eqv) hm + exact Inv_of_eqvC (eqvC_symm he) (Inv_ck_cp15 111095) + +theorem nonhalt_A : ∀ n, ¬ halted M (run M n (blank 0)) := + nonhalt_of_start startA_inv + +end Cert + +variable {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +abbrev holdout_0084_tm : Machine (Fin 2) (Fin 6) := target_tm +set_option maxRecDepth 200000 +set_option maxHeartbeats 4000000 +def b2f : Bool → Fin 2 + | false => 0 + | true => 1 +def toLB : List Bool → ListBlank (Fin 2) + | [] => default + | b :: xs => ListBlank.cons (b2f b) (toLB xs) +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl +theorem toLB_head (L : List Bool) : (toLB L).head = b2f (L.headD false) := by + cases L with + | nil => rfl + | cons b xs => simp [toLB] +theorem toLB_tail (L : List Bool) : (toLB L).tail = toLB L.tail := by + cases L with + | nil => rfl + | cons b xs => simp [toLB] +def toBBCfg (c : Cert.Cfg) (hq : c.q < 6) : Cfg (Fin 2) (Fin 6) := + ⟨some ⟨c.q, hq⟩, ⟨b2f c.h, toLB c.L, toLB c.R⟩⟩ +theorem step_bridge (c : Cert.Cfg) (hq : c.q < 6) (hnh : ¬ Cert.halted Cert.M c) : + ∃ (hq' : (Cert.step Cert.M c).q < 6), + step holdout_0084_tm (toBBCfg c hq) = some (toBBCfg (Cert.step Cert.M c) hq') := by + obtain ⟨q, L, h, R⟩ := c + rcases q with _ | _ | _ | _ | _ | _ | q + · cases h <;> exact ⟨by simp [Cert.step, Cert.M]; try decide, by simp [toBBCfg, Cert.step, Cert.M, step, holdout_0084_tm, target_tm, Tape.write, Tape.move, toLB, toLB_head, toLB_tail, b2f]⟩ + · cases h <;> exact ⟨by simp [Cert.step, Cert.M]; try decide, by simp [toBBCfg, Cert.step, Cert.M, step, holdout_0084_tm, target_tm, Tape.write, Tape.move, toLB, toLB_head, toLB_tail, b2f]⟩ + · cases h <;> exact ⟨by simp [Cert.step, Cert.M]; try decide, by simp [toBBCfg, Cert.step, Cert.M, step, holdout_0084_tm, target_tm, Tape.write, Tape.move, toLB, toLB_head, toLB_tail, b2f]⟩ + · cases h <;> exact ⟨by simp [Cert.step, Cert.M]; try decide, by simp [toBBCfg, Cert.step, Cert.M, step, holdout_0084_tm, target_tm, Tape.write, Tape.move, toLB, toLB_head, toLB_tail, b2f]⟩ + · cases h + · exact False.elim (hnh rfl) + · exact ⟨by simp [Cert.step, Cert.M]; try decide, by simp [toBBCfg, Cert.step, Cert.M, step, holdout_0084_tm, target_tm, Tape.write, Tape.move, toLB, toLB_head, toLB_tail, b2f]⟩ + · cases h <;> exact ⟨by simp [Cert.step, Cert.M]; try decide, by simp [toBBCfg, Cert.step, Cert.M, step, holdout_0084_tm, target_tm, Tape.write, Tape.move, toLB, toLB_head, toLB_tail, b2f]⟩ + · change q + 6 < 6 at hq; omega +theorem multiStep_bridge (n : Nat) : + ∃ (hq : (Cert.run Cert.M n (Cert.blank 0)).q < 6), + multiStep holdout_0084_tm (init []) n = some (toBBCfg (Cert.run Cert.M n (Cert.blank 0)) hq) := by + induction n with + | zero => exact ⟨by decide, rfl⟩ + | succ n ih => + obtain ⟨hq, hn⟩ := ih + obtain ⟨hq', hst⟩ := step_bridge (Cert.run Cert.M n (Cert.blank 0)) hq (Cert.nonhalt_A n) + rw [show Cert.run Cert.M (n + 1) (Cert.blank 0) = Cert.step Cert.M (Cert.run Cert.M n (Cert.blank 0)) from by rw [Cert.run_add]; rfl] + refine ⟨hq', ?_⟩ + rw [multiStep_succ', hn, Option.bind_some, hst] +theorem holdout_0084_nonhalt : + IsDoesNotHalt holdout_0084_tm := by + intro cfg ⟨n, hn⟩ + obtain ⟨hq, hms⟩ := multiStep_bridge n + rw [hms, Option.some.injEq] at hn + subst hn + obtain ⟨hq', hst⟩ := step_bridge (Cert.run Cert.M n (Cert.blank 0)) hq (Cert.nonhalt_A n) + rw [hst] + rfl + + + +theorem is_does_not_halt : IsNotHalt target_tm := holdout_0084_nonhalt + +public section + +theorem is_not_halt : IsNotHalt target := by rw [target_eq]; exact is_does_not_halt + +end + +end BusyBeaver.M_1RB1RC_1LC0RF_1RE0LD_1LB0LD_HHH1RF_0LF0RA diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RC_1LC1RE_HHH1LD_0LE0LD_1RA0RF_1LD1RB.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RC_1LC1RE_HHH1LD_0LE0LD_1RA0RF_1LD1RB.lean new file mode 100644 index 00000000..e446cb5d --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RC_1LC1RE_HHH1LD_0LE0LD_1RA0RF_1LD1RB.lean @@ -0,0 +1,2074 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1RC_1LC1RE_HHH1LD_0LE0LD_1RA0RF_1LD1RB + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RC_1LC1RE_HHH1LD_0LE0LD_1RA0RF_1LD1RB" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {zG_ zL_ α β γ : Type*} [Inhabited zG_] [Inhabited zL_] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +-- ============================================================================ +-- Section 2: Turing Machine Infrastructure & Notations +-- ============================================================================ + + +/- A Turing machine statement writing a symbol and moving in direction `dir`. -/ +-- ============================================================================ +-- Section 5: Specific Turing Machine: holdout_0779 +-- ============================================================================ +/- Transition function for holdout_0779: `1RB1RC_1LC1RE_---1LD_0LE0LD_1RA0RF_1LD1RB` -/ + +-- ============================================================================ +-- Section 6: Step & Execution Infrastructure +-- ============================================================================ + +set_option maxHeartbeats 8000000 +set_option maxRecDepth 4000000 + +open Counter + +local infixr:60 " ⋙ " => stepPlus_trans + +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail]) +macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step))) +macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +@[simp] theorem append_nil_lb (s : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> s = s := rfl +@[simp] theorem cons_append_lb (a : Fin 2) (l : List (Fin 2)) (s : ListBlank (Fin 2)) : + (a :: l) +> s = a >> (l +> s) := rfl + +theorem append_assoc_lb (l₁ l₂ : List (Fin 2)) (s : ListBlank (Fin 2)) : + (l₁ ++ l₂) +> s = l₁ +> (l₂ +> s) := by + induction l₁ with + | nil => rfl + | cons a l₁ ih => simp [ih] + +@[simp] theorem pow_zero_list (w : List (Fin 2)) : w ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (w : List (Fin 2)) (n : Nat) : w ^ (n + 1) = w ++ w ^ n := rfl + +theorem pow_add_list (w : List (Fin 2)) (m n : Nat) : + w ^ (m + n) = w ^ m ++ w ^ n := by + induction m with + | zero => simp [Nat.zero_add] + | succ m ih => + have h1 : m + 1 + n = (m + n) + 1 := by omega + rw [h1, pow_succ_list, pow_succ_list, ih, List.append_assoc] + +theorem pow_succ_right_lb (w : List (Fin 2)) (a : Nat) (r : ListBlank (Fin 2)) : + (w ^ a) +> (w +> r) = (w ^ (a + 1)) +> r := by + have h1 : w +> r = (w ^ 1) +> r := by simp [pow_succ_list] + rw [h1, ← append_assoc_lb, ← pow_add_list, Nat.add_comm a 1] + +-- ============================================================================ +-- Section 7: Pair7Ternary (SOCMisc.v lines 6690-6777) +-- ============================================================================ + +abbrev e0 : List (Fin 2) := [0, 0, 0] +abbrev e1 : List (Fin 2) := [1, 1, 0] +abbrev e2 : List (Fin 2) := [0, 1, 0] +abbrev w111 : List (Fin 2) := [1, 1, 1] +abbrev w011 : List (Fin 2) := [0, 1, 1] + +inductive TC (tail : ListBlank (Fin 2)) : Nat → Nat → ListBlank (Fin 2) → Prop + | nil : TC tail 0 0 tail + | d0 (h v : Nat) (r : ListBlank (Fin 2)) : TC tail h v r → TC tail (h + 1) (v * 3) (e0 +> r) + | d1 (h v : Nat) (r : ListBlank (Fin 2)) : TC tail h v r → TC tail (h + 1) (1 + v * 3) (e1 +> r) + | d2 (h v : Nat) (r : ListBlank (Fin 2)) : TC tail h v r → TC tail (h + 1) (2 + v * 3) (e2 +> r) + +theorem TC_bound {tail : ListBlank (Fin 2)} {h v : Nat} {r : ListBlank (Fin 2)} + (H : TC tail h v r) : v < 3 ^ h := by + induction H with + | nil => decide + | d0 h v r _ ih => rw [Nat.pow_succ]; omega + | d1 h v r _ ih => rw [Nat.pow_succ]; omega + | d2 h v r _ ih => rw [Nat.pow_succ]; omega + +theorem TC_unique_aux {tail : ListBlank (Fin 2)} {h h' v v' : Nat} {r s : ListBlank (Fin 2)} + (H1 : TC tail h v r) (H2 : TC tail h' v' s) (hh : h = h') (hv : v = v') : r = s := by + induction H1 generalizing h' v' s with + | nil => cases H2 <;> first | rfl | omega + | d0 h v r _ ih => + cases H2 with + | d0 h' v' s h2 => exact congrArg (e0 +> ·) (ih h2 (by omega) (by omega)) + | _ => omega + | d1 h v r _ ih => + cases H2 with + | d1 h' v' s h2 => exact congrArg (e1 +> ·) (ih h2 (by omega) (by omega)) + | _ => omega + | d2 h v r _ ih => + cases H2 with + | d2 h' v' s h2 => exact congrArg (e2 +> ·) (ih h2 (by omega) (by omega)) + | _ => omega + +theorem TC_unique {tail : ListBlank (Fin 2)} {h v : Nat} {r s : ListBlank (Fin 2)} + (H1 : TC tail h v r) (H2 : TC tail h v s) : r = s := + TC_unique_aux H1 H2 rfl rfl + +theorem TC_zero (tail : ListBlank (Fin 2)) (h : Nat) : TC tail h 0 ((e0 ^ h) +> tail) := by + induction h with + | zero => exact TC.nil + | succ h ih => + rw [pow_succ_list, append_assoc_lb] + exact TC.d0 h 0 ((e0 ^ h) +> tail) ih + +theorem pow_pos (b i : Nat) (hb : 0 < b) : 0 < b ^ i := by + induction i with + | zero => simp + | succ i ih => rw [Nat.pow_succ]; exact Nat.mul_pos ih hb + +theorem pow_mono (b i j : Nat) (hb : 0 < b) (hij : i ≤ j) : b ^ i ≤ b ^ j := + Nat.pow_le_pow_right hb hij + +theorem TC_full (tail : ListBlank (Fin 2)) (h : Nat) : TC tail h (3 ^ h - 1) ((e2 ^ h) +> tail) := by + induction h with + | zero => exact TC.nil + | succ h ih => + rw [pow_succ_list, append_assoc_lb] + have hp : 0 < 3 ^ h := pow_pos 3 h (by decide) + have heq : 3 ^ (h + 1) - 1 = 2 + (3 ^ h - 1) * 3 := by rw [Nat.pow_succ]; omega + rw [heq] + exact TC.d2 h (3 ^ h - 1) ((e2 ^ h) +> tail) ih + +theorem TC_zero_unique {tail : ListBlank (Fin 2)} {h : Nat} {r : ListBlank (Fin 2)} + (H : TC tail h 0 r) : r = (e0 ^ h) +> tail := + TC_unique H (TC_zero tail h) + +theorem TC_full_unique {tail : ListBlank (Fin 2)} {h : Nat} {r : ListBlank (Fin 2)} + (H : TC tail h (3 ^ h - 1) r) : r = (e2 ^ h) +> tail := + TC_unique H (TC_full tail h) + +theorem TC_carry {tail : ListBlank (Fin 2)} {h v : Nat} {r : ListBlank (Fin 2)} + (H : TC tail h v r) (Hb : v + 1 < 3 ^ h) : + ∃ j b q s, h = j + (b + 1) ∧ TC tail b q s ∧ + ((r = (e2 ^ j) +> (e0 +> s) ∧ TC tail h (v + 1) ((e0 ^ j) +> (e1 +> s))) ∨ + (r = (e2 ^ j) +> (e1 +> s) ∧ TC tail h (v + 1) ((e0 ^ j) +> (e2 +> s)))) := by + induction H with + | nil => simp at Hb + | d0 h v r htc _ => + refine ⟨0, h, v, r, by omega, htc, Or.inl ⟨rfl, ?_⟩⟩ + have heq : v * 3 + 1 = 1 + v * 3 := by omega + rw [heq]; exact TC.d1 h v r htc + | d1 h v r htc _ => + refine ⟨0, h, v, r, by omega, htc, Or.inr ⟨rfl, ?_⟩⟩ + have heq : (1 + v * 3) + 1 = 2 + v * 3 := by omega + rw [heq]; exact TC.d2 h v r htc + | d2 h v r htc ih => + have hv : v + 1 < 3 ^ h := by rw [Nat.pow_succ] at Hb; omega + rcases ih hv with ⟨j, b, q, s, hh, hs, ⟨hr, hn⟩ | ⟨hr, hn⟩⟩ + · refine ⟨j + 1, b, q, s, by omega, hs, Or.inl ⟨?_, ?_⟩⟩ + · rw [pow_succ_list, append_assoc_lb, hr] + · rw [pow_succ_list, append_assoc_lb] + have heq : (2 + v * 3) + 1 = (v + 1) * 3 := by omega + rw [heq]; exact TC.d0 h (v + 1) _ hn + · refine ⟨j + 1, b, q, s, by omega, hs, Or.inr ⟨?_, ?_⟩⟩ + · rw [pow_succ_list, append_assoc_lb, hr] + · rw [pow_succ_list, append_assoc_lb] + have heq : (2 + v * 3) + 1 = (v + 1) * 3 := by omega + rw [heq]; exact TC.d0 h (v + 1) _ hn + +theorem TC_positive {tail : ListBlank (Fin 2)} {h v : Nat} {r : ListBlank (Fin 2)} + (H : TC tail h v r) (Hv : 0 < v) : + ∃ j b q s, h = j + (b + 1) ∧ TC tail b q s ∧ + ((r = (e0 ^ j) +> (e1 +> s) ∧ v = 3 ^ j * (1 + q * 3)) ∨ + (r = (e0 ^ j) +> (e2 +> s) ∧ v = 3 ^ j * (2 + q * 3))) := by + induction H with + | nil => omega + | d0 h v r htc ih => + have hp : 0 < v := by omega + rcases ih hp with ⟨j, b, q, s, hh, hs, ⟨hr, hv⟩ | ⟨hr, hv⟩⟩ + · refine ⟨j + 1, b, q, s, by omega, hs, Or.inl ⟨?_, ?_⟩⟩ + · rw [pow_succ_list, append_assoc_lb, hr] + · rw [hv, Nat.pow_succ]; ring + · refine ⟨j + 1, b, q, s, by omega, hs, Or.inr ⟨?_, ?_⟩⟩ + · rw [pow_succ_list, append_assoc_lb, hr] + · rw [hv, Nat.pow_succ]; ring + | d1 h v r htc _ => + exact ⟨0, h, v, r, by omega, htc, Or.inl ⟨rfl, by simp⟩⟩ + | d2 h v r htc _ => + exact ⟨0, h, v, r, by omega, htc, Or.inr ⟨rfl, by simp⟩⟩ + +-- ============================================================================ +-- Section 8: Pair7Bounds (SOCMisc.v lines 6780-6918) +-- ============================================================================ + +theorem pow6 (i : Nat) : 6 ^ i = 2 ^ i * 3 ^ i := by + induction i with + | zero => rfl + | succ i ih => rw [Nat.pow_succ, Nat.pow_succ, Nat.pow_succ, ih]; ring + +theorem deficit_next (A i a d d' : Nat) (ha : a ≤ i) + (hd : d + 1 ≤ 2 ^ i * A + 2 * 6 ^ i) (hstep : d' ≤ 2 * d + 8 * 6 ^ a + 1) : + d' + 1 ≤ 2 ^ (1 + i) * A + 2 * 6 ^ (1 + i) := by + have h6a : 6 ^ a ≤ 6 ^ i := pow_mono 6 a i (by decide) ha + have h2 : 2 ^ (1 + i) * A = 2 * (2 ^ i * A) := by rw [Nat.add_comm 1 i, Nat.pow_succ]; ring + have h6 : 6 ^ (1 + i) = 6 * 6 ^ i := by rw [Nat.add_comm 1 i, Nat.pow_succ]; ring + (try omega) +theorem deficit_guard (C A i k d : Nat) + (hsum : k + d = C * 2 ^ i) (hd : d + 1 ≤ 2 ^ i * A + 2 * 6 ^ i) (hC : A + 6 * 3 ^ i ≤ C) : + 4 * 6 ^ i < k := by + have h1 : 2 ^ i * (A + 6 * 3 ^ i) ≤ 2 ^ i * C := Nat.mul_le_mul_left (2 ^ i) hC + have h2 : 2 ^ i * (A + 6 * 3 ^ i) = 2 ^ i * A + 6 * 6 ^ i := by rw [pow6]; ring + have h3 : C * 2 ^ i = 2 ^ i * C := Nat.mul_comm C (2 ^ i) + (try omega) +theorem deficit3_budget (C h i : Nat) (hi : i ≤ h) (hC : 3 * 3 ^ h ≤ C) : + 2 + 6 * 3 ^ i ≤ 4 * C := by + have h1 := pow_mono 3 i h (by decide) hi + have h2 := pow_pos 3 i (by decide) + (try omega) +theorem deficit26_budget (C j t A : Nat) (hC : 3 * 3 ^ (j + 1 + t) ≤ C) (hA : A + 6 ≤ 36 * 3 ^ j) : + A + 6 * 3 ^ t ≤ 4 * C := by + cases t with + | zero => + have h1 : 3 * 3 ^ (j + 1 + 0) = 9 * 3 ^ j := by + rw [Nat.add_zero, Nat.pow_succ]; ring + simp at * + (try omega) + | succ t => + have h1 : 3 * 3 ^ (j + 1 + (t + 1)) = 9 * (3 ^ j * 3 ^ (t + 1)) := by + rw [Nat.pow_add, Nat.pow_add, Nat.pow_one]; ring + have h2 : 3 ≤ 3 ^ (t + 1) := by + have := pow_pos 3 t (by decide) + rw [Nat.pow_succ]; omega + have h3 : 1 ≤ 3 ^ j := pow_pos 3 j (by decide) + have h4 : 3 ^ j * 3 ≤ 3 ^ j * 3 ^ (t + 1) := Nat.mul_le_mul_left (3 ^ j) h2 + have h5 : 1 * 3 ^ (t + 1) ≤ 3 ^ j * 3 ^ (t + 1) := Nat.mul_le_mul_right (3 ^ (t + 1)) h3 + (try omega) +theorem deficit26_budget_scaled (C j t q A : Nat) + (hq : q ≤ t) (hC : 3 * 3 ^ (j + 1 + t) ≤ C) (hA : A + 6 ≤ 36 * 3 ^ j) : + 2 ^ (j + 1) * A + 6 * 3 ^ q ≤ 2 ^ (j + 1) * (4 * C) := by + have h1 := deficit26_budget C j t A hC hA + have h2 := pow_mono 3 q t (by decide) hq + have h3 : 1 ≤ 2 ^ (j + 1) := pow_pos 2 (j + 1) (by decide) + have h4 : 1 * (6 * 3 ^ q) ≤ 2 ^ (j + 1) * (6 * 3 ^ t) := Nat.mul_le_mul h3 (by omega) + have h5 : 2 ^ (j + 1) * (A + 6 * 3 ^ t) ≤ 2 ^ (j + 1) * (4 * C) := Nat.mul_le_mul_left _ h1 + have h6 : 2 ^ (j + 1) * (A + 6 * 3 ^ t) = 2 ^ (j + 1) * A + 2 ^ (j + 1) * (6 * 3 ^ t) := by ring + (try omega) +theorem zeros_next (i b d : Nat) (h : d + 2 ^ i * b = 12 * 6 ^ i) : + (2 * d + 8 * 6 ^ (1 + i)) + 2 ^ (1 + i) * b = 12 * 6 ^ (1 + i) := by + have h2 : 2 ^ (1 + i) * b = 2 * (2 ^ i * b) := by rw [Nat.add_comm 1 i, Nat.pow_succ]; ring + have h6 : 6 ^ (1 + i) = 6 * 6 ^ i := by rw [Nat.add_comm 1 i, Nat.pow_succ]; ring + (try omega) +theorem zeros_guard (C h i b k d : Nat) + (hi : i < h) (hC : 3 * 3 ^ h ≤ C) (hb : 0 < b) + (hsum : k + d = 4 * C * 2 ^ i) (hd : d + 2 ^ i * b = 12 * 6 ^ i) : + 4 * 6 ^ (1 + i) < k := by + have h1 : 3 ^ (1 + i) ≤ 3 ^ h := pow_mono 3 (1 + i) h (by decide) (by omega) + have h2 : 3 ^ (1 + i) = 3 * 3 ^ i := by rw [Nat.add_comm 1 i, Nat.pow_succ]; ring + have h3 : 2 ^ i * (9 * 3 ^ i) ≤ 2 ^ i * C := Nat.mul_le_mul_left (2 ^ i) (by omega) + have h4 : 2 ^ i * (9 * 3 ^ i) = 9 * 6 ^ i := by rw [pow6]; ring + have h5 : 4 * C * 2 ^ i = 4 * (2 ^ i * C) := by ring + have h6 : 4 * 6 ^ (1 + i) = 24 * 6 ^ i := by rw [Nat.add_comm 1 i, Nat.pow_succ]; ring + have h7 : 1 ≤ 2 ^ i := pow_pos 2 i (by decide) + have h8 : 1 * 1 ≤ 2 ^ i * b := Nat.mul_le_mul h7 hb + (try omega) +theorem zeros_end (C h b k d : Nat) + (hC : 3 * 3 ^ h ≤ C) (hsum : k + d = 4 * C * 2 ^ h) (hd : d + 2 ^ h * b = 12 * 6 ^ h) : + 2 ^ h * b ≤ k := by + have h1 : 2 ^ h * (3 * 3 ^ h) ≤ 2 ^ h * C := Nat.mul_le_mul_left (2 ^ h) hC + have h2 : 2 ^ h * (3 * 3 ^ h) = 3 * 6 ^ h := by rw [pow6]; ring + have h3 : 4 * C * 2 ^ h = 4 * (2 ^ h * C) := by ring + (try omega) +theorem pow2_mod3 (n : Nat) : 2 ^ n % 3 = 1 ∨ 2 ^ n % 3 = 2 := by + induction n with + | zero => exact Or.inl rfl + | succ n ih => + rw [Nat.pow_succ] + (try omega) +theorem pow2_remainder (n : Nat) : ∃ q, 2 ^ n = 1 + q * 3 ∨ 2 ^ n = 2 + q * 3 := by + rcases pow2_mod3 n with h | h <;> refine ⟨2 ^ n / 3, ?_⟩ <;> omega + +theorem hard0_remainder (n h : Nat) (hlo : 6 * 3 ^ h + 1 ≤ 2 ^ n) (hhi : 2 ^ n + 2 < 9 * 3 ^ h) : + ∃ q, (2 ^ n + 1 - 6 * 3 ^ h = q * 3 ∧ 1 ≤ q ∧ q < 3 ^ h) ∨ + (2 ^ n + 1 - 6 * 3 ^ h = 2 + q * 3 ∧ 1 + q < 3 ^ h) := by + rcases pow2_remainder n with ⟨t, ht | ht⟩ + · exact ⟨t - 2 * 3 ^ h, Or.inr ⟨by omega, by omega⟩⟩ + · exact ⟨1 + t - 2 * 3 ^ h, Or.inl ⟨by omega, by omega, by omega⟩⟩ + +theorem hard2_remainder (n h : Nat) (hlo : 6 * 3 ^ h ≤ 2 ^ n) (hhi : 2 ^ n + 1 < 9 * 3 ^ h) : + ∃ q, (2 ^ n - 6 * 3 ^ h = 1 + q * 3 ∧ q < 3 ^ h) ∨ + (2 ^ n - 6 * 3 ^ h = 2 + q * 3 ∧ 1 + q < 3 ^ h) := by + rcases pow2_remainder n with ⟨t, ht | ht⟩ + · exact ⟨t - 2 * 3 ^ h, Or.inl ⟨by omega, by omega⟩⟩ + · exact ⟨t - 2 * 3 ^ h, Or.inr ⟨by omega, by omega⟩⟩ + +theorem normal_budget (a u : Nat) : 4 * 6 ^ a < 2 ^ a * (1 + u * 2) ↔ 2 * 3 ^ a ≤ u := by + have h1 : 4 * 6 ^ a = 2 ^ a * (4 * 3 ^ a) := by rw [pow6]; ring + have h2 : 0 < 2 ^ a := pow_pos 2 a (by decide) + rw [h1] + constructor + · intro h + have h3 : 4 * 3 ^ a < 1 + u * 2 := (Nat.mul_lt_mul_left h2).mp h + (try omega) + · intro h + refine (Nat.mul_lt_mul_left h2).mpr ?_ + (try omega) +theorem power_exit (m a : Nat) (ha : 1 ≤ a) (hm : 3 ^ a ≤ 2 ^ m) : + 11 ≤ 2 ^ (a + 1) * (2 ^ (m + 1) - 2 * 3 ^ a + 3) - 1 ∧ + 2 ^ (a + 1) * (2 ^ (m + 1) - 2 * 3 ^ a + 3) - 1 ≤ 2 ^ (m + a + 2) - 13 := by + have h2a : 4 ≤ 2 ^ (a + 1) := by + change 2 ^ 2 ≤ 2 ^ (a + 1) + exact pow_mono 2 2 (a + 1) (by decide) (by omega) + have h3a : 3 ≤ 3 ^ a := by + change 3 ^ 1 ≤ 3 ^ a + exact pow_mono 3 1 a (by decide) ha + have hm1 : 2 ^ (m + 1) = 2 * 2 ^ m := by rw [Nat.pow_succ]; ring + have hma : 2 ^ (m + a + 2) = 2 ^ (a + 1) * (2 * 2 ^ m) := by + have heq : m + a + 2 = (a + 1) + (m + 1) := by omega + rw [heq, Nat.pow_add, hm1] + rw [hm1, hma] + set X := 2 ^ (a + 1) + set Y := 2 ^ m + set Z := 3 ^ a + have hsub : 3 ≤ 2 * Y - 2 * Z + 3 := by omega + have hmul1 : 4 * 3 ≤ X * (2 * Y - 2 * Z + 3) := Nat.mul_le_mul h2a hsub + have hmul2 : X * (2 * Y - 2 * Z + 3) + X * (2 * Z - 3) = X * (2 * Y) := by + rw [← Nat.left_distrib] + congr 1; omega + have hmul3 : 4 * 3 ≤ X * (2 * Z - 3) := Nat.mul_le_mul h2a (by omega) + (try omega) +-- ============================================================================ +-- Section 9: TM7 Base Windows & Left Counter LC (SOCMisc.v lines 6920-7118) +-- ============================================================================ + +def LBar (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + (l <{{E}} ([0] +> r)) + +def RBar (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + (([1] +> l) {{B}}> r) + +def QBar (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + RBar l ([1, 1] +> r) + +def outer : ListBlank (Fin 2) := [1] +> default + +theorem R100 (l r : ListBlank (Fin 2)) : + (RBar l ([1, 0, 0] +> r)) [target_tm]⊢⁺ (RBar (w111 +> l) r) := by + unfold RBar w111; simp only [cons_append_lb, append_nil_lb]; execute + +theorem R111 (l r : ListBlank (Fin 2)) : + (RBar l (w111 +> r)) [target_tm]⊢⁺ (RBar (w011 +> l) r) := by + unfold RBar w111 w011; simp only [cons_append_lb, append_nil_lb]; execute + +theorem R110 (l r : ListBlank (Fin 2)) : + (RBar l (e1 +> r)) [target_tm]⊢⁺ (LBar l (w111 +> r)) := by + unfold RBar LBar e1 w111; simp only [cons_append_lb, append_nil_lb]; execute + +theorem R0 (l r : ListBlank (Fin 2)) : + (RBar l ([0] +> r)) [target_tm]⊢⁺ (l <{{D}} ([1, 1] +> r)) := by + unfold RBar; simp only [cons_append_lb, append_nil_lb]; execute + +theorem step_L_111 (l r : ListBlank (Fin 2)) : + (LBar (w111 +> l) r) [target_tm]⊢⁺ (LBar l (w111 +> r)) := by + unfold LBar w111; simp only [cons_append_lb, append_nil_lb]; execute + +theorem sweep_L_111 (a : Nat) (l r : ListBlank (Fin 2)) : + (LBar ((w111 ^ a) +> l) r) [target_tm]⊢* (LBar l ((w111 ^ a) +> r)) := by + induction a generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ a ih => + have h1 : (LBar ((w111 ^ (a + 1)) +> l) r) = (LBar (w111 +> ((w111 ^ a) +> l)) r) := by + rw [pow_succ_list, append_assoc_lb] + rw [h1] + have h2 := stepPlus_stepStar_stepPlus (step_L_111 ((w111 ^ a) +> l) r) (ih l (w111 +> r)) + rw [pow_succ_right_lb] at h2 + exact stepPlus_stepStar h2 + +theorem sweep_R111 (a : Nat) (l r : ListBlank (Fin 2)) : + (RBar l ((w111 ^ a) +> r)) [target_tm]⊢* (RBar ((w011 ^ a) +> l) r) := by + induction a generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ a ih => + have h1 : (RBar l ((w111 ^ (a + 1)) +> r)) = (RBar l (w111 +> ((w111 ^ a) +> r))) := by + rw [pow_succ_list, append_assoc_lb] + rw [h1] + have h2 := stepPlus_stepStar_stepPlus (R111 l ((w111 ^ a) +> r)) (ih (w011 +> l) r) + rw [pow_succ_right_lb] at h2 + exact stepPlus_stepStar h2 + +theorem LInc_base (l r : ListBlank (Fin 2)) : + (LBar (w011 +> l) r) [target_tm]⊢⁺ (RBar (w111 +> l) r) := by + unfold LBar RBar w011 w111; simp only [cons_append_lb, append_nil_lb]; execute + +theorem LInc (l r : ListBlank (Fin 2)) (a : Nat) : + (LBar ((w111 ^ a) +> (w011 +> l)) r) [target_tm]⊢⁺ + (RBar ((w011 ^ a) +> (w111 +> l)) r) := + stepPlus_stepStar_stepPlus + (stepStar_stepPlus_stepPlus (sweep_L_111 a (w011 +> l) r) (LInc_base l ((w111 ^ a) +> r))) + (sweep_R111 a (w111 +> l) r) + +theorem LBlank1_base (r : ListBlank (Fin 2)) : + (LBar outer r) [target_tm]⊢⁺ (RBar outer ([1] +> r)) := by + unfold LBar RBar outer; simp only [cons_append_lb, append_nil_lb]; execute + +theorem LBlank1 (r : ListBlank (Fin 2)) (n : Nat) : + (LBar ((w111 ^ n) +> outer) r) [target_tm]⊢⁺ + (RBar ((w011 ^ n) +> outer) ([1] +> r)) := by + have h2 : ([1] +> ((w111 ^ n) +> r)) = ((w111 ^ n) +> ([1] +> r)) := by + induction n with + | zero => rfl + | succ n ih => + have lhs : ([1] +> ((w111 ^ (n + 1)) +> r)) = (w111 +> ([1] +> ((w111 ^ n) +> r))) := by + rw [pow_succ_list, append_assoc_lb]; rfl + have rhs : ((w111 ^ (n + 1)) +> ([1] +> r)) = (w111 +> ((w111 ^ n) +> ([1] +> r))) := by + rw [pow_succ_list, append_assoc_lb] + rw [lhs, rhs, ih] + have h1 := stepStar_stepPlus_stepPlus (sweep_L_111 n outer r) (LBlank1_base ((w111 ^ n) +> r)) + rw [h2] at h1 + exact stepPlus_stepStar_stepPlus h1 (sweep_R111 n outer ([1] +> r)) + +inductive LC (o : ListBlank (Fin 2)) : Nat → Nat → ListBlank (Fin 2) → Prop + | nil : LC o 0 0 o + | d0 (n k : Nat) (l : ListBlank (Fin 2)) : LC o n k l → LC o (1 + n) (k * 2) (w111 +> l) + | d1 (n k : Nat) (l : ListBlank (Fin 2)) : LC o n k l → LC o (1 + n) (1 + k * 2) (w011 +> l) + +theorem LC_bound {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} + (H : LC o n k l) : k < 2 ^ n := by + induction H with + | nil => decide + | d0 n k l _ ih => rw [Nat.add_comm 1 n, Nat.pow_succ]; omega + | d1 n k l _ ih => rw [Nat.add_comm 1 n, Nat.pow_succ]; omega + +theorem LC_unique_aux {o : ListBlank (Fin 2)} {n n' k k' : Nat} {l l' : ListBlank (Fin 2)} + (H1 : LC o n k l) (H2 : LC o n' k' l') (hn : n = n') (hk : k = k') : l = l' := by + induction H1 generalizing n' k' l' with + | nil => cases H2 <;> first | rfl | omega + | d0 n k l _ ih => + cases H2 with + | d0 n' k' l' h2 => exact congrArg (w111 +> ·) (ih h2 (by omega) (by omega)) + | _ => omega + | d1 n k l _ ih => + cases H2 with + | d1 n' k' l' h2 => exact congrArg (w011 +> ·) (ih h2 (by omega) (by omega)) + | _ => omega + +theorem LC_unique {o : ListBlank (Fin 2)} {n k : Nat} {l l' : ListBlank (Fin 2)} + (H1 : LC o n k l) (H2 : LC o n k l') : l = l' := + LC_unique_aux H1 H2 rfl rfl + +theorem LC_zeros {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} (a : Nat) + (H : LC o n k l) : LC o (n + a) (k * 2 ^ a) ((w111 ^ a) +> l) := by + induction a with + | zero => simpa using H + | succ a ih => + rw [pow_succ_list, append_assoc_lb] + have h1 := LC.d0 (n + a) (k * 2 ^ a) ((w111 ^ a) +> l) ih + have hn : 1 + (n + a) = n + (a + 1) := by omega + have hk : k * 2 ^ a * 2 = k * 2 ^ (a + 1) := by rw [Nat.pow_succ]; ring + rw [hn, hk] at h1 + exact h1 + +theorem LC_ones {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} (a : Nat) + (H : LC o n k l) : LC o (n + a) ((1 + k) * 2 ^ a - 1) ((w011 ^ a) +> l) := by + induction a with + | zero => + have hk : (1 + k) * 2 ^ 0 - 1 = k := by omega + rw [hk]; exact H + | succ a ih => + rw [pow_succ_list, append_assoc_lb] + have h1 := LC.d1 (n + a) ((1 + k) * 2 ^ a - 1) ((w011 ^ a) +> l) ih + have hp : 1 ≤ 2 ^ a := pow_pos 2 a (by decide) + have hp2 : 1 ≤ (1 + k) * 2 ^ a := Nat.le_trans hp (Nat.le_mul_of_pos_left _ (by omega)) + have hn : 1 + (n + a) = n + (a + 1) := by omega + have hk : 1 + ((1 + k) * 2 ^ a - 1) * 2 = (1 + k) * 2 ^ (a + 1) - 1 := by + rw [Nat.pow_succ] + have : (1 + k) * (2 ^ a * 2) = ((1 + k) * 2 ^ a) * 2 := by ring + (try omega) + rw [hn, hk] at h1 + exact h1 + +theorem LC_zero (o : ListBlank (Fin 2)) (n : Nat) : LC o n 0 ((w111 ^ n) +> o) := by + have h := LC_zeros n (LC.nil (o := o)) + simpa using h + +theorem LC_full (o : ListBlank (Fin 2)) (n : Nat) : LC o n (2 ^ n - 1) ((w011 ^ n) +> o) := by + have h := LC_ones n (LC.nil (o := o)) + simpa using h + +theorem LC_zero_unique {o : ListBlank (Fin 2)} {n : Nat} {l : ListBlank (Fin 2)} + (H : LC o n 0 l) : l = (w111 ^ n) +> o := + LC_unique H (LC_zero o n) + +theorem LC_positive_split {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} + (H : LC o n k l) (Hk : 0 < k) : + ∃ a m u hi, n = m + 1 + a ∧ k = 2 ^ a * (1 + u * 2) ∧ + LC o m u hi ∧ l = (w111 ^ a) +> (w011 +> hi) := by + induction H with + | nil => omega + | d0 n k l hlc ih => + rcases ih (by omega) with ⟨a, m, u, hi, hn, hk, hc, hl⟩ + refine ⟨1 + a, m, u, hi, by omega, ?_, hc, ?_⟩ + · rw [hk, Nat.add_comm 1 a, Nat.pow_succ]; ring + · rw [hl, Nat.add_comm 1 a, pow_succ_list, append_assoc_lb] + | d1 n k l hlc _ => + exact ⟨0, n, k, l, by omega, by simp, hlc, rfl⟩ + +theorem LC_borrow {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} + (H : LC o n (1 + k) l) : + ∃ l', LC o n k l' ∧ ∀ r, (LBar l r) [target_tm]⊢⁺ (RBar l' r) := by + rcases LC_positive_split H (by omega) with ⟨a, m, u, hi, hn, hk, hc, hl⟩ + refine ⟨(w011 ^ a) +> (w111 +> hi), ?_, ?_⟩ + · have h1 := LC_ones a (LC.d0 m u hi hc) + have hn' : (1 + m) + a = n := by omega + have hp : 1 ≤ 2 ^ a := pow_pos 2 a (by decide) + have hk' : (1 + u * 2) * 2 ^ a - 1 = k := by + have : (1 + u * 2) * 2 ^ a = 2 ^ a * (1 + u * 2) := Nat.mul_comm _ _ + (try omega) + rw [hn', hk'] at h1 + exact h1 + · intro r + rw [hl] + exact LInc hi r a + +theorem LC_R100 {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) + (H : LC o n k l) : + ∃ l', LC o (1 + n) (k * 2) l' ∧ (RBar l ([1, 0, 0] +> r)) [target_tm]⊢⁺ (RBar l' r) := + ⟨w111 +> l, LC.d0 n k l H, R100 l r⟩ + +theorem LC_R111 {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) + (H : LC o n k l) : + ∃ l', LC o (1 + n) (1 + k * 2) l' ∧ (RBar l (w111 +> r)) [target_tm]⊢⁺ (RBar l' r) := + ⟨w011 +> l, LC.d1 n k l H, R111 l r⟩ + +theorem LC_R110 {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) + (H : LC o n k l) (Hk : 0 < k) : + ∃ l', LC o (1 + n) (k * 2 - 1) l' ∧ (RBar l (e1 +> r)) [target_tm]⊢⁺ (RBar l' r) := by + have hc : LC o n (1 + (k - 1)) l := by + have heq : 1 + (k - 1) = k := by omega + rw [heq]; exact H + rcases LC_borrow hc with ⟨l', h', hb⟩ + refine ⟨w011 +> l', ?_, ?_⟩ + · have h1 := LC.d1 n (k - 1) l' h' + have heq : 1 + (k - 1) * 2 = k * 2 - 1 := by omega + rw [heq] at h1 + exact h1 + · exact (R110 l r) ⋙ (hb (w111 +> r)) ⋙ (R111 l' r) + +theorem LC_Lzero {n : Nat} {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) + (H : LC outer n 0 l) : + ∃ l', LC outer n (2 ^ n - 1) l' ∧ (LBar l r) [target_tm]⊢⁺ (RBar l' ([1] +> r)) := by + rw [LC_zero_unique H] + exact ⟨(w011 ^ n) +> outer, LC_full outer n, LBlank1 r n⟩ + +theorem step_D_111 (l r : ListBlank (Fin 2)) : + ((w111 +> l) <{{D}} r) [target_tm]⊢⁺ (l <{{D}} (e0 +> r)) := by + unfold w111 e0; simp only [cons_append_lb, append_nil_lb]; execute + +theorem sweep_D_111 (a : Nat) (l r : ListBlank (Fin 2)) : + (((w111 ^ a) +> l) <{{D}} r) [target_tm]⊢* (l <{{D}} ((e0 ^ a) +> r)) := by + induction a generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ a ih => + have h1 : (((w111 ^ (a + 1)) +> l) <{{D}} r) = ((w111 +> ((w111 ^ a) +> l)) <{{D}} r) := by + rw [pow_succ_list, append_assoc_lb] + rw [h1] + have h2 := stepPlus_stepStar_stepPlus (step_D_111 ((w111 ^ a) +> l) r) (ih l (e0 +> r)) + rw [pow_succ_right_lb] at h2 + exact stepPlus_stepStar h2 + +theorem DReturn_base (l r : ListBlank (Fin 2)) : + ((w011 +> l) <{{D}} r) [target_tm]⊢⁺ (LBar l ([1, 1] +> r)) := by + unfold LBar w011; simp only [cons_append_lb, append_nil_lb]; execute + +theorem DReturn (l r : ListBlank (Fin 2)) (a : Nat) : + (((w111 ^ a) +> (w011 +> l)) <{{D}} r) [target_tm]⊢⁺ + (LBar l ([1, 1] +> ((e0 ^ a) +> r))) := + stepStar_stepPlus_stepPlus (sweep_D_111 a (w011 +> l) r) (DReturn_base l ((e0 ^ a) +> r)) + +theorem LC_Dpositive {o : ListBlank (Fin 2)} {m u : Nat} {hi : ListBlank (Fin 2)} + (a : Nat) (r : ListBlank (Fin 2)) (H : LC o m (1 + u) hi) : + ∃ l', LC o m u l' ∧ + (((w111 ^ a) +> (w011 +> hi)) <{{D}} r) [target_tm]⊢⁺ + (RBar l' ([1, 1] +> ((e0 ^ a) +> r))) := by + rcases LC_borrow H with ⟨l', hc, hb⟩ + exact ⟨l', hc, (DReturn hi r a) ⋙ (hb ([1, 1] +> ((e0 ^ a) +> r)))⟩ + +theorem LC_Dpower {m : Nat} {hi : ListBlank (Fin 2)} (a : Nat) (r : ListBlank (Fin 2)) + (H : LC outer m 0 hi) : + ∃ l', LC outer m (2 ^ m - 1) l' ∧ + (((w111 ^ a) +> (w011 +> hi)) <{{D}} r) [target_tm]⊢⁺ + (RBar l' (w111 +> ((e0 ^ a) +> r))) := by + rw [LC_zero_unique H] + refine ⟨(w011 ^ m) +> outer, LC_full outer m, ?_⟩ + have h1 := DReturn ((w111 ^ m) +> outer) r a + have h2 := LBlank1 ([1, 1] +> ((e0 ^ a) +> r)) m + exact h1 ⋙ h2 + +theorem LC_factor {o : ListBlank (Fin 2)} {m a u : Nat} {l : ListBlank (Fin 2)} + (H : LC o (m + 1 + a) (2 ^ a * (1 + u * 2)) l) : + ∃ hi, LC o m u hi ∧ l = (w111 ^ a) +> (w011 +> hi) := by + induction a generalizing l with + | zero => + have hn : m + 1 + 0 = 1 + m := by omega + have hk : 2 ^ 0 * (1 + u * 2) = 1 + u * 2 := by simp + rw [hn, hk] at H + generalize hm1 : 1 + m = n0 at H + generalize hk1 : 1 + u * 2 = k0 at H + cases H with + | nil => omega + | d0 => omega + | d1 n' k' hi hc => + have hn' : m = n' := by omega + have hk' : u = k' := by omega + subst hn'; subst hk' + exact ⟨hi, hc, rfl⟩ + | succ a ih => + have hn : m + 1 + (a + 1) = 1 + (m + 1 + a) := by omega + have hk : 2 ^ (a + 1) * (1 + u * 2) = (2 ^ a * (1 + u * 2)) * 2 := by rw [Nat.pow_succ]; ring + rw [hn, hk] at H + generalize hm1 : 1 + (m + 1 + a) = n0 at H + generalize hk1 : (2 ^ a * (1 + u * 2)) * 2 = k0 at H + cases H with + | nil => omega + | d1 => omega + | d0 n' k' hi hc => + have hn' : m + 1 + a = n' := by omega + have hk' : 2 ^ a * (1 + u * 2) = k' := by omega + subst hn'; subst hk' + rcases ih hc with ⟨hi', hc', heq⟩ + refine ⟨hi', hc', ?_⟩ + rw [heq, pow_succ_list, append_assoc_lb] + +theorem LC_R0positive {o : ListBlank (Fin 2)} {m a u : Nat} {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) + (H : LC o (m + 1 + a) (2 ^ a * (1 + (1 + u) * 2)) l) : + ∃ l', LC o m u l' ∧ + (RBar l ([0] +> r)) [target_tm]⊢⁺ (RBar l' ([1, 1] +> ((e0 ^ a) +> ([1, 1] +> r)))) := by + rcases LC_factor H with ⟨hi, hc, hl⟩ + rcases LC_Dpositive a ([1, 1] +> r) hc with ⟨l', hc', hs⟩ + rw [hl] + exact ⟨l', hc', (R0 ((w111 ^ a) +> (w011 +> hi)) r) ⋙ hs⟩ + +theorem LC_R0power {m a : Nat} {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) + (H : LC outer (m + 1 + a) (2 ^ a) l) : + ∃ l', LC outer m (2 ^ m - 1) l' ∧ + (RBar l ([0] +> r)) [target_tm]⊢⁺ (RBar l' (w111 +> ((e0 ^ a) +> ([1, 1] +> r)))) := by + have H0 : LC outer (m + 1 + a) (2 ^ a * (1 + 0 * 2)) l := by simpa using H + rcases LC_factor H0 with ⟨hi, hc, hl⟩ + rcases LC_Dpower a ([1, 1] +> r) hc with ⟨l', hc', hs⟩ + rw [hl] + exact ⟨l', hc', (R0 ((w111 ^ a) +> (w011 +> hi)) r) ⋙ hs⟩ + +-- ============================================================================ +-- Section 10: Pair7Counting (SOCMisc.v lines 7120-7277) +-- ============================================================================ + +theorem QLow (l r : ListBlank (Fin 2)) : + (QBar l (e0 +> r)) [target_tm]⊢⁺ (LBar l ([1, 1, 1, 0, 0] +> r)) := + R110 l ([0, 0] +> r) + +theorem QLowBack (l r : ListBlank (Fin 2)) : + (RBar l ([1, 1, 1, 0, 0] +> r)) [target_tm]⊢⁺ (LBar l ([1, 1, 1, 1, 0] +> r)) := by + unfold RBar LBar; simp only [cons_append_lb, append_nil_lb]; execute + +theorem step_QEnter (l r : ListBlank (Fin 2)) : + (QBar l (e1 +> r)) [target_tm]⊢⁺ (RBar (w011 +> l) ([1, 0] +> r)) := by + unfold QBar RBar e1 w011; simp only [cons_append_lb, append_nil_lb]; execute + +theorem sweep_R100_e2 (j : Nat) (l r : ListBlank (Fin 2)) : + (RBar l ([1, 0] +> ((e2 ^ j) +> r))) [target_tm]⊢* + (RBar ((w111 ^ j) +> l) ([1, 0] +> r)) := by + induction j generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ j ih => + have h1 : (RBar l ([1, 0] +> ((e2 ^ (j + 1)) +> r))) = + (RBar l ([1, 0, 0] +> ([1, 0] +> ((e2 ^ j) +> r)))) := by + rw [pow_succ_list, append_assoc_lb]; rfl + rw [h1] + have h2 := stepPlus_stepStar_stepPlus (R100 l ([1, 0] +> ((e2 ^ j) +> r))) (ih (w111 +> l) r) + rw [pow_succ_right_lb] at h2 + exact stepPlus_stepStar h2 + +theorem step_QEnd0 (l r : ListBlank (Fin 2)) : + (RBar l ([1, 0] +> (e0 +> r))) [target_tm]⊢⁺ ((w111 +> l) <{{D}} (e1 +> r)) := by + unfold RBar e0 w111 e1; simp only [cons_append_lb, append_nil_lb]; execute + +theorem step_QEnd1 (l r : ListBlank (Fin 2)) : + (RBar l ([1, 0] +> (e1 +> r))) [target_tm]⊢⁺ ((w111 +> l) <{{D}} (e2 +> r)) := by + unfold RBar e1 w111 e2; simp only [cons_append_lb, append_nil_lb]; execute + +theorem step_QEndTail (l r : ListBlank (Fin 2)) : + (RBar l ([1, 0] +> ([1, 1] +> r))) [target_tm]⊢⁺ ((w111 +> l) <{{D}} ([0, 1] +> r)) := by + unfold RBar w111; simp only [cons_append_lb, append_nil_lb]; execute + +theorem QCarry0 (l r : ListBlank (Fin 2)) (j : Nat) : + (QBar l (e1 +> ((e2 ^ j) +> (e0 +> r)))) [target_tm]⊢⁺ + (LBar l ([1, 1] +> ((e0 ^ (1 + j)) +> (e1 +> r)))) := by + have h1 := stepPlus_stepStar_stepPlus (step_QEnter l ((e2 ^ j) +> (e0 +> r))) + (sweep_R100_e2 j (w011 +> l) (e0 +> r)) + have h2 := h1 ⋙ (step_QEnd0 ((w111 ^ j) +> (w011 +> l)) r) + have h3 : (w111 +> ((w111 ^ j) +> (w011 +> l))) = ((w111 ^ (1 + j)) +> (w011 +> l)) := by + rw [Nat.add_comm 1 j, pow_succ_list, append_assoc_lb] + rw [h3] at h2 + exact h2 ⋙ (DReturn l (e1 +> r) (1 + j)) + +theorem QCarry1 (l r : ListBlank (Fin 2)) (j : Nat) : + (QBar l (e1 +> ((e2 ^ j) +> (e1 +> r)))) [target_tm]⊢⁺ + (LBar l ([1, 1] +> ((e0 ^ (1 + j)) +> (e2 +> r)))) := by + have h1 := stepPlus_stepStar_stepPlus (step_QEnter l ((e2 ^ j) +> (e1 +> r))) + (sweep_R100_e2 j (w011 +> l) (e1 +> r)) + have h2 := h1 ⋙ (step_QEnd1 ((w111 ^ j) +> (w011 +> l)) r) + have h3 : (w111 +> ((w111 ^ j) +> (w011 +> l))) = ((w111 ^ (1 + j)) +> (w011 +> l)) := by + rw [Nat.add_comm 1 j, pow_succ_list, append_assoc_lb] + rw [h3] at h2 + exact h2 ⋙ (DReturn l (e2 +> r) (1 + j)) + +theorem QCarryTail (l r : ListBlank (Fin 2)) (j : Nat) : + (QBar l (e1 +> ((e2 ^ j) +> ([1, 1] +> r)))) [target_tm]⊢⁺ + (LBar l ([1, 1] +> ((e0 ^ (1 + j)) +> ([0, 1] +> r)))) := by + have h1 := stepPlus_stepStar_stepPlus (step_QEnter l ((e2 ^ j) +> ([1, 1] +> r))) + (sweep_R100_e2 j (w011 +> l) ([1, 1] +> r)) + have h2 := h1 ⋙ (step_QEndTail ((w111 ^ j) +> (w011 +> l)) r) + have h3 : (w111 +> ((w111 ^ j) +> (w011 +> l))) = ((w111 ^ (1 + j)) +> (w011 +> l)) := by + rw [Nat.add_comm 1 j, pow_succ_list, append_assoc_lb] + rw [h3] at h2 + exact h2 ⋙ (DReturn l ([0, 1] +> r) (1 + j)) + +theorem QExit (l r : ListBlank (Fin 2)) (j : Nat) : + (QBar l (e1 +> ((e2 ^ j) +> ([0, 1] +> r)))) [target_tm]⊢⁺ + (RBar ((w111 ^ (1 + j)) +> (w011 +> l)) ([1] +> r)) := by + have h1 := stepPlus_stepStar_stepPlus (step_QEnter l ((e2 ^ j) +> ([0, 1] +> r))) + (sweep_R100_e2 j (w011 +> l) ([0, 1] +> r)) + have h2 : ([1, 0] +> ([0, 1] +> r)) = ([1, 0, 0] +> ([1] +> r)) := rfl + rw [h2] at h1 + have h3 := h1 ⋙ (R100 ((w111 ^ j) +> (w011 +> l)) ([1] +> r)) + have h4 : (w111 +> ((w111 ^ j) +> (w011 +> l))) = ((w111 ^ (1 + j)) +> (w011 +> l)) := by + rw [Nat.add_comm 1 j, pow_succ_list, append_assoc_lb] + rw [h4] at h3 + exact h3 + +theorem Q0 {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) + (H : LC o n (2 + k) l) : + ∃ l', LC o n k l' ∧ (QBar l (e0 +> r)) [target_tm]⊢⁺ (QBar l' (e1 +> r)) := by + have H0 : LC o n (1 + (1 + k)) l := by + have : 1 + (1 + k) = 2 + k := by omega + rw [this]; exact H + rcases LC_borrow H0 with ⟨l1, h1, s1⟩ + rcases LC_borrow h1 with ⟨l2, h2, s2⟩ + refine ⟨l2, h2, ?_⟩ + exact (QLow l r) ⋙ (s1 ([1, 1, 1, 0, 0] +> r)) ⋙ (QLowBack l1 r) ⋙ (s2 ([1, 1, 1, 1, 0] +> r)) + +theorem Q1 {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) (j : Nat) + (H : LC o n (1 + k) l) : + ∃ l', LC o n k l' ∧ + (QBar l (e1 +> ((e2 ^ j) +> (e0 +> r)))) [target_tm]⊢⁺ + (QBar l' ((e0 ^ (1 + j)) +> (e1 +> r))) := by + rcases LC_borrow H with ⟨l', h', hs⟩ + exact ⟨l', h', (QCarry0 l r j) ⋙ (hs ([1, 1] +> ((e0 ^ (1 + j)) +> (e1 +> r))))⟩ + +theorem Q2 {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) (j : Nat) + (H : LC o n (1 + k) l) : + ∃ l', LC o n k l' ∧ + (QBar l (e1 +> ((e2 ^ j) +> (e1 +> r)))) [target_tm]⊢⁺ + (QBar l' ((e0 ^ (1 + j)) +> (e2 +> r))) := by + rcases LC_borrow H with ⟨l', h', hs⟩ + exact ⟨l', h', (QCarry1 l r j) ⋙ (hs ([1, 1] +> ((e0 ^ (1 + j)) +> (e2 +> r))))⟩ + +theorem Q3 {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) (j : Nat) + (H : LC o n (1 + k) l) : + ∃ l', LC o n k l' ∧ + (QBar l (e1 +> ((e2 ^ j) +> ([1, 1] +> r)))) [target_tm]⊢⁺ + (QBar l' ((e0 ^ (1 + j)) +> ([0, 1] +> r))) := by + rcases LC_borrow H with ⟨l', h', hs⟩ + exact ⟨l', h', (QCarryTail l r j) ⋙ (hs ([1, 1] +> ((e0 ^ (1 + j)) +> ([0, 1] +> r))))⟩ + +theorem Q4 {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) (j : Nat) + (H : LC o n k l) : + ∃ l', LC o (n + j + 2) ((1 + k * 2) * 2 ^ (1 + j)) l' ∧ + (QBar l (e1 +> ((e2 ^ j) +> ([0, 1] +> r)))) [target_tm]⊢⁺ + (RBar l' ([1] +> r)) := by + refine ⟨(w111 ^ (1 + j)) +> (w011 +> l), ?_, QExit l r j⟩ + have h1 := LC_zeros (1 + j) (LC.d1 n k l H) + have hn : (1 + n) + (1 + j) = n + j + 2 := by omega + rw [hn] at h1 + exact h1 + +theorem TC_next {o tail : ListBlank (Fin 2)} {n k h v : Nat} {l r : ListBlank (Fin 2)} + (Hl : LC o n (3 + k) l) (Hr : TC tail h v r) (Hb : v + 1 < 3 ^ h) : + ∃ l' r', LC o n k l' ∧ TC tail h (v + 1) r' ∧ + (QBar l (e0 +> r)) [target_tm]⊢⁺ (QBar l' (e0 +> r')) := by + rcases TC_carry Hr Hb with ⟨j, b, q, s, hh, hs, ⟨hr, hn⟩ | ⟨hr, hn⟩⟩ + · subst hr + have Hl' : LC o n (2 + (1 + k)) l := by + have : 2 + (1 + k) = 3 + k := by omega + rw [this]; exact Hl + rcases Q0 ((e2 ^ j) +> (e0 +> s)) Hl' with ⟨l1, h1, s1⟩ + rcases Q1 s j h1 with ⟨l2, h2, s2⟩ + refine ⟨l2, (e0 ^ j) +> (e1 +> s), h2, hn, ?_⟩ + have h_r : ((e0 ^ (1 + j)) +> (e1 +> s)) = (e0 +> ((e0 ^ j) +> (e1 +> s))) := by + rw [Nat.add_comm 1 j, pow_succ_list, append_assoc_lb] + rw [h_r] at s2 + exact s1 ⋙ s2 + · subst hr + have Hl' : LC o n (2 + (1 + k)) l := by + have : 2 + (1 + k) = 3 + k := by omega + rw [this]; exact Hl + rcases Q0 ((e2 ^ j) +> (e1 +> s)) Hl' with ⟨l1, h1, s1⟩ + rcases Q2 s j h1 with ⟨l2, h2, s2⟩ + refine ⟨l2, (e0 ^ j) +> (e2 +> s), h2, hn, ?_⟩ + have h_r : ((e0 ^ (1 + j)) +> (e2 +> s)) = (e0 +> ((e0 ^ j) +> (e2 +> s))) := by + rw [Nat.add_comm 1 j, pow_succ_list, append_assoc_lb] + rw [h_r] at s2 + exact s1 ⋙ s2 + +theorem TC_steps (count : Nat) {o tail : ListBlank (Fin 2)} {n k h v : Nat} {l r : ListBlank (Fin 2)} + (Hl : LC o n (3 * count + k) l) (Hr : TC tail h v r) (Hb : v + count < 3 ^ h) : + ∃ l' r', LC o n k l' ∧ TC tail h (v + count) r' ∧ + (QBar l (e0 +> r)) [target_tm]⊢* (QBar l' (e0 +> r')) := by + induction count generalizing k l v r with + | zero => + have hk : 3 * 0 + k = k := by omega + rw [hk] at Hl + exact ⟨l, r, Hl, Hr, ⟨0, rfl⟩⟩ + | succ count ih => + have Hl1 : LC o n (3 + (3 * count + k)) l := by + have : 3 + (3 * count + k) = 3 * (count + 1) + k := by omega + rw [this]; exact Hl + rcases TC_next Hl1 Hr (by omega) with ⟨l1, r1, h1, t1, s1⟩ + rcases ih h1 t1 (by omega) with ⟨l2, r2, h2, t2, s2⟩ + have hv : (v + 1) + count = v + (count + 1) := by omega + rw [hv] at t2 + exact ⟨l2, r2, h2, t2, stepPlus_stepStar (stepPlus_stepStar_stepPlus s1 s2)⟩ + +theorem TC_first {o : ListBlank (Fin 2)} {n k h v : Nat} {l r : ListBlank (Fin 2)} (tail : ListBlank (Fin 2)) + (Hl : LC o n (3 * (3 ^ h - v) + k) l) (Hr : TC ([1, 1] +> tail) h v r) : + ∃ l', LC o n k l' ∧ + (QBar l (e0 +> r)) [target_tm]⊢⁺ (QBar l' (e0 +> ((e0 ^ h) +> ([0, 1] +> tail)))) := by + have hb := TC_bound Hr + have Hl1 : LC o n (3 * (3 ^ h - 1 - v) + (3 + k)) l := by + have : 3 * (3 ^ h - 1 - v) + (3 + k) = 3 * (3 ^ h - v) + k := by omega + rw [this]; exact Hl + rcases TC_steps (3 ^ h - 1 - v) Hl1 Hr (by omega) with ⟨l1, r1, h1, t1, s1⟩ + have hv : v + (3 ^ h - 1 - v) = 3 ^ h - 1 := by omega + rw [hv] at t1 + rw [TC_full_unique t1] at s1 + have h1' : LC o n (2 + (1 + k)) l1 := by + have : 2 + (1 + k) = 3 + k := by omega + rw [this]; exact h1 + rcases Q0 ((e2 ^ h) +> ([1, 1] +> tail)) h1' with ⟨l2, h2, s2⟩ + rcases Q3 tail h h2 with ⟨l3, h3, s3⟩ + have h_r : ((e0 ^ (1 + h)) +> ([0, 1] +> tail)) = (e0 +> ((e0 ^ h) +> ([0, 1] +> tail))) := by + rw [Nat.add_comm 1 h, pow_succ_list, append_assoc_lb] + rw [h_r] at s3 + exact ⟨l3, h3, stepStar_stepPlus_stepPlus s1 (s2 ⋙ s3)⟩ + +theorem TC_exit {o : ListBlank (Fin 2)} {n k h v : Nat} {l r : ListBlank (Fin 2)} (tail : ListBlank (Fin 2)) + (Hl : LC o n (3 * (3 ^ h - v) - 1 + k) l) (Hr : TC ([0, 1] +> tail) h v r) : + ∃ l', LC o (n + h + 2) ((1 + k * 2) * 2 ^ (1 + h)) l' ∧ + (QBar l (e0 +> r)) [target_tm]⊢⁺ (RBar l' ([1] +> tail)) := by + have hb := TC_bound Hr + have Hl1 : LC o n (3 * (3 ^ h - 1 - v) + (2 + k)) l := by + have : 3 * (3 ^ h - 1 - v) + (2 + k) = 3 * (3 ^ h - v) - 1 + k := by omega + rw [this]; exact Hl + rcases TC_steps (3 ^ h - 1 - v) Hl1 Hr (by omega) with ⟨l1, r1, h1, t1, s1⟩ + have hv : v + (3 ^ h - 1 - v) = 3 ^ h - 1 := by omega + rw [hv] at t1 + rw [TC_full_unique t1] at s1 + rcases Q0 ((e2 ^ h) +> ([0, 1] +> tail)) h1 with ⟨l2, h2, s2⟩ + rcases Q4 tail h h2 with ⟨l3, h3, s3⟩ + exact ⟨l3, h3, stepStar_stepPlus_stepPlus s1 (s2 ⋙ s3)⟩ + +theorem Q_return {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} (h : Nat) (tail : ListBlank (Fin 2)) + (Hl : LC o n (2 * 3 ^ (1 + h) - 1 + k) l) : + ∃ l', LC o (n + h + 2) ((1 + k * 2) * 2 ^ (1 + h)) l' ∧ + (QBar l ((e0 ^ (1 + h)) +> ([1, 1] +> tail))) [target_tm]⊢⁺ (RBar l' ([1] +> tail)) := by + have hp : 0 < 3 ^ h := pow_pos 3 h (by decide) + have Hl1 : LC o n (3 * (3 ^ h - 0) + (3 * 3 ^ h - 1 + k)) l := by + have : 3 * (3 ^ h - 0) + (3 * 3 ^ h - 1 + k) = 2 * 3 ^ (1 + h) - 1 + k := by + rw [Nat.add_comm 1 h, Nat.pow_succ]; omega + rw [this]; exact Hl + rcases TC_first tail Hl1 (TC_zero ([1, 1] +> tail) h) with ⟨l1, h1, s1⟩ + have h1' : LC o n (3 * (3 ^ h - 0) - 1 + k) l1 := by simpa using h1 + rcases TC_exit tail h1' (TC_zero ([0, 1] +> tail) h) with ⟨l2, h2, s2⟩ + have h_r : (e0 +> ((e0 ^ h) +> ([1, 1] +> tail))) = ((e0 ^ (1 + h)) +> ([1, 1] +> tail)) := by + rw [Nat.add_comm 1 h, pow_succ_list, append_assoc_lb] + rw [h_r] at s1 + exact ⟨l2, h2, s1 ⋙ s2⟩ + +-- ============================================================================ +-- Section 11: Pair7Low, Pair7Normal, Pair7Repair (SOCMisc.v lines 7280-7475) +-- ============================================================================ + +theorem zero11 {n : Nat} {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) (H : LC outer n 0 l) : + ∃ l', LC outer (n + 1) (2 ^ (n + 1) - 1) l' ∧ + (LBar l ([1, 1] +> r)) [target_tm]⊢⁺ (RBar l' r) := by + rcases LC_Lzero ([1, 1] +> r) H with ⟨l1, h1, s1⟩ + rcases LC_R111 r h1 with ⟨l2, h2, s2⟩ + have hn : 1 + n = n + 1 := by omega + have hp : 1 ≤ 2 ^ n := pow_pos 2 n (by decide) + have hk : 1 + (2 ^ n - 1) * 2 = 2 ^ (n + 1) - 1 := by rw [Nat.pow_succ]; omega + rw [hn, hk] at h2 + exact ⟨l2, h2, s1 ⋙ s2⟩ + +theorem clear0 {n : Nat} {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) (H : LC outer n 0 l) : + ∃ l', LC outer (n + 2) (2 ^ (n + 2) - 2) l' ∧ + (QBar l (e0 +> r)) [target_tm]⊢⁺ (RBar l' r) := by + rcases zero11 ([1, 0, 0] +> r) H with ⟨l1, h1, s1⟩ + rcases LC_R100 r h1 with ⟨l2, h2, s2⟩ + have hn : 1 + (n + 1) = n + 2 := by omega + have hp : 1 ≤ 2 ^ (n + 1) := pow_pos 2 (n + 1) (by decide) + have hk : (2 ^ (n + 1) - 1) * 2 = 2 ^ (n + 2) - 2 := by + have : 2 ^ (n + 2) = 2 ^ (n + 1) * 2 := by rw [Nat.pow_succ] + (try omega) + rw [hn, hk] at h2 + exact ⟨l2, h2, (QLow l r) ⋙ s1 ⋙ s2⟩ + +theorem clear1 {n : Nat} {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) (H : LC outer n 1 l) : + ∃ l', LC outer (n + 2) (2 ^ (n + 2) - 3) l' ∧ + (QBar l (e0 +> r)) [target_tm]⊢⁺ (RBar l' r) := by + have H0 : LC outer n (1 + 0) l := H + rcases LC_borrow H0 with ⟨l1, h1, s1⟩ + rcases zero11 ([1, 1, 0] +> r) h1 with ⟨l2, h2, s2⟩ + have hp : 0 < 2 ^ (n + 1) - 1 := by + have : 1 ≤ 2 ^ n := pow_pos 2 n (by decide) + rw [Nat.pow_succ]; omega + rcases LC_R110 r h2 hp with ⟨l3, h3, s3⟩ + have hn : 1 + (n + 1) = n + 2 := by omega + have hk : (2 ^ (n + 1) - 1) * 2 - 1 = 2 ^ (n + 2) - 3 := by + have : 2 ^ (n + 2) = 2 ^ (n + 1) * 2 := by rw [Nat.pow_succ] + (try omega) + rw [hn, hk] at h3 + exact ⟨l3, h3, (QLow l r) ⋙ (s1 ([1, 1, 1, 0, 0] +> r)) ⋙ (QLowBack l1 r) ⋙ s2 ⋙ s3⟩ + +theorem clear2a {tail : ListBlank (Fin 2)} {n h v : Nat} {l r : ListBlank (Fin 2)} + (Hl : LC outer n 2 l) (Hr : TC tail h v r) (Hb : v + 1 < 3 ^ h) : + ∃ l' r', LC outer (n + 1) (2 ^ (n + 1) - 1) l' ∧ TC tail h (v + 1) r' ∧ + (QBar l (e0 +> r)) [target_tm]⊢⁺ (RBar l' (e0 +> r')) := by + rcases TC_carry Hr Hb with ⟨j, b, q, s, hh, hs, ⟨hr, hn⟩ | ⟨hr, hn⟩⟩ + · subst hr + have Hl0 : LC outer n (2 + 0) l := Hl + rcases Q0 ((e2 ^ j) +> (e0 +> s)) Hl0 with ⟨l1, h1, s1⟩ + rcases zero11 ((e0 ^ (1 + j)) +> (e1 +> s)) h1 with ⟨l2, h2, s2⟩ + have s12 := s1 ⋙ (QCarry0 l1 s j) ⋙ s2 + have h_r : (RBar l2 ((e0 ^ (1 + j)) +> (e1 +> s))) = (RBar l2 (e0 +> ((e0 ^ j) +> (e1 +> s)))) := by + rw [Nat.add_comm 1 j, pow_succ_list, append_assoc_lb] + rw [h_r] at s12 + exact ⟨l2, (e0 ^ j) +> (e1 +> s), h2, hn, s12⟩ + · subst hr + have Hl0 : LC outer n (2 + 0) l := Hl + rcases Q0 ((e2 ^ j) +> (e1 +> s)) Hl0 with ⟨l1, h1, s1⟩ + rcases zero11 ((e0 ^ (1 + j)) +> (e2 +> s)) h1 with ⟨l2, h2, s2⟩ + have s12 := s1 ⋙ (QCarry1 l1 s j) ⋙ s2 + have h_r : (RBar l2 ((e0 ^ (1 + j)) +> (e2 +> s))) = (RBar l2 (e0 +> ((e0 ^ j) +> (e2 +> s)))) := by + rw [Nat.add_comm 1 j, pow_succ_list, append_assoc_lb] + rw [h_r] at s12 + exact ⟨l2, (e0 ^ j) +> (e2 +> s), h2, hn, s12⟩ + +theorem clear2_full_low {n h : Nat} {l r : ListBlank (Fin 2)} (tail : ListBlank (Fin 2)) + (Hl : LC outer n 2 l) (Hr : TC ([1, 1] +> tail) h (3 ^ h - 1) r) : + ∃ l' r', LC outer (n + 1) (2 ^ (n + 1) - 1) l' ∧ + TC ([0, 1] +> tail) h 0 r' ∧ + (QBar l (e0 +> r)) [target_tm]⊢⁺ (RBar l' (e0 +> r')) := by + rw [TC_full_unique Hr] + have Hl0 : LC outer n (2 + 0) l := Hl + rcases Q0 ((e2 ^ h) +> ([1, 1] +> tail)) Hl0 with ⟨l1, h1, s1⟩ + rcases zero11 ((e0 ^ (1 + h)) +> ([0, 1] +> tail)) h1 with ⟨l2, h2, s2⟩ + have s12 := s1 ⋙ (QCarryTail l1 tail h) ⋙ s2 + have h_r : (RBar l2 ((e0 ^ (1 + h)) +> ([0, 1] +> tail))) = (RBar l2 (e0 +> ((e0 ^ h) +> ([0, 1] +> tail)))) := by + rw [Nat.add_comm 1 h, pow_succ_list, append_assoc_lb] + rw [h_r] at s12 + exact ⟨l2, (e0 ^ h) +> ([0, 1] +> tail), h2, TC_zero ([0, 1] +> tail) h, s12⟩ + +theorem OddPrefix {o : ListBlank (Fin 2)} {m v : Nat} {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) + (H : LC o (1 + m) (3 + v * 2) l) : + ∃ l', LC o (1 + m) (1 + v * 2) l' ∧ + (RBar l ([0] +> r)) [target_tm]⊢⁺ (RBar l' ([1] +> r)) := by + have HC : LC o (m + 1 + 0) (2 ^ 0 * (1 + (1 + v) * 2)) l := by + have hn : m + 1 + 0 = 1 + m := by omega + have hk : 2 ^ 0 * (1 + (1 + v) * 2) = 3 + v * 2 := by omega + rw [hn, hk]; exact H + rcases LC_R0positive r HC with ⟨l1, h1, s1⟩ + rcases LC_R111 ([1] +> r) h1 with ⟨l2, h2, s2⟩ + exact ⟨l2, h2, s1 ⋙ s2⟩ + +theorem EvenPrefix {o : ListBlank (Fin 2)} {m h v : Nat} {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) + (H : LC o (m + h + 2) (2 ^ (1 + h) * (1 + (2 * 3 ^ (1 + h) + v) * 2)) l) : + ∃ l', LC o (m + h + 2) (2 ^ (1 + h) * (1 + v * 2)) l' ∧ + (RBar l ([0] +> r)) [target_tm]⊢⁺ (RBar l' ([1] +> r)) := by + have hp : 1 ≤ 3 ^ (1 + h) := pow_pos 3 (1 + h) (by decide) + have HC : LC o (m + 1 + (1 + h)) (2 ^ (1 + h) * (1 + (1 + (2 * 3 ^ (1 + h) - 1 + v)) * 2)) l := by + have hn : m + 1 + (1 + h) = m + h + 2 := by omega + have hk : 1 + (1 + (2 * 3 ^ (1 + h) - 1 + v)) * 2 = 1 + (2 * 3 ^ (1 + h) + v) * 2 := by omega + rw [hn, hk]; exact H + rcases LC_R0positive r HC with ⟨l1, h1, s1⟩ + rcases Q_return h r h1 with ⟨l2, h2, s2⟩ + have hk2 : (1 + v * 2) * 2 ^ (1 + h) = 2 ^ (1 + h) * (1 + v * 2) := Nat.mul_comm _ _ + rw [hk2] at h2 + exact ⟨l2, h2, s1 ⋙ s2⟩ + +theorem Odd000 {o : ListBlank (Fin 2)} {m v : Nat} {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) + (H : LC o (1 + m) (3 + v * 2) l) : + ∃ l', LC o (2 + m) (2 + v * 4) l' ∧ + (RBar l (e0 +> r)) [target_tm]⊢⁺ (RBar l' r) := by + rcases OddPrefix ([0, 0] +> r) H with ⟨l1, h1, s1⟩ + rcases LC_R100 r h1 with ⟨l2, h2, s2⟩ + have hn : 1 + (1 + m) = 2 + m := by omega + have hk : (1 + v * 2) * 2 = 2 + v * 4 := by omega + rw [hn, hk] at h2 + exact ⟨l2, h2, s1 ⋙ s2⟩ + +theorem Even000 {o : ListBlank (Fin 2)} {m h v : Nat} {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) + (H : LC o (m + h + 2) (2 ^ (1 + h) * (1 + (2 * 3 ^ (1 + h) + v) * 2)) l) : + ∃ l', LC o (m + h + 3) (2 ^ (2 + h) * (1 + v * 2)) l' ∧ + (RBar l (e0 +> r)) [target_tm]⊢⁺ (RBar l' r) := by + rcases EvenPrefix ([0, 0] +> r) H with ⟨l1, h1, s1⟩ + rcases LC_R100 r h1 with ⟨l2, h2, s2⟩ + have hn : 1 + (m + h + 2) = m + h + 3 := by omega + have hk : (2 ^ (1 + h) * (1 + v * 2)) * 2 = 2 ^ (2 + h) * (1 + v * 2) := by + have : 2 + h = (1 + h) + 1 := by omega + rw [this, Nat.pow_succ]; ring + rw [hn, hk] at h2 + exact ⟨l2, h2, s1 ⋙ s2⟩ + +theorem FullRead {n : Nat} {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) + (Hn : 3 ≤ 2 ^ n) (Hl : LC outer (n + 1) (2 ^ (n + 1) - 1) l) : + ∃ l', LC outer (n + 2) (2 ^ (n + 2) - 6) l' ∧ + (RBar l (e0 +> r)) [target_tm]⊢⁺ (RBar l' r) := by + have HC : LC outer (1 + n) (3 + (2 ^ n - 2) * 2) l := by + have hn : 1 + n = n + 1 := by omega + have hk : 3 + (2 ^ n - 2) * 2 = 2 ^ (n + 1) - 1 := by rw [Nat.pow_succ]; omega + rw [hn, hk]; exact Hl + rcases Odd000 r HC with ⟨l', h', hs⟩ + have hn' : 2 + n = n + 2 := by omega + have hk' : 2 + (2 ^ n - 2) * 4 = 2 ^ (n + 2) - 6 := by + have : 2 ^ (n + 2) = 2 ^ n * 4 := by rw [Nat.pow_add] + (try omega) + rw [hn', hk'] at h' + exact ⟨l', h', hs⟩ + +theorem clear2 {tail : ListBlank (Fin 2)} {n h v : Nat} {l r : ListBlank (Fin 2)} + (Hl : LC outer n 2 l) (Hr : TC tail h v r) (Hv : v + 1 < 3 ^ h) : + ∃ l' r', LC outer (n + 2) (2 ^ (n + 2) - 6) l' ∧ + TC tail h (v + 1) r' ∧ (QBar l (e0 +> r)) [target_tm]⊢⁺ (RBar l' r') := by + have hn := LC_bound Hl + rcases clear2a Hl Hr Hv with ⟨l1, r1, h1, t1, s1⟩ + rcases FullRead r1 (by omega) h1 with ⟨l2, h2, s2⟩ + exact ⟨l2, r1, h2, t1, s1 ⋙ s2⟩ + +theorem clear2_full {n h : Nat} {l r : ListBlank (Fin 2)} (tail : ListBlank (Fin 2)) + (Hl : LC outer n 2 l) (Hr : TC ([1, 1] +> tail) h (3 ^ h - 1) r) : + ∃ l' r', LC outer (n + 2) (2 ^ (n + 2) - 6) l' ∧ + TC ([0, 1] +> tail) h 0 r' ∧ (QBar l (e0 +> r)) [target_tm]⊢⁺ (RBar l' r') := by + have hn := LC_bound Hl + rcases clear2_full_low tail Hl Hr with ⟨l1, r1, h1, t1, s1⟩ + rcases FullRead r1 (by omega) h1 with ⟨l2, h2, s2⟩ + exact ⟨l2, r1, h2, t1, s1 ⋙ s2⟩ + +theorem HardEntry (n h k : Nat) {l : ListBlank (Fin 2)} + (Hl : LC outer (n + h + 2) (2 ^ (1 + h) * (1 + (1 + 3 * 3 ^ h + k) * 2)) l) : + ∃ l', LC outer n k l' ∧ + (RBar l ([0, 1] +> default)) [target_tm]⊢⁺ + (QBar l' (e0 +> ((e0 ^ h) +> ([0, 1, 1, 0] +> default)))) := by + have HC : LC outer (n + 1 + (1 + h)) (2 ^ (1 + h) * (1 + (1 + (3 * 3 ^ h + k)) * 2)) l := by + have hn : n + 1 + (1 + h) = n + h + 2 := by omega + have hk : 1 + (3 * 3 ^ h + k) = 1 + 3 * 3 ^ h + k := by omega + rw [hn, hk]; exact Hl + rcases LC_R0positive ([1, 0] +> default) HC with ⟨l1, h1, s1⟩ + have h1' : LC outer n (3 * (3 ^ h - 0) + k) l1 := by simpa using h1 + rcases TC_first ([1, 0] +> default) h1' (TC_zero ([1, 1] +> ([1, 0] +> default)) h) with ⟨l2, h2, s2⟩ + have hr0 : ([0] +> ([1, 0] +> (default : ListBlank (Fin 2)))) = ([0, 1] +> default) := by simp + rw [hr0] at s1 + have hr1 : (RBar l1 ([1, 1] +> ((e0 ^ (1 + h)) +> ([1, 1] +> ([1, 0] +> default))))) = + (QBar l1 (e0 +> ((e0 ^ h) +> ([1, 1] +> ([1, 0] +> default))))) := by + unfold QBar + rw [Nat.add_comm 1 h, pow_succ_list, append_assoc_lb] + rw [hr1] at s1 + have hr2 : ([0, 1] +> ([1, 0] +> (default : ListBlank (Fin 2)))) = ([0, 1, 1, 0] +> default) := by simp + rw [hr2] at s2 + exact ⟨l2, h2, s1 ⋙ s2⟩ + +-- ============================================================================ +-- Section 12: Pair7Read (SOCMisc.v lines 7478-7575) +-- ============================================================================ + +def cost : Nat → Nat + | 0 => 4 + | h + 1 => 8 * 6 ^ (h + 1) + +theorem cost_bounds (a : Nat) : 4 ≤ cost a ∧ cost a ≤ 8 * 6 ^ a := by + cases a with + | zero => decide + | succ h => + have hp : 0 < 6 ^ (h + 1) := pow_pos 6 (h + 1) (by decide) + change 4 ≤ 8 * 6 ^ (h + 1) ∧ 8 * 6 ^ (h + 1) ≤ 8 * 6 ^ (h + 1) + (try omega) +theorem LC_adic_width {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} (a u : Nat) + (Hl : LC o n k l) (Hk : k = 2 ^ a * (1 + u * 2)) : a < n := by + have hb := LC_bound Hl + by_contra hge + have hle : n ≤ a := by omega + have hpow : 2 ^ n ≤ 2 ^ a := pow_mono 2 n a (by decide) hle + have hpos : 0 < 2 ^ a := pow_pos 2 a (by decide) + have : 2 ^ a ≤ k := by + rw [Hk] + have : 1 ≤ 1 + u * 2 := by omega + exact Nat.le_mul_of_pos_right (2 ^ a) (by omega) + (try omega) +theorem ReadPrefix {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} (a u : Nat) + (r : ListBlank (Fin 2)) (Hl : LC o n k l) (Hk : k = 2 ^ a * (1 + u * 2)) (Hg : 4 * 6 ^ a < k) : + ∃ l' p v, LC o n p l' ∧ p = 2 ^ a * (1 + v * 2) ∧ + 2 ≤ p ∧ p * 2 + cost a = k * 2 ∧ + (RBar l ([0] +> r)) [target_tm]⊢⁺ (RBar l' ([1] +> r)) := by + have Hn := LC_adic_width a u Hl Hk + cases a with + | zero => + have Hk0 : k = 1 + u * 2 := by simpa using Hk + have Hg0 : 4 < k := by simpa using Hg + have HC : LC o (1 + (n - 1)) (3 + (u - 1) * 2) l := by + have hn : 1 + (n - 1) = n := by omega + have hk : 3 + (u - 1) * 2 = k := by omega + rw [hn, hk]; exact Hl + rcases OddPrefix r HC with ⟨l', h', hs⟩ + have hn' : 1 + (n - 1) = n := by omega + rw [hn'] at h' + refine ⟨l', 1 + (u - 1) * 2, u - 1, h', ?_, ?_, ?_, hs⟩ + · simp + · omega + · change (1 + (u - 1) * 2) * 2 + 4 = k * 2; omega + | succ a => + have Hk_lt : 4 * 6 ^ (a + 1) < 2 ^ (a + 1) * (1 + u * 2) := by rw [← Hk]; exact Hg + have Hu : 2 * 3 ^ (a + 1) ≤ u := (normal_budget (a + 1) u).mp Hk_lt + have HC : LC o ((n - 2 - a) + a + 2) (2 ^ (1 + a) * (1 + (2 * 3 ^ (1 + a) + (u - 2 * 3 ^ (1 + a))) * 2)) l := by + have hn : (n - 2 - a) + a + 2 = n := by omega + have ha1 : 1 + a = a + 1 := by omega + have hk : 2 ^ (a + 1) * (1 + (2 * 3 ^ (a + 1) + (u - 2 * 3 ^ (a + 1))) * 2) = k := by + have : 2 * 3 ^ (a + 1) + (u - 2 * 3 ^ (a + 1)) = u := by omega + rw [this, Hk] + rw [hn, ha1, hk]; exact Hl + rcases EvenPrefix r HC with ⟨l', h', hs⟩ + have hn' : (n - 2 - a) + a + 2 = n := by omega + have ha1 : 1 + a = a + 1 := by omega + rw [hn', ha1] at h' + refine ⟨l', 2 ^ (a + 1) * (1 + (u - 2 * 3 ^ (a + 1)) * 2), u - 2 * 3 ^ (a + 1), h', rfl, ?_, ?_, hs⟩ + · have hp : 2 ≤ 2 ^ (a + 1) := by + have := pow_mono 2 1 (a + 1) (by decide) (by omega) + simpa using this + have : 1 ≤ 1 + (u - 2 * 3 ^ (a + 1)) * 2 := by omega + have := Nat.mul_le_mul hp this + (try omega) + · change 2 ^ (a + 1) * (1 + (u - 2 * 3 ^ (a + 1)) * 2) * 2 + 8 * 6 ^ (a + 1) = k * 2 + rw [pow6 (a + 1), Hk] + have hu_eq : (u - 2 * 3 ^ (a + 1)) * 2 + 4 * 3 ^ (a + 1) = u * 2 := by omega + calc 2 ^ (a + 1) * (1 + (u - 2 * 3 ^ (a + 1)) * 2) * 2 + 8 * (2 ^ (a + 1) * 3 ^ (a + 1)) + _ = 2 ^ (a + 1) * (1 + ((u - 2 * 3 ^ (a + 1)) * 2 + 4 * 3 ^ (a + 1))) * 2 := by ring + _ = 2 ^ (a + 1) * (1 + u * 2) * 2 := by rw [hu_eq] + +theorem Read0 {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} (a u : Nat) + (r : ListBlank (Fin 2)) (Hl : LC o n k l) (Hk : k = 2 ^ a * (1 + u * 2)) (Hg : 4 * 6 ^ a < k) : + ∃ l' k' u', LC o (1 + n) k' l' ∧ + k' = 2 ^ (1 + a) * (1 + u' * 2) ∧ k' + cost a = k * 2 ∧ + (RBar l (e0 +> r)) [target_tm]⊢⁺ (RBar l' r) := by + rcases ReadPrefix a u ([0, 0] +> r) Hl Hk Hg with ⟨l1, p, v, h1, hp, hpos, he, s1⟩ + rcases LC_R100 r h1 with ⟨l2, h2, s2⟩ + refine ⟨l2, p * 2, v, h2, ?_, he, s1 ⋙ s2⟩ + have : 2 ^ (1 + a) = 2 ^ a * 2 := by rw [Nat.add_comm 1 a, Nat.pow_succ] + rw [hp, this] + ring + +theorem Read1 {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) + (Hl : LC o n k l) (Hk : 2 ≤ k) : + ∃ l' k' u', LC o (1 + n) k' l' ∧ + k' = 1 + u' * 2 ∧ 3 ≤ k' ∧ k' + 1 = k * 2 ∧ + (RBar l (e1 +> r)) [target_tm]⊢⁺ (RBar l' r) := by + rcases LC_R110 r Hl (by omega) with ⟨l', h', hs⟩ + refine ⟨l', k * 2 - 1, k - 1, h', ?_, ?_, ?_, hs⟩ <;> omega + +theorem Read2 {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} (a u : Nat) + (r : ListBlank (Fin 2)) (Hl : LC o n k l) (Hk : k = 2 ^ a * (1 + u * 2)) (Hg : 4 * 6 ^ a < k) : + ∃ l' k' u', LC o (1 + n) k' l' ∧ + k' = 1 + u' * 2 ∧ 3 ≤ k' ∧ k' + cost a + 1 = k * 2 ∧ + (RBar l (e2 +> r)) [target_tm]⊢⁺ (RBar l' r) := by + rcases ReadPrefix a u ([1, 0] +> r) Hl Hk Hg with ⟨l1, p, v, h1, hp, hpos, he, s1⟩ + rcases LC_R110 r h1 (by omega) with ⟨l2, h2, s2⟩ + refine ⟨l2, p * 2 - 1, p - 1, h2, ?_, ?_, ?_, s1 ⋙ s2⟩ <;> omega + +theorem Read011 {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} (a u : Nat) + (r : ListBlank (Fin 2)) (Hl : LC o n k l) (Hk : k = 2 ^ a * (1 + u * 2)) (Hg : 4 * 6 ^ a < k) : + ∃ l' k' u', LC o (1 + n) k' l' ∧ + k' = 1 + u' * 2 ∧ 3 ≤ k' ∧ k' + cost a = k * 2 + 1 ∧ + (RBar l ([0, 1, 1] +> r)) [target_tm]⊢⁺ (RBar l' r) := by + rcases ReadPrefix a u ([1, 1] +> r) Hl Hk Hg with ⟨l1, p, v, h1, hp, hpos, he, s1⟩ + rcases LC_R111 r h1 with ⟨l2, h2, s2⟩ + refine ⟨l2, 1 + p * 2, p, h2, rfl, ?_, ?_, s1 ⋙ s2⟩ <;> omega + +-- ============================================================================ +-- Section 13: Pair7Scan (SOCMisc.v lines 7578-7862) +-- ============================================================================ + +inductive EndTail : ListBlank (Fin 2) → Prop where + | End11 : EndTail ([1, 1] +> default) + | End01 : EndTail ([0, 1] +> default) + | End0110 : EndTail ([0, 1, 1, 0] +> default) + +inductive Trit : List (Fin 2) → Prop where + | Trit0 : Trit e0 + | Trit1 : Trit e1 + | Trit2 : Trit e2 + +theorem trit_step {w : List (Fin 2)} {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} + (a u d : Nat) (r : ListBlank (Fin 2)) + (Hw : Trit w) (Hl : LC o n k l) (Hk : k = 2 ^ a * (1 + u * 2)) (Hg : 4 * 6 ^ a < k) (Hd : 1 ≤ d) : + ∃ l' k' d' a' u', LC o (1 + n) k' l' ∧ + k' + d' = 2 * (k + d) ∧ 1 ≤ d' ∧ d' ≤ 2 * d + 8 * 6 ^ a + 1 ∧ + a' ≤ 1 + a ∧ k' = 2 ^ a' * (1 + u' * 2) ∧ + (RBar l (w +> r)) [target_tm]⊢⁺ (RBar l' r) := by + have hc := cost_bounds a + cases Hw with + | Trit0 => + rcases Read0 a u r Hl Hk Hg with ⟨l', k', u', hl', hk', hcost, hs⟩ + refine ⟨l', k', 2 * d + cost a, 1 + a, u', hl', ?_, ?_, ?_, ?_, hk', hs⟩ <;> omega + | Trit1 => + have hp6 : 0 < 6 ^ a := pow_pos 6 a (by decide) + have hk2 : 2 ≤ k := by omega + rcases Read1 r Hl hk2 with ⟨l', k', u', hl', hk', hp', hcost, hs⟩ + refine ⟨l', k', 2 * d + 1, 0, u', hl', ?_, ?_, ?_, ?_, ?_, hs⟩ + · omega + · omega + · omega + · omega + · simpa using hk' + | Trit2 => + rcases Read2 a u r Hl Hk Hg with ⟨l', k', u', hl', hk', hp', hcost, hs⟩ + refine ⟨l', k', 2 * d + cost a + 1, 0, u', hl', ?_, ?_, ?_, ?_, ?_, hs⟩ + · omega + · omega + · omega + · omega + · simpa using hk' + +theorem terminal {o : ListBlank (Fin 2)} {n k : Nat} {l : ListBlank (Fin 2)} (a u : Nat) + {tail : ListBlank (Fin 2)} (HE : EndTail tail) (Hl : LC o n k l) + (Hk : k = 2 ^ a * (1 + u * 2)) (Hg : 4 * 6 ^ a < k) : + ∃ l' v, LC o (n + 1) (3 + v * 2) l' ∧ 6 + v * 2 ≤ 2 ^ (n + 1) ∧ + (RBar l tail) [target_tm]⊢⁺ (RBar l' default) := by + have hb := LC_bound Hl + have hc := cost_bounds a + have hp6 : 0 < 6 ^ a := pow_pos 6 a (by decide) + have hk2 : 2 ≤ k := by omega + have hpow : 2 ^ (n + 1) = 2 ^ n * 2 := by rw [Nat.pow_succ] + cases HE with + | End11 => + rcases Read1 default Hl hk2 with ⟨l', k', u', hl', hk', hp', hcost, hs⟩ + have hn : 1 + n = n + 1 := by omega + have hk_eq : k' = 3 + (u' - 1) * 2 := by omega + rw [hn, hk_eq] at hl' + have htail : (e1 +> (default : ListBlank (Fin 2))) = ([1, 1] +> default) := by + unfold e1; simp + rw [htail] at hs + refine ⟨l', u' - 1, hl', ?_, hs⟩ + (try omega) + | End01 => + rcases Read2 a u default Hl Hk Hg with ⟨l', k', u', hl', hk', hp', hcost, hs⟩ + have hn : 1 + n = n + 1 := by omega + have hk_eq : k' = 3 + (u' - 1) * 2 := by omega + rw [hn, hk_eq] at hl' + have htail : (e2 +> (default : ListBlank (Fin 2))) = ([0, 1] +> default) := by + unfold e2; simp + rw [htail] at hs + refine ⟨l', u' - 1, hl', ?_, hs⟩ + (try omega) + | End0110 => + rcases Read011 a u default Hl Hk Hg with ⟨l', k', u', hl', hk', hp', hcost, hs⟩ + have hn : 1 + n = n + 1 := by omega + have hk_eq : k' = 3 + (u' - 1) * 2 := by omega + rw [hn, hk_eq] at hl' + have htail : ([0, 1, 1] +> (default : ListBlank (Fin 2))) = ([0, 1, 1, 0] +> default) := by simp + rw [htail] at hs + refine ⟨l', u' - 1, hl', ?_, hs⟩ + (try omega) +theorem bounded_cons (o : ListBlank (Fin 2)) (C A h : Nat) (r : ListBlank (Fin 2)) (w : List (Fin 2)) + (Hw : Trit w) + (IH : ∀ n k l i d a u, + LC o n k l → k = 2 ^ a * (1 + u * 2) → a ≤ i → k + d = C * 2 ^ i → + 1 ≤ d → d + 1 ≤ 2 ^ i * A + 2 * 6 ^ i → A + 6 * 3 ^ (i + h) ≤ C → + ∃ l' v, LC o (n + h + 1) (3 + v * 2) l' ∧ + 6 + v * 2 ≤ 2 ^ (n + h + 1) ∧ (RBar l r) [target_tm]⊢⁺ (RBar l' default)) : + ∀ n k l i d a u, + LC o n k l → k = 2 ^ a * (1 + u * 2) → a ≤ i → k + d = C * 2 ^ i → + 1 ≤ d → d + 1 ≤ 2 ^ i * A + 2 * 6 ^ i → A + 6 * 3 ^ (i + (h + 1)) ≤ C → + ∃ l' v, LC o (n + (h + 1) + 1) (3 + v * 2) l' ∧ + 6 + v * 2 ≤ 2 ^ (n + (h + 1) + 1) ∧ (RBar l (w +> r)) [target_tm]⊢⁺ (RBar l' default) := by + intro n k l i d a u Hl Hk Ha Hsum Hd Hdef HC + have h3mono : 3 ^ i ≤ 3 ^ (i + (h + 1)) := pow_mono 3 i (i + (h + 1)) (by decide) (by omega) + have Hci : A + 6 * 3 ^ i ≤ C := by omega + have Hgi := deficit_guard C A i k d Hsum Hdef Hci + have h6mono : 6 ^ a ≤ 6 ^ i := pow_mono 6 a i (by decide) Ha + have Hg : 4 * 6 ^ a < k := by omega + rcases trit_step a u d r Hw Hl Hk Hg Hd with ⟨l1, k1, d1, a1, u1, HL, HS, HD, HB, HA, HK, HT⟩ + have Hsum1 : k1 + d1 = C * 2 ^ (1 + i) := by + rw [HS, Hsum, Nat.add_comm 1 i, Nat.pow_succ] + ring + have Hdef1 := deficit_next A i a d d1 Ha Hdef HB + have HC1 : A + 6 * 3 ^ ((1 + i) + h) ≤ C := by + have : (1 + i) + h = i + (h + 1) := by omega + rw [this]; exact HC + rcases IH (1 + n) k1 l1 (1 + i) d1 a1 u1 HL HK (by omega) Hsum1 HD Hdef1 HC1 with ⟨l2, v, HL2, HB2, HT2⟩ + have hn_eq : (1 + n) + h + 1 = n + (h + 1) + 1 := by omega + rw [hn_eq] at HL2 HB2 + exact ⟨l2, v, HL2, HB2, HT ⋙ HT2⟩ + +theorem bounded_scan (o : ListBlank (Fin 2)) (C A : Nat) {tail : ListBlank (Fin 2)} {h v : Nat} {r : ListBlank (Fin 2)} + (Hr : TC tail h v r) (HE : EndTail tail) : + ∀ n k l i d a u, + LC o n k l → k = 2 ^ a * (1 + u * 2) → a ≤ i → k + d = C * 2 ^ i → + 1 ≤ d → d + 1 ≤ 2 ^ i * A + 2 * 6 ^ i → A + 6 * 3 ^ (i + h) ≤ C → + ∃ l' q, LC o (n + h + 1) (3 + q * 2) l' ∧ + 6 + q * 2 ≤ 2 ^ (n + h + 1) ∧ (RBar l r) [target_tm]⊢⁺ (RBar l' default) := by + induction Hr with + | nil => + intro n k l i d a u Hl Hk Ha Hsum Hd Hdef HC + have HC0 : A + 6 * 3 ^ i ≤ C := by simpa using HC + have Hgi := deficit_guard C A i k d Hsum Hdef HC0 + have h6mono : 6 ^ a ≤ 6 ^ i := pow_mono 6 a i (by decide) Ha + have Hg : 4 * 6 ^ a < k := by omega + exact terminal a u HE Hl Hk Hg + | d0 h v r htc ih => + exact bounded_cons o C A h r e0 Trit.Trit0 ih + | d1 h v r htc ih => + exact bounded_cons o C A h r e1 Trit.Trit1 ih + | d2 h v r htc ih => + exact bounded_cons o C A h r e2 Trit.Trit2 ih + +theorem D3 (n : Nat) {l : ListBlank (Fin 2)} (h v : Nat) {r tail : ListBlank (Fin 2)} + (Hl : LC outer (n + 2) (2 ^ (n + 2) - 3) l) (Hr : TC tail h v r) (HE : EndTail tail) + (HC : 3 * 3 ^ h ≤ 2 ^ n) : + ∃ l' u, LC outer (n + h + 3) (3 + u * 2) l' ∧ 6 + u * 2 ≤ 2 ^ (n + h + 3) ∧ + (RBar l r) [target_tm]⊢⁺ (RBar l' default) := by + have hp : 0 < 3 ^ h := pow_pos 3 h (by decide) + have Hpow : 2 ^ (n + 2) = 4 * 2 ^ n := by rw [Nat.pow_add]; ring + have Hk : 2 ^ (n + 2) - 3 = 2 ^ 0 * (1 + (2 * 2 ^ n - 2) * 2) := by simp; omega + have Hsum : (2 ^ (n + 2) - 3) + 3 = (4 * 2 ^ n) * 2 ^ 0 := by simp; omega + have HB : 2 + 6 * 3 ^ (0 + h) ≤ 4 * 2 ^ n := deficit3_budget (2 ^ n) h (0 + h) (by omega) HC + rcases bounded_scan outer (4 * 2 ^ n) 2 Hr HE (n + 2) (2 ^ (n + 2) - 3) l 0 3 0 (2 * 2 ^ n - 2) + Hl Hk (by omega) Hsum (by omega) (by decide) HB with ⟨l', u, HL, HG, HS⟩ + have hn_eq : (n + 2) + h + 1 = n + h + 3 := by omega + rw [hn_eq] at HL HG + exact ⟨l', u, HL, HG, HS⟩ + +theorem zero_scan (count : Nat) (o : ListBlank (Fin 2)) (C b : Nat) (r : ListBlank (Fin 2)) : + ∀ n k l i d u, + LC o n k l → k = 2 ^ (1 + i) * (1 + u * 2) → k + d = 4 * C * 2 ^ i → + d + 2 ^ i * b = 12 * 6 ^ i → 1 ≤ d → 0 < b → 3 * 3 ^ (i + count) ≤ C → + ∃ l' k' d' u', LC o (n + count) k' l' ∧ + k' = 2 ^ (1 + (i + count)) * (1 + u' * 2) ∧ k' + d' = 4 * C * 2 ^ (i + count) ∧ + d' + 2 ^ (i + count) * b = 12 * 6 ^ (i + count) ∧ 1 ≤ d' ∧ + (RBar l ((e0 ^ count) +> r)) [target_tm]⊢* (RBar l' r) := by + induction count with + | zero => + intro n k l i d u Hl Hk Hsum Hd Hp Hb HC + exact ⟨l, k, d, u, Hl, Hk, Hsum, Hd, Hp, ⟨0, rfl⟩⟩ + | succ count ih => + intro n k l i d u Hl Hk Hsum Hd Hp Hb HC + have Hg : 4 * 6 ^ (1 + i) < k := zeros_guard C (i + (count + 1)) i b k d (by omega) HC Hb Hsum Hd + rcases Read0 (1 + i) u ((e0 ^ count) +> r) Hl Hk Hg with ⟨l1, k1, u1, HL, HK, HD, HS⟩ + have hcost : cost (1 + i) = 8 * 6 ^ (1 + i) := by + have : 1 + i = i + 1 := by omega + rw [this]; rfl + rw [hcost] at HD + have Hsum1 : k1 + (2 * d + 8 * 6 ^ (1 + i)) = 4 * C * 2 ^ (1 + i) := by + have hpow : 4 * C * 2 ^ (1 + i) = (4 * C * 2 ^ i) * 2 := by + rw [Nat.add_comm 1 i, Nat.pow_succ]; ring + (try omega) + have Hd1 := zeros_next i b d Hd + have HC1 : 3 * 3 ^ ((1 + i) + count) ≤ C := by + have : (1 + i) + count = i + (count + 1) := by omega + rw [this]; exact HC + rcases ih (1 + n) k1 l1 (1 + i) (2 * d + 8 * 6 ^ (1 + i)) u1 HL HK Hsum1 Hd1 (by omega) Hb HC1 + with ⟨l2, k2, d2, u2, HL2, HK2, HS2, HD2, HP2, HT2⟩ + have hn_eq : (1 + n) + count = n + (count + 1) := by omega + have hi_eq : (1 + i) + count = i + (count + 1) := by omega + rw [hn_eq] at HL2 + rw [hi_eq] at HK2 HS2 HD2 + have hr_eq : ((e0 ^ (count + 1)) +> r) = (e0 +> ((e0 ^ count) +> r)) := by + rw [pow_succ_list, append_assoc_lb] + rw [hr_eq] + exact ⟨l2, k2, d2, u2, HL2, HK2, HS2, HD2, HP2, stepPlus_stepStar (stepPlus_stepStar_stepPlus HS HT2)⟩ + +theorem initial26 (n h d : Nat) (Hd : d = 2 ∨ d = 6) (HC : 3 * 3 ^ h ≤ 2 ^ n) : + ∃ b u, 6 ≤ b ∧ b ≤ 10 ∧ d + b = 12 ∧ + 2 ^ (n + 2) - d = 2 ^ 1 * (1 + u * 2) ∧ (2 ^ (n + 2) - d) + d = 4 * 2 ^ n ∧ 1 ≤ d := by + have hp : 0 < 3 ^ h := pow_pos 3 h (by decide) + have Hpow : 2 ^ (n + 2) = 4 * 2 ^ n := by rw [Nat.pow_add]; ring + rcases Hd with rfl | rfl + · refine ⟨10, 2 ^ n - 1, ?_, ?_, ?_, ?_, ?_, ?_⟩ <;> omega + · refine ⟨6, 2 ^ n - 2, ?_, ?_, ?_, ?_, ?_, ?_⟩ <;> omega + +theorem Zero26 (n h d : Nat) {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) + (Hd : d = 2 ∨ d = 6) (HC : 3 * 3 ^ h ≤ 2 ^ n) (Hl : LC outer (n + 2) (2 ^ (n + 2) - d) l) : + ∃ l', LC outer (n + h + 2) (2 ^ h * (4 * 2 ^ n - 12 * 3 ^ h + (12 - d))) l' ∧ + (RBar l ((e0 ^ h) +> r)) [target_tm]⊢* (RBar l' r) := by + rcases initial26 n h d Hd HC with ⟨b, u, Hb, Hb', Hdb, Hk, Hsum, Hp⟩ + have HS : (2 ^ (n + 2) - d) + d = 4 * 2 ^ n * 2 ^ 0 := by simp [Hsum] + have HD : d + 2 ^ 0 * b = 12 * 6 ^ 0 := by simp [Hdb] + rcases zero_scan h outer (2 ^ n) b r (n + 2) (2 ^ (n + 2) - d) l 0 d u Hl Hk HS HD Hp (by omega) (by simpa using HC) + with ⟨l1, k1, d1, u1, HL, HK, HS1, HD1, HP1, HT⟩ + have hn_eq : (n + 2) + h = n + h + 2 := by omega + have Hvalue : k1 = 2 ^ h * (4 * 2 ^ n - 12 * 3 ^ h + (12 - d)) := by + have hs1 : k1 + d1 = 2 ^ h * (4 * 2 ^ n) := by + have h0 : 4 * 2 ^ n * 2 ^ (0 + h) = 2 ^ h * (4 * 2 ^ n) := by rw [Nat.zero_add]; ring + (try omega) + have hd1 : d1 + 2 ^ h * b = 2 ^ h * (12 * 3 ^ h) := by + have h0 : 2 ^ (0 + h) * b = 2 ^ h * b := by rw [Nat.zero_add] + have h1 : 12 * 6 ^ (0 + h) = 2 ^ h * (12 * 3 ^ h) := by + rw [Nat.zero_add, pow6 h]; ring + (try omega) + have hb_eq : b = 12 - d := by omega + subst hb_eq + have hdist1 : 2 ^ h * (4 * 2 ^ n - 12 * 3 ^ h + (12 - d)) = + 2 ^ h * (4 * 2 ^ n - 12 * 3 ^ h) + 2 ^ h * (12 - d) := by + rw [Nat.mul_add] + have hdist2 : 2 ^ h * (4 * 2 ^ n - 12 * 3 ^ h) + 2 ^ h * (12 * 3 ^ h) = 2 ^ h * (4 * 2 ^ n) := by + rw [← Nat.mul_add, Nat.sub_add_cancel (by omega)] + (try omega) + rw [hn_eq, Hvalue] at HL + exact ⟨l1, HL, HT⟩ + +theorem Z26 (n : Nat) {l : ListBlank (Fin 2)} (h d : Nat) {r : ListBlank (Fin 2)} + (Hl : LC outer (n + 2) (2 ^ (n + 2) - d) l) (Hr : TC ([1, 1] +> default) h 0 r) + (Hd : d = 2 ∨ d = 6) (HC : 3 * 3 ^ h ≤ 2 ^ n) : + ∃ l' u, LC outer (n + h + 3) (3 + u * 2) l' ∧ 6 + u * 2 ≤ 2 ^ (n + h + 3) ∧ + (RBar l r) [target_tm]⊢⁺ (RBar l' default) := by + rw [TC_zero_unique Hr] + rcases initial26 n h d Hd HC with ⟨b, u, Hb, Hb', Hdb, Hk, Hsum, Hp⟩ + have HS : (2 ^ (n + 2) - d) + d = 4 * 2 ^ n * 2 ^ 0 := by simp [Hsum] + have HD : d + 2 ^ 0 * b = 12 * 6 ^ 0 := by simp [Hdb] + rcases zero_scan h outer (2 ^ n) b ([1, 1] +> default) (n + 2) (2 ^ (n + 2) - d) l 0 d u + Hl Hk HS HD Hp (by omega) (by simpa using HC) + with ⟨l1, k1, d1, u1, HL, HK, HS1, HD1, HP1, HT⟩ + have hs1 : k1 + d1 = 4 * 2 ^ n * 2 ^ h := by simpa using HS1 + have hd1 : d1 + 2 ^ h * b = 12 * 6 ^ h := by simpa using HD1 + have Hpos := zeros_end (2 ^ n) h b k1 d1 HC hs1 hd1 + have hp2 : 1 ≤ 2 ^ h := pow_pos 2 h (by decide) + have hmul : 1 * 6 ≤ 2 ^ h * b := Nat.mul_le_mul hp2 Hb + have hk2 : 2 ≤ k1 := by omega + rcases Read1 default HL hk2 with ⟨l2, k2, u2, HL2, HK2, HP2, HD2, HT2⟩ + have Hbound := LC_bound HL + have hn_eq : 1 + ((n + 2) + h) = n + h + 3 := by omega + have hk_eq : k2 = 3 + (u2 - 1) * 2 := by omega + rw [hn_eq, hk_eq] at HL2 + have hpow : 2 ^ (n + h + 3) = 2 ^ ((n + 2) + h) * 2 := by + have : n + h + 3 = ((n + 2) + h) + 1 := by omega + rw [this, Nat.pow_succ] + have htail : (e1 +> (default : ListBlank (Fin 2))) = ([1, 1] +> default) := by unfold e1; simp + rw [htail] at HT2 + refine ⟨l2, u2 - 1, HL2, ?_, stepStar_stepPlus_stepPlus HT HT2⟩ + (try omega) +theorem after_nonzero (o : ListBlank (Fin 2)) (C j t A n k : Nat) {l : ListBlank (Fin 2)} (u : Nat) + {tail : ListBlank (Fin 2)} {v : Nat} {r : ListBlank (Fin 2)} + (Hr : TC tail t v r) (HE : EndTail tail) (Hl : LC o n k l) (Hk : k = 1 + u * 2) + (Hsum : k + (2 ^ (j + 1) * A + 1) = 2 ^ (j + 1) * (4 * C)) + (HA : A + 6 ≤ 36 * 3 ^ j) (HC : 3 * 3 ^ (j + 1 + t) ≤ C) : + ∃ l' q, LC o (n + t + 1) (3 + q * 2) l' ∧ 6 + q * 2 ≤ 2 ^ (n + t + 1) ∧ + (RBar l r) [target_tm]⊢⁺ (RBar l' default) := by + have HK : k = 2 ^ 0 * (1 + u * 2) := by simpa using Hk + have HS : k + (2 ^ (j + 1) * A + 1) = (2 ^ (j + 1) * (4 * C)) * 2 ^ 0 := by simpa using Hsum + have HB : 2 ^ (j + 1) * A + 6 * 3 ^ (0 + t) ≤ 2 ^ (j + 1) * (4 * C) := + deficit26_budget_scaled C j t (0 + t) A (by omega) HC HA + exact bounded_scan o (2 ^ (j + 1) * (4 * C)) (2 ^ (j + 1) * A) Hr HE n k l 0 + (2 ^ (j + 1) * A + 1) 0 u Hl HK (by omega) HS (by omega) (by simp) HB + +theorem D26 (n : Nat) {l : ListBlank (Fin 2)} (h v : Nat) {r tail : ListBlank (Fin 2)} (d : Nat) + (Hl : LC outer (n + 2) (2 ^ (n + 2) - d) l) (Hr : TC tail h v r) (HE : EndTail tail) + (Hd : d = 2 ∨ d = 6) (Hv : 0 < v) (HC : 3 * 3 ^ h ≤ 2 ^ n) : + ∃ l' u, LC outer (n + h + 3) (3 + u * 2) l' ∧ 6 + u * 2 ≤ 2 ^ (n + h + 3) ∧ + (RBar l r) [target_tm]⊢⁺ (RBar l' default) := by + rcases initial26 n h d Hd HC with ⟨b, u, Hb, Hb', Hdb, Hk, Hsum, Hp⟩ + rcases TC_positive Hr Hv with ⟨j, t, q, s, Hh, HT, ⟨Er, Ev⟩ | ⟨Er, Ev⟩⟩ + · subst Er + have h3mono : 3 ^ j ≤ 3 ^ h := pow_mono 3 j h (by decide) (by omega) + have HCj : 3 * 3 ^ j ≤ 2 ^ n := by omega + have HCt : 3 * 3 ^ (j + 1 + t) ≤ 2 ^ n := by + have : j + 1 + t = h := by omega + rw [this]; exact HC + have HS : (2 ^ (n + 2) - d) + d = 4 * 2 ^ n * 2 ^ 0 := by simp [Hsum] + have HD : d + 2 ^ 0 * b = 12 * 6 ^ 0 := by simp [Hdb] + rcases zero_scan j outer (2 ^ n) b (e1 +> s) (n + 2) (2 ^ (n + 2) - d) l 0 d u + Hl Hk HS HD Hp (by omega) (by simpa using HCj) + with ⟨l1, k1, d1, u1, HL, HK, HS1, HD1, HP1, HT1⟩ + have hp3j : 0 < 3 ^ j := pow_pos 3 j (by decide) + have Hbnd : b ≤ 12 * 3 ^ j := by omega + have hd1 : d1 + 2 ^ j * b = 12 * 6 ^ j := by simpa using HD1 + have Hdef : d1 = 2 ^ j * (12 * 3 ^ j - b) := by + rw [pow6 j] at hd1 + have : 2 ^ j * (12 * 3 ^ j - b) + 2 ^ j * b = 12 * (2 ^ j * 3 ^ j) := by + rw [← Nat.mul_add, Nat.sub_add_cancel Hbnd]; ring + (try omega) + have hs1 : k1 + d1 = 4 * 2 ^ n * 2 ^ j := by simpa using HS1 + have Hg : 4 * 6 ^ (1 + j) < k1 := zeros_guard (2 ^ n) h j b k1 d1 (by omega) HC (by omega) hs1 hd1 + have hp6 : 0 < 6 ^ (1 + j) := pow_pos 6 (1 + j) (by decide) + have hk2 : 2 ≤ k1 := by omega + rcases Read1 s HL hk2 with ⟨l2, k2, u2, HL2, HK2, HP2, HD2, HT2⟩ + have HA : (12 * 3 ^ j - b) + 6 ≤ 36 * 3 ^ j := by omega + have Hsum2 : k2 + (2 ^ (j + 1) * (12 * 3 ^ j - b) + 1) = 2 ^ (j + 1) * (4 * 2 ^ n) := by + have h1 : 2 ^ (j + 1) * (12 * 3 ^ j - b) = 2 * d1 := by + rw [Hdef, Nat.pow_succ]; ring + have h2 : 2 ^ (j + 1) * (4 * 2 ^ n) = 2 * (4 * 2 ^ n * 2 ^ j) := by + rw [Nat.pow_succ]; ring + (try omega) + rcases after_nonzero outer (2 ^ n) j t (12 * 3 ^ j - b) (1 + (n + 2 + j)) k2 u2 + HT HE HL2 HK2 Hsum2 HA HCt with ⟨l3, w, HL3, HB3, HT3⟩ + have hn_eq : (1 + (n + 2 + j)) + t + 1 = n + h + 3 := by omega + rw [hn_eq] at HL3 HB3 + exact ⟨l3, w, HL3, HB3, stepStar_stepPlus_stepPlus HT1 (HT2 ⋙ HT3)⟩ + · subst Er + have h3mono : 3 ^ j ≤ 3 ^ h := pow_mono 3 j h (by decide) (by omega) + have HCj : 3 * 3 ^ j ≤ 2 ^ n := by omega + have HCt : 3 * 3 ^ (j + 1 + t) ≤ 2 ^ n := by + have : j + 1 + t = h := by omega + rw [this]; exact HC + have HS : (2 ^ (n + 2) - d) + d = 4 * 2 ^ n * 2 ^ 0 := by simp [Hsum] + have HD : d + 2 ^ 0 * b = 12 * 6 ^ 0 := by simp [Hdb] + rcases zero_scan j outer (2 ^ n) b (e2 +> s) (n + 2) (2 ^ (n + 2) - d) l 0 d u + Hl Hk HS HD Hp (by omega) (by simpa using HCj) + with ⟨l1, k1, d1, u1, HL, HK, HS1, HD1, HP1, HT1⟩ + have hp3j : 0 < 3 ^ j := pow_pos 3 j (by decide) + have Hbnd : b ≤ 12 * 3 ^ j := by omega + have hd1 : d1 + 2 ^ j * b = 12 * 6 ^ j := by simpa using HD1 + have Hdef : d1 = 2 ^ j * (12 * 3 ^ j - b) := by + rw [pow6 j] at hd1 + have : 2 ^ j * (12 * 3 ^ j - b) + 2 ^ j * b = 12 * (2 ^ j * 3 ^ j) := by + rw [← Nat.mul_add, Nat.sub_add_cancel Hbnd]; ring + (try omega) + have hs1 : k1 + d1 = 4 * 2 ^ n * 2 ^ j := by simpa using HS1 + have Hg : 4 * 6 ^ (1 + j) < k1 := zeros_guard (2 ^ n) h j b k1 d1 (by omega) HC (by omega) hs1 hd1 + have HK' : k1 = 2 ^ (1 + j) * (1 + u1 * 2) := by simpa using HK + rcases Read2 (1 + j) u1 s HL HK' Hg with ⟨l2, k2, u2, HL2, HK2, HP2, HD2, HT2⟩ + have hcost : cost (1 + j) = 8 * 6 ^ (1 + j) := by + have : 1 + j = j + 1 := by omega + rw [this]; rfl + rw [hcost] at HD2 + have HA : (36 * 3 ^ j - b) + 6 ≤ 36 * 3 ^ j := by omega + have Hsum2 : k2 + (2 ^ (j + 1) * (36 * 3 ^ j - b) + 1) = 2 ^ (j + 1) * (4 * 2 ^ n) := by + have hsub : 36 * 3 ^ j - b = (12 * 3 ^ j - b) + 24 * 3 ^ j := by omega + have h1 : 2 ^ (j + 1) * (36 * 3 ^ j - b) = 2 * d1 + 8 * 6 ^ (1 + j) := by + rw [hsub, Nat.mul_add, Hdef, Nat.add_comm 1 j, pow6 (j + 1), Nat.pow_succ, Nat.pow_succ] + ring + have h2 : 2 ^ (j + 1) * (4 * 2 ^ n) = 2 * (4 * 2 ^ n * 2 ^ j) := by + rw [Nat.pow_succ]; ring + (try omega) + rcases after_nonzero outer (2 ^ n) j t (36 * 3 ^ j - b) (1 + (n + 2 + j)) k2 u2 + HT HE HL2 HK2 Hsum2 HA HCt with ⟨l3, w, HL3, HB3, HT3⟩ + have hn_eq : (1 + (n + 2 + j)) + t + 1 = n + h + 3 := by omega + rw [hn_eq] at HL3 HB3 + exact ⟨l3, w, HL3, HB3, stepStar_stepPlus_stepPlus HT1 (HT2 ⋙ HT3)⟩ + +-- ============================================================================ +-- Section 14: Pair7Power (SOCMisc.v lines 7865-7957) +-- ============================================================================ + +theorem PowerStart (m h : Nat) {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) + (Hg : 3 ^ (1 + h) ≤ 2 ^ m) (H : LC outer (m + h + 2) (2 ^ (1 + h)) l) : + ∃ l', LC outer (m + 2) (2 ^ (m + 2) - 6) l' ∧ + (RBar l ([0, 0] +> r)) [target_tm]⊢⁺ (RBar l' ((e0 ^ h) +> (e1 +> r))) := by + have h3_le : 3 ≤ 3 ^ (1 + h) := by + have := pow_mono 3 1 (1 + h) (by decide) (by omega) + simpa using this + have H3 : 3 ≤ 2 ^ m := by omega + have HC : LC outer (m + 1 + (1 + h)) (2 ^ (1 + h)) l := by + have : m + 1 + (1 + h) = m + h + 2 := by omega + rw [this]; exact H + rcases LC_R0power ([0] +> r) HC with ⟨l1, h1, s1⟩ + rcases LC_R111 ((e0 ^ (1 + h)) +> (e1 +> r)) h1 with ⟨l2, h2, s2⟩ + have HC2 : LC outer (1 + m) (3 + (2 ^ m - 2) * 2) l2 := by + have hk : 1 + (2 ^ m - 1) * 2 = 3 + (2 ^ m - 2) * 2 := by omega + rw [hk] at h2; exact h2 + rcases Odd000 ((e0 ^ h) +> (e1 +> r)) HC2 with ⟨l3, h3', s3⟩ + have hn : 2 + m = m + 2 := by omega + have hk3 : 2 + (2 ^ m - 2) * 4 = 2 ^ (m + 2) - 6 := by + have : 2 ^ (m + 2) = 2 ^ m * 4 := by rw [Nat.pow_add] + (try omega) + rw [hn, hk3] at h3' + have hr0 : ([0] +> ([0] +> r)) = ([0, 0] +> r) := rfl + rw [hr0] at s1 + have hr1 : ([1, 1] +> ([0] +> r)) = (e1 +> r) := rfl + rw [hr1] at s1 + have hr2 : (e0 +> ((e0 ^ h) +> (e1 +> r))) = ((e0 ^ (1 + h)) +> (e1 +> r)) := by + rw [Nat.add_comm 1 h, pow_succ_list, append_assoc_lb] + rw [hr2] at s3 + exact ⟨l3, h3', s1 ⋙ s2 ⋙ s3⟩ + +theorem PowerZeros (m j t : Nat) {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) + (Hg : 3 ^ (1 + j + t) ≤ 2 ^ m) + (H : LC outer (m + j + 2) (2 ^ (1 + j) * (1 + (2 ^ m - 3 ^ (1 + j) + 1) * 2)) l) : + ∃ l', LC outer (m + j + t + 2) (2 ^ (1 + j + t) * (1 + (2 ^ m - 3 ^ (1 + j + t) + 1) * 2)) l' ∧ + (RBar l ((e0 ^ t) +> (e1 +> r))) [target_tm]⊢* (RBar l' (e1 +> r)) := by + induction t generalizing j l with + | zero => + exact ⟨l, H, ⟨0, rfl⟩⟩ + | succ t ih => + have h3mono : 3 ^ (2 + j) ≤ 3 ^ (1 + j + (t + 1)) := pow_mono 3 (2 + j) (1 + j + (t + 1)) (by decide) (by omega) + have Hj : 3 ^ (2 + j) ≤ 2 ^ m := by omega + have Hu : 2 * 3 ^ (1 + j) + (2 ^ m - 3 ^ (2 + j) + 1) = 2 ^ m - 3 ^ (1 + j) + 1 := by + have : 3 ^ (2 + j) = 3 ^ (1 + j) * 3 := by + have : 2 + j = (1 + j) + 1 := by omega + rw [this, Nat.pow_succ] + (try omega) + have HC : LC outer (m + j + 2) (2 ^ (1 + j) * (1 + (2 * 3 ^ (1 + j) + (2 ^ m - 3 ^ (2 + j) + 1)) * 2)) l := by + rw [Hu]; exact H + rcases Even000 ((e0 ^ t) +> (e1 +> r)) HC with ⟨l1, h1, s1⟩ + have HC1 : LC outer (m + (1 + j) + 2) (2 ^ (1 + (1 + j)) * (1 + (2 ^ m - 3 ^ (1 + (1 + j)) + 1) * 2)) l1 := by + have hn : m + j + 3 = m + (1 + j) + 2 := by omega + have hj : 2 + j = 1 + (1 + j) := by omega + rw [hn, hj] at h1; exact h1 + have Hg1 : 3 ^ (1 + (1 + j) + t) ≤ 2 ^ m := by + have : 1 + (1 + j) + t = 1 + j + (t + 1) := by omega + rw [this]; exact Hg + rcases ih (1 + j) Hg1 HC1 with ⟨l2, h2, s2⟩ + have hn2 : m + (1 + j) + t + 2 = m + j + (t + 1) + 2 := by omega + have hj2 : 1 + (1 + j) + t = 1 + j + (t + 1) := by omega + rw [hn2, hj2] at h2 + have hr : ((e0 ^ (t + 1)) +> (e1 +> r)) = (e0 +> ((e0 ^ t) +> (e1 +> r))) := by + rw [pow_succ_list, append_assoc_lb] + rw [hr] + exact ⟨l2, h2, stepPlus_stepStar (stepPlus_stepStar_stepPlus s1 s2)⟩ + +theorem Power (m h : Nat) {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) + (Hg : 3 ^ (1 + h) ≤ 2 ^ m) (H : LC outer (m + h + 2) (2 ^ (1 + h)) l) : + ∃ l', LC outer (m + h + 3) (2 ^ (2 + h) * (2 ^ (m + 1) - 2 * 3 ^ (1 + h) + 3) - 1) l' ∧ + (RBar l ([0, 0] +> r)) [target_tm]⊢⁺ (RBar l' r) := by + rcases PowerStart m h r Hg H with ⟨l1, h1, s1⟩ + have h3_le : 3 ≤ 3 ^ (1 + h) := by + have := pow_mono 3 1 (1 + h) (by decide) (by omega) + simpa using this + have H3 : 3 ≤ 2 ^ m := by omega + have HC : LC outer (m + 0 + 2) (2 ^ (1 + 0) * (1 + (2 ^ m - 3 ^ (1 + 0) + 1) * 2)) l1 := by + have hk : 2 ^ (m + 2) - 6 = 2 ^ (1 + 0) * (1 + (2 ^ m - 3 ^ (1 + 0) + 1) * 2) := by + have : 2 ^ (m + 2) = 2 ^ m * 4 := by rw [Nat.pow_add] + simp [this]; omega + rw [← hk]; exact h1 + have Hg0 : 3 ^ (1 + 0 + h) ≤ 2 ^ m := by simpa using Hg + rcases PowerZeros m 0 h r Hg0 HC with ⟨l2, h2, s2⟩ + have hp2 : 0 < 2 ^ (1 + 0 + h) := pow_pos 2 (1 + 0 + h) (by decide) + have Hp : 0 < 2 ^ (1 + 0 + h) * (1 + (2 ^ m - 3 ^ (1 + 0 + h) + 1) * 2) := + Nat.mul_pos hp2 (by omega) + rcases LC_R110 r h2 Hp with ⟨l3, h4, s3⟩ + have hn : 1 + (m + 0 + h + 2) = m + h + 3 := by omega + have hk4 : (2 ^ (1 + 0 + h) * (1 + (2 ^ m - 3 ^ (1 + 0 + h) + 1) * 2)) * 2 - 1 = + 2 ^ (2 + h) * (2 ^ (m + 1) - 2 * 3 ^ (1 + h) + 3) - 1 := by + have h1 : 1 + 0 + h = 1 + h := by omega + rw [h1] + have h_inner : 1 + (2 ^ m - 3 ^ (1 + h) + 1) * 2 = 2 ^ (m + 1) - 2 * 3 ^ (1 + h) + 3 := by + rw [Nat.pow_succ]; omega + have h_outer : 2 ^ (2 + h) = 2 ^ (1 + h) * 2 := by + have : 2 + h = (1 + h) + 1 := by omega + rw [this, Nat.pow_succ] + rw [h_inner, h_outer] + have h_comm : 2 ^ (1 + h) * (2 ^ (m + 1) - 2 * 3 ^ (1 + h) + 3) * 2 = + 2 ^ (1 + h) * 2 * (2 ^ (m + 1) - 2 * 3 ^ (1 + h) + 3) := by ring + rw [h_comm] + rw [hn, hk4] at h4 + exact ⟨l3, h4, (stepPlus_stepStar_stepPlus s1 s2) ⋙ s3⟩ + +theorem Power_Bo (m h : Nat) {l : ListBlank (Fin 2)} (r : ListBlank (Fin 2)) + (Hg : 3 ^ (1 + h) ≤ 2 ^ m) (H : LC outer (m + h + 2) (2 ^ (1 + h)) l) : + ∃ l' v, LC outer (m + h + 3) (3 + v * 2) l' ∧ + 6 + v * 2 ≤ 2 ^ (m + h + 3) ∧ (RBar l ([0, 0] +> r)) [target_tm]⊢⁺ (RBar l' r) := by + rcases Power m h r Hg H with ⟨l', HC, HS⟩ + rcases power_exit m (1 + h) (by omega) Hg with ⟨Hlo, Hhi⟩ + have h2h : 1 + h + 1 = 2 + h := by omega + have hmh : m + (1 + h) + 2 = m + h + 3 := by omega + rw [h2h] at Hlo Hhi + rw [hmh] at Hhi + have h_pow : 2 ^ (2 + h) * (2 ^ (m + 1) - 2 * 3 ^ (1 + h) + 3) = + (2 ^ (1 + h) * (2 ^ (m + 1) - 2 * 3 ^ (1 + h) + 3)) * 2 := by + have : 2 ^ (2 + h) = 2 ^ (1 + h) * 2 := by + have : 2 + h = (1 + h) + 1 := by omega + rw [this, Nat.pow_succ] + rw [this]; ring + have He : 2 ^ (2 + h) * (2 ^ (m + 1) - 2 * 3 ^ (1 + h) + 3) - 1 = + 3 + (2 ^ (1 + h) * (2 ^ (m + 1) - 2 * 3 ^ (1 + h) + 3) - 2) * 2 := by + (try omega) + rw [He] at HC + refine ⟨l', 2 ^ (1 + h) * (2 ^ (m + 1) - 2 * 3 ^ (1 + h) + 3) - 2, HC, ?_, HS⟩ + (try omega) +-- ============================================================================ +-- Section 15: Pair7Closure (SOCMisc.v lines 7960-8053) +-- ============================================================================ + +inductive Allowed : Cfg (Fin 2) (Fin 6) → Prop where + | Bo (n v : Nat) (l : ListBlank (Fin 2)) : + LC outer n (3 + v * 2) l → 6 + v * 2 ≤ 2 ^ n → Allowed (RBar l default) + | Be (m a u : Nat) (l : ListBlank (Fin 2)) : + LC outer (m + a + 2) (2 ^ (1 + a) * (1 + u * 2)) l → + u + 3 ^ (1 + a) ≤ 2 ^ m → Allowed (RBar l default) + | S11 (n k h v : Nat) (l r : ListBlank (Fin 2)) : + LC outer n k l → TC ([1, 1] +> default) h v r → + k + v * 3 + 3 * 3 ^ h + 1 ≤ 2 ^ n → Allowed (QBar l (e0 +> r)) + | S01 (n k h v : Nat) (l r : ListBlank (Fin 2)) : + LC outer n k l → TC ([0, 1] +> default) h v r → + k + v * 3 + 6 * 3 ^ h + 1 ≤ 2 ^ n → Allowed (QBar l (e0 +> r)) + +theorem Bo_step (n v : Nat) (l : ListBlank (Fin 2)) + (Hl : LC outer n (3 + v * 2) l) (Hg : 6 + v * 2 ≤ 2 ^ n) : + ∃ c', ((RBar l default) [target_tm]⊢⁺ c') ∧ Allowed c' := by + cases n with + | zero => omega + | succ m => + have Hl' : LC outer (1 + m) (3 + v * 2) l := by + have : 1 + m = m + 1 := by omega + rw [this]; exact Hl + rcases Odd000 default Hl' with ⟨l', HC, HS⟩ + have hr : (e0 +> (default : ListBlank (Fin 2))) = default := by unfold e0; simp + rw [hr] at HS + have hn : 2 + m = m + 0 + 2 := by omega + have hk : 2 + v * 4 = 2 ^ (1 + 0) * (1 + v * 2) := by simp; omega + rw [hn, hk] at HC + refine ⟨RBar l' default, HS, Allowed.Be m 0 v l' HC ?_⟩ + have : 2 ^ (m + 1) = 2 ^ m * 2 := by rw [Nat.pow_succ] + simp at *; omega + +theorem Be_step (m a u : Nat) (l : ListBlank (Fin 2)) + (Hl : LC outer (m + a + 2) (2 ^ (1 + a) * (1 + u * 2)) l) (Hg : u + 3 ^ (1 + a) ≤ 2 ^ m) : + ∃ c', ((RBar l default) [target_tm]⊢⁺ c') ∧ Allowed c' := by + cases u with + | zero => + have HC : LC outer (m + a + 2) (2 ^ (1 + a)) l := by simpa using Hl + rcases Power_Bo m a default (by omega) HC with ⟨l', v, H1, H2, HS⟩ + have hr : ([0, 0] +> (default : ListBlank (Fin 2))) = default := by simp + rw [hr] at HS + exact ⟨RBar l' default, HS, Allowed.Bo (m + a + 3) v l' H1 H2⟩ + | succ u => + have HC : LC outer (m + 1 + (1 + a)) (2 ^ (1 + a) * (1 + (1 + u) * 2)) l := by + have hn : m + 1 + (1 + a) = m + a + 2 := by omega + have hu : 1 + u = u + 1 := by omega + rw [hn, hu]; exact Hl + rcases LC_R0positive default HC with ⟨l', H1, HS⟩ + have hr0 : ([0] +> (default : ListBlank (Fin 2))) = default := by simp + rw [hr0] at HS + have hr1 : (RBar l' ([1, 1] +> ((e0 ^ (1 + a)) +> ([1, 1] +> default)))) = + (QBar l' (e0 +> ((e0 ^ a) +> ([1, 1] +> default)))) := by + unfold QBar + rw [Nat.add_comm 1 a, pow_succ_list, append_assoc_lb] + rw [hr1] at HS + refine ⟨QBar l' (e0 +> ((e0 ^ a) +> ([1, 1] +> default))), HS, + Allowed.S11 m u a 0 l' ((e0 ^ a) +> ([1, 1] +> default)) H1 (TC_zero ([1, 1] +> default) a) ?_⟩ + have : 3 ^ (1 + a) = 3 * 3 ^ a := by rw [Nat.add_comm 1 a, Nat.pow_succ]; ring + (try omega) +theorem S01_exit (n k h : Nat) (l r : ListBlank (Fin 2)) + (Hl : LC outer n (2 + k) l) (Hr : TC ([0, 1] +> default) h (3 ^ h - 1) r) + (Hg : 2 + k + (3 ^ h - 1) * 3 + 6 * 3 ^ h + 1 ≤ 2 ^ n) : + ∃ c', ((QBar l (e0 +> r)) [target_tm]⊢⁺ c') ∧ Allowed c' := by + have hp : 0 < 3 ^ h := pow_pos 3 h (by decide) + have HC : LC outer n (3 * (3 ^ h - (3 ^ h - 1)) - 1 + k) l := by + have : 3 * (3 ^ h - (3 ^ h - 1)) - 1 + k = 2 + k := by omega + rw [this]; exact Hl + rcases TC_exit default HC Hr with ⟨l1, H1, S1⟩ + rcases LC_R100 default H1 with ⟨l2, H2, S2⟩ + have hr1 : ([1, 0, 0] +> (default : ListBlank (Fin 2))) = ([1] +> default) := by simp + rw [hr1] at S2 + have hn : 1 + (n + h + 2) = n + (1 + h) + 2 := by omega + have hk : ((1 + k * 2) * 2 ^ (1 + h)) * 2 = 2 ^ (1 + (1 + h)) * (1 + k * 2) := by + have : 1 + (1 + h) = (1 + h) + 1 := by omega + rw [this, Nat.pow_succ]; ring + rw [hn, hk] at H2 + refine ⟨RBar l2 default, S1 ⋙ S2, Allowed.Be n (1 + h) k l2 H2 ?_⟩ + have : 3 ^ (1 + (1 + h)) = 9 * 3 ^ h := by + have : 1 + (1 + h) = h + 2 := by omega + rw [this, Nat.pow_add]; ring + (try omega) +theorem S11_step (n k h v : Nat) (l r : ListBlank (Fin 2)) + (Hl : LC outer n (3 + k) l) (Hr : TC ([1, 1] +> default) h v r) + (Hg : 3 + k + v * 3 + 3 * 3 ^ h + 1 ≤ 2 ^ n) : + ∃ c', ((QBar l (e0 +> r)) [target_tm]⊢⁺ c') ∧ Allowed c' := by + by_cases Hv : v + 1 < 3 ^ h + · rcases TC_next Hl Hr Hv with ⟨l', r', HC, HT, HS⟩ + exact ⟨QBar l' (e0 +> r'), HS, Allowed.S11 n k h (v + 1) l' r' HC HT (by omega)⟩ + · have hb := TC_bound Hr + have Ev : v = 3 ^ h - 1 := by omega + subst Ev + have HC : LC outer n (3 * (3 ^ h - (3 ^ h - 1)) + k) l := by + have : 3 * (3 ^ h - (3 ^ h - 1)) + k = 3 + k := by omega + rw [this]; exact Hl + rcases TC_first default HC Hr with ⟨l', H1, HS⟩ + exact ⟨QBar l' (e0 +> ((e0 ^ h) +> ([0, 1] +> default))), HS, + Allowed.S01 n k h 0 l' ((e0 ^ h) +> ([0, 1] +> default)) H1 (TC_zero ([0, 1] +> default) h) (by omega)⟩ + +theorem S01_step (n k h v : Nat) (l r : ListBlank (Fin 2)) + (Hl : LC outer n (3 + k) l) (Hr : TC ([0, 1] +> default) h v r) + (Hg : 3 + k + v * 3 + 6 * 3 ^ h + 1 ≤ 2 ^ n) : + ∃ c', ((QBar l (e0 +> r)) [target_tm]⊢⁺ c') ∧ Allowed c' := by + by_cases Hv : v + 1 < 3 ^ h + · rcases TC_next Hl Hr Hv with ⟨l', r', HC, HT, HS⟩ + exact ⟨QBar l' (e0 +> r'), HS, Allowed.S01 n k h (v + 1) l' r' HC HT (by omega)⟩ + · have hb := TC_bound Hr + have Ev : v = 3 ^ h - 1 := by omega + subst Ev + have Hl' : LC outer n (2 + (1 + k)) l := by + have : 2 + (1 + k) = 3 + k := by omega + rw [this]; exact Hl + exact S01_exit n (1 + k) h l r Hl' Hr (by omega) + +-- ============================================================================ +-- Section 16: Pair7LowReturn & Nonhalt (SOCMisc.v lines 8056-8259) +-- ============================================================================ + +theorem Good0 (n : Nat) {l : ListBlank (Fin 2)} (h v : Nat) {r tail : ListBlank (Fin 2)} + (Hl : LC outer n 0 l) (Hr : TC tail h v r) (HE : EndTail tail) + (Hv : 0 < v) (HC : 3 * 3 ^ h ≤ 2 ^ n) : + ∃ l' u, LC outer (n + h + 3) (3 + u * 2) l' ∧ 6 + u * 2 ≤ 2 ^ (n + h + 3) ∧ + (QBar l (e0 +> r)) [target_tm]⊢⁺ (RBar l' default) := by + rcases clear0 r Hl with ⟨l1, H1, S1⟩ + rcases D26 n h v 2 H1 Hr HE (Or.inl rfl) Hv HC with ⟨l2, u, H2, H3, S2⟩ + exact ⟨l2, u, H2, H3, S1 ⋙ S2⟩ + +theorem Good1 (n : Nat) {l : ListBlank (Fin 2)} (h v : Nat) {r tail : ListBlank (Fin 2)} + (Hl : LC outer n 1 l) (Hr : TC tail h v r) (HE : EndTail tail) + (HC : 3 * 3 ^ h ≤ 2 ^ n) : + ∃ l' u, LC outer (n + h + 3) (3 + u * 2) l' ∧ 6 + u * 2 ≤ 2 ^ (n + h + 3) ∧ + (QBar l (e0 +> r)) [target_tm]⊢⁺ (RBar l' default) := by + rcases clear1 r Hl with ⟨l1, H1, S1⟩ + rcases D3 n h v H1 Hr HE HC with ⟨l2, u, H2, H3, S2⟩ + exact ⟨l2, u, H2, H3, S1 ⋙ S2⟩ + +theorem Good2 (n : Nat) {l : ListBlank (Fin 2)} (h v : Nat) {r tail : ListBlank (Fin 2)} + (Hl : LC outer n 2 l) (Hr : TC tail h v r) (HE : EndTail tail) + (Hv : v + 1 < 3 ^ h) (HC : 3 * 3 ^ h ≤ 2 ^ n) : + ∃ l' u, LC outer (n + h + 3) (3 + u * 2) l' ∧ 6 + u * 2 ≤ 2 ^ (n + h + 3) ∧ + (QBar l (e0 +> r)) [target_tm]⊢⁺ (RBar l' default) := by + rcases clear2 Hl Hr Hv with ⟨l1, r1, H1, T1, S1⟩ + rcases D26 n h (v + 1) 6 H1 T1 HE (Or.inr rfl) (by omega) HC with ⟨l2, u, H2, H3, S2⟩ + exact ⟨l2, u, H2, H3, S1 ⋙ S2⟩ + +theorem Zero11 (n : Nat) {l : ListBlank (Fin 2)} (h : Nat) {r : ListBlank (Fin 2)} + (Hl : LC outer n 0 l) (Hr : TC ([1, 1] +> default) h 0 r) (HC : 3 * 3 ^ h ≤ 2 ^ n) : + ∃ l' u, LC outer (n + h + 3) (3 + u * 2) l' ∧ 6 + u * 2 ≤ 2 ^ (n + h + 3) ∧ + (QBar l (e0 +> r)) [target_tm]⊢⁺ (RBar l' default) := by + rcases clear0 r Hl with ⟨l1, H1, S1⟩ + rcases Z26 n h 2 H1 Hr (Or.inl rfl) HC with ⟨l2, u, H2, H3, S2⟩ + exact ⟨l2, u, H2, H3, S1 ⋙ S2⟩ + +theorem RemainderReturn (n h q b : Nat) {l : ListBlank (Fin 2)} + (Hl : LC outer n (3 * q + b) l) (Hb : b ≤ 2) (Hq : q < 3 ^ h) + (H0 : b = 0 → 0 < q) (H2 : b = 2 → q + 1 < 3 ^ h) (HC : 3 * 3 ^ h ≤ 2 ^ n) : + ∃ l' u, LC outer (n + h + 3) (3 + u * 2) l' ∧ 6 + u * 2 ≤ 2 ^ (n + h + 3) ∧ + (QBar l (e0 +> ((e0 ^ h) +> ([0, 1, 1, 0] +> default)))) [target_tm]⊢⁺ (RBar l' default) := by + rcases TC_steps q Hl (TC_zero ([0, 1, 1, 0] +> default) h) (by omega) with ⟨l1, r1, H1, T1, S1⟩ + have h0q : 0 + q = q := by omega + rw [h0q] at T1 + have HR : ∃ l' u, LC outer (n + h + 3) (3 + u * 2) l' ∧ 6 + u * 2 ≤ 2 ^ (n + h + 3) ∧ + (QBar l1 (e0 +> r1)) [target_tm]⊢⁺ (RBar l' default) := by + rcases b with _ | _ | b + · exact Good0 n h q H1 T1 EndTail.End0110 (H0 rfl) HC + · exact Good1 n h q H1 T1 EndTail.End0110 HC + · have hb0 : b = 0 := by omega + subst hb0 + exact Good2 n h q H1 T1 EndTail.End0110 (H2 rfl) HC + rcases HR with ⟨l2, u, HL, HG, HS⟩ + exact ⟨l2, u, HL, HG, stepStar_stepPlus_stepPlus S1 HS⟩ + +theorem remaining_safe (n h p : Nat) (Hp : p ≤ 1) (HC : 6 * 3 ^ h + p ≤ 2 ^ n) (HT : 2 ^ n + 1 + p < 9 * 3 ^ h) : + ∃ q b, 2 ^ n - 6 * 3 ^ h + p = 3 * q + b ∧ b ≤ 2 ∧ q < 3 ^ h ∧ + (b = 0 → 0 < q) ∧ (b = 2 → q + 1 < 3 ^ h) := by + cases p with + | zero => + rcases hard2_remainder n h (by omega) (by omega) with ⟨q, ⟨HQ, Hq⟩ | ⟨HQ, Hq⟩⟩ + · refine ⟨q, 1, ?_, ?_, Hq, ?_, ?_⟩ <;> omega + · refine ⟨q, 2, ?_, ?_, ?_, ?_, ?_⟩ <;> omega + | succ p => + have hp0 : p = 0 := by omega + subst hp0 + rcases hard0_remainder n h (by omega) (by omega) with ⟨q, ⟨HQ, Hq, Hq'⟩ | ⟨HQ, Hq⟩⟩ + · refine ⟨q, 0, ?_, ?_, Hq', ?_, ?_⟩ <;> omega + · refine ⟨q, 2, ?_, ?_, ?_, ?_, ?_⟩ <;> omega + +theorem HardScan (n h p : Nat) {l : ListBlank (Fin 2)} + (Hp : p ≤ 1) (HC : 6 * 3 ^ h + p ≤ 2 ^ n) + (Hl : LC outer (n + 2) (2 ^ (n + 2) - (6 - 4 * p)) l) : + ∃ l' u, LC outer (n + h + 3) (3 + u * 2) l' ∧ 6 + u * 2 ≤ 2 ^ (n + h + 3) ∧ + (RBar l ((e0 ^ h) +> ([0, 1] +> default))) [target_tm]⊢⁺ (RBar l' default) := by + have Hd : 6 - 4 * p = 2 ∨ 6 - 4 * p = 6 := by omega + have HC3 : 3 * 3 ^ h ≤ 2 ^ n := by omega + rcases Zero26 n h (6 - 4 * p) ([0, 1] +> default) Hd HC3 Hl with ⟨l1, H1, S1⟩ + have HK : 2 ^ h * (4 * 2 ^ n - 12 * 3 ^ h + (12 - (6 - 4 * p))) = + 2 ^ (1 + h) * (1 + (2 ^ n - 3 * 3 ^ h + 1 + p) * 2) := by + have h1 : 4 * 2 ^ n - 12 * 3 ^ h + (12 - (6 - 4 * p)) = 2 * (1 + (2 ^ n - 3 * 3 ^ h + 1 + p) * 2) := by omega + have h2 : 2 ^ (1 + h) = 2 ^ h * 2 := by rw [Nat.add_comm 1 h, Nat.pow_succ] + rw [h1, h2] + ring + by_cases HT : 9 * 3 ^ h ≤ 2 ^ n + 1 + p + · have HG : 4 * 6 ^ (1 + h) < 2 ^ h * (4 * 2 ^ n - 12 * 3 ^ h + (12 - (6 - 4 * p))) := by + rw [HK] + apply (normal_budget (1 + h) (2 ^ n - 3 * 3 ^ h + 1 + p)).mpr + have : 3 ^ (1 + h) = 3 * 3 ^ h := by rw [Nat.add_comm 1 h, Nat.pow_succ]; ring + (try omega) + rcases terminal (1 + h) (2 ^ n - 3 * 3 ^ h + 1 + p) EndTail.End01 H1 HK HG with ⟨l2, u, HL, HB, HS⟩ + have hn_eq : (n + h + 2) + 1 = n + h + 3 := by omega + rw [hn_eq] at HL HB + exact ⟨l2, u, HL, HB, stepStar_stepPlus_stepPlus S1 HS⟩ + · have HT' : 2 ^ n + 1 + p < 9 * 3 ^ h := by omega + have HB : LC outer (n + h + 2) (2 ^ (1 + h) * (1 + (1 + 3 * 3 ^ h + (2 ^ n - 6 * 3 ^ h + p)) * 2)) l1 := by + have hk_eq : 2 ^ h * (4 * 2 ^ n - 12 * 3 ^ h + (12 - (6 - 4 * p))) = + 2 ^ (1 + h) * (1 + (1 + 3 * 3 ^ h + (2 ^ n - 6 * 3 ^ h + p)) * 2) := by + rw [HK] + have : 1 + 3 * 3 ^ h + (2 ^ n - 6 * 3 ^ h + p) = 2 ^ n - 3 * 3 ^ h + 1 + p := by omega + rw [this] + rw [← hk_eq]; exact H1 + rcases HardEntry n h (2 ^ n - 6 * 3 ^ h + p) HB with ⟨l2, H2, S2⟩ + rcases remaining_safe n h p Hp HC HT' with ⟨q, b, HQ, Hb, Hq, H0, Htwo⟩ + have HL : LC outer n (3 * q + b) l2 := by rw [← HQ]; exact H2 + rcases RemainderReturn n h q b HL Hb Hq H0 Htwo HC3 with ⟨l3, u, H3, H4, S3⟩ + exact ⟨l3, u, H3, H4, stepStar_stepPlus_stepPlus S1 (S2 ⋙ S3)⟩ + +theorem Hard0 (n : Nat) {l : ListBlank (Fin 2)} (h : Nat) {r : ListBlank (Fin 2)} + (Hl : LC outer n 0 l) (Hr : TC ([0, 1] +> default) h 0 r) (HC : 6 * 3 ^ h + 1 ≤ 2 ^ n) : + ∃ l' u, LC outer (n + h + 3) (3 + u * 2) l' ∧ 6 + u * 2 ≤ 2 ^ (n + h + 3) ∧ + (QBar l (e0 +> r)) [target_tm]⊢⁺ (RBar l' default) := by + rw [TC_zero_unique Hr] + rcases clear0 ((e0 ^ h) +> ([0, 1] +> default)) Hl with ⟨l1, H1, S1⟩ + rcases HardScan n h 1 (by omega) HC H1 with ⟨l2, u, H2, H3, S2⟩ + exact ⟨l2, u, H2, H3, S1 ⋙ S2⟩ + +theorem Hard2 (n : Nat) {l : ListBlank (Fin 2)} (h : Nat) {r : ListBlank (Fin 2)} + (Hl : LC outer n 2 l) (Hr : TC ([1, 1] +> default) h (3 ^ h - 1) r) (HC : 6 * 3 ^ h ≤ 2 ^ n) : + ∃ l' u, LC outer (n + h + 3) (3 + u * 2) l' ∧ 6 + u * 2 ≤ 2 ^ (n + h + 3) ∧ + (QBar l (e0 +> r)) [target_tm]⊢⁺ (RBar l' default) := by + rcases clear2_full default Hl Hr with ⟨l1, r1, H1, T1, S1⟩ + rw [TC_zero_unique T1] at S1 + rcases HardScan n h 0 (by omega) (by omega) H1 with ⟨l2, u, H2, H3, S2⟩ + exact ⟨l2, u, H2, H3, S1 ⋙ S2⟩ + +theorem Bo_return (n : Nat) (c : Cfg (Fin 2) (Fin 6)) + (H : ∃ l u, LC outer n (3 + u * 2) l ∧ 6 + u * 2 ≤ 2 ^ n ∧ c [target_tm]⊢⁺ (RBar l default)) : + ∃ c', (c [target_tm]⊢⁺ c') ∧ Allowed c' := by + rcases H with ⟨l, u, Hl, Hg, HS⟩ + exact ⟨RBar l default, HS, Allowed.Bo n u l Hl Hg⟩ + +theorem S11_all (n k h v : Nat) (l r : ListBlank (Fin 2)) + (Hl : LC outer n k l) (Hr : TC ([1, 1] +> default) h v r) + (Hg : k + v * 3 + 3 * 3 ^ h + 1 ≤ 2 ^ n) : + ∃ c', ((QBar l (e0 +> r)) [target_tm]⊢⁺ c') ∧ Allowed c' := by + rcases k with _ | _ | _ | k + · cases v with + | zero => exact Bo_return (n + h + 3) _ (Zero11 n h Hl Hr (by omega)) + | succ v => exact Bo_return (n + h + 3) _ (Good0 n h (v + 1) Hl Hr EndTail.End11 (by omega) (by omega)) + · exact Bo_return (n + h + 3) _ (Good1 n h v Hl Hr EndTail.End11 (by omega)) + · by_cases Hv : v + 1 < 3 ^ h + · exact Bo_return (n + h + 3) _ (Good2 n h v Hl Hr EndTail.End11 Hv (by omega)) + · have hb := TC_bound Hr + have Ev : v = 3 ^ h - 1 := by omega + subst Ev + exact Bo_return (n + h + 3) _ (Hard2 n h Hl Hr (by omega)) + · have Hl' : LC outer n (3 + k) l := by + have : 3 + k = k + 3 := by omega + rw [this]; exact Hl + exact S11_step n k h v l r Hl' Hr (by omega) + +theorem S01_all (n k h v : Nat) (l r : ListBlank (Fin 2)) + (Hl : LC outer n k l) (Hr : TC ([0, 1] +> default) h v r) + (Hg : k + v * 3 + 6 * 3 ^ h + 1 ≤ 2 ^ n) : + ∃ c', ((QBar l (e0 +> r)) [target_tm]⊢⁺ c') ∧ Allowed c' := by + rcases k with _ | _ | _ | k + · cases v with + | zero => exact Bo_return (n + h + 3) _ (Hard0 n h Hl Hr (by omega)) + | succ v => exact Bo_return (n + h + 3) _ (Good0 n h (v + 1) Hl Hr EndTail.End01 (by omega) (by omega)) + · exact Bo_return (n + h + 3) _ (Good1 n h v Hl Hr EndTail.End01 (by omega)) + · by_cases Hv : v + 1 < 3 ^ h + · exact Bo_return (n + h + 3) _ (Good2 n h v Hl Hr EndTail.End01 Hv (by omega)) + · have hb := TC_bound Hr + have Ev : v = 3 ^ h - 1 := by omega + subst Ev + exact S01_exit n 0 h l r Hl Hr (by omega) + · have Hl' : LC outer n (3 + k) l := by + have : 3 + k = k + 3 := by omega + rw [this]; exact Hl + exact S01_step n k h v l r Hl' Hr (by omega) + +theorem Allowed_step (c : Cfg (Fin 2) (Fin 6)) (H : Allowed c) : + ∃ c', (c [target_tm]⊢⁺ c') ∧ Allowed c' := by + cases H with + | Bo n v l Hl Hg => exact Bo_step n v l Hl Hg + | Be m a u l Hl Hg => exact Be_step m a u l Hl Hg + | S11 n k h v l r Hl Hr Hg => exact S11_all n k h v l r Hl Hr Hg + | S01 n k h v l r Hl Hr Hg => exact S01_all n k h v l r Hl Hr Hg + +-- ============================================================================ +-- Section 17: Computable `CCfg` 333-Step Startup & Nonhalt Theorem +-- ============================================================================ + +open Counter in +def ccfg_init : CCfg (Fin 2) (Fin 6) := ⟨A, 0, [], []⟩ +open Counter in +def ccfg_333 : CCfg (Fin 2) (Fin 6) := + ⟨B, 0, [1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1], []⟩ + +open Counter in +set_option maxRecDepth 4000000 in +theorem bmultiStep_333 : bmultiStep target_tm 333 ccfg_init = some ccfg_333 := by decide + +def l_init : ListBlank (Fin 2) := + w011 +> (w011 +> (w111 +> (w011 +> (w011 +> outer)))) + +theorem l_init_LC : LC outer 5 27 l_init := + LC.d1 4 13 _ (LC.d1 3 6 _ (LC.d0 2 3 _ (LC.d1 1 1 _ (LC.d1 0 0 outer (LC.nil : LC outer 0 0 outer))))) + +open Counter in +theorem entry_tm7 : (init []) [target_tm]⊢* (RBar l_init default) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = evalBCfg ccfg_init := rfl + have h_end : evalBCfg ccfg_333 = RBar l_init default := by + unfold evalBCfg evalWindow ccfg_333 RBar l_init w011 w111 outer + simp only [cons_append_lb, append_nil_lb] + rfl + rw [h_init, ← h_end] + exact ⟨333, bmultiStep_sound 333 ccfg_init ccfg_333 bmultiStep_333⟩ + +end Solution + +open Counter + + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := + does_not_halt_of_invariant Allowed + ⟨RBar l_init default, entry_tm7, Allowed.Bo 5 12 l_init l_init_LC (by decide)⟩ + Allowed_step + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1RC_1LC1RE_HHH1LD_0LE0LD_1RA0RF_1LD1RB diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RC_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RC_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH.lean new file mode 100644 index 00000000..e6cbecd3 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RC_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH.lean @@ -0,0 +1,365 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusH +public import BusyBeaver.Calculi.WordCalculusI + + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.M_1RB1RC_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RC_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +open WordCalculus Word WordCanonBR WordCanonBR.BRIncs WordCanonBR.Choice +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +local notation "WordList" => List Word + +def loc_z29 : WordList := [V,V,V,K,K,V,V,Q,V,Q,Q,V,V,V,V,V,Q,K,Q,Q,Q,Q,K,Q,Q,Q] + +def loc_z2a : List (List Choice) := [ + [CT,CT,(COC0 0),CSP0,CS10,CT,(COC1 0),CSP1,CT,CP1,CT,CT,CT,CT,CT,CP0,CS11,CP1,CP0,CP1,CP0], + [CT, (COC1 0), CSP1, CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP1, CT, CT, CT, CT, CT, + CT, CT, CT, (COC0 0), CSP1, CT, CT, CT, CT, CP1, CP1, CP1, CP1, CP0, CS10, CS01, CP0, + CS10, CS11, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, CT, (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, + CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + CP0, CT, CP1, CT, CT, CP0, CS10, CP0, CS00, CS00, CS00, CS11, CP1, CP1, CP1, CP0, CS10, + CP0, CS00, CS11, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, CT, (COC0 0), (CSC0 0), + CSP1, (COC1 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, (COC1 0), CSP0, CS10, CS10, + CS11, CT, CT, CT, (COC0 0), CSP1, (COC1 0), CSP0, CS11, CT, CT, CP0, CS10, CS11, CP1, + CP1, CP1, CP1, CP1, CP0, CS10, CP1, CP1, CP1, CP0, CP1, CP0, CS10, CS11, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, CT, + (COC0 0), CSP0, CS10, CT, (COC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, + (COC1 0), CSP1, CP1, CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP1, CT, CT, CT, CP1, + CT, CT, CT, CT, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, CT, CP1, CT, CT, CP0, CS10, CS11, + CP0, CS10, CS11, CP1, CP0, CS10, CS00, CS10, CS10, CS11, CP1, CP1, CP1, CP1, CP0, CS10, + CS01, CP1, CP1, CP0, CS10, CS00, CP1, CP0, CS10, CS11, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP1, CT, CT, CT, CT, CT, CT, + CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CS11, CT, (COC0 0), + CSP1, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, + CT, CT, CT, CP1, CT, CP1, CT, CT, CP0, CS11, CP1, CT, CT, CT, CT, CT, CP0, CT, CT, CT, + CP0, CT, CT, CP1, CT, CT, CP0, CS11, CP0, CS11, CP0, CS11, CP0, CS11, CP1, CP0, CS10, + CS00, CS10, CP0, CP0, CS00, CS10, CS01, CP1, CP1, CP1, CP1, CP1, CP0, CS10, CP1, CP1, + CP1, CP0, CP0, CS00, CS01, CP0, CS10, CS11, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, CT, (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, CT, + CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP0, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, (COC1 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, CT, CT, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, (COC1 0), CSP1, + (COC1 0), CSP1, (COC1 0), CSP1, CT, CT, CP0, CS11, CT, (COC0 0), CSP0, CP0, CT, CT, CT, + CT, CT, (COC0 0), CSP1, CT, CT, CT, CT, (COC0 0), CSP0, CS10, CT, CP1, CT, CT, CP0, CS10, + CS10, CS00, CP1, CP1, CP0, CS10, CS00, CS10, CS10, CP0, CS00, CS10, CS00, CS00, CS10, + CP1, CP0, CS10, CP0, CS00, CS00, CS00, CS00, CS10, CS10, CS00, CS10, CS00, CP0, CS01, + CP1, CP1, CP1, CP0, CP0, CS00, CP0, CS01, CP1, CP1, CP1, CP1, CP1, CP0, CS10, CP1, CP1, + CP1, CP0, CS10, CP0, CS00, CS11, CP0, CS10, CS01, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, CT, (COC0 0), (CSC0 0), CSP1, + (COC1 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, CT, CT, + CT, (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, (COC1 0), CSP1, (COC1 0), CSP1, CT, CT, CT, (COC0 0), CSP1, (COC1 0), + CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, + CT, CT, CT, CT, (COC0 0), CSP1, CP0, CT, CT, CT, CP0, CP1, (COC0 0), CSP0, CP0, CS00, + CS01, CT, (COC0 0), CSP1, (COC1 0), CSP0, CS10, CS00, CS10, CS11, (COC0 2), CSP0, CT, CT, + CT, CT, (COC0 0), (CSC1 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP1, CT, CT, CT, + (COC0 0), CSP1, (COC1 0), CSP0, CS11, CT, CP0, CT, CT, CP0, CS11, CP0, CS11, CP1, CP0, + CP1, CP1, CP1, CP0, CS11, CP1, CP1, CP1, CP1, CP1, CP0, CP1, CP1, CP1, CP1, CP1, CP1, + CP1, CP0, CS10, CP1, CP1, CP1, CP0, CS10, CS00, CS01, CP1, CP0, CP1, CP1, CP1, CP1, CP1, + CP0, CS10, CP1, CP1, CP1, CP0, CP1, CP0, CS10, CS11, CP0, CS10, CS01, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, CT, + (COC0 0), CSP0, CS10, CT, (COC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, + (COC1 0), CSP0, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP0, CT, CT, CT, CT, CT, + CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + CT, (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, (COC1 0), CSP1, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, + CS11, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, + (COC1 0), CSP0, (CEC 0), (CSC0 0), CSP1, CT, CP0, CS11, CP0, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, (COC1 0), CSP1, CT, CT, CT, CT, (COC0 0), CSP1, (COC1 0), CSP1, CT, CT, + CT, CT, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), + CSP1, CT, CT, CT, CT, CP0, CS10, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, CT, CT, CT, + CT, CT, CT, CP1, CT, CP0, CT, CT, CP0, CS10, CP0, CS00, CP1, CP0, CS11, CP1, CP0, CS11, + CP1, CP0, CS11, CP1, CP1, CP0, CP0, CS01, CP0, CS10, CS10, CS10, CP0, CS00, CP1, CP0, + CS10, CP0, CS00, CS00, CS01, CP0, CS10, CP1, CP0, CP0, CS00, CS00, CS11, CP1, CP0, CS10, + CS00, CP0, CS01, CP0, CP1, CP1, CP1, CP1, CP1, CP0, CS10, CP1, CP1, CP1, CP1, CP1, CP1, + CP1, CP0, CS10, CS01, CP1, CP1, CP1, CP0, CP0, CS00, CP0, CS01, CP1, CP1, CP1, CP1, CP1, + CP0, CS10, CS01, CP1, CP1, CP0, CS10, CS00, CP1, CP0, CS10, CS11, CP0, CS10, CS11, CP1, + CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, (COC1 0), + CSP1, CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP1, CT, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), + CSP0, CS11, CT, (COC0 0), CSP1, CT, CT, CT, (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, CT, + CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), (CSC0 0), CSP1, CT, CT, CT, + (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, + (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP1, CT, + CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, + CT, (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, + CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, CT, (COC0 0), + CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP1, CT, CT, CT, (COC0 0), (CSC1 0), + CSP1, CP1, (COC1 0), CSP0, CT, (COC1 0), CSP1, (COC1 0), CSP0, CS10, (CEC 0), CSP1, CT, + CT, (COC0 0), CSP0, CS10, CS01, CT, CT, (COC0 1), CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), + CSP1, CT, CT, CT, CT, CT, CT, CT, CT, CP0, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP0, CT, + CT, CT, CT, CT, CT, CP0, CT, CT, CT, CP0, CT, CT, CP1, CT, CP1, CT, CT, CP0, CS10, CS10, + CP1, CP0, CS11, CP0, CS11, CP1, CP0, CS10, CP1, CP0, CP0, CS00, CP0, CP1, CP0, CS10, + CS10, CS00, CS00, CS00, CS00, CS01, CP1, CP1, CP0, CS10, CP1, CP0, CS11, CP1, CP1, CP1, + CP1, CP1, CP0, CS11, CP1, CP0, CS10, CS01, CP0, CS10, CS01, CP0, CP1, CP1, CP0, CS11, + CP0, CS10, CP0, CP0, CS00, CS10, CP1, CP0, CS10, CP1, CP1, CP0, CS10, CS00, CP1, CP1, + CP0, CP0, CS00, CS00, CS00, CS11, CP1, CP1, CP1, CP1, CP1, CP0, CS10, CP1, CP1, CP1, CP1, + CP1, CP1, CP1, CP0, CS10, CP1, CP1, CP1, CP0, CS10, CS00, CS01, CP1, CP0, CP1, CP1, CP1, + CP1, CP1, CP0, CS10, CP1, CP1, CP1, CP0, CP0, CS00, CS01, CP0, CS10, CS11, CP0, CS10, + CS01, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, (COC1 0), + CSP1, CT, (COC0 0), CSP1, CT, CT, (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, CT, CT, CT, + CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + CT, CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP0, CT, CT, CT, (COC0 0), (CSC1 0), + CSP1, (COC1 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CP0, CT, CT, + CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, + (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CT, + CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, + CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, + CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, (COC0 0), + CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, + (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CS11, + CT, CT, (COC0 0), CSP1, CT, (COC0 0), CSP1, (COC1 0), CSP1, (COC1 0), CSP1, CT, CT, CT, + (COC0 0), CSP0, CT, CP0, CT, (COC1 0), CSP0, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CP1, CT, (COC0 0), + CSP1, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP1, + CP0, CS10, CS00, CS10, CS00, CT, CT, (COC0 0), CSP1, CT, (COC0 0), CSP1, CT, CT, CT, CT, + CT, (COC0 0), CSP1, CT, CT, CP0, CT, CP0, CT, CT, CT, (COC0 0), CSP1, (COC1 0), CSP1, CT, + (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, CT, CT, CT, CP0, CT, CT, CT, (COC0 0), CSP0, + CS10, CS00, CS11, CT, CT, CT, CT, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP1, CT, CT, CT, CT, CP0, CS10, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, + CT, CT, CT, CT, (COC0 0), CSP0, CS10, CT, CP1, CT, CP0, CT, CT, CP0, CS11, CP0, CS11, + CP0, CS11, CP1, CP0, CS11, CP1, CP0, CS10, CP1, CP1, CP1, CP1, CP0, CS10, CS01, CP1, CP0, + CP0, CP0, CS00, CP0, CS00, CS00, CP0, CS00, CS00, CS10, CS00, CS10, CP0, CP0, CS00, CS10, + CS00, CS10, CS10, CS00, CS10, CS10, CS10, CS00, CP1, CP1, CP0, CS10, CS01, CP0, CP0, + CS01, CP1, CP1, CP0, CP0, CS01, CP1, CP1, CP1, CP0, CS10, CP1, CP1, CP0, CP1, CP0, CS10, + CP1, CP1, CP1, CP1, CP1, CP0, CS10, CS01, CP1, CP0, CP0, CP0, CP1, CP0, CP1, CP0, CP0, + CP1, CP0, CP0, CS00, CS00, CP0, CP1, CP0, CS10, CP1, CP0, CP0, CS00, CS00, CP1, CP1, CP1, + CP0, CS10, CS01, CP0, CP1, CP1, CP1, CP1, CP1, CP0, CS10, CP1, CP1, CP1, CP1, CP1, CP1, + CP1, CP0, CS10, CS01, CP1, CP1, CP1, CP0, CP0, CS00, CP0, CS01, CP1, CP1, CP1, CP1, CP1, + CP0, CS10, CP1, CP1, CP1, CP0, CS10, CP0, CS00, CS11, CP0, CS10, CS01, CP0, CS10, CS11, + CP1, CP0] +] + +def loc_z2b : WordList := [V, V, V, K, V, Q, V, K, V, V, V, V, V, V, V, V, V, K, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, K, Q, V, V, Q, V, V, V, V, K, Q, V, V, Q, V, V, V, V, + V, V, V, V, V, V, K, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, K, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, K, V, Q, V, V, V, V, V, V, V, K, Q, V, V, V, V, V, + V, V, V, K, V, V, V, V, V, K, V, Q, V, V, V, V, V, K, V, V, V, V, V, V, V, K, V, V, Q, V, + V, K, V, V, V, V, K, V, V, V, V, V, V, V, K, V, Q, V, V, V, V, V, V, K, V, V, V, V, K, Q, + V, V, Q, V, V, V, V, V, K, V, Q, V, V, V, V, V, V, K, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, K, V, V, V, V, V, V, K, V, V, V, V, V, V, V, K, V, V, V, V, V, V, V, V, V, V, V, V, + V, K, Q, V, V, V, K, V, V, K, V, V, Q, V, V, V, V, K, V, Q, V, V, K, V, V, K, V, Q, V, Q, + V, V, V, V, K, V, V, V, V, Q, V, V, V, V, V, V, V, V, K, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, K, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, K, + V, Q, V, V, K, V, V, V, K, V, V, V, K, V, V, Q, K, Q, K, V, V, K, V, V, K, V, V, V, V, V, + V, K, V, V, V, V, V, V, V, V, V, K, V, Q, V, V, K, V, Q, V, K, V, V, V, V, V, V, V, V, K, + V, Q, K, Q, V, V, V, V, V, K, V, V, V, V, V, V, V, V, K, V, V, V, V, V, V, Q, V, V, V, V, + V, V, V, K, V, V, V, V, V, K, V, Q, V, V, V, V, V, V, V, Q, V, Q, V, Q, V, V, Q, V, V, Q, + V, V, V, V, V, Q, K, V, V, V, V, K, V, K, K, V, K, K, Q, K, Q, V, V, K, Q, K, Q, Q, K, Q, + Q, Q, K, V, V, V, Q, K, V, V, K, V, V, V, V, K, V, V, V, V, Q, V, V, V, V, V, Q, V, V, V, + V, V, V, Q, K, V, V, V, V, V, V, V, V, V, V, V, V, K, K, V, V, V, Q, V, V, V, K, K, V, V, + V, V, Q, K, V, V, V, V, V, V, V, Q, V, V, V, V, V, V, V, V, Q, K, V, V, V, V, V, K, V, K, + V, V, V, V, V, V, Q, V, V, V, V, Q, V, K, Q, V, Q, K, V, Q, Q, V, V] + +def z2c_low : WordList := [Q, K, K, K, Q, Q, Q, Q, K, Q, Q, K, Q, Q, Q, Q, K, K, Q, Q, Q, K, Q, + K, K, Q, K, Q, K, Q, K, K, Q, K, K, K, Q, Q, K, Q, Q, K, Q, K, Q, K, K, Q, Q, K, Q, Q, K, + Q, K, K, K, Q, K, Q, Q, Q, Q, Q, K, K, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, K, + Q, Q, K, K, Q, Q, Q, K, K, K, K, Q, Q, Q, Q, Q, K, K, K, K, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, + Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, K, Q, Q, Q, + Q, Q, K, K, Q, K, K, Q, Q, K, K, K, Q, Q, Q, K, Q, Q, K, K, Q, Q, Q, Q, Q, Q, Q, Q, K, K, + Q, Q, Q, Q, K, K, Q, Q, Q, K, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, K, Q, Q, Q, Q, Q, Q, + K, K, K, K, Q, Q, K, Q, Q, Q, Q, Q, K, Q, Q, K, K, Q, K, K, K, Q, K, Q, Q, Q, K, K, Q, Q, + Q, Q, Q, K, K, K, Q, Q, Q, Q, Q, K, Q, K, K, K, K, K, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, + Q, Q, K, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, K, Q, Q, Q, Q, Q, Q, Q, K, K, + K, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, K, Q] + +def z2c_top : WordList := [Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,K,K] + +def loc_z2c : WordList := z2c_low ++ z2c_top + +theorem loc_z2d : + CanonRounds (evalWords loc_z29 default) + (evalWords (prefix33Words ++ (loc_z2b ++ (loc_z2c ++ tail8Words))) default) := + evalCanonRounds_sound loc_z2a loc_z29 + (prefix33Words ++ (loc_z2b ++ (loc_z2c ++ tail8Words))) + (by decide +kernel) + +theorem loc_z2e : + BGood (loc_z2b ++ (loc_z2c ++ tail8Words)) := by + apply bGood_of_check loc_z2b z2c_low z2c_top <;> decide +kernel + +def zCk0 : CCfg := ⟨E,0,[],[]⟩ + +def zCk1 : CCfg := ⟨C,1, + [0, 1], + [0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, + 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, + 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1]⟩ + +def zCk2 : CCfg := ⟨E,0, + [0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, + 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, + 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 0, 0, 1], + [0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1]⟩ + +def zCk3 : CCfg := ⟨E,0, + [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, + 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, + 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1], + [1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1]⟩ + +def zCk4 : CCfg := ⟨C,1, + [0, 1], + [0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, + 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, + 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, + 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1]⟩ + +private theorem zCk_step1 : (c_to_cfg zCk0) [canon_tm]⊢⁺ (c_to_cfg zCk1) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk0 8179 = some zCk1) + +private theorem zCk_step2 : (c_to_cfg zCk1) [canon_tm]⊢⁺ (c_to_cfg zCk2) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk1 10000 = some zCk2) + +private theorem zCk_step3 : (c_to_cfg zCk2) [canon_tm]⊢⁺ (c_to_cfg zCk3) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk2 10000 = some zCk3) + +private theorem zCk_step4 : (c_to_cfg zCk3) [canon_tm]⊢⁺ (c_to_cfg zCk4) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk3 10405 = some zCk4) + +theorem z0E : (c_to_cfg zCk0) [canon_tm]⊢⁺ (cfgCanon (evalWords loc_z29 default)) := by + have h_all := stepPlus_trans_canon zCk_step1 + (stepPlus_trans_canon zCk_step2 + (stepPlus_trans_canon zCk_step3 zCk_step4)) + have heq : c_to_cfg zCk4 = cfgCanon (evalWords loc_z29 default) := by + simp only [c_to_cfg, C, WordCanonBR.C, zCk4, zCf, cfgCanon, zCL, cfgLeft, lh, w_base, w_word, + w_rest, loc_z29, evalWords, t, d0, d1, one, List.cons_append, List.nil_append, + append_cons, append_nil, z00, zero_cons_default_canon, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] + rwa [heq] at h_all + +theorem loc_z2s (m : Nat) : + ∃ N ≥ m,∃ w,multiStep canon_tm (c_to_cfg zCk0) N = + some (cfgCanon (evalWords (prefix33Words ++ w) default)) /\ BGood w := by + induction m with + | zero => + rcases z0E with ⟨k1,_,hk1⟩ + rcases stepStar_of_canonRounds loc_z2d with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,loc_z2b ++ (loc_z2c ++ tail8Words), + multiStep_trans_canon canon_tm _ _ _ k1 k2 hk1 hk2,loc_z2e⟩ + | succ m ih => + rcases ih with ⟨N,hN,w,h_ms,h_good⟩ + rcases bGood_progress h_good with ⟨w',hStep,h_good'⟩ + rcases stepPlus_of_bStep hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,w', + multiStep_trans_canon canon_tm _ _ _ N k h_ms h_step_k,h_good'⟩ + +def zStMap : Fin 6 -> Fin 6 + | 0 => 1 + | 1 => 2 + | 2 => 3 + | 3 => 4 + | 4 => 0 + | 5 => 5 + +def zCfgMap (c : Cfg (Fin 2) (Fin 6)) : Cfg (Fin 2) (Fin 6) := + ⟨c.q.map zStMap,c.tape⟩ + +theorem zStepMap (c : Cfg (Fin 2) (Fin 6)) : + step target_tm (zCfgMap c) = (step canon_tm c).map zCfgMap := by + rcases c with ⟨_ | ⟨_ | _ | _ | _ | _ | _ | q,hq⟩,⟨h,l,r⟩⟩ <;> + rcases h with ⟨_ | _ | a,ha⟩ <;> + first | omega | rfl + +theorem zMultiStepMap (c : Cfg (Fin 2) (Fin 6)) (n : Nat) : + multiStep target_tm (zCfgMap c) n = (multiStep canon_tm c n).map zCfgMap := by + induction n with + | zero => rfl + | succ n ih => + rw [multiStep_succ_canon,multiStep_succ_canon,ih] + cases multiStep canon_tm c n with + | none => rfl + | some c' => exact zStepMap c' + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases loc_z2s (n + 1) with ⟨N,hN,_,h_N,_⟩ + have h_init : zCfgMap (c_to_cfg zCk0) = init [] := rfl + have h_map := zMultiStepMap (c_to_cfg zCk0) N + rw [h_init,h_N] at h_map + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_map + have h_some := multiStep_add_Intermediate h_map + rw [multiStep_succ_canon,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1RC_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RD_1LC0RB_0RD0LC_1LB0LE_1RF0RE_1RAHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RD_1LC0RB_0RD0LC_1LB0LE_1RF0RE_1RAHHH.lean new file mode 100644 index 00000000..5d8dd255 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RD_1LC0RB_0RD0LC_1LB0LE_1RF0RE_1RAHHH.lean @@ -0,0 +1,49 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.BB6.NonHalt.M_1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RB1RD_1LC0RB_0RD0LC_1LB0LE_1RF0RE_1RAHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RD_1LC0RB_0RD0LC_1LB0LE_1RF0RE_1RAHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +def stateMap_m0676 : Fin 6 → Fin 6 + | 0 => 1 + | 1 => 2 + | 2 => 3 + | 3 => 4 + | 4 => 5 + | 5 => 0 + +public section + +theorem is_not_halt : IsNotHalt target := by + exact Counter.does_not_halt_of_conj_stem + (M_tgt := target) + (M_src := BusyBeaver.M_1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC.target) + (σ := stateMap_m0676) (f := true) + (c₁ := (default : ListBlank (Fin 2)) {{5}}> default) + (by decide) (Counter.init_reaches_conjCfg_default rfl) + BusyBeaver.M_1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC.is_not_halt_from_0676 + +end + +end BusyBeaver.M_1RB1RD_1LC0RB_0RD0LC_1LB0LE_1RF0RE_1RAHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RE_0RC0RA_0LD0LF_1LA1LD_0RB0LD_1LCHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RE_0RC0RA_0LD0LF_1LA1LD_0RB0LD_1LCHHH.lean new file mode 100644 index 00000000..41100bb7 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RE_0RC0RA_0LD0LF_1LA1LD_0RB0LD_1LCHHH.lean @@ -0,0 +1,49 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.BB6.NonHalt.M_1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RB1RE_0RC0RA_0LD0LF_1LA1LD_0RB0LD_1LCHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RE_0RC0RA_0LD0LF_1LA1LD_0RB0LD_1LCHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +def stateMap_m0699 : Fin 6 → Fin 6 + | 0 => 3 + | 1 => 0 + | 2 => 1 + | 3 => 2 + | 4 => 4 + | 5 => 5 + +public section + +theorem is_not_halt : IsNotHalt target := by + exact Counter.does_not_halt_of_conj_stem + (M_tgt := target) + (M_src := BusyBeaver.M_1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH.target) + (σ := stateMap_m0699) (f := true) + (c₁ := (default : ListBlank (Fin 2)) {{1}}> default) + (by decide) (Counter.init_reaches_conjCfg_default rfl) + BusyBeaver.M_1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH.is_not_halt_from_0682 + +end + +end BusyBeaver.M_1RB1RE_0RC0RA_0LD0LF_1LA1LD_0RB0LD_1LCHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RE_1LC1RB_1RA0LD_1RC0LB_0RFHHH_0LD1RA.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RE_1LC1RB_1RA0LD_1RC0LB_0RFHHH_0LD1RA.lean new file mode 100644 index 00000000..40cbd151 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RE_1LC1RB_1RA0LD_1RC0LB_0RFHHH_0LD1RA.lean @@ -0,0 +1,18380 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.Excursion + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1RE_1LC1RB_1RA0LD_1RC0LB_0RFHHH_0LD1RA + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RE_1LC1RB_1RA0LD_1RC0LB_0RFHHH_0LD1RA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +abbrev target_tm_alias : Machine (Fin 2) (Fin 6) := target_tm +variable {α zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +abbrev qi : Machine (Fin 2) (Fin 6) + | 0,0 => some (some 1,Stmt.write 1 Dir.left) + | 0,1 => some (some 4,Stmt.write 1 Dir.left) + | 1,0 => some (some 2,Stmt.write 1 Dir.right) + | 1,1 => some (some 1,Stmt.write 1 Dir.left) + | 2,0 => some (some 0,Stmt.write 1 Dir.left) + | 2,1 => some (some 3,Stmt.write 0 Dir.right) + | 3,0 => some (some 2,Stmt.write 1 Dir.left) + | 3,1 => some (some 1,Stmt.write 0 Dir.right) + | 4,0 => some (some 5,Stmt.write 0 Dir.left) + | 4,1 => none + | 5,0 => some (some 3,Stmt.write 0 Dir.right) + | 5,1 => some (some 0,Stmt.write 1 Dir.left) +set_option maxHeartbeats 2000000 +set_option maxRecDepth 200000 +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0=some config:=rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1=step M config:=rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1)=Option.bind (multiStep M config n) (step M):= by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default=default:= by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head=0:=rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail=default:=rfl +@[simp] theorem append_nil (s : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> s=s:=rfl +@[simp] theorem append_cons (a : Fin 2) (l : List (Fin 2)) (s : ListBlank (Fin 2)) : + (a :: l) +> s=a >> (l +> s):=rfl +@[simp] theorem append_assoc (l1 l2 : List (Fin 2)) (s : ListBlank (Fin 2)) : + (l1 ++ l2) +> s=l1 +> (l2 +> s):= by + induction l1 with + | nil => rfl + | cons a l1 ih => simp [ih] +@[simp] theorem pow_zero_list (l : List α) : l ^ (0 : ℕ)=[]:=rfl +@[simp] theorem pow_succ_list (l : List α) (n : ℕ) : l ^ (n + 1)=l ++ l ^ n:=rfl +theorem qh (l : List α) (m n : ℕ) : l ^ (m + n)=l ^ m ++ l ^ n:= by + induction m with + | zero => simp [Nat.zero_add] + | succ m ih => simp [pow_succ_list,Nat.succ_add,ih,List.append_assoc] +theorem pow_shift (l : List α) (n : ℕ) : l ^ n ++ l=l ^ (n + 1):= by + induction n with + | zero => simp [pow_succ_list] + | succ n ih => simp [pow_succ_list,List.append_assoc,ih] +@[simp] theorem nil_pow_list (n : ℕ) : ([] : List α) ^ n=[]:= by + induction n with + | zero => rfl + | succ n ih => exact ih +theorem commute_power {x v w : List (Fin 2)} {a b : ℕ} + (h : x ++ v ^ a=w ^ b ++ x) (k : ℕ) : + x ++ v ^ (k * a)=w ^ (k * b) ++ x:= + BusyBeaver.Excursion.commute_pow_left h k +theorem qZ {w : List (Fin 2)} (h : w.all (fun b => b == 0)=true) : + w +> default=default:= by + induction w with + | nil => rfl + | cons b w ih => + simp only [List.all_cons,Bool.and_eq_true,beq_iff_eq] at h + rcases h with ⟨rfl,hw⟩ + rw [append_cons,ih hw,zero_cons_default] +theorem qaa {w : List (Fin 2)} (h : w.all (fun b => b == 0)=true) (n : ℕ) : + (w ^ n) +> default=default:= by + induction n with + | zero => rfl + | succ n ih => + rw [pow_succ_list,append_assoc,ih,qZ h] +theorem qO {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢^{1} c₂:= by simp [h] +theorem qr {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢* c₂:=⟨1,qO tm c₁ c₂ h⟩ +theorem qC {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m)=(multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m):= by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,multiStep_succ,ih,Option.bind_assoc] + simp_rw [multiStep_succ] +theorem qH {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c3 : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c3) : + c₁ [tm]⊢^{n+m} c3:= by + rw [qC,h₁]; simp [h₂] +theorem q1 {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c3) : c₁ [tm]⊢* c3:= by + obtain ⟨n,hn⟩:=h₁; obtain ⟨m,hm⟩:=h₂ + exact ⟨n + m,qH tm c₁ c₂ c3 n m hn hm⟩ +theorem qa0 {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂:= by obtain ⟨n,_,hn⟩:=h; exact ⟨n,hn⟩ +theorem qs {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c3) : c₁ [tm]⊢⁺ c3:= by + obtain ⟨n,n_pos,hn⟩:=h₁; obtain ⟨m,hm⟩:=h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),qH tm c₁ c₂ c3 n m hn hm⟩ +theorem qE {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c3) : c₁ [tm]⊢⁺ c3 := + qs (step_stepPlus tm c₁ c₂ h₁) h₂ +set_option linter.all false +abbrev O : Fin 2 := ⟨0, Nat.zero_lt_succ 1⟩ +abbrev I : Fin 2 := ⟨1, Nat.succ_lt_succ (Nat.zero_lt_succ 0)⟩ +@[simp] theorem O_cons_default : O >> default = default := zero_cons_default +def q6 (n : ℕ) (f : ℕ → α) : α := + Nat.casesOn (Nat.add n 1) (f 0) (fun m => f m) +@[simp] theorem strictNat_eq (n : ℕ) (f : ℕ → α) : q6 n f=f n:= rfl +@[inline] def eqF2 (a b : Fin 2) : Bool := Nat.beq a.1 b.1 +theorem eqF2_iff {a b : Fin 2} : eqF2 a b = true ↔ a = b := by + rcases a with ⟨a, ha⟩; rcases b with ⟨b, hb⟩ + simp [eqF2, Nat.beq_eq, Fin.ext_iff] +@[inline] def eqF6 (a b : Fin 6) : Bool := Nat.beq a.1 b.1 +theorem eqF6_iff {a b : Fin 6} : eqF6 a b = true ↔ a = b := by + rcases a with ⟨a, ha⟩; rcases b with ⟨b, hb⟩ + simp [eqF6, Nat.beq_eq, Fin.ext_iff] + +set_option linter.constructorNameAsVariable false + +theorem ble_true {a b : ℕ} (h : Nat.ble a b = true) : a ≤ b := Nat.le_of_ble_eq_true h +theorem ble_false {a b : ℕ} (h : Nat.ble a b = false) : b < a := + Nat.lt_of_not_le (fun hle => by rw [Nat.ble_eq_true_of_le hle] at h; contradiction) + +def eqL2 : List (Fin 2) → List (Fin 2) → Bool + | [], [] => true + | a :: as, b :: bs => + match Nat.beq a.1 b.1 with + | true => eqL2 as bs + | false => false + | _, _ => false + +theorem eqL2_iff {u v : List (Fin 2)} : eqL2 u v = true ↔ u = v := by + induction u generalizing v with + | nil => cases v <;> simp [eqL2] + | cons a as ih => + cases v with + | nil => simp [eqL2] + | cons b bs => + unfold eqL2 + cases h : Nat.beq a.1 b.1 + · have hne : a ≠ b := by + intro heq; subst heq; have htrue : Nat.beq a.1 a.1 = true := Nat.beq_eq.mpr rfl; rw [htrue] at h; contradiction + simp [hne] + · have heq : a = b := Fin.ext (Nat.beq_eq.mp h) + subst heq + simp [ih] + +def strip_prefix : List (Fin 2) → List (Fin 2) → Option (List (Fin 2) × List (Fin 2)) + | [], v => some ([], v) + | w, [] => some (w, []) + | b1 :: w', b2 :: v' => + match Nat.beq b1.1 b2.1 with + | true => strip_prefix w' v' + | false => none + +theorem strip_prefix_spec {w v w_rem v_rem : List (Fin 2)} + (h : strip_prefix w v = some (w_rem, v_rem)) : + (w_rem = [] → v = w ++ v_rem) ∧ (v_rem = [] → w = v ++ w_rem) := by + induction w generalizing v with + | nil => + unfold strip_prefix at h + injection h with hp; injection hp with hw hv + subst hw hv + refine ⟨fun _ => rfl, fun hv0 => ?_⟩ + subst hv0; rfl + | cons b1 w' ih => + cases v with + | nil => + unfold strip_prefix at h + injection h with hp; injection hp with hw hv + subst hw hv + refine ⟨fun hw0 => by contradiction, fun _ => rfl⟩ + | cons b2 v' => + unfold strip_prefix at h + cases hb : Nat.beq b1.1 b2.1 + · rw [hb] at h; contradiction + · rw [hb] at h + have hb_eq : b1 = b2 := Fin.ext (Nat.beq_eq.mp hb) + subst hb_eq + rcases ih h with ⟨ih1, ih2⟩ + refine ⟨fun hw0 => congrArg (b1 :: ·) (ih1 hw0), fun hv0 => congrArg (b1 :: ·) (ih2 hv0)⟩ + +def W : List (Fin 2):=[I,O,I,I,I,I,I,I,I] +def H_L : List (Fin 2):=[O,I,O,I,O,I,O,I,O] +def H_R : List (Fin 2):=[I,O,I,I,I,I] +def U : List (Fin 2):=[I,O,O,I,O,I,O,I,O,I,O] +inductive Digit where + | D0 | D1 | D2 | D3 | D4 | D5 + | D6 | D7 | D8 | D9 | D10 | D11 | D12 | D13 | D14 | D15 | D16 | D17 + | D18 | D19 | D20 | D21 +deriving DecidableEq +def qad (d : Digit) (f : Digit → α) : α := + match d with + | .D0 => f .D0 + | .D1 => f .D1 + | .D2 => f .D2 + | .D3 => f .D3 + | .D4 => f .D4 + | .D5 => f .D5 + | .D6 => f .D6 + | .D7 => f .D7 + | .D8 => f .D8 + | .D9 => f .D9 + | .D10 => f .D10 + | .D11 => f .D11 + | .D12 => f .D12 + | .D13 => f .D13 + | .D14 => f .D14 + | .D15 => f .D15 + | .D16 => f .D16 + | .D17 => f .D17 + | .D18 => f .D18 + | .D19 => f .D19 + | .D20 => f .D20 + | .D21 => f .D21 +@[simp] theorem strictDigit_eq (d : Digit) (f : Digit → α) : qad d f=f d:= by + cases d <;> rfl +def q0 : Digit → List (Fin 2) + | .D0 => [I,O,I,I,I,I,I,O,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I] + | .D1 => [I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I] + | .D2 => [I,O,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,O,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I] + | .D3 => [I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,O,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I] + | .D4 => [I,O,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I] + | .D5 => [I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I] + | .D6 => [I,O,I,I,I,I] + | .D7 => [I,I,I,I,I,I,I,I,I] + | .D8 => [I,O,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I] + | .D9 => [I,I,I,I,I,I,I,I,I,I,I,I,I,I,I] + | .D10 => [I,O,I,I,I,I,I,O,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I] + | .D11 => [I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I] + | .D12 => [I,O,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I] + | .D13 => [I,I,I,I,I,I,I,I,I,I,O,I,I,I,I] + | .D14 => [I,O,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I] + | .D15 => [I,I,I,I,I,I,I,I,I,I,I,I] + | .D16 => [I,O,I,I,I,I,I,O,I,I,I,I] + | .D17 => [I,I,I,I,I,I] + | .D18 => [I,O,I,I,I,I,I,O,I,I,I,I,I,O,I,I,I,I] + | .D19 => [I,I,I,I,I,I,I,O,I,I,I,I] + | .D20 => [I,O,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I] + | .D21 => [I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I] +def qQ : Digit → Digit + | .D0 => .D1 + | .D1 => .D2 + | .D2 => .D3 + | .D3 => .D4 + | .D4 => .D5 + | .D5 => .D0 + | .D6 => .D7 + | .D7 => .D8 + | .D8 => .D9 + | .D9 => .D10 + | .D10 => .D11 + | .D11 => .D12 + | .D12 => .D13 + | .D13 => .D14 + | .D14 => .D15 + | .D15 => .D16 + | .D16 => .D17 + | .D17 => .D6 + | .D18 => .D19 + | .D19 => .D20 + | .D20 => .D21 + | .D21 => .D18 +def take : Digit → ℕ + | .D1 | .D6 | .D7 | .D9 | .D19 => 1 + | _ => 0 +def qY : Digit → ℕ + | .D0 | .D2 | .D4 | .D6 | .D8 | .D10 | .D12 | .D14 | .D16 | .D18 | .D20 => 1 + | _ => 0 +def qo : Digit → ℕ + | .D11 | .D15 | .D17 | .D21 => 1 + | _ => 0 +def qD : Digit → ℕ + | .D0 | .D1 | .D2 | .D3 | .D4 | .D5 => 6 + | .D18 | .D19 | .D20 | .D21 => 4 + | _ => 12 +def qM : Digit → ℕ + | .D0 | .D1 | .D2 | .D3 | .D4 | .D5 | .D18 | .D19 | .D20 | .D21 => 1 + | _ => 3 +def qU : Digit → ℕ + | .D0 | .D1 | .D2 | .D3 | .D4 | .D5 => 3 + | .D18 | .D19 | .D20 | .D21 => 2 + | _ => 6 +def qy : Digit → ℕ + | .D0 | .D1 | .D2 | .D3 | .D4 | .D5 => 0 + | .D18 | .D19 | .D20 | .D21 => 1 + | _ => 3 +def qj (tm : Machine (Fin 2) (Fin 6)) : ℕ → ListBlank (Fin 2) → ListBlank (Fin 2) → Prop + | 0,r,r' => r=r' + | t + 1,r,r' => + ∃ r1,(∀ l,((H_L +> l) {{D}}> r) [tm]⊢* (l <{{A}} (H_R +> r1))) ∧ + qj tm t r1 r' +theorem sideCalls_add {tm : Machine (Fin 2) (Fin 6)} {t u : ℕ} {r1 r2 r3 : ListBlank (Fin 2)} + (h₁ : qj tm t r1 r2) (h₂ : qj tm u r2 r3) : + qj tm (t + u) r1 r3:= by + induction t generalizing r1 with + | zero => + rw [Nat.zero_add] + change r1=r2 at h₁ + subst h₁ + exact h₂ + | succ t ih => + rcases h₁ with ⟨rm,hstep,hrest⟩ + rw [Nat.succ_add] + exact ⟨rm,hstep,ih hrest⟩ +theorem qae {tm : Machine (Fin 2) (Fin 6)} {t u : ℕ} {r1 r3 : ListBlank (Fin 2)} + (h : qj tm (t + u) r1 r3) : + ∃ r2,qj tm t r1 r2 ∧ qj tm u r2 r3:= by + induction t generalizing r1 with + | zero => + rw [Nat.zero_add] at h + exact ⟨r1,rfl,h⟩ + | succ t ih => + rw [Nat.succ_add] at h + rcases h with ⟨rm,hstep,hrest⟩ + rcases ih hrest with ⟨r2,h₁,h₂⟩ + exact ⟨r2,⟨rm,hstep,h₁⟩,h₂⟩ +def q4 (tm : Machine (Fin 2) (Fin 6)) (t u : ℕ) (w1 w₂ : List (Fin 2)) : Prop := + ∀ r1 r2,qj tm u r1 r2 → qj tm t (w1 +> r1) (w₂ +> r2) +theorem qd (tm : Machine (Fin 2) (Fin 6)) (w : List (Fin 2)) : + q4 tm 0 0 w w:= by + intro r1 r2 h + change r1=r2 at h + subst h + rfl +theorem segCalls_nil (tm : Machine (Fin 2) (Fin 6)) (t : ℕ) : + q4 tm t t [] []:= by + intro r1 r2 h + exact h +theorem q3 {tm : Machine (Fin 2) (Fin 6)} {t u v : ℕ} + {w1 w₂ v1 v2 : List (Fin 2)} + (h₁ : q4 tm t u w1 w₂) (h₂ : q4 tm u v v1 v2) : + q4 tm t v (w1 ++ v1) (w₂ ++ v2):= by + intro r1 r2 hr + rw [append_assoc,append_assoc] + exact h₁ (v1 +> r1) (v2 +> r2) (h₂ r1 r2 hr) +theorem qP {tm : Machine (Fin 2) (Fin 6)} {t1 u1 t2 u2 : ℕ} + {w1 w₂ w3 : List (Fin 2)} + (h₁ : q4 tm t1 u1 w1 w₂) (h₂ : q4 tm t2 u2 w₂ w3) : + q4 tm (t1 + t2) (u1 + u2) w1 w3:= by + intro r1 r3 hr + rcases qae hr with ⟨r2,hr₁,hr₂⟩ + exact sideCalls_add (h₁ r1 r2 hr₁) (h₂ r2 r3 hr₂) +theorem qb {tm : Machine (Fin 2) (Fin 6)} {w1 w₂ : List (Fin 2)} + (h : ∀ l r,((H_L +> l) {{D}}> (w1 +> r)) [tm]⊢* (l <{{A}} (H_R +> w₂ +> r))) : + q4 tm 1 0 w1 w₂:= by + intro r1 r2 hr + change r1=r2 at hr + subst hr + exact ⟨w₂ +> r1,fun l => h l r1,rfl⟩ +theorem qq {tm : Machine (Fin 2) (Fin 6)} {w1 w_mid w₂ : List (Fin 2)} + (hR : ∀ l r,((H_L +> l) {{D}}> (w1 +> r)) [tm]⊢* ((H_L +> w_mid +> l) {{D}}> r)) + (hL : ∀ l r,((w_mid +> l) <{{A}} (H_R +> r)) [tm]⊢* (l <{{A}} (H_R +> w₂ +> r))) : + q4 tm 1 1 w1 w₂:= by + intro r1 r2 hr + rcases hr with ⟨r',hcall,rfl⟩ + refine ⟨w₂ +> r',fun l => ?_,rfl⟩ + exact q1 (hR l r1) (q1 (hcall (w_mid +> l)) (hL l r')) +theorem wall_n {tm : Machine (Fin 2) (Fin 6)} + (hwall1 : q4 tm 1 1 W W) (n : ℕ) : + q4 tm 1 1 (W ^ n) (W ^ n):= by + induction n with + | zero => exact segCalls_nil tm 1 + | succ n ih => + rw [pow_succ_list] + exact q3 hwall1 ih +theorem walls {tm : Machine (Fin 2) (Fin 6)} + (hwall1 : q4 tm 1 1 W W) (t n : ℕ) : + q4 tm t t (W ^ n) (W ^ n):= by + induction t with + | zero => exact qd tm (W ^ n) + | succ t ih => + have h1:=qP (wall_n hwall1 n) ih + rwa [Nat.add_comm 1 t] at h1 +theorem prefix_rule {tm : Machine (Fin 2) (Fin 6)} + (hwall1 : q4 tm 1 1 W W) + {t u a b c : ℕ} {p p' : Digit} + (h : q4 tm t u (q0 p ++ W ^ b) (W ^ a ++ q0 p' ++ W ^ c)) (k : ℕ) : + q4 tm t u (W ^ k ++ (q0 p ++ W ^ b)) (W ^ (k + a) ++ q0 p' ++ W ^ c):= by + have hw:=walls hwall1 t k + have hc:=q3 hw h + simpa only [qh,List.append_assoc] using hc +structure Effect where + phase : Digit + used : ℕ + given : ℕ + sent : ℕ +deriving DecidableEq +def qN : Digit → ℕ → Effect + | p,0 => ⟨p,0,0,0⟩ + | p,t + 1 => + let a:=qN (qQ p) t + ⟨a.phase,take p + a.used,qY p + a.given,qo p + a.sent⟩ +theorem total_spec {tm : Machine (Fin 2) (Fin 6)} + (hwall1 : q4 tm 1 1 W W) + (hone : ∀ p n,q4 tm 1 (qo p) (q0 p ++ W ^ (take p + n)) (W ^ (qY p) ++ q0 (qQ p) ++ W ^ n)) + (t : ℕ) (p : Digit) (n : ℕ) : + let a:=qN p t + q4 tm t a.sent (q0 p ++ W ^ (a.used + n)) (W ^ a.given ++ q0 a.phase ++ W ^ n):= by + induction t generalizing p n with + | zero => + dsimp -failIfUnchanged [qN] + simpa only [Nat.zero_add,pow_zero_list,List.nil_append] using qd tm (q0 p ++ W ^ n) + | succ t ih => + dsimp -failIfUnchanged [qN] + have h1:=hone p ((qN (qQ p) t).used + n) + have h2:=prefix_rule hwall1 (ih (qQ p) n) (qY p) + rw [← List.append_assoc] at h2 + have h3:=qP h1 h2 + rw [Nat.add_comm 1 t,← Nat.add_assoc] at h3 + exact h3 +theorem total_add (p : Digit) (t u : ℕ) : + qN p (t + u) = + let a:=qN p t + let b:=qN a.phase u + ⟨b.phase,a.used + b.used,a.given + b.given,a.sent + b.sent⟩:= by + induction t generalizing p with + | zero => + rw [Nat.zero_add] + dsimp -failIfUnchanged only [qN] + rcases qN p u with ⟨ph,us,gv,sn⟩ + simp only [Nat.zero_add] + | succ t ih => + rw [Nat.succ_add] + dsimp -failIfUnchanged only [qN] + rw [ih (qQ p)] + dsimp -failIfUnchanged only + congr 1 <;> omega +theorem total_cycle (p : Digit) : + qN p (qD p)=⟨p,qM p,qU p,qy p⟩:= by + cases p <;> rfl +theorem total_period (p : Digit) (k r : ℕ) : + qN p (k * qD p + r) = + let a:=qN p r + ⟨a.phase,k * qM p + a.used,k * qU p + a.given,k * qy p + a.sent⟩:= by + induction k with + | zero => + simp only [Nat.zero_mul,Nat.zero_add] + | succ k ih => + have h_eq : (k + 1) * qD p + r=qD p + (k * qD p + r):= by ring + rw [h_eq,total_add,total_cycle] + dsimp -failIfUnchanged only + rw [ih] + dsimp -failIfUnchanged only + congr 1 <;> ring +def qN_fast : Digit → ℕ → Effect + | p, 0 => ⟨p, 0, 0, 0⟩ + | p, t + 1 => + match qN_fast (qQ p) t with + | ⟨ph, u, g, s⟩ => + ⟨ph, Nat.add (take p) u, Nat.add (qY p) g, Nat.add (qo p) s⟩ +theorem qN_fast_eq (p : Digit) (t : ℕ) : qN_fast p t = qN p t := by + induction t generalizing p with + | zero => rfl + | succ t ih => + unfold qN_fast qN + rw [ih (qQ p)] + rfl +def qF (p : Digit) (t : ℕ) : Effect := + let per := qD p + q6 (Nat.div t per) (fun k => + q6 (Nat.mod t per) (fun r => + match qN_fast p r with + | ⟨ph, u, g, s⟩ => + qad ph (fun ph' => + q6 (Nat.add (Nat.mul k (qM p)) u) (fun u' => + q6 (Nat.add (Nat.mul k (qU p)) g) (fun g' => + q6 (Nat.add (Nat.mul k (qy p)) s) (fun s' => + ⟨ph', u', g', s'⟩)))))) +theorem totalN_spec (p : Digit) (t : ℕ) : qF p t=qN p t:= by + unfold qF + simp only [strictNat_eq,strictDigit_eq,qN_fast_eq] + have h_div : t=(t / qD p) * qD p + t % qD p:=(Nat.div_add_mod' t (qD p)).symm + conv_rhs => rw [h_div,total_period] + rcases qN p (t % qD p) with ⟨ph,u,g,s⟩ + rfl +theorem totalN_rule {tm : Machine (Fin 2) (Fin 6)} + (hwall1 : q4 tm 1 1 W W) + (hone : ∀ p n,q4 tm 1 (qo p) (q0 p ++ W ^ (take p + n)) (W ^ (qY p) ++ q0 (qQ p) ++ W ^ n)) + (p : Digit) (t n : ℕ) (h : (qF p t).used ≤ n) : + let a:=qF p t + q4 tm t a.sent (q0 p ++ W ^ n) (W ^ a.given ++ q0 a.phase ++ W ^ (n - a.used)):= by + dsimp -failIfUnchanged only + have h_spec:=total_spec hwall1 hone t p (n - (qF p t).used) + rw [← totalN_spec p t] at h_spec + dsimp -failIfUnchanged only at h_spec + have h_add : (qF p t).used + (n - (qF p t).used)=n:=Nat.add_sub_of_le h + rwa [h_add] at h_spec +abbrev qK:=List (Digit × ℕ) +def qg : qK → List (Fin 2) + | [] => [] + | (p,n) :: xs => q0 p ++ W ^ n ++ qg xs + +def qZ_open : ℕ → qK → Option (ℕ × qK × ℕ) + | t, [] => some (0, [], t) + | t, (p, n) :: xs => + match Nat.beq t 0 with + | true => some (0, (p, n) :: xs, 0) + | false => + match qF p t with + | ⟨ph, u, g, s⟩ => + match Nat.ble u n with + | true => + match qZ_open s xs with + | some (e, ys, u_out) => + q6 (Nat.add (Nat.sub n u) e) (fun m => + some (g, (ph, m) :: ys, u_out)) + | none => none + | false => none + +theorem qZ_open_spec {tm : Machine (Fin 2) (Fin 6)} + (hwall1 : q4 tm 1 1 W W) + (hone : ∀ p n, q4 tm 1 (qo p) (q0 p ++ W ^ (take p + n)) (W ^ (qY p) ++ q0 (qQ p) ++ W ^ n)) + (t : ℕ) (xs : qK) (e : ℕ) (ys : qK) (u_out : ℕ) (h : qZ_open t xs = some (e, ys, u_out)) : + q4 tm t u_out (qg xs) (W ^ e ++ qg ys) := by + induction xs generalizing t e ys u_out with + | nil => + unfold qZ_open at h + injection h with hp1; injection hp1 with he hp2; injection hp2 with hys hu + subst he hys hu + exact segCalls_nil tm t + | cons pn xs ih => + rcases pn with ⟨p, n⟩ + unfold qZ_open at h + cases ht : Nat.beq t 0 + · rw [ht] at h + dsimp -failIfUnchanged only at h + cases hle : Nat.ble (qF p t).used n + · rw [hle] at h; contradiction + · rw [hle] at h + cases hb : qZ_open (qF p t).sent xs with + | none => rw [hb] at h; contradiction + | some eys => + rcases eys with ⟨e', ys', u'⟩ + rw [hb] at h + simp only [strictNat_eq, Nat.add_eq, Nat.sub_eq] at h + injection h with hp1; injection hp1 with he hp2; injection hp2 with hys hu + subst he hys hu + have h1 := totalN_rule hwall1 hone p t n (ble_true hle) + have h2 := ih (qF p t).sent e' ys' u' hb + have h3 := q3 h1 h2 + simpa only [qg, qh, List.append_assoc] using h3 + · rw [ht] at h + injection h with hp1; injection hp1 with he hp2; injection hp2 with hys hu + subst he hys hu + have ht0 : t = 0 := Nat.beq_eq.mp ht; subst ht0 + simpa using qd tm (qg ((p, n) :: xs)) + +def qZ_open_many : List ℕ → ℕ → ℕ → qK → ℕ → Option (ℕ × ℕ × qK × ℕ) + | [], t_acc, e_acc, xs, u_acc => some (t_acc, e_acc, xs, u_acc) + | t :: ts, t_acc, e_acc, xs, u_acc => + match qZ_open t xs with + | some (e, ys, u_out) => + q6 (Nat.add t_acc t) (fun t' => + q6 (Nat.add e_acc e) (fun e' => + q6 (Nat.add u_acc u_out) (fun u' => + qZ_open_many ts t' e' ys u'))) + | none => none + +theorem qZ_open_many_spec {tm : Machine (Fin 2) (Fin 6)} + (hwall1 : q4 tm 1 1 W W) + (hone : ∀ p n, q4 tm 1 (qo p) (q0 p ++ W ^ (take p + n)) (W ^ (qY p) ++ q0 (qQ p) ++ W ^ n)) + (ts : List ℕ) (t_acc e_acc : ℕ) (xs : qK) (u_acc : ℕ) + (tf ef : ℕ) (yf : qK) (uf : ℕ) + (w0 : List (Fin 2)) + (h_acc : q4 tm t_acc u_acc w0 (W ^ e_acc ++ qg xs)) + (h : qZ_open_many ts t_acc e_acc xs u_acc = some (tf, ef, yf, uf)) : + q4 tm tf uf w0 (W ^ ef ++ qg yf) := by + induction ts generalizing t_acc e_acc xs u_acc with + | nil => + unfold qZ_open_many at h + injection h with hp1; injection hp1 with ht hp2; injection hp2 with he hp3; injection hp3 with hxs hu + subst ht he hxs hu + exact h_acc + | cons t ts ih => + unfold qZ_open_many at h + cases ho : qZ_open t xs with + | none => rw [ho] at h; contradiction + | some eyu => + rcases eyu with ⟨e, ys, u_out⟩ + rw [ho] at h + simp only [strictNat_eq, Nat.add_eq] at h + have h_step := qZ_open_spec hwall1 hone t xs e ys u_out ho + have h_w := walls hwall1 t e_acc + have h_step_w : q4 tm t u_out (W ^ e_acc ++ qg xs) (W ^ (e_acc + e) ++ qg ys) := by + simpa only [qh, List.append_assoc] using q3 h_w h_step + have h_next := qP h_acc h_step_w + exact ih (t_acc + t) (e_acc + e) ys (u_acc + u_out) h_next h + +theorem qg_append (xs1 xs2 : qK) : qg (xs1 ++ xs2) = qg xs1 ++ qg xs2 := by + induction xs1 with + | nil => rfl + | cons pn rest ih => + rcases pn with ⟨p, n⟩ + simp only [List.cons_append, qg, ih, List.append_assoc] + +def append_qK : qK → ℕ → qK → Option qK + | [], e2, ys2 => + match Nat.beq e2 0 with + | true => some ys2 + | false => none + | [(p, n)], e2, ys2 => + q6 (Nat.add n e2) (fun m => some ((p, m) :: ys2)) + | (p, n) :: rest, e2, ys2 => + match append_qK rest e2 ys2 with + | some ys' => some ((p, n) :: ys') + | none => none + +theorem append_qK_spec {ys1 : qK} {e2 : ℕ} {ys2 ys : qK} + (h : append_qK ys1 e2 ys2 = some ys) : + qg ys1 ++ (W ^ e2 ++ qg ys2) = qg ys := by + induction ys1 generalizing ys with + | nil => + unfold append_qK at h + cases he : Nat.beq e2 0 + · rw [he] at h; contradiction + · rw [he] at h; injection h with hys; subst hys + have he0 : e2 = 0 := Nat.beq_eq.mp he; subst he0 + rfl + | cons pn rest ih => + rcases pn with ⟨p, n⟩ + cases rest with + | nil => + unfold append_qK at h + simp only [strictNat_eq, Nat.add_eq] at h + injection h with hys; subst hys + simp only [qg, List.append_nil, qh, List.append_assoc] + | cons pn2 rest2 => + unfold append_qK at h + cases ha : append_qK (pn2 :: rest2) e2 ys2 with + | none => rw [ha] at h; contradiction + | some ys' => + rw [ha] at h; injection h with hys; subst hys + change (q0 p ++ W ^ n) ++ qg (pn2 :: rest2) ++ (W ^ e2 ++ qg ys2) = (q0 p ++ W ^ n) ++ qg ys' + rw [List.append_assoc (q0 p ++ W ^ n), ih ha] + +def qZ_segs : List (List ℕ × qK) → Option (ℕ × ℕ × qK × qK) + | [] => none + | [(ts, xs)] => + match qZ_open_many ts 0 0 xs 0 with + | some (t, e, ys, u) => + match Nat.beq u 0 with + | true => some (t, e, xs, ys) + | false => none + | none => none + | (ts, xs) :: seg2 :: rest => + match qZ_open_many ts 0 0 xs 0, qZ_segs (seg2 :: rest) with + | some (t1, e1, ys1, u1), some (t2, e2, xs2, ys2) => + match Nat.beq u1 t2 with + | true => + match append_qK ys1 e2 ys2 with + | some ys => some (t1, e1, xs ++ xs2, ys) + | none => none + | false => none + | _, _ => none + +theorem qZ_segs_spec {tm : Machine (Fin 2) (Fin 6)} + (hwall1 : q4 tm 1 1 W W) + (hone : ∀ p n, q4 tm 1 (qo p) (q0 p ++ W ^ (take p + n)) (W ^ (qY p) ++ q0 (qQ p) ++ W ^ n)) + (segs : List (List ℕ × qK)) (t e : ℕ) (xs ys : qK) + (h : qZ_segs segs = some (t, e, xs, ys)) : + q4 tm t 0 (qg xs) (W ^ e ++ qg ys) := by + induction segs generalizing t e xs ys with + | nil => contradiction + | cons seg1 rest ih => + rcases seg1 with ⟨ts1, xs1⟩ + cases rest with + | nil => + unfold qZ_segs at h + cases hm : qZ_open_many ts1 0 0 xs1 0 with + | none => rw [hm] at h; contradiction + | some teyu => + rcases teyu with ⟨t1, e1, ys1, u1⟩ + rw [hm] at h + dsimp -failIfUnchanged only at h + cases hu : Nat.beq u1 0 + · rw [hu] at h; contradiction + · rw [hu] at h + injection h with hp1; injection hp1 with ht hp2; injection hp2 with he hp3; injection hp3 with hxs hys + subst ht he hxs hys + have hu0 : u1 = 0 := Nat.beq_eq.mp hu; subst hu0 + exact qZ_open_many_spec hwall1 hone ts1 0 0 xs1 0 t1 e1 ys1 0 (qg xs1) (qd tm (qg xs1)) hm + | cons seg2 rest2 => + unfold qZ_segs at h + cases hm1 : qZ_open_many ts1 0 0 xs1 0 with + | none => rw [hm1] at h; contradiction + | some teyu1 => + rcases teyu1 with ⟨t1, e1, ys1, u1⟩ + rw [hm1] at h + cases hm2 : qZ_segs (seg2 :: rest2) with + | none => rw [hm2] at h; contradiction + | some texy2 => + rcases texy2 with ⟨t2, e2, xs2, ys2⟩ + rw [hm2] at h + dsimp -failIfUnchanged only at h + cases hut : Nat.beq u1 t2 + · rw [hut] at h; contradiction + · rw [hut] at h + cases hap : append_qK ys1 e2 ys2 with + | none => rw [hap] at h; contradiction + | some ys_all => + rw [hap] at h + injection h with hp1; injection hp1 with ht hp2; injection hp2 with he hp3; injection hp3 with hxs hys + subst ht he hxs hys + have hut_eq : u1 = t2 := Nat.beq_eq.mp hut; subst hut_eq + have h1 := qZ_open_many_spec hwall1 hone ts1 0 0 xs1 0 t1 e1 ys1 u1 (qg xs1) (qd tm (qg xs1)) hm1 + have h2 := ih u1 e2 xs2 ys2 hm2 + have h3 := q3 h1 h2 + rw [← qg_append, List.append_assoc (W ^ e1), append_qK_spec hap] at h3 + exact h3 + +theorem calls_spec {tm : Machine (Fin 2) (Fin 6)} + (hemit : ∀ r,(([O,I] +> default) <{{A}} (H_R +> r)) [tm]⊢* ((U.reverse +> default) {{D}}> r)) + (t : ℕ) (r r' : ListBlank (Fin 2)) (h : qj tm t r r') : + ((U.reverse +> default) {{D}}> r) [tm]⊢* ((U.reverse +> default) {{D}}> r'):= by + induction t generalizing r with + | zero => + change r=r' at h + subst h + exact ⟨0,rfl⟩ + | succ t ih => + rcases h with ⟨r1,hstep,hrest⟩ + have hU : U.reverse +> (default : ListBlank (Fin 2))=H_L +> ([O,I] +> default):=rfl + rw [hU] + exact q1 (hstep ([O,I] +> default)) (q1 (hemit r1) (ih r1 hrest)) + +abbrev Runs:=List (List (Fin 2) × ℕ) + +def q9 (r : Runs) (f : Runs → α) : α := + match r with + | [] => f [] + | head :: tail => f (head :: tail) +@[simp] theorem strictRuns_eq (r : Runs) (f : Runs → α) : q9 r f=f r:= by + cases r <;> rfl + +def Runs.denote : Runs → ListBlank (Fin 2) + | [] => default + | (w,n) :: xs => (w ^ n) +> Runs.denote xs + +def Runs.cons1 (w : List (Fin 2)) (xs : Runs) : Runs := (w, 1) :: xs +theorem Runs.cons1_spec (w : List (Fin 2)) (xs : Runs) : + Runs.denote (Runs.cons1 w xs) = w +> Runs.denote xs := by + simp [Runs.cons1, Runs.denote, pow_succ_list] + +def Runs.consN (w : List (Fin 2)) (n : ℕ) (xs : Runs) : Runs := + match Nat.beq n 0 with + | true => xs + | false => q6 n (fun n' => (w, n') :: xs) +theorem Runs.consN_spec (w : List (Fin 2)) (n : ℕ) (xs : Runs) : + Runs.denote (Runs.consN w n xs) = (w ^ n) +> Runs.denote xs := by + unfold Runs.consN + cases hn : Nat.beq n 0 + · simp [strictNat_eq, Runs.denote] + · have hn0 : n = 0 := Nat.beq_eq.mp hn + subst hn0 + simp [Runs.denote] + +def Runs.push (w : List (Fin 2)) (n : ℕ) (xs : Runs) : Runs := + match w with + | [] => xs + | b :: w' => + match Nat.beq n 0 with + | true => xs + | false => + match xs with + | [] => q6 n (fun n' => [(b :: w', n')]) + | (v, m) :: ys => + match eqL2 (b :: w') v with + | true => q6 (Nat.add n m) (fun nm => (b :: w', nm) :: ys) + | false => q6 n (fun n' => (b :: w', n') :: (v, m) :: ys) + +theorem Runs.push_spec (w : List (Fin 2)) (n : ℕ) (xs : Runs) : + Runs.denote (Runs.push w n xs)=(w ^ n) +> Runs.denote xs:= by + cases w with + | nil => simp [Runs.push,nil_pow_list] + | cons b w' => + unfold Runs.push + cases hn : Nat.beq n 0 + · cases xs with + | nil => rfl + | cons vm ys => + rcases vm with ⟨v,m⟩ + dsimp -failIfUnchanged only + cases hv : eqL2 (b :: w') v + · rfl + · have hv_eq : b :: w'=v:=eqL2_iff.mp hv + subst hv_eq + simp only [strictNat_eq, Nat.add_eq, Runs.denote, qh, append_assoc] + · have hn0 : n=0:=Nat.beq_eq.mp hn + subst hn0 + simp + +def Runs.pop : Runs → Fin 2 × Runs + | [] => (O, []) + | ([], _) :: xs => Runs.pop xs + | (b :: w, n) :: xs => + match Nat.beq n 0 with + | true => Runs.pop xs + | false => + match Nat.beq n 1 with + | true => + match w with + | [] => (b, xs) + | b2 :: w' => q9 (Runs.push (b2 :: w') 1 xs) (fun xs2 => (b, xs2)) + | false => + q6 (Nat.sub n 1) (fun n' => + match w with + | [] => (b, ([b], n') :: xs) + | b2 :: w' => (b, Runs.cons1 (b2 :: w') ((b :: b2 :: w', n') :: xs))) + +theorem Runs.pop_spec (xs : Runs) : + Runs.denote xs=(Runs.pop xs).1 >> Runs.denote (Runs.pop xs).2:= by + induction xs with + | nil => + simp only [Runs.pop,Runs.denote,O_cons_default] + | cons wn xs ih => + rcases wn with ⟨w,n⟩ + cases w with + | nil => + simpa [Runs.pop,Runs.denote,nil_pow_list] using ih + | cons b w => + unfold Runs.pop + cases hn : Nat.beq n 0 + · have hn_pos : 0 < n := Nat.pos_of_ne_zero (by intro h0; subst h0; exact Bool.noConfusion hn) + have hn_eq : n = (n - 1) + 1 := (Nat.sub_add_cancel hn_pos).symm + cases hn1 : Nat.beq n 1 + · simp only [strictNat_eq, Nat.sub_eq] + cases w with + | nil => + dsimp -failIfUnchanged only [Runs.denote] + conv_lhs => rw [hn_eq, pow_succ_list] + simp [pow_succ_list, append_assoc] + | cons b2 w' => + dsimp -failIfUnchanged only [Runs.denote, Runs.cons1] + conv_lhs => rw [hn_eq, pow_succ_list] + simp [pow_succ_list, append_assoc] + · have hn1_eq : n = 1 := Nat.beq_eq.mp hn1 + subst hn1_eq + cases w with + | nil => simp [Runs.denote, pow_succ_list] + | cons b2 w' => + simp [strictRuns_eq, Runs.push_spec, Runs.denote, pow_succ_list] + · have hn0 : n = 0 := Nat.beq_eq.mp hn + subst hn0 + simpa [Runs.denote] using ih + +def Runs.remove : List (Fin 2) → Runs → Option Runs + | [], xs => q9 xs (fun xs' => some xs') + | b :: w, xs => + match Runs.pop xs with + | (b', xs') => + match Nat.beq b.1 b'.1 with + | true => Runs.remove w xs' + | false => none + +theorem Runs.remove_spec {w : List (Fin 2)} {xs ys : Runs} + (h : Runs.remove w xs=some ys) : + Runs.denote xs=w +> Runs.denote ys:= by + induction w generalizing xs with + | nil => + unfold Runs.remove at h + simp only [strictRuns_eq] at h + injection h with hys; subst hys; rfl + | cons b w ih => + unfold Runs.remove at h + dsimp -failIfUnchanged only at h + cases hb : Nat.beq b.1 (Runs.pop xs).1.1 + · rw [hb] at h; contradiction + · rw [hb] at h + have hb_eq : b = (Runs.pop xs).1 := Fin.ext (Nat.beq_eq.mp hb) + rw [Runs.pop_spec xs, ← hb_eq, ih h] + rfl + +def Runs.remove_word : ℕ → List (Fin 2) → Runs → Option Runs + | 0, w, xs => Runs.remove w xs + | _ + 1, [], xs => some xs + | _ + 1, w, [] => Runs.remove w [] + | fuel + 1, w, (v, nv) :: ys => + match Nat.beq nv 0 with + | true => Runs.remove_word fuel w ys + | false => + match strip_prefix w v with + | some ([], []) => + match Nat.beq nv 1 with + | true => some ys + | false => q6 (Nat.sub nv 1) (fun nv' => some ((v, nv') :: ys)) + | some ([], v_rem) => + match Nat.beq nv 1 with + | true => q9 (Runs.push v_rem 1 ys) (fun ys2 => some ys2) + | false => + q6 (Nat.sub nv 1) (fun nv' => + some (Runs.cons1 v_rem ((v, nv') :: ys))) + | some (w_rem, []) => + match Nat.beq nv 1 with + | true => Runs.remove_word fuel w_rem ys + | false => + q6 (Nat.sub nv 1) (fun nv' => + Runs.remove_word fuel w_rem ((v, nv') :: ys)) + | _ => none + +theorem Runs.remove_word_spec {fuel : ℕ} {w : List (Fin 2)} {xs ys : Runs} + (h : Runs.remove_word fuel w xs = some ys) : + Runs.denote xs = w +> Runs.denote ys := by + induction fuel generalizing w xs ys with + | zero => exact Runs.remove_spec h + | succ fuel ih => + cases w with + | nil => + unfold Runs.remove_word at h + injection h with hys; subst hys; rfl + | cons b1 w' => + cases xs with + | nil => + unfold Runs.remove_word at h + exact Runs.remove_spec h + | cons vn ys0 => + rcases vn with ⟨v, nv⟩ + unfold Runs.remove_word at h + cases hnv : Nat.beq nv 0 + · rw [hnv] at h + have hnv_pos : 0 < nv := Nat.pos_of_ne_zero (by intro h0; subst h0; exact Bool.noConfusion hnv) + have hnv_eq : nv = 1 + (nv - 1) := (Nat.add_sub_of_le hnv_pos).symm + have h_v_pow : v ^ nv = v ++ v ^ (nv - 1) := by + conv_lhs => rw [hnv_eq, qh, pow_succ_list, pow_zero_list, List.append_nil] + cases hsp : strip_prefix (b1 :: w') v with + | none => rw [hsp] at h; contradiction + | some wv => + rcases wv with ⟨w_rem, v_rem⟩ + rw [hsp] at h + rcases strip_prefix_spec hsp with ⟨hsp1, hsp2⟩ + cases w_rem with + | nil => + cases v_rem with + | nil => + dsimp -failIfUnchanged only at h + have hv_eq : v = b1 :: w' := by simpa using hsp1 rfl + cases hnv1 : Nat.beq nv 1 + · rw [hnv1] at h + simp only [strictNat_eq, Nat.sub_eq] at h + injection h with hys; subst hys + have h_v_pow2 : v ^ nv = (b1 :: w') ++ v ^ (nv - 1) := + h_v_pow.trans (congrArg (· ++ v ^ (nv - 1)) hv_eq) + rw [Runs.denote, h_v_pow2, Runs.denote, append_assoc] + · rw [hnv1] at h + injection h with hys; subst hys + have hnv1_eq : nv = 1 := Nat.beq_eq.mp hnv1; subst hnv1_eq + rw [Runs.denote, hv_eq] + simp [pow_succ_list] + | cons bv v_tail => + dsimp -failIfUnchanged only at h + have hv_eq := hsp1 rfl + cases hnv1 : Nat.beq nv 1 + · rw [hnv1] at h + simp only [strictNat_eq, Nat.sub_eq] at h + injection h with hys; subst hys + have h_v_pow2 : v ^ nv = (b1 :: w' ++ (bv :: v_tail)) ++ v ^ (nv - 1) := + h_v_pow.trans (congrArg (· ++ v ^ (nv - 1)) hv_eq) + rw [Runs.denote, h_v_pow2, Runs.cons1_spec, Runs.denote] + simp [append_assoc] + · rw [hnv1] at h + simp only [strictRuns_eq] at h + injection h with hys; subst hys + have hnv1_eq : nv = 1 := Nat.beq_eq.mp hnv1; subst hnv1_eq + rw [Runs.denote, Runs.push_spec, hv_eq] + simp [pow_succ_list, append_assoc] + | cons bw w_tail => + cases v_rem with + | nil => + dsimp -failIfUnchanged only at h + have hw_eq := hsp2 rfl + cases hnv1 : Nat.beq nv 1 + · rw [hnv1] at h + simp only [strictNat_eq, Nat.sub_eq] at h + have h_ih := ih h + rw [Runs.denote] at h_ih + rw [Runs.denote, h_v_pow, append_assoc, h_ih, hw_eq, append_assoc] + · rw [hnv1] at h + have hnv1_eq : nv = 1 := Nat.beq_eq.mp hnv1; subst hnv1_eq + have h_ih := ih h + rw [Runs.denote, h_ih, hw_eq] + simp [pow_succ_list, append_assoc] + | cons bv v_tail => + dsimp -failIfUnchanged only at h + contradiction + · rw [hnv] at h + have hnv0 : nv = 0 := Nat.beq_eq.mp hnv + subst hnv0 + simpa [Runs.denote] using ih h + +def Runs.remove_fast : ℕ → List (Fin 2) → ℕ → Runs → Option Runs + | 0, _, n, xs => + match Nat.beq n 0 with + | true => some xs + | false => none + | fuel + 1, w, n, xs => + match Nat.beq n 0 with + | true => some xs + | false => + match xs with + | (x, nx) :: ys => + match strip_prefix w x with + | some ([], []) => + match Nat.ble nx n with + | true => + match Nat.beq nx n with + | true => some ys + | false => q6 (Nat.sub n nx) (fun n' => Runs.remove_fast fuel w n' ys) + | false => + q6 (Nat.sub nx n) (fun nx' => some ((x, nx') :: ys)) + | some (w_rem, []) => + match Nat.beq nx 1 with + | true => + match ys with + | (v, m) :: ys' => + match eqL2 v (w_rem ++ x) with + | true => + match Nat.ble m n with + | false => + q6 (Nat.sub m n) (fun m' => + some (Runs.cons1 x ((v, m') :: ys'))) + | true => + match Nat.beq m n with + | true => q9 (Runs.push x 1 ys') (fun zs => some zs) + | false => + match Nat.beq (Nat.add m 1) n with + | true => Runs.remove_word 16 w_rem ys' + | false => + match Nat.beq (Nat.add m 2) n with + | true => Runs.remove_word 16 (w_rem ++ w) ys' + | false => + q6 (Nat.sub n m) (fun n' => + q9 (Runs.push x 1 ys') (fun zs => + Runs.remove_fast fuel w n' zs)) + | false => + match Runs.remove_word 16 w_rem ys with + | some zs => q6 (Nat.sub n 1) (fun n' => Runs.remove_fast fuel w n' zs) + | none => none + | [] => none + | false => + match Runs.remove_word 16 w ((x, nx) :: ys) with + | some zs => q6 (Nat.sub n 1) (fun n' => Runs.remove_fast fuel w n' zs) + | none => none + | some ([], x_rem) => + match Nat.beq nx 1 with + | true => + q9 (Runs.push x_rem 1 ys) (fun zs => + q6 (Nat.sub n 1) (fun n' => Runs.remove_fast fuel w n' zs)) + | false => + match Nat.beq nx 0 with + | true => none + | false => + q6 (Nat.sub nx 1) (fun nx' => + q6 (Nat.sub n 1) (fun n' => + Runs.remove_fast fuel w n' (Runs.cons1 x_rem ((x, nx') :: ys)))) + | _ => none + | [] => none + +theorem Runs.remove_fast_spec {fuel : ℕ} {w : List (Fin 2)} {n : ℕ} {xs ys : Runs} + (h : Runs.remove_fast fuel w n xs = some ys) : + Runs.denote xs = (w ^ n) +> Runs.denote ys := by + induction fuel generalizing n xs ys with + | zero => + unfold Runs.remove_fast at h + cases hn : Nat.beq n 0 + · rw [hn] at h; contradiction + · rw [hn] at h + injection h with hys; subst hys + have hn0 : n = 0 := Nat.beq_eq.mp hn; subst hn0 + simp + | succ fuel ih => + unfold Runs.remove_fast at h + cases hn : Nat.beq n 0 + · rw [hn] at h + have hn_pos : 0 < n := Nat.pos_of_ne_zero (by intro h0; subst h0; exact Bool.noConfusion hn) + have hn_eq1 : n = (n - 1) + 1 := (Nat.sub_add_cancel hn_pos).symm + rcases xs with _ | ⟨⟨x, nx⟩, ys0⟩ + · contradiction + · simp only [] at h + cases hsp : strip_prefix w x with + | none => rw [hsp] at h; contradiction + | some wx => + rcases wx with ⟨w_rem, x_rem⟩ + rw [hsp] at h + rcases strip_prefix_spec hsp with ⟨hsp1, hsp2⟩ + cases w_rem with + | nil => + cases x_rem with + | nil => + dsimp -failIfUnchanged only at h + have hwx_eq : x = w := by simpa using hsp1 rfl + subst hwx_eq + cases hble : Nat.ble nx n + · rw [hble] at h + simp only [strictNat_eq, Nat.sub_eq] at h + injection h with hys; subst hys + have hlt : n < nx := ble_false hble + have hnx_eq : nx = n + (nx - n) := (Nat.add_sub_of_le (Nat.le_of_lt hlt)).symm + rw [Runs.denote, Runs.denote] + conv_lhs => rw [hnx_eq, qh, append_assoc] + · rw [hble] at h + have hle : nx ≤ n := ble_true hble + cases hbeq : Nat.beq nx n + · rw [hbeq] at h + simp only [strictNat_eq, Nat.sub_eq] at h + rw [Runs.denote, ih h, ← append_assoc, ← qh, Nat.add_sub_of_le hle] + · rw [hbeq] at h + injection h with hys; subst hys + have hnx_eq : nx = n := Nat.beq_eq.mp hbeq; subst hnx_eq + rfl + | cons bx x_tail => + dsimp -failIfUnchanged only at h + have hx_eq : x = w ++ (bx :: x_tail) := hsp1 rfl + cases hnx1 : Nat.beq nx 1 + · rw [hnx1] at h + cases hnx0 : Nat.beq nx 0 + · rw [hnx0] at h + simp only [strictNat_eq, Nat.sub_eq] at h + have hnx_pos : 0 < nx := Nat.pos_of_ne_zero (by intro h0; subst h0; exact Bool.noConfusion hnx0) + have hnx_eq : nx = 1 + (nx - 1) := (Nat.add_sub_of_le hnx_pos).symm + have h_x_pow : x ^ nx = (w ++ (bx :: x_tail)) ++ x ^ (nx - 1) := by + conv_lhs => rw [hnx_eq, qh, pow_succ_list, pow_zero_list, List.append_nil] + rw [← hx_eq] + have h_ih := ih h + rw [Runs.cons1_spec, Runs.denote] at h_ih + rw [Runs.denote, h_x_pow, append_assoc, append_assoc, h_ih] + conv_rhs => rw [hn_eq1, pow_succ_list, append_assoc] + · rw [hnx0] at h; contradiction + · rw [hnx1] at h + simp only [strictRuns_eq, strictNat_eq, Nat.sub_eq] at h + have hnx1_eq : nx = 1 := Nat.beq_eq.mp hnx1; subst hnx1_eq + have h_ih := ih h + rw [Runs.push_spec] at h_ih + simp only [pow_succ_list, pow_zero_list, List.append_nil] at h_ih + rw [Runs.denote, pow_succ_list, pow_zero_list, List.append_nil, hx_eq, append_assoc, h_ih] + conv_rhs => rw [hn_eq1, pow_succ_list, append_assoc] + | cons bw w_tail => + cases x_rem with + | nil => + dsimp -failIfUnchanged only at h + have hw_eq : w = x ++ (bw :: w_tail) := hsp2 rfl + cases hnx1 : Nat.beq nx 1 + · rw [hnx1] at h + cases hrem : Runs.remove_word 16 w ((x, nx) :: ys0) with + | none => rw [hrem] at h; contradiction + | some zs => + rw [hrem] at h + simp only [strictNat_eq, Nat.sub_eq] at h + rw [Runs.remove_word_spec hrem, ih h] + conv_rhs => rw [hn_eq1, pow_succ_list, append_assoc] + · rw [hnx1] at h + have hnx1_eq : nx = 1 := Nat.beq_eq.mp hnx1; subst hnx1_eq + have hx1 : x ^ (1 : ℕ) = x := by simp [pow_succ_list] + rcases ys0 with _ | ⟨⟨v, m⟩, ys'⟩ + · contradiction + · dsimp -failIfUnchanged only at h + cases heq : eqL2 v ((bw :: w_tail) ++ x) + · rw [heq] at h + cases hrem : Runs.remove_word 16 (bw :: w_tail) ((v, m) :: ys') with + | none => rw [hrem] at h; contradiction + | some zs => + rw [hrem] at h + simp only [strictNat_eq, Nat.sub_eq] at h + rw [Runs.denote, hx1, Runs.remove_word_spec hrem, ← append_assoc, ← hw_eq, ih h] + conv_rhs => rw [hn_eq1, pow_succ_list, append_assoc] + · rw [heq] at h + have hv_eq : v = (bw :: w_tail) ++ x := eqL2_iff.mp heq + have hxveq : x ++ v = w ++ x := by rw [hv_eq, hw_eq, List.append_assoc] + have heq1 : x ++ v ^ 1 = w ^ 1 ++ x := by simpa [pow_succ_list] using hxveq + cases hble : Nat.ble m n + · rw [hble] at h + simp only [strictNat_eq, Nat.sub_eq] at h + injection h with hys; subst hys + have hlt : n < m := ble_false hble + have hm_eq : m = n + (m - n) := (Nat.add_sub_of_le (Nat.le_of_lt hlt)).symm + have hk_comm := commute_power heq1 n + simp only [Nat.mul_one] at hk_comm + rw [Runs.denote, Runs.denote, Runs.cons1_spec, Runs.denote, hx1] + conv_lhs => rw [hm_eq, qh] + rw [append_assoc (v ^ n), ← append_assoc x, hk_comm, append_assoc] + · rw [hble] at h + have hle : m ≤ n := ble_true hble + have hk_comm := commute_power heq1 m + simp only [Nat.mul_one] at hk_comm + cases hbeq0 : Nat.beq m n + · rw [hbeq0] at h + cases hbeq1 : Nat.beq (Nat.add m 1) n + · rw [hbeq1] at h + cases hbeq2 : Nat.beq (Nat.add m 2) n + · rw [hbeq2] at h + simp only [strictNat_eq, strictRuns_eq, Nat.sub_eq] at h + have h_ih := ih h + rw [Runs.push_spec, hx1] at h_ih + rw [Runs.denote, Runs.denote, hx1, ← append_assoc, hk_comm, append_assoc, h_ih, ← append_assoc, ← qh, Nat.add_sub_of_le hle] + · rw [hbeq2] at h + have hn_m2 : m + 2 = n := Nat.beq_eq.mp hbeq2; subst hn_m2 + have hrem := Runs.remove_word_spec h + rw [Runs.denote, Runs.denote, hx1, ← append_assoc, hk_comm, append_assoc, hrem] + rw [append_assoc (bw :: w_tail) w, ← append_assoc x (bw :: w_tail), ← hw_eq, ← append_assoc (w ^ m) w, pow_shift, ← append_assoc (w ^ (m + 1)) w, pow_shift] + · rw [hbeq1] at h + have hn_m1 : m + 1 = n := Nat.beq_eq.mp hbeq1; subst hn_m1 + have hrem := Runs.remove_word_spec h + rw [Runs.denote, Runs.denote, hx1, ← append_assoc, hk_comm, append_assoc, hrem] + rw [← append_assoc x, ← hw_eq, ← append_assoc (w ^ m), pow_shift] + · rw [hbeq0] at h + simp only [strictRuns_eq] at h + injection h with hys; subst hys + have hm_n : m = n := Nat.beq_eq.mp hbeq0; subst hm_n + rw [Runs.denote, Runs.denote, Runs.push_spec, hx1, ← append_assoc, hk_comm, append_assoc] + | cons bx x_tail => + dsimp -failIfUnchanged only at h + contradiction + · rw [hn] at h + injection h with hys; subst hys + have hn0 : n = 0 := Nat.beq_eq.mp hn; subst hn0 + simp + +def Runs.zeros : Runs → Bool + | [] => true + | (w, _) :: xs => + match w.all (fun b => Nat.beq b.1 0) with + | true => Runs.zeros xs + | false => false + +theorem Runs.zeros_spec {xs : Runs} (h : Runs.zeros xs = true) : Runs.denote xs = default := by + induction xs with + | nil => rfl + | cons wn xs ih => + rcases wn with ⟨w, n⟩ + unfold Runs.zeros at h + cases hw : w.all (fun b => Nat.beq b.1 0) + · rw [hw] at h; contradiction + · rw [hw] at h + have hw' : w.all (fun b => b == 0) = true := by + rw [List.all_eq_true] at hw ⊢ + intro x hx + rw [beq_iff_eq] + exact Fin.ext (Nat.beq_eq.mp (hw x hx)) + rw [Runs.denote, ih h, qaa hw' n] + +structure RMConfig where + left : Runs + right : Runs + state : Fin 6 + dir : Dir +deriving DecidableEq + +def eqRuns : Runs → Runs → Bool + | [], [] => true + | (w1, n1) :: xs, (w2, n2) :: ys => + match Nat.beq n1 n2 with + | true => + match eqL2 w1 w2 with + | true => eqRuns xs ys + | false => false + | false => false + | _, _ => false + +theorem eqRuns_iff {xs ys : Runs} : eqRuns xs ys = true ↔ xs = ys := by + induction xs generalizing ys with + | nil => cases ys <;> simp [eqRuns] + | cons x xs ih => + rcases x with ⟨w1, n1⟩ + cases ys with + | nil => simp [eqRuns] + | cons y ys => + rcases y with ⟨w2, n2⟩ + unfold eqRuns + cases hn : Nat.beq n1 n2 + · have hne : n1 ≠ n2 := by + intro heq; subst heq; have htrue : Nat.beq n1 n1 = true := Nat.beq_eq.mpr rfl; rw [htrue] at hn; contradiction + simp [hne] + · have heq_n : n1 = n2 := Nat.beq_eq.mp hn + subst heq_n + cases hw : eqL2 w1 w2 + · have hne_w : w1 ≠ w2 := by + intro heq; subst heq; have htrue : eqL2 w1 w1 = true := eqL2_iff.mpr rfl; rw [htrue] at hw; contradiction + simp [hne_w] + · have heq_w : w1 = w2 := eqL2_iff.mp hw + subst heq_w + simp [ih] + +@[inline] def eqDir : Dir → Dir → Bool + | .left, .left => true + | .right, .right => true + | _, _ => false + +theorem eqDir_iff {d1 d2 : Dir} : eqDir d1 d2 = true ↔ d1 = d2 := by + cases d1 <;> cases d2 <;> simp [eqDir] + +def eqOptCfg (o : Option RMConfig) (c : RMConfig) : Bool := + match o with + | none => false + | some ⟨l1, r1, q1, d1⟩ => + match Nat.beq q1.1 c.state.1 with + | true => + match eqDir d1 c.dir with + | true => + match eqRuns l1 c.left with + | true => eqRuns r1 c.right + | false => false + | false => false + | false => false + +theorem eqOptCfg_spec {o : Option RMConfig} {c : RMConfig} (h : eqOptCfg o c = true) : + o = some c := by + rcases o with _ | ⟨l1, r1, q1, d1⟩ + · contradiction + · rcases c with ⟨l2, r2, q2, d2⟩ + unfold eqOptCfg at h + dsimp -failIfUnchanged only at h + cases hq : Nat.beq q1.1 q2.1 + · rw [hq] at h; contradiction + · rw [hq] at h + cases hd : eqDir d1 d2 + · rw [hd] at h; contradiction + · rw [hd] at h + cases hl : eqRuns l1 l2 + · rw [hl] at h; contradiction + · rw [hl] at h + have hq_eq : q1 = q2 := Fin.ext (Nat.beq_eq.mp hq) + have hd_eq : d1 = d2 := eqDir_iff.mp hd + have hl_eq : l1 = l2 := eqRuns_iff.mp hl + have hr_eq : r1 = r2 := eqRuns_iff.mp h + subst hq_eq hd_eq hl_eq hr_eq + rfl + +def RMConfig.denote (c : RMConfig) : Cfg (Fin 2) (Fin 6) := + match c.dir with + | .left => Runs.denote c.left <{{c.state}} Runs.denote c.right + | .right => Runs.denote c.left {{c.state}}> Runs.denote c.right + +def qk (d : Dir) (c : RMConfig) : RMConfig := + match d, c.dir with + | .left, .right => + match Runs.pop c.right with + | (b, r') => + q9 (Runs.push [b] 1 c.left) (fun l' => + ⟨l', r', c.state, .left⟩) + | .right, .left => + match Runs.pop c.left with + | (b, l') => + q9 (Runs.push [b] 1 c.right) (fun r' => + ⟨l', r', c.state, .right⟩) + | _, _ => c + +theorem qR (d : Dir) (c : RMConfig) : (qk d c).denote = c.denote := by + rcases c with ⟨l, r, q, cd⟩ + cases d <;> cases cd <;> try rfl + · unfold qk RMConfig.denote + simp only [strictRuns_eq] + rw [Runs.push_spec, Runs.pop_spec r] + simp only [pow_succ_list, pow_zero_list, List.append_nil, append_cons, append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] + · unfold qk RMConfig.denote + simp only [strictRuns_eq] + rw [Runs.push_spec, Runs.pop_spec l] + simp only [pow_succ_list, pow_zero_list, List.append_nil, append_cons, append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] + +theorem qa3 (d : Dir) (c : RMConfig) : (qk d c).dir = d := by + rcases c with ⟨l, r, q, cd⟩ + cases d <;> cases cd <;> simp [qk] + +theorem qG (d : Dir) (c : RMConfig) : (qk d c).state = c.state := by + rcases c with ⟨l, r, q, cd⟩ + cases d <;> cases cd <;> simp [qk] + +structure Scan where + q : Fin 6 + dir : Dir + scan_in : List (Fin 2) + scan_out : List (Fin 2) + context : List (Fin 2) + +def qc (tm : Machine (Fin 2) (Fin 6)) (s : Scan) : Prop := + ∀ (n : ℕ) (l r : ListBlank (Fin 2)), + match s.dir with + | .right => + ((s.context +> l) {{s.q}}> ((s.scan_in ^ n) +> r)) [tm]⊢* + ((s.context +> (s.scan_out ^ n) +> l) {{s.q}}> r) + | .left => + (((s.scan_in ^ n) +> l) <{{s.q}} (s.context +> r)) [tm]⊢* + (l <{{s.q}} (s.context +> (s.scan_out ^ n) +> r)) + +theorem qt {tm : Machine (Fin 2) (Fin 6)} {s : Scan} (hd : s.dir = .right) + (hbase : ∀ l r, ((s.context +> l) {{s.q}}> (s.scan_in +> r)) [tm]⊢* + ((s.context +> s.scan_out +> l) {{s.q}}> r)) : + qc tm s := by + unfold qc + intro n l r + rw [hd] + dsimp -failIfUnchanged only + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [pow_succ_list, append_assoc] + have h1 := hbase l ((s.scan_in ^ n) +> r) + have h2 := ih (s.scan_out +> l) r + rw [← append_assoc (s.scan_out ^ n) s.scan_out l, pow_shift] at h2 + exact q1 h1 h2 + +theorem qe {tm : Machine (Fin 2) (Fin 6)} {s : Scan} (hd : s.dir = .left) + (hbase : ∀ l r, ((s.scan_in +> l) <{{s.q}} (s.context +> r)) [tm]⊢* + (l <{{s.q}} (s.context +> s.scan_out +> r))) : + qc tm s := by + unfold qc + intro n l r + rw [hd] + dsimp -failIfUnchanged only + induction n generalizing l r with + | zero => exact ⟨0, rfl⟩ + | succ n ih => + rw [pow_succ_list, append_assoc] + have h1 := hbase ((s.scan_in ^ n) +> l) r + have h2 := ih l (s.scan_out +> r) + rw [← append_assoc (s.scan_out ^ n) s.scan_out r, pow_shift] at h2 + exact q1 h1 h2 + +def ql := Runs.remove_fast 16 + +def qA (s : Scan) (n : ℕ) (l r : Runs) : Option (Runs × Runs) := + match s.dir with + | .left => + match Runs.remove_word 16 s.context r, ql s.scan_in n l with + | some r', some l' => + q9 (Runs.push s.scan_out n r') (fun r1 => + match s.context with + | [] => some (l', r1) + | c0 :: cs => some (l', Runs.cons1 (c0 :: cs) r1)) + | _, _ => none + | .right => + match Runs.remove_word 16 s.context l, ql s.scan_in n r with + | some l', some r' => + q9 (Runs.push s.scan_out n l') (fun l1 => + match s.context with + | [] => some (l1, r') + | c0 :: cs => some (Runs.cons1 (c0 :: cs) l1, r')) + | _, _ => none + +theorem qab {tm : Machine (Fin 2) (Fin 6)} {s : Scan} {n : ℕ} {l r l' r' : Runs} + (hv : qc tm s) (h : qA s n l r = some (l', r')) : + (RMConfig.denote ⟨l, r, s.q, s.dir⟩) [tm]⊢* (RMConfig.denote ⟨l', r', s.q, s.dir⟩) := by + unfold qc at hv + rcases s with ⟨q, d, sin, sout, ctx⟩ + have hv_n := hv n + unfold qA ql at h + cases d + · dsimp -failIfUnchanged only at h hv_n + cases hr : Runs.remove_word 16 ctx r with + | none => rw [hr] at h; contradiction + | some r0 => + rw [hr] at h + cases hl : Runs.remove_fast 16 sin n l with + | none => rw [hl] at h; contradiction + | some l0 => + rw [hl] at h + simp only [strictRuns_eq] at h + cases ctx with + | nil => + injection h with hpair; injection hpair with hl' hr'; subst hl' hr' + unfold RMConfig.denote; dsimp -failIfUnchanged only + rw [Runs.push_spec, Runs.remove_word_spec hr, Runs.remove_fast_spec hl, append_nil] + simpa only [append_nil] using hv_n (Runs.denote l0) (Runs.denote r0) + | cons c0 cs => + injection h with hpair; injection hpair with hl' hr'; subst hl' hr' + unfold RMConfig.denote; dsimp -failIfUnchanged only + rw [Runs.cons1_spec, Runs.push_spec, Runs.remove_word_spec hr, Runs.remove_fast_spec hl] + exact hv_n (Runs.denote l0) (Runs.denote r0) + · dsimp -failIfUnchanged only at h hv_n + cases hl : Runs.remove_word 16 ctx l with + | none => rw [hl] at h; contradiction + | some l0 => + rw [hl] at h + cases hr : Runs.remove_fast 16 sin n r with + | none => rw [hr] at h; contradiction + | some r0 => + rw [hr] at h + simp only [strictRuns_eq] at h + cases ctx with + | nil => + injection h with hpair; injection hpair with hl' hr'; subst hl' hr' + unfold RMConfig.denote; dsimp -failIfUnchanged only + rw [Runs.push_spec, Runs.remove_word_spec hl, Runs.remove_fast_spec hr, append_nil] + simpa only [append_nil] using hv_n (Runs.denote l0) (Runs.denote r0) + | cons c0 cs => + injection h with hpair; injection hpair with hl' hr'; subst hl' hr' + unfold RMConfig.denote; dsimp -failIfUnchanged only + rw [Runs.cons1_spec, Runs.push_spec, Runs.remove_word_spec hl, Runs.remove_fast_spec hr] + exact hv_n (Runs.denote l0) (Runs.denote r0) + +def use_scan (s : Scan) (n : ℕ) (c : RMConfig) : Option RMConfig := + match Nat.beq c.state.1 s.q.1 with + | true => + match qk s.dir c with + | ⟨zl, zr, _, _⟩ => + match qA s n zl zr with + | some (l, r) => some ⟨l, r, s.q, s.dir⟩ + | none => none + | false => none + +theorem use_scan_spec {tm : Machine (Fin 2) (Fin 6)} {s : Scan} {n : ℕ} {c c' : RMConfig} + (hv : qc tm s) (h : use_scan s n c = some c') : + (c.denote) [tm]⊢* (c'.denote) := by + unfold use_scan at h + cases hq : Nat.beq c.state.1 s.q.1 + · rw [hq] at h; contradiction + · rw [hq] at h + have hq_eq : c.state = s.q := Fin.ext (Nat.beq_eq.mp hq) + rw [← qR s.dir c] + have hd_z : (qk s.dir c).dir = s.dir := qa3 s.dir c + have hq_z : (qk s.dir c).state = s.q := by rw [qG, hq_eq] + rcases hz : qk s.dir c with ⟨l, r, qz, dz⟩ + rw [hz] at hd_z hq_z h + dsimp -failIfUnchanged only at hd_z hq_z h + subst hd_z hq_z + cases hs : qA s n l r with + | none => rw [hs] at h; contradiction + | some lr => + rcases lr with ⟨l', r'⟩ + rw [hs] at h + injection h with hc'; subst hc' + exact qab hv hs + +def Runs.remove_one (w : List (Fin 2)) (xs : Runs) : Option Runs := + match xs with + | (v, 1) :: ys => + match eqL2 w v with + | true => some ys + | false => Runs.remove_word 16 w xs + | _ => Runs.remove_word 16 w xs + +theorem Runs.remove_one_spec {w : List (Fin 2)} {xs ys : Runs} + (h : Runs.remove_one w xs = some ys) : + Runs.denote xs = w +> Runs.denote ys := by + unfold Runs.remove_one at h + rcases xs with _ | ⟨⟨v, _ | _ | m⟩, rest⟩ + · exact Runs.remove_word_spec h + · exact Runs.remove_word_spec h + · simp only [Nat.zero_add] at h ⊢ + cases hwv : eqL2 w v + · simp only [hwv] at h + exact Runs.remove_word_spec h + · simp only [hwv] at h + injection h with hys; subst hys + have hwv_eq : w = v := eqL2_iff.mp hwv + subst hwv_eq + simp [Runs.denote, pow_succ_list] + · exact Runs.remove_word_spec h + +def Runs.remove_exact (w : List (Fin 2)) (n : ℕ) (xs : Runs) : Option Runs := + match Nat.beq n 0 with + | true => some xs + | false => + match xs with + | (v, m) :: ys => + match eqL2 w v with + | true => + match Nat.ble m n with + | false => + q6 (Nat.sub m n) (fun m' => some ((v, m') :: ys)) + | true => + match Nat.beq n m with + | true => some ys + | false => q6 (Nat.sub n m) (fun n' => Runs.remove_fast 16 w n' ys) + | false => + match Nat.beq n 1 with + | true => Runs.remove_word 16 w ((v, m) :: ys) + | false => Runs.remove_fast 16 w n ((v, m) :: ys) + | [] => none + +theorem Runs.remove_exact_spec {w : List (Fin 2)} {n : ℕ} {xs ys : Runs} + (h : Runs.remove_exact w n xs = some ys) : + Runs.denote xs = (w ^ n) +> Runs.denote ys := by + unfold Runs.remove_exact at h + cases hn0 : Nat.beq n 0 + · rw [hn0] at h + rcases xs with _ | ⟨⟨v, m⟩, rest⟩ + · contradiction + · dsimp -failIfUnchanged only at h + cases hwv : eqL2 w v + · rw [hwv] at h + cases hn1 : Nat.beq n 1 + · rw [hn1] at h + exact Runs.remove_fast_spec h + · rw [hn1] at h + have hn1_eq : n = 1 := Nat.beq_eq.mp hn1; subst hn1_eq + simpa [pow_succ_list] using Runs.remove_word_spec h + · rw [hwv] at h + have hwv_eq : w = v := eqL2_iff.mp hwv; subst hwv_eq + cases hble : Nat.ble m n + · rw [hble] at h + simp only [strictNat_eq, Nat.sub_eq] at h + injection h with hys; subst hys + have hlt : n < m := ble_false hble + have hm_eq : m = n + (m - n) := (Nat.add_sub_of_le (Nat.le_of_lt hlt)).symm + rw [Runs.denote, Runs.denote] + conv_lhs => rw [hm_eq, qh, append_assoc] + · rw [hble] at h + have hle : m ≤ n := ble_true hble + cases hnm : Nat.beq n m + · rw [hnm] at h + simp only [strictNat_eq, Nat.sub_eq] at h + rw [Runs.denote, Runs.remove_fast_spec h, ← append_assoc, ← qh, Nat.add_sub_of_le hle] + · rw [hnm] at h + injection h with hys; subst hys + have hnm_eq : n = m := Nat.beq_eq.mp hnm; subst hnm_eq + rfl + · rw [hn0] at h + injection h with hys; subst hys + have hn : n = 0 := Nat.beq_eq.mp hn0; subst hn + simp + +def qm : qK → Runs → Option Runs + | [], r => some r + | (p, n) :: xs, r => + match Runs.remove_one (q0 p) r with + | none => none + | some r1 => + match Runs.remove_exact W n r1 with + | none => none + | some r2 => qm xs r2 + +theorem qa1 {xs : qK} {r r' : Runs} + (h : qm xs r = some r') : + Runs.denote r = (qg xs) +> Runs.denote r' := by + induction xs generalizing r with + | nil => + unfold qm at h + injection h with hr'; subst hr'; rfl + | cons pn xs ih => + rcases pn with ⟨p, n⟩ + unfold qm at h + cases hr1 : Runs.remove_one (q0 p) r with + | none => rw [hr1] at h; contradiction + | some r1 => + rw [hr1] at h + dsimp -failIfUnchanged only at h + cases hr2 : Runs.remove_exact W n r1 with + | none => rw [hr2] at h; contradiction + | some r2 => + rw [hr2] at h + dsimp -failIfUnchanged only at h + rw [Runs.remove_one_spec hr1, Runs.remove_exact_spec hr2, ih h, qg, append_assoc, append_assoc] + +def qL : qK → Runs → Runs + | [], r => r + | (p, n) :: xs, r => + q9 (qL xs r) (fun r1 => + match Nat.beq n 0 with + | true => Runs.push (q0 p) 1 r1 + | false => + q9 (Runs.push W n r1) (fun r2 => + Runs.cons1 (q0 p) r2)) + +theorem qaf (xs : qK) (r : Runs) : + Runs.denote (qL xs r) = (qg xs) +> Runs.denote r := by + induction xs with + | nil => rfl + | cons pn xs ih => + rcases pn with ⟨p, n⟩ + unfold qL qg + simp only [strictRuns_eq] + cases hn : Nat.beq n 0 + · simp only [strictRuns_eq, Runs.cons1_spec, Runs.push_spec, ih, append_assoc] + · have hn0 : n = 0 := Nat.beq_eq.mp hn; subst hn0 + have hw1 : (q0 p) ^ (1 : ℕ) = q0 p := by simp [pow_succ_list] + simp only [Runs.push_spec, ih, hw1, pow_zero_list, List.append_nil, append_assoc] + +def qah (c : Cfg (Fin 2) (Fin 6)) : Cfg (Fin 2) (Fin 6) := + ⟨c.q,⟨c.tape.1,c.tape.right,c.tape.left⟩⟩ +theorem qa6 (c : Cfg (Fin 2) (Fin 6)) : + step target_tm_alias (qah c)=(step qi c).map qah:= by + rcases c with ⟨_ | ⟨q,hq⟩,⟨⟨b,hb⟩,l,r⟩⟩ + · rfl + · rcases q with _ | _ | _ | _ | _ | _ | q <;> try omega + all_goals (rcases b with _ | _ | b <;> first | omega | rfl) +theorem qa4 (c : Cfg (Fin 2) (Fin 6)) (n : ℕ) : + multiStep target_tm_alias (qah c) n=(multiStep qi c n).map qah:= by + induction n with + | zero => rfl + | succ n ih => + rw [multiStep_succ,multiStep_succ,ih] + cases multiStep qi c n with + | none => rfl + | some c' => simp [qa6] +theorem qI (h : IsDoesNotHalt qi) : IsDoesNotHalt target_tm_alias:= by + intro cfg ⟨n,hn⟩ + have hinit : qah (init [])=init []:=rfl + rw [← hinit,qa4] at hn + cases hms : multiStep qi (init []) n with + | none => rw [hms] at hn; contradiction + | some c0 => + rw [hms] at hn + injection hn with hcfg + subst hcfg + rw [qa6] + cases hstep : step qi c0 with + | none => + have hsome:=h c0 ⟨n,hms⟩ + rw [hstep] at hsome + contradiction + | some _ => rfl +abbrev cfg_of := @Counter.cfg_of (Fin 2) (Fin 6) +abbrev LocalState := Counter.LocalState (Fin 2) (Fin 6) +abbrev step_local := @Counter.step_local (Fin 2) (Fin 6) +abbrev step_local_spec := @Counter.step_local_spec (Fin 2) (Fin 6) _ _ +abbrev run_local := @Counter.run_local (Fin 2) (Fin 6) +abbrev run_local_spec := @Counter.run_local_spec (Fin 2) (Fin 6) _ _ +theorem run_local_plus_spec {tm : Machine (Fin 2) (Fin 6)} {n : ℕ} {s1 s2 : LocalState} + (h : run_local tm (n + 1) s1 = some s2) (L R : ListBlank (Fin 2)) : + (cfg_of s1.q s1.d (s1.l +> L) (s1.r +> R)) [tm]⊢⁺ + (cfg_of s2.q s2.d (s2.l +> L) (s2.r +> R)) := + Counter.run_local_plus_eq L R h rfl rfl +theorem qb_local {n : ℕ} {w1 w2 : List (Fin 2)} + (h : run_local qi n ⟨H_L, w1, D, .right⟩ = some ⟨[], H_R ++ w2, A, .left⟩) : + q4 qi 1 0 w1 w2 := by + apply qb + intro l r + simpa only [cfg_of, Counter.cfg_of, append_assoc, append_nil] using run_local_spec h l r +theorem qq_local {nR nL : ℕ} {w1 w_mid w2 : List (Fin 2)} + (hR : run_local qi nR ⟨H_L, w1, D, .right⟩ = some ⟨H_L ++ w_mid, [], D, .right⟩) + (hL : run_local qi nL ⟨w_mid, H_R, A, .left⟩ = some ⟨[], H_R ++ w2, A, .left⟩) : + q4 qi 1 1 w1 w2 := by + apply qq (w_mid := w_mid) + · intro l r + simpa only [cfg_of, Counter.cfg_of, append_assoc, append_nil] using run_local_spec hR l r + · intro l r + simpa only [cfg_of, Counter.cfg_of, append_assoc, append_nil] using run_local_spec hL l r +theorem wall_1 : q4 qi 1 1 W W := + qq_local (nR := 15) (nL := 29) (w_mid := [O,I,O,I,O,I,O,I,O]) (by decide +kernel) (by decide +kernel) +theorem inc0 : q4 qi 1 0 (q0 .D0) (W ++ q0 .D1) := qb_local (n := 58) (by decide +kernel) +theorem inc1 : q4 qi 1 0 (q0 .D1 ++ W) (q0 .D2) := qb_local (n := 170) (by decide +kernel) +theorem inc2 : q4 qi 1 0 (q0 .D2) (W ++ q0 .D3) := qb_local (n := 58) (by decide +kernel) +theorem inc3 : q4 qi 1 0 (q0 .D3) (q0 .D4) := qb_local (n := 70) (by decide +kernel) +theorem inc4 : q4 qi 1 0 (q0 .D4) (W ++ q0 .D5) := qb_local (n := 58) (by decide +kernel) +theorem inc5 : q4 qi 1 0 (q0 .D5) (q0 .D0) := qb_local (n := 114) (by decide +kernel) +theorem inc6 : q4 qi 1 0 (q0 .D6 ++ W) (W ++ q0 .D7) := qb_local (n := 58) (by decide +kernel) +theorem inc7 : q4 qi 1 0 (q0 .D7 ++ W) (q0 .D8) := qb_local (n := 70) (by decide +kernel) +theorem inc8 : q4 qi 1 0 (q0 .D8) (W ++ q0 .D9) := qb_local (n := 58) (by decide +kernel) +theorem inc9 : q4 qi 1 0 (q0 .D9 ++ W) (q0 .D10) := qb_local (n := 98) (by decide +kernel) +theorem inc10 : q4 qi 1 0 (q0 .D10) (W ++ q0 .D11) := qb_local (n := 58) (by decide +kernel) +theorem inc11 : q4 qi 1 1 (q0 .D11) (q0 .D12) := + qq_local (nR := 39) (nL := 61) (w_mid := [I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O]) (by decide +kernel) (by decide +kernel) +theorem inc12 : q4 qi 1 0 (q0 .D12) (W ++ q0 .D13) := qb_local (n := 58) (by decide +kernel) +theorem inc13 : q4 qi 1 0 (q0 .D13) (q0 .D14) := qb_local (n := 70) (by decide +kernel) +theorem inc14 : q4 qi 1 0 (q0 .D14) (W ++ q0 .D15) := qb_local (n := 58) (by decide +kernel) +theorem inc15 : q4 qi 1 1 (q0 .D15) (q0 .D16) := + qq_local (nR := 24) (nL := 32) (w_mid := [I,O,I,O,I,O,I,O,I,O,I,O]) (by decide +kernel) (by decide +kernel) +theorem inc16 : q4 qi 1 0 (q0 .D16) (W ++ q0 .D17) := qb_local (n := 58) (by decide +kernel) +theorem inc17 : q4 qi 1 1 (q0 .D17) (q0 .D6) := + qq_local (nR := 12) (nL := 16) (w_mid := [I,O,I,O,I,O]) (by decide +kernel) (by decide +kernel) +theorem inc18 : q4 qi 1 0 (q0 .D18) (W ++ q0 .D19) := qb_local (n := 58) (by decide +kernel) +theorem inc19 : q4 qi 1 0 (q0 .D19 ++ W) (q0 .D20) := qb_local (n := 86) (by decide +kernel) +theorem inc20 : q4 qi 1 0 (q0 .D20) (W ++ q0 .D21) := qb_local (n := 58) (by decide +kernel) +theorem inc21 : q4 qi 1 1 (q0 .D21) (q0 .D18) := + qq_local (nR := 36) (nL := 48) (w_mid := [I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O]) (by decide +kernel) (by decide +kernel) +theorem one (p : Digit) (n : ℕ) : + q4 qi 1 (qo p) + (q0 p ++ W ^ (take p + n)) + (W ^ (qY p) ++ q0 (qQ p) ++ W ^ n):= by + cases p + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + have h:=q3 inc0 (qd qi (W ^ n)) + rw [Nat.zero_add,pow_succ_list,pow_zero_list,List.append_nil] + simpa only [List.append_assoc] using h + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + have h:=q3 inc1 (qd qi (W ^ n)) + have h1 : 1 + n=n + 1:= by omega + rw [h1,pow_succ_list,pow_zero_list,List.nil_append] + simpa only [List.append_assoc] using h + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + have h:=q3 inc2 (qd qi (W ^ n)) + rw [Nat.zero_add,pow_succ_list,pow_zero_list,List.append_nil] + simpa only [List.append_assoc] using h + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + simpa only [Nat.zero_add,pow_zero_list,List.nil_append,List.append_assoc] using q3 inc3 (qd qi (W ^ n)) + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + have h:=q3 inc4 (qd qi (W ^ n)) + rw [Nat.zero_add,pow_succ_list,pow_zero_list,List.append_nil] + simpa only [List.append_assoc] using h + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + simpa only [Nat.zero_add,pow_zero_list,List.nil_append,List.append_assoc] using q3 inc5 (qd qi (W ^ n)) + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + have h:=q3 inc6 (qd qi (W ^ n)) + have h1 : 1 + n=n + 1:= by omega + rw [h1,pow_succ_list,pow_succ_list,pow_zero_list,List.append_nil] + simpa only [List.append_assoc] using h + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + have h:=q3 inc7 (qd qi (W ^ n)) + have h1 : 1 + n=n + 1:= by omega + rw [h1,pow_succ_list,pow_zero_list,List.nil_append] + simpa only [List.append_assoc] using h + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + have h:=q3 inc8 (qd qi (W ^ n)) + rw [Nat.zero_add,pow_succ_list,pow_zero_list,List.append_nil] + simpa only [List.append_assoc] using h + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + have h:=q3 inc9 (qd qi (W ^ n)) + have h1 : 1 + n=n + 1:= by omega + rw [h1,pow_succ_list,pow_zero_list,List.nil_append] + simpa only [List.append_assoc] using h + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + have h:=q3 inc10 (qd qi (W ^ n)) + rw [Nat.zero_add,pow_succ_list,pow_zero_list,List.append_nil] + simpa only [List.append_assoc] using h + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + simpa only [Nat.zero_add,pow_zero_list,List.nil_append,List.append_assoc] using q3 inc11 (wall_n wall_1 n) + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + have h:=q3 inc12 (qd qi (W ^ n)) + rw [Nat.zero_add,pow_succ_list,pow_zero_list,List.append_nil] + simpa only [List.append_assoc] using h + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + simpa only [Nat.zero_add,pow_zero_list,List.nil_append,List.append_assoc] using q3 inc13 (qd qi (W ^ n)) + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + have h:=q3 inc14 (qd qi (W ^ n)) + rw [Nat.zero_add,pow_succ_list,pow_zero_list,List.append_nil] + simpa only [List.append_assoc] using h + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + simpa only [Nat.zero_add,pow_zero_list,List.nil_append,List.append_assoc] using q3 inc15 (wall_n wall_1 n) + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + have h:=q3 inc16 (qd qi (W ^ n)) + rw [Nat.zero_add,pow_succ_list,pow_zero_list,List.append_nil] + simpa only [List.append_assoc] using h + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + simpa only [Nat.zero_add,pow_zero_list,List.nil_append,List.append_assoc] using q3 inc17 (wall_n wall_1 n) + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + have h:=q3 inc18 (qd qi (W ^ n)) + rw [Nat.zero_add,pow_succ_list,pow_zero_list,List.append_nil] + simpa only [List.append_assoc] using h + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + have h:=q3 inc19 (qd qi (W ^ n)) + have h1 : 1 + n=n + 1:= by omega + rw [h1,pow_succ_list,pow_zero_list,List.nil_append] + simpa only [List.append_assoc] using h + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + have h:=q3 inc20 (qd qi (W ^ n)) + rw [Nat.zero_add,pow_succ_list,pow_zero_list,List.append_nil] + simpa only [List.append_assoc] using h + · dsimp -failIfUnchanged only [take,qY,qo,qQ] + simpa only [Nat.zero_add,pow_zero_list,List.nil_append,List.append_assoc] using q3 inc21 (wall_n wall_1 n) +theorem emit (r : ListBlank (Fin 2)) : + (([O,I] +> default) <{{A}} (H_R +> r)) [qi]⊢* ((U.reverse +> default) {{D}}> r):= by + have h := run_local_spec (tm := qi) (n := 31) + (s1 := ⟨[O,I,O,O,O], H_R, A, .left⟩) + (s2 := ⟨U.reverse, [], D, .right⟩) + (by decide +kernel) default r + simpa only [cfg_of, Counter.cfg_of, append_cons, append_nil, O_cons_default] using h + +theorem segs_step (segs : List (List ℕ × qK)) (t e : ℕ) (xs ys : qK) (k : ℕ) (r : ListBlank (Fin 2)) + (h : qZ_segs segs = some (t, e, xs, ys)) : + ((U.reverse +> default) {{D}}> ((W ^ k) +> (qg xs) +> r)) [qi]⊢* + ((U.reverse +> default) {{D}}> ((W ^ (k + e)) +> (qg ys) +> r)) := by + apply calls_spec emit t + have hw := walls wall_1 t k + have hb := qZ_segs_spec wall_1 one segs t e xs ys h + have hc := q3 hw hb r r rfl + simpa only [qh, List.append_assoc, append_assoc] using hc + +def step_many : List (List (List ℕ × qK)) → ℕ → Runs → Option (ℕ × Runs) + | [], k, r0 => some (k, r0) + | segs :: rest, k, r0 => + match qZ_segs segs with + | some (_, e, xs, ys) => + match qm xs r0 with + | some r1 => + q6 (Nat.add k e) (fun k' => + q9 (qL ys r1) (fun r2 => + step_many rest k' r2)) + | none => none + | none => none + +theorem step_many_spec (txs : List (List (List ℕ × qK))) (k : ℕ) (r0 : Runs) (ke : ℕ) (rf : Runs) + (h : step_many txs k r0 = some (ke, rf)) : + ((U.reverse +> default) {{D}}> ((W ^ k) +> Runs.denote r0)) [qi]⊢* + ((U.reverse +> default) {{D}}> ((W ^ ke) +> Runs.denote rf)) := by + induction txs generalizing k r0 with + | nil => + unfold step_many at h + injection h with hpair; injection hpair with hke hrf; subst hke hrf + exact ⟨0, rfl⟩ + | cons segs rest ih => + unfold step_many at h + cases hb : qZ_segs segs with + | none => rw [hb] at h; contradiction + | some texy => + rcases texy with ⟨t, e, xs, ys⟩ + rw [hb] at h + dsimp -failIfUnchanged only at h + cases hrc : qm xs r0 with + | none => rw [hrc] at h; contradiction + | some r1 => + rw [hrc] at h + simp only [strictNat_eq, strictRuns_eq, Nat.add_eq] at h + have h_step := segs_step segs t e xs ys k (Runs.denote r1) hb + rw [← qa1 hrc, ← qaf ys r1] at h_step + exact q1 h_step (ih (k + e) (qL ys r1) h) + +def qC_many (k : ℕ) (txs : List (List (List ℕ × qK))) (c : RMConfig) : Option RMConfig := + match Nat.beq c.state.1 3 with + | true => + match qk .right c with + | ⟨zl, zr, _, _⟩ => + match Runs.remove_one U.reverse zl, Runs.remove_exact W k zr with + | some l0, some r0 => + match Runs.zeros l0 with + | true => + match step_many txs k r0 with + | some (ke, rf) => + some ⟨zl, Runs.consN W ke rf, D, .right⟩ + | none => none + | false => none + | _, _ => none + | false => none + +theorem qP_many {k : ℕ} {txs : List (List (List ℕ × qK))} {c c' : RMConfig} + (h : qC_many k txs c = some c') : + (c.denote) [qi]⊢* (c'.denote) := by + unfold qC_many at h + cases hq : Nat.beq c.state.1 3 + · rw [hq] at h; contradiction + · rw [hq] at h + have hq_eq : c.state = D := Fin.ext (Nat.beq_eq.mp hq) + rw [← qR .right c] + have hd_z : (qk .right c).dir = .right := qa3 .right c + have hq_z : (qk .right c).state = D := by rw [qG, hq_eq] + rcases hz : qk .right c with ⟨l, r, qz, dz⟩ + rw [hz] at hd_z hq_z h + dsimp -failIfUnchanged only at hd_z hq_z h + subst hd_z hq_z + cases hl0 : Runs.remove_one U.reverse l with + | none => rw [hl0] at h; contradiction + | some l0 => + rw [hl0] at h + cases hr0 : Runs.remove_exact W k r with + | none => rw [hr0] at h; contradiction + | some r0 => + rw [hr0] at h + dsimp -failIfUnchanged only at h + cases hz0 : Runs.zeros l0 + · rw [hz0] at h; contradiction + · rw [hz0] at h + cases hsm : step_many txs k r0 with + | none => rw [hsm] at h; contradiction + | some kerf => + rcases kerf with ⟨ke, rf⟩ + rw [hsm] at h + injection h with hc'; subst hc' + unfold RMConfig.denote + dsimp -failIfUnchanged only + have hl_den : Runs.denote l = U.reverse +> default := by + rw [Runs.remove_one_spec hl0, Runs.zeros_spec hz0] + rw [hl_den, Runs.consN_spec, Runs.remove_exact_spec hr0] + exact step_many_spec txs k r0 ke rf hsm + +def Runs.toList : Runs → List (Fin 2) + | [] => [] + | (w, n) :: xs => w ^ n ++ Runs.toList xs + +def Runs.push_runs : Runs → Runs → Runs + | [], ys => ys + | (w, n) :: xs, ys => q9 (Runs.push_runs xs ys) (fun zs => Runs.push w n zs) + +theorem Runs.push_runs_spec (xs ys : Runs) : + Runs.denote (Runs.push_runs xs ys) = Runs.toList xs +> Runs.denote ys := by + induction xs with + | nil => rfl + | cons wn xs ih => + rcases wn with ⟨w, n⟩ + simp only [Runs.push_runs, Runs.toList, strictRuns_eq, Runs.push_spec, ih, append_assoc] + +structure MacroRule where + q1 : Fin 6 + d1 : Dir + l_in : List (Fin 2) + r_in : List (Fin 2) + q2 : Fin 6 + d2 : Dir + l_out : Runs + r_out : Runs + +def MacroRule.Valid (tm : Machine (Fin 2) (Fin 6)) (m : MacroRule) : Prop := + ∀ (l r : ListBlank (Fin 2)), + (cfg_of m.q1 m.d1 (m.l_in +> l) (m.r_in +> r)) [tm]⊢* + (cfg_of m.q2 m.d2 (Runs.toList m.l_out +> l) (Runs.toList m.r_out +> r)) + +theorem check_macro_spec {tm : Machine (Fin 2) (Fin 6)} {n : ℕ} {m : MacroRule} + (h : run_local tm n ⟨m.l_in, m.r_in, m.q1, m.d1⟩ = some ⟨Runs.toList m.l_out, Runs.toList m.r_out, m.q2, m.d2⟩) : + MacroRule.Valid tm m := by + intro L R + exact run_local_spec h L R + +def apply_macro (m : MacroRule) (c : RMConfig) : Option RMConfig := + match Nat.beq c.state.1 m.q1.1 with + | true => + match qk m.d1 c with + | ⟨zl, zr, _, _⟩ => + match Runs.remove_word 16 m.l_in zl, Runs.remove_word 16 m.r_in zr with + | some l', some r' => + q9 (Runs.push_runs m.l_out l') (fun l1 => + q9 (Runs.push_runs m.r_out r') (fun r1 => + some ⟨l1, r1, m.q2, m.d2⟩)) + | _, _ => none + | false => none + +theorem apply_macro_spec {tm : Machine (Fin 2) (Fin 6)} {m : MacroRule} {c c' : RMConfig} + (hv : MacroRule.Valid tm m) (h : apply_macro m c = some c') : + (c.denote) [tm]⊢* (c'.denote) := by + unfold apply_macro at h + cases hq : Nat.beq c.state.1 m.q1.1 + · rw [hq] at h; contradiction + · rw [hq] at h + have hq_eq : c.state = m.q1 := Fin.ext (Nat.beq_eq.mp hq) + rw [← qR m.d1 c] + have hd_z : (qk m.d1 c).dir = m.d1 := qa3 m.d1 c + have hq_z : (qk m.d1 c).state = m.q1 := by rw [qG, hq_eq] + rcases hz : qk m.d1 c with ⟨l, r, qz, dz⟩ + rw [hz] at hd_z hq_z h + dsimp -failIfUnchanged only at hd_z hq_z h + subst hd_z hq_z + cases hl : Runs.remove_word 16 m.l_in l with + | none => rw [hl] at h; contradiction + | some l' => + rw [hl] at h + cases hr : Runs.remove_word 16 m.r_in r with + | none => rw [hr] at h; contradiction + | some r' => + rw [hr] at h + simp only [strictRuns_eq] at h + injection h with hc'; subst hc' + have h_lhs : (RMConfig.mk l r m.q1 m.d1).denote = cfg_of m.q1 m.d1 (m.l_in +> Runs.denote l') (m.r_in +> Runs.denote r') := by + cases m.d1 <;> simp [RMConfig.denote, cfg_of, Counter.cfg_of, Runs.remove_word_spec hl, Runs.remove_word_spec hr] + have h_rhs : (RMConfig.mk (Runs.push_runs m.l_out l') (Runs.push_runs m.r_out r') m.q2 m.d2).denote = + cfg_of m.q2 m.d2 (Runs.toList m.l_out +> Runs.denote l') (Runs.toList m.r_out +> Runs.denote r') := by + cases m.d2 <;> simp [RMConfig.denote, cfg_of, Counter.cfg_of, Runs.push_runs_spec] + rw [h_lhs, h_rhs] + exact hv (Runs.denote l') (Runs.denote r') + +def macro_0 : MacroRule := ⟨B, .right, [O], [I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I], B, .right, [([O,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I],1)], []⟩ +theorem macro_0_valid : MacroRule.Valid qi macro_0 := check_macro_spec (n := 36) (by decide +kernel) +def macro_1 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O], [], A, .left, [], [([I,O,I,I,I,I,I,O,I,I,I,I,I,O,I,I,I,I],1)]⟩ +theorem macro_1_valid : MacroRule.Valid qi macro_1 := check_macro_spec (n := 48) (by decide +kernel) +def macro_2 : MacroRule := ⟨D, .right, [], [I], B, .right, [([O],1)], []⟩ +theorem macro_2_valid : MacroRule.Valid qi macro_2 := check_macro_spec (n := 1) (by decide +kernel) +def macro_3 : MacroRule := ⟨B, .right, [O], [I,I,I,I,I,I,I,I,I,I,I,I], B, .right, [([O,O,I,O,I,O,I,O,I,O,I,O,I],1)], []⟩ +theorem macro_3_valid : MacroRule.Valid qi macro_3 := check_macro_spec (n := 24) (by decide +kernel) +def macro_4 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,I,O,I,O,I,O], [], A, .left, [], [([I,O,I,I,I,I,I,O,I,I,I,I],1)]⟩ +theorem macro_4_valid : MacroRule.Valid qi macro_4 := check_macro_spec (n := 32) (by decide +kernel) +def macro_5 : MacroRule := ⟨A, .left, [O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,O,O], [I,O], D, .right, [([O,I,O,I,O,I,O,I,O,O,I],1)], [([I,O,I,I,I],1),([I,I,I,I,I,O,I,I,I],5)]⟩ +theorem macro_5_valid : MacroRule.Valid qi macro_5 := check_macro_spec (n := 205) (by decide +kernel) +def macro_6 : MacroRule := ⟨B, .right, [O], [I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I], B, .right, [([O],1),([O,I],6),([O,I,O,O,I,O,I,O,I],1)], []⟩ +theorem macro_6_valid : MacroRule.Valid qi macro_6 := check_macro_spec (n := 39) (by decide +kernel) +def macro_7 : MacroRule := ⟨B, .right, [O,O,I,O,I,O,I,O,I,O], [I,I,I,I,I,I,O,I,I,I,I,I,O], A, .left, [], [([I,O,I,I,I,I],2),([I,O,I,I,I,I,I,I,I],1),([I],2)]⟩ +theorem macro_7_valid : MacroRule.Valid qi macro_7 := check_macro_spec (n := 85) (by decide +kernel) +def macro_8 : MacroRule := ⟨B, .right, [O], [I,I,I,O], A, .left, [([I],1),([O,I],1)], [([I],2)]⟩ +theorem macro_8_valid : MacroRule.Valid qi macro_8 := check_macro_spec (n := 9) (by decide +kernel) +def macro_9 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,O,O,O,O], [], D, .right, [([O,I,O,I,O,I,O,I,O,O,I],1)], [([I,I,I,I,I,I,I,I,I],1),([I,O,I,I,I,I,I,I,I],5)]⟩ +theorem macro_9_valid : MacroRule.Valid qi macro_9 := check_macro_spec (n := 253) (by decide +kernel) +def macro_10 : MacroRule := ⟨A, .left, [I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,O,O,O], [], B, .right, [([O],1),([O,I,O,O,I,O,I,O,I,O,I],1)], [([I,I,I,I,I],1),([I,O,I,I,I,I,I,I,I],5)]⟩ +theorem macro_10_valid : MacroRule.Valid qi macro_10 := check_macro_spec (n := 155) (by decide +kernel) +def macro_11 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O], [], A, .left, [], [([I,O,I,I,I,I],2),([I,O,I,I,I,I,I,I,I],1)]⟩ +theorem macro_11_valid : MacroRule.Valid qi macro_11 := check_macro_spec (n := 61) (by decide +kernel) +def macro_12 : MacroRule := ⟨B, .right, [O], [I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I], B, .right, [([O,O,I,O,I,O,I,O,I],1),([O],1),([O,I],6)], []⟩ +theorem macro_12_valid : MacroRule.Valid qi macro_12 := check_macro_spec (n := 39) (by decide +kernel) +def macro_13 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,I,O,I,O], [], A, .left, [], [([I,O,I,I,I,I],2),([I,I,I,I,O,I,I,I,I],1)]⟩ +theorem macro_13_valid : MacroRule.Valid qi macro_13 := check_macro_spec (n := 53) (by decide +kernel) +def macro_14 : MacroRule := ⟨B, .right, [O,O,I,O,I,O,I,O,I,O], [I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O], A, .left, [], [([I,O,I,I,I,I],5),([I],2)]⟩ +theorem macro_14_valid : MacroRule.Valid qi macro_14 := check_macro_spec (n := 125) (by decide +kernel) +def macro_15 : MacroRule := ⟨B, .right, [O,O,I,O,I,O,I,O,I,O], [I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O], A, .left, [], [([I,O,I,I,I,I],4),([I],2)]⟩ +theorem macro_15_valid : MacroRule.Valid qi macro_15 := check_macro_spec (n := 97) (by decide +kernel) +def macro_16 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O], [], A, .left, [], [([I,O,I,I,I,I],4)]⟩ +theorem macro_16_valid : MacroRule.Valid qi macro_16 := check_macro_spec (n := 64) (by decide +kernel) +def macro_17 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O], [], A, .left, [], [([I,O,I,I,I,I,I,I,I],1),([I,O,I,I,I,I],2)]⟩ +theorem macro_17_valid : MacroRule.Valid qi macro_17 := check_macro_spec (n := 53) (by decide +kernel) +def macro_18 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,O,O], [], D, .right, [([O,I,O,I,O,I,O,I,O,O,I],1)], [([I,O,I,I,I,I,I,I,I],5)]⟩ +theorem macro_18_valid : MacroRule.Valid qi macro_18 := check_macro_spec (n := 192) (by decide +kernel) +def macro_19 : MacroRule := ⟨B, .right, [O,O], [I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,O], A, .left, [], [([I,O,I,I,I,I],2),([I,O,I,I,I,I,I,I,I],4),([I],1)]⟩ +theorem macro_19_valid : MacroRule.Valid qi macro_19 := check_macro_spec (n := 199) (by decide +kernel) +def macro_20 : MacroRule := ⟨B, .right, [O,O], [I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,O], A, .left, [], [([I],1),([O,I,I,I,I,I,I,I,I],5)]⟩ +theorem macro_20_valid : MacroRule.Valid qi macro_20 := check_macro_spec (n := 179) (by decide +kernel) +def macro_21 : MacroRule := ⟨B, .right, [O,O,I,O,I,O,I,O], [I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,O], A, .left, [], [([I,O,I,I,I,I],2),([I,I,I,I,O,I,I,I,I],1),([I,O,I,I,I,I,I,I,I],3),([I],1)]⟩ +theorem macro_21_valid : MacroRule.Valid qi macro_21 := check_macro_spec (n := 187) (by decide +kernel) +def macro_22 : MacroRule := ⟨B, .left, [I,O,I,O,I,O,I,O,I,O,I,O], [I,I,O], B, .left, [], [([I,I,O],1),([I,I,O,I,I,I],2)]⟩ +theorem macro_22_valid : MacroRule.Valid qi macro_22 := check_macro_spec (n := 32) (by decide +kernel) +def macro_23 : MacroRule := ⟨B, .right, [O], [I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,O], B, .left, [([I],1),([O,I],2)], [([I,I,O],1),([I,I,O,I,I,I,I,I,I],2)]⟩ +theorem macro_23_valid : MacroRule.Valid qi macro_23 := check_macro_spec (n := 97) (by decide +kernel) +def macro_24 : MacroRule := ⟨B, .left, [I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,O,O], [I,I,O], D, .right, [([O,I,O,I,O,I,O,I,O,O,I],1)], [([I,O,I,I,I,I,I,I],1),([I,I,O,I,I,I,I,I,I],5)]⟩ +theorem macro_24_valid : MacroRule.Valid qi macro_24 := check_macro_spec (n := 217) (by decide +kernel) +def macro_25 : MacroRule := ⟨B, .right, [O,O,I,O], [I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,O], A, .left, [], [([I,O],1),([I,I,I,I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],1),([I],2)]⟩ +theorem macro_25_valid : MacroRule.Valid qi macro_25 := check_macro_spec (n := 97) (by decide +kernel) +def macro_26 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,O,O,O], [], B, .right, [([O],1),([O,I,O,O,I,O,I,O,I,O,I],1)], [([I,I],1),([I,I,I,I,O,I,I,I,I],5)]⟩ +theorem macro_26_valid : MacroRule.Valid qi macro_26 := check_macro_spec (n := 150) (by decide +kernel) +def macro_27 : MacroRule := ⟨B, .right, [O,O,I,O], [I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O], A, .left, [], [([I,O],1),([I,I,I,I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],3),([I],2)]⟩ +theorem macro_27_valid : MacroRule.Valid qi macro_27 := check_macro_spec (n := 153) (by decide +kernel) +def macro_28 : MacroRule := ⟨B, .right, [O,O,I,O], [I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,O], A, .left, [], [([I,O,I,I,I,I],2),([I,O,I,I,I,I,I,I,I],1),([I],2)]⟩ +theorem macro_28_valid : MacroRule.Valid qi macro_28 := check_macro_spec (n := 97) (by decide +kernel) +def macro_29 : MacroRule := ⟨B, .right, [O], [I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O], A, .left, [([I],1),([O,I],1)], [([I,O],1),([I,I,I,I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],4),([I],2)]⟩ +theorem macro_29_valid : MacroRule.Valid qi macro_29 := check_macro_spec (n := 193) (by decide +kernel) +def macro_30 : MacroRule := ⟨B, .right, [O,O,I,O,I,O,I,O], [I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,O], A, .left, [], [([I,O,I,I,I,I],2),([I,O,I,I,I,I,I,I,I],3),([I],1)]⟩ +theorem macro_30_valid : MacroRule.Valid qi macro_30 := check_macro_spec (n := 151) (by decide +kernel) +def macro_31 : MacroRule := ⟨B, .right, [O,O], [I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,O], A, .left, [], [([I,O,I,I,I,I],2),([I,I,I,I,O,I,I,I,I],1),([I,O,I,I,I,I,I,I,I],2),([I],1)]⟩ +theorem macro_31_valid : MacroRule.Valid qi macro_31 := check_macro_spec (n := 163) (by decide +kernel) +def macro_32 : MacroRule := ⟨B, .right, [O], [I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,O], A, .left, [([I],1),([O,I],2)], [([I,O,I,I,I,I,I,I,I],4),([I],1)]⟩ +theorem macro_32_valid : MacroRule.Valid qi macro_32 := check_macro_spec (n := 155) (by decide +kernel) +def macro_33 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O], [], A, .left, [], [([I,O],1),([I,I,I,I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],1)]⟩ +theorem macro_33_valid : MacroRule.Valid qi macro_33 := check_macro_spec (n := 61) (by decide +kernel) +def macro_34 : MacroRule := ⟨B, .right, [O,O,I,O], [I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O], A, .left, [], [([I,O],1),([I,I,I,I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],4),([I],2)]⟩ +theorem macro_34_valid : MacroRule.Valid qi macro_34 := check_macro_spec (n := 181) (by decide +kernel) +def macro_35 : MacroRule := ⟨B, .right, [O,O,I,O], [I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,O], A, .left, [], [([I,O],1),([I,I,I,I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],1),([I,O,I,I,I,I,I,I,I],1),([I],2)]⟩ +theorem macro_35_valid : MacroRule.Valid qi macro_35 := check_macro_spec (n := 141) (by decide +kernel) +def macro_36 : MacroRule := ⟨B, .right, [O,O,I,O], [I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O], A, .left, [], [([I,O,I,I,I,I],5),([I],2)]⟩ +theorem macro_36_valid : MacroRule.Valid qi macro_36 := check_macro_spec (n := 137) (by decide +kernel) +def macro_37 : MacroRule := ⟨B, .right, [O,O], [I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,O], A, .left, [], [([I,O,I,I,I,I,I,I,I],4),([I],1)]⟩ +theorem macro_37_valid : MacroRule.Valid qi macro_37 := check_macro_spec (n := 143) (by decide +kernel) +def macro_38 : MacroRule := ⟨B, .right, [O,O,I,O,I,O,I,O,I,O], [I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O], A, .left, [], [([I,O,I,I,I,I],2),([I,O,I,I,I,I,I,I,I],1),([I,O],1),([I,I,I,I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],4),([I],2)]⟩ +theorem macro_38_valid : MacroRule.Valid qi macro_38 := check_macro_spec (n := 269) (by decide +kernel) +def macro_39 : MacroRule := ⟨B, .right, [O,O,I,O,I,O,I,O], [I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,O], A, .left, [], [([I,O,I,I,I,I],2),([I,I,I,I,O,I,I,I,I],1),([I,O,I,I,I,I,I,I,I],2),([I],1)]⟩ +theorem macro_39_valid : MacroRule.Valid qi macro_39 := check_macro_spec (n := 151) (by decide +kernel) +def macro_40 : MacroRule := ⟨B, .right, [O,O,I,O], [I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O], A, .left, [], [([I,O,I,I,I,I],4),([I],2)]⟩ +theorem macro_40_valid : MacroRule.Valid qi macro_40 := check_macro_spec (n := 109) (by decide +kernel) +def macro_41 : MacroRule := ⟨B, .right, [O], [I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I], B, .right, [([O],1),([O,I],12)], []⟩ +theorem macro_41_valid : MacroRule.Valid qi macro_41 := check_macro_spec (n := 48) (by decide +kernel) +def macro_42 : MacroRule := ⟨A, .left, [O,I,O,I,O,I], [I,O], A, .left, [], [([I,O],1),([I,I,O,I,I,I],1)]⟩ +theorem macro_42_valid : MacroRule.Valid qi macro_42 := check_macro_spec (n := 16) (by decide +kernel) +def macro_43 : MacroRule := ⟨A, .left, [O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,O,O], [I,O], D, .right, [([O,I,O,I,O,I,O,I,O,O,I],1)], [([I],1),([O],1),([I],6),([I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],1),([I],2),([I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],1),([I],2)]⟩ +theorem macro_43_valid : MacroRule.Valid qi macro_43 := check_macro_spec (n := 189) (by decide +kernel) +def macro_44 : MacroRule := ⟨B, .left, [I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,I,O,I,O], [I,I,O], B, .left, [], [([I,I,O],1),([I,I,O,I,I,I],2),([I,I,I,I,I,O,I,I,I],1)]⟩ +theorem macro_44_valid : MacroRule.Valid qi macro_44 := check_macro_spec (n := 61) (by decide +kernel) +def macro_45 : MacroRule := ⟨A, .left, [I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O], [], A, .left, [], [([I,O,I,I,I,I],1),([I],3),([I,O,I,I,I,I],1),([I],3),([I,O,I,I,I,I],1),([I],3)]⟩ +theorem macro_45_valid : MacroRule.Valid qi macro_45 := check_macro_spec (n := 63) (by decide +kernel) +def macro_46 : MacroRule := ⟨A, .left, [I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,O,O,O], [], B, .right, [([O],1),([O,I,O,O,I,O,I,O,I,O,I],1)], [([I],5),([I,O,I,I,I,I],1),([I],3),([I,O,I,I,I,I],1),([I],3)]⟩ +theorem macro_46_valid : MacroRule.Valid qi macro_46 := check_macro_spec (n := 92) (by decide +kernel) +def macro_47 : MacroRule := ⟨B, .right, [O,O,I,O,I,O,I,O,I,O], [I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,O], A, .left, [], [([I,O,I,I,I,I],5),([I,O,I,I,I,I,I,I,I],1),([I],2)]⟩ +theorem macro_47_valid : MacroRule.Valid qi macro_47 := check_macro_spec (n := 169) (by decide +kernel) +def macro_48 : MacroRule := ⟨B, .right, [O,O,I,O,I,O,I,O], [I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,O], B, .left, [], [([I,I,O],1),([I,I,O,I,I,I],2),([I,I,O,I,I,I,I,I,I],2)]⟩ +theorem macro_48_valid : MacroRule.Valid qi macro_48 := check_macro_spec (n := 129) (by decide +kernel) +def macro_49 : MacroRule := ⟨B, .right, [O], [I,I,I,I,I,I,O,I,I], B, .right, [([O],1),([O,I,O,O,I,O,I,O,I],1)], []⟩ +theorem macro_49_valid : MacroRule.Valid qi macro_49 := check_macro_spec (n := 15) (by decide +kernel) +def macro_50 : MacroRule := ⟨D, .right, [O,I,O,I,O,I,O,I,O,O,I,O,O,O], [I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,O], D, .right, [([O,I,O,I,O,I,O,I,O,O,I],1)], [([I],1),([O],1),([I],7),([I,O],1),([I,I,I,I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],1),([I],2)]⟩ +theorem macro_50_valid : MacroRule.Valid qi macro_50 := check_macro_spec (n := 189) (by decide +kernel) +def macro_51 : MacroRule := ⟨D, .right, [O,I,O,I,O,I,O,I,O,O,I,O,O,O], [I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O], D, .right, [([O,I,O,I,O,I,O,I,O,O,I],1)], [([I],1),([O],1),([I],6),([I,I,O,I,I,I],1),([I],3),([I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],4),([I],2)]⟩ +theorem macro_51_valid : MacroRule.Valid qi macro_51 := check_macro_spec (n := 289) (by decide +kernel) +def macro_52 : MacroRule := ⟨B, .right, [O,O,I,O], [I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O], A, .left, [], [([I,O],1),([I,I,I,I,I,O,I,I,I],4),([I,I,I,I],1),([I,O,I,I,I,I],3),([I],2)]⟩ +theorem macro_52_valid : MacroRule.Valid qi macro_52 := check_macro_spec (n := 285) (by decide +kernel) +def macro_53 : MacroRule := ⟨B, .right, [O,O,I,O,I,O,I,O,I,O], [I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,O,O], A, .left, [], [([I,O,I,I,I,I],3),([I,O,I,I,I,I,I,I,I],2),([I,O],1),([I,I,I,I,I,O,I,I,I],1),([I,I,I,I,I,I,I],1),([I],1)]⟩ +theorem macro_53_valid : MacroRule.Valid qi macro_53 := check_macro_spec (n := 235) (by decide +kernel) +def macro_54 : MacroRule := ⟨B, .right, [O,O], [I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O,O], A, .left, [], [([I,O,I,I,I,I,I,I,I],1),([I,O,I,I,I,I],3),([I,O,I,I,I,I,I,I,I],1),([I],1)]⟩ +theorem macro_54_valid : MacroRule.Valid qi macro_54 := check_macro_spec (n := 155) (by decide +kernel) +def macro_55 : MacroRule := ⟨D, .right, [], [I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I], B, .right, [([O],1),([O,I],6),([O,I,O,I,O,I,O,I],1),([O,O,I,O,I,O,I,O,I],9),([O],1)], []⟩ +theorem macro_55_valid : MacroRule.Valid qi macro_55 := check_macro_spec (n := 175) (by decide +kernel) +def macro_56 : MacroRule := ⟨B, .right, [O], [I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I], B, .right, [([O,O,I,O,I,O,I,O,I],2),([O],1),([O,I],6),([O,I,O,O,I,O,I,O,I],1)], []⟩ +theorem macro_56_valid : MacroRule.Valid qi macro_56 := check_macro_spec (n := 69) (by decide +kernel) +def macro_57 : MacroRule := ⟨B, .right, [O,O], [I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,O], A, .left, [], [([I,O,I,I,I,I],2),([I,O,I,I,I,I,I,I,I],3),([I],1)]⟩ +theorem macro_57_valid : MacroRule.Valid qi macro_57 := check_macro_spec (n := 163) (by decide +kernel) +def macro_58 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O], [], A, .left, [], [([I,O,I,I,I,I,I,I,I],1),([I,O,I,I,I,I],2),([I,I,I,I,O,I,I,I,I],2)]⟩ +theorem macro_58_valid : MacroRule.Valid qi macro_58 := check_macro_spec (n := 95) (by decide +kernel) +def macro_59 : MacroRule := ⟨B, .right, [O], [I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I], B, .right, [([O],1),([O,I,O,O,I,O,I,O,I],7)], []⟩ +theorem macro_59_valid : MacroRule.Valid qi macro_59 := check_macro_spec (n := 105) (by decide +kernel) +def macro_60 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O], [], A, .left, [], [([I,O,I,I,I,I,I,I,I],7),([I,O,I,I,I,I],5)]⟩ +theorem macro_60_valid : MacroRule.Valid qi macro_60 := check_macro_spec (n := 227) (by decide +kernel) +def macro_61 : MacroRule := ⟨B, .right, [O], [I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I], B, .right, [([O],1),([O,I],6),([O,I,O,O,I,O,I,O,I],1),([O,I,O,I,O,I,O,I],1),([O,O,I,O,I,O,I,O,I],11),([O],1),([O,I],9)], []⟩ +theorem macro_61_valid : MacroRule.Valid qi macro_61 := check_macro_spec (n := 255) (by decide +kernel) +def macro_62 : MacroRule := ⟨B, .right, [O], [I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I], B, .right, [([O,O,I,O,I,O,I,O,I],1),([O],1),([O,I],12)], []⟩ +theorem macro_62_valid : MacroRule.Valid qi macro_62 := check_macro_spec (n := 63) (by decide +kernel) +def macro_63 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O], [], A, .left, [], [([I,O,I,I,I,I],5),([I,I,I,I,O,I,I,I,I],1)]⟩ +theorem macro_63_valid : MacroRule.Valid qi macro_63 := check_macro_spec (n := 101) (by decide +kernel) +def macro_64 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O], [], A, .left, [], [([I,O,I,I,I,I],5)]⟩ +theorem macro_64_valid : MacroRule.Valid qi macro_64 := check_macro_spec (n := 80) (by decide +kernel) +def macro_65 : MacroRule := ⟨B, .right, [O,O,I,O,I,O,I,O], [I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,O], A, .left, [], [([I,O,I,I,I,I],2),([I,O,I,I,I,I,I,I,I],2),([I,O,I,I,I,I],2),([I,O,I,I,I,I,I,I,I],3),([I],1)]⟩ +theorem macro_65_valid : MacroRule.Valid qi macro_65 := check_macro_spec (n := 279) (by decide +kernel) +def macro_66 : MacroRule := ⟨B, .right, [O], [I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I], B, .right, [([O,O,I,O,I,O,I,O,I],9),([O],1),([O,I],6)], []⟩ +theorem macro_66_valid : MacroRule.Valid qi macro_66 := check_macro_spec (n := 159) (by decide +kernel) +def macro_67 : MacroRule := ⟨B, .right, [O], [I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,O], A, .left, [([I],1),([O,I],2)], [([I,O,I,I,I,I,I,I,I],1),([I,O,I,I,I,I],2),([I,O,I,I,I,I,I,I,I],4),([I],1)]⟩ +theorem macro_67_valid : MacroRule.Valid qi macro_67 := check_macro_spec (n := 247) (by decide +kernel) +def macro_68 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O], [], A, .left, [], [([I,O,I,I,I,I,I,I,I],9),([I,O,I,I,I,I],2)]⟩ +theorem macro_68_valid : MacroRule.Valid qi macro_68 := check_macro_spec (n := 221) (by decide +kernel) +def macro_69 : MacroRule := ⟨B, .right, [O,O,I,O,I,O,I,O], [I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,O], A, .left, [], [([I,O,I,I,I,I],3),([I,I,I,I,O,I,I,I,I],1),([I,O,I,I,I,I,I,I,I],3),([I],1)]⟩ +theorem macro_69_valid : MacroRule.Valid qi macro_69 := check_macro_spec (n := 215) (by decide +kernel) +def macro_70 : MacroRule := ⟨B, .right, [O,O,I,O,I,O,I,O], [I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,O], A, .left, [], [([I,O,I,I,I,I],4),([I,O,I,I,I,I,I,I,I],3),([I],1)]⟩ +theorem macro_70_valid : MacroRule.Valid qi macro_70 := check_macro_spec (n := 207) (by decide +kernel) +def macro_71 : MacroRule := ⟨B, .right, [O,O,I,O,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O], [I,I,I,O], A, .left, [], [([I,O,I,I,I,I],2),([I,O,I,I,I,I,I,I,I],1),([I],2)]⟩ +theorem macro_71_valid : MacroRule.Valid qi macro_71 := check_macro_spec (n := 70) (by decide +kernel) +def macro_72 : MacroRule := ⟨B, .left, [I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O], [I,I,O], B, .left, [], [([I,I,O],1),([I,I,O,I,I,I],3)]⟩ +theorem macro_72_valid : MacroRule.Valid qi macro_72 := check_macro_spec (n := 48) (by decide +kernel) +def macro_73 : MacroRule := ⟨B, .left, [I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,O,O], [I,I,O], D, .right, [([O,I,O,I,O,I,O,I,O,O,I],1)], [([I,O,I,I,I],1),([I,I,I,I,I,O,I,I,I],5)]⟩ +theorem macro_73_valid : MacroRule.Valid qi macro_73 := check_macro_spec (n := 204) (by decide +kernel) +def macro_74 : MacroRule := ⟨A, .left, [I,O,I,O,I,O], [], A, .left, [], [([I,O,I,I,I,I],1)]⟩ +theorem macro_74_valid : MacroRule.Valid qi macro_74 := check_macro_spec (n := 16) (by decide +kernel) +def macro_75 : MacroRule := ⟨A, .left, [O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,O,O,O,O], [I,O], D, .right, [([O,I,O,I,O,I,O,I,O,O,I],1)], [([I,I,I,I,I],1),([I,I,I,I,I,O,I,I,I],5)]⟩ +theorem macro_75_valid : MacroRule.Valid qi macro_75 := check_macro_spec (n := 237) (by decide +kernel) +def macro_76 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,O,I,O,I,O,I,O], [], B, .left, [], [([I],1),([I,O],1),([I,I,O,I,I,I],1),([I,I,I,I],1)]⟩ +theorem macro_76_valid : MacroRule.Valid qi macro_76 := check_macro_spec (n := 33) (by decide +kernel) +def macro_77 : MacroRule := ⟨B, .left, [I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,O,O,O,O], [I,I,O], D, .right, [([O,I,O,I,O,I,O,I,O,O,I],1)], [([I],10),([O],1),([I],3),([I,I,I,I],1),([I,O,I,I,I,I],1),([I],2),([I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],1),([I],2)]⟩ +theorem macro_77_valid : MacroRule.Valid qi macro_77 := check_macro_spec (n := 220) (by decide +kernel) +def macro_78 : MacroRule := ⟨A, .left, [O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O], [I,O], B, .right, [([O],1),([O,I],1)], [([I,O],1),([I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],1),([I],2),([I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],1),([I],2),([I,I,O,I,I,I],1)]⟩ +theorem macro_78_valid : MacroRule.Valid qi macro_78 := check_macro_spec (n := 137) (by decide +kernel) +def macro_79 : MacroRule := ⟨B, .right, [O,O,I,O,I,O,I,O,I,O,I,O,O,I,O,O,O], [I,O], D, .right, [([O,I,O,I,O,I,O,I,O,O,I],1)], [([I],1),([O],1),([I],6)]⟩ +theorem macro_79_valid : MacroRule.Valid qi macro_79 := check_macro_spec (n := 68) (by decide +kernel) +def macro_80 : MacroRule := ⟨A, .left, [O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O], [I,O], B, .left, [], [([I],1),([I,O],1),([I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],1),([I],2),([I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],1),([I],2),([I,I,O,I,I,I],1)]⟩ +theorem macro_80_valid : MacroRule.Valid qi macro_80 := check_macro_spec (n := 133) (by decide +kernel) +def macro_81 : MacroRule := ⟨B, .left, [I,O,O,I,O,I,O,I,O,I,O,O,I,O,O,O], [I,I,O], D, .right, [([O,I,O,I,O,I,O,I,O,O,I],1)], [([I],1),([O],1),([I],6)]⟩ +theorem macro_81_valid : MacroRule.Valid qi macro_81 := check_macro_spec (n := 72) (by decide +kernel) +def macro_82 : MacroRule := ⟨B, .left, [I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I], [I,I,O], A, .left, [], [([I,O],1),([I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],1),([I],2)]⟩ +theorem macro_82_valid : MacroRule.Valid qi macro_82 := check_macro_spec (n := 57) (by decide +kernel) +def macro_83 : MacroRule := ⟨A, .left, [O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,O,O], [I,O], D, .right, [([O,I,O,I,O,I,O,I,O,O,I],1)], [([I],1),([O],1),([I],6),([I,I,O,I,I,I],1),([I],3),([I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],1),([I],2)]⟩ +theorem macro_83_valid : MacroRule.Valid qi macro_83 := check_macro_spec (n := 160) (by decide +kernel) +def macro_84 : MacroRule := ⟨B, .right, [O,O,I,O,O,I,O,I,O,I,O,I,O,I,O,I,O], [I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,O], A, .left, [], [([I,O,I,I,I,I],2),([I,I,I,I,O,I,I,I,I],1),([I,O,I,I,I,I,I,I,I],3),([I],1)]⟩ +theorem macro_84_valid : MacroRule.Valid qi macro_84 := check_macro_spec (n := 172) (by decide +kernel) +def macro_85 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,O,I,O], [], A, .left, [], [([I,O,I,I,I,I,I,I,I],1)]⟩ +theorem macro_85_valid : MacroRule.Valid qi macro_85 := check_macro_spec (n := 29) (by decide +kernel) +def macro_86 : MacroRule := ⟨A, .left, [O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I], [I,O], A, .left, [], [([I,O],1),([I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],1),([I],2),([I,I,O,I,I,I],1)]⟩ +theorem macro_86_valid : MacroRule.Valid qi macro_86 := check_macro_spec (n := 74) (by decide +kernel) +def macro_87 : MacroRule := ⟨A, .left, [O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,O,O], [I,O], D, .right, [([O,I,O,I,O,I,O,I,O,O,I],1)], [([I],1),([O],1),([I],6),([I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],1),([I],2)]⟩ +theorem macro_87_valid : MacroRule.Valid qi macro_87 := check_macro_spec (n := 131) (by decide +kernel) +def macro_88 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,O,I,O,I,O,I], [], A, .left, [], [([I,O],1),([I,I,O,I,I,I],1),([I,I,I,I],1)]⟩ +theorem macro_88_valid : MacroRule.Valid qi macro_88 := check_macro_spec (n := 32) (by decide +kernel) +def macro_89 : MacroRule := ⟨A, .left, [O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,O,O,O,O], [I,O], D, .right, [([O,I,O,I,O,I,O,I,O,O,I],1)], [([I],10),([O],1),([I],3),([I,I,I,I],1),([I,O,I,I,I,I],1),([I],2),([I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],1),([I],2)]⟩ +theorem macro_89_valid : MacroRule.Valid qi macro_89 := check_macro_spec (n := 221) (by decide +kernel) +def macro_90 : MacroRule := ⟨B, .right, [O,O,I,O], [I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O], A, .left, [], [([I,O,I,I,I,I],2),([I,O,I,I,I,I,I,I,I],1),([I,O],1),([I,I,I,I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],4),([I],2)]⟩ +theorem macro_90_valid : MacroRule.Valid qi macro_90 := check_macro_spec (n := 281) (by decide +kernel) +def macro_91 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O], [], B, .right, [([O],1),([O,I],1)], [([I,O,I,I,I,I],2),([I],2),([I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],1),([I],2),([I,I,O,I,I,I],1),([I,I,I,I],1)]⟩ +theorem macro_91_valid : MacroRule.Valid qi macro_91 := check_macro_spec (n := 137) (by decide +kernel) +def macro_92 : MacroRule := ⟨B, .right, [O,O,I,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,O,O,O,O], [I,O], D, .right, [([O,I,O,I,O,I,O,I,O,O,I],1)], [([I],10),([O],1),([I],3)]⟩ +theorem macro_92_valid : MacroRule.Valid qi macro_92 := check_macro_spec (n := 116) (by decide +kernel) +def macro_93 : MacroRule := ⟨A, .left, [O,I,O,I,O,I,O,I,O], [I,O], A, .left, [([I],1),([O,I],1)], [([I],2),([I,I,O,I,I,I],1)]⟩ +theorem macro_93_valid : MacroRule.Valid qi macro_93 := check_macro_spec (n := 26) (by decide +kernel) +def macro_94 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,I,O,O,O], [], D, .right, [([O,I,O,I,O,I,O,I,O,O,I],1)], [([I],1),([O],1),([I],6),([I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],1),([I],2),([I,I,O,I,I,I],1),([I,I,I,I],1),([I,O,I,I,I,I],1)]⟩ +theorem macro_94_valid : MacroRule.Valid qi macro_94 := check_macro_spec (n := 179) (by decide +kernel) +def macro_95 : MacroRule := ⟨B, .right, [O], [I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,O], A, .left, [([O,O,I,O,I,O,I],1)], [([I],1),([O],1),([I],1),([I,O,I,I,I,I],2),([I],2)]⟩ +theorem macro_95_valid : MacroRule.Valid qi macro_95 := check_macro_spec (n := 79) (by decide +kernel) +def macro_96 : MacroRule := ⟨A, .right, [O,O,O,O,O,O,O,O,O,O,O,O], [O,O,O,O,O,O], B, .right, [([O],1),([O,I,O,O,I,O,I,O,I,O,I],1)], [([I],6)]⟩ +theorem macro_96_valid : MacroRule.Valid qi macro_96 := check_macro_spec (n := 116) (by decide +kernel) +def macro_97 : MacroRule := ⟨B, .right, [O,O,I,O,I,O,I,O], [O,O], D, .right, [([O],1),([I],1)], [([I],2),([O],1),([I],5)]⟩ +theorem macro_97_valid : MacroRule.Valid qi macro_97 := check_macro_spec (n := 14) (by decide +kernel) +def macro_98 : MacroRule := ⟨D, .right, [O,I,O,I,I,O,O,I,O,I,O,I,O,I,O,O,O,O,O,O,O], [O], B, .right, [([O],2),([I],1),([O],1),([I],1),([O],1),([I],1),([O],1),([I],1),([O],2),([I],1)], [([I],6),([O],1),([I],3)]⟩ +theorem macro_98_valid : MacroRule.Valid qi macro_98 := check_macro_spec (n := 79) (by decide +kernel) +def macro_99 : MacroRule := ⟨B, .right, [O,O], [O,O], A, .left, [], [([I],4)]⟩ +theorem macro_99_valid : MacroRule.Valid qi macro_99 := check_macro_spec (n := 7) (by decide +kernel) +def macro_100 : MacroRule := ⟨A, .left, [I,O,I,O,I,O], [], D, .right, [([O],1),([I],1)], [([I],2),([O],1),([I],1)]⟩ +theorem macro_100_valid : MacroRule.Valid qi macro_100 := check_macro_spec (n := 7) (by decide +kernel) +def macro_101 : MacroRule := ⟨D, .right, [O,I,O,I,I,O,I,O,I,O,I,O,O,I,O,O,O,O], [O], B, .right, [([O],1),([O,I,O,O,I,O,I,O,I,O,I],1)], [([I],3),([O],1),([I],3)]⟩ +theorem macro_101_valid : MacroRule.Valid qi macro_101 := check_macro_spec (n := 50) (by decide +kernel) +def macro_102 : MacroRule := ⟨B, .left, [O,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,O,O,O,O], [I,O], B, .right, [([O],2),([I],1),([O],1),([I],1),([O],1),([I],1),([O],1),([I],1),([O],2),([I],1)], [([I],10)]⟩ +theorem macro_102_valid : MacroRule.Valid qi macro_102 := check_macro_spec (n := 113) (by decide +kernel) +def macro_103 : MacroRule := ⟨B, .right, [], [O,O], A, .left, [([I],1)], [([I],1)]⟩ +theorem macro_103_valid : MacroRule.Valid qi macro_103 := check_macro_spec (n := 2) (by decide +kernel) +def macro_104 : MacroRule := ⟨A, .left, [I,O,I,O], [], B, .left, [], [([I],2),([O],1),([I],1)]⟩ +theorem macro_104_valid : MacroRule.Valid qi macro_104 := check_macro_spec (n := 4) (by decide +kernel) +def macro_105 : MacroRule := ⟨B, .left, [O,O,I,I,O,I,O,I,O], [I,O], D, .right, [([O],1),([I],1)], [([I],2),([O],1),([I],2),([O],1),([I],3)]⟩ +theorem macro_105_valid : MacroRule.Valid qi macro_105 := check_macro_spec (n := 14) (by decide +kernel) +def macro_106 : MacroRule := ⟨B, .left, [O,O,I], [I,O], A, .left, [], [([I],1),([O],1),([I],3)]⟩ +theorem macro_106_valid : MacroRule.Valid qi macro_106 := check_macro_spec (n := 7) (by decide +kernel) +def macro_107 : MacroRule := ⟨A, .left, [I,O,I,O,I,O,I,O,I,O,I,O,O,I,O,O,O], [], D, .right, [([O,I,O,I,O,I,O,I,O,O,I],1)], [([I],1),([O],1),([I],4)]⟩ +theorem macro_107_valid : MacroRule.Valid qi macro_107 := check_macro_spec (n := 63) (by decide +kernel) +def macro_108 : MacroRule := ⟨A, .left, [I,O,O], [], A, .left, [], [([I],3)]⟩ +theorem macro_108_valid : MacroRule.Valid qi macro_108 := check_macro_spec (n := 5) (by decide +kernel) +def macro_109 : MacroRule := ⟨A, .left, [I,O,O,I,O,I,O,I,O,I,O,O,I,O,O,O,O], [], B, .right, [([O],1),([O,I,O,O,I,O,I,O,I,O,I],1)], [([I],5)]⟩ +theorem macro_109_valid : MacroRule.Valid qi macro_109 := check_macro_spec (n := 50) (by decide +kernel) +def macro_110 : MacroRule := ⟨B, .left, [O], [I,O], A, .left, [([I],1)], [([I],2)]⟩ +theorem macro_110_valid : MacroRule.Valid qi macro_110 := check_macro_spec (n := 4) (by decide +kernel) +def macro_111 : MacroRule := ⟨A, .left, [O], [], B, .left, [], [([I],1)]⟩ +theorem macro_111_valid : MacroRule.Valid qi macro_111 := check_macro_spec (n := 1) (by decide +kernel) +def macro_112 : MacroRule := ⟨B, .left, [O,O,I,I,O,I,O,I,O,O,I,O,I,O,I,O,I,O,O,O,O,O,O], [I,O], D, .right, [([O,I,O,I,O,I,O,I,O,O,I],1)], [([I],10),([O],1),([I],3)]⟩ +theorem macro_112_valid : MacroRule.Valid qi macro_112 := check_macro_spec (n := 115) (by decide +kernel) +def macro_113 : MacroRule := ⟨B, .left, [O,O,I,O,I,O,I,O,I,O,I,O,O,I,O,O,O], [I,O], D, .right, [([O,I,O,I,O,I,O,I,O,O,I],1)], [([I],1),([O],1),([I],6)]⟩ +theorem macro_113_valid : MacroRule.Valid qi macro_113 := check_macro_spec (n := 67) (by decide +kernel) +def macro_114 : MacroRule := ⟨B, .right, [], [O,I], D, .right, [([O],1),([I],1)], []⟩ +theorem macro_114_valid : MacroRule.Valid qi macro_114 := check_macro_spec (n := 2) (by decide +kernel) +def macro_115 : MacroRule := ⟨D, .right, [O], [O], A, .left, [], [([I],2)]⟩ +theorem macro_115_valid : MacroRule.Valid qi macro_115 := check_macro_spec (n := 2) (by decide +kernel) +def macro_116 : MacroRule := ⟨B, .left, [O], [I,O], E, .left, [], [([I],3)]⟩ +theorem macro_116_valid : MacroRule.Valid qi macro_116 := check_macro_spec (n := 5) (by decide +kernel) +def macro_117 : MacroRule := ⟨E, .left, [O,I,O], [], B, .left, [], [([I],2),([O],1)]⟩ +theorem macro_117_valid : MacroRule.Valid qi macro_117 := check_macro_spec (n := 3) (by decide +kernel) +inductive MacroId where + | m0 | m1 | m2 | m3 | m4 | m5 | m6 | m7 | m8 | m9 | m10 | m11 | m12 | m13 | m14 | m15 | m16 | m17 | m18 | m19 | m20 | m21 | m22 | m23 | m24 | m25 | m26 | m27 | m28 | m29 | m30 | m31 | m32 | m33 | m34 | m35 | m36 | m37 | m38 | m39 | m40 | m41 | m42 | m43 | m44 | m45 | m46 | m47 | m48 | m49 | m50 | m51 | m52 | m53 | m54 | m55 | m56 | m57 | m58 | m59 | m60 | m61 | m62 | m63 | m64 | m65 | m66 | m67 | m68 | m69 | m70 | m71 | m72 | m73 | m74 | m75 | m76 | m77 | m78 | m79 | m80 | m81 | m82 | m83 | m84 | m85 | m86 | m87 | m88 | m89 | m90 | m91 | m92 | m93 | m94 | m95 | m96 | m97 | m98 | m99 | m100 | m101 | m102 | m103 | m104 | m105 | m106 | m107 | m108 | m109 | m110 | m111 | m112 | m113 | m114 | m115 | m116 | m117 +def exec_macro (m : MacroId) (c : RMConfig) : Option RMConfig := + match m with + | .m0 => apply_macro macro_0 c + | .m1 => apply_macro macro_1 c + | .m2 => apply_macro macro_2 c + | .m3 => apply_macro macro_3 c + | .m4 => apply_macro macro_4 c + | .m5 => apply_macro macro_5 c + | .m6 => apply_macro macro_6 c + | .m7 => apply_macro macro_7 c + | .m8 => apply_macro macro_8 c + | .m9 => apply_macro macro_9 c + | .m10 => apply_macro macro_10 c + | .m11 => apply_macro macro_11 c + | .m12 => apply_macro macro_12 c + | .m13 => apply_macro macro_13 c + | .m14 => apply_macro macro_14 c + | .m15 => apply_macro macro_15 c + | .m16 => apply_macro macro_16 c + | .m17 => apply_macro macro_17 c + | .m18 => apply_macro macro_18 c + | .m19 => apply_macro macro_19 c + | .m20 => apply_macro macro_20 c + | .m21 => apply_macro macro_21 c + | .m22 => apply_macro macro_22 c + | .m23 => apply_macro macro_23 c + | .m24 => apply_macro macro_24 c + | .m25 => apply_macro macro_25 c + | .m26 => apply_macro macro_26 c + | .m27 => apply_macro macro_27 c + | .m28 => apply_macro macro_28 c + | .m29 => apply_macro macro_29 c + | .m30 => apply_macro macro_30 c + | .m31 => apply_macro macro_31 c + | .m32 => apply_macro macro_32 c + | .m33 => apply_macro macro_33 c + | .m34 => apply_macro macro_34 c + | .m35 => apply_macro macro_35 c + | .m36 => apply_macro macro_36 c + | .m37 => apply_macro macro_37 c + | .m38 => apply_macro macro_38 c + | .m39 => apply_macro macro_39 c + | .m40 => apply_macro macro_40 c + | .m41 => apply_macro macro_41 c + | .m42 => apply_macro macro_42 c + | .m43 => apply_macro macro_43 c + | .m44 => apply_macro macro_44 c + | .m45 => apply_macro macro_45 c + | .m46 => apply_macro macro_46 c + | .m47 => apply_macro macro_47 c + | .m48 => apply_macro macro_48 c + | .m49 => apply_macro macro_49 c + | .m50 => apply_macro macro_50 c + | .m51 => apply_macro macro_51 c + | .m52 => apply_macro macro_52 c + | .m53 => apply_macro macro_53 c + | .m54 => apply_macro macro_54 c + | .m55 => apply_macro macro_55 c + | .m56 => apply_macro macro_56 c + | .m57 => apply_macro macro_57 c + | .m58 => apply_macro macro_58 c + | .m59 => apply_macro macro_59 c + | .m60 => apply_macro macro_60 c + | .m61 => apply_macro macro_61 c + | .m62 => apply_macro macro_62 c + | .m63 => apply_macro macro_63 c + | .m64 => apply_macro macro_64 c + | .m65 => apply_macro macro_65 c + | .m66 => apply_macro macro_66 c + | .m67 => apply_macro macro_67 c + | .m68 => apply_macro macro_68 c + | .m69 => apply_macro macro_69 c + | .m70 => apply_macro macro_70 c + | .m71 => apply_macro macro_71 c + | .m72 => apply_macro macro_72 c + | .m73 => apply_macro macro_73 c + | .m74 => apply_macro macro_74 c + | .m75 => apply_macro macro_75 c + | .m76 => apply_macro macro_76 c + | .m77 => apply_macro macro_77 c + | .m78 => apply_macro macro_78 c + | .m79 => apply_macro macro_79 c + | .m80 => apply_macro macro_80 c + | .m81 => apply_macro macro_81 c + | .m82 => apply_macro macro_82 c + | .m83 => apply_macro macro_83 c + | .m84 => apply_macro macro_84 c + | .m85 => apply_macro macro_85 c + | .m86 => apply_macro macro_86 c + | .m87 => apply_macro macro_87 c + | .m88 => apply_macro macro_88 c + | .m89 => apply_macro macro_89 c + | .m90 => apply_macro macro_90 c + | .m91 => apply_macro macro_91 c + | .m92 => apply_macro macro_92 c + | .m93 => apply_macro macro_93 c + | .m94 => apply_macro macro_94 c + | .m95 => apply_macro macro_95 c + | .m96 => apply_macro macro_96 c + | .m97 => apply_macro macro_97 c + | .m98 => apply_macro macro_98 c + | .m99 => apply_macro macro_99 c + | .m100 => apply_macro macro_100 c + | .m101 => apply_macro macro_101 c + | .m102 => apply_macro macro_102 c + | .m103 => apply_macro macro_103 c + | .m104 => apply_macro macro_104 c + | .m105 => apply_macro macro_105 c + | .m106 => apply_macro macro_106 c + | .m107 => apply_macro macro_107 c + | .m108 => apply_macro macro_108 c + | .m109 => apply_macro macro_109 c + | .m110 => apply_macro macro_110 c + | .m111 => apply_macro macro_111 c + | .m112 => apply_macro macro_112 c + | .m113 => apply_macro macro_113 c + | .m114 => apply_macro macro_114 c + | .m115 => apply_macro macro_115 c + | .m116 => apply_macro macro_116 c + | .m117 => apply_macro macro_117 c +theorem exec_macro_spec {m : MacroId} {c c' : RMConfig} + (h : exec_macro m c = some c') : + (c.denote) [qi]⊢* (c'.denote) := by + cases m + · exact apply_macro_spec macro_0_valid h + · exact apply_macro_spec macro_1_valid h + · exact apply_macro_spec macro_2_valid h + · exact apply_macro_spec macro_3_valid h + · exact apply_macro_spec macro_4_valid h + · exact apply_macro_spec macro_5_valid h + · exact apply_macro_spec macro_6_valid h + · exact apply_macro_spec macro_7_valid h + · exact apply_macro_spec macro_8_valid h + · exact apply_macro_spec macro_9_valid h + · exact apply_macro_spec macro_10_valid h + · exact apply_macro_spec macro_11_valid h + · exact apply_macro_spec macro_12_valid h + · exact apply_macro_spec macro_13_valid h + · exact apply_macro_spec macro_14_valid h + · exact apply_macro_spec macro_15_valid h + · exact apply_macro_spec macro_16_valid h + · exact apply_macro_spec macro_17_valid h + · exact apply_macro_spec macro_18_valid h + · exact apply_macro_spec macro_19_valid h + · exact apply_macro_spec macro_20_valid h + · exact apply_macro_spec macro_21_valid h + · exact apply_macro_spec macro_22_valid h + · exact apply_macro_spec macro_23_valid h + · exact apply_macro_spec macro_24_valid h + · exact apply_macro_spec macro_25_valid h + · exact apply_macro_spec macro_26_valid h + · exact apply_macro_spec macro_27_valid h + · exact apply_macro_spec macro_28_valid h + · exact apply_macro_spec macro_29_valid h + · exact apply_macro_spec macro_30_valid h + · exact apply_macro_spec macro_31_valid h + · exact apply_macro_spec macro_32_valid h + · exact apply_macro_spec macro_33_valid h + · exact apply_macro_spec macro_34_valid h + · exact apply_macro_spec macro_35_valid h + · exact apply_macro_spec macro_36_valid h + · exact apply_macro_spec macro_37_valid h + · exact apply_macro_spec macro_38_valid h + · exact apply_macro_spec macro_39_valid h + · exact apply_macro_spec macro_40_valid h + · exact apply_macro_spec macro_41_valid h + · exact apply_macro_spec macro_42_valid h + · exact apply_macro_spec macro_43_valid h + · exact apply_macro_spec macro_44_valid h + · exact apply_macro_spec macro_45_valid h + · exact apply_macro_spec macro_46_valid h + · exact apply_macro_spec macro_47_valid h + · exact apply_macro_spec macro_48_valid h + · exact apply_macro_spec macro_49_valid h + · exact apply_macro_spec macro_50_valid h + · exact apply_macro_spec macro_51_valid h + · exact apply_macro_spec macro_52_valid h + · exact apply_macro_spec macro_53_valid h + · exact apply_macro_spec macro_54_valid h + · exact apply_macro_spec macro_55_valid h + · exact apply_macro_spec macro_56_valid h + · exact apply_macro_spec macro_57_valid h + · exact apply_macro_spec macro_58_valid h + · exact apply_macro_spec macro_59_valid h + · exact apply_macro_spec macro_60_valid h + · exact apply_macro_spec macro_61_valid h + · exact apply_macro_spec macro_62_valid h + · exact apply_macro_spec macro_63_valid h + · exact apply_macro_spec macro_64_valid h + · exact apply_macro_spec macro_65_valid h + · exact apply_macro_spec macro_66_valid h + · exact apply_macro_spec macro_67_valid h + · exact apply_macro_spec macro_68_valid h + · exact apply_macro_spec macro_69_valid h + · exact apply_macro_spec macro_70_valid h + · exact apply_macro_spec macro_71_valid h + · exact apply_macro_spec macro_72_valid h + · exact apply_macro_spec macro_73_valid h + · exact apply_macro_spec macro_74_valid h + · exact apply_macro_spec macro_75_valid h + · exact apply_macro_spec macro_76_valid h + · exact apply_macro_spec macro_77_valid h + · exact apply_macro_spec macro_78_valid h + · exact apply_macro_spec macro_79_valid h + · exact apply_macro_spec macro_80_valid h + · exact apply_macro_spec macro_81_valid h + · exact apply_macro_spec macro_82_valid h + · exact apply_macro_spec macro_83_valid h + · exact apply_macro_spec macro_84_valid h + · exact apply_macro_spec macro_85_valid h + · exact apply_macro_spec macro_86_valid h + · exact apply_macro_spec macro_87_valid h + · exact apply_macro_spec macro_88_valid h + · exact apply_macro_spec macro_89_valid h + · exact apply_macro_spec macro_90_valid h + · exact apply_macro_spec macro_91_valid h + · exact apply_macro_spec macro_92_valid h + · exact apply_macro_spec macro_93_valid h + · exact apply_macro_spec macro_94_valid h + · exact apply_macro_spec macro_95_valid h + · exact apply_macro_spec macro_96_valid h + · exact apply_macro_spec macro_97_valid h + · exact apply_macro_spec macro_98_valid h + · exact apply_macro_spec macro_99_valid h + · exact apply_macro_spec macro_100_valid h + · exact apply_macro_spec macro_101_valid h + · exact apply_macro_spec macro_102_valid h + · exact apply_macro_spec macro_103_valid h + · exact apply_macro_spec macro_104_valid h + · exact apply_macro_spec macro_105_valid h + · exact apply_macro_spec macro_106_valid h + · exact apply_macro_spec macro_107_valid h + · exact apply_macro_spec macro_108_valid h + · exact apply_macro_spec macro_109_valid h + · exact apply_macro_spec macro_110_valid h + · exact apply_macro_spec macro_111_valid h + · exact apply_macro_spec macro_112_valid h + · exact apply_macro_spec macro_113_valid h + · exact apply_macro_spec macro_114_valid h + · exact apply_macro_spec macro_115_valid h + · exact apply_macro_spec macro_116_valid h + · exact apply_macro_spec macro_117_valid h +theorem qe_local {n : ℕ} {s : Scan} (hd : s.dir = .left) + (h : run_local qi n ⟨s.scan_in, s.context, s.q, .left⟩ = some ⟨[], s.context ++ s.scan_out, s.q, .left⟩) : + qc qi s := by + apply qe hd + intro l r + simpa only [cfg_of, Counter.cfg_of, append_assoc, append_nil] using run_local_spec h l r +theorem qt_local {n : ℕ} {s : Scan} (hd : s.dir = .right) + (h : run_local qi n ⟨s.context, s.scan_in, s.q, .right⟩ = some ⟨s.context ++ s.scan_out, [], s.q, .right⟩) : + qc qi s := by + apply qt hd + intro l r + simpa only [cfg_of, Counter.cfg_of, append_assoc, append_nil] using run_local_spec h l r +def scan_0 : Scan:=⟨A,.left,[I,O,I,O,I,O,I,O,O],[I,I,I,I,O,I,I,I,I],[]⟩ +theorem scan_0_valid : qc qi scan_0 := qe_local (n := 21) rfl (by decide +kernel) +def scan_1 : Scan:=⟨B,.left,[I,O,I,O,I,O,I,O,O],[I,I,I,I,I,O,I,I,I],[I,I,O]⟩ +theorem scan_1_valid : qc qi scan_1 := qe_local (n := 29) rfl (by decide +kernel) +def scan_2 : Scan:=⟨A,.left,[I,O,I,O,I,O,O,I,O],[I,O,I,I,I,I,I,I,I],[]⟩ +theorem scan_2_valid : qc qi scan_2 := qe_local (n := 29) rfl (by decide +kernel) +def scan_3 : Scan:=⟨A,.left,[I,O,O,I,O,I,O,I,O],[I,O,I,I,I,I,I,I,I],[]⟩ +theorem scan_3_valid : qc qi scan_3 := qe_local (n := 21) rfl (by decide +kernel) +def scan_4 : Scan:=⟨B,.left,[I,O,O,I,O,I,O,I,O],[I,I,O,I,I,I,I,I,I],[I,I,O]⟩ +theorem scan_4_valid : qc qi scan_4 := qe_local (n := 29) rfl (by decide +kernel) +def scan_5 : Scan:=⟨A,.left,[O,I,O,I,O,I,O,I,O],[I,I,I,I,I,O,I,I,I],[I,O]⟩ +theorem scan_5_valid : qc qi scan_5 := qe_local (n := 29) rfl (by decide +kernel) +def scan_6 : Scan:=⟨B,.right,[O,I,I,I,I,I,I,I,I],[O,O,I,O,I,O,I,O,I],[]⟩ +theorem scan_6_valid : qc qi scan_6 := qt_local (n := 15) rfl (by decide +kernel) +def scan_7 : Scan:=⟨B,.right,[I,I,I,I,I,I,O,I,I],[O,I,O,O,I,O,I,O,I],[O]⟩ +theorem scan_7_valid : qc qi scan_7 := qt_local (n := 15) rfl (by decide +kernel) +def scan_8 : Scan:=⟨A,.left,[I,O,I,O,I,O],[I,O,I,I,I,I],[]⟩ +theorem scan_8_valid : qc qi scan_8 := qe_local (n := 16) rfl (by decide +kernel) +def scan_9 : Scan:=⟨B,.left,[I,O,I,O,I,O],[I,I,O,I,I,I],[I,I,O]⟩ +theorem scan_9_valid : qc qi scan_9 := qe_local (n := 16) rfl (by decide +kernel) +def scan_10 : Scan:=⟨A,.left,[O,I,O,I,O,I],[I,I,O,I,I,I],[I,O]⟩ +theorem scan_10_valid : qc qi scan_10 := qe_local (n := 16) rfl (by decide +kernel) +def scan_11 : Scan:=⟨E,.left,[O,I,O,I,O,I],[I,I,O,I,I,I],[]⟩ +theorem scan_11_valid : qc qi scan_11 := qe_local (n := 16) rfl (by decide +kernel) +def scan_12 : Scan:=⟨B,.right,[I,I],[O,I],[O]⟩ +theorem scan_12_valid : qc qi scan_12 := qt_local (n := 4) rfl (by decide +kernel) +def scan_13 : Scan:=⟨D,.right,[I,I],[O,I],[]⟩ +theorem scan_13_valid : qc qi scan_13 := qt_local (n := 4) rfl (by decide +kernel) +def scan_14 : Scan:=⟨B,.left,[I],[I],[]⟩ +theorem scan_14_valid : qc qi scan_14 := qe_local (n := 1) rfl (by decide +kernel) +inductive ScanId where + | s0 | s1 | s2 | s3 | s4 | s5 | s6 | s7 | s8 | s9 | s10 | s11 | s12 | s13 | s14 +def exec_scan (s : ScanId) (n : ℕ) (c : RMConfig) : Option RMConfig := + match s with + | .s0 => use_scan scan_0 n c + | .s1 => use_scan scan_1 n c + | .s2 => use_scan scan_2 n c + | .s3 => use_scan scan_3 n c + | .s4 => use_scan scan_4 n c + | .s5 => use_scan scan_5 n c + | .s6 => use_scan scan_6 n c + | .s7 => use_scan scan_7 n c + | .s8 => use_scan scan_8 n c + | .s9 => use_scan scan_9 n c + | .s10 => use_scan scan_10 n c + | .s11 => use_scan scan_11 n c + | .s12 => use_scan scan_12 n c + | .s13 => use_scan scan_13 n c + | .s14 => use_scan scan_14 n c +theorem exec_scan_spec {s : ScanId} {n : ℕ} {c c' : RMConfig} + (h : exec_scan s n c = some c') : + (c.denote) [qi]⊢* (c'.denote) := by + cases s + · exact use_scan_spec scan_0_valid h + · exact use_scan_spec scan_1_valid h + · exact use_scan_spec scan_2_valid h + · exact use_scan_spec scan_3_valid h + · exact use_scan_spec scan_4_valid h + · exact use_scan_spec scan_5_valid h + · exact use_scan_spec scan_6_valid h + · exact use_scan_spec scan_7_valid h + · exact use_scan_spec scan_8_valid h + · exact use_scan_spec scan_9_valid h + · exact use_scan_spec scan_10_valid h + · exact use_scan_spec scan_11_valid h + · exact use_scan_spec scan_12_valid h + · exact use_scan_spec scan_13_valid h + · exact use_scan_spec scan_14_valid h +def exec_scan2 (s1 s2 : ScanId) : List (ℕ × ℕ) → RMConfig → Option RMConfig + | [], c => some c + | (n1, n2) :: rest, c => + match exec_scan s1 n1 c with + | some c1 => + match exec_scan s2 n2 c1 with + | some c2 => exec_scan2 s1 s2 rest c2 + | none => none + | none => none +theorem exec_scan2_spec {s1 s2 : ScanId} {ns : List (ℕ × ℕ)} {c c' : RMConfig} + (h : exec_scan2 s1 s2 ns c = some c') : + (c.denote) [qi]⊢* (c'.denote) := by + induction ns generalizing c with + | nil => + injection h with heq; subst heq; exact ⟨0, rfl⟩ + | cons p rest ih => + rcases p with ⟨n1, n2⟩ + unfold exec_scan2 at h + cases ho1 : exec_scan s1 n1 c with + | none => rw [ho1] at h; contradiction + | some c1 => + rw [ho1] at h; dsimp -failIfUnchanged only at h + cases ho2 : exec_scan s2 n2 c1 with + | none => rw [ho2] at h; contradiction + | some c2 => + rw [ho2] at h; dsimp -failIfUnchanged only at h + exact q1 (exec_scan_spec ho1) (q1 (exec_scan_spec ho2) (ih h)) +def exec_mac_scan : List (MacroId × ScanId × ℕ) → RMConfig → Option RMConfig + | [], c => some c + | (m, s, n) :: rest, c => + match exec_macro m c with + | some c1 => + match exec_scan s n c1 with + | some c2 => exec_mac_scan rest c2 + | none => none + | none => none +theorem exec_mac_scan_spec {ms : List (MacroId × ScanId × ℕ)} {c c' : RMConfig} + (h : exec_mac_scan ms c = some c') : + (c.denote) [qi]⊢* (c'.denote) := by + induction ms generalizing c with + | nil => + injection h with heq; subst heq; exact ⟨0, rfl⟩ + | cons p rest ih => + rcases p with ⟨m, s, n⟩ + unfold exec_mac_scan at h + cases ho1 : exec_macro m c with + | none => rw [ho1] at h; contradiction + | some c1 => + rw [ho1] at h; dsimp -failIfUnchanged only at h + cases ho2 : exec_scan s n c1 with + | none => rw [ho2] at h; contradiction + | some c2 => + rw [ho2] at h; dsimp -failIfUnchanged only at h + exact q1 (exec_macro_spec ho1) (q1 (exec_scan_spec ho2) (ih h)) +def exec_mac_scan2 (s1 s2 : ScanId) : List (MacroId × ℕ × ℕ) → RMConfig → Option RMConfig + | [], c => some c + | (m, n1, n2) :: rest, c => + match exec_macro m c with + | some c1 => + match exec_scan s1 n1 c1 with + | some c2 => + match exec_scan s2 n2 c2 with + | some c3 => exec_mac_scan2 s1 s2 rest c3 + | none => none + | none => none + | none => none +theorem exec_mac_scan2_spec {s1 s2 : ScanId} {ns : List (MacroId × ℕ × ℕ)} {c c' : RMConfig} + (h : exec_mac_scan2 s1 s2 ns c = some c') : + (c.denote) [qi]⊢* (c'.denote) := by + induction ns generalizing c with + | nil => + injection h with heq; subst heq; exact ⟨0, rfl⟩ + | cons p rest ih => + rcases p with ⟨m, n1, n2⟩ + unfold exec_mac_scan2 at h + cases ho1 : exec_macro m c with + | none => rw [ho1] at h; contradiction + | some c1 => + rw [ho1] at h; dsimp -failIfUnchanged only at h + cases ho2 : exec_scan s1 n1 c1 with + | none => rw [ho2] at h; contradiction + | some c2 => + rw [ho2] at h; dsimp -failIfUnchanged only at h + cases ho3 : exec_scan s2 n2 c2 with + | none => rw [ho3] at h; contradiction + | some c3 => + rw [ho3] at h; dsimp -failIfUnchanged only at h + exact q1 (exec_macro_spec ho1) (q1 (exec_scan_spec ho2) (q1 (exec_scan_spec ho3) (ih h))) +inductive Cmd where + | m (m : MacroId) + | b (k : ℕ) (txs : List (List (List ℕ × qK))) + | s (s : ScanId) (n : ℕ) + | s2 (s1 s2 : ScanId) (ns : List (ℕ × ℕ)) + | ms (ms : List (MacroId × ScanId × ℕ)) + | ms2 (s1 s2 : ScanId) (ns : List (MacroId × ℕ × ℕ)) +def exec_cmd (cmd : Cmd) (c : RMConfig) : Option RMConfig := + match cmd with + | .m m => exec_macro m c + | .b k txs => qC_many k txs c + | .s s n => exec_scan s n c + | .s2 s1 s2 ns => exec_scan2 s1 s2 ns c + | .ms ms => exec_mac_scan ms c + | .ms2 s1 s2 ns => exec_mac_scan2 s1 s2 ns c +theorem exec_cmd_spec {cmd : Cmd} {c c' : RMConfig} + (h : exec_cmd cmd c = some c') : + (c.denote) [qi]⊢* (c'.denote) := by + cases cmd with + | m m => exact exec_macro_spec h + | b k txs => exact qP_many h + | s s n => exact exec_scan_spec h + | s2 s1 s2 ns => exact exec_scan2_spec h + | ms ms => exact exec_mac_scan_spec h + | ms2 s1 s2 ns => exact exec_mac_scan2_spec h +def q7 : List Cmd → RMConfig → Option RMConfig + | [], c => some c + | cmd :: rest, c => + match exec_cmd cmd c with + | some c' => q7 rest c' + | none => none +theorem q2 {cs : List Cmd} {c c' : RMConfig} + (h : q7 cs c = some c') : + (c.denote) [qi]⊢* (c'.denote) := by + induction cs generalizing c with + | nil => + injection h with heq; subst heq; exact ⟨0, rfl⟩ + | cons cmd rest ih => + unfold q7 at h + cases hc : exec_cmd cmd c with + | none => rw [hc] at h; contradiction + | some c₁ => + rw [hc] at h + exact q1 (exec_cmd_spec hc) (ih h) + +def qa8 (l : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + (([O,O,I,O] +> l) <{{A}} ([I,O,I,I,O,I,I,I,I,I,O,I,I,I,I,I,I,O] +> default)) +theorem qag (l : ListBlank (Fin 2)) : + (qa8 l) [qi]⊢⁺ (qa8 (I >> l)):= by + have h := run_local_plus_spec (tm := qi) (n := 124) + (s1 := ⟨[O,O,I,O], [I,O,I,I,O,I,I,I,I,I,O,I,I,I,I,I,I,O,O], A, .left⟩) + (s2 := ⟨[O,O,I,O,I], [I,O,I,I,O,I,I,I,I,I,O,I,I,I,I,I,I,O], A, .left⟩) + (by decide +kernel) l default + simpa only [qa8, cfg_of, Counter.cfg_of, append_cons, append_nil, O_cons_default] using h + +def qJ (c : RMConfig) : Bool := + match Nat.beq c.state.1 0 with + | true => + match qk .left c with + | ⟨zl, zr, _, _⟩ => + match Runs.remove_word 16 [O,O,I,O] zl, + Runs.remove_word 16 [I,O,I,I,O,I,I,I,I,I,O,I,I,I,I,I,I,O] zr with + | some _, some r0 => Runs.zeros r0 + | _, _ => false + | false => false + +theorem qa5 {c : RMConfig} (h : qJ c = true) : + ∃ l, c.denote = qa8 l := by + unfold qJ at h + cases hq : Nat.beq c.state.1 0 + · rw [hq] at h; contradiction + · rw [hq] at h + have hq_eq : c.state = A := Fin.ext (Nat.beq_eq.mp hq) + rw [← qR .left c] + have hd_z : (qk .left c).dir = .left := qa3 .left c + have hq_z : (qk .left c).state = A := by rw [qG, hq_eq] + rcases hz : qk .left c with ⟨l, r, qz, dz⟩ + rw [hz] at hd_z hq_z h + dsimp -failIfUnchanged only at hd_z hq_z h + subst hd_z hq_z + cases hl : Runs.remove_word 16 [O,O,I,O] l with + | none => rw [hl] at h; contradiction + | some l0 => + rw [hl] at h + cases hr : Runs.remove_word 16 [I,O,I,I,O,I,I,I,I,I,O,I,I,I,I,I,I,O] r with + | none => rw [hr] at h; contradiction + | some r0 => + rw [hr] at h + refine ⟨Runs.denote l0, ?_⟩ + unfold RMConfig.denote qa8 + dsimp -failIfUnchanged only + rw [Runs.remove_word_spec hl, Runs.remove_word_spec hr, Runs.zeros_spec h] + +theorem step_chunk {c c' : RMConfig} (cs : List Cmd) (h : eqOptCfg (q7 cs c) c' = true) : + (c.denote) [qi]⊢* (c'.denote) := + q2 (eqOptCfg_spec h) + +theorem qn {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} + (h : c₁ [M]⊢⁺ c₂) : (step M c₁).isSome:= by + rcases h with ⟨n,hn,hms⟩ + cases n with + | zero => omega + | succ n => + rw [Nat.add_comm n 1,qC,multiStep_one] at hms + cases hstep : step M c₁ with + | none => rw [hstep] at hms; simp at hms + | some c' => rfl +theorem qT (M : Machine Γ Λ) (c : Cfg Γ Λ) (n : Nat) : + multiStep M c (n + 1)=(step M c).bind (fun c' => multiStep M c' n):= by + rw [Nat.add_comm n 1,qC,multiStep_one] +theorem qu {M : Machine Γ Λ} {c0 c₁ c : Cfg Γ Λ} + {n m : Nat} (h1 : c0 [M]⊢^{n} c₁) (h2 : c0 [M]⊢^{m} c) : + (m ≤ n ∧ c [M]⊢^{n - m} c₁) ∨ (n < m ∧ c₁ [M]⊢^{m - n} c):= by + induction n generalizing c0 m with + | zero => + simp only [multiStep_zero,Option.some.injEq] at h1 + subst h1 + rcases m with _ | m + · simp only [multiStep_zero,Option.some.injEq] at h2 + subst h2 + left; exact ⟨by omega,rfl⟩ + · right; exact ⟨by omega,h2⟩ + | succ n ih => + rcases m with _ | m + · simp only [multiStep_zero,Option.some.injEq] at h2 + subst h2 + left; exact ⟨by omega,h1⟩ + · rw [qT] at h1 h2 + cases hs : step M c0 with + | none => rw [hs] at h1; simp at h1 + | some c0' => + simp only [hs,Option.bind] at h1 h2 + rcases ih h1 h2 with ⟨hle,h⟩ | ⟨hlt,h⟩ + · left; refine ⟨by omega,?_⟩; simpa only [Nat.succ_sub_succ_eq_sub] using h + · right; refine ⟨by omega,?_⟩; simpa only [Nat.succ_sub_succ_eq_sub] using h +theorem qv {M : Machine Γ Λ} {c c' : Cfg Γ Λ} + (h : c [M]⊢* c') (h' : (step M c').isSome) : (step M c).isSome:= by + rcases h with ⟨k,hk⟩ + cases k with + | zero => + simp only [multiStep_zero,Option.some.injEq] at hk + subst hk; exact h' + | succ k => + exact qn ⟨k + 1,by omega,hk⟩ +theorem qX (l : ListBlank (Fin 2)) : + (step qi (qa8 l)).isSome := + qn (qag l) +theorem qS (k : Nat) : + ∀ c l,((qa8 l) [qi]⊢^{k} c) → (step qi c).isSome:= by + induction k using Nat.strong_induction_on with + | h k ih => + intro c l hreach + rcases qag l with ⟨m,hm_pos,hm⟩ + rcases qu hm hreach with ⟨_,hd⟩ | ⟨hlt,hd⟩ + · exact qv ⟨m - k,hd⟩ (qX ((1 : Fin 2) >> l)) + · exact ih (k - m) (by omega) c ((1 : Fin 2) >> l) hd +theorem qB {c0 : Cfg (Fin 2) (Fin 6)} {l : ListBlank (Fin 2)} + (h0 : c0 [qi]⊢* qa8 l) : + ∀ cfg,(c0 [qi]⊢* cfg) → (step qi cfg).isSome:= by + intro cfg ⟨k,hk⟩ + rcases h0 with ⟨m,hm⟩ + rcases qu hm hk with ⟨_,hd⟩ | ⟨_,hd⟩ + · exact qv ⟨m - k,hd⟩ (qX l) + · exact qS (k - m) cfg l hd +set_option maxHeartbeats 4000000 +abbrev w0 : List (Fin 2) := [I] +abbrev w1 : List (Fin 2) := [O] +abbrev w2 : List (Fin 2) := [I,I] +abbrev w3 : List (Fin 2) := [I,O] +abbrev w4 : List (Fin 2) := [O,I] +abbrev w5 : List (Fin 2) := [I,O,I] +abbrev w6 : List (Fin 2) := [I,I,I,I] +abbrev w7 : List (Fin 2) := [I,I,I,I,I] +abbrev w8 : List (Fin 2) := [I,I,I,I,I,I] +abbrev w9 : List (Fin 2) := [I,I,O,I,I,I] +abbrev w10 : List (Fin 2) := [I,O,I,I,I,I] +abbrev w11 : List (Fin 2) := [O,I,O,I,O,I] +abbrev w12 : List (Fin 2) := [I,I,I,I,I,I,I] +abbrev w13 : List (Fin 2) := [I,O,I,O,I,O,I] +abbrev w14 : List (Fin 2) := [O,O,I,O,I,O,I] +abbrev w15 : List (Fin 2) := [I,O,O,I,O,I,O,I] +abbrev w16 : List (Fin 2) := [O,I,I,I,I,I,I,I] +abbrev w17 : List (Fin 2) := [O,I,O,I,O,I,O,I] +abbrev w18 : List (Fin 2) := [I,I,I,I,I,I,I,I,I] +abbrev w19 : List (Fin 2) := [I,I,I,I,I,O,I,I,I] +abbrev w20 : List (Fin 2) := [I,I,I,I,O,I,I,I,I] +abbrev w21 : List (Fin 2) := [I,I,O,I,I,I,I,I,I] +abbrev w22 : List (Fin 2) := [I,O,I,I,I,I,I,I,I] +abbrev w23 : List (Fin 2) := [O,I,I,I,I,I,I,I,I] +abbrev w24 : List (Fin 2) := [O,I,O,O,I,O,I,O,I] +abbrev w25 : List (Fin 2) := [O,O,I,O,I,O,I,O,I] +abbrev w26 : List (Fin 2) := [I,I,I,I,I,O,I,I,I,I] +abbrev w27 : List (Fin 2) := [I,I,I,I,I,I,I,I,I,I,I] +abbrev w28 : List (Fin 2) := [I,O,I,O,I,O,I,O,I,O,I] +abbrev w29 : List (Fin 2) := [O,I,O,I,O,I,O,I,O,O,I] +abbrev w30 : List (Fin 2) := [O,I,O,O,I,O,I,O,I,O,I] +abbrev w31 : List (Fin 2) := [I,I,I,I,I,I,I,I,I,I,I,I] +abbrev w32 : List (Fin 2) := [I,I,I,I,I,I,I,O,I,I,I,I] +abbrev w33 : List (Fin 2) := [I,O,I,I,I,I,I,O,I,I,I,I] +abbrev w34 : List (Fin 2) := [I,I,I,I,I,I,I,I,I,I,I,I,I] +abbrev w35 : List (Fin 2) := [O,O,I,O,I,O,I,O,I,O,I,O,I] +abbrev w36 : List (Fin 2) := [I,I,I,I,I,I,I,I,I,I,I,I,I,I,I] +abbrev w37 : List (Fin 2) := [I,I,I,I,I,I,I,I,I,I,O,I,I,I,I] +abbrev w38 : List (Fin 2) := [I,I,I,I,I,O,I,I,I,I,I,O,I,I,I,I] +abbrev w39 : List (Fin 2) := [I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I] +abbrev w40 : List (Fin 2) := [I,O,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I] +abbrev w41 : List (Fin 2) := [I,O,I,I,I,I,I,O,I,I,I,I,I,O,I,I,I,I] +abbrev w42 : List (Fin 2) := [O,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I,O,I] +abbrev w43 : List (Fin 2) := [I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I] +abbrev w44 : List (Fin 2) := [I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I] +abbrev w45 : List (Fin 2) := [I,O,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I] +abbrev w46 : List (Fin 2) := [I,O,I,I,I,I,I,O,I,I,I,I,I,I,I,I,O,I,I,I,I] +abbrev w47 : List (Fin 2) := [I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I] +abbrev w48 : List (Fin 2) := [I,O,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I] +abbrev w49 : List (Fin 2) := [I,O,I,I,I,I,I,O,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I] +abbrev w50 : List (Fin 2) := [I,I,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I] +abbrev w51 : List (Fin 2) := [I,O,I,I,I,I,I,O,I,I,I,I,I,O,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I] +def cfg_0 : RMConfig := ⟨[],[],A,.right⟩ +def cfg_1 : RMConfig := ⟨[(w17,1),(w25,984),(w42,1),(w24,1069),(w17,1),(w25,64),(w1,1),(w29,1)],[(w10,2),(w22,1),(w3,1),(w19,1156),(w6,1),(w10,1),(w22,1),(w0,2),(w6,1),(w10,1),(w20,999),(w22,1),(w10,2),(w20,72),(w22,4),(w0,1)],A,.left⟩ +def cfg_2 : RMConfig := ⟨[(w0,1),(w25,2),(w1,1),(w29,1)],[(w10,1),(w0,3),(w10,1),(w0,3),(w10,1),(w0,3),(w22,15352),(w33,1),(w22,4606),(w33,1),(w22,530275),(w33,1),(w20,22439),(w22,1),(w10,2),(w20,13778),(w22,681),(w33,1),(w20,881),(w22,1),(w10,2),(w20,42),(w22,4),(w0,1)],A,.left⟩ +def cfg_3 : RMConfig := ⟨[(w0,1),(w25,2),(w1,1),(w29,1)],[(w10,1),(w0,3),(w10,1),(w0,3),(w10,1),(w0,3),(w22,8440),(w33,1),(w22,136105201),(w33,1),(w20,15009),(w22,1),(w10,2),(w20,11918),(w22,216),(w10,2),(w20,1),(w22,763),(w33,1),(w22,14),(w10,2),(w22,3),(w0,1)],A,.left⟩ +def cfg_4 : RMConfig := ⟨[(w1,1),(w24,11355),(w17,1),(w1,1),(w4,6),(w24,1225163702),(w17,1),(w25,290049),(w35,1),(w17,1),(w25,477),(w35,1),(w17,1),(w25,5181),(w1,1),(w29,1)],[(w7,1),(w31,1),(w22,11005),(w31,1),(w22,698),(w8,1),(w22,4),(w0,1)],B,.right⟩ +def cfg_5 : RMConfig := ⟨[(w1,1),(w24,1),(w17,1),(w25,835587),(w35,1),(w17,1),(w25,1966053),(w1,1),(w29,1)],[(w2,1),(w33,1),(w22,218110),(w8,1),(w22,69838),(w31,1),(w22,207946),(w8,1),(w22,53094),(w31,1),(w22,278662),(w8,1),(w22,1225162136),(w44,1),(w22,10963),(w10,1),(w22,10908),(w45,1),(w22,673),(w18,1),(w22,4),(w0,1)],B,.right⟩ +def cfg_6 : RMConfig := ⟨[(w29,1)],[(w22,29491180),(w31,1),(w22,13860866),(w10,1),(w22,122880),(w40,1),(w22,3520510),(w8,1),(w22,1125838),(w31,1),(w22,3328906),(w8,1),(w22,5107992),(w31,1),(w22,3181864),(w8,1),(w22,28546),(w31,1),(w22,272525),(w40,1),(w22,1225160601),(w18,1),(w22,10581),(w10,1),(w22,10812),(w45,1),(w22,649),(w18,1),(w22,4),(w0,1)],D,.right⟩ +def cfg_7 : RMConfig := ⟨[(w13,1),(w25,10720),(w1,1),(w4,6),(w24,1),(w17,1),(w25,10224),(w35,1),(w24,1225159175),(w17,1),(w25,266817),(w42,1),(w24,5716),(w17,1),(w25,3090543),(w42,1),(w24,4742710),(w17,1),(w25,51019887),(w42,1),(w24,82181688),(w17,1),(w25,55050249),(w42,1),(w24,25165774),(w17,1),(w25,84934653),(w35,1),(w17,1),(w25,116391933),(w1,1),(w29,1)],[(w22,628),(w10,2),(w22,4),(w0,1)],A,.left⟩ +def cfg_8 : RMConfig := ⟨[(w11,1),(w24,4),(w30,1)],[(w10,1),(w22,50331593),(w0,2),(w26,1),(w20,61341706),(w22,2200903224),(w41,1),(w20,630995056),(w22,29559862),(w41,1),(w20,37864432),(w22,1453846),(w41,1),(w20,2268328),(w22,1225158023),(w33,1),(w20,9937),(w22,1),(w10,2),(w20,10649),(w22,610),(w10,2),(w22,4),(w0,1)],A,.left⟩ +def cfg_9 : RMConfig := ⟨[(w28,1),(w24,9579),(w17,1),(w1,1),(w4,6),(w24,1225156598),(w17,1),(w25,2262627),(w42,1),(w24,1431046),(w17,1),(w25,37773231),(w42,1),(w24,29195062),(w17,1),(w25,629535855),(w42,1),(w24,2195066422),(w17,1),(w25,824426607),(w35,1),(w17,1),(w25,1347354165),(w35,1),(w24,13369342),(w17,1),(w25,44040189),(w35,1),(w17,1),(w25,1182793725),(w1,1),(w29,1)],[(w22,10561),(w33,1),(w22,587),(w10,2),(w20,1),(w22,3),(w0,1)],A,.left⟩ +def cfg_10 : RMConfig := ⟨[(w15,1),(w24,1409541),(w17,1),(w25,37687215),(w42,1),(w24,28850998),(w17,1),(w25,628159599),(w42,1),(w24,2189561398),(w17,1),(w25,802406511),(w42,1),(w24,1259273782),(w17,1),(w25,13241155695),(w42,1),(w24,21759000118),(w17,1),(w25,1019215869),(w35,1),(w17,1),(w25,503316477),(w35,1),(w17,1),(w25,5435817981),(w1,1),(w29,1)],[(w41,1),(w20,2257252),(w22,1225155254),(w10,2),(w20,1),(w22,9243),(w33,1),(w22,10477),(w41,1),(w20,566),(w0,1),(w23,5)],A,.left⟩ +def cfg_11 : RMConfig := ⟨[(w29,1)],[(w22,21743271907),(w36,1),(w22,4),(w40,1),(w22,353227505207),(w46,1),(w22,213129363568),(w8,1),(w22,20466105910),(w31,1),(w22,12917932144),(w8,1),(w22,1178467894),(w31,1),(w22,782205040),(w8,1),(w22,2184511030),(w31,1),(w22,626897008),(w8,1),(w22,28535350),(w31,1),(w22,37608304),(w8,1),(w22,1389814),(w31,1),(w22,2252320),(w8,1),(w22,1225154021),(w8,1),(w22,8936),(w45,1),(w22,10399),(w40,1),(w22,546),(w45,1),(w22,3),(w0,1)],D,.right⟩ +def cfg_12 : RMConfig := ⟨[(w17,1),(w25,4),(w1,1),(w29,1)],[(w3,1),(w19,3002182139824),(w38,1),(w22,4094177574928),(w3,1),(w19,1),(w6,1),(w10,3),(w0,2),(w26,1),(w22,18522046414),(w31,1),(w22,204346490890),(w8,1),(w22,331333238328),(w31,1),(w22,207655796848),(w8,1),(w22,19097714230),(w31,1),(w22,12575834224),(w8,1),(w22,1092943414),(w31,1),(w22,760823920),(w8,1),(w22,2179165750),(w31,1),(w22,625560688),(w8,1),(w22,28201270),(w31,1),(w22,37524784),(w8,1),(w22,1368934),(w31,1),(w22,2247100),(w8,1),(w22,1225152716),(w44,1),(w22,8608),(w46,1),(w22,10318),(w36,1),(w22,526),(w37,1),(w22,3),(w0,1)],A,.left⟩ +def cfg_13 : RMConfig := ⟨[(w15,1),(w24,3),(w30,1)],[(w0,1),(w3,1),(w9,1),(w6,1),(w22,7627861917689),(w0,2),(w26,1),(w20,5566277615614),(w22,1649267441614),(w41,1),(w20,3607772528650),(w22,5385888988728),(w41,1),(w20,3343632040048),(w22,310848257590),(w41,1),(w20,202534551664),(w22,17817402934),(w41,1),(w20,12255756400),(w22,1012923958),(w41,1),(w20,740819056),(w22,2174164534),(w41,1),(w20,624310384),(w22,27888694),(w41,1),(w20,37446640),(w22,1349398),(w41,1),(w20,2242216),(w22,1225151495),(w33,1),(w20,8305),(w22,1),(w10,2),(w20,10241),(w22,508),(w10,2),(w22,4),(w0,1)],B,.left⟩ +def cfg_14 : RMConfig := ⟨[(w1,1),(w4,1),(w29,1)],[(w3,1),(w9,1),(w6,1),(w10,1),(w0,2),(w9,1),(w6,1),(w10,1),(w0,2),(w9,1),(w19,48034914238384),(w38,1),(w22,65506841198608),(w3,1),(w19,1),(w6,1),(w10,3),(w0,2),(w26,1),(w22,88119844011574),(w31,1),(w22,53984517685360),(w8,1),(w22,5095173389878),(w31,1),(w22,3270953140336),(w8,1),(w22,292678532662),(w31,1),(w22,197992120432),(w8,1),(w22,16681795126),(w31,1),(w22,11971854448),(w8,1),(w22,941948470),(w31,1),(w22,723075184),(w8,1),(w22,2169728566),(w31,1),(w22,623201392),(w8,1),(w22,27611446),(w31,1),(w22,37377328),(w8,1),(w22,1332070),(w31,1),(w22,2237884),(w8,1),(w22,1225150412),(w44,1),(w22,8032),(w46,1),(w22,10174),(w36,1),(w22,490),(w37,1),(w22,3),(w0,1)],B,.right⟩ +def cfg_15 : RMConfig := ⟨[(w5,1),(w24,5),(w30,1)],[(w22,119571889520633),(w0,2),(w12,1),(w22,1439192001281589),(w41,1),(w20,871070907236464),(w22,83352430313014),(w41,1),(w20,52792664260720),(w22,4797210033718),(w41,1),(w20,3196462301296),(w22,274055822902),(w41,1),(w20,193336442992),(w22,15517875766),(w41,1),(w20,11680874608),(w22,869203510),(w41,1),(w20,704888944),(w22,2165182006),(w41,1),(w20,622064752),(w22,27327286),(w41,1),(w20,37306288),(w22,1314310),(w41,1),(w20,2233444),(w22,1225149302),(w10,2),(w20,1),(w22,7755),(w33,1),(w22,10105),(w33,1),(w22,473),(w10,2),(w20,1),(w22,3),(w0,1)],A,.left⟩ +def cfg_16 : RMConfig := ⟨[(w0,1),(w1,1),(w29,1)],[(w0,1),(w3,1),(w9,1),(w6,1),(w10,1),(w0,2),(w9,1),(w6,1),(w10,1),(w0,2),(w9,1),(w19,12296938045046704),(w38,1),(w22,16769751346839568),(w3,1),(w19,1),(w6,1),(w10,3),(w0,2),(w26,1),(w22,75866302316494),(w31,1),(w22,837003226644490),(w8,1),(w22,1357140946058808),(w31,1),(w22,850558143430768),(w8,1),(w22,78224239361590),(w31,1),(w22,51510616522864),(w8,1),(w22,4476698099254),(w31,1),(w22,3116334317680),(w8,1),(w22,254023826998),(w31,1),(w22,188328444016),(w8,1),(w22,14265876022),(w31,1),(w22,11367874672),(w8,1),(w22,790953526),(w31,1),(w22,685326448),(w8,1),(w22,2160291382),(w31,1),(w22,620842096),(w8,1),(w22,27021622),(w31,1),(w22,37229872),(w8,1),(w22,1295206),(w31,1),(w22,2228668),(w8,1),(w22,1225148108),(w44,1),(w22,7456),(w46,1),(w22,10030),(w36,1),(w22,454),(w37,1),(w22,3),(w0,1)],B,.left⟩ +def cfg_17 : RMConfig := ⟨[(w42,1),(w24,1280862326881846),(w17,1),(w25,13726028283248751),(w42,1),(w24,22182647090380344),(w17,1),(w25,15265619440041993),(w42,1),(w24,8708132091985870),(w17,1),(w25,30610403717283837),(w1,1),(w29,1)],[(w16,1),(w22,831488488636527),(w8,1),(w22,73456825663030),(w31,1),(w22,50318763098224),(w8,1),(w22,4178734743094),(w31,1),(w22,3041843478640),(w8,1),(w22,235401117238),(w31,1),(w22,183672766576),(w8,1),(w22,13101956662),(w31,1),(w22,11076894832),(w8,1),(w22,718208566),(w31,1),(w22,667140208),(w8,1),(w22,2155744822),(w31,1),(w22,619705456),(w8,1),(w22,26737462),(w31,1),(w22,37158832),(w8,1),(w22,1277446),(w31,1),(w22,2224228),(w8,1),(w22,1225146998),(w44,1),(w22,7179),(w31,1),(w22,9961),(w31,1),(w22,437),(w44,1),(w22,2),(w0,1)],B,.right⟩ +def cfg_18 : RMConfig := ⟨[(w29,1)],[(w22,135107988821114620),(w31,1),(w22,57420895248973886),(w10,1),(w22,15),(w45,1),(w22,14988542509842433),(w49,1),(w22,364527687026343477),(w37,1),(w22,222017785927041136),(w8,1),(w22,21094130578882102),(w31,1),(w22,13453899155374192),(w8,1),(w22,1212830044913206),(w31,1),(w22,814480418144368),(w8,1),(w22,69204808039990),(w31,1),(w22,49255758692464),(w8,1),(w22,3912983641654),(w31,1),(w22,2975405703280),(w8,1),(w22,218791673398),(w31,1),(w22,179520405616),(w8,1),(w22,12063866422),(w31,1),(w22,10817372272),(w8,1),(w22,653327926),(w31,1),(w22,650920048),(w8,1),(w22,2151689782),(w31,1),(w22,618691696),(w8,1),(w22,26484022),(w31,1),(w22,37095472),(w8,1),(w22,1261606),(w31,1),(w22,2220268),(w8,1),(w22,1225146008),(w44,1),(w22,6931),(w10,1),(w22,9900),(w45,1),(w22,421),(w18,1),(w22,4),(w0,1)],D,.right⟩ +def cfg_19 : RMConfig := ⟨[(w4,1),(w25,3),(w1,1),(w29,1)],[(w3,1),(w9,1),(w6,1),(w10,1),(w0,2),(w21,5971773105893277155),(w9,2),(w19,3587117103200600196),(w21,2),(w34,1),(w22,346214221354106424),(w49,1),(w22,217439419508981871),(w33,1),(w22,19949538974367286),(w31,1),(w22,13167751254245488),(w8,1),(w22,1141293069631030),(w31,1),(w22,796596174323824),(w8,1),(w22,64733747084854),(w31,1),(w22,48137993453680),(w8,1),(w22,3633542331958),(w31,1),(w22,2905545375856),(w8,1),(w22,201326591542),(w31,1),(w22,175154135152),(w8,1),(w22,10972298806),(w31,1),(w22,10544480368),(w8,1),(w22,585104950),(w31,1),(w22,633864304),(w8,1),(w22,2147425846),(w31,1),(w22,617625712),(w8,1),(w22,26217526),(w31,1),(w22,37028848),(w8,1),(w22,1244950),(w31,1),(w22,2216104),(w8,1),(w22,1225144967),(w8,1),(w22,6673),(w44,1),(w22,9833),(w8,1),(w22,406),(w31,1),(w22,3),(w0,1)],A,.left⟩ +def cfg_20 : RMConfig := ⟨[(w1,1),(w24,1),(w17,1),(w25,388),(w35,1),(w17,1),(w25,9768),(w42,1),(w24,6411),(w17,1),(w1,1),(w4,6),(w24,1225143926),(w17,1),(w25,2211939),(w42,1),(w24,1228294),(w17,1),(w25,36962223),(w42,1),(w24,25951030),(w17,1),(w25,616559727),(w42,1),(w24,2143161910),(w17,1),(w25,616808559),(w42,1),(w24,516881974),(w17,1),(w25,10271588463),(w42,1),(w24,9880731190),(w17,1),(w25,170787864687),(w42,1),(w24,183861509686),(w17,1),(w25,2835685048431),(w42,1),(w24,3354101022262),(w17,1),(w25,47020228214895),(w42,1),(w24,60262686129718),(w17,1),(w25,778711930503279),(w42,1),(w24,1069756094348854),(w17,1),(w25,12881603353116783),(w42,1),(w24,18804947369852470),(w17,1),(w25,212861053090922607),(w42,1),(w24,327900755681869366),(w17,1),(w25,3513863240511651951),(w42,1),(w24,5678757655137484344),(w17,1),(w25,3907998576650747913),(w42,1),(w24,2229281815548395470),(w17,1),(w25,7836263351624663037),(w1,1),(w29,1)],[(w27,1),(w22,2),(w0,1)],B,.right⟩ +def cfg_21 : RMConfig := ⟨[(w15,1),(w24,1003785396682293),(w17,1),(w25,12617720562450543),(w42,1),(w24,17749416207187510),(w17,1),(w25,208638928440262767),(w42,1),(w24,311012257079230006),(w17,1),(w25,3446309246101094511),(w42,1),(w24,5408541677495254582),(w17,1),(w25,56870330194527780975),(w42,1),(w24,93454195867565162038),(w17,1),(w25,4377498837804122109),(w35,1),(w17,1),(w25,2161727821137838077),(w35,1),(w17,1),(w25,23346660468288651261),(w1,1),(w29,1)],[(w41,1),(w20,762219256086640),(w22,56139517525558),(w41,1),(w20,45989436063856),(w22,3096402984502),(w41,1),(w20,2771260538992),(w22,167755382326),(w41,1),(w20,166761332848),(w22,8874098230),(w41,1),(w20,10019930224),(w22,453967414),(w41,1),(w20,601079920),(w22,2139229750),(w41,1),(w20,615576688),(w22,25705270),(w41,1),(w20,36900784),(w22,1212934),(w41,1),(w20,2208100),(w22,1225142966),(w10,2),(w20,1),(w22,6171),(w33,1),(w22,9709),(w41,1),(w20,374),(w0,1),(w23,5)],A,.left⟩ +def cfg_22 : RMConfig := ⟨[(w5,1), + (w17,1), + (w25,774763251095801167837), + (w1,1), + (w29,1)], + [(w22,1), + (w3,1), + (w19,1106804644422573096965), + (w6,1), + (w10,1), + (w22,1), + (w0,2), + (w47,1), + (w22,2594073385365405692), + (w33,1), + (w22,4971973988617027534), + (w31,1), + (w22,54853843461372641290), + (w8,1), + (w22,88941589040939925048), + (w31,1), + (w22,55742178487871471728), + (w8,1), + (w22,5126503750831177270), + (w31,1), + (w22,3375799764435075184), + (w8,1), + (w22,293384886662725174), + (w31,1), + (w22,204232085836136560), + (w8,1), + (w22,16647705556155958), + (w31,1), + (w22,12342292899692656), + (w8,1), + (w22,934928480992822), + (w31,1), + (w22,745005027164272), + (w8,1), + (w22,51835960294966), + (w31,1), + (w22,44913546756208), + (w8,1), + (w22,2827430657590), + (w31,1), + (w22,2704017457264), + (w8,1), + (w22,150944611894), + (w31,1), + (w22,162558640240), + (w8,1), + (w22,7823425078), + (w31,1), + (w22,9757261936), + (w8,1), + (w22,388300342), + (w31,1), + (w22,584663152), + (w8,1), + (w22,2135125558), + (w31,1), + (w22,614550640), + (w8,1), + (w22,25448758), + (w31,1), + (w22,36836656), + (w8,1), + (w22,1196902), + (w31,1), + (w22,2204092), + (w8,1), + (w22,1225141964), + (w44,1), + (w22,5920), + (w46,1), + (w22,9646), + (w36,1), + (w22,358), + (w37,1), + (w22,3), + (w0,1)], + A,.left⟩ +def cfg_23 : RMConfig := ⟨[(w28,1), + (w24,5691), + (w17,1), + (w1,1), + (w4,6), + (w24,1225141046), + (w17,1), + (w25,2200419), + (w42,1), + (w24,1182214), + (w17,1), + (w25,36777903), + (w42,1), + (w24,25213750), + (w17,1), + (w25,613610607), + (w42,1), + (w24,2131365430), + (w17,1), + (w25,569622639), + (w42,1), + (w24,328138294), + (w17,1), + (w25,9516613743), + (w42,1), + (w24,6860832310), + (w17,1), + (w25,158708269167), + (w42,1), + (w24,135543127606), + (w17,1), + (w25,2642411520111), + (w42,1), + (w24,2581006908982), + (w17,1), + (w25,43927851761775), + (w42,1), + (w24,47893180317238), + (w17,1), + (w25,729233907253359), + (w42,1), + (w24,871844001349174), + (w17,1), + (w25,12089954981118063), + (w42,1), + (w24,15638353881857590), + (w17,1), + (w25,200194679138943087), + (w42,1), + (w24,277235259873951286), + (w17,1), + (w25,3311201257279979631), + (w42,1), + (w24,4868109722210795062), + (w17,1), + (w25,54708602373389942895), + (w42,1), + (w24,84807284583013809718), + (w17,1), + (w25,903007754084803412079), + (w42,1), + (w24,1467597017770478272056), + (w17,1), + (w25,1055787867843720118281), + (w35,1), + (w17,1), + (w25,792057073664903872461), + (w35,1), + (w17,1), + (w25,373546567492618420221), + (w1,1), + (w29,1)], + [(w22,9589), + (w41,1), + (w20,344), + (w0,1), + (w23,5)], + A,.left⟩ +def cfg_24 : RMConfig := ⟨[(w17,1), + (w25,4), + (w1,1), + (w29,1)], + [(w3,1), + (w19,1494186269970473680883), + (w6,1), + (w10,3), + (w0,2), + (w6,1), + (w22,24273609357992556232246), + (w31,1), + (w22,14646138333773080559728), + (w8,1), + (w22,1406420120432277454390), + (w31,1), + (w22,887713529750253207664), + (w8,1), + (w22,80983728499376258614), + (w31,1), + (w22,53752713352480555120), + (w8,1), + (w22,4629137466983448118), + (w31,1), + (w22,3251458193473142896), + (w8,1), + (w22,262299493922242102), + (w31,1), + (w22,196460737651015792), + (w8,1), + (w22,14704868509875766), + (w31,1), + (w22,11856583638122608), + (w8,1), + (w22,813501165600310), + (w31,1), + (w22,714648198316144), + (w8,1), + (w22,44246753082934), + (w31,1), + (w22,43016244953200), + (w8,1), + (w22,2353105206838), + (w31,1), + (w22,2585436094576), + (w8,1), + (w22,121299271222), + (w31,1), + (w22,155147305072), + (w8,1), + (w22,5970591286), + (w31,1), + (w22,9294053488), + (w8,1), + (w22,272498230), + (w31,1), + (w22,555712624), + (w8,1), + (w22,2127887926), + (w31,1), + (w22,612741232), + (w8,1), + (w22,24996406), + (w31,1), + (w22,36723568), + (w8,1), + (w22,1168630), + (w31,1), + (w22,2197024), + (w8,1), + (w22,1225140197), + (w8,1), + (w22,5480), + (w45,1), + (w22,9535), + (w40,1), + (w22,330), + (w45,1), + (w22,3), + (w0,1)], + A,.left⟩ +def cfg_25 : RMConfig := ⟨[(w25,611644528), + (w42,1), + (w24,2123501110), + (w17,1), + (w25,538165359), + (w42,1), + (w24,202309174), + (w17,1), + (w25,9013297263), + (w42,1), + (w24,4847566390), + (w17,1), + (w25,150655205487), + (w42,1), + (w24,103330872886), + (w17,1), + (w25,2513562501231), + (w42,1), + (w24,2065610833462), + (w17,1), + (w25,41866267459695), + (w42,1), + (w24,39646843108918), + (w17,1), + (w25,696248558420079), + (w42,1), + (w24,739902606016054), + (w17,1), + (w25,11562189399785583), + (w42,1), + (w24,13527291556527670), + (w17,1), + (w25,191750429837623407), + (w42,1), + (w24,243458262668672566), + (w17,1), + (w25,3176093268458864751), + (w42,1), + (w24,4327677766926335542), + (w17,1), + (w25,52546874552252104815), + (w42,1), + (w24,76160373298462457398), + (w17,1), + (w25,868420108946598002799), + (w42,1), + (w24,1329246437217656634934), + (w17,1), + (w25,14337443600914597281903), + (w42,1), + (w24,23038830426558623120952), + (w17,1), + (w25,15121718454423404937225), + (w42,1), + (w24,5589363454333994139598), + (w17,1), + (w25,17930235239645684170749), + (w35,1), + (w17,1), + (w25,8854437155380584775677), + (w35,1), + (w17,1), + (w25,95627921278110315577341), + (w1,1), + (w29,1)], + [(w7,1), + (w22,24722230), + (w31,1), + (w22,36655024), + (w8,1), + (w22,1151494), + (w31,1), + (w22,2192740), + (w8,1), + (w22,1225139126), + (w44,1), + (w22,5211), + (w31,1), + (w22,9469), + (w31,1), + (w22,314), + (w8,1), + (w22,4), + (w0,1)], + B,.right⟩ +def cfg_26 : RMConfig := ⟨[(w29,1)], + [(w22,141670994486089104752620), + (w31,1), + (w22,60210172656588039389186), + (w10,1), + (w22,15728640), + (w40,1), + (w22,15716625950800541908990), + (w8,1), + (w22,382234983951335620017718), + (w31,1), + (w22,232802521896232969027696), + (w8,1), + (w22,22118799065882359295542), + (w31,1), + (w22,14107435760745531325552), + (w8,1), + (w22,1271744477175390145846), + (w31,1), + (w22,854044618936031380528), + (w8,1), + (w22,72566500795820801830), + (w31,1), + (w22,51648406426591690924), + (w8,1), + (w22,4103060735511232069), + (w36,1), + (w22,3119939010605088883), + (w49,1), + (w22,229419698205228597), + (w37,1), + (w22,188240788721762416), + (w8,1), + (w22,12649881277562422), + (w31,1), + (w22,11342836830044272), + (w8,1), + (w22,685064463580726), + (w31,1), + (w22,682539022811248), + (w8,1), + (w22,36219459206710), + (w31,1), + (w22,41009421484144), + (w8,1), + (w22,1851399339574), + (w31,1), + (w22,2460009627760), + (w8,1), + (w22,89942654518), + (w31,1), + (w22,147308150896), + (w8,1), + (w22,4010802742), + (w31,1), + (w22,8804106352), + (w8,1), + (w22,150011446), + (w31,1), + (w22,525090928), + (w8,1), + (w22,2120232502), + (w31,1), + (w22,610827376), + (w8,1), + (w22,24517942), + (w31,1), + (w22,36603952), + (w8,1), + (w22,1138726), + (w31,1), + (w22,2189548), + (w8,1), + (w22,1225138328), + (w44,1), + (w22,5011), + (w10,1), + (w22,9420), + (w45,1), + (w22,301), + (w18,1), + (w22,4), + (w0,1)], + D,.right⟩ +def cfg_27 : RMConfig := ⟨[(w29,1)], + [(w22,3123845428418270308859884), + (w31,1), + (w22,4545868035572392223834114), + (w10,1), + (w22,3099053004383204671488), + (w33,1), + (w22,11400087837552502898686), + (w8,1), + (w22,20558896270149295275982), + (w31,1), + (w22,224729765520975826255882), + (w8,1), + (w22,364316854387488306757176), + (w31,1), + (w22,228322989505271140712560), + (w8,1), + (w22,20998915968141902216758), + (w31,1), + (w22,13827464986310417055856), + (w8,1), + (w22,1201751783566611578422), + (w31,1), + (w22,836546445533836738672), + (w8,1), + (w22,68191957445272141366), + (w31,1), + (w22,50554770588954525808), + (w8,1), + (w22,3829651776101940790), + (w31,1), + (w22,3051586770752766064), + (w8,1), + (w22,212331638242147894), + (w31,1), + (w22,183968773730992240), + (w8,1), + (w22,11581877529869878), + (w31,1), + (w22,11075835893121136), + (w8,1), + (w22,618314229349942), + (w31,1), + (w22,665851464253552), + (w8,1), + (w22,32047569567286), + (w31,1), + (w22,39966449074288), + (w8,1), + (w22,1590656237110), + (w31,1), + (w22,2394823852144), + (w8,1), + (w22,73646210614), + (w31,1), + (w22,143234039920), + (w8,1), + (w22,2992274998), + (w31,1), + (w22,8549474416), + (w8,1), + (w22,86353462), + (w31,1), + (w22,509176432), + (w8,1), + (w22,2116253878), + (w31,1), + (w22,609832720), + (w8,1), + (w22,24269278), + (w31,1), + (w22,36541786), + (w8,1), + (w22,1123184), + (w10,1), + (w22,2185664), + (w37,1), + (w22,1225137355), + (w49,1), + (w22,4768), + (w46,1), + (w22,9358), + (w36,1), + (w22,286), + (w37,1), + (w22,3), + (w0,1)], + D,.right⟩ +def cfg_28 : RMConfig := ⟨[(w25,3300934171525882004373430), + (w1,1), + (w29,1)], + [(w27,1), + (w22,4501595849795489299955728), + (w50,1), + (w33,1), + (w22,6055549570564781928087094), + (w31,1), + (w22,3709787807175580506390640), + (w8,1), + (w22,350137649263080999222838), + (w31,1), + (w22,224778188224169313828976), + (w8,1), + (w22,20112715647866445495862), + (w31,1), + (w22,13605914906241552875632), + (w8,1), + (w22,1146364263549395533366), + (w31,1), + (w22,822699565529532727408), + (w8,1), + (w22,64730237444196138550), + (w31,1), + (w22,49689340588685525104), + (w8,1), + (w22,3613294276034690614), + (w31,1), + (w22,2997497395735953520), + (w8,1), + (w22,198809294487944758), + (w31,1), + (w22,180588187792441456), + (w8,1), + (w22,10736731045232182), + (w31,1), + (w22,10864549271961712), + (w8,1), + (w22,565492574060086), + (w31,1), + (w22,652646050431088), + (w8,1), + (w22,28746216111670), + (w31,1), + (w22,39141110710384), + (w8,1), + (w22,1384321646134), + (w31,1), + (w22,2343240204400), + (w8,1), + (w22,60750298678), + (w31,1), + (w22,140010061936), + (w8,1), + (w22,2186280502), + (w31,1), + (w22,8347975792), + (w8,1), + (w22,35978806), + (w31,1), + (w22,496582768), + (w8,1), + (w22,2113105462), + (w31,1), + (w22,609045616), + (w8,1), + (w22,24072502), + (w31,1), + (w22,36492592), + (w8,1), + (w22,1110886), + (w31,1), + (w22,2182588), + (w8,1), + (w22,1225136588), + (w44,1), + (w22,4576), + (w46,1), + (w22,9310), + (w36,1), + (w22,274), + (w37,1), + (w22,3), + (w0,1)], + B,.right⟩ +def cfg_29 : RMConfig := ⟨[(w29,1)], + [(w22,120817017180207482940476505), + (w31,1), + (w22,3173432005870781635283714), + (w8,1), + (w22,2989258416002080433189796), + (w31,1), + (w22,170005301469705980922626), + (w8,1), + (w22,179745101275825559253924), + (w31,1), + (w22,8854443910780506852098), + (w8,1), + (w22,10791346971970068214692), + (w31,1), + (w22,442722279981524368130), + (w8,1), + (w22,646789069637564936100), + (w31,1), + (w22,20752613471204190722), + (w8,1), + (w22,38694934595437538148), + (w31,1), + (w22,864692777722693874), + (w8,1), + (w22,2310347021157954336), + (w31,1), + (w22,27021700843444961), + (w44,1), + (w22,137641289381316506), + (w18,1), + (w22,6442450944), + (w49,1), + (w22,8180368121266401), + (w51,1), + (w22,370535955431076), + (w51,1), + (w22,23158463659684), + (w51,1), + (w22,1447403978404), + (w51,1), + (w22,90462748324), + (w51,1), + (w22,5653921444), + (w51,1), + (w22,353369764), + (w33,1), + (w22,2110856786), + (w10,1), + (w22,608483448), + (w33,1), + (w22,23931959), + (w46,1), + (w22,36457456), + (w8,1), + (w22,1102102), + (w31,1), + (w22,2180392), + (w8,1), + (w22,1225136039), + (w8,1), + (w22,4441), + (w44,1), + (w22,9275), + (w8,1), + (w22,266), + (w10,1), + (w0,1), + (w23,5)], + D,.right⟩ +def cfg_30 : RMConfig := ⟨[(w4,1),(w25,4),(w1,1),(w29,1)],[(w3,1),(w9,1),(w19,140401799637344103255592642),(w38,1),(w3,1),(w19,4976888274336870410422),(w38,1),(w3,1),(w19,1215060631078594342),(w38,1),(w3,1),(w19,296649968588482),(w38,1),(w3,1),(w19,73500983977),(w6,1),(w10,1),(w22,1),(w0,2),(w47,1),(w22,353369763),(w8,1),(w22,2110856786),(w10,1),(w22,608483448),(w33,1),(w22,23931959),(w46,1),(w22,36457456),(w8,1),(w22,1102102),(w31,1),(w22,2180392),(w8,1),(w22,1225136039),(w8,1),(w22,4441),(w44,1),(w22,9275),(w8,1),(w22,266),(w10,1),(w0,1),(w23,5)],A,.left⟩ +def cfg_31 : RMConfig := ⟨[(w25,128849018882),(w1,1),(w29,1)],[(w43,1),(w22,54760833020),(w32,1),(w10,1),(w22,14294188028),(w10,1),(w22,68551704580),(w33,1),(w22,140401799637344365864926148),(w41,1),(w22,4976888274267799719286),(w41,1),(w22,1215060613810921558),(w41,1),(w22,296645651670286),(w41,1),(w22,72421754428),(w10,1),(w22,2106076724),(w33,1),(w22,607288432),(w10,1),(w22,23633206),(w33,1),(w22,36382768),(w10,1),(w22,1083430),(w33,1),(w22,2175724),(w10,1),(w22,1225134872),(w46,1),(w22,4148),(w18,1),(w22,9203),(w45,1),(w22,247),(w18,1),(w22,4),(w0,1)],B,.right⟩ +def cfg_32 : RMConfig := ⟨[(w4,1),(w25,2),(w1,1),(w29,1)],[(w3,1),(w9,1),(w6,1),(w10,1),(w0,2),(w9,1),(w19,347892350966),(w6,1),(w10,4),(w0,2),(w12,1),(w22,5651640090164),(w31,1),(w22,3410069815408),(w8,1),(w22,48368713732),(w31,1),(w22,140401799637344360819178436),(w39,1),(w22,4976888274266538282358),(w39,1),(w22,1215060613495562326),(w39,1),(w22,296645572830478),(w39,1),(w22,72402044476),(w8,1),(w22,2101149236),(w31,1),(w22,606056560),(w8,1),(w22,23325238),(w31,1),(w22,36305776),(w8,1),(w22,1064182),(w31,1),(w22,2170912),(w8,1),(w22,1225133669),(w8,1),(w22,3848),(w45,1),(w22,9127),(w40,1),(w22,228),(w45,1),(w22,3),(w0,1)],A,.left⟩ +def cfg_33 : RMConfig := ⟨[(w4,1),(w25,4),(w1,1),(w29,1)],[(w3,1),(w9,1),(w19,48034914238384),(w38,1),(w22,65506841198608),(w3,1),(w19,1),(w6,1),(w10,3),(w0,2),(w26,1),(w22,296352743374),(w31,1),(w22,3269543854090),(w8,1),(w22,5301331820088),(w31,1),(w22,3322492747888),(w8,1),(w22,26474446852),(w31,1),(w22,140401799637344355345611716),(w39,1),(w22,4976888274265169890678),(w39,1),(w22,1215060613153464406),(w39,1),(w22,296645487305998),(w39,1),(w22,72380663356),(w8,1),(w22,2095803956),(w31,1),(w22,604720240),(w8,1),(w22,22991158),(w31,1),(w22,36222256),(w8,1),(w22,1043302),(w31,1),(w22,2165692),(w8,1),(w22,1225132364),(w44,1),(w22,3520),(w46,1),(w22,9046),(w36,1),(w22,208),(w37,1),(w22,3),(w0,1)],A,.left⟩ +def cfg_34 : RMConfig := ⟨[(w24,4),(w30,1)],[(w3,1),(w9,1),(w6,1),(w22,119571889520633),(w0,2),(w12,1),(w22,34016140984269),(w41,1),(w20,59631325937674),(w22,86650965196344),(w41,1),(w20,53617297981552),(w22,5003368463926),(w41,1),(w20,3248001908848),(w22,7851737092),(w33,1),(w22,140401799637344350689934276),(w41,1),(w22,4976888274264005971318),(w41,1),(w22,1215060612862484566),(w41,1),(w22,296645414561038),(w10,4),(w20,72362477116),(w22,2091257396),(w41,1),(w20,603583600),(w22,22706998),(w41,1),(w20,36151216),(w22,1025542),(w41,1),(w20,2161252),(w22,1225131254),(w10,2),(w20,1),(w22,3243),(w33,1),(w22,8977),(w33,1),(w22,191),(w10,2),(w20,1),(w22,3),(w0,1)],A,.left⟩ +def cfg_35 : RMConfig := ⟨[(w1,1),(w4,1),(w5,1),(w30,1)],[(w10,2),(w0,2),(w9,1),(w6,1),(w10,1),(w0,2),(w9,1),(w6,1),(w22,119185342457),(w0,2),(w26,1),(w20,86973087742),(w22,3211151290653742),(w33,1),(w22,437448408566002),(w41,1),(w22,140401799637343940524751854),(w41,1),(w22,4976888274263084273014),(w41,1),(w22,1215060612632059990),(w41,1),(w22,296645356954894),(w10,4),(w20,72348075580),(w22,2087657012),(w41,1),(w20,602683504),(w22,22481974),(w41,1),(w20,36094960),(w22,1011478),(w41,1),(w20,2157736),(w22,1225130375),(w33,1),(w20,3025),(w22,1),(w10,2),(w20,8921),(w22,178),(w10,2),(w22,4),(w0,1)],B,.right⟩ +def cfg_36 : RMConfig := ⟨[(w42,1),(w24,2082938420),(w17,1),(w25,72329201211),(w42,1),(w17,1),(w25,296645281457421),(w42,1),(w17,1),(w25,1215060612330070101),(w42,1),(w17,1),(w25,4976888274261876313461),(w42,1),(w17,1),(w25,140401799637343935692913645),(w42,1),(w17,1),(w25,437429081213169),(w42,1),(w24,3211073981242414),(w17,1),(w25,13683765805167),(w35,1),(w17,1),(w25,22780506537525),(w1,1),(w29,1)],[(w16,1),(w22,601503855),(w8,1),(w22,22187062),(w31,1),(w22,36021232),(w8,1),(w22,993046),(w31,1),(w22,2153128),(w8,1),(w22,1225129223),(w8,1),(w22,2737),(w44,1),(w22,8849),(w8,1),(w22,160),(w31,1),(w22,3),(w0,1)],B,.right⟩ +def cfg_37 : RMConfig := ⟨[(w35,1),(w17,1),(w25,131941395333081),(w1,1),(w29,1)],[(w16,1),(w22,56075093016582),(w36,1),(w44,1),(w22,14637248544765),(w33,1),(w22,4690104287182),(w31,1),(w22,13954348744714),(w8,1),(w22,21424370613816),(w31,1),(w22,13344731824240),(w8,1),(w22,3210989222747182),(w31,1),(w22,437407891589362),(w39,1),(w22,140401799637343930395507694),(w39,1),(w22,4976888274260551961974),(w39,1),(w22,1215060611998982230),(w39,1),(w22,296645198685454),(w39,1),(w22,72308508220),(w8,1),(w22,2077765172),(w31,1),(w22,600210544),(w8,1),(w22,21863734),(w31,1),(w22,35940400),(w8,1),(w22,972838),(w31,1),(w22,2148076),(w8,1),(w22,1225127960),(w44,1),(w22,2419),(w10,1),(w22,8772),(w45,1),(w22,139),(w18,1),(w22,4),(w0,1)],B,.right⟩ +def cfg_38 : RMConfig := ⟨[(w5,1),(w24,5),(w30,1)],[(w22,211106232532937),(w0,2),(w26,1),(w20,257285720899594),(w22,351293965073976),(w41,1),(w20,215641717997680),(w22,20306605375030),(w41,1),(w20,13065290514544),(w22,3210919362419758),(w33,1),(w22,437390426507506),(w41,1),(w22,140401799637343926029237230),(w41,1),(w22,4976888274259460394358),(w41,1),(w22,1215060611726090326),(w41,1),(w22,296645130462478),(w10,4),(w20,72291452476),(w22,2073501236),(w41,1),(w20,599144560),(w22,21597238),(w41,1),(w20,35873776),(w22,956182),(w41,1),(w20,2143912),(w22,1225126919),(w33,1),(w20,2161),(w22,1),(w10,2),(w20,8705),(w22,124),(w10,2),(w22,4),(w0,1)],A,.left⟩ +def cfg_39 : RMConfig := ⟨[(w25,3476655767027824),(w42,1),(w24,5726256557456950),(w17,1),(w25,356241767399421),(w35,1),(w17,1),(w25,488183162732541),(w1,1),(w29,1)],[(w7,1),(w22,331502755774006),(w31,1),(w22,210693915672688),(w8,1),(w22,19069654793782),(w31,1),(w22,12756052869232),(w8,1),(w22,3210842053008430),(w31,1),(w22,437371099154674),(w39,1),(w22,140401799637343921197399022),(w39,1),(w22,4976888274258252434806),(w39,1),(w22,1215060611424100438),(w39,1),(w22,296645054965006),(w39,1),(w22,72272578108),(w8,1),(w22,2068782644),(w31,1),(w22,597964912),(w8,1),(w22,21302326),(w31,1),(w22,35800048),(w8,1),(w22,937750),(w31,1),(w22,2139304),(w8,1),(w22,1225125767),(w8,1),(w22,1873),(w44,1),(w22,8633),(w8,1),(w22,106),(w31,1),(w22,3),(w0,1)],B,.right⟩ +def cfg_40 : RMConfig := ⟨[(w1,1),(w4,6),(w24,1),(w17,1),(w25,47287796087390173),(w1,1),(w29,1)],[(w16,1),(w22,67553994410557444),(w32,1),(w48,1),(w22,158329674399740),(w33,1),(w22,303465209266126),(w31,1),(w22,3348012906577930),(w8,1),(w22,5428563784236600),(w31,1),(w22,3402232573722736),(w8,1),(w22,312896957447734),(w31,1),(w22,206042466091120),(w8,1),(w22,17906792398390),(w31,1),(w22,12465337270384),(w8,1),(w22,3210769374108718),(w31,1),(w22,437352929429746),(w39,1),(w22,140401799637343916654967790),(w39,1),(w22,4976888274257116826998),(w39,1),(w22,1215060611140198486),(w39,1),(w22,296644983989518),(w39,1),(w22,72254834236),(w8,1),(w22,2064346676),(w31,1),(w22,596855920),(w8,1),(w22,21025078),(w31,1),(w22,35730736),(w8,1),(w22,920422),(w31,1),(w22,2134972),(w8,1),(w22,1225124684),(w44,1),(w22,1600),(w46,1),(w22,8566),(w36,1),(w22,88),(w37,1),(w22,3),(w0,1)],B,.right⟩ +def cfg_41 : RMConfig := ⟨[(w4,1),(w25,4),(w1,1),(w29,1)],[(w3,1),(w9,1),(w19,91197892454252530),(w6,1),(w10,1),(w22,1),(w0,2),(w26,1),(w22,42643458971664334),(w31,1),(w22,63015210411098122),(w8,1),(w22,89218771524255288),(w31,1),(w22,55026158923677808),(w8,1),(w22,5153960755199542),(w31,1),(w22,3333581816463472),(w8,1),(w22,295734268132918),(w31,1),(w22,201751793762416),(w8,1),(w22,16834124316214),(w31,1),(w22,12197170249840),(w8,1),(w22,3210702332353582),(w31,1),(w22,437336168990962),(w39,1),(w22,140401799637343912464858094),(w39,1),(w22,4976888274256069299574),(w39,1),(w22,1215060610878316630),(w39,1),(w22,296644918519054),(w39,1),(w22,72238466620),(w8,1),(w22,2060254772),(w31,1),(w22,595832944),(w8,1),(w22,20769334),(w31,1),(w22,35666800),(w8,1),(w22,904438),(w31,1),(w22,2130976),(w8,1),(w22,1225123685),(w8,1),(w22,1352),(w45,1),(w22,8503),(w40,1),(w22,72),(w45,1),(w22,3),(w0,1)],A,.left⟩ +def cfg_42 : RMConfig := ⟨[(w1,1),(w30,1)],[(w7,1),(w22,124974889659531261),(w41,1),(w20,91197892454252542),(w22,1465921678709095990),(w41,1),(w20,890023876359094384),(w22,84864705478262326),(w41,1),(w20,53937642412179568),(w22,4881831627324982),(w41,1),(w20,3265549534494832),(w22,278726197640758),(w41,1),(w20,197499776139376),(w22,15771119910454),(w41,1),(w20,11931419148400),(w22,3210635894578222),(w33,1),(w22,437319559547122),(w41,1),(w22,140401799637343908312497134),(w41,1),(w22,4976888274255031209334),(w41,1),(w22,1215060610618794070),(w41,1),(w22,296644853638414),(w10,4),(w20,72222246460),(w22,2056199732),(w41,1),(w20,594819184),(w22,20515894),(w41,1),(w20,35603440),(w22,888598),(w41,1),(w20,2127016),(w22,1225122695),(w33,1),(w20,1105),(w22,1),(w10,2),(w20,8441),(w22,58),(w10,2),(w22,4),(w0,1)],B,.right⟩ +def cfg_43 : RMConfig := ⟨[(w29,1)], + [(w22,12105670025935847404), + (w31,1), + (w22,17293824012211716098), + (w10,1), + (w22,360777252864), + (w33,1), + (w22,40532486840647678), + (w8,1), + (w22,77687116120719310), + (w31,1), + (w22,857091309721092106), + (w8,1), + (w22,1389712330173972024), + (w31,1), + (w22,870971539225313392), + (w8,1), + (w22,80101621194817078), + (w31,1), + (w22,52746871341318256), + (w8,1), + (w22,4584138859609654), + (w31,1), + (w22,3191126342566000), + (w8,1), + (w22,260120399658550), + (w31,1), + (w22,192848326643824), + (w8,1), + (w22,14608257536566), + (w31,1), + (w22,11640703554928), + (w8,1), + (w22,3210563215679854), + (w31,1), + (w22,437301389822530), + (w39,1), + (w22,140401799637343903770065986), + (w39,1), + (w22,4976888274253895601547), + (w32,1), + (w22,1215060610334892124), + (w32,1), + (w22,296644782662928), + (w32,1), + (w22,72204502589), + (w8,1), + (w22,2051763764), + (w31,1), + (w22,593710192), + (w8,1), + (w22,20238646), + (w31,1), + (w22,35534128), + (w8,1), + (w22,871270), + (w31,1), + (w22,2122684), + (w8,1), + (w22,1225121612), + (w44,1), + (w22,832), + (w46,1), + (w22,8374), + (w36,1), + (w22,40), + (w37,1), + (w22,3), + (w0,1)], + D,.right⟩ +def cfg_44 : RMConfig := ⟨[(w15,1), + (w24,602), + (w17,1), + (w1,1), + (w4,6), + (w24,1225120694), + (w17,1), + (w25,2119011), + (w42,1), + (w24,856582), + (w17,1), + (w25,35475375), + (w42,1), + (w24,20003638), + (w17,1), + (w25,592770159), + (w42,1), + (w24,2048003636), + (w17,1), + (w25,72189462075), + (w42,1), + (w17,1), + (w25,296644722500877), + (w42,1), + (w17,1), + (w25,1215060610094243925), + (w42,1), + (w17,1), + (w25,4976888274252933008757), + (w42,1), + (w17,1), + (w25,140401799637343899919694829), + (w42,1), + (w17,1), + (w25,437285988337905), + (w42,1), + (w24,3210501609741358), + (w17,1), + (w25,11394279800943), + (w42,1), + (w24,13622562520630), + (w17,1), + (w25,188905546580079), + (w42,1), + (w24,244349279403574), + (w17,1), + (w25,3128041861546095), + (w42,1), + (w24,4331800935530038), + (w17,1), + (w25,51737519644999791), + (w42,1), + (w24,76064214409543222), + (w17,1), + (w25,854821912084217967), + (w42,1), + (w24,1325113821609590326), + (w17,1), + (w25,14109496157575053423), + (w42,1), + (w24,22931203402663722552), + (w17,1), + (w25,16496685435058126857), + (w35,1), + (w17,1), + (w25,12375891776014122957), + (w35,1), + (w17,1), + (w25,5836665117072162813), + (w1,1), + (w29,1)], + [(w33,1), + (w22,8317), + (w41,1), + (w20,26), + (w0,1), + (w23,5)], + A,.left⟩ +def cfg_45 : RMConfig := ⟨[(w0,1), + (w4,1), + (w17,1), + (w25,3), + (w1,1), + (w29,1)], + [(w0,2), + (w9,1), + (w19,23346660468288651254), + (w6,1), + (w10,4), + (w0,2), + (w12,1), + (w22,379275146218633690676), + (w31,1), + (w22,228845911465204383856), + (w8,1), + (w22,21975314381754334774), + (w31,1), + (w22,13870523902347706480), + (w8,1), + (w22,1265370757802753590), + (w31,1), + (w22,839886146132508784), + (w8,1), + (w22,72330272921615926), + (w31,1), + (w22,50804034273017968), + (w8,1), + (w22,4098429592534582), + (w31,1), + (w22,3069699025797232), + (w8,1), + (w22,229763570466358), + (w31,1), + (w22,185259119345776), + (w8,1), + (w22,12710955712054), + (w31,1), + (w22,11166378098800), + (w8,1), + (w22,3210444634315822), + (w31,1), + (w22,437271744481522), + (w39,1), + (w22,140401799637343896358730734), + (w39,1), + (w22,4976888274252042767734), + (w39,1), + (w22,1215060609871683670), + (w39,1), + (w22,296644666860814), + (w39,1), + (w22,72175552060), + (w8,1), + (w22,2044526132), + (w31,1), + (w22,591900784), + (w8,1), + (w22,19786294), + (w31,1), + (w22,35421040), + (w8,1), + (w22,842998), + (w31,1), + (w22,2115616), + (w8,1), + (w22,1225119845), + (w8,1), + (w22,392), + (w45,1), + (w22,8263), + (w40,1), + (w22,12), + (w45,1), + (w22,3), + (w0,1)], + A,.left⟩ +def cfg_46 : RMConfig := ⟨[(w14,1), + (w17,1), + (w25,8200), + (w1,1), + (w4,6), + (w24,1), + (w17,1), + (w25,144), + (w35,1), + (w24,1225118855), + (w17,1), + (w25,2111655), + (w42,1), + (w24,827158), + (w17,1), + (w25,35357679), + (w42,1), + (w24,19532854), + (w17,1), + (w25,590887023), + (w42,1), + (w24,2040471092), + (w17,1), + (w25,72159331899), + (w42,1), + (w17,1), + (w25,296644601980173), + (w42,1), + (w17,1), + (w25,1215060609612161109), + (w42,1), + (w17,1), + (w25,4976888274251004677493), + (w42,1), + (w17,1), + (w25,140401799637343892206369773), + (w42,1), + (w17,1), + (w25,437255135037681), + (w42,1), + (w24,3210378196540462), + (w17,1), + (w25,10900626997359), + (w42,1), + (w24,11647951306294), + (w17,1), + (w25,181007101722735), + (w42,1), + (w24,212755499974198), + (w17,1), + (w25,3001666743828591), + (w42,1), + (w24,3826300464660022), + (w17,1), + (w25,49715517761519727), + (w42,1), + (w24,67976206875622966), + (w17,1), + (w25,822469881948536943), + (w42,1), + (w24,1195705701066866230), + (w17,1), + (w25,13591863675404157039), + (w42,1), + (w24,20860673473980137014), + (w17,1), + (w25,224387347834107592815), + (w42,1), + (w24,361440891694246526520), + (w17,1), + (w25,242113515967437864969), + (w42,1), + (w24,110680464442257309646), + (w17,1), + (w25,629495141515338448893), + (w1,1), + (w29,1)], + [(w0,1), + (w1,1), + (w0,1), + (w10,2), + (w0,2)], + A,.left⟩ +theorem chunk_0_step : (cfg_0.denote) [qi]⊢* (cfg_1.denote) := + step_chunk [ + .ms [(.m96,.s12,3),(.m97,.s13,1)], + .ms2 .s7 .s12 [(.m98,1,3)], + .ms [(.m99,.s0,1),(.m100,.s13,1)], + .ms2 .s12 .s14 [(.m101,1,1)], + .ms2 .s12 .s6 [(.m102,9,1)], + .ms [(.m103,.s3,2)], + .ms2 .s12 .s14 [(.m104,1,1)], + .ms [(.m105,.s13,1)], + .ms2 .s12 .s14 [(.m101,1,1),(.m102,7,1)], + .ms [(.m106,.s5,1)], + .m .m107, + .b 0 [[([1],[(.D16,1)])]], + .m .m50, + .b 1 [[([3],[(.D6,2)])]], + .m .m51, + .b 3 [[([3],[(.D18,1),(.D17,0)])]], + .ms2 .s6 .s12 [(.m2,5,12)], + .ms2 .s3 .s8 [(.m103,1,4)], + .ms [(.m108,.s8,1),(.m108,.s8,1),(.m108,.s8,1),(.m108,.s8,1)], + .ms2 .s7 .s12 [(.m109,5,1)], + .s .s14 1, + .ms2 .s8 .s10 [(.m110,1,1)], + .ms2 .s12 .s14 [(.m111,1,1)], + .ms2 .s8 .s10 [(.m110,2,1)], + .ms2 .s12 .s14 [(.m111,1,1)], + .ms [(.m110,.s8,2)], + .ms2 .s12 .s14 [(.m111,1,1)], + .m .m112, + .b 0 [[([4],[(.D7,5),(.D19,0)])]], + .ms2 .s6 .s7 [(.m2,2,1)], + .s2 .s12 .s6 [(6,3)], + .s2 .s7 .s12 [(1,1)], + .s .s14 1, + .ms2 .s2 .s8 [(.m110,1,2)], + .s2 .s5 .s2 [(3,1)], + .s2 .s8 .s10 [(2,1)], + .ms2 .s12 .s14 [(.m111,1,1)], + .m .m113, + .b 2 [[([15],[(.D12,3),(.D8,1)])]], + .ms2 .s6 .s12 [(.m2,10,6)], + .s2 .s6 .s7 [(2,1)], + .s .s12 6, + .ms2 .s3 .s0 [(.m103,1,1)], + .s2 .s8 .s3 [(2,2),(2,4)], + .ms [(.m108,.s8,1),(.m108,.s8,1),(.m108,.s8,1),(.m108,.s8,1),(.m108,.s8,1)], + .ms2 .s7 .s12 [(.m109,10,1)], + .s .s14 1, + .ms2 .s2 .s8 [(.m110,5,1)], + .s .s10 1, + .ms2 .s12 .s14 [(.m111,1,1)], + .ms2 .s8 .s10 [(.m110,2,1)], + .ms2 .s12 .s14 [(.m111,1,1)], + .ms [(.m110,.s8,2)], + .ms2 .s12 .s14 [(.m111,1,1)], + .m .m112, + .b 0 [[([20,28,4],[(.D7,10),(.D17,2),(.D12,1)])]], + .ms2 .s6 .s7 [(.m2,26,1)], + .s2 .s12 .s6 [(6,2)], + .s2 .s7 .s12 [(1,9)], + .s .s6 1, + .ms2 .s3 .s8 [(.m103,2,2)], + .s2 .s3 .s0 [(1,2)], + .s2 .s8 .s3 [(2,1)], + .s .s0 21, + .ms [(.m26,.s7,26),(.m8,.s2,21)], + .m .m9, + .b 0 [[([20],[(.D7,26),(.D13,2),(.D6,1)])],[([62],[(.D15,23)]),([13,3],[(.D17,3),(.D13,0)]),([1],[(.D6,2)])]], + .ms2 .s6 .s7 [(.m2,41,16)], + .ms2 .s5 .s2 [(.m36,16,36)], + .m .m18, + .b 41 [[([23],[(.D6,16),(.D18,1),(.D9,1)])]], + .ms2 .s6 .s7 [(.m2,53,13)], + .s .s12 6, + .ms [(.m114,.s13,2)], + .ms2 .s2 .s8 [(.m115,1,2)], + .s2 .s5 .s2 [(13,48)], + .m .m18, + .b 53 [[([9],[(.D6,13),(.D6,1)])]], + .ms2 .s6 .s12 [(.m2,58,6)], + .s2 .s6 .s12 [(11,7)], + .s .s14 1, + .ms2 .s8 .s5 [(.m110,4,11)], + .s2 .s8 .s5 [(2,52)], + .m .m5, + .b 58 [[([7],[(.D16,11),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,62,1)], + .s2 .s12 .s6 [(6,9)], + .s2 .s7 .s12 [(1,4)], + .s .s14 1, + .ms2 .s8 .s5 [(.m110,2,1)], + .s2 .s2 .s8 [(9,2)], + .s2 .s5 .s2 [(1,57)], + .m .m18, + .b 62 [[([15],[(.D12,9),(.D6,2)])]], + .ms2 .s6 .s12 [(.m2,70,6)], + .s2 .s6 .s12 [(8,13)], + .s .s14 1, + .ms2 .s8 .s5 [(.m110,6,8)], + .s2 .s8 .s5 [(2,64)], + .m .m5, + .b 70 [[([7],[(.D16,8),(.D18,0)])]], + .ms2 .s6 .s7 [(.m2,74,1)], + .s2 .s12 .s6 [(6,6)], + .s2 .s7 .s12 [(1,1)], + .s .s14 1, + .ms2 .s2 .s8 [(.m110,1,2)], + .s2 .s5 .s2 [(6,1)], + .s2 .s8 .s5 [(2,68)], + .m .m5, + .b 74 [[([5],[(.D12,6),(.D6,1)])]], + .ms2 .s6 .s7 [(.m2,77,7)], + .s2 .s12 .s14 [(10,1)], + .ms2 .s8 .s5 [(.m110,4,7)], + .s .s2 72, + .m .m18, + .b 77 [[([9],[(.D6,7),(.D16,1)])]], + .ms2 .s6 .s12 [(.m2,82,6)], + .s2 .s6 .s7 [(5,1)], + .s .s12 5, + .ms2 .s3 .s2 [(.m103,1,1)], + .s2 .s8 .s5 [(2,5),(2,76)], + .m .m5, + .b 82 [[([13],[(.D16,5),(.D6,2)])]], + .ms [(.m2,.s6,89),(.m52,.s2,84)], + .m .m18, + .b 89 [[([9],[(.D6,4),(.D18,0)])]], + .ms [(.m2,.s6,94),(.m53,.s5,88)], + .m .m5, + .b 94 [[([5],[(.D16,2),(.D6,1)])],[([2],[(.D9,1),(.D15,0)])]], + .ms [(.m2,.s6,98),(.m54,.s0,93),(.m26,.s7,98),(.m8,.s2,93)], + .m .m9, + .b 0 [[([20],[(.D7,98),(.D13,0),(.D16,1)])]], + .ms [(.m55,.s6,95)], + .ms2 .s3 .s8 [(.m39,95,2)], + .s .s3 4, + .ms [(.m108,.s8,1),(.m108,.s8,1),(.m108,.s8,1),(.m108,.s8,1),(.m108,.s8,1)], + .ms2 .s7 .s12 [(.m109,10,1)], + .s .s14 1, + .ms2 .s2 .s8 [(.m110,5,1)], + .s .s10 1, + .ms2 .s12 .s14 [(.m111,1,1)], + .ms2 .s8 .s10 [(.m110,2,1)], + .ms2 .s12 .s14 [(.m111,1,1)], + .ms [(.m110,.s8,2)], + .ms2 .s12 .s14 [(.m111,1,1)], + .m .m112, + .b 0 [[([38,14],[(.D7,10),(.D17,95)]),([3],[(.D12,2)])]], + .ms [(.m2,.s6,26),(.m56,.s7,94),(.m57,.s3,94),(.m58,.s0,21),(.m26,.s7,26),(.m8,.s2,21)], + .m .m9, + .b 0 [[([82],[(.D7,26)]),([8,9,3],[(.D13,2),(.D6,94)])]], + .ms2 .s6 .s7 [(.m2,41,16)], + .ms2 .s5 .s2 [(.m36,16,36)], + .m .m18, + .b 41 [[([23],[(.D6,16),(.D18,1),(.D15,91),(.D16,3)])]], + .ms2 .s6 .s7 [(.m2,53,13)], + .s .s12 6, + .ms [(.m114,.s13,2)], + .ms2 .s2 .s8 [(.m115,1,2)], + .s2 .s5 .s2 [(13,48)], + .m .m18, + .b 53 [[([9],[(.D6,13),(.D6,1)])]], + .ms2 .s6 .s12 [(.m2,58,6)], + .s2 .s6 .s12 [(11,7)], + .s .s14 1, + .ms2 .s8 .s5 [(.m110,4,11)], + .s2 .s8 .s5 [(2,52)], + .m .m5, + .b 58 [[([7],[(.D16,11),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,62,1)], + .s2 .s12 .s6 [(6,9)], + .s2 .s7 .s12 [(1,4)], + .s .s14 1, + .ms2 .s8 .s5 [(.m110,2,1)], + .s2 .s2 .s8 [(9,2)], + .s2 .s5 .s2 [(1,57)], + .m .m18, + .b 62 [[([15],[(.D12,9),(.D6,2)])]], + .ms2 .s6 .s12 [(.m2,70,6)], + .s2 .s6 .s12 [(8,10)], + .s .s14 1, + .ms2 .s8 .s5 [(.m110,5,8)], + .s2 .s8 .s5 [(2,64)], + .m .m5, + .b 70 [[([13],[(.D16,8),(.D18,1),(.D17,90),(.D17,3)])]], + .ms [(.m2,.s6,77)], + .ms2 .s12 .s6 [(.m59,15,90)], + .ms [(.m37,.s0,90),(.m60,.s0,72),(.m26,.s7,77),(.m8,.s2,72)], + .m .m9, + .b 0 [[([34],[(.D7,77),(.D7,6),(.D18,0)])]], + .ms2 .s6 .s7 [(.m2,17,73)], + .s2 .s12 .s6 [(9,5)], + .s2 .s7 .s12 [(1,1)], + .s .s14 1, + .ms2 .s2 .s8 [(.m110,1,2)], + .s2 .s5 .s8 [(5,2)], + .s2 .s5 .s2 [(73,12)], + .s2 .s8 .s10 [(1,1)], + .ms2 .s12 .s14 [(.m111,1,1)], + .ms2 .s8 .s10 [(.m110,2,1)], + .ms2 .s12 .s14 [(.m111,1,1)], + .ms [(.m116,.s11,1)], + .ms2 .s12 .s14 [(.m117,1,1)], + .m .m113, + .b 17 [[([155],[(.D6,73)]),([17,10,11],[(.D16,5),(.D8,90)]),([3],[(.D6,4)])],[([46],[(.D17,53),(.D12,91),(.D9,2)])]], + .ms [(.m2,.s6,118),(.m3,.s6,47),(.m6,.s6,89),(.m39,.s3,89),(.m13,.s3,47),(.m4,.s3,112),(.m10,.s7,118),(.m8,.s2,113)], + .m .m9, + .b 0 [[([244],[(.D7,118),(.D17,47),(.D12,89),(.D12,2)])]], + .ms [(.m2,.s6,122)], + .ms2 .s6 .s7 [(.m6,86,40)], + .ms [(.m0,.s6,88),(.m30,.s3,88)], + .ms2 .s3 .s0 [(.m4,40,86)], + .ms [(.m17,.s0,117),(.m26,.s7,122),(.m8,.s2,117)], + .m .m9, + .b 0 [[([491,47],[(.D7,122),(.D13,86)]),([33],[(.D6,40),(.D16,88),(.D16,3)])]], + .ms2 .s6 .s7 [(.m2,269,55)], + .ms [(.m0,.s6,70),(.m3,.s6,35),(.m6,.s6,86),(.m37,.s0,86),(.m17,.s0,35),(.m1,.s3,70)], + .ms2 .s3 .s0 [(.m4,55,264)], + .ms [(.m26,.s7,269),(.m8,.s2,264)], + .m .m9, + .b 0 [[([868,432,234,102,48,42,6],[(.D7,269),(.D7,54),(.D16,70)]),([27],[(.D16,35),(.D12,86),(.D6,4)])],[([18],[(.D11,51),(.D13,0),(.D6,57)])],[([36],[(.D17,50)]),([7,2],[(.D12,1),(.D17,55)]),([1],[(.D7,32)])],[([10],[(.D17,46),(.D21,0),(.D17,54),(.D8,31)])]], + .ms [(.m2,.s6,898),(.m3,.s6,44),(.m7,.s5,44),(.m4,.s5,892)], + .m .m5, + .b 898 [[([173,93,48,24,12],[(.D16,44),(.D8,55)]),([22],[(.D9,31),(.D7,86),(.D8,2)])],[([7,2],[(.D12,1),(.D6,44)])]], + .ms [(.m2,.s6,1078),(.m15,.s5,1072)], + .m .m5, + .b 1078 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,1079),(.m25,.s2,1074)], + .m .m18, + .b 1079 [[([3],[(.D6,2)])],[([2],[(.D21,0),(.D7,42)])]], + .ms [(.m2,.s6,1082),(.m7,.s5,1076)], + .m .m5, + .b 1082 [[([10],[(.D8,1),(.D17,41),(.D7,29)])],[([7,2],[(.D12,1),(.D17,39)]),([1],[(.D8,28)])],[([2],[(.D21,0),(.D17,39),(.D9,28)])]], + .ms [(.m2,.s6,1093),(.m7,.s5,1087)], + .m .m5, + .b 1093 [[([157,8],[(.D8,39),(.D10,27)]),([10],[(.D13,85),(.D9,2)])]], + .ms2 .s6 .s7 [(.m2,1176,20)], + .ms [(.m0,.s6,23),(.m6,.s6,83),(.m39,.s3,83),(.m13,.s3,23)], + .ms2 .s3 .s0 [(.m4,20,1171)], + .ms [(.m26,.s7,1176),(.m8,.s2,1171)], + .m .m9, + .b 0 [[([586],[(.D7,1176)]),([74,36,22,12,2],[(.D7,19),(.D16,23)]),([9],[(.D12,83),(.D12,2)])]], + .ms2 .s6 .s7 [(.m2,293,1103)], + .ms2 .s5 .s2 [(.m40,1103,288)], + .m .m18, + .b 293 [[([9],[(.D6,1103),(.D16,1)])]], + .ms [(.m2,.s6,298),(.m3,.s6,1101),(.m25,.s2,1101),(.m1,.s5,292)], + .m .m5, + .b 298 [[([13],[(.D16,1101),(.D6,2)])],[([96],[(.D17,1100),(.D21,19),(.D9,82),(.D14,2)])]], + .ms2 .s6 .s7 [(.m2,353,1088)], + .ms [(.m41,.s6,16),(.m3,.s6,82),(.m30,.s3,82),(.m4,.s3,16)], + .ms2 .s3 .s0 [(.m1,1088,348)], + .ms [(.m26,.s7,353),(.m8,.s2,348)], + .m .m9, + .b 0 [[([514],[(.D7,353),(.D7,1087),(.D18,16),(.D16,82),(.D16,3)])]], + .ms2 .s6 .s7 [(.m2,257,289)], + .ms [(.m0,.s6,1071),(.m61,.s6,80)], + .ms2 .s0 .s8 [(.m37,80,2)], + .s2 .s3 .s0 [(1,12)], + .s2 .s8 .s3 [(4,1071)], + .ms2 .s3 .s0 [(.m4,289,252)], + .ms [(.m26,.s7,257),(.m8,.s2,252)], + .m .m9, + .b 0 [[([1031,516,253,131,61,35,13,11,1],[(.D7,257),(.D7,288)]),([128],[(.D16,1071),(.D18,12),(.D12,80),(.D6,4)])],[([5],[(.D13,0),(.D6,224)])],[([7,2],[(.D12,1),(.D17,222)]),([1],[(.D12,1054)])],[([2],[(.D21,0),(.D17,222),(.D13,1054)])]], + .ms [(.m2,.s6,1034),(.m7,.s5,1028)], + .m .m5, + .b 1034 [[([783,232],[(.D8,222),(.D14,1054)]),([33,16,8,4,2],[(.D18,8),(.D8,79)]),([3],[(.D8,2)])]], + .ms [(.m2,.s6,1542),(.m3,.s6,96),(.m3,.s6,1023),(.m62,.s7,77),(.m31,.s3,77),(.m63,.s3,1023),(.m4,.s3,96),(.m4,.s3,1536),(.m10,.s7,1542),(.m8,.s2,1537)], + .m .m9, + .b 0 [[([124],[(.D7,1542),(.D17,96),(.D16,1023),(.D18,0)])]], + .ms [(.m2,.s6,62),(.m6,.s6,1525),(.m6,.s6,91),(.m6,.s6,1021),(.m7,.s5,1021),(.m11,.s5,91),(.m11,.s5,1525),(.m11,.s5,56)], + .m .m5, + .b 62 [[([863],[(.D12,1525),(.D12,91),(.D12,1021)]),([10,3],[(.D8,1),(.D6,77)])],[([160],[(.D11,1417),(.D11,64),(.D17,1016),(.D21,0),(.D15,75),(.D12,2)])]], + .ms [(.m2,.s6,574),(.m3,.s6,1398),(.m3,.s6,60),(.m3,.s6,1014),(.m7,.s5,1014),(.m4,.s5,60),(.m4,.s5,1398),(.m4,.s5,568)], + .m .m5, + .b 574 [[([127],[(.D16,1398),(.D16,60),(.D16,1014),(.D6,1)])]], + .ms [(.m2,.s6,638),(.m6,.s6,1381),(.m6,.s6,55),(.m6,.s6,1012),(.m15,.s5,1012),(.m11,.s5,55),(.m11,.s5,1381),(.m11,.s5,632)], + .m .m5, + .b 638 [[([95],[(.D12,1381),(.D12,55),(.D12,1012),(.D16,1)])]], + .ms [(.m2,.s6,686),(.m6,.s6,1369)], + .ms2 .s6 .s7 [(.m6,52,1013)], + .ms [(.m23,.s1,1013),(.m22,.s4,52),(.m44,.s4,1369),(.m44,.s4,680)], + .m .m24, + .b 686 [[([287],[(.D12,1369),(.D12,52),(.D6,1013),(.D6,2)])]], + .ms [(.m2,.s6,830),(.m6,.s6,1333),(.m6,.s6,43),(.m6,.s6,1009),(.m14,.s5,1009),(.m11,.s5,43),(.m11,.s5,1333),(.m11,.s5,824)], + .m .m5, + .b 830 [[([383],[(.D12,1333),(.D12,43),(.D12,1009),(.D18,1),(.D17,74),(.D13,2)])]], + .ms [(.m2,.s6,1022),(.m6,.s6,1285),(.m6,.s6,31),(.m6,.s6,1006),(.m7,.s5,1006),(.m11,.s5,31),(.m11,.s5,1285),(.m11,.s5,1016)], + .m .m5, + .b 1022 [[([479],[(.D12,1285),(.D12,31),(.D12,1006),(.D8,74),(.D14,2)])]], + .ms [(.m2,.s6,1262),(.m6,.s6,1225)], + .ms2 .s6 .s7 [(.m6,16,1004)], + .ms [(.m0,.s6,74),(.m30,.s3,74)], + .ms2 .s3 .s0 [(.m4,1004,16)], + .ms [(.m17,.s0,1225),(.m17,.s0,1257),(.m26,.s7,1262),(.m8,.s2,1257)], + .m .m9, + .b 0 [[([2074],[(.D7,1262),(.D13,1225)]),([67,36,14,10,2],[(.D12,16),(.D6,1004)]),([7],[(.D16,74),(.D16,3)])]], + .ms2 .s6 .s7 [(.m2,1037,1003)], + .ms [(.m0,.s6,1161),(.m15,.s5,1161)], + .ms2 .s5 .s2 [(.m4,1003,1032)], + .m .m18, + .b 1037 [[([33],[(.D6,1003),(.D16,1161),(.D16,1)])]], + .ms [(.m2,.s6,1054),(.m3,.s6,998),(.m6,.s6,1159),(.m25,.s2,1159),(.m33,.s2,998),(.m1,.s5,1048)], + .m .m5, + .b 1054 [[([61],[(.D16,998),(.D12,1159),(.D6,2)])]], + .ms2 .s6 .s7 [(.m2,1085,991)], + .ms [(.m0,.s6,1158),(.m41,.s6,999),(.m6,.s6,72),(.m37,.s0,72),(.m17,.s0,999),(.m64,.s3,1158)], + .ms2 .s3 .s0 [(.m4,991,1080)], + .ms [(.m26,.s7,1085),(.m8,.s2,1080)], + .m .m9, + .b 0 [[([130],[(.D7,1085),(.D7,990),(.D16,1158),(.D18,0)])]], + .ms2 .s6 .s7 [(.m2,65,1069)], + .ms [(.m0,.s6,986),(.m6,.s6,1156),(.m7,.s5,1156)], + .m .m11, + ] (by decide +kernel) +theorem chunk_1_step : (cfg_1.denote) [qi]⊢* (cfg_2.denote) := + step_chunk [ + .s .s5 986, + .ms2 .s5 .s2 [(.m4,1069,60)], + .m .m18, + .b 65 [[([4273,1736],[(.D6,1069),(.D16,986)]),([375],[(.D12,1156),(.D8,999),(.D12,72),(.D6,4)])]], + .ms [(.m2,.s6,3070)], + .ms2 .s6 .s7 [(.m3,317,799),(.m0,1110,989)], + .ms [(.m12,.s7,69),(.m31,.s3,69)], + .ms2 .s3 .s0 [(.m13,989,1110),(.m1,799,317)], + .ms [(.m1,.s3,3064),(.m10,.s7,3070),(.m8,.s2,3065)], + .m .m9, + .b 0 [[([10138],[(.D7,3070)]),([1264,634,323,157,83,37,23,12,1],[(.D17,317),(.D6,799)]),([158],[(.D16,1110),(.D6,989),(.D12,69),(.D12,2)])],[([22],[(.D17,1803),(.D13,0),(.D6,719)])],[([36],[(.D15,1799)]),([7,2],[(.D12,1),(.D17,717)]),([1],[(.D6,1091)])],[([8],[(.D15,1795),(.D21,0),(.D17,717),(.D7,1090)])]], + .ms [(.m2,.s6,5102),(.m6,.s6,1793),(.m7,.s5,1793),(.m11,.s5,5096)], + .m .m5, + .b 5102 [[([1661],[(.D12,1793),(.D8,717),(.D8,1089),(.D10,982),(.D9,68),(.D14,2)])]], + .ms2 .s6 .s7 [(.m2,5933,1587)], + .ms [(.m0,.s6,666),(.m3,.s6,1077),(.m6,.s6,979),(.m3,.s6,68),(.m30,.s3,68),(.m4,.s3,979),(.m13,.s3,1077),(.m4,.s3,666)], + .ms2 .s3 .s0 [(.m4,1587,5928)], + .ms [(.m26,.s7,5933),(.m8,.s2,5928)], + .m .m9, + .b 0 [[([7676],[(.D7,5933),(.D7,1586),(.D16,666),(.D16,1077),(.D12,979),(.D16,68),(.D16,3)])]], + .ms [(.m2,.s6,3838)], + .ms2 .s6 .s7 [(.m3,4973,1347)], + .ms [(.m0,.s6,606)], + .ms2 .s6 .s7 [(.m3,1062,977)], + .ms [(.m12,.s7,66),(.m32,.s0,66),(.m17,.s0,977),(.m4,.s3,1062),(.m4,.s3,606)], + .ms2 .s3 .s0 [(.m4,1347,4973)], + .ms [(.m1,.s3,3832),(.m10,.s7,3838),(.m8,.s2,3833)], + .m .m9, + .b 0 [[([15350,7677,3840,1920,960,480,240,120,60,27,12,9,3],[(.D7,3838),(.D17,4973)]),([1918],[(.D6,1347),(.D16,606),(.D16,1062),(.D6,977),(.D12,66),(.D6,4)])]], + .ms [(.m2,.s6,15349),(.m14,.s5,15343)], + .m .m5, + .b 15349 [[([5],[(.D18,1),(.D15,4012),(.D16,1107)])]], + .ms [(.m2,.s6,15352),(.m7,.s5,15346)], + .m .m5, + .b 15352 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,15353),(.m15,.s5,15347)], + .m .m5, + .b 15353 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,15354),(.m25,.s2,15349)], + .m .m18, + .b 15354 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,15356),(.m14,.s5,15350)], + .m .m5, + .b 15356 [[([5],[(.D18,1),(.D17,4011),(.D17,1107),(.D15,546),(.D15,1047),(.D11,971),(.D6,67)])]], + .ms [(.m2,.s6,15359),(.m7,.s5,15353)], + .m .m5, + .b 15359 [[([16045,848],[(.D8,4011),(.D6,1107)]),([1055],[(.D16,546),(.D16,1047),(.D12,972),(.D7,66),(.D8,2)])]], + .ms2 .s6 .s7 [(.m2,23806,1901)], + .ms [(.m3,.s6,579),(.m3,.s6,414)], + .ms2 .s6 .s7 [(.m3,1014,965)], + .ms [(.m12,.s7,63),(.m31,.s3,63)], + .ms2 .s3 .s0 [(.m13,965,1014)], + .ms [(.m1,.s3,414)], + .ms2 .s3 .s0 [(.m4,579,1901)], + .ms [(.m4,.s3,23800),(.m10,.s7,23806),(.m8,.s2,23801)], + .m .m9, + .b 0 [[([60778],[(.D7,23806)]),([7598,3802,1898,948,478,240,120,60,26,12,10,2],[(.D7,1900),(.D6,579),(.D16,414)]),([237],[(.D16,1014),(.D6,965),(.D12,63),(.D12,2)])]], + .ms2 .s6 .s7 [(.m2,30389,16209)], + .ms2 .s5 .s2 [(.m40,16209,30384)], + .m .m18, + .b 30389 [[([9],[(.D6,16209),(.D16,1)])]], + .ms [(.m2,.s6,30394),(.m3,.s6,16207),(.m25,.s2,16207),(.m1,.s5,30388)], + .m .m5, + .b 30394 [[([13],[(.D16,16207),(.D6,2)])]], + .ms2 .s6 .s7 [(.m2,30401,16206)], + .ms2 .s5 .s2 [(.m36,16206,30396)], + .m .m18, + .b 30401 [[([17],[(.D6,16206),(.D18,1)])]], + .ms [(.m2,.s6,30410),(.m6,.s6,16202),(.m14,.s5,16202),(.m11,.s5,30404)], + .m .m5, + .b 30410 [[([23],[(.D12,16202),(.D18,1),(.D17,102),(.D17,296),(.D13,984)])]], + .ms [(.m2,.s6,30422),(.m6,.s6,16199),(.m7,.s5,16199),(.m11,.s5,30416)], + .m .m5, + .b 30422 [[([1695],[(.D12,16199)]),([409,14],[(.D8,102),(.D6,296)]),([25],[(.D14,984),(.D17,957),(.D14,62),(.D15,2)])]], + .ms [(.m2,.s6,31270),(.m3,.s6,15988),(.m6,.s6,49),(.m3,.s6,282),(.m3,.s6,981),(.m6,.s6,955),(.m3,.s6,62),(.m30,.s3,62),(.m4,.s3,955),(.m13,.s3,981),(.m4,.s3,282),(.m4,.s3,49),(.m13,.s3,15988),(.m4,.s3,31264),(.m10,.s7,31270),(.m8,.s2,31265)], + .m .m9, + .b 0 [[([6292],[(.D7,31270),(.D17,15988)]),([199,98,48,24,12,10,2],[(.D12,49),(.D16,282)]),([25],[(.D16,981),(.D12,955),(.D16,62),(.D16,3)])]], + .ms [(.m2,.s6,3146)], + .ms2 .s6 .s7 [(.m6,30482,15792)], + .ms2 .s5 .s2 [(.m40,15792,30482)], + .ms [(.m33,.s2,3141)], + .m .m18, + .b 3146 [[([39],[(.D12,30482),(.D6,15792),(.D16,1)])]], + .ms [(.m2,.s6,3166),(.m3,.s6,30478),(.m3,.s6,15790),(.m25,.s2,15790),(.m1,.s5,30478),(.m4,.s5,3160)], + .m .m5, + .b 3166 [[([55],[(.D16,30478),(.D16,15790),(.D6,2)])]], + .ms [(.m2,.s6,3194)], + .ms2 .s6 .s7 [(.m6,30470,15789)], + .ms2 .s5 .s2 [(.m36,15789,30470)], + .ms [(.m33,.s2,3189)], + .m .m18, + .b 3194 [[([95],[(.D12,30470),(.D6,15789),(.D18,1),(.D17,269),(.D17,978),(.D6,956)])]], + .ms [(.m2,.s6,3242)], + .ms2 .s6 .s7 [(.m6,30458,15786)], + .ms2 .s5 .s2 [(.m28,15786,30458)], + .ms [(.m33,.s2,3237)], + .m .m18, + .b 3242 [[([6023],[(.D12,30458),(.D6,15786),(.D8,269),(.D6,979),(.D7,955),(.D6,63),(.D17,3)])]], + .ms [(.m2,.s6,6254),(.m6,.s6,29705),(.m6,.s6,15596),(.m6,.s6,222)], + .ms2 .s6 .s7 [(.m3,966,953)], + .ms [(.m12,.s7,60),(.m32,.s0,60),(.m17,.s0,953),(.m4,.s3,966),(.m4,.s3,222),(.m13,.s3,15596),(.m13,.s3,29705),(.m13,.s3,6248),(.m10,.s7,6254),(.m8,.s2,6249)], + .m .m9, + .b 0 [[([25019,12505,6252,3131,1561,780,395,193,96,48,24,12,11,1],[(.D7,6254),(.D13,29705)]),([3127],[(.D12,15596),(.D12,222),(.D16,966),(.D6,953),(.D12,60),(.D6,4)])],[([5],[(.D13,0),(.D6,28143)])],[([7,2],[(.D12,1),(.D17,28141)]),([1],[(.D7,15206)])],[([2],[(.D21,0),(.D17,28140),(.D8,15205)])]], + .ms [(.m2,.s6,25022),(.m7,.s5,25016)], + .m .m5, + .b 25022 [[([12057],[(.D8,28141),(.D9,15205)]),([499,250,4],[(.D14,125),(.D7,942)]),([46],[(.D7,946),(.D12,59),(.D9,2)])]], + .ms2 .s6 .s7 [(.m2,31051,26635)], + .ms [(.m12,.s7,14828),(.m12,.s7,30)], + .ms2 .s6 .s7 [(.m0,918,941)], + .ms [(.m12,.s7,57),(.m31,.s3,57)], + .ms2 .s3 .s0 [(.m13,941,918)], + .ms [(.m1,.s3,30),(.m13,.s3,14828)], + .ms2 .s3 .s0 [(.m13,26635,31046)], + .ms [(.m26,.s7,31051),(.m8,.s2,31046)], + .m .m9, + .b 0 [[([15812],[(.D7,31051),(.D7,26634),(.D12,14828)]),([126,61,35,13,11],[(.D12,30),(.D16,918)]),([16],[(.D6,941),(.D12,57)])],[([12600],[(.D15,29074),(.D11,26139),(.D15,14705),(.D12,911),(.D10,937),(.D15,57),(.D12,2)])]], + .ms [(.m2,.s6,14206)], + .ms2 .s6 .s7 [(.m3,27499,25747)], + .ms [(.m12,.s7,14606),(.m3,.s6,888),(.m6,.s6,931),(.m3,.s6,56),(.m30,.s3,56),(.m4,.s3,931)], + .ms2 .s3 .s0 [(.m13,888,14606)], + .ms [(.m17,.s0,25747),(.m4,.s3,27499),(.m4,.s3,14200),(.m10,.s7,14206),(.m8,.s2,14201)], + .m .m9, + .b 0 [[([30716],[(.D7,14206),(.D17,27499),(.D6,25747),(.D12,14606),(.D6,888),(.D12,931),(.D16,56),(.D16,3)])]], + .ms [(.m2,.s6,15358),(.m3,.s6,10366)], + .ms2 .s6 .s7 [(.m3,26539,25507)], + .ms [(.m12,.s7,14546)], + .ms2 .s6 .s7 [(.m3,873,929)], + .ms [(.m12,.s7,54),(.m32,.s0,54),(.m17,.s0,929)], + .ms2 .s3 .s0 [(.m4,873,14546)], + .ms [(.m17,.s0,25507),(.m4,.s3,26539),(.m4,.s3,10366),(.m4,.s3,15352),(.m10,.s7,15358),(.m8,.s2,15353)], + .m .m9, + .b 0 [[([61430,30717,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D7,15358),(.D17,10366)]),([7678],[(.D16,26539),(.D6,25507),(.D12,14546),(.D6,873),(.D6,929),(.D12,54),(.D6,4)])]], + .ms [(.m2,.s6,61429),(.m14,.s5,61423)], + .m .m5, + .b 61429 [[([5],[(.D18,1),(.D15,6525),(.D14,25579)])]], + .ms [(.m2,.s6,61432),(.m7,.s5,61426)], + .m .m5, + .b 61432 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,61433),(.m15,.s5,61427)], + .m .m5, + .b 61433 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,61434),(.m25,.s2,61429)], + .m .m18, + .b 61434 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,61436),(.m14,.s5,61430)], + .m .m5, + .b 61436 [[([5],[(.D18,1),(.D17,6524),(.D15,25579),(.D17,25267),(.D11,14486),(.D17,858),(.D11,923),(.D6,55)])]], + .ms [(.m2,.s6,61439),(.m7,.s5,61433)], + .m .m5, + .b 61439 [[([26099,13055,6528,3264,1632,816,408,204,97,48,24,12,11],[(.D8,6524),(.D16,25579)]),([3262],[(.D6,25267),(.D12,14486),(.D6,858),(.D12,924),(.D7,54),(.D8,2)])],[([143681],[(.D2,23946)])]], + .ms [(.m2,.s6,159379),(.m27,.s2,159374)], + .m .m18, + .b 159379 [[([1],[(.D6,1)])],[([4],[(.D13,0),(.D6,1)])],[([2],[(.D17,1),(.D15,0),(.D6,24859)])],[([4],[(.D3,0)])],[([2],[(.D17,1),(.D21,24858),(.D11,14384),(.D17,832),(.D14,918)])],[([5],[(.D13,0),(.D16,24858),(.D12,14384)])],[([953],[(.D12,24859),(.D13,14384),(.D6,833),(.D15,918),(.D7,53),(.D11,1)])]], + .ms2 .s6 .s7 [(.m2,159865,24741)], + .ms [(.m12,.s7,14354)], + .ms2 .s6 .s7 [(.m3,825,917)], + .ms [(.m12,.s7,51),(.m31,.s3,51)], + .ms2 .s3 .s0 [(.m13,917,825)], + .ms [(.m4,.s3,14354)], + .ms2 .s3 .s0 [(.m13,24741,159860)], + .ms [(.m26,.s7,159865),(.m8,.s2,159860)], + .m .m9, + .b 0 [[([16892],[(.D7,159865),(.D7,24740),(.D12,14354),(.D6,825),(.D6,917),(.D12,51),(.D12,2)])]], + .ms [(.m2,.s6,8446)], + .ms2 .s6 .s7 [(.m3,157753,24213)], + .ms [(.m12,.s7,14222),(.m3,.s6,792),(.m6,.s6,907),(.m3,.s6,50),(.m30,.s3,50),(.m4,.s3,907)], + .ms2 .s3 .s0 [(.m13,792,14222)], + .ms [(.m17,.s0,24213),(.m4,.s3,157753),(.m4,.s3,8440),(.m10,.s7,8446),(.m8,.s2,8441)], + .m .m9, + .b 0 [[([30716],[(.D7,8446),(.D17,157753),(.D6,24213),(.D12,14222),(.D6,792),(.D12,907),(.D16,50),(.D16,3)])]], + .ms [(.m2,.s6,15358),(.m3,.s6,4606)], + .ms2 .s6 .s7 [(.m3,156793,23973)], + .ms [(.m12,.s7,14162)], + .ms2 .s6 .s7 [(.m3,777,905)], + .ms [(.m12,.s7,48),(.m32,.s0,48),(.m17,.s0,905)], + .ms2 .s3 .s0 [(.m4,777,14162)], + .ms [(.m17,.s0,23973),(.m4,.s3,156793),(.m4,.s3,4606),(.m4,.s3,15352),(.m10,.s7,15358),(.m8,.s2,15353)], + .m .m9, + .b 0 [[([61430,30717,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D7,15358),(.D17,4606),(.D16,156793)]),([1919],[(.D6,23973),(.D12,14162),(.D6,777),(.D6,905),(.D12,48),(.D6,4)])]], + .ms [(.m2,.s6,61429),(.m14,.s5,61423)], + .m .m5, + .b 61429 [[([5],[(.D18,1),(.D15,765),(.D14,155833)])]], + .ms [(.m2,.s6,61432),(.m7,.s5,61426)], + .m .m5, + .b 61432 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,61433),(.m15,.s5,61427)], + .m .m5, + .b 61433 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,61434),(.m25,.s2,61429)], + .m .m18, + .b 61434 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,61436),(.m14,.s5,61430)], + .m .m5, + .b 61436 [[([5],[(.D18,1),(.D17,764),(.D15,155833),(.D17,23733),(.D11,14102),(.D17,762),(.D11,899),(.D6,49)])]], + .ms [(.m2,.s6,61439),(.m7,.s5,61433)], + .m .m5, + .b 61439 [[([3059,1535,768,384,192,96,48,24,12],[(.D8,764),(.D16,155833)]),([382],[(.D6,23733),(.D12,14102),(.D6,762),(.D12,900),(.D7,48)])],[([933845],[(.D2,155640)])]], + .ms [(.m2,.s6,531421),(.m27,.s2,531416)], + .m .m18, + .b 531421 [[([1],[(.D6,1)])],[([4],[(.D13,0),(.D6,1)])],[([2],[(.D17,1),(.D15,0),(.D6,23685)])],[([4],[(.D3,0)])],[([2],[(.D17,1),(.D21,23684),(.D11,14090),(.D17,759),(.D17,900),(.D8,47)])],[([5],[(.D13,0),(.D16,23684),(.D12,14090)])],[([3833],[(.D12,23685),(.D13,14090),(.D6,759),(.D6,901),(.D9,47),(.D8,2)])]], + .ms2 .s6 .s7 [(.m2,533347,23207)], + .ms [(.m12,.s7,13970)], + .ms2 .s6 .s7 [(.m3,729,893)], + .ms [(.m12,.s7,45),(.m31,.s3,45)], + .ms2 .s3 .s0 [(.m13,893,729)], + .ms [(.m4,.s3,13970)], + .ms2 .s3 .s0 [(.m13,23207,533342)], + .ms [(.m26,.s7,533347),(.m8,.s2,533342)], + .m .m9, + .b 0 [[([16892],[(.D7,533347),(.D7,23206),(.D12,13970),(.D6,729),(.D6,893),(.D12,45),(.D12,2)])]], + .ms [(.m2,.s6,8446)], + .ms2 .s6 .s7 [(.m3,531235,22679)], + .ms [(.m12,.s7,13838),(.m3,.s6,696),(.m6,.s6,883),(.m3,.s6,44),(.m30,.s3,44),(.m4,.s3,883)], + .ms2 .s3 .s0 [(.m13,696,13838)], + .ms [(.m17,.s0,22679),(.m4,.s3,531235),(.m4,.s3,8440),(.m10,.s7,8446),(.m8,.s2,8441)], + .m .m9, + .b 0 [[([30716],[(.D7,8446),(.D17,531235),(.D6,22679),(.D12,13838),(.D6,696),(.D12,883),(.D16,44),(.D16,3)])]], + .ms [(.m2,.s6,15358),(.m3,.s6,4606)], + .ms2 .s6 .s7 [(.m3,530275,22439)], + .ms [(.m12,.s7,13778)], + .ms2 .s6 .s7 [(.m3,681,881)], + .ms [(.m12,.s7,42),(.m32,.s0,42),(.m17,.s0,881)], + .ms2 .s3 .s0 [(.m4,681,13778)], + .ms [(.m17,.s0,22439),(.m4,.s3,530275),(.m4,.s3,4606),(.m4,.s3,15352)], + .m .m45, + ] (by decide +kernel) +theorem chunk_2_step : (cfg_2.denote) [qi]⊢* (cfg_3.denote) := + step_chunk [ + .ms [(.m46,.s7,15358),(.m8,.s2,15353)], + .m .m9, + .b 0 [[([61430,30717,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D7,15358),(.D17,4606),(.D16,530275)]),([1919],[(.D6,22439),(.D12,13778),(.D6,681),(.D6,881),(.D12,42),(.D6,4)])]], + .ms [(.m2,.s6,61429),(.m14,.s5,61423)], + .m .m5, + .b 61429 [[([5],[(.D18,1),(.D15,765),(.D14,529315)])]], + .ms [(.m2,.s6,61432),(.m7,.s5,61426)], + .m .m5, + .b 61432 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,61433),(.m15,.s5,61427)], + .m .m5, + .b 61433 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,61434),(.m25,.s2,61429)], + .m .m18, + .b 61434 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,61436),(.m14,.s5,61430)], + .m .m5, + .b 61436 [[([5],[(.D18,1),(.D17,764),(.D15,529315),(.D17,22199),(.D11,13718),(.D17,666),(.D11,875),(.D6,43)])]], + .ms [(.m2,.s6,61439),(.m7,.s5,61433)], + .m .m5, + .b 61439 [[([3059,1535,768,384,192,96,48,24,12],[(.D8,764),(.D16,529315)]),([382],[(.D6,22199),(.D12,13718),(.D6,666),(.D12,876),(.D7,42)])],[([3174737],[(.D2,529122)])]], + .ms [(.m2,.s6,1651867),(.m27,.s2,1651862)], + .m .m18, + .b 1651867 [[([1],[(.D6,1)])],[([4],[(.D13,0),(.D6,1)])],[([2],[(.D17,1),(.D15,0),(.D6,22151)])],[([4],[(.D3,0)])],[([2],[(.D17,1),(.D21,22150),(.D11,13706),(.D17,663),(.D17,876),(.D8,41)])],[([5],[(.D13,0),(.D16,22150),(.D12,13706)])],[([3833],[(.D12,22151),(.D13,13706),(.D6,663),(.D6,877),(.D9,41),(.D8,2)])]], + .ms2 .s6 .s7 [(.m2,1653793,21673)], + .ms [(.m12,.s7,13586)], + .ms2 .s6 .s7 [(.m3,633,869)], + .ms [(.m12,.s7,39),(.m31,.s3,39)], + .ms2 .s3 .s0 [(.m13,869,633)], + .ms [(.m4,.s3,13586)], + .ms2 .s3 .s0 [(.m13,21673,1653788)], + .ms [(.m26,.s7,1653793),(.m8,.s2,1653788)], + .m .m9, + .b 0 [[([16892],[(.D7,1653793),(.D7,21672),(.D12,13586),(.D6,633),(.D6,869),(.D12,39),(.D12,2)])]], + .ms [(.m2,.s6,8446)], + .ms2 .s6 .s7 [(.m3,1651681,21145)], + .ms [(.m12,.s7,13454),(.m3,.s6,600),(.m6,.s6,859),(.m3,.s6,38),(.m30,.s3,38),(.m4,.s3,859)], + .ms2 .s3 .s0 [(.m13,600,13454)], + .ms [(.m17,.s0,21145),(.m4,.s3,1651681),(.m4,.s3,8440),(.m10,.s7,8446),(.m8,.s2,8441)], + .m .m9, + .b 0 [[([30716],[(.D7,8446),(.D17,1651681),(.D6,21145),(.D12,13454),(.D6,600),(.D12,859),(.D16,38),(.D16,3)])]], + .ms [(.m2,.s6,15358),(.m3,.s6,4606)], + .ms2 .s6 .s7 [(.m3,1650721,20905)], + .ms [(.m12,.s7,13394)], + .ms2 .s6 .s7 [(.m3,585,857)], + .ms [(.m12,.s7,36),(.m32,.s0,36),(.m17,.s0,857)], + .ms2 .s3 .s0 [(.m4,585,13394)], + .ms [(.m17,.s0,20905),(.m4,.s3,1650721),(.m4,.s3,4606),(.m4,.s3,15352),(.m10,.s7,15358),(.m8,.s2,15353)], + .m .m9, + .b 0 [[([61430,30717,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D7,15358),(.D17,4606),(.D16,1650721)]),([1919],[(.D6,20905),(.D12,13394),(.D6,585),(.D6,857),(.D12,36),(.D6,4)])]], + .ms [(.m2,.s6,61429),(.m14,.s5,61423)], + .m .m5, + .b 61429 [[([5],[(.D18,1),(.D15,765),(.D14,1649761)])]], + .ms [(.m2,.s6,61432),(.m7,.s5,61426)], + .m .m5, + .b 61432 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,61433),(.m15,.s5,61427)], + .m .m5, + .b 61433 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,61434),(.m25,.s2,61429)], + .m .m18, + .b 61434 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,61436),(.m14,.s5,61430)], + .m .m5, + .b 61436 [[([5],[(.D18,1),(.D17,764),(.D15,1649761),(.D17,20665),(.D11,13334),(.D17,570),(.D11,851),(.D6,37)])]], + .ms [(.m2,.s6,61439),(.m7,.s5,61433)], + .m .m5, + .b 61439 [[([3059,1535,768,384,192,96,48,24,12],[(.D8,764),(.D16,1649761)]),([382],[(.D6,20665),(.D12,13334),(.D6,570),(.D12,852),(.D7,36)])],[([9897413],[(.D2,1649568)])]], + .ms [(.m2,.s6,5013205),(.m27,.s2,5013200)], + .m .m18, + .b 5013205 [[([1],[(.D6,1)])],[([4],[(.D13,0),(.D6,1)])],[([2],[(.D17,1),(.D15,0),(.D6,20617)])],[([4],[(.D3,0)])],[([2],[(.D17,1),(.D21,20616),(.D11,13322),(.D17,567),(.D17,852),(.D8,35)])],[([5],[(.D13,0),(.D16,20616),(.D12,13322)])],[([3833],[(.D12,20617),(.D13,13322),(.D6,567),(.D6,853),(.D9,35),(.D8,2)])]], + .ms2 .s6 .s7 [(.m2,5015131,20139)], + .ms [(.m12,.s7,13202)], + .ms2 .s6 .s7 [(.m3,537,845)], + .ms [(.m12,.s7,33),(.m31,.s3,33)], + .ms2 .s3 .s0 [(.m13,845,537)], + .ms [(.m4,.s3,13202)], + .ms2 .s3 .s0 [(.m13,20139,5015126)], + .ms [(.m26,.s7,5015131),(.m8,.s2,5015126)], + .m .m9, + .b 0 [[([16892],[(.D7,5015131),(.D7,20138),(.D12,13202),(.D6,537),(.D6,845),(.D12,33),(.D12,2)])]], + .ms [(.m2,.s6,8446)], + .ms2 .s6 .s7 [(.m3,5013019,19611)], + .ms [(.m12,.s7,13070),(.m3,.s6,504),(.m6,.s6,835),(.m3,.s6,32),(.m30,.s3,32),(.m4,.s3,835)], + .ms2 .s3 .s0 [(.m13,504,13070)], + .ms [(.m17,.s0,19611),(.m4,.s3,5013019),(.m4,.s3,8440),(.m10,.s7,8446),(.m8,.s2,8441)], + .m .m9, + .b 0 [[([30716],[(.D7,8446),(.D17,5013019),(.D6,19611),(.D12,13070),(.D6,504),(.D12,835),(.D16,32),(.D16,3)])]], + .ms [(.m2,.s6,15358),(.m3,.s6,4606)], + .ms2 .s6 .s7 [(.m3,5012059,19371)], + .ms [(.m12,.s7,13010)], + .ms2 .s6 .s7 [(.m3,489,833)], + .ms [(.m12,.s7,30),(.m32,.s0,30),(.m17,.s0,833)], + .ms2 .s3 .s0 [(.m4,489,13010)], + .ms [(.m17,.s0,19371),(.m4,.s3,5012059),(.m4,.s3,4606),(.m4,.s3,15352),(.m10,.s7,15358),(.m8,.s2,15353)], + .m .m9, + .b 0 [[([61430,30717,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D7,15358),(.D17,4606),(.D16,5012059)]),([1919],[(.D6,19371),(.D12,13010),(.D6,489),(.D6,833),(.D12,30),(.D6,4)])]], + .ms [(.m2,.s6,61429),(.m14,.s5,61423)], + .m .m5, + .b 61429 [[([5],[(.D18,1),(.D15,765),(.D14,5011099)])]], + .ms [(.m2,.s6,61432),(.m7,.s5,61426)], + .m .m5, + .b 61432 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,61433),(.m15,.s5,61427)], + .m .m5, + .b 61433 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,61434),(.m25,.s2,61429)], + .m .m18, + .b 61434 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,61436),(.m14,.s5,61430)], + .m .m5, + .b 61436 [[([5],[(.D18,1),(.D17,764),(.D15,5011099),(.D17,19131),(.D11,12950),(.D17,474),(.D11,827),(.D6,31)])]], + .ms [(.m2,.s6,61439),(.m7,.s5,61433)], + .m .m5, + .b 61439 [[([3059,1535,768,384,192,96,48,24,12],[(.D8,764),(.D16,5011099)]),([382],[(.D6,19131),(.D12,12950),(.D6,474),(.D12,828),(.D7,30)])],[([30065441],[(.D2,5010906)])]], + .ms [(.m2,.s6,15097219),(.m27,.s2,15097214)], + .m .m18, + .b 15097219 [[([1],[(.D6,1)])],[([4],[(.D13,0),(.D6,1)])],[([2],[(.D17,1),(.D15,0),(.D6,19083)])],[([4],[(.D3,0)])],[([2],[(.D17,1),(.D21,19082),(.D11,12938),(.D17,471),(.D17,828),(.D8,29)])],[([5],[(.D13,0),(.D16,19082),(.D12,12938)])],[([3833],[(.D12,19083),(.D13,12938),(.D6,471),(.D6,829),(.D9,29),(.D8,2)])]], + .ms2 .s6 .s7 [(.m2,15099145,18605)], + .ms [(.m12,.s7,12818)], + .ms2 .s6 .s7 [(.m3,441,821)], + .ms [(.m12,.s7,27),(.m31,.s3,27)], + .ms2 .s3 .s0 [(.m13,821,441)], + .ms [(.m4,.s3,12818)], + .ms2 .s3 .s0 [(.m13,18605,15099140)], + .ms [(.m26,.s7,15099145),(.m8,.s2,15099140)], + .m .m9, + .b 0 [[([16892],[(.D7,15099145),(.D7,18604),(.D12,12818),(.D6,441),(.D6,821),(.D12,27),(.D12,2)])]], + .ms [(.m2,.s6,8446)], + .ms2 .s6 .s7 [(.m3,15097033,18077)], + .ms [(.m12,.s7,12686),(.m3,.s6,408),(.m6,.s6,811),(.m3,.s6,26),(.m30,.s3,26),(.m4,.s3,811)], + .ms2 .s3 .s0 [(.m13,408,12686)], + .ms [(.m17,.s0,18077),(.m4,.s3,15097033),(.m4,.s3,8440),(.m10,.s7,8446),(.m8,.s2,8441)], + .m .m9, + .b 0 [[([30716],[(.D7,8446),(.D17,15097033),(.D6,18077),(.D12,12686),(.D6,408),(.D12,811),(.D16,26),(.D16,3)])]], + .ms [(.m2,.s6,15358),(.m3,.s6,4606)], + .ms2 .s6 .s7 [(.m3,15096073,17837)], + .ms [(.m12,.s7,12626)], + .ms2 .s6 .s7 [(.m3,393,809)], + .ms [(.m12,.s7,24),(.m32,.s0,24),(.m17,.s0,809)], + .ms2 .s3 .s0 [(.m4,393,12626)], + .ms [(.m17,.s0,17837),(.m4,.s3,15096073),(.m4,.s3,4606),(.m4,.s3,15352),(.m10,.s7,15358),(.m8,.s2,15353)], + .m .m9, + .b 0 [[([61430,30717,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D7,15358),(.D17,4606),(.D16,15096073)]),([1919],[(.D6,17837),(.D12,12626),(.D6,393),(.D6,809),(.D12,24),(.D6,4)])]], + .ms [(.m2,.s6,61429),(.m14,.s5,61423)], + .m .m5, + .b 61429 [[([5],[(.D18,1),(.D15,765),(.D14,15095113)])]], + .ms [(.m2,.s6,61432),(.m7,.s5,61426)], + .m .m5, + .b 61432 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,61433),(.m15,.s5,61427)], + .m .m5, + .b 61433 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,61434),(.m25,.s2,61429)], + .m .m18, + .b 61434 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,61436),(.m14,.s5,61430)], + .m .m5, + .b 61436 [[([5],[(.D18,1),(.D17,764),(.D15,15095113),(.D17,17597),(.D11,12566),(.D17,378),(.D11,803),(.D6,25)])]], + .ms [(.m2,.s6,61439),(.m7,.s5,61433)], + .m .m5, + .b 61439 [[([3059,1535,768,384,192,96,48,24,12],[(.D8,764),(.D16,15095113)]),([382],[(.D6,17597),(.D12,12566),(.D6,378),(.D12,804),(.D7,24)])],[([90569525],[(.D2,15094920)])]], + .ms [(.m2,.s6,45349261),(.m27,.s2,45349256)], + .m .m18, + .b 45349261 [[([1],[(.D6,1)])],[([4],[(.D13,0),(.D6,1)])],[([2],[(.D17,1),(.D15,0),(.D6,17549)])],[([4],[(.D3,0)])],[([2],[(.D17,1),(.D21,17548),(.D11,12554),(.D17,375),(.D17,804),(.D8,23)])],[([5],[(.D13,0),(.D16,17548),(.D12,12554)])],[([3833],[(.D12,17549),(.D13,12554),(.D6,375),(.D6,805),(.D9,23),(.D8,2)])]], + .ms2 .s6 .s7 [(.m2,45351187,17071)], + .ms [(.m12,.s7,12434)], + .ms2 .s6 .s7 [(.m3,345,797)], + .ms [(.m12,.s7,21),(.m31,.s3,21)], + .ms2 .s3 .s0 [(.m13,797,345)], + .ms [(.m4,.s3,12434)], + .ms2 .s3 .s0 [(.m13,17071,45351182)], + .ms [(.m26,.s7,45351187),(.m8,.s2,45351182)], + .m .m9, + .b 0 [[([16892],[(.D7,45351187),(.D7,17070),(.D12,12434),(.D6,345),(.D6,797),(.D12,21),(.D12,2)])]], + .ms [(.m2,.s6,8446)], + .ms2 .s6 .s7 [(.m3,45349075,16543)], + .ms [(.m12,.s7,12302),(.m3,.s6,312),(.m6,.s6,787),(.m3,.s6,20),(.m30,.s3,20),(.m4,.s3,787)], + .ms2 .s3 .s0 [(.m13,312,12302)], + .ms [(.m17,.s0,16543),(.m4,.s3,45349075),(.m4,.s3,8440),(.m10,.s7,8446),(.m8,.s2,8441)], + .m .m9, + .b 0 [[([30716],[(.D7,8446),(.D17,45349075),(.D6,16543),(.D12,12302),(.D6,312),(.D12,787),(.D16,20),(.D16,3)])]], + .ms [(.m2,.s6,15358),(.m3,.s6,4606)], + .ms2 .s6 .s7 [(.m3,45348115,16303)], + .ms [(.m12,.s7,12242)], + .ms2 .s6 .s7 [(.m3,297,785)], + .ms [(.m12,.s7,18),(.m32,.s0,18),(.m17,.s0,785)], + .ms2 .s3 .s0 [(.m4,297,12242)], + .ms [(.m17,.s0,16303),(.m4,.s3,45348115),(.m4,.s3,4606),(.m4,.s3,15352),(.m10,.s7,15358),(.m8,.s2,15353)], + .m .m9, + .b 0 [[([61430,30717,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D7,15358),(.D17,4606),(.D16,45348115)]),([1919],[(.D6,16303),(.D12,12242),(.D6,297),(.D6,785),(.D12,18),(.D6,4)])]], + .ms [(.m2,.s6,61429),(.m14,.s5,61423)], + .m .m5, + .b 61429 [[([5],[(.D18,1),(.D15,765),(.D14,45347155)])]], + .ms [(.m2,.s6,61432),(.m7,.s5,61426)], + .m .m5, + .b 61432 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,61433),(.m15,.s5,61427)], + .m .m5, + .b 61433 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,61434),(.m25,.s2,61429)], + .m .m18, + .b 61434 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,61436),(.m14,.s5,61430)], + .m .m5, + .b 61436 [[([5],[(.D18,1),(.D17,764),(.D15,45347155),(.D17,16063),(.D11,12182),(.D17,282),(.D11,779),(.D6,19)])]], + .ms [(.m2,.s6,61439),(.m7,.s5,61433)], + .m .m5, + .b 61439 [[([3059,1535,768,384,192,96,48,24,12],[(.D8,764),(.D16,45347155)]),([382],[(.D6,16063),(.D12,12182),(.D6,282),(.D12,780),(.D7,18)])],[([272081777],[(.D2,45346962)])]], + .ms [(.m2,.s6,136105387),(.m27,.s2,136105382)], + .m .m18, + .b 136105387 [[([1],[(.D6,1)])],[([4],[(.D13,0),(.D6,1)])],[([2],[(.D17,1),(.D15,0),(.D6,16015)])],[([4],[(.D3,0)])],[([2],[(.D17,1),(.D21,16014),(.D11,12170),(.D17,279),(.D17,780),(.D8,17)])],[([5],[(.D13,0),(.D16,16014),(.D12,12170)])],[([3833],[(.D12,16015),(.D13,12170),(.D6,279),(.D6,781),(.D9,17),(.D8,2)])]], + .ms2 .s6 .s7 [(.m2,136107313,15537)], + .ms [(.m12,.s7,12050)], + .ms2 .s6 .s7 [(.m3,249,773)], + .ms [(.m12,.s7,15),(.m31,.s3,15)], + .ms2 .s3 .s0 [(.m13,773,249)], + .ms [(.m4,.s3,12050)], + .ms2 .s3 .s0 [(.m13,15537,136107308)], + .ms [(.m26,.s7,136107313),(.m8,.s2,136107308)], + .m .m9, + .b 0 [[([16892],[(.D7,136107313),(.D7,15536),(.D12,12050),(.D6,249),(.D6,773),(.D12,15),(.D12,2)])]], + .ms [(.m2,.s6,8446)], + .ms2 .s6 .s7 [(.m3,136105201,15009)], + .ms [(.m12,.s7,11918),(.m3,.s6,216),(.m6,.s6,763),(.m3,.s6,14),(.m30,.s3,14),(.m4,.s3,763)], + .ms2 .s3 .s0 [(.m13,216,11918)], + .ms [(.m17,.s0,15009),(.m4,.s3,136105201),(.m4,.s3,8440)], + .m .m45, + ] (by decide +kernel) +theorem chunk_3_step : (cfg_3.denote) [qi]⊢* (cfg_4.denote) := + step_chunk [ + .ms [(.m46,.s7,8446),(.m8,.s2,8441)], + .m .m9, + .b 0 [[([30716],[(.D7,8446),(.D17,136105201),(.D6,15009),(.D12,11918),(.D6,216),(.D12,763),(.D16,14),(.D16,3)])]], + .ms [(.m2,.s6,15358),(.m3,.s6,4606)], + .ms2 .s6 .s7 [(.m3,136104241,14769)], + .ms [(.m12,.s7,11858)], + .ms2 .s6 .s7 [(.m3,201,761)], + .s2 .s12 .s6 [(6,1)], + .s2 .s7 .s12 [(12,6)], + .s .s6 3, + .ms2 .s3 .s0 [(.m103,4,12)], + .s2 .s8 .s3 [(2,1)], + .s .s0 761, + .ms2 .s3 .s0 [(.m4,201,11858)], + .ms [(.m17,.s0,14769),(.m4,.s3,136104241),(.m4,.s3,4606),(.m4,.s3,15352),(.m10,.s7,15358),(.m8,.s2,15353)], + .m .m9, + .b 0 [[([61430,30717,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D7,15358),(.D17,4606),(.D16,136104241)]),([1919],[(.D6,14769),(.D12,11858),(.D6,201),(.D6,761),(.D12,12),(.D6,4)])]], + .ms [(.m2,.s6,61429),(.m14,.s5,61423)], + .m .m5, + .b 61429 [[([5],[(.D18,1),(.D15,765),(.D14,136103281)])]], + .ms [(.m2,.s6,61432),(.m7,.s5,61426)], + .m .m5, + .b 61432 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,61433),(.m15,.s5,61427)], + .m .m5, + .b 61433 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,61434),(.m25,.s2,61429)], + .m .m18, + .b 61434 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,61436),(.m14,.s5,61430)], + .m .m5, + .b 61436 [[([5],[(.D18,1),(.D17,764),(.D15,136103281),(.D17,14529),(.D11,11798),(.D17,186),(.D11,755),(.D6,13)])]], + .ms [(.m2,.s6,61439),(.m7,.s5,61433)], + .m .m5, + .b 61439 [[([3059,1535,768,384,192,96,48,24,12],[(.D8,764),(.D16,136103281)]),([382],[(.D6,14529),(.D12,11798),(.D6,186),(.D12,756),(.D7,12)])],[([816618533],[(.D2,136103088)])]], + .ms [(.m2,.s6,408373765),(.m27,.s2,408373760)], + .m .m18, + .b 408373765 [[([1],[(.D6,1)])],[([4],[(.D13,0),(.D6,1)])],[([2],[(.D17,1),(.D15,0),(.D6,14481)])],[([4],[(.D3,0)])],[([2],[(.D17,1),(.D21,14480),(.D11,11786),(.D17,183),(.D17,756),(.D8,11)])],[([5],[(.D13,0),(.D16,14480),(.D12,11786)])],[([3833],[(.D12,14481),(.D13,11786),(.D6,183),(.D6,757),(.D9,11),(.D8,2)])]], + .ms2 .s6 .s7 [(.m2,408375691,14003)], + .ms [(.m12,.s7,11666)], + .ms2 .s6 .s7 [(.m3,153,749)], + .s2 .s12 .s6 [(6,1)], + .s2 .s7 .s12 [(9,6)], + .s2 .s6 .s7 [(1,1)], + .s .s12 3, + .ms2 .s3 .s0 [(.m103,2,1)], + .s2 .s8 .s3 [(2,9)], + .s2 .s0 .s8 [(1,2)], + .s2 .s3 .s0 [(749,153)], + .ms [(.m4,.s3,11666)], + .ms2 .s3 .s0 [(.m13,14003,408375686)], + .ms [(.m26,.s7,408375691),(.m8,.s2,408375686)], + .m .m9, + .b 0 [[([16892],[(.D7,408375691),(.D7,14002),(.D12,11666),(.D6,153),(.D6,749),(.D12,9),(.D12,2)])]], + .ms [(.m2,.s6,8446)], + .ms2 .s6 .s7 [(.m3,408373579,13475)], + .ms [(.m12,.s7,11534),(.m3,.s6,120)], + .ms2 .s6 .s12 [(.m6,739,6)], + .s2 .s6 .s12 [(8,6)], + .s .s6 2, + .ms2 .s3 .s8 [(.m103,3,2)], + .s2 .s3 .s8 [(8,2)], + .s .s3 739, + .ms2 .s3 .s0 [(.m13,120,11534)], + .ms [(.m17,.s0,13475),(.m4,.s3,408373579),(.m4,.s3,8440),(.m10,.s7,8446),(.m8,.s2,8441)], + .m .m9, + .b 0 [[([30716],[(.D7,8446),(.D17,408373579),(.D6,13475),(.D12,11534),(.D6,120),(.D12,739),(.D16,8),(.D16,3)])]], + .ms [(.m2,.s6,15358),(.m3,.s6,4606)], + .ms2 .s6 .s7 [(.m3,408372619,13235)], + .ms [(.m12,.s7,11474)], + .ms2 .s6 .s7 [(.m3,105,737)], + .s2 .s12 .s6 [(6,1)], + .s2 .s7 .s12 [(6,6)], + .s .s6 3, + .ms2 .s3 .s0 [(.m103,4,6)], + .s2 .s8 .s3 [(2,1)], + .s .s0 737, + .ms2 .s3 .s0 [(.m4,105,11474)], + .ms [(.m17,.s0,13235),(.m4,.s3,408372619),(.m4,.s3,4606),(.m4,.s3,15352),(.m10,.s7,15358),(.m8,.s2,15353)], + .m .m9, + .b 0 [[([61430,30717,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D7,15358),(.D17,4606),(.D16,408372619)]),([1919],[(.D6,13235),(.D12,11474),(.D6,105),(.D6,737),(.D12,6),(.D6,4)])]], + .ms [(.m2,.s6,61429),(.m14,.s5,61423)], + .m .m5, + .b 61429 [[([5],[(.D18,1),(.D15,765),(.D14,408371659)])]], + .ms [(.m2,.s6,61432),(.m7,.s5,61426)], + .m .m5, + .b 61432 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,61433),(.m15,.s5,61427)], + .m .m5, + .b 61433 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,61434),(.m25,.s2,61429)], + .m .m18, + .b 61434 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,61436),(.m14,.s5,61430)], + .m .m5, + .b 61436 [[([5],[(.D18,1),(.D17,764),(.D15,408371659),(.D17,12995),(.D11,11414),(.D17,90),(.D11,731),(.D6,7)])]], + .ms [(.m2,.s6,61439),(.m7,.s5,61433)], + .m .m5, + .b 61439 [[([3059,1535,768,384,192,96,48,24,12],[(.D8,764),(.D16,408371659)]),([382],[(.D6,12995),(.D12,11414),(.D6,90),(.D12,732),(.D7,6)])],[([2450228801],[(.D2,408371466)])]], + .ms [(.m2,.s6,1225178899),(.m27,.s2,1225178894)], + .m .m18, + .b 1225178899 [[([1],[(.D6,1)])],[([4],[(.D13,0),(.D6,1)])],[([2],[(.D17,1),(.D15,0),(.D6,12947)])],[([4],[(.D3,0)])],[([2],[(.D17,1),(.D21,12946),(.D11,11402),(.D17,87),(.D17,732),(.D8,5)])],[([5],[(.D13,0),(.D16,12946),(.D12,11402)])],[([3833],[(.D12,12947),(.D13,11402),(.D6,87),(.D6,733),(.D9,5),(.D8,2)])]], + .ms2 .s6 .s7 [(.m2,1225180825,12469)], + .ms [(.m12,.s7,11282)], + .ms2 .s6 .s7 [(.m3,57,725)], + .s2 .s12 .s6 [(6,1)], + .s2 .s7 .s12 [(3,6)], + .s2 .s6 .s7 [(1,1)], + .s .s12 3, + .ms2 .s3 .s0 [(.m103,2,1)], + .s2 .s8 .s3 [(2,3)], + .s2 .s0 .s8 [(1,2)], + .s2 .s3 .s0 [(725,57)], + .ms [(.m4,.s3,11282)], + .ms2 .s3 .s0 [(.m13,12469,1225180820)], + .ms [(.m26,.s7,1225180825),(.m8,.s2,1225180820)], + .m .m9, + .b 0 [[([16892],[(.D7,1225180825),(.D7,12468),(.D12,11282)]),([228,35],[(.D6,57),(.D6,725)]),([15],[(.D12,3),(.D12,2)])]], + .ms [(.m2,.s6,8446)], + .ms2 .s6 .s7 [(.m3,1225178713,11941)], + .ms [(.m12,.s7,11150),(.m3,.s6,24),(.m6,.s6,715),(.m65,.s3,715)], + .ms2 .s3 .s0 [(.m13,24,11150)], + .ms [(.m17,.s0,11941),(.m4,.s3,1225178713),(.m4,.s3,8440),(.m10,.s7,8446),(.m8,.s2,8441)], + .m .m9, + .b 0 [[([30716],[(.D7,8446),(.D17,1225178713),(.D6,11941),(.D12,11150)]),([95,24],[(.D6,24),(.D12,715)]),([5,2],[(.D16,2),(.D16,3)])]], + .ms [(.m2,.s6,15358),(.m3,.s6,4606)], + .ms2 .s6 .s7 [(.m3,1225177753,11701)], + .ms [(.m12,.s7,11090),(.m66,.s7,713),(.m67,.s0,713),(.m68,.s0,11090),(.m17,.s0,11701),(.m4,.s3,1225177753),(.m4,.s3,4606),(.m4,.s3,15352),(.m10,.s7,15358),(.m8,.s2,15353)], + .m .m9, + .b 0 [[([38012],[(.D7,15358),(.D17,4606),(.D16,1225177753),(.D6,11701),(.D12,11090),(.D6,9),(.D6,713),(.D6,1)])],[([27648],[(.D15,10606),(.D15,3418),(.D15,1225177456),(.D11,11625),(.D15,11072)]),([15,9,3],[(.D6,5),(.D15,711)]),([2],[(.D13,0)])],[([1920],[(.D15,7150),(.D15,2554),(.D15,1225177240),(.D11,11571),(.D15,11059),(.D21,0),(.D15,710),(.D15,0),(.D6,4)])]], + .ms [(.m2,.s6,33790),(.m3,.s6,6910),(.m3,.s6,2494)], + .ms2 .s6 .s7 [(.m3,1225177225,11569)], + .ms [(.m12,.s7,11057),(.m28,.s5,11057)], + .ms2 .s5 .s2 [(.m11,11569,1225177225)], + .ms [(.m1,.s5,2494),(.m4,.s5,6910),(.m4,.s5,33784)], + .m .m5, + .b 33790 [[([1535],[(.D16,6910),(.D16,2494),(.D16,1225177225),(.D6,11569),(.D12,11057),(.D6,1)])]], + .ms [(.m2,.s6,34558),(.m3,.s6,6718),(.m3,.s6,2446)], + .ms2 .s6 .s7 [(.m3,1225177213,11566)], + .ms [(.m3,.s6,11058)], + .ms2 .s5 .s2 [(.m15,11058,11566)], + .ms [(.m4,.s5,1225177213),(.m4,.s5,2446),(.m4,.s5,6718),(.m4,.s5,34552)], + .m .m5, + .b 34558 [[([2687],[(.D16,6718),(.D16,2446),(.D16,1225177213),(.D6,11566),(.D6,11058),(.D16,1)])]], + .ms [(.m2,.s6,35902),(.m3,.s6,6382),(.m3,.s6,2362),(.m3,.s6,1225177192),(.m6,.s6,11559),(.m3,.s6,11056),(.m25,.s2,11056),(.m1,.s5,11559),(.m11,.s5,1225177192),(.m4,.s5,2362),(.m4,.s5,6382),(.m4,.s5,35896)], + .m .m5, + .b 35902 [[([3455],[(.D16,6382),(.D16,2362),(.D16,1225177192),(.D12,11559),(.D16,11056),(.D6,2)])]], + .ms [(.m2,.s6,37630),(.m3,.s6,5950),(.m3,.s6,2254)], + .ms2 .s6 .s7 [(.m3,1225177165,11554)], + .ms [(.m3,.s6,11055)], + .ms2 .s5 .s2 [(.m14,11055,11554)], + .ms [(.m4,.s5,1225177165),(.m4,.s5,2254),(.m4,.s5,5950),(.m4,.s5,37624)], + .m .m5, + .b 37630 [[([6143],[(.D16,5950),(.D16,2254),(.D16,1225177165),(.D6,11554),(.D6,11055),(.D18,1),(.D17,708),(.D16,1)])]], + .ms [(.m2,.s6,40702),(.m3,.s6,5182),(.m3,.s6,2062)], + .ms2 .s6 .s7 [(.m3,1225177117,11542)], + .ms [(.m3,.s6,11052)], + .ms2 .s5 .s2 [(.m7,11052,11542)], + .ms [(.m4,.s5,1225177117),(.m4,.s5,2062),(.m4,.s5,5182),(.m4,.s5,40696)], + .m .m5, + .b 40702 [[([10751],[(.D16,5182),(.D16,2062),(.D16,1225177117),(.D6,11542),(.D6,11052),(.D8,709),(.D17,1),(.D7,3)])],[([10368],[(.D15,3838),(.D15,1726),(.D15,1225177033),(.D17,11521),(.D11,11045),(.D17,709),(.D13,1),(.D17,2)])]], + .ms [(.m2,.s6,51262),(.m3,.s6,2542),(.m3,.s6,1402),(.m3,.s6,1225176952),(.m6,.s6,11499),(.m3,.s6,11041),(.m3,.s6,707),(.m69,.s3,707),(.m4,.s3,11041),(.m4,.s3,11499),(.m13,.s3,1225176952),(.m4,.s3,1402),(.m4,.s3,2542),(.m4,.s3,51256),(.m10,.s7,51262),(.m8,.s2,51257)], + .m .m9, + .b 0 [[([81332],[(.D7,51262)]),([10166,5087,2544,1272,636,315,156,81,39,21,12,3],[(.D17,2542),(.D16,1402)]),([1270],[(.D16,1225176952),(.D12,11499),(.D16,11041),(.D16,707)]),([2,2],[(.D16,1),(.D6,3)])]], + .ms [(.m2,.s6,40666),(.m3,.s6,41095),(.m14,.s5,41095),(.m4,.s5,40660)], + .m .m5, + .b 40666 [[([23],[(.D16,41095),(.D18,1),(.D15,765),(.D14,1225176793)])]], + .ms [(.m2,.s6,40678),(.m3,.s6,41092),(.m7,.s5,41092),(.m4,.s5,40672)], + .m .m5, + .b 40678 [[([7],[(.D16,41092),(.D6,1)])]], + .ms [(.m2,.s6,40682),(.m6,.s6,41090),(.m15,.s5,41090),(.m11,.s5,40676)], + .m .m5, + .b 40682 [[([5],[(.D12,41090),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,40685,41091)], + .ms [(.m23,.s1,41091),(.m22,.s4,40679)], + .m .m24, + .b 40685 [[([17],[(.D6,41091),(.D6,2)])]], + .ms [(.m2,.s6,40694),(.m6,.s6,41087),(.m14,.s5,41087),(.m11,.s5,40688)], + .m .m5, + .b 40694 [[([23],[(.D12,41087),(.D18,1),(.D17,764),(.D15,1225176793),(.D17,11461),(.D11,11030),(.D11,703),(.D6,1)])]], + .ms [(.m2,.s6,40706),(.m6,.s6,41084),(.m7,.s5,41084),(.m11,.s5,40700)], + .m .m5, + .b 40706 [[([4215],[(.D12,41084),(.D8,764),(.D16,1225176793),(.D6,11461),(.D12,11030),(.D12,704),(.D21,0),(.D17,2)])]], + .ms [(.m2,.s6,42814)], + .ms2 .s6 .s7 [(.m3,40558,634)], + .ms [(.m0,.s6,1225176760),(.m6,.s6,11451),(.m3,.s6,11029),(.m3,.s6,704),(.m70,.s3,704),(.m4,.s3,11029),(.m4,.s3,11451),(.m13,.s3,1225176760)], + .ms2 .s3 .s0 [(.m4,634,40558)], + .ms [(.m1,.s3,42808),(.m10,.s7,42814),(.m8,.s2,42809)], + .m .m9, + .b 0 [[([32252],[(.D7,42814),(.D17,40558),(.D6,634),(.D16,1225176760),(.D12,11451),(.D16,11029),(.D16,704),(.D18,0)])]], + .ms [(.m2,.s6,16126),(.m3,.s6,38782)], + .ms2 .s6 .s7 [(.m3,39550,382),(.m0,1225176697,11437)], + .ms [(.m12,.s7,11024),(.m12,.s7,702),(.m28,.s5,702),(.m11,.s5,11024)], + .ms2 .s5 .s2 [(.m11,11437,1225176697),(.m1,382,39550)], + .ms [(.m1,.s5,38782),(.m4,.s5,16120)], + .m .m5, + .b 16126 [[([48775],[(.D16,38782),(.D16,39550)]),([1525,767,384,192,96,48,24,12],[(.D6,382),(.D16,1225176697)]),([190],[(.D6,11437),(.D12,11024),(.D12,702),(.D8,3)])],[([130738,65373,32688,16344,8172,4083,2040,1020,513,255,129,63,33,15,9,3],[(.D11,32684),(.D17,38026)]),([16342],[(.D2,1225176600)])]], + .ms [(.m2,.s6,171253),(.m14,.s5,171247)], + .m .m5, + .b 171253 [[([5],[(.D18,1),(.D15,29853),(.D0,1225173877)])]], + .ms [(.m2,.s6,171256),(.m7,.s5,171250)], + .m .m5, + .b 171256 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,171257),(.m15,.s5,171251)], + .m .m5, + .b 171257 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,171258),(.m25,.s2,171253)], + .m .m18, + .b 171258 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,171260),(.m14,.s5,171254)], + .m .m5, + .b 171260 [[([5],[(.D18,1),(.D17,29852),(.D1,1225173877)])]], + .ms [(.m2,.s6,171263),(.m7,.s5,171257)], + .m .m5, + .b 171263 [[([119411,59711,29856,14928,7464,3732,1861,935,468,229,119,60,25,12,11],[(.D8,29852),(.D2,1225173876)])],[([7,2],[(.D12,1),(.D10,1225163925)]),([1],[(.D16,11413)])]], + .ms [(.m2,.s6,290679),(.m15,.s5,290673)], + .m .m5, + .b 290679 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,290680),(.m25,.s2,290675)], + .m .m18, + .b 290680 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,290682),(.m14,.s5,290676)], + .m .m5, + .b 290682 [[([3],[(.D18,1)])]], + .ms [(.m2,.s6,290684),(.m14,.s5,290678)], + .m .m5, + .b 290684 [[([5],[(.D18,1),(.D17,1225163925),(.D17,11413),(.D11,11018),(.D11,700),(.D10,2)])]], + .ms [(.m2,.s6,290687),(.m7,.s5,290681)], + .m .m5, + .b 290687 [[([261],[(.D8,1225163925),(.D6,11413),(.D12,11018),(.D12,701),(.D11,2)])]], + .ms2 .s6 .s7 [(.m2,290818,1225163894)], + .ms [(.m12,.s7,11403),(.m0,.s6,11017),(.m3,.s6,701),(.m21,.s3,701),(.m4,.s3,11017),(.m4,.s3,11403)], + .ms2 .s3 .s0 [(.m13,1225163894,290813)], + .ms [(.m26,.s7,290818),(.m8,.s2,290813)], + .m .m9, + .b 0 [[([3548],[(.D7,290818),(.D7,1225163893),(.D12,11403),(.D16,11017),(.D16,701),(.D12,3)])]], + .ms [(.m2,.s6,1774)], + .ms2 .s6 .s7 [(.m3,290374,1225163783)], + .ms [(.m3,.s6,11377)], + .ms2 .s6 .s7 [(.m6,11009,700)], + .ms2 .s3 .s0 [(.m19,700,11009)], + .ms [(.m17,.s0,11377)], + .ms2 .s3 .s0 [(.m4,1225163783,290374)], + .ms [(.m1,.s3,1768),(.m10,.s7,1774),(.m8,.s2,1769)], + .m .m9, + .b 0 [[([7094,3270],[(.D7,1774),(.D17,290374)]),([647],[(.D6,1225163783),(.D6,11377),(.D12,11009),(.D6,700),(.D16,4)])]], + .ms [(.m2,.s6,5182),(.m3,.s6,478)], + .ms2 .s6 .s7 [(.m3,290050,1225163702)], + .ms [(.m12,.s7,11355)], + ] (by decide +kernel) +theorem chunk_4_step : (cfg_4.denote) [qi]⊢* (cfg_5.denote) := + step_chunk [ + .ms [(.m0,.s6,11005),(.m3,.s6,698),(.m20,.s0,698),(.m1,.s3,11005),(.m4,.s3,11355)], + .ms2 .s3 .s0 [(.m13,1225163702,290050)], + .ms [(.m1,.s3,478),(.m4,.s3,5176),(.m10,.s7,5182),(.m8,.s2,5177)], + .m .m9, + .b 0 [[([15284],[(.D7,5182)]),([1910,959,480,240,120,60,27,12,9,3],[(.D17,478),(.D16,290050)]),([238],[(.D6,1225163702),(.D12,11355),(.D16,11005),(.D16,698),(.D6,5)])]], + .ms [(.m2,.s6,7642),(.m3,.s6,3271),(.m14,.s5,3271),(.m4,.s5,7636)], + .m .m5, + .b 7642 [[([23],[(.D16,3271),(.D18,1),(.D15,289929),(.D16,1225163672)])]], + .ms [(.m2,.s6,7654),(.m3,.s6,3268),(.m7,.s5,3268),(.m4,.s5,7648)], + .m .m5, + .b 7654 [[([7],[(.D16,3268),(.D6,1)])]], + .ms [(.m2,.s6,7658),(.m6,.s6,3266),(.m15,.s5,3266),(.m11,.s5,7652)], + .m .m5, + .b 7658 [[([5],[(.D12,3266),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,7661,3267)], + .ms [(.m23,.s1,3267),(.m22,.s4,7655)], + .m .m24, + .b 7661 [[([17],[(.D6,3267),(.D6,2)])]], + .ms [(.m2,.s6,7670),(.m6,.s6,3263),(.m14,.s5,3263),(.m11,.s5,7664)], + .m .m5, + .b 7670 [[([23],[(.D12,3263),(.D18,1),(.D17,289928),(.D17,1225163672),(.D11,11347),(.D6,11004)])]], + .ms [(.m2,.s6,7682),(.m6,.s6,3260),(.m7,.s5,3260),(.m11,.s5,7676)], + .m .m5, + .b 7682 [[([13041,6525,1161],[(.D12,3260),(.D8,289928)]),([1295],[(.D6,1225163672),(.D12,11348),(.D7,11003),(.D8,697),(.D7,4)])]], + .ms [(.m2,.s6,18046)], + .ms2 .s6 .s7 [(.m3,670,289282)], + .ms [(.m3,.s6,1225163510),(.m6,.s6,11307),(.m3,.s6,10993),(.m3,.s6,695),(.m21,.s3,695),(.m4,.s3,10993),(.m4,.s3,11307)], + .ms2 .s3 .s0 [(.m13,1225163510,289282)], + .ms [(.m4,.s3,670),(.m4,.s3,18040),(.m10,.s7,18046),(.m8,.s2,18041)], + .m .m9, + .b 0 [[([21428],[(.D7,18046)]),([2678,1343,672,336,168,84,39,21,12,3],[(.D17,670),(.D6,289282)]),([334],[(.D6,1225163510),(.D12,11307),(.D16,10993),(.D16,695),(.D12,3)])],[([8],[(.D15,15367),(.D21,0),(.D19,289113)])]], + .ms [(.m2,.s6,10718),(.m6,.s6,15365),(.m7,.s5,15365),(.m11,.s5,10712)], + .m .m5, + .b 10718 [[([41],[(.D12,15365),(.D8,1),(.D7,289112)])],[([61442,30722,15360,7680,3840,1920,960,480,240,120,60,33,15,9,3],[(.D17,15361),(.D2,289110)])]], + .ms [(.m2,.s6,72181),(.m47,.s5,72175)], + .m .m5, + .b 72181 [[([1],[(.D18,0)])]], + .ms [(.m2,.s6,72182),(.m7,.s5,72176)], + .m .m5, + .b 72182 [[([10],[(.D8,1),(.D11,283990),(.D16,1225163468)])],[([3],[(.D12,1)])]], + .ms [(.m2,.s6,72189),(.m48,.s4,72183)], + .m .m24, + .b 72189 [[([5],[(.D16,2),(.D17,283990),(.D17,1225163468),(.D11,11296),(.D12,10990)])]], + .ms [(.m2,.s6,72192),(.m15,.s5,72186)], + .m .m5, + .b 72192 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,72193),(.m25,.s2,72188)], + .m .m18, + .b 72193 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,72195),(.m14,.s5,72189)], + .m .m5, + .b 72195 [[([5],[(.D18,1),(.D17,283988),(.D6,1225163468)])]], + .ms [(.m2,.s6,72198),(.m7,.s5,72192)], + .m .m5, + .b 72198 [[([2203],[(.D8,283989),(.D7,1225163467),(.D12,11297),(.D13,10990),(.D9,694),(.D13,3)])]], + .ms [(.m2,.s6,73300)], + .ms2 .s6 .s7 [(.m3,283714,1225163399)], + .ms [(.m3,.s6,11281)], + .ms2 .s6 .s7 [(.m6,10985,694)], + .ms2 .s3 .s0 [(.m19,694,10985)], + .ms [(.m17,.s0,11281)], + .ms2 .s3 .s0 [(.m4,1225163399,283714)], + .ms [(.m1,.s3,73294),(.m10,.s7,73300),(.m8,.s2,73295)], + .m .m9, + .b 0 [[([10364],[(.D7,73300),(.D17,283714),(.D6,1225163399),(.D6,11281),(.D12,10985),(.D6,694),(.D16,4)])]], + .ms [(.m2,.s6,5182),(.m3,.s6,72004)], + .ms2 .s6 .s7 [(.m3,283390,1225163318)], + .ms [(.m12,.s7,11259),(.m0,.s6,10981),(.m3,.s6,692),(.m20,.s0,692),(.m1,.s3,10981),(.m4,.s3,11259)], + .ms2 .s3 .s0 [(.m13,1225163318,283390)], + .ms [(.m1,.s3,72004),(.m4,.s3,5176),(.m10,.s7,5182),(.m8,.s2,5177)], + .m .m9, + .b 0 [[([20726,10365,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,5182),(.D17,72004)]),([2590],[(.D16,283390),(.D6,1225163318),(.D12,11259),(.D16,10981),(.D16,692),(.D6,5)])]], + .ms [(.m2,.s6,20725),(.m14,.s5,20719)], + .m .m5, + .b 20725 [[([5],[(.D18,1),(.D15,70707),(.D14,283066)])]], + .ms [(.m2,.s6,20728),(.m7,.s5,20722)], + .m .m5, + .b 20728 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,20729),(.m15,.s5,20723)], + .m .m5, + .b 20729 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,20730),(.m25,.s2,20725)], + .m .m18, + .b 20730 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,20732),(.m14,.s5,20726)], + .m .m5, + .b 20732 [[([5],[(.D18,1),(.D17,70706),(.D15,283066),(.D17,1225163237),(.D17,11240),(.D8,10975)])]], + .ms [(.m2,.s6,20735),(.m7,.s5,20729)], + .m .m5, + .b 20735 [[([14205],[(.D8,70706),(.D16,283066),(.D6,1225163237),(.D6,11241),(.D9,10975),(.D14,690),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,27838,68932),(.m0,282622,1225163126)], + .ms [(.m12,.s7,11211),(.m0,.s6,10969),(.m3,.s6,689),(.m21,.s3,689),(.m4,.s3,10969),(.m4,.s3,11211)], + .ms2 .s3 .s0 [(.m13,1225163126,282622),(.m1,68932,27833)], + .ms [(.m26,.s7,27838),(.m8,.s2,27833)], + .m .m9, + .b 0 [[([56828],[(.D7,27838),(.D7,68931),(.D16,282622),(.D6,1225163126),(.D12,11211),(.D16,10969),(.D16,689),(.D12,3)])]], + .ms [(.m2,.s6,28414)], + .ms2 .s6 .s7 [(.m3,20734,67156),(.m0,282178,1225163015)], + .ms [(.m3,.s6,11185)], + .ms2 .s6 .s7 [(.m6,10961,688)], + .ms2 .s3 .s0 [(.m19,688,10961)], + .ms [(.m17,.s0,11185)], + .ms2 .s3 .s0 [(.m4,1225163015,282178),(.m1,67156,20734)], + .ms [(.m1,.s3,28408),(.m10,.s7,28414),(.m8,.s2,28409)], + .m .m9, + .b 0 [[([113654,52230],[(.D7,28414),(.D17,20734)]),([10367],[(.D6,67156),(.D16,282178),(.D6,1225163015),(.D6,11185),(.D12,10961),(.D6,688),(.D16,4)])]], + .ms [(.m2,.s6,82942),(.m3,.s6,7678)], + .ms2 .s6 .s7 [(.m3,15550,65860),(.m0,281854,1225162934)], + .ms [(.m12,.s7,11163),(.m0,.s6,10957),(.m3,.s6,686),(.m20,.s0,686),(.m1,.s3,10957),(.m4,.s3,11163)], + .ms2 .s3 .s0 [(.m13,1225162934,281854),(.m1,65860,15550)], + .ms [(.m1,.s3,7678),(.m4,.s3,82936),(.m10,.s7,82942),(.m8,.s2,82937)], + .m .m9, + .b 0 [[([245684],[(.D7,82942)]),([30710,15359,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,7678),(.D16,15550)]),([3838],[(.D6,65860),(.D16,281854),(.D6,1225162934),(.D12,11163),(.D16,10957),(.D16,686),(.D6,5)])]], + .ms [(.m2,.s6,122842),(.m3,.s6,52231),(.m14,.s5,52231),(.m4,.s5,122836)], + .m .m5, + .b 122842 [[([23],[(.D16,52231),(.D18,1),(.D15,13629),(.D16,65380)])]], + .ms [(.m2,.s6,122854),(.m3,.s6,52228),(.m7,.s5,52228),(.m4,.s5,122848)], + .m .m5, + .b 122854 [[([7],[(.D16,52228),(.D6,1)])]], + .ms [(.m2,.s6,122858),(.m6,.s6,52226),(.m15,.s5,52226),(.m11,.s5,122852)], + .m .m5, + .b 122858 [[([5],[(.D12,52226),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,122861,52227)], + .ms [(.m23,.s1,52227),(.m22,.s4,122855)], + .m .m24, + .b 122861 [[([17],[(.D6,52227),(.D6,2)])]], + .ms [(.m2,.s6,122870),(.m6,.s6,52223),(.m14,.s5,52223),(.m11,.s5,122864)], + .m .m5, + .b 122870 [[([23],[(.D12,52223),(.D18,1),(.D17,13628),(.D17,65380),(.D15,281734),(.D17,1225162904),(.D11,11155),(.D6,10956)])]], + .ms [(.m2,.s6,122882),(.m6,.s6,52220),(.m7,.s5,52220),(.m11,.s5,122876)], + .m .m5, + .b 122882 [[([208881,104445,18441],[(.D12,52220),(.D8,13628),(.D6,65380)]),([5183],[(.D16,281734),(.D6,1225162904),(.D12,11156),(.D7,10955),(.D8,685),(.D7,4)])]], + .ms [(.m2,.s6,288766)], + .ms2 .s6 .s7 [(.m3,10750,3262)], + .ms [(.m3,.s6,62788)], + .ms2 .s6 .s7 [(.m3,281086,1225162742)], + .ms [(.m12,.s7,11115),(.m0,.s6,10945),(.m3,.s6,683),(.m21,.s3,683),(.m4,.s3,10945),(.m4,.s3,11115)], + .ms2 .s3 .s0 [(.m13,1225162742,281086),(.m1,62788,3262)], + .ms [(.m4,.s3,10750),(.m4,.s3,288760),(.m10,.s7,288766),(.m8,.s2,288761)], + .m .m9, + .b 0 [[([343988],[(.D7,288766)]),([42998,21503,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,10750),(.D6,3262),(.D6,62788)]),([1343],[(.D16,281086),(.D6,1225162742),(.D12,11115),(.D16,10945),(.D16,683),(.D12,3)])],[([8],[(.D15,245767),(.D21,0),(.D19,573)])]], + .ms [(.m2,.s6,171998),(.m6,.s6,245765),(.m7,.s5,245765),(.m11,.s5,171992)], + .m .m5, + .b 171998 [[([41],[(.D12,245765),(.D8,1),(.D7,572)])],[([13702],[(.D17,245761),(.D2,570)])]], + .ms [(.m2,.s6,178870),(.m3,.s6,244048),(.m27,.s2,244048),(.m1,.s5,178864)], + .m .m5, + .b 178870 [[([7],[(.D16,244048),(.D6,1)])],[([16],[(.D11,244046),(.D13,0),(.D6,1)])],[([8],[(.D15,244045),(.D17,1),(.D15,0),(.D6,62116)])],[([16],[(.D11,244043),(.D3,0)])],[([8],[(.D15,244042),(.D17,1),(.D21,62115),(.D15,280918),(.D17,1225162700),(.D11,11104),(.D12,10942)])],[([18],[(.D11,244040),(.D13,0),(.D16,62115),(.D16,280918)])],[([35302],[(.D17,244039),(.D12,62116),(.D17,280918),(.D6,1225162700),(.D12,11105),(.D13,10942),(.D9,682),(.D13,3)])]], + .ms [(.m2,.s6,196558)], + .ms2 .s6 .s7 [(.m3,239626,61014),(.m0,280642,1225162631)], + .ms [(.m3,.s6,11089)], + .ms2 .s6 .s7 [(.m6,10937,682)], + .ms2 .s3 .s0 [(.m19,682,10937)], + .ms [(.m17,.s0,11089)], + .ms2 .s3 .s0 [(.m4,1225162631,280642),(.m1,61014,239626)], + .ms [(.m1,.s3,196552),(.m10,.s7,196558),(.m8,.s2,196553)], + .m .m9, + .b 0 [[([165884],[(.D7,196558),(.D17,239626),(.D6,61014),(.D16,280642),(.D6,1225162631),(.D6,11089),(.D12,10937),(.D6,682),(.D16,4)])]], + .ms [(.m2,.s6,82942),(.m3,.s6,175822)], + .ms2 .s6 .s7 [(.m3,234442,59718),(.m0,280318,1225162550)], + .ms [(.m12,.s7,11067),(.m0,.s6,10933),(.m3,.s6,680),(.m20,.s0,680),(.m1,.s3,10933),(.m4,.s3,11067)], + .ms2 .s3 .s0 [(.m13,1225162550,280318),(.m1,59718,234442)], + .ms [(.m1,.s3,175822),(.m4,.s3,82936),(.m10,.s7,82942),(.m8,.s2,82937)], + .m .m9, + .b 0 [[([331766,165885,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,82942),(.D17,175822)]),([41470],[(.D16,234442),(.D6,59718),(.D16,280318),(.D6,1225162550),(.D12,11067),(.D16,10933),(.D16,680),(.D6,5)])]], + .ms [(.m2,.s6,331765),(.m14,.s5,331759)], + .m .m5, + .b 331765 [[([5],[(.D18,1),(.D15,155085),(.D14,229258)])]], + .ms [(.m2,.s6,331768),(.m7,.s5,331762)], + .m .m5, + .b 331768 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,331769),(.m15,.s5,331763)], + .m .m5, + .b 331769 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,331770),(.m25,.s2,331765)], + .m .m18, + .b 331770 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,331772),(.m14,.s5,331766)], + .m .m5, + .b 331772 [[([5],[(.D18,1),(.D17,155084),(.D15,229258),(.D17,58422),(.D15,279994),(.D17,1225162469),(.D17,11048),(.D8,10927)])]], + .ms [(.m2,.s6,331775),(.m7,.s5,331769)], + .m .m5, + .b 331775 [[([227325],[(.D8,155084),(.D16,229258),(.D6,58422),(.D16,279994),(.D6,1225162469),(.D6,11049),(.D9,10927),(.D14,678),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,445438,126670),(.m0,222154,56646),(.m0,279550,1225162358)], + .ms [(.m12,.s7,11019),(.m0,.s6,10921),(.m3,.s6,677),(.m21,.s3,677),(.m4,.s3,10921),(.m4,.s3,11019)], + .ms2 .s3 .s0 [(.m13,1225162358,279550),(.m1,56646,222154),(.m1,126670,445433)], + .ms [(.m26,.s7,445438),(.m8,.s2,445433)], + .m .m9, + .b 0 [[([909308],[(.D7,445438),(.D7,126669),(.D16,222154),(.D6,56646),(.D16,279550),(.D6,1225162358),(.D12,11019),(.D16,10921),(.D16,677),(.D12,3)])]], + .ms [(.m2,.s6,454654)], + .ms2 .s6 .s7 [(.m3,331774,98254),(.m0,215050,54870),(.m0,279106,1225162247)], + .ms [(.m3,.s6,10993)], + .ms2 .s6 .s7 [(.m6,10913,676)], + .ms2 .s3 .s0 [(.m19,676,10913)], + .ms [(.m17,.s0,10993)], + .ms2 .s3 .s0 [(.m4,1225162247,279106),(.m1,54870,215050),(.m1,98254,331774)], + .ms [(.m1,.s3,454648),(.m10,.s7,454654),(.m8,.s2,454649)], + .m .m9, + .b 0 [[([1818614,835590],[(.D7,454654),(.D17,331774)]),([165887],[(.D6,98254),(.D16,215050),(.D6,54870),(.D16,279106),(.D6,1225162247),(.D6,10993),(.D12,10913),(.D6,676),(.D16,4)])]], + .ms [(.m2,.s6,1327102),(.m3,.s6,122878)], + .ms2 .s6 .s7 [(.m3,248830,77518),(.m0,209866,53574),(.m0,278782,1225162166)], + .ms [(.m12,.s7,10971),(.m0,.s6,10909),(.m3,.s6,674),(.m20,.s0,674),(.m1,.s3,10909),(.m4,.s3,10971)], + .ms2 .s3 .s0 [(.m13,1225162166,278782),(.m1,53574,209866),(.m1,77518,248830)], + .ms [(.m1,.s3,122878),(.m4,.s3,1327096),(.m10,.s7,1327102),(.m8,.s2,1327097)], + .m .m9, + .b 0 [[([3932084],[(.D7,1327102)]),([491510,245759,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,122878),(.D16,248830)]),([61438],[(.D6,77518),(.D16,209866),(.D6,53574),(.D16,278782),(.D6,1225162166),(.D12,10971),(.D16,10909),(.D16,674),(.D6,5)])]], + .ms [(.m2,.s6,1966042),(.m3,.s6,835591),(.m14,.s5,835591),(.m4,.s5,1966036)], + .m .m5, + .b 1966042 [[([23],[(.D16,835591),(.D18,1),(.D15,218109),(.D16,69838)])]], + .ms [(.m2,.s6,1966054),(.m3,.s6,835588)], + .m .m49, + ] (by decide +kernel) +theorem chunk_5_step : (cfg_5.denote) [qi]⊢* (cfg_6.denote) := + step_chunk [ + .ms [(.m71,.s5,835588),(.m4,.s5,1966048)], + .m .m5, + .b 1966054 [[([7],[(.D16,835588),(.D6,1)])]], + .ms [(.m2,.s6,1966058),(.m6,.s6,835586),(.m15,.s5,835586),(.m11,.s5,1966052)], + .m .m5, + .b 1966058 [[([5],[(.D12,835586),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,1966061,835587)], + .ms [(.m23,.s1,835587),(.m22,.s4,1966055)], + .m .m24, + .b 1966061 [[([17],[(.D6,835587),(.D6,2)])]], + .ms [(.m2,.s6,1966070),(.m6,.s6,835583),(.m14,.s5,835583),(.m11,.s5,1966064)], + .m .m5, + .b 1966070 [[([23],[(.D12,835583),(.D18,1),(.D17,218108),(.D17,69838),(.D15,207946),(.D17,53094),(.D15,278662),(.D17,1225162136),(.D11,10963),(.D6,10908)])]], + .ms [(.m2,.s6,1966082),(.m6,.s6,835580),(.m7,.s5,835580),(.m11,.s5,1966076)], + .m .m5, + .b 1966082 [[([3342321,1671165,294921],[(.D12,835580),(.D8,218108),(.D6,69838),(.D16,207946)]),([20735],[(.D6,53094),(.D16,278662),(.D6,1225162136),(.D12,10964),(.D7,10907),(.D8,673),(.D7,4)])]], + .ms [(.m2,.s6,4620286)], + .ms2 .s6 .s7 [(.m3,172030,52222)], + .ms [(.m3,.s6,28366)], + .ms2 .s6 .s7 [(.m3,197578,50502),(.m0,278014,1225161974)], + .ms [(.m12,.s7,10923),(.m0,.s6,10897),(.m3,.s6,671),(.m21,.s3,671),(.m4,.s3,10897),(.m4,.s3,10923)], + .ms2 .s3 .s0 [(.m13,1225161974,278014),(.m1,50502,197578),(.m1,28366,52222)], + .ms [(.m4,.s3,172030),(.m4,.s3,4620280),(.m10,.s7,4620286),(.m8,.s2,4620281)], + .m .m9, + .b 0 [[([5504948],[(.D7,4620286)]),([688118,344063,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,172030),(.D6,52222),(.D6,28366)]),([21503],[(.D16,197578),(.D6,50502),(.D16,278014),(.D6,1225161974),(.D12,10923),(.D16,10897),(.D16,671),(.D12,3)])],[([8],[(.D15,3932167),(.D21,0),(.D19,9213)])]], + .ms [(.m2,.s6,2752478),(.m6,.s6,3932165),(.m7,.s5,3932165),(.m11,.s5,2752472)], + .m .m5, + .b 2752478 [[([41],[(.D12,3932165),(.D8,1),(.D7,9212)])],[([221062],[(.D17,3932161),(.D2,9210)])]], + .ms [(.m2,.s6,2863030),(.m3,.s6,3904528),(.m27,.s2,3904528),(.m1,.s5,2863024)], + .m .m5, + .b 2863030 [[([7],[(.D16,3904528),(.D6,1)])],[([16],[(.D11,3904526),(.D13,0),(.D6,1)])],[([8],[(.D15,3904525),(.D17,1),(.D15,0),(.D6,17614)])],[([16],[(.D11,3904523),(.D3,0)])],[([8],[(.D15,3904522),(.D17,1),(.D21,17613),(.D15,194890),(.D17,49830),(.D15,277846),(.D17,1225161932),(.D11,10912),(.D12,10894)])],[([18],[(.D11,3904520),(.D13,0),(.D16,17613),(.D16,194890)])],[([563652],[(.D17,3904519)]),([70459,35231,17616,8808,4404,2199,1101,552,276,135,69,36,15,9,3],[(.D12,17614),(.D17,194890)]),([8807],[(.D6,49830),(.D16,277846),(.D6,1225161932),(.D12,10913),(.D13,10894),(.D9,670),(.D13,3)])],[([10],[(.D17,3834063),(.D21,0),(.D19,190486)])]], + .ms [(.m2,.s6,3144898),(.m3,.s6,3834061),(.m7,.s5,3834061),(.m4,.s5,3144892)], + .m .m5, + .b 3144898 [[([43],[(.D16,3834061),(.D8,1),(.D7,190485)])],[([4571610],[(.D11,3834054),(.D2,190483)])]], + .ms2 .s6 .s7 [(.m2,5430725,3262605)], + .ms [(.m29,.s2,3262605),(.m4,.s5,5430719)], + .m .m5, + .b 5430725 [[([9],[(.D6,3262605),(.D6,1)])],[([20],[(.D15,3262603),(.D13,0),(.D10,48728),(.D9,277570)])],[([36],[(.D11,3262599)]),([7,2],[(.D12,1),(.D6,48728)])]], + .ms [(.m2,.s6,5430758),(.m6,.s6,3262595),(.m15,.s5,3262595),(.m11,.s5,5430752)], + .m .m5, + .b 5430758 [[([5],[(.D12,3262595),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,5430761,3262596)], + .ms [(.m23,.s1,3262596),(.m22,.s4,5430755)], + .m .m24, + .b 5430761 [[([17],[(.D6,3262596),(.D6,2)])],[([6],[(.D11,3262592),(.D21,0),(.D7,48726)])]], + .ms2 .s6 .s7 [(.m2,5430773,3262593)], + .ms2 .s5 .s2 [(.m28,3262593,5430768)], + .m .m18, + .b 5430773 [[([45],[(.D6,3262593),(.D8,1),(.D17,48725),(.D10,277569)])],[([36],[(.D15,3262586)]),([7,2],[(.D12,1),(.D17,48724)]),([1],[(.D11,277569),(.D16,1225161863)])],[([8],[(.D15,3262582),(.D21,0),(.D17,48723),(.D12,277570)])]], + .ms [(.m2,.s6,5430818),(.m6,.s6,3262580),(.m7,.s5,3262580),(.m11,.s5,5430812)], + .m .m5, + .b 5430818 [[([39],[(.D12,3262580),(.D8,48724),(.D13,277570),(.D17,1225161863),(.D17,10897),(.D11,10889),(.D17,670),(.D15,3)])]], + .ms [(.m2,.s6,5430838)], + .ms2 .s6 .s7 [(.m3,3262576,48724),(.m0,277570,1225161863)], + .ms [(.m3,.s6,10897)], + .ms2 .s6 .s7 [(.m6,10889,670)], + .ms2 .s3 .s0 [(.m19,670,10889)], + .ms [(.m17,.s0,10897)], + .ms2 .s3 .s0 [(.m4,1225161863,277570),(.m1,48724,3262576)], + .ms [(.m1,.s3,5430832),(.m10,.s7,5430838),(.m8,.s2,5430833)], + .m .m9, + .b 0 [[([165884],[(.D7,5430838),(.D17,3262576),(.D6,48724),(.D16,277570),(.D6,1225161863),(.D6,10897),(.D12,10889),(.D6,670),(.D16,4)])]], + .ms [(.m2,.s6,82942),(.m3,.s6,5410102)], + .ms2 .s6 .s7 [(.m3,3257392,47428),(.m0,277246,1225161782)], + .ms [(.m12,.s7,10875),(.m0,.s6,10885),(.m3,.s6,668),(.m20,.s0,668),(.m1,.s3,10885),(.m4,.s3,10875)], + .ms2 .s3 .s0 [(.m13,1225161782,277246),(.m1,47428,3257392)], + .ms [(.m1,.s3,5410102),(.m4,.s3,82936),(.m10,.s7,82942),(.m8,.s2,82937)], + .m .m9, + .b 0 [[([331766,165885,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,82942),(.D17,5410102)]),([41470],[(.D16,3257392),(.D6,47428),(.D16,277246),(.D6,1225161782),(.D12,10875),(.D16,10885),(.D16,668),(.D6,5)])]], + .ms [(.m2,.s6,331765),(.m14,.s5,331759)], + .m .m5, + .b 331765 [[([5],[(.D18,1),(.D15,5389365),(.D14,3252208)])]], + .ms [(.m2,.s6,331768),(.m7,.s5,331762)], + .m .m5, + .b 331768 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,331769),(.m15,.s5,331763)], + .m .m5, + .b 331769 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,331770),(.m25,.s2,331765)], + .m .m18, + .b 331770 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,331772),(.m14,.s5,331766)], + .m .m5, + .b 331772 [[([5],[(.D18,1),(.D17,5389364),(.D15,3252208),(.D17,46132),(.D15,276922),(.D17,1225161701),(.D17,10856),(.D8,10879)])]], + .ms [(.m2,.s6,331775),(.m7,.s5,331769)], + .m .m5, + .b 331775 [[([227325],[(.D8,5389364),(.D16,3252208),(.D6,46132),(.D16,276922),(.D6,1225161701),(.D6,10857),(.D9,10879),(.D14,666),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,445438,5360950),(.m0,3245104,44356),(.m0,276478,1225161590)], + .ms [(.m12,.s7,10827),(.m0,.s6,10873),(.m3,.s6,665),(.m21,.s3,665),(.m4,.s3,10873),(.m4,.s3,10827)], + .ms2 .s3 .s0 [(.m13,1225161590,276478),(.m1,44356,3245104),(.m1,5360950,445433)], + .ms [(.m26,.s7,445438),(.m8,.s2,445433)], + .m .m9, + .b 0 [[([909308],[(.D7,445438),(.D7,5360949),(.D16,3245104),(.D6,44356),(.D16,276478),(.D6,1225161590),(.D12,10827),(.D16,10873),(.D16,665),(.D12,3)])]], + .ms [(.m2,.s6,454654)], + .ms2 .s6 .s7 [(.m3,331774,5332534),(.m0,3238000,42580),(.m0,276034,1225161479)], + .ms [(.m3,.s6,10801)], + .ms2 .s6 .s7 [(.m6,10865,664)], + .ms2 .s3 .s0 [(.m19,664,10865)], + .ms [(.m17,.s0,10801)], + .ms2 .s3 .s0 [(.m4,1225161479,276034),(.m1,42580,3238000),(.m1,5332534,331774)], + .ms [(.m1,.s3,454648),(.m10,.s7,454654),(.m8,.s2,454649)], + .m .m9, + .b 0 [[([1818614,835590],[(.D7,454654),(.D17,331774)]),([165887],[(.D6,5332534),(.D16,3238000),(.D6,42580),(.D16,276034),(.D6,1225161479),(.D6,10801),(.D12,10865),(.D6,664),(.D16,4)])]], + .ms [(.m2,.s6,1327102),(.m3,.s6,122878)], + .ms2 .s6 .s7 [(.m3,248830,5311798),(.m0,3232816,41284),(.m0,275710,1225161398)], + .ms [(.m12,.s7,10779),(.m0,.s6,10861),(.m3,.s6,662),(.m20,.s0,662),(.m1,.s3,10861),(.m4,.s3,10779)], + .ms2 .s3 .s0 [(.m13,1225161398,275710),(.m1,41284,3232816),(.m1,5311798,248830)], + .ms [(.m1,.s3,122878),(.m4,.s3,1327096),(.m10,.s7,1327102),(.m8,.s2,1327097)], + .m .m9, + .b 0 [[([3932084],[(.D7,1327102)]),([491510,245759,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,122878),(.D16,248830)]),([61438],[(.D6,5311798),(.D16,3232816),(.D6,41284),(.D16,275710),(.D6,1225161398),(.D12,10779),(.D16,10861),(.D16,662),(.D6,5)])]], + .ms [(.m2,.s6,1966042),(.m3,.s6,835591),(.m14,.s5,835591),(.m4,.s5,1966036)], + .m .m5, + .b 1966042 [[([23],[(.D16,835591),(.D18,1),(.D15,218109),(.D16,5304118)])]], + .ms [(.m2,.s6,1966054),(.m3,.s6,835588),(.m7,.s5,835588),(.m4,.s5,1966048)], + .m .m5, + .b 1966054 [[([7],[(.D16,835588),(.D6,1)])]], + .ms [(.m2,.s6,1966058),(.m6,.s6,835586),(.m15,.s5,835586),(.m11,.s5,1966052)], + .m .m5, + .b 1966058 [[([5],[(.D12,835586),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,1966061,835587)], + .ms [(.m23,.s1,835587),(.m22,.s4,1966055)], + .m .m24, + .b 1966061 [[([17],[(.D6,835587),(.D6,2)])]], + .ms [(.m2,.s6,1966070),(.m6,.s6,835583),(.m14,.s5,835583),(.m11,.s5,1966064)], + .m .m5, + .b 1966070 [[([23],[(.D12,835583),(.D18,1),(.D17,218108),(.D17,5304118),(.D15,3230896),(.D17,40804),(.D15,275590),(.D17,1225161368),(.D11,10771),(.D6,10860)])]], + .ms [(.m2,.s6,1966082),(.m6,.s6,835580),(.m7,.s5,835580),(.m11,.s5,1966076)], + .m .m5, + .b 1966082 [[([3342321,1671165,294921],[(.D12,835580),(.D8,218108),(.D6,5304118)]),([82943],[(.D16,3230896),(.D6,40804),(.D16,275590),(.D6,1225161368),(.D12,10772),(.D7,10859),(.D8,661),(.D7,4)])]], + .ms [(.m2,.s6,4620286)], + .ms2 .s6 .s7 [(.m3,172030,52222)], + .ms [(.m3,.s6,5262646)], + .ms2 .s6 .s7 [(.m3,3220528,38212),(.m0,274942,1225161206)], + .ms [(.m12,.s7,10731),(.m0,.s6,10849),(.m3,.s6,659),(.m21,.s3,659),(.m4,.s3,10849),(.m4,.s3,10731)], + .ms2 .s3 .s0 [(.m13,1225161206,274942),(.m1,38212,3220528),(.m1,5262646,52222)], + .ms [(.m4,.s3,172030),(.m4,.s3,4620280),(.m10,.s7,4620286),(.m8,.s2,4620281)], + .m .m9, + .b 0 [[([5504948],[(.D7,4620286)]),([688118,344063,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,172030),(.D6,52222),(.D6,5262646)]),([21503],[(.D16,3220528),(.D6,38212),(.D16,274942),(.D6,1225161206),(.D12,10731),(.D16,10849),(.D16,659),(.D12,3)])],[([8],[(.D15,3932167),(.D21,0),(.D19,9213)])]], + .ms [(.m2,.s6,2752478),(.m6,.s6,3932165),(.m7,.s5,3932165),(.m11,.s5,2752472)], + .m .m5, + .b 2752478 [[([41],[(.D12,3932165),(.D8,1),(.D7,9212)])],[([221062],[(.D17,3932161),(.D2,9210)])]], + .ms [(.m2,.s6,2863030),(.m3,.s6,3904528),(.m27,.s2,3904528),(.m1,.s5,2863024)], + .m .m5, + .b 2863030 [[([7],[(.D16,3904528),(.D6,1)])],[([16],[(.D11,3904526),(.D13,0),(.D6,1)])],[([8],[(.D15,3904525),(.D17,1),(.D15,0),(.D6,5251894)])],[([16],[(.D11,3904523),(.D3,0)])],[([8],[(.D15,3904522),(.D17,1),(.D21,5251893),(.D15,3217840),(.D17,37540),(.D15,274774),(.D17,1225161164),(.D11,10720),(.D12,10846)])],[([18],[(.D11,3904520),(.D13,0),(.D16,5251893),(.D16,3217840)])],[([565222],[(.D17,3904519),(.D12,5251894),(.D17,3217840),(.D6,37540),(.D16,274774),(.D6,1225161164),(.D12,10721),(.D13,10846),(.D9,658),(.D13,3)])]], + .ms [(.m2,.s6,3145678)], + .ms2 .s6 .s7 [(.m3,3833866,5234232),(.m0,3213424,36436),(.m0,274498,1225161095)], + .ms [(.m3,.s6,10705)], + .ms2 .s6 .s7 [(.m6,10841,658)], + .ms2 .s3 .s0 [(.m19,658,10841)], + .ms [(.m17,.s0,10705)], + .ms2 .s3 .s0 [(.m4,1225161095,274498),(.m1,36436,3213424),(.m1,5234232,3833866)], + .ms [(.m1,.s3,3145672),(.m10,.s7,3145678),(.m8,.s2,3145673)], + .m .m9, + .b 0 [[([2654204],[(.D7,3145678),(.D17,3833866),(.D6,5234232),(.D16,3213424),(.D6,36436),(.D16,274498),(.D6,1225161095),(.D6,10705),(.D12,10841),(.D6,658),(.D16,4)])]], + .ms [(.m2,.s6,1327102),(.m3,.s6,2813902)], + .ms2 .s6 .s7 [(.m3,3750922,5213496),(.m0,3208240,35140),(.m0,274174,1225161014)], + .ms [(.m12,.s7,10683),(.m0,.s6,10837),(.m3,.s6,656),(.m20,.s0,656),(.m1,.s3,10837),(.m4,.s3,10683)], + .ms2 .s3 .s0 [(.m13,1225161014,274174),(.m1,35140,3208240),(.m1,5213496,3750922)], + .ms [(.m1,.s3,2813902),(.m4,.s3,1327096),(.m10,.s7,1327102),(.m8,.s2,1327097)], + .m .m9, + .b 0 [[([5308406,2654205,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,1327102),(.D17,2813902)]),([663550],[(.D16,3750922),(.D6,5213496),(.D16,3208240),(.D6,35140),(.D16,274174),(.D6,1225161014),(.D12,10683),(.D16,10837),(.D16,656),(.D6,5)])]], + .ms [(.m2,.s6,5308405),(.m14,.s5,5308399)], + .m .m5, + .b 5308405 [[([5],[(.D18,1),(.D15,2482125),(.D14,3667978)])]], + .ms [(.m2,.s6,5308408),(.m7,.s5,5308402)], + .m .m5, + .b 5308408 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,5308409),(.m15,.s5,5308403)], + .m .m5, + .b 5308409 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,5308410),(.m25,.s2,5308405)], + .m .m18, + .b 5308410 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,5308412),(.m14,.s5,5308406)], + .m .m5, + .b 5308412 [[([5],[(.D18,1),(.D17,2482124),(.D15,3667978),(.D17,5192760),(.D15,3203056),(.D17,33844),(.D15,273850),(.D17,1225160933),(.D17,10664),(.D8,10831)])]], + .ms [(.m2,.s6,5308415),(.m7,.s5,5308409)], + .m .m5, + .b 5308415 [[([3637245],[(.D8,2482124),(.D16,3667978),(.D6,5192760),(.D16,3203056),(.D6,33844),(.D16,273850),(.D6,1225160933),(.D6,10665),(.D9,10831),(.D14,654),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,7127038,2027470),(.m0,3554314,5164344),(.m0,3195952,32068),(.m0,273406,1225160822)], + .ms [(.m12,.s7,10635),(.m0,.s6,10825),(.m3,.s6,653),(.m21,.s3,653),(.m4,.s3,10825),(.m4,.s3,10635)], + .ms2 .s3 .s0 [(.m13,1225160822,273406),(.m1,32068,3195952),(.m1,5164344,3554314),(.m1,2027470,7127033)], + .ms [(.m26,.s7,7127038),(.m8,.s2,7127033)], + .m .m9, + .b 0 [[([14548988],[(.D7,7127038),(.D7,2027469),(.D16,3554314),(.D6,5164344),(.D16,3195952),(.D6,32068),(.D16,273406),(.D6,1225160822),(.D12,10635),(.D16,10825),(.D16,653),(.D12,3)])]], + .ms [(.m2,.s6,7274494)], + .ms2 .s6 .s7 [(.m3,5308414,1572814),(.m0,3440650,5135928),(.m0,3188848,30292),(.m0,272962,1225160711)], + .ms [(.m3,.s6,10609)], + .ms2 .s6 .s7 [(.m6,10817,652)], + .ms2 .s3 .s0 [(.m19,652,10817)], + .ms [(.m17,.s0,10609)], + .ms2 .s3 .s0 [(.m4,1225160711,272962),(.m1,30292,3188848),(.m1,5135928,3440650),(.m1,1572814,5308414)], + .ms [(.m1,.s3,7274488),(.m10,.s7,7274494),(.m8,.s2,7274489)], + .m .m9, + .b 0 [[([29097974,13369350],[(.D7,7274494),(.D17,5308414)]),([2654207],[(.D6,1572814),(.D16,3440650),(.D6,5135928),(.D16,3188848),(.D6,30292),(.D16,272962),(.D6,1225160711),(.D6,10609),(.D12,10817),(.D6,652),(.D16,4)])]], + .ms [(.m2,.s6,21233662),(.m3,.s6,1966078)], + .ms2 .s6 .s7 [(.m3,3981310,1241038),(.m0,3357706,5115192),(.m0,3183664,28996),(.m0,272638,1225160630)], + .ms [(.m12,.s7,10587),(.m0,.s6,10813),(.m3,.s6,650),(.m20,.s0,650),(.m1,.s3,10813),(.m4,.s3,10587)], + .ms2 .s3 .s0 [(.m13,1225160630,272638),(.m1,28996,3183664),(.m1,5115192,3357706),(.m1,1241038,3981310)], + .ms [(.m1,.s3,1966078),(.m4,.s3,21233656),(.m10,.s7,21233662),(.m8,.s2,21233657)], + .m .m9, + .b 0 [[([58982360],[(.D7,21233662)]),([7864310,3932159,1966080,983040],[(.D17,1966078),(.D16,3981310)]),([921599],[(.D6,1241038),(.D16,3357706),(.D6,5115192),(.D16,3183664),(.D6,28996),(.D16,272638),(.D6,1225160630),(.D12,10587),(.D16,10813),(.D16,650),(.D6,5)])]], + ] (by decide +kernel) +theorem chunk_6_step : (cfg_6.denote) [qi]⊢* (cfg_7.denote) := + step_chunk [ + .b 29491180 [[([3932124],[(.D15,13860866)]),([491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D6,122880),(.D14,3520510)]),([61439],[(.D17,1125838),(.D15,3328906),(.D17,5107992),(.D15,3181864),(.D17,28546),(.D15,272525),(.D14,1225160601),(.D7,10581)])]], + .ms [(.m2,.s6,31457242),(.m3,.s6,13369351),(.m14,.s5,13369351),(.m4,.s5,31457236)], + .m .m5, + .b 31457242 [[([23],[(.D16,13369351),(.D18,1),(.D15,3489789),(.D16,1118158)])]], + .ms [(.m2,.s6,31457254),(.m3,.s6,13369348),(.m7,.s5,13369348),(.m4,.s5,31457248)], + .m .m5, + .b 31457254 [[([7],[(.D16,13369348),(.D6,1)])]], + .ms [(.m2,.s6,31457258),(.m6,.s6,13369346),(.m15,.s5,13369346),(.m11,.s5,31457252)], + .m .m5, + .b 31457258 [[([5],[(.D12,13369346),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,31457261,13369347)], + .ms [(.m23,.s1,13369347),(.m22,.s4,31457255)], + .m .m24, + .b 31457261 [[([17],[(.D6,13369347),(.D6,2)])]], + .ms [(.m2,.s6,31457270),(.m6,.s6,13369343),(.m14,.s5,13369343),(.m11,.s5,31457264)], + .m .m5, + .b 31457270 [[([23],[(.D12,13369343),(.D18,1),(.D17,3489788),(.D17,1118158),(.D15,3326986),(.D17,5107512),(.D15,3181744),(.D17,28516),(.D15,272518),(.D17,1225160600),(.D11,10579),(.D6,10812)])]], + .ms [(.m2,.s6,31457282),(.m6,.s6,13369340),(.m7,.s5,13369340),(.m11,.s5,31457276)], + .m .m5, + .b 31457282 [[([53477361,26738685,4718601],[(.D12,13369340),(.D8,3489788),(.D6,1118158),(.D16,3326986)]),([331775],[(.D6,5107512),(.D16,3181744),(.D6,28516),(.D16,272518),(.D6,1225160600),(.D12,10580),(.D7,10811),(.D8,649),(.D7,4)])]], + .ms [(.m2,.s6,73924606)], + .ms2 .s6 .s7 [(.m3,2752510,835582)], + .ms [(.m3,.s6,454606)], + .ms2 .s6 .s7 [(.m3,3161098,5066040),(.m0,3171376,25924),(.m0,271870,1225160438)], + .ms [(.m12,.s7,10539),(.m0,.s6,10801),(.m3,.s6,647),(.m21,.s3,647),(.m4,.s3,10801),(.m4,.s3,10539)], + .ms2 .s3 .s0 [(.m13,1225160438,271870),(.m1,25924,3171376),(.m1,5066040,3161098),(.m1,454606,835582)], + .ms [(.m4,.s3,2752510),(.m4,.s3,73924600),(.m10,.s7,73924606),(.m8,.s2,73924601)], + .m .m9, + .b 0 [[([88080308],[(.D7,73924606)]),([11010038,5505023,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,2752510),(.D6,835582),(.D6,454606)]),([344063],[(.D16,3161098),(.D6,5066040),(.D16,3171376),(.D6,25924),(.D16,271870),(.D6,1225160438),(.D12,10539),(.D16,10801),(.D16,647),(.D12,3)])],[([8],[(.D15,62914567),(.D21,0),(.D19,147453)])]], + .ms [(.m2,.s6,44040158),(.m6,.s6,62914565),(.m7,.s5,62914565),(.m11,.s5,44040152)], + .m .m5, + .b 44040158 [[([41],[(.D12,62914565),(.D8,1),(.D7,147452)])],[([3538822],[(.D17,62914561),(.D2,147450)])]], + .ms [(.m2,.s6,45809590),(.m3,.s6,62472208),(.m27,.s2,62472208),(.m1,.s5,45809584)], + .m .m5, + .b 45809590 [[([7],[(.D16,62472208),(.D6,1)])],[([16],[(.D11,62472206),(.D13,0),(.D6,1)])],[([8],[(.D15,62472205),(.D17,1),(.D15,0),(.D6,282574)])],[([16],[(.D11,62472203),(.D3,0)])],[([8],[(.D15,62472202),(.D17,1),(.D21,282573),(.D15,3118090),(.D17,5055288),(.D15,3168688),(.D17,25252),(.D15,271702),(.D17,1225160396),(.D11,10528),(.D12,10798)])],[([18],[(.D11,62472200),(.D13,0),(.D16,282573),(.D16,3118090)])],[([9042372],[(.D17,62472199)]),([1130299,565151,282576,141288,70644,35319,17661,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,282574),(.D17,3118090)]),([141287],[(.D6,5055288),(.D16,3168688),(.D6,25252),(.D16,271702),(.D6,1225160396),(.D12,10529),(.D13,10798),(.D9,646),(.D13,3)])],[([10],[(.D17,61341903),(.D21,0),(.D19,3047446)])]], + .ms [(.m2,.s6,50330818),(.m3,.s6,61341901),(.m7,.s5,61341901),(.m4,.s5,50330812)], + .m .m5, + .b 50330818 [[([43],[(.D16,61341901),(.D8,1),(.D7,3047445)])],[([73138650],[(.D11,61341894),(.D2,3047443)])]], + .ms2 .s6 .s7 [(.m2,86900165,52199565)], + .ms [(.m29,.s2,52199565),(.m4,.s5,86900159)], + .m .m5, + .b 86900165 [[([9],[(.D6,52199565),(.D6,1)])],[([20],[(.D15,52199563),(.D13,0),(.D10,5037626),(.D9,3164272)])],[([36],[(.D11,52199559)]),([7,2],[(.D12,1),(.D6,5037626)])]], + .ms [(.m2,.s6,86900198),(.m6,.s6,52199555),(.m15,.s5,52199555),(.m11,.s5,86900192)], + .m .m5, + .b 86900198 [[([5],[(.D12,52199555),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,86900201,52199556)], + .ms [(.m23,.s1,52199556),(.m22,.s4,86900195)], + .m .m24, + .b 86900201 [[([17],[(.D6,52199556),(.D6,2)])],[([6],[(.D11,52199552),(.D21,0),(.D7,5037624)])]], + .ms2 .s6 .s7 [(.m2,86900213,52199553)], + .ms2 .s5 .s2 [(.m28,52199553,86900208)], + .m .m18, + .b 86900213 [[([45],[(.D6,52199553),(.D8,1),(.D17,5037623),(.D10,3164271)])],[([36],[(.D15,52199546)]),([7,2],[(.D12,1),(.D17,5037622)]),([1],[(.D11,3164271),(.D16,24148)])],[([8],[(.D15,52199542),(.D21,0),(.D17,5037621),(.D12,3164272)])]], + .ms [(.m2,.s6,86900258),(.m6,.s6,52199540),(.m7,.s5,52199540),(.m11,.s5,86900252)], + .m .m5, + .b 86900258 [[([39],[(.D12,52199540),(.D8,5037622),(.D13,3164272),(.D17,24148),(.D15,271426),(.D17,1225160327),(.D17,10513),(.D11,10793),(.D17,646),(.D15,3)])]], + .ms [(.m2,.s6,86900278)], + .ms2 .s6 .s7 [(.m3,52199536,5037622),(.m0,3164272,24148),(.m0,271426,1225160327)], + .ms [(.m3,.s6,10513)], + .ms2 .s6 .s7 [(.m6,10793,646)], + .ms2 .s3 .s0 [(.m19,646,10793)], + .ms [(.m17,.s0,10513)], + .ms2 .s3 .s0 [(.m4,1225160327,271426),(.m1,24148,3164272),(.m1,5037622,52199536)], + .ms [(.m1,.s3,86900272),(.m10,.s7,86900278),(.m8,.s2,86900273)], + .m .m9, + .b 0 [[([2654204],[(.D7,86900278),(.D17,52199536),(.D6,5037622),(.D16,3164272),(.D6,24148),(.D16,271426),(.D6,1225160327),(.D6,10513),(.D12,10793),(.D6,646),(.D16,4)])]], + .ms [(.m2,.s6,1327102),(.m3,.s6,86568502)], + .ms2 .s6 .s7 [(.m3,52116592,5016886),(.m0,3159088,22852),(.m0,271102,1225160246)], + .ms [(.m12,.s7,10491),(.m0,.s6,10789),(.m3,.s6,644),(.m20,.s0,644),(.m1,.s3,10789),(.m4,.s3,10491)], + .ms2 .s3 .s0 [(.m13,1225160246,271102),(.m1,22852,3159088),(.m1,5016886,52116592)], + .ms [(.m1,.s3,86568502),(.m4,.s3,1327096),(.m10,.s7,1327102),(.m8,.s2,1327097)], + .m .m9, + .b 0 [[([5308406,2654205,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,1327102),(.D17,86568502)]),([663550],[(.D16,52116592),(.D6,5016886),(.D16,3159088),(.D6,22852),(.D16,271102),(.D6,1225160246),(.D12,10491),(.D16,10789),(.D16,644),(.D6,5)])]], + .ms [(.m2,.s6,5308405),(.m14,.s5,5308399)], + .m .m5, + .b 5308405 [[([5],[(.D18,1),(.D15,86236725),(.D14,52033648)])]], + .ms [(.m2,.s6,5308408),(.m7,.s5,5308402)], + .m .m5, + .b 5308408 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,5308409),(.m15,.s5,5308403)], + .m .m5, + .b 5308409 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,5308410),(.m25,.s2,5308405)], + .m .m18, + .b 5308410 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,5308412),(.m14,.s5,5308406)], + .m .m5, + .b 5308412 [[([5],[(.D18,1),(.D17,86236724),(.D15,52033648),(.D17,4996150),(.D15,3153904),(.D17,21556),(.D15,270778),(.D17,1225160165),(.D17,10472),(.D8,10783)])]], + .ms [(.m2,.s6,5308415),(.m7,.s5,5308409)], + .m .m5, + .b 5308415 [[([3637245],[(.D8,86236724),(.D16,52033648),(.D6,4996150),(.D16,3153904),(.D6,21556),(.D16,270778),(.D6,1225160165),(.D6,10473),(.D9,10783),(.D14,642),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,7127038,85782070),(.m0,51919984,4967734),(.m0,3146800,19780),(.m0,270334,1225160054)], + .ms [(.m12,.s7,10443),(.m0,.s6,10777),(.m3,.s6,641),(.m21,.s3,641),(.m4,.s3,10777),(.m4,.s3,10443)], + .ms2 .s3 .s0 [(.m13,1225160054,270334),(.m1,19780,3146800),(.m1,4967734,51919984),(.m1,85782070,7127033)], + .ms [(.m26,.s7,7127038),(.m8,.s2,7127033)], + .m .m9, + .b 0 [[([14548988],[(.D7,7127038),(.D7,85782069),(.D16,51919984),(.D6,4967734),(.D16,3146800),(.D6,19780),(.D16,270334),(.D6,1225160054),(.D12,10443),(.D16,10777),(.D16,641),(.D12,3)])]], + .ms [(.m2,.s6,7274494)], + .ms2 .s6 .s7 [(.m3,5308414,85327414),(.m0,51806320,4939318),(.m0,3139696,18004),(.m0,269890,1225159943)], + .ms [(.m3,.s6,10417)], + .ms2 .s6 .s7 [(.m6,10769,640)], + .ms2 .s3 .s0 [(.m19,640,10769)], + .ms [(.m17,.s0,10417)], + .ms2 .s3 .s0 [(.m4,1225159943,269890),(.m1,18004,3139696),(.m1,4939318,51806320),(.m1,85327414,5308414)], + .ms [(.m1,.s3,7274488),(.m10,.s7,7274494),(.m8,.s2,7274489)], + .m .m9, + .b 0 [[([29097974,13369350],[(.D7,7274494),(.D17,5308414)]),([2654207],[(.D6,85327414),(.D16,51806320),(.D6,4939318),(.D16,3139696),(.D6,18004),(.D16,269890),(.D6,1225159943),(.D6,10417),(.D12,10769),(.D6,640),(.D16,4)])]], + .ms [(.m2,.s6,21233662),(.m3,.s6,1966078)], + .ms2 .s6 .s7 [(.m3,3981310,84995638),(.m0,51723376,4918582),(.m0,3134512,16708),(.m0,269566,1225159862)], + .ms [(.m12,.s7,10395),(.m0,.s6,10765),(.m3,.s6,638),(.m20,.s0,638),(.m1,.s3,10765),(.m4,.s3,10395)], + .ms2 .s3 .s0 [(.m13,1225159862,269566),(.m1,16708,3134512),(.m1,4918582,51723376),(.m1,84995638,3981310)], + .ms [(.m1,.s3,1966078),(.m4,.s3,21233656),(.m10,.s7,21233662),(.m8,.s2,21233657)], + .m .m9, + .b 0 [[([62914484],[(.D7,21233662)]),([7864310,3932159,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,1966078),(.D16,3981310)]),([983038],[(.D6,84995638),(.D16,51723376),(.D6,4918582),(.D16,3134512),(.D6,16708),(.D16,269566),(.D6,1225159862),(.D12,10395),(.D16,10765),(.D16,638),(.D6,5)])]], + .ms [(.m2,.s6,31457242),(.m3,.s6,13369351),(.m14,.s5,13369351),(.m4,.s5,31457236)], + .m .m5, + .b 31457242 [[([23],[(.D16,13369351),(.D18,1),(.D15,3489789),(.D16,84872758)])]], + .ms [(.m2,.s6,31457254),(.m3,.s6,13369348),(.m7,.s5,13369348),(.m4,.s5,31457248)], + .m .m5, + .b 31457254 [[([7],[(.D16,13369348),(.D6,1)])]], + .ms [(.m2,.s6,31457258),(.m6,.s6,13369346),(.m15,.s5,13369346),(.m11,.s5,31457252)], + .m .m5, + .b 31457258 [[([5],[(.D12,13369346),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,31457261,13369347)], + .ms [(.m23,.s1,13369347),(.m22,.s4,31457255)], + .m .m24, + .b 31457261 [[([17],[(.D6,13369347),(.D6,2)])]], + .ms [(.m2,.s6,31457270),(.m6,.s6,13369343),(.m14,.s5,13369343),(.m11,.s5,31457264)], + .m .m5, + .b 31457270 [[([23],[(.D12,13369343),(.D18,1),(.D17,3489788),(.D17,84872758),(.D15,51692656),(.D17,4910902),(.D15,3132592),(.D17,16228),(.D15,269446),(.D17,1225159832),(.D11,10387),(.D6,10764)])]], + .ms [(.m2,.s6,31457282),(.m6,.s6,13369340),(.m7,.s5,13369340),(.m11,.s5,31457276)], + .m .m5, + .b 31457282 [[([53477361,26738685,4718601],[(.D12,13369340),(.D8,3489788),(.D6,84872758)]),([1327103],[(.D16,51692656),(.D6,4910902),(.D16,3132592),(.D6,16228),(.D16,269446),(.D6,1225159832),(.D12,10388),(.D7,10763),(.D8,637),(.D7,4)])]], + .ms [(.m2,.s6,73924606)], + .ms2 .s6 .s7 [(.m3,2752510,835582)], + .ms [(.m3,.s6,84209206)], + .ms2 .s6 .s7 [(.m3,51526768,4869430),(.m0,3122224,13636),(.m0,268798,1225159670)], + .ms [(.m12,.s7,10347),(.m0,.s6,10753),(.m3,.s6,635),(.m21,.s3,635),(.m4,.s3,10753),(.m4,.s3,10347)], + .ms2 .s3 .s0 [(.m13,1225159670,268798),(.m1,13636,3122224),(.m1,4869430,51526768),(.m1,84209206,835582)], + .ms [(.m4,.s3,2752510),(.m4,.s3,73924600),(.m10,.s7,73924606),(.m8,.s2,73924601)], + .m .m9, + .b 0 [[([88080308],[(.D7,73924606)]),([11010038,5505023,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,2752510),(.D6,835582),(.D6,84209206)]),([344063],[(.D16,51526768),(.D6,4869430),(.D16,3122224),(.D6,13636),(.D16,268798),(.D6,1225159670),(.D12,10347),(.D16,10753),(.D16,635),(.D12,3)])],[([8],[(.D15,62914567),(.D21,0),(.D19,147453)])]], + .ms [(.m2,.s6,44040158),(.m6,.s6,62914565),(.m7,.s5,62914565),(.m11,.s5,44040152)], + .m .m5, + .b 44040158 [[([41],[(.D12,62914565),(.D8,1),(.D7,147452)])],[([3538822],[(.D17,62914561),(.D2,147450)])]], + .ms [(.m2,.s6,45809590),(.m3,.s6,62472208),(.m27,.s2,62472208),(.m1,.s5,45809584)], + .m .m5, + .b 45809590 [[([7],[(.D16,62472208),(.D6,1)])],[([16],[(.D11,62472206),(.D13,0),(.D6,1)])],[([8],[(.D15,62472205),(.D17,1),(.D15,0),(.D6,84037174)])],[([16],[(.D11,62472203),(.D3,0)])],[([8],[(.D15,62472202),(.D17,1),(.D21,84037173),(.D15,51483760),(.D17,4858678),(.D15,3119536),(.D17,12964),(.D15,268630),(.D17,1225159628),(.D11,10336),(.D12,10750)])],[([18],[(.D11,62472200),(.D13,0),(.D16,84037173),(.D16,51483760)])],[([9043942],[(.D17,62472199),(.D12,84037174),(.D17,51483760),(.D6,4858678),(.D16,3119536),(.D6,12964),(.D16,268630),(.D6,1225159628),(.D12,10337),(.D13,10750),(.D9,634),(.D13,3)])]], + .ms [(.m2,.s6,50331598)], + .ms2 .s6 .s7 [(.m3,61341706,83754552),(.m0,51413104,4841014),(.m0,3115120,11860),(.m0,268354,1225159559)], + .ms [(.m3,.s6,10321)], + .ms2 .s6 .s7 [(.m6,10745,634)], + .ms2 .s3 .s0 [(.m19,634,10745)], + .ms [(.m17,.s0,10321)], + .ms2 .s3 .s0 [(.m4,1225159559,268354),(.m1,11860,3115120),(.m1,4841014,51413104),(.m1,83754552,61341706)], + .ms [(.m1,.s3,50331592),(.m10,.s7,50331598),(.m8,.s2,50331593)], + .m .m9, + .b 0 [[([42467324],[(.D7,50331598),(.D17,61341706),(.D6,83754552),(.D16,51413104),(.D6,4841014),(.D16,3115120),(.D6,11860),(.D16,268354),(.D6,1225159559),(.D6,10321),(.D12,10745),(.D6,634),(.D16,4)])]], + .ms [(.m2,.s6,21233662),(.m3,.s6,45023182)], + .ms2 .s6 .s7 [(.m3,60014602,83422776),(.m0,51330160,4820278),(.m0,3109936,10564),(.m0,268030,1225159478)], + .ms [(.m12,.s7,10299),(.m0,.s6,10741),(.m3,.s6,632),(.m20,.s0,632),(.m1,.s3,10741),(.m4,.s3,10299)], + .ms2 .s3 .s0 [(.m13,1225159478,268030),(.m1,10564,3109936),(.m1,4820278,51330160),(.m1,83422776,60014602)], + .ms [(.m1,.s3,45023182),(.m4,.s3,21233656),(.m10,.s7,21233662),(.m8,.s2,21233657)], + .m .m9, + .b 0 [[([84934646,42467325,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,21233662),(.D17,45023182)]),([10616830],[(.D16,60014602),(.D6,83422776),(.D16,51330160),(.D6,4820278),(.D16,3109936),(.D6,10564),(.D16,268030),(.D6,1225159478),(.D12,10299),(.D16,10741),(.D16,632),(.D6,5)])]], + .ms [(.m2,.s6,84934645),(.m14,.s5,84934639)], + .m .m5, + .b 84934645 [[([5],[(.D18,1),(.D15,39714765),(.D14,58687498)])]], + .ms [(.m2,.s6,84934648),(.m7,.s5,84934642)], + .m .m5, + .b 84934648 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,84934649),(.m15,.s5,84934643)], + .m .m5, + .b 84934649 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,84934650),(.m25,.s2,84934645)], + .m .m18, + .b 84934650 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,84934652),(.m14,.s5,84934646)], + .m .m5, + .b 84934652 [[([5],[(.D18,1),(.D17,39714764),(.D15,58687498),(.D17,83091000),(.D15,51247216),(.D17,4799542),(.D15,3104752),(.D17,9268),(.D15,267706),(.D17,1225159397),(.D17,10280),(.D8,10735)])]], + .ms [(.m2,.s6,84934655),(.m7,.s5,84934649)], + .m .m5, + .b 84934655 [[([58195965],[(.D8,39714764),(.D16,58687498),(.D6,83091000),(.D16,51247216),(.D6,4799542),(.D16,3104752),(.D6,9268),(.D16,267706),(.D6,1225159397),(.D6,10281),(.D9,10735),(.D14,630),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,114032638,32440270),(.m0,56868874,82636344),(.m0,51133552,4771126),(.m0,3097648,7492),(.m0,267262,1225159286)], + .ms [(.m12,.s7,10251),(.m0,.s6,10729),(.m3,.s6,629),(.m21,.s3,629),(.m4,.s3,10729),(.m4,.s3,10251)], + .ms2 .s3 .s0 [(.m13,1225159286,267262),(.m1,7492,3097648),(.m1,4771126,51133552),(.m1,82636344,56868874),(.m1,32440270,114032633)], + .ms [(.m26,.s7,114032638),(.m8,.s2,114032633)], + .m .m9, + .b 0 [[([232783868],[(.D7,114032638),(.D7,32440269),(.D16,56868874),(.D6,82636344),(.D16,51133552),(.D6,4771126),(.D16,3097648),(.D6,7492),(.D16,267262),(.D6,1225159286),(.D12,10251),(.D16,10729),(.D16,629),(.D12,3)])]], + .ms [(.m2,.s6,116391934)], + .ms2 .s6 .s7 [(.m3,84934654,25165774),(.m0,55050250,82181688),(.m0,51019888,4742710),(.m0,3090544,5716),(.m0,266818,1225159175)], + .ms [(.m3,.s6,10225)], + .ms2 .s6 .s7 [(.m6,10721,628)], + .ms [(.m19,.s3,628)], + ] (by decide +kernel) +theorem chunk_7_step : (cfg_7.denote) [qi]⊢* (cfg_8.denote) := + step_chunk [ + .s .s0 10721, + .ms [(.m17,.s0,10225)], + .ms2 .s3 .s0 [(.m4,1225159175,266818),(.m1,5716,3090544),(.m1,4742710,51019888),(.m1,82181688,55050250),(.m1,25165774,84934654)], + .ms [(.m1,.s3,116391928),(.m10,.s7,116391934),(.m8,.s2,116391929)], + .m .m9, + .b 0 [[([465567734,213909510],[(.D7,116391934),(.D17,84934654)]),([42467327],[(.D6,25165774),(.D16,55050250),(.D6,82181688),(.D16,51019888),(.D6,4742710),(.D16,3090544),(.D6,5716),(.D16,266818),(.D6,1225159175),(.D6,10225),(.D12,10721),(.D6,628),(.D16,4)])]], + .ms [(.m2,.s6,339738622),(.m3,.s6,31457278)], + .ms2 .s6 .s7 [(.m3,63700990,19857358),(.m0,53723146,81849912),(.m0,50936944,4721974),(.m0,3085360,4420),(.m0,266494,1225159094)], + .ms [(.m12,.s7,10203),(.m0,.s6,10717),(.m3,.s6,626),(.m20,.s0,626),(.m1,.s3,10717),(.m4,.s3,10203)], + .ms2 .s3 .s0 [(.m13,1225159094,266494),(.m1,4420,3085360),(.m1,4721974,50936944),(.m1,81849912,53723146),(.m1,19857358,63700990)], + .ms [(.m1,.s3,31457278),(.m4,.s3,339738616),(.m10,.s7,339738622),(.m8,.s2,339738617)], + .m .m9, + .b 0 [[([1006632884],[(.D7,339738622)]),([125829110,62914559,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,31457278),(.D16,63700990)]),([15728638],[(.D6,19857358),(.D16,53723146),(.D6,81849912),(.D16,50936944),(.D6,4721974),(.D16,3085360),(.D6,4420),(.D16,266494),(.D6,1225159094),(.D12,10203),(.D16,10717),(.D16,626),(.D6,5)])]], + .ms [(.m2,.s6,503316442),(.m3,.s6,213909511),(.m14,.s5,213909511),(.m4,.s5,503316436)], + .m .m5, + .b 503316442 [[([23],[(.D16,213909511),(.D18,1),(.D15,55836669),(.D16,17891278)])]], + .ms [(.m2,.s6,503316454),(.m3,.s6,213909508),(.m7,.s5,213909508),(.m4,.s5,503316448)], + .m .m5, + .b 503316454 [[([7],[(.D16,213909508),(.D6,1)])]], + .ms [(.m2,.s6,503316458),(.m6,.s6,213909506),(.m15,.s5,213909506),(.m11,.s5,503316452)], + .m .m5, + .b 503316458 [[([5],[(.D12,213909506),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,503316461,213909507)], + .ms [(.m23,.s1,213909507),(.m22,.s4,503316455)], + .m .m24, + .b 503316461 [[([17],[(.D6,213909507),(.D6,2)])]], + .ms [(.m2,.s6,503316470),(.m6,.s6,213909503),(.m14,.s5,213909503),(.m11,.s5,503316464)], + .m .m5, + .b 503316470 [[([23],[(.D12,213909503),(.D18,1),(.D17,55836668),(.D17,17891278),(.D15,53231626),(.D17,81727032),(.D15,50906224),(.D17,4714294),(.D15,3083440),(.D17,3940),(.D15,266374),(.D17,1225159064),(.D11,10195),(.D6,10716)])]], + .ms [(.m2,.s6,503316482),(.m6,.s6,213909500),(.m7,.s5,213909500),(.m11,.s5,503316476)], + .m .m5, + .b 503316482 [[([855638001,427819005,75497481],[(.D12,213909500),(.D8,55836668),(.D6,17891278),(.D16,53231626)]),([5308415],[(.D6,81727032),(.D16,50906224),(.D6,4714294),(.D16,3083440)]),([13055,7680],[(.D6,3940),(.D16,266374)]),([1295],[(.D6,1225159064),(.D12,10196),(.D7,10715),(.D8,625),(.D7,4)])]], + .ms [(.m2,.s6,1182793726)], + .ms2 .s6 .s7 [(.m3,44040190,13369342)], + .ms [(.m3,.s6,7274446)], + .ms2 .s6 .s7 [(.m3,50577418,81063480),(.m0,50740336,4672822),(.m0,3073072,1348),(.m0,265726,1225158902)], + .ms [(.m12,.s7,10155),(.m0,.s6,10705),(.m3,.s6,623),(.m21,.s3,623),(.m4,.s3,10705),(.m4,.s3,10155)], + .ms2 .s3 .s0 [(.m13,1225158902,265726),(.m1,1348,3073072),(.m1,4672822,50740336),(.m1,81063480,50577418),(.m1,7274446,13369342)], + .ms [(.m4,.s3,44040190),(.m4,.s3,1182793720),(.m10,.s7,1182793726),(.m8,.s2,1182793721)], + .m .m9, + .b 0 [[([1409286068],[(.D7,1182793726)]),([176160758,88080383,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,44040190),(.D6,13369342),(.D6,7274446)]),([5505023],[(.D16,50577418),(.D6,81063480),(.D16,50740336),(.D6,4672822),(.D16,3073072),(.D6,1348),(.D16,265726),(.D6,1225158902),(.D12,10155),(.D16,10705),(.D16,623),(.D12,3)])],[([8],[(.D15,1006632967),(.D21,0),(.D19,2359293)])]], + .ms [(.m2,.s6,704643038),(.m6,.s6,1006632965),(.m7,.s5,1006632965),(.m11,.s5,704643032)], + .m .m5, + .b 704643038 [[([41],[(.D12,1006632965),(.D8,1),(.D7,2359292)])],[([56622982],[(.D17,1006632961),(.D2,2359290)])]], + .ms [(.m2,.s6,732954550),(.m3,.s6,999555088),(.m27,.s2,999555088),(.m1,.s5,732954544)], + .m .m5, + .b 732954550 [[([7],[(.D16,999555088), + (.D6,1)])], + [([16],[(.D11,999555086), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,999555085), + (.D17,1), + (.D15,0), + (.D6,4521934)])], + [([16],[(.D11,999555083), + (.D3,0)])], + [([8],[(.D15,999555082), + (.D17,1), + (.D21,4521933), + (.D15,49889290), + (.D17,80891448), + (.D15,50697328), + (.D17,4662070), + (.D15,3070384), + (.D17,676), + (.D15,265558), + (.D17,1225158860), + (.D11,10144), + (.D12,10702)])], + [([18],[(.D11,999555080), + (.D13,0), + (.D16,4521933), + (.D16,49889290)])], + [([88483404],[(.D17,999555079)]), + ([16615827,5505024],[(.D12,4521934), + (.D17,49889290)]), + ([1382553],[(.D6,80891448), + (.D16,50697328), + (.D6,4662070), + (.D16,3070384)]), + ([2701,1355,673,336,168,84,47,24,12],[(.D6,676), + (.D16,265558)]), + ([337],[(.D6,1225158860), + (.D12,10145), + (.D13,10702), + (.D9,622), + (.D13,3)])], + [([56218488],[(.D17,988494654)]), + ([7027312,3513659,1756827,878412,439209,219603,109800,54900,27453,13728,6864,3432,1716,855,429,216,108,51,24,12,9,3],[(.D15,1756828), + (.D17,49198014)]), + ([878414],[(.D15,80718628), + (.D17,50654124), + (.D15,4651268), + (.D17,3067684), + (.D2,265388)])], + [([10],[(.D17,981467343), + (.D21,0), + (.D19,48758806)])]], + .ms [(.m2,.s6,805305538),(.m3,.s6,981467341),(.m7,.s5,981467341),(.m4,.s5,805305532)], + .m .m5, + .b 805305538 [[([43],[(.D16,981467341),(.D8,1),(.D7,48758805)])],[([1170211290],[(.D11,981467334),(.D2,48758803)])]], + .ms2 .s6 .s7 [(.m2,1390411205,835190925)], + .ms [(.m29,.s2,835190925),(.m4,.s5,1390411199)], + .m .m5, + .b 1390411205 [[([9],[(.D6,835190925),(.D6,1)])],[([20],[(.D15,835190923),(.D13,0),(.D10,80608826),(.D9,50626672)])],[([36],[(.D11,835190919)]),([7,2],[(.D12,1),(.D6,80608826)])]], + .ms [(.m2,.s6,1390411238),(.m6,.s6,835190915),(.m15,.s5,835190915),(.m11,.s5,1390411232)], + .m .m5, + .b 1390411238 [[([5],[(.D12,835190915),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,1390411241,835190916)], + .ms [(.m23,.s1,835190916),(.m22,.s4,1390411235)], + .m .m24, + .b 1390411241 [[([17],[(.D6,835190916),(.D6,2)])],[([6],[(.D11,835190912),(.D21,0),(.D7,80608824)])]], + .ms2 .s6 .s7 [(.m2,1390411253,835190913)], + .ms2 .s5 .s2 [(.m28,835190913,1390411248)], + .m .m18, + .b 1390411253 [[([45],[(.D6,835190913),(.D8,1),(.D17,80608823),(.D10,50626671)])],[([36],[(.D15,835190906)]),([7,2],[(.D12,1),(.D17,80608822)]),([1],[(.D11,50626671),(.D16,4644406)])],[([8],[(.D15,835190902),(.D21,0),(.D17,80608821),(.D12,50626672)])]], + .ms [(.m2,.s6,1390411298),(.m6,.s6,835190900),(.m7,.s5,835190900),(.m11,.s5,1390411292)], + .m .m5, + .b 1390411298 [[([1627035687],[(.D12,835190900)]),([297241963,109516958],[(.D8,80608822),(.D13,50626672)]),([18577622,6844810],[(.D17,4644406),(.D15,3065968)]),([1588902],[(.D1,264817)])],[([2150],[(.D15,631811440),(.D17,29763958),(.D15,37915456),(.D17,1466602),(.D15,2271517),(.D17,1),(.D21,0),(.D17,1225158817),(.D12,10134)])],[([4608],[(.D17,631811172),(.D15,29763890),(.D17,37915440),(.D15,1466597),(.D11,2271515),(.D13,0),(.D18,1225158818)])],[([9216],[(.D17,631810596),(.D15,29763746),(.D17,37915404),(.D15,1466588),(.D17,2271514)]),([7,2],[(.D12,1),(.D7,1225158817)])],[([2458],[(.D17,631809444),(.D15,29763458),(.D17,37915332),(.D15,1466570),(.D17,2271510),(.D21,0),(.D15,1225158816),(.D13,10134)])]], + .ms [(.m2,.s6,2203938358)], + .ms2 .s6 .s7 [(.m3,631809136,29763382),(.m0,37915312,1466566)], + .ms [(.m0,.s6,2271508),(.m7,.s5,2271508)], + .ms2 .s5 .s2 [(.m4,1466566,37915312),(.m1,29763382,631809136)], + .ms [(.m1,.s5,2203938352)], + .m .m5, + .b 2203938358 [[([2149],[(.D16,631809136),(.D6,29763382),(.D16,37915312),(.D6,1466566),(.D16,2271508),(.D6,1)])]], + .ms2 .s6 .s7 [(.m2,2203939433,631808868),(.m0,29763314,37915296)], + .ms [(.m0,.s6,1466561),(.m6,.s6,2271506),(.m15,.s5,2271506),(.m11,.s5,1466561)], + .ms2 .s5 .s2 [(.m4,37915296,29763314),(.m1,631808868,2203939428)], + .m .m18, + .b 2203939433 [[([1535],[(.D6,631808868),(.D16,29763314),(.D6,37915296),(.D16,1466561),(.D12,2271506),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,2203940201,631808676),(.m0,29763266,37915284),(.m0,1466558,2271507)], + .ms [(.m23,.s1,2271507),(.m22,.s4,1466558)], + .ms2 .s4 .s1 [(.m22,37915284,29763266),(.m72,631808676,2203940196)], + .m .m73, + .b 2203940201 [[([4607],[(.D6,631808676),(.D16,29763266),(.D6,37915284),(.D16,1466558),(.D6,2271507),(.D6,2)])]], + .ms2 .s6 .s7 [(.m2,2203942505,631808100),(.m0,29763122,37915248)], + .ms [(.m0,.s6,1466549),(.m6,.s6,2271503),(.m14,.s5,2271503),(.m11,.s5,1466549)], + .ms2 .s5 .s2 [(.m4,37915248,29763122),(.m1,631808100,2203942500)], + .m .m18, + .b 2203942505 [[([6143],[(.D6,631808100),(.D16,29763122),(.D6,37915248),(.D16,1466549),(.D12,2271503),(.D18,1),(.D17,1225158814),(.D14,10134)])]], + .ms2 .s6 .s7 [(.m2,2203945577,631807332),(.m0,29762930,37915200)], + .ms [(.m0,.s6,1466537),(.m6,.s6,2271500),(.m7,.s5,2271500),(.m11,.s5,1466537)], + .ms2 .s5 .s2 [(.m4,37915200,29762930),(.m1,631807332,2203945572)], + .m .m18, + .b 2203945577 [[([206745],[(.D6,631807332),(.D16,29762930),(.D6,37915200),(.D16,1466537),(.D12,2271500),(.D8,1225158815),(.D15,10134),(.D10,10698),(.D14,621),(.D14,3)])]], + .ms [(.m2,.s6,2204048950)], + .ms2 .s6 .s7 [(.m3,631781488,29756470),(.m0,37913584,1466134),(.m0,2271400,1225158791)], + .ms [(.m3,.s6,10129)], + .ms2 .s6 .s7 [(.m6,10697,622)], + .ms2 .s3 .s0 [(.m19,622,10697)], + .ms [(.m17,.s0,10129)], + .ms2 .s3 .s0 [(.m4,1225158791,2271400),(.m1,1466134,37913584),(.m1,29756470,631781488)], + .ms [(.m1,.s3,2204048944),(.m10,.s7,2204048950),(.m8,.s2,2204048945)], + .m .m9, + .b 0 [[([2654204],[(.D7,2204048950),(.D17,631781488),(.D6,29756470),(.D16,37913584),(.D6,1466134),(.D16,2271400),(.D6,1225158791),(.D6,10129),(.D12,10697),(.D6,622),(.D16,4)])]], + .ms [(.m2,.s6,1327102),(.m3,.s6,2203717174)], + .ms2 .s6 .s7 [(.m3,631698544,29735734),(.m0,37908400,1464838),(.m0,2271076,1225158710)], + .ms [(.m12,.s7,10107),(.m0,.s6,10693),(.m3,.s6,620),(.m20,.s0,620),(.m1,.s3,10693),(.m4,.s3,10107)], + .ms2 .s3 .s0 [(.m13,1225158710,2271076),(.m1,1464838,37908400),(.m1,29735734,631698544)], + .ms [(.m1,.s3,2203717174),(.m4,.s3,1327096),(.m10,.s7,1327102),(.m8,.s2,1327097)], + .m .m9, + .b 0 [[([5308406,2654205,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,1327102),(.D17,2203717174)]),([663550],[(.D16,631698544),(.D6,29735734),(.D16,37908400),(.D6,1464838),(.D16,2271076),(.D6,1225158710),(.D12,10107),(.D16,10693),(.D16,620),(.D6,5)])]], + .ms [(.m2,.s6,5308405),(.m14,.s5,5308399)], + .m .m5, + .b 5308405 [[([5],[(.D18,1),(.D15,2203385397),(.D14,631615600)])]], + .ms [(.m2,.s6,5308408),(.m7,.s5,5308402)], + .m .m5, + .b 5308408 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,5308409),(.m15,.s5,5308403)], + .m .m5, + .b 5308409 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,5308410),(.m25,.s2,5308405)], + .m .m18, + .b 5308410 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,5308412),(.m14,.s5,5308406)], + .m .m5, + .b 5308412 [[([5],[(.D18,1),(.D17,2203385396),(.D15,631615600),(.D17,29714998),(.D15,37903216),(.D17,1463542),(.D15,2270752),(.D17,1225158629),(.D17,10088),(.D8,10687)])]], + .ms [(.m2,.s6,5308415),(.m7,.s5,5308409)], + .m .m5, + .b 5308415 [[([3637245],[(.D8,2203385396),(.D16,631615600),(.D6,29714998),(.D16,37903216),(.D6,1463542),(.D16,2270752),(.D6,1225158629),(.D6,10089),(.D9,10687),(.D14,618),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,7127038,2202930742),(.m0,631501936,29686582),(.m0,37896112,1461766),(.m0,2270308,1225158518)], + .ms [(.m12,.s7,10059),(.m0,.s6,10681),(.m3,.s6,617),(.m21,.s3,617),(.m4,.s3,10681),(.m4,.s3,10059)], + .ms2 .s3 .s0 [(.m13,1225158518,2270308),(.m1,1461766,37896112),(.m1,29686582,631501936),(.m1,2202930742,7127033)], + .ms [(.m26,.s7,7127038),(.m8,.s2,7127033)], + .m .m9, + .b 0 [[([14548988],[(.D7,7127038),(.D7,2202930741),(.D16,631501936),(.D6,29686582),(.D16,37896112),(.D6,1461766),(.D16,2270308),(.D6,1225158518),(.D12,10059),(.D16,10681),(.D16,617),(.D12,3)])]], + .ms [(.m2,.s6,7274494)], + .ms2 .s6 .s7 [(.m3,5308414,2202476086),(.m0,631388272,29658166),(.m0,37889008,1459990),(.m0,2269864,1225158407)], + .ms [(.m3,.s6,10033)], + .ms2 .s6 .s7 [(.m6,10673,616)], + .ms2 .s3 .s0 [(.m19,616,10673)], + .ms [(.m17,.s0,10033)], + .ms2 .s3 .s0 [(.m4,1225158407,2269864),(.m1,1459990,37889008),(.m1,29658166,631388272),(.m1,2202476086,5308414)], + .ms [(.m1,.s3,7274488),(.m10,.s7,7274494),(.m8,.s2,7274489)], + .m .m9, + .b 0 [[([29097974,13369350],[(.D7,7274494),(.D17,5308414)]),([2654207],[(.D6,2202476086),(.D16,631388272),(.D6,29658166),(.D16,37889008),(.D6,1459990),(.D16,2269864),(.D6,1225158407),(.D6,10033),(.D12,10673),(.D6,616),(.D16,4)])]], + .ms [(.m2,.s6,21233662),(.m3,.s6,1966078)], + .ms2 .s6 .s7 [(.m3,3981310,2202144310),(.m0,631305328,29637430),(.m0,37883824,1458694),(.m0,2269540,1225158326)], + .ms [(.m12,.s7,10011),(.m0,.s6,10669),(.m3,.s6,614),(.m20,.s0,614),(.m1,.s3,10669),(.m4,.s3,10011)], + .ms2 .s3 .s0 [(.m13,1225158326,2269540),(.m1,1458694,37883824),(.m1,29637430,631305328),(.m1,2202144310,3981310)], + .ms [(.m1,.s3,1966078),(.m4,.s3,21233656),(.m10,.s7,21233662),(.m8,.s2,21233657)], + .m .m9, + .b 0 [[([62914484],[(.D7,21233662)]),([7864310,3932159,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,1966078),(.D16,3981310)]),([983038],[(.D6,2202144310),(.D16,631305328),(.D6,29637430),(.D16,37883824),(.D6,1458694),(.D16,2269540),(.D6,1225158326),(.D12,10011),(.D16,10669),(.D16,614),(.D6,5)])]], + .ms [(.m2,.s6,31457242),(.m3,.s6,13369351),(.m14,.s5,13369351),(.m4,.s5,31457236)], + .m .m5, + .b 31457242 [[([23],[(.D16,13369351),(.D18,1),(.D15,3489789),(.D16,2202021430)])]], + .ms [(.m2,.s6,31457254),(.m3,.s6,13369348),(.m7,.s5,13369348),(.m4,.s5,31457248)], + .m .m5, + .b 31457254 [[([7],[(.D16,13369348),(.D6,1)])]], + .ms [(.m2,.s6,31457258),(.m6,.s6,13369346),(.m15,.s5,13369346),(.m11,.s5,31457252)], + .m .m5, + .b 31457258 [[([5],[(.D12,13369346),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,31457261,13369347)], + .ms [(.m23,.s1,13369347),(.m22,.s4,31457255)], + .m .m24, + .b 31457261 [[([17],[(.D6,13369347),(.D6,2)])]], + .ms [(.m2,.s6,31457270),(.m6,.s6,13369343),(.m14,.s5,13369343),(.m11,.s5,31457264)], + .m .m5, + .b 31457270 [[([23],[(.D12,13369343),(.D18,1),(.D17,3489788),(.D17,2202021430),(.D15,631274608),(.D17,29629750),(.D15,37881904),(.D17,1458214),(.D15,2269420),(.D17,1225158296),(.D11,10003),(.D6,10668)])]], + .ms [(.m2,.s6,31457282),(.m6,.s6,13369340),(.m7,.s5,13369340),(.m11,.s5,31457276)], + .m .m5, + .b 31457282 [[([53477361,26738685,4718601],[(.D12,13369340),(.D8,3489788),(.D6,2202021430)]),([1327103],[(.D16,631274608),(.D6,29629750),(.D16,37881904),(.D6,1458214),(.D16,2269420),(.D6,1225158296),(.D12,10004),(.D7,10667),(.D8,613),(.D7,4)])]], + .ms [(.m2,.s6,73924606)], + .ms2 .s6 .s7 [(.m3,2752510,835582)], + .ms [(.m3,.s6,2201357878)], + .ms2 .s6 .s7 [(.m3,631108720,29588278),(.m0,37871536,1455622),(.m0,2268772,1225158134)], + .ms [(.m12,.s7,9963),(.m0,.s6,10657),(.m3,.s6,611),(.m21,.s3,611),(.m4,.s3,10657),(.m4,.s3,9963)], + .ms2 .s3 .s0 [(.m13,1225158134,2268772),(.m1,1455622,37871536),(.m1,29588278,631108720),(.m1,2201357878,835582)], + .ms [(.m4,.s3,2752510),(.m4,.s3,73924600),(.m10,.s7,73924606),(.m8,.s2,73924601)], + .m .m9, + .b 0 [[([88080308],[(.D7,73924606)]),([11010038,5505023,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,2752510),(.D6,835582),(.D6,2201357878)]),([344063],[(.D16,631108720),(.D6,29588278),(.D16,37871536),(.D6,1455622),(.D16,2268772),(.D6,1225158134),(.D12,9963),(.D16,10657),(.D16,611),(.D12,3)])],[([8],[(.D15,62914567),(.D21,0),(.D19,147453)])]], + .ms [(.m2,.s6,44040158),(.m6,.s6,62914565),(.m7,.s5,62914565),(.m11,.s5,44040152)], + .m .m5, + .b 44040158 [[([41],[(.D12,62914565),(.D8,1),(.D7,147452)])],[([3538822],[(.D17,62914561),(.D2,147450)])]], + .ms [(.m2,.s6,45809590),(.m3,.s6,62472208),(.m27,.s2,62472208),(.m1,.s5,45809584)], + .m .m5, + .b 45809590 [[([7],[(.D16,62472208),(.D6,1)])],[([16],[(.D11,62472206),(.D13,0),(.D6,1)])],[([8],[(.D15,62472205),(.D17,1),(.D15,0),(.D6,2201185846)])],[([16],[(.D11,62472203),(.D3,0)])],[([8],[(.D15,62472202),(.D17,1),(.D21,2201185845),(.D15,631065712),(.D17,29577526),(.D15,37868848),(.D17,1454950),(.D15,2268604),(.D17,1225158092),(.D11,9952),(.D12,10654)])],[([18],[(.D11,62472200),(.D13,0),(.D16,2201185845),(.D16,631065712)])],[([9043942],[(.D17,62472199),(.D12,2201185846),(.D17,631065712),(.D6,29577526),(.D16,37868848),(.D6,1454950),(.D16,2268604),(.D6,1225158092),(.D12,9953),(.D13,10654),(.D9,610),(.D13,3)])]], + .ms [(.m2,.s6,50331598)], + .ms2 .s6 .s7 [(.m3,61341706,2200903224),(.m0,630995056,29559862),(.m0,37864432,1453846),(.m0,2268328,1225158023)], + .ms [(.m3,.s6,9937)], + .ms2 .s6 .s7 [(.m6,10649,610)], + .ms2 .s3 .s0 [(.m19,610,10649)], + .ms [(.m17,.s0,9937)], + .ms2 .s3 .s0 [(.m4,1225158023,2268328),(.m1,1453846,37864432),(.m1,29559862,630995056),(.m1,2200903224,61341706)], + .ms [(.m1,.s3,50331592),(.m10,.s7,50331598),(.m8,.s2,50331593)], + .m .m74, + ] (by decide +kernel) +theorem chunk_8_step : (cfg_8.denote) [qi]⊢* (cfg_9.denote) := + step_chunk [ + .m .m75, + .b 0 [[([42467324],[(.D7,50331598),(.D17,61341706),(.D6,2200903224),(.D16,630995056),(.D6,29559862),(.D16,37864432),(.D6,1453846),(.D16,2268328),(.D6,1225158023),(.D6,9937),(.D12,10649),(.D6,610),(.D16,4)])]], + .ms [(.m2,.s6,21233662),(.m3,.s6,45023182)], + .ms2 .s6 .s7 [(.m3,60014602,2200571448),(.m0,630912112,29539126),(.m0,37859248,1452550),(.m0,2268004,1225157942)], + .ms [(.m12,.s7,9915),(.m0,.s6,10645),(.m3,.s6,608),(.m20,.s0,608),(.m1,.s3,10645),(.m4,.s3,9915)], + .ms2 .s3 .s0 [(.m13,1225157942,2268004),(.m1,1452550,37859248),(.m1,29539126,630912112),(.m1,2200571448,60014602)], + .ms [(.m1,.s3,45023182),(.m4,.s3,21233656),(.m10,.s7,21233662),(.m8,.s2,21233657)], + .m .m9, + .b 0 [[([84934646,42467325,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,21233662),(.D17,45023182)]),([10616830],[(.D16,60014602),(.D6,2200571448),(.D16,630912112),(.D6,29539126),(.D16,37859248),(.D6,1452550),(.D16,2268004),(.D6,1225157942),(.D12,9915),(.D16,10645),(.D16,608),(.D6,5)])]], + .ms [(.m2,.s6,84934645),(.m14,.s5,84934639)], + .m .m5, + .b 84934645 [[([5],[(.D18,1),(.D15,39714765),(.D14,58687498)])]], + .ms [(.m2,.s6,84934648),(.m7,.s5,84934642)], + .m .m5, + .b 84934648 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,84934649),(.m15,.s5,84934643)], + .m .m5, + .b 84934649 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,84934650),(.m25,.s2,84934645)], + .m .m18, + .b 84934650 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,84934652),(.m14,.s5,84934646)], + .m .m5, + .b 84934652 [[([5],[(.D18,1),(.D17,39714764),(.D15,58687498),(.D17,2200239672),(.D15,630829168),(.D17,29518390),(.D15,37854064),(.D17,1451254),(.D15,2267680),(.D17,1225157861),(.D17,9896),(.D8,10639)])]], + .ms [(.m2,.s6,84934655),(.m7,.s5,84934649)], + .m .m5, + .b 84934655 [[([58195965],[(.D8,39714764),(.D16,58687498),(.D6,2200239672),(.D16,630829168),(.D6,29518390),(.D16,37854064),(.D6,1451254),(.D16,2267680),(.D6,1225157861),(.D6,9897),(.D9,10639),(.D14,606),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,114032638,32440270),(.m0,56868874,2199785016),(.m0,630715504,29489974),(.m0,37846960,1449478),(.m0,2267236,1225157750)], + .ms [(.m12,.s7,9867),(.m0,.s6,10633),(.m3,.s6,605),(.m21,.s3,605),(.m4,.s3,10633),(.m4,.s3,9867)], + .ms2 .s3 .s0 [(.m13,1225157750,2267236),(.m1,1449478,37846960),(.m1,29489974,630715504),(.m1,2199785016,56868874),(.m1,32440270,114032633)], + .ms [(.m26,.s7,114032638),(.m8,.s2,114032633)], + .m .m9, + .b 0 [[([232783868],[(.D7,114032638),(.D7,32440269),(.D16,56868874),(.D6,2199785016),(.D16,630715504),(.D6,29489974),(.D16,37846960),(.D6,1449478),(.D16,2267236),(.D6,1225157750),(.D12,9867),(.D16,10633),(.D16,605),(.D12,3)])]], + .ms [(.m2,.s6,116391934)], + .ms2 .s6 .s7 [(.m3,84934654,25165774),(.m0,55050250,2199330360),(.m0,630601840,29461558),(.m0,37839856,1447702),(.m0,2266792,1225157639)], + .ms [(.m3,.s6,9841)], + .ms2 .s6 .s7 [(.m6,10625,604)], + .ms2 .s3 .s0 [(.m19,604,10625)], + .ms [(.m17,.s0,9841)], + .ms2 .s3 .s0 [(.m4,1225157639,2266792),(.m1,1447702,37839856),(.m1,29461558,630601840),(.m1,2199330360,55050250),(.m1,25165774,84934654)], + .ms [(.m1,.s3,116391928),(.m10,.s7,116391934),(.m8,.s2,116391929)], + .m .m9, + .b 0 [[([465567734,213909510],[(.D7,116391934),(.D17,84934654)]),([42467327],[(.D6,25165774),(.D16,55050250),(.D6,2199330360),(.D16,630601840),(.D6,29461558),(.D16,37839856),(.D6,1447702),(.D16,2266792),(.D6,1225157639),(.D6,9841),(.D12,10625),(.D6,604),(.D16,4)])]], + .ms [(.m2,.s6,339738622),(.m3,.s6,31457278)], + .ms2 .s6 .s7 [(.m3,63700990,19857358),(.m0,53723146,2198998584),(.m0,630518896,29440822),(.m0,37834672,1446406),(.m0,2266468,1225157558)], + .ms [(.m12,.s7,9819),(.m0,.s6,10621),(.m3,.s6,602),(.m20,.s0,602),(.m1,.s3,10621),(.m4,.s3,9819)], + .ms2 .s3 .s0 [(.m13,1225157558,2266468),(.m1,1446406,37834672),(.m1,29440822,630518896),(.m1,2198998584,53723146),(.m1,19857358,63700990)], + .ms [(.m1,.s3,31457278),(.m4,.s3,339738616),(.m10,.s7,339738622),(.m8,.s2,339738617)], + .m .m9, + .b 0 [[([1006632884],[(.D7,339738622)]),([125829110,62914559,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,31457278),(.D16,63700990)]),([15728638],[(.D6,19857358),(.D16,53723146),(.D6,2198998584),(.D16,630518896),(.D6,29440822),(.D16,37834672),(.D6,1446406),(.D16,2266468),(.D6,1225157558),(.D12,9819),(.D16,10621),(.D16,602),(.D6,5)])]], + .ms [(.m2,.s6,503316442),(.m3,.s6,213909511),(.m14,.s5,213909511),(.m4,.s5,503316436)], + .m .m5, + .b 503316442 [[([23],[(.D16,213909511),(.D18,1),(.D15,55836669),(.D16,17891278)])]], + .ms [(.m2,.s6,503316454),(.m3,.s6,213909508),(.m7,.s5,213909508),(.m4,.s5,503316448)], + .m .m5, + .b 503316454 [[([7],[(.D16,213909508),(.D6,1)])]], + .ms [(.m2,.s6,503316458),(.m6,.s6,213909506),(.m15,.s5,213909506),(.m11,.s5,503316452)], + .m .m5, + .b 503316458 [[([5],[(.D12,213909506),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,503316461,213909507)], + .ms [(.m23,.s1,213909507),(.m22,.s4,503316455)], + .m .m24, + .b 503316461 [[([17],[(.D6,213909507),(.D6,2)])]], + .ms [(.m2,.s6,503316470),(.m6,.s6,213909503),(.m14,.s5,213909503),(.m11,.s5,503316464)], + .m .m5, + .b 503316470 [[([23],[(.D12,213909503),(.D18,1),(.D17,55836668),(.D17,17891278),(.D15,53231626),(.D17,2198875704),(.D15,630488176),(.D17,29433142),(.D15,37832752),(.D17,1445926),(.D15,2266348),(.D17,1225157528),(.D11,9811),(.D6,10620)])]], + .ms [(.m2,.s6,503316482),(.m6,.s6,213909500),(.m7,.s5,213909500),(.m11,.s5,503316476)], + .m .m5, + .b 503316482 [[([855638001,427819005,75497481],[(.D12,213909500),(.D8,55836668),(.D6,17891278),(.D16,53231626)]),([5308415],[(.D6,2198875704),(.D16,630488176),(.D6,29433142),(.D16,37832752),(.D6,1445926),(.D16,2266348),(.D6,1225157528),(.D12,9812),(.D7,10619),(.D8,601),(.D7,4)])]], + .ms [(.m2,.s6,1182793726)], + .ms2 .s6 .s7 [(.m3,44040190,13369342)], + .ms [(.m3,.s6,7274446)], + .ms2 .s6 .s7 [(.m3,50577418,2198212152),(.m0,630322288,29391670),(.m0,37822384,1443334),(.m0,2265700,1225157366)], + .ms [(.m12,.s7,9771),(.m0,.s6,10609),(.m3,.s6,599),(.m21,.s3,599),(.m4,.s3,10609),(.m4,.s3,9771)], + .ms2 .s3 .s0 [(.m13,1225157366,2265700),(.m1,1443334,37822384),(.m1,29391670,630322288),(.m1,2198212152,50577418),(.m1,7274446,13369342)], + .ms [(.m4,.s3,44040190),(.m4,.s3,1182793720),(.m10,.s7,1182793726),(.m8,.s2,1182793721)], + .m .m9, + .b 0 [[([1409286068],[(.D7,1182793726)]),([176160758,88080383,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,44040190),(.D6,13369342),(.D6,7274446)]),([5505023],[(.D16,50577418),(.D6,2198212152),(.D16,630322288),(.D6,29391670),(.D16,37822384),(.D6,1443334),(.D16,2265700),(.D6,1225157366),(.D12,9771),(.D16,10609),(.D16,599),(.D12,3)])],[([8],[(.D15,1006632967),(.D21,0),(.D19,2359293)])]], + .ms [(.m2,.s6,704643038),(.m6,.s6,1006632965),(.m7,.s5,1006632965),(.m11,.s5,704643032)], + .m .m5, + .b 704643038 [[([41],[(.D12,1006632965),(.D8,1),(.D7,2359292)])],[([56622982],[(.D17,1006632961),(.D2,2359290)])]], + .ms [(.m2,.s6,732954550),(.m3,.s6,999555088),(.m27,.s2,999555088),(.m1,.s5,732954544)], + .m .m5, + .b 732954550 [[([7],[(.D16,999555088),(.D6,1)])],[([16],[(.D11,999555086),(.D13,0),(.D6,1)])],[([8],[(.D15,999555085),(.D17,1),(.D15,0),(.D6,4521934)])],[([16],[(.D11,999555083),(.D3,0)])],[([8],[(.D15,999555082),(.D17,1),(.D21,4521933),(.D15,49889290),(.D17,2198040120),(.D15,630279280),(.D17,29380918),(.D15,37819696),(.D17,1442662),(.D15,2265532),(.D17,1225157324),(.D11,9760),(.D12,10606)])],[([18],[(.D11,999555080),(.D13,0),(.D16,4521933),(.D16,49889290)])],[([144701892],[(.D17,999555079)]),([18087739,9043871,4521936,2260968,1130484,565239,282621,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,4521934),(.D17,49889290)]),([2260967],[(.D6,2198040120),(.D16,630279280),(.D6,29380918),(.D16,37819696),(.D6,1442662),(.D16,2265532),(.D6,1225157324),(.D12,9761),(.D13,10606),(.D9,598),(.D13,3)])],[([10],[(.D17,981467343),(.D21,0),(.D19,48758806)])]], + .ms [(.m2,.s6,805305538),(.m3,.s6,981467341),(.m7,.s5,981467341),(.m4,.s5,805305532)], + .m .m5, + .b 805305538 [[([43],[(.D16,981467341),(.D8,1),(.D7,48758805)])],[([1170211290],[(.D11,981467334),(.D2,48758803)])]], + .ms2 .s6 .s7 [(.m2,1390411205,835190925)], + .ms [(.m29,.s2,835190925),(.m4,.s5,1390411199)], + .m .m5, + .b 1390411205 [[([9],[(.D6,835190925),(.D6,1)])],[([20],[(.D15,835190923),(.D13,0),(.D10,2197757498),(.D9,630208624)])],[([36],[(.D11,835190919)]),([7,2],[(.D12,1),(.D6,2197757498)])]], + .ms [(.m2,.s6,1390411238),(.m6,.s6,835190915),(.m15,.s5,835190915),(.m11,.s5,1390411232)], + .m .m5, + .b 1390411238 [[([5],[(.D12,835190915),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,1390411241,835190916)], + .ms [(.m23,.s1,835190916),(.m22,.s4,1390411235)], + .m .m24, + .b 1390411241 [[([17],[(.D6,835190916),(.D6,2)])],[([6],[(.D11,835190912),(.D21,0),(.D7,2197757496)])]], + .ms2 .s6 .s7 [(.m2,1390411253,835190913)], + .ms2 .s5 .s2 [(.m28,835190913,1390411248)], + .m .m18, + .b 1390411253 [[([45],[(.D6,835190913),(.D8,1),(.D17,2197757495),(.D10,630208623)])],[([36],[(.D15,835190906)]),([7,2],[(.D12,1),(.D17,2197757494)]),([1],[(.D11,630208623),(.D16,29363254)])],[([8],[(.D15,835190902),(.D21,0),(.D17,2197757493),(.D12,630208624)])]], + .ms [(.m2,.s6,1390411298),(.m6,.s6,835190900),(.m7,.s5,835190900),(.m11,.s5,1390411292)], + .m .m5, + .b 1390411298 [[([39],[(.D12,835190900),(.D8,2197757494),(.D13,630208624),(.D17,29363254),(.D15,37815280),(.D17,1441558),(.D15,2265256),(.D17,1225157255),(.D17,9745),(.D11,10601),(.D17,598),(.D15,3)])]], + .ms [(.m2,.s6,1390411318)], + .ms2 .s6 .s7 [(.m3,835190896,2197757494),(.m0,630208624,29363254),(.m0,37815280,1441558),(.m0,2265256,1225157255)], + .ms [(.m3,.s6,9745)], + .ms2 .s6 .s7 [(.m6,10601,598)], + .ms2 .s3 .s0 [(.m19,598,10601)], + .ms [(.m17,.s0,9745)], + .ms2 .s3 .s0 [(.m4,1225157255,2265256),(.m1,1441558,37815280),(.m1,29363254,630208624),(.m1,2197757494,835190896)], + .ms [(.m1,.s3,1390411312),(.m10,.s7,1390411318),(.m8,.s2,1390411313)], + .m .m9, + .b 0 [[([42467324],[(.D7,1390411318),(.D17,835190896),(.D6,2197757494),(.D16,630208624),(.D6,29363254),(.D16,37815280),(.D6,1441558),(.D16,2265256),(.D6,1225157255),(.D6,9745),(.D12,10601),(.D6,598),(.D16,4)])]], + .ms [(.m2,.s6,21233662),(.m3,.s6,1385102902)], + .ms2 .s6 .s7 [(.m3,833863792,2197425718),(.m0,630125680,29342518),(.m0,37810096,1440262),(.m0,2264932,1225157174)], + .ms [(.m12,.s7,9723),(.m0,.s6,10597),(.m3,.s6,596),(.m20,.s0,596),(.m1,.s3,10597),(.m4,.s3,9723)], + .ms2 .s3 .s0 [(.m13,1225157174,2264932),(.m1,1440262,37810096),(.m1,29342518,630125680),(.m1,2197425718,833863792)], + .ms [(.m1,.s3,1385102902),(.m4,.s3,21233656),(.m10,.s7,21233662),(.m8,.s2,21233657)], + .m .m9, + .b 0 [[([84934646,42467325,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,21233662),(.D17,1385102902)]),([10616830],[(.D16,833863792),(.D6,2197425718),(.D16,630125680),(.D6,29342518),(.D16,37810096),(.D6,1440262),(.D16,2264932),(.D6,1225157174),(.D12,9723),(.D16,10597),(.D16,596),(.D6,5)])]], + .ms [(.m2,.s6,84934645),(.m14,.s5,84934639)], + .m .m5, + .b 84934645 [[([5],[(.D18,1),(.D15,1379794485),(.D14,832536688)])]], + .ms [(.m2,.s6,84934648),(.m7,.s5,84934642)], + .m .m5, + .b 84934648 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,84934649),(.m15,.s5,84934643)], + .m .m5, + .b 84934649 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,84934650),(.m25,.s2,84934645)], + .m .m18, + .b 84934650 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,84934652),(.m14,.s5,84934646)], + .m .m5, + .b 84934652 [[([5],[(.D18,1),(.D17,1379794484),(.D15,832536688),(.D17,2197093942),(.D15,630042736),(.D17,29321782),(.D15,37804912),(.D17,1438966),(.D15,2264608),(.D17,1225157093),(.D17,9704),(.D8,10591)])]], + .ms [(.m2,.s6,84934655),(.m7,.s5,84934649)], + .m .m5, + .b 84934655 [[([58195965],[(.D8,1379794484),(.D16,832536688),(.D6,2197093942),(.D16,630042736),(.D6,29321782),(.D16,37804912),(.D6,1438966),(.D16,2264608),(.D6,1225157093),(.D6,9705),(.D9,10591),(.D14,594),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,114032638,1372519990),(.m0,830718064,2196639286),(.m0,629929072,29293366),(.m0,37797808,1437190),(.m0,2264164,1225156982)], + .ms [(.m12,.s7,9675),(.m0,.s6,10585),(.m3,.s6,593),(.m21,.s3,593),(.m4,.s3,10585),(.m4,.s3,9675)], + .ms2 .s3 .s0 [(.m13,1225156982,2264164),(.m1,1437190,37797808),(.m1,29293366,629929072),(.m1,2196639286,830718064),(.m1,1372519990,114032633)], + .ms [(.m26,.s7,114032638),(.m8,.s2,114032633)], + .m .m9, + .b 0 [[([232783868],[(.D7,114032638),(.D7,1372519989),(.D16,830718064),(.D6,2196639286),(.D16,629929072),(.D6,29293366),(.D16,37797808),(.D6,1437190),(.D16,2264164),(.D6,1225156982),(.D12,9675),(.D16,10585),(.D16,593),(.D12,3)])]], + .ms [(.m2,.s6,116391934)], + .ms2 .s6 .s7 [(.m3,84934654,1365245494),(.m0,828899440,2196184630),(.m0,629815408,29264950),(.m0,37790704,1435414),(.m0,2263720,1225156871)], + .ms [(.m3,.s6,9649)], + .ms2 .s6 .s7 [(.m6,10577,592)], + .ms2 .s3 .s0 [(.m19,592,10577)], + .ms [(.m17,.s0,9649)], + .ms2 .s3 .s0 [(.m4,1225156871,2263720),(.m1,1435414,37790704),(.m1,29264950,629815408),(.m1,2196184630,828899440),(.m1,1365245494,84934654)], + .ms [(.m1,.s3,116391928),(.m10,.s7,116391934),(.m8,.s2,116391929)], + .m .m9, + .b 0 [[([465567734,213909510],[(.D7,116391934),(.D17,84934654)]),([42467327],[(.D6,1365245494),(.D16,828899440),(.D6,2196184630),(.D16,629815408),(.D6,29264950),(.D16,37790704),(.D6,1435414),(.D16,2263720),(.D6,1225156871),(.D6,9649),(.D12,10577),(.D6,592),(.D16,4)])]], + .ms [(.m2,.s6,339738622),(.m3,.s6,31457278)], + .ms2 .s6 .s7 [(.m3,63700990,1359937078),(.m0,827572336,2195852854),(.m0,629732464,29244214),(.m0,37785520,1434118),(.m0,2263396,1225156790)], + .ms [(.m12,.s7,9627),(.m0,.s6,10573),(.m3,.s6,590),(.m20,.s0,590),(.m1,.s3,10573),(.m4,.s3,9627)], + .ms2 .s3 .s0 [(.m13,1225156790,2263396),(.m1,1434118,37785520),(.m1,29244214,629732464),(.m1,2195852854,827572336),(.m1,1359937078,63700990)], + .ms [(.m1,.s3,31457278),(.m4,.s3,339738616),(.m10,.s7,339738622),(.m8,.s2,339738617)], + .m .m9, + .b 0 [[([1006632884],[(.D7,339738622)]),([125829110,62914559,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,31457278),(.D16,63700990)]),([15728638],[(.D6,1359937078),(.D16,827572336),(.D6,2195852854),(.D16,629732464),(.D6,29244214),(.D16,37785520),(.D6,1434118),(.D16,2263396),(.D6,1225156790),(.D12,9627),(.D16,10573),(.D16,590),(.D6,5)])]], + .ms [(.m2,.s6,503316442),(.m3,.s6,213909511),(.m14,.s5,213909511),(.m4,.s5,503316436)], + .m .m5, + .b 503316442 [[([23],[(.D16,213909511),(.D18,1),(.D15,55836669),(.D16,1357970998)])]], + .ms [(.m2,.s6,503316454),(.m3,.s6,213909508),(.m7,.s5,213909508),(.m4,.s5,503316448)], + .m .m5, + .b 503316454 [[([7],[(.D16,213909508),(.D6,1)])]], + .ms [(.m2,.s6,503316458),(.m6,.s6,213909506),(.m15,.s5,213909506),(.m11,.s5,503316452)], + .m .m5, + .b 503316458 [[([5],[(.D12,213909506),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,503316461,213909507)], + .ms [(.m23,.s1,213909507),(.m22,.s4,503316455)], + .m .m24, + .b 503316461 [[([17],[(.D6,213909507),(.D6,2)])]], + .ms [(.m2,.s6,503316470),(.m6,.s6,213909503),(.m14,.s5,213909503),(.m11,.s5,503316464)], + .m .m5, + .b 503316470 [[([23],[(.D12,213909503),(.D18,1),(.D17,55836668),(.D17,1357970998),(.D15,827080816),(.D17,2195729974),(.D15,629701744),(.D17,29236534),(.D15,37783600),(.D17,1433638),(.D15,2263276),(.D17,1225156760),(.D11,9619),(.D6,10572)])]], + .ms [(.m2,.s6,503316482),(.m6,.s6,213909500),(.m7,.s5,213909500),(.m11,.s5,503316476)], + .m .m5, + .b 503316482 [[([855638001,427819005,75497481],[(.D12,213909500),(.D8,55836668),(.D6,1357970998)]),([21233663],[(.D16,827080816),(.D6,2195729974),(.D16,629701744),(.D6,29236534),(.D16,37783600),(.D6,1433638),(.D16,2263276),(.D6,1225156760),(.D12,9620),(.D7,10571),(.D8,589),(.D7,4)])]], + .ms [(.m2,.s6,1182793726)], + .ms2 .s6 .s7 [(.m3,44040190,13369342)], + .ms [(.m3,.s6,1347354166)], + .ms2 .s6 .s7 [(.m3,824426608,2195066422),(.m0,629535856,29195062),(.m0,37773232,1431046),(.m0,2262628,1225156598)], + .ms [(.m12,.s7,9579),(.m0,.s6,10561),(.m3,.s6,587),(.m21,.s3,587),(.m4,.s3,10561)], + ] (by decide +kernel) +theorem chunk_9_step : (cfg_9.denote) [qi]⊢* (cfg_10.denote) := + step_chunk [ + .ms [(.m4,.s3,9579)], + .ms2 .s3 .s0 [(.m13,1225156598,2262628),(.m1,1431046,37773232),(.m1,29195062,629535856),(.m1,2195066422,824426608),(.m1,1347354166,13369342)], + .ms [(.m4,.s3,44040190),(.m4,.s3,1182793720),(.m10,.s7,1182793726),(.m8,.s2,1182793721)], + .m .m9, + .b 0 [[([1409286068],[(.D7,1182793726)]),([176160758,88080383,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,44040190),(.D6,13369342),(.D6,1347354166)]),([5505023],[(.D16,824426608),(.D6,2195066422),(.D16,629535856),(.D6,29195062),(.D16,37773232),(.D6,1431046),(.D16,2262628),(.D6,1225156598),(.D12,9579),(.D16,10561),(.D16,587),(.D12,3)])],[([8],[(.D15,1006632967),(.D21,0),(.D19,2359293)])]], + .ms [(.m2,.s6,704643038),(.m6,.s6,1006632965),(.m7,.s5,1006632965),(.m11,.s5,704643032)], + .m .m5, + .b 704643038 [[([41],[(.D12,1006632965),(.D8,1),(.D7,2359292)])],[([56622982],[(.D17,1006632961),(.D2,2359290)])]], + .ms [(.m2,.s6,732954550),(.m3,.s6,999555088),(.m27,.s2,999555088),(.m1,.s5,732954544)], + .m .m5, + .b 732954550 [[([7],[(.D16,999555088),(.D6,1)])],[([16],[(.D11,999555086),(.D13,0),(.D6,1)])],[([8],[(.D15,999555085),(.D17,1),(.D15,0),(.D6,1344601654)])],[([16],[(.D11,999555083),(.D3,0)])],[([8],[(.D15,999555082),(.D17,1),(.D21,1344601653),(.D15,823738480),(.D17,2194894390),(.D15,629492848),(.D17,29184310),(.D15,37770544),(.D17,1430374),(.D15,2262460),(.D17,1225156556),(.D11,9568),(.D12,10558)])],[([18],[(.D11,999555080),(.D13,0),(.D16,1344601653),(.D16,823738480)])],[([144703462],[(.D17,999555079),(.D12,1344601654),(.D17,823738480),(.D6,2194894390),(.D16,629492848),(.D6,29184310),(.D16,37770544),(.D6,1430374),(.D16,2262460),(.D6,1225156556),(.D12,9569),(.D13,10558),(.D9,586),(.D13,3)])]], + .ms [(.m2,.s6,805306318)], + .ms2 .s6 .s7 [(.m3,981467146,1340079672),(.m0,822607984,2194611766),(.m0,629422192,29166646),(.m0,37766128,1429270),(.m0,2262184,1225156487)], + .ms [(.m3,.s6,9553)], + .ms2 .s6 .s7 [(.m6,10553,586)], + .ms2 .s3 .s0 [(.m19,586,10553)], + .ms [(.m17,.s0,9553)], + .ms2 .s3 .s0 [(.m4,1225156487,2262184),(.m1,1429270,37766128),(.m1,29166646,629422192),(.m1,2194611766,822607984),(.m1,1340079672,981467146)], + .ms [(.m1,.s3,805306312),(.m10,.s7,805306318),(.m8,.s2,805306313)], + .m .m9, + .b 0 [[([679477244],[(.D7,805306318),(.D17,981467146),(.D6,1340079672),(.D16,822607984),(.D6,2194611766),(.D16,629422192),(.D6,29166646),(.D16,37766128),(.D6,1429270),(.D16,2262184),(.D6,1225156487),(.D6,9553),(.D12,10553),(.D6,586),(.D16,4)])]], + .ms [(.m2,.s6,339738622),(.m3,.s6,720371662)], + .ms2 .s6 .s7 [(.m3,960233482,1334771256),(.m0,821280880,2194279990),(.m0,629339248,29145910),(.m0,37760944,1427974),(.m0,2261860,1225156406)], + .ms [(.m12,.s7,9531),(.m0,.s6,10549),(.m3,.s6,584),(.m20,.s0,584),(.m1,.s3,10549),(.m4,.s3,9531)], + .ms2 .s3 .s0 [(.m13,1225156406,2261860),(.m1,1427974,37760944),(.m1,29145910,629339248),(.m1,2194279990,821280880),(.m1,1334771256,960233482)], + .ms [(.m1,.s3,720371662),(.m4,.s3,339738616),(.m10,.s7,339738622),(.m8,.s2,339738617)], + .m .m9, + .b 0 [[([1358954486,679477245,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,339738622),(.D17,720371662)]),([169869310],[(.D16,960233482),(.D6,1334771256),(.D16,821280880),(.D6,2194279990),(.D16,629339248),(.D6,29145910),(.D16,37760944),(.D6,1427974),(.D16,2261860),(.D6,1225156406),(.D12,9531),(.D16,10549),(.D16,584),(.D6,5)])]], + .ms [(.m2,.s6,1358954485),(.m14,.s5,1358954479)], + .m .m5, + .b 1358954485 [[([5],[(.D18,1),(.D15,635437005),(.D14,938999818)])]], + .ms [(.m2,.s6,1358954488),(.m7,.s5,1358954482)], + .m .m5, + .b 1358954488 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,1358954489),(.m15,.s5,1358954483)], + .m .m5, + .b 1358954489 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,1358954490),(.m25,.s2,1358954485)], + .m .m18, + .b 1358954490 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,1358954492),(.m14,.s5,1358954486)], + .m .m5, + .b 1358954492 [[([5],[(.D18,1),(.D17,635437004),(.D15,938999818),(.D17,1329462840),(.D15,819953776),(.D17,2193948214),(.D15,629256304),(.D17,29125174),(.D15,37755760),(.D17,1426678),(.D15,2261536),(.D17,1225156325),(.D17,9512),(.D8,10543)])]], + .ms [(.m2,.s6,1358954495),(.m7,.s5,1358954489)], + .m .m5, + .b 1358954495 [[([931135485],[(.D8,635437004),(.D16,938999818),(.D6,1329462840),(.D16,819953776),(.D6,2193948214),(.D16,629256304),(.D6,29125174),(.D16,37755760),(.D6,1426678),(.D16,2261536),(.D6,1225156325),(.D6,9513),(.D9,10543),(.D14,582),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,1824522238,519045070),(.m0,909901834,1322188344),(.m0,818135152,2193493558),(.m0,629142640,29096758),(.m0,37748656,1424902),(.m0,2261092,1225156214)], + .ms [(.m12,.s7,9483),(.m0,.s6,10537),(.m3,.s6,581),(.m21,.s3,581),(.m4,.s3,10537),(.m4,.s3,9483)], + .ms2 .s3 .s0 [(.m13,1225156214,2261092),(.m1,1424902,37748656),(.m1,29096758,629142640),(.m1,2193493558,818135152),(.m1,1322188344,909901834),(.m1,519045070,1824522233)], + .ms [(.m26,.s7,1824522238),(.m8,.s2,1824522233)], + .m .m9, + .b 0 [[([3724541948],[(.D7,1824522238),(.D7,519045069),(.D16,909901834),(.D6,1322188344),(.D16,818135152),(.D6,2193493558),(.D16,629142640),(.D6,29096758),(.D16,37748656),(.D6,1424902),(.D16,2261092),(.D6,1225156214),(.D12,9483),(.D16,10537),(.D16,581),(.D12,3)])]], + .ms [(.m2,.s6,1862270974)], + .ms2 .s6 .s7 [(.m3,1358954494,402653134),(.m0,880803850,1314913848),(.m0,816316528,2193038902),(.m0,629028976,29068342),(.m0,37741552,1423126),(.m0,2260648,1225156103)], + .ms [(.m3,.s6,9457)], + .ms2 .s6 .s7 [(.m6,10529,580)], + .ms2 .s3 .s0 [(.m19,580,10529)], + .ms [(.m17,.s0,9457)], + .ms2 .s3 .s0 [(.m4,1225156103,2260648),(.m1,1423126,37741552),(.m1,29068342,629028976),(.m1,2193038902,816316528),(.m1,1314913848,880803850),(.m1,402653134,1358954494)], + .ms [(.m1,.s3,1862270968),(.m10,.s7,1862270974),(.m8,.s2,1862270969)], + .m .m9, + .b 0 [[([7449083894,3422552070],[(.D7,1862270974),(.D17,1358954494)]),([679477247],[(.D6,402653134),(.D16,880803850),(.D6,1314913848),(.D16,816316528),(.D6,2193038902),(.D16,629028976),(.D6,29068342),(.D16,37741552),(.D6,1423126),(.D16,2260648),(.D6,1225156103),(.D6,9457),(.D12,10529),(.D6,580),(.D16,4)])]], + .ms [(.m2,.s6,5435817982),(.m3,.s6,503316478)], + .ms2 .s6 .s7 [(.m3,1019215870,317718478),(.m0,859570186,1309605432),(.m0,814989424,2192707126),(.m0,628946032,29047606),(.m0,37736368,1421830),(.m0,2260324,1225156022)], + .ms [(.m12,.s7,9435),(.m0,.s6,10525),(.m3,.s6,578),(.m20,.s0,578),(.m1,.s3,10525),(.m4,.s3,9435)], + .ms2 .s3 .s0 [(.m13,1225156022,2260324),(.m1,1421830,37736368),(.m1,29047606,628946032),(.m1,2192707126,814989424),(.m1,1309605432,859570186),(.m1,317718478,1019215870)], + .ms [(.m1,.s3,503316478),(.m4,.s3,5435817976),(.m10,.s7,5435817982),(.m8,.s2,5435817977)], + .m .m9, + .b 0 [[([16106127284],[(.D7,5435817982)]),([2013265910,1006632959,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,503316478),(.D16,1019215870)]),([251658238],[(.D6,317718478),(.D16,859570186),(.D6,1309605432),(.D16,814989424),(.D6,2192707126),(.D16,628946032),(.D6,29047606),(.D16,37736368),(.D6,1421830),(.D16,2260324),(.D6,1225156022),(.D12,9435),(.D16,10525),(.D16,578),(.D6,5)])]], + .ms [(.m2,.s6,8053063642),(.m3,.s6,3422552071),(.m14,.s5,3422552071),(.m4,.s5,8053063636)], + .m .m5, + .b 8053063642 [[([23],[(.D16,3422552071),(.D18,1),(.D15,893386749),(.D16,286261198)])]], + .ms [(.m2,.s6,8053063654),(.m3,.s6,3422552068),(.m7,.s5,3422552068),(.m4,.s5,8053063648)], + .m .m5, + .b 8053063654 [[([7],[(.D16,3422552068),(.D6,1)])]], + .ms [(.m2,.s6,8053063658),(.m6,.s6,3422552066),(.m15,.s5,3422552066),(.m11,.s5,8053063652)], + .m .m5, + .b 8053063658 [[([5],[(.D12,3422552066),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,8053063661,3422552067)], + .ms [(.m23,.s1,3422552067),(.m22,.s4,8053063655)], + .m .m24, + .b 8053063661 [[([17],[(.D6,3422552067),(.D6,2)])]], + .ms [(.m2,.s6,8053063670),(.m6,.s6,3422552063),(.m14,.s5,3422552063),(.m11,.s5,8053063664)], + .m .m5, + .b 8053063670 [[([23],[(.D12,3422552063),(.D18,1),(.D17,893386748),(.D17,286261198),(.D15,851705866),(.D17,1307639352),(.D15,814497904),(.D17,2192584246),(.D15,628915312),(.D17,29039926),(.D15,37734448),(.D17,1421350),(.D15,2260204),(.D17,1225155992),(.D11,9427),(.D6,10524)])]], + .ms [(.m2,.s6,8053063682),(.m6,.s6,3422552060),(.m7,.s5,3422552060),(.m11,.s5,8053063676)], + .m .m5, + .b 8053063682 [[([13690208241,6845104125,1207959561],[(.D12,3422552060),(.D8,893386748),(.D6,286261198),(.D16,851705866)]),([84934655],[(.D6,1307639352),(.D16,814497904),(.D6,2192584246),(.D16,628915312),(.D6,29039926),(.D16,37734448),(.D6,1421350),(.D16,2260204),(.D6,1225155992),(.D12,9428),(.D7,10523),(.D8,577),(.D7,4)])]], + .ms [(.m2,.s6,18924699646)], + .ms2 .s6 .s7 [(.m3,704643070,213909502)], + .ms [(.m3,.s6,116391886)], + .ms2 .s6 .s7 [(.m3,809238538,1297022520),(.m0,811843696,2191920694),(.m0,628749424,28998454),(.m0,37724080,1418758),(.m0,2259556,1225155830)], + .ms [(.m12,.s7,9387),(.m0,.s6,10513),(.m3,.s6,575),(.m21,.s3,575),(.m4,.s3,10513),(.m4,.s3,9387)], + .ms2 .s3 .s0 [(.m13,1225155830,2259556),(.m1,1418758,37724080),(.m1,28998454,628749424),(.m1,2191920694,811843696),(.m1,1297022520,809238538),(.m1,116391886,213909502)], + .ms [(.m4,.s3,704643070),(.m4,.s3,18924699640),(.m10,.s7,18924699646),(.m8,.s2,18924699641)], + .m .m9, + .b 0 [[([22548578228],[(.D7,18924699646)]),([2818572278,1409286143,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,704643070),(.D6,213909502),(.D6,116391886)]),([88080383],[(.D16,809238538),(.D6,1297022520),(.D16,811843696),(.D6,2191920694),(.D16,628749424),(.D6,28998454),(.D16,37724080),(.D6,1418758),(.D16,2259556),(.D6,1225155830),(.D12,9387),(.D16,10513),(.D16,575),(.D12,3)])],[([8],[(.D15,16106127367),(.D21,0),(.D19,37748733)])]], + .ms [(.m2,.s6,11274289118),(.m6,.s6,16106127365),(.m7,.s5,16106127365),(.m11,.s5,11274289112)], + .m .m5, + .b 11274289118 [[([41],[(.D12,16106127365),(.D8,1),(.D7,37748732)])],[([905969542],[(.D17,16106127361),(.D2,37748730)])]], + .ms [(.m2,.s6,11727273910),(.m3,.s6,15992881168),(.m27,.s2,15992881168),(.m1,.s5,11727273904)], + .m .m5, + .b 11727273910 [[([7],[(.D16,15992881168), + (.D6,1)])], + [([16],[(.D11,15992881166), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,15992881165), + (.D17,1), + (.D15,0), + (.D6,72351694)])], + [([16],[(.D11,15992881163), + (.D3,0)])], + [([8],[(.D15,15992881162), + (.D17,1), + (.D21,72351693), + (.D15,798228490), + (.D17,1294270008), + (.D15,811155568), + (.D17,2191748662), + (.D15,628706416), + (.D17,28987702), + (.D15,37721392), + (.D17,1418086), + (.D15,2259388), + (.D17,1225155788), + (.D11,9376), + (.D12,10510)])], + [([18],[(.D11,15992881160), + (.D13,0), + (.D16,72351693), + (.D16,798228490)])], + [([2315254212],[(.D17,15992881159)]), + ([289406779,144703391,72351696,36175848,18087924,9043959,4521981,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,72351694), + (.D17,798228490)]), + ([36175847],[(.D6,1294270008), + (.D16,811155568), + (.D6,2191748662), + (.D16,628706416), + (.D6,28987702), + (.D16,37721392), + (.D6,1418086), + (.D16,2259388), + (.D6,1225155788), + (.D12,9377), + (.D13,10510), + (.D9,574), + (.D13,3)])], + [([10],[(.D17,15703474383), + (.D21,0), + (.D19,780140566)])]], + .ms [(.m2,.s6,12884901058),(.m3,.s6,15703474381),(.m7,.s5,15703474381),(.m4,.s5,12884901052)], + .m .m5, + .b 12884901058 [[([43],[(.D16,15703474381),(.D8,1),(.D7,780140565)])],[([18723373530],[(.D11,15703474374),(.D2,780140563)])]], + .ms2 .s6 .s7 [(.m2,22246587845,13363052685)], + .ms [(.m29,.s2,13363052685),(.m4,.s5,22246587839)], + .m .m5, + .b 22246587845 [[([9],[(.D6,13363052685),(.D6,1)])],[([20],[(.D15,13363052683),(.D13,0),(.D10,1289748026),(.D9,810025072)])],[([36],[(.D11,13363052679)]),([7,2],[(.D12,1),(.D6,1289748026)])]], + .ms [(.m2,.s6,22246587878),(.m6,.s6,13363052675),(.m15,.s5,13363052675),(.m11,.s5,22246587872)], + .m .m5, + .b 22246587878 [[([5],[(.D12,13363052675),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,22246587881,13363052676)], + .ms [(.m23,.s1,13363052676),(.m22,.s4,22246587875)], + .m .m24, + .b 22246587881 [[([17],[(.D6,13363052676),(.D6,2)])],[([6],[(.D11,13363052672),(.D21,0),(.D7,1289748024)])]], + .ms2 .s6 .s7 [(.m2,22246587893,13363052673)], + .ms2 .s5 .s2 [(.m28,13363052673,22246587888)], + .m .m18, + .b 22246587893 [[([45],[(.D6,13363052673),(.D8,1),(.D17,1289748023),(.D10,810025071)])],[([36],[(.D15,13363052666)]),([7,2],[(.D12,1),(.D17,1289748022)]),([1],[(.D11,810025071),(.D16,2191466038)])],[([8],[(.D15,13363052662),(.D21,0),(.D17,1289748021),(.D12,810025072)])]], + .ms [(.m2,.s6,22246587938),(.m6,.s6,13363052660),(.m7,.s5,13363052660),(.m11,.s5,22246587932)], + .m .m5, + .b 22246587938 [[([39],[(.D12,13363052660),(.D8,1289748022),(.D13,810025072),(.D17,2191466038),(.D15,628635760),(.D17,28970038),(.D15,37716976),(.D17,1416982),(.D15,2259112),(.D17,1225155719),(.D17,9361),(.D11,10505),(.D17,574),(.D15,3)])]], + .ms [(.m2,.s6,22246587958)], + .ms2 .s6 .s7 [(.m3,13363052656,1289748022),(.m0,810025072,2191466038),(.m0,628635760,28970038),(.m0,37716976,1416982),(.m0,2259112,1225155719)], + .ms [(.m3,.s6,9361)], + .ms2 .s6 .s7 [(.m6,10505,574)], + .ms2 .s3 .s0 [(.m19,574,10505)], + .ms [(.m17,.s0,9361)], + .ms2 .s3 .s0 [(.m4,1225155719,2259112),(.m1,1416982,37716976),(.m1,28970038,628635760),(.m1,2191466038,810025072),(.m1,1289748022,13363052656)], + .ms [(.m1,.s3,22246587952),(.m10,.s7,22246587958),(.m8,.s2,22246587953)], + .m .m9, + .b 0 [[([679477244],[(.D7,22246587958),(.D17,13363052656),(.D6,1289748022),(.D16,810025072),(.D6,2191466038),(.D16,628635760),(.D6,28970038),(.D16,37716976),(.D6,1416982),(.D16,2259112),(.D6,1225155719),(.D6,9361),(.D12,10505),(.D6,574),(.D16,4)])]], + .ms [(.m2,.s6,339738622),(.m3,.s6,22161653302)], + .ms2 .s6 .s7 [(.m3,13341818992,1284439606),(.m0,808697968,2191134262),(.m0,628552816,28949302),(.m0,37711792,1415686),(.m0,2258788,1225155638)], + .ms [(.m12,.s7,9339),(.m0,.s6,10501),(.m3,.s6,572),(.m20,.s0,572),(.m1,.s3,10501),(.m4,.s3,9339)], + .ms2 .s3 .s0 [(.m13,1225155638,2258788),(.m1,1415686,37711792),(.m1,28949302,628552816),(.m1,2191134262,808697968),(.m1,1284439606,13341818992)], + .ms [(.m1,.s3,22161653302),(.m4,.s3,339738616),(.m10,.s7,339738622),(.m8,.s2,339738617)], + .m .m9, + .b 0 [[([1358954486,679477245,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,339738622),(.D17,22161653302)]),([169869310],[(.D16,13341818992),(.D6,1284439606),(.D16,808697968),(.D6,2191134262),(.D16,628552816),(.D6,28949302),(.D16,37711792),(.D6,1415686),(.D16,2258788),(.D6,1225155638),(.D12,9339),(.D16,10501),(.D16,572),(.D6,5)])]], + .ms [(.m2,.s6,1358954485),(.m14,.s5,1358954479)], + .m .m5, + .b 1358954485 [[([5],[(.D18,1),(.D15,22076718645),(.D14,13320585328)])]], + .ms [(.m2,.s6,1358954488),(.m7,.s5,1358954482)], + .m .m5, + .b 1358954488 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,1358954489),(.m15,.s5,1358954483)], + .m .m5, + .b 1358954489 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,1358954490),(.m25,.s2,1358954485)], + .m .m18, + .b 1358954490 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,1358954492),(.m14,.s5,1358954486)], + .m .m5, + .b 1358954492 [[([5],[(.D18,1),(.D17,22076718644),(.D15,13320585328),(.D17,1279131190),(.D15,807370864),(.D17,2190802486),(.D15,628469872),(.D17,28928566),(.D15,37706608),(.D17,1414390),(.D15,2258464),(.D17,1225155557),(.D17,9320),(.D8,10495)])]], + .ms [(.m2,.s6,1358954495),(.m7,.s5,1358954489)], + .m .m5, + .b 1358954495 [[([931135485],[(.D8,22076718644),(.D16,13320585328),(.D6,1279131190),(.D16,807370864),(.D6,2190802486),(.D16,628469872),(.D6,28928566),(.D16,37706608),(.D6,1414390),(.D16,2258464),(.D6,1225155557),(.D6,9321),(.D9,10495),(.D14,570),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,1824522238,21960326710),(.m0,13291487344,1271856694),(.m0,805552240,2190347830),(.m0,628356208,28900150),(.m0,37699504,1412614),(.m0,2258020,1225155446)], + .ms [(.m12,.s7,9291),(.m0,.s6,10489),(.m3,.s6,569),(.m21,.s3,569),(.m4,.s3,10489),(.m4,.s3,9291)], + .ms2 .s3 .s0 [(.m13,1225155446,2258020),(.m1,1412614,37699504),(.m1,28900150,628356208),(.m1,2190347830,805552240),(.m1,1271856694,13291487344),(.m1,21960326710,1824522233)], + .ms [(.m26,.s7,1824522238),(.m8,.s2,1824522233)], + .m .m9, + .b 0 [[([3724541948],[(.D7,1824522238),(.D7,21960326709),(.D16,13291487344),(.D6,1271856694),(.D16,805552240),(.D6,2190347830),(.D16,628356208),(.D6,28900150),(.D16,37699504),(.D6,1412614),(.D16,2258020),(.D6,1225155446),(.D12,9291),(.D16,10489),(.D16,569),(.D12,3)])]], + .ms [(.m2,.s6,1862270974)], + .ms2 .s6 .s7 [(.m3,1358954494,21843934774),(.m0,13262389360,1264582198),(.m0,803733616,2189893174),(.m0,628242544,28871734),(.m0,37692400,1410838),(.m0,2257576,1225155335)], + .ms [(.m3,.s6,9265)], + .ms2 .s6 .s7 [(.m6,10481,568)], + .ms2 .s3 .s0 [(.m19,568,10481)], + .ms [(.m17,.s0,9265)], + .ms2 .s3 .s0 [(.m4,1225155335,2257576),(.m1,1410838,37692400),(.m1,28871734,628242544),(.m1,2189893174,803733616),(.m1,1264582198,13262389360),(.m1,21843934774,1358954494)], + .ms [(.m1,.s3,1862270968),(.m10,.s7,1862270974),(.m8,.s2,1862270969)], + .m .m9, + .b 0 [[([7449083894,3422552070],[(.D7,1862270974),(.D17,1358954494)]),([679477247],[(.D6,21843934774),(.D16,13262389360),(.D6,1264582198),(.D16,803733616),(.D6,2189893174),(.D16,628242544),(.D6,28871734),(.D16,37692400),(.D6,1410838),(.D16,2257576),(.D6,1225155335),(.D6,9265),(.D12,10481),(.D6,568),(.D16,4)])]], + .ms [(.m2,.s6,5435817982),(.m3,.s6,503316478)], + .ms2 .s6 .s7 [(.m3,1019215870,21759000118),(.m0,13241155696,1259273782),(.m0,802406512,2189561398),(.m0,628159600,28850998),(.m0,37687216,1409542),(.m0,2257252,1225155254)], + .ms [(.m12,.s7,9243),(.m0,.s6,10477),(.m3,.s6,566),(.m20,.s0,566),(.m1,.s3,10477),(.m4,.s3,9243)], + .ms2 .s3 .s0 [(.m13,1225155254,2257252)], + .m .m1, + ] (by decide +kernel) +theorem chunk_10_step : (cfg_10.denote) [qi]⊢* (cfg_11.denote) := + step_chunk [ + .s2 .s3 .s0 [(1409542,37687216)], + .ms2 .s3 .s0 [(.m1,28850998,628159600),(.m1,2189561398,802406512),(.m1,1259273782,13241155696),(.m1,21759000118,1019215870)], + .ms [(.m1,.s3,503316478),(.m4,.s3,5435817976),(.m10,.s7,5435817982),(.m8,.s2,5435817977)], + .m .m9, + .b 0 [[([16106127284],[(.D7,5435817982)]),([2013265910,1006632959,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,503316478),(.D16,1019215870)]),([251658238],[(.D6,21759000118),(.D16,13241155696),(.D6,1259273782),(.D16,802406512),(.D6,2189561398),(.D16,628159600),(.D6,28850998),(.D16,37687216),(.D6,1409542),(.D16,2257252),(.D6,1225155254),(.D12,9243),(.D16,10477),(.D16,566),(.D6,5)])]], + .ms [(.m2,.s6,8053063642),(.m3,.s6,3422552071),(.m14,.s5,3422552071),(.m4,.s5,8053063636)], + .m .m5, + .b 8053063642 [[([23],[(.D16,3422552071),(.D18,1),(.D15,893386749),(.D16,21727542838)])]], + .ms [(.m2,.s6,8053063654),(.m3,.s6,3422552068),(.m7,.s5,3422552068),(.m4,.s5,8053063648)], + .m .m5, + .b 8053063654 [[([7],[(.D16,3422552068),(.D6,1)])]], + .ms [(.m2,.s6,8053063658),(.m6,.s6,3422552066),(.m15,.s5,3422552066),(.m11,.s5,8053063652)], + .m .m5, + .b 8053063658 [[([5],[(.D12,3422552066),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,8053063661,3422552067)], + .ms [(.m23,.s1,3422552067),(.m22,.s4,8053063655)], + .m .m24, + .b 8053063661 [[([17],[(.D6,3422552067),(.D6,2)])]], + .ms [(.m2,.s6,8053063670),(.m6,.s6,3422552063),(.m14,.s5,3422552063),(.m11,.s5,8053063664)], + .m .m5, + .b 8053063670 [[([23],[(.D12,3422552063),(.D18,1),(.D17,893386748),(.D17,21727542838),(.D15,13233291376),(.D17,1257307702),(.D15,801914992),(.D17,2189438518),(.D15,628128880),(.D17,28843318),(.D15,37685296),(.D17,1409062),(.D15,2257132),(.D17,1225155224),(.D11,9235),(.D6,10476)])]], + .ms [(.m2,.s6,8053063682),(.m6,.s6,3422552060),(.m7,.s5,3422552060),(.m11,.s5,8053063676)], + .m .m5, + .b 8053063682 [[([13690208241,6845104125,1207959561],[(.D12,3422552060),(.D8,893386748),(.D6,21727542838)]),([339738623],[(.D16,13233291376),(.D6,1257307702),(.D16,801914992),(.D6,2189438518),(.D16,628128880),(.D6,28843318),(.D16,37685296),(.D6,1409062),(.D16,2257132),(.D6,1225155224),(.D12,9236),(.D7,10475),(.D8,565),(.D7,4)])]], + .ms [(.m2,.s6,18924699646)], + .ms2 .s6 .s7 [(.m3,704643070,213909502)], + .ms [(.m3,.s6,21557673526)], + .ms2 .s6 .s7 [(.m3,13190824048,1246690870),(.m0,799260784,2188774966),(.m0,627962992,28801846),(.m0,37674928,1406470),(.m0,2256484,1225155062)], + .ms [(.m12,.s7,9195),(.m0,.s6,10465),(.m3,.s6,563),(.m21,.s3,563),(.m4,.s3,10465),(.m4,.s3,9195)], + .ms2 .s3 .s0 [(.m13,1225155062,2256484),(.m1,1406470,37674928),(.m1,28801846,627962992),(.m1,2188774966,799260784),(.m1,1246690870,13190824048),(.m1,21557673526,213909502)], + .ms [(.m4,.s3,704643070),(.m4,.s3,18924699640),(.m10,.s7,18924699646),(.m8,.s2,18924699641)], + .m .m9, + .b 0 [[([22548578228],[(.D7,18924699646)]),([2818572278,1409286143,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,704643070),(.D6,213909502),(.D6,21557673526)]),([88080383],[(.D16,13190824048),(.D6,1246690870),(.D16,799260784),(.D6,2188774966),(.D16,627962992),(.D6,28801846),(.D16,37674928),(.D6,1406470),(.D16,2256484),(.D6,1225155062),(.D12,9195),(.D16,10465),(.D16,563),(.D12,3)])],[([8],[(.D15,16106127367),(.D21,0),(.D19,37748733)])]], + .ms [(.m2,.s6,11274289118),(.m6,.s6,16106127365),(.m7,.s5,16106127365),(.m11,.s5,11274289112)], + .m .m5, + .b 11274289118 [[([41],[(.D12,16106127365),(.D8,1),(.D7,37748732)])],[([905969542],[(.D17,16106127361),(.D2,37748730)])]], + .ms [(.m2,.s6,11727273910),(.m3,.s6,15992881168),(.m27,.s2,15992881168),(.m1,.s5,11727273904)], + .m .m5, + .b 11727273910 [[([7],[(.D16,15992881168),(.D6,1)])],[([16],[(.D11,15992881166),(.D13,0),(.D6,1)])],[([8],[(.D15,15992881165),(.D17,1),(.D15,0),(.D6,21513633334)])],[([16],[(.D11,15992881163),(.D3,0)])],[([8],[(.D15,15992881162),(.D17,1),(.D21,21513633333),(.D15,13179814000),(.D17,1243938358),(.D15,798572656),(.D17,2188602934),(.D15,627919984),(.D17,28791094),(.D15,37672240),(.D17,1405798),(.D15,2256316),(.D17,1225155020),(.D11,9184),(.D12,10462)])],[([18],[(.D11,15992881160),(.D13,0),(.D16,21513633333),(.D16,13179814000)])],[([2315255782],[(.D17,15992881159),(.D12,21513633334),(.D17,13179814000),(.D6,1243938358),(.D16,798572656),(.D6,2188602934),(.D16,627919984),(.D6,28791094),(.D16,37672240),(.D6,1405798),(.D16,2256316),(.D6,1225155020),(.D12,9185),(.D13,10462),(.D9,562),(.D13,3)])]], + .ms [(.m2,.s6,12884901838)], + .ms2 .s6 .s7 [(.m3,15703474186,21441281592),(.m0,13161726064,1239416374),(.m0,797442160,2188320310),(.m0,627849328,28773430),(.m0,37667824,1404694),(.m0,2256040,1225154951)], + .ms [(.m3,.s6,9169)], + .ms2 .s6 .s7 [(.m6,10457,562)], + .ms2 .s3 .s0 [(.m19,562,10457)], + .ms [(.m17,.s0,9169)], + .ms2 .s3 .s0 [(.m4,1225154951,2256040),(.m1,1404694,37667824),(.m1,28773430,627849328),(.m1,2188320310,797442160),(.m1,1239416374,13161726064),(.m1,21441281592,15703474186)], + .ms [(.m1,.s3,12884901832),(.m10,.s7,12884901838),(.m8,.s2,12884901833)], + .m .m9, + .b 0 [[([10871635964],[(.D7,12884901838),(.D17,15703474186),(.D6,21441281592),(.D16,13161726064),(.D6,1239416374),(.D16,797442160),(.D6,2188320310),(.D16,627849328),(.D6,28773430),(.D16,37667824),(.D6,1404694),(.D16,2256040),(.D6,1225154951),(.D6,9169),(.D12,10457),(.D6,562),(.D16,4)])]], + .ms [(.m2,.s6,5435817982),(.m3,.s6,11525947342)], + .ms2 .s6 .s7 [(.m3,15363735562,21356346936),(.m0,13140492400,1234107958),(.m0,796115056,2187988534),(.m0,627766384,28752694),(.m0,37662640,1403398),(.m0,2255716,1225154870)], + .ms [(.m12,.s7,9147),(.m0,.s6,10453),(.m3,.s6,560),(.m20,.s0,560),(.m1,.s3,10453),(.m4,.s3,9147)], + .ms2 .s3 .s0 [(.m13,1225154870,2255716),(.m1,1403398,37662640),(.m1,28752694,627766384),(.m1,2187988534,796115056),(.m1,1234107958,13140492400),(.m1,21356346936,15363735562)], + .ms [(.m1,.s3,11525947342),(.m4,.s3,5435817976),(.m10,.s7,5435817982),(.m8,.s2,5435817977)], + .m .m9, + .b 0 [[([21743271926,10871635965,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,5435817982),(.D17,11525947342)]),([2717908990],[(.D16,15363735562),(.D6,21356346936),(.D16,13140492400),(.D6,1234107958),(.D16,796115056),(.D6,2187988534),(.D16,627766384),(.D6,28752694),(.D16,37662640),(.D6,1403398),(.D16,2255716),(.D6,1225154870),(.D12,9147),(.D16,10453),(.D16,560),(.D6,5)])]], + .ms [(.m2,.s6,21743271925),(.m14,.s5,21743271919)], + .m .m5, + .b 21743271925 [[([5],[(.D18,1),(.D15,10166992845),(.D14,15023996938)])]], + .ms [(.m2,.s6,21743271928),(.m7,.s5,21743271922)], + .m .m5, + .b 21743271928 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,21743271929),(.m15,.s5,21743271923)], + .m .m5, + .b 21743271929 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,21743271930),(.m25,.s2,21743271925)], + .m .m18, + .b 21743271930 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,21743271932),(.m14,.s5,21743271926)], + .m .m5, + .b 21743271932 [[([5],[(.D18,1),(.D17,10166992844),(.D15,15023996938),(.D17,21271412280),(.D15,13119258736),(.D17,1228799542),(.D15,794787952),(.D17,2187656758),(.D15,627683440),(.D17,28731958),(.D15,37657456),(.D17,1402102),(.D15,2255392),(.D17,1225154789),(.D17,9128),(.D8,10447)])]], + .ms [(.m2,.s6,21743271935),(.m7,.s5,21743271929)], + .m .m5, + .b 21743271935 [[([14898167805],[(.D8,10166992844),(.D16,15023996938),(.D6,21271412280),(.D16,13119258736),(.D6,1228799542),(.D16,794787952),(.D6,2187656758),(.D16,627683440),(.D6,28731958),(.D16,37657456),(.D6,1402102),(.D16,2255392),(.D6,1225154789),(.D6,9129),(.D9,10447),(.D14,558),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,29192355838,8304721870),(.m0,14558429194,21155020344),(.m0,13090160752,1221525046),(.m0,792969328,2187202102),(.m0,627569776,28703542),(.m0,37650352,1400326),(.m0,2254948,1225154678)], + .ms [(.m12,.s7,9099),(.m0,.s6,10441),(.m3,.s6,557),(.m21,.s3,557),(.m4,.s3,10441),(.m4,.s3,9099)], + .ms2 .s3 .s0 [(.m13,1225154678,2254948),(.m1,1400326,37650352),(.m1,28703542,627569776),(.m1,2187202102,792969328),(.m1,1221525046,13090160752),(.m1,21155020344,14558429194),(.m1,8304721870,29192355833)], + .ms [(.m26,.s7,29192355838),(.m8,.s2,29192355833)], + .m .m9, + .b 0 [[([59592671228],[(.D7,29192355838),(.D7,8304721869),(.D16,14558429194),(.D6,21155020344),(.D16,13090160752),(.D6,1221525046),(.D16,792969328),(.D6,2187202102),(.D16,627569776),(.D6,28703542),(.D16,37650352),(.D6,1400326),(.D16,2254948),(.D6,1225154678),(.D12,9099),(.D16,10441),(.D16,557),(.D12,3)])]], + .ms [(.m2,.s6,29796335614)], + .ms2 .s6 .s7 [(.m3,21743271934,6442450894),(.m0,14092861450,21038628408),(.m0,13061062768,1214250550),(.m0,791150704,2186747446),(.m0,627456112,28675126),(.m0,37643248,1398550),(.m0,2254504,1225154567)], + .ms [(.m3,.s6,9073)], + .ms2 .s6 .s7 [(.m6,10433,556)], + .ms2 .s3 .s0 [(.m19,556,10433)], + .ms [(.m17,.s0,9073)], + .ms2 .s3 .s0 [(.m4,1225154567,2254504),(.m1,1398550,37643248),(.m1,28675126,627456112),(.m1,2186747446,791150704),(.m1,1214250550,13061062768),(.m1,21038628408,14092861450),(.m1,6442450894,21743271934)], + .ms [(.m1,.s3,29796335608),(.m10,.s7,29796335614),(.m8,.s2,29796335609)], + .m .m9, + .b 0 [[([119185342454,54760833030],[(.D7,29796335614),(.D17,21743271934)]),([10871635967],[(.D6,6442450894),(.D16,14092861450),(.D6,21038628408),(.D16,13061062768),(.D6,1214250550),(.D16,791150704),(.D6,2186747446),(.D16,627456112),(.D6,28675126),(.D16,37643248),(.D6,1398550),(.D16,2254504),(.D6,1225154567),(.D6,9073),(.D12,10433),(.D6,556),(.D16,4)])]], + .ms [(.m2,.s6,86973087742),(.m3,.s6,8053063678)], + .ms2 .s6 .s7 [(.m3,16307453950,5083496398),(.m0,13753122826,20953693752),(.m0,13039829104,1208942134),(.m0,789823600,2186415670),(.m0,627373168,28654390),(.m0,37638064,1397254),(.m0,2254180,1225154486)], + .ms [(.m12,.s7,9051),(.m0,.s6,10429),(.m3,.s6,554),(.m20,.s0,554),(.m1,.s3,10429),(.m4,.s3,9051)], + .ms2 .s3 .s0 [(.m13,1225154486,2254180),(.m1,1397254,37638064),(.m1,28654390,627373168),(.m1,2186415670,789823600),(.m1,1208942134,13039829104),(.m1,20953693752,13753122826),(.m1,5083496398,16307453950)], + .ms [(.m1,.s3,8053063678),(.m4,.s3,86973087736),(.m10,.s7,86973087742),(.m8,.s2,86973087737)], + .m .m9, + .b 0 [[([257698037684],[(.D7,86973087742)]),([32212254710,16106127359,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,8053063678),(.D16,16307453950)]),([4026531838],[(.D6,5083496398),(.D16,13753122826),(.D6,20953693752),(.D16,13039829104),(.D6,1208942134),(.D16,789823600),(.D6,2186415670),(.D16,627373168),(.D6,28654390),(.D16,37638064),(.D6,1397254),(.D16,2254180),(.D6,1225154486),(.D12,9051),(.D16,10429),(.D16,554),(.D6,5)])]], + .ms [(.m2,.s6,128849018842),(.m3,.s6,54760833031),(.m14,.s5,54760833031),(.m4,.s5,128849018836)], + .m .m5, + .b 128849018842 [[([23],[(.D16,54760833031),(.D18,1),(.D15,14294188029),(.D16,4580179918)])]], + .ms [(.m2,.s6,128849018854),(.m3,.s6,54760833028),(.m7,.s5,54760833028),(.m4,.s5,128849018848)], + .m .m5, + .b 128849018854 [[([7],[(.D16,54760833028),(.D6,1)])]], + .ms [(.m2,.s6,128849018858),(.m6,.s6,54760833026),(.m15,.s5,54760833026),(.m11,.s5,128849018852)], + .m .m5, + .b 128849018858 [[([5],[(.D12,54760833026),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,128849018861,54760833027)], + .ms [(.m23,.s1,54760833027),(.m22,.s4,128849018855)], + .m .m24, + .b 128849018861 [[([17],[(.D6,54760833027),(.D6,2)])]], + .ms [(.m2,.s6,128849018870),(.m6,.s6,54760833023),(.m14,.s5,54760833023),(.m11,.s5,128849018864)], + .m .m5, + .b 128849018870 [[([23],[(.D12,54760833023),(.D18,1),(.D17,14294188028),(.D17,4580179918),(.D15,13627293706),(.D17,20922236472),(.D15,13031964784),(.D17,1206976054),(.D15,789332080),(.D17,2186292790),(.D15,627342448),(.D17,28646710),(.D15,37636144),(.D17,1396774),(.D15,2254060),(.D17,1225154456),(.D11,9043),(.D6,10428)])]], + .ms [(.m2,.s6,128849018882),(.m6,.s6,54760833020),(.m7,.s5,54760833020),(.m11,.s5,128849018876)], + .m .m5, + .b 128849018882 [[([219043332081,109521666045,19327352841],[(.D12,54760833020),(.D8,14294188028),(.D6,4580179918),(.D16,13627293706)]),([1358954495],[(.D6,20922236472),(.D16,13031964784),(.D6,1206976054),(.D16,789332080),(.D6,2186292790),(.D16,627342448),(.D6,28646710),(.D16,37636144),(.D6,1396774),(.D16,2254060),(.D6,1225154456),(.D12,9044),(.D7,10427),(.D8,553),(.D7,4)])]], + .ms [(.m2,.s6,302795194366)], + .ms2 .s6 .s7 [(.m3,11274289150,3422552062)], + .ms [(.m3,.s6,1862270926)], + .ms2 .s6 .s7 [(.m3,12947816458,20752367160),(.m0,12989497456,1196359222),(.m0,786677872,2185629238),(.m0,627176560,28605238),(.m0,37625776,1394182),(.m0,2253412,1225154294)], + .ms [(.m12,.s7,9003),(.m0,.s6,10417),(.m3,.s6,551),(.m21,.s3,551),(.m4,.s3,10417),(.m4,.s3,9003)], + .ms2 .s3 .s0 [(.m13,1225154294,2253412),(.m1,1394182,37625776),(.m1,28605238,627176560),(.m1,2185629238,786677872),(.m1,1196359222,12989497456),(.m1,20752367160,12947816458),(.m1,1862270926,3422552062)], + .ms [(.m4,.s3,11274289150),(.m4,.s3,302795194360),(.m10,.s7,302795194366),(.m8,.s2,302795194361)], + .m .m9, + .b 0 [[([360777252788],[(.D7,302795194366)]),([45097156598,22548578303,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,11274289150),(.D6,3422552062),(.D6,1862270926)]),([1409286143],[(.D16,12947816458),(.D6,20752367160),(.D16,12989497456),(.D6,1196359222),(.D16,786677872),(.D6,2185629238),(.D16,627176560),(.D6,28605238),(.D16,37625776),(.D6,1394182),(.D16,2253412),(.D6,1225154294),(.D12,9003),(.D16,10417),(.D16,551),(.D12,3)])],[([8],[(.D15,257698037767),(.D21,0),(.D19,603979773)])]], + .ms [(.m2,.s6,180388626398),(.m6,.s6,257698037765),(.m7,.s5,257698037765),(.m11,.s5,180388626392)], + .m .m5, + .b 180388626398 [[([41],[(.D12,257698037765),(.D8,1),(.D7,603979772)])],[([14495514502],[(.D17,257698037761),(.D2,603979770)])]], + .ms [(.m2,.s6,187636383670),(.m3,.s6,255886098448),(.m27,.s2,255886098448),(.m1,.s5,187636383664)], + .m .m5, + .b 187636383670 [[([7],[(.D16,255886098448), + (.D6,1)])], + [([16],[(.D11,255886098446), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,255886098445), + (.D17,1), + (.D15,0), + (.D6,1157627854)])], + [([16],[(.D11,255886098443), + (.D3,0)])], + [([8],[(.D15,255886098442), + (.D17,1), + (.D21,1157627853), + (.D15,12771655690), + (.D17,20708326968), + (.D15,12978487408), + (.D17,1193606710), + (.D15,785989744), + (.D17,2185457206), + (.D15,627133552), + (.D17,28594486), + (.D15,37623088), + (.D17,1393510), + (.D15,2253244), + (.D17,1225154252), + (.D11,8992), + (.D12,10414)])], + [([18],[(.D11,255886098440), + (.D13,0), + (.D16,1157627853), + (.D16,12771655690)])], + [([37044091332],[(.D17,255886098439)]), + ([4630511419,2315255711,1157627856,578813928,289406964,144703479,72351741,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,1157627854), + (.D17,12771655690)]), + ([578813927],[(.D6,20708326968), + (.D16,12978487408), + (.D6,1193606710), + (.D16,785989744), + (.D6,2185457206), + (.D16,627133552), + (.D6,28594486), + (.D16,37623088), + (.D6,1393510), + (.D16,2253244), + (.D6,1225154252), + (.D12,8993), + (.D13,10414), + (.D9,550), + (.D13,3)])], + [([10],[(.D17,251255587023), + (.D21,0), + (.D19,12482248726)])]], + .ms [(.m2,.s6,206158429378),(.m3,.s6,251255587021),(.m7,.s5,251255587021),(.m4,.s5,206158429372)], + .m .m5, + .b 206158429378 [[([43],[(.D16,251255587021),(.D8,1),(.D7,12482248725)])],[([299573969370],[(.D11,251255587014),(.D2,12482248723)])]], + .ms2 .s6 .s7 [(.m2,355945414085,213808840845)], + .ms [(.m29,.s2,213808840845),(.m4,.s5,355945414079)], + .m .m5, + .b 355945414085 [[([9],[(.D6,213808840845),(.D6,1)])],[([20],[(.D15,213808840843),(.D13,0),(.D10,20635975226),(.D9,12960399472)])],[([36],[(.D11,213808840839)]),([7,2],[(.D12,1),(.D6,20635975226)])]], + .ms [(.m2,.s6,355945414118),(.m6,.s6,213808840835),(.m15,.s5,213808840835),(.m11,.s5,355945414112)], + .m .m5, + .b 355945414118 [[([5],[(.D12,213808840835),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,355945414121,213808840836)], + .ms [(.m23,.s1,213808840836),(.m22,.s4,355945414115)], + .m .m24, + .b 355945414121 [[([17],[(.D6,213808840836),(.D6,2)])],[([6],[(.D11,213808840832),(.D21,0),(.D7,20635975224)])]], + .ms2 .s6 .s7 [(.m2,355945414133,213808840833)], + .ms2 .s5 .s2 [(.m28,213808840833,355945414128)], + .m .m18, + .b 355945414133 [[([45],[(.D6,213808840833),(.D8,1),(.D17,20635975223),(.D10,12960399471)])],[([36],[(.D15,213808840826)]),([7,2],[(.D12,1),(.D17,20635975222)]),([1],[(.D11,12960399471),(.D16,1189084726)])],[([8],[(.D15,213808840822),(.D21,0),(.D17,20635975221),(.D12,12960399472)])]], + .ms [(.m2,.s6,355945414178),(.m6,.s6,213808840820),(.m7,.s5,213808840820),(.m11,.s5,355945414172)], + .m .m5, + .b 355945414178 [[([39],[(.D12,213808840820),(.D8,20635975222),(.D13,12960399472),(.D17,1189084726),(.D15,784859248),(.D17,2185174582),(.D15,627062896),(.D17,28576822),(.D15,37618672),(.D17,1392406),(.D15,2252968),(.D17,1225154183),(.D17,8977),(.D11,10409),(.D17,550),(.D15,3)])]], + .ms [(.m2,.s6,355945414198)], + .ms2 .s6 .s7 [(.m3,213808840816,20635975222),(.m0,12960399472,1189084726),(.m0,784859248,2185174582),(.m0,627062896,28576822),(.m0,37618672,1392406),(.m0,2252968,1225154183)], + .ms [(.m3,.s6,8977)], + .ms2 .s6 .s7 [(.m6,10409,550)], + .ms2 .s3 .s0 [(.m19,550,10409)], + .ms [(.m17,.s0,8977)], + .ms2 .s3 .s0 [(.m4,1225154183,2252968),(.m1,1392406,37618672),(.m1,28576822,627062896),(.m1,2185174582,784859248),(.m1,1189084726,12960399472),(.m1,20635975222,213808840816)], + .ms [(.m1,.s3,355945414192),(.m10,.s7,355945414198),(.m8,.s2,355945414193)], + .m .m9, + .b 0 [[([10871635964],[(.D7,355945414198),(.D17,213808840816),(.D6,20635975222),(.D16,12960399472),(.D6,1189084726),(.D16,784859248),(.D6,2185174582),(.D16,627062896),(.D6,28576822),(.D16,37618672),(.D6,1392406),(.D16,2252968),(.D6,1225154183),(.D6,8977),(.D12,10409),(.D6,550),(.D16,4)])]], + .ms [(.m2,.s6,5435817982),(.m3,.s6,354586459702)], + .ms2 .s6 .s7 [(.m3,213469102192,20551040566),(.m0,12939165808,1183776310),(.m0,783532144,2184842806),(.m0,626979952,28556086),(.m0,37613488,1391110),(.m0,2252644,1225154102)], + .ms [(.m12,.s7,8955),(.m0,.s6,10405),(.m3,.s6,548),(.m20,.s0,548),(.m1,.s3,10405),(.m4,.s3,8955)], + .ms2 .s3 .s0 [(.m13,1225154102,2252644),(.m1,1391110,37613488),(.m1,28556086,626979952),(.m1,2184842806,783532144),(.m1,1183776310,12939165808),(.m1,20551040566,213469102192)], + .ms [(.m1,.s3,354586459702),(.m4,.s3,5435817976),(.m10,.s7,5435817982),(.m8,.s2,5435817977)], + .m .m9, + .b 0 [[([21743271926,10871635965,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39],[(.D7,5435817982),(.D17,354586459702)]),([2717908988],[(.D16,213469102192),(.D6,20551040566),(.D16,12939165808),(.D6,1183776310),(.D16,783532144),(.D6,2184842806),(.D16,626979952),(.D6,28556086),(.D16,37613488),(.D6,1391110),(.D16,2252644),(.D6,1225154102),(.D12,8955),(.D16,10405),(.D16,548),(.D6,5)])]], + ] (by decide +kernel) +theorem chunk_11_step : (cfg_11.denote) [qi]⊢* (cfg_12.denote) := + step_chunk [ + .b 21743271907 [[([21,12,3],[(.D9,4),(.D14,353227505207)]),([2],[(.D12,213129363568)])]], + .ms [(.m2,.s6,21743271925),(.m14,.s5,21743271919)], + .m .m5, + .b 21743271925 [[([5],[(.D18,1),(.D15,353227505205),(.D14,213129363568)])]], + .ms [(.m2,.s6,21743271928),(.m7,.s5,21743271922)], + .m .m5, + .b 21743271928 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,21743271929),(.m15,.s5,21743271923)], + .m .m5, + .b 21743271929 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,21743271930),(.m25,.s2,21743271925)], + .m .m18, + .b 21743271930 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,21743271932),(.m14,.s5,21743271926)], + .m .m5, + .b 21743271932 [[([5],[(.D18,1),(.D17,353227505204),(.D15,213129363568),(.D17,20466105910),(.D15,12917932144),(.D17,1178467894),(.D15,782205040),(.D17,2184511030),(.D15,626897008),(.D17,28535350),(.D15,37608304),(.D17,1389814),(.D15,2252320),(.D17,1225154021),(.D17,8936),(.D8,10399)])]], + .ms [(.m2,.s6,21743271935),(.m7,.s5,21743271929)], + .m .m5, + .b 21743271935 [[([14898167805],[(.D8,353227505204),(.D16,213129363568),(.D6,20466105910),(.D16,12917932144),(.D6,1178467894),(.D16,782205040),(.D6,2184511030),(.D16,626897008),(.D6,28535350),(.D16,37608304),(.D6,1389814),(.D16,2252320),(.D6,1225154021),(.D6,8937),(.D9,10399),(.D14,546),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,29192355838,351365234230),(.m0,212663795824,20349713974),(.m0,12888834160,1171193398),(.m0,780386416,2184056374),(.m0,626783344,28506934),(.m0,37601200,1388038),(.m0,2251876,1225153910)], + .ms [(.m12,.s7,8907),(.m0,.s6,10393),(.m3,.s6,545),(.m21,.s3,545),(.m4,.s3,10393),(.m4,.s3,8907)], + .ms2 .s3 .s0 [(.m13,1225153910,2251876),(.m1,1388038,37601200),(.m1,28506934,626783344),(.m1,2184056374,780386416),(.m1,1171193398,12888834160),(.m1,20349713974,212663795824),(.m1,351365234230,29192355833)], + .ms [(.m26,.s7,29192355838),(.m8,.s2,29192355833)], + .m .m9, + .b 0 [[([59592671228],[(.D7,29192355838),(.D7,351365234229),(.D16,212663795824),(.D6,20349713974),(.D16,12888834160),(.D6,1171193398),(.D16,780386416),(.D6,2184056374),(.D16,626783344),(.D6,28506934),(.D16,37601200),(.D6,1388038),(.D16,2251876),(.D6,1225153910),(.D12,8907),(.D16,10393),(.D16,545),(.D12,3)])]], + .ms [(.m2,.s6,29796335614)], + .ms2 .s6 .s7 [(.m3,21743271934,349502963254),(.m0,212198228080,20233322038),(.m0,12859736176,1163918902),(.m0,778567792,2183601718),(.m0,626669680,28478518),(.m0,37594096,1386262),(.m0,2251432,1225153799)], + .ms [(.m3,.s6,8881)], + .ms2 .s6 .s7 [(.m6,10385,544)], + .ms2 .s3 .s0 [(.m19,544,10385)], + .ms [(.m17,.s0,8881)], + .ms2 .s3 .s0 [(.m4,1225153799,2251432),(.m1,1386262,37594096),(.m1,28478518,626669680),(.m1,2183601718,778567792),(.m1,1163918902,12859736176),(.m1,20233322038,212198228080),(.m1,349502963254,21743271934)], + .ms [(.m1,.s3,29796335608),(.m10,.s7,29796335614),(.m8,.s2,29796335609)], + .m .m9, + .b 0 [[([119185342454,54760833030],[(.D7,29796335614),(.D17,21743271934)]),([10871635967],[(.D6,349502963254),(.D16,212198228080),(.D6,20233322038),(.D16,12859736176),(.D6,1163918902),(.D16,778567792),(.D6,2183601718),(.D16,626669680),(.D6,28478518),(.D16,37594096),(.D6,1386262),(.D16,2251432),(.D6,1225153799),(.D6,8881),(.D12,10385),(.D6,544),(.D16,4)])]], + .ms [(.m2,.s6,86973087742),(.m3,.s6,8053063678)], + .ms2 .s6 .s7 [(.m3,16307453950,348144008758),(.m0,211858489456,20148387382),(.m0,12838502512,1158610486),(.m0,777240688,2183269942),(.m0,626586736,28457782),(.m0,37588912,1384966),(.m0,2251108,1225153718)], + .ms [(.m12,.s7,8859),(.m0,.s6,10381),(.m3,.s6,542),(.m20,.s0,542),(.m1,.s3,10381),(.m4,.s3,8859)], + .ms2 .s3 .s0 [(.m13,1225153718,2251108),(.m1,1384966,37588912),(.m1,28457782,626586736),(.m1,2183269942,777240688),(.m1,1158610486,12838502512),(.m1,20148387382,211858489456),(.m1,348144008758,16307453950)], + .ms [(.m1,.s3,8053063678),(.m4,.s3,86973087736),(.m10,.s7,86973087742),(.m8,.s2,86973087737)], + .m .m9, + .b 0 [[([257698037684],[(.D7,86973087742)]),([32212254710,16106127359,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,8053063678),(.D16,16307453950)]),([4026531838],[(.D6,348144008758),(.D16,211858489456),(.D6,20148387382),(.D16,12838502512),(.D6,1158610486),(.D16,777240688),(.D6,2183269942),(.D16,626586736),(.D6,28457782),(.D16,37588912),(.D6,1384966),(.D16,2251108),(.D6,1225153718),(.D12,8859),(.D16,10381),(.D16,542),(.D6,5)])]], + .ms [(.m2,.s6,128849018842),(.m3,.s6,54760833031),(.m14,.s5,54760833031),(.m4,.s5,128849018836)], + .m .m5, + .b 128849018842 [[([23],[(.D16,54760833031),(.D18,1),(.D15,14294188029),(.D16,347640692278)])]], + .ms [(.m2,.s6,128849018854),(.m3,.s6,54760833028),(.m7,.s5,54760833028),(.m4,.s5,128849018848)], + .m .m5, + .b 128849018854 [[([7],[(.D16,54760833028),(.D6,1)])]], + .ms [(.m2,.s6,128849018858),(.m6,.s6,54760833026),(.m15,.s5,54760833026),(.m11,.s5,128849018852)], + .m .m5, + .b 128849018858 [[([5],[(.D12,54760833026),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,128849018861,54760833027)], + .ms [(.m23,.s1,54760833027),(.m22,.s4,128849018855)], + .m .m24, + .b 128849018861 [[([17],[(.D6,54760833027),(.D6,2)])]], + .ms [(.m2,.s6,128849018870),(.m6,.s6,54760833023),(.m14,.s5,54760833023),(.m11,.s5,128849018864)], + .m .m5, + .b 128849018870 [[([23],[(.D12,54760833023),(.D18,1),(.D17,14294188028),(.D17,347640692278),(.D15,211732660336),(.D17,20116930102),(.D15,12830638192),(.D17,1156644406),(.D15,776749168),(.D17,2183147062),(.D15,626556016),(.D17,28450102),(.D15,37586992),(.D17,1384486),(.D15,2250988),(.D17,1225153688),(.D11,8851),(.D6,10380)])]], + .ms [(.m2,.s6,128849018882),(.m6,.s6,54760833020),(.m7,.s5,54760833020),(.m11,.s5,128849018876)], + .m .m5, + .b 128849018882 [[([219043332081,109521666045,19327352841],[(.D12,54760833020),(.D8,14294188028),(.D6,347640692278)]),([5435817983],[(.D16,211732660336),(.D6,20116930102),(.D16,12830638192),(.D6,1156644406),(.D16,776749168),(.D6,2183147062),(.D16,626556016),(.D6,28450102),(.D16,37586992),(.D6,1384486),(.D16,2250988),(.D6,1225153688),(.D12,8852),(.D7,10379),(.D8,541),(.D7,4)])]], + .ms [(.m2,.s6,302795194366)], + .ms2 .s6 .s7 [(.m3,11274289150,3422552062)], + .ms [(.m3,.s6,344922783286)], + .ms2 .s6 .s7 [(.m3,211053183088,19947060790),(.m0,12788170864,1146027574),(.m0,774094960,2182483510),(.m0,626390128,28408630),(.m0,37576624,1381894),(.m0,2250340,1225153526)], + .ms [(.m12,.s7,8811),(.m0,.s6,10369),(.m3,.s6,539),(.m21,.s3,539),(.m4,.s3,10369),(.m4,.s3,8811)], + .ms2 .s3 .s0 [(.m13,1225153526,2250340),(.m1,1381894,37576624),(.m1,28408630,626390128),(.m1,2182483510,774094960),(.m1,1146027574,12788170864),(.m1,19947060790,211053183088),(.m1,344922783286,3422552062)], + .ms [(.m4,.s3,11274289150),(.m4,.s3,302795194360),(.m10,.s7,302795194366),(.m8,.s2,302795194361)], + .m .m9, + .b 0 [[([360777252788],[(.D7,302795194366)]),([45097156598,22548578303,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,11274289150),(.D6,3422552062),(.D6,344922783286)]),([1409286143],[(.D16,211053183088),(.D6,19947060790),(.D16,12788170864),(.D6,1146027574),(.D16,774094960),(.D6,2182483510),(.D16,626390128),(.D6,28408630),(.D16,37576624),(.D6,1381894),(.D16,2250340),(.D6,1225153526),(.D12,8811),(.D16,10369),(.D16,539),(.D12,3)])],[([8],[(.D15,257698037767),(.D21,0),(.D19,603979773)])]], + .ms [(.m2,.s6,180388626398),(.m6,.s6,257698037765),(.m7,.s5,257698037765),(.m11,.s5,180388626392)], + .m .m5, + .b 180388626398 [[([41],[(.D12,257698037765),(.D8,1),(.D7,603979772)])],[([14495514502],[(.D17,257698037761),(.D2,603979770)])]], + .ms [(.m2,.s6,187636383670),(.m3,.s6,255886098448),(.m27,.s2,255886098448),(.m1,.s5,187636383664)], + .m .m5, + .b 187636383670 [[([7],[(.D16,255886098448),(.D6,1)])],[([16],[(.D11,255886098446),(.D13,0),(.D6,1)])],[([8],[(.D15,255886098445),(.D17,1),(.D15,0),(.D6,344218140214)])],[([16],[(.D11,255886098443),(.D3,0)])],[([8],[(.D15,255886098442),(.D17,1),(.D21,344218140213),(.D15,210877022320),(.D17,19903020598),(.D15,12777160816),(.D17,1143275062),(.D15,773406832),(.D17,2182311478),(.D15,626347120),(.D17,28397878),(.D15,37573936),(.D17,1381222),(.D15,2250172),(.D17,1225153484),(.D11,8800),(.D12,10366)])],[([18],[(.D11,255886098440),(.D13,0),(.D16,344218140213),(.D16,210877022320)])],[([37044092902],[(.D17,255886098439),(.D12,344218140214),(.D17,210877022320),(.D6,19903020598),(.D16,12777160816),(.D6,1143275062),(.D16,773406832),(.D6,2182311478),(.D16,626347120),(.D6,28397878),(.D16,37573936),(.D6,1381222),(.D16,2250172),(.D6,1225153484),(.D12,8801),(.D13,10366),(.D9,538),(.D13,3)])]], + .ms [(.m2,.s6,206158430158)], + .ms2 .s6 .s7 [(.m3,251255586826,343060512312),(.m0,210587615344,19830668854),(.m0,12759072880,1138753078),(.m0,772276336,2182028854),(.m0,626276464,28380214),(.m0,37569520,1380118),(.m0,2249896,1225153415)], + .ms [(.m3,.s6,8785)], + .ms2 .s6 .s7 [(.m6,10361,538)], + .ms2 .s3 .s0 [(.m19,538,10361)], + .ms [(.m17,.s0,8785)], + .ms2 .s3 .s0 [(.m4,1225153415,2249896),(.m1,1380118,37569520),(.m1,28380214,626276464),(.m1,2182028854,772276336),(.m1,1138753078,12759072880),(.m1,19830668854,210587615344),(.m1,343060512312,251255586826)], + .ms [(.m1,.s3,206158430152),(.m10,.s7,206158430158),(.m8,.s2,206158430153)], + .m .m9, + .b 0 [[([173946175484],[(.D7,206158430158),(.D17,251255586826),(.D6,343060512312),(.D16,210587615344),(.D6,19830668854),(.D16,12759072880),(.D6,1138753078),(.D16,772276336),(.D6,2182028854),(.D16,626276464),(.D6,28380214),(.D16,37569520),(.D6,1380118),(.D16,2249896),(.D6,1225153415),(.D6,8785),(.D12,10361),(.D6,538),(.D16,4)])]], + .ms [(.m2,.s6,86973087742),(.m3,.s6,184415158222)], + .ms2 .s6 .s7 [(.m3,245819768842,341701557816),(.m0,210247876720,19745734198),(.m0,12737839216,1133444662),(.m0,770949232,2181697078),(.m0,626193520,28359478),(.m0,37564336,1378822),(.m0,2249572,1225153334)], + .ms [(.m12,.s7,8763),(.m0,.s6,10357),(.m3,.s6,536),(.m20,.s0,536),(.m1,.s3,10357),(.m4,.s3,8763)], + .ms2 .s3 .s0 [(.m13,1225153334,2249572),(.m1,1378822,37564336),(.m1,28359478,626193520),(.m1,2181697078,770949232),(.m1,1133444662,12737839216),(.m1,19745734198,210247876720),(.m1,341701557816,245819768842)], + .ms [(.m1,.s3,184415158222),(.m4,.s3,86973087736),(.m10,.s7,86973087742),(.m8,.s2,86973087737)], + .m .m9, + .b 0 [[([347892350966,173946175485,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,86973087742),(.D17,184415158222)]),([43486543870],[(.D16,245819768842),(.D6,341701557816),(.D16,210247876720),(.D6,19745734198),(.D16,12737839216),(.D6,1133444662),(.D16,770949232),(.D6,2181697078),(.D16,626193520),(.D6,28359478),(.D16,37564336),(.D6,1378822),(.D16,2249572),(.D6,1225153334),(.D12,8763),(.D16,10357),(.D16,536),(.D6,5)])]], + .ms [(.m2,.s6,347892350965),(.m14,.s5,347892350959)], + .m .m5, + .b 347892350965 [[([5],[(.D18,1),(.D15,162671886285),(.D14,240383950858)])]], + .ms [(.m2,.s6,347892350968),(.m7,.s5,347892350962)], + .m .m5, + .b 347892350968 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,347892350969),(.m15,.s5,347892350963)], + .m .m5, + .b 347892350969 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,347892350970),(.m25,.s2,347892350965)], + .m .m18, + .b 347892350970 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,347892350972),(.m14,.s5,347892350966)], + .m .m5, + .b 347892350972 [[([5],[(.D18,1),(.D17,162671886284),(.D15,240383950858),(.D17,340342603320),(.D15,209908138096),(.D17,19660799542),(.D15,12716605552),(.D17,1128136246),(.D15,769622128),(.D17,2181365302),(.D15,626110576),(.D17,28338742),(.D15,37559152),(.D17,1377526),(.D15,2249248),(.D17,1225153253),(.D17,8744),(.D8,10351)])]], + .ms [(.m2,.s6,347892350975),(.m7,.s5,347892350969)], + .m .m5, + .b 347892350975 [[([238370684925],[(.D8,162671886284),(.D16,240383950858),(.D6,340342603320),(.D16,209908138096),(.D6,19660799542),(.D16,12716605552),(.D6,1128136246),(.D16,769622128),(.D6,2181365302),(.D16,626110576),(.D6,28338742),(.D16,37559152),(.D6,1377526),(.D16,2249248),(.D6,1225153253),(.D6,8745),(.D9,10351),(.D14,534),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,467077693438,132875550670),(.m0,232934866954,338480332344),(.m0,209442570352,19544407606),(.m0,12687507568,1120861750),(.m0,767803504,2180910646),(.m0,625996912,28310326),(.m0,37552048,1375750),(.m0,2248804,1225153142)], + .ms [(.m12,.s7,8715),(.m0,.s6,10345),(.m3,.s6,533),(.m21,.s3,533),(.m4,.s3,10345),(.m4,.s3,8715)], + .ms2 .s3 .s0 [(.m13,1225153142,2248804),(.m1,1375750,37552048),(.m1,28310326,625996912),(.m1,2180910646,767803504),(.m1,1120861750,12687507568),(.m1,19544407606,209442570352),(.m1,338480332344,232934866954),(.m1,132875550670,467077693433)], + .ms [(.m26,.s7,467077693438),(.m8,.s2,467077693433)], + .m .m9, + .b 0 [[([953482739708],[(.D7,467077693438),(.D7,132875550669),(.D16,232934866954),(.D6,338480332344),(.D16,209442570352),(.D6,19544407606),(.D16,12687507568),(.D6,1120861750),(.D16,767803504),(.D6,2180910646),(.D16,625996912),(.D6,28310326),(.D16,37552048),(.D6,1375750),(.D16,2248804),(.D6,1225153142),(.D12,8715),(.D16,10345),(.D16,533),(.D12,3)])]], + .ms [(.m2,.s6,476741369854)], + .ms2 .s6 .s7 [(.m3,347892350974,103079215054),(.m0,225485783050,336618061368),(.m0,208977002608,19428015670),(.m0,12658409584,1113587254),(.m0,765984880,2180455990),(.m0,625883248,28281910),(.m0,37544944,1373974),(.m0,2248360,1225153031)], + .ms [(.m3,.s6,8689)], + .ms2 .s6 .s7 [(.m6,10337,532)], + .ms2 .s3 .s0 [(.m19,532,10337)], + .ms [(.m17,.s0,8689)], + .ms2 .s3 .s0 [(.m4,1225153031,2248360),(.m1,1373974,37544944),(.m1,28281910,625883248),(.m1,2180455990,765984880),(.m1,1113587254,12658409584),(.m1,19428015670,208977002608),(.m1,336618061368,225485783050),(.m1,103079215054,347892350974)], + .ms [(.m1,.s3,476741369848),(.m10,.s7,476741369854),(.m8,.s2,476741369849)], + .m .m9, + .b 0 [[([1906965479414,876173328390],[(.D7,476741369854),(.D17,347892350974)]),([173946175487],[(.D6,103079215054),(.D16,225485783050),(.D6,336618061368),(.D16,208977002608),(.D6,19428015670),(.D16,12658409584),(.D6,1113587254),(.D16,765984880),(.D6,2180455990),(.D16,625883248),(.D6,28281910),(.D16,37544944),(.D6,1373974),(.D16,2248360),(.D6,1225153031),(.D6,8689),(.D12,10337),(.D6,532),(.D16,4)])]], + .ms [(.m2,.s6,1391569403902),(.m3,.s6,128849018878)], + .ms2 .s6 .s7 [(.m3,260919263230,81335943118),(.m0,220049965066,335259106872),(.m0,208637263984,19343081014),(.m0,12637175920,1108278838),(.m0,764657776,2180124214),(.m0,625800304,28261174),(.m0,37539760,1372678),(.m0,2248036,1225152950)], + .ms [(.m12,.s7,8667),(.m0,.s6,10333),(.m3,.s6,530),(.m20,.s0,530),(.m1,.s3,10333),(.m4,.s3,8667)], + .ms2 .s3 .s0 [(.m13,1225152950,2248036),(.m1,1372678,37539760),(.m1,28261174,625800304),(.m1,2180124214,764657776),(.m1,1108278838,12637175920),(.m1,19343081014,208637263984),(.m1,335259106872,220049965066),(.m1,81335943118,260919263230)], + .ms [(.m1,.s3,128849018878),(.m4,.s3,1391569403896),(.m10,.s7,1391569403902),(.m8,.s2,1391569403897)], + .m .m9, + .b 0 [[([4123168604084],[(.D7,1391569403902)]),([515396075510,257698037759,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,128849018878),(.D16,260919263230)]),([64424509438],[(.D6,81335943118),(.D16,220049965066),(.D6,335259106872),(.D16,208637263984),(.D6,19343081014),(.D16,12637175920),(.D6,1108278838),(.D16,764657776),(.D6,2180124214),(.D16,625800304),(.D6,28261174),(.D16,37539760),(.D6,1372678),(.D16,2248036),(.D6,1225152950),(.D12,8667),(.D16,10333),(.D16,530),(.D6,5)])]], + .ms [(.m2,.s6,2061584302042),(.m3,.s6,876173328391),(.m14,.s5,876173328391),(.m4,.s5,2061584302036)], + .m .m5, + .b 2061584302042 [[([23],[(.D16,876173328391),(.D18,1),(.D15,228707008509),(.D16,73282879438)])]], + .ms [(.m2,.s6,2061584302054),(.m3,.s6,876173328388),(.m7,.s5,876173328388),(.m4,.s5,2061584302048)], + .m .m5, + .b 2061584302054 [[([7],[(.D16,876173328388),(.D6,1)])]], + .ms [(.m2,.s6,2061584302058),(.m6,.s6,876173328386),(.m15,.s5,876173328386),(.m11,.s5,2061584302052)], + .m .m5, + .b 2061584302058 [[([5],[(.D12,876173328386),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,2061584302061,876173328387)], + .ms [(.m23,.s1,876173328387),(.m22,.s4,2061584302055)], + .m .m24, + .b 2061584302061 [[([17],[(.D6,876173328387),(.D6,2)])]], + .ms [(.m2,.s6,2061584302070),(.m6,.s6,876173328383),(.m14,.s5,876173328383),(.m11,.s5,2061584302064)], + .m .m5, + .b 2061584302070 [[([23],[(.D12,876173328383),(.D18,1),(.D17,228707008508),(.D17,73282879438),(.D15,218036699146),(.D17,334755790392),(.D15,208511434864),(.D17,19311623734),(.D15,12629311600),(.D17,1106312758),(.D15,764166256),(.D17,2180001334),(.D15,625769584),(.D17,28253494),(.D15,37537840),(.D17,1372198),(.D15,2247916),(.D17,1225152920),(.D11,8659),(.D6,10332)])]], + .ms [(.m2,.s6,2061584302082),(.m6,.s6,876173328380),(.m7,.s5,876173328380),(.m11,.s5,2061584302076)], + .m .m5, + .b 2061584302082 [[([3504693313521,1752346656765,309237645321],[(.D12,876173328380),(.D8,228707008508),(.D6,73282879438),(.D16,218036699146)]),([21743271935],[(.D6,334755790392),(.D16,208511434864),(.D6,19311623734),(.D16,12629311600),(.D6,1106312758),(.D16,764166256),(.D6,2180001334),(.D16,625769584),(.D6,28253494),(.D16,37537840),(.D6,1372198),(.D16,2247916),(.D6,1225152920),(.D12,8660),(.D7,10331),(.D8,529),(.D7,4)])]], + .ms [(.m2,.s6,4844723109886)], + .ms2 .s6 .s7 [(.m3,180388626430,54760833022)], + .ms [(.m3,.s6,29796335566)], + .ms2 .s6 .s7 [(.m3,207165063178,332037881400),(.m0,207831957616,19141754422),(.m0,12586844272,1095695926),(.m0,761512048,2179337782),(.m0,625603696,28212022),(.m0,37527472,1369606),(.m0,2247268,1225152758)], + .ms [(.m12,.s7,8619),(.m0,.s6,10321),(.m3,.s6,527),(.m21,.s3,527),(.m4,.s3,10321),(.m4,.s3,8619)], + .ms2 .s3 .s0 [(.m13,1225152758,2247268),(.m1,1369606,37527472),(.m1,28212022,625603696),(.m1,2179337782,761512048),(.m1,1095695926,12586844272),(.m1,19141754422,207831957616),(.m1,332037881400,207165063178),(.m1,29796335566,54760833022)], + .ms [(.m4,.s3,180388626430),(.m4,.s3,4844723109880),(.m10,.s7,4844723109886),(.m8,.s2,4844723109881)], + .m .m9, + .b 0 [[([5772436045748],[(.D7,4844723109886)]),([721554505718,360777252863,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,180388626430),(.D6,54760833022),(.D6,29796335566)]),([22548578303],[(.D16,207165063178),(.D6,332037881400),(.D16,207831957616),(.D6,19141754422),(.D16,12586844272),(.D6,1095695926),(.D16,761512048),(.D6,2179337782),(.D16,625603696),(.D6,28212022),(.D16,37527472),(.D6,1369606),(.D16,2247268),(.D6,1225152758),(.D12,8619),(.D16,10321),(.D16,527),(.D12,3)])],[([8],[(.D15,4123168604167),(.D21,0),(.D19,9663676413)])]], + .ms [(.m2,.s6,2886218022878),(.m6,.s6,4123168604165),(.m7,.s5,4123168604165),(.m11,.s5,2886218022872)], + .m .m5, + .b 2886218022878 [[([41],[(.D12,4123168604165),(.D8,1),(.D7,9663676412)])],[([231928233862],[(.D17,4123168604161),(.D2,9663676410)])]], + .ms [(.m2,.s6,3002182139830),(.m3,.s6,4094177574928),(.m27,.s2,4094177574928),(.m1,.s5,3002182139824)], + ] (by decide +kernel) +theorem chunk_12_step : (cfg_12.denote) [qi]⊢* (cfg_13.denote) := + step_chunk [ + .m .m5, + .b 3002182139830 [[([7],[(.D16,4094177574928), + (.D6,1)])], + [([16],[(.D11,4094177574926), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,4094177574925), + (.D17,1), + (.D15,0), + (.D6,18522046414)])], + [([16],[(.D11,4094177574923), + (.D3,0)])], + [([8],[(.D15,4094177574922), + (.D17,1), + (.D21,18522046413), + (.D15,204346490890), + (.D17,331333238328), + (.D15,207655796848), + (.D17,19097714230), + (.D15,12575834224), + (.D17,1092943414), + (.D15,760823920), + (.D17,2179165750), + (.D15,625560688), + (.D17,28201270), + (.D15,37524784), + (.D17,1368934), + (.D15,2247100), + (.D17,1225152716), + (.D11,8608), + (.D12,10318)])], + [([18],[(.D11,4094177574920), + (.D13,0), + (.D16,18522046413), + (.D16,204346490890)])], + [([592705485252],[(.D17,4094177574919)]), + ([74088185659,37044092831,18522046416,9261023208,4630511604,2315255799,1157627901,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,18522046414), + (.D17,204346490890)]), + ([9261023207],[(.D6,331333238328), + (.D16,207655796848), + (.D6,19097714230), + (.D16,12575834224), + (.D6,1092943414), + (.D16,760823920), + (.D6,2179165750), + (.D16,625560688), + (.D6,28201270), + (.D16,37524784), + (.D6,1368934), + (.D16,2247100), + (.D6,1225152716), + (.D12,8609), + (.D13,10318), + (.D9,526), + (.D13,3)])], + [([10],[(.D17,4020089389263), + (.D21,0), + (.D19,199715979286)])]], + .ms [(.m2,.s6,3298534882498),(.m3,.s6,4020089389261),(.m7,.s5,4020089389261),(.m4,.s5,3298534882492)], + .m .m5, + .b 3298534882498 [[([43],[(.D16,4020089389261),(.D8,1),(.D7,199715979285)])],[([4793183502810],[(.D11,4020089389254),(.D2,199715979283)])]], + .ms2 .s6 .s7 [(.m2,5695126633925,3420941451405)], + .ms [(.m29,.s2,3420941451405),(.m4,.s5,5695126633919)], + .m .m5, + .b 5695126633925 [[([9],[(.D6,3420941451405),(.D6,1)])],[([20],[(.D15,3420941451403),(.D13,0),(.D10,330175610426),(.D9,207366389872)])],[([36],[(.D11,3420941451399)]),([7,2],[(.D12,1),(.D6,330175610426)])]], + .ms [(.m2,.s6,5695126633958),(.m6,.s6,3420941451395),(.m15,.s5,3420941451395),(.m11,.s5,5695126633952)], + .m .m5, + .b 5695126633958 [[([5],[(.D12,3420941451395),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,5695126633961,3420941451396)], + .ms [(.m23,.s1,3420941451396),(.m22,.s4,5695126633955)], + .m .m24, + .b 5695126633961 [[([17],[(.D6,3420941451396),(.D6,2)])],[([6],[(.D11,3420941451392),(.D21,0),(.D7,330175610424)])]], + .ms2 .s6 .s7 [(.m2,5695126633973,3420941451393)], + .ms2 .s5 .s2 [(.m28,3420941451393,5695126633968)], + .m .m18, + .b 5695126633973 [[([45],[(.D6,3420941451393),(.D8,1),(.D17,330175610423),(.D10,207366389871)])],[([36],[(.D15,3420941451386)]),([7,2],[(.D12,1),(.D17,330175610422)]),([1],[(.D11,207366389871),(.D16,19025362486)])],[([8],[(.D15,3420941451382),(.D21,0),(.D17,330175610421),(.D12,207366389872)])]], + .ms [(.m2,.s6,5695126634018),(.m6,.s6,3420941451380),(.m7,.s5,3420941451380),(.m11,.s5,5695126634012)], + .m .m5, + .b 5695126634018 [[([39],[(.D12,3420941451380),(.D8,330175610422),(.D13,207366389872),(.D17,19025362486),(.D15,12557746288),(.D17,1088421430),(.D15,759693424),(.D17,2178883126),(.D15,625490032),(.D17,28183606),(.D15,37520368),(.D17,1367830),(.D15,2246824),(.D17,1225152647),(.D17,8593),(.D11,10313),(.D17,526),(.D15,3)])]], + .ms [(.m2,.s6,5695126634038)], + .ms2 .s6 .s7 [(.m3,3420941451376,330175610422),(.m0,207366389872,19025362486),(.m0,12557746288,1088421430),(.m0,759693424,2178883126),(.m0,625490032,28183606),(.m0,37520368,1367830),(.m0,2246824,1225152647)], + .ms [(.m3,.s6,8593)], + .ms2 .s6 .s7 [(.m6,10313,526)], + .ms2 .s3 .s0 [(.m19,526,10313)], + .ms [(.m17,.s0,8593)], + .ms2 .s3 .s0 [(.m4,1225152647,2246824),(.m1,1367830,37520368),(.m1,28183606,625490032),(.m1,2178883126,759693424),(.m1,1088421430,12557746288),(.m1,19025362486,207366389872),(.m1,330175610422,3420941451376)], + .ms [(.m1,.s3,5695126634032),(.m10,.s7,5695126634038),(.m8,.s2,5695126634033)], + .m .m9, + .b 0 [[([173946175484],[(.D7,5695126634038),(.D17,3420941451376),(.D6,330175610422),(.D16,207366389872),(.D6,19025362486),(.D16,12557746288),(.D6,1088421430),(.D16,759693424),(.D6,2178883126),(.D16,625490032),(.D6,28183606),(.D16,37520368),(.D6,1367830),(.D16,2246824),(.D6,1225152647),(.D6,8593),(.D12,10313),(.D6,526),(.D16,4)])]], + .ms [(.m2,.s6,86973087742),(.m3,.s6,5673383362102)], + .ms2 .s6 .s7 [(.m3,3415505633392,328816655926),(.m0,207026651248,18940427830),(.m0,12536512624,1083113014),(.m0,758366320,2178551350),(.m0,625407088,28162870),(.m0,37515184,1366534),(.m0,2246500,1225152566)], + .ms [(.m12,.s7,8571),(.m0,.s6,10309),(.m3,.s6,524),(.m20,.s0,524),(.m1,.s3,10309),(.m4,.s3,8571)], + .ms2 .s3 .s0 [(.m13,1225152566,2246500),(.m1,1366534,37515184),(.m1,28162870,625407088),(.m1,2178551350,758366320),(.m1,1083113014,12536512624),(.m1,18940427830,207026651248),(.m1,328816655926,3415505633392)], + .ms [(.m1,.s3,5673383362102),(.m4,.s3,86973087736),(.m10,.s7,86973087742),(.m8,.s2,86973087737)], + .m .m9, + .b 0 [[([347892350966,173946175485,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,86973087742),(.D17,5673383362102)]),([43486543870],[(.D16,3415505633392),(.D6,328816655926),(.D16,207026651248),(.D6,18940427830),(.D16,12536512624),(.D6,1083113014),(.D16,758366320),(.D6,2178551350),(.D16,625407088),(.D6,28162870),(.D16,37515184),(.D6,1366534),(.D16,2246500),(.D6,1225152566),(.D12,8571),(.D16,10309),(.D16,524),(.D6,5)])]], + .ms [(.m2,.s6,347892350965),(.m14,.s5,347892350959)], + .m .m5, + .b 347892350965 [[([5],[(.D18,1),(.D15,5651640090165),(.D14,3410069815408)])]], + .ms [(.m2,.s6,347892350968),(.m7,.s5,347892350962)], + .m .m5, + .b 347892350968 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,347892350969),(.m15,.s5,347892350963)], + .m .m5, + .b 347892350969 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,347892350970),(.m25,.s2,347892350965)], + .m .m18, + .b 347892350970 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,347892350972),(.m14,.s5,347892350966)], + .m .m5, + .b 347892350972 [[([5],[(.D18,1),(.D17,5651640090164),(.D15,3410069815408),(.D17,327457701430),(.D15,206686912624),(.D17,18855493174),(.D15,12515278960),(.D17,1077804598),(.D15,757039216),(.D17,2178219574),(.D15,625324144),(.D17,28142134),(.D15,37510000),(.D17,1365238),(.D15,2246176),(.D17,1225152485),(.D17,8552),(.D8,10303)])]], + .ms [(.m2,.s6,347892350975),(.m7,.s5,347892350969)], + .m .m5, + .b 347892350975 [[([238370684925],[(.D8,5651640090164),(.D16,3410069815408),(.D6,327457701430),(.D16,206686912624),(.D6,18855493174),(.D16,12515278960),(.D6,1077804598),(.D16,757039216),(.D6,2178219574),(.D16,625324144),(.D6,28142134),(.D16,37510000),(.D6,1365238),(.D16,2246176),(.D6,1225152485),(.D6,8553),(.D9,10303),(.D14,522),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,467077693438,5621843754550),(.m0,3402620731504,325595430454),(.m0,206221344880,18739101238),(.m0,12486180976,1070530102),(.m0,755220592,2177764918),(.m0,625210480,28113718),(.m0,37502896,1363462),(.m0,2245732,1225152374)], + .ms [(.m12,.s7,8523),(.m0,.s6,10297),(.m3,.s6,521),(.m21,.s3,521),(.m4,.s3,10297),(.m4,.s3,8523)], + .ms2 .s3 .s0 [(.m13,1225152374,2245732),(.m1,1363462,37502896),(.m1,28113718,625210480),(.m1,2177764918,755220592),(.m1,1070530102,12486180976),(.m1,18739101238,206221344880),(.m1,325595430454,3402620731504),(.m1,5621843754550,467077693433)], + .ms [(.m26,.s7,467077693438),(.m8,.s2,467077693433)], + .m .m9, + .b 0 [[([953482739708],[(.D7,467077693438),(.D7,5621843754549),(.D16,3402620731504),(.D6,325595430454),(.D16,206221344880),(.D6,18739101238),(.D16,12486180976),(.D6,1070530102),(.D16,755220592),(.D6,2177764918),(.D16,625210480),(.D6,28113718),(.D16,37502896),(.D6,1363462),(.D16,2245732),(.D6,1225152374),(.D12,8523),(.D16,10297),(.D16,521),(.D12,3)])]], + .ms [(.m2,.s6,476741369854)], + .ms2 .s6 .s7 [(.m3,347892350974,5592047418934),(.m0,3395171647600,323733159478),(.m0,205755777136,18622709302),(.m0,12457082992,1063255606),(.m0,753401968,2177310262),(.m0,625096816,28085302),(.m0,37495792,1361686),(.m0,2245288,1225152263)], + .ms [(.m3,.s6,8497)], + .ms2 .s6 .s7 [(.m6,10289,520)], + .ms2 .s3 .s0 [(.m19,520,10289)], + .ms [(.m17,.s0,8497)], + .ms2 .s3 .s0 [(.m4,1225152263,2245288),(.m1,1361686,37495792),(.m1,28085302,625096816),(.m1,2177310262,753401968),(.m1,1063255606,12457082992),(.m1,18622709302,205755777136),(.m1,323733159478,3395171647600),(.m1,5592047418934,347892350974)], + .ms [(.m1,.s3,476741369848),(.m10,.s7,476741369854),(.m8,.s2,476741369849)], + .m .m9, + .b 0 [[([1906965479414,876173328390],[(.D7,476741369854),(.D17,347892350974)]),([173946175487],[(.D6,5592047418934),(.D16,3395171647600),(.D6,323733159478),(.D16,205755777136),(.D6,18622709302),(.D16,12457082992),(.D6,1063255606),(.D16,753401968),(.D6,2177310262),(.D16,625096816),(.D6,28085302),(.D16,37495792),(.D6,1361686),(.D16,2245288),(.D6,1225152263),(.D6,8497),(.D12,10289),(.D6,520),(.D16,4)])]], + .ms [(.m2,.s6,1391569403902),(.m3,.s6,128849018878)], + .ms2 .s6 .s7 [(.m3,260919263230,5570304146998),(.m0,3389735829616,322374204982),(.m0,205416038512,18537774646),(.m0,12435849328,1057947190),(.m0,752074864,2176978486),(.m0,625013872,28064566),(.m0,37490608,1360390),(.m0,2244964,1225152182)], + .ms [(.m12,.s7,8475),(.m0,.s6,10285),(.m3,.s6,518),(.m20,.s0,518),(.m1,.s3,10285),(.m4,.s3,8475)], + .ms2 .s3 .s0 [(.m13,1225152182,2244964),(.m1,1360390,37490608),(.m1,28064566,625013872),(.m1,2176978486,752074864),(.m1,1057947190,12435849328),(.m1,18537774646,205416038512),(.m1,322374204982,3389735829616),(.m1,5570304146998,260919263230)], + .ms [(.m1,.s3,128849018878),(.m4,.s3,1391569403896),(.m10,.s7,1391569403902),(.m8,.s2,1391569403897)], + .m .m9, + .b 0 [[([4123168604084],[(.D7,1391569403902)]),([515396075510,257698037759,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,128849018878),(.D16,260919263230)]),([64424509438],[(.D6,5570304146998),(.D16,3389735829616),(.D6,322374204982),(.D16,205416038512),(.D6,18537774646),(.D16,12435849328),(.D6,1057947190),(.D16,752074864),(.D6,2176978486),(.D16,625013872),(.D6,28064566),(.D16,37490608),(.D6,1360390),(.D16,2244964),(.D6,1225152182),(.D12,8475),(.D16,10285),(.D16,518),(.D6,5)])]], + .ms [(.m2,.s6,2061584302042),(.m3,.s6,876173328391),(.m14,.s5,876173328391),(.m4,.s5,2061584302036)], + .m .m5, + .b 2061584302042 [[([23],[(.D16,876173328391),(.D18,1),(.D15,228707008509),(.D16,5562251083318)])]], + .ms [(.m2,.s6,2061584302054),(.m3,.s6,876173328388),(.m7,.s5,876173328388),(.m4,.s5,2061584302048)], + .m .m5, + .b 2061584302054 [[([7],[(.D16,876173328388),(.D6,1)])]], + .ms [(.m2,.s6,2061584302058),(.m6,.s6,876173328386),(.m15,.s5,876173328386),(.m11,.s5,2061584302052)], + .m .m5, + .b 2061584302058 [[([5],[(.D12,876173328386),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,2061584302061,876173328387)], + .ms [(.m23,.s1,876173328387),(.m22,.s4,2061584302055)], + .m .m24, + .b 2061584302061 [[([17],[(.D6,876173328387),(.D6,2)])]], + .ms [(.m2,.s6,2061584302070),(.m6,.s6,876173328383),(.m14,.s5,876173328383),(.m11,.s5,2061584302064)], + .m .m5, + .b 2061584302070 [[([23],[(.D12,876173328383),(.D18,1),(.D17,228707008508),(.D17,5562251083318),(.D15,3387722563696),(.D17,321870888502),(.D15,205290209392),(.D17,18506317366),(.D15,12427985008),(.D17,1055981110),(.D15,751583344),(.D17,2176855606),(.D15,624983152),(.D17,28056886),(.D15,37488688),(.D17,1359910),(.D15,2244844),(.D17,1225152152),(.D11,8467),(.D6,10284)])]], + .ms [(.m2,.s6,2061584302082),(.m6,.s6,876173328380),(.m7,.s5,876173328380),(.m11,.s5,2061584302076)], + .m .m5, + .b 2061584302082 [[([3504693313521,1752346656765,309237645321],[(.D12,876173328380),(.D8,228707008508),(.D6,5562251083318)]),([86973087743],[(.D16,3387722563696),(.D6,321870888502),(.D16,205290209392),(.D6,18506317366),(.D16,12427985008),(.D6,1055981110),(.D16,751583344),(.D6,2176855606),(.D16,624983152),(.D6,28056886),(.D16,37488688),(.D6,1359910),(.D16,2244844),(.D6,1225152152),(.D12,8468),(.D7,10283),(.D8,517),(.D7,4)])]], + .ms [(.m2,.s6,4844723109886)], + .ms2 .s6 .s7 [(.m3,180388626430,54760833022)], + .ms [(.m3,.s6,5518764539446)], + .ms2 .s6 .s7 [(.m3,3376850927728,319152979510),(.m0,204610732144,18336448054),(.m0,12385517680,1045364278),(.m0,748929136,2176192054),(.m0,624817264,28015414),(.m0,37478320,1357318),(.m0,2244196,1225151990)], + .ms [(.m12,.s7,8427),(.m0,.s6,10273),(.m3,.s6,515),(.m21,.s3,515),(.m4,.s3,10273),(.m4,.s3,8427)], + .ms2 .s3 .s0 [(.m13,1225151990,2244196),(.m1,1357318,37478320),(.m1,28015414,624817264),(.m1,2176192054,748929136),(.m1,1045364278,12385517680),(.m1,18336448054,204610732144),(.m1,319152979510,3376850927728),(.m1,5518764539446,54760833022)], + .ms [(.m4,.s3,180388626430),(.m4,.s3,4844723109880),(.m10,.s7,4844723109886),(.m8,.s2,4844723109881)], + .m .m9, + .b 0 [[([5772436045748],[(.D7,4844723109886)]),([721554505718,360777252863,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,180388626430),(.D6,54760833022),(.D6,5518764539446)]),([22548578303],[(.D16,3376850927728),(.D6,319152979510),(.D16,204610732144),(.D6,18336448054),(.D16,12385517680),(.D6,1045364278),(.D16,748929136),(.D6,2176192054),(.D16,624817264),(.D6,28015414),(.D16,37478320),(.D6,1357318),(.D16,2244196),(.D6,1225151990),(.D12,8427),(.D16,10273),(.D16,515),(.D12,3)])],[([8],[(.D15,4123168604167),(.D21,0),(.D19,9663676413)])]], + .ms [(.m2,.s6,2886218022878),(.m6,.s6,4123168604165),(.m7,.s5,4123168604165),(.m11,.s5,2886218022872)], + .m .m5, + .b 2886218022878 [[([41],[(.D12,4123168604165),(.D8,1),(.D7,9663676412)])],[([231928233862],[(.D17,4123168604161),(.D2,9663676410)])]], + .ms [(.m2,.s6,3002182139830),(.m3,.s6,4094177574928),(.m27,.s2,4094177574928),(.m1,.s5,3002182139824)], + .m .m5, + .b 3002182139830 [[([7],[(.D16,4094177574928),(.D6,1)])],[([16],[(.D11,4094177574926),(.D13,0),(.D6,1)])],[([8],[(.D15,4094177574925),(.D17,1),(.D15,0),(.D6,5507490250294)])],[([16],[(.D11,4094177574923),(.D3,0)])],[([8],[(.D15,4094177574922),(.D17,1),(.D21,5507490250293),(.D15,3374032355440),(.D17,318448336438),(.D15,204434571376),(.D17,18292407862),(.D15,12374507632),(.D17,1042611766),(.D15,748241008),(.D17,2176020022),(.D15,624774256),(.D17,28004662),(.D15,37475632),(.D17,1356646),(.D15,2244028),(.D17,1225151948),(.D11,8416),(.D12,10270)])],[([18],[(.D11,4094177574920),(.D13,0),(.D16,5507490250293),(.D16,3374032355440)])],[([592705486822],[(.D17,4094177574919),(.D12,5507490250294),(.D17,3374032355440),(.D6,318448336438),(.D16,204434571376),(.D6,18292407862),(.D16,12374507632),(.D6,1042611766),(.D16,748241008),(.D6,2176020022),(.D16,624774256),(.D6,28004662),(.D16,37475632),(.D6,1356646),(.D16,2244028),(.D6,1225151948),(.D12,8417),(.D13,10270),(.D9,514),(.D13,3)])]], + .ms [(.m2,.s6,3298534883278)], + .ms2 .s6 .s7 [(.m3,4020089389066,5488968203832),(.m0,3369401843824,317290708534),(.m0,204145164400,18220056118),(.m0,12356419696,1038089782),(.m0,747110512,2175737398),(.m0,624703600,27986998),(.m0,37471216,1355542),(.m0,2243752,1225151879)], + .ms [(.m3,.s6,8401)], + .ms2 .s6 .s7 [(.m6,10265,514)], + .ms2 .s3 .s0 [(.m19,514,10265)], + .ms [(.m17,.s0,8401)], + .ms2 .s3 .s0 [(.m4,1225151879,2243752),(.m1,1355542,37471216),(.m1,27986998,624703600),(.m1,2175737398,747110512),(.m1,1038089782,12356419696),(.m1,18220056118,204145164400),(.m1,317290708534,3369401843824),(.m1,5488968203832,4020089389066)], + .ms [(.m1,.s3,3298534883272),(.m10,.s7,3298534883278),(.m8,.s2,3298534883273)], + .m .m9, + .b 0 [[([2783138807804],[(.D7,3298534883278),(.D17,4020089389066),(.D6,5488968203832),(.D16,3369401843824),(.D6,317290708534),(.D16,204145164400),(.D6,18220056118),(.D16,12356419696),(.D6,1038089782),(.D16,747110512),(.D6,2175737398),(.D16,624703600),(.D6,27986998),(.D16,37471216),(.D6,1355542),(.D16,2243752),(.D6,1225151879),(.D6,8401),(.D12,10265),(.D6,514),(.D16,4)])]], + .ms [(.m2,.s6,1391569403902),(.m3,.s6,2950642532302)], + .ms2 .s6 .s7 [(.m3,3933116301322,5467224931896),(.m0,3363966025840,315931754038),(.m0,203805425776,18135121462),(.m0,12335186032,1032781366),(.m0,745783408,2175405622),(.m0,624620656,27966262),(.m0,37466032,1354246),(.m0,2243428,1225151798)], + .ms [(.m12,.s7,8379),(.m0,.s6,10261),(.m3,.s6,512),(.m20,.s0,512),(.m1,.s3,10261),(.m4,.s3,8379)], + .ms2 .s3 .s0 [(.m13,1225151798,2243428),(.m1,1354246,37466032),(.m1,27966262,624620656),(.m1,2175405622,745783408),(.m1,1032781366,12335186032),(.m1,18135121462,203805425776),(.m1,315931754038,3363966025840),(.m1,5467224931896,3933116301322)], + .ms [(.m1,.s3,2950642532302),(.m4,.s3,1391569403896),(.m10,.s7,1391569403902),(.m8,.s2,1391569403897)], + .m .m9, + .b 0 [[([5566277615606,2783138807805,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,1391569403902),(.D17,2950642532302)]),([695784701950],[(.D16,3933116301322),(.D6,5467224931896),(.D16,3363966025840),(.D6,315931754038),(.D16,203805425776),(.D6,18135121462),(.D16,12335186032),(.D6,1032781366),(.D16,745783408),(.D6,2175405622),(.D16,624620656),(.D6,27966262),(.D16,37466032),(.D6,1354246),(.D16,2243428),(.D6,1225151798),(.D12,8379),(.D16,10261),(.D16,512),(.D6,5)])]], + .ms [(.m2,.s6,5566277615605),(.m14,.s5,5566277615599)], + .m .m5, + .b 5566277615605 [[([5],[(.D18,1),(.D15,2602750181325),(.D14,3846143213578)])]], + .ms [(.m2,.s6,5566277615608),(.m7,.s5,5566277615602)], + .m .m5, + .b 5566277615608 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,5566277615609),(.m15,.s5,5566277615603)], + .m .m5, + .b 5566277615609 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,5566277615610),(.m25,.s2,5566277615605)], + .m .m18, + .b 5566277615610 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,5566277615612),(.m14,.s5,5566277615606)], + .m .m5, + .b 5566277615612 [[([5],[(.D18,1),(.D17,2602750181324),(.D15,3846143213578),(.D17,5445481659960),(.D15,3358530207856),(.D17,314572799542),(.D15,203465687152),(.D17,18050186806),(.D15,12313952368),(.D17,1027472950),(.D15,744456304),(.D17,2175073846),(.D15,624537712),(.D17,27945526),(.D15,37460848),(.D17,1352950),(.D15,2243104),(.D17,1225151717),(.D17,8360),(.D8,10255)])]], + .ms [(.m2,.s6,5566277615615),(.m7,.s5,5566277615609)], + .m .m5, + .b 5566277615615 [[([3813930958845],[(.D8,2602750181324),(.D16,3846143213578),(.D6,5445481659960),(.D16,3358530207856),(.D6,314572799542),(.D16,203465687152),(.D6,18050186806),(.D16,12313952368),(.D6,1027472950),(.D16,744456304),(.D6,2175073846),(.D16,624537712),(.D6,27945526),(.D16,37460848),(.D6,1352950),(.D16,2243104),(.D6,1225151717),(.D6,8361),(.D9,10255),(.D14,510),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,7473243095038,2126008811470),(.m0,3726957871114,5415685324344),(.m0,3351081123952,312710528566),(.m0,203000119408,17933794870),(.m0,12284854384,1020198454),(.m0,742637680,2174619190),(.m0,624424048,27917110),(.m0,37453744,1351174),(.m0,2242660,1225151606)], + .ms [(.m12,.s7,8331),(.m0,.s6,10249),(.m3,.s6,509),(.m21,.s3,509),(.m4,.s3,10249),(.m4,.s3,8331)], + .ms2 .s3 .s0 [(.m13,1225151606,2242660),(.m1,1351174,37453744),(.m1,27917110,624424048),(.m1,2174619190,742637680),(.m1,1020198454,12284854384),(.m1,17933794870,203000119408),(.m1,312710528566,3351081123952),(.m1,5415685324344,3726957871114),(.m1,2126008811470,7473243095033)], + .ms [(.m26,.s7,7473243095038),(.m8,.s2,7473243095033)], + .m .m9, + .b 0 [[([15255723835388],[(.D7,7473243095038),(.D7,2126008811469),(.D16,3726957871114),(.D6,5415685324344),(.D16,3351081123952),(.D6,312710528566),(.D16,203000119408),(.D6,17933794870),(.D16,12284854384),(.D6,1020198454),(.D16,742637680),(.D6,2174619190),(.D16,624424048),(.D6,27917110),(.D16,37453744),(.D6,1351174),(.D16,2242660),(.D6,1225151606),(.D12,8331),(.D16,10249),(.D16,509),(.D12,3)])]], + .ms [(.m2,.s6,7627861917694)], + .ms2 .s6 .s7 [(.m3,5566277615614,1649267441614),(.m0,3607772528650,5385888988728),(.m0,3343632040048,310848257590),(.m0,202534551664,17817402934),(.m0,12255756400,1012923958),(.m0,740819056,2174164534),(.m0,624310384,27888694),(.m0,37446640,1349398),(.m0,2242216,1225151495)], + .ms [(.m3,.s6,8305)], + .ms2 .s6 .s7 [(.m6,10241,508)], + .ms2 .s3 .s0 [(.m19,508,10241)], + .ms [(.m17,.s0,8305)], + .ms2 .s3 .s0 [(.m4,1225151495,2242216),(.m1,1349398,37446640),(.m1,27888694,624310384),(.m1,2174164534,740819056),(.m1,1012923958,12255756400),(.m1,17817402934,202534551664),(.m1,310848257590,3343632040048),(.m1,5385888988728,3607772528650),(.m1,1649267441614,5566277615614)], + .ms [(.m1,.s3,7627861917688),(.m10,.s7,7627861917694),(.m8,.s2,7627861917689)], + .m .m76, + ] (by decide +kernel) +theorem chunk_13_step : (cfg_13.denote) [qi]⊢* (cfg_14.denote) := + step_chunk [ + .m .m77, + .b 0 [[([30511447670774,14018773254150],[(.D7,7627861917694),(.D17,5566277615614)]),([2783138807807],[(.D6,1649267441614),(.D16,3607772528650),(.D6,5385888988728),(.D16,3343632040048),(.D6,310848257590),(.D16,202534551664),(.D6,17817402934),(.D16,12255756400),(.D6,1012923958),(.D16,740819056),(.D6,2174164534),(.D16,624310384),(.D6,27888694),(.D16,37446640),(.D6,1349398),(.D16,2242216),(.D6,1225151495),(.D6,8305),(.D12,10241),(.D6,508),(.D16,4)])]], + .ms [(.m2,.s6,22265110462462),(.m3,.s6,2061584302078)], + .ms2 .s6 .s7 [(.m3,4174708211710,1301375090638),(.m0,3520799440906,5364145716792),(.m0,3338196222064,309489303094),(.m0,202194813040,17732468278),(.m0,12234522736,1007615542),(.m0,739491952,2173832758),(.m0,624227440,27867958),(.m0,37441456,1348102),(.m0,2241892,1225151414)], + .ms [(.m12,.s7,8283),(.m0,.s6,10237),(.m3,.s6,506),(.m20,.s0,506),(.m1,.s3,10237),(.m4,.s3,8283)], + .ms2 .s3 .s0 [(.m13,1225151414,2241892),(.m1,1348102,37441456),(.m1,27867958,624227440),(.m1,2173832758,739491952),(.m1,1007615542,12234522736),(.m1,17732468278,202194813040),(.m1,309489303094,3338196222064),(.m1,5364145716792,3520799440906),(.m1,1301375090638,4174708211710)], + .ms [(.m1,.s3,2061584302078),(.m4,.s3,22265110462456),(.m10,.s7,22265110462462),(.m8,.s2,22265110462457)], + .m .m9, + .b 0 [[([65970697666484],[(.D7,22265110462462)]),([8246337208310,4123168604159,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,2061584302078),(.D16,4174708211710)]),([1030792151038],[(.D6,1301375090638),(.D16,3520799440906),(.D6,5364145716792),(.D16,3338196222064),(.D6,309489303094),(.D16,202194813040),(.D6,17732468278),(.D16,12234522736),(.D6,1007615542),(.D16,739491952),(.D6,2173832758),(.D16,624227440),(.D6,27867958),(.D16,37441456),(.D6,1348102),(.D16,2241892),(.D6,1225151414),(.D12,8283),(.D16,10237),(.D16,506),(.D6,5)])]], + .ms [(.m2,.s6,32985348833242),(.m3,.s6,14018773254151),(.m14,.s5,14018773254151),(.m4,.s5,32985348833236)], + .m .m5, + .b 32985348833242 [[([23],[(.D16,14018773254151),(.D18,1),(.D15,3659312136189),(.D16,1172526071758)])]], + .ms [(.m2,.s6,32985348833254),(.m3,.s6,14018773254148),(.m7,.s5,14018773254148),(.m4,.s5,32985348833248)], + .m .m5, + .b 32985348833254 [[([7],[(.D16,14018773254148),(.D6,1)])]], + .ms [(.m2,.s6,32985348833258),(.m6,.s6,14018773254146),(.m15,.s5,14018773254146),(.m11,.s5,32985348833252)], + .m .m5, + .b 32985348833258 [[([5],[(.D12,14018773254146),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,32985348833261,14018773254147)], + .ms [(.m23,.s1,14018773254147),(.m22,.s4,32985348833255)], + .m .m24, + .b 32985348833261 [[([17],[(.D6,14018773254147),(.D6,2)])]], + .ms [(.m2,.s6,32985348833270),(.m6,.s6,14018773254143),(.m14,.s5,14018773254143),(.m11,.s5,32985348833264)], + .m .m5, + .b 32985348833270 [[([23],[(.D12,14018773254143),(.D18,1),(.D17,3659312136188),(.D17,1172526071758),(.D15,3488587186186),(.D17,5356092653112),(.D15,3336182956144),(.D17,308985986614),(.D15,202068983920),(.D17,17701010998),(.D15,12226658416),(.D17,1005649462),(.D15,739000432),(.D17,2173709878),(.D15,624196720),(.D17,27860278),(.D15,37439536),(.D17,1347622),(.D15,2241772),(.D17,1225151384),(.D11,8275),(.D6,10236)])]], + .ms [(.m2,.s6,32985348833282),(.m6,.s6,14018773254140),(.m7,.s5,14018773254140),(.m11,.s5,32985348833276)], + .m .m5, + .b 32985348833282 [[([56075093016561,28037546508285,4947802325001],[(.D12,14018773254140),(.D8,3659312136188),(.D6,1172526071758),(.D16,3488587186186)]),([347892350975],[(.D6,5356092653112),(.D16,3336182956144),(.D6,308985986614),(.D16,202068983920),(.D6,17701010998),(.D16,12226658416),(.D6,1005649462),(.D16,739000432),(.D6,2173709878),(.D16,624196720),(.D6,27860278),(.D16,37439536),(.D6,1347622),(.D16,2241772),(.D6,1225151384),(.D12,8276),(.D7,10235),(.D8,505),(.D7,4)])]], + .ms [(.m2,.s6,77515569758206)], + .ms2 .s6 .s7 [(.m3,2886218022910,876173328382)], + .ms [(.m3,.s6,476741369806)], + .ms2 .s6 .s7 [(.m3,3314641010698,5312606109240),(.m0,3325311320176,306268077622),(.m0,201389506672,17531141686),(.m0,12184191088,995032630),(.m0,736346224,2173046326),(.m0,624030832,27818806),(.m0,37429168,1345030),(.m0,2241124,1225151222)], + .ms [(.m12,.s7,8235),(.m0,.s6,10225),(.m3,.s6,503),(.m21,.s3,503),(.m4,.s3,10225),(.m4,.s3,8235)], + .ms2 .s3 .s0 [(.m13,1225151222,2241124),(.m1,1345030,37429168),(.m1,27818806,624030832),(.m1,2173046326,736346224),(.m1,995032630,12184191088),(.m1,17531141686,201389506672),(.m1,306268077622,3325311320176),(.m1,5312606109240,3314641010698),(.m1,476741369806,876173328382)], + .ms [(.m4,.s3,2886218022910),(.m4,.s3,77515569758200),(.m10,.s7,77515569758206),(.m8,.s2,77515569758201)], + .m .m9, + .b 0 [[([92358976733108],[(.D7,77515569758206)]),([11544872091638,5772436045823,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,2886218022910),(.D6,876173328382),(.D6,476741369806)]),([360777252863],[(.D16,3314641010698),(.D6,5312606109240),(.D16,3325311320176),(.D6,306268077622),(.D16,201389506672),(.D6,17531141686),(.D16,12184191088),(.D6,995032630),(.D16,736346224),(.D6,2173046326),(.D16,624030832),(.D6,27818806),(.D16,37429168),(.D6,1345030),(.D16,2241124),(.D6,1225151222),(.D12,8235),(.D16,10225),(.D16,503),(.D12,3)])],[([8],[(.D15,65970697666567),(.D21,0),(.D19,154618822653)])]], + .ms [(.m2,.s6,46179488366558),(.m6,.s6,65970697666565),(.m7,.s5,65970697666565),(.m11,.s5,46179488366552)], + .m .m5, + .b 46179488366558 [[([41],[(.D12,65970697666565),(.D8,1),(.D7,154618822652)])],[([3710851743622],[(.D17,65970697666561),(.D2,154618822650)])]], + .ms [(.m2,.s6,48034914238390),(.m3,.s6,65506841198608),(.m27,.s2,65506841198608),(.m1,.s5,48034914238384)], + .m .m5, + .b 48034914238390 [[([7],[(.D16,65506841198608), + (.D6,1)])], + [([16],[(.D11,65506841198606), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,65506841198605), + (.D17,1), + (.D15,0), + (.D6,296352743374)])], + [([16],[(.D11,65506841198603), + (.D3,0)])], + [([8],[(.D15,65506841198602), + (.D17,1), + (.D21,296352743373), + (.D15,3269543854090), + (.D17,5301331820088), + (.D15,3322492747888), + (.D17,305563434550), + (.D15,201213345904), + (.D17,17487101494), + (.D15,12173181040), + (.D17,992280118), + (.D15,735658096), + (.D17,2172874294), + (.D15,623987824), + (.D17,27808054), + (.D15,37426480), + (.D17,1344358), + (.D15,2240956), + (.D17,1225151180), + (.D11,8224), + (.D12,10222)])], + [([18],[(.D11,65506841198600), + (.D13,0), + (.D16,296352743373), + (.D16,3269543854090)])], + [([9483287787972],[(.D17,65506841198599)]), + ([1185410973499,592705486751,296352743376,148176371688,74088185844,37044092919,18522046461,9261023232,4630511616,2315255808,1157627904,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,296352743374), + (.D17,3269543854090)]), + ([148176371687],[(.D6,5301331820088), + (.D16,3322492747888), + (.D6,305563434550), + (.D16,201213345904), + (.D6,17487101494), + (.D16,12173181040), + (.D6,992280118), + (.D16,735658096), + (.D6,2172874294), + (.D16,623987824), + (.D6,27808054), + (.D16,37426480), + (.D6,1344358), + (.D16,2240956), + (.D6,1225151180), + (.D12,8225), + (.D13,10222), + (.D9,502), + (.D13,3)])], + [([10],[(.D17,64321430225103), + (.D21,0), + (.D19,3195455668246)])]], + .ms [(.m2,.s6,52776558132418),(.m3,.s6,64321430225101),(.m7,.s5,64321430225101),(.m4,.s5,52776558132412)], + .m .m5, + .b 52776558132418 [[([43],[(.D16,64321430225101),(.D8,1),(.D7,3195455668245)])],[([76690936037850],[(.D11,64321430225094),(.D2,3195455668243)])]], + .ms2 .s6 .s7 [(.m2,91122026151365,54735063220365)], + .ms [(.m29,.s2,54735063220365),(.m4,.s5,91122026151359)], + .m .m5, + .b 91122026151365 [[([9],[(.D6,54735063220365),(.D6,1)])],[([20],[(.D15,54735063220363),(.D13,0),(.D10,5282809773626),(.D9,3317862236272)])],[([36],[(.D11,54735063220359)]),([7,2],[(.D12,1),(.D6,5282809773626)])]], + .ms [(.m2,.s6,91122026151398),(.m6,.s6,54735063220355),(.m15,.s5,54735063220355),(.m11,.s5,91122026151392)], + .m .m5, + .b 91122026151398 [[([5],[(.D12,54735063220355),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,91122026151401,54735063220356)], + .ms [(.m23,.s1,54735063220356),(.m22,.s4,91122026151395)], + .m .m24, + .b 91122026151401 [[([17],[(.D6,54735063220356),(.D6,2)])],[([6],[(.D11,54735063220352),(.D21,0),(.D7,5282809773624)])]], + .ms2 .s6 .s7 [(.m2,91122026151413,54735063220353)], + .ms2 .s5 .s2 [(.m28,54735063220353,91122026151408)], + .m .m18, + .b 91122026151413 [[([45],[(.D6,54735063220353),(.D8,1),(.D17,5282809773623),(.D10,3317862236271)])],[([36],[(.D15,54735063220346)]),([7,2],[(.D12,1),(.D17,5282809773622)]),([1],[(.D11,3317862236271),(.D16,304405806646)])],[([8],[(.D15,54735063220342),(.D21,0),(.D17,5282809773621),(.D12,3317862236272)])]], + .ms [(.m2,.s6,91122026151458),(.m6,.s6,54735063220340),(.m7,.s5,54735063220340),(.m11,.s5,91122026151452)], + .m .m5, + .b 91122026151458 [[([39],[(.D12,54735063220340),(.D8,5282809773622),(.D13,3317862236272),(.D17,304405806646),(.D15,200923938928),(.D17,17414749750),(.D15,12155093104),(.D17,987758134),(.D15,734527600),(.D17,2172591670),(.D15,623917168),(.D17,27790390),(.D15,37422064),(.D17,1343254),(.D15,2240680),(.D17,1225151111),(.D17,8209),(.D11,10217),(.D17,502),(.D15,3)])]], + .ms [(.m2,.s6,91122026151478)], + .ms2 .s6 .s7 [(.m3,54735063220336,5282809773622),(.m0,3317862236272,304405806646),(.m0,200923938928,17414749750),(.m0,12155093104,987758134),(.m0,734527600,2172591670),(.m0,623917168,27790390),(.m0,37422064,1343254),(.m0,2240680,1225151111)], + .ms [(.m3,.s6,8209)], + .ms2 .s6 .s7 [(.m6,10217,502)], + .ms2 .s3 .s0 [(.m19,502,10217)], + .ms [(.m17,.s0,8209)], + .ms2 .s3 .s0 [(.m4,1225151111,2240680),(.m1,1343254,37422064),(.m1,27790390,623917168),(.m1,2172591670,734527600),(.m1,987758134,12155093104),(.m1,17414749750,200923938928),(.m1,304405806646,3317862236272),(.m1,5282809773622,54735063220336)], + .ms [(.m1,.s3,91122026151472),(.m10,.s7,91122026151478),(.m8,.s2,91122026151473)], + .m .m9, + .b 0 [[([2783138807804],[(.D7,91122026151478),(.D17,54735063220336),(.D6,5282809773622),(.D16,3317862236272),(.D6,304405806646),(.D16,200923938928),(.D6,17414749750),(.D16,12155093104),(.D6,987758134),(.D16,734527600),(.D6,2172591670),(.D16,623917168),(.D6,27790390),(.D16,37422064),(.D6,1343254),(.D16,2240680),(.D6,1225151111),(.D6,8209),(.D12,10217),(.D6,502),(.D16,4)])]], + .ms [(.m2,.s6,1391569403902),(.m3,.s6,90774133800502)], + .ms2 .s6 .s7 [(.m3,54648090132592,5261066501686),(.m0,3312426418288,303046852150),(.m0,200584200304,17329815094),(.m0,12133859440,982449718),(.m0,733200496,2172259894),(.m0,623834224,27769654),(.m0,37416880,1341958),(.m0,2240356,1225151030)], + .ms [(.m12,.s7,8187),(.m0,.s6,10213),(.m3,.s6,500),(.m20,.s0,500),(.m1,.s3,10213),(.m4,.s3,8187)], + .ms2 .s3 .s0 [(.m13,1225151030,2240356),(.m1,1341958,37416880),(.m1,27769654,623834224),(.m1,2172259894,733200496),(.m1,982449718,12133859440),(.m1,17329815094,200584200304),(.m1,303046852150,3312426418288),(.m1,5261066501686,54648090132592)], + .ms [(.m1,.s3,90774133800502),(.m4,.s3,1391569403896),(.m10,.s7,1391569403902),(.m8,.s2,1391569403897)], + .m .m9, + .b 0 [[([5566277615606,2783138807805,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,1391569403902),(.D17,90774133800502)]),([695784701950],[(.D16,54648090132592),(.D6,5261066501686),(.D16,3312426418288),(.D6,303046852150),(.D16,200584200304),(.D6,17329815094),(.D16,12133859440),(.D6,982449718),(.D16,733200496),(.D6,2172259894),(.D16,623834224),(.D6,27769654),(.D16,37416880),(.D6,1341958),(.D16,2240356),(.D6,1225151030),(.D12,8187),(.D16,10213),(.D16,500),(.D6,5)])]], + .ms [(.m2,.s6,5566277615605),(.m14,.s5,5566277615599)], + .m .m5, + .b 5566277615605 [[([5],[(.D18,1),(.D15,90426241449525),(.D14,54561117044848)])]], + .ms [(.m2,.s6,5566277615608),(.m7,.s5,5566277615602)], + .m .m5, + .b 5566277615608 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,5566277615609),(.m15,.s5,5566277615603)], + .m .m5, + .b 5566277615609 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,5566277615610),(.m25,.s2,5566277615605)], + .m .m18, + .b 5566277615610 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,5566277615612),(.m14,.s5,5566277615606)], + .m .m5, + .b 5566277615612 [[([5],[(.D18,1),(.D17,90426241449524),(.D15,54561117044848),(.D17,5239323229750),(.D15,3306990600304),(.D17,301687897654),(.D15,200244461680),(.D17,17244880438),(.D15,12112625776),(.D17,977141302),(.D15,731873392),(.D17,2171928118),(.D15,623751280),(.D17,27748918),(.D15,37411696),(.D17,1340662),(.D15,2240032),(.D17,1225150949),(.D17,8168),(.D8,10207)])]], + .ms [(.m2,.s6,5566277615615),(.m7,.s5,5566277615609)], + .m .m5, + .b 5566277615615 [[([3813930958845],[(.D8,90426241449524),(.D16,54561117044848),(.D6,5239323229750),(.D16,3306990600304),(.D6,301687897654),(.D16,200244461680),(.D6,17244880438),(.D16,12112625776),(.D6,977141302),(.D16,731873392),(.D6,2171928118),(.D16,623751280),(.D6,27748918),(.D16,37411696),(.D6,1340662),(.D16,2240032),(.D6,1225150949),(.D6,8169),(.D9,10207),(.D14,498),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,7473243095038,89949500079670),(.m0,54441931702384,5209526894134),(.m0,3299541516400,299825626678),(.m0,199778893936,17128488502),(.m0,12083527792,969866806),(.m0,730054768,2171473462),(.m0,623637616,27720502),(.m0,37404592,1338886),(.m0,2239588,1225150838)], + .ms [(.m12,.s7,8139),(.m0,.s6,10201),(.m3,.s6,497),(.m21,.s3,497),(.m4,.s3,10201),(.m4,.s3,8139)], + .ms2 .s3 .s0 [(.m13,1225150838,2239588),(.m1,1338886,37404592),(.m1,27720502,623637616),(.m1,2171473462,730054768),(.m1,969866806,12083527792),(.m1,17128488502,199778893936),(.m1,299825626678,3299541516400),(.m1,5209526894134,54441931702384),(.m1,89949500079670,7473243095033)], + .ms [(.m26,.s7,7473243095038),(.m8,.s2,7473243095033)], + .m .m9, + .b 0 [[([15255723835388],[(.D7,7473243095038),(.D7,89949500079669),(.D16,54441931702384),(.D6,5209526894134),(.D16,3299541516400),(.D6,299825626678),(.D16,199778893936),(.D6,17128488502),(.D16,12083527792),(.D6,969866806),(.D16,730054768),(.D6,2171473462),(.D16,623637616),(.D6,27720502),(.D16,37404592),(.D6,1338886),(.D16,2239588),(.D6,1225150838),(.D12,8139),(.D16,10201),(.D16,497),(.D12,3)])]], + .ms [(.m2,.s6,7627861917694)], + .ms2 .s6 .s7 [(.m3,5566277615614,89472758709814),(.m0,54322746359920,5179730558518),(.m0,3292092432496,297963355702),(.m0,199313326192,17012096566),(.m0,12054429808,962592310),(.m0,728236144,2171018806),(.m0,623523952,27692086),(.m0,37397488,1337110),(.m0,2239144,1225150727)], + .ms [(.m3,.s6,8113)], + .ms2 .s6 .s7 [(.m6,10193,496)], + .ms2 .s3 .s0 [(.m19,496,10193)], + .ms [(.m17,.s0,8113)], + .ms2 .s3 .s0 [(.m4,1225150727,2239144),(.m1,1337110,37397488),(.m1,27692086,623523952),(.m1,2171018806,728236144),(.m1,962592310,12054429808),(.m1,17012096566,199313326192),(.m1,297963355702,3292092432496),(.m1,5179730558518,54322746359920),(.m1,89472758709814,5566277615614)], + .ms [(.m1,.s3,7627861917688),(.m10,.s7,7627861917694),(.m8,.s2,7627861917689)], + .m .m9, + .b 0 [[([30511447670774,14018773254150],[(.D7,7627861917694),(.D17,5566277615614)]),([2783138807807],[(.D6,89472758709814),(.D16,54322746359920),(.D6,5179730558518),(.D16,3292092432496),(.D6,297963355702),(.D16,199313326192),(.D6,17012096566),(.D16,12054429808),(.D6,962592310),(.D16,728236144),(.D6,2171018806),(.D16,623523952),(.D6,27692086),(.D16,37397488),(.D6,1337110),(.D16,2239144),(.D6,1225150727),(.D6,8113),(.D12,10193),(.D6,496),(.D16,4)])]], + .ms [(.m2,.s6,22265110462462),(.m3,.s6,2061584302078)], + .ms2 .s6 .s7 [(.m3,4174708211710,89124866358838),(.m0,54235773272176,5157987286582),(.m0,3286656614512,296604401206),(.m0,198973587568,16927161910),(.m0,12033196144,957283894),(.m0,726909040,2170687030),(.m0,623441008,27671350),(.m0,37392304,1335814),(.m0,2238820,1225150646)], + .ms [(.m12,.s7,8091),(.m0,.s6,10189),(.m3,.s6,494),(.m20,.s0,494),(.m1,.s3,10189),(.m4,.s3,8091)], + .ms2 .s3 .s0 [(.m13,1225150646,2238820),(.m1,1335814,37392304),(.m1,27671350,623441008),(.m1,2170687030,726909040),(.m1,957283894,12033196144),(.m1,16927161910,198973587568),(.m1,296604401206,3286656614512),(.m1,5157987286582,54235773272176),(.m1,89124866358838,4174708211710)], + .ms [(.m1,.s3,2061584302078),(.m4,.s3,22265110462456),(.m10,.s7,22265110462462),(.m8,.s2,22265110462457)], + .m .m9, + .b 0 [[([65970697666484],[(.D7,22265110462462)]),([8246337208310,4123168604159,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,2061584302078),(.D16,4174708211710)]),([1030792151038],[(.D6,89124866358838),(.D16,54235773272176),(.D6,5157987286582),(.D16,3286656614512),(.D6,296604401206),(.D16,198973587568),(.D6,16927161910),(.D16,12033196144),(.D6,957283894),(.D16,726909040),(.D6,2170687030),(.D16,623441008),(.D6,27671350),(.D16,37392304),(.D6,1335814),(.D16,2238820),(.D6,1225150646),(.D12,8091),(.D16,10189),(.D16,494),(.D6,5)])]], + .ms [(.m2,.s6,32985348833242),(.m3,.s6,14018773254151),(.m14,.s5,14018773254151),(.m4,.s5,32985348833236)], + .m .m5, + .b 32985348833242 [[([23],[(.D16,14018773254151),(.D18,1),(.D15,3659312136189),(.D16,88996017339958)])]], + .ms [(.m2,.s6,32985348833254),(.m3,.s6,14018773254148),(.m7,.s5,14018773254148),(.m4,.s5,32985348833248)], + .m .m5, + .b 32985348833254 [[([7],[(.D16,14018773254148),(.D6,1)])]], + .ms [(.m2,.s6,32985348833258),(.m6,.s6,14018773254146),(.m15,.s5,14018773254146),(.m11,.s5,32985348833252)], + .m .m5, + .b 32985348833258 [[([5],[(.D12,14018773254146),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,32985348833261,14018773254147)], + .ms [(.m23,.s1,14018773254147),(.m22,.s4,32985348833255)], + .m .m24, + .b 32985348833261 [[([17],[(.D6,14018773254147),(.D6,2)])]], + .ms [(.m2,.s6,32985348833270),(.m6,.s6,14018773254143),(.m14,.s5,14018773254143),(.m11,.s5,32985348833264)], + .m .m5, + .b 32985348833270 [[([23],[(.D12,14018773254143),(.D18,1),(.D17,3659312136188),(.D17,88996017339958),(.D15,54203561017456),(.D17,5149934222902),(.D15,3284643348592),(.D17,296101084726),(.D15,198847758448),(.D17,16895704630),(.D15,12025331824),(.D17,955317814),(.D15,726417520),(.D17,2170564150),(.D15,623410288),(.D17,27663670),(.D15,37390384),(.D17,1335334),(.D15,2238700),(.D17,1225150616),(.D11,8083),(.D6,10188)])]], + .ms [(.m2,.s6,32985348833282),(.m6,.s6,14018773254140),(.m7,.s5,14018773254140),(.m11,.s5,32985348833276)], + .m .m5, + .b 32985348833282 [[([56075093016561,28037546508285,4947802325001],[(.D12,14018773254140),(.D8,3659312136188),(.D6,88996017339958)]),([1391569403903],[(.D16,54203561017456),(.D6,5149934222902),(.D16,3284643348592),(.D6,296101084726),(.D16,198847758448),(.D6,16895704630),(.D16,12025331824),(.D6,955317814),(.D16,726417520),(.D6,2170564150),(.D16,623410288),(.D6,27663670),(.D16,37390384),(.D6,1335334),(.D16,2238700),(.D6,1225150616),(.D12,8084),(.D7,10187),(.D8,493),(.D7,4)])]], + .ms [(.m2,.s6,77515569758206)], + .ms2 .s6 .s7 [(.m3,2886218022910,876173328382)], + .ms [(.m3,.s6,88300232638006)], + .ms2 .s6 .s7 [(.m3,54029614841968,5106447679030),(.m0,3273771712624,293383175734),(.m0,198168281200,16725835318),(.m0,11982864496,944700982),(.m0,723763312,2169900598),(.m0,623244400,27622198),(.m0,37380016,1332742),(.m0,2238052,1225150454)], + .ms [(.m12,.s7,8043),(.m0,.s6,10177),(.m3,.s6,491),(.m21,.s3,491),(.m4,.s3,10177),(.m4,.s3,8043)], + .ms2 .s3 .s0 [(.m13,1225150454,2238052),(.m1,1332742,37380016),(.m1,27622198,623244400),(.m1,2169900598,723763312),(.m1,944700982,11982864496),(.m1,16725835318,198168281200),(.m1,293383175734,3273771712624),(.m1,5106447679030,54029614841968),(.m1,88300232638006,876173328382)], + .ms [(.m4,.s3,2886218022910),(.m4,.s3,77515569758200),(.m10,.s7,77515569758206),(.m8,.s2,77515569758201)], + .m .m9, + .b 0 [[([92358976733108],[(.D7,77515569758206)]),([11544872091638,5772436045823,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,2886218022910),(.D6,876173328382),(.D6,88300232638006)]),([360777252863],[(.D16,54029614841968),(.D6,5106447679030),(.D16,3273771712624),(.D6,293383175734),(.D16,198168281200),(.D6,16725835318),(.D16,11982864496),(.D6,944700982),(.D16,723763312),(.D6,2169900598),(.D16,623244400),(.D6,27622198),(.D16,37380016),(.D6,1332742),(.D16,2238052),(.D6,1225150454),(.D12,8043),(.D16,10177),(.D16,491),(.D12,3)])],[([8],[(.D15,65970697666567),(.D21,0),(.D19,154618822653)])]], + .ms [(.m2,.s6,46179488366558),(.m6,.s6,65970697666565),(.m7,.s5,65970697666565),(.m11,.s5,46179488366552)], + .m .m5, + .b 46179488366558 [[([41],[(.D12,65970697666565),(.D8,1),(.D7,154618822652)])],[([3710851743622],[(.D17,65970697666561),(.D2,154618822650)])]], + .ms [(.m2,.s6,48034914238390),(.m3,.s6,65506841198608),(.m27,.s2,65506841198608),(.m1,.s5,48034914238384)], + .m .m78, + ] (by decide +kernel) +theorem chunk_14_step : (cfg_14.denote) [qi]⊢* (cfg_15.denote) := + step_chunk [ + .m .m79, + .b 48034914238390 [[([7],[(.D16,65506841198608), + (.D6,1)])], + [([16],[(.D11,65506841198606), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,65506841198605), + (.D17,1), + (.D15,0), + (.D6,88119844011574)])], + [([16],[(.D11,65506841198603), + (.D3,0)])], + [([8],[(.D15,65506841198602), + (.D17,1), + (.D21,88119844011573), + (.D15,53984517685360), + (.D17,5095173389878), + (.D15,3270953140336), + (.D17,292678532662), + (.D15,197992120432), + (.D17,16681795126), + (.D15,11971854448), + (.D17,941948470), + (.D15,723075184), + (.D17,2169728566), + (.D15,623201392), + (.D17,27611446), + (.D15,37377328), + (.D17,1332070), + (.D15,2237884), + (.D17,1225150412), + (.D11,8032), + (.D12,10174)])], + [([18],[(.D11,65506841198600), + (.D13,0), + (.D16,88119844011573), + (.D16,53984517685360)])], + [([9483287789542],[(.D17,65506841198599), + (.D12,88119844011574), + (.D17,53984517685360), + (.D6,5095173389878), + (.D16,3270953140336), + (.D6,292678532662), + (.D16,197992120432), + (.D6,16681795126), + (.D16,11971854448), + (.D6,941948470), + (.D16,723075184), + (.D6,2169728566), + (.D16,623201392), + (.D6,27611446), + (.D16,37377328), + (.D6,1332070), + (.D16,2237884), + (.D6,1225150412), + (.D12,8033), + (.D13,10174), + (.D9,490), + (.D13,3)])]], + .ms [(.m2,.s6,52776558133198)], + .ms2 .s6 .s7 [(.m3,64321430224906,87823491268152),(.m0,53910429499504,5076651343414),(.m0,3266322628720,291520904758),(.m0,197702713456,16609443382),(.m0,11953766512,937426486),(.m0,721944688,2169445942),(.m0,623130736,27593782),(.m0,37372912,1330966),(.m0,2237608,1225150343)], + .ms [(.m3,.s6,8017)], + .ms2 .s6 .s7 [(.m6,10169,490)], + .ms2 .s3 .s0 [(.m19,490,10169)], + .ms [(.m17,.s0,8017)], + .ms2 .s3 .s0 [(.m4,1225150343,2237608),(.m1,1330966,37372912),(.m1,27593782,623130736),(.m1,2169445942,721944688),(.m1,937426486,11953766512),(.m1,16609443382,197702713456),(.m1,291520904758,3266322628720),(.m1,5076651343414,53910429499504),(.m1,87823491268152,64321430224906)], + .ms [(.m1,.s3,52776558133192),(.m10,.s7,52776558133198),(.m8,.s2,52776558133193)], + .m .m9, + .b 0 [[([44530220924924],[(.D7,52776558133198),(.D17,64321430224906),(.D6,87823491268152),(.D16,53910429499504),(.D6,5076651343414),(.D16,3266322628720),(.D6,291520904758),(.D16,197702713456),(.D6,16609443382),(.D16,11953766512),(.D6,937426486),(.D16,721944688),(.D6,2169445942),(.D16,623130736),(.D6,27593782),(.D16,37372912),(.D6,1330966),(.D16,2237608),(.D6,1225150343),(.D6,8017),(.D12,10169),(.D6,490),(.D16,4)])]], + .ms [(.m2,.s6,22265110462462),(.m3,.s6,47210280517582)], + .ms2 .s6 .s7 [(.m3,62929860821002,87475598917176),(.m0,53823456411760,5054908071478),(.m0,3260886810736,290161950262),(.m0,197362974832,16524508726),(.m0,11932532848,932118070),(.m0,720617584,2169114166),(.m0,623047792,27573046),(.m0,37367728,1329670),(.m0,2237284,1225150262)], + .ms [(.m12,.s7,7995),(.m0,.s6,10165),(.m3,.s6,488),(.m20,.s0,488),(.m1,.s3,10165),(.m4,.s3,7995)], + .ms2 .s3 .s0 [(.m13,1225150262,2237284),(.m1,1329670,37367728),(.m1,27573046,623047792),(.m1,2169114166,720617584),(.m1,932118070,11932532848),(.m1,16524508726,197362974832),(.m1,290161950262,3260886810736),(.m1,5054908071478,53823456411760),(.m1,87475598917176,62929860821002)], + .ms [(.m1,.s3,47210280517582),(.m4,.s3,22265110462456),(.m10,.s7,22265110462462),(.m8,.s2,22265110462457)], + .m .m9, + .b 0 [[([89060441849846,44530220924925,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,22265110462462),(.D17,47210280517582)]),([11132555231230],[(.D16,62929860821002),(.D6,87475598917176),(.D16,53823456411760),(.D6,5054908071478),(.D16,3260886810736),(.D6,290161950262),(.D16,197362974832),(.D6,16524508726),(.D16,11932532848),(.D6,932118070),(.D16,720617584),(.D6,2169114166),(.D16,623047792),(.D6,27573046),(.D16,37367728),(.D6,1329670),(.D16,2237284),(.D6,1225150262),(.D12,7995),(.D16,10165),(.D16,488),(.D6,5)])]], + .ms [(.m2,.s6,89060441849845),(.m14,.s5,89060441849839)], + .m .m5, + .b 89060441849845 [[([5],[(.D18,1),(.D15,41644002901965),(.D14,61538291417098)])]], + .ms [(.m2,.s6,89060441849848),(.m7,.s5,89060441849842)], + .m .m5, + .b 89060441849848 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,89060441849849),(.m15,.s5,89060441849843)], + .m .m5, + .b 89060441849849 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,89060441849850),(.m25,.s2,89060441849845)], + .m .m18, + .b 89060441849850 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,89060441849852),(.m14,.s5,89060441849846)], + .m .m5, + .b 89060441849852 [[([5],[(.D18,1),(.D17,41644002901964),(.D15,61538291417098),(.D17,87127706566200),(.D15,53736483324016),(.D17,5033164799542),(.D15,3255450992752),(.D17,288802995766),(.D15,197023236208),(.D17,16439574070),(.D15,11911299184),(.D17,926809654),(.D15,719290480),(.D17,2168782390),(.D15,622964848),(.D17,27552310),(.D15,37362544),(.D17,1328374),(.D15,2236960),(.D17,1225150181),(.D17,7976),(.D8,10159)])]], + .ms [(.m2,.s6,89060441849855),(.m7,.s5,89060441849849)], + .m .m5, + .b 89060441849855 [[([61022895341565],[(.D8,41644002901964),(.D16,61538291417098),(.D6,87127706566200),(.D16,53736483324016),(.D6,5033164799542),(.D16,3255450992752),(.D6,288802995766),(.D16,197023236208),(.D6,16439574070),(.D16,11911299184),(.D6,926809654),(.D16,719290480),(.D6,2168782390),(.D16,622964848),(.D6,27552310),(.D16,37362544),(.D6,1328374),(.D16,2236960),(.D6,1225150181),(.D6,7977),(.D9,10159),(.D14,486),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,119571889520638,34016140984270),(.m0,59631325937674,86650965196344),(.m0,53617297981552,5003368463926),(.m0,3248001908848,286940724790),(.m0,196557668464,16323182134),(.m0,11882201200,919535158),(.m0,717471856,2168327734),(.m0,622851184,27523894),(.m0,37355440,1326598),(.m0,2236516,1225150070)], + .ms [(.m12,.s7,7947),(.m0,.s6,10153),(.m3,.s6,485),(.m21,.s3,485),(.m4,.s3,10153),(.m4,.s3,7947)], + .ms2 .s3 .s0 [(.m13,1225150070,2236516),(.m1,1326598,37355440),(.m1,27523894,622851184),(.m1,2168327734,717471856),(.m1,919535158,11882201200),(.m1,16323182134,196557668464),(.m1,286940724790,3248001908848),(.m1,5003368463926,53617297981552),(.m1,86650965196344,59631325937674),(.m1,34016140984270,119571889520633)], + .ms [(.m26,.s7,119571889520638),(.m8,.s2,119571889520633)], + .m .m9, + .b 0 [[([244091581366268],[(.D7,119571889520638),(.D7,34016140984269),(.D16,59631325937674),(.D6,86650965196344),(.D16,53617297981552),(.D6,5003368463926),(.D16,3248001908848),(.D6,286940724790),(.D16,196557668464),(.D6,16323182134),(.D16,11882201200),(.D6,919535158),(.D16,717471856),(.D6,2168327734),(.D16,622851184),(.D6,27523894),(.D16,37355440),(.D6,1326598),(.D16,2236516),(.D6,1225150070),(.D12,7947),(.D16,10153),(.D16,485),(.D12,3)])]], + .ms [(.m2,.s6,122045790683134)], + .ms2 .s6 .s7 [(.m3,89060441849854,26388279066574),(.m0,57724360458250,86174223826488),(.m0,53498112639088,4973572128310),(.m0,3240552824944,285078453814),(.m0,196092100720,16206790198),(.m0,11853103216,912260662),(.m0,715653232,2167873078),(.m0,622737520,27495478),(.m0,37348336,1324822),(.m0,2236072,1225149959)], + .ms [(.m3,.s6,7921)], + .ms2 .s6 .s7 [(.m6,10145,484)], + .ms2 .s3 .s0 [(.m19,484,10145)], + .ms [(.m17,.s0,7921)], + .ms2 .s3 .s0 [(.m4,1225149959,2236072),(.m1,1324822,37348336),(.m1,27495478,622737520),(.m1,2167873078,715653232),(.m1,912260662,11853103216),(.m1,16206790198,196092100720),(.m1,285078453814,3240552824944),(.m1,4973572128310,53498112639088),(.m1,86174223826488,57724360458250),(.m1,26388279066574,89060441849854)], + .ms [(.m1,.s3,122045790683128),(.m10,.s7,122045790683134),(.m8,.s2,122045790683129)], + .m .m9, + .b 0 [[([488183162732534,224300372066310],[(.D7,122045790683134),(.D17,89060441849854)]),([44530220924927],[(.D6,26388279066574),(.D16,57724360458250),(.D6,86174223826488),(.D16,53498112639088),(.D6,4973572128310),(.D16,3240552824944),(.D6,285078453814),(.D16,196092100720),(.D6,16206790198),(.D16,11853103216),(.D6,912260662),(.D16,715653232),(.D6,2167873078),(.D16,622737520),(.D6,27495478),(.D16,37348336),(.D6,1324822),(.D16,2236072),(.D6,1225149959),(.D6,7921),(.D12,10145),(.D6,484),(.D16,4)])]], + .ms [(.m2,.s6,356241767399422),(.m3,.s6,32985348833278)], + .ms2 .s6 .s7 [(.m3,66795331387390,20822001450958),(.m0,56332791054346,85826331475512),(.m0,53411139551344,4951828856374),(.m0,3235117006960,283719499318),(.m0,195752362096,16121855542),(.m0,11831869552,906952246),(.m0,714326128,2167541302),(.m0,622654576,27474742),(.m0,37343152,1323526),(.m0,2235748,1225149878)], + .ms [(.m12,.s7,7899),(.m0,.s6,10141),(.m3,.s6,482),(.m20,.s0,482),(.m1,.s3,10141),(.m4,.s3,7899)], + .ms2 .s3 .s0 [(.m13,1225149878,2235748),(.m1,1323526,37343152),(.m1,27474742,622654576),(.m1,2167541302,714326128),(.m1,906952246,11831869552),(.m1,16121855542,195752362096),(.m1,283719499318,3235117006960),(.m1,4951828856374,53411139551344),(.m1,85826331475512,56332791054346),(.m1,20822001450958,66795331387390)], + .ms [(.m1,.s3,32985348833278),(.m4,.s3,356241767399416),(.m10,.s7,356241767399422),(.m8,.s2,356241767399417)], + .m .m9, + .b 0 [[([1055531162664884],[(.D7,356241767399422)]),([131941395333110,65970697666559,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,32985348833278),(.D16,66795331387390)]),([16492674416638],[(.D6,20822001450958),(.D16,56332791054346),(.D6,85826331475512),(.D16,53411139551344),(.D6,4951828856374),(.D16,3235117006960),(.D6,283719499318),(.D16,195752362096),(.D6,16121855542),(.D16,11831869552),(.D6,906952246),(.D16,714326128),(.D6,2167541302),(.D16,622654576),(.D6,27474742),(.D16,37343152),(.D6,1323526),(.D16,2235748),(.D6,1225149878),(.D12,7899),(.D16,10141),(.D16,482),(.D6,5)])]], + .ms [(.m2,.s6,527765581332442),(.m3,.s6,224300372066311),(.m14,.s5,224300372066311),(.m4,.s5,527765581332436)], + .m .m5, + .b 527765581332442 [[([23],[(.D16,224300372066311),(.D18,1),(.D15,58548994179069),(.D16,18760417148878)])]], + .ms [(.m2,.s6,527765581332454),(.m3,.s6,224300372066308),(.m7,.s5,224300372066308),(.m4,.s5,527765581332448)], + .m .m5, + .b 527765581332454 [[([7],[(.D16,224300372066308),(.D6,1)])]], + .ms [(.m2,.s6,527765581332458),(.m6,.s6,224300372066306),(.m15,.s5,224300372066306),(.m11,.s5,527765581332452)], + .m .m5, + .b 527765581332458 [[([5],[(.D12,224300372066306),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,527765581332461,224300372066307)], + .ms [(.m23,.s1,224300372066307),(.m22,.s4,527765581332455)], + .m .m24, + .b 527765581332461 [[([17],[(.D6,224300372066307),(.D6,2)])]], + .ms [(.m2,.s6,527765581332470),(.m6,.s6,224300372066303),(.m14,.s5,224300372066303),(.m11,.s5,527765581332464)], + .m .m5, + .b 527765581332470 [[([23],[(.D12,224300372066303),(.D18,1),(.D17,58548994179068),(.D17,18760417148878),(.D15,55817394978826),(.D17,85697482456632),(.D15,53378927296624),(.D17,4943775792694),(.D15,3233103741040),(.D17,283216182838),(.D15,195626532976),(.D17,16090398262),(.D15,11824005232),(.D17,904986166),(.D15,713834608),(.D17,2167418422),(.D15,622623856),(.D17,27467062),(.D15,37341232),(.D17,1323046),(.D15,2235628),(.D17,1225149848),(.D11,7891),(.D6,10140)])]], + .ms [(.m2,.s6,527765581332482),(.m6,.s6,224300372066300),(.m7,.s5,224300372066300),(.m11,.s5,527765581332476)], + .m .m5, + .b 527765581332482 [[([897201488265201,448600744132605,79164837199881],[(.D12,224300372066300),(.D8,58548994179068),(.D6,18760417148878),(.D16,55817394978826)]),([5566277615615],[(.D6,85697482456632),(.D16,53378927296624),(.D6,4943775792694),(.D16,3233103741040),(.D6,283216182838),(.D16,195626532976),(.D6,16090398262),(.D16,11824005232),(.D6,904986166),(.D16,713834608),(.D6,2167418422),(.D16,622623856),(.D6,27467062),(.D16,37341232),(.D6,1323046),(.D16,2235628),(.D6,1225149848),(.D12,7892),(.D7,10139),(.D8,481),(.D7,4)])]], + .ms [(.m2,.s6,1240249116131326)], + .ms2 .s6 .s7 [(.m3,46179488366590,14018773254142)], + .ms [(.m3,.s6,7627861917646)], + .ms2 .s6 .s7 [(.m3,53034256171018,85001697754680),(.m0,53204981121136,4900289248822),(.m0,3222232105072,280498273846),(.m0,194947055728,15920528950),(.m0,11781537904,894369334),(.m0,711180400,2166754870),(.m0,622457968,27425590),(.m0,37330864,1320454),(.m0,2234980,1225149686)], + .ms [(.m12,.s7,7851),(.m0,.s6,10129),(.m3,.s6,479),(.m21,.s3,479),(.m4,.s3,10129),(.m4,.s3,7851)], + .ms2 .s3 .s0 [(.m13,1225149686,2234980),(.m1,1320454,37330864),(.m1,27425590,622457968),(.m1,2166754870,711180400),(.m1,894369334,11781537904),(.m1,15920528950,194947055728),(.m1,280498273846,3222232105072),(.m1,4900289248822,53204981121136),(.m1,85001697754680,53034256171018),(.m1,7627861917646,14018773254142)], + .ms [(.m4,.s3,46179488366590),(.m4,.s3,1240249116131320),(.m10,.s7,1240249116131326),(.m8,.s2,1240249116131321)], + .m .m9, + .b 0 [[([1477743627730868],[(.D7,1240249116131326)]),([184717953466358,92358976733183,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,46179488366590),(.D6,14018773254142),(.D6,7627861917646)]),([5772436045823],[(.D16,53034256171018),(.D6,85001697754680),(.D16,53204981121136),(.D6,4900289248822),(.D16,3222232105072),(.D6,280498273846),(.D16,194947055728),(.D6,15920528950),(.D16,11781537904),(.D6,894369334),(.D16,711180400),(.D6,2166754870),(.D16,622457968),(.D6,27425590),(.D16,37330864),(.D6,1320454),(.D16,2234980),(.D6,1225149686),(.D12,7851),(.D16,10129),(.D16,479),(.D12,3)])],[([8],[(.D15,1055531162664967),(.D21,0),(.D19,2473901162493)])]], + .ms [(.m2,.s6,738871813865438),(.m6,.s6,1055531162664965),(.m7,.s5,1055531162664965),(.m11,.s5,738871813865432)], + .m .m5, + .b 738871813865438 [[([41],[(.D12,1055531162664965),(.D8,1),(.D7,2473901162492)])],[([59373627899782],[(.D17,1055531162664961),(.D2,2473901162490)])]], + .ms [(.m2,.s6,768558627815350),(.m3,.s6,1048109459177488),(.m27,.s2,1048109459177488),(.m1,.s5,768558627815344)], + .m .m5, + .b 768558627815350 [[([7],[(.D16,1048109459177488), + (.D6,1)])], + [([16],[(.D11,1048109459177486), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,1048109459177485), + (.D17,1), + (.D15,0), + (.D6,4741643894734)])], + [([16],[(.D11,1048109459177483), + (.D3,0)])], + [([8],[(.D15,1048109459177482), + (.D17,1), + (.D21,4741643894733), + (.D15,52312701665290), + (.D17,84821309128248), + (.D15,53159883964528), + (.D17,4889014959670), + (.D15,3219413532784), + (.D17,279793630774), + (.D15,194770894960), + (.D17,15876488758), + (.D15,11770527856), + (.D17,891616822), + (.D15,710492272), + (.D17,2166582838), + (.D15,622414960), + (.D17,27414838), + (.D15,37328176), + (.D17,1319782), + (.D15,2234812), + (.D17,1225149644), + (.D11,7840), + (.D12,10126)])], + [([18],[(.D11,1048109459177480), + (.D13,0), + (.D16,4741643894733), + (.D16,52312701665290)])], + [([151732604631492],[(.D17,1048109459177479)]), + ([18966575578939,9483287789471,4741643894736,2370821947368,1185410973684,592705486839,296352743421,148176371712,74088185856,37044092928,18522046464,9261023232,4630511616,2315255808,1157627904,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,4741643894734), + (.D17,52312701665290)]), + ([2370821947367],[(.D6,84821309128248), + (.D16,53159883964528), + (.D6,4889014959670), + (.D16,3219413532784), + (.D6,279793630774), + (.D16,194770894960), + (.D6,15876488758), + (.D16,11770527856), + (.D6,891616822), + (.D16,710492272), + (.D6,2166582838), + (.D16,622414960), + (.D6,27414838), + (.D16,37328176), + (.D6,1319782), + (.D16,2234812), + (.D6,1225149644), + (.D12,7841), + (.D13,10126), + (.D9,478), + (.D13,3)])], + [([10],[(.D17,1029142883598543), + (.D21,0), + (.D19,51127290691606)])]], + .ms [(.m2,.s6,844424930131138),(.m3,.s6,1029142883598541),(.m7,.s5,1029142883598541),(.m4,.s5,844424930131132)], + .m .m5, + .b 844424930131138 [[([43],[(.D16,1029142883598541),(.D8,1),(.D7,51127290691605)])],[([1227054976598490],[(.D11,1029142883598534),(.D2,51127290691603)])]], + .ms2 .s6 .s7 [(.m2,1457952418430405,875761011523725)], + .ms [(.m29,.s2,875761011523725),(.m4,.s5,1457952418430399)], + .m .m5, + .b 1457952418430405 [[([9],[(.D6,875761011523725),(.D6,1)])],[([20],[(.D15,875761011523723),(.D13,0),(.D10,84524956384826),(.D9,53085795778672)])],[([36],[(.D11,875761011523719)]),([7,2],[(.D12,1),(.D6,84524956384826)])]], + .ms [(.m2,.s6,1457952418430438),(.m6,.s6,875761011523715),(.m15,.s5,875761011523715),(.m11,.s5,1457952418430432)], + .m .m5, + .b 1457952418430438 [[([5],[(.D12,875761011523715),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,1457952418430441,875761011523716)], + .ms [(.m23,.s1,875761011523716),(.m22,.s4,1457952418430435)], + .m .m24, + .b 1457952418430441 [[([17],[(.D6,875761011523716),(.D6,2)])],[([6],[(.D11,875761011523712),(.D21,0),(.D7,84524956384824)])]], + .ms2 .s6 .s7 [(.m2,1457952418430453,875761011523713)], + .ms2 .s5 .s2 [(.m28,875761011523713,1457952418430448)], + .m .m18, + .b 1457952418430453 [[([45],[(.D6,875761011523713),(.D8,1),(.D17,84524956384823),(.D10,53085795778671)])],[([36],[(.D15,875761011523706)]),([7,2],[(.D12,1),(.D17,84524956384822)]),([1],[(.D11,53085795778671),(.D16,4870492913206)])],[([8],[(.D15,875761011523702),(.D21,0),(.D17,84524956384821),(.D12,53085795778672)])]], + .ms [(.m2,.s6,1457952418430498),(.m6,.s6,875761011523700),(.m7,.s5,875761011523700),(.m11,.s5,1457952418430492)], + .m .m5, + .b 1457952418430498 [[([39],[(.D12,875761011523700),(.D8,84524956384822),(.D13,53085795778672),(.D17,4870492913206),(.D15,3214783021168),(.D17,278636002870),(.D15,194481487984),(.D17,15804137014),(.D15,11752439920),(.D17,887094838),(.D15,709361776),(.D17,2166300214),(.D15,622344304),(.D17,27397174),(.D15,37323760),(.D17,1318678),(.D15,2234536),(.D17,1225149575),(.D17,7825),(.D11,10121),(.D17,478),(.D15,3)])]], + .ms [(.m2,.s6,1457952418430518)], + .ms2 .s6 .s7 [(.m3,875761011523696,84524956384822),(.m0,53085795778672,4870492913206),(.m0,3214783021168,278636002870),(.m0,194481487984,15804137014),(.m0,11752439920,887094838),(.m0,709361776,2166300214),(.m0,622344304,27397174),(.m0,37323760,1318678),(.m0,2234536,1225149575)], + .ms [(.m3,.s6,7825)], + .ms2 .s6 .s7 [(.m6,10121,478)], + .ms2 .s3 .s0 [(.m19,478,10121)], + .ms [(.m17,.s0,7825)], + .ms2 .s3 .s0 [(.m4,1225149575,2234536),(.m1,1318678,37323760),(.m1,27397174,622344304),(.m1,2166300214,709361776),(.m1,887094838,11752439920),(.m1,15804137014,194481487984),(.m1,278636002870,3214783021168),(.m1,4870492913206,53085795778672),(.m1,84524956384822,875761011523696)], + .ms [(.m1,.s3,1457952418430512),(.m10,.s7,1457952418430518),(.m8,.s2,1457952418430513)], + .m .m9, + .b 0 [[([44530220924924],[(.D7,1457952418430518),(.D17,875761011523696),(.D6,84524956384822),(.D16,53085795778672),(.D6,4870492913206),(.D16,3214783021168),(.D6,278636002870),(.D16,194481487984),(.D6,15804137014),(.D16,11752439920),(.D6,887094838),(.D16,709361776),(.D6,2166300214),(.D16,622344304),(.D6,27397174),(.D16,37323760),(.D6,1318678),(.D16,2234536),(.D6,1225149575),(.D6,7825),(.D12,10121),(.D6,478),(.D16,4)])]], + .ms [(.m2,.s6,22265110462462),(.m3,.s6,1452386140814902)], + .ms2 .s6 .s7 [(.m3,874369442119792,84177064033846),(.m0,52998822690928,4848749641270),(.m0,3209347203184,277277048374),(.m0,194141749360,15719202358),(.m0,11731206256,881786422),(.m0,708034672,2165968438),(.m0,622261360,27376438),(.m0,37318576,1317382),(.m0,2234212,1225149494)], + .ms [(.m12,.s7,7803),(.m0,.s6,10117),(.m3,.s6,476),(.m20,.s0,476),(.m1,.s3,10117),(.m4,.s3,7803)], + .ms2 .s3 .s0 [(.m13,1225149494,2234212),(.m1,1317382,37318576),(.m1,27376438,622261360),(.m1,2165968438,708034672),(.m1,881786422,11731206256),(.m1,15719202358,194141749360),(.m1,277277048374,3209347203184),(.m1,4848749641270,52998822690928),(.m1,84177064033846,874369442119792)], + .ms [(.m1,.s3,1452386140814902),(.m4,.s3,22265110462456),(.m10,.s7,22265110462462),(.m8,.s2,22265110462457)], + .m .m9, + .b 0 [[([89060441849846,44530220924925,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,22265110462462),(.D17,1452386140814902)]),([11132555231230],[(.D16,874369442119792),(.D6,84177064033846),(.D16,52998822690928),(.D6,4848749641270),(.D16,3209347203184),(.D6,277277048374),(.D16,194141749360),(.D6,15719202358),(.D16,11731206256),(.D6,881786422),(.D16,708034672),(.D6,2165968438),(.D16,622261360),(.D6,27376438),(.D16,37318576),(.D6,1317382),(.D16,2234212),(.D6,1225149494),(.D12,7803),(.D16,10117),(.D16,476),(.D6,5)])]], + .ms [(.m2,.s6,89060441849845),(.m14,.s5,89060441849839)], + .m .m5, + .b 89060441849845 [[([5],[(.D18,1),(.D15,1446819863199285),(.D14,872977872715888)])]], + .ms [(.m2,.s6,89060441849848),(.m7,.s5,89060441849842)], + .m .m5, + .b 89060441849848 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,89060441849849),(.m15,.s5,89060441849843)], + .m .m5, + .b 89060441849849 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,89060441849850),(.m25,.s2,89060441849845)], + .m .m18, + .b 89060441849850 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,89060441849852),(.m14,.s5,89060441849846)], + .m .m5, + .b 89060441849852 [[([5],[(.D18,1),(.D17,1446819863199284),(.D15,872977872715888),(.D17,83829171682870),(.D15,52911849603184),(.D17,4827006369334),(.D15,3203911385200),(.D17,275918093878),(.D15,193802010736),(.D17,15634267702),(.D15,11709972592),(.D17,876478006),(.D15,706707568),(.D17,2165636662),(.D15,622178416),(.D17,27355702),(.D15,37313392),(.D17,1316086),(.D15,2233888),(.D17,1225149413),(.D17,7784),(.D8,10111)])]], + .ms [(.m2,.s6,89060441849855),(.m7,.s5,89060441849849)], + .m .m5, + .b 89060441849855 [[([61022895341565],[(.D8,1446819863199284),(.D16,872977872715888),(.D6,83829171682870),(.D16,52911849603184),(.D6,4827006369334),(.D16,3203911385200),(.D6,275918093878),(.D16,193802010736),(.D6,15634267702),(.D16,11709972592),(.D6,876478006),(.D16,706707568),(.D6,2165636662),(.D16,622178416),(.D6,27355702),(.D16,37313392),(.D6,1316086),(.D16,2233888),(.D6,1225149413),(.D6,7785),(.D9,10111),(.D14,474),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,119571889520638,1439192001281590),(.m0,871070907236464,83352430313014),(.m0,52792664260720,4797210033718),(.m0,3196462301296,274055822902),(.m0,193336442992,15517875766),(.m0,11680874608,869203510),(.m0,704888944,2165182006),(.m0,622064752,27327286),(.m0,37306288,1314310),(.m0,2233444,1225149302)], + .ms [(.m12,.s7,7755),(.m0,.s6,10105),(.m3,.s6,473),(.m21,.s3,473),(.m4,.s3,10105),(.m4,.s3,7755)], + .ms2 .s3 .s0 [(.m13,1225149302,2233444),(.m1,1314310,37306288),(.m1,27327286,622064752),(.m1,2165182006,704888944),(.m1,869203510,11680874608),(.m1,15517875766,193336442992),(.m1,274055822902,3196462301296),(.m1,4797210033718,52792664260720),(.m1,83352430313014,871070907236464),(.m1,1439192001281590,119571889520633)], + .ms [(.m26,.s7,119571889520638),(.m8,.s2,119571889520633)], + ] (by decide +kernel) +theorem chunk_15_step : (cfg_15.denote) [qi]⊢* (cfg_16.denote) := + step_chunk [ + .m .m9, + .b 0 [[([244091581366268],[(.D7,119571889520638),(.D7,1439192001281589),(.D16,871070907236464),(.D6,83352430313014),(.D16,52792664260720),(.D6,4797210033718),(.D16,3196462301296),(.D6,274055822902),(.D16,193336442992),(.D6,15517875766),(.D16,11680874608),(.D6,869203510),(.D16,704888944),(.D6,2165182006),(.D16,622064752),(.D6,27327286),(.D16,37306288),(.D6,1314310),(.D16,2233444),(.D6,1225149302),(.D12,7755),(.D16,10105),(.D16,473),(.D12,3)])]], + .ms [(.m2,.s6,122045790683134)], + .ms2 .s6 .s7 [(.m3,89060441849854,1431564139363894),(.m0,869163941757040,82875688943158),(.m0,52673478918256,4767413698102),(.m0,3189013217392,272193551926),(.m0,192870875248,15401483830),(.m0,11651776624,861929014),(.m0,703070320,2164727350),(.m0,621951088,27298870),(.m0,37299184,1312534),(.m0,2233000,1225149191)], + .ms [(.m3,.s6,7729)], + .ms2 .s6 .s7 [(.m6,10097,472)], + .ms2 .s3 .s0 [(.m19,472,10097)], + .ms [(.m17,.s0,7729)], + .ms2 .s3 .s0 [(.m4,1225149191,2233000),(.m1,1312534,37299184),(.m1,27298870,621951088),(.m1,2164727350,703070320),(.m1,861929014,11651776624),(.m1,15401483830,192870875248),(.m1,272193551926,3189013217392),(.m1,4767413698102,52673478918256),(.m1,82875688943158,869163941757040),(.m1,1431564139363894,89060441849854)], + .ms [(.m1,.s3,122045790683128),(.m10,.s7,122045790683134),(.m8,.s2,122045790683129)], + .m .m9, + .b 0 [[([488183162732534,224300372066310],[(.D7,122045790683134),(.D17,89060441849854)]),([44530220924927],[(.D6,1431564139363894),(.D16,869163941757040),(.D6,82875688943158),(.D16,52673478918256),(.D6,4767413698102),(.D16,3189013217392),(.D6,272193551926),(.D16,192870875248),(.D6,15401483830),(.D16,11651776624),(.D6,861929014),(.D16,703070320),(.D6,2164727350),(.D16,621951088),(.D6,27298870),(.D16,37299184),(.D6,1312534),(.D16,2233000),(.D6,1225149191),(.D6,7729),(.D12,10097),(.D6,472),(.D16,4)])]], + .ms [(.m2,.s6,356241767399422),(.m3,.s6,32985348833278)], + .ms2 .s6 .s7 [(.m3,66795331387390,1425997861748278),(.m0,867772372353136,82527796592182),(.m0,52586505830512,4745670426166),(.m0,3183577399408,270834597430),(.m0,192531136624,15316549174),(.m0,11630542960,856620598),(.m0,701743216,2164395574),(.m0,621868144,27278134),(.m0,37294000,1311238),(.m0,2232676,1225149110)], + .ms [(.m12,.s7,7707),(.m0,.s6,10093),(.m3,.s6,470),(.m20,.s0,470),(.m1,.s3,10093),(.m4,.s3,7707)], + .ms2 .s3 .s0 [(.m13,1225149110,2232676),(.m1,1311238,37294000),(.m1,27278134,621868144),(.m1,2164395574,701743216),(.m1,856620598,11630542960),(.m1,15316549174,192531136624),(.m1,270834597430,3183577399408),(.m1,4745670426166,52586505830512),(.m1,82527796592182,867772372353136),(.m1,1425997861748278,66795331387390)], + .ms [(.m1,.s3,32985348833278),(.m4,.s3,356241767399416),(.m10,.s7,356241767399422),(.m8,.s2,356241767399417)], + .m .m9, + .b 0 [[([1055531162664884],[(.D7,356241767399422)]),([131941395333110,65970697666559,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,32985348833278),(.D16,66795331387390)]),([16492674416638],[(.D6,1425997861748278),(.D16,867772372353136),(.D6,82527796592182),(.D16,52586505830512),(.D6,4745670426166),(.D16,3183577399408),(.D6,270834597430),(.D16,192531136624),(.D6,15316549174),(.D16,11630542960),(.D6,856620598),(.D16,701743216),(.D6,2164395574),(.D16,621868144),(.D6,27278134),(.D16,37294000),(.D6,1311238),(.D16,2232676),(.D6,1225149110),(.D12,7707),(.D16,10093),(.D16,470),(.D6,5)])]], + .ms [(.m2,.s6,527765581332442),(.m3,.s6,224300372066311),(.m14,.s5,224300372066311),(.m4,.s5,527765581332436)], + .m .m5, + .b 527765581332442 [[([23],[(.D16,224300372066311),(.D18,1),(.D15,58548994179069),(.D16,1423936277446198)])]], + .ms [(.m2,.s6,527765581332454),(.m3,.s6,224300372066308),(.m7,.s5,224300372066308),(.m4,.s5,527765581332448)], + .m .m5, + .b 527765581332454 [[([7],[(.D16,224300372066308),(.D6,1)])]], + .ms [(.m2,.s6,527765581332458),(.m6,.s6,224300372066306),(.m15,.s5,224300372066306),(.m11,.s5,527765581332452)], + .m .m5, + .b 527765581332458 [[([5],[(.D12,224300372066306),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,527765581332461,224300372066307)], + .ms [(.m23,.s1,224300372066307),(.m22,.s4,527765581332455)], + .m .m24, + .b 527765581332461 [[([17],[(.D6,224300372066307),(.D6,2)])]], + .ms [(.m2,.s6,527765581332470),(.m6,.s6,224300372066303),(.m14,.s5,224300372066303),(.m11,.s5,527765581332464)], + .m .m5, + .b 527765581332470 [[([23],[(.D12,224300372066303),(.D18,1),(.D17,58548994179068),(.D17,1423936277446198),(.D15,867256976277616),(.D17,82398947573302),(.D15,52554293575792),(.D17,4737617362486),(.D15,3181564133488),(.D17,270331280950),(.D15,192405307504),(.D17,15285091894),(.D15,11622678640),(.D17,854654518),(.D15,701251696),(.D17,2164272694),(.D15,621837424),(.D17,27270454),(.D15,37292080),(.D17,1310758),(.D15,2232556),(.D17,1225149080),(.D11,7699),(.D6,10092)])]], + .ms [(.m2,.s6,527765581332482),(.m6,.s6,224300372066300),(.m7,.s5,224300372066300),(.m11,.s5,527765581332476)], + .m .m5, + .b 527765581332482 [[([897201488265201,448600744132605,79164837199881],[(.D12,224300372066300),(.D8,58548994179068),(.D6,1423936277446198)]),([22265110462463],[(.D16,867256976277616),(.D6,82398947573302),(.D16,52554293575792),(.D6,4737617362486),(.D16,3181564133488),(.D6,270331280950),(.D16,192405307504),(.D6,15285091894),(.D16,11622678640),(.D6,854654518),(.D16,701251696),(.D6,2164272694),(.D16,621837424),(.D6,27270454),(.D16,37292080),(.D6,1310758),(.D16,2232556),(.D6,1225149080),(.D12,7700),(.D7,10091),(.D8,469),(.D7,4)])]], + .ms [(.m2,.s6,1240249116131326)], + .ms2 .s6 .s7 [(.m3,46179488366590,14018773254142)], + .ms [(.m3,.s6,1412803722214966)], + .ms2 .s6 .s7 [(.m3,864473837469808,81703162871350),(.m0,52380347400304,4694130818614),(.m0,3170692497520,267613371958),(.m0,191725830256,15115222582),(.m0,11580211312,844037686),(.m0,698597488,2163609142),(.m0,621671536,27228982),(.m0,37281712,1308166),(.m0,2231908,1225148918)], + .ms [(.m12,.s7,7659),(.m0,.s6,10081),(.m3,.s6,467),(.m21,.s3,467),(.m4,.s3,10081),(.m4,.s3,7659)], + .ms2 .s3 .s0 [(.m13,1225148918,2231908),(.m1,1308166,37281712),(.m1,27228982,621671536),(.m1,2163609142,698597488),(.m1,844037686,11580211312),(.m1,15115222582,191725830256),(.m1,267613371958,3170692497520),(.m1,4694130818614,52380347400304),(.m1,81703162871350,864473837469808),(.m1,1412803722214966,14018773254142)], + .ms [(.m4,.s3,46179488366590),(.m4,.s3,1240249116131320),(.m10,.s7,1240249116131326),(.m8,.s2,1240249116131321)], + .m .m9, + .b 0 [[([1477743627730868],[(.D7,1240249116131326)]), + ([184717953466358,92358976733183,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,46179488366590), + (.D6,14018773254142), + (.D6,1412803722214966)]), + ([5772436045823],[(.D16,864473837469808), + (.D6,81703162871350), + (.D16,52380347400304), + (.D6,4694130818614), + (.D16,3170692497520), + (.D6,267613371958), + (.D16,191725830256), + (.D6,15115222582), + (.D16,11580211312), + (.D6,844037686), + (.D16,698597488), + (.D6,2163609142), + (.D16,621671536), + (.D6,27228982), + (.D16,37281712), + (.D6,1308166), + (.D16,2231908), + (.D6,1225148918), + (.D12,7659), + (.D16,10081), + (.D16,467), + (.D12,3)])], + [([8],[(.D15,1055531162664967), + (.D21,0), + (.D19,2473901162493)])]], + .ms [(.m2,.s6,738871813865438),(.m6,.s6,1055531162664965),(.m7,.s5,1055531162664965),(.m11,.s5,738871813865432)], + .m .m5, + .b 738871813865438 [[([41],[(.D12,1055531162664965),(.D8,1),(.D7,2473901162492)])],[([59373627899782],[(.D17,1055531162664961),(.D2,2473901162490)])]], + .ms [(.m2,.s6,768558627815350),(.m3,.s6,1048109459177488),(.m27,.s2,1048109459177488),(.m1,.s5,768558627815344)], + .m .m5, + .b 768558627815350 [[([7],[(.D16,1048109459177488), + (.D6,1)])], + [([16],[(.D11,1048109459177486), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,1048109459177485), + (.D17,1), + (.D15,0), + (.D6,1409917504192054)])], + [([16],[(.D11,1048109459177483), + (.D3,0)])], + [([8],[(.D15,1048109459177482), + (.D17,1), + (.D21,1409917504192053), + (.D15,863752282964080), + (.D17,81522774244918), + (.D15,52335250243696), + (.D17,4682856529462), + (.D15,3167873925232), + (.D17,266908728886), + (.D15,191549669488), + (.D17,15071182390), + (.D15,11569201264), + (.D17,841285174), + (.D15,697909360), + (.D17,2163437110), + (.D15,621628528), + (.D17,27218230), + (.D15,37279024), + (.D17,1307494), + (.D15,2231740), + (.D17,1225148876), + (.D11,7648), + (.D12,10078)])], + [([18],[(.D11,1048109459177480), + (.D13,0), + (.D16,1409917504192053), + (.D16,863752282964080)])], + [([151732604633062],[(.D17,1048109459177479), + (.D12,1409917504192054), + (.D17,863752282964080), + (.D6,81522774244918), + (.D16,52335250243696), + (.D6,4682856529462), + (.D16,3167873925232), + (.D6,266908728886), + (.D16,191549669488), + (.D6,15071182390), + (.D16,11569201264), + (.D6,841285174), + (.D16,697909360), + (.D6,2163437110), + (.D16,621628528), + (.D6,27218230), + (.D16,37279024), + (.D6,1307494), + (.D16,2231740), + (.D6,1225148876), + (.D12,7649), + (.D13,10078), + (.D9,466), + (.D13,3)])]], + .ms [(.m2,.s6,844424930131918)], + .ms2 .s6 .s7 [(.m3,1029142883598346,1405175860297272),(.m0,862566871990384,81226421501494),(.m0,52261162057840,4664334482998),(.m0,3163243413616,265751100982),(.m0,191260262512,14998830646),(.m0,11551113328,836763190),(.m0,696778864,2163154486),(.m0,621557872,27200566),(.m0,37274608,1306390),(.m0,2231464,1225148807)], + .ms [(.m3,.s6,7633)], + .ms2 .s6 .s7 [(.m6,10073,466)], + .ms2 .s3 .s0 [(.m19,466,10073)], + .ms [(.m17,.s0,7633)], + .ms2 .s3 .s0 [(.m4,1225148807,2231464),(.m1,1306390,37274608),(.m1,27200566,621557872),(.m1,2163154486,696778864),(.m1,836763190,11551113328),(.m1,14998830646,191260262512),(.m1,265751100982,3163243413616),(.m1,4664334482998,52261162057840),(.m1,81226421501494,862566871990384),(.m1,1405175860297272,1029142883598346)], + .ms [(.m1,.s3,844424930131912),(.m10,.s7,844424930131918),(.m8,.s2,844424930131913)], + .m .m9, + .b 0 [[([712483534798844],[(.D7,844424930131918),(.D17,1029142883598346),(.D6,1405175860297272),(.D16,862566871990384),(.D6,81226421501494),(.D16,52261162057840),(.D6,4664334482998),(.D16,3163243413616),(.D6,265751100982),(.D16,191260262512),(.D6,14998830646),(.D16,11551113328),(.D6,836763190),(.D16,696778864),(.D6,2163154486),(.D16,621557872),(.D6,27200566),(.D16,37274608),(.D6,1306390),(.D16,2231464),(.D6,1225148807),(.D6,7633),(.D12,10073),(.D6,466),(.D16,4)])]], + .ms [(.m2,.s6,356241767399422),(.m3,.s6,755364488282062)], + .ms2 .s6 .s7 [(.m3,1006877773135882,1399609582681656),(.m0,861175302586480,80878529150518),(.m0,52174188970096,4642591211062),(.m0,3157807595632,264392146486),(.m0,190920523888,14913895990),(.m0,11529879664,831454774),(.m0,695451760,2162822710),(.m0,621474928,27179830),(.m0,37269424,1305094),(.m0,2231140,1225148726)], + .ms [(.m12,.s7,7611),(.m0,.s6,10069),(.m3,.s6,464),(.m20,.s0,464),(.m1,.s3,10069),(.m4,.s3,7611)], + .ms2 .s3 .s0 [(.m13,1225148726,2231140),(.m1,1305094,37269424),(.m1,27179830,621474928),(.m1,2162822710,695451760),(.m1,831454774,11529879664),(.m1,14913895990,190920523888),(.m1,264392146486,3157807595632),(.m1,4642591211062,52174188970096),(.m1,80878529150518,861175302586480),(.m1,1399609582681656,1006877773135882)], + .ms [(.m1,.s3,755364488282062),(.m4,.s3,356241767399416),(.m10,.s7,356241767399422),(.m8,.s2,356241767399417)], + .m .m9, + .b 0 [[([1424967069597686,712483534798845,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,356241767399422),(.D17,755364488282062)]),([178120883699710],[(.D16,1006877773135882),(.D6,1399609582681656),(.D16,861175302586480),(.D6,80878529150518),(.D16,52174188970096),(.D6,4642591211062),(.D16,3157807595632),(.D6,264392146486),(.D16,190920523888),(.D6,14913895990),(.D16,11529879664),(.D6,831454774),(.D16,695451760),(.D6,2162822710),(.D16,621474928),(.D6,27179830),(.D16,37269424),(.D6,1305094),(.D16,2231140),(.D6,1225148726),(.D12,7611),(.D16,10069),(.D16,464),(.D6,5)])]], + .ms [(.m2,.s6,1424967069597685),(.m14,.s5,1424967069597679)], + .m .m5, + .b 1424967069597685 [[([5],[(.D18,1),(.D15,666304046432205),(.D14,984612662673418)])]], + .ms [(.m2,.s6,1424967069597688),(.m7,.s5,1424967069597682)], + .m .m5, + .b 1424967069597688 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,1424967069597689),(.m15,.s5,1424967069597683)], + .m .m5, + .b 1424967069597689 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,1424967069597690),(.m25,.s2,1424967069597685)], + .m .m18, + .b 1424967069597690 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,1424967069597692),(.m14,.s5,1424967069597686)], + .m .m5, + .b 1424967069597692 [[([5],[(.D18,1),(.D17,666304046432204),(.D15,984612662673418),(.D17,1394043305066040),(.D15,859783733182576),(.D17,80530636799542),(.D15,52087215882352),(.D17,4620847939126),(.D15,3152371777648),(.D17,263033191990),(.D15,190580785264),(.D17,14828961334),(.D15,11508646000),(.D17,826146358),(.D15,694124656),(.D17,2162490934),(.D15,621391984),(.D17,27159094),(.D15,37264240),(.D17,1303798),(.D15,2230816),(.D17,1225148645),(.D17,7592),(.D8,10063)])]], + .ms [(.m2,.s6,1424967069597695),(.m7,.s5,1424967069597689)], + .m .m5, + .b 1424967069597695 [[([976366325465085],[(.D8,666304046432204),(.D16,984612662673418),(.D6,1394043305066040),(.D16,859783733182576),(.D6,80530636799542),(.D16,52087215882352),(.D6,4620847939126),(.D16,3152371777648),(.D6,263033191990),(.D16,190580785264),(.D6,14828961334),(.D16,11508646000),(.D6,826146358),(.D16,694124656),(.D6,2162490934),(.D16,621391984),(.D6,27159094),(.D16,37264240),(.D6,1303798),(.D16,2230816),(.D6,1225148645),(.D6,7593),(.D9,10063),(.D14,462),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,1913150232330238,544258255749070),(.m0,954101215002634,1386415443148344),(.m0,857876767703152,80053895429686),(.m0,51968030539888,4591051603510),(.m0,3144922693744,261170921014),(.m0,190115217520,14712569398),(.m0,11479548016,818871862),(.m0,692306032,2162036278),(.m0,621278320,27130678),(.m0,37257136,1302022),(.m0,2230372,1225148534)], + .ms [(.m12,.s7,7563),(.m0,.s6,10057),(.m3,.s6,461),(.m21,.s3,461),(.m4,.s3,10057),(.m4,.s3,7563)], + .ms2 .s3 .s0 [(.m13,1225148534,2230372),(.m1,1302022,37257136),(.m1,27130678,621278320),(.m1,2162036278,692306032),(.m1,818871862,11479548016),(.m1,14712569398,190115217520),(.m1,261170921014,3144922693744),(.m1,4591051603510,51968030539888),(.m1,80053895429686,857876767703152),(.m1,1386415443148344,954101215002634),(.m1,544258255749070,1913150232330233)], + .ms [(.m26,.s7,1913150232330238),(.m8,.s2,1913150232330233)], + .m .m9, + .b 0 [[([3905465301860348],[(.D7,1913150232330238),(.D7,544258255749069),(.D16,954101215002634),(.D6,1386415443148344),(.D16,857876767703152),(.D6,80053895429686),(.D16,51968030539888),(.D6,4591051603510),(.D16,3144922693744),(.D6,261170921014),(.D16,190115217520),(.D6,14712569398),(.D16,11479548016),(.D6,818871862),(.D16,692306032),(.D6,2162036278),(.D16,621278320),(.D6,27130678),(.D16,37257136),(.D6,1302022),(.D16,2230372),(.D6,1225148534),(.D12,7563),(.D16,10057),(.D16,461),(.D12,3)])]], + .ms [(.m2,.s6,1952732650930174)], + .ms2 .s6 .s7 [(.m3,1424967069597694,422212465065934),(.m0,923589767331850,1378787581230648),(.m0,855969802223728,79577154059830),(.m0,51848845197424,4561255267894),(.m0,3137473609840,259308650038),(.m0,189649649776,14596177462),(.m0,11450450032,811597366),(.m0,690487408,2161581622),(.m0,621164656,27102262),(.m0,37250032,1300246),(.m0,2229928,1225148423)], + .ms [(.m3,.s6,7537)], + .ms2 .s6 .s7 [(.m6,10049,460)], + .ms2 .s3 .s0 [(.m19,460,10049)], + .ms [(.m17,.s0,7537)], + .ms2 .s3 .s0 [(.m4,1225148423,2229928),(.m1,1300246,37250032),(.m1,27102262,621164656),(.m1,2161581622,690487408),(.m1,811597366,11450450032),(.m1,14596177462,189649649776),(.m1,259308650038,3137473609840),(.m1,4561255267894,51848845197424),(.m1,79577154059830,855969802223728),(.m1,1378787581230648,923589767331850),(.m1,422212465065934,1424967069597694)], + .ms [(.m1,.s3,1952732650930168),(.m10,.s7,1952732650930174),(.m8,.s2,1952732650930169)], + .m .m9, + .b 0 [[([7810930603720694,3588805953060870],[(.D7,1952732650930174),(.D17,1424967069597694)]),([712483534798847],[(.D6,422212465065934),(.D16,923589767331850),(.D6,1378787581230648),(.D16,855969802223728),(.D6,79577154059830),(.D16,51848845197424),(.D6,4561255267894),(.D16,3137473609840),(.D6,259308650038),(.D16,189649649776),(.D6,14596177462),(.D16,11450450032),(.D6,811597366),(.D16,690487408),(.D6,2161581622),(.D16,621164656),(.D6,27102262),(.D16,37250032),(.D6,1300246),(.D16,2229928),(.D6,1225148423),(.D6,7537),(.D12,10049),(.D6,460),(.D16,4)])]], + .ms [(.m2,.s6,5699868278390782),(.m3,.s6,527765581332478)], + .ms2 .s6 .s7 [(.m3,1068725302198270,333152023216078),(.m0,901324656869386,1373221303615032),(.m0,854578232819824,79229261708854),(.m0,51761872109680,4539511995958),(.m0,3132037791856,257949695542),(.m0,189309911152,14511242806),(.m0,11429216368,806288950),(.m0,689160304,2161249846),(.m0,621081712,27081526),(.m0,37244848,1298950),(.m0,2229604,1225148342)], + .ms [(.m12,.s7,7515),(.m0,.s6,10045),(.m3,.s6,458),(.m20,.s0,458),(.m1,.s3,10045),(.m4,.s3,7515)], + .ms2 .s3 .s0 [(.m13,1225148342,2229604),(.m1,1298950,37244848),(.m1,27081526,621081712),(.m1,2161249846,689160304),(.m1,806288950,11429216368),(.m1,14511242806,189309911152),(.m1,257949695542,3132037791856),(.m1,4539511995958,51761872109680),(.m1,79229261708854,854578232819824),(.m1,1373221303615032,901324656869386),(.m1,333152023216078,1068725302198270)], + .ms [(.m1,.s3,527765581332478),(.m4,.s3,5699868278390776),(.m10,.s7,5699868278390782),(.m8,.s2,5699868278390777)], + .m .m9, + .b 0 [[([16888498602639284],[(.D7,5699868278390782)]), + ([2111062325329910,1055531162664959,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,527765581332478), + (.D16,1068725302198270)]), + ([263882790666238],[(.D6,333152023216078), + (.D16,901324656869386), + (.D6,1373221303615032), + (.D16,854578232819824), + (.D6,79229261708854), + (.D16,51761872109680), + (.D6,4539511995958), + (.D16,3132037791856), + (.D6,257949695542), + (.D16,189309911152), + (.D6,14511242806), + (.D16,11429216368), + (.D6,806288950), + (.D16,689160304), + (.D6,2161249846), + (.D16,621081712), + (.D6,27081526), + (.D16,37244848), + (.D6,1298950), + (.D16,2229604), + (.D6,1225148342), + (.D12,7515), + (.D16,10045), + (.D16,458), + (.D6,5)])]], + .ms [(.m2,.s6,8444249301319642),(.m3,.s6,3588805953060871),(.m14,.s5,3588805953060871),(.m4,.s5,8444249301319636)], + .m .m5, + .b 8444249301319642 [[([23],[(.D16,3588805953060871),(.D18,1),(.D15,936783906865149),(.D16,300166674382798)])]], + .ms [(.m2,.s6,8444249301319654),(.m3,.s6,3588805953060868),(.m7,.s5,3588805953060868),(.m4,.s5,8444249301319648)], + .m .m5, + .b 8444249301319654 [[([7],[(.D16,3588805953060868),(.D6,1)])]], + .ms [(.m2,.s6,8444249301319658),(.m6,.s6,3588805953060866),(.m15,.s5,3588805953060866),(.m11,.s5,8444249301319652)], + .m .m5, + .b 8444249301319658 [[([5],[(.D12,3588805953060866),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,8444249301319661,3588805953060867)], + .ms [(.m23,.s1,3588805953060867),(.m22,.s4,8444249301319655)], + .m .m24, + .b 8444249301319661 [[([17],[(.D6,3588805953060867),(.D6,2)])]], + .ms [(.m2,.s6,8444249301319670),(.m6,.s6,3588805953060863),(.m14,.s5,3588805953060863),(.m11,.s5,8444249301319664)], + .m .m5, + .b 8444249301319670 [[([23],[(.D12,3588805953060863),(.D18,1),(.D17,936783906865148),(.D17,300166674382798),(.D15,893078319661066),(.D17,1371159719312952),(.D15,854062836744304),(.D17,79100412689974),(.D15,51729659854960),(.D17,4531458932278),(.D15,3130024525936),(.D17,257446379062),(.D15,189184082032),(.D17,14479785526),(.D15,11421352048),(.D17,804322870),(.D15,688668784),(.D17,2161126966),(.D15,621050992),(.D17,27073846),(.D15,37242928),(.D17,1298470),(.D15,2229484),(.D17,1225148312),(.D11,7507),(.D6,10044)])]], + .ms [(.m2,.s6,8444249301319682),(.m6,.s6,3588805953060860),(.m7,.s5,3588805953060860),(.m11,.s5,8444249301319676)], + .m .m5, + .b 8444249301319682 [[([14355223812243441,7177611906121725,1266637395197961],[(.D12,3588805953060860),(.D8,936783906865148),(.D6,300166674382798),(.D16,893078319661066)]),([89060441849855],[(.D6,1371159719312952),(.D16,854062836744304),(.D6,79100412689974),(.D16,51729659854960),(.D6,4531458932278),(.D16,3130024525936),(.D6,257446379062),(.D16,189184082032),(.D6,14479785526),(.D16,11421352048),(.D6,804322870),(.D16,688668784),(.D6,2161126966),(.D16,621050992),(.D6,27073846),(.D16,37242928),(.D6,1298470),(.D16,2229484),(.D6,1225148312),(.D12,7508),(.D7,10043),(.D8,457),(.D7,4)])]], + .ms [(.m2,.s6,19843985858101246)], + .ms2 .s6 .s7 [(.m3,738871813865470,224300372066302)], + .ms [(.m3,.s6,122045790683086)], + .ms2 .s6 .s7 [(.m3,848548098736138,1360027164081720),(.m0,851279697936496,78404627988022),(.m0,51555713679472,4487972388406),(.m0,3119152889968,254728470070),(.m0,188504604784,14309916214),(.m0,11378884720,793706038),(.m0,686014576,2160463414),(.m0,620885104,27032374),(.m0,37232560,1295878),(.m0,2228836,1225148150)], + .ms [(.m12,.s7,7467),(.m0,.s6,10033),(.m3,.s6,455),(.m21,.s3,455),(.m4,.s3,10033),(.m4,.s3,7467)], + .ms2 .s3 .s0 [(.m13,1225148150,2228836),(.m1,1295878,37232560),(.m1,27032374,620885104),(.m1,2160463414,686014576),(.m1,793706038,11378884720),(.m1,14309916214,188504604784),(.m1,254728470070,3119152889968),(.m1,4487972388406,51555713679472),(.m1,78404627988022,851279697936496),(.m1,1360027164081720,848548098736138),(.m1,122045790683086,224300372066302)], + .ms [(.m4,.s3,738871813865470),(.m4,.s3,19843985858101240),(.m10,.s7,19843985858101246),(.m8,.s2,19843985858101241)], + .m .m9, + .b 0 [[([23643898043695028],[(.D7,19843985858101246)]), + ([2955487255461878,1477743627730943,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,738871813865470), + (.D6,224300372066302), + (.D6,122045790683086)]), + ([92358976733183],[(.D16,848548098736138), + (.D6,1360027164081720), + (.D16,851279697936496), + (.D6,78404627988022), + (.D16,51555713679472), + (.D6,4487972388406), + (.D16,3119152889968), + (.D6,254728470070), + (.D16,188504604784), + (.D6,14309916214), + (.D16,11378884720), + (.D6,793706038), + (.D16,686014576), + (.D6,2160463414), + (.D16,620885104), + (.D6,27032374), + (.D16,37232560), + (.D6,1295878), + (.D16,2228836), + (.D6,1225148150), + (.D12,7467), + (.D16,10033), + (.D16,455), + (.D12,3)])], + [([8],[(.D15,16888498602639367), + (.D21,0), + (.D19,39582418599933)])]], + .ms [(.m2,.s6,11821949021847518),(.m6,.s6,16888498602639365),(.m7,.s5,16888498602639365),(.m11,.s5,11821949021847512)], + .m .m5, + .b 11821949021847518 [[([41],[(.D12,16888498602639365),(.D8,1),(.D7,39582418599932)])],[([949978046398342],[(.D17,16888498602639361),(.D2,39582418599930)])]], + .ms [(.m2,.s6,12296938045046710),(.m3,.s6,16769751346839568),(.m27,.s2,16769751346839568),(.m1,.s5,12296938045046704)], + .m .m80, + ] (by decide +kernel) +theorem chunk_16_step : (cfg_16.denote) [qi]⊢* (cfg_17.denote) := + step_chunk [ + .m .m81, + .b 12296938045046710 [[([7],[(.D16,16769751346839568), + (.D6,1)])], + [([16],[(.D11,16769751346839566), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,16769751346839565), + (.D17,1), + (.D15,0), + (.D6,75866302316494)])], + [([16],[(.D11,16769751346839563), + (.D3,0)])], + [([8],[(.D15,16769751346839562), + (.D17,1), + (.D21,75866302316493), + (.D15,837003226644490), + (.D17,1357140946058808), + (.D15,850558143430768), + (.D17,78224239361590), + (.D15,51510616522864), + (.D17,4476698099254), + (.D15,3116334317680), + (.D17,254023826998), + (.D15,188328444016), + (.D17,14265876022), + (.D15,11367874672), + (.D17,790953526), + (.D15,685326448), + (.D17,2160291382), + (.D15,620842096), + (.D17,27021622), + (.D15,37229872), + (.D17,1295206), + (.D15,2228668), + (.D17,1225148108), + (.D11,7456), + (.D12,10030)])], + [([18],[(.D11,16769751346839560), + (.D13,0), + (.D16,75866302316493), + (.D16,837003226644490)])], + [([2427721674127812],[(.D17,16769751346839559)]), + ([303465209265979,151732604632991,75866302316496,37933151158248,18966575579124,9483287789559,4741643894781,2370821947392,1185410973696,592705486848,296352743424,148176371712,74088185856,37044092928,18522046464,9261023232,4630511616,2315255808,1157627904,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,75866302316494), + (.D17,837003226644490)]), + ([37933151158247],[(.D6,1357140946058808), + (.D16,850558143430768), + (.D6,78224239361590), + (.D16,51510616522864), + (.D6,4476698099254), + (.D16,3116334317680), + (.D6,254023826998), + (.D16,188328444016), + (.D6,14265876022), + (.D16,11367874672), + (.D6,790953526), + (.D16,685326448), + (.D6,2160291382), + (.D16,620842096), + (.D6,27021622), + (.D16,37229872), + (.D6,1295206), + (.D16,2228668), + (.D6,1225148108), + (.D12,7457), + (.D13,10030), + (.D9,454), + (.D13,3)])], + [([10],[(.D17,16466286137573583), + (.D21,0), + (.D19,818036651065366)])]], + .ms [(.m2,.s6,13510798882110658),(.m3,.s6,16466286137573581),(.m7,.s5,16466286137573581),(.m4,.s5,13510798882110652)], + .m .m5, + .b 13510798882110658 [[([43],[(.D16,16466286137573581),(.D8,1),(.D7,818036651065365)])],[([19632879625568730],[(.D11,16466286137573574),(.D2,818036651065363)])]], + .ms2 .s6 .s7 [(.m2,23327238694895045,14012176184377485)], + .ms [(.m29,.s2,14012176184377485),(.m4,.s5,23327238694895039)], + .m .m5, + .b 23327238694895045 [[([9],[(.D6,14012176184377485),(.D6,1)])],[([20],[(.D15,14012176184377483),(.D13,0),(.D10,1352399302164026),(.D9,849372732457072)])],[([36],[(.D11,14012176184377479)]),([7,2],[(.D12,1),(.D6,1352399302164026)])]], + .ms [(.m2,.s6,23327238694895078),(.m6,.s6,14012176184377475),(.m15,.s5,14012176184377475),(.m11,.s5,23327238694895072)], + .m .m5, + .b 23327238694895078 [[([5],[(.D12,14012176184377475),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,23327238694895081,14012176184377476)], + .ms [(.m23,.s1,14012176184377476),(.m22,.s4,23327238694895075)], + .m .m24, + .b 23327238694895081 [[([17],[(.D6,14012176184377476),(.D6,2)])],[([6],[(.D11,14012176184377472),(.D21,0),(.D7,1352399302164024)])]], + .ms2 .s6 .s7 [(.m2,23327238694895093,14012176184377473)], + .ms2 .s5 .s2 [(.m28,14012176184377473,23327238694895088)], + .m .m18, + .b 23327238694895093 [[([45],[(.D6,14012176184377473),(.D8,1),(.D17,1352399302164023),(.D10,849372732457071)])],[([36],[(.D15,14012176184377466)]),([7,2],[(.D12,1),(.D17,1352399302164022)]),([1],[(.D11,849372732457071),(.D16,77927886618166)])],[([8],[(.D15,14012176184377462),(.D21,0),(.D17,1352399302164021),(.D12,849372732457072)])]], + .ms [(.m2,.s6,23327238694895138),(.m6,.s6,14012176184377460),(.m7,.s5,14012176184377460),(.m11,.s5,23327238694895132)], + .m .m5, + .b 23327238694895138 [[([39],[(.D12,14012176184377460),(.D8,1352399302164022),(.D13,849372732457072),(.D17,77927886618166),(.D15,51436528337008),(.D17,4458176052790),(.D15,3111703806064),(.D17,252866199094),(.D15,188039037040),(.D17,14193524278),(.D15,11349786736),(.D17,786431542),(.D15,684195952),(.D17,2160008758),(.D15,620771440),(.D17,27003958),(.D15,37225456),(.D17,1294102),(.D15,2228392),(.D17,1225148039),(.D17,7441),(.D11,10025),(.D17,454),(.D15,3)])]], + .ms [(.m2,.s6,23327238694895158)], + .ms2 .s6 .s7 [(.m3,14012176184377456,1352399302164022),(.m0,849372732457072,77927886618166),(.m0,51436528337008,4458176052790),(.m0,3111703806064,252866199094),(.m0,188039037040,14193524278),(.m0,11349786736,786431542),(.m0,684195952,2160008758),(.m0,620771440,27003958),(.m0,37225456,1294102),(.m0,2228392,1225148039)], + .ms [(.m3,.s6,7441)], + .ms2 .s6 .s7 [(.m6,10025,454)], + .ms2 .s3 .s0 [(.m19,454,10025)], + .ms [(.m17,.s0,7441)], + .ms2 .s3 .s0 [(.m4,1225148039,2228392),(.m1,1294102,37225456),(.m1,27003958,620771440),(.m1,2160008758,684195952),(.m1,786431542,11349786736),(.m1,14193524278,188039037040),(.m1,252866199094,3111703806064),(.m1,4458176052790,51436528337008),(.m1,77927886618166,849372732457072),(.m1,1352399302164022,14012176184377456)], + .ms [(.m1,.s3,23327238694895152),(.m10,.s7,23327238694895158),(.m8,.s2,23327238694895153)], + .m .m9, + .b 0 [[([712483534798844],[(.D7,23327238694895158),(.D17,14012176184377456),(.D6,1352399302164022),(.D16,849372732457072),(.D6,77927886618166),(.D16,51436528337008),(.D6,4458176052790),(.D16,3111703806064),(.D6,252866199094),(.D16,188039037040),(.D6,14193524278),(.D16,11349786736),(.D6,786431542),(.D16,684195952),(.D6,2160008758),(.D16,620771440),(.D6,27003958),(.D16,37225456),(.D6,1294102),(.D16,2228392),(.D6,1225148039),(.D6,7441),(.D12,10025),(.D6,454),(.D16,4)])]], + .ms [(.m2,.s6,356241767399422),(.m3,.s6,23238178253045302)], + .ms2 .s6 .s7 [(.m3,13989911073914992,1346833024548406),(.m0,847981163053168,77579994267190),(.m0,51349555249264,4436432780854),(.m0,3106267988080,251507244598),(.m0,187699298416,14108589622),(.m0,11328553072,781123126),(.m0,682868848,2159676982),(.m0,620688496,26983222),(.m0,37220272,1292806),(.m0,2228068,1225147958)], + .ms [(.m12,.s7,7419),(.m0,.s6,10021),(.m3,.s6,452),(.m20,.s0,452),(.m1,.s3,10021),(.m4,.s3,7419)], + .ms2 .s3 .s0 [(.m13,1225147958,2228068),(.m1,1292806,37220272),(.m1,26983222,620688496),(.m1,2159676982,682868848),(.m1,781123126,11328553072),(.m1,14108589622,187699298416),(.m1,251507244598,3106267988080),(.m1,4436432780854,51349555249264),(.m1,77579994267190,847981163053168),(.m1,1346833024548406,13989911073914992)], + .ms [(.m1,.s3,23238178253045302),(.m4,.s3,356241767399416),(.m10,.s7,356241767399422),(.m8,.s2,356241767399417)], + .m .m9, + .b 0 [[([1424967069597686,712483534798845,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,356241767399422),(.D17,23238178253045302)]),([178120883699710],[(.D16,13989911073914992),(.D6,1346833024548406),(.D16,847981163053168),(.D6,77579994267190),(.D16,51349555249264),(.D6,4436432780854),(.D16,3106267988080),(.D6,251507244598),(.D16,187699298416),(.D6,14108589622),(.D16,11328553072),(.D6,781123126),(.D16,682868848),(.D6,2159676982),(.D16,620688496),(.D6,26983222),(.D16,37220272),(.D6,1292806),(.D16,2228068),(.D6,1225147958),(.D12,7419),(.D16,10021),(.D16,452),(.D6,5)])]], + .ms [(.m2,.s6,1424967069597685),(.m14,.s5,1424967069597679)], + .m .m5, + .b 1424967069597685 [[([5],[(.D18,1),(.D15,23149117811195445),(.D14,13967645963452528)])]], + .ms [(.m2,.s6,1424967069597688),(.m7,.s5,1424967069597682)], + .m .m5, + .b 1424967069597688 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,1424967069597689),(.m15,.s5,1424967069597683)], + .m .m5, + .b 1424967069597689 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,1424967069597690),(.m25,.s2,1424967069597685)], + .m .m18, + .b 1424967069597690 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,1424967069597692),(.m14,.s5,1424967069597686)], + .m .m5, + .b 1424967069597692 [[([5],[(.D18,1),(.D17,23149117811195444),(.D15,13967645963452528),(.D17,1341266746932790),(.D15,846589593649264),(.D17,77232101916214),(.D15,51262582161520),(.D17,4414689508918),(.D15,3100832170096),(.D17,250148290102),(.D15,187359559792),(.D17,14023654966),(.D15,11307319408),(.D17,775814710),(.D15,681541744),(.D17,2159345206),(.D15,620605552),(.D17,26962486),(.D15,37215088),(.D17,1291510),(.D15,2227744),(.D17,1225147877),(.D17,7400),(.D8,10015)])]], + .ms [(.m2,.s6,1424967069597695),(.m7,.s5,1424967069597689)], + .m .m5, + .b 1424967069597695 [[([976366325465085],[(.D8,23149117811195444),(.D16,13967645963452528),(.D6,1341266746932790),(.D16,846589593649264),(.D6,77232101916214),(.D16,51262582161520),(.D6,4414689508918),(.D16,3100832170096),(.D6,250148290102),(.D16,187359559792),(.D6,14023654966),(.D16,11307319408),(.D6,775814710),(.D16,681541744),(.D6,2159345206),(.D16,620605552),(.D6,26962486),(.D16,37215088),(.D6,1291510),(.D16,2227744),(.D6,1225147877),(.D6,7401),(.D9,10015),(.D14,450),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,1913150232330238,23027072020512310),(.m0,13937134515781744,1333638885015094),(.m0,844682628169840,76755360546358),(.m0,51143396819056,4384893173302),(.m0,3093383086192,248286019126),(.m0,186893992048,13907263030),(.m0,11278221424,768540214),(.m0,679723120,2158890550),(.m0,620491888,26934070),(.m0,37207984,1289734),(.m0,2227300,1225147766)], + .ms [(.m12,.s7,7371),(.m0,.s6,10009),(.m3,.s6,449),(.m21,.s3,449),(.m4,.s3,10009),(.m4,.s3,7371)], + .ms2 .s3 .s0 [(.m13,1225147766,2227300),(.m1,1289734,37207984),(.m1,26934070,620491888),(.m1,2158890550,679723120),(.m1,768540214,11278221424),(.m1,13907263030,186893992048),(.m1,248286019126,3093383086192),(.m1,4384893173302,51143396819056),(.m1,76755360546358,844682628169840),(.m1,1333638885015094,13937134515781744),(.m1,23027072020512310,1913150232330233)], + .ms [(.m26,.s7,1913150232330238),(.m8,.s2,1913150232330233)], + .m .m9, + .b 0 [[([3905465301860348],[(.D7,1913150232330238),(.D7,23027072020512309),(.D16,13937134515781744),(.D6,1333638885015094),(.D16,844682628169840),(.D6,76755360546358),(.D16,51143396819056),(.D6,4384893173302),(.D16,3093383086192),(.D6,248286019126),(.D16,186893992048),(.D6,13907263030),(.D16,11278221424),(.D6,768540214),(.D16,679723120),(.D6,2158890550),(.D16,620491888),(.D6,26934070),(.D16,37207984),(.D6,1289734),(.D16,2227300),(.D6,1225147766),(.D12,7371),(.D16,10009),(.D16,449),(.D12,3)])]], + .ms [(.m2,.s6,1952732650930174)], + .ms2 .s6 .s7 [(.m3,1424967069597694,22905026229829174),(.m0,13906623068110960,1326011023097398),(.m0,842775662690416,76278619176502),(.m0,51024211476592,4355096837686),(.m0,3085934002288,246423748150),(.m0,186428424304,13790871094),(.m0,11249123440,761265718),(.m0,677904496,2158435894),(.m0,620378224,26905654),(.m0,37200880,1287958),(.m0,2226856,1225147655)], + .ms [(.m3,.s6,7345)], + .ms2 .s6 .s7 [(.m6,10001,448)], + .ms2 .s3 .s0 [(.m19,448,10001)], + .ms [(.m17,.s0,7345)], + .ms2 .s3 .s0 [(.m4,1225147655,2226856),(.m1,1287958,37200880),(.m1,26905654,620378224),(.m1,2158435894,677904496),(.m1,761265718,11249123440),(.m1,13790871094,186428424304),(.m1,246423748150,3085934002288),(.m1,4355096837686,51024211476592),(.m1,76278619176502,842775662690416),(.m1,1326011023097398,13906623068110960),(.m1,22905026229829174,1424967069597694)], + .ms [(.m1,.s3,1952732650930168),(.m10,.s7,1952732650930174),(.m8,.s2,1952732650930169)], + .m .m9, + .b 0 [[([7810930603720694,3588805953060870],[(.D7,1952732650930174),(.D17,1424967069597694)]),([712483534798847],[(.D6,22905026229829174),(.D16,13906623068110960),(.D6,1326011023097398),(.D16,842775662690416),(.D6,76278619176502),(.D16,51024211476592),(.D6,4355096837686),(.D16,3085934002288),(.D6,246423748150),(.D16,186428424304),(.D6,13790871094),(.D16,11249123440),(.D6,761265718),(.D16,677904496),(.D6,2158435894),(.D16,620378224),(.D6,26905654),(.D16,37200880),(.D6,1287958),(.D16,2226856),(.D6,1225147655),(.D6,7345),(.D12,10001),(.D6,448),(.D16,4)])]], + .ms [(.m2,.s6,5699868278390782),(.m3,.s6,527765581332478)], + .ms2 .s6 .s7 [(.m3,1068725302198270,22815965787979318),(.m0,13884357957648496,1320444745481782),(.m0,841384093286512,75930726825526),(.m0,50937238388848,4333353565750),(.m0,3080498184304,245064793654),(.m0,186088685680,13705936438),(.m0,11227889776,755957302),(.m0,676577392,2158104118),(.m0,620295280,26884918),(.m0,37195696,1286662),(.m0,2226532,1225147574)], + .ms [(.m12,.s7,7323),(.m0,.s6,9997),(.m3,.s6,446),(.m20,.s0,446),(.m1,.s3,9997),(.m4,.s3,7323)], + .ms2 .s3 .s0 [(.m13,1225147574,2226532),(.m1,1286662,37195696),(.m1,26884918,620295280),(.m1,2158104118,676577392),(.m1,755957302,11227889776),(.m1,13705936438,186088685680),(.m1,245064793654,3080498184304),(.m1,4333353565750,50937238388848),(.m1,75930726825526,841384093286512),(.m1,1320444745481782,13884357957648496),(.m1,22815965787979318,1068725302198270)], + .ms [(.m1,.s3,527765581332478),(.m4,.s3,5699868278390776),(.m10,.s7,5699868278390782),(.m8,.s2,5699868278390777)], + .m .m9, + .b 0 [[([16888498602639284],[(.D7,5699868278390782)]), + ([2111062325329910,1055531162664959,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,527765581332478), + (.D16,1068725302198270)]), + ([263882790666238],[(.D6,22815965787979318), + (.D16,13884357957648496), + (.D6,1320444745481782), + (.D16,841384093286512), + (.D6,75930726825526), + (.D16,50937238388848), + (.D6,4333353565750), + (.D16,3080498184304), + (.D6,245064793654), + (.D16,186088685680), + (.D6,13705936438), + (.D16,11227889776), + (.D6,755957302), + (.D16,676577392), + (.D6,2158104118), + (.D16,620295280), + (.D6,26884918), + (.D16,37195696), + (.D6,1286662), + (.D16,2226532), + (.D6,1225147574), + (.D12,7323), + (.D16,9997), + (.D16,446), + (.D6,5)])]], + .ms [(.m2,.s6,8444249301319642),(.m3,.s6,3588805953060871),(.m14,.s5,3588805953060871),(.m4,.s5,8444249301319636)], + .m .m5, + .b 8444249301319642 [[([23],[(.D16,3588805953060871),(.D18,1),(.D15,936783906865149),(.D16,22782980439146038)])]], + .ms [(.m2,.s6,8444249301319654),(.m3,.s6,3588805953060868),(.m7,.s5,3588805953060868),(.m4,.s5,8444249301319648)], + .m .m5, + .b 8444249301319654 [[([7],[(.D16,3588805953060868),(.D6,1)])]], + .ms [(.m2,.s6,8444249301319658),(.m6,.s6,3588805953060866),(.m15,.s5,3588805953060866),(.m11,.s5,8444249301319652)], + .m .m5, + .b 8444249301319658 [[([5],[(.D12,3588805953060866),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,8444249301319661,3588805953060867)], + .ms [(.m23,.s1,3588805953060867),(.m22,.s4,8444249301319655)], + .m .m24, + .b 8444249301319661 [[([17],[(.D6,3588805953060867),(.D6,2)])]], + .ms [(.m2,.s6,8444249301319670),(.m6,.s6,3588805953060863),(.m14,.s5,3588805953060863),(.m11,.s5,8444249301319664)], + .m .m5, + .b 8444249301319670 [[([23],[(.D12,3588805953060863),(.D18,1),(.D17,936783906865148),(.D17,22782980439146038),(.D15,13876111620440176),(.D17,1318383161179702),(.D15,840868697210992),(.D17,75801877806646),(.D15,50905026134128),(.D17,4325300502070),(.D15,3078484918384),(.D17,244561477174),(.D15,185962856560),(.D17,13674479158),(.D15,11220025456),(.D17,753991222),(.D15,676085872),(.D17,2157981238),(.D15,620264560),(.D17,26877238),(.D15,37193776),(.D17,1286182),(.D15,2226412),(.D17,1225147544),(.D11,7315),(.D6,9996)])]], + .ms [(.m2,.s6,8444249301319682),(.m6,.s6,3588805953060860),(.m7,.s5,3588805953060860),(.m11,.s5,8444249301319676)], + .m .m5, + .b 8444249301319682 [[([14355223812243441,7177611906121725,1266637395197961],[(.D12,3588805953060860),(.D8,936783906865148),(.D6,22782980439146038)]),([356241767399423],[(.D16,13876111620440176),(.D6,1318383161179702),(.D16,840868697210992),(.D6,75801877806646),(.D16,50905026134128),(.D6,4325300502070),(.D16,3078484918384),(.D6,244561477174),(.D16,185962856560),(.D6,13674479158),(.D16,11220025456),(.D6,753991222),(.D16,676085872),(.D6,2157981238),(.D16,620264560),(.D6,26877238),(.D16,37193776),(.D6,1286182),(.D16,2226412),(.D6,1225147544),(.D12,7316),(.D7,9995),(.D8,445),(.D7,4)])]], + .ms [(.m2,.s6,19843985858101246)], + .ms2 .s6 .s7 [(.m3,738871813865470,224300372066302)], + .ms [(.m3,.s6,22604859555446326)], + .ms2 .s6 .s7 [(.m3,13831581399515248,1307250605948470),(.m0,838085558403184,75106093104694),(.m0,50731079958640,4281813958198),(.m0,3067613282416,241843568182),(.m0,185283379312,13504609846),(.m0,11177558128,743374390),(.m0,673431664,2157317686),(.m0,620098672,26835766),(.m0,37183408,1283590),(.m0,2225764,1225147382)], + .ms [(.m12,.s7,7275),(.m0,.s6,9985),(.m3,.s6,443),(.m21,.s3,443),(.m4,.s3,9985),(.m4,.s3,7275)], + .ms2 .s3 .s0 [(.m13,1225147382,2225764),(.m1,1283590,37183408),(.m1,26835766,620098672),(.m1,2157317686,673431664),(.m1,743374390,11177558128),(.m1,13504609846,185283379312),(.m1,241843568182,3067613282416),(.m1,4281813958198,50731079958640),(.m1,75106093104694,838085558403184),(.m1,1307250605948470,13831581399515248),(.m1,22604859555446326,224300372066302)], + .ms [(.m4,.s3,738871813865470),(.m4,.s3,19843985858101240),(.m10,.s7,19843985858101246),(.m8,.s2,19843985858101241)], + .m .m9, + .b 0 [[([23643898043695028],[(.D7,19843985858101246)]), + ([2955487255461878,1477743627730943,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,738871813865470), + (.D6,224300372066302), + (.D6,22604859555446326)]), + ([92358976733183],[(.D16,13831581399515248), + (.D6,1307250605948470), + (.D16,838085558403184), + (.D6,75106093104694), + (.D16,50731079958640), + (.D6,4281813958198), + (.D16,3067613282416), + (.D6,241843568182), + (.D16,185283379312), + (.D6,13504609846), + (.D16,11177558128), + (.D6,743374390), + (.D16,673431664), + (.D6,2157317686), + (.D16,620098672), + (.D6,26835766), + (.D16,37183408), + (.D6,1283590), + (.D16,2225764), + (.D6,1225147382), + (.D12,7275), + (.D16,9985), + (.D16,443), + (.D12,3)])], + [([8],[(.D15,16888498602639367), + (.D21,0), + (.D19,39582418599933)])]], + .ms [(.m2,.s6,11821949021847518),(.m6,.s6,16888498602639365),(.m7,.s5,16888498602639365),(.m11,.s5,11821949021847512)], + .m .m5, + .b 11821949021847518 [[([41],[(.D12,16888498602639365),(.D8,1),(.D7,39582418599932)])],[([949978046398342],[(.D17,16888498602639361),(.D2,39582418599930)])]], + .ms [(.m2,.s6,12296938045046710),(.m3,.s6,16769751346839568),(.m27,.s2,16769751346839568),(.m1,.s5,12296938045046704)], + .m .m5, + .b 12296938045046710 [[([7],[(.D16,16769751346839568), + (.D6,1)])], + [([16],[(.D11,16769751346839566), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,16769751346839565), + (.D17,1), + (.D15,0), + (.D6,22558680067079734)])], + [([16],[(.D11,16769751346839563), + (.D3,0)])], + [([8],[(.D15,16769751346839562), + (.D17,1), + (.D21,22558680067079733), + (.D15,13820036527423600), + (.D17,1304364387925558), + (.D15,837364003897456), + (.D17,74925704478262), + (.D15,50685982802032), + (.D17,4270539669046), + (.D15,3064794710128), + (.D17,241138925110), + (.D15,185107218544), + (.D17,13460569654), + (.D15,11166548080), + (.D17,740621878), + (.D15,672743536), + (.D17,2157145654), + (.D15,620055664), + (.D17,26825014), + (.D15,37180720), + (.D17,1282918), + (.D15,2225596), + (.D17,1225147340), + (.D11,7264), + (.D12,9982)])], + [([18],[(.D11,16769751346839560), + (.D13,0), + (.D16,22558680067079733), + (.D16,13820036527423600)])], + [([2427721674129382],[(.D17,16769751346839559), + (.D12,22558680067079734), + (.D17,13820036527423600), + (.D6,1304364387925558), + (.D16,837364003897456), + (.D6,74925704478262), + (.D16,50685982802032), + (.D6,4270539669046), + (.D16,3064794710128), + (.D6,241138925110), + (.D16,185107218544), + (.D6,13460569654), + (.D16,11166548080), + (.D6,740621878), + (.D16,672743536), + (.D6,2157145654), + (.D16,620055664), + (.D6,26825014), + (.D16,37180720), + (.D6,1282918), + (.D16,2225596), + (.D6,1225147340), + (.D12,7265), + (.D13,9982), + (.D9,442), + (.D13,3)])]], + .ms [(.m2,.s6,13510798882111438)], + .ms2 .s6 .s7 [(.m3,16466286137573386,22482813764763192),(.m0,13801069951844464,1299622744030774),(.m0,836178592923760,74629351734838),(.m0,50611894616176,4252017622582),(.m0,3060164198512,239981297206),(.m0,184817811568,13388217910),(.m0,11148460144,736099894),(.m0,671613040,2156863030),(.m0,619985008,26807350),(.m0,37176304,1281814),(.m0,2225320,1225147271)], + .ms [(.m3,.s6,7249)], + .ms2 .s6 .s7 [(.m6,9977,442)], + .ms2 .s3 .s0 [(.m19,442,9977)], + .ms [(.m17,.s0,7249)], + .ms2 .s3 .s0 [(.m4,1225147271,2225320),(.m1,1281814,37176304),(.m1,26807350,619985008),(.m1,2156863030,671613040),(.m1,736099894,11148460144),(.m1,13388217910,184817811568),(.m1,239981297206,3060164198512),(.m1,4252017622582,50611894616176),(.m1,74629351734838,836178592923760),(.m1,1299622744030774,13801069951844464),(.m1,22482813764763192,16466286137573386)], + .ms [(.m1,.s3,13510798882111432),(.m10,.s7,13510798882111438),(.m8,.s2,13510798882111433)], + .m .m9, + .b 0 [[([11399736556781564],[(.D7,13510798882111438),(.D17,16466286137573386),(.D6,22482813764763192),(.D16,13801069951844464),(.D6,1299622744030774),(.D16,836178592923760),(.D6,74629351734838),(.D16,50611894616176),(.D6,4252017622582),(.D16,3060164198512),(.D6,239981297206),(.D16,184817811568),(.D6,13388217910),(.D16,11148460144),(.D6,736099894),(.D16,671613040),(.D6,2156863030),(.D16,619985008),(.D6,26807350),(.D16,37176304),(.D6,1281814),(.D16,2225320),(.D6,1225147271),(.D6,7249),(.D12,9977),(.D6,442),(.D16,4)])]], + .ms [(.m2,.s6,5699868278390782),(.m3,.s6,12085831812513742)], + .ms2 .s6 .s7 [(.m3,16110044370173962,22393753322913336),(.m0,13778804841382000,1294056466415158),(.m0,834787023519856,74281459383862),(.m0,50524921528432,4230274350646),(.m0,3054728380528,238622342710),(.m0,184478072944,13303283254),(.m0,11127226480,730791478),(.m0,670285936,2156531254),(.m0,619902064,26786614),(.m0,37171120,1280518),(.m0,2224996,1225147190)], + .ms [(.m12,.s7,7227),(.m0,.s6,9973),(.m3,.s6,440),(.m20,.s0,440),(.m1,.s3,9973),(.m4,.s3,7227)], + .ms2 .s3 .s0 [(.m13,1225147190,2224996),(.m1,1280518,37171120),(.m1,26786614,619902064),(.m1,2156531254,670285936),(.m1,730791478,11127226480),(.m1,13303283254,184478072944),(.m1,238622342710,3054728380528),(.m1,4230274350646,50524921528432),(.m1,74281459383862,834787023519856),(.m1,1294056466415158,13778804841382000),(.m1,22393753322913336,16110044370173962)], + .ms [(.m1,.s3,12085831812513742),(.m4,.s3,5699868278390776),(.m10,.s7,5699868278390782),(.m8,.s2,5699868278390777)], + .m .m9, + .b 0 [[([22799473113563126,11399736556781565,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,5699868278390782), + (.D17,12085831812513742)]), + ([2849934139195390],[(.D16,16110044370173962), + (.D6,22393753322913336), + (.D16,13778804841382000), + (.D6,1294056466415158), + (.D16,834787023519856), + (.D6,74281459383862), + (.D16,50524921528432), + (.D6,4230274350646), + (.D16,3054728380528), + (.D6,238622342710), + (.D16,184478072944), + (.D6,13303283254), + (.D16,11127226480), + (.D6,730791478), + (.D16,670285936), + (.D6,2156531254), + (.D16,619902064), + (.D6,26786614), + (.D16,37171120), + (.D6,1280518), + (.D16,2224996), + (.D6,1225147190), + (.D12,7227), + (.D16,9973), + (.D16,440), + (.D6,5)])]], + .ms [(.m2,.s6,22799473113563125),(.m14,.s5,22799473113563119)], + .m .m5, + .b 22799473113563125 [[([5],[(.D18,1),(.D15,10660864742916045),(.D14,15753802602774538)])]], + .ms [(.m2,.s6,22799473113563128),(.m7,.s5,22799473113563122)], + .m .m5, + .b 22799473113563128 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,22799473113563129),(.m15,.s5,22799473113563123)], + .m .m5, + .b 22799473113563129 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,22799473113563130),(.m25,.s2,22799473113563125)], + .m .m18, + .b 22799473113563130 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,22799473113563132),(.m14,.s5,22799473113563126)], + .m .m5, + .b 22799473113563132 [[([5],[(.D18,1),(.D17,10660864742916044),(.D15,15753802602774538),(.D17,22304692881063480),(.D15,13756539730919536),(.D17,1288490188799542),(.D15,833395454115952),(.D17,73933567032886),(.D15,50437948440688),(.D17,4208531078710),(.D15,3049292562544),(.D17,237263388214),(.D15,184138334320),(.D17,13218348598),(.D15,11105992816),(.D17,725483062),(.D15,668958832),(.D17,2156199478),(.D15,619819120),(.D17,26765878),(.D15,37165936),(.D17,1279222),(.D15,2224672),(.D17,1225147109),(.D17,7208),(.D8,9967)])]], + .ms [(.m2,.s6,22799473113563135),(.m7,.s5,22799473113563129)], + .m .m5, + .b 22799473113563135 [[([15621861207441405],[(.D8,10660864742916044),(.D16,15753802602774538),(.D6,22304692881063480),(.D16,13756539730919536),(.D6,1288490188799542),(.D16,833395454115952),(.D6,73933567032886),(.D16,50437948440688),(.D6,4208531078710),(.D16,3049292562544),(.D6,237263388214),(.D16,184138334320),(.D6,13218348598),(.D16,11105992816),(.D6,725483062),(.D16,668958832),(.D6,2156199478),(.D16,619819120),(.D6,26765878),(.D16,37165936),(.D6,1279222),(.D16,2224672),(.D6,1225147109),(.D6,7209),(.D9,9967),(.D14,438),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,30610403717283838,8708132091985870),(.m0,15265619440041994,22182647090380344),(.m0,13726028283248752,1280862326881846)], + .m .m0, + ] (by decide +kernel) +theorem chunk_17_step : (cfg_17.denote) [qi]⊢* (cfg_18.denote) := + step_chunk [ + .s2 .s6 .s7 [(831488488636528,73456825663030)], + .ms2 .s6 .s7 [(.m0,50318763098224,4178734743094),(.m0,3041843478640,235401117238),(.m0,183672766576,13101956662),(.m0,11076894832,718208566),(.m0,667140208,2155744822),(.m0,619705456,26737462),(.m0,37158832,1277446),(.m0,2224228,1225146998)], + .ms [(.m12,.s7,7179),(.m0,.s6,9961),(.m3,.s6,437),(.m21,.s3,437),(.m4,.s3,9961),(.m4,.s3,7179)], + .ms2 .s3 .s0 [(.m13,1225146998,2224228),(.m1,1277446,37158832),(.m1,26737462,619705456),(.m1,2155744822,667140208),(.m1,718208566,11076894832),(.m1,13101956662,183672766576),(.m1,235401117238,3041843478640),(.m1,4178734743094,50318763098224),(.m1,73456825663030,831488488636528),(.m1,1280862326881846,13726028283248752),(.m1,22182647090380344,15265619440041994),(.m1,8708132091985870,30610403717283833)], + .ms [(.m26,.s7,30610403717283838),(.m8,.s2,30610403717283833)], + .m .m9, + .b 0 [[([62487444829765628],[(.D7,30610403717283838),(.D7,8708132091985869),(.D16,15265619440041994),(.D6,22182647090380344),(.D16,13726028283248752),(.D6,1280862326881846),(.D16,831488488636528),(.D6,73456825663030),(.D16,50318763098224),(.D6,4178734743094),(.D16,3041843478640),(.D6,235401117238),(.D16,183672766576),(.D6,13101956662),(.D16,11076894832),(.D6,718208566),(.D16,667140208),(.D6,2155744822),(.D16,619705456),(.D6,26737462),(.D16,37158832),(.D6,1277446),(.D16,2224228),(.D6,1225146998),(.D12,7179),(.D16,9961),(.D16,437),(.D12,3)])]], + .ms [(.m2,.s6,31243722414882814)], + .ms2 .s6 .s7 [(.m3,22799473113563134,6755399441055694),(.m0,14777436277309450,22060601299697208),(.m0,13695516835577968,1273234464964150),(.m0,829581523157104,72980084293174),(.m0,50199577755760,4148938407478),(.m0,3034394394736,233538846262),(.m0,183207198832,12985564726),(.m0,11047796848,710934070),(.m0,665321584,2155290166),(.m0,619591792,26709046),(.m0,37151728,1275670),(.m0,2223784,1225146887)], + .ms [(.m3,.s6,7153)], + .ms2 .s6 .s7 [(.m6,9953,436)], + .ms2 .s3 .s0 [(.m19,436,9953)], + .ms [(.m17,.s0,7153)], + .ms2 .s3 .s0 [(.m4,1225146887,2223784),(.m1,1275670,37151728),(.m1,26709046,619591792),(.m1,2155290166,665321584),(.m1,710934070,11047796848),(.m1,12985564726,183207198832),(.m1,233538846262,3034394394736),(.m1,4148938407478,50199577755760),(.m1,72980084293174,829581523157104),(.m1,1273234464964150,13695516835577968),(.m1,22060601299697208,14777436277309450),(.m1,6755399441055694,22799473113563134)], + .ms [(.m1,.s3,31243722414882808),(.m10,.s7,31243722414882814),(.m8,.s2,31243722414882809)], + .m .m9, + .b 0 [[([124974889659531254,57420895248973830],[(.D7,31243722414882814),(.D17,22799473113563134)]),([11399736556781567],[(.D6,6755399441055694),(.D16,14777436277309450),(.D6,22060601299697208),(.D16,13695516835577968),(.D6,1273234464964150),(.D16,829581523157104),(.D6,72980084293174),(.D16,50199577755760),(.D6,4148938407478),(.D16,3034394394736),(.D6,233538846262),(.D16,183207198832),(.D6,12985564726),(.D16,11047796848),(.D6,710934070),(.D16,665321584),(.D6,2155290166),(.D16,619591792),(.D6,26709046),(.D16,37151728),(.D6,1275670),(.D16,2223784),(.D6,1225146887),(.D6,7153),(.D12,9953),(.D6,436),(.D16,4)])]], + .ms [(.m2,.s6,91197892454252542),(.m3,.s6,8444249301319678)], + .ms2 .s6 .s7 [(.m3,17099604835172350,5330432371457998),(.m0,14421194509910026,21971540857847352),(.m0,13673251725115504,1267668187348534),(.m0,828189953753200,72632191942198),(.m0,50112604668016,4127195135542),(.m0,3028958576752,232179891766),(.m0,182867460208,12900630070),(.m0,11026563184,705625654),(.m0,663994480,2154958390),(.m0,619508848,26688310),(.m0,37146544,1274374),(.m0,2223460,1225146806)], + .ms [(.m12,.s7,7131),(.m0,.s6,9949),(.m3,.s6,434),(.m20,.s0,434),(.m1,.s3,9949),(.m4,.s3,7131)], + .ms2 .s3 .s0 [(.m13,1225146806,2223460),(.m1,1274374,37146544),(.m1,26688310,619508848),(.m1,2154958390,663994480),(.m1,705625654,11026563184),(.m1,12900630070,182867460208),(.m1,232179891766,3028958576752),(.m1,4127195135542,50112604668016),(.m1,72632191942198,828189953753200),(.m1,1267668187348534,13673251725115504),(.m1,21971540857847352,14421194509910026),(.m1,5330432371457998,17099604835172350)], + .ms [(.m1,.s3,8444249301319678),(.m4,.s3,91197892454252536),(.m10,.s7,91197892454252542),(.m8,.s2,91197892454252537)], + .m .m9, + .b 0 [[([270215977642229684],[(.D7,91197892454252542)]), + ([33776997205278710,16888498602639359,8444249301319680,4222124650659840,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,8444249301319678), + (.D16,17099604835172350)]), + ([4222124650659838],[(.D6,5330432371457998), + (.D16,14421194509910026), + (.D6,21971540857847352), + (.D16,13673251725115504), + (.D6,1267668187348534), + (.D16,828189953753200), + (.D6,72632191942198), + (.D16,50112604668016), + (.D6,4127195135542), + (.D16,3028958576752), + (.D6,232179891766), + (.D16,182867460208), + (.D6,12900630070), + (.D16,11026563184), + (.D6,705625654), + (.D16,663994480), + (.D6,2154958390), + (.D16,619508848), + (.D6,26688310), + (.D16,37146544), + (.D6,1274374), + (.D16,2223460), + (.D6,1225146806), + (.D12,7131), + (.D16,9949), + (.D16,434), + (.D6,5)])]], + .ms [(.m2,.s6,135107988821114842),(.m3,.s6,57420895248973831),(.m14,.s5,57420895248973831),(.m4,.s5,135107988821114836)], + .m .m5, + .b 135107988821114842 [[([23],[(.D16,57420895248973831),(.D18,1),(.D15,14988542509842429),(.D16,4802666790125518)])]], + .ms [(.m2,.s6,135107988821114854),(.m3,.s6,57420895248973828),(.m7,.s5,57420895248973828),(.m4,.s5,135107988821114848)], + .m .m5, + .b 135107988821114854 [[([7],[(.D16,57420895248973828),(.D6,1)])]], + .ms [(.m2,.s6,135107988821114858),(.m6,.s6,57420895248973826),(.m15,.s5,57420895248973826),(.m11,.s5,135107988821114852)], + .m .m5, + .b 135107988821114858 [[([5],[(.D12,57420895248973826),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,135107988821114861,57420895248973827)], + .ms [(.m23,.s1,57420895248973827),(.m22,.s4,135107988821114855)], + .m .m24, + .b 135107988821114861 [[([17],[(.D6,57420895248973827),(.D6,2)])]], + .ms [(.m2,.s6,135107988821114870),(.m6,.s6,57420895248973823),(.m14,.s5,57420895248973823),(.m11,.s5,135107988821114864)], + .m .m5, + .b 135107988821114870 [[([23],[(.D12,57420895248973823),(.D18,1),(.D17,14988542509842428),(.D17,4802666790125518),(.D15,14289253114576906),(.D17,21938555509014072),(.D15,13665005387907184),(.D17,1265606603046454),(.D15,827674557677680),(.D17,72503342923318),(.D15,50080392413296),(.D17,4119142071862),(.D15,3026945310832),(.D17,231676575286),(.D15,182741631088),(.D17,12869172790),(.D15,11018698864),(.D17,703659574),(.D15,663502960),(.D17,2154835510),(.D15,619478128),(.D17,26680630),(.D15,37144624),(.D17,1273894),(.D15,2223340),(.D17,1225146776),(.D11,7123),(.D6,9948)])]], + .ms [(.m2,.s6,135107988821114882),(.m6,.s6,57420895248973820),(.m7,.s5,57420895248973820),(.m11,.s5,135107988821114876)], + .m .m5, + .b 135107988821114882 [[([229683580995895281,114841790497947645,20266198323167241],[(.D12,57420895248973820),(.D8,14988542509842428),(.D6,4802666790125518),(.D16,14289253114576906)]),([1424967069597695],[(.D6,21938555509014072),(.D16,13665005387907184),(.D6,1265606603046454),(.D16,827674557677680),(.D6,72503342923318),(.D16,50080392413296),(.D6,4119142071862),(.D16,3026945310832),(.D6,231676575286),(.D16,182741631088),(.D6,12869172790),(.D16,11018698864),(.D6,703659574),(.D16,663502960),(.D6,2154835510),(.D16,619478128),(.D6,26680630),(.D16,37144624),(.D6,1273894),(.D16,2223340),(.D6,1225146776),(.D12,7124),(.D7,9947),(.D8,433),(.D7,4)])]], + .ms [(.m2,.s6,317503773729619966)], + .ms2 .s6 .s7 [(.m3,11821949021847550,3588805953060862)], + .ms [(.m3,.s6,1952732650930126)], + .ms2 .s6 .s7 [(.m3,13576769579778058,21760434625314360),(.m0,13620475166982256,1254474047815222),(.m0,824891418869872,71807558221366),(.m0,49906446237808,4075655527990),(.m0,3016073674864,228958666294),(.m0,182062153840,12699303478),(.m0,10976231536,693042742),(.m0,660848752,2154171958),(.m0,619312240,26639158),(.m0,37134256,1271302),(.m0,2222692,1225146614)], + .ms [(.m12,.s7,7083),(.m0,.s6,9937),(.m3,.s6,431),(.m21,.s3,431),(.m4,.s3,9937),(.m4,.s3,7083)], + .ms2 .s3 .s0 [(.m13,1225146614,2222692),(.m1,1271302,37134256),(.m1,26639158,619312240),(.m1,2154171958,660848752),(.m1,693042742,10976231536),(.m1,12699303478,182062153840),(.m1,228958666294,3016073674864),(.m1,4075655527990,49906446237808),(.m1,71807558221366,824891418869872),(.m1,1254474047815222,13620475166982256),(.m1,21760434625314360,13576769579778058),(.m1,1952732650930126,3588805953060862)], + .ms [(.m4,.s3,11821949021847550),(.m4,.s3,317503773729619960),(.m10,.s7,317503773729619966),(.m8,.s2,317503773729619961)], + .m .m9, + .b 0 [[([378302368699121588],[(.D7,317503773729619966)]), + ([47287796087390198,23643898043695103,11821949021847552,5910974510923776,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,11821949021847550), + (.D6,3588805953060862), + (.D6,1952732650930126)]), + ([1477743627730943],[(.D16,13576769579778058), + (.D6,21760434625314360), + (.D16,13620475166982256), + (.D6,1254474047815222), + (.D16,824891418869872), + (.D6,71807558221366), + (.D16,49906446237808), + (.D6,4075655527990), + (.D16,3016073674864), + (.D6,228958666294), + (.D16,182062153840), + (.D6,12699303478), + (.D16,10976231536), + (.D6,693042742), + (.D16,660848752), + (.D6,2154171958), + (.D16,619312240), + (.D6,26639158), + (.D16,37134256), + (.D6,1271302), + (.D16,2222692), + (.D6,1225146614), + (.D12,7083), + (.D16,9937), + (.D16,431), + (.D12,3)])], + [([8],[(.D15,270215977642229767), + (.D21,0), + (.D19,633318697598973)])]], + .ms [(.m2,.s6,189151184349560798),(.m6,.s6,270215977642229765),(.m7,.s5,270215977642229765),(.m11,.s5,189151184349560792)], + .m .m5, + .b 189151184349560798 [[([41],[(.D12,270215977642229765),(.D8,1),(.D7,633318697598972)])],[([15199648742375302],[(.D17,270215977642229761),(.D2,633318697598970)])]], + .ms [(.m2,.s6,196751008720748470),(.m3,.s6,268316021549432848),(.m27,.s2,268316021549432848),(.m1,.s5,196751008720748464)], + .m .m5, + .b 196751008720748470 [[([7],[(.D16,268316021549432848), + (.D6,1)])], + [([16],[(.D11,268316021549432846), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,268316021549432845), + (.D17,1), + (.D15,0), + (.D6,1213860837064654)])], + [([16],[(.D11,268316021549432843), + (.D3,0)])], + [([8],[(.D15,268316021549432842), + (.D17,1), + (.D21,1213860837064653), + (.D15,13392051626311690), + (.D17,21714255136947768), + (.D15,13608930294890608), + (.D17,1251587829792310), + (.D15,824169864364144), + (.D17,71627169594934), + (.D15,49861349081200), + (.D17,4064381238838), + (.D15,3013255102576), + (.D17,228254023222), + (.D15,181885993072), + (.D17,12655263286), + (.D15,10965221488), + (.D17,690290230), + (.D15,660160624), + (.D17,2153999926), + (.D15,619269232), + (.D17,26628406), + (.D15,37131568), + (.D17,1270630), + (.D15,2222524), + (.D17,1225146572), + (.D11,7072), + (.D12,9934)])], + [([18],[(.D11,268316021549432840), + (.D13,0), + (.D16,1213860837064653), + (.D16,13392051626311690)])], + [([38843546786068932],[(.D17,268316021549432839)]), + ([4855443348258619,2427721674129311,1213860837064656,606930418532328,303465209266164,151732604633079,75866302316541,37933151158272,18966575579136,9483287789568,4741643894784,2370821947392,1185410973696,592705486848,296352743424,148176371712,74088185856,37044092928,18522046464,9261023232,4630511616,2315255808,1157627904,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,1213860837064654), + (.D17,13392051626311690)]), + ([606930418532327],[(.D6,21714255136947768), + (.D16,13608930294890608), + (.D6,1251587829792310), + (.D16,824169864364144), + (.D6,71627169594934), + (.D16,49861349081200), + (.D6,4064381238838), + (.D16,3013255102576), + (.D6,228254023222), + (.D16,181885993072), + (.D6,12655263286), + (.D16,10965221488), + (.D6,690290230), + (.D16,660160624), + (.D6,2153999926), + (.D16,619269232), + (.D6,26628406), + (.D16,37131568), + (.D6,1270630), + (.D16,2222524), + (.D6,1225146572), + (.D12,7073), + (.D13,9934), + (.D9,430), + (.D13,3)])], + [([10],[(.D17,263460578201174223), + (.D21,0), + (.D19,13088586417045526)])]], + .ms [(.m2,.s6,216172782113782978),(.m3,.s6,263460578201174221),(.m7,.s5,263460578201174221),(.m4,.s5,216172782113782972)], + .m .m5, + .b 216172782113782978 [[([43],[(.D16,263460578201174221),(.D8,1),(.D7,13088586417045525)])],[([314126074009092570],[(.D11,263460578201174214),(.D2,13088586417045523)])]], + .ms2 .s6 .s7 [(.m2,373235819118329285,224194818950037645)], + .ms [(.m29,.s2,224194818950037645),(.m4,.s5,373235819118329279)], + .m .m5, + .b 373235819118329285 [[([9],[(.D6,224194818950037645),(.D6,1)])],[([20],[(.D15,224194818950037643),(.D13,0),(.D10,21638388834631226),(.D9,13589963719311472)])],[([36],[(.D11,224194818950037639)]),([7,2],[(.D12,1),(.D6,21638388834631226)])]], + .ms [(.m2,.s6,373235819118329318),(.m6,.s6,224194818950037635),(.m15,.s5,224194818950037635),(.m11,.s5,373235819118329312)], + .m .m5, + .b 373235819118329318 [[([5],[(.D12,224194818950037635),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,373235819118329321,224194818950037636)], + .ms [(.m23,.s1,224194818950037636),(.m22,.s4,373235819118329315)], + .m .m24, + .b 373235819118329321 [[([17],[(.D6,224194818950037636),(.D6,2)])],[([6],[(.D11,224194818950037632),(.D21,0),(.D7,21638388834631224)])]], + .ms2 .s6 .s7 [(.m2,373235819118329333,224194818950037633)], + .ms2 .s5 .s2 [(.m28,224194818950037633,373235819118329328)], + .m .m18, + .b 373235819118329333 [[([45],[(.D6,224194818950037633),(.D8,1),(.D17,21638388834631223),(.D10,13589963719311471)])],[([36],[(.D15,224194818950037626)]),([7,2],[(.D12,1),(.D17,21638388834631222)]),([1],[(.D11,13589963719311471),(.D16,1246846185897526)])],[([8],[(.D15,224194818950037622),(.D21,0),(.D17,21638388834631221),(.D12,13589963719311472)])]], + .ms [(.m2,.s6,373235819118329378),(.m6,.s6,224194818950037620),(.m7,.s5,224194818950037620),(.m11,.s5,373235819118329372)], + .m .m5, + .b 373235819118329378 [[([39],[(.D12,224194818950037620),(.D8,21638388834631222),(.D13,13589963719311472),(.D17,1246846185897526),(.D15,822984453390448),(.D17,71330816851510),(.D15,49787260895344),(.D17,4045859192374),(.D15,3008624590960),(.D17,227096395318),(.D15,181596586096),(.D17,12582911542),(.D15,10947133552),(.D17,685768246),(.D15,659030128),(.D17,2153717302),(.D15,619198576),(.D17,26610742),(.D15,37127152),(.D17,1269526),(.D15,2222248),(.D17,1225146503),(.D17,7057),(.D11,9929),(.D17,430),(.D15,3)])]], + .ms [(.m2,.s6,373235819118329398)], + .ms2 .s6 .s7 [(.m3,224194818950037616,21638388834631222),(.m0,13589963719311472,1246846185897526),(.m0,822984453390448,71330816851510),(.m0,49787260895344,4045859192374),(.m0,3008624590960,227096395318),(.m0,181596586096,12582911542),(.m0,10947133552,685768246),(.m0,659030128,2153717302),(.m0,619198576,26610742),(.m0,37127152,1269526),(.m0,2222248,1225146503)], + .ms [(.m3,.s6,7057)], + .ms2 .s6 .s7 [(.m6,9929,430)], + .ms2 .s3 .s0 [(.m19,430,9929)], + .ms [(.m17,.s0,7057)], + .ms2 .s3 .s0 [(.m4,1225146503,2222248),(.m1,1269526,37127152),(.m1,26610742,619198576),(.m1,2153717302,659030128),(.m1,685768246,10947133552),(.m1,12582911542,181596586096),(.m1,227096395318,3008624590960),(.m1,4045859192374,49787260895344),(.m1,71330816851510,822984453390448),(.m1,1246846185897526,13589963719311472),(.m1,21638388834631222,224194818950037616)], + .ms [(.m1,.s3,373235819118329392),(.m10,.s7,373235819118329398),(.m8,.s2,373235819118329393)], + .m .m9, + .b 0 [[([11399736556781564],[(.D7,373235819118329398),(.D17,224194818950037616),(.D6,21638388834631222),(.D16,13589963719311472),(.D6,1246846185897526),(.D16,822984453390448),(.D6,71330816851510),(.D16,49787260895344),(.D6,4045859192374),(.D16,3008624590960),(.D6,227096395318),(.D16,181596586096),(.D6,12582911542),(.D16,10947133552),(.D6,685768246),(.D16,659030128),(.D6,2153717302),(.D16,619198576),(.D6,26610742),(.D16,37127152),(.D6,1269526),(.D16,2222248),(.D6,1225146503),(.D6,7057),(.D12,9929),(.D6,430),(.D16,4)])]], + .ms [(.m2,.s6,5699868278390782),(.m3,.s6,371810852048731702)], + .ms2 .s6 .s7 [(.m3,223838577182638192,21549328392781366),(.m0,13567698608849008,1241279908281910),(.m0,821592883986544,70982924500534),(.m0,49700287807600,4024115920438),(.m0,3003188772976,225737440822),(.m0,181256847472,12497976886),(.m0,10925899888,680459830),(.m0,657703024,2153385526),(.m0,619115632,26590006),(.m0,37121968,1268230),(.m0,2221924,1225146422)], + .ms [(.m12,.s7,7035),(.m0,.s6,9925),(.m3,.s6,428),(.m20,.s0,428),(.m1,.s3,9925),(.m4,.s3,7035)], + .ms2 .s3 .s0 [(.m13,1225146422,2221924),(.m1,1268230,37121968),(.m1,26590006,619115632),(.m1,2153385526,657703024),(.m1,680459830,10925899888),(.m1,12497976886,181256847472),(.m1,225737440822,3003188772976),(.m1,4024115920438,49700287807600),(.m1,70982924500534,821592883986544),(.m1,1241279908281910,13567698608849008),(.m1,21549328392781366,223838577182638192)], + .ms [(.m1,.s3,371810852048731702),(.m4,.s3,5699868278390776),(.m10,.s7,5699868278390782),(.m8,.s2,5699868278390777)], + .m .m9, + .b 0 [[([22799473113563126,11399736556781565,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,5699868278390782), + (.D17,371810852048731702)]), + ([2849934139195390],[(.D16,223838577182638192), + (.D6,21549328392781366), + (.D16,13567698608849008), + (.D6,1241279908281910), + (.D16,821592883986544), + (.D6,70982924500534), + (.D16,49700287807600), + (.D6,4024115920438), + (.D16,3003188772976), + (.D6,225737440822), + (.D16,181256847472), + (.D6,12497976886), + (.D16,10925899888), + (.D6,680459830), + (.D16,657703024), + (.D6,2153385526), + (.D16,619115632), + (.D6,26590006), + (.D16,37121968), + (.D6,1268230), + (.D16,2221924), + (.D6,1225146422), + (.D12,7035), + (.D16,9925), + (.D16,428), + (.D6,5)])]], + .ms [(.m2,.s6,22799473113563125),(.m14,.s5,22799473113563119)], + .m .m5, + .b 22799473113563125 [[([5],[(.D18,1),(.D15,370385884979134005),(.D14,223482335415238768)])]], + .ms [(.m2,.s6,22799473113563128),(.m7,.s5,22799473113563122)], + .m .m5, + .b 22799473113563128 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,22799473113563129),(.m15,.s5,22799473113563123)], + .m .m5, + .b 22799473113563129 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,22799473113563130),(.m25,.s2,22799473113563125)], + .m .m18, + .b 22799473113563130 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,22799473113563132),(.m14,.s5,22799473113563126)], + .m .m5, + .b 22799473113563132 [[([5],[(.D18,1),(.D17,370385884979134004),(.D15,223482335415238768),(.D17,21460267950931510),(.D15,13545433498386544),(.D17,1235713630666294),(.D15,820201314582640),(.D17,70635032149558),(.D15,49613314719856),(.D17,4002372648502),(.D15,2997752954992),(.D17,224378486326),(.D15,180917108848),(.D17,12413042230),(.D15,10904666224),(.D17,675151414),(.D15,656375920),(.D17,2153053750),(.D15,619032688),(.D17,26569270),(.D15,37116784),(.D17,1266934),(.D15,2221600),(.D17,1225146341),(.D17,7016),(.D8,9919)])]], + .ms [(.m2,.s6,22799473113563135),(.m7,.s5,22799473113563129)], + .m .m5, + .b 22799473113563135 [[([15621861207441405],[(.D8,370385884979134004),(.D16,223482335415238768),(.D6,21460267950931510),(.D16,13545433498386544),(.D6,1235713630666294),(.D16,820201314582640),(.D6,70635032149558),(.D16,49613314719856),(.D6,4002372648502),(.D16,2997752954992),(.D6,224378486326),(.D16,180917108848),(.D6,12413042230),(.D16,10904666224),(.D6,675151414),(.D16,656375920),(.D6,2153053750),(.D16,619032688),(.D6,26569270),(.D16,37116784),(.D6,1266934),(.D16,2221600),(.D6,1225146341),(.D6,7017),(.D9,9919),(.D14,426),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,30610403717283838,368433152328203830),(.m0,222994152252506224,21338222160248374),(.m0,13514922050715760,1228085768748598),(.m0,818294349103216,70158290779702),(.m0,49494129377392,3972576312886),(.m0,2990303871088,222516215350),(.m0,180451541104,12296650294),(.m0,10875568240,667876918),(.m0,654557296,2152599094),(.m0,618919024,26540854),(.m0,37109680,1265158),(.m0,2221156,1225146230)], + .ms [(.m12,.s7,6987),(.m0,.s6,9913),(.m3,.s6,425),(.m21,.s3,425),(.m4,.s3,9913),(.m4,.s3,6987)], + .ms2 .s3 .s0 [(.m13,1225146230,2221156),(.m1,1265158,37109680),(.m1,26540854,618919024),(.m1,2152599094,654557296),(.m1,667876918,10875568240),(.m1,12296650294,180451541104),(.m1,222516215350,2990303871088),(.m1,3972576312886,49494129377392),(.m1,70158290779702,818294349103216),(.m1,1228085768748598,13514922050715760),(.m1,21338222160248374,222994152252506224),(.m1,368433152328203830,30610403717283833)], + .ms [(.m26,.s7,30610403717283838),(.m8,.s2,30610403717283833)], + .m .m9, + .b 0 [[([62487444829765628],[(.D7,30610403717283838),(.D7,368433152328203829),(.D16,222994152252506224),(.D6,21338222160248374),(.D16,13514922050715760),(.D6,1228085768748598),(.D16,818294349103216),(.D6,70158290779702),(.D16,49494129377392),(.D6,3972576312886),(.D16,2990303871088),(.D6,222516215350),(.D16,180451541104),(.D6,12296650294),(.D16,10875568240),(.D6,667876918),(.D16,654557296),(.D6,2152599094),(.D16,618919024),(.D6,26540854),(.D16,37109680),(.D6,1265158),(.D16,2221156),(.D6,1225146230),(.D12,6987),(.D16,9913),(.D16,425),(.D12,3)])]], + .ms [(.m2,.s6,31243722414882814)], + .ms2 .s6 .s7 [(.m3,22799473113563134,366480419677273654),(.m0,222505969089773680,21216176369565238),(.m0,13484410603044976,1220457906830902),(.m0,816387383623792,69681549409846),(.m0,49374944034928,3942779977270),(.m0,2982854787184,220653944374),(.m0,179985973360,12180258358),(.m0,10846470256,660602422),(.m0,652738672,2152144438),(.m0,618805360,26512438),(.m0,37102576,1263382),(.m0,2220712,1225146119)], + .ms [(.m3,.s6,6961)], + .ms2 .s6 .s7 [(.m6,9905,424)], + .ms2 .s3 .s0 [(.m19,424,9905)], + .ms [(.m17,.s0,6961)], + .ms2 .s3 .s0 [(.m4,1225146119,2220712),(.m1,1263382,37102576),(.m1,26512438,618805360),(.m1,2152144438,652738672),(.m1,660602422,10846470256),(.m1,12180258358,179985973360),(.m1,220653944374,2982854787184),(.m1,3942779977270,49374944034928),(.m1,69681549409846,816387383623792),(.m1,1220457906830902,13484410603044976),(.m1,21216176369565238,222505969089773680),(.m1,366480419677273654,22799473113563134)], + .ms [(.m1,.s3,31243722414882808),(.m10,.s7,31243722414882814),(.m8,.s2,31243722414882809)], + .m .m9, + .b 0 [[([124974889659531254,57420895248973830],[(.D7,31243722414882814),(.D17,22799473113563134)]),([11399736556781567],[(.D6,366480419677273654),(.D16,222505969089773680),(.D6,21216176369565238),(.D16,13484410603044976),(.D6,1220457906830902),(.D16,816387383623792),(.D6,69681549409846),(.D16,49374944034928),(.D6,3942779977270),(.D16,2982854787184),(.D6,220653944374),(.D16,179985973360),(.D6,12180258358),(.D16,10846470256),(.D6,660602422),(.D16,652738672),(.D6,2152144438),(.D16,618805360),(.D6,26512438),(.D16,37102576),(.D6,1263382),(.D16,2220712),(.D6,1225146119),(.D6,6961),(.D12,9905),(.D6,424),(.D16,4)])]], + .ms [(.m2,.s6,91197892454252542),(.m3,.s6,8444249301319678)], + .ms2 .s6 .s7 [(.m3,17099604835172350,365055452607675958),(.m0,222149727322374256,21127115927715382),(.m0,13462145492582512,1214891629215286),(.m0,814995814219888,69333657058870),(.m0,49287970947184,3921036705334),(.m0,2977418969200,219294989878),(.m0,179646234736,12095323702),(.m0,10825236592,655294006),(.m0,651411568,2151812662),(.m0,618722416,26491702),(.m0,37097392,1262086),(.m0,2220388,1225146038)], + .ms [(.m12,.s7,6939),(.m0,.s6,9901),(.m3,.s6,422),(.m20,.s0,422),(.m1,.s3,9901),(.m4,.s3,6939)], + .ms2 .s3 .s0 [(.m13,1225146038,2220388),(.m1,1262086,37097392),(.m1,26491702,618722416),(.m1,2151812662,651411568),(.m1,655294006,10825236592),(.m1,12095323702,179646234736),(.m1,219294989878,2977418969200),(.m1,3921036705334,49287970947184),(.m1,69333657058870,814995814219888),(.m1,1214891629215286,13462145492582512),(.m1,21127115927715382,222149727322374256),(.m1,365055452607675958,17099604835172350)], + .ms [(.m1,.s3,8444249301319678),(.m4,.s3,91197892454252536),(.m10,.s7,91197892454252542),(.m8,.s2,91197892454252537)], + .m .m9, + .b 0 [[([270215977642229240],[(.D7,91197892454252542)]), + ([33776997205278710,16888498602639359,8444249301319680,4222124650659840,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120],[(.D17,8444249301319678), + (.D16,17099604835172350)]), + ([4222124650659832],[(.D6,365055452607675958), + (.D16,222149727322374256), + (.D6,21127115927715382), + (.D16,13462145492582512), + (.D6,1214891629215286), + (.D16,814995814219888), + (.D6,69333657058870), + (.D16,49287970947184), + (.D6,3921036705334), + (.D16,2977418969200), + (.D6,219294989878), + (.D16,179646234736), + (.D6,12095323702), + (.D16,10825236592), + (.D6,655294006), + (.D16,651411568), + (.D6,2151812662), + (.D16,618722416), + (.D6,26491702), + (.D16,37097392), + (.D6,1262086), + (.D16,2220388), + (.D6,1225146038), + (.D12,6939), + (.D16,9901), + (.D16,422), + (.D6,5)])]], + ] (by decide +kernel) +theorem chunk_18_step : (cfg_18.denote) [qi]⊢* (cfg_19.denote) := + step_chunk [ + .b 135107988821114620 [[([444],[(.D15,57420895248973886)]),([60,27,12,9,3],[(.D6,15),(.D8,14988542509842433)]),([6],[(.D10,364527687026343477),(.D13,222017785927041136)])]], + .ms [(.m2,.s6,135107988821114842),(.m3,.s6,57420895248973831),(.m14,.s5,57420895248973831),(.m4,.s5,135107988821114836)], + .m .m5, + .b 135107988821114842 [[([23],[(.D16,57420895248973831),(.D18,1),(.D15,14988542509842429),(.D16,364527687026343478)])]], + .ms [(.m2,.s6,135107988821114854),(.m3,.s6,57420895248973828),(.m7,.s5,57420895248973828),(.m4,.s5,135107988821114848)], + .m .m5, + .b 135107988821114854 [[([7],[(.D16,57420895248973828),(.D6,1)])]], + .ms [(.m2,.s6,135107988821114858),(.m6,.s6,57420895248973826),(.m15,.s5,57420895248973826),(.m11,.s5,135107988821114852)], + .m .m5, + .b 135107988821114858 [[([5],[(.D12,57420895248973826),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,135107988821114861,57420895248973827)], + .ms [(.m23,.s1,57420895248973827),(.m22,.s4,135107988821114855)], + .m .m24, + .b 135107988821114861 [[([17],[(.D6,57420895248973827),(.D6,2)])]], + .ms [(.m2,.s6,135107988821114870),(.m6,.s6,57420895248973823),(.m14,.s5,57420895248973823),(.m11,.s5,135107988821114864)], + .m .m5, + .b 135107988821114870 [[([23],[(.D12,57420895248973823),(.D18,1),(.D17,14988542509842428),(.D17,364527687026343478),(.D15,222017785927041136),(.D17,21094130578882102),(.D15,13453899155374192),(.D17,1212830044913206),(.D15,814480418144368),(.D17,69204808039990),(.D15,49255758692464),(.D17,3912983641654),(.D15,2975405703280),(.D17,218791673398),(.D15,179520405616),(.D17,12063866422),(.D15,10817372272),(.D17,653327926),(.D15,650920048),(.D17,2151689782),(.D15,618691696),(.D17,26484022),(.D15,37095472),(.D17,1261606),(.D15,2220268),(.D17,1225146008),(.D11,6931),(.D6,9900)])]], + .ms [(.m2,.s6,135107988821114882),(.m6,.s6,57420895248973820),(.m7,.s5,57420895248973820),(.m11,.s5,135107988821114876)], + .m .m5, + .b 135107988821114882 [[([229683580995895281,114841790497947645,20266198323167241],[(.D12,57420895248973820),(.D8,14988542509842428),(.D6,364527687026343478)]),([5699868278390783],[(.D16,222017785927041136),(.D6,21094130578882102),(.D16,13453899155374192),(.D6,1212830044913206),(.D16,814480418144368),(.D6,69204808039990),(.D16,49255758692464),(.D6,3912983641654),(.D16,2975405703280),(.D6,218791673398),(.D16,179520405616),(.D6,12063866422),(.D16,10817372272),(.D6,653327926),(.D16,650920048),(.D6,2151689782),(.D16,618691696),(.D6,26484022),(.D16,37095472),(.D6,1261606),(.D16,2220268),(.D6,1225146008),(.D12,6932),(.D7,9899),(.D8,421),(.D7,4)])]], + .ms [(.m2,.s6,317503773729619966)], + .ms2 .s6 .s7 [(.m3,11821949021847550,3588805953060862)], + .ms [(.m3,.s6,361677752887148086)], + .ms2 .s6 .s7 [(.m3,221305302392242288,20916009695182390),(.m0,13409368934449264,1201697489681974),(.m0,811697279336560,68509023338038),(.m0,49081812516976,3869497097782),(.m0,2964534067312,216073764406),(.m0,178840928368,11893997110),(.m0,10774904944,642711094),(.m0,648265840,2151026230),(.m0,618525808,26442550),(.m0,37085104,1259014),(.m0,2219620,1225145846)], + .ms [(.m12,.s7,6891),(.m0,.s6,9889),(.m3,.s6,419),(.m21,.s3,419),(.m4,.s3,9889),(.m4,.s3,6891)], + .ms2 .s3 .s0 [(.m13,1225145846,2219620),(.m1,1259014,37085104),(.m1,26442550,618525808),(.m1,2151026230,648265840),(.m1,642711094,10774904944),(.m1,11893997110,178840928368),(.m1,216073764406,2964534067312),(.m1,3869497097782,49081812516976),(.m1,68509023338038,811697279336560),(.m1,1201697489681974,13409368934449264),(.m1,20916009695182390,221305302392242288),(.m1,361677752887148086,3588805953060862)], + .ms [(.m4,.s3,11821949021847550),(.m4,.s3,317503773729619960),(.m10,.s7,317503773729619966),(.m8,.s2,317503773729619961)], + .m .m9, + .b 0 [[([378302368699121588],[(.D7,317503773729619966)]), + ([47287796087390198,23643898043695103,11821949021847552,5910974510923776,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,11821949021847550), + (.D6,3588805953060862), + (.D6,361677752887148086)]), + ([1477743627730943],[(.D16,221305302392242288), + (.D6,20916009695182390), + (.D16,13409368934449264), + (.D6,1201697489681974), + (.D16,811697279336560), + (.D6,68509023338038), + (.D16,49081812516976), + (.D6,3869497097782), + (.D16,2964534067312), + (.D6,216073764406), + (.D16,178840928368), + (.D6,11893997110), + (.D16,10774904944), + (.D6,642711094), + (.D16,648265840), + (.D6,2151026230), + (.D16,618525808), + (.D6,26442550), + (.D16,37085104), + (.D6,1259014), + (.D16,2219620), + (.D6,1225145846), + (.D12,6891), + (.D16,9889), + (.D16,419), + (.D12,3)])], + [([8],[(.D15,270215977642229767), + (.D21,0), + (.D19,633318697598973)])]], + .ms [(.m2,.s6,189151184349560798),(.m6,.s6,270215977642229765),(.m7,.s5,270215977642229765),(.m11,.s5,189151184349560792)], + .m .m5, + .b 189151184349560798 [[([41],[(.D12,270215977642229765),(.D8,1),(.D7,633318697598972)])],[([15199648742375302],[(.D17,270215977642229761),(.D2,633318697598970)])]], + .ms [(.m2,.s6,196751008720748470),(.m3,.s6,268316021549432848),(.m27,.s2,268316021549432848),(.m1,.s5,196751008720748464)], + .m .m5, + .b 196751008720748470 [[([7],[(.D16,268316021549432848), + (.D6,1)])], + [([16],[(.D11,268316021549432846), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,268316021549432845), + (.D17,1), + (.D15,0), + (.D6,360938881073282614)])], + [([16],[(.D11,268316021549432843), + (.D3,0)])], + [([8],[(.D15,268316021549432842), + (.D17,1), + (.D21,360938881073282613), + (.D15,221120584438775920), + (.D17,20869830206815798), + (.D15,13397824062357616), + (.D17,1198811271659062), + (.D15,810975724830832), + (.D17,68328634711606), + (.D15,49036715360368), + (.D17,3858222808630), + (.D15,2961715495024), + (.D17,215369121334), + (.D15,178664767600), + (.D17,11849956918), + (.D15,10763894896), + (.D17,639958582), + (.D15,647577712), + (.D17,2150854198), + (.D15,618482800), + (.D17,26431798), + (.D15,37082416), + (.D17,1258342), + (.D15,2219452), + (.D17,1225145804), + (.D11,6880), + (.D12,9886)])], + [([18],[(.D11,268316021549432840), + (.D13,0), + (.D16,360938881073282613), + (.D16,221120584438775920)])], + [([38843546786070502],[(.D17,268316021549432839), + (.D12,360938881073282614), + (.D17,221120584438775920), + (.D6,20869830206815798), + (.D16,13397824062357616), + (.D6,1198811271659062), + (.D16,810975724830832), + (.D6,68328634711606), + (.D16,49036715360368), + (.D6,3858222808630), + (.D16,2961715495024), + (.D6,215369121334), + (.D16,178664767600), + (.D6,11849956918), + (.D16,10763894896), + (.D6,639958582), + (.D16,647577712), + (.D6,2150854198), + (.D16,618482800), + (.D6,26431798), + (.D16,37082416), + (.D6,1258342), + (.D16,2219452), + (.D6,1225145804), + (.D12,6881), + (.D13,9886), + (.D9,418), + (.D13,3)])]], + .ms [(.m2,.s6,216172782113783758)], + .ms2 .s6 .s7 [(.m3,263460578201174026,359725020236217912),(.m0,220817119229509744,20793963904499254),(.m0,13378857486778480,1194069627764278),(.m0,809790313857136,68032281968182),(.m0,48962627174512,3839700762166),(.m0,2957084983408,214211493430),(.m0,178375360624,11777605174),(.m0,10745806960,635436598),(.m0,646447216,2150571574),(.m0,618412144,26414134),(.m0,37078000,1257238),(.m0,2219176,1225145735)], + .ms [(.m3,.s6,6865)], + .ms2 .s6 .s7 [(.m6,9881,418)], + .ms2 .s3 .s0 [(.m19,418,9881)], + .ms [(.m17,.s0,6865)], + .ms2 .s3 .s0 [(.m4,1225145735,2219176),(.m1,1257238,37078000),(.m1,26414134,618412144),(.m1,2150571574,646447216),(.m1,635436598,10745806960),(.m1,11777605174,178375360624),(.m1,214211493430,2957084983408),(.m1,3839700762166,48962627174512),(.m1,68032281968182,809790313857136),(.m1,1194069627764278,13378857486778480),(.m1,20793963904499254,220817119229509744),(.m1,359725020236217912,263460578201174026)], + .ms [(.m1,.s3,216172782113783752),(.m10,.s7,216172782113783758),(.m8,.s2,216172782113783753)], + .m .m9, + .b 0 [[([182395784908505084],[(.D7,216172782113783758),(.D17,263460578201174026),(.D6,359725020236217912),(.D16,220817119229509744),(.D6,20793963904499254),(.D16,13378857486778480),(.D6,1194069627764278),(.D16,809790313857136),(.D6,68032281968182),(.D16,48962627174512),(.D6,3839700762166),(.D16,2957084983408),(.D6,214211493430),(.D16,178375360624),(.D6,11777605174),(.D16,10745806960),(.D6,635436598),(.D16,646447216),(.D6,2150571574),(.D16,618412144),(.D6,26414134),(.D16,37078000),(.D6,1257238),(.D16,2219176),(.D6,1225145735),(.D6,6865),(.D12,9881),(.D6,418),(.D16,4)])]], + .ms [(.m2,.s6,91197892454252542),(.m3,.s6,193373309000220622)], + .ms2 .s6 .s7 [(.m3,257760709922783242,358300053166620216),(.m0,220460877462110320,20704903462649398),(.m0,13356592376316016,1188503350148662),(.m0,808398744453232,67684389617206),(.m0,48875654086768,3817957490230),(.m0,2951649165424,212852538934),(.m0,178035622000,11692670518),(.m0,10724573296,630128182),(.m0,645120112,2150239798),(.m0,618329200,26393398),(.m0,37072816,1255942),(.m0,2218852,1225145654)], + .ms [(.m12,.s7,6843),(.m0,.s6,9877),(.m3,.s6,416),(.m20,.s0,416),(.m1,.s3,9877),(.m4,.s3,6843)], + .ms2 .s3 .s0 [(.m13,1225145654,2218852),(.m1,1255942,37072816),(.m1,26393398,618329200),(.m1,2150239798,645120112),(.m1,630128182,10724573296),(.m1,11692670518,178035622000),(.m1,212852538934,2951649165424),(.m1,3817957490230,48875654086768),(.m1,67684389617206,808398744453232),(.m1,1188503350148662,13356592376316016),(.m1,20704903462649398,220460877462110320),(.m1,358300053166620216,257760709922783242)], + .ms [(.m1,.s3,193373309000220622),(.m4,.s3,91197892454252536),(.m10,.s7,91197892454252542),(.m8,.s2,91197892454252537)], + .m .m9, + .b 0 [[([364791569817010166,182395784908505085,91197892454252544,45598946227126272,22799473113563136,11399736556781568,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,91197892454252542), + (.D17,193373309000220622)]), + ([45598946227126270],[(.D16,257760709922783242), + (.D6,358300053166620216), + (.D16,220460877462110320), + (.D6,20704903462649398), + (.D16,13356592376316016), + (.D6,1188503350148662), + (.D16,808398744453232), + (.D6,67684389617206), + (.D16,48875654086768), + (.D6,3817957490230), + (.D16,2951649165424), + (.D6,212852538934), + (.D16,178035622000), + (.D6,11692670518), + (.D16,10724573296), + (.D6,630128182), + (.D16,645120112), + (.D6,2150239798), + (.D16,618329200), + (.D6,26393398), + (.D16,37072816), + (.D6,1255942), + (.D16,2218852), + (.D6,1225145654), + (.D12,6843), + (.D16,9877), + (.D16,416), + (.D6,5)])]], + .ms [(.m2,.s6,364791569817010165),(.m14,.s5,364791569817010159)], + .m .m5, + .b 364791569817010165 [[([5],[(.D18,1),(.D15,170573835886657485),(.D14,252060841644392458)])]], + .ms [(.m2,.s6,364791569817010168),(.m7,.s5,364791569817010162)], + .m .m5, + .b 364791569817010168 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,364791569817010169),(.m15,.s5,364791569817010163)], + .m .m5, + .b 364791569817010169 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,364791569817010170),(.m25,.s2,364791569817010165)], + .m .m18, + .b 364791569817010170 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,364791569817010172),(.m14,.s5,364791569817010166)], + .m .m5, + .b 364791569817010172 [[([5],[(.D18,1),(.D17,170573835886657484),(.D15,252060841644392458),(.D17,356875086097022520),(.D15,220104635694710896),(.D17,20615843020799542),(.D15,13334327265853552),(.D17,1182937072533046),(.D15,807007175049328),(.D17,67336497266230),(.D15,48788680999024),(.D17,3796214218294),(.D15,2946213347440),(.D17,211493584438),(.D15,177695883376),(.D17,11607735862),(.D15,10703339632),(.D17,624819766),(.D15,643793008),(.D17,2149908022),(.D15,618246256),(.D17,26372662),(.D15,37067632),(.D17,1254646),(.D15,2218528),(.D17,1225145573),(.D17,6824),(.D8,9871)])]], + .ms [(.m2,.s6,364791569817010175),(.m7,.s5,364791569817010169)], + .m .m5, + .b 364791569817010175 [[([249949779319062525],[(.D8,170573835886657484),(.D16,252060841644392458),(.D6,356875086097022520),(.D16,220104635694710896),(.D6,20615843020799542),(.D16,13334327265853552),(.D6,1182937072533046),(.D16,807007175049328),(.D6,67336497266230),(.D16,48788680999024),(.D6,3796214218294),(.D16,2946213347440),(.D6,211493584438),(.D16,177695883376),(.D6,11607735862),(.D16,10703339632),(.D6,624819766),(.D16,643793008),(.D6,2149908022),(.D16,618246256),(.D6,26372662),(.D16,37067632),(.D6,1254646),(.D16,2218528),(.D6,1225145573),(.D6,6825),(.D9,9871),(.D14,414),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,489766459476541438,139330113471774670),(.m0,244249911040671754,354922353446092344),(.m0,219616452531978352,20493797230116406),(.m0,13303815818182768,1175309210615350),(.m0,805100209569904,66859755896374),(.m0,48669495656560,3766417882678),(.m0,2938764263536,209631313462),(.m0,177230315632,11491343926),(.m0,10674241648,617545270),(.m0,641974384,2149453366),(.m0,618132592,26344246),(.m0,37060528,1252870),(.m0,2218084,1225145462)], + .ms [(.m12,.s7,6795),(.m0,.s6,9865),(.m3,.s6,413),(.m21,.s3,413),(.m4,.s3,9865),(.m4,.s3,6795)], + .ms2 .s3 .s0 [(.m13,1225145462,2218084),(.m1,1252870,37060528),(.m1,26344246,618132592),(.m1,2149453366,641974384),(.m1,617545270,10674241648),(.m1,11491343926,177230315632),(.m1,209631313462,2938764263536),(.m1,3766417882678,48669495656560),(.m1,66859755896374,805100209569904),(.m1,1175309210615350,13303815818182768),(.m1,20493797230116406,219616452531978352),(.m1,354922353446092344,244249911040671754),(.m1,139330113471774670,489766459476541433)], + .ms [(.m26,.s7,489766459476541438),(.m8,.s2,489766459476541433)], + .m .m9, + .b 0 [[([999799117276250108],[(.D7,489766459476541438),(.D7,139330113471774669),(.D16,244249911040671754),(.D6,354922353446092344),(.D16,219616452531978352),(.D6,20493797230116406),(.D16,13303815818182768),(.D6,1175309210615350),(.D16,805100209569904),(.D6,66859755896374),(.D16,48669495656560),(.D6,3766417882678),(.D16,2938764263536),(.D6,209631313462),(.D16,177230315632),(.D6,11491343926),(.D16,10674241648),(.D6,617545270),(.D16,641974384),(.D6,2149453366),(.D16,618132592),(.D6,26344246),(.D16,37060528),(.D6,1252870),(.D16,2218084),(.D6,1225145462),(.D12,6795),(.D16,9865),(.D16,413),(.D12,3)])]], + .ms [(.m2,.s6,499899558638125054)], + .ms2 .s6 .s7 [(.m3,364791569817010174,108086391056891854),(.m0,236438980436951050,352969620795162168),(.m0,219128269369245808,20371751439433270),(.m0,13273304370511984,1167681348697654),(.m0,803193244090480,66383014526518),(.m0,48550310314096,3736621547062),(.m0,2931315179632,207769042486),(.m0,176764747888,11374951990),(.m0,10645143664,610270774),(.m0,640155760,2148998710),(.m0,618018928,26315830),(.m0,37053424,1251094),(.m0,2217640,1225145351)], + .ms [(.m3,.s6,6769)], + .ms2 .s6 .s7 [(.m6,9857,412)], + .ms2 .s3 .s0 [(.m19,412,9857)], + .ms [(.m17,.s0,6769)], + .ms2 .s3 .s0 [(.m4,1225145351,2217640),(.m1,1251094,37053424),(.m1,26315830,618018928),(.m1,2148998710,640155760),(.m1,610270774,10645143664),(.m1,11374951990,176764747888),(.m1,207769042486,2931315179632),(.m1,3736621547062,48550310314096),(.m1,66383014526518,803193244090480),(.m1,1167681348697654,13273304370511984),(.m1,20371751439433270,219128269369245808),(.m1,352969620795162168,236438980436951050),(.m1,108086391056891854,364791569817010174)], + .ms [(.m1,.s3,499899558638125048),(.m10,.s7,499899558638125054),(.m8,.s2,499899558638125049)], + .m .m9, + .b 0 [[([1999598234552500214,918734323983581190],[(.D7,499899558638125054),(.D17,364791569817010174)]),([182395784908505087],[(.D6,108086391056891854),(.D16,236438980436951050),(.D6,352969620795162168),(.D16,219128269369245808),(.D6,20371751439433270),(.D16,13273304370511984),(.D6,1167681348697654),(.D16,803193244090480),(.D6,66383014526518),(.D16,48550310314096),(.D6,3736621547062),(.D16,2931315179632),(.D6,207769042486),(.D16,176764747888),(.D6,11374951990),(.D16,10645143664),(.D6,610270774),(.D16,640155760),(.D6,2148998710),(.D16,618018928),(.D6,26315830),(.D16,37053424),(.D6,1251094),(.D16,2217640),(.D6,1225145351),(.D6,6769),(.D12,9857),(.D6,412),(.D16,4)])]], + .ms [(.m2,.s6,1459166279268040702),(.m3,.s6,135107988821114878)], + .ms2 .s6 .s7 [(.m3,273593677362757630,85286917943328718),(.m0,230739112158560266,351544653725564472),(.m0,218772027601846384,20282690997583414),(.m0,13251039260049520,1162115071082038),(.m0,801801674686576,66035122175542),(.m0,48463337226352,3714878275126),(.m0,2925879361648,206410087990),(.m0,176425009264,11290017334),(.m0,10623910000,604962358),(.m0,638828656,2148666934),(.m0,617935984,26295094),(.m0,37048240,1249798),(.m0,2217316,1225145270)], + .ms [(.m12,.s7,6747),(.m0,.s6,9853),(.m3,.s6,410),(.m20,.s0,410),(.m1,.s3,9853),(.m4,.s3,6747)], + .ms2 .s3 .s0 [(.m13,1225145270,2217316),(.m1,1249798,37048240),(.m1,26295094,617935984),(.m1,2148666934,638828656),(.m1,604962358,10623910000),(.m1,11290017334,176425009264),(.m1,206410087990,2925879361648),(.m1,3714878275126,48463337226352),(.m1,66035122175542,801801674686576),(.m1,1162115071082038,13251039260049520),(.m1,20282690997583414,218772027601846384),(.m1,351544653725564472,230739112158560266),(.m1,85286917943328718,273593677362757630)], + .ms [(.m1,.s3,135107988821114878),(.m4,.s3,1459166279268040696),(.m10,.s7,1459166279268040702),(.m8,.s2,1459166279268040697)], + .m .m9, + .b 0 [[([4323455642275676084],[(.D7,1459166279268040702)]), + ([540431955284459510,270215977642229759,135107988821114880,67553994410557440,33776997205278720,16888498602639360,8444249301319680,4222124650659840,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,135107988821114878), + (.D16,273593677362757630)]), + ([67553994410557438],[(.D6,85286917943328718), + (.D16,230739112158560266), + (.D6,351544653725564472), + (.D16,218772027601846384), + (.D6,20282690997583414), + (.D16,13251039260049520), + (.D6,1162115071082038), + (.D16,801801674686576), + (.D6,66035122175542), + (.D16,48463337226352), + (.D6,3714878275126), + (.D16,2925879361648), + (.D6,206410087990), + (.D16,176425009264), + (.D6,11290017334), + (.D16,10623910000), + (.D6,604962358), + (.D16,638828656), + (.D6,2148666934), + (.D16,617935984), + (.D6,26295094), + (.D16,37048240), + (.D6,1249798), + (.D16,2217316), + (.D6,1225145270), + (.D12,6747), + (.D16,9853), + (.D16,410), + (.D6,5)])]], + .ms [(.m2,.s6,2161727821137838042),(.m3,.s6,918734323983581191),(.m14,.s5,918734323983581191),(.m4,.s5,2161727821137838036)], + .m .m5, + .b 2161727821137838042 [[([23],[(.D16,918734323983581191),(.D18,1),(.D15,239816680157478909),(.D16,76842668642009038)])]], + .ms [(.m2,.s6,2161727821137838054),(.m3,.s6,918734323983581188),(.m7,.s5,918734323983581188),(.m4,.s5,2161727821137838048)], + .m .m5, + .b 2161727821137838054 [[([7],[(.D16,918734323983581188),(.D6,1)])]], + .ms [(.m2,.s6,2161727821137838058),(.m6,.s6,918734323983581186),(.m15,.s5,918734323983581186),(.m11,.s5,2161727821137838052)], + .m .m5, + .b 2161727821137838058 [[([5],[(.D12,918734323983581186),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,2161727821137838061,918734323983581187)], + .ms [(.m23,.s1,918734323983581187),(.m22,.s4,2161727821137838055)], + .m .m24, + .b 2161727821137838061 [[([17],[(.D6,918734323983581187),(.D6,2)])]], + .ms [(.m2,.s6,2161727821137838070),(.m6,.s6,918734323983581183),(.m14,.s5,918734323983581183),(.m11,.s5,2161727821137838064)], + .m .m5, + .b 2161727821137838070 [[([23],[(.D12,918734323983581183),(.D18,1),(.D17,239816680157478908),(.D17,76842668642009038),(.D15,228628049833230346),(.D17,351016888144231992),(.D15,218640086206513264),(.D17,20249705648750134),(.D15,13242792922841200),(.D17,1160053486779958),(.D15,801286278611056),(.D17,65906273156662),(.D15,48431124971632),(.D17,3706825211446),(.D15,2923866095728),(.D17,205906771510),(.D15,176299180144),(.D17,11258560054),(.D15,10616045680),(.D17,602996278),(.D15,638337136),(.D17,2148544054),(.D15,617905264),(.D17,26287414),(.D15,37046320),(.D17,1249318),(.D15,2217196),(.D17,1225145240),(.D11,6739),(.D6,9852)])]], + .ms [(.m2,.s6,2161727821137838082),(.m6,.s6,918734323983581180),(.m7,.s5,918734323983581180),(.m11,.s5,2161727821137838076)], + .m .m5, + .b 2161727821137838082 [[([3674937295934324721,1837468647967162365,324259173170675721],[(.D12,918734323983581180),(.D8,239816680157478908),(.D6,76842668642009038),(.D16,228628049833230346)]),([22799473113563135],[(.D6,351016888144231992),(.D16,218640086206513264),(.D6,20249705648750134),(.D16,13242792922841200),(.D6,1160053486779958),(.D16,801286278611056),(.D6,65906273156662),(.D16,48431124971632),(.D6,3706825211446),(.D16,2923866095728),(.D6,205906771510),(.D16,176299180144),(.D6,11258560054),(.D16,10616045680),(.D6,602996278),(.D16,638337136),(.D6,2148544054),(.D16,617905264),(.D6,26287414),(.D16,37046320),(.D6,1249318),(.D16,2217196),(.D6,1225145240),(.D12,6740),(.D7,9851),(.D8,409),(.D7,4)])]], + .ms [(.m2,.s6,5080060379673919486)], + .ms2 .s6 .s7 [(.m3,189151184349560830,57420895248973822)], + .ms [(.m3,.s6,31243722414882766)], + .ms2 .s6 .s7 [(.m3,217228313276448778,348166954005036600),(.m0,217927602671714416,20071584765050422),(.m0,13198262701916272,1148920931548726),(.m0,798503139803248,65210488454710),(.m0,48257178796144,3663338667574),(.m0,2912994459760,203188862518),(.m0,175619702896,11088690742),(.m0,10573578352,592379446),(.m0,635682928,2147880502),(.m0,617739376,26245942),(.m0,37035952,1246726),(.m0,2216548,1225145078)], + .ms [(.m12,.s7,6699),(.m0,.s6,9841),(.m3,.s6,407),(.m21,.s3,407),(.m4,.s3,9841),(.m4,.s3,6699)], + .ms2 .s3 .s0 [(.m13,1225145078,2216548),(.m1,1246726,37035952),(.m1,26245942,617739376),(.m1,2147880502,635682928),(.m1,592379446,10573578352),(.m1,11088690742,175619702896),(.m1,203188862518,2912994459760),(.m1,3663338667574,48257178796144),(.m1,65210488454710,798503139803248),(.m1,1148920931548726,13198262701916272),(.m1,20071584765050422,217927602671714416),(.m1,348166954005036600,217228313276448778),(.m1,31243722414882766,57420895248973822)], + .ms [(.m4,.s3,189151184349560830),(.m4,.s3,5080060379673919480),(.m10,.s7,5080060379673919486),(.m8,.s2,5080060379673919481)], + .m .m9, + .b 0 [[([6052837899185946548],[(.D7,5080060379673919486)]), + ([756604737398243318,378302368699121663,189151184349560832,94575592174780416,47287796087390208,23643898043695104,11821949021847552,5910974510923776,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,189151184349560830), + (.D6,57420895248973822), + (.D6,31243722414882766)]), + ([23643898043695103],[(.D16,217228313276448778), + (.D6,348166954005036600), + (.D16,217927602671714416), + (.D6,20071584765050422), + (.D16,13198262701916272), + (.D6,1148920931548726), + (.D16,798503139803248), + (.D6,65210488454710), + (.D16,48257178796144), + (.D6,3663338667574), + (.D16,2912994459760), + (.D6,203188862518), + (.D16,175619702896), + (.D6,11088690742), + (.D16,10573578352), + (.D6,592379446), + (.D16,635682928), + (.D6,2147880502), + (.D16,617739376), + (.D6,26245942), + (.D16,37035952), + (.D6,1246726), + (.D16,2216548), + (.D6,1225145078), + (.D12,6699), + (.D16,9841), + (.D16,407), + (.D12,3)])], + [([8],[(.D15,4323455642275676167), + (.D21,0), + (.D19,10133099161583613)])]], + .ms [(.m2,.s6,3026418949592973278),(.m6,.s6,4323455642275676165),(.m7,.s5,4323455642275676165),(.m11,.s5,3026418949592973272)], + .m .m5, + .b 3026418949592973278 [[([41],[(.D12,4323455642275676165),(.D8,1),(.D7,10133099161583612)])],[([243194379878006662],[(.D17,4323455642275676161),(.D2,10133099161583610)])]], + .ms [(.m2,.s6,3148016139531976630),(.m3,.s6,4293056344790925328),(.m27,.s2,4293056344790925328),(.m1,.s5,3148016139531976624)], + .m .m5, + .b 3148016139531976630 [[([7],[(.D16,4293056344790925328), + (.D6,1)])], + [([16],[(.D11,4293056344790925326), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,4293056344790925325), + (.D17,1), + (.D15,0), + (.D6,19421773393035214)])], + [([16],[(.D11,4293056344790925323), + (.D3,0)])], + [([8],[(.D15,4293056344790925322), + (.D17,1), + (.D21,19421773393035213), + (.D15,214272826020986890), + (.D17,347428082191171128), + (.D15,217742884718248048), + (.D17,20025405276683830), + (.D15,13186717829824624), + (.D17,1146034713525814), + (.D15,797781585297520), + (.D17,65030099828278), + (.D15,48212081639536), + (.D17,3652064378422), + (.D15,2910175887472), + (.D17,202484219446), + (.D15,175443542128), + (.D17,11044650550), + (.D15,10562568304), + (.D17,589626934), + (.D15,634994800), + (.D17,2147708470), + (.D15,617696368), + (.D17,26235190), + (.D15,37033264), + (.D17,1246054), + (.D15,2216380), + (.D17,1225145036), + (.D11,6688), + (.D12,9838)])], + [([18],[(.D11,4293056344790925320), + (.D13,0), + (.D16,19421773393035213), + (.D16,214272826020986890)])], + [([621496748577126852],[(.D17,4293056344790925319)]), + ([77687093572140859,38843546786070431,19421773393035216,9710886696517608,4855443348258804,2427721674129399,1213860837064701,606930418532352,303465209266176,151732604633088,75866302316544,37933151158272,18966575579136,9483287789568,4741643894784,2370821947392,1185410973696,592705486848,296352743424,148176371712,74088185856,37044092928,18522046464,9261023232,4630511616,2315255808,1157627904,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,19421773393035214), + (.D17,214272826020986890)]), + ([9710886696517607],[(.D6,347428082191171128), + (.D16,217742884718248048), + (.D6,20025405276683830), + (.D16,13186717829824624), + (.D6,1146034713525814), + (.D16,797781585297520), + (.D6,65030099828278), + (.D16,48212081639536), + (.D6,3652064378422), + (.D16,2910175887472), + (.D6,202484219446), + (.D16,175443542128), + (.D6,11044650550), + (.D16,10562568304), + (.D6,589626934), + (.D16,634994800), + (.D6,2147708470), + (.D16,617696368), + (.D6,26235190), + (.D16,37033264), + (.D6,1246054), + (.D16,2216380), + (.D6,1225145036), + (.D12,6689), + (.D13,9838), + (.D9,406), + (.D13,3)])], + [([10],[(.D17,4215369251218784463), + (.D21,0), + (.D19,209417382672728086)])]], + .ms [(.m2,.s6,3458764513820540098),(.m3,.s6,4215369251218784461),(.m7,.s5,4215369251218784461),(.m4,.s5,3458764513820540092)], + .m .m5, + .b 3458764513820540098 [[([43],[(.D16,4215369251218784461),(.D8,1),(.D7,209417382672728085)])],[([5026017184145474010],[(.D11,4215369251218784454),(.D2,209417382672728083)])]], + .ms2 .s6 .s7 [(.m2,5971773105893277125,3587117103200600205)], + .ms [(.m29,.s2,3587117103200600205),(.m4,.s5,5971773105893277119)], + .m .m5, + .b 5971773105893277125 [[([9],[(.D6,3587117103200600205),(.D6,1)])],[([20],[(.D15,3587117103200600203),(.D13,0),(.D10,346214221354106426),(.D9,217439419508981872)])],[([36],[(.D11,3587117103200600199)]),([7,2],[(.D12,1),(.D6,346214221354106426)])]], + .ms [(.m2,.s6,5971773105893277158),(.m6,.s6,3587117103200600195),(.m15,.s5,3587117103200600195),(.m11,.s5,5971773105893277152)], + .m .m5, + .b 5971773105893277158 [[([5],[(.D12,3587117103200600195),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,5971773105893277161,3587117103200600196)], + .ms [(.m23,.s1,3587117103200600196),(.m22,.s4,5971773105893277155)], + .m .m82, + ] (by decide +kernel) +theorem chunk_19_step : (cfg_19.denote) [qi]⊢* (cfg_20.denote) := + step_chunk [ + .m .m83, + .b 5971773105893277161 [[([17],[(.D6,3587117103200600196),(.D6,2)])],[([6],[(.D11,3587117103200600192),(.D21,0),(.D7,346214221354106424)])]], + .ms2 .s6 .s7 [(.m2,5971773105893277173,3587117103200600193)], + .ms2 .s5 .s2 [(.m28,3587117103200600193,5971773105893277168)], + .m .m18, + .b 5971773105893277173 [[([45],[(.D6,3587117103200600193),(.D8,1),(.D17,346214221354106423),(.D10,217439419508981871)])],[([36],[(.D15,3587117103200600186)]),([7,2],[(.D12,1),(.D17,346214221354106422)]),([1],[(.D11,217439419508981871),(.D16,19949538974367286)])],[([8],[(.D15,3587117103200600182),(.D21,0),(.D17,346214221354106421),(.D12,217439419508981872)])]], + .ms [(.m2,.s6,5971773105893277218),(.m6,.s6,3587117103200600180),(.m7,.s5,3587117103200600180),(.m11,.s5,5971773105893277212)], + .m .m5, + .b 5971773105893277218 [[([39],[(.D12,3587117103200600180),(.D8,346214221354106422),(.D13,217439419508981872),(.D17,19949538974367286),(.D15,13167751254245488),(.D17,1141293069631030),(.D15,796596174323824),(.D17,64733747084854),(.D15,48137993453680),(.D17,3633542331958),(.D15,2905545375856),(.D17,201326591542),(.D15,175154135152),(.D17,10972298806),(.D15,10544480368),(.D17,585104950),(.D15,633864304),(.D17,2147425846),(.D15,617625712),(.D17,26217526),(.D15,37028848),(.D17,1244950),(.D15,2216104),(.D17,1225144967),(.D17,6673),(.D11,9833),(.D17,406),(.D15,3)])]], + .ms [(.m2,.s6,5971773105893277238)], + .ms2 .s6 .s7 [(.m3,3587117103200600176,346214221354106422),(.m0,217439419508981872,19949538974367286),(.m0,13167751254245488,1141293069631030),(.m0,796596174323824,64733747084854),(.m0,48137993453680,3633542331958),(.m0,2905545375856,201326591542),(.m0,175154135152,10972298806),(.m0,10544480368,585104950),(.m0,633864304,2147425846),(.m0,617625712,26217526),(.m0,37028848,1244950),(.m0,2216104,1225144967)], + .ms [(.m3,.s6,6673)], + .ms2 .s6 .s7 [(.m6,9833,406)], + .ms2 .s3 .s0 [(.m19,406,9833)], + .ms [(.m17,.s0,6673)], + .ms2 .s3 .s0 [(.m4,1225144967,2216104),(.m1,1244950,37028848),(.m1,26217526,617625712),(.m1,2147425846,633864304),(.m1,585104950,10544480368),(.m1,10972298806,175154135152),(.m1,201326591542,2905545375856),(.m1,3633542331958,48137993453680),(.m1,64733747084854,796596174323824),(.m1,1141293069631030,13167751254245488),(.m1,19949538974367286,217439419508981872),(.m1,346214221354106422,3587117103200600176)], + .ms [(.m1,.s3,5971773105893277232),(.m10,.s7,5971773105893277238),(.m8,.s2,5971773105893277233)], + .m .m9, + .b 0 [[([182395784908505084],[(.D7,5971773105893277238),(.D17,3587117103200600176),(.D6,346214221354106422),(.D16,217439419508981872),(.D6,19949538974367286),(.D16,13167751254245488),(.D6,1141293069631030),(.D16,796596174323824),(.D6,64733747084854),(.D16,48137993453680),(.D6,3633542331958),(.D16,2905545375856),(.D6,201326591542),(.D16,175154135152),(.D6,10972298806),(.D16,10544480368),(.D6,585104950),(.D16,633864304),(.D6,2147425846),(.D16,617625712),(.D6,26217526),(.D16,37028848),(.D6,1244950),(.D16,2216104),(.D6,1225144967),(.D6,6673),(.D12,9833),(.D6,406),(.D16,4)])]], + .ms [(.m2,.s6,91197892454252542),(.m3,.s6,5948973632779714102)], + .ms2 .s6 .s7 [(.m3,3581417234922209392,344789254284508726),(.m0,217083177741582448,19860478532517430),(.m0,13145486143783024,1135726792015414),(.m0,795204604919920,64385854733878),(.m0,48051020365936,3611799060022),(.m0,2900109557872,199967637046),(.m0,174814396528,10887364150),(.m0,10523246704,579796534),(.m0,632537200,2147094070),(.m0,617542768,26196790),(.m0,37023664,1243654),(.m0,2215780,1225144886)], + .ms [(.m12,.s7,6651),(.m0,.s6,9829),(.m3,.s6,404),(.m20,.s0,404),(.m1,.s3,9829),(.m4,.s3,6651)], + .ms2 .s3 .s0 [(.m13,1225144886,2215780),(.m1,1243654,37023664),(.m1,26196790,617542768),(.m1,2147094070,632537200),(.m1,579796534,10523246704),(.m1,10887364150,174814396528),(.m1,199967637046,2900109557872),(.m1,3611799060022,48051020365936),(.m1,64385854733878,795204604919920),(.m1,1135726792015414,13145486143783024),(.m1,19860478532517430,217083177741582448),(.m1,344789254284508726,3581417234922209392)], + .ms [(.m1,.s3,5948973632779714102),(.m4,.s3,91197892454252536),(.m10,.s7,91197892454252542),(.m8,.s2,91197892454252537)], + .m .m9, + .b 0 [[([364791569817010166,182395784908505085,91197892454252544,45598946227126272,22799473113563136,11399736556781568,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,91197892454252542), + (.D17,5948973632779714102)]), + ([45598946227126270],[(.D16,3581417234922209392), + (.D6,344789254284508726), + (.D16,217083177741582448), + (.D6,19860478532517430), + (.D16,13145486143783024), + (.D6,1135726792015414), + (.D16,795204604919920), + (.D6,64385854733878), + (.D16,48051020365936), + (.D6,3611799060022), + (.D16,2900109557872), + (.D6,199967637046), + (.D16,174814396528), + (.D6,10887364150), + (.D16,10523246704), + (.D6,579796534), + (.D16,632537200), + (.D6,2147094070), + (.D16,617542768), + (.D6,26196790), + (.D16,37023664), + (.D6,1243654), + (.D16,2215780), + (.D6,1225144886), + (.D12,6651), + (.D16,9829), + (.D16,404), + (.D6,5)])]], + .ms [(.m2,.s6,364791569817010165),(.m14,.s5,364791569817010159)], + .m .m5, + .b 364791569817010165 [[([5],[(.D18,1),(.D15,5926174159666150965),(.D14,3575717366643818608)])]], + .ms [(.m2,.s6,364791569817010168),(.m7,.s5,364791569817010162)], + .m .m5, + .b 364791569817010168 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,364791569817010169),(.m15,.s5,364791569817010163)], + .m .m5, + .b 364791569817010169 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,364791569817010170),(.m25,.s2,364791569817010165)], + .m .m18, + .b 364791569817010170 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,364791569817010172),(.m14,.s5,364791569817010166)], + .m .m5, + .b 364791569817010172 [[([5],[(.D18,1),(.D17,5926174159666150964),(.D15,3575717366643818608),(.D17,343364287214911030),(.D15,216726935974183024),(.D17,19771418090667574),(.D15,13123221033320560),(.D17,1130160514399798),(.D15,793813035516016),(.D17,64037962382902),(.D15,47964047278192),(.D17,3590055788086),(.D15,2894673739888),(.D17,198608682550),(.D15,174474657904),(.D17,10802429494),(.D15,10502013040),(.D17,574488118),(.D15,631210096),(.D17,2146762294),(.D15,617459824),(.D17,26176054),(.D15,37018480),(.D17,1242358),(.D15,2215456),(.D17,1225144805),(.D17,6632),(.D8,9823)])]], + .ms [(.m2,.s6,364791569817010175),(.m7,.s5,364791569817010169)], + .m .m5, + .b 364791569817010175 [[([249949779319062525],[(.D8,5926174159666150964),(.D16,3575717366643818608),(.D6,343364287214911030),(.D16,216726935974183024),(.D6,19771418090667574),(.D16,13123221033320560),(.D6,1130160514399798),(.D16,793813035516016),(.D6,64037962382902),(.D16,47964047278192),(.D6,3590055788086),(.D16,2894673739888),(.D6,198608682550),(.D16,174474657904),(.D6,10802429494),(.D16,10502013040),(.D6,574488118),(.D16,631210096),(.D6,2146762294),(.D16,617459824),(.D6,26176054),(.D16,37018480),(.D6,1242358),(.D16,2215456),(.D6,1225144805),(.D6,6633),(.D9,9823),(.D14,402),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,489766459476541438,5894930437251268150),(.m0,3567906436040097904,341411554563980854),(.m0,216238752811450480,19649372299984438),(.m0,13092709585649776,1122532652482102),(.m0,791906070036592,63561221013046),(.m0,47844861935728,3560259452470),(.m0,2887224655984,196746411574),(.m0,174009090160,10686037558),(.m0,10472915056,567213622),(.m0,629391472,2146307638),(.m0,617346160,26147638),(.m0,37011376,1240582),(.m0,2215012,1225144694)], + .ms [(.m12,.s7,6603),(.m0,.s6,9817),(.m3,.s6,401),(.m21,.s3,401),(.m4,.s3,9817),(.m4,.s3,6603)], + .ms2 .s3 .s0 [(.m13,1225144694,2215012),(.m1,1240582,37011376),(.m1,26147638,617346160),(.m1,2146307638,629391472),(.m1,567213622,10472915056),(.m1,10686037558,174009090160),(.m1,196746411574,2887224655984),(.m1,3560259452470,47844861935728),(.m1,63561221013046,791906070036592),(.m1,1122532652482102,13092709585649776),(.m1,19649372299984438,216238752811450480),(.m1,341411554563980854,3567906436040097904),(.m1,5894930437251268150,489766459476541433)], + .ms [(.m26,.s7,489766459476541438),(.m8,.s2,489766459476541433)], + .m .m9, + .b 0 [[([999799117276250108],[(.D7,489766459476541438),(.D7,5894930437251268149),(.D16,3567906436040097904),(.D6,341411554563980854),(.D16,216238752811450480),(.D6,19649372299984438),(.D16,13092709585649776),(.D6,1122532652482102),(.D16,791906070036592),(.D6,63561221013046),(.D16,47844861935728),(.D6,3560259452470),(.D16,2887224655984),(.D6,196746411574),(.D16,174009090160),(.D6,10686037558),(.D16,10472915056),(.D6,567213622),(.D16,629391472),(.D6,2146307638),(.D16,617346160),(.D6,26147638),(.D16,37011376),(.D6,1240582),(.D16,2215012),(.D6,1225144694),(.D12,6603),(.D16,9817),(.D16,401),(.D12,3)])]], + .ms [(.m2,.s6,499899558638125054)], + .ms2 .s6 .s7 [(.m3,364791569817010174,5863686714836385334),(.m0,3560095505436377200,339458821913050678),(.m0,215750569648717936,19527326509301302),(.m0,13062198137978992,1114904790564406),(.m0,789999104557168,63084479643190),(.m0,47725676593264,3530463116854),(.m0,2879775572080,194884140598),(.m0,173543522416,10569645622),(.m0,10443817072,559939126),(.m0,627572848,2145852982),(.m0,617232496,26119222),(.m0,37004272,1238806),(.m0,2214568,1225144583)], + .ms [(.m3,.s6,6577)], + .ms2 .s6 .s7 [(.m6,9809,400)], + .ms2 .s3 .s0 [(.m19,400,9809)], + .ms [(.m17,.s0,6577)], + .ms2 .s3 .s0 [(.m4,1225144583,2214568),(.m1,1238806,37004272),(.m1,26119222,617232496),(.m1,2145852982,627572848),(.m1,559939126,10443817072),(.m1,10569645622,173543522416),(.m1,194884140598,2879775572080),(.m1,3530463116854,47725676593264),(.m1,63084479643190,789999104557168),(.m1,1114904790564406,13062198137978992),(.m1,19527326509301302,215750569648717936),(.m1,339458821913050678,3560095505436377200),(.m1,5863686714836385334,364791569817010174)], + .ms [(.m1,.s3,499899558638125048),(.m10,.s7,499899558638125054),(.m8,.s2,499899558638125049)], + .m .m9, + .b 0 [[([1999598234552500214,918734323983581190],[(.D7,499899558638125054),(.D17,364791569817010174)]),([182395784908505087],[(.D6,5863686714836385334),(.D16,3560095505436377200),(.D6,339458821913050678),(.D16,215750569648717936),(.D6,19527326509301302),(.D16,13062198137978992),(.D6,1114904790564406),(.D16,789999104557168),(.D6,63084479643190),(.D16,47725676593264),(.D6,3530463116854),(.D16,2879775572080),(.D6,194884140598),(.D16,173543522416),(.D6,10569645622),(.D16,10443817072),(.D6,559939126),(.D16,627572848),(.D6,2145852982),(.D16,617232496),(.D6,26119222),(.D16,37004272),(.D6,1238806),(.D16,2214568),(.D6,1225144583),(.D6,6577),(.D12,9809),(.D6,400),(.D16,4)])]], + .ms [(.m2,.s6,1459166279268040702),(.m3,.s6,135107988821114878)], + .ms2 .s6 .s7 [(.m3,273593677362757630,5840887241722822198),(.m0,3554395637157986416,338033854843452982),(.m0,215394327881318512,19438266067451446),(.m0,13039933027516528,1109338512948790),(.m0,788607535153264,62736587292214),(.m0,47638703505520,3508719844918),(.m0,2874339754096,193525186102),(.m0,173203783792,10484710966),(.m0,10422583408,554630710),(.m0,626245744,2145521206),(.m0,617149552,26098486),(.m0,36999088,1237510),(.m0,2214244,1225144502)], + .ms [(.m12,.s7,6555),(.m0,.s6,9805),(.m3,.s6,398),(.m20,.s0,398),(.m1,.s3,9805),(.m4,.s3,6555)], + .ms2 .s3 .s0 [(.m13,1225144502,2214244),(.m1,1237510,36999088),(.m1,26098486,617149552),(.m1,2145521206,626245744),(.m1,554630710,10422583408),(.m1,10484710966,173203783792),(.m1,193525186102,2874339754096),(.m1,3508719844918,47638703505520),(.m1,62736587292214,788607535153264),(.m1,1109338512948790,13039933027516528),(.m1,19438266067451446,215394327881318512),(.m1,338033854843452982,3554395637157986416),(.m1,5840887241722822198,273593677362757630)], + .ms [(.m1,.s3,135107988821114878),(.m4,.s3,1459166279268040696),(.m10,.s7,1459166279268040702),(.m8,.s2,1459166279268040697)], + .m .m9, + .b 0 [[([4323455642275676084],[(.D7,1459166279268040702)]), + ([540431955284459510,270215977642229759,135107988821114880,67553994410557440,33776997205278720,16888498602639360,8444249301319680,4222124650659840,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,135107988821114878), + (.D16,273593677362757630)]), + ([67553994410557438],[(.D6,5840887241722822198), + (.D16,3554395637157986416), + (.D6,338033854843452982), + (.D16,215394327881318512), + (.D6,19438266067451446), + (.D16,13039933027516528), + (.D6,1109338512948790), + (.D16,788607535153264), + (.D6,62736587292214), + (.D16,47638703505520), + (.D6,3508719844918), + (.D16,2874339754096), + (.D6,193525186102), + (.D16,173203783792), + (.D6,10484710966), + (.D16,10422583408), + (.D6,554630710), + (.D16,626245744), + (.D6,2145521206), + (.D16,617149552), + (.D6,26098486), + (.D16,36999088), + (.D6,1237510), + (.D16,2214244), + (.D6,1225144502), + (.D12,6555), + (.D16,9805), + (.D16,398), + (.D6,5)])]], + .ms [(.m2,.s6,2161727821137838042),(.m3,.s6,918734323983581191),(.m14,.s5,918734323983581191),(.m4,.s5,2161727821137838036)], + .m .m5, + .b 2161727821137838042 [[([23],[(.D16,918734323983581191),(.D18,1),(.D15,239816680157478909),(.D16,5832442992421502518)])]], + .ms [(.m2,.s6,2161727821137838054),(.m3,.s6,918734323983581188),(.m7,.s5,918734323983581188),(.m4,.s5,2161727821137838048)], + .m .m5, + .b 2161727821137838054 [[([7],[(.D16,918734323983581188),(.D6,1)])]], + .ms [(.m2,.s6,2161727821137838058),(.m6,.s6,918734323983581186),(.m15,.s5,918734323983581186),(.m11,.s5,2161727821137838052)], + .m .m5, + .b 2161727821137838058 [[([5],[(.D12,918734323983581186),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,2161727821137838061,918734323983581187)], + .ms [(.m23,.s1,918734323983581187),(.m22,.s4,2161727821137838055)], + .m .m24, + .b 2161727821137838061 [[([17],[(.D6,918734323983581187),(.D6,2)])]], + .ms [(.m2,.s6,2161727821137838070),(.m6,.s6,918734323983581183),(.m14,.s5,918734323983581183),(.m11,.s5,2161727821137838064)], + .m .m5, + .b 2161727821137838070 [[([23],[(.D12,918734323983581183),(.D18,1),(.D17,239816680157478908),(.D17,5832442992421502518),(.D15,3552284574832656496),(.D17,337506089262120502),(.D15,215262386485985392),(.D17,19405280718618166),(.D15,13031686690308208),(.D17,1107276928646710),(.D15,788092139077744),(.D17,62607738273334),(.D15,47606491250800),(.D17,3500666781238),(.D15,2872326488176),(.D17,193021869622),(.D15,173077954672),(.D17,10453253686),(.D15,10414719088),(.D17,552664630),(.D15,625754224),(.D17,2145398326),(.D15,617118832),(.D17,26090806),(.D15,36997168),(.D17,1237030),(.D15,2214124),(.D17,1225144472),(.D11,6547),(.D6,9804)])]], + .ms [(.m2,.s6,2161727821137838082),(.m6,.s6,918734323983581180),(.m7,.s5,918734323983581180),(.m11,.s5,2161727821137838076)], + .m .m5, + .b 2161727821137838082 [[([3674937295934324721,1837468647967162365,324259173170675721],[(.D12,918734323983581180),(.D8,239816680157478908),(.D6,5832442992421502518)]),([91197892454252543],[(.D16,3552284574832656496),(.D6,337506089262120502),(.D16,215262386485985392),(.D6,19405280718618166),(.D16,13031686690308208),(.D6,1107276928646710),(.D16,788092139077744),(.D6,62607738273334),(.D16,47606491250800),(.D6,3500666781238),(.D16,2872326488176),(.D6,193021869622),(.D16,173077954672),(.D6,10453253686),(.D16,10414719088),(.D6,552664630),(.D16,625754224),(.D6,2145398326),(.D16,617118832),(.D6,26090806),(.D16,36997168),(.D6,1237030),(.D16,2214124),(.D6,1225144472),(.D12,6548),(.D7,9803),(.D8,397),(.D7,4)])]], + .ms [(.m2,.s6,5080060379673919486)], + .ms2 .s6 .s7 [(.m3,189151184349560830,57420895248973822)], + .ms [(.m3,.s6,5786844046194376246)], + .ms2 .s6 .s7 [(.m3,3540884838275874928,334656155122925110),(.m0,214549902951186544,19227159834918454),(.m0,12987156469383280,1096144373415478),(.m0,785309000269936,61911953571382),(.m0,47432545075312,3457180237366),(.m0,2861454852208,190303960630),(.m0,172398477424,10283384374),(.m0,10372251760,542047798),(.m0,623100016,2144734774),(.m0,616952944,26049334),(.m0,36986800,1234438),(.m0,2213476,1225144310)], + .ms [(.m12,.s7,6507),(.m0,.s6,9793),(.m3,.s6,395),(.m21,.s3,395),(.m4,.s3,9793),(.m4,.s3,6507)], + .ms2 .s3 .s0 [(.m13,1225144310,2213476),(.m1,1234438,36986800),(.m1,26049334,616952944),(.m1,2144734774,623100016),(.m1,542047798,10372251760),(.m1,10283384374,172398477424),(.m1,190303960630,2861454852208),(.m1,3457180237366,47432545075312),(.m1,61911953571382,785309000269936),(.m1,1096144373415478,12987156469383280),(.m1,19227159834918454,214549902951186544),(.m1,334656155122925110,3540884838275874928),(.m1,5786844046194376246,57420895248973822)], + .ms [(.m4,.s3,189151184349560830),(.m4,.s3,5080060379673919480),(.m10,.s7,5080060379673919486),(.m8,.s2,5080060379673919481)], + .m .m9, + .b 0 [[([6052837899185946548],[(.D7,5080060379673919486)]), + ([756604737398243318,378302368699121663,189151184349560832,94575592174780416,47287796087390208,23643898043695104,11821949021847552,5910974510923776,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,189151184349560830), + (.D6,57420895248973822), + (.D6,5786844046194376246)]), + ([23643898043695103],[(.D16,3540884838275874928), + (.D6,334656155122925110), + (.D16,214549902951186544), + (.D6,19227159834918454), + (.D16,12987156469383280), + (.D6,1096144373415478), + (.D16,785309000269936), + (.D6,61911953571382), + (.D16,47432545075312), + (.D6,3457180237366), + (.D16,2861454852208), + (.D6,190303960630), + (.D16,172398477424), + (.D6,10283384374), + (.D16,10372251760), + (.D6,542047798), + (.D16,623100016), + (.D6,2144734774), + (.D16,616952944), + (.D6,26049334), + (.D16,36986800), + (.D6,1234438), + (.D16,2213476), + (.D6,1225144310), + (.D12,6507), + (.D16,9793), + (.D16,395), + (.D12,3)])], + [([8],[(.D15,4323455642275676167), + (.D21,0), + (.D19,10133099161583613)])]], + .ms [(.m2,.s6,3026418949592973278),(.m6,.s6,4323455642275676165),(.m7,.s5,4323455642275676165),(.m11,.s5,3026418949592973272)], + .m .m5, + .b 3026418949592973278 [[([41],[(.D12,4323455642275676165),(.D8,1),(.D7,10133099161583612)])],[([243194379878006662],[(.D17,4323455642275676161),(.D2,10133099161583610)])]], + .ms [(.m2,.s6,3148016139531976630),(.m3,.s6,4293056344790925328),(.m27,.s2,4293056344790925328),(.m1,.s5,3148016139531976624)], + .m .m5, + .b 3148016139531976630 [[([7],[(.D16,4293056344790925328), + (.D6,1)])], + [([16],[(.D11,4293056344790925326), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,4293056344790925325), + (.D17,1), + (.D15,0), + (.D6,5775022097172528694)])], + [([16],[(.D11,4293056344790925323), + (.D3,0)])], + [([8],[(.D15,4293056344790925322), + (.D17,1), + (.D21,5775022097172528693), + (.D15,3537929351020413040), + (.D17,333917283309059638), + (.D15,214365184997720176), + (.D17,19180980346551862), + (.D15,12975611597291632), + (.D17,1093258155392566), + (.D15,784587445764208), + (.D17,61731564944950), + (.D15,47387447918704), + (.D17,3445905948214), + (.D15,2858636279920), + (.D17,189599317558), + (.D15,172222316656), + (.D17,10239344182), + (.D15,10361241712), + (.D17,539295286), + (.D15,622411888), + (.D17,2144562742), + (.D15,616909936), + (.D17,26038582), + (.D15,36984112), + (.D17,1233766), + (.D15,2213308), + (.D17,1225144268), + (.D11,6496), + (.D12,9790)])], + [([18],[(.D11,4293056344790925320), + (.D13,0), + (.D16,5775022097172528693), + (.D16,3537929351020413040)])], + [([621496748577128422],[(.D17,4293056344790925319), + (.D12,5775022097172528694), + (.D17,3537929351020413040), + (.D6,333917283309059638), + (.D16,214365184997720176), + (.D6,19180980346551862), + (.D16,12975611597291632), + (.D6,1093258155392566), + (.D16,784587445764208), + (.D6,61731564944950), + (.D16,47387447918704), + (.D6,3445905948214), + (.D16,2858636279920), + (.D6,189599317558), + (.D16,172222316656), + (.D6,10239344182), + (.D16,10361241712), + (.D6,539295286), + (.D16,622411888), + (.D6,2144562742), + (.D16,616909936), + (.D6,26038582), + (.D16,36984112), + (.D6,1233766), + (.D16,2213308), + (.D6,1225144268), + (.D12,6497), + (.D13,9790), + (.D9,394), + (.D13,3)])]], + .ms [(.m2,.s6,3458764513820540878)], + .ms2 .s6 .s7 [(.m3,4215369251218784266,5755600323779493432),(.m0,3533073907672154224,332703422471994934),(.m0,214061719788454000,19105114044235318),(.m0,12956645021712496,1088516511497782),(.m0,783402034790512,61435212201526),(.m0,47313359732848,3427383901750),(.m0,2854005768304,188441689654),(.m0,171932909680,10166992438),(.m0,10343153776,534773302),(.m0,621281392,2144280118),(.m0,616839280,26020918),(.m0,36979696,1232662),(.m0,2213032,1225144199)], + .ms [(.m3,.s6,6481)], + .ms2 .s6 .s7 [(.m6,9785,394)], + .ms2 .s3 .s0 [(.m19,394,9785)], + .ms [(.m17,.s0,6481)], + .ms2 .s3 .s0 [(.m4,1225144199,2213032),(.m1,1232662,36979696),(.m1,26020918,616839280),(.m1,2144280118,621281392),(.m1,534773302,10343153776),(.m1,10166992438,171932909680),(.m1,188441689654,2854005768304),(.m1,3427383901750,47313359732848),(.m1,61435212201526,783402034790512),(.m1,1088516511497782,12956645021712496),(.m1,19105114044235318,214061719788454000),(.m1,332703422471994934,3533073907672154224),(.m1,5755600323779493432,4215369251218784266)], + .ms [(.m1,.s3,3458764513820540872),(.m10,.s7,3458764513820540878),(.m8,.s2,3458764513820540873)], + .m .m9, + .b 0 [[([2918332558536081404],[(.D7,3458764513820540878),(.D17,4215369251218784266),(.D6,5755600323779493432),(.D16,3533073907672154224),(.D6,332703422471994934),(.D16,214061719788454000),(.D6,19105114044235318),(.D16,12956645021712496),(.D6,1088516511497782),(.D16,783402034790512),(.D6,61435212201526),(.D16,47313359732848),(.D6,3427383901750),(.D16,2854005768304),(.D6,188441689654),(.D16,171932909680),(.D6,10166992438),(.D16,10343153776),(.D6,534773302),(.D16,621281392),(.D6,2144280118),(.D16,616839280),(.D6,26020918),(.D16,36979696),(.D6,1232662),(.D16,2213032),(.D6,1225144199),(.D6,6481),(.D12,9785),(.D6,394),(.D16,4)])]], + .ms [(.m2,.s6,1459166279268040702),(.m3,.s6,3093972944003530702)], + .ms2 .s6 .s7 [(.m3,4124171358764531722,5732800850665930296),(.m0,3527374039393763440,331278455402397238),(.m0,213705478021054576,19016053602385462),(.m0,12934379911250032,1082950233882166),(.m0,782010465386608,61087319850550),(.m0,47226386645104,3405640629814),(.m0,2848569950320,187082735158),(.m0,171593171056,10082057782),(.m0,10321920112,529464886),(.m0,619954288,2143948342),(.m0,616756336,26000182),(.m0,36974512,1231366),(.m0,2212708,1225144118)], + .ms [(.m12,.s7,6459),(.m0,.s6,9781),(.m3,.s6,392),(.m20,.s0,392),(.m1,.s3,9781),(.m4,.s3,6459)], + .ms2 .s3 .s0 [(.m13,1225144118,2212708),(.m1,1231366,36974512),(.m1,26000182,616756336),(.m1,2143948342,619954288),(.m1,529464886,10321920112),(.m1,10082057782,171593171056),(.m1,187082735158,2848569950320),(.m1,3405640629814,47226386645104),(.m1,61087319850550,782010465386608),(.m1,1082950233882166,12934379911250032),(.m1,19016053602385462,213705478021054576),(.m1,331278455402397238,3527374039393763440),(.m1,5732800850665930296,4124171358764531722)], + .ms [(.m1,.s3,3093972944003530702),(.m4,.s3,1459166279268040696),(.m10,.s7,1459166279268040702),(.m8,.s2,1459166279268040697)], + .m .m9, + .b 0 [[([5836665117072162806,2918332558536081405,1459166279268040704,729583139634020352,364791569817010176,182395784908505088,91197892454252544,45598946227126272,22799473113563136,11399736556781568,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,1459166279268040702), + (.D17,3093972944003530702)]), + ([729583139634020350],[(.D16,4124171358764531722), + (.D6,5732800850665930296), + (.D16,3527374039393763440), + (.D6,331278455402397238), + (.D16,213705478021054576), + (.D6,19016053602385462), + (.D16,12934379911250032), + (.D6,1082950233882166), + (.D16,782010465386608), + (.D6,61087319850550), + (.D16,47226386645104), + (.D6,3405640629814), + (.D16,2848569950320), + (.D6,187082735158), + (.D16,171593171056), + (.D6,10082057782), + (.D16,10321920112), + (.D6,529464886), + (.D16,619954288), + (.D6,2143948342), + (.D16,616756336), + (.D6,26000182), + (.D16,36974512), + (.D6,1231366), + (.D16,2212708), + (.D6,1225144118), + (.D12,6459), + (.D16,9781), + (.D16,392), + (.D6,5)])]], + .ms [(.m2,.s6,5836665117072162805),(.m14,.s5,5836665117072162799)], + .m .m5, + .b 5836665117072162805 [[([5],[(.D18,1),(.D15,2729181374186520525),(.D14,4032973466310279178)])]], + .ms [(.m2,.s6,5836665117072162808),(.m7,.s5,5836665117072162802)], + .m .m5, + .b 5836665117072162808 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,5836665117072162809),(.m15,.s5,5836665117072162803)], + .m .m5, + .b 5836665117072162809 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,5836665117072162810),(.m25,.s2,5836665117072162805)], + .m .m18, + .b 5836665117072162810 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,5836665117072162812),(.m14,.s5,5836665117072162806)], + .m .m5, + .b 5836665117072162812 [[([5],[(.D18,1),(.D17,2729181374186520524),(.D15,4032973466310279178),(.D17,5710001377552367160),(.D15,3521674171115372656),(.D17,329853488332799542),(.D15,213349236253655152),(.D17,18926993160535606),(.D15,12912114800787568),(.D17,1077383956266550),(.D15,780618895982704),(.D17,60739427499574),(.D15,47139413557360),(.D17,3383897357878),(.D15,2843134132336),(.D17,185723780662),(.D15,171253432432),(.D17,9997123126),(.D15,10300686448),(.D17,524156470),(.D15,618627184),(.D17,2143616566),(.D15,616673392),(.D17,25979446),(.D15,36969328),(.D17,1230070),(.D15,2212384),(.D17,1225144037),(.D17,6440),(.D8,9775)])]], + .ms [(.m2,.s6,5836665117072162815),(.m7,.s5,5836665117072162809)], + .m .m5, + .b 5836665117072162815 [[([3999196469105000445],[(.D8,2729181374186520524),(.D16,4032973466310279178),(.D6,5710001377552367160),(.D16,3521674171115372656),(.D6,329853488332799542),(.D16,213349236253655152),(.D6,18926993160535606),(.D16,12912114800787568),(.D6,1077383956266550),(.D16,780618895982704),(.D6,60739427499574),(.D16,47139413557360),(.D6,3383897357878),(.D16,2843134132336),(.D6,185723780662),(.D16,171253432432),(.D6,9997123126),(.D16,10300686448),(.D6,524156470),(.D16,618627184),(.D6,2143616566),(.D16,616673392),(.D6,25979446),(.D16,36969328),(.D6,1230070),(.D16,2212384),(.D6,1225144037),(.D6,6441),(.D9,9775),(.D14,390),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,7836263351624663038,2229281815548395470),(.m0,3907998576650747914,5678757655137484344),(.m0,3513863240511651952,327900755681869366),(.m0,212861053090922608,18804947369852470),(.m0,12881603353116784,1069756094348854),(.m0,778711930503280,60262686129718),(.m0,47020228214896,3354101022262),(.m0,2835685048432,183861509686),(.m0,170787864688,9880731190),(.m0,10271588464,516881974),(.m0,616808560,2143161910),(.m0,616559728,25951030),(.m0,36962224,1228294),(.m0,2211940,1225143926)], + .ms [(.m12,.s7,6411),(.m0,.s6,9769),(.m3,.s6,389)], + .m .m49, + ] (by decide +kernel) +theorem chunk_20_step : (cfg_20.denote) [qi]⊢* (cfg_21.denote) := + step_chunk [ + .ms [(.m84,.s3,389),(.m4,.s3,9769),(.m4,.s3,6411)], + .ms2 .s3 .s0 [(.m13,1225143926,2211940),(.m1,1228294,36962224),(.m1,25951030,616559728),(.m1,2143161910,616808560),(.m1,516881974,10271588464),(.m1,9880731190,170787864688),(.m1,183861509686,2835685048432),(.m1,3354101022262,47020228214896),(.m1,60262686129718,778711930503280),(.m1,1069756094348854,12881603353116784),(.m1,18804947369852470,212861053090922608),(.m1,327900755681869366,3513863240511651952),(.m1,5678757655137484344,3907998576650747914),(.m1,2229281815548395470,7836263351624663033)], + .ms [(.m26,.s7,7836263351624663038),(.m8,.s2,7836263351624663033)], + .m .m9, + .b 0 [[([15996785876420001788],[(.D7,7836263351624663038),(.D7,2229281815548395469),(.D16,3907998576650747914),(.D6,5678757655137484344),(.D16,3513863240511651952),(.D6,327900755681869366),(.D16,212861053090922608),(.D6,18804947369852470),(.D16,12881603353116784),(.D6,1069756094348854),(.D16,778711930503280),(.D6,60262686129718),(.D16,47020228214896),(.D6,3354101022262),(.D16,2835685048432),(.D6,183861509686),(.D16,170787864688),(.D6,9880731190),(.D16,10271588464),(.D6,516881974),(.D16,616808560),(.D6,2143161910),(.D16,616559728),(.D6,25951030),(.D16,36962224),(.D6,1228294),(.D16,2211940),(.D6,1225143926),(.D12,6411),(.D16,9769),(.D16,389),(.D12,3)])]], + .ms [(.m2,.s6,7998392938210000894)], + .ms2 .s6 .s7 [(.m3,5836665117072162814,1729382256910270414),(.m0,3783023686991216650,5647513932722601528),(.m0,3506052309907931248,325948023030939190),(.m0,212372869928190064,18682901579169334),(.m0,12851091905446000,1062128232431158),(.m0,776804965023856,59785944759862),(.m0,46901042872432,3324304686646),(.m0,2828235964528,181999238710),(.m0,170322296944,9764339254),(.m0,10242490480,509607478),(.m0,614989936,2142707254),(.m0,616446064,25922614),(.m0,36955120,1226518),(.m0,2211496,1225143815)], + .ms [(.m3,.s6,6385)], + .ms2 .s6 .s7 [(.m6,9761,388)], + .ms2 .s3 .s0 [(.m19,388,9761)], + .ms [(.m17,.s0,6385)], + .ms2 .s3 .s0 [(.m4,1225143815,2211496),(.m1,1226518,36955120),(.m1,25922614,616446064),(.m1,2142707254,614989936),(.m1,509607478,10242490480),(.m1,9764339254,170322296944),(.m1,181999238710,2828235964528),(.m1,3324304686646,46901042872432),(.m1,59785944759862,776804965023856),(.m1,1062128232431158,12851091905446000),(.m1,18682901579169334,212372869928190064),(.m1,325948023030939190,3506052309907931248),(.m1,5647513932722601528,3783023686991216650),(.m1,1729382256910270414,5836665117072162814)], + .ms [(.m1,.s3,7998392938210000888),(.m10,.s7,7998392938210000894),(.m8,.s2,7998392938210000889)], + .m .m9, + .b 0 [[([31993571752840003574,14699749183737298950],[(.D7,7998392938210000894),(.D17,5836665117072162814)]),([2918332558536081407],[(.D6,1729382256910270414),(.D16,3783023686991216650),(.D6,5647513932722601528),(.D16,3506052309907931248),(.D6,325948023030939190),(.D16,212372869928190064),(.D6,18682901579169334),(.D16,12851091905446000),(.D6,1062128232431158),(.D16,776804965023856),(.D6,59785944759862),(.D16,46901042872432),(.D6,3324304686646),(.D16,2828235964528),(.D6,181999238710),(.D16,170322296944),(.D6,9764339254),(.D16,10242490480),(.D6,509607478),(.D16,614989936),(.D6,2142707254),(.D16,616446064),(.D6,25922614),(.D16,36955120),(.D6,1226518),(.D16,2211496),(.D6,1225143815),(.D6,6385),(.D12,9761),(.D6,388),(.D16,4)])]], + .ms [(.m2,.s6,23346660468288651262),(.m3,.s6,2161727821137838078)], + .ms2 .s6 .s7 [(.m3,4377498837804122110,1364590687093260238),(.m0,3691825794536964106,5624714459609038392),(.m0,3500352441629540464,324523055961341494),(.m0,212016628160790640,18593841137319478),(.m0,12828826794983536,1056561954815542),(.m0,775413395619952,59438052408886),(.m0,46814069784688,3302561414710),(.m0,2822800146544,180640284214),(.m0,169982558320,9679404598),(.m0,10221256816,504299062),(.m0,613662832,2142375478),(.m0,616363120,25901878),(.m0,36949936,1225222),(.m0,2211172,1225143734)], + .ms [(.m12,.s7,6363),(.m0,.s6,9757),(.m3,.s6,386),(.m20,.s0,386),(.m1,.s3,9757),(.m4,.s3,6363)], + .ms2 .s3 .s0 [(.m13,1225143734,2211172),(.m1,1225222,36949936),(.m1,25901878,616363120),(.m1,2142375478,613662832),(.m1,504299062,10221256816),(.m1,9679404598,169982558320),(.m1,180640284214,2822800146544),(.m1,3302561414710,46814069784688),(.m1,59438052408886,775413395619952),(.m1,1056561954815542,12828826794983536),(.m1,18593841137319478,212016628160790640),(.m1,324523055961341494,3500352441629540464),(.m1,5624714459609038392,3691825794536964106),(.m1,1364590687093260238,4377498837804122110)], + .ms [(.m1,.s3,2161727821137838078),(.m4,.s3,23346660468288651256),(.m10,.s7,23346660468288651262),(.m8,.s2,23346660468288651257)], + .m .m9, + .b 0 [[([69175290276410818484],[(.D7,23346660468288651262)]), + ([8646911284551352310,4323455642275676159,2161727821137838080,1080863910568919040,540431955284459520,270215977642229760,135107988821114880,67553994410557440,33776997205278720,16888498602639360,8444249301319680,4222124650659840,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,2161727821137838078), + (.D16,4377498837804122110)]), + ([1080863910568919038],[(.D6,1364590687093260238), + (.D16,3691825794536964106), + (.D6,5624714459609038392), + (.D16,3500352441629540464), + (.D6,324523055961341494), + (.D16,212016628160790640), + (.D6,18593841137319478), + (.D16,12828826794983536), + (.D6,1056561954815542), + (.D16,775413395619952), + (.D6,59438052408886), + (.D16,46814069784688), + (.D6,3302561414710), + (.D16,2822800146544), + (.D6,180640284214), + (.D16,169982558320), + (.D6,9679404598), + (.D16,10221256816), + (.D6,504299062), + (.D16,613662832), + (.D6,2142375478), + (.D16,616363120), + (.D6,25901878), + (.D16,36949936), + (.D6,1225222), + (.D16,2211172), + (.D6,1225143734), + (.D12,6363), + (.D16,9757), + (.D16,386), + (.D6,5)])]], + .ms [(.m2,.s6,34587645138205409242),(.m3,.s6,14699749183737298951),(.m14,.s5,14699749183737298951),(.m4,.s5,34587645138205409236)], + .m .m5, + .b 34587645138205409242 [[([23],[(.D16,14699749183737298951),(.D18,1),(.D15,3837066882519662589),(.D16,1229482698272145358)])]], + .ms [(.m2,.s6,34587645138205409254),(.m3,.s6,14699749183737298948),(.m7,.s5,14699749183737298948),(.m4,.s5,34587645138205409248)], + .m .m5, + .b 34587645138205409254 [[([7],[(.D16,14699749183737298948),(.D6,1)])]], + .ms [(.m2,.s6,34587645138205409258),(.m6,.s6,14699749183737298946),(.m15,.s5,14699749183737298946),(.m11,.s5,34587645138205409252)], + .m .m5, + .b 34587645138205409258 [[([5],[(.D12,14699749183737298946),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,34587645138205409261,14699749183737298947)], + .ms [(.m23,.s1,14699749183737298947),(.m22,.s4,34587645138205409255)], + .m .m24, + .b 34587645138205409261 [[([17],[(.D6,14699749183737298947),(.D6,2)])]], + .ms [(.m2,.s6,34587645138205409270),(.m6,.s6,14699749183737298943),(.m14,.s5,14699749183737298943),(.m11,.s5,34587645138205409264)], + .m .m5, + .b 34587645138205409270 [[([23],[(.D12,14699749183737298943),(.D18,1),(.D17,3837066882519662588),(.D17,1229482698272145358),(.D15,3658048797331685386),(.D17,5616270210307718712),(.D15,3498241379304210544),(.D17,323995290380009014),(.D15,211884686765457520),(.D17,18560855788486198),(.D15,12820580457775216),(.D17,1054500370513462),(.D15,774897999544432),(.D17,59309203390006),(.D15,46781857529968),(.D17,3294508351030),(.D15,2820786880624),(.D17,180136967734),(.D15,169856729200),(.D17,9647947318),(.D15,10213392496),(.D17,502332982),(.D15,613171312),(.D17,2142252598),(.D15,616332400),(.D17,25894198),(.D15,36948016),(.D17,1224742),(.D15,2211052),(.D17,1225143704),(.D11,6355),(.D6,9756)])]], + .ms [(.m2,.s6,34587645138205409282),(.m6,.s6,14699749183737298940),(.m7,.s5,14699749183737298940),(.m11,.s5,34587645138205409276)], + .m .m5, + .b 34587645138205409282 [[([58798996734949195761,29399498367474597885,5188146770730811401],[(.D12,14699749183737298940),(.D8,3837066882519662588),(.D6,1229482698272145358),(.D16,3658048797331685386)]),([364791569817010175],[(.D6,5616270210307718712),(.D16,3498241379304210544),(.D6,323995290380009014),(.D16,211884686765457520),(.D6,18560855788486198),(.D16,12820580457775216),(.D6,1054500370513462),(.D16,774897999544432),(.D6,59309203390006),(.D16,46781857529968),(.D6,3294508351030),(.D16,2820786880624),(.D6,180136967734),(.D16,169856729200),(.D6,9647947318),(.D16,10213392496),(.D6,502332982),(.D16,613171312),(.D6,2142252598),(.D16,616332400),(.D6,25894198),(.D16,36948016),(.D6,1224742),(.D16,2211052),(.D6,1225143704),(.D12,6356),(.D7,9755),(.D8,385),(.D7,4)])]], + .ms [(.m2,.s6,81280966074782711806)], + .ms2 .s6 .s7 [(.m3,3026418949592973310,918734323983581182)], + .ms [(.m3,.s6,499899558638125006)], + .ms2 .s6 .s7 [(.m3,3475653012423180298,5570671264080592440),(.m0,3486841642747428976,321145356240813622),(.m0,211172203230658672,18382734904786486),(.m0,12776050236850288,1043367815282230),(.m0,772114860736624,58613418688054),(.m0,46607911354480,3251021807158),(.m0,2809915244656,177419058742),(.m0,169177251952,9478078006),(.m0,10170925168,491716150),(.m0,610517104,2141589046),(.m0,616166512,25852726),(.m0,36937648,1222150),(.m0,2210404,1225143542)], + .ms [(.m12,.s7,6315),(.m0,.s6,9745),(.m3,.s6,383),(.m21,.s3,383),(.m4,.s3,9745),(.m4,.s3,6315)], + .ms2 .s3 .s0 [(.m13,1225143542,2210404),(.m1,1222150,36937648),(.m1,25852726,616166512),(.m1,2141589046,610517104),(.m1,491716150,10170925168),(.m1,9478078006,169177251952),(.m1,177419058742,2809915244656),(.m1,3251021807158,46607911354480),(.m1,58613418688054,772114860736624),(.m1,1043367815282230,12776050236850288),(.m1,18382734904786486,211172203230658672),(.m1,321145356240813622,3486841642747428976),(.m1,5570671264080592440,3475653012423180298),(.m1,499899558638125006,918734323983581182)], + .ms [(.m4,.s3,3026418949592973310),(.m4,.s3,81280966074782711800),(.m10,.s7,81280966074782711806),(.m8,.s2,81280966074782711801)], + .m .m9, + .b 0 [[([96845406386975145908],[(.D7,81280966074782711806)]), + ([12105675798371893238,6052837899185946623,3026418949592973312,1513209474796486656,756604737398243328,378302368699121664,189151184349560832,94575592174780416,47287796087390208,23643898043695104,11821949021847552,5910974510923776,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,3026418949592973310), + (.D6,918734323983581182), + (.D6,499899558638125006)]), + ([378302368699121663],[(.D16,3475653012423180298), + (.D6,5570671264080592440), + (.D16,3486841642747428976), + (.D6,321145356240813622), + (.D16,211172203230658672), + (.D6,18382734904786486), + (.D16,12776050236850288), + (.D6,1043367815282230), + (.D16,772114860736624), + (.D6,58613418688054), + (.D16,46607911354480), + (.D6,3251021807158), + (.D16,2809915244656), + (.D6,177419058742), + (.D16,169177251952), + (.D6,9478078006), + (.D16,10170925168), + (.D6,491716150), + (.D16,610517104), + (.D6,2141589046), + (.D16,616166512), + (.D6,25852726), + (.D16,36937648), + (.D6,1222150), + (.D16,2210404), + (.D6,1225143542), + (.D12,6315), + (.D16,9745), + (.D16,383), + (.D12,3)])], + [([8],[(.D15,69175290276410818567), + (.D21,0), + (.D19,162129586585337853)])]], + .ms [(.m2,.s6,48422703193487572958),(.m6,.s6,69175290276410818565),(.m7,.s5,69175290276410818565),(.m11,.s5,48422703193487572952)], + .m .m5, + .b 48422703193487572958 [[([41],[(.D12,69175290276410818565),(.D8,1),(.D7,162129586585337852)])],[([3891110078048108422],[(.D17,69175290276410818561),(.D2,162129586585337850)])]], + .ms [(.m2,.s6,50368258232511627190),(.m3,.s6,68688901516654805008),(.m27,.s2,68688901516654805008),(.m1,.s5,50368258232511627184)], + .m .m5, + .b 50368258232511627190 [[([7],[(.D16,68688901516654805008), + (.D6,1)])], + [([16],[(.D11,68688901516654805006), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,68688901516654805005), + (.D17,1), + (.D15,0), + (.D6,310748374288564174)])], + [([16],[(.D11,68688901516654805003), + (.D3,0)])], + [([8],[(.D15,68688901516654805002), + (.D17,1), + (.D21,310748374288564173), + (.D15,3428365216335790090), + (.D17,5558849315058744888), + (.D15,3483886155491967088), + (.D17,320406484426948150), + (.D15,210987485277192304), + (.D17,18336555416419894), + (.D15,12764505364758640), + (.D17,1040481597259318), + (.D15,771393306230896), + (.D17,58433030061622), + (.D15,46562814197872), + (.D17,3239747518006), + (.D15,2807096672368), + (.D17,176714415670), + (.D15,169001091184), + (.D17,9434037814), + (.D15,10159915120), + (.D17,488963638), + (.D15,609828976), + (.D17,2141417014), + (.D15,616123504), + (.D17,25841974), + (.D15,36934960), + (.D17,1221478), + (.D15,2210236), + (.D17,1225143500), + (.D11,6304), + (.D12,9742)])], + [([18],[(.D11,68688901516654805000), + (.D13,0), + (.D16,310748374288564173), + (.D16,3428365216335790090)])], + [([9943947977234053572],[(.D17,68688901516654804999)]), + ([1242993497154256699,621496748577128351,310748374288564176,155374187144282088,77687093572141044,38843546786070519,19421773393035261,9710886696517632,4855443348258816,2427721674129408,1213860837064704,606930418532352,303465209266176,151732604633088,75866302316544,37933151158272,18966575579136,9483287789568,4741643894784,2370821947392,1185410973696,592705486848,296352743424,148176371712,74088185856,37044092928,18522046464,9261023232,4630511616,2315255808,1157627904,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,310748374288564174), + (.D17,3428365216335790090)]), + ([155374187144282087],[(.D6,5558849315058744888), + (.D16,3483886155491967088), + (.D6,320406484426948150), + (.D16,210987485277192304), + (.D6,18336555416419894), + (.D16,12764505364758640), + (.D6,1040481597259318), + (.D16,771393306230896), + (.D6,58433030061622), + (.D16,46562814197872), + (.D6,3239747518006), + (.D16,2807096672368), + (.D6,176714415670), + (.D16,169001091184), + (.D6,9434037814), + (.D16,10159915120), + (.D6,488963638), + (.D16,609828976), + (.D6,2141417014), + (.D16,616123504), + (.D6,25841974), + (.D16,36934960), + (.D6,1221478), + (.D16,2210236), + (.D6,1225143500), + (.D12,6305), + (.D13,9742), + (.D9,382), + (.D13,3)])], + [([10],[(.D17,67445908019500548303), + (.D21,0), + (.D19,3350678122763649046)])]], + .ms [(.m2,.s6,55340232221128654018),(.m3,.s6,67445908019500548301),(.m7,.s5,67445908019500548301),(.m4,.s5,55340232221128654012)], + .m .m5, + .b 55340232221128654018 [[([43],[(.D16,67445908019500548301),(.D8,1),(.D7,3350678122763649045)])],[([80416274946327577050],[(.D11,67445908019500548294),(.D2,3350678122763649043)])]], + .ms2 .s6 .s7 [(.m2,95548369694292442565,57393873651209601165)], + .ms [(.m29,.s2,57393873651209601165),(.m4,.s5,95548369694292442559)], + .m .m5, + .b 95548369694292442565 [[([9],[(.D6,57393873651209601165),(.D6,1)])],[([20],[(.D15,57393873651209601163),(.D13,0),(.D10,5539427541665709626),(.D9,3479030712143708272)])],[([36],[(.D11,57393873651209601159)]),([7,2],[(.D12,1),(.D6,5539427541665709626)])]], + .ms [(.m2,.s6,95548369694292442598),(.m6,.s6,57393873651209601155),(.m15,.s5,57393873651209601155),(.m11,.s5,95548369694292442592)], + .m .m5, + .b 95548369694292442598 [[([5],[(.D12,57393873651209601155),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,95548369694292442601,57393873651209601156)], + .ms [(.m23,.s1,57393873651209601156),(.m22,.s4,95548369694292442595)], + .m .m24, + .b 95548369694292442601 [[([17],[(.D6,57393873651209601156),(.D6,2)])],[([6],[(.D11,57393873651209601152),(.D21,0),(.D7,5539427541665709624)])]], + .ms2 .s6 .s7 [(.m2,95548369694292442613,57393873651209601153)], + .ms2 .s5 .s2 [(.m28,57393873651209601153,95548369694292442608)], + .m .m18, + .b 95548369694292442613 [[([45],[(.D6,57393873651209601153),(.D8,1),(.D17,5539427541665709623),(.D10,3479030712143708271)])],[([36],[(.D15,57393873651209601146)]),([7,2],[(.D12,1),(.D17,5539427541665709622)]),([1],[(.D11,3479030712143708271),(.D16,319192623589883446)])],[([8],[(.D15,57393873651209601142),(.D21,0),(.D17,5539427541665709621),(.D12,3479030712143708272)])]], + .ms [(.m2,.s6,95548369694292442658),(.m6,.s6,57393873651209601140),(.m7,.s5,57393873651209601140),(.m11,.s5,95548369694292442652)], + .m .m5, + .b 95548369694292442658 [[([39],[(.D12,57393873651209601140),(.D8,5539427541665709622),(.D13,3479030712143708272),(.D17,319192623589883446),(.D15,210684020067926128),(.D17,18260689114103350),(.D15,12745538789179504),(.D17,1035739953364534),(.D15,770207895257200),(.D17,58136677318198),(.D15,46488726012016),(.D17,3221225471542),(.D15,2802466160752),(.D17,175556787766),(.D15,168711684208),(.D17,9361686070),(.D15,10141827184),(.D17,484441654),(.D15,608698480),(.D17,2141134390),(.D15,616052848),(.D17,25824310),(.D15,36930544),(.D17,1220374),(.D15,2209960),(.D17,1225143431),(.D17,6289),(.D11,9737),(.D17,382),(.D15,3)])]], + .ms [(.m2,.s6,95548369694292442678)], + .ms2 .s6 .s7 [(.m3,57393873651209601136,5539427541665709622),(.m0,3479030712143708272,319192623589883446),(.m0,210684020067926128,18260689114103350),(.m0,12745538789179504,1035739953364534),(.m0,770207895257200,58136677318198),(.m0,46488726012016,3221225471542),(.m0,2802466160752,175556787766),(.m0,168711684208,9361686070),(.m0,10141827184,484441654),(.m0,608698480,2141134390),(.m0,616052848,25824310),(.m0,36930544,1220374),(.m0,2209960,1225143431)], + .ms [(.m3,.s6,6289)], + .ms2 .s6 .s7 [(.m6,9737,382)], + .ms2 .s3 .s0 [(.m19,382,9737)], + .ms [(.m17,.s0,6289)], + .ms2 .s3 .s0 [(.m4,1225143431,2209960),(.m1,1220374,36930544),(.m1,25824310,616052848),(.m1,2141134390,608698480),(.m1,484441654,10141827184),(.m1,9361686070,168711684208),(.m1,175556787766,2802466160752),(.m1,3221225471542,46488726012016),(.m1,58136677318198,770207895257200),(.m1,1035739953364534,12745538789179504),(.m1,18260689114103350,210684020067926128),(.m1,319192623589883446,3479030712143708272),(.m1,5539427541665709622,57393873651209601136)], + .ms [(.m1,.s3,95548369694292442672),(.m10,.s7,95548369694292442678),(.m8,.s2,95548369694292442673)], + .m .m9, + .b 0 [[([2918332558536081404],[(.D7,95548369694292442678),(.D17,57393873651209601136),(.D6,5539427541665709622),(.D16,3479030712143708272),(.D6,319192623589883446),(.D16,210684020067926128),(.D6,18260689114103350),(.D16,12745538789179504),(.D6,1035739953364534),(.D16,770207895257200),(.D6,58136677318198),(.D16,46488726012016),(.D6,3221225471542),(.D16,2802466160752),(.D6,175556787766),(.D16,168711684208),(.D6,9361686070),(.D16,10141827184),(.D6,484441654),(.D16,608698480),(.D6,2141134390),(.D16,616052848),(.D6,25824310),(.D16,36930544),(.D6,1220374),(.D16,2209960),(.D6,1225143431),(.D6,6289),(.D12,9737),(.D6,382),(.D16,4)])]], + .ms [(.m2,.s6,1459166279268040702),(.m3,.s6,95183578124475432502)], + .ms2 .s6 .s7 [(.m3,57302675758755348592,5516628068552146486),(.m0,3473330843865317488,317767656520285750),(.m0,210327778300526704,18171628672253494),(.m0,12723273678717040,1030173675748918),(.m0,768816325853296,57788784967222),(.m0,46401752924272,3199482199606),(.m0,2797030342768,174197833270),(.m0,168371945584,9276751414),(.m0,10120593520,479133238),(.m0,607371376,2140802614),(.m0,615969904,25803574),(.m0,36925360,1219078),(.m0,2209636,1225143350)], + .ms [(.m12,.s7,6267),(.m0,.s6,9733),(.m3,.s6,380),(.m20,.s0,380),(.m1,.s3,9733),(.m4,.s3,6267)], + .ms2 .s3 .s0 [(.m13,1225143350,2209636),(.m1,1219078,36925360),(.m1,25803574,615969904),(.m1,2140802614,607371376),(.m1,479133238,10120593520),(.m1,9276751414,168371945584),(.m1,174197833270,2797030342768),(.m1,3199482199606,46401752924272),(.m1,57788784967222,768816325853296),(.m1,1030173675748918,12723273678717040),(.m1,18171628672253494,210327778300526704),(.m1,317767656520285750,3473330843865317488),(.m1,5516628068552146486,57302675758755348592)], + .ms [(.m1,.s3,95183578124475432502),(.m4,.s3,1459166279268040696),(.m10,.s7,1459166279268040702),(.m8,.s2,1459166279268040697)], + .m .m9, + .b 0 [[([5836665117072162806,2918332558536081405,1459166279268040704,729583139634020352,364791569817010176,182395784908505088,91197892454252544,45598946227126272,22799473113563136,11399736556781568,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,1459166279268040702), + (.D17,95183578124475432502)]), + ([729583139634020350],[(.D16,57302675758755348592), + (.D6,5516628068552146486), + (.D16,3473330843865317488), + (.D6,317767656520285750), + (.D16,210327778300526704), + (.D6,18171628672253494), + (.D16,12723273678717040), + (.D6,1030173675748918), + (.D16,768816325853296), + (.D6,57788784967222), + (.D16,46401752924272), + (.D6,3199482199606), + (.D16,2797030342768), + (.D6,174197833270), + (.D16,168371945584), + (.D6,9276751414), + (.D16,10120593520), + (.D6,479133238), + (.D16,607371376), + (.D6,2140802614), + (.D16,615969904), + (.D6,25803574), + (.D16,36925360), + (.D6,1219078), + (.D16,2209636), + (.D6,1225143350), + (.D12,6267), + (.D16,9733), + (.D16,380), + (.D6,5)])]], + .ms [(.m2,.s6,5836665117072162805),(.m14,.s5,5836665117072162799)], + .m .m5, + .b 5836665117072162805 [[([5],[(.D18,1),(.D15,94818786554658422325),(.D14,57211477866301096048)])]], + .ms [(.m2,.s6,5836665117072162808),(.m7,.s5,5836665117072162802)], + .m .m5, + .b 5836665117072162808 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,5836665117072162809),(.m15,.s5,5836665117072162803)], + .m .m5, + .b 5836665117072162809 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,5836665117072162810),(.m25,.s2,5836665117072162805)], + .m .m18, + .b 5836665117072162810 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,5836665117072162812),(.m14,.s5,5836665117072162806)], + .m .m5, + .b 5836665117072162812 [[([5],[(.D18,1),(.D17,94818786554658422324),(.D15,57211477866301096048),(.D17,5493828595438583350),(.D15,3467630975586926704),(.D17,316342689450688054),(.D15,209971536533127280),(.D17,18082568230403638),(.D15,12701008568254576),(.D17,1024607398133302),(.D15,767424756449392),(.D17,57440892616246),(.D15,46314779836528),(.D17,3177738927670),(.D15,2791594524784),(.D17,172838878774),(.D15,168032206960),(.D17,9191816758),(.D15,10099359856),(.D17,473824822),(.D15,606044272),(.D17,2140470838),(.D15,615886960),(.D17,25782838),(.D15,36920176),(.D17,1217782),(.D15,2209312),(.D17,1225143269),(.D17,6248),(.D8,9727)])]], + .ms [(.m2,.s6,5836665117072162815),(.m7,.s5,5836665117072162809)], + .m .m5, + .b 5836665117072162815 [[([3999196469105000445],[(.D8,94818786554658422324),(.D16,57211477866301096048),(.D6,5493828595438583350),(.D16,3467630975586926704),(.D6,316342689450688054),(.D16,209971536533127280),(.D6,18082568230403638),(.D16,12701008568254576),(.D6,1024607398133302),(.D16,767424756449392),(.D6,57440892616246),(.D16,46314779836528),(.D6,3177738927670),(.D16,2791594524784),(.D6,172838878774),(.D16,168032206960),(.D6,9191816758),(.D16,10099359856),(.D6,473824822),(.D16,606044272),(.D6,2140470838),(.D16,615886960),(.D6,25782838),(.D16,36920176),(.D6,1217782),(.D16,2209312),(.D6,1225143269),(.D6,6249),(.D9,9727),(.D14,378),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,7836263351624663038,94318886996020297270),(.m0,57086502976641564784,5462584873023700534),(.m0,3459820044983206000,314389956799757878),(.m0,209483353370394736,17960522439720502),(.m0,12670497120583792,1016979536215606),(.m0,765517790969968,56964151246390),(.m0,46195594494064,3147942592054),(.m0,2784145440880,170976607798),(.m0,167566639216,9075424822),(.m0,10070261872,466550326),(.m0,604225648,2140016182),(.m0,615773296,25754422),(.m0,36913072,1216006),(.m0,2208868,1225143158)], + .ms [(.m12,.s7,6219),(.m0,.s6,9721),(.m3,.s6,377),(.m21,.s3,377),(.m4,.s3,9721),(.m4,.s3,6219)], + .ms2 .s3 .s0 [(.m13,1225143158,2208868),(.m1,1216006,36913072),(.m1,25754422,615773296),(.m1,2140016182,604225648),(.m1,466550326,10070261872),(.m1,9075424822,167566639216),(.m1,170976607798,2784145440880),(.m1,3147942592054,46195594494064),(.m1,56964151246390,765517790969968),(.m1,1016979536215606,12670497120583792),(.m1,17960522439720502,209483353370394736),(.m1,314389956799757878,3459820044983206000),(.m1,5462584873023700534,57086502976641564784),(.m1,94318886996020297270,7836263351624663033)], + .ms [(.m26,.s7,7836263351624663038),(.m8,.s2,7836263351624663033)], + .m .m9, + .b 0 [[([15996785876420001788],[(.D7,7836263351624663038),(.D7,94318886996020297269),(.D16,57086502976641564784),(.D6,5462584873023700534),(.D16,3459820044983206000),(.D6,314389956799757878),(.D16,209483353370394736),(.D6,17960522439720502),(.D16,12670497120583792),(.D6,1016979536215606),(.D16,765517790969968),(.D6,56964151246390),(.D16,46195594494064),(.D6,3147942592054),(.D16,2784145440880),(.D6,170976607798),(.D16,167566639216),(.D6,9075424822),(.D16,10070261872),(.D6,466550326),(.D16,604225648),(.D6,2140016182),(.D16,615773296),(.D6,25754422),(.D16,36913072),(.D6,1216006),(.D16,2208868),(.D6,1225143158),(.D12,6219),(.D16,9721),(.D16,377),(.D12,3)])]], + .ms [(.m2,.s6,7998392938210000894)], + .ms2 .s6 .s7 [(.m3,5836665117072162814,93818987437382172214),(.m0,56961528086982033520,5431341150608817718),(.m0,3452009114379485296,312437224148827702),(.m0,208995170207662192,17838476649037366),(.m0,12639985672913008,1009351674297910),(.m0,763610825490544,56487409876534),(.m0,46076409151600,3118146256438),(.m0,2776696356976,169114336822),(.m0,167101071472,8959032886),(.m0,10041163888,459275830),(.m0,602407024,2139561526),(.m0,615659632,25726006),(.m0,36905968,1214230),(.m0,2208424,1225143047)], + .ms [(.m3,.s6,6193)], + .ms2 .s6 .s7 [(.m6,9713,376)], + .ms2 .s3 .s0 [(.m19,376,9713)], + .ms [(.m17,.s0,6193)], + .ms2 .s3 .s0 [(.m4,1225143047,2208424),(.m1,1214230,36905968),(.m1,25726006,615659632),(.m1,2139561526,602407024),(.m1,459275830,10041163888),(.m1,8959032886,167101071472),(.m1,169114336822,2776696356976),(.m1,3118146256438,46076409151600),(.m1,56487409876534,763610825490544),(.m1,1009351674297910,12639985672913008),(.m1,17838476649037366,208995170207662192),(.m1,312437224148827702,3452009114379485296),(.m1,5431341150608817718,56961528086982033520),(.m1,93818987437382172214,5836665117072162814)], + .ms [(.m1,.s3,7998392938210000888),(.m10,.s7,7998392938210000894),(.m8,.s2,7998392938210000889)], + .m .m9, + .b 0 [[([31993571752840003574,14699749183737298950],[(.D7,7998392938210000894),(.D17,5836665117072162814)]),([2918332558536081407],[(.D6,93818987437382172214),(.D16,56961528086982033520),(.D6,5431341150608817718),(.D16,3452009114379485296),(.D6,312437224148827702),(.D16,208995170207662192),(.D6,17838476649037366),(.D16,12639985672913008),(.D6,1009351674297910),(.D16,763610825490544),(.D6,56487409876534),(.D16,46076409151600),(.D6,3118146256438),(.D16,2776696356976),(.D6,169114336822),(.D16,167101071472),(.D6,8959032886),(.D16,10041163888),(.D6,459275830),(.D16,602407024),(.D6,2139561526),(.D16,615659632),(.D6,25726006),(.D16,36905968),(.D6,1214230),(.D16,2208424),(.D6,1225143047),(.D6,6193),(.D12,9713),(.D6,376),(.D16,4)])]], + .ms [(.m2,.s6,23346660468288651262),(.m3,.s6,2161727821137838078)], + .ms2 .s6 .s7 [(.m3,4377498837804122110,93454195867565162038),(.m0,56870330194527780976,5408541677495254582),(.m0,3446309246101094512,311012257079230006),(.m0,208638928440262768,17749416207187510),(.m0,12617720562450544,1003785396682294),(.m0,762219256086640,56139517525558),(.m0,45989436063856,3096402984502),(.m0,2771260538992,167755382326),(.m0,166761332848,8874098230),(.m0,10019930224,453967414),(.m0,601079920,2139229750),(.m0,615576688,25705270),(.m0,36900784,1212934),(.m0,2208100,1225142966)], + .ms [(.m12,.s7,6171),(.m0,.s6,9709),(.m3,.s6,374),(.m20,.s0,374),(.m1,.s3,9709),(.m4,.s3,6171)], + .ms2 .s3 .s0 [(.m13,1225142966,2208100),(.m1,1212934,36900784),(.m1,25705270,615576688),(.m1,2139229750,601079920),(.m1,453967414,10019930224),(.m1,8874098230,166761332848),(.m1,167755382326,2771260538992),(.m1,3096402984502,45989436063856),(.m1,56139517525558,762219256086640)], + .m .m1, + ] (by decide +kernel) +theorem chunk_21_step : (cfg_21.denote) [qi]⊢* (cfg_22.denote) := + step_chunk [ + .s2 .s3 .s0 [(1003785396682294,12617720562450544)], + .ms2 .s3 .s0 [(.m1,17749416207187510,208638928440262768),(.m1,311012257079230006,3446309246101094512),(.m1,5408541677495254582,56870330194527780976),(.m1,93454195867565162038,4377498837804122110)], + .ms [(.m1,.s3,2161727821137838078),(.m4,.s3,23346660468288651256),(.m10,.s7,23346660468288651262),(.m8,.s2,23346660468288651257)], + .m .m9, + .b 0 [[([69175290276410818484],[(.D7,23346660468288651262)]), + ([8646911284551352310,4323455642275676159,2161727821137838080,1080863910568919040,540431955284459520,270215977642229760,135107988821114880,67553994410557440,33776997205278720,16888498602639360,8444249301319680,4222124650659840,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,2161727821137838078), + (.D16,4377498837804122110)]), + ([1080863910568919038],[(.D6,93454195867565162038), + (.D16,56870330194527780976), + (.D6,5408541677495254582), + (.D16,3446309246101094512), + (.D6,311012257079230006), + (.D16,208638928440262768), + (.D6,17749416207187510), + (.D16,12617720562450544), + (.D6,1003785396682294), + (.D16,762219256086640), + (.D6,56139517525558), + (.D16,45989436063856), + (.D6,3096402984502), + (.D16,2771260538992), + (.D6,167755382326), + (.D16,166761332848), + (.D6,8874098230), + (.D16,10019930224), + (.D6,453967414), + (.D16,601079920), + (.D6,2139229750), + (.D16,615576688), + (.D6,25705270), + (.D16,36900784), + (.D6,1212934), + (.D16,2208100), + (.D6,1225142966), + (.D12,6171), + (.D16,9709), + (.D16,374), + (.D6,5)])]], + .ms [(.m2,.s6,34587645138205409242),(.m3,.s6,14699749183737298951),(.m14,.s5,14699749183737298951),(.m4,.s5,34587645138205409236)], + .m .m5, + .b 34587645138205409242 [[([23],[(.D16,14699749183737298951),(.D18,1),(.D15,3837066882519662589),(.D16,93319087878744047158)])]], + .ms [(.m2,.s6,34587645138205409254),(.m3,.s6,14699749183737298948),(.m7,.s5,14699749183737298948),(.m4,.s5,34587645138205409248)], + .m .m5, + .b 34587645138205409254 [[([7],[(.D16,14699749183737298948),(.D6,1)])]], + .ms [(.m2,.s6,34587645138205409258),(.m6,.s6,14699749183737298946),(.m15,.s5,14699749183737298946),(.m11,.s5,34587645138205409252)], + .m .m5, + .b 34587645138205409258 [[([5],[(.D12,14699749183737298946),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,34587645138205409261,14699749183737298947)], + .ms [(.m23,.s1,14699749183737298947),(.m22,.s4,34587645138205409255)], + .m .m24, + .b 34587645138205409261 [[([17],[(.D6,14699749183737298947),(.D6,2)])]], + .ms [(.m2,.s6,34587645138205409270),(.m6,.s6,14699749183737298943),(.m14,.s5,14699749183737298943),(.m11,.s5,34587645138205409264)], + .m .m5, + .b 34587645138205409270 [[([23],[(.D12,14699749183737298943),(.D18,1),(.D17,3837066882519662588),(.D17,93319087878744047158),(.D15,56836553197322502256),(.D17,5400097428193934902),(.D15,3444198183775764592),(.D17,310484491497897526),(.D15,208506987044929648),(.D17,17716430858354230),(.D15,12609474225242224),(.D17,1001723812380214),(.D15,761703860011120),(.D17,56010668506678),(.D15,45957223809136),(.D17,3088349920822),(.D15,2769247273072),(.D17,167252065846),(.D15,166635503728),(.D17,8842640950),(.D15,10012065904),(.D17,452001334),(.D15,600588400),(.D17,2139106870),(.D15,615545968),(.D17,25697590),(.D15,36898864),(.D17,1212454),(.D15,2207980),(.D17,1225142936),(.D11,6163),(.D6,9708)])]], + .ms [(.m2,.s6,34587645138205409282),(.m6,.s6,14699749183737298940),(.m7,.s5,14699749183737298940),(.m11,.s5,34587645138205409276)], + .m .m5, + .b 34587645138205409282 [[([58798996734949195761,29399498367474597885,5188146770730811401],[(.D12,14699749183737298940),(.D8,3837066882519662588),(.D6,93319087878744047158)]),([1459166279268040703],[(.D16,56836553197322502256),(.D6,5400097428193934902),(.D16,3444198183775764592),(.D6,310484491497897526),(.D16,208506987044929648),(.D6,17716430858354230),(.D16,12609474225242224),(.D6,1001723812380214),(.D16,761703860011120),(.D6,56010668506678),(.D16,45957223809136),(.D6,3088349920822),(.D16,2769247273072),(.D6,167252065846),(.D16,166635503728),(.D6,8842640950),(.D16,10012065904),(.D6,452001334),(.D16,600588400),(.D6,2139106870),(.D16,615545968),(.D6,25697590),(.D16,36898864),(.D6,1212454),(.D16,2207980),(.D6,1225142936),(.D12,6164),(.D7,9707),(.D8,373),(.D7,4)])]], + .ms [(.m2,.s6,81280966074782711806)], + .ms2 .s6 .s7 [(.m3,3026418949592973310,918734323983581182)], + .ms [(.m3,.s6,92589504739110026806)], + .ms2 .s6 .s7 [(.m3,56654157412413997168,5354498481966808630),(.m0,3432798447218983024,307634557358702134),(.m0,207794503510130800,17538309974654518),(.m0,12564944004317296,990591257148982),(.m0,758920721203312,55314883804726),(.m0,45783277633648,3044863376950),(.m0,2758375637104,164534156854),(.m0,165956026480,8672771638),(.m0,9969598576,441384502),(.m0,597934192,2138443318),(.m0,615380080,25656118),(.m0,36888496,1209862),(.m0,2207332,1225142774)], + .ms [(.m12,.s7,6123),(.m0,.s6,9697),(.m3,.s6,371),(.m21,.s3,371),(.m4,.s3,9697),(.m4,.s3,6123)], + .ms2 .s3 .s0 [(.m13,1225142774,2207332),(.m1,1209862,36888496),(.m1,25656118,615380080),(.m1,2138443318,597934192),(.m1,441384502,9969598576),(.m1,8672771638,165956026480),(.m1,164534156854,2758375637104),(.m1,3044863376950,45783277633648),(.m1,55314883804726,758920721203312),(.m1,990591257148982,12564944004317296),(.m1,17538309974654518,207794503510130800),(.m1,307634557358702134,3432798447218983024),(.m1,5354498481966808630,56654157412413997168),(.m1,92589504739110026806,918734323983581182)], + .ms [(.m4,.s3,3026418949592973310),(.m4,.s3,81280966074782711800),(.m10,.s7,81280966074782711806),(.m8,.s2,81280966074782711801)], + .m .m9, + .b 0 [[([96845406386975145908],[(.D7,81280966074782711806)]), + ([12105675798371893238,6052837899185946623,3026418949592973312,1513209474796486656,756604737398243328,378302368699121664,189151184349560832,94575592174780416,47287796087390208,23643898043695104,11821949021847552,5910974510923776,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,3026418949592973310), + (.D6,918734323983581182), + (.D6,92589504739110026806)]), + ([378302368699121663],[(.D16,56654157412413997168), + (.D6,5354498481966808630), + (.D16,3432798447218983024), + (.D6,307634557358702134), + (.D16,207794503510130800), + (.D6,17538309974654518), + (.D16,12564944004317296), + (.D6,990591257148982), + (.D16,758920721203312), + (.D6,55314883804726), + (.D16,45783277633648), + (.D6,3044863376950), + (.D16,2758375637104), + (.D6,164534156854), + (.D16,165956026480), + (.D6,8672771638), + (.D16,9969598576), + (.D6,441384502), + (.D16,597934192), + (.D6,2138443318), + (.D16,615380080), + (.D6,25656118), + (.D16,36888496), + (.D6,1209862), + (.D16,2207332), + (.D6,1225142774), + (.D12,6123), + (.D16,9697), + (.D16,371), + (.D12,3)])], + [([8],[(.D15,69175290276410818567), + (.D21,0), + (.D19,162129586585337853)])]], + .ms [(.m2,.s6,48422703193487572958),(.m6,.s6,69175290276410818565),(.m7,.s5,69175290276410818565),(.m11,.s5,48422703193487572952)], + .m .m5, + .b 48422703193487572958 [[([41],[(.D12,69175290276410818565),(.D8,1),(.D7,162129586585337852)])],[([3891110078048108422],[(.D17,69175290276410818561),(.D2,162129586585337850)])]], + .ms [(.m2,.s6,50368258232511627190),(.m3,.s6,68688901516654805008),(.m27,.s2,68688901516654805008),(.m1,.s5,50368258232511627184)], + .m .m5, + .b 50368258232511627190 [[([7],[(.D16,68688901516654805008), + (.D6,1)])], + [([16],[(.D11,68688901516654805006), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,68688901516654805005), + (.D17,1), + (.D15,0), + (.D6,92400353554760465974)])], + [([16],[(.D11,68688901516654805003), + (.D3,0)])], + [([8],[(.D15,68688901516654805002), + (.D17,1), + (.D21,92400353554760465973), + (.D15,56606869616326606960), + (.D17,5342676532944961078), + (.D15,3429842959963521136), + (.D17,306895685544836662), + (.D15,207609785556664432), + (.D17,17492130486287926), + (.D15,12553399132225648), + (.D17,987705039126070), + (.D15,758199166697584), + (.D17,55134495178294), + (.D15,45738180477040), + (.D17,3033589087798), + (.D15,2755557064816), + (.D17,163829513782), + (.D15,165779865712), + (.D17,8628731446), + (.D15,9958588528), + (.D17,438631990), + (.D15,597246064), + (.D17,2138271286), + (.D15,615337072), + (.D17,25645366), + (.D15,36885808), + (.D17,1209190), + (.D15,2207164), + (.D17,1225142732), + (.D11,6112), + (.D12,9694)])], + [([18],[(.D11,68688901516654805000), + (.D13,0), + (.D16,92400353554760465973), + (.D16,56606869616326606960)])], + [([9943947977234055142],[(.D17,68688901516654804999), + (.D12,92400353554760465974), + (.D17,56606869616326606960), + (.D6,5342676532944961078), + (.D16,3429842959963521136), + (.D6,306895685544836662), + (.D16,207609785556664432), + (.D6,17492130486287926), + (.D16,12553399132225648), + (.D6,987705039126070), + (.D16,758199166697584), + (.D6,55134495178294), + (.D16,45738180477040), + (.D6,3033589087798), + (.D16,2755557064816), + (.D6,163829513782), + (.D16,165779865712), + (.D6,8628731446), + (.D16,9958588528), + (.D6,438631990), + (.D16,597246064), + (.D6,2138271286), + (.D16,615337072), + (.D6,25645366), + (.D16,36885808), + (.D6,1209190), + (.D16,2207164), + (.D6,1225142732), + (.D12,6113), + (.D13,9694), + (.D9,370), + (.D13,3)])]], + .ms [(.m2,.s6,55340232221128654798)], + .ms2 .s6 .s7 [(.m3,67445908019500548106,92089605180471901752),(.m0,56529182522754465904,5323254759551925814),(.m0,3424987516615262320,305681824707771958),(.m0,207306320347398256,17416264183971382),(.m0,12534432556646512,982963395231286),(.m0,757013755723888,54838142434870),(.m0,45664092291184,3015067041334),(.m0,2750926553200,162671885878),(.m0,165490458736,8556379702),(.m0,9940500592,434110006),(.m0,596115568,2137988662),(.m0,615266416,25627702),(.m0,36881392,1208086),(.m0,2206888,1225142663)], + .ms [(.m3,.s6,6097)], + .ms2 .s6 .s7 [(.m6,9689,370)], + .ms2 .s3 .s0 [(.m19,370,9689)], + .ms [(.m17,.s0,6097)], + .ms2 .s3 .s0 [(.m4,1225142663,2206888),(.m1,1208086,36881392),(.m1,25627702,615266416),(.m1,2137988662,596115568),(.m1,434110006,9940500592),(.m1,8556379702,165490458736),(.m1,162671885878,2750926553200),(.m1,3015067041334,45664092291184),(.m1,54838142434870,757013755723888),(.m1,982963395231286,12534432556646512),(.m1,17416264183971382,207306320347398256),(.m1,305681824707771958,3424987516615262320),(.m1,5323254759551925814,56529182522754465904),(.m1,92089605180471901752,67445908019500548106)], + .ms [(.m1,.s3,55340232221128654792),(.m10,.s7,55340232221128654798),(.m8,.s2,55340232221128654793)], + .m .m9, + .b 0 [[([46693320936577302524],[(.D7,55340232221128654798),(.D17,67445908019500548106),(.D6,92089605180471901752),(.D16,56529182522754465904),(.D6,5323254759551925814),(.D16,3424987516615262320),(.D6,305681824707771958),(.D16,207306320347398256),(.D6,17416264183971382),(.D16,12534432556646512),(.D6,982963395231286),(.D16,757013755723888),(.D6,54838142434870),(.D16,45664092291184),(.D6,3015067041334),(.D16,2750926553200),(.D6,162671885878),(.D16,165490458736),(.D6,8556379702),(.D16,9940500592),(.D6,434110006),(.D16,596115568),(.D6,2137988662),(.D16,615266416),(.D6,25627702),(.D16,36881392),(.D6,1208086),(.D16,2206888),(.D6,1225142663),(.D6,6097),(.D12,9689),(.D6,370),(.D16,4)])]], + .ms [(.m2,.s6,23346660468288651262),(.m3,.s6,49503567104056491982)], + .ms2 .s6 .s7 [(.m3,65986741740232507402,91724813610654891576),(.m0,56437984630300213360,5300455286438362678),(.m0,3419287648336871536,304256857638174262),(.m0,206950078579998832,17327203742121526),(.m0,12512167446184048,977397117615670),(.m0,755622186319984,54490250083894),(.m0,45577119203440,2993323769398),(.m0,2745490735216,161312931382),(.m0,165150720112,8471445046),(.m0,9919266928,428801590),(.m0,594788464,2137656886),(.m0,615183472,25606966),(.m0,36876208,1206790),(.m0,2206564,1225142582)], + .ms [(.m12,.s7,6075),(.m0,.s6,9685),(.m3,.s6,368),(.m20,.s0,368),(.m1,.s3,9685),(.m4,.s3,6075)], + .ms2 .s3 .s0 [(.m13,1225142582,2206564),(.m1,1206790,36876208),(.m1,25606966,615183472),(.m1,2137656886,594788464),(.m1,428801590,9919266928),(.m1,8471445046,165150720112),(.m1,161312931382,2745490735216),(.m1,2993323769398,45577119203440),(.m1,54490250083894,755622186319984),(.m1,977397117615670,12512167446184048),(.m1,17327203742121526,206950078579998832),(.m1,304256857638174262,3419287648336871536),(.m1,5300455286438362678,56437984630300213360),(.m1,91724813610654891576,65986741740232507402)], + .ms [(.m1,.s3,49503567104056491982),(.m4,.s3,23346660468288651256),(.m10,.s7,23346660468288651262),(.m8,.s2,23346660468288651257)], + .m .m9, + .b 0 [[([93386641873154605046,46693320936577302525,23346660468288651264,11673330234144325632,5836665117072162816,2918332558536081408,1459166279268040704,729583139634020352,364791569817010176,182395784908505088,91197892454252544,45598946227126272,22799473113563136,11399736556781568,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,23346660468288651262), + (.D17,49503567104056491982)]), + ([11673330234144325630],[(.D16,65986741740232507402), + (.D6,91724813610654891576), + (.D16,56437984630300213360), + (.D6,5300455286438362678), + (.D16,3419287648336871536), + (.D6,304256857638174262), + (.D16,206950078579998832), + (.D6,17327203742121526), + (.D16,12512167446184048), + (.D6,977397117615670), + (.D16,755622186319984), + (.D6,54490250083894), + (.D16,45577119203440), + (.D6,2993323769398), + (.D16,2745490735216), + (.D6,161312931382), + (.D16,165150720112), + (.D6,8471445046), + (.D16,9919266928), + (.D6,428801590), + (.D16,594788464), + (.D6,2137656886), + (.D16,615183472), + (.D6,25606966), + (.D16,36876208), + (.D6,1206790), + (.D16,2206564), + (.D6,1225142582), + (.D12,6075), + (.D16,9685), + (.D16,368), + (.D6,5)])]], + .ms [(.m2,.s6,93386641873154605045),(.m14,.s5,93386641873154605039)], + .m .m5, + .b 93386641873154605045 [[([5],[(.D18,1),(.D15,43666901986984329165),(.D14,64527575460964466698)])]], + .ms [(.m2,.s6,93386641873154605048),(.m7,.s5,93386641873154605042)], + .m .m5, + .b 93386641873154605048 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,93386641873154605049),(.m15,.s5,93386641873154605043)], + .m .m5, + .b 93386641873154605049 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,93386641873154605050),(.m25,.s2,93386641873154605045)], + .m .m18, + .b 93386641873154605050 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,93386641873154605052),(.m14,.s5,93386641873154605046)], + .m .m5, + .b 93386641873154605052 [[([5],[(.D18,1),(.D17,43666901986984329164),(.D15,64527575460964466698),(.D17,91360022040837881400),(.D15,56346786737845960816),(.D17,5277655813324799542),(.D15,3413587780058480752),(.D17,302831890568576566),(.D15,206593836812599408),(.D17,17238143300271670),(.D15,12489902335721584),(.D17,971830840000054),(.D15,754230616916080),(.D17,54142357732918),(.D15,45490146115696),(.D17,2971580497462),(.D15,2740054917232),(.D17,159953976886),(.D15,164810981488),(.D17,8386510390),(.D15,9898033264),(.D17,423493174),(.D15,593461360),(.D17,2137325110),(.D15,615100528),(.D17,25586230),(.D15,36871024),(.D17,1205494),(.D15,2206240),(.D17,1225142501),(.D17,6056),(.D8,9679)])]], + .ms [(.m2,.s6,93386641873154605055),(.m7,.s5,93386641873154605049)], + .m .m5, + .b 93386641873154605055 [[([63987143505680007165],[(.D8,43666901986984329164),(.D16,64527575460964466698),(.D6,91360022040837881400),(.D16,56346786737845960816),(.D6,5277655813324799542),(.D16,3413587780058480752),(.D6,302831890568576566),(.D16,206593836812599408),(.D6,17238143300271670),(.D16,12489902335721584),(.D6,971830840000054),(.D16,754230616916080),(.D6,54142357732918),(.D16,45490146115696),(.D6,2971580497462),(.D16,2740054917232),(.D6,159953976886),(.D16,164810981488),(.D6,8386510390),(.D16,9898033264),(.D6,423493174),(.D16,593461360),(.D6,2137325110),(.D16,615100528),(.D6,25586230),(.D16,36871024),(.D6,1205494),(.D16,2206240),(.D6,1225142501),(.D6,6057),(.D9,9679),(.D14,366),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,125380213625994608638,35668509048774328270),(.m0,62527977226411966474,90860122482199756344),(.m0,56221811848186429552,5246412090909916726),(.m0,3405776849454760048,300879157917646390),(.m0,206105653649866864,17116097509588534),(.m0,12459390888050800,964202978082358),(.m0,752323651436656,53665616363062),(.m0,45370960773232,2941784161846),(.m0,2732605833328,158091705910),(.m0,164345413744,8270118454),(.m0,9868935280,416218678),(.m0,591642736,2136870454),(.m0,614986864,25557814),(.m0,36863920,1203718),(.m0,2205796,1225142390)], + .ms [(.m12,.s7,6027),(.m0,.s6,9673),(.m3,.s6,365),(.m21,.s3,365),(.m4,.s3,9673),(.m4,.s3,6027)], + .ms2 .s3 .s0 [(.m13,1225142390,2205796),(.m1,1203718,36863920),(.m1,25557814,614986864),(.m1,2136870454,591642736),(.m1,416218678,9868935280),(.m1,8270118454,164345413744),(.m1,158091705910,2732605833328),(.m1,2941784161846,45370960773232),(.m1,53665616363062,752323651436656),(.m1,964202978082358,12459390888050800),(.m1,17116097509588534,206105653649866864),(.m1,300879157917646390,3405776849454760048),(.m1,5246412090909916726,56221811848186429552),(.m1,90860122482199756344,62527977226411966474),(.m1,35668509048774328270,125380213625994608633)], + .ms [(.m26,.s7,125380213625994608638),(.m8,.s2,125380213625994608633)], + .m .m9, + .b 0 [[([255948574022720028668],[(.D7,125380213625994608638),(.D7,35668509048774328269),(.D16,62527977226411966474),(.D6,90860122482199756344),(.D16,56221811848186429552),(.D6,5246412090909916726),(.D16,3405776849454760048),(.D6,300879157917646390),(.D16,206105653649866864),(.D6,17116097509588534),(.D16,12459390888050800),(.D6,964202978082358),(.D16,752323651436656),(.D6,53665616363062),(.D16,45370960773232),(.D6,2941784161846),(.D16,2732605833328),(.D6,158091705910),(.D16,164345413744),(.D6,8270118454),(.D16,9868935280),(.D6,416218678),(.D16,591642736),(.D6,2136870454),(.D16,614986864),(.D6,25557814),(.D16,36863920),(.D6,1203718),(.D16,2205796),(.D6,1225142390),(.D12,6027),(.D16,9673),(.D16,365),(.D12,3)])]], + .ms [(.m2,.s6,127974287011360014334)], + .ms2 .s6 .s7 [(.m3,93386641873154605054,27670116110564327374),(.m0,60528378991859466250,90360222923561631288),(.m0,56096836958526898288,5215168368495033910),(.m0,3397965918851039344,298926425266716214),(.m0,205617470487134320,16994051718905398),(.m0,12428879440380016,956575116164662),(.m0,750416685957232,53188874993206),(.m0,45251775430768,2911987826230),(.m0,2725156749424,156229434934),(.m0,163879846000,8153726518),(.m0,9839837296,408944182),(.m0,589824112,2136415798),(.m0,614873200,25529398),(.m0,36856816,1201942),(.m0,2205352,1225142279)], + .ms [(.m3,.s6,6001)], + .ms2 .s6 .s7 [(.m6,9665,364)], + .ms2 .s3 .s0 [(.m19,364,9665)], + .ms [(.m17,.s0,6001)], + .ms2 .s3 .s0 [(.m4,1225142279,2205352),(.m1,1201942,36856816),(.m1,25529398,614873200),(.m1,2136415798,589824112),(.m1,408944182,9839837296),(.m1,8153726518,163879846000),(.m1,156229434934,2725156749424),(.m1,2911987826230,45251775430768),(.m1,53188874993206,750416685957232),(.m1,956575116164662,12428879440380016),(.m1,16994051718905398,205617470487134320),(.m1,298926425266716214,3397965918851039344),(.m1,5215168368495033910,56096836958526898288),(.m1,90360222923561631288,60528378991859466250),(.m1,27670116110564327374,93386641873154605054)], + .ms [(.m1,.s3,127974287011360014328),(.m10,.s7,127974287011360014334),(.m8,.s2,127974287011360014329)], + .m .m9, + .b 0 [[([511897148045440057334,235195986939796783110],[(.D7,127974287011360014334),(.D17,93386641873154605054)]),([46693320936577302527],[(.D6,27670116110564327374),(.D16,60528378991859466250),(.D6,90360222923561631288),(.D16,56096836958526898288),(.D6,5215168368495033910),(.D16,3397965918851039344),(.D6,298926425266716214),(.D16,205617470487134320),(.D6,16994051718905398),(.D16,12428879440380016),(.D6,956575116164662),(.D16,750416685957232),(.D6,53188874993206),(.D16,45251775430768),(.D6,2911987826230),(.D16,2725156749424),(.D6,156229434934),(.D16,163879846000),(.D6,8153726518),(.D16,9839837296),(.D6,408944182),(.D16,589824112),(.D6,2136415798),(.D16,614873200),(.D6,25529398),(.D16,36856816),(.D6,1201942),(.D16,2205352),(.D6,1225142279),(.D6,6001),(.D12,9665),(.D6,364),(.D16,4)])]], + .ms [(.m2,.s6,373546567492618420222),(.m3,.s6,34587645138205409278)], + .ms2 .s6 .s7 [(.m3,70039981404865953790,21833450993492164558),(.m0,59069212712591425546,89995431353744621112),(.m0,56005639066072645744,5192368895381470774),(.m0,3392266050572648560,297501458197118518),(.m0,205261228719734896,16904991277055542),(.m0,12406614329917552,951008838549046),(.m0,749025116553328,52840982642230),(.m0,45164802343024,2890244554294),(.m0,2719720931440,154870480438),(.m0,163540107376,8068791862),(.m0,9818603632,403635766),(.m0,588497008,2136084022),(.m0,614790256,25508662),(.m0,36851632,1200646),(.m0,2205028,1225142198)], + .ms [(.m12,.s7,5979),(.m0,.s6,9661),(.m3,.s6,362),(.m20,.s0,362),(.m1,.s3,9661),(.m4,.s3,5979)], + .ms2 .s3 .s0 [(.m13,1225142198,2205028),(.m1,1200646,36851632),(.m1,25508662,614790256),(.m1,2136084022,588497008),(.m1,403635766,9818603632),(.m1,8068791862,163540107376),(.m1,154870480438,2719720931440),(.m1,2890244554294,45164802343024),(.m1,52840982642230,749025116553328),(.m1,951008838549046,12406614329917552),(.m1,16904991277055542,205261228719734896),(.m1,297501458197118518,3392266050572648560),(.m1,5192368895381470774,56005639066072645744),(.m1,89995431353744621112,59069212712591425546),(.m1,21833450993492164558,70039981404865953790)], + .ms [(.m1,.s3,34587645138205409278),(.m4,.s3,373546567492618420216),(.m10,.s7,373546567492618420222),(.m8,.s2,373546567492618420217)], + .m .m9, + .b 0 [[([1106804644422573096884],[(.D7,373546567492618420222)]), + ([138350580552821637110,69175290276410818559,34587645138205409280,17293822569102704640,8646911284551352320,4323455642275676160,2161727821137838080,1080863910568919040,540431955284459520,270215977642229760,135107988821114880,67553994410557440,33776997205278720,16888498602639360,8444249301319680,4222124650659840,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,34587645138205409278), + (.D16,70039981404865953790)]), + ([17293822569102704638],[(.D6,21833450993492164558), + (.D16,59069212712591425546), + (.D6,89995431353744621112), + (.D16,56005639066072645744), + (.D6,5192368895381470774), + (.D16,3392266050572648560), + (.D6,297501458197118518), + (.D16,205261228719734896), + (.D6,16904991277055542), + (.D16,12406614329917552), + (.D6,951008838549046), + (.D16,749025116553328), + (.D6,52840982642230), + (.D16,45164802343024), + (.D6,2890244554294), + (.D16,2719720931440), + (.D6,154870480438), + (.D16,163540107376), + (.D6,8068791862), + (.D16,9818603632), + (.D6,403635766), + (.D16,588497008), + (.D6,2136084022), + (.D16,614790256), + (.D6,25508662), + (.D16,36851632), + (.D6,1200646), + (.D16,2205028), + (.D6,1225142198), + (.D12,5979), + (.D16,9661), + (.D16,362), + (.D6,5)])]], + .ms [(.m2,.s6,553402322211286548442),(.m3,.s6,235195986939796783111),(.m14,.s5,235195986939796783111),(.m4,.s5,553402322211286548436)], + .m .m5, + .b 553402322211286548442 [[([23],[(.D16,235195986939796783111),(.D18,1),(.D15,61393070120314601469),(.D16,19671723172354326478)])]], + .ms [(.m2,.s6,553402322211286548454),(.m3,.s6,235195986939796783108),(.m7,.s5,235195986939796783108),(.m4,.s5,553402322211286548448)], + .m .m5, + .b 553402322211286548454 [[([7],[(.D16,235195986939796783108),(.D6,1)])]], + .ms [(.m2,.s6,553402322211286548458),(.m6,.s6,235195986939796783106),(.m15,.s5,235195986939796783106),(.m11,.s5,553402322211286548452)], + .m .m5, + .b 553402322211286548458 [[([5],[(.D12,235195986939796783106),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,553402322211286548461,235195986939796783107)], + .ms [(.m23,.s1,235195986939796783107),(.m22,.s4,553402322211286548455)], + .m .m24, + .b 553402322211286548461 [[([17],[(.D6,235195986939796783107),(.D6,2)])]], + .ms [(.m2,.s6,553402322211286548470),(.m6,.s6,235195986939796783103),(.m14,.s5,235195986939796783103),(.m11,.s5,553402322211286548464)], + .m .m5, + .b 553402322211286548470 [[([23],[(.D12,235195986939796783103),(.D18,1),(.D17,61393070120314601468),(.D17,19671723172354326478),(.D15,58528780757306966026),(.D17,89860323364923506232),(.D15,55971862068867367024),(.D17,5183924646080151094),(.D15,3390154988247318640),(.D17,296973692615786038),(.D15,205129287324401776),(.D17,16872005928222262),(.D15,12398367992709232),(.D17,948947254246966),(.D15,748509720477808),(.D17,52712133623350),(.D15,45132590088304),(.D17,2882191490614),(.D15,2717707665520),(.D17,154367163958),(.D15,163414278256),(.D17,8037334582),(.D15,9810739312),(.D17,401669686),(.D15,588005488),(.D17,2135961142),(.D15,614759536),(.D17,25500982),(.D15,36849712),(.D17,1200166),(.D15,2204908),(.D17,1225142168),(.D11,5971),(.D6,9660)])]], + .ms [(.m2,.s6,553402322211286548482),(.m6,.s6,235195986939796783100),(.m7,.s5,235195986939796783100),(.m11,.s5,553402322211286548476)], + .m .m5, + .b 553402322211286548482 [[([940783947759187132401,470391973879593566205,83010348331692982281],[(.D12,235195986939796783100),(.D8,61393070120314601468),(.D6,19671723172354326478),(.D16,58528780757306966026)]),([5836665117072162815],[(.D6,89860323364923506232),(.D16,55971862068867367024),(.D6,5183924646080151094),(.D16,3390154988247318640),(.D6,296973692615786038),(.D16,205129287324401776),(.D6,16872005928222262),(.D16,12398367992709232),(.D6,948947254246966),(.D16,748509720477808),(.D6,52712133623350),(.D16,45132590088304),(.D6,2882191490614),(.D16,2717707665520),(.D6,154367163958),(.D16,163414278256),(.D6,8037334582),(.D16,9810739312),(.D6,401669686),(.D16,588005488),(.D6,2135961142),(.D16,614759536),(.D6,25500982),(.D16,36849712),(.D6,1200166),(.D16,2204908),(.D6,1225142168),(.D12,5972),(.D7,9659),(.D8,361),(.D7,4)])]], + .ms [(.m2,.s6,1300495457196523388926)], + .ms2 .s6 .s7 [(.m3,48422703193487572990,14699749183737298942)], + .ms [(.m3,.s6,7998392938210000846)], + .ms2 .s6 .s7 [(.m3,55610448198770884618,89130740225289485880),(.m0,55789466283958861936,5138325699853024822),(.m0,3378755251690537072,294123758476590646),(.m0,204416803789602928,16693885044522550),(.m0,12353837771784304,937814699015734),(.m0,745726581670000,52016348921398),(.m0,44958643912816,2838704946742),(.m0,2706836029552,151649254966),(.m0,162734801008,7867465270),(.m0,9768271984,391052854),(.m0,585351280,2135297590),(.m0,614593648,25459510),(.m0,36839344,1197574),(.m0,2204260,1225142006)], + .ms [(.m12,.s7,5931),(.m0,.s6,9649),(.m3,.s6,359),(.m21,.s3,359),(.m4,.s3,9649),(.m4,.s3,5931)], + .ms2 .s3 .s0 [(.m13,1225142006,2204260),(.m1,1197574,36839344),(.m1,25459510,614593648),(.m1,2135297590,585351280),(.m1,391052854,9768271984),(.m1,7867465270,162734801008),(.m1,151649254966,2706836029552),(.m1,2838704946742,44958643912816),(.m1,52016348921398,745726581670000),(.m1,937814699015734,12353837771784304),(.m1,16693885044522550,204416803789602928),(.m1,294123758476590646,3378755251690537072),(.m1,5138325699853024822,55789466283958861936),(.m1,89130740225289485880,55610448198770884618),(.m1,7998392938210000846,14699749183737298942)], + .ms [(.m4,.s3,48422703193487572990),(.m4,.s3,1300495457196523388920),(.m10,.s7,1300495457196523388926),(.m8,.s2,1300495457196523388921)], + .m .m9, + .b 0 [[([1549526502191602335668],[(.D7,1300495457196523388926)]), + ([193690812773950291958,96845406386975145983,48422703193487572992,24211351596743786496,12105675798371893248,6052837899185946624,3026418949592973312,1513209474796486656,756604737398243328,378302368699121664,189151184349560832,94575592174780416,47287796087390208,23643898043695104,11821949021847552,5910974510923776,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,48422703193487572990), + (.D6,14699749183737298942), + (.D6,7998392938210000846)]), + ([6052837899185946623],[(.D16,55610448198770884618), + (.D6,89130740225289485880), + (.D16,55789466283958861936), + (.D6,5138325699853024822), + (.D16,3378755251690537072), + (.D6,294123758476590646), + (.D16,204416803789602928), + (.D6,16693885044522550), + (.D16,12353837771784304), + (.D6,937814699015734), + (.D16,745726581670000), + (.D6,52016348921398), + (.D16,44958643912816), + (.D6,2838704946742), + (.D16,2706836029552), + (.D6,151649254966), + (.D16,162734801008), + (.D6,7867465270), + (.D16,9768271984), + (.D6,391052854), + (.D16,585351280), + (.D6,2135297590), + (.D16,614593648), + (.D6,25459510), + (.D16,36839344), + (.D6,1197574), + (.D16,2204260), + (.D6,1225142006), + (.D12,5931), + (.D16,9649), + (.D16,359), + (.D12,3)])], + [([8],[(.D15,1106804644422573096967), + (.D21,0), + (.D19,2594073385365405693)])]], + .ms [(.m2,.s6,774763251095801167838),(.m6,.s6,1106804644422573096965),(.m7,.s5,1106804644422573096965)], + .m .m85, + ] (by decide +kernel) +theorem chunk_22_step : (cfg_22.denote) [qi]⊢* (cfg_23.denote) := + step_chunk [ + .ms [(.m4,.s5,774763251095801167832)], + .m .m5, + .b 774763251095801167838 [[([41],[(.D12,1106804644422573096965),(.D8,1),(.D7,2594073385365405692)])],[([62257761248769736582],[(.D17,1106804644422573096961),(.D2,2594073385365405690)])]], + .ms [(.m2,.s6,805892131720186036150),(.m3,.s6,1099022424266476879888),(.m27,.s2,1099022424266476879888),(.m1,.s5,805892131720186036144)], + .m .m5, + .b 805892131720186036150 [[([7],[(.D16,1099022424266476879888), + (.D6,1)])], + [([16],[(.D11,1099022424266476879886), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,1099022424266476879885), + (.D17,1), + (.D15,0), + (.D6,4971973988617027534)])], + [([16],[(.D11,1099022424266476879883), + (.D3,0)])], + [([8],[(.D15,1099022424266476879882), + (.D17,1), + (.D21,4971973988617027533), + (.D15,54853843461372641290), + (.D17,88941589040939925048), + (.D15,55742178487871471728), + (.D17,5126503750831177270), + (.D15,3375799764435075184), + (.D17,293384886662725174), + (.D15,204232085836136560), + (.D17,16647705556155958), + (.D15,12342292899692656), + (.D17,934928480992822), + (.D15,745005027164272), + (.D17,51835960294966), + (.D15,44913546756208), + (.D17,2827430657590), + (.D15,2704017457264), + (.D17,150944611894), + (.D15,162558640240), + (.D17,7823425078), + (.D15,9757261936), + (.D17,388300342), + (.D15,584663152), + (.D17,2135125558), + (.D15,614550640), + (.D17,25448758), + (.D15,36836656), + (.D17,1196902), + (.D15,2204092), + (.D17,1225141964), + (.D11,5920), + (.D12,9646)])], + [([18],[(.D11,1099022424266476879880), + (.D13,0), + (.D16,4971973988617027533), + (.D16,54853843461372641290)])], + [([159103167635744881092],[(.D17,1099022424266476879879)]), + ([19887895954468110139,9943947977234055071,4971973988617027536,2485986994308513768,1242993497154256884,621496748577128439,310748374288564221,155374187144282112,77687093572141056,38843546786070528,19421773393035264,9710886696517632,4855443348258816,2427721674129408,1213860837064704,606930418532352,303465209266176,151732604633088,75866302316544,37933151158272,18966575579136,9483287789568,4741643894784,2370821947392,1185410973696,592705486848,296352743424,148176371712,74088185856,37044092928,18522046464,9261023232,4630511616,2315255808,1157627904,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,4971973988617027534), + (.D17,54853843461372641290)]), + ([2485986994308513767],[(.D6,88941589040939925048), + (.D16,55742178487871471728), + (.D6,5126503750831177270), + (.D16,3375799764435075184), + (.D6,293384886662725174), + (.D16,204232085836136560), + (.D6,16647705556155958), + (.D16,12342292899692656), + (.D6,934928480992822), + (.D16,745005027164272), + (.D6,51835960294966), + (.D16,44913546756208), + (.D6,2827430657590), + (.D16,2704017457264), + (.D6,150944611894), + (.D16,162558640240), + (.D6,7823425078), + (.D16,9757261936), + (.D6,388300342), + (.D16,584663152), + (.D6,2135125558), + (.D16,614550640), + (.D6,25448758), + (.D16,36836656), + (.D6,1196902), + (.D16,2204092), + (.D6,1225141964), + (.D12,5921), + (.D13,9646), + (.D9,358), + (.D13,3)])], + [([10],[(.D17,1079134528312008769743), + (.D21,0), + (.D19,53610849964218384406)])]], + .ms [(.m2,.s6,885443715538058476738),(.m3,.s6,1079134528312008769741),(.m7,.s5,1079134528312008769741),(.m4,.s5,885443715538058476732)], + .m .m5, + .b 885443715538058476738 [[([43],[(.D16,1079134528312008769741),(.D8,1),(.D7,53610849964218384405)])],[([1286660399141241225690],[(.D11,1079134528312008769734),(.D2,53610849964218384403)])]], + .ms2 .s6 .s7 [(.m2,1528773915108679089605,918301978419353616525)], + .ms [(.m29,.s2,918301978419353616525),(.m4,.s5,1528773915108679089599)], + .m .m5, + .b 1528773915108679089605 [[([9],[(.D6,918301978419353616525),(.D6,1)])],[([20],[(.D15,918301978419353616523),(.D13,0),(.D10,88630840666651360826),(.D9,55664491394299330672)])],[([36],[(.D11,918301978419353616519)]),([7,2],[(.D12,1),(.D6,88630840666651360826)])]], + .ms [(.m2,.s6,1528773915108679089638),(.m6,.s6,918301978419353616515),(.m15,.s5,918301978419353616515),(.m11,.s5,1528773915108679089632)], + .m .m5, + .b 1528773915108679089638 [[([5],[(.D12,918301978419353616515),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,1528773915108679089641,918301978419353616516)], + .ms [(.m23,.s1,918301978419353616516),(.m22,.s4,1528773915108679089635)], + .m .m24, + .b 1528773915108679089641 [[([17],[(.D6,918301978419353616516),(.D6,2)])],[([6],[(.D11,918301978419353616512),(.D21,0),(.D7,88630840666651360824)])]], + .ms2 .s6 .s7 [(.m2,1528773915108679089653,918301978419353616513)], + .ms2 .s5 .s2 [(.m28,918301978419353616513,1528773915108679089648)], + .m .m18, + .b 1528773915108679089653 [[([45],[(.D6,918301978419353616513),(.D8,1),(.D17,88630840666651360823),(.D10,55664491394299330671)])],[([36],[(.D15,918301978419353616506)]),([7,2],[(.D12,1),(.D17,88630840666651360822)]),([1],[(.D11,55664491394299330671),(.D16,5107081977438142006)])],[([8],[(.D15,918301978419353616502),(.D21,0),(.D17,88630840666651360821),(.D12,55664491394299330672)])]], + .ms [(.m2,.s6,1528773915108679089698),(.m6,.s6,918301978419353616500),(.m7,.s5,918301978419353616500),(.m11,.s5,1528773915108679089692)], + .m .m5, + .b 1528773915108679089698 [[([39],[(.D12,918301978419353616500),(.D8,88630840666651360822),(.D13,55664491394299330672),(.D17,5107081977438142006),(.D15,3370944321086816368),(.D17,292171025825660470),(.D15,203928620626870384),(.D17,16571839253839414),(.D15,12323326324113520),(.D17,930186837098038),(.D15,743819616190576),(.D17,51539607551542),(.D15,44839458570352),(.D17,2808908611126),(.D15,2699386945648),(.D17,149786983990),(.D15,162269233264),(.D17,7751073334),(.D15,9739174000),(.D17,383778358),(.D15,583532656),(.D17,2134842934),(.D15,614479984),(.D17,25431094),(.D15,36832240),(.D17,1195798),(.D15,2203816),(.D17,1225141895),(.D17,5905),(.D11,9641),(.D17,358),(.D15,3)])]], + .ms [(.m2,.s6,1528773915108679089718)], + .ms2 .s6 .s7 [(.m3,918301978419353616496,88630840666651360822),(.m0,55664491394299330672,5107081977438142006),(.m0,3370944321086816368,292171025825660470),(.m0,203928620626870384,16571839253839414),(.m0,12323326324113520,930186837098038),(.m0,743819616190576,51539607551542),(.m0,44839458570352,2808908611126),(.m0,2699386945648,149786983990),(.m0,162269233264,7751073334),(.m0,9739174000,383778358),(.m0,583532656,2134842934),(.m0,614479984,25431094),(.m0,36832240,1195798),(.m0,2203816,1225141895)], + .ms [(.m3,.s6,5905)], + .ms2 .s6 .s7 [(.m6,9641,358)], + .ms2 .s3 .s0 [(.m19,358,9641)], + .ms [(.m17,.s0,5905)], + .ms2 .s3 .s0 [(.m4,1225141895,2203816),(.m1,1195798,36832240),(.m1,25431094,614479984),(.m1,2134842934,583532656),(.m1,383778358,9739174000),(.m1,7751073334,162269233264),(.m1,149786983990,2699386945648),(.m1,2808908611126,44839458570352),(.m1,51539607551542,743819616190576),(.m1,930186837098038,12323326324113520),(.m1,16571839253839414,203928620626870384),(.m1,292171025825660470,3370944321086816368),(.m1,5107081977438142006,55664491394299330672),(.m1,88630840666651360822,918301978419353616496)], + .ms [(.m1,.s3,1528773915108679089712),(.m10,.s7,1528773915108679089718),(.m8,.s2,1528773915108679089713)], + .m .m9, + .b 0 [[([46693320936577302524],[(.D7,1528773915108679089718),(.D17,918301978419353616496),(.D6,88630840666651360822),(.D16,55664491394299330672),(.D6,5107081977438142006),(.D16,3370944321086816368),(.D6,292171025825660470),(.D16,203928620626870384),(.D6,16571839253839414),(.D16,12323326324113520),(.D6,930186837098038),(.D16,743819616190576),(.D6,51539607551542),(.D16,44839458570352),(.D6,2808908611126),(.D16,2699386945648),(.D6,149786983990),(.D16,162269233264),(.D6,7751073334),(.D16,9739174000),(.D6,383778358),(.D16,583532656),(.D6,2134842934),(.D16,614479984),(.D6,25431094),(.D16,36832240),(.D6,1195798),(.D16,2203816),(.D6,1225141895),(.D6,5905),(.D12,9641),(.D6,358),(.D16,4)])]], + .ms [(.m2,.s6,23346660468288651262),(.m3,.s6,1522937249991606926902)], + .ms2 .s6 .s7 [(.m3,916842812140085575792,88266049096834350646),(.m0,55573293501845078128,5084282504324578870),(.m0,3365244452808425584,290746058756062774),(.m0,203572378859470960,16482778811989558),(.m0,12301061213651056,924620559482422),(.m0,742428046786672,51191715200566),(.m0,44752485482608,2787165339190),(.m0,2693951127664,148428029494),(.m0,161929494640,7666138678),(.m0,9717940336,378469942),(.m0,582205552,2134511158),(.m0,614397040,25410358),(.m0,36827056,1194502),(.m0,2203492,1225141814)], + .ms [(.m12,.s7,5883),(.m0,.s6,9637),(.m3,.s6,356),(.m20,.s0,356),(.m1,.s3,9637),(.m4,.s3,5883)], + .ms2 .s3 .s0 [(.m13,1225141814,2203492),(.m1,1194502,36827056),(.m1,25410358,614397040),(.m1,2134511158,582205552),(.m1,378469942,9717940336),(.m1,7666138678,161929494640),(.m1,148428029494,2693951127664),(.m1,2787165339190,44752485482608),(.m1,51191715200566,742428046786672),(.m1,924620559482422,12301061213651056),(.m1,16482778811989558,203572378859470960),(.m1,290746058756062774,3365244452808425584),(.m1,5084282504324578870,55573293501845078128),(.m1,88266049096834350646,916842812140085575792)], + .ms [(.m1,.s3,1522937249991606926902),(.m4,.s3,23346660468288651256),(.m10,.s7,23346660468288651262),(.m8,.s2,23346660468288651257)], + .m .m9, + .b 0 [[([93386641873154605046,46693320936577302525,23346660468288651264,11673330234144325632,5836665117072162816,2918332558536081408,1459166279268040704,729583139634020352,364791569817010176,182395784908505088,91197892454252544,45598946227126272,22799473113563136,11399736556781568,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,23346660468288651262), + (.D17,1522937249991606926902)]), + ([11673330234144325630],[(.D16,916842812140085575792), + (.D6,88266049096834350646), + (.D16,55573293501845078128), + (.D6,5084282504324578870), + (.D16,3365244452808425584), + (.D6,290746058756062774), + (.D16,203572378859470960), + (.D6,16482778811989558), + (.D16,12301061213651056), + (.D6,924620559482422), + (.D16,742428046786672), + (.D6,51191715200566), + (.D16,44752485482608), + (.D6,2787165339190), + (.D16,2693951127664), + (.D6,148428029494), + (.D16,161929494640), + (.D6,7666138678), + (.D16,9717940336), + (.D6,378469942), + (.D16,582205552), + (.D6,2134511158), + (.D16,614397040), + (.D6,25410358), + (.D16,36827056), + (.D6,1194502), + (.D16,2203492), + (.D6,1225141814), + (.D12,5883), + (.D16,9637), + (.D16,356), + (.D6,5)])]], + .ms [(.m2,.s6,93386641873154605045),(.m14,.s5,93386641873154605039)], + .m .m5, + .b 93386641873154605045 [[([5],[(.D18,1),(.D15,1517100584874534764085),(.D14,915383645860817535088)])]], + .ms [(.m2,.s6,93386641873154605048),(.m7,.s5,93386641873154605042)], + .m .m5, + .b 93386641873154605048 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,93386641873154605049),(.m15,.s5,93386641873154605043)], + .m .m5, + .b 93386641873154605049 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,93386641873154605050),(.m25,.s2,93386641873154605045)], + .m .m18, + .b 93386641873154605050 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,93386641873154605052),(.m14,.s5,93386641873154605046)], + .m .m5, + .b 93386641873154605052 [[([5],[(.D18,1),(.D17,1517100584874534764084),(.D15,915383645860817535088),(.D17,87901257527017340470),(.D15,55482095609390825584),(.D17,5061483031211015734),(.D15,3359544584530034800),(.D17,289321091686465078),(.D15,203216137092071536),(.D17,16393718370139702),(.D15,12278796103188592),(.D17,919054281866806),(.D15,741036477382768),(.D17,50843822849590),(.D15,44665512394864),(.D17,2765422067254),(.D15,2688515309680),(.D17,147069074998),(.D15,161589756016),(.D17,7581204022),(.D15,9696706672),(.D17,373161526),(.D15,580878448),(.D17,2134179382),(.D15,614314096),(.D17,25389622),(.D15,36821872),(.D17,1193206),(.D15,2203168),(.D17,1225141733),(.D17,5864),(.D8,9631)])]], + .ms [(.m2,.s6,93386641873154605055),(.m7,.s5,93386641873154605049)], + .m .m5, + .b 93386641873154605055 [[([63987143505680007165],[(.D8,1517100584874534764084),(.D16,915383645860817535088),(.D6,87901257527017340470),(.D16,55482095609390825584),(.D6,5061483031211015734),(.D16,3359544584530034800),(.D6,289321091686465078),(.D16,203216137092071536),(.D6,16393718370139702),(.D16,12278796103188592),(.D6,919054281866806),(.D16,741036477382768),(.D6,50843822849590),(.D16,44665512394864),(.D6,2765422067254),(.D16,2688515309680),(.D6,147069074998),(.D16,161589756016),(.D6,7581204022),(.D16,9696706672),(.D6,373161526),(.D16,580878448),(.D6,2134179382),(.D16,614314096),(.D6,25389622),(.D16,36821872),(.D6,1193206),(.D16,2203168),(.D6,1225141733),(.D6,5865),(.D9,9631),(.D14,354),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,125380213625994608638,1509102191936324763190),(.m0,913384047626265034864,87401357968379215414),(.m0,55357120719731294320,5030239308796132918),(.m0,3351733653926314096,287368359035534902),(.m0,202727953929338992,16271672579456566),(.m0,12248284655517808,911426419949110),(.m0,739129511903344,50367081479734),(.m0,44546327052400,2735625731638),(.m0,2681066225776,145206804022),(.m0,161124188272,7464812086),(.m0,9667608688,365887030),(.m0,579059824,2133724726),(.m0,614200432,25361206),(.m0,36814768,1191430),(.m0,2202724,1225141622)], + .ms [(.m12,.s7,5835),(.m0,.s6,9625),(.m3,.s6,353),(.m21,.s3,353),(.m4,.s3,9625),(.m4,.s3,5835)], + .ms2 .s3 .s0 [(.m13,1225141622,2202724),(.m1,1191430,36814768),(.m1,25361206,614200432),(.m1,2133724726,579059824),(.m1,365887030,9667608688),(.m1,7464812086,161124188272),(.m1,145206804022,2681066225776),(.m1,2735625731638,44546327052400),(.m1,50367081479734,739129511903344),(.m1,911426419949110,12248284655517808),(.m1,16271672579456566,202727953929338992),(.m1,287368359035534902,3351733653926314096),(.m1,5030239308796132918,55357120719731294320),(.m1,87401357968379215414,913384047626265034864),(.m1,1509102191936324763190,125380213625994608633)], + .ms [(.m26,.s7,125380213625994608638),(.m8,.s2,125380213625994608633)], + .m .m9, + .b 0 [[([255948574022720028668],[(.D7,125380213625994608638),(.D7,1509102191936324763189),(.D16,913384047626265034864),(.D6,87401357968379215414),(.D16,55357120719731294320),(.D6,5030239308796132918),(.D16,3351733653926314096),(.D6,287368359035534902),(.D16,202727953929338992),(.D6,16271672579456566),(.D16,12248284655517808),(.D6,911426419949110),(.D16,739129511903344),(.D6,50367081479734),(.D16,44546327052400),(.D6,2735625731638),(.D16,2681066225776),(.D6,145206804022),(.D16,161124188272),(.D6,7464812086),(.D16,9667608688),(.D6,365887030),(.D16,579059824),(.D6,2133724726),(.D16,614200432),(.D6,25361206),(.D16,36814768),(.D6,1191430),(.D16,2202724),(.D6,1225141622),(.D12,5835),(.D16,9625),(.D16,353),(.D12,3)])]], + .ms [(.m2,.s6,127974287011360014334)], + .ms2 .s6 .s7 [(.m3,93386641873154605054,1501103798998114762294),(.m0,911384449391712534640,86901458409741090358),(.m0,55232145830071763056,4998995586381250102),(.m0,3343922723322593392,285415626384604726),(.m0,202239770766606448,16149626788773430),(.m0,12217773207847024,903798558031414),(.m0,737222546423920,49890340109878),(.m0,44427141709936,2705829396022),(.m0,2673617141872,143344533046),(.m0,160658620528,7348420150),(.m0,9638510704,358612534),(.m0,577241200,2133270070),(.m0,614086768,25332790),(.m0,36807664,1189654),(.m0,2202280,1225141511)], + .ms [(.m3,.s6,5809)], + .ms2 .s6 .s7 [(.m6,9617,352)], + .ms2 .s3 .s0 [(.m19,352,9617)], + .ms [(.m17,.s0,5809)], + .ms2 .s3 .s0 [(.m4,1225141511,2202280),(.m1,1189654,36807664),(.m1,25332790,614086768),(.m1,2133270070,577241200),(.m1,358612534,9638510704),(.m1,7348420150,160658620528),(.m1,143344533046,2673617141872),(.m1,2705829396022,44427141709936),(.m1,49890340109878,737222546423920),(.m1,903798558031414,12217773207847024),(.m1,16149626788773430,202239770766606448),(.m1,285415626384604726,3343922723322593392),(.m1,4998995586381250102,55232145830071763056),(.m1,86901458409741090358,911384449391712534640),(.m1,1501103798998114762294,93386641873154605054)], + .ms [(.m1,.s3,127974287011360014328),(.m10,.s7,127974287011360014334),(.m8,.s2,127974287011360014329)], + .m .m9, + .b 0 [[([511897148045440057334,235195986939796783110],[(.D7,127974287011360014334),(.D17,93386641873154605054)]),([46693320936577302527],[(.D6,1501103798998114762294),(.D16,911384449391712534640),(.D6,86901458409741090358),(.D16,55232145830071763056),(.D6,4998995586381250102),(.D16,3343922723322593392),(.D6,285415626384604726),(.D16,202239770766606448),(.D6,16149626788773430),(.D16,12217773207847024),(.D6,903798558031414),(.D16,737222546423920),(.D6,49890340109878),(.D16,44427141709936),(.D6,2705829396022),(.D16,2673617141872),(.D6,143344533046),(.D16,160658620528),(.D6,7348420150),(.D16,9638510704),(.D6,358612534),(.D16,577241200),(.D6,2133270070),(.D16,614086768),(.D6,25332790),(.D16,36807664),(.D6,1189654),(.D16,2202280),(.D6,1225141511),(.D6,5809),(.D12,9617),(.D6,352),(.D16,4)])]], + .ms [(.m2,.s6,373546567492618420222),(.m3,.s6,34587645138205409278)], + .ms2 .s6 .s7 [(.m3,70039981404865953790,1495267133881042599478),(.m0,909925283112444493936,86536666839924080182),(.m0,55140947937617510512,4976196113267686966),(.m0,3338222855044202608,283990659315007030),(.m0,201883528999207024,16060566346923574),(.m0,12195508097384560,898232280415798),(.m0,735830977020016,49542447758902),(.m0,44340168622192,2684086124086),(.m0,2668181323888,141985578550),(.m0,160318881904,7263485494),(.m0,9617277040,353304118),(.m0,575914096,2132938294),(.m0,614003824,25312054),(.m0,36802480,1188358),(.m0,2201956,1225141430)], + .ms [(.m12,.s7,5787),(.m0,.s6,9613),(.m3,.s6,350),(.m20,.s0,350),(.m1,.s3,9613),(.m4,.s3,5787)], + .ms2 .s3 .s0 [(.m13,1225141430,2201956),(.m1,1188358,36802480),(.m1,25312054,614003824),(.m1,2132938294,575914096),(.m1,353304118,9617277040),(.m1,7263485494,160318881904),(.m1,141985578550,2668181323888),(.m1,2684086124086,44340168622192),(.m1,49542447758902,735830977020016),(.m1,898232280415798,12195508097384560),(.m1,16060566346923574,201883528999207024),(.m1,283990659315007030,3338222855044202608),(.m1,4976196113267686966,55140947937617510512),(.m1,86536666839924080182,909925283112444493936),(.m1,1495267133881042599478,70039981404865953790)], + .ms [(.m1,.s3,34587645138205409278),(.m4,.s3,373546567492618420216),(.m10,.s7,373546567492618420222),(.m8,.s2,373546567492618420217)], + .m .m9, + .b 0 [[([1106804644422573096884],[(.D7,373546567492618420222)]), + ([138350580552821637110,69175290276410818559,34587645138205409280,17293822569102704640,8646911284551352320,4323455642275676160,2161727821137838080,1080863910568919040,540431955284459520,270215977642229760,135107988821114880,67553994410557440,33776997205278720,16888498602639360,8444249301319680,4222124650659840,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,34587645138205409278), + (.D16,70039981404865953790)]), + ([17293822569102704638],[(.D6,1495267133881042599478), + (.D16,909925283112444493936), + (.D6,86536666839924080182), + (.D16,55140947937617510512), + (.D6,4976196113267686966), + (.D16,3338222855044202608), + (.D6,283990659315007030), + (.D16,201883528999207024), + (.D6,16060566346923574), + (.D16,12195508097384560), + (.D6,898232280415798), + (.D16,735830977020016), + (.D6,49542447758902), + (.D16,44340168622192), + (.D6,2684086124086), + (.D16,2668181323888), + (.D6,141985578550), + (.D16,160318881904), + (.D6,7263485494), + (.D16,9617277040), + (.D6,353304118), + (.D16,575914096), + (.D6,2132938294), + (.D16,614003824), + (.D6,25312054), + (.D16,36802480), + (.D6,1188358), + (.D16,2201956), + (.D6,1225141430), + (.D12,5787), + (.D16,9613), + (.D16,350), + (.D6,5)])]], + .ms [(.m2,.s6,553402322211286548442),(.m3,.s6,235195986939796783111),(.m14,.s5,235195986939796783111),(.m4,.s5,553402322211286548436)], + .m .m5, + .b 553402322211286548442 [[([23],[(.D16,235195986939796783111),(.D18,1),(.D15,61393070120314601469),(.D16,1493105406059904761398)])]], + .ms [(.m2,.s6,553402322211286548454),(.m3,.s6,235195986939796783108),(.m7,.s5,235195986939796783108),(.m4,.s5,553402322211286548448)], + .m .m5, + .b 553402322211286548454 [[([7],[(.D16,235195986939796783108),(.D6,1)])]], + .ms [(.m2,.s6,553402322211286548458),(.m6,.s6,235195986939796783106),(.m15,.s5,235195986939796783106),(.m11,.s5,553402322211286548452)], + .m .m5, + .b 553402322211286548458 [[([5],[(.D12,235195986939796783106),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,553402322211286548461,235195986939796783107)], + .ms [(.m23,.s1,235195986939796783107),(.m22,.s4,553402322211286548455)], + .m .m24, + .b 553402322211286548461 [[([17],[(.D6,235195986939796783107),(.D6,2)])]], + .ms [(.m2,.s6,553402322211286548470),(.m6,.s6,235195986939796783103),(.m14,.s5,235195986939796783103),(.m11,.s5,553402322211286548464)], + .m .m5, + .b 553402322211286548470 [[([23],[(.D12,235195986939796783103),(.D18,1),(.D17,61393070120314601468),(.D17,1493105406059904761398),(.D15,909384851157160034416),(.D17,86401558851102965302),(.D15,55107170940412231792),(.D17,4967751863966367286),(.D15,3336111792718872688),(.D17,283462893733674550),(.D15,201751587603873904),(.D17,16027580998090294),(.D15,12187261760176240),(.D17,896170696113718),(.D15,735315580944496),(.D17,49413598740022),(.D15,44307956367472),(.D17,2676033060406),(.D15,2666168057968),(.D17,141482262070),(.D15,160193052784),(.D17,7232028214),(.D15,9609412720),(.D17,351338038),(.D15,575422576),(.D17,2132815414),(.D15,613973104),(.D17,25304374),(.D15,36800560),(.D17,1187878),(.D15,2201836),(.D17,1225141400),(.D11,5779),(.D6,9612)])]], + .ms [(.m2,.s6,553402322211286548482),(.m6,.s6,235195986939796783100),(.m7,.s5,235195986939796783100),(.m11,.s5,553402322211286548476)], + .m .m5, + .b 553402322211286548482 [[([940783947759187132401,470391973879593566205,83010348331692982281],[(.D12,235195986939796783100),(.D8,61393070120314601468),(.D6,1493105406059904761398)]),([23346660468288651263],[(.D16,909384851157160034416),(.D6,86401558851102965302),(.D16,55107170940412231792),(.D6,4967751863966367286),(.D16,3336111792718872688),(.D6,283462893733674550),(.D16,201751587603873904),(.D6,16027580998090294),(.D16,12187261760176240),(.D6,896170696113718),(.D16,735315580944496),(.D6,49413598740022),(.D16,44307956367472),(.D6,2676033060406),(.D16,2666168057968),(.D6,141482262070),(.D16,160193052784),(.D6,7232028214),(.D16,9609412720),(.D6,351338038),(.D16,575422576),(.D6,2132815414),(.D16,613973104),(.D6,25304374),(.D16,36800560),(.D6,1187878),(.D16,2201836),(.D6,1225141400),(.D12,5780),(.D7,9611),(.D8,349),(.D7,4)])]], + .ms [(.m2,.s6,1300495457196523388926)], + .ms2 .s6 .s7 [(.m3,48422703193487572990,14699749183737298942)], + .ms [(.m3,.s6,1481432075825760435766)], + .ms2 .s6 .s7 [(.m3,906466518598623953008,85671975711468944950),(.m0,54924775155503726704,4922152917739241014),(.m0,3324712056162091120,280612959594479158),(.m0,201039104069075056,15849460114390582),(.m0,12142731539251312,885038140882486),(.m0,732532442136688,48717814038070),(.m0,44134010191984,2632546516534),(.m0,2655296422000,138764353078),(.m0,159513575536,7062158902),(.m0,9566945392,340721206),(.m0,572768368,2132151862),(.m0,613807216,25262902),(.m0,36790192,1185286),(.m0,2201188,1225141238)], + .ms [(.m12,.s7,5739),(.m0,.s6,9601),(.m3,.s6,347),(.m21,.s3,347),(.m4,.s3,9601),(.m4,.s3,5739)], + .ms2 .s3 .s0 [(.m13,1225141238,2201188),(.m1,1185286,36790192),(.m1,25262902,613807216),(.m1,2132151862,572768368),(.m1,340721206,9566945392),(.m1,7062158902,159513575536),(.m1,138764353078,2655296422000),(.m1,2632546516534,44134010191984),(.m1,48717814038070,732532442136688),(.m1,885038140882486,12142731539251312),(.m1,15849460114390582,201039104069075056),(.m1,280612959594479158,3324712056162091120),(.m1,4922152917739241014,54924775155503726704),(.m1,85671975711468944950,906466518598623953008),(.m1,1481432075825760435766,14699749183737298942)], + .ms [(.m4,.s3,48422703193487572990),(.m4,.s3,1300495457196523388920),(.m10,.s7,1300495457196523388926),(.m8,.s2,1300495457196523388921)], + .m .m9, + .b 0 [[([1549526502191602335668],[(.D7,1300495457196523388926)]), + ([193690812773950291958,96845406386975145983,48422703193487572992,24211351596743786496,12105675798371893248,6052837899185946624,3026418949592973312,1513209474796486656,756604737398243328,378302368699121664,189151184349560832,94575592174780416,47287796087390208,23643898043695104,11821949021847552,5910974510923776,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,48422703193487572990), + (.D6,14699749183737298942), + (.D6,1481432075825760435766)]), + ([6052837899185946623],[(.D16,906466518598623953008), + (.D6,85671975711468944950), + (.D16,54924775155503726704), + (.D6,4922152917739241014), + (.D16,3324712056162091120), + (.D6,280612959594479158), + (.D16,201039104069075056), + (.D6,15849460114390582), + (.D16,12142731539251312), + (.D6,885038140882486), + (.D16,732532442136688), + (.D6,48717814038070), + (.D16,44134010191984), + (.D6,2632546516534), + (.D16,2655296422000), + (.D6,138764353078), + (.D16,159513575536), + (.D6,7062158902), + (.D16,9566945392), + (.D6,340721206), + (.D16,572768368), + (.D6,2132151862), + (.D16,613807216), + (.D6,25262902), + (.D16,36790192), + (.D6,1185286), + (.D16,2201188), + (.D6,1225141238), + (.D12,5739), + (.D16,9601), + (.D16,347), + (.D12,3)])], + [([8],[(.D15,1106804644422573096967), + (.D21,0), + (.D19,2594073385365405693)])]], + .ms [(.m2,.s6,774763251095801167838),(.m6,.s6,1106804644422573096965),(.m7,.s5,1106804644422573096965),(.m11,.s5,774763251095801167832)], + .m .m5, + .b 774763251095801167838 [[([41],[(.D12,1106804644422573096965),(.D8,1),(.D7,2594073385365405692)])],[([62257761248769736582],[(.D17,1106804644422573096961),(.D2,2594073385365405690)])]], + .ms [(.m2,.s6,805892131720186036150),(.m3,.s6,1099022424266476879888),(.m27,.s2,1099022424266476879888),(.m1,.s5,805892131720186036144)], + .m .m5, + .b 805892131720186036150 [[([7],[(.D16,1099022424266476879888), + (.D6,1)])], + [([16],[(.D11,1099022424266476879886), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,1099022424266476879885), + (.D17,1), + (.D15,0), + (.D6,1478405656876167462454)])], + [([16],[(.D11,1099022424266476879883), + (.D3,0)])], + [([8],[(.D15,1099022424266476879882), + (.D17,1), + (.D21,1478405656876167462453), + (.D15,905709913861225709680), + (.D17,85482824527119384118), + (.D15,54877487359416336496), + (.D17,4910330968717393462), + (.D15,3321756568906629232), + (.D17,279874087780613686), + (.D15,200854386115608688), + (.D17,15803280626023990), + (.D15,12131186667159664), + (.D17,882151922859574), + (.D15,731810887630960), + (.D17,48537425411638), + (.D15,44088913035376), + (.D17,2621272227382), + (.D15,2652477849712), + (.D17,138059710006), + (.D15,159337414768), + (.D17,7018118710), + (.D15,9555935344), + (.D17,337968694), + (.D15,572080240), + (.D17,2131979830), + (.D15,613764208), + (.D17,25252150), + (.D15,36787504), + (.D17,1184614), + (.D15,2201020), + (.D17,1225141196), + (.D11,5728), + (.D12,9598)])], + [([18],[(.D11,1099022424266476879880), + (.D13,0), + (.D16,1478405656876167462453), + (.D16,905709913861225709680)])], + [([159103167635744882662],[(.D17,1099022424266476879879), + (.D12,1478405656876167462454), + (.D17,905709913861225709680), + (.D6,85482824527119384118), + (.D16,54877487359416336496), + (.D6,4910330968717393462), + (.D16,3321756568906629232), + (.D6,279874087780613686), + (.D16,200854386115608688), + (.D6,15803280626023990), + (.D16,12131186667159664), + (.D6,882151922859574), + (.D16,731810887630960), + (.D6,48537425411638), + (.D16,44088913035376), + (.D6,2621272227382), + (.D16,2652477849712), + (.D6,138059710006), + (.D16,159337414768), + (.D6,7018118710), + (.D16,9555935344), + (.D6,337968694), + (.D16,572080240), + (.D6,2131979830), + (.D16,613764208), + (.D6,25252150), + (.D16,36787504), + (.D6,1184614), + (.D16,2201020), + (.D6,1225141196), + (.D12,5729), + (.D13,9598), + (.D9,346), + (.D13,3)])]], + .ms [(.m2,.s6,885443715538058477518)], + .ms2 .s6 .s7 [(.m3,1079134528312008769546,1473433682887550434872),(.m0,904466920364071452784,85172076152830819894),(.m0,54799800265844195440,4890909195324358198),(.m0,3316901125558370416,278660226943548982),(.m0,200550920906342512,15727414323707446),(.m0,12112220091580528,877410278964790),(.m0,730625476657264,48241072668214),(.m0,44014824849520,2602750180918),(.m0,2647847338096,136902082102),(.m0,159048007792,6945766966),(.m0,9537847408,333446710),(.m0,570949744,2131697206),(.m0,613693552,25234486),(.m0,36783088,1183510),(.m0,2200744,1225141127)], + .ms [(.m3,.s6,5713)], + .ms2 .s6 .s7 [(.m6,9593,346)], + .ms2 .s3 .s0 [(.m19,346,9593)], + .ms [(.m17,.s0,5713)], + .ms2 .s3 .s0 [(.m4,1225141127,2200744),(.m1,1183510,36783088),(.m1,25234486,613693552),(.m1,2131697206,570949744),(.m1,333446710,9537847408),(.m1,6945766966,159048007792),(.m1,136902082102,2647847338096),(.m1,2602750180918,44014824849520),(.m1,48241072668214,730625476657264),(.m1,877410278964790,12112220091580528),(.m1,15727414323707446,200550920906342512),(.m1,278660226943548982,3316901125558370416),(.m1,4890909195324358198,54799800265844195440),(.m1,85172076152830819894,904466920364071452784),(.m1,1473433682887550434872,1079134528312008769546)], + .ms [(.m1,.s3,885443715538058477512),(.m10,.s7,885443715538058477518),(.m8,.s2,885443715538058477513)], + .m .m9, + .b 0 [[([747093134985236840444],[(.D7,885443715538058477518),(.D17,1079134528312008769546),(.D6,1473433682887550434872),(.D16,904466920364071452784),(.D6,85172076152830819894),(.D16,54799800265844195440),(.D6,4890909195324358198),(.D16,3316901125558370416),(.D6,278660226943548982),(.D16,200550920906342512),(.D6,15727414323707446),(.D16,12112220091580528),(.D6,877410278964790),(.D16,730625476657264),(.D6,48241072668214),(.D16,44014824849520),(.D6,2602750180918),(.D16,2647847338096),(.D6,136902082102),(.D16,159048007792),(.D6,6945766966),(.D16,9537847408),(.D6,333446710),(.D16,570949744),(.D6,2131697206),(.D16,613693552),(.D6,25234486),(.D16,36783088),(.D6,1183510),(.D16,2200744),(.D6,1225141127),(.D6,5713),(.D12,9593),(.D6,346),(.D16,4)])]], + .ms [(.m2,.s6,373546567492618420222),(.m3,.s6,792057073664903872462)], + .ms2 .s6 .s7 [(.m3,1055787867843720118282,1467597017770478272056),(.m0,903007754084803412080,84807284583013809718),(.m0,54708602373389942896,4868109722210795062),(.m0,3311201257279979632,277235259873951286),(.m0,200194679138943088,15638353881857590),(.m0,12089954981118064,871844001349174),(.m0,729233907253360,47893180317238),(.m0,43927851761776,2581006908982),(.m0,2642411520112,135543127606),(.m0,158708269168,6860832310),(.m0,9516613744,328138294),(.m0,569622640,2131365430),(.m0,613610608,25213750),(.m0,36777904,1182214),(.m0,2200420,1225141046)], + .ms [(.m12,.s7,5691),(.m0,.s6,9589),(.m3,.s6,344),(.m20,.s0,344),(.m1,.s3,9589)], + ] (by decide +kernel) +theorem chunk_23_step : (cfg_23.denote) [qi]⊢* (cfg_24.denote) := + step_chunk [ + .ms [(.m4,.s3,5691)], + .ms2 .s3 .s0 [(.m13,1225141046,2200420),(.m1,1182214,36777904),(.m1,25213750,613610608),(.m1,2131365430,569622640),(.m1,328138294,9516613744),(.m1,6860832310,158708269168),(.m1,135543127606,2642411520112),(.m1,2581006908982,43927851761776),(.m1,47893180317238,729233907253360),(.m1,871844001349174,12089954981118064),(.m1,15638353881857590,200194679138943088),(.m1,277235259873951286,3311201257279979632),(.m1,4868109722210795062,54708602373389942896),(.m1,84807284583013809718,903007754084803412080),(.m1,1467597017770478272056,1055787867843720118282)], + .ms [(.m1,.s3,792057073664903872462),(.m4,.s3,373546567492618420216),(.m10,.s7,373546567492618420222),(.m8,.s2,373546567492618420217)], + .m .m9, + .b 0 [[([1494186269970473680886,747093134985236840445,373546567492618420224,186773283746309210112,93386641873154605056,46693320936577302528,23346660468288651264,11673330234144325632,5836665117072162816,2918332558536081408,1459166279268040704,729583139634020352,364791569817010176,182395784908505088,91197892454252544,45598946227126272,22799473113563136,11399736556781568,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,373546567492618420222), + (.D17,792057073664903872462)]), + ([186773283746309210110],[(.D16,1055787867843720118282), + (.D6,1467597017770478272056), + (.D16,903007754084803412080), + (.D6,84807284583013809718), + (.D16,54708602373389942896), + (.D6,4868109722210795062), + (.D16,3311201257279979632), + (.D6,277235259873951286), + (.D16,200194679138943088), + (.D6,15638353881857590), + (.D16,12089954981118064), + (.D6,871844001349174), + (.D16,729233907253360), + (.D6,47893180317238), + (.D16,43927851761776), + (.D6,2581006908982), + (.D16,2642411520112), + (.D6,135543127606), + (.D16,158708269168), + (.D6,6860832310), + (.D16,9516613744), + (.D6,328138294), + (.D16,569622640), + (.D6,2131365430), + (.D16,613610608), + (.D6,25213750), + (.D16,36777904), + (.D6,1182214), + (.D16,2200420), + (.D6,1225141046), + (.D12,5691), + (.D16,9589), + (.D16,344), + (.D6,5)])]], + .ms [(.m2,.s6,1494186269970473680885),(.m14,.s5,1494186269970473680879)], + .m .m5, + .b 1494186269970473680885 [[([5],[(.D18,1),(.D15,698670431791749267405),(.D14,1032441207375431467018)])]], + .ms [(.m2,.s6,1494186269970473680888),(.m7,.s5,1494186269970473680882)], + .m .m5, + .b 1494186269970473680888 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,1494186269970473680889),(.m15,.s5,1494186269970473680883)], + .m .m5, + .b 1494186269970473680889 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,1494186269970473680890),(.m25,.s2,1494186269970473680885)], + .m .m18, + .b 1494186269970473680890 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,1494186269970473680892),(.m14,.s5,1494186269970473680886)], + .m .m5, + .b 1494186269970473680892 [[([5],[(.D18,1),(.D17,698670431791749267404),(.D15,1032441207375431467018),(.D17,1461760352653406109240),(.D15,901548587805535371376),(.D17,84442493013196799542),(.D15,54617404480935690352),(.D17,4845310249097231926),(.D15,3305501389001588848),(.D17,275810292804353590),(.D15,199838437371543664),(.D17,15549293440007734),(.D15,12067689870655600),(.D17,866277723733558),(.D15,727842337849456),(.D17,47545287966262),(.D15,43840878674032),(.D17,2559263637046),(.D15,2636975702128),(.D17,134184173110),(.D15,158368530544),(.D17,6775897654),(.D15,9495380080),(.D17,322829878),(.D15,568295536),(.D17,2131033654),(.D15,613527664),(.D17,25193014),(.D15,36772720),(.D17,1180918),(.D15,2200096),(.D17,1225140965),(.D17,5672),(.D8,9583)])]], + .ms [(.m2,.s6,1494186269970473680895),(.m7,.s5,1494186269970473680889)], + .m .m5, + .b 1494186269970473680895 [[([1023794296090880114685],[(.D8,698670431791749267404),(.D16,1032441207375431467018),(.D6,1461760352653406109240),(.D16,901548587805535371376),(.D6,84442493013196799542),(.D16,54617404480935690352),(.D6,4845310249097231926),(.D16,3305501389001588848),(.D6,275810292804353590),(.D16,199838437371543664),(.D6,15549293440007734),(.D16,12067689870655600),(.D6,866277723733558),(.D16,727842337849456),(.D6,47545287966262),(.D16,43840878674032),(.D6,2559263637046),(.D16,2636975702128),(.D6,134184173110),(.D16,158368530544),(.D6,6775897654),(.D16,9495380080),(.D6,322829878),(.D16,568295536),(.D6,2131033654),(.D16,613527664),(.D6,25193014),(.D16,36772720),(.D6,1180918),(.D16,2200096),(.D6,1225140965),(.D6,5673),(.D9,9583),(.D14,342),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,2006083418015913738238,570696144780389253070),(.m0,1000447635622591463434,1453761959715196108344),(.m0,899548989570982871152,83942593454558674486),(.m0,54492429591276159088,4814066526682349110),(.m0,3297690458397868144,273857560153423414),(.m0,199350254208811120,15427247649324598),(.m0,12037178422984816,858649861815862),(.m0,725935372370032,47068546596406),(.m0,43721693331568,2529467301430),(.m0,2629526618224,132321902134),(.m0,157902962800,6659505718),(.m0,9466282096,315555382),(.m0,566476912,2130578998),(.m0,613414000,25164598),(.m0,36765616,1179142),(.m0,2199652,1225140854)], + .ms [(.m12,.s7,5643),(.m0,.s6,9577),(.m3,.s6,341),(.m21,.s3,341),(.m4,.s3,9577),(.m4,.s3,5643)], + .ms2 .s3 .s0 [(.m13,1225140854,2199652),(.m1,1179142,36765616),(.m1,25164598,613414000),(.m1,2130578998,566476912),(.m1,315555382,9466282096),(.m1,6659505718,157902962800),(.m1,132321902134,2629526618224),(.m1,2529467301430,43721693331568),(.m1,47068546596406,725935372370032),(.m1,858649861815862,12037178422984816),(.m1,15427247649324598,199350254208811120),(.m1,273857560153423414,3297690458397868144),(.m1,4814066526682349110,54492429591276159088),(.m1,83942593454558674486,899548989570982871152),(.m1,1453761959715196108344,1000447635622591463434),(.m1,570696144780389253070,2006083418015913738233)], + .ms [(.m26,.s7,2006083418015913738238),(.m8,.s2,2006083418015913738233)], + .m .m9, + .b 0 [[([4095177184363520458748],[(.D7,2006083418015913738238),(.D7,570696144780389253069),(.D16,1000447635622591463434),(.D6,1453761959715196108344),(.D16,899548989570982871152),(.D6,83942593454558674486),(.D16,54492429591276159088),(.D6,4814066526682349110),(.D16,3297690458397868144),(.D6,273857560153423414),(.D16,199350254208811120),(.D6,15427247649324598),(.D16,12037178422984816),(.D6,858649861815862),(.D16,725935372370032),(.D6,47068546596406),(.D16,43721693331568),(.D6,2529467301430),(.D16,2629526618224),(.D6,132321902134),(.D16,157902962800),(.D6,6659505718),(.D16,9466282096),(.D6,315555382),(.D16,566476912),(.D6,2130578998),(.D16,613414000),(.D6,25164598),(.D16,36765616),(.D6,1179142),(.D16,2199652),(.D6,1225140854),(.D12,5643),(.D16,9577),(.D16,341),(.D12,3)])]], + .ms [(.m2,.s6,2047588592181760229374)], + .ms2 .s6 .s7 [(.m3,1494186269970473680894,442721857769029238734),(.m0,968454063869751459850,1445763566776986107448),(.m0,897549391336430370928,83442693895920549430),(.m0,54367454701616627824,4782822804267466294),(.m0,3289879527794147440,271904827502493238),(.m0,198862071046078576,15305201858641462),(.m0,12006666975314032,851021999898166),(.m0,724028406890608,46591805226550),(.m0,43602507989104,2499670965814),(.m0,2622077534320,130459631158),(.m0,157437395056,6543113782),(.m0,9437184112,308280886),(.m0,564658288,2130124342),(.m0,613300336,25136182),(.m0,36758512,1177366),(.m0,2199208,1225140743)], + .ms [(.m3,.s6,5617)], + .ms2 .s6 .s7 [(.m6,9569,340)], + .ms2 .s3 .s0 [(.m19,340,9569)], + .ms [(.m17,.s0,5617)], + .ms2 .s3 .s0 [(.m4,1225140743,2199208),(.m1,1177366,36758512),(.m1,25136182,613300336),(.m1,2130124342,564658288),(.m1,308280886,9437184112),(.m1,6543113782,157437395056),(.m1,130459631158,2622077534320),(.m1,2499670965814,43602507989104),(.m1,46591805226550,724028406890608),(.m1,851021999898166,12006666975314032),(.m1,15305201858641462,198862071046078576),(.m1,271904827502493238,3289879527794147440),(.m1,4782822804267466294,54367454701616627824),(.m1,83442693895920549430,897549391336430370928),(.m1,1445763566776986107448,968454063869751459850),(.m1,442721857769029238734,1494186269970473680894)], + .ms [(.m1,.s3,2047588592181760229368),(.m10,.s7,2047588592181760229374),(.m8,.s2,2047588592181760229369)], + .m .m9, + .b 0 [[([8190354368727040917494,3763135791036748529670],[(.D7,2047588592181760229374),(.D17,1494186269970473680894)]),([747093134985236840447],[(.D6,442721857769029238734),(.D16,968454063869751459850),(.D6,1445763566776986107448),(.D16,897549391336430370928),(.D6,83442693895920549430),(.D16,54367454701616627824),(.D6,4782822804267466294),(.D16,3289879527794147440),(.D6,271904827502493238),(.D16,198862071046078576),(.D6,15305201858641462),(.D16,12006666975314032),(.D6,851021999898166),(.D16,724028406890608),(.D6,46591805226550),(.D16,43602507989104),(.D6,2499670965814),(.D16,2622077534320),(.D6,130459631158),(.D16,157437395056),(.D6,6543113782),(.D16,9437184112),(.D6,308280886),(.D16,564658288),(.D6,2130124342),(.D16,613300336),(.D6,25136182),(.D16,36758512),(.D6,1177366),(.D16,2199208),(.D6,1225140743),(.D6,5617),(.D12,9569),(.D6,340),(.D16,4)])]], + .ms [(.m2,.s6,5976745079881894723582),(.m3,.s6,553402322211286548478)], + .ms2 .s6 .s7 [(.m3,1120639702477855260670,349335215895874633678),(.m0,945107403401462808586,1439926901659913944632),(.m0,896090225057162330224,83077902326103539254),(.m0,54276256809162375280,4760023331153903158),(.m0,3284179659515756656,270479860432895542),(.m0,198505829278679152,15216141416791606),(.m0,11984401864851568,845455722282550),(.m0,722636837486704,46243912875574),(.m0,43515534901360,2477927693878),(.m0,2616641716336,129100676662),(.m0,157097656432,6458179126),(.m0,9415950448,302972470),(.m0,563331184,2129792566),(.m0,613217392,25115446),(.m0,36753328,1176070),(.m0,2198884,1225140662)], + .ms [(.m12,.s7,5595),(.m0,.s6,9565),(.m3,.s6,338),(.m20,.s0,338),(.m1,.s3,9565),(.m4,.s3,5595)], + .ms2 .s3 .s0 [(.m13,1225140662,2198884),(.m1,1176070,36753328),(.m1,25115446,613217392),(.m1,2129792566,563331184),(.m1,302972470,9415950448),(.m1,6458179126,157097656432),(.m1,129100676662,2616641716336),(.m1,2477927693878,43515534901360),(.m1,46243912875574,722636837486704),(.m1,845455722282550,11984401864851568),(.m1,15216141416791606,198505829278679152),(.m1,270479860432895542,3284179659515756656),(.m1,4760023331153903158,54276256809162375280),(.m1,83077902326103539254,896090225057162330224),(.m1,1439926901659913944632,945107403401462808586),(.m1,349335215895874633678,1120639702477855260670)], + .ms [(.m1,.s3,553402322211286548478),(.m4,.s3,5976745079881894723576),(.m10,.s7,5976745079881894723582),(.m8,.s2,5976745079881894723577)], + .m .m9, + .b 0 [[([17708874310761169551284],[(.D7,5976745079881894723582)]), + ([2213609288845146193910,1106804644422573096959,553402322211286548480,276701161105643274240,138350580552821637120,69175290276410818560,34587645138205409280,17293822569102704640,8646911284551352320,4323455642275676160,2161727821137838080,1080863910568919040,540431955284459520,270215977642229760,135107988821114880,67553994410557440,33776997205278720,16888498602639360,8444249301319680,4222124650659840,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,553402322211286548478), + (.D16,1120639702477855260670)]), + ([276701161105643274238],[(.D6,349335215895874633678), + (.D16,945107403401462808586), + (.D6,1439926901659913944632), + (.D16,896090225057162330224), + (.D6,83077902326103539254), + (.D16,54276256809162375280), + (.D6,4760023331153903158), + (.D16,3284179659515756656), + (.D6,270479860432895542), + (.D16,198505829278679152), + (.D6,15216141416791606), + (.D16,11984401864851568), + (.D6,845455722282550), + (.D16,722636837486704), + (.D6,46243912875574), + (.D16,43515534901360), + (.D6,2477927693878), + (.D16,2616641716336), + (.D6,129100676662), + (.D16,157097656432), + (.D6,6458179126), + (.D16,9415950448), + (.D6,302972470), + (.D16,563331184), + (.D6,2129792566), + (.D16,613217392), + (.D6,25115446), + (.D16,36753328), + (.D6,1176070), + (.D16,2198884), + (.D6,1225140662), + (.D12,5595), + (.D16,9565), + (.D16,338), + (.D6,5)])]], + .ms [(.m2,.s6,8854437155380584775642),(.m3,.s6,3763135791036748529671),(.m14,.s5,3763135791036748529671),(.m4,.s5,8854437155380584775636)], + .m .m5, + .b 8854437155380584775642 [[([23],[(.D16,3763135791036748529671),(.D18,1),(.D15,982289121925033623549),(.D16,314747570757669224398)])]], + .ms [(.m2,.s6,8854437155380584775654),(.m3,.s6,3763135791036748529668),(.m7,.s5,3763135791036748529668),(.m4,.s5,8854437155380584775648)], + .m .m5, + .b 8854437155380584775654 [[([7],[(.D16,3763135791036748529668),(.D6,1)])]], + .ms [(.m2,.s6,8854437155380584775658),(.m6,.s6,3763135791036748529666),(.m15,.s5,3763135791036748529666),(.m11,.s5,8854437155380584775652)], + .m .m5, + .b 8854437155380584775658 [[([5],[(.D12,3763135791036748529666),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,8854437155380584775661,3763135791036748529667)], + .ms [(.m23,.s1,3763135791036748529667),(.m22,.s4,8854437155380584775655)], + .m .m24, + .b 8854437155380584775661 [[([17],[(.D6,3763135791036748529667),(.D6,2)])]], + .ms [(.m2,.s6,8854437155380584775670),(.m6,.s6,3763135791036748529663),(.m14,.s5,3763135791036748529663),(.m11,.s5,8854437155380584775664)], + .m .m5, + .b 8854437155380584775670 [[([23],[(.D12,3763135791036748529663),(.D18,1),(.D17,982289121925033623548),(.D17,314747570757669224398),(.D15,936460492116911456266),(.D17,1437765173838776106552),(.D15,895549793101877870704),(.D17,82942794337282424374),(.D15,54242479811957096560),(.D17,4751579081852583478),(.D15,3282068597190426736),(.D17,269952094851563062),(.D15,198373887883346032),(.D17,15183156067958326),(.D15,11976155527643248),(.D17,843394137980470),(.D15,722121441411184),(.D17,46115063856694),(.D15,43483322646640),(.D17,2469874630198),(.D15,2614628450416),(.D17,128597360182),(.D15,156971827312),(.D17,6426721846),(.D15,9408086128),(.D17,301006390),(.D15,562839664),(.D17,2129669686),(.D15,613186672),(.D17,25107766),(.D15,36751408),(.D17,1175590),(.D15,2198764),(.D17,1225140632),(.D11,5587),(.D6,9564)])]], + .ms [(.m2,.s6,8854437155380584775682),(.m6,.s6,3763135791036748529660),(.m7,.s5,3763135791036748529660),(.m11,.s5,8854437155380584775676)], + .m .m5, + .b 8854437155380584775682 [[([15052543164146994118641,7526271582073497059325,1328165573307087716361],[(.D12,3763135791036748529660),(.D8,982289121925033623548),(.D6,314747570757669224398),(.D16,936460492116911456266)]),([93386641873154605055],[(.D6,1437765173838776106552),(.D16,895549793101877870704),(.D6,82942794337282424374),(.D16,54242479811957096560),(.D6,4751579081852583478),(.D16,3282068597190426736),(.D6,269952094851563062),(.D16,198373887883346032),(.D6,15183156067958326),(.D16,11976155527643248),(.D6,843394137980470),(.D16,722121441411184),(.D6,46115063856694),(.D16,43483322646640),(.D6,2469874630198),(.D16,2614628450416),(.D6,128597360182),(.D16,156971827312),(.D6,6426721846),(.D16,9408086128),(.D6,301006390),(.D16,562839664),(.D6,2129669686),(.D16,613186672),(.D6,25107766),(.D16,36751408),(.D6,1175590),(.D16,2198764),(.D6,1225140632),(.D12,5588),(.D7,9563),(.D8,337),(.D7,4)])]], + .ms [(.m2,.s6,20807927315144374222846)], + .ms2 .s6 .s7 [(.m3,774763251095801167870,235195986939796783102)], + .ms [(.m3,.s6,127974287011360014286)], + .ms2 .s6 .s7 [(.m3,889767171180334153738,1426091843604631780920),(.m0,892631460543341789296,82213211197648404022),(.m0,54060084027048591472,4705980135625457206),(.m0,3270668860633645168,267102160712367670),(.m0,197661404348547184,15005035184258614),(.m0,11931625306718320,832261582749238),(.m0,719338302603376,45419279154742),(.m0,43309376471152,2426388086326),(.m0,2603756814448,125879451190),(.m0,156292350064,6256852534),(.m0,9365618800,290389558),(.m0,560185456,2129006134),(.m0,613020784,25066294),(.m0,36741040,1172998),(.m0,2198116,1225140470)], + .ms [(.m12,.s7,5547),(.m0,.s6,9553),(.m3,.s6,335),(.m21,.s3,335),(.m4,.s3,9553),(.m4,.s3,5547)], + .ms2 .s3 .s0 [(.m13,1225140470,2198116),(.m1,1172998,36741040),(.m1,25066294,613020784),(.m1,2129006134,560185456),(.m1,290389558,9365618800),(.m1,6256852534,156292350064),(.m1,125879451190,2603756814448),(.m1,2426388086326,43309376471152),(.m1,45419279154742,719338302603376),(.m1,832261582749238,11931625306718320),(.m1,15005035184258614,197661404348547184),(.m1,267102160712367670,3270668860633645168),(.m1,4705980135625457206,54060084027048591472),(.m1,82213211197648404022,892631460543341789296),(.m1,1426091843604631780920,889767171180334153738),(.m1,127974287011360014286,235195986939796783102)], + .ms [(.m4,.s3,774763251095801167870),(.m4,.s3,20807927315144374222840),(.m10,.s7,20807927315144374222846),(.m8,.s2,20807927315144374222841)], + .m .m9, + .b 0 [[([24792424035065637371828],[(.D7,20807927315144374222846)]), + ([3099053004383204671478,1549526502191602335743,774763251095801167872,387381625547900583936,193690812773950291968,96845406386975145984,48422703193487572992,24211351596743786496,12105675798371893248,6052837899185946624,3026418949592973312,1513209474796486656,756604737398243328,378302368699121664,189151184349560832,94575592174780416,47287796087390208,23643898043695104,11821949021847552,5910974510923776,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,774763251095801167870), + (.D6,235195986939796783102), + (.D6,127974287011360014286)]), + ([96845406386975145983],[(.D16,889767171180334153738), + (.D6,1426091843604631780920), + (.D16,892631460543341789296), + (.D6,82213211197648404022), + (.D16,54060084027048591472), + (.D6,4705980135625457206), + (.D16,3270668860633645168), + (.D6,267102160712367670), + (.D16,197661404348547184), + (.D6,15005035184258614), + (.D16,11931625306718320), + (.D6,832261582749238), + (.D16,719338302603376), + (.D6,45419279154742), + (.D16,43309376471152), + (.D6,2426388086326), + (.D16,2603756814448), + (.D6,125879451190), + (.D16,156292350064), + (.D6,6256852534), + (.D16,9365618800), + (.D6,290389558), + (.D16,560185456), + (.D6,2129006134), + (.D16,613020784), + (.D6,25066294), + (.D16,36741040), + (.D6,1172998), + (.D16,2198116), + (.D6,1225140470), + (.D12,5547), + (.D16,9553), + (.D16,335), + (.D12,3)])], + [([8],[(.D15,17708874310761169551367), + (.D21,0), + (.D19,41505174165846491133)])]], + .ms [(.m2,.s6,12396212017532818685918),(.m6,.s6,17708874310761169551365),(.m7,.s5,17708874310761169551365),(.m11,.s5,12396212017532818685912)], + .m .m5, + .b 12396212017532818685918 [[([41],[(.D12,17708874310761169551365),(.D8,1),(.D7,41505174165846491132)])],[([996124179980315787142],[(.D17,17708874310761169551361),(.D2,41505174165846491130)])]], + .ms [(.m2,.s6,12894274107522976579510),(.m3,.s6,17584358788263630077968),(.m27,.s2,17584358788263630077968),(.m1,.s5,12894274107522976579504)], + .m .m5, + .b 12894274107522976579510 [[([7],[(.D16,17584358788263630077968), + (.D6,1)])], + [([16],[(.D11,17584358788263630077966), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,17584358788263630077965), + (.D17,1), + (.D15,0), + (.D6,79551583817872441294)])], + [([16],[(.D11,17584358788263630077963), + (.D3,0)])], + [([8],[(.D15,17584358788263630077962), + (.D17,1), + (.D21,79551583817872441293), + (.D15,877661495381962260490), + (.D17,1423065424655038807608), + (.D15,891874855805943545968), + (.D17,82024060013298843190), + (.D15,54012796230961201264), + (.D17,4694158186603609654), + (.D15,3267713373378183280), + (.D17,266363288898502198), + (.D15,197476686395080816), + (.D17,14958855695892022), + (.D15,11920080434626672), + (.D17,829375364726326), + (.D15,718616748097648), + (.D17,45238890528310), + (.D15,43264279314544), + (.D17,2415113797174), + (.D15,2600938242160), + (.D17,125174808118), + (.D15,156116189296), + (.D17,6212812342), + (.D15,9354608752), + (.D17,287637046), + (.D15,559497328), + (.D17,2128834102), + (.D15,612977776), + (.D17,25055542), + (.D15,36738352), + (.D17,1172326), + (.D15,2197948), + (.D17,1225140428), + (.D11,5536), + (.D12,9550)])], + [([18],[(.D11,17584358788263630077960), + (.D13,0), + (.D16,79551583817872441293), + (.D16,877661495381962260490)])], + [([2545650682171918121412],[(.D17,17584358788263630077959)]), + ([318206335271489765179,159103167635744882591,79551583817872441296,39775791908936220648,19887895954468110324,9943947977234055159,4971973988617027581,2485986994308513792,1242993497154256896,621496748577128448,310748374288564224,155374187144282112,77687093572141056,38843546786070528,19421773393035264,9710886696517632,4855443348258816,2427721674129408,1213860837064704,606930418532352,303465209266176,151732604633088,75866302316544,37933151158272,18966575579136,9483287789568,4741643894784,2370821947392,1185410973696,592705486848,296352743424,148176371712,74088185856,37044092928,18522046464,9261023232,4630511616,2315255808,1157627904,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,79551583817872441294), + (.D17,877661495381962260490)]), + ([39775791908936220647],[(.D6,1423065424655038807608), + (.D16,891874855805943545968), + (.D6,82024060013298843190), + (.D16,54012796230961201264), + (.D6,4694158186603609654), + (.D16,3267713373378183280), + (.D6,266363288898502198), + (.D16,197476686395080816), + (.D6,14958855695892022), + (.D16,11920080434626672), + (.D6,829375364726326), + (.D16,718616748097648), + (.D6,45238890528310), + (.D16,43264279314544), + (.D6,2415113797174), + (.D16,2600938242160), + (.D6,125174808118), + (.D16,156116189296), + (.D6,6212812342), + (.D16,9354608752), + (.D6,287637046), + (.D16,559497328), + (.D6,2128834102), + (.D16,612977776), + (.D6,25055542), + (.D16,36738352), + (.D6,1172326), + (.D16,2197948), + (.D6,1225140428), + (.D12,5537), + (.D13,9550), + (.D9,334), + (.D13,3)])], + [([10],[(.D17,17266152452992140312783), + (.D21,0), + (.D19,857773599427494150166)])]], + .ms [(.m2,.s6,14167099448608935640258),(.m3,.s6,17266152452992140312781),(.m7,.s5,17266152452992140312781),(.m4,.s5,14167099448608935640252)], + .m .m5, + .b 14167099448608935640258 [[([43],[(.D16,17266152452992140312781),(.D8,1),(.D7,857773599427494150165)])],[([20586566386259859603930],[(.D11,17266152452992140312774),(.D2,857773599427494150163)])]], + .ms2 .s6 .s7 [(.m2,24460382641738865442245,14692831654709657862285)], + .ms [(.m29,.s2,14692831654709657862285),(.m4,.s5,24460382641738865442239)], + .m .m5, + .b 24460382641738865442245 [[([9],[(.D6,14692831654709657862285),(.D6,1)])],[([20],[(.D15,14692831654709657862283),(.D13,0),(.D10,1418093450666421780026),(.D9,890631862308789289072)])],[([36],[(.D11,14692831654709657862279)]),([7,2],[(.D12,1),(.D6,1418093450666421780026)])]], + .ms [(.m2,.s6,24460382641738865442278),(.m6,.s6,14692831654709657862275),(.m15,.s5,14692831654709657862275),(.m11,.s5,24460382641738865442272)], + .m .m5, + .b 24460382641738865442278 [[([5],[(.D12,14692831654709657862275),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,24460382641738865442281,14692831654709657862276)], + .ms [(.m23,.s1,14692831654709657862276),(.m22,.s4,24460382641738865442275)], + .m .m24, + .b 24460382641738865442281 [[([17],[(.D6,14692831654709657862276),(.D6,2)])],[([6],[(.D11,14692831654709657862272),(.D21,0),(.D7,1418093450666421780024)])]], + .ms2 .s6 .s7 [(.m2,24460382641738865442293,14692831654709657862273)], + .ms2 .s5 .s2 [(.m28,14692831654709657862273,24460382641738865442288)], + .m .m18, + .b 24460382641738865442293 [[([45],[(.D6,14692831654709657862273),(.D8,1),(.D17,1418093450666421780023),(.D10,890631862308789289071)])],[([36],[(.D15,14692831654709657862266)]),([7,2],[(.D12,1),(.D17,1418093450666421780022)]),([1],[(.D11,890631862308789289071),(.D16,81713311639010278966)])],[([8],[(.D15,14692831654709657862262),(.D21,0),(.D17,1418093450666421780021),(.D12,890631862308789289072)])]], + .ms [(.m2,.s6,24460382641738865442338),(.m6,.s6,14692831654709657862260),(.m7,.s5,14692831654709657862260),(.m11,.s5,24460382641738865442332)], + .m .m5, + .b 24460382641738865442338 [[([39],[(.D12,14692831654709657862260),(.D8,1418093450666421780022),(.D13,890631862308789289072),(.D17,81713311639010278966),(.D15,53935109137389060208),(.D17,4674736413210574390),(.D15,3262857930029924464),(.D17,265149428061437494),(.D15,197173221185814640),(.D17,14882989393575478),(.D15,11901113859047536),(.D17,824633720831542),(.D15,717431337123952),(.D17,44942537784886),(.D15,43190191128688),(.D17,2396591750710),(.D15,2596307730544),(.D17,124017180214),(.D15,155826782320),(.D17,6140460598),(.D15,9336520816),(.D17,283115062),(.D15,558366832),(.D17,2128551478),(.D15,612907120),(.D17,25037878),(.D15,36733936),(.D17,1171222),(.D15,2197672),(.D17,1225140359),(.D17,5521),(.D11,9545),(.D17,334),(.D15,3)])]], + .ms [(.m2,.s6,24460382641738865442358)], + .ms2 .s6 .s7 [(.m3,14692831654709657862256,1418093450666421780022),(.m0,890631862308789289072,81713311639010278966),(.m0,53935109137389060208,4674736413210574390),(.m0,3262857930029924464,265149428061437494),(.m0,197173221185814640,14882989393575478),(.m0,11901113859047536,824633720831542),(.m0,717431337123952,44942537784886),(.m0,43190191128688,2396591750710),(.m0,2596307730544,124017180214),(.m0,155826782320,6140460598),(.m0,9336520816,283115062),(.m0,558366832,2128551478),(.m0,612907120,25037878),(.m0,36733936,1171222),(.m0,2197672,1225140359)], + .ms [(.m3,.s6,5521)], + .ms2 .s6 .s7 [(.m6,9545,334)], + .ms2 .s3 .s0 [(.m19,334,9545)], + .ms [(.m17,.s0,5521)], + .ms2 .s3 .s0 [(.m4,1225140359,2197672),(.m1,1171222,36733936),(.m1,25037878,612907120),(.m1,2128551478,558366832),(.m1,283115062,9336520816),(.m1,6140460598,155826782320),(.m1,124017180214,2596307730544),(.m1,2396591750710,43190191128688),(.m1,44942537784886,717431337123952),(.m1,824633720831542,11901113859047536),(.m1,14882989393575478,197173221185814640),(.m1,265149428061437494,3262857930029924464),(.m1,4674736413210574390,53935109137389060208),(.m1,81713311639010278966,890631862308789289072),(.m1,1418093450666421780022,14692831654709657862256)], + .ms [(.m1,.s3,24460382641738865442352),(.m10,.s7,24460382641738865442358),(.m8,.s2,24460382641738865442353)], + .m .m9, + .b 0 [[([747093134985236840444],[(.D7,24460382641738865442358),(.D17,14692831654709657862256),(.D6,1418093450666421780022),(.D16,890631862308789289072),(.D6,81713311639010278966),(.D16,53935109137389060208),(.D6,4674736413210574390),(.D16,3262857930029924464),(.D6,265149428061437494),(.D16,197173221185814640),(.D6,14882989393575478),(.D16,11901113859047536),(.D6,824633720831542),(.D16,717431337123952),(.D6,44942537784886),(.D16,43190191128688),(.D6,2396591750710),(.D16,2596307730544),(.D6,124017180214),(.D16,155826782320),(.D6,6140460598),(.D16,9336520816),(.D6,283115062),(.D16,558366832),(.D6,2128551478),(.D16,612907120),(.D6,25037878),(.D16,36733936),(.D6,1171222),(.D16,2197672),(.D6,1225140359),(.D6,5521),(.D12,9545),(.D6,334),(.D16,4)])]], + .ms [(.m2,.s6,373546567492618420222),(.m3,.s6,24366995999865710837302)], + .ms2 .s6 .s7 [(.m3,14669484994241369210992,1412256785549349617206),(.m0,889172696029521248368,81348520069193268790),(.m0,53843911244934807664,4651936940097011254),(.m0,3257158061751533680,263724460991839798),(.m0,196816979418415216,14793928951725622),(.m0,11878848748585072,819067443215926),(.m0,716039767720048,44594645433910),(.m0,43103218040944,2374848478774),(.m0,2590871912560,122658225718),(.m0,155487043696,6055525942),(.m0,9315287152,277806646),(.m0,557039728,2128219702),(.m0,612824176,25017142),(.m0,36728752,1169926),(.m0,2197348,1225140278)], + .ms [(.m12,.s7,5499),(.m0,.s6,9541),(.m3,.s6,332),(.m20,.s0,332),(.m1,.s3,9541),(.m4,.s3,5499)], + .ms2 .s3 .s0 [(.m13,1225140278,2197348),(.m1,1169926,36728752),(.m1,25017142,612824176),(.m1,2128219702,557039728),(.m1,277806646,9315287152),(.m1,6055525942,155487043696),(.m1,122658225718,2590871912560),(.m1,2374848478774,43103218040944),(.m1,44594645433910,716039767720048),(.m1,819067443215926,11878848748585072),(.m1,14793928951725622,196816979418415216),(.m1,263724460991839798,3257158061751533680),(.m1,4651936940097011254,53843911244934807664),(.m1,81348520069193268790,889172696029521248368),(.m1,1412256785549349617206,14669484994241369210992)], + .ms [(.m1,.s3,24366995999865710837302),(.m4,.s3,373546567492618420216),(.m10,.s7,373546567492618420222),(.m8,.s2,373546567492618420217)], + .m .m9, + .b 0 [[([1494186269970473680886,747093134985236840445,373546567492618420224,186773283746309210112,93386641873154605056,46693320936577302528,23346660468288651264,11673330234144325632,5836665117072162816,2918332558536081408,1459166279268040704,729583139634020352,364791569817010176,182395784908505088,91197892454252544,45598946227126272,22799473113563136,11399736556781568,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,373546567492618420222), + (.D17,24366995999865710837302)]), + ([186773283746309210110],[(.D16,14669484994241369210992), + (.D6,1412256785549349617206), + (.D16,889172696029521248368), + (.D6,81348520069193268790), + (.D16,53843911244934807664), + (.D6,4651936940097011254), + (.D16,3257158061751533680), + (.D6,263724460991839798), + (.D16,196816979418415216), + (.D6,14793928951725622), + (.D16,11878848748585072), + (.D6,819067443215926), + (.D16,716039767720048), + (.D6,44594645433910), + (.D16,43103218040944), + (.D6,2374848478774), + (.D16,2590871912560), + (.D6,122658225718), + (.D16,155487043696), + (.D6,6055525942), + (.D16,9315287152), + (.D6,277806646), + (.D16,557039728), + (.D6,2128219702), + (.D16,612824176), + (.D6,25017142), + (.D16,36728752), + (.D6,1169926), + (.D16,2197348), + (.D6,1225140278), + (.D12,5499), + (.D16,9541), + (.D16,332), + (.D6,5)])]], + .ms [(.m2,.s6,1494186269970473680885),(.m14,.s5,1494186269970473680879)], + .m .m5, + .b 1494186269970473680885 [[([5],[(.D18,1),(.D15,24273609357992556232245),(.D14,14646138333773080559728)])]], + .ms [(.m2,.s6,1494186269970473680888),(.m7,.s5,1494186269970473680882)], + .m .m5, + .b 1494186269970473680888 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,1494186269970473680889),(.m15,.s5,1494186269970473680883)], + ] (by decide +kernel) +theorem chunk_24_step : (cfg_24.denote) [qi]⊢* (cfg_25.denote) := + step_chunk [ + .m .m5, + .b 1494186269970473680889 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,1494186269970473680890),(.m25,.s2,1494186269970473680885)], + .m .m18, + .b 1494186269970473680890 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,1494186269970473680892),(.m14,.s5,1494186269970473680886)], + .m .m5, + .b 1494186269970473680892 [[([5],[(.D18,1),(.D17,24273609357992556232244),(.D15,14646138333773080559728),(.D17,1406420120432277454390),(.D15,887713529750253207664),(.D17,80983728499376258614),(.D15,53752713352480555120),(.D17,4629137466983448118),(.D15,3251458193473142896),(.D17,262299493922242102),(.D15,196460737651015792),(.D17,14704868509875766),(.D15,11856583638122608),(.D17,813501165600310),(.D15,714648198316144),(.D17,44246753082934),(.D15,43016244953200),(.D17,2353105206838),(.D15,2585436094576),(.D17,121299271222),(.D15,155147305072),(.D17,5970591286),(.D15,9294053488),(.D17,272498230),(.D15,555712624),(.D17,2127887926),(.D15,612741232),(.D17,24996406),(.D15,36723568),(.D17,1168630),(.D15,2197024),(.D17,1225140197),(.D17,5480),(.D8,9535)])]], + .ms [(.m2,.s6,1494186269970473680895),(.m7,.s5,1494186269970473680889)], + .m .m5, + .b 1494186269970473680895 [[([1023794296090880114685],[(.D8,24273609357992556232244),(.D16,14646138333773080559728),(.D6,1406420120432277454390),(.D16,887713529750253207664),(.D6,80983728499376258614),(.D16,53752713352480555120),(.D6,4629137466983448118),(.D16,3251458193473142896),(.D6,262299493922242102),(.D16,196460737651015792),(.D6,14704868509875766),(.D16,11856583638122608),(.D6,813501165600310),(.D16,714648198316144),(.D6,44246753082934),(.D16,43016244953200),(.D6,2353105206838),(.D16,2585436094576),(.D6,121299271222),(.D16,155147305072),(.D6,5970591286),(.D16,9294053488),(.D6,272498230),(.D16,555712624),(.D6,2127887926),(.D16,612741232),(.D6,24996406),(.D16,36723568),(.D6,1168630),(.D16,2197024),(.D6,1225140197),(.D6,5481),(.D9,9535),(.D14,330),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,2006083418015913738238,24145635070981196217910),(.m0,14614144762020240556144,1398421727494067453494),(.m0,885713931515700707440,80483828940738133558),(.m0,53627738462821023856,4597893744568565302),(.m0,3243647262869422192,260346761271311926),(.m0,195972554488283248,14582822719192630),(.m0,11826072190451824,805873303682614),(.m0,712741232836720,43770011713078),(.m0,42897059610736,2323308871222),(.m0,2577987010672,119437000246),(.m0,154681737328,5854199350),(.m0,9264955504,265223734),(.m0,553894000,2127433270),(.m0,612627568,24967990),(.m0,36716464,1166854),(.m0,2196580,1225140086)], + .ms [(.m12,.s7,5451),(.m0,.s6,9529),(.m3,.s6,329),(.m21,.s3,329),(.m4,.s3,9529),(.m4,.s3,5451)], + .ms2 .s3 .s0 [(.m13,1225140086,2196580),(.m1,1166854,36716464),(.m1,24967990,612627568),(.m1,2127433270,553894000),(.m1,265223734,9264955504),(.m1,5854199350,154681737328),(.m1,119437000246,2577987010672),(.m1,2323308871222,42897059610736),(.m1,43770011713078,712741232836720),(.m1,805873303682614,11826072190451824),(.m1,14582822719192630,195972554488283248),(.m1,260346761271311926,3243647262869422192),(.m1,4597893744568565302,53627738462821023856),(.m1,80483828940738133558,885713931515700707440),(.m1,1398421727494067453494,14614144762020240556144),(.m1,24145635070981196217910,2006083418015913738233)], + .ms [(.m26,.s7,2006083418015913738238),(.m8,.s2,2006083418015913738233)], + .m .m9, + .b 0 [[([4095177184363520458748],[(.D7,2006083418015913738238),(.D7,24145635070981196217909),(.D16,14614144762020240556144),(.D6,1398421727494067453494),(.D16,885713931515700707440),(.D6,80483828940738133558),(.D16,53627738462821023856),(.D6,4597893744568565302),(.D16,3243647262869422192),(.D6,260346761271311926),(.D16,195972554488283248),(.D6,14582822719192630),(.D16,11826072190451824),(.D6,805873303682614),(.D16,712741232836720),(.D6,43770011713078),(.D16,42897059610736),(.D6,2323308871222),(.D16,2577987010672),(.D6,119437000246),(.D16,154681737328),(.D6,5854199350),(.D16,9264955504),(.D6,265223734),(.D16,553894000),(.D6,2127433270),(.D16,612627568),(.D6,24967990),(.D16,36716464),(.D6,1166854),(.D16,2196580),(.D6,1225140086),(.D12,5451),(.D16,9529),(.D16,329),(.D12,3)])]], + .ms [(.m2,.s6,2047588592181760229374)], + .ms2 .s6 .s7 [(.m3,1494186269970473680894,24017660783969836203574),(.m0,14582151190267400552560,1390423334555857452598),(.m0,883714333281148207216,79983929382100008502),(.m0,53502763573161492592,4566650022153682486),(.m0,3235836332265701488,258394028620381750),(.m0,195484371325550704,14460776928509494),(.m0,11795560742781040,798245441764918),(.m0,710834267357296,43293270343222),(.m0,42777874268272,2293512535606),(.m0,2570537926768,117574729270),(.m0,154216169584,5737807414),(.m0,9235857520,257949238),(.m0,552075376,2126978614),(.m0,612513904,24939574),(.m0,36709360,1165078),(.m0,2196136,1225139975)], + .ms [(.m3,.s6,5425)], + .ms2 .s6 .s7 [(.m6,9521,328)], + .ms2 .s3 .s0 [(.m19,328,9521)], + .ms [(.m17,.s0,5425)], + .ms2 .s3 .s0 [(.m4,1225139975,2196136),(.m1,1165078,36709360),(.m1,24939574,612513904),(.m1,2126978614,552075376),(.m1,257949238,9235857520),(.m1,5737807414,154216169584),(.m1,117574729270,2570537926768),(.m1,2293512535606,42777874268272),(.m1,43293270343222,710834267357296),(.m1,798245441764918,11795560742781040),(.m1,14460776928509494,195484371325550704),(.m1,258394028620381750,3235836332265701488),(.m1,4566650022153682486,53502763573161492592),(.m1,79983929382100008502,883714333281148207216),(.m1,1390423334555857452598,14582151190267400552560),(.m1,24017660783969836203574,1494186269970473680894)], + .ms [(.m1,.s3,2047588592181760229368),(.m10,.s7,2047588592181760229374),(.m8,.s2,2047588592181760229369)], + .m .m9, + .b 0 [[([8190354368727040917494,3763135791036748529670],[(.D7,2047588592181760229374),(.D17,1494186269970473680894)]),([747093134985236840447],[(.D6,24017660783969836203574),(.D16,14582151190267400552560),(.D6,1390423334555857452598),(.D16,883714333281148207216),(.D6,79983929382100008502),(.D16,53502763573161492592),(.D6,4566650022153682486),(.D16,3235836332265701488),(.D6,258394028620381750),(.D16,195484371325550704),(.D6,14460776928509494),(.D16,11795560742781040),(.D6,798245441764918),(.D16,710834267357296),(.D6,43293270343222),(.D16,42777874268272),(.D6,2293512535606),(.D16,2570537926768),(.D6,117574729270),(.D16,154216169584),(.D6,5737807414),(.D16,9235857520),(.D6,257949238),(.D16,552075376),(.D6,2126978614),(.D16,612513904),(.D6,24939574),(.D16,36709360),(.D6,1165078),(.D16,2196136),(.D6,1225139975),(.D6,5425),(.D12,9521),(.D6,328),(.D16,4)])]], + .ms [(.m2,.s6,5976745079881894723582),(.m3,.s6,553402322211286548478)], + .ms2 .s6 .s7 [(.m3,1120639702477855260670,23924274142096681598518),(.m0,14558804529799111901296,1384586669438785289782),(.m0,882255167001880166512,79619137812282998326),(.m0,53411565680707240048,4543850549040119350),(.m0,3230136463987310704,256969061550784054),(.m0,195128129558151280,14371716486659638),(.m0,11773295632318576,792679164149302),(.m0,709442697953392,42945377992246),(.m0,42690901180528,2271769263670),(.m0,2565102108784,116215774774),(.m0,153876430960,5652872758),(.m0,9214623856,252640822),(.m0,550748272,2126646838),(.m0,612430960,24918838),(.m0,36704176,1163782),(.m0,2195812,1225139894)], + .ms [(.m12,.s7,5403),(.m0,.s6,9517),(.m3,.s6,326),(.m20,.s0,326),(.m1,.s3,9517),(.m4,.s3,5403)], + .ms2 .s3 .s0 [(.m13,1225139894,2195812),(.m1,1163782,36704176),(.m1,24918838,612430960),(.m1,2126646838,550748272),(.m1,252640822,9214623856),(.m1,5652872758,153876430960),(.m1,116215774774,2565102108784),(.m1,2271769263670,42690901180528),(.m1,42945377992246,709442697953392),(.m1,792679164149302,11773295632318576),(.m1,14371716486659638,195128129558151280),(.m1,256969061550784054,3230136463987310704),(.m1,4543850549040119350,53411565680707240048),(.m1,79619137812282998326,882255167001880166512),(.m1,1384586669438785289782,14558804529799111901296),(.m1,23924274142096681598518,1120639702477855260670)], + .ms [(.m1,.s3,553402322211286548478),(.m4,.s3,5976745079881894723576),(.m10,.s7,5976745079881894723582),(.m8,.s2,5976745079881894723577)], + .m .m9, + .b 0 [[([17708874310761169551284],[(.D7,5976745079881894723582)]), + ([2213609288845146193910,1106804644422573096959,553402322211286548480,276701161105643274240,138350580552821637120,69175290276410818560,34587645138205409280,17293822569102704640,8646911284551352320,4323455642275676160,2161727821137838080,1080863910568919040,540431955284459520,270215977642229760,135107988821114880,67553994410557440,33776997205278720,16888498602639360,8444249301319680,4222124650659840,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,553402322211286548478), + (.D16,1120639702477855260670)]), + ([276701161105643274238],[(.D6,23924274142096681598518), + (.D16,14558804529799111901296), + (.D6,1384586669438785289782), + (.D16,882255167001880166512), + (.D6,79619137812282998326), + (.D16,53411565680707240048), + (.D6,4543850549040119350), + (.D16,3230136463987310704), + (.D6,256969061550784054), + (.D16,195128129558151280), + (.D6,14371716486659638), + (.D16,11773295632318576), + (.D6,792679164149302), + (.D16,709442697953392), + (.D6,42945377992246), + (.D16,42690901180528), + (.D6,2271769263670), + (.D16,2565102108784), + (.D6,116215774774), + (.D16,153876430960), + (.D6,5652872758), + (.D16,9214623856), + (.D6,252640822), + (.D16,550748272), + (.D6,2126646838), + (.D16,612430960), + (.D6,24918838), + (.D16,36704176), + (.D6,1163782), + (.D16,2195812), + (.D6,1225139894), + (.D12,5403), + (.D16,9517), + (.D16,326), + (.D6,5)])]], + .ms [(.m2,.s6,8854437155380584775642),(.m3,.s6,3763135791036748529671),(.m14,.s5,3763135791036748529671),(.m4,.s5,8854437155380584775636)], + .m .m5, + .b 8854437155380584775642 [[([23],[(.D16,3763135791036748529671),(.D18,1),(.D15,982289121925033623549),(.D16,23889686496958476189238)])]], + .ms [(.m2,.s6,8854437155380584775654),(.m3,.s6,3763135791036748529668),(.m7,.s5,3763135791036748529668),(.m4,.s5,8854437155380584775648)], + .m .m5, + .b 8854437155380584775654 [[([7],[(.D16,3763135791036748529668),(.D6,1)])]], + .ms [(.m2,.s6,8854437155380584775658),(.m6,.s6,3763135791036748529666),(.m15,.s5,3763135791036748529666),(.m11,.s5,8854437155380584775652)], + .m .m5, + .b 8854437155380584775658 [[([5],[(.D12,3763135791036748529666),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,8854437155380584775661,3763135791036748529667)], + .ms [(.m23,.s1,3763135791036748529667),(.m22,.s4,8854437155380584775655)], + .m .m24, + .b 8854437155380584775661 [[([17],[(.D6,3763135791036748529667),(.D6,2)])]], + .ms [(.m2,.s6,8854437155380584775670),(.m6,.s6,3763135791036748529663),(.m14,.s5,3763135791036748529663),(.m11,.s5,8854437155380584775664)], + .m .m5, + .b 8854437155380584775670 [[([23],[(.D12,3763135791036748529663),(.D18,1),(.D17,982289121925033623548),(.D17,23889686496958476189238),(.D15,14550157618514560548976),(.D17,1382424941617647451702),(.D15,881714735046595706992),(.D17,79484029823461883446),(.D15,53377788683501961328),(.D17,4535406299738799670),(.D15,3228025401661980784),(.D17,256441295969451574),(.D15,194996188162818160),(.D17,14338731137826358),(.D15,11765049295110256),(.D17,790617579847222),(.D15,708927301877872),(.D17,42816528973366),(.D15,42658688925808),(.D17,2263716199990),(.D15,2563088842864),(.D17,115712458294),(.D15,153750601840),(.D17,5621415478),(.D15,9206759536),(.D17,250674742),(.D15,550256752),(.D17,2126523958),(.D15,612400240),(.D17,24911158),(.D15,36702256),(.D17,1163302),(.D15,2195692),(.D17,1225139864),(.D11,5395),(.D6,9516)])]], + .ms [(.m2,.s6,8854437155380584775682),(.m6,.s6,3763135791036748529660),(.m7,.s5,3763135791036748529660),(.m11,.s5,8854437155380584775676)], + .m .m5, + .b 8854437155380584775682 [[([15052543164146994118641,7526271582073497059325,1328165573307087716361],[(.D12,3763135791036748529660),(.D8,982289121925033623548),(.D6,23889686496958476189238)]),([373546567492618420223],[(.D16,14550157618514560548976),(.D6,1382424941617647451702),(.D16,881714735046595706992),(.D6,79484029823461883446),(.D16,53377788683501961328),(.D6,4535406299738799670),(.D16,3228025401661980784),(.D6,256441295969451574),(.D16,194996188162818160),(.D6,14338731137826358),(.D16,11765049295110256),(.D6,790617579847222),(.D16,708927301877872),(.D6,42816528973366),(.D16,42658688925808),(.D6,2263716199990),(.D16,2563088842864),(.D6,115712458294),(.D16,153750601840),(.D6,5621415478),(.D16,9206759536),(.D6,250674742),(.D16,550256752),(.D6,2126523958),(.D16,612400240),(.D6,24911158),(.D16,36702256),(.D6,1163302),(.D16,2195692),(.D6,1225139864),(.D12,5396),(.D7,9515),(.D8,325),(.D7,4)])]], + .ms [(.m2,.s6,20807927315144374222846)], + .ms2 .s6 .s7 [(.m3,774763251095801167870,235195986939796783102)], + .ms [(.m3,.s6,23702913213212166979126)], + .ms2 .s6 .s7 [(.m3,14503464297577983246448,1370751611383503126070),(.m0,878796402488059625584,78754446683827863094),(.m0,53195392898593456240,4489807353511673398),(.m0,3216625665105199216,253591361830256182),(.m0,194283704628019312,14160610254126646),(.m0,11720519074185328,779485024615990),(.m0,706144163070064,42120744271414),(.m0,42484742750320,2220229656118),(.m0,2552217206896,112994549302),(.m0,153071124592,5451546166),(.m0,9164292208,240057910),(.m0,547602544,2125860406),(.m0,612234352,24869686),(.m0,36691888,1160710),(.m0,2195044,1225139702)], + .ms [(.m12,.s7,5355),(.m0,.s6,9505),(.m3,.s6,323),(.m21,.s3,323),(.m4,.s3,9505),(.m4,.s3,5355)], + .ms2 .s3 .s0 [(.m13,1225139702,2195044),(.m1,1160710,36691888),(.m1,24869686,612234352),(.m1,2125860406,547602544),(.m1,240057910,9164292208),(.m1,5451546166,153071124592),(.m1,112994549302,2552217206896),(.m1,2220229656118,42484742750320),(.m1,42120744271414,706144163070064),(.m1,779485024615990,11720519074185328),(.m1,14160610254126646,194283704628019312),(.m1,253591361830256182,3216625665105199216),(.m1,4489807353511673398,53195392898593456240),(.m1,78754446683827863094,878796402488059625584),(.m1,1370751611383503126070,14503464297577983246448),(.m1,23702913213212166979126,235195986939796783102)], + .ms [(.m4,.s3,774763251095801167870),(.m4,.s3,20807927315144374222840),(.m10,.s7,20807927315144374222846),(.m8,.s2,20807927315144374222841)], + .m .m9, + .b 0 [[([24792424035065637371828],[(.D7,20807927315144374222846)]), + ([3099053004383204671478,1549526502191602335743,774763251095801167872,387381625547900583936,193690812773950291968,96845406386975145984,48422703193487572992,24211351596743786496,12105675798371893248,6052837899185946624,3026418949592973312,1513209474796486656,756604737398243328,378302368699121664,189151184349560832,94575592174780416,47287796087390208,23643898043695104,11821949021847552,5910974510923776,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,774763251095801167870), + (.D6,235195986939796783102), + (.D6,23702913213212166979126)]), + ([96845406386975145983],[(.D16,14503464297577983246448), + (.D6,1370751611383503126070), + (.D16,878796402488059625584), + (.D6,78754446683827863094), + (.D16,53195392898593456240), + (.D6,4489807353511673398), + (.D16,3216625665105199216), + (.D6,253591361830256182), + (.D16,194283704628019312), + (.D6,14160610254126646), + (.D16,11720519074185328), + (.D6,779485024615990), + (.D16,706144163070064), + (.D6,42120744271414), + (.D16,42484742750320), + (.D6,2220229656118), + (.D16,2552217206896), + (.D6,112994549302), + (.D16,153071124592), + (.D6,5451546166), + (.D16,9164292208), + (.D6,240057910), + (.D16,547602544), + (.D6,2125860406), + (.D16,612234352), + (.D6,24869686), + (.D16,36691888), + (.D6,1160710), + (.D16,2195044), + (.D6,1225139702), + (.D12,5355), + (.D16,9505), + (.D16,323), + (.D12,3)])], + [([8],[(.D15,17708874310761169551367), + (.D21,0), + (.D19,41505174165846491133)])]], + .ms [(.m2,.s6,12396212017532818685918),(.m6,.s6,17708874310761169551365),(.m7,.s5,17708874310761169551365),(.m11,.s5,12396212017532818685912)], + .m .m5, + .b 12396212017532818685918 [[([41],[(.D12,17708874310761169551365),(.D8,1),(.D7,41505174165846491132)])],[([996124179980315787142],[(.D17,17708874310761169551361),(.D2,41505174165846491130)])]], + .ms [(.m2,.s6,12894274107522976579510),(.m3,.s6,17584358788263630077968),(.m27,.s2,17584358788263630077968),(.m1,.s5,12894274107522976579504)], + .m .m5, + .b 12894274107522976579510 [[([7],[(.D16,17584358788263630077968), + (.D6,1)])], + [([16],[(.D11,17584358788263630077966), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,17584358788263630077965), + (.D17,1), + (.D15,0), + (.D6,23654490510018679406134)])], + [([16],[(.D11,17584358788263630077963), + (.D3,0)])], + [([8],[(.D15,17584358788263630077962), + (.D17,1), + (.D21,23654490510018679406133), + (.D15,14491358621779611353200), + (.D17,1367725192433910152758), + (.D15,878039797750661382256), + (.D17,78565295499478302262), + (.D15,53148105102506066032), + (.D17,4477985404489825846), + (.D15,3213670177849737328), + (.D17,252852490016390710), + (.D15,194098986674552944), + (.D17,14114430765760054), + (.D15,11708974202093680), + (.D17,776598806593078), + (.D15,705422608564336), + (.D17,41940355644982), + (.D15,42439645593712), + (.D17,2208955366966), + (.D15,2549398634608), + (.D17,112289906230), + (.D15,152894963824), + (.D17,5407505974), + (.D15,9153282160), + (.D17,237305398), + (.D15,546914416), + (.D17,2125688374), + (.D15,612191344), + (.D17,24858934), + (.D15,36689200), + (.D17,1160038), + (.D15,2194876), + (.D17,1225139660), + (.D11,5344), + (.D12,9502)])], + [([18],[(.D11,17584358788263630077960), + (.D13,0), + (.D16,23654490510018679406133), + (.D16,14491358621779611353200)])], + [([2545650682171918122982],[(.D17,17584358788263630077959), + (.D12,23654490510018679406134), + (.D17,14491358621779611353200), + (.D6,1367725192433910152758), + (.D16,878039797750661382256), + (.D6,78565295499478302262), + (.D16,53148105102506066032), + (.D6,4477985404489825846), + (.D16,3213670177849737328), + (.D6,252852490016390710), + (.D16,194098986674552944), + (.D6,14114430765760054), + (.D16,11708974202093680), + (.D6,776598806593078), + (.D16,705422608564336), + (.D6,41940355644982), + (.D16,42439645593712), + (.D6,2208955366966), + (.D16,2549398634608), + (.D6,112289906230), + (.D16,152894963824), + (.D6,5407505974), + (.D16,9153282160), + (.D6,237305398), + (.D16,546914416), + (.D6,2125688374), + (.D16,612191344), + (.D6,24858934), + (.D16,36689200), + (.D6,1160038), + (.D16,2194876), + (.D6,1225139660), + (.D12,5345), + (.D13,9502), + (.D9,322), + (.D13,3)])]], + .ms [(.m2,.s6,14167099448608935641038)], + .ms2 .s6 .s7 [(.m3,17266152452992140312586,23574938926200806964792),(.m0,14471470725825143242864,1362753218445293125174),(.m0,876796804253507125360,78254547125189738038),(.m0,53070418008933924976,4458563631096790582),(.m0,3208814734501478512,251638629179326006),(.m0,193795521465286768,14038564463443510),(.m0,11690007626514544,771857162698294),(.m0,704237197590640,41644002901558),(.m0,42365557407856,2190433320502),(.m0,2544768122992,111132278326),(.m0,152605556848,5335154230),(.m0,9135194224,232783414),(.m0,545783920,2125405750),(.m0,612120688,24841270),(.m0,36684784,1158934),(.m0,2194600,1225139591)], + .ms [(.m3,.s6,5329)], + .ms2 .s6 .s7 [(.m6,9497,322)], + .ms2 .s3 .s0 [(.m19,322,9497)], + .ms [(.m17,.s0,5329)], + .ms2 .s3 .s0 [(.m4,1225139591,2194600),(.m1,1158934,36684784),(.m1,24841270,612120688),(.m1,2125405750,545783920),(.m1,232783414,9135194224),(.m1,5335154230,152605556848),(.m1,111132278326,2544768122992),(.m1,2190433320502,42365557407856),(.m1,41644002901558,704237197590640),(.m1,771857162698294,11690007626514544),(.m1,14038564463443510,193795521465286768),(.m1,251638629179326006,3208814734501478512),(.m1,4458563631096790582,53070418008933924976),(.m1,78254547125189738038,876796804253507125360),(.m1,1362753218445293125174,14471470725825143242864),(.m1,23574938926200806964792,17266152452992140312586)], + .ms [(.m1,.s3,14167099448608935641032),(.m10,.s7,14167099448608935641038),(.m8,.s2,14167099448608935641033)], + .m .m9, + .b 0 [[([11953490159763789447164],[(.D7,14167099448608935641038),(.D17,17266152452992140312586),(.D6,23574938926200806964792),(.D16,14471470725825143242864),(.D6,1362753218445293125174),(.D16,876796804253507125360),(.D6,78254547125189738038),(.D16,53070418008933924976),(.D6,4458563631096790582),(.D16,3208814734501478512),(.D6,251638629179326006),(.D16,193795521465286768),(.D6,14038564463443510),(.D16,11690007626514544),(.D6,771857162698294),(.D16,704237197590640),(.D6,41644002901558),(.D16,42365557407856),(.D6,2190433320502),(.D16,2544768122992),(.D6,111132278326),(.D16,152605556848),(.D6,5335154230),(.D16,9135194224),(.D6,232783414),(.D16,545783920),(.D6,2125405750),(.D16,612120688),(.D6,24841270),(.D16,36684784),(.D6,1158934),(.D16,2194600),(.D6,1225139591),(.D6,5329),(.D12,9497),(.D6,322),(.D16,4)])]], + .ms [(.m2,.s6,5976745079881894723582),(.m3,.s6,12672913178638461960142)], + .ms2 .s6 .s7 [(.m3,16892605885499521892362,23481552284327652359736),(.m0,14448124065356854591600,1356916553328220962358),(.m0,875337637974239084656,77889755555372727862),(.m0,52979220116479672432,4435764157983227446),(.m0,3203114866223087728,250213662109728310),(.m0,193439279697887344,13949504021593654),(.m0,11667742516052080,766290885082678),(.m0,702845628186736,41296110550582),(.m0,42278584320112,2168690048566),(.m0,2539332305008,109773323830),(.m0,152265818224,5250219574),(.m0,9113960560,227474998),(.m0,544456816,2125073974),(.m0,612037744,24820534),(.m0,36679600,1157638),(.m0,2194276,1225139510)], + .ms [(.m12,.s7,5307),(.m0,.s6,9493),(.m3,.s6,320),(.m20,.s0,320),(.m1,.s3,9493),(.m4,.s3,5307)], + .ms2 .s3 .s0 [(.m13,1225139510,2194276),(.m1,1157638,36679600),(.m1,24820534,612037744),(.m1,2125073974,544456816),(.m1,227474998,9113960560),(.m1,5250219574,152265818224),(.m1,109773323830,2539332305008),(.m1,2168690048566,42278584320112),(.m1,41296110550582,702845628186736),(.m1,766290885082678,11667742516052080),(.m1,13949504021593654,193439279697887344),(.m1,250213662109728310,3203114866223087728),(.m1,4435764157983227446,52979220116479672432),(.m1,77889755555372727862,875337637974239084656),(.m1,1356916553328220962358,14448124065356854591600),(.m1,23481552284327652359736,16892605885499521892362)], + .ms [(.m1,.s3,12672913178638461960142),(.m4,.s3,5976745079881894723576),(.m10,.s7,5976745079881894723582),(.m8,.s2,5976745079881894723577)], + .m .m9, + .b 0 [[([23906980319527578894326,11953490159763789447165,5976745079881894723584,2988372539940947361792,1494186269970473680896,747093134985236840448,373546567492618420224,186773283746309210112,93386641873154605056,46693320936577302528,23346660468288651264,11673330234144325632,5836665117072162816,2918332558536081408,1459166279268040704,729583139634020352,364791569817010176,182395784908505088,91197892454252544,45598946227126272,22799473113563136,11399736556781568,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,5976745079881894723582), + (.D17,12672913178638461960142)]), + ([2988372539940947361790],[(.D16,16892605885499521892362), + (.D6,23481552284327652359736), + (.D16,14448124065356854591600), + (.D6,1356916553328220962358), + (.D16,875337637974239084656), + (.D6,77889755555372727862), + (.D16,52979220116479672432), + (.D6,4435764157983227446), + (.D16,3203114866223087728), + (.D6,250213662109728310), + (.D16,193439279697887344), + (.D6,13949504021593654), + (.D16,11667742516052080), + (.D6,766290885082678), + (.D16,702845628186736), + (.D6,41296110550582), + (.D16,42278584320112), + (.D6,2168690048566), + (.D16,2539332305008), + (.D6,109773323830), + (.D16,152265818224), + (.D6,5250219574), + (.D16,9113960560), + (.D6,227474998), + (.D16,544456816), + (.D6,2125073974), + (.D16,612037744), + (.D6,24820534), + (.D16,36679600), + (.D6,1157638), + (.D16,2194276), + (.D6,1225139510), + (.D12,5307), + (.D16,9493), + (.D16,320), + (.D6,5)])]], + .ms [(.m2,.s6,23906980319527578894325),(.m14,.s5,23906980319527578894319)], + .m .m5, + .b 23906980319527578894325 [[([5],[(.D18,1),(.D15,11178726908667988279245),(.D14,16519059318006903472138)])]], + .ms [(.m2,.s6,23906980319527578894328),(.m7,.s5,23906980319527578894322)], + .m .m5, + .b 23906980319527578894328 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,23906980319527578894329),(.m15,.s5,23906980319527578894323)], + .m .m5, + .b 23906980319527578894329 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,23906980319527578894330),(.m25,.s2,23906980319527578894325)], + .m .m18, + .b 23906980319527578894330 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,23906980319527578894332),(.m14,.s5,23906980319527578894326)], + .m .m5, + .b 23906980319527578894332 [[([5],[(.D18,1),(.D17,11178726908667988279244),(.D15,16519059318006903472138),(.D17,23388165642454497754680),(.D15,14424777404888565940336),(.D17,1351079888211148799542),(.D15,873878471694971043952),(.D17,77524963985555717686),(.D15,52888022224025419888),(.D17,4412964684869664310),(.D15,3197414997944696944),(.D17,248788695040130614),(.D15,193083037930487920),(.D17,13860443579743798),(.D15,11645477405589616),(.D17,760724607467062),(.D15,701454058782832),(.D17,40948218199606),(.D15,42191611232368),(.D17,2146946776630),(.D15,2533896487024),(.D17,108414369334),(.D15,151926079600),(.D17,5165284918),(.D15,9092726896),(.D17,222166582),(.D15,543129712),(.D17,2124742198),(.D15,611954800),(.D17,24799798),(.D15,36674416),(.D17,1156342),(.D15,2193952),(.D17,1225139429),(.D17,5288),(.D8,9487)])]], + .ms [(.m2,.s6,23906980319527578894335),(.m7,.s5,23906980319527578894329)], + .m .m5, + .b 23906980319527578894335 [[([16380708737454081835005],[(.D8,11178726908667988279244),(.D16,16519059318006903472138),(.D6,23388165642454497754680),(.D16,14424777404888565940336),(.D6,1351079888211148799542),(.D16,873878471694971043952),(.D6,77524963985555717686),(.D16,52888022224025419888),(.D6,4412964684869664310),(.D16,3197414997944696944),(.D6,248788695040130614),(.D16,193083037930487920),(.D6,13860443579743798),(.D16,11645477405589616),(.D6,760724607467062),(.D16,701454058782832),(.D6,40948218199606),(.D16,42191611232368),(.D6,2146946776630),(.D16,2533896487024),(.D6,108414369334),(.D16,151926079600),(.D6,5165284918),(.D16,9092726896),(.D6,222166582),(.D16,543129712),(.D6,2124742198),(.D16,611954800),(.D6,24799798),(.D16,36674416),(.D6,1156342),(.D16,2193952),(.D6,1225139429),(.D6,5289),(.D9,9487),(.D14,318),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,32097334688254619811838,9131138316486228049870),(.m0,16007162169961463414794,23260191355443137740344),(.m0,14392783833135725936752,1343081495272938798646),(.m0,871878873460418543728,77025064426917592630),(.m0,52763047334365888624,4381720962454781494),(.m0,3189604067340976240,246835962389200438),(.m0,192594854767755376,13738397789060662),(.m0,11614965957918832,753096745549366),(.m0,699547093303408,40471476829750),(.m0,42072425889904,2117150441014),(.m0,2526447403120,106552098358),(.m0,151460511856,5048892982),(.m0,9063628912,214892086),(.m0,541311088,2124287542),(.m0,611841136,24771382),(.m0,36667312,1154566),(.m0,2193508,1225139318)], + .ms [(.m12,.s7,5259),(.m0,.s6,9481),(.m3,.s6,317),(.m21,.s3,317),(.m4,.s3,9481),(.m4,.s3,5259)], + .ms2 .s3 .s0 [(.m13,1225139318,2193508),(.m1,1154566,36667312),(.m1,24771382,611841136),(.m1,2124287542,541311088),(.m1,214892086,9063628912),(.m1,5048892982,151460511856),(.m1,106552098358,2526447403120),(.m1,2117150441014,42072425889904),(.m1,40471476829750,699547093303408),(.m1,753096745549366,11614965957918832),(.m1,13738397789060662,192594854767755376),(.m1,246835962389200438,3189604067340976240),(.m1,4381720962454781494,52763047334365888624),(.m1,77025064426917592630,871878873460418543728),(.m1,1343081495272938798646,14392783833135725936752),(.m1,23260191355443137740344,16007162169961463414794),(.m1,9131138316486228049870,32097334688254619811833)], + .ms [(.m26,.s7,32097334688254619811838),(.m8,.s2,32097334688254619811833)], + .m .m9, + .b 0 [[([65522834949816327340028],[(.D7,32097334688254619811838),(.D7,9131138316486228049869),(.D16,16007162169961463414794),(.D6,23260191355443137740344),(.D16,14392783833135725936752),(.D6,1343081495272938798646),(.D16,871878873460418543728),(.D6,77025064426917592630),(.D16,52763047334365888624),(.D6,4381720962454781494),(.D16,3189604067340976240),(.D6,246835962389200438),(.D16,192594854767755376),(.D6,13738397789060662),(.D16,11614965957918832),(.D6,753096745549366),(.D16,699547093303408),(.D6,40471476829750),(.D16,42072425889904),(.D6,2117150441014),(.D16,2526447403120),(.D6,106552098358),(.D16,151460511856),(.D6,5048892982),(.D16,9063628912),(.D6,214892086),(.D16,541311088),(.D6,2124287542),(.D16,611841136),(.D6,24771382),(.D16,36667312),(.D6,1154566),(.D16,2193508),(.D6,1225139318),(.D12,5259),(.D16,9481),(.D16,317),(.D12,3)])]], + .ms [(.m2,.s6,32761417474908163670014)], + .ms2 .s6 .s7 [(.m3,23906980319527578894334,7083549724304467820494),(.m0,15495265021916023357450,23132217068431777726008),(.m0,14360790261382885933168,1335083102334728797750),(.m0,869879275225866043504,76525164868279467574),(.m0,52638072444706357360,4350477240039898678),(.m0,3181793136737255536,244883229738270262),(.m0,192106671605022832,13616351998377526),(.m0,11584454510248048,745468883631670),(.m0,697640127823984,39994735459894),(.m0,41953240547440,2087354105398),(.m0,2518998319216,104689827382),(.m0,150994944112,4932501046),(.m0,9034530928,207617590),(.m0,539492464,2123832886),(.m0,611727472,24742966),(.m0,36660208,1152790),(.m0,2193064,1225139207)], + .ms [(.m3,.s6,5233)], + .ms2 .s6 .s7 [(.m6,9473,316)], + .ms2 .s3 .s0 [(.m19,316,9473)], + .ms [(.m17,.s0,5233)], + .ms2 .s3 .s0 [(.m4,1225139207,2193064),(.m1,1152790,36660208),(.m1,24742966,611727472),(.m1,2123832886,539492464),(.m1,207617590,9034530928),(.m1,4932501046,150994944112),(.m1,104689827382,2518998319216),(.m1,2087354105398,41953240547440),(.m1,39994735459894,697640127823984),(.m1,745468883631670,11584454510248048),(.m1,13616351998377526,192106671605022832),(.m1,244883229738270262,3181793136737255536),(.m1,4350477240039898678,52638072444706357360),(.m1,76525164868279467574,869879275225866043504),(.m1,1335083102334728797750,14360790261382885933168),(.m1,23132217068431777726008,15495265021916023357450),(.m1,7083549724304467820494,23906980319527578894334)], + .ms [(.m1,.s3,32761417474908163670008),(.m10,.s7,32761417474908163670014),(.m8,.s2,32761417474908163670009)], + .m .m9, + .b 0 [[([131045669899632654680054,60210172656587976474630],[(.D7,32761417474908163670014),(.D17,23906980319527578894334)]),([11953490159763789447167],[(.D6,7083549724304467820494),(.D16,15495265021916023357450),(.D6,23132217068431777726008),(.D16,14360790261382885933168),(.D6,1335083102334728797750),(.D16,869879275225866043504),(.D6,76525164868279467574),(.D16,52638072444706357360),(.D6,4350477240039898678),(.D16,3181793136737255536),(.D6,244883229738270262),(.D16,192106671605022832),(.D6,13616351998377526),(.D16,11584454510248048),(.D6,745468883631670),(.D16,697640127823984),(.D6,39994735459894),(.D16,41953240547440),(.D6,2087354105398),(.D16,2518998319216),(.D6,104689827382),(.D16,150994944112),(.D6,4932501046),(.D16,9034530928),(.D6,207617590),(.D16,539492464),(.D6,2123832886),(.D16,611727472),(.D6,24742966),(.D16,36660208),(.D6,1152790),(.D16,2193064),(.D6,1225139207),(.D6,5233),(.D12,9473),(.D6,316),(.D16,4)])]], + .ms [(.m2,.s6,95627921278110315577342),(.m3,.s6,8854437155380584775678)], + .ms2 .s6 .s7 [(.m3,17930235239645684170750,5589363454333994139598),(.m0,15121718454423404937226,23038830426558623120952),(.m0,14337443600914597281904,1329246437217656634934),(.m0,868420108946598002800,76160373298462457398),(.m0,52546874552252104816,4327677766926335542),(.m0,3176093268458864752,243458262668672566),(.m0,191750429837623408,13527291556527670),(.m0,11562189399785584,739902606016054),(.m0,696248558420080,39646843108918),(.m0,41866267459696,2065610833462),(.m0,2513562501232,103330872886),(.m0,150655205488,4847566390),(.m0,9013297264,202309174),(.m0,538165360,2123501110)], + .ms [(.m0,.s6,611644528)], + ] (by decide +kernel) +theorem chunk_25_step : (cfg_25.denote) [qi]⊢* (cfg_26.denote) := + step_chunk [ + .s .s7 24722230, + .ms2 .s6 .s7 [(.m0,36655024,1151494),(.m0,2192740,1225139126)], + .ms [(.m12,.s7,5211),(.m0,.s6,9469),(.m3,.s6,314),(.m20,.s0,314),(.m1,.s3,9469),(.m4,.s3,5211)], + .ms2 .s3 .s0 [(.m13,1225139126,2192740),(.m1,1151494,36655024),(.m1,24722230,611644528),(.m1,2123501110,538165360),(.m1,202309174,9013297264),(.m1,4847566390,150655205488),(.m1,103330872886,2513562501232),(.m1,2065610833462,41866267459696),(.m1,39646843108918,696248558420080),(.m1,739902606016054,11562189399785584),(.m1,13527291556527670,191750429837623408),(.m1,243458262668672566,3176093268458864752),(.m1,4327677766926335542,52546874552252104816),(.m1,76160373298462457398,868420108946598002800),(.m1,1329246437217656634934,14337443600914597281904),(.m1,23038830426558623120952,15121718454423404937226),(.m1,5589363454333994139598,17930235239645684170750)], + .ms [(.m1,.s3,8854437155380584775678),(.m4,.s3,95627921278110315577336),(.m10,.s7,95627921278110315577342),(.m8,.s2,95627921278110315577337)], + .m .m9, + .b 0 [[([283341988972178712821684],[(.D7,95627921278110315577342)]), + ([35417748621522339102710,17708874310761169551359,8854437155380584775680,4427218577690292387840,2213609288845146193920,1106804644422573096960,553402322211286548480,276701161105643274240,138350580552821637120,69175290276410818560,34587645138205409280,17293822569102704640,8646911284551352320,4323455642275676160,2161727821137838080,1080863910568919040,540431955284459520,270215977642229760,135107988821114880,67553994410557440,33776997205278720,16888498602639360,8444249301319680,4222124650659840,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,8854437155380584775678), + (.D16,17930235239645684170750)]), + ([4427218577690292387838],[(.D6,5589363454333994139598), + (.D16,15121718454423404937226), + (.D6,23038830426558623120952), + (.D16,14337443600914597281904), + (.D6,1329246437217656634934), + (.D16,868420108946598002800), + (.D6,76160373298462457398), + (.D16,52546874552252104816), + (.D6,4327677766926335542), + (.D16,3176093268458864752), + (.D6,243458262668672566), + (.D16,191750429837623408), + (.D6,13527291556527670), + (.D16,11562189399785584), + (.D6,739902606016054), + (.D16,696248558420080), + (.D6,39646843108918), + (.D16,41866267459696), + (.D6,2065610833462), + (.D16,2513562501232), + (.D6,103330872886), + (.D16,150655205488), + (.D6,4847566390), + (.D16,9013297264), + (.D6,202309174), + (.D16,538165360), + (.D6,2123501110), + (.D16,611644528), + (.D6,24722230), + (.D16,36655024), + (.D6,1151494), + (.D16,2192740), + (.D6,1225139126), + (.D12,5211), + (.D16,9469), + (.D16,314), + (.D6,5)])]], + .ms [(.m2,.s6,141670994486089356410842),(.m3,.s6,60210172656587976474631),(.m14,.s5,60210172656587976474631),(.m4,.s5,141670994486089356410836)], + .m .m5, + .b 141670994486089356410842 [[([23],[(.D16,60210172656587976474631),(.D18,1),(.D15,15716625950800537976829),(.D16,5035961132122707591118)])]], + .ms [(.m2,.s6,141670994486089356410854),(.m3,.s6,60210172656587976474628),(.m7,.s5,60210172656587976474628),(.m4,.s5,141670994486089356410848)], + .m .m5, + .b 141670994486089356410854 [[([7],[(.D16,60210172656587976474628),(.D6,1)])]], + .ms [(.m2,.s6,141670994486089356410858),(.m6,.s6,60210172656587976474626),(.m15,.s5,60210172656587976474626),(.m11,.s5,141670994486089356410852)], + .m .m5, + .b 141670994486089356410858 [[([5],[(.D12,60210172656587976474626),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,141670994486089356410861,60210172656587976474627)], + .ms [(.m23,.s1,60210172656587976474627),(.m22,.s4,141670994486089356410855)], + .m .m24, + .b 141670994486089356410861 [[([17],[(.D6,60210172656587976474627),(.D6,2)])]], + .ms [(.m2,.s6,141670994486089356410870),(.m6,.s6,60210172656587976474623),(.m14,.s5,60210172656587976474623),(.m11,.s5,141670994486089356410864)], + .m .m5, + .b 141670994486089356410870 [[([23],[(.D12,60210172656587976474623),(.D18,1),(.D17,15716625950800537976828),(.D17,5035961132122707591118),(.D15,14983367873870583300106),(.D17,23004242781420417711672),(.D15,14328796689630045929584),(.D17,1327084709396518796854),(.D15,867879676991313543280),(.D17,76025265309641342518),(.D15,52513097555046826096),(.D17,4319233517625015862),(.D15,3173982206133534832),(.D17,242930497087340086),(.D15,191618488442290288),(.D17,13494306207694390),(.D15,11553943062577264),(.D17,737841021713974),(.D15,695733162344560),(.D17,39517994090038),(.D15,41834055204976),(.D17,2057557769782),(.D15,2511549235312),(.D17,102827556406),(.D15,150529376368),(.D17,4816109110),(.D15,9005432944),(.D17,200343094),(.D15,537673840),(.D17,2123378230),(.D15,611613808),(.D17,24714550),(.D15,36653104),(.D17,1151014),(.D15,2192620),(.D17,1225139096),(.D11,5203),(.D6,9468)])]], + .ms [(.m2,.s6,141670994486089356410882),(.m6,.s6,60210172656587976474620),(.m7,.s5,60210172656587976474620),(.m11,.s5,141670994486089356410876)], + .m .m5, + .b 141670994486089356410882 [[([240840690626351905898481,120420345313175952949245,21250649172913403461641],[(.D12,60210172656587976474620),(.D8,15716625950800537976828),(.D6,5035961132122707591118),(.D16,14983367873870583300106)]),([1494186269970473680895],[(.D6,23004242781420417711672),(.D16,14328796689630045929584),(.D6,1327084709396518796854),(.D16,867879676991313543280),(.D6,76025265309641342518),(.D16,52513097555046826096),(.D6,4319233517625015862),(.D16,3173982206133534832),(.D6,242930497087340086),(.D16,191618488442290288),(.D6,13494306207694390),(.D16,11553943062577264),(.D6,737841021713974),(.D16,695733162344560),(.D6,39517994090038),(.D16,41834055204976),(.D6,2057557769782),(.D16,2511549235312),(.D6,102827556406),(.D16,150529376368),(.D6,4816109110),(.D16,9005432944),(.D6,200343094),(.D16,537673840),(.D6,2123378230),(.D16,611613808),(.D6,24714550),(.D16,36653104),(.D6,1151014),(.D16,2192620),(.D6,1225139096),(.D12,5204),(.D7,9467),(.D8,313),(.D7,4)])]], + .ms [(.m2,.s6,332926837042309987565566)], + .ms2 .s6 .s7 [(.m3,12396212017532818685950,3763135791036748529662)], + .ms [(.m3,.s6,2047588592181760229326)], + .ms2 .s6 .s7 [(.m3,14236274738885346459658,22817469497674108501560),(.m0,14282103368693468627056,1315411379162374471222),(.m0,864961344432777461872,75295682170007322166),(.m0,52330701770138321008,4273634571397889590),(.m0,3162582469576753264,240080562948144694),(.m0,190906004907491440,13316185323994678),(.m0,11509412841652336,726708466482742),(.m0,692950023536752,38822209388086),(.m0,41660109029488,2014071225910),(.m0,2500677599344,100109647414),(.m0,149849899120,4646239798),(.m0,8962965616,189726262),(.m0,535019632,2122714678),(.m0,611447920,24673078),(.m0,36642736,1148422),(.m0,2191972,1225138934)], + .ms [(.m12,.s7,5163),(.m0,.s6,9457),(.m3,.s6,311),(.m21,.s3,311),(.m4,.s3,9457),(.m4,.s3,5163)], + .ms2 .s3 .s0 [(.m13,1225138934,2191972),(.m1,1148422,36642736),(.m1,24673078,611447920),(.m1,2122714678,535019632),(.m1,189726262,8962965616),(.m1,4646239798,149849899120),(.m1,100109647414,2500677599344),(.m1,2014071225910,41660109029488),(.m1,38822209388086,692950023536752),(.m1,726708466482742,11509412841652336),(.m1,13316185323994678,190906004907491440),(.m1,240080562948144694,3162582469576753264),(.m1,4273634571397889590,52330701770138321008),(.m1,75295682170007322166,864961344432777461872),(.m1,1315411379162374471222,14282103368693468627056),(.m1,22817469497674108501560,14236274738885346459658),(.m1,2047588592181760229326,3763135791036748529662)], + .ms [(.m4,.s3,12396212017532818685950),(.m4,.s3,332926837042309987565560),(.m10,.s7,332926837042309987565566),(.m8,.s2,332926837042309987565561)], + .m .m9, + .b 0 [[([396678784561050197950388],[(.D7,332926837042309987565566)]), + ([49584848070131274743798,24792424035065637371903,12396212017532818685952,6198106008766409342976,3099053004383204671488,1549526502191602335744,774763251095801167872,387381625547900583936,193690812773950291968,96845406386975145984,48422703193487572992,24211351596743786496,12105675798371893248,6052837899185946624,3026418949592973312,1513209474796486656,756604737398243328,378302368699121664,189151184349560832,94575592174780416,47287796087390208,23643898043695104,11821949021847552,5910974510923776,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,12396212017532818685950), + (.D6,3763135791036748529662), + (.D6,2047588592181760229326)]), + ([1549526502191602335743],[(.D16,14236274738885346459658), + (.D6,22817469497674108501560), + (.D16,14282103368693468627056), + (.D6,1315411379162374471222), + (.D16,864961344432777461872), + (.D6,75295682170007322166), + (.D16,52330701770138321008), + (.D6,4273634571397889590), + (.D16,3162582469576753264), + (.D6,240080562948144694), + (.D16,190906004907491440), + (.D6,13316185323994678), + (.D16,11509412841652336), + (.D6,726708466482742), + (.D16,692950023536752), + (.D6,38822209388086), + (.D16,41660109029488), + (.D6,2014071225910), + (.D16,2500677599344), + (.D6,100109647414), + (.D16,149849899120), + (.D6,4646239798), + (.D16,8962965616), + (.D6,189726262), + (.D16,535019632), + (.D6,2122714678), + (.D16,611447920), + (.D6,24673078), + (.D16,36642736), + (.D6,1148422), + (.D16,2191972), + (.D6,1225138934), + (.D12,5163), + (.D16,9457), + (.D16,311), + (.D12,3)])], + [([8],[(.D15,283341988972178712821767), + (.D21,0), + (.D19,664082786653543858173)])]], + .ms [(.m2,.s6,198339392280525098975198),(.m6,.s6,283341988972178712821765),(.m7,.s5,283341988972178712821765),(.m11,.s5,198339392280525098975192)], + .m .m5, + .b 198339392280525098975198 [[([41],[(.D12,283341988972178712821765),(.D8,1),(.D7,664082786653543858172)])],[([15937986879685052596102],[(.D17,283341988972178712821761),(.D2,664082786653543858170)])]], + .ms [(.m2,.s6,206308385720367625273270),(.m3,.s6,281349740612218081247248),(.m27,.s2,281349740612218081247248),(.m1,.s5,206308385720367625273264)], + .m .m5, + .b 206308385720367625273270 [[([7],[(.D16,281349740612218081247248), + (.D6,1)])], + [([16],[(.D11,281349740612218081247246), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,281349740612218081247245), + (.D17,1), + (.D15,0), + (.D6,1272825341085959061454)])], + [([16],[(.D11,281349740612218081247243), + (.D3,0)])], + [([8],[(.D15,281349740612218081247242), + (.D17,1), + (.D21,1272825341085959061453), + (.D15,14042583926111396167690), + (.D17,22769046794480620928568), + (.D15,14269997692895096733808), + (.D17,1312384960212781497910), + (.D15,864204739695379218544), + (.D17,75106530985657761334), + (.D15,52283413974050930800), + (.D17,4261812622376042038), + (.D15,3159626982321291376), + (.D17,239341691134279222), + (.D15,190721286954025072), + (.D17,13270005835628086), + (.D15,11497867969560688), + (.D17,723822248459830), + (.D15,692228469031024), + (.D17,38641820761654), + (.D15,41615011872880), + (.D17,2002796936758), + (.D15,2497859027056), + (.D17,99405004342), + (.D15,149673738352), + (.D17,4602199606), + (.D15,8951955568), + (.D17,186973750), + (.D15,534331504), + (.D17,2122542646), + (.D15,611404912), + (.D17,24662326), + (.D15,36640048), + (.D17,1147750), + (.D15,2191804), + (.D17,1225138892), + (.D11,5152), + (.D12,9454)])], + [([18],[(.D11,281349740612218081247240), + (.D13,0), + (.D16,1272825341085959061453), + (.D16,14042583926111396167690)])], + [([40730410914750689966532],[(.D17,281349740612218081247239)]), + ([5091301364343836245819,2545650682171918122911,1272825341085959061456,636412670542979530728,318206335271489765364,159103167635744882679,79551583817872441341,39775791908936220672,19887895954468110336,9943947977234055168,4971973988617027584,2485986994308513792,1242993497154256896,621496748577128448,310748374288564224,155374187144282112,77687093572141056,38843546786070528,19421773393035264,9710886696517632,4855443348258816,2427721674129408,1213860837064704,606930418532352,303465209266176,151732604633088,75866302316544,37933151158272,18966575579136,9483287789568,4741643894784,2370821947392,1185410973696,592705486848,296352743424,148176371712,74088185856,37044092928,18522046464,9261023232,4630511616,2315255808,1157627904,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,1272825341085959061454), + (.D17,14042583926111396167690)]), + ([636412670542979530727],[(.D6,22769046794480620928568), + (.D16,14269997692895096733808), + (.D6,1312384960212781497910), + (.D16,864204739695379218544), + (.D6,75106530985657761334), + (.D16,52283413974050930800), + (.D6,4261812622376042038), + (.D16,3159626982321291376), + (.D6,239341691134279222), + (.D16,190721286954025072), + (.D6,13270005835628086), + (.D16,11497867969560688), + (.D6,723822248459830), + (.D16,692228469031024), + (.D6,38641820761654), + (.D16,41615011872880), + (.D6,2002796936758), + (.D16,2497859027056), + (.D6,99405004342), + (.D16,149673738352), + (.D6,4602199606), + (.D16,8951955568), + (.D6,186973750), + (.D16,534331504), + (.D6,2122542646), + (.D16,611404912), + (.D6,24662326), + (.D16,36640048), + (.D6,1147750), + (.D16,2191804), + (.D6,1225138892), + (.D12,5153), + (.D13,9454), + (.D9,310), + (.D13,3)])], + [([10],[(.D17,276258439247874245001423), + (.D21,0), + (.D19,13724377590839906402326)])]], + .ms [(.m2,.s6,226673591177742970256578),(.m3,.s6,276258439247874245001421),(.m7,.s5,276258439247874245001421),(.m4,.s5,226673591177742970256572)], + .m .m5, + .b 226673591177742970256578 [[([43],[(.D16,276258439247874245001421),(.D8,1),(.D7,13724377590839906402325)])],[([329385062180157753655770],[(.D11,276258439247874245001414),(.D2,13724377590839906402323)])]], + .ms2 .s6 .s7 [(.m2,391366122267821847084485,235085306475354525794445)], + .ms [(.m29,.s2,235085306475354525794445),(.m4,.s5,391366122267821847084479)], + .m .m5, + .b 391366122267821847084485 [[([9],[(.D6,235085306475354525794445),(.D6,1)])],[([20],[(.D15,235085306475354525794443),(.D13,0),(.D10,22689495210662748487226),(.D9,14250109796940628623472)])],[([36],[(.D11,235085306475354525794439)]),([7,2],[(.D12,1),(.D6,22689495210662748487226)])]], + .ms [(.m2,.s6,391366122267821847084518),(.m6,.s6,235085306475354525794435),(.m15,.s5,235085306475354525794435),(.m11,.s5,391366122267821847084512)], + .m .m5, + .b 391366122267821847084518 [[([5],[(.D12,235085306475354525794435),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,391366122267821847084521,235085306475354525794436)], + .ms [(.m23,.s1,235085306475354525794436),(.m22,.s4,391366122267821847084515)], + .m .m24, + .b 391366122267821847084521 [[([17],[(.D6,235085306475354525794436),(.D6,2)])],[([6],[(.D11,235085306475354525794432),(.D21,0),(.D7,22689495210662748487224)])]], + .ms2 .s6 .s7 [(.m2,391366122267821847084533,235085306475354525794433)], + .ms2 .s5 .s2 [(.m28,235085306475354525794433,391366122267821847084528)], + .m .m18, + .b 391366122267821847084533 [[([45],[(.D6,235085306475354525794433),(.D8,1),(.D17,22689495210662748487223),(.D10,14250109796940628623471)])],[([36],[(.D15,235085306475354525794426)]),([7,2],[(.D12,1),(.D17,22689495210662748487222)]),([1],[(.D11,14250109796940628623471),(.D16,1307412986224164470326)])],[([8],[(.D15,235085306475354525794422),(.D21,0),(.D17,22689495210662748487221),(.D12,14250109796940628623472)])]], + .ms [(.m2,.s6,391366122267821847084578),(.m6,.s6,235085306475354525794420),(.m7,.s5,235085306475354525794420),(.m11,.s5,391366122267821847084572)], + .m .m5, + .b 391366122267821847084578 [[([39],[(.D12,235085306475354525794420),(.D8,22689495210662748487222),(.D13,14250109796940628623472),(.D17,1307412986224164470326),(.D15,862961746198224961648),(.D17,74795782611369197110),(.D15,52205726880478789744),(.D17,4242390848983006774),(.D15,3154771538973032560),(.D17,238127830297214518),(.D15,190417821744758896),(.D17,13194139533311542),(.D15,11478901393981552),(.D17,719080604565046),(.D15,691043058057328),(.D17,38345468018230),(.D15,41540923687024),(.D17,1984274890294),(.D15,2493228515440),(.D17,98247376438),(.D15,149384331376),(.D17,4529847862),(.D15,8933867632),(.D17,182451766),(.D15,533201008),(.D17,2122260022),(.D15,611334256),(.D17,24644662),(.D15,36635632),(.D17,1146646),(.D15,2191528),(.D17,1225138823),(.D17,5137),(.D11,9449),(.D17,310),(.D15,3)])]], + .ms [(.m2,.s6,391366122267821847084598)], + .ms2 .s6 .s7 [(.m3,235085306475354525794416,22689495210662748487222),(.m0,14250109796940628623472,1307412986224164470326),(.m0,862961746198224961648,74795782611369197110),(.m0,52205726880478789744,4242390848983006774),(.m0,3154771538973032560,238127830297214518),(.m0,190417821744758896,13194139533311542),(.m0,11478901393981552,719080604565046),(.m0,691043058057328,38345468018230),(.m0,41540923687024,1984274890294),(.m0,2493228515440,98247376438),(.m0,149384331376,4529847862),(.m0,8933867632,182451766),(.m0,533201008,2122260022),(.m0,611334256,24644662),(.m0,36635632,1146646),(.m0,2191528,1225138823)], + .ms [(.m3,.s6,5137)], + .ms2 .s6 .s7 [(.m6,9449,310)], + .ms2 .s3 .s0 [(.m19,310,9449)], + .ms [(.m17,.s0,5137)], + .ms2 .s3 .s0 [(.m4,1225138823,2191528),(.m1,1146646,36635632),(.m1,24644662,611334256),(.m1,2122260022,533201008),(.m1,182451766,8933867632),(.m1,4529847862,149384331376),(.m1,98247376438,2493228515440),(.m1,1984274890294,41540923687024),(.m1,38345468018230,691043058057328),(.m1,719080604565046,11478901393981552),(.m1,13194139533311542,190417821744758896),(.m1,238127830297214518,3154771538973032560),(.m1,4242390848983006774,52205726880478789744),(.m1,74795782611369197110,862961746198224961648),(.m1,1307412986224164470326,14250109796940628623472),(.m1,22689495210662748487222,235085306475354525794416)], + .ms [(.m1,.s3,391366122267821847084592),(.m10,.s7,391366122267821847084598),(.m8,.s2,391366122267821847084593)], + .m .m9, + .b 0 [[([11953490159763789447164],[(.D7,391366122267821847084598),(.D17,235085306475354525794416),(.D6,22689495210662748487222),(.D16,14250109796940628623472),(.D6,1307412986224164470326),(.D16,862961746198224961648),(.D6,74795782611369197110),(.D16,52205726880478789744),(.D6,4242390848983006774),(.D16,3154771538973032560),(.D6,238127830297214518),(.D16,190417821744758896),(.D6,13194139533311542),(.D16,11478901393981552),(.D6,719080604565046),(.D16,691043058057328),(.D6,38345468018230),(.D16,41540923687024),(.D6,1984274890294),(.D16,2493228515440),(.D6,98247376438),(.D16,149384331376),(.D6,4529847862),(.D16,8933867632),(.D6,182451766),(.D16,533201008),(.D6,2122260022),(.D16,611334256),(.D6,24644662),(.D16,36635632),(.D6,1146646),(.D16,2191528),(.D6,1225138823),(.D6,5137),(.D12,9449),(.D6,310),(.D16,4)])]], + .ms [(.m2,.s6,5976745079881894723582),(.m3,.s6,389871935997851373403702)], + .ms2 .s6 .s7 [(.m3,234711759907861907374192,22596108568789593882166),(.m0,14226763136472339972208,1301576321107092307510),(.m0,861502579918956920944,74430991041552186934),(.m0,52114528988024537200,4219591375869443638),(.m0,3149071670694641776,236702863227616822),(.m0,190061579977359472,13105079091461686),(.m0,11456636283519088,713514326949430),(.m0,689651488653424,37997575667254),(.m0,41453950599280,1962531618358),(.m0,2487792697456,96888421942),(.m0,149044592752,4444913206),(.m0,8912633968,177143350),(.m0,531873904,2121928246),(.m0,611251312,24623926),(.m0,36630448,1145350),(.m0,2191204,1225138742)], + .ms [(.m12,.s7,5115),(.m0,.s6,9445),(.m3,.s6,308),(.m20,.s0,308),(.m1,.s3,9445),(.m4,.s3,5115)], + .ms2 .s3 .s0 [(.m13,1225138742,2191204),(.m1,1145350,36630448),(.m1,24623926,611251312),(.m1,2121928246,531873904),(.m1,177143350,8912633968),(.m1,4444913206,149044592752),(.m1,96888421942,2487792697456),(.m1,1962531618358,41453950599280),(.m1,37997575667254,689651488653424),(.m1,713514326949430,11456636283519088),(.m1,13105079091461686,190061579977359472),(.m1,236702863227616822,3149071670694641776),(.m1,4219591375869443638,52114528988024537200),(.m1,74430991041552186934,861502579918956920944),(.m1,1301576321107092307510,14226763136472339972208),(.m1,22596108568789593882166,234711759907861907374192)], + .ms [(.m1,.s3,389871935997851373403702),(.m4,.s3,5976745079881894723576),(.m10,.s7,5976745079881894723582),(.m8,.s2,5976745079881894723577)], + .m .m9, + .b 0 [[([23906980319527578894326,11953490159763789447165,5976745079881894723584,2988372539940947361792,1494186269970473680896,747093134985236840448,373546567492618420224,186773283746309210112,93386641873154605056,46693320936577302528,23346660468288651264,11673330234144325632,5836665117072162816,2918332558536081408,1459166279268040704,729583139634020352,364791569817010176,182395784908505088,91197892454252544,45598946227126272,22799473113563136,11399736556781568,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,5976745079881894723582), + (.D17,389871935997851373403702)]), + ([2988372539940947361790],[(.D16,234711759907861907374192), + (.D6,22596108568789593882166), + (.D16,14226763136472339972208), + (.D6,1301576321107092307510), + (.D16,861502579918956920944), + (.D6,74430991041552186934), + (.D16,52114528988024537200), + (.D6,4219591375869443638), + (.D16,3149071670694641776), + (.D6,236702863227616822), + (.D16,190061579977359472), + (.D6,13105079091461686), + (.D16,11456636283519088), + (.D6,713514326949430), + (.D16,689651488653424), + (.D6,37997575667254), + (.D16,41453950599280), + (.D6,1962531618358), + (.D16,2487792697456), + (.D6,96888421942), + (.D16,149044592752), + (.D6,4444913206), + (.D16,8912633968), + (.D6,177143350), + (.D16,531873904), + (.D6,2121928246), + (.D16,611251312), + (.D6,24623926), + (.D16,36630448), + (.D6,1145350), + (.D16,2191204), + (.D6,1225138742), + (.D12,5115), + (.D16,9445), + (.D16,308), + (.D6,5)])]], + .ms [(.m2,.s6,23906980319527578894325),(.m14,.s5,23906980319527578894319)], + .m .m5, + .b 23906980319527578894325 [[([5],[(.D18,1),(.D15,388377749727880899722805),(.D14,234338213340369288953968)])]], + .ms [(.m2,.s6,23906980319527578894328),(.m7,.s5,23906980319527578894322)], + .m .m5, + .b 23906980319527578894328 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,23906980319527578894329),(.m15,.s5,23906980319527578894323)], + .m .m5, + .b 23906980319527578894329 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,23906980319527578894330),(.m25,.s2,23906980319527578894325)], + .m .m18, + .b 23906980319527578894330 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,23906980319527578894332),(.m14,.s5,23906980319527578894326)], + .m .m5, + .b 23906980319527578894332 [[([5],[(.D18,1),(.D17,388377749727880899722804),(.D15,234338213340369288953968),(.D17,22502721926916439277110),(.D15,14203416476004051320944),(.D17,1295739655990020144694),(.D15,860043413639688880240),(.D17,74066199471735176758),(.D15,52023331095570284656),(.D17,4196791902755880502),(.D15,3143371802416250992),(.D17,235277896158019126),(.D15,189705338209960048),(.D17,13016018649611830),(.D15,11434371173056624),(.D17,707948049333814),(.D15,688259919249520),(.D17,37649683316278),(.D15,41366977511536),(.D17,1940788346422),(.D15,2482356879472),(.D17,95529467446),(.D15,148704854128),(.D17,4359978550),(.D15,8891400304),(.D17,171834934),(.D15,530546800),(.D17,2121596470),(.D15,611168368),(.D17,24603190),(.D15,36625264),(.D17,1144054),(.D15,2190880),(.D17,1225138661),(.D17,5096),(.D8,9439)])]], + .ms [(.m2,.s6,23906980319527578894335),(.m7,.s5,23906980319527578894329)], + .m .m5, + .b 23906980319527578894335 [[([16380708737454081835005],[(.D8,388377749727880899722804),(.D16,234338213340369288953968),(.D6,22502721926916439277110),(.D16,14203416476004051320944),(.D6,1295739655990020144694),(.D16,860043413639688880240),(.D6,74066199471735176758),(.D16,52023331095570284656),(.D6,4196791902755880502),(.D16,3143371802416250992),(.D6,235277896158019126),(.D16,189705338209960048),(.D6,13016018649611830),(.D16,11434371173056624),(.D6,707948049333814),(.D16,688259919249520),(.D6,37649683316278),(.D16,41366977511536),(.D6,1940788346422),(.D16,2482356879472),(.D6,95529467446),(.D16,148704854128),(.D6,4359978550),(.D16,8891400304),(.D6,171834934),(.D16,530546800),(.D6,2121596470),(.D16,611168368),(.D6,24603190),(.D16,36625264),(.D6,1144054),(.D16,2190880),(.D6,1225138661),(.D6,5097),(.D9,9439),(.D14,306),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,32097334688254619811838,386330161135699139493430),(.m0,233826316192323848896624,22374747639905079262774),(.m0,14171422904251211317360,1287741263051810143798),(.m0,858043815405136380016,73566299913097051702),(.m0,51898356205910753392,4165548180340997686),(.m0,3135560871812530288,233325163507088950),(.m0,189217155047227504,12893972858928694),(.m0,11403859725385840,700320187416118),(.m0,686352953770096,37172941946422),(.m0,41247792169072,1910992010806),(.m0,2474907795568,93667196470),(.m0,148239286384,4243586614),(.m0,8862302320,164560438),(.m0,528728176,2121141814),(.m0,611054704,24574774),(.m0,36618160,1142278),(.m0,2190436,1225138550)], + .ms [(.m12,.s7,5067),(.m0,.s6,9433),(.m3,.s6,305),(.m21,.s3,305),(.m4,.s3,9433),(.m4,.s3,5067)], + .ms2 .s3 .s0 [(.m13,1225138550,2190436),(.m1,1142278,36618160),(.m1,24574774,611054704),(.m1,2121141814,528728176),(.m1,164560438,8862302320),(.m1,4243586614,148239286384),(.m1,93667196470,2474907795568),(.m1,1910992010806,41247792169072),(.m1,37172941946422,686352953770096),(.m1,700320187416118,11403859725385840),(.m1,12893972858928694,189217155047227504),(.m1,233325163507088950,3135560871812530288),(.m1,4165548180340997686,51898356205910753392),(.m1,73566299913097051702,858043815405136380016),(.m1,1287741263051810143798,14171422904251211317360),(.m1,22374747639905079262774,233826316192323848896624),(.m1,386330161135699139493430,32097334688254619811833)], + .ms [(.m26,.s7,32097334688254619811838),(.m8,.s2,32097334688254619811833)], + .m .m9, + .b 0 [[([65522834949816327340028],[(.D7,32097334688254619811838),(.D7,386330161135699139493429),(.D16,233826316192323848896624),(.D6,22374747639905079262774),(.D16,14171422904251211317360),(.D6,1287741263051810143798),(.D16,858043815405136380016),(.D6,73566299913097051702),(.D16,51898356205910753392),(.D6,4165548180340997686),(.D16,3135560871812530288),(.D6,233325163507088950),(.D16,189217155047227504),(.D6,12893972858928694),(.D16,11403859725385840),(.D6,700320187416118),(.D16,686352953770096),(.D6,37172941946422),(.D16,41247792169072),(.D6,1910992010806),(.D16,2474907795568),(.D6,93667196470),(.D16,148239286384),(.D6,4243586614),(.D16,8862302320),(.D6,164560438),(.D16,528728176),(.D6,2121141814),(.D16,611054704),(.D6,24574774),(.D16,36618160),(.D6,1142278),(.D16,2190436),(.D6,1225138550),(.D12,5067),(.D16,9433),(.D16,305),(.D12,3)])]], + .ms [(.m2,.s6,32761417474908163670014)], + .ms2 .s6 .s7 [(.m3,23906980319527578894334,384282572543517379264054),(.m0,233314419044278408839280,22246773352893719248438),(.m0,14139429332498371313776,1279742870113600142902),(.m0,856044217170583879792,73066400354458926646),(.m0,51773381316251222128,4134304457926114870),(.m0,3127749941208809584,231372430856158774),(.m0,188728971884494960,12771927068245558),(.m0,11373348277715056,692692325498422),(.m0,684445988290672,36696200576566),(.m0,41128606826608,1881195675190),(.m0,2467458711664,91804925494),(.m0,147773718640,4127194678),(.m0,8833204336,157285942),(.m0,526909552,2120687158),(.m0,610941040,24546358),(.m0,36611056,1140502),(.m0,2189992,1225138439)], + .ms [(.m3,.s6,5041)], + .ms2 .s6 .s7 [(.m6,9425,304)], + .ms2 .s3 .s0 [(.m19,304,9425)], + .ms [(.m17,.s0,5041)], + .ms2 .s3 .s0 [(.m4,1225138439,2189992),(.m1,1140502,36611056),(.m1,24546358,610941040),(.m1,2120687158,526909552),(.m1,157285942,8833204336),(.m1,4127194678,147773718640),(.m1,91804925494,2467458711664),(.m1,1881195675190,41128606826608),(.m1,36696200576566,684445988290672),(.m1,692692325498422,11373348277715056),(.m1,12771927068245558,188728971884494960),(.m1,231372430856158774,3127749941208809584),(.m1,4134304457926114870,51773381316251222128),(.m1,73066400354458926646,856044217170583879792),(.m1,1279742870113600142902,14139429332498371313776),(.m1,22246773352893719248438,233314419044278408839280),(.m1,384282572543517379264054,23906980319527578894334)], + .ms [(.m1,.s3,32761417474908163670008),(.m10,.s7,32761417474908163670014),(.m8,.s2,32761417474908163670009)], + .m .m9, + .b 0 [[([131045669899632654680054,60210172656587976474630],[(.D7,32761417474908163670014),(.D17,23906980319527578894334)]),([11953490159763789447167],[(.D6,384282572543517379264054),(.D16,233314419044278408839280),(.D6,22246773352893719248438),(.D16,14139429332498371313776),(.D6,1279742870113600142902),(.D16,856044217170583879792),(.D6,73066400354458926646),(.D16,51773381316251222128),(.D6,4134304457926114870),(.D16,3127749941208809584),(.D6,231372430856158774),(.D16,188728971884494960),(.D6,12771927068245558),(.D16,11373348277715056),(.D6,692692325498422),(.D16,684445988290672),(.D6,36696200576566),(.D16,41128606826608),(.D6,1881195675190),(.D16,2467458711664),(.D6,91804925494),(.D16,147773718640),(.D6,4127194678),(.D16,8833204336),(.D6,157285942),(.D16,526909552),(.D6,2120687158),(.D16,610941040),(.D6,24546358),(.D16,36611056),(.D6,1140502),(.D16,2189992),(.D6,1225138439),(.D6,5041),(.D12,9425),(.D6,304),(.D16,4)])]], + .ms [(.m2,.s6,95627921278110315577342),(.m3,.s6,8854437155380584775678)], + .ms2 .s6 .s7 [(.m3,17930235239645684170750,382788386273546905583158),(.m0,232940872476785790419056,22153386711020564643382),(.m0,14116082672030082662512,1273906204996527980086),(.m0,854585050891315839088,72701608784641916470),(.m0,51682183423796969584,4111504984812551734),(.m0,3122050072930418800,229947463786561078),(.m0,188372730117095536,12682866626395702),(.m0,11351083167252592,687126047882806),(.m0,683054418886768,36348308225590),(.m0,41041633738864,1859452403254),(.m0,2462022893680,90445970998),(.m0,147433980016,4042260022),(.m0,8811970672,151977526),(.m0,525582448,2120355382),(.m0,610858096,24525622),(.m0,36605872,1139206),(.m0,2189668,1225138358)], + .ms [(.m12,.s7,5019),(.m0,.s6,9421),(.m3,.s6,302),(.m20,.s0,302),(.m1,.s3,9421),(.m4,.s3,5019)], + .ms2 .s3 .s0 [(.m13,1225138358,2189668),(.m1,1139206,36605872),(.m1,24525622,610858096),(.m1,2120355382,525582448),(.m1,151977526,8811970672),(.m1,4042260022,147433980016),(.m1,90445970998,2462022893680),(.m1,1859452403254,41041633738864),(.m1,36348308225590,683054418886768),(.m1,687126047882806,11351083167252592),(.m1,12682866626395702,188372730117095536),(.m1,229947463786561078,3122050072930418800),(.m1,4111504984812551734,51682183423796969584),(.m1,72701608784641916470,854585050891315839088),(.m1,1273906204996527980086,14116082672030082662512),(.m1,22153386711020564643382,232940872476785790419056),(.m1,382788386273546905583158,17930235239645684170750)], + .ms [(.m1,.s3,8854437155380584775678),(.m4,.s3,95627921278110315577336),(.m10,.s7,95627921278110315577342),(.m8,.s2,95627921278110315577337)], + .m .m9, + .b 0 [[([283341988972178209505240],[(.D7,95627921278110315577342)]), + ([35417748621522339102710,17708874310761169551359,8854437155380584775680,4427218577690292387840,2213609288845146193920,1106804644422573096960,553402322211286548480,276701161105643274240,138350580552821637120,69175290276410818560,34587645138205409280,17293822569102704640,8646911284551352320,4323455642275676160,2161727821137838080,1080863910568919040,540431955284459520,270215977642229760,135107988821114880,67553994410557440,33776997205278720,16888498602639360,8444249301319680,4222124650659840,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120],[(.D17,8854437155380584775678), + (.D16,17930235239645684170750)]), + ([4427218577690284523519],[(.D6,382788386273546905583158), + (.D16,232940872476785790419056), + (.D6,22153386711020564643382), + (.D16,14116082672030082662512), + (.D6,1273906204996527980086), + (.D16,854585050891315839088), + (.D6,72701608784641916470), + (.D16,51682183423796969584), + (.D6,4111504984812551734), + (.D16,3122050072930418800), + (.D6,229947463786561078), + (.D16,188372730117095536), + (.D6,12682866626395702), + (.D16,11351083167252592), + (.D6,687126047882806), + (.D16,683054418886768), + (.D6,36348308225590), + (.D16,41041633738864), + (.D6,1859452403254), + (.D16,2462022893680), + (.D6,90445970998), + (.D16,147433980016), + (.D6,4042260022), + (.D16,8811970672), + (.D6,151977526), + (.D16,525582448), + (.D6,2120355382), + (.D16,610858096), + (.D6,24525622), + (.D16,36605872), + (.D6,1139206), + (.D16,2189668), + (.D6,1225138358), + (.D12,5019), + (.D16,9421), + (.D16,302), + (.D6,5)])]], + ] (by decide +kernel) +theorem chunk_26_step : (cfg_26.denote) [qi]⊢* (cfg_27.denote) := + step_chunk [ + .b 141670994486089104752620 [[([503316444],[(.D15,60210172656588039389186)]),([62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D6,15728640),(.D14,15716625950800541908990)]),([7864319],[(.D17,382234983951335620017718),(.D15,232802521896232969027696),(.D17,22118799065882359295542),(.D15,14107435760745531325552),(.D17,1271744477175390145846),(.D15,854044618936031380528),(.D17,72566500795820801830),(.D15,51648406426591690924),(.D17,4103060735511232069),(.D9,3119939010605088883),(.D10,229419698205228597),(.D13,188240788721762416)])]], + .ms [(.m2,.s6,141670994486089356410842),(.m3,.s6,60210172656587976474631),(.m14,.s5,60210172656587976474631),(.m4,.s5,141670994486089356410836)], + .m .m5, + .b 141670994486089356410842 [[([23],[(.D16,60210172656587976474631),(.D18,1),(.D15,15716625950800537976829),(.D16,382234983951335619034678)])]], + .ms [(.m2,.s6,141670994486089356410854),(.m3,.s6,60210172656587976474628),(.m7,.s5,60210172656587976474628),(.m4,.s5,141670994486089356410848)], + .m .m5, + .b 141670994486089356410854 [[([7],[(.D16,60210172656587976474628),(.D6,1)])]], + .ms [(.m2,.s6,141670994486089356410858),(.m6,.s6,60210172656587976474626),(.m15,.s5,60210172656587976474626),(.m11,.s5,141670994486089356410852)], + .m .m5, + .b 141670994486089356410858 [[([5],[(.D12,60210172656587976474626),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,141670994486089356410861,60210172656587976474627)], + .ms [(.m23,.s1,60210172656587976474627),(.m22,.s4,141670994486089356410855)], + .m .m24, + .b 141670994486089356410861 [[([17],[(.D6,60210172656587976474627),(.D6,2)])]], + .ms [(.m2,.s6,141670994486089356410870),(.m6,.s6,60210172656587976474623),(.m14,.s5,60210172656587976474623),(.m11,.s5,141670994486089356410864)], + .m .m5, + .b 141670994486089356410870 [[([23],[(.D12,60210172656587976474623),(.D18,1),(.D17,15716625950800537976828),(.D17,382234983951335619034678),(.D15,232802521896232968781936),(.D17,22118799065882359234102),(.D15,14107435760745531310192),(.D17,1271744477175390142006),(.D15,854044618936031379568),(.D17,72566500795820801590),(.D15,51648406426591690864),(.D17,4103060735511232054),(.D15,3119939010605088880),(.D17,229419698205228598),(.D15,188240788721762416),(.D17,12649881277562422),(.D15,11342836830044272),(.D17,685064463580726),(.D15,682539022811248),(.D17,36219459206710),(.D15,41009421484144),(.D17,1851399339574),(.D15,2460009627760),(.D17,89942654518),(.D15,147308150896),(.D17,4010802742),(.D15,8804106352),(.D17,150011446),(.D15,525090928),(.D17,2120232502),(.D15,610827376),(.D17,24517942),(.D15,36603952),(.D17,1138726),(.D15,2189548),(.D17,1225138328),(.D11,5011),(.D6,9420)])]], + .ms [(.m2,.s6,141670994486089356410882),(.m6,.s6,60210172656587976474620),(.m7,.s5,60210172656587976474620),(.m11,.s5,141670994486089356410876)], + .m .m5, + .b 141670994486089356410882 [[([240840690626351905898481,120420345313175952949245,21250649172913403461641],[(.D12,60210172656587976474620),(.D8,15716625950800537976828),(.D6,382234983951335619034678)]),([5976745079881894723583],[(.D16,232802521896232968781936),(.D6,22118799065882359234102),(.D16,14107435760745531310192),(.D6,1271744477175390142006),(.D16,854044618936031379568),(.D6,72566500795820801590),(.D16,51648406426591690864),(.D6,4103060735511232054),(.D16,3119939010605088880),(.D6,229419698205228598),(.D16,188240788721762416),(.D6,12649881277562422),(.D16,11342836830044272),(.D6,685064463580726),(.D16,682539022811248),(.D6,36219459206710),(.D16,41009421484144),(.D6,1851399339574),(.D16,2460009627760),(.D6,89942654518),(.D16,147308150896),(.D6,4010802742),(.D16,8804106352),(.D6,150011446),(.D16,525090928),(.D6,2120232502),(.D16,610827376),(.D6,24517942),(.D16,36603952),(.D6,1138726),(.D16,2189548),(.D6,1225138328),(.D12,5012),(.D7,9419),(.D8,301),(.D7,4)])]], + .ms [(.m2,.s6,332926837042309987565566)], + .ms2 .s6 .s7 [(.m3,12396212017532818685950,3763135791036748529662)], + .ms [(.m3,.s6,379246611411394671672886)], + .ms2 .s6 .s7 [(.m3,232055428761247731941488,21932025782136050023990),(.m0,14060742439808954007664,1260071146941245816374),(.m0,851126286377495298160,71836917656186781238),(.m0,51466010641683185776,4057461789284105782),(.m0,3108539274048307312,226569764066033206),(.m0,187528305186963568,12471760393862710),(.m0,11298306609119344,673931908349494),(.m0,679755884003440,35523674504758),(.m0,40835475308656,1807912795702),(.m0,2449137991792,87224745526),(.m0,146628673648,3840933430),(.m0,8761639024,139394614),(.m0,522436720,2119568950),(.m0,610661488,24476470),(.m0,36593584,1136134),(.m0,2188900,1225138166)], + .ms [(.m12,.s7,4971),(.m0,.s6,9409),(.m3,.s6,299),(.m21,.s3,299),(.m4,.s3,9409),(.m4,.s3,4971)], + .ms2 .s3 .s0 [(.m13,1225138166,2188900),(.m1,1136134,36593584),(.m1,24476470,610661488),(.m1,2119568950,522436720),(.m1,139394614,8761639024),(.m1,3840933430,146628673648),(.m1,87224745526,2449137991792),(.m1,1807912795702,40835475308656),(.m1,35523674504758,679755884003440),(.m1,673931908349494,11298306609119344),(.m1,12471760393862710,187528305186963568),(.m1,226569764066033206,3108539274048307312),(.m1,4057461789284105782,51466010641683185776),(.m1,71836917656186781238,851126286377495298160),(.m1,1260071146941245816374,14060742439808954007664),(.m1,21932025782136050023990,232055428761247731941488),(.m1,379246611411394671672886,3763135791036748529662)], + .ms [(.m4,.s3,12396212017532818685950),(.m4,.s3,332926837042309987565560),(.m10,.s7,332926837042309987565566),(.m8,.s2,332926837042309987565561)], + .m .m9, + .b 0 [[([396678784561050197950388],[(.D7,332926837042309987565566)]), + ([49584848070131274743798,24792424035065637371903,12396212017532818685952,6198106008766409342976,3099053004383204671488,1549526502191602335744,774763251095801167872,387381625547900583936,193690812773950291968,96845406386975145984,48422703193487572992,24211351596743786496,12105675798371893248,6052837899185946624,3026418949592973312,1513209474796486656,756604737398243328,378302368699121664,189151184349560832,94575592174780416,47287796087390208,23643898043695104,11821949021847552,5910974510923776,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,12396212017532818685950), + (.D6,3763135791036748529662), + (.D6,379246611411394671672886)]), + ([1549526502191602335743],[(.D16,232055428761247731941488), + (.D6,21932025782136050023990), + (.D16,14060742439808954007664), + (.D6,1260071146941245816374), + (.D16,851126286377495298160), + (.D6,71836917656186781238), + (.D16,51466010641683185776), + (.D6,4057461789284105782), + (.D16,3108539274048307312), + (.D6,226569764066033206), + (.D16,187528305186963568), + (.D6,12471760393862710), + (.D16,11298306609119344), + (.D6,673931908349494), + (.D16,679755884003440), + (.D6,35523674504758), + (.D16,40835475308656), + (.D6,1807912795702), + (.D16,2449137991792), + (.D6,87224745526), + (.D16,146628673648), + (.D6,3840933430), + (.D16,8761639024), + (.D6,139394614), + (.D16,522436720), + (.D6,2119568950), + (.D16,610661488), + (.D6,24476470), + (.D16,36593584), + (.D6,1136134), + (.D16,2188900), + (.D6,1225138166), + (.D12,4971), + (.D16,9409), + (.D16,299), + (.D12,3)])], + [([8],[(.D15,283341988972178712821767), + (.D21,0), + (.D19,664082786653543858173)])]], + .ms [(.m2,.s6,198339392280525098975198),(.m6,.s6,283341988972178712821765),(.m7,.s5,283341988972178712821765),(.m11,.s5,198339392280525098975192)], + .m .m5, + .b 198339392280525098975198 [[([41],[(.D12,283341988972178712821765),(.D8,1),(.D7,664082786653543858172)])],[([15937986879685052596102],[(.D17,283341988972178712821761),(.D2,664082786653543858170)])]], + .ms [(.m2,.s6,206308385720367625273270),(.m3,.s6,281349740612218081247248),(.m27,.s2,281349740612218081247248),(.m1,.s5,206308385720367625273264)], + .m .m5, + .b 206308385720367625273270 [[([7],[(.D16,281349740612218081247248), + (.D6,1)])], + [([16],[(.D11,281349740612218081247246), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,281349740612218081247245), + (.D17,1), + (.D15,0), + (.D6,378471848160298870505014)])], + [([16],[(.D11,281349740612218081247243), + (.D3,0)])], + [([8],[(.D15,281349740612218081247242), + (.D17,1), + (.D21,378471848160298870505013), + (.D15,231861737948473781649520), + (.D17,21883603078942562450998), + (.D15,14048636764010582114416), + (.D17,1257044727991652843062), + (.D15,850369681640097054832), + (.D17,71647766471837220406), + (.D15,51418722845595795568), + (.D17,4045639840262258230), + (.D15,3105583786792845424), + (.D17,225830892252167734), + (.D15,187343587233497200), + (.D17,12425580905496118), + (.D15,11286761737027696), + (.D17,671045690326582), + (.D15,679034329497712), + (.D17,35343285878326), + (.D15,40790378152048), + (.D17,1796638506550), + (.D15,2446319419504), + (.D17,86520102454), + (.D15,146452512880), + (.D17,3796893238), + (.D15,8750628976), + (.D17,136642102), + (.D15,521748592), + (.D17,2119396918), + (.D15,610618480), + (.D17,24465718), + (.D15,36590896), + (.D17,1135462), + (.D15,2188732), + (.D17,1225138124), + (.D11,4960), + (.D12,9406)])], + [([18],[(.D11,281349740612218081247240), + (.D13,0), + (.D16,378471848160298870505013), + (.D16,231861737948473781649520)])], + [([40730410914750689968102],[(.D17,281349740612218081247239), + (.D12,378471848160298870505014), + (.D17,231861737948473781649520), + (.D6,21883603078942562450998), + (.D16,14048636764010582114416), + (.D6,1257044727991652843062), + (.D16,850369681640097054832), + (.D6,71647766471837220406), + (.D16,51418722845595795568), + (.D6,4045639840262258230), + (.D16,3105583786792845424), + (.D6,225830892252167734), + (.D16,187343587233497200), + (.D6,12425580905496118), + (.D16,11286761737027696), + (.D6,671045690326582), + (.D16,679034329497712), + (.D6,35343285878326), + (.D16,40790378152048), + (.D6,1796638506550), + (.D16,2446319419504), + (.D6,86520102454), + (.D16,146452512880), + (.D6,3796893238), + (.D16,8750628976), + (.D6,136642102), + (.D16,521748592), + (.D6,2119396918), + (.D16,610618480), + (.D6,24465718), + (.D16,36590896), + (.D6,1135462), + (.D16,2188732), + (.D6,1225138124), + (.D12,4961), + (.D13,9406), + (.D9,298), + (.D13,3)])]], + .ms [(.m2,.s6,226673591177742970257358)], + .ms2 .s6 .s7 [(.m3,276258439247874245001226,377199022819212911443512),(.m0,231543531613202291884144,21804051495124690009654),(.m0,14028748868056114004080,1252072754003035815478),(.m0,849126688142942797936,71337018097548656182),(.m0,51341035752023654512,4026218066869222966),(.m0,3100728343444586608,224617031415103030),(.m0,187040122024231024,12349714603179574),(.m0,11267795161448560,666304046431798),(.m0,677848918524016,35046933134902),(.m0,40716289966192,1778116460086),(.m0,2441688907888,85362474550),(.m0,146163105904,3724541494),(.m0,8732541040,132120118),(.m0,520618096,2119114294),(.m0,610547824,24448054),(.m0,36586480,1134358),(.m0,2188456,1225138055)], + .ms [(.m3,.s6,4945)], + .ms2 .s6 .s7 [(.m6,9401,298)], + .ms2 .s3 .s0 [(.m19,298,9401)], + .ms [(.m17,.s0,4945)], + .ms2 .s3 .s0 [(.m4,1225138055,2188456),(.m1,1134358,36586480),(.m1,24448054,610547824),(.m1,2119114294,520618096),(.m1,132120118,8732541040),(.m1,3724541494,146163105904),(.m1,85362474550,2441688907888),(.m1,1778116460086,40716289966192),(.m1,35046933134902,677848918524016),(.m1,666304046431798,11267795161448560),(.m1,12349714603179574,187040122024231024),(.m1,224617031415103030,3100728343444586608),(.m1,4026218066869222966,51341035752023654512),(.m1,71337018097548656182,849126688142942797936),(.m1,1252072754003035815478,14028748868056114004080),(.m1,21804051495124690009654,231543531613202291884144),(.m1,377199022819212911443512,276258439247874245001226)], + .ms [(.m1,.s3,226673591177742970257352),(.m10,.s7,226673591177742970257358),(.m8,.s2,226673591177742970257353)], + .m .m9, + .b 0 [[([191255842556220631154684],[(.D7,226673591177742970257358),(.D17,276258439247874245001226),(.D6,377199022819212911443512),(.D16,231543531613202291884144),(.D6,21804051495124690009654),(.D16,14028748868056114004080),(.D6,1252072754003035815478),(.D16,849126688142942797936),(.D6,71337018097548656182),(.D16,51341035752023654512),(.D6,4026218066869222966),(.D16,3100728343444586608),(.D6,224617031415103030),(.D16,187040122024231024),(.D6,12349714603179574),(.D16,11267795161448560),(.D6,666304046431798),(.D16,677848918524016),(.D6,35046933134902),(.D16,40716289966192),(.D6,1778116460086),(.D16,2441688907888),(.D6,85362474550),(.D16,146163105904),(.D6,3724541494),(.D16,8732541040),(.D6,132120118),(.D16,520618096),(.D6,2119114294),(.D16,610547824),(.D6,24448054),(.D16,36586480),(.D6,1134358),(.D16,2188456),(.D6,1225138055),(.D6,4945),(.D12,9401),(.D6,298),(.D16,4)])]], + .ms [(.m2,.s6,95627921278110315577342),(.m3,.s6,202766610858215391363022)], + .ms2 .s6 .s7 [(.m3,270281694167992350277642,375704836549242437762616),(.m0,231169985045709673463920,21710664853251535404598),(.m0,14005402207587825352816,1246236088885963652662),(.m0,847667521863674757232,70972226527731646006),(.m0,51249837859569401968,4003418593755659830),(.m0,3095028475166195824,223192064345505334),(.m0,186683880256831600,12260654161329718),(.m0,11245530050986096,660737768816182),(.m0,676457349120112,34699040783926),(.m0,40629316878448,1756373188150),(.m0,2436253089904,84003520054),(.m0,145823367280,3639606838),(.m0,8711307376,126811702),(.m0,519290992,2118782518),(.m0,610464880,24427318),(.m0,36581296,1133062),(.m0,2188132,1225137974)], + .ms [(.m12,.s7,4923),(.m0,.s6,9397),(.m3,.s6,296),(.m20,.s0,296),(.m1,.s3,9397),(.m4,.s3,4923)], + .ms2 .s3 .s0 [(.m13,1225137974,2188132),(.m1,1133062,36581296),(.m1,24427318,610464880),(.m1,2118782518,519290992),(.m1,126811702,8711307376),(.m1,3639606838,145823367280),(.m1,84003520054,2436253089904),(.m1,1756373188150,40629316878448),(.m1,34699040783926,676457349120112),(.m1,660737768816182,11245530050986096),(.m1,12260654161329718,186683880256831600),(.m1,223192064345505334,3095028475166195824),(.m1,4003418593755659830,51249837859569401968),(.m1,70972226527731646006,847667521863674757232),(.m1,1246236088885963652662,14005402207587825352816),(.m1,21710664853251535404598,231169985045709673463920),(.m1,375704836549242437762616,270281694167992350277642)], + .ms [(.m1,.s3,202766610858215391363022),(.m4,.s3,95627921278110315577336),(.m10,.s7,95627921278110315577342),(.m8,.s2,95627921278110315577337)], + .m .m9, + .b 0 [[([382511685112441262309366,191255842556220631154685,95627921278110315577344,47813960639055157788672,23906980319527578894336,11953490159763789447168,5976745079881894723584,2988372539940947361792,1494186269970473680896,747093134985236840448,373546567492618420224,186773283746309210112,93386641873154605056,46693320936577302528,23346660468288651264,11673330234144325632,5836665117072162816,2918332558536081408,1459166279268040704,729583139634020352,364791569817010176,182395784908505088,91197892454252544,45598946227126272,22799473113563136,11399736556781568,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,95627921278110315577342), + (.D17,202766610858215391363022)]), + ([47813960639055157788670],[(.D16,270281694167992350277642), + (.D6,375704836549242437762616), + (.D16,231169985045709673463920), + (.D6,21710664853251535404598), + (.D16,14005402207587825352816), + (.D6,1246236088885963652662), + (.D16,847667521863674757232), + (.D6,70972226527731646006), + (.D16,51249837859569401968), + (.D6,4003418593755659830), + (.D16,3095028475166195824), + (.D6,223192064345505334), + (.D16,186683880256831600), + (.D6,12260654161329718), + (.D16,11245530050986096), + (.D6,660737768816182), + (.D16,676457349120112), + (.D6,34699040783926), + (.D16,40629316878448), + (.D6,1756373188150), + (.D16,2436253089904), + (.D6,84003520054), + (.D16,145823367280), + (.D6,3639606838), + (.D16,8711307376), + (.D6,126811702), + (.D16,519290992), + (.D6,2118782518), + (.D16,610464880), + (.D6,24427318), + (.D16,36581296), + (.D6,1133062), + (.D16,2188132), + (.D6,1225137974), + (.D12,4923), + (.D16,9397), + (.D16,296), + (.D6,5)])]], + .ms [(.m2,.s6,382511685112441262309365),(.m14,.s5,382511685112441262309359)], + .m .m5, + .b 382511685112441262309365 [[([5],[(.D18,1),(.D15,178859630538687812468685),(.D14,264304949088110455554058)])]], + .ms [(.m2,.s6,382511685112441262309368),(.m7,.s5,382511685112441262309362)], + .m .m5, + .b 382511685112441262309368 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,382511685112441262309369),(.m15,.s5,382511685112441262309363)], + .m .m5, + .b 382511685112441262309369 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,382511685112441262309370),(.m25,.s2,382511685112441262309365)], + .m .m18, + .b 382511685112441262309370 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,382511685112441262309372),(.m14,.s5,382511685112441262309366)], + .m .m5, + .b 382511685112441262309372 [[([5],[(.D18,1),(.D17,178859630538687812468684),(.D15,264304949088110455554058),(.D17,374210650279271964081720),(.D15,230796438478217055043696),(.D17,21617278211378380799542),(.D15,13982055547119536701552),(.D17,1240399423768891489846),(.D15,846208355584406716528),(.D17,70607434957914635830),(.D15,51158639967115149424),(.D17,3980619120642096694),(.D15,3089328606887805040),(.D17,221767097275907638),(.D15,186327638489432176),(.D17,12171593719479862),(.D15,11223264940523632),(.D17,655171491200566),(.D15,675065779716208),(.D17,34351148432950),(.D15,40542343790704),(.D17,1734629916214),(.D15,2430817271920),(.D17,82644565558),(.D15,145483628656),(.D17,3554672182),(.D15,8690073712),(.D17,121503286),(.D15,517963888),(.D17,2118450742),(.D15,610381936),(.D17,24406582),(.D15,36576112),(.D17,1131766),(.D15,2187808),(.D17,1225137893),(.D17,4904),(.D8,9391)])]], + .ms [(.m2,.s6,382511685112441262309375),(.m7,.s5,382511685112441262309369)], + .m .m5, + .b 382511685112441262309375 [[([262091339799265309360125],[(.D8,178859630538687812468684),(.D16,264304949088110455554058),(.D6,374210650279271964081720),(.D16,230796438478217055043696),(.D6,21617278211378380799542),(.D16,13982055547119536701552),(.D6,1240399423768891489846),(.D16,846208355584406716528),(.D6,70607434957914635830),(.D16,51158639967115149424),(.D6,3980619120642096694),(.D16,3089328606887805040),(.D6,221767097275907638),(.D16,186327638489432176),(.D6,12171593719479862),(.D16,11223264940523632),(.D6,655171491200566),(.D16,675065779716208),(.D6,34351148432950),(.D16,40542343790704),(.D6,1734629916214),(.D16,2430817271920),(.D6,82644565558),(.D16,145483628656),(.D6,3554672182),(.D16,8690073712),(.D6,121503286),(.D16,517963888),(.D6,2118450742),(.D16,610381936),(.D6,24406582),(.D16,36576112),(.D6,1131766),(.D16,2187808),(.D6,1225137893),(.D6,4905),(.D9,9391),(.D14,294),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,513557355012073916989438,146098213063779648798670),(.m0,256114594719383414636554,372163061687090203852344),(.m0,230284541330171614986352,21489303924367020785206),(.m0,13950061975366696697968,1232401030830681488950),(.m0,844208757349854216304,70107535399276510774),(.m0,51033665077455618160,3949375398227213878),(.m0,3081517676284084336,219814364624977462),(.m0,185839455326699632,12049547928796726),(.m0,11192753492852848,647543629282870),(.m0,673158814236784,33874407063094),(.m0,40423158448240,1704833580598),(.m0,2423368188016,80782294582),(.m0,145018060912,3438280246),(.m0,8660975728,114228790),(.m0,516145264,2117996086),(.m0,610268272,24378166),(.m0,36569008,1129990),(.m0,2187364,1225137782)], + .ms [(.m12,.s7,4875),(.m0,.s6,9385),(.m3,.s6,293),(.m21,.s3,293),(.m4,.s3,9385),(.m4,.s3,4875)], + .ms2 .s3 .s0 [(.m13,1225137782,2187364),(.m1,1129990,36569008),(.m1,24378166,610268272),(.m1,2117996086,516145264),(.m1,114228790,8660975728),(.m1,3438280246,145018060912),(.m1,80782294582,2423368188016),(.m1,1704833580598,40423158448240),(.m1,33874407063094,673158814236784),(.m1,647543629282870,11192753492852848),(.m1,12049547928796726,185839455326699632),(.m1,219814364624977462,3081517676284084336),(.m1,3949375398227213878,51033665077455618160),(.m1,70107535399276510774,844208757349854216304),(.m1,1232401030830681488950,13950061975366696697968),(.m1,21489303924367020785206,230284541330171614986352),(.m1,372163061687090203852344,256114594719383414636554),(.m1,146098213063779648798670,513557355012073916989433)], + .ms [(.m26,.s7,513557355012073916989438),(.m8,.s2,513557355012073916989433)], + .m .m9, + .b 0 [[([1048365359197061237440508],[(.D7,513557355012073916989438),(.D7,146098213063779648798669),(.D16,256114594719383414636554),(.D6,372163061687090203852344),(.D16,230284541330171614986352),(.D6,21489303924367020785206),(.D16,13950061975366696697968),(.D6,1232401030830681488950),(.D16,844208757349854216304),(.D6,70107535399276510774),(.D16,51033665077455618160),(.D6,3949375398227213878),(.D16,3081517676284084336),(.D6,219814364624977462),(.D16,185839455326699632),(.D6,12049547928796726),(.D16,11192753492852848),(.D6,647543629282870),(.D16,673158814236784),(.D6,33874407063094),(.D16,40423158448240),(.D6,1704833580598),(.D16,2423368188016),(.D6,80782294582),(.D16,145018060912),(.D6,3438280246),(.D16,8660975728),(.D6,114228790),(.D16,516145264),(.D6,2117996086),(.D16,610268272),(.D6,24378166),(.D16,36569008),(.D6,1129990),(.D16,2187364),(.D6,1225137782),(.D12,4875),(.D16,9385),(.D16,293),(.D12,3)])]], + .ms [(.m2,.s6,524182679598530618720254)], + .ms2 .s6 .s7 [(.m3,382511685112441262309374,113336795588871485128654),(.m0,247924240350656373719050,370115473094908443622968),(.m0,229772644182126174929008,21361329637355660770870),(.m0,13918068403613856694384,1224402637892471488054),(.m0,842209159115301716080,69607635840638385718),(.m0,50908690187796086896,3918131675812331062),(.m0,3073706745680363632,217861631974047286),(.m0,185351272163967088,11927502138113590),(.m0,11162242045182064,639915767365174),(.m0,671251848757360,33397665693238),(.m0,40303973105776,1675037244982),(.m0,2415919104112,78920023606),(.m0,144552493168,3321888310),(.m0,8631877744,106954294),(.m0,514326640,2117541430),(.m0,610154608,24349750),(.m0,36561904,1128214),(.m0,2186920,1225137671)], + .ms [(.m3,.s6,4849)], + .ms2 .s6 .s7 [(.m6,9377,292)], + .ms2 .s3 .s0 [(.m19,292,9377)], + .ms [(.m17,.s0,4849)], + .ms2 .s3 .s0 [(.m4,1225137671,2186920),(.m1,1128214,36561904),(.m1,24349750,610154608),(.m1,2117541430,514326640),(.m1,106954294,8631877744),(.m1,3321888310,144552493168),(.m1,78920023606,2415919104112),(.m1,1675037244982,40303973105776),(.m1,33397665693238,671251848757360),(.m1,639915767365174,11162242045182064),(.m1,11927502138113590,185351272163967088),(.m1,217861631974047286,3073706745680363632),(.m1,3918131675812331062,50908690187796086896),(.m1,69607635840638385718,842209159115301716080),(.m1,1224402637892471488054,13918068403613856694384),(.m1,21361329637355660770870,229772644182126174929008),(.m1,370115473094908443622968,247924240350656373719050),(.m1,113336795588871485128654,382511685112441262309374)], + .ms [(.m1,.s3,524182679598530618720248),(.m10,.s7,524182679598530618720254),(.m8,.s2,524182679598530618720249)], + .m .m9, + .b 0 [[([2096730718394122474881014,963362762505407623593990],[(.D7,524182679598530618720254), + (.D17,382511685112441262309374)]), + ([191255842556220631154687],[(.D6,113336795588871485128654), + (.D16,247924240350656373719050), + (.D6,370115473094908443622968), + (.D16,229772644182126174929008), + (.D6,21361329637355660770870), + (.D16,13918068403613856694384), + (.D6,1224402637892471488054), + (.D16,842209159115301716080), + (.D6,69607635840638385718), + (.D16,50908690187796086896), + (.D6,3918131675812331062), + (.D16,3073706745680363632), + (.D6,217861631974047286), + (.D16,185351272163967088), + (.D6,11927502138113590), + (.D16,11162242045182064), + (.D6,639915767365174), + (.D16,671251848757360), + (.D6,33397665693238), + (.D16,40303973105776), + (.D6,1675037244982), + (.D16,2415919104112), + (.D6,78920023606), + (.D16,144552493168), + (.D6,3321888310), + (.D16,8631877744), + (.D6,106954294), + (.D16,514326640), + (.D6,2117541430), + (.D16,610154608), + (.D6,24349750), + (.D16,36561904), + (.D6,1128214), + (.D16,2186920), + (.D6,1225137671), + (.D6,4849), + (.D12,9377), + (.D6,292), + (.D16,4)])]], + .ms [(.m2,.s6,1530046740449765049237502),(.m3,.s6,141670994486089356410878)], + .ms2 .s6 .s7 [(.m3,286883763834330946732030,89429815269343906234318),(.m0,241947495270774478995466,368621286824937969942072),(.m0,229399097614633556508784,21267942995482506165814),(.m0,13894721743145568043120,1218565972775399325238),(.m0,840749992836033675376,69242844270821375542),(.m0,50817492295341834352,3895332202698767926),(.m0,3068006877401972848,216436664904449590),(.m0,184995030396567664,11838441696263734),(.m0,11139976934719600,634349489749558),(.m0,669860279353456,33049773342262),(.m0,40217000018032,1653293973046),(.m0,2410483286128,77561069110),(.m0,144212754544,3236953654),(.m0,8610644080,101645878),(.m0,512999536,2117209654),(.m0,610071664,24329014),(.m0,36556720,1126918),(.m0,2186596,1225137590)], + .ms [(.m12,.s7,4827),(.m0,.s6,9373),(.m3,.s6,290),(.m20,.s0,290),(.m1,.s3,9373),(.m4,.s3,4827)], + .ms2 .s3 .s0 [(.m13,1225137590,2186596),(.m1,1126918,36556720),(.m1,24329014,610071664),(.m1,2117209654,512999536),(.m1,101645878,8610644080),(.m1,3236953654,144212754544),(.m1,77561069110,2410483286128),(.m1,1653293973046,40217000018032),(.m1,33049773342262,669860279353456),(.m1,634349489749558,11139976934719600),(.m1,11838441696263734,184995030396567664),(.m1,216436664904449590,3068006877401972848),(.m1,3895332202698767926,50817492295341834352),(.m1,69242844270821375542,840749992836033675376),(.m1,1218565972775399325238,13894721743145568043120),(.m1,21267942995482506165814,229399097614633556508784),(.m1,368621286824937969942072,241947495270774478995466),(.m1,89429815269343906234318,286883763834330946732030)], + .ms [(.m1,.s3,141670994486089356410878),(.m4,.s3,1530046740449765049237496),(.m10,.s7,1530046740449765049237502),(.m8,.s2,1530046740449765049237497)], + .m .m9, + .b 0 [[([4533471823554859405148084],[(.D7,1530046740449765049237502)]), + ([566683977944357425643510,283341988972178712821759,141670994486089356410880,70835497243044678205440,35417748621522339102720,17708874310761169551360,8854437155380584775680,4427218577690292387840,2213609288845146193920,1106804644422573096960,553402322211286548480,276701161105643274240,138350580552821637120,69175290276410818560,34587645138205409280,17293822569102704640,8646911284551352320,4323455642275676160,2161727821137838080,1080863910568919040,540431955284459520,270215977642229760,135107988821114880,67553994410557440,33776997205278720,16888498602639360,8444249301319680,4222124650659840,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,141670994486089356410878), + (.D16,286883763834330946732030)]), + ([70835497243044678205438],[(.D6,89429815269343906234318), + (.D16,241947495270774478995466), + (.D6,368621286824937969942072), + (.D16,229399097614633556508784), + (.D6,21267942995482506165814), + (.D16,13894721743145568043120), + (.D6,1218565972775399325238), + (.D16,840749992836033675376), + (.D6,69242844270821375542), + (.D16,50817492295341834352), + (.D6,3895332202698767926), + (.D16,3068006877401972848), + (.D6,216436664904449590), + (.D16,184995030396567664), + (.D6,11838441696263734), + (.D16,11139976934719600), + (.D6,634349489749558), + (.D16,669860279353456), + (.D6,33049773342262), + (.D16,40217000018032), + (.D6,1653293973046), + (.D16,2410483286128), + (.D6,77561069110), + (.D16,144212754544), + (.D6,3236953654), + (.D16,8610644080), + (.D6,101645878), + (.D16,512999536), + (.D6,2117209654), + (.D16,610071664), + (.D6,24329014), + (.D16,36556720), + (.D6,1126918), + (.D16,2186596), + (.D6,1225137590), + (.D12,4827), + (.D16,9373), + (.D16,290), + (.D6,5)])]], + .ms [(.m2,.s6,2266735911777429702574042),(.m3,.s6,963362762505407623593991),(.m14,.s5,963362762505407623593991),(.m4,.s5,2266735911777429702574036)], + .m .m5, + .b 2266735911777429702574042 [[([23],[(.D16,963362762505407623593991),(.D18,1),(.D15,251466015212808607629309),(.D16,80575378113963321458638)])]], + .ms [(.m2,.s6,2266735911777429702574054),(.m3,.s6,963362762505407623593988),(.m7,.s5,963362762505407623593988),(.m4,.s5,2266735911777429702574048)], + .m .m5, + .b 2266735911777429702574054 [[([7],[(.D16,963362762505407623593988),(.D6,1)])]], + .ms [(.m2,.s6,2266735911777429702574058),(.m6,.s6,963362762505407623593986),(.m15,.s5,963362762505407623593986),(.m11,.s5,2266735911777429702574052)], + .m .m5, + .b 2266735911777429702574058 [[([5],[(.D12,963362762505407623593986),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,2266735911777429702574061,963362762505407623593987)], + .ms [(.m23,.s1,963362762505407623593987),(.m22,.s4,2266735911777429702574055)], + .m .m24, + .b 2266735911777429702574061 [[([17],[(.D6,963362762505407623593987),(.D6,2)])]], + .ms [(.m2,.s6,2266735911777429702574070),(.m6,.s6,963362762505407623593983),(.m14,.s5,963362762505407623593983),(.m11,.s5,2266735911777429702574064)], + .m .m5, + .b 2266735911777429702574070 [[([23],[(.D12,963362762505407623593983),(.D18,1),(.D17,251466015212808607629308),(.D17,80575378113963321458638),(.D15,239733885981929332801546),(.D17,368067884502726683393592),(.D15,229260747034080734871664),(.D17,21233355350344300756534),(.D15,13886074831861016690800),(.D17,1216404244954261487158),(.D15,840209560880749215856),(.D17,69107736282000260662),(.D15,50783715298136555632),(.D17,3886887953397448246),(.D15,3065895815076642928),(.D17,215908899323117110),(.D15,184863089001234544),(.D17,11805456347430454),(.D15,11131730597511280),(.D17,632287905447478),(.D15,669344883277936),(.D17,32920924323382),(.D15,40184787763312),(.D17,1645240909366),(.D15,2408470020208),(.D17,77057752630),(.D15,144086925424),(.D17,3205496374),(.D15,8602779760),(.D17,99679798),(.D15,512508016),(.D17,2117086774),(.D15,610040944),(.D17,24321334),(.D15,36554800),(.D17,1126438),(.D15,2186476),(.D17,1225137560),(.D11,4819),(.D6,9372)])]], + .ms [(.m2,.s6,2266735911777429702574082),(.m6,.s6,963362762505407623593980),(.m7,.s5,963362762505407623593980),(.m11,.s5,2266735911777429702574076)], + .m .m5, + .b 2266735911777429702574082 [[([3853451050021630494375921,1926725525010815247187965,340010386766614455386121],[(.D12,963362762505407623593980), + (.D8,251466015212808607629308), + (.D6,80575378113963321458638), + (.D16,239733885981929332801546)]), + ([23906980319527578894335],[(.D6,368067884502726683393592), + (.D16,229260747034080734871664), + (.D6,21233355350344300756534), + (.D16,13886074831861016690800), + (.D6,1216404244954261487158), + (.D16,840209560880749215856), + (.D6,69107736282000260662), + (.D16,50783715298136555632), + (.D6,3886887953397448246), + (.D16,3065895815076642928), + (.D6,215908899323117110), + (.D16,184863089001234544), + (.D6,11805456347430454), + (.D16,11131730597511280), + (.D6,632287905447478), + (.D16,669344883277936), + (.D6,32920924323382), + (.D16,40184787763312), + (.D6,1645240909366), + (.D16,2408470020208), + (.D6,77057752630), + (.D16,144086925424), + (.D6,3205496374), + (.D16,8602779760), + (.D6,99679798), + (.D16,512508016), + (.D6,2117086774), + (.D16,610040944), + (.D6,24321334), + (.D16,36554800), + (.D6,1126438), + (.D16,2186476), + (.D6,1225137560), + (.D12,4820), + (.D7,9371), + (.D8,289), + (.D7,4)])]], + .ms [(.m2,.s6,5326829392676959801049086)], + .ms2 .s6 .s7 [(.m3,198339392280525098975230,60210172656587976474622)], + .ms [(.m3,.s6,32761417474908163669966)], + .ms2 .s6 .s7 [(.m3,227780395822165543354378,365079511962785736031800),(.m0,228513653899095498031216,21046582066597991546422),(.m0,13839381510924439388272,1204730914720117161526),(.m0,837291228322213134448,68378153142366240310),(.m0,50601319513228050544,3841289007170321974),(.m0,3054496078519861360,213058965183921718),(.m0,184150605466435696,11627335463730742),(.m0,11087200376586352,621155350216246),(.m0,666561744470128,32225139621430),(.m0,40010841587824,1601754365494),(.m0,2397598384240,74339843638),(.m0,143407448176,3035627062),(.m0,8560312432,89062966),(.m0,509853808,2116423222),(.m0,609875056,24279862),(.m0,36544432,1123846),(.m0,2185828,1225137398)], + .ms [(.m12,.s7,4779),(.m0,.s6,9361),(.m3,.s6,287),(.m21,.s3,287),(.m4,.s3,9361),(.m4,.s3,4779)], + .ms2 .s3 .s0 [(.m13,1225137398,2185828),(.m1,1123846,36544432),(.m1,24279862,609875056),(.m1,2116423222,509853808),(.m1,89062966,8560312432),(.m1,3035627062,143407448176),(.m1,74339843638,2397598384240),(.m1,1601754365494,40010841587824),(.m1,32225139621430,666561744470128),(.m1,621155350216246,11087200376586352),(.m1,11627335463730742,184150605466435696),(.m1,213058965183921718,3054496078519861360),(.m1,3841289007170321974,50601319513228050544),(.m1,68378153142366240310,837291228322213134448),(.m1,1204730914720117161526,13839381510924439388272),(.m1,21046582066597991546422,228513653899095498031216),(.m1,365079511962785736031800,227780395822165543354378),(.m1,32761417474908163669966,60210172656587976474622)], + .ms [(.m4,.s3,198339392280525098975230),(.m4,.s3,5326829392676959801049080),(.m10,.s7,5326829392676959801049086),(.m8,.s2,5326829392676959801049081)], + .m .m9, + .b 0 [[([6247690856836540617719768],[(.D7,5326829392676959801049086)]), + ([793357569122100395900918,396678784561050197950463,198339392280525098975232,99169696140262549487616,49584848070131274743808,24792424035065637371904],[(.D17,198339392280525098975230), + (.D6,60210172656587976474622), + (.D6,32761417474908163669966)]), + ([24405042409517736787967],[(.D16,227780395822165543354378), + (.D6,365079511962785736031800), + (.D16,228513653899095498031216), + (.D6,21046582066597991546422), + (.D16,13839381510924439388272), + (.D6,1204730914720117161526), + (.D16,837291228322213134448), + (.D6,68378153142366240310), + (.D16,50601319513228050544), + (.D6,3841289007170321974), + (.D16,3054496078519861360), + (.D6,213058965183921718), + (.D16,184150605466435696), + (.D6,11627335463730742), + (.D16,11087200376586352), + (.D6,621155350216246), + (.D16,666561744470128), + (.D6,32225139621430), + (.D16,40010841587824), + (.D6,1601754365494), + (.D16,2397598384240), + (.D6,74339843638), + (.D16,143407448176), + (.D6,3035627062), + (.D16,8560312432), + (.D6,89062966), + (.D16,509853808), + (.D6,2116423222), + (.D16,609875056), + (.D6,24279862), + (.D16,36544432), + (.D6,1123846), + (.D16,2185828), + (.D6,1225137398), + (.D12,4779), + (.D16,9361), + (.D16,287), + (.D12,3)])]], + ] (by decide +kernel) +theorem chunk_27_step : (cfg_27.denote) [qi]⊢* (cfg_28.denote) := + step_chunk [ + .b 3123845428418270308859884 [[([99169696140262549487580],[(.D15,4545868035572392223834114)]), + ([12396212017532818685952,6198106008766409342976,3099053004383204671488,1549526502191602335744,774763251095801167872,387381625547900583936,193690812773950291968,96845406386975145984,48422703193487572992,24211351596743786496,12105675798371893248,6052837899185946624,3026418949592973312,1513209474796486656,756604737398243328,378302368699121664,189151184349560832,94575592174780416,47287796087390208,23643898043695104,11821949021847552,5910974510923776,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D6,3099053004383204671488), + (.D16,11400087837552502898686)]), + ([1549526502191602335743],[(.D17,20558896270149295275982), + (.D15,224729765520975826255882), + (.D17,364316854387488306757176), + (.D15,228322989505271140712560), + (.D17,20998915968141902216758), + (.D15,13827464986310417055856), + (.D17,1201751783566611578422), + (.D15,836546445533836738672), + (.D17,68191957445272141366), + (.D15,50554770588954525808), + (.D17,3829651776101940790), + (.D15,3051586770752766064), + (.D17,212331638242147894), + (.D15,183968773730992240), + (.D17,11581877529869878), + (.D15,11075835893121136), + (.D17,618314229349942), + (.D15,665851464253552), + (.D17,32047569567286), + (.D15,39966449074288), + (.D17,1590656237110), + (.D15,2394823852144), + (.D17,73646210614), + (.D15,143234039920), + (.D17,2992274998), + (.D15,8549474416), + (.D17,86353462), + (.D15,509176432), + (.D17,2116253878), + (.D15,609832720), + (.D17,24269278), + (.D15,36541786), + (.D17,1123184), + (.D6,2185664), + (.D13,1225137355), + (.D10,4768)])], + [([8],[(.D15,4533471823554859405148167), + (.D21,0), + (.D19,10625324586456701730813)])]], + .ms [(.m2,.s6,3173430276488401583603678),(.m6,.s6,4533471823554859405148165),(.m7,.s5,4533471823554859405148165),(.m11,.s5,3173430276488401583603672)], + .m .m5, + .b 3173430276488401583603678 [[([41],[(.D12,4533471823554859405148165),(.D8,1),(.D7,10625324586456701730812)])],[([255007790074960841539462],[(.D17,4533471823554859405148161),(.D2,10625324586456701730810)])]], + .ms [(.m2,.s6,3300934171525882004373430),(.m3,.s6,4501595849795489299955728),(.m27,.s2,4501595849795489299955728),(.m1,.s5,3300934171525882004373424)], + .m .m5, + .b 3300934171525882004373430 [[([7],[(.D16,4501595849795489299955728), + (.D6,1)])], + [([16],[(.D11,4501595849795489299955726), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,4501595849795489299955725), + (.D17,1), + (.D15,0), + (.D6,20365205457375344984014)])], + [([16],[(.D11,4501595849795489299955723), + (.D3,0)])], + [([8],[(.D15,4501595849795489299955722), + (.D17,1), + (.D21,20365205457375344984013), + (.D15,224681342817782338682890), + (.D17,364304748711689934863928), + (.D15,228319963086321547739248), + (.D17,20998159363404503973430), + (.D15,13827275835126067495024), + (.D17,1201704495770524188214), + (.D15,836534623584814891120), + (.D17,68189001958016679478), + (.D15,50554031717140660336), + (.D17,3829467058148474422), + (.D15,3051540591264399472), + (.D17,212320093370056246), + (.D15,183965887512969328), + (.D17,11581155975364150), + (.D15,11075655504494704), + (.D17,618269132193334), + (.D15,665840189964400), + (.D17,32044750994998), + (.D15,39965744431216), + (.D17,1590480076342), + (.D15,2394779811952), + (.D17,73635200566), + (.D15,143231287408), + (.D17,2991586870), + (.D15,8549302384), + (.D17,86310454), + (.D15,509165680), + (.D17,2116251190), + (.D15,609832048), + (.D17,24269110), + (.D15,36541744), + (.D17,1123174), + (.D15,2185660), + (.D17,1225137356), + (.D11,4768), + (.D12,9358)])], + [([18],[(.D11,4501595849795489299955720), + (.D13,0), + (.D16,20365205457375344984013), + (.D16,224681342817782338682890)])], + [([651686574636011039488452],[(.D17,4501595849795489299955719)]), + ([81460821829501379936059,40730410914750689968031,20365205457375344984016,10182602728687672492008,5091301364343836246004,2545650682171918122999,1272825341085959061501,636412670542979530752,318206335271489765376,159103167635744882688,79551583817872441344,39775791908936220672,19887895954468110336,9943947977234055168,4971973988617027584,2485986994308513792,1242993497154256896,621496748577128448,310748374288564224,155374187144282112,77687093572141056,38843546786070528,19421773393035264,9710886696517632,4855443348258816,2427721674129408,1213860837064704,606930418532352,303465209266176,151732604633088,75866302316544,37933151158272,18966575579136,9483287789568,4741643894784,2370821947392,1185410973696,592705486848,296352743424,148176371712,74088185856,37044092928,18522046464,9261023232,4630511616,2315255808,1157627904,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,20365205457375344984014), + (.D17,224681342817782338682890)]), + ([10182602728687672492007],[(.D6,364304748711689934863928), + (.D16,228319963086321547739248), + (.D6,20998159363404503973430), + (.D16,13827275835126067495024), + (.D6,1201704495770524188214), + (.D16,836534623584814891120), + (.D6,68189001958016679478), + (.D16,50554031717140660336), + (.D6,3829467058148474422), + (.D16,3051540591264399472), + (.D6,212320093370056246), + (.D16,183965887512969328), + (.D6,11581155975364150), + (.D16,11075655504494704), + (.D6,618269132193334), + (.D16,665840189964400), + (.D6,32044750994998), + (.D16,39965744431216), + (.D6,1590480076342), + (.D16,2394779811952), + (.D6,73635200566), + (.D16,143231287408), + (.D6,2991586870), + (.D16,8549302384), + (.D6,86310454), + (.D16,509165680), + (.D6,2116251190), + (.D16,609832048), + (.D6,24269110), + (.D16,36541744), + (.D6,1123174), + (.D16,2185660), + (.D6,1225137356), + (.D12,4769), + (.D13,9358), + (.D9,286), + (.D13,3)])], + [([10],[(.D17,4420135027965987920019663), + (.D21,0), + (.D19,219590041453438502436886)])]], + .ms [(.m2,.s6,3626777458843887524117698),(.m3,.s6,4420135027965987920019661),(.m7,.s5,4420135027965987920019661),(.m4,.s5,3626777458843887524117692)], + .m .m5, + .b 3626777458843887524117698 [[([43],[(.D16,4420135027965987920019661),(.D8,1),(.D7,219590041453438502436885)])],[([5270160994882524058485210],[(.D11,4420135027965987920019654),(.D2,219590041453438502436883)])]], + .ms2 .s6 .s7 [(.m2,6261857956285149553360325,3761364903605672412709005)], + .ms [(.m29,.s2,3761364903605672412709005),(.m4,.s5,6261857956285149553360319)], + .m .m5, + .b 6261857956285149553360325 [[([9],[(.D6,3761364903605672412709005),(.D6,1)])],[([20],[(.D15,3761364903605672412709003),(.D13,0),(.D10,363031923370603975802426),(.D9,228001756751050057973872)])],[([36],[(.D11,3761364903605672412708999)]),([7,2],[(.D12,1),(.D6,363031923370603975802426)])]], + .ms [(.m2,.s6,6261857956285149553360358),(.m6,.s6,3761364903605672412708995),(.m15,.s5,3761364903605672412708995),(.m11,.s5,6261857956285149553360352)], + .m .m5, + .b 6261857956285149553360358 [[([5],[(.D12,3761364903605672412708995),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,6261857956285149553360361,3761364903605672412708996)], + .ms [(.m23,.s1,3761364903605672412708996),(.m22,.s4,6261857956285149553360355)], + .m .m24, + .b 6261857956285149553360361 [[([17],[(.D6,3761364903605672412708996),(.D6,2)])],[([6],[(.D11,3761364903605672412708992),(.D21,0),(.D7,363031923370603975802424)])]], + .ms2 .s6 .s7 [(.m2,6261857956285149553360373,3761364903605672412708993)], + .ms2 .s5 .s2 [(.m28,3761364903605672412708993,6261857956285149553360368)], + .m .m18, + .b 6261857956285149553360373 [[([45],[(.D6,3761364903605672412708993),(.D8,1),(.D17,363031923370603975802423),(.D10,228001756751050057973871)])],[([36],[(.D15,3761364903605672412708986)]),([7,2],[(.D12,1),(.D17,363031923370603975802422)]),([1],[(.D11,228001756751050057973871),(.D16,20918607779586631532086)])],[([8],[(.D15,3761364903605672412708982),(.D21,0),(.D17,363031923370603975802421),(.D12,228001756751050057973872)])]], + .ms [(.m2,.s6,6261857956285149553360418),(.m6,.s6,3761364903605672412708980),(.m7,.s5,3761364903605672412708980),(.m11,.s5,6261857956285149553360412)], + .m .m5, + .b 6261857956285149553360418 [[([39],[(.D12,3761364903605672412708980),(.D8,363031923370603975802422),(.D13,228001756751050057973872),(.D17,20918607779586631532086),(.D15,13807387939171599384688),(.D17,1196732521781907160630),(.D15,835291630087660634224),(.D17,67878253583728115254),(.D15,50476344623568519280),(.D17,3810045284755439158),(.D15,3046685147916140656),(.D17,211106232532991542),(.D15,183662422303703152),(.D17,11505289673047606),(.D15,11056688928915568),(.D17,613527488298550),(.D15,664654778990704),(.D17,31748398251574),(.D15,39891656245360),(.D17,1571958029878),(.D15,2390149300336),(.D17,72477572662),(.D15,142941880432),(.D17,2919235126),(.D15,8531214448),(.D17,81788470),(.D15,508035184),(.D17,2115968566),(.D15,609761392),(.D17,24251446),(.D15,36537328),(.D17,1122070),(.D15,2185384),(.D17,1225137287),(.D17,4753),(.D11,9353),(.D17,286),(.D15,3)])]], + .ms [(.m2,.s6,6261857956285149553360438)], + .ms2 .s6 .s7 [(.m3,3761364903605672412708976,363031923370603975802422),(.m0,228001756751050057973872,20918607779586631532086),(.m0,13807387939171599384688,1196732521781907160630),(.m0,835291630087660634224,67878253583728115254),(.m0,50476344623568519280,3810045284755439158),(.m0,3046685147916140656,211106232532991542),(.m0,183662422303703152,11505289673047606),(.m0,11056688928915568,613527488298550),(.m0,664654778990704,31748398251574),(.m0,39891656245360,1571958029878),(.m0,2390149300336,72477572662),(.m0,142941880432,2919235126),(.m0,8531214448,81788470),(.m0,508035184,2115968566),(.m0,609761392,24251446),(.m0,36537328,1122070),(.m0,2185384,1225137287)], + .ms [(.m3,.s6,4753)], + .ms2 .s6 .s7 [(.m6,9353,286)], + .ms2 .s3 .s0 [(.m19,286,9353)], + .ms [(.m17,.s0,4753)], + .ms2 .s3 .s0 [(.m4,1225137287,2185384),(.m1,1122070,36537328),(.m1,24251446,609761392),(.m1,2115968566,508035184),(.m1,81788470,8531214448),(.m1,2919235126,142941880432),(.m1,72477572662,2390149300336),(.m1,1571958029878,39891656245360),(.m1,31748398251574,664654778990704),(.m1,613527488298550,11056688928915568),(.m1,11505289673047606,183662422303703152),(.m1,211106232532991542,3046685147916140656),(.m1,3810045284755439158,50476344623568519280),(.m1,67878253583728115254,835291630087660634224),(.m1,1196732521781907160630,13807387939171599384688),(.m1,20918607779586631532086,228001756751050057973872),(.m1,363031923370603975802422,3761364903605672412708976)], + .ms [(.m1,.s3,6261857956285149553360432),(.m10,.s7,6261857956285149553360438),(.m8,.s2,6261857956285149553360433)], + .m .m9, + .b 0 [[([191255842556220631154684],[(.D7,6261857956285149553360438),(.D17,3761364903605672412708976),(.D6,363031923370603975802422),(.D16,228001756751050057973872),(.D6,20918607779586631532086),(.D16,13807387939171599384688),(.D6,1196732521781907160630),(.D16,835291630087660634224),(.D6,67878253583728115254),(.D16,50476344623568519280),(.D6,3810045284755439158),(.D16,3046685147916140656),(.D6,211106232532991542),(.D16,183662422303703152),(.D6,11505289673047606),(.D16,11056688928915568),(.D6,613527488298550),(.D16,664654778990704),(.D6,31748398251574),(.D16,39891656245360),(.D6,1571958029878),(.D16,2390149300336),(.D6,72477572662),(.D16,142941880432),(.D6,2919235126),(.D16,8531214448),(.D6,81788470),(.D16,508035184),(.D6,2115968566),(.D16,609761392),(.D6,24251446),(.D16,36537328),(.D6,1122070),(.D16,2185384),(.D6,1225137287),(.D6,4753),(.D12,9353),(.D6,286),(.D16,4)])]], + .ms [(.m2,.s6,95627921278110315577342),(.m3,.s6,6237950975965621974466102)], + .ms2 .s6 .s7 [(.m3,3755388158525790517985392,361537737100633502121526),(.m0,227628210183557439553648,20825221137713476927030),(.m0,13784041278703310733424,1190895856664834997814),(.m0,833832463808392593520,67513462013911105078),(.m0,50385146731114266736,3787245811641876022),(.m0,3040985279637749872,209681265463393846),(.m0,183306180536303728,11416229231197750),(.m0,11034423818453104,607961210682934),(.m0,663263209586800,31400505900598),(.m0,39804683157616,1550214757942),(.m0,2384713482352,71118618166),(.m0,142602141808,2834300470),(.m0,8509980784,76480054),(.m0,506708080,2115636790),(.m0,609678448,24230710),(.m0,36532144,1120774),(.m0,2185060,1225137206)], + .ms [(.m12,.s7,4731),(.m0,.s6,9349),(.m3,.s6,284),(.m20,.s0,284),(.m1,.s3,9349),(.m4,.s3,4731)], + .ms2 .s3 .s0 [(.m13,1225137206,2185060),(.m1,1120774,36532144),(.m1,24230710,609678448),(.m1,2115636790,506708080),(.m1,76480054,8509980784),(.m1,2834300470,142602141808),(.m1,71118618166,2384713482352),(.m1,1550214757942,39804683157616),(.m1,31400505900598,663263209586800),(.m1,607961210682934,11034423818453104),(.m1,11416229231197750,183306180536303728),(.m1,209681265463393846,3040985279637749872),(.m1,3787245811641876022,50385146731114266736),(.m1,67513462013911105078,833832463808392593520),(.m1,1190895856664834997814,13784041278703310733424),(.m1,20825221137713476927030,227628210183557439553648),(.m1,361537737100633502121526,3755388158525790517985392)], + .ms [(.m1,.s3,6237950975965621974466102),(.m4,.s3,95627921278110315577336),(.m10,.s7,95627921278110315577342),(.m8,.s2,95627921278110315577337)], + .m .m9, + .b 0 [[([382511685112441262309366,191255842556220631154685,95627921278110315577344,47813960639055157788672,23906980319527578894336,11953490159763789447168,5976745079881894723584,2988372539940947361792,1494186269970473680896,747093134985236840448,373546567492618420224,186773283746309210112,93386641873154605056,46693320936577302528,23346660468288651264,11673330234144325632,5836665117072162816,2918332558536081408,1459166279268040704,729583139634020352,364791569817010176,182395784908505088,91197892454252544,45598946227126272,22799473113563136,11399736556781568,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,95627921278110315577342), + (.D17,6237950975965621974466102)]), + ([47813960639055157788670],[(.D16,3755388158525790517985392), + (.D6,361537737100633502121526), + (.D16,227628210183557439553648), + (.D6,20825221137713476927030), + (.D16,13784041278703310733424), + (.D6,1190895856664834997814), + (.D16,833832463808392593520), + (.D6,67513462013911105078), + (.D16,50385146731114266736), + (.D6,3787245811641876022), + (.D16,3040985279637749872), + (.D6,209681265463393846), + (.D16,183306180536303728), + (.D6,11416229231197750), + (.D16,11034423818453104), + (.D6,607961210682934), + (.D16,663263209586800), + (.D6,31400505900598), + (.D16,39804683157616), + (.D6,1550214757942), + (.D16,2384713482352), + (.D6,71118618166), + (.D16,142602141808), + (.D6,2834300470), + (.D16,8509980784), + (.D6,76480054), + (.D16,506708080), + (.D6,2115636790), + (.D16,609678448), + (.D6,24230710), + (.D16,36532144), + (.D6,1120774), + (.D16,2185060), + (.D6,1225137206), + (.D12,4731), + (.D16,9349), + (.D16,284), + (.D6,5)])]], + .ms [(.m2,.s6,382511685112441262309365),(.m14,.s5,382511685112441262309359)], + .m .m5, + .b 382511685112441262309365 [[([5],[(.D18,1),(.D15,6214043995646094395571765),(.D14,3749411413445908623261808)])]], + .ms [(.m2,.s6,382511685112441262309368),(.m7,.s5,382511685112441262309362)], + .m .m5, + .b 382511685112441262309368 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,382511685112441262309369),(.m15,.s5,382511685112441262309363)], + .m .m5, + .b 382511685112441262309369 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,382511685112441262309370),(.m25,.s2,382511685112441262309365)], + .m .m18, + .b 382511685112441262309370 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,382511685112441262309372),(.m14,.s5,382511685112441262309366)], + .m .m5, + .b 382511685112441262309372 [[([5],[(.D18,1),(.D17,6214043995646094395571764),(.D15,3749411413445908623261808),(.D17,360043550830663028440630),(.D15,227254663616064821133424),(.D17,20731834495840322321974),(.D15,13760694618235022082160),(.D17,1185059191547762834998),(.D15,832373297529124552816),(.D17,67148670444094094902),(.D15,50293948838660014192),(.D17,3764446338528312886),(.D15,3035285411359359088),(.D17,208256298393796150),(.D15,182949938768904304),(.D17,11327168789347894),(.D15,11012158707990640),(.D17,602394933067318),(.D15,661871640182896),(.D17,31052613549622),(.D15,39717710069872),(.D17,1528471486006),(.D15,2379277664368),(.D17,69759663670),(.D15,142262403184),(.D17,2749365814),(.D15,8488747120),(.D17,71171638),(.D15,505380976),(.D17,2115305014),(.D15,609595504),(.D17,24209974),(.D15,36526960),(.D17,1119478),(.D15,2184736),(.D17,1225137125),(.D17,4712),(.D8,9343)])]], + .ms [(.m2,.s6,382511685112441262309375),(.m7,.s5,382511685112441262309369)], + .m .m5, + .b 382511685112441262309375 [[([262091339799265309360125],[(.D8,6214043995646094395571764),(.D16,3749411413445908623261808),(.D6,360043550830663028440630),(.D16,227254663616064821133424),(.D6,20731834495840322321974),(.D16,13760694618235022082160),(.D6,1185059191547762834998),(.D16,832373297529124552816),(.D6,67148670444094094902),(.D16,50293948838660014192),(.D6,3764446338528312886),(.D16,3035285411359359088),(.D6,208256298393796150),(.D16,182949938768904304),(.D6,11327168789347894),(.D16,11012158707990640),(.D6,602394933067318),(.D16,661871640182896),(.D6,31052613549622),(.D16,39717710069872),(.D6,1528471486006),(.D16,2379277664368),(.D6,69759663670),(.D16,142262403184),(.D6,2749365814),(.D16,8488747120),(.D6,71171638),(.D16,505380976),(.D6,2115305014),(.D16,609595504),(.D6,24209974),(.D16,36526960),(.D6,1119478),(.D16,2184736),(.D6,1225137125),(.D6,4713),(.D9,9343),(.D14,282),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,513557355012073916989438,6181282578171186231901750),(.m0,3741221059077181582344304,357995962238481268211254),(.m0,226742766468019381076080,20603860208828962307638),(.m0,13728701046482182078576,1177060798609552834102),(.m0,830373699294572052592,66648770885455969846),(.m0,50168973949000482928,3733202616113430070),(.m0,3027474480755638384,206303565742865974),(.m0,182461755606171760,11205122998664758),(.m0,10981647260319856,594767071149622),(.m0,659964674703472,30575872179766),(.m0,39598524727408,1498675150390),(.m0,2371828580464,67897392694),(.m0,141796835440,2632973878),(.m0,8459649136,63897142),(.m0,503562352,2114850358),(.m0,609481840,24181558),(.m0,36519856,1117702),(.m0,2184292,1225137014)], + .ms [(.m12,.s7,4683),(.m0,.s6,9337),(.m3,.s6,281),(.m21,.s3,281),(.m4,.s3,9337),(.m4,.s3,4683)], + .ms2 .s3 .s0 [(.m13,1225137014,2184292),(.m1,1117702,36519856),(.m1,24181558,609481840),(.m1,2114850358,503562352),(.m1,63897142,8459649136),(.m1,2632973878,141796835440),(.m1,67897392694,2371828580464),(.m1,1498675150390,39598524727408),(.m1,30575872179766,659964674703472),(.m1,594767071149622,10981647260319856),(.m1,11205122998664758,182461755606171760),(.m1,206303565742865974,3027474480755638384),(.m1,3733202616113430070,50168973949000482928),(.m1,66648770885455969846,830373699294572052592),(.m1,1177060798609552834102,13728701046482182078576),(.m1,20603860208828962307638,226742766468019381076080),(.m1,357995962238481268211254,3741221059077181582344304),(.m1,6181282578171186231901750,513557355012073916989433)], + .ms [(.m26,.s7,513557355012073916989438),(.m8,.s2,513557355012073916989433)], + .m .m9, + .b 0 [[([1048365359197061237440508],[(.D7,513557355012073916989438),(.D7,6181282578171186231901749),(.D16,3741221059077181582344304),(.D6,357995962238481268211254),(.D16,226742766468019381076080),(.D6,20603860208828962307638),(.D16,13728701046482182078576),(.D6,1177060798609552834102),(.D16,830373699294572052592),(.D6,66648770885455969846),(.D16,50168973949000482928),(.D6,3733202616113430070),(.D16,3027474480755638384),(.D6,206303565742865974),(.D16,182461755606171760),(.D6,11205122998664758),(.D16,10981647260319856),(.D6,594767071149622),(.D16,659964674703472),(.D6,30575872179766),(.D16,39598524727408),(.D6,1498675150390),(.D16,2371828580464),(.D6,67897392694),(.D16,141796835440),(.D6,2632973878),(.D16,8459649136),(.D6,63897142),(.D16,503562352),(.D6,2114850358),(.D16,609481840),(.D6,24181558),(.D16,36519856),(.D6,1117702),(.D16,2184292),(.D6,1225137014),(.D12,4683),(.D16,9337),(.D16,281),(.D12,3)])]], + .ms [(.m2,.s6,524182679598530618720254)], + .ms2 .s6 .s7 [(.m3,382511685112441262309374,6148521160696278068231734),(.m0,3733030704708454541426800,355948373646299507981878),(.m0,226230869319973941018736,20475885921817602293302),(.m0,13696707474729342074992,1169062405671342833206),(.m0,828374101060019552368,66148871326817844790),(.m0,50043999059340951664,3701958893698547254),(.m0,3019663550151917680,204350833091935798),(.m0,181973572443439216,11083077207981622),(.m0,10951135812649072,587139209231926),(.m0,658057709224048,30099130809910),(.m0,39479339384944,1468878814774),(.m0,2364379496560,66035121718),(.m0,141331267696,2516581942),(.m0,8430551152,56622646),(.m0,501743728,2114395702),(.m0,609368176,24153142),(.m0,36512752,1115926),(.m0,2183848,1225136903)], + .ms [(.m3,.s6,4657)], + .ms2 .s6 .s7 [(.m6,9329,280)], + .ms2 .s3 .s0 [(.m19,280,9329)], + .ms [(.m17,.s0,4657)], + .ms2 .s3 .s0 [(.m4,1225136903,2183848),(.m1,1115926,36512752),(.m1,24153142,609368176),(.m1,2114395702,501743728),(.m1,56622646,8430551152),(.m1,2516581942,141331267696),(.m1,66035121718,2364379496560),(.m1,1468878814774,39479339384944),(.m1,30099130809910,658057709224048),(.m1,587139209231926,10951135812649072),(.m1,11083077207981622,181973572443439216),(.m1,204350833091935798,3019663550151917680),(.m1,3701958893698547254,50043999059340951664),(.m1,66148871326817844790,828374101060019552368),(.m1,1169062405671342833206,13696707474729342074992),(.m1,20475885921817602293302,226230869319973941018736),(.m1,355948373646299507981878,3733030704708454541426800),(.m1,6148521160696278068231734,382511685112441262309374)], + .ms [(.m1,.s3,524182679598530618720248),(.m10,.s7,524182679598530618720254),(.m8,.s2,524182679598530618720249)], + .m .m9, + .b 0 [[([2096730718394122474881014,963362762505407623593990],[(.D7,524182679598530618720254), + (.D17,382511685112441262309374)]), + ([191255842556220631154687],[(.D6,6148521160696278068231734), + (.D16,3733030704708454541426800), + (.D6,355948373646299507981878), + (.D16,226230869319973941018736), + (.D6,20475885921817602293302), + (.D16,13696707474729342074992), + (.D6,1169062405671342833206), + (.D16,828374101060019552368), + (.D6,66148871326817844790), + (.D16,50043999059340951664), + (.D6,3701958893698547254), + (.D16,3019663550151917680), + (.D6,204350833091935798), + (.D16,181973572443439216), + (.D6,11083077207981622), + (.D16,10951135812649072), + (.D6,587139209231926), + (.D16,658057709224048), + (.D6,30099130809910), + (.D16,39479339384944), + (.D6,1468878814774), + (.D16,2364379496560), + (.D6,66035121718), + (.D16,141331267696), + (.D6,2516581942), + (.D16,8430551152), + (.D6,56622646), + (.D16,501743728), + (.D6,2114395702), + (.D16,609368176), + (.D6,24153142), + (.D16,36512752), + (.D6,1115926), + (.D16,2183848), + (.D6,1225136903), + (.D6,4657), + (.D12,9329), + (.D6,280), + (.D16,4)])]], + .ms [(.m2,.s6,1530046740449765049237502),(.m3,.s6,141670994486089356410878)], + .ms2 .s6 .s7 [(.m3,286883763834330946732030,6124614180376750489337398),(.m0,3727053959628572646703216,354454187376329034300982),(.m0,225857322752481322598512,20382499279944447688246),(.m0,13673360814261053423728,1163225740554270670390),(.m0,826914934780751511664,65784079757000834614),(.m0,49952801166886699120,3679159420584984118),(.m0,3013963681873526896,202925866022338102),(.m0,181617330676039792,10994016766131766),(.m0,10928870702186608,581572931616310),(.m0,656666139820144,29751238458934),(.m0,39392366297200,1447135542838),(.m0,2358943678576,64676167222),(.m0,140991529072,2431647286),(.m0,8409317488,51314230),(.m0,500416624,2114063926),(.m0,609285232,24132406),(.m0,36507568,1114630),(.m0,2183524,1225136822)], + .ms [(.m12,.s7,4635),(.m0,.s6,9325),(.m3,.s6,278),(.m20,.s0,278),(.m1,.s3,9325),(.m4,.s3,4635)], + .ms2 .s3 .s0 [(.m13,1225136822,2183524),(.m1,1114630,36507568),(.m1,24132406,609285232),(.m1,2114063926,500416624),(.m1,51314230,8409317488),(.m1,2431647286,140991529072),(.m1,64676167222,2358943678576),(.m1,1447135542838,39392366297200),(.m1,29751238458934,656666139820144),(.m1,581572931616310,10928870702186608),(.m1,10994016766131766,181617330676039792),(.m1,202925866022338102,3013963681873526896),(.m1,3679159420584984118,49952801166886699120),(.m1,65784079757000834614,826914934780751511664),(.m1,1163225740554270670390,13673360814261053423728),(.m1,20382499279944447688246,225857322752481322598512),(.m1,354454187376329034300982,3727053959628572646703216),(.m1,6124614180376750489337398,286883763834330946732030)], + .ms [(.m1,.s3,141670994486089356410878),(.m4,.s3,1530046740449765049237496),(.m10,.s7,1530046740449765049237502),(.m8,.s2,1530046740449765049237497)], + .m .m9, + .b 0 [[([4533471823554859405148084],[(.D7,1530046740449765049237502)]), + ([566683977944357425643510,283341988972178712821759,141670994486089356410880,70835497243044678205440,35417748621522339102720,17708874310761169551360,8854437155380584775680,4427218577690292387840,2213609288845146193920,1106804644422573096960,553402322211286548480,276701161105643274240,138350580552821637120,69175290276410818560,34587645138205409280,17293822569102704640,8646911284551352320,4323455642275676160,2161727821137838080,1080863910568919040,540431955284459520,270215977642229760,135107988821114880,67553994410557440,33776997205278720,16888498602639360,8444249301319680,4222124650659840,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,141670994486089356410878), + (.D16,286883763834330946732030)]), + ([70835497243044678205438],[(.D6,6124614180376750489337398), + (.D16,3727053959628572646703216), + (.D6,354454187376329034300982), + (.D16,225857322752481322598512), + (.D6,20382499279944447688246), + (.D16,13673360814261053423728), + (.D6,1163225740554270670390), + (.D16,826914934780751511664), + (.D6,65784079757000834614), + (.D16,49952801166886699120), + (.D6,3679159420584984118), + (.D16,3013963681873526896), + (.D6,202925866022338102), + (.D16,181617330676039792), + (.D6,10994016766131766), + (.D16,10928870702186608), + (.D6,581572931616310), + (.D16,656666139820144), + (.D6,29751238458934), + (.D16,39392366297200), + (.D6,1447135542838), + (.D16,2358943678576), + (.D6,64676167222), + (.D16,140991529072), + (.D6,2431647286), + (.D16,8409317488), + (.D6,51314230), + (.D16,500416624), + (.D6,2114063926), + (.D16,609285232), + (.D6,24132406), + (.D16,36507568), + (.D6,1114630), + (.D16,2183524), + (.D6,1225136822), + (.D12,4635), + (.D16,9325), + (.D16,278), + (.D6,5)])]], + .ms [(.m2,.s6,2266735911777429702574042),(.m3,.s6,963362762505407623593991),(.m14,.s5,963362762505407623593991),(.m4,.s5,2266735911777429702574036)], + .m .m5, + .b 2266735911777429702574042 [[([23],[(.D16,963362762505407623593991),(.D18,1),(.D15,251466015212808607629309),(.D16,6115759743221369904561718)])]], + .ms [(.m2,.s6,2266735911777429702574054),(.m3,.s6,963362762505407623593988),(.m7,.s5,963362762505407623593988),(.m4,.s5,2266735911777429702574048)], + .m .m5, + .b 2266735911777429702574054 [[([7],[(.D16,963362762505407623593988),(.D6,1)])]], + .ms [(.m2,.s6,2266735911777429702574058),(.m6,.s6,963362762505407623593986),(.m15,.s5,963362762505407623593986),(.m11,.s5,2266735911777429702574052)], + .m .m5, + .b 2266735911777429702574058 [[([5],[(.D12,963362762505407623593986),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,2266735911777429702574061,963362762505407623593987)], + .ms [(.m23,.s1,963362762505407623593987),(.m22,.s4,2266735911777429702574055)], + .m .m24, + .b 2266735911777429702574061 [[([17],[(.D6,963362762505407623593987),(.D6,2)])]], + .ms [(.m2,.s6,2266735911777429702574070),(.m6,.s6,963362762505407623593983),(.m14,.s5,963362762505407623593983),(.m11,.s5,2266735911777429702574064)], + .m .m5, + .b 2266735911777429702574070 [[([23],[(.D12,963362762505407623593983),(.D18,1),(.D17,251466015212808607629308),(.D17,6115759743221369904561718),(.D15,3724840350339727500509296),(.D17,353900785054117747752502),(.D15,225718972171928500961392),(.D17,20347911634806242278966),(.D15,13664713902976502071408),(.D17,1161064012733132832310),(.D15,826374502825467052144),(.D17,65648971768179719734),(.D15,49919024169681420400),(.D17,3670715171283664438),(.D15,3011852619548196976),(.D17,202398100441005622),(.D15,181485389280706672),(.D17,10961031417298486),(.D15,10920624364978288),(.D17,579511347314230),(.D15,656150743744624),(.D17,29622389440054),(.D15,39360154042480),(.D17,1439082479158),(.D15,2356930412656),(.D17,64172850742),(.D15,140865699952),(.D17,2400190006),(.D15,8401453168),(.D17,49348150),(.D15,499925104),(.D17,2113941046),(.D15,609254512),(.D17,24124726),(.D15,36505648),(.D17,1114150),(.D15,2183404),(.D17,1225136792),(.D11,4627),(.D6,9324)])]], + .ms [(.m2,.s6,2266735911777429702574082),(.m6,.s6,963362762505407623593980),(.m7,.s5,963362762505407623593980),(.m11,.s5,2266735911777429702574076)], + .m .m5, + .b 2266735911777429702574082 [[([3853451050021630494375921,1926725525010815247187965,340010386766614455386121],[(.D12,963362762505407623593980), + (.D8,251466015212808607629308), + (.D6,6115759743221369904561718)]), + ([95627921278110315577343],[(.D16,3724840350339727500509296), + (.D6,353900785054117747752502), + (.D16,225718972171928500961392), + (.D6,20347911634806242278966), + (.D16,13664713902976502071408), + (.D6,1161064012733132832310), + (.D16,826374502825467052144), + (.D6,65648971768179719734), + (.D16,49919024169681420400), + (.D6,3670715171283664438), + (.D16,3011852619548196976), + (.D6,202398100441005622), + (.D16,181485389280706672), + (.D6,10961031417298486), + (.D16,10920624364978288), + (.D6,579511347314230), + (.D16,656150743744624), + (.D6,29622389440054), + (.D16,39360154042480), + (.D6,1439082479158), + (.D16,2356930412656), + (.D6,64172850742), + (.D16,140865699952), + (.D6,2400190006), + (.D16,8401453168), + (.D6,49348150), + (.D16,499925104), + (.D6,2113941046), + (.D16,609254512), + (.D6,24124726), + (.D16,36505648), + (.D6,1114150), + (.D16,2183404), + (.D6,1225136792), + (.D12,4628), + (.D7,9323), + (.D8,277), + (.D7,4)])]], + .ms [(.m2,.s6,5326829392676959801049086)], + .ms2 .s6 .s7 [(.m3,198339392280525098975230,60210172656587976474622)], + .ms [(.m3,.s6,6067945782582314746773046)], + .ms2 .s6 .s7 [(.m3,3712886860179963711062128,350912412514176800390710),(.m0,224971879036943264120944,20161138351059933068854),(.m0,13618020582039924768880,1149390682498988506678),(.m0,823456170266930970736,64919388628545699382),(.m0,49736628384772915312,3625116225056538166),(.m0,3000452882991415408,199548166301810230),(.m0,180772905745907824,10782910533598774),(.m0,10876094144053360,568378792082998),(.m0,653367604936816,28926604738102),(.m0,39186207866992,1395595935286),(.m0,2346058776688,61454941750),(.m0,140186222704,2230320694),(.m0,8358985840,38731318),(.m0,497270896,2113277494),(.m0,609088624,24083254),(.m0,36495280,1111558),(.m0,2182756,1225136630)], + .ms [(.m12,.s7,4587),(.m0,.s6,9313),(.m3,.s6,275),(.m21,.s3,275),(.m4,.s3,9313),(.m4,.s3,4587)], + .ms2 .s3 .s0 [(.m13,1225136630,2182756),(.m1,1111558,36495280),(.m1,24083254,609088624),(.m1,2113277494,497270896),(.m1,38731318,8358985840),(.m1,2230320694,140186222704),(.m1,61454941750,2346058776688),(.m1,1395595935286,39186207866992),(.m1,28926604738102,653367604936816),(.m1,568378792082998,10876094144053360),(.m1,10782910533598774,180772905745907824),(.m1,199548166301810230,3000452882991415408),(.m1,3625116225056538166,49736628384772915312),(.m1,64919388628545699382,823456170266930970736),(.m1,1149390682498988506678,13618020582039924768880),(.m1,20161138351059933068854,224971879036943264120944),(.m1,350912412514176800390710,3712886860179963711062128),(.m1,6067945782582314746773046,60210172656587976474622)], + .ms [(.m4,.s3,198339392280525098975230),(.m4,.s3,5326829392676959801049080),(.m10,.s7,5326829392676959801049086),(.m8,.s2,5326829392676959801049081)], + .m .m9, + .b 0 [[([6346860552976803167207348],[(.D7,5326829392676959801049086)]), + ([793357569122100395900918,396678784561050197950463,198339392280525098975232,99169696140262549487616,49584848070131274743808,24792424035065637371904,12396212017532818685952,6198106008766409342976,3099053004383204671488,1549526502191602335744,774763251095801167872,387381625547900583936,193690812773950291968,96845406386975145984,48422703193487572992,24211351596743786496,12105675798371893248,6052837899185946624,3026418949592973312,1513209474796486656,756604737398243328,378302368699121664,189151184349560832,94575592174780416,47287796087390208,23643898043695104,11821949021847552,5910974510923776,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,198339392280525098975230), + (.D6,60210172656587976474622), + (.D6,6067945782582314746773046)]), + ([24792424035065637371903],[(.D16,3712886860179963711062128), + (.D6,350912412514176800390710), + (.D16,224971879036943264120944), + (.D6,20161138351059933068854), + (.D16,13618020582039924768880), + (.D6,1149390682498988506678), + (.D16,823456170266930970736), + (.D6,64919388628545699382), + (.D16,49736628384772915312), + (.D6,3625116225056538166), + (.D16,3000452882991415408), + (.D6,199548166301810230), + (.D16,180772905745907824), + (.D6,10782910533598774), + (.D16,10876094144053360), + (.D6,568378792082998), + (.D16,653367604936816), + (.D6,28926604738102), + (.D16,39186207866992), + (.D6,1395595935286), + (.D16,2346058776688), + (.D6,61454941750), + (.D16,140186222704), + (.D6,2230320694), + (.D16,8358985840), + (.D6,38731318), + (.D16,497270896), + (.D6,2113277494), + (.D16,609088624), + (.D6,24083254), + (.D16,36495280), + (.D6,1111558), + (.D16,2182756), + (.D6,1225136630), + (.D12,4587), + (.D16,9313), + (.D16,275), + (.D12,3)])], + [([8],[(.D15,4533471823554859405148167), + (.D21,0), + (.D19,10625324586456701730813)])]], + .ms [(.m2,.s6,3173430276488401583603678),(.m6,.s6,4533471823554859405148165),(.m7,.s5,4533471823554859405148165),(.m11,.s5,3173430276488401583603672)], + .m .m5, + .b 3173430276488401583603678 [[([41],[(.D12,4533471823554859405148165),(.D8,1),(.D7,10625324586456701730812)])],[([255007790074960841539462],[(.D17,4533471823554859405148161),(.D2,10625324586456701730810)])]], + .ms [(.m2,.s6,3300934171525882004373430)], + ] (by decide +kernel) +theorem chunk_28_step : (cfg_28.denote) [qi]⊢* (cfg_29.denote) := + step_chunk [ + .ms [(.m3,.s6,4501595849795489299955728),(.m27,.s2,4501595849795489299955728),(.m1,.s5,3300934171525882004373424)], + .m .m5, + .b 3300934171525882004373430 [[([7],[(.D16,4501595849795489299955728), + (.D6,1)])], + [([16],[(.D11,4501595849795489299955726), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,4501595849795489299955725), + (.D17,1), + (.D15,0), + (.D6,6055549570564781928087094)])], + [([16],[(.D11,4501595849795489299955723), + (.D3,0)])], + [([8],[(.D15,4501595849795489299955722), + (.D17,1), + (.D21,6055549570564781928087093), + (.D15,3709787807175580506390640), + (.D17,350137649263080999222838), + (.D15,224778188224169313828976), + (.D17,20112715647866445495862), + (.D15,13605914906241552875632), + (.D17,1146364263549395533366), + (.D15,822699565529532727408), + (.D17,64730237444196138550), + (.D15,49689340588685525104), + (.D17,3613294276034690614), + (.D15,2997497395735953520), + (.D17,198809294487944758), + (.D15,180588187792441456), + (.D17,10736731045232182), + (.D15,10864549271961712), + (.D17,565492574060086), + (.D15,652646050431088), + (.D17,28746216111670), + (.D15,39141110710384), + (.D17,1384321646134), + (.D15,2343240204400), + (.D17,60750298678), + (.D15,140010061936), + (.D17,2186280502), + (.D15,8347975792), + (.D17,35978806), + (.D15,496582768), + (.D17,2113105462), + (.D15,609045616), + (.D17,24072502), + (.D15,36492592), + (.D17,1110886), + (.D15,2182588), + (.D17,1225136588), + (.D11,4576), + (.D12,9310)])], + [([18],[(.D11,4501595849795489299955720), + (.D13,0), + (.D16,6055549570564781928087093), + (.D16,3709787807175580506390640)])], + [([651686574636011039490022],[(.D17,4501595849795489299955719), + (.D12,6055549570564781928087094), + (.D17,3709787807175580506390640), + (.D6,350137649263080999222838), + (.D16,224778188224169313828976), + (.D6,20112715647866445495862), + (.D16,13605914906241552875632), + (.D6,1146364263549395533366), + (.D16,822699565529532727408), + (.D6,64730237444196138550), + (.D16,49689340588685525104), + (.D6,3613294276034690614), + (.D16,2997497395735953520), + (.D6,198809294487944758), + (.D16,180588187792441456), + (.D6,10736731045232182), + (.D16,10864549271961712), + (.D6,565492574060086), + (.D16,652646050431088), + (.D6,28746216111670), + (.D16,39141110710384), + (.D6,1384321646134), + (.D16,2343240204400), + (.D6,60750298678), + (.D16,140010061936), + (.D6,2186280502), + (.D16,8347975792), + (.D6,35978806), + (.D16,496582768), + (.D6,2113105462), + (.D16,609045616), + (.D6,24072502), + (.D16,36492592), + (.D6,1110886), + (.D16,2182588), + (.D6,1225136588), + (.D12,4577), + (.D13,9310), + (.D9,274), + (.D13,3)])]], + .ms [(.m2,.s6,3626777458843887524118478)], + .ms2 .s6 .s7 [(.m3,4420135027965987920019466,6035184365107406583103032),(.m0,3704696505811236670144624,348864823921995040161334),(.m0,224459981888897824063600,20033164064048573054518),(.m0,13586027010287084765296,1141392289560778505782),(.m0,821456572032378470512,64419489069907574326),(.m0,49611653495113384048,3593872502641655350),(.m0,2992641952387694704,197595433650880054),(.m0,180284722583175280,10660864742915638),(.m0,10845582696382576,560750930165302),(.m0,651460639457392,28449863368246),(.m0,39067022524528,1365799599670),(.m0,2338609692784,59592670774),(.m0,139720654960,2113928758),(.m0,8329887856,31456822),(.m0,495452272,2112822838),(.m0,608974960,24054838),(.m0,36488176,1109782),(.m0,2182312,1225136519)], + .ms [(.m3,.s6,4561)], + .ms2 .s6 .s7 [(.m6,9305,274)], + .ms2 .s3 .s0 [(.m19,274,9305)], + .ms [(.m17,.s0,4561)], + .ms2 .s3 .s0 [(.m4,1225136519,2182312),(.m1,1109782,36488176),(.m1,24054838,608974960),(.m1,2112822838,495452272),(.m1,31456822,8329887856),(.m1,2113928758,139720654960),(.m1,59592670774,2338609692784),(.m1,1365799599670,39067022524528),(.m1,28449863368246,651460639457392),(.m1,560750930165302,10845582696382576),(.m1,10660864742915638,180284722583175280),(.m1,197595433650880054,2992641952387694704),(.m1,3593872502641655350,49611653495113384048),(.m1,64419489069907574326,821456572032378470512),(.m1,1141392289560778505782,13586027010287084765296),(.m1,20033164064048573054518,224459981888897824063600),(.m1,348864823921995040161334,3704696505811236670144624),(.m1,6035184365107406583103032,4420135027965987920019466)], + .ms [(.m1,.s3,3626777458843887524118472),(.m10,.s7,3626777458843887524118478),(.m8,.s2,3626777458843887524118473)], + .m .m9, + .b 0 [[([3060093480899530098475004],[(.D7,3626777458843887524118478),(.D17,4420135027965987920019466),(.D6,6035184365107406583103032),(.D16,3704696505811236670144624),(.D6,348864823921995040161334),(.D16,224459981888897824063600),(.D6,20033164064048573054518),(.D16,13586027010287084765296),(.D6,1141392289560778505782),(.D16,821456572032378470512),(.D6,64419489069907574326),(.D16,49611653495113384048),(.D6,3593872502641655350),(.D16,2992641952387694704),(.D6,197595433650880054),(.D16,180284722583175280),(.D6,10660864742915638),(.D16,10845582696382576),(.D6,560750930165302),(.D16,651460639457392),(.D6,28449863368246),(.D16,39067022524528),(.D6,1365799599670),(.D16,2338609692784),(.D6,59592670774),(.D16,139720654960),(.D6,2113928758),(.D16,8329887856),(.D6,31456822),(.D16,495452272),(.D6,2112822838),(.D16,608974960),(.D6,24054838),(.D16,36488176),(.D6,1109782),(.D16,2182312),(.D6,1225136519),(.D6,4561),(.D12,9305),(.D6,274),(.D16,4)])]], + .ms [(.m2,.s6,1530046740449765049237502),(.m3,.s6,3244265773731446261809102)], + .ms2 .s6 .s7 [(.m3,4324507106687877604442122,6011277384787879004208696),(.m0,3698719760731354775421040,347370637652024566480438),(.m0,224086435321405205643376,19939777422175418449462),(.m0,13562680349818796114032,1135555624443706342966),(.m0,819997405753110429808,64054697500090564150),(.m0,49520455602659131504,3571073029528092214),(.m0,2986942084109303920,196170466581282358),(.m0,179928480815775856,10571804301065782),(.m0,10823317585920112,555184652549686),(.m0,650069070053488,28101971017270),(.m0,38980049436784,1344056327734),(.m0,2333173874800,58233716278),(.m0,139380916336,2028994102),(.m0,8308654192,26148406),(.m0,494125168,2112491062),(.m0,608892016,24034102),(.m0,36482992,1108486),(.m0,2181988,1225136438)], + .ms [(.m12,.s7,4539),(.m0,.s6,9301),(.m3,.s6,272),(.m20,.s0,272),(.m1,.s3,9301),(.m4,.s3,4539)], + .ms2 .s3 .s0 [(.m13,1225136438,2181988),(.m1,1108486,36482992),(.m1,24034102,608892016),(.m1,2112491062,494125168),(.m1,26148406,8308654192),(.m1,2028994102,139380916336),(.m1,58233716278,2333173874800),(.m1,1344056327734,38980049436784),(.m1,28101971017270,650069070053488),(.m1,555184652549686,10823317585920112),(.m1,10571804301065782,179928480815775856),(.m1,196170466581282358,2986942084109303920),(.m1,3571073029528092214,49520455602659131504),(.m1,64054697500090564150,819997405753110429808),(.m1,1135555624443706342966,13562680349818796114032),(.m1,19939777422175418449462,224086435321405205643376),(.m1,347370637652024566480438,3698719760731354775421040),(.m1,6011277384787879004208696,4324507106687877604442122)], + .ms [(.m1,.s3,3244265773731446261809102),(.m4,.s3,1530046740449765049237496),(.m10,.s7,1530046740449765049237502),(.m8,.s2,1530046740449765049237497)], + .m .m9, + .b 0 [[([6120186961799060196950006,3060093480899530098475005,1530046740449765049237504,765023370224882524618752,382511685112441262309376,191255842556220631154688,95627921278110315577344,47813960639055157788672,23906980319527578894336,11953490159763789447168,5976745079881894723584,2988372539940947361792,1494186269970473680896,747093134985236840448,373546567492618420224,186773283746309210112,93386641873154605056,46693320936577302528,23346660468288651264,11673330234144325632,5836665117072162816,2918332558536081408,1459166279268040704,729583139634020352,364791569817010176,182395784908505088,91197892454252544,45598946227126272,22799473113563136,11399736556781568,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,1530046740449765049237502), + (.D17,3244265773731446261809102)]), + ([765023370224882524618750],[(.D16,4324507106687877604442122), + (.D6,6011277384787879004208696), + (.D16,3698719760731354775421040), + (.D6,347370637652024566480438), + (.D16,224086435321405205643376), + (.D6,19939777422175418449462), + (.D16,13562680349818796114032), + (.D6,1135555624443706342966), + (.D16,819997405753110429808), + (.D6,64054697500090564150), + (.D16,49520455602659131504), + (.D6,3571073029528092214), + (.D16,2986942084109303920), + (.D6,196170466581282358), + (.D16,179928480815775856), + (.D6,10571804301065782), + (.D16,10823317585920112), + (.D6,555184652549686), + (.D16,650069070053488), + (.D6,28101971017270), + (.D16,38980049436784), + (.D6,1344056327734), + (.D16,2333173874800), + (.D6,58233716278), + (.D16,139380916336), + (.D6,2028994102), + (.D16,8308654192), + (.D6,26148406), + (.D16,494125168), + (.D6,2112491062), + (.D16,608892016), + (.D6,24034102), + (.D16,36482992), + (.D6,1108486), + (.D16,2181988), + (.D6,1225136438), + (.D12,4539), + (.D16,9301), + (.D16,272), + (.D6,5)])]], + .ms [(.m2,.s6,6120186961799060196950005),(.m14,.s5,6120186961799060196949999)], + .m .m5, + .b 6120186961799060196950005 [[([5],[(.D18,1),(.D15,2861754088619004999499725),(.D14,4228879185409767288864778)])]], + .ms [(.m2,.s6,6120186961799060196950008),(.m7,.s5,6120186961799060196950002)], + .m .m5, + .b 6120186961799060196950008 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,6120186961799060196950009),(.m15,.s5,6120186961799060196950003)], + .m .m5, + .b 6120186961799060196950009 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,6120186961799060196950010),(.m25,.s2,6120186961799060196950005)], + .m .m18, + .b 6120186961799060196950010 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,6120186961799060196950012),(.m14,.s5,6120186961799060196950006)], + .m .m5, + .b 6120186961799060196950012 [[([5],[(.D18,1),(.D17,2861754088619004999499724),(.D15,4228879185409767288864778),(.D17,5987370404468351425314360),(.D15,3692743015651472880697456),(.D17,345876451382054092799542),(.D15,223712888753912587223152),(.D17,19846390780302263844406),(.D15,13539333689350507462768),(.D17,1129718959326634180150),(.D15,818538239473842389104),(.D17,63689905930273553974),(.D15,49429257710204878960),(.D17,3548273556414529078),(.D15,2981242215830913136),(.D17,194745499511684662),(.D15,179572239048376432),(.D17,10482743859215926),(.D15,10801052475457648),(.D17,549618374934070),(.D15,648677500649584),(.D17,27754078666294),(.D15,38893076349040),(.D17,1322313055798),(.D15,2327738056816),(.D17,56874761782),(.D15,139041177712),(.D17,1944059446),(.D15,8287420528),(.D17,20839990),(.D15,492798064),(.D17,2112159286),(.D15,608809072),(.D17,24013366),(.D15,36477808),(.D17,1107190),(.D15,2181664),(.D17,1225136357),(.D17,4520),(.D8,9295)])]], + .ms [(.m2,.s6,6120186961799060196950015),(.m7,.s5,6120186961799060196950009)], + .m .m5, + .b 6120186961799060196950015 [[([4193461436788244949762045],[(.D8,2861754088619004999499724),(.D16,4228879185409767288864778),(.D6,5987370404468351425314360),(.D16,3692743015651472880697456),(.D6,345876451382054092799542),(.D16,223712888753912587223152),(.D6,19846390780302263844406),(.D16,13539333689350507462768),(.D6,1129718959326634180150),(.D16,818538239473842389104),(.D6,63689905930273553974),(.D16,49429257710204878960),(.D6,3548273556414529078),(.D16,2981242215830913136),(.D6,194745499511684662),(.D16,179572239048376432),(.D6,10482743859215926),(.D16,10801052475457648),(.D6,549618374934070),(.D16,648677500649584),(.D6,27754078666294),(.D16,38893076349040),(.D6,1322313055798),(.D16,2327738056816),(.D6,56874761782),(.D16,139041177712),(.D6,1944059446),(.D16,8287420528),(.D6,20839990),(.D16,492798064),(.D6,2112159286),(.D16,608809072),(.D6,24013366),(.D16,36477808),(.D6,1107190),(.D16,2181664),(.D6,1225136357),(.D6,4521),(.D9,9295),(.D14,270),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,8216917680193182671831038,2337571409020474380779470),(.m0,4097833515510134634184714,5954608986993443261644344),(.m0,3684552661282745839779952,343828862789872332570166),(.m0,223200991605867147165808,19718416493290903830070),(.m0,13507340117597667459184,1121720566388424179254),(.m0,816538641239289888880,63190006371635428918),(.m0,49304282820545347696,3517029833999646262),(.m0,2973431285227192432,192792766860754486),(.m0,179084055885643888,10360698068532790),(.m0,10770541027786864,541990513016374),(.m0,646770535170160,27277337296438),(.m0,38773891006576,1292516720182),(.m0,2320288972912,55012490806),(.m0,138575609968,1827667510),(.m0,8258322544,13565494),(.m0,490979440,2111704630),(.m0,608695408,23984950),(.m0,36470704,1105414),(.m0,2181220,1225136246)], + .ms [(.m12,.s7,4491),(.m0,.s6,9289),(.m3,.s6,269),(.m21,.s3,269),(.m4,.s3,9289),(.m4,.s3,4491)], + .ms2 .s3 .s0 [(.m13,1225136246,2181220),(.m1,1105414,36470704),(.m1,23984950,608695408),(.m1,2111704630,490979440),(.m1,13565494,8258322544),(.m1,1827667510,138575609968),(.m1,55012490806,2320288972912),(.m1,1292516720182,38773891006576),(.m1,27277337296438,646770535170160),(.m1,541990513016374,10770541027786864),(.m1,10360698068532790,179084055885643888),(.m1,192792766860754486,2973431285227192432),(.m1,3517029833999646262,49304282820545347696),(.m1,63190006371635428918,816538641239289888880),(.m1,1121720566388424179254,13507340117597667459184),(.m1,19718416493290903830070,223200991605867147165808),(.m1,343828862789872332570166,3684552661282745839779952),(.m1,5954608986993443261644344,4097833515510134634184714),(.m1,2337571409020474380779470,8216917680193182671831033)], + .ms [(.m26,.s7,8216917680193182671831038),(.m8,.s2,8216917680193182671831033)], + .m .m9, + .b 0 [[([16773845747152979799048188],[(.D7,8216917680193182671831038), + (.D7,2337571409020474380779469), + (.D16,4097833515510134634184714), + (.D6,5954608986993443261644344), + (.D16,3684552661282745839779952), + (.D6,343828862789872332570166), + (.D16,223200991605867147165808), + (.D6,19718416493290903830070), + (.D16,13507340117597667459184), + (.D6,1121720566388424179254), + (.D16,816538641239289888880), + (.D6,63190006371635428918), + (.D16,49304282820545347696), + (.D6,3517029833999646262), + (.D16,2973431285227192432), + (.D6,192792766860754486), + (.D16,179084055885643888), + (.D6,10360698068532790), + (.D16,10770541027786864), + (.D6,541990513016374), + (.D16,646770535170160), + (.D6,27277337296438), + (.D16,38773891006576), + (.D6,1292516720182), + (.D16,2320288972912), + (.D6,55012490806), + (.D16,138575609968), + (.D6,1827667510), + (.D16,8258322544)]), + ([54261973,3933994],[(.D6,13565494), + (.D16,490979440)]), + ([3637247],[(.D6,2111704630), + (.D16,608695408), + (.D6,23984950), + (.D16,36470704), + (.D6,1105414), + (.D16,2181220), + (.D6,1225136246), + (.D12,4491), + (.D16,9289), + (.D16,269), + (.D12,3)])]], + .ms [(.m2,.s6,8386922873576489899524094)], + .ms2 .s6 .s7 [(.m3,6120186961799060196950014,1813388729421943762059214),(.m0,3966787845610501979504650,5921847569518535097974328),(.m0,3676362306914018798862448,341781274197690572340790),(.m0,222689094457821707108464,19590442206279543815734),(.m0,13475346545844827455600,1113722173450214178358),(.m0,814539043004737388656,62690106812997303862),(.m0,49179307930885816432,3485786111584763446),(.m0,2965620354623471728,190840034209824310),(.m0,178595872722911344,10238652277849654),(.m0,10740029580116080,534362651098678),(.m0,644863569690736,26800595926582),(.m0,38654705664112,1262720384566),(.m0,2312839889008,53150219830),(.m0,138110042224,1711275574),(.m0,8229224560,6290998),(.m0,489160816,2111249974),(.m0,608581744,23956534),(.m0,36463600,1103638),(.m0,2180776,1225136135)], + .ms [(.m3,.s6,4465)], + .ms2 .s6 .s7 [(.m6,9281,268)], + .ms2 .s3 .s0 [(.m19,268,9281)], + .ms [(.m17,.s0,4465)], + .ms2 .s3 .s0 [(.m4,1225136135,2180776),(.m1,1103638,36463600),(.m1,23956534,608581744),(.m1,2111249974,489160816),(.m1,6290998,8229224560),(.m1,1711275574,138110042224),(.m1,53150219830,2312839889008),(.m1,1262720384566,38654705664112),(.m1,26800595926582,644863569690736),(.m1,534362651098678,10740029580116080),(.m1,10238652277849654,178595872722911344),(.m1,190840034209824310,2965620354623471728),(.m1,3485786111584763446,49179307930885816432),(.m1,62690106812997303862,814539043004737388656),(.m1,1113722173450214178358,13475346545844827455600),(.m1,19590442206279543815734,222689094457821707108464),(.m1,341781274197690572340790,3676362306914018798862448),(.m1,5921847569518535097974328,3966787845610501979504650),(.m1,1813388729421943762059214,6120186961799060196950014)], + .ms [(.m1,.s3,8386922873576489899524088),(.m10,.s7,8386922873576489899524094),(.m8,.s2,8386922873576489899524089)], + .m .m9, + .b 0 [[([29012105328003801696278932,14506056641581091741761536,5443333724807588137559656],[(.D7,8386922873576489899524094), + (.D17,6120186961799060196950014)]), + ([3060093480899530098475007],[(.D6,1813388729421943762059214), + (.D16,3966787845610501979504650), + (.D6,5921847569518535097974328), + (.D16,3676362306914018798862448), + (.D6,341781274197690572340790), + (.D16,222689094457821707108464), + (.D6,19590442206279543815734), + (.D16,13475346545844827455600), + (.D6,1113722173450214178358), + (.D16,814539043004737388656), + (.D6,62690106812997303862), + (.D16,49179307930885816432), + (.D6,3485786111584763446), + (.D16,2965620354623471728), + (.D6,190840034209824310), + (.D16,178595872722911344), + (.D6,10238652277849654), + (.D16,10740029580116080), + (.D6,534362651098678), + (.D16,644863569690736), + (.D6,26800595926582), + (.D16,38654705664112), + (.D6,1262720384566), + (.D16,2312839889008), + (.D6,53150219830), + (.D16,138110042224), + (.D6,1711275574), + (.D16,8229224560)]), + ([25163989,12581999,4721339],[(.D6,6290998), + (.D16,489160816)]), + ([2654207],[(.D6,2111249974), + (.D16,608581744), + (.D6,23956534), + (.D16,36463600), + (.D6,1103638), + (.D16,2180776), + (.D6,1225136135), + (.D6,4465), + (.D12,9281), + (.D6,268), + (.D16,4)])]], + .ms [(.m2,.s6,24480747847196240787800062),(.m3,.s6,2266735911777429702574078)], + .ms2 .s6 .s7 [(.m3,4590140221349295147712510,1430877044309502499749838),(.m0,3871159924332391663927306,5897940589199007519079992),(.m0,3670385561834136904138864,340287087927720098659894),(.m0,222315547890329088688240,19497055564406389210678),(.m0,13451999885376538804336,1107885508333142015542),(.m0,813079876725469347952,62325315243180293686),(.m0,49088110038431563888,3462986638471200310),(.m0,2959920486345080944,189415067140226614),(.m0,178239630955511920,10149591835999798),(.m0,10717764469653616,528796373483062),(.m0,643472000286832,26452703575606),(.m0,38567732576368,1240977112630),(.m0,2307404071024,51791265334),(.m0,137770303600,1626340918),(.m0,8207990896,982582),(.m0,487833712,2110918198),(.m0,608498800,23935798),(.m0,36458416,1102342),(.m0,2180452,1225136054)], + .ms [(.m12,.s7,4443),(.m0,.s6,9277),(.m3,.s6,266),(.m20,.s0,266),(.m1,.s3,9277),(.m4,.s3,4443)], + .ms2 .s3 .s0 [(.m13,1225136054,2180452),(.m1,1102342,36458416),(.m1,23935798,608498800),(.m1,2110918198,487833712),(.m1,982582,8207990896),(.m1,1626340918,137770303600),(.m1,51791265334,2307404071024),(.m1,1240977112630,38567732576368),(.m1,26452703575606,643472000286832),(.m1,528796373483062,10717764469653616),(.m1,10149591835999798,178239630955511920),(.m1,189415067140226614,2959920486345080944),(.m1,3462986638471200310,49088110038431563888),(.m1,62325315243180293686,813079876725469347952),(.m1,1107885508333142015542,13451999885376538804336),(.m1,19497055564406389210678,222315547890329088688240),(.m1,340287087927720098659894,3670385561834136904138864),(.m1,5897940589199007519079992,3871159924332391663927306),(.m1,1430877044309502499749838,4590140221349295147712510)], + .ms [(.m1,.s3,2266735911777429702574078),(.m4,.s3,24480747847196240787800056),(.m10,.s7,24480747847196240787800062),(.m8,.s2,24480747847196240787800057)], + .m .m9, + .b 0 [[([36250843244390820929234524],[(.D7,24480747847196240787800062), + (.D17,2266735911777429702574078), + (.D16,4590140221349295147712510), + (.D6,1430877044309502499749838), + (.D16,3871159924332391663927306), + (.D6,5897940589199007519079992), + (.D16,3670385561834136904138864), + (.D6,340287087927720098659894), + (.D16,222315547890329088688240), + (.D6,19497055564406389210678), + (.D16,13451999885376538804336), + (.D6,1107885508333142015542), + (.D16,813079876725469347952), + (.D6,62325315243180293686), + (.D16,49088110038431563888), + (.D6,3462986638471200310), + (.D16,2959920486345080944), + (.D6,189415067140226614), + (.D16,178239630955511920), + (.D6,10149591835999798), + (.D16,10717764469653616), + (.D6,528796373483062), + (.D16,643472000286832), + (.D6,26452703575606), + (.D16,38567732576368), + (.D6,1240977112630), + (.D16,2307404071024), + (.D6,51791265334), + (.D16,137770303600), + (.D6,1626340918), + (.D16,8207990896)]), + ([3930325,1965167,982584,491292,245641,122820,61415,30708,15349,7679,3840,1920,960,480,240,120,60,25,12,11],[(.D6,982582), + (.D16,487833712)]), + ([491290],[(.D6,2110918198), + (.D16,608498800), + (.D6,23935798), + (.D16,36458416), + (.D6,1102342), + (.D16,2180452), + (.D6,1225136054), + (.D12,4443), + (.D16,9277), + (.D16,266)])], + [([36284705932486929553135960],[(.D11,19949392441647388171645745)]), + ([4535588241560866194141994,2267794120780433097071001,1133897060390216548535499,566948530195108274267748,283474265097554137133877,141737132548777068566940,70868566274388534283467,35434283137194267141732,17717141568597133570869,8858570784298566785436,4429285392149283392715,2214642696074641696356,1107321348037320848181,553660674018660424092,276830337009330212043,138415168504665106020,69207584252332553013,34603792126166276508,17301896063083138251,8650948031541569124,4325474015770784565,2162737007885392284,1081368503942696139,540684251971348068,270342125985674037,135171062992837020,67585531496418507,33792765748209252,16896382874104629,8448191437052316,4224095718526155,2112047859263076,1056023929631541,528011964815772,264005982407883,132002991203940,66001495601973,33000747800988,16500373900491,8250186950244,4125093475125,2062546737564,1031273368779,515636684388,257818342197,128909171100,64454585547,32227292772,16113646389,8056823196,4028411595,2014205796,1007102901,503551452,251775723,125887860,62943933,31471968,15735984,7867992,3933996,1966995,983496,491748,245877,122940,61467,30732,15369,7683,3840,1920,960,480,240,120,60,33,15,9,3],[(.D11,1133897060390216548535498), + (.D17,4306930508502491859202866)]), + ([566948530195108274267749],[(.D15,1360074616097801677622426), + (.D17,3853459317279466458395454), + (.D15,5893515437435776217697028), + (.D17,3669279273893329078793124), + (.D15,340010515942518142323458), + (.D17,222246404894028599604132), + (.D15,19479769815331266939650), + (.D17,13447678448107758236580), + (.D15,1106805149015946873602), + (.D17,812809786896170562468), + (.D15,62257792785855597314), + (.D17,49071229424100389796), + (.D15,3458766484888406786), + (.D17,2958865447949382564), + (.D15,189151307541302018), + (.D17,178173691055780772), + (.D15,10133106861067010), + (.D17,10713643225920420), + (.D15,527766062549762), + (.D17,643214422553508), + (.D15,26388309142274), + (.D17,38551633968036), + (.D15,1236952460546), + (.D17,2306397908004), + (.D15,51539724578), + (.D17,137707418412), + (.D15,1610619620), + (.D17,8204060572), + (.D2,487588065)])]], + .ms [(.m2,.s6,36267774588438875241185242),(.m3,.s6,15413804200086521977503751),(.m14,.s5,15413804200086521977503751),(.m4,.s5,36267774588438875241185236)], + .m .m5, + .b 36267774588438875241185242 [[([23],[(.D16,15413804200086521977503751),(.D18,1),(.D15,4023456243404937722068989),(.D16,1289206049823413143338958)])]], + .ms [(.m2,.s6,36267774588438875241185254),(.m3,.s6,15413804200086521977503748),(.m7,.s5,15413804200086521977503748),(.m4,.s5,36267774588438875241185248)], + .m .m5, + .b 36267774588438875241185254 [[([7],[(.D16,15413804200086521977503748),(.D6,1)])]], + .ms [(.m2,.s6,36267774588438875241185258),(.m6,.s6,15413804200086521977503746),(.m15,.s5,15413804200086521977503746),(.m11,.s5,36267774588438875241185252)], + .m .m5, + .b 36267774588438875241185258 [[([5],[(.D12,15413804200086521977503746),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,36267774588438875241185261,15413804200086521977503747)], + .ms [(.m23,.s1,15413804200086521977503747),(.m22,.s4,36267774588438875241185255)], + .m .m24, + .b 36267774588438875241185261 [[([17],[(.D6,15413804200086521977503747),(.D6,2)])]], + .ms [(.m2,.s6,36267774588438875241185270),(.m6,.s6,15413804200086521977503743),(.m14,.s5,15413804200086521977503743),(.m11,.s5,36267774588438875241185264)], + .m .m5, + .b 36267774588438875241185270 [[([23],[(.D12,15413804200086521977503743),(.D18,1),(.D17,4023456243404937722068988),(.D17,1289206049823413143338958),(.D15,3835742175710869324824586),(.D17,5889086152043626934304312),(.D15,3668171952545291757944944),(.D17,339733685605508812111414),(.D15,222177197309776267051120),(.D17,19462467919268183801398),(.D15,13443352974091987452016),(.D17,1105723780512004177462),(.D15,812539444770184888432),(.D17,62190207254359178806),(.D15,49054333041226285168),(.D17,3454542389169880630),(.D15,2957809424019751024),(.D17,188887301558894134),(.D15,178107689560178800),(.D17,10116606487166518),(.D15,10709518132445296),(.D17,526734789180982),(.D15,642956604211312),(.D17,26323854556726),(.D15,38535520321648),(.D17,1232924048950),(.D15,2305390805104),(.D17,51287948854),(.D15,137644474480),(.D17,1594883638),(.D15,8200126576),(.D1,486276734)])]], + .ms [(.m2,.s6,36267774588438875241185282),(.m6,.s6,15413804200086521977503740),(.m7,.s5,15413804200086521977503740),(.m11,.s5,36267774588438875241185276)], + .m .m5, + .b 36267774588438875241185282 [[([61655216800346087910014961,30827608400173043955007485,15413804200086521977503744,7706902100043260988751872,3853451050021630494375936,1926725525010815247187968,963362762505407623593984,481681381252703811796992,240840690626351905898496,120420345313175952949248,60210172656587976474624,30105086328293988237312,15052543164146994118656,7526271582073497059328,3763135791036748529664,1881567895518374264832,940783947759187132416,470391973879593566208,235195986939796783104,117597993469898391552,58798996734949195776,29399498367474597888,14699749183737298944,7349874591868649472,3674937295934324736,1837468647967162368,918734323983581184,459367161991790592,229683580995895296,114841790497947648,57420895248973824,28710447624486912,14355223812243456,7177611906121728,3588805953060864,1794402976530432,897201488265216,448600744132608,224300372066304,112150186033152,56075093016576,28037546508288,14018773254144,7009386627072,3504693313536,1752346656768,876173328384,438086664192,219043332096,109521666048,54760833024,27380416512,13690208256,6845104128,3422552064,1711276032,855638016,427819008,213909504,106954752,53477376,26738688,13369344,6684672,3342336,1671168,835584,417792,208896,104448,52224,26112,13056,6528,3264,1632,816,408,204,99,48,24,12,9,3],[(.D12,15413804200086521977503740), + (.D8,4023456243404937722068988), + (.D6,1289206049823413143338958), + (.D16,3835742175710869324824586)]), + ([481681381252703811796991],[(.D6,5889086152043626934304312), + (.D16,3668171952545291757944944), + (.D6,339733685605508812111414), + (.D16,222177197309776267051120), + (.D6,19462467919268183801398), + (.D16,13443352974091987452016), + (.D6,1105723780512004177462), + (.D16,812539444770184888432), + (.D6,62190207254359178806), + (.D16,49054333041226285168), + (.D6,3454542389169880630), + (.D16,2957809424019751024), + (.D6,188887301558894134), + (.D16,178107689560178800), + (.D6,10116606487166518), + (.D16,10709518132445296), + (.D6,526734789180982), + (.D16,642956604211312), + (.D6,26323854556726), + (.D16,38535520321648), + (.D6,1232924048950), + (.D16,2305390805104), + (.D6,51287948854), + (.D16,137644474480), + (.D6,1594883638), + (.D16,8200126576), + (.D2,486276733)])], + [([2],[(.D21,0), + (.D19,170005193383307227693053)])]], + .ms [(.m2,.s6,97922991388784963151200246),(.m7,.s5,97922991388784963151200240)], + .m .m5, + .b 97922991388784963151200246 [[([10],[(.D8,1),(.D7,170005193383307227693052)])],[([1020031160299843366158305],[(.D2,170005193383307227693050)])]], + .ms [(.m2,.s6,98433006968934884834279404),(.m27,.s2,98433006968934884834279399)], + .m .m18, + .b 98433006968934884834279404 [[([1],[(.D6,1)])], + [([4],[(.D13,0), + (.D6,1)])], + [([2],[(.D17,1), + (.D15,0), + (.D6,325843287318005519744974)])], + [([4],[(.D3,0)])], + [([2],[(.D17,1), + (.D21,325843287318005519744973), + (.D15,3594901485084517418926090), + (.D17,5828875979387038957829688), + (.D15,3653119409381144763826288), + (.D17,335970549814472063581750), + (.D15,221236413362017079918704), + (.D17,19227271932328387018294), + (.D15,13384553977357038256240), + (.D17,1091024031328266878518), + (.D15,808864507474250563696), + (.D17,61271472930375597622), + (.D15,48824649460230389872), + (.D17,3397121493920906806), + (.D15,2943454200207507568), + (.D17,185298495605833270), + (.D15,177210488071913584), + (.D17,9892306115100214), + (.D15,10653443039428720), + (.D17,512716015926838), + (.D15,639451910897776), + (.D17,25447681228342), + (.D15,38316476989552), + (.D17,1178163215926), + (.D15,2291700596848), + (.D17,47865396790), + (.D15,136788836464), + (.D17,1380974134), + (.D15,8146649200), + (.D1,468450942)])], + [([5],[(.D13,0), + (.D16,325843287318005519744973), + (.D16,3594901485084517418926090)])], + [([1303373149272022078979899,651686574636011039489951,325843287318005519744976,162921643659002759872488,81460821829501379936244,40730410914750689968119,20365205457375344984061,10182602728687672492032,5091301364343836246016,2545650682171918123008,1272825341085959061504,636412670542979530752,318206335271489765376,159103167635744882688,79551583817872441344,39775791908936220672,19887895954468110336,9943947977234055168,4971973988617027584,2485986994308513792,1242993497154256896,621496748577128448,310748374288564224,155374187144282112,77687093572141056,38843546786070528,19421773393035264,9710886696517632,4855443348258816,2427721674129408,1213860837064704,606930418532352,303465209266176,151732604633088,75866302316544,37933151158272,18966575579136,9483287789568,4741643894784,2370821947392,1185410973696,592705486848,296352743424,148176371712,74088185856,37044092928,18522046464,9261023232,4630511616,2315255808,1157627904,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,325843287318005519744974), + (.D17,3594901485084517418926090)]), + ([162921643659002759872487],[(.D6,5828875979387038957829688), + (.D16,3653119409381144763826288), + (.D6,335970549814472063581750), + (.D16,221236413362017079918704), + (.D6,19227271932328387018294), + (.D16,13384553977357038256240), + (.D6,1091024031328266878518), + (.D16,808864507474250563696), + (.D6,61271472930375597622), + (.D16,48824649460230389872), + (.D6,3397121493920906806), + (.D16,2943454200207507568), + (.D6,185298495605833270), + (.D16,177210488071913584), + (.D6,9892306115100214), + (.D16,10653443039428720), + (.D6,512716015926838), + (.D16,639451910897776), + (.D6,25447681228342), + (.D16,38316476989552), + (.D6,1178163215926), + (.D16,2291700596848), + (.D6,47865396790), + (.D16,136788836464), + (.D6,1380974134), + (.D16,8146649200), + (.D2,468450941)])], + [([2],[(.D21,0), + (.D19,3513440663255016038989846)])]], + .ms [(.m2,.s6,99736380118206906913259311),(.m7,.s5,99736380118206906913259305)], + .m .m5, + .b 99736380118206906913259311 [[([10],[(.D8,1),(.D7,3513440663255016038989845)])],[([21080643979530096233939063],[(.D2,3513440663255016038989843)])]], + .ms [(.m2,.s6,110276702107971955030228848),(.m34,.s2,110276702107971955030228843)], + .m .m18, + .b 110276702107971955030228848 [[([1],[(.D6,1)])],[([5],[(.D13,0),(.D10,5808510773929663612845626),(.D9,3648028108016800927580272)])],[([7,2],[(.D12,1),(.D6,5808510773929663612845626)])]], + .ms [(.m2,.s6,110276702107971955030228856),(.m15,.s5,110276702107971955030228850)], + .m .m5, + .b 110276702107971955030228856 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,110276702107971955030228857),(.m25,.s2,110276702107971955030228852)], + .m .m18, + .b 110276702107971955030228857 [[([3],[(.D6,2)])],[([2],[(.D21,0),(.D7,5808510773929663612845624)])]], + .ms [(.m2,.s6,110276702107971955030228860),(.m7,.s5,110276702107971955030228854)], + .m .m5, + .b 110276702107971955030228860 [[([10],[(.D8,1),(.D17,5808510773929663612845623),(.D10,3648028108016800927580271)])],[([7,2],[(.D12,1),(.D17,5808510773929663612845622)]),([1],[(.D11,3648028108016800927580271),(.D16,334697724473386104520246)])],[([2],[(.D21,0),(.D17,5808510773929663612845621),(.D12,3648028108016800927580272)])]], + .ms [(.m2,.s6,110276702107971955030228871),(.m7,.s5,110276702107971955030228865)], + .m .m5, + .b 110276702107971955030228871 [[([2946755651903429117843875],[(.D8,5808510773929663612845622), + (.D13,3648028108016800927580272), + (.D17,334697724473386104520246), + (.D15,220918207026745590153328), + (.D17,19147720348510514576950), + (.D15,13364666081402570145904), + (.D17,1086052057339649850934), + (.D15,807621513977096306800), + (.D17,60960724556087033398), + (.D15,48746962366658248816), + (.D17,3377699720527871542), + (.D15,2938598756859248752), + (.D17,184084634768768566), + (.D15,176907022862647408), + (.D17,9816439812783670), + (.D15,10634476463849584), + (.D17,507974372032054), + (.D15,638266499924080), + (.D17,25151328484918), + (.D15,38242388803696), + (.D17,1159641169462), + (.D15,2287070085232), + (.D17,46707768886), + (.D15,136499429488)]), + ([5234489558,2617244783,1308622392,654311196,327155593,163577796,81788903,40894452,20447221,10223615,5111808,2555904,1277952,638976,319488,159744,79872,39936,19968,9984,4992,2496,1248,624,312,156,73,36,23,12],[(.D17,1308622390), + (.D15,8128561264)]), + ([654311195],[(.D1,462421630)])], + [([3626778427663165176152064],[(.D15,5440166317441734973115138), + (.D17,3555941993894818767647652), + (.D15,311676195942890564537090), + (.D17,215162824894121705157540), + (.D15,17708874815354543328002), + (.D17,13004954698113577333668), + (.D15,996124211517401647874), + (.D17,785139552521534256036), + (.D15,55340234192196520706), + (.D17,47341839775685620644), + (.D15,3026419072784714498), + (.D17,2850778594923459492), + (.D15,162129594284821250), + (.D17,171418262741660580), + (.D15,8444249782536962), + (.D17,10291428956287908), + (.D15,422212495141634), + (.D17,616826030701476), + (.D15,19791211179266), + (.D17,36902359477284)]), + ([3298534978056,786408],[(.D15,824633837858), + (.D17,2203318252332)]), + ([103079242638,51539621325,25769810664,12884905332,6442452661,3221226335,1610613168,805306584,402653292,201326641,100663320,50331660,25165835,12582913,6291456,3145728,1572864,786432,393216,196608,98304,49152,24576,12288,6144,3072,1536,768,384,192,96,48,24,12,11],[(.D15,25769810660), + (.D17,131264939932)]), + ([12884905330],[(.D2,7801405665)])], + [([3626777519395092377370624],[(.D15,4986819013983839326096130), + (.D17,3442605168030344855892900), + (.D15,283341989476772086598402), + (.D17,208079273277592085672868), + (.D15,15937986911222138456834), + (.D17,12562232722080476115876), + (.D15,885443717509126343426), + (.D17,757469429019465429924), + (.D15,48422703316679314178), + (.D17,45612457056806319012), + (.D15,2594073393064889090), + (.D17,2742692174993503140), + (.D15,135107989302332162), + (.D17,164662861496038308), + (.D15,6755399471131394), + (.D17,9869216378436516), + (.D15,316659350678786), + (.D17,590437744585764)]), + ([52776558227976,786408],[(.D15,13194139650338), + (.D17,35253091595052)]), + ([1649267469198,824633734605,412316867304,206158433652,103079216821,51539608415,25769804208,12884902104,6442451052,3221225521,1610612760,805306380,402653195,201326593,100663296,50331648,25165824,12582912,6291456,3145728,1572864,786432,393216,196608,98304,49152,24576,12288,6144,3072,1536,768,384,192,96,48,24,12,11],[(.D15,412316867300), + (.D17,2100239009692)]), + ([206158433650],[(.D2,124822487265)])], + [([3626777462628337827446784],[(.D15,4533471824059452778924802), + (.D17,3329268370549248219100068), + (.D15,255007790106497927400194), + (.D17,200995723435023545873316), + (.D15,14167099450580003506946), + (.D17,12119510856919942378404), + (.D15,774763251218992909058), + (.D17,729799312446932071332), + (.D15,41505174173545974530), + (.D17,43883074771022984100), + (.D15,2161727821619055362), + (.D17,2634605782132044708), + (.D15,108086391086967554), + (.D17,157907461942197156), + (.D15,5066549582671106), + (.D17,9447003906321444)]), + ([844424930226696,786408],[(.D15,211106232650018), + (.D17,564049465078572)]), + ([26388279094158,13194139547085,6597069773544,3298534886772,1649267443381,824633721695,412316860848,206158430424,103079215212,51539607601,25769803800,12884901900,6442450955,3221225473,1610612736,805306368,402653184,201326592,100663296,50331648,25165824,12582912,6291456,3145728,1572864,786432,393216,196608,98304,49152,24576,12288,6144,3072,1536,768,384,192,96,48,24,12,11],[(.D15,6597069773540), + (.D17,33603824125852)]), + ([3298534886770],[(.D2,1997159792865)])], + [([3626777459080415668076544],[(.D15,4080124641230910550493954), + (.D17,3215931574842112661992356), + (.D15,226673591179714038123266), + (.D17,193912173703327573554084), + (.D15,12396212017656010427138), + (.D17,11676788998688944108452), + (.D15,664082786661243341570), + (.D17,702129196307494679460), + (.D15,34587645138686626562), + (.D17,42153692512308147108), + (.D15,1729382256940346114), + (.D17,2526519390962367396), + (.D15,81064793294548226), + (.D17,151152062494092324)]), + ([13510798882206216,786408],[(.D15,3377699720644898), + (.D17,9024791440814892)]), + ([422212465093518,211106232546765,105553116273384,52776558136692,26388279068341,13194139534175,6597069767088,3298534883544,1649267441772,824633720881,412316860440,206158430220,103079215115,51539607553,25769803776,12884901888,6442450944,3221225472,1610612736,805306368,402653184,201326592,100663296,50331648,25165824,12582912,6291456,3145728,1572864,786432,393216,196608,98304,49152,24576,12288,6144,3072,1536,768,384,192,96,48,24,12,11],[(.D15,105553116273380), + (.D17,537661185984412)]), + ([52776558136690],[(.D2,31954556682465)])], + [([3626763623800615653605376],[(.D15,3626777458845858591984386), + (.D17,3102594779245849672364964), + (.D15,198339392280648290716418), + (.D17,186828623978561136702372), + (.D15,10625324586464401214210), + (.D17,11234067140891041805220), + (.D15,553402322211767765762), + (.D17,674459080195125785508), + (.D15,27670116110594403074), + (.D17,40424310255285091236), + (.D15,1297036692684582146), + (.D17,2418432999898426404), + (.D15,54043195528562978), + (.D17,144396663052596012)]), + ([6755399441083278,3377699720541645,1688849860270824,844424930135412,422212465067701,211106232533855,105553116266928,52776558133464,26388279066732,13194139533361,6597069766680,3298534883340,1649267441675,824633720833,412316860416,206158430208,103079215104,51539607552],[(.D15,1688849860270820), + (.D17,8602578975721372)]), + ([844421708909938],[(.D2,511272906916065)])]], + ] (by decide +kernel) +theorem chunk_29_step : (cfg_29.denote) [qi]⊢* (cfg_30.denote) := + step_chunk [ + .b 120817017180207482940476505 [[([13835058054879510528],[(.D15,3173432005870781635283714), + (.D17,2989258416002080433189796), + (.D15,170005301469705980922626), + (.D17,179745101275825559253924), + (.D15,8854443910780506852098), + (.D17,10791346971970068214692), + (.D15,442722279981524368130), + (.D17,646789069637564936100), + (.D15,20752613471204190722), + (.D17,38694934595437538148), + (.D15,864692777722693874), + (.D17,2310347021157954336), + (.D15,27021700843444961), + (.D11,137641289381316506)]), + ([25769803776,12884901888,6442450944,3221225472,1610612736,805306368,402653184,201326592,100663296,50331648,25165824,12582912,6291456,3145728,1572864,786432,393216,196608,98304,49152,24576,12288,6144,3072,1536,768,384,192,96,48,24,12,11],[(.D7,6442450944), + (.D10,8180368121266401)]), + ([3221225472],[(.D0,370535955431076)])], + [([3626777458844811462180864],[(.D15,3173430276488524775344898), + (.D17,2989257983656516218205092), + (.D15,170005193383314927176450), + (.D17,179745074254227795817380), + (.D15,8854437155381065992962), + (.D17,10791345283120207999908), + (.D15,442721857769059314434), + (.D17,646788964084448672676), + (.D15,20752587082925124866), + (.D17,38694927998367771684)]), + ([3458764513820635656,786408],[(.D15,864691128455252258), + (.D17,2310346608841093932)]), + ([108086391056919438,54043195528459725,27021597764229864,13510798882114932,6755399441057461,3377699720528735,1688849860264368,844424930132184,422212465066092,211106232533041,105553116266520,52776558133260,26388279066635,13194139533313,6597069766656,3298534883328,1649267441664,824633720832,412316860416,206158430208,103079215104,51539607552,25769803776,12884901888,6442450944,3221225472,1610612736,805306368,402653184,201326592,100663296,50331648,25165824,12582912,6291456,3145728,1572864,786432,393216,196608,98304,49152,24576,12288,6144,3072,1536,768,384,192,96,48,24,12,11],[(.D15,27021597764229860), + (.D17,137641263611512732)]), + ([13510798882114930],[(.D2,8180366510653665)])], + [([3626777458843945270247424],[(.D15,2720083094132923342572290), + (.D17,2875921188067615860011940), + (.D15,141670994486089837628162), + (.D17,172661524529921523430308), + (.D15,7083549724304497896194), + (.D17,10348623425351065975716), + (.D15,332041393326773808386), + (.D17,619118847973877296164)]), + ([55340232221128749576,786408],[(.D15,13835058055282280738), + (.D17,36965545741457060652)]), + ([1729382256910297998,864691128455149005,432345564227574504,216172782113787252,108086391056893621,54043195528446815,27021597764223408,13510798882111704,6755399441055852,3377699720527921,1688849860263960,844424930131980,422212465065995,211106232532993,105553116266496,52776558133248,26388279066624,13194139533312,6597069766656,3298534883328,1649267441664,824633720832,412316860416,206158430208,103079215104,51539607552,25769803776,12884901888,6442450944,3221225472,1610612736,805306368,402653184,201326592,100663296,50331648,25165824,12582912,6291456,3145728,1572864,786432,393216,196608,98304,49152,24576,12288,6144,3072,1536,768,384,192,96,48,24,12,11],[(.D15,432345564227574500), + (.D17,2202260217784174492)]), + ([216172782113787250],[(.D2,130885864170455265)])], + [([3626777458843891133251584],[(.D15,2266735911777430183791362), + (.D17,2762584392478742570316708), + (.D15,113336795588871515204354), + (.D17,165577974805616942824356), + (.D15,5312662293228352744706), + (.D17,9905901567582029687844)]), + ([885443715538058572296,786408],[(.D15,221360928884514736418), + (.D17,591448731863312528172)]), + ([27670116110564354958,13835058055282177485,6917529027641088744,3458764513820544372,1729382256910272181,864691128455136095,432345564227568048,216172782113784024,108086391056892012,54043195528446001,27021597764223000,13510798882111500,6755399441055755,3377699720527873,1688849860263936,844424930131968,422212465065984,211106232532992,105553116266496,52776558133248,26388279066624,13194139533312,6597069766656,3298534883328,1649267441664,824633720832,412316860416,206158430208,103079215104,51539607552,25769803776,12884901888,6442450944,3221225472,1610612736,805306368,402653184,201326592,100663296,50331648,25165824,12582912,6291456,3145728,1572864,786432,393216,196608,98304,49152,24576,12288,6144,3072,1536,768,384,192,96,48,24,12,11],[(.D15,6917529027641088740), + (.D17,35236163484546762652)]), + ([3458764513820544370],[(.D2,2094173826727280865)])], + [([3626777458843887749689344],[(.D15,1813388729421943792134914), + (.D17,2649247596889870972402596), + (.D15,85002596691653615725826), + (.D17,158494425081312467954724)]), + ([14167099448608935735816,786408],[(.D15,3541774862152234027298), + (.D17,9463179709813000008492)]), + ([442721857769029266318,221360928884514633165,110680464442257316584,55340232221128658292,27670116110564329141,13835058055282164575,6917529027641082288,3458764513820541144,1729382256910270572,864691128455135281,432345564227567640,216172782113783820,108086391056891915,54043195528445953,27021597764222976,13510798882111488,6755399441055744,3377699720527872,1688849860263936,844424930131968,422212465065984,211106232532992,105553116266496,52776558133248,26388279066624,13194139533312,6597069766656,3298534883328,1649267441664,824633720832,412316860416,206158430208,103079215104,51539607552,25769803776,12884901888,6442450944,3221225472,1610612736,805306368,402653184,201326592,100663296,50331648,25165824,12582912,6291456,3145728,1572864,786432,393216,196608,98304,49152,24576,12288,6144,3072,1536,768,384,192,96,48,24,12,11],[(.D15,110680464442257316580), + (.D17,563778615752748173212)]), + ([55340232221128658290],[(.D2,33506781227636490465)])], + [([3626777458843887538216704],[(.D15,1360041547066457823423746), + (.D17,2535910801300999480224804)]), + ([226673591177742970352136,786408],[(.D15,56668397794435742681378), + (.D17,151410875357007999693612)]), + ([7083549724304467848078,3541774862152233924045,1770887431076116962024,885443715538058481012,442721857769029240501,221360928884514620255,110680464442257310128,55340232221128655064,27670116110564327532,13835058055282163761,6917529027641081880,3458764513820540940,1729382256910270475,864691128455135233,432345564227567616,216172782113783808,108086391056891904,54043195528445952,27021597764222976,13510798882111488,6755399441055744,3377699720527872,1688849860263936,844424930131968,422212465065984,211106232532992,105553116266496,52776558133248,26388279066624,13194139533312,6597069766656,3298534883328,1649267441664,824633720832,412316860416,206158430208,103079215104,51539607552,25769803776,12884901888,6442450944,3221225472,1610612736,805306368,402653184,201326592,100663296,50331648,25165824,12582912,6291456,3145728,1572864,786432,393216,196608,98304,49152,24576,12288,6144,3072,1536,768,384,192,96,48,24,12,11],[(.D15,1770887431076116962020), + (.D17,9020457852043970742172)]), + ([885443715538058481010],[(.D2,536108499642183844065)])], + [([3626777458843887524213256,786408],[(.D15,906694364710971881146658), + (.D17,2422574005712127994655532)]), + ([113336795588871485156238,56668397794435742578125,28334198897217871289064,14167099448608935644532,7083549724304467822261,3541774862152233911135,1770887431076116955568,885443715538058477784,442721857769029238892,221360928884514619441,110680464442257309720,55340232221128654860,27670116110564327435,13835058055282163713,6917529027641081856,3458764513820540928,1729382256910270464,864691128455135232,432345564227567616,216172782113783808,108086391056891904,54043195528445952,27021597764222976,13510798882111488,6755399441055744,3377699720527872,1688849860263936,844424930131968,422212465065984,211106232532992,105553116266496,52776558133248,26388279066624,13194139533312,6597069766656,3298534883328,1649267441664,824633720832,412316860416,206158430208,103079215104,51539607552,25769803776,12884901888,6442450944,3221225472,1610612736,805306368,402653184,201326592,100663296,50331648,25165824,12582912,6291456,3145728,1572864,786432,393216,196608,98304,49152,24576,12288,6144,3072,1536,768,384,192,96,48,24,12,11],[(.D15,28334198897217871289060), + (.D17,144327325632703531845532)]), + ([14167099448608935644530],[(.D2,8577735994274941501665)])], + [([1813388729421943762086798,906694364710971881043405,453347182355485940521704,226673591177742970260852,113336795588871485130421,56668397794435742565215,28334198897217871282608,14167099448608935641304,7083549724304467820652,3541774862152233910321,1770887431076116955160,885443715538058477580,442721857769029238795,221360928884514619393,110680464442257309696,55340232221128654848,27670116110564327424,13835058055282163712,6917529027641081856,3458764513820540928,1729382256910270464,864691128455135232,432345564227567616,216172782113783808,108086391056891904,54043195528445952,27021597764222976,13510798882111488,6755399441055744,3377699720527872,1688849860263936,844424930131968,422212465065984,211106232532992,105553116266496,52776558133248,26388279066624,13194139533312,6597069766656,3298534883328,1649267441664,824633720832,412316860416,206158430208,103079215104,51539607552,25769803776,12884901888,6442450944,3221225472,1610612736,805306368,402653184,201326592,100663296,50331648,25165824,12582912,6291456,3145728,1572864,786432,393216,196608,98304,49152,24576,12288,6144,3072,1536,768,384,192,96,48,24,12,11],[(.D15,453347182355485940521700), + (.D17,2309237210123256509499292)]), + ([226673591177742970260850],[(.D2,137243775908399064023265)])], + [([13175402487206310146213195],[(.D2,2195900414534385024368865)])]], + .ms [(.m2,.s6,140098446447293764554717958),(.m27,.s2,140098446447293764554717953)], + .m .m18, + .b 140098446447293764554717958 [[([1],[(.D6,1)])],[([4],[(.D13,0),(.D6,1)])],[([2],[(.D17,1),(.D5,0)])],[([4],[(.D3,0)])],[([2],[(.D17,1),(.D21,0),(.D9,99464844045441902313124)])],[([4],[(.D13,0),(.D18,0)])]], + .ms [(.m2,.s6,140098446447293764554717967),(.m35,.s2,140098446447293764554717962)], + .m .m18, + .b 140098446447293764554717967 [[([7,2],[(.D12,1),(.D11,99464844045441902313123)]),([1],[(.D0,6216552752840118894244)])],[([2],[(.D21,0),(.D19,99464844045441902313124)])]], + .ms [(.m2,.s6,140098446447293764554717973),(.m7,.s5,140098446447293764554717967)], + .m .m5, + .b 140098446447293764554717973 [[([10],[(.D8,1),(.D7,99464844045441902313123)])],[([596789064272651413878731],[(.D2,99464844045441902313121)])]], + .ms [(.m2,.s6,140396840979430090261657344),(.m34,.s2,140396840979430090261657339)], + .m .m18, + .b 140396840979430090261657344 [[([1],[(.D6,1)])],[([4],[(.D13,0),(.D16,1),(.D21,0)])]], + .ms [(.m2,.s6,140396840979430090261657347),(.m38,.s5,140396840979430090261657341)], + .m .m5, + .b 140396840979430090261657347 [[([7,2],[(.D12,1),(.D18,1)])]], + .ms [(.m2,.s6,140396840979430090261657352),(.m15,.s5,140396840979430090261657346)], + .m .m5, + .b 140396840979430090261657352 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,140396840979430090261657353),(.m25,.s2,140396840979430090261657348)], + .m .m18, + .b 140396840979430090261657353 [[([3],[(.D6,2)])],[([2],[(.D21,0),(.D21,6216552752840118894243),(.D0,388534547052507430564)])]], + .ms [(.m2,.s6,140396840979430090261657356),(.m7,.s5,140396840979430090261657350)], + .m .m5, + .b 140396840979430090261657356 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,140396840979430090261657357),(.m15,.s5,140396840979430090261657351)], + .m .m5, + .b 140396840979430090261657357 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,140396840979430090261657358),(.m25,.s2,140396840979430090261657353)], + .m .m18, + .b 140396840979430090261657358 [[([3],[(.D6,2)])],[([9324829129260178333536],[(.D21,6216552752840118894244),(.D1,388534547052507430564)])]], + .ms [(.m2,.s6,140401503393994720350824128),(.m0,.s6,5050949111682596602552),(.m27,.s2,5050949111682596602552),(.m16,.s5,140401503393994720350824122)], + .m .m5, + .b 140401503393994720350824128 [[([7],[(.D18,5050949111682596602552),(.D6,1)])],[([16],[(.D21,5050949111682596602551),(.D13,0),(.D6,1)])],[([8],[(.D21,5050949111682596602549),(.D17,1),(.D5,0)])],[([16],[(.D21,5050949111682596602548),(.D3,0)])],[([8],[(.D21,5050949111682596602546),(.D17,1),(.D21,0),(.D9,24283409190781714084)])],[([16],[(.D21,5050949111682596602545),(.D13,0),(.D18,0)])]], + .ms [(.m2,.s6,140401503393994720350824164),(.m0,.s6,5050949111682596602543),(.m35,.s2,5050949111682596602543),(.m16,.s5,140401503393994720350824158)], + .m .m5, + .b 140401503393994720350824164 [[([39],[(.D18,5050949111682596602543)]),([7,2],[(.D12,1),(.D11,24283409190781714083)]),([1],[(.D0,1517713074423856804)])],[([8],[(.D21,5050949111682596602538),(.D21,0),(.D19,24283409190781714084)])]], + .ms [(.m2,.s6,140401503393994720350824188),(.m0,.s6,5050949111682596602537),(.m7,.s5,5050949111682596602537),(.m1,.s5,140401503393994720350824182)], + .m .m5, + .b 140401503393994720350824188 [[([43],[(.D18,5050949111682596602537),(.D8,1),(.D7,24283409190781714083)])],[([582801820578761137964],[(.D21,5050949111682596602531),(.D2,24283409190781714081)])]], + .ms [(.m2,.s6,140401794794905009731393192),(.m0,.s6,4978098884110251460286),(.m34,.s2,4978098884110251460286),(.m16,.s5,140401794794905009731393186)], + .m .m5, + .b 140401794794905009731393192 [[([7],[(.D18,4978098884110251460286),(.D6,1)])],[([16],[(.D21,4978098884110251460285),(.D13,0),(.D16,1),(.D21,0)])]], + .ms [(.m2,.s6,140401794794905009731393204),(.m0,.s6,4978098884110251460283),(.m38,.s5,4978098884110251460283),(.m1,.s5,140401794794905009731393198)], + .m .m5, + .b 140401794794905009731393204 [[([39],[(.D18,4978098884110251460283)]),([7,2],[(.D12,1),(.D18,1)])]], + .ms [(.m2,.s6,140401794794905009731393224),(.m0,.s6,4978098884110251460278),(.m15,.s5,4978098884110251460278),(.m1,.s5,140401794794905009731393218)], + .m .m5, + .b 140401794794905009731393224 [[([7],[(.D18,4978098884110251460278),(.D16,1)])]], + .ms [(.m2,.s6,140401794794905009731393228),(.m0,.s6,4978098884110251460277),(.m25,.s2,4978098884110251460277),(.m16,.s5,140401794794905009731393222)], + .m .m5, + .b 140401794794905009731393228 [[([15],[(.D18,4978098884110251460277),(.D6,2)])],[([8],[(.D21,4978098884110251460275),(.D21,0),(.D21,1517713074423856803),(.D0,94857067151490724)])]], + .ms [(.m2,.s6,140401794794905009731393240),(.m0,.s6,4978098884110251460274),(.m7,.s5,4978098884110251460274),(.m1,.s5,140401794794905009731393234)], + .m .m5, + .b 140401794794905009731393240 [[([7],[(.D18,4978098884110251460274),(.D6,1)])]], + .ms [(.m2,.s6,140401794794905009731393244),(.m0,.s6,4978098884110251460273),(.m15,.s5,4978098884110251460273),(.m1,.s5,140401794794905009731393238)], + .m .m5, + .b 140401794794905009731393244 [[([7],[(.D18,4978098884110251460273),(.D16,1)])]], + .ms [(.m2,.s6,140401794794905009731393248),(.m0,.s6,4978098884110251460272),(.m25,.s2,4978098884110251460272),(.m16,.s5,140401794794905009731393242)], + .m .m5, + .b 140401794794905009731393248 [[([15],[(.D18,4978098884110251460272),(.D6,2)])],[([9106278446543109504],[(.D21,4978098884110251460270),(.D21,1517713074423856804),(.D1,94857067151490724)])]], + .ms [(.m2,.s6,140401799348044233002948008),(.m0,.s6,4976960599304433571582),(.m0,.s6,1233141872969384632),(.m27,.s2,1233141872969384632),(.m16,.s5,4976960599304433571582),(.m1,.s5,140401799348044233002948002)], + .m .m5, + .b 140401799348044233002948008 [[([31],[(.D18,4976960599304433571582),(.D18,1233141872969384632),(.D6,1)])],[([64],[(.D21,4976960599304433571578),(.D21,1233141872969384631),(.D13,0),(.D6,1)])],[([32],[(.D21,4976960599304433571570),(.D21,1233141872969384629),(.D17,1),(.D5,0)])],[([64],[(.D21,4976960599304433571566),(.D21,1233141872969384628),(.D3,0)])],[([32],[(.D21,4976960599304433571558),(.D21,1233141872969384626),(.D17,1),(.D21,0),(.D9,5928566696967844)])],[([64],[(.D21,4976960599304433571554),(.D21,1233141872969384625),(.D13,0),(.D18,0)])]], + .ms [(.m2,.s6,140401799348044233002948152),(.m0,.s6,4976960599304433571546),(.m0,.s6,1233141872969384623),(.m35,.s2,1233141872969384623),(.m16,.s5,4976960599304433571546),(.m1,.s5,140401799348044233002948146)], + .m .m5, + .b 140401799348044233002948152 [[([159],[(.D18,4976960599304433571546),(.D18,1233141872969384623)]),([7,2],[(.D12,1),(.D11,5928566696967843)]),([1],[(.D0,370535418560164)])],[([32],[(.D21,4976960599304433571526),(.D21,1233141872969384618),(.D21,0),(.D19,5928566696967844)])]], + .ms [(.m2,.s6,140401799348044233002948248),(.m0,.s6,4976960599304433571522),(.m0,.s6,1233141872969384617),(.m7,.s5,1233141872969384617),(.m1,.s5,4976960599304433571522),(.m1,.s5,140401799348044233002948242)], + .m .m5, + .b 140401799348044233002948248 [[([175],[(.D18,4976960599304433571522),(.D18,1233141872969384617),(.D8,1),(.D7,5928566696967843)])],[([569142402908912816],[(.D21,4976960599304433571500),(.D21,1233141872969384611),(.D2,5928566696967841)])]], + .ms [(.m2,.s6,140401799632615434457404744),(.m0,.s6,4976889456504069957398),(.m0,.s6,1215356172878481086),(.m34,.s2,1215356172878481086),(.m16,.s5,4976889456504069957398),(.m1,.s5,140401799632615434457404738)], + .m .m5, + .b 140401799632615434457404744 [[([31],[(.D18,4976889456504069957398),(.D18,1215356172878481086),(.D6,1)])],[([64],[(.D21,4976889456504069957394),(.D21,1215356172878481085),(.D13,0),(.D16,1),(.D21,0)])]], + .ms [(.m2,.s6,140401799632615434457404792),(.m0,.s6,4976889456504069957386),(.m0,.s6,1215356172878481083),(.m38,.s5,1215356172878481083),(.m1,.s5,4976889456504069957386),(.m1,.s5,140401799632615434457404786)], + .m .m5, + .b 140401799632615434457404792 [[([159],[(.D18,4976889456504069957386),(.D18,1215356172878481083)]),([7,2],[(.D12,1),(.D18,1)])]], + .ms [(.m2,.s6,140401799632615434457404872),(.m0,.s6,4976889456504069957366),(.m0,.s6,1215356172878481078),(.m15,.s5,1215356172878481078),(.m1,.s5,4976889456504069957366),(.m1,.s5,140401799632615434457404866)], + .m .m5, + .b 140401799632615434457404872 [[([31],[(.D18,4976889456504069957366),(.D18,1215356172878481078),(.D16,1)])]], + .ms [(.m2,.s6,140401799632615434457404888),(.m0,.s6,4976889456504069957362),(.m0,.s6,1215356172878481077),(.m25,.s2,1215356172878481077),(.m16,.s5,4976889456504069957362),(.m1,.s5,140401799632615434457404882)], + .m .m5, + .b 140401799632615434457404888 [[([63],[(.D18,4976889456504069957362),(.D18,1215356172878481077),(.D6,2)])],[([32],[(.D21,4976889456504069957354),(.D21,1215356172878481075),(.D21,0),(.D21,370535418560163),(.D0,23158463659684)])]], + .ms [(.m2,.s6,140401799632615434457404936),(.m0,.s6,4976889456504069957350),(.m0,.s6,1215356172878481074),(.m7,.s5,1215356172878481074),(.m1,.s5,4976889456504069957350),(.m1,.s5,140401799632615434457404930)], + .m .m5, + .b 140401799632615434457404936 [[([31],[(.D18,4976889456504069957350),(.D18,1215356172878481074),(.D6,1)])]], + .ms [(.m2,.s6,140401799632615434457404952),(.m0,.s6,4976889456504069957346),(.m0,.s6,1215356172878481073),(.m15,.s5,1215356172878481073),(.m1,.s5,4976889456504069957346),(.m1,.s5,140401799632615434457404946)], + .m .m5, + .b 140401799632615434457404952 [[([31],[(.D18,4976889456504069957346),(.D18,1215356172878481073),(.D16,1)])]], + .ms [(.m2,.s6,140401799632615434457404968),(.m0,.s6,4976889456504069957342),(.m0,.s6,1215356172878481072),(.m25,.s2,1215356172878481072),(.m16,.s5,4976889456504069957342),(.m1,.s5,140401799632615434457404962)], + .m .m5, + .b 140401799632615434457404968 [[([63],[(.D18,4976889456504069957342),(.D18,1215356172878481072),(.D6,2)])],[([8892850045318656],[(.D21,4976889456504069957334),(.D21,1215356172878481070),(.D21,370535418560164),(.D1,23158463659684)])]], + .ms [(.m2,.s6,140401799637061859480064328),(.m0,.s6,4976888344897814292502),(.m0,.s6,1215078271314564862),(.m0,.s6,301060027581112),(.m27,.s2,301060027581112),(.m16,.s5,1215078271314564862),(.m1,.s5,4976888344897814292502),(.m1,.s5,140401799637061859480064322)], + .m .m5, + .b 140401799637061859480064328 [[([127],[(.D18,4976888344897814292502),(.D18,1215078271314564862),(.D18,301060027581112),(.D6,1)])],[([256],[(.D21,4976888344897814292486),(.D21,1215078271314564858),(.D21,301060027581111),(.D13,0),(.D6,1)])],[([128],[(.D21,4976888344897814292454),(.D21,1215078271314564850),(.D21,301060027581109),(.D17,1),(.D5,0)])],[([256],[(.D21,4976888344897814292438),(.D21,1215078271314564846),(.D21,301060027581108),(.D3,0)])],[([128],[(.D21,4976888344897814292406),(.D21,1215078271314564838),(.D21,301060027581106),(.D17,1),(.D21,0),(.D9,1447403978404)])],[([256],[(.D21,4976888344897814292390),(.D21,1215078271314564834),(.D21,301060027581105),(.D13,0),(.D18,0)])]], + .ms [(.m2,.s6,140401799637061859480064904),(.m0,.s6,4976888344897814292358),(.m0,.s6,1215078271314564826),(.m0,.s6,301060027581103),(.m35,.s2,301060027581103),(.m16,.s5,1215078271314564826),(.m1,.s5,4976888344897814292358),(.m1,.s5,140401799637061859480064898)], + .m .m5, + .b 140401799637061859480064904 [[([639],[(.D18,4976888344897814292358),(.D18,1215078271314564826),(.D18,301060027581103)]),([7,2],[(.D12,1),(.D11,1447403978403)]),([1],[(.D0,90462748324)])],[([128],[(.D21,4976888344897814292278),(.D21,1215078271314564806),(.D21,301060027581098),(.D21,0),(.D19,1447403978404)])]], + .ms [(.m2,.s6,140401799637061859480065288),(.m0,.s6,4976888344897814292262),(.m0,.s6,1215078271314564802),(.m0,.s6,301060027581097),(.m7,.s5,301060027581097),(.m1,.s5,1215078271314564802),(.m1,.s5,4976888344897814292262),(.m1,.s5,140401799637061859480065282)], + .m .m5, + .b 140401799637061859480065288 [[([703],[(.D18,4976888344897814292262),(.D18,1215078271314564802),(.D18,301060027581097),(.D8,1),(.D7,1447403978403)])],[([555803127706304],[(.D21,4976888344897814292174),(.D21,1215078271314564780),(.D21,301060027581091),(.D2,1447403978401)])]], + .ms [(.m2,.s6,140401799637339761043918792),(.m0,.s6,4976888275422423328886),(.m0,.s6,1215060902466823958),(.m0,.s6,296717815645886),(.m34,.s2,296717815645886),(.m16,.s5,1215060902466823958),(.m1,.s5,4976888275422423328886),(.m1,.s5,140401799637339761043918786)], + .m .m5, + .b 140401799637339761043918792 [[([127],[(.D18,4976888275422423328886),(.D18,1215060902466823958),(.D18,296717815645886),(.D6,1)])],[([256],[(.D21,4976888275422423328870),(.D21,1215060902466823954),(.D21,296717815645885),(.D13,0),(.D16,1),(.D21,0)])]], + .ms [(.m2,.s6,140401799637339761043918984),(.m0,.s6,4976888275422423328838),(.m0,.s6,1215060902466823946),(.m0,.s6,296717815645883),(.m38,.s5,296717815645883),(.m1,.s5,1215060902466823946),(.m1,.s5,4976888275422423328838),(.m1,.s5,140401799637339761043918978)], + .m .m5, + .b 140401799637339761043918984 [[([639],[(.D18,4976888275422423328838),(.D18,1215060902466823946),(.D18,296717815645883)]),([7,2],[(.D12,1),(.D18,1)])]], + .ms [(.m2,.s6,140401799637339761043919304),(.m0,.s6,4976888275422423328758),(.m0,.s6,1215060902466823926),(.m0,.s6,296717815645878),(.m15,.s5,296717815645878),(.m1,.s5,1215060902466823926),(.m1,.s5,4976888275422423328758),(.m1,.s5,140401799637339761043919298)], + .m .m5, + .b 140401799637339761043919304 [[([127],[(.D18,4976888275422423328758),(.D18,1215060902466823926),(.D18,296717815645878),(.D16,1)])]], + .ms [(.m2,.s6,140401799637339761043919368),(.m0,.s6,4976888275422423328742),(.m0,.s6,1215060902466823922),(.m0,.s6,296717815645877),(.m25,.s2,296717815645877),(.m16,.s5,1215060902466823922),(.m1,.s5,4976888275422423328742),(.m1,.s5,140401799637339761043919362)], + .m .m5, + .b 140401799637339761043919368 [[([255],[(.D18,4976888275422423328742),(.D18,1215060902466823922),(.D18,296717815645877),(.D6,2)])],[([128],[(.D21,4976888275422423328710),(.D21,1215060902466823914),(.D21,296717815645875),(.D21,0),(.D21,90462748323),(.D0,5653921444)])]], + .ms [(.m2,.s6,140401799637339761043919560),(.m0,.s6,4976888275422423328694),(.m0,.s6,1215060902466823910),(.m0,.s6,296717815645874),(.m7,.s5,296717815645874),(.m1,.s5,1215060902466823910),(.m1,.s5,4976888275422423328694),(.m1,.s5,140401799637339761043919554)], + .m .m5, + .b 140401799637339761043919560 [[([127],[(.D18,4976888275422423328694),(.D18,1215060902466823910),(.D18,296717815645874),(.D6,1)])]], + .ms [(.m2,.s6,140401799637339761043919624),(.m0,.s6,4976888275422423328678),(.m0,.s6,1215060902466823906),(.m0,.s6,296717815645873),(.m15,.s5,296717815645873),(.m1,.s5,1215060902466823906),(.m1,.s5,4976888275422423328678),(.m1,.s5,140401799637339761043919618)], + .m .m5, + .b 140401799637339761043919624 [[([127],[(.D18,4976888275422423328678),(.D18,1215060902466823906),(.D18,296717815645873),(.D16,1)])]], + .ms [(.m2,.s6,140401799637339761043919688),(.m0,.s6,4976888275422423328662),(.m0,.s6,1215060902466823902),(.m0,.s6,296717815645872),(.m25,.s2,296717815645872),(.m16,.s5,1215060902466823902),(.m1,.s5,4976888275422423328662),(.m1,.s5,140401799637339761043919682)], + .m .m5, + .b 140401799637339761043919688 [[([255],[(.D18,4976888275422423328662),(.D18,1215060902466823902),(.D18,296717815645872),(.D6,2)])],[([8684423337984],[(.D21,4976888275422423328630),(.D21,1215060902466823894),(.D21,296717815645870),(.D21,90462748324),(.D1,5653921444)])]], + .ms [(.m2,.s6,140401799637344103255588808),(.m0,.s6,4976888274336870411382),(.m0,.s6,1215060631078594582),(.m0,.s6,296649968588542),(.m0,.s6,73500983992),(.m27,.s2,73500983992),(.m16,.s5,296649968588542),(.m1,.s5,1215060631078594582),(.m1,.s5,4976888274336870411382),(.m1,.s5,140401799637344103255588802)], + .m .m5, + .b 140401799637344103255588808 [[([511],[(.D18,4976888274336870411382),(.D18,1215060631078594582),(.D18,296649968588542),(.D18,73500983992),(.D6,1)])],[([1024],[(.D21,4976888274336870411318),(.D21,1215060631078594566),(.D21,296649968588538),(.D21,73500983991),(.D13,0),(.D6,1)])],[([512],[(.D21,4976888274336870411190),(.D21,1215060631078594534),(.D21,296649968588530),(.D21,73500983989),(.D17,1),(.D5,0)])],[([1024],[(.D21,4976888274336870411126),(.D21,1215060631078594518),(.D21,296649968588526),(.D21,73500983988),(.D3,0)])],[([512],[(.D21,4976888274336870410998),(.D21,1215060631078594486),(.D21,296649968588518),(.D21,73500983986),(.D17,1),(.D21,0),(.D9,353369764)])],[([1024],[(.D21,4976888274336870410934),(.D21,1215060631078594470),(.D21,296649968588514),(.D21,73500983985),(.D13,0),(.D18,0)])]], + .ms [(.m2,.s6,140401799637344103255591112),(.m0,.s6,4976888274336870410806),(.m0,.s6,1215060631078594438),(.m0,.s6,296649968588506),(.m0,.s6,73500983983),(.m35,.s2,73500983983),(.m16,.s5,296649968588506),(.m1,.s5,1215060631078594438),(.m1,.s5,4976888274336870410806),(.m1,.s5,140401799637344103255591106)], + .m .m5, + .b 140401799637344103255591112 [[([2559],[(.D18,4976888274336870410806),(.D18,1215060631078594438),(.D18,296649968588506),(.D18,73500983983)]),([7,2],[(.D12,1),(.D11,353369763)]),([1],[(.D16,2110856786)])],[([512],[(.D21,4976888274336870410486),(.D21,1215060631078594358),(.D21,296649968588486),(.D21,73500983978),(.D21,0),(.D19,353369764)])]], + .ms [(.m2,.s6,140401799637344103255592648),(.m0,.s6,4976888274336870410422),(.m0,.s6,1215060631078594342),(.m0,.s6,296649968588482),(.m0,.s6,73500983977),(.m7,.s5,73500983977),(.m1,.s5,296649968588482),(.m1,.s5,1215060631078594342),(.m1,.s5,4976888274336870410422),(.m1,.s5,140401799637344103255592642)], + .m .m42, + ] (by decide +kernel) +theorem chunk_30_step : (cfg_30.denote) [qi]⊢* (cfg_31.denote) := + step_chunk [ + .m .m43, + .b 140401799637344103255592648 [[([2815],[(.D18,4976888274336870410422),(.D18,1215060631078594342),(.D18,296649968588482),(.D18,73500983977),(.D8,1),(.D7,353369763)])],[([542775954176],[(.D21,4976888274336870410070),(.D21,1215060631078594254),(.D21,296649968588460),(.D21,73500983971),(.D2,353369761)])]], + .ms [(.m2,.s6,140401799637344374643571144),(.m0,.s6,4976888274269023415798),(.m0,.s6,1215060614116845686),(.m0,.s6,296645728151318),(.m0,.s6,72440874686),(.m34,.s2,72440874686),(.m16,.s5,296645728151318),(.m1,.s5,1215060614116845686),(.m1,.s5,4976888274269023415798),(.m1,.s5,140401799637344374643571138)], + .m .m5, + .b 140401799637344374643571144 [[([511],[(.D18,4976888274269023415798),(.D18,1215060614116845686),(.D18,296645728151318),(.D18,72440874686),(.D6,1)])],[([1280],[(.D21,4976888274269023415734),(.D21,1215060614116845670),(.D21,296645728151314),(.D21,72440874685),(.D13,0),(.D10,2110856785),(.D6,608483448)])],[([2304],[(.D21,4976888274269023415574),(.D21,1215060614116845630),(.D21,296645728151304),(.D21,72440874682)]),([7,2],[(.D12,1),(.D6,2110856786)])]], + .ms [(.m2,.s6,140401799637344374643573192),(.m0,.s6,4976888274269023415286),(.m0,.s6,1215060614116845558),(.m0,.s6,296645728151286),(.m0,.s6,72440874678),(.m15,.s5,72440874678),(.m1,.s5,296645728151286),(.m1,.s5,1215060614116845558),(.m1,.s5,4976888274269023415286),(.m1,.s5,140401799637344374643573186)], + .m .m5, + .b 140401799637344374643573192 [[([511],[(.D18,4976888274269023415286),(.D18,1215060614116845558),(.D18,296645728151286),(.D18,72440874678),(.D16,1)])]], + .ms [(.m2,.s6,140401799637344374643573448),(.m0,.s6,4976888274269023415222),(.m0,.s6,1215060614116845542),(.m0,.s6,296645728151282),(.m0,.s6,72440874677),(.m25,.s2,72440874677),(.m16,.s5,296645728151282),(.m1,.s5,1215060614116845542),(.m1,.s5,4976888274269023415222),(.m1,.s5,140401799637344374643573442)], + .m .m5, + .b 140401799637344374643573448 [[([1023],[(.D18,4976888274269023415222),(.D18,1215060614116845542),(.D18,296645728151282),(.D18,72440874677),(.D6,2)])],[([512],[(.D21,4976888274269023415094),(.D21,1215060614116845510),(.D21,296645728151274),(.D21,72440874675),(.D21,0),(.D7,2110856784)])]], + .ms [(.m2,.s6,140401799637344374643574216),(.m0,.s6,4976888274269023415030),(.m0,.s6,1215060614116845494),(.m0,.s6,296645728151270),(.m0,.s6,72440874674),(.m7,.s5,72440874674),(.m1,.s5,296645728151270),(.m1,.s5,1215060614116845494),(.m1,.s5,4976888274269023415030),(.m1,.s5,140401799637344374643574210)], + .m .m5, + .b 140401799637344374643574216 [[([2815],[(.D18,4976888274269023415030),(.D18,1215060614116845494),(.D18,296645728151270),(.D18,72440874674),(.D8,1),(.D17,2110856783),(.D7,608483447)])],[([2304],[(.D21,4976888274269023414678),(.D21,1215060614116845406),(.D21,296645728151248),(.D21,72440874668)]),([7,2],[(.D12,1),(.D17,2110856781)]),([1],[(.D8,608483446)])],[([512],[(.D21,4976888274269023414390),(.D21,1215060614116845334),(.D21,296645728151230),(.D21,72440874664),(.D21,0),(.D17,2110856781),(.D9,608483446)])]], + .ms [(.m2,.s6,140401799637344374643577032),(.m0,.s6,4976888274269023414326),(.m0,.s6,1215060614116845318),(.m0,.s6,296645728151226),(.m0,.s6,72440874663),(.m7,.s5,72440874663),(.m1,.s5,296645728151226),(.m1,.s5,1215060614116845318),(.m1,.s5,4976888274269023414326),(.m1,.s5,140401799637344374643577026)], + .m .m5, + .b 140401799637344374643577032 [[([1484838399],[(.D18,4976888274269023414326),(.D18,1215060614116845318),(.D18,296645728151226),(.D18,72440874663),(.D8,2110856781),(.D10,608483445),(.D16,23931959),(.D12,36457456),(.D17,1102102),(.D15,2180392),(.D17,1225136039),(.D17,4441),(.D11,9275),(.D17,266),(.D6,5)])]], + .ms [(.m2,.s6,140401799637344375385996232),(.m0,.s6,4976888274268837809526),(.m0,.s6,1215060614070444118),(.m0,.s6,296645716550926)], + .ms2 .s6 .s7 [(.m0,72437974588,2110131764),(.m0,608302192,23886646),(.m0,36446128,1099270),(.m0,2179684,1225135862)], + .ms [(.m12,.s7,4395),(.m0,.s6,9265),(.m3,.s6,263),(.m21,.s3,263),(.m4,.s3,9265),(.m4,.s3,4395)], + .ms2 .s3 .s0 [(.m13,1225135862,2179684),(.m1,1099270,36446128),(.m1,23886646,608302192),(.m1,2110131764,72437974588)], + .ms [(.m16,.s3,296645716550926),(.m1,.s3,1215060614070444118),(.m1,.s3,4976888274268837809526),(.m1,.s3,140401799637344375385996226),(.m10,.s7,140401799637344375385996232),(.m8,.s2,140401799637344375385996227)], + .m .m9, + .b 0 [[([3724541948],[(.D7,140401799637344375385996232),(.D19,4976888274268837809526),(.D18,1215060614070444118),(.D18,296645716550926),(.D18,72437974588),(.D6,2110131764),(.D16,608302192),(.D6,23886646),(.D16,36446128),(.D6,1099270),(.D16,2179684),(.D6,1225135862),(.D12,4395),(.D16,9265),(.D16,263),(.D12,3)])]], + .ms [(.m2,.s6,1862270974),(.m3,.s6,140401799637344374920428488),(.m0,.s6,4976888274268721417590),(.m0,.s6,1215060614041346134),(.m0,.s6,296645709276430)], + .ms2 .s6 .s7 [(.m0,72436155964,2109677108),(.m0,608188528,23858230),(.m0,36439024,1097494),(.m0,2179240,1225135751)], + .ms [(.m3,.s6,4369)], + .ms2 .s6 .s7 [(.m6,9257,262)], + .ms2 .s3 .s0 [(.m19,262,9257)], + .ms [(.m17,.s0,4369)], + .ms2 .s3 .s0 [(.m4,1225135751,2179240),(.m1,1097494,36439024),(.m1,23858230,608188528),(.m1,2109677108,72436155964)], + .ms [(.m16,.s3,296645709276430),(.m1,.s3,1215060614041346134),(.m1,.s3,4976888274268721417590),(.m1,.s3,140401799637344374920428488),(.m4,.s3,1862270968),(.m10,.s7,1862270974),(.m8,.s2,1862270969)], + .m .m9, + .b 0 [[([7449083894,3422552070],[(.D7,1862270974),(.D17,140401799637344374920428488)]),([679477247],[(.D18,4976888274268721417590),(.D18,1215060614041346134),(.D18,296645709276430),(.D18,72436155964),(.D6,2109677108),(.D16,608188528),(.D6,23858230),(.D16,36439024),(.D6,1097494),(.D16,2179240),(.D6,1225135751),(.D6,4369),(.D12,9257),(.D6,262),(.D16,4)])]], + .ms [(.m2,.s6,5435817982),(.m3,.s6,503316478),(.m3,.s6,140401799637344374580689864),(.m0,.s6,4976888274268636482934),(.m0,.s6,1215060614020112470),(.m0,.s6,296645703968014)], + .ms2 .s6 .s7 [(.m0,72434828860,2109345332),(.m0,608105584,23837494),(.m0,36433840,1096198),(.m0,2178916,1225135670)], + .ms [(.m12,.s7,4347),(.m0,.s6,9253),(.m3,.s6,260),(.m20,.s0,260),(.m1,.s3,9253),(.m4,.s3,4347)], + .ms2 .s3 .s0 [(.m13,1225135670,2178916),(.m1,1096198,36433840),(.m1,23837494,608105584),(.m1,2109345332,72434828860)], + .ms [(.m16,.s3,296645703968014),(.m1,.s3,1215060614020112470),(.m1,.s3,4976888274268636482934),(.m1,.s3,140401799637344374580689864),(.m4,.s3,503316478),(.m4,.s3,5435817976),(.m10,.s7,5435817982),(.m8,.s2,5435817977)], + .m .m9, + .b 0 [[([16106127284],[(.D7,5435817982)]),([2013265910,1006632959,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,503316478),(.D16,140401799637344374580689864)]),([251658238],[(.D18,4976888274268636482934),(.D18,1215060614020112470),(.D18,296645703968014),(.D18,72434828860),(.D6,2109345332),(.D16,608105584),(.D6,23837494),(.D16,36433840),(.D6,1096198),(.D16,2178916),(.D6,1225135670),(.D12,4347),(.D16,9253),(.D16,260),(.D6,5)])]], + .ms [(.m2,.s6,8053063642),(.m3,.s6,3422552071),(.m14,.s5,3422552071),(.m4,.s5,8053063636)], + .m .m5, + .b 8053063642 [[([23],[(.D16,3422552071),(.D18,1),(.D15,140401799637344374454860743),(.D20,4976888274268605025654)])]], + .ms [(.m2,.s6,8053063654),(.m3,.s6,3422552068),(.m7,.s5,3422552068),(.m4,.s5,8053063648)], + .m .m5, + .b 8053063654 [[([7],[(.D16,3422552068),(.D6,1)])]], + .ms [(.m2,.s6,8053063658),(.m6,.s6,3422552066),(.m15,.s5,3422552066),(.m11,.s5,8053063652)], + .m .m5, + .b 8053063658 [[([5],[(.D12,3422552066),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,8053063661,3422552067)], + .ms [(.m23,.s1,3422552067),(.m22,.s4,8053063655)], + .m .m24, + .b 8053063661 [[([17],[(.D6,3422552067),(.D6,2)])]], + .ms [(.m2,.s6,8053063670),(.m6,.s6,3422552063),(.m14,.s5,3422552063),(.m11,.s5,8053063664)], + .m .m5, + .b 8053063670 [[([23],[(.D12,3422552063),(.D18,1),(.D17,140401799637344374454860742),(.D21,4976888274268605025654),(.D21,1215060614012248150),(.D21,296645702001934),(.D21,72434337340),(.D17,2109222452),(.D15,608074864),(.D17,23829814),(.D15,36431920),(.D17,1095718),(.D15,2178796),(.D17,1225135640),(.D11,4339),(.D6,9252)])]], + .ms [(.m2,.s6,8053063682),(.m6,.s6,3422552060),(.m7,.s5,3422552060),(.m11,.s5,8053063676)], + .m .m5, + .b 8053063682 [[([13690208241,6845104125,1207959561],[(.D12,3422552060),(.D8,140401799637344374454860742)]),([1358954495],[(.D18,4976888274268605025654),(.D18,1215060614012248150),(.D18,296645702001934),(.D18,72434337340),(.D6,2109222452),(.D16,608074864),(.D6,23829814),(.D16,36431920),(.D6,1095718),(.D16,2178796),(.D6,1225135640),(.D12,4340),(.D7,9251),(.D8,259),(.D7,4)])]], + .ms [(.m2,.s6,18924699646)], + .ms2 .s6 .s7 [(.m3,704643070,140401799637344373775383496)], + .ms [(.m41,.s6,4976888274268435156342),(.m0,.s6,1215060613969780822),(.m0,.s6,296645691385102)], + .ms2 .s6 .s7 [(.m0,72431683132,2108558900),(.m0,607908976,23788342),(.m0,36421552,1093126),(.m0,2178148,1225135478)], + .ms [(.m12,.s7,4299),(.m0,.s6,9241),(.m3,.s6,257),(.m21,.s3,257),(.m4,.s3,9241),(.m4,.s3,4299)], + .ms2 .s3 .s0 [(.m13,1225135478,2178148),(.m1,1093126,36421552),(.m1,23788342,607908976),(.m1,2108558900,72431683132)], + .ms [(.m16,.s3,296645691385102),(.m1,.s3,1215060613969780822),(.m1,.s3,4976888274268435156342)], + .ms2 .s3 .s0 [(.m1,140401799637344373775383496,704643070)], + .ms [(.m1,.s3,18924699640),(.m10,.s7,18924699646),(.m8,.s2,18924699641)], + .m .m9, + .b 0 [[([22548578228],[(.D7,18924699646)]),([2818572278,1409286143,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,704643070),(.D6,140401799637344373775383496)]),([352321534],[(.D18,4976888274268435156342),(.D18,1215060613969780822),(.D18,296645691385102),(.D18,72431683132),(.D6,2108558900),(.D16,607908976),(.D6,23788342),(.D16,36421552),(.D6,1093126),(.D16,2178148),(.D6,1225135478),(.D12,4299),(.D16,9241),(.D16,257),(.D12,3)])],[([8],[(.D15,16106127367),(.D21,0),(.D19,140401799637344373599222727)])]], + .ms [(.m2,.s6,11274289118),(.m6,.s6,16106127365),(.m7,.s5,16106127365),(.m11,.s5,11274289112)], + .m .m5, + .b 11274289118 [[([41],[(.D12,16106127365),(.D8,1),(.D7,140401799637344373599222726)])],[([64424509442,32212254722,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,33,15,9,3],[(.D17,16106127361),(.D2,140401799637344373599222724)])]], + .ms [(.m2,.s6,75698798581),(.m47,.s5,75698798575)], + .m .m5, + .b 75698798581 [[([1],[(.D18,0)])]], + .ms [(.m2,.s6,75698798582),(.m7,.s5,75698798576)], + .m .m5, + .b 75698798582 [[([10],[(.D8,1),(.D11,140401799637344368230513604),(.D20,4976888274268391116150)])],[([3],[(.D12,1)])]], + .ms [(.m2,.s6,75698798589),(.m48,.s4,75698798583)], + .m .m24, + .b 75698798589 [[([5],[(.D16,2),(.D17,140401799637344368230513604),(.D21,4976888274268391116150),(.D21,1215060613958770774),(.D21,296645688632590),(.D21,72430995004),(.D17,2108386868),(.D15,607865968),(.D17,23777590),(.D15,36418864),(.D17,1092454),(.D15,2177980),(.D17,1225135436),(.D11,4288),(.D12,9238)])]], + .ms [(.m2,.s6,75698798592),(.m15,.s5,75698798586)], + .m .m5, + .b 75698798592 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,75698798593),(.m25,.s2,75698798588)], + .m .m18, + .b 75698798593 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,75698798595),(.m14,.s5,75698798589)], + .m .m5, + .b 75698798595 [[([5],[(.D18,1),(.D17,140401799637344368230513602),(.D18,4976888274268391116150)])]], + .ms [(.m2,.s6,75698798598),(.m7,.s5,75698798592)], + .m .m5, + .b 75698798598 [[([2315255803],[(.D8,140401799637344368230513603),(.D19,4976888274268391116150),(.D18,1215060613958770774),(.D18,296645688632590),(.D18,72430995004),(.D6,2108386868),(.D16,607865968),(.D6,23777590),(.D16,36418864),(.D6,1092454),(.D16,2177980),(.D6,1225135436),(.D12,4289),(.D13,9238),(.D9,256),(.D13,3)])]], + .ms [(.m2,.s6,76856426500),(.m3,.s6,140401799637344367941106628),(.m0,.s6,4976888274268318764406),(.m0,.s6,1215060613940682838),(.m0,.s6,296645684110606)], + .ms2 .s6 .s7 [(.m0,72429864508,2108104244),(.m0,607795312,23759926),(.m0,36414448,1091350),(.m0,2177704,1225135367)], + .ms [(.m3,.s6,4273)], + .ms2 .s6 .s7 [(.m6,9233,256)], + .ms2 .s3 .s0 [(.m19,256,9233)], + .ms [(.m17,.s0,4273)], + .ms2 .s3 .s0 [(.m4,1225135367,2177704),(.m1,1091350,36414448),(.m1,23759926,607795312),(.m1,2108104244,72429864508)], + .ms [(.m16,.s3,296645684110606),(.m1,.s3,1215060613940682838),(.m1,.s3,4976888274268318764406),(.m1,.s3,140401799637344367941106628),(.m4,.s3,76856426494),(.m10,.s7,76856426500),(.m8,.s2,76856426495)], + .m .m9, + .b 0 [[([10871635964],[(.D7,76856426500),(.D17,140401799637344367941106628),(.D18,4976888274268318764406),(.D18,1215060613940682838),(.D18,296645684110606),(.D18,72429864508),(.D6,2108104244),(.D16,607795312),(.D6,23759926),(.D16,36414448),(.D6,1091350),(.D16,2177704),(.D6,1225135367),(.D6,4273),(.D12,9233),(.D6,256),(.D16,4)])]], + .ms [(.m2,.s6,5435817982),(.m3,.s6,75497472004),(.m3,.s6,140401799637344367601368004),(.m0,.s6,4976888274268233829750),(.m0,.s6,1215060613919449174),(.m0,.s6,296645678802190)], + .ms2 .s6 .s7 [(.m0,72428537404,2107772468),(.m0,607712368,23739190),(.m0,36409264,1090054),(.m0,2177380,1225135286)], + .ms [(.m12,.s7,4251),(.m0,.s6,9229),(.m3,.s6,254),(.m20,.s0,254),(.m1,.s3,9229),(.m4,.s3,4251)], + .ms2 .s3 .s0 [(.m13,1225135286,2177380),(.m1,1090054,36409264),(.m1,23739190,607712368),(.m1,2107772468,72428537404)], + .ms [(.m16,.s3,296645678802190),(.m1,.s3,1215060613919449174),(.m1,.s3,4976888274268233829750),(.m1,.s3,140401799637344367601368004),(.m4,.s3,75497472004),(.m4,.s3,5435817976),(.m10,.s7,5435817982),(.m8,.s2,5435817977)], + .m .m9, + .b 0 [[([21743271926,10871635965,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,5435817982),(.D17,75497472004)]),([2717908990],[(.D16,140401799637344367601368004),(.D18,4976888274268233829750),(.D18,1215060613919449174),(.D18,296645678802190),(.D18,72428537404),(.D6,2107772468),(.D16,607712368),(.D6,23739190),(.D16,36409264),(.D6,1090054),(.D16,2177380),(.D6,1225135286),(.D12,4251),(.D16,9229),(.D16,254),(.D6,5)])]], + .ms [(.m2,.s6,21743271925),(.m14,.s5,21743271919)], + .m .m5, + .b 21743271925 [[([5],[(.D18,1),(.D15,74138517507),(.D14,140401799637344367261629380)])]], + .ms [(.m2,.s6,21743271928),(.m7,.s5,21743271922)], + .m .m5, + .b 21743271928 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,21743271929),(.m15,.s5,21743271923)], + .m .m5, + .b 21743271929 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,21743271930),(.m25,.s2,21743271925)], + .m .m18, + .b 21743271930 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,21743271932),(.m14,.s5,21743271926)], + .m .m5, + .b 21743271932 [[([5],[(.D18,1),(.D17,74138517506),(.D15,140401799637344367261629380),(.D21,4976888274268148895094),(.D21,1215060613898215510),(.D21,296645673493774),(.D21,72427210300),(.D17,2107440692),(.D15,607629424),(.D17,23718454),(.D15,36404080),(.D17,1088758),(.D15,2177056),(.D17,1225135205),(.D17,4232),(.D8,9223)])]], + .ms [(.m2,.s6,21743271935),(.m7,.s5,21743271929)], + .m .m5, + .b 21743271935 [[([14898167805],[(.D8,74138517506),(.D16,140401799637344367261629380),(.D18,4976888274268148895094),(.D18,1215060613898215510),(.D18,296645673493774),(.D18,72427210300),(.D6,2107440692),(.D16,607629424),(.D6,23718454),(.D16,36404080),(.D6,1088758),(.D16,2177056),(.D6,1225135205),(.D6,4233),(.D9,9223),(.D14,252),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,29192355838,72276246532)], + .ms [(.m0,.s6,140401799637344366796061636),(.m0,.s6,4976888274268032503158),(.m0,.s6,1215060613869117526),(.m0,.s6,296645666219278)], + .ms2 .s6 .s7 [(.m0,72425391676,2106986036),(.m0,607515760,23690038),(.m0,36396976,1086982),(.m0,2176612,1225135094)], + .ms [(.m12,.s7,4203),(.m0,.s6,9217),(.m3,.s6,251),(.m21,.s3,251),(.m4,.s3,9217),(.m4,.s3,4203)], + .ms2 .s3 .s0 [(.m13,1225135094,2176612),(.m1,1086982,36396976),(.m1,23690038,607515760),(.m1,2106986036,72425391676)], + .ms [(.m16,.s3,296645666219278),(.m1,.s3,1215060613869117526),(.m1,.s3,4976888274268032503158),(.m1,.s3,140401799637344366796061636)], + .ms2 .s3 .s0 [(.m4,72276246532,29192355833)], + .ms [(.m26,.s7,29192355838),(.m8,.s2,29192355833)], + .m .m9, + .b 0 [[([59592671228],[(.D7,29192355838),(.D7,72276246531),(.D16,140401799637344366796061636),(.D18,4976888274268032503158),(.D18,1215060613869117526),(.D18,296645666219278),(.D18,72425391676),(.D6,2106986036),(.D16,607515760),(.D6,23690038),(.D16,36396976),(.D6,1086982),(.D16,2176612),(.D6,1225135094),(.D12,4203),(.D16,9217),(.D16,251),(.D12,3)])]], + .ms [(.m2,.s6,29796335614)], + .ms2 .s6 .s7 [(.m3,21743271934,70413975556)], + .ms [(.m0,.s6,140401799637344366330493892),(.m0,.s6,4976888274267916111222),(.m0,.s6,1215060613840019542),(.m0,.s6,296645658944782)], + .ms2 .s6 .s7 [(.m0,72423573052,2106531380),(.m0,607402096,23661622),(.m0,36389872,1085206),(.m0,2176168,1225134983)], + .ms [(.m3,.s6,4177)], + .ms2 .s6 .s7 [(.m6,9209,250)], + .ms2 .s3 .s0 [(.m19,250,9209)], + .ms [(.m17,.s0,4177)], + .ms2 .s3 .s0 [(.m4,1225134983,2176168),(.m1,1085206,36389872),(.m1,23661622,607402096),(.m1,2106531380,72423573052)], + .ms [(.m16,.s3,296645658944782),(.m1,.s3,1215060613840019542),(.m1,.s3,4976888274267916111222),(.m1,.s3,140401799637344366330493892)], + .ms2 .s3 .s0 [(.m4,70413975556,21743271934)], + .ms [(.m1,.s3,29796335608),(.m10,.s7,29796335614),(.m8,.s2,29796335609)], + .m .m9, + .b 0 [[([119185342454,54760833030],[(.D7,29796335614),(.D17,21743271934)]),([10871635967],[(.D6,70413975556),(.D16,140401799637344366330493892),(.D18,4976888274267916111222),(.D18,1215060613840019542),(.D18,296645658944782),(.D18,72423573052),(.D6,2106531380),(.D16,607402096),(.D6,23661622),(.D16,36389872),(.D6,1085206),(.D16,2176168),(.D6,1225134983),(.D6,4177),(.D12,9209),(.D6,250),(.D16,4)])]], + .ms [(.m2,.s6,86973087742),(.m3,.s6,8053063678)], + .ms2 .s6 .s7 [(.m3,16307453950,69055021060)], + .ms [(.m0,.s6,140401799637344365990755268),(.m0,.s6,4976888274267831176566),(.m0,.s6,1215060613818785878),(.m0,.s6,296645653636366)], + .ms2 .s6 .s7 [(.m0,72422245948,2106199604),(.m0,607319152,23640886),(.m0,36384688,1083910),(.m0,2175844,1225134902)], + .ms [(.m12,.s7,4155),(.m0,.s6,9205),(.m3,.s6,248),(.m20,.s0,248),(.m1,.s3,9205),(.m4,.s3,4155)], + .ms2 .s3 .s0 [(.m13,1225134902,2175844),(.m1,1083910,36384688),(.m1,23640886,607319152),(.m1,2106199604,72422245948)], + .ms [(.m16,.s3,296645653636366),(.m1,.s3,1215060613818785878),(.m1,.s3,4976888274267831176566),(.m1,.s3,140401799637344365990755268)], + .ms2 .s3 .s0 [(.m4,69055021060,16307453950)], + .ms [(.m1,.s3,8053063678),(.m4,.s3,86973087736),(.m10,.s7,86973087742),(.m8,.s2,86973087737)], + .m .m9, + .b 0 [[([257698037684],[(.D7,86973087742)]),([32212254710,16106127359,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,8053063678),(.D16,16307453950)]),([4026531838],[(.D6,69055021060),(.D16,140401799637344365990755268),(.D18,4976888274267831176566),(.D18,1215060613818785878),(.D18,296645653636366),(.D18,72422245948),(.D6,2106199604),(.D16,607319152),(.D6,23640886),(.D16,36384688),(.D6,1083910),(.D16,2175844),(.D6,1225134902),(.D12,4155),(.D16,9205),(.D16,248),(.D6,5)])]], + .ms [(.m2,.s6,128849018842),(.m3,.s6,54760833031),(.m14,.s5,54760833031),(.m4,.s5,128849018836)], + .m .m5, + .b 128849018842 [[([23],[(.D16,54760833031),(.D18,1),(.D15,14294188029),(.D16,68551704580)])]], + .ms [(.m2,.s6,128849018854),(.m3,.s6,54760833028),(.m7,.s5,54760833028),(.m4,.s5,128849018848)], + .m .m5, + .b 128849018854 [[([7],[(.D16,54760833028),(.D6,1)])]], + .ms [(.m2,.s6,128849018858),(.m6,.s6,54760833026),(.m15,.s5,54760833026),(.m11,.s5,128849018852)], + .m .m5, + .b 128849018858 [[([5],[(.D12,54760833026),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,128849018861,54760833027)], + .ms [(.m23,.s1,54760833027),(.m22,.s4,128849018855)], + .m .m24, + .b 128849018861 [[([17],[(.D6,54760833027),(.D6,2)])]], + .ms [(.m2,.s6,128849018870),(.m6,.s6,54760833023),(.m14,.s5,54760833023),(.m11,.s5,128849018864)], + .m .m5, + .b 128849018870 [[([23],[(.D12,54760833023),(.D18,1),(.D17,14294188028),(.D17,68551704580),(.D15,140401799637344365864926148),(.D21,4976888274267799719286),(.D21,1215060613810921558),(.D21,296645651670286),(.D21,72421754428),(.D17,2106076724),(.D15,607288432),(.D17,23633206),(.D15,36382768),(.D17,1083430),(.D15,2175724),(.D17,1225134872),(.D11,4147),(.D6,9204)])]], + .ms [(.m2,.s6,128849018882)], + ] (by decide +kernel) +theorem chunk_31_step : (cfg_31.denote) [qi]⊢* (cfg_32.denote) := + step_chunk [ + .ms [(.m6,.s6,54760833020),(.m7,.s5,54760833020),(.m11,.s5,128849018876)], + .m .m5, + .b 128849018882 [[([219043332081,109521666045,19327352841],[(.D12,54760833020),(.D8,14294188028),(.D6,68551704580)]),([5435817983],[(.D16,140401799637344365864926148),(.D18,4976888274267799719286),(.D18,1215060613810921558),(.D18,296645651670286),(.D18,72421754428),(.D6,2106076724),(.D16,607288432),(.D6,23633206),(.D16,36382768),(.D6,1083430),(.D16,2175724),(.D6,1225134872),(.D12,4148),(.D7,9203),(.D8,247),(.D7,4)])]], + .ms [(.m2,.s6,302795194366)], + .ms2 .s6 .s7 [(.m3,11274289150,3422552062)], + .ms [(.m3,.s6,65833795588),(.m3,.s6,140401799637344365185448900),(.m0,.s6,4976888274267629849974),(.m0,.s6,1215060613768454230),(.m0,.s6,296645641053454)], + .ms2 .s6 .s7 [(.m0,72419100220,2105413172),(.m0,607122544,23591734),(.m0,36372400,1080838),(.m0,2175076,1225134710)], + .ms [(.m12,.s7,4107),(.m0,.s6,9193),(.m3,.s6,245),(.m21,.s3,245),(.m4,.s3,9193),(.m4,.s3,4107)], + .ms2 .s3 .s0 [(.m13,1225134710,2175076),(.m1,1080838,36372400),(.m1,23591734,607122544),(.m1,2105413172,72419100220)], + .ms [(.m16,.s3,296645641053454),(.m1,.s3,1215060613768454230),(.m1,.s3,4976888274267629849974),(.m1,.s3,140401799637344365185448900)], + .ms2 .s3 .s0 [(.m4,65833795588,3422552062)], + .ms [(.m4,.s3,11274289150),(.m4,.s3,302795194360),(.m10,.s7,302795194366),(.m8,.s2,302795194361)], + .m .m9, + .b 0 [[([360777252788],[(.D7,302795194366)]),([45097156598,22548578303,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,11274289150),(.D6,3422552062),(.D6,65833795588)]),([1409286143],[(.D16,140401799637344365185448900),(.D18,4976888274267629849974),(.D18,1215060613768454230),(.D18,296645641053454),(.D18,72419100220),(.D6,2105413172),(.D16,607122544),(.D6,23591734),(.D16,36372400),(.D6,1080838),(.D16,2175076),(.D6,1225134710),(.D12,4107),(.D16,9193),(.D16,245),(.D12,3)])],[([8],[(.D15,257698037767),(.D21,0),(.D19,603979773)])]], + .ms [(.m2,.s6,180388626398),(.m6,.s6,257698037765),(.m7,.s5,257698037765),(.m11,.s5,180388626392)], + .m .m5, + .b 180388626398 [[([41],[(.D12,257698037765),(.D8,1),(.D7,603979772)])],[([14495514502],[(.D17,257698037761),(.D2,603979770)])]], + .ms [(.m2,.s6,187636383670),(.m3,.s6,255886098448),(.m27,.s2,255886098448),(.m1,.s5,187636383664)], + .m .m5, + .b 187636383670 [[([7],[(.D16,255886098448),(.D6,1)])],[([16],[(.D11,255886098446),(.D13,0),(.D6,1)])],[([8],[(.D15,255886098445),(.D17,1),(.D15,0),(.D6,65129152516)])],[([16],[(.D11,255886098443),(.D3,0)])],[([8],[(.D15,255886098442),(.D17,1),(.D21,65129152515),(.D15,140401799637344365009288132),(.D21,4976888274267585809782),(.D21,1215060613757444182),(.D21,296645638300942),(.D21,72418412092),(.D17,2105241140),(.D15,607079536),(.D17,23580982),(.D15,36369712),(.D17,1080166),(.D15,2174908),(.D17,1225134668),(.D11,4096),(.D12,9190)])],[([18],[(.D11,255886098440),(.D13,0),(.D16,65129152515),(.D16,140401799637344365009288132)])],[([37044092902],[(.D17,255886098439),(.D12,65129152516),(.D17,140401799637344365009288132),(.D18,4976888274267585809782),(.D18,1215060613757444182),(.D18,296645638300942),(.D18,72418412092),(.D6,2105241140),(.D16,607079536),(.D6,23580982),(.D16,36369712),(.D6,1080166),(.D16,2174908),(.D6,1225134668),(.D12,4097),(.D13,9190),(.D9,244),(.D13,3)])]], + .ms [(.m2,.s6,206158430158)], + .ms2 .s6 .s7 [(.m3,251255586826,63971524614)], + .ms [(.m0,.s6,140401799637344364719881156),(.m0,.s6,4976888274267513458038),(.m0,.s6,1215060613739356246),(.m0,.s6,296645633778958)], + .ms2 .s6 .s7 [(.m0,72417281596,2104958516),(.m0,607008880,23563318),(.m0,36365296,1079062),(.m0,2174632,1225134599)], + .ms [(.m3,.s6,4081)], + .ms2 .s6 .s7 [(.m6,9185,244)], + .ms2 .s3 .s0 [(.m19,244,9185)], + .ms [(.m17,.s0,4081)], + .ms2 .s3 .s0 [(.m4,1225134599,2174632),(.m1,1079062,36365296),(.m1,23563318,607008880),(.m1,2104958516,72417281596)], + .ms [(.m16,.s3,296645633778958),(.m1,.s3,1215060613739356246),(.m1,.s3,4976888274267513458038),(.m1,.s3,140401799637344364719881156)], + .ms2 .s3 .s0 [(.m4,63971524614,251255586826)], + .ms [(.m1,.s3,206158430152),(.m10,.s7,206158430158),(.m8,.s2,206158430153)], + .m .m9, + .b 0 [[([173946175484],[(.D7,206158430158),(.D17,251255586826),(.D6,63971524614),(.D16,140401799637344364719881156),(.D18,4976888274267513458038),(.D18,1215060613739356246),(.D18,296645633778958),(.D18,72417281596),(.D6,2104958516),(.D16,607008880),(.D6,23563318),(.D16,36365296),(.D6,1079062),(.D16,2174632),(.D6,1225134599),(.D6,4081),(.D12,9185),(.D6,244),(.D16,4)])]], + .ms [(.m2,.s6,86973087742),(.m3,.s6,184415158222)], + .ms2 .s6 .s7 [(.m3,245819768842,62612570118)], + .ms [(.m0,.s6,140401799637344364380142532),(.m0,.s6,4976888274267428523382),(.m0,.s6,1215060613718122582),(.m0,.s6,296645628470542)], + .ms2 .s6 .s7 [(.m0,72415954492,2104626740),(.m0,606925936,23542582),(.m0,36360112,1077766),(.m0,2174308,1225134518)], + .ms [(.m12,.s7,4059),(.m0,.s6,9181),(.m3,.s6,242),(.m20,.s0,242),(.m1,.s3,9181),(.m4,.s3,4059)], + .ms2 .s3 .s0 [(.m13,1225134518,2174308),(.m1,1077766,36360112),(.m1,23542582,606925936),(.m1,2104626740,72415954492)], + .ms [(.m16,.s3,296645628470542),(.m1,.s3,1215060613718122582),(.m1,.s3,4976888274267428523382),(.m1,.s3,140401799637344364380142532)], + .ms2 .s3 .s0 [(.m4,62612570118,245819768842)], + .ms [(.m1,.s3,184415158222),(.m4,.s3,86973087736),(.m10,.s7,86973087742),(.m8,.s2,86973087737)], + .m .m9, + .b 0 [[([347892350966,173946175485,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,86973087742),(.D17,184415158222)]),([43486543870],[(.D16,245819768842),(.D6,62612570118),(.D16,140401799637344364380142532),(.D18,4976888274267428523382),(.D18,1215060613718122582),(.D18,296645628470542),(.D18,72415954492),(.D6,2104626740),(.D16,606925936),(.D6,23542582),(.D16,36360112),(.D6,1077766),(.D16,2174308),(.D6,1225134518),(.D12,4059),(.D16,9181),(.D16,242),(.D6,5)])]], + .ms [(.m2,.s6,347892350965),(.m14,.s5,347892350959)], + .m .m5, + .b 347892350965 [[([5],[(.D18,1),(.D15,162671886285),(.D14,240383950858)])]], + .ms [(.m2,.s6,347892350968),(.m7,.s5,347892350962)], + .m .m5, + .b 347892350968 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,347892350969),(.m15,.s5,347892350963)], + .m .m5, + .b 347892350969 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,347892350970),(.m25,.s2,347892350965)], + .m .m18, + .b 347892350970 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,347892350972),(.m14,.s5,347892350966)], + .m .m5, + .b 347892350972 [[([5],[(.D18,1),(.D17,162671886284),(.D15,240383950858),(.D17,61253615622),(.D15,140401799637344364040403908),(.D21,4976888274267343588726),(.D21,1215060613696888918),(.D21,296645623162126),(.D21,72414627388),(.D17,2104294964),(.D15,606842992),(.D17,23521846),(.D15,36354928),(.D17,1076470),(.D15,2173984),(.D17,1225134437),(.D17,4040),(.D8,9175)])]], + .ms [(.m2,.s6,347892350975),(.m7,.s5,347892350969)], + .m .m5, + .b 347892350975 [[([238370684925],[(.D8,162671886284),(.D16,240383950858),(.D6,61253615622),(.D16,140401799637344364040403908),(.D18,4976888274267343588726),(.D18,1215060613696888918),(.D18,296645623162126),(.D18,72414627388),(.D6,2104294964),(.D16,606842992),(.D6,23521846),(.D16,36354928),(.D6,1076470),(.D16,2173984),(.D6,1225134437),(.D6,4041),(.D9,9175),(.D14,240),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,467077693438,132875550670),(.m0,232934866954,59391344646)], + .ms [(.m0,.s6,140401799637344363574836164),(.m0,.s6,4976888274267227196790),(.m0,.s6,1215060613667790934),(.m0,.s6,296645615887630)], + .ms2 .s6 .s7 [(.m0,72412808764,2103840308),(.m0,606729328,23493430),(.m0,36347824,1074694),(.m0,2173540,1225134326)], + .ms [(.m12,.s7,4011),(.m0,.s6,9169),(.m3,.s6,239),(.m21,.s3,239),(.m4,.s3,9169),(.m4,.s3,4011)], + .ms2 .s3 .s0 [(.m13,1225134326,2173540),(.m1,1074694,36347824),(.m1,23493430,606729328),(.m1,2103840308,72412808764)], + .ms [(.m16,.s3,296645615887630),(.m1,.s3,1215060613667790934),(.m1,.s3,4976888274267227196790),(.m1,.s3,140401799637344363574836164)], + .ms2 .s3 .s0 [(.m4,59391344646,232934866954),(.m1,132875550670,467077693433)], + .ms [(.m26,.s7,467077693438),(.m8,.s2,467077693433)], + .m .m9, + .b 0 [[([953482739708],[(.D7,467077693438),(.D7,132875550669),(.D16,232934866954),(.D6,59391344646),(.D16,140401799637344363574836164),(.D18,4976888274267227196790),(.D18,1215060613667790934),(.D18,296645615887630),(.D18,72412808764),(.D6,2103840308),(.D16,606729328),(.D6,23493430),(.D16,36347824),(.D6,1074694),(.D16,2173540),(.D6,1225134326),(.D12,4011),(.D16,9169),(.D16,239),(.D12,3)])]], + .ms [(.m2,.s6,476741369854)], + .ms2 .s6 .s7 [(.m3,347892350974,103079215054),(.m0,225485783050,57529073670)], + .ms [(.m0,.s6,140401799637344363109268420),(.m0,.s6,4976888274267110804854),(.m0,.s6,1215060613638692950),(.m0,.s6,296645608613134)], + .ms2 .s6 .s7 [(.m0,72410990140,2103385652),(.m0,606615664,23465014),(.m0,36340720,1072918),(.m0,2173096,1225134215)], + .ms [(.m3,.s6,3985)], + .ms2 .s6 .s7 [(.m6,9161,238)], + .ms2 .s3 .s0 [(.m19,238,9161)], + .ms [(.m17,.s0,3985)], + .ms2 .s3 .s0 [(.m4,1225134215,2173096),(.m1,1072918,36340720),(.m1,23465014,606615664),(.m1,2103385652,72410990140)], + .ms [(.m16,.s3,296645608613134),(.m1,.s3,1215060613638692950),(.m1,.s3,4976888274267110804854),(.m1,.s3,140401799637344363109268420)], + .ms2 .s3 .s0 [(.m4,57529073670,225485783050),(.m1,103079215054,347892350974)], + .ms [(.m1,.s3,476741369848),(.m10,.s7,476741369854),(.m8,.s2,476741369849)], + .m .m9, + .b 0 [[([1906965479414,876173328390],[(.D7,476741369854),(.D17,347892350974)]),([173946175487],[(.D6,103079215054),(.D16,225485783050),(.D6,57529073670),(.D16,140401799637344363109268420),(.D18,4976888274267110804854),(.D18,1215060613638692950),(.D18,296645608613134),(.D18,72410990140),(.D6,2103385652),(.D16,606615664),(.D6,23465014),(.D16,36340720),(.D6,1072918),(.D16,2173096),(.D6,1225134215),(.D6,3985),(.D12,9161),(.D6,238),(.D16,4)])]], + .ms [(.m2,.s6,1391569403902),(.m3,.s6,128849018878)], + .ms2 .s6 .s7 [(.m3,260919263230,81335943118),(.m0,220049965066,56170119174)], + .ms [(.m0,.s6,140401799637344362769529796),(.m0,.s6,4976888274267025870198),(.m0,.s6,1215060613617459286),(.m0,.s6,296645603304718)], + .ms2 .s6 .s7 [(.m0,72409663036,2103053876),(.m0,606532720,23444278),(.m0,36335536,1071622),(.m0,2172772,1225134134)], + .ms [(.m12,.s7,3963),(.m0,.s6,9157),(.m3,.s6,236),(.m20,.s0,236),(.m1,.s3,9157),(.m4,.s3,3963)], + .ms2 .s3 .s0 [(.m13,1225134134,2172772),(.m1,1071622,36335536),(.m1,23444278,606532720),(.m1,2103053876,72409663036)], + .ms [(.m16,.s3,296645603304718),(.m1,.s3,1215060613617459286),(.m1,.s3,4976888274267025870198),(.m1,.s3,140401799637344362769529796)], + .ms2 .s3 .s0 [(.m4,56170119174,220049965066),(.m1,81335943118,260919263230)], + .ms [(.m1,.s3,128849018878),(.m4,.s3,1391569403896),(.m10,.s7,1391569403902),(.m8,.s2,1391569403897)], + .m .m9, + .b 0 [[([4123168604084],[(.D7,1391569403902)]),([515396075510,257698037759,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,128849018878),(.D16,260919263230)]),([64424509438],[(.D6,81335943118),(.D16,220049965066),(.D6,56170119174),(.D16,140401799637344362769529796),(.D18,4976888274267025870198),(.D18,1215060613617459286),(.D18,296645603304718),(.D18,72409663036),(.D6,2103053876),(.D16,606532720),(.D6,23444278),(.D16,36335536),(.D6,1071622),(.D16,2172772),(.D6,1225134134),(.D12,3963),(.D16,9157),(.D16,236),(.D6,5)])]], + .ms [(.m2,.s6,2061584302042),(.m3,.s6,876173328391),(.m14,.s5,876173328391),(.m4,.s5,2061584302036)], + .m .m5, + .b 2061584302042 [[([23],[(.D16,876173328391),(.D18,1),(.D15,228707008509),(.D16,73282879438)])]], + .ms [(.m2,.s6,2061584302054),(.m3,.s6,876173328388),(.m7,.s5,876173328388),(.m4,.s5,2061584302048)], + .m .m5, + .b 2061584302054 [[([7],[(.D16,876173328388),(.D6,1)])]], + .ms [(.m2,.s6,2061584302058),(.m6,.s6,876173328386),(.m15,.s5,876173328386),(.m11,.s5,2061584302052)], + .m .m5, + .b 2061584302058 [[([5],[(.D12,876173328386),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,2061584302061,876173328387)], + .ms [(.m23,.s1,876173328387),(.m22,.s4,2061584302055)], + .m .m24, + .b 2061584302061 [[([17],[(.D6,876173328387),(.D6,2)])]], + .ms [(.m2,.s6,2061584302070),(.m6,.s6,876173328383),(.m14,.s5,876173328383),(.m11,.s5,2061584302064)], + .m .m5, + .b 2061584302070 [[([23],[(.D12,876173328383),(.D18,1),(.D17,228707008508),(.D17,73282879438),(.D15,218036699146),(.D17,55666802694),(.D15,140401799637344362643700676),(.D21,4976888274266994412918),(.D21,1215060613609594966),(.D21,296645601338638),(.D21,72409171516),(.D17,2102930996),(.D15,606502000),(.D17,23436598),(.D15,36333616),(.D17,1071142),(.D15,2172652),(.D17,1225134104),(.D11,3955),(.D6,9156)])]], + .ms [(.m2,.s6,2061584302082),(.m6,.s6,876173328380),(.m7,.s5,876173328380),(.m11,.s5,2061584302076)], + .m .m5, + .b 2061584302082 [[([3504693313521,1752346656765,309237645321],[(.D12,876173328380),(.D8,228707008508),(.D6,73282879438),(.D16,218036699146)]),([21743271935],[(.D6,55666802694),(.D16,140401799637344362643700676),(.D18,4976888274266994412918),(.D18,1215060613609594966),(.D18,296645601338638),(.D18,72409171516),(.D6,2102930996),(.D16,606502000),(.D6,23436598),(.D16,36333616),(.D6,1071142),(.D16,2172652),(.D6,1225134104),(.D12,3956),(.D7,9155),(.D8,235),(.D7,4)])]], + .ms [(.m2,.s6,4844723109886)], + .ms2 .s6 .s7 [(.m3,180388626430,54760833022)], + .ms [(.m3,.s6,29796335566)], + .ms2 .s6 .s7 [(.m3,207165063178,52948893702)], + .ms [(.m0,.s6,140401799637344361964223428),(.m0,.s6,4976888274266824543606),(.m0,.s6,1215060613567127638),(.m0,.s6,296645590721806)], + .ms2 .s6 .s7 [(.m0,72406517308,2102267444),(.m0,606336112,23395126),(.m0,36323248,1068550),(.m0,2172004,1225133942)], + .ms [(.m12,.s7,3915),(.m0,.s6,9145),(.m3,.s6,233),(.m21,.s3,233),(.m4,.s3,9145),(.m4,.s3,3915)], + .ms2 .s3 .s0 [(.m13,1225133942,2172004),(.m1,1068550,36323248),(.m1,23395126,606336112),(.m1,2102267444,72406517308)], + .ms [(.m16,.s3,296645590721806),(.m1,.s3,1215060613567127638),(.m1,.s3,4976888274266824543606),(.m1,.s3,140401799637344361964223428)], + .ms2 .s3 .s0 [(.m4,52948893702,207165063178),(.m1,29796335566,54760833022)], + .ms [(.m4,.s3,180388626430),(.m4,.s3,4844723109880),(.m10,.s7,4844723109886),(.m8,.s2,4844723109881)], + .m .m9, + .b 0 [[([5772436045748],[(.D7,4844723109886)]),([721554505718,360777252863,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,180388626430),(.D6,54760833022),(.D6,29796335566)]),([22548578303],[(.D16,207165063178),(.D6,52948893702),(.D16,140401799637344361964223428),(.D18,4976888274266824543606),(.D18,1215060613567127638),(.D18,296645590721806),(.D18,72406517308),(.D6,2102267444),(.D16,606336112),(.D6,23395126),(.D16,36323248),(.D6,1068550),(.D16,2172004),(.D6,1225133942),(.D12,3915),(.D16,9145),(.D16,233),(.D12,3)])],[([8],[(.D15,4123168604167),(.D21,0),(.D19,9663676413)])]], + .ms [(.m2,.s6,2886218022878),(.m6,.s6,4123168604165),(.m7,.s5,4123168604165),(.m11,.s5,2886218022872)], + .m .m5, + .b 2886218022878 [[([41],[(.D12,4123168604165),(.D8,1),(.D7,9663676412)])],[([231928233862],[(.D17,4123168604161),(.D2,9663676410)])]], + .ms [(.m2,.s6,3002182139830),(.m3,.s6,4094177574928),(.m27,.s2,4094177574928),(.m1,.s5,3002182139824)], + .m .m5, + .b 3002182139830 [[([7],[(.D16,4094177574928), + (.D6,1)])], + [([16],[(.D11,4094177574926), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,4094177574925), + (.D17,1), + (.D15,0), + (.D6,18522046414)])], + [([16],[(.D11,4094177574923), + (.D3,0)])], + [([8],[(.D15,4094177574922), + (.D17,1), + (.D21,18522046413), + (.D15,204346490890), + (.D17,52244250630), + (.D15,140401799637344361788062660), + (.D21,4976888274266780503414), + (.D21,1215060613556117590), + (.D21,296645587969294), + (.D21,72405829180), + (.D17,2102095412), + (.D15,606293104), + (.D17,23384374), + (.D15,36320560), + (.D17,1067878), + (.D15,2171836), + (.D17,1225133900), + (.D11,3904), + (.D12,9142)])], + [([18],[(.D11,4094177574920), + (.D13,0), + (.D16,18522046413), + (.D16,204346490890)])], + [([592705485252],[(.D17,4094177574919)]), + ([74088185659,37044092831,18522046416,9261023208,4630511604,2315255799,1157627901,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,18522046414), + (.D17,204346490890)]), + ([9261023207],[(.D6,52244250630), + (.D16,140401799637344361788062660), + (.D18,4976888274266780503414), + (.D18,1215060613556117590), + (.D18,296645587969294), + (.D18,72405829180), + (.D6,2102095412), + (.D16,606293104), + (.D6,23384374), + (.D16,36320560), + (.D6,1067878), + (.D16,2171836), + (.D6,1225133900), + (.D12,3905), + (.D13,9142), + (.D9,232), + (.D13,3)])], + [([10],[(.D17,4020089389263), + (.D21,0), + (.D19,199715979286)])]], + .ms [(.m2,.s6,3298534882498),(.m3,.s6,4020089389261),(.m7,.s5,4020089389261),(.m4,.s5,3298534882492)], + .m .m5, + .b 3298534882498 [[([43],[(.D16,4020089389261),(.D8,1),(.D7,199715979285)])],[([4793183502810],[(.D11,4020089389254),(.D2,199715979283)])]], + .ms2 .s6 .s7 [(.m2,5695126633925,3420941451405)], + .ms [(.m29,.s2,3420941451405),(.m4,.s5,5695126633919)], + .m .m5, + .b 5695126633925 [[([9],[(.D6,3420941451405),(.D6,1)])],[([20],[(.D15,3420941451403),(.D13,0),(.D10,51086622728),(.D9,140401799637344361498655684)])],[([36],[(.D11,3420941451399)]),([7,2],[(.D12,1),(.D6,51086622728)])]], + .ms [(.m2,.s6,5695126633958),(.m6,.s6,3420941451395),(.m15,.s5,3420941451395),(.m11,.s5,5695126633952)], + .m .m5, + .b 5695126633958 [[([5],[(.D12,3420941451395),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,5695126633961,3420941451396)], + .ms [(.m23,.s1,3420941451396),(.m22,.s4,5695126633955)], + .m .m24, + .b 5695126633961 [[([17],[(.D6,3420941451396),(.D6,2)])],[([6],[(.D11,3420941451392),(.D21,0),(.D7,51086622726)])]], + .ms2 .s6 .s7 [(.m2,5695126633973,3420941451393)], + .ms2 .s5 .s2 [(.m28,3420941451393,5695126633968)], + .m .m18, + .b 5695126633973 [[([45],[(.D6,3420941451393),(.D8,1),(.D17,51086622725),(.D10,140401799637344361498655683)])],[([36],[(.D15,3420941451386)]),([7,2],[(.D12,1),(.D17,51086622724)]),([1],[(.D11,140401799637344361498655683),(.D20,4976888274266708151670)])],[([8],[(.D15,3420941451382),(.D21,0),(.D17,51086622723),(.D12,140401799637344361498655684)])]], + .ms [(.m2,.s6,5695126634018),(.m6,.s6,3420941451380),(.m7,.s5,3420941451380),(.m11,.s5,5695126634012)], + .m .m5, + .b 5695126634018 [[([39],[(.D12,3420941451380),(.D8,51086622724),(.D13,140401799637344361498655684),(.D21,4976888274266708151670),(.D21,1215060613538029654),(.D21,296645583447310),(.D21,72404698684),(.D17,2101812788),(.D15,606222448),(.D17,23366710),(.D15,36316144),(.D17,1066774),(.D15,2171560),(.D17,1225133831),(.D17,3889),(.D11,9137),(.D17,232),(.D15,3)])]], + .ms [(.m2,.s6,5695126634038)], + .ms2 .s6 .s7 [(.m3,3420941451376,51086622724)], + .ms [(.m0,.s6,140401799637344361498655684),(.m0,.s6,4976888274266708151670),(.m0,.s6,1215060613538029654),(.m0,.s6,296645583447310)], + .ms2 .s6 .s7 [(.m0,72404698684,2101812788),(.m0,606222448,23366710),(.m0,36316144,1066774),(.m0,2171560,1225133831)], + .ms [(.m3,.s6,3889)], + .ms2 .s6 .s7 [(.m6,9137,232)], + .ms2 .s3 .s0 [(.m19,232,9137)], + .ms [(.m17,.s0,3889)], + .ms2 .s3 .s0 [(.m4,1225133831,2171560),(.m1,1066774,36316144),(.m1,23366710,606222448),(.m1,2101812788,72404698684)], + .ms [(.m16,.s3,296645583447310),(.m1,.s3,1215060613538029654),(.m1,.s3,4976888274266708151670),(.m1,.s3,140401799637344361498655684)], + .ms2 .s3 .s0 [(.m4,51086622724,3420941451376)], + .ms [(.m1,.s3,5695126634032),(.m10,.s7,5695126634038),(.m8,.s2,5695126634033)], + .m .m9, + .b 0 [[([173946175484],[(.D7,5695126634038),(.D17,3420941451376),(.D6,51086622724),(.D16,140401799637344361498655684),(.D18,4976888274266708151670),(.D18,1215060613538029654),(.D18,296645583447310),(.D18,72404698684),(.D6,2101812788),(.D16,606222448),(.D6,23366710),(.D16,36316144),(.D6,1066774),(.D16,2171560),(.D6,1225133831),(.D6,3889),(.D12,9137),(.D6,232),(.D16,4)])]], + .ms [(.m2,.s6,86973087742),(.m3,.s6,5673383362102)], + .ms2 .s6 .s7 [(.m3,3415505633392,49727668228)], + .ms [(.m0,.s6,140401799637344361158917060),(.m0,.s6,4976888274266623217014),(.m0,.s6,1215060613516795990),(.m0,.s6,296645578138894)], + .ms2 .s6 .s7 [(.m0,72403371580,2101481012),(.m0,606139504,23345974),(.m0,36310960,1065478),(.m0,2171236,1225133750)], + .ms [(.m12,.s7,3867),(.m0,.s6,9133),(.m3,.s6,230),(.m20,.s0,230),(.m1,.s3,9133),(.m4,.s3,3867)], + .ms2 .s3 .s0 [(.m13,1225133750,2171236),(.m1,1065478,36310960),(.m1,23345974,606139504),(.m1,2101481012,72403371580)], + .ms [(.m16,.s3,296645578138894),(.m1,.s3,1215060613516795990),(.m1,.s3,4976888274266623217014),(.m1,.s3,140401799637344361158917060)], + .ms2 .s3 .s0 [(.m4,49727668228,3415505633392)], + .ms [(.m1,.s3,5673383362102),(.m4,.s3,86973087736),(.m10,.s7,86973087742),(.m8,.s2,86973087737)], + .m .m9, + .b 0 [[([347892350966,173946175485,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,86973087742),(.D17,5673383362102)]),([43486543870],[(.D16,3415505633392),(.D6,49727668228),(.D16,140401799637344361158917060),(.D18,4976888274266623217014),(.D18,1215060613516795990),(.D18,296645578138894),(.D18,72403371580),(.D6,2101481012),(.D16,606139504),(.D6,23345974),(.D16,36310960),(.D6,1065478),(.D16,2171236),(.D6,1225133750),(.D12,3867),(.D16,9133),(.D16,230),(.D6,5)])]], + .ms [(.m2,.s6,347892350965),(.m14,.s5,347892350959)], + .m .m5, + .b 347892350965 [[([5],[(.D18,1),(.D15,5651640090165),(.D14,3410069815408)])]], + .ms [(.m2,.s6,347892350968),(.m7,.s5,347892350962)], + .m .m5, + .b 347892350968 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,347892350969),(.m15,.s5,347892350963)], + .m .m5, + .b 347892350969 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,347892350970),(.m25,.s2,347892350965)], + .m .m18, + .b 347892350970 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,347892350972),(.m14,.s5,347892350966)], + .m .m86, + ] (by decide +kernel) +theorem chunk_32_step : (cfg_32.denote) [qi]⊢* (cfg_33.denote) := + step_chunk [ + .m .m87, + .b 347892350972 [[([5],[(.D18,1),(.D17,5651640090164),(.D15,3410069815408),(.D17,48368713732),(.D15,140401799637344360819178436),(.D21,4976888274266538282358),(.D21,1215060613495562326),(.D21,296645572830478),(.D21,72402044476),(.D17,2101149236),(.D15,606056560),(.D17,23325238),(.D15,36305776),(.D17,1064182),(.D15,2170912),(.D17,1225133669),(.D17,3848),(.D8,9127)])]], + .ms [(.m2,.s6,347892350975),(.m7,.s5,347892350969)], + .m .m5, + .b 347892350975 [[([238370684925],[(.D8,5651640090164),(.D16,3410069815408),(.D6,48368713732),(.D16,140401799637344360819178436),(.D18,4976888274266538282358),(.D18,1215060613495562326),(.D18,296645572830478),(.D18,72402044476),(.D6,2101149236),(.D16,606056560),(.D6,23325238),(.D16,36305776),(.D6,1064182),(.D16,2170912),(.D6,1225133669),(.D6,3849),(.D9,9127),(.D14,228),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,467077693438,5621843754550),(.m0,3402620731504,46506442756)], + .ms [(.m0,.s6,140401799637344360353610692),(.m0,.s6,4976888274266421890422),(.m0,.s6,1215060613466464342),(.m0,.s6,296645565555982)], + .ms2 .s6 .s7 [(.m0,72400225852,2100694580),(.m0,605942896,23296822),(.m0,36298672,1062406),(.m0,2170468,1225133558)], + .ms [(.m12,.s7,3819),(.m0,.s6,9121),(.m3,.s6,227),(.m21,.s3,227),(.m4,.s3,9121),(.m4,.s3,3819)], + .ms2 .s3 .s0 [(.m13,1225133558,2170468),(.m1,1062406,36298672),(.m1,23296822,605942896),(.m1,2100694580,72400225852)], + .ms [(.m16,.s3,296645565555982),(.m1,.s3,1215060613466464342),(.m1,.s3,4976888274266421890422),(.m1,.s3,140401799637344360353610692)], + .ms2 .s3 .s0 [(.m4,46506442756,3402620731504),(.m1,5621843754550,467077693433)], + .ms [(.m26,.s7,467077693438),(.m8,.s2,467077693433)], + .m .m9, + .b 0 [[([953482739708],[(.D7,467077693438),(.D7,5621843754549),(.D16,3402620731504),(.D6,46506442756),(.D16,140401799637344360353610692),(.D18,4976888274266421890422),(.D18,1215060613466464342),(.D18,296645565555982),(.D18,72400225852),(.D6,2100694580),(.D16,605942896),(.D6,23296822),(.D16,36298672),(.D6,1062406),(.D16,2170468),(.D6,1225133558),(.D12,3819),(.D16,9121),(.D16,227),(.D12,3)])]], + .ms [(.m2,.s6,476741369854)], + .ms2 .s6 .s7 [(.m3,347892350974,5592047418934),(.m0,3395171647600,44644171780)], + .ms [(.m0,.s6,140401799637344359888042948),(.m0,.s6,4976888274266305498486),(.m0,.s6,1215060613437366358),(.m0,.s6,296645558281486)], + .ms2 .s6 .s7 [(.m0,72398407228,2100239924),(.m0,605829232,23268406),(.m0,36291568,1060630),(.m0,2170024,1225133447)], + .ms [(.m3,.s6,3793)], + .ms2 .s6 .s7 [(.m6,9113,226)], + .ms2 .s3 .s0 [(.m19,226,9113)], + .ms [(.m17,.s0,3793)], + .ms2 .s3 .s0 [(.m4,1225133447,2170024),(.m1,1060630,36291568),(.m1,23268406,605829232),(.m1,2100239924,72398407228)], + .ms [(.m16,.s3,296645558281486),(.m1,.s3,1215060613437366358),(.m1,.s3,4976888274266305498486),(.m1,.s3,140401799637344359888042948)], + .ms2 .s3 .s0 [(.m4,44644171780,3395171647600),(.m1,5592047418934,347892350974)], + .ms [(.m1,.s3,476741369848),(.m10,.s7,476741369854),(.m8,.s2,476741369849)], + .m .m9, + .b 0 [[([1906965479414,876173328390],[(.D7,476741369854),(.D17,347892350974)]),([173946175487],[(.D6,5592047418934),(.D16,3395171647600),(.D6,44644171780),(.D16,140401799637344359888042948),(.D18,4976888274266305498486),(.D18,1215060613437366358),(.D18,296645558281486),(.D18,72398407228),(.D6,2100239924),(.D16,605829232),(.D6,23268406),(.D16,36291568),(.D6,1060630),(.D16,2170024),(.D6,1225133447),(.D6,3793),(.D12,9113),(.D6,226),(.D16,4)])]], + .ms [(.m2,.s6,1391569403902),(.m3,.s6,128849018878)], + .ms2 .s6 .s7 [(.m3,260919263230,5570304146998),(.m0,3389735829616,43285217284)], + .ms [(.m0,.s6,140401799637344359548304324),(.m0,.s6,4976888274266220563830),(.m0,.s6,1215060613416132694),(.m0,.s6,296645552973070)], + .ms2 .s6 .s7 [(.m0,72397080124,2099908148),(.m0,605746288,23247670),(.m0,36286384,1059334),(.m0,2169700,1225133366)], + .ms [(.m12,.s7,3771),(.m0,.s6,9109),(.m3,.s6,224),(.m20,.s0,224),(.m1,.s3,9109),(.m4,.s3,3771)], + .ms2 .s3 .s0 [(.m13,1225133366,2169700),(.m1,1059334,36286384),(.m1,23247670,605746288),(.m1,2099908148,72397080124)], + .ms [(.m16,.s3,296645552973070),(.m1,.s3,1215060613416132694),(.m1,.s3,4976888274266220563830),(.m1,.s3,140401799637344359548304324)], + .ms2 .s3 .s0 [(.m4,43285217284,3389735829616),(.m1,5570304146998,260919263230)], + .ms [(.m1,.s3,128849018878),(.m4,.s3,1391569403896),(.m10,.s7,1391569403902),(.m8,.s2,1391569403897)], + .m .m9, + .b 0 [[([4123168604084],[(.D7,1391569403902)]),([515396075510,257698037759,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,128849018878),(.D16,260919263230)]),([64424509438],[(.D6,5570304146998),(.D16,3389735829616),(.D6,43285217284),(.D16,140401799637344359548304324),(.D18,4976888274266220563830),(.D18,1215060613416132694),(.D18,296645552973070),(.D18,72397080124),(.D6,2099908148),(.D16,605746288),(.D6,23247670),(.D16,36286384),(.D6,1059334),(.D16,2169700),(.D6,1225133366),(.D12,3771),(.D16,9109),(.D16,224),(.D6,5)])]], + .ms [(.m2,.s6,2061584302042),(.m3,.s6,876173328391),(.m14,.s5,876173328391),(.m4,.s5,2061584302036)], + .m .m5, + .b 2061584302042 [[([23],[(.D16,876173328391),(.D18,1),(.D15,228707008509),(.D16,5562251083318)])]], + .ms [(.m2,.s6,2061584302054),(.m3,.s6,876173328388),(.m7,.s5,876173328388),(.m4,.s5,2061584302048)], + .m .m5, + .b 2061584302054 [[([7],[(.D16,876173328388),(.D6,1)])]], + .ms [(.m2,.s6,2061584302058),(.m6,.s6,876173328386),(.m15,.s5,876173328386),(.m11,.s5,2061584302052)], + .m .m5, + .b 2061584302058 [[([5],[(.D12,876173328386),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,2061584302061,876173328387)], + .ms [(.m23,.s1,876173328387),(.m22,.s4,2061584302055)], + .m .m24, + .b 2061584302061 [[([17],[(.D6,876173328387),(.D6,2)])]], + .ms [(.m2,.s6,2061584302070),(.m6,.s6,876173328383),(.m14,.s5,876173328383),(.m11,.s5,2061584302064)], + .m .m5, + .b 2061584302070 [[([23],[(.D12,876173328383),(.D18,1),(.D17,228707008508),(.D17,5562251083318),(.D15,3387722563696),(.D17,42781900804),(.D15,140401799637344359422475204),(.D21,4976888274266189106550),(.D21,1215060613408268374),(.D21,296645551006990),(.D21,72396588604),(.D17,2099785268),(.D15,605715568),(.D17,23239990),(.D15,36284464),(.D17,1058854),(.D15,2169580),(.D17,1225133336),(.D11,3763),(.D6,9108)])]], + .ms [(.m2,.s6,2061584302082),(.m6,.s6,876173328380),(.m7,.s5,876173328380),(.m11,.s5,2061584302076)], + .m .m5, + .b 2061584302082 [[([3504693313521,1752346656765,309237645321],[(.D12,876173328380),(.D8,228707008508),(.D6,5562251083318)]),([86973087743],[(.D16,3387722563696),(.D6,42781900804),(.D16,140401799637344359422475204),(.D18,4976888274266189106550),(.D18,1215060613408268374),(.D18,296645551006990),(.D18,72396588604),(.D6,2099785268),(.D16,605715568),(.D6,23239990),(.D16,36284464),(.D6,1058854),(.D16,2169580),(.D6,1225133336),(.D12,3764),(.D7,9107),(.D8,223),(.D7,4)])]], + .ms [(.m2,.s6,4844723109886)], + .ms2 .s6 .s7 [(.m3,180388626430,54760833022)], + .ms [(.m3,.s6,5518764539446)], + .ms2 .s6 .s7 [(.m3,3376850927728,40063991812)], + .ms [(.m0,.s6,140401799637344358742997956),(.m0,.s6,4976888274266019237238),(.m0,.s6,1215060613365801046),(.m0,.s6,296645540390158)], + .ms2 .s6 .s7 [(.m0,72393934396,2099121716),(.m0,605549680,23198518),(.m0,36274096,1056262),(.m0,2168932,1225133174)], + .ms [(.m12,.s7,3723),(.m0,.s6,9097),(.m3,.s6,221),(.m21,.s3,221),(.m4,.s3,9097),(.m4,.s3,3723)], + .ms2 .s3 .s0 [(.m13,1225133174,2168932),(.m1,1056262,36274096),(.m1,23198518,605549680),(.m1,2099121716,72393934396)], + .ms [(.m16,.s3,296645540390158),(.m1,.s3,1215060613365801046),(.m1,.s3,4976888274266019237238),(.m1,.s3,140401799637344358742997956)], + .ms2 .s3 .s0 [(.m4,40063991812,3376850927728),(.m1,5518764539446,54760833022)], + .ms [(.m4,.s3,180388626430),(.m4,.s3,4844723109880),(.m10,.s7,4844723109886),(.m8,.s2,4844723109881)], + .m .m9, + .b 0 [[([5772436045748],[(.D7,4844723109886)]),([721554505718,360777252863,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,180388626430),(.D6,54760833022),(.D6,5518764539446)]),([22548578303],[(.D16,3376850927728),(.D6,40063991812),(.D16,140401799637344358742997956),(.D18,4976888274266019237238),(.D18,1215060613365801046),(.D18,296645540390158),(.D18,72393934396),(.D6,2099121716),(.D16,605549680),(.D6,23198518),(.D16,36274096),(.D6,1056262),(.D16,2168932),(.D6,1225133174),(.D12,3723),(.D16,9097),(.D16,221),(.D12,3)])],[([8],[(.D15,4123168604167),(.D21,0),(.D19,9663676413)])]], + .ms [(.m2,.s6,2886218022878),(.m6,.s6,4123168604165),(.m7,.s5,4123168604165),(.m11,.s5,2886218022872)], + .m .m5, + .b 2886218022878 [[([41],[(.D12,4123168604165),(.D8,1),(.D7,9663676412)])],[([231928233862],[(.D17,4123168604161),(.D2,9663676410)])]], + .ms [(.m2,.s6,3002182139830),(.m3,.s6,4094177574928),(.m27,.s2,4094177574928),(.m1,.s5,3002182139824)], + .m .m5, + .b 3002182139830 [[([7],[(.D16,4094177574928), + (.D6,1)])], + [([16],[(.D11,4094177574926), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,4094177574925), + (.D17,1), + (.D15,0), + (.D6,5507490250294)])], + [([16],[(.D11,4094177574923), + (.D3,0)])], + [([8],[(.D15,4094177574922), + (.D17,1), + (.D21,5507490250293), + (.D15,3374032355440), + (.D17,39359348740), + (.D15,140401799637344358566837188), + (.D21,4976888274265975197046), + (.D21,1215060613354790998), + (.D21,296645537637646), + (.D21,72393246268), + (.D17,2098949684), + (.D15,605506672), + (.D17,23187766), + (.D15,36271408), + (.D17,1055590), + (.D15,2168764), + (.D17,1225133132), + (.D11,3712), + (.D12,9094)])], + [([18],[(.D11,4094177574920), + (.D13,0), + (.D16,5507490250293), + (.D16,3374032355440)])], + [([592705486822],[(.D17,4094177574919), + (.D12,5507490250294), + (.D17,3374032355440), + (.D6,39359348740), + (.D16,140401799637344358566837188), + (.D18,4976888274265975197046), + (.D18,1215060613354790998), + (.D18,296645537637646), + (.D18,72393246268), + (.D6,2098949684), + (.D16,605506672), + (.D6,23187766), + (.D16,36271408), + (.D6,1055590), + (.D16,2168764), + (.D6,1225133132), + (.D12,3713), + (.D13,9094), + (.D9,220), + (.D13,3)])]], + .ms [(.m2,.s6,3298534883278)], + .ms2 .s6 .s7 [(.m3,4020089389066,5488968203832),(.m0,3369401843824,38201720836)], + .ms [(.m0,.s6,140401799637344358277430212),(.m0,.s6,4976888274265902845302),(.m0,.s6,1215060613336703062),(.m0,.s6,296645533115662)], + .ms2 .s6 .s7 [(.m0,72392115772,2098667060),(.m0,605436016,23170102),(.m0,36266992,1054486),(.m0,2168488,1225133063)], + .ms [(.m3,.s6,3697)], + .ms2 .s6 .s7 [(.m6,9089,220)], + .ms2 .s3 .s0 [(.m19,220,9089)], + .ms [(.m17,.s0,3697)], + .ms2 .s3 .s0 [(.m4,1225133063,2168488),(.m1,1054486,36266992),(.m1,23170102,605436016),(.m1,2098667060,72392115772)], + .ms [(.m16,.s3,296645533115662),(.m1,.s3,1215060613336703062),(.m1,.s3,4976888274265902845302),(.m1,.s3,140401799637344358277430212)], + .ms2 .s3 .s0 [(.m4,38201720836,3369401843824),(.m1,5488968203832,4020089389066)], + .ms [(.m1,.s3,3298534883272),(.m10,.s7,3298534883278),(.m8,.s2,3298534883273)], + .m .m9, + .b 0 [[([2783138807804],[(.D7,3298534883278),(.D17,4020089389066),(.D6,5488968203832),(.D16,3369401843824),(.D6,38201720836),(.D16,140401799637344358277430212),(.D18,4976888274265902845302),(.D18,1215060613336703062),(.D18,296645533115662),(.D18,72392115772),(.D6,2098667060),(.D16,605436016),(.D6,23170102),(.D16,36266992),(.D6,1054486),(.D16,2168488),(.D6,1225133063),(.D6,3697),(.D12,9089),(.D6,220),(.D16,4)])]], + .ms [(.m2,.s6,1391569403902),(.m3,.s6,2950642532302)], + .ms2 .s6 .s7 [(.m3,3933116301322,5467224931896),(.m0,3363966025840,36842766340)], + .ms [(.m0,.s6,140401799637344357937691588),(.m0,.s6,4976888274265817910646),(.m0,.s6,1215060613315469398),(.m0,.s6,296645527807246)], + .ms2 .s6 .s7 [(.m0,72390788668,2098335284),(.m0,605353072,23149366),(.m0,36261808,1053190),(.m0,2168164,1225132982)], + .ms [(.m12,.s7,3675),(.m0,.s6,9085),(.m3,.s6,218),(.m20,.s0,218),(.m1,.s3,9085),(.m4,.s3,3675)], + .ms2 .s3 .s0 [(.m13,1225132982,2168164),(.m1,1053190,36261808),(.m1,23149366,605353072),(.m1,2098335284,72390788668)], + .ms [(.m16,.s3,296645527807246),(.m1,.s3,1215060613315469398),(.m1,.s3,4976888274265817910646),(.m1,.s3,140401799637344357937691588)], + .ms2 .s3 .s0 [(.m4,36842766340,3363966025840),(.m1,5467224931896,3933116301322)], + .ms [(.m1,.s3,2950642532302),(.m4,.s3,1391569403896),(.m10,.s7,1391569403902),(.m8,.s2,1391569403897)], + .m .m9, + .b 0 [[([5566277615606,2783138807805,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,1391569403902),(.D17,2950642532302)]),([695784701950],[(.D16,3933116301322),(.D6,5467224931896),(.D16,3363966025840),(.D6,36842766340),(.D16,140401799637344357937691588),(.D18,4976888274265817910646),(.D18,1215060613315469398),(.D18,296645527807246),(.D18,72390788668),(.D6,2098335284),(.D16,605353072),(.D6,23149366),(.D16,36261808),(.D6,1053190),(.D16,2168164),(.D6,1225132982),(.D12,3675),(.D16,9085),(.D16,218),(.D6,5)])]], + .ms [(.m2,.s6,5566277615605),(.m14,.s5,5566277615599)], + .m .m5, + .b 5566277615605 [[([5],[(.D18,1),(.D15,2602750181325),(.D14,3846143213578)])]], + .ms [(.m2,.s6,5566277615608),(.m7,.s5,5566277615602)], + .m .m5, + .b 5566277615608 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,5566277615609),(.m15,.s5,5566277615603)], + .m .m5, + .b 5566277615609 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,5566277615610),(.m25,.s2,5566277615605)], + .m .m18, + .b 5566277615610 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,5566277615612),(.m14,.s5,5566277615606)], + .m .m5, + .b 5566277615612 [[([5],[(.D18,1),(.D17,2602750181324),(.D15,3846143213578),(.D17,5445481659960),(.D15,3358530207856),(.D17,35483811844),(.D15,140401799637344357597952964),(.D21,4976888274265732975990),(.D21,1215060613294235734),(.D21,296645522498830),(.D21,72389461564),(.D17,2098003508),(.D15,605270128),(.D17,23128630),(.D15,36256624),(.D17,1051894),(.D15,2167840),(.D17,1225132901),(.D17,3656),(.D8,9079)])]], + .ms [(.m2,.s6,5566277615615),(.m7,.s5,5566277615609)], + .m .m5, + .b 5566277615615 [[([3813930958845],[(.D8,2602750181324),(.D16,3846143213578),(.D6,5445481659960),(.D16,3358530207856),(.D6,35483811844),(.D16,140401799637344357597952964),(.D18,4976888274265732975990),(.D18,1215060613294235734),(.D18,296645522498830),(.D18,72389461564),(.D6,2098003508),(.D16,605270128),(.D6,23128630),(.D16,36256624),(.D6,1051894),(.D16,2167840),(.D6,1225132901),(.D6,3657),(.D9,9079),(.D14,216),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,7473243095038,2126008811470),(.m0,3726957871114,5415685324344),(.m0,3351081123952,33621540868)], + .ms [(.m0,.s6,140401799637344357132385220),(.m0,.s6,4976888274265616584054),(.m0,.s6,1215060613265137750),(.m0,.s6,296645515224334)], + .ms2 .s6 .s7 [(.m0,72387642940,2097548852),(.m0,605156464,23100214),(.m0,36249520,1050118),(.m0,2167396,1225132790)], + .ms [(.m12,.s7,3627),(.m0,.s6,9073),(.m3,.s6,215),(.m21,.s3,215),(.m4,.s3,9073),(.m4,.s3,3627)], + .ms2 .s3 .s0 [(.m13,1225132790,2167396),(.m1,1050118,36249520),(.m1,23100214,605156464),(.m1,2097548852,72387642940)], + .ms [(.m16,.s3,296645515224334),(.m1,.s3,1215060613265137750),(.m1,.s3,4976888274265616584054),(.m1,.s3,140401799637344357132385220)], + .ms2 .s3 .s0 [(.m4,33621540868,3351081123952),(.m1,5415685324344,3726957871114),(.m1,2126008811470,7473243095033)], + .ms [(.m26,.s7,7473243095038),(.m8,.s2,7473243095033)], + .m .m9, + .b 0 [[([15255723835388],[(.D7,7473243095038),(.D7,2126008811469),(.D16,3726957871114),(.D6,5415685324344),(.D16,3351081123952),(.D6,33621540868),(.D16,140401799637344357132385220),(.D18,4976888274265616584054),(.D18,1215060613265137750),(.D18,296645515224334),(.D18,72387642940),(.D6,2097548852),(.D16,605156464),(.D6,23100214),(.D16,36249520),(.D6,1050118),(.D16,2167396),(.D6,1225132790),(.D12,3627),(.D16,9073),(.D16,215),(.D12,3)])]], + .ms [(.m2,.s6,7627861917694)], + .ms2 .s6 .s7 [(.m3,5566277615614,1649267441614),(.m0,3607772528650,5385888988728),(.m0,3343632040048,31759269892)], + .ms [(.m0,.s6,140401799637344356666817476),(.m0,.s6,4976888274265500192118),(.m0,.s6,1215060613236039766),(.m0,.s6,296645507949838)], + .ms2 .s6 .s7 [(.m0,72385824316,2097094196),(.m0,605042800,23071798),(.m0,36242416,1048342),(.m0,2166952,1225132679)], + .ms [(.m3,.s6,3601)], + .ms2 .s6 .s7 [(.m6,9065,214)], + .ms2 .s3 .s0 [(.m19,214,9065)], + .ms [(.m17,.s0,3601)], + .ms2 .s3 .s0 [(.m4,1225132679,2166952),(.m1,1048342,36242416),(.m1,23071798,605042800),(.m1,2097094196,72385824316)], + .ms [(.m16,.s3,296645507949838),(.m1,.s3,1215060613236039766),(.m1,.s3,4976888274265500192118),(.m1,.s3,140401799637344356666817476)], + .ms2 .s3 .s0 [(.m4,31759269892,3343632040048),(.m1,5385888988728,3607772528650),(.m1,1649267441614,5566277615614)], + .ms [(.m1,.s3,7627861917688),(.m10,.s7,7627861917694),(.m8,.s2,7627861917689)], + .m .m9, + .b 0 [[([30511447670774,14018773254150],[(.D7,7627861917694),(.D17,5566277615614)]),([2783138807807],[(.D6,1649267441614),(.D16,3607772528650),(.D6,5385888988728),(.D16,3343632040048),(.D6,31759269892),(.D16,140401799637344356666817476),(.D18,4976888274265500192118),(.D18,1215060613236039766),(.D18,296645507949838),(.D18,72385824316),(.D6,2097094196),(.D16,605042800),(.D6,23071798),(.D16,36242416),(.D6,1048342),(.D16,2166952),(.D6,1225132679),(.D6,3601),(.D12,9065),(.D6,214),(.D16,4)])]], + .ms [(.m2,.s6,22265110462462),(.m3,.s6,2061584302078)], + .ms2 .s6 .s7 [(.m3,4174708211710,1301375090638),(.m0,3520799440906,5364145716792),(.m0,3338196222064,30400315396)], + .ms [(.m0,.s6,140401799637344356327078852),(.m0,.s6,4976888274265415257462),(.m0,.s6,1215060613214806102),(.m0,.s6,296645502641422)], + .ms2 .s6 .s7 [(.m0,72384497212,2096762420),(.m0,604959856,23051062),(.m0,36237232,1047046),(.m0,2166628,1225132598)], + .ms [(.m12,.s7,3579),(.m0,.s6,9061),(.m3,.s6,212),(.m20,.s0,212),(.m1,.s3,9061),(.m4,.s3,3579)], + .ms2 .s3 .s0 [(.m13,1225132598,2166628),(.m1,1047046,36237232),(.m1,23051062,604959856),(.m1,2096762420,72384497212)], + .ms [(.m16,.s3,296645502641422),(.m1,.s3,1215060613214806102),(.m1,.s3,4976888274265415257462),(.m1,.s3,140401799637344356327078852)], + .ms2 .s3 .s0 [(.m4,30400315396,3338196222064),(.m1,5364145716792,3520799440906),(.m1,1301375090638,4174708211710)], + .ms [(.m1,.s3,2061584302078),(.m4,.s3,22265110462456),(.m10,.s7,22265110462462),(.m8,.s2,22265110462457)], + .m .m9, + .b 0 [[([65970697666484],[(.D7,22265110462462)]),([8246337208310,4123168604159,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,2061584302078),(.D16,4174708211710)]),([1030792151038],[(.D6,1301375090638),(.D16,3520799440906),(.D6,5364145716792),(.D16,3338196222064),(.D6,30400315396),(.D16,140401799637344356327078852),(.D18,4976888274265415257462),(.D18,1215060613214806102),(.D18,296645502641422),(.D18,72384497212),(.D6,2096762420),(.D16,604959856),(.D6,23051062),(.D16,36237232),(.D6,1047046),(.D16,2166628),(.D6,1225132598),(.D12,3579),(.D16,9061),(.D16,212),(.D6,5)])]], + .ms [(.m2,.s6,32985348833242),(.m3,.s6,14018773254151),(.m14,.s5,14018773254151),(.m4,.s5,32985348833236)], + .m .m5, + .b 32985348833242 [[([23],[(.D16,14018773254151),(.D18,1),(.D15,3659312136189),(.D16,1172526071758)])]], + .ms [(.m2,.s6,32985348833254),(.m3,.s6,14018773254148),(.m7,.s5,14018773254148),(.m4,.s5,32985348833248)], + .m .m5, + .b 32985348833254 [[([7],[(.D16,14018773254148),(.D6,1)])]], + .ms [(.m2,.s6,32985348833258),(.m6,.s6,14018773254146),(.m15,.s5,14018773254146),(.m11,.s5,32985348833252)], + .m .m5, + .b 32985348833258 [[([5],[(.D12,14018773254146),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,32985348833261,14018773254147)], + .ms [(.m23,.s1,14018773254147),(.m22,.s4,32985348833255)], + .m .m24, + .b 32985348833261 [[([17],[(.D6,14018773254147),(.D6,2)])]], + .ms [(.m2,.s6,32985348833270),(.m6,.s6,14018773254143),(.m14,.s5,14018773254143),(.m11,.s5,32985348833264)], + .m .m5, + .b 32985348833270 [[([23],[(.D12,14018773254143),(.D18,1),(.D17,3659312136188),(.D17,1172526071758),(.D15,3488587186186),(.D17,5356092653112),(.D15,3336182956144),(.D17,29896998916),(.D15,140401799637344356201249732),(.D21,4976888274265383800182),(.D21,1215060613206941782),(.D21,296645500675342),(.D21,72384005692),(.D17,2096639540),(.D15,604929136),(.D17,23043382),(.D15,36235312),(.D17,1046566),(.D15,2166508),(.D17,1225132568),(.D11,3571),(.D6,9060)])]], + .ms [(.m2,.s6,32985348833282),(.m6,.s6,14018773254140),(.m7,.s5,14018773254140),(.m11,.s5,32985348833276)], + .m .m5, + .b 32985348833282 [[([56075093016561,28037546508285,4947802325001],[(.D12,14018773254140),(.D8,3659312136188),(.D6,1172526071758),(.D16,3488587186186)]),([347892350975],[(.D6,5356092653112),(.D16,3336182956144),(.D6,29896998916),(.D16,140401799637344356201249732),(.D18,4976888274265383800182),(.D18,1215060613206941782),(.D18,296645500675342),(.D18,72384005692),(.D6,2096639540),(.D16,604929136),(.D6,23043382),(.D16,36235312),(.D6,1046566),(.D16,2166508),(.D6,1225132568),(.D12,3572),(.D7,9059),(.D8,211),(.D7,4)])]], + .ms [(.m2,.s6,77515569758206)], + .ms2 .s6 .s7 [(.m3,2886218022910,876173328382)], + .ms [(.m3,.s6,476741369806)], + .ms2 .s6 .s7 [(.m3,3314641010698,5312606109240),(.m0,3325311320176,27179089924)], + .ms [(.m0,.s6,140401799637344355521772484),(.m0,.s6,4976888274265213930870),(.m0,.s6,1215060613164474454),(.m0,.s6,296645490058510)], + .ms2 .s6 .s7 [(.m0,72381351484,2095975988),(.m0,604763248,23001910),(.m0,36224944,1043974),(.m0,2165860,1225132406)], + .ms [(.m12,.s7,3531),(.m0,.s6,9049),(.m3,.s6,209),(.m21,.s3,209),(.m4,.s3,9049),(.m4,.s3,3531)], + .ms2 .s3 .s0 [(.m13,1225132406,2165860),(.m1,1043974,36224944),(.m1,23001910,604763248),(.m1,2095975988,72381351484)], + .ms [(.m16,.s3,296645490058510),(.m1,.s3,1215060613164474454),(.m1,.s3,4976888274265213930870),(.m1,.s3,140401799637344355521772484)], + .ms2 .s3 .s0 [(.m4,27179089924,3325311320176),(.m1,5312606109240,3314641010698),(.m1,476741369806,876173328382)], + .ms [(.m4,.s3,2886218022910),(.m4,.s3,77515569758200),(.m10,.s7,77515569758206),(.m8,.s2,77515569758201)], + .m .m9, + .b 0 [[([92358976733108],[(.D7,77515569758206)]),([11544872091638,5772436045823,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,2886218022910),(.D6,876173328382),(.D6,476741369806)]),([360777252863],[(.D16,3314641010698),(.D6,5312606109240),(.D16,3325311320176),(.D6,27179089924),(.D16,140401799637344355521772484),(.D18,4976888274265213930870),(.D18,1215060613164474454),(.D18,296645490058510),(.D18,72381351484),(.D6,2095975988),(.D16,604763248),(.D6,23001910),(.D16,36224944),(.D6,1043974),(.D16,2165860),(.D6,1225132406),(.D12,3531),(.D16,9049),(.D16,209),(.D12,3)])],[([8],[(.D15,65970697666567),(.D21,0),(.D19,154618822653)])]], + .ms [(.m2,.s6,46179488366558),(.m6,.s6,65970697666565),(.m7,.s5,65970697666565),(.m11,.s5,46179488366552)], + .m .m5, + .b 46179488366558 [[([41],[(.D12,65970697666565),(.D8,1),(.D7,154618822652)])],[([3710851743622],[(.D17,65970697666561),(.D2,154618822650)])]], + .ms [(.m2,.s6,48034914238390),(.m3,.s6,65506841198608),(.m27,.s2,65506841198608),(.m1,.s5,48034914238384)], + .m .m42, + ] (by decide +kernel) +theorem chunk_33_step : (cfg_33.denote) [qi]⊢* (cfg_34.denote) := + step_chunk [ + .m .m43, + .b 48034914238390 [[([7],[(.D16,65506841198608), + (.D6,1)])], + [([16],[(.D11,65506841198606), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,65506841198605), + (.D17,1), + (.D15,0), + (.D6,296352743374)])], + [([16],[(.D11,65506841198603), + (.D3,0)])], + [([8],[(.D15,65506841198602), + (.D17,1), + (.D21,296352743373), + (.D15,3269543854090), + (.D17,5301331820088), + (.D15,3322492747888), + (.D17,26474446852), + (.D15,140401799637344355345611716), + (.D21,4976888274265169890678), + (.D21,1215060613153464406), + (.D21,296645487305998), + (.D21,72380663356), + (.D17,2095803956), + (.D15,604720240), + (.D17,22991158), + (.D15,36222256), + (.D17,1043302), + (.D15,2165692), + (.D17,1225132364), + (.D11,3520), + (.D12,9046)])], + [([18],[(.D11,65506841198600), + (.D13,0), + (.D16,296352743373), + (.D16,3269543854090)])], + [([9483287787972],[(.D17,65506841198599)]), + ([1185410973499,592705486751,296352743376,148176371688,74088185844,37044092919,18522046461,9261023232,4630511616,2315255808,1157627904,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,296352743374), + (.D17,3269543854090)]), + ([148176371687],[(.D6,5301331820088), + (.D16,3322492747888), + (.D6,26474446852), + (.D16,140401799637344355345611716), + (.D18,4976888274265169890678), + (.D18,1215060613153464406), + (.D18,296645487305998), + (.D18,72380663356), + (.D6,2095803956), + (.D16,604720240), + (.D6,22991158), + (.D16,36222256), + (.D6,1043302), + (.D16,2165692), + (.D6,1225132364), + (.D12,3521), + (.D13,9046), + (.D9,208), + (.D13,3)])], + [([10],[(.D17,64321430225103), + (.D21,0), + (.D19,3195455668246)])]], + .ms [(.m2,.s6,52776558132418),(.m3,.s6,64321430225101),(.m7,.s5,64321430225101),(.m4,.s5,52776558132412)], + .m .m5, + .b 52776558132418 [[([43],[(.D16,64321430225101),(.D8,1),(.D7,3195455668245)])],[([76690936037850],[(.D11,64321430225094),(.D2,3195455668243)])]], + .ms2 .s6 .s7 [(.m2,91122026151365,54735063220365)], + .ms [(.m29,.s2,54735063220365),(.m4,.s5,91122026151359)], + .m .m5, + .b 91122026151365 [[([9],[(.D6,54735063220365),(.D6,1)])],[([20],[(.D15,54735063220363),(.D13,0),(.D10,5282809773626),(.D9,3317862236272)])],[([36],[(.D11,54735063220359)]),([7,2],[(.D12,1),(.D6,5282809773626)])]], + .ms [(.m2,.s6,91122026151398),(.m6,.s6,54735063220355),(.m15,.s5,54735063220355),(.m11,.s5,91122026151392)], + .m .m5, + .b 91122026151398 [[([5],[(.D12,54735063220355),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,91122026151401,54735063220356)], + .ms [(.m23,.s1,54735063220356),(.m22,.s4,91122026151395)], + .m .m24, + .b 91122026151401 [[([17],[(.D6,54735063220356),(.D6,2)])],[([6],[(.D11,54735063220352),(.D21,0),(.D7,5282809773624)])]], + .ms2 .s6 .s7 [(.m2,91122026151413,54735063220353)], + .ms2 .s5 .s2 [(.m28,54735063220353,91122026151408)], + .m .m18, + .b 91122026151413 [[([45],[(.D6,54735063220353),(.D8,1),(.D17,5282809773623),(.D10,3317862236271)])],[([36],[(.D15,54735063220346)]),([7,2],[(.D12,1),(.D17,5282809773622)]),([1],[(.D11,3317862236271),(.D16,25316818948)])],[([8],[(.D15,54735063220342),(.D21,0),(.D17,5282809773621),(.D12,3317862236272)])]], + .ms [(.m2,.s6,91122026151458),(.m6,.s6,54735063220340),(.m7,.s5,54735063220340),(.m11,.s5,91122026151452)], + .m .m5, + .b 91122026151458 [[([39],[(.D12,54735063220340),(.D8,5282809773622),(.D13,3317862236272),(.D17,25316818948),(.D15,140401799637344355056204740),(.D21,4976888274265097538934),(.D21,1215060613135376470),(.D21,296645482784014),(.D21,72379532860),(.D17,2095521332),(.D15,604649584),(.D17,22973494),(.D15,36217840),(.D17,1042198),(.D15,2165416),(.D17,1225132295),(.D17,3505),(.D11,9041),(.D17,208),(.D15,3)])]], + .ms [(.m2,.s6,91122026151478)], + .ms2 .s6 .s7 [(.m3,54735063220336,5282809773622),(.m0,3317862236272,25316818948)], + .ms [(.m0,.s6,140401799637344355056204740),(.m0,.s6,4976888274265097538934),(.m0,.s6,1215060613135376470),(.m0,.s6,296645482784014)], + .ms2 .s6 .s7 [(.m0,72379532860,2095521332),(.m0,604649584,22973494),(.m0,36217840,1042198),(.m0,2165416,1225132295)], + .ms [(.m3,.s6,3505)], + .ms2 .s6 .s7 [(.m6,9041,208)], + .ms2 .s3 .s0 [(.m19,208,9041)], + .ms [(.m17,.s0,3505)], + .ms2 .s3 .s0 [(.m4,1225132295,2165416),(.m1,1042198,36217840),(.m1,22973494,604649584),(.m1,2095521332,72379532860)], + .ms [(.m16,.s3,296645482784014),(.m1,.s3,1215060613135376470),(.m1,.s3,4976888274265097538934),(.m1,.s3,140401799637344355056204740)], + .ms2 .s3 .s0 [(.m4,25316818948,3317862236272),(.m1,5282809773622,54735063220336)], + .ms [(.m1,.s3,91122026151472),(.m10,.s7,91122026151478),(.m8,.s2,91122026151473)], + .m .m9, + .b 0 [[([2783138807804],[(.D7,91122026151478),(.D17,54735063220336),(.D6,5282809773622),(.D16,3317862236272),(.D6,25316818948),(.D16,140401799637344355056204740),(.D18,4976888274265097538934),(.D18,1215060613135376470),(.D18,296645482784014),(.D18,72379532860),(.D6,2095521332),(.D16,604649584),(.D6,22973494),(.D16,36217840),(.D6,1042198),(.D16,2165416),(.D6,1225132295),(.D6,3505),(.D12,9041),(.D6,208),(.D16,4)])]], + .ms [(.m2,.s6,1391569403902),(.m3,.s6,90774133800502)], + .ms2 .s6 .s7 [(.m3,54648090132592,5261066501686),(.m0,3312426418288,23957864452)], + .ms [(.m0,.s6,140401799637344354716466116),(.m0,.s6,4976888274265012604278),(.m0,.s6,1215060613114142806),(.m0,.s6,296645477475598)], + .ms2 .s6 .s7 [(.m0,72378205756,2095189556),(.m0,604566640,22952758),(.m0,36212656,1040902),(.m0,2165092,1225132214)], + .ms [(.m12,.s7,3483),(.m0,.s6,9037),(.m3,.s6,206),(.m20,.s0,206),(.m1,.s3,9037),(.m4,.s3,3483)], + .ms2 .s3 .s0 [(.m13,1225132214,2165092),(.m1,1040902,36212656),(.m1,22952758,604566640),(.m1,2095189556,72378205756)], + .ms [(.m16,.s3,296645477475598),(.m1,.s3,1215060613114142806),(.m1,.s3,4976888274265012604278),(.m1,.s3,140401799637344354716466116)], + .ms2 .s3 .s0 [(.m4,23957864452,3312426418288),(.m1,5261066501686,54648090132592)], + .ms [(.m1,.s3,90774133800502),(.m4,.s3,1391569403896),(.m10,.s7,1391569403902),(.m8,.s2,1391569403897)], + .m .m9, + .b 0 [[([5566277615606,2783138807805,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,1391569403902),(.D17,90774133800502)]),([695784701950],[(.D16,54648090132592),(.D6,5261066501686),(.D16,3312426418288),(.D6,23957864452),(.D16,140401799637344354716466116),(.D18,4976888274265012604278),(.D18,1215060613114142806),(.D18,296645477475598),(.D18,72378205756),(.D6,2095189556),(.D16,604566640),(.D6,22952758),(.D16,36212656),(.D6,1040902),(.D16,2165092),(.D6,1225132214),(.D12,3483),(.D16,9037),(.D16,206),(.D6,5)])]], + .ms [(.m2,.s6,5566277615605),(.m14,.s5,5566277615599)], + .m .m5, + .b 5566277615605 [[([5],[(.D18,1),(.D15,90426241449525),(.D14,54561117044848)])]], + .ms [(.m2,.s6,5566277615608),(.m7,.s5,5566277615602)], + .m .m5, + .b 5566277615608 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,5566277615609),(.m15,.s5,5566277615603)], + .m .m5, + .b 5566277615609 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,5566277615610),(.m25,.s2,5566277615605)], + .m .m18, + .b 5566277615610 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,5566277615612),(.m14,.s5,5566277615606)], + .m .m5, + .b 5566277615612 [[([5],[(.D18,1),(.D17,90426241449524),(.D15,54561117044848),(.D17,5239323229750),(.D15,3306990600304),(.D17,22598909956),(.D15,140401799637344354376727492),(.D21,4976888274264927669622),(.D21,1215060613092909142),(.D21,296645472167182),(.D21,72376878652),(.D17,2094857780),(.D15,604483696),(.D17,22932022),(.D15,36207472),(.D17,1039606),(.D15,2164768),(.D17,1225132133),(.D17,3464),(.D8,9031)])]], + .ms [(.m2,.s6,5566277615615),(.m7,.s5,5566277615609)], + .m .m5, + .b 5566277615615 [[([3813930958845],[(.D8,90426241449524),(.D16,54561117044848),(.D6,5239323229750),(.D16,3306990600304),(.D6,22598909956),(.D16,140401799637344354376727492),(.D18,4976888274264927669622),(.D18,1215060613092909142),(.D18,296645472167182),(.D18,72376878652),(.D6,2094857780),(.D16,604483696),(.D6,22932022),(.D16,36207472),(.D6,1039606),(.D16,2164768),(.D6,1225132133),(.D6,3465),(.D9,9031),(.D14,204),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,7473243095038,89949500079670),(.m0,54441931702384,5209526894134),(.m0,3299541516400,20736638980)], + .ms [(.m0,.s6,140401799637344353911159748),(.m0,.s6,4976888274264811277686),(.m0,.s6,1215060613063811158),(.m0,.s6,296645464892686)], + .ms2 .s6 .s7 [(.m0,72375060028,2094403124),(.m0,604370032,22903606),(.m0,36200368,1037830),(.m0,2164324,1225132022)], + .ms [(.m12,.s7,3435),(.m0,.s6,9025),(.m3,.s6,203),(.m21,.s3,203),(.m4,.s3,9025),(.m4,.s3,3435)], + .ms2 .s3 .s0 [(.m13,1225132022,2164324),(.m1,1037830,36200368),(.m1,22903606,604370032),(.m1,2094403124,72375060028)], + .ms [(.m16,.s3,296645464892686),(.m1,.s3,1215060613063811158),(.m1,.s3,4976888274264811277686),(.m1,.s3,140401799637344353911159748)], + .ms2 .s3 .s0 [(.m4,20736638980,3299541516400),(.m1,5209526894134,54441931702384),(.m1,89949500079670,7473243095033)], + .ms [(.m26,.s7,7473243095038),(.m8,.s2,7473243095033)], + .m .m9, + .b 0 [[([15255723835388],[(.D7,7473243095038),(.D7,89949500079669),(.D16,54441931702384),(.D6,5209526894134),(.D16,3299541516400),(.D6,20736638980),(.D16,140401799637344353911159748),(.D18,4976888274264811277686),(.D18,1215060613063811158),(.D18,296645464892686),(.D18,72375060028),(.D6,2094403124),(.D16,604370032),(.D6,22903606),(.D16,36200368),(.D6,1037830),(.D16,2164324),(.D6,1225132022),(.D12,3435),(.D16,9025),(.D16,203),(.D12,3)])]], + .ms [(.m2,.s6,7627861917694)], + .ms2 .s6 .s7 [(.m3,5566277615614,89472758709814),(.m0,54322746359920,5179730558518),(.m0,3292092432496,18874368004)], + .ms [(.m0,.s6,140401799637344353445592004),(.m0,.s6,4976888274264694885750),(.m0,.s6,1215060613034713174),(.m0,.s6,296645457618190)], + .ms2 .s6 .s7 [(.m0,72373241404,2093948468),(.m0,604256368,22875190),(.m0,36193264,1036054),(.m0,2163880,1225131911)], + .ms [(.m3,.s6,3409)], + .ms2 .s6 .s7 [(.m6,9017,202)], + .ms2 .s3 .s0 [(.m19,202,9017)], + .ms [(.m17,.s0,3409)], + .ms2 .s3 .s0 [(.m4,1225131911,2163880),(.m1,1036054,36193264),(.m1,22875190,604256368),(.m1,2093948468,72373241404)], + .ms [(.m16,.s3,296645457618190),(.m1,.s3,1215060613034713174),(.m1,.s3,4976888274264694885750),(.m1,.s3,140401799637344353445592004)], + .ms2 .s3 .s0 [(.m4,18874368004,3292092432496),(.m1,5179730558518,54322746359920),(.m1,89472758709814,5566277615614)], + .ms [(.m1,.s3,7627861917688),(.m10,.s7,7627861917694),(.m8,.s2,7627861917689)], + .m .m9, + .b 0 [[([30511447670774,14018773254150],[(.D7,7627861917694),(.D17,5566277615614)]),([2783138807807],[(.D6,89472758709814),(.D16,54322746359920),(.D6,5179730558518),(.D16,3292092432496),(.D6,18874368004),(.D16,140401799637344353445592004),(.D18,4976888274264694885750),(.D18,1215060613034713174),(.D18,296645457618190),(.D18,72373241404),(.D6,2093948468),(.D16,604256368),(.D6,22875190),(.D16,36193264),(.D6,1036054),(.D16,2163880),(.D6,1225131911),(.D6,3409),(.D12,9017),(.D6,202),(.D16,4)])]], + .ms [(.m2,.s6,22265110462462),(.m3,.s6,2061584302078)], + .ms2 .s6 .s7 [(.m3,4174708211710,89124866358838),(.m0,54235773272176,5157987286582),(.m0,3286656614512,17515413508)], + .ms [(.m0,.s6,140401799637344353105853380),(.m0,.s6,4976888274264609951094),(.m0,.s6,1215060613013479510),(.m0,.s6,296645452309774)], + .ms2 .s6 .s7 [(.m0,72371914300,2093616692),(.m0,604173424,22854454),(.m0,36188080,1034758),(.m0,2163556,1225131830)], + .ms [(.m12,.s7,3387),(.m0,.s6,9013),(.m3,.s6,200),(.m20,.s0,200),(.m1,.s3,9013),(.m4,.s3,3387)], + .ms2 .s3 .s0 [(.m13,1225131830,2163556),(.m1,1034758,36188080),(.m1,22854454,604173424),(.m1,2093616692,72371914300)], + .ms [(.m16,.s3,296645452309774),(.m1,.s3,1215060613013479510),(.m1,.s3,4976888274264609951094),(.m1,.s3,140401799637344353105853380)], + .ms2 .s3 .s0 [(.m4,17515413508,3286656614512),(.m1,5157987286582,54235773272176),(.m1,89124866358838,4174708211710)], + .ms [(.m1,.s3,2061584302078),(.m4,.s3,22265110462456),(.m10,.s7,22265110462462),(.m8,.s2,22265110462457)], + .m .m9, + .b 0 [[([65970697666484],[(.D7,22265110462462)]),([8246337208310,4123168604159,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,2061584302078),(.D16,4174708211710)]),([1030792151038],[(.D6,89124866358838),(.D16,54235773272176),(.D6,5157987286582),(.D16,3286656614512),(.D6,17515413508),(.D16,140401799637344353105853380),(.D18,4976888274264609951094),(.D18,1215060613013479510),(.D18,296645452309774),(.D18,72371914300),(.D6,2093616692),(.D16,604173424),(.D6,22854454),(.D16,36188080),(.D6,1034758),(.D16,2163556),(.D6,1225131830),(.D12,3387),(.D16,9013),(.D16,200),(.D6,5)])]], + .ms [(.m2,.s6,32985348833242),(.m3,.s6,14018773254151),(.m14,.s5,14018773254151),(.m4,.s5,32985348833236)], + .m .m5, + .b 32985348833242 [[([23],[(.D16,14018773254151),(.D18,1),(.D15,3659312136189),(.D16,88996017339958)])]], + .ms [(.m2,.s6,32985348833254),(.m3,.s6,14018773254148),(.m7,.s5,14018773254148),(.m4,.s5,32985348833248)], + .m .m5, + .b 32985348833254 [[([7],[(.D16,14018773254148),(.D6,1)])]], + .ms [(.m2,.s6,32985348833258),(.m6,.s6,14018773254146),(.m15,.s5,14018773254146),(.m11,.s5,32985348833252)], + .m .m5, + .b 32985348833258 [[([5],[(.D12,14018773254146),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,32985348833261,14018773254147)], + .ms [(.m23,.s1,14018773254147),(.m22,.s4,32985348833255)], + .m .m24, + .b 32985348833261 [[([17],[(.D6,14018773254147),(.D6,2)])]], + .ms [(.m2,.s6,32985348833270),(.m6,.s6,14018773254143),(.m14,.s5,14018773254143),(.m11,.s5,32985348833264)], + .m .m5, + .b 32985348833270 [[([23],[(.D12,14018773254143),(.D18,1),(.D17,3659312136188),(.D17,88996017339958),(.D15,54203561017456),(.D17,5149934222902),(.D15,3284643348592),(.D17,17012097028),(.D15,140401799637344352980024260),(.D21,4976888274264578493814),(.D21,1215060613005615190),(.D21,296645450343694),(.D21,72371422780),(.D17,2093493812),(.D15,604142704),(.D17,22846774),(.D15,36186160),(.D17,1034278),(.D15,2163436),(.D17,1225131800),(.D11,3379),(.D6,9012)])]], + .ms [(.m2,.s6,32985348833282),(.m6,.s6,14018773254140),(.m7,.s5,14018773254140),(.m11,.s5,32985348833276)], + .m .m5, + .b 32985348833282 [[([56075093016561,28037546508285,4947802325001],[(.D12,14018773254140),(.D8,3659312136188),(.D6,88996017339958)]),([1391569403903],[(.D16,54203561017456),(.D6,5149934222902),(.D16,3284643348592),(.D6,17012097028),(.D16,140401799637344352980024260),(.D18,4976888274264578493814),(.D18,1215060613005615190),(.D18,296645450343694),(.D18,72371422780),(.D6,2093493812),(.D16,604142704),(.D6,22846774),(.D16,36186160),(.D6,1034278),(.D16,2163436),(.D6,1225131800),(.D12,3380),(.D7,9011),(.D8,199),(.D7,4)])]], + .ms [(.m2,.s6,77515569758206)], + .ms2 .s6 .s7 [(.m3,2886218022910,876173328382)], + .ms [(.m3,.s6,88300232638006)], + .ms2 .s6 .s7 [(.m3,54029614841968,5106447679030),(.m0,3273771712624,14294188036)], + .ms [(.m0,.s6,140401799637344352300547012),(.m0,.s6,4976888274264408624502),(.m0,.s6,1215060612963147862),(.m0,.s6,296645439726862)], + .ms2 .s6 .s7 [(.m0,72368768572,2092830260),(.m0,603976816,22805302),(.m0,36175792,1031686),(.m0,2162788,1225131638)], + .ms [(.m12,.s7,3339),(.m0,.s6,9001),(.m3,.s6,197),(.m21,.s3,197),(.m4,.s3,9001),(.m4,.s3,3339)], + .ms2 .s3 .s0 [(.m13,1225131638,2162788),(.m1,1031686,36175792),(.m1,22805302,603976816),(.m1,2092830260,72368768572)], + .ms [(.m16,.s3,296645439726862),(.m1,.s3,1215060612963147862),(.m1,.s3,4976888274264408624502),(.m1,.s3,140401799637344352300547012)], + .ms2 .s3 .s0 [(.m4,14294188036,3273771712624),(.m1,5106447679030,54029614841968),(.m1,88300232638006,876173328382)], + .ms [(.m4,.s3,2886218022910),(.m4,.s3,77515569758200),(.m10,.s7,77515569758206),(.m8,.s2,77515569758201)], + .m .m9, + .b 0 [[([92358976733108],[(.D7,77515569758206)]),([11544872091638,5772436045823,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,2886218022910),(.D6,876173328382),(.D6,88300232638006)]),([360777252863],[(.D16,54029614841968),(.D6,5106447679030),(.D16,3273771712624),(.D6,14294188036),(.D16,140401799637344352300547012),(.D18,4976888274264408624502),(.D18,1215060612963147862),(.D18,296645439726862),(.D18,72368768572),(.D6,2092830260),(.D16,603976816),(.D6,22805302),(.D16,36175792),(.D6,1031686),(.D16,2162788),(.D6,1225131638),(.D12,3339),(.D16,9001),(.D16,197),(.D12,3)])],[([8],[(.D15,65970697666567),(.D21,0),(.D19,154618822653)])]], + .ms [(.m2,.s6,46179488366558),(.m6,.s6,65970697666565),(.m7,.s5,65970697666565),(.m11,.s5,46179488366552)], + .m .m5, + .b 46179488366558 [[([41],[(.D12,65970697666565),(.D8,1),(.D7,154618822652)])],[([3710851743622],[(.D17,65970697666561),(.D2,154618822650)])]], + .ms [(.m2,.s6,48034914238390),(.m3,.s6,65506841198608),(.m27,.s2,65506841198608),(.m1,.s5,48034914238384)], + .m .m5, + .b 48034914238390 [[([7],[(.D16,65506841198608), + (.D6,1)])], + [([16],[(.D11,65506841198606), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,65506841198605), + (.D17,1), + (.D15,0), + (.D6,88119844011574)])], + [([16],[(.D11,65506841198603), + (.D3,0)])], + [([8],[(.D15,65506841198602), + (.D17,1), + (.D21,88119844011573), + (.D15,53984517685360), + (.D17,5095173389878), + (.D15,3270953140336), + (.D17,13589544964), + (.D15,140401799637344352124386244), + (.D21,4976888274264364584310), + (.D21,1215060612952137814), + (.D21,296645436974350), + (.D21,72368080444), + (.D17,2092658228), + (.D15,603933808), + (.D17,22794550), + (.D15,36173104), + (.D17,1031014), + (.D15,2162620), + (.D17,1225131596), + (.D11,3328), + (.D12,8998)])], + [([18],[(.D11,65506841198600), + (.D13,0), + (.D16,88119844011573), + (.D16,53984517685360)])], + [([9483287789542],[(.D17,65506841198599), + (.D12,88119844011574), + (.D17,53984517685360), + (.D6,5095173389878), + (.D16,3270953140336), + (.D6,13589544964), + (.D16,140401799637344352124386244), + (.D18,4976888274264364584310), + (.D18,1215060612952137814), + (.D18,296645436974350), + (.D18,72368080444), + (.D6,2092658228), + (.D16,603933808), + (.D6,22794550), + (.D16,36173104), + (.D6,1031014), + (.D16,2162620), + (.D6,1225131596), + (.D12,3329), + (.D13,8998), + (.D9,196), + (.D13,3)])]], + .ms [(.m2,.s6,52776558133198)], + .ms2 .s6 .s7 [(.m3,64321430224906,87823491268152),(.m0,53910429499504,5076651343414),(.m0,3266322628720,12431917060)], + .ms [(.m0,.s6,140401799637344351834979268),(.m0,.s6,4976888274264292232566),(.m0,.s6,1215060612934049878),(.m0,.s6,296645432452366)], + .ms2 .s6 .s7 [(.m0,72366949948,2092375604),(.m0,603863152,22776886),(.m0,36168688,1029910),(.m0,2162344,1225131527)], + .ms [(.m3,.s6,3313)], + .ms2 .s6 .s7 [(.m6,8993,196)], + .ms2 .s3 .s0 [(.m19,196,8993)], + .ms [(.m17,.s0,3313)], + .ms2 .s3 .s0 [(.m4,1225131527,2162344),(.m1,1029910,36168688),(.m1,22776886,603863152),(.m1,2092375604,72366949948)], + .ms [(.m16,.s3,296645432452366),(.m1,.s3,1215060612934049878),(.m1,.s3,4976888274264292232566),(.m1,.s3,140401799637344351834979268)], + .ms2 .s3 .s0 [(.m4,12431917060,3266322628720),(.m1,5076651343414,53910429499504),(.m1,87823491268152,64321430224906)], + .ms [(.m1,.s3,52776558133192),(.m10,.s7,52776558133198),(.m8,.s2,52776558133193)], + .m .m9, + .b 0 [[([44530220924924],[(.D7,52776558133198),(.D17,64321430224906),(.D6,87823491268152),(.D16,53910429499504),(.D6,5076651343414),(.D16,3266322628720),(.D6,12431917060),(.D16,140401799637344351834979268),(.D18,4976888274264292232566),(.D18,1215060612934049878),(.D18,296645432452366),(.D18,72366949948),(.D6,2092375604),(.D16,603863152),(.D6,22776886),(.D16,36168688),(.D6,1029910),(.D16,2162344),(.D6,1225131527),(.D6,3313),(.D12,8993),(.D6,196),(.D16,4)])]], + .ms [(.m2,.s6,22265110462462),(.m3,.s6,47210280517582)], + .ms2 .s6 .s7 [(.m3,62929860821002,87475598917176),(.m0,53823456411760,5054908071478),(.m0,3260886810736,11072962564)], + .ms [(.m0,.s6,140401799637344351495240644),(.m0,.s6,4976888274264207297910),(.m0,.s6,1215060612912816214),(.m0,.s6,296645427143950)], + .ms2 .s6 .s7 [(.m0,72365622844,2092043828),(.m0,603780208,22756150),(.m0,36163504,1028614),(.m0,2162020,1225131446)], + .ms [(.m12,.s7,3291),(.m0,.s6,8989),(.m3,.s6,194),(.m20,.s0,194),(.m1,.s3,8989),(.m4,.s3,3291)], + .ms2 .s3 .s0 [(.m13,1225131446,2162020),(.m1,1028614,36163504),(.m1,22756150,603780208),(.m1,2092043828,72365622844)], + .ms [(.m16,.s3,296645427143950),(.m1,.s3,1215060612912816214),(.m1,.s3,4976888274264207297910),(.m1,.s3,140401799637344351495240644)], + .ms2 .s3 .s0 [(.m4,11072962564,3260886810736),(.m1,5054908071478,53823456411760),(.m1,87475598917176,62929860821002)], + .ms [(.m1,.s3,47210280517582),(.m4,.s3,22265110462456),(.m10,.s7,22265110462462),(.m8,.s2,22265110462457)], + .m .m9, + .b 0 [[([89060441849846,44530220924925,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,22265110462462),(.D17,47210280517582)]),([11132555231230],[(.D16,62929860821002),(.D6,87475598917176),(.D16,53823456411760),(.D6,5054908071478),(.D16,3260886810736),(.D6,11072962564),(.D16,140401799637344351495240644),(.D18,4976888274264207297910),(.D18,1215060612912816214),(.D18,296645427143950),(.D18,72365622844),(.D6,2092043828),(.D16,603780208),(.D6,22756150),(.D16,36163504),(.D6,1028614),(.D16,2162020),(.D6,1225131446),(.D12,3291),(.D16,8989),(.D16,194),(.D6,5)])]], + .ms [(.m2,.s6,89060441849845),(.m14,.s5,89060441849839)], + .m .m5, + .b 89060441849845 [[([5],[(.D18,1),(.D15,41644002901965),(.D14,61538291417098)])]], + .ms [(.m2,.s6,89060441849848),(.m7,.s5,89060441849842)], + .m .m5, + .b 89060441849848 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,89060441849849),(.m15,.s5,89060441849843)], + .m .m5, + .b 89060441849849 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,89060441849850),(.m25,.s2,89060441849845)], + .m .m18, + .b 89060441849850 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,89060441849852),(.m14,.s5,89060441849846)], + .m .m5, + .b 89060441849852 [[([5],[(.D18,1),(.D17,41644002901964),(.D15,61538291417098),(.D17,87127706566200),(.D15,53736483324016),(.D17,5033164799542),(.D15,3255450992752),(.D17,9714008068),(.D15,140401799637344351155502020),(.D21,4976888274264122363254),(.D21,1215060612891582550),(.D21,296645421835534),(.D21,72364295740),(.D17,2091712052),(.D15,603697264),(.D17,22735414),(.D15,36158320),(.D17,1027318),(.D15,2161696),(.D17,1225131365),(.D17,3272),(.D8,8983)])]], + .ms [(.m2,.s6,89060441849855),(.m7,.s5,89060441849849)], + .m .m5, + .b 89060441849855 [[([61022895341565],[(.D8,41644002901964),(.D16,61538291417098),(.D6,87127706566200),(.D16,53736483324016),(.D6,5033164799542),(.D16,3255450992752),(.D6,9714008068),(.D16,140401799637344351155502020),(.D18,4976888274264122363254),(.D18,1215060612891582550),(.D18,296645421835534),(.D18,72364295740),(.D6,2091712052),(.D16,603697264),(.D6,22735414),(.D16,36158320),(.D6,1027318),(.D16,2161696),(.D6,1225131365),(.D6,3273),(.D9,8983),(.D14,192),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,119571889520638,34016140984270),(.m0,59631325937674,86650965196344),(.m0,53617297981552,5003368463926),(.m0,3248001908848,7851737092)], + .ms [(.m0,.s6,140401799637344350689934276),(.m0,.s6,4976888274264005971318),(.m0,.s6,1215060612862484566),(.m0,.s6,296645414561038)], + .ms2 .s6 .s7 [(.m0,72362477116,2091257396),(.m0,603583600,22706998),(.m0,36151216,1025542),(.m0,2161252,1225131254)], + .ms [(.m12,.s7,3243),(.m0,.s6,8977),(.m3,.s6,191),(.m21,.s3,191),(.m4,.s3,8977),(.m4,.s3,3243)], + .ms2 .s3 .s0 [(.m13,1225131254,2161252),(.m1,1025542,36151216),(.m1,22706998,603583600),(.m1,2091257396,72362477116)], + .ms [(.m16,.s3,296645414561038),(.m1,.s3,1215060612862484566),(.m1,.s3,4976888274264005971318),(.m1,.s3,140401799637344350689934276)], + .ms2 .s3 .s0 [(.m4,7851737092,3248001908848),(.m1,5003368463926,53617297981552),(.m1,86650965196344,59631325937674),(.m1,34016140984270,119571889520633)], + .ms [(.m26,.s7,119571889520638),(.m8,.s2,119571889520633)], + .m .m88, + ] (by decide +kernel) +theorem chunk_34_step : (cfg_34.denote) [qi]⊢* (cfg_35.denote) := + step_chunk [ + .m .m89, + .b 0 [[([244091581366268],[(.D7,119571889520638),(.D7,34016140984269),(.D16,59631325937674),(.D6,86650965196344),(.D16,53617297981552),(.D6,5003368463926),(.D16,3248001908848),(.D6,7851737092),(.D16,140401799637344350689934276),(.D18,4976888274264005971318),(.D18,1215060612862484566),(.D18,296645414561038),(.D18,72362477116),(.D6,2091257396),(.D16,603583600),(.D6,22706998),(.D16,36151216),(.D6,1025542),(.D16,2161252),(.D6,1225131254),(.D12,3243),(.D16,8977),(.D16,191),(.D12,3)])]], + .ms [(.m2,.s6,122045790683134)], + .ms2 .s6 .s7 [(.m3,89060441849854,26388279066574),(.m0,57724360458250,86174223826488),(.m0,53498112639088,4973572128310),(.m0,3240552824944,5989466116)], + .ms [(.m0,.s6,140401799637344350224366532),(.m0,.s6,4976888274263889579382),(.m0,.s6,1215060612833386582),(.m0,.s6,296645407286542)], + .ms2 .s6 .s7 [(.m0,72360658492,2090802740),(.m0,603469936,22678582),(.m0,36144112,1023766),(.m0,2160808,1225131143)], + .ms [(.m3,.s6,3217)], + .ms2 .s6 .s7 [(.m6,8969,190)], + .ms2 .s3 .s0 [(.m19,190,8969)], + .ms [(.m17,.s0,3217)], + .ms2 .s3 .s0 [(.m4,1225131143,2160808),(.m1,1023766,36144112),(.m1,22678582,603469936),(.m1,2090802740,72360658492)], + .ms [(.m16,.s3,296645407286542),(.m1,.s3,1215060612833386582),(.m1,.s3,4976888274263889579382),(.m1,.s3,140401799637344350224366532)], + .ms2 .s3 .s0 [(.m4,5989466116,3240552824944),(.m1,4973572128310,53498112639088),(.m1,86174223826488,57724360458250),(.m1,26388279066574,89060441849854)], + .ms [(.m1,.s3,122045790683128),(.m10,.s7,122045790683134),(.m8,.s2,122045790683129)], + .m .m9, + .b 0 [[([488183162732534,224300372066310],[(.D7,122045790683134),(.D17,89060441849854)]),([44530220924927],[(.D6,26388279066574),(.D16,57724360458250),(.D6,86174223826488),(.D16,53498112639088),(.D6,4973572128310),(.D16,3240552824944),(.D6,5989466116),(.D16,140401799637344350224366532),(.D18,4976888274263889579382),(.D18,1215060612833386582),(.D18,296645407286542),(.D18,72360658492),(.D6,2090802740),(.D16,603469936),(.D6,22678582),(.D16,36144112),(.D6,1023766),(.D16,2160808),(.D6,1225131143),(.D6,3217),(.D12,8969),(.D6,190),(.D16,4)])]], + .ms [(.m2,.s6,356241767399422),(.m3,.s6,32985348833278)], + .ms2 .s6 .s7 [(.m3,66795331387390,20822001450958),(.m0,56332791054346,85826331475512),(.m0,53411139551344,4951828856374),(.m0,3235117006960,4630511620)], + .ms [(.m0,.s6,140401799637344349884627908),(.m0,.s6,4976888274263804644726),(.m0,.s6,1215060612812152918),(.m0,.s6,296645401978126)], + .ms2 .s6 .s7 [(.m0,72359331388,2090470964),(.m0,603386992,22657846),(.m0,36138928,1022470),(.m0,2160484,1225131062)], + .ms [(.m12,.s7,3195),(.m0,.s6,8965),(.m3,.s6,188),(.m20,.s0,188),(.m1,.s3,8965),(.m4,.s3,3195)], + .ms2 .s3 .s0 [(.m13,1225131062,2160484),(.m1,1022470,36138928),(.m1,22657846,603386992),(.m1,2090470964,72359331388)], + .ms [(.m16,.s3,296645401978126),(.m1,.s3,1215060612812152918),(.m1,.s3,4976888274263804644726),(.m1,.s3,140401799637344349884627908)], + .ms2 .s3 .s0 [(.m4,4630511620,3235117006960),(.m1,4951828856374,53411139551344),(.m1,85826331475512,56332791054346),(.m1,20822001450958,66795331387390)], + .ms [(.m1,.s3,32985348833278),(.m4,.s3,356241767399416),(.m10,.s7,356241767399422),(.m8,.s2,356241767399417)], + .m .m9, + .b 0 [[([1055531162664884],[(.D7,356241767399422)]),([131941395333110,65970697666559,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,32985348833278),(.D16,66795331387390)]),([16492674416638],[(.D6,20822001450958),(.D16,56332791054346),(.D6,85826331475512),(.D16,53411139551344),(.D6,4951828856374),(.D16,3235117006960),(.D6,4630511620),(.D16,140401799637344349884627908),(.D18,4976888274263804644726),(.D18,1215060612812152918),(.D18,296645401978126),(.D18,72359331388),(.D6,2090470964),(.D16,603386992),(.D6,22657846),(.D16,36138928),(.D6,1022470),(.D16,2160484),(.D6,1225131062),(.D12,3195),(.D16,8965),(.D16,188),(.D6,5)])]], + .ms [(.m2,.s6,527765581332442),(.m3,.s6,224300372066311),(.m14,.s5,224300372066311),(.m4,.s5,527765581332436)], + .m .m5, + .b 527765581332442 [[([23],[(.D16,224300372066311),(.D18,1),(.D15,58548994179069),(.D16,18760417148878)])]], + .ms [(.m2,.s6,527765581332454),(.m3,.s6,224300372066308),(.m7,.s5,224300372066308),(.m4,.s5,527765581332448)], + .m .m5, + .b 527765581332454 [[([7],[(.D16,224300372066308),(.D6,1)])]], + .ms [(.m2,.s6,527765581332458),(.m6,.s6,224300372066306),(.m15,.s5,224300372066306),(.m11,.s5,527765581332452)], + .m .m5, + .b 527765581332458 [[([5],[(.D12,224300372066306),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,527765581332461,224300372066307)], + .ms [(.m23,.s1,224300372066307),(.m22,.s4,527765581332455)], + .m .m24, + .b 527765581332461 [[([17],[(.D6,224300372066307),(.D6,2)])]], + .ms [(.m2,.s6,527765581332470),(.m6,.s6,224300372066303),(.m14,.s5,224300372066303),(.m11,.s5,527765581332464)], + .m .m5, + .b 527765581332470 [[([23],[(.D12,224300372066303),(.D18,1),(.D17,58548994179068),(.D17,18760417148878),(.D15,55817394978826),(.D17,85697482456632),(.D15,53378927296624),(.D17,4943775792694),(.D15,3233103741040),(.D17,4127195140),(.D15,140401799637344349758798788),(.D21,4976888274263773187446),(.D21,1215060612804288598),(.D21,296645400012046),(.D21,72358839868),(.D17,2090348084),(.D15,603356272),(.D17,22650166),(.D15,36137008),(.D17,1021990),(.D15,2160364),(.D17,1225131032),(.D11,3187),(.D6,8964)])]], + .ms [(.m2,.s6,527765581332482),(.m6,.s6,224300372066300),(.m7,.s5,224300372066300),(.m11,.s5,527765581332476)], + .m .m5, + .b 527765581332482 [[([897201488265201,448600744132605,79164837199881],[(.D12,224300372066300),(.D8,58548994179068),(.D6,18760417148878),(.D16,55817394978826)]),([5566277615615],[(.D6,85697482456632),(.D16,53378927296624),(.D6,4943775792694),(.D16,3233103741040)]),([13690208255,8053063680],[(.D6,4127195140),(.D16,140401799637344349758798788)]),([1358954495],[(.D18,4976888274263773187446),(.D18,1215060612804288598),(.D18,296645400012046),(.D18,72358839868),(.D6,2090348084),(.D16,603356272),(.D6,22650166),(.D16,36137008),(.D6,1021990),(.D16,2160364),(.D6,1225131032),(.D12,3188),(.D7,8963),(.D8,187),(.D7,4)])]], + .ms [(.m2,.s6,1240249116131326)], + .ms2 .s6 .s7 [(.m3,46179488366590,14018773254142)], + .ms [(.m3,.s6,7627861917646)], + .ms2 .s6 .s7 [(.m3,53034256171018,85001697754680),(.m0,53204981121136,4900289248822),(.m0,3222232105072,1409286148)], + .ms [(.m0,.s6,140401799637344349079321540),(.m0,.s6,4976888274263603318134),(.m0,.s6,1215060612761821270),(.m0,.s6,296645389395214)], + .ms2 .s6 .s7 [(.m0,72356185660,2089684532),(.m0,603190384,22608694),(.m0,36126640,1019398),(.m0,2159716,1225130870)], + .ms [(.m12,.s7,3147),(.m0,.s6,8953),(.m3,.s6,185),(.m21,.s3,185),(.m4,.s3,8953),(.m4,.s3,3147)], + .ms2 .s3 .s0 [(.m13,1225130870,2159716),(.m1,1019398,36126640),(.m1,22608694,603190384),(.m1,2089684532,72356185660)], + .ms [(.m16,.s3,296645389395214),(.m1,.s3,1215060612761821270),(.m1,.s3,4976888274263603318134),(.m1,.s3,140401799637344349079321540)], + .ms2 .s3 .s0 [(.m4,1409286148,3222232105072),(.m1,4900289248822,53204981121136),(.m1,85001697754680,53034256171018),(.m1,7627861917646,14018773254142)], + .ms [(.m4,.s3,46179488366590),(.m4,.s3,1240249116131320),(.m10,.s7,1240249116131326),(.m8,.s2,1240249116131321)], + .m .m9, + .b 0 [[([1477743627730868],[(.D7,1240249116131326)]), + ([184717953466358,92358976733183,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,46179488366590), + (.D6,14018773254142), + (.D6,7627861917646)]), + ([5772436045823],[(.D16,53034256171018), + (.D6,85001697754680), + (.D16,53204981121136), + (.D6,4900289248822), + (.D16,3222232105072), + (.D6,1409286148), + (.D16,140401799637344349079321540), + (.D18,4976888274263603318134), + (.D18,1215060612761821270), + (.D18,296645389395214), + (.D18,72356185660), + (.D6,2089684532), + (.D16,603190384), + (.D6,22608694), + (.D16,36126640), + (.D6,1019398), + (.D16,2159716), + (.D6,1225130870), + (.D12,3147), + (.D16,8953), + (.D16,185), + (.D12,3)])], + [([8],[(.D15,1055531162664967), + (.D21,0), + (.D19,2473901162493)])]], + .ms [(.m2,.s6,738871813865438),(.m6,.s6,1055531162664965),(.m7,.s5,1055531162664965),(.m11,.s5,738871813865432)], + .m .m5, + .b 738871813865438 [[([41],[(.D12,1055531162664965),(.D8,1),(.D7,2473901162492)])],[([59373627899782],[(.D17,1055531162664961),(.D2,2473901162490)])]], + .ms [(.m2,.s6,768558627815350),(.m3,.s6,1048109459177488),(.m27,.s2,1048109459177488),(.m1,.s5,768558627815344)], + .m .m5, + .b 768558627815350 [[([7],[(.D16,1048109459177488), + (.D6,1)])], + [([16],[(.D11,1048109459177486), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,1048109459177485), + (.D17,1), + (.D15,0), + (.D6,4741643894734)])], + [([16],[(.D11,1048109459177483), + (.D3,0)])], + [([8],[(.D15,1048109459177482), + (.D17,1), + (.D21,4741643894733), + (.D15,52312701665290), + (.D17,84821309128248), + (.D15,53159883964528), + (.D17,4889014959670), + (.D15,3219413532784), + (.D17,704643076), + (.D15,140401799637344348903160772), + (.D21,4976888274263559277942), + (.D21,1215060612750811222), + (.D21,296645386642702), + (.D21,72355497532), + (.D17,2089512500), + (.D15,603147376), + (.D17,22597942), + (.D15,36123952), + (.D17,1018726), + (.D15,2159548), + (.D17,1225130828), + (.D11,3136), + (.D12,8950)])], + [([18],[(.D11,1048109459177480), + (.D13,0), + (.D16,4741643894733), + (.D16,52312701665290)])], + [([92358977136204],[(.D17,1048109459177479)]), + ([17317308238227,5772436045824],[(.D12,4741643894734), + (.D17,52312701665290)]), + ([1443109017753],[(.D6,84821309128248), + (.D16,53159883964528), + (.D6,4889014959670), + (.D16,3219413532784)]), + ([2818572301,1409286155,704643073,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,47,24,12],[(.D6,704643076), + (.D16,140401799637344348903160772)]), + ([352321537],[(.D18,4976888274263559277942), + (.D18,1215060612750811222), + (.D18,296645386642702), + (.D18,72355497532), + (.D6,2089512500), + (.D16,603147376), + (.D6,22597942), + (.D16,36123952), + (.D6,1018726), + (.D16,2159548), + (.D6,1225130828), + (.D12,3137), + (.D13,8950), + (.D9,184), + (.D13,3)])], + [([59373627495288],[(.D17,1036564587035454)]), + ([7421703436912,3710851718459,1855425859227,927712929612,463856464809,231928232403,115964116200,57982058100,28991029053,14495514528,7247757264,3623878632,1811939316,905969655,452984829,226492416,113246208,56623104,28311552,14155776,7077888,3538944,1769472,884736,442368,221184,110592,55296,27648,13824,6912,3456,1728,864,432,216,108,51,24,12,9,3],[(.D15,1855425859228), + (.D17,51591147156414)]), + ([927712929614],[(.D15,84640920501028), + (.D17,53114786807724), + (.D15,4877740670468), + (.D17,3216594960484), + (.D2,140401799637344348727000002)])], + [([10],[(.D17,1029142883598543), + (.D21,0), + (.D19,51127290691606)])]], + .ms [(.m2,.s6,844424930131138),(.m3,.s6,1029142883598541),(.m7,.s5,1029142883598541),(.m4,.s5,844424930131132)], + .m .m5, + .b 844424930131138 [[([43],[(.D16,1029142883598541),(.D8,1),(.D7,51127290691605)])],[([1227054976598490],[(.D11,1029142883598534),(.D2,51127290691603)])]], + .ms2 .s6 .s7 [(.m2,1457952418430405,875761011523725)], + .ms [(.m29,.s2,875761011523725),(.m4,.s5,1457952418430399)], + .m .m5, + .b 1457952418430405 [[([9],[(.D6,875761011523725),(.D6,1)])],[([20],[(.D15,875761011523723),(.D13,0),(.D10,84524956384826),(.D9,53085795778672)])],[([36],[(.D11,875761011523719)]),([7,2],[(.D12,1),(.D6,84524956384826)])]], + .ms [(.m2,.s6,1457952418430438),(.m6,.s6,875761011523715),(.m15,.s5,875761011523715),(.m11,.s5,1457952418430432)], + .m .m5, + .b 1457952418430438 [[([5],[(.D12,875761011523715),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,1457952418430441,875761011523716)], + .ms [(.m23,.s1,875761011523716),(.m22,.s4,1457952418430435)], + .m .m24, + .b 1457952418430441 [[([17],[(.D6,875761011523716),(.D6,2)])],[([6],[(.D11,875761011523712),(.D21,0),(.D7,84524956384824)])]], + .ms2 .s6 .s7 [(.m2,1457952418430453,875761011523713)], + .ms2 .s5 .s2 [(.m28,875761011523713,1457952418430448)], + .m .m18, + .b 1457952418430453 [[([45],[(.D6,875761011523713),(.D8,1),(.D17,84524956384823),(.D10,53085795778671)])],[([36],[(.D15,875761011523706)]),([7,2],[(.D12,1),(.D17,84524956384822)]),([1],[(.D11,53085795778671),(.D16,4870492913206)])],[([8],[(.D15,875761011523702),(.D21,0),(.D17,84524956384821),(.D12,53085795778672)])]], + .ms [(.m2,.s6,1457952418430498),(.m6,.s6,875761011523700),(.m7,.s5,875761011523700),(.m11,.s5,1457952418430492)], + .m .m5, + .b 1457952418430498 [[([2493692371561037],[(.D12,875761011523700)]), + ([311711546445163,155855773222632,77927886611328,58445914958424,19481971652712],[(.D8,84524956384822), + (.D13,53085795778672)]), + ([19481971652822,9740985826415,4870492913208,2435246456604,1217623228297,608811614148,304405807079,152202903540,76101451765,38050725887,19025362944,9512681472,4756340736,2378170368,1189085184,594542592,297271296,148635648,74317824,37158912,18579456,9289728,4644864,2322432,1161216,580608,290304,145152,72576,36288,18144,9072,4536,2268,1129,564,287,144,72,36,13,11],[(.D17,4870492913206), + (.D15,3214783021168)]), + ([2435246456603],[(.D1,140401799637344348123020231)])], + [([211106232753276],[(.D17,564049465078572)]), + ([26388279094158,13194139547085,6597069773544,3298534886772,1649267443381,824633721695,412316860848,206158430424,103079215212,51539607601,25769803800,12884901900,6442450955,3221225473,1610612736,805306368,402653184,201326592,100663296,50331648,25165824,12582912,6291456,3145728,1572864,786432,393216,196608,98304,49152,24576,12288,6144,3072,1536,768,384,192,96,48,24,12,11],[(.D15,6597069773540), + (.D17,33603824125852)]), + ([3298534886770],[(.D2,1997159792865)])], + [([766909360379182],[(.D17,537661185984412), + (.D2,31954556682465)])]], + .ms [(.m2,.s6,3193806400777246),(.m3,.s6,441797515937014),(.m27,.s2,441797515937014),(.m1,.s5,3193806400777240)], + .m .m5, + .b 3193806400777246 [[([7],[(.D16,441797515937014),(.D6,1)])],[([16],[(.D11,441797515937012),(.D13,0),(.D6,1)])],[([8],[(.D15,441797515937011),(.D17,1),(.D5,0)])],[([16],[(.D11,441797515937009),(.D3,0)])],[([8],[(.D15,441797515937008),(.D17,1),(.D21,0),(.D9,1447403978404)])],[([16],[(.D11,441797515937006),(.D13,0),(.D18,0)])]], + .ms [(.m2,.s6,3193806400777282),(.m3,.s6,441797515937005),(.m35,.s2,441797515937005),(.m1,.s5,3193806400777276)], + .m .m5, + .b 3193806400777282 [[([37],[(.D16,441797515937005)]),([7,2],[(.D12,1),(.D11,1447403978403)]),([1],[(.D0,140401799637343942248610797)])],[([10],[(.D17,441797515937001),(.D21,0),(.D19,1447403978404)])]], + .ms [(.m2,.s6,3193806400777306),(.m3,.s6,441797515936999),(.m7,.s5,441797515936999),(.m4,.s5,3193806400777300)], + .m .m5, + .b 3193806400777306 [[([43],[(.D16,441797515936999),(.D8,1),(.D7,1447403978403)])],[([34737695481642],[(.D11,441797515936992),(.D2,1447403978401)])]], + .ms2 .s6 .s7 [(.m2,3211175248518149,437455304001789)], + .ms [(.m29,.s2,437455304001789),(.m4,.s5,3211175248518143)], + .m .m5, + .b 3211175248518149 [[([9],[(.D6,437455304001789),(.D6,1)])],[([14],[(.D15,437455304001787),(.D13,0),(.D16,1),(.D21,0)])]], + .ms2 .s6 .s7 [(.m2,3211175248518161,437455304001786)], + .ms2 .s5 .s2 [(.m90,437455304001786,3211175248518156)], + .m .m18, + .b 3211175248518161 [[([41],[(.D6,437455304001786)]),([7,2],[(.D12,1),(.D18,1)])]], + .ms [(.m2,.s6,3211175248518182),(.m6,.s6,437455304001779),(.m15,.s5,437455304001779),(.m11,.s5,3211175248518176)], + .m .m5, + .b 3211175248518182 [[([5],[(.D12,437455304001779),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,3211175248518185,437455304001780)], + .ms [(.m23,.s1,437455304001780),(.m22,.s4,3211175248518179)], + .m .m24, + .b 3211175248518185 [[([17],[(.D6,437455304001780),(.D6,2)])],[([6],[(.D11,437455304001776),(.D21,0),(.D21,140401799637343942248610796),(.D19,4976888274263515237750)])]], + .ms2 .s6 .s7 [(.m2,3211175248518197,437455304001777)], + .ms2 .s5 .s2 [(.m28,437455304001777,3211175248518192)], + .m .m18, + .b 3211175248518197 [[([9],[(.D6,437455304001777),(.D6,1)])]], + .ms [(.m2,.s6,3211175248518202),(.m3,.s6,437455304001775),(.m15,.s5,437455304001775),(.m4,.s5,3211175248518196)], + .m .m5, + .b 3211175248518202 [[([7],[(.D16,437455304001775),(.D16,1)])]], + .ms [(.m2,.s6,3211175248518206),(.m6,.s6,437455304001773),(.m25,.s2,437455304001773),(.m33,.s2,3211175248518201)], + .m .m18, + .b 3211175248518206 [[([15],[(.D12,437455304001773),(.D6,2)])],[([3623878608],[(.D15,437455304001772),(.D21,140401799637343942248610796),(.D20,4976888274263515237749),(.D18,1215060612739801174),(.D18,296645383890190),(.D18,72354809404),(.D6,2089340468),(.D16,603104368),(.D6,22587190),(.D16,36121264),(.D6,1018054),(.D16,2159380),(.D6,1225130786),(.D12,3126),(.D10,8946),(.D14,183),(.D14,3)])]], + .ms [(.m2,.s6,3211177060457518),(.m3,.s6,437454851016946),(.m0,.s6,140401799637343942135364590),(.m0,.s6,4976888274263486926198),(.m0,.s6,1215060612732723286),(.m0,.s6,296645382120718)], + .ms2 .s6 .s7 [(.m0,72354367036,2089229876),(.m0,603076720,22580278),(.m0,36119536,1017622),(.m0,2159272,1225130759)], + .ms [(.m3,.s6,3121)], + .ms2 .s6 .s7 [(.m6,8945,184)], + .ms2 .s3 .s0 [(.m19,184,8945)], + .ms [(.m17,.s0,3121)], + .ms2 .s3 .s0 [(.m4,1225130759,2159272),(.m1,1017622,36119536),(.m1,22580278,603076720),(.m1,2089229876,72354367036)], + .ms [(.m16,.s3,296645382120718),(.m1,.s3,1215060612732723286),(.m1,.s3,4976888274263486926198),(.m1,.s3,140401799637343942135364590),(.m1,.s3,437454851016946),(.m4,.s3,3211177060457512),(.m10,.s7,3211177060457518),(.m8,.s2,3211177060457513)], + .m .m9, + .b 0 [[([43486543868],[(.D7,3211177060457518),(.D17,437454851016946),(.D18,140401799637343942135364590),(.D18,4976888274263486926198),(.D18,1215060612732723286),(.D18,296645382120718),(.D18,72354367036),(.D6,2089229876),(.D16,603076720),(.D6,22580278),(.D16,36119536),(.D6,1017622),(.D16,2159272),(.D6,1225130759),(.D6,3121),(.D12,8945),(.D6,184),(.D16,4)])]], + .ms [(.m2,.s6,21743271934),(.m3,.s6,3211171624639534),(.m3,.s6,437453492062450),(.m0,.s6,140401799637343941795625966),(.m0,.s6,4976888274263401991542),(.m0,.s6,1215060612711489622),(.m0,.s6,296645376812302)], + .ms2 .s6 .s7 [(.m0,72353039932,2088898100),(.m0,602993776,22559542),(.m0,36114352,1016326),(.m0,2158948,1225130678)], + .ms [(.m12,.s7,3099),(.m0,.s6,8941),(.m3,.s6,182),(.m20,.s0,182),(.m1,.s3,8941),(.m4,.s3,3099)], + .ms2 .s3 .s0 [(.m13,1225130678,2158948),(.m1,1016326,36114352),(.m1,22559542,602993776),(.m1,2088898100,72353039932)], + .ms [(.m16,.s3,296645376812302),(.m1,.s3,1215060612711489622),(.m1,.s3,4976888274263401991542),(.m1,.s3,140401799637343941795625966),(.m1,.s3,437453492062450),(.m4,.s3,3211171624639534),(.m4,.s3,21743271928),(.m10,.s7,21743271934),(.m8,.s2,21743271929)], + .m .m9, + .b 0 [[([86973087734,43486543869,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,21743271934),(.D17,3211171624639534)]),([10871635966],[(.D16,437453492062450),(.D18,140401799637343941795625966),(.D18,4976888274263401991542),(.D18,1215060612711489622),(.D18,296645376812302),(.D18,72353039932),(.D6,2088898100),(.D16,602993776),(.D6,22559542),(.D16,36114352),(.D6,1016326),(.D16,2158948),(.D6,1225130678),(.D12,3099),(.D16,8941),(.D16,182),(.D6,5)])]], + .ms [(.m2,.s6,86973087733),(.m14,.s5,86973087727)], + .m .m5, + .b 86973087733 [[([5],[(.D18,1),(.D15,3211166188821549),(.D14,437452133107954)])]], + .ms [(.m2,.s6,86973087736),(.m7,.s5,86973087730)], + .m .m5, + .b 86973087736 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,86973087737),(.m15,.s5,86973087731)], + .m .m5, + .b 86973087737 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,86973087738),(.m25,.s2,86973087733)], + .m .m18, + .b 86973087738 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,86973087740),(.m14,.s5,86973087734)], + .m .m5, + .b 86973087740 [[([5],[(.D18,1),(.D17,3211166188821548),(.D15,437452133107954),(.D21,140401799637343941455887342),(.D21,4976888274263317056886),(.D21,1215060612690255958),(.D21,296645371503886),(.D21,72351712828),(.D17,2088566324),(.D15,602910832),(.D17,22538806),(.D15,36109168),(.D17,1015030),(.D15,2158624),(.D17,1225130597),(.D17,3080),(.D8,8935)])]], + .ms [(.m2,.s6,86973087743),(.m7,.s5,86973087737)], + .m .m5, + .b 86973087743 [[([59592671229],[(.D8,3211166188821548),(.D16,437452133107954),(.D18,140401799637343941455887342),(.D18,4976888274263317056886),(.D18,1215060612690255958),(.D18,296645371503886),(.D18,72351712828),(.D6,2088566324),(.D16,602910832),(.D6,22538806),(.D16,36109168),(.D6,1015030),(.D16,2158624),(.D6,1225130597),(.D6,3081),(.D9,8935),(.D14,180),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,116769423358,3211158739737646)], + .ms [(.m0,.s6,437450270836978),(.m0,.s6,140401799637343940990319598),(.m0,.s6,4976888274263200664950),(.m0,.s6,1215060612661157974),(.m0,.s6,296645364229390)], + .ms2 .s6 .s7 [(.m0,72349894204,2088111668),(.m0,602797168,22510390),(.m0,36102064,1013254),(.m0,2158180,1225130486)], + .ms [(.m12,.s7,3051),(.m0,.s6,8929),(.m3,.s6,179),(.m21,.s3,179),(.m4,.s3,8929),(.m4,.s3,3051)], + .ms2 .s3 .s0 [(.m13,1225130486,2158180),(.m1,1013254,36102064),(.m1,22510390,602797168),(.m1,2088111668,72349894204)], + .ms [(.m16,.s3,296645364229390),(.m1,.s3,1215060612661157974),(.m1,.s3,4976888274263200664950),(.m1,.s3,140401799637343940990319598),(.m1,.s3,437450270836978)], + .ms2 .s3 .s0 [(.m4,3211158739737646,116769423353)], + .ms [(.m26,.s7,116769423358),(.m8,.s2,116769423353)], + .m .m9, + .b 0 [[([238370684924],[(.D7,116769423358),(.D7,3211158739737645),(.D16,437450270836978),(.D18,140401799637343940990319598),(.D18,4976888274263200664950),(.D18,1215060612661157974),(.D18,296645364229390),(.D18,72349894204),(.D6,2088111668),(.D16,602797168),(.D6,22510390),(.D16,36102064),(.D6,1013254),(.D16,2158180),(.D6,1225130486),(.D12,3051),(.D16,8929),(.D16,179),(.D12,3)])]], + .ms [(.m2,.s6,119185342462)], + .ms2 .s6 .s7 [(.m3,86973087742,3211151290653742)], + .ms [(.m0,.s6,437448408566002),(.m0,.s6,140401799637343940524751854),(.m0,.s6,4976888274263084273014),(.m0,.s6,1215060612632059990),(.m0,.s6,296645356954894)], + .ms2 .s6 .s7 [(.m0,72348075580,2087657012),(.m0,602683504,22481974),(.m0,36094960,1011478),(.m0,2157736,1225130375)], + .ms [(.m3,.s6,3025)], + .ms2 .s6 .s7 [(.m6,8921,178)], + .ms2 .s3 .s0 [(.m19,178,8921)], + .ms [(.m17,.s0,3025)], + .ms2 .s3 .s0 [(.m4,1225130375,2157736),(.m1,1011478,36094960),(.m1,22481974,602683504),(.m1,2087657012,72348075580)], + .ms [(.m16,.s3,296645356954894),(.m1,.s3,1215060612632059990),(.m1,.s3,4976888274263084273014),(.m1,.s3,140401799637343940524751854),(.m1,.s3,437448408566002)], + .ms2 .s3 .s0 [(.m4,3211151290653742,86973087742)], + .ms [(.m1,.s3,119185342456),(.m10,.s7,119185342462),(.m8,.s2,119185342457)], + .m .m91, + ] (by decide +kernel) +theorem chunk_35_step : (cfg_35.denote) [qi]⊢* (cfg_36.denote) := + step_chunk [ + .m .m92, + .b 0 [[([476741369846,219043332102],[(.D7,119185342462),(.D17,86973087742)]),([43486543871],[(.D6,3211151290653742),(.D16,437448408566002),(.D18,140401799637343940524751854),(.D18,4976888274263084273014),(.D18,1215060612632059990),(.D18,296645356954894),(.D18,72348075580),(.D6,2087657012),(.D16,602683504),(.D6,22481974),(.D16,36094960),(.D6,1011478),(.D16,2157736),(.D6,1225130375),(.D6,3025),(.D12,8921),(.D6,178),(.D16,4)])]], + .ms [(.m2,.s6,347892350974),(.m3,.s6,32212254718)], + .ms2 .s6 .s7 [(.m3,65229815806,3211145854835758)], + .ms [(.m0,.s6,437447049611506),(.m0,.s6,140401799637343940185013230),(.m0,.s6,4976888274262999338358),(.m0,.s6,1215060612610826326),(.m0,.s6,296645351646478)], + .ms2 .s6 .s7 [(.m0,72346748476,2087325236),(.m0,602600560,22461238),(.m0,36089776,1010182),(.m0,2157412,1225130294)], + .ms [(.m12,.s7,3003),(.m0,.s6,8917),(.m3,.s6,176),(.m20,.s0,176),(.m1,.s3,8917),(.m4,.s3,3003)], + .ms2 .s3 .s0 [(.m13,1225130294,2157412),(.m1,1010182,36089776),(.m1,22461238,602600560),(.m1,2087325236,72346748476)], + .ms [(.m16,.s3,296645351646478),(.m1,.s3,1215060612610826326),(.m1,.s3,4976888274262999338358),(.m1,.s3,140401799637343940185013230),(.m1,.s3,437447049611506)], + .ms2 .s3 .s0 [(.m4,3211145854835758,65229815806)], + .ms [(.m1,.s3,32212254718),(.m4,.s3,347892350968),(.m10,.s7,347892350974),(.m8,.s2,347892350969)], + .m .m9, + .b 0 [[([1030792150964],[(.D7,347892350974)]),([128849018870,64424509439,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,32212254718),(.D16,65229815806)]),([16106127358],[(.D6,3211145854835758),(.D16,437447049611506),(.D18,140401799637343940185013230),(.D18,4976888274262999338358),(.D18,1215060612610826326),(.D18,296645351646478),(.D18,72346748476),(.D6,2087325236),(.D16,602600560),(.D6,22461238),(.D16,36089776),(.D6,1010182),(.D16,2157412),(.D6,1225130294),(.D12,3003),(.D16,8917),(.D16,176),(.D6,5)])]], + .ms [(.m2,.s6,515396075482),(.m3,.s6,219043332103),(.m14,.s5,219043332103),(.m4,.s5,515396075476)], + .m .m5, + .b 515396075482 [[([23],[(.D16,219043332103),(.D18,1),(.D15,57176752125),(.D16,3211143841569838)])]], + .ms [(.m2,.s6,515396075494),(.m3,.s6,219043332100),(.m7,.s5,219043332100),(.m4,.s5,515396075488)], + .m .m5, + .b 515396075494 [[([7],[(.D16,219043332100),(.D6,1)])]], + .ms [(.m2,.s6,515396075498),(.m6,.s6,219043332098),(.m15,.s5,219043332098),(.m11,.s5,515396075492)], + .m .m5, + .b 515396075498 [[([5],[(.D12,219043332098),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,515396075501,219043332099)], + .ms [(.m23,.s1,219043332099),(.m22,.s4,515396075495)], + .m .m24, + .b 515396075501 [[([17],[(.D6,219043332099),(.D6,2)])]], + .ms [(.m2,.s6,515396075510),(.m6,.s6,219043332095),(.m14,.s5,219043332095),(.m11,.s5,515396075504)], + .m .m5, + .b 515396075510 [[([23],[(.D12,219043332095),(.D18,1),(.D17,57176752124),(.D17,3211143841569838),(.D15,437446546295026),(.D21,140401799637343940059184110),(.D21,4976888274262967881078),(.D21,1215060612602962006),(.D21,296645349680398),(.D21,72346256956),(.D17,2087202356),(.D15,602569840),(.D17,22453558),(.D15,36087856),(.D17,1009702),(.D15,2157292),(.D17,1225130264),(.D11,2995),(.D6,8916)])]], + .ms [(.m2,.s6,515396075522),(.m6,.s6,219043332092),(.m7,.s5,219043332092),(.m11,.s5,515396075516)], + .m .m5, + .b 515396075522 [[([876173328369,438086664189,77309411337],[(.D12,219043332092),(.D8,57176752124),(.D6,3211143841569838)]),([21743271935],[(.D16,437446546295026),(.D18,140401799637343940059184110),(.D18,4976888274262967881078),(.D18,1215060612602962006),(.D18,296645349680398),(.D18,72346256956),(.D6,2087202356),(.D16,602569840),(.D6,22453558),(.D16,36087856),(.D6,1009702),(.D16,2157292),(.D6,1225130264),(.D12,2996),(.D7,8915),(.D8,175),(.D7,4)])]], + .ms [(.m2,.s6,1211180777470)], + .ms2 .s6 .s7 [(.m3,45097156606,13690208254)], + .ms [(.m3,.s6,3211132969933870),(.m3,.s6,437443828386034),(.m0,.s6,140401799637343939379706862),(.m0,.s6,4976888274262798011766),(.m0,.s6,1215060612560494678),(.m0,.s6,296645339063566)], + .ms2 .s6 .s7 [(.m0,72343602748,2086538804),(.m0,602403952,22412086),(.m0,36077488,1007110),(.m0,2156644,1225130102)], + .ms [(.m12,.s7,2955),(.m0,.s6,8905),(.m3,.s6,173),(.m21,.s3,173),(.m4,.s3,8905),(.m4,.s3,2955)], + .ms2 .s3 .s0 [(.m13,1225130102,2156644),(.m1,1007110,36077488),(.m1,22412086,602403952),(.m1,2086538804,72343602748)], + .ms [(.m16,.s3,296645339063566),(.m1,.s3,1215060612560494678),(.m1,.s3,4976888274262798011766),(.m1,.s3,140401799637343939379706862),(.m1,.s3,437443828386034)], + .ms2 .s3 .s0 [(.m4,3211132969933870,13690208254)], + .ms [(.m4,.s3,45097156606),(.m4,.s3,1211180777464),(.m10,.s7,1211180777470),(.m8,.s2,1211180777465)], + .m .m9, + .b 0 [[([1443109011380],[(.D7,1211180777470)]),([180388626422,90194313215,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,45097156606),(.D6,13690208254),(.D6,3211132969933870)]),([5637144575],[(.D16,437443828386034),(.D18,140401799637343939379706862),(.D18,4976888274262798011766),(.D18,1215060612560494678),(.D18,296645339063566),(.D18,72343602748),(.D6,2086538804),(.D16,602403952),(.D6,22412086),(.D16,36077488),(.D6,1007110),(.D16,2156644),(.D6,1225130102),(.D12,2955),(.D16,8905),(.D16,173),(.D12,3)])],[([8],[(.D15,1030792151047),(.D21,0),(.D19,2415919101)])]], + .ms [(.m2,.s6,721554505694),(.m6,.s6,1030792151045),(.m7,.s5,1030792151045),(.m11,.s5,721554505688)], + .m .m5, + .b 721554505694 [[([41],[(.D12,1030792151045),(.D8,1),(.D7,2415919100)])],[([57982058374],[(.D17,1030792151041),(.D2,2415919098)])]], + .ms [(.m2,.s6,750545534902),(.m3,.s6,1023544393744),(.m27,.s2,1023544393744),(.m1,.s5,750545534896)], + .m .m5, + .b 750545534902 [[([7],[(.D16,1023544393744), + (.D6,1)])], + [([16],[(.D11,1023544393742), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,1023544393741), + (.D17,1), + (.D15,0), + (.D6,3211130151361582)])], + [([16],[(.D11,1023544393739), + (.D3,0)])], + [([8],[(.D15,1023544393738), + (.D17,1), + (.D21,3211130151361581), + (.D15,437443123742962), + (.D21,140401799637343939203546094), + (.D21,4976888274262753971574), + (.D21,1215060612549484630), + (.D21,296645336311054), + (.D21,72342914620), + (.D17,2086366772), + (.D15,602360944), + (.D17,22401334), + (.D15,36074800), + (.D17,1006438), + (.D15,2156476), + (.D17,1225130060), + (.D11,2944), + (.D12,8902)])], + [([18],[(.D11,1023544393736), + (.D13,0), + (.D16,3211130151361581), + (.D16,437443123742962)])], + [([148176371686],[(.D17,1023544393735), + (.D12,3211130151361582), + (.D17,437443123742962), + (.D18,140401799637343939203546094), + (.D18,4976888274262753971574), + (.D18,1215060612549484630), + (.D18,296645336311054), + (.D18,72342914620), + (.D6,2086366772), + (.D16,602360944), + (.D6,22401334), + (.D16,36074800), + (.D6,1006438), + (.D16,2156476), + (.D6,1225130060), + (.D12,2945), + (.D13,8902), + (.D9,172), + (.D13,3)])]], + .ms [(.m2,.s6,824633720782)], + .ms2 .s6 .s7 [(.m3,1005022347274,3211125520849968)], + .ms [(.m0,.s6,437441966115058),(.m0,.s6,140401799637343938914139118),(.m0,.s6,4976888274262681619830),(.m0,.s6,1215060612531396694),(.m0,.s6,296645331789070)], + .ms2 .s6 .s7 [(.m0,72341784124,2086084148),(.m0,602290288,22383670),(.m0,36070384,1005334),(.m0,2156200,1225129991)], + .ms [(.m3,.s6,2929)], + .ms2 .s6 .s7 [(.m6,8897,172)], + .ms2 .s3 .s0 [(.m19,172,8897)], + .ms [(.m17,.s0,2929)], + .ms2 .s3 .s0 [(.m4,1225129991,2156200),(.m1,1005334,36070384),(.m1,22383670,602290288),(.m1,2086084148,72341784124)], + .ms [(.m16,.s3,296645331789070),(.m1,.s3,1215060612531396694),(.m1,.s3,4976888274262681619830),(.m1,.s3,140401799637343938914139118),(.m1,.s3,437441966115058)], + .ms2 .s3 .s0 [(.m4,3211125520849968,1005022347274)], + .ms [(.m1,.s3,824633720776),(.m10,.s7,824633720782),(.m8,.s2,824633720777)], + .m .m9, + .b 0 [[([695784701948],[(.D7,824633720782),(.D17,1005022347274),(.D6,3211125520849968),(.D16,437441966115058),(.D18,140401799637343938914139118),(.D18,4976888274262681619830),(.D18,1215060612531396694),(.D18,296645331789070),(.D18,72341784124),(.D6,2086084148),(.D16,602290288),(.D6,22383670),(.D16,36070384),(.D6,1005334),(.D16,2156200),(.D6,1225129991),(.D6,2929),(.D12,8897),(.D6,172),(.D16,4)])]], + .ms [(.m2,.s6,347892350974),(.m3,.s6,737660633038)], + .ms2 .s6 .s7 [(.m3,983279075338,3211120085031984)], + .ms [(.m0,.s6,437440607160562),(.m0,.s6,140401799637343938574400494),(.m0,.s6,4976888274262596685174),(.m0,.s6,1215060612510163030),(.m0,.s6,296645326480654)], + .ms2 .s6 .s7 [(.m0,72340457020,2085752372),(.m0,602207344,22362934),(.m0,36065200,1004038),(.m0,2155876,1225129910)], + .ms [(.m12,.s7,2907),(.m0,.s6,8893),(.m3,.s6,170),(.m20,.s0,170),(.m1,.s3,8893),(.m4,.s3,2907)], + .ms2 .s3 .s0 [(.m13,1225129910,2155876),(.m1,1004038,36065200),(.m1,22362934,602207344),(.m1,2085752372,72340457020)], + .ms [(.m16,.s3,296645326480654),(.m1,.s3,1215060612510163030),(.m1,.s3,4976888274262596685174),(.m1,.s3,140401799637343938574400494),(.m1,.s3,437440607160562)], + .ms2 .s3 .s0 [(.m4,3211120085031984,983279075338)], + .ms [(.m1,.s3,737660633038),(.m4,.s3,347892350968),(.m10,.s7,347892350974),(.m8,.s2,347892350969)], + .m .m9, + .b 0 [[([1391569403894,695784701949,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,347892350974),(.D17,737660633038)]),([173946175486],[(.D16,983279075338),(.D6,3211120085031984),(.D16,437440607160562),(.D18,140401799637343938574400494),(.D18,4976888274262596685174),(.D18,1215060612510163030),(.D18,296645326480654),(.D18,72340457020),(.D6,2085752372),(.D16,602207344),(.D6,22362934),(.D16,36065200),(.D6,1004038),(.D16,2155876),(.D6,1225129910),(.D12,2907),(.D16,8893),(.D16,170),(.D6,5)])]], + .ms [(.m2,.s6,1391569403893),(.m14,.s5,1391569403887)], + .m .m5, + .b 1391569403893 [[([5],[(.D18,1),(.D15,650687545293),(.D14,961535803402)])]], + .ms [(.m2,.s6,1391569403896),(.m7,.s5,1391569403890)], + .m .m5, + .b 1391569403896 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,1391569403897),(.m15,.s5,1391569403891)], + .m .m5, + .b 1391569403897 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,1391569403898),(.m25,.s2,1391569403893)], + .m .m18, + .b 1391569403898 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,1391569403900),(.m14,.s5,1391569403894)], + .m .m5, + .b 1391569403900 [[([5],[(.D18,1),(.D17,650687545292),(.D15,961535803402),(.D17,3211114649214000),(.D15,437439248206066),(.D21,140401799637343938234661870),(.D21,4976888274262511750518),(.D21,1215060612488929366),(.D21,296645321172238),(.D21,72339129916),(.D17,2085420596),(.D15,602124400),(.D17,22342198),(.D15,36060016),(.D17,1002742),(.D15,2155552),(.D17,1225129829),(.D17,2888),(.D8,8887)])]], + .ms [(.m2,.s6,1391569403903),(.m7,.s5,1391569403897)], + .m .m5, + .b 1391569403903 [[([953482739709],[(.D8,650687545292),(.D16,961535803402),(.D6,3211114649214000),(.D16,437439248206066),(.D18,140401799637343938234661870),(.D18,4976888274262511750518),(.D18,1215060612488929366),(.D18,296645321172238),(.D18,72339129916),(.D6,2085420596),(.D16,602124400),(.D6,22342198),(.D16,36060016),(.D6,1002742),(.D16,2155552),(.D6,1225129829),(.D6,2889),(.D9,8887),(.D14,168),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,1868310773758,531502202830),(.m0,931739467786,3211107200130096)], + .ms [(.m0,.s6,437437385935090),(.m0,.s6,140401799637343937769094126),(.m0,.s6,4976888274262395358582),(.m0,.s6,1215060612459831382),(.m0,.s6,296645313897742)], + .ms2 .s6 .s7 [(.m0,72337311292,2084965940),(.m0,602010736,22313782),(.m0,36052912,1000966),(.m0,2155108,1225129718)], + .ms [(.m12,.s7,2859),(.m0,.s6,8881),(.m3,.s6,167),(.m21,.s3,167),(.m4,.s3,8881),(.m4,.s3,2859)], + .ms2 .s3 .s0 [(.m13,1225129718,2155108),(.m1,1000966,36052912),(.m1,22313782,602010736),(.m1,2084965940,72337311292)], + .ms [(.m16,.s3,296645313897742),(.m1,.s3,1215060612459831382),(.m1,.s3,4976888274262395358582),(.m1,.s3,140401799637343937769094126),(.m1,.s3,437437385935090)], + .ms2 .s3 .s0 [(.m4,3211107200130096,931739467786),(.m1,531502202830,1868310773753)], + .ms [(.m26,.s7,1868310773758),(.m8,.s2,1868310773753)], + .m .m9, + .b 0 [[([3813930958844],[(.D7,1868310773758),(.D7,531502202829),(.D16,931739467786),(.D6,3211107200130096),(.D16,437437385935090),(.D18,140401799637343937769094126),(.D18,4976888274262395358582),(.D18,1215060612459831382),(.D18,296645313897742),(.D18,72337311292),(.D6,2084965940),(.D16,602010736),(.D6,22313782),(.D16,36052912),(.D6,1000966),(.D16,2155108),(.D6,1225129718),(.D12,2859),(.D16,8881),(.D16,167),(.D12,3)])]], + .ms [(.m2,.s6,1906965479422)], + .ms2 .s6 .s7 [(.m3,1391569403902,412316860366),(.m0,901943132170,3211099751046192)], + .ms [(.m0,.s6,437435523664114),(.m0,.s6,140401799637343937303526382),(.m0,.s6,4976888274262278966646),(.m0,.s6,1215060612430733398),(.m0,.s6,296645306623246)], + .ms2 .s6 .s7 [(.m0,72335492668,2084511284),(.m0,601897072,22285366),(.m0,36045808,999190),(.m0,2154664,1225129607)], + .ms [(.m3,.s6,2833)], + .ms2 .s6 .s7 [(.m6,8873,166)], + .ms2 .s3 .s0 [(.m19,166,8873)], + .ms [(.m17,.s0,2833)], + .ms2 .s3 .s0 [(.m4,1225129607,2154664),(.m1,999190,36045808),(.m1,22285366,601897072),(.m1,2084511284,72335492668)], + .ms [(.m16,.s3,296645306623246),(.m1,.s3,1215060612430733398),(.m1,.s3,4976888274262278966646),(.m1,.s3,140401799637343937303526382),(.m1,.s3,437435523664114)], + .ms2 .s3 .s0 [(.m4,3211099751046192,901943132170),(.m1,412316860366,1391569403902)], + .ms [(.m1,.s3,1906965479416),(.m10,.s7,1906965479422),(.m8,.s2,1906965479417)], + .m .m9, + .b 0 [[([7627861917686,3504693313542],[(.D7,1906965479422),(.D17,1391569403902)]),([695784701951],[(.D6,412316860366),(.D16,901943132170),(.D6,3211099751046192),(.D16,437435523664114),(.D18,140401799637343937303526382),(.D18,4976888274262278966646),(.D18,1215060612430733398),(.D18,296645306623246),(.D18,72335492668),(.D6,2084511284),(.D16,601897072),(.D6,22285366),(.D16,36045808),(.D6,999190),(.D16,2154664),(.D6,1225129607),(.D6,2833),(.D12,8873),(.D6,166),(.D16,4)])]], + .ms [(.m2,.s6,5566277615614),(.m3,.s6,515396075518)], + .ms2 .s6 .s7 [(.m3,1043677052926,325343772622),(.m0,880199860234,3211094315228208)], + .ms [(.m0,.s6,437434164709618),(.m0,.s6,140401799637343936963787758),(.m0,.s6,4976888274262194031990),(.m0,.s6,1215060612409499734),(.m0,.s6,296645301314830)], + .ms2 .s6 .s7 [(.m0,72334165564,2084179508),(.m0,601814128,22264630),(.m0,36040624,997894),(.m0,2154340,1225129526)], + .ms [(.m12,.s7,2811),(.m0,.s6,8869),(.m3,.s6,164),(.m20,.s0,164),(.m1,.s3,8869),(.m4,.s3,2811)], + .ms2 .s3 .s0 [(.m13,1225129526,2154340),(.m1,997894,36040624),(.m1,22264630,601814128),(.m1,2084179508,72334165564)], + .ms [(.m16,.s3,296645301314830),(.m1,.s3,1215060612409499734),(.m1,.s3,4976888274262194031990),(.m1,.s3,140401799637343936963787758),(.m1,.s3,437434164709618)], + .ms2 .s3 .s0 [(.m4,3211094315228208,880199860234),(.m1,325343772622,1043677052926)], + .ms [(.m1,.s3,515396075518),(.m4,.s3,5566277615608),(.m10,.s7,5566277615614),(.m8,.s2,5566277615609)], + .m .m9, + .b 0 [[([16492674416564],[(.D7,5566277615614)]),([2061584302070,1030792151039,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,515396075518),(.D16,1043677052926)]),([257698037758],[(.D6,325343772622),(.D16,880199860234),(.D6,3211094315228208),(.D16,437434164709618),(.D18,140401799637343936963787758),(.D18,4976888274262194031990),(.D18,1215060612409499734),(.D18,296645301314830),(.D18,72334165564),(.D6,2084179508),(.D16,601814128),(.D6,22264630),(.D16,36040624),(.D6,997894),(.D16,2154340),(.D6,1225129526),(.D12,2811),(.D16,8869),(.D16,164),(.D6,5)])]], + .ms [(.m2,.s6,8246337208282),(.m3,.s6,3504693313543),(.m14,.s5,3504693313543),(.m4,.s5,8246337208276)], + .m .m5, + .b 8246337208282 [[([23],[(.D16,3504693313543),(.D18,1),(.D15,914828034045),(.D16,293131517902)])]], + .ms [(.m2,.s6,8246337208294),(.m3,.s6,3504693313540),(.m7,.s5,3504693313540),(.m4,.s5,8246337208288)], + .m .m5, + .b 8246337208294 [[([7],[(.D16,3504693313540),(.D6,1)])]], + .ms [(.m2,.s6,8246337208298),(.m6,.s6,3504693313538),(.m15,.s5,3504693313538),(.m11,.s5,8246337208292)], + .m .m5, + .b 8246337208298 [[([5],[(.D12,3504693313538),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,8246337208301,3504693313539)], + .ms [(.m23,.s1,3504693313539),(.m22,.s4,8246337208295)], + .m .m24, + .b 8246337208301 [[([17],[(.D6,3504693313539),(.D6,2)])]], + .ms [(.m2,.s6,8246337208310),(.m6,.s6,3504693313535),(.m14,.s5,3504693313535),(.m11,.s5,8246337208304)], + .m .m5, + .b 8246337208310 [[([23],[(.D12,3504693313535),(.D18,1),(.D17,914828034044),(.D17,293131517902),(.D15,872146796554),(.D17,3211092301962288),(.D15,437433661393138),(.D21,140401799637343936837958638),(.D21,4976888274262162574710),(.D21,1215060612401635414),(.D21,296645299348750),(.D21,72333674044),(.D17,2084056628),(.D15,601783408),(.D17,22256950),(.D15,36038704),(.D17,997414),(.D15,2154220),(.D17,1225129496),(.D11,2803),(.D6,8868)])]], + .ms [(.m2,.s6,8246337208322),(.m6,.s6,3504693313532),(.m7,.s5,3504693313532),(.m11,.s5,8246337208316)], + .m .m5, + .b 8246337208322 [[([14018773254129,7009386627069,1236950581257],[(.D12,3504693313532),(.D8,914828034044),(.D6,293131517902),(.D16,872146796554)]),([86973087743],[(.D6,3211092301962288),(.D16,437433661393138),(.D18,140401799637343936837958638),(.D18,4976888274262162574710),(.D18,1215060612401635414),(.D18,296645299348750),(.D18,72333674044),(.D6,2084056628),(.D16,601783408),(.D6,22256950),(.D16,36038704),(.D6,997414),(.D16,2154220),(.D6,1225129496),(.D12,2804),(.D7,8867),(.D8,163),(.D7,4)])]], + .ms [(.m2,.s6,19378892439550)], + .ms2 .s6 .s7 [(.m3,721554505726,219043332094)], + .ms [(.m3,.s6,119185342414)], + .ms2 .s6 .s7 [(.m3,828660252682,3211081430326320)], + .ms [(.m0,.s6,437430943484146),(.m0,.s6,140401799637343936158481390),(.m0,.s6,4976888274261992705398),(.m0,.s6,1215060612359168086),(.m0,.s6,296645288731918)], + .ms2 .s6 .s7 [(.m0,72331019836,2083393076),(.m0,601617520,22215478),(.m0,36028336,994822),(.m0,2153572,1225129334)], + .ms [(.m12,.s7,2763),(.m0,.s6,8857),(.m3,.s6,161),(.m21,.s3,161),(.m4,.s3,8857),(.m4,.s3,2763)], + .ms2 .s3 .s0 [(.m13,1225129334,2153572),(.m1,994822,36028336),(.m1,22215478,601617520),(.m1,2083393076,72331019836)], + .ms [(.m16,.s3,296645288731918),(.m1,.s3,1215060612359168086),(.m1,.s3,4976888274261992705398),(.m1,.s3,140401799637343936158481390),(.m1,.s3,437430943484146)], + .ms2 .s3 .s0 [(.m4,3211081430326320,828660252682),(.m1,119185342414,219043332094)], + .ms [(.m4,.s3,721554505726),(.m4,.s3,19378892439544),(.m10,.s7,19378892439550),(.m8,.s2,19378892439545)], + .m .m9, + .b 0 [[([23089744183220],[(.D7,19378892439550)]),([2886218022902,1443109011455,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,721554505726),(.D6,219043332094),(.D6,119185342414)]),([90194313215],[(.D16,828660252682),(.D6,3211081430326320),(.D16,437430943484146),(.D18,140401799637343936158481390),(.D18,4976888274261992705398),(.D18,1215060612359168086),(.D18,296645288731918),(.D18,72331019836),(.D6,2083393076),(.D16,601617520),(.D6,22215478),(.D16,36028336),(.D6,994822),(.D16,2153572),(.D6,1225129334),(.D12,2763),(.D16,8857),(.D16,161),(.D12,3)])],[([8],[(.D15,16492674416647),(.D21,0),(.D19,38654705661)])]], + .ms [(.m2,.s6,11544872091614),(.m6,.s6,16492674416645),(.m7,.s5,16492674416645),(.m11,.s5,11544872091608)], + .m .m5, + .b 11544872091614 [[([41],[(.D12,16492674416645),(.D8,1),(.D7,38654705660)])],[([927712935814],[(.D17,16492674416641),(.D2,38654705658)])]], + .ms [(.m2,.s6,12008728559542),(.m3,.s6,16376710299664),(.m27,.s2,16376710299664),(.m1,.s5,12008728559536)], + .m .m5, + .b 12008728559542 [[([7],[(.D16,16376710299664), + (.D6,1)])], + [([16],[(.D11,16376710299662), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,16376710299661), + (.D17,1), + (.D15,0), + (.D6,74088185806)])], + [([16],[(.D11,16376710299659), + (.D3,0)])], + [([8],[(.D15,16376710299658), + (.D17,1), + (.D21,74088185805), + (.D15,817385963530), + (.D17,3211078611754032), + (.D15,437430238841074), + (.D21,140401799637343935982320622), + (.D21,4976888274261948665206), + (.D21,1215060612348158038), + (.D21,296645285979406), + (.D21,72330331708), + (.D17,2083221044), + (.D15,601574512), + (.D17,22204726), + (.D15,36025648), + (.D17,994150), + (.D15,2153404), + (.D17,1225129292), + (.D11,2752), + (.D12,8854)])], + [([18],[(.D11,16376710299656), + (.D13,0), + (.D16,74088185805), + (.D16,817385963530)])], + [([2370821945796],[(.D17,16376710299655)]), + ([296352743227,148176371615,74088185808,37044092904,18522046452,9261023223,4630511613,2315255808,1157627904,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,74088185806), + (.D17,817385963530)]), + ([37044092903],[(.D6,3211078611754032), + (.D16,437430238841074), + (.D18,140401799637343935982320622), + (.D18,4976888274261948665206), + (.D18,1215060612348158038), + (.D18,296645285979406), + (.D18,72330331708), + (.D6,2083221044), + (.D16,601574512), + (.D6,22204726), + (.D16,36025648), + (.D6,994150), + (.D16,2153404), + (.D6,1225129292), + (.D12,2753), + (.D13,8854), + (.D9,160), + (.D13,3)])], + [([10],[(.D17,16080357556431), + (.D21,0), + (.D19,798863917078)])]], + .ms [(.m2,.s6,13194139532482),(.m3,.s6,16080357556429),(.m7,.s5,16080357556429),(.m4,.s5,13194139532476)], + .m .m5, + .b 13194139532482 [[([43],[(.D16,16080357556429),(.D8,1),(.D7,798863917077)])],[([19172734009818],[(.D11,16080357556422),(.D2,798863917075)])]], + .ms2 .s6 .s7 [(.m2,22780506537413,13683765805197)], + .ms [(.m29,.s2,13683765805197),(.m4,.s5,22780506537407)], + .m .m5, + .b 22780506537413 [[([9],[(.D6,13683765805197),(.D6,1)])],[([20],[(.D15,13683765805195),(.D13,0),(.D10,3211073981242418),(.D9,437429081213170)])],[([36],[(.D11,13683765805191)]),([7,2],[(.D12,1),(.D6,3211073981242418)])]], + .ms [(.m2,.s6,22780506537446),(.m6,.s6,13683765805187),(.m15,.s5,13683765805187),(.m11,.s5,22780506537440)], + .m .m5, + .b 22780506537446 [[([5],[(.D12,13683765805187),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,22780506537449,13683765805188)], + .ms [(.m23,.s1,13683765805188),(.m22,.s4,22780506537443)], + .m .m24, + .b 22780506537449 [[([17],[(.D6,13683765805188),(.D6,2)])],[([6],[(.D11,13683765805184),(.D21,0),(.D7,3211073981242416)])]], + .ms2 .s6 .s7 [(.m2,22780506537461,13683765805185)], + .ms2 .s5 .s2 [(.m28,13683765805185,22780506537456)], + .m .m18, + .b 22780506537461 [[([45],[(.D6,13683765805185),(.D8,1),(.D17,3211073981242415),(.D10,437429081213169)])],[([36],[(.D15,13683765805178)]),([7,2],[(.D12,1),(.D17,3211073981242414)]),([1],[(.D11,437429081213169),(.D20,140401799637343935692913646)])],[([8],[(.D15,13683765805174),(.D21,0),(.D17,3211073981242413),(.D12,437429081213170)])]], + .ms [(.m2,.s6,22780506537506),(.m6,.s6,13683765805172),(.m7,.s5,13683765805172),(.m11,.s5,22780506537500)], + .m .m5, + .b 22780506537506 [[([39],[(.D12,13683765805172),(.D8,3211073981242414),(.D13,437429081213170),(.D21,140401799637343935692913646),(.D21,4976888274261876313462),(.D21,1215060612330070102),(.D21,296645281457422),(.D21,72329201212),(.D17,2082938420),(.D15,601503856),(.D17,22187062),(.D15,36021232),(.D17,993046),(.D15,2153128),(.D17,1225129223),(.D17,2737),(.D11,8849),(.D17,160),(.D15,3)])]], + .ms [(.m2,.s6,22780506537526)], + .ms2 .s6 .s7 [(.m3,13683765805168,3211073981242414)], + .ms [(.m0,.s6,437429081213170),(.m0,.s6,140401799637343935692913646),(.m0,.s6,4976888274261876313462),(.m0,.s6,1215060612330070102),(.m0,.s6,296645281457422)], + .ms2 .s6 .s7 [(.m0,72329201212,2082938420)], + .m .m0, + ] (by decide +kernel) +theorem chunk_36_step : (cfg_36.denote) [qi]⊢* (cfg_37.denote) := + step_chunk [ + .s2 .s6 .s7 [(601503856,22187062)], + .ms2 .s6 .s7 [(.m0,36021232,993046),(.m0,2153128,1225129223)], + .ms [(.m3,.s6,2737)], + .ms2 .s6 .s7 [(.m6,8849,160)], + .ms2 .s3 .s0 [(.m19,160,8849)], + .ms [(.m17,.s0,2737)], + .ms2 .s3 .s0 [(.m4,1225129223,2153128),(.m1,993046,36021232),(.m1,22187062,601503856),(.m1,2082938420,72329201212)], + .ms [(.m16,.s3,296645281457422),(.m1,.s3,1215060612330070102),(.m1,.s3,4976888274261876313462),(.m1,.s3,140401799637343935692913646),(.m1,.s3,437429081213170)], + .ms2 .s3 .s0 [(.m4,3211073981242414,13683765805168)], + .ms [(.m1,.s3,22780506537520),(.m10,.s7,22780506537526),(.m8,.s2,22780506537521)], + .m .m9, + .b 0 [[([695784701948],[(.D7,22780506537526),(.D17,13683765805168),(.D6,3211073981242414),(.D16,437429081213170),(.D18,140401799637343935692913646),(.D18,4976888274261876313462),(.D18,1215060612330070102),(.D18,296645281457422),(.D18,72329201212),(.D6,2082938420),(.D16,601503856),(.D6,22187062),(.D16,36021232),(.D6,993046),(.D16,2153128),(.D6,1225129223),(.D6,2737),(.D12,8849),(.D6,160),(.D16,4)])]], + .ms [(.m2,.s6,347892350974),(.m3,.s6,22693533449782)], + .ms2 .s6 .s7 [(.m3,13662022533232,3211068545424430)], + .ms [(.m0,.s6,437427722258674),(.m0,.s6,140401799637343935353175022),(.m0,.s6,4976888274261791378806),(.m0,.s6,1215060612308836438),(.m0,.s6,296645276149006)], + .ms2 .s6 .s7 [(.m0,72327874108,2082606644),(.m0,601420912,22166326),(.m0,36016048,991750),(.m0,2152804,1225129142)], + .ms [(.m12,.s7,2715),(.m0,.s6,8845),(.m3,.s6,158),(.m20,.s0,158),(.m1,.s3,8845),(.m4,.s3,2715)], + .ms2 .s3 .s0 [(.m13,1225129142,2152804),(.m1,991750,36016048),(.m1,22166326,601420912),(.m1,2082606644,72327874108)], + .ms [(.m16,.s3,296645276149006),(.m1,.s3,1215060612308836438),(.m1,.s3,4976888274261791378806),(.m1,.s3,140401799637343935353175022),(.m1,.s3,437427722258674)], + .ms2 .s3 .s0 [(.m4,3211068545424430,13662022533232)], + .ms [(.m1,.s3,22693533449782),(.m4,.s3,347892350968),(.m10,.s7,347892350974),(.m8,.s2,347892350969)], + .m .m9, + .b 0 [[([1391569403894,695784701949,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,347892350974),(.D17,22693533449782)]),([173946175486],[(.D16,13662022533232),(.D6,3211068545424430),(.D16,437427722258674),(.D18,140401799637343935353175022),(.D18,4976888274261791378806),(.D18,1215060612308836438),(.D18,296645276149006),(.D18,72327874108),(.D6,2082606644),(.D16,601420912),(.D6,22166326),(.D16,36016048),(.D6,991750),(.D16,2152804),(.D6,1225129142),(.D12,2715),(.D16,8845),(.D16,158),(.D6,5)])]], + .ms [(.m2,.s6,1391569403893),(.m14,.s5,1391569403887)], + .m .m5, + .b 1391569403893 [[([5],[(.D18,1),(.D15,22606560362037),(.D14,13640279261296)])]], + .ms [(.m2,.s6,1391569403896),(.m7,.s5,1391569403890)], + .m .m5, + .b 1391569403896 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,1391569403897),(.m15,.s5,1391569403891)], + .m .m5, + .b 1391569403897 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,1391569403898),(.m25,.s2,1391569403893)], + .m .m18, + .b 1391569403898 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,1391569403900),(.m14,.s5,1391569403894)], + .m .m5, + .b 1391569403900 [[([5],[(.D18,1),(.D17,22606560362036),(.D15,13640279261296),(.D17,3211063109606446),(.D15,437426363304178),(.D21,140401799637343935013436398),(.D21,4976888274261706444150),(.D21,1215060612287602774),(.D21,296645270840590),(.D21,72326547004),(.D17,2082274868),(.D15,601337968),(.D17,22145590),(.D15,36010864),(.D17,990454),(.D15,2152480),(.D17,1225129061),(.D17,2696),(.D8,8839)])]], + .ms [(.m2,.s6,1391569403903),(.m7,.s5,1391569403897)], + .m .m5, + .b 1391569403903 [[([953482739709],[(.D8,22606560362036),(.D16,13640279261296),(.D6,3211063109606446),(.D16,437426363304178),(.D18,140401799637343935013436398),(.D18,4976888274261706444150),(.D18,1215060612287602774),(.D18,296645270840590),(.D18,72326547004),(.D6,2082274868),(.D16,601337968),(.D6,22145590),(.D16,36010864),(.D6,990454),(.D16,2152480),(.D6,1225129061),(.D6,2697),(.D9,8839),(.D14,156),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,1868310773758,22487375019574),(.m0,13610482925680,3211055660522542)], + .ms [(.m0,.s6,437424501033202),(.m0,.s6,140401799637343934547868654),(.m0,.s6,4976888274261590052214),(.m0,.s6,1215060612258504790),(.m0,.s6,296645263566094)], + .ms2 .s6 .s7 [(.m0,72324728380,2081820212),(.m0,601224304,22117174),(.m0,36003760,988678),(.m0,2152036,1225128950)], + .ms [(.m12,.s7,2667),(.m0,.s6,8833),(.m3,.s6,155),(.m21,.s3,155),(.m4,.s3,8833),(.m4,.s3,2667)], + .ms2 .s3 .s0 [(.m13,1225128950,2152036),(.m1,988678,36003760),(.m1,22117174,601224304),(.m1,2081820212,72324728380)], + .ms [(.m16,.s3,296645263566094),(.m1,.s3,1215060612258504790),(.m1,.s3,4976888274261590052214),(.m1,.s3,140401799637343934547868654),(.m1,.s3,437424501033202)], + .ms2 .s3 .s0 [(.m4,3211055660522542,13610482925680),(.m1,22487375019574,1868310773753)], + .ms [(.m26,.s7,1868310773758),(.m8,.s2,1868310773753)], + .m .m9, + .b 0 [[([3813930958844],[(.D7,1868310773758),(.D7,22487375019573),(.D16,13610482925680),(.D6,3211055660522542),(.D16,437424501033202),(.D18,140401799637343934547868654),(.D18,4976888274261590052214),(.D18,1215060612258504790),(.D18,296645263566094),(.D18,72324728380),(.D6,2081820212),(.D16,601224304),(.D6,22117174),(.D16,36003760),(.D6,988678),(.D16,2152036),(.D6,1225128950),(.D12,2667),(.D16,8833),(.D16,155),(.D12,3)])]], + .ms [(.m2,.s6,1906965479422)], + .ms2 .s6 .s7 [(.m3,1391569403902,22368189677110),(.m0,13580686590064,3211048211438638)], + .ms [(.m0,.s6,437422638762226),(.m0,.s6,140401799637343934082300910),(.m0,.s6,4976888274261473660278),(.m0,.s6,1215060612229406806),(.m0,.s6,296645256291598)], + .ms2 .s6 .s7 [(.m0,72322909756,2081365556),(.m0,601110640,22088758),(.m0,35996656,986902),(.m0,2151592,1225128839)], + .ms [(.m3,.s6,2641)], + .ms2 .s6 .s7 [(.m6,8825,154)], + .ms2 .s3 .s0 [(.m19,154,8825)], + .ms [(.m17,.s0,2641)], + .ms2 .s3 .s0 [(.m4,1225128839,2151592),(.m1,986902,35996656),(.m1,22088758,601110640),(.m1,2081365556,72322909756)], + .ms [(.m16,.s3,296645256291598),(.m1,.s3,1215060612229406806),(.m1,.s3,4976888274261473660278),(.m1,.s3,140401799637343934082300910),(.m1,.s3,437422638762226)], + .ms2 .s3 .s0 [(.m4,3211048211438638,13580686590064),(.m1,22368189677110,1391569403902)], + .ms [(.m1,.s3,1906965479416),(.m10,.s7,1906965479422),(.m8,.s2,1906965479417)], + .m .m9, + .b 0 [[([7627861917686,3504693313542],[(.D7,1906965479422),(.D17,1391569403902)]),([695784701951],[(.D6,22368189677110),(.D16,13580686590064),(.D6,3211048211438638),(.D16,437422638762226),(.D18,140401799637343934082300910),(.D18,4976888274261473660278),(.D18,1215060612229406806),(.D18,296645256291598),(.D18,72322909756),(.D6,2081365556),(.D16,601110640),(.D6,22088758),(.D16,35996656),(.D6,986902),(.D16,2151592),(.D6,1225128839),(.D6,2641),(.D12,8825),(.D6,154),(.D16,4)])]], + .ms [(.m2,.s6,5566277615614),(.m3,.s6,515396075518)], + .ms2 .s6 .s7 [(.m3,1043677052926,22281216589366),(.m0,13558943318128,3211042775620654)], + .ms [(.m0,.s6,437421279807730),(.m0,.s6,140401799637343933742562286),(.m0,.s6,4976888274261388725622),(.m0,.s6,1215060612208173142),(.m0,.s6,296645250983182)], + .ms2 .s6 .s7 [(.m0,72321582652,2081033780),(.m0,601027696,22068022),(.m0,35991472,985606),(.m0,2151268,1225128758)], + .ms [(.m12,.s7,2619),(.m0,.s6,8821),(.m3,.s6,152),(.m20,.s0,152),(.m1,.s3,8821),(.m4,.s3,2619)], + .ms2 .s3 .s0 [(.m13,1225128758,2151268),(.m1,985606,35991472),(.m1,22068022,601027696),(.m1,2081033780,72321582652)], + .ms [(.m16,.s3,296645250983182),(.m1,.s3,1215060612208173142),(.m1,.s3,4976888274261388725622),(.m1,.s3,140401799637343933742562286),(.m1,.s3,437421279807730)], + .ms2 .s3 .s0 [(.m4,3211042775620654,13558943318128),(.m1,22281216589366,1043677052926)], + .ms [(.m1,.s3,515396075518),(.m4,.s3,5566277615608),(.m10,.s7,5566277615614),(.m8,.s2,5566277615609)], + .m .m9, + .b 0 [[([16492674416564],[(.D7,5566277615614)]),([2061584302070,1030792151039,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,515396075518),(.D16,1043677052926)]),([257698037758],[(.D6,22281216589366),(.D16,13558943318128),(.D6,3211042775620654),(.D16,437421279807730),(.D18,140401799637343933742562286),(.D18,4976888274261388725622),(.D18,1215060612208173142),(.D18,296645250983182),(.D18,72321582652),(.D6,2081033780),(.D16,601027696),(.D6,22068022),(.D16,35991472),(.D6,985606),(.D16,2151268),(.D6,1225128758),(.D12,2619),(.D16,8821),(.D16,152),(.D6,5)])]], + .ms [(.m2,.s6,8246337208282),(.m3,.s6,3504693313543),(.m14,.s5,3504693313543),(.m4,.s5,8246337208276)], + .m .m5, + .b 8246337208282 [[([23],[(.D16,3504693313543),(.D18,1),(.D15,914828034045),(.D16,22249004334646)])]], + .ms [(.m2,.s6,8246337208294),(.m3,.s6,3504693313540),(.m7,.s5,3504693313540),(.m4,.s5,8246337208288)], + .m .m5, + .b 8246337208294 [[([7],[(.D16,3504693313540),(.D6,1)])]], + .ms [(.m2,.s6,8246337208298),(.m6,.s6,3504693313538),(.m15,.s5,3504693313538),(.m11,.s5,8246337208292)], + .m .m5, + .b 8246337208298 [[([5],[(.D12,3504693313538),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,8246337208301,3504693313539)], + .ms [(.m23,.s1,3504693313539),(.m22,.s4,8246337208295)], + .m .m24, + .b 8246337208301 [[([17],[(.D6,3504693313539),(.D6,2)])]], + .ms [(.m2,.s6,8246337208310),(.m6,.s6,3504693313535),(.m14,.s5,3504693313535),(.m11,.s5,8246337208304)], + .m .m5, + .b 8246337208310 [[([23],[(.D12,3504693313535),(.D18,1),(.D17,914828034044),(.D17,22249004334646),(.D15,13550890254448),(.D17,3211040762354734),(.D15,437420776491250),(.D21,140401799637343933616733166),(.D21,4976888274261357268342),(.D21,1215060612200308822),(.D21,296645249017102),(.D21,72321091132),(.D17,2080910900),(.D15,600996976),(.D17,22060342),(.D15,35989552),(.D17,985126),(.D15,2151148),(.D17,1225128728),(.D11,2611),(.D6,8820)])]], + .ms [(.m2,.s6,8246337208322),(.m6,.s6,3504693313532),(.m7,.s5,3504693313532),(.m11,.s5,8246337208316)], + .m .m5, + .b 8246337208322 [[([14018773254129,7009386627069,1236950581257],[(.D12,3504693313532),(.D8,914828034044),(.D6,22249004334646)]),([347892350975],[(.D16,13550890254448),(.D6,3211040762354734),(.D16,437420776491250),(.D18,140401799637343933616733166),(.D18,4976888274261357268342),(.D18,1215060612200308822),(.D18,296645249017102),(.D18,72321091132),(.D6,2080910900),(.D16,600996976),(.D6,22060342),(.D16,35989552),(.D6,985126),(.D16,2151148),(.D6,1225128728),(.D12,2612),(.D7,8819),(.D8,151),(.D7,4)])]], + .ms [(.m2,.s6,19378892439550)], + .ms2 .s6 .s7 [(.m3,721554505726,219043332094)], + .ms [(.m3,.s6,22075058159158)], + .ms2 .s6 .s7 [(.m3,13507403710576,3211029890718766)], + .ms [(.m0,.s6,437418058582258),(.m0,.s6,140401799637343932937255918),(.m0,.s6,4976888274261187399030),(.m0,.s6,1215060612157841494),(.m0,.s6,296645238400270)], + .ms2 .s6 .s7 [(.m0,72318436924,2080247348),(.m0,600831088,22018870),(.m0,35979184,982534),(.m0,2150500,1225128566)], + .ms [(.m12,.s7,2571),(.m0,.s6,8809),(.m3,.s6,149),(.m21,.s3,149),(.m4,.s3,8809),(.m4,.s3,2571)], + .ms2 .s3 .s0 [(.m13,1225128566,2150500),(.m1,982534,35979184),(.m1,22018870,600831088),(.m1,2080247348,72318436924)], + .ms [(.m16,.s3,296645238400270),(.m1,.s3,1215060612157841494),(.m1,.s3,4976888274261187399030),(.m1,.s3,140401799637343932937255918),(.m1,.s3,437418058582258)], + .ms2 .s3 .s0 [(.m4,3211029890718766,13507403710576),(.m1,22075058159158,219043332094)], + .ms [(.m4,.s3,721554505726),(.m4,.s3,19378892439544),(.m10,.s7,19378892439550),(.m8,.s2,19378892439545)], + .m .m9, + .b 0 [[([23089744183220],[(.D7,19378892439550)]),([2886218022902,1443109011455,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,721554505726),(.D6,219043332094),(.D6,22075058159158)]),([90194313215],[(.D16,13507403710576),(.D6,3211029890718766),(.D16,437418058582258),(.D18,140401799637343932937255918),(.D18,4976888274261187399030),(.D18,1215060612157841494),(.D18,296645238400270),(.D18,72318436924),(.D6,2080247348),(.D16,600831088),(.D6,22018870),(.D16,35979184),(.D6,982534),(.D16,2150500),(.D6,1225128566),(.D12,2571),(.D16,8809),(.D16,149),(.D12,3)])],[([8],[(.D15,16492674416647),(.D21,0),(.D19,38654705661)])]], + .ms [(.m2,.s6,11544872091614),(.m6,.s6,16492674416645),(.m7,.s5,16492674416645),(.m11,.s5,11544872091608)], + .m .m5, + .b 11544872091614 [[([41],[(.D12,16492674416645),(.D8,1),(.D7,38654705660)])],[([927712935814],[(.D17,16492674416641),(.D2,38654705658)])]], + .ms [(.m2,.s6,12008728559542),(.m3,.s6,16376710299664),(.m27,.s2,16376710299664),(.m1,.s5,12008728559536)], + .m .m5, + .b 12008728559542 [[([7],[(.D16,16376710299664), + (.D6,1)])], + [([16],[(.D11,16376710299662), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,16376710299661), + (.D17,1), + (.D15,0), + (.D6,22029961002550)])], + [([16],[(.D11,16376710299659), + (.D3,0)])], + [([8],[(.D15,16376710299658), + (.D17,1), + (.D21,22029961002549), + (.D15,13496129421424), + (.D17,3211027072146478), + (.D15,437417353939186), + (.D21,140401799637343932761095150), + (.D21,4976888274261143358838), + (.D21,1215060612146831446), + (.D21,296645235647758), + (.D21,72317748796), + (.D17,2080075316), + (.D15,600788080), + (.D17,22008118), + (.D15,35976496), + (.D17,981862), + (.D15,2150332), + (.D17,1225128524), + (.D11,2560), + (.D12,8806)])], + [([18],[(.D11,16376710299656), + (.D13,0), + (.D16,22029961002549), + (.D16,13496129421424)])], + [([2370821947366],[(.D17,16376710299655), + (.D12,22029961002550), + (.D17,13496129421424), + (.D6,3211027072146478), + (.D16,437417353939186), + (.D18,140401799637343932761095150), + (.D18,4976888274261143358838), + (.D18,1215060612146831446), + (.D18,296645235647758), + (.D18,72317748796), + (.D6,2080075316), + (.D16,600788080), + (.D6,22008118), + (.D16,35976496), + (.D6,981862), + (.D16,2150332), + (.D6,1225128524), + (.D12,2561), + (.D13,8806), + (.D9,148), + (.D13,3)])]], + .ms [(.m2,.s6,13194139533262)], + .ms2 .s6 .s7 [(.m3,16080357556234,21955872816696),(.m0,13477607374960,3211022441634862)], + .ms [(.m0,.s6,437416196311282),(.m0,.s6,140401799637343932471688174),(.m0,.s6,4976888274261071007094),(.m0,.s6,1215060612128743510),(.m0,.s6,296645231125774)], + .ms2 .s6 .s7 [(.m0,72316618300,2079792692),(.m0,600717424,21990454),(.m0,35972080,980758),(.m0,2150056,1225128455)], + .ms [(.m3,.s6,2545)], + .ms2 .s6 .s7 [(.m6,8801,148)], + .ms2 .s3 .s0 [(.m19,148,8801)], + .ms [(.m17,.s0,2545)], + .ms2 .s3 .s0 [(.m4,1225128455,2150056),(.m1,980758,35972080),(.m1,21990454,600717424),(.m1,2079792692,72316618300)], + .ms [(.m16,.s3,296645231125774),(.m1,.s3,1215060612128743510),(.m1,.s3,4976888274261071007094),(.m1,.s3,140401799637343932471688174),(.m1,.s3,437416196311282)], + .ms2 .s3 .s0 [(.m4,3211022441634862,13477607374960),(.m1,21955872816696,16080357556234)], + .ms [(.m1,.s3,13194139533256),(.m10,.s7,13194139533262),(.m8,.s2,13194139533257)], + .m .m9, + .b 0 [[([11132555231228],[(.D7,13194139533262),(.D17,16080357556234),(.D6,21955872816696),(.D16,13477607374960),(.D6,3211022441634862),(.D16,437416196311282),(.D18,140401799637343932471688174),(.D18,4976888274261071007094),(.D18,1215060612128743510),(.D18,296645231125774),(.D18,72316618300),(.D6,2079792692),(.D16,600717424),(.D6,21990454),(.D16,35972080),(.D6,980758),(.D16,2150056),(.D6,1225128455),(.D6,2545),(.D12,8801),(.D6,148),(.D16,4)])]], + .ms [(.m2,.s6,5566277615614),(.m3,.s6,11802570129358)], + .ms2 .s6 .s7 [(.m3,15732465205258,21868899728952),(.m0,13455864103024,3211017005816878)], + .ms [(.m0,.s6,437414837356786),(.m0,.s6,140401799637343932131949550),(.m0,.s6,4976888274260986072438),(.m0,.s6,1215060612107509846),(.m0,.s6,296645225817358)], + .ms2 .s6 .s7 [(.m0,72315291196,2079460916),(.m0,600634480,21969718),(.m0,35966896,979462),(.m0,2149732,1225128374)], + .ms [(.m12,.s7,2523),(.m0,.s6,8797),(.m3,.s6,146),(.m20,.s0,146),(.m1,.s3,8797),(.m4,.s3,2523)], + .ms2 .s3 .s0 [(.m13,1225128374,2149732),(.m1,979462,35966896),(.m1,21969718,600634480),(.m1,2079460916,72315291196)], + .ms [(.m16,.s3,296645225817358),(.m1,.s3,1215060612107509846),(.m1,.s3,4976888274260986072438),(.m1,.s3,140401799637343932131949550),(.m1,.s3,437414837356786)], + .ms2 .s3 .s0 [(.m4,3211017005816878,13455864103024),(.m1,21868899728952,15732465205258)], + .ms [(.m1,.s3,11802570129358),(.m4,.s3,5566277615608),(.m10,.s7,5566277615614),(.m8,.s2,5566277615609)], + .m .m9, + .b 0 [[([22265110462454,11132555231229,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,5566277615614),(.D17,11802570129358)]),([2783138807806],[(.D16,15732465205258),(.D6,21868899728952),(.D16,13455864103024),(.D6,3211017005816878),(.D16,437414837356786),(.D18,140401799637343932131949550),(.D18,4976888274260986072438),(.D18,1215060612107509846),(.D18,296645225817358),(.D18,72315291196),(.D6,2079460916),(.D16,600634480),(.D6,21969718),(.D16,35966896),(.D6,979462),(.D16,2149732),(.D6,1225128374),(.D12,2523),(.D16,8797),(.D16,146),(.D6,5)])]], + .ms [(.m2,.s6,22265110462453),(.m14,.s5,22265110462447)], + .m .m5, + .b 22265110462453 [[([5],[(.D18,1),(.D15,10411000725453),(.D14,15384572854282)])]], + .ms [(.m2,.s6,22265110462456),(.m7,.s5,22265110462450)], + .m .m5, + .b 22265110462456 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,22265110462457),(.m15,.s5,22265110462451)], + .m .m5, + .b 22265110462457 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,22265110462458),(.m25,.s2,22265110462453)], + .m .m18, + .b 22265110462458 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,22265110462460),(.m14,.s5,22265110462454)], + .m .m5, + .b 22265110462460 [[([5],[(.D18,1),(.D17,10411000725452),(.D15,15384572854282),(.D17,21781926641208),(.D15,13434120831088),(.D17,3211011569998894),(.D15,437413478402290),(.D21,140401799637343931792210926),(.D21,4976888274260901137782),(.D21,1215060612086276182),(.D21,296645220508942),(.D21,72313964092),(.D17,2079129140),(.D15,600551536),(.D17,21948982),(.D15,35961712),(.D17,978166),(.D15,2149408),(.D17,1225128293),(.D17,2504),(.D8,8791)])]], + .ms [(.m2,.s6,22265110462463),(.m7,.s5,22265110462457)], + .m .m5, + .b 22265110462463 [[([15255723835389],[(.D8,10411000725452),(.D16,15384572854282),(.D6,21781926641208),(.D16,13434120831088),(.D6,3211011569998894),(.D16,437413478402290),(.D18,140401799637343931792210926),(.D18,4976888274260901137782),(.D18,1215060612086276182),(.D18,296645220508942),(.D18,72313964092),(.D6,2079129140),(.D16,600551536),(.D6,21948982),(.D16,35961712),(.D6,978166),(.D16,2149408),(.D6,1225128293),(.D6,2505),(.D9,8791),(.D14,144),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,29892972380158,8504035246030),(.m0,14907831484426,21662741298744),(.m0,13404324495472,3211004120914990)], + .ms [(.m0,.s6,437411616131314),(.m0,.s6,140401799637343931326643182),(.m0,.s6,4976888274260784745846),(.m0,.s6,1215060612057178198),(.m0,.s6,296645213234446)], + .ms2 .s6 .s7 [(.m0,72312145468,2078674484),(.m0,600437872,21920566),(.m0,35954608,976390),(.m0,2148964,1225128182)], + .ms [(.m12,.s7,2475),(.m0,.s6,8785),(.m3,.s6,143),(.m21,.s3,143),(.m4,.s3,8785),(.m4,.s3,2475)], + .ms2 .s3 .s0 [(.m13,1225128182,2148964),(.m1,976390,35954608),(.m1,21920566,600437872),(.m1,2078674484,72312145468)], + .ms [(.m16,.s3,296645213234446),(.m1,.s3,1215060612057178198),(.m1,.s3,4976888274260784745846),(.m1,.s3,140401799637343931326643182),(.m1,.s3,437411616131314)], + .ms2 .s3 .s0 [(.m4,3211004120914990,13404324495472),(.m1,21662741298744,14907831484426),(.m1,8504035246030,29892972380153)], + .ms [(.m26,.s7,29892972380158),(.m8,.s2,29892972380153)], + .m .m9, + .b 0 [[([61022895341564],[(.D7,29892972380158),(.D7,8504035246029),(.D16,14907831484426),(.D6,21662741298744),(.D16,13404324495472),(.D6,3211004120914990),(.D16,437411616131314),(.D18,140401799637343931326643182),(.D18,4976888274260784745846),(.D18,1215060612057178198),(.D18,296645213234446),(.D18,72312145468),(.D6,2078674484),(.D16,600437872),(.D6,21920566),(.D16,35954608),(.D6,976390),(.D16,2148964),(.D6,1225128182),(.D12,2475),(.D16,8785),(.D16,143),(.D12,3)])]], + .ms [(.m2,.s6,30511447670782)], + .ms2 .s6 .s7 [(.m3,22265110462462,6597069766606),(.m0,14431090114570,21543555956280),(.m0,13374528159856,3210996671831086)], + .ms [(.m0,.s6,437409753860338),(.m0,.s6,140401799637343930861075438),(.m0,.s6,4976888274260668353910),(.m0,.s6,1215060612028080214),(.m0,.s6,296645205959950)], + .ms2 .s6 .s7 [(.m0,72310326844,2078219828),(.m0,600324208,21892150),(.m0,35947504,974614),(.m0,2148520,1225128071)], + .ms [(.m3,.s6,2449)], + .ms2 .s6 .s7 [(.m6,8777,142)], + .ms2 .s3 .s0 [(.m19,142,8777)], + .ms [(.m17,.s0,2449)], + .ms2 .s3 .s0 [(.m4,1225128071,2148520),(.m1,974614,35947504),(.m1,21892150,600324208),(.m1,2078219828,72310326844)], + .ms [(.m16,.s3,296645205959950),(.m1,.s3,1215060612028080214),(.m1,.s3,4976888274260668353910),(.m1,.s3,140401799637343930861075438),(.m1,.s3,437409753860338)], + .ms2 .s3 .s0 [(.m4,3210996671831086,13374528159856),(.m1,21543555956280,14431090114570),(.m1,6597069766606,22265110462462)], + .ms [(.m1,.s3,30511447670776),(.m10,.s7,30511447670782),(.m8,.s2,30511447670777)], + .m .m9, + .b 0 [[([122045790683126,56075093016582],[(.D7,30511447670782),(.D17,22265110462462)]),([11132555231231],[(.D6,6597069766606),(.D16,14431090114570),(.D6,21543555956280),(.D16,13374528159856),(.D6,3210996671831086),(.D16,437409753860338),(.D18,140401799637343930861075438),(.D18,4976888274260668353910),(.D18,1215060612028080214),(.D18,296645205959950),(.D18,72310326844),(.D6,2078219828),(.D16,600324208),(.D6,21892150),(.D16,35947504),(.D6,974614),(.D16,2148520),(.D6,1225128071),(.D6,2449),(.D12,8777),(.D6,142),(.D16,4)])]], + .ms [(.m2,.s6,89060441849854),(.m3,.s6,8246337208318)], + .ms2 .s6 .s7 [(.m3,16698832846846,5205500362702),(.m0,14083197763594,21456582868536),(.m0,13352784887920,3210991236013102)], + .ms [(.m0,.s6,437408394905842),(.m0,.s6,140401799637343930521336814),(.m0,.s6,4976888274260583419254),(.m0,.s6,1215060612006846550),(.m0,.s6,296645200651534)], + .ms2 .s6 .s7 [(.m0,72308999740,2077888052),(.m0,600241264,21871414),(.m0,35942320,973318),(.m0,2148196,1225127990)], + .ms [(.m12,.s7,2427),(.m0,.s6,8773),(.m3,.s6,140),(.m20,.s0,140),(.m1,.s3,8773),(.m4,.s3,2427)], + .ms2 .s3 .s0 [(.m13,1225127990,2148196),(.m1,973318,35942320),(.m1,21871414,600241264),(.m1,2077888052,72308999740)], + .ms [(.m16,.s3,296645200651534),(.m1,.s3,1215060612006846550),(.m1,.s3,4976888274260583419254),(.m1,.s3,140401799637343930521336814),(.m1,.s3,437408394905842)], + .ms2 .s3 .s0 [(.m4,3210991236013102,13352784887920),(.m1,21456582868536,14083197763594),(.m1,5205500362702,16698832846846)], + .ms [(.m1,.s3,8246337208318),(.m4,.s3,89060441849848),(.m10,.s7,89060441849854),(.m8,.s2,89060441849849)], + .m .m9, + .b 0 [[([263882790666164],[(.D7,89060441849854)]),([32985348833270,16492674416639,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,8246337208318),(.D16,16698832846846)]),([4123168604158],[(.D6,5205500362702),(.D16,14083197763594),(.D6,21456582868536),(.D16,13352784887920),(.D6,3210991236013102),(.D16,437408394905842),(.D18,140401799637343930521336814),(.D18,4976888274260583419254),(.D18,1215060612006846550),(.D18,296645200651534),(.D18,72308999740),(.D6,2077888052),(.D16,600241264),(.D6,21871414),(.D16,35942320),(.D6,973318),(.D16,2148196),(.D6,1225127990),(.D12,2427),(.D16,8773),(.D16,140),(.D6,5)])]], + .ms [(.m2,.s6,131941395333082)], + .m .m3, + ] (by decide +kernel) +theorem chunk_37_step : (cfg_37.denote) [qi]⊢* (cfg_38.denote) := + step_chunk [ + .s .s6 56075093016583, + .ms [(.m14,.s5,56075093016583),(.m4,.s5,131941395333076)], + .m .m5, + .b 131941395333082 [[([23],[(.D16,56075093016583),(.D18,1),(.D15,14637248544765),(.D16,4690104287182)])]], + .ms [(.m2,.s6,131941395333094),(.m3,.s6,56075093016580),(.m7,.s5,56075093016580),(.m4,.s5,131941395333088)], + .m .m5, + .b 131941395333094 [[([7],[(.D16,56075093016580),(.D6,1)])]], + .ms [(.m2,.s6,131941395333098),(.m6,.s6,56075093016578),(.m15,.s5,56075093016578),(.m11,.s5,131941395333092)], + .m .m5, + .b 131941395333098 [[([5],[(.D12,56075093016578),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,131941395333101,56075093016579)], + .ms [(.m23,.s1,56075093016579),(.m22,.s4,131941395333095)], + .m .m24, + .b 131941395333101 [[([17],[(.D6,56075093016579),(.D6,2)])]], + .ms [(.m2,.s6,131941395333110),(.m6,.s6,56075093016575),(.m14,.s5,56075093016575),(.m11,.s5,131941395333104)], + .m .m5, + .b 131941395333110 [[([23],[(.D12,56075093016575),(.D18,1),(.D17,14637248544764),(.D17,4690104287182),(.D15,13954348744714),(.D17,21424370613816),(.D15,13344731824240),(.D17,3210989222747182),(.D15,437407891589362),(.D21,140401799637343930395507694),(.D21,4976888274260551961974),(.D21,1215060611998982230),(.D21,296645198685454),(.D21,72308508220),(.D17,2077765172),(.D15,600210544),(.D17,21863734),(.D15,35940400),(.D17,972838),(.D15,2148076),(.D17,1225127960),(.D11,2419),(.D6,8772)])]], + .ms [(.m2,.s6,131941395333122),(.m6,.s6,56075093016572),(.m7,.s5,56075093016572),(.m11,.s5,131941395333116)], + .m .m5, + .b 131941395333122 [[([224300372066289,112150186033149,19791209299977],[(.D12,56075093016572),(.D8,14637248544764),(.D6,4690104287182),(.D16,13954348744714)]),([1391569403903],[(.D6,21424370613816),(.D16,13344731824240),(.D6,3210989222747182),(.D16,437407891589362),(.D18,140401799637343930395507694),(.D18,4976888274260551961974),(.D18,1215060611998982230),(.D18,296645198685454),(.D18,72308508220),(.D6,2077765172),(.D16,600210544),(.D6,21863734),(.D16,35940400),(.D6,972838),(.D16,2148076),(.D6,1225127960),(.D12,2420),(.D7,8771),(.D8,139),(.D7,4)])]], + .ms [(.m2,.s6,310062279032830)], + .ms2 .s6 .s7 [(.m3,11544872091646,3504693313534)], + .ms [(.m3,.s6,1906965479374)], + .ms2 .s6 .s7 [(.m3,13258564042762,21250424438328),(.m0,13301245280368,3210978351111214)], + .ms [(.m0,.s6,437405173680370),(.m0,.s6,140401799637343929716030446),(.m0,.s6,4976888274260382092662),(.m0,.s6,1215060611956514902),(.m0,.s6,296645188068622)], + .ms2 .s6 .s7 [(.m0,72305854012,2077101620),(.m0,600044656,21822262),(.m0,35930032,970246),(.m0,2147428,1225127798)], + .ms [(.m12,.s7,2379),(.m0,.s6,8761),(.m3,.s6,137),(.m21,.s3,137),(.m4,.s3,8761),(.m4,.s3,2379)], + .ms2 .s3 .s0 [(.m13,1225127798,2147428),(.m1,970246,35930032),(.m1,21822262,600044656),(.m1,2077101620,72305854012)], + .ms [(.m16,.s3,296645188068622),(.m1,.s3,1215060611956514902),(.m1,.s3,4976888274260382092662),(.m1,.s3,140401799637343929716030446),(.m1,.s3,437405173680370)], + .ms2 .s3 .s0 [(.m4,3210978351111214,13301245280368),(.m1,21250424438328,13258564042762),(.m1,1906965479374,3504693313534)], + .ms [(.m4,.s3,11544872091646),(.m4,.s3,310062279032824),(.m10,.s7,310062279032830),(.m8,.s2,310062279032825)], + .m .m9, + .b 0 [[([369435906932660],[(.D7,310062279032830)]),([46179488366582,23089744183295,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,11544872091646),(.D6,3504693313534),(.D6,1906965479374)]),([1443109011455],[(.D16,13258564042762),(.D6,21250424438328),(.D16,13301245280368),(.D6,3210978351111214),(.D16,437405173680370),(.D18,140401799637343929716030446),(.D18,4976888274260382092662),(.D18,1215060611956514902),(.D18,296645188068622),(.D18,72305854012),(.D6,2077101620),(.D16,600044656),(.D6,21822262),(.D16,35930032),(.D6,970246),(.D16,2147428),(.D6,1225127798),(.D12,2379),(.D16,8761),(.D16,137),(.D12,3)])],[([8],[(.D15,263882790666247),(.D21,0),(.D19,618475290621)])]], + .ms [(.m2,.s6,184717953466334),(.m6,.s6,263882790666245),(.m7,.s5,263882790666245),(.m11,.s5,184717953466328)], + .m .m5, + .b 184717953466334 [[([41],[(.D12,263882790666245),(.D8,1),(.D7,618475290620)])],[([14843406974854],[(.D17,263882790666241),(.D2,618475290618)])]], + .ms [(.m2,.s6,192139656953782),(.m3,.s6,262027364794384),(.m27,.s2,262027364794384),(.m1,.s5,192139656953776)], + .m .m5, + .b 192139656953782 [[([7],[(.D16,262027364794384), + (.D6,1)])], + [([16],[(.D11,262027364794382), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,262027364794381), + (.D17,1), + (.D15,0), + (.D6,1185410973646)])], + [([16],[(.D11,262027364794379), + (.D3,0)])], + [([8],[(.D15,262027364794378), + (.D17,1), + (.D21,1185410973645), + (.D15,13078175416330), + (.D17,21205327281720), + (.D15,13289970991216), + (.D17,3210975532538926), + (.D15,437404469037298), + (.D21,140401799637343929539869678), + (.D21,4976888274260338052470), + (.D21,1215060611945504854), + (.D21,296645185316110), + (.D21,72305165884), + (.D17,2076929588), + (.D15,600001648), + (.D17,21811510), + (.D15,35927344), + (.D17,969574), + (.D15,2147260), + (.D17,1225127756), + (.D11,2368), + (.D12,8758)])], + [([18],[(.D11,262027364794376), + (.D13,0), + (.D16,1185410973645), + (.D16,13078175416330)])], + [([37933151156676],[(.D17,262027364794375)]), + ([4741643894587,2370821947295,1185410973648,592705486824,296352743412,148176371703,74088185853,37044092928,18522046464,9261023232,4630511616,2315255808,1157627904,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,1185410973646), + (.D17,13078175416330)]), + ([592705486823],[(.D6,21205327281720), + (.D16,13289970991216), + (.D6,3210975532538926), + (.D16,437404469037298), + (.D18,140401799637343929539869678), + (.D18,4976888274260338052470), + (.D18,1215060611945504854), + (.D18,296645185316110), + (.D18,72305165884), + (.D6,2076929588), + (.D16,600001648), + (.D6,21811510), + (.D16,35927344), + (.D6,969574), + (.D16,2147260), + (.D6,1225127756), + (.D12,2369), + (.D13,8758), + (.D9,136), + (.D13,3)])], + [([10],[(.D17,257285720899791), + (.D21,0), + (.D19,12781822672918)])]], + .ms [(.m2,.s6,211106232532162),(.m3,.s6,257285720899789),(.m7,.s5,257285720899789),(.m4,.s5,211106232532156)], + .m .m5, + .b 211106232532162 [[([43],[(.D16,257285720899789),(.D8,1),(.D7,12781822672917)])],[([306763744149978],[(.D11,257285720899782),(.D2,12781822672915)])]], + .ms2 .s6 .s7 [(.m2,364488104607173,218940252881037)], + .ms [(.m29,.s2,218940252881037),(.m4,.s5,364488104607167)], + .m .m5, + .b 364488104607173 [[([9],[(.D6,218940252881037),(.D6,1)])],[([20],[(.D15,218940252881035),(.D13,0),(.D10,21131239095866),(.D9,13271448944752)])],[([36],[(.D11,218940252881031)]),([7,2],[(.D12,1),(.D6,21131239095866)])]], + .ms [(.m2,.s6,364488104607206),(.m6,.s6,218940252881027),(.m15,.s5,218940252881027),(.m11,.s5,364488104607200)], + .m .m5, + .b 364488104607206 [[([5],[(.D12,218940252881027),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,364488104607209,218940252881028)], + .ms [(.m23,.s1,218940252881028),(.m22,.s4,364488104607203)], + .m .m24, + .b 364488104607209 [[([17],[(.D6,218940252881028),(.D6,2)])],[([6],[(.D11,218940252881024),(.D21,0),(.D7,21131239095864)])]], + .ms2 .s6 .s7 [(.m2,364488104607221,218940252881025)], + .ms2 .s5 .s2 [(.m28,218940252881025,364488104607216)], + .m .m18, + .b 364488104607221 [[([45],[(.D6,218940252881025),(.D8,1),(.D17,21131239095863),(.D10,13271448944751)])],[([36],[(.D15,218940252881018)]),([7,2],[(.D12,1),(.D17,21131239095862)]),([1],[(.D11,13271448944751),(.D16,3210970902027310)])],[([8],[(.D15,218940252881014),(.D21,0),(.D17,21131239095861),(.D12,13271448944752)])]], + .ms [(.m2,.s6,364488104607266),(.m6,.s6,218940252881012),(.m7,.s5,218940252881012),(.m11,.s5,364488104607260)], + .m .m5, + .b 364488104607266 [[([39],[(.D12,218940252881012),(.D8,21131239095862),(.D13,13271448944752),(.D17,3210970902027310),(.D15,437403311409394),(.D21,140401799637343929250462702),(.D21,4976888274260265700726),(.D21,1215060611927416918),(.D21,296645180794126),(.D21,72304035388),(.D17,2076646964),(.D15,599930992),(.D17,21793846),(.D15,35922928),(.D17,968470),(.D15,2146984),(.D17,1225127687),(.D17,2353),(.D11,8753),(.D17,136),(.D15,3)])]], + .ms [(.m2,.s6,364488104607286)], + .ms2 .s6 .s7 [(.m3,218940252881008,21131239095862),(.m0,13271448944752,3210970902027310)], + .ms [(.m0,.s6,437403311409394),(.m0,.s6,140401799637343929250462702),(.m0,.s6,4976888274260265700726),(.m0,.s6,1215060611927416918),(.m0,.s6,296645180794126)], + .ms2 .s6 .s7 [(.m0,72304035388,2076646964),(.m0,599930992,21793846),(.m0,35922928,968470),(.m0,2146984,1225127687)], + .ms [(.m3,.s6,2353)], + .ms2 .s6 .s7 [(.m6,8753,136)], + .ms2 .s3 .s0 [(.m19,136,8753)], + .ms [(.m17,.s0,2353)], + .ms2 .s3 .s0 [(.m4,1225127687,2146984),(.m1,968470,35922928),(.m1,21793846,599930992),(.m1,2076646964,72304035388)], + .ms [(.m16,.s3,296645180794126),(.m1,.s3,1215060611927416918),(.m1,.s3,4976888274260265700726),(.m1,.s3,140401799637343929250462702),(.m1,.s3,437403311409394)], + .ms2 .s3 .s0 [(.m4,3210970902027310,13271448944752),(.m1,21131239095862,218940252881008)], + .ms [(.m1,.s3,364488104607280),(.m10,.s7,364488104607286),(.m8,.s2,364488104607281)], + .m .m9, + .b 0 [[([11132555231228],[(.D7,364488104607286),(.D17,218940252881008),(.D6,21131239095862),(.D16,13271448944752),(.D6,3210970902027310),(.D16,437403311409394),(.D18,140401799637343929250462702),(.D18,4976888274260265700726),(.D18,1215060611927416918),(.D18,296645180794126),(.D18,72304035388),(.D6,2076646964),(.D16,599930992),(.D6,21793846),(.D16,35922928),(.D6,968470),(.D16,2146984),(.D6,1225127687),(.D6,2353),(.D12,8753),(.D6,136),(.D16,4)])]], + .ms [(.m2,.s6,5566277615614),(.m3,.s6,363096535203382)], + .ms2 .s6 .s7 [(.m3,218592360530032,21044266008118),(.m0,13249705672816,3210965466209326)], + .ms [(.m0,.s6,437401952454898),(.m0,.s6,140401799637343928910724078),(.m0,.s6,4976888274260180766070),(.m0,.s6,1215060611906183254),(.m0,.s6,296645175485710)], + .ms2 .s6 .s7 [(.m0,72302708284,2076315188),(.m0,599848048,21773110),(.m0,35917744,967174),(.m0,2146660,1225127606)], + .ms [(.m12,.s7,2331),(.m0,.s6,8749),(.m3,.s6,134),(.m20,.s0,134),(.m1,.s3,8749),(.m4,.s3,2331)], + .ms2 .s3 .s0 [(.m13,1225127606,2146660),(.m1,967174,35917744),(.m1,21773110,599848048),(.m1,2076315188,72302708284)], + .ms [(.m16,.s3,296645175485710),(.m1,.s3,1215060611906183254),(.m1,.s3,4976888274260180766070),(.m1,.s3,140401799637343928910724078),(.m1,.s3,437401952454898)], + .ms2 .s3 .s0 [(.m4,3210965466209326,13249705672816),(.m1,21044266008118,218592360530032)], + .ms [(.m1,.s3,363096535203382),(.m4,.s3,5566277615608),(.m10,.s7,5566277615614),(.m8,.s2,5566277615609)], + .m .m9, + .b 0 [[([22265110462454,11132555231229,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,5566277615614),(.D17,363096535203382)]),([2783138807806],[(.D16,218592360530032),(.D6,21044266008118),(.D16,13249705672816),(.D6,3210965466209326),(.D16,437401952454898),(.D18,140401799637343928910724078),(.D18,4976888274260180766070),(.D18,1215060611906183254),(.D18,296645175485710),(.D18,72302708284),(.D6,2076315188),(.D16,599848048),(.D6,21773110),(.D16,35917744),(.D6,967174),(.D16,2146660),(.D6,1225127606),(.D12,2331),(.D16,8749),(.D16,134),(.D6,5)])]], + .ms [(.m2,.s6,22265110462453),(.m14,.s5,22265110462447)], + .m .m5, + .b 22265110462453 [[([5],[(.D18,1),(.D15,361704965799477),(.D14,218244468179056)])]], + .ms [(.m2,.s6,22265110462456),(.m7,.s5,22265110462450)], + .m .m5, + .b 22265110462456 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,22265110462457),(.m15,.s5,22265110462451)], + .m .m5, + .b 22265110462457 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,22265110462458),(.m25,.s2,22265110462453)], + .m .m18, + .b 22265110462458 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,22265110462460),(.m14,.s5,22265110462454)], + .m .m5, + .b 22265110462460 [[([5],[(.D18,1),(.D17,361704965799476),(.D15,218244468179056),(.D17,20957292920374),(.D15,13227962400880),(.D17,3210960030391342),(.D15,437400593500402),(.D21,140401799637343928570985454),(.D21,4976888274260095831414),(.D21,1215060611884949590),(.D21,296645170177294),(.D21,72301381180),(.D17,2075983412),(.D15,599765104),(.D17,21752374),(.D15,35912560),(.D17,965878),(.D15,2146336),(.D17,1225127525),(.D17,2312),(.D8,8743)])]], + .ms [(.m2,.s6,22265110462463),(.m7,.s5,22265110462457)], + .m .m5, + .b 22265110462463 [[([15255723835389],[(.D8,361704965799476),(.D16,218244468179056),(.D6,20957292920374),(.D16,13227962400880),(.D6,3210960030391342),(.D16,437400593500402),(.D18,140401799637343928570985454),(.D18,4976888274260095831414),(.D18,1215060611884949590),(.D18,296645170177294),(.D18,72301381180),(.D6,2075983412),(.D16,599765104),(.D6,21752374),(.D16,35912560),(.D6,965878),(.D16,2146336),(.D6,1225127525),(.D6,2313),(.D9,8743),(.D14,132),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,29892972380158,359798000320054),(.m0,217767726809200,20838107577910),(.m0,13198166065264,3210952581307438)], + .ms [(.m0,.s6,437398731229426),(.m0,.s6,140401799637343928105417710),(.m0,.s6,4976888274259979439478),(.m0,.s6,1215060611855851606),(.m0,.s6,296645162902798)], + .ms2 .s6 .s7 [(.m0,72299562556,2075528756),(.m0,599651440,21723958),(.m0,35905456,964102),(.m0,2145892,1225127414)], + .ms [(.m12,.s7,2283),(.m0,.s6,8737),(.m3,.s6,131),(.m21,.s3,131),(.m4,.s3,8737),(.m4,.s3,2283)], + .ms2 .s3 .s0 [(.m13,1225127414,2145892),(.m1,964102,35905456),(.m1,21723958,599651440),(.m1,2075528756,72299562556)], + .ms [(.m16,.s3,296645162902798),(.m1,.s3,1215060611855851606),(.m1,.s3,4976888274259979439478),(.m1,.s3,140401799637343928105417710),(.m1,.s3,437398731229426)], + .ms2 .s3 .s0 [(.m4,3210952581307438,13198166065264),(.m1,20838107577910,217767726809200),(.m1,359798000320054,29892972380153)], + .ms [(.m26,.s7,29892972380158),(.m8,.s2,29892972380153)], + .m .m9, + .b 0 [[([61022895341564],[(.D7,29892972380158),(.D7,359798000320053),(.D16,217767726809200),(.D6,20838107577910),(.D16,13198166065264),(.D6,3210952581307438),(.D16,437398731229426),(.D18,140401799637343928105417710),(.D18,4976888274259979439478),(.D18,1215060611855851606),(.D18,296645162902798),(.D18,72299562556),(.D6,2075528756),(.D16,599651440),(.D6,21723958),(.D16,35905456),(.D6,964102),(.D16,2145892),(.D6,1225127414),(.D12,2283),(.D16,8737),(.D16,131),(.D12,3)])]], + .ms [(.m2,.s6,30511447670782)], + .ms2 .s6 .s7 [(.m3,22265110462462,357891034840630),(.m0,217290985439344,20718922235446),(.m0,13168369729648,3210945132223534)], + .ms [(.m0,.s6,437396868958450),(.m0,.s6,140401799637343927639849966),(.m0,.s6,4976888274259863047542),(.m0,.s6,1215060611826753622),(.m0,.s6,296645155628302)], + .ms2 .s6 .s7 [(.m0,72297743932,2075074100),(.m0,599537776,21695542),(.m0,35898352,962326),(.m0,2145448,1225127303)], + .ms [(.m3,.s6,2257)], + .ms2 .s6 .s7 [(.m6,8729,130)], + .ms2 .s3 .s0 [(.m19,130,8729)], + .ms [(.m17,.s0,2257)], + .ms2 .s3 .s0 [(.m4,1225127303,2145448),(.m1,962326,35898352),(.m1,21695542,599537776),(.m1,2075074100,72297743932)], + .ms [(.m16,.s3,296645155628302),(.m1,.s3,1215060611826753622),(.m1,.s3,4976888274259863047542),(.m1,.s3,140401799637343927639849966),(.m1,.s3,437396868958450)], + .ms2 .s3 .s0 [(.m4,3210945132223534,13168369729648),(.m1,20718922235446,217290985439344),(.m1,357891034840630,22265110462462)], + .ms [(.m1,.s3,30511447670776),(.m10,.s7,30511447670782),(.m8,.s2,30511447670777)], + .m .m9, + .b 0 [[([122045790683126,56075093016582],[(.D7,30511447670782),(.D17,22265110462462)]),([11132555231231],[(.D6,357891034840630),(.D16,217290985439344),(.D6,20718922235446),(.D16,13168369729648),(.D6,3210945132223534),(.D16,437396868958450),(.D18,140401799637343927639849966),(.D18,4976888274259863047542),(.D18,1215060611826753622),(.D18,296645155628302),(.D18,72297743932),(.D6,2075074100),(.D16,599537776),(.D6,21695542),(.D16,35898352),(.D6,962326),(.D16,2145448),(.D6,1225127303),(.D6,2257),(.D12,8729),(.D6,130),(.D16,4)])]], + .ms [(.m2,.s6,89060441849854),(.m3,.s6,8246337208318)], + .ms2 .s6 .s7 [(.m3,16698832846846,356499465436726),(.m0,216943093088368,20631949147702),(.m0,13146626457712,3210939696405550)], + .ms [(.m0,.s6,437395510003954),(.m0,.s6,140401799637343927300111342),(.m0,.s6,4976888274259778112886),(.m0,.s6,1215060611805519958),(.m0,.s6,296645150319886)], + .ms2 .s6 .s7 [(.m0,72296416828,2074742324),(.m0,599454832,21674806),(.m0,35893168,961030),(.m0,2145124,1225127222)], + .ms [(.m12,.s7,2235),(.m0,.s6,8725),(.m3,.s6,128),(.m20,.s0,128),(.m1,.s3,8725),(.m4,.s3,2235)], + .ms2 .s3 .s0 [(.m13,1225127222,2145124),(.m1,961030,35893168),(.m1,21674806,599454832),(.m1,2074742324,72296416828)], + .ms [(.m16,.s3,296645150319886),(.m1,.s3,1215060611805519958),(.m1,.s3,4976888274259778112886),(.m1,.s3,140401799637343927300111342),(.m1,.s3,437395510003954)], + .ms2 .s3 .s0 [(.m4,3210939696405550,13146626457712),(.m1,20631949147702,216943093088368),(.m1,356499465436726,16698832846846)], + .ms [(.m1,.s3,8246337208318),(.m4,.s3,89060441849848),(.m10,.s7,89060441849854),(.m8,.s2,89060441849849)], + .m .m9, + .b 0 [[([263882790666164],[(.D7,89060441849854)]),([32985348833270,16492674416639,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,8246337208318),(.D16,16698832846846)]),([4123168604158],[(.D6,356499465436726),(.D16,216943093088368),(.D6,20631949147702),(.D16,13146626457712),(.D6,3210939696405550),(.D16,437395510003954),(.D18,140401799637343927300111342),(.D18,4976888274259778112886),(.D18,1215060611805519958),(.D18,296645150319886),(.D18,72296416828),(.D6,2074742324),(.D16,599454832),(.D6,21674806),(.D16,35893168),(.D6,961030),(.D16,2145124),(.D6,1225127222),(.D12,2235),(.D16,8725),(.D16,128),(.D6,5)])]], + .ms [(.m2,.s6,131941395333082),(.m3,.s6,56075093016583),(.m14,.s5,56075093016583),(.m4,.s5,131941395333076)], + .m .m5, + .b 131941395333082 [[([23],[(.D16,56075093016583),(.D18,1),(.D15,14637248544765),(.D16,355984069361206)])]], + .ms [(.m2,.s6,131941395333094),(.m3,.s6,56075093016580),(.m7,.s5,56075093016580),(.m4,.s5,131941395333088)], + .m .m5, + .b 131941395333094 [[([7],[(.D16,56075093016580),(.D6,1)])]], + .ms [(.m2,.s6,131941395333098),(.m6,.s6,56075093016578),(.m15,.s5,56075093016578),(.m11,.s5,131941395333092)], + .m .m5, + .b 131941395333098 [[([5],[(.D12,56075093016578),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,131941395333101,56075093016579)], + .ms [(.m23,.s1,56075093016579),(.m22,.s4,131941395333095)], + .m .m24, + .b 131941395333101 [[([17],[(.D6,56075093016579),(.D6,2)])]], + .ms [(.m2,.s6,131941395333110),(.m6,.s6,56075093016575),(.m14,.s5,56075093016575),(.m11,.s5,131941395333104)], + .m .m5, + .b 131941395333110 [[([23],[(.D12,56075093016575),(.D18,1),(.D17,14637248544764),(.D17,355984069361206),(.D15,216814244069488),(.D17,20599736892982),(.D15,13138573394032),(.D17,3210937683139630),(.D15,437395006687474),(.D21,140401799637343927174282222),(.D21,4976888274259746655606),(.D21,1215060611797655638),(.D21,296645148353806),(.D21,72295925308),(.D17,2074619444),(.D15,599424112),(.D17,21667126),(.D15,35891248),(.D17,960550),(.D15,2145004),(.D17,1225127192),(.D11,2227),(.D6,8724)])]], + .ms [(.m2,.s6,131941395333122),(.m6,.s6,56075093016572),(.m7,.s5,56075093016572),(.m11,.s5,131941395333116)], + .m .m5, + .b 131941395333122 [[([224300372066289,112150186033149,19791209299977],[(.D12,56075093016572),(.D8,14637248544764),(.D6,355984069361206)]),([5566277615615],[(.D16,216814244069488),(.D6,20599736892982),(.D16,13138573394032),(.D6,3210937683139630),(.D16,437395006687474),(.D18,140401799637343927174282222),(.D18,4976888274259746655606),(.D18,1215060611797655638),(.D18,296645148353806),(.D18,72295925308),(.D6,2074619444),(.D16,599424112),(.D6,21667126),(.D16,35891248),(.D6,960550),(.D16,2145004),(.D6,1225127192),(.D12,2228),(.D7,8723),(.D8,127),(.D7,4)])]], + .ms [(.m2,.s6,310062279032830)], + .ms2 .s6 .s7 [(.m3,11544872091646,3504693313534)], + .ms [(.m3,.s6,353200930553398)], + .ms2 .s6 .s7 [(.m3,216118459367536,20425790717494),(.m0,13095086850160,3210926811503662)], + .ms [(.m0,.s6,437392288778482),(.m0,.s6,140401799637343926494804974),(.m0,.s6,4976888274259576786294),(.m0,.s6,1215060611755188310),(.m0,.s6,296645137736974)], + .ms2 .s6 .s7 [(.m0,72293271100,2073955892),(.m0,599258224,21625654),(.m0,35880880,957958),(.m0,2144356,1225127030)], + .ms [(.m12,.s7,2187),(.m0,.s6,8713),(.m3,.s6,125),(.m21,.s3,125),(.m4,.s3,8713),(.m4,.s3,2187)], + .ms2 .s3 .s0 [(.m13,1225127030,2144356),(.m1,957958,35880880),(.m1,21625654,599258224),(.m1,2073955892,72293271100)], + .ms [(.m16,.s3,296645137736974),(.m1,.s3,1215060611755188310),(.m1,.s3,4976888274259576786294),(.m1,.s3,140401799637343926494804974),(.m1,.s3,437392288778482)], + .ms2 .s3 .s0 [(.m4,3210926811503662,13095086850160),(.m1,20425790717494,216118459367536),(.m1,353200930553398,3504693313534)], + .ms [(.m4,.s3,11544872091646),(.m4,.s3,310062279032824),(.m10,.s7,310062279032830),(.m8,.s2,310062279032825)], + .m .m9, + .b 0 [[([369435906932660],[(.D7,310062279032830)]),([46179488366582,23089744183295,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,11544872091646),(.D6,3504693313534),(.D6,353200930553398)]),([1443109011455],[(.D16,216118459367536),(.D6,20425790717494),(.D16,13095086850160),(.D6,3210926811503662),(.D16,437392288778482),(.D18,140401799637343926494804974),(.D18,4976888274259576786294),(.D18,1215060611755188310),(.D18,296645137736974),(.D18,72293271100),(.D6,2073955892),(.D16,599258224),(.D6,21625654),(.D16,35880880),(.D6,957958),(.D16,2144356),(.D6,1225127030),(.D12,2187),(.D16,8713),(.D16,125),(.D12,3)])],[([8],[(.D15,263882790666247),(.D21,0),(.D19,618475290621)])]], + .ms [(.m2,.s6,184717953466334),(.m6,.s6,263882790666245),(.m7,.s5,263882790666245),(.m11,.s5,184717953466328)], + .m .m5, + .b 184717953466334 [[([41],[(.D12,263882790666245),(.D8,1),(.D7,618475290620)])],[([14843406974854],[(.D17,263882790666241),(.D2,618475290618)])]], + .ms [(.m2,.s6,192139656953782),(.m3,.s6,262027364794384),(.m27,.s2,262027364794384),(.m1,.s5,192139656953776)], + .m .m5, + .b 192139656953782 [[([7],[(.D16,262027364794384), + (.D6,1)])], + [([16],[(.D11,262027364794382), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,262027364794381), + (.D17,1), + (.D15,0), + (.D6,352479376047670)])], + [([16],[(.D11,262027364794379), + (.D3,0)])], + [([8],[(.D15,262027364794378), + (.D17,1), + (.D21,352479376047669), + (.D15,215938070741104), + (.D17,20380693560886), + (.D15,13083812561008), + (.D17,3210923992931374), + (.D15,437391584135410), + (.D21,140401799637343926318644206), + (.D21,4976888274259532746102), + (.D21,1215060611744178262), + (.D21,296645134984462), + (.D21,72292582972), + (.D17,2073783860), + (.D15,599215216), + (.D17,21614902), + (.D15,35878192), + (.D17,957286), + (.D15,2144188), + (.D17,1225126988), + (.D11,2176), + (.D12,8710)])], + [([18],[(.D11,262027364794376), + (.D13,0), + (.D16,352479376047669), + (.D16,215938070741104)])], + [([37933151158246],[(.D17,262027364794375), + (.D12,352479376047670), + (.D17,215938070741104), + (.D6,20380693560886), + (.D16,13083812561008), + (.D6,3210923992931374), + (.D16,437391584135410), + (.D18,140401799637343926318644206), + (.D18,4976888274259532746102), + (.D18,1215060611744178262), + (.D18,296645134984462), + (.D18,72292582972), + (.D6,2073783860), + (.D16,599215216), + (.D6,21614902), + (.D16,35878192), + (.D6,957286), + (.D16,2144188), + (.D6,1225126988), + (.D12,2177), + (.D13,8710), + (.D9,124), + (.D13,3)])]], + .ms [(.m2,.s6,211106232532942)], + .ms2 .s6 .s7 [(.m3,257285720899594,351293965073976),(.m0,215641717997680,20306605375030),(.m0,13065290514544,3210919362419758)], + .ms [(.m0,.s6,437390426507506),(.m0,.s6,140401799637343926029237230),(.m0,.s6,4976888274259460394358),(.m0,.s6,1215060611726090326),(.m0,.s6,296645130462478)], + .ms2 .s6 .s7 [(.m0,72291452476,2073501236),(.m0,599144560,21597238),(.m0,35873776,956182),(.m0,2143912,1225126919)], + .ms [(.m3,.s6,2161)], + .ms2 .s6 .s7 [(.m6,8705,124)], + .ms2 .s3 .s0 [(.m19,124,8705)], + .ms [(.m17,.s0,2161)], + .ms2 .s3 .s0 [(.m4,1225126919,2143912),(.m1,956182,35873776),(.m1,21597238,599144560),(.m1,2073501236,72291452476)], + .ms [(.m16,.s3,296645130462478),(.m1,.s3,1215060611726090326),(.m1,.s3,4976888274259460394358),(.m1,.s3,140401799637343926029237230),(.m1,.s3,437390426507506)], + .ms2 .s3 .s0 [(.m4,3210919362419758,13065290514544),(.m1,20306605375030,215641717997680),(.m1,351293965073976,257285720899594)], + .ms [(.m1,.s3,211106232532936),(.m10,.s7,211106232532942),(.m8,.s2,211106232532937)], + ] (by decide +kernel) +theorem chunk_38_step : (cfg_38.denote) [qi]⊢* (cfg_39.denote) := + step_chunk [ + .m .m9, + .b 0 [[([178120883699708],[(.D7,211106232532942),(.D17,257285720899594),(.D6,351293965073976),(.D16,215641717997680),(.D6,20306605375030),(.D16,13065290514544),(.D6,3210919362419758),(.D16,437390426507506),(.D18,140401799637343926029237230),(.D18,4976888274259460394358),(.D18,1215060611726090326),(.D18,296645130462478),(.D18,72291452476),(.D6,2073501236),(.D16,599144560),(.D6,21597238),(.D16,35873776),(.D6,956182),(.D16,2143912),(.D6,1225126919),(.D6,2161),(.D12,8705),(.D6,124),(.D16,4)])]], + .ms [(.m2,.s6,89060441849854),(.m3,.s6,188841122070478)], + .ms2 .s6 .s7 [(.m3,251719443283978,349902395670072),(.m0,215293825646704,20219632287286),(.m0,13043547242608,3210913926601774)], + .ms [(.m0,.s6,437389067553010),(.m0,.s6,140401799637343925689498606),(.m0,.s6,4976888274259375459702),(.m0,.s6,1215060611704856662),(.m0,.s6,296645125154062)], + .ms2 .s6 .s7 [(.m0,72290125372,2073169460),(.m0,599061616,21576502),(.m0,35868592,954886),(.m0,2143588,1225126838)], + .ms [(.m12,.s7,2139),(.m0,.s6,8701),(.m3,.s6,122),(.m20,.s0,122),(.m1,.s3,8701),(.m4,.s3,2139)], + .ms2 .s3 .s0 [(.m13,1225126838,2143588),(.m1,954886,35868592),(.m1,21576502,599061616),(.m1,2073169460,72290125372)], + .ms [(.m16,.s3,296645125154062),(.m1,.s3,1215060611704856662),(.m1,.s3,4976888274259375459702),(.m1,.s3,140401799637343925689498606),(.m1,.s3,437389067553010)], + .ms2 .s3 .s0 [(.m4,3210913926601774,13043547242608),(.m1,20219632287286,215293825646704),(.m1,349902395670072,251719443283978)], + .ms [(.m1,.s3,188841122070478),(.m4,.s3,89060441849848),(.m10,.s7,89060441849854),(.m8,.s2,89060441849849)], + .m .m9, + .b 0 [[([356241767399414,178120883699709,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,89060441849854),(.D17,188841122070478)]),([44530220924926],[(.D16,251719443283978),(.D6,349902395670072),(.D16,215293825646704),(.D6,20219632287286),(.D16,13043547242608),(.D6,3210913926601774),(.D16,437389067553010),(.D18,140401799637343925689498606),(.D18,4976888274259375459702),(.D18,1215060611704856662),(.D18,296645125154062),(.D18,72290125372),(.D6,2073169460),(.D16,599061616),(.D6,21576502),(.D16,35868592),(.D6,954886),(.D16,2143588),(.D6,1225126838),(.D12,2139),(.D16,8701),(.D16,122),(.D6,5)])]], + .ms [(.m2,.s6,356241767399413),(.m14,.s5,356241767399407)], + .m .m5, + .b 356241767399413 [[([5],[(.D18,1),(.D15,166576011608013),(.D14,246153165668362)])]], + .ms [(.m2,.s6,356241767399416),(.m7,.s5,356241767399410)], + .m .m5, + .b 356241767399416 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,356241767399417),(.m15,.s5,356241767399411)], + .m .m5, + .b 356241767399417 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,356241767399418),(.m25,.s2,356241767399413)], + .m .m18, + .b 356241767399418 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,356241767399420),(.m14,.s5,356241767399414)], + .m .m5, + .b 356241767399420 [[([5],[(.D18,1),(.D17,166576011608012),(.D15,246153165668362),(.D17,348510826266168),(.D15,214945933295728),(.D17,20132659199542),(.D15,13021803970672),(.D17,3210908490783790),(.D15,437387708598514),(.D21,140401799637343925349759982),(.D21,4976888274259290525046),(.D21,1215060611683622998),(.D21,296645119845646),(.D21,72288798268),(.D17,2072837684),(.D15,598978672),(.D17,21555766),(.D15,35863408),(.D17,953590),(.D15,2143264),(.D17,1225126757),(.D17,2120),(.D8,8695)])]], + .ms [(.m2,.s6,356241767399423),(.m7,.s5,356241767399417)], + .m .m5, + .b 356241767399423 [[([244091581366269],[(.D8,166576011608012),(.D16,246153165668362),(.D6,348510826266168),(.D16,214945933295728),(.D6,20132659199542),(.D16,13021803970672),(.D6,3210908490783790),(.D16,437387708598514),(.D18,140401799637343925349759982),(.D18,4976888274259290525046),(.D18,1215060611683622998),(.D18,296645119845646),(.D18,72288798268),(.D6,2072837684),(.D16,598978672),(.D6,21555766),(.D16,35863408),(.D6,953590),(.D16,2143264),(.D6,1225126757),(.D6,2121),(.D9,8695),(.D14,120),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,478287558082558,136064563937230),(.m0,238525303750666,346603860786744),(.m0,214469191925872,20013473857078),(.m0,12992007635056,3210901041699886)], + .ms [(.m0,.s6,437385846327538),(.m0,.s6,140401799637343924884192238),(.m0,.s6,4976888274259174133110),(.m0,.s6,1215060611654525014),(.m0,.s6,296645112571150)], + .ms2 .s6 .s7 [(.m0,72286979644,2072383028),(.m0,598865008,21527350),(.m0,35856304,951814),(.m0,2142820,1225126646)], + .ms [(.m12,.s7,2091),(.m0,.s6,8689),(.m3,.s6,119),(.m21,.s3,119),(.m4,.s3,8689),(.m4,.s3,2091)], + .ms2 .s3 .s0 [(.m13,1225126646,2142820),(.m1,951814,35856304),(.m1,21527350,598865008),(.m1,2072383028,72286979644)], + .ms [(.m16,.s3,296645112571150),(.m1,.s3,1215060611654525014),(.m1,.s3,4976888274259174133110),(.m1,.s3,140401799637343924884192238),(.m1,.s3,437385846327538)], + .ms2 .s3 .s0 [(.m4,3210901041699886,12992007635056),(.m1,20013473857078,214469191925872),(.m1,346603860786744,238525303750666),(.m1,136064563937230,478287558082553)], + .ms [(.m26,.s7,478287558082558),(.m8,.s2,478287558082553)], + .m .m9, + .b 0 [[([976366325465084],[(.D7,478287558082558),(.D7,136064563937229),(.D16,238525303750666),(.D6,346603860786744),(.D16,214469191925872),(.D6,20013473857078),(.D16,12992007635056),(.D6,3210901041699886),(.D16,437385846327538),(.D18,140401799637343924884192238),(.D18,4976888274259174133110),(.D18,1215060611654525014),(.D18,296645112571150),(.D18,72286979644),(.D6,2072383028),(.D16,598865008),(.D6,21527350),(.D16,35856304),(.D6,951814),(.D16,2142820),(.D6,1225126646),(.D12,2091),(.D16,8689),(.D16,119),(.D12,3)])]], + .ms [(.m2,.s6,488183162732542)], + .ms2 .s6 .s7 [(.m3,356241767399422,105553116266446),(.m0,230897441832970,344696895307320),(.m0,213992450556016,19894288514614),(.m0,12962211299440,3210893592615982)], + .ms [(.m0,.s6,437383984056562),(.m0,.s6,140401799637343924418624494),(.m0,.s6,4976888274259057741174),(.m0,.s6,1215060611625427030),(.m0,.s6,296645105296654)], + .ms2 .s6 .s7 [(.m0,72285161020,2071928372),(.m0,598751344,21498934),(.m0,35849200,950038),(.m0,2142376,1225126535)], + .ms [(.m3,.s6,2065)], + .ms2 .s6 .s7 [(.m6,8681,118)], + .ms2 .s3 .s0 [(.m19,118,8681)], + .ms [(.m17,.s0,2065)], + .ms2 .s3 .s0 [(.m4,1225126535,2142376),(.m1,950038,35849200),(.m1,21498934,598751344),(.m1,2071928372,72285161020)], + .ms [(.m16,.s3,296645105296654),(.m1,.s3,1215060611625427030),(.m1,.s3,4976888274259057741174),(.m1,.s3,140401799637343924418624494),(.m1,.s3,437383984056562)], + .ms2 .s3 .s0 [(.m4,3210893592615982,12962211299440),(.m1,19894288514614,213992450556016),(.m1,344696895307320,230897441832970),(.m1,105553116266446,356241767399422)], + .ms [(.m1,.s3,488183162732536),(.m10,.s7,488183162732542),(.m8,.s2,488183162732537)], + .m .m9, + .b 0 [[([1952732650930166,897201488265222],[(.D7,488183162732542),(.D17,356241767399422)]),([178120883699711],[(.D6,105553116266446),(.D16,230897441832970),(.D6,344696895307320),(.D16,213992450556016),(.D6,19894288514614),(.D16,12962211299440),(.D6,3210893592615982),(.D16,437383984056562),(.D18,140401799637343924418624494),(.D18,4976888274259057741174),(.D18,1215060611625427030),(.D18,296645105296654),(.D18,72285161020),(.D6,2071928372),(.D16,598751344),(.D6,21498934),(.D16,35849200),(.D6,950038),(.D16,2142376),(.D6,1225126535),(.D6,2065),(.D12,8681),(.D6,118),(.D16,4)])]], + .ms [(.m2,.s6,1424967069597694),(.m3,.s6,131941395333118)], + .ms2 .s6 .s7 [(.m3,267181325549566,83288005803982),(.m0,225331164217354,343305325903416),(.m0,213644558205040,19807315426870),(.m0,12940468027504,3210888156797998)], + .ms [(.m0,.s6,437382625102066),(.m0,.s6,140401799637343924078885870),(.m0,.s6,4976888274258972806518),(.m0,.s6,1215060611604193366),(.m0,.s6,296645099988238)], + .ms2 .s6 .s7 [(.m0,72283833916,2071596596),(.m0,598668400,21478198),(.m0,35844016,948742),(.m0,2142052,1225126454)], + .ms [(.m12,.s7,2043),(.m0,.s6,8677),(.m3,.s6,116),(.m20,.s0,116),(.m1,.s3,8677),(.m4,.s3,2043)], + .ms2 .s3 .s0 [(.m13,1225126454,2142052),(.m1,948742,35844016),(.m1,21478198,598668400),(.m1,2071596596,72283833916)], + .ms [(.m16,.s3,296645099988238),(.m1,.s3,1215060611604193366),(.m1,.s3,4976888274258972806518),(.m1,.s3,140401799637343924078885870),(.m1,.s3,437382625102066)], + .ms2 .s3 .s0 [(.m4,3210888156797998,12940468027504),(.m1,19807315426870,213644558205040),(.m1,343305325903416,225331164217354),(.m1,83288005803982,267181325549566)], + .ms [(.m1,.s3,131941395333118),(.m4,.s3,1424967069597688),(.m10,.s7,1424967069597694),(.m8,.s2,1424967069597689)], + .m .m9, + .b 0 [[([4222124650659764],[(.D7,1424967069597694)]), + ([527765581332470,263882790666239,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,131941395333118), + (.D16,267181325549566)]), + ([65970697666558],[(.D6,83288005803982), + (.D16,225331164217354), + (.D6,343305325903416), + (.D16,213644558205040), + (.D6,19807315426870), + (.D16,12940468027504), + (.D6,3210888156797998), + (.D16,437382625102066), + (.D18,140401799637343924078885870), + (.D18,4976888274258972806518), + (.D18,1215060611604193366), + (.D18,296645099988238), + (.D18,72283833916), + (.D6,2071596596), + (.D16,598668400), + (.D6,21478198), + (.D16,35844016), + (.D6,948742), + (.D16,2142052), + (.D6,1225126454), + (.D12,2043), + (.D16,8677), + (.D16,116), + (.D6,5)])]], + .ms [(.m2,.s6,2111062325329882),(.m3,.s6,897201488265223),(.m14,.s5,897201488265223),(.m4,.s5,2111062325329876)], + .m .m5, + .b 2111062325329882 [[([23],[(.D16,897201488265223),(.D18,1),(.D15,234195976716285),(.D16,75041668595662)])]], + .ms [(.m2,.s6,2111062325329894),(.m3,.s6,897201488265220),(.m7,.s5,897201488265220),(.m4,.s5,2111062325329888)], + .m .m5, + .b 2111062325329894 [[([7],[(.D16,897201488265220),(.D6,1)])]], + .ms [(.m2,.s6,2111062325329898),(.m6,.s6,897201488265218),(.m15,.s5,897201488265218),(.m11,.s5,2111062325329892)], + .m .m5, + .b 2111062325329898 [[([5],[(.D12,897201488265218),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,2111062325329901,897201488265219)], + .ms [(.m23,.s1,897201488265219),(.m22,.s4,2111062325329895)], + .m .m24, + .b 2111062325329901 [[([17],[(.D6,897201488265219),(.D6,2)])]], + .ms [(.m2,.s6,2111062325329910),(.m6,.s6,897201488265215),(.m14,.s5,897201488265215),(.m11,.s5,2111062325329904)], + .m .m5, + .b 2111062325329910 [[([23],[(.D12,897201488265215),(.D18,1),(.D17,234195976716284),(.D17,75041668595662),(.D15,223269579915274),(.D17,342789929827896),(.D15,213515709186160),(.D17,19775103172150),(.D15,12932414963824),(.D17,3210886143532078),(.D15,437382121785586),(.D21,140401799637343923953056750),(.D21,4976888274258941349238),(.D21,1215060611596329046),(.D21,296645098022158),(.D21,72283342396),(.D17,2071473716),(.D15,598637680),(.D17,21470518),(.D15,35842096),(.D17,948262),(.D15,2141932),(.D17,1225126424),(.D11,2035),(.D6,8676)])]], + .ms [(.m2,.s6,2111062325329922),(.m6,.s6,897201488265212),(.m7,.s5,897201488265212),(.m11,.s5,2111062325329916)], + .m .m5, + .b 2111062325329922 [[([3588805953060849,1794402976530429,316659348799497],[(.D12,897201488265212),(.D8,234195976716284),(.D6,75041668595662),(.D16,223269579915274)]),([22265110462463],[(.D6,342789929827896),(.D16,213515709186160),(.D6,19775103172150),(.D16,12932414963824),(.D6,3210886143532078),(.D16,437382121785586),(.D18,140401799637343923953056750),(.D18,4976888274258941349238),(.D18,1215060611596329046),(.D18,296645098022158),(.D18,72283342396),(.D6,2071473716),(.D16,598637680),(.D6,21470518),(.D16,35842096),(.D6,948262),(.D16,2141932),(.D6,1225126424),(.D12,2036),(.D7,8675),(.D8,115),(.D7,4)])]], + .ms [(.m2,.s6,4960996464525310)], + .ms2 .s6 .s7 [(.m3,184717953466366,56075093016574)], + .ms [(.m3,.s6,30511447670734)], + .ms2 .s6 .s7 [(.m3,212137024684042,340006791020088),(.m0,212819924484208,19601156996662),(.m0,12888928419952,3210875271896110)], + .ms [(.m0,.s6,437379403876594),(.m0,.s6,140401799637343923273579502),(.m0,.s6,4976888274258771479926),(.m0,.s6,1215060611553861718),(.m0,.s6,296645087405326)], + .ms2 .s6 .s7 [(.m0,72280688188,2070810164),(.m0,598471792,21429046),(.m0,35831728,945670),(.m0,2141284,1225126262)], + .ms [(.m12,.s7,1995),(.m0,.s6,8665),(.m3,.s6,113),(.m21,.s3,113),(.m4,.s3,8665),(.m4,.s3,1995)], + .ms2 .s3 .s0 [(.m13,1225126262,2141284),(.m1,945670,35831728),(.m1,21429046,598471792),(.m1,2070810164,72280688188)], + .ms [(.m16,.s3,296645087405326),(.m1,.s3,1215060611553861718),(.m1,.s3,4976888274258771479926),(.m1,.s3,140401799637343923273579502),(.m1,.s3,437379403876594)], + .ms2 .s3 .s0 [(.m4,3210875271896110,12888928419952),(.m1,19601156996662,212819924484208),(.m1,340006791020088,212137024684042),(.m1,30511447670734,56075093016574)], + .ms [(.m4,.s3,184717953466366),(.m4,.s3,4960996464525304),(.m10,.s7,4960996464525310),(.m8,.s2,4960996464525305)], + .m .m9, + .b 0 [[([5910974510923700],[(.D7,4960996464525310)]), + ([738871813865462,369435906932735,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,184717953466366), + (.D6,56075093016574), + (.D6,30511447670734)]), + ([23089744183295],[(.D16,212137024684042), + (.D6,340006791020088), + (.D16,212819924484208), + (.D6,19601156996662), + (.D16,12888928419952), + (.D6,3210875271896110), + (.D16,437379403876594), + (.D18,140401799637343923273579502), + (.D18,4976888274258771479926), + (.D18,1215060611553861718), + (.D18,296645087405326), + (.D18,72280688188), + (.D6,2070810164), + (.D16,598471792), + (.D6,21429046), + (.D16,35831728), + (.D6,945670), + (.D16,2141284), + (.D6,1225126262), + (.D12,1995), + (.D16,8665), + (.D16,113), + (.D12,3)])], + [([8],[(.D15,4222124650659847), + (.D21,0), + (.D19,9895604649981)])]], + .ms [(.m2,.s6,2955487255461854),(.m6,.s6,4222124650659845),(.m7,.s5,4222124650659845),(.m11,.s5,2955487255461848)], + .m .m5, + .b 2955487255461854 [[([41],[(.D12,4222124650659845),(.D8,1),(.D7,9895604649980)])],[([237494511599494],[(.D17,4222124650659841),(.D2,9895604649978)])]], + .ms [(.m2,.s6,3074234511261622),(.m3,.s6,4192437836709904),(.m27,.s2,4192437836709904),(.m1,.s5,3074234511261616)], + .m .m5, + .b 3074234511261622 [[([7],[(.D16,4192437836709904), + (.D6,1)])], + [([16],[(.D11,4192437836709902), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,4192437836709901), + (.D17,1), + (.D15,0), + (.D6,18966575579086)])], + [([16],[(.D11,4192437836709899), + (.D3,0)])], + [([8],[(.D15,4192437836709898), + (.D17,1), + (.D21,18966575579085), + (.D15,209250806661130), + (.D17,339285236514360), + (.D15,212639535857776), + (.D17,19556059840054), + (.D15,12877654130800), + (.D17,3210872453323822), + (.D15,437378699233522), + (.D21,140401799637343923097418734), + (.D21,4976888274258727439734), + (.D21,1215060611542851670), + (.D21,296645084652814), + (.D21,72280000060), + (.D17,2070638132), + (.D15,598428784), + (.D17,21418294), + (.D15,35829040), + (.D17,944998), + (.D15,2141116), + (.D17,1225126220), + (.D11,1984), + (.D12,8662)])], + [([18],[(.D11,4192437836709896), + (.D13,0), + (.D16,18966575579085), + (.D16,209250806661130)])], + [([606930418530756],[(.D17,4192437836709895)]), + ([75866302316347,37933151158175,18966575579088,9483287789544,4741643894772,2370821947383,1185410973693,592705486848,296352743424,148176371712,74088185856,37044092928,18522046464,9261023232,4630511616,2315255808,1157627904,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,18966575579086), + (.D17,209250806661130)]), + ([9483287789543],[(.D6,339285236514360), + (.D16,212639535857776), + (.D6,19556059840054), + (.D16,12877654130800), + (.D6,3210872453323822), + (.D16,437378699233522), + (.D18,140401799637343923097418734), + (.D18,4976888274258727439734), + (.D18,1215060611542851670), + (.D18,296645084652814), + (.D18,72280000060), + (.D6,2070638132), + (.D16,598428784), + (.D6,21418294), + (.D16,35829040), + (.D6,944998), + (.D16,2141116), + (.D6,1225126220), + (.D12,1985), + (.D13,8662), + (.D9,112), + (.D13,3)])], + [([10],[(.D17,4116571534393551), + (.D21,0), + (.D19,204509162766358)])]], + .ms [(.m2,.s6,3377699720527042),(.m3,.s6,4116571534393549),(.m7,.s5,4116571534393549),(.m4,.s5,3377699720527036)], + .m .m5, + .b 3377699720527042 [[([43],[(.D16,4116571534393549),(.D8,1),(.D7,204509162766357)])],[([4908219906392538],[(.D11,4116571534393542),(.D2,204509162766355)])]], + .ms2 .s6 .s7 [(.m2,5831809673723333,3503044046094477)], + .ms [(.m29,.s2,3503044046094477),(.m4,.s5,5831809673723327)], + .m .m5, + .b 5831809673723333 [[([9],[(.D6,3503044046094477),(.D6,1)])],[([20],[(.D15,3503044046094475),(.D13,0),(.D10,338099825540666),(.D9,212343183114352)])],[([36],[(.D11,3503044046094471)]),([7,2],[(.D12,1),(.D6,338099825540666)])]], + .ms [(.m2,.s6,5831809673723366),(.m6,.s6,3503044046094467),(.m15,.s5,3503044046094467),(.m11,.s5,5831809673723360)], + .m .m5, + .b 5831809673723366 [[([5],[(.D12,3503044046094467),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,5831809673723369,3503044046094468)], + .ms [(.m23,.s1,3503044046094468),(.m22,.s4,5831809673723363)], + .m .m24, + .b 5831809673723369 [[([17],[(.D6,3503044046094468),(.D6,2)])],[([6],[(.D11,3503044046094464),(.D21,0),(.D7,338099825540664)])]], + .ms2 .s6 .s7 [(.m2,5831809673723381,3503044046094465)], + .ms2 .s5 .s2 [(.m28,3503044046094465,5831809673723376)], + .m .m18, + .b 5831809673723381 [[([45],[(.D6,3503044046094465),(.D8,1),(.D17,338099825540663),(.D10,212343183114351)])],[([36],[(.D15,3503044046094458)]),([7,2],[(.D12,1),(.D17,338099825540662)]),([1],[(.D11,212343183114351),(.D16,19481971654198)])],[([8],[(.D15,3503044046094454),(.D21,0),(.D17,338099825540661),(.D12,212343183114352)])]], + .ms [(.m2,.s6,5831809673723426),(.m6,.s6,3503044046094452),(.m7,.s5,3503044046094452),(.m11,.s5,5831809673723420)], + .m .m5, + .b 5831809673723426 [[([39],[(.D12,3503044046094452),(.D8,338099825540662),(.D13,212343183114352),(.D17,19481971654198),(.D15,12859132084336),(.D17,3210867822812206),(.D15,437377541605618),(.D21,140401799637343922808011758),(.D21,4976888274258655087990),(.D21,1215060611524763734),(.D21,296645080130830),(.D21,72278869564),(.D17,2070355508),(.D15,598358128),(.D17,21400630),(.D15,35824624),(.D17,943894),(.D15,2140840),(.D17,1225126151),(.D17,1969),(.D11,8657),(.D17,112),(.D15,3)])]], + .ms [(.m2,.s6,5831809673723446)], + .ms2 .s6 .s7 [(.m3,3503044046094448,338099825540662),(.m0,212343183114352,19481971654198),(.m0,12859132084336,3210867822812206)], + .ms [(.m0,.s6,437377541605618),(.m0,.s6,140401799637343922808011758),(.m0,.s6,4976888274258655087990),(.m0,.s6,1215060611524763734),(.m0,.s6,296645080130830)], + .ms2 .s6 .s7 [(.m0,72278869564,2070355508),(.m0,598358128,21400630),(.m0,35824624,943894),(.m0,2140840,1225126151)], + .ms [(.m3,.s6,1969)], + .ms2 .s6 .s7 [(.m6,8657,112)], + .ms2 .s3 .s0 [(.m19,112,8657)], + .ms [(.m17,.s0,1969)], + .ms2 .s3 .s0 [(.m4,1225126151,2140840),(.m1,943894,35824624),(.m1,21400630,598358128),(.m1,2070355508,72278869564)], + .ms [(.m16,.s3,296645080130830),(.m1,.s3,1215060611524763734),(.m1,.s3,4976888274258655087990),(.m1,.s3,140401799637343922808011758),(.m1,.s3,437377541605618)], + .ms2 .s3 .s0 [(.m4,3210867822812206,12859132084336),(.m1,19481971654198,212343183114352),(.m1,338099825540662,3503044046094448)], + .ms [(.m1,.s3,5831809673723440),(.m10,.s7,5831809673723446),(.m8,.s2,5831809673723441)], + .m .m9, + .b 0 [[([178120883699708],[(.D7,5831809673723446),(.D17,3503044046094448),(.D6,338099825540662),(.D16,212343183114352),(.D6,19481971654198),(.D16,12859132084336),(.D6,3210867822812206),(.D16,437377541605618),(.D18,140401799637343922808011758),(.D18,4976888274258655087990),(.D18,1215060611524763734),(.D18,296645080130830),(.D18,72278869564),(.D6,2070355508),(.D16,598358128),(.D6,21400630),(.D16,35824624),(.D6,943894),(.D16,2140840),(.D6,1225126151),(.D6,1969),(.D12,8657),(.D6,112),(.D16,4)])]], + .ms [(.m2,.s6,89060441849854),(.m3,.s6,5809544563260982)], + .ms2 .s6 .s7 [(.m3,3497477768478832,336708256136758),(.m0,211995290763376,19394998566454),(.m0,12837388812400,3210862386994222)], + .ms [(.m0,.s6,437376182651122),(.m0,.s6,140401799637343922468273134),(.m0,.s6,4976888274258570153334),(.m0,.s6,1215060611503530070),(.m0,.s6,296645074822414)], + .ms2 .s6 .s7 [(.m0,72277542460,2070023732),(.m0,598275184,21379894),(.m0,35819440,942598),(.m0,2140516,1225126070)], + .ms [(.m12,.s7,1947),(.m0,.s6,8653),(.m3,.s6,110),(.m20,.s0,110),(.m1,.s3,8653),(.m4,.s3,1947)], + .ms2 .s3 .s0 [(.m13,1225126070,2140516),(.m1,942598,35819440),(.m1,21379894,598275184),(.m1,2070023732,72277542460)], + .ms [(.m16,.s3,296645074822414),(.m1,.s3,1215060611503530070),(.m1,.s3,4976888274258570153334),(.m1,.s3,140401799637343922468273134),(.m1,.s3,437376182651122)], + .ms2 .s3 .s0 [(.m4,3210862386994222,12837388812400),(.m1,19394998566454,211995290763376),(.m1,336708256136758,3497477768478832)], + .ms [(.m1,.s3,5809544563260982),(.m4,.s3,89060441849848),(.m10,.s7,89060441849854),(.m8,.s2,89060441849849)], + .m .m9, + .b 0 [[([356241767399414,178120883699709,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,89060441849854),(.D17,5809544563260982)]),([44530220924926],[(.D16,3497477768478832),(.D6,336708256136758),(.D16,211995290763376),(.D6,19394998566454),(.D16,12837388812400),(.D6,3210862386994222),(.D16,437376182651122),(.D18,140401799637343922468273134),(.D18,4976888274258570153334),(.D18,1215060611503530070),(.D18,296645074822414),(.D18,72277542460),(.D6,2070023732),(.D16,598275184),(.D6,21379894),(.D16,35819440),(.D6,942598),(.D16,2140516),(.D6,1225126070),(.D12,1947),(.D16,8653),(.D16,110),(.D6,5)])]], + .ms [(.m2,.s6,356241767399413),(.m14,.s5,356241767399407)], + .m .m5, + .b 356241767399413 [[([5],[(.D18,1),(.D15,5787279452798517),(.D14,3491911490863216)])]], + .ms [(.m2,.s6,356241767399416),(.m7,.s5,356241767399410)], + .m .m5, + .b 356241767399416 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,356241767399417),(.m15,.s5,356241767399411)], + .m .m5, + .b 356241767399417 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,356241767399418),(.m25,.s2,356241767399413)], + .m .m18, + .b 356241767399418 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,356241767399420),(.m14,.s5,356241767399414)], + .m .m5, + .b 356241767399420 [[([5],[(.D18,1),(.D17,5787279452798516),(.D15,3491911490863216),(.D17,335316686732854),(.D15,211647398412400),(.D17,19308025478710),(.D15,12815645540464),(.D17,3210856951176238),(.D15,437374823696626),(.D21,140401799637343922128534510),(.D21,4976888274258485218678),(.D21,1215060611482296406),(.D21,296645069513998),(.D21,72276215356),(.D17,2069691956),(.D15,598192240),(.D17,21359158),(.D15,35814256),(.D17,941302),(.D15,2140192),(.D17,1225125989),(.D17,1928),(.D8,8647)])]], + .ms [(.m2,.s6,356241767399423),(.m7,.s5,356241767399417)], + .m .m5, + .b 356241767399423 [[([244091581366269],[(.D8,5787279452798516),(.D16,3491911490863216),(.D6,335316686732854),(.D16,211647398412400),(.D6,19308025478710),(.D16,12815645540464),(.D6,3210856951176238),(.D16,437374823696626),(.D18,140401799637343922128534510),(.D18,4976888274258485218678),(.D18,1215060611482296406),(.D18,296645069513998),(.D18,72276215356),(.D6,2069691956),(.D16,598192240),(.D6,21359158),(.D16,35814256),(.D6,941302),(.D16,2140192),(.D6,1225125989),(.D6,1929),(.D9,8647),(.D14,108),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,478287558082558,5756768005127734),(.m0,3484283628945520,333409721253430),(.m0,211170657042544,19188840136246),(.m0,12785849204848,3210849502092334)], + .ms [(.m0,.s6,437372961425650),(.m0,.s6,140401799637343921662966766),(.m0,.s6,4976888274258368826742),(.m0,.s6,1215060611453198422),(.m0,.s6,296645062239502)], + .ms2 .s6 .s7 [(.m0,72274396732,2069237300),(.m0,598078576,21330742),(.m0,35807152,939526),(.m0,2139748,1225125878)], + .ms [(.m12,.s7,1899),(.m0,.s6,8641),(.m3,.s6,107),(.m21,.s3,107),(.m4,.s3,8641),(.m4,.s3,1899)], + .ms2 .s3 .s0 [(.m13,1225125878,2139748),(.m1,939526,35807152),(.m1,21330742,598078576),(.m1,2069237300,72274396732)], + .ms [(.m16,.s3,296645062239502),(.m1,.s3,1215060611453198422),(.m1,.s3,4976888274258368826742),(.m1,.s3,140401799637343921662966766),(.m1,.s3,437372961425650)], + .ms2 .s3 .s0 [(.m4,3210849502092334,12785849204848),(.m1,19188840136246,211170657042544),(.m1,333409721253430,3484283628945520),(.m1,5756768005127734,478287558082553)], + .ms [(.m26,.s7,478287558082558),(.m8,.s2,478287558082553)], + .m .m9, + .b 0 [[([976366325465084],[(.D7,478287558082558),(.D7,5756768005127733),(.D16,3484283628945520),(.D6,333409721253430),(.D16,211170657042544),(.D6,19188840136246),(.D16,12785849204848),(.D6,3210849502092334),(.D16,437372961425650),(.D18,140401799637343921662966766),(.D18,4976888274258368826742),(.D18,1215060611453198422),(.D18,296645062239502),(.D18,72274396732),(.D6,2069237300),(.D16,598078576),(.D6,21330742),(.D16,35807152),(.D6,939526),(.D16,2139748),(.D6,1225125878),(.D12,1899),(.D16,8641),(.D16,107),(.D12,3)])]], + .ms [(.m2,.s6,488183162732542)], + .ms2 .s6 .s7 [(.m3,356241767399422,5726256557456950)], + .ms [(.m0,.s6,3476655767027824)], + ] (by decide +kernel) +theorem chunk_39_step : (cfg_39.denote) [qi]⊢* (cfg_40.denote) := + step_chunk [ + .s .s7 331502755774006, + .ms2 .s6 .s7 [(.m0,210693915672688,19069654793782),(.m0,12756052869232,3210842053008430)], + .ms [(.m0,.s6,437371099154674),(.m0,.s6,140401799637343921197399022),(.m0,.s6,4976888274258252434806),(.m0,.s6,1215060611424100438),(.m0,.s6,296645054965006)], + .ms2 .s6 .s7 [(.m0,72272578108,2068782644),(.m0,597964912,21302326),(.m0,35800048,937750),(.m0,2139304,1225125767)], + .ms [(.m3,.s6,1873)], + .ms2 .s6 .s7 [(.m6,8633,106)], + .ms2 .s3 .s0 [(.m19,106,8633)], + .ms [(.m17,.s0,1873)], + .ms2 .s3 .s0 [(.m4,1225125767,2139304),(.m1,937750,35800048),(.m1,21302326,597964912),(.m1,2068782644,72272578108)], + .ms [(.m16,.s3,296645054965006),(.m1,.s3,1215060611424100438),(.m1,.s3,4976888274258252434806),(.m1,.s3,140401799637343921197399022),(.m1,.s3,437371099154674)], + .ms2 .s3 .s0 [(.m4,3210842053008430,12756052869232),(.m1,19069654793782,210693915672688),(.m1,331502755774006,3476655767027824),(.m1,5726256557456950,356241767399422)], + .ms [(.m1,.s3,488183162732536),(.m10,.s7,488183162732542),(.m8,.s2,488183162732537)], + .m .m9, + .b 0 [[([1952732650930166,897201488265222],[(.D7,488183162732542),(.D17,356241767399422)]),([178120883699711],[(.D6,5726256557456950),(.D16,3476655767027824),(.D6,331502755774006),(.D16,210693915672688),(.D6,19069654793782),(.D16,12756052869232),(.D6,3210842053008430),(.D16,437371099154674),(.D18,140401799637343921197399022),(.D18,4976888274258252434806),(.D18,1215060611424100438),(.D18,296645054965006),(.D18,72272578108),(.D6,2068782644),(.D16,597964912),(.D6,21302326),(.D16,35800048),(.D6,937750),(.D16,2139304),(.D6,1225125767),(.D6,1873),(.D12,8633),(.D6,106),(.D16,4)])]], + .ms [(.m2,.s6,1424967069597694),(.m3,.s6,131941395333118)], + .ms2 .s6 .s7 [(.m3,267181325549566,5703991446994486),(.m0,3471089489412208,330111186370102),(.m0,210346023321712,18982681706038),(.m0,12734309597296,3210836617190446)], + .ms [(.m0,.s6,437369740200178),(.m0,.s6,140401799637343920857660398),(.m0,.s6,4976888274258167500150),(.m0,.s6,1215060611402866774),(.m0,.s6,296645049656590)], + .ms2 .s6 .s7 [(.m0,72271251004,2068450868),(.m0,597881968,21281590),(.m0,35794864,936454),(.m0,2138980,1225125686)], + .ms [(.m12,.s7,1851),(.m0,.s6,8629),(.m3,.s6,104),(.m20,.s0,104),(.m1,.s3,8629),(.m4,.s3,1851)], + .ms2 .s3 .s0 [(.m13,1225125686,2138980),(.m1,936454,35794864),(.m1,21281590,597881968),(.m1,2068450868,72271251004)], + .ms [(.m16,.s3,296645049656590),(.m1,.s3,1215060611402866774),(.m1,.s3,4976888274258167500150),(.m1,.s3,140401799637343920857660398),(.m1,.s3,437369740200178)], + .ms2 .s3 .s0 [(.m4,3210836617190446,12734309597296),(.m1,18982681706038,210346023321712),(.m1,330111186370102,3471089489412208),(.m1,5703991446994486,267181325549566)], + .ms [(.m1,.s3,131941395333118),(.m4,.s3,1424967069597688),(.m10,.s7,1424967069597694),(.m8,.s2,1424967069597689)], + .m .m9, + .b 0 [[([4222124650659764],[(.D7,1424967069597694)]), + ([527765581332470,263882790666239,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,131941395333118), + (.D16,267181325549566)]), + ([65970697666558],[(.D6,5703991446994486), + (.D16,3471089489412208), + (.D6,330111186370102), + (.D16,210346023321712), + (.D6,18982681706038), + (.D16,12734309597296), + (.D6,3210836617190446), + (.D16,437369740200178), + (.D18,140401799637343920857660398), + (.D18,4976888274258167500150), + (.D18,1215060611402866774), + (.D18,296645049656590), + (.D18,72271251004), + (.D6,2068450868), + (.D16,597881968), + (.D6,21281590), + (.D16,35794864), + (.D6,936454), + (.D16,2138980), + (.D6,1225125686), + (.D12,1851), + (.D16,8629), + (.D16,104), + (.D6,5)])]], + .ms [(.m2,.s6,2111062325329882),(.m3,.s6,897201488265223),(.m14,.s5,897201488265223),(.m4,.s5,2111062325329876)], + .m .m5, + .b 2111062325329882 [[([23],[(.D16,897201488265223),(.D18,1),(.D15,234195976716285),(.D16,5695745109786166)])]], + .ms [(.m2,.s6,2111062325329894),(.m3,.s6,897201488265220),(.m7,.s5,897201488265220),(.m4,.s5,2111062325329888)], + .m .m5, + .b 2111062325329894 [[([7],[(.D16,897201488265220),(.D6,1)])]], + .ms [(.m2,.s6,2111062325329898),(.m6,.s6,897201488265218),(.m15,.s5,897201488265218),(.m11,.s5,2111062325329892)], + .m .m5, + .b 2111062325329898 [[([5],[(.D12,897201488265218),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,2111062325329901,897201488265219)], + .ms [(.m23,.s1,897201488265219),(.m22,.s4,2111062325329895)], + .m .m24, + .b 2111062325329901 [[([17],[(.D6,897201488265219),(.D6,2)])]], + .ms [(.m2,.s6,2111062325329910),(.m6,.s6,897201488265215),(.m14,.s5,897201488265215),(.m11,.s5,2111062325329904)], + .m .m5, + .b 2111062325329910 [[([23],[(.D12,897201488265215),(.D18,1),(.D17,234195976716284),(.D17,5695745109786166),(.D15,3469027905110128),(.D17,329595790294582),(.D15,210217174302832),(.D17,18950469451318),(.D15,12726256533616),(.D17,3210834603924526),(.D15,437369236883698),(.D21,140401799637343920731831278),(.D21,4976888274258136042870),(.D21,1215060611395002454),(.D21,296645047690510),(.D21,72270759484),(.D17,2068327988),(.D15,597851248),(.D17,21273910),(.D15,35792944),(.D17,935974),(.D15,2138860),(.D17,1225125656),(.D11,1843),(.D6,8628)])]], + .ms [(.m2,.s6,2111062325329922),(.m6,.s6,897201488265212),(.m7,.s5,897201488265212),(.m11,.s5,2111062325329916)], + .m .m5, + .b 2111062325329922 [[([3588805953060849,1794402976530429,316659348799497],[(.D12,897201488265212),(.D8,234195976716284),(.D6,5695745109786166)]),([89060441849855],[(.D16,3469027905110128),(.D6,329595790294582),(.D16,210217174302832),(.D6,18950469451318),(.D16,12726256533616),(.D6,3210834603924526),(.D16,437369236883698),(.D18,140401799637343920731831278),(.D18,4976888274258136042870),(.D18,1215060611395002454),(.D18,296645047690510),(.D18,72270759484),(.D6,2068327988),(.D16,597851248),(.D6,21273910),(.D16,35792944),(.D6,935974),(.D16,2138860),(.D6,1225125656),(.D12,1844),(.D7,8627),(.D8,103),(.D7,4)])]], + .ms [(.m2,.s6,4960996464525310)], + .ms2 .s6 .s7 [(.m3,184717953466366,56075093016574)], + .ms [(.m3,.s6,5651214888861238)], + .ms2 .s6 .s7 [(.m3,3457895349878896,326812651486774),(.m0,209521389600880,18776523275830),(.m0,12682769989744,3210823732288558)], + .ms [(.m0,.s6,437366518974706),(.m0,.s6,140401799637343920052354030),(.m0,.s6,4976888274257966173558),(.m0,.s6,1215060611352535126),(.m0,.s6,296645037073678)], + .ms2 .s6 .s7 [(.m0,72268105276,2067664436),(.m0,597685360,21232438),(.m0,35782576,933382),(.m0,2138212,1225125494)], + .ms [(.m12,.s7,1803),(.m0,.s6,8617),(.m3,.s6,101),(.m21,.s3,101),(.m4,.s3,8617),(.m4,.s3,1803)], + .ms2 .s3 .s0 [(.m13,1225125494,2138212),(.m1,933382,35782576),(.m1,21232438,597685360),(.m1,2067664436,72268105276)], + .ms [(.m16,.s3,296645037073678),(.m1,.s3,1215060611352535126),(.m1,.s3,4976888274257966173558),(.m1,.s3,140401799637343920052354030),(.m1,.s3,437366518974706)], + .ms2 .s3 .s0 [(.m4,3210823732288558,12682769989744),(.m1,18776523275830,209521389600880),(.m1,326812651486774,3457895349878896),(.m1,5651214888861238,56075093016574)], + .ms [(.m4,.s3,184717953466366),(.m4,.s3,4960996464525304),(.m10,.s7,4960996464525310),(.m8,.s2,4960996464525305)], + .m .m9, + .b 0 [[([5910974510923700],[(.D7,4960996464525310)]), + ([738871813865462,369435906932735,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,184717953466366), + (.D6,56075093016574), + (.D6,5651214888861238)]), + ([23089744183295],[(.D16,3457895349878896), + (.D6,326812651486774), + (.D16,209521389600880), + (.D6,18776523275830), + (.D16,12682769989744), + (.D6,3210823732288558), + (.D16,437366518974706), + (.D18,140401799637343920052354030), + (.D18,4976888274257966173558), + (.D18,1215060611352535126), + (.D18,296645037073678), + (.D18,72268105276), + (.D6,2067664436), + (.D16,597685360), + (.D6,21232438), + (.D16,35782576), + (.D6,933382), + (.D16,2138212), + (.D6,1225125494), + (.D12,1803), + (.D16,8617), + (.D16,101), + (.D12,3)])], + [([8],[(.D15,4222124650659847), + (.D21,0), + (.D19,9895604649981)])]], + .ms [(.m2,.s6,2955487255461854),(.m6,.s6,4222124650659845),(.m7,.s5,4222124650659845),(.m11,.s5,2955487255461848)], + .m .m5, + .b 2955487255461854 [[([41],[(.D12,4222124650659845),(.D8,1),(.D7,9895604649980)])],[([237494511599494],[(.D17,4222124650659841),(.D2,9895604649978)])]], + .ms [(.m2,.s6,3074234511261622),(.m3,.s6,4192437836709904),(.m27,.s2,4192437836709904),(.m1,.s5,3074234511261616)], + .m .m5, + .b 3074234511261622 [[([7],[(.D16,4192437836709904), + (.D6,1)])], + [([16],[(.D11,4192437836709902), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,4192437836709901), + (.D17,1), + (.D15,0), + (.D6,5639670016769590)])], + [([16],[(.D11,4192437836709899), + (.D3,0)])], + [([8],[(.D15,4192437836709898), + (.D17,1), + (.D21,5639670016769589), + (.D15,3455009131855984), + (.D17,326091096981046), + (.D15,209341000974448), + (.D17,18731426119222), + (.D15,12671495700592), + (.D17,3210820913716270), + (.D15,437365814331634), + (.D21,140401799637343919876193262), + (.D21,4976888274257922133366), + (.D21,1215060611341525078), + (.D21,296645034321166), + (.D21,72267417148), + (.D17,2067492404), + (.D15,597642352), + (.D17,21221686), + (.D15,35779888), + (.D17,932710), + (.D15,2138044), + (.D17,1225125452), + (.D11,1792), + (.D12,8614)])], + [([18],[(.D11,4192437836709896), + (.D13,0), + (.D16,5639670016769589), + (.D16,3455009131855984)])], + [([606930418532326],[(.D17,4192437836709895), + (.D12,5639670016769590), + (.D17,3455009131855984), + (.D6,326091096981046), + (.D16,209341000974448), + (.D6,18731426119222), + (.D16,12671495700592), + (.D6,3210820913716270), + (.D16,437365814331634), + (.D18,140401799637343919876193262), + (.D18,4976888274257922133366), + (.D18,1215060611341525078), + (.D18,296645034321166), + (.D18,72267417148), + (.D6,2067492404), + (.D16,597642352), + (.D6,21221686), + (.D16,35779888), + (.D6,932710), + (.D16,2138044), + (.D6,1225125452), + (.D12,1793), + (.D13,8614), + (.D9,100), + (.D13,3)])]], + .ms [(.m2,.s6,3377699720527822)], + .ms2 .s6 .s7 [(.m3,4116571534393354,5620703441190456),(.m0,3450267487961200,324905686007350),(.m0,209044648231024,18657337933366),(.m0,12652973654128,3210816283204654)], + .ms [(.m0,.s6,437364656703730),(.m0,.s6,140401799637343919586786286),(.m0,.s6,4976888274257849781622),(.m0,.s6,1215060611323437142),(.m0,.s6,296645029799182)], + .ms2 .s6 .s7 [(.m0,72266286652,2067209780),(.m0,597571696,21204022),(.m0,35775472,931606),(.m0,2137768,1225125383)], + .ms [(.m3,.s6,1777)], + .ms2 .s6 .s7 [(.m6,8609,100)], + .ms2 .s3 .s0 [(.m19,100,8609)], + .ms [(.m17,.s0,1777)], + .ms2 .s3 .s0 [(.m4,1225125383,2137768),(.m1,931606,35775472),(.m1,21204022,597571696),(.m1,2067209780,72266286652)], + .ms [(.m16,.s3,296645029799182),(.m1,.s3,1215060611323437142),(.m1,.s3,4976888274257849781622),(.m1,.s3,140401799637343919586786286),(.m1,.s3,437364656703730)], + .ms2 .s3 .s0 [(.m4,3210816283204654,12652973654128),(.m1,18657337933366,209044648231024),(.m1,324905686007350,3450267487961200),(.m1,5620703441190456,4116571534393354)], + .ms [(.m1,.s3,3377699720527816),(.m10,.s7,3377699720527822),(.m8,.s2,3377699720527817)], + .m .m9, + .b 0 [[([2849934139195388],[(.D7,3377699720527822),(.D17,4116571534393354),(.D6,5620703441190456),(.D16,3450267487961200),(.D6,324905686007350),(.D16,209044648231024),(.D6,18657337933366),(.D16,12652973654128),(.D6,3210816283204654),(.D16,437364656703730),(.D18,140401799637343919586786286),(.D18,4976888274257849781622),(.D18,1215060611323437142),(.D18,296645029799182),(.D18,72266286652),(.D6,2067209780),(.D16,597571696),(.D6,21204022),(.D16,35775472),(.D6,931606),(.D16,2137768),(.D6,1225125383),(.D6,1777),(.D12,8609),(.D6,100),(.D16,4)])]], + .ms [(.m2,.s6,1424967069597694),(.m3,.s6,3021457953128398)], + .ms2 .s6 .s7 [(.m3,4027511092543498,5598438330727992),(.m0,3444701210345584,323514116603446),(.m0,208696755880048,18570364845622),(.m0,12631230382192,3210810847386670)], + .ms [(.m0,.s6,437363297749234),(.m0,.s6,140401799637343919247047662),(.m0,.s6,4976888274257764846966),(.m0,.s6,1215060611302203478),(.m0,.s6,296645024490766)], + .ms2 .s6 .s7 [(.m0,72264959548,2066878004),(.m0,597488752,21183286),(.m0,35770288,930310),(.m0,2137444,1225125302)], + .ms [(.m12,.s7,1755),(.m0,.s6,8605),(.m3,.s6,98),(.m20,.s0,98),(.m1,.s3,8605),(.m4,.s3,1755)], + .ms2 .s3 .s0 [(.m13,1225125302,2137444),(.m1,930310,35770288),(.m1,21183286,597488752),(.m1,2066878004,72264959548)], + .ms [(.m16,.s3,296645024490766),(.m1,.s3,1215060611302203478),(.m1,.s3,4976888274257764846966),(.m1,.s3,140401799637343919247047662),(.m1,.s3,437363297749234)], + .ms2 .s3 .s0 [(.m4,3210810847386670,12631230382192),(.m1,18570364845622,208696755880048),(.m1,323514116603446,3444701210345584),(.m1,5598438330727992,4027511092543498)], + .ms [(.m1,.s3,3021457953128398),(.m4,.s3,1424967069597688),(.m10,.s7,1424967069597694),(.m8,.s2,1424967069597689)], + .m .m9, + .b 0 [[([5699868278390774,2849934139195389,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,1424967069597694), + (.D17,3021457953128398)]), + ([712483534798846],[(.D16,4027511092543498), + (.D6,5598438330727992), + (.D16,3444701210345584), + (.D6,323514116603446), + (.D16,208696755880048), + (.D6,18570364845622), + (.D16,12631230382192), + (.D6,3210810847386670), + (.D16,437363297749234), + (.D18,140401799637343919247047662), + (.D18,4976888274257764846966), + (.D18,1215060611302203478), + (.D18,296645024490766), + (.D18,72264959548), + (.D6,2066878004), + (.D16,597488752), + (.D6,21183286), + (.D16,35770288), + (.D6,930310), + (.D16,2137444), + (.D6,1225125302), + (.D12,1755), + (.D16,8605), + (.D16,98), + (.D6,5)])]], + .ms [(.m2,.s6,5699868278390773),(.m14,.s5,5699868278390767)], + .m .m5, + .b 5699868278390773 [[([5],[(.D18,1),(.D15,2665216185728973),(.D14,3938450650693642)])]], + .ms [(.m2,.s6,5699868278390776),(.m7,.s5,5699868278390770)], + .m .m5, + .b 5699868278390776 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,5699868278390777),(.m15,.s5,5699868278390771)], + .m .m5, + .b 5699868278390777 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,5699868278390778),(.m25,.s2,5699868278390773)], + .m .m18, + .b 5699868278390778 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,5699868278390780),(.m14,.s5,5699868278390774)], + .m .m5, + .b 5699868278390780 [[([5],[(.D18,1),(.D17,2665216185728972),(.D15,3938450650693642),(.D17,5576173220265528),(.D15,3439134932729968),(.D17,322122547199542),(.D15,208348863529072),(.D17,18483391757878),(.D15,12609487110256),(.D17,3210805411568686),(.D15,437361938794738),(.D21,140401799637343918907309038),(.D21,4976888274257679912310),(.D21,1215060611280969814),(.D21,296645019182350),(.D21,72263632444),(.D17,2066546228),(.D15,597405808),(.D17,21162550),(.D15,35765104),(.D17,929014),(.D15,2137120),(.D17,1225125221),(.D17,1736),(.D8,8599)])]], + .ms [(.m2,.s6,5699868278390783),(.m7,.s5,5699868278390777)], + .m .m5, + .b 5699868278390783 [[([3905465301860349],[(.D8,2665216185728972),(.D16,3938450650693642),(.D6,5576173220265528),(.D16,3439134932729968),(.D6,322122547199542),(.D16,208348863529072),(.D6,18483391757878),(.D16,12609487110256),(.D6,3210805411568686),(.D16,437361938794738),(.D18,140401799637343918907309038),(.D18,4976888274257679912310),(.D18,1215060611280969814),(.D18,296645019182350),(.D18,72263632444),(.D6,2066546228),(.D16,597405808),(.D6,21162550),(.D16,35765104),(.D6,929014),(.D16,2137120),(.D6,1225125221),(.D6,1737),(.D9,8599),(.D14,96),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,7652600929320958,2177033022996430),(.m0,3816404860010506,5545661772594744),(.m0,3431507070812272,320215581720118),(.m0,207872122159216,18364206415414),(.m0,12579690774640,3210797962484782)], + .ms [(.m0,.s6,437360076523762),(.m0,.s6,140401799637343918441741294),(.m0,.s6,4976888274257563520374),(.m0,.s6,1215060611251871830),(.m0,.s6,296645011907854)], + .ms2 .s6 .s7 [(.m0,72261813820,2066091572),(.m0,597292144,21134134),(.m0,35758000,927238),(.m0,2136676,1225125110)], + .ms [(.m12,.s7,1707),(.m0,.s6,8593),(.m3,.s6,95),(.m21,.s3,95),(.m4,.s3,8593),(.m4,.s3,1707)], + .ms2 .s3 .s0 [(.m13,1225125110,2136676),(.m1,927238,35758000),(.m1,21134134,597292144),(.m1,2066091572,72261813820)], + .ms [(.m16,.s3,296645011907854),(.m1,.s3,1215060611251871830),(.m1,.s3,4976888274257563520374),(.m1,.s3,140401799637343918441741294),(.m1,.s3,437360076523762)], + .ms2 .s3 .s0 [(.m4,3210797962484782,12579690774640),(.m1,18364206415414,207872122159216),(.m1,320215581720118,3431507070812272),(.m1,5545661772594744,3816404860010506),(.m1,2177033022996430,7652600929320953)], + .ms [(.m26,.s7,7652600929320958),(.m8,.s2,7652600929320953)], + .m .m9, + .b 0 [[([15621861207441404],[(.D7,7652600929320958),(.D7,2177033022996429),(.D16,3816404860010506),(.D6,5545661772594744),(.D16,3431507070812272),(.D6,320215581720118),(.D16,207872122159216),(.D6,18364206415414),(.D16,12579690774640),(.D6,3210797962484782),(.D16,437360076523762),(.D18,140401799637343918441741294),(.D18,4976888274257563520374),(.D18,1215060611251871830),(.D18,296645011907854),(.D18,72261813820),(.D6,2066091572),(.D16,597292144),(.D6,21134134),(.D16,35758000),(.D6,927238),(.D16,2136676),(.D6,1225125110),(.D12,1707),(.D16,8593),(.D16,95),(.D12,3)])]], + .ms [(.m2,.s6,7810930603720702)], + .ms2 .s6 .s7 [(.m3,5699868278390782,1688849860263886),(.m0,3694359069327370,5515150324923960),(.m0,3423879208894576,318308616240694),(.m0,207395380789360,18245021072950),(.m0,12549894439024,3210790513400878)], + .ms [(.m0,.s6,437358214252786),(.m0,.s6,140401799637343917976173550),(.m0,.s6,4976888274257447128438),(.m0,.s6,1215060611222773846),(.m0,.s6,296645004633358)], + .ms2 .s6 .s7 [(.m0,72259995196,2065636916),(.m0,597178480,21105718),(.m0,35750896,925462),(.m0,2136232,1225124999)], + .ms [(.m3,.s6,1681)], + .ms2 .s6 .s7 [(.m6,8585,94)], + .ms2 .s3 .s0 [(.m19,94,8585)], + .ms [(.m17,.s0,1681)], + .ms2 .s3 .s0 [(.m4,1225124999,2136232),(.m1,925462,35750896),(.m1,21105718,597178480),(.m1,2065636916,72259995196)], + .ms [(.m16,.s3,296645004633358),(.m1,.s3,1215060611222773846),(.m1,.s3,4976888274257447128438),(.m1,.s3,140401799637343917976173550),(.m1,.s3,437358214252786)], + .ms2 .s3 .s0 [(.m4,3210790513400878,12549894439024),(.m1,18245021072950,207395380789360),(.m1,318308616240694,3423879208894576),(.m1,5515150324923960,3694359069327370),(.m1,1688849860263886,5699868278390782)], + .ms [(.m1,.s3,7810930603720696),(.m10,.s7,7810930603720702),(.m8,.s2,7810930603720697)], + .m .m9, + .b 0 [[([31243722414882806,14355223812243462],[(.D7,7810930603720702),(.D17,5699868278390782)]),([2849934139195391],[(.D6,1688849860263886),(.D16,3694359069327370),(.D6,5515150324923960),(.D16,3423879208894576),(.D6,318308616240694),(.D16,207395380789360),(.D6,18245021072950),(.D16,12549894439024),(.D6,3210790513400878),(.D16,437358214252786),(.D18,140401799637343917976173550),(.D18,4976888274257447128438),(.D18,1215060611222773846),(.D18,296645004633358),(.D18,72259995196),(.D6,2065636916),(.D16,597178480),(.D6,21105718),(.D16,35750896),(.D6,925462),(.D16,2136232),(.D6,1225124999),(.D6,1681),(.D12,8585),(.D6,94),(.D16,4)])]], + .ms [(.m2,.s6,22799473113563134),(.m3,.s6,2111062325329918)], + .ms2 .s6 .s7 [(.m3,4274901208793086,1332608092864462),(.m0,3605298627477514,5492885214461496),(.m0,3418312931278960,316917046836790),(.m0,207047488438384,18158047985206),(.m0,12528151167088,3210785077582894)], + .ms [(.m0,.s6,437356855298290),(.m0,.s6,140401799637343917636434926),(.m0,.s6,4976888274257362193782),(.m0,.s6,1215060611201540182),(.m0,.s6,296644999324942)], + .ms2 .s6 .s7 [(.m0,72258668092,2065305140),(.m0,597095536,21084982),(.m0,35745712,924166),(.m0,2135908,1225124918)], + .ms [(.m12,.s7,1659),(.m0,.s6,8581),(.m3,.s6,92),(.m20,.s0,92),(.m1,.s3,8581),(.m4,.s3,1659)], + .ms2 .s3 .s0 [(.m13,1225124918,2135908),(.m1,924166,35745712),(.m1,21084982,597095536),(.m1,2065305140,72258668092)], + .ms [(.m16,.s3,296644999324942),(.m1,.s3,1215060611201540182),(.m1,.s3,4976888274257362193782),(.m1,.s3,140401799637343917636434926),(.m1,.s3,437356855298290)], + .ms2 .s3 .s0 [(.m4,3210785077582894,12528151167088),(.m1,18158047985206,207047488438384),(.m1,316917046836790,3418312931278960),(.m1,5492885214461496,3605298627477514),(.m1,1332608092864462,4274901208793086)], + .ms [(.m1,.s3,2111062325329918),(.m4,.s3,22799473113563128),(.m10,.s7,22799473113563134),(.m8,.s2,22799473113563129)], + .m .m9, + .b 0 [[([67553994410557364],[(.D7,22799473113563134)]), + ([8444249301319670,4222124650659839,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,2111062325329918), + (.D16,4274901208793086)]), + ([1055531162664958],[(.D6,1332608092864462), + (.D16,3605298627477514), + (.D6,5492885214461496), + (.D16,3418312931278960), + (.D6,316917046836790), + (.D16,207047488438384), + (.D6,18158047985206), + (.D16,12528151167088), + (.D6,3210785077582894), + (.D16,437356855298290), + (.D18,140401799637343917636434926), + (.D18,4976888274257362193782), + (.D18,1215060611201540182), + (.D18,296644999324942), + (.D18,72258668092), + (.D6,2065305140), + (.D16,597095536), + (.D6,21084982), + (.D16,35745712), + (.D6,924166), + (.D16,2135908), + (.D6,1225124918), + (.D12,1659), + (.D16,8581), + (.D16,92), + (.D6,5)])]], + .ms [(.m2,.s6,33776997205278682),(.m3,.s6,14355223812243463),(.m14,.s5,14355223812243463),(.m4,.s5,33776997205278676)], + .m .m5, + .b 33776997205278682 [[([23],[(.D16,14355223812243463),(.D18,1),(.D15,3747135627460605),(.D16,1200666697531342)])]], + .ms [(.m2,.s6,33776997205278694),(.m3,.s6,14355223812243460),(.m7,.s5,14355223812243460),(.m4,.s5,33776997205278688)], + .m .m5, + .b 33776997205278694 [[([7],[(.D16,14355223812243460),(.D6,1)])]], + .ms [(.m2,.s6,33776997205278698),(.m6,.s6,14355223812243458),(.m15,.s5,14355223812243458),(.m11,.s5,33776997205278692)], + .m .m5, + .b 33776997205278698 [[([5],[(.D12,14355223812243458),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,33776997205278701,14355223812243459)], + .ms [(.m23,.s1,14355223812243459),(.m22,.s4,33776997205278695)], + .m .m24, + .b 33776997205278701 [[([17],[(.D6,14355223812243459),(.D6,2)])]], + .ms [(.m2,.s6,33776997205278710),(.m6,.s6,14355223812243455),(.m14,.s5,14355223812243455),(.m11,.s5,33776997205278704)], + .m .m5, + .b 33776997205278710 [[([23],[(.D12,14355223812243455),(.D18,1),(.D17,3747135627460604),(.D17,1200666697531342),(.D15,3572313278644234),(.D17,5484638877253176),(.D15,3416251346976880),(.D17,316401650761270),(.D15,206918639419504),(.D17,18125835730486),(.D15,12520098103408),(.D17,3210783064316974),(.D15,437356351981810),(.D21,140401799637343917510605806),(.D21,4976888274257330736502),(.D21,1215060611193675862),(.D21,296644997358862),(.D21,72258176572),(.D17,2065182260),(.D15,597064816),(.D17,21077302),(.D15,35743792),(.D17,923686),(.D15,2135788),(.D17,1225124888),(.D11,1651),(.D6,8580)])]], + .ms [(.m2,.s6,33776997205278722),(.m6,.s6,14355223812243452),(.m7,.s5,14355223812243452),(.m11,.s5,33776997205278716)], + .m .m5, + .b 33776997205278722 [[([57420895248973809,28710447624486909,5066549580791817],[(.D12,14355223812243452),(.D8,3747135627460604),(.D6,1200666697531342),(.D16,3572313278644234)]),([356241767399423],[(.D6,5484638877253176),(.D16,3416251346976880),(.D6,316401650761270),(.D16,206918639419504),(.D6,18125835730486),(.D16,12520098103408),(.D6,3210783064316974),(.D16,437356351981810),(.D18,140401799637343917510605806),(.D18,4976888274257330736502),(.D18,1215060611193675862),(.D18,296644997358862),(.D18,72258176572),(.D6,2065182260),(.D16,597064816),(.D6,21077302),(.D16,35743792),(.D6,923686),(.D16,2135788),(.D6,1225124888),(.D12,1652),(.D7,8579),(.D8,91),(.D7,4)])]], + .ms [(.m2,.s6,79375943432404990)], + .ms2 .s6 .s7 [(.m3,2955487255461886,897201488265214)], + .ms [(.m3,.s6,488183162732494)], + .ms2 .s6 .s7 [(.m3,3394192394944522,5440108656328248),(.m0,3405118791745648,313618511953462),(.m0,206222854717552,17951889554998),(.m0,12476611559536,3210772192681006)], + .ms [(.m0,.s6,437353634072818),(.m0,.s6,140401799637343916831128558),(.m0,.s6,4976888274257160867190),(.m0,.s6,1215060611151208534),(.m0,.s6,296644986742030)], + .ms2 .s6 .s7 [(.m0,72255522364,2064518708),(.m0,596898928,21035830),(.m0,35733424,921094),(.m0,2135140,1225124726)], + .ms [(.m12,.s7,1611),(.m0,.s6,8569),(.m3,.s6,89),(.m21,.s3,89),(.m4,.s3,8569),(.m4,.s3,1611)], + .ms2 .s3 .s0 [(.m13,1225124726,2135140),(.m1,921094,35733424),(.m1,21035830,596898928),(.m1,2064518708,72255522364)], + .ms [(.m16,.s3,296644986742030),(.m1,.s3,1215060611151208534),(.m1,.s3,4976888274257160867190),(.m1,.s3,140401799637343916831128558),(.m1,.s3,437353634072818)], + .ms2 .s3 .s0 [(.m4,3210772192681006,12476611559536),(.m1,17951889554998,206222854717552),(.m1,313618511953462,3405118791745648),(.m1,5440108656328248,3394192394944522),(.m1,488183162732494,897201488265214)], + .ms [(.m4,.s3,2955487255461886),(.m4,.s3,79375943432404984),(.m10,.s7,79375943432404990),(.m8,.s2,79375943432404985)], + .m .m9, + .b 0 [[([94575592174780340],[(.D7,79375943432404990)]), + ([11821949021847542,5910974510923775,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,2955487255461886), + (.D6,897201488265214), + (.D6,488183162732494)]), + ([369435906932735],[(.D16,3394192394944522), + (.D6,5440108656328248), + (.D16,3405118791745648), + (.D6,313618511953462), + (.D16,206222854717552), + (.D6,17951889554998), + (.D16,12476611559536), + (.D6,3210772192681006), + (.D16,437353634072818), + (.D18,140401799637343916831128558), + (.D18,4976888274257160867190), + (.D18,1215060611151208534), + (.D18,296644986742030), + (.D18,72255522364), + (.D6,2064518708), + (.D16,596898928), + (.D6,21035830), + (.D16,35733424), + (.D6,921094), + (.D16,2135140), + (.D6,1225124726), + (.D12,1611), + (.D16,8569), + (.D16,89), + (.D12,3)])], + [([8],[(.D15,67553994410557447), + (.D21,0), + (.D19,158329674399741)])]], + .ms [(.m2,.s6,47287796087390174)], + .m .m6, + ] (by decide +kernel) +theorem chunk_40_step : (cfg_40.denote) [qi]⊢* (cfg_41.denote) := + step_chunk [ + .s .s6 67553994410557445, + .ms [(.m7,.s5,67553994410557445),(.m11,.s5,47287796087390168)], + .m .m5, + .b 47287796087390174 [[([41],[(.D12,67553994410557445),(.D8,1),(.D7,158329674399740)])],[([3799912185593734],[(.D17,67553994410557441),(.D2,158329674399738)])]], + .ms [(.m2,.s6,49187752180187062),(.m3,.s6,67079005387358224),(.m27,.s2,67079005387358224),(.m1,.s5,49187752180187056)], + .m .m5, + .b 49187752180187062 [[([7],[(.D16,67079005387358224), + (.D6,1)])], + [([16],[(.D11,67079005387358222), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,67079005387358221), + (.D17,1), + (.D15,0), + (.D6,303465209266126)])], + [([16],[(.D11,67079005387358219), + (.D3,0)])], + [([8],[(.D15,67079005387358218), + (.D17,1), + (.D21,303465209266125), + (.D15,3348012906577930), + (.D17,5428563784236600), + (.D15,3402232573722736), + (.D17,312896957447734), + (.D15,206042466091120), + (.D17,17906792398390), + (.D15,12465337270384), + (.D17,3210769374108718), + (.D15,437352929429746), + (.D21,140401799637343916654967790), + (.D21,4976888274257116826998), + (.D21,1215060611140198486), + (.D21,296644983989518), + (.D21,72254834236), + (.D17,2064346676), + (.D15,596855920), + (.D17,21025078), + (.D15,35730736), + (.D17,920422), + (.D15,2134972), + (.D17,1225124684), + (.D11,1600), + (.D12,8566)])], + [([18],[(.D11,67079005387358216), + (.D13,0), + (.D16,303465209266125), + (.D16,3348012906577930)])], + [([9710886696516036],[(.D17,67079005387358215)]), + ([1213860837064507,606930418532255,303465209266128,151732604633064,75866302316532,37933151158263,18966575579133,9483287789568,4741643894784,2370821947392,1185410973696,592705486848,296352743424,148176371712,74088185856,37044092928,18522046464,9261023232,4630511616,2315255808,1157627904,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,303465209266126), + (.D17,3348012906577930)]), + ([151732604633063],[(.D6,5428563784236600), + (.D16,3402232573722736), + (.D6,312896957447734), + (.D16,206042466091120), + (.D6,17906792398390), + (.D16,12465337270384), + (.D6,3210769374108718), + (.D16,437352929429746), + (.D18,140401799637343916654967790), + (.D18,4976888274257116826998), + (.D18,1215060611140198486), + (.D18,296644983989518), + (.D18,72254834236), + (.D6,2064346676), + (.D16,596855920), + (.D6,21025078), + (.D16,35730736), + (.D6,920422), + (.D16,2134972), + (.D6,1225124684), + (.D12,1601), + (.D13,8566), + (.D9,88), + (.D13,3)])], + [([10],[(.D17,65865144550293711), + (.D21,0), + (.D19,3272146604261398)])]], + .ms [(.m2,.s6,54043195528445122),(.m3,.s6,65865144550293709),(.m7,.s5,65865144550293709),(.m4,.s5,54043195528445116)], + .m .m5, + .b 54043195528445122 [[([43],[(.D16,65865144550293709),(.D8,1),(.D7,3272146604261397)])],[([78531518502273498],[(.D11,65865144550293702),(.D2,3272146604261395)])]], + .ms2 .s6 .s7 [(.m2,93308954779581893,56048704737509517)], + .ms [(.m29,.s2,56048704737509517),(.m4,.s5,93308954779581887)], + .m .m5, + .b 93308954779581893 [[([9],[(.D6,56048704737509517),(.D6,1)])],[([20],[(.D15,56048704737509515),(.D13,0),(.D10,5409597208657466),(.D9,3397490929827952)])],[([36],[(.D11,56048704737509511)]),([7,2],[(.D12,1),(.D6,5409597208657466)])]], + .ms [(.m2,.s6,93308954779581926),(.m6,.s6,56048704737509507),(.m15,.s5,56048704737509507),(.m11,.s5,93308954779581920)], + .m .m5, + .b 93308954779581926 [[([5],[(.D12,56048704737509507),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,93308954779581929,56048704737509508)], + .ms [(.m23,.s1,56048704737509508),(.m22,.s4,93308954779581923)], + .m .m24, + .b 93308954779581929 [[([17],[(.D6,56048704737509508),(.D6,2)])],[([6],[(.D11,56048704737509504),(.D21,0),(.D7,5409597208657464)])]], + .ms2 .s6 .s7 [(.m2,93308954779581941,56048704737509505)], + .ms2 .s5 .s2 [(.m28,56048704737509505,93308954779581936)], + .m .m18, + .b 93308954779581941 [[([45],[(.D6,56048704737509505),(.D8,1),(.D17,5409597208657463),(.D10,3397490929827951)])],[([36],[(.D15,56048704737509498)]),([7,2],[(.D12,1),(.D17,5409597208657462)]),([1],[(.D11,3397490929827951),(.D16,311711546474038)])],[([8],[(.D15,56048704737509494),(.D21,0),(.D17,5409597208657461),(.D12,3397490929827952)])]], + .ms [(.m2,.s6,93308954779581986),(.m6,.s6,56048704737509492),(.m7,.s5,56048704737509492),(.m11,.s5,93308954779581980)], + .m .m5, + .b 93308954779581986 [[([39],[(.D12,56048704737509492),(.D8,5409597208657462),(.D13,3397490929827952),(.D17,311711546474038),(.D15,205746113347696),(.D17,17832704212534),(.D15,12446815223920),(.D17,3210764743597102),(.D15,437351771801842),(.D21,140401799637343916365560814),(.D21,4976888274257044475254),(.D21,1215060611122110550),(.D21,296644979467534),(.D21,72253703740),(.D17,2064064052),(.D15,596785264),(.D17,21007414),(.D15,35726320),(.D17,919318),(.D15,2134696),(.D17,1225124615),(.D17,1585),(.D11,8561),(.D17,88),(.D15,3)])]], + .ms [(.m2,.s6,93308954779582006)], + .ms2 .s6 .s7 [(.m3,56048704737509488,5409597208657462),(.m0,3397490929827952,311711546474038),(.m0,205746113347696,17832704212534),(.m0,12446815223920,3210764743597102)], + .ms [(.m0,.s6,437351771801842),(.m0,.s6,140401799637343916365560814),(.m0,.s6,4976888274257044475254),(.m0,.s6,1215060611122110550),(.m0,.s6,296644979467534)], + .ms2 .s6 .s7 [(.m0,72253703740,2064064052),(.m0,596785264,21007414),(.m0,35726320,919318),(.m0,2134696,1225124615)], + .ms [(.m3,.s6,1585)], + .ms2 .s6 .s7 [(.m6,8561,88)], + .ms2 .s3 .s0 [(.m19,88,8561)], + .ms [(.m17,.s0,1585)], + .ms2 .s3 .s0 [(.m4,1225124615,2134696),(.m1,919318,35726320),(.m1,21007414,596785264),(.m1,2064064052,72253703740)], + .ms [(.m16,.s3,296644979467534),(.m1,.s3,1215060611122110550),(.m1,.s3,4976888274257044475254),(.m1,.s3,140401799637343916365560814),(.m1,.s3,437351771801842)], + .ms2 .s3 .s0 [(.m4,3210764743597102,12446815223920),(.m1,17832704212534,205746113347696),(.m1,311711546474038,3397490929827952),(.m1,5409597208657462,56048704737509488)], + .ms [(.m1,.s3,93308954779582000),(.m10,.s7,93308954779582006),(.m8,.s2,93308954779582001)], + .m .m9, + .b 0 [[([2849934139195388],[(.D7,93308954779582006),(.D17,56048704737509488),(.D6,5409597208657462),(.D16,3397490929827952),(.D6,311711546474038),(.D16,205746113347696),(.D6,17832704212534),(.D16,12446815223920),(.D6,3210764743597102),(.D16,437351771801842),(.D18,140401799637343916365560814),(.D18,4976888274257044475254),(.D18,1215060611122110550),(.D18,296644979467534),(.D18,72253703740),(.D6,2064064052),(.D16,596785264),(.D6,21007414),(.D16,35726320),(.D6,919318),(.D16,2134696),(.D6,1225124615),(.D6,1585),(.D12,8561),(.D6,88),(.D16,4)])]], + .ms [(.m2,.s6,1424967069597694),(.m3,.s6,92952713012182582)], + .ms2 .s6 .s7 [(.m3,55959644295659632,5387332098194998),(.m0,3391924652212336,310319977070134),(.m0,205398220996720,17745731124790),(.m0,12425071951984,3210759307779118)], + .ms [(.m0,.s6,437350412847346),(.m0,.s6,140401799637343916025822190),(.m0,.s6,4976888274256959540598),(.m0,.s6,1215060611100876886),(.m0,.s6,296644974159118)], + .ms2 .s6 .s7 [(.m0,72252376636,2063732276),(.m0,596702320,20986678),(.m0,35721136,918022),(.m0,2134372,1225124534)], + .ms [(.m12,.s7,1563),(.m0,.s6,8557),(.m3,.s6,86),(.m20,.s0,86),(.m1,.s3,8557),(.m4,.s3,1563)], + .ms2 .s3 .s0 [(.m13,1225124534,2134372),(.m1,918022,35721136),(.m1,20986678,596702320),(.m1,2063732276,72252376636)], + .ms [(.m16,.s3,296644974159118),(.m1,.s3,1215060611100876886),(.m1,.s3,4976888274256959540598),(.m1,.s3,140401799637343916025822190),(.m1,.s3,437350412847346)], + .ms2 .s3 .s0 [(.m4,3210759307779118,12425071951984),(.m1,17745731124790,205398220996720),(.m1,310319977070134,3391924652212336),(.m1,5387332098194998,55959644295659632)], + .ms [(.m1,.s3,92952713012182582),(.m4,.s3,1424967069597688),(.m10,.s7,1424967069597694),(.m8,.s2,1424967069597689)], + .m .m9, + .b 0 [[([5699868278390774,2849934139195389,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,1424967069597694), + (.D17,92952713012182582)]), + ([712483534798846],[(.D16,55959644295659632), + (.D6,5387332098194998), + (.D16,3391924652212336), + (.D6,310319977070134), + (.D16,205398220996720), + (.D6,17745731124790), + (.D16,12425071951984), + (.D6,3210759307779118), + (.D16,437350412847346), + (.D18,140401799637343916025822190), + (.D18,4976888274256959540598), + (.D18,1215060611100876886), + (.D18,296644974159118), + (.D18,72252376636), + (.D6,2063732276), + (.D16,596702320), + (.D6,20986678), + (.D16,35721136), + (.D6,918022), + (.D16,2134372), + (.D6,1225124534), + (.D12,1563), + (.D16,8557), + (.D16,86), + (.D6,5)])]], + .ms [(.m2,.s6,5699868278390773),(.m14,.s5,5699868278390767)], + .m .m5, + .b 5699868278390773 [[([5],[(.D18,1),(.D15,92596471244783157),(.D14,55870583853809776)])]], + .ms [(.m2,.s6,5699868278390776),(.m7,.s5,5699868278390770)], + .m .m5, + .b 5699868278390776 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,5699868278390777),(.m15,.s5,5699868278390771)], + .m .m5, + .b 5699868278390777 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,5699868278390778),(.m25,.s2,5699868278390773)], + .m .m18, + .b 5699868278390778 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,5699868278390780),(.m14,.s5,5699868278390774)], + .m .m5, + .b 5699868278390780 [[([5],[(.D18,1),(.D17,92596471244783156),(.D15,55870583853809776),(.D17,5365066987732534),(.D15,3386358374596720),(.D17,308928407666230),(.D15,205050328645744),(.D17,17658758037046),(.D15,12403328680048),(.D17,3210753871961134),(.D15,437349053892850),(.D21,140401799637343915686083566),(.D21,4976888274256874605942),(.D21,1215060611079643222),(.D21,296644968850702),(.D21,72251049532),(.D17,2063400500),(.D15,596619376),(.D17,20965942),(.D15,35715952),(.D17,916726),(.D15,2134048),(.D17,1225124453),(.D17,1544),(.D8,8551)])]], + .ms [(.m2,.s6,5699868278390783),(.m7,.s5,5699868278390777)], + .m .m5, + .b 5699868278390783 [[([3905465301860349],[(.D8,92596471244783156),(.D16,55870583853809776),(.D6,5365066987732534),(.D16,3386358374596720),(.D6,308928407666230),(.D16,205050328645744),(.D6,17658758037046),(.D16,12403328680048),(.D6,3210753871961134),(.D16,437349053892850),(.D18,140401799637343915686083566),(.D18,4976888274256874605942),(.D18,1215060611079643222),(.D18,296644968850702),(.D18,72251049532),(.D6,2063400500),(.D16,596619376),(.D6,20965942),(.D16,35715952),(.D6,916726),(.D16,2134048),(.D6,1225124453),(.D6,1545),(.D9,8551),(.D14,84),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,7652600929320958,92108288082050614),(.m0,55748538063126640,5334555540061750),(.m0,3378730512679024,307021442186806),(.m0,204573587275888,17539572694582),(.m0,12373532344432,3210746422877230)], + .ms [(.m0,.s6,437347191621874),(.m0,.s6,140401799637343915220515822),(.m0,.s6,4976888274256758214006),(.m0,.s6,1215060611050545238),(.m0,.s6,296644961576206)], + .ms2 .s6 .s7 [(.m0,72249230908,2062945844),(.m0,596505712,20937526),(.m0,35708848,914950),(.m0,2133604,1225124342)], + .ms [(.m12,.s7,1515),(.m0,.s6,8545),(.m3,.s6,83),(.m21,.s3,83),(.m4,.s3,8545),(.m4,.s3,1515)], + .ms2 .s3 .s0 [(.m13,1225124342,2133604),(.m1,914950,35708848),(.m1,20937526,596505712),(.m1,2062945844,72249230908)], + .ms [(.m16,.s3,296644961576206),(.m1,.s3,1215060611050545238),(.m1,.s3,4976888274256758214006),(.m1,.s3,140401799637343915220515822),(.m1,.s3,437347191621874)], + .ms2 .s3 .s0 [(.m4,3210746422877230,12373532344432),(.m1,17539572694582,204573587275888),(.m1,307021442186806,3378730512679024),(.m1,5334555540061750,55748538063126640),(.m1,92108288082050614,7652600929320953)], + .ms [(.m26,.s7,7652600929320958),(.m8,.s2,7652600929320953)], + .m .m9, + .b 0 [[([15621861207441404],[(.D7,7652600929320958),(.D7,92108288082050613),(.D16,55748538063126640),(.D6,5334555540061750),(.D16,3378730512679024),(.D6,307021442186806),(.D16,204573587275888),(.D6,17539572694582),(.D16,12373532344432),(.D6,3210746422877230),(.D16,437347191621874),(.D18,140401799637343915220515822),(.D18,4976888274256758214006),(.D18,1215060611050545238),(.D18,296644961576206),(.D18,72249230908),(.D6,2062945844),(.D16,596505712),(.D6,20937526),(.D16,35708848),(.D6,914950),(.D16,2133604),(.D6,1225124342),(.D12,1515),(.D16,8545),(.D16,83),(.D12,3)])]], + .ms [(.m2,.s6,7810930603720702)], + .ms2 .s6 .s7 [(.m3,5699868278390782,91620104919318070),(.m0,55626492272443504,5304044092390966),(.m0,3371102650761328,305114476707382),(.m0,204096845906032,17420387352118),(.m0,12343736008816,3210738973793326)], + .ms [(.m0,.s6,437345329350898),(.m0,.s6,140401799637343914754948078),(.m0,.s6,4976888274256641822070),(.m0,.s6,1215060611021447254),(.m0,.s6,296644954301710)], + .ms2 .s6 .s7 [(.m0,72247412284,2062491188),(.m0,596392048,20909110),(.m0,35701744,913174),(.m0,2133160,1225124231)], + .ms [(.m3,.s6,1489)], + .ms2 .s6 .s7 [(.m6,8537,82)], + .ms2 .s3 .s0 [(.m19,82,8537)], + .ms [(.m17,.s0,1489)], + .ms2 .s3 .s0 [(.m4,1225124231,2133160),(.m1,913174,35701744),(.m1,20909110,596392048),(.m1,2062491188,72247412284)], + .ms [(.m16,.s3,296644954301710),(.m1,.s3,1215060611021447254),(.m1,.s3,4976888274256641822070),(.m1,.s3,140401799637343914754948078),(.m1,.s3,437345329350898)], + .ms2 .s3 .s0 [(.m4,3210738973793326,12343736008816),(.m1,17420387352118,204096845906032),(.m1,305114476707382,3371102650761328),(.m1,5304044092390966,55626492272443504),(.m1,91620104919318070,5699868278390782)], + .ms [(.m1,.s3,7810930603720696),(.m10,.s7,7810930603720702),(.m8,.s2,7810930603720697)], + .m .m9, + .b 0 [[([31243722414882806,14355223812243462],[(.D7,7810930603720702),(.D17,5699868278390782)]),([2849934139195391],[(.D6,91620104919318070),(.D16,55626492272443504),(.D6,5304044092390966),(.D16,3371102650761328),(.D6,305114476707382),(.D16,204096845906032),(.D6,17420387352118),(.D16,12343736008816),(.D6,3210738973793326),(.D16,437345329350898),(.D18,140401799637343914754948078),(.D18,4976888274256641822070),(.D18,1215060611021447254),(.D18,296644954301710),(.D18,72247412284),(.D6,2062491188),(.D16,596392048),(.D6,20909110),(.D16,35701744),(.D6,913174),(.D16,2133160),(.D6,1225124231),(.D6,1489),(.D12,8537),(.D6,82),(.D16,4)])]], + .ms [(.m2,.s6,22799473113563134),(.m3,.s6,2111062325329918)], + .ms2 .s6 .s7 [(.m3,4274901208793086,91263863151918646),(.m0,55537431830593648,5281778981928502),(.m0,3365536373145712,303722907303478),(.m0,203748953555056,17333414264374),(.m0,12321992736880,3210733537975342)], + .ms [(.m0,.s6,437343970396402),(.m0,.s6,140401799637343914415209454),(.m0,.s6,4976888274256556887414),(.m0,.s6,1215060611000213590),(.m0,.s6,296644948993294)], + .ms2 .s6 .s7 [(.m0,72246085180,2062159412),(.m0,596309104,20888374),(.m0,35696560,911878),(.m0,2132836,1225124150)], + .ms [(.m12,.s7,1467),(.m0,.s6,8533),(.m3,.s6,80),(.m20,.s0,80),(.m1,.s3,8533),(.m4,.s3,1467)], + .ms2 .s3 .s0 [(.m13,1225124150,2132836),(.m1,911878,35696560),(.m1,20888374,596309104),(.m1,2062159412,72246085180)], + .ms [(.m16,.s3,296644948993294),(.m1,.s3,1215060611000213590),(.m1,.s3,4976888274256556887414),(.m1,.s3,140401799637343914415209454),(.m1,.s3,437343970396402)], + .ms2 .s3 .s0 [(.m4,3210733537975342,12321992736880),(.m1,17333414264374,203748953555056),(.m1,303722907303478,3365536373145712),(.m1,5281778981928502,55537431830593648),(.m1,91263863151918646,4274901208793086)], + .ms [(.m1,.s3,2111062325329918),(.m4,.s3,22799473113563128),(.m10,.s7,22799473113563134),(.m8,.s2,22799473113563129)], + .m .m9, + .b 0 [[([67553994410557364],[(.D7,22799473113563134)]), + ([8444249301319670,4222124650659839,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,2111062325329918), + (.D16,4274901208793086)]), + ([1055531162664958],[(.D6,91263863151918646), + (.D16,55537431830593648), + (.D6,5281778981928502), + (.D16,3365536373145712), + (.D6,303722907303478), + (.D16,203748953555056), + (.D6,17333414264374), + (.D16,12321992736880), + (.D6,3210733537975342), + (.D16,437343970396402), + (.D18,140401799637343914415209454), + (.D18,4976888274256556887414), + (.D18,1215060611000213590), + (.D18,296644948993294), + (.D18,72246085180), + (.D6,2062159412), + (.D16,596309104), + (.D6,20888374), + (.D16,35696560), + (.D6,911878), + (.D16,2132836), + (.D6,1225124150), + (.D12,1467), + (.D16,8533), + (.D16,80), + (.D6,5)])]], + .ms [(.m2,.s6,33776997205278682),(.m3,.s6,14355223812243463),(.m14,.s5,14355223812243463),(.m4,.s5,33776997205278676)], + .m .m5, + .b 33776997205278682 [[([23],[(.D16,14355223812243463),(.D18,1),(.D15,3747135627460605),(.D16,91131921756585526)])]], + .ms [(.m2,.s6,33776997205278694),(.m3,.s6,14355223812243460),(.m7,.s5,14355223812243460),(.m4,.s5,33776997205278688)], + .m .m5, + .b 33776997205278694 [[([7],[(.D16,14355223812243460),(.D6,1)])]], + .ms [(.m2,.s6,33776997205278698),(.m6,.s6,14355223812243458),(.m15,.s5,14355223812243458),(.m11,.s5,33776997205278692)], + .m .m5, + .b 33776997205278698 [[([5],[(.D12,14355223812243458),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,33776997205278701,14355223812243459)], + .ms [(.m23,.s1,14355223812243459),(.m22,.s4,33776997205278695)], + .m .m24, + .b 33776997205278701 [[([17],[(.D6,14355223812243459),(.D6,2)])]], + .ms [(.m2,.s6,33776997205278710),(.m6,.s6,14355223812243455),(.m14,.s5,14355223812243455),(.m11,.s5,33776997205278704)], + .m .m5, + .b 33776997205278710 [[([23],[(.D12,14355223812243455),(.D18,1),(.D17,3747135627460604),(.D17,91131921756585526),(.D15,55504446481760368),(.D17,5273532644720182),(.D15,3363474788843632),(.D17,303207511227958),(.D15,203620104536176),(.D17,17301202009654),(.D15,12313939673200),(.D17,3210731524709422),(.D15,437343467079922),(.D21,140401799637343914289380334),(.D21,4976888274256525430134),(.D21,1215060610992349270),(.D21,296644947027214),(.D21,72245593660),(.D17,2062036532),(.D15,596278384),(.D17,20880694),(.D15,35694640),(.D17,911398),(.D15,2132716),(.D17,1225124120),(.D11,1459),(.D6,8532)])]], + .ms [(.m2,.s6,33776997205278722),(.m6,.s6,14355223812243452),(.m7,.s5,14355223812243452),(.m11,.s5,33776997205278716)], + .m .m5, + .b 33776997205278722 [[([57420895248973809,28710447624486909,5066549580791817],[(.D12,14355223812243452),(.D8,3747135627460604),(.D6,91131921756585526)]),([1424967069597695],[(.D16,55504446481760368),(.D6,5273532644720182),(.D16,3363474788843632),(.D6,303207511227958),(.D16,203620104536176),(.D6,17301202009654),(.D16,12313939673200),(.D6,3210731524709422),(.D16,437343467079922),(.D18,140401799637343914289380334),(.D18,4976888274256525430134),(.D18,1215060610992349270),(.D18,296644947027214),(.D18,72245593660),(.D6,2062036532),(.D16,596278384),(.D6,20880694),(.D16,35694640),(.D6,911398),(.D16,2132716),(.D6,1225124120),(.D12,1460),(.D7,8531),(.D8,79),(.D7,4)])]], + .ms [(.m2,.s6,79375943432404990)], + .ms2 .s6 .s7 [(.m3,2955487255461886,897201488265214)], + .ms [(.m3,.s6,90419438221786678)], + .ms2 .s6 .s7 [(.m3,55326325598060656,5229002423795254),(.m0,3352342233612400,300424372420150),(.m0,202924319834224,17127255834166),(.m0,12270453129328,3210720653073454)], + .ms [(.m0,.s6,437340749170930),(.m0,.s6,140401799637343913609903086),(.m0,.s6,4976888274256355560822),(.m0,.s6,1215060610949881942),(.m0,.s6,296644936410382)], + .ms2 .s6 .s7 [(.m0,72242939452,2061372980),(.m0,596112496,20839222),(.m0,35684272,908806),(.m0,2132068,1225123958)], + .ms [(.m12,.s7,1419),(.m0,.s6,8521),(.m3,.s6,77),(.m21,.s3,77),(.m4,.s3,8521),(.m4,.s3,1419)], + .ms2 .s3 .s0 [(.m13,1225123958,2132068),(.m1,908806,35684272),(.m1,20839222,596112496),(.m1,2061372980,72242939452)], + .ms [(.m16,.s3,296644936410382),(.m1,.s3,1215060610949881942),(.m1,.s3,4976888274256355560822),(.m1,.s3,140401799637343913609903086),(.m1,.s3,437340749170930)], + .ms2 .s3 .s0 [(.m4,3210720653073454,12270453129328),(.m1,17127255834166,202924319834224),(.m1,300424372420150,3352342233612400),(.m1,5229002423795254,55326325598060656),(.m1,90419438221786678,897201488265214)], + .ms [(.m4,.s3,2955487255461886),(.m4,.s3,79375943432404984),(.m10,.s7,79375943432404990),(.m8,.s2,79375943432404985)], + .m .m9, + .b 0 [[([94575592174780340],[(.D7,79375943432404990)]), + ([11821949021847542,5910974510923775,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,2955487255461886), + (.D6,897201488265214), + (.D6,90419438221786678)]), + ([369435906932735],[(.D16,55326325598060656), + (.D6,5229002423795254), + (.D16,3352342233612400), + (.D6,300424372420150), + (.D16,202924319834224), + (.D6,17127255834166), + (.D16,12270453129328), + (.D6,3210720653073454), + (.D16,437340749170930), + (.D18,140401799637343913609903086), + (.D18,4976888274256355560822), + (.D18,1215060610949881942), + (.D18,296644936410382), + (.D18,72242939452), + (.D6,2061372980), + (.D16,596112496), + (.D6,20839222), + (.D16,35684272), + (.D6,908806), + (.D16,2132068), + (.D6,1225123958), + (.D12,1419), + (.D16,8521), + (.D16,77), + (.D12,3)])], + [([8],[(.D15,67553994410557447), + (.D21,0), + (.D19,158329674399741)])]], + .ms [(.m2,.s6,47287796087390174),(.m6,.s6,67553994410557445),(.m7,.s5,67553994410557445),(.m11,.s5,47287796087390168)], + .m .m5, + .b 47287796087390174 [[([41],[(.D12,67553994410557445),(.D8,1),(.D7,158329674399740)])],[([3799912185593734],[(.D17,67553994410557441),(.D2,158329674399738)])]], + .ms [(.m2,.s6,49187752180187062),(.m3,.s6,67079005387358224),(.m27,.s2,67079005387358224),(.m1,.s5,49187752180187056)], + .m .m5, + .b 49187752180187062 [[([7],[(.D16,67079005387358224), + (.D6,1)])], + [([16],[(.D11,67079005387358222), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,67079005387358221), + (.D17,1), + (.D15,0), + (.D6,90234720268320310)])], + [([16],[(.D11,67079005387358219), + (.D3,0)])], + [([8],[(.D15,67079005387358218), + (.D17,1), + (.D21,90234720268320309), + (.D15,55280146109694064), + (.D17,5217457551703606), + (.D15,3349456015589488), + (.D17,299702817914422), + (.D15,202743931207792), + (.D17,17082158677558), + (.D15,12259178840176), + (.D17,3210717834501166), + (.D15,437340044527858), + (.D21,140401799637343913433742318), + (.D21,4976888274256311520630), + (.D21,1215060610938871894), + (.D21,296644933657870), + (.D21,72242251324), + (.D17,2061200948), + (.D15,596069488), + (.D17,20828470), + (.D15,35681584), + (.D17,908134), + (.D15,2131900), + (.D17,1225123916), + (.D11,1408), + (.D12,8518)])], + [([18],[(.D11,67079005387358216), + (.D13,0), + (.D16,90234720268320309), + (.D16,55280146109694064)])], + [([9710886696517606],[(.D17,67079005387358215), + (.D12,90234720268320310), + (.D17,55280146109694064), + (.D6,5217457551703606), + (.D16,3349456015589488), + (.D6,299702817914422), + (.D16,202743931207792), + (.D6,17082158677558), + (.D16,12259178840176), + (.D6,3210717834501166), + (.D16,437340044527858), + (.D18,140401799637343913433742318), + (.D18,4976888274256311520630), + (.D18,1215060610938871894), + (.D18,296644933657870), + (.D18,72242251324), + (.D6,2061200948), + (.D16,596069488), + (.D6,20828470), + (.D16,35681584), + (.D6,908134), + (.D16,2131900), + (.D6,1225123916), + (.D12,1409), + (.D13,8518), + (.D9,76), + (.D13,3)])]], + .ms [(.m2,.s6,54043195528445902)], + .ms2 .s6 .s7 [(.m3,65865144550293514,89931255059054136),(.m0,55204279807377520,5198490976124470),(.m0,3344714371694704,298517406940726),(.m0,202447578464368,17008070491702),(.m0,12240656793712,3210713203989550)], + .ms [(.m0,.s6,437338886899954),(.m0,.s6,140401799637343913144335342),(.m0,.s6,4976888274256239168886),(.m0,.s6,1215060610920783958),(.m0,.s6,296644929135886)], + .ms2 .s6 .s7 [(.m0,72241120828,2060918324),(.m0,595998832,20810806),(.m0,35677168,907030),(.m0,2131624,1225123847)], + .ms [(.m3,.s6,1393)], + .ms2 .s6 .s7 [(.m6,8513,76)], + .ms2 .s3 .s0 [(.m19,76,8513)], + .ms [(.m17,.s0,1393)], + .ms2 .s3 .s0 [(.m4,1225123847,2131624),(.m1,907030,35677168),(.m1,20810806,595998832),(.m1,2060918324,72241120828)], + .ms [(.m16,.s3,296644929135886),(.m1,.s3,1215060610920783958),(.m1,.s3,4976888274256239168886),(.m1,.s3,140401799637343913144335342),(.m1,.s3,437338886899954)], + .ms2 .s3 .s0 [(.m4,3210713203989550,12240656793712),(.m1,17008070491702,202447578464368),(.m1,298517406940726,3344714371694704),(.m1,5198490976124470,55204279807377520),(.m1,89931255059054136,65865144550293514)], + .ms [(.m1,.s3,54043195528445896),(.m10,.s7,54043195528445902),(.m8,.s2,54043195528445897)], + .m .m9, + .b 0 [[([45598946227126268],[(.D7,54043195528445902),(.D17,65865144550293514),(.D6,89931255059054136),(.D16,55204279807377520),(.D6,5198490976124470),(.D16,3344714371694704),(.D6,298517406940726),(.D16,202447578464368),(.D6,17008070491702),(.D16,12240656793712),(.D6,3210713203989550),(.D16,437338886899954),(.D18,140401799637343913144335342),(.D18,4976888274256239168886),(.D18,1215060610920783958),(.D18,296644929135886),(.D18,72241120828),(.D6,2060918324),(.D16,595998832),(.D6,20810806),(.D16,35677168),(.D6,907030),(.D16,2131624),(.D6,1225123847),(.D6,1393),(.D12,8513),(.D6,76),(.D16,4)])]], + .ms [(.m2,.s6,22799473113563134),(.m3,.s6,48343327250055118)], + .ms2 .s6 .s7 [(.m3,64440177480695818,89575013291654712),(.m0,55115219365527664,5176225865662006),(.m0,3339148094079088,297125837536822),(.m0,202099686113392,16921097403958),(.m0,12218913521776,3210707768171566)], + .ms [(.m0,.s6,437337527945458),(.m0,.s6,140401799637343912804596718),(.m0,.s6,4976888274256154234230),(.m0,.s6,1215060610899550294),(.m0,.s6,296644923827470)], + .ms2 .s6 .s7 [(.m0,72239793724,2060586548),(.m0,595915888,20790070),(.m0,35671984,905734),(.m0,2131300,1225123766)], + .ms [(.m12,.s7,1371),(.m0,.s6,8509),(.m3,.s6,74),(.m20,.s0,74),(.m1,.s3,8509),(.m4,.s3,1371)], + .ms2 .s3 .s0 [(.m13,1225123766,2131300),(.m1,905734,35671984),(.m1,20790070,595915888),(.m1,2060586548,72239793724)], + .ms [(.m16,.s3,296644923827470),(.m1,.s3,1215060610899550294),(.m1,.s3,4976888274256154234230),(.m1,.s3,140401799637343912804596718),(.m1,.s3,437337527945458)], + .ms2 .s3 .s0 [(.m4,3210707768171566,12218913521776),(.m1,16921097403958,202099686113392),(.m1,297125837536822,3339148094079088),(.m1,5176225865662006,55115219365527664),(.m1,89575013291654712,64440177480695818)], + .ms [(.m1,.s3,48343327250055118),(.m4,.s3,22799473113563128),(.m10,.s7,22799473113563134),(.m8,.s2,22799473113563129)], + .m .m9, + .b 0 [[([91197892454252534,45598946227126269,22799473113563136,11399736556781568,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,22799473113563134), + (.D17,48343327250055118)]), + ([11399736556781566],[(.D16,64440177480695818), + (.D6,89575013291654712), + (.D16,55115219365527664), + (.D6,5176225865662006), + (.D16,3339148094079088), + (.D6,297125837536822), + (.D16,202099686113392), + (.D6,16921097403958), + (.D16,12218913521776), + (.D6,3210707768171566), + (.D16,437337527945458), + (.D18,140401799637343912804596718), + (.D18,4976888274256154234230), + (.D18,1215060610899550294), + (.D18,296644923827470), + (.D18,72239793724), + (.D6,2060586548), + (.D16,595915888), + (.D6,20790070), + (.D16,35671984), + (.D6,905734), + (.D16,2131300), + (.D6,1225123766), + (.D12,1371), + (.D16,8509), + (.D16,74), + (.D6,5)])]], + .ms [(.m2,.s6,91197892454252533),(.m14,.s5,91197892454252527)], + .m .m5, + .b 91197892454252533 [[([5],[(.D18,1),(.D15,42643458971664333),(.D14,63015210411098122)])]], + .ms [(.m2,.s6,91197892454252536),(.m7,.s5,91197892454252530)], + .m .m42, + ] (by decide +kernel) +theorem chunk_41_step : (cfg_41.denote) [qi]⊢* (cfg_42.denote) := + step_chunk [ + .m .m43, + .b 91197892454252536 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,91197892454252537),(.m15,.s5,91197892454252531)], + .m .m5, + .b 91197892454252537 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,91197892454252538),(.m25,.s2,91197892454252533)], + .m .m18, + .b 91197892454252538 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,91197892454252540),(.m14,.s5,91197892454252534)], + .m .m5, + .b 91197892454252540 [[([5],[(.D18,1),(.D17,42643458971664332),(.D15,63015210411098122),(.D17,89218771524255288),(.D15,55026158923677808),(.D17,5153960755199542),(.D15,3333581816463472),(.D17,295734268132918),(.D15,201751793762416),(.D17,16834124316214),(.D15,12197170249840),(.D17,3210702332353582),(.D15,437336168990962),(.D21,140401799637343912464858094),(.D21,4976888274256069299574),(.D21,1215060610878316630),(.D21,296644918519054),(.D21,72238466620),(.D17,2060254772),(.D15,595832944),(.D17,20769334),(.D15,35666800),(.D17,904438),(.D15,2130976),(.D17,1225123685),(.D17,1352),(.D8,8503)])]], + .ms [(.m2,.s6,91197892454252543),(.m7,.s5,91197892454252537)], + .m .m5, + .b 91197892454252543 [[([62487444829765629],[(.D8,42643458971664332),(.D16,63015210411098122),(.D6,89218771524255288),(.D16,55026158923677808),(.D6,5153960755199542),(.D16,3333581816463472),(.D6,295734268132918),(.D16,201751793762416),(.D6,16834124316214),(.D16,12197170249840),(.D6,3210702332353582),(.D16,437336168990962),(.D18,140401799637343912464858094),(.D18,4976888274256069299574),(.D18,1215060610878316630),(.D18,296644918519054),(.D18,72238466620),(.D6,2060254772),(.D16,595832944),(.D6,20769334),(.D16,35666800),(.D6,904438),(.D16,2130976),(.D6,1225123685),(.D6,1353),(.D9,8503),(.D14,72),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,122441614869135358,34832528367943630),(.m0,61062477760167946,88730588361522744),(.m0,54904113132994672,5123449307528758),(.m0,3325953954545776,293827302653494),(.m0,201275052392560,16714938973750),(.m0,12167373914224,3210694883269678)], + .ms [(.m0,.s6,437334306719986),(.m0,.s6,140401799637343911999290350),(.m0,.s6,4976888274255952907638),(.m0,.s6,1215060610849218646),(.m0,.s6,296644911244558)], + .ms2 .s6 .s7 [(.m0,72236647996,2059800116),(.m0,595719280,20740918),(.m0,35659696,902662),(.m0,2130532,1225123574)], + .ms [(.m12,.s7,1323),(.m0,.s6,8497),(.m3,.s6,71),(.m21,.s3,71),(.m4,.s3,8497),(.m4,.s3,1323)], + .ms2 .s3 .s0 [(.m13,1225123574,2130532),(.m1,902662,35659696),(.m1,20740918,595719280),(.m1,2059800116,72236647996)], + .ms [(.m16,.s3,296644911244558),(.m1,.s3,1215060610849218646),(.m1,.s3,4976888274255952907638),(.m1,.s3,140401799637343911999290350),(.m1,.s3,437334306719986)], + .ms2 .s3 .s0 [(.m4,3210694883269678,12167373914224),(.m1,16714938973750,201275052392560),(.m1,293827302653494,3325953954545776),(.m1,5123449307528758,54904113132994672),(.m1,88730588361522744,61062477760167946),(.m1,34832528367943630,122441614869135353)], + .ms [(.m26,.s7,122441614869135358),(.m8,.s2,122441614869135353)], + .m .m9, + .b 0 [[([249949779319062524],[(.D7,122441614869135358),(.D7,34832528367943629),(.D16,61062477760167946),(.D6,88730588361522744),(.D16,54904113132994672),(.D6,5123449307528758),(.D16,3325953954545776),(.D6,293827302653494),(.D16,201275052392560),(.D6,16714938973750),(.D16,12167373914224),(.D6,3210694883269678),(.D16,437334306719986),(.D18,140401799637343911999290350),(.D18,4976888274255952907638),(.D18,1215060610849218646),(.D18,296644911244558),(.D18,72236647996),(.D6,2059800116),(.D16,595719280),(.D6,20740918),(.D16,35659696),(.D6,902662),(.D16,2130532),(.D6,1225123574),(.D12,1323),(.D16,8497),(.D16,71),(.D12,3)])]], + .ms [(.m2,.s6,124974889659531262)], + .ms2 .s6 .s7 [(.m3,91197892454252542,27021597764222926),(.m0,59109745109237770,88242405198790200),(.m0,54782067342311536,5092937859857974),(.m0,3318326092628080,291920337174070),(.m0,200798311022704,16595753631286),(.m0,12137577578608,3210687434185774)], + .ms [(.m0,.s6,437332444449010),(.m0,.s6,140401799637343911533722606),(.m0,.s6,4976888274255836515702),(.m0,.s6,1215060610820120662),(.m0,.s6,296644903970062)], + .ms2 .s6 .s7 [(.m0,72234829372,2059345460),(.m0,595605616,20712502),(.m0,35652592,900886),(.m0,2130088,1225123463)], + .ms [(.m3,.s6,1297)], + .ms2 .s6 .s7 [(.m6,8489,70)], + .ms2 .s3 .s0 [(.m19,70,8489)], + .ms [(.m17,.s0,1297)], + .ms2 .s3 .s0 [(.m4,1225123463,2130088),(.m1,900886,35652592),(.m1,20712502,595605616),(.m1,2059345460,72234829372)], + .ms [(.m16,.s3,296644903970062),(.m1,.s3,1215060610820120662),(.m1,.s3,4976888274255836515702),(.m1,.s3,140401799637343911533722606),(.m1,.s3,437332444449010)], + .ms2 .s3 .s0 [(.m4,3210687434185774,12137577578608),(.m1,16595753631286,200798311022704),(.m1,291920337174070,3318326092628080),(.m1,5092937859857974,54782067342311536),(.m1,88242405198790200,59109745109237770),(.m1,27021597764222926,91197892454252542)], + .ms [(.m1,.s3,124974889659531256),(.m10,.s7,124974889659531262),(.m8,.s2,124974889659531257)], + .m .m9, + .b 0 [[([499899558638125046,229683580995895302],[(.D7,124974889659531262),(.D17,91197892454252542)]),([45598946227126271],[(.D6,27021597764222926),(.D16,59109745109237770),(.D6,88242405198790200),(.D16,54782067342311536),(.D6,5092937859857974),(.D16,3318326092628080),(.D6,291920337174070),(.D16,200798311022704),(.D6,16595753631286),(.D16,12137577578608),(.D6,3210687434185774),(.D16,437332444449010),(.D18,140401799637343911533722606),(.D18,4976888274255836515702),(.D18,1215060610820120662),(.D18,296644903970062),(.D18,72234829372),(.D6,2059345460),(.D16,595605616),(.D6,20712502),(.D16,35652592),(.D6,900886),(.D16,2130088),(.D6,1225123463),(.D6,1297),(.D12,8489),(.D6,70),(.D16,4)])]], + .ms [(.m2,.s6,364791569817010174),(.m3,.s6,33776997205278718)], + .ms2 .s6 .s7 [(.m3,68398419340689406,21321729485832142),(.m0,57684778039640074,87886163431390776),(.m0,54693006900461680,5070672749395510),(.m0,3312759815012464,290528767770166),(.m0,200450418671728,16508780543542),(.m0,12115834306672,3210681998367790)], + .ms [(.m0,.s6,437331085494514),(.m0,.s6,140401799637343911193983982),(.m0,.s6,4976888274255751581046),(.m0,.s6,1215060610798886998),(.m0,.s6,296644898661646)], + .ms2 .s6 .s7 [(.m0,72233502268,2059013684),(.m0,595522672,20691766),(.m0,35647408,899590),(.m0,2129764,1225123382)], + .ms [(.m12,.s7,1275),(.m0,.s6,8485),(.m3,.s6,68),(.m20,.s0,68),(.m1,.s3,8485),(.m4,.s3,1275)], + .ms2 .s3 .s0 [(.m13,1225123382,2129764),(.m1,899590,35647408),(.m1,20691766,595522672),(.m1,2059013684,72233502268)], + .ms [(.m16,.s3,296644898661646),(.m1,.s3,1215060610798886998),(.m1,.s3,4976888274255751581046),(.m1,.s3,140401799637343911193983982),(.m1,.s3,437331085494514)], + .ms2 .s3 .s0 [(.m4,3210681998367790,12115834306672),(.m1,16508780543542,200450418671728),(.m1,290528767770166,3312759815012464),(.m1,5070672749395510,54693006900461680),(.m1,87886163431390776,57684778039640074),(.m1,21321729485832142,68398419340689406)], + .ms [(.m1,.s3,33776997205278718),(.m4,.s3,364791569817010168),(.m10,.s7,364791569817010174),(.m8,.s2,364791569817010169)], + .m .m9, + .b 0 [[([1080863910568918964],[(.D7,364791569817010174)]), + ([135107988821114870,67553994410557439,33776997205278720,16888498602639360,8444249301319680,4222124650659840,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,33776997205278718), + (.D16,68398419340689406)]), + ([16888498602639358],[(.D6,21321729485832142), + (.D16,57684778039640074), + (.D6,87886163431390776), + (.D16,54693006900461680), + (.D6,5070672749395510), + (.D16,3312759815012464), + (.D6,290528767770166), + (.D16,200450418671728), + (.D6,16508780543542), + (.D16,12115834306672), + (.D6,3210681998367790), + (.D16,437331085494514), + (.D18,140401799637343911193983982), + (.D18,4976888274255751581046), + (.D18,1215060610798886998), + (.D18,296644898661646), + (.D18,72233502268), + (.D6,2059013684), + (.D16,595522672), + (.D6,20691766), + (.D16,35647408), + (.D6,899590), + (.D16,2129764), + (.D6,1225123382), + (.D12,1275), + (.D16,8485), + (.D16,68), + (.D6,5)])]], + .ms [(.m2,.s6,540431955284459482),(.m3,.s6,229683580995895303),(.m14,.s5,229683580995895303),(.m4,.s5,540431955284459476)], + .m .m5, + .b 540431955284459482 [[([23],[(.D16,229683580995895303),(.D18,1),(.D15,59954170039369725),(.D16,19210667160502222)])]], + .ms [(.m2,.s6,540431955284459494),(.m3,.s6,229683580995895300),(.m7,.s5,229683580995895300),(.m4,.s5,540431955284459488)], + .m .m5, + .b 540431955284459494 [[([7],[(.D16,229683580995895300),(.D6,1)])]], + .ms [(.m2,.s6,540431955284459498),(.m6,.s6,229683580995895298),(.m15,.s5,229683580995895298),(.m11,.s5,540431955284459492)], + .m .m5, + .b 540431955284459498 [[([5],[(.D12,229683580995895298),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,540431955284459501,229683580995895299)], + .ms [(.m23,.s1,229683580995895299),(.m22,.s4,540431955284459495)], + .m .m24, + .b 540431955284459501 [[([17],[(.D6,229683580995895299),(.D6,2)])]], + .ms [(.m2,.s6,540431955284459510),(.m6,.s6,229683580995895295),(.m14,.s5,229683580995895295),(.m11,.s5,540431955284459504)], + .m .m5, + .b 540431955284459510 [[([23],[(.D12,229683580995895295),(.D18,1),(.D17,59954170039369724),(.D17,19210667160502222),(.D15,57157012458307594),(.D17,87754222036057656),(.D15,54660021551628400),(.D17,5062426412187190),(.D15,3310698230710384),(.D17,290013371694646),(.D15,200321569652848),(.D17,16476568288822),(.D15,12107781242992),(.D17,3210679985101870),(.D15,437330582178034),(.D21,140401799637343911068154862),(.D21,4976888274255720123766),(.D21,1215060610791022678),(.D21,296644896695566),(.D21,72233010748),(.D17,2058890804),(.D15,595491952),(.D17,20684086),(.D15,35645488),(.D17,899110),(.D15,2129644),(.D17,1225123352),(.D11,1267),(.D6,8484)])]], + .ms [(.m2,.s6,540431955284459522),(.m6,.s6,229683580995895292),(.m7,.s5,229683580995895292),(.m11,.s5,540431955284459516)], + .m .m5, + .b 540431955284459522 [[([918734323983581169,459367161991790589,81064793292668937],[(.D12,229683580995895292),(.D8,59954170039369724),(.D6,19210667160502222),(.D16,57157012458307594)]),([5699868278390783],[(.D6,87754222036057656),(.D16,54660021551628400),(.D6,5062426412187190),(.D16,3310698230710384),(.D6,290013371694646),(.D16,200321569652848),(.D6,16476568288822),(.D16,12107781242992),(.D6,3210679985101870),(.D16,437330582178034),(.D18,140401799637343911068154862),(.D18,4976888274255720123766),(.D18,1215060610791022678),(.D18,296644896695566),(.D18,72233010748),(.D6,2058890804),(.D16,595491952),(.D6,20684086),(.D16,35645488),(.D6,899110),(.D16,2129644),(.D6,1225123352),(.D12,1268),(.D7,8483),(.D8,67),(.D7,4)])]], + .ms [(.m2,.s6,1270015094918479870)], + .ms2 .s6 .s7 [(.m3,47287796087390206,14355223812243454)], + .ms [(.m3,.s6,7810930603720654)], + .ms2 .s6 .s7 [(.m3,54307078319112202,87041738501258808),(.m0,54481900667928688,5017896191262262),(.m0,3299565675479152,287230232886838),(.m0,199625784950896,16302622113334),(.m0,12064294699120,3210669113465902)], + .ms [(.m0,.s6,437327864269042),(.m0,.s6,140401799637343910388677614),(.m0,.s6,4976888274255550254454),(.m0,.s6,1215060610748555350),(.m0,.s6,296644886078734)], + .ms2 .s6 .s7 [(.m0,72230356540,2058227252),(.m0,595326064,20642614),(.m0,35635120,896518),(.m0,2128996,1225123190)], + .ms [(.m12,.s7,1227),(.m0,.s6,8473),(.m3,.s6,65),(.m21,.s3,65),(.m4,.s3,8473),(.m4,.s3,1227)], + .ms2 .s3 .s0 [(.m13,1225123190,2128996),(.m1,896518,35635120),(.m1,20642614,595326064),(.m1,2058227252,72230356540)], + .ms [(.m16,.s3,296644886078734),(.m1,.s3,1215060610748555350),(.m1,.s3,4976888274255550254454),(.m1,.s3,140401799637343910388677614),(.m1,.s3,437327864269042)], + .ms2 .s3 .s0 [(.m4,3210669113465902,12064294699120),(.m1,16302622113334,199625784950896),(.m1,287230232886838,3299565675479152),(.m1,5017896191262262,54481900667928688),(.m1,87041738501258808,54307078319112202),(.m1,7810930603720654,14355223812243454)], + .ms [(.m4,.s3,47287796087390206),(.m4,.s3,1270015094918479864),(.m10,.s7,1270015094918479870),(.m8,.s2,1270015094918479865)], + .m .m9, + .b 0 [[([1513209474796486580],[(.D7,1270015094918479870)]), + ([189151184349560822,94575592174780415,47287796087390208,23643898043695104,11821949021847552,5910974510923776,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,47287796087390206), + (.D6,14355223812243454), + (.D6,7810930603720654)]), + ([5910974510923775],[(.D16,54307078319112202), + (.D6,87041738501258808), + (.D16,54481900667928688), + (.D6,5017896191262262), + (.D16,3299565675479152), + (.D6,287230232886838), + (.D16,199625784950896), + (.D6,16302622113334), + (.D16,12064294699120), + (.D6,3210669113465902), + (.D16,437327864269042), + (.D18,140401799637343910388677614), + (.D18,4976888274255550254454), + (.D18,1215060610748555350), + (.D18,296644886078734), + (.D18,72230356540), + (.D6,2058227252), + (.D16,595326064), + (.D6,20642614), + (.D16,35635120), + (.D6,896518), + (.D16,2128996), + (.D6,1225123190), + (.D12,1227), + (.D16,8473), + (.D16,65), + (.D12,3)])], + [([8],[(.D15,1080863910568919047), + (.D21,0), + (.D19,2533274790395901)])]], + .ms [(.m2,.s6,756604737398243294),(.m6,.s6,1080863910568919045),(.m7,.s5,1080863910568919045),(.m11,.s5,756604737398243288)], + .m .m5, + .b 756604737398243294 [[([41],[(.D12,1080863910568919045),(.D8,1),(.D7,2533274790395900)])],[([60798594969501574],[(.D17,1080863910568919041),(.D2,2533274790395898)])]], + .ms [(.m2,.s6,787004034882994102),(.m3,.s6,1073264086197731344),(.m27,.s2,1073264086197731344),(.m1,.s5,787004034882994096)], + .m .m5, + .b 787004034882994102 [[([7],[(.D16,1073264086197731344), + (.D6,1)])], + [([16],[(.D11,1073264086197731342), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,1073264086197731341), + (.D17,1), + (.D15,0), + (.D6,4855443348258766)])], + [([16],[(.D11,1073264086197731339), + (.D3,0)])], + [([8],[(.D15,1073264086197731338), + (.D17,1), + (.D21,4855443348258765), + (.D15,53568206505246730), + (.D17,86857020547792440), + (.D15,54435721179562096), + (.D17,5006351319170614), + (.D15,3296679457456240), + (.D17,286508678381110), + (.D15,199445396324464), + (.D17,16257524956726), + (.D15,12053020409968), + (.D17,3210666294893614), + (.D15,437327159625970), + (.D21,140401799637343910212516846), + (.D21,4976888274255506214262), + (.D21,1215060610737545302), + (.D21,296644883326222), + (.D21,72229668412), + (.D17,2058055220), + (.D15,595283056), + (.D17,20631862), + (.D15,35632432), + (.D17,895846), + (.D15,2128828), + (.D17,1225123148), + (.D11,1216), + (.D12,8470)])], + [([18],[(.D11,1073264086197731336), + (.D13,0), + (.D16,4855443348258765), + (.D16,53568206505246730)])], + [([155374187144280516],[(.D17,1073264086197731335)]), + ([19421773393035067,9710886696517535,4855443348258768,2427721674129384,1213860837064692,606930418532343,303465209266173,151732604633088,75866302316544,37933151158272,18966575579136,9483287789568,4741643894784,2370821947392,1185410973696,592705486848,296352743424,148176371712,74088185856,37044092928,18522046464,9261023232,4630511616,2315255808,1157627904,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,4855443348258766), + (.D17,53568206505246730)]), + ([2427721674129383],[(.D6,86857020547792440), + (.D16,54435721179562096), + (.D6,5006351319170614), + (.D16,3296679457456240), + (.D6,286508678381110), + (.D16,199445396324464), + (.D6,16257524956726), + (.D16,12053020409968), + (.D6,3210666294893614), + (.D16,437327159625970), + (.D18,140401799637343910212516846), + (.D18,4976888274255506214262), + (.D18,1215060610737545302), + (.D18,296644883326222), + (.D18,72229668412), + (.D6,2058055220), + (.D16,595283056), + (.D6,20631862), + (.D16,35632432), + (.D6,895846), + (.D16,2128828), + (.D6,1225123148), + (.D12,1217), + (.D13,8470), + (.D9,64), + (.D13,3)])], + [([10],[(.D17,1053842312804696271), + (.D21,0), + (.D19,52354345668182038)])]], + .ms [(.m2,.s6,864691128455134402),(.m3,.s6,1053842312804696269),(.m7,.s5,1053842312804696269),(.m4,.s5,864691128455134396)], + .m .m5, + .b 864691128455134402 [[([43],[(.D16,1053842312804696269),(.D8,1),(.D7,52354345668182037)])],[([1256504296036368858],[(.D11,1053842312804696262),(.D2,52354345668182035)])]], + .ms2 .s6 .s7 [(.m2,1492943276473318853,896779275800150157)], + .ms [(.m29,.s2,896779275800150157),(.m4,.s5,1492943276473318847)], + .m .m5, + .b 1492943276473318853 [[([9],[(.D6,896779275800150157),(.D6,1)])],[([20],[(.D15,896779275800150155),(.D13,0),(.D10,86553555338526266),(.D9,54359854877245552)])],[([36],[(.D11,896779275800150151)]),([7,2],[(.D12,1),(.D6,86553555338526266)])]], + .ms [(.m2,.s6,1492943276473318886),(.m6,.s6,896779275800150147),(.m15,.s5,896779275800150147),(.m11,.s5,1492943276473318880)], + .m .m5, + .b 1492943276473318886 [[([5],[(.D12,896779275800150147),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,1492943276473318889,896779275800150148)], + .ms [(.m23,.s1,896779275800150148),(.m22,.s4,1492943276473318883)], + .m .m24, + .b 1492943276473318889 [[([17],[(.D6,896779275800150148),(.D6,2)])],[([6],[(.D11,896779275800150144),(.D21,0),(.D7,86553555338526264)])]], + .ms2 .s6 .s7 [(.m2,1492943276473318901,896779275800150145)], + .ms2 .s5 .s2 [(.m28,896779275800150145,1492943276473318896)], + .m .m18, + .b 1492943276473318901 [[([45],[(.D6,896779275800150145),(.D8,1),(.D17,86553555338526263),(.D10,54359854877245551)])],[([36],[(.D15,896779275800150138)]),([7,2],[(.D12,1),(.D17,86553555338526262)]),([1],[(.D11,54359854877245551),(.D16,4987384743591478)])],[([8],[(.D15,896779275800150134),(.D21,0),(.D17,86553555338526261),(.D12,54359854877245552)])]], + .ms [(.m2,.s6,1492943276473318946),(.m6,.s6,896779275800150132),(.m7,.s5,896779275800150132),(.m11,.s5,1492943276473318940)], + .m .m5, + .b 1492943276473318946 [[([39],[(.D12,896779275800150132),(.D8,86553555338526262),(.D13,54359854877245552),(.D17,4987384743591478),(.D15,3291937813561456),(.D17,285323267407414),(.D15,199149043581040),(.D17,16183436770870),(.D15,12034498363504),(.D17,3210661664381998),(.D15,437326001998066),(.D21,140401799637343909923109870),(.D21,4976888274255433862518),(.D21,1215060610719457366),(.D21,296644878804238),(.D21,72228537916),(.D17,2057772596),(.D15,595212400),(.D17,20614198),(.D15,35628016),(.D17,894742),(.D15,2128552),(.D17,1225123079),(.D17,1201),(.D11,8465),(.D17,64),(.D15,3)])]], + .ms [(.m2,.s6,1492943276473318966)], + .ms2 .s6 .s7 [(.m3,896779275800150128,86553555338526262),(.m0,54359854877245552,4987384743591478),(.m0,3291937813561456,285323267407414),(.m0,199149043581040,16183436770870),(.m0,12034498363504,3210661664381998)], + .ms [(.m0,.s6,437326001998066),(.m0,.s6,140401799637343909923109870),(.m0,.s6,4976888274255433862518),(.m0,.s6,1215060610719457366),(.m0,.s6,296644878804238)], + .ms2 .s6 .s7 [(.m0,72228537916,2057772596),(.m0,595212400,20614198),(.m0,35628016,894742),(.m0,2128552,1225123079)], + .ms [(.m3,.s6,1201)], + .ms2 .s6 .s7 [(.m6,8465,64)], + .ms2 .s3 .s0 [(.m19,64,8465)], + .ms [(.m17,.s0,1201)], + .ms2 .s3 .s0 [(.m4,1225123079,2128552),(.m1,894742,35628016),(.m1,20614198,595212400),(.m1,2057772596,72228537916)], + .ms [(.m16,.s3,296644878804238),(.m1,.s3,1215060610719457366),(.m1,.s3,4976888274255433862518),(.m1,.s3,140401799637343909923109870),(.m1,.s3,437326001998066)], + .ms2 .s3 .s0 [(.m4,3210661664381998,12034498363504),(.m1,16183436770870,199149043581040),(.m1,285323267407414,3291937813561456),(.m1,4987384743591478,54359854877245552),(.m1,86553555338526262,896779275800150128)], + .ms [(.m1,.s3,1492943276473318960),(.m10,.s7,1492943276473318966),(.m8,.s2,1492943276473318961)], + .m .m9, + .b 0 [[([45598946227126268],[(.D7,1492943276473318966),(.D17,896779275800150128),(.D6,86553555338526262),(.D16,54359854877245552),(.D6,4987384743591478),(.D16,3291937813561456),(.D6,285323267407414),(.D16,199149043581040),(.D6,16183436770870),(.D16,12034498363504),(.D6,3210661664381998),(.D16,437326001998066),(.D18,140401799637343909923109870),(.D18,4976888274255433862518),(.D18,1215060610719457366),(.D18,296644878804238),(.D18,72228537916),(.D6,2057772596),(.D16,595212400),(.D6,20614198),(.D16,35628016),(.D6,894742),(.D16,2128552),(.D6,1225123079),(.D6,1201),(.D12,8465),(.D6,64),(.D16,4)])]], + .ms [(.m2,.s6,22799473113563134),(.m3,.s6,1487243408194928182)], + .ms2 .s6 .s7 [(.m3,895354308730552432,86197313571126838),(.m0,54270794435395696,4965119633129014),(.m0,3286371535945840,283931698003510),(.m0,198801151230064,16096463683126),(.m0,12012755091568,3210656228564014)], + .ms [(.m0,.s6,437324643043570),(.m0,.s6,140401799637343909583371246),(.m0,.s6,4976888274255348927862),(.m0,.s6,1215060610698223702),(.m0,.s6,296644873495822)], + .ms2 .s6 .s7 [(.m0,72227210812,2057440820),(.m0,595129456,20593462),(.m0,35622832,893446),(.m0,2128228,1225122998)], + .ms [(.m12,.s7,1179),(.m0,.s6,8461),(.m3,.s6,62),(.m20,.s0,62),(.m1,.s3,8461),(.m4,.s3,1179)], + .ms2 .s3 .s0 [(.m13,1225122998,2128228),(.m1,893446,35622832),(.m1,20593462,595129456),(.m1,2057440820,72227210812)], + .ms [(.m16,.s3,296644873495822),(.m1,.s3,1215060610698223702),(.m1,.s3,4976888274255348927862),(.m1,.s3,140401799637343909583371246),(.m1,.s3,437324643043570)], + .ms2 .s3 .s0 [(.m4,3210656228564014,12012755091568),(.m1,16096463683126,198801151230064),(.m1,283931698003510,3286371535945840),(.m1,4965119633129014,54270794435395696),(.m1,86197313571126838,895354308730552432)], + .ms [(.m1,.s3,1487243408194928182),(.m4,.s3,22799473113563128),(.m10,.s7,22799473113563134),(.m8,.s2,22799473113563129)], + .m .m9, + .b 0 [[([91197892454252534,45598946227126269,22799473113563136,11399736556781568,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,22799473113563134), + (.D17,1487243408194928182)]), + ([11399736556781566],[(.D16,895354308730552432), + (.D6,86197313571126838), + (.D16,54270794435395696), + (.D6,4965119633129014), + (.D16,3286371535945840), + (.D6,283931698003510), + (.D16,198801151230064), + (.D6,16096463683126), + (.D16,12012755091568), + (.D6,3210656228564014), + (.D16,437324643043570), + (.D18,140401799637343909583371246), + (.D18,4976888274255348927862), + (.D18,1215060610698223702), + (.D18,296644873495822), + (.D18,72227210812), + (.D6,2057440820), + (.D16,595129456), + (.D6,20593462), + (.D16,35622832), + (.D6,893446), + (.D16,2128228), + (.D6,1225122998), + (.D12,1179), + (.D16,8461), + (.D16,62), + (.D6,5)])]], + .ms [(.m2,.s6,91197892454252533),(.m14,.s5,91197892454252527)], + .m .m5, + .b 91197892454252533 [[([5],[(.D18,1),(.D15,1481543539916537397),(.D14,893929341660954736)])]], + .ms [(.m2,.s6,91197892454252536),(.m7,.s5,91197892454252530)], + .m .m5, + .b 91197892454252536 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,91197892454252537),(.m15,.s5,91197892454252531)], + .m .m5, + .b 91197892454252537 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,91197892454252538),(.m25,.s2,91197892454252533)], + .m .m18, + .b 91197892454252538 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,91197892454252540),(.m14,.s5,91197892454252534)], + .m .m5, + .b 91197892454252540 [[([5],[(.D18,1),(.D17,1481543539916537396),(.D15,893929341660954736),(.D17,85841071803727414),(.D15,54181733993545840),(.D17,4942854522666550),(.D15,3280805258330224),(.D17,282540128599606),(.D15,198453258879088),(.D17,16009490595382),(.D15,11991011819632),(.D17,3210650792746030),(.D15,437323284089074),(.D21,140401799637343909243632622),(.D21,4976888274255263993206),(.D21,1215060610676990038),(.D21,296644868187406),(.D21,72225883708),(.D17,2057109044),(.D15,595046512),(.D17,20572726),(.D15,35617648),(.D17,892150),(.D15,2127904),(.D17,1225122917),(.D17,1160),(.D8,8455)])]], + .ms [(.m2,.s6,91197892454252543),(.m7,.s5,91197892454252537)], + .m .m5, + .b 91197892454252543 [[([62487444829765629],[(.D8,1481543539916537396),(.D16,893929341660954736),(.D6,85841071803727414),(.D16,54181733993545840),(.D6,4942854522666550),(.D16,3280805258330224),(.D6,282540128599606),(.D16,198453258879088),(.D6,16009490595382),(.D16,11991011819632),(.D6,3210650792746030),(.D16,437323284089074),(.D18,140401799637343909243632622),(.D18,4976888274255263993206),(.D18,1215060610676990038),(.D18,296644868187406),(.D18,72225883708),(.D6,2057109044),(.D16,595046512),(.D6,20572726),(.D16,35617648),(.D6,892150),(.D16,2127904),(.D6,1225122917),(.D6,1161),(.D9,8455),(.D14,60),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,122441614869135358,1473732609312816694),(.m0,891976609010024560,85352888640994870),(.m0,54059688202862704,4912343074995766),(.m0,3273177396412528,280633163120182),(.m0,197976517509232,15890305252918),(.m0,11961215484016,3210643343662126)], + .ms [(.m0,.s6,437321421818098),(.m0,.s6,140401799637343908778064878),(.m0,.s6,4976888274255147601270),(.m0,.s6,1215060610647892054),(.m0,.s6,296644860912910)], + .ms2 .s6 .s7 [(.m0,72224065084,2056654388),(.m0,594932848,20544310),(.m0,35610544,890374),(.m0,2127460,1225122806)], + .ms [(.m12,.s7,1131),(.m0,.s6,8449),(.m3,.s6,59),(.m21,.s3,59),(.m4,.s3,8449),(.m4,.s3,1131)], + .ms2 .s3 .s0 [(.m13,1225122806,2127460),(.m1,890374,35610544),(.m1,20544310,594932848),(.m1,2056654388,72224065084)], + .ms [(.m16,.s3,296644860912910),(.m1,.s3,1215060610647892054),(.m1,.s3,4976888274255147601270),(.m1,.s3,140401799637343908778064878),(.m1,.s3,437321421818098)], + .ms2 .s3 .s0 [(.m4,3210643343662126,11961215484016),(.m1,15890305252918,197976517509232),(.m1,280633163120182,3273177396412528),(.m1,4912343074995766,54059688202862704),(.m1,85352888640994870,891976609010024560),(.m1,1473732609312816694,122441614869135353)], + .ms [(.m26,.s7,122441614869135358),(.m8,.s2,122441614869135353)], + .m .m9, + .b 0 [[([249949779319062524],[(.D7,122441614869135358),(.D7,1473732609312816693),(.D16,891976609010024560),(.D6,85352888640994870),(.D16,54059688202862704),(.D6,4912343074995766),(.D16,3273177396412528),(.D6,280633163120182),(.D16,197976517509232),(.D6,15890305252918),(.D16,11961215484016),(.D6,3210643343662126),(.D16,437321421818098),(.D18,140401799637343908778064878),(.D18,4976888274255147601270),(.D18,1215060610647892054),(.D18,296644860912910),(.D18,72224065084),(.D6,2056654388),(.D16,594932848),(.D6,20544310),(.D16,35610544),(.D6,890374),(.D16,2127460),(.D6,1225122806),(.D12,1131),(.D16,8449),(.D16,59),(.D12,3)])]], + .ms [(.m2,.s6,124974889659531262)], + .ms2 .s6 .s7 [(.m3,91197892454252542,1465921678709095990),(.m0,890023876359094384,84864705478262326),(.m0,53937642412179568,4881831627324982),(.m0,3265549534494832,278726197640758),(.m0,197499776139376,15771119910454),(.m0,11931419148400,3210635894578222)], + .ms [(.m0,.s6,437319559547122),(.m0,.s6,140401799637343908312497134),(.m0,.s6,4976888274255031209334),(.m0,.s6,1215060610618794070),(.m0,.s6,296644853638414)], + .ms2 .s6 .s7 [(.m0,72222246460,2056199732),(.m0,594819184,20515894),(.m0,35603440,888598),(.m0,2127016,1225122695)], + .ms [(.m3,.s6,1105)], + .ms2 .s6 .s7 [(.m6,8441,58)], + .ms2 .s3 .s0 [(.m19,58,8441)], + .ms [(.m17,.s0,1105)], + .ms2 .s3 .s0 [(.m4,1225122695,2127016),(.m1,888598,35603440),(.m1,20515894,594819184),(.m1,2056199732,72222246460)], + .ms [(.m16,.s3,296644853638414),(.m1,.s3,1215060610618794070),(.m1,.s3,4976888274255031209334),(.m1,.s3,140401799637343908312497134),(.m1,.s3,437319559547122)], + .ms2 .s3 .s0 [(.m4,3210635894578222,11931419148400),(.m1,15771119910454,197499776139376),(.m1,278726197640758,3265549534494832),(.m1,4881831627324982,53937642412179568),(.m1,84864705478262326,890023876359094384),(.m1,1465921678709095990,91197892454252542)], + .ms [(.m1,.s3,124974889659531256)], + .m .m10, + ] (by decide +kernel) +theorem chunk_42_step : (cfg_42.denote) [qi]⊢* (cfg_43.denote) := + step_chunk [ + .s .s7 124974889659531262, + .ms [(.m8,.s2,124974889659531257)], + .m .m9, + .b 0 [[([499899558638125046,229683580995895302],[(.D7,124974889659531262),(.D17,91197892454252542)]),([45598946227126271],[(.D6,1465921678709095990),(.D16,890023876359094384),(.D6,84864705478262326),(.D16,53937642412179568),(.D6,4881831627324982),(.D16,3265549534494832),(.D6,278726197640758),(.D16,197499776139376),(.D6,15771119910454),(.D16,11931419148400),(.D6,3210635894578222),(.D16,437319559547122),(.D18,140401799637343908312497134),(.D18,4976888274255031209334),(.D18,1215060610618794070),(.D18,296644853638414),(.D18,72222246460),(.D6,2056199732),(.D16,594819184),(.D6,20515894),(.D16,35603440),(.D6,888598),(.D16,2127016),(.D6,1225122695),(.D6,1105),(.D12,8441),(.D6,58),(.D16,4)])]], + .ms [(.m2,.s6,364791569817010174),(.m3,.s6,33776997205278718)], + .ms2 .s6 .s7 [(.m3,68398419340689406,1460221810430705206),(.m0,888598909289496688,84508463710862902),(.m0,53848581970329712,4859566516862518),(.m0,3259983256879216,277334628236854),(.m0,197151883788400,15684146822710),(.m0,11909675876464,3210630458760238)], + .ms [(.m0,.s6,437318200592626),(.m0,.s6,140401799637343907972758510),(.m0,.s6,4976888274254946274678),(.m0,.s6,1215060610597560406),(.m0,.s6,296644848329998)], + .ms2 .s6 .s7 [(.m0,72220919356,2055867956),(.m0,594736240,20495158),(.m0,35598256,887302),(.m0,2126692,1225122614)], + .ms [(.m12,.s7,1083),(.m0,.s6,8437),(.m3,.s6,56),(.m20,.s0,56),(.m1,.s3,8437),(.m4,.s3,1083)], + .ms2 .s3 .s0 [(.m13,1225122614,2126692),(.m1,887302,35598256),(.m1,20495158,594736240),(.m1,2055867956,72220919356)], + .ms [(.m16,.s3,296644848329998),(.m1,.s3,1215060610597560406),(.m1,.s3,4976888274254946274678),(.m1,.s3,140401799637343907972758510),(.m1,.s3,437318200592626)], + .ms2 .s3 .s0 [(.m4,3210630458760238,11909675876464),(.m1,15684146822710,197151883788400),(.m1,277334628236854,3259983256879216),(.m1,4859566516862518,53848581970329712),(.m1,84508463710862902,888598909289496688),(.m1,1460221810430705206,68398419340689406)], + .ms [(.m1,.s3,33776997205278718),(.m4,.s3,364791569817010168),(.m10,.s7,364791569817010174),(.m8,.s2,364791569817010169)], + .m .m9, + .b 0 [[([1080863910568918964],[(.D7,364791569817010174)]), + ([135107988821114870,67553994410557439,33776997205278720,16888498602639360,8444249301319680,4222124650659840,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,33776997205278718), + (.D16,68398419340689406)]), + ([16888498602639358],[(.D6,1460221810430705206), + (.D16,888598909289496688), + (.D6,84508463710862902), + (.D16,53848581970329712), + (.D6,4859566516862518), + (.D16,3259983256879216), + (.D6,277334628236854), + (.D16,197151883788400), + (.D6,15684146822710), + (.D16,11909675876464), + (.D6,3210630458760238), + (.D16,437318200592626), + (.D18,140401799637343907972758510), + (.D18,4976888274254946274678), + (.D18,1215060610597560406), + (.D18,296644848329998), + (.D18,72220919356), + (.D6,2055867956), + (.D16,594736240), + (.D6,20495158), + (.D16,35598256), + (.D6,887302), + (.D16,2126692), + (.D6,1225122614), + (.D12,1083), + (.D16,8437), + (.D16,56), + (.D6,5)])]], + .ms [(.m2,.s6,540431955284459482),(.m3,.s6,229683580995895303),(.m14,.s5,229683580995895303),(.m4,.s5,540431955284459476)], + .m .m5, + .b 540431955284459482 [[([23],[(.D16,229683580995895303),(.D18,1),(.D15,59954170039369725),(.D16,1458110748105375286)])]], + .ms [(.m2,.s6,540431955284459494),(.m3,.s6,229683580995895300),(.m7,.s5,229683580995895300),(.m4,.s5,540431955284459488)], + .m .m5, + .b 540431955284459494 [[([7],[(.D16,229683580995895300),(.D6,1)])]], + .ms [(.m2,.s6,540431955284459498),(.m6,.s6,229683580995895298),(.m15,.s5,229683580995895298),(.m11,.s5,540431955284459492)], + .m .m5, + .b 540431955284459498 [[([5],[(.D12,229683580995895298),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,540431955284459501,229683580995895299)], + .ms [(.m23,.s1,229683580995895299),(.m22,.s4,540431955284459495)], + .m .m24, + .b 540431955284459501 [[([17],[(.D6,229683580995895299),(.D6,2)])]], + .ms [(.m2,.s6,540431955284459510),(.m6,.s6,229683580995895295),(.m14,.s5,229683580995895295),(.m11,.s5,540431955284459504)], + .m .m5, + .b 540431955284459510 [[([23],[(.D12,229683580995895295),(.D18,1),(.D17,59954170039369724),(.D17,1458110748105375286),(.D15,888071143708164208),(.D17,84376522315529782),(.D15,53815596621496432),(.D17,4851320179654198),(.D15,3257921672577136),(.D17,276819232161334),(.D15,197023034769520),(.D17,15651934567990),(.D15,11901622812784),(.D17,3210628445494318),(.D15,437317697276146),(.D21,140401799637343907846929390),(.D21,4976888274254914817398),(.D21,1215060610589696086),(.D21,296644846363918),(.D21,72220427836),(.D17,2055745076),(.D15,594705520),(.D17,20487478),(.D15,35596336),(.D17,886822),(.D15,2126572),(.D17,1225122584),(.D11,1075),(.D6,8436)])]], + .ms [(.m2,.s6,540431955284459522),(.m6,.s6,229683580995895292),(.m7,.s5,229683580995895292),(.m11,.s5,540431955284459516)], + .m .m5, + .b 540431955284459522 [[([918734323983581169,459367161991790589,81064793292668937],[(.D12,229683580995895292),(.D8,59954170039369724),(.D6,1458110748105375286)]),([22799473113563135],[(.D16,888071143708164208),(.D6,84376522315529782),(.D16,53815596621496432),(.D6,4851320179654198),(.D16,3257921672577136),(.D6,276819232161334),(.D16,197023034769520),(.D6,15651934567990),(.D16,11901622812784),(.D6,3210628445494318),(.D16,437317697276146),(.D18,140401799637343907846929390),(.D18,4976888274254914817398),(.D18,1215060610589696086),(.D18,296644846363918),(.D18,72220427836),(.D6,2055745076),(.D16,594705520),(.D6,20487478),(.D16,35596336),(.D6,886822),(.D16,2126572),(.D6,1225122584),(.D12,1076),(.D7,8435),(.D8,55),(.D7,4)])]], + .ms [(.m2,.s6,1270015094918479870)], + .ms2 .s6 .s7 [(.m3,47287796087390206,14355223812243454)], + .ms [(.m3,.s6,1446711011548593718)], + .ms2 .s6 .s7 [(.m3,885221209568968816,83664038780730934),(.m0,53637475737796720,4806789958729270),(.m0,3246789117345904,274036093353526),(.m0,196327250067568,15477988392502),(.m0,11858136268912,3210617573858350)], + .ms [(.m0,.s6,437314979367154),(.m0,.s6,140401799637343907167452142),(.m0,.s6,4976888274254744948086),(.m0,.s6,1215060610547228758),(.m0,.s6,296644835747086)], + .ms2 .s6 .s7 [(.m0,72217773628,2055081524),(.m0,594539632,20446006),(.m0,35585968,884230),(.m0,2125924,1225122422)], + .ms [(.m12,.s7,1035),(.m0,.s6,8425),(.m3,.s6,53),(.m21,.s3,53),(.m4,.s3,8425),(.m4,.s3,1035)], + .ms2 .s3 .s0 [(.m13,1225122422,2125924),(.m1,884230,35585968),(.m1,20446006,594539632),(.m1,2055081524,72217773628)], + .ms [(.m16,.s3,296644835747086),(.m1,.s3,1215060610547228758),(.m1,.s3,4976888274254744948086),(.m1,.s3,140401799637343907167452142),(.m1,.s3,437314979367154)], + .ms2 .s3 .s0 [(.m4,3210617573858350,11858136268912),(.m1,15477988392502,196327250067568),(.m1,274036093353526,3246789117345904),(.m1,4806789958729270,53637475737796720),(.m1,83664038780730934,885221209568968816),(.m1,1446711011548593718,14355223812243454)], + .ms [(.m4,.s3,47287796087390206),(.m4,.s3,1270015094918479864),(.m10,.s7,1270015094918479870),(.m8,.s2,1270015094918479865)], + .m .m9, + .b 0 [[([1513209474796486580],[(.D7,1270015094918479870)]), + ([189151184349560822,94575592174780415,47287796087390208,23643898043695104,11821949021847552,5910974510923776,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,47287796087390206), + (.D6,14355223812243454), + (.D6,1446711011548593718)]), + ([5910974510923775],[(.D16,885221209568968816), + (.D6,83664038780730934), + (.D16,53637475737796720), + (.D6,4806789958729270), + (.D16,3246789117345904), + (.D6,274036093353526), + (.D16,196327250067568), + (.D6,15477988392502), + (.D16,11858136268912), + (.D6,3210617573858350), + (.D16,437314979367154), + (.D18,140401799637343907167452142), + (.D18,4976888274254744948086), + (.D18,1215060610547228758), + (.D18,296644835747086), + (.D18,72217773628), + (.D6,2055081524), + (.D16,594539632), + (.D6,20446006), + (.D16,35585968), + (.D6,884230), + (.D16,2125924), + (.D6,1225122422), + (.D12,1035), + (.D16,8425), + (.D16,53), + (.D12,3)])], + [([8],[(.D15,1080863910568919047), + (.D21,0), + (.D19,2533274790395901)])]], + .ms [(.m2,.s6,756604737398243294),(.m6,.s6,1080863910568919045),(.m7,.s5,1080863910568919045),(.m11,.s5,756604737398243288)], + .m .m5, + .b 756604737398243294 [[([41],[(.D12,1080863910568919045),(.D8,1),(.D7,2533274790395900)])],[([60798594969501574],[(.D17,1080863910568919041),(.D2,2533274790395898)])]], + .ms [(.m2,.s6,787004034882994102),(.m3,.s6,1073264086197731344),(.m27,.s2,1073264086197731344),(.m1,.s5,787004034882994096)], + .m .m5, + .b 787004034882994102 [[([7],[(.D16,1073264086197731344), + (.D6,1)])], + [([16],[(.D11,1073264086197731342), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,1073264086197731341), + (.D17,1), + (.D15,0), + (.D6,1443755524293131830)])], + [([16],[(.D11,1073264086197731339), + (.D3,0)])], + [([8],[(.D15,1073264086197731338), + (.D17,1), + (.D21,1443755524293131829), + (.D15,884482337755103344), + (.D17,83479320827264566), + (.D15,53591296249430128), + (.D17,4795245086637622), + (.D15,3243902899322992), + (.D17,273314538847798), + (.D15,196146861441136), + (.D17,15432891235894), + (.D15,11846861979760), + (.D17,3210614755286062), + (.D15,437314274724082), + (.D21,140401799637343906991291374), + (.D21,4976888274254700907894), + (.D21,1215060610536218710), + (.D21,296644832994574), + (.D21,72217085500), + (.D17,2054909492), + (.D15,594496624), + (.D17,20435254), + (.D15,35583280), + (.D17,883558), + (.D15,2125756), + (.D17,1225122380), + (.D11,1024), + (.D12,8422)])], + [([18],[(.D11,1073264086197731336), + (.D13,0), + (.D16,1443755524293131829), + (.D16,884482337755103344)])], + [([155374187144282086],[(.D17,1073264086197731335), + (.D12,1443755524293131830), + (.D17,884482337755103344), + (.D6,83479320827264566), + (.D16,53591296249430128), + (.D6,4795245086637622), + (.D16,3243902899322992), + (.D6,273314538847798), + (.D16,196146861441136), + (.D6,15432891235894), + (.D16,11846861979760), + (.D6,3210614755286062), + (.D16,437314274724082), + (.D18,140401799637343906991291374), + (.D18,4976888274254700907894), + (.D18,1215060610536218710), + (.D18,296644832994574), + (.D18,72217085500), + (.D6,2054909492), + (.D16,594496624), + (.D6,20435254), + (.D16,35583280), + (.D6,883558), + (.D16,2125756), + (.D6,1225122380), + (.D12,1025), + (.D13,8422), + (.D9,52), + (.D13,3)])]], + .ms [(.m2,.s6,864691128455135182)], + .ms2 .s6 .s7 [(.m3,1053842312804696074,1438900080944873016),(.m0,883268476918038640,83175855617998390),(.m0,53515429947113584,4776278511058486),(.m0,3239161255428208,272129127874102),(.m0,195850508697712,15358803050038),(.m0,11828339933296,3210610124774446)], + .ms [(.m0,.s6,437313117096178),(.m0,.s6,140401799637343906701884398),(.m0,.s6,4976888274254628556150),(.m0,.s6,1215060610518130774),(.m0,.s6,296644828472590)], + .ms2 .s6 .s7 [(.m0,72215955004,2054626868),(.m0,594425968,20417590),(.m0,35578864,882454),(.m0,2125480,1225122311)], + .ms [(.m3,.s6,1009)], + .ms2 .s6 .s7 [(.m6,8417,52)], + .ms2 .s3 .s0 [(.m19,52,8417)], + .ms [(.m17,.s0,1009)], + .ms2 .s3 .s0 [(.m4,1225122311,2125480),(.m1,882454,35578864),(.m1,20417590,594425968),(.m1,2054626868,72215955004)], + .ms [(.m16,.s3,296644828472590),(.m1,.s3,1215060610518130774),(.m1,.s3,4976888274254628556150),(.m1,.s3,140401799637343906701884398),(.m1,.s3,437313117096178)], + .ms2 .s3 .s0 [(.m4,3210610124774446,11828339933296),(.m1,15358803050038,195850508697712),(.m1,272129127874102,3239161255428208),(.m1,4776278511058486,53515429947113584),(.m1,83175855617998390,883268476918038640),(.m1,1438900080944873016,1053842312804696074)], + .ms [(.m1,.s3,864691128455135176),(.m10,.s7,864691128455135182),(.m8,.s2,864691128455135177)], + .m .m9, + .b 0 [[([729583139634020348],[(.D7,864691128455135182),(.D17,1053842312804696074),(.D6,1438900080944873016),(.D16,883268476918038640),(.D6,83175855617998390),(.D16,53515429947113584),(.D6,4776278511058486),(.D16,3239161255428208),(.D6,272129127874102),(.D16,195850508697712),(.D6,15358803050038),(.D16,11828339933296),(.D6,3210610124774446),(.D16,437313117096178),(.D18,140401799637343906701884398),(.D18,4976888274254628556150),(.D18,1215060610518130774),(.D18,296644828472590),(.D18,72215955004),(.D6,2054626868),(.D16,594425968),(.D6,20417590),(.D16,35578864),(.D6,882454),(.D16,2125480),(.D6,1225122311),(.D6,1009),(.D12,8417),(.D6,52),(.D16,4)])]], + .ms [(.m2,.s6,364791569817010174),(.m3,.s6,773493236000882638)], + .ms2 .s6 .s7 [(.m3,1031042839691132938,1433200212666482232),(.m0,881843509848440944,82819613850598966),(.m0,53426369505263728,4754013400596022),(.m0,3233594977812592,270737558470198),(.m0,195502616346736,15271829962294),(.m0,11806596661360,3210604688956462)], + .ms [(.m0,.s6,437311758141682),(.m0,.s6,140401799637343906362145774),(.m0,.s6,4976888274254543621494),(.m0,.s6,1215060610496897110),(.m0,.s6,296644823164174)], + .ms2 .s6 .s7 [(.m0,72214627900,2054295092),(.m0,594343024,20396854),(.m0,35573680,881158),(.m0,2125156,1225122230)], + .ms [(.m12,.s7,987),(.m0,.s6,8413),(.m3,.s6,50),(.m20,.s0,50),(.m1,.s3,8413),(.m4,.s3,987)], + .ms2 .s3 .s0 [(.m13,1225122230,2125156),(.m1,881158,35573680),(.m1,20396854,594343024),(.m1,2054295092,72214627900)], + .ms [(.m16,.s3,296644823164174),(.m1,.s3,1215060610496897110),(.m1,.s3,4976888274254543621494),(.m1,.s3,140401799637343906362145774),(.m1,.s3,437311758141682)], + .ms2 .s3 .s0 [(.m4,3210604688956462,11806596661360),(.m1,15271829962294,195502616346736),(.m1,270737558470198,3233594977812592),(.m1,4754013400596022,53426369505263728),(.m1,82819613850598966,881843509848440944),(.m1,1433200212666482232,1031042839691132938)], + .ms [(.m1,.s3,773493236000882638),(.m4,.s3,364791569817010168),(.m10,.s7,364791569817010174),(.m8,.s2,364791569817010169)], + .m .m9, + .b 0 [[([1459166279268040694,729583139634020349,364791569817010176,182395784908505088,91197892454252544,45598946227126272,22799473113563136,11399736556781568,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,364791569817010174), + (.D17,773493236000882638)]), + ([182395784908505086],[(.D16,1031042839691132938), + (.D6,1433200212666482232), + (.D16,881843509848440944), + (.D6,82819613850598966), + (.D16,53426369505263728), + (.D6,4754013400596022), + (.D16,3233594977812592), + (.D6,270737558470198), + (.D16,195502616346736), + (.D6,15271829962294), + (.D16,11806596661360), + (.D6,3210604688956462), + (.D16,437311758141682), + (.D18,140401799637343906362145774), + (.D18,4976888274254543621494), + (.D18,1215060610496897110), + (.D18,296644823164174), + (.D18,72214627900), + (.D6,2054295092), + (.D16,594343024), + (.D6,20396854), + (.D16,35573680), + (.D6,881158), + (.D16,2125156), + (.D6,1225122230), + (.D12,987), + (.D16,8413), + (.D16,50), + (.D6,5)])]], + .ms [(.m2,.s6,1459166279268040693),(.m14,.s5,1459166279268040687)], + .m .m5, + .b 1459166279268040693 [[([5],[(.D18,1),(.D15,682295343546630093),(.D14,1008243366577569802)])]], + .ms [(.m2,.s6,1459166279268040696),(.m7,.s5,1459166279268040690)], + .m .m5, + .b 1459166279268040696 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,1459166279268040697),(.m15,.s5,1459166279268040691)], + .m .m5, + .b 1459166279268040697 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,1459166279268040698),(.m25,.s2,1459166279268040693)], + .m .m18, + .b 1459166279268040698 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,1459166279268040700),(.m14,.s5,1459166279268040694)], + .m .m5, + .b 1459166279268040700 [[([5],[(.D18,1),(.D17,682295343546630092),(.D15,1008243366577569802),(.D17,1427500344388091448),(.D15,880418542778843248),(.D17,82463372083199542),(.D15,53337309063413872),(.D17,4731748290133558),(.D15,3228028700196976),(.D17,269345989066294),(.D15,195154723995760),(.D17,15184856874550),(.D15,11784853389424),(.D17,3210599253138478),(.D15,437310399187186),(.D21,140401799637343906022407150),(.D21,4976888274254458686838),(.D21,1215060610475663446),(.D21,296644817855758),(.D21,72213300796),(.D17,2053963316),(.D15,594260080),(.D17,20376118),(.D15,35568496),(.D17,879862),(.D15,2124832),(.D17,1225122149),(.D17,968),(.D8,8407)])]], + .ms [(.m2,.s6,1459166279268040703),(.m7,.s5,1459166279268040697)], + .m .m5, + .b 1459166279268040703 [[([999799117276250109],[(.D8,682295343546630092),(.D16,1008243366577569802),(.D6,1427500344388091448),(.D16,880418542778843248),(.D6,82463372083199542),(.D16,53337309063413872),(.D6,4731748290133558),(.D16,3228028700196976),(.D6,269345989066294),(.D16,195154723995760),(.D6,15184856874550),(.D16,11784853389424),(.D6,3210599253138478),(.D16,437310399187186),(.D18,140401799637343906022407150),(.D18,4976888274254458686838),(.D18,1215060610475663446),(.D18,296644817855758),(.D18,72213300796),(.D6,2053963316),(.D16,594260080),(.D6,20376118),(.D16,35568496),(.D6,879862),(.D16,2124832),(.D6,1225122149),(.D6,969),(.D9,8407),(.D14,48),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,1959065837906165758,557320453887098830),(.m0,976999644162686986,1419689413784370744),(.m0,878465810127913072,81975188920466998),(.m0,53215263272730736,4701236842462774),(.m0,3220400838279280,267439023586870),(.m0,194677982625904,15065671532086),(.m0,11755057053808,3210591804054574)], + .ms [(.m0,.s6,437308536916210),(.m0,.s6,140401799637343905556839406),(.m0,.s6,4976888274254342294902),(.m0,.s6,1215060610446565462),(.m0,.s6,296644810581262)], + .ms2 .s6 .s7 [(.m0,72211482172,2053508660),(.m0,594146416,20347702),(.m0,35561392,878086),(.m0,2124388,1225122038)], + .ms [(.m12,.s7,939),(.m0,.s6,8401),(.m3,.s6,47),(.m21,.s3,47),(.m4,.s3,8401),(.m4,.s3,939)], + .ms2 .s3 .s0 [(.m13,1225122038,2124388),(.m1,878086,35561392),(.m1,20347702,594146416),(.m1,2053508660,72211482172)], + .ms [(.m16,.s3,296644810581262),(.m1,.s3,1215060610446565462),(.m1,.s3,4976888274254342294902),(.m1,.s3,140401799637343905556839406),(.m1,.s3,437308536916210)], + .ms2 .s3 .s0 [(.m4,3210591804054574,11755057053808),(.m1,15065671532086,194677982625904),(.m1,267439023586870,3220400838279280),(.m1,4701236842462774,53215263272730736),(.m1,81975188920466998,878465810127913072),(.m1,1419689413784370744,976999644162686986),(.m1,557320453887098830,1959065837906165753)], + .ms [(.m26,.s7,1959065837906165758),(.m8,.s2,1959065837906165753)], + .m .m9, + .b 0 [[([3999196469105000444],[(.D7,1959065837906165758),(.D7,557320453887098829),(.D16,976999644162686986),(.D6,1419689413784370744),(.D16,878465810127913072),(.D6,81975188920466998),(.D16,53215263272730736),(.D6,4701236842462774),(.D16,3220400838279280),(.D6,267439023586870),(.D16,194677982625904),(.D6,15065671532086),(.D16,11755057053808),(.D6,3210591804054574),(.D16,437308536916210),(.D18,140401799637343905556839406),(.D18,4976888274254342294902),(.D18,1215060610446565462),(.D18,296644810581262),(.D18,72211482172),(.D6,2053508660),(.D16,594146416),(.D6,20347702),(.D16,35561392),(.D6,878086),(.D16,2124388),(.D6,1225122038),(.D12,939),(.D16,8401),(.D16,47),(.D12,3)])]], + .ms [(.m2,.s6,1999598234552500222)], + .ms2 .s6 .s7 [(.m3,1459166279268040702,432345564227567566),(.m0,945755921747804170,1411878483180650040),(.m0,876513077476982896,81487005757734454),(.m0,53093217482047600,4670725394791990),(.m0,3212772976361584,265532058107446),(.m0,194201241256048,14946486189622),(.m0,11725260718192,3210584354970670)], + .ms [(.m0,.s6,437306674645234),(.m0,.s6,140401799637343905091271662),(.m0,.s6,4976888274254225902966),(.m0,.s6,1215060610417467478),(.m0,.s6,296644803306766)], + .ms2 .s6 .s7 [(.m0,72209663548,2053054004),(.m0,594032752,20319286),(.m0,35554288,876310),(.m0,2123944,1225121927)], + .ms [(.m3,.s6,913)], + .ms2 .s6 .s7 [(.m6,8393,46)], + .ms2 .s3 .s0 [(.m19,46,8393)], + .ms [(.m17,.s0,913)], + .ms2 .s3 .s0 [(.m4,1225121927,2123944),(.m1,876310,35554288),(.m1,20319286,594032752),(.m1,2053054004,72209663548)], + .ms [(.m16,.s3,296644803306766),(.m1,.s3,1215060610417467478),(.m1,.s3,4976888274254225902966),(.m1,.s3,140401799637343905091271662),(.m1,.s3,437306674645234)], + .ms2 .s3 .s0 [(.m4,3210584354970670,11725260718192),(.m1,14946486189622,194201241256048),(.m1,265532058107446,3212772976361584),(.m1,4670725394791990,53093217482047600),(.m1,81487005757734454,876513077476982896),(.m1,1411878483180650040,945755921747804170),(.m1,432345564227567566,1459166279268040702)], + .ms [(.m1,.s3,1999598234552500216),(.m10,.s7,1999598234552500222),(.m8,.s2,1999598234552500217)], + .m .m9, + .b 0 [[([7998392938210000886,3674937295934324742],[(.D7,1999598234552500222),(.D17,1459166279268040702)]),([729583139634020351],[(.D6,432345564227567566),(.D16,945755921747804170),(.D6,1411878483180650040),(.D16,876513077476982896),(.D6,81487005757734454),(.D16,53093217482047600),(.D6,4670725394791990),(.D16,3212772976361584),(.D6,265532058107446),(.D16,194201241256048),(.D6,14946486189622),(.D16,11725260718192),(.D6,3210584354970670),(.D16,437306674645234),(.D18,140401799637343905091271662),(.D18,4976888274254225902966),(.D18,1215060610417467478),(.D18,296644803306766),(.D18,72209663548),(.D6,2053054004),(.D16,594032752),(.D6,20319286),(.D16,35554288),(.D6,876310),(.D16,2123944),(.D6,1225121927),(.D6,913),(.D12,8393),(.D6,46),(.D16,4)])]], + .ms [(.m2,.s6,5836665117072162814),(.m3,.s6,540431955284459518)], + .ms2 .s6 .s7 [(.m3,1094374709451030526,341147671773315022),(.m0,922956448634241034,1406178614902259256),(.m0,875088110407385200,81130763990335030),(.m0,53004157040197744,4648460284329526),(.m0,3207206698745968,264140488703542),(.m0,193853348905072,14859513101878),(.m0,11703517446256,3210578919152686)], + .ms [(.m0,.s6,437305315690738),(.m0,.s6,140401799637343904751533038),(.m0,.s6,4976888274254140968310),(.m0,.s6,1215060610396233814),(.m0,.s6,296644797998350)], + .ms2 .s6 .s7 [(.m0,72208336444,2052722228),(.m0,593949808,20298550),(.m0,35549104,875014),(.m0,2123620,1225121846)], + .ms [(.m12,.s7,891),(.m0,.s6,8389),(.m3,.s6,44),(.m20,.s0,44),(.m1,.s3,8389),(.m4,.s3,891)], + .ms2 .s3 .s0 [(.m13,1225121846,2123620),(.m1,875014,35549104),(.m1,20298550,593949808),(.m1,2052722228,72208336444)], + .ms [(.m16,.s3,296644797998350),(.m1,.s3,1215060610396233814),(.m1,.s3,4976888274254140968310),(.m1,.s3,140401799637343904751533038),(.m1,.s3,437305315690738)], + .ms2 .s3 .s0 [(.m4,3210578919152686,11703517446256),(.m1,14859513101878,193853348905072),(.m1,264140488703542,3207206698745968),(.m1,4648460284329526,53004157040197744),(.m1,81130763990335030,875088110407385200),(.m1,1406178614902259256,922956448634241034),(.m1,341147671773315022,1094374709451030526)], + .ms [(.m1,.s3,540431955284459518),(.m4,.s3,5836665117072162808),(.m10,.s7,5836665117072162814),(.m8,.s2,5836665117072162809)], + .m .m9, + .b 0 [[([17293822569102704564],[(.D7,5836665117072162814)]), + ([2161727821137838070,1080863910568919039,540431955284459520,270215977642229760,135107988821114880,67553994410557440,33776997205278720,16888498602639360,8444249301319680,4222124650659840,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,540431955284459518), + (.D16,1094374709451030526)]), + ([270215977642229758],[(.D6,341147671773315022), + (.D16,922956448634241034), + (.D6,1406178614902259256), + (.D16,875088110407385200), + (.D6,81130763990335030), + (.D16,53004157040197744), + (.D6,4648460284329526), + (.D16,3207206698745968), + (.D6,264140488703542), + (.D16,193853348905072), + (.D6,14859513101878), + (.D16,11703517446256), + (.D6,3210578919152686), + (.D16,437305315690738), + (.D18,140401799637343904751533038), + (.D18,4976888274254140968310), + (.D18,1215060610396233814), + (.D18,296644797998350), + (.D18,72208336444), + (.D6,2052722228), + (.D16,593949808), + (.D6,20298550), + (.D16,35549104), + (.D6,875014), + (.D16,2123620), + (.D6,1225121846), + (.D12,891), + (.D16,8389), + (.D16,44), + (.D6,5)])]], + .ms [(.m2,.s6,8646911284551352282),(.m3,.s6,3674937295934324743),(.m14,.s5,3674937295934324743),(.m4,.s5,8646911284551352276)], + .m .m5, + .b 8646911284551352282 [[([23],[(.D16,3674937295934324743),(.D18,1),(.D15,959266720629915645),(.D16,307370674568036302)])]], + .ms [(.m2,.s6,8646911284551352294),(.m3,.s6,3674937295934324740),(.m7,.s5,3674937295934324740),(.m4,.s5,8646911284551352288)], + .m .m5, + .b 8646911284551352294 [[([7],[(.D16,3674937295934324740),(.D6,1)])]], + .ms [(.m2,.s6,8646911284551352298),(.m6,.s6,3674937295934324738),(.m15,.s5,3674937295934324738),(.m11,.s5,8646911284551352292)], + .m .m5, + .b 8646911284551352298 [[([5],[(.D12,3674937295934324738),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,8646911284551352301,3674937295934324739)], + .ms [(.m23,.s1,3674937295934324739),(.m22,.s4,8646911284551352295)], + .m .m24, + .b 8646911284551352301 [[([17],[(.D6,3674937295934324739),(.D6,2)])]], + .ms [(.m2,.s6,8646911284551352310),(.m6,.s6,3674937295934324735),(.m14,.s5,3674937295934324735),(.m11,.s5,8646911284551352304)], + .m .m5, + .b 8646911284551352310 [[([23],[(.D12,3674937295934324735),(.D18,1),(.D17,959266720629915644),(.D17,307370674568036302),(.D15,914512199332921354),(.D17,1404067552576929336),(.D15,874560344826052720),(.D17,80998822595001910),(.D15,52971171691364464),(.D17,4640213947121206),(.D15,3205145114443888),(.D17,263625092628022),(.D15,193724499886192),(.D17,14827300847158),(.D15,11695464382576),(.D17,3210576905886766),(.D15,437304812374258),(.D21,140401799637343904625703918),(.D21,4976888274254109511030),(.D21,1215060610388369494),(.D21,296644796032270),(.D21,72207844924),(.D17,2052599348),(.D15,593919088),(.D17,20290870),(.D15,35547184),(.D17,874534),(.D15,2123500),(.D17,1225121816),(.D11,883),(.D6,8388)])]], + .ms [(.m2,.s6,8646911284551352322),(.m6,.s6,3674937295934324732),(.m7,.s5,3674937295934324732),(.m11,.s5,8646911284551352316)], + .m .m5, + .b 8646911284551352322 [[([14699749183737298929,7349874591868649469,1297036692682702857],[(.D12,3674937295934324732),(.D8,959266720629915644),(.D6,307370674568036302),(.D16,914512199332921354)]),([91197892454252543],[(.D6,1404067552576929336),(.D16,874560344826052720),(.D6,80998822595001910),(.D16,52971171691364464),(.D6,4640213947121206),(.D16,3205145114443888),(.D6,263625092628022),(.D16,193724499886192),(.D6,14827300847158),(.D16,11695464382576),(.D6,3210576905886766),(.D16,437304812374258),(.D18,140401799637343904625703918),(.D18,4976888274254109511030),(.D18,1215060610388369494),(.D18,296644796032270),(.D18,72207844924),(.D6,2052599348),(.D16,593919088),(.D6,20290870),(.D16,35547184),(.D6,874534),(.D16,2123500),(.D6,1225121816),(.D12,884),(.D7,8387),(.D8,43),(.D7,4)])]], + .ms [(.m2,.s6,20320241518695677950)], + .ms2 .s6 .s7 [(.m3,756604737398243326,229683580995895294)], + .ms [(.m3,.s6,124974889659531214)], + .ms2 .s6 .s7 [(.m3,868913253105795082,1392667816020147768),(.m0,871710410686857328,80286339060203062),(.m0,52793050807664752,4595683726196278),(.m0,3194012559212656,260841953820214),(.m0,193028715184240,14653354671670),(.m0,11651977838704,3210566034250798)], + .ms [(.m0,.s6,437302094465266),(.m0,.s6,140401799637343903946226670),(.m0,.s6,4976888274253939641718),(.m0,.s6,1215060610345902166),(.m0,.s6,296644785415438)], + .ms2 .s6 .s7 [(.m0,72205190716,2051935796),(.m0,593753200,20249398),(.m0,35536816,871942),(.m0,2122852,1225121654)], + .ms [(.m12,.s7,843),(.m0,.s6,8377),(.m3,.s6,41),(.m21,.s3,41),(.m4,.s3,8377),(.m4,.s3,843)], + .ms2 .s3 .s0 [(.m13,1225121654,2122852),(.m1,871942,35536816),(.m1,20249398,593753200),(.m1,2051935796,72205190716)], + .ms [(.m16,.s3,296644785415438),(.m1,.s3,1215060610345902166),(.m1,.s3,4976888274253939641718),(.m1,.s3,140401799637343903946226670),(.m1,.s3,437302094465266)], + .ms2 .s3 .s0 [(.m4,3210566034250798,11651977838704),(.m1,14653354671670,193028715184240),(.m1,260841953820214,3194012559212656),(.m1,4595683726196278,52793050807664752),(.m1,80286339060203062,871710410686857328),(.m1,1392667816020147768,868913253105795082),(.m1,124974889659531214,229683580995895294)], + .ms [(.m4,.s3,756604737398243326),(.m4,.s3,20320241518695677944),(.m10,.s7,20320241518695677950),(.m8,.s2,20320241518695677945)], + .m .m9, + .b 0 [[([24211340051871694808],[(.D7,20320241518695677950)]), + ([3026418949592973302,1513209474796486655,756604737398243328,378302368699121664,189151184349560832,94575592174780416,47287796087390208,23643898043695104,11821949021847552,5910974510923776,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912],[(.D17,756604737398243326), + (.D6,229683580995895294), + (.D6,124974889659531214)]), + ([94575547077623807],[(.D16,868913253105795082), + (.D6,1392667816020147768), + (.D16,871710410686857328), + (.D6,80286339060203062), + (.D16,52793050807664752), + (.D6,4595683726196278), + (.D16,3194012559212656), + (.D6,260841953820214), + (.D16,193028715184240), + (.D6,14653354671670), + (.D16,11651977838704), + (.D6,3210566034250798), + (.D16,437302094465266), + (.D18,140401799637343903946226670), + (.D18,4976888274253939641718), + (.D18,1215060610345902166), + (.D18,296644785415438), + (.D18,72205190716), + (.D6,2051935796), + (.D16,593753200), + (.D6,20249398), + (.D16,35536816), + (.D6,871942), + (.D16,2122852), + (.D6,1225121654), + (.D12,843), + (.D16,8377), + (.D16,41), + (.D12,3)])]], + ] (by decide +kernel) +theorem chunk_43_step : (cfg_43.denote) [qi]⊢* (cfg_44.denote) := + step_chunk [ + .b 12105670025935847404 [[([11544872091612],[(.D15,17293824012211716098)]), + ([1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D6,360777252864), + (.D16,40532486840647678)]), + ([180388626431],[(.D17,77687116120719310), + (.D15,857091309721092106), + (.D17,1389712330173972024), + (.D15,870971539225313392), + (.D17,80101621194817078), + (.D15,52746871341318256), + (.D17,4584138859609654), + (.D15,3191126342566000), + (.D17,260120399658550), + (.D15,192848326643824), + (.D17,14608257536566), + (.D15,11640703554928), + (.D17,3210563215679854), + (.D15,437301389822530), + (.D21,140401799637343903770065986), + (.D21,4976888274253895601547), + (.D19,1215060610334892124), + (.D19,296644782662928), + (.D19,72204502589)])], + [([8],[(.D15,17293822569102704647), + (.D21,0), + (.D19,40532396646334461)])]], + .ms [(.m2,.s6,12105675798371893214),(.m6,.s6,17293822569102704645),(.m7,.s5,17293822569102704645),(.m11,.s5,12105675798371893208)], + .m .m5, + .b 12105675798371893214 [[([41],[(.D12,17293822569102704645),(.D8,1),(.D7,40532396646334460)])],[([972777519512027014],[(.D17,17293822569102704641),(.D2,40532396646334458)])]], + .ms [(.m2,.s6,12592064558127906742),(.m3,.s6,17172225379163701264),(.m27,.s2,17172225379163701264),(.m1,.s5,12592064558127906736)], + .m .m5, + .b 12592064558127906742 [[([7],[(.D16,17172225379163701264), + (.D6,1)])], + [([16],[(.D11,17172225379163701262), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,17172225379163701261), + (.D17,1), + (.D15,0), + (.D6,77687093572141006)])], + [([16],[(.D11,17172225379163701259), + (.D3,0)])], + [([8],[(.D15,17172225379163701258), + (.D17,1), + (.D21,77687093572141005), + (.D15,857091304083947530), + (.D17,1389712328764685880), + (.D15,870971538872991856), + (.D17,80101621106736694), + (.D15,52746871319298160), + (.D17,4584138854104630), + (.D15,3191126341189744), + (.D17,260120399314486), + (.D15,192848326557808), + (.D17,14608257515062), + (.D15,11640703549552), + (.D17,3210563215678510), + (.D15,437301389822194), + (.D21,140401799637343903770065902), + (.D21,4976888274253895601526), + (.D21,1215060610334892118), + (.D21,296644782662926), + (.D21,72204502588), + (.D17,2051763764), + (.D15,593710192), + (.D17,20238646), + (.D15,35534128), + (.D17,871270), + (.D15,2122684), + (.D17,1225121612), + (.D11,832), + (.D12,8374)])], + [([18],[(.D11,17172225379163701256), + (.D13,0), + (.D16,77687093572141005), + (.D16,857091304083947530)])], + [([2485986994308512196],[(.D17,17172225379163701255)]), + ([310748374288564027,155374187144282015,77687093572141008,38843546786070504,19421773393035252,9710886696517623,4855443348258813,2427721674129408,1213860837064704,606930418532352,303465209266176,151732604633088,75866302316544,37933151158272,18966575579136,9483287789568,4741643894784,2370821947392,1185410973696,592705486848,296352743424,148176371712,74088185856,37044092928,18522046464,9261023232,4630511616,2315255808,1157627904,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,77687093572141006), + (.D17,857091304083947530)]), + ([38843546786070503],[(.D6,1389712328764685880), + (.D16,870971538872991856), + (.D6,80101621106736694), + (.D16,52746871319298160), + (.D6,4584138854104630), + (.D16,3191126341189744), + (.D6,260120399314486), + (.D16,192848326557808), + (.D6,14608257515062), + (.D16,11640703549552), + (.D6,3210563215678510), + (.D16,437301389822194), + (.D18,140401799637343903770065902), + (.D18,4976888274253895601526), + (.D18,1215060610334892118), + (.D18,296644782662926), + (.D18,72204502588), + (.D6,2051763764), + (.D16,593710192), + (.D6,20238646), + (.D16,35534128), + (.D6,871270), + (.D16,2122684), + (.D6,1225121612), + (.D12,833), + (.D13,8374), + (.D9,40), + (.D13,3)])], + [([10],[(.D17,16861477004875137231), + (.D21,0), + (.D19,837669530690912278)])]], + .ms [(.m2,.s6,13835058055282162882),(.m3,.s6,16861477004875137229),(.m7,.s5,16861477004875137229),(.m4,.s5,13835058055282162876)], + .m .m5, + .b 13835058055282162882 [[([43],[(.D16,16861477004875137229),(.D8,1),(.D7,837669530690912277)])],[([20104068736581894618],[(.D11,16861477004875137222),(.D2,837669530690912275)])]], + .ms2 .s6 .s7 [(.m2,23887092423573110213,14348468412802400397)], + .ms [(.m29,.s2,14348468412802400397),(.m4,.s5,23887092423573110207)], + .m .m5, + .b 23887092423573110213 [[([9],[(.D6,14348468412802400397),(.D6,1)])],[([20],[(.D15,14348468412802400395),(.D13,0),(.D10,1384856885416427066),(.D9,869757678035927152)])],[([36],[(.D11,14348468412802400391)]),([7,2],[(.D12,1),(.D6,1384856885416427066)])]], + .ms [(.m2,.s6,23887092423573110246),(.m6,.s6,14348468412802400387),(.m15,.s5,14348468412802400387),(.m11,.s5,23887092423573110240)], + .m .m5, + .b 23887092423573110246 [[([5],[(.D12,14348468412802400387),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,23887092423573110249,14348468412802400388)], + .ms [(.m23,.s1,14348468412802400388),(.m22,.s4,23887092423573110243)], + .m .m24, + .b 23887092423573110249 [[([17],[(.D6,14348468412802400388),(.D6,2)])],[([6],[(.D11,14348468412802400384),(.D21,0),(.D7,1384856885416427064)])]], + .ms2 .s6 .s7 [(.m2,23887092423573110261,14348468412802400385)], + .ms2 .s5 .s2 [(.m28,14348468412802400385,23887092423573110256)], + .m .m18, + .b 23887092423573110261 [[([45],[(.D6,14348468412802400385),(.D8,1),(.D17,1384856885416427063),(.D10,869757678035927151)])],[([36],[(.D15,14348468412802400378)]),([7,2],[(.D12,1),(.D17,1384856885416427062)]),([1],[(.D11,869757678035927151),(.D16,79798155897470518)])],[([8],[(.D15,14348468412802400374),(.D21,0),(.D17,1384856885416427061),(.D12,869757678035927152)])]], + .ms [(.m2,.s6,23887092423573110306),(.m6,.s6,14348468412802400372),(.m7,.s5,14348468412802400372),(.m11,.s5,23887092423573110300)], + .m .m5, + .b 23887092423573110306 [[([39],[(.D12,14348468412802400372),(.D8,1384856885416427062),(.D13,869757678035927152),(.D17,79798155897470518),(.D15,52671005016981616),(.D17,4565172278525494),(.D15,3186384697294960),(.D17,258934988340790),(.D15,192551973814384),(.D17,14534169329206),(.D15,11622181503088),(.D17,3210558585166894),(.D15,437300232194290),(.D21,140401799637343903480658926),(.D21,4976888274253823249782),(.D21,1215060610316804182),(.D21,296644778140942),(.D21,72203372092),(.D17,2051481140),(.D15,593639536),(.D17,20220982),(.D15,35529712),(.D17,870166),(.D15,2122408),(.D17,1225121543),(.D17,817),(.D11,8369),(.D17,40),(.D15,3)])]], + .ms [(.m2,.s6,23887092423573110326)], + .ms2 .s6 .s7 [(.m3,14348468412802400368,1384856885416427062),(.m0,869757678035927152,79798155897470518),(.m0,52671005016981616,4565172278525494),(.m0,3186384697294960,258934988340790),(.m0,192551973814384,14534169329206),(.m0,11622181503088,3210558585166894)], + .ms [(.m0,.s6,437300232194290),(.m0,.s6,140401799637343903480658926),(.m0,.s6,4976888274253823249782),(.m0,.s6,1215060610316804182),(.m0,.s6,296644778140942)], + .ms2 .s6 .s7 [(.m0,72203372092,2051481140),(.m0,593639536,20220982),(.m0,35529712,870166),(.m0,2122408,1225121543)], + .ms [(.m3,.s6,817)], + .ms2 .s6 .s7 [(.m6,8369,40)], + .ms2 .s3 .s0 [(.m19,40,8369)], + .ms [(.m17,.s0,817)], + .ms2 .s3 .s0 [(.m4,1225121543,2122408),(.m1,870166,35529712),(.m1,20220982,593639536),(.m1,2051481140,72203372092)], + .ms [(.m16,.s3,296644778140942),(.m1,.s3,1215060610316804182),(.m1,.s3,4976888274253823249782),(.m1,.s3,140401799637343903480658926),(.m1,.s3,437300232194290)], + .ms2 .s3 .s0 [(.m4,3210558585166894,11622181503088),(.m1,14534169329206,192551973814384),(.m1,258934988340790,3186384697294960),(.m1,4565172278525494,52671005016981616),(.m1,79798155897470518,869757678035927152),(.m1,1384856885416427062,14348468412802400368)], + .ms [(.m1,.s3,23887092423573110320),(.m10,.s7,23887092423573110326),(.m8,.s2,23887092423573110321)], + .m .m9, + .b 0 [[([729583139634020348],[(.D7,23887092423573110326),(.D17,14348468412802400368),(.D6,1384856885416427062),(.D16,869757678035927152),(.D6,79798155897470518),(.D16,52671005016981616),(.D6,4565172278525494),(.D16,3186384697294960),(.D6,258934988340790),(.D16,192551973814384),(.D6,14534169329206),(.D16,11622181503088),(.D6,3210558585166894),(.D16,437300232194290),(.D18,140401799637343903480658926),(.D18,4976888274253823249782),(.D18,1215060610316804182),(.D18,296644778140942),(.D18,72203372092),(.D6,2051481140),(.D16,593639536),(.D6,20220982),(.D16,35529712),(.D6,870166),(.D16,2122408),(.D6,1225121543),(.D6,817),(.D12,8369),(.D6,40),(.D16,4)])]], + .ms [(.m2,.s6,364791569817010174),(.m3,.s6,23795894531118857782)], + .ms2 .s6 .s7 [(.m3,14325668939688837232,1379157017138036278),(.m0,868332710966329456,79441914130071094),(.m0,52581944575131760,4542907168063030),(.m0,3180818419679344,257543418936886),(.m0,192204081463408,14447196241462),(.m0,11600438231152,3210553149348910)], + .ms [(.m0,.s6,437298873239794),(.m0,.s6,140401799637343903140920302),(.m0,.s6,4976888274253738315126),(.m0,.s6,1215060610295570518),(.m0,.s6,296644772832526)], + .ms2 .s6 .s7 [(.m0,72202044988,2051149364),(.m0,593556592,20200246),(.m0,35524528,868870),(.m0,2122084,1225121462)], + .ms [(.m12,.s7,795),(.m0,.s6,8365),(.m3,.s6,38),(.m20,.s0,38),(.m1,.s3,8365),(.m4,.s3,795)], + .ms2 .s3 .s0 [(.m13,1225121462,2122084),(.m1,868870,35524528),(.m1,20200246,593556592),(.m1,2051149364,72202044988)], + .ms [(.m16,.s3,296644772832526),(.m1,.s3,1215060610295570518),(.m1,.s3,4976888274253738315126),(.m1,.s3,140401799637343903140920302),(.m1,.s3,437298873239794)], + .ms2 .s3 .s0 [(.m4,3210553149348910,11600438231152),(.m1,14447196241462,192204081463408),(.m1,257543418936886,3180818419679344),(.m1,4542907168063030,52581944575131760),(.m1,79441914130071094,868332710966329456),(.m1,1379157017138036278,14325668939688837232)], + .ms [(.m1,.s3,23795894531118857782),(.m4,.s3,364791569817010168),(.m10,.s7,364791569817010174),(.m8,.s2,364791569817010169)], + .m .m9, + .b 0 [[([1459166279268040694,729583139634020349,364791569817010176,182395784908505088,91197892454252544,45598946227126272,22799473113563136,11399736556781568,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,364791569817010174), + (.D17,23795894531118857782)]), + ([182395784908505086],[(.D16,14325668939688837232), + (.D6,1379157017138036278), + (.D16,868332710966329456), + (.D6,79441914130071094), + (.D16,52581944575131760), + (.D6,4542907168063030), + (.D16,3180818419679344), + (.D6,257543418936886), + (.D16,192204081463408), + (.D6,14447196241462), + (.D16,11600438231152), + (.D6,3210553149348910), + (.D16,437298873239794), + (.D18,140401799637343903140920302), + (.D18,4976888274253738315126), + (.D18,1215060610295570518), + (.D18,296644772832526), + (.D18,72202044988), + (.D6,2051149364), + (.D16,593556592), + (.D6,20200246), + (.D16,35524528), + (.D6,868870), + (.D16,2122084), + (.D6,1225121462), + (.D12,795), + (.D16,8365), + (.D16,38), + (.D6,5)])]], + .ms [(.m2,.s6,1459166279268040693),(.m14,.s5,1459166279268040687)], + .m .m5, + .b 1459166279268040693 [[([5],[(.D18,1),(.D15,23704696638664605237),(.D14,14302869466575274096)])]], + .ms [(.m2,.s6,1459166279268040696),(.m7,.s5,1459166279268040690)], + .m .m5, + .b 1459166279268040696 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,1459166279268040697),(.m15,.s5,1459166279268040691)], + .m .m5, + .b 1459166279268040697 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,1459166279268040698),(.m25,.s2,1459166279268040693)], + .m .m18, + .b 1459166279268040698 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,1459166279268040700),(.m14,.s5,1459166279268040694)], + .m .m5, + .b 1459166279268040700 [[([5],[(.D18,1),(.D17,23704696638664605236),(.D15,14302869466575274096),(.D17,1373457148859645494),(.D15,866907743896731760),(.D17,79085672362671670),(.D15,52492884133281904),(.D17,4520642057600566),(.D15,3175252142063728),(.D17,256151849532982),(.D15,191856189112432),(.D17,14360223153718),(.D15,11578694959216),(.D17,3210547713530926),(.D15,437297514285298),(.D21,140401799637343902801181678),(.D21,4976888274253653380470),(.D21,1215060610274336854),(.D21,296644767524110),(.D21,72200717884),(.D17,2050817588),(.D15,593473648),(.D17,20179510),(.D15,35519344),(.D17,867574),(.D15,2121760),(.D17,1225121381),(.D17,776),(.D8,8359)])]], + .ms [(.m2,.s6,1459166279268040703),(.m7,.s5,1459166279268040697)], + .m .m5, + .b 1459166279268040703 [[([999799117276250109],[(.D8,23704696638664605236),(.D16,14302869466575274096),(.D6,1373457148859645494),(.D16,866907743896731760),(.D6,79085672362671670),(.D16,52492884133281904),(.D6,4520642057600566),(.D16,3175252142063728),(.D6,256151849532982),(.D16,191856189112432),(.D6,14360223153718),(.D16,11578694959216),(.D6,3210547713530926),(.D16,437297514285298),(.D18,140401799637343902801181678),(.D18,4976888274253653380470),(.D18,1215060610274336854),(.D18,296644767524110),(.D18,72200717884),(.D6,2050817588),(.D16,593473648),(.D6,20179510),(.D16,35519344),(.D6,867574),(.D16,2121760),(.D6,1225121381),(.D6,777),(.D9,8359),(.D14,36),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,1959065837906165758,23579721749005073974),(.m0,14271625744160391280,1365646218255924790),(.m0,864955011245801584,78597489199939126),(.m0,52370838342598768,4490130609929782),(.m0,3167624280146032,254244884053558),(.m0,191379447742576,14241037811254),(.m0,11548898623600,3210540264447022)], + .ms [(.m0,.s6,437295652014322),(.m0,.s6,140401799637343902335613934),(.m0,.s6,4976888274253536988534),(.m0,.s6,1215060610245238870),(.m0,.s6,296644760249614)], + .ms2 .s6 .s7 [(.m0,72198899260,2050362932),(.m0,593359984,20151094),(.m0,35512240,865798),(.m0,2121316,1225121270)], + .ms [(.m12,.s7,747),(.m0,.s6,8353),(.m3,.s6,35),(.m21,.s3,35),(.m4,.s3,8353),(.m4,.s3,747)], + .ms2 .s3 .s0 [(.m13,1225121270,2121316),(.m1,865798,35512240),(.m1,20151094,593359984),(.m1,2050362932,72198899260)], + .ms [(.m16,.s3,296644760249614),(.m1,.s3,1215060610245238870),(.m1,.s3,4976888274253536988534),(.m1,.s3,140401799637343902335613934),(.m1,.s3,437295652014322)], + .ms2 .s3 .s0 [(.m4,3210540264447022,11548898623600),(.m1,14241037811254,191379447742576),(.m1,254244884053558,3167624280146032),(.m1,4490130609929782,52370838342598768),(.m1,78597489199939126,864955011245801584),(.m1,1365646218255924790,14271625744160391280),(.m1,23579721749005073974,1959065837906165753)], + .ms [(.m26,.s7,1959065837906165758),(.m8,.s2,1959065837906165753)], + .m .m9, + .b 0 [[([3999196469105000444],[(.D7,1959065837906165758),(.D7,23579721749005073973),(.D16,14271625744160391280),(.D6,1365646218255924790),(.D16,864955011245801584),(.D6,78597489199939126),(.D16,52370838342598768),(.D6,4490130609929782),(.D16,3167624280146032),(.D6,254244884053558),(.D16,191379447742576),(.D6,14241037811254),(.D16,11548898623600),(.D6,3210540264447022),(.D16,437295652014322),(.D18,140401799637343902335613934),(.D18,4976888274253536988534),(.D18,1215060610245238870),(.D18,296644760249614),(.D18,72198899260),(.D6,2050362932),(.D16,593359984),(.D6,20151094),(.D16,35512240),(.D6,865798),(.D16,2121316),(.D6,1225121270),(.D12,747),(.D16,8353),(.D16,35),(.D12,3)])]], + .ms [(.m2,.s6,1999598234552500222)], + .ms2 .s6 .s7 [(.m3,1459166279268040702,23454746859345542710),(.m0,14240382021745508464,1357835287652204086),(.m0,863002278594871408,78109306037206582),(.m0,52248792551915632,4459619162258998),(.m0,3159996418228336,252337918574134),(.m0,190902706372720,14121852468790),(.m0,11519102287984,3210532815363118)], + .ms [(.m0,.s6,437293789743346),(.m0,.s6,140401799637343901870046190),(.m0,.s6,4976888274253420596598),(.m0,.s6,1215060610216140886),(.m0,.s6,296644752975118)], + .ms2 .s6 .s7 [(.m0,72197080636,2049908276),(.m0,593246320,20122678),(.m0,35505136,864022),(.m0,2120872,1225121159)], + .ms [(.m3,.s6,721)], + .ms2 .s6 .s7 [(.m6,8345,34)], + .ms2 .s3 .s0 [(.m19,34,8345)], + .ms [(.m17,.s0,721)], + .ms2 .s3 .s0 [(.m4,1225121159,2120872),(.m1,864022,35505136),(.m1,20122678,593246320),(.m1,2049908276,72197080636)], + .ms [(.m16,.s3,296644752975118),(.m1,.s3,1215060610216140886),(.m1,.s3,4976888274253420596598),(.m1,.s3,140401799637343901870046190),(.m1,.s3,437293789743346)], + .ms2 .s3 .s0 [(.m4,3210532815363118,11519102287984),(.m1,14121852468790,190902706372720),(.m1,252337918574134,3159996418228336),(.m1,4459619162258998,52248792551915632),(.m1,78109306037206582,863002278594871408),(.m1,1357835287652204086,14240382021745508464),(.m1,23454746859345542710,1459166279268040702)], + .ms [(.m1,.s3,1999598234552500216),(.m10,.s7,1999598234552500222),(.m8,.s2,1999598234552500217)], + .m .m9, + .b 0 [[([7998392938210000886,3674937295934324742],[(.D7,1999598234552500222),(.D17,1459166279268040702)]),([729583139634020351],[(.D6,23454746859345542710),(.D16,14240382021745508464),(.D6,1357835287652204086),(.D16,863002278594871408),(.D6,78109306037206582),(.D16,52248792551915632),(.D6,4459619162258998),(.D16,3159996418228336),(.D6,252337918574134),(.D16,190902706372720),(.D6,14121852468790),(.D16,11519102287984),(.D6,3210532815363118),(.D16,437293789743346),(.D18,140401799637343901870046190),(.D18,4976888274253420596598),(.D18,1215060610216140886),(.D18,296644752975118),(.D18,72197080636),(.D6,2049908276),(.D16,593246320),(.D6,20122678),(.D16,35505136),(.D6,864022),(.D16,2120872),(.D6,1225121159),(.D6,721),(.D12,8345),(.D6,34),(.D16,4)])]], + .ms [(.m2,.s6,5836665117072162814),(.m3,.s6,540431955284459518)], + .ms2 .s6 .s7 [(.m3,1094374709451030526,23363548966891290166),(.m0,14217582548631945328,1352135419373813302),(.m0,861577311525273712,77753064269807158),(.m0,52159732110065776,4437354051796534),(.m0,3154430140612720,250946349170230),(.m0,190554814021744,14034879381046),(.m0,11497359016048,3210527379545134)], + .ms [(.m0,.s6,437292430788850),(.m0,.s6,140401799637343901530307566),(.m0,.s6,4976888274253335661942),(.m0,.s6,1215060610194907222),(.m0,.s6,296644747666702)], + .ms2 .s6 .s7 [(.m0,72195753532,2049576500),(.m0,593163376,20101942),(.m0,35499952,862726),(.m0,2120548,1225121078)], + .ms [(.m12,.s7,699),(.m0,.s6,8341),(.m3,.s6,32),(.m20,.s0,32),(.m1,.s3,8341),(.m4,.s3,699)], + .ms2 .s3 .s0 [(.m13,1225121078,2120548),(.m1,862726,35499952),(.m1,20101942,593163376),(.m1,2049576500,72195753532)], + .ms [(.m16,.s3,296644747666702),(.m1,.s3,1215060610194907222),(.m1,.s3,4976888274253335661942),(.m1,.s3,140401799637343901530307566),(.m1,.s3,437292430788850)], + .ms2 .s3 .s0 [(.m4,3210527379545134,11497359016048),(.m1,14034879381046,190554814021744),(.m1,250946349170230,3154430140612720),(.m1,4437354051796534,52159732110065776),(.m1,77753064269807158,861577311525273712),(.m1,1352135419373813302,14217582548631945328),(.m1,23363548966891290166,1094374709451030526)], + .ms [(.m1,.s3,540431955284459518),(.m4,.s3,5836665117072162808),(.m10,.s7,5836665117072162814),(.m8,.s2,5836665117072162809)], + .m .m9, + .b 0 [[([17293822569102704564],[(.D7,5836665117072162814)]), + ([2161727821137838070,1080863910568919039,540431955284459520,270215977642229760,135107988821114880,67553994410557440,33776997205278720,16888498602639360,8444249301319680,4222124650659840,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,540431955284459518), + (.D16,1094374709451030526)]), + ([270215977642229758],[(.D6,23363548966891290166), + (.D16,14217582548631945328), + (.D6,1352135419373813302), + (.D16,861577311525273712), + (.D6,77753064269807158), + (.D16,52159732110065776), + (.D6,4437354051796534), + (.D16,3154430140612720), + (.D6,250946349170230), + (.D16,190554814021744), + (.D6,14034879381046), + (.D16,11497359016048), + (.D6,3210527379545134), + (.D16,437292430788850), + (.D18,140401799637343901530307566), + (.D18,4976888274253335661942), + (.D18,1215060610194907222), + (.D18,296644747666702), + (.D18,72195753532), + (.D6,2049576500), + (.D16,593163376), + (.D6,20101942), + (.D16,35499952), + (.D6,862726), + (.D16,2120548), + (.D6,1225121078), + (.D12,699), + (.D16,8341), + (.D16,32), + (.D6,5)])]], + .ms [(.m2,.s6,8646911284551352282),(.m3,.s6,3674937295934324743),(.m14,.s5,3674937295934324743),(.m4,.s5,8646911284551352276)], + .m .m5, + .b 8646911284551352282 [[([23],[(.D16,3674937295934324743),(.D18,1),(.D15,959266720629915645),(.D16,23329771969686011446)])]], + .ms [(.m2,.s6,8646911284551352294),(.m3,.s6,3674937295934324740),(.m7,.s5,3674937295934324740),(.m4,.s5,8646911284551352288)], + .m .m5, + .b 8646911284551352294 [[([7],[(.D16,3674937295934324740),(.D6,1)])]], + .ms [(.m2,.s6,8646911284551352298),(.m6,.s6,3674937295934324738),(.m15,.s5,3674937295934324738),(.m11,.s5,8646911284551352292)], + .m .m5, + .b 8646911284551352298 [[([5],[(.D12,3674937295934324738),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,8646911284551352301,3674937295934324739)], + .ms [(.m23,.s1,3674937295934324739),(.m22,.s4,8646911284551352295)], + .m .m24, + .b 8646911284551352301 [[([17],[(.D6,3674937295934324739),(.D6,2)])]], + .ms [(.m2,.s6,8646911284551352310),(.m6,.s6,3674937295934324735),(.m14,.s5,3674937295934324735),(.m11,.s5,8646911284551352304)], + .m .m5, + .b 8646911284551352310 [[([23],[(.D12,3674937295934324735),(.D18,1),(.D17,959266720629915644),(.D17,23329771969686011446),(.D15,14209138299330625648),(.D17,1350024357048483382),(.D15,861049545943941232),(.D17,77621122874474038),(.D15,52126746761232496),(.D17,4429107714588214),(.D15,3152368556310640),(.D17,250430953094710),(.D15,190425965002864),(.D17,14002667126326),(.D15,11489305952368),(.D17,3210525366279214),(.D15,437291927472370),(.D21,140401799637343901404478446),(.D21,4976888274253304204662),(.D21,1215060610187042902),(.D21,296644745700622),(.D21,72195262012),(.D17,2049453620),(.D15,593132656),(.D17,20094262),(.D15,35498032),(.D17,862246),(.D15,2120428),(.D17,1225121048),(.D11,691),(.D6,8340)])]], + .ms [(.m2,.s6,8646911284551352322),(.m6,.s6,3674937295934324732),(.m7,.s5,3674937295934324732),(.m11,.s5,8646911284551352316)], + .m .m5, + .b 8646911284551352322 [[([14699749183737298929,7349874591868649469,1297036692682702857],[(.D12,3674937295934324732),(.D8,959266720629915644),(.D6,23329771969686011446)]),([364791569817010175],[(.D16,14209138299330625648),(.D6,1350024357048483382),(.D16,861049545943941232),(.D6,77621122874474038),(.D16,52126746761232496),(.D6,4429107714588214),(.D16,3152368556310640),(.D6,250430953094710),(.D16,190425965002864),(.D6,14002667126326),(.D16,11489305952368),(.D6,3210525366279214),(.D16,437291927472370),(.D18,140401799637343901404478446),(.D18,4976888274253304204662),(.D18,1215060610187042902),(.D18,296644745700622),(.D18,72195262012),(.D6,2049453620),(.D16,593132656),(.D6,20094262),(.D16,35498032),(.D6,862246),(.D16,2120428),(.D6,1225121048),(.D12,692),(.D7,8339),(.D8,31),(.D7,4)])]], + .ms [(.m2,.s6,20320241518695677950)], + .ms2 .s6 .s7 [(.m3,756604737398243326,229683580995895294)], + .ms [(.m3,.s6,23147376184777506358)], + .ms2 .s6 .s7 [(.m3,14163539353103499376,1338624620491701814),(.m0,858199611804745840,76908639339675190),(.m0,51948625877532784,4384577493663286),(.m0,3141236001079408,247647814286902),(.m0,189730180300912,13828720950838),(.m0,11445819408496,3210514494643246)], + .ms [(.m0,.s6,437289209563378),(.m0,.s6,140401799637343900725001198),(.m0,.s6,4976888274253134335350),(.m0,.s6,1215060610144575574),(.m0,.s6,296644735083790)], + .ms2 .s6 .s7 [(.m0,72192607804,2048790068),(.m0,592966768,20052790),(.m0,35487664,859654),(.m0,2119780,1225120886)], + .ms [(.m12,.s7,651),(.m0,.s6,8329),(.m3,.s6,29),(.m21,.s3,29),(.m4,.s3,8329),(.m4,.s3,651)], + .ms2 .s3 .s0 [(.m13,1225120886,2119780),(.m1,859654,35487664),(.m1,20052790,592966768),(.m1,2048790068,72192607804)], + .ms [(.m16,.s3,296644735083790),(.m1,.s3,1215060610144575574),(.m1,.s3,4976888274253134335350),(.m1,.s3,140401799637343900725001198),(.m1,.s3,437289209563378)], + .ms2 .s3 .s0 [(.m4,3210514494643246,11445819408496),(.m1,13828720950838,189730180300912),(.m1,247647814286902,3141236001079408),(.m1,4384577493663286,51948625877532784),(.m1,76908639339675190,858199611804745840),(.m1,1338624620491701814,14163539353103499376),(.m1,23147376184777506358,229683580995895294)], + .ms [(.m4,.s3,756604737398243326),(.m4,.s3,20320241518695677944),(.m10,.s7,20320241518695677950),(.m8,.s2,20320241518695677945)], + .m .m9, + .b 0 [[([24211351596743786420],[(.D7,20320241518695677950)]), + ([3026418949592973302,1513209474796486655,756604737398243328,378302368699121664,189151184349560832,94575592174780416,47287796087390208,23643898043695104,11821949021847552,5910974510923776,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,756604737398243326), + (.D6,229683580995895294), + (.D6,23147376184777506358)]), + ([94575592174780415],[(.D16,14163539353103499376), + (.D6,1338624620491701814), + (.D16,858199611804745840), + (.D6,76908639339675190), + (.D16,51948625877532784), + (.D6,4384577493663286), + (.D16,3141236001079408), + (.D6,247647814286902), + (.D16,189730180300912), + (.D6,13828720950838), + (.D16,11445819408496), + (.D6,3210514494643246), + (.D16,437289209563378), + (.D18,140401799637343900725001198), + (.D18,4976888274253134335350), + (.D18,1215060610144575574), + (.D18,296644735083790), + (.D18,72192607804), + (.D6,2048790068), + (.D16,592966768), + (.D6,20052790), + (.D16,35487664), + (.D6,859654), + (.D16,2119780), + (.D6,1225120886), + (.D12,651), + (.D16,8329), + (.D16,29), + (.D12,3)])], + [([8],[(.D15,17293822569102704647), + (.D21,0), + (.D19,40532396646334461)])]], + .ms [(.m2,.s6,12105675798371893214),(.m6,.s6,17293822569102704645),(.m7,.s5,17293822569102704645),(.m11,.s5,12105675798371893208)], + .m .m5, + .b 12105675798371893214 [[([41],[(.D12,17293822569102704645),(.D8,1),(.D7,40532396646334460)])],[([972777519512027014],[(.D17,17293822569102704641),(.D2,40532396646334458)])]], + .ms [(.m2,.s6,12592064558127906742),(.m3,.s6,17172225379163701264),(.m27,.s2,17172225379163701264),(.m1,.s5,12592064558127906736)], + .m .m5, + .b 12592064558127906742 [[([7],[(.D16,17172225379163701264), + (.D6,1)])], + [([16],[(.D11,17172225379163701262), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,17172225379163701261), + (.D17,1), + (.D15,0), + (.D6,23100088388690116150)])], + [([16],[(.D11,17172225379163701259), + (.D3,0)])], + [([8],[(.D15,17172225379163701258), + (.D17,1), + (.D21,23100088388690116149), + (.D15,14151717404081651824), + (.D17,1335669133236239926), + (.D15,857460739990880368), + (.D17,76723921386208822), + (.D15,51902446389166192), + (.D17,4373032621571638), + (.D15,3138349783056496), + (.D17,246926259781174), + (.D15,189549791674480), + (.D17,13783623794230), + (.D15,11434545119344), + (.D17,3210511676070958), + (.D15,437288504920306), + (.D21,140401799637343900548840430), + (.D21,4976888274253090295158), + (.D21,1215060610133565526), + (.D21,296644732331278), + (.D21,72191919676), + (.D17,2048618036), + (.D15,592923760), + (.D17,20042038), + (.D15,35484976), + (.D17,858982), + (.D15,2119612), + (.D17,1225120844), + (.D11,640), + (.D12,8326)])], + [([18],[(.D11,17172225379163701256), + (.D13,0), + (.D16,23100088388690116149), + (.D16,14151717404081651824)])], + [([2485986994308513766],[(.D17,17172225379163701255), + (.D12,23100088388690116150), + (.D17,14151717404081651824), + (.D6,1335669133236239926), + (.D16,857460739990880368), + (.D6,76723921386208822), + (.D16,51902446389166192), + (.D6,4373032621571638), + (.D16,3138349783056496), + (.D6,246926259781174), + (.D16,189549791674480), + (.D6,13783623794230), + (.D16,11434545119344), + (.D6,3210511676070958), + (.D16,437288504920306), + (.D18,140401799637343900548840430), + (.D18,4976888274253090295158), + (.D18,1215060610133565526), + (.D18,296644732331278), + (.D18,72191919676), + (.D6,2048618036), + (.D16,592923760), + (.D6,20042038), + (.D16,35484976), + (.D6,858982), + (.D16,2119612), + (.D6,1225120844), + (.D12,641), + (.D13,8326), + (.D9,28), + (.D13,3)])]], + .ms [(.m2,.s6,13835058055282163662)], + .ms2 .s6 .s7 [(.m3,16861477004875137034,23022401295117975096),(.m0,14132295630688616560,1330813689887981110),(.m0,856246879153815664,76420456176942646),(.m0,51826580086849648,4354066045992502),(.m0,3133608139161712,245740848807478),(.m0,189253438931056,13709535608374),(.m0,11416023072880,3210507045559342)], + .ms [(.m0,.s6,437287347292402),(.m0,.s6,140401799637343900259433454),(.m0,.s6,4976888274253017943414),(.m0,.s6,1215060610115477590),(.m0,.s6,296644727809294)], + .ms2 .s6 .s7 [(.m0,72190789180,2048335412),(.m0,592853104,20024374),(.m0,35480560,857878),(.m0,2119336,1225120775)], + .ms [(.m3,.s6,625)], + .ms2 .s6 .s7 [(.m6,8321,28)], + .ms2 .s3 .s0 [(.m19,28,8321)], + .ms [(.m17,.s0,625)], + .ms2 .s3 .s0 [(.m4,1225120775,2119336),(.m1,857878,35480560),(.m1,20024374,592853104),(.m1,2048335412,72190789180)], + .ms [(.m16,.s3,296644727809294),(.m1,.s3,1215060610115477590),(.m1,.s3,4976888274253017943414),(.m1,.s3,140401799637343900259433454),(.m1,.s3,437287347292402)], + .ms2 .s3 .s0 [(.m4,3210507045559342,11416023072880),(.m1,13709535608374,189253438931056),(.m1,245740848807478,3133608139161712),(.m1,4354066045992502,51826580086849648),(.m1,76420456176942646,856246879153815664),(.m1,1330813689887981110,14132295630688616560),(.m1,23022401295117975096,16861477004875137034)], + .ms [(.m1,.s3,13835058055282163656),(.m10,.s7,13835058055282163662),(.m8,.s2,13835058055282163657)], + .m .m9, + .b 0 [[([11673330234144325628],[(.D7,13835058055282163662),(.D17,16861477004875137034),(.D6,23022401295117975096),(.D16,14132295630688616560),(.D6,1330813689887981110),(.D16,856246879153815664),(.D6,76420456176942646),(.D16,51826580086849648),(.D6,4354066045992502),(.D16,3133608139161712),(.D6,245740848807478),(.D16,189253438931056),(.D6,13709535608374),(.D16,11416023072880),(.D6,3210507045559342),(.D16,437287347292402),(.D18,140401799637343900259433454),(.D18,4976888274253017943414),(.D18,1215060610115477590),(.D18,296644727809294),(.D18,72190789180),(.D6,2048335412),(.D16,592853104),(.D6,20024374),(.D16,35480560),(.D6,857878),(.D16,2119336),(.D6,1225120775),(.D6,625),(.D12,8321),(.D6,28),(.D16,4)])]], + .ms [(.m2,.s6,5836665117072162814),(.m3,.s6,12375891776014122958)], + .ms2 .s6 .s7 [(.m3,16496685435058126858,22931203402663722552),(.m0,14109496157575053424,1325113821609590326),(.m0,854821912084217968,76064214409543222),(.m0,51737519644999792,4331800935530038),(.m0,3128041861546096,244349279403574),(.m0,188905546580080,13622562520630),(.m0,11394279800944,3210501609741358)], + .ms [(.m0,.s6,437285988337906),(.m0,.s6,140401799637343899919694830),(.m0,.s6,4976888274252933008758),(.m0,.s6,1215060610094243926),(.m0,.s6,296644722500878)], + .ms2 .s6 .s7 [(.m0,72189462076,2048003636),(.m0,592770160,20003638),(.m0,35475376,856582),(.m0,2119012,1225120694)], + .ms [(.m12,.s7,603),(.m0,.s6,8317),(.m3,.s6,26),(.m20,.s0,26),(.m1,.s3,8317)], + .m .m4, + ] (by decide +kernel) +theorem chunk_44_step : (cfg_44.denote) [qi]⊢* (cfg_45.denote) := + step_chunk [ + .s .s3 603, + .ms2 .s3 .s0 [(.m13,1225120694,2119012),(.m1,856582,35475376),(.m1,20003638,592770160),(.m1,2048003636,72189462076)], + .ms [(.m16,.s3,296644722500878),(.m1,.s3,1215060610094243926),(.m1,.s3,4976888274252933008758),(.m1,.s3,140401799637343899919694830),(.m1,.s3,437285988337906)], + .ms2 .s3 .s0 [(.m4,3210501609741358,11394279800944),(.m1,13622562520630,188905546580080),(.m1,244349279403574,3128041861546096),(.m1,4331800935530038,51737519644999792),(.m1,76064214409543222,854821912084217968),(.m1,1325113821609590326,14109496157575053424),(.m1,22931203402663722552,16496685435058126858)], + .ms [(.m1,.s3,12375891776014122958),(.m4,.s3,5836665117072162808),(.m10,.s7,5836665117072162814),(.m8,.s2,5836665117072162809)], + .m .m9, + .b 0 [[([23346660468288651254,11673330234144325629,5836665117072162816,2918332558536081408,1459166279268040704,729583139634020352,364791569817010176,182395784908505088,91197892454252544,45598946227126272,22799473113563136,11399736556781568,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,5836665117072162814), + (.D17,12375891776014122958)]), + ([2918332558536081406],[(.D16,16496685435058126858), + (.D6,22931203402663722552), + (.D16,14109496157575053424), + (.D6,1325113821609590326), + (.D16,854821912084217968), + (.D6,76064214409543222), + (.D16,51737519644999792), + (.D6,4331800935530038), + (.D16,3128041861546096), + (.D6,244349279403574), + (.D16,188905546580080), + (.D6,13622562520630), + (.D16,11394279800944), + (.D6,3210501609741358), + (.D16,437285988337906), + (.D18,140401799637343899919694830), + (.D18,4976888274252933008758), + (.D18,1215060610094243926), + (.D18,296644722500878), + (.D18,72189462076), + (.D6,2048003636), + (.D16,592770160), + (.D6,20003638), + (.D16,35475376), + (.D6,856582), + (.D16,2119012), + (.D6,1225120694), + (.D12,603), + (.D16,8317), + (.D16,26), + (.D6,5)])]], + .ms [(.m2,.s6,23346660468288651253),(.m14,.s5,23346660468288651247)], + .m .m5, + .b 23346660468288651253 [[([5],[(.D18,1),(.D15,10916725496746082253),(.D14,16131893865241116682)])]], + .ms [(.m2,.s6,23346660468288651256),(.m7,.s5,23346660468288651250)], + .m .m5, + .b 23346660468288651256 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,23346660468288651257),(.m15,.s5,23346660468288651251)], + .m .m5, + .b 23346660468288651257 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,23346660468288651258),(.m25,.s2,23346660468288651253)], + .m .m18, + .b 23346660468288651258 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,23346660468288651260),(.m14,.s5,23346660468288651254)], + .m .m5, + .b 23346660468288651260 [[([5],[(.D18,1),(.D17,10916725496746082252),(.D15,16131893865241116682),(.D17,22840005510209470008),(.D15,14086696684461490288),(.D17,1319413953331199542),(.D15,853396945014620272),(.D17,75707972642143798),(.D15,51648459203149936),(.D17,4309535825067574),(.D15,3122475583930480),(.D17,242957709999670),(.D15,188557654229104),(.D17,13535589432886),(.D15,11372536529008),(.D17,3210496173923374),(.D15,437284629383410),(.D21,140401799637343899579956206),(.D21,4976888274252848074102),(.D21,1215060610073010262),(.D21,296644717192462),(.D21,72188134972),(.D17,2047671860),(.D15,592687216),(.D17,19982902),(.D15,35470192),(.D17,855286),(.D15,2118688),(.D17,1225120613),(.D17,584),(.D8,8311)])]], + .ms [(.m2,.s6,23346660468288651263),(.m7,.s5,23346660468288651257)], + .m .m5, + .b 23346660468288651263 [[([15996785876420001789],[(.D8,10916725496746082252),(.D16,16131893865241116682),(.D6,22840005510209470008),(.D16,14086696684461490288),(.D6,1319413953331199542),(.D16,853396945014620272),(.D6,75707972642143798),(.D16,51648459203149936),(.D6,4309535825067574),(.D16,3122475583930480),(.D6,242957709999670),(.D16,188557654229104),(.D6,13535589432886),(.D16,11372536529008),(.D6,3210496173923374),(.D16,437284629383410),(.D18,140401799637343899579956206),(.D18,4976888274252848074102),(.D18,1215060610073010262),(.D18,296644717192462),(.D18,72188134972),(.D6,2047671860),(.D16,592687216),(.D6,19982902),(.D16,35470192),(.D6,855286),(.D16,2118688),(.D6,1225120613),(.D6,585),(.D9,8311),(.D14,24),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,31345053406498652158,8917127262193582030),(.m0,15631994306602991626,22715030620549938744),(.m0,14055452962046607472,1311603022727478838),(.m0,851444212363690096,75219789479411254),(.m0,51526413412466800,4279024377396790),(.m0,3114847722012784,241050744520246),(.m0,188080912859248,13416404090422),(.m0,11342740193392,3210488724839470)], + .ms [(.m0,.s6,437282767112434),(.m0,.s6,140401799637343899114388462),(.m0,.s6,4976888274252731682166),(.m0,.s6,1215060610043912278),(.m0,.s6,296644709917966)], + .ms2 .s6 .s7 [(.m0,72186316348,2047217204),(.m0,592573552,19954486),(.m0,35463088,853510),(.m0,2118244,1225120502)], + .ms [(.m12,.s7,555),(.m0,.s6,8305),(.m3,.s6,23),(.m21,.s3,23),(.m4,.s3,8305),(.m4,.s3,555)], + .ms2 .s3 .s0 [(.m13,1225120502,2118244),(.m1,853510,35463088),(.m1,19954486,592573552),(.m1,2047217204,72186316348)], + .ms [(.m16,.s3,296644709917966),(.m1,.s3,1215060610043912278),(.m1,.s3,4976888274252731682166),(.m1,.s3,140401799637343899114388462),(.m1,.s3,437282767112434)], + .ms2 .s3 .s0 [(.m4,3210488724839470,11342740193392),(.m1,13416404090422,188080912859248),(.m1,241050744520246,3114847722012784),(.m1,4279024377396790,51526413412466800),(.m1,75219789479411254,851444212363690096),(.m1,1311603022727478838,14055452962046607472),(.m1,22715030620549938744,15631994306602991626),(.m1,8917127262193582030,31345053406498652153)], + .ms [(.m26,.s7,31345053406498652158),(.m8,.s2,31345053406498652153)], + .m .m9, + .b 0 [[([63987143505680007164],[(.D7,31345053406498652158),(.D7,8917127262193582029),(.D16,15631994306602991626),(.D6,22715030620549938744),(.D16,14055452962046607472),(.D6,1311603022727478838),(.D16,851444212363690096),(.D6,75219789479411254),(.D16,51526413412466800),(.D6,4279024377396790),(.D16,3114847722012784),(.D6,241050744520246),(.D16,188080912859248),(.D6,13416404090422),(.D16,11342740193392),(.D6,3210488724839470),(.D16,437282767112434),(.D18,140401799637343899114388462),(.D18,4976888274252731682166),(.D18,1215060610043912278),(.D18,296644709917966),(.D18,72186316348),(.D6,2047217204),(.D16,592573552),(.D6,19954486),(.D16,35463088),(.D6,853510),(.D16,2118244),(.D6,1225120502),(.D12,555),(.D16,8305),(.D16,23),(.D12,3)])]], + .ms [(.m2,.s6,31993571752840003582)], + .ms2 .s6 .s7 [(.m3,23346660468288651262,6917529027641081806),(.m0,15132094747964866570,22590055730890407480),(.m0,14024209239631724656,1303792092123758134),(.m0,849491479712759920,74731606316678710),(.m0,51404367621783664,4248512929726006),(.m0,3107219860095088,239143779040822),(.m0,187604171489392,13297218747958),(.m0,11312943857776,3210481275755566)], + .ms [(.m0,.s6,437280904841458),(.m0,.s6,140401799637343898648820718),(.m0,.s6,4976888274252615290230),(.m0,.s6,1215060610014814294),(.m0,.s6,296644702643470)], + .ms2 .s6 .s7 [(.m0,72184497724,2046762548),(.m0,592459888,19926070),(.m0,35455984,851734),(.m0,2117800,1225120391)], + .ms [(.m3,.s6,529)], + .ms2 .s6 .s7 [(.m6,8297,22)], + .ms2 .s3 .s0 [(.m19,22,8297)], + .ms [(.m17,.s0,529)], + .ms2 .s3 .s0 [(.m4,1225120391,2117800),(.m1,851734,35455984),(.m1,19926070,592459888),(.m1,2046762548,72184497724)], + .ms [(.m16,.s3,296644702643470),(.m1,.s3,1215060610014814294),(.m1,.s3,4976888274252615290230),(.m1,.s3,140401799637343898648820718),(.m1,.s3,437280904841458)], + .ms2 .s3 .s0 [(.m4,3210481275755566,11312943857776),(.m1,13297218747958,187604171489392),(.m1,239143779040822,3107219860095088),(.m1,4248512929726006,51404367621783664),(.m1,74731606316678710,849491479712759920),(.m1,1303792092123758134,14024209239631724656),(.m1,22590055730890407480,15132094747964866570),(.m1,6917529027641081806,23346660468288651262)], + .ms [(.m1,.s3,31993571752840003576),(.m10,.s7,31993571752840003582),(.m8,.s2,31993571752840003577)], + .m .m9, + .b 0 [[([127974287011360014326,58798996734949195782],[(.D7,31993571752840003582),(.D17,23346660468288651262)]),([11673330234144325631],[(.D6,6917529027641081806),(.D16,15132094747964866570),(.D6,22590055730890407480),(.D16,14024209239631724656),(.D6,1303792092123758134),(.D16,849491479712759920),(.D6,74731606316678710),(.D16,51404367621783664),(.D6,4248512929726006),(.D16,3107219860095088),(.D6,239143779040822),(.D16,187604171489392),(.D6,13297218747958),(.D16,11312943857776),(.D6,3210481275755566),(.D16,437280904841458),(.D18,140401799637343898648820718),(.D18,4976888274252615290230),(.D18,1215060610014814294),(.D18,296644702643470),(.D18,72184497724),(.D6,2046762548),(.D16,592459888),(.D6,19926070),(.D16,35455984),(.D6,851734),(.D16,2117800),(.D6,1225120391),(.D6,529),(.D12,8297),(.D6,22),(.D16,4)])]], + .ms [(.m2,.s6,93386641873154605054),(.m3,.s6,8646911284551352318)], + .ms2 .s6 .s7 [(.m3,17509995351216488446,5458362748373041102),(.m0,14767303178147856394,22498857838436154936),(.m0,14001409766518161520,1298092223845367350),(.m0,848066512643162224,74375364549279286),(.m0,51315307179933808,4226247819263542),(.m0,3101653582479472,237752209636918),(.m0,187256279138416,13210245660214),(.m0,11291200585840,3210475839937582)], + .ms [(.m0,.s6,437279545886962),(.m0,.s6,140401799637343898309082094),(.m0,.s6,4976888274252530355574),(.m0,.s6,1215060609993580630),(.m0,.s6,296644697335054)], + .ms2 .s6 .s7 [(.m0,72183170620,2046430772),(.m0,592376944,19905334),(.m0,35450800,850438),(.m0,2117476,1225120310)], + .ms [(.m12,.s7,507),(.m0,.s6,8293),(.m3,.s6,20),(.m20,.s0,20),(.m1,.s3,8293),(.m4,.s3,507)], + .ms2 .s3 .s0 [(.m13,1225120310,2117476),(.m1,850438,35450800),(.m1,19905334,592376944),(.m1,2046430772,72183170620)], + .ms [(.m16,.s3,296644697335054),(.m1,.s3,1215060609993580630),(.m1,.s3,4976888274252530355574),(.m1,.s3,140401799637343898309082094),(.m1,.s3,437279545886962)], + .ms2 .s3 .s0 [(.m4,3210475839937582,11291200585840),(.m1,13210245660214,187256279138416),(.m1,237752209636918,3101653582479472),(.m1,4226247819263542,51315307179933808),(.m1,74375364549279286,848066512643162224),(.m1,1298092223845367350,14001409766518161520),(.m1,22498857838436154936,14767303178147856394),(.m1,5458362748373041102,17509995351216488446)], + .ms [(.m1,.s3,8646911284551352318),(.m4,.s3,93386641873154605048),(.m10,.s7,93386641873154605054),(.m8,.s2,93386641873154605049)], + .m .m9, + .b 0 [[([276701161105643274164],[(.D7,93386641873154605054)]), + ([34587645138205409270,17293822569102704639,8646911284551352320,4323455642275676160,2161727821137838080,1080863910568919040,540431955284459520,270215977642229760,135107988821114880,67553994410557440,33776997205278720,16888498602639360,8444249301319680,4222124650659840,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,8646911284551352318), + (.D16,17509995351216488446)]), + ([4323455642275676158],[(.D6,5458362748373041102), + (.D16,14767303178147856394), + (.D6,22498857838436154936), + (.D16,14001409766518161520), + (.D6,1298092223845367350), + (.D16,848066512643162224), + (.D6,74375364549279286), + (.D16,51315307179933808), + (.D6,4226247819263542), + (.D16,3101653582479472), + (.D6,237752209636918), + (.D16,187256279138416), + (.D6,13210245660214), + (.D16,11291200585840), + (.D6,3210475839937582), + (.D16,437279545886962), + (.D18,140401799637343898309082094), + (.D18,4976888274252530355574), + (.D18,1215060609993580630), + (.D18,296644697335054), + (.D18,72183170620), + (.D6,2046430772), + (.D16,592376944), + (.D6,19905334), + (.D16,35450800), + (.D6,850438), + (.D16,2117476), + (.D6,1225120310), + (.D12,507), + (.D16,8293), + (.D16,20), + (.D6,5)])]], + .ms [(.m2,.s6,138350580552821637082),(.m3,.s6,58798996734949195783),(.m14,.s5,58798996734949195783),(.m4,.s5,138350580552821637076)], + .m .m5, + .b 138350580552821637082 [[([23],[(.D16,58798996734949195783),(.D18,1),(.D15,15348267530078650365),(.D16,4917930793088581582)])]], + .ms [(.m2,.s6,138350580552821637094),(.m3,.s6,58798996734949195780),(.m7,.s5,58798996734949195780),(.m4,.s5,138350580552821637088)], + .m .m5, + .b 138350580552821637094 [[([7],[(.D16,58798996734949195780),(.D6,1)])]], + .ms [(.m2,.s6,138350580552821637098),(.m6,.s6,58798996734949195778),(.m15,.s5,58798996734949195778),(.m11,.s5,138350580552821637092)], + .m .m5, + .b 138350580552821637098 [[([5],[(.D12,58798996734949195778),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,138350580552821637101,58798996734949195779)], + .ms [(.m23,.s1,58798996734949195779),(.m22,.s4,138350580552821637095)], + .m .m24, + .b 138350580552821637101 [[([17],[(.D6,58798996734949195779),(.D6,2)])]], + .ms [(.m2,.s6,138350580552821637110),(.m6,.s6,58798996734949195775),(.m14,.s5,58798996734949195775),(.m11,.s5,138350580552821637104)], + .m .m5, + .b 138350580552821637110 [[([23],[(.D12,58798996734949195775),(.D18,1),(.D17,15348267530078650364),(.D17,4917930793088581582),(.D15,14632195189326741514),(.D17,22465080841230876216),(.D15,13992965517216841840),(.D17,1295981161520037430),(.D15,847538747061829744),(.D17,74243423153946166),(.D15,51282321831100528),(.D17,4218001482055222),(.D15,3099591998177392),(.D17,237236813561398),(.D15,187127430119536),(.D17,13178033405494),(.D15,11283147522160),(.D17,3210473826671662),(.D15,437279042570482),(.D21,140401799637343898183252974),(.D21,4976888274252498898294),(.D21,1215060609985716310),(.D21,296644695368974),(.D21,72182679100),(.D17,2046307892),(.D15,592346224),(.D17,19897654),(.D15,35448880),(.D17,849958),(.D15,2117356),(.D17,1225120280),(.D11,499),(.D6,8292)])]], + .ms [(.m2,.s6,138350580552821637122),(.m6,.s6,58798996734949195772),(.m7,.s5,58798996734949195772),(.m11,.s5,138350580552821637116)], + .m .m5, + .b 138350580552821637122 [[([235195986939796783089,117597993469898391549,20752587082923245577],[(.D12,58798996734949195772),(.D8,15348267530078650364),(.D6,4917930793088581582),(.D16,14632195189326741514)]),([1459166279268040703],[(.D6,22465080841230876216),(.D16,13992965517216841840),(.D6,1295981161520037430),(.D16,847538747061829744),(.D6,74243423153946166),(.D16,51282321831100528),(.D6,4218001482055222),(.D16,3099591998177392),(.D6,237236813561398),(.D16,187127430119536),(.D6,13178033405494),(.D16,11283147522160),(.D6,3210473826671662),(.D16,437279042570482),(.D18,140401799637343898183252974),(.D18,4976888274252498898294),(.D18,1215060609985716310),(.D18,296644695368974),(.D18,72182679100),(.D6,2046307892),(.D16,592346224),(.D6,19897654),(.D16,35448880),(.D6,849958),(.D16,2117356),(.D6,1225120280),(.D12,500),(.D7,8291),(.D8,19),(.D7,4)])]], + .ms [(.m2,.s6,325123864299130847230)], + .ms2 .s6 .s7 [(.m3,12105675798371893246,3674937295934324734)], + .ms [(.m3,.s6,1999598234552500174)], + .ms2 .s6 .s7 [(.m3,13902612049692721162,22282685056322371128),(.m0,13947366570989715568,1284581424963255862),(.m0,844688812922634352,73530939619147318),(.m0,51104200947400816,4173471261130294),(.m0,3088459442946160,234453674753590),(.m0,186431645417584,13004087230006),(.m0,11239660978288,3210462955035694)], + .ms [(.m0,.s6,437276324661490),(.m0,.s6,140401799637343897503775726),(.m0,.s6,4976888274252329028982),(.m0,.s6,1215060609943248982),(.m0,.s6,296644684752142)], + .ms2 .s6 .s7 [(.m0,72180024892,2045644340),(.m0,592180336,19856182),(.m0,35438512,847366),(.m0,2116708,1225120118)], + .ms [(.m12,.s7,459),(.m0,.s6,8281),(.m3,.s6,17),(.m21,.s3,17),(.m4,.s3,8281),(.m4,.s3,459)], + .ms2 .s3 .s0 [(.m13,1225120118,2116708),(.m1,847366,35438512),(.m1,19856182,592180336),(.m1,2045644340,72180024892)], + .ms [(.m16,.s3,296644684752142),(.m1,.s3,1215060609943248982),(.m1,.s3,4976888274252329028982),(.m1,.s3,140401799637343897503775726),(.m1,.s3,437276324661490)], + .ms2 .s3 .s0 [(.m4,3210462955035694,11239660978288),(.m1,13004087230006,186431645417584),(.m1,234453674753590,3088459442946160),(.m1,4173471261130294,51104200947400816),(.m1,73530939619147318,844688812922634352),(.m1,1284581424963255862,13947366570989715568),(.m1,22282685056322371128,13902612049692721162),(.m1,1999598234552500174,3674937295934324734)], + .ms [(.m4,.s3,12105675798371893246),(.m4,.s3,325123864299130847224),(.m10,.s7,325123864299130847230),(.m8,.s2,325123864299130847225)], + .m .m9, + .b 0 [[([387381625547900583860],[(.D7,325123864299130847230)]), + ([48422703193487572982,24211351596743786495,12105675798371893248,6052837899185946624,3026418949592973312,1513209474796486656,756604737398243328,378302368699121664,189151184349560832,94575592174780416,47287796087390208,23643898043695104,11821949021847552,5910974510923776,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,12105675798371893246), + (.D6,3674937295934324734), + (.D6,1999598234552500174)]), + ([1513209474796486655],[(.D16,13902612049692721162), + (.D6,22282685056322371128), + (.D16,13947366570989715568), + (.D6,1284581424963255862), + (.D16,844688812922634352), + (.D6,73530939619147318), + (.D16,51104200947400816), + (.D6,4173471261130294), + (.D16,3088459442946160), + (.D6,234453674753590), + (.D16,186431645417584), + (.D6,13004087230006), + (.D16,11239660978288), + (.D6,3210462955035694), + (.D16,437276324661490), + (.D18,140401799637343897503775726), + (.D18,4976888274252329028982), + (.D18,1215060609943248982), + (.D18,296644684752142), + (.D18,72180024892), + (.D6,2045644340), + (.D16,592180336), + (.D6,19856182), + (.D16,35438512), + (.D6,847366), + (.D16,2116708), + (.D6,1225120118), + (.D12,459), + (.D16,8281), + (.D16,17), + (.D12,3)])], + [([8],[(.D15,276701161105643274247), + (.D21,0), + (.D19,648518346341351421)])]], + .ms [(.m2,.s6,193690812773950291934),(.m6,.s6,276701161105643274245),(.m7,.s5,276701161105643274245),(.m11,.s5,193690812773950291928)], + .m .m5, + .b 193690812773950291934 [[([41],[(.D12,276701161105643274245),(.D8,1),(.D7,648518346341351420)])],[([15564440312192434054],[(.D17,276701161105643274241),(.D2,648518346341351418)])]], + .ms [(.m2,.s6,201473032930046508982),(.m3,.s6,274755606066619219984),(.m27,.s2,274755606066619219984),(.m1,.s5,201473032930046508976)], + .m .m5, + .b 201473032930046508982 [[([7],[(.D16,274755606066619219984), + (.D6,1)])], + [([16],[(.D11,274755606066619219982), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,274755606066619219981), + (.D17,1), + (.D15,0), + (.D6,1242993497154256846)])], + [([16],[(.D11,274755606066619219979), + (.D3,0)])], + [([8],[(.D15,274755606066619219978), + (.D17,1), + (.D21,1242993497154256845), + (.D15,13713460865343160330), + (.D17,22235397260234980920), + (.D15,13935544621967868016), + (.D17,1281625937707793974), + (.D15,843949941108768880), + (.D17,73346221665680950), + (.D15,51058021459034224), + (.D17,4161926389038646), + (.D15,3085573224923248), + (.D17,233732120247862), + (.D15,186251256791152), + (.D17,12958990073398), + (.D15,11228386689136), + (.D17,3210460136463406), + (.D15,437275620018418), + (.D21,140401799637343897327614958), + (.D21,4976888274252284988790), + (.D21,1215060609932238934), + (.D21,296644681999630), + (.D21,72179336764), + (.D17,2045472308), + (.D15,592137328), + (.D17,19845430), + (.D15,35435824), + (.D17,846694), + (.D15,2116540), + (.D17,1225120076), + (.D11,448), + (.D12,8278)])], + [([18],[(.D11,274755606066619219976), + (.D13,0), + (.D16,1242993497154256845), + (.D16,13713460865343160330)])], + [([39775791908936219076],[(.D17,274755606066619219975)]), + ([4971973988617027387,2485986994308513695,1242993497154256848,621496748577128424,310748374288564212,155374187144282103,77687093572141053,38843546786070528,19421773393035264,9710886696517632,4855443348258816,2427721674129408,1213860837064704,606930418532352,303465209266176,151732604633088,75866302316544,37933151158272,18966575579136,9483287789568,4741643894784,2370821947392,1185410973696,592705486848,296352743424,148176371712,74088185856,37044092928,18522046464,9261023232,4630511616,2315255808,1157627904,578813952,289406976,144703488,72351744,36175872,18087936,9043968,4521984,2260992,1130496,565248,282624,141312,70656,35328,17664,8832,4416,2208,1104,552,276,135,69,36,15,9,3],[(.D12,1242993497154256846), + (.D17,13713460865343160330)]), + ([621496748577128423],[(.D6,22235397260234980920), + (.D16,13935544621967868016), + (.D6,1281625937707793974), + (.D16,843949941108768880), + (.D6,73346221665680950), + (.D16,51058021459034224), + (.D6,4161926389038646), + (.D16,3085573224923248), + (.D6,233732120247862), + (.D16,186251256791152), + (.D6,12958990073398), + (.D16,11228386689136), + (.D6,3210460136463406), + (.D16,437275620018418), + (.D18,140401799637343897327614958), + (.D18,4976888274252284988790), + (.D18,1215060609932238934), + (.D18,296644681999630), + (.D18,72179336764), + (.D6,2045472308), + (.D16,592137328), + (.D6,19845430), + (.D16,35435824), + (.D6,846694), + (.D16,2116540), + (.D6,1225120076), + (.D12,449), + (.D13,8278), + (.D9,16), + (.D13,3)])], + [([10],[(.D17,269783632078002192591), + (.D21,0), + (.D19,13402712491054596118)])]], + .ms [(.m2,.s6,221360928884514618562),(.m3,.s6,269783632078002192589),(.m7,.s5,269783632078002192589),(.m4,.s5,221360928884514618556)], + .m .m5, + .b 221360928884514618562 [[([43],[(.D16,269783632078002192589),(.D8,1),(.D7,13402712491054596117)])],[([321665099785310306778],[(.D11,269783632078002192582),(.D2,13402712491054596115)])]], + .ms2 .s6 .s7 [(.m2,382193478777169771973,229575494604838404237)], + .ms [(.m29,.s2,229575494604838404237),(.m4,.s5,382193478777169771967)], + .m .m5, + .b 382193478777169771973 [[([9],[(.D6,229575494604838404237),(.D6,1)])],[([20],[(.D15,229575494604838404235),(.D13,0),(.D10,22157710166662839866),(.D9,13916122848574832752)])],[([36],[(.D11,229575494604838404231)]),([7,2],[(.D12,1),(.D6,22157710166662839866)])]], + .ms [(.m2,.s6,382193478777169772006),(.m6,.s6,229575494604838404227),(.m15,.s5,229575494604838404227),(.m11,.s5,382193478777169772000)], + .m .m5, + .b 382193478777169772006 [[([5],[(.D12,229575494604838404227),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,382193478777169772009,229575494604838404228)], + .ms [(.m23,.s1,229575494604838404228),(.m22,.s4,382193478777169772003)], + .m .m24, + .b 382193478777169772009 [[([17],[(.D6,229575494604838404228),(.D6,2)])],[([6],[(.D11,229575494604838404224),(.D21,0),(.D7,22157710166662839864)])]], + .ms2 .s6 .s7 [(.m2,382193478777169772021,229575494604838404225)], + .ms2 .s5 .s2 [(.m28,229575494604838404225,382193478777169772016)], + .m .m18, + .b 382193478777169772021 [[([45],[(.D6,229575494604838404225),(.D8,1),(.D17,22157710166662839863),(.D10,13916122848574832751)])],[([36],[(.D15,229575494604838404218)]),([7,2],[(.D12,1),(.D17,22157710166662839862)]),([1],[(.D11,13916122848574832751),(.D16,1276770494359535158)])],[([8],[(.D15,229575494604838404214),(.D21,0),(.D17,22157710166662839861),(.D12,13916122848574832752)])]], + .ms [(.m2,.s6,382193478777169772066),(.m6,.s6,229575494604838404212),(.m7,.s5,229575494604838404212),(.m11,.s5,382193478777169772060)], + .m .m5, + .b 382193478777169772066 [[([39],[(.D12,229575494604838404212),(.D8,22157710166662839862),(.D13,13916122848574832752),(.D17,1276770494359535158),(.D15,842736080271704176),(.D17,73042756456414774),(.D15,50982155156717680),(.D17,4142959813459510),(.D15,3080831581028464),(.D17,232546709274166),(.D15,185954904047728),(.D17,12884901887542),(.D15,11209864642672),(.D17,3210455505951790),(.D15,437274462390514),(.D21,140401799637343897038207982),(.D21,4976888274252212637046),(.D21,1215060609914150998),(.D21,296644677477646),(.D21,72178206268),(.D17,2045189684),(.D15,592066672),(.D17,19827766),(.D15,35431408),(.D17,845590),(.D15,2116264),(.D17,1225120007),(.D17,433),(.D11,8273),(.D17,16),(.D15,3)])]], + .ms [(.m2,.s6,382193478777169772086)], + .ms2 .s6 .s7 [(.m3,229575494604838404208,22157710166662839862),(.m0,13916122848574832752,1276770494359535158),(.m0,842736080271704176,73042756456414774),(.m0,50982155156717680,4142959813459510),(.m0,3080831581028464,232546709274166),(.m0,185954904047728,12884901887542),(.m0,11209864642672,3210455505951790)], + .ms [(.m0,.s6,437274462390514),(.m0,.s6,140401799637343897038207982),(.m0,.s6,4976888274252212637046),(.m0,.s6,1215060609914150998),(.m0,.s6,296644677477646)], + .ms2 .s6 .s7 [(.m0,72178206268,2045189684),(.m0,592066672,19827766),(.m0,35431408,845590),(.m0,2116264,1225120007)], + .ms [(.m3,.s6,433)], + .ms2 .s6 .s7 [(.m6,8273,16)], + .ms2 .s3 .s0 [(.m19,16,8273)], + .ms [(.m17,.s0,433)], + .ms2 .s3 .s0 [(.m4,1225120007,2116264),(.m1,845590,35431408),(.m1,19827766,592066672),(.m1,2045189684,72178206268)], + .ms [(.m16,.s3,296644677477646),(.m1,.s3,1215060609914150998),(.m1,.s3,4976888274252212637046),(.m1,.s3,140401799637343897038207982),(.m1,.s3,437274462390514)], + .ms2 .s3 .s0 [(.m4,3210455505951790,11209864642672),(.m1,12884901887542,185954904047728),(.m1,232546709274166,3080831581028464),(.m1,4142959813459510,50982155156717680),(.m1,73042756456414774,842736080271704176),(.m1,1276770494359535158,13916122848574832752),(.m1,22157710166662839862,229575494604838404208)], + .ms [(.m1,.s3,382193478777169772080),(.m10,.s7,382193478777169772086),(.m8,.s2,382193478777169772081)], + .m .m9, + .b 0 [[([11673330234144325628],[(.D7,382193478777169772086),(.D17,229575494604838404208),(.D6,22157710166662839862),(.D16,13916122848574832752),(.D6,1276770494359535158),(.D16,842736080271704176),(.D6,73042756456414774),(.D16,50982155156717680),(.D6,4142959813459510),(.D16,3080831581028464),(.D6,232546709274166),(.D16,185954904047728),(.D6,12884901887542),(.D16,11209864642672),(.D6,3210455505951790),(.D16,437274462390514),(.D18,140401799637343897038207982),(.D18,4976888274252212637046),(.D18,1215060609914150998),(.D18,296644677477646),(.D18,72178206268),(.D6,2045189684),(.D16,592066672),(.D6,19827766),(.D16,35431408),(.D6,845590),(.D16,2116264),(.D6,1225120007),(.D6,433),(.D12,8273),(.D6,16),(.D16,4)])]], + .ms [(.m2,.s6,5836665117072162814),(.m3,.s6,380734312497901731382)], + .ms2 .s6 .s7 [(.m3,229210703035021394032,22066512274208587318),(.m0,13893323375461269616,1271070626081144374),(.m0,841311113202106480,72686514689015350),(.m0,50893094714867824,4120694702997046),(.m0,3075265303412848,231155139870262),(.m0,185607011696752,12797928799798),(.m0,11188121370736,3210450070133806)], + .ms [(.m0,.s6,437273103436018),(.m0,.s6,140401799637343896698469358),(.m0,.s6,4976888274252127702390),(.m0,.s6,1215060609892917334),(.m0,.s6,296644672169230)], + .ms2 .s6 .s7 [(.m0,72176879164,2044857908),(.m0,591983728,19807030),(.m0,35426224,844294),(.m0,2115940,1225119926)], + .ms [(.m12,.s7,411),(.m0,.s6,8269),(.m3,.s6,14),(.m20,.s0,14),(.m1,.s3,8269),(.m4,.s3,411)], + .ms2 .s3 .s0 [(.m13,1225119926,2115940),(.m1,844294,35426224),(.m1,19807030,591983728),(.m1,2044857908,72176879164)], + .ms [(.m16,.s3,296644672169230),(.m1,.s3,1215060609892917334),(.m1,.s3,4976888274252127702390),(.m1,.s3,140401799637343896698469358),(.m1,.s3,437273103436018)], + .ms2 .s3 .s0 [(.m4,3210450070133806,11188121370736),(.m1,12797928799798,185607011696752),(.m1,231155139870262,3075265303412848),(.m1,4120694702997046,50893094714867824),(.m1,72686514689015350,841311113202106480),(.m1,1271070626081144374,13893323375461269616),(.m1,22066512274208587318,229210703035021394032)], + .ms [(.m1,.s3,380734312497901731382),(.m4,.s3,5836665117072162808),(.m10,.s7,5836665117072162814),(.m8,.s2,5836665117072162809)], + .m .m9, + .b 0 [[([23346660468288651254,11673330234144325629,5836665117072162816,2918332558536081408,1459166279268040704,729583139634020352,364791569817010176,182395784908505088,91197892454252544,45598946227126272,22799473113563136,11399736556781568,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D7,5836665117072162814), + (.D17,380734312497901731382)]), + ([2918332558536081406],[(.D16,229210703035021394032), + (.D6,22066512274208587318), + (.D16,13893323375461269616), + (.D6,1271070626081144374), + (.D16,841311113202106480), + (.D6,72686514689015350), + (.D16,50893094714867824), + (.D6,4120694702997046), + (.D16,3075265303412848), + (.D6,231155139870262), + (.D16,185607011696752), + (.D6,12797928799798), + (.D16,11188121370736), + (.D6,3210450070133806), + (.D16,437273103436018), + (.D18,140401799637343896698469358), + (.D18,4976888274252127702390), + (.D18,1215060609892917334), + (.D18,296644672169230), + (.D18,72176879164), + (.D6,2044857908), + (.D16,591983728), + (.D6,19807030), + (.D16,35426224), + (.D6,844294), + (.D16,2115940), + (.D6,1225119926), + (.D12,411), + (.D16,8269), + (.D16,14), + (.D6,5)])]], + .ms [(.m2,.s6,23346660468288651253),(.m14,.s5,23346660468288651247)], + .m .m5, + .b 23346660468288651253 [[([5],[(.D18,1),(.D15,379275146218633690677),(.D14,228845911465204383856)])]], + .ms [(.m2,.s6,23346660468288651256),(.m7,.s5,23346660468288651250)], + .m .m5, + .b 23346660468288651256 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,23346660468288651257),(.m15,.s5,23346660468288651251)], + .m .m5, + .b 23346660468288651257 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,23346660468288651258),(.m25,.s2,23346660468288651253)], + .m .m18, + .b 23346660468288651258 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,23346660468288651260),(.m14,.s5,23346660468288651254)], + .m .m93, + ] (by decide +kernel) +theorem chunk_45_step : (cfg_45.denote) [qi]⊢* (cfg_46.denote) := + step_chunk [ + .m .m94, + .b 23346660468288651260 [[([5],[(.D18,1),(.D17,379275146218633690676),(.D15,228845911465204383856),(.D17,21975314381754334774),(.D15,13870523902347706480),(.D17,1265370757802753590),(.D15,839886146132508784),(.D17,72330272921615926),(.D15,50804034273017968),(.D17,4098429592534582),(.D15,3069699025797232),(.D17,229763570466358),(.D15,185259119345776),(.D17,12710955712054),(.D15,11166378098800),(.D17,3210444634315822),(.D15,437271744481522),(.D21,140401799637343896358730734),(.D21,4976888274252042767734),(.D21,1215060609871683670),(.D21,296644666860814),(.D21,72175552060),(.D17,2044526132),(.D15,591900784),(.D17,19786294),(.D15,35421040),(.D17,842998),(.D15,2115616),(.D17,1225119845),(.D17,392),(.D8,8263)])]], + .ms [(.m2,.s6,23346660468288651263),(.m7,.s5,23346660468288651257)], + .m .m5, + .b 23346660468288651263 [[([15996785876420001789],[(.D8,379275146218633690676),(.D16,228845911465204383856),(.D6,21975314381754334774),(.D16,13870523902347706480),(.D6,1265370757802753590),(.D16,839886146132508784),(.D6,72330272921615926),(.D16,50804034273017968),(.D6,4098429592534582),(.D16,3069699025797232),(.D6,229763570466358),(.D16,185259119345776),(.D6,12710955712054),(.D16,11166378098800),(.D6,3210444634315822),(.D16,437271744481522),(.D18,140401799637343896358730734),(.D18,4976888274252042767734),(.D18,1215060609871683670),(.D18,296644666860814),(.D18,72175552060),(.D6,2044526132),(.D16,591900784),(.D6,19786294),(.D16,35421040),(.D6,842998),(.D16,2115616),(.D6,1225119845),(.D6,393),(.D9,8263),(.D14,12),(.D8,3)])]], + .ms2 .s6 .s7 [(.m2,31345053406498652158,377275547984081190454),(.m0,228346011906566258800,21850339492094803510),(.m0,13839280179932823664,1257559827199032886),(.m0,837933413481578608,71842089758883382),(.m0,50681988482334832,4067918144863798),(.m0,3062071163879536,227856604986934),(.m0,184782377975920,12591770369590),(.m0,11136581763184,3210437185231918)], + .ms [(.m0,.s6,437269882210546),(.m0,.s6,140401799637343895893162990),(.m0,.s6,4976888274251926375798),(.m0,.s6,1215060609842585686),(.m0,.s6,296644659586318)], + .ms2 .s6 .s7 [(.m0,72173733436,2044071476),(.m0,591787120,19757878),(.m0,35413936,841222),(.m0,2115172,1225119734)], + .ms [(.m12,.s7,363)], + .ms2 .s6 .s12 [(.m0,8257,6)], + .s2 .s6 .s7 [(11,1)], + .s2 .s12 .s6 [(6,2)], + .ms2 .s3 .s0 [(.m103,3,1)], + .s2 .s8 .s3 [(2,11),(2,8257)], + .ms [(.m4,.s3,363)], + .ms2 .s3 .s0 [(.m13,1225119734,2115172),(.m1,841222,35413936),(.m1,19757878,591787120),(.m1,2044071476,72173733436)], + .ms [(.m16,.s3,296644659586318),(.m1,.s3,1215060609842585686),(.m1,.s3,4976888274251926375798),(.m1,.s3,140401799637343895893162990),(.m1,.s3,437269882210546)], + .ms2 .s3 .s0 [(.m4,3210437185231918,11136581763184),(.m1,12591770369590,184782377975920),(.m1,227856604986934,3062071163879536),(.m1,4067918144863798,50681988482334832),(.m1,71842089758883382,837933413481578608),(.m1,1257559827199032886,13839280179932823664),(.m1,21850339492094803510,228346011906566258800),(.m1,377275547984081190454,31345053406498652153)], + .ms [(.m26,.s7,31345053406498652158),(.m8,.s2,31345053406498652153)], + .m .m9, + .b 0 [[([63987143505680007164],[(.D7,31345053406498652158),(.D7,377275547984081190453),(.D16,228346011906566258800),(.D6,21850339492094803510),(.D16,13839280179932823664),(.D6,1257559827199032886),(.D16,837933413481578608),(.D6,71842089758883382),(.D16,50681988482334832),(.D6,4067918144863798),(.D16,3062071163879536),(.D6,227856604986934),(.D16,184782377975920),(.D6,12591770369590),(.D16,11136581763184),(.D6,3210437185231918),(.D16,437269882210546),(.D18,140401799637343895893162990),(.D18,4976888274251926375798),(.D18,1215060609842585686),(.D18,296644659586318),(.D18,72173733436),(.D6,2044071476),(.D16,591787120),(.D6,19757878),(.D16,35413936),(.D6,841222),(.D16,2115172),(.D6,1225119734),(.D12,363),(.D16,8257),(.D16,11),(.D12,3)])]], + .ms [(.m2,.s6,31993571752840003582)], + .ms2 .s6 .s7 [(.m3,23346660468288651262,375275949749528690230),(.m0,227846112347928133744,21725364602435272246),(.m0,13808036457517940848,1249748896595312182),(.m0,835980680830648432,71353906596150838),(.m0,50559942691651696,4037406697193014),(.m0,3054443301961840,225949639507510),(.m0,184305636606064,12472585027126),(.m0,11106785427568,3210429736148014)], + .ms [(.m0,.s6,437268019939570),(.m0,.s6,140401799637343895427595246),(.m0,.s6,4976888274251809983862),(.m0,.s6,1215060609813487702),(.m0,.s6,296644652311822)], + .ms2 .s6 .s7 [(.m0,72171914812,2043616820),(.m0,591673456,19729462),(.m0,35406832,839446),(.m0,2114728,1225119623)], + .ms [(.m3,.s6,337)], + .ms2 .s6 .s7 [(.m6,8249,10)], + .s2 .s12 .s6 [(9,3)], + .ms2 .s3 .s8 [(.m103,4,2)], + .s2 .s3 .s0 [(10,8249)], + .ms [(.m17,.s0,337)], + .ms2 .s3 .s0 [(.m4,1225119623,2114728),(.m1,839446,35406832),(.m1,19729462,591673456),(.m1,2043616820,72171914812)], + .ms [(.m16,.s3,296644652311822),(.m1,.s3,1215060609813487702),(.m1,.s3,4976888274251809983862),(.m1,.s3,140401799637343895427595246),(.m1,.s3,437268019939570)], + .ms2 .s3 .s0 [(.m4,3210429736148014,11106785427568),(.m1,12472585027126,184305636606064),(.m1,225949639507510,3054443301961840),(.m1,4037406697193014,50559942691651696),(.m1,71353906596150838,835980680830648432),(.m1,1249748896595312182,13808036457517940848),(.m1,21725364602435272246,227846112347928133744),(.m1,375275949749528690230,23346660468288651262)], + .ms [(.m1,.s3,31993571752840003576),(.m10,.s7,31993571752840003582),(.m8,.s2,31993571752840003577)], + .m .m9, + .b 0 [[([127974287011360014326,58798996734949195782],[(.D7,31993571752840003582),(.D17,23346660468288651262)]),([11673330234144325631],[(.D6,375275949749528690230),(.D16,227846112347928133744),(.D6,21725364602435272246),(.D16,13808036457517940848),(.D6,1249748896595312182),(.D16,835980680830648432),(.D6,71353906596150838),(.D16,50559942691651696),(.D6,4037406697193014),(.D16,3054443301961840),(.D6,225949639507510),(.D16,184305636606064),(.D6,12472585027126),(.D16,11106785427568),(.D6,3210429736148014),(.D16,437268019939570),(.D18,140401799637343895427595246),(.D18,4976888274251809983862),(.D18,1215060609813487702),(.D18,296644652311822),(.D18,72171914812),(.D6,2043616820),(.D16,591673456),(.D6,19729462),(.D16,35406832),(.D6,839446),(.D16,2114728),(.D6,1225119623),(.D6,337),(.D12,8249),(.D6,10),(.D16,4)])]], + .ms [(.m2,.s6,93386641873154605054),(.m3,.s6,8646911284551352318)], + .ms2 .s6 .s7 [(.m3,17509995351216488446,373816783470260649526),(.m0,227481320778111123568,21634166709981019702),(.m0,13785236984404377712,1244049028316921398),(.m0,834555713761050736,70997664828751414),(.m0,50470882249801840,4015141586730550),(.m0,3048877024346224,224558070103606),(.m0,183957744255088,12385611939382),(.m0,11085042155632,3210424300330030)], + .ms [(.m0,.s6,437266660985074),(.m0,.s6,140401799637343895087856622),(.m0,.s6,4976888274251725049206),(.m0,.s6,1215060609792254038),(.m0,.s6,296644647003406)], + .ms2 .s6 .s7 [(.m0,72170587708,2043285044),(.m0,591590512,19708726),(.m0,35401648,838150),(.m0,2114404,1225119542)], + .ms [(.m12,.s7,315)], + .ms2 .s6 .s12 [(.m0,8245,6)], + .s2 .s6 .s7 [(8,4)], + .s .s12 3, + .ms2 .s3 .s0 [(.m103,5,8)], + .s2 .s8 .s3 [(3,8245)], + .ms [(.m4,.s3,315)], + .ms2 .s3 .s0 [(.m13,1225119542,2114404),(.m1,838150,35401648),(.m1,19708726,591590512),(.m1,2043285044,72170587708)], + .ms [(.m16,.s3,296644647003406),(.m1,.s3,1215060609792254038),(.m1,.s3,4976888274251725049206),(.m1,.s3,140401799637343895087856622),(.m1,.s3,437266660985074)], + .ms2 .s3 .s0 [(.m4,3210424300330030,11085042155632),(.m1,12385611939382,183957744255088),(.m1,224558070103606,3048877024346224),(.m1,4015141586730550,50470882249801840),(.m1,70997664828751414,834555713761050736),(.m1,1244049028316921398,13785236984404377712),(.m1,21634166709981019702,227481320778111123568),(.m1,373816783470260649526,17509995351216488446)], + .ms [(.m1,.s3,8646911284551352318),(.m4,.s3,93386641873154605048),(.m10,.s7,93386641873154605054),(.m8,.s2,93386641873154605049)], + .m .m9, + .b 0 [[([276701161105643274164],[(.D7,93386641873154605054)]), + ([34587645138205409270,17293822569102704639,8646911284551352320,4323455642275676160,2161727821137838080,1080863910568919040,540431955284459520,270215977642229760,135107988821114880,67553994410557440,33776997205278720,16888498602639360,8444249301319680,4222124650659840,2111062325329920,1055531162664960,527765581332480,263882790666240,131941395333120,65970697666560,32985348833280,16492674416640,8246337208320,4123168604160,2061584302080,1030792151040,515396075520,257698037760,128849018880,64424509440,32212254720,16106127360,8053063680,4026531840,2013265920,1006632960,503316480,251658240,125829120,62914560,31457280,15728640,7864320,3932160,1966080,983040,491520,245760,122880,61440,30720,15360,7680,3840,1920,960,480,240,120,60,27,12,9,3],[(.D17,8646911284551352318), + (.D16,17509995351216488446)]), + ([4323455642275676158],[(.D6,373816783470260649526), + (.D16,227481320778111123568), + (.D6,21634166709981019702), + (.D16,13785236984404377712), + (.D6,1244049028316921398), + (.D16,834555713761050736), + (.D6,70997664828751414), + (.D16,50470882249801840), + (.D6,4015141586730550), + (.D16,3048877024346224), + (.D6,224558070103606), + (.D16,183957744255088), + (.D6,12385611939382), + (.D16,11085042155632), + (.D6,3210424300330030), + (.D16,437266660985074), + (.D18,140401799637343895087856622), + (.D18,4976888274251725049206), + (.D18,1215060609792254038), + (.D18,296644647003406), + (.D18,72170587708), + (.D6,2043285044), + (.D16,591590512), + (.D6,19708726), + (.D16,35401648), + (.D6,838150), + (.D16,2114404), + (.D6,1225119542), + (.D12,315), + (.D16,8245), + (.D16,8), + (.D6,5)])]], + .ms [(.m2,.s6,138350580552821637082),(.m3,.s6,58798996734949195783),(.m14,.s5,58798996734949195783),(.m4,.s5,138350580552821637076)], + .m .m5, + .b 138350580552821637082 [[([23],[(.D16,58798996734949195783),(.D18,1),(.D15,15348267530078650365),(.D16,373276351514976190006)])]], + .ms [(.m2,.s6,138350580552821637094),(.m3,.s6,58798996734949195780),(.m7,.s5,58798996734949195780),(.m4,.s5,138350580552821637088)], + .m .m5, + .b 138350580552821637094 [[([7],[(.D16,58798996734949195780),(.D6,1)])]], + .ms [(.m2,.s6,138350580552821637098),(.m6,.s6,58798996734949195778),(.m15,.s5,58798996734949195778),(.m11,.s5,138350580552821637092)], + .m .m5, + .b 138350580552821637098 [[([5],[(.D12,58798996734949195778),(.D16,1)])]], + .ms2 .s6 .s7 [(.m2,138350580552821637101,58798996734949195779)], + .ms [(.m23,.s1,58798996734949195779),(.m22,.s4,138350580552821637095)], + .m .m24, + .b 138350580552821637101 [[([17],[(.D6,58798996734949195779),(.D6,2)])]], + .ms [(.m2,.s6,138350580552821637110),(.m6,.s6,58798996734949195775),(.m14,.s5,58798996734949195775),(.m11,.s5,138350580552821637104)], + .m .m5, + .b 138350580552821637110 [[([23],[(.D12,58798996734949195775),(.D18,1),(.D17,15348267530078650364),(.D17,373276351514976190006),(.D15,227346212789290008688),(.D17,21600389712775740982),(.D15,13776792735103058032),(.D17,1241937965991591478),(.D15,834027948179718256),(.D17,70865723433418294),(.D15,50437896900968560),(.D17,4006895249522230),(.D15,3046815440044144),(.D17,224042674028086),(.D15,183828895236208),(.D17,12353399684662),(.D15,11076989091952),(.D17,3210422287064110),(.D15,437266157668594),(.D21,140401799637343894962027502),(.D21,4976888274251693591926),(.D21,1215060609784389718),(.D21,296644645037326),(.D21,72170096188),(.D17,2043162164),(.D15,591559792),(.D17,19701046),(.D15,35399728),(.D17,837670),(.D15,2114284),(.D17,1225119512),(.D11,307),(.D6,8244)])]], + .ms [(.m2,.s6,138350580552821637122),(.m6,.s6,58798996734949195772),(.m7,.s5,58798996734949195772),(.m11,.s5,138350580552821637116)], + .m .m5, + .b 138350580552821637122 [[([235195986939796783089,117597993469898391549,20752587082923245577],[(.D12,58798996734949195772),(.D8,15348267530078650364),(.D6,373276351514976190006)]),([5836665117072162815],[(.D16,227346212789290008688),(.D6,21600389712775740982),(.D16,13776792735103058032),(.D6,1241937965991591478),(.D16,834027948179718256),(.D6,70865723433418294),(.D16,50437896900968560),(.D6,4006895249522230),(.D16,3046815440044144),(.D6,224042674028086),(.D16,183828895236208),(.D6,12353399684662),(.D16,11076989091952),(.D6,3210422287064110),(.D16,437266157668594),(.D18,140401799637343894962027502),(.D18,4976888274251693591926),(.D18,1215060609784389718),(.D18,296644645037326),(.D18,72170096188),(.D6,2043162164),(.D16,591559792),(.D6,19701046),(.D16,35399728),(.D6,837670),(.D16,2114284),(.D6,1225119512),(.D12,308),(.D7,8243),(.D8,7),(.D7,4)])]], + .ms [(.m2,.s6,325123864299130847230)], + .ms2 .s6 .s7 [(.m3,12105675798371893246,3674937295934324734)], + .ms [(.m3,.s6,370358018956440108598)], + .ms2 .s6 .s7 [(.m3,226616629649655988336,21417993927867235894),(.m0,13731193788875931760,1230538229434809910),(.m0,831178014040522864,70153239898619446),(.m0,50259776017268848,3962365028597302),(.m0,3035682884812912,221259535220278),(.m0,183133110534256,12179453509174),(.m0,11033502548080,3210411415428142)], + .ms [(.m0,.s6,437263439759602),(.m0,.s6,140401799637343894282550254),(.m0,.s6,4976888274251523722614),(.m0,.s6,1215060609741922390),(.m0,.s6,296644634420494)], + .ms2 .s6 .s7 [(.m0,72167441980,2042498612),(.m0,591393904,19659574),(.m0,35389360,835078),(.m0,2113636,1225119350)], + .ms [(.m12,.s7,267)], + .ms2 .s6 .s12 [(.m0,8233,6)], + .s2 .s6 .s7 [(5,1)], + .s2 .s12 .s6 [(6,2)], + .ms2 .s3 .s0 [(.m103,3,1)], + .s2 .s8 .s3 [(2,5),(2,8233)], + .ms [(.m4,.s3,267)], + .ms2 .s3 .s0 [(.m13,1225119350,2113636),(.m1,835078,35389360),(.m1,19659574,591393904),(.m1,2042498612,72167441980)], + .ms [(.m16,.s3,296644634420494),(.m1,.s3,1215060609741922390),(.m1,.s3,4976888274251523722614),(.m1,.s3,140401799637343894282550254),(.m1,.s3,437263439759602)], + .ms2 .s3 .s0 [(.m4,3210411415428142,11033502548080),(.m1,12179453509174,183133110534256),(.m1,221259535220278,3035682884812912),(.m1,3962365028597302,50259776017268848),(.m1,70153239898619446,831178014040522864),(.m1,1230538229434809910,13731193788875931760),(.m1,21417993927867235894,226616629649655988336),(.m1,370358018956440108598,3674937295934324734)], + .ms [(.m4,.s3,12105675798371893246),(.m4,.s3,325123864299130847224),(.m10,.s7,325123864299130847230),(.m8,.s2,325123864299130847225)], + .m .m9, + .b 0 [[([387381625547900583860],[(.D7,325123864299130847230)]), + ([48422703193487572982,24211351596743786495,12105675798371893248,6052837899185946624,3026418949592973312,1513209474796486656,756604737398243328,378302368699121664,189151184349560832,94575592174780416,47287796087390208,23643898043695104,11821949021847552,5910974510923776,2955487255461888,1477743627730944,738871813865472,369435906932736,184717953466368,92358976733184,46179488366592,23089744183296,11544872091648,5772436045824,2886218022912,1443109011456,721554505728,360777252864,180388626432,90194313216,45097156608,22548578304,11274289152,5637144576,2818572288,1409286144,704643072,352321536,176160768,88080384,44040192,22020096,11010048,5505024,2752512,1376256,688128,344064,172032,86016,43008,21504,10752,5376,2688,1344,672,336,168,84,39,21,12,3],[(.D17,12105675798371893246), + (.D6,3674937295934324734), + (.D6,370358018956440108598)]), + ([1513209474796486655],[(.D16,226616629649655988336), + (.D6,21417993927867235894), + (.D16,13731193788875931760), + (.D6,1230538229434809910), + (.D16,831178014040522864), + (.D6,70153239898619446), + (.D16,50259776017268848), + (.D6,3962365028597302), + (.D16,3035682884812912), + (.D6,221259535220278), + (.D16,183133110534256), + (.D6,12179453509174), + (.D16,11033502548080), + (.D6,3210411415428142), + (.D16,437263439759602), + (.D18,140401799637343894282550254), + (.D18,4976888274251523722614), + (.D18,1215060609741922390), + (.D18,296644634420494), + (.D18,72167441980), + (.D6,2042498612), + (.D16,591393904), + (.D6,19659574), + (.D16,35389360), + (.D6,835078), + (.D16,2113636), + (.D6,1225119350), + (.D12,267), + (.D16,8233), + (.D16,5), + (.D12,3)])], + [([8],[(.D15,276701161105643274247), + (.D21,0), + (.D19,648518346341351421)])]], + .ms [(.m2,.s6,193690812773950291934),(.m6,.s6,276701161105643274245),(.m7,.s5,276701161105643274245),(.m11,.s5,193690812773950291928)], + .m .m5, + .b 193690812773950291934 [[([41],[(.D12,276701161105643274245),(.D8,1),(.D7,648518346341351420)])],[([15564440312192434054],[(.D17,276701161105643274241),(.D2,648518346341351418)])]], + .ms [(.m2,.s6,201473032930046508982),(.m3,.s6,274755606066619219984),(.m27,.s2,274755606066619219984),(.m1,.s5,201473032930046508976)], + .m .m5, + .b 201473032930046508982 [[([7],[(.D16,274755606066619219984), + (.D6,1)])], + [([16],[(.D11,274755606066619219982), + (.D13,0), + (.D6,1)])], + [([8],[(.D15,274755606066619219981), + (.D17,1), + (.D15,0), + (.D6,369601414219041865270)])], + [([16],[(.D11,274755606066619219979), + (.D3,0)])], + [([8],[(.D15,274755606066619219978), + (.D17,1), + (.D21,369601414219041865269), + (.D15,226427478465306427504), + (.D17,21370706131779845686), + (.D15,13719371839854084208), + (.D17,1227582742179348022), + (.D15,830439142226657392), + (.D17,69968521945153078), + (.D15,50213596528902256), + (.D17,3950820156505654), + (.D15,3032796666790000), + (.D17,220537980714550), + (.D15,182952721907824), + (.D17,12134356352566), + (.D15,11022228258928), + (.D17,3210408596855854), + (.D15,437262735116530), + (.D21,140401799637343894106389486), + (.D21,4976888274251479682422), + (.D21,1215060609730912342), + (.D21,296644631667982), + (.D21,72166753852), + (.D17,2042326580), + (.D15,591350896), + (.D17,19648822), + (.D15,35386672), + (.D17,834406), + (.D15,2113468), + (.D17,1225119308), + (.D11,256), + (.D12,8230)])], + [([18],[(.D11,274755606066619219976), + (.D13,0), + (.D16,369601414219041865269), + (.D16,226427478465306427504)])], + [([39775791908936220646],[(.D17,274755606066619219975), + (.D12,369601414219041865270), + (.D17,226427478465306427504), + (.D6,21370706131779845686), + (.D16,13719371839854084208), + (.D6,1227582742179348022), + (.D16,830439142226657392), + (.D6,69968521945153078), + (.D16,50213596528902256), + (.D6,3950820156505654), + (.D16,3032796666790000), + (.D6,220537980714550), + (.D16,182952721907824), + (.D6,12134356352566), + (.D16,11022228258928), + (.D6,3210408596855854), + (.D16,437262735116530), + (.D18,140401799637343894106389486), + (.D18,4976888274251479682422), + (.D18,1215060609730912342), + (.D18,296644631667982), + (.D18,72166753852), + (.D6,2042326580), + (.D16,591350896), + (.D6,19648822), + (.D16,35386672), + (.D6,834406), + (.D16,2113468), + (.D6,1225119308), + (.D12,257), + (.D13,8230), + (.D9,4), + (.D13,3)])]], + .ms [(.m2,.s6,221360928884514619342)], + .ms2 .s6 .s7 [(.m3,269783632078002192394,368358420721887608376),(.m0,226116730091017863280,21293019038207704630),(.m0,13699950066461048944,1222727298831089206),(.m0,829225281389592688,69665056735886902),(.m0,50137730226585712,3931853580926518),(.m0,3028055022895216,219352569740854),(.m0,182656369164400,12060268166710),(.m0,11003706212464,3210403966344238)], + .ms [(.m0,.s6,437261577488626),(.m0,.s6,140401799637343893816982510),(.m0,.s6,4976888274251407330678),(.m0,.s6,1215060609712824406),(.m0,.s6,296644627145998)], + .ms2 .s6 .s7 [(.m0,72165623356,2042043956),(.m0,591280240,19631158),(.m0,35382256,833302),(.m0,2113192,1225119239)], + .ms [(.m3,.s6,241)], + .ms2 .s6 .s7 [(.m6,8225,4)], + .s2 .s12 .s6 [(9,3)], + .ms2 .s3 .s8 [(.m103,4,2)], + .s2 .s3 .s0 [(4,8225)], + .ms [(.m17,.s0,241)], + .ms2 .s3 .s0 [(.m4,1225119239,2113192),(.m1,833302,35382256),(.m1,19631158,591280240),(.m1,2042043956,72165623356)], + .ms [(.m16,.s3,296644627145998),(.m1,.s3,1215060609712824406),(.m1,.s3,4976888274251407330678),(.m1,.s3,140401799637343893816982510),(.m1,.s3,437261577488626)], + .ms2 .s3 .s0 [(.m4,3210403966344238,11003706212464),(.m1,12060268166710,182656369164400),(.m1,219352569740854,3028055022895216),(.m1,3931853580926518,50137730226585712),(.m1,69665056735886902,829225281389592688),(.m1,1222727298831089206,13699950066461048944),(.m1,21293019038207704630,226116730091017863280),(.m1,368358420721887608376,269783632078002192394)], + .ms [(.m1,.s3,221360928884514619336),(.m10,.s7,221360928884514619342),(.m8,.s2,221360928884514619337)], + .m .m9, + .b 0 [[([186773283746309210108],[(.D7,221360928884514619342),(.D17,269783632078002192394),(.D6,368358420721887608376),(.D16,226116730091017863280),(.D6,21293019038207704630),(.D16,13699950066461048944),(.D6,1222727298831089206),(.D16,829225281389592688),(.D6,69665056735886902),(.D16,50137730226585712),(.D6,3931853580926518),(.D16,3028055022895216),(.D6,219352569740854),(.D16,182656369164400),(.D6,12060268166710),(.D16,11003706212464),(.D6,3210403966344238),(.D16,437261577488626),(.D18,140401799637343893816982510),(.D18,4976888274251407330678),(.D18,1215060609712824406),(.D18,296644627145998),(.D18,72165623356),(.D6,2042043956),(.D16,591280240),(.D6,19631158),(.D16,35382256),(.D6,833302),(.D16,2113192),(.D6,1225119239),(.D6,241),(.D12,8225),(.D6,4),(.D16,4)])]], + .ms [(.m2,.s6,93386641873154605054),(.m3,.s6,198014268416225968078)], + .ms2 .s6 .s7 [(.m3,263946966960930029578,366899254442619567672),(.m0,225751938521200853104,21201821145753452086),(.m0,13677150593347485808,1217027430552698422),(.m0,827800314319994992,69308814968487478),(.m0,50048669784735856,3909588470464054),(.m0,3022488745279600,217961000336950),(.m0,182308476813424,11973295078966),(.m0,10981962940528,3210398530526254)], + .ms [(.m0,.s6,437260218534130),(.m0,.s6,140401799637343893477243886),(.m0,.s6,4976888274251322396022),(.m0,.s6,1215060609691590742),(.m0,.s6,296644621837582)], + .ms2 .s6 .s7 [(.m0,72164296252,2041712180),(.m0,591197296,19610422),(.m0,35377072,832006),(.m0,2112868,1225119158)], + .ms [(.m12,.s7,219)], + .ms2 .s6 .s12 [(.m0,8221,6)], + .s2 .s6 .s7 [(2,4)], + .s .s12 3, + .ms2 .s3 .s0 [(.m103,5,2)], + .s2 .s8 .s3 [(3,8221)], + .ms [(.m4,.s3,219)], + .ms2 .s3 .s0 [(.m13,1225119158,2112868),(.m1,832006,35377072),(.m1,19610422,591197296),(.m1,2041712180,72164296252)], + .ms [(.m16,.s3,296644621837582),(.m1,.s3,1215060609691590742),(.m1,.s3,4976888274251322396022),(.m1,.s3,140401799637343893477243886),(.m1,.s3,437260218534130)], + .ms2 .s3 .s0 [(.m4,3210398530526254,10981962940528),(.m1,11973295078966,182308476813424),(.m1,217961000336950,3022488745279600),(.m1,3909588470464054,50048669784735856),(.m1,69308814968487478,827800314319994992),(.m1,1217027430552698422,13677150593347485808),(.m1,21201821145753452086,225751938521200853104),(.m1,366899254442619567672,263946966960930029578)], + .ms [(.m1,.s3,198014268416225968078),(.m4,.s3,93386641873154605048),(.m10,.s7,93386641873154605054),(.m8,.s2,93386641873154605049)], + .m .m9, + .b 0 [[([373546567492618420214,186773283746309210109],[(.D7,93386641873154605054), + (.D17,198014268416225968078)]), + ([35019990702432976895],[(.D16,263946966960930029578), + (.D6,366899254442619567672), + (.D16,225751938521200853104), + (.D6,21201821145753452086), + (.D16,13677150593347485808), + (.D6,1217027430552698422), + (.D16,827800314319994992), + (.D6,69308814968487478), + (.D16,50048669784735856), + (.D6,3909588470464054), + (.D16,3022488745279600), + (.D6,217961000336950), + (.D16,182308476813424), + (.D6,11973295078966), + (.D16,10981962940528), + (.D6,3210398530526254), + (.D16,437260218534130), + (.D18,140401799637343893477243886), + (.D18,4976888274251322396022), + (.D18,1215060609691590742), + (.D18,296644621837582), + (.D18,72164296252), + (.D6,2041712180), + (.D16,591197296), + (.D6,19610422), + (.D16,35377072), + (.D6,832006), + (.D16,2112868), + (.D6,1225119158), + (.D12,219), + (.D16,8221)]), + ([5,2],[(.D16,2), + (.D6,5)])], + [([93386641873154605056,46693320936577302528,23346660468288651264,11673330234144325632,5836665117072162816,2918332558536081408,1459166279268040704,729583139634020352,364791569817010176,182395784908505088,91197892454252544,45598946227126272,22799473113563136,11399736556781568,5699868278390784,2849934139195392,1424967069597696,712483534798848,356241767399424,178120883699712,89060441849856,44530220924928,22265110462464,11132555231232,5566277615616,2783138807808,1391569403904,695784701952,347892350976,173946175488,86973087744,43486543872,21743271936,10871635968,5435817984,2717908992,1358954496,679477248,339738624,169869312,84934656,42467328,21233664,10616832,5308416,2654208,1327104,663552,331776,165888,82944,41472,20736,10368,5184,2592,1296,648,324,159,81,39,21,12,3],[(.D6,23346660468288651264), + (.D14,180504273065009479630)]), + ([11673330234144325631],[(.D15,259569468123125907466), + (.D17,365804879733168537144), + (.D15,225478344843838095472), + (.D17,21133422726412762678), + (.D15,13660050988512313456), + (.D17,1212752529343905334), + (.D15,826731589017796720), + (.D17,69041633642937910), + (.D15,49981874453348464), + (.D17,3892889637617206), + (.D15,3018314037067888), + (.D17,216917323284022), + (.D15,182047557550192), + (.D17,11908065263158), + (.D15,10965655486576), + (.D17,3210394453662766), + (.D15,437259199318258), + (.D21,140401799637343893222439918), + (.D21,4976888274251258695030), + (.D21,1215060609675665494), + (.D21,296644617856270), + (.D21,72163300924), + (.D17,2041463348), + (.D15,591135088), + (.D17,19594870), + (.D15,35373184), + (.D17,831034), + (.D15,2112625), + (.D11,1225119095), + (.D12,204), + (.D10,8216), + (.D1,4)])]], + .ms [(.m2,.s6,373546567492618420213),(.m14,.s5,373546567492618420207)], + .m .m5, + .b 373546567492618420213 [[([5],[(.D18,1),(.D15,174667607947937316813),(.D14,258110301843857866762)])]], + .ms [(.m2,.s6,373546567492618420216),(.m7,.s5,373546567492618420210)], + .m .m5, + .b 373546567492618420216 [[([1],[(.D6,1)])]], + .ms [(.m2,.s6,373546567492618420217),(.m15,.s5,373546567492618420211)], + .m .m5, + .b 373546567492618420217 [[([1],[(.D16,1)])]], + .ms [(.m2,.s6,373546567492618420218),(.m25,.s2,373546567492618420213)], + .m .m18, + .b 373546567492618420218 [[([3],[(.D6,2)])]], + .ms [(.m2,.s6,373546567492618420220),(.m14,.s5,373546567492618420214)], + .m .m5, + .b 373546567492618420220 [[([5],[(.D18,1),(.D17,174667607947937316812),(.D15,258110301843857866762),(.D17,365440088163351526968),(.D15,225387146951383842928),(.D17,21110623253299199542),(.D15,13654351120233922672),(.D17,1211327562274307638),(.D15,826375347250397296),(.D17,68952573201088054),(.D15,49959609342886000),(.D17,3887323360001590),(.D15,3016922467663984),(.D17,216569430933046),(.D15,181960584462448),(.D17,11886321991222),(.D15,10960219668592),(.D17,3210393094708270),(.D15,437258859579634),(.D21,140401799637343893137505262),(.D21,4976888274251237461366),(.D21,1215060609670357078),(.D21,296644616529166),(.D21,72162969148),(.D17,2041380404),(.D15,591114352),(.D17,19589686),(.D15,35371888),(.D17,830710),(.D15,2112544),(.D17,1225119077),(.D17,200),(.D8,8215)])]], + .ms [(.m2,.s6,373546567492618420223),(.m7,.s5,373546567492618420217)], + .m .m5, + .b 373546567492618420223 [[([401216683603182747645],[(.D8,174667607947937316812),(.D16,258110301843857866762),(.D6,365440088163351526968),(.D16,225387146951383842928),(.D6,21110623253299199542),(.D16,13654351120233922672),(.D6,1211327562274307638),(.D16,826375347250397296),(.D6,68952573201088054),(.D16,49959609342886000),(.D6,3887323360001590),(.D16,3016922467663984),(.D6,216569430933046),(.D16,181960584462448),(.D6,11886321991222),(.D16,10960219668592),(.D6,3210393094708270),(.D16,437258859579634),(.D18,140401799637343893137505262),(.D18,4976888274251237461366),(.D18,1215060609670357078),(.D18,296644616529166),(.D18,72162969148),(.D6,2041380404),(.D16,591114352),(.D6,19589686),(.D16,35371888),(.D6,830710),(.D16,2112544),(.D6,1225119077),(.D6,201),(.D9,8215),(.D4,3)])]], + .ms2 .s6 .s7 [(.m2,574154909294209794046,124515522497539473358),(.m0,245572280481258405898,362305582822701661752),(.m0,224603520616221376624,20914716669508582966),(.m0,13605374474286268528,1199083400787394102),(.m0,823314306878668912,68187313108155958),(.m0,49768294319652976,3839494604193334),(.m0,3004965278711920,213580133695030),(.m0,181213260152944,11699490913846),(.m0,10913511899248,3210381417765934)], + .ms [(.m0,.s6,437255940344050),(.m0,.s6,140401799637343892407696366),(.m0,.s6,4976888274251055009142),(.m0,.s6,1215060609624744022),(.m0,.s6,296644605125902)], + .ms2 .s6 .s7 [(.m0,72160118332,2040667700),(.m0,590936176,19545142),(.m0,35360752,827926),(.m0,2111848,1225118903)], + .ms [(.m3,.s6,157),(.m6,.s6,8204),(.m27,.s2,8204),(.m33,.s2,157)], + .ms2 .s5 .s2 [(.m4,1225118903,2111848),(.m1,827926,35360752),(.m1,19545142,590936176),(.m1,2040667700,72160118332)], + .ms [(.m16,.s5,296644605125902),(.m1,.s5,1215060609624744022),(.m1,.s5,4976888274251055009142),(.m1,.s5,140401799637343892407696366),(.m1,.s5,437255940344050)], + .ms2 .s5 .s2 [(.m4,3210381417765934,10913511899248),(.m1,11699490913846,181213260152944),(.m1,213580133695030,3004965278711920),(.m1,3839494604193334,49768294319652976),(.m1,68187313108155958,823314306878668912),(.m1,1199083400787394102,13605374474286268528),(.m1,20914716669508582966,224603520616221376624),(.m1,362305582822701661752,245572280481258405898),(.m1,124515522497539473358,574154909294209794041)], + .m .m18, + .b 574154909294209794046 [[([27670116110564327423],[(.D6,124515522497539473358), + (.D16,245572280481258405898), + (.D6,362305582822701661752), + (.D16,224603520616221376624), + (.D6,20914716669508582966), + (.D16,13605374474286268528), + (.D6,1199083400787394102), + (.D16,823314306878668912), + (.D6,68187313108155958), + (.D16,49768294319652976), + (.D6,3839494604193334), + (.D16,3004965278711920), + (.D6,213580133695030), + (.D16,181213260152944), + (.D6,11699490913846), + (.D16,10913511899248), + (.D6,3210381417765934), + (.D16,437255940344050), + (.D18,140401799637343892407696366), + (.D18,4976888274251055009142), + (.D18,1215060609624744022), + (.D18,296644605125902), + (.D18,72160118332), + (.D6,2040667700), + (.D16,590936176), + (.D6,19545142), + (.D16,35360752), + (.D6,827926), + (.D16,2111848), + (.D6,1225118903), + (.D6,157), + (.D12,8204), + (.D6,1)])], + [([83010348331692982272],[(.D17,121056757983718932430), + (.D15,244707589352803270666), + (.D17,362089410040587877944), + (.D15,224549477420692930672), + (.D17,20901205870626471478), + (.D15,13601996774565740656), + (.D17,1198238975857262134), + (.D15,823103200646135920), + (.D17,68134536550022710), + (.D15,49755100180119664), + (.D17,3836196069310006), + (.D15,3004140644991088), + (.D17,213373975264822), + (.D15,181161720545392), + (.D17,11686606011958), + (.D15,10910290673776), + (.D17,3210380612459566), + (.D15,437255739017458), + (.D21,140401799637343892357364718), + (.D21,4976888274251042426230), + (.D21,1215060609621598294), + (.D21,296644604339470), + (.D21,72159921724), + (.D17,2040618548), + (.D15,590923888), + (.D17,19542070), + (.D15,35359984), + (.D17,827734), + (.D15,2111800), + (.D17,1225118891), + (.D17,154), + (.D17,8205), + (.D13,0), + (.D16,0)])]], + .ms2 .s6 .s7 [(.m2,629495141515338448894,110680464442257309646),(.m0,242113515967437864970,361440891694246526520),(.m0,224387347834107592816,20860673473980137014),(.m0,13591863675404157040,1195705701066866230),(.m0,822469881948536944,67976206875622966),(.m0,49715517761519728,3826300464660022),(.m0,3001666743828592,212755499974198),(.m0,181007101722736,11647951306294),(.m0,10900626997360,3210378196540462)], + .ms [(.m0,.s6,437255135037682),(.m0,.s6,140401799637343892206369774),(.m0,.s6,4976888274251004677494),(.m0,.s6,1215060609612161110),(.m0,.s6,296644601980174)], + .ms2 .s6 .s7 [(.m0,72159331900,2040471092),(.m0,590887024,19532854),(.m0,35357680,827158),(.m0,2111656,1225118855)], + .ms [(.m3,.s6,145),(.m6,.s6,8201)], + .m .m95, + ] (by decide +kernel) +theorem glider_final : qJ cfg_46 = true := by decide +kernel +theorem init_eq_cfg_0 : cfg_0.denote = init [] := rfl +theorem tm17_nonhalt : IsDoesNotHalt qi := by + rcases qa5 glider_final with ⟨l, hglider⟩ + apply qB (l := l) + rw [← init_eq_cfg_0, ← hglider] + refine q1 chunk_0_step ?_ + refine q1 chunk_1_step ?_ + refine q1 chunk_2_step ?_ + refine q1 chunk_3_step ?_ + refine q1 chunk_4_step ?_ + refine q1 chunk_5_step ?_ + refine q1 chunk_6_step ?_ + refine q1 chunk_7_step ?_ + refine q1 chunk_8_step ?_ + refine q1 chunk_9_step ?_ + refine q1 chunk_10_step ?_ + refine q1 chunk_11_step ?_ + refine q1 chunk_12_step ?_ + refine q1 chunk_13_step ?_ + refine q1 chunk_14_step ?_ + refine q1 chunk_15_step ?_ + refine q1 chunk_16_step ?_ + refine q1 chunk_17_step ?_ + refine q1 chunk_18_step ?_ + refine q1 chunk_19_step ?_ + refine q1 chunk_20_step ?_ + refine q1 chunk_21_step ?_ + refine q1 chunk_22_step ?_ + refine q1 chunk_23_step ?_ + refine q1 chunk_24_step ?_ + refine q1 chunk_25_step ?_ + refine q1 chunk_26_step ?_ + refine q1 chunk_27_step ?_ + refine q1 chunk_28_step ?_ + refine q1 chunk_29_step ?_ + refine q1 chunk_30_step ?_ + refine q1 chunk_31_step ?_ + refine q1 chunk_32_step ?_ + refine q1 chunk_33_step ?_ + refine q1 chunk_34_step ?_ + refine q1 chunk_35_step ?_ + refine q1 chunk_36_step ?_ + refine q1 chunk_37_step ?_ + refine q1 chunk_38_step ?_ + refine q1 chunk_39_step ?_ + refine q1 chunk_40_step ?_ + refine q1 chunk_41_step ?_ + refine q1 chunk_42_step ?_ + refine q1 chunk_43_step ?_ + refine q1 chunk_44_step ?_ + refine q1 chunk_45_step ?_ + exact ⟨0, rfl⟩ +theorem target_tm_is_nonhalt : + IsDoesNotHalt target_tm_alias := + qI tm17_nonhalt + + + +theorem is_does_not_halt : IsNotHalt target_tm := target_tm_is_nonhalt + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1RE_1LC1RB_1RA0LD_1RC0LB_0RFHHH_0LD1RA diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RE_1LC1RD_1LD0LC_1RA0RF_0RDHHH_0RD0LB.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RE_1LC1RD_1LD0LC_1RA0RF_0RDHHH_0RD0LB.lean new file mode 100644 index 00000000..1c72cce6 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RE_1LC1RD_1LD0LC_1RA0RF_0RDHHH_0RD0LB.lean @@ -0,0 +1,532 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1RE_1LC1RD_1LD0LC_1RA0RF_0RDHHH_0RD0LB + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RE_1LC1RD_1LD0LC_1RA0RF_0RDHHH_0RD0LB" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +set_option maxRecDepth 2000000 +set_option maxHeartbeats 20000000 + +theorem _jb_zero_cons_default : ((0 : Fin 2) >> (default : ListBlank (Fin 2))) = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +theorem _jb_default_head_zero : (default : ListBlank (Fin 2)).head = (0 : Fin 2) := rfl +theorem _jb_default_tail_eq : (default : ListBlank (Fin 2)).tail = default := rfl +theorem _jb_init_nil_cfg : (init [] : Cfg (Fin 2) (Fin 6)) = ⟨some 0, ⟨0, default, default⟩⟩ := by + ext <;> rfl +theorem _jb_mk_nil : (Turing.ListBlank.mk ([] : List (Fin 2))) = default := rfl +theorem _jb_mk_cons (a : Fin 2) (l : List (Fin 2)) : Turing.ListBlank.mk (a :: l) = a >> Turing.ListBlank.mk l := rfl +theorem _jb_head_append_cons (a : Fin 2) (l : List (Fin 2)) (s : ListBlank (Fin 2)) : ((a :: l) +> s).head = a := by + simp [Turing.ListBlank.head_cons] +theorem _jb_tail_append_cons (a : Fin 2) (l : List (Fin 2)) (s : ListBlank (Fin 2)) : ((a :: l) +> s).tail = l +> s := by + simp [Turing.ListBlank.tail_cons] + + +-- ============================================================================ +-- Wave 25 Standalone verified Canonical Proof Library for holdout_0756 (1RB---_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC) +-- Cluster: Untouched 12/12 & 11/12 Septet IV (0220..0766) | Donor: holdout_0220 (1RB0RA_1LC0LF_1LE0LD_1LB---_1RA1LB_0LB0RC) +-- S_6 x Z_2 Isomorphism: 11/12 match | perm = (E,B,C,A,D,F) | mirror = 1 +-- Differing transition(s): D.F0=0LB vs M.F0=0RA +-- ============================================================================ + +set_option maxHeartbeats 20000000 +set_option maxRecDepth 2000000 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem pow_zero_list (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +omit [Inhabited Γ] in +@[simp] +theorem list_pow_append_one (u : List (Fin 2)) (k : Nat) : + u^k ++ u = u^(k + 1) := by + have h := list_pow_add_comm u k 1 + dsimp [HPow.hPow] at h ⊢ + rw [List.append_nil] at h + exact h + +theorem pow_add_append_right (u : List (Fin 2)) (m n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (m + n)) +> r = (u ^ m) +> ((u ^ n) +> r) := by + rw [list_pow_add, ← listblank_append_append] + +theorem pow_succ_append_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (n + 1)) +> r = u +> ((u ^ n) +> r) := by + rw [pow_succ_list, ← listblank_append_append] + +theorem pow_succ_append_right' (u : List (Fin 2)) (k : Nat) (r : ListBlank (Fin 2)) : + (u ^ k) +> (u +> r) = (u ^ (k + 1)) +> r := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (m n : Nat) : + s <+ (u ^ (m + n)) = (s <+ (u ^ m)) <+ (u ^ n) := by + rw [listblank_append_append, ← list_pow_add, add_comm] + +theorem pow_succ_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k : Nat) : + (s <+ u) <+ (u ^ k) = s <+ (u ^ (k + 1)) := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add3_append_right (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) (r : ListBlank (Fin 2)) : + (u ^ (k₁ + k₂ + k₃)) +> r = (u ^ k₁) +> ((u ^ k₂) +> ((u ^ k₃) +> r)) := by + rw [pow_add_append_right u (k₁ + k₂) k₃ r, pow_add_append_right u k₁ k₂ ((u ^ k₃) +> r)] + +theorem pow_add3_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) : + s <+ (u ^ (k₁ + k₂ + k₃)) = ((s <+ (u ^ k₁)) <+ (u ^ k₂)) <+ (u ^ k₃) := by + rw [pow_add_append_left s u (k₁ + k₂) k₃, pow_add_append_left s u k₁ k₂] + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, _, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +theorem step_some {c c' : Cfg (Fin 2) (Fin 6)} (h : step target_tm c = some c') : + c [target_tm]⊢⁺ c' := ⟨1, Nat.zero_lt_one, h⟩ + +theorem stepPlus_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := step_stepStar_stepPlus h1 (stepPlus_stepStar h2) + +theorem stepStar_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢* c₃ := stepStar_trans (step_stepStar target_tm c₁ c₂ h1) h2 + +theorem stepPlus_stepStar_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢⁺ c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepPlus_stepStar_stepPlus h1 h2 + +theorem stepStar_stepPlus_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢* c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepStar_stepPlus_stepPlus h1 h2 + +theorem stepPlus_of_step {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢ c₂) : + c₁ [target_tm]⊢⁺ c₂ := step_stepPlus target_tm c₁ c₂ h + +theorem stepStar_of_stepPlus {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢⁺ c₂) : + c₁ [target_tm]⊢* c₂ := stepPlus_stepStar h + +local macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +local macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail]) +local macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step))) +local macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +theorem multiStep_step_isSome {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₀ cfg cfg' : Cfg Γ Λ) (n m : Nat) + (hn : multiStep M c₀ n = some cfg) + (hnm : multiStep M c₀ (n + (1 + m)) = some cfg') : + (step M cfg).isSome := by + rw [multiStep_add M c₀ n (1 + m), hn] at hnm + dsimp [Option.bind] at hnm + rw [multiStep_add M cfg 1 m, multiStep_one] at hnm + cases hs : step M cfg with + | none => + rw [hs] at hnm + nomatch hnm + | some c₁ => rfl + +theorem inv_reaches_beyond {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') + (N : Nat) : + ∃ (m : Nat) (cfg' : Cfg Γ Λ), multiStep M (init []) (N + m) = some cfg' ∧ Inv cfg' := by + induction N with + | zero => + obtain ⟨cfg₀, ⟨n₀, hn₀⟩, h_inv₀⟩ := h_init + refine ⟨n₀, cfg₀, ?_, h_inv₀⟩ + rwa [Nat.zero_add] + | succ N ih => + obtain ⟨m, cfg₁, hm, h_inv₁⟩ := ih + cases m with + | zero => + obtain ⟨cfg₂, ⟨k, hk_pos, hk⟩, h_inv₂⟩ := h_step cfg₁ h_inv₁ + cases k with + | zero => omega + | succ k' => + refine ⟨k', cfg₂, ?_, h_inv₂⟩ + have h_trans := multiStep_trans M (init []) cfg₁ cfg₂ N (k' + 1) hm hk + have h_eq : (N + 1) + k' = N + (k' + 1) := by omega + rwa [h_eq] + | succ m' => + refine ⟨m', cfg₁, ?_, h_inv₁⟩ + have h_eq : (N + 1) + m' = N + (m' + 1) := by omega + rwa [h_eq] + +theorem closed_inv_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') : + IsDoesNotHalt M := by + intro cfg ⟨n, hn⟩ + obtain ⟨m, cfg', hnm, _⟩ := inv_reaches_beyond M Inv h_init h_step (n + 1) + have h_eq : (n + 1) + m = n + (1 + m) := by omega + rw [h_eq] at hnm + exact multiStep_step_isSome M (init []) cfg cfg' n m hn hnm + +theorem closed_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) + (n₀ : Nat) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, ∃ n', (hub n) [M]⊢⁺ (hub n')) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hcfg⟩ + subst hcfg + obtain ⟨n', hn'⟩ := h_step n + exact ⟨hub n', hn', ⟨n', rfl⟩⟩ + +theorem closed_guarded_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) (P : Nat → Prop) + (n₀ : Nat) (h_P₀ : P n₀) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, P n → ∃ n', P n' ∧ ((hub n) [M]⊢⁺ (hub n'))) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, P n ∧ cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, h_P₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hPn, hcfg⟩ + subst hcfg + obtain ⟨n', hPn', hn'⟩ := h_step n hPn + exact ⟨hub n', hn', ⟨n', hPn', rfl⟩⟩ + + +def QINIT : Fin 6 := 0 +def B : Fin 6 := 3 +def E : Fin 6 := 2 +abbrev holdout_0786_tm : Machine (Fin 2) (Fin 6) := target_tm +abbrev M : Machine (Fin 2) (Fin 6) := target_tm + +theorem rule_B_000 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 0, 0] +> r)) [target_tm]⊢⁺ (l <{{E}} ([0, 0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_001 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 0, 1] +> r)) [target_tm]⊢⁺ ((l <+ [1, 1, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_010 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 1, 0] +> r)) [target_tm]⊢⁺ ((l <+ [0, 1, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_10 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([1, 0] +> r)) [target_tm]⊢⁺ ((l <+ [0, 0]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_111 (l r : ListBlank (Fin 2)) : + ((l <+ [1, 1, 1]) <{{E}} r) [target_tm]⊢⁺ (l <{{E}} ([0, 0, 0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_011 (l r : ListBlank (Fin 2)) : + ((l <+ [0, 1, 1]) <{{E}} r) [target_tm]⊢⁺ (l <{{E}} ([0, 1, 0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_00 (l r : ListBlank (Fin 2)) : + ((l <+ [0, 0]) <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ ((l <+ [0, 1, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_nil (r : ListBlank (Fin 2)) : + (default <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ ((default <+ [0, 1, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +def Round (r r' : ListBlank (Fin 2)) : Prop := + ∀ l : ListBlank (Fin 2), (l {{B}}> r) [target_tm]⊢⁺ (l <{{E}} r') + +inductive Sweeps : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) → Prop + | zero (r : ListBlank (Fin 2)) : Sweeps 0 r r + | succ {n : Nat} {r r₁ r₂ : ListBlank (Fin 2)} : + Round r r₁ → Sweeps n r₁ r₂ → Sweeps (n + 1) r r₂ + +theorem Sweeps.trans {a b : Nat} {r₁ r₂ r₃ : ListBlank (Fin 2)} + (h₁ : Sweeps a r₁ r₂) (h₂ : Sweeps b r₂ r₃) : Sweeps (a + b) r₁ r₃ := by + induction h₁ with + | zero _ => simpa using h₂ + | succ hr _ ih => + rw [Nat.succ_add] + exact Sweeps.succ hr (ih h₂) + +theorem sweeps_split_last {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps (n + 1) r r') : + ∃ r₁ : ListBlank (Fin 2), Sweeps n r r₁ ∧ Round r₁ r' := by + induction n generalizing r with + | zero => + cases h with + | succ hr h0 => + cases h0 with + | zero _ => exact ⟨r, Sweeps.zero r, hr⟩ + | succ m ih => + cases h with + | succ hr hs => + obtain ⟨r₁, hs₁, hr₁⟩ := ih hs + exact ⟨r₁, Sweeps.succ hr hs₁, hr₁⟩ + +theorem round_000 (r : ListBlank (Fin 2)) : + Round ([0, 0, 0] +> r) ([0, 0, 1] +> r) := + fun l => rule_B_000 l r + +theorem round_001 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 0, 1] +> r) ([0, 0, 0] +> r') := + fun l => stepPlus_trans (rule_B_001 l r) (stepPlus_trans (h (l <+ [1, 1, 1])) (rule_E_111 l r')) + +theorem round_010 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 1, 0] +> r) ([0, 1, 0] +> r') := + fun l => stepPlus_trans (rule_B_010 l r) (stepPlus_trans (h (l <+ [0, 1, 1])) (rule_E_011 l r')) + +theorem round_10 {r₁ r r₂ : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Round r r₂) : + Round ([1, 0] +> r₁) ([0, 1, 0] +> r₂) := + fun l => stepPlus_trans (rule_B_10 l r₁) + (stepPlus_trans (h₁ (l <+ [0, 0])) + (stepPlus_trans (rule_E_00 l r) + (stepPlus_trans (h₂ (l <+ [0, 1, 1])) (rule_E_011 l r₂)))) + +theorem sweeps_010 {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps n r r') : + Sweeps n ([0, 1, 0] +> r) ([0, 1, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | succ hr _ ih => exact Sweeps.succ (round_010 hr) ih + +theorem sweeps_10 {n : Nat} {r₁ r r' : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Sweeps (n + 1) r r') : + Sweeps (n + 1) ([1, 0] +> r₁) ([0, 1, 0] +> r') := by + cases h₂ with + | succ hr₂ hs => + exact Sweeps.succ (round_10 h₁ hr₂) (sweeps_010 hs) + +theorem sweeps_000_even {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k) ([0, 0, 0] +> r) ([0, 0, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | @succ m r₀ r₁ r₂ hr _ ih => + have h2 : Sweeps 2 ([0, 0, 0] +> r₀) ([0, 0, 0] +> r₁) := + Sweeps.succ (round_000 r₀) (Sweeps.succ (round_001 hr) (Sweeps.zero _)) + have htr := Sweeps.trans h2 ih + rw [show 2 + 2 * m = 2 * (m + 1) by omega] at htr + exact htr + +theorem sweeps_000_odd {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k + 1) ([0, 0, 0] +> r) ([0, 0, 1] +> r') := by + have he := sweeps_000_even h + have h1 : Sweeps 1 ([0, 0, 0] +> r') ([0, 0, 1] +> r') := + Sweeps.succ (round_000 r') (Sweeps.zero _) + exact Sweeps.trans he h1 + +theorem default_eq_b000 : + (default : ListBlank (Fin 2)) = [0, 0, 0] +> default := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b000_cons_zero (r : ListBlank (Fin 2)) : + [0, 0, 0] +> ((0 : Fin 2) >> r) = (0 : Fin 2) >> ([0, 0, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +theorem b001_cons_zero (r : ListBlank (Fin 2)) : + [0, 0, 1] +> ((0 : Fin 2) >> r) = (0 : Fin 2) >> ([0, 1, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +theorem b001_default_eq : + ([0, 0, 1] +> default : ListBlank (Fin 2)) = (0 : Fin 2) >> ([0, 1, 0] +> default) := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b010_eq_zero_cons_b10 (r : ListBlank (Fin 2)) : + [0, 1, 0] +> r = (0 : Fin 2) >> ([1, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +inductive Valid : Nat → ListBlank (Fin 2) → Prop + | nil {n : Nat} (hn : n ≥ 1) : + Valid n default + | t0 {n : Nat} {r : ListBlank (Fin 2)} (hn : n ≥ 2) (hr : Valid (n / 2) r) : + Valid n ([0, 0, 0] +> r) + | t1 {n : Nat} {r : ListBlank (Fin 2)} (hn : n ≥ 1) (hr : Valid (n + 1) r) : + Valid n ([0, 1, 0] +> r) + | t2 {n : Nat} {r₁ r : ListBlank (Fin 2)} (hn : n ≥ 1) + (hround : Round r₁ ((0 : Fin 2) >> r)) (hr : Valid (n + 1) r) : + Valid n ([1, 0] +> r₁) + +theorem Valid.mono {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) {n' : Nat} (hle : n ≤ n') : + Valid n' r := by + induction h generalizing n' with + | nil hn => exact Valid.nil (by omega) + | t0 hn _ ih => exact Valid.t0 (by omega) (ih (by omega)) + | t1 hn _ ih => exact Valid.t1 (by omega) (ih (by omega)) + | t2 hn hround _ ih => exact Valid.t2 (by omega) hround (ih (by omega)) + +theorem valid_sweeps_nil : ∀ n : Nat, n ≥ 1 → + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ Sweeps n default ((0 : Fin 2) >> r') := by + intro n + induction n using Nat.strongRecOn with + | ind n ih => + intro hn + rcases ( by omega : n = 1 ∨ (n ≥ 2 ∧ n % 2 = 0) ∨ (n ≥ 2 ∧ n % 2 = 1) ) with rfl | ⟨hn2, hev⟩ | ⟨hn2, hod⟩ + · refine ⟨[0, 1, 0] +> default, Valid.t1 (by omega) (Valid.nil (by omega)), ?_⟩ + have h1 : Sweeps 1 ([0, 0, 0] +> default) ([0, 0, 1] +> default) := + Sweeps.succ (round_000 default) (Sweeps.zero _) + rw [b001_default_eq, ← default_eq_b000] at h1 + exact h1 + · obtain ⟨r', hr', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨[0, 0, 0] +> r', Valid.t0 hn2 hr', ?_⟩ + have he := sweeps_000_even hs' + rw [← default_eq_b000, b000_cons_zero, show 2 * (n / 2) = n by omega] at he + exact he + · obtain ⟨r', hr', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨[0, 1, 0] +> r', Valid.t1 (by omega) (hr'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [← default_eq_b000, b001_cons_zero, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + +theorem valid_sweeps {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) : + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ Sweeps n r ((0 : Fin 2) >> r') := by + induction h with + | @nil n hn => exact valid_sweeps_nil n hn + | @t0 n r hn hr ih => + obtain ⟨r', hr', hs'⟩ := ih + rcases ( by omega : n % 2 = 0 ∨ n % 2 = 1 ) with hev | hod + · refine ⟨[0, 0, 0] +> r', Valid.t0 hn hr', ?_⟩ + have he := sweeps_000_even hs' + rw [b000_cons_zero, show 2 * (n / 2) = n by omega] at he + exact he + · refine ⟨[0, 1, 0] +> r', Valid.t1 (by omega) (hr'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [b001_cons_zero, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + | @t1 n r hn hr ih => + obtain ⟨r', hr', hs'⟩ := ih + obtain ⟨r₁, hs₁, hr₁⟩ := sweeps_split_last hs' + refine ⟨[1, 0] +> r₁, Valid.t2 hn hr₁ hr', ?_⟩ + rw [← b010_eq_zero_cons_b10] + exact sweeps_010 hs₁ + | @t2 n r₁ r hn hround hr ih => + obtain ⟨r', hr', hs'⟩ := ih + obtain ⟨r₂, hs₂, hr₂⟩ := sweeps_split_last hs' + refine ⟨[1, 0] +> r₂, Valid.t2 hn hr₂ hr', ?_⟩ + rw [← b010_eq_zero_cons_b10] + rw [show n = (n - 1) + 1 by omega] at hs₂ ⊢ + exact sweeps_10 hround hs₂ + +theorem era_step {r : ListBlank (Fin 2)} (h : Valid 1 r) : + ∃ r' : ListBlank (Fin 2), Valid 1 r' ∧ + ((default <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ (default <{{E}} ((0 : Fin 2) >> r'))) := by + obtain ⟨r', hr', hs'⟩ := valid_sweeps (h.mono (by omega : 1 ≤ 2)) + obtain ⟨r₁, hs₁, hr₂⟩ := sweeps_split_last hs' + obtain ⟨r₀, hs₀, hr₁⟩ := sweeps_split_last hs₁ + cases hs₀ with + | zero _ => + refine ⟨[1, 0] +> r₁, Valid.t2 (by omega) hr₂ hr', ?_⟩ + have s1 := rule_E_nil r + have s2 := hr₁ (default <+ [0, 1, 1]) + have s3 := rule_E_011 default r₁ + rw [← b010_eq_zero_cons_b10] + exact stepPlus_trans s1 (stepPlus_trans s2 s3) + +def era0_r : ListBlank (Fin 2) := + [1, 0] +> default + +theorem init_reaches_era0 : + (init []) [target_tm]⊢* (default <{{E}} ((0 : Fin 2) >> era0_r)) := by + apply stepPlus_stepStar + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{QINIT}}> default) := rfl + rw [h_init] + dsimp [era0_r, ListBlank.append] + execute + +theorem valid_era0 : Valid 1 era0_r := by + have hround : Round default ((0 : Fin 2) >> ([0, 1, 0] +> default)) := by + have h0 := round_000 default + rw [b001_default_eq, ← default_eq_b000] at h0 + exact h0 + exact Valid.t2 (by omega) hround (Valid.t1 (by omega) (Valid.nil (by omega))) + +private theorem holdout_0786_nonhalt : IsDoesNotHalt holdout_0786_tm := by + refine closed_inv_does_not_halt target_tm + (fun cfg => ∃ r : ListBlank (Fin 2), Valid 1 r ∧ cfg = (default <{{E}} ((0 : Fin 2) >> r))) + ⟨default <{{E}} ((0 : Fin 2) >> era0_r), init_reaches_era0, ⟨era0_r, valid_era0, rfl⟩⟩ ?_ + intro cfg ⟨r, hr, hcfg⟩ + subst hcfg + obtain ⟨r', hr', hstep⟩ := era_step hr + exact ⟨default <{{E}} ((0 : Fin 2) >> r'), hstep, ⟨r', hr', rfl⟩⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := + holdout_0786_nonhalt + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1RE_1LC1RD_1LD0LC_1RA0RF_0RDHHH_0RD0LB diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RF_0RC1RE_1LD1RB_0LE0LC_1RA0LC_0RBHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RF_0RC1RE_1LD1RB_0LE0LC_1RA0LC_0RBHHH.lean new file mode 100644 index 00000000..393bd4ca --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RF_0RC1RE_1LD1RB_0LE0LC_1RA0LC_0RBHHH.lean @@ -0,0 +1,49 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.BB6.NonHalt.M_1RB0LD_1RC1RF_0RD1RA_1LE1RC_0LA0LD_0RCHHH + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RB1RF_0RC1RE_1LD1RB_0LE0LC_1RA0LC_0RBHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_0RC1RE_1LD1RB_0LE0LC_1RA0LC_0RBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +def stateMap_m0702 : Fin 6 → Fin 6 + | 0 => 4 -- m0702 state A + | 1 => 0 -- m0702 state B + | 2 => 1 -- m0702 state C + | 3 => 2 -- m0702 state D + | 4 => 3 -- m0702 state E + | 5 => 5 -- m0702 state F + +public section + +theorem is_not_halt : IsNotHalt target := by + exact Counter.does_not_halt_of_conj_stem + (M_tgt := target) + (M_src := BusyBeaver.M_1RB0LD_1RC1RF_0RD1RA_1LE1RC_0LA0LD_0RCHHH.target) + (σ := stateMap_m0702) (f := false) + (c₁ := (default : ListBlank (Fin 2)) {{1}}> default) + (by decide) (Counter.init_reaches_conjCfg_default rfl) + BusyBeaver.M_1RB0LD_1RC1RF_0RD1RA_1LE1RC_0LA0LD_0RCHHH.is_not_halt_from_0702 + +end + +end BusyBeaver.M_1RB1RF_0RC1RE_1LD1RB_0LE0LC_1RA0LC_0RBHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RF_1LC0LE_1RD0LB_1RA0RC_1RE1LB_0RDHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RF_1LC0LE_1RD0LB_1RA0RC_1RE1LB_0RDHHH.lean new file mode 100644 index 00000000..76135283 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RF_1LC0LE_1RD0LB_1RA0RC_1RE1LB_0RDHHH.lean @@ -0,0 +1,2461 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1RF_1LC0LE_1RD0LB_1RA0RC_1RE1LB_0RDHHH + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1LC0LE_1RD0LB_1RA0RC_1RE1LB_0RDHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +set_option maxHeartbeats 4000000 +set_option maxRecDepth 8000 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem pow_zero_list (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : + (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +omit [Inhabited Γ] in +@[simp] +theorem list_pow_append_one (u : List (Fin 2)) (k : Nat) : + u^k ++ u = u^(k + 1) := by + have h := list_pow_add_comm u k 1 + dsimp [HPow.hPow] at h ⊢ + rw [List.append_nil] at h + exact h + +theorem pow_add_append_right (u : List (Fin 2)) (m n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (m + n)) +> r = (u ^ m) +> ((u ^ n) +> r) := by + rw [list_pow_add, ← listblank_append_append] + +theorem pow_succ_append_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (n + 1)) +> r = u +> ((u ^ n) +> r) := by + rw [pow_succ_list, ← listblank_append_append] + +theorem pow_succ_append_right' (u : List (Fin 2)) (k : Nat) (r : ListBlank (Fin 2)) : + (u ^ k) +> (u +> r) = (u ^ (k + 1)) +> r := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (m n : Nat) : + s <+ (u ^ (m + n)) = (s <+ (u ^ m)) <+ (u ^ n) := by + rw [listblank_append_append, ← list_pow_add, add_comm] + +theorem pow_succ_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k : Nat) : + s <+ (u ^ (k + 1)) = (s <+ (u ^ k)) <+ u := by + rw [pow_succ_list, ← listblank_append_append] + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +local macro "finish" : tactic => + `(tactic| exists 0 <;> fail) + +local macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, listblank_append_cons, listblank_append_nil, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, listblank_append_cons, listblank_append_nil, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail]) + +local macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step))) + +local macro "execute" : tactic => + `(tactic| (try simp only [listblank_append_cons, listblank_append_nil]) <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +theorem multiStep_step_isSome {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₀ cfg cfg' : Cfg Γ Λ) (n m : Nat) + (hn : multiStep M c₀ n = some cfg) + (hnm : multiStep M c₀ (n + (1 + m)) = some cfg') : + (step M cfg).isSome := by + rw [multiStep_add M c₀ n (1 + m), hn] at hnm + dsimp [Option.bind] at hnm + rw [multiStep_add M cfg 1 m, multiStep_one] at hnm + cases hs : step M cfg with + | none => rw [hs] at hnm; nomatch hnm + | some c₁ => rfl + +theorem inv_reaches_beyond {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') + (N : Nat) : + ∃ (m : Nat) (cfg' : Cfg Γ Λ), multiStep M (init []) (N + m) = some cfg' ∧ Inv cfg' := by + induction N with + | zero => + obtain ⟨cfg₀, ⟨n₀, hn₀⟩, h_inv₀⟩ := h_init + refine ⟨n₀, cfg₀, ?_, h_inv₀⟩ + rwa [Nat.zero_add] + | succ N ih => + obtain ⟨m, cfg₁, hm, h_inv₁⟩ := ih + cases m with + | zero => + obtain ⟨cfg₂, ⟨k, hk_pos, hk⟩, h_inv₂⟩ := h_step cfg₁ h_inv₁ + cases k with + | zero => omega + | succ k' => + refine ⟨k', cfg₂, ?_, h_inv₂⟩ + have h_trans := multiStep_trans M (init []) cfg₁ cfg₂ N (k' + 1) hm hk + have h_eq : (N + 1) + k' = N + (k' + 1) := by omega + rwa [h_eq] + | succ m' => + refine ⟨m', cfg₁, ?_, h_inv₁⟩ + have h_eq : (N + 1) + m' = N + (m' + 1) := by omega + rwa [h_eq] + +theorem closed_inv_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') : + IsNotHalt M := by + intro cfg ⟨n, hn⟩ + obtain ⟨m, cfg', hnm, _⟩ := inv_reaches_beyond M Inv h_init h_step (n + 1) + have h_eq : (n + 1) + m = n + (1 + m) := by omega + rw [h_eq] at hnm + exact multiStep_step_isSome M (init []) cfg cfg' n m hn hnm + +-- State abbreviations for 1RB1RF_1LC0LE_1RD0LB_1RA0RC_1RE1LB_0RD--- +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 + +-- List rotation lemmas +theorem list_one_append_01_pow (k : Nat) : + ([1] : List (Fin 2)) ++ (([0, 1] : List (Fin 2)) ^ k) = (([1, 0] : List (Fin 2)) ^ k) ++ [1] := by + induction k with + | zero => rfl + | succ k ih => + rw [pow_succ_list, pow_succ_list] + rw [← List.append_assoc ([1] : List (Fin 2)) [0, 1], List.append_assoc ([1, 0] : List (Fin 2))] + change ([1, 0] : List (Fin 2)) ++ ([1] ++ ([0, 1] : List (Fin 2)) ^ k) = + ([1, 0] : List (Fin 2)) ++ ((([1, 0] : List (Fin 2)) ^ k) ++ [1]) + rw [ih] + +theorem list_zero_append_10_pow (k : Nat) : + ([0] : List (Fin 2)) ++ (([1, 0] : List (Fin 2)) ^ k) = (([0, 1] : List (Fin 2)) ^ k) ++ [0] := by + induction k with + | zero => rfl + | succ k ih => + rw [pow_succ_list, pow_succ_list] + rw [← List.append_assoc ([0] : List (Fin 2)) [1, 0], List.append_assoc ([0, 1] : List (Fin 2))] + change ([0, 1] : List (Fin 2)) ++ ([0] ++ ([1, 0] : List (Fin 2)) ^ k) = + ([0, 1] : List (Fin 2)) ++ ((([0, 1] : List (Fin 2)) ^ k) ++ [0]) + rw [ih] + +theorem rotR_1_01 (k : Nat) (r : ListBlank (Fin 2)) : + ([1] : List (Fin 2)) +> ((([0, 1] : List (Fin 2)) ^ k) +> r) = + ((([1, 0] : List (Fin 2)) ^ k) +> (([1] : List (Fin 2)) +> r)) := by + rw [listblank_append_append, list_one_append_01_pow, ← listblank_append_append] + +theorem rotR_01_0 (k : Nat) (r : ListBlank (Fin 2)) : + ((([0, 1] : List (Fin 2)) ^ k) +> (([0] : List (Fin 2)) +> r)) = + ([0] : List (Fin 2)) +> ((([1, 0] : List (Fin 2)) ^ k) +> r) := by + rw [listblank_append_append, ← list_zero_append_10_pow, ← listblank_append_append] + +theorem rotL_10_0_default (k : Nat) : + ((default : ListBlank (Fin 2)) <+ (([1, 0] : List (Fin 2)) ^ k)) <+ [0] = + (default : ListBlank (Fin 2)) <+ (([0, 1] : List (Fin 2)) ^ k) := by + rw [listblank_append_append, list_zero_append_10_pow, ← listblank_append_append] + have h0 : (default : ListBlank (Fin 2)) <+ [0] = default := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + rw [h0] + +-- The 5 shift lemmas +theorem shiftR_D_10 (k : Nat) (l r : ListBlank (Fin 2)) : + (l {{D}}> ((([1, 0] : List (Fin 2)) ^ k) +> r)) [target_tm]⊢* + ((l <+ (([1, 0] : List (Fin 2)) ^ k)) {{D}}> r) := by + induction k generalizing l r with + | zero => simp only [pow_zero_list, listblank_append_nil]; exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_append_right] + have h1 : (l {{D}}> ([1, 0] +> ((([1, 0] : List (Fin 2)) ^ k) +> r))) [target_tm]⊢* + ((l <+ [1, 0]) {{D}}> ((([1, 0] : List (Fin 2)) ^ k) +> r)) := by execute + have h2 := ih (l <+ [1, 0]) r + rw [listblank_append_append, list_pow_append_one] at h2 + exact stepStar_trans h1 h2 + +theorem shiftR_C_01 (k : Nat) (l r : ListBlank (Fin 2)) : + (l {{C}}> ((([0, 1] : List (Fin 2)) ^ k) +> r)) [target_tm]⊢* + ((l <+ (([0, 1] : List (Fin 2)) ^ k)) {{C}}> r) := by + induction k generalizing l r with + | zero => simp only [pow_zero_list, listblank_append_nil]; exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_append_right] + have h1 : (l {{C}}> ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> r))) [target_tm]⊢* + ((l <+ [0, 1]) {{C}}> ((([0, 1] : List (Fin 2)) ^ k) +> r)) := by execute + have h2 := ih (l <+ [0, 1]) r + rw [listblank_append_append, list_pow_append_one] at h2 + exact stepStar_trans h1 h2 + +theorem shiftL_B_01 (k : Nat) (l r : ListBlank (Fin 2)) : + ((l <+ (([0, 1] : List (Fin 2)) ^ k)) <{{B}} r) [target_tm]⊢* + (l <{{B}} ((([0, 1] : List (Fin 2)) ^ k) +> r)) := by + induction k generalizing l r with + | zero => simp only [pow_zero_list, listblank_append_nil]; exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_append_left] + have h1 : (((l <+ (([0, 1] : List (Fin 2)) ^ k)) <+ [0, 1]) <{{B}} r) [target_tm]⊢* + ((l <+ (([0, 1] : List (Fin 2)) ^ k)) <{{B}} ([0, 1] +> r)) := by execute + have h2 := ih l ([0, 1] +> r) + rw [pow_succ_append_right'] at h2 + exact stepStar_trans h1 h2 + +theorem shiftL_C_10 (k : Nat) (l r : ListBlank (Fin 2)) : + ((l <+ (([1, 0] : List (Fin 2)) ^ k)) <{{C}} r) [target_tm]⊢* + (l <{{C}} ((([1, 0] : List (Fin 2)) ^ k) +> r)) := by + induction k generalizing l r with + | zero => simp only [pow_zero_list, listblank_append_nil]; exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_append_left] + have h1 : (((l <+ (([1, 0] : List (Fin 2)) ^ k)) <+ [1, 0]) <{{C}} r) [target_tm]⊢* + ((l <+ (([1, 0] : List (Fin 2)) ^ k)) <{{C}} ([1, 0] +> r)) := by execute + have h2 := ih l ([1, 0] +> r) + rw [pow_succ_append_right'] at h2 + exact stepStar_trans h1 h2 + +theorem shiftL6_B_10_look1 (k : Nat) (l r : ListBlank (Fin 2)) : + ((l <+ (([1, 0] : List (Fin 2)) ^ k)) <{{B}} ([1] +> r)) [target_tm]⊢* + (l <{{B}} ((([1, 0] : List (Fin 2)) ^ k) +> ([1] +> r))) := by + induction k generalizing l r with + | zero => simp only [pow_zero_list, listblank_append_nil]; exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_append_left] + have h1 : (((l <+ (([1, 0] : List (Fin 2)) ^ k)) <+ [1, 0]) <{{B}} ([1] +> r)) [target_tm]⊢* + ((l <+ (([1, 0] : List (Fin 2)) ^ k)) <{{B}} ([1] +> ([0, 1] +> r))) := by execute + have h2 := ih l ([0, 1] +> r) + have hr : ([1] : List (Fin 2)) +> ([0, 1] +> r) = [1, 0] +> ([1] +> r) := rfl + rw [← pow_succ_append_right' ([1, 0] : List (Fin 2)) k ([1] +> r)] + rw [← hr] + exact stepStar_trans h1 h2 +-- The 14 low-level sweep lemmas +theorem Start (h : Nat) (r : ListBlank (Fin 2)) : + ((default : ListBlank (Fin 2)) <{{C}} ((([1, 0] : List (Fin 2)) ^ h) +> ([1, 1, 0, 0, 1] +> r))) [target_tm]⊢⁺ + (((((default : ListBlank (Fin 2)) <+ (([0, 1] : List (Fin 2)) ^ (4 + h))) <+ [1, 1, 1]) <+ [0]) {{D}}> r) := by + have s1 : ((default : ListBlank (Fin 2)) <{{C}} ((([1, 0] : List (Fin 2)) ^ h) +> ([1, 1, 0, 0, 1] +> r))) [target_tm]⊢⁺ + ((default <+ [1]) {{D}}> ((([1, 0] : List (Fin 2)) ^ h) +> ([1, 1, 0, 0, 1] +> r))) := by execute + have s2 := shiftR_D_10 h (default <+ [1]) ([1, 1, 0, 0, 1] +> r) + have s3 : (((default <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ h)) {{D}}> ([1, 1, 0, 0, 1] +> r)) [target_tm]⊢* + (((default <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ h)) <{{C}} ([1, 0, 0, 0, 1] +> r)) := by execute + have s4 := shiftL_C_10 h (default <+ [1]) ([1, 0, 0, 0, 1] +> r) + have s5 : ((default <+ [1]) <{{C}} ((([1, 0] : List (Fin 2)) ^ h) +> ([1, 0, 0, 0, 1] +> r))) [target_tm]⊢* + ((default <+ [1, 0, 1]) {{D}}> ((([1, 0] : List (Fin 2)) ^ h) +> ([1, 0, 0, 0, 1] +> r))) := by execute + have s6 := shiftR_D_10 h (default <+ [1, 0, 1]) ([1, 0, 0, 0, 1] +> r) + have s7 : (((default <+ [1, 0, 1]) <+ (([1, 0] : List (Fin 2)) ^ h)) {{D}}> ([1, 0, 0, 0, 1] +> r)) [target_tm]⊢* + (((default <+ [1, 0, 1]) <+ (([1, 0] : List (Fin 2)) ^ h)) <{{C}} ([1, 1, 0, 1, 0] +> r)) := by execute + have s8 := shiftL_C_10 h (default <+ [1, 0, 1]) ([1, 1, 0, 1, 0] +> r) + have s9 : ((default <+ [1, 0, 1]) <{{C}} ((([1, 0] : List (Fin 2)) ^ h) +> ([1, 1, 0, 1, 0] +> r))) [target_tm]⊢* + ((default <+ [1, 0, 1, 0, 1]) {{D}}> ((([1, 0] : List (Fin 2)) ^ h) +> ([1, 1, 0, 1, 0] +> r))) := by execute + have s10 := shiftR_D_10 h (default <+ [1, 0, 1, 0, 1]) ([1, 1, 0, 1, 0] +> r) + have s11 : (((default <+ [1, 0, 1, 0, 1]) <+ (([1, 0] : List (Fin 2)) ^ h)) {{D}}> ([1, 1, 0, 1, 0] +> r)) [target_tm]⊢* + (((default <+ [1, 0, 1, 0, 1]) <+ (([1, 0] : List (Fin 2)) ^ h)) <{{C}} ([1, 0, 0, 1, 0] +> r)) := by execute + have s12 := shiftL_C_10 h (default <+ [1, 0, 1, 0, 1]) ([1, 0, 0, 1, 0] +> r) + have s13 : ((default <+ [1, 0, 1, 0, 1]) <{{C}} ((([1, 0] : List (Fin 2)) ^ h) +> ([1, 0, 0, 1, 0] +> r))) [target_tm]⊢* + ((default <+ [1, 0, 1, 0, 1, 0, 1, 0]) {{D}}> ((([1, 0] : List (Fin 2)) ^ h) +> ([1, 0, 0, 1, 0] +> r))) := by execute + have h13_eq : ((default : ListBlank (Fin 2)) <+ [1, 0, 1, 0, 1, 0, 1, 0]) = + ((default : ListBlank (Fin 2)) <+ (([1, 0] : List (Fin 2)) ^ 4)) := rfl + rw [h13_eq] at s13 + have s14 := shiftR_D_10 h (default <+ (([1, 0] : List (Fin 2)) ^ 4)) ([1, 0, 0, 1, 0] +> r) + rw [← pow_add_append_left default ([1, 0] : List (Fin 2)) 4 h] at s14 + have s15 : (((default : ListBlank (Fin 2)) <+ (([1, 0] : List (Fin 2)) ^ (4 + h))) {{D}}> ([1, 0, 0, 1, 0] +> r)) [target_tm]⊢* + ((((((default : ListBlank (Fin 2)) <+ (([1, 0] : List (Fin 2)) ^ (4 + h))) <+ [0]) <+ [1, 1, 1]) <+ [0]) {{D}}> r) := by execute + rw [rotL_10_0_default (4 + h)] at s15 + exact stepPlus_stepStar_stepPlus s1 + (stepStar_trans s2 (stepStar_trans s3 (stepStar_trans s4 (stepStar_trans s5 + (stepStar_trans s6 (stepStar_trans s7 (stepStar_trans s8 (stepStar_trans s9 + (stepStar_trans s10 (stepStar_trans s11 (stepStar_trans s12 (stepStar_trans s13 + (stepStar_trans s14 s15))))))))))))) + +theorem PassR (l : ListBlank (Fin 2)) (p q : Nat) (r : ListBlank (Fin 2)) : + ((l <+ [0]) {{D}}> ((([1, 0] : List (Fin 2)) ^ p) +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> r)))) [target_tm]⊢* + (((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) <+ [1, 1]) <+ [0]) {{D}}> r) := by + rw [pow_succ_append_right] + have s1 := shiftR_D_10 p (l <+ [0]) ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ q) +> ([0, 0, 1, 0] +> r))) + have s2 : (((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) {{D}}> ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ q) +> ([0, 0, 1, 0] +> r)))) [target_tm]⊢* + ((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 1]) {{F}}> ((([0, 1] : List (Fin 2)) ^ q) +> ([0] +> ([0, 1, 0] +> r)))) := by execute + rw [rotR_01_0 q ([0, 1, 0] +> r)] at s2 + have s3 : ((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 1]) {{F}}> ([0] +> ((([1, 0] : List (Fin 2)) ^ q) +> ([0, 1, 0] +> r)))) [target_tm]⊢* + ((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) {{D}}> ((([1, 0] : List (Fin 2)) ^ q) +> ([0, 1, 0] +> r))) := by execute + have s4 := shiftR_D_10 q (((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) ([0, 1, 0] +> r) + have s5 : (((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) {{D}}> ([0, 1, 0] +> r)) [target_tm]⊢* + (((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) <+ [1, 1]) <+ [0]) {{D}}> r) := by execute + exact stepStar_trans s1 (stepStar_trans s2 (stepStar_trans s3 (stepStar_trans s4 s5))) + +theorem Borrow (l : ListBlank (Fin 2)) (p q : Nat) (r : ListBlank (Fin 2)) : + (l {{D}}> ((([1, 0] : List (Fin 2)) ^ p) +> ((([0, 1] : List (Fin 2)) ^ (q + 2)) +> ([0, 0, 0, 1] +> r)))) [target_tm]⊢* + (l <{{B}} ((([1, 0] : List (Fin 2)) ^ (p + 1)) +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> r)))) := by + rw [pow_succ_append_right ([0, 1] : List (Fin 2)) (q + 1), pow_succ_append_right ([0, 1] : List (Fin 2)) q] + have s1 := shiftR_D_10 p l ([0, 1] +> ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ q) +> ([0, 0, 0, 1] +> r)))) + have s2 : ((l <+ (([1, 0] : List (Fin 2)) ^ p)) {{D}}> ([0, 1] +> ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ q) +> ([0, 0, 0, 1] +> r))))) [target_tm]⊢* + (((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 0, 1, 1]) {{C}}> ((([0, 1] : List (Fin 2)) ^ q) +> ([0, 0, 0, 1] +> r))) := by execute + have s3 := shiftR_C_01 q ((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 0, 1, 1]) ([0, 0, 0, 1] +> r) + have s4 : ((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 0, 1, 1]) <+ (([0, 1] : List (Fin 2)) ^ q)) {{C}}> ([0, 0, 0, 1] +> r)) [target_tm]⊢* + ((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 0, 1, 1]) <+ (([0, 1] : List (Fin 2)) ^ q)) <{{B}} ([1, 0, 1, 0] +> r)) := by execute + have s5 := shiftL_B_01 q ((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 0, 1, 1]) ([1, 0, 1, 0] +> r) + have s6 : (((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 0, 1, 1]) <{{B}} ((([0, 1] : List (Fin 2)) ^ q) +> ([1, 0, 1, 0] +> r))) [target_tm]⊢* + (((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1, 1]) {{C}}> ((([0, 1] : List (Fin 2)) ^ q) +> ([1, 0, 1, 0] +> r))) := by execute + have s7 := shiftR_C_01 q ((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1, 1]) ([1, 0, 1, 0] +> r) + have s8 : ((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1, 1]) <+ (([0, 1] : List (Fin 2)) ^ q)) {{C}}> ([1, 0, 1, 0] +> r)) [target_tm]⊢* + ((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1, 1]) <+ (([0, 1] : List (Fin 2)) ^ q)) <{{B}} ([0, 0, 1, 0] +> r)) := by execute + have s9 := shiftL_B_01 q ((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1, 1]) ([0, 0, 1, 0] +> r) + have s10 : (((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1, 1]) <{{B}} ((([0, 1] : List (Fin 2)) ^ q) +> ([0, 0, 1, 0] +> r))) [target_tm]⊢* + ((l <+ (([1, 0] : List (Fin 2)) ^ p)) <{{B}} ([1] +> ([0] +> ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ q) +> ([0, 0, 1, 0] +> r)))))) := by execute + have s11 := shiftL6_B_10_look1 p l ([0] +> ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ q) +> ([0, 0, 1, 0] +> r)))) + have hr : ([1] : List (Fin 2)) +> ([0] +> ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ q) +> ([0, 0, 1, 0] +> r)))) = + [1, 0] +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> r)) := by + rw [pow_succ_append_right]; rfl + rw [← pow_succ_append_right' ([1, 0] : List (Fin 2)) p, ← hr] + exact stepStar_trans s1 (stepStar_trans s2 (stepStar_trans s3 (stepStar_trans s4 (stepStar_trans s5 + (stepStar_trans s6 (stepStar_trans s7 (stepStar_trans s8 (stepStar_trans s9 (stepStar_trans s10 s11))))))))) + +theorem PassL (l : ListBlank (Fin 2)) (p q : Nat) (r : ListBlank (Fin 2)) : + (((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ (q + 1))) <+ [1, 1]) <+ [0]) <{{B}} r) [target_tm]⊢* + ((l <+ [0]) <{{B}} ((([1, 0] : List (Fin 2)) ^ (p + 1)) +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 0, 1] +> r)))) := by + rw [pow_succ_append_left _ ([1, 0] : List (Fin 2)) q] + have s1 : ((((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) <+ [1, 0]) <+ [1, 1]) <+ [0]) <{{B}} r) [target_tm]⊢* + (((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) <{{C}} ([1, 1, 0, 0, 1] +> r)) := by execute + have s2 := shiftL_C_10 q (((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) ([1, 1, 0, 0, 1] +> r) + have s3 : ((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <{{C}} ((([1, 0] : List (Fin 2)) ^ q) +> ([1, 1, 0, 0, 1] +> r))) [target_tm]⊢* + ((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 1, 1]) {{D}}> ((([1, 0] : List (Fin 2)) ^ q) +> ([1, 1, 0, 0, 1] +> r))) := by execute + have s4 := shiftR_D_10 q (((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 1, 1]) ([1, 1, 0, 0, 1] +> r) + have s5 : (((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) {{D}}> ([1, 1, 0, 0, 1] +> r)) [target_tm]⊢* + (((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) <{{C}} ([1, 0, 0, 0, 1] +> r)) := by execute + have s6 := shiftL_C_10 q (((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 1, 1]) ([1, 0, 0, 0, 1] +> r) + have s7 : ((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 1, 1]) <{{C}} ((([1, 0] : List (Fin 2)) ^ q) +> ([1, 0, 0, 0, 1] +> r))) [target_tm]⊢* + (((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <{{B}} ([1] +> ([0] +> ([0] +> ((([1, 0] : List (Fin 2)) ^ q) +> ([1] +> ([0, 0, 0, 1] +> r))))))) := by execute + have s8 := shiftL6_B_10_look1 p (l <+ [0]) ([0] +> ([0] +> ((([1, 0] : List (Fin 2)) ^ q) +> ([1] +> ([0, 0, 0, 1] +> r))))) + have hr : ([1] : List (Fin 2)) +> ([0] +> ([0] +> ((([1, 0] : List (Fin 2)) ^ q) +> ([1] +> ([0, 0, 0, 1] +> r))))) = + [1, 0] +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 0, 1] +> r)) := by + rw [← rotR_01_0 q ([1] +> ([0, 0, 0, 1] +> r))] + have h01 : ([0] : List (Fin 2)) +> ([1] +> ([0, 0, 0, 1] +> r)) = [0, 1] +> ([0, 0, 0, 1] +> r) := rfl + rw [h01, pow_succ_append_right']; rfl + rw [← pow_succ_append_right' ([1, 0] : List (Fin 2)) p, ← hr] + exact stepStar_trans s1 (stepStar_trans s2 (stepStar_trans s3 (stepStar_trans s4 + (stepStar_trans s5 (stepStar_trans s6 (stepStar_trans s7 s8)))))) + +theorem EndPh (h : Nat) (r : ListBlank (Fin 2)) : + (((((default : ListBlank (Fin 2)) <+ (([0, 1] : List (Fin 2)) ^ (4 + h))) <+ [1, 1, 1]) <+ [0]) <{{B}} r) [target_tm]⊢* + ((default : ListBlank (Fin 2)) <{{C}} ((([1, 0] : List (Fin 2)) ^ (4 + h)) +> ([1, 1, 0, 0, 1] +> r))) := by + have s1 : (((((default : ListBlank (Fin 2)) <+ (([0, 1] : List (Fin 2)) ^ (4 + h))) <+ [1, 1, 1]) <+ [0]) <{{B}} r) [target_tm]⊢* + (((default : ListBlank (Fin 2)) <+ (([0, 1] : List (Fin 2)) ^ (4 + h))) <{{B}} ([1, 0, 0, 1] +> r)) := by execute + have s2 := shiftL_B_01 (4 + h) default ([1, 0, 0, 1] +> r) + have s3 : ((default : ListBlank (Fin 2)) <{{B}} ((([0, 1] : List (Fin 2)) ^ (4 + h)) +> ([1, 0, 0, 1] +> r))) [target_tm]⊢* + ((default : ListBlank (Fin 2)) <{{C}} ([1] +> ((([0, 1] : List (Fin 2)) ^ (4 + h)) +> ([1, 0, 0, 1] +> r)))) := by execute + rw [rotR_1_01 (4 + h) ([1, 0, 0, 1] +> r)] at s3 + exact stepStar_trans s1 (stepStar_trans s2 s3) + +theorem EndT (l : ListBlank (Fin 2)) (p q : Nat) : + ((((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ (q + 1))) <+ [1, 1]) <+ [0]) {{D}}> default) [target_tm]⊢* + (l <{{B}} ((([1, 0] : List (Fin 2)) ^ (p + 1)) +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> ([1, 0, 1] +> default))))) := by + rw [pow_succ_append_left _ ([1, 0] : List (Fin 2)) q] + have s1 : (((((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) <+ [1, 0]) <+ [1, 1]) <+ [0]) {{D}}> default) [target_tm]⊢* + ((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) <{{C}} ([1, 1, 0, 1, 0, 1, 0, 1] +> default)) := by execute + have s2 := shiftL_C_10 q ((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) ([1, 1, 0, 1, 0, 1, 0, 1] +> default) + have s3 : (((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <{{C}} ((([1, 0] : List (Fin 2)) ^ q) +> ([1, 1, 0, 1, 0, 1, 0, 1] +> default))) [target_tm]⊢* + (((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 1, 1]) {{D}}> ((([1, 0] : List (Fin 2)) ^ q) +> ([1, 1, 0, 1, 0, 1, 0, 1] +> default))) := by execute + have s4 := shiftR_D_10 q ((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 1, 1]) ([1, 1, 0, 1, 0, 1, 0, 1] +> default) + have s5 : ((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) {{D}}> ([1, 1, 0, 1, 0, 1, 0, 1] +> default)) [target_tm]⊢* + ((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) <{{C}} ([1, 0, 0, 1, 0, 1, 0, 1] +> default)) := by execute + have s6 := shiftL_C_10 q ((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 1, 1]) ([1, 0, 0, 1, 0, 1, 0, 1] +> default) + have s7 : (((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 1, 1]) <{{C}} ((([1, 0] : List (Fin 2)) ^ q) +> ([1, 0, 0, 1, 0, 1, 0, 1] +> default))) [target_tm]⊢* + ((l <+ (([1, 0] : List (Fin 2)) ^ p)) <{{B}} ([1] +> ([0] +> ([0] +> ((([1, 0] : List (Fin 2)) ^ q) +> ([1] +> ([0, 0, 1, 0] +> ([1, 0, 1] +> default)))))))) := by execute + have s8 := shiftL6_B_10_look1 p l ([0] +> ([0] +> ((([1, 0] : List (Fin 2)) ^ q) +> ([1] +> ([0, 0, 1, 0] +> ([1, 0, 1] +> default)))))) + have hr : ([1] : List (Fin 2)) +> ([0] +> ([0] +> ((([1, 0] : List (Fin 2)) ^ q) +> ([1] +> ([0, 0, 1, 0] +> ([1, 0, 1] +> default)))))) = + [1, 0] +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> ([1, 0, 1] +> default))) := by + rw [← rotR_01_0 q ([1] +> ([0, 0, 1, 0] +> ([1, 0, 1] +> default)))] + have h01 : ([0] : List (Fin 2)) +> ([1] +> ([0, 0, 1, 0] +> ([1, 0, 1] +> default))) = [0, 1] +> ([0, 0, 1, 0] +> ([1, 0, 1] +> default)) := rfl + rw [h01, pow_succ_append_right']; rfl + rw [← pow_succ_append_right' ([1, 0] : List (Fin 2)) p, ← hr] + exact stepStar_trans s1 (stepStar_trans s2 (stepStar_trans s3 (stepStar_trans s4 + (stepStar_trans s5 (stepStar_trans s6 (stepStar_trans s7 s8)))))) + +theorem EndLastT (l : ListBlank (Fin 2)) (p : Nat) : + (((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ [1, 1]) <+ [0]) {{D}}> default) [target_tm]⊢* + (l <{{B}} ((([1, 0] : List (Fin 2)) ^ (p + 4)) +> ([1] +> default))) := by + have s1 : (((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ [1, 1]) <+ [0]) {{D}}> default) [target_tm]⊢* + ((l <+ (([1, 0] : List (Fin 2)) ^ p)) <{{B}} ([1] +> ([0, 1, 0, 1, 0, 1, 0, 1] +> default))) := by execute + have s2 := shiftL6_B_10_look1 p l ([0, 1, 0, 1, 0, 1, 0, 1] +> default) + have hr : ([1] : List (Fin 2)) +> ([0, 1, 0, 1, 0, 1, 0, 1] +> default) = + (([1, 0] : List (Fin 2)) ^ 4) +> ([1] +> default) := rfl + rw [pow_add_append_right ([1, 0] : List (Fin 2)) p 4, ← hr] + exact stepStar_trans s1 s2 + +theorem MergeB (l : ListBlank (Fin 2)) (p p' : Nat) (r : ListBlank (Fin 2)) : + (l {{D}}> ((([1, 0] : List (Fin 2)) ^ p) +> ([0, 1] +> ([0, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ p') +> r))))) [target_tm]⊢* + (l <{{B}} ((([1, 0] : List (Fin 2)) ^ (p + p' + 3)) +> r)) := by + have s1 := shiftR_D_10 p l ([0, 1] +> ([0, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ p') +> r))) + have s2 : ((l <+ (([1, 0] : List (Fin 2)) ^ p)) {{D}}> ([0, 1] +> ([0, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ p') +> r)))) [target_tm]⊢* + ((l <+ (([1, 0] : List (Fin 2)) ^ p)) <{{B}} ([1] +> ([0, 1, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ p') +> r)))) := by execute + have s3 := shiftL6_B_10_look1 p l ([0, 1, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ p') +> r)) + have hr : ([1] : List (Fin 2)) +> ([0, 1, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ p') +> r)) = + (([1, 0] : List (Fin 2)) ^ 3) +> ((([1, 0] : List (Fin 2)) ^ p') +> r) := rfl + have hp : p + p' + 3 = p + (3 + p') := by omega + rw [hp, pow_add_append_right ([1, 0] : List (Fin 2)) p (3 + p'), pow_add_append_right ([1, 0] : List (Fin 2)) 3 p', ← hr] + exact stepStar_trans s1 (stepStar_trans s2 s3) + +theorem MergeE (l : ListBlank (Fin 2)) (p : Nat) : + (l {{D}}> ((([1, 0] : List (Fin 2)) ^ p) +> ([0, 1] +> ([0, 0, 0, 1] +> default)))) [target_tm]⊢* + (l <{{B}} ((([1, 0] : List (Fin 2)) ^ (p + 2)) +> ([1] +> default))) := by + have s1 := shiftR_D_10 p l ([0, 1] +> ([0, 0, 0, 1] +> default)) + have s2 : ((l <+ (([1, 0] : List (Fin 2)) ^ p)) {{D}}> ([0, 1] +> ([0, 0, 0, 1] +> default))) [target_tm]⊢* + ((l <+ (([1, 0] : List (Fin 2)) ^ p)) <{{B}} ([1] +> ([0, 1, 0, 1] +> default))) := by execute + have s3 := shiftL6_B_10_look1 p l ([0, 1, 0, 1] +> default) + have hr : ([1] : List (Fin 2)) +> ([0, 1, 0, 1] +> default) = + (([1, 0] : List (Fin 2)) ^ 2) +> ([1] +> default) := rfl + rw [pow_add_append_right ([1, 0] : List (Fin 2)) p 2, ← hr] + exact stepStar_trans s1 (stepStar_trans s2 s3) + +theorem OvT (l : ListBlank (Fin 2)) (t : Nat) : + ((l <+ [0]) {{D}}> ((([1, 0] : List (Fin 2)) ^ t) +> ([1] +> default))) [target_tm]⊢* + (l <{{B}} ((([0, 1] : List (Fin 2)) ^ (t + 1)) +> ([0, 0, 0, 1] +> default))) := by + have s1 := shiftR_D_10 t (l <+ [0]) ([1] +> default) + have s2 : (((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ t)) {{D}}> ([1] +> default)) [target_tm]⊢* + (((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ t)) <{{C}} ([1, 1, 0, 0, 1] +> default)) := by execute + have s3 := shiftL_C_10 t (l <+ [0]) ([1, 1, 0, 0, 1] +> default) + have s4 : ((l <+ [0]) <{{C}} ((([1, 0] : List (Fin 2)) ^ t) +> ([1, 1, 0, 0, 1] +> default))) [target_tm]⊢* + ((l <+ [1]) {{D}}> ((([1, 0] : List (Fin 2)) ^ t) +> ([1, 1, 0, 0, 1] +> default))) := by execute + have s5 := shiftR_D_10 t (l <+ [1]) ([1, 1, 0, 0, 1] +> default) + have s6 : (((l <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ t)) {{D}}> ([1, 1, 0, 0, 1] +> default)) [target_tm]⊢* + (((l <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ t)) <{{C}} ([1, 0, 0, 0, 1] +> default)) := by execute + have s7 := shiftL_C_10 t (l <+ [1]) ([1, 0, 0, 0, 1] +> default) + have s8 : ((l <+ [1]) <{{C}} ((([1, 0] : List (Fin 2)) ^ t) +> ([1, 0, 0, 0, 1] +> default))) [target_tm]⊢* + (l <{{B}} ([0] +> ((([1, 0] : List (Fin 2)) ^ t) +> ([1] +> ([0, 0, 0, 1] +> default))))) := by execute + rw [← rotR_01_0 t ([1] +> ([0, 0, 0, 1] +> default))] at s8 + have h01 : ([0] : List (Fin 2)) +> ([1] +> ([0, 0, 0, 1] +> default)) = [0, 1] +> ([0, 0, 0, 1] +> default) := rfl + rw [h01, pow_succ_append_right'] at s8 + exact stepStar_trans s1 (stepStar_trans s2 (stepStar_trans s3 (stepStar_trans s4 + (stepStar_trans s5 (stepStar_trans s6 (stepStar_trans s7 s8)))))) + +theorem OvL (l : ListBlank (Fin 2)) (p q : Nat) (r : ListBlank (Fin 2)) : + ((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ (p + 1))) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) <+ [1, 1]) <{{B}} r) [target_tm]⊢* + (l <{{B}} ((([0, 1] : List (Fin 2)) ^ (p + 1)) +> ([0, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r)))) := by + rw [pow_succ_append_left _ ([1, 0] : List (Fin 2)) p] + have s1 : (((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 0]) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) <+ [1, 1]) <{{B}} r) [target_tm]⊢* + ((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 0]) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) <{{B}} ([1] +> ([0] +> r))) := by execute + have s2 := shiftL6_B_10_look1 q ((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 0]) <+ [0, 1, 1]) ([0] +> r) + have hq : ([1] : List (Fin 2)) +> ([0] +> r) = [1, 0] +> r := rfl + rw [hq, pow_succ_append_right' ([1, 0] : List (Fin 2)) q r] at s2 + have s3 : (((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 0]) <+ [0, 1, 1]) <{{B}} ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r)) [target_tm]⊢* + (((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <{{C}} ([1, 1, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r))) := by execute + have s4 := shiftL_C_10 p (l <+ [0]) ([1, 1, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r)) + have s5 : ((l <+ [0]) <{{C}} ((([1, 0] : List (Fin 2)) ^ p) +> ([1, 1, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r)))) [target_tm]⊢* + ((l <+ [1]) {{D}}> ((([1, 0] : List (Fin 2)) ^ p) +> ([1, 1, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r)))) := by execute + have s6 := shiftR_D_10 p (l <+ [1]) ([1, 1, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r)) + have s7 : (((l <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ p)) {{D}}> ([1, 1, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r))) [target_tm]⊢* + (((l <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ p)) <{{C}} ([1, 0, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r))) := by execute + have s8 := shiftL_C_10 p (l <+ [1]) ([1, 0, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r)) + have s9 : ((l <+ [1]) <{{C}} ((([1, 0] : List (Fin 2)) ^ p) +> ([1, 0, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r)))) [target_tm]⊢* + (l <{{B}} ([0] +> ((([1, 0] : List (Fin 2)) ^ p) +> ([1] +> ([0, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r)))))) := by execute + rw [← rotR_01_0 p ([1] +> ([0, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r)))] at s9 + have h01 : ([0] : List (Fin 2)) +> ([1] +> ([0, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r))) = + [0, 1] +> ([0, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (q + 1)) +> r)) := rfl + rw [h01, pow_succ_append_right'] at s9 + exact stepStar_trans s1 (stepStar_trans s2 (stepStar_trans s3 (stepStar_trans s4 + (stepStar_trans s5 (stepStar_trans s6 (stepStar_trans s7 (stepStar_trans s8 s9))))))) + +theorem OvEnd (h p : Nat) (r : ListBlank (Fin 2)) : + ((((default : ListBlank (Fin 2)) <+ (([0, 1] : List (Fin 2)) ^ (4 + h))) <+ [1, 1, 1]) <{{B}} ((([0, 1] : List (Fin 2)) ^ (p + 2)) +> ([0, 0, 0, 1] +> r))) [target_tm]⊢* + ((default : ListBlank (Fin 2)) <{{C}} ((([1, 0] : List (Fin 2)) ^ 2) +> ([1, 1, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (h + 5)) +> ((([0, 1] : List (Fin 2)) ^ (p + 1)) +> ([0, 0, 1, 0] +> r)))))) := by + have hp2 : ((([0, 1] : List (Fin 2)) ^ (p + 2)) +> ([0, 0, 0, 1] +> r)) = + [0, 1, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ p) +> ([0, 0, 0, 1] +> r)) := by + rw [pow_succ_append_right ([0, 1] : List (Fin 2)) (p + 1), pow_succ_append_right ([0, 1] : List (Fin 2)) p]; rfl + rw [hp2] + have s1 : ((((default : ListBlank (Fin 2)) <+ (([0, 1] : List (Fin 2)) ^ (4 + h))) <+ [1, 1, 1]) <{{B}} ([0, 1, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ p) +> ([0, 0, 0, 1] +> r)))) [target_tm]⊢* + (((default : ListBlank (Fin 2)) <+ (([0, 1] : List (Fin 2)) ^ (4 + h))) <{{E}} ([0, 1, 0, 0, 1, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ p) +> ([0, 0, 0, 1] +> r)))) := by execute + have s2 : ((((default : ListBlank (Fin 2)) <+ (([1, 0] : List (Fin 2)) ^ (4 + h))) <+ [0]) <{{E}} ([0, 1, 0, 0, 1, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ p) +> ([0, 0, 0, 1] +> r)))) [target_tm]⊢* + (((default : ListBlank (Fin 2)) <+ (([1, 0] : List (Fin 2)) ^ (4 + h))) <{{B}} ([1] +> ([0, 1, 0, 0, 1, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ p) +> ([0, 0, 0, 1] +> r))))) := by execute + rw [rotL_10_0_default (4 + h)] at s2 + have s3 := shiftL6_B_10_look1 (4 + h) default ([0, 1, 0, 0, 1, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ p) +> ([0, 0, 0, 1] +> r))) + have h4h_eq : ((([1, 0] : List (Fin 2)) ^ (4 + h)) +> ([1] +> ([0, 1, 0, 0, 1, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ p) +> ([0, 0, 0, 1] +> r))))) = + ([1, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ (h + 2)) +> ([1] +> ([0, 1, 0, 0, 1, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ p) +> ([0, 0, 0, 1] +> r)))))) := by + have h4h : 4 + h = 2 + (h + 2) := by omega + rw [h4h, pow_add_append_right ([1, 0] : List (Fin 2)) 2 (h + 2)]; rfl + rw [h4h_eq] at s3 + have s4 : ((default : ListBlank (Fin 2)) <{{B}} ([1, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ (h + 2)) +> ([1] +> ([0, 1, 0, 0, 1, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ p) +> ([0, 0, 0, 1] +> r))))))) [target_tm]⊢* + (((default : ListBlank (Fin 2)) <+ [0, 1, 1, 1, 0, 1, 0, 1]) {{D}}> ((([1, 0] : List (Fin 2)) ^ (h + 2)) +> ([1, 0, 1, 0] +> ([0, 1, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ p) +> ([0, 0, 0, 1] +> r)))))) := by execute + have h_mid : ((([1, 0] : List (Fin 2)) ^ (h + 2)) +> ([1, 0, 1, 0] +> ([0, 1, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ p) +> ([0, 0, 0, 1] +> r))))) = + ((([1, 0] : List (Fin 2)) ^ (h + 4)) +> ((([0, 1] : List (Fin 2)) ^ (p + 2)) +> ([0, 0, 0, 1] +> r))) := by + have ha : ([1, 0, 1, 0] : List (Fin 2)) +> ([0, 1, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ p) +> ([0, 0, 0, 1] +> r))) = + (([1, 0] : List (Fin 2)) ^ 2) +> ((([0, 1] : List (Fin 2)) ^ (p + 2)) +> ([0, 0, 0, 1] +> r)) := by + rw [hp2]; rfl + rw [ha, ← pow_add_append_right] + rw [h_mid] at s4 + have s5 := Borrow ((default : ListBlank (Fin 2)) <+ [0, 1, 1, 1, 0, 1, 0, 1]) (h + 4) p r + have s6 : (((default : ListBlank (Fin 2)) <+ [0, 1, 1, 1, 0, 1, 0, 1]) <{{B}} ((([1, 0] : List (Fin 2)) ^ (h + 5)) +> ((([0, 1] : List (Fin 2)) ^ (p + 1)) +> ([0, 0, 1, 0] +> r)))) [target_tm]⊢* + ((default : ListBlank (Fin 2)) <{{C}} ([1, 0, 1, 0] +> ([1, 1, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (h + 5)) +> ((([0, 1] : List (Fin 2)) ^ (p + 1)) +> ([0, 0, 1, 0] +> r)))))) := by execute + exact stepStar_trans s1 (stepStar_trans s2 (stepStar_trans s3 (stepStar_trans s4 (stepStar_trans s5 s6)))) + +theorem X1Sw (l : ListBlank (Fin 2)) (p : Nat) (r : ListBlank (Fin 2)) : + ((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ (p + 1))) <+ [0, 1, 1]) <+ [1, 1]) <+ [0]) <{{B}} r) [target_tm]⊢* + (l <{{B}} ((([0, 1] : List (Fin 2)) ^ (p + 1)) +> ([0, 0, 1, 0, 1, 0, 1] +> r))) := by + rw [pow_succ_append_left _ ([1, 0] : List (Fin 2)) p] + have s1 : (((((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 0]) <+ [0, 1, 1]) <+ [1, 1]) <+ [0]) <{{B}} r) [target_tm]⊢* + (((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <{{C}} ([1, 1, 0, 1, 0, 1, 0, 1] +> r)) := by execute + have s2 := shiftL_C_10 p (l <+ [0]) ([1, 1, 0, 1, 0, 1, 0, 1] +> r) + have s3 : ((l <+ [0]) <{{C}} ((([1, 0] : List (Fin 2)) ^ p) +> ([1, 1, 0, 1, 0, 1, 0, 1] +> r))) [target_tm]⊢* + ((l <+ [1]) {{D}}> ((([1, 0] : List (Fin 2)) ^ p) +> ([1, 1, 0, 1, 0, 1, 0, 1] +> r))) := by execute + have s4 := shiftR_D_10 p (l <+ [1]) ([1, 1, 0, 1, 0, 1, 0, 1] +> r) + have s5 : (((l <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ p)) {{D}}> ([1, 1, 0, 1, 0, 1, 0, 1] +> r)) [target_tm]⊢* + (((l <+ [1]) <+ (([1, 0] : List (Fin 2)) ^ p)) <{{C}} ([1, 0, 0, 1, 0, 1, 0, 1] +> r)) := by execute + have s6 := shiftL_C_10 p (l <+ [1]) ([1, 0, 0, 1, 0, 1, 0, 1] +> r) + have s7 : ((l <+ [1]) <{{C}} ((([1, 0] : List (Fin 2)) ^ p) +> ([1, 0, 0, 1, 0, 1, 0, 1] +> r))) [target_tm]⊢* + (l <{{B}} ([0] +> ((([1, 0] : List (Fin 2)) ^ p) +> ([1] +> ([0, 0, 1, 0, 1, 0, 1] +> r))))) := by execute + rw [← rotR_01_0 p ([1] +> ([0, 0, 1, 0, 1, 0, 1] +> r))] at s7 + have h01 : ([0] : List (Fin 2)) +> ([1] +> ([0, 0, 1, 0, 1, 0, 1] +> r)) = [0, 1] +> ([0, 0, 1, 0, 1, 0, 1] +> r) := rfl + rw [h01, pow_succ_append_right'] at s7 + exact stepStar_trans s1 (stepStar_trans s2 (stepStar_trans s3 (stepStar_trans s4 + (stepStar_trans s5 (stepStar_trans s6 s7))))) + +theorem X2T (l : ListBlank (Fin 2)) (p q k : Nat) : + ((((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ (q + 1))) <+ [1, 1]) <+ [0]) {{D}}> ([1, 0, 1, 1, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ (k + 1)) +> default))) [target_tm]⊢* + (l <{{B}} ((([1, 0] : List (Fin 2)) ^ (p + 1)) +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ 3) +> ((([0, 1] : List (Fin 2)) ^ (k + 1)) +> ([0, 0, 0, 1] +> default))))))) := by + rw [pow_succ_append_left _ ([1, 0] : List (Fin 2)) q, pow_succ_append_right ([0, 1] : List (Fin 2)) k] + set lq := (((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) + have s1 : ((((lq <+ [1, 0]) <+ [1, 1]) <+ [0]) {{D}}> ([1, 0, 1, 1, 0, 1] +> ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> default)))) [target_tm]⊢* + ((lq <+ [0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0]) {{C}}> ((([0, 1] : List (Fin 2)) ^ k) +> default)) := by execute + have s2 := shiftR_C_01 k (lq <+ [0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0]) default + have s3 : (((lq <+ [0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0]) <+ (([0, 1] : List (Fin 2)) ^ k)) {{C}}> default) [target_tm]⊢* + (((lq <+ [0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0]) <+ (([0, 1] : List (Fin 2)) ^ k)) <{{B}} ([1, 0, 0, 1] +> default)) := by execute + have s4 := shiftL_B_01 k (lq <+ [0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0]) ([1, 0, 0, 1] +> default) + have s5 : ((lq <+ [0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0]) <{{B}} ((([0, 1] : List (Fin 2)) ^ k) +> ([1, 0, 0, 1] +> default))) [target_tm]⊢* + ((lq <+ [0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0]) {{C}}> ((([0, 1] : List (Fin 2)) ^ k) +> ([1, 0, 0, 1] +> default))) := by execute + have s6 := shiftR_C_01 k (lq <+ [0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0]) ([1, 0, 0, 1] +> default) + have s7 : (((lq <+ [0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0]) <+ (([0, 1] : List (Fin 2)) ^ k)) {{C}}> ([1, 0, 0, 1] +> default)) [target_tm]⊢* + (((lq <+ [0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0]) <+ (([0, 1] : List (Fin 2)) ^ k)) <{{B}} ([0, 0, 0, 1] +> default)) := by execute + have s8 := shiftL_B_01 k (lq <+ [0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0]) ([0, 0, 0, 1] +> default) + have s9 : ((lq <+ [0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0]) <{{B}} ((([0, 1] : List (Fin 2)) ^ k) +> ([0, 0, 0, 1] +> default))) [target_tm]⊢* + (lq <{{C}} ([1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> ([0, 0, 0, 1] +> default)))) := by execute + have s10 := shiftL_C_10 q ((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) ([1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> ([0, 0, 0, 1] +> default))) + have s11 : (((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <{{C}} ((([1, 0] : List (Fin 2)) ^ q) +> ([1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> ([0, 0, 0, 1] +> default))))) [target_tm]⊢* + (((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 1, 1]) {{D}}> ((([1, 0] : List (Fin 2)) ^ q) +> ([1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> ([0, 0, 0, 1] +> default))))) := by execute + have s12 := shiftR_D_10 q ((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 1, 1]) ([1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> ([0, 0, 0, 1] +> default))) + have s13 : ((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) {{D}}> ([1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> ([0, 0, 0, 1] +> default)))) [target_tm]⊢* + ((((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ q)) <{{C}} ([1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> ([0, 0, 0, 1] +> default)))) := by execute + have s14 := shiftL_C_10 q ((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 1, 1]) ([1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> ([0, 0, 0, 1] +> default))) + have s15 : (((l <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [1, 1, 1]) <{{C}} ((([1, 0] : List (Fin 2)) ^ q) +> ([1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> ([0, 0, 0, 1] +> default))))) [target_tm]⊢* + ((l <+ (([1, 0] : List (Fin 2)) ^ p)) <{{B}} ([1] +> ([0] +> ([0] +> ((([1, 0] : List (Fin 2)) ^ q) +> ([1] +> ([0, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ 3) +> ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> ([0, 0, 0, 1] +> default))))))))))) := by execute + have s16 := shiftL6_B_10_look1 p l ([0] +> ([0] +> ((([1, 0] : List (Fin 2)) ^ q) +> ([1] +> ([0, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ 3) +> ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> ([0, 0, 0, 1] +> default))))))))) + have hr : ([1] : List (Fin 2)) +> ([0] +> ([0] +> ((([1, 0] : List (Fin 2)) ^ q) +> ([1] +> ([0, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ 3) +> ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> ([0, 0, 0, 1] +> default))))))))) = + [1, 0] +> ((([0, 1] : List (Fin 2)) ^ (q + 1)) +> ([0, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ 3) +> ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> ([0, 0, 0, 1] +> default)))))) := by + rw [← rotR_01_0 q ([1] +> ([0, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ 3) +> ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> ([0, 0, 0, 1] +> default))))))] + have h01 : ([0] : List (Fin 2)) +> ([1] +> ([0, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ 3) +> ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> ([0, 0, 0, 1] +> default)))))) = + [0, 1] +> ([0, 0, 1, 0] +> ((([1, 0] : List (Fin 2)) ^ 3) +> ([0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> ([0, 0, 0, 1] +> default))))) := rfl + rw [h01, pow_succ_append_right']; rfl + rw [pow_succ_append_right ([0, 1] : List (Fin 2)) k, ← pow_succ_append_right' ([1, 0] : List (Fin 2)) p, ← hr] + exact stepStar_trans s1 (stepStar_trans s2 (stepStar_trans s3 (stepStar_trans s4 + (stepStar_trans s5 (stepStar_trans s6 (stepStar_trans s7 (stepStar_trans s8 + (stepStar_trans s9 (stepStar_trans s10 (stepStar_trans s11 (stepStar_trans s12 + (stepStar_trans s13 (stepStar_trans s14 (stepStar_trans s15 s16)))))))))))))) +-- The family K and macro rules (Skelet1LikeC2_1RB1RF.v lines 104-360) +abbrev Tri := Nat × Nat × Bool + +def sd (d : Bool) : List (Fin 2) := + if d then [0, 0, 0, 1] else [0, 0, 1, 0] + +def RP : List Tri → ListBlank (Fin 2) → ListBlank (Fin 2) + | [], r => r + | (p, q, d) :: P', r => + ((([1, 0] : List (Fin 2)) ^ p) +> ((([0, 1] : List (Fin 2)) ^ q) +> (sd d +> RP P' r))) + +inductive Tl where + | TN + | TA (t : Nat) + | TB (k : Nat) + +def RT : Tl → ListBlank (Fin 2) + | .TN => default + | .TA t => ((([1, 0] : List (Fin 2)) ^ t) +> ([1] +> default)) + | .TB k => ([1, 0, 1, 1, 0, 1] +> ((([0, 1] : List (Fin 2)) ^ k) +> default)) + +def K (h : Nat) (P : List Tri) (T : Tl) : Cfg (Fin 2) (Fin 6) := + (default : ListBlank (Fin 2)) <{{C}} ((([1, 0] : List (Fin 2)) ^ h) +> ([1, 1, 0, 0, 1] +> RP P (RT T))) + +def reg (p q : Nat) (l : ListBlank (Fin 2)) : ListBlank (Fin 2) := + (((((l <+ [0]) <+ (([1, 0] : List (Fin 2)) ^ p)) <+ [0, 1, 1]) <+ (([1, 0] : List (Fin 2)) ^ (q - 1))) <+ [1, 1]) + +def LP : List Tri → ListBlank (Fin 2) → ListBlank (Fin 2) + | [], l => l + | (p, q, _) :: Z', l => LP Z' (reg p q l) + +def OvR : List Tri → ListBlank (Fin 2) → ListBlank (Fin 2) + | [], r => r + | (p, q, _) :: Z', r => + ((([0, 1] : List (Fin 2)) ^ p) +> ([0, 0, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ q) +> OvR Z' r))) + +def touch (x : Tri) : Tri := + match x with + | (p, q, d) => (p + 1, q - 1, !d) + +abbrev okR (x : Tri) : Prop := x.2.2 = false ∧ 1 ≤ x.2.1 + +abbrev okL (x : Tri) : Prop := x.2.2 = false ∧ 2 ≤ x.2.1 + +abbrev okO (x : Tri) : Prop := 1 ≤ x.1 ∧ 1 ≤ x.2.1 + +theorem RP_app (Z W : List Tri) (r : ListBlank (Fin 2)) : + RP (Z ++ W) r = RP Z (RP W r) := by + induction Z with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + simp only [List.cons_append, RP, ih] + +theorem LP_app (Z W : List Tri) (l : ListBlank (Fin 2)) : + LP (Z ++ W) l = LP W (LP Z l) := by + induction Z generalizing l with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + simp only [List.cons_append, LP, ih] + +theorem PassesR (Z : List Tri) (hZ : List.Forall okR Z) (l r : ListBlank (Fin 2)) : + ((l <+ [0]) {{D}}> RP Z r) [target_tm]⊢* ((LP Z l <+ [0]) {{D}}> r) := by + induction Z generalizing l r with + | nil => exact ⟨0, rfl⟩ + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + rw [List.forall_cons] at hZ + rcases hZ with ⟨⟨rfl, hq⟩, hZ'⟩ + dsimp at hq + cases q with + | zero => omega + | succ q => + dsimp [RP, LP, sd] + have h1 := PassR l p q (RP Z r) + have h2 := ih hZ' (reg p (q + 1) l) r + dsimp [reg] at h2 + exact stepStar_trans h1 h2 + +theorem PassesL (Z : List Tri) (hZ : List.Forall okL Z) (l r : ListBlank (Fin 2)) : + ((LP Z l <+ [0]) <{{B}} r) [target_tm]⊢* ((l <+ [0]) <{{B}} RP (Z.map touch) r) := by + induction Z generalizing l r with + | nil => exact ⟨0, rfl⟩ + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + rw [List.forall_cons] at hZ + rcases hZ with ⟨⟨rfl, hq⟩, hZ'⟩ + dsimp at hq + cases q with + | zero => omega + | succ q => + cases q with + | zero => omega + | succ q => + dsimp [LP, RP, List.map, touch, sd] + have h1 := ih hZ' (reg p (q + 2) l) r + have h2 := PassL l p q (RP (Z.map touch) r) + dsimp [reg] at h1 + exact stepStar_trans h1 h2 + +theorem OvPasses (Z : List Tri) (hZ : List.Forall okO Z) (l r : ListBlank (Fin 2)) : + (LP Z l <{{B}} r) [target_tm]⊢* (l <{{B}} OvR Z r) := by + induction Z generalizing l r with + | nil => exact ⟨0, rfl⟩ + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + rw [List.forall_cons] at hZ + rcases hZ with ⟨⟨hp, hq⟩, hZ'⟩ + dsimp at hp hq + cases p with + | zero => omega + | succ p => + cases q with + | zero => omega + | succ q => + dsimp [LP, OvR] + have h1 := ih hZ' (reg (p + 1) (q + 1) l) r + have h2 := OvL l p q (OvR Z r) + dsimp [reg] at h1 + exact stepStar_trans h1 h2 + +theorem okL_R (Z : List Tri) (hZ : List.Forall okL Z) : List.Forall okR Z := by + induction Z with + | nil => trivial + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + rw [List.forall_cons] at hZ ⊢ + dsimp [okL, okR] at hZ ⊢ + exact ⟨⟨hZ.1.1, by omega⟩, ih hZ.2⟩ + +theorem Forall_snoc {α : Type*} (P : α → Prop) (Z : List α) (x : α) + (hZ : List.Forall P Z) (hx : P x) : List.Forall P (Z ++ [x]) := by + rw [List.forall_append] + exact ⟨hZ, by simp [hx]⟩ + +theorem Dec (h : Nat) (Z : List Tri) (p q : Nat) (R : List Tri) (T : Tl) (hZ : List.Forall okL Z) : + (K h (Z ++ (p, q + 2, true) :: R) T) [target_tm]⊢⁺ + (K (4 + h) (Z.map touch ++ (p + 1, q + 1, false) :: R) T) := by + unfold K + rw [RP_app, RP_app] + dsimp [RP, sd] + exact stepPlus_stepStar_stepPlus (Start h _) + (stepStar_trans (PassesR Z (okL_R Z hZ) _ _) + (stepStar_trans (Borrow _ p q _) + (stepStar_trans (PassesL Z hZ _ _) (EndPh h _)))) + +theorem DecMerge (h : Nat) (Z : List Tri) (p p' q' : Nat) (d' : Bool) (R : List Tri) (T : Tl) + (hZ : List.Forall okL Z) : + (K h (Z ++ (p, 1, true) :: (p', q', d') :: R) T) [target_tm]⊢⁺ + (K (4 + h) (Z.map touch ++ (p + p' + 3, q', d') :: R) T) := by + unfold K + rw [RP_app, RP_app] + dsimp [RP, sd] + exact stepPlus_stepStar_stepPlus (Start h _) + (stepStar_trans (PassesR Z (okL_R Z hZ) _ _) + (stepStar_trans (MergeB _ p p' _) + (stepStar_trans (PassesL Z hZ _ _) (EndPh h _)))) + +theorem DecMergeTail (h : Nat) (Z : List Tri) (p t : Nat) (hZ : List.Forall okL Z) : + (K h (Z ++ [(p, 1, true)]) (.TA t)) [target_tm]⊢⁺ + (K (4 + h) (Z.map touch) (.TA (p + t + 3))) := by + unfold K + rw [RP_app] + dsimp [RP, sd, RT] + exact stepPlus_stepStar_stepPlus (Start h _) + (stepStar_trans (PassesR Z (okL_R Z hZ) _ _) + (stepStar_trans (MergeB _ p t _) + (stepStar_trans (PassesL Z hZ _ _) (EndPh h _)))) + +theorem DecMergeEmpty (h : Nat) (Z : List Tri) (p : Nat) (hZ : List.Forall okL Z) : + (K h (Z ++ [(p, 1, true)]) .TN) [target_tm]⊢⁺ + (K (4 + h) (Z.map touch) (.TA (p + 2))) := by + unfold K + rw [RP_app] + dsimp [RP, sd, RT] + exact stepPlus_stepStar_stepPlus (Start h _) + (stepStar_trans (PassesR Z (okL_R Z hZ) _ _) + (stepStar_trans (MergeE _ p) + (stepStar_trans (PassesL Z hZ _ _) (EndPh h _)))) + +theorem EndR (h : Nat) (Z : List Tri) (p q : Nat) (hZ : List.Forall okL Z) : + (K h (Z ++ [(p, q + 2, false)]) .TN) [target_tm]⊢⁺ + (K (4 + h) (Z.map touch ++ [(p + 1, q + 1, false)]) (.TA 1)) := by + unfold K + rw [RP_app, RP_app] + dsimp [RP, sd, RT] + exact stepPlus_stepStar_stepPlus (Start h _) + (stepStar_trans (PassesR Z (okL_R Z hZ) _ _) + (stepStar_trans (PassR _ p (q + 1) default) + (stepStar_trans (EndT _ p q) + (stepStar_trans (PassesL Z hZ _ _) (EndPh h _))))) + +theorem EndLast (h : Nat) (Z : List Tri) (p : Nat) (hZ : List.Forall okL Z) : + (K h (Z ++ [(p, 1, false)]) .TN) [target_tm]⊢⁺ + (K (4 + h) (Z.map touch) (.TA (p + 4))) := by + unfold K + rw [RP_app] + dsimp [RP, sd, RT] + exact stepPlus_stepStar_stepPlus (Start h _) + (stepStar_trans (PassesR Z (okL_R Z hZ) _ _) + (stepStar_trans (PassR _ p 0 default) + (stepStar_trans (EndLastT _ p) + (stepStar_trans (PassesL Z hZ _ _) (EndPh h _))))) + +theorem X2 (h : Nat) (Z : List Tri) (p q k : Nat) (hZ : List.Forall okL Z) : + (K h (Z ++ [(p, q + 2, false)]) (.TB (k + 1))) [target_tm]⊢⁺ + (K (4 + h) (Z.map touch ++ [(p + 1, q + 1, false), (3, k + 1, true)]) .TN) := by + unfold K + rw [RP_app, RP_app] + dsimp [RP, sd, RT] + exact stepPlus_stepStar_stepPlus (Start h _) + (stepStar_trans (PassesR Z (okL_R Z hZ) _ _) + (stepStar_trans (PassR _ p (q + 1) _) + (stepStar_trans (X2T _ p q k) + (stepStar_trans (PassesL Z hZ _ _) (EndPh h _))))) + +def ovp (q : Nat) : List Tri → Nat → List Tri + | [], t => [(q, t + 1, true)] + | (p', q', _) :: Z', t => (q, p', true) :: ovp q' Z' t + +theorem ovp_eq (Z : List Tri) (q t : Nat) : + RP (ovp q Z t) default = + ((([1, 0] : List (Fin 2)) ^ q) +> OvR Z ((([0, 1] : List (Fin 2)) ^ (t + 1)) +> ([0, 0, 0, 1] +> default))) := by + induction Z generalizing q with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p', q', d'⟩ + simp only [ovp, RP, OvR, sd, ↓reduceIte, ih q'] + +theorem Ov (h p1 q1 : Nat) (Z : List Tri) (t : Nat) + (hq : 1 ≤ q1) (hR : List.Forall okR Z) (hO : List.Forall okO Z) : + (K h ((p1 + 2, q1, false) :: Z) (.TA t)) [target_tm]⊢⁺ + (K 2 ((h + 5, p1 + 1, false) :: ovp q1 Z t) .TN) := by + cases q1 with + | zero => omega + | succ q1' => + unfold K + simp only [RP, sd, RT] + rw [ovp_eq Z (q1' + 1) t] + exact stepPlus_stepStar_stepPlus (Start h _) + (stepStar_trans (PassR _ (p1 + 2) q1' _) + (stepStar_trans (PassesR Z hR _ _) + (stepStar_trans (OvT _ t) + (stepStar_trans (OvPasses Z hO _ _) + (stepStar_trans (OvL _ (p1 + 1) q1' _) + (OvEnd h p1 _)))))) + +theorem OvEmpty (h p : Nat) : + (K h [] (.TA (p + 1))) [target_tm]⊢⁺ + (K 2 [(h + 5, p + 1, false)] .TN) := by + unfold K + dsimp [RP, RT, sd] + have s1 := Start h ((([1, 0] : List (Fin 2)) ^ (p + 1)) +> ([1] +> default)) + have s2 := OvT (((default : ListBlank (Fin 2)) <+ (([0, 1] : List (Fin 2)) ^ (4 + h))) <+ [1, 1, 1]) (p + 1) + have s3 := OvEnd h p default + exact stepPlus_stepStar_stepPlus s1 (stepStar_trans s2 s3) + +def ovpX (q : Nat) : List Tri → Nat → List Tri + | [], pa => [(q, pa, false)] + | (p', q', _) :: Z', pa => (q, p', true) :: ovpX q' Z' pa + +theorem ovpX_eq (Z : List Tri) (q pa : Nat) (r : ListBlank (Fin 2)) : + RP (ovpX q Z pa) r = + ((([1, 0] : List (Fin 2)) ^ q) +> OvR Z ((([0, 1] : List (Fin 2)) ^ pa) +> ([0, 0, 1, 0] +> r))) := by + induction Z generalizing q with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p', q', d'⟩ + simp only [ovpX, RP, OvR, sd, ↓reduceIte, ih q'] + +theorem tailB_eq (n : Nat) : + ([0, 0, 1, 0, 1, 0, 1] +> ((([1, 0] : List (Fin 2)) ^ (n + 1)) +> ([1] +> default))) = + ([0, 0, 1, 0] +> RT (.TB n)) := by + rw [pow_succ_append_right ([1, 0] : List (Fin 2)) n ([1] +> default)] + rw [← rotR_1_01 n default] + rfl + +theorem X1 (h p1 q1 : Nat) (Z : List Tri) (pa pb : Nat) + (hq : 1 ≤ q1) (hR : List.Forall okR Z) (hO : List.Forall okO Z) : + (K h ((p1 + 2, q1, false) :: (Z ++ [(pa + 1, 1, false), (pb, 1, false)])) .TN) [target_tm]⊢⁺ + (K 2 ((h + 5, p1 + 1, false) :: ovpX q1 Z (pa + 1)) (.TB (pb + 3))) := by + cases q1 with + | zero => omega + | succ q1' => + unfold K + simp only [RP, sd] + rw [RP_app] + simp only [RP, sd] + rw [ovpX_eq Z (q1' + 1) (pa + 1) (RT (.TB (pb + 3))), ← tailB_eq (pb + 3)] + have hpb : pb + 3 + 1 = pb + 4 := by omega + rw [hpb] + have htn : RT .TN = default := rfl + rw [htn] + exact stepPlus_stepStar_stepPlus (Start h _) + (stepStar_trans (PassR _ (p1 + 2) q1' _) + (stepStar_trans (PassesR Z hR _ _) + (stepStar_trans (PassR _ (pa + 1) 0 _) + (stepStar_trans (PassR _ pb 0 default) + (stepStar_trans (EndLastT _ pb) + (stepStar_trans (X1Sw _ pa _) + (stepStar_trans (OvPasses Z hO _ _) + (stepStar_trans (OvL _ (p1 + 1) q1' _) + (OvEnd h p1 _))))))))) +-- Initial trajectory: 359 steps to K 2 [(9, 1, false)] .TN, then 2 macro steps to K 2 [(11, 13, false)] .TN, then 57 macro steps to base +def cfg_step_33 : Cfg (Fin 2) (Fin 6) := + ((default) {{(1 : Fin 6)}}> ([0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1] +> default)) +def cfg_step_66 : Cfg (Fin 2) (Fin 6) := + ((default <+ [0, 1, 0, 1, 0, 1, 0, 1]) {{(2 : Fin 6)}}> ([0, 1, 1, 0, 1] +> default)) +def cfg_step_99 : Cfg (Fin 2) (Fin 6) := + ((default <+ [1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]) {{(2 : Fin 6)}}> ([1, 1] +> default)) +def cfg_step_132 : Cfg (Fin 2) (Fin 6) := + ((default <+ [0, 1, 0, 1, 0, 1, 0, 1]) {{(2 : Fin 6)}}> ([0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1] +> default)) +def cfg_step_165 : Cfg (Fin 2) (Fin 6) := + ((default <+ [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]) {{(3 : Fin 6)}}> ([1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1] +> default)) +def cfg_step_198 : Cfg (Fin 2) (Fin 6) := + ((default <+ [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]) {{(1 : Fin 6)}}> ([1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1] +> default)) +def cfg_step_231 : Cfg (Fin 2) (Fin 6) := + ((default <+ [1, 1, 1, 0, 1, 0, 1]) {{(4 : Fin 6)}}> ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1] +> default)) +def cfg_step_264 : Cfg (Fin 2) (Fin 6) := + ((default <+ [1, 0, 1, 0, 1]) {{(3 : Fin 6)}}> ([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1] +> default)) +def cfg_step_297 : Cfg (Fin 2) (Fin 6) := + ((default <+ [0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1]) {{(2 : Fin 6)}}> ([1, 0, 1] +> default)) +def cfg_step_330 : Cfg (Fin 2) (Fin 6) := + ((default <+ [1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1]) {{(1 : Fin 6)}}> ([1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1] +> default)) + +theorem init_to_359 : (init []) [target_tm]⊢* K 2 [(9, 1, false)] .TN := by + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{(0 : Fin 6)}}> default) := rfl + rw [h0] + have c1 : (default {{(0 : Fin 6)}}> default) [target_tm]⊢* cfg_step_33 := by dsimp [cfg_step_33]; execute + have c2 : cfg_step_33 [target_tm]⊢* cfg_step_66 := by dsimp [cfg_step_33, cfg_step_66]; execute + have c3 : cfg_step_66 [target_tm]⊢* cfg_step_99 := by dsimp [cfg_step_66, cfg_step_99]; execute + have c4 : cfg_step_99 [target_tm]⊢* cfg_step_132 := by dsimp [cfg_step_99, cfg_step_132]; execute + have c5 : cfg_step_132 [target_tm]⊢* cfg_step_165 := by dsimp [cfg_step_132, cfg_step_165]; execute + have c6 : cfg_step_165 [target_tm]⊢* cfg_step_198 := by dsimp [cfg_step_165, cfg_step_198]; execute + have c7 : cfg_step_198 [target_tm]⊢* cfg_step_231 := by dsimp [cfg_step_198, cfg_step_231]; execute + have c8 : cfg_step_231 [target_tm]⊢* cfg_step_264 := by dsimp [cfg_step_231, cfg_step_264]; execute + have c9 : cfg_step_264 [target_tm]⊢* cfg_step_297 := by dsimp [cfg_step_264, cfg_step_297]; execute + have c10 : cfg_step_297 [target_tm]⊢* cfg_step_330 := by dsimp [cfg_step_297, cfg_step_330]; execute + have c11 : cfg_step_330 [target_tm]⊢* K 2 [(9, 1, false)] .TN := by + dsimp [cfg_step_330, K, RP, RT, sd]; execute + exact stepStar_trans c1 (stepStar_trans c2 (stepStar_trans c3 (stepStar_trans c4 + (stepStar_trans c5 (stepStar_trans c6 (stepStar_trans c7 (stepStar_trans c8 + (stepStar_trans c9 (stepStar_trans c10 c11))))))))) + +theorem init0 : (init []) [target_tm]⊢* K 2 [(11, 13, false)] .TN := by + have s1 := init_to_359 + have s2 := stepPlus_stepStar (EndLast 2 [] 9 (by decide)) + have s3 := stepPlus_stepStar (OvEmpty 6 12) + exact stepStar_trans s1 (stepStar_trans s2 s3) + +def base : List Tri := + [(95, 68, false), (34, 33, true), (10, 15, true), (1, 26, true)] +theorem init_to_base : (init []) [target_tm]⊢* K 2 base .TN := by + have ms0 := init0 + have ms1 : (K 2 [(11, 13, false)] .TN) [target_tm]⊢* (K 6 [(12, 12, false)] (.TA 1)) := + stepPlus_stepStar (EndR 2 [] 11 11 (by decide)) + have ms2 : (K 6 [(12, 12, false)] (.TA 1)) [target_tm]⊢* (K 2 [(11, 11, false), (12, 2, true)] .TN) := + stepPlus_stepStar (Ov 6 10 12 [] 1 (by decide) (by decide) (by decide)) + have ms3 : (K 2 [(11, 11, false), (12, 2, true)] .TN) [target_tm]⊢* (K 6 [(12, 10, true), (13, 1, false)] .TN) := + stepPlus_stepStar (Dec 2 [(11, 11, false)] 12 0 [] .TN (by decide)) + have ms4 : (K 6 [(12, 10, true), (13, 1, false)] .TN) [target_tm]⊢* (K 10 [(13, 9, false), (13, 1, false)] .TN) := + stepPlus_stepStar (Dec 6 [] 12 8 [(13, 1, false)] .TN (by decide)) + have ms5 : (K 10 [(13, 9, false), (13, 1, false)] .TN) [target_tm]⊢* (K 14 [(14, 8, true)] (.TA 17)) := + stepPlus_stepStar (EndLast 10 [(13, 9, false)] 13 (by decide)) + have ms6 : (K 14 [(14, 8, true)] (.TA 17)) [target_tm]⊢* (K 18 [(15, 7, false)] (.TA 17)) := + stepPlus_stepStar (Dec 14 [] 14 6 [] (.TA 17) (by decide)) + have ms7 : (K 18 [(15, 7, false)] (.TA 17)) [target_tm]⊢* (K 2 [(23, 14, false), (7, 18, true)] .TN) := + stepPlus_stepStar (Ov 18 13 7 [] 17 (by decide) (by decide) (by decide)) + have ms8 : (K 2 [(23, 14, false), (7, 18, true)] .TN) [target_tm]⊢* (K 6 [(24, 13, true), (8, 17, false)] .TN) := + stepPlus_stepStar (Dec 2 [(23, 14, false)] 7 16 [] .TN (by decide)) + have ms9 : (K 6 [(24, 13, true), (8, 17, false)] .TN) [target_tm]⊢* (K 10 [(25, 12, false), (8, 17, false)] .TN) := + stepPlus_stepStar (Dec 6 [] 24 11 [(8, 17, false)] .TN (by decide)) + have ms10 : (K 10 [(25, 12, false), (8, 17, false)] .TN) [target_tm]⊢* (K 14 [(26, 11, true), (9, 16, false)] (.TA 1)) := + stepPlus_stepStar (EndR 10 [(25, 12, false)] 8 15 (by decide)) + have ms11 : (K 14 [(26, 11, true), (9, 16, false)] (.TA 1)) [target_tm]⊢* (K 18 [(27, 10, false), (9, 16, false)] (.TA 1)) := + stepPlus_stepStar (Dec 14 [] 26 9 [(9, 16, false)] (.TA 1) (by decide)) + have ms12 : (K 18 [(27, 10, false), (9, 16, false)] (.TA 1)) [target_tm]⊢* (K 2 [(23, 26, false), (10, 9, true), (16, 2, true)] .TN) := + stepPlus_stepStar (Ov 18 25 10 [(9, 16, false)] 1 (by decide) (by decide) (by decide)) + have ms13 : (K 2 [(23, 26, false), (10, 9, true), (16, 2, true)] .TN) [target_tm]⊢* (K 6 [(24, 25, true), (11, 8, false), (16, 2, true)] .TN) := + stepPlus_stepStar (Dec 2 [(23, 26, false)] 10 7 [(16, 2, true)] .TN (by decide)) + have ms14 : (K 6 [(24, 25, true), (11, 8, false), (16, 2, true)] .TN) [target_tm]⊢* (K 10 [(25, 24, false), (11, 8, false), (16, 2, true)] .TN) := + stepPlus_stepStar (Dec 6 [] 24 23 [(11, 8, false), (16, 2, true)] .TN (by decide)) + have ms15 : (K 10 [(25, 24, false), (11, 8, false), (16, 2, true)] .TN) [target_tm]⊢* (K 14 [(26, 23, true), (12, 7, true), (17, 1, false)] .TN) := + stepPlus_stepStar (Dec 10 [(25, 24, false), (11, 8, false)] 16 0 [] .TN (by decide)) + have ms16 : (K 14 [(26, 23, true), (12, 7, true), (17, 1, false)] .TN) [target_tm]⊢* (K 18 [(27, 22, false), (12, 7, true), (17, 1, false)] .TN) := + stepPlus_stepStar (Dec 14 [] 26 21 [(12, 7, true), (17, 1, false)] .TN (by decide)) + have ms17 : (K 18 [(27, 22, false), (12, 7, true), (17, 1, false)] .TN) [target_tm]⊢* (K 22 [(28, 21, true), (13, 6, false), (17, 1, false)] .TN) := + stepPlus_stepStar (Dec 18 [(27, 22, false)] 12 5 [(17, 1, false)] .TN (by decide)) + have ms18 : (K 22 [(28, 21, true), (13, 6, false), (17, 1, false)] .TN) [target_tm]⊢* (K 26 [(29, 20, false), (13, 6, false), (17, 1, false)] .TN) := + stepPlus_stepStar (Dec 22 [] 28 19 [(13, 6, false), (17, 1, false)] .TN (by decide)) + have ms19 : (K 26 [(29, 20, false), (13, 6, false), (17, 1, false)] .TN) [target_tm]⊢* (K 30 [(30, 19, true), (14, 5, true)] (.TA 21)) := + stepPlus_stepStar (EndLast 26 [(29, 20, false), (13, 6, false)] 17 (by decide)) + have ms20 : (K 30 [(30, 19, true), (14, 5, true)] (.TA 21)) [target_tm]⊢* (K 34 [(31, 18, false), (14, 5, true)] (.TA 21)) := + stepPlus_stepStar (Dec 30 [] 30 17 [(14, 5, true)] (.TA 21) (by decide)) + have ms21 : (K 34 [(31, 18, false), (14, 5, true)] (.TA 21)) [target_tm]⊢* (K 38 [(32, 17, true), (15, 4, false)] (.TA 21)) := + stepPlus_stepStar (Dec 34 [(31, 18, false)] 14 3 [] (.TA 21) (by decide)) + have ms22 : (K 38 [(32, 17, true), (15, 4, false)] (.TA 21)) [target_tm]⊢* (K 42 [(33, 16, false), (15, 4, false)] (.TA 21)) := + stepPlus_stepStar (Dec 38 [] 32 15 [(15, 4, false)] (.TA 21) (by decide)) + have ms23 : (K 42 [(33, 16, false), (15, 4, false)] (.TA 21)) [target_tm]⊢* (K 2 [(47, 32, false), (16, 15, true), (4, 22, true)] .TN) := + stepPlus_stepStar (Ov 42 31 16 [(15, 4, false)] 21 (by decide) (by decide) (by decide)) + have ms24 : (K 2 [(47, 32, false), (16, 15, true), (4, 22, true)] .TN) [target_tm]⊢* (K 6 [(48, 31, true), (17, 14, false), (4, 22, true)] .TN) := + stepPlus_stepStar (Dec 2 [(47, 32, false)] 16 13 [(4, 22, true)] .TN (by decide)) + have ms25 : (K 6 [(48, 31, true), (17, 14, false), (4, 22, true)] .TN) [target_tm]⊢* (K 10 [(49, 30, false), (17, 14, false), (4, 22, true)] .TN) := + stepPlus_stepStar (Dec 6 [] 48 29 [(17, 14, false), (4, 22, true)] .TN (by decide)) + have ms26 : (K 10 [(49, 30, false), (17, 14, false), (4, 22, true)] .TN) [target_tm]⊢* (K 14 [(50, 29, true), (18, 13, true), (5, 21, false)] .TN) := + stepPlus_stepStar (Dec 10 [(49, 30, false), (17, 14, false)] 4 20 [] .TN (by decide)) + have ms27 : (K 14 [(50, 29, true), (18, 13, true), (5, 21, false)] .TN) [target_tm]⊢* (K 18 [(51, 28, false), (18, 13, true), (5, 21, false)] .TN) := + stepPlus_stepStar (Dec 14 [] 50 27 [(18, 13, true), (5, 21, false)] .TN (by decide)) + have ms28 : (K 18 [(51, 28, false), (18, 13, true), (5, 21, false)] .TN) [target_tm]⊢* (K 22 [(52, 27, true), (19, 12, false), (5, 21, false)] .TN) := + stepPlus_stepStar (Dec 18 [(51, 28, false)] 18 11 [(5, 21, false)] .TN (by decide)) + have ms29 : (K 22 [(52, 27, true), (19, 12, false), (5, 21, false)] .TN) [target_tm]⊢* (K 26 [(53, 26, false), (19, 12, false), (5, 21, false)] .TN) := + stepPlus_stepStar (Dec 22 [] 52 25 [(19, 12, false), (5, 21, false)] .TN (by decide)) + have ms30 : (K 26 [(53, 26, false), (19, 12, false), (5, 21, false)] .TN) [target_tm]⊢* (K 30 [(54, 25, true), (20, 11, true), (6, 20, false)] (.TA 1)) := + stepPlus_stepStar (EndR 26 [(53, 26, false), (19, 12, false)] 5 19 (by decide)) + have ms31 : (K 30 [(54, 25, true), (20, 11, true), (6, 20, false)] (.TA 1)) [target_tm]⊢* (K 34 [(55, 24, false), (20, 11, true), (6, 20, false)] (.TA 1)) := + stepPlus_stepStar (Dec 30 [] 54 23 [(20, 11, true), (6, 20, false)] (.TA 1) (by decide)) + have ms32 : (K 34 [(55, 24, false), (20, 11, true), (6, 20, false)] (.TA 1)) [target_tm]⊢* (K 38 [(56, 23, true), (21, 10, false), (6, 20, false)] (.TA 1)) := + stepPlus_stepStar (Dec 34 [(55, 24, false)] 20 9 [(6, 20, false)] (.TA 1) (by decide)) + have ms33 : (K 38 [(56, 23, true), (21, 10, false), (6, 20, false)] (.TA 1)) [target_tm]⊢* (K 42 [(57, 22, false), (21, 10, false), (6, 20, false)] (.TA 1)) := + stepPlus_stepStar (Dec 38 [] 56 21 [(21, 10, false), (6, 20, false)] (.TA 1) (by decide)) + have ms34 : (K 42 [(57, 22, false), (21, 10, false), (6, 20, false)] (.TA 1)) [target_tm]⊢* (K 2 [(47, 56, false), (22, 21, true), (10, 6, true), (20, 2, true)] .TN) := + stepPlus_stepStar (Ov 42 55 22 [(21, 10, false), (6, 20, false)] 1 (by decide) (by decide) (by decide)) + have ms35 : (K 2 [(47, 56, false), (22, 21, true), (10, 6, true), (20, 2, true)] .TN) [target_tm]⊢* (K 6 [(48, 55, true), (23, 20, false), (10, 6, true), (20, 2, true)] .TN) := + stepPlus_stepStar (Dec 2 [(47, 56, false)] 22 19 [(10, 6, true), (20, 2, true)] .TN (by decide)) + have ms36 : (K 6 [(48, 55, true), (23, 20, false), (10, 6, true), (20, 2, true)] .TN) [target_tm]⊢* (K 10 [(49, 54, false), (23, 20, false), (10, 6, true), (20, 2, true)] .TN) := + stepPlus_stepStar (Dec 6 [] 48 53 [(23, 20, false), (10, 6, true), (20, 2, true)] .TN (by decide)) + have ms37 : (K 10 [(49, 54, false), (23, 20, false), (10, 6, true), (20, 2, true)] .TN) [target_tm]⊢* (K 14 [(50, 53, true), (24, 19, true), (11, 5, false), (20, 2, true)] .TN) := + stepPlus_stepStar (Dec 10 [(49, 54, false), (23, 20, false)] 10 4 [(20, 2, true)] .TN (by decide)) + have ms38 : (K 14 [(50, 53, true), (24, 19, true), (11, 5, false), (20, 2, true)] .TN) [target_tm]⊢* (K 18 [(51, 52, false), (24, 19, true), (11, 5, false), (20, 2, true)] .TN) := + stepPlus_stepStar (Dec 14 [] 50 51 [(24, 19, true), (11, 5, false), (20, 2, true)] .TN (by decide)) + have ms39 : (K 18 [(51, 52, false), (24, 19, true), (11, 5, false), (20, 2, true)] .TN) [target_tm]⊢* (K 22 [(52, 51, true), (25, 18, false), (11, 5, false), (20, 2, true)] .TN) := + stepPlus_stepStar (Dec 18 [(51, 52, false)] 24 17 [(11, 5, false), (20, 2, true)] .TN (by decide)) + have ms40 : (K 22 [(52, 51, true), (25, 18, false), (11, 5, false), (20, 2, true)] .TN) [target_tm]⊢* (K 26 [(53, 50, false), (25, 18, false), (11, 5, false), (20, 2, true)] .TN) := + stepPlus_stepStar (Dec 22 [] 52 49 [(25, 18, false), (11, 5, false), (20, 2, true)] .TN (by decide)) + have ms41 : (K 26 [(53, 50, false), (25, 18, false), (11, 5, false), (20, 2, true)] .TN) [target_tm]⊢* (K 30 [(54, 49, true), (26, 17, true), (12, 4, true), (21, 1, false)] .TN) := + stepPlus_stepStar (Dec 26 [(53, 50, false), (25, 18, false), (11, 5, false)] 20 0 [] .TN (by decide)) + have ms42 : (K 30 [(54, 49, true), (26, 17, true), (12, 4, true), (21, 1, false)] .TN) [target_tm]⊢* (K 34 [(55, 48, false), (26, 17, true), (12, 4, true), (21, 1, false)] .TN) := + stepPlus_stepStar (Dec 30 [] 54 47 [(26, 17, true), (12, 4, true), (21, 1, false)] .TN (by decide)) + have ms43 : (K 34 [(55, 48, false), (26, 17, true), (12, 4, true), (21, 1, false)] .TN) [target_tm]⊢* (K 38 [(56, 47, true), (27, 16, false), (12, 4, true), (21, 1, false)] .TN) := + stepPlus_stepStar (Dec 34 [(55, 48, false)] 26 15 [(12, 4, true), (21, 1, false)] .TN (by decide)) + have ms44 : (K 38 [(56, 47, true), (27, 16, false), (12, 4, true), (21, 1, false)] .TN) [target_tm]⊢* (K 42 [(57, 46, false), (27, 16, false), (12, 4, true), (21, 1, false)] .TN) := + stepPlus_stepStar (Dec 38 [] 56 45 [(27, 16, false), (12, 4, true), (21, 1, false)] .TN (by decide)) + have ms45 : (K 42 [(57, 46, false), (27, 16, false), (12, 4, true), (21, 1, false)] .TN) [target_tm]⊢* (K 46 [(58, 45, true), (28, 15, true), (13, 3, false), (21, 1, false)] .TN) := + stepPlus_stepStar (Dec 42 [(57, 46, false), (27, 16, false)] 12 2 [(21, 1, false)] .TN (by decide)) + have ms46 : (K 46 [(58, 45, true), (28, 15, true), (13, 3, false), (21, 1, false)] .TN) [target_tm]⊢* (K 50 [(59, 44, false), (28, 15, true), (13, 3, false), (21, 1, false)] .TN) := + stepPlus_stepStar (Dec 46 [] 58 43 [(28, 15, true), (13, 3, false), (21, 1, false)] .TN (by decide)) + have ms47 : (K 50 [(59, 44, false), (28, 15, true), (13, 3, false), (21, 1, false)] .TN) [target_tm]⊢* (K 54 [(60, 43, true), (29, 14, false), (13, 3, false), (21, 1, false)] .TN) := + stepPlus_stepStar (Dec 50 [(59, 44, false)] 28 13 [(13, 3, false), (21, 1, false)] .TN (by decide)) + have ms48 : (K 54 [(60, 43, true), (29, 14, false), (13, 3, false), (21, 1, false)] .TN) [target_tm]⊢* (K 58 [(61, 42, false), (29, 14, false), (13, 3, false), (21, 1, false)] .TN) := + stepPlus_stepStar (Dec 54 [] 60 41 [(29, 14, false), (13, 3, false), (21, 1, false)] .TN (by decide)) + have ms49 : (K 58 [(61, 42, false), (29, 14, false), (13, 3, false), (21, 1, false)] .TN) [target_tm]⊢* (K 62 [(62, 41, true), (30, 13, true), (14, 2, true)] (.TA 25)) := + stepPlus_stepStar (EndLast 58 [(61, 42, false), (29, 14, false), (13, 3, false)] 21 (by decide)) + have ms50 : (K 62 [(62, 41, true), (30, 13, true), (14, 2, true)] (.TA 25)) [target_tm]⊢* (K 66 [(63, 40, false), (30, 13, true), (14, 2, true)] (.TA 25)) := + stepPlus_stepStar (Dec 62 [] 62 39 [(30, 13, true), (14, 2, true)] (.TA 25) (by decide)) + have ms51 : (K 66 [(63, 40, false), (30, 13, true), (14, 2, true)] (.TA 25)) [target_tm]⊢* (K 70 [(64, 39, true), (31, 12, false), (14, 2, true)] (.TA 25)) := + stepPlus_stepStar (Dec 66 [(63, 40, false)] 30 11 [(14, 2, true)] (.TA 25) (by decide)) + have ms52 : (K 70 [(64, 39, true), (31, 12, false), (14, 2, true)] (.TA 25)) [target_tm]⊢* (K 74 [(65, 38, false), (31, 12, false), (14, 2, true)] (.TA 25)) := + stepPlus_stepStar (Dec 70 [] 64 37 [(31, 12, false), (14, 2, true)] (.TA 25) (by decide)) + have ms53 : (K 74 [(65, 38, false), (31, 12, false), (14, 2, true)] (.TA 25)) [target_tm]⊢* (K 78 [(66, 37, true), (32, 11, true), (15, 1, false)] (.TA 25)) := + stepPlus_stepStar (Dec 74 [(65, 38, false), (31, 12, false)] 14 0 [] (.TA 25) (by decide)) + have ms54 : (K 78 [(66, 37, true), (32, 11, true), (15, 1, false)] (.TA 25)) [target_tm]⊢* (K 82 [(67, 36, false), (32, 11, true), (15, 1, false)] (.TA 25)) := + stepPlus_stepStar (Dec 78 [] 66 35 [(32, 11, true), (15, 1, false)] (.TA 25) (by decide)) + have ms55 : (K 82 [(67, 36, false), (32, 11, true), (15, 1, false)] (.TA 25)) [target_tm]⊢* (K 86 [(68, 35, true), (33, 10, false), (15, 1, false)] (.TA 25)) := + stepPlus_stepStar (Dec 82 [(67, 36, false)] 32 9 [(15, 1, false)] (.TA 25) (by decide)) + have ms56 : (K 86 [(68, 35, true), (33, 10, false), (15, 1, false)] (.TA 25)) [target_tm]⊢* (K 90 [(69, 34, false), (33, 10, false), (15, 1, false)] (.TA 25)) := + stepPlus_stepStar (Dec 86 [] 68 33 [(33, 10, false), (15, 1, false)] (.TA 25) (by decide)) + have ms57 : (K 90 [(69, 34, false), (33, 10, false), (15, 1, false)] (.TA 25)) [target_tm]⊢* (K 2 [(95, 68, false), (34, 33, true), (10, 15, true), (1, 26, true)] .TN) := + stepPlus_stepStar (Ov 90 67 34 [(33, 10, false), (15, 1, false)] 25 (by decide) (by decide) (by decide)) + exact stepStar_trans ms0 (stepStar_trans ms1 (stepStar_trans ms2 (stepStar_trans ms3 + (stepStar_trans ms4 (stepStar_trans ms5 (stepStar_trans ms6 (stepStar_trans ms7 + (stepStar_trans ms8 (stepStar_trans ms9 (stepStar_trans ms10 (stepStar_trans ms11 + (stepStar_trans ms12 (stepStar_trans ms13 (stepStar_trans ms14 (stepStar_trans ms15 + (stepStar_trans ms16 (stepStar_trans ms17 (stepStar_trans ms18 (stepStar_trans ms19 + (stepStar_trans ms20 (stepStar_trans ms21 (stepStar_trans ms22 (stepStar_trans ms23 + (stepStar_trans ms24 (stepStar_trans ms25 (stepStar_trans ms26 (stepStar_trans ms27 + (stepStar_trans ms28 (stepStar_trans ms29 (stepStar_trans ms30 (stepStar_trans ms31 + (stepStar_trans ms32 (stepStar_trans ms33 (stepStar_trans ms34 (stepStar_trans ms35 + (stepStar_trans ms36 (stepStar_trans ms37 (stepStar_trans ms38 (stepStar_trans ms39 + (stepStar_trans ms40 (stepStar_trans ms41 (stepStar_trans ms42 (stepStar_trans ms43 + (stepStar_trans ms44 (stepStar_trans ms45 (stepStar_trans ms46 (stepStar_trans ms47 + (stepStar_trans ms48 (stepStar_trans ms49 (stepStar_trans ms50 (stepStar_trans ms51 + (stepStar_trans ms52 (stepStar_trans ms53 (stepStar_trans ms54 (stepStar_trans ms55 + (stepStar_trans ms56 ms57)))))))))))))))))))))))))))))))))))))))))))))))))))))))) +-- ============================================================================ +-- Arithmetic Invariant Layer (Skelet1LikeC2_1RB1RF.v lines 369-862) +-- ============================================================================ + +def bv (d : Bool) : Nat := if d then 1 else 0 + +def dv : List Tri → Nat + | [] => 0 + | (_, _, d) :: P' => bv d + 2 * dv P' + +abbrev dig (x : Tri) : Bool := x.2.2 +abbrev dig0 (x : Tri) : Prop := dig x = false + +theorem pow_pos (n : Nat) : 1 ≤ 2 ^ n := Nat.one_le_two_pow + +theorem pow_S (n : Nat) : 2 ^ (n + 1) = 2 * 2 ^ n := by ring + +theorem nat_ge_or_mod2 (a b c : Nat) (h : ¬(a ≥ b) → c % 2 = 0) : a ≥ b ∨ c % 2 = 0 := + if hab : a ≥ b then Or.inl hab else Or.inr (h hab) + +theorem dv_lt (P : List Tri) : dv P < 2 ^ P.length := by + induction P with + | nil => decide + | cons x P ih => + rcases x with ⟨p, q, d⟩ + dsimp [dv, List.length, bv] + rw [pow_S] + cases d <;> dsimp <;> omega + +theorem dv_zeros (Z R : List Tri) (hZ : List.Forall dig0 Z) : + dv (Z ++ R) = 2 ^ Z.length * dv R := by + induction Z with + | nil => simp [dv] + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + rw [List.forall_cons] at hZ + rcases hZ with ⟨hd, hZ'⟩ + dsimp [dig0, dig] at hd + subst hd + dsimp [dv, bv, List.length] + rw [pow_S, ih hZ'] + ring + +theorem dv_tz (Z R : List Tri) (hZ : List.Forall dig0 Z) : + dv (Z.map touch ++ R) + 1 = 2 ^ Z.length + 2 ^ Z.length * dv R := by + induction Z with + | nil => + simp only [List.map_nil, List.nil_append, List.length_nil, pow_zero] + omega + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + rw [List.forall_cons] at hZ + rcases hZ with ⟨hd, hZ'⟩ + dsimp [dig0, dig] at hd + subst hd + simp only [List.map_cons, List.cons_append, touch, Bool.not_false, dv, bv, ↓reduceIte, List.length_cons, pow_S] + have ih' := ih hZ' + have hmul : (2 * 2 ^ Z.length) * dv R = 2 * (2 ^ Z.length * dv R) := by ring + omega + +def AllI (Pr : Nat → Tri → List Tri → Prop) : Nat → List Tri → Prop + | _, [] => True + | i, x :: Y => Pr i x Y ∧ AllI Pr (i + 1) Y + +theorem AllI_app (Pr : Nat → Tri → List Tri → Prop) (Z : List Tri) (i : Nat) (R : List Tri) + (h : AllI Pr i (Z ++ R)) : AllI Pr (i + Z.length) R := by + induction Z generalizing i with + | nil => simpa using h + | cons x Z ih => + dsimp [AllI, List.length] at h ⊢ + have h' := ih (i + 1) h.2 + have heq : i + 1 + Z.length = i + (Z.length + 1) := by omega + rwa [heq] at h' + +theorem AllI_mono (Pr Pr' : Nat → Tri → List Tri → Prop) (P : List Tri) (i : Nat) + (hm : ∀ j x Y, i ≤ j → Pr j x Y → Pr' j x Y) (h : AllI Pr i P) : AllI Pr' i P := by + induction P generalizing i with + | nil => trivial + | cons x P ih => + dsimp [AllI] at h ⊢ + exact ⟨hm i x P (Nat.le_refl i) h.1, ih (i + 1) (fun j y Y hj => hm j y Y (by omega)) h.2⟩ + +theorem AllI_shift (Pr Pr' : Nat → Tri → List Tri → Prop) (P : List Tri) (i : Nat) + (hm : ∀ j x Y, i ≤ j → Pr (j + 1) x Y → Pr' j x Y) (h : AllI Pr (i + 1) P) : AllI Pr' i P := by + induction P generalizing i with + | nil => trivial + | cons x P ih => + dsimp [AllI] at h ⊢ + exact ⟨hm i x P (Nat.le_refl i) h.1, ih (i + 1) (fun j y Y hj => hm j y Y (by omega)) h.2⟩ + +theorem AllI_touchZ (Pr Pr' : Nat → Tri → List Tri → Prop) (R R' Z : List Tri) (i : Nat) + (hZ : List.Forall dig0 Z) + (hob : ∀ j p q Zr, List.Forall dig0 Zr → j + (Zr.length + 1) = i + Z.length → + Pr j (p, q, false) (Zr ++ R) → Pr' j (p + 1, q - 1, true) (Zr.map touch ++ R')) + (hA : AllI Pr i (Z ++ R)) + (hR : AllI Pr' (i + Z.length) R') : + AllI Pr' i (Z.map touch ++ R') := by + induction Z generalizing i with + | nil => simpa using hR + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + rw [List.forall_cons] at hZ + rcases hZ with ⟨hd, hZ'⟩ + dsimp [dig0, dig] at hd + subst hd + simp only [List.length_cons] at hob hR ⊢ + dsimp [AllI, List.map, touch] at hA ⊢ + refine ⟨hob i p q Z hZ' (by omega) hA.1, ?_⟩ + have heq : i + (Z.length + 1) = (i + 1) + Z.length := by omega + rw [heq] at hR + exact ih (i + 1) hZ' (fun j p' q' Zr hZr hj => hob j p' q' Zr hZr (by omega)) hA.2 hR + +inductive Phase where + | E1 | E2 | E1t | E2t | T0 | L1 | L2 | LX + deriving DecidableEq + +def PN (ph : Phase) (c4 : Bool) (p q n tv : Nat) : Prop := + match ph with + | .E1 => match n with + | 0 => q ≥ tv + 2 ^ n + 1 ∧ p + tv + 2 ^ n ≥ 3 + | _ + 1 => q ≥ tv + 3 * 2 ^ n + 1 ∧ (p + tv) % 2 = 1 ∧ p + tv + 2 ^ n ≥ 3 * 2 ^ n + | .E2 => match n with + | 0 => q ≥ tv + 1 ∧ p + tv ≥ 3 + | _ + 1 => q ≥ tv + 2 * 2 ^ n + 1 ∧ (p + tv) % 2 = 1 ∧ p + tv ≥ 3 * 2 ^ n + | .E1t => match n with + | 0 => q ≥ tv + 2 ^ n + 1 ∧ p + tv + 2 ^ n = 5 + | _ + 1 => q ≥ tv + 2 * 2 ^ n + 1 ∧ (p + tv) % 2 = 1 ∧ p + tv + 2 ^ n ≥ 3 * 2 ^ n + | .E2t => match n with + | 0 => q ≥ tv + 1 ∧ p + tv = 5 + | _ + 1 => q ≥ tv + 2 ^ n + 1 ∧ (p + tv) % 2 = 1 ∧ p + tv ≥ 3 * 2 ^ n + | .T0 => q ≥ tv + 7 * 2 ^ n + 1 ∧ p + tv + 5 * 2 ^ n ≥ 6 * 2 ^ n ∧ + match n with + | 0 => tv = 0 ∧ p % 2 = 0 + | _ + 1 => (p + tv) % 2 = 1 + | .L1 => q + 2 ^ n ≥ tv + 2 ∧ + match n with + | 0 => q = tv + 2 ^ n + | 1 => p + tv + 2 ^ n ≥ (if c4 then 4 else 5) * 2 ^ n ∧ + (q ≥ tv + 2 ^ n + 1 ∨ (q + tv) % 2 = 0) ∧ (if c4 then q = tv + 2 ^ n else True) + | _ + 2 => p + tv + 2 ^ n ≥ (if c4 then 4 else 5) * 2 ^ n ∧ (q + tv) % 2 = 0 + | .LX => match n with + | 0 => q = tv + 1 + | 1 => p + tv ≥ 4 * 2 ^ n ∧ q = tv + 1 + | _ + 2 => p + tv ≥ 4 * 2 ^ n ∧ (q + tv) % 2 = 0 + | .L2 => p + tv ≥ (if c4 then 4 else 5) * (2 * 2 ^ n) ∧ + match n with + | 0 => (q ≥ tv + 1 ∨ (q + tv) % 2 = 0) ∧ (if c4 then q = tv else True) + | _ + 1 => (q + tv) % 2 = 0 + +def PI (ph : Phase) (h i p q n tv : Nat) : Prop := + match i with + | 1 => h % 2 = 0 ∧ + match ph with + | .E1 | .E1t => 2 ≤ n ∧ p + tv + 2 ^ n + 3 ≥ 11 * 2 ^ n ∧ h + 4 * (tv + 2 ^ n) + 6 ≥ 12 * 2 ^ n + | .E2 | .E2t => 2 ≤ n ∧ p + tv + 3 ≥ 11 * 2 ^ n ∧ h + 4 * tv + 6 ≥ 12 * 2 ^ n + | .T0 => 2 ≤ n ∧ p + tv + 5 * 2 ^ n + 3 ≥ 22 * 2 ^ n ∧ h + 4 * (tv + 5 * 2 ^ n) + 6 ≥ 24 * 2 ^ n + | .L1 => 2 ≤ n ∧ q ≥ tv + 3 * 2 ^ n ∧ h + 4 * (tv + 2 ^ n) + 6 ≥ 8 * 2 ^ n + | .LX => 3 ≤ n ∧ q ≥ tv + 2 * 2 ^ n ∧ h + 4 * tv + 6 ≥ 8 * 2 ^ n + | .L2 => 1 ≤ n ∧ q ≥ tv + 4 * 2 ^ n ∧ h + 4 * tv + 6 ≥ 16 * 2 ^ n + | 2 => match ph with + | .E1 | .E1t => p + tv + 2 ^ n + 1 ≥ 7 * 2 ^ n + | .E2 | .E2t => p + tv + 1 ≥ 7 * 2 ^ n + | .T0 => p + tv + 5 * 2 ^ n + 1 ≥ 14 * 2 ^ n + | .L1 => q ≥ tv + 2 ^ n + 1 + | .LX | .L2 => q ≥ tv + 1 + | _ => True + +def PC (ph : Phase) (c4 : Bool) (h i p q n tv : Nat) : Prop := + 1 ≤ p ∧ 1 ≤ q ∧ PN ph c4 p q n tv ∧ PI ph h i p q n tv + +def Lift (Pr : Nat → Nat → Nat → Nat → Nat → Prop) (i : Nat) (x : Tri) (Y : List Tri) : Prop := + match x with + | (p, q, _) => Pr i p q Y.length (dv (x :: Y)) + +def PCx (ph : Phase) (c4 : Bool) (h : Nat) : Nat → Tri → List Tri → Prop := + Lift (PC ph c4 h) +-- Per-pair obligation lemmas (Skelet1LikeC2_1RB1RF.v lines 539-717) + +theorem ob_touch (ph : Phase) (c4 : Bool) (h i p q n tv : Nat) + (ht : 1 ≤ tv) (hq : 2 ≤ q) (hPC : PC ph c4 h i p q n tv) : + PC ph c4 (4 + h) i (p + 1) (q - 1) n (tv - 1) := by + have hpow := pow_pos n + rcases hPC with ⟨hp1, hq1, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN ⊢ + cases ph <;> cases c4 <;> rcases n with _ | _ | n <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN ⊢) <;> + ((repeat' apply And.intro) <;> (try trivial) <;> (try (apply nat_ge_or_mod2; intro _)) <;> omega) + · simp -failIfUnchanged only [PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hI ⊢ + rcases i with _ | _ | _ | i <;> try trivial + all_goals (cases ph <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hI ⊢) <;> omega) + +theorem ob_merge (ph : Phase) (c4 : Bool) (h i p q n u U : Nat) + (hph : ph = .L1 ∨ ph = .L2 ∨ ph = .LX) + (hn : 1 ≤ n) (hu : 2 ≤ u) (hu2 : u % 2 = 0) (hU2 : U % 2 = 0) (hUu : U + u ≤ 2 * 2 ^ n) + (hL1 : ph = .L1 → U + u ≤ 2 ^ n) (hLX : ph = .LX → 2 ≤ n) (hc4 : ph = .L1 → c4 = true → 2 ≤ n) + (hi1 : i = 1 → 2 ≤ n) (hiX : ph = .LX → i = 1 → 3 ≤ n) (hq : 2 ≤ q) + (hPC : PC ph c4 h i p q (n + 1) (u + 2 * U)) : + PC ph c4 (4 + h) i (p + 1) (q - 1) n (u - 1 + U) := by + have hpow := pow_pos n + have hpowS := pow_S n + rcases hPC with ⟨hp1, hq1, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN ⊢ + rw [hpowS] at hN + rcases hph with rfl | rfl | rfl + · have hL1' := hL1 rfl + have hc4' := hc4 rfl + cases c4 <;> (rcases n with _ | _ | n <;> try omega) + all_goals ( + (try have := hc4' rfl) + (try rw [pow_S] at hN hUu hL1' hpow ⊢) + (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN hUu hL1' hpow ⊢) + (repeat' apply And.intro) <;> (try trivial) <;> (try (apply nat_ge_or_mod2; intro _)) <;> omega) + · cases c4 <;> (rcases n with _ | _ | n <;> try omega) + all_goals ( + (try rw [pow_S] at hN hUu hpow ⊢) + (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN ⊢) + omega) + · have hLX' := hLX rfl + rcases n with _ | _ | n <;> omega + · simp -failIfUnchanged only [PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hI ⊢ + rw [hpowS] at hI + rcases i with _ | _ | _ | i <;> try trivial + · have hi1' := hi1 rfl + rcases hph with rfl | rfl | rfl + · have hL1' := hL1 rfl; (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hI ⊢); omega + · (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hI ⊢); omega + · have hLX' := hLX rfl; have hiX' := hiX rfl rfl; (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hI ⊢); omega + · rcases hph with rfl | rfl | rfl <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hI ⊢) <;> omega + +theorem ob_mt (c4 : Bool) (h i p q n : Nat) (hq : 2 ≤ q) (hi1 : i = 1 → 1 ≤ n) + (hPC : PC .L2 c4 h i p q (n + 1) (2 * 2 ^ n)) : + PC .L2 false (4 + h) i (p + 1) (q - 1) n (2 * 2 ^ n - 1) := by + have hpow := pow_pos n + have hpowS := pow_S n + rcases hPC with ⟨hp1, hq1, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN ⊢ + rw [hpowS] at hN + cases c4 <;> rcases n with _ | n <;> (try rw [pow_S] at hN hpow ⊢) <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN ⊢) <;> + ((repeat' apply And.intro) <;> (try trivial) <;> (try (apply nat_ge_or_mod2; intro _)) <;> omega) + · simp -failIfUnchanged only [PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hI ⊢ + rw [hpowS] at hI + rcases i with _ | _ | _ | i <;> try trivial + · have := hi1 rfl; (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hI ⊢); omega + · (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hI ⊢); omega + +theorem ob_fuse (ph : Phase) (c4 : Bool) (h h' k p p' q' n tv : Nat) + (hph : ph = .L1 ∨ ph = .L2 ∨ ph = .LX) (hk : 3 ≤ k) + (hPC : PC ph c4 h (k + 1) p' q' n tv) : + PC ph c4 h' k (p + p' + 3) q' n tv := by + have hpow := pow_pos n + rcases hPC with ⟨hp1, hq1, hN, _⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN ⊢ + rcases hph with rfl | rfl | rfl <;> cases c4 <;> rcases n with _ | _ | n <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN ⊢) <;> + ((repeat' apply And.intro) <;> (try trivial) <;> (try (apply nat_ge_or_mod2; intro _)) <;> omega) + · simp -failIfUnchanged only [PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] + rcases k with _ | _ | _ | k <;> try omega + trivial + +theorem ob_far (ph : Phase) (c4 : Bool) (h h' i j p q n tv : Nat) + (_hi : 3 ≤ i) (hj : 3 ≤ j) (hPC : PC ph c4 h i p q n tv) : + PC ph c4 h' j p q n tv := by + rcases hPC with ⟨hp1, hq1, hN, _⟩ + refine ⟨hp1, hq1, hN, ?_⟩ + simp -failIfUnchanged only [PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] + rcases j with _ | _ | _ | j <;> try omega + trivial + +def endtr (ph ph' : Phase) : Prop := + (ph = .E1 ∧ ph' = .E2) ∨ (ph = .E1t ∧ ph' = .E2t) + +theorem ob_end (ph ph' : Phase) (h i p q n : Nat) (hph : endtr ph ph') (hn : 1 ≤ n) (hq : 2 ≤ q) + (hPC : PC ph false h i p q n 0) : + PC ph' false (4 + h) i (p + 1) (q - 1) n (2 ^ n - 1) := by + have hpow := pow_pos n + rcases hPC with ⟨hp1, hq1, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN ⊢ + rcases hph with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ <;> rcases n with _ | n <;> (try rw [pow_S] at hN hpow ⊢) <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN ⊢) <;> omega + · simp -failIfUnchanged only [PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hI ⊢ + rcases i with _ | _ | _ | i <;> try trivial + all_goals (rcases hph with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hI ⊢) <;> omega) + +theorem ob_end_top (ph ph' : Phase) (h i p q : Nat) (hph : endtr ph ph') (hi : 3 ≤ i) + (hPC : PC ph false h i p (q + 2) 0 0) : + PC ph' false (4 + h) i (p + 1) (q + 1) 0 0 := by + rcases hPC with ⟨hp1, hq1, hN, _⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN ⊢ + rcases hph with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN ⊢) <;> omega + · simp -failIfUnchanged only [PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] + rcases i with _ | _ | _ | i <;> try omega + trivial + +theorem ob_endlast (c4 : Bool) (h i p q n : Nat) (hq : 2 ≤ q) + (hPC : PC .L1 c4 h i p q (n + 1) 0) : + PC .L2 c4 (4 + h) i (p + 1) (q - 1) n (2 * 2 ^ n - 1) := by + have hpow := pow_pos n + have hpowS := pow_S n + rcases hPC with ⟨hp1, hq1, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN ⊢ + rw [hpowS] at hN + cases c4 <;> rcases n with _ | n <;> (try rw [pow_S] at hN hpow ⊢) <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN ⊢) <;> + ((repeat' apply And.intro) <;> (try trivial) <;> (try (apply nat_ge_or_mod2; intro _)) <;> omega) + · simp -failIfUnchanged only [PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hI ⊢ + rw [hpowS] at hI + rcases i with _ | _ | _ | i <;> (try trivial) <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hI ⊢) <;> omega + +theorem ob_x2 (h i p q n : Nat) (hn : 1 ≤ n) (hq : 2 ≤ q) + (hPC : PC .T0 false h i p q n 0) : + PC .E1t false (4 + h) i (p + 1) (q - 1) (n + 1) (3 * 2 ^ n - 1) := by + have hpow := pow_pos n + have hpowS := pow_S n + rcases hPC with ⟨hp1, hq1, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN ⊢ + rw [hpowS] + rcases n with _ | n <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN ⊢) <;> omega + · simp -failIfUnchanged only [PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hI ⊢ + rw [hpowS] + rcases i with _ | _ | _ | i <;> (try trivial) <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hI ⊢) <;> omega + +theorem ob_x2_top (h i p q : Nat) (hi : 3 ≤ i) + (hPC : PC .T0 false h i p (q + 2) 0 0) : + PC .E1t false (4 + h) i (p + 1) (q + 1) 1 2 := by + rcases hPC with ⟨hp1, hq1, hN, _⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN ⊢; omega + · simp -failIfUnchanged only [PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] + rcases i with _ | _ | _ | i <;> try omega + trivial + +theorem ob_x2_new (h i k : Nat) (hi : 3 ≤ i) (hk : 3 ≤ k) : + PC .E1t false h i 3 k 0 1 := by + refine ⟨by omega, by omega, ?_, ?_⟩ + · simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false]; omega + · simp -failIfUnchanged only [PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] + rcases i with _ | _ | _ | i <;> try omega + trivial + +def ovtr (ph ph' : Phase) (c4' : Bool) (Xp : Nat → Prop) : Prop := + (ph = .E2 ∧ ph' = .L1 ∧ c4' = false ∧ Xp = (fun x => x ≠ 4)) ∨ + (ph = .E2 ∧ ph' = .LX ∧ c4' = false ∧ Xp = (fun x => x = 4)) ∨ + (ph = .E2t ∧ ph' = .L1 ∧ c4' = true ∧ Xp = (fun _ => True)) ∨ + (ph = .L2 ∧ ph' = .E1 ∧ c4' = false ∧ Xp = (fun _ => True)) + +theorem ob_ov_head (ph ph' : Phase) (c4' : Bool) (Xp : Nat → Prop) (h p1 q1 n : Nat) + (htr : ovtr ph ph' c4' Xp) + (hPC : PC ph false h 1 (p1 + 2) q1 n 0) : + PC ph' c4' 2 1 (h + 5) (p1 + 1) (n + 1) (2 * (2 * 2 ^ n) - 2) := by + rcases hPC with ⟨hp1, hq1, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases n with _ | _ | n <;> [skip; skip; have := pow_pos n] <;> + rcases htr with ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, _⟩ <;> + simp -failIfUnchanged only [PN, PI, pow_S, Nat.pow_zero, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at * <;> + ((repeat' apply And.intro) <;> (try trivial) <;> (try (apply nat_ge_or_mod2; intro _)) <;> omega) + · rcases n with _ | _ | n <;> [skip; skip; have := pow_pos n] <;> + rcases htr with ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, _⟩ | ⟨rfl, rfl, rfl, _⟩ <;> + simp -failIfUnchanged only [PN, PI, pow_S, Nat.pow_zero, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at * <;> + ((repeat' apply And.intro) <;> (try trivial) <;> omega) + +theorem ob_ov_step (ph ph' : Phase) (c4' : Bool) (Xp : Nat → Prop) (h i pp q p' q' m : Nat) + (htr : ovtr ph ph' c4' Xp) (hi : 1 ≤ i) + (hPC : PC ph false h i pp q (m + 1) 0) + (hPC' : PC ph false h (i + 1) p' q' m 0) + (hX : m = 0 → Xp p') : + PC ph' c4' 2 (i + 1) q p' (m + 1) (2 * (2 * 2 ^ m) - 1) := by + have hpow := pow_pos m + have hpowS := pow_S m + rcases hPC with ⟨hpp, hq, hN, hI⟩ + rcases hPC' with ⟨hp', hq', hN', hI'⟩ + refine ⟨hq, hp', ?_, ?_⟩ + · simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN hN' ⊢ + rw [hpowS] at hN ⊢ + rcases htr with ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ + all_goals (rcases m with _ | _ | m <;> (try have := hX rfl) <;> (try rw [pow_S] at hN hN' hpow ⊢) <;> (try rw [pow_S] at hN hN' hpow ⊢) <;> + (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN hN' hX ⊢) <;> ((repeat' apply And.intro) <;> (try trivial) <;> (try (apply nat_ge_or_mod2; intro _)) <;> omega)) + · simp -failIfUnchanged only [PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] + rcases i with _ | _ | i + · omega + · simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN hN' hI hI' ⊢ + rw [hpowS] at hN hI ⊢ + rcases htr with ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ + all_goals (rcases m with _ | _ | m <;> (try rw [pow_S] at hN hN' hI hI' hpow ⊢) <;> (try rw [pow_S] at hN hN' hI hI' hpow ⊢) <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN hN' hI hI' hX ⊢) <;> omega) + · trivial + +theorem ob_ov_base (ph ph' : Phase) (c4' : Bool) (Xp : Nat → Prop) (h i pp q t : Nat) + (htr : ovtr ph ph' c4' Xp) (hi : 1 ≤ i) + (ht1 : ph = .L2 → 2 ≤ t) (ht2 : ph ≠ .L2 → t = 1) + (hPC : PC ph false h i pp q 0 0) : + PC ph' c4' 2 (i + 1) q (t + 1) 0 1 := by + rcases hPC with ⟨hpp, hq, hN, hI⟩ + refine ⟨hq, by omega, ?_, ?_⟩ + · simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN hI ⊢ + rcases htr with ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ + · have := ht2 (by decide); omega + · have := ht2 (by decide); omega + · have := ht2 (by decide); omega + · have := ht1 rfl; omega + · simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN hI ⊢ + rcases i with _ | _ | i + · omega + · rcases htr with ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl, rfl⟩ + · have := ht2 (by decide); (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN hI ⊢); omega + · have := ht2 (by decide); (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN hI ⊢); omega + · have := ht2 (by decide); (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN hI ⊢); omega + · have := ht1 rfl; (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN hI ⊢); omega + · trivial + +theorem ob_x1_head (h p1 q1 n : Nat) + (hPC : PC .LX false h 1 (p1 + 2) q1 (n + 2) 0) : + PC .T0 false 2 1 (h + 5) (p1 + 1) (n + 1) (2 * 2 ^ n - 2) := by + rcases hPC with ⟨hp1, hq1, hN, hI⟩ + refine ⟨by omega, by omega, ?_, ?_⟩ + · rcases n with _ | _ | n <;> [skip; skip; have := pow_pos n] <;> + simp -failIfUnchanged only [PN, PI, pow_S, Nat.pow_zero, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false, true_and, and_true] at * <;> + omega + · rcases n with _ | _ | n <;> [skip; skip; have := pow_pos n] <;> + simp -failIfUnchanged only [PN, PI, pow_S, Nat.pow_zero, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false, true_and, and_true] at * <;> + omega + +theorem ob_x1_step (h i pp q p' q' m : Nat) (hi : 1 ≤ i) + (hPC : PC .LX false h i pp q (m + 3) 0) + (hPC' : PC .LX false h (i + 1) p' q' (m + 2) 0) : + PC .T0 false 2 (i + 1) q p' (m + 1) (2 * 2 ^ m - 1) := by + have hpow := pow_pos m + rcases hPC with ⟨hpp, hq, hN, hI⟩ + rcases hPC' with ⟨hp', hq', hN', hI'⟩ + refine ⟨hq, hp', ?_, ?_⟩ + · simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN hN' ⊢ + rw [pow_S (m + 2), pow_S (m + 1), pow_S m] at hN + rw [pow_S (m + 1), pow_S m] at hN' + rw [pow_S m] + rcases m with _ | m <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN hN' ⊢) <;> omega + · simp -failIfUnchanged only [PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] + rcases i with _ | _ | i + · omega + · simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN hN' hI hI' ⊢ + rw [pow_S (m + 2), pow_S (m + 1), pow_S m] at hN hI + rw [pow_S (m + 1), pow_S m] at hN' + rw [pow_S m] + rcases m with _ | m <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN hN' hI hI' ⊢) <;> omega + · trivial + +theorem ob_x1_base (h i pp q pa : Nat) (hi : 1 ≤ i) + (hPC : PC .LX false h i pp q 2 0) + (hPC' : PC .LX false h (i + 1) (pa + 1) 1 1 0) : + PC .T0 false 2 (i + 1) q (pa + 1) 0 0 := by + rcases hPC with ⟨hpp, hq, hN, hI⟩ + rcases hPC' with ⟨hp', hq', hN', hI'⟩ + refine ⟨hq, by omega, ?_, ?_⟩ + · simp -failIfUnchanged only [PN, PI, pow_S, Nat.pow_zero, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at * + (repeat' apply And.intro) <;> (try trivial) <;> omega + · rcases i with _ | _ | i + · omega + · simp -failIfUnchanged only [PN, PI, pow_S, Nat.pow_zero, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at * + omega + · trivial +-- List-level preservation and Jstep (Skelet1LikeC2_1RB1RF.v lines 720-1280) + +theorem dv_zero (Z : List Tri) (hZ : List.Forall dig0 Z) : dv Z = 0 := by + have h := dv_zeros Z [] hZ + rw [List.append_nil] at h + dsimp [dv] at h + omega + +theorem dv_tz' (Z R : List Tri) (hZ : List.Forall dig0 Z) : + dv (Z.map touch ++ R) = 2 ^ Z.length - 1 + 2 ^ Z.length * dv R := by + have h := dv_tz Z R hZ + have hp := pow_pos Z.length + omega + +theorem ovp_len (q : Nat) (Z : List Tri) (t : Nat) : + (ovp q Z t).length = Z.length + 1 := by + induction Z generalizing q with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p', q', d'⟩ + dsimp [ovp, List.length] + rw [ih q'] + +theorem ovp_dv (q : Nat) (Z : List Tri) (t : Nat) : + dv (ovp q Z t) + 1 = 2 ^ (Z.length + 1) := by + induction Z generalizing q with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p', q', d'⟩ + dsimp [ovp, dv, bv, List.length] + have h := ih q' + rw [pow_S (Z.length + 1)] + omega + +theorem ovpX_len (q : Nat) (Z : List Tri) (pa : Nat) : + (ovpX q Z pa).length = Z.length + 1 := by + induction Z generalizing q with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p', q', d'⟩ + dsimp [ovpX, List.length] + rw [ih q'] + +theorem ovpX_dv (q : Nat) (Z : List Tri) (pa : Nat) : + dv (ovpX q Z pa) + 1 = 2 ^ Z.length := by + induction Z generalizing q with + | nil => rfl + | cons x Z ih => + rcases x with ⟨p', q', d'⟩ + dsimp [ovpX, dv, bv, List.length] + have h := ih q' + rw [pow_S Z.length] + omega + +def lastOK (Xp : Nat → Prop) : List Tri → Prop + | [] => True + | [(p, _, _)] => Xp p + | _ :: Z' => lastOK Xp Z' + +theorem lastOK_cons (Xp : Nat → Prop) (p q : Nat) (d : Bool) (Z : List Tri) + (h : lastOK Xp ((p, q, d) :: Z)) : (Z = [] → Xp p) ∧ lastOK Xp Z := by + cases Z with + | nil => exact ⟨fun _ => h, trivial⟩ + | cons z Z' => exact ⟨(fun h' => nomatch h'), h⟩ + +theorem lastOK_dec (Z : List Tri) : + lastOK (fun x => x = 4) Z ∨ lastOK (fun x => x ≠ 4) Z := by + induction Z with + | nil => exact Or.inl trivial + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + cases Z with + | nil => + dsimp [lastOK] + if hp : p = 4 then exact Or.inl hp else exact Or.inr hp + | cons z Z' => exact ih + +theorem lastOK_True (Z : List Tri) : lastOK (fun _ => True) Z := by + induction Z with + | nil => trivial + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + cases Z with + | nil => trivial + | cons z Z' => exact ih + +theorem AllI_ovp (ph ph' : Phase) (c4' : Bool) (Xp : Nat → Prop) (h t : Nat) + (htr : ovtr ph ph' c4' Xp) (ht1 : ph = .L2 → 2 ≤ t) (ht2 : ph ≠ .L2 → t = 1) + (Z : List Tri) (i pp q : Nat) (hi : 1 ≤ i) (hZ : List.Forall dig0 Z) + (hX : lastOK Xp Z) (hPC : PC ph false h i pp q Z.length 0) + (hA : AllI (PCx ph false h) (i + 1) Z) : + AllI (PCx ph' c4' 2) (i + 1) (ovp q Z t) := by + induction Z generalizing i pp q with + | nil => + dsimp [ovp, AllI, PCx, Lift, List.length, dv, bv] + exact ⟨ob_ov_base ph ph' c4' Xp h i pp q t htr hi ht1 ht2 hPC, trivial⟩ + | cons x Z ih => + rcases x with ⟨p', q', d'⟩ + rw [List.forall_cons] at hZ + rcases hZ with ⟨hd', hZ'⟩ + dsimp [dig0, dig] at hd' + subst hd' + rcases hA with ⟨hH, hA'⟩ + rcases lastOK_cons Xp p' q' false Z hX with ⟨hX1, hX2⟩ + dsimp [PCx, Lift, List.length] at hH hPC + have hz0 : List.Forall dig0 ((p', q', false) :: Z) := by + rw [List.forall_cons]; exact ⟨rfl, hZ'⟩ + rw [dv_zero _ hz0] at hH + dsimp [ovp, AllI] + refine ⟨?_, ih (i + 1) p' q' (by omega) hZ' hX2 hH hA'⟩ + dsimp [PCx, Lift] + rw [ovp_len] + have hdv : dv ((q, p', true) :: ovp q' Z t) = 2 * (2 * 2 ^ Z.length) - 1 := by + dsimp [dv, bv] + have E := ovp_dv q' Z t + rw [pow_S] at E + omega + rw [hdv] + exact ob_ov_step ph ph' c4' Xp h i pp q p' q' Z.length htr hi hPC hH + (fun hm => hX1 (by cases Z <;> first | rfl | nomatch hm)) + +theorem AllI_ovpX (h pa pb : Nat) (Z : List Tri) (i pp q : Nat) (hi : 1 ≤ i) + (hZ : List.Forall dig0 Z) + (hPC : PC .LX false h i pp q (Z.length + 2) 0) + (hA : AllI (PCx .LX false h) (i + 1) (Z ++ [(pa + 1, 1, false), (pb, 1, false)])) : + AllI (PCx .T0 false 2) (i + 1) (ovpX q Z (pa + 1)) := by + induction Z generalizing i pp q with + | nil => + dsimp [ovpX, AllI, List.nil_append] at hA ⊢ + rcases hA with ⟨hHa, _⟩ + dsimp [PCx, Lift, List.length, dv, bv] at hHa ⊢ + exact ⟨ob_x1_base h i pp q pa hi hPC hHa, trivial⟩ + | cons x Z ih => + rcases x with ⟨p', q', d'⟩ + rw [List.forall_cons] at hZ + rcases hZ with ⟨hd', hZ'⟩ + dsimp [dig0, dig] at hd' + subst hd' + dsimp [List.cons_append, AllI] at hA + rcases hA with ⟨hH, hA'⟩ + dsimp [PCx, Lift] at hH + rw [List.length_append] at hH + dsimp [List.length] at hH hPC + have hz0 : List.Forall dig0 ((p', q', false) :: (Z ++ [(pa + 1, 1, false), (pb, 1, false)])) := by + rw [List.forall_cons]; refine ⟨rfl, ?_⟩ + rw [List.forall_append]; exact ⟨hZ', by simp [dig0, dig]⟩ + rw [dv_zero _ hz0] at hH + dsimp [ovpX, AllI] + refine ⟨?_, ih (i + 1) p' q' (by omega) hZ' hH hA'⟩ + dsimp [PCx, Lift] + rw [ovpX_len] + have hdv : dv ((q, p', true) :: ovpX q' Z (pa + 1)) = 2 * 2 ^ Z.length - 1 := by + dsimp [dv, bv] + have E := ovpX_dv q' Z (pa + 1) + omega + rw [hdv] + exact ob_x1_step h i pp q p' q' Z.length hi hPC hH + +theorem passq (ph : Phase) (c4 : Bool) (h i p q n tv : Nat) + (hPC : PC ph c4 h i p q n tv) (ht : 2 ≤ tv) (ht2 : tv % 2 = 0) : 2 ≤ q := by + have hpow := pow_pos n + rcases hPC with ⟨hp, hq, hN, _⟩ + simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN + cases ph <;> cases c4 <;> rcases n with _ | _ | n <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN) <;> omega + +theorem Z_okL (ph : Phase) (c4 : Bool) (h : Nat) (Z : List Tri) (i : Nat) (x : Tri) (R : List Tri) + (hZ : List.Forall dig0 Z) (hx : dig x = true) + (hA : AllI (PCx ph c4 h) i (Z ++ x :: R)) : List.Forall okL Z := by + induction Z generalizing i with + | nil => trivial + | cons z Z ih => + rcases z with ⟨p, q, d⟩ + rw [List.forall_cons] at hZ ⊢ + rcases hZ with ⟨hd, hZ'⟩ + dsimp [dig0, dig] at hd + subst hd + dsimp [List.cons_append, AllI] at hA + rcases hA with ⟨hH, hA'⟩ + refine ⟨⟨rfl, ?_⟩, ih (i + 1) hZ' hA'⟩ + dsimp [PCx, Lift] at hH + apply passq ph c4 h i p q (Z ++ x :: R).length (dv ((p, q, false) :: (Z ++ x :: R))) hH + · dsimp [dv, bv] + rw [dv_zeros Z (x :: R) hZ'] + rcases x with ⟨px, qx, dx⟩ + dsimp [dig] at hx + subst hx + dsimp [dv, bv] + have hp := pow_pos Z.length + have hmul : 2 ^ Z.length * 1 ≤ 2 ^ Z.length * (1 + 2 * dv R) := + Nat.mul_le_mul_left (2 ^ Z.length) (by omega) + omega + · dsimp [dv, bv]; omega + +theorem borrow1 (ph : Phase) (c4 : Bool) (h k p n tv : Nat) + (hk : 1 ≤ k) (ht : tv % 2 = 1) (hPC : PC ph c4 h k p 1 n tv) : + (ph = .L1 ∨ ph = .L2 ∨ ph = .LX) ∧ 3 ≤ k ∧ + (ph = .L1 → 1 ≤ n ∧ tv + 1 ≤ 2 ^ n ∧ (c4 = true → 2 ≤ n)) ∧ + (ph = .LX → 2 ≤ n) := by + have hpow := pow_pos n + rcases hPC with ⟨hp, hq, hN, hI⟩ + have hph : ph = .L1 ∨ ph = .L2 ∨ ph = .LX := by + simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN + cases ph <;> try (first | exact Or.inl rfl | exact Or.inr (Or.inl rfl) | exact Or.inr (Or.inr rfl)) + all_goals (rcases n with _ | n <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN) <;> omega) + refine ⟨hph, ?_, ?_, ?_⟩ + · simp -failIfUnchanged only [PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hI + rcases k with _ | _ | _ | k <;> try omega + all_goals (rcases hph with rfl | rfl | rfl <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hI) <;> omega) + · intro hL1; subst hL1 + simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN + cases c4 <;> rcases n with _ | _ | n <;> (try rw [pow_S] at hN hpow ⊢) <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN ⊢) <;> + ((repeat' apply And.intro) <;> (try intro _) <;> (try contradiction) <;> omega) + · intro hLX; subst hLX + simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN + rcases n with _ | _ | n <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN) <;> omega + +theorem inv_Dec (ph : Phase) (c4 : Bool) (h : Nat) (Z : List Tri) (p q : Nat) (R : List Tri) + (hZ : List.Forall dig0 Z) + (hA : AllI (PCx ph c4 h) 1 (Z ++ (p, q + 2, true) :: R)) : + AllI (PCx ph c4 (4 + h)) 1 (Z.map touch ++ (p + 1, q + 1, false) :: R) := by + have hB := AllI_app (PCx ph c4 h) Z 1 ((p, q + 2, true) :: R) hA + dsimp [AllI] at hB + rcases hB with ⟨hx, hR⟩ + apply AllI_touchZ (PCx ph c4 h) (PCx ph c4 (4 + h)) ((p, q + 2, true) :: R) ((p + 1, q + 1, false) :: R) Z 1 hZ + · intro j p0 q0 Zr hZr hj h0 + dsimp [PCx, Lift] at h0 ⊢ + simp only [List.length_append, List.length_map, List.length_cons, dv, bv] at h0 ⊢ + rw [dv_zeros Zr ((p, q + 2, true) :: R) hZr] at h0 + rw [dv_tz' Zr ((p + 1, q + 1, false) :: R) hZr] + dsimp [dv, bv] at h0 ⊢ + have hp := pow_pos Zr.length + have heq : 1 + 2 * (2 ^ Zr.length - 1 + 2 ^ Zr.length * (0 + 2 * dv R)) = + 0 + 2 * (2 ^ Zr.length * (1 + 2 * dv R)) - 1 := by + have hm1 : 2 ^ Zr.length * (0 + 2 * dv R) = 2 * (2 ^ Zr.length * dv R) := by ring + have hm2 : 2 ^ Zr.length * (1 + 2 * dv R) = 2 ^ Zr.length + 2 * (2 ^ Zr.length * dv R) := by ring + rw [hm1, hm2]; omega + rw [heq] + have htv2 : 2 ≤ 0 + 2 * (2 ^ Zr.length * (1 + 2 * dv R)) := by + have hm2 : 2 ^ Zr.length * (1 + 2 * dv R) = 2 ^ Zr.length + 2 * (2 ^ Zr.length * dv R) := by ring + omega + have hq0 : 2 ≤ q0 := passq ph c4 h j p0 q0 (Zr.length + (R.length + 1)) _ h0 htv2 (by omega) + exact ob_touch ph c4 h j p0 q0 (Zr.length + (R.length + 1)) _ (by omega) hq0 h0 + · exact hA + · dsimp [AllI] + refine ⟨?_, ?_⟩ + · dsimp [PCx, Lift, dv, bv] at hx ⊢ + have heq : 0 + 2 * dv R = (1 + 2 * dv R) - 1 := by omega + rw [heq] + exact ob_touch ph c4 h (1 + Z.length) p (q + 2) R.length (1 + 2 * dv R) (by omega) (by omega) hx + · refine AllI_mono (PCx ph c4 h) (PCx ph c4 (4 + h)) R (1 + Z.length + 1) ?_ hR + intro j y Y hj hy + rcases y with ⟨py, qy, dy⟩ + dsimp [PCx, Lift] at hy ⊢ + rcases hy with ⟨hp, hq, hN, hI⟩ + refine ⟨hp, hq, hN, ?_⟩ + rcases j with _ | _ | _ | j <;> first | omega | exact hI +-- Remaining inv_* lemmas, J, Jstep, J_base, and is_does_not_halt (Skelet1LikeC2_1RB1RF.v lines 863-1280) + +theorem snoc_nn (Z : List Tri) (y : Tri) : Z ++ [y] ≠ [] := by + cases Z <;> (intro h; nomatch h) + +def minlen : Phase → Nat + | .LX => 3 + | .L2 => 1 + | _ => 2 + +theorem head_len (ph : Phase) (c4 : Bool) (h : Nat) (x : Tri) (Y : List Tri) + (hPC : PCx ph c4 h 1 x Y) : minlen ph ≤ Y.length := by + rcases x with ⟨p, q, d⟩ + simp -failIfUnchanged only [PCx, Lift, PC, PI] at hPC + rcases hPC with ⟨_, _, _, _, hI⟩ + cases ph <;> dsimp [minlen] at hI ⊢ <;> omega + +theorem AllI_len (ph : Phase) (c4 : Bool) (h : Nat) (P : List Tri) + (hne : P ≠ []) (hA : AllI (PCx ph c4 h) 1 P) : minlen ph + 1 ≤ P.length := by + cases P with + | nil => contradiction + | cons x Y => + have := head_len ph c4 h x Y hA.1 + dsimp [List.length] + omega + +theorem q2_V0 (ph : Phase) (c4 : Bool) (h i p q n : Nat) + (hPC : PC ph c4 h i p q n 0) (hn : 1 ≤ n) (hX : ph = .LX → 2 ≤ n) : 2 ≤ q := by + have hpow := pow_pos n + rcases hPC with ⟨hp, hq, hN, _⟩ + simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN + cases ph <;> cases c4 <;> rcases n with _ | _ | n <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN) <;> try omega + all_goals (have := hX rfl; omega) + +theorem p1_V0 (ph : Phase) (c4 : Bool) (h p q n : Nat) + (hPC : PC ph c4 h 1 p q n 0) (hph : ph = .E2 ∨ ph = .E2t ∨ ph = .L2 ∨ ph = .LX) : 2 ≤ p := by + have hpow := pow_pos n + rcases hPC with ⟨hp, hq, hN, hI⟩ + simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN hI + rcases hph with rfl | rfl | rfl | rfl <;> cases c4 <;> rcases n with _ | _ | n <;> + (try rw [pow_S] at hN hI hpow) <;> (try simp -failIfUnchanged only [PN, PI, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN hI) <;> omega + +theorem L2_c4_V0 (h i p q : Nat) (hPC : PC .L2 true h i p q 0 0) : False := by + rcases hPC with ⟨_, _, hN, _⟩ + simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN + omega + +theorem AllI_okRO (ph : Phase) (c4 : Bool) (h : Nat) (Z : List Tri) (i : Nat) + (hZ : List.Forall dig0 Z) (hA : AllI (PCx ph c4 h) i Z) : + List.Forall okR Z ∧ List.Forall okO Z := by + induction Z generalizing i with + | nil => exact ⟨trivial, trivial⟩ + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + rw [List.forall_cons] at hZ + rcases hZ with ⟨hd, hZ'⟩ + dsimp [dig0, dig] at hd + subst hd + dsimp [AllI] at hA + rcases hA with ⟨hH, hA'⟩ + rcases ih (i + 1) hZ' hA' with ⟨hR, hO⟩ + dsimp [PCx, Lift, PC] at hH + rcases hH with ⟨hp, hq, _⟩ + rw [List.forall_cons, List.forall_cons] + exact ⟨⟨⟨rfl, hq⟩, hR⟩, ⟨⟨hp, hq⟩, hO⟩⟩ + +theorem inv_Merge (ph : Phase) (c4 : Bool) (h : Nat) (Z : List Tri) (p p' q' : Nat) (d' : Bool) (R0 : List Tri) + (hZ : List.Forall dig0 Z) + (hA : AllI (PCx ph c4 h) 1 (Z ++ (p, 1, true) :: (p', q', d') :: R0)) : + AllI (PCx ph c4 (4 + h)) 1 (Z.map touch ++ (p + p' + 3, q', d') :: R0) := by + have hB := AllI_app (PCx ph c4 h) Z 1 ((p, 1, true) :: (p', q', d') :: R0) hA + dsimp [AllI] at hB + rcases hB with ⟨hx, hy, hR⟩ + have hlt := dv_lt ((p', q', d') :: R0) + dsimp [List.length] at hlt + set Hd := dv ((p', q', d') :: R0) + have hx' := hx + dsimp [PCx, Lift, List.length] at hx' + change PC ph c4 h (1 + Z.length) p 1 (R0.length + 1) (1 + 2 * Hd) at hx' + rcases borrow1 ph c4 h (1 + Z.length) p (R0.length + 1) (1 + 2 * Hd) (by omega) (by omega) hx' with + ⟨hph, hk, hL1, hLX⟩ + apply AllI_touchZ (PCx ph c4 h) (PCx ph c4 (4 + h)) + ((p, 1, true) :: (p', q', d') :: R0) ((p + p' + 3, q', d') :: R0) Z 1 hZ + · intro j p0 q0 Zr hZr hj h0 + dsimp [PCx, Lift] at h0 ⊢ + simp only [List.length_append, List.length_map, List.length_cons, dv, bv] at h0 ⊢ + rw [dv_zeros Zr ((p, 1, true) :: (p', q', d') :: R0) hZr] at h0 + rw [dv_tz' Zr ((p + p' + 3, q', d') :: R0) hZr] + change PC ph c4 h j p0 q0 (Zr.length + (R0.length + 2)) (0 + 2 * (2 ^ Zr.length * (1 + 2 * Hd))) at h0 + change PC ph c4 (4 + h) j (p0 + 1) (q0 - 1) (Zr.length + (R0.length + 1)) (1 + 2 * (2 ^ Zr.length - 1 + 2 ^ Zr.length * Hd)) + set A := 2 ^ Zr.length + set B := 2 ^ R0.length + have hA1 : 1 ≤ A := pow_pos Zr.length + have hB1 : 1 ≤ B := pow_pos R0.length + have hpow_add : 2 ^ (Zr.length + (R0.length + 1)) = A * (2 * B) := by + rw [Nat.pow_add, pow_S] + rw [pow_S] at hlt + change Hd < 2 * B at hlt + have hn_eq : Zr.length + (R0.length + 2) = (Zr.length + (R0.length + 1)) + 1 := by omega + have htv_in : 0 + 2 * (A * (1 + 2 * Hd)) = (2 * A) + 2 * (2 * A * Hd) := by ring + have htv_out : 1 + 2 * (A - 1 + A * Hd) = (2 * A) - 1 + (2 * A * Hd) := by + have hm : 2 * (A - 1 + A * Hd) = 2 * (A - 1) + 2 * (A * Hd) := by ring + have hm2 : 2 * A * Hd = 2 * (A * Hd) := by ring + omega + rw [hn_eq, htv_in] at h0 + rw [htv_out] + have hq2 : 2 ≤ q0 := by + apply passq ph c4 h j p0 q0 ((Zr.length + (R0.length + 1)) + 1) ((2 * A) + 2 * (2 * A * Hd)) h0 + · omega + · omega + have hU2 : (2 * A * Hd) % 2 = 0 := by + have hmul : 2 * A * Hd = 2 * (A * Hd) := by ring + omega + apply ob_merge ph c4 h j p0 q0 (Zr.length + (R0.length + 1)) (2 * A) (2 * A * Hd) hph (by omega) (by omega) + (by omega) hU2 + · rw [hpow_add] + have hmul : (2 * A) * (Hd + 1) ≤ (2 * A) * (2 * B) := Nat.mul_le_mul_left (2 * A) (by omega) + have hring : (2 * A) * (Hd + 1) = 2 * A * Hd + 2 * A := by ring + have hring2 : (2 * A) * (2 * B) = 2 * (A * (2 * B)) := by ring + omega + · intro hpL1 + rcases hL1 hpL1 with ⟨_, hb, _⟩ + rw [pow_S] at hb + change (1 + 2 * Hd) + 1 ≤ 2 * B at hb + rw [hpow_add] + have hmul : A * (2 * Hd + 2) ≤ A * (2 * B) := Nat.mul_le_mul_left A (by omega) + have hring : A * (2 * Hd + 2) = 2 * A * Hd + 2 * A := by ring + omega + · intro hpLX; have := hLX hpLX; omega + · intro hpL1 hc4; rcases hL1 hpL1 with ⟨_, _, hc2⟩; have := hc2 hc4; omega + · intro hi1; omega + · intro hpLX hi1; have := hLX hpLX; omega + · exact hq2 + · exact h0 + · exact hA + · dsimp [AllI] + refine ⟨?_, ?_⟩ + · dsimp [PCx, Lift] at hy ⊢ + change PC ph c4 h (1 + Z.length + 1) p' q' R0.length Hd at hy + change PC ph c4 (4 + h) (1 + Z.length) (p + p' + 3) q' R0.length Hd + exact ob_fuse ph c4 h (4 + h) (1 + Z.length) p p' q' R0.length Hd hph (by omega) hy + · refine AllI_shift (PCx ph c4 h) (PCx ph c4 (4 + h)) R0 (1 + Z.length + 1) ?_ hR + intro j y Y hj hy0 + rcases y with ⟨py, qy, dy⟩ + dsimp [PCx, Lift] at hy0 ⊢ + exact ob_far ph c4 h (4 + h) (j + 1) j py qy Y.length (dv ((py, qy, dy) :: Y)) (by omega) (by omega) hy0 + +theorem inv_MT (c4 : Bool) (h : Nat) (Z : List Tri) (p : Nat) + (hZ : List.Forall dig0 Z) + (hA : AllI (PCx .L2 c4 h) 1 (Z ++ [(p, 1, true)])) : + AllI (PCx .L2 false (4 + h)) 1 (Z.map touch) ∧ 2 ≤ Z.length := by + have hB := AllI_app (PCx .L2 c4 h) Z 1 [(p, 1, true)] hA + dsimp [AllI] at hB + rcases hB with ⟨hx, _⟩ + dsimp [PCx, Lift, List.length, dv, bv] at hx + rcases borrow1 .L2 c4 h (1 + Z.length) p 0 1 (by omega) (by omega) hx with ⟨_, hk, _⟩ + refine ⟨?_, by omega⟩ + have hnil : Z.map touch = Z.map touch ++ [] := (List.append_nil _).symm + rw [hnil] + apply AllI_touchZ (PCx .L2 c4 h) (PCx .L2 false (4 + h)) [(p, 1, true)] [] Z 1 hZ _ hA trivial + intro j p0 q0 Zr hZr hj h0 + dsimp [PCx, Lift] at h0 ⊢ + simp only [List.length_append, List.length_map, List.length_cons, List.length_nil, dv, bv] at h0 ⊢ + rw [dv_zeros Zr [(p, 1, true)] hZr] at h0 + rw [dv_tz' Zr [] hZr] + dsimp [dv, bv] at h0 ⊢ + have hp := pow_pos Zr.length + have htv_in : 0 + 2 * 2 ^ Zr.length = 2 * 2 ^ Zr.length := by omega + have htv_out : 1 + 2 * (2 ^ Zr.length - 1) = 2 * 2 ^ Zr.length - 1 := by omega + try rw [Nat.mul_one] at h0 + rw [htv_in] at h0 + rw [htv_out] + have hq0 : 2 ≤ q0 := passq .L2 c4 h j p0 q0 (Zr.length + 1) (2 * 2 ^ Zr.length) h0 (by omega) (by omega) + exact ob_mt c4 h j p0 q0 Zr.length hq0 (by omega) h0 + +theorem inv_End (ph ph' : Phase) (h : Nat) (Z : List Tri) (p q : Nat) + (htr : endtr ph ph') (hZ : List.Forall dig0 Z) + (hA : AllI (PCx ph false h) 1 (Z ++ [(p, q + 2, false)])) : + AllI (PCx ph' false (4 + h)) 1 (Z.map touch ++ [(p + 1, q + 1, false)]) := by + have hlen := AllI_len ph false h (Z ++ [(p, q + 2, false)]) (snoc_nn Z _) hA + rw [List.length_append] at hlen + dsimp [List.length] at hlen + have hm : minlen ph = 2 := by + rcases htr with ⟨rfl, _⟩ | ⟨rfl, _⟩ <;> rfl + have hB := AllI_app (PCx ph false h) Z 1 [(p, q + 2, false)] hA + dsimp [AllI] at hB + rcases hB with ⟨hx, _⟩ + apply AllI_touchZ (PCx ph false h) (PCx ph' false (4 + h)) [(p, q + 2, false)] [(p + 1, q + 1, false)] Z 1 hZ + · intro j p0 q0 Zr hZr hj h0 + dsimp [PCx, Lift] at h0 ⊢ + simp only [List.length_append, List.length_map, List.length_cons, List.length_nil, dv, bv] at h0 ⊢ + rw [dv_zeros Zr [(p, q + 2, false)] hZr] at h0 + rw [dv_tz' Zr [(p + 1, q + 1, false)] hZr] + dsimp [dv, bv] at h0 ⊢ + have hp := pow_pos Zr.length + have htv_out : 1 + 2 * (2 ^ Zr.length - 1) = 2 ^ (Zr.length + 1) - 1 := by + rw [pow_S]; omega + rw [htv_out] + have hq0 : 2 ≤ q0 := q2_V0 ph false h j p0 q0 (Zr.length + 1) h0 (by omega) + (by intro hX; rcases htr with ⟨rfl, _⟩ | ⟨rfl, _⟩ <;> nomatch hX) + exact ob_end ph ph' h j p0 q0 (Zr.length + 1) htr (by omega) hq0 h0 + · exact hA + · dsimp [AllI, PCx, Lift, List.length, dv, bv] at hx ⊢ + exact ⟨ob_end_top ph ph' h (1 + Z.length) p q htr (by omega) hx, trivial⟩ + +theorem inv_X2 (h : Nat) (Z : List Tri) (p q k : Nat) + (hZ : List.Forall dig0 Z) (hk : 3 ≤ k) + (hA : AllI (PCx .T0 false h) 1 (Z ++ [(p, q + 2, false)])) : + AllI (PCx .E1t false (4 + h)) 1 (Z.map touch ++ [(p + 1, q + 1, false), (3, k, true)]) := by + have hlen := AllI_len .T0 false h (Z ++ [(p, q + 2, false)]) (snoc_nn Z _) hA + rw [List.length_append] at hlen + dsimp [List.length, minlen] at hlen + have hB := AllI_app (PCx .T0 false h) Z 1 [(p, q + 2, false)] hA + dsimp [AllI] at hB + rcases hB with ⟨hx, _⟩ + apply AllI_touchZ (PCx .T0 false h) (PCx .E1t false (4 + h)) + [(p, q + 2, false)] [(p + 1, q + 1, false), (3, k, true)] Z 1 hZ + · intro j p0 q0 Zr hZr hj h0 + dsimp [PCx, Lift] at h0 ⊢ + simp only [List.length_append, List.length_map, List.length_cons, List.length_nil, dv, bv] at h0 ⊢ + rw [dv_zeros Zr [(p, q + 2, false)] hZr] at h0 + rw [dv_tz' Zr [(p + 1, q + 1, false), (3, k, true)] hZr] + dsimp [dv, bv] at h0 ⊢ + have hp := pow_pos Zr.length + have htv_out : 1 + 2 * (2 ^ Zr.length - 1 + 2 ^ Zr.length * 2) = + 3 * 2 ^ (Zr.length + 1) - 1 := by + rw [pow_S]; omega + rw [htv_out] + have hlen_eq : Zr.length + 2 = (Zr.length + 1) + 1 := by omega + rw [hlen_eq] + have hq0 : 2 ≤ q0 := q2_V0 .T0 false h j p0 q0 (Zr.length + 1) h0 (by omega) (by intro hX; nomatch hX) + exact ob_x2 h j p0 q0 (Zr.length + 1) (by omega) hq0 h0 + · exact hA + · dsimp [AllI, PCx, Lift, List.length, dv, bv] at hx ⊢ + exact ⟨ob_x2_top h (1 + Z.length) p q (by omega) hx, + ob_x2_new (4 + h) (1 + Z.length + 1) k (by omega) hk, + trivial⟩ + +theorem inv_EndLast (c4 : Bool) (h : Nat) (Z : List Tri) (p : Nat) + (hZ : List.Forall dig0 Z) + (hA : AllI (PCx .L1 c4 h) 1 (Z ++ [(p, 1, false)])) : + AllI (PCx .L2 c4 (4 + h)) 1 (Z.map touch) ∧ 2 ≤ Z.length := by + have hlen := AllI_len .L1 c4 h (Z ++ [(p, 1, false)]) (snoc_nn Z _) hA + rw [List.length_append] at hlen + dsimp [List.length, minlen] at hlen + refine ⟨?_, by omega⟩ + have hnil : Z.map touch = Z.map touch ++ [] := (List.append_nil _).symm + rw [hnil] + apply AllI_touchZ (PCx .L1 c4 h) (PCx .L2 c4 (4 + h)) [(p, 1, false)] [] Z 1 hZ _ hA trivial + intro j p0 q0 Zr hZr hj h0 + dsimp [PCx, Lift] at h0 ⊢ + simp only [List.length_append, List.length_map, List.length_cons, List.length_nil, dv, bv] at h0 ⊢ + rw [dv_zeros Zr [(p, 1, false)] hZr] at h0 + rw [dv_tz' Zr [] hZr] + dsimp [dv, bv] at h0 ⊢ + have hp := pow_pos Zr.length + have htv_out : 1 + 2 * (2 ^ Zr.length - 1) = 2 * 2 ^ Zr.length - 1 := by omega + rw [htv_out] + have hq0 : 2 ≤ q0 := q2_V0 .L1 c4 h j p0 q0 (Zr.length + 1) h0 (by omega) (by intro hX; nomatch hX) + exact ob_endlast c4 h j p0 q0 Zr.length hq0 h0 + +theorem inv_Ov (ph ph' : Phase) (c4' : Bool) (Xp : Nat → Prop) (h p1 q1 : Nat) (Z : List Tri) (t : Nat) + (htr : ovtr ph ph' c4' Xp) (ht1 : ph = .L2 → 2 ≤ t) (ht2 : ph ≠ .L2 → t = 1) + (hZ : List.Forall dig0 Z) (hX : lastOK Xp Z) + (hA : AllI (PCx ph false h) 1 ((p1 + 2, q1, false) :: Z)) : + AllI (PCx ph' c4' 2) 1 ((h + 5, p1 + 1, false) :: ovp q1 Z t) := by + dsimp [AllI] at hA ⊢ + rcases hA with ⟨hH, hA'⟩ + have hH' := hH + dsimp [PCx, Lift] at hH' + have hz0 : List.Forall dig0 ((p1 + 2, q1, false) :: Z) := by + rw [List.forall_cons]; exact ⟨rfl, hZ⟩ + rw [dv_zero _ hz0] at hH' + refine ⟨?_, AllI_ovp ph ph' c4' Xp h t htr ht1 ht2 Z 1 (p1 + 2) q1 (by omega) hZ hX hH' hA'⟩ + dsimp [PCx, Lift] + rw [ovp_len] + have hdv : dv ((h + 5, p1 + 1, false) :: ovp q1 Z t) = 2 * (2 * 2 ^ Z.length) - 2 := by + dsimp [dv, bv] + have E := ovp_dv q1 Z t + rw [pow_S] at E + omega + rw [hdv] + exact ob_ov_head ph ph' c4' Xp h p1 q1 Z.length htr hH' + +theorem inv_X1 (h p1 q1 : Nat) (Z : List Tri) (pa pb : Nat) + (hZ : List.Forall dig0 Z) + (hA : AllI (PCx .LX false h) 1 ((p1 + 2, q1, false) :: (Z ++ [(pa + 1, 1, false), (pb, 1, false)]))) : + AllI (PCx .T0 false 2) 1 ((h + 5, p1 + 1, false) :: ovpX q1 Z (pa + 1)) := by + dsimp [AllI] at hA ⊢ + rcases hA with ⟨hH, hA'⟩ + have hH' := hH + dsimp [PCx, Lift] at hH' + have hz0 : List.Forall dig0 ((p1 + 2, q1, false) :: (Z ++ [(pa + 1, 1, false), (pb, 1, false)])) := by + rw [List.forall_cons]; refine ⟨rfl, ?_⟩ + rw [List.forall_append]; exact ⟨hZ, by simp [dig0, dig]⟩ + rw [dv_zero _ hz0] at hH' + rw [List.length_append] at hH' + dsimp [List.length] at hH' + refine ⟨?_, AllI_ovpX h pa pb Z 1 (p1 + 2) q1 (by omega) hZ hH' hA'⟩ + dsimp [PCx, Lift] + rw [ovpX_len] + have hdv : dv ((h + 5, p1 + 1, false) :: ovpX q1 Z (pa + 1)) = 2 * 2 ^ Z.length - 2 := by + dsimp [dv, bv] + have E := ovpX_dv q1 Z (pa + 1) + omega + rw [hdv] + exact ob_x1_head h p1 q1 Z.length hH' + +structure St where + sh : Nat + sP : List Tri + sT : Tl + sph : Phase + sc4 : Bool + +def Cf (s : St) : Cfg (Fin 2) (Fin 6) := + K s.sh s.sP s.sT + +def TC (ph : Phase) (c4 : Bool) (T : Tl) : Prop := + match ph with + | .E1 | .E1t | .LX => T = .TN ∧ c4 = false + | .L1 => T = .TN + | .E2 | .E2t => T = .TA 1 ∧ c4 = false + | .T0 => (∃ k, T = .TB k ∧ 3 ≤ k) ∧ c4 = false + | .L2 => ∃ t, T = .TA t ∧ 2 ≤ t + +def J (s : St) : Prop := + s.sP ≠ [] ∧ TC s.sph s.sc4 s.sT ∧ AllI (PCx s.sph s.sc4 s.sh) 1 s.sP + +theorem split1 (P : List Tri) : + (∃ Z x R, P = Z ++ x :: R ∧ List.Forall dig0 Z ∧ dig x = true) ∨ List.Forall dig0 P := by + induction P with + | nil => exact Or.inr trivial + | cons x P ih => + rcases x with ⟨p, q, d⟩ + cases d with + | true => exact Or.inl ⟨[], (p, q, true), P, rfl, trivial, rfl⟩ + | false => + rcases ih with ⟨Z, x, R, rfl, hZ, hx⟩ | h0 + · refine Or.inl ⟨(p, q, false) :: Z, x, R, rfl, ?_, hx⟩ + rw [List.forall_cons]; exact ⟨rfl, hZ⟩ + · refine Or.inr ?_ + rw [List.forall_cons]; exact ⟨rfl, h0⟩ + +theorem exists_last {α : Type*} {P : List α} (hne : P ≠ []) : + ∃ Z y, P = Z ++ [y] := by + induction P with + | nil => contradiction + | cons x P ih => + cases P with + | nil => exact ⟨[], x, rfl⟩ + | cons y P' => + rcases ih (by intro h; nomatch h) with ⟨Z, last, hP⟩ + refine ⟨x :: Z, last, ?_⟩ + simp [hP] + +theorem Forall_snoc_inv {α : Type*} (Pr : α → Prop) (Z : List α) (y : α) + (h : List.Forall Pr (Z ++ [y])) : List.Forall Pr Z ∧ Pr y := by + rw [List.forall_append] at h + rcases h with ⟨h1, h2⟩ + rw [List.forall_cons] at h2 + exact ⟨h1, h2.1⟩ + +theorem Z_okL_V0 (ph : Phase) (c4 : Bool) (h : Nat) (y : Tri) (hph : ph ≠ .LX) + (Z : List Tri) (i : Nat) (hZ : List.Forall dig0 (Z ++ [y])) + (hA : AllI (PCx ph c4 h) i (Z ++ [y])) : List.Forall okL Z := by + induction Z generalizing i with + | nil => trivial + | cons x Z ih => + rcases x with ⟨p, q, d⟩ + dsimp [List.cons_append] at hZ hA + rw [List.forall_cons] at hZ ⊢ + rcases hZ with ⟨hd, hZ'⟩ + dsimp [dig0, dig] at hd + subst hd + dsimp [AllI] at hA + rcases hA with ⟨hH, hA'⟩ + refine ⟨⟨rfl, ?_⟩, ih (i + 1) hZ' hA'⟩ + dsimp [PCx, Lift] at hH + have hz0 : List.Forall dig0 ((p, q, false) :: (Z ++ [y])) := by + rw [List.forall_cons]; exact ⟨rfl, hZ'⟩ + rw [dv_zero _ hz0] at hH + apply q2_V0 ph c4 h i p q (Z ++ [y]).length hH + · rw [List.length_append]; dsimp [List.length]; omega + · intro hX; contradiction + +theorem last_pc (ph : Phase) (c4 : Bool) (h : Nat) (Z : List Tri) (p q : Nat) (d : Bool) + (hZ : List.Forall dig0 (Z ++ [(p, q, d)])) + (hA : AllI (PCx ph c4 h) 1 (Z ++ [(p, q, d)])) : + d = false ∧ PC ph c4 h (1 + Z.length) p q 0 0 := by + rcases Forall_snoc_inv dig0 Z (p, q, d) hZ with ⟨_, hd⟩ + dsimp [dig0, dig] at hd + subst hd + have hB := AllI_app (PCx ph c4 h) Z 1 [(p, q, false)] hA + dsimp [AllI, PCx, Lift, List.length, dv, bv] at hB + exact ⟨rfl, hB.1⟩ + +theorem first_pc (ph : Phase) (c4 : Bool) (h p q : Nat) (d : Bool) (Z : List Tri) + (hZ : List.Forall dig0 ((p, q, d) :: Z)) + (hA : AllI (PCx ph c4 h) 1 ((p, q, d) :: Z)) : + d = false ∧ PC ph c4 h 1 p q Z.length 0 ∧ List.Forall dig0 Z ∧ AllI (PCx ph c4 h) 2 Z := by + rw [List.forall_cons] at hZ + rcases hZ with ⟨hd, hZ'⟩ + dsimp [dig0, dig] at hd + subst hd + dsimp [AllI] at hA + rcases hA with ⟨hH, hA'⟩ + dsimp [PCx, Lift] at hH + have hz0 : List.Forall dig0 ((p, q, false) :: Z) := by + rw [List.forall_cons]; exact ⟨rfl, hZ'⟩ + rw [dv_zero _ hz0] at hH + exact ⟨rfl, hH, hZ', hA'⟩ + +theorem Jstep (s : St) (hs : J s) : ∃ s', ((Cf s) [target_tm]⊢⁺ (Cf s')) ∧ J s' := by + rcases s with ⟨h, P, T, ph, c4⟩ + rcases hs with ⟨hP, hT, hA⟩ + dsimp [Cf] at hP hT hA ⊢ + rcases split1 P with ⟨Z, ⟨p, q, d⟩, R, rfl, hZ, hd⟩ | h0 + · dsimp [dig] at hd; subst hd + have hZL : List.Forall okL Z := Z_okL ph c4 h Z 1 (p, q, true) R hZ rfl hA + have hB := AllI_app (PCx ph c4 h) Z 1 ((p, q, true) :: R) hA + dsimp [AllI] at hB + rcases hB with ⟨hx, hR⟩ + have hx' := hx + dsimp [PCx, Lift] at hx' + rcases q with _ | _ | q + · rcases hx' with ⟨_, hq, _⟩; omega + · rcases borrow1 ph c4 h (1 + Z.length) p R.length (dv ((p, 1, true) :: R)) + (by omega) (by dsimp [dv, bv]; omega) hx' with ⟨hph, hk, hL1, hLX⟩ + cases R with + | nil => + cases T with + | TN => + exfalso + rcases hph with rfl | rfl | rfl + · rcases hL1 rfl with ⟨hn, _⟩; dsimp [List.length] at hn; omega + · rcases hT with ⟨t, ht, _⟩; nomatch ht + · have hX := hLX rfl; dsimp [List.length] at hX; omega + | TA t => + have hphL2 : ph = .L2 := by + rcases hph with rfl | rfl | rfl + · dsimp [TC] at hT; nomatch hT + · rfl + · dsimp [TC] at hT; nomatch hT.1 + subst hphL2 + rcases hT with ⟨t', ht, ht2⟩ + cases ht + rcases inv_MT c4 h Z p hZ hA with ⟨hA', hlen⟩ + refine ⟨⟨4 + h, Z.map touch, .TA (p + t + 3), .L2, false⟩, ?_, ?_⟩ + · exact DecMergeTail h Z p t hZL + · refine ⟨by cases Z <;> dsimp [List.length] at hlen ⊢ <;> first | omega | (intro h; nomatch h), ?_, hA'⟩ + exact ⟨p + t + 3, rfl, by omega⟩ + | TB k => + exfalso + rcases hph with rfl | rfl | rfl + · dsimp [TC] at hT; nomatch hT + · rcases hT with ⟨t, ht, _⟩; nomatch ht + · dsimp [TC] at hT; nomatch hT.1 + | cons r1 R0 => + rcases r1 with ⟨p', q', d'⟩ + refine ⟨⟨4 + h, Z.map touch ++ (p + p' + 3, q', d') :: R0, T, ph, c4⟩, ?_, ?_⟩ + · exact DecMerge h Z p p' q' d' R0 T hZL + · refine ⟨by cases Z <;> (intro h; nomatch h), hT, inv_Merge ph c4 h Z p p' q' d' R0 hZ hA⟩ + · refine ⟨⟨4 + h, Z.map touch ++ (p + 1, q + 1, false) :: R, T, ph, c4⟩, ?_, ?_⟩ + · exact Dec h Z p q R T hZL + · refine ⟨by cases Z <;> (intro h; nomatch h), hT, inv_Dec ph c4 h Z p q R hZ hA⟩ + · cases ph with + | E1 => + rcases hT with ⟨rfl, rfl⟩ + rcases exists_last hP with ⟨Z, ⟨p, q, d⟩, rfl⟩ + rcases last_pc .E1 false h Z p q d h0 hA with ⟨rfl, hy⟩ + have hq : 2 ≤ q := by rcases hy with ⟨_, _, hN, _⟩; simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN; omega + rcases q with _ | _ | q; · omega + · omega + have hZL : List.Forall okL Z := Z_okL_V0 .E1 false h (p, q + 2, false) (by decide) Z 1 h0 hA + rcases Forall_snoc_inv dig0 Z (p, q + 2, false) h0 with ⟨hZ, _⟩ + refine ⟨⟨4 + h, Z.map touch ++ [(p + 1, q + 1, false)], .TA 1, .E2, false⟩, ?_, ?_⟩ + · exact EndR h Z p q hZL + · refine ⟨snoc_nn _ _, ⟨rfl, rfl⟩, inv_End .E1 .E2 h Z p q (Or.inl ⟨rfl, rfl⟩) hZ hA⟩ + | E2 => + rcases hT with ⟨rfl, rfl⟩ + cases P with + | nil => contradiction + | cons x Z => + rcases x with ⟨p1, q1, d1⟩ + rcases first_pc .E2 false h p1 q1 d1 Z h0 hA with ⟨rfl, hH, hZ, hA2⟩ + have hp1 := p1_V0 .E2 false h p1 q1 Z.length hH (Or.inl rfl) + rcases p1 with _ | _ | p1; · omega + · omega + rcases AllI_okRO .E2 false h Z 2 hZ hA2 with ⟨hR, hO⟩ + have hq1 : 1 ≤ q1 := hH.2.1 + rcases lastOK_dec Z with hX | hX + · refine ⟨⟨2, (h + 5, p1 + 1, false) :: ovp q1 Z 1, .TN, .LX, false⟩, ?_, ?_⟩ + · exact Ov h p1 q1 Z 1 hq1 hR hO + · refine ⟨(by intro h'; nomatch h'), ⟨rfl, rfl⟩, inv_Ov .E2 .LX false (fun x => x = 4) h p1 q1 Z 1 + (Or.inr (Or.inl ⟨rfl, rfl, rfl, rfl⟩)) (by decide) (fun _ => rfl) hZ hX hA⟩ + · refine ⟨⟨2, (h + 5, p1 + 1, false) :: ovp q1 Z 1, .TN, .L1, false⟩, ?_, ?_⟩ + · exact Ov h p1 q1 Z 1 hq1 hR hO + · refine ⟨(by intro h'; nomatch h'), rfl, inv_Ov .E2 .L1 false (fun x => x ≠ 4) h p1 q1 Z 1 + (Or.inl ⟨rfl, rfl, rfl, rfl⟩) (by decide) (fun _ => rfl) hZ hX hA⟩ + | E1t => + rcases hT with ⟨rfl, rfl⟩ + rcases exists_last hP with ⟨Z, ⟨p, q, d⟩, rfl⟩ + rcases last_pc .E1t false h Z p q d h0 hA with ⟨rfl, hy⟩ + have hq : 2 ≤ q := by rcases hy with ⟨_, _, hN, _⟩; simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN; omega + rcases q with _ | _ | q; · omega + · omega + have hZL : List.Forall okL Z := Z_okL_V0 .E1t false h (p, q + 2, false) (by decide) Z 1 h0 hA + rcases Forall_snoc_inv dig0 Z (p, q + 2, false) h0 with ⟨hZ, _⟩ + refine ⟨⟨4 + h, Z.map touch ++ [(p + 1, q + 1, false)], .TA 1, .E2t, false⟩, ?_, ?_⟩ + · exact EndR h Z p q hZL + · refine ⟨snoc_nn _ _, ⟨rfl, rfl⟩, inv_End .E1t .E2t h Z p q (Or.inr ⟨rfl, rfl⟩) hZ hA⟩ + | E2t => + rcases hT with ⟨rfl, rfl⟩ + cases P with + | nil => contradiction + | cons x Z => + rcases x with ⟨p1, q1, d1⟩ + rcases first_pc .E2t false h p1 q1 d1 Z h0 hA with ⟨rfl, hH, hZ, hA2⟩ + have hp1 := p1_V0 .E2t false h p1 q1 Z.length hH (Or.inr (Or.inl rfl)) + rcases p1 with _ | _ | p1; · omega + · omega + rcases AllI_okRO .E2t false h Z 2 hZ hA2 with ⟨hR, hO⟩ + have hq1 : 1 ≤ q1 := hH.2.1 + refine ⟨⟨2, (h + 5, p1 + 1, false) :: ovp q1 Z 1, .TN, .L1, true⟩, ?_, ?_⟩ + · exact Ov h p1 q1 Z 1 hq1 hR hO + · refine ⟨(by intro h'; nomatch h'), rfl, inv_Ov .E2t .L1 true (fun _ => True) h p1 q1 Z 1 + (Or.inr (Or.inr (Or.inl ⟨rfl, rfl, rfl, rfl⟩))) (by decide) (fun _ => rfl) hZ (lastOK_True Z) hA⟩ + | T0 => + rcases hT with ⟨⟨k, rfl, hk⟩, rfl⟩ + rcases exists_last hP with ⟨Z, ⟨p, q, d⟩, rfl⟩ + rcases last_pc .T0 false h Z p q d h0 hA with ⟨rfl, hy⟩ + have hq : 2 ≤ q := by rcases hy with ⟨_, _, hN, _⟩; simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN; omega + rcases q with _ | _ | q; · omega + · omega + rcases k with _ | k; · omega + have hZL : List.Forall okL Z := Z_okL_V0 .T0 false h (p, q + 2, false) (by decide) Z 1 h0 hA + rcases Forall_snoc_inv dig0 Z (p, q + 2, false) h0 with ⟨hZ, _⟩ + refine ⟨⟨4 + h, Z.map touch ++ [(p + 1, q + 1, false), (3, k + 1, true)], .TN, .E1t, false⟩, ?_, ?_⟩ + · exact X2 h Z p q k hZL + · refine ⟨(by cases Z <;> (intro h'; nomatch h')), ⟨rfl, rfl⟩, inv_X2 h Z p q (k + 1) hZ hk hA⟩ + | L1 => + dsimp [TC] at hT; subst hT + rcases exists_last hP with ⟨Z, ⟨p, q, d⟩, rfl⟩ + rcases last_pc .L1 c4 h Z p q d h0 hA with ⟨rfl, hy⟩ + have hq : q = 1 := by rcases hy with ⟨_, _, hN, _⟩; simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN; omega + subst hq + have hZL : List.Forall okL Z := Z_okL_V0 .L1 c4 h (p, 1, false) (by decide) Z 1 h0 hA + rcases Forall_snoc_inv dig0 Z (p, 1, false) h0 with ⟨hZ, _⟩ + rcases inv_EndLast c4 h Z p hZ hA with ⟨hA', hlen⟩ + refine ⟨⟨4 + h, Z.map touch, .TA (p + 4), .L2, c4⟩, ?_, ?_⟩ + · exact EndLast h Z p hZL + · refine ⟨(by cases Z <;> dsimp [List.length] at hlen ⊢ <;> first | omega | (intro h'; nomatch h')), ?_, hA'⟩ + exact ⟨p + 4, rfl, by omega⟩ + | L2 => + rcases hT with ⟨t, rfl, ht⟩ + cases c4 with + | true => + exfalso + rcases exists_last hP with ⟨Z, ⟨p, q, d⟩, rfl⟩ + rcases last_pc .L2 true h Z p q d h0 hA with ⟨rfl, hy⟩ + exact L2_c4_V0 h (1 + Z.length) p q hy + | false => + cases P with + | nil => contradiction + | cons x Z => + rcases x with ⟨p1, q1, d1⟩ + rcases first_pc .L2 false h p1 q1 d1 Z h0 hA with ⟨rfl, hH, hZ, hA2⟩ + have hp1 := p1_V0 .L2 false h p1 q1 Z.length hH (Or.inr (Or.inr (Or.inl rfl))) + rcases p1 with _ | _ | p1; · omega + · omega + rcases AllI_okRO .L2 false h Z 2 hZ hA2 with ⟨hR, hO⟩ + have hq1 : 1 ≤ q1 := hH.2.1 + refine ⟨⟨2, (h + 5, p1 + 1, false) :: ovp q1 Z t, .TN, .E1, false⟩, ?_, ?_⟩ + · exact Ov h p1 q1 Z t hq1 hR hO + · refine ⟨(by intro h'; nomatch h'), ⟨rfl, rfl⟩, inv_Ov .L2 .E1 false (fun _ => True) h p1 q1 Z t + (Or.inr (Or.inr (Or.inr ⟨rfl, rfl, rfl, rfl⟩))) (fun _ => ht) (fun h' => (h' rfl).elim) + hZ (lastOK_True Z) hA⟩ + | LX => + rcases hT with ⟨rfl, rfl⟩ + have hlen := AllI_len .LX false h P hP hA + dsimp [minlen] at hlen + rcases exists_last hP with ⟨P1, ⟨pb, qb, db⟩, rfl⟩ + have hP1 : P1 ≠ [] := by + cases P1 <;> dsimp [List.length] at hlen <;> first | omega | (intro h'; nomatch h') + rcases exists_last hP1 with ⟨P2, ⟨pa, qa, da⟩, rfl⟩ + cases P2 with + | nil => dsimp [List.length] at hlen; omega + | cons x Z => + rcases x with ⟨p1, q1, d1⟩ + simp only [List.cons_append, List.append_assoc, List.nil_append] at h0 hA ⊢ + rcases first_pc .LX false h p1 q1 d1 (Z ++ [(pa, qa, da), (pb, qb, db)]) h0 hA with + ⟨rfl, hH, hZab, hA2⟩ + rw [List.forall_append] at hZab + rcases hZab with ⟨hZ, hab⟩ + rw [List.forall_cons, List.forall_cons] at hab + rcases hab with ⟨hda, hdb, _⟩ + dsimp [dig0, dig] at hda hdb + subst hda; subst hdb + have hB := AllI_app (PCx .LX false h) Z 2 [(pa, qa, false), (pb, qb, false)] hA2 + dsimp [AllI, PCx, Lift, List.length, dv, bv] at hB + rcases hB with ⟨ha, hb, _⟩ + have hqa : qa = 1 := by rcases ha with ⟨_, _, hN, _⟩; simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN; omega + have hqb : qb = 1 := by rcases hb with ⟨_, _, hN, _⟩; simp -failIfUnchanged only [PN, Bool.false_eq_true, ↓reduceIte, ite_true, ite_false] at hN; omega + subst hqa; subst hqb + have hpa : 1 ≤ pa := ha.1 + rcases pa with _ | pa; · omega + have hp1 := p1_V0 .LX false h p1 q1 (Z ++ [(pa + 1, 1, false), (pb, 1, false)]).length hH + (Or.inr (Or.inr (Or.inr rfl))) + rcases p1 with _ | _ | p1; · omega + · omega + have hZab' : List.Forall dig0 (Z ++ [(pa + 1, 1, false), (pb, 1, false)]) := by + rw [List.forall_append]; exact ⟨hZ, by simp [dig0, dig]⟩ + rcases AllI_okRO .LX false h (Z ++ [(pa + 1, 1, false), (pb, 1, false)]) 2 hZab' hA2 with ⟨hR, hO⟩ + rw [List.forall_append] at hR hO + have hq1 : 1 ≤ q1 := hH.2.1 + refine ⟨⟨2, (h + 5, p1 + 1, false) :: ovpX q1 Z (pa + 1), .TB (pb + 3), .T0, false⟩, ?_, ?_⟩ + · exact X1 h p1 q1 Z pa pb hq1 hR.1 hO.1 + · refine ⟨(by intro h'; nomatch h'), ⟨⟨pb + 3, rfl, by omega⟩, rfl⟩, inv_X1 h p1 q1 Z pa pb hZ hA⟩ + +theorem J_base : J ⟨2, base, .TN, .E1, false⟩ := by + dsimp [J, base, TC, AllI, PCx, Lift, PC, PN, PI, dv, bv, List.length] + refine ⟨(by intro h'; nomatch h'), ⟨rfl, rfl⟩, ?_⟩ + simp only [Bool.false_eq_true, ↓reduceIte]; decide +def InvCfg (cfg : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ s : St, cfg = Cf s ∧ J s + +theorem inv_init : ∃ cfg₀, ((init []) [target_tm]⊢* cfg₀) ∧ InvCfg cfg₀ := + ⟨Cf ⟨2, base, .TN, .E1, false⟩, init_to_base, ⟨⟨2, base, .TN, .E1, false⟩, rfl, J_base⟩⟩ + +theorem inv_step (cfg : Cfg (Fin 2) (Fin 6)) (h : InvCfg cfg) : + ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ InvCfg cfg' := by + rcases h with ⟨s, rfl, hs⟩ + rcases Jstep s hs with ⟨s', hstep, hs'⟩ + exact ⟨Cf s', hstep, ⟨s', rfl, hs'⟩⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := + closed_inv_does_not_halt target_tm InvCfg inv_init inv_step + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1RF_1LC0LE_1RD0LB_1RA0RC_1RE1LB_0RDHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RF_1LC0LF_HHH0LD_0LE1LD_0RF0LB_1RA1RE.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RF_1LC0LF_HHH0LD_0LE1LD_0RF0LB_1RA1RE.lean new file mode 100644 index 00000000..c11805e9 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RF_1LC0LF_HHH0LD_0LE1LD_0RF0LB_1RA1RE.lean @@ -0,0 +1,3417 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Excursion +public import BusyBeaver.Calculi.Longitudinal + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.M_1RB1RF_1LC0LF_HHH0LD_0LE1LD_0RF0LB_1RA1RE + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1LC0LF_HHH0LD_0LE1LD_0RF0LB_1RA1RE" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +def target_tm : Machine (Fin 2) (Fin 6) + | 0, 0 => some (some 1, Stmt.write 1 Dir.right) + | 0, 1 => some (some 5, Stmt.write 1 Dir.right) + | 1, 0 => some (some 2, Stmt.write 1 Dir.left) + | 1, 1 => some (some 5, Stmt.write 0 Dir.left) + | 2, 0 => none + | 2, 1 => some (some 3, Stmt.write 0 Dir.left) + | 3, 0 => some (some 4, Stmt.write 0 Dir.left) + | 3, 1 => some (some 3, Stmt.write 1 Dir.left) + | 4, 0 => some (some 5, Stmt.write 0 Dir.right) + | 4, 1 => some (some 1, Stmt.write 0 Dir.left) + | 5, 0 => some (some 0, Stmt.write 1 Dir.right) + | 5, 1 => some (some 4, Stmt.write 1 Dir.right) + +theorem target_eq : target = target_tm := by + funext q s + fin_cases q <;> fin_cases s <;> rfl + +end + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] +set_option autoImplicit true +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + +set_option linter.unusedSectionVars false +set_option maxHeartbeats 4000000 +set_option maxRecDepth 200000 +abbrev gQ:=Fin 2 +abbrev ai:=ListBlank (Fin 2) +abbrev aL:=Cfg (Fin 2) (Fin 6) +abbrev tm:=target_tm +@[simp] theorem sq (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config:=rfl +@[simp] theorem n8 (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config:=rfl +@[simp] theorem sm (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +theorem qO {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [M]⊢ c₂) : + c₁ [M]⊢^{1} c₂ := by simp [h] +theorem qC {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m:Nat) : + multiStep M c₁ (n + m) = (multiStep M c₁ n).bind (fun c₂ => multiStep M c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,sm,ih,Option.bind_assoc] + simp_rw [sm] +theorem qT {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c : Cfg Γ Λ) (n:Nat) : + multiStep M c (n + 1) = (step M c).bind (fun c' => multiStep M c' n) := by + rw [Nat.add_comm n 1,qC,n8] +theorem qH {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m:Nat) + (h₁ : c₁ [M]⊢^{n} c₂) (h₂ : c₂ [M]⊢^{m} c₃) : + c₁ [M]⊢^{n + m} c₃ := by + rw [qC,h₁]; simp [h₂] +theorem mm {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {M : Machine Γ Λ} (c : Cfg Γ Λ) : c [M]⊢* c:=⟨0,rfl⟩ +theorem sr {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [M]⊢* c₂) (h₂ : c₂ [M]⊢* c₃) : c₁ [M]⊢* c₃ := by + rcases h₁ with ⟨n,hn⟩; rcases h₂ with ⟨m,hm⟩ + exact ⟨n + m,qH M c₁ c₂ c₃ n m hn hm⟩ +theorem V {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [M]⊢⁺ c₂) : + c₁ [M]⊢* c₂ := by rcases h with ⟨n,_,hn⟩; exact ⟨n,hn⟩ +theorem ee {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [M]⊢⁺ c₂) (h₂ : c₂ [M]⊢* c₃) : c₁ [M]⊢⁺ c₃ := by + rcases h₁ with ⟨n,hn_pos,hn⟩; rcases h₂ with ⟨m,hm⟩ + exact ⟨n + m,by omega,qH M c₁ c₂ c₃ n m hn hm⟩ +theorem kT {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [M]⊢* c₂) (h₂ : c₂ [M]⊢⁺ c₃) : c₁ [M]⊢⁺ c₃ := by + rcases h₁ with ⟨n,hn⟩; rcases h₂ with ⟨m,hm_pos,hm⟩ + exact ⟨n + m,by omega,qH M c₁ c₂ c₃ n m hn hm⟩ +theorem sp {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [M]⊢⁺ c₂) (h₂ : c₂ [M]⊢⁺ c₃) : c₁ [M]⊢⁺ c₃ := + ee h₁ (V h₂) +@[simp] theorem oQ : (0 : Fin 2)>>default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem kX : (default : ListBlank (Fin 2)).head = 0:=rfl +@[simp] theorem k5 : (default : ListBlank (Fin 2)).tail = default:=rfl +@[simp] theorem append_nil (s : ListBlank (Fin 2)) : ([] : List (Fin 2))+>s = s:=rfl +@[simp] theorem append_cons (a : Fin 2) (l : List (Fin 2)) (s : ListBlank (Fin 2)) : + (a :: l)+>s = a>>(l+>s):=rfl +@[simp] theorem append_assoc (l1 l2 : List (Fin 2)) (s : ListBlank (Fin 2)) : + (l1++l2)+>s = l1+>(l2+>s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp [ih] +theorem qZ {w : List (Fin 2)} (h : BusyBeaver.Longitudinal.BoundedConfig.all0 w = true) : + w+>default = default := + BusyBeaver.Longitudinal.BoundedConfig.all0_spec h +theorem xV (b : Fin 2) : b = 0∨b = 1 := by + rcases b with ⟨_ | ⟨_ | n⟩,hlt⟩ + · left; rfl + · right; rfl + · omega +theorem dW (r:ai) : (∃ r',r = [0]+>r')∨(∃ r',r = [1]+>r') := by + have h : r.head>>r.tail = r:=Turing.ListBlank.cons_head_tail r + rcases xV r.head with h0 | h1 + · left; refine ⟨r.tail,?_⟩; rw [append_cons,append_nil,← h0,h] + · right; refine ⟨r.tail,?_⟩; rw [append_cons,append_nil,← h1,h] +def bf (l:ai) (w : List gQ) : ai:=w.reverse+>l +def FR (l r:ai) : aL:=l {{F}}> r +def DL (l r:ai) : aL:=l <{{D}} r +def FL (l r:ai) : aL:=l <{{F}} r +def BL (l r:ai) : aL:=l <{{B}} r +def CE (r:ai) : aL:=default {{E}}> ([0,0]+>r) +def wL : List gQ:=[1,1,0] +def wX : List gQ:=[1,1,0,1,1,0] +def wY : List gQ:=[1,1,1,1] +def wa : List gQ:=[1,1,1,0,1,0] +def wb : List gQ:=[1,0,1,0] +@[simp] theorem Hm (l:ai) : bf l [] = l:=rfl +theorem df (l:ai) (u v : List gQ) : bf l (u++v) = bf (bf l u) v := by + simp [bf,List.reverse_append,append_assoc] +structure pu where + past : List gQ + front : List gQ + state : Fin 6 + left_head : Bool +deriving DecidableEq +def pu.toBC (x:pu) : BusyBeaver.Longitudinal.BoundedConfig.BCfg gQ (Fin 6) := + match x.left_head with + | true => ⟨x.front, x.past, x.state, .left⟩ + | false => ⟨x.past, x.front, x.state, .right⟩ +def pu.ofBC (x : BusyBeaver.Longitudinal.BoundedConfig.BCfg gQ (Fin 6)) : pu := + match x.sgn with + | .left => ⟨x.r, x.l, x.s, true⟩ + | .right => ⟨x.l, x.r, x.s, false⟩ +theorem pu_toBC_ofBC (x : BusyBeaver.Longitudinal.BoundedConfig.BCfg gQ (Fin 6)) : + (pu.ofBC x).toBC = x := by + rcases x with ⟨l, r, s, _ | _⟩ <;> rfl +def go (x:pu) (l r:ai) : aL := + BusyBeaver.Longitudinal.BoundedConfig.toCfg x.toBC l r +def qi (x:pu) : Option pu := + (BusyBeaver.Longitudinal.BoundedConfig.step tm x.toBC).map pu.ofBC +theorem x4 {x y : pu} (h : qi x = some y) (l r:ai) : + (go x l r) [tm]⊢ (go y l r) := by + rcases Option.map_eq_some_iff.mp h with ⟨b, hb, rfl⟩ + simpa only [go, pu_toBC_ofBC] using + BusyBeaver.Longitudinal.BoundedConfig.step_spec tm x.toBC hb l r +def v4 : Nat→pu→Option pu + | 0,x => some x + | n + 1,x => + match qi x with + | none => none + | some z => v4 n z +theorem yH {n : Nat} {x y : pu} (h : v4 n x = some y) (l r:ai) : + (go x l r) [tm]⊢^{n} (go y l r) := by + induction n generalizing x with + | zero => injection h with hy; subst hy; rfl + | succ n ih => + unfold v4 at h + rcases hs : qi x with _ | z + · rw [hs] at h; contradiction + · rw [hs] at h + rw [Nat.add_comm n 1] + exact qH tm _ _ _ 1 n (qO tm _ _ (x4 hs l r)) (ih h) +theorem U (n:Nat) (x y:pu) (h : v4 (n + 1) x = some y) (l r:ai) : + (go x l r) [tm]⊢⁺ (go y l r) := + ⟨n + 1,Nat.succ_pos n,yH h l r⟩ +theorem r1 (l r:ai) : (FR l ([0,0,0]+>r)) [tm]⊢⁺ (DL l ([1,0,1]+>r)) := + U 4 ⟨[],[0,0,0],F,false⟩ ⟨[],[1,0,1],D,true⟩ (by decide) l r +theorem r3 (l r:ai) : (FR l ([0,0,1]+>r)) [tm]⊢⁺ (FR (bf l wL) r) := + U 4 ⟨[],[0,0,1],F,false⟩ ⟨wL.reverse,[],F,false⟩ (by decide) l r +theorem xA (l r:ai) : (FR l ([0,1]+>r)) [tm]⊢⁺ (FR (bf l [1,1]) r) := + U 1 ⟨[],[0,1],F,false⟩ ⟨[1,1],[],F,false⟩ (by decide) l r +theorem u8 (l r:ai) : (FR l ([1,0]+>r)) [tm]⊢⁺ (FR (bf l [1,0]) r) := + U 1 ⟨[],[1,0],F,false⟩ ⟨[0,1],[],F,false⟩ (by decide) l r +theorem vn (l r:ai) : (FR l ([1,1]+>r)) [tm]⊢⁺ (FL l ([0,0]+>r)) := + U 2 ⟨[],[1,1],F,false⟩ ⟨[],[0,0],F,true⟩ (by decide) l r +theorem An (l r:ai) : (DL (bf l [1]) r) [tm]⊢⁺ (DL l ([1]+>r)) := + U 0 ⟨[1],[],D,true⟩ ⟨[],[1],D,true⟩ (by decide) l r +theorem xE (l r:ai) : (DL (bf l [1,0]) r) [tm]⊢⁺ (BL l ([0,0]+>r)) := + U 1 ⟨[0,1],[],D,true⟩ ⟨[],[0,0],B,true⟩ (by decide) l r +theorem EA (l r:ai) : (BL (bf l [1]) ([0,0]+>r)) [tm]⊢⁺ (FL l ([0,0,0]+>r)) := + U 0 ⟨[1],[0,0],B,true⟩ ⟨[],[0,0,0],F,true⟩ (by decide) l r +theorem xN (l r:ai) : (BL (bf l [1,0]) ([0,0]+>r)) [tm]⊢⁺ (DL l ([0,1,0,0]+>r)) := + U 1 ⟨[0,1],[0,0],B,true⟩ ⟨[],[0,1,0,0],D,true⟩ (by decide) l r +theorem EX (l r:ai) : (FL (bf l [1]) ([0,0]+>r)) [tm]⊢⁺ (FR (bf l [1,0]) ([0]+>r)) := + U 1 ⟨[1],[0,0],F,true⟩ ⟨[0,1],[0],F,false⟩ (by decide) l r +theorem xR (l r:ai) : (FL (bf l [1,0]) ([0,0]+>r)) [tm]⊢⁺ (DL (bf l [1]) ([1,0,1]+>r)) := + U 4 ⟨[0,1],[0,0],F,true⟩ ⟨[1],[1,0,1],D,true⟩ (by decide) l r +abbrev d7 (c:aL) (n:Nat) : Prop := + BusyBeaver.Excursion.HaltsIn tm c n +abbrev cE (c:aL) (P : aL→Prop) : Prop := + BusyBeaver.Excursion.Leads tm c P +abbrev fl (c:aL) (P : aL→Prop) : Prop := + BusyBeaver.Excursion.Advances tm c P +theorem uF {c d : aL} {n : Nat} (hr : c [tm]⊢* d) (hh : d7 c n) : + ∃ m ≤ n,d7 d m := + BusyBeaver.Excursion.haltsIn_reduce_stepStar hr hh +theorem kz {c d : aL} {n : Nat} (hr : c [tm]⊢⁺ d) (hh : d7 c n) : + ∃ m < n,d7 d m := + BusyBeaver.Excursion.haltsIn_reduce_stepPlus hr hh +theorem dg {c : aL} {P : aL→Prop} (hp : P c) : cE c P := + BusyBeaver.Excursion.Leads.here hp +theorem bn {c d : aL} {P : aL→Prop} (hr : c [tm]⊢* d) (hp : P d) : cE c P := + BusyBeaver.Excursion.Leads.of_stepStar hr hp +theorem bh {c : aL} {P Q : aL→Prop} (h1 : cE c P) (h2 : ∀ d,P d→cE d Q) : + cE c Q := + BusyBeaver.Excursion.Leads.trans h1 h2 +theorem xZ {c : aL} {P Q : aL→Prop} (h : cE c P) (hinc : ∀ d,P d→Q d) : + cE c Q := + BusyBeaver.Excursion.Leads.mono h hinc +theorem x3 {c : aL} {P : aL→Prop} (h : fl c P) : cE c P := + BusyBeaver.Excursion.Advances.to_leads h +theorem cr {c d : aL} {P : aL→Prop} (hr : c [tm]⊢⁺ d) (h : cE d P) : + fl c P := + BusyBeaver.Excursion.Advances.of_stepPlus_leads hr h +theorem cc {c d : aL} {P : aL→Prop} (hr : c [tm]⊢⁺ d) (h : cE d P) : + cE c P := + BusyBeaver.Excursion.Leads.of_stepPlus_leads hr h +theorem su {c : aL} {P Q : aL→Prop} (h1 : fl c P) (h2 : ∀ d,P d→cE d Q) : + fl c Q := + BusyBeaver.Excursion.Advances.trans h1 h2 +theorem q2 {P : aL→Prop} (h : ∀ c,P c→fl c P) : + ∀ n c,P c→¬ d7 c n := + BusyBeaver.Excursion.not_haltsIn_of_advances h +inductive Bs where + | GoRight | FromD | FromF | FromB +def sd (b:Bool) : List gQ:=if b then [1,0] else [1] +def bJ (l:ai) : List Bool→ai + | [] => l + | b :: s => bf (bJ l s) (sd b) +def aq (l:ai) (s : List Bool) (e:Bs) (r:ai) : aL := + match e with + | .GoRight => FR (bJ l s) r + | .FromD => DL (bJ l s) r + | .FromF => FL (bJ l s) ([0,0]+>r) + | .FromB => BL (bJ l s) ([0,0]+>r) +inductive ip (l:ai) : aL→Prop where + | contact_D (r:ai) : ip l (DL l r) + | contact_F (r:ai) : ip l (FL l ([0,0]+>r)) + | contact_B (r:ai) : ip l (BL l ([0,0]+>r)) +theorem el {c d : aL} {P : aL→Prop} {n : Nat} + (hr : c [tm]⊢⁺ d) + (ih : ∀ m < n,d7 d m→∃ k e,k ≤ m∧P e∧d7 e k) + (hh : d7 c n) : ∃ k e,k ≤ n∧P e∧d7 e k := by + rcases kz hr hh with ⟨m,hmn,hm⟩ + rcases ih m hmn hm with ⟨k,e,hkm,hp,hk⟩ + exact ⟨k,e,by omega,hp,hk⟩ +theorem uo (n:Nat) : + ∀ (l:ai) (s : List Bool) (e:Bs) (r:ai), + d7 (aq l s e r) n → + ∃ k c,k ≤ n∧ip l c∧d7 c k := by + induction n using Nat.strong_induction_on with + | h n ih => + intro l s e r hhalt + cases e with + | GoRight => + rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · have hr : (aq l s .GoRight ([0]+>([0]+>([0]+>r)))) [tm]⊢⁺ (aq l s .FromD ([1,0,1]+>r)) := by + simpa only [aq,← append_assoc] using! r1 (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l s .FromD ([1,0,1]+>r) hm) hhalt + · have hr : (aq l s .GoRight ([0]+>([0]+>([1]+>r)))) [tm]⊢⁺ (aq l (true :: false :: s) .GoRight r) := by + simpa only [aq,bJ,sd,df,← append_assoc] using! r3 (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l (true :: false :: s) .GoRight r hm) hhalt + · have hr : (aq l s .GoRight ([0]+>([1]+>r))) [tm]⊢⁺ (aq l (false :: false :: s) .GoRight r) := by + simpa only [aq,bJ,sd,df,← append_assoc] using! xA (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l (false :: false :: s) .GoRight r hm) hhalt + · rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · have hr : (aq l s .GoRight ([1]+>([0]+>r))) [tm]⊢⁺ (aq l (true :: s) .GoRight r) := by + simpa only [aq,bJ,sd,df,← append_assoc] using! u8 (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l (true :: s) .GoRight r hm) hhalt + · have hr : (aq l s .GoRight ([1]+>([1]+>r))) [tm]⊢⁺ (aq l s .FromF r) := by + simpa only [aq,← append_assoc] using! vn (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l s .FromF r hm) hhalt + | FromD => + cases s with + | nil => exact ⟨n,DL l r,le_rfl,.contact_D r,hhalt⟩ + | cons b s => + cases b + · have hr : (aq l (false :: s) .FromD r) [tm]⊢⁺ (aq l s .FromD ([1]+>r)) := + An (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l s .FromD ([1]+>r) hm) hhalt + · have hr : (aq l (true :: s) .FromD r) [tm]⊢⁺ (aq l s .FromB r) := + xE (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l s .FromB r hm) hhalt + | FromF => + cases s with + | nil => exact ⟨n,FL l ([0,0]+>r),le_rfl,.contact_F r,hhalt⟩ + | cons b s => + cases b + · have hr : (aq l (false :: s) .FromF r) [tm]⊢⁺ (aq l (true :: s) .GoRight ([0]+>r)) := + EX (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l (true :: s) .GoRight ([0]+>r) hm) hhalt + · have hr : (aq l (true :: s) .FromF r) [tm]⊢⁺ (aq l (false :: s) .FromD ([1,0,1]+>r)) := + xR (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l (false :: s) .FromD ([1,0,1]+>r) hm) hhalt + | FromB => + cases s with + | nil => exact ⟨n,BL l ([0,0]+>r),le_rfl,.contact_B r,hhalt⟩ + | cons b s => + cases b + · have hr : (aq l (false :: s) .FromB r) [tm]⊢⁺ (aq l s .FromF ([0]+>r)) := by + simpa only [aq,← append_assoc] using! EA (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l s .FromF ([0]+>r) hm) hhalt + · have hr : (aq l (true :: s) .FromB r) [tm]⊢⁺ (aq l s .FromD ([0,1,0,0]+>r)) := + xN (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l s .FromD ([0,1,0,0]+>r) hm) hhalt +theorem fv (l r:ai) : cE (FR l r) (ip l) := + fun n hn => uo n l [] .GoRight r hn +theorem jC (l:ai) (s : List Bool) (e:Bs) (r:ai) : + cE (aq l s e r) (ip l) := + fun n hn => uo n l s e r hn +theorem pG (l r:ai) : fl (FR l r) (ip l) := by + rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · refine cr ?_ (dg (.contact_D ([1,0,1]+>r))) + simpa only [← append_assoc] using! r1 l r + · refine cr ?_ (jC l [true,false] .GoRight r) + simpa only [aq,bJ,sd,df,← append_assoc] using! r3 l r + · refine cr ?_ (jC l [false,false] .GoRight r) + simpa only [aq,bJ,sd,df,← append_assoc] using! xA l r + · rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · refine cr ?_ (jC l [true] .GoRight r) + simpa only [aq,bJ,sd,df,← append_assoc] using! u8 l r + · refine cr ?_ (dg (.contact_F r)) + simpa only [← append_assoc] using! vn l r +inductive gw (l:ai) : aL→Prop where + | weak_D (r:ai) : gw l (DL l r) + | weak_F (r:ai) : gw l (FL l ([0,0,0]+>r)) +inductive dU (l:ai) : aL→Prop where + | strong_D (r:ai) : dU l (DL l (wa+>r)) + | strong_F (r:ai) : dU l (FL l ([0,0,0]+>(wa+>r))) +theorem GP (l r:ai) : (DL (bf l wL) r) [tm]⊢⁺ (FL l ([0,0,0]+>r)) := + U 2 ⟨wL.reverse,[],D,true⟩ ⟨[],[0,0,0],F,true⟩ (by decide) l r +theorem GZ (l r:ai) : (FL (bf l wL) ([0,0]+>r)) [tm]⊢⁺ (DL l ([1,1,1,0,1]+>r)) := + U 6 ⟨wL.reverse,[0,0],F,true⟩ ⟨[],[1,1,1,0,1],D,true⟩ (by decide) l r +theorem GN (l r:ai) : (BL (bf l wL) ([0,0]+>r)) [tm]⊢⁺ (DL l ([1,0,1,0,0]+>r)) := + U 2 ⟨wL.reverse,[0,0],B,true⟩ ⟨[],[1,0,1,0,0],D,true⟩ (by decide) l r +theorem Ge (l r:ai) : (DL (bf l [1,1]) r) [tm]⊢⁺ (DL l ([1,1]+>r)) := + U 1 ⟨[1,1],[],D,true⟩ ⟨[],[1,1],D,true⟩ (by decide) l r +theorem Gd (l r:ai) : (FL (bf l [1,1]) ([0,0]+>r)) [tm]⊢⁺ (FR (bf l wL) ([0]+>r)) := + U 1 ⟨[1,1],[0,0],F,true⟩ ⟨wL.reverse,[0],F,false⟩ (by decide) l r +theorem Hc (l r:ai) : (BL (bf l [1,1]) ([0,0]+>r)) [tm]⊢⁺ (FR (bf l [1,0]) ([0,0]+>r)) := + U 2 ⟨[1,1],[0,0],B,true⟩ ⟨[0,1],[0,0],F,false⟩ (by decide) l r +theorem GV (l r:ai) : (DL (bf l wX) r) [tm]⊢⁺ (DL l (wa+>r)) := + U 9 ⟨wX.reverse,[],D,true⟩ ⟨[],wa,D,true⟩ (by decide) l r +theorem Dp (l r:ai) : (FL (bf l wX) ([0,0,0]+>r)) [tm]⊢⁺ (FL l ([0,0,0]+>(wa+>r))) := by + simpa only [append_assoc] using! + U 9 ⟨wX.reverse,[0,0,0],F,true⟩ ⟨[],[0,0,0]++wa,F,true⟩ (by decide) l r +theorem rV (l:ai) (c:aL) (h : ip (bf l wL) c) : cE c (gw l) := by + cases h with + | contact_D r => exact bn (V (GP l r)) (.weak_F r) + | contact_F r => exact bn (V (GZ l r)) (.weak_D ([1,1,1,0,1]+>r)) + | contact_B r => exact bn (V (GN l r)) (.weak_D ([1,0,1,0,0]+>r)) +theorem yQ (l r:ai) : cE (FR (bf l wL) r) (gw l) := + bh (fv (bf l wL) r) (rV l) +def lu (w : List gQ) : Prop := + ∀ l c,gw (bf l w) c→cE c (gw l) +theorem Bf : lu wL := by + intro l c h + cases h with + | weak_D r => exact rV l _ (.contact_D r) + | weak_F r => + have hc : ip (bf l wL) (FL (bf l wL) ([0,0]+>([0]+>r))):=.contact_F ([0]+>r) + simpa only [← append_assoc] using! rV l _ hc +theorem AK : lu [1,1] := by + intro l c h + cases h with + | weak_D r => exact bn (V (Ge l r)) (.weak_D ([1,1]+>r)) + | weak_F r => + have hf : (FL (bf l [1,1]) ([0,0,0]+>r)) [tm]⊢⁺ (FR (bf l wL) ([0]+>([0]+>r))) := by + simpa only [← append_assoc] using! Gd l ([0]+>r) + exact cc hf (yQ l ([0]+>([0]+>r))) +theorem yP {u v : List gQ} (hu : lu u) (hv : lu v) : + lu (u++v) := by + intro l c hc + rw [df] at hc + exact bh (hv (bf l u) c hc) (hu l) +inductive b9 where + | PL | P11 +deriving DecidableEq +def xS : b9→List gQ + | .PL => wL + | .P11 => [1,1] +def hE : List b9→List gQ + | [] => [] + | p :: ps => xS p++hE ps +theorem w8 (ps : List b9) : lu (hE ps) := by + induction ps with + | nil => intro l c h; exact dg h + | cons p ps ih => + unfold hE + refine yP ?_ ih + cases p + · exact Bf + · exact AK +theorem DR (l:ai) (c:aL) (h : gw (bf l wX) c) : + cE c (dU l) := by + cases h with + | weak_D r => exact bn (V (GV l r)) (.strong_D r) + | weak_F r => exact bn (V (Dp l r)) (.strong_F r) +def b5 (ps : List b9) : List gQ := + (wX++hE ps)++wL +theorem lI (ps : List b9) (l:ai) (c:aL) + (h : ip (bf l (b5 ps)) c) : cE c (dU l) := by + unfold b5 at h + rw [df,df] at h + refine bh (rV (bf (bf l wX) (hE ps)) c h) ?_ + intro d hd + refine bh (w8 ps (bf l wX) d hd) ?_ + intro e he + exact DR l e he +theorem r7 (ps : List b9) (l r:ai) : + cE (FR (bf l (b5 ps)) r) (dU l) := + bh (fv (bf l (b5 ps)) r) (lI ps l) +inductive dA (l:ai) : aL→Prop where + | phase_D (r:ai) : dA l (DL l r) + | phase_F (r:ai) : dA l (FL l ([0,0,0]+>r)) + | phase_B101 (r:ai) : dA l (BL l ([0,0,1,0,1]+>r)) + | phase_B11101 (r:ai) : dA l (BL l ([0,0,1,1,1,0,1]+>r)) +theorem xX (l:ai) (c:aL) (h : gw l c) : dA l c := by + cases h with + | weak_D r => exact .phase_D r + | weak_F r => exact .phase_F r +theorem GC (l r:ai) : (DL (bf l ([1,0]++wL)) r) [tm]⊢⁺ (DL l ([1,1,0,1,0]+>r)) := + U 8 ⟨(([1,0] : List gQ)++wL).reverse,[],D,true⟩ ⟨[],[1,1,0,1,0],D,true⟩ (by decide) l r +theorem Gy (l r:ai) : (FL (bf l ([1,0]++wL)) ([0,0]+>r)) [tm]⊢⁺ (BL l ([0,0,1,1,1,0,1]+>r)) := + U 8 ⟨(([1,0] : List gQ)++wL).reverse,[0,0],F,true⟩ ⟨[],[0,0,1,1,1,0,1],B,true⟩ (by decide) l r +theorem Gi (l r:ai) : (BL (bf l ([1,0]++wL)) ([0,0]+>r)) [tm]⊢⁺ (BL l ([0,0,1,0,1,0,0]+>r)) := + U 4 ⟨(([1,0] : List gQ)++wL).reverse,[0,0],B,true⟩ ⟨[],[0,0,1,0,1,0,0],B,true⟩ (by decide) l r +theorem Cx (l r:ai) : cE (FR (bf l ([1,0]++wL)) r) (dA l) := by + refine bh (fv (bf l ([1,0]++wL)) r) ?_ + intro c h + cases h with + | contact_D r0 => exact bn (V (GC l r0)) (.phase_D ([1,1,0,1,0]+>r0)) + | contact_F r0 => exact bn (V (Gy l r0)) (.phase_B11101 r0) + | contact_B r0 => + have hp : dA l (BL l ([0,0,1,0,1,0,0]+>r0)) := by + simpa only [← append_assoc] using! dA.phase_B101 ([0,0]+>r0) + exact bn (V (Gi l r0)) hp +theorem A1 (l r:ai) : (FR (bf l [1,0]) ([0,0,0]+>r)) [tm]⊢⁺ (BL l ([0,0,1,0,1]+>r)) := + U 6 ⟨[0,1],[0,0,0],F,false⟩ ⟨[],[0,0,1,0,1],B,true⟩ (by decide) l r +theorem AL (l r:ai) : (FR (bf l [1,0]) ([0,0,1]+>r)) [tm]⊢⁺ (FR (bf l ([1,0]++wL)) r) := + U 4 ⟨[0,1],[0,0,1],F,false⟩ ⟨(([1,0] : List gQ)++wL).reverse,[],F,false⟩ (by decide) l r +theorem Bd (l r:ai) : cE (FR (bf l [1,0]) ([0,0]+>r)) (dA l) := by + rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · have hr : (FR (bf l [1,0]) ([0,0]+>([0]+>r))) [tm]⊢⁺ (BL l ([0,0,1,0,1]+>r)) := by + simpa only [← append_assoc] using! A1 l r + exact bn (V hr) (.phase_B101 r) + · have hr : (FR (bf l [1,0]) ([0,0]+>([1]+>r))) [tm]⊢⁺ (FR (bf l ([1,0]++wL)) r) := by + simpa only [← append_assoc] using! AL l r + exact cc hr (Cx l r) +theorem x1 (l r:ai) : cE (FR (bf l [1,1]) r) (dA l) := by + refine bh (fv (bf l [1,1]) r) ?_ + intro c h + cases h with + | contact_D r0 => exact bn (V (Ge l r0)) (.phase_D ([1,1]+>r0)) + | contact_F r0 => exact cc (Gd l r0) (xZ (yQ l ([0]+>r0)) (xX l)) + | contact_B r0 => exact cc (Hc l r0) (Bd l r0) +theorem uK (l r:ai) : cE (FR l ([0]+>r)) (dA l) := by + rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · have hr : (FR l ([0]+>([0]+>([0]+>r)))) [tm]⊢⁺ (DL l ([1,0,1]+>r)) := by + simpa only [← append_assoc] using! r1 l r + exact bn (V hr) (.phase_D ([1,0,1]+>r)) + · have hr : (FR l ([0]+>([0]+>([1]+>r)))) [tm]⊢⁺ (FR (bf l wL) r) := by + simpa only [← append_assoc] using! r3 l r + exact cc hr (xZ (yQ l r) (xX l)) + · have hr : (FR l ([0]+>([1]+>r))) [tm]⊢⁺ (FR (bf l [1,1]) r) := by + simpa only [← append_assoc] using! xA l r + exact cc hr (x1 l r) +inductive W where + | UA | UT +deriving DecidableEq +inductive cm where + | CD | CF +deriving DecidableEq +def y2 : W→List gQ + | .UA => wa + | .UT => wY++wa +def yL : W→List gQ + | .UA => wa + | .UT => wa++wb +def G1 : W→List gQ + | .UA => wX + | .UT => wX++wY +def HD : List W→List gQ + | [] => [] + | u :: us => y2 u++HD us +def HF : List W→List gQ + | [] => [] + | u :: us => yL u++HF us +def G : List W→List gQ + | [] => [] + | u :: us => G1 u++G us +@[simp] theorem B8 (u:W) (us : List W) : HD (u :: us) = y2 u++HD us:=rfl +@[simp] theorem Ct (u:W) (us : List W) : HF (u :: us) = yL u++HF us:=rfl +def lX : cm→List gQ + | .CD => [] + | .CF => wY +def n9 (d:cm) (us : List W) : List gQ := + match d with + | .CD => HD us + | .CF => wb++HF us +def hF (d:cm) (us : List W) (r:ai) : aL := + CE (n9 d us+>r) +def lr (c:aL) : Prop := + ∃ d us r,3 ≤ us.length∧c = hF d us r +def cn (d:cm) (us : List W) : ai := + bf default ([0]++lX d++G us) +theorem FQ (us vs : List W) : HD (us++vs) = HD us++HD vs := by + induction us with + | nil => rfl + | cons u us ih => simp [HD,ih,List.append_assoc] +theorem FY (us vs : List W) : HF (us++vs) = HF us++HF vs := by + induction us with + | nil => rfl + | cons u us ih => simp [HF,ih,List.append_assoc] +theorem Gk (us vs : List W) : G (us++vs) = G us++G vs := by + induction us with + | nil => rfl + | cons u us ih => simp [G,ih,List.append_assoc] +theorem DW (u:W) (l r:ai) : + (FR l ([0]+>(y2 u+>r))) [tm]⊢⁺ (FR (bf l (G1 u)) ([0]+>r)) := by + cases u + · simpa only [y2,G1,append_assoc] using! + U 11 ⟨[],[0]++wa,F,false⟩ ⟨wX.reverse,[0],F,false⟩ (by decide) l r + · simpa only [y2,G1,append_assoc] using! + U 17 ⟨[],[0]++(wY++wa),F,false⟩ ⟨(wX++wY).reverse,[0],F,false⟩ (by decide) l r +theorem DO (u:W) (l r:ai) : + (FR l ([0]+>(yL u+>r))) [tm]⊢⁺ (FR (bf l (G1 u)) ([0]+>r)) := by + cases u + · simpa only [yL,G1,append_assoc] using! + U 11 ⟨[],[0]++wa,F,false⟩ ⟨wX.reverse,[0],F,false⟩ (by decide) l r + · simpa only [yL,G1,append_assoc] using! + U 15 ⟨[],[0]++(wa++wb),F,false⟩ ⟨(wX++wY).reverse,[0],F,false⟩ (by decide) l r +theorem FK (l r:ai) : + (FR l ([0]+>(wb+>r))) [tm]⊢⁺ (FR (bf l wY) ([0]+>r)) := by + simpa only [append_assoc] using! + U 3 ⟨[],[0]++wb,F,false⟩ ⟨wY.reverse,[0],F,false⟩ (by decide) l r +theorem EG (us : List W) (l r:ai) : + (FR l ([0]+>(HD us+>r))) [tm]⊢* (FR (bf l (G us)) ([0]+>r)) := by + induction us generalizing l r with + | nil => exact mm _ + | cons u us ih => + unfold HD G + rw [append_assoc,df] + exact V (ee (DW u l (HD us+>r)) (ih (bf l (G1 u)) r)) +theorem E6 (us : List W) (l r:ai) : + (FR l ([0]+>(HF us+>r))) [tm]⊢* (FR (bf l (G us)) ([0]+>r)) := by + induction us generalizing l r with + | nil => exact mm _ + | cons u us ih => + unfold HF G + rw [append_assoc,df] + exact V (ee (DO u l (HF us+>r)) (ih (bf l (G1 u)) r)) +theorem E7 (r:ai) : (CE r) [tm]⊢⁺ (FR (bf default [0]) ([0]+>r)) := by + refine ⟨1,by decide,?_⟩ + simp only [CE,FR,bf,List.reverse_singleton,n8,step,append_cons,append_nil, + Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,kX,k5,tm,target_tm,E,F,Option.map,Tape.write,Tape.move] +theorem ta (d:cm) (us : List W) (r:ai) : + (hF d us r) [tm]⊢⁺ (FR (cn d us) ([0]+>r)) := by + unfold hF + refine ee (E7 (n9 d us+>r)) ?_ + cases d + · unfold n9 cn lX + simp only [List.append_nil,df] + exact EG us (bf default [0]) r + · unfold n9 cn lX + rw [append_assoc,df,df] + exact V (ee (FK (bf default [0]) (HF us+>r)) (E6 us (bf (bf default [0]) wY) r)) +theorem G7 (u:W) (l r:ai) : + (DL (bf l (G1 u)) (wa+>r)) [tm]⊢⁺ (DL l (wa+>(y2 u+>r))) := by + cases u + · simpa only [G1,y2,append_assoc] using! + U 9 ⟨wX.reverse,wa,D,true⟩ ⟨[],wa++wa,D,true⟩ (by decide) l r + · simpa only [G1,y2,append_assoc] using! + U 13 ⟨(wX++wY).reverse,wa,D,true⟩ ⟨[],wa++(wY++wa),D,true⟩ (by decide) l r +theorem G5 (u:W) (l r:ai) : + (FL (bf l (G1 u)) ([0,0,0]+>(wa+>r))) [tm]⊢⁺ (FL l ([0,0,0]+>(wa+>(yL u+>r)))) := by + cases u + · simpa only [G1,yL,append_assoc] using! + U 9 ⟨wX.reverse,[0,0,0]++wa,F,true⟩ ⟨[],[0,0,0]++wa++wa,F,true⟩ (by decide) l r + · simpa only [G1,yL,append_assoc] using! + U 49 ⟨(wX++wY).reverse,[0,0,0]++wa,F,true⟩ ⟨[],[0,0,0]++wa++(wa++wb),F,true⟩ (by decide) l r +theorem H8 (us : List W) (l r:ai) : + (DL (bf l (G us)) (wa+>r)) [tm]⊢* (DL l (wa+>(HD us+>r))) := by + induction us generalizing l r with + | nil => exact mm _ + | cons u us ih => + unfold G HD + rw [df,append_assoc] + exact sr (ih (bf l (G1 u)) r) (V (G7 u l (HD us+>r))) +theorem HJ (us : List W) (l r:ai) : + (FL (bf l (G us)) ([0,0,0]+>(wa+>r))) [tm]⊢* (FL l ([0,0,0]+>(wa+>(HF us+>r)))) := by + induction us generalizing l r with + | nil => exact mm _ + | cons u us ih => + unfold G HF + rw [df,append_assoc] + exact sr (ih (bf l (G1 u)) r) (V (G5 u l (HF us+>r))) +theorem HC (l r:ai) : (DL (bf l wY) (wa+>r)) [tm]⊢⁺ (DL l (wY+>(wa+>r))) := by + simpa only [append_assoc] using! + U 3 ⟨wY.reverse,wa,D,true⟩ ⟨[],wY++wa,D,true⟩ (by decide) l r +theorem H0 (l r:ai) : + (FL (bf l wY) ([0,0,0]+>(wa+>r))) [tm]⊢⁺ (FL l ([0,0,0]+>(wa+>(wb+>r)))) := by + simpa only [append_assoc] using! + U 39 ⟨wY.reverse,[0,0,0]++wa,F,true⟩ ⟨[],[0,0,0]++wa++wb,F,true⟩ (by decide) l r +theorem BV (r:ai) : (DL (bf default [0]) r) [tm]⊢⁺ (CE r) := by + refine ⟨1,by decide,?_⟩ + simp only [DL,CE,bf,List.reverse_singleton,n8,step,append_cons,append_nil, + Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,kX,k5,tm,target_tm,D,E,Option.map,Tape.write,Tape.move] +structure f3 where + past : List gQ + front : List gQ + state : Fin 6 +deriving DecidableEq +def dw (x:f3) (r:ai) : aL := + ⟨some x.state,⟨(x.front+>r).head,x.past+>default,(x.front+>r).tail⟩⟩ +def mr (x:f3) : Option f3 := + match x.front with + | [] => none + | b :: bs => + match tm x.state b with + | none => none + | some (none,_) => none + | some (some s',Stmt.write v .right) => some ⟨v :: x.past,bs,s'⟩ + | some (some s',Stmt.write v .left) => + match x.past with + | [] => some ⟨[],0 :: v :: bs,s'⟩ + | a :: ls => some ⟨ls,a :: v :: bs,s'⟩ +def AD : Nat→f3→Option f3 + | 0,x => some x + | n + 1,x => + match mr x with + | none => none + | some y => AD n y +theorem vQ {x y : f3} (h : mr x = some y) (r:ai) : + (dw x r) [tm]⊢ (dw y r) := by + rcases x with ⟨ls,fs,s⟩ + cases fs with + | nil => contradiction + | cons b bs => + unfold mr at h; dsimp only at h + rcases htm : tm s b with _ | ⟨q',st⟩ + · rw [htm] at h; contradiction + · rw [htm] at h + rcases q' with _ | s' + · contradiction + · rcases st with ⟨v,d⟩ + cases d + · cases ls with + | nil => + injection h with hy; subst hy + unfold dw; dsimp only [append_cons,append_nil] + simp only [step,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,kX,k5,htm,Option.map,Tape.write,Tape.move] + | cons a ls => + injection h with hy; subst hy + unfold dw; dsimp only [append_cons] + simp only [step,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,htm,Option.map,Tape.write,Tape.move] + · injection h with hy; subst hy + unfold dw; dsimp only [append_cons] + simp only [step,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,htm,Option.map,Tape.write,Tape.move] +theorem C3 {n : Nat} {x y : f3} (h : AD n x = some y) (r:ai) : + (dw x r) [tm]⊢^{n} (dw y r) := by + induction n generalizing x with + | zero => injection h with hy; subst hy; rfl + | succ n ih => + unfold AD at h + rcases hs : mr x with _ | z + · rw [hs] at h; contradiction + · rw [hs] at h + rw [Nat.add_comm n 1] + exact qH tm _ _ _ 1 n (qO tm _ _ (vQ hs r)) (ih h) +theorem vD {n : Nat} {x y : f3} (h : AD (n + 1) x = some y) (r:ai) : + (dw x r) [tm]⊢⁺ (dw y r) := + ⟨n + 1,Nat.succ_pos n,C3 h r⟩ +def r2 : List gQ→List gQ + | [] => [] + | b :: ls => + match r2 ls with + | [] => if b==0 then [] else [b] + | ys => b :: ys +theorem xo (ls : List gQ) : r2 ls+>default = ls+>default := by + induction ls with + | nil => rfl + | cons b ls ih => + unfold r2 + rcases h : r2 ls with _ | ⟨y,ys⟩ + · rw [h,append_nil] at ih + rcases xV b with rfl | rfl + · change []+>default = (0 :: ls)+>default + rw [append_nil,append_cons,← ih,oQ] + · change [1]+>default = (1 :: ls)+>default + rw [append_cons,append_nil,append_cons,← ih] + · change (b :: y :: ys)+>default = (b :: ls)+>default + rw [append_cons,← h,ih,append_cons] +def kR (x y:f3) : Bool := + r2 x.past==r2 y.past&&x.front==y.front&&x.state==y.state +theorem kE {x y : f3} (h : kR x y = true) (r:ai) : + dw x r = dw y r := by + unfold kR at h + simp only [Bool.and_eq_true,beq_iff_eq] at h + rcases h with ⟨⟨hp,hf⟩,hs⟩ + unfold dw + rw [hf,hs,← xo x.past,← xo y.past,hp] +def vG (n:Nat) (x y:f3) : Bool := + match AD n x with + | some z => kR z y + | none => false +theorem kC (n:Nat) (x y:f3) (h : vG (n + 1) x y = true) (r:ai) : + (dw x r) [tm]⊢⁺ (dw y r) := by + unfold vG at h + rcases hr : AD (n + 1) x with _ | z + · rw [hr] at h; contradiction + · rw [hr] at h + rw [← kE h r] + exact vD hr r +theorem Cc (r:ai) : (FL (bf default [0]) ([0,0,0]+>(wa+>r))) [tm]⊢⁺ (CE (wb+>(wa+>r))) := by + have h:=kC 5 ⟨[],0 :: ([0,0,0]++wa),F⟩ ⟨[],[0,0]++wb++wa,E⟩ (by decide) r + simpa only [dw,FL,CE,bf,List.reverse_singleton,append_cons,append_nil,append_assoc, + Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons] using h +def gJ : cm→W + | .CD => .UA + | .CF => .UT +theorem Ec (d:cm) (us : List W) (r:ai) : + (DL (cn d us) (wa+>r)) [tm]⊢⁺ (hF .CD (gJ d :: us) r) := by + unfold cn + rw [df] + refine kT (H8 us (bf default ([0]++lX d)) r) ?_ + cases d + · unfold lX gJ hF n9 + simp only [B8,y2,List.append_nil,append_assoc] + exact BV (wa+>(HD us+>r)) + · unfold lX gJ hF n9 + rw [df] + refine sp (HC (bf default [0]) (HD us+>r)) ?_ + simp only [B8,y2,append_assoc] + exact BV (wY+>(wa+>(HD us+>r))) +theorem D2 (d:cm) (us : List W) (r:ai) : + (FL (cn d us) ([0,0,0]+>(wa+>r))) [tm]⊢⁺ (hF .CF (gJ d :: us) r) := by + unfold cn + rw [df] + refine kT (HJ us (bf default ([0]++lX d)) r) ?_ + cases d + · unfold lX gJ hF n9 + simp only [Ct,yL,List.append_nil,append_assoc] + exact Cc (HF us+>r) + · unfold lX gJ hF n9 + rw [df] + refine sp (H0 (bf default [0]) (HF us+>r)) ?_ + simp only [Ct,yL,append_assoc] + exact Cc (wb+>(HF us+>r)) +def A5 (d:cm) (us : List W) (c:aL) : Prop := + ∃ d' r,c = hF d' (gJ d :: us) r +theorem hN (d:cm) (us : List W) (c:aL) + (h : dU (cn d us) c) : cE c (A5 d us) := by + cases h with + | strong_D r => + exact bn (V (Ec d us r)) ⟨.CD,r,rfl⟩ + | strong_F r => + exact bn (V (D2 d us r)) ⟨.CF,r,rfl⟩ +theorem i8 (d:cm) (us : List W) (c:aL) + (hlen : 2 ≤ us.length) (h : A5 d us c) : lr c := by + rcases h with ⟨d',r,rfl⟩ + exact ⟨d',gJ d :: us,r,by simp; omega,rfl⟩ +def Cl : List gQ:=[1,1,1,1,1,1,1,1,1] +def wh : List gQ:=[1,1,1,1,1,1,0,1,0] +theorem CB (l r:ai) : + (FR l ([0]+>(Cl+>r))) [tm]⊢⁺ (FR (bf l (b5 [])) ([0]+>r)) := by + simpa only [b5,hE,append_assoc] using! + U 20 ⟨[],[0]++Cl,F,false⟩ ⟨((wX++[])++wL).reverse,[0],F,false⟩ (by decide) l r +theorem DU (l r:ai) : + (FR l ([0]+>(wh+>r))) [tm]⊢⁺ (FR (bf l (b5 [])) ([0]+>r)) := by + simpa only [b5,hE,append_assoc] using! + U 18 ⟨[],[0]++wh,F,false⟩ ⟨((wX++[])++wL).reverse,[0],F,false⟩ (by decide) l r +theorem yZ (d:cm) (us : List W) (r:ai) (t : List gQ) + (hlen : 2 ≤ us.length) + (ht : ∀ l r,(FR l ([0]+>(t+>r))) [tm]⊢⁺ (FR (bf l (b5 [])) ([0]+>r))) : + cE (hF d us (t+>r)) lr := by + refine cc (ta d us (t+>r)) ?_ + refine cc (ht (cn d us) r) ?_ + refine bh (r7 [] (cn d us) ([0]+>r)) ?_ + intro c hc + refine bh (hN d us c hc) ?_ + intro e he + exact dg (i8 d us e hlen he) +theorem x6 (d:cm) (us : List W) (r:ai) (hlen : 2 ≤ us.length) : + cE (hF d us (Cl+>r)) lr := + yZ d us r Cl hlen CB +theorem y6 (d:cm) (us : List W) (r:ai) (hlen : 2 ≤ us.length) : + cE (hF d us (wh+>r)) lr := + yZ d us r wh hlen DU +theorem xG (r:ai) : + (hF .CF [.UA,.UT] ((wY++wa++wa)+>r)) [tm]⊢⁺ + (FR (bf (cn .CF [.UA,.UT]) (b5 [.P11,.P11])) ([0,0,1,0]+>r)) := by + have h:=kC 57 + ⟨[],[0,0]++n9 .CF [.UA,.UT]++(wY++wa++wa),E⟩ + ⟨([0]++lX .CF++G [.UA,.UT]++b5 [.P11,.P11]).reverse,[0,0,1,0],F⟩ + (by decide) r + simpa only [dw,hF,CE,FR,cn,df,bf,append_assoc] using! h +theorem Ah (r:ai) : + cE (hF .CF [.UA,.UT] ((wY++wa++wa)+>r)) lr := by + refine cc (xG r) ?_ + refine bh (r7 [.P11,.P11] (cn .CF [.UA,.UT]) ([0,0,1,0]+>r)) ?_ + intro c hc + refine bh (hN .CF [.UA,.UT] c hc) ?_ + intro e he + exact dg (i8 .CF [.UA,.UT] e (by decide) he) +inductive bR where + | RD | RF | RB +deriving DecidableEq +def jY (e:bR) (l r:ai) : aL := + match e with + | .RD => DL l r + | .RF => FL l r + | .RB => BL l r +def vM : List (bR × List gQ) := + [(.RD,[]),(.RF,[0,0]),(.RB,[0,0])] +def pM : List (bR × List gQ) := + [(.RD,[1,0,1]),(.RD,[1,1,1,0,1]),(.RD,[1,0,1,0,0]),(.RF,[0,0,0])] +def zU : List (bR × List gQ) := + [(.RD,[1,1,0,1]),(.RD,[0,1,0,0]),(.RF,[0,0]),(.RB,[0,0])] +def xK : List (bR × List gQ):=[(.RD,[]),(.RF,[0,0])] +def Bc : List (bR × List gQ):=[(.RD,[]),(.RB,[0,0])] +def Cm : List (bR × List gQ):=[(.RF,[0,0])] +def ic (l:ai) (es : List (bR × List gQ)) (c:aL) : Prop := + ∃ e p r,(e,p) ∈ es∧c = jY e l (p+>r) +theorem v5 (l:ai) (c:aL) (h : ip l c) : ic l vM c := by + cases h with + | contact_D r => exact ⟨.RD,[],r,by decide,rfl⟩ + | contact_F r => exact ⟨.RF,[0,0],r,by decide,rfl⟩ + | contact_B r => exact ⟨.RB,[0,0],r,by decide,rfl⟩ +theorem Bn (l r:ai) : fl (FR l r) (ic l vM) := + su (pG l r) (fun c h => dg (v5 l c h)) +theorem CL (l:ai) (c:aL) (h : ip (bf l wL) c) : + cE c (ic l pM) := by + cases h with + | contact_D r => + exact bn (V (GP l r)) ⟨.RF,[0,0,0],r,by decide,rfl⟩ + | contact_F r => + exact bn (V (GZ l r)) ⟨.RD,[1,1,1,0,1],r,by decide,rfl⟩ + | contact_B r => + exact bn (V (GN l r)) ⟨.RD,[1,0,1,0,0],r,by decide,rfl⟩ +theorem xU (l r:ai) : fl (FR l ([0,0]+>r)) (ic l pM) := by + rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · have hr : (FR l ([0,0]+>([0]+>r))) [tm]⊢⁺ (DL l ([1,0,1]+>r)) := by + simpa only [← append_assoc] using! r1 l r + exact cr hr (dg ⟨.RD,[1,0,1],r,by decide,rfl⟩) + · have hr : (FR l ([0,0]+>([1]+>r))) [tm]⊢⁺ (FR (bf l wL) r) := by + simpa only [← append_assoc] using! r3 l r + exact cr hr (bh (fv (bf l wL) r) (CL l)) +theorem Bh (l:ai) (c:aL) (h : ip (bf l [1,0]) c) : + cE c (ic l zU) := by + cases h with + | contact_D r => + exact bn (V (xE l r)) ⟨.RB,[0,0],r,by decide,rfl⟩ + | contact_F r => + refine cc (xR l r) ?_ + refine cc (An l ([1,0,1]+>r)) ?_ + exact dg ⟨.RD,[1,1,0,1],r,by decide,by simp [jY,← append_assoc]⟩ + | contact_B r => + exact bn (V (xN l r)) ⟨.RD,[0,1,0,0],r,by decide,rfl⟩ +theorem CP (l r:ai) : fl (FR l ([1]+>r)) (ic l zU) := by + rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · have hr : (FR l ([1]+>([0]+>r))) [tm]⊢⁺ (FR (bf l [1,0]) r) := by + simpa only [← append_assoc] using! u8 l r + exact cr hr (bh (fv (bf l [1,0]) r) (Bh l)) + · have hr : (FR l ([1]+>([1]+>r))) [tm]⊢⁺ (FL l ([0,0]+>r)) := by + simpa only [← append_assoc] using! vn l r + exact cr hr (dg ⟨.RF,[0,0],r,by decide,rfl⟩) +theorem x0 (l:ai) (c:aL) (h : ic l pM c) : + ic l xK c := by + rcases h with ⟨e,p,r,hin,rfl⟩ + simp only [pM,List.mem_cons,List.not_mem_nil,or_false,Prod.mk.injEq] at hin + rcases hin with ⟨rfl,rfl⟩ | ⟨rfl,rfl⟩ | ⟨rfl,rfl⟩ | ⟨rfl,rfl⟩ + · exact ⟨.RD,[],[1,0,1]+>r,by decide,rfl⟩ + · exact ⟨.RD,[],[1,1,1,0,1]+>r,by decide,rfl⟩ + · exact ⟨.RD,[],[1,0,1,0,0]+>r,by decide,rfl⟩ + · exact ⟨.RF,[0,0],[0]+>r,by decide,by simp [jY,← append_assoc]⟩ +theorem xe (l r:ai) : fl (FR l ([0,0]+>r)) (ic l xK) := + su (xU l r) (fun c h => dg (x0 l c h)) +theorem wW (l r:ai) : fl (FR l ([1,0]+>r)) (ic l Bc) := by + refine cr (u8 l r) ?_ + refine bh (fv (bf l [1,0]) r) ?_ + intro c h + cases h with + | contact_D r0 => + exact bn (V (xE l r0)) ⟨.RB,[0,0],r0,by decide,rfl⟩ + | contact_F r0 => + refine cc (xR l r0) ?_ + exact bn (V (An l ([1,0,1]+>r0))) + ⟨.RD,[],[1,1,0,1]+>r0,by decide,by simp [jY,← append_assoc]⟩ + | contact_B r0 => + exact bn (V (xN l r0)) + ⟨.RD,[],[0,1,0,0]+>r0,by decide,rfl⟩ +theorem wo (l r:ai) : fl (FR l ([1,1]+>r)) (ic l Cm) := + cr (vn l r) (dg ⟨.RF,[0,0],r,by decide,rfl⟩) +inductive ax where + | qA | qB | qC | qD | qE | qF +deriving DecidableEq +def x8 (b:Bool) : gQ:=if b then 1 else 0 +def be (bs : List Bool) : List gQ:=bs.map x8 +@[simp] theorem yW : be [] = []:=rfl +@[simp] theorem m7 (b:Bool) (bs : List Bool) : be (b :: bs) = x8 b :: be bs:=rfl +@[simp] theorem jF (xs ys : List Bool) : be (xs++ys) = be xs++be ys := by simp [be] +@[simp] theorem sM (xs : List Bool) : be xs.reverse = (be xs).reverse := by simp [be] +def BB : ax→Fin 6 + | .qA => A | .qB => B | .qC => C | .qD => D | .qE => E | .qF => F +structure R where + past : List Bool + front : List Bool + state : ax +deriving DecidableEq +def sy (x:R) : f3 := + ⟨be x.past,be x.front,BB x.state⟩ +def dC (x:R) (r:ai) : aL:=dw (sy x) r +def vX (x:R) : Option R := + match x.front with + | [] => none + | false :: bs => + match x.state with + | .qA => some ⟨true :: x.past,bs,.qB⟩ + | .qB => + match x.past with + | [] => some ⟨[],false :: true :: bs,.qC⟩ + | a :: ls => some ⟨ls,a :: true :: bs,.qC⟩ + | .qC => none + | .qD => + match x.past with + | [] => some ⟨[],false :: false :: bs,.qE⟩ + | a :: ls => some ⟨ls,a :: false :: bs,.qE⟩ + | .qE => some ⟨false :: x.past,bs,.qF⟩ + | .qF => some ⟨true :: x.past,bs,.qA⟩ + | true :: bs => + match x.state with + | .qA => some ⟨true :: x.past,bs,.qF⟩ + | .qB => + match x.past with + | [] => some ⟨[],false :: false :: bs,.qF⟩ + | a :: ls => some ⟨ls,a :: false :: bs,.qF⟩ + | .qC => + match x.past with + | [] => some ⟨[],false :: false :: bs,.qD⟩ + | a :: ls => some ⟨ls,a :: false :: bs,.qD⟩ + | .qD => + match x.past with + | [] => some ⟨[],false :: true :: bs,.qD⟩ + | a :: ls => some ⟨ls,a :: true :: bs,.qD⟩ + | .qE => + match x.past with + | [] => some ⟨[],false :: false :: bs,.qB⟩ + | a :: ls => some ⟨ls,a :: false :: bs,.qB⟩ + | .qF => some ⟨true :: x.past,bs,.qE⟩ +def AN (q:ax) (ih : List Bool→List Bool→ax→Option R) (bs : List Bool) : Option R := + ih [] (false :: true :: bs) q +def zA (a:Bool) (ls : List Bool) (_ : ax→(List Bool→List Bool→ax→Option R)→List Bool→Option R) + (q:ax) (ih : List Bool→List Bool→ax→Option R) (bs : List Bool) : Option R := + ih ls (a :: true :: bs) q +noncomputable def sS (q:ax) (ih : List Bool→List Bool→ax→Option R) (past bs : List Bool) : Option R := + List.rec (motive:=fun _ => ax→(List Bool→List Bool→ax→Option R)→List Bool→Option R) + AN + zA + past q ih bs +def Ac (q:ax) (ih : List Bool→List Bool→ax→Option R) (bs : List Bool) : Option R := + ih [] (false :: false :: bs) q +def ya (a:Bool) (ls : List Bool) (_ : ax→(List Bool→List Bool→ax→Option R)→List Bool→Option R) + (q:ax) (ih : List Bool→List Bool→ax→Option R) (bs : List Bool) : Option R := + ih ls (a :: false :: bs) q +noncomputable def ln (q:ax) (ih : List Bool→List Bool→ax→Option R) (past bs : List Bool) : Option R := + List.rec (motive:=fun _ => ax→(List Bool→List Bool→ax→Option R)→List Bool→Option R) + Ac + ya + past q ih bs +def ll (q:ax) (ih : List Bool→List Bool→ax→Option R) (past bs : List Bool) : Option R := + ih (true :: past) bs q +def xz (q:ax) (ih : List Bool→List Bool→ax→Option R) (past bs : List Bool) : Option R := + ih (false :: past) bs q +def CH (_ : List Bool→List Bool→ax→Option R) (_ _ : List Bool) : Option R := + none +noncomputable def xq (state:ax) : (List Bool→List Bool→ax→Option R)→List Bool→List Bool→Option R := + ax.rec (motive:=fun _ => (List Bool→List Bool→ax→Option R)→List Bool→List Bool→Option R) + (ll .qB) + (sS .qC) + CH + (ln .qE) + (xz .qF) + (ll .qA) + state +noncomputable def xH (state:ax) : (List Bool→List Bool→ax→Option R)→List Bool→List Bool→Option R := + ax.rec (motive:=fun _ => (List Bool→List Bool→ax→Option R)→List Bool→List Bool→Option R) + (ll .qF) + (ln .qF) + (ln .qD) + (sS .qD) + (ln .qB) + (ll .qE) + state +noncomputable def B2 (b:Bool) : ax→(List Bool→List Bool→ax→Option R)→List Bool→List Bool→Option R := + Bool.rec (motive:=fun _ => ax→(List Bool→List Bool→ax→Option R)→List Bool→List Bool→Option R) + xq + xH + b +noncomputable def Am (b:Bool) (bs : List Bool) + (_ : ax→(List Bool→List Bool→ax→Option R)→List Bool→Option R) + (state:ax) (ih : List Bool→List Bool→ax→Option R) (past : List Bool) : Option R := + B2 b state ih past bs +def AT (_:ax) (_ : List Bool→List Bool→ax→Option R) (_ : List Bool) : Option R := + none +noncomputable def lN (ih : List Bool→List Bool→ax→Option R) + (past front : List Bool) (state:ax) : Option R := + List.rec (motive:=fun _ => ax→(List Bool→List Bool→ax→Option R)→List Bool→Option R) + AT + Am + front state ih past +def Ab (past front : List Bool) (state:ax) : Option R := + some ⟨past,front,state⟩ +noncomputable def zN (_:Nat) (ih : List Bool→List Bool→ax→Option R) : List Bool→List Bool→ax→Option R := + lN ih +noncomputable def l7 (n:Nat) : List Bool→List Bool→ax→Option R := + Nat.rec (motive:=fun _ => List Bool→List Bool→ax→Option R) + Ab + zN + n +noncomputable def xC (n:Nat) (x:R) : Option R := + R.rec (motive:=fun _ => Option R) (l7 n) x +noncomputable def Ag (n:Nat) (x:R) : Option R := + R.rec (motive:=fun _ => Option R) (lN (l7 n)) x +theorem y8 (x:R) : (vX x).map sy = mr (sy x) := by + rcases x with ⟨_ | ⟨a,ls⟩,_ | ⟨_ | _,bs⟩,_ | _ | _ | _ | _ | _⟩ <;> rfl +theorem wq (ih : List Bool→List Bool→ax→Option R) + (past front : List Bool) (state:ax) : + lN ih past front state = + match vX ⟨past,front,state⟩ with + | none => none + | some y => ih y.past y.front y.state := by + rcases past with _ | ⟨a,ls⟩ <;> rcases front with _ | ⟨_ | _,bs⟩ <;> cases state <;> rfl +theorem vJ (n:Nat) (past front : List Bool) (state:ax) : + (l7 n past front state).map sy = AD n (sy ⟨past,front,state⟩) := by + induction n generalizing past front state with + | zero => rfl + | succ n ih => + change (lN (l7 n) past front state).map sy = AD (n + 1) (sy ⟨past,front,state⟩) + rw [wq] + unfold AD + rw [← y8 ⟨past,front,state⟩] + rcases vX ⟨past,front,state⟩ with _ | ⟨p',f',s'⟩ <;> simp [ih] +theorem AP (n:Nat) (x:R) : (xC n x).map sy = AD n (sy x) := + vJ n x.past x.front x.state +def Cz : ax→ax→Bool + | .qA,.qA | .qB,.qB | .qC,.qC | .qD,.qD | .qE,.qE | .qF,.qF => true + | _,_ => false +theorem zQ (x y:ax) : Cz x y = true↔x = y := by + cases x <;> cases y <;> decide +def sw (_:Bool) (_ : List Bool) (_:Bool) : Bool:=false +noncomputable def zK (ys : List Bool) : Bool := + List.rec (motive:=fun _ => Bool) true sw ys +noncomputable def zC (b:Bool) (ih : List Bool→Bool) (bs : List Bool) : Bool := + Bool.rec (motive:=fun _ => Bool) (ih bs) false b +noncomputable def yX (b:Bool) (ih : List Bool→Bool) (bs : List Bool) : Bool := + Bool.rec (motive:=fun _ => Bool) false (ih bs) b +noncomputable def ri (b:Bool) (bs : List Bool) (_ : (List Bool→Bool)→Bool→Bool) + (ih : List Bool→Bool) (a:Bool) : Bool := + Bool.rec (motive:=fun _ => Bool→(List Bool→Bool)→List Bool→Bool) zC yX a b ih bs +def sl (_ : List Bool→Bool) (_:Bool) : Bool:=false +noncomputable def pr (a:Bool) (_ : List Bool) (ih : List Bool→Bool) (ys : List Bool) : Bool := + List.rec (motive:=fun _ => (List Bool→Bool)→Bool→Bool) + sl + ri + ys ih a +noncomputable def lp (xs ys : List Bool) : Bool := + List.rec (motive:=fun _ => List Bool→Bool) + zK + pr + xs ys +theorem oE (xs ys : List Bool) : lp xs ys = true↔xs = ys := by + induction xs generalizing ys with + | nil => + cases ys <;> simp [lp,zK,sw] + | cons a as ih => + cases ys with + | nil => simp [lp,pr,sl] + | cons b bs => + change pr a as (lp as) (b :: bs) = true↔a :: as = b :: bs + cases a <;> cases b <;> simp [pr,ri,zC,yX,ih] +def mz (b:Bool) (_ : List Bool) (ih : List Bool) : List Bool := + match ih with + | [] => if b then [true] else [] + | ys => b :: ys +noncomputable def mO (ls : List Bool) : List Bool := + List.rec (motive:=fun _ => List Bool) [] mz ls +theorem so (ls : List Bool) : be (mO ls) = r2 (be ls) := by + induction ls with + | nil => rfl + | cons b ls ih => + change be (mz b ls (mO ls)) = r2 (x8 b :: be ls) + unfold mz r2 + rw [← ih] + rcases mO ls with _ | ⟨y,ys⟩ <;> cases b <;> rfl +noncomputable def mn (xp xf : List Bool) (xs:ax) (yp yf : List Bool) (ys:ax) : Bool := + Cz xs ys&&lp xf yf&&(lp xp yp||lp (mO xp) (mO yp)) +noncomputable def xk (y:R) (xp xf : List Bool) (xs:ax) : Bool := + R.rec (motive:=fun _ => Bool) (mn xp xf xs) y +noncomputable def tQ (x y:R) : Bool := + R.rec (motive:=fun _ => Bool) (xk y) x +theorem wm {x y : R} (h : tQ x y = true) (r:ai) : + dC x r = dC y r := by + rcases x with ⟨xp,xf,xs⟩ + rcases y with ⟨yp,yf,ys⟩ + change mn xp xf xs yp yf ys = true at h + unfold mn at h + simp only [Bool.and_eq_true,Bool.or_eq_true,zQ,oE] at h + rcases h with ⟨⟨hs,hf⟩,hp | hp⟩ + · apply kE _ r + unfold kR sy + dsimp only + rw [hp,hf,hs] + simp + · apply kE _ r + unfold kR sy + dsimp only + rw [← so xp,← so yp,hp,hf,hs] + simp +def A6 (_:R) : Bool:=false +noncomputable def A2 (z y:R) : Bool:=tQ z y +noncomputable def og (n:Nat) (x y:R) : Bool := + Option.rec (motive:=fun _ => R→Bool) A6 A2 (xC n x) y +noncomputable def eO (n:Nat) (x y:R) : Bool := + Option.rec (motive:=fun _ => R→Bool) A6 A2 (Ag n x) y +theorem gi (n:Nat) (x y:R) + (h : og (n + 1) x y = true) (r:ai) : + (dC x r) [tm]⊢⁺ (dC y r) := by + unfold og at h + rcases hr : xC (n + 1) x with _ | z + · rw [hr] at h; contradiction + · rw [hr] at h + change tQ z y = true at h + rw [← wm h r] + have hrun : AD (n + 1) (sy x) = some (sy z) := by + rw [← AP (n + 1) x,hr]; rfl + exact vD hrun r +def bL : List Bool:=[true,true,false] +def bX : List Bool:=[true,true,false,true,true,false] +def bY : List Bool:=[true,true,true,true] +def ba : List Bool:=[true,true,true,false,true,false] +def bb : List Bool:=[true,false,true,false] +def EH : List Bool:=[true,true,true,true,true,true,true,true,true] +def B0 : List Bool:=[true,true,true,true,true,true,false,true,false] +def F8 : W→List Bool + | .UA => ba + | .UT => bY++ba +def F9 : W→List Bool + | .UA => ba + | .UT => ba++bb +def Ho : W→List Bool + | .UA => bX + | .UT => bX++bY +def FC : List W→List Bool + | [] => [] + | u :: us => F8 u++FC us +def F2 : List W→List Bool + | [] => [] + | u :: us => F9 u++F2 us +def bG : List W→List Bool + | [] => [] + | u :: us => Ho u++bG us +def bW : cm→List Bool + | .CD => [] + | .CF => bY +def xP (d:cm) (us : List W) : List Bool := + match d with + | .CD => FC us + | .CF => bb++F2 us +def wc : b9→List Bool + | .PL => bL + | .P11 => [true,true] +def mI : List b9→List Bool + | [] => [] + | p :: ps => wc p++mI ps +def rS (ps : List b9) : List Bool := + (bX++mI ps)++bL +def Do (b:Bool) : List Bool := + if b then [true,false] else [true] +def nT : List Bool→List Bool + | [] => [] + | b :: s => nT s++Do b +@[simp] theorem GF : be bL = wL:=rfl +@[simp] theorem GI : be bX = wX:=rfl +@[simp] theorem DP : be bY = wY:=rfl +@[simp] theorem Bb : be ba = wa:=rfl +@[simp] theorem GH : be bb = wb:=rfl +@[simp] theorem Bl : be EH = Cl:=rfl +@[simp] theorem zW : be B0 = wh:=rfl +@[simp] theorem Gt (us : List W) : be (FC us) = HD us := by + induction us with + | nil => rfl + | cons u us ih => cases u <;> simp [FC,HD,F8,y2,← ih] +@[simp] theorem Gm (us : List W) : be (F2 us) = HF us := by + induction us with + | nil => rfl + | cons u us ih => cases u <;> simp [F2,HF,F9,yL,← ih] +@[simp] theorem GG (us : List W) : be (bG us) = G us := by + induction us with + | nil => rfl + | cons u us ih => cases u <;> simp [bG,G,Ho,G1,← ih] +@[simp] theorem Fr (d:cm) : be (bW d) = lX d := by + cases d <;> rfl +@[simp] theorem nZ (d:cm) (us : List W) : be (xP d us) = n9 d us := by + cases d <;> simp [xP,n9] +@[simp] theorem Cw (ps : List b9) : be (mI ps) = hE ps := by + induction ps with + | nil => rfl + | cons p ps ih => cases p <;> simp [mI,hE,wc,xS,x8,← ih] +@[simp] theorem vW (ps : List b9) : be (rS ps) = b5 ps := by + simp [rS,b5] +def lw : List Bool→List gQ + | [] => [] + | b :: s => lw s++sd b +theorem xM (l:ai) (s : List Bool) : + bJ l s = bf l (lw s) := by + induction s with + | nil => rfl + | cons b s ih => + unfold bJ lw + rw [ih,df] +theorem xJ (base : List gQ) (ps : List b9) (s : List Bool) (r:ai) : + cE (FR (bf default ((base++b5 ps)++lw s)) r) + (dU (bf default base)) := by + rw [df,df,← xM] + exact bh (jC (bf (bf default base) (b5 ps)) s .GoRight r) + (lI ps (bf default base)) +@[simp] theorem vV (s : List Bool) : be (nT s) = lw s := by + induction s with + | nil => rfl + | cons b s ih => cases b <;> simp [nT,lw,Do,sd,x8,← ih] +def pC (q w : List Bool) : R:=⟨q.reverse,w,.qF⟩ +def hG (q : List Bool) (s:ax) (w : List Bool) : R := + match q.reverse with + | [] => ⟨[],false :: w,s⟩ + | a :: ls => ⟨ls,a :: w,s⟩ +def jJ (qr w : List Bool) : R:=⟨qr,w,.qF⟩ +def gh (qr : List Bool) (s:ax) (w : List Bool) : R := + match qr with + | [] => ⟨[],false :: w,s⟩ + | a :: ls => ⟨ls,a :: w,s⟩ +def xB (w : List Bool) : R:=⟨[],false :: false :: w,.qE⟩ +theorem zG (q w : List Bool) (r:ai) : + dC (pC q w) r = FR (bf default (be q)) (be w+>r) := by + unfold dC pC sy dw FR bf + simp [BB] +theorem pE (q : List Bool) (s:ax) (w : List Bool) (r:ai) : + dC (hG q s w) r = ((bf default (be q)) <{{BB s}} (be w+>r)) := by + unfold dC hG sy bf dw + dsimp only + rw [← sM] + rcases q.reverse with _ | ⟨a,ls⟩ <;> + simp only [yW,m7,x8,Bool.false_eq_true,↓reduceIte, + append_cons,append_nil,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,kX,k5] +theorem vP (qr w : List Bool) (r:ai) : + dC (jJ qr w) r = FR (bf default (be qr.reverse)) (be w+>r) := by + unfold dC jJ sy dw FR bf + simp [BB] +theorem w1 (qr : List Bool) (s:ax) (w : List Bool) (r:ai) : + dC (gh qr s w) r = ((bf default (be qr.reverse)) <{{BB s}} (be w+>r)) := by + unfold dC gh sy bf dw + dsimp only + rw [← sM,List.reverse_reverse] + rcases qr with _ | ⟨a,ls⟩ <;> + simp only [yW,m7,x8,Bool.false_eq_true,↓reduceIte, + append_cons,append_nil,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,kX,k5] +theorem C1 (w : List Bool) (r:ai) : + dC (xB w) r = CE (be w+>r):=rfl +inductive fZ where + | Recovered (d:cm) (us : List W) (tail : List Bool) + | NineGain (d:cm) (us : List W) (tail : List Bool) + | SixGain (d:cm) (us : List W) (tail : List Bool) + | YaaGain (tail : List Bool) +deriving DecidableEq +def j6 : fZ→List Bool + | .Recovered d us tail => xP d us++tail + | .NineGain d us tail => xP d us++EH++tail + | .SixGain d us tail => xP d us++B0++tail + | .YaaGain tail => xP .CF [.UA,.UT]++bY++ba++ba++tail +def f0 (t:fZ) : R:=xB (j6 t) +def jj : fZ→Bool + | .Recovered _ us _ => decide (3 ≤ us.length) + | .NineGain _ us _ => decide (2 ≤ us.length) + | .SixGain _ us _ => decide (2 ≤ us.length) + | .YaaGain _ => true +theorem nO (t:fZ) (h : jj t = true) (r:ai) : + cE (dC (f0 t) r) lr := by + unfold f0 + rw [C1] + cases t with + | Recovered d us tail => + have hlen : 3 ≤ us.length:=of_decide_eq_true h + unfold j6 + simp only [jF,nZ,append_assoc] + exact dg ⟨d,us,be tail+>r,hlen,rfl⟩ + | NineGain d us tail => + have hlen : 2 ≤ us.length:=of_decide_eq_true h + unfold j6 + simp only [jF,nZ,Bl,append_assoc] + exact x6 d us (be tail+>r) hlen + | SixGain d us tail => + have hlen : 2 ≤ us.length:=of_decide_eq_true h + unfold j6 + simp only [jF,nZ,zW,append_assoc] + exact y6 d us (be tail+>r) hlen + | YaaGain tail => + unfold j6 + simp only [jF,nZ,DP,Bb] + have heq : (n9 .CF [.UA,.UT]++wY++wa++wa++be tail)+>r = + n9 .CF [.UA,.UT]+>((wY++wa++wa)+>(be tail+>r)) := by + simp only [append_assoc] + rw [heq] + exact Ah (be tail+>r) +structure mB where + guard_base : List Bool + guard_pieces : List b9 + guard_stack : List Bool + guard_D_steps : Nat + guard_D_terminal : fZ + guard_F_steps : Nat + guard_F_terminal : fZ +deriving DecidableEq +def ur (g:mB) : List Bool := + (g.guard_base++rS g.guard_pieces)++nT g.guard_stack +noncomputable def nU (g:mB) : Bool := + jj g.guard_D_terminal && + jj g.guard_F_terminal && + eO g.guard_D_steps (hG g.guard_base .qD ba) (f0 g.guard_D_terminal) && + eO g.guard_F_steps (hG g.guard_base .qF ([false,false,false]++ba)) (f0 g.guard_F_terminal) +theorem Bm (g:mB) (h : nU g = true) (r:ai) : + cE (FR (bf default (be (ur g))) r) lr := by + unfold nU at h + simp only [Bool.and_eq_true] at h + rcases h with ⟨⟨⟨hd,hf⟩,nd⟩,nf⟩ + unfold ur + simp only [jF,vW,vV] + refine bh (xJ (be g.guard_base) g.guard_pieces g.guard_stack r) ?_ + intro c hc + cases hc with + | strong_D r0 => + have hnat:=gi g.guard_D_steps (hG g.guard_base .qD ba) (f0 g.guard_D_terminal) nd r0 + rw [pE] at hnat + dsimp only [BB,Bb] at hnat + exact cc hnat (nO g.guard_D_terminal hd r0) + | strong_F r0 => + have hnat:=gi g.guard_F_steps (hG g.guard_base .qF ([false,false,false]++ba)) (f0 g.guard_F_terminal) nf r0 + rw [pE] at hnat + have h000 : be ([false,false,false]++ba)+>r0 = [0,0,0]+>(wa+>r0) := by + simp [append_assoc,x8] + dsimp only [BB] at hnat + rw [h000] at hnat + exact cc hnat (nO g.guard_F_terminal hf r0) +inductive k1 where + | AllCases | Cases00 | Cases1 | Coarse00 | Coarse10 | Coarse11 +deriving DecidableEq +def iW : k1→List (bR × List gQ) + | .AllCases => vM + | .Cases00 => pM + | .Cases1 => zU + | .Coarse00 => xK + | .Coarse10 => Bc + | .Coarse11 => Cm +def sn : k1→List (bR × List Bool) + | .AllCases => [(.RD,[]),(.RF,[false,false]),(.RB,[false,false])] + | .Cases00 => [(.RD,[true,false,true]),(.RD,[true,true,true,false,true]),(.RD,[true,false,true,false,false]),(.RF,[false,false,false])] + | .Cases1 => [(.RD,[true,true,false,true]),(.RD,[false,true,false,false]),(.RF,[false,false]),(.RB,[false,false])] + | .Coarse00 => [(.RD,[]),(.RF,[false,false])] + | .Coarse10 => [(.RD,[]),(.RB,[false,false])] + | .Coarse11 => [(.RF,[false,false])] +theorem vC (s:k1) : + (sn s).map (fun e => (e.1,be e.2)) = iW s := by + cases s <;> rfl +noncomputable def kq (s:k1) (w : List Bool) : Bool := + match s with + | .AllCases => true + | .Cases00 => lp w [false,false] + | .Cases1 => lp w [true] + | .Coarse00 => lp (w.take 2) [false,false] + | .Coarse10 => lp (w.take 2) [true,false] + | .Coarse11 => lp (w.take 2) [true,true] +theorem zc (s:k1) (w : List Bool) (h : kq s w = true) (l r:ai) : + fl (FR l (be w+>r)) (ic l (iW s)) := by + cases s with + | AllCases => exact Bn l (be w+>r) + | Cases00 => + unfold kq at h; rw [oE] at h; subst h + exact xU l r + | Cases1 => + unfold kq at h; rw [oE] at h; subst h + exact CP l r + | Coarse00 => + rcases w with _ | ⟨_ | _,_ | ⟨_ | _,w'⟩⟩ <;> try contradiction + simpa only [iW,m7,x8,Bool.false_eq_true,↓reduceIte,← append_assoc] using! xe l (be w'+>r) + | Coarse10 => + rcases w with _ | ⟨_ | _,_ | ⟨_ | _,w'⟩⟩ <;> try contradiction + simpa only [iW,m7,x8,Bool.false_eq_true,↓reduceIte,← append_assoc] using! wW l (be w'+>r) + | Coarse11 => + rcases w with _ | ⟨_ | _,_ | ⟨_ | _,w'⟩⟩ <;> try contradiction + simpa only [iW,m7,x8,Bool.false_eq_true,↓reduceIte,← append_assoc] using! wo l (be w'+>r) +def ny : bR→ax + | .RD => .qD + | .RF => .qF + | .RB => .qB +def Gs : bR→Fin 6 + | .RD => D + | .RF => F + | .RB => B +@[simp] theorem x5 (s:bR) : BB (ny s) = Gs s := by + cases s <;> rfl +inductive Pos where + | Z : Pos + | O : Pos→Pos + | E : Pos→Pos +deriving DecidableEq +def Fc : bR→bR→Bool + | .RD,.RD | .RF,.RF | .RB,.RB => true + | _,_ => false +theorem CC (x y:bR) : Fc x y = true↔x = y := by + cases x <;> cases y <;> decide +structure px where + state : bR + pref : List Bool + steps : Nat + target : Pos + prep : List Bool +deriving DecidableEq +noncomputable def ss (e : bR × List Bool) (b:px) : Bool := + Fc e.1 b.state&&lp e.2 b.pref +noncomputable def yh (s:k1) (bs : List px) : Bool := + (sn s).all (fun e => bs.any (ss e)) +theorem x9 (s:k1) (bs : List px) (e : bR × List gQ) + (hc : yh s bs = true) (hin : e ∈ iW s) : + ∃ b ∈ bs,e.1 = b.state∧e.2 = be b.pref := by + rw [← vC s,List.mem_map] at hin + rcases hin with ⟨⟨st,p⟩,hp,rfl⟩ + unfold yh at hc + have h1:=List.all_eq_true.mp hc (st,p) hp + rcases List.any_eq_true.mp h1 with ⟨b,hb,hm⟩ + unfold ss at hm + simp only [Bool.and_eq_true,CC,oE] at hm + exact ⟨b,hb,hm.1,by rw [hm.2]⟩ +inductive dp where + | rEnd (t:fZ) + | rProt (gc:mB) (w : List Bool) + | rNat (fin:R) (steps:Nat) (target:Pos) (prep : List Bool) + | rRet (qr w : List Bool) (s:k1) (bs : List px) +def FV (t:fZ) : R:=f0 t +def Cu (gc:mB) (w : List Bool) : R:=pC (ur gc) w +def FT (fin:R) (_:Nat) (_:Pos) (_ : List Bool) : R:=fin +def Dz (qr w : List Bool) (_:k1) (_ : List px) : R:=jJ qr w +noncomputable def fw (r:dp) : R := + dp.rec (motive:=fun _ => R) FV Cu FT Dz r +def D4 (p : List Bool) (xp xf : List Bool) (xs:ax) : R := + ⟨xp,xf++p,xs⟩ +noncomputable def jE (p : List Bool) (x:R) : R := + R.rec (motive:=fun _ => R) (D4 p) x +theorem nQ (p : List Bool) (x:R) (r:ai) : + dC (jE p x) r = dC x (be p+>r) := by + rcases x with ⟨xp,xf,xs⟩ + change dC ⟨xp,xf++p,xs⟩ r = dC ⟨xp,xf,xs⟩ (be p+>r) + unfold dC dw sy + simp only [jF,append_assoc] +inductive ab (α : Type) where + | empty : ab α + | node : Option α→ab α→ab α→ab α +def za (v : Option α) (_ _ : ab α) (_ _ : Option α) : Option α:=v +noncomputable def B6 (t : ab α) : Option α := + ab.rec (motive:=fun _ => Option α) none za t +def vE (_ : ab α→Option α) : Option α:=none +def zk (_ : Option α) (l _ : ab α) (_ _ : (ab α→Option α)→Option α) (ih : ab α→Option α) : Option α:=ih l +def AE (_ : Option α) (_ r : ab α) (_ _ : (ab α→Option α)→Option α) (ih : ab α→Option α) : Option α:=ih r +noncomputable def BJ (_:Pos) (ih : ab α→Option α) (t : ab α) : Option α := + ab.rec (motive:=fun _ => (ab α→Option α)→Option α) vE zk t ih +noncomputable def BZ (_:Pos) (ih : ab α→Option α) (t : ab α) : Option α := + ab.rec (motive:=fun _ => (ab α→Option α)→Option α) vE AE t ih +noncomputable def ig (t : ab α) (p:Pos) : Option α := + Pos.rec (motive:=fun _ => ab α→Option α) + B6 + BJ + BZ + p t +def n6 (_ : α→Bool) (ihl ihr:Bool) : Bool:=ihl&&ihr +def oz (x : α) (p : α→Bool) (ihl ihr:Bool) : Bool:=p x&&ihl&&ihr +noncomputable def me (p : α→Bool) (v : Option α) (_ _ : ab α) (ihl ihr:Bool) : Bool := + Option.rec (motive:=fun _ => (α→Bool)→Bool→Bool→Bool) + n6 + oz + v p ihl ihr +noncomputable def ay (p : α→Bool) (t : ab α) : Bool := + ab.rec (motive:=fun _ => Bool) true (me p) t +theorem AR {p : α→Bool} {t : ab α} {i : Pos} {x : α} + (hall : ay p t = true) (hget : ig t i = some x) : p x = true := by + induction i generalizing t with + | Z => + cases t with + | empty => contradiction + | node v l r => + change v = some x at hget + subst hget + change (p x&&ay p l&&ay p r) = true at hall + simp only [Bool.and_eq_true] at hall + exact hall.1.1 + | O i ih => + cases t with + | empty => contradiction + | node v l r => + change ig l i = some x at hget + change me p v l r (ay p l) (ay p r) = true at hall + have hl : ay p l = true := by + cases v <;> simp only [me,n6,oz,Bool.and_eq_true] at hall <;> tauto + exact ih hl hget + | E i ih => + cases t with + | empty => contradiction + | node v l r => + change ig r i = some x at hget + change me p v l r (ay p l) (ay p r) = true at hall + have hr : ay p r = true := by + cases v <;> simp only [me,n6,oz,Bool.and_eq_true] at hall <;> tauto + exact ih hr hget +def vH (_:Nat) (_:R) (_ : List Bool) : Bool:=false +noncomputable def vT (y:dp) (steps:Nat) (fin:R) (prep : List Bool) : Bool := + eO steps fin (jE prep (fw y)) +noncomputable def mN (opt_y : Option dp) (steps:Nat) (fin:R) (prep : List Bool) : Bool := + Option.rec (motive:=fun _ => Nat→R→List Bool→Bool) + vH + vT + opt_y steps fin prep +noncomputable def D6 (g : ab dp) (qr : List Bool) + (state:bR) (pref : List Bool) (steps:Nat) (target:Pos) (prep : List Bool) : Bool := + mN (ig g target) steps (gh qr (ny state) pref) prep +noncomputable def pB (g : ab dp) (qr : List Bool) (b:px) : Bool := + px.rec (motive:=fun _ => Bool) (D6 g qr) b +def F0 (t:fZ) (_ : ab dp) : Bool:=jj t +noncomputable def Ex (gc:mB) (_ : List Bool) (_ : ab dp) : Bool:=nU gc +noncomputable def FD (fin:R) (steps:Nat) (target:Pos) (prep : List Bool) (g : ab dp) : Bool := + mN (ig g target) steps fin prep +noncomputable def FH (qr w : List Bool) (s:k1) (bs : List px) (g : ab dp) : Bool := + kq s w&&yh s bs&&bs.all (pB g qr) +noncomputable def sf (g : ab dp) (r:dp) : Bool := + dp.rec (motive:=fun _ => ab dp→Bool) + F0 Ex FD FH r g +theorem Be (g : ab dp) (hg : ay (sf g) g = true) : + ∀ (i:Pos) (x:dp),ig g i = some x→∀ r,cE (dC (fw x) r) lr := by + intro i x hx r n hn + induction n using Nat.strong_induction_on generalizing i x r with + | h n ih => + have hchk : sf g x = true:=AR hg hx + cases x with + | rEnd t => + change jj t = true at hchk + exact nO t hchk r n hn + | rProt gc w => + change nU gc = true at hchk + unfold fw Cu at hn + rw [zG] at hn + exact Bm gc hchk (be w+>r) n hn + | rNat fin steps target prep => + change mN (ig g target) steps fin prep = true at hchk + rcases hy : ig g target with _ | y + · rw [hy] at hchk; contradiction + · rw [hy] at hchk + change eO steps fin (jE prep (fw y)) = true at hchk + have hp:=gi steps fin (jE prep (fw y)) hchk r + rw [nQ] at hp + rcases kz hp hn with ⟨m,hmn,hm⟩ + rcases ih m hmn target y hy (be prep+>r) hm with ⟨k,d,hkm,hsafe,hk⟩ + exact ⟨k,d,by omega,hsafe,hk⟩ + | rRet qr w s bs => + change (kq s w&&yh s bs&&bs.all (pB g qr)) = true at hchk + simp only [Bool.and_eq_true] at hchk + rcases hchk with ⟨⟨hs,hc⟩,hbs⟩ + unfold fw Dz at hn + rw [vP] at hn + rcases zc s w hs (bf default (be qr.reverse)) r n hn with ⟨m,c,hmn,hret,hm⟩ + rcases hret with ⟨e,p,r',hin,rfl⟩ + rcases x9 s bs (e,p) hc hin with ⟨b,hb,he,hp⟩ + dsimp only at he hp; subst he hp + have hbv : pB g qr b = true:=List.all_eq_true.mp hbs b hb + rcases b with ⟨b_state,b_pref,b_steps,b_target,b_prep⟩ + change mN (ig g b_target) b_steps (gh qr (ny b_state) b_pref) b_prep = true at hbv + rcases hy : ig g b_target with _ | y + · rw [hy] at hbv; contradiction + · rw [hy] at hbv + change eO b_steps (gh qr (ny b_state) b_pref) (jE b_prep (fw y)) = true at hbv + have hnat:=gi b_steps (gh qr (ny b_state) b_pref) (jE b_prep (fw y)) hbv r' + rw [w1,x5,nQ] at hnat + have hret_step : (jY b_state (bf default (be qr.reverse)) (be b_pref+>r')) [tm]⊢⁺ (dC (fw y) (be b_prep+>r')) := by + revert hnat; cases b_state <;> intro hnat <;> exact hnat + rcases kz hret_step hm with ⟨a,ham,ha⟩ + rcases ih a (by omega) b_target y hy (be b_prep+>r') ha with ⟨z,d,hza,hsafe,hz⟩ + exact ⟨z,d,by omega,hsafe,hz⟩ +def j9 : W→List b9 + | .UA => [.PL] + | .UT => [.P11,.P11,.PL] +theorem Go (u:W) : G1 u++wX = b5 (j9 u) := by + cases u <;> rfl +theorem CU (u:W) : G [u,.UA] = b5 (j9 u) := by + cases u <;> rfl +theorem CW (u:W) : G [u,.UT] = b5 (j9 u)++wY := by + cases u <;> rfl +theorem AX (u v:W) (l:ai) (c:aL) + (h : ip (bf l (G [u,v])) c) : cE c (dU l) := by + cases v + · rw [CU] at h + exact lI (j9 u) l c h + · rw [CW,df] at h + have hstack (e:Bs) (r0:ai) : + cE (aq (bf l (b5 (j9 u))) [false,false,false,false] e r0) (dU l) := + bh (jC (bf l (b5 (j9 u))) [false,false,false,false] e r0) + (lI (j9 u) l) + cases h with + | contact_D r0 => exact hstack .FromD r0 + | contact_F r0 => exact hstack .FromF r0 + | contact_B r0 => exact hstack .FromB r0 +theorem xW (d:cm) (us vs : List W) : + cn d (us++vs) = bf (cn d us) (G vs) := by + unfold cn + rw [Gk,← List.append_assoc,df] +theorem Bi (d:cm) (us : List W) (u:W) : + cn d (us++[u]) = bf (cn d us) (G1 u) := by + rw [xW] + simp [G] +theorem B7 (d:cm) (a b c e:W) (r:ai) : + fl (hF d [a,b,c,e] r) lr := by + refine cr (ta d [a,b,c,e] r) ?_ + have hf : cn d [a,b,c,e] = bf (cn d [a,b]) (G [c,e]) := + xW d [a,b] [c,e] + rw [hf] + refine bh (fv (bf (cn d [a,b]) (G [c,e])) ([0]+>r)) ?_ + intro x hx + refine bh (AX c e (cn d [a,b]) x hx) ?_ + intro y hy + refine bh (hN d [a,b] y hy) ?_ + intro z hz + exact dg (i8 d [a,b] z (by simp) hz) +theorem F5 (u:W) (l r:ai) : + (DL (bf l (G1 u)) r) [tm]⊢⁺ (DL l (wa+>((match u with | .UA => [] | .UT => wY)+>r))) := by + cases u + · simpa only [G1,append_nil] using! GV l r + · simpa only [G1,append_assoc] using! + U 13 ⟨(wX++wY).reverse,[],D,true⟩ ⟨[],wa++wY,D,true⟩ (by decide) l r +theorem Ea (l r:ai) : + (FL (bf l (G1 .UA)) ([0,0,0]+>r)) [tm]⊢⁺ (FL l ([0,0,0]+>(wa+>r))) := + Dp l r +theorem D1 (l r:ai) : + (FL (bf l (G1 .UT)) ([0,0,0]+>r)) [tm]⊢⁺ (FR (bf l (b5 [.P11])) ([0,0]+>r)) := + U 1 ⟨(wX++wY).reverse,[0,0,0],F,true⟩ ⟨(b5 [.P11]).reverse,[0,0],F,false⟩ (by decide) l r +theorem A0 (d:cm) (us : List W) (u:W) (c:aL) + (h : dA (bf (cn d us) (G1 u)) c) + (h1 : ∀ r,cE (BL (bf (cn d us) (G1 u)) ([0,0,1,0,1]+>r)) lr) + (h2 : ∀ r,cE (BL (bf (cn d us) (G1 u)) ([0,0,1,1,1,0,1]+>r)) lr) + (hlen : 2 ≤ us.length) : cE c lr := by + cases h with + | phase_D r => + refine cc (F5 u (cn d us) r) ?_ + refine bh (hN d us _ (.strong_D _)) ?_ + intro e he + exact dg (i8 d us e hlen he) + | phase_F r => + cases u + · refine cc (Ea (cn d us) r) ?_ + refine bh (hN d us _ (.strong_F _)) ?_ + intro e he + exact dg (i8 d us e hlen he) + · refine cc (D1 (cn d us) r) ?_ + refine bh (r7 [.P11] (cn d us) ([0,0]+>r)) ?_ + intro e he + refine bh (hN d us e he) ?_ + intro f hf + exact dg (i8 d us f hlen hf) + | phase_B101 r => exact h1 r + | phase_B11101 r => exact h2 r +def r8 : Prop:=∀ d a b c r, + cE (BL (cn d [a,b,c]) ([0,0,1,0,1]+>r)) lr ∧ + cE (BL (cn d [a,b,c]) ([0,0,1,1,1,0,1]+>r)) lr +theorem Bp (hb:r8) (d:cm) (a b c:W) (r:ai) : + fl (hF d [a,b,c] r) lr := by + refine cr (ta d [a,b,c] r) ?_ + refine bh (uK (cn d [a,b,c]) r) ?_ + intro x hx + have hsnoc : cn d [a,b,c] = bf (cn d [a,b]) (G1 c) := + Bi d [a,b] c + rw [hsnoc] at hx + refine A0 d [a,b] c x hx ?_ ?_ (by simp) + · intro r'; rw [← hsnoc]; exact (hb d a b c r').1 + · intro r'; rw [← hsnoc]; exact (hb d a b c r').2 +theorem Br (d:cm) (us vs : List W) (r:ai) : + hF d (us++vs) r = hF d us ((match d with | .CD => HD vs | .CF => HF vs)+>r) := by + cases d <;> simp [hF,n9,FQ,FY,append_assoc] +theorem y3 (hb:r8) (c:aL) (hs : lr c) : fl c lr := by + rcases hs with ⟨d,us,r,hlen,rfl⟩ + rcases us with _ | ⟨a,_ | ⟨b,_ | ⟨e,_ | ⟨f,us'⟩⟩⟩⟩ + · contradiction + · contradiction + · contradiction + · exact Bp hb d a b e r + · have h4 : [a,b,e,f]++us' = a :: b :: e :: f :: us':=rfl + rw [← h4,Br] + exact B7 d a b e f _ +theorem AM (hb:r8) (c:aL) (hs : lr c) (n:Nat) : ¬ d7 c n := + q2 (y3 hb) n c hs +theorem CR : + (init []) [tm]⊢* (hF .CD [.UA,.UT,.UA,.UA] ([1,0,1,0,0,1,1,0,1,0,1,1,0,1,0,0,1,0,1]+>default)) := by + have h0 : init [] = dw ⟨[],([0] : List gQ) ^ 32,A⟩ default := by + have hz : (([0] : List gQ) ^ 32)+>default = default:=qZ (by decide) + unfold init dw + rw [append_nil,hz] + rfl + have hrun:=kC 1044 + ⟨[],([0] : List gQ) ^ 32,A⟩ + ⟨[],[0,0]++n9 .CD [.UA,.UT,.UA,.UA]++[1,0,1,0,0,1,1,0,1,0,1,1,0,1,0,0,1,0,1],E⟩ + (by decide) default + rw [h0] + refine V ?_ + simpa only [dw,hF,CE,append_assoc] using! hrun +abbrev Y:=List Bool +abbrev U_:=List W +abbrev M_:=List b9 +abbrev T_:=ab dp +def cD : cm:=.CD +def cF : cm:=.CF +def Ii : ab dp:=.empty +def nd (x:dp) (l r : ab dp) : ab dp:=.node (some x) l r +def aZ (x:dp) (l : ab dp) : ab dp:=.node (some x) l .empty +def Ij (x:dp) (r : ab dp) : ab dp:=.node (some x) .empty r +def lf (x:dp) : ab dp:=.node (some x) .empty .empty +def z0:Pos:=.Z +def z1:Pos:=.O z0 +def z2:Pos:=.E z0 +def z3:Pos:=.O z1 +def z4:Pos:=.E z1 +def z5:Pos:=.O z2 +def z6:Pos:=.E z2 +def z7:Pos:=.O z3 +def z8:Pos:=.E z3 +def z9:Pos:=.O z4 +def dn:Pos:=.E z4 +def c5:Pos:=.O z5 +def cG:Pos:=.E z5 +def cM:Pos:=.O z6 +def cq:Pos:=.E z6 +def cP:Pos:=.O z7 +def cy:Pos:=.E z7 +def ct:Pos:=.O z8 +def cB:Pos:=.E z8 +def cV:Pos:=.O z9 +def dy:Pos:=.E z9 +def c9:Pos:=.O dn +def dj:Pos:=.E dn +def dP:Pos:=.O c5 +def di:Pos:=.E c5 +def da:Pos:=.O cG +def cA:Pos:=.E cG +def cS:Pos:=.O cM +def cI:Pos:=.E cM +def c8:Pos:=.O cq +def cN:Pos:=.E cq +def c7:Pos:=.O cP +def c0:Pos:=.E cP +def dI:Pos:=.O cy +def dr:Pos:=.E cy +def ds:Pos:=.O ct +def dT:Pos:=.E ct +def c6:Pos:=.O cB +def dl:Pos:=.E cB +def dL:Pos:=.O cV +def cO:Pos:=.E cV +def dM:Pos:=.O dy +def cL:Pos:=.E dy +def cU:Pos:=.O c9 +def cT:Pos:=.E c9 +def dq:Pos:=.O dj +def dY:Pos:=.E dj +def d9:Pos:=.O dP +def d1:Pos:=.E dP +def FE:Pos:=.O di +def Gj:Pos:=.E di +def GD:Pos:=.O da +def Gn:Pos:=.E da +def Gq:Pos:=.O cA +def GA:Pos:=.E cA +def Gh:Pos:=.O cS +def Gz:Pos:=.E cS +def Gx:Pos:=.O cI +def F3:Pos:=.E cI +def Fq:Pos:=.O c8 +def FU:Pos:=.E c8 +def FJ:Pos:=.O cN +def Gu:Pos:=.E cN +def Hp:Pos:=.O c7 +def HQ:Pos:=.E c7 +def HE:Pos:=.O c0 +def HO:Pos:=.E c0 +def Hy:Pos:=.O dI +def HN:Pos:=.E dI +def HG:Pos:=.O dr +def Ia:Pos:=.E dr +def H4:Pos:=.O ds +def H3:Pos:=.E ds +def Hx:Pos:=.O dT +def HH:Pos:=.E dT +def HY:Pos:=.O c6 +def Hz:Pos:=.E c6 +def Ht:Pos:=.O dl +def H6:Pos:=.E dl +def HB:Pos:=.O dL +def HI:Pos:=.E dL +def HS:Pos:=.O cO +def Hv:Pos:=.E cO +def GR:Pos:=.O dM +def Hk:Pos:=.E dM +def He:Pos:=.O cL +def Hu:Pos:=.E cL +def HM:Pos:=.O cU +def Hw:Pos:=.E cU +def HK:Pos:=.O cT +def H1:Pos:=.E cT +def Hs:Pos:=.O dq +def HW:Pos:=.E dq +def HV:Pos:=.O dY +def HZ:Pos:=.E dY +def H9:Pos:=.O d9 +def HT:Pos:=.E d9 +def H2:Pos:=.O d1 +def HX:Pos:=.E d1 +def HP:Pos:=.O FE +def Ha:Pos:=.E FE +def GT:Pos:=.O Gj +def Hi:Pos:=.E Gj +def Hl:Pos:=.O GD +def GM:Pos:=.E GD +def G8:Pos:=.O Gn +def G9:Pos:=.E Gn +def Hn:Pos:=.O Gq +def Hf:Pos:=.E Gq +def GO:Pos:=.O GA +def GX:Pos:=.E GA +def GY:Pos:=.O Gh +def Gc:Pos:=.E Gh +def Hh:Pos:=.O Gz +def «GL»:Pos:=.E Gz +def G6:Pos:=.O Gx +def GU:Pos:=.E Gx +def G4:Pos:=.O F3 +def GK:Pos:=.E F3 +def Hj:Pos:=.O Fq +def Hd:Pos:=.E Fq +def Hg:Pos:=.O FU +def GS:Pos:=.E FU +def GQ:Pos:=.O FJ +def G0:Pos:=.E FJ +def Gf:Pos:=.O Gu +def Hb:Pos:=.E Gu +def vx(p:Pos):Pos:=.E (.E (.E p)) +def vA(p:Pos):Pos:=.O (.E (.E p)) +def vu(p:Pos):Pos:=.E (.O (.E p)) +def vq(p:Pos):Pos:=.O (.O (.E p)) +def vw(p:Pos):Pos:=.E (.E (.O p)) +def vp(p:Pos):Pos:=.O (.E (.O p)) +def vt(p:Pos):Pos:=.E (.O (.O p)) +def vB(p:Pos):Pos:=.O (.O (.O p)) +namespace Pos +def p0(p:Pos):Pos:=vx (vx p) +def p1(p:Pos):Pos:=vA (vx p) +def p2(p:Pos):Pos:=vu (vx p) +def p3(p:Pos):Pos:=vq (vx p) +def p4(p:Pos):Pos:=vw (vx p) +def p5(p:Pos):Pos:=vp (vx p) +def p6(p:Pos):Pos:=vt (vx p) +def p7(p:Pos):Pos:=vB (vx p) +def p8(p:Pos):Pos:=vx (vA p) +def p9(p:Pos):Pos:=vA (vA p) +def gL(p:Pos):Pos:=vu (vA p) +def hH(p:Pos):Pos:=vq (vA p) +def f5(p:Pos):Pos:=vw (vA p) +def gj(p:Pos):Pos:=vp (vA p) +def ga(p:Pos):Pos:=vt (vA p) +def f9(p:Pos):Pos:=vB (vA p) +def eA(p:Pos):Pos:=vx (vu p) +def gn(p:Pos):Pos:=vA (vu p) +def fx(p:Pos):Pos:=vu (vu p) +def fM(p:Pos):Pos:=vq (vu p) +def gd(p:Pos):Pos:=vw (vu p) +def gb(p:Pos):Pos:=vp (vu p) +def fq(p:Pos):Pos:=vt (vu p) +def gv(p:Pos):Pos:=vB (vu p) +def fC(p:Pos):Pos:=vx (vq p) +def gm(p:Pos):Pos:=vA (vq p) +def gH(p:Pos):Pos:=vu (vq p) +def fm(p:Pos):Pos:=vq (vq p) +def eS(p:Pos):Pos:=vw (vq p) +def eY(p:Pos):Pos:=vp (vq p) +def gg(p:Pos):Pos:=vt (vq p) +def fL(p:Pos):Pos:=vB (vq p) +def ex(p:Pos):Pos:=vx (vw p) +def fN(p:Pos):Pos:=vA (vw p) +def fK(p:Pos):Pos:=vu (vw p) +def ez(p:Pos):Pos:=vq (vw p) +def eu(p:Pos):Pos:=vw (vw p) +def fA(p:Pos):Pos:=vp (vw p) +def fT(p:Pos):Pos:=vt (vw p) +def eB(p:Pos):Pos:=vB (vw p) +def er(p:Pos):Pos:=vx (vp p) +def gk(p:Pos):Pos:=vA (vp p) +def e1(p:Pos):Pos:=vu (vp p) +def gl(p:Pos):Pos:=vq (vp p) +def fz(p:Pos):Pos:=vw (vp p) +def f8(p:Pos):Pos:=vp (vp p) +def eH(p:Pos):Pos:=vt (vp p) +def eW(p:Pos):Pos:=vB (vp p) +def fi(p:Pos):Pos:=vx (vt p) +def fU(p:Pos):Pos:=vA (vt p) +def fo(p:Pos):Pos:=vu (vt p) +def eZ(p:Pos):Pos:=vq (vt p) +def ev(p:Pos):Pos:=vw (vt p) +def gO(p:Pos):Pos:=vp (vt p) +def fu(p:Pos):Pos:=vt (vt p) +def fD(p:Pos):Pos:=vB (vt p) +def fE(p:Pos):Pos:=vx (vB p) +def f4(p:Pos):Pos:=vA (vB p) +def ft(p:Pos):Pos:=vu (vB p) +def fp(p:Pos):Pos:=vq (vB p) +def gK(p:Pos):Pos:=vw (vB p) +def fP(p:Pos):Pos:=vp (vB p) +def f6(p:Pos):Pos:=vt (vB p) +def e7(p:Pos):Pos:=vB (vB p) +end Pos +def e_:Y:=[] +def bd:Y:=false::e_ +def b1:Y:=true::e_ +def aP:Y:=false::bd +def aE:Y:=false::b1 +def fY:Y:=true::bd +def jN:Y:=true::b1 +def Gl:Y:=false::aP +def aw:Y:=false::fY +def jH:Y:=false::jN +def j:Y:=true::aP +def H:Y:=true::aE +def vO:Y:=true::fY +def xI:Y:=true::jN +def FX:Y:=false::aw +def FO:Y:=false::jH +def L:Y:=false::j +def au:Y:=false::H +def xi:Y:=false::vO +def FG:Y:=false::xI +def FS:Y:=true::Gl +def bt:Y:=true::aw +def pw:Y:=true::jH +def h9:Y:=true::j +def K:Y:=true::H +def yi:Y:=true::vO +def pq:Y:=true::xI +def af:Y:=false::L +def aA:Y:=false::au +def k9:Y:=false::bt +def kW:Y:=false::pw +def hj:Y:=false::h9 +def ak:Y:=false::K +def oj:Y:=false::pq +def EM:Y:=true::FX +def aU:Y:=true::L +def ci:Y:=true::au +def rv:Y:=true::xi +def EW:Y:=true::FG +def bq:Y:=true::bt +def yJ:Y:=true::pw +def ah:Y:=true::K +def oF:Y:=true::yi +def yE:Y:=true::pq +def br:Y:=false::af +def bj:Y:=false::ak +def Ed:Y:=false::oj +def D7:Y:=false::EM +def ad:Y:=false::aU +def dO:Y:=false::ci +def hO:Y:=false::bq +def X:Y:=false::ah +def u9:Y:=false::oF +def ie:Y:=true::af +def iZ:Y:=true::aA +def mE:Y:=true::k9 +def kx:Y:=true::kW +def aH:Y:=true::hj +def dN:Y:=true::ak +def A3:Y:=true::oj +def eM:Y:=true::aU +def dV:Y:=true::ci +def pJ:Y:=true::rv +def A9:Y:=true::EW +def aN:Y:=true::bq +def DZ:Y:=true::yJ +def dZ:Y:=true::ah +def xL:Y:=true::oF +def A8:Y:=true::yE +def dD:Y:=false::ad +def Di:Y:=false::hO +def aB:Y:=false::X +def b3:Y:=false::ie +def e4:Y:=false::iZ +def vS:Y:=false::mE +def Df:Y:=false::kx +def bO:Y:=false::aH +def cg:Y:=false::dN +def zi:Y:=false::A3 +def gN:Y:=false::eM +def vN:Y:=false::dV +def vI:Y:=false::pJ +def vK:Y:=false::A9 +def b4:Y:=false::aN +def C2:Y:=false::DZ +def lq:Y:=false::dZ +def ao:Y:=true::br +def ar:Y:=true::bj +def CG:Y:=true::Ed +def CX:Y:=true::D7 +def cC:Y:=true::ad +def e3:Y:=true::dO +def vU:Y:=true::hO +def aV:Y:=true::X +def De:Y:=true::u9 +def my:Y:=true::mE +def iE:Y:=true::kx +def oo:Y:=true::aH +def rR:Y:=true::dN +def ea:Y:=true::eM +def gf:Y:=true::dV +def gS:Y:=true::aN +def bK:Y:=true::dZ +def yn:Y:=true::xL +def Ic(t:Y):Y:=false::false::false::false::t +def wi(t:Y):Y:=true::false::false::false::t +def mx(t:Y):Y:=false::true::false::false::t +def wM(t:Y):Y:=true::true::false::false::t +def pn(t:Y):Y:=false::false::true::false::t +def js(t:Y):Y:=true::false::true::false::t +def kU(t:Y):Y:=false::true::true::false::t +def lv(t:Y):Y:=true::true::true::false::t +def xT(t:Y):Y:=false::false::false::true::t +def mS(t:Y):Y:=true::false::false::true::t +def kd(t:Y):Y:=false::true::false::true::t +def jM(t:Y):Y:=true::true::false::true::t +def pY(t:Y):Y:=false::false::true::true::t +def ks(t:Y):Y:=true::false::true::true::t +def nH(t:Y):Y:=false::true::true::true::t +def kI(t:Y):Y:=true::true::true::true::t +def _root_.List.sx(t:Y):Y:=wi (wi t) +def _root_.List.v9(t:Y):Y:=mx (wi t) +def _root_.List.H5(t:Y):Y:=pn (wi t) +def _root_.List.G2(t:Y):Y:=js (wi t) +def _root_.List.GW(t:Y):Y:=kU (wi t) +def _root_.List.Dg(t:Y):Y:=lv (wi t) +def _root_.List.GE(t:Y):Y:=kd (wi t) +def _root_.List.iG(t:Y):Y:=mx (mx t) +def _root_.List.GB(t:Y):Y:=wM (mx t) +def _root_.List.hU(t:Y):Y:=js (mx t) +def _root_.List.AQ(t:Y):Y:=mS (mx t) +def _root_.List.wd(t:Y):Y:=kd (mx t) +def _root_.List.o5(t:Y):Y:=jM (mx t) +def _root_.List.AV(t:Y):Y:=pY (mx t) +def _root_.List.xx(t:Y):Y:=ks (mx t) +def _root_.List.vL(t:Y):Y:=nH (mx t) +def _root_.List.mu(t:Y):Y:=kI (mx t) +def _root_.List.HU(t:Y):Y:=pn (wM t) +def _root_.List.AZ(t:Y):Y:=js (wM t) +def _root_.List.yb(t:Y):Y:=lv (wM t) +def _root_.List.y9(t:Y):Y:=pn (pn t) +def _root_.List.hM(t:Y):Y:=js (pn t) +def _root_.List.x2(t:Y):Y:=kU (pn t) +def _root_.List.F4(t:Y):Y:=xT (pn t) +def _root_.List.D8(t:Y):Y:=mS (pn t) +def _root_.List.ni(t:Y):Y:=kd (pn t) +def _root_.List.hK(t:Y):Y:=jM (pn t) +def _root_.List.jd(t:Y):Y:=mx (js t) +def _root_.List.vr(t:Y):Y:=wM (js t) +def _root_.List.bi(t:Y):Y:=js (js t) +def _root_.List.bg(t:Y):Y:=kU (js t) +def _root_.List.cJ(t:Y):Y:=lv (js t) +def _root_.List.kY(t:Y):Y:=mS (js t) +def _root_.List.aD(t:Y):Y:=kd (js t) +def _root_.List.b8(t:Y):Y:=jM (js t) +def _root_.List.pD(t:Y):Y:=pY (js t) +def _root_.List.bm(t:Y):Y:=ks (js t) +def _root_.List.ja(t:Y):Y:=nH (js t) +def _root_.List.bu(t:Y):Y:=kI (js t) +def _root_.List.fr(t:Y):Y:=pn (kU t) +def _root_.List.xF(t:Y):Y:=js (kU t) +def _root_.List.mX(t:Y):Y:=kU (kU t) +def _root_.List.pT(t:Y):Y:=mS (kU t) +def _root_.List.aX(t:Y):Y:=kd (kU t) +def _root_.List.bH(t:Y):Y:=jM (kU t) +def _root_.List.CJ(t:Y):Y:=pY (kU t) +def _root_.List.cd(t:Y):Y:=ks (kU t) +def _root_.List.aS(t:Y):Y:=nH (kU t) +def _root_.List.b6(t:Y):Y:=kI (kU t) +def _root_.List.bI(t:Y):Y:=mx (lv t) +def _root_.List.Cn(t:Y):Y:=wM (lv t) +def _root_.List.aI(t:Y):Y:=js (lv t) +def _root_.List.iI(t:Y):Y:=kU (lv t) +def _root_.List.wj(t:Y):Y:=lv (lv t) +def _root_.List.FZ(t:Y):Y:=mS (lv t) +def _root_.List.bw(t:Y):Y:=kd (lv t) +def _root_.List.dm(t:Y):Y:=jM (lv t) +def _root_.List.EQ(t:Y):Y:=pY (lv t) +def _root_.List.hL(t:Y):Y:=ks (lv t) +def _root_.List.jr(t:Y):Y:=nH (lv t) +def _root_.List.fy(t:Y):Y:=kI (lv t) +def _root_.List.Fy(t:Y):Y:=xT (xT t) +def _root_.List.Gp(t:Y):Y:=mS (xT t) +def _root_.List.xD(t:Y):Y:=kd (xT t) +def _root_.List.CI(t:Y):Y:=jM (xT t) +def _root_.List.FI(t:Y):Y:=ks (xT t) +def _root_.List.gP(t:Y):Y:=wi (mS t) +def _root_.List.AO(t:Y):Y:=mx (mS t) +def _root_.List.Em(t:Y):Y:=pn (mS t) +def _root_.List.sk(t:Y):Y:=js (mS t) +def _root_.List.n1(t:Y):Y:=kU (mS t) +def _root_.List.eC(t:Y):Y:=lv (mS t) +def _root_.List.vz(t:Y):Y:=kd (mS t) +def _root_.List.yd(t:Y):Y:=pn (kd t) +def _root_.List.ib(t:Y):Y:=js (kd t) +def _root_.List.Eb(t:Y):Y:=kU (kd t) +def _root_.List.ae(t:Y):Y:=kd (kd t) +def _root_.List.aF(t:Y):Y:=jM (kd t) +def _root_.List.kB(t:Y):Y:=pY (kd t) +def _root_.List.e0(t:Y):Y:=ks (kd t) +def _root_.List.aC(t:Y):Y:=nH (kd t) +def _root_.List.bP(t:Y):Y:=kI (kd t) +def _root_.List.cH(t:Y):Y:=mx (jM t) +def _root_.List.vv(t:Y):Y:=wM (jM t) +def _root_.List.cx(t:Y):Y:=js (jM t) +def _root_.List.S(t:Y):Y:=kU (jM t) +def _root_.List.cz(t:Y):Y:=lv (jM t) +def _root_.List.iH(t:Y):Y:=mS (jM t) +def _root_.List.bQ(t:Y):Y:=kd (jM t) +def _root_.List.gR(t:Y):Y:=jM (jM t) +def _root_.List.FN(t:Y):Y:=pY (jM t) +def _root_.List.fj(t:Y):Y:=ks (jM t) +def _root_.List.ia(t:Y):Y:=nH (jM t) +def _root_.List.eK(t:Y):Y:=kI (jM t) +def _root_.List.r4(t:Y):Y:=xT (pY t) +def _root_.List.rF(t:Y):Y:=mS (pY t) +def _root_.List.nh(t:Y):Y:=kd (pY t) +def _root_.List.gY(t:Y):Y:=jM (pY t) +def _root_.List.xQ(t:Y):Y:=ks (pY t) +def _root_.List.Gg(t:Y):Y:=mx (ks t) +def _root_.List.Gw(t:Y):Y:=wM (ks t) +def _root_.List.cR(t:Y):Y:=js (ks t) +def _root_.List.bV(t:Y):Y:=kU (ks t) +def _root_.List.aO(t:Y):Y:=lv (ks t) +def _root_.List.mv(t:Y):Y:=mS (ks t) +def _root_.List.aj(t:Y):Y:=kd (ks t) +def _root_.List.ag(t:Y):Y:=jM (ks t) +def _root_.List.Gv(t:Y):Y:=pY (ks t) +def _root_.List.eP(t:Y):Y:=ks (ks t) +def _root_.List.b2(t:Y):Y:=nH (ks t) +def _root_.List.nR(t:Y):Y:=kI (ks t) +def _root_.List.kv(t:Y):Y:=pn (nH t) +def _root_.List.pF(t:Y):Y:=js (nH t) +def _root_.List.nS(t:Y):Y:=kU (nH t) +def _root_.List.cQ(t:Y):Y:=kd (nH t) +def _root_.List.bl(t:Y):Y:=jM (nH t) +def _root_.List.eb(t:Y):Y:=ks (nH t) +def _root_.List.iF(t:Y):Y:=nH (nH t) +def _root_.List.q5(t:Y):Y:=kI (nH t) +def _root_.List.fF(t:Y):Y:=mx (kI t) +def _root_.List.pl(t:Y):Y:=wM (kI t) +def _root_.List.eV(t:Y):Y:=js (kI t) +def _root_.List.a0(t:Y):Y:=kU (kI t) +def _root_.List.pk(t:Y):Y:=lv (kI t) +def _root_.List.F1(t:Y):Y:=mS (kI t) +def _root_.List.eN(t:Y):Y:=kd (kI t) +def _root_.List.dJ(t:Y):Y:=jM (kI t) +def _root_.List.HL(t:Y):Y:=pY (kI t) +def _root_.List.dK(t:Y):Y:=ks (kI t) +def _root_.List.jq(t:Y):Y:=nH (kI t) +def _root_.List.ec(t:Y):Y:=kI (kI t) +def _root_.List.bo(t:Y):Y:=t.eV.aO +def _root_.List.av(t:Y):Y:=t.aC.bi +def _root_.List.b0(t:Y):Y:=t.aC.aS +def _root_.List.eh(t:Y):Y:=t.kv.hK +def _root_.List.cw(t:Y):Y:=t.bu.aO +def _root_.List.cY(t:Y):Y:=t.pD.aF +def _root_.List.bz(t:Y):Y:=t.bm.aI +def _root_.List.qV(t:Y):Y:=t.bi.aI +def _root_.List.cK(t:Y):Y:=t.bV.ae +def _root_.List.cs(t:Y):Y:=t.S.aj +def _root_.List.eD(t:Y):Y:=t.AQ.bi +def _root_.List.gD(t:Y):Y:=t.hU.fr +def _root_.List.cf(t:Y):Y:=t.cd.S +def _root_.List.k7(t:Y):Y:=t.gY.bm +def _root_.List.dv(t:Y):Y:=t.ag.aX +def _root_.List.fQ(t:Y):Y:=t.aO.iG +def _root_.List.bp(t:Y):Y:=t.ae.S +def _root_.List.EK(t:Y):Y:=t.gY.bu +def _root_.List.dB(t:Y):Y:=t.e0.S +def _root_.List.cv(t:Y):Y:=t.bQ.bl +def _root_.List.gC(t:Y):Y:=t.ag.S +def _root_.List.d6(t:Y):Y:=t.bm.bI +def _root_.List.g8(t:Y):Y:=t.e0.bI +def _root_.List.Fk(t:Y):Y:=t.bi.cR +def _root_.List.it(t:Y):Y:=t.eb.S +def _root_.List.EO(t:Y):Y:=t.b8.AQ +def _root_.List.dh(t:Y):Y:=t.bm.fy +def _root_.List.EN(t:Y):Y:=t.nh.bi +def _root_.List.fg(t:Y):Y:=t.b8.aX +def _root_.List.gZ(t:Y):Y:=t.cx.S +def _root_.List.fH(t:Y):Y:=t.bV.ag +def _root_.List.iV(t:Y):Y:=t.cx.aC +def _root_.List.Ao(t:Y):Y:=t.bQ.eV +def _root_.List.ik(t:Y):Y:=t.bH.dm +def _root_.List.gE(t:Y):Y:=t.eV.gY +def _root_.List.i9(t:Y):Y:=t.bI.aC +def _root_.List.kk(t:Y):Y:=t.cR.aI +def _root_.List.i0(t:Y):Y:=t.cQ.pF +def _root_.List.ce(t:Y):Y:=t.bl.aC +def _root_.List.i2(t:Y):Y:=t.aI.gP +def _root_.List.g6(t:Y):Y:=t.S.ag +def _root_.List.h8(t:Y):Y:=t.bH.aC +def _root_.List.ho(t:Y):Y:=t.ag.aD +def _root_.List.iv(t:Y):Y:=t.n1.hK +def _root_.List.jQ(t:Y):Y:=t.aI.aO +def _root_.List.g0(t:Y):Y:=t.bH.bw +def _root_.List.kl(t:Y):Y:=t.a0.a0 +def _root_.List.db(t:Y):Y:=t.EK.aO +def _root_.List.dx(t:Y):Y:=t.hL.fy +def _root_.List.io(t:Y):Y:=t.eh.gD +def _root_.List.dt(t:Y):Y:=t.EO.qV +def _root_.List.fd(t:Y):Y:=t.EN.aO +def _root_.List.gT(t:Y):Y:=t.Fk.aI +def _root_.List.eF(t:Y):Y:=t.Ao.aO +def _root_.List.hV(t:Y):Y:=t.k7.aI +def _root_.List.gB(t:Y):Y:=t.jd.aC +def DA : List W:=[.UA,.UA] +def kD : List W:=[.UA,.UA,.UA] +def FW : List W:=[.UA,.UA,.UA,.UA] +def f7 : List W:=[.UA,.UA,.UT] +def FB : List W:=[.UA,.UA,.UT,.UA] +def A7 : List W:=[.UA,.UT] +def nP : List W:=[.UA,.UT,.UA] +def FP : List W:=[.UA,.UT,.UA,.UA] +def Ev : List W:=[.UA,.UT,.UA,.UA,.UA] +def A4 : List W:=[.UA,.UT,.UA,.UA,.UA,.UA] +def vR : List W:=[.UA,.UT,.UT] +def Ga : List W:=[.UT,.UA] +def dE : List W:=[.UT,.UA,.UA] +def vk : List W:=[.UT,.UA,.UA,.UA] +def Ft : List W:=[.UT,.UA,.UA,.UA,.UA] +def hI : List W:=[.UT,.UA,.UT] +def Dq : List W:=[.UT,.UA,.UT,.UA] +def F6 : List W:=[.UT,.UA,.UT,.UT] +def Gb : List W:=[.UT,.UT] +def mD : List W:=[.UT,.UT,.UA] +def FM : List W:=[.UT,.UT,.UA,.UA] +def fB : List W:=[.UT,.UT,.UT] +def Dj : List W:=[.UT,.UT,.UT,.UA] +def wN : List b9:=[] +def iC : List b9:=[.P11] +def sc : List b9:=[.P11,.P11] +def Bq : List Bool:=[] +def Gr : List Bool:=[false,false] +def rT : List Bool:=[false,false,false,false,true,true,true,true] +def Bz : List Bool:=[false,false,true,false] +def rg : List Bool:=[false,false,true,false,false,false,false,false,true,true,true,true,false,false,true,false,false,true,false] +def zy : List Bool:=[false,false,true,true,true,true] +def xY : List Bool:=[true] +def AU : List Bool:=[true,false,false,false,false,true,true,true,true] +def DT : List Bool:=[true,false,false,true,false] +def xy : List Bool:=[true,false,false,true,false,false,false,false,true,true,true,true] +def Bt : List Bool:=[true,false,false,true,false,false,true,false] +def BA : List Bool:=[true,false,false,true,true,true,true] +def Bk : List Bool:=[true,false,false,true,true,true,true,true] +def yc : List Bool:=[true,false,false,true,true,true,true,true,false,false,false] +def EB : List Bool:=[true,false,true,false] +def x7 : List Bool:=[true,false,true,false,false,false,false,true,true,true,true] +def BE : List Bool:=[true,false,true,false,false,true,false] +def rZ : List Bool:=[true,false,true,false,true,true,true,true] +def vo : List Bool:=[true,false,true,false,true,true,true,true,false,false,true,false,false,true,false] +def CN : List Bool:=[true,false,true,true,true,true] +def Cp : List Bool:=[true,false,true,true,true,true,true] +def Ap : List Bool:=[true,false,true,true,true,true,true,false,false,false] +def Dh : List Bool:=[true,true] +def sv : List Bool:=[true,true,false,false,false,false,false,true,true,true,true] +def Bo : List Bool:=[true,true,true] +def tt : List Bool:=[true,true,true,true] +def B5 : List Bool:=[true,true,true,true,false,false,false] +def Bg : List Bool:=[true,true,true,true,true,false,false,false] +def vy : List Bool:=[true,true,true,true,true,true,false,false,false,true,false,false,false,true,false] +def aM (d:cm) (us : List W) (w : List Bool) : fZ:=.Recovered d us w +def t9 (d:cm) (us : List W) (w : List Bool) : fZ:=.NineGain d us w +def t6 (d:cm) (us : List W) (w : List Bool) : fZ:=.SixGain d us w +def tY (w : List Bool) : fZ:=.YaaGain w +def eU (d:cm) (us : List W) (w : List Bool) : dp:=.rEnd (aM d us w) +def Dm (d:cm) (us : List W) (w : List Bool) : dp:=.rEnd (t9 d us w) +def zj (d:cm) (us : List W) (w : List Bool) : dp:=.rEnd (t6 d us w) +def kH (w : List Bool) : dp:=.rEnd (tY w) +def DG (w : List Bool) (s:Nat) (t:Pos) (p : List Bool) : dp:=.rNat (xB w) s t p +def Id (q w : List Bool) (s:Nat) (t:Pos) (p : List Bool) : dp:=.rNat (jJ q w) s t p +def F7 (q w : List Bool) (s:Nat) (t:Pos) (p : List Bool) : dp:=.rNat (gh q .qB w) s t p +def rP (b : List Bool) (ps : List b9) (st : List Bool) (nd:Nat) (td:fZ) (nf:Nat) (tf:fZ) (w : List Bool) : dp:=.rProt ⟨b,ps,st,nd,td,nf,tf⟩ w +def dH (q w : List Bool) (s1:Nat) (t1:Pos) (p1 : List Bool) (s2:Nat) (t2:Pos) (p2 : List Bool) (s3:Nat) (t3:Pos) (p3 : List Bool) : dp:=.rRet q w .AllCases [⟨.RD,[],s1,t1,p1⟩,⟨.RF,[false,false],s2,t2,p2⟩,⟨.RB,[false,false],s3,t3,p3⟩] +def eX (q : List Bool) (s1:Nat) (t1:Pos) (p1 : List Bool) (s2:Nat) (t2:Pos) (p2 : List Bool) (s3:Nat) (t3:Pos) (p3 : List Bool) (s4:Nat) (t4:Pos) (p4 : List Bool) : dp:=.rRet q [false,false] .Cases00 [⟨.RD,[true,false,true],s1,t1,p1⟩,⟨.RD,[true,true,true,false,true],s2,t2,p2⟩,⟨.RD,[true,false,true,false,false],s3,t3,p3⟩,⟨.RF,[false,false,false],s4,t4,p4⟩] +def jL (q : List Bool) (s1:Nat) (t1:Pos) (p1 : List Bool) (s2:Nat) (t2:Pos) (p2 : List Bool) (s3:Nat) (t3:Pos) (p3 : List Bool) (s4:Nat) (t4:Pos) (p4 : List Bool) : dp:=.rRet q [true] .Cases1 [⟨.RD,[true,true,false,true],s1,t1,p1⟩,⟨.RD,[false,true,false,false],s2,t2,p2⟩,⟨.RF,[false,false],s3,t3,p3⟩,⟨.RB,[false,false],s4,t4,p4⟩] +def FF (q w : List Bool) (s1:Nat) (t1:Pos) (p1 : List Bool) (s2:Nat) (t2:Pos) (p2 : List Bool) : dp:=.rRet q w .Coarse00 [⟨.RD,[],s1,t1,p1⟩,⟨.RF,[false,false],s2,t2,p2⟩] +def Bj (q w : List Bool) (s1:Nat) (t1:Pos) (p1 : List Bool) (s2:Nat) (t2:Pos) (p2 : List Bool) : dp:=.rRet q w .Coarse10 [⟨.RD,[],s1,t1,p1⟩,⟨.RB,[false,false],s2,t2,p2⟩] +noncomputable section +def an:=z6.fu +def ap:=z2.fp +def bv:=dj.f4 +def bN:=z3.gm +def b7:=d1.fT +def ca:=z2.ft +def ch:=dj.fE +def c4:=z8.fT +def ey:=c9.fC +def et:=cq.ga +def dX:=z1.p0 +def ep:=z1.p1 +def fG:=z1.p9 +def hB:=cO.p3 +def fe:=cM.e1 +def hJ:=ct.eS +def hC:=cq.p1 +def iq:=z6.fP +def hD:=dy.eZ +def iK:=cq.p0 +def kA:=z2.f9 +def jK:=dr.hH +def jc:=dM.fU +def iB:=z2.fU +def kw:=z5.p0 +def iJ:=d1.fE +def lF:=cM.fD +def lo:=cP.eW +def iz:=dn.e7 +def je:=z6.ev +def mF:=z6.f6 +def mL:=cP.gm +def mf:=cP.fC +def mG:=ct.fp +def mH:=cO.p1 +def l0:=cI.p3 +def lJ:=cA.er +def mJ:=dP.gn +def nX:=z5.ez +def mK:=dr.gk +def mc:=z6.ex +def mM:=cy.p5 +def lA:=c0.fL +def lm:=cB.fq +def ky:=cP.eY +def py:=c0.fo +def rO:=z2.e7 +def nW:=z3.fm +def rN:=cy.gO +def nV:=cG.gm +def se:=z4.fK +def pv:=z7.gv +def sb:=cU.f5 +def rU:=dy.eS +def r5:=z7.f5 +def nY:=cy.p2 +def pm:=ct.p5 +def vg:=ds.fC +def sg:=ct.eY +def pA:=dn.p1 +def pp:=cM.p9 +def pz:=cM.gL +def rQ:=d1.e1 +def rY:=cS.gb +def r9:=d1.eu +def rW:=d1.er +def pt:=c0.fT +def si:=z2.fP +def u5:=c0.fD +def sa:=cP.gH +def vd:=cU.gj +def sj:=cP.gn +def vj:=cO.p8 +def r6:=cP.gg +def po:=c5.p5 +def vm:=cq.eY +def u7:=di.e1 +def wt:=z2.eZ +def vf:=dy.gL +def vc:=di.eH +def vb:=ds.gH +def u6:=di.fi +def ve:=dl.eA +def yj:=c9.p6 +def rX:=z6.gk +def vl:=cB.gv +def vh:=cI.gH +def xb:=dj.fD +def xj:=cy.gg +def wS:=ds.gv +def yg:=cV.fN +def va:=da.ez +def vi:=cB.f8 +def yk:=cI.p5 +def v8:=cG.f8 +def xn:=cG.fT +def xg:=cM.gl +def yl:=cP.eS +def ym:=z5.fo +def wT:=cB.gm +def vZ:=cI.p4 +def uV:=cB.fC +def uz:=cM.gg +def wZ:=dL.gv +def Ai:=cM.hH +def w3:=dn.gb +def wn:=c5.eu +def w2:=dr.gd +def xa:=cL.fx +def tj:=cI.gO +def wU:=cI.fi +def wg:=c9.gl +def wD:=cG.gb +def xv:=cG.fM +def w0:=cG.fA +def ws:=dy.fz +def xd:=dy.gl +def xr:=cS.fA +def wy:=cN.fP +def v3:=c8.p1 +def wO:=dj.f9 +def wv:=dj.f5 +def ug:=ct.p4 +def sF:=cM.ft +def rb:=cG.fC +def wf:=dP.fz +def wu:=cM.gk +def zm:=di.p1 +def B4:=cM.eS +def AA:=z4.fA +def zr:=dy.f6 +def wK:=c0.fu +def we:=c8.eY +def wG:=dj.ft +def zR:=z8.f4 +def zw:=cO.p9 +def tH:=cU.eZ +def v7:=cP.p2 +def yK:=c6.fP +def Aa:=cS.gj +def yz:=cA.fA +def xw:=cG.gk +def yI:=c7.p6 +def v2:=cI.eA +def uv:=cM.fu +def u0:=z7.fm +def yV:=cB.fA +def Cs:=di.fz +def zZ:=cB.eH +def w6:=c6.p5 +def wr:=cG.gj +def wF:=z7.gj +def yo:=cU.p6 +def zM:=cT.p6 +def Ae:=cP.eZ +def xt:=cM.fp +def zE:=cV.fC +def zp:=dM.fp +def yO:=c7.eY +def zx:=dr.gb +def AH:=dI.eS +def As:=c5.fi +def zH:=dY.er +def yt:=dY.gk +def w5:=cP.e7 +def yY:=dP.p4 +def yS:=dl.gl +def y7:=c6.fm +def yM:=dj.p6 +def y0:=c8.ez +def Ax:=dL.fU +def Aq:=c5.p4 +def wV:=c5.p7 +def Ar:=da.gm +def Ak:=cV.eu +def AC:=dn.ex +def wC:=c9.f9 +def zh:=dq.eZ +def xh:=cB.ex +def zP:=dj.fu +def ze:=da.fo +def nC:=bd.ag +def sL:=e_.cd +def lO:=oF.ag +def kV:=vO.a0 +def Av:=e_.jr +def yB:=bd.dK +def i4:=xi.ag +def qk:=fY.dJ +def kt:=yi.eb +def cZ:=vI.ag +def fk:=rv.S +def il:=pJ.cd +def lD:=vO.cd +def xm:=fY.S +def o0:=yn.cd +def qs:=xL.S +def BT:=vO.b6 +def yv:=rv.eK +def rE:=vI.dK +def aQ:=bd.hM +def aY:=b1.xF +def cj:=e_.bQ +def BI:=xi.nR +def Ad:=fY.cz +def s5:=pJ.jr +def bF:=aE.nh +def bE:=aP.xD +def rp:=yn.b6 +def cl:=e_.iG +def cX:=e_.cH +def ed:=b1.aI +def fI:=b1.bI +def dS:=e_.wd +def dk:=aE.bl +def dz:=e_.hU +def Af:=xL.cz +def d8:=bd.hK +def d0:=bd.bi +def d4:=aP.FI +def eQ:=e_.cx +def Cj:=b1.eb +def e6:=aP.aF +def fX:=b1.bH +def gx:=e_.yb +def ow:=aE.eN +def gq:=aE.pF +def g5:=e_.ib +def gX:=aP.eC +def g7:=b3.bl +def g2:=K.aC +def hW:=e_.ia +def hQ:=cg.bl +def h5:=aE.xQ +def iD:=bd.jd +def i6:=fY.bI +def iX:=af.bQ +def iY:=e_.iH +def iQ:=ie.aI +def iS:=aV.aI +def iN:=e_.aC +def l6:=e_.bm +def jk:=L.bP +def jv:=e_.aF +def jt:=aE.aO +def jD:=j.Dg +def jw:=H.eC +def jl:=H.sk +def ju:=j.G2 +def jy:=ah.bm +def jn:=b1.ni +def jT:=bq.bl +def kn:=b1.bP +def jX:=e4.bl +def kr:=bd.bQ +def kc:=fY.bH +def ke:=ak.bQ +def ki:=e_.pD +def j5:=H.aO +def kg:=L.aC +def jZ:=bd.y9 +def jU:=H.Em +def ka:=j.H5 +def k6:=aP.ib +def kO:=b1.bw +def ld:=e_.vL +def kJ:=bd.kY +def kS:=L.wd +def rC:=L.bm +def kP:=e_.HU +def k0:=b1.fr +def lk:=K.wd +def lR:=fY.aI +def mq:=bd.iH +def mh:=j.vL +def lT:=bd.aX +def lS:=e_.aD +def lV:=e_.AZ +def lM:=aE.cQ +def lG:=j.cJ +def lP:=bd.cx +def nK:=j.GE +def mW:=e_.AQ +def nJ:=b1.hL +def m3:=aP.bQ +def nk:=H.eV +def nG:=ao.aI +def mY:=dN.aI +def mT:=ah.kY +def m4:=K.bm +def nj:=aE.aC +def nq:=H.aC +def nB:=ar.aI +def nD:=K.bl +def nn:=aP.cR +def oR:=aE.gY +def oy:=aP.CI +def ob:=iZ.aI +def o3:=X.bQ +def oA:=aE.Em +def oG:=br.aF +def oa:=ak.jd +def oW:=j.bH +def om:=af.jd +def oC:=aE.sk +def o4:=j.aF +def o6:=H.nh +def oY:=aP.Gg +def pc:=aw.bl +def oI:=j.bQ +def oM:=bt.eV +def pX:=L.vL +def pQ:=e_.S +def ra:=H.fF +def q8:=ci.aI +def qL:=br.ib +def Fx:=oj.ag +def qI:=bd.bm +def rA:=K.AQ +def qG:=bj.aF +def rB:=aU.kY +def rJ:=e_.bu +def qQ:=aE.eV +def qy:=aP.eP +def rG:=K.vL +def rI:=br.bQ +def q3:=b1.hK +def qp:=bq.aC +def rD:=ak.bm +def rM:=af.bm +def qb:=aw.kv +def pS:=bj.bQ +def q4:=b1.bm +def rt:=aU.bm +def q6:=H.vz +def rr:=X.bi +def qm:=L.AQ +def s7:=j.bI +def uU:=ah.bu +def uI:=aE.bQ +def ue:=K.Em +def sI:=K.bP +def uc:=j.mu +def uG:=hj.bl +def uH:=H.bl +def ty:=K.sk +def tP:=L.bl +def tb:=ak.bi +def t8:=aE.bV +def u4:=e_.cJ +def tX:=e_.fj +def tT:=cC.aI +def uD:=bd.aC +def uj:=H.gY +def tr:=H.AQ +def uL:=aP.Gp +def uk:=br.xD +def Ek:=fY.eb +def tI:=h9.aI +def ub:=aP.ae +def tS:=au.bi +def tL:=H.aI +def uu:=bd.x2 +def tG:=aP.cx +def th:=b1.cJ +def t5:=au.jd +def ui:=af.bi +def tx:=bd.aD +def Eq:=bd.nR +def jm:=Av.ag +def iP:=kV.ag +def fc:=qk.cd +def kb:=yB.S +def fa:=sL.cz +def iA:=nC.a0 +def dF:=BT.ag +def nx:=sL.dJ +def hR:=kt.cz +def j0:=nC.b6 +def eT:=lO.b6 +def iy:=Ad.eb +def j7:=xm.nR +def eI:=BI.cz +def h7:=lD.eK +def n2:=kV.dK +def gs:=o0.eK +def kQ:=lO.a0 +def rk:=yB.eK +def gr:=rp.ag +def sO:=il.dK +def zl:=fk.jq +def gF:=qs.nR +def gG:=yv.b6 +def Bx:=lD.gR +def eE:=nC.jr +def BX:=i4.iI +def BU:=nC.aS +def ru:=i4.fy +def pU:=Av.nR +def mU:=kt.dJ +def ud:=sL.S +def gu:=cj.bl +def BH:=xm.eP +def y4:=il.bQ +def gU:=yv.cd +def k8:=rE.eK +def ok:=qs.eP +def ti:=fk.eb +def tU:=rE.bQ +def h3:=s5.ag +def tV:=i4.aS +def zu:=fk.eP +def tW:=qk.jr +def B3:=o0.bQ +def nA:=xm.ag +def pb:=nC.cd +def od:=s5.eP +def sK:=lO.aS +def BG:=il.ag +def AF:=lD.cz +def AI:=yv.aS +def Bu:=cZ.eN +def m8:=BI.S +def jA:=Af.eb +def sQ:=cZ.aI +def jV:=ow.bl +def rf:=s5.nR +def kp:=fI.bl +def ko:=i4.jr +def j2:=Cj.S +def kj:=rE.cz +def Ei:=cZ.cz +def tA:=cZ.pk +def sU:=qs.b2 +def zB:=kt.S +def wz:=o0.fj +def yG:=o0.S +def Fo:=xm.b2 +def Fz:=Cj.dJ +def yx:=rp.cd +def En:=cZ.eb +def mP:=fk.dK +def BD:=qs.ag +def v0:=il.dJ +def yN:=i4.dm +def yT:=fk.a0 +def BP:=il.eb +def Bw:=lD.ia +def By:=lO.cd +def q9:=lO.ec +def B9:=lO.ag +def qt:=Fx.jr +def pR:=Af.jq +def ES:=yB.fj +def E9:=cZ.S +def ER:=i4.hL +def Fu:=Av.b2 +def ET:=Af.S +def t7:=dS.bl +def sP:=rC.bI +def u1:=lD.fj +def sV:=cX.bl +def tN:=cl.bl +def uN:=ed.aI +def tM:=l6.aI +def E5:=Ek.eb +def sY:=qk.fy +def u3:=ed.aO +def EJ:=il.a0 +def sB:=Eq.S +def ul:=rE.fj +def ot:=jm.aI +def pe:=fc.bV +def d5:=n2.eK +def ng:=iP.e0 +def Cd:=fa.eV +def k4:=sO.cd +def uB:=kb.bl +def iT:=jm.jr +def i1:=rk.b6 +def jx:=iA.bl +def Au:=j0.bl +def g3:=kb.dK +def jp:=nx.aI +def hY:=kQ.ec +def j8:=h7.e0 +def qM:=jm.dm +def oP:=j7.bV +def ii:=y4.ag +def o8:=zl.S +def iu:=ru.b8 +def v1:=ud.bl +def i3:=fc.dJ +def BM:=Bx.bw +def lH:=pU.cz +def nm:=zu.cd +def jg:=hR.b8 +def Bv:=eT.aX +def o2:=Bu.ag +def EZ:=BU.ag +def BR:=ti.cQ +def jS:=mU.fy +def EF:=BX.eV +def rH:=kb.a0 +def yR:=AF.b8 +def uP:=tV.S +def wR:=Ei.ae +def li:=tW.nR +def kZ:=iA.ec +def kK:=ok.cd +def E8:=fa.cd +def zY:=fc.eb +def uq:=nx.jr +def mj:=iP.a0 +def EE:=BH.fj +def uQ:=Fo.cR +def l8:=B3.ag +def tF:=dF.a0 +def Fp:=BX.aj +def l4:=Fz.jr +def Aw:=kb.ag +def wQ:=sK.S +def nr:=En.bi +def nt:=iy.eK +def nb:=sQ.cz +def Fm:=fa.b6 +def nw:=nx.b6 +def Fg:=BH.S +def wE:=iy.dJ +def m2:=dF.jr +def Ep:=BU.b2 +def v6:=j0.aX +def nL:=iA.nR +def ED:=hR.cx +def zt:=eI.eb +def oi:=pb.bV +def BW:=zB.nR +def y1:=k8.bH +def n5:=iA.dK +def oN:=od.cd +def n4:=tU.ag +def pf:=iP.pk +def ox:=j0.eP +def oV:=nx.fy +def E0:=BD.fy +def yU:=jm.cd +def EY:=nA.e0 +def pg:=AI.S +def oZ:=dF.e0 +def Fl:=Bx.cd +def BQ:=yG.ec +def oL:=iy.aO +def oq:=yx.e0 +def Fa:=BG.cR +def Ew:=iP.aj +def Ch:=rf.cx +def qW:=hR.iF +def rl:=eI.ec +def Fe:=wz.aF +def Fh:=eT.bV +def rc:=BP.b8 +def Cr:=zl.cz +def BK:=Bw.cR +def pW:=dF.bP +def qh:=tA.cd +def BN:=BG.aX +def BO:=By.eK +def B1:=sU.cR +def rh:=fa.iF +def Ci:=ES.S +def rn:=yN.bg +def Ce:=E9.cR +def rj:=iy.eb +def Fi:=ER.ae +def qf:=hR.eb +def rm:=gr.dJ +def tv:=m8.dK +def ux:=gs.bH +def Er:=Fu.ag +def um:=yT.e0 +def uR:=ET.bV +def tn:=nx.dm +def tk:=j7.gR +def uJ:=gG.ec +def Eh:=hR.cd +def tE:=tU.dK +def s6:=j0.cx +def E4:=gs.aD +def Fd:=gF.e0 +def sD:=j7.aX +def Ey:=iP.eV +def sW:=eT.eP +def un:=AI.fj +def uy:=E5.ae +def tq:=iP.ag +def sZ:=B3.eP +def uO:=v0.S +def ut:=iP.b6 +def ts:=B9.bH +def ua:=EJ.ae +def m9:=ot.S +def g9:=pe.ag +def lK:=Cd.S +def i5:=uB.cd +def wk:=BM.e0 +def xl:=EZ.bi +def uE:=EF.b8 +def j3:=Bv.ag +def kL:=Au.cd +def yr:=BR.S +def tp:=E8.ae +def Cv:=qM.bg +def wI:=EE.bg +def l3:=Fp.ae +def ma:=yR.dm +def lU:=ng.cz +def uY:=oP.ag +def BY:=k4.S +def Cg:=Fm.bi +def mZ:=o8.ag +def mQ:=Fg.ae +def zJ:=Ep.aF +def nE:=zY.b8 +def nF:=ED.cd +def ou:=wR.ag +def n0:=E0.ag +def n7:=v1.b6 +def Cb:=Aw.jq +def oK:=EY.fj +def oJ:=Fl.bi +def Co:=Fa.cd +def qc:=uP.pk +def rd:=BW.a0 +def qw:=Ew.S +def qU:=Fe.cd +def rz:=Fh.ae +def qJ:=rH.e0 +def qP:=BQ.S +def re:=Fi.S +def qx:=wQ.eP +def rs:=uq.bV +def qg:=jx.b6 +def Fs:=o2.cd +def s0:=zt.aX +def tu:=ng.S +def tc:=nm.cx +def tO:=Er.aD +def tK:=Cr.b8 +def sN:=BK.b8 +def tg:=Eh.ae +def uw:=Cd.bQ +def sC:=iT.bV +def sT:=i1.eb +def uA:=E4.aF +def uh:=Fd.bi +def tl:=tF.cx +def s8:=j8.S +def sX:=uQ.S +def tw:=BN.aF +def te:=Ch.ae +def sH:=BO.eb +def uT:=yU.ec +def uW:=lH.a0 +def Eu:=Ey.ae +def tD:=y1.bi +def tZ:=Ci.cx +def tz:=v1.cd +def sJ:=v6.ag +def uf:=B1.S +def sR:=Au.aI +def t0:=Ce.bg +def uZ:=wE.aD +def uC:=jp.cz +def lW:=wk.S +def l9:=Cv.ag +def m1:=xl.b8 +def na:=yr.ag +def os:=BY.bV +def oX:=Cg.S +def oU:=uE.cd +def BS:=lK.ag +def qe:=m9.eb +def q7:=Cb.ag +def pZ:=wI.ag +def qX:=Co.S +def rq:=zJ.cd +def qn:=tp.e0 +def rK:=Fs.e0 +def s9:=m9.ag +def sE:=Eu.S +def El:=uY.cd +def pH:=BS.b8 +def tC:=El.cd +def zD a1 a2 a3:=DG a1 a2 a3 e_ +def zb a1 a2 a3 a4 a5 a6 a7:=dH a1 e_ a2 a3 e_ a4 a5 e_ a6 a7 e_ +def km a1:=Dm cD Gb a1 +def yC a1:=eU cD kD a1 +def zf a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=jL a1 a2 a3 a4 a2 a3 a5 a6 a7 a8 a9 a7 a10 +def oe a1 a2 a3 a4 a5 a6 a7:=dH a1 bd a2 a3 e_ a4 a5 e_ a6 a7 e_ +def y5 a1:=zj cD DA a1 +def Al a1 a2 a3 a4 a5 a6 a7 a8:=eX a1 a2 a3 a4 a2 a3 a5 a2 a3 a6 a7 a8 e_ +def zV a1 a2 a3 a4 a5 a6 a7 a8 a9:=eX a1 a2 a3 a4 a2 a3 a5 a2 a3 a6 a7 a8 a9 +def zI a1:=Dm cD A7 a1 +def Cq a1:=eU cD vR a1 +def zz a1 a2 a3 a4 a5 a6 a7 a8:=jL a1 a2 a3 e_ a2 a4 e_ a5 a6 e_ a7 a8 e_ +def AG a1:=eU cD FP a1 +def yy a1 a2 a3 a4 a5 a6:=eX a1 a2 a3 e_ a2 a4 e_ a2 a3 aP a5 a6 e_ +def zT a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 e_ a2 a3 a4 a5 a6 e_ a7 a8 e_ +def zX a1:=eU cF f7 a1 +def zd a1 a2 a3 a4 a5 a6 a7:=eX a1 a2 a3 e_ a4 a5 e_ a2 a3 aP a6 a7 e_ +def zs a1 a2 a3 a4 a5 a6 a7 a8 a9:=jL a1 a2 a3 a4 a2 a3 a5 a6 a7 e_ a8 a9 e_ +def wP a1:=eU cD hI a1 +def yA a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 e_ a4 a5 a6 a7 a8 e_ +def zF a1 a2 a3 a4 a5 a6 a7 a8 a9:=jL a1 a2 a3 e_ a4 a5 e_ a6 a7 e_ a8 a9 e_ +def zn a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 e_ a4 a5 a6 a7 a5 a8 +def BF a1 a2 a3 a4 a5 a6 a7:=eX a1 a2 a3 e_ a2 a4 e_ a2 a5 e_ a6 a7 e_ +def wl a1:=eU cF fB a1 +def Az a1 a2 a3 a4 a5 a6 a7 a8 a9:=dH a1 bd a2 a3 a4 a5 a6 a7 a8 a6 a9 +def AB a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=jL a1 a2 a3 a4 a2 a3 a5 a6 a7 e_ a8 a9 a10 +def zq a1 a2 a3 a4 a5 a6 a7 a8:=eX a1 a2 a3 e_ a4 a5 b1 a2 a3 aP a6 a7 a8 +def Ay a1 a2 a3 a4 a5 a6 a7 a8 a9:=dH a1 e_ a2 a3 a4 a5 a6 a7 a8 a6 a9 +def Cf a1:=eU cF nP a1 +def zv a1:=eU cF dE a1 +def pI a1 a2 a3 a4 a5 a6 a7 a8:=eX a1 a2 a3 a4 a2 a3 a5 a2 a3 a6 a7 a8 bd +def wp a1:=eU cD dE a1 +def q0 a1:=Dm cD DA a1 +def Ca a1:=eU cD FW a1 +def qj a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 e_ a2 a3 e_ a4 a5 a6 a7 a5 a8 +def zO a1 a2 a3 a4 a5 a6 a7 a8 a9:=eX a1 a2 a3 e_ a4 a5 a6 a2 a3 aP a7 a8 a9 +def E1 a1 a2 a3 a4:=F7 a1 a2 a3 a4 e_ +def zo a1:=zj cD Ga a1 +def w4 a1:=eU cD fB a1 +def m0 a1 a2 a3 a4 a5 a6 a7:=dH a1 b1 a2 a3 e_ a4 a5 e_ a6 a7 e_ +def oh a1 a2 a3 a4 a5 a6 a7 a8 a9:=dH a1 bd a2 a3 a4 a5 a6 a7 a8 a9 e_ +def w7 a1 a2 a3 a4 a5 a6 a7 a8:=eX a1 a2 a3 e_ a4 a5 a6 a2 a3 aP a7 a8 e_ +def uM a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11:=jL a1 a2 a3 e_ a4 a5 a6 a7 a8 a9 a10 a8 a11 +def oO a1 a2 a3 a4 a5 a6 a7:=dH a1 bd a2 a3 e_ a4 a5 e_ a6 a7 bd +def pO a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 e_ a4 a5 a6 a7 a8 bd +def Ff a1:=eU cD mD a1 +def lB a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 a4 a5 a6 e_ a7 a8 e_ +def BC a1:=eU cD f7 a1 +def ro a1:=zj cD Gb a1 +def oB a1 a2 a3 a4 a5 a6 a7 a8 a9:=jL a1 a2 a3 e_ a2 a4 e_ a5 a6 a7 a8 a6 a9 +def oS a1 a2 a3 a4 a5 a6 a7 a8 a9:=jL a1 a2 a3 e_ a2 a4 e_ a5 a6 e_ a7 a8 a9 +def oD a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 bd a4 a5 a6 a7 a5 a8 +def nI a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=jL a1 a2 a3 e_ a4 a5 e_ a6 a7 a8 a9 a7 a10 +def oH a1 a2 a3 a4 a5:=FF a1 aP a2 a3 e_ a4 a5 e_ +def Fb a1:=Dm cD Ga a1 +def jo a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=jL a1 a2 a3 e_ a4 a5 e_ a6 a7 e_ a8 a9 a10 +def wB a1 a2 a3 a4 a5 a6 a7 a8:=eX a1 a2 a3 e_ a4 a5 e_ a2 a3 aP a6 a7 a8 +def jB a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11:=jL a1 a2 a3 e_ a4 a5 a6 a7 a8 a9 a10 a11 e_ +def Ck a1:=eU cF vR a1 +def Aj a1:=eU cD nP a1 +def zL a1 a2 a3 a4 a5 a6 a7:=eX a1 a2 a3 e_ a4 a5 b1 a2 a3 aP a6 a7 e_ +def lz a1:=eU cF kD a1 +def lL a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11:=eX a1 a2 a3 e_ a4 a5 a6 a7 a8 e_ a9 a10 a11 +def wH a1 a2 a3 a4 a5 a6 a7 a8 a9:=eX a1 a2 a3 e_ a4 a5 e_ a6 a7 e_ a8 a9 e_ +def lZ a1 a2 a3 a4 a5 a6 a7:=eX a1 a2 a3 e_ a2 a4 e_ a2 a3 aP a5 a6 a7 +def l5 a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 e_ a2 a3 e_ a4 a5 e_ a6 a7 a8 +def EU a1:=eU cD vk a1 +def Fw a1:=eU cD Dq a1 +def Et a1:=zj cD A7 a1 +def pd a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=eX a1 a2 a3 e_ a4 a5 a6 a7 a8 e_ a9 a10 bd +def ov a1 a2 a3 a4 a5 a6 a7 a8:=eX a1 a2 a3 e_ a4 a5 a6 a2 a3 aP a7 a5 a8 +def pj a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11:=jL a1 a2 a3 e_ a4 a5 a6 a7 a8 e_ a9 a10 a11 +def rx a1 a2 a3 a4 a5 a6 a7:=dH a1 e_ a2 a3 e_ a4 a5 bd a6 a7 e_ +def EI a1:=eU cD Ev a1 +def qK a1 a2 a3 a4 a5 a6 a7:=dH a1 e_ a2 a3 e_ a4 a5 e_ a6 a7 aP +def rL a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 e_ a2 a3 a4 a5 a6 e_ a7 a3 a8 +def qa a1 a2 a3 a4:=rP a1 iC a2 a3 (aM cD dE e_) a4 (aM cF dE e_) b1 +def Eo a1 a2 a3 a4 a5 a6 a7 a8:=eX a1 a2 a3 e_ a4 a5 e_ a2 a6 e_ a7 a8 e_ +def q1 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=jL a1 a2 a3 e_ a4 a5 a6 a7 a5 a8 a9 a5 a10 +def qN a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 aP a4 a5 a6 a7 a5 a8 +def qS a1 a2 a3 a4 a5 a6 a7 a8:=jL a1 a2 a3 a4 a2 a3 a5 a6 a7 a4 a8 a7 a5 +def qz a1:=eU cF hI a1 +def pV a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=jL a1 a2 a3 e_ a4 a5 a6 a7 a8 e_ a9 a10 e_ +def qo a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 a4 a5 a6 a7 a8 a6 a4 +def Es a1:=eU cF Ft a1 +def pN a1 a2 a3 a4 a5 a6 a7 a8:=eX a1 a2 a3 a4 a2 a3 a5 a2 a3 a6 a7 a3 a8 +def tJ a1 a2 a3 a4 a5 a6 a7 a8 a9:=jL a1 a2 a3 a4 a2 a3 a5 a6 a7 e_ a8 a9 aP +def tR a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 a4 a5 a6 e_ a7 a3 a8 +def uS a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 bd a4 a5 a6 a7 a8 aP +def tB a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 a4 a5 a3 a6 a7 a3 a8 +def sG a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=eX a1 a2 a3 e_ a4 a5 a6 a7 a8 e_ a9 a5 a10 +def xu a1 a2 a3 a4 a5 a6 a7 a8 a9:=jL a1 a2 a3 a4 a2 a3 a5 a6 a3 a7 a8 a3 a9 +def w9 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=jL a1 a2 a3 e_ a4 a5 e_ a6 a7 a8 a9 a10 e_ +def wJ a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=jL a1 a2 a3 e_ a4 a5 a6 a7 a8 e_ a9 a10 aP +def wx a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 bd a4 a5 a6 a7 a8 e_ +def wA a1 a2 a3 a4 a5 a6 a7 a8:=eX a1 a2 a3 e_ a4 a5 a6 a2 a3 aP a7 a8 bd +def yD a1 a2 a3 a4 a5 a6 a7:=dH a1 bd a2 a3 e_ a4 a5 e_ a6 a7 aP +def zg a1 a2 a3 a4 a5 a6 a7 a8 a9:=jL a1 a2 a3 e_ a4 a5 bd a6 a7 e_ a8 a9 e_ +def yF a1 a2 a3 a4 a5 a6 a7 a8 a9:=eX a1 a2 a3 e_ a4 a5 a6 a2 a7 e_ a8 a9 e_ +def yu a1 a2 a3 a4 a5 a6 a7:=eX a1 a2 a3 e_ a2 a4 e_ a2 a5 e_ a6 a7 bd +def yq a1 a2 a3 a4 a5 a6 a7:=dH a1 e_ a2 a3 bd a4 a5 e_ a6 a7 e_ +def zS a1 a2 a3 a4 a5 a6 a7 a8 a9:=jL a1 a2 a3 a4 a2 a3 a5 a6 a7 e_ a8 a3 a9 +def At a1 a2 a3 a4:=rP a1 iC a2 a3 (aM cD nP e_) a4 (aM cF nP e_) e_ +def yw a1 a2 a3:=rP a1 iC xY a2 (aM cD f7 e_) a3 (aM cF f7 e_) b1 +def ac a1 a2 a3:=lf (zD a1 a2 a3) +def al a1:=lf (km a1) +def aG a1:=lf (y5 a1) +def aK a1:=lf (yC a1) +def aT a1 a2 a3 a4 a5 a6 a7:=lf (zb a1 a2 a3 a4 a5 a6 a7) +def bk a1:=lf (Cq a1) +def bC a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=lf (zf a1 a2 a3 a4 a5 a6 a7 a8 a9 a10) +def bM a1 a2 a3 a4 a5 a6 a7 a8:=lf (Al a1 a2 a3 a4 a5 a6 a7 a8) +def bZ a1 a2 a3 a4 a5 a6 a7 a8 a9:=lf (zV a1 a2 a3 a4 a5 a6 a7 a8 a9) +def co a1:=lf (wp a1) +def cp a1 a2 a3 a4 a5 a6:=lf (yy a1 a2 a3 a4 a5 a6) +def dc a1:=lf (wl a1) +def dd a1 a2 a3 a4:=lf (E1 a1 a2 a3 a4) +def d2 a1:=lf (Cf a1) +def em a1 a2 a3 a4 a5 a6 a7 a8:=lf (zz a1 a2 a3 a4 a5 a6 a7 a8) +def eo a1 a2 a3 a4 a5 a6 a7 a8:=lf (yA a1 a2 a3 a4 a5 a6 a7 a8) +def e8 a1 a2 a3 a4 a5 a6 a7 a8:=lf (pI a1 a2 a3 a4 a5 a6 a7 a8) +def ff a1 a2 a3 a4 a5 a6 a7:=lf (zd a1 a2 a3 a4 a5 a6 a7) +def fb a1 a2 a3:=lf (eU a1 a2 a3) +def e5 a1 a2 a3 a4 a5 a6 a7 a8:=lf (qj a1 a2 a3 a4 a5 a6 a7 a8) +def fW a1:=lf (Ff a1) +def fJ a1:=lf (zI a1) +def g4 a1 a2 a3 a4 a5 a6 a7:=lf (oe a1 a2 a3 a4 a5 a6 a7) +def g1 a1 a2 a3 a4 a5 a6 a7 a8:=lf (zq a1 a2 a3 a4 a5 a6 a7 a8) +def hZ a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13:=lf (jL a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13) +def hT a1 a2 a3 a4 a5 a6 a7 a8 a9:=lf (Az a1 a2 a3 a4 a5 a6 a7 a8 a9) +def h6 a1 a2 a3 a4 a5 a6 a7 a8 a9:=lf (oh a1 a2 a3 a4 a5 a6 a7 a8 a9) +def ij a1 a2 a3 a4 a5 a6 a7 a8 a9:=lf (Ay a1 a2 a3 a4 a5 a6 a7 a8 a9) +def iR a1 a2 a3 a4 a5 a6 a7 a8:=lf (zT a1 a2 a3 a4 a5 a6 a7 a8) +def i7 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=lf (AB a1 a2 a3 a4 a5 a6 a7 a8 a9 a10) +def iO a1 a2 a3 a4:=lf (DG a1 a2 a3 a4) +def iM a1:=lf (w4 a1) +def iL a1 a2 a3 a4 a5 a6 a7 a8 a9:=lf (zs a1 a2 a3 a4 a5 a6 a7 a8 a9) +def ji a1:=lf (Fb a1) +def kf a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11:=lf (dH a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11) +def lb a1:=lf (AG a1) +def lc a1 a2 a3 a4 a5 a6 a7 a8 a9:=lf (zF a1 a2 a3 a4 a5 a6 a7 a8 a9) +def lg a1 a2 a3 a4 a5 a6 a7 a8 a9:=lf (zO a1 a2 a3 a4 a5 a6 a7 a8 a9) +def la a1 a2 a3 a4 a5 a6 a7:=lf (BF a1 a2 a3 a4 a5 a6 a7) +def ms a1:=lf (BC a1) +def ml a1:=lf (zX a1) +def ly a1:=lf (Aj a1) +def mg a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11:=lf (uM a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11) +def mb a1 a2 a3 a4 a5 a6 a7 a8:=lf (zn a1 a2 a3 a4 a5 a6 a7 a8) +def nz a1 a2 a3 a4 a5 a6 a7 a8 a9:=lf (oB a1 a2 a3 a4 a5 a6 a7 a8 a9) +def n3 a1:=lf (Et a1) +def o9 a1:=lf (Ca a1) +def qY a1 a2 a3 a4 a5:=lf (F7 a1 a2 a3 a4 a5) +def pL a1 a2 a3 a4 a5 a6 a7 a8:=lf (pO a1 a2 a3 a4 a5 a6 a7 a8) +def ql a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=lf (nI a1 a2 a3 a4 a5 a6 a7 a8 a9 a10) +def J a1 a2 a3 l:=aZ (zD a1 a2 a3) l +def aW a1 l:=aZ (km a1) l +def bA a1 a2 a3 a4 a5 a6 a7 l:=aZ (zb a1 a2 a3 a4 a5 a6 a7) l +def bD a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 l:=aZ (zf a1 a2 a3 a4 a5 a6 a7 a8 a9 a10) l +def bT a1 a2 a3 a4 l:=aZ (DG a1 a2 a3 a4) l +def ck a1 l:=aZ (y5 a1) l +def de a1 l:=aZ (yC a1) l +def du a1 a2 a3 a4 a5 a6 a7 a8 a9 l:=aZ (zV a1 a2 a3 a4 a5 a6 a7 a8 a9) l +def dG a1 l:=aZ (zX a1) l +def ek a1 a2 a3 a4 a5 a6 a7 a8 l:=aZ (zT a1 a2 a3 a4 a5 a6 a7 a8) l +def en a1 l:=aZ (Cq a1) l +def ej a1 a2 a3 a4 a5 a6 a7 a8 a9 l:=aZ (zs a1 a2 a3 a4 a5 a6 a7 a8 a9) l +def eG a1 a2 a3 a4 a5 a6 a7 a8 l:=aZ (Al a1 a2 a3 a4 a5 a6 a7 a8) l +def e9 a1 a2 a3 a4 a5 a6 a7 a8 l:=aZ (zz a1 a2 a3 a4 a5 a6 a7 a8) l +def fh a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 l:=aZ (dH a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11) l +def fS a1 a2 a3 a4 a5 a6 a7 a8 l:=aZ (zn a1 a2 a3 a4 a5 a6 a7 a8) l +def fO a1 a2 a3 a4 a5 a6 a7 a8 l:=aZ (yA a1 a2 a3 a4 a5 a6 a7 a8) l +def fV a1 a2 a3 a4 a5 a6 a7 l:=aZ (oe a1 a2 a3 a4 a5 a6 a7) l +def gz a1 a2 a3 a4 a5 a6 a7 a8 a9 l:=aZ (Az a1 a2 a3 a4 a5 a6 a7 a8 a9) l +def gy a1 l:=aZ (zI a1) l +def gV a1 a2 a3 a4 a5 a6 a7 l:=aZ (zd a1 a2 a3 a4 a5 a6 a7) l +def gW a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 l:=aZ (AB a1 a2 a3 a4 a5 a6 a7 a8 a9 a10) l +def hX a1 a2 a3 a4 a5 a6 a7 a8 l:=aZ (zq a1 a2 a3 a4 a5 a6 a7 a8) l +def iw a1 a2 a3 a4 a5 a6 a7 a8 a9 l:=aZ (Ay a1 a2 a3 a4 a5 a6 a7 a8 a9) l +def ix a1 l:=aZ (Cf a1) l +def ir a1 a2 a3 a4 a5 a6 a7 a8 a9 l:=aZ (zF a1 a2 a3 a4 a5 a6 a7 a8 a9) l +def jz a1 l:=aZ (wl a1) l +def jW a1 a2 a3 a4 a5 a6 a7 a8 a9 l:=aZ (zO a1 a2 a3 a4 a5 a6 a7 a8 a9) l +def j4 a1 l:=aZ (ro a1) l +def kh a1 a2 a3 a4 a5 a6 l:=aZ (yy a1 a2 a3 a4 a5 a6) l +def kN a1 a2 a3 a4 a5 a6 a7 a8 l:=aZ (pI a1 a2 a3 a4 a5 a6 a7 a8) l +def k3 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 l:=aZ (jL a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13) l +def md a1 a2 a3 a4 a5 a6 a7 a8 l:=aZ (w7 a1 a2 a3 a4 a5 a6 a7 a8) l +def mR a1 a2 a3 a4 a5 a6 a7 a8 l:=aZ (pO a1 a2 a3 a4 a5 a6 a7 a8) l +def m5 a1 l:=aZ (w4 a1) l +def ns a1 a2 a3 a4 a5 a6 a7 l:=aZ (oO a1 a2 a3 a4 a5 a6 a7) l +def nc a1 a2 a3 a4 a5 a6 a7 l:=aZ (zL a1 a2 a3 a4 a5 a6 a7) l +def o7 a1 a2 a3 a4 a5 a6 a7 a8 a9 l:=aZ (oS a1 a2 a3 a4 a5 a6 a7 a8 a9) l +def oc a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 l:=aZ (uM a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11) l +def N a1 a2 a3 l r:=nd (zD a1 a2 a3) l r +def az a1 a2 a3 a4 a5 a6 a7 l r:=nd (oe a1 a2 a3 a4 a5 a6 a7) l r +def aJ a1 a2 a3 a4 a5 a6 a7 l r:=nd (zb a1 a2 a3 a4 a5 a6 a7) l r +def aR a1 l r:=nd (wP a1) l r +def bc a1 l r:=nd (AG a1) l r +def bU a1 l r:=nd (zI a1) l r +def bS a1 l r:=nd (zv a1) l r +def cb a1 a2 a3 a4 a5 a6 a7 l r:=nd (BF a1 a2 a3 a4 a5 a6 a7) l r +def cu a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (Al a1 a2 a3 a4 a5 a6 a7 a8) l r +def c3 a1 l r:=nd (q0 a1) l r +def dQ a1 a2 a3 a4 a5 a6 a7 a8 a9 l r:=nd (zF a1 a2 a3 a4 a5 a6 a7 a8 a9) l r +def dR a1 l r:=nd (Ca a1) l r +def d3 a1 l r:=nd (zo a1) l r +def ef a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 l r:=nd (zf a1 a2 a3 a4 a5 a6 a7 a8 a9 a10) l r +def ei a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (zz a1 a2 a3 a4 a5 a6 a7 a8) l r +def eg a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (zT a1 a2 a3 a4 a5 a6 a7 a8) l r +def eL a1 l r:=nd (zX a1) l r +def eR a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 l r:=nd (dH a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11) l r +def eJ a1 l r:=nd (yC a1) l r +def e2 a1 a2 a3 a4 l r:=nd (DG a1 a2 a3 a4) l r +def fR a1 a2 a3 a4 a5 a6 a7 l r:=nd (zd a1 a2 a3 a4 a5 a6 a7) l r +def gA a1 a2 a3 a4 a5 a6 a7 a8 a9 l r:=nd (zV a1 a2 a3 a4 a5 a6 a7 a8 a9) l r +def gp a1 a2 a3 a4 a5 a6 a7 a8 a9 l r:=nd (zs a1 a2 a3 a4 a5 a6 a7 a8 a9) l r +def gI a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (zn a1 a2 a3 a4 a5 a6 a7 a8) l r +def hi a1 a2 a3 a4 a5 a6 l r:=nd (yy a1 a2 a3 a4 a5 a6) l r +def hS a1 a2 a3 a4 a5 a6 a7 l r:=nd (m0 a1 a2 a3 a4 a5 a6 a7) l r +def im a1 l r:=nd (km a1) l r +def ku a1 l r:=nd (Ck a1) l r +def lj a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 l r:=nd (jL a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13) l r +def k2 a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (lB a1 a2 a3 a4 a5 a6 a7 a8) l r +def lQ a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (yA a1 a2 a3 a4 a5 a6 a7 a8) l r +def lE a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (wB a1 a2 a3 a4 a5 a6 a7 a8) l r +def mi a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 l r:=nd (eX a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13) l r +def lY a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (w7 a1 a2 a3 a4 a5 a6 a7 a8) l r +def lC a1 a2 a3 l r:=nd (eU a1 a2 a3) l r +def m6 a1 l r:=nd (EU a1) l r +def mV a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 l r:=nd (AB a1 a2 a3 a4 a5 a6 a7 a8 a9 a10) l r +def nl a1 l r:=nd (Fw a1) l r +def nv a1 a2 a3 a4 a5 a6 a7 a8 a9 l r:=nd (Ay a1 a2 a3 a4 a5 a6 a7 a8 a9) l r +def op a1 l r:=nd (BC a1) l r +def o1 a1 a2 a3 a4 a5 a6 a7 a8 a9 l r:=nd (Az a1 a2 a3 a4 a5 a6 a7 a8 a9) l r +def oT a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (oD a1 a2 a3 a4 a5 a6 a7 a8) l r +def ol a1 a2 a3 a4 a5 a6 a7 a8 a9 l r:=nd (zO a1 a2 a3 a4 a5 a6 a7 a8 a9) l r +def ph a1 a2 a3 a4 a5 l r:=nd (oH a1 a2 a3 a4 a5) l r +def qR a1 l r:=nd (EI a1) l r +def pK a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (Eo a1 a2 a3 a4 a5 a6 a7 a8) l r +def qq a1 a2 a3 a4 a5 a6 a7 a8 a9 l r:=nd (wH a1 a2 a3 a4 a5 a6 a7 a8 a9) l r +def ry a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (qj a1 a2 a3 a4 a5 a6 a7 a8) l r +def qu a1 l r:=nd (Es a1) l r +def qv a1 a2 a3 a4 a5 a6 a7 l r:=nd (oO a1 a2 a3 a4 a5 a6 a7) l r +def qd a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (zq a1 a2 a3 a4 a5 a6 a7 a8) l r +def pP a1 l r:=nd (y5 a1) l r +def Ez : ab dp:=(op gx (d3 cl (eL aP.Fy.aF (cb i3.b8 49 z3.f4 z3.fE z3.fD 1 z3.fu (az tv.jq 4 z4.eB 87 z6.eA 83 z7.fu (N gS.i0.bo 69 cy.fu (iR m1.b8 87 bN b1.g8 1 dI.fo 2 dI.fU) (ji iD)) (e9 hY.cQ.cQ 60 da.f6 da.fP 49 da.gK 46 da.fp (bM kL.fH.bw 178 ap aE.eC.d6 K.eC.d6 L.eC.d6 19 dL.er))) (bU bO.bu (J aY.iG.hU.gT 83 dy.gd (em ng.cx.fj.cQ 145 ds.fm vb 88 ds.gm 84 vg)) (du rp.dK.cQ.fj.S 171 zm au X ad 92 mG aN (bk jV)))) (bc ed.eV (nd (tJ gs.aI.gZ 156 an cg.iV b3.iV 72 z9.fz 60 z7.p7) (N b1.bg.pT.hK.dh 57 ct.gK (aG jV.fQ) (lb dO.S)) (iw pU.dJ.cR.dm.aX 89 mG L 172 cV.er ar 168 ao (bk jk))) (hi tV.ia.aj 52 B4 cM.fm 95 uz (aW nK.aD (n3 bq.ae.bV.aS)) (J i6.iv.bm.dx 164 c8.eA (lf (pd nr.bV 24 dq.fK 100 cT.p7 H 26 dq.fN 54 dq.f4)))))) (N ed.eV.dK.fy 139 z2.f6 (bU iX (gA tv.it 122 AA jv dk e6 103 se lR (N iE.yb.hU.bo 189 cV.gk (d2 pX.vv.bm) (dc aV)) (fh na e_ 64 ch jH 1 di.fA e_ 2 cB.gn bd (bC os.b2.b2.aj 199 ap cX.bP.bP.av cl.bP.bP.av 145 ey cg.bQ.cv 141 b3.bQ.cv))) (bc pQ (bD ii.aX.aj 91 fe bF bE 74 zr K 70 L (ij dF.jq.b2.ae.cQ 70 wK aH 176 u5 oR 172 oy)) (e9 s0.cs 75 cI.hH cI.gL 184 cI.p9 180 cI.p8 (aT nr.dJ 11 cT.ev 1 cT.eZ 2 cT.fo)))) (az mj 38 mF 115 iq 14 z6.gK (N FS.G2.iI.cx 282 dn.f6 (mR oi.b2.b2 4 cy.e1 65 ct.p0 H 61 hJ (co j.v9.bl.ec)) (aZ (rx j8.fH.dm 11 c7.p9 1 c7.fE 2 cN.gk) (ms jT))) (ef tu.aj 125 et aY aQ 66 hC ak 62 af (jW tc.aS 11 dP.p6 83 c9.p5 aE 94 fe e_.ja (bM lW.ag.bw 113 bv ob.aO iY.jQ mW.jQ 19 dl.eS)) (de K.cJ.kY.ib.fr (cp jA.eb.ag.iI 113 dY.ev dY.eZ 272 dY.fT)))))) (bc cC (cb ux.bw 54 z1.fq z1.gb z1.gd 19 z1.fM (bS nJ.bm (cu nt.dm.bw 93 se g5 gq k6 19 z7.fx (im e_.e0.mX (aK bt.io) (lf (rP rv.dJ.jr wN Bq 28 (aM cD mD e_) 105 (aM cF mD e_) aP))) (fS oi.b2.a0.ae 272 c7.f4 136 sg ar 132 ao (bZ o8.eP.cd.ag.bg 186 ap dO.nh.fj.bI cj.nh.fj.bI dS.nh.fj.bI 200 wZ bt))) (ef gs.iI.bV.aj 139 pA cX cl 88 fG jt.aD 84 gX.aD (kN qc.S 86 hJ ci aV cC 111 yg (bM rd.eP.aF 180 b7 fI.ja.ae ra.ja.ae s7.ja.ae 1 ds.f5)) (mR tO.bQ.b2 4 cI.fE 148 cS.ex H 144 l0 (ac aN.iG.eD.aI 286 cT.eS)))) (c3 bF.aF (o1 qw.nR.S 110 an vS.ce 116 c4 uU 112 aU.bu (aZ (yD jg.bp 63 pp 126 pz 122 Ai) (aK kO.io)) (aZ (yD i5.dK.ja 4 da.fN 47 da.fK 44 va) (nz Ch.S 57 cL.f4 cL.fE 87 mH aV 83 cC))) (aJ um.bQ 52 cq.fu 17 cq.gO 61 cq.ev (o7 nb.gR.bw 270 dP.fm dP.gH 17 dP.er 218 hC j.ae (aG pX.eK.ce)) (fO nr.cz.S 108 we 70 c8.ex H 66 cN.f4 (lf (rP eE sc Bt 24 (aM cD dE e_) 65 (aM cF dE e_) b1)))))) (c3 m3 (qR ah (eR qW.S.a0 e_ 66 z8.fo e_ 107 an uI.mv 14 z8.eZ aP (fR oi.b2.bl 33 vi 32 cB.fz 1 cB.gl (ac e_.aO.bP.dt 334 dr.fz) (qY cZ.b6 aB 71 rQ au)) (J ci.xF.r4.eF 171 c7.fM (bk kn))) (oT s5.b2.cR.S 95 cG.e7 57 po X 53 ad (bA k4.cx.dJ 11 dj.fK 1 dj.fN 2 dj.ex (iR oX.ag.ag 110 bv e_.aO.aO 1 dT.p5 2 dT.p4)) (J q8.aO.bP.eV.dK.fy 134 c8.fT (ac e3.eC.bu.bz 223 dq.eY)))) (gp o0.gR.bw 42 kA bj br 17 z6.gm 361 z6.p1 (ei fk.ag.aF.bw 52 dn.fq w3 17 dn.gn 129 dn.p4 (aZ (zg ou 226 dP.p0 54 wG 1 dy.gO 2 dy.ev) (ml nk.aI.cH)) (ek rl.bV.aF.b8 121 lJ kW 1 cN.f9 2 cN.ga (bk jX))) (ef q9.bw.e0.ae 64 sa cX cl 169 cP.p1 K 165 L (aZ (oD m1.jr 4 cA.fq 87 bN H.dK.bI 83 j.hL.bI) (bM lW.fH 117 bv o3.aO hW.bQ.aO ld.bQ.aO 1 dL.fp)) (e9 B9.aS.cQ.cs 245 dI.eW dI.eH 417 dI.f8 413 dI.fz (lb qL.bg))))))) +def Fv : ab dp:=(hS gU.aX 122 d1 89 FE 194 Gj (nd (rP qt sc Bq 28 (aM cD hI e_) 105 (aM cF hI e_) aP) (cu eT.gC 252 iJ dO cj dS 56 z1.fK (nd (oB hR.cz.S 128 z3.gl z3.e1 55 dX X 51 ad) (aJ nt.dm.dm 11 z7.fN 1 z7.ex 2 z7.fL (nd (lz uI.bl) (bk oy.ae.eh) (ji kr)) (mR jg.aS.aF.aS 4 da.er 501 mJ K.cR 134 c7.fU (ac ob.pD.eP.aI.db 109 dL.gd))) (nd (oS k8.dJ.bw 50 c5.fA wn 17 c5.fK 509 iz kJ.sx) (aW kS.nS (co H.kB.aF.ec)) (ix mE.pl.bm (lc hY.bQ 23 cU.gl 24 cU.e1 17 cU.gk 115 cU.eA)))) (ei ru.iF.aj 124 z5.f8 z5.fz 69 z5.gl 65 z5.e1 (nd (ov qU.aj 23 z9.ex 138 c4 au.eN 112 kc) (J X.cH.hU.gT 172 cV.fo (aK ar.cJ.kY.ib.fr)) (ek ok.aS.ae.ag 65 pp jN 1 cA.p5 2 cA.p4 (aT y1.dm 11 dM.fL 1 dM.gg 2 dM.eY))) (N gN.pT.hK.dh 55 cM.eH (k3 ok.aS.ae.a0 371 ky fX 65 dP.fD e_ 146 pz aE 14 da.eW aP (bZ tO.bQ.ho 75 yk oA ue L.Em 164 l0 kc)) (en h9.bg.hK (bk nG.gY))))) (eL K (cb rf.it 148 z4.fz z4.gl z4.e1 57 z4.gk (m6 gN.S (N L.bu.dt 334 cV.p7 (pL rf.ec.aI.ja 4 dI.p4 145 c0.fi H 141 c0.er) (lf (q0 eQ.bI))) (k3 De.fj.cx.bi.cx.aD 185 cN.ez e_ 587 cN.gg e_ 128 iz dN.fr.iH 62 di.f8 j (aT lH.eb.ag 55 cO.ga 1 cO.gj 2 cO.f5))) (nd (pO mP.aO.b2 4 cG.eS 92 cG.fi H 88 v8) (aZ (qK zl.cx.bp 138 dj.fi 60 dj.eW 56 di.gK) (bM jg.cd.gR.ag 89 iK aV.wj nJ.wj qI.wj 1 dT.fT)) (aZ (lL li.aj.cR.bV 24 c8.fD 207 cI.fU H 26 c8.fu 69 rY aN) (al ke)))) (d3 lq (eJ sI.gY (J rA.aI.hV 72 cB.fE (eo kZ.dJ.bp 68 dr.f8 286 u5 e_.bP 53 ds.p2)) (ck mq.sx.ni (fW g7))) (aJ i5.dJ 11 cP.fp 1 cP.ft 2 cP.f4 (ck ed.gP.ni (al ah.rF.bH.bH)) (bA uR.aF.bi.b8 77 c7.ez 1 c7.fK 2 c7.fN (co aQ.bg.eK)))))) (aR bj.eK (aR gu (bU uc (lQ nt.iI.a0 97 z8.fE 134 zR aE 14 z8.fD (op oG.xF (hZ g9.aS.a0 87 iK dN.wj 87 iK ie.wj 158 et dV.bP 14 da.p9 aP) (al e4)) (iw kK.S.cQ 69 iK aH 132 et oR 128 oy (lf (tR mZ.bH.b6.aX 186 ap uc.av 29 dL.gL 206 uG.av)))) (az tn.bg 34 c5.p6 47 po 96 cG.fu (bA nb.eK.b8 57 c9.eS 1 c9.fm 2 c9.gH (al kO.kv.aX)) (ir jS.aS.ag.aS 11 cI.fK 214 c8.eB 123 cI.fN 119 cI.ex (aK ci.bp)))) (bS oa.bu (gI rz.ag.aS 4 z9.eS 108 an uH.b0 104 oW.b0 (bA tk.ik 11 ct.f5 1 ct.hH 2 ct.gL (fJ aA.ib.iG.eC)) (J aN.aI.bV.fd 159 c7.gm (e8 BP.S 68 zw au X ad 49 dM.eA))) (nd (jo uB.aI.aD 177 cP.eB 420 cy.fC 143 cP.fT 60 cM.eW j) (J bt.hL.aI.hV 73 dP.f9 (bC oU.cs 87 ch qG.aC oG.aC 122 bv mY.aO 118 iQ.aO)) (e9 n5.e0.cJ.ag.bw 112 c7.fi c7.eW 17 c7.eH 193 c7.f8 (ac iS.bi.hL.dx 156 dY.f6))))) (N sI.dh 53 z2.ga (cb nw.ag.bw 91 z4.p4 z4.p3 z4.p2 19 z4.p1 (ef iy.gR.cd.bi.aD 106 nX oa om 87 pv fX 83 d8 (dQ Cg.bQ 82 cB.eS 220 dj.fz 17 cB.fm 59 cB.gH (hT fc.cz.dK.S.S 178 b7 bt.nh.ae 77 u6 X 73 ad) (dd yG aB 71 b7)) (m5 iQ.bu (bM mU.dm.bw 47 rO aA aB dD 19 dM.e1))) (gI rc.ae 91 cG.er 61 xn K 57 L (bT ki.yd.hM.bu.dK.fy 112 iB ki.Eb.kB (h6 i5.aj.b2.a0 195 jK bq 169 mK gf 14 c6.e1)) (du eT.cd.e0.b8.bg 131 iq H.kY.bg.jd mT.bg.jd rB.bg.jd 80 ep i6.pD.n1 (ff jS.ag.bw 157 dq.fz 314 dq.p9 19 dq.gl)))) (bc H.ec (lE gF.gR.aS 11 dn.p2 144 pA 71 fG fY.bw (gV wI.bl 84 dy.eB 228 di.eu 1 cy.gL (bM i4.b6.aj.cQ.g6 134 w2 ah bK ea 1 dT.fM)) (gz mQ.cs 73 ca t7 92 bN m4.bI 88 sP (kf kt.cx.bp e_ 51 tH bd 88 xa K 84 xa L))) (az rk.pk.ae.aj 60 sa 165 v7 161 cP.p1 (bT jD.kY.sx.cJ.aO.aO 500 tj cl (bZ kL.bV.b2.aj 178 ap oC.hL.bI ty.hL.bI L.sk.hL.bI 128 ve aw)) (fS uJ.e0.bg.S 64 cN.gj 126 lJ cj 122 dS (lf (rP eE iC xY 24 (aM cD dE e_) 65 (aM cF dE e_) b1)))))))) +def Fn : ab dp:=(nd (kH L) (bc d0 (aR j5.bP (aR tP (nd (uM gF.aX.aC 11 z7.gl 77 kA hj.gP 53 mc aE.fF 49 aP.cH) (nd (jB jg.aX.aC 11 cy.eB 383 ap kP.CI 364 iB lq.bH.kB 122 cy.fT) (hZ tK.cd.iF 11 dI.gn e_ 147 dI.eA e_ 120 hD dN.aO 17 cN.eB bd) (ji m3)) (bT d8.kv.pT.hK.dh 305 ky d8 (lf (w7 eI.b8.dm.cJ.ag.bw 135 dL.eW 438 ap iN.eK.av 19 dL.eH)))) (bS gu (bT e_.bi.r4.Gp.bm.bz 146 ep bt.cJ.ja (eo oN.dJ.S.a0 91 ds.gO 282 yK aE 14 c6.gK)) (fO d5.eN.S.a0 74 cS.gO 88 Aa aE 14 cS.f5 (e8 rk.cd.dB 133 r9 nj g2 kg 64 cU.f4)))) (nd (kH aQ) (bS h9.EQ.FI (J oj.cH.hU.gT 365 cV.fP (d2 mh.vv.bm)) (ck ed.ec.aC (aT cZ.ik 11 dM.er 1 dM.eB 2 dM.fT))) (N e3.aO.hU.bo 548 c9.fi (aZ (lB sK.cx.aF.ae 123 cq.eA L 535 cS.gn 532 cS.eA) (n3 kx.ae.bV.aS)) (bD jS.bH.bi.ae 179 wU K L 75 rY ar 71 ao (i7 sN.bw 58 vd jw jD 17 dq.gb 90 sb bO))))) (dR tb (aJ k8.dv 54 z4.e7 149 z4.eH 145 z4.f8 (hi nt.iI.ag 97 z8.gg z8.eY 1 z8.eS (fR n4.b6 54 ct.p2 133 cV.f5 1 ct.p1 (ac d4.bi.cJ.aO.aO 585 dT.gb) (lf (m0 tg 224 d1.fo 121 d1.fu 200 d1.f8))) (ej k8.dJ.cJ.ae 58 yz K L 226 cA.e1 222 cA.gk (aT nx.cd.ag 47 cO.fA 1 cO.eu 2 cO.ez))) (ei uQ.bQ 87 xw cG.er 17 cG.eB 53 xn (bA tE.b6.dm 11 dj.f6 1 dj.fP 2 dj.gK (i7 uw.ag.g0 233 ch bF.bV bE.bV 17 dT.fK 109 hD lT.pF)) (bA qk.dm.cd.aX.bl.b8 150 cI.p2 1 cI.p1 2 cI.p0 (g4 wE.aI.cQ 99 cT.gk 57 cT.er 53 cT.eB)))) (nd (zj cF A7 C2) (N kJ.mu.bo 55 dn.e1 (aW rJ.bH (lf (jo kV.a0.aj.cR.cx.aD 199 ds.fM 272 ds.fx 243 ds.gn 74 dr.fu j))) (bA uJ.bQ.bP 140 c0.fi 1 c0.eW 2 c0.eH (bk jT))) (N cj.r4.ib.bo 614 cV.fT (J d0.r4.eF 164 cA.fE (al m4.bH.bH)) (o7 s6.bg.eP.S 72 c7.p8 c7.p7 110 yI 106 v2 j (fW kP.cx.bu)))))) (az j7.dJ.S.ae 71 Gf 134 Hb 130 z1.e7 (cb sC.ag 59 z1.f9 z1.ga z1.gj 1 z1.f5 (bU bd.b6 (N aP.Fy.ae.pF.cw 78 z7.p4 (mi od.dm.bg 36 cy.ga e_ 91 cy.gj e_ 38 cy.f5 e_ 53 mL bd (aG ah.AQ.sx.ni) (em i1.a0 44 d1.gK d1.fp 175 d9.gd 14 d9.fM)) (eG nm.bl.bw 116 fe g5 gq k6 19 da.fq (aG aN.bm.fr.gB))) (eJ K.GB.cJ.fr (aZ (lz aU.cY) (ac ah.hU.bP.dt 334 dT.p3)) (aZ (uS sT.aX.b2 4 cS.ft 202 cS.fC H 198 cS.fz) (al fX)))) (ei pf.eb.aD 131 z5.f9 z5.ga 177 z5.gj 38 z5.f5 (nd (rL g3.aX.bP.aX 96 an af.ia.aS 29 z9.gj 116 oo.b0) (fV nm.q5.aj 16 ct.fM 112 ct.fx 268 cV.eY (bC xl.bg.aj 68 ca jl.bI ju.bI 91 bN nq.cH 87 mh.cH)) (eG ii.fH 121 fe ed nk j.aI 1 cN.gd (bM ux.bw 54 mF jX kp iD.bl 19 cL.gm))) (ef ox.fg 124 cq.eH K L 64 v8 ak 60 af (aZ (oB mZ.aD 60 dP.gb dP.gd 170 ap ak.cx 166 af.cx) (d2 gq.aI.pl.bm)) (de qQ.gY.gD (lg s0.aC 11 dq.p4 182 hB iN.x2 63 dq.gm aw))))) (ei j0.a0 36 z2.fq z2.gl 95 z2.gb 14 z2.gd (cb nw.ag.dm 114 z4.ga z4.gj z4.f5 1 z4.hH (oT j3.jr 4 z8.p9 106 c4 bK 102 ea (mV od.jr.cx.bw 99 mf cX cl 17 cB.eu 65 vm bO (lf (tR fc.cz.dK.cz.aX 178 b7 L.ja.ae 29 ds.gg 198 aH.cK)) (qY dF.b6 aB 111 rW au)) (bA kL.bP.aX 130 di.eY 29 cA.eA 161 cA.f9 (bM qM.bw 43 ep aA aB dD 19 dM.f8))) (aJ rc.b6 95 uv 1 cM.gO 2 cM.ev (fh od.dm.cJ.aX bd 61 sj L 29 dj.fm e_ 81 mM aH (aT qe.b6.dm 11 dT.eA 1 dT.f9 2 dT.ga)) (j4 bF.bi.bu (aT jS.ag.dm 11 cT.gn 1 cT.eA 2 cT.f9)))) (aJ iP.cz.b8 69 z6.fM 1 z6.fx 2 z6.gn (N nK.iH.ib.bz 64 dn.hH (J aY.gP.cJ.aO.aO 221 dj.e1 (aK ki.eC.gD)) (kN k4.gZ 69 rU au X ad 140 cA.gm (fW kp))) (op o4.xF (e9 d5.gC.aj 70 di.fx di.gn 122 di.eA 118 di.f9 (dc ju.i2)) (de g5.kY.ib.fr (lf (zv H)))))))) +def E2 : ab dp:=(eL aU (aR vN.eK (aJ mj.eb.aX 62 z1.fT 41 z1.fA 138 z1.eu (bS iZ.bm (aJ i3.e0.eK 61 u0 1 z7.gH 2 z7.gm (mV pR.eV.b8.bw 166 yV ak af 17 cy.gm 77 mG h9 (aK oR.io) (la kQ.ag 40 d9.fK d9.fN d9.ex 1 d9.fL)) (dG oo.e0.cH (lf (xu o8.eP.jr.ae.aj 178 ap ar.bg.hM.fF ao.bg.hM.fF 240 ak.aC.fj.bI 236 af.aC.fj.bI)))) (e2 K.AZ.bi.cJ.aO.aO 330 iz ak.kY.sx (fV pW.b2.ae 128 dP.f6 165 c9.gO 367 dP.fP (fJ jZ.vr.aI)) (ix qy.Cn.bm (lf (rx iu.b8 51 cU.ez 1 cU.fT 2 cU.fK))))) (nd (zj cF A7 b4) (nd (qa eE xy 24 65) (aW cg.nS (bk fX.ae.eh)) (bT b1.kB.CI.dt 370 wg ak (eo ud.bV.a0 51 dM.p3 70 rQ iN 14 dM.p2))) (dR X.bg (dG jy.cH (i7 lW.ag.bw 113 bv nB.aO nG.aO 17 c6.f9 94 ch o4.aC)) (en aH.wd.bl.bH (e8 s6.cJ.S 98 sb dO cj dS 60 dq.gk))))) (eL H (pK nt.jr 11 z4.fT 122 AA z4.eu 85 z4.ez (gA h3.S.cR.bg 106 nX jv dk e6 79 pv aN (lj l8.bi.aD 378 ap jU.CI 378 ap ka.CI 371 iB t8.bH.kB 129 cy.fT j (fJ aV.mX.eC) (ji dV)) (fh oV.dK.aX.S e_ 59 cA.eB bd 117 lJ H 53 di.fu e_ (h6 j0.gC 96 vj bt 52 cO.er H 48 cO.p6))) (ei u1.aF.aD 46 cG.fq wD 96 cG.gd 92 xv (J ah.xx.mX.aF.sk.aI 144 di.eB (fb cF vk aE.ia.mv.bm)) (du e_.dm.dm.aX.aF.aX.aj 104 Cs aA aB dD 67 u7 bq (bk aQ.gY)))) (eg jm.iI.q5 91 nW jH 1 z6.gg 2 z6.eY (N nK.aF.sk.aI 108 dn.gj (fS ii.cK 98 cB.fi 66 zZ K 62 L (aG nJ.jQ.iG)) (gy ah.iG.eC (aK kp))) (fR qh.eN 68 cP.f8 145 cy.fm 19 cP.fz (oc ou.aS 11 di.fT 101 bv j.ib 70 ch lq 66 gN (iO L.iG.bl.hU.gE.cw 240 ap L.iG.mv.bI)) (fh sO.aS.g6.aX e_ 140 cN.ex aP 103 hD ar.cJ 99 hD ao.cJ (lb ak.pF.bg)))))) (eL iZ.aF (az iA.cK 168 z1.p4 202 z1.p3 198 z1.p2 (ei dF.dK.S 50 z3.p0 z4.e7 145 z4.f6 141 z4.fP (eg uA.b6 94 an xI.b0 1 z8.e1 2 z8.gk (k2 kt.ec.S.bp 168 iB aw.nS.kB 172 ct.eW 243 cV.fU (aG g7.fQ) (al cj)) (gz s9.S 85 iK u4 138 et sI 134 jk (i7 mZ.bH.b6.b6.bw 136 ey cX.bQ.cv cl.bQ.cv 17 cO.e7 206 ap hj.bP.bP.av))) (N bd.cH.bu.cw 54 cG.fE (aW gX.bH (dc aY.bm.fr.vr)) (j4 bO.bi.bu (lf (ro jw))))) (nl bK.AZ (oT uh.S.b2 4 z9.eY 109 an nD.b0 105 tP.b0 (fS nm.q5.b2 4 cV.eA 105 hJ ah 101 aU (co jU.aF.ec)) (du g9.aS.aj 136 et e4.bP fI.bP iD.bP 91 iK bq.cJ (lf (rP fk iC rT 20 (aM cD kD e_) 25 (aM cF kD e_) e_)))) (nd (jB jx.pk.aD 35 cq.fm 84 mf j 82 vm aE 26 cq.gH) (aW bq.iv (eo iy.bV.nR.gR.bp 143 w6 131 c6.p8 H 53 dl.fN)) (kh tl.bu.aD 171 c0.ft c0.f4 65 c0.fE (bM tl.bg 167 hB ci.mX aV.mX cC.mX 62 dq.fq))))) (nd (yF gs.aS 11 z2.p0 90 dX au z3.e7 46 z3.f6) (nd (kH aU) (gA qw.aj 100 r5 H ah aU 66 an kc.aC (mV jp.eb.b8.bw 63 mL rG pX 17 cB.f5 113 cy.gj bO (lg g9.cz.aS 11 ds.f4 184 mK H 140 lA bq) (dd n2.S aB 111 r9)) (aZ (q1 l3.dJ.aj 23 c7.f6 127 ca aH.cR.bI 111 m4.bI 107 sP) (ff yT.ag 44 dM.eA 828 cU.ga 1 dM.f9))) (nd (pj tA.b8.bw 67 cM.fT 122 lF j 17 cM.fA 88 w0 hj) (fS tp.bP.ia 4 dj.p9 103 ca tX.bI 99 e_.xx.bI (i7 oU.gR.bw 114 bv sV.aO tN.aO 17 c6.f8 109 ch h9.bi.nh)) (jz jU.Gw (ac cX.gP.eF 68 dq.ex)))) (nd (qN sK.cK 188 z6.fD 139 wt ar 135 ao) (bS ka.aF (fV s8.S 121 dy.eY 66 rU 62 dy.fm (aK rI.io)) (aW e_.vv.bI.aD (e8 pb.dB 53 rQ nj g2 kg 56 cL.p9))) (gI sX.S 61 cq.p5 107 wr X 103 ad (aZ (rP l4 iC Bg 32 (aM cD fB e_) 145 (aM cF fB e_) bd) (lf (q1 o8.eP.jr.ae.aC 11 dL.eZ 182 ap bO.y9.hM.fF 226 ah.vz.fj.bI 222 aU.vz.fj.bI))) (ej n0.bw 170 b7 rG.ae pX.ae 17 dI.eZ 73 di.ev (la gF.eN 37 dY.p1 dY.p0 d9.e7 19 d9.f6))))))) +def EP : ab dp:=(az fa.dJ.bg 32 cO 47 dM 43 cL (qq m2.bV 150 Hu 230 HM 152 Hw 306 HK (cb iT.eP.bQ 55 z1.e1 z1.gk z1.er 19 z1.eB (k2 mj.S 80 dX aw 54 z3.f4 50 z3.gO (nd (oh nw.nR.S 132 kw mE.aI 95 z7.gK H 91 z7.fi) (nd (w9 m9.a0 457 cV.p8 122 cy.eW 77 hC aE 14 cy.eH) (lf (lB mQ.ia.S 84 bN i6.fF 85 dI.fq 29 dI.gb)) (fb cD Dq bd)) (ix d4.pl.bm (bZ oU.dB 87 ch q8.nh iS.nh tT.nh 122 bv b4.bQ.aO))) (N mE.bi.cJ.aO.aO 215 c5.fN (ns gr.dK.gR.aS 4 dy.ga 114 dy.gj 110 dj.gn (ac iZ.F4.eK.dt 334 dl.f4)) (fV sT.cK 96 c9.fU 64 c9.ev 60 c9.eZ (e8 By.dB 93 b7 nj g2 kg 60 cU.fP)))) (bc nJ.aI (gI qJ.cz.aS 4 z9.eW 114 c4 uH 110 oW (bT aw.bQ.xQ.bu.dK.fy 131 je uD.cH (bM tw.g0 92 bN q3.g8 uj.g8 j.hK.g8 19 ds.fi)) (aZ (wH kQ.jq.eP.bV 24 cV.fT 202 cS.f8 26 cS.fp 38 cS.ft) (fb cF mD aV))) (dR my.a0 (aW K.cR.nS (ac e4.i0.gE.cw 94 c6.fU)) (ir te.dJ.aj 23 c8.f9 129 c8.ga 113 c8.gj 109 c8.f5 (aG X.bu.iG))))) (N k0.eF 59 z2.f4 (cb gG.a0.ag 52 z4.fo z4.fU z4.fi 1 z4.eW (bc hQ (lQ uB.aD.S 335 cV.er 56 ct.fK H 113 cV.eB (g4 gG.aj.cR.iI.ae 177 dI.fu 201 dI.gO 197 dI.ev) (al b3)) (o7 kZ.eN.cR.aD 92 cA.f8 cA.fz 64 cA.gl 60 di.fE j (hT iu.cd.gZ.b2.ae 107 ey nK.cv 197 ap K.iG.ce.bi 193 L.iG.ce.bi))) (aJ ko.bl.q5 87 cG.fi 1 cG.eW 2 cG.eH (aZ (lZ yR.cd.aD 63 yj c9.p5 92 fe hO) (co L.AV.aF.ec)) (J jU.Gg.eD.kk 221 cI.p7 (al lS)))) (nd (yu hR.S 98 z6.ft z6.f4 z6.fE 43 ep) (dQ lD.S.bl.iF 11 dn.eZ 54 dn.fo 153 dn.fN 17 dn.fU (du i5.S 60 hC au X ad 127 et aN (al h9.bg.hK)) (ek sH.bQ 169 b7 gN.ae 17 c0.gO 68 c0.ev (ly jT))) (N pq.yb.hU.bo 171 cP.p0 (bT b4.bl.eC.db 166 hD u4 (al rA.bH.bH)) (en aY.wd.bl.bH (bk pw.fr.hK)))))) (d3 e_.FN.cH (eR eT.aj.b2.aj b1 64 z1.eA e_ 268 iJ ak.aC 264 iJ af.aC (N nD.dh 216 z3.gH (k2 qJ.S 60 an qp 102 wF 98 r5 (e2 lT.xQ.bu.dK.fy 131 je bO.cH (ac g5.aI.bV.fd 159 c0.fx) (fb cF fB b1)) (dG oR.e0.cH (aG H.aF.aC.S.gB))) (bU dz.aO (dG K.cR.cH (ac ar.aF.bl.dt 342 dl.fU)) (ej li.aj.cR.aX 69 rY ar ao 181 cI.fU 177 wU (em gr.eb.cQ 124 cU.p9 cU.p8 54 cU.p7 50 yo)))) (nl tb (lE i3.e0.dB 79 z9.fx 87 z9.gn 163 an kr.iV (dG b1.bi.cH (cp sD.dB.ag 73 dr.er dr.eB 1 dr.fT)) (dG fX.e0.cH (eo zB.bV.a0 55 cL.eZ 110 b7 iN 14 cL.fo))) (e2 fI.bP.hV 187 cP.fE b1 (fV n7.jr.S 111 c9.gm 85 dP.ex 29 dP.fL (bk jy.bV.hK)) (bA sD.e0.gR.dm 11 cN.fD 1 cN.fu 2 cN.gO (h6 eI.cz.gR.a0 77 jc gS 176 hB q8 14 dq.p8))))) (eL cC (nd (kH fY) (gp qw.ag 62 an uH.aC oW.aC 1 z7.p6 2 z8.p7 (eR nm.iF.S e_ 41 vi bd 95 cB.eW H 29 cB.eB e_ (bM i5.g6 72 hC g2 dZ.aC eM.aC 1 c0.p6) (qY h7.b6 aB 210 d1.ft au)) (aZ (lB tw.b6 80 bN A3.bI 1 cA.fq 2 cA.gb) (h6 Aw.S 103 b7 aw 52 cO.eS H 48 dM.f6))) (aJ tA.bu.b8 57 cM.f6 1 cM.fP 2 cM.gK (ck cC.h8 (hT Cb.aj.b2.ae 84 pt d4 189 b7 ak.hM.cK 185 af.hM.cK)) (kN jS.eV.cf 71 Aa au X ad 90 cI.eY (g4 Au.bH.ae 52 dq.e7 64 dq.f6 60 dq.fP)))) (eg iP.eN.ag 46 rX jH 1 z6.gb 2 z6.gd (eJ gN.hK (e9 zJ.aD 52 dy.f8 ws 271 di.eZ 87 xd (lf (oO hY.bw.aF.aS 4 ds.eA 80 ds.f9 76 c6.fN))) (du uT.cd.a0 176 b7 ci.jr.ae aV.jr.ae cC.jr.ae 103 pt bt (co kp))) (gp eI.ja.cR.eN 55 mf bj br 17 cP.gb 25 cP.gd (gW tU.a0.aF.bw 62 mM aY aQ 17 di.gd 90 nY aH (d2 uN.pl.bm)) (jz H.cQ.mv (lf (eX fc.eN 33 an b1 33 fG e_ 33 an j 19 dY.gb e_)))))))) +def EL : ab dp:=(d3 X (bc lV (aR bt.bP (bS dN.bm (ef kb.dJ.bi.aD 72 kA cX.gP cl.gP 60 mc ak.cH 56 af.cH (im H.cR.nS (d2 aB.aF.pl.bm) (hZ kQ.a0 113 c5.gj b1 40 c5.gb bd 135 d9.er e_ 14 d9.eB e_)) (gV kK.eK.aF 41 va 40 da.fK 1 da.fN (aG K.o5.aC.S.gB))) (mV gF.gR.g0 79 fG jw.aD jD.aD 17 c5.fL 146 pA hj (ir sL.eb.eb.ae.aC 11 c9.ft 183 dj.p4 55 vf 51 c9.f4 (al ak.iH.bQ)) (fV lH.ag.b2.ae 71 xr 147 cS.eu 143 cS.ez (lc uW.aC 11 cU.gg 79 cU.eY 176 cT.fE 51 cU.eS)))) (c3 eQ.bI (eg sE.ag 102 an iE.b0 1 z9.eY 2 z9.eS (bT au.cH.AQ.hK.dh 242 vl au (aT oN.dJ.bQ.bP 111 ds.ev 1 ds.eZ 2 ds.fo)) (bD ii.b2.b2.aj 121 cV.ex bF bE 122 hJ dN.bm 118 ie.bm (aT gr.ik 11 dM.fq 1 dM.gb 2 dM.gd))) (N aE.rF.aI.hV 70 cq.e7 (aW fY.bg.hK (bC kK.e0.q5.bi.aD 95 vg oa om 164 vb fX 160 d8)) (ej u9.b2.aj.ae.aj.e0.cQ 118 wy K L 73 c8.p2 69 v3 (e5 gr.jq.dv 164 dq.ev 66 cT.eS ar 62 ao))))) (c3 b3 (ku jy (lY sW.cd.aj 23 z8.fM 180 an dV.iV 75 z8.fx (nd (l5 jg.b6.aX 126 cy.eW 29 cB.fE 146 et gx) (bC q7.aD 173 b7 ar.ni.ae ao.ni.ae 76 u6 ak 72 af) (lf (zo dD.cH))) (J cj.nh.cH.hU.aI.aI 271 cA.ex (hZ u1.S 292 xa e_ 42 cO.gL e_ 65 zw e_ 61 z2.gb aP))) (az uQ.cQ 112 cG.ga 195 cM.eZ 192 cM.fo (J j.xx.mX.aF.sk.aI 134 di.fo (bC dF.jq.b2.ae.aj 66 cN.eu bF bE 180 u5 jt 176 gX)) (bA d5.cx.aF.b8 204 c8.eZ 1 c8.fo 2 c8.fU (em nr.aX 54 cT.p9 cT.p8 74 cT.p7 70 zM)))) (hi gs.bP 38 z6.ez z6.fK 1 z6.fN (eJ e_.cz.gY (aZ (pd oK.bV 24 dy.gK 88 cB.eW H 26 cB.eB 38 vi) (lf (jo g9.gZ 475 dl.fD 140 ds.p8 170 jK 166 c0.fK j))) (gy fX.iG.eC (iM g7))) (mV v6.nR.S 96 lF ak af 102 Ae 98 xt j (ns BW.pk.iF 4 di.fU 99 u6 17 cA.ez (aG bF.S.gB)) (bD na.aD 72 ch ar.ni ao.ni 111 bv cg.aO 107 b3.aO (fW ka.cx.bu)))))) (nd (rP eE iC tt 24 (aM cD dE e_) 65 (aM cF dE e_) e_) (aR g7 (aJ eI.dJ.dm 11 z3.p7 1 z3.p6 2 z3.p5 (lY g3.bV.b2 11 z8.eZ 100 an uI.mv 63 z8.fo (gI pg.ag.aS 4 ct.fE 68 pm dZ 64 eM (bC ti.cx.bi.cs 91 bN aY.d6 aQ.d6 84 ca ke.bl 80 iX.bl) (iM ah)) (bA s9.dm 11 da.gj 1 da.f5 2 da.hH (bZ pH.jr.aj 189 ap jn.eK.av o6.eK.av j.ni.eK.av 135 ey fY.aX.cv))) (fR iA.a0.bP 44 cG.fP 231 cG.fo 1 cG.gK (ek oZ.g6 62 pm jN 1 c9.fM 2 ct.fE (bC rd.bV.aj 71 pt aY aQ 188 b7 eQ.cK 184 dz.cK)) (aZ (rx kQ.jq.eP.g6 76 vh 1 cI.eY 2 cI.gm) (lf (ro aY.yb))))) (nl lV (nv j3.fg 118 c4 iX 76 an jl.i9 72 ju.i9 (fO h7.iI.bV.a0 80 ct.p9 121 zE aE 14 cV.fq (cp tD.q5.bw 197 c6.fC c6.gv 19 c6.fq)) (eG s9.bw 67 hC H.vL ah.vL aU.vL 19 c0.gH (bZ jA.it 148 zp au X ad 57 rO b4))) (N au.cH.o5.eD.aI 58 cq.fL (aW j5.bH (mg j8.cz.b8.dm.aS 11 dl.p8 188 ap hj.sk.hL.bI 130 ve K 126 L)) (kh s0.ia.aj 176 c7.fz c7.gl 111 c7.e1 (aK iX.bp))))) (az gs.b6 42 z2.p9 1 z2.p8 2 z2.p7 (cb nL.S.a0 96 z4.p0 z5.e7 z5.f6 119 z5.fP (nd (tB uh.S 61 an lR.gP 97 g2.aS 93 kg.aS) (nd (wJ uE.aC 11 cB.gb 71 cB.gH aH 234 dj.er 86 cB.eS) (g4 jg.b6.cQ.S 134 c0.p9 151 ds.fP 49 ds.gK) (dd mj aB 220 iJ)) (aZ (qS xi.b2.b2.aj.ae.cz.ae 67 wO K L 120 wv 116) (aK jk))) (ef v6.eP.aD 60 xn aY aQ 102 xw ak 98 af (eG nC.ag.ag.bi.bm.aF 64 vf aE.kv K.kv L.kv 1 dj.ga (al lM.a0.hK)) (en tb.bV.hK (aG fY.fy.iG)))) (nv jm.hL.bp 55 mc i6 79 kA mT 75 rB (gA pf.cd.a0 76 fG e3.eN ed.eN d0.eN 171 pA aw (ek oN.cQ.bP 179 lm pq 1 dy.fK 2 dy.fN (ac K.aF.bl.dt 342 dT.hH)) (gz un.ae.b2.ae 96 nY d4 72 mM ak.hM 68 af.hM (kf kV.aj.cR.ja bd 4 cU.fo e_ 50 cL.f5 H 46 tH aP))) (aJ fa.bl.bi.b8 87 cy.e7 1 cy.f6 2 cy.fP (ej oJ.hL.eN 102 ca rD.bI rM.bI 17 di.p7 25 di.p6 (al X.bm.bH.bH)) (de tr.hK.gD (lf (qz j)))))))) +def Ej : ab dp:=(nd (Bj ru.iF.aj fY 124 dq e_ 65 dY e_) (pK nt.aX 149 G8 316 G9 Hn 31 HS (k2 eT.gC 252 iJ aw 56 z1.fo 52 z1.ez (bS ci.eP (gp h3.eN.a0 90 kw eQ.fF dz.fF 107 z7.fT 14 z7.fA (dR dk.a0 (ql m9.cQ.cs 355 dl.p7 356 dl.p6 509 mJ eQ.cR 505 dz.cR) (lf (wP gx))) (gW nm.q5.b6.bw 113 hJ ar.bm ao.bm 17 da.gl 128 cV.ex bO (lf (xu lK.bl.eV.bi.aD 177 ap bF.y9.hM.fF bE.y9.hM.fF 233 eQ.vz.fj.bI 229 dz.vz.fj.bI)))) (bU bE.bu (ck uL.h8 (pL n4.pk.aI.ja 4 c6.fA 116 ds.ev H 112 c6.eA)) (mR fk.dJ.bi.cd.jq 4 cS.p6 64 cS.ev H 60 cI.gd (ac aE.eh.dh 139 cU.fT)))) (bc tM (ry B1.cx.ae 162 z9.fD 69 an K.hU.aC 65 L.hU.aC (k3 q9.cd.bi.aD 165 cV.e7 e_ 165 cV.f6 e_ 173 iB dN.mX.kB 56 ct.ev j (bC qP.aj 66 py K L 179 b7 nq.ae 175 mh.ae)) (bD wz.S.cx.aD 117 iq bj.yd.jd br.yd.jd 74 ep H.kB.n1 70 j.AV.n1 (aT dF.ik 11 dM.fK 1 dM.fN 2 dM.ex))) (dQ ok.aS.aC 11 cM.f9 177 cq.eu 118 cq.ez 53 cM.eW (J aP.Fy.ib.bP.eV.dK.fy 253 dP.fp (ac cj.i0.gE.cw 99 c6.f5)) (J jN.bg.cJ.bi.hL.dx 156 c8.p5 (al iS))))) (N iN.iH.qV 283 z2.fo (ku fY.bm (aJ qW.g6 67 z8.fm 1 z8.gH 2 z8.gm (nd (pI ox.cz.S 119 lo au X ad 78 rN) (co gu.ec) (lf (kH L))) (e9 gG.jq.cR.cQ 220 cA.e1 cA.gk 60 lJ 56 yz (aT qM.dm 11 cO.gm 1 cO.fC 2 cO.gv))) (dR K.iI (ck aw.mv.ni (lg lW.b2 11 cN.er 92 ch dV.aC 105 bv aN.aO)) (e9 gG.aj.cR.hL.eN 104 c8.fP c8.gK 17 c8.fp 25 c8.ft (eo fa.aj.aF.a0 55 cT.hH 115 sb au 14 cT.gL)))) (lQ gU.bV 22 z6.fi 81 je H 120 z6.gl (ei il.cz.bu.aD 49 dn.fA dn.eu 63 dn.ez 26 dn.fK (aZ (pV rp.dK.cx.ja.aC 11 cV.p2 185 iB oY.o5.kB 300 c9.p9 179 cV.p1) (g4 kZ.eb.bg.ae 64 ds.gk 84 ds.er 80 ds.eB)) (ek n0.b8 174 b7 e_.cK 1 cA.eH 2 c0.f8 (co jT))) (aJ rh.ag.eN 69 cq.p4 17 cq.p3 25 cq.p2 (J jN.xQ.r4.eF 171 cA.eZ (em i1.pk.bp.aj 203 dl.fC dl.gv 88 dl.fq 84 dl.gb)) (ir tZ.aD.aF.aj 23 c7.fA 265 dI.eu 249 dI.ez 245 dI.fK (fW cj.eV.bu)))))) (nd (rP qt sc Bz 28 (aM cD hI e_) 105 (aM cF hI e_) aP) (ry i3.fg 61 z1.hH 243 iJ bF 239 bE (az dF.ec.aS 4 z3.ga 50 z3.gj 46 z3.f5 (cu m2.a0.ag 98 se ed nk j.aI 1 z8.e7 (gA oL.bl.bg 53 vm au X ad 99 mf aw (iL uT.cd.ae 172 b7 bj.xD.ae uk.ae 71 dI.p0 67 dr.e7) (la i1.ag 44 d9.hH d9.gL d9.p9 1 d9.p8)) (du iu.cf 165 ap q8 iS tT 67 ey aN (aG g5.bm.fr.gB))) (eR eI.iF.S e_ 41 c5.f5 bd 77 c5.p1 H 29 cN.fz e_ (J aP.fj.bV.fd 159 c9.ex (em lH.dJ.cR.b8.bw 79 dl.gO dl.ev 17 dl.eZ 210 dl.fo)) (oc uy.e0.aF.aj 23 cI.er 85 u7 gx 131 iz fX.kv.iH 127 d8.kv.iH (ac g5.iG.eD.aI 239 cT.gv)))) (bS jv.bu (aJ j3.dm.dm 11 z9.gL 1 z9.p9 2 z9.p8 (kh ma.ag 106 yg cV.ex 1 cV.fL (i7 qe.b6.bw 190 jK cX cl 17 dr.f5 154 mK aH)) (aZ (lB l8.aD.ae 475 dX d4.bg 498 dr.eY 494 dr.eS) (nz li.gZ 61 cL.fz cL.gl 91 si cj 87 dS))) (nd (rx qh.dJ 11 cq.er 1 cq.fU 2 cq.eB) (aZ (oD eI.b8.cf 214 ug 67 pm ah 63 aU) (em n4.aj.ia.cQ 78 dl.eu dl.ez 29 dl.gd 26 dl.fA)) (jz bd.S.vr (bZ iA.kl.cR.bg 145 hB H.kY.v9 mT.v9 rB.v9 68 mH qb.hM))))) (op ah (nd (kH cC) (aJ iT.bl.ik 11 z9.e7 1 z9.f6 2 z9.fP (im ar.mX (e8 tz.fj.S 76 yO au X ad 119 c0.gd) (dd k8.b6 aA 9 cO.gO)) (du tU.a0.bP.bg 62 mL aE.kB K.kB L.kB 238 vl ki (h6 kQ.gC 143 r9 aw 56 cO.gd H 52 dM.gK))) (dR L.bg (m5 tI.bu (bZ fk.nR.cx.cR.cf 89 zx au X ad 139 w2 aN)) (ck kn.fQ (hT dF.ag.eP.S 139 hB lR 80 jc cj 76 dS)))) (mV fc.b6.bw 100 wt bj br 17 z6.p9 57 nW bO (nd (oB g3.ho 129 dn.p8 dn.p7 78 fG K.aD 74 L.aD) (aZ (qo wR.cK 93 xd L 62 ws K 58) (ac jH.cx.aI.eC.bu.bz 393 c6.fD)) (fS mQ.cz.ja 4 cA.gH 73 ca aE.F1.bH 69 aP.iH.bH (e5 jA.dJ.fg 65 cL.gl 95 si lk 91 kS))) (N j.xF.dt 73 cP.p9 (aW oC.bw (ql j8.cz.b8.dm.aD 35 dl.p1 158 dl.p0 188 ap H.e0.hL.bI 184 j.xx.hL.bI)) (o7 fa.aj.aF.cf 71 dI.gg dI.eY 95 AH 91 we j (co bK))))))) +def EV : ab dp:=(hS fc.dv 108 HE 225 Hx 222 HH (m6 pQ (aR jk (bS e3.eP (cu nw.bl.ag 92 kw ed.fF nk.fF j.aI.fF 1 z7.gb (nd (uS oL.iF.b2 4 cq.fN 244 cP.eu H 240 ky) (ac kW.r4.iv.bm.dx 164 dI.gL) (lf (yq i1.aX 44 c5.gb 29 d9.eY 64 d9.eS))) (dG ah.e0.cH (bZ os.nR.S 129 ey e_.ae.cv lM.cv ub.cv 191 ap b4.eK.av))) (nd (lL kZ.dJ.bg 36 c5.gg 94 c5.fA H 38 c5.eY 56 As aN) (k3 nb.eK.aS 11 c9.gk e_ 35 c9.er e_ 274 dP.fU e_ 110 ct.fx aP (dc af.pT.sx)) (J jZ.cJ.bi.hL.dx 156 cI.gK (aG kx.aC)))) (N jZ.Ao.bz 154 z5.ex (cu uh.eN 89 an aA.ia.aS aB.ia.aS dD.ia.aS 19 z9.gv (aW aP.sk.nS (aK fX.io)) (fh i5.gC e_ 183 c0.fK e_ 139 lA H 470 dr.eu e_ (cp h7.g0 50 cL.fA cL.eu 19 cL.ez))) (N eQ.aO.hU.bo 548 ct.eu (nc kK.bQ.aC 11 dP.eH 83 da.eu 128 dP.f8 (dc tS.gP)) (j4 oC.aI.bu (o9 aN.AZ))))) (c3 iD (bc rJ (nd (jB nE.aS 11 z8.eH 65 an oY.aC 103 c4 K 99 z8.eW) (eR sJ.dm e_ 11 cG.fz b1 1 cB.gO e_ 2 cB.ev e_ (al dV.mu.bH) (al dV)) (gz oX.S 67 xb aN 102 bv dk 98 e6 (g1 nx.cd.aj 23 dM.eZ 77 cL.fp 51 cO.fA aw))) (nd (wJ rc.aC 11 cG.hH 65 xn aH 95 cG.gL 91 xw) (jW uE.aS 11 dj.fT 77 xb gf 94 bv gS (mb l8.b8.b2.ae 149 vb 92 vg K 88 L)) (J bt.pD.xD.cH.hU.aI.aI 317 cN.gK (lf (oO tF.bl.aS 4 cT.p2 62 cT.p1 58 dq.eu))))) (d3 hW (ei cZ.aS.e0.cQ 71 dn.fC dn.gv 58 dn.fq 54 w3 (bT pw.aX.rF.bm.bz 122 dX kx.fr (aK cC.fr.hK.gD)) (aZ (rL BO.q5.aX 169 b7 b3.cQ 29 cN.p7 189 bd.aS.ae) (e5 v0.fg 57 dM.p0 87 vj jl 83 ju))) (aJ jx.pk.b6 239 cP.eu 1 cP.ez 2 cP.fK (md BM.bP.bg 58 di.fL 406 b7 ak.nh.ae 254 c7.fx (iO d4.mu.hU.gE.cw 232 ap d4.xx.fF)) (e9 kt.eb.cz.aI.b8.bw 408 cN.gH cN.gm 17 cN.fL 252 cN.fC (bZ n2.fj.gR.bH.bg 70 zH au X ad 122 yt aN)))))) (eL oG (eL h5 (ku H.eP (gI dF.iI.aj.ae 72 pv 103 nX K 99 L (az sY.q5.bi.cQ 69 cP.fm 162 ct.er 241 cV.fz (aG kp.fQ) (al b3)) (gV jp.eN.b2.ag 81 da.p1 168 c7.fD 1 da.p0 (ij kL.S.S.dK.S 194 ap b4.eK.av 136 ey lM.cv 132 ub.cv))) (nd (Aj ah.yb) (iw rn.dv 105 nV L 67 lF bj 63 br (bC iy.ec.b6.bi.aD 61 wK aY aQ 179 u5 fX 175 d8)) (ir qk.dm.cd.aX.bl.aS 11 cI.ga 47 cI.gj 238 c8.gv 69 cI.f5 (em i1.a0.aj 183 cT.fU cT.fi 60 cT.eW 56 cT.eH)))) (qu H.bV (cu uf.a0.ag 119 c4 u3 nk.aO j.jQ 1 z9.p0 (bT j.bg.rF.bm.bz 114 dX aU.bg (aT oV.dK.cR.b8 105 dr.fi 1 dr.eW 2 dr.eH)) (md sR.S.b2 11 cN.p2 112 hD ci.aO 131 cN.p1 (aK jT))) (aJ zu.dm.aX 168 cP.ga 113 cP.gj 110 cP.f5 (fO nb.bQ.S 75 c9.p1 139 xg vN 41 dP.gL (h6 lW.bV.a0 117 bv aw.eN.aO 104 ch tL.nh 14 dl.fL)) (en fY.bm.bV.hK (co aH.bg.eK))))) (bc ci (bc iY.aI (gA l9.aD 105 r5 g5 gq k6 75 an vU.h8 (lE oL.cx.aD 73 cB.p8 279 dy.gg 61 mM aw (bZ l3.eP.aD 90 bN e4.vz.jd fI.vz.jd iD.vz.jd 79 ca bq.kY.bH) (dd gr.a0 aB 261 d1.p2)) (gW qM.cd.ag.bw 140 iq nB.bI nG.bI 17 cA.p3 79 ep h9.cJ.ja (d2 aV))) (fR j7.bQ.aj 35 cM.fN 43 cM.ex 53 cM.fL (fS lK.cK 67 cV.eZ 194 bN h5.fF 190 d4.fF (al H.rF.bH.bH)) (J bd.S.jd.eD.kk 221 c8.fM (bk gX.gY)))) (gI o0.ia.cR.ja 4 z7.f4 54 mc ra 50 s7 (nd (lZ sW.S 129 c5.fE c5.fD 70 fG kr) (aZ (jB un.aF.iF 11 dy.fC 64 sj bO 116 nY K 17 dy.gv) (aK lS.io)) (bD rH.gC.aj 72 ep ar.cJ.ja ao.cJ.ja 149 iq mY.bI 145 iQ.bI (ly gu))) (nd (jo ox.cz.aj 23 cy.gk 171 ct.gv 153 cy.fU 74 cq.p4 j) (gW kt.ec.fj.cJ.S 85 mG K L 168 zm 164 cV.er j (g4 oZ.fj.ae.b2.ae 106 dl.fT 82 dl.er 78 dl.eB)) (eG pZ.b6 100 bv ah.aO bK.aO ea.aO 1 dT.eZ (lf (qz H)))))))) +def E3 : ab dp:=(nd (rP j2 iC Dh 24 (aM cD f7 e_) 65 (aM cF f7 e_) b1) (cb nL.S 84 HG Ia H4 89 H3 (aR ah.bP (nd (rP eE iC tt 24 (aM cD dE e_) 65 (aM cF dE e_) e_) (aJ kj.eV.dJ 11 z7.eZ 1 z7.fo 2 z7.fU (N e_.eK.i0.bo 77 cy.fo (bZ mQ.ia.aj 84 bN aA.aF.fF aB.aF.fF dD.aF.fF 109 ca aw.cR.bI) (lf (wP ah))) (fh sU.ho.bQ bd 65 ep e_.AV.n1 17 da.eZ e_ 124 iq j.yd.jd (lf (jB s8.aj.ag.iF 11 dL.fT 188 ap hj.eC.av 122 ey K.cY 17 dL.fA)))) (bU ci.fy (aZ (eU cF Dj ar) (iL wQ.bV.pk.ae 86 vg K L 151 ds.fm 147 vb)) (bA uW.cx.b6 197 cS.fC 1 cS.gv 2 cS.fq (co gu)))) (nd (kH u4) (cu iT.bl.g0 153 an e4.iV fI.iV iD.iV 19 z9.gk (fS kV.ec.b2.aF.aX 163 cP.p1 66 sa K 62 L (bC ti.cx.bi.gZ 95 bN fX.g8 d8.g8 80 ca ah.cY 76 aU.cY)) (aW nK.hM (bM rH.ag 48 ep X hW ld 1 dM.f5))) (az rh.ia.S 149 xt 85 cM.gv 29 cM.fq (aW j.mX.nS (iO o3.bV.rF.bm.bz 114 dX gu.bg)) (en pS.eh (aG af.pT.vL))))) (N nk.eV.dK.fy 188 z2.gK (ku cC (qv g3.bV.b2 4 z8.eu 61 z8.ez 58 u0 (qd fa.bl.bi.aD 47 ct.ex 650 cS.gO 91 cy.e7 aw (bk lT.eh) (al kr)) (bA sO.bH.bi.b8 139 cA.fo 1 cA.fU 2 cA.fi (ij s8.aj.ag.dv 196 ap d8.bP.av 120 ey lk.cv 116 kS.cv))) (N ra.bu.cw 186 cG.eZ (bD tz.aF.aD 68 yj bj br 101 fe t8 97 aP.n1 (ac iZ.ni.vv.D8.fy.bz 81 dT.er)) (de cX.o5.bp (lf (rP l4 iC Gr 32 (aM cD fB e_) 145 (aM cF fB e_) e_))))) (bS H (dQ fa.a0.aC 11 dn.f4 71 dn.fE 148 dn.gl 43 dn.fD (gz h7.iI.nR.S 139 lo aw 80 w5 ah 76 aU (al br.iH.bQ)) (fh qP.b2 bd 4 cA.f4 aP 70 cA.f6 H 66 c0.eZ aP (ly hQ))) (nd (rP j2 wN Cp 24 (aM cD f7 e_) 65 (aM cF f7 e_) aP) (fO jp.eN.b2.a0 81 dj.fp 175 yY aE 14 dP.p3 (hZ lK.bl.b6.aD 173 ap bF.d6 173 ap bE.d6 135 yS aE 26 dl.gk e_)) (J aH.pD.xD.cH.hU.aI.aI 317 dl.gK (aK hW.bQ.bp)))))) (aR aE.ec (e2 j.bm.bu.bu.dh 151 iJ aP.aC (cu wz.fj.S 58 dX nj g2 kg 135 z3.eS (aJ nL.gR.dm 11 z7.eA 1 z7.f9 2 z7.ga (e2 lM.rF.bm.bz 122 dX K.fr (iO aV.hL.aI.hV 231 et H.bH) (lf (rP rv.dJ.jr iC xY 28 (aM cD mD e_) 105 (aM cF mD e_) b1))) (iw oK.cz.ae 113 sg br 86 hJ h5 82 d4 (ac iS.pD.eP.aI.db 114 dL.p3))) (gI gG.jq.b2.ae 184 c5.fT 60 wn K 56 L (dG ie.hL.cH (hT sH.S.S 76 py aN 189 b7 ed.aC.ae 185 d0.aC.ae)) (J aU.iv.bm.dx 164 cI.fu (lf (ro aH.yb))))) (dQ iT.dK.aC 11 z5.gv 136 z5.fq 162 z5.gb 29 z5.gd (nd (tB hR.bl.bi.cf 71 an tM.gP 107 dk.b0 103 e6.b0) (J H.cR.bV.fd 159 ct.gH (aG iQ.fQ)) (dG jn.bm.cH (cp y1.bw 54 cL.fL cL.gg 19 cL.eY))) (N X.aF.vz.bi.aO 65 cq.fU (J aV.hL.bV.fd 159 dP.fK (d2 eQ.aI.pl.bm)) (J mE.aO.kY.eF 925 dT.p0 (lc tW.cK.cQ 235 dq.p0 236 dY.e7 144 dq.p2 140 dq.p1))))) (eL ci (lC cD A4 bd (bc jV (nd (pI qh.S 99 lo aE K L 76 xj) (aT lU.eV.b8 65 c0.f5 1 c0.hH 2 c0.gL) (dd cZ.a0 aB 170 d1.ft)) (eG t0.bl 66 ca iY.bH aE.F1.bH aP.iH.bH 1 cA.gH (g1 zt.aj 23 dM.eW 81 cL.fD 55 cO.fL aw))) (lj tV.ia.ag 91 sF aE 91 uz bd 1 cG.p0 e_ 2 cM.e7 e_ (gz mQ.S 76 bN i6 65 ca dk 61 e6 (al i6.mu.bH)) (fh jA.dK.gR.cf e_ 125 cI.gg e_ 81 vh H 77 cI.fL aP (bk gf.gY)))) (ol jm.iI.iF 11 z6.gv 61 z5.gk aE 95 nW hO (k2 gF.gR.b6 67 fG zi 1 dn.eA 2 dn.f9 (gV uw.aj 35 dy.fi 43 dy.eW 99 dy.eH (al ar.iH.bQ)) (gy j.ib.iG.eC (e5 wE.fg 61 cL.fE 91 mH jl 87 ju))) (N cX.eC.db 60 cP.fq (bD jx.aj.e0.cQ 92 nY h5 d4 68 mM aY 64 aQ (bM oU.g6 118 bv iS.aO nJ.jQ qI.jQ 1 dL.ft)) (J jn.vv.hK.bm.dx 164 cN.gv (lf (zg rH 103 d9 36 an 95 dY.gH 14 dY.gm)))))))) +def EC : ab dp:=(hS cZ.ec.bw 115 Gh 17 Gz 50 Gx (aJ gU.eb.cQ 78 GR 93 Hk 89 He (aR dV.bl (cb eT.b6.bw 125 z3.eB z3.fT z3.fA 19 z3.eu (o1 fc.a0.bp 77 kA bq.gP 61 mc X.cH 57 ad.cH (N q3.i0.bo 68 cy.eS (d2 lT.bl.pl.bm) (ji b3)) (bT bd.FN.CI.dt 362 mJ vU (bM iu.aS.S.eb.aF 195 wZ H ah aU 1 dL.fL))) (ef iT.eb.e0.cQ 148 pA b1.mX uu 85 fG jw.aD 81 jD.aD (aW cX.nS (al rR.mu.bH)) (e9 uZ.bP.aX 174 cS.e1 cS.gk 29 cS.er 194 cS.eB (eo qs.cK.S 86 cU.fL 57 cU.eH H 191 cT.fm)))) (eL qG (eg nE.b6.ag 111 c4 jN.bu 1 z9.fL 2 z9.gg (gW ok.bH.bi.aD 296 lm aY aQ 417 dj.p5 128 ct.fz j (dc cg.cQ.mv)) (kN uB.aI.cJ.S 149 pz dO cj dS 72 da.eH (ij tq.aX 50 ep af 109 iq cX 105 cl))) (gp sQ.q5.bw 492 je lk.cH kS.cH 17 cM.p5 221 cq.gv (md sZ.bi.eN 62 dP.gO 368 ky uj 19 dP.ev (bC na.iI.aj 102 ch ar.bi.nh ao.bi.nh 123 bv hQ.aO 119 g7.aO)) (ix ao.Cn.bm (aT dF.ag.eP.dJ 11 dq.eS 1 dq.fm 2 dq.gH))))) (az h7.a0 38 z2.er 115 z2.eB 14 z2.fT (ku ju (gp nF.eK 101 c4 e_.eK e_.mu 1 z8.gv 2 z8.fq (fR g9.ag 124 cB.ft 459 c9.gL 1 cB.f4 (lf (lZ n0.aD 61 dI.p2 dI.p1 178 b7 aw.cK)) (lb nn)) (bT aU.AO.kv.hM.bu.bu 61 iz j.fr.iH (h6 fk.gC 63 rQ aw 48 cO.eH H 44 cO.hH))) (N k9.iH.ib.bo 59 cG.gH (J rA.F4.eF 166 di.gO (mg na.aS 11 dT.eu 111 bv bd.pT.cJ 80 ch ah.aC 76 aU.aC)) (en kO.eh (aG rA.vL)))) (az gF.bV 22 z6.e1 41 rX 37 z6.er (pP aY.yb (aZ (qj uP.aj.S 68 zr 93 fe X 89 ad) (fJ b4.x2.eC)) (gy jU.Gv.eC (cp pU.S.fH 59 cU.f4 cU.fE 1 cU.fD))) (gI v1.eb.ia 4 cM.fE 99 sF K 95 L (ir rf.ec.aD.aC 11 di.fp 97 di.ft 57 di.f4 53 di.fE (al af.pT.bH.bH)) (de ah.io (bk cC.fr.hK)))))) (hS i3.iI.iF 4 z1.fp 109 z1.ft 17 z1.f4 (aR m3.bl (bU uH (m6 X.S (nd (w9 ot.bQ.aC 11 cy.p1 127 ct.f6 369 je b1.aS.cH 114 cy.p0) (bM tu.eP.eN 84 iK iZ.wj iY.wj mW.wj 19 dT.eH) (al iD)) (iw rh.ag.dv 85 rN af 130 lo bF 126 bE (mg tC.dJ.aD 35 dL.p7 165 ey hj.bQ.cv 199 ap t8.eK.av 195 aP.n1.eK.av))) (aJ n5.aX 28 c5.p2 44 c5.p1 40 c5.p0 (aZ (nI uY.aS 11 c9.gv 65 c9.fq 163 ap qQ 159 tG) (fb cF vk dN.gP.bm)) (aW jy.xF (aG aN.iG)))) (qu vN (nd (zS fc.eN.cR.b8.bw 97 an oR.b0 oy.b0 17 z9.p5 73 lV.i2) (ek qc.q5 100 hJ jN 1 ct.p7 2 ct.p6 (lf (oS te.pk.S 200 c6.eY c6.eS 99 y7 95 c8.p3 j))) (bD l8.cf 70 hC nq mh 137 et j5 133 lG (e8 rj.S 108 hB au X ad 53 dM.ga))) (lj sK.cz.bi.aD 228 cP.fm aY 228 cP.fm aQ 382 yl dV 64 cM.f5 j (aZ (wx uO.kl 83 cy.ev 146 lo iN 14 dP.ga) (bZ g9.cx.fj.S 152 mK th j5 lG 200 jK kr)) (en ke.eh (aK aw.eN.bp))))) (bc H (nd (kH b1.wj) (lQ qW.S.S 53 z9.fu 153 an aE.iV 63 z9.gO (e2 aE.mv.aI.db 232 ap aE.cx (aT lU.ik 11 dr.gl 1 dr.e1 2 dI.fx) (qY ut aB 111 b7 au)) (m5 L.xQ.bu (h6 i1.gC 104 si k9 60 cO.ga H 56 dM.fE))) (dR ak.S (m5 qQ.bu (mg ng.cx.fj.cQ.aC 11 c6.gl 100 vg oY 157 vb dZ 153 eM)) (ns ts.bi.ae.ia 4 c8.fC 241 cN.f8 72 cN.eH (aG L.bu.iG)))) (nv tg 102 ym L 55 kA k0 51 jZ (hi rl.a0 47 c5.fP c5.gK 203 c5.fp (gy j.kY.aI (bC t0.ho 78 ca aY.wd.bl aQ.wd.bl 101 bN fX.d6 97 d8.d6)) (aZ (ov oJ.cd.aj 23 c7.p1 119 bN e_.bP.g8 93 hO.fj.bI) (o9 dZ.fr))) (ef rn.ho 101 cM.eu aY aQ 71 cM.ez ak 67 af (bD nC.ag.ag.bi.bg.aj 105 cV.fD ak af 573 tj cg 569 b3 (mb uY.e0.gR.aX 84 dL.ev 183 ap bF.fj.bI 179 bE.fj.bI)) (gy aw.pF.iG.eC (fb cF hI b1))))))) +def Dr : ab dp:=(c3 K.AO (hS h3.ae.aC 4 HI 215 HP 211 Ha (aR bd.aF.bl (aR e6 (aJ h3.pk.ag 89 z7.e1 1 z7.gk 2 z7.er (lY rc.aj 23 cy.ez 125 uv ci 99 cy.fK (pL pb.dJ.bm.bg.b2 4 dr.fo 131 c7.fu H 127 w2) (ji b3)) (bT q3.kv.pT.hK.dh 305 ky q3 (hZ iu.aS.eK.bi.aD 173 ap bj.yd.hM.fF 173 ap br.yd.hM.fF 247 ap au.nh.fj.bI 58 dL.f8 e_))) (nd (lZ g3.ho 129 c5.gk c5.er 78 fG bq.aD) (aZ (wH iu.cd.bV 24 ct.fi 170 dy.p4 26 dy.p3 63 dy.p2) (ac bq.i0.gE.cw 88 c6.ev)) (bA d5.cz.cd.bQ 70 cS.p9 17 cS.p8 122 cS.p7 (iM jV)))) (nd (kH j5) (k2 j3.ae 60 an aQ.aC 73 z9.eB 70 z9.fT (hX q9.cd.bi.aS 11 cV.gK 70 dy.f9 173 ct.fD aw (d2 ak.aS.vv.bm)) (aZ (jB rH.ag.bQ.aC 11 cS.fU 80 ep bO.x2.n1 169 iq dN.bV.jd 41 cS.fi) (e5 cZ.dv 46 cO.gL 69 z2.gb bj 65 br))) (nd (pO cZ.aj.S.b2 4 cM.gn 100 uv H 96 nV) (ir xi.b2.b2.aj.ae.aj 183 da.gO 184 da.ev 479 cS.p3 476 cS.p2 (lf (eX o2.aI.cz.S 122 dl.gn e_ 122 ve H 122 dl.gn aP 180 ap l6.hL.bI))) (bA tl.bu.b8 57 c8.p9 1 c8.p8 2 c8.p7 (bk dS.gY))))) (nd (rP eE sc DT 24 (aM cD dE e_) 65 (aM cF dE e_) b1) (bU cj.eN (bc kp (e2 dk.i0.bo 204 fe au (nz n0.aD 61 dI.p7 dI.p6 178 b7 t8.ae 174 aP.n1.ae) (lb d0)) (gW BQ.eK.bw 98 py K L 17 cA.fT 179 b7 o4.cQ (aT zt.ag 51 cO.fL 1 cO.gg 2 cO.eY))) (dQ h7.aI.eN 45 cG.ez 46 cG.fK 17 cG.fN 25 cG.ex (fV oX 86 bv 59 ch 55 xb (lg na.jr 11 dT.fL 112 ch jv.aC 107 bv rJ.aO)) (J eQ.iv.bm.dx 164 c8.f6 (bk gx.gY)))) (az m8.bl 76 je 1 z6.eZ 2 z6.fo (pP dN.eC (fh sX.a0 bd 103 uv bt 83 rb aE 14 cP.e1 aP (fJ aN.AV.eC)) (k3 n0.aS 11 c0.gl e_ 178 b7 h9.ni.ae 69 cA.f6 aE 65 u6 aP (co hQ))) (lj rc.aD 59 cq.p9 e_ 118 cq.p8 e_ 319 cM.ga H 57 cq.fu j (J nk.r4.eF 171 cA.gO (al pS.kv.aX)) (kh sD.e0.gR.bw 69 c7.p4 c7.p3 19 c7.p2 (bZ gG.b6.wj.S 159 hB e3.aI uN d0.aI 82 jc pc)))))) (nd (rP qt sc Bz 28 (aM cD hI e_) 105 (aM cF hI e_) e_) (aR kp (bU L.mu (nd (lL nL.aO.S 114 z7.p2 190 z7.fC H 116 z7.p1 97 kw lR.fF) (nd (uM un.aF.aj 23 cy.p7 80 mL bd.aS 64 mf ak 60 af) (ff oq.b8.bg 121 cA.ex 288 dr.fC 235 dr.gv) (la li.eN 41 d9.f9 d9.ga d9.gj 19 d9.f5)) (ck jU.aF.aC (aG cl.aC.S.gB))) (N CX.eV.dK.fy 51 c5.gd (J au.bm.aX.pF.bo 213 dP.e1 (lf (tJ l8.iI.cx.bw 141 wS bj br 17 dT.fq 215 ds.fm))) (J eM.hU.bP.eV.dK.fy 92 cI.e1 (ff d5.aj 23 cT.fP 76 cT.gK 50 cT.fp)))) (lC cF vk aE.nR (nd (oh qw.bV.a0 116 c4 aw.eN 92 an q4.i9 14 z9.f5) (aZ (lz jl.cY) (lf (tB oJ.iI.ae 85 bN j.v9.fF 109 ak.aS.cH 105 af.aS.cH))) (gz kL.S.S 170 ap b4.bi 76 ey dk 72 e6 (eo pU.S.bV.a0 59 cL.eH 150 r9 iN 14 cL.f8))) (aJ uQ.eK.dm 11 cq.gl 1 cq.e1 2 cq.gk (fS BY.b2 4 dP.fM 69 ey bK 65 ea (aG nq.eK.ce)) (de e3.gY.gD (bC re.aj 83 sb bF bE 67 vd jt 63 gX))))) (lC cF f7 b1 (nd (kH ci) (eR l9.a0 e_ 109 c4 rJ 107 an dO.ce 14 z8.p1 e_ (aJ eI.bu.gR.b8 246 cB.ez 1 cB.fK 2 cB.fN (ml dz.aI.cH) (dd tF aB 247 d1.gd)) (aZ (lL jx.aj.gR.bg 36 cA.f5 106 mM K.xF 38 cA.hH 68 sj i6) (lf (ov qf.aj 23 dM.fz 81 mF dV.bl 55 bt.bP)))) (e2 qL.hU.bo 546 je lT.cH (aZ (qN eI.ja.cR.cQ 231 vl 59 mL bj 55 br) (aK br.vv.cJ.fr)) (bA ua.ag.ag 65 c8.ex 1 c8.fL 2 c8.gg (eo n5.bQ.S 61 dq.fu 60 cT.fq H 56 dq.gO)))) (gI hR.eV.S 90 z6.gj 51 rX X 47 ad (eJ rI.gY (bD wR.eP.aD 66 cB.gH aY aQ 97 cB.eS ak 93 af (ac g2.vv.D8.fy.bz 319 ds.gj)) (jW tw.aS 11 c7.e7 83 ca b1.cY 84 bN bd.fj.bI (iM jX))) (nd (rP j2 wN rZ 24 (aM cD f7 e_) 65 (aM cF f7 e_) e_) (ej i1.a0.cx.bw 64 yM ak af 17 di.ga 138 di.gj (al iX.kv.aX)) (jz fY.aX.mv (lf (yq Bv 40 an 29 dY.f9 60 dY.ga)))))))) +def Dk : ab dp:=(c3 o4 (m6 aw.S (hS qf.b6.bw 107 z1.eY 17 z1.fm 71 z1.gH (bS mW.bm (cu h3.eN.ag 90 kw aV.bI nJ.bI qI.bI 1 z7.fq (N ah.aC.hM.gT 82 cy.fq (em kt.eb.cx.ae.cR.b8.bw 248 dr.p8 dr.p7 17 dI.fA 364 dr.p6) (fb cF mD H)) (bA nm.bl.dm 11 dP.gm 1 dP.fC 2 dP.gv (lf (tR iu.cd.cx.cz.aX 185 ap gX.av 29 dL.ex 205 tI.av)))) (bU aY.aO (bA sZ.bi.dJ 11 c9.eW 1 c9.eH 2 c9.f8 (fJ qL.iG.eC)) (j4 d4.bu (lc hY.aj 23 cU.gm 68 cU.fC 52 cU.gv 48 cU.fq)))) (az gU.a0.ae 89 z5.fK 175 z5.eY 172 z5.eS (lj rz.a0 92 an ak.ia.aS 92 an af.ia.aS 78 an tL.gP 14 z8.fN aP (aW bt.bH (em ts.bi.bp.aj 357 ds.p7 ds.p6 257 ds.p5 253 ds.p4)) (hX i5.cR.aD 68 c7.gn 239 ds.gO 135 da.eB aw (nz j7.gZ 53 dM.p1 dM.p0 83 vj aV 79 cC))) (nd (tJ rh.cs 81 w0 cX cl 73 cq.gK 70 cG.fz) (ej lU.bi.eN 492 mJ rD rM 17 dP.fi 25 dP.eW (lf (wH pg.dK.eP.bg 56 c6.fM 144 c6.fx 58 c6.gn 114 c6.eA))) (bD li.gC.ho 125 y0 bj br 89 vh cg 85 b3 (e5 te.S 65 dq.fq 174 hB aV.mX 170 cC.mX))))) (c3 e4 (nd (kH H) (gA Cv.aj 55 an e4.aC fI.aC iD.aC 101 c4 aw (e2 H.fr.bi.k7.fy 319 ap au.gY (lf (oD fc.cz.dK.S.b2 4 dr.p2 182 b7 dZ.aC.ae 178 eM.aC.ae)) (fb cD fB b1)) (gz qX 96 bv aN 69 ch X 65 ad (ly kn))) (N H.CJ.ib.bo 73 cG.gn (k3 sO.aS.cs 87 hD aY 87 hD aQ 119 dj.eB e_ 116 di.fA bd (i7 l8.cd.ag.bw 92 iK jw.cJ jD.cJ 17 dT.p2 153 et o4.bP)) (fh vO.ag.ag.bi.b8.cJ.aX bd 66 vc af 29 c8.gk e_ 148 iz qy.fr.iH (bk jD.gY)))) (d3 hO (eJ ar.hK.gY (J qp.hM.gT 82 dy.fE (al vS.a0.hK)) (gy af.pD.eC (ms jX))) (gA pb.aO.ho 57 B4 aA aB dD 104 uz bq (du pg.eV.bg 60 wT au X ad 182 lm aN (lf (sG n4.aj.gR.bg 36 c6.fx 357 ap H.cH.mv.bI 38 dl.p3 311 mq.xx.fF))) (iw oJ.cf 78 ca kr.bl 93 bN jy.bI 89 rt.bI (aK ar.CJ.xD.S)))))) (eL mW.aF (nd (rP yE.it wN Dh 28 (t9 cD DA bq) 105 (aM cF f7 bt) b1) (cb eI.dJ.bw 47 z4.ft z4.f4 z4.fE 19 z4.fD (c3 bj.xD.aF (nd (pV ng.aX.aC 11 ct.f8 301 lm aH 410 c9.f6 121 ct.fz) (cp sN.iI.ag 74 c0.p0 dI.e7 1 dI.f6) (al m3)) (J bd.ni.bl.eC.db 80 da.p3 (bC kL.S.S.cz.ae 190 ap H.gP.aI.av j.sx.aI.av 104 ey h5.cY 100 d4.cY))) (N fI.bu.cw 95 cG.fD (aW K.eC.bH (aK ke.io)) (bA nr.cz.ag 66 cI.fM 1 cI.fx 2 cI.gn (al pS)))) (cb hR.q5.b6.bg 136 z5.p4 z5.p3 z5.p2 89 z5.p1 (nd (xu sE.aj 66 an jl.i2 ju.i2 106 fX.b0 102 d8.b0) (J tM.db 72 cV.ga (iR qP.ag 175 b7 b1.aC.ae 1 dr.p2 2 dr.p1)) (du tz.aF.aD 68 yj aA aB dD 101 fe aw.bV (aK hQ))) (nd (oB v1.b2.aj 214 cP.eA cP.f9 501 je H.ae.cH 497 j.wd.cH) (bT iY.D8.aI.hV 148 hC aE.ia (iO uD.eK.hU.gE.cw 232 ap uD.fj.fF)) (de b1.aF.o5.bp (lf (rL s5.b2.b2.q5.aX 79 jc d8 29 dY.gK 99 oI)))))) (m6 pQ (cb nL.g6 96 z5.gK z5.fp z5.ft 1 z5.f4 (eR qU.bQ e_ 66 an oW.aC 17 z9.fU e_ 112 r5 aH (N b1.kB.eC.db 161 cB.p9 (aT pg.dK.ag.dm 11 ds.fE 1 ds.fD 2 ds.fu) (qY gr.b6 aB 151 r9 au)) (bA xl.bu.b8 57 c7.gK 1 c7.fp 2 c7.ft (ly jk))) (gp um.aX 94 xv K L 52 cG.fq 48 wD (ck kJ.h8 (hT rq.cz.S 102 ch my.aC 115 bv j5.aO 111 lG.aO)) (J jv.iv.bm.dx 164 c8.gb (lf (oS rf.cz.b8.bw 61 dq.fi dq.eW 17 dq.eH 183 mH gN.hM))))) (nv qs.bV.pk.ae 104 wt br 65 nW q6 61 nK (eJ iX.gY (gW tE.ag.bw 76 r6 jw jD 17 dy.gm 257 ky bO (dc oC.fr.vr)) (aZ (oD sZ.bi.S 129 pz 70 pp ah 66 aU) (ms jV))) (N mq.cJ.hU.bo 157 ct.fL (aW dN.mX.nS (hZ oZ.fj.aF.cx.aD 339 ap bj.Eb.mv.bI 339 ap br.Eb.mv.bI 319 ap K.kY.xx.fF 82 dl.p4 j)) (aZ (pV tK.cd.aj 23 dT.fD 250 ch bO.bV 141 dT.fu 138 dT.gO) (la eT.ag 40 d9.fP d9.gK d9.fp 1 d9.ft))))))) +def Du : ab dp:=(bc d0 (bc e3 (az mj.eb.aX 62 z1.fT 41 z1.fA 138 z1.eu (aR dk (gA eT.cx.bg 72 kA H.kY mT rB 52 mc i6 (fR i5.eN 119 cy.fz 454 cV.p5 19 cy.gl (ml cl.bm.cH) (ji cj)) (j4 L.xQ.bu (lf (jo oZ.fj.aF.it 245 dL.eu 138 dL.fo 86 Ax 82 w6 j)))) (nd (tR sW.cz.aX 78 fG ie.bw 29 c5.gl 98 gx.aD) (fh vI.kl.cR.cJ.aX bd 62 vf af 29 dy.p9 e_ 583 tj hj (iR qx.gR.b8 143 lA kW 1 ds.gL 2 ds.p9)) (ej bd.kl.cR.bg.cR.eN 122 iz oR.kv.iH oy.kv.iH 17 cS.fM 25 cS.fx (fW gu)))) (cb nt.cf 102 z5.fu z5.gO z5.ev 101 z5.eZ (nd (pN fc.eN.cR.b8.aD 61 an jn.bi.gP o6.bi.gP j.ni.bi.gP 105 lP.b0) (ej rp.dK.cx.bi.aX 58 ct.ev ar ao 171 cV.e7 167 cV.f6 (bk kS.eh)) (bA li.dK.b8.dm 11 cS.fE 1 cS.fD 2 cS.fu (bM kQ.a0.ag 52 rO X hW ld 1 dM.hH))) (nd (uS sQ.a0.b2 4 cG.p0 98 sF H 94 cM.eY) (J kJ.sx.cJ.aO.aO 405 cA.p1 (bZ kt.eb.cx.aF.dB 75 vZ au X ad 156 l0 aN)) (de bF.bH.bp (aG uj.iG))))) (ei nA.a0.aj 85 z2.fD z2.fu 121 z2.gO 118 z2.ev (bU aB.bQ (N lM.pF.eV.bz 71 z8.fL (az rk.pk.ae.cQ 64 cy.gd 161 cP.fN 157 cP.ex (d2 X.jd.pl.bm) (lf (m0 sY.eb.ae 96 z0 211 z1 219 z2))) (gy dZ.iG.eC (aT yN.dm 11 cO.gl 1 cO.e1 2 cO.gk))) (ef eI.cx.aD 67 Aq bj br 55 wV K 51 L (aZ (lB tc.b6 90 fe oj 1 c9.p0 2 dj.e7) (mb uR.aC.S.b2 4 c6.f4 158 l0 bK 154 ea)) (jz vK.vr (em k4.aD 49 cT.f8 cT.fz 75 cT.gl 50 cT.e1)))) (bS aV (nd (oS h7.cx.aD 66 dn.f8 dn.fz 163 dn.eS 50 dn.fD j) (kN lU.S 80 hC dO cj dS 129 cB.ft (aK b1.mX.gP.ib.fr)) (ek sH.S 173 b7 b4.ae 68 c0.eZ 64 py (bk hQ))) (qd mP.aX.aC 11 cq.hH 62 cy.gK 84 cq.fp aw (J l6.mX.aF.sk.aI 199 cA.ft (al t5.mu.bH)) (ck lG.fQ (bZ tD.aD 167 hB jn.x2 o6.x2 j.ni.x2 70 dY.fp aw)))))) (hS fa.jq.eb.ae 128 GQ 73 G0 69 Gf (aR pc (N cl.aF.sk.aI 141 z3.gv (fR i3.e0.ia 11 z7.p8 87 z7.p7 70 z7.p6 (N aB.eC.db 147 cy.f9 (ml aN.aI.cH) (dc j)) (ej uP.eV.S 119 fe eQ dz 68 Ar 64 da.fC (mb iu.bH.bi.cf 83 wZ 189 ap g2.iH.v9 185 kg.iH.v9))) (o1 qW.aj.b2.ae 152 pA uu 89 fG ar.Dg.aD 85 ao.Dg.aD (J rC.aX.pF.bo 211 dP.gl (ac K.o5.av.k7.fy 202 dT.gL)) (ns uZ.bP.ia 4 cI.eH 105 cI.f8 101 c8.ev (em lH.dJ.bw 51 cU.p5 cU.p4 17 cU.p3 190 cU.p2)))) (bS jt.bu (ef j3.iI.aj 90 an tb.i9 ui.i9 122 c4 hQ 118 g7 (e9 mP.ag.iI.aj 119 ct.gb ct.gd 165 cV.ez 162 cV.fK (aG iY.jQ.iG)) (bT X.iH.aI.hV 124 hC cj (bC gF.gZ 57 mF hQ g7 87 dX cj 83 dS))) (gp tA.bg.aj 58 v8 ak af 345 cy.fA 122 cq.eH (J b4.bm.bV.fd 159 dP.eS (cp rs.aF.b2.ag 202 dl.fm dl.gH 1 dl.gm)) (e9 tO.e0.bi.eN 240 c7.eB c7.fT 17 cN.eZ 25 cN.fo (bk b1.eh))))) (N bd.ib.cw 41 z2.fC (aJ nw.ag.dm 11 z4.gn 1 z4.eA 2 z4.f9 (cu qW.cs 85 an H.wd.mv ah.wd.mv aU.wd.mv 75 z8.p5 (ef rp.dK.cQ.cs 70 mG ar ao 175 yV K 171 L (co H.ae.bl.ec) (dd rE.S aB 71 rW)) (ek m1.bP 68 ca CG.bH 1 cA.fM 2 cA.fx (bC wz.S 46 ep ak af 105 iq K 101 L))) (dR b4.S (bD jp.dJ.cs 250 ky bF bE 85 r6 jt 81 gX (bM na.b6 76 ch dZ.aC e_.eK.aC e_.mu.aC 1 dT.gn)) (aZ (lZ kQ.jq.eP.cs 120 y0 c8.fK 80 vh aw) (aK uu.bp)))) (ef jm.iI.aj 98 ym K L 51 kA ak 47 af (eJ aQ.gY (J H.gP.aI.db 116 dy.gk (aK e_.AV.eC.gD)) (iw qn.S 86 bN l6.bI 75 ca gu 71 t7 (ij i3.fg 61 mF g7 91 dX lk 87 kS))) (nd (zL tU.a0.aC 11 cP.fx 88 nY 54 sj) (m5 nB.bu (e8 n5.e0.cJ.fj.S 102 y7 au X ad 207 dl.fm)) (jz cl.cQ.mv (la Aw 36 dY.gd dY.fM dY.fx 1 dY.gn))))))) +def Dl : ab dp:=(d3 ld (N nG.eV.bz 142 GO (aR gq.bP (bS bt.eP (lQ kj.q5.S 189 z7.gn 94 z7.e1 H 90 z7.gg (oT u1.aF.cf 66 rb 108 nV ah 104 aU (lf (qS e_.dm.dm.aX.aF.aX.cz.ae 71 v3 K L 124 wy 120)) (lf (eX jA.eN 37 c5.gb b1 99 c5.fM e_ 37 c5.gb j 19 d9.ez e_))) (fh g9.eN.S e_ 49 va bd 136 wf K 132 wf L (iL o2.aI.S.b2.aj 188 ap aY.bu.d6 aQ.bu.d6 138 dL.fm 134 dL.gH))) (bS oA.aF (k3 pe.cx.aD 521 cS.f4 e_ 637 iz oo.kv.iH 348 ct.er aE 124 cq.eA j (fJ ao.AV.eC)) (ix L.hU.pl.bm (lc jA.ec.aD 113 cT.fu 160 cT.gO 63 cU.fm 26 cU.gH)))) (N gq.bP.dh 59 z5.er (nd (rL pf.b8.fg 160 an b3.iV 75 z9.gH 164 bd.b6.b0) (aZ (eX sY.q5.bi.S 65 mG b1 197 je g2.cH 65 mG j 166 yV e_) (d2 lk.bl.pl.bm)) (ej l8.aI.b8.bw 500 mJ aY.cR aQ.cR 17 c7.eZ 411 dl.gj (aT d5.ik 11 dM.fM 1 dM.fx 2 dM.gn))) (N ao.bg.fd 76 cq.fP (oc oK.dJ.aD 35 dP.eZ 142 hJ h9.bm 121 ct.fx ak 117 af (ij lU.ik.aX 197 jK b3 153 mK aY 149 aQ)) (e9 yi.cz.S.bp.aF.bw 67 c8.p2 v3 17 cN.f6 116 wy (aG uU.iG))))) (op gx (bU b4.bQ (nd (ov uA.aS 11 z8.eA 76 an iN.bi.gP 98 aN.b0) (nd (pV ko.eb.gR.bw 159 ct.fq 264 Ak j 17 ct.gm 126 ct.fC) (iR q7.b8 72 u6 jH 1 c0.f9 2 c0.ga) (fb cD hI b1)) (aZ (qN iy.ec.eV.ae.b2 4 di.eB 119 lJ ah 115 aU) (ff yN.bw 39 dM.fu 219 cL.f9 19 dM.gO))) (dR ak.bg (ck ar.aF.aC (e8 qx.dB 173 jK au X ad 147 dT.e1)) (de bO.bH.bp (bk gN.hK)))) (d3 X (pP ar.Dg (aZ (yD qc.ja 4 cB.gl 39 cB.fz 36 vi) (ac oM.bP.dt 334 dT.p8)) (J cl.xQ.bi.cJ.aO.aO 585 dT.p1 (cp mU.jr.fH 63 cU.fu cU.gO 1 cU.ev))) (cu uQ.eK.bw 93 lF aA aB dD 19 cP.fU (kh vO.ag.ag.bi.b8.bg 99 Cs di.gl 58 u7 (bM lK.bl.cd.aF 177 ap fI.d6 ra.d6 s7.d6 1 dl.p2)) (md j8.fH.bw 135 cN.er 216 ch dV.aC 19 cN.eB (fW af.cx.bu)))))) (cb qf.ag 51 z1.fo z1.fU z1.fi 1 z1.eW (N X.bu.dh 55 z1.p8 (cb eI.dJ.dm 160 z3.p4 z3.p3 z3.p2 1 z3.p1 (eR nF.bQ bd 101 z8.eW e_ 17 z8.eH e_ 67 an oY.aC (az kt.ec.S.ae.bQ 51 ct.ev 17 ct.eZ 251 cV.fp (hZ oP.bl.cf 135 dT.f8 e_ 136 cN.ex aP 99 hD j5 95 hD lG) (fb cD Dj bd)) (J jn.pT.aI.hV 78 da.gL (bC pH.cd.cQ 103 ey q6.cv nK.cv 193 ap sV.av 189 tN.av))) (eR dF.aj.bQ e_ 46 wV bd 17 cG.f4 e_ 74 Aq j (bA mP.ag.dm.dm 11 c9.ga 1 c9.gj 2 c9.f5 (lg qx.gR.aD 35 dT.gv 229 jK dV 147 lA lS)) (J tG.aO.bP.eV.dK.fy 134 cI.fC (ac h5.bi.hL.dx 156 cT.gH)))) (qu af (nd (oh uf.kl 119 c4 aN.aO 117 an au.cQ.ce 14 z9.p3) (J fY.hL.aX.pF.bo 666 c0.e1 (ac jn.y9.jd.eD.kk 221 dr.fK)) (ek g9.aS.ag 87 iK jN.cJ 1 da.p8 2 da.p7 (o9 H.fr))) (e2 qb.pT.hK.dh 305 ky aw (aW ah.iv (bZ rq.cs 111 bv tS.aO rr.aO ad.bi.aO 88 ch kc.aC)) (e9 uZ.aF.bw 174 c7.p0 c0.e7 17 c0.f6 77 c0.fP (aK aB.bQ.bp))))) (aR pq (bc iQ (nd (uS qw.b2 4 u0 104 c4 ah 100 wF) (dQ oP.bl.aj 23 cB.fx 125 cB.gn 119 cB.eA 94 cB.f9 (ac bt.r4.eK.dt 334 dT.eY) (qY gs.b6 aB 260 iJ au)) (ek ts.cJ.b8.b6 153 l0 pq 1 dT.f4 2 dT.fE (lf (lz aV)))) (nd (qS cZ.aj.cx.ae 50 wD K L 100 xv 96) (e9 sL.eb.eb.ae.aF.bw 63 dj.eA wO 17 dj.gj 112 wv (aG bd.aS.eK.ce)) (ix m4.Cn.bm (aG ak.hK.iG)))) (ef kV.aj.b2.aj 50 nW bF bE 109 wt ak 105 af (gI lD.S.cQ.b2.ae 75 dn.gv 62 w3 K 58 L (aZ (qS wI.aj 57 xb K L 92 bv 88) (e5 kK.gR.fg 144 ds.p8 174 c0.fK ar 170 ao)) (aZ (rP l4 iC Ap 32 (aM cD fB e_) 145 (aM cF fB e_) aP) (aK gu))) (nd (rP fk iC sv 20 (aM cD kD e_) 25 (aM cF kD e_) b1) (jW tw.iF 11 di.p5 94 bN H.bI.fF 101 ca vU.bI (al bK.bm.bH.bH)) (de L.aF.o5.bp (em eT.a0 40 d9.eH d9.f8 135 dY.p6 14 dY.p5))))))) +def DI : ab dp:=(eL e6 (cb kj.S 64 HV HZ H9 225 G6 (aR dZ.bP (aR kc (cu kj.eV.eN 87 kw g5.fF gq.fF k6.fF 19 z7.fK (nv um.dJ.aX 100 lF af 106 xt ar 102 ao (iO bq.pD.CI.dt 362 mJ aw.cR) (lf (qz aV))) (dG tX.hL.cH (iO g2.eK.hU.gE.cw 232 ap g2.fj.fF))) (cu oV.dK.aF 51 As ah bK ea 1 c5.ez (fV gr.dK.gR.ae 28 dy.p1 70 dy.p0 66 c9.e7 (bM t0.fH 97 bN dk.g8 nD.g8 tP.g8 1 ds.gd)) (k3 hR.S.eP.cR.aD 75 ep bF.x2.n1 75 ep bE.x2.n1 184 iq b1.kY.bg.jd 50 cS.p4 e_ (aT sY.eb.ae 96 cU.er 211 cU.fA 219 cU.eu)))) (az iy.bQ.ae 207 z5.fi 109 z5.eW 223 z5.eH (ef l9.aD 105 r5 aY aQ 75 an dN.h8 71 ie.h8 (gV rv.fj.fj.cx.bi.a0 60 cV.fE 491 di.p8 137 cV.fD (bZ m1.aD 68 ca oA.aF ue.aF L.Em.aF 91 bN bt.g8)) (oc mU.hL.fj.cQ.aC 11 cS.eH 155 cS.ez aH 79 xr dZ 75 eM (ac K.eC.bu.cw 147 dM.p6))) (nd (jB pe.cQ.aC 11 cM.gj 233 cP.fm aH 367 ky H 57 cM.f5) (J gx.hU.bP.eV.dK.fy 259 dP.fE (lf (rx kL.bV.b2.ag 124 ve 1 c6.f5 2 dl.f9))) (hX d5.cx.aF.aD 66 c8.p4 372 c6.gH 208 c8.eZ aw (ff hY.g6 162 dq.f9 319 dY.fP 1 dq.ga))))) (N b1.ib.cw 41 z2.fi (bU hW.bQ (oT uf.b2 4 z7.p6 69 an nD.aC 65 tP.aC (dQ ma.aS 11 ct.gn 141 cV.eS 270 cV.fm 106 ct.eA (lg rd.b2 11 dI.p5 81 c0.eZ aE 172 b7 bd.ia.ae) (kf ru.iF.aj fY 124 d1.fi e_ 69 d1.eW e_ 65 d1.eH e_)) (eG fc.cz.dK.eN 162 b7 e4.cQ fI.cQ iD.cQ 19 cA.ez (aT mU.cd.ag 51 cO.gd 1 cO.fM 2 cO.fx))) (eg gG.aX.ag 52 po jH 1 cG.fL 2 cG.gg (gV zJ.b6 56 dj.gO 235 cA.ev 1 dj.ev (lf (lB tK.cf 102 hD bt.aO 150 cN.fN 138 dT.gm))) (J jU.aO.bi.hL.dx 156 c8.f4 (dc jl)))) (ei eT.bl 36 z6.eW z6.eH 1 z6.f8 2 z6.fz (az i4.cd.aO.aX 51 AC 29 dn.fL 71 dn.gg (gW tc.bw 65 zr ak af 17 dy.e7 98 fe bO (aT AF.eb.aI.b8.b8 133 dr.fM 1 dr.fx 2 dr.gn)) (fO Bu.cK.S 58 cA.eW 144 cA.fo H 313 dr.gg (bM sC.ag 59 mF gu jV m3.bl 1 cU.ft))) (eR rh.ag.a0 e_ 73 w5 e_ 136 lo aE 14 cP.f6 e_ (hX j8.aX.aC 11 di.fP 68 cA.eW 136 dj.eZ aw (al ak.aX.a0.hK)) (de oo.io (aK h9.CJ.xD.S)))))) (nd (rP eE iC CN 24 (aM cD dE e_) 65 (aM cF dE e_) aP) (aR dk.bl (bU uG (az iT.bl.b6 54 z8.f6 1 z8.fP 2 z8.gK (N bd.FN.eC.db 487 dy.gH (ac tr.GE.bi.k7.fy 80 c0.p5) (dc H)) (aW e_.bV.hK (bC os.bV.aj 89 ey aY.cY aQ.cY 195 ap mY.av 191 iQ.av))) (az n5.bV 22 c5.gj 38 c5.f5 26 c5.hH (ns qc.aS 4 c9.gg 271 dP.ez 107 dP.eu (aK H.kB.eC.gD)) (aZ (pV uy.e0.aF.iF 11 cI.fT 69 vc kP 460 cN.e7 17 cI.fA) (mb n2.ia.b2.ae 128 cU.p8 58 yo K 54 L)))) (bS e6.bu (eR uA.cf e_ 110 an pc.b0 78 an jy.i2 74 an rt.i2 (aZ (pj ii.ho 141 c9.fA 627 mJ qy 277 c9.eu 113 ct.eA j) (lf (jB uw.ag.b6.aD 147 c6.eB 254 bv tI.aO 135 hD b1.kY.cJ 26 c6.fT))) (fO sQ.S.b2.a0 114 da.f9 93 yO aE 14 c7.eS (cp d5.g0 58 cL.gb cL.gd 19 cL.fM))) (hi um.S 56 lF rb 98 nV (fO uP.a0.S 98 wC 72 c9.fx H 157 da.fM (g4 qg.aX.dJ.ae 28 dl.fA 84 dl.eu 80 dl.ez)) (J t5.iv.bm.dx 164 cN.hH (bk iQ.gY))))) (lC cD FB bd (ei kj.it 94 z4.gL z4.p9 99 z4.p8 95 z4.p7 (nd (pN uh.S 61 an q8.gP iS.gP tT.gP 97 qp.aS) (az uw.ag 91 cB.fL 1 cB.gg 2 cB.eY (ml gq.aI.cH) (o9 dO.S)) (aW aQ.bm.bw (iL n2.fj.S 50 rO ak af 145 zp 141 dM.ft))) (dQ tV.fj.ae 137 cM.p2 138 cM.p1 113 cM.p0 273 cq.f9 (fO rk.a0.cR.bg.S 60 dy.f9 181 dy.fx H 277 di.f5 (lg qX.b2 11 c6.eH 126 bv tL.aO 81 ch gS.aC)) (hX nr.cz.aj 23 c8.fm 96 cN.ev 70 cI.fM aw (lf (jo d5.it 317 dq.f5 160 dq.ev 62 zh 58 cT.eS j))))) (lY iP.cz.aD 46 z6.p6 196 kw gf.fF 77 z6.p5 (gp il.cz.bg.aj 62 dn.eH ak af 61 dn.p6 57 dn.p5 (gz yr.aj 91 bv aU 68 ch ak 64 af (lf (wB AF.eb.aI.b8.aD 79 dT.fP 409 dT.eB 137 dr.fM aw))) (gz l3.cK 75 ca uL.bH 86 bN bj.xD.jd 82 uk.jd (lf (eX jm.aD.aF 43 tH e_ 43 cL.f5 H 43 tH aP 1 cU.fo e_)))) (dQ ot.bQ.aj 35 cP.p5 36 cP.p4 181 ct.e1 178 ct.gk (m5 lP.bu (aG au.aC.S.gB)) (kh s6.bg.ag.bw 68 dI.gH dI.gm 19 dI.fC (lf (rP eE wN Bq 24 (aM cD dE e_) 65 (aM cF dE e_) aP)))))))) +def Dw : ab dp:=(d3 b4 (bc ci (eR gF.gZ b1 57 z1.gm e_ 239 iJ X 235 iJ ad (bS d0.eP (gp nL.fj.S 96 se eQ dz 119 z4.gd 115 z4.fM (N H.n1.hM.gT 82 cy.fM (lf (wB uR.aF.bi.aD 120 dI.p9 342 dr.fN 81 c7.ez aw)) (fW bK)) (bD nb.cs 71 hJ aY aQ 118 sg ak 114 af (bM os.eP.aF 187 ap aB.eC.av b1.EQ.eC.av bd.pD.eC.av 1 dL.eA))) (eg uy.ae.ae 111 iz ao.sx 374 c5.gv 370 c5.fq (J jy.bV.fd 159 c9.eB (al ao.fr.aX)) (ej tZ.aI.aX 68 cS.eY ar ao 127 cI.fp 123 cI.ft (g4 re 51 vd 75 sb 131 cT.gg)))) (ei i3.a0.aj 93 z5.fm z5.gH 138 z5.gm 134 z5.fC (gA j3.aD 60 an t5.aC X.gB ad.gB 110 c4 lS (hX ot.e0.aD 118 cV.e1 263 dj.p0 55 ct.fK aw (ac oC.fr.jd.eD.kk 221 dr.p5)) (kN l8.fy.bg 129 wf aE K L 46 va (eo m8.bV.a0 55 cL.fp 110 rW iN 14 cL.ft))) (aJ mP.aX.bP 80 cq.fp 1 cq.ft 2 cq.f4 (kN ko.eb.dB 104 zE au X ad 85 c9.fK (al lS.kv.aX)) (en K.aD.bl.bH (mb BK.bg.ae 58 cT.p8 78 zM K 74 L))))) (c3 cj (az h3.pk.S 112 z4.fm 93 z4.fL 89 z4.gH (eg rz.ag 92 an b1.b0 1 z8.hH 2 z8.gL (gA rn.dK.S 105 Ae au X ad 103 lF b4 (mg qx.gR.aD 35 dI.fM 219 jK hj 147 lA cg 143 b3) (dd lD.S aB 31 rQ)) (gz iy.bV.b2.bp 65 uV aN 191 lm dk 187 e6 (eo iA.kl 48 mH 125 hB aE 14 cO.p0))) (dQ ko.bl.aj 23 cG.p7 79 cG.p6 73 cG.p5 48 cG.p4 (jW oN.cQ.aC 11 dj.eu 75 uV gf 183 lm gS (lf (q1 rq.cz.aj 23 dT.p7 131 bv uG.aO 115 H.bP.aO 111 uc.aO))) (j4 tX.aI.bu (iR rj.iF.ag 75 jc kW 1 cT.fM 2 cT.fx)))) (mi jm.fy.ja 11 z6.fm e_ 100 z6.gH e_ 11 z6.fm aP 43 z6.ez bd (nd (nI gF.gR.aS 11 dn.fM 134 dn.fx 71 fG kO 67 tx) (hX eI.bu.gR.aD 35 dy.fD 115 dj.fp 250 cB.ez aw (dc o6.y9.vr)) (e9 yx.gR.ae.cQ 239 dr.f4 dr.fE 53 c7.fq 50 c7.gb (ly kp))) (az jp.dJ.S 69 r6 242 ky 238 yl (fO o2.bH.a0 131 di.fm 106 rU au 14 di.gH (lf (tR oZ.eK.aD.S.ae 353 ap uL.bm.fF 169 dL.eB 337 h9.bg.hM.fF))) (iw ou.cf 82 ch qp 113 bv u3 109 d0.aO (aK ie.CJ.xD.S)))))) (c3 L.hU.bI (N uU.dh 215 F3 (cb gG.kl 52 z4.fu z4.gO z4.ev 165 z4.eZ (nd (qo gU.dv.ae 101 nX L 78 pv K 74) (N mh.hM.gT 82 ct.fT (aT tw.ik 11 dI.fP 1 dI.gK 2 dI.fp) (iM gx)) (aZ (qj oL.bl.dm.aX 83 dP.p5 159 xh ar 155 ao) (bC rK.cs 94 ey bF.cv bE.cv 196 ap hQ.av 192 g7.av))) (N bF.bu.cw 54 cG.gO (J kJ.aF.hU.gT 116 c9.p8 (fJ jn.x2.eC)) (ix rD.Cn.bm (ff gG.ag.aC 11 cT.fK 73 cT.fN 52 cT.ex)))) (nl aN.AZ (nd (xu g3.aX.dB.aj 76 an aY.bz.gP aQ.bz.gP 116 hQ.b0 112 g7.b0) (aZ (wA jp.S.b2 11 cV.hH 224 ug aE 59 ct.p2) (co ue.aF.ec)) (J lM.bl.eC.db 87 c7.fE (ms hQ))) (fR m9.bV 59 cq.fx 308 ct.fi 202 cP.p7 (J b4.pT.aI.hV 79 dP.p7 (bC pZ.cf 116 bv mY.aO iQ.aO 89 ch dk.aC 85 e6.aC)) (bT nG.AO.kv.hM.bu.bu 61 iz rM.fr.iH (n3 j.GW.aS))))) (bc cC (aJ m2.dv 98 z4.p9 103 z5.fE 99 z5.fD (cu l9.ag 109 c4 j5 ah.aO aU.aO 1 z9.eH (lj ng.cR.aD 127 cB.p5 e_ 197 r6 gx 252 sa dV 121 cy.p0 j (kf i4.b6.aj.cQ.S.a0 e_ 134 c7.fu bt 106 zx aE 14 dr.f9 e_) (dd d5.b6 aA 9 cO.eW)) (J X.ia.hM.gT 82 cA.p0 (ac rJ.bu.cw 178 dM.gL))) (nd (At sB rZ 24 65) (aZ (eX hY.bH.bg 48 cV.fo e_ 241 cV.fP H 50 dj.p7 e_ 64 yM e_) (aK L.AV.vv.cJ.fr)) (fO kV.a0.aj.cR.bV.S 70 c8.e7 155 cI.p2 H 373 cN.f5 (bk qQ.gY)))) (k2 eT.bl.aX 48 rX af 41 z7.fD 38 z7.f4 (bS b1.cY (aZ (jB pW.bV.aC 11 dy.fq 58 cq.eS aH 100 mf H 41 dy.gb) (bZ qP.aj 66 py H ah aU 179 b7 bt.aC.ae)) (fV uR.aC.bQ 61 cS.eY 17 cS.eS 350 cI.ev (e8 gU.dB 93 rW nj g2 kg 60 cL.p3))) (N iS.k7.fy 72 cy.fE (eG q9.bw.bP.bw 82 mG au X ad 19 da.e7 (lf (oS k4.bQ.ag.b6.bw 129 dL.gl dL.e1 17 dL.gk 195 ap aH.bu.d6))) (fh oU.bQ e_ 102 bv L.aO 17 cN.gl e_ 79 ch h9.ni (ji e4))))))) +def DN : ab dp:=(c3 iD (az nw.aj 16 HN 143 H6 140 HB (pK qf.aj 23 z1.eH 81 z1.f8 z1.fz 55 z1.gl (aR gS (lE m2.jq 11 z7.gO 137 z7.ev 86 z6.p0 aw (hi rh.ag.ag 73 rN cy.ev 1 cy.eZ (i7 Ce.cJ.ag.bw 110 ca aY.cR.bI aQ.cR.bI 17 dI.fi 101 bN lT.bl.fF) (aT kb.ec.aX 44 d9.gO 29 d9.ev 64 d9.eZ)) (kh oP.nR.a0 57 da.fE da.fD 138 da.fu (aG rR.aC.S.gB))) (az rf.ec.aX 49 As 29 c5.eW 69 c5.eH (J aQ.iG.hU.gT 190 dy.fM (ff g9.cx.aF 136 wS 471 dl.eW 1 ds.fq)) (ir sT.eP.aD 167 cI.eZ 265 cI.fo 63 cS.fm 38 cS.gH (e8 n5.dB 90 mH H.bm jy rt 64 cL.p0)))) (bc d0.eV (k2 g3.bV.bV.a0 158 an bq.iV 94 z9.gl 14 z9.e1 (fS eI.bu.gR.aS 4 cB.p4 77 r6 dZ 73 eM (e8 re.it 113 yI au X ad 79 c0.p0)) (aW q6.hM (co jk))) (dQ v0.aF.bw 281 cP.fD 117 cM.gH 17 cM.gm 65 cM.fC (aW H.nS.nS (ac b3.i0.gE.cw 92 c6.gO)) (de cg.gY.gD (aG ak.pT.vL))))) (nd (rP sB iC Bo 24 (aM cD nP e_) 65 (aM cF nP e_) b1) (ku aV (aJ l9 97 c4 1 u0 2 z8.fA (lQ j0.cK.S 52 cy.gK 92 cy.e7 H 261 c9.fD (em tl.bg.aj 70 dI.ft dI.f4 183 dI.fE 179 dI.fD) (dc cC)) (kh oP.cx.bg 53 di.gK dj.eW 135 dj.fi (lf (sG pH.dm.bg 36 cO.gK 231 ap H.cH.ce.bi 38 cO.fp 193 mq.mu.av)))) (nd (rP sB iC tt 24 (aM cD nP e_) 65 (aM cF nP e_) bd) (bT bt.rF.aI.hV 199 et u4 (ff jg.aS.fH 142 dT.e1 477 dl.p9 1 dT.gk)) (en nn.bV.hK (ac iY.mu.eV.dK.fy 120 cT.eY)))) (lC cD hI e_ (dQ cZ.jq.cQ 101 dn.fp 102 dn.ft 29 dn.fP 26 dn.gK (hX n7.aS 11 cV.gL 108 wC 64 ct.p0 aw (al bj.iH.bQ)) (aZ (wp zi.bl.ec) (cp ko.fH 55 cL.p6 cL.p5 1 cL.p4))) (nd (rP j2 wN Bk 24 (aM cD f7 e_) 65 (aM cF f7 e_) b1) (aZ (jo od.jr.cz.S 159 da.p4 79 dP.p5 155 yY 151 xh j) (lf (lB k4.bQ.dv 175 ap sP 103 yS 99 dl.e1))) (bD oF.b6.cd.bi.cd.bg.aj 109 cI.ez ak af 138 iz m4.fr.iH 134 rC.fr.iH (aK o3.bp)))))) (nd (yF g3.ia 11 GU 262 iJ au G4 48 GK) (e2 q4.bu.bu.dh 151 iJ iN (bS qI.bm (bc jk (N my.eC.db 63 cy.gn (ac dz.aI.bV.fd 159 c0.gb) (lf (yu lH.S 138 d9.fm d9.gH d9.gm 47 rO))) (J jn.bm.bV.fd 159 da.eY (lf (l5 os.nR.bQ 19 dL.f9 17 dL.ga 191 ap aH.mu.av)))) (gp dF.ec.cz.ae 54 wn K L 186 c5.eB 182 c5.fT (dG dN.hL.cH (i7 ut.dJ.g0 179 b7 aY.cK aQ.cK 17 ds.hH 78 pt aH)) (hX oq.bm.aS 11 cI.fD 80 c8.e7 147 cS.ex aw (hZ d5.cx.aD 74 cU.hH e_ 74 cU.gL e_ 191 cT.er aE 58 cU.eS j)))) (c3 bE.aF (nd (ov nE.b6.aj 23 z9.fM 141 c4 gf.aO 115 bq.bu) (J b1.bi.bV.fd 159 ct.fm (aG mY.fQ)) (nc m9.jq.aC 11 c0.eY 144 c0.p9 46 c0.eS (eo rs.a0 59 cL.fD 107 mH q4 14 cL.fu))) (N hO.aF.vz.bi.aO 59 cq.eZ (md oK.aj 23 dP.fA 143 fe gf 109 dP.eu (iL o2.b6.a0.aj 230 ap aY.qV aQ.qV 82 c6.gb 78 c6.gd)) (hX ua.ag.aj 23 cN.fE 95 cN.eA 69 c8.ex aw (lf (rP eE sc BE 24 (aM cD dE e_) 65 (aM cF dE e_) aP)))))) (cb ru.S 98 z2.eY z2.eS z2.fm 43 z2.gH (qR bK (bc gu (N cj.i0.bo 75 cy.fo (g1 qe.aj 23 c0.gj 164 mK 138 lA aw) (dd cZ.a0 aA 21 cO.f4)) (bD qn.aX 71 ca aE.rF.bH uL.bH 82 bN bF.jd 78 bE.jd (h6 gG.gC 100 mH bt 56 cO.fL H 52 dM.e7))) (lE gG.aX.aj 47 cG.p2 55 cG.p1 56 po hO (ek qn.eK 82 bN e_.dK.bI 1 dj.fL 2 dj.gg (ij Co.cx.ae 100 bv qL 81 ch bj.n1 77 br.n1)) (j4 tM.bu (g4 il.eK.bH.ae 40 cT.p0 131 dq.fL 128 dq.gg)))) (gI kb.eb.b2 4 z6.fC 96 nW X 92 ad (eJ oI.gY (fV sR.S 82 hD 106 dy.fo 94 dy.fU (mb ut.dJ.bH.ae 66 dT.fp 187 b7 ar.yd.ae 183 ao.yd.ae)) (aZ (oB rl.bV.aF.aD 59 ds.fT ds.fA 125 lJ cg 121 b3) (bk kp))) (hi un.aF 48 mL mf 1 cP.gv (jW qn.ia 11 di.fq 103 ca H.cY 86 bN aw.dK.bI (ij na.fg 119 bv iX.aO 88 ch tb.nh 84 ui.nh)) (jz hj.cQ.mv (aT i3 11 dY.eY 1 dY.eS 2 dY.fm))))))) +def Dt : ab dp:=(cb eT.bl 36 GD Gn Gq 1 GA (cb m8.cQ.ae 225 Hj Hd Hg 213 GS (aJ ux.dm 11 z1.fN 1 z1.ex 2 z1.fL (lQ sU.b2.a0 130 z3.gk 75 dX iN 14 z3.er (qR b1.bu (fR uO.ag 71 xj 146 cy.fU 1 cy.eY (em uZ.bP.cs 186 dI.gk dI.er 121 dI.eB 117 dI.fT) (ji cg)) (bA i5.cR.b8 131 da.eB 1 da.fT 2 da.fA (e5 n4.aj.ia.dv 142 dL.fo 90 w6 ar 86 ao))) (bU aH.aO (bD pR.eV.b8.aD 65 sa aY aQ 174 v7 ak 170 af (co j.AV.aF.ec)) (bD gr.eb.q5.bi.aD 150 cS.ez aY aQ 86 xr fX 82 d8 (ac pw.fr.hK.dh 154 cT.f4)))) (eL o4 (gA qJ.cz.S 90 an e_.ae.ce lM.ce ub.ce 114 c4 bt.aO (aW lT.nS (aK ao.cJ.kY.ib.fr)) (bT dk.kv.pT.hK.dh 305 ky dk (aT iP.ik 11 dM.eS 1 dM.fm 2 dM.gH))) (az jp.dJ.bQ 19 cM.p8 17 cM.p7 37 cM.p6 (fO ot.bQ.aF.a0 67 c9.fz 166 pz au 14 dP.fu (iR rq.g6 84 ch iE.aC 1 c6.gL 2 c6.p9)) (ix ar.Cn.bm (lc k8.aS.cs 115 dq.gd 116 dq.fM 70 dq.fx 66 dq.gn))))) (az fk.ec.aX 40 z2.gl 29 z2.e1 60 z2.gk (ku jl (lj j3.aD 60 an oa.aC 60 an om.aC 110 c4 cg 106 z8.eW j (cu s9 122 et ah bK ea 1 cB.fp (g1 uJ.bQ.aC 11 dI.p3 78 dr.f8 144 c0.fi aw) (lf (q0 dz.bI))) (bT ah.AO.kv.hM.bu.bu 61 iz H.kv.iH (aK kn))) (qd ko.bl.iF 11 cG.fm 159 xt 91 cG.fi aw (fh wk.bQ e_ 58 wG bd 17 dj.eH e_ 93 zP j (lf (rL kK.S.q5.aX 91 iK ie.wj 29 dT.fA 111 gx.cJ))) (nc rs.aF.iF 11 c8.gO 186 c8.p6 103 c8.ev (al iX)))) (d3 gN (N k9.iH.ib.bz 57 dn.eY (bT qm.aI.hV 193 et gx (cp oV.dK.cR.aD 63 ds.p1 ds.p0 113 dT.e7)) (fS qP.S 66 pt 179 b7 H.cK 175 j.bg.ae (fW jT))) (N dz.bH.hU.bo 161 cy.eu (bD uE.aD 86 zP bj br 67 wG K 63 L (al ak.pT.bH.bH)) (J bq.r4.iv.bm.dx 164 c7.fL (bC tn.dm.cs 144 hB jl.aI ju.aI 89 jc ke 85 iX)))))) (aR br.eK (aR jV (pK kZ.aj 23 z3.hH 74 z3.gL z3.p9 48 z3.p8 (hi nL.gR.bw 92 z8.fu z8.gO 19 z8.ev (nd (rP j2 wN zy 24 (aM cD f7 e_) 65 (aM cF f7 e_) aP) (h6 jg.cd.gR.a0 89 iK bt.pk 178 et jv.bP 14 dT.eW) (al fI)) (eG uO.a0.ag 83 rN X hW ld 1 da.ga (iL rK.eK.aD 184 ap aY.mu.av aQ.mu.av 63 dL.p9 26 dL.p8))) (hi ul.ae 62 Aq c5.p3 46 wV (fS kL.S 60 ey 162 ap ed 158 d0 (lf (qa eE vy 24 65))) (aZ (eX d5.cz.cf 74 cI.fL e_ 74 vh H 74 cI.fL aP 122 cI.gg e_) (aK aV.bp)))) (bS om.bu (nd (pN iT.cx.cJ.S 81 an e3.i2 uN.gP d0.i2 99 b4.ia.aS) (J lP.i0.bo 68 ct.p8 (fJ aB.ib.iG.eC)) (du qh.it 129 lo nj g2 kg 88 rN b4 (ac j5.bu.cw 186 cL.ga))) (N jv.o5.eD.aI 50 cq.fK (bD ko.eb.fj.S 81 rN ak af 126 lo X 122 ad (bZ sR.g6.bg 106 hD H.kY.cJ mT.cJ rB.cJ 269 bv bt.jQ)) (en oo.ae.eh (e8 jA.ec.cf 65 zh au X ad 167 dq.f9))))) (aJ h3.a0 133 z2.hH 81 z2.gj 14 z2.f5 (nd (kH gf) (nd (nI nE.aD 59 z9.fE 158 z9.fD 65 an eQ.aC 61 dz.aC) (ei uC.ae 51 wT uV 177 vl 173 lm (bZ q7.aD 173 b7 iZ.ni.ae iY.ni.ae mW.ni.ae 76 u6 hO) (dd ut aA 9 cO.ev)) (aZ (nI li.eb.aX.aj 59 cA.gL 60 cA.p9 73 yM K 69 L) (iM kn))) (nd (lz L.xQ) (kh hY.aS.aj 60 dj.fM dj.fx 112 dj.gn (bM qe.b6.bw 190 jK e4 fI iD 19 c6.gk)) (aZ (jo ts.cJ.b8.aD 47 c8.gm 281 cN.fU 245 cN.fi 76 cI.f5 j) (aG K.bu.iG)))) (mi tv.jq 11 z6.p4 e_ 142 z4.gb e_ 11 z6.p4 aP 87 z6.eA bd (dQ uJ.iF 11 dn.p0 52 c5.e7 790 c5.fC 17 c5.f6 (ek uE.b6 90 bv pq 1 dy.eu 2 dy.ez (hT gr.ec.aX.S.ae 90 ds.e1 L 74 wg k0 70 jZ)) (gz l3.gC 93 ca fY.cY 94 bN X.fj.bI 90 ad.fj.bI (o9 K.fr))) (N aN.dt 334 ct.fA (aZ (lL Ad.cz.S.ae.gR.bg 36 di.hH 107 dj.eA H 38 di.gL 69 vf qb) (lb ah.bg.pF.bg)) (aZ (lZ rl.bV.aF.aD 59 dI.f9 dI.ga 125 lJ lS) (co gx))))))) +def DF : ab dp:=(nd (rP j2 iC xY 24 (aM cD f7 e_) 65 (aM cF f7 e_) fY) (nd (kH e_) (aR lG.bP (cu mj.S 80 dX dO cj dS 54 z3.fi (bc bd.bu (nd (pI ng.cx.bg 58 cy.fA aE K L 125 cB.fu) (ac e_.eV.aI.eC.bu.bz 393 dT.ft) (la jm.fy.S 138 d9.fo d9.fU d9.fi 47 d9.eW)) (md ot.bQ.aF.ag 67 da.eH 373 ky nD 1 da.f8 (ac oM.pD.eP.aI.db 103 dL.gg))) (gI i3.S.S 134 c5.e1 79 fG ah.aD 75 aU.aD (ir mZ.aC 11 dy.p8 135 dy.p7 64 dy.p6 60 dy.p5 (lf (w7 pg.dK.ag.bw 86 c6.fp 363 ap q4.hL.bI 19 c6.ft))) (nc li.dK.b8.bw 75 cS.hH 199 cI.gg 19 cS.gL (iM gu)))) (nd (kH th) (nd (tB sE 90 an b4.aS 58 ed.gP 54 d0.gP) (aZ (uS pR.aj.ae.b2 4 cP.p7 174 ct.fD H 170 ct.eW) (d2 j.v9.pl.bm)) (fV re.ec 59 cS.ev 1 cS.eZ 2 cS.fo (ac ob.bo 171 cL.eA))) (dR oj.S (aW my.nS (ql lK.bl.b6.aS 11 dl.fM 35 dl.fx 181 ap tX.hL.bI 177 e_.xx.hL.bI)) (gz jA.dK.e0.bg.ae 73 rY ao 185 wU K 181 L (hT tn.dm.S 73 jc aw 136 hB ed 132 d0))))) (dR ui (bU dO.eN (bc jX (az n7.b6 60 ct.p0 1 cB.e7 2 cB.f6 (fJ j.sx.aI) (lf (m0 h3.a0.aj 89 d1.gO 98 d1.ev 94 d1.eZ))) (fS kZ.eb.ja.ae 224 cA.gk 64 yz K 60 L (aT tn.dm 11 cO.fK 1 cO.fN 2 cO.ex))) (fR ox.dm 88 w0 216 cG.eA 1 cG.eu (ck e_.bi.ce (ql qX.jq 11 dT.fN 23 dT.ex 108 bv e_.eK.aO 104 e_.mu.aO)) (de L.gY.gD (em wE.aI.eN 53 cT.fT cT.fA 17 cT.eu 25 cT.ez)))) (N aw.bu.dh 45 z6.gO (ei j0.cz.ae 44 dn.gk dn.er 201 dn.ga 89 dn.eB (bT ah.iG.dt 237 iB X.bH.kB (ac kJ.vL.hK.bm.dx 164 dr.gm)) (aZ (qK k8.jq.cQ.S 146 c0.er 70 c0.eB 66 dr.ft) (cp rs.ag 59 cL.p0 cU.e7 1 cU.f6))) (N L.aO.hU.bo 308 cy.f4 (J oC.mX.aF.sk.aI 115 cA.fD (al rC.bH.bH)) (fO sN.iI.a0 74 cN.ev 130 yI aE 14 c7.p5 (g4 lH.cz.cd.aX 115 yt 67 zH 252 dY.fL)))))) (d3 ki.cH (aR jX (bU K.mu (nd (lL kj.eV.S 92 z7.eu 193 z5.eu H 94 z7.p3 95 kw l6.bI) (dQ sR.eN 91 cy.hH 92 cy.gL 17 cy.p9 25 cy.p8 (lc tO.S.aC 11 dr.fD 199 dr.fm 236 dr.gH 67 dr.fu) (g4 d5.a0 46 d9.fx 195 d9.gn 14 d9.eA)) (dG bt.e0.cH (aG cX.aC.S.gB))) (eJ L.GB.cJ.fr (gV h7.iI.fH 80 c9.fK 755 dT.gd 1 c9.fN (lf (pd lU.bH.bg 48 ds.fP 138 ds.gm H 50 dT.ez 141 wS))) (hX uW.cx.aS 11 cI.gl 81 c8.fi 201 cS.fC aw (al d8)))) (bS oY.bu (ef qJ.gZ 114 c4 ke iX 72 an aV.i9 68 cC.i9 (bD n7.jr.aj 111 Ak bj br 112 hJ eQ 108 dz (bC oJ.fg 89 bN ar.vL.cH ao.vL.cH 74 ca jl.bI 70 ju.bI)) (iw n7.fg 123 fe dz 72 da.fC K 68 L (nz jA.gZ 57 cL.fi cL.eW 130 r9 X 126 ad))) (az ox.iI.ae 73 cq.fz 505 cB.eZ 502 cB.fo (ck kP.aF.aC (e5 uZ.bP.dm.aX 204 c6.eS 103 c8.p3 ar 99 ao)) (de tG.gY.gD (bk qb.hK))))) (c3 cg (qR bq (ol nF.ia 11 z8.p2 95 an ci.i9 105 c4 gS (im kO.nS (ml eQ.aI.cH) (dd tF aA 21 cO.fu)) (ek oJ.cd.ag 89 bN jH.fj.bI 1 cA.ga 2 cA.gj (hT eT.gC 100 dX k9 56 mF sI 52 jk))) (N bj.ib.hU.bo 60 cM.f8 (k3 od.jr.cx.aD 53 cq.eS aY 53 cq.eS aQ 115 mL e_.kB 50 dj.gH e_ (ql qe.aX.aj 59 dT.gj 60 dT.f5 150 wS ak 146 af)) (j4 bE.bi.bu (bk kW.gY)))) (hi m2.ec 82 z6.eA z6.f9 1 z6.ga (eJ pS.gY (J aQ.gP.cJ.aO.aO 222 dj.gk (ac nj.vv.D8.fy.bz 172 ds.ga)) (fS t0.b2 4 cN.p0 85 bN nJ.bI 81 qI.bI (e5 tW.ag.fg 61 cL.eW 134 r9 bF 130 bE))) (nd (rP j2 wN rT 24 (aM cD f7 e_) 65 (aM cF f7 e_) e_) (aW aH.bm.bw (al ke.kv.aX)) (de gq.kY.ib.fr (cp tq 38 ep dX 1 dY.eA))))))) +def DM : ab dp:=(nd (rP yE.it wN xY 28 (t9 cD DA bq) 105 (aM cF f7 bt) b1) (az g3.eK.ae 52 Gc 37 Hh 34 «GL» (aR dz.bP (bS iY.bm (ei kj.cd.ae 68 z7.fC pv 99 z5.eu 95 nX (lj pW.eP.aX 35 cy.gv e_ 128 mf hj 41 cq.fm e_ 86 mf j (aK oy.io) (fb cD fB e_)) (dG ak.fj.cH (iL os.nR.aD 183 ap cX.eC.av cl.eC.av 63 dL.fK 26 dL.fN))) (e2 L.AZ.bi.cJ.aO.aO 330 iz af.kY.sx (e9 rm.aI.ae 58 c9.ev c9.eZ 41 c9.fo 94 c9.fU (fJ bj.ib.iG.eC)) (de rR.o5.bp (kf o8.S e_ 53 cU.fN e_ 56 cU.ez H 52 cU.ex e_)))) (ei gU.dv 93 z5.eu nX 149 z5.fL 145 z5.gg (nd (rP eE iC x7 24 (aM cD dE e_) 65 (aM cF dE e_) aP) (aW b3.nS (bk d8.ae.eh)) (fO g9.bp 73 da.eu 136 da.eB H 433 dr.ga (cp cZ.g0 46 cL.er cL.eB 19 cL.fT))) (ef sX.aj 61 lF bj br 107 nV K 103 L (dG bK.bm.cH (bM uw.ag.cd.aF 264 bv tL.aO ah.jQ aU.jQ 1 c6.ga)) (en au.cv.bH (aT s0.bP 59 dq.gm 1 dq.fC 2 dq.gv))))) (cb h7.ag 38 z2.fN z2.ex z2.fL 1 z2.gg (aJ gU.dJ.ag 88 se 1 z4.fN 2 z4.ex (m6 jH.S (e2 eM.iG.dt 237 iB gN.bH.kB (co ki.aF.ec) (ac rr.kk 84 d1.fA)) (bD pZ.aD 96 bv bj.ib qL 77 ch t8 73 aP.n1 (g1 fa.eb.aj 23 dM.ev 77 cL.e7 51 cO.er aw))) (N j.ib.hU.bo 55 cG.fx (bD oX.aj 67 ch bF bE 102 bv jt 98 gX (bZ wQ.ag.wj.S 161 et aE.aF.bP K.aF.bP L.aF.bP 94 iK l6.wj)) (ej oF.b6.cd.bi.cd.bu.aD 64 vc jU ka 63 c8.gl 26 c8.e1 (bk jw.gY)))) (eR fc.gC e_ 97 nW k9 53 z4.er b1 49 z6.eS e_ (eJ u4.gY (bD ko.it.aj 104 lo cX cl 85 xj ak 81 af (e8 sN.cf 98 AH au X ad 78 dr.er)) (gW uT.jr.aj 172 b7 qG.cQ oG.cQ 107 c0.gm 103 py j (e5 nA.fg 53 dM.p4 54 rQ bF 50 bE))) (oT nA.bP.S.S 62 cM.fm 105 uz ah 101 aU (ek ou.b8 97 bv iE 1 di.ez 2 di.fK (ac d4.pD.eP.aI.db 97 dL.gK)) (du qX.aj 77 ch e4.aC fI.aC iD.aC 112 bv lP.aO (lb k9.pF.bg)))))) (eL iY.aF (az kb.jq.S 44 FJ 85 Fq 29 FU (az gG.kl 52 z4.gK 165 z3.p4 14 z4.fp (oT nF.S 105 wF 67 an dk.aC 63 e6.aC (nd (oB kt.ec.fj.bg.aj 247 cV.fi cV.eW 203 je nq.cH 199 mh.cH) (ac lM.pF.kY.eF 85 c0.p1) (al ow)) (ek tz.aF.b8 97 fe e_.bV 1 da.p6 2 da.p5 (bM pH.dm.bw 189 ap q3.bP.av uj.bP.av j.hK.bP.av 19 cO.fP))) (nd (At sB Dh 24 65) (aW aE.eC.bH (dc aQ.bm.fr.vr)) (nc sN.jr 11 cI.gb 118 we 62 cI.gd (lf (ro jD))))) (nl ea.AZ (nd (zS iT.cx.bg.ag.bw 107 an sV.b0 tN.b0 17 z9.p1 83 aH.bz.gP) (hX qc.iF 11 cV.f9 121 c9.gm 104 hJ bq (co ka.aF.ec)) (aZ (oD oi.ag.bg.S 73 c9.p5 102 fe H.bV 98 j.bg) (lf (rP fk iC rZ 20 (aM cD kD e_) 25 (aM cF kD e_) e_)))) (qv jx.aj.ia 4 cq.gm 56 cq.fC 52 sj (J iZ.D8.aI.hV 77 dP.hH (g1 qg.eP.cR.aD 67 dl.ex 206 dL.fu 130 c6.p8 aw)) (ix i6.pl.bm (bC gG.b6.cd.bi.aD 145 hB cX.gP.v9 cl.gP.v9 76 mH dN.fr.hM 72 ie.fr.hM))))) (nd (qa eE Bo 24 65) (bc oM (nv qU.S 70 an pc.aC 112 wF X 108 ad (lE pW.aX.aj 47 cB.hH 55 cB.gL 62 mL hO (bZ g9.cf 140 et e3.aO u3 d0.aO 77 hC qp) (dd gr.b6 aA 9 cO.fU)) (fS l3.dJ.aS 4 c7.fP 111 ca K.cR.bI 107 L.cR.bI (ms jk))) (az cZ.aj.cs 96 cM.eu 62 cM.ez 607 ct.ez (ck b1.FZ.h8 (lf (ov ou.cd.aj 23 c6.fz 139 bv au.eN.aO 113 kc.aO))) (jz ka.Gw (ac cl.gP.eF 651 dY.fU)))) (N aA.ib.bP.dh 58 z7.fP (eJ ke.gY (gy mT.aI (dc aH.bm.fr.vr)) (aW e_.GB.bI.aD (ms gu))) (qd sJ.aD 56 cy.ft 279 c9.fz 106 wr hO (aW i6.aD (lf (pN iu.aS.eK.bi.bg 177 ap ci.fr.hM.fF aV.fr.hM.fF cC.fr.hM.fF 225 bq.vz.fj.bI))) (bD mQ.cx.ae 80 bN bj.xD.jd uk.jd 77 ca aE.rF.bH 73 uL.bH (fb cF hI b1))))))) +def DB : ab dp:=(ph gU.cR.bg 112 cU 214 cT (qq h3.ag 218 H1 267 Hs 220 HW 1 Ht (aR fX.bl (pK i3.aD 35 z3.ev 164 z3.eZ z3.fo 53 z3.fU (lE kj.q5.aj 23 z7.eW 120 z7.eH 94 z7.gK aw (lQ g9.a0 124 cP.fE 97 hC au 14 cy.f8 (bM xl.bu.aD 79 bN t5.fF X.jd.fF ad.jd.fF 65 dI.gd) (lf (rP qt wN Bq 28 (aM cD hI e_) 105 (aM cF hI e_) aP))) (aZ (nI sT.aX.aj 59 da.fU 60 da.fi 72 ze K 68 L) (bZ na.cf 92 ch dO.ce gu.aC t7.aC 123 bv tM.aO))) (gp gs.iI.nR.aD 76 fG rA.bw qm.bw 63 c5.f8 26 c5.fz (ej nC.ag.ag.bi.bu.aD 60 vf jU ka 63 dy.f5 26 dy.hH (lf (l5 kK.gR.aI.ae 136 dr.p0 41 ds.gb 172 wS j))) (fV rm.aD.S 66 ze 200 cS.fz 53 cS.gl (bZ g3.dB 90 dX au.bQ o3 ad.bQ 64 mF kr.bl)))) (bc qI.aI (nd (tB sE.S 66 an b4.bi.gP 106 ed.b0 102 d0.b0) (gW jp.g6.bw 67 pm jw jD 17 cB.p0 226 ug bO (bk lk.eh)) (aW fY.bm.xF (dc j))) (N oj.aF.vz.bi.aO 62 cM.fM (aZ (pj BT.b6.cd.bi.aD 183 di.p3 317 iq tI.bI 491 cS.fN 58 c9.f4 j) (e5 uC.iF.dv 93 c6.f6 266 c7.eA ar 262 ao)) (ns te.dJ.aS 4 c8.hH 113 c8.gL 109 c7.e1 (lf (l5 sD.bP.aX 57 cT.gj 29 dq.fD 77 vd gx)))))) (N jZ.eF 138 z2.fE (bU aA.bQ (bc g7 (N tr.cJ.hU.bo 156 cV.fA (d2 t5.pl.bm) (ac gf.bH.bz 199 d1.f4)) (gy kP.Gv.eC (aT i4.cd.ag 43 cO.eH 1 cO.f8 2 cO.fz))) (nd (qK v0.bP.S 93 v8 70 cG.fz 58 cG.gv) (bA ii.eP.b8 57 c9.p4 1 c9.p3 2 c9.p2 (n3 xI.ae.bV.aS)) (J ka.Gg.eD.kk 221 cI.p6 (ij ok.S.ae 53 kA jZ 108 ym cX 104 cl)))) (lC cF hI b1 (hi nA.aI.a0 49 dn.fi dn.eW 94 dn.eH (J uU.dt 334 c9.hH (fJ ci.mX.eC)) (bA dF.jq.b2.ae 164 u5 58 cN.eu 54 wK (cp m8.fH 55 cL.p3 cL.p2 1 cL.p1))) (nd (pO il.eN.cR.ja 4 cq.f5 85 cq.fp H 81 cq.fE) (J lP.r4.eF 166 cA.fp (al qm.bH.bH)) (en aQ.wd.bl.bH (h6 rs.bp 172 hB b4.x2 71 dY.fp H 67 dY.f8)))))) (d3 e_.AV.cH (aR o4.bl (ei BN 45 ap ca 171 z3.fC 60 bN (az pf.b8.jr 4 z7.hH 70 z7.gL 61 z7.p9 (e2 dS.xQ.bu.dK.fy 131 je ad.cH (e5 oi.ag.dm.aX 116 c7.gg 77 wC ar 73 ao) (fb cF mD aV)) (dG oy.e0.cH (aG j.o5.aC.S.gB))) (ef i3.S.cz.ae 83 fG ar.Dg.aD ao.Dg.aD 154 pA b1.mX 150 uu (dG L.cR.cH (ac ao.aF.bl.dt 342 dl.fi)) (eG sT.aX.bl 64 rY ah bK ea 1 cI.eW (ff jA.dK.aF 49 cT.f6 170 cT.fC 1 cU.e1)))) (nl ui (gp hR.bl.bi.cd.eN 99 an K.mu.b0 L.mu.b0 17 z9.eA 25 z9.f9 (dG H.cR.cH (aG ob.fQ)) (dG d8.e0.cH (cp iP.g0 50 cL.eS cL.fm 19 cL.gH))) (N aQ.bH.hU.bo 164 cP.fu (gV nb.eK.aD 106 dP.gg 266 da.eS 65 dP.eY (d2 aN.aI.pl.bm)) (fV ud.dK.aC.aF.b6 126 c7.fu 1 c7.gO 2 c7.ev (bM dF.ag.eP.eN 72 jc q3 uj j.hK 19 dq.p5))))) (c3 kr (qR aU (eR sW.cf bd 90 an kr.mv 82 z8.p6 e_ 70 z7.gL aP (mV h7.iI.ag.bw 76 xj bj br 17 cB.fT 111 lo hj (ij tu.dv 74 hC mh 141 et ar.cJ 137 ao.cJ) (dd rE.S aA 115 dY.gL)) (eG o2.bH.ag 224 ca e_.e0.bH aE.eb.bH aP.e0.bH 1 cA.gd (g1 yU.aj 23 dM.eH 77 cL.eZ 51 cO.eS aw))) (az y4.dJ.b6 93 sF 1 cM.f4 2 cM.fE (gy bt.kY.aI (bZ lW.aj 101 bv iZ.cJ iY.cJ mW.cJ 78 ch bt.aC)) (J pw.jQ.bP.eV.dK.fy 134 c8.eu (aK b1.mX.bp)))) (ef tg 102 ym cX cl 55 kA k0 51 jZ (eJ aY.gY (J bd.pT.F4.eF 161 dj.gl (aK e_.FN.eC.gD)) (aZ (lL qn.bV 24 cN.p6 108 bN ak.nh.jd 26 cA.gn 71 ca mq.bH) (e5 BD.fg 57 cL.ev 94 b7 bF 90 bE))) (cu jx.eV.aF 94 mf aE K L 1 cP.fM (eG od.dm.cJ.aF 233 vl aB b1.EQ bd.pD 1 di.fM (d2 nk.aI.pl.bm)) (jz cX.cQ.mv (fb cF dE b1))))))) +def Ds : ab dp:=(d3 hW (N nB.eV.bz 141 Hf (aR g5.bP (bS ie.bm (bc kn (eg sX.ag 103 nV jN 1 cP.gk 2 cP.er (bk bt.ae.eh) (g4 gr.a0 42 d9.fT 155 d9.fA 14 d9.eu)) (bA m9.jq.bP 40 da.ex 1 da.fL 2 da.gg (aG L.o5.aC.S.gB))) (bS ki.aF (J tr.o5.eD.aI 58 c9.fE (al af.iH.bQ)) (ix K.hU.pl.bm (lf (pd rm.bg 36 cU.fx 92 cU.p7 H 38 cU.gn 54 cT.f6))))) (c3 dz.bI (cu g3.bV.fH 158 an cj.iV ow.iV m3.iV 1 z9.fm (aZ (wJ kV.ec.b2.aF.aS 11 cV.eH 70 sa aH 167 cP.fA 163 v7) (aT uC.iF.cQ.S 117 c6.eA 151 c6.fx 61 c6.gn)) (iw ma.dv 118 yg af 97 hJ jl 93 ju (ij gr.dv 54 rO af 149 dM.ft K 145 L))) (N ar.bg.fd 75 cq.f6 (dG ci.hL.cH (bM i5.aj.b2.ag 195 jK cj ow m3 1 c6.gj)) (eG oF.b6.cd.bi.cd.bm.aF 68 vc aE.kv K.kv L.kv 1 c8.p0 (bZ nr.S 78 sb au X ad 58 vd aN))))) (nd (yw j2 24 65) (ku rt (gI iT.cx.bg.b2 4 z8.gn 99 an dZ.b0 95 eM.b0 (hi nb.S 102 ct.gg sg 63 hJ (al bt.eK.bH) (ac gq.bz 76 d1.gk)) (bT bq.AO.kv.hM.bu.bu 61 iz qb.iH (eo yT.a0 44 vj 85 zw aE 14 cO.p7))) (dQ rn.aj 201 cM.fU 202 cM.fi 97 wr 93 cG.f5 (gy K.kY.aI (ac iS.bP.dt 334 dl.fz)) (fV tD.cQ 74 c8.eW 171 c8.eH 167 c8.f8 (cp ua.bl 49 dq.f4 dq.fE 1 dq.e7)))) (nd (l5 gF.aX 41 mc 29 z6.fL 61 kA j) (az nA.aI.cQ 91 dn.fm 49 dn.gH 45 dn.gm (fh yR.cd.b8 e_ 88 fe jH 1 vi bd 2 dy.fp e_ (eo jg.aS.bV.a0 142 mK 190 jK aE 14 dT.f6)) (J cX.xQ.bi.cJ.aO.aO 585 dT.fx (iM jT))) (nd (wx u1.aF.jr.a0 98 rb 122 Ae aE 14 cP.fo) (ir yi.cz.S.bp.aC 11 di.eW 185 cA.fK 59 vc 55 di.f8 (aG bE.S.gB)) (bD l3.ho 86 bN cX.sk.bI cl.sk.bI 83 ca K.aD.bl 79 L.aD.bl (bM tW.b2.eP.cx.aF 117 yt ah bK ea 1 dY.ez)))))) (aJ qf.ag 51 z1.ev 1 z1.eZ 2 z1.f6 (aR kr.bl (bU au.eN (eg j3.b6 64 an b1.ce 1 z8.fU 2 z8.fi (aJ q9.cd.bi.b6 169 ct.fD 1 ct.fu 2 ct.gO (lf (tJ s8.cs 74 rU bF bE 153 c0.p2 150 cN.fA)) (iM bK)) (gz tz.aF.ae 68 xg br 101 wu h5 97 d4 (i7 os.ag.bw 187 ap sV.av tN.av 17 dL.p1 101 ey bO.cv))) (N aE.vz.bu.cw 53 cG.fp (bA ma.b8 67 c9.fx 1 c9.gn 2 c9.eA (hT kK.gR.iI.S 174 mK fY 148 lA cj 144 dS)) (aZ (qj hY.cQ.dv 80 cS.ga 72 da.ft ar 68 ao) (lf (ro aQ.yb))))) (qu ak (ef nF.fj.S 117 c4 eQ.aO dz.aO 97 an lM.ce 93 ub.ce (gV tk.g0 75 cV.gb 297 dP.gk 19 cV.gd (aK pw.fr.hK.gD)) (bA tu.eP.dJ 11 c7.f9 1 c7.ga 2 c7.gj (o9 bd.S))) (e2 X.cH.o5.eD.aI 126 sa rR (aW ah.aO.bH (hT pZ.cf 116 bv lR.aO 89 ch dk.aC 85 e6.aC)) (en ah.ae.eh (aK aA.bQ.bp))))) (cb kj.S 64 z2.p3 z2.p2 z2.p1 225 z3.fP (bc mY (nd (pN rz.aj 56 an tS.gP rr.gP ad.bi.gP 96 bt.b0) (nd (pd wk.bV 24 cB.gd 84 dy.f8 H 26 cB.fM 89 dy.eB) (ff lU.eV.aD 129 ds.fp 464 dl.f5 73 ds.ft) (dd gs.b6 aA 9 cO.fo)) (aZ (qo pJ.dm.dm.aX.ae.b2.ae 118 wv L 73 wO K 69) (ac iQ.bo 169 cL.gn))) (dR lq.bg (J b1.FZ.sx.cJ.aO.aO 410 cA.p2 (lf (oS k4.cz.dJ.bw 73 c6.ex c6.fL 17 c6.gg 237 ap aH.qV))) (en ui.bV.hK (cp fa.aj.aF.ag 55 dq.gk dq.er 1 dq.eB)))) (aJ m2.ec 82 z6.p0 1 z7.e7 2 z7.f6 (gp pb.bQ.cz.ae 56 w3 K L 77 dn.fC 73 dn.gv (iw uC.bp 185 lm aN 67 wT X 63 ad (ac ob.bP.dt 334 dl.fE)) (aZ (rP l4 iC yc 32 (aM cD fB e_) 145 (aM cF fB e_) b1) (g1 fc.aX.aC 11 cU.fi 96 cU.fL 49 cL.f5 aw))) (N dO.r4.ib.bo 518 dP.e7 (ck K.kY.h8 (n3 d0.ae.bV.aS)) (de ah.AQ.hK.gD (aT gF.dJ 11 dY.p9 1 dY.p8 2 dY.p7))))))) +def DD : ab dp:=(d3 aB.cH (az gU.eb.cQ 78 GR 93 Hk 89 He (aR sI (cu eT.b6.dm 70 dX iN aE.iF aP.aC 1 z3.fz (k2 nw.bl.a0 92 kw aN.fF 129 z7.eu 14 z7.ez (cu u1.aF.jr.ag 98 lF X hW ld 1 cy.fN (ac tS.vz.bi.k7.fy 75 dI.gl) (lf (qz ci))) (eG n7.dm.bw 111 yg aA aB dD 19 da.e1 (ac iQ.pD.eP.aI.db 107 dL.ez))) (ei kZ.eb.cQ 180 c5.eB c5.fT 56 c5.fA 52 wn (aZ (rP l4 iC B5 32 (aM cD fB e_) 145 (aM cF fB e_) b1) (g1 oN.dJ.bQ.aC 11 c6.eu 153 w6 115 ds.ev aw)) (hX re.jq 11 cS.p5 133 v2 63 cS.ev aw (e8 kb.cx.bg 81 xa aE K L 48 tH)))) (N dS.iH.qV 116 z5.fU (eg j3.b8 106 c4 kW 1 z9.fK 2 z9.fN (aZ (jB pJ.dm.dm.aX.aF.iF 11 cV.ft 65 vf kP 285 ep K.cJ.ja 17 cV.f4) (hT mQ.S.S 73 ca ki.aF 92 bN K.g8 88 L.g8)) (J aN.hU.bP.eV.dK.fy 259 cS.eW (ac aE.eC.bu.cw 139 dM.p7))) (fR sK.cz.bg 115 cM.ga 436 cP.fL 118 cq.fN (ej uW.cx.bw 63 ze ak af 17 dP.ft 137 dP.f4 (e8 n4.pk.cf 265 yK au X ad 96 c6.eZ)) (fO jS.bH.bg.S 71 c8.fi 209 c8.eZ H 362 cN.p9 (ac oM.bi.hL.dx 156 dq.gj))))) (d3 H.ja (bU o3 (nd (l5 nF.bQ 101 z8.eW 17 z8.eH 67 an oY.aC) (nd (qK oK.S 66 hJ 109 sg 105 ct.gg) (co t7.ec) (kf gU.cR.bg aP 112 d1.fU e_ 214 d1.fz e_ 210 d1.gl e_)) (kh rl.bV.aF 51 cA.eB cA.eu 1 dj.fz (iR qf.ag 51 mF kn 1 cO.fq 2 cO.gb))) (dR dZ.iI (fh lW e_ 62 ch bd 93 bv ah 89 bv aU (hZ lW.ag 74 ch ah.aC 74 ch aU.aC 1 cN.ex bd 2 dT.gH e_)) (en oI.eh (cp nr.eN 50 dq.gK dq.fp 19 dq.ft)))) (gA m8.cQ 43 iB aA aB dD 80 je aw (eJ h9.hK.gY (md pR.aj.bP.bg 57 cV.p0 180 iB dk.o5.kB 299 c9.p7 (cp cZ.jr.aO.bi.S 79 dr.fq zx 129 w2)) (J kW.xQ.r4.eF 189 c0.eA (cp zB.fH 55 cU.fP cU.gK 1 cU.fp))) (az kK.S 120 et 57 hC 53 iK (mR ru.aD.cR.ja 4 di.f6 137 dj.eZ H 133 dj.fi (dc lV.i2)) (ns tZ.aD.aF.aS 4 c7.eu 249 dI.fL 80 dI.ex (n3 au.bV.aS)))))) (nd (qa eE BA 24 65) (aR jv.bl (nd (rP b1.jq.nR.S iC xY 32 (t9 cD A7 bq) 145 (aM cF vR bt) b1) (nv gU.dJ.dv 100 se dz 123 z4.gb bj 119 br (aJ oL.cx.b8 57 mM 1 cy.p4 2 cy.p3 (g4 oV.a0.aC.S 63 dr.gO 113 dr.ev 29 dr.eZ) (al bq)) (ek pH 71 ey iE 1 da.gb 2 da.gd (aG gq.bm.fr.gB))) (nd (zg ul.aF 229 c5.p8 42 wV 1 c5.f9 2 c5.ga) (aZ (jo qc.aj 23 c9.fL 287 dP.eB 271 dP.fT 107 cV.fM j) (al oI.kv.aX)) (fS uy.e0.aF.aS 4 cI.eB 69 u7 dZ 65 eM (iL i1.cz.ae 52 yo K L 130 cU.p9 126 cU.p8)))) (bS dk.bu (eR rz.ag.b6 e_ 104 an b1.ce.aS 1 z9.p7 e_ 2 z9.f9 bd (J dN.hL.bV.fd 159 cV.gg (ff lU.g0 137 dr.gL 472 dl.hH 19 dr.p9)) (aZ (jo nm.cz.S 272 c0.fq 112 c7.gg 73 yO 69 wC j) (eo mU.jr.bV.a0 63 cL.e1 111 si uI 14 cL.gk))) (eg pb.aO.ag.b8 100 uz jN 1 cq.fT 2 cq.fA (J jH.cx.gE.bz 509 c0.fz (em qg.aX.cz.ae 76 dl.er dl.eB 205 dL.fP 104 dl.fT)) (jz jN.bg.vr (bk mY.gY))))) (op bK (lC cD A4 e_ (eg l9.eN 105 c4 e_.mu 17 z9.gK 25 z9.fp (im ao.mX (ml g5.aI.cH) (dd k8.b6 aB 287 d1.gn)) (aW aY.bm.bw (g1 mU.cd.aj 23 dM.gl 81 cL.eH 55 cO.gd aw))) (nd (pO tV.fj.iF 4 cM.fz 493 je cg.cH 17 cM.p3) (J e_.bV.cH.hU.gT 140 dj.gb (aK K.AV.vv.cJ.fr)) (fO fa.aj.aF.b6.S 123 v2 71 cI.fM H 67 c8.eS (bZ rj.iF.aj 134 hB tS rr ad.bi 79 jc lS)))) (eR hR.aS.S bd 51 z5.gk bd 97 z6.p8 e_ 29 z6.p7 e_ (bS kP.aF (aZ (pj tK.bw 113 dy.fT 174 ch bO 17 dy.fA 94 hD aH) (eo i4.b6.aj.cQ.S.S 84 dr.eA 138 dr.fM H 528 dl.gL)) (jW m1.aC 11 c7.f5 105 bN dV.vz.jd 72 ca fY.FZ.bH (ac aE.cH.eD.aI 226 cU.eW))) (N aE.e0.aI.k7.fy 68 cP.p8 (aW ty.bw (lf (oO j8.cz.b8.cd.iF 4 dL.e7 130 dL.f6 17 dL.er))) (fO sD.dB.a0 73 cN.eA 115 AH aE 14 dI.fm (fb cD vk bd))))))) +def DH : ab dp:=(az fc.a0.ae 45 Hp 129 HO 126 Hy (nd (rP eE iC tt 24 (aM cD dE e_) 65 (aM cF dE e_) bd) (aR bq.bP (bS ed.eP (nd (rL nt.bP.aX 94 kw dz.fF 29 z7.gd 114 qy.bI) (qd jx.pk.aS 11 cy.gb 190 xh 243 cP.eu aw (eo oq.bg.bp 125 c7.ex 82 c7.ez H 243 dr.ez) (fW ah)) (dG aV.hL.cH (bC rK.e0.cQ 98 ey h5.cY d4.cY 192 ap nB.av 188 nG.av))) (gp oV.a0.aj 171 c5.fp ak af 59 c5.eS 55 c5.fm (kN ii.nR.S 106 hJ e3 ed d0 113 c9.eY (al ar.fr.aX)) (bD jg.bp.aj 134 pz bF bE 79 pp jt 75 gX (g1 iu.aD 47 cT.e7 101 cT.hH 55 cU.ez aw)))) (nd (zj cF A7 cl) (o1 uf.S 65 an i6.aC 111 c4 cj 107 dS (J iE.AQ.hK.dh 213 cV.gl (aK d8.io)) (aZ (nI g9.cz.aS 11 c0.fN 35 c0.ex 140 lA K 136 L) (nz iy.gZ 53 cL.fP cL.gK 90 rW X 86 ad))) (dR hW.bg (J jy.aX.pF.bo 674 ds.f8 (dc rr.gP)) (j4 ty.aI.bu (iL s6.bi.ae 72 zM K L 60 cT.p9 56 cT.p8))))) (aJ fk.ec.aX 40 z2.gl 29 z2.e1 60 z2.gk (qR jN (aJ pf.b8.b8 79 z8.ga 1 z8.gj 2 z8.f5 (dR lS.a0 (ac bd.aF.bl.dt 342 dr.fA) (dd lD.S aA 71 dY.gg)) (du ou.aD 62 xb g5 gq k6 101 bv kc (lc ul.S 233 dM.p9 46 cO.p4 105 hB 101 cO.p2))) (nd (pd um.bV 24 cG.p9 78 cG.fq H 26 cG.p8 94 cM.eB) (fS n4.cR.ja 4 dj.fA 184 lm bK 180 ea (bC sR.S.bV.aj 102 hD lk.pF kS.pF 242 ch b1.aX.bV 238 bd.ni.bV)) (o7 rm.iI.ho 209 cN.fp cN.ft 130 c8.er 126 cI.ex j (aT uq.eP.b8 55 cT.fq 1 cT.gb 2 cT.gd)))) (d3 aE.jq (cu il.cz.bm.aF 53 AC ah bK ea 1 dn.gd (fh AI.eK.iI.S bd 180 xh e_ 251 cB.ez H 370 dX d0.fr (dc jn.y9.vr)) (ns Ci.iF.aF.aS 4 cN.fK 409 cN.fm 165 cN.eS (ly jX))) (gp rk.pk.ae.cQ 64 cy.gd K L 161 cP.fN 157 cP.ex (aZ (w9 o8.aj.a0 147 di.gg 126 di.eY 86 rU aE 14 di.eS) (hZ kL.aO.cQ.aC 11 dL.gO e_ 178 ap j.yd.hM.fF 232 ap b1.aS.fj.bI 49 dl.gj e_)) (gV yx.gR.ae.aj 70 cN.eY 235 cN.fq 167 cN.eS (aK dN.CJ.xD.S)))))) (c3 K.hU.bI (eL d4 (ku j.bm (nd (qS dF.iI.aj.ae 72 pv K L 103 nX 99) (N nq.hM.gT 82 ct.eB (e5 fk.dJ.bi.cd.dv 76 c7.p7 114 v2 ar 110 ao) (lf (rP l4 iC xY 32 (aM cD fB e_) 145 (aM cF fB e_) b1))) (J jn.bl.eC.db 82 cA.e7 (mg tC.dJ.aS 11 dL.p0 199 ap h9.ni.eK.av 137 ey H.cQ.cv 133 j.aX.cv))) (mi ul.aF 42 po e_ 42 cG.fP e_ 42 po aP 1 c5.f9 bd (gW sY.eb.ae.eV.aD 180 iB oa.o5.kB om.o5.kB 307 dP.f5 186 cV.p1 j (kf iy.ec.aj.S.ae bd 65 dT.fz e_ 65 dT.gl e_ 121 cN.eu bO)) (kN tZ.aI.S 149 l0 H ah aU 72 vZ (dc lV)))) (qu j.bg (nv l9.dv 121 c4 dz.aO 101 an bj.ae.ce 97 br.ae.ce (J nJ.aI.db 71 cV.gj (co oA.aF.ec)) (ck H.cR.ce (cp ud.fH 51 cL.p9 cL.p8 1 cL.p7))) (dQ i5.aC 11 cq.gd 139 cP.hH 202 cP.gL 119 cq.fM (md ii.eP.aD 70 dP.p9 237 iK ci.pk 65 dP.p8 (bM pZ.g0 112 bv aA.bQ.aO aB.bQ.aO dD.bQ.aO 19 dl.gg)) (bT nB.AO.kv.hM.bu.bu 61 iz rD.fr.iH (n3 H.n1.aS))))) (bc aV (bc mW.aI (eg qU.ag 108 c4 iE 1 z9.fi 2 z9.eW (N fY.Cn.aI.db 74 cB.p7 (mg l3.ag.aS 11 dr.gj 83 ca aH.wd.bl 94 bN dZ.d6 90 eM.d6) (lb aE.S)) (du tq.aS.aj 62 ep g5.ja gq.ja k6.ja 139 iq lP.bI (lf (Ck j)))) (nd (At sB rT 24 65) (ck mq.h8 (bC s9.cs 146 et qG.bP oG.bP 101 iK jt.cJ 97 gX.cJ)) (J jN.bg.jd.eD.kk 221 c8.fx (ff n5.bQ.aj 35 dq.fT 43 dq.fA 60 dq.eu)))) (ol gF.aX.aC 11 z7.fE 87 kA dV.gP 53 mc aw.fF (eg g3.ag.b8 74 fG jN.aD 1 c5.fu 2 c5.gO (du eI.ja.cR.a0 59 cq.fC au X ad 115 nY bt (lf (oD uT.cf 71 c0.eZ 180 b7 g2.ae 176 kg.ae))) (bA oq.bm.b6 143 cS.ex 1 cS.fL 2 cS.gg (ly jV))) (qv ox.cz.aS 4 cy.er 152 ct.gj 74 ct.ga (fO pR.eV.ja.a0 87 dj.p0 188 zm aE 14 di.p0 (bZ kL.fH.bg 106 yS au X ad 182 ap i6.d6)) (bA iu.dB.ag 135 dT.fo 1 dT.fU 2 dT.fi (la gs.ag 42 d9.f4 d9.fE d9.fD 1 d9.fu))))))) +def Dy : ab dp:=(c3 b1.AO (hS tv.aC 4 HY 307 Hv 29 Hz (aR aU.bP (aR iE (bc jN.bu (nd (wA qh.jq 11 cy.fi 149 lo au 72 cP.fP) (i7 tp.aF.bw 82 bN rG.cH pX.cH 17 dI.gv 75 ca lV.bI) (lf (wP bK))) (ix h5.pl.bm (bZ tC.a0 183 ap H.bu.av uU.av aU.bu.av 121 ey bt.cY))) (bU aV.fy (bA pU.dJ.aX.aF.b8 176 dy.fx 1 dy.gn 2 dy.eA (g4 qx.gR.ae 28 ds.fq 482 dl.eH 478 dl.f8)) (fV rm.aD.bQ 62 rY 17 cS.gd 339 cI.gk (co jV)))) (bc iS (nd (q1 qJ.cz.aj 23 z9.er 130 c4 uG 114 H.bP 110 uc) (ir oL.iF.cQ 43 cB.p3 44 cB.p2 29 cB.p1 26 cP.fM (h6 t0.bV.a0 97 bN gS.g8 100 ca gf.cY 14 ds.fU)) (ir jA.dK.gR.aC 11 cS.f6 167 cS.gm 38 cS.fP 29 cS.gK (fW jk))) (lY tA.bu.aD 57 cM.gb 154 rb aE 65 cM.gd (aW aw.nS.nS (ff oN.dJ.g6 91 c6.eZ 190 c6.hH 1 c6.fo)) (en rI.eh (aG au.bu.iG))))) (bc pQ (bU aw.eN (fR iT.bl.aS 11 z8.fK 65 z8.fN 60 z8.ex (N ki.Fy.ib.bo 582 da.ft (iL gG.aj.cR.fg 181 dI.fD K L 76 dI.ft 72 dI.f4) (al cg)) (ck e3.gP.ni (bC tC.cz.ae 191 ap K.iG.ce.bi L.iG.ce.bi 109 ey q6.cv 105 nK.cv))) (nd (wA rj.ja 11 cG.fU 105 cG.e7 aE 49 cG.fP) (ej uP.eV.ae 60 zZ K L 41 cB.fU 96 cB.fi (lf (rP eE sc vo 24 (aM cD dE e_) 65 (aM cF dE e_) bd))) (de cl.o5.bp (iM b1.bu)))) (hi tq 38 ep dX 1 z6.fp (qq cZ.dJ.bg 36 dn.fu 84 dn.gO 38 dn.ev 147 dn.fT (jW tk.b6.aj 23 cV.p9 105 cy.ev aE 79 w5 bq (iL i1.dK.ae.aj 64 wg ak af 88 ds.gl 84 ds.e1)) (jW n0.aS 11 c0.gk 188 b7 ci.nh.ae 69 cA.f6 aw (ly g7))) (nd (wJ sJ.aS 11 cq.gj 106 cM.eu aH 613 c9.fp 60 cM.ez) (nc tE.b6.bw 76 dP.p2 292 cN.p1 19 dP.p1 (aK aH.cJ.kY.ib.fr)) (de bt.cJ.kY.ib.fr (i7 ul.fj.ag.bw 80 jc pS rI 17 dY.eH 151 hB lV.aI)))))) (aR aP.eK (mi sC.a0 59 z1.fx e_ 59 z1.gn e_ 59 z1.eA e_ 259 iJ uD (bS l6.bm (bc dV.bl (N ub.rF.bm.bz 64 cy.eA (ff sQ.S.b2.ag 114 c0.gd 274 dr.fL 1 c0.fM) (fW gx)) (dG b4.bm.cH (e8 oN.eb.bu.cf 89 Ax au X ad 145 dL.eY))) (bU eQ.aO (mR m9.cQ.ia 4 c9.ez 493 mJ tX 126 dP.f8 (bZ rd.ho 71 py g5 gq k6 188 b7 lP.aC.ae)) (o7 oq.bm.aD 121 cI.fp cI.ft 70 tj 66 cS.eY j (ac kJ.mu.eV.dK.fy 67 cT.fD)))) (cb gs.jr.bV 131 z5.fM z5.fx z5.gn 161 z5.eA (nd (pN sE.aj 66 an oC.i2 ty.i2 L.sk.i2 106 kc.b0) (J lR.gE.bz 552 wg (ac u3.kY.eF 925 dl.ga)) (dG o6.bm.cH (nz fc.gZ 53 cL.gO cL.ev 90 b7 X 86 ad))) (N e4.bP.hV 64 cq.eW (gW ii.ag.bw 109 sg bj br 17 dP.fN 78 hJ aH (d2 dz.aI.pl.bm)) (ck jk.fQ (hZ rj.iF.a0 75 jc fX 75 jc d8 156 hB tL 14 cT.fN aP))))) (eL aV (cb h3.pk.S 112 z4.gb z4.gd z4.fM 93 z4.fx (nd (pI m2.it 117 zR au X ad 102 z8.gg) (aJ ma.bP 32 cB.e1 1 cB.gk 2 cB.er (lf (lB g9.cz.b6 136 lA jN 1 c0.p8 2 c0.p7)) (dd h7.b6 aA 9 cO.fE)) (gV o8.aj.ag 135 cA.gm 134 cA.fC 1 cA.gv (co kn))) (fR h7.aI.a0 55 cG.gv 63 cG.fz 90 v8 (ck aV.h8 (bC qP.cz.ae 183 b7 ak.hM.cK af.hM.cK 86 pt h5 82 d4)) (oc rm.iI.ag.aS 11 c8.fA 130 y0 j 82 vh K 78 L (al bt.aI)))) (N lG.bP.dh 56 z6.fq (eJ H.xF.gY (J K.xx.mX.aF.sk.aI 136 dj.f8 (al ao.iH.bQ)) (aZ (jB q7.iF 11 c0.fC 181 b7 bO.ja.ae 104 pt K 17 c0.gv) (co jX))) (N cl.eC.db 481 cB.gj (eG jp.eb.bm.aF 63 sj fI ra s7 1 di.gb (ij qX.dv 120 bv iQ.aO 93 ch qG.aC 89 oG.aC)) (J fY.aX.bl.eD.kk 239 cN.gb (g4 mj 38 dY.fC 115 dY.gv 14 dY.fq))))))) +def Dv : ab dp:=(eL aH (m6 H.S (nd (yF ux.dm 102 z1.gg 254 iJ aE.iF z1.eY 1 z1.eS) (mi sU.b2.a0 130 z3.ez e_ 130 z3.fK e_ 130 z3.fN e_ 75 dX uD (gA kb.dJ.bi.aD 72 kA e4.gP fI.gP iD.gP 60 mc hO.cH (nd (l5 tk.b6.aX 75 cP.fi 29 cy.gH 95 xj j) (d2 aA.aF.pl.bm) (aT jA.dJ 11 d9.gl 1 d9.e1 2 d9.gk)) (J e_.kB.eK.dt 334 c0.ez (iR j8.cx.bp.ag 184 ap b1.aC.iH.v9 1 dL.gm 2 dL.fC))) (cu gs.iI.eP.aF 80 fG H.rF.bw ah.rF.bw aU.rF.bw 1 c5.ex (aW cl.nS (iR rd.ag.b8 184 b7 kx.aC.ae 1 ds.eY 2 ds.eS)) (J pQ.cJ.bi.hL.dx 156 cS.fT (g1 lO.bH.bi.aD 81 cU.fM 482 dq.fo 56 cU.eH aw)))) (eL oG (eR g3.aX.dB e_ 100 an qp.aS 68 an iS.gP 64 an tT.gP (J aU.gP.o5.eD.aI 284 c9.fP (dc b3.cQ.mv)) (gW ng.cR.b8.bw 70 pp jw jD 17 cS.fK 141 pz bO (aT ux.dm 11 dM.gm 1 dM.fC 2 dM.gv))) (fR nA.bP.bw 89 cM.p4 171 cq.gb 19 cM.p3 (bT gS.kv.pT.hK.dh 305 ky gS (aT pZ.ik 11 c6.p4 1 c6.p3 2 c6.p2)) (bD u9.b2.aj.ae.aj.cs 114 di.gl bF bE 77 u7 jt 73 gX (ac ob.bi.hL.dx 156 dq.gL))))) (cb j7.eN 33 z2.fA z2.eu z2.ez 19 z2.fK (ku H.bm (eR gF.bQ.gC bd 75 z8.fN bd 82 z8.gb e_ 70 z8.gd e_ (N au.bu.dt 334 cV.p6 (em lH.jq.cR.bw 79 dr.f6 dr.fP 17 dr.gK 71 dr.fp) (lf (zo aB.cH))) (J dO.nh.cH.hU.aI.aI 74 cA.fN (g1 i4.cd.aj 23 dM.fD 73 dM.p3 47 cO.eH aw))) (nd (qK fa.cx.cf 101 nV 63 rb 59 lF) (J qm.F4.eF 258 di.ev (fJ cl.pD.eC)) (de A9.o5.bp (aG qm.vL)))) (fR eT.cQ 31 z6.eB 39 z6.fT 40 z6.fA (pP aQ.yb (oc tc.aS 11 dy.fP 73 yj j 94 fe lq 90 gN (al kx.bl.bH)) (gy ka.Gv.eC (iM hQ))) (qv fa.cx.b6.aS 4 cP.gO 101 cP.ev 97 cy.fK (aZ (pd uJ.e0.bg 48 di.fD 110 lJ H 50 di.fu 56 cA.eB) (al jy.bH.bH)) (gz gG.cK 80 po j 48 c5.p0 K 44 L (fW jU.cx.bu)))))) (cb g3.gR.iI 60 z1.fE z1.fD z1.fu 108 z1.gO (cu g3.dB 242 iJ nj g2 kg 64 z1.gL (bU oW (m6 ad.S (lY sZ.bg 58 ct.e7 221 vm au 236 mG (iR l3.eP.b8 75 ca jN.kY.bH 1 c0.p4 2 c0.p3) (aT hY.aX 48 d9.p3 29 d9.p2 68 d9.p1)) (aW eQ.iv (pL tC.eb.iF 4 dL.p6 137 ey H.bQ.cv 17 cO.fP))) (nd (yq dF.aj.S 50 po 92 cG.e7 41 cG.f6) (ek mZ.b6 64 ey pq 1 c9.gb 2 c9.gd (lf (sG sH.gR.bg 36 dT.eS 223 b7 K.xF.cK 38 dT.fm 185 i6.ja.ae))) (gV d5.eN.g6 85 cI.eY 84 cI.eS 1 cI.fm (ac mT.eF 177 cT.fL)))) (cb pf.cz.aF 84 z5.p8 z5.p7 z5.p6 1 z5.p5 (cu qw.fH 116 c4 o3 hW.bQ ld.bQ 1 z9.p4 (ir ox.gZ 418 wf 78 cV.gm 101 zE 97 cV.gv (eo rs.aF.b2.a0 202 c6.gH 119 y7 aE 14 c6.gm)) (aZ (oh i5.S.a0 72 hC bd.ia 157 et ci.aO 14 c0.fm) (bZ zY.S 108 iq jv dk e6 53 ep b4))) (N j.fr.pT.hK.dh 63 cq.ex (eG mP.ag.dm.bw 78 rN aA aB dD 19 dP.gj (kf uY.e0.fj.S e_ 183 ap l6.hL.bI 129 ve H 125 dl.gn aP)) (en iX.eh (aK ke.bp))))) (qq h3.ag 218 z2.p6 267 z2.p5 220 z2.p4 1 z2.gL (nd (kH bd.cJ) (lY pf.b8.aD 47 z9.ev 140 an au.jq.aS 87 z9.eZ (az iy.bV.b2.ae 175 lm 57 wT 53 uV (lc g9.cz.aD 467 dl.fp 132 dr.p0 75 ds.e7 26 ds.f6) (dd mj aA 21 cO.eZ)) (fV jS.cz.aD.ae 63 cA.p8 103 cA.p7 99 cA.p6 (g1 lH.eb.aj 23 dM.gk 85 cL.e1 59 cO.ga aw))) (dR af.S (ej Ad.cz.S.ae.e0.cQ 114 wv K L 69 dj.eA 65 wO (bZ pe.aj.b2.eV.bg 95 vg jv dk e6 156 vb aN)) (J oW.iv.bm.dx 164 c8.fq (bM ua.ag 53 vd ah bK ea 1 dq.e1)))) (eg gF.aX.bP 49 mc e_.fF 1 z6.p3 2 z6.p2 (nd (jB qW.ag.iF 11 c5.ft 81 fG bd.pT.bw 172 pA H 17 c5.f4) (bD jx.aj.cs 106 cy.gj bF bE 72 mL nq 68 mh (bC i5.aj.b2.aj 147 mK aY aQ 199 jK cg 195 b3)) (bD pW.aX.cz.ae 66 mM ak.hM af.hM 98 nY h5 94 d4 (ac b1.eh.dh 136 cU.eB))) (hi ko.cx.bg 47 cq.gL cq.fD 83 cq.fE (bT nn.r4.Gp.bm.bz 146 ep aH.cJ.ja (al X.jd.mu.bH)) (jz aU.bg.vr (lf (zv aV)))))))) +def DC : ab dp:=(c3 L.AO (qq gU.cR.bg 116 GT 248 Hi 118 Hl 214 GM (aR kn (aJ eT.b6.dm 11 z3.eW 1 z3.eH 2 z3.f8 (N e_.ae.pF.eV.bz 63 z7.eB (dR kO.a0 (g1 ud.dK.aC.aF.aS 11 dr.fU 94 dr.eA 130 c7.fu aw) (lf (rP qt iC xY 28 (aM cD hI e_) 105 (aM cF hI e_) b1))) (aZ (l5 pe.cQ.bP.aX 69 dP.fD 29 da.fz 89 pp gx) (g1 lK.cx.bg.b2 11 dL.fz 93 wZ 181 ap bd.ia.iH.v9))) (bU bF.bu (ck aE.rF.h8 (iO yJ.kB.ib.gE.cw 244 ap yJ.xF.fF)) (ck A8.fQ (e8 kQ.dK.dB 94 si au.bQ o3 ad.bQ 68 cU.fu)))) (nd (kH lG) (aJ uh.dJ 11 z9.fA 1 z9.eu 2 z9.ez (bT j.fr.hM.bu.dK.fy 112 iB j.mX.kB (d2 af.aS.vv.bm)) (du qM.cd.eP.bg 75 ep ci.mX.n1 aV.mX.n1 cC.mX.n1 168 iq mE.bV.jd (aT h7.ik 11 dM.fA 1 dM.eu 2 dM.ez))) (qd rc.aS 11 cM.eA 71 cq.p5 99 uv aw (J aE.r4.ib.bP.eV.dK.fy 253 dP.gK (lf (l5 o2.aI.cz.bQ 19 dl.f6 17 dl.fP 180 ap bO.d6))) (en lS.eh (ac iQ.bi.hL.dx 156 dq.hH))))) (nd (rP eE sc EB 24 (aM cD dE e_) 65 (aM cF dE e_) aP) (bU dS.eN (ry tv.dv 99 z8.ft 118 z7.ev bj 114 br (e2 nD.i0.bo 204 fe X (co kP.aF.ec) (lf (kH K))) (aZ (wp lT.bl.ec) (aT yU.ag 47 cO.eS 1 cO.fm 2 cO.gH))) (dR j.iI (gV wR.aj 81 zP 205 cA.fu 58 wG (bM j8.fH.aD 92 hD aA.ib aB.ib dD.ib 155 dT.gg)) (jz kP.Gw (hZ ua.a0 53 cT.ga e_ 53 cT.gj e_ 95 sb aE 14 cT.f5 e_)))) (N FO.cx.bz 40 z6.fU (az Bw.b2.ae 91 dn.eB 50 dn.gk 46 dn.er (eG sJ.bw 98 nV au X ad 19 cV.p3 (fJ pQ.vr.aI)) (ek q7.b6 177 b7 xI.aC.ae 1 c0.fA 2 c0.eu (co g7))) (nd (rP fk iC AU 20 (aM cD kD e_) 25 (aM cF kD e_) bd) (aZ (wA wI.b2 11 di.e7 106 bv gf 61 dj.gO) (al rI.kv.aX)) (ck jT.fQ (fW dO.eV.bu)))))) (lC cF F6 b1 (aR iD.bl (dQ dF.ec.aj 23 z3.fx 66 z3.gn 50 z3.eA 46 z3.f9 (nd (tJ dF.fy.b8.bw 95 kw rD.bI rM.bI 17 z7.p0 182 z7.fC) (gI un.aF.aS 4 cy.p6 64 mL lq 60 gN (em d5.b2.ae.cQ 197 ds.eu ds.ez 74 ds.fK 70 ds.fN) (fb cF fB b1)) (ck ka.aF.aC (kf pH.jr.ag e_ 131 ey Df.cv 1 dL.p3 bd 2 dL.hH e_))) (az uq.bl 23 c5.fx 1 c5.gn 2 c5.eA (aZ (qj mP.ag.fg 82 cV.gm 105 cV.gv K 101 L) (bZ qn.dB 83 ca th.cY j5.cY lG.cY 102 bN pc.g8)) (k3 uW.cx.aD 175 cI.fU e_ 175 wU e_ 339 c8.eH aE 67 rY j (al kO)))) (az g3.eb.cQ 82 z5.hH 133 z5.gL 129 z5.p9 (cu nE.g0 111 c4 aA.bQ aB.bQ dD.bQ 19 z9.hH (aZ (lz ju.cY) (ij l3.cz.ae 86 bN pX.cH 83 ca K.AZ.bI 79 L.AZ.bI)) (du BS.aD 165 ap jn.bi o6.bi j.ni.bi 75 ey kc (cp gr.g0 54 cL.fC cL.gv 19 cL.fq))) (ry j7.bQ.cz.ae 121 cM.gH 73 cM.fC K 69 L (jW mZ.aS 11 dP.fx 180 ap iN.bi 68 ey gS (aG mh.eK.ce)) (de ed.gY.gD (mg rj.eb.ae.aC 11 dq.p6 150 hB hj.gP.v9 69 mH H.kv.hM 65 j.fr.hM))))) (cb j0.ag 36 z2.fM z2.fx z2.gn 1 z2.eA (nd (kH aV) (cu uf.ec 103 c4 b1.fy H.ec j.fy 1 z8.p0 (e2 kP.FI.bu.dK.fy 131 je aH.iG (ac uN.bV.fd 159 dr.ex) (o9 aE.S)) (bD jp.eb.bg.aj 83 nY aY aQ 71 mM eQ 67 dz (fW kn))) (dR K.bg (e9 li.eb.ag.bw 113 dj.gm dj.fC 17 dj.gv 77 dj.fq (al b1.dm.mu.bH)) (ck rJ.fQ (lg uq.eP.aD 55 dq.f8 131 jc e_.bP 59 cT.fq aw)))) (lE iP.eN.aj 35 z6.f5 43 z6.hH 50 rX hO (nd (lL cZ.aS.gR.bg 36 dn.gL 96 dn.fq H 38 dn.p9 58 AC aN) (aZ (qS BR.cx.ae 56 ws K L 95 xd 91) (ac lR.aI.eC.bu.bz 393 c6.e7)) (du lK.aO.S 89 rU dO cj dS 229 ca bd.e0.bH (iM kp))) (nd (pj jg.cd.aD 139 ct.ft 200 pm gx 227 ct.f4 126 cq.fM j) (bT oA.yd.hM.bu.dK.fy 112 iB oA.Eb.kB (hZ uC.cx.iI.aC 11 dl.p5 e_ 344 ap j.Eb.mv.bI 312 ap b1.FZ.xx.fF 75 dl.p4 e_)) (du nb.dB 71 Ar au X ad 126 fe lR (co ah))))))) +def DJ : ab dp:=(hS jm.hL.ae 119 HQ 47 Gu 43 Hp (nd (qa eE Bo 24 65) (e2 h9.bm.bu.bu.dh 151 iJ j.aC (ry qM.dm.aX 132 z3.e1 59 dX bF 55 bE (gp iA.eP.S.ae 97 nX K L 74 z7.fC 70 pv (e2 b1.cQ.rF.bm.bz 122 dX xI.fr (ff oq.bg.ae.aj 125 dI.fN 347 dr.p4 82 dI.ex) (cp gr.ag 42 rO si 1 d9.gg)) (J bt.e0.bV.fd 159 dP.fq (ql rK.eK.aS 11 dL.gj 35 dL.f5 192 ap lq.eK.av 188 gN.eK.av))) (bU aQ.aO (J ci.hL.bV.fd 159 c9.e1 (dc ak.pT.sx)) (J k0.cJ.bi.hL.dx 156 cI.fP (lf (oO hY.aS 4 cU.gb 52 cU.gd 48 cT.fp))))) (N k0.Ao.bz 67 z5.fN (eR uA.a0 bd 94 an aw.jq.aS 98 an q8.gP 14 z9.fC e_ (aW aE.cR.nS (aK oI.io)) (J mq.GE.bi.k7.fy 327 c7.eA (eo ko.bV.a0 55 cL.e7 103 vj q4 14 cL.f6))) (dR ad.S (dG cg.cR.cH (aT qg.eP.cR.b8 126 c6.p8 1 c6.p7 2 c6.p6)) (en jH.cv.bH (bk lP.gY))))) (c3 fI (cb gU.dJ.ag 88 z4.fL z4.gg z4.eY 1 z4.eS (cu gs.aI.S 80 an dO.mv cj.mv dS.mv 60 u0 (lY pe.aj.aF 120 cB.fu 358 iB hW.bH.kB 1 cP.fu (lg q7.aS 11 ds.fz 86 py gf 181 b7 aN.aC.ae) (ac gq.gT 92 d1.ez)) (aZ (nI kZ.eN.cR.aS 11 cA.gg 64 cA.eY 118 lJ K 114 L) (h6 iA.gC 103 rW aw 52 cO.fA H 48 cO.p5))) (mi j7.bQ.a0 46 cM.er b1 165 cG.gd aE 48 cG.f9 e_ 93 w0 bd (aZ (qN yr.b2 4 dy.fo 95 bv bK 91 ea) (bC oX.ho 106 bv rA.cJ qm.cJ 87 ch eQ.aC 83 dz.aC)) (bT H.bu.AO.kv.hM.bu.bu 61 iz th.kv.iH (lf (w9 tF.bl.aj 23 cT.p5 78 cT.p4 62 cT.eY H 58 cT.p3))))) (mi eT.bl 36 rX e_ 36 z6.ez e_ 36 rX aP 1 z6.f8 bd (eJ ao.hK.gY (bD tE.aX.aj 58 vm bF bE 108 mf cg 104 b3 (al d0.bl.bH)) (gy bK.iG.eC (ms kp))) (eR kV.ec.b2.aF.aS bd 4 cq.f9 bd 167 cP.fA e_ 163 v7 aP (ek qg.bi.b8 186 lm iE 1 di.fN 2 di.ex (iO h5.mu.hU.gE.cw 232 ap h5.xx.fF)) (gy H.gP.aI (aK ao.CJ.xD.S)))))) (d3 Di.cH (d3 bd.aS (ku q4 (c3 uk.aF (lY pe.cx.bg 53 ct.gl 296 vl X 409 c9.gK (aG jX.fQ) (la jS.S 178 d9.p0 d1.e7 d1.f6 51 d1.fP)) (J aV.cd.aI.db 126 da.p2 (hT s8.aj.aj.b2.ae 102 ey d4.cY 196 ap H.gP.aI.av 192 j.sx.aI.av))) (nd (Aj H.yb) (bD kK.cs 65 hC bF bE 136 et jt 132 gX (aK iX.io)) (eG hR.S.bV.e0.aF 75 ep fI.pD.n1 ra.pD.n1 s7.pD.n1 1 cI.f9 (al rI)))) (qu b1.bg (gA nF.dB 75 an H.d6.aC jy.i9 rt.i9 121 c4 b4.bQ (bT H.bV.rF.bm.bz 114 dX ah.bg (cp rl.eP.bg 63 dr.ft c0.eB 143 c0.er)) (ir oP.bl.cd.ia 11 cN.p5 23 cN.p4 138 cN.ex 126 cN.p3 (aK g7))) (N au.bg.fd 73 cq.fq (bD tc.aD 86 wu aY aQ 73 xg ak 69 af (bC rq.gZ 115 bv ke.aO iX.aO 84 ch ed.nh 80 d0.nh)) (J aA.ib.hU.bP.eV.dK.fy 104 cN.p8 (aT tD.b8 66 dY.fp 1 dY.ft 2 dY.f4))))) (nd (rP eE iC tt 24 (aM cD dE e_) 65 (aM cF dE e_) bd) (bc ob (o1 qJ.S.S 110 r5 aN 76 an aV.h8 72 cC.h8 (lQ pW.aX.S 78 nY 62 mM H 123 dy.ex (hT ti.cx.bi.bQ.S 95 bN bq.vz.jd 80 ca mT.bH 76 rB.bH) (dd gr.a0 aA 21 cO.fi)) (bD mQ.cs 73 ca lk.bl kS.bl 92 bN m4.bI 88 sP (ac gX.bu.cw 137 dM.p8))) (hi rn.bl 89 cM.eB cM.fK 1 cG.fK (aZ (zS tp.bP.aX 82 bN K.hU.fF L.hU.fF 29 dj.p8 102 qy.bI) (lf (ov oX.ag.aj 23 c6.er 140 bv ci.bo 114 aw.aO.aO))) (J dk.iv.bm.dx 164 c8.gd (bk tI.gY)))) (aJ kj.q5.ag 90 z7.gK 1 z7.fp 2 z7.ft (gI iT.eb.ia 4 dn.f9 73 fG H.eN 69 j.bw (du oL.iF.aj 240 yl H ah aU 75 r6 bq (dc ty.fr.vr)) (du ok.aS.ae.aj 124 Ai aA aB dD 69 pp bq (e8 mP.dB 86 vj H.bm jy rt 60 cL.p6))) (N ea.i0.bo 70 cy.e1 (fS eT.cd.gR.aS 4 di.p2 141 iq qQ.bI 137 tG.bI (iO kJ.mu.hU.gE.cw 232 ap kJ.xx.fF)) (mR tK.cd.aS 4 dT.ev 234 ch ak.bV 153 dT.gg (ji bq))))))) +def DE : ab dp:=(nd (kH K) (bc ed (aR th.bP (aR nD (eg kb.dJ.bi.b8 56 mc jH.cH 1 z7.f8 2 z7.fz (N fY.fy.dt 334 cB.fD (kf iu.dB.a0 e_ 134 cN.p1 e_ 119 hD ci.aO 14 cN.p2 aP) (ji ow)) (ix lV.pl.bm (eo pg.a0.bP.S.a0 140 dL.fu 106 Ax aE 14 dL.fi))) (bS dO.bl (J e3.F1.sx.cJ.aO.aO 422 di.p9 (lf (jo eI.b8.jr.it 181 c6.fu 89 c6.f6 262 yK 258 c7.eA j))) (aZ (jo i1.jq.dB 75 cS.f9 76 cS.ga 68 Aa 64 da.ft j) (fW jV)))) (nd (kH aY) (nd (qa eE sv 24 65) (du oZ.cs 209 ct.p3 H ah aU 66 pm bq (d2 nq.vv.bm)) (ck e3.ec.aC (iM jk))) (ol y4.dJ.aS 11 cM.fx 72 cM.fm aE 97 sF aw (bA q9.bw.bP.dm 11 dj.p3 1 dj.p2 2 dj.p1 (iR tO.bQ.ag.b8 160 l0 iE 1 c6.fi 2 c6.eW)) (de bE.bH.bp (aG ah.gY.iG))))) (dR nn (bU dD.bQ (bc jT (aJ jx.cf 60 pm 211 ug 207 ct.p3 (e5 te.cz.ae 178 c0.e7 85 c0.fP K 81 L) (ac H.iI.cx.bz 119 d1.fD)) (gy eM.iG.eC (aT fa.eb.ag 47 cO.er 1 cO.eB 2 cO.fT))) (aJ h7.aI.cQ 85 cG.gl 51 cG.e1 295 cM.eW (aW kr.nS (lg ts.cJ.b8.aS 11 c6.fE 90 yk b1.pD 157 l0 gS)) (kh uR.aC.S 65 yk vZ 146 l0 (bk e_.cz.gY)))) (nd (qz j) (pP aH.yb (gW wQ.ag.bw 127 et jw jD 17 cV.p4 72 hC bO (aK uu.gP.ib.fr)) (eG ut.dJ.b6 167 b7 hW.ae aE.jq.ae aP.ia.ae 1 c0.fU (bk g7))) (N aN.yb.hU.bo 174 cy.fp (J ed.r4.eF 172 cA.f4 (al au.bm.bH.bH)) (bA s6.bg.ag.dm 11 cN.fM 1 cN.fx 2 cN.gn (hZ tW.b2.eP.cz.aD 113 dY.fz e_ 113 dY.gl e_ 99 zH aE 26 dY.e1 e_)))))) (eL b1.CJ.aF (aR jT (ei iy.ec.eN 41 z3.fq z3.gb 17 z3.gd 25 z3.fM (N aE.r4.ae.pF.cw 78 z7.p5 (N b1.EQ.eC.db 487 dy.e1 (aG tr.sx.ni) (aT li.dJ 11 d9.gv 1 d9.fq 2 d9.gb)) (aZ (oh ii.bV.a0 121 fe aN 88 Ar aE 14 da.gv) (lf (lZ j8.cx.bp.aj 78 dL.fM dL.fx 188 ap bt.aC.iH.v9)))) (eJ aE.vv.cJ.fr (aZ (lz ah.cY) (ac L.o5.av.k7.fy 269 dT.p9)) (J vK.cJ.bi.hL.dx 156 cI.fz (al oI)))) (bS gX.bu (cu uA.ag 94 an X.ia.aS hW.ia.aS ld.ia.aS 1 z9.ga (aZ (lz lV.cY) (e5 re.dv 75 dI.eY 99 we ar 95 ao)) (bT ad.iH.aI.hV 124 hC dS (h6 sC.a0 59 mF jT 107 dX uI 14 cL.fU))) (N bO.iH.ib.bo 61 cq.f8 (ck pc.aC (d2 g5.aI.pl.bm)) (nc kV.a0.aj.cR.aX.aC 11 cN.eW 135 c7.ex 74 cN.eH (pL gG.aj.cR.ja 4 dq.p7 64 dq.gm H 60 dq.fq))))) (az j7.dJ 11 z2.gv 1 z2.f8 2 z2.fz (bc ci.eV (eg l9.b8 71 an pw.h8 1 z8.p4 2 z8.p3 (im oI.nS (iL rd.nR.aD 176 b7 bF.ja.ae bE.ja.ae 63 ds.ex 26 ds.fL) (dd dF.b6 aA 9 cO.fD)) (fh oJ.aS.S e_ 74 ca mq.bH 115 bN ak.nh.jd 29 cA.gn e_ (lf (wx rH.a0 48 dX 125 iq dV 14 dM.fP)))) (N u3.hU.bo 548 cP.gl (ej jp.eb.bu.aD 59 sj bF bE 63 dj.eY 26 dj.eS (kf ou.cd.bQ e_ 78 ch aU.aC 17 dT.eu e_ 113 bv bd.pT.cJ)) (en tx.bl.bH (bk b1.wj.gY)))) (mi o0.gR.iI 103 z6.gL e_ 46 z4.er b1 46 z6.eS e_ 94 nW k9 (N q6.iH.ib.bz 63 dn.f5 (J j.sx.aI.db 116 dy.er (al e_.e0.fr.aX)) (oc m1.aS 11 cN.e1 91 bN hj.sk.bI 76 ca kO.bl 72 tx.bl (fW jX))) (N aE.HL.eC.db 487 cB.p6 (m5 nG.bu (dc jl.i2)) (de h9.cJ.kY.ib.fr (fb cD hI e_))))))) +def Dx : ab dp:=(qq gF.bV 24 F3 78 Fq 26 FU 41 FJ (hS gs.b6.cQ 27 GX 54 GY 50 Gc (aR k6.bP (cb sU.b2.ag 130 z3.ex z3.fL z3.gg 1 z3.eY (lE h3.pk.aj 23 z7.eY 119 z7.eS 93 z7.e1 aw (gA sX.aj 61 lF aA aB dD 107 nV bq (lf (qo uy.e0.ae.b2.ae 122 wy L 77 v3 K 73)) (fb cF mD b1)) (ej n7.iI.aj 211 hC bj.ae br.ae 279 da.fm 275 da.gH (iR iu.aS.g6.aX 185 ap gX.d6 113 dL.fq 109 dL.gb))) (bS ue.aF (J aw.ia.hM.gT 82 c9.fu (fJ k0.vr.aI)) (e9 tl.b8.bw 175 cS.p1 cS.p0 17 cI.e7 82 cI.f6 (bM iA.eP.bg 52 iB aE.kB K.kB L.kB 227 cT.ft)))) (aJ m8.jq.S 88 z5.eB 85 z5.fT 29 z5.fA (mV nF.gR.bw 113 c4 sV tN 17 z9.gm 97 an nn.i9 (J rG.hM.gT 82 cV.f8 (d2 kS.bl.pl.bm)) (gV g9.ae.aj 73 c7.fo 157 dI.e1 136 c7.fU (nz il.gZ 49 dM.p5 dM.p4 50 rQ X 46 ad))) (aJ rn.cQ 55 xn 93 xw 89 cG.er (mR oK.eb.iF 4 dP.fo 114 hJ aE.eP 17 da.e1 (aT lW.ag.dm 11 c6.p1 1 c6.p0 2 dl.e7)) (j4 H.e0.aI.bu (aG bK.bu.iG))))) (c3 bq (N fY.aO.bP.dh 59 z4.eB (nd (uM kj.cd.ae.aC 11 z8.f9 111 nX oY 80 pv dZ 76 eM) (nd (zL qh.aj 23 ct.f9 102 ct.p9 76 ct.ga) (fJ k9.mv.aI) (ac rr.bz 84 d1.eB)) (hX kZ.eN.cR.aS 11 cA.fL 74 cN.gj 118 lJ bq (ms kn))) (dR af.bg (ck ao.aF.aC (lf (rP eE sc rg 24 (aM cD dE e_) 65 (aM cF dE e_) e_))) (gW oF.b6.cd.bi.cd.b8.bw 68 u7 jw jD 17 c8.fz 121 di.gl bO (bk aY.gY)))) (d3 ad (pP ao.Dg (nc ma.aC 11 dy.ft 85 c9.p1 38 dy.f4 (aG iS.fQ)) (gy ak.pD.eC (aK jX))) (dQ uO.a0 159 cy.ex 71 cP.fi 116 lo 14 cP.eH (ek kZ.eN.cR.b6 114 lJ jN 1 di.gk 2 di.er (iO K.iG.bl.hU.gE.cw 240 ap K.iG.mv.bI)) (fh qX.ag e_ 108 bv kx.aO 1 cN.fN bd 2 cN.fT e_ (ac aY.wd.eV.eV.dK.fy 188 dY.ex)))))) (aR bd.eK (aJ nx.aS.S 135 z1.p6 145 z1.p5 29 z1.p7 (bU kc (aJ sW.cd.ag 67 z8.f8 1 z8.fz 2 z8.gl (dQ oZ.S.cQ 135 ct.fo 136 ct.fU 133 cV.fu 130 cV.gO (aG hQ.fQ) (lf (rP l4 wN Bq 32 (aM cD fB e_) 145 (aM cF fB e_) aP))) (iw oi.ag.bi.ae 90 wu aQ 77 xg k0 73 jZ (bM rK.fj.aF 188 ap iY.mu.av aE.F1.mu.av aP.iH.mu.av 1 cO.f6))) (dR H.iI (aW jt.bH (ac iQ.bP.dt 334 dl.fu)) (o7 jS.aS.ho 115 cI.gv cI.fq 214 c8.fN 75 cS.p9 j (ac d4.bi.hL.dx 156 cT.gm)))) (nl ah.AZ (cu j3.dm.bw 114 c4 g5.aO gq.aO k6.aO 19 z9.p2 (bA ma.eN 102 cV.fM 17 cV.fx 25 cV.gn (dc b4.y9.vr)) (gz tu.eP.S 141 et bq.bP 92 iK ah.cJ 88 aU.cJ (lf (rP fk iC zy 20 (aM cD kD e_) 25 (aM cF kD e_) aP)))) (az tE.aX 28 cq.gg 50 vm 46 cq.eS (aW aU.iv (ac cX.kB.ib.gE.cw 82 dl.fK)) (fV s0.ia.S 176 c8.p6 85 c0.gK 29 c0.fp (bM eI.cz.gR.ag 77 jc dk nD tP 1 dY.gO))))) (nd (rP qt iC Bq 28 (aM cD hI e_) 105 (aM cF hI e_) bd) (nd (kH ah) (ol nE.aS 11 z9.fo 75 an H.i9 103 c4 bq (qv oP.bl.aS 4 cB.eY 106 cB.ga 97 dy.eH (lf (qN lU.aS.b2 4 va 141 lA ah 137 aU)) (dd n2.S aA 159 d9.fC)) (iw oq.bm.cf 159 l0 aN 82 vZ X 78 ad (ac oM.bo 305 cU.fU))) (nd (qo v6.cK 98 xv L 56 wD K 52) (aZ (pj lK.eP.aD 135 dj.hH 231 ca qy.bI 71 dj.gL 67 dy.p5 j) (al fY.hL.bH.bH)) (ix rC.Cn.bm (aG af.hK.iG)))) (ef lO.ik.aX 107 wt k0 jZ 56 nW bF 52 bE (bS jU.aF (J au.vr.aI.db 73 dy.fL (aK pS.io)) (aW uk.aD (aK jV))) (nd (lz h9.EQ.FI) (gW m1.bw 83 bN rD.bI rM.bI 17 di.p4 80 ca lT.bl (bC k4.bQ.ag.ho 183 ap cX.sk.hL.bI cl.sk.hL.bI 137 ve cg 133 b3)) (bA tD.q5.dm 11 dI.gj 1 dI.f5 2 dI.hH (g4 gs.a0 42 dY.p4 155 dY.p3 14 dY.p2))))))) +def Dn : ab dp:=(c3 dz.bI (hS mj.jq 4 HT 50 H2 46 HX (aR eM.bP (aR pc (bc aU.bu (N d8.i0.bo 66 cy.fL (bk oR.ae.eh) (lf (qz cC))) (aZ (q1 jg.aS.aF.aj 23 da.gk 517 mJ aH.cR 501 m4 497 rC) (ff pg.a0.bP.g6 140 dL.eY 254 dL.p2 1 dL.eS))) (bU L.bu (aW lk.nS (ij m1.fg 99 bN d8.g8 84 ca aY.cY 80 aQ.cY)) (gz zY.cx.aF.aX 73 ep L.pD.n1 128 iq ar.bg.jd 124 ao.bg.jd (aT lO.bH.bi.b8 52 cU.eH 1 cU.f8 2 cU.fz)))) (d3 aP.cH (o1 l9.S 85 an bt.i9 113 c4 dk 109 e6 (ej k4.cx.ae 188 bN h5.fF d4.fF 69 cV.ev 65 cV.eZ (bC tp.bP.cs 94 bN lk.bl.fF kS.bl.fF 119 ca eQ.cR.bI 115 dz.cR.bI)) (du n2.ia.b2.eV.bg 150 cS.eu au X ad 78 xr aN (e5 dF.dv 50 cO.p4 109 cO.p2 K 105 L))) (hi uB.aI.bg 119 Ai pz 60 pp (aW b1.bi.nS (hT tZ.aI.S.S 80 yk ki 165 l0 dk 161 e6)) (J aw.pF.hU.bP.eV.dK.fy 188 c8.p3 (bk nB.gY))))) (dQ j7.dJ 110 z2.eW 15 z2.eH 1 z2.f8 2 z2.fz (bU ld.bQ (ol j3.aS 11 z8.fC 120 r5 gf 68 an bt.ce (eg tk.b6.ag 75 w5 jN 1 cB.fP 2 cB.gK (fJ jH.mv.aI) (ml e6)) (aZ (wp hQ.ec) (aT mU.dm.dm 11 cO.gn 1 cO.eA 2 cO.f9))) (N jH.iH.ib.bo 57 cG.eY (bA j8.aX.bP 132 dj.eZ 1 dj.fo 2 dj.fU (bM iu.dB.aj 97 hD iZ.cJ iY.cJ mW.cJ 143 dT.fC)) (J ka.aO.bi.hL.dx 156 c8.fE (dc ju)))) (ry gU.aX 122 z6.eu 40 z2.gm ak 36 af (eJ aE.bP.gY (bT aH.rF.aI.hV 199 et aP.aO (mg k8.eb.cQ.aC 11 ds.p3 66 wK aH 172 u5 dZ 168 eM)) (aZ (lZ sO.bH.bi.aD 53 c7.fC c7.gv 143 cA.fo aw) (fW hQ))) (fR uO.ec 67 cP.fP 144 cy.fU 1 cP.gK (J bt.xQ.r4.eF 174 cA.eH (al af.aX.a0.hK)) (de ak.cx.gY.gD (co aY.bg.eK)))))) (az gF.cz.aS 4 z1.f6 57 z1.fP 53 z1.gK (aR e6.bl (bU H.bP (lj nw.eP.S 95 z8.fp e_ 95 z8.ft e_ 114 zR e_ 110 z7.ev aP (op qG.xF (iO aw.bQ.bV.rF.bm.bz 114 dX k9.bl.bg) (la d5.ag 46 d9.p7 d9.p6 d9.p5 1 d9.p4)) (bA ii.b6.dm 11 da.fx 1 da.gn 2 da.eA (lf (sG rK.gR.bg 36 dL.p5 230 ap aE.mv.aI.av 38 dL.p4 192 ki.eC.av)))) (fR uq.cQ 47 c5.gL 109 cG.ft 31 c5.p9 (aZ (lZ ma.a0 106 Ak c9.eY 103 hJ bt) (cp d5.b2.ae.aj 193 c6.ez c6.fK 78 c6.fN)) (md bd.kl.cR.bg.cR.a0 64 cI.eu 126 iz j5.kv.iH 141 cI.ez (lf (oO k8.aS.ia 4 cU.p1 54 cU.p0 50 cT.ex))))) (lC cF vk fY.bu (nd (q1 rz.ag.aj 23 z9.p6 124 an uG.b0 108 H.bP.b0 104 uc.b0) (J L.cR.bV.fd 159 cV.gH (mb oX.ag.aS 4 cN.fT 114 bv qQ.aO 110 tG.aO)) (gV ii.b6.bw 109 c7.fm 269 c0.gn 19 c7.gH (ac iS.bo 783 cU.f9))) (eg sJ.b8 102 wr jH 1 cq.p7 2 cq.p6 (hX ma.aD 35 dP.eA 148 da.f9 71 c9.fx aw (iO my.kB.ib.gE.cw 244 ap my.xF.fF)) (de mq.hK.gD (em nA.a0.cs 197 dY.fi dY.eW 598 dY.fK 594 dY.fN))))) (nd (rP j2 wN Bq 24 (aM cD f7 e_) 65 (aM cF f7 e_) aP) (az nL.S.a0 96 z4.p6 119 z4.ga 14 z4.p5 (eg fc.eN.cR.b8.b8 101 an kx.b0 1 z9.ft 2 z9.f4 (o1 tq.aj.ae 78 ep af.aS 62 dX ak.y9 58 af.y9 (iL uT.cd.aD 172 b7 bj.yd.ae br.yd.ae 71 ds.eW 67 ds.eH) (dd yG aA 115 d9.fz)) (m5 mY.bu (lf (wx kQ.kl 52 si 165 zp aE 14 dM.f4)))) (nd (pV ii.aX 58 xg 248 et aH 83 fe 79 wu) (jW pU.dJ.aX.aF.aD 55 dj.gd 168 iB ue.Eb.kB 180 dy.fx aw (bC l8.iI.cz.S 193 jK cg b3 149 mK ah 145 aU)) (J vS.pF.kY.eF 75 c8.gH (eo hY.S.a0 162 dq.fo 82 zh aE 14 dq.fU)))) (bc b1.fy (gI gs.iI.b2 4 dn.p3 72 fG ow 68 m3 (ej wk.aX 89 xd K L 58 dy.f8 54 ws (ac bt.nh.vv.D8.fy.bz 82 dT.gK)) (aZ (pj uY.b8.bw 147 c7.hH 232 bN aH.d6 17 c7.gL 81 rU bO) (aT fc.aX.bP 45 cL.f5 1 cL.hH 2 cL.gL))) (N kJ.o5.eD.aI 53 cP.p3 (bT jw.kY.sx.cJ.aO.aO 500 tj cX (aG jH.aC.S.gB)) (ck oM.fQ (lf (yu hR.S 98 dY.gj dY.f5 dY.hH 43 ep)))))))) +def DK : ab dp:=(d3 cX (bc aV (az sC.a0 59 z1.fC 107 z1.gg 14 z1.gv (bS aV.bm (nd (oh m2.kl 98 se aN 139 AA dV 14 z7.fM) (N j.GW.hM.gT 82 cy.fx (ac b4.y9.jd.eD.kk 221 dI.p8) (fb cD FM bd)) (bD oi.b2.dv 116 sg k0 jZ 77 hJ aY 73 aQ (i7 mZ.bH.g0 186 ap nB.av nG.av 17 dL.gn 96 ey aH.cY))) (nd (sG iT.eb.gR.bg 36 c5.gH 123 fG dN.eC.aD 38 c5.gm 85 bt.rF.bw) (J bK.bm.bV.fd 159 c9.fT (bC sH.e0.cQ 80 pt h5 d4 185 b7 aY.cK 181 aQ.cK)) (J vK.jd.eD.kk 221 cI.f4 (aG d0.aC)))) (nl nn (aJ nE.ik 11 z9.fq 1 z9.gb 2 z9.gd (J oA.Fy.ib.bo 529 da.f4 (ac lP.r4.iv.bm.dx 164 dr.p3)) (aZ (rx qe.ag 134 lA 1 va 2 c0.gg) (cp dF.g0 50 cL.fK cL.fN 19 cL.ex))) (nd (qK cZ.eV.bp 86 cq.fE 54 cq.fD 50 cq.gL) (dG aP.fj.cH (aG rG.eK.ce)) (ck e_.aO.fQ (em pb.dJ.b8.bw 589 dY.fA dY.eu 17 dq.eA 204 dq.p3))))) (c3 ow (pK gU.dJ.aj 23 z4.gm 118 z4.fC z4.gv 92 z4.fq (k2 nE.b6 99 c4 jN 1 z8.p9 2 z8.p8 (dQ oK.aX 35 cB.fU 94 cB.fi 62 cB.eW 58 zZ (pL qx.e0.iF 4 dI.fx 191 jK H 17 dr.p9) (dd cZ.b6 aA 9 cO.ft)) (du qg.bi.aD 60 uV g5 gq k6 190 lm kc (cp tn.bw 43 dM.fo jc 19 dM.fi))) (qv ko.bl.aS 4 cG.p3 60 cG.gv 51 cM.fL (fV Cr.ja.ae 140 dj.ez 323 cA.eS 320 cA.fm (mb rq.cz.aS 4 dT.p6 115 bv uH.aO 111 oW.aO)) (j4 e_.xx.aI.bu (bk bq.gY)))) (d3 L (eJ d8.gY (J bt.cd.aI.db 126 dy.fu (ml uN.cH)) (J aE.kB.aF.eD.kk 66 c7.gd (e5 h3.fg 57 cL.gK 94 rW bF 90 bE))) (nd (qo eI.bu.gR.aX 73 r6 L 246 yl K 242) (gV k4.cx.eN 125 di.gm 133 di.fC 19 di.gv (aT eI.b8.dm.cJ.ag.dm 11 dL.f4 1 dL.fE 2 dL.fD)) (iw oU.S 106 bv bt.aO 79 ch g2 75 kg (lb bj.ib.bg)))))) (eL aE.r4.aF (N bK.bu.dh 269 Fq (bU ke (lj m8.jq.cs 103 z8.er e_ 104 z8.eB e_ 104 kw m4.bI 100 kw sP (aJ ot.e0.b8 51 ct.fK 1 cy.fp 2 ct.fN (d2 rG.vv.bm) (dc ci)) (bA n0.b6 65 cA.f6 1 cA.fP 2 cA.gK (bC mZ.bH.b6.ho 194 ap ar.ni.eK.av ao.ni.eK.av 144 ey dN.aX.cv 140 ie.aX.cv))) (N bE.bu.cw 180 cG.ev (bT jv.vL.hM.bu.dK.fy 122 iB jv.o5.kB (fJ o6.x2.eC)) (ix rM.Cn.bm (bk dZ.gY)))) (N jN.eV.bz 46 z6.e7 (gA qU.it 100 an dO.cQ.ce cj.cQ.ce dS.cQ.ce 124 c4 lR.aO (J e_.eV.gE.bz 552 mJ (co H.AO.bl.ec)) (kN jx.eV.fj.S 158 yY au X ad 86 da.p1 (ms g7))) (dQ sZ.bw 175 cP.p6 416 ct.eH 17 cq.gn 159 cq.eA (aZ (qN ii.aX.b2 4 vi 95 fe hW 91 ld) (h6 oU.S.a0 118 bv oM.aO 109 ch au.ce 14 dl.eY)) (aZ (lL u9.b2.aj.ae.aj.gR.bg 36 c7.gk 111 c8.p2 H 38 c7.er 73 vc qb) (lc gr.gC.iF 11 dY.fE 118 dY.fD 273 dY.eB 17 dY.fu))))) (aJ i3.b8 49 z3.gK 1 z3.fp 2 z3.ft (bc e3.eV (ol qU.jq 11 z9.f8 120 an e_.ae.ce 108 c4 fY.fy (N aP.cH.o5.eD.aI 56 ct.fP (aG gu.fQ) (dd d5.b6 aB 301 FE.e7)) (eG pR.eV.ja.ag 87 mG ah bK ea 1 cS.e7 (ff iA.a0.ag 48 dM.ga 235 cL.gj 1 dM.gj))) (az zu.hL.S 123 cq.fo 96 cM.eY 150 cq.fi (aW q6.aD (lb fY.bg.pF.bg)) (aZ (wB qk.dm.cd.aX.bl.aD 65 c8.gn 230 cN.gL 154 cI.p2 aw) (ff i4.b6.b6.bg 56 cT.fL 450 dY.fo 81 dq.ez)))) (bc A8 (ei oV.ec.aD 47 c5.ev c5.eZ 63 c5.fo 26 c5.fU (bD jx.cf.aj 219 ug bF bE 76 pm jt 72 gX (ac qL.bP.dt 334 dl.ft)) (aW dk.nS (bk gu))) (N tT.k7.fy 64 cy.fD (bT bq.bQ.xQ.bu.dK.fy 131 je aw.iF.cH (aG bd.h8.S.gB)) (du ti.cx.bi.S 68 ca dO.bl gu t7 83 bN l6.bI (ji fI))))))) +def mC : ab dp:=(ph iA.eP.bg 100 z9 225 dn (hS hY.aj 16 z3 52 z4 48 z5 (ph d5.ag 46 c5 1 cG (im kO (ph il.ec.bQ 19 dj 17 dP Ez Fv) (hS cZ.ec.aD 38 c0 63 dI 26 di Fn E2)) (im kW (im dS EP EL) (hS h3.a0.aj 89 c6 98 dl 94 dL Ej EV))) (im d8 (nd (Bj fa.jq.iF fY 4 cP e_ 17 cy e_) (nd (wl fY) E3 EC) (c3 oa Dr Dk)) (ph i1.ag 44 dy 1 c9 (nd (rP l4 wN Bq 32 (aM cD fB e_) 145 (aM cF fB e_) bd) Du Dl) (c3 b3 DI Dw)))) (az hY.aS 4 z6 52 z7 48 z8 (im fX (im tx (az j0.dK.aX 28 di 44 da 40 cA DN Dt) (ph cZ.dK.aF 42 dr 1 ds DF DM)) (az jS.S 178 ct 51 cB 47 cV (nd (w4 jN) DB Ds) (bc nn DD DH))) (ph d5.aj 16 cM 50 cq (hS tg 224 dT 121 cS 200 cI (im cj Dy Dv) (c3 om DC DJ)) (im cg (az fk.ec.aX 40 c8 29 cN 60 c7 DE Dx) (nd (yw j2 24 65) Dn DK))))) +def bx : dp→Bool:=sf mC +theorem DQ : ay bx Ez = true := by decide +kernel +theorem Ee : ay bx Fv = true := by decide +kernel +theorem DY : ay bx Fn = true := by decide +kernel +theorem D9 : ay bx E2 = true := by decide +kernel +theorem D5 : ay bx EP = true := by decide +kernel +theorem DV : ay bx EL = true := by decide +kernel +theorem D0 : ay bx Ej = true := by decide +kernel +theorem DS : ay bx EV = true := by decide +kernel +theorem D3 : ay bx E3 = true := by decide +kernel +theorem DX : ay bx EC = true := by decide +kernel +theorem Dd : ay bx Dr = true := by decide +kernel +theorem Da : ay bx Dk = true := by decide +kernel +theorem CY : ay bx Du = true := by decide +kernel +theorem C9 : ay bx Dl = true := by decide +kernel +theorem C8 : ay bx DI = true := by decide +kernel +theorem CO : ay bx Dw = true := by decide +kernel +theorem CA : ay bx DN = true := by decide +kernel +theorem C5 : ay bx Dt = true := by decide +kernel +theorem CZ : ay bx DF = true := by decide +kernel +theorem C7 : ay bx DM = true := by decide +kernel +theorem C0 : ay bx DB = true := by decide +kernel +theorem C6 : ay bx Ds = true := by decide +kernel +theorem CM : ay bx DD = true := by decide +kernel +theorem Cy : ay bx DH = true := by decide +kernel +theorem CQ : ay bx Dy = true := by decide +kernel +theorem CS : ay bx Dv = true := by decide +kernel +theorem C4 : ay bx DC = true := by decide +kernel +theorem CV : ay bx DJ = true := by decide +kernel +theorem CT : ay bx DE = true := by decide +kernel +theorem Db : ay bx Dx = true := by decide +kernel +theorem CK : ay bx Dn = true := by decide +kernel +theorem Dc : ay bx DK = true := by decide +kernel +theorem ew (x:dp) {l r : ab dp} + (hx : bx x = true) (hl : ay bx l = true) (hr : ay bx r = true) : + ay bx (nd x l r) = true := by + change (bx x&&ay bx l&&ay bx r) = true + rw [hx,hl,hr]; rfl +theorem AS : ay (sf mC) mC = true := + (ew (oH iA.eP.bg 100 z9 225 dn) (by decide +kernel) (ew (m0 hY.aj 16 z3 52 z4 48 z5) (by decide +kernel) (ew (oH d5.ag 46 c5 1 cG) (by decide +kernel) (ew (km kO) (by decide +kernel) (ew (oH il.ec.bQ 19 dj 17 dP) (by decide +kernel) DQ Ee) (ew (m0 cZ.ec.aD 38 c0 63 dI 26 di) (by decide +kernel) DY D9)) (ew (km kW) (by decide +kernel) (ew (km dS) (by decide +kernel) D5 DV) (ew (m0 h3.a0.aj 89 c6 98 dl 94 dL) (by decide +kernel) D0 DS))) (ew (km d8) (by decide +kernel) (ew (Bj fa.jq.iF fY 4 cP e_ 17 cy e_) (by decide +kernel) (ew (wl fY) (by decide +kernel) D3 DX) (ew (q0 oa) (by decide +kernel) Dd Da)) (ew (oH i1.ag 44 dy 1 c9) (by decide +kernel) (ew (rP l4 wN Bq 32 (aM cD fB e_) 145 (aM cF fB e_) bd) (by decide +kernel) CY C9) (ew (q0 b3) (by decide +kernel) C8 CO)))) (ew (oe hY.aS 4 z6 52 z7 48 z8) (by decide +kernel) (ew (km fX) (by decide +kernel) (ew (km tx) (by decide +kernel) (ew (oe j0.dK.aX 28 di 44 da 40 cA) (by decide +kernel) CA C5) (ew (oH cZ.dK.aF 42 dr 1 ds) (by decide +kernel) CZ C7)) (ew (oe jS.S 178 ct 51 cB 47 cV) (by decide +kernel) (ew (w4 jN) (by decide +kernel) C0 C6) (ew (AG nn) (by decide +kernel) CM Cy))) (ew (oH d5.aj 16 cM 50 cq) (by decide +kernel) (ew (m0 tg 224 dT 121 cS 200 cI) (by decide +kernel) (ew (km cj) (by decide +kernel) CQ CS) (ew (q0 om) (by decide +kernel) C4 CV)) (ew (km cg) (by decide +kernel) (ew (oe fk.ec.aX 40 c8 29 cN 60 c7) (by decide +kernel) CT Db) (ew (yw j2 24 65) (by decide +kernel) CK Dc))))) +def uX (idx:Pos) (q w : List Bool) : Bool := + match ig mC idx with + | none => false + | some x => + let y:=fw x + let z:=hG q .qB w + Cz y.state z.state&&lp y.front z.front&&lp y.past z.past +theorem am (idx:Pos) (q w : List Bool) + (h : uX idx q w = true) (r:ai) : + cE (BL (bf default (be q)) (be w+>r)) lr := by + unfold uX at h + rcases hx : ig mC idx with _ | x + · rw [hx] at h; contradiction + · rw [hx] at h + dsimp only at h + simp only [Bool.and_eq_true,zQ,oE] at h + rcases h with ⟨⟨hs,hf⟩,hp⟩ + have heq : fw x = hG q .qB w := by + rcases h1 : fw x with ⟨p1,f1,s1⟩ + rcases h2 : hG q .qB w with ⟨p2,f2,s2⟩ + rw [h1,h2] at hs hf hp + dsimp only at hs hf hp + subst hs hf hp + rfl + have hs_g:=Be mC AS idx x hx r + rw [heq,pE] at hs_g + exact hs_g +theorem AW (d:cm) (us : List W) : + cn d us = bf default (be ([false]++bW d++bG us)) := by + unfold cn + simp [x8] +theorem xO : r8 := by + intro d a b c r + rw [AW d [a,b,c]] + cases d <;> cases a <;> cases b <;> cases c + · exact ⟨am d1.fK ([false]++bW cD++bG kD) aA (by decide +kernel) r,am d1.fN ([false]++bW cD++bG kD) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.ex ([false]++bW cD++bG f7) aA (by decide +kernel) r,am d1.fL ([false]++bW cD++bG f7) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.gg ([false]++bW cD++bG nP) aA (by decide +kernel) r,am d1.eY ([false]++bW cD++bG nP) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.eS ([false]++bW cD++bG vR) aA (by decide +kernel) r,am d1.fm ([false]++bW cD++bG vR) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.gH ([false]++bW cD++bG dE) aA (by decide +kernel) r,am d1.gm ([false]++bW cD++bG dE) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.fC ([false]++bW cD++bG hI) aA (by decide +kernel) r,am d1.gv ([false]++bW cD++bG hI) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.fq ([false]++bW cD++bG mD) aA (by decide +kernel) r,am d1.gb ([false]++bW cD++bG mD) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.fM ([false]++bW cD++bG fB) aA (by decide +kernel) r,am d1.fx ([false]++bW cD++bG fB) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.eA ([false]++bW cF++bG kD) aA (by decide +kernel) r,am d1.f9 ([false]++bW cF++bG kD) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.ga ([false]++bW cF++bG f7) aA (by decide +kernel) r,am d1.gj ([false]++bW cF++bG f7) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.f5 ([false]++bW cF++bG nP) aA (by decide +kernel) r,am d1.hH ([false]++bW cF++bG nP) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.gL ([false]++bW cF++bG vR) aA (by decide +kernel) r,am d1.p9 ([false]++bW cF++bG vR) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.p8 ([false]++bW cF++bG dE) aA (by decide +kernel) r,am d1.p7 ([false]++bW cF++bG dE) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.p6 ([false]++bW cF++bG hI) aA (by decide +kernel) r,am d1.p5 ([false]++bW cF++bG hI) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.p4 ([false]++bW cF++bG mD) aA (by decide +kernel) r,am d1.p3 ([false]++bW cF++bG mD) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.p1 ([false]++bW cF++bG fB) aA (by decide +kernel) r,am d1.p0 ([false]++bW cF++bG fB) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ +end + + + +@[expose] public section + +theorem is_does_not_halt : IsNotHalt target_tm := + BusyBeaver.Excursion.does_not_halt_of_advances CR + ⟨.CD, [.UA, .UT, .UA, .UA], _, by decide, rfl⟩ (y3 xO) + +theorem is_not_halt : IsNotHalt target := by rw [target_eq]; exact is_does_not_halt + +end + +end BusyBeaver.M_1RB1RF_1LC0LF_HHH0LD_0LE1LD_0RF0LB_1RA1RE diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RF_1LC0RD_HHH0LD_1LE0LD_1RA0RF_0RE0LB.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RF_1LC0RD_HHH0LD_1LE0LD_1RA0RF_0RE0LB.lean new file mode 100644 index 00000000..33463324 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RF_1LC0RD_HHH0LD_1LE0LD_1RA0RF_0RE0LB.lean @@ -0,0 +1,49 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RB1RF_1LC0RD_HHH0LD_1LE0LD_1RA0RF_0RE0LB + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1LC0RD_HHH0LD_1LE0LD_1RA0RF_0RE0LB" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +def stateMap_m0689 : Fin 6 → Fin 6 + | 0 => 3 -- m0689 state A + | 1 => 4 -- m0689 state B + | 2 => 0 -- m0689 state C + | 3 => 5 -- m0689 state D + | 4 => 1 -- m0689 state E + | 5 => 2 -- m0689 state F + +public section + +theorem is_not_halt : IsNotHalt target := by + exact Counter.does_not_halt_of_conj_stem + (M_tgt := target) + (M_src := BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA.target) + (σ := stateMap_m0689) (f := true) + (c₁ := (default : ListBlank (Fin 2)) {{2}}> default) + (by decide) (Counter.init_reaches_conjCfg_default rfl) + BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA.is_not_halt_from_0689 + +end + +end BusyBeaver.M_1RB1RF_1LC0RD_HHH0LD_1LE0LD_1RA0RF_0RE0LB diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RF_1LC1RE_HHH0LD_1LE0LD_1RA0RF_0RE0LB.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RF_1LC1RE_HHH0LD_1LE0LD_1RA0RF_0RE0LB.lean new file mode 100644 index 00000000..c45d9502 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RF_1LC1RE_HHH0LD_1LE0LD_1RA0RF_0RE0LB.lean @@ -0,0 +1,515 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1RF_1LC1RE_HHH0LD_1LE0LD_1RA0RF_0RE0LB + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1LC1RE_HHH0LD_1LE0LD_1RA0RF_0RE0LB" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +-- ============================================================================ +-- Wave 25 Standalone verified Canonical Proof Library for holdout_0756 (1RB---_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC) +-- Cluster: Untouched 12/12 & 11/12 Septet IV (0220..0766) | Donor: holdout_0220 (1RB0RA_1LC0LF_1LE0LD_1LB---_1RA1LB_0LB0RC) +-- S_6 x Z_2 Isomorphism: 11/12 match | perm = (E,B,C,A,D,F) | mirror = 1 +-- Differing transition(s): D.F0=0LB vs M.F0=0RA +-- ============================================================================ + +set_option maxHeartbeats 2000000 +set_option maxRecDepth 2000 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem pow_zero_list (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +omit [Inhabited Γ] in +@[simp] +theorem list_pow_append_one (u : List (Fin 2)) (k : Nat) : + u^k ++ u = u^(k + 1) := by + have h := list_pow_add_comm u k 1 + dsimp [HPow.hPow] at h ⊢ + rw [List.append_nil] at h + exact h + +theorem pow_add_append_right (u : List (Fin 2)) (m n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (m + n)) +> r = (u ^ m) +> ((u ^ n) +> r) := by + rw [list_pow_add, ← listblank_append_append] + +theorem pow_succ_append_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (n + 1)) +> r = u +> ((u ^ n) +> r) := by + rw [pow_succ_list, ← listblank_append_append] + +theorem pow_succ_append_right' (u : List (Fin 2)) (k : Nat) (r : ListBlank (Fin 2)) : + (u ^ k) +> (u +> r) = (u ^ (k + 1)) +> r := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (m n : Nat) : + s <+ (u ^ (m + n)) = (s <+ (u ^ m)) <+ (u ^ n) := by + rw [listblank_append_append, ← list_pow_add, add_comm] + +theorem pow_succ_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k : Nat) : + (s <+ u) <+ (u ^ k) = s <+ (u ^ (k + 1)) := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add3_append_right (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) (r : ListBlank (Fin 2)) : + (u ^ (k₁ + k₂ + k₃)) +> r = (u ^ k₁) +> ((u ^ k₂) +> ((u ^ k₃) +> r)) := by + rw [pow_add_append_right u (k₁ + k₂) k₃ r, pow_add_append_right u k₁ k₂ ((u ^ k₃) +> r)] + +theorem pow_add3_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) : + s <+ (u ^ (k₁ + k₂ + k₃)) = ((s <+ (u ^ k₁)) <+ (u ^ k₂)) <+ (u ^ k₃) := by + rw [pow_add_append_left s u (k₁ + k₂) k₃, pow_add_append_left s u k₁ k₂] + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, _, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +theorem step_some {c c' : Cfg (Fin 2) (Fin 6)} (h : step target_tm c = some c') : + c [target_tm]⊢⁺ c' := ⟨1, Nat.zero_lt_one, h⟩ + +theorem stepPlus_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := step_stepStar_stepPlus h1 (stepPlus_stepStar h2) + +theorem stepStar_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢* c₃ := stepStar_trans (step_stepStar target_tm c₁ c₂ h1) h2 + +theorem stepPlus_stepStar_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢⁺ c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepPlus_stepStar_stepPlus h1 h2 + +theorem stepStar_stepPlus_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢* c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepStar_stepPlus_stepPlus h1 h2 + +theorem stepPlus_of_step {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢ c₂) : + c₁ [target_tm]⊢⁺ c₂ := step_stepPlus target_tm c₁ c₂ h + +theorem stepStar_of_stepPlus {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢⁺ c₂) : + c₁ [target_tm]⊢* c₂ := stepPlus_stepStar h + +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail]) +macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step))) +macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +theorem multiStep_step_isSome {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₀ cfg cfg' : Cfg Γ Λ) (n m : Nat) + (hn : multiStep M c₀ n = some cfg) + (hnm : multiStep M c₀ (n + (1 + m)) = some cfg') : + (step M cfg).isSome := by + rw [multiStep_add M c₀ n (1 + m), hn] at hnm + dsimp [Option.bind] at hnm + rw [multiStep_add M cfg 1 m, multiStep_one] at hnm + cases hs : step M cfg with + | none => + rw [hs] at hnm + nomatch hnm + | some c₁ => rfl + +theorem inv_reaches_beyond {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') + (N : Nat) : + ∃ (m : Nat) (cfg' : Cfg Γ Λ), multiStep M (init []) (N + m) = some cfg' ∧ Inv cfg' := by + induction N with + | zero => + obtain ⟨cfg₀, ⟨n₀, hn₀⟩, h_inv₀⟩ := h_init + refine ⟨n₀, cfg₀, ?_, h_inv₀⟩ + rwa [Nat.zero_add] + | succ N ih => + obtain ⟨m, cfg₁, hm, h_inv₁⟩ := ih + cases m with + | zero => + obtain ⟨cfg₂, ⟨k, hk_pos, hk⟩, h_inv₂⟩ := h_step cfg₁ h_inv₁ + cases k with + | zero => omega + | succ k' => + refine ⟨k', cfg₂, ?_, h_inv₂⟩ + have h_trans := multiStep_trans M (init []) cfg₁ cfg₂ N (k' + 1) hm hk + have h_eq : (N + 1) + k' = N + (k' + 1) := by omega + rwa [h_eq] + | succ m' => + refine ⟨m', cfg₁, ?_, h_inv₁⟩ + have h_eq : (N + 1) + m' = N + (m' + 1) := by omega + rwa [h_eq] + +theorem closed_inv_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') : + IsDoesNotHalt M := by + intro cfg ⟨n, hn⟩ + obtain ⟨m, cfg', hnm, _⟩ := inv_reaches_beyond M Inv h_init h_step (n + 1) + have h_eq : (n + 1) + m = n + (1 + m) := by omega + rw [h_eq] at hnm + exact multiStep_step_isSome M (init []) cfg cfg' n m hn hnm + +theorem closed_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) + (n₀ : Nat) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, ∃ n', (hub n) [M]⊢⁺ (hub n')) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hcfg⟩ + subst hcfg + obtain ⟨n', hn'⟩ := h_step n + exact ⟨hub n', hn', ⟨n', rfl⟩⟩ + +theorem closed_guarded_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) (P : Nat → Prop) + (n₀ : Nat) (h_P₀ : P n₀) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, P n → ∃ n', P n' ∧ ((hub n) [M]⊢⁺ (hub n'))) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, P n ∧ cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, h_P₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hPn, hcfg⟩ + subst hcfg + obtain ⟨n', hPn', hn'⟩ := h_step n hPn + exact ⟨hub n', hn', ⟨n', hPn', rfl⟩⟩ + + +def QINIT : Fin 6 := 0 +def B : Fin 6 := 4 +def E : Fin 6 := 3 +abbrev holdout_0569_tm : Machine (Fin 2) (Fin 6) := target_tm +abbrev M : Machine (Fin 2) (Fin 6) := target_tm + +theorem rule_B_000 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 0, 0] +> r)) [target_tm]⊢⁺ (l <{{E}} ([0, 0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_001 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 0, 1] +> r)) [target_tm]⊢⁺ ((l <+ [1, 1, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_010 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 1, 0] +> r)) [target_tm]⊢⁺ ((l <+ [0, 1, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_10 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([1, 0] +> r)) [target_tm]⊢⁺ ((l <+ [0, 0]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_111 (l r : ListBlank (Fin 2)) : + ((l <+ [1, 1, 1]) <{{E}} r) [target_tm]⊢⁺ (l <{{E}} ([0, 0, 0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_011 (l r : ListBlank (Fin 2)) : + ((l <+ [0, 1, 1]) <{{E}} r) [target_tm]⊢⁺ (l <{{E}} ([0, 1, 0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_00 (l r : ListBlank (Fin 2)) : + ((l <+ [0, 0]) <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ ((l <+ [0, 1, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_nil (r : ListBlank (Fin 2)) : + (default <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ ((default <+ [0, 1, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +abbrev Round (r r' : ListBlank (Fin 2)) : Prop := + ∀ l : ListBlank (Fin 2), (l {{B}}> r) [target_tm]⊢⁺ (l <{{E}} r') + +inductive Sweeps : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) → Prop + | zero (r : ListBlank (Fin 2)) : Sweeps 0 r r + | succ {n : Nat} {r r₁ r₂ : ListBlank (Fin 2)} : + Round r r₁ → Sweeps n r₁ r₂ → Sweeps (n + 1) r r₂ + +theorem Sweeps.trans {a b : Nat} {r₁ r₂ r₃ : ListBlank (Fin 2)} + (h₁ : Sweeps a r₁ r₂) (h₂ : Sweeps b r₂ r₃) : Sweeps (a + b) r₁ r₃ := by + induction h₁ with + | zero _ => simpa using h₂ + | succ hr _ ih => + rw [Nat.succ_add] + exact Sweeps.succ hr (ih h₂) + +theorem sweeps_split_last {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps (n + 1) r r') : + ∃ r₁ : ListBlank (Fin 2), Sweeps n r r₁ ∧ Round r₁ r' := by + induction n generalizing r with + | zero => + cases h with + | succ hr h0 => + cases h0 with + | zero _ => exact ⟨r, Sweeps.zero r, hr⟩ + | succ m ih => + cases h with + | succ hr hs => + obtain ⟨r₁, hs₁, hr₁⟩ := ih hs + exact ⟨r₁, Sweeps.succ hr hs₁, hr₁⟩ + +theorem round_000 (r : ListBlank (Fin 2)) : + Round ([0, 0, 0] +> r) ([0, 0, 1] +> r) := + fun l => rule_B_000 l r + +theorem round_001 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 0, 1] +> r) ([0, 0, 0] +> r') := + fun l => stepPlus_trans (rule_B_001 l r) (stepPlus_trans (h (l <+ [1, 1, 1])) (rule_E_111 l r')) + +theorem round_010 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 1, 0] +> r) ([0, 1, 0] +> r') := + fun l => stepPlus_trans (rule_B_010 l r) (stepPlus_trans (h (l <+ [0, 1, 1])) (rule_E_011 l r')) + +theorem round_10 {r₁ r r₂ : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Round r r₂) : + Round ([1, 0] +> r₁) ([0, 1, 0] +> r₂) := + fun l => stepPlus_trans (rule_B_10 l r₁) + (stepPlus_trans (h₁ (l <+ [0, 0])) + (stepPlus_trans (rule_E_00 l r) + (stepPlus_trans (h₂ (l <+ [0, 1, 1])) (rule_E_011 l r₂)))) + +theorem sweeps_010 {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps n r r') : + Sweeps n ([0, 1, 0] +> r) ([0, 1, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | succ hr _ ih => exact Sweeps.succ (round_010 hr) ih + +theorem sweeps_10 {n : Nat} {r₁ r r' : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Sweeps (n + 1) r r') : + Sweeps (n + 1) ([1, 0] +> r₁) ([0, 1, 0] +> r') := by + cases h₂ with + | succ hr₂ hs => + exact Sweeps.succ (round_10 h₁ hr₂) (sweeps_010 hs) + +theorem sweeps_000_even {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k) ([0, 0, 0] +> r) ([0, 0, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | @succ m r₀ r₁ r₂ hr _ ih => + have h2 : Sweeps 2 ([0, 0, 0] +> r₀) ([0, 0, 0] +> r₁) := + Sweeps.succ (round_000 r₀) (Sweeps.succ (round_001 hr) (Sweeps.zero _)) + have htr := Sweeps.trans h2 ih + rw [show 2 + 2 * m = 2 * (m + 1) by omega] at htr + exact htr + +theorem sweeps_000_odd {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k + 1) ([0, 0, 0] +> r) ([0, 0, 1] +> r') := by + have he := sweeps_000_even h + have h1 : Sweeps 1 ([0, 0, 0] +> r') ([0, 0, 1] +> r') := + Sweeps.succ (round_000 r') (Sweeps.zero _) + exact Sweeps.trans he h1 + +theorem default_eq_b000 : + (default : ListBlank (Fin 2)) = [0, 0, 0] +> default := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b000_cons_zero (r : ListBlank (Fin 2)) : + [0, 0, 0] +> ((0 : Fin 2) >> r) = (0 : Fin 2) >> ([0, 0, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +theorem b001_cons_zero (r : ListBlank (Fin 2)) : + [0, 0, 1] +> ((0 : Fin 2) >> r) = (0 : Fin 2) >> ([0, 1, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +theorem b001_default_eq : + ([0, 0, 1] +> default : ListBlank (Fin 2)) = (0 : Fin 2) >> ([0, 1, 0] +> default) := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b010_eq_zero_cons_b10 (r : ListBlank (Fin 2)) : + [0, 1, 0] +> r = (0 : Fin 2) >> ([1, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +inductive Valid : Nat → ListBlank (Fin 2) → Prop + | nil {n : Nat} (hn : n ≥ 1) : + Valid n default + | t0 {n : Nat} {r : ListBlank (Fin 2)} (hn : n ≥ 2) (hr : Valid (n / 2) r) : + Valid n ([0, 0, 0] +> r) + | t1 {n : Nat} {r : ListBlank (Fin 2)} (hn : n ≥ 1) (hr : Valid (n + 1) r) : + Valid n ([0, 1, 0] +> r) + | t2 {n : Nat} {r₁ r : ListBlank (Fin 2)} (hn : n ≥ 1) + (hround : Round r₁ ((0 : Fin 2) >> r)) (hr : Valid (n + 1) r) : + Valid n ([1, 0] +> r₁) + +theorem Valid.mono {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) {n' : Nat} (hle : n ≤ n') : + Valid n' r := by + induction h generalizing n' with + | nil hn => exact Valid.nil (by omega) + | t0 hn _ ih => exact Valid.t0 (by omega) (ih (by omega)) + | t1 hn _ ih => exact Valid.t1 (by omega) (ih (by omega)) + | t2 hn hround _ ih => exact Valid.t2 (by omega) hround (ih (by omega)) + +theorem valid_sweeps_nil : ∀ n : Nat, n ≥ 1 → + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ Sweeps n default ((0 : Fin 2) >> r') := by + intro n + induction n using Nat.strongRecOn with + | ind n ih => + intro hn + rcases ( by omega : n = 1 ∨ (n ≥ 2 ∧ n % 2 = 0) ∨ (n ≥ 2 ∧ n % 2 = 1) ) with rfl | ⟨hn2, hev⟩ | ⟨hn2, hod⟩ + · refine ⟨[0, 1, 0] +> default, Valid.t1 (by omega) (Valid.nil (by omega)), ?_⟩ + have h1 : Sweeps 1 ([0, 0, 0] +> default) ([0, 0, 1] +> default) := + Sweeps.succ (round_000 default) (Sweeps.zero _) + rw [b001_default_eq, ← default_eq_b000] at h1 + exact h1 + · obtain ⟨r', hr', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨[0, 0, 0] +> r', Valid.t0 hn2 hr', ?_⟩ + have he := sweeps_000_even hs' + rw [← default_eq_b000, b000_cons_zero, show 2 * (n / 2) = n by omega] at he + exact he + · obtain ⟨r', hr', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨[0, 1, 0] +> r', Valid.t1 (by omega) (hr'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [← default_eq_b000, b001_cons_zero, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + +theorem valid_sweeps {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) : + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ Sweeps n r ((0 : Fin 2) >> r') := by + induction h with + | @nil n hn => exact valid_sweeps_nil n hn + | @t0 n r hn hr ih => + obtain ⟨r', hr', hs'⟩ := ih + rcases ( by omega : n % 2 = 0 ∨ n % 2 = 1 ) with hev | hod + · refine ⟨[0, 0, 0] +> r', Valid.t0 hn hr', ?_⟩ + have he := sweeps_000_even hs' + rw [b000_cons_zero, show 2 * (n / 2) = n by omega] at he + exact he + · refine ⟨[0, 1, 0] +> r', Valid.t1 (by omega) (hr'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [b001_cons_zero, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + | @t1 n r hn hr ih => + obtain ⟨r', hr', hs'⟩ := ih + obtain ⟨r₁, hs₁, hr₁⟩ := sweeps_split_last hs' + refine ⟨[1, 0] +> r₁, Valid.t2 hn hr₁ hr', ?_⟩ + rw [← b010_eq_zero_cons_b10] + exact sweeps_010 hs₁ + | @t2 n r₁ r hn hround hr ih => + obtain ⟨r', hr', hs'⟩ := ih + obtain ⟨r₂, hs₂, hr₂⟩ := sweeps_split_last hs' + refine ⟨[1, 0] +> r₂, Valid.t2 hn hr₂ hr', ?_⟩ + rw [← b010_eq_zero_cons_b10] + rw [show n = (n - 1) + 1 by omega] at hs₂ ⊢ + exact sweeps_10 hround hs₂ + +theorem era_step {r : ListBlank (Fin 2)} (h : Valid 1 r) : + ∃ r' : ListBlank (Fin 2), Valid 1 r' ∧ + ((default <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ (default <{{E}} ((0 : Fin 2) >> r'))) := by + obtain ⟨r', hr', hs'⟩ := valid_sweeps (h.mono (by omega : 1 ≤ 2)) + obtain ⟨r₁, hs₁, hr₂⟩ := sweeps_split_last hs' + obtain ⟨r₀, hs₀, hr₁⟩ := sweeps_split_last hs₁ + cases hs₀ with + | zero _ => + refine ⟨[1, 0] +> r₁, Valid.t2 (by omega) hr₂ hr', ?_⟩ + have s1 := rule_E_nil r + have s2 := hr₁ (default <+ [0, 1, 1]) + have s3 := rule_E_011 default r₁ + rw [← b010_eq_zero_cons_b10] + exact stepPlus_trans s1 (stepPlus_trans s2 s3) + +def era0_r : ListBlank (Fin 2) := + [1, 0] +> default + +theorem init_reaches_era0 : + (init []) [target_tm]⊢* (default <{{E}} ((0 : Fin 2) >> era0_r)) := by + apply stepPlus_stepStar + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{QINIT}}> default) := rfl + rw [h_init] + dsimp [era0_r, ListBlank.append] + execute + +theorem valid_era0 : Valid 1 era0_r := by + have hround : Round default ((0 : Fin 2) >> ([0, 1, 0] +> default)) := by + have h0 := round_000 default + rw [b001_default_eq, ← default_eq_b000] at h0 + exact h0 + exact Valid.t2 (by omega) hround (Valid.t1 (by omega) (Valid.nil (by omega))) + +theorem holdout_0569_nonhalt : IsDoesNotHalt holdout_0569_tm := by + refine closed_inv_does_not_halt target_tm + (fun cfg => ∃ r : ListBlank (Fin 2), Valid 1 r ∧ cfg = (default <{{E}} ((0 : Fin 2) >> r))) + ⟨default <{{E}} ((0 : Fin 2) >> era0_r), init_reaches_era0, ⟨era0_r, valid_era0, rfl⟩⟩ ?_ + intro cfg ⟨r, hr, hcfg⟩ + subst hcfg + obtain ⟨r', hr', hstep⟩ := era_step hr + exact ⟨default <{{E}} ((0 : Fin 2) >> r'), hstep, ⟨r', hr', rfl⟩⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := + holdout_0569_nonhalt + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1RF_1LC1RE_HHH0LD_1LE0LD_1RA0RF_0RE0LB diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LA0LB_0RBHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LA0LB_0RBHHH.lean new file mode 100644 index 00000000..2f87bc93 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LA0LB_0RBHHH.lean @@ -0,0 +1,876 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusF +public import BusyBeaver.Calculi.WordCalculusG +public import BusyBeaver.Calculi.WordCalculusH + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LA0LB_0RBHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LA0LB_0RBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +@[reducible] def tm : Machine (Fin 2) (Fin 6) := target_tm +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 2000000 + +open WordVKQ Word + +abbrev evalCCfgVKQ (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev z0b (c : CCfg) : Option CCfg := Counter.bstep tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (evalCCfgVKQ c1) [tm]⊢⁺ (evalCCfgVKQ c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ + +abbrev pref21 : BitWord := [0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0] + + +def zCs : Call -> Fin 6 + | .ch => C + | .ca => B + +def zCR (w : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([1] +> r) {{zCs c}}> w) + +def zCL (w : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (r <{{D}} ([0] +> w)) + +def zCf (w : HalfTape) : Cfg (Fin 2) (Fin 6) := + (default <{{D}} ([0] +> pref21 +> w)) + +abbrev callStep (c : Call) (w1 w2 : HalfTape) : Prop := + ∀ r, (zCR w1 c r) [tm]⊢⁺ (zCL w2 r) + +abbrev Side := SideP callStep +abbrev Seg := SegP callStep + +theorem seg_ch_V : Seg [.ch] [.ch, .ch] V_u V_u := + segP_of_step_two (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (fun u r => by unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_V : Seg [.ca] [.ch] V_u Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Vp : Seg [.ca] [.ca, .ca] Vp Vp := + segP_of_step_two (mid1 := [0, 1, 1, 1]) (mid2 := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_K : Seg [.ch] [] K_u Q_u := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs K_u Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_Q : Seg [.ch] [.ch] Q_u K_u := + segP_of_step_one (mid := [1, 1]) + (fun u r => by unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL K_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_VpQ : Seg [.ca] [.ca] (Vp ++ Q_u) (Kp ++ Vp) := + segP_of_step_one (mid := [0, 1, 0, 1, 1, 1]) + (fun u r => by unfold zCR zCs Vp Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_KpVp : Seg [.ca] [] (Kp ++ Vp) (Qp ++ Vp) := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs Kp Vp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_QpVp : Seg [.ca] [.ca, .ca] (Qp ++ Vp) (Kp ++ Vp) := + segP_of_step_two (mid1 := [0, 1, 1, 1, 1, 1]) (mid2 := [0, 1, 0, 1, 1, 1]) + (fun u r => by unfold zCR zCs Qp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Kp : Seg [.ca] [] Kp Qp := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs Kp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Qp : Seg [.ca] [.ca] Qp Kp := + segP_of_step_one (mid := [1, 1]) + (fun u r => by unfold zCR zCs Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_KQ : Seg [.ca] [] (K_u ++ Q_u) Vp := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs K_u Q_u Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_QQ : Seg [.ca] [.ca] (Q_u ++ Q_u) Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + + +-- Turnaround zP0..zP6 +abbrev tr1 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1] +abbrev tr2 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1] +abbrev tr3 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1] +abbrev tr4 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1] +abbrev tr5 : BitWord := [0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1] +abbrev tr6 : BitWord := [0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1] + +theorem zP0 (w : HalfTape) : (zCf w) [tm]⊢⁺ (zCR w .ca (tr1 +> default)) := by + unfold zCf zCR zCs pref21 tr1 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP1 (w : HalfTape) : (zCL w (tr1 +> default)) [tm]⊢⁺ (zCR w .ca (tr2 +> default)) := by + unfold zCL zCR zCs tr1 tr2 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP2 (w : HalfTape) : (zCL w (tr2 +> default)) [tm]⊢⁺ (zCR w .ca (tr3 +> default)) := by + unfold zCL zCR zCs tr2 tr3 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP3 (w : HalfTape) : (zCL w (tr3 +> default)) [tm]⊢⁺ (zCR w .ca (tr4 +> default)) := by + unfold zCL zCR zCs tr3 tr4 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP4 (w : HalfTape) : (zCL w (tr4 +> default)) [tm]⊢⁺ (zCR w .ca (tr5 +> default)) := by + unfold zCL zCR zCs tr4 tr5 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP5 (w : HalfTape) : (zCL w (tr5 +> default)) [tm]⊢⁺ (zCR w .ca (tr6 +> default)) := by + unfold zCL zCR zCs tr5 tr6 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP6 (w : HalfTape) : (zCL w (tr6 +> default)) [tm]⊢⁺ (zCf ([1, 1, 0] +> w)) := by + unfold zCL zCf tr6 pref21 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +-- Section 2: Words, Shift Identity, DigitVal, Parse, Scan, Step +theorem segSpec : SegSpec callStep := + ⟨seg_ch_V, seg_ca_V, seg_ca_Vp, seg_ch_K, seg_ch_Q, + seg_ca_VpQ, seg_ca_KpVp, seg_ca_QpVp, seg_ca_Kp, seg_ca_Qp, + seg_ca_KQ, seg_ca_QQ⟩ + +theorem Side_turnaround {w w' : HalfTape} (h : Side ([Call.ca] ^ 6) w w') : + (zCf w) [tm]⊢⁺ (zCf ([1, 1, 0] +> w')) := by + rcases h with _ | ⟨hc1, h⟩ + rcases h with _ | ⟨hc2, h⟩ + rcases h with _ | ⟨hc3, h⟩ + rcases h with _ | ⟨hc4, h⟩ + rcases h with _ | ⟨hc5, h⟩ + rcases h with _ | ⟨hc6, h⟩ + cases h + exact stepPlus_trans_vkq (zP0 w) + (stepPlus_trans_vkq (hc1 (tr1 +> default)) + (stepPlus_trans_vkq (zP1 _) + (stepPlus_trans_vkq (hc2 (tr2 +> default)) + (stepPlus_trans_vkq (zP2 _) + (stepPlus_trans_vkq (hc3 (tr3 +> default)) + (stepPlus_trans_vkq (zP3 _) + (stepPlus_trans_vkq (hc4 (tr4 +> default)) + (stepPlus_trans_vkq (zP4 _) + (stepPlus_trans_vkq (hc5 (tr5 +> default)) + (stepPlus_trans_vkq (zP5 _) + (stepPlus_trans_vkq (hc6 (tr6 +> default)) (zP6 w')))))))))))) + +theorem Step_exec {u u' : List Word} (h : Step u u') : + (zCf (evalWords u default)) [tm]⊢⁺ (zCf (evalWords u' default)) := by + rcases h with ⟨n, b', v, da, H, g, hScan, hDg, rfl⟩ + have hSeg := Seg_of_Scan segSpec hScan + dsimp at hSeg + have hSide0 := sideP_of_segP hSeg (Side_ca_default segSpec hDg) + rw [wordsToBits_append_tape, evalWords_append, evalWords_replicate_K, wordsToBitsShifted_append_tape, <- evalWordsShifted_append] at hSide0 + have hTurn := Side_turnaround hSide0 + rwa [evalWords_V_shift] at hTurn + +theorem Rounds_exec {u v : List Word} (h : Rounds u v) : + (zCf (evalWords u default)) [tm]⊢* (zCf (evalWords v default)) := by + induction h with + | refl _ => exact ⟨0, rfl⟩ + | next hS _ ih => exact stepStar_of_stepPlus_vkq (stepPlus_stepStar_trans_vkq (Step_exec hS) ih) + +-- Section 3: Universal Parse_V_start, Scan_of_Parse, and Trace Evaluators + +def u_0 : List Word := [V,K,Q,Q] +def tags_0 : List Nat := [1,5] +def da_0 : List Word := [Q,K,K,Q] +def n_0 : Nat := 0 +def u_1 : List Word := [V,K,V,V,Q,K,K,Q] +def tags_1 : List Nat := [1,0,0,3,3,5] +def da_1 : List Word := [Q,K,Q] +def n_1 : Nat := 0 +def u_2 : List Word := [V,K,V,V,V,K,Q,V,Q,K,Q] +def tags_2 : List Nat := [1,0,0,1,3,0,4,4] +def da_2 : List Word := [K,Q,K,K,K,Q] +def n_2 : Nat := 1 +def u_3 : List Word := [V,K,V,V,V,K,V,Q,V,V,V,K,Q,K,K,K,Q] +def tags_3 : List Nat := [1,0,0,1,0,3,0,0,1,3,4,3,4] +def da_3 : List Word := [K,K,Q,K,K,Q] +def n_3 : Nat := 1 +def u_4 : List Word := [V,K,V,V,V,K,V,V,K,V,V,K,V,Q,V,K,V,K,K,Q,K,K,Q] +def tags_4 : List Nat := [1,0,0,1,0,1,0,1,0,3,1,2,4,3,3,4] +def da_4 : List Word := [K,K,Q,K,K,Q] +def n_4 : Nat := 1 +def u_5 : List Word := [V,K,V,V,V,K,V,V,K,V,V,K,V,V,K,K,V,Q,V,V,K,K,V,K,K,Q,K,K,Q] +def tags_5 : List Nat := [1,0,0,1,0,1,0,1,0,0,5,0,3,0,0,5,2,4,3,3,4] +def da_5 : List Word := [K,Q,Q,Q,Q,Q,K,K,K,Q,K,Q] +def n_5 : Nat := 1 +def u_6 : List Word := [V,K,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,Q,V,V,K,K,V,K,Q,Q,Q,Q,Q,K,K,K,Q,K,Q] +def tags_6 : List Nat := [1,0,0,1,0,1,0,1,0,0,0,0,1,0,0,0,3,0,0,5,0,5,5,5,3,3,4,3,4] +def da_6 : List Word := [K,K,K,Q,K,K,Q,Q,K,Q,Q,Q,K,K,K,Q,K,Q] +def n_6 : Nat := 1 +def u_7 : List Word := [V,K,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,K,V,V,V,V,V,V,V,Q,K,V,K,V,K,K,K,Q,K,K,Q,Q,K,Q,Q,Q,K,K,K,Q,K,Q] +def tags_7 : List Nat := [1,0,0,1,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,3,3,1,2,3,4,3,3,5,4,5,3,3,4,3,4] +def da_7 : List Word := [K,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,K,K,K,Q,K,Q] +def n_7 : Nat := 1 +def u_8 : List Word := [V,K,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,K,V,V,V,V,V,V,V,V,K,Q,K,V,Q,V,Q,V,K,Q,V,V,V,Q,Q,V,K,V,K,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,K,K,K,Q,K,Q] +def tags_8 : List Nat := [1,0,0,1,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,3,3,0,3,0,3,0,5,0,0,0,4,1,2,5,4,3,5,4,5,3,3,4,3,4] +def da_8 : List Word := [K,Q,Q,K,K,Q,Q,K,K,K,K,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,K,Q,K,Q] +def n_8 : Nat := 1 +def u_9 : List Word := [V,K,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,K,V,V,V,V,V,V,V,V,K,V,Q,K,V,K,V,K,V,V,V,V,V,V,K,V,Q,V,V,V,K,V,V,V,Q,Q,V,K,V,K,Q,Q,K,K,Q,Q,K,K,K,K,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,K,Q,K,Q] +def tags_9 : List Nat := [1,0,0,1,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,3,3,1,2,0,0,0,0,0,1,0,3,0,0,1,0,0,0,4,1,2,5,4,5,3,4,4,5,3,5,4,5,3,3,4,3,4] +def da_9 : List Word := [K,Q,K,Q,K,K,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,K,Q,K,Q] +def n_9 : Nat := 1 +def u_10 : List Word := [V,K,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,K,V,V,V,V,V,V,V,V,K,V,V,K,K,K,V,Q,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,Q,V,V,V,V,Q,V,V,V,Q,V,V,V,Q,Q,V,K,V,K,Q,K,Q,K,K,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,K,Q,K,Q] +def tags_10 : List Nat := [1,0,0,1,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,5,0,3,0,0,0,0,0,1,0,1,0,1,0,0,0,0,1,0,3,0,0,0,0,3,0,0,0,3,0,0,0,4,1,2,5,5,3,5,5,3,5,4,5,3,3,5,5,3,5,4,5,3,3,4,3,4] +def da_10 : List Word := [K,Q,Q,K,Q,Q,K,K,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,K,Q,K,Q] +def n_10 : Nat := 1 +def u_11 : List Word := [V,K,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,K,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,V,K,V,V,V,V,K,V,Q,V,V,V,Q,V,V,Q,V,V,V,Q,Q,V,V,Q,V,V,V,Q,Q,V,K,V,K,Q,Q,K,Q,Q,K,K,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,K,Q,K,Q] +def tags_11 : List Nat := [1,0,0,1,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0,1,0,1,0,1,0,0,0,0,1,0,1,0,0,0,1,0,0,1,0,0,0,1,0,3,0,0,0,3,0,0,3,0,0,0,4,0,0,3,0,0,0,4,1,0,5,3,3,5,5,5,4,4,5,3,5,3,3,4,5,5,3,3,5,5,5,3,5,4,5,3,3,4,3,4] +def da_11 : List Word := [K,Q,Q,K,Q,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,K,K,Q,Q,K,Q,K,Q,K,Q,Q,K,K,Q,Q,Q,K,K,K,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,K,Q,K,Q] +def n_11 : Nat := 1 +def u_12 : List Word := [V,K,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,K,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,V,K,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,V,K,V,V,V,V,K,V,V,V,Q,Q,V,V,V,V,V,V,Q,V,Q,K,V,V,V,Q,K,V,V,V,Q,V,V,V,Q,Q,V,K,V,K,Q,Q,K,Q,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,K,K,Q,Q,K,Q,K,Q,K,Q,Q,K,K,Q,Q,Q,K,K,K,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,K,Q,K,Q] +def tags_12 : List Nat := [1,0,0,1,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0,1,0,1,0,1,0,0,0,0,1,0,1,0,0,0,1,0,0,1,0,0,0,1,0,1,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,4,0,0,0,0,0,0,3,0,4,0,0,0,3,3,0,0,0,3,0,0,0,4,1,0,5,4,4,3,5,4,5,3,5,5,3,3,5,4,4,3,5,3,4,5,3,3,4,5,4,3,3,5,5,5,3,5,4,5,3,3,4,3,4] +def da_12 : List Word := [K,Q,Q,K,Q,Q,K,Q,Q,K,K,K,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,K,K,Q,K,K,Q,Q,K,Q,K,Q,Q,K,K,Q,Q,Q,K,K,K,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,K,Q,K,Q] +def n_12 : Nat := 1 +def u_13 : List Word := [V,K,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,K,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,K,V,V,V,K,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,V,K,V,V,V,V,K,V,V,V,V,V,V,V,V,V,V,V,K,V,V,V,V,V,K,Q,V,V,V,K,V,V,V,V,K,V,V,V,V,V,K,V,V,V,Q,V,V,Q,K,V,V,V,K,V,Q,V,V,Q,Q,V,V,V,K,K,V,V,V,Q,V,V,V,Q,Q,V,K,V,K,Q,Q,K,Q,Q,K,Q,Q,K,K,K,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,K,K,Q,K,K,Q,Q,K,Q,K,Q,Q,K,K,Q,Q,Q,K,K,K,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,K,Q,K,Q] +def head58 : List Word := [V,K,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,K,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V] +def tags_head58 : List Nat := [1,0,0,1,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0,1,0,1,0,1,0,0,0,0,1,0] +def v_head58 : List Word := [K,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,K,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V] +def a_58 : Nat := 4294967295 +def b_58 : Nat := 10986952480 +def A_top29 : Nat := 343342264 +def s17 : List Word := [V,V,V,K,K,V,V,V,Q,V,V,V,Q,Q,V,K,V] +def s19 : List Word := s17 ++ [K,Q] +def tags_s19 : List Nat := [0,0,0,5,0,0,0,3,0,0,0,4,1,0,5] +def v_s19 : List Word := [V,V,V,V,V,V,V,K,V,V,V,V,K,V,V,V] +def top27 : List Word := [K,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,K,Q,K,Q] +def top28 : List Word := top27 ++ [K] +def tags_top28 : List Nat := [4,5,4,3,3,5,5,5,3,5,4,5,3,3,4,3,4] +def p_58_init : List Word := [V,K,V,V,V,V,K,V,V,V,K,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,V,K,V,V,V,V,K,V,V,V,V,V,V,V,V,V,V,V,K,V,V,V,V,V,K,Q,V,V,V,K,V,V,V,V,K,V,V,V,V,V,K,V,V,V,Q,V,V,Q,K,V,V,V,K,V,Q,V,V,Q,Q] +def ds_core_init : List Word := [Q,Q,K,Q,Q,K,K,K,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,K,K,Q,K,K,Q,Q,K,Q,K,Q,Q,K,K,Q,Q,Q] +def A_core_init : Nat := 2029234004258587 + +-- Initial 409 steps from init [] to zCf (evalWords u_0 default) +def zInitCCfg : CCfg := ⟨0, 0, [], []⟩ +def zHit6CCfg : CCfg := ⟨3, 0, [], [0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1]⟩ + +set_option maxRecDepth 200000 in +theorem zCm_init_409 : zCm zInitCCfg 409 = some zHit6CCfg := by decide + +theorem init_to_u0 : (init []) [tm]⊢* zCf (evalWords u_0 default) := by + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = evalCCfgVKQ zInitCCfg := rfl + have h1 : evalCCfgVKQ zHit6CCfg = zCf (evalWords u_0 default) := by + dsimp [evalCCfgVKQ, zHit6CCfg, zCf, pref21, u_0, evalWords, V_u, K_u, Q_u] + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq, default_head_vkq, default_tail_vkq] + have hPlus := zTc (by decide : 0 < 409) zCm_init_409 + rw [<- h0, h1] at hPlus + exact stepStar_of_stepPlus_vkq hPlus + +-- 13 finite rounds u_0 -> u_13 +set_option maxRecDepth 200000 in +theorem step_0 : Step u_0 u_1 := checkStep_sound n_0 tags_0 u_0 da_0 u_1 (by decide) +set_option maxRecDepth 200000 in +theorem step_1 : Step u_1 u_2 := checkStep_sound n_1 tags_1 u_1 da_1 u_2 (by decide) +set_option maxRecDepth 200000 in +theorem step_2 : Step u_2 u_3 := checkStep_sound n_2 tags_2 u_2 da_2 u_3 (by decide) +set_option maxRecDepth 200000 in +theorem step_3 : Step u_3 u_4 := checkStep_sound n_3 tags_3 u_3 da_3 u_4 (by decide) +set_option maxRecDepth 200000 in +theorem step_4 : Step u_4 u_5 := checkStep_sound n_4 tags_4 u_4 da_4 u_5 (by decide) +set_option maxRecDepth 200000 in +theorem step_5 : Step u_5 u_6 := checkStep_sound n_5 tags_5 u_5 da_5 u_6 (by decide) +set_option maxRecDepth 200000 in +theorem step_6 : Step u_6 u_7 := checkStep_sound n_6 tags_6 u_6 da_6 u_7 (by decide) +set_option maxRecDepth 200000 in +theorem step_7 : Step u_7 u_8 := checkStep_sound n_7 tags_7 u_7 da_7 u_8 (by decide) +set_option maxRecDepth 200000 in +theorem step_8 : Step u_8 u_9 := checkStep_sound n_8 tags_8 u_8 da_8 u_9 (by decide) +set_option maxRecDepth 200000 in +theorem step_9 : Step u_9 u_10 := checkStep_sound n_9 tags_9 u_9 da_9 u_10 (by decide) +set_option maxRecDepth 200000 in +theorem step_10 : Step u_10 u_11 := checkStep_sound n_10 tags_10 u_10 da_10 u_11 (by decide) +set_option maxRecDepth 200000 in +theorem step_11 : Step u_11 u_12 := checkStep_sound n_11 tags_11 u_11 da_11 u_12 (by decide) +set_option maxRecDepth 200000 in +theorem step_12 : Step u_12 u_13 := checkStep_sound n_12 tags_12 u_12 da_12 u_13 (by decide) + +theorem rounds_0_13 : Rounds u_0 u_13 := + Rounds.next step_0 (Rounds.next step_1 (Rounds.next step_2 (Rounds.next step_3 (Rounds.next step_4 (Rounds.next step_5 (Rounds.next step_6 (Rounds.next step_7 (Rounds.next step_8 (Rounds.next step_9 (Rounds.next step_10 (Rounds.next step_11 (Rounds.next step_12 (Rounds.refl u_13))))))))))))) + +-- Invariant Good u (5-piece decomposition) +abbrev Good (u : List Word) : Prop := + ∃ p_58 ds_core A_core m, + u = head58 ++ p_58 ++ s17 ++ [K, Q, Q, K] ++ ds_core ++ [K, K] ++ top27 ∧ + (∃ p_tail, p_58 = V :: p_tail) ∧ + m = 4 + ds_core.length ∧ + 12 <= m ∧ + DigitVal A_core (m - 4) ds_core ∧ + A_core * 32 <= 31 * 2 ^ (m - 4) ∧ + wordScale p_58 * ((2 ^ m : Nat) : Rat) = 512 ∧ + wordPot p_58 <= 21 / 4 + +set_option maxRecDepth 200000 in +theorem good_u13 : Good u_13 := by + refine ⟨p_58_init, ds_core_init, A_core_init, 55, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · decide + · exact ⟨p_58_init.tail, rfl⟩ + · decide + · decide + · exact checkDg_sound A_core_init ds_core_init (by decide) + · decide + · have h := checkScalePow_sound p_58_init 55 9 (by decide) + norm_num at h + exact h + · have h := checkWordPotLe_sound p_58_init 21 4 (by decide) + norm_num at h + linarith + +-- Fixed-piece Scan lemmas +set_option maxRecDepth 200000 in +theorem Scan_head58 : Scan 0 6 head58 a_58 b_58 v_head58 0 := by + have h := checkAffineScan_sound tags_head58 0 0 0 6 head58 0 a_58 0 b_58 v_head58 0 0 0 (by decide) + simpa using h + +theorem v_head58_eq : V :: v_head58 = head58 ++ [V] := rfl + +theorem Scan_s19 (ap bp : Nat) (hbp : 3 <= bp) : + Scan ap bp s19 (8 * ap + 9) (4096 * (bp - 3) + 4287) v_s19 3 := by + have h := checkAffineScan_sound tags_s19 1 0 1 3 s19 8 9 4096 4287 v_s19 3 ap (bp - 3) (by decide) + have h_bp : 1 * (bp - 3) + 3 = bp := by omega + have h_ap : 1 * ap + 0 = ap := by omega + rwa [h_ap, h_bp] at h + +theorem Scan_top28 (b_top28 : Nat) (hb : 3 <= b_top28) : + Scan (2 ^ 26) b_top28 top28 0 (32 * (b_top28 - 3) + 22) s17 11 := by + have h := checkAffineScan_sound tags_top28 0 (2 ^ 26) 1 3 top28 0 0 32 22 s17 11 0 (b_top28 - 3) (by decide) + have h_in : 1 * (b_top28 - 3) + 3 = b_top28 := by omega + dsimp at h + rwa [h_in] at h + +theorem Parse_s19_split {ap a_end g_all : Nat} {rest : List Word} + (h : Parse ap (s19 ++ Q :: rest) a_end g_all) : + ∃ g_mid, Parse (8 * ap + 9) (Q :: rest) a_end g_mid := by + change Parse ap ([V,V,V,K,K,V,V,V,Q,V,V,V,Q,Q,V,K,V,K,Q,Q] ++ rest) a_end g_all at h + simp only [List.cons_append, List.nil_append] at h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + rcases Parse_VK_inv h with h | h + · -- VK at pos=2 + cases h with + | D _ hq1_4 _ => dsimp [dVal] at hq1_4; omega + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + · -- T at pos=2 + cases h with + | D _ hq1_3 _ => dsimp [dVal] at hq1_3; omega + | @P _ q2_3 _ _ _ _ _ _ _ hq2_3 h => + have hq2_3_eq : q2_3 = 1 + ap * 2 := by dsimp [dVal] at hq2_3; omega + subst hq2_3_eq + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + cases h with + | @D _ q1_8 _ _ _ _ _ hq1_8 h => + have hq1_8_eq : q1_8 = 8 + ap * 8 := by dsimp [dVal] at hq1_8; omega + subst hq1_8_eq + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + cases h with + | @D _ q1_12 _ _ _ _ _ hq1_12 h => + have hq1_12_eq : q1_12 = 36 + ap * 32 := by dsimp [dVal] at hq1_12; omega + subst hq1_12_eq + cases h with + | D _ hq1_13 _ => dsimp [dVal] at hq1_13; omega + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + | @P _ q2_12 _ _ _ _ _ _ _ hq2_12 h => + have hq2_12_eq : q2_12 = 18 + ap * 16 := by dsimp [dVal] at hq2_12; omega + subst hq2_12_eq + rcases Parse_VK_inv h with h | h + · -- VK at pos=14 + rcases Parse_VK_inv h with h | h + · -- VK at pos=16 + cases h with + | D _ hq1_18 _ => dsimp [dVal] at hq1_18; omega + | P _ _ hq2_18 _ => dsimp [dVal] at hq2_18; omega + · -- T at pos=16 + cases h with + | D _ hq1_17 _ => dsimp [dVal] at hq1_17; omega + | @P _ q2_17 _ _ _ _ _ _ _ hq2_17 h => + have hq2_17_eq : q2_17 = 9 + ap * 8 := by dsimp [dVal] at hq2_17; omega + subst hq2_17_eq + have h_end : 9 + ap * 8 = 8 * ap + 9 := by omega + rw [h_end] at h + exact ⟨_, h⟩ + · -- T at pos=14 + cases h with + | D _ hq1_15 _ => dsimp [dVal] at hq1_15; omega + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + +-- Section 6: Main Invariant Closure and Goal Proof +theorem zDg_top29 : DigitVal A_top29 29 ([K, K] ++ top27) := + checkDg_sound A_top29 ([K, K] ++ top27) (by decide) + +theorem digitVal_bot4 : DigitVal 6 4 [K, Q, Q, K] := + checkDg_sound 6 [K, Q, Q, K] (by decide) + +theorem digitVal_mid {A_core m : Nat} {ds_core : List Word} + (hm : 12 <= m) (hD : DigitVal A_core (m - 4) ds_core) + (hA_core : A_core * 32 <= 31 * 2 ^ (m - 4)) : + ∃ A_mid, + DigitVal A_mid m ([Q, K] ++ ds_core ++ [K, K]) ∧ + 1 <= A_mid ∧ + A_mid <= 1 + 31 * 2 ^ (m - 7) := by + have h_qk : DigitVal 1 2 [Q, K] := checkDg_sound 1 [Q, K] (by decide) + have h_kk : DigitVal 0 2 [K, K] := checkDg_sound 0 [K, K] (by decide) + have h1 := digitVal_append h_qk hD + have h2 := digitVal_append h1 h_kk + have hlen1 : 2 + (m - 4) = m - 2 := by omega + have hlen2 : (m - 2) + 2 = m := by omega + rw [hlen1] at h2 + rw [hlen2] at h2 + have h_pow1 : 2 ^ (m - 4) = 8 * 2 ^ (m - 7) := by + have heq : m - 4 = 3 + (m - 7) := by omega + rw [heq, Nat.pow_add] + have h_pos_m7 : 1 <= 2 ^ (m - 7) := pow_two_pos (m - 7) + exact ⟨1 + A_core * 4 + 0 * 2 ^ (m - 2), + by simpa [List.append_assoc] using h2, + by omega, + by omega⟩ + +theorem force_a26 {p_58 ds_mid : List Word} {ap gp m A_mid a_top g_mid : Nat} + (hm : 12 <= m) + (hP_p : Parse a_58 p_58 ap gp) + (hz13 : wordScale p_58 * ((2 ^ m : Nat) : Rat) = 512) + (hzW : wordPot p_58 <= 21 / 4) + (hD_mid : DigitVal A_mid m ds_mid) + (hA_lo : 1 <= A_mid) + (hA_hi : A_mid <= 1 + 31 * 2 ^ (m - 7)) + (hP_mid : Parse (8 * ap + 9) ds_mid a_top g_mid) : + a_top = 2 ^ 26 := by + rcases Parse_la hP_p with ⟨hla_lo, hla_hi⟩ + have hz12 := wordValQ_nonneg p_58 + have hz10_le := two_wordVal_add_wordValQ_le p_58 + have h_diff_hi : ((ap : Rat) + 1) * wordScale p_58 - ((a_58 : Rat) + 1) < 11 := by linarith + have h_powm_pos : (0 : Rat) < ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + have h_mul_lo : ((a_58 : Rat) + 1) * ((2 ^ m : Nat) : Rat) <= ((ap : Rat) + 1) * (wordScale p_58 * ((2 ^ m : Nat) : Rat)) := by + nlinarith + have h_mul_hi : ((ap : Rat) + 1) * (wordScale p_58 * ((2 ^ m : Nat) : Rat)) < (((a_58 : Rat) + 1) + 11) * ((2 ^ m : Nat) : Rat) := by + nlinarith + rw [hz13] at h_mul_lo h_mul_hi + have ha58_val : a_58 + 1 = 2 ^ 32 := by decide + have ha58_r : (a_58 : Rat) + 1 = ((2 ^ 32 : Nat) : Rat) := by exact_mod_cast ha58_val + rw [ha58_r] at h_mul_lo h_mul_hi + have h_nat_lo : 2 ^ 32 * 2 ^ m <= (ap + 1) * 512 := by exact_mod_cast h_mul_lo + have h_nat_hi : (ap + 1) * 512 < (2 ^ 32 + 11) * 2 ^ m := by exact_mod_cast h_mul_hi + have h_512 : (ap + 1) * 512 = (8 * (ap + 1)) * 64 := by ring + rw [h_512] at h_nat_lo h_nat_hi + have h_split1 : 2 ^ 32 * 2 ^ m = (2 ^ 26 * 2 ^ m) * 64 := by + have : (2 ^ 32 : Nat) = 2 ^ 26 * 64 := by decide + rw [this]; ring + have h_split2 : (2 ^ 32 + 11) * 2 ^ m = (2 ^ 26 * 2 ^ m + 11 * 2 ^ (m - 6)) * 64 := by + have h32 : (2 ^ 32 : Nat) = 2 ^ 26 * 64 := by decide + have hm6 : 2 ^ m = 2 ^ (m - 6) * 64 := by + have h6 : (64 : Nat) = 2 ^ 6 := rfl + rw [h6, <- Nat.pow_add, Nat.sub_add_cancel (by omega : 6 <= m)] + calc (2 ^ 32 + 11) * 2 ^ m + _ = 2 ^ 32 * 2 ^ m + 11 * 2 ^ m := by ring + _ = (2 ^ 26 * 64) * 2 ^ m + 11 * (2 ^ (m - 6) * 64) := by rw [h32, hm6] + _ = (2 ^ 26 * 2 ^ m + 11 * 2 ^ (m - 6)) * 64 := by ring + rw [h_split1] at h_nat_lo + rw [h_split2] at h_nat_hi + have h_pos64 : 0 < 64 := by decide + have hap_lo : 2 ^ 26 * 2 ^ m <= 8 * (ap + 1) := Nat.le_of_mul_le_mul_right h_nat_lo h_pos64 + have hap_hi : 8 * (ap + 1) < 2 ^ 26 * 2 ^ m + 11 * 2 ^ (m - 6) := Nat.lt_of_mul_lt_mul_right h_nat_hi + have h_pow_m6 : 2 ^ (m - 6) = 2 * 2 ^ (m - 7) := by + have heq : m - 6 = 1 + (m - 7) := by omega + rw [heq, Nat.pow_add] + have h_pow_m : 2 ^ m = 128 * 2 ^ (m - 7) := by + have h7 : (128 : Nat) = 2 ^ 7 := rfl + rw [h7, <- Nat.pow_add, Nat.add_sub_of_le (by omega : 7 <= m)] + have h_pow_m7_ge : 32 <= 2 ^ (m - 7) := by + have h5 : 5 <= m - 7 := by omega + have hle := Nat.pow_le_pow_right (by decide : 1 <= 2) h5 + simpa using hle + rcases parse_digitVal_a hP_mid hD_mid with ⟨h_atop_lo, h_atop_hi⟩ + have h_sum_lo : 2 ^ 26 * 2 ^ m < (8 * ap + 9) + A_mid := by omega + have h_sum_hi : (8 * ap + 9) + A_mid < (2 ^ 26 + 1) * 2 ^ m := by + have : (2 ^ 26 + 1) * 2 ^ m = 2 ^ 26 * 2 ^ m + 128 * 2 ^ (m - 7) := by + rw [Nat.add_mul, Nat.one_mul, h_pow_m] + omega + have h_pos_m : 0 < 2 ^ m := pow_two_pos m + have h_lt1 : a_top < 2 ^ 26 + 1 := Nat.lt_of_mul_lt_mul_right (lt_of_le_of_lt h_atop_lo h_sum_hi) + have h_lt2 : 2 ^ 26 < a_top + 1 := Nat.lt_of_mul_lt_mul_right (lt_trans h_sum_lo h_atop_hi) + omega + +theorem bound_b_mid0 {p_58 v_p ds_mid : List Word} + {ap bp gp m A_mid b_mid0 : Nat} + (hm : 12 <= m) + (hS_p : Scan a_58 b_58 p_58 ap bp v_p gp) + (hbp : 3 <= bp) + (hz13 : wordScale p_58 * ((2 ^ m : Nat) : Rat) = 512) + (hzW : wordPot p_58 <= 21 / 4) + (hb_mid0 : b_mid0 = 4096 * (bp - 3) + 4287) + (hD_mid : DigitVal A_mid m ds_mid) : + 2 + 4 * wordVal ds_mid < (b_mid0 : Rat) := by + have h_delta_p := (Scan_delta hS_p).2 + have h_4wv_p := two_wordVal_add_wordValQ_le_four_wordPotV v_p + have h_cw_p := scan_wordPot_contract hS_p + have hc_b58 := (cPar_bounds b_58).2 + have h_wv_p_lt : wordPotV v_p < 6 := by linarith + have h_z13_p := scan_wordScale_eq hS_p + have h_pow_gp_ge1 : (1 : Rat) <= ((2 ^ (3 * gp) : Nat) : Rat) := by exact_mod_cast (pow_two_pos (3 * gp)) + have h_z13_vp_pos := wordScale_pos v_p + have h_z13_vp_le : wordScale v_p <= wordScale p_58 := by nlinarith + have h_b58_big : ((2 ^ 33 : Nat) : Rat) + 26 < (b_58 : Rat) := by norm_num [b_58] + have h_bp2_pos : (0 : Rat) <= (bp : Rat) - 2 := by + have : (2 : Rat) <= (bp : Rat) := by exact_mod_cast (by omega : 2 <= bp) + linarith + have h_prod_p : ((2 ^ 33 : Nat) : Rat) < ((bp : Rat) - 2) * wordScale p_58 := by nlinarith + have h_powm_pos : (0 : Rat) < ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + have h_mul_m : ((2 ^ 33 : Nat) : Rat) * ((2 ^ m : Nat) : Rat) < ((bp : Rat) - 2) * (wordScale p_58 * ((2 ^ m : Nat) : Rat)) := by + nlinarith + rw [hz13] at h_mul_m + have h_pow33 : ((2 ^ 33 : Nat) : Rat) = ((2 ^ 24 : Nat) : Rat) * 512 := by norm_num + rw [h_pow33] at h_mul_m + have h_bp2_gt : ((2 ^ 24 : Nat) : Rat) * ((2 ^ m : Nat) : Rat) < (bp : Rat) - 2 := by linarith + have h_bmid0_r : (b_mid0 : Rat) = 4096 * ((bp : Rat) - 3) + 4287 := by + rw [hb_mid0, Nat.cast_add, Nat.cast_mul, Nat.cast_sub hbp]; push_cast; ring + have h_z10_mid := (digitVal_scale_and_val hD_mid).2 + have h_pow24_val : ((2 ^ 24 : Nat) : Rat) = 16777216 := by norm_num + have h_powm_ge1 : (1 : Rat) <= ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + rw [h_z10_mid, h_bmid0_r] + rw [h_pow24_val] at h_bp2_gt + linarith + +theorem bound_zW_p58' {p_58 v_p ds_mid v_mid : List Word} + {ap bp gp m A_mid b_mid0 b_top28 g_mid : Nat} + (hm : 12 <= m) + (hS_p : Scan a_58 b_58 p_58 ap bp v_p gp) + (hz13 : wordScale p_58 * ((2 ^ m : Nat) : Rat) = 512) + (hzW : wordPot p_58 <= 21 / 4) + (hD_mid : DigitVal A_mid m ds_mid) + (hS_mid : Scan (8 * ap + 9) b_mid0 ds_mid (2 ^ 26) b_top28 v_mid g_mid) : + wordPotV (v_p ++ v_s19 ++ v_mid) <= 21 / 4 := by + -- Step A: wordPotV v_p <= 327 / 64 + have h_cw_p := scan_wordPot_contract hS_p + have hc_b58 : cPar b_58 = 3 / 16 := by + unfold cPar + have hmod : b_58 % 2 = 0 := by decide + rw [hmod]; rfl + rw [hc_b58] at h_cw_p + have hA : wordPotV v_p <= 327 / 64 := by linarith + -- wordScale bounds + have h_z13_p := scan_wordScale_eq hS_p + have h_z13_s19 : wordScale v_s19 = 1 / 4096 := by + have h := checkScalePow_sound v_s19 12 0 (by decide) + norm_num at h + linarith + have h_wv_s19 : wordPotV v_s19 <= 9 / 1024 := by + have h := checkWordPotVLe_sound v_s19 9 1024 (by decide) + norm_num at h + linarith + -- Step B: wordScale v_p * wordPotV v_s19 <= 9 / 8192 + have h_powm_ge12 : (2 ^ 12 : Nat) <= 2 ^ m := Nat.pow_le_pow_right (by decide) hm + have h_powm_r : ((2 ^ 12 : Nat) : Rat) <= ((2 ^ m : Nat) : Rat) := by exact_mod_cast h_powm_ge12 + have h_z13_p_le : wordScale p_58 <= 1 / 8 := by + have h_pos_p := wordScale_pos p_58 + have h_mul := mul_le_mul_of_nonneg_left h_powm_r (le_of_lt h_pos_p) + rw [hz13] at h_mul + norm_num at h_mul + linarith + have h_pow_gp_ge1 : (1 : Rat) <= ((2 ^ (3 * gp) : Nat) : Rat) := by exact_mod_cast (pow_two_pos (3 * gp)) + have h_z13_vp_pos := wordScale_pos v_p + have h_z13_vp_le : wordScale v_p <= 1 / 8 := by nlinarith + have hB : wordScale v_p * wordPotV v_s19 <= 9 / 8192 := by + have h_wv_nn := wordPotV_nonneg v_s19 + nlinarith + -- Step C: wordScale (v_p ++ v_s19) * wordPotV v_mid <= 1 / 8 + have h_dc_eq := digitVal_scan_dCount hS_mid hD_mid + have h_wv_mid_dc := (dCount_bound v_mid).2 + have h_vp_m : wordScale v_p * ((2 ^ m : Nat) : Rat) <= 512 := by + have h_eq : wordScale v_p * ((2 ^ m : Nat) : Rat) * ((2 ^ (3 * gp) : Nat) : Rat) = 512 := by + calc wordScale v_p * ((2 ^ m : Nat) : Rat) * ((2 ^ (3 * gp) : Nat) : Rat) + _ = (wordScale v_p * ((2 ^ (3 * gp) : Nat) : Rat)) * ((2 ^ m : Nat) : Rat) := by ring + _ = wordScale p_58 * ((2 ^ m : Nat) : Rat) := by rw [h_z13_p] + _ = 512 := hz13 + have h_pos_m : (0 : Rat) < ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + have h_nn : 0 <= wordScale v_p * ((2 ^ m : Nat) : Rat) := mul_nonneg (le_of_lt h_z13_vp_pos) (le_of_lt h_pos_m) + nlinarith + have h_prod_ps : wordScale v_p * wordScale v_s19 * ((2 ^ m : Nat) : Rat) <= 1 / 8 := by + rw [h_z13_s19] + linarith + have hC : wordScale (v_p ++ v_s19) * wordPotV v_mid <= 1 / 8 := by + rw [wordScale_append] + have h_wv_mid_le : wordPotV v_mid <= ((2 ^ m : Nat) : Rat) := by + have h_dc_le_m : 2 ^ (dCount v_mid) <= 2 ^ m := Nat.pow_le_pow_right (by decide) (by omega) + have h_dc_r : ((2 ^ (dCount v_mid) : Nat) : Rat) <= ((2 ^ m : Nat) : Rat) := by exact_mod_cast h_dc_le_m + linarith + have h_wv_mid_nn := wordPotV_nonneg v_mid + have h_z13_ps_pos : 0 < wordScale v_p * wordScale v_s19 := mul_pos h_z13_vp_pos (wordScale_pos v_s19) + nlinarith + -- Combine A + B + C + have h_app1 := wordPotV_append_le v_p v_s19 + have h_app2 := wordPotV_append_le (v_p ++ v_s19) v_mid + linarith + +theorem bound_b_end_digitVal {w_58 v_w58 : List Word} {b_top28 g_w58 k : Nat} + (hk : 3 <= k) + (hb_top28 : 3 <= b_top28) + (hS_w : Scan a_58 b_58 w_58 (2 ^ 26) b_top28 v_w58 g_w58) + (hz13_vw : wordScale v_w58 * ((2 ^ k : Nat) : Rat) = 1) + (hWV_vw : wordPotV v_w58 <= 21 / 4) : + ∃ A_core' ds_core', + DigitVal A_core' (k + 6) ds_core' ∧ + ds_core'.length = k + 6 ∧ + A_core' * 32 <= 31 * 2 ^ (k + 6) ∧ + DigitVal (32 * (b_top28 - 3) + 22) (k + 39) + ([K, Q, Q, K] ++ ds_core' ++ [K, K] ++ top27) := by + rcases Scan_delta hS_w with ⟨hd_lo, hd_hi⟩ + have h_4wv := two_wordVal_add_wordValQ_le_four_wordPotV v_w58 + have hd_hi' : ((b_58 : Rat) - 2) - ((b_top28 : Rat) - 2) * wordScale v_w58 <= 21 := by linarith + have h_powk_pos : (0 : Rat) < ((2 ^ k : Nat) : Rat) := by exact_mod_cast (pow_two_pos k) + have h_mul_lo : (((b_58 : Rat) - 2) - 21) * ((2 ^ k : Nat) : Rat) <= ((b_top28 : Rat) - 2) * (wordScale v_w58 * ((2 ^ k : Nat) : Rat)) := by + nlinarith + have h_mul_hi : ((b_top28 : Rat) - 2) * (wordScale v_w58 * ((2 ^ k : Nat) : Rat)) <= ((b_58 : Rat) - 1) * ((2 ^ k : Nat) : Rat) := by + nlinarith + rw [hz13_vw, mul_one] at h_mul_lo h_mul_hi + have hb58_r : (b_58 : Rat) - 2 = (A_top29 : Rat) * 32 + 30 := by norm_num [b_58, A_top29] + have hb58_1_r : (b_58 : Rat) - 1 = (A_top29 : Rat) * 32 + 31 := by norm_num [b_58, A_top29] + rw [hb58_r] at h_mul_lo + rw [hb58_1_r] at h_mul_hi + let b_end := 32 * (b_top28 - 3) + 22 + have hb_end_r : (b_end : Rat) = 32 * ((b_top28 : Rat) - 2) - 10 := by + dsimp [b_end] + rw [Nat.cast_add, Nat.cast_mul, Nat.cast_sub hb_top28] + push_cast; ring + have h_pow_k10 : ((2 ^ (k + 10) : Nat) : Rat) = 1024 * ((2 ^ k : Nat) : Rat) := by + have h10 : ((2 ^ 10 : Nat) : Rat) = 1024 := by norm_num + rw [Nat.pow_add, Nat.cast_mul, h10]; ring + have h_powk_ge1 : (1 : Rat) <= ((2 ^ k : Nat) : Rat) := by exact_mod_cast (pow_two_pos k) + have h_bend_lo_r : (A_top29 : Rat) * ((2 ^ (k + 10) : Nat) : Rat) < (b_end : Rat) := by + rw [hb_end_r, h_pow_k10]; linarith + have h_bend_mid_r : (b_end : Rat) + 10 <= (A_top29 : Rat) * ((2 ^ (k + 10) : Nat) : Rat) + 16 * 62 * ((2 ^ k : Nat) : Rat) := by + rw [hb_end_r, h_pow_k10]; linarith + have h_bend_hi_r : (b_end : Rat) < ((A_top29 : Rat) + 1) * ((2 ^ (k + 10) : Nat) : Rat) := by + rw [hb_end_r, h_pow_k10]; linarith + have h_bend_lo : A_top29 * 2 ^ (k + 10) < b_end := by exact_mod_cast h_bend_lo_r + have h_bend_mid : b_end + 10 <= A_top29 * 2 ^ (k + 10) + 16 * 62 * 2 ^ k := by exact_mod_cast h_bend_mid_r + have h_bend_hi : b_end < (A_top29 + 1) * 2 ^ (k + 10) := by exact_mod_cast h_bend_hi_r + have h_bend_mod16 : b_end % 16 = 6 := by dsimp [b_end]; omega + let A_core' := (b_end / 16) % (2 ^ (k + 6)) + have h_Acore'_lt : A_core' < 2 ^ (k + 6) := Nat.mod_lt _ (pow_two_pos (k + 6)) + rcases exists_digitVal_of_lt_pow (k + 6) A_core' h_Acore'_lt with ⟨ds_core', hD_core'⟩ + have h_len_core' := length_of_digitVal hD_core' + have h_bot_mid := digitVal_append digitVal_bot4 hD_core' + have h_all := digitVal_append h_bot_mid zDg_top29 + have h_len_all : (4 + (k + 6)) + 29 = k + 39 := by omega + have h_pow_k10_eq : 2 ^ (k + 10) = 16 * 2 ^ (k + 6) := by + have : k + 10 = 4 + (k + 6) := by omega + rw [this, Nat.pow_add] + have h_div_top : b_end / (2 ^ (k + 10)) = A_top29 := by + have h_pos_k10 : 0 < 2 ^ (k + 10) := pow_two_pos (k + 10) + have h1 := (Nat.le_div_iff_mul_le h_pos_k10).mpr (le_of_lt h_bend_lo) + have h2 := (Nat.div_lt_iff_lt_mul h_pos_k10).mpr h_bend_hi + omega + have h_val_all : 6 + A_core' * 2 ^ 4 + A_top29 * 2 ^ (4 + (k + 6)) = b_end := by + have h1 : 2 ^ 4 = 16 := by decide + have h2 : 2 ^ (4 + (k + 6)) = 16 * 2 ^ (k + 6) := by rw [Nat.pow_add] + rw [h1, h2] + have h_assoc : A_top29 * (16 * 2 ^ (k + 6)) = 16 * (A_top29 * 2 ^ (k + 6)) := by ring + rw [h_assoc] + dsimp [A_core'] + have h_div16 : (b_end / 16) / (2 ^ (k + 6)) = A_top29 := by + rw [Nat.div_div_eq_div_mul, <- h_pow_k10_eq, h_div_top] + have h_mod_div := Nat.div_add_mod (b_end / 16) (2 ^ (k + 6)) + rw [h_div16, Nat.mul_comm (2 ^ (k + 6)) A_top29] at h_mod_div + have h_mod16 := Nat.div_add_mod b_end 16 + omega + have h_Acore'_le_k : A_core' <= 62 * 2 ^ k := by + have h_eq4 : 2 ^ 4 = 16 := by decide + have h_eq_k10 : 2 ^ (4 + (k + 6)) = 2 ^ (k + 10) := by + have : 4 + (k + 6) = k + 10 := by omega + rw [this] + rw [h_eq4, h_eq_k10] at h_val_all + omega + have h_Acore'_32 : A_core' * 32 <= 31 * 2 ^ (k + 6) := by + have h_pow_k6 : 2 ^ (k + 6) = 64 * 2 ^ k := by + have : k + 6 = 6 + k := by omega + rw [this, Nat.pow_add] + omega + rw [h_len_all, h_val_all] at h_all + exact ⟨A_core', ds_core', hD_core', h_len_core', h_Acore'_32, by simpa [List.append_assoc] using h_all⟩ + +theorem Good_step {u : List Word} (hG : Good u) : + ∃ u', Step u u' ∧ Good u' := by + rcases hG with ⟨p_58, ds_core, A_core, m, rfl, ⟨p_tail, hp_start⟩, hm_def, hm, hD_core, hA_core, hz13, hzW⟩ + -- Piece 2: p_58 + have hP_p_ex : ∃ ap gp, Parse a_58 p_58 ap gp := by + rw [hp_start]; exact Parse_V_start a_58 p_tail + rcases hP_p_ex with ⟨ap, gp, hP_p⟩ + have hb_58_ok : 2 + 4 * wordVal p_58 < (b_58 : Rat) := by + have hz12 := wordValQ_nonneg p_58 + have hz10_le := two_wordVal_add_wordValQ_le p_58 + have hb58_gt : (25 : Rat) < (b_58 : Rat) := by norm_num [b_58] + linarith + rcases Scan_of_Parse hP_p b_58 hb_58_ok with ⟨bp, v_p, hS_p, hbp⟩ + -- Piece 3: s19 + have hS_s19 := Scan_s19 ap bp hbp + let b_mid0 := 4096 * (bp - 3) + 4287 + -- Piece 4: ds_mid = [Q, K] ++ ds_core ++ [K, K] + let ds_mid := [Q, K] ++ ds_core ++ [K, K] + rcases digitVal_mid hm hD_core hA_core with ⟨A_mid, hD_mid, hA_lo, hA_hi⟩ + have hP_s19_all : ∃ a_top g_all, Parse ap (s19 ++ ds_mid) a_top g_all := by + change ∃ a_top g_all, Parse ap (V :: (s19.tail ++ ds_mid)) a_top g_all + exact Parse_V_start ap _ + rcases hP_s19_all with ⟨a_top, g_all, hP_all⟩ + have hP_mid_ex : ∃ g_mid, Parse (8 * ap + 9) ds_mid a_top g_mid := by + dsimp [ds_mid] at hP_all ⊢ + exact Parse_s19_split hP_all + rcases hP_mid_ex with ⟨g_mid, hP_mid⟩ + have hatop_eq := force_a26 hm hP_p hz13 hzW hD_mid hA_lo hA_hi hP_mid + subst hatop_eq + have hb_mid0_ok := bound_b_mid0 hm hS_p hbp hz13 hzW rfl hD_mid + rcases Scan_of_Parse hP_mid b_mid0 hb_mid0_ok with ⟨b_top28, v_mid, hS_mid, hb_top28_ge3⟩ + -- Piece 5: top28 = top27 ++ [K] + have hS_top28 := Scan_top28 b_top28 hb_top28_ge3 + -- Combine Pieces 2 + 3 + 4 into w_58 + let w_58 := p_58 ++ s19 ++ ds_mid + let v_w58 := v_p ++ v_s19 ++ v_mid + let g_w58 := gp + 3 + g_mid + have hS_w58 : Scan a_58 b_58 w_58 (2 ^ 26) b_top28 v_w58 g_w58 := by + have h23 := Scan_append hS_p hS_s19 + have h234 := Scan_append h23 hS_mid + simpa [w_58, v_w58, g_w58, List.append_assoc, Nat.add_assoc] using h234 + -- Combine Piece 1 + w_58 + Piece 5 + have h_u_rep1 : + (head58 ++ p_58 ++ s17 ++ [K, Q, Q, K] ++ ds_core ++ [K, K] ++ top27) ++ List.replicate 1 K = + head58 ++ w_58 ++ top28 := by + dsimp [w_58, s19, ds_mid, top28, List.replicate] + simp only [List.append_assoc, List.cons_append, List.nil_append, List.append_nil] + have hS_full : + Scan 0 6 ((head58 ++ p_58 ++ s17 ++ [K, Q, Q, K] ++ ds_core ++ [K, K] ++ top27) ++ List.replicate 1 K) + 0 (32 * (b_top28 - 3) + 22) (v_head58 ++ v_w58 ++ s17) (0 + g_w58 + 11) := by + rw [h_u_rep1] + exact Scan_append (Scan_append Scan_head58 hS_w58) hS_top28 + -- Closure bounds for p_58' = V :: v_w58 and b_end + let k := 3 + 3 * gp + 3 * g_mid + have hk : 3 <= k := by omega + have hWV_vw : wordPotV v_w58 <= 21 / 4 := + bound_zW_p58' hm hS_p hz13 hzW hD_mid hS_mid + have hz13_vw : wordScale v_w58 * ((2 ^ k : Nat) : Rat) = 1 := by + have h_z13_w := scan_wordScale_eq hS_w58 + have h_w_eq : wordScale w_58 = 64 := by + dsimp only [w_58] + rw [wordScale_append, wordScale_append] + have h_s19 : wordScale s19 = 1 / 8 := by + have h := checkScalePow_sound s19 3 0 (by decide) + norm_num at h + linarith + have h_mid := (digitVal_scale_and_val hD_mid).1 + rw [h_s19, h_mid] + linarith + rw [h_w_eq] at h_z13_w + have h_3gw : 3 * g_w58 = k + 6 := by dsimp [g_w58, k]; omega + have h6 : ((2 ^ 6 : Nat) : Rat) = 64 := by norm_num + rw [h_3gw, Nat.pow_add, Nat.cast_mul, h6] at h_z13_w + linarith + rcases bound_b_end_digitVal hk hb_top28_ge3 hS_w58 hz13_vw hWV_vw + with ⟨A_core', ds_core', hD_core', hlen_core', hA_core', hD_bend⟩ + let da := [K, Q, Q, K] ++ ds_core' ++ [K, K] ++ top27 + let u' := V :: (v_head58 ++ v_w58 ++ s17 ++ da) + refine ⟨u', ⟨1, 32 * (b_top28 - 3) + 22, v_head58 ++ v_w58 ++ s17, da, k + 39, 0 + g_w58 + 11, hS_full, hD_bend, rfl⟩, ?_⟩ + -- Prove Good u' + let p_58' := V :: v_w58 + let m' := k + 10 + refine ⟨p_58', ds_core', A_core', m', ?_, ⟨v_w58, rfl⟩, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · dsimp only [u', p_58', da, v_head58, head58] + simp only [List.cons_append, List.nil_append, List.append_assoc] + · dsimp [m']; omega + · dsimp [m']; omega + · have h_m'_4 : m' - 4 = k + 6 := by dsimp [m']; omega + rwa [h_m'_4] + · have h_m'_4 : m' - 4 = k + 6 := by dsimp [m']; omega + rwa [h_m'_4] + · dsimp only [p_58', m', wordScale] + have h_m'_split : k + 10 = k + 1 + 9 := by omega + have h1 : ((2 ^ 1 : Nat) : Rat) = 2 := by norm_num + have h9 : ((2 ^ 9 : Nat) : Rat) = 512 := by norm_num + rw [h_m'_split, Nat.pow_add, Nat.pow_add, Nat.cast_mul, Nat.cast_mul, h1, h9] + linarith + · dsimp only [p_58'] + rw [wordPot_cons_V] + exact hWV_vw + +theorem reach_N (m : Nat) : + ∃ N, m <= N ∧ ∃ u, + multiStep tm (init []) N = some (zCf (evalWords u default)) ∧ + Good u := by + induction m with + | zero => + rcases init_to_u0 with ⟨k1, hk1⟩ + rcases Rounds_exec rounds_0_13 with ⟨k2, hk2⟩ + exact ⟨k1 + k2, Nat.zero_le _, u_13, multiStep_trans_vkq tm _ _ _ k1 k2 hk1 hk2, good_u13⟩ + | succ m ih => + rcases ih with ⟨N, hN, u, h_ms, hG⟩ + rcases Good_step hG with ⟨u', hStep, hG'⟩ + rcases Step_exec hStep with ⟨k, hk_pos, h_step_k⟩ + exact ⟨N + k, Nat.add_le_add hN hk_pos, u', multiStep_trans_vkq tm _ _ _ N k h_ms h_step_k, hG'⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n, hn⟩ + rcases reach_N (n + 1) with ⟨N, hN, _, h_N, _⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := multiStep_add_intermediate_vkq h_N + rw [multiStep_succ_vkq, hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LA0LB_0RBHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LB0LB_0RBHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LB0LB_0RBHHH.lean new file mode 100644 index 00000000..2b868624 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LB0LB_0RBHHH.lean @@ -0,0 +1,918 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusF +public import BusyBeaver.Calculi.WordCalculusG +public import BusyBeaver.Calculi.WordCalculusH + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LB0LB_0RBHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LB0LB_0RBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +abbrev A : Fin 6 := 3 +abbrev B : Fin 6 := 4 +abbrev C : Fin 6 := 1 +abbrev D : Fin 6 := 0 +abbrev E : Fin 6 := 2 +abbrev F : Fin 6 := 5 +@[reducible] def tm : Machine (Fin 2) (Fin 6) := target_tm +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 8000000 + +open WordVKQ Word + +abbrev evalCCfgVKQ (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev z0b (c : CCfg) : Option CCfg := Counter.bstep tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (evalCCfgVKQ c1) [tm]⊢⁺ (evalCCfgVKQ c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ + +set_option maxRecDepth 200000 +set_option exponentiation.threshold 2048 +abbrev pref_cap : BitWord := [1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0] + + +def zCs : Call -> Fin 6 + | .ch => E + | .ca => C + +def zCR (w : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([1] +> r) {{zCs c}}> w) + +def zCL (w : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (r <{{A}} ([0] +> w)) + +def zCf (w : HalfTape) : Cfg (Fin 2) (Fin 6) := + (default <{{A}} ([0] +> pref_cap +> w)) +abbrev callStep (c : Call) (w1 w2 : HalfTape) : Prop := + ∀ r, (zCR w1 c r) [tm]⊢⁺ (zCL w2 r) + +abbrev Side := SideP callStep +abbrev Seg := SegP callStep + +theorem seg_ch_V : Seg [.ch] [.ch, .ch] V_u V_u := + segP_of_step_two (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (fun u r => by unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_V : Seg [.ca] [.ch] V_u Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Vp : Seg [.ca] [.ca, .ca] Vp Vp := + segP_of_step_two (mid1 := [0, 1, 1, 1]) (mid2 := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_K : Seg [.ch] [] K_u Q_u := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs K_u Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_Q : Seg [.ch] [.ch] Q_u K_u := + segP_of_step_one (mid := [1, 1]) + (fun u r => by unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL K_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_VpQ : Seg [.ca] [.ca] (Vp ++ Q_u) (Kp ++ Vp) := + segP_of_step_one (mid := [0, 1, 0, 1, 1, 1]) + (fun u r => by unfold zCR zCs Vp Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_KpVp : Seg [.ca] [] (Kp ++ Vp) (Qp ++ Vp) := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs Kp Vp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_QpVp : Seg [.ca] [.ca, .ca] (Qp ++ Vp) (Kp ++ Vp) := + segP_of_step_two (mid1 := [0, 1, 1, 1, 1, 1]) (mid2 := [0, 1, 0, 1, 1, 1]) + (fun u r => by unfold zCR zCs Qp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Kp : Seg [.ca] [] Kp Qp := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs Kp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Qp : Seg [.ca] [.ca] Qp Kp := + segP_of_step_one (mid := [1, 1]) + (fun u r => by unfold zCR zCs Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_KQ : Seg [.ca] [] (K_u ++ Q_u) Vp := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs K_u Q_u Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_QQ : Seg [.ca] [.ca] (Q_u ++ Q_u) Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + + +-- Turnaround zP0..zP6 +abbrev tr1 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr2 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr3 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr4 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1] +abbrev tr5 : BitWord := [0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1] +abbrev tr6 : BitWord := [0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1] + +theorem zP0 (w : HalfTape) : (zCf w) [tm]⊢⁺ (zCR w .ca (tr1 +> default)) := by + unfold zCf zCR zCs pref_cap tr1 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP1 (w : HalfTape) : (zCL w (tr1 +> default)) [tm]⊢⁺ (zCR w .ca (tr2 +> default)) := by + unfold zCL zCR zCs tr1 tr2 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP2 (w : HalfTape) : (zCL w (tr2 +> default)) [tm]⊢⁺ (zCR w .ca (tr3 +> default)) := by + unfold zCL zCR zCs tr2 tr3 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP3 (w : HalfTape) : (zCL w (tr3 +> default)) [tm]⊢⁺ (zCR w .ca (tr4 +> default)) := by + unfold zCL zCR zCs tr3 tr4 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP4 (w : HalfTape) : (zCL w (tr4 +> default)) [tm]⊢⁺ (zCR w .ca (tr5 +> default)) := by + unfold zCL zCR zCs tr4 tr5 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP5 (w : HalfTape) : (zCL w (tr5 +> default)) [tm]⊢⁺ (zCR w .ca (tr6 +> default)) := by + unfold zCL zCR zCs tr5 tr6 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute +theorem zP6 (w : HalfTape) : (zCL w (tr6 +> default)) [tm]⊢⁺ (zCf ([1, 1, 0] +> w)) := by + unfold zCL zCf tr6 pref_cap + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +-- Section 2: Words, Shift Identity, DigitVal, Parse, Scan, Step +theorem segSpec : SegSpec callStep := + ⟨seg_ch_V, seg_ca_V, seg_ca_Vp, seg_ch_K, seg_ch_Q, + seg_ca_VpQ, seg_ca_KpVp, seg_ca_QpVp, seg_ca_Kp, seg_ca_Qp, + seg_ca_KQ, seg_ca_QQ⟩ + +theorem Side_turnaround {w w' : HalfTape} (h : Side ([Call.ca] ^ 6) w w') : + (zCf w) [tm]⊢⁺ (zCf ([1, 1, 0] +> w')) := by + rcases h with _ | ⟨hc1, h⟩ + rcases h with _ | ⟨hc2, h⟩ + rcases h with _ | ⟨hc3, h⟩ + rcases h with _ | ⟨hc4, h⟩ + rcases h with _ | ⟨hc5, h⟩ + rcases h with _ | ⟨hc6, h⟩ + cases h + exact stepPlus_trans_vkq (zP0 w) (stepPlus_trans_vkq (hc1 (tr1 +> default)) (stepPlus_trans_vkq (zP1 _) (stepPlus_trans_vkq (hc2 (tr2 +> default)) (stepPlus_trans_vkq (zP2 _) (stepPlus_trans_vkq (hc3 (tr3 +> default)) (stepPlus_trans_vkq (zP3 _) (stepPlus_trans_vkq (hc4 (tr4 +> default)) (stepPlus_trans_vkq (zP4 _) (stepPlus_trans_vkq (hc5 (tr5 +> default)) (stepPlus_trans_vkq (zP5 _) (stepPlus_trans_vkq (hc6 (tr6 +> default)) (zP6 w')))))))))))) + +theorem Step_exec {u u' : List Word} (h : Step u u') : + (zCf (evalWords u default)) [tm]⊢⁺ (zCf (evalWords u' default)) := by + rcases h with ⟨n, b', v, da, H, g, hScan, hDg, rfl⟩ + have hSeg := Seg_of_Scan segSpec hScan + dsimp at hSeg + have hSide0 := sideP_of_segP hSeg (Side_ca_default segSpec hDg) + rw [wordsToBits_append_tape, evalWords_append, evalWords_replicate_K, wordsToBitsShifted_append_tape, <- evalWordsShifted_append] at hSide0 + have hTurn := Side_turnaround hSide0 + rwa [evalWords_V_shift] at hTurn + +theorem Rounds_exec {u v : List Word} (h : Rounds u v) : + (zCf (evalWords u default)) [tm]⊢* (zCf (evalWords v default)) := by + induction h with + | refl _ => exact ⟨0, rfl⟩ + | next hS _ ih => exact stepStar_of_stepPlus_vkq (stepPlus_stepStar_trans_vkq (Step_exec hS) ih) + +-- Section 3: Universal Parse_V_start, Scan_of_Parse, and Trace Evaluators + +def u_0 : List Word := [Q,Q] +def tags_0 : List Nat := [5] +def da_0 : List Word := [Q,Q,K,Q] +def n_0 : Nat := 0 +def u_1 : List Word := [V,V,Q,Q,K,Q] +def tags_1 : List Nat := [0,0,4,5] +def da_1 : List Word := [Q,Q,K,K,K,K,Q] +def n_1 : Nat := 0 +def u_2 : List Word := [V,V,V,V,V,Q,Q,K,K,K,K,Q] +def tags_2 : List Nat := [0,0,0,0,0,4,3,3,3,5] +def da_2 : List Word := [Q,Q,Q,Q,Q,Q] +def n_2 : Nat := 0 +def u_3 : List Word := [V,V,V,V,V,V,V,K,Q,K,V,Q,Q,Q,Q,Q,Q] +def tags_3 : List Nat := [0,0,0,0,0,0,1,3,3,0,3,3,3,3,3,5] +def da_3 : List Word := [Q,K,Q] +def n_3 : Nat := 1 +def u_4 : List Word := [V,V,V,V,V,V,V,K,V,Q,K,V,K,Q,Q,Q,Q,V,Q,K,Q] +def tags_4 : List Nat := [0,0,0,0,0,0,1,0,3,3,1,5,5,0,4,4] +def da_4 : List Word := [K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q] +def n_4 : Nat := 1 +def u_5 : List Word := [V,V,V,V,V,V,V,K,V,V,K,K,K,V,V,V,V,V,V,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q] +def tags_5 : List Nat := [0,0,0,0,0,0,1,0,1,5,0,0,0,0,0,1,3,4,5,3,5,5,4] +def da_5 : List Word := [K,K,K,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q] +def n_5 : Nat := 1 +def u_6 : List Word := [V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,Q,V,V,Q,V,V,V,K,K,K,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q] +def tags_6 : List Nat := [0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,3,0,0,3,0,0,1,5,3,5,5,4,3,5,5,5,4] +def da_6 : List Word := [K,K,K,K,Q,Q,K,Q,K,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def n_6 : Nat := 1 +def u_7 : List Word := [V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,Q,V,V,V,K,V,V,V,V,K,K,K,K,Q,Q,K,Q,K,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def tags_7 : List Nat := [0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,3,0,0,1,0,0,0,0,5,5,4,5,4,3,5,5,3,3,5,5,5,4] +def da_7 : List Word := [K,K,K,K,K,K,Q,Q,K,K,K,K,Q,Q,K,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def n_7 : Nat := 1 +def u_8 : List Word := [V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,Q,K,V,V,V,V,K,K,K,K,K,K,Q,Q,K,K,K,K,Q,Q,K,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def tags_8 : List Nat := [0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,3,3,0,0,0,0,5,5,3,3,5,3,3,3,3,5,3,3,3,3,4,5,5,3,3,5,5,5,4] +def da_8 : List Word := [K,K,K,K,K,Q,K,Q,Q,Q,Q,Q,K,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def n_8 : Nat := 1 +def u_9 : List Word := [V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,V,K,Q,V,V,V,V,V,V,Q,K,V,Q,K,K,K,V,Q,Q,K,K,V,V,V,Q,K,V,V,V,V,K,K,K,K,K,Q,K,Q,Q,Q,Q,Q,K,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def tags_9 : List Nat := [0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,3,0,0,0,0,0,0,3,3,0,4,3,3,0,3,3,4,0,0,0,3,3,0,0,0,0,5,5,3,3,5,5,5,3,4,3,3,3,4,5,5,3,3,5,5,5,4] +def da_9 : List Word := [K,K,K,K,K,Q,K,Q,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def n_9 : Nat := 1 +def u_10 : List Word := [V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,V,K,V,Q,V,V,V,V,V,V,K,Q,V,V,K,Q,V,K,Q,V,V,V,V,K,Q,V,V,V,V,V,V,Q,K,V,V,V,Q,V,K,Q,Q,V,V,V,Q,K,V,V,V,V,K,K,K,K,K,Q,K,Q,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def tags_10 : List Nat := [0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,0,3,0,0,0,0,0,1,3,0,1,3,1,3,0,0,0,1,3,0,0,0,0,0,0,3,3,0,0,0,3,2,5,0,0,0,3,3,0,0,0,0,5,5,3,5,5,3,5,4,3,3,5,5,5,5,3,4,3,3,3,4,5,5,3,3,5,5,5,4] +def da_10 : List Word := [K,K,K,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,Q,Q,Q,K,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def n_10 : Nat := 1 +def u_11 : List Word := [V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,Q,V,K,V,Q,K,V,Q,V,V,V,K,V,Q,V,V,V,V,V,V,K,Q,V,V,V,K,Q,V,V,V,V,V,K,Q,V,V,V,V,V,V,Q,V,V,Q,V,V,K,K,V,V,V,V,Q,V,K,Q,Q,V,V,V,Q,K,V,V,V,V,K,K,K,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,Q,Q,Q,K,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def tags_11 : List Nat := [0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,0,1,0,0,0,0,1,0,3,1,0,4,0,3,0,0,1,0,3,0,0,0,0,0,1,3,0,0,1,3,0,0,0,0,1,3,0,0,0,0,0,0,3,0,0,3,0,0,5,0,0,0,0,3,2,5,0,0,0,3,3,0,0,0,0,5,5,3,3,4,3,3,3,4,3,5,4,5,3,5,3,5,3,3,5,5,5,5,3,4,3,3,3,4,5,5,3,3,5,5,5,4] +def da_11 : List Word := [K,K,K,K,K,Q,Q,Q,Q,K,Q,K,K,Q,K,K,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,K,K,Q,Q,Q,K,K,Q,K,K,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def n_11 : Nat := 1 +def u_12 : List Word := [V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,K,V,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,Q,V,V,K,V,Q,V,V,V,V,K,V,Q,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,Q,V,V,V,V,V,K,Q,V,V,V,V,V,V,Q,K,V,K,K,K,V,K,V,V,V,Q,V,Q,V,Q,Q,V,V,V,V,Q,V,K,Q,Q,V,V,V,Q,K,V,V,V,V,K,K,K,K,K,Q,Q,Q,Q,K,Q,K,K,Q,K,K,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,K,K,Q,Q,Q,K,K,Q,K,K,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def tags_12 : List Nat := [0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,0,1,0,0,0,0,1,0,0,5,0,0,0,1,0,1,0,1,0,0,0,0,1,0,3,0,1,0,3,0,0,0,1,0,3,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,3,0,0,0,0,1,3,0,0,0,0,0,0,3,3,1,3,3,2,0,0,0,3,0,3,0,4,0,0,0,0,3,2,5,0,0,0,3,3,0,0,0,0,5,5,3,3,3,4,3,4,5,3,3,4,3,5,5,3,5,3,3,5,5,3,4,3,3,5,3,4,3,5,5,5,5,3,4,3,3,3,4,5,5,3,3,5,5,5,4] +def da_12 : List Word := [K,K,K,K,K,Q,Q,Q,K,K,Q,K,K,Q,Q,Q,Q,K,K,Q,K,K,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,Q,K,K,Q,Q,K,K,K,Q,Q,K,K,K,Q,Q,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def n_12 : Nat := 1 +def u_13 : List Word := [V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,Q,V,V,V,V,K,V,Q,V,V,V,V,V,V,K,Q,K,V,Q,Q,Q,V,V,V,V,K,V,K,V,V,V,V,V,V,K,Q,V,V,V,V,V,K,Q,V,V,V,V,V,V,Q,K,Q,V,K,V,V,Q,Q,V,K,V,V,Q,V,Q,Q,V,V,Q,V,K,Q,V,Q,V,K,V,V,V,V,Q,V,K,Q,Q,V,V,V,Q,K,V,V,V,V,K,K,K,K,K,Q,Q,Q,K,K,Q,K,K,Q,Q,Q,Q,K,K,Q,K,K,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,Q,K,K,Q,Q,K,K,K,Q,Q,K,K,K,Q,Q,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def tags_13 : List Nat := [0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,1,0,1,2,0,1,0,0,1,0,1,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,3,0,0,0,1,0,3,0,0,0,0,0,1,3,3,0,3,3,3,0,0,0,1,2,0,0,0,0,0,1,3,0,0,0,0,1,3,0,0,0,0,0,0,3,4,1,0,0,4,1,0,0,3,0,3,3,0,0,3,0,5,0,3,1,0,0,0,0,3,2,5,0,0,0,3,3,0,0,0,0,5,5,3,3,4,3,3,3,5,5,5,3,4,3,5,3,5,5,3,4,5,5,3,5,3,3,5,3,3,3,5,3,3,3,5,5,3,4,3,5,5,5,5,3,4,3,3,3,4,5,5,3,3,5,5,5,4] +def da_13 : List Word := [K,K,K,K,K,Q,K,K,Q,K,Q,K,K,Q,K,Q,K,K,K,Q,K,K,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,K,K,Q,K,K,K,Q,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,K,K,Q,K,Q,Q,K,K,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def n_13 : Nat := 1 +def u_14 : List Word := [V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,Q,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,Q,K,V,K,Q,Q,V,V,V,K,V,Q,V,V,V,V,V,V,K,V,Q,V,V,V,V,K,V,Q,V,V,V,V,V,V,K,V,K,V,V,V,V,K,V,V,V,K,V,K,K,V,V,K,V,V,V,K,K,V,V,V,V,V,K,Q,V,V,V,V,V,K,Q,V,V,V,V,V,V,Q,K,V,K,K,K,V,V,V,Q,V,K,V,Q,V,V,Q,V,V,V,Q,V,Q,Q,V,Q,Q,Q,V,Q,K,Q,V,V,Q,V,K,V,V,V,V,Q,V,K,Q,Q,V,V,V,Q,K,V,V,V,V,K,K,K,K,K,Q,K,K,Q,K,Q,K,K,Q,K,Q,K,K,K,Q,K,K,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,K,K,Q,K,K,K,Q,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,K,K,Q,K,Q,Q,K,K,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def tags_14 : List Nat := [0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,1,0,1,0,3,0,1,0,0,1,0,1,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,0,1,0,1,0,0,0,0,1,0,3,3,1,5,0,0,1,0,3,0,0,0,0,0,1,0,3,0,0,0,1,0,3,0,0,0,0,0,1,2,0,0,0,1,0,0,1,0,5,0,1,0,0,0,5,0,0,0,0,1,3,0,0,0,0,1,3,0,0,0,0,0,0,3,3,1,3,3,0,0,0,3,2,0,3,0,0,3,0,0,0,3,0,3,3,0,3,5,0,3,4,0,0,3,2,0,0,0,0,3,2,5,0,0,0,3,3,0,0,0,0,5,5,3,3,3,4,3,4,5,4,3,3,4,3,3,5,5,3,5,4,5,4,5,3,3,5,3,5,5,3,4,5,3,4,3,3,4,5,3,3,4,5,5,4,5,3,4,3,5,5,5,5,3,4,3,3,3,4,5,5,3,3,5,5,5,4] +def da_14 : List Word := [K,K,K,K,K,Q,Q,Q,K,K,K,K,K,K,K,Q,Q,K,Q,Q,K,K,Q,K,K,Q,K,Q,K,Q,Q,Q,K,K,Q,Q,K,Q,K,K,K,K,Q,K,K,Q,Q,K,Q,Q,K,K,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,K,K,Q,K,Q,K,K,Q,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,K,Q,Q,K,Q,Q,K,K,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def n_14 : Nat := 1 +def u_15 : List Word := [V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,K,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,K,K,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,Q,V,V,V,V,K,V,V,V,K,V,V,V,V,K,V,V,V,V,V,V,V,V,V,K,V,Q,V,V,V,V,K,V,Q,V,V,V,V,V,V,K,Q,K,V,Q,Q,V,V,V,K,Q,V,V,K,V,V,K,V,V,V,K,V,K,K,V,K,V,V,K,V,V,V,K,Q,V,V,V,V,V,K,Q,V,V,V,V,V,K,Q,V,V,V,V,V,V,Q,K,Q,V,K,V,V,V,K,K,V,K,K,V,V,Q,V,V,V,V,V,Q,Q,V,Q,V,V,Q,V,V,Q,V,K,K,V,V,Q,Q,V,V,V,V,V,Q,V,K,V,V,V,V,Q,V,K,Q,Q,V,V,V,Q,K,V,V,V,V,K,K,K,K,K,Q,Q,Q,K,K,K,K,K,K,K,Q,Q,K,Q,Q,K,K,Q,K,K,Q,K,Q,K,Q,Q,Q,K,K,Q,Q,K,Q,K,K,K,K,Q,K,K,Q,Q,K,Q,Q,K,K,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,K,K,Q,K,Q,K,K,Q,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,K,Q,Q,K,Q,Q,K,K,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def tags_15 : List Nat := [0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,1,0,1,0,1,2,0,0,1,0,1,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,0,1,0,1,0,0,0,0,1,0,1,5,0,0,0,1,0,1,0,0,0,0,1,0,1,0,0,1,0,1,0,0,0,0,1,0,3,0,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,3,0,0,0,1,0,3,0,0,0,0,0,1,3,3,0,3,3,0,0,1,3,0,1,0,1,0,0,1,0,5,2,0,1,0,0,1,3,0,0,0,0,1,3,0,0,0,0,1,3,0,0,0,0,0,0,3,4,1,0,0,0,5,0,5,0,0,3,0,0,0,0,0,4,0,3,0,0,3,0,0,3,2,3,0,0,4,0,0,0,0,0,3,2,0,0,0,0,3,2,5,0,0,0,3,3,0,0,0,0,5,5,3,4,4,4,5,4,3,4,3,4,5,3,5,4,3,3,4,3,5,3,5,3,3,3,4,3,3,5,3,5,4,5,5,3,5,3,5,5,3,4,4,3,4,3,4,5,5,3,4,5,3,4,3,5,3,5,3,3,4,5,5,4,5,3,4,3,5,5,5,5,3,4,3,3,3,4,5,5,3,3,5,5,5,4] +def da_15 : List Word := [K,K,K,K,K,Q,Q,Q,K,K,Q,K,Q,K,K,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,K,K,Q,K,K,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,K,K,Q,K,K,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,K,K,Q,K,K,Q,Q,Q,K,K,Q,Q,K,Q,K,Q,Q,Q,K,K,Q,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,K,Q,Q,K,Q,Q,K,K,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def n_15 : Nat := 1 +def u_16 : List Word := [V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,K,V,Q,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,V,K,V,V,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,Q,K,V,K,Q,V,V,K,V,Q,V,K,V,V,K,V,V,V,K,V,V,V,Q,V,V,K,V,V,V,K,V,Q,V,V,V,V,K,V,Q,V,V,V,V,K,V,Q,V,V,V,V,V,V,K,V,K,V,V,V,V,V,V,V,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,Q,V,Q,V,V,V,V,V,V,V,V,K,Q,V,V,V,V,V,K,Q,V,V,V,V,V,K,Q,V,V,V,V,V,V,Q,V,V,V,V,V,K,V,K,V,V,Q,V,V,K,K,V,K,V,Q,V,Q,Q,Q,V,K,Q,V,Q,V,V,V,V,Q,V,Q,V,V,Q,V,V,K,V,K,V,V,V,Q,V,V,Q,V,K,V,Q,V,Q,K,V,V,V,V,V,Q,V,K,V,V,V,V,Q,V,K,Q,Q,V,V,V,Q,K,V,V,V,V,K,K,K,K,K,Q,Q,Q,K,K,Q,K,Q,K,K,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,K,K,Q,K,K,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,K,K,Q,K,K,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,K,K,Q,K,K,Q,Q,Q,K,K,Q,Q,K,Q,K,Q,Q,Q,K,K,Q,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,K,Q,Q,K,Q,Q,K,K,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def tags_16 : List Nat := [0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,1,0,1,0,1,0,3,0,0,1,0,1,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,0,1,0,1,0,0,0,0,1,0,1,0,0,0,0,1,0,1,0,0,0,0,1,0,1,0,0,1,0,1,0,0,0,0,1,0,1,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,1,0,0,0,0,1,0,3,3,0,5,0,1,0,3,1,0,1,0,0,1,0,0,0,3,0,1,0,0,1,0,3,0,0,0,1,0,3,0,0,0,1,0,3,0,0,0,0,0,1,2,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,1,3,0,3,0,0,0,0,0,0,0,1,3,0,0,0,0,1,3,0,0,0,0,1,3,0,0,0,0,0,0,3,0,0,0,0,1,2,0,0,3,0,0,5,2,0,3,0,4,3,2,3,0,3,0,0,0,0,3,0,3,0,0,3,0,1,2,0,0,0,3,0,0,3,2,0,3,0,3,3,0,0,0,0,0,3,2,0,0,0,0,3,2,5,0,0,0,3,3,0,0,0,0,5,5,3,4,4,3,3,3,3,4,4,4,3,3,3,3,4,4,5,3,5,5,5,5,3,5,5,3,3,4,3,3,4,3,5,5,3,5,3,5,3,3,3,3,5,3,3,4,4,3,5,3,5,5,5,3,5,4,4,5,3,5,3,4,3,4,5,3,3,5,4,4,5,3,4,3,4,5,5,3,4,5,3,4,3,3,4,5,3,3,4,5,5,4,5,3,4,3,5,5,5,5,3,4,3,3,3,4,5,5,3,3,5,5,5,4] +def da_16 : List Word := [K,K,K,K,K,Q,Q,Q,K,K,K,K,Q,K,K,Q,Q,Q,Q,K,K,K,Q,Q,K,Q,K,K,Q,K,K,Q,Q,K,Q,Q,K,K,K,Q,Q,K,K,K,K,K,Q,Q,K,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,Q,Q,K,Q,Q,K,K,K,Q,K,Q,K,K,Q,Q,Q,K,Q,K,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,K,K,Q,Q,Q,K,K,Q,K,K,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,Q,Q,Q,K,Q,Q,K,K,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def n_16 : Nat := 1 +def u_17 : List Word := [V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,V,K,V,V,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,K,V,V,V,K,V,V,K,K,V,V,K,V,V,V,K,V,V,V,V,K,V,K,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,Q,V,V,V,V,V,V,V,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,Q,V,K,V,V,V,V,V,V,V,K,V,Q,V,V,V,V,K,V,Q,V,V,V,V,K,V,Q,V,V,V,V,V,V,K,V,V,V,V,K,V,Q,V,V,V,K,V,V,V,Q,V,V,K,V,V,K,Q,V,Q,V,K,V,V,V,V,K,V,K,V,V,K,V,K,V,Q,V,V,V,V,K,V,V,K,Q,V,V,K,V,K,Q,V,V,V,V,V,K,Q,V,V,V,V,V,K,Q,V,V,V,V,V,K,Q,V,V,V,V,V,V,Q,V,V,K,Q,K,K,V,V,V,K,Q,K,K,V,V,V,Q,V,V,V,V,Q,V,V,Q,K,V,K,K,V,K,V,V,Q,V,Q,V,Q,K,K,K,V,Q,K,V,V,K,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,K,V,V,Q,Q,V,V,V,V,Q,V,K,V,V,V,Q,V,V,Q,V,K,K,V,V,Q,Q,V,V,V,V,V,Q,V,K,V,V,V,V,Q,V,K,Q,Q,V,V,V,Q,K,V,V,V,V,K,K,K,K,K,Q,Q,Q,K,K,K,K,Q,K,K,Q,Q,Q,Q,K,K,K,Q,Q,K,Q,K,K,Q,K,K,Q,Q,K,Q,Q,K,K,K,Q,Q,K,K,K,K,K,Q,Q,K,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,Q,Q,K,Q,Q,K,K,K,Q,K,Q,K,K,Q,Q,Q,K,Q,K,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,K,K,Q,Q,Q,K,K,Q,K,K,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,Q,Q,Q,K,Q,Q,K,K,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] + +def head_w : List Word := [V,V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,V] +def tags_head : List Nat := [0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0] +def v_head : List Word := [V,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,V,V,V,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,V,V,V,V] +def a_head : Nat := 140737488355327 +def b_head : Nat := 559618400251794 +def A_top : Nat := 8744037503934 + +def s_base : List Word := [V,V,V,V,V,Q,V,K,V,V,V,V,Q,V,K,Q,Q,V,V,V,Q,K,V,V,V,V] +def s_full : List Word := s_base ++ [K,K,K,K,K,Q,Q,Q,K] +def tags_s : List Nat := [0,0,0,0,0,3,2,0,0,0,0,3,2,5,0,0,0,3,3,0,0,0,0,5,5,3,4,4] +def v_s : List Word := [V,V,V,V,V,K,Q,V,V,V,V,V,K,Q,V,V,V,V,V,K,Q,V,V,V,V,V,V,Q,V,V] + +def top_base : List Word := [K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,K,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q] +def top_full : List Word := top_base ++ [K] +def tags_top : List Nat := [4,5,5,4,5,3,4,3,5,5,5,5,3,4,3,3,3,4,5,5,3,3,5,5,5,4] + +def p_init : List Word := [V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,V,K,V,V,V,V,K,V,V,V,V,V,V,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,V,K,K,V,V,V,K,V,V,K,K,V,V,K,V,V,V,K,V,V,V,V,K,V,K,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,K,V,V,K,V,V,V,V,V,K,V,Q,V,V,V,V,V,V,V,V,V,K,V,V,V,V,V,V,V,K,V,V,K,V,V,K,V,Q,V,K,V,V,V,V,V,V,V,K,V,Q,V,V,V,V,K,V,Q,V,V,V,V,K,V,Q,V,V,V,V,V,V,K,V,V,V,V,K,V,Q,V,V,V,K,V,V,V,Q,V,V,K,V,V,K,Q,V,Q,V,K,V,V,V,V,K,V,K,V,V,K,V,K,V,Q,V,V,V,V,K,V,V,K,Q,V,V,K,V,K,Q,V,V,V,V,V,K,Q,V,V,V,V,V,K,Q,V,V,V,V,V,K,Q,V,V,V,V,V,V,Q,V,V,K,Q,K,K,V,V,V,K,Q,K,K,V,V,V,Q,V,V,V,V,Q,V,V,Q,K,V,K,K,V,K,V,V,Q,V,Q,V,Q,K,K,K,V,Q,K,V,V,K,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,K,V,V,Q,Q,V,V,V,V,Q,V,K,V,V,V,Q,V,V,Q,V,K,K,V,V,Q,Q] +def ds_core_init : List Word := [K,K,Q,K,K,Q,Q,Q,Q,K,K,K,Q,Q,K,Q,K,K,Q,K,K,Q,Q,K,Q,Q,K,K,K,Q,Q,K,K,K,K,K,Q,Q,K,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,Q,Q,K,Q,Q,K,K,K,Q,K,Q,K,K,Q,Q,Q,K,Q,K,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,K,K,Q,Q,Q,K,K,Q,K,K,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,K,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,K,Q,Q,Q,Q,K,Q,Q,K,K] +def A_core_init : Nat := 2539960954206412836472306455261201041925226148324 + +def zInitCCfg : CCfg := ⟨0, 0, [], []⟩ +def zHitCCfg : CCfg := ⟨3, 0, [], [0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,1,0,1]⟩ + +set_option maxRecDepth 200000 in +theorem zCm_init : zCm zInitCCfg 230 = some zHitCCfg := by decide + +theorem init_to_u0 : (init []) [tm]⊢* zCf (evalWords u_0 default) := by + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = evalCCfgVKQ zInitCCfg := rfl + have h1 : evalCCfgVKQ zHitCCfg = zCf (evalWords u_0 default) := by + dsimp [evalCCfgVKQ, zHitCCfg, zCf, pref_cap, u_0, evalWords, V_u, K_u, Q_u] + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq, default_head_vkq, default_tail_vkq] + have hPlus := zTc (by decide : 0 < 230) zCm_init + rw [<- h0, h1] at hPlus + exact stepStar_of_stepPlus_vkq hPlus + +set_option maxRecDepth 200000 in +theorem step_0 : Step u_0 u_1 := checkStep_sound n_0 tags_0 u_0 da_0 u_1 (by decide) +set_option maxRecDepth 200000 in +theorem step_1 : Step u_1 u_2 := checkStep_sound n_1 tags_1 u_1 da_1 u_2 (by decide) +set_option maxRecDepth 200000 in +theorem step_2 : Step u_2 u_3 := checkStep_sound n_2 tags_2 u_2 da_2 u_3 (by decide) +set_option maxRecDepth 200000 in +theorem step_3 : Step u_3 u_4 := checkStep_sound n_3 tags_3 u_3 da_3 u_4 (by decide) +set_option maxRecDepth 200000 in +theorem step_4 : Step u_4 u_5 := checkStep_sound n_4 tags_4 u_4 da_4 u_5 (by decide) +set_option maxRecDepth 200000 in +theorem step_5 : Step u_5 u_6 := checkStep_sound n_5 tags_5 u_5 da_5 u_6 (by decide) +set_option maxRecDepth 200000 in +theorem step_6 : Step u_6 u_7 := checkStep_sound n_6 tags_6 u_6 da_6 u_7 (by decide) +set_option maxRecDepth 200000 in +theorem step_7 : Step u_7 u_8 := checkStep_sound n_7 tags_7 u_7 da_7 u_8 (by decide) +set_option maxRecDepth 200000 in +theorem step_8 : Step u_8 u_9 := checkStep_sound n_8 tags_8 u_8 da_8 u_9 (by decide) +set_option maxRecDepth 200000 in +theorem step_9 : Step u_9 u_10 := checkStep_sound n_9 tags_9 u_9 da_9 u_10 (by decide) +set_option maxRecDepth 200000 in +theorem step_10 : Step u_10 u_11 := checkStep_sound n_10 tags_10 u_10 da_10 u_11 (by decide) +set_option maxRecDepth 200000 in +theorem step_11 : Step u_11 u_12 := checkStep_sound n_11 tags_11 u_11 da_11 u_12 (by decide) +set_option maxRecDepth 200000 in +theorem step_12 : Step u_12 u_13 := checkStep_sound n_12 tags_12 u_12 da_12 u_13 (by decide) +set_option maxRecDepth 200000 in +theorem step_13 : Step u_13 u_14 := checkStep_sound n_13 tags_13 u_13 da_13 u_14 (by decide) +set_option maxRecDepth 200000 in +theorem step_14 : Step u_14 u_15 := checkStep_sound n_14 tags_14 u_14 da_14 u_15 (by decide) +set_option maxRecDepth 200000 in +theorem step_15 : Step u_15 u_16 := checkStep_sound n_15 tags_15 u_15 da_15 u_16 (by decide) +set_option maxRecDepth 200000 in +theorem step_16 : Step u_16 u_17 := checkStep_sound n_16 tags_16 u_16 da_16 u_17 (by decide) + +theorem rounds_0_17 : Rounds u_0 u_17 := + Rounds.next step_0 (Rounds.next step_1 (Rounds.next step_2 (Rounds.next step_3 (Rounds.next step_4 (Rounds.next step_5 (Rounds.next step_6 (Rounds.next step_7 (Rounds.next step_8 (Rounds.next step_9 (Rounds.next step_10 (Rounds.next step_11 (Rounds.next step_12 (Rounds.next step_13 (Rounds.next step_14 (Rounds.next step_15 (Rounds.next step_16 (Rounds.refl u_17))))))))))))))))) + +abbrev Good (u : List Word) : Prop := + ∃ p_w ds_core A_core m, + u = head_w ++ p_w ++ s_base ++ [K,K,K,K,K,Q,Q,Q,K,K] ++ ds_core ++ top_base ∧ + (∃ p_tail, p_w = V :: p_tail) ∧ + m = 1 + ds_core.length ∧ + 17 <= m ∧ + DigitVal A_core (m - 1) ds_core ∧ + A_core * 64 <= 17 * 2 ^ (m - 1) ∧ + wordScale p_w * ((2 ^ m : Nat) : Rat) = 64 ∧ + wordPot p_w <= 13 / 4 + +set_option maxRecDepth 200000 in +theorem good_u17 : Good u_17 := by + refine ⟨p_init, ds_core_init, A_core_init, 164, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · decide + · exact ⟨p_init.tail, rfl⟩ + · decide + · decide + · exact checkDg_sound A_core_init ds_core_init (by decide) + · decide + · have h := checkScalePow_sound p_init 164 6 (by decide) + norm_num at h + exact h + · have h := checkWordPotLe_sound p_init 13 4 (by decide) + norm_num at h + linarith + +set_option maxRecDepth 200000 in +theorem Scan_head : Scan 0 6 head_w a_head b_head v_head 0 := by + have h := checkAffineScan_sound tags_head 0 0 0 6 head_w 0 a_head 0 b_head v_head 0 0 0 (by decide) + simpa using h + +theorem v_head_eq : V :: v_head = head_w ++ [V] := rfl + +theorem Scan_s (ap bp : Nat) (hbp : 3 <= bp) : + Scan ap bp s_full (2 * ap + 2) (65536 * (bp - 3) + 51714) v_s 5 := by + have h := checkAffineScan_sound tags_s 1 0 1 3 s_full 2 2 65536 51714 v_s 5 ap (bp - 3) (by decide) + have h_bp : 1 * (bp - 3) + 3 = bp := by omega + have h_ap : 1 * ap + 0 = ap := by omega + rwa [h_ap, h_bp] at h + +theorem Scan_top (b_top : Nat) (hb : 2 <= b_top) : + Scan (2 ^ 42) b_top top_full 0 (1024 * (b_top - 2) + 224) s_base 18 := by + have h := checkAffineScan_sound tags_top 0 (2 ^ 42) 1 2 top_full 0 0 1024 224 s_base 18 0 (b_top - 2) (by decide) + have h_in : 1 * (b_top - 2) + 2 = b_top := by omega + dsimp at h + rwa [h_in] at h + +theorem Parse_s_split {ap a_end g_all : Nat} {rest : List Word} + (h : Parse ap (s_full ++ K :: rest) a_end g_all) : + ∃ g_mid, Parse (2 * (ap + 1)) (K :: rest) a_end g_mid := by + change Parse ap ([V,V,V,V,V,Q,V,K,V,V,V,V,Q,V,K,Q,Q,V,V,V,Q,K,V,V,V,V,K,K,K,K,K,Q,Q,Q,K,K] ++ rest) a_end g_all at h + simp only [List.cons_append, List.nil_append] at h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + cases h with + | @D _ q1_1 _ _ _ _ _ hq1_1 h => + have hq1_1_eq : q1_1 = 16 + ap * 16 := by dsimp [dVal] at hq1_1; omega + subst hq1_1_eq + rcases Parse_VK_inv h with h | h + · -- VK at i=6 + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + cases h with + | @D _ q1_2 _ _ _ _ _ hq1_2 h => + have hq1_2_eq : q1_2 = 136 + ap * 128 := by dsimp [dVal] at hq1_2; omega + subst hq1_2_eq + rcases Parse_VK_inv h with h | h + · -- VK at i=13 + cases h with + | D _ hq1_3 _ => dsimp [dVal] at hq1_3; omega + | @P _ q2_3 _ _ _ _ _ _ _ hq2_3 h => + have hq2_3_eq : q2_3 = 34 + ap * 32 := by dsimp [dVal] at hq2_3; omega + subst hq2_3_eq + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + cases h with + | @D _ q1_4 _ _ _ _ _ hq1_4 h => + have hq1_4_eq : q1_4 = 140 + ap * 128 := by dsimp [dVal] at hq1_4; omega + subst hq1_4_eq + cases h with + | @D _ q1_5 _ _ _ _ _ hq1_5 h => + have hq1_5_eq : q1_5 = 70 + ap * 64 := by dsimp [dVal] at hq1_5; omega + subst hq1_5_eq + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + rcases Parse_VK_inv h with h | h + · -- VK at i=25 + cases h with + | D _ hq1_6 _ => dsimp [dVal] at hq1_6; omega + | @P _ q2_6 _ _ _ _ _ _ _ hq2_6 h => + have hq2_6_eq : q2_6 = 141 + ap * 128 := by dsimp [dVal] at hq2_6; omega + subst hq2_6_eq + cases h with + | D _ hq1_7 _ => dsimp [dVal] at hq1_7; omega + | P _ _ hq2_7 _ => dsimp [dVal] at hq2_7; omega + · -- T at i=25 + cases h with + | D _ hq1_8 _ => dsimp [dVal] at hq1_8; omega + | @P _ q2_8 _ _ _ _ _ _ _ hq2_8 h => + have hq2_8_eq : q2_8 = 283 + ap * 256 := by dsimp [dVal] at hq2_8; omega + subst hq2_8_eq + cases h with + | D _ hq1_9 _ => dsimp [dVal] at hq1_9; omega + | @P _ q2_9 _ _ _ _ _ _ _ hq2_9 h => + have hq2_9_eq : q2_9 = 70 + ap * 64 := by dsimp [dVal] at hq2_9; omega + subst hq2_9_eq + cases h with + | @D _ q1_10 _ _ _ _ _ hq1_10 h => + have hq1_10_eq : q1_10 = 35 + ap * 32 := by dsimp [dVal] at hq1_10; omega + subst hq1_10_eq + cases h with + | @D _ q1_11 _ _ _ _ _ hq1_11 h => + have hq1_11_eq : q1_11 = 18 + ap * 16 := by dsimp [dVal] at hq1_11; omega + subst hq1_11_eq + cases h with + | D _ hq1_12 _ => dsimp [dVal] at hq1_12; omega + | P _ _ hq2_12 _ => dsimp [dVal] at hq2_12; omega + | @P _ q2_11 _ _ _ _ _ _ _ hq2_11 h => + have hq2_11_eq : q2_11 = 9 + ap * 8 := by dsimp [dVal] at hq2_11; omega + subst hq2_11_eq + cases h with + | @D _ q1_13 _ _ _ _ _ hq1_13 h => + have hq1_13_eq : q1_13 = 5 + ap * 4 := by dsimp [dVal] at hq1_13; omega + subst hq1_13_eq + cases h with + | D _ hq1_14 _ => dsimp [dVal] at hq1_14; omega + | P _ _ hq2_14 _ => dsimp [dVal] at hq2_14; omega + | @P _ q2_13 _ _ _ _ _ _ _ hq2_13 h => + have hq2_13_eq : q2_13 = 2 + ap * 2 := by dsimp [dVal] at hq2_13; omega + subst hq2_13_eq + have h_end : 2 + ap * 2 = 2 * (ap + 1) := by omega + rw [h_end] at h + exact ⟨_, h⟩ + | P _ _ hq2_10 _ => dsimp [dVal] at hq2_10; omega + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + | P _ _ hq2_4 _ => dsimp [dVal] at hq2_4; omega + · -- T at i=13 + cases h with + | D _ hq1_15 _ => dsimp [dVal] at hq1_15; omega + | @P _ q2_15 _ _ _ _ _ _ _ hq2_15 h => + have hq2_15_eq : q2_15 = 68 + ap * 64 := by dsimp [dVal] at hq2_15; omega + subst hq2_15_eq + cases h with + | D _ hq1_16 _ => dsimp [dVal] at hq1_16; omega + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + · -- T at i=6 + cases h with + | D _ hq1_17 _ => dsimp [dVal] at hq1_17; omega + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + +-- Section 6: Main Invariant Closure and Goal Proof +theorem zDg_top : DigitVal A_top 43 top_base := + checkDg_sound A_top top_base (by decide) + +theorem zDg_bot : DigitVal 224 10 [K,K,K,K,K,Q,Q,Q,K,K] := + checkDg_sound 224 [K,K,K,K,K,Q,Q,Q,K,K] (by decide) + +theorem digitVal_mid {A_core m : Nat} {ds_core : List Word} + (hm : 17 <= m) (hD : DigitVal A_core (m - 1) ds_core) + (hA_core : A_core * 64 <= 17 * 2 ^ (m - 1)) : + ∃ A_mid, + DigitVal A_mid m ([K] ++ ds_core) ∧ + A_mid <= 0 + 17 * 2 ^ (m - 6) := by + have h_bs : DigitVal 0 1 [K] := checkDg_sound 0 [K] (by decide) + have h1 := digitVal_append h_bs hD + have hlen1 : 1 + (m - 1) = m := by omega + rw [hlen1] at h1 + have h_pow1 : 2 ^ (m - 1) = 32 * 2 ^ (m - 6) := by + have heq : m - 1 = 5 + (m - 6) := by omega + rw [heq, Nat.pow_add] + exact ⟨0 + A_core * 2, h1, by omega⟩ + +theorem force_a_top {p_w ds_mid : List Word} {ap gp m A_mid a_top g_mid : Nat} + (hm : 17 <= m) + (hP_p : Parse a_head p_w ap gp) + (hz13 : wordScale p_w * ((2 ^ m : Nat) : Rat) = 64) + (hzW : wordPot p_w <= 13 / 4) + (hD_mid : DigitVal A_mid m ds_mid) + (hA_hi : A_mid <= 0 + 17 * 2 ^ (m - 6)) + (hP_mid : Parse (2 * (ap + 1)) ds_mid a_top g_mid) : + a_top = 2 ^ 42 := by + rcases Parse_la hP_p with ⟨hla_lo, hla_hi⟩ + have hz12 := wordValQ_nonneg p_w + have hz10_le := two_wordVal_add_wordValQ_le p_w + have h_diff_hi : ((ap : Rat) + 1) * wordScale p_w - ((a_head : Rat) + 1) < 7 := by linarith + have h_powm_pos : (0 : Rat) < ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + have h_mul_lo : ((a_head : Rat) + 1) * ((2 ^ m : Nat) : Rat) <= ((ap : Rat) + 1) * (wordScale p_w * ((2 ^ m : Nat) : Rat)) := by + nlinarith + have h_mul_hi : ((ap : Rat) + 1) * (wordScale p_w * ((2 ^ m : Nat) : Rat)) < (((a_head : Rat) + 1) + 7) * ((2 ^ m : Nat) : Rat) := by + nlinarith + rw [hz13] at h_mul_lo h_mul_hi + have ha_val : a_head + 1 = 2 ^ 47 := by decide + have ha_r : (a_head : Rat) + 1 = ((2 ^ 47 : Nat) : Rat) := by exact_mod_cast ha_val + rw [ha_r] at h_mul_lo h_mul_hi + have h_nat_lo : 2 ^ 47 * 2 ^ m <= (ap + 1) * 64 := by exact_mod_cast h_mul_lo + have h_nat_hi : (ap + 1) * 64 < (2 ^ 47 + 7) * 2 ^ m := by exact_mod_cast h_mul_hi + have h_ep : (ap + 1) * 64 = (2 * (ap + 1)) * 32 := by ring + rw [h_ep] at h_nat_lo h_nat_hi + have h_split1 : 2 ^ 47 * 2 ^ m = (2 ^ 42 * 2 ^ m) * 32 := by + have : (2 ^ 47 : Nat) = 2 ^ 42 * 32 := by decide + rw [this]; ring + have h_split2 : (2 ^ 47 + 7) * 2 ^ m = (2 ^ 42 * 2 ^ m + 7 * 2 ^ (m - 5)) * 32 := by + have h_eh : (2 ^ 47 : Nat) = 2 ^ 42 * 32 := by decide + have hm_de : 2 ^ m = 2 ^ (m - 5) * 32 := by + have h_de : (32 : Nat) = 2 ^ 5 := rfl + rw [h_de, <- Nat.pow_add, Nat.sub_add_cancel (by omega : 5 <= m)] + calc (2 ^ 47 + 7) * 2 ^ m + _ = 2 ^ 47 * 2 ^ m + 7 * 2 ^ m := by ring + _ = (2 ^ 42 * 32) * 2 ^ m + 7 * (2 ^ (m - 5) * 32) := by rw [h_eh, hm_de] + _ = (2 ^ 42 * 2 ^ m + 7 * 2 ^ (m - 5)) * 32 := by ring + rw [h_split1] at h_nat_lo + rw [h_split2] at h_nat_hi + have h_pos_de : 0 < 32 := by decide + have hap_lo : 2 ^ 42 * 2 ^ m <= 2 * (ap + 1) := Nat.le_of_mul_le_mul_right h_nat_lo h_pos_de + have hap_hi : 2 * (ap + 1) < 2 ^ 42 * 2 ^ m + 7 * 2 ^ (m - 5) := Nat.lt_of_mul_lt_mul_right h_nat_hi + have h_pow_mde : 2 ^ (m - 5) = 2 * 2 ^ (m - 6) := by + have heq : m - 5 = 1 + (m - 6) := by omega + rw [heq, Nat.pow_add] + have h_pow_m : 2 ^ m = 64 * 2 ^ (m - 6) := by + have h_dg : (64 : Nat) = 2 ^ 6 := rfl + rw [h_dg, <- Nat.pow_add, Nat.add_sub_of_le (by omega : 6 <= m)] + have h_pow_mdg_ge : 2048 <= 2 ^ (m - 6) := by + have h_le_m : 11 <= m - 6 := by omega + have hle := Nat.pow_le_pow_right (by decide : 1 <= 2) h_le_m + simpa using hle + rcases parse_digitVal_a hP_mid hD_mid with ⟨h_atop_lo, h_atop_hi⟩ + have h_sum_lo : 2 ^ 42 * 2 ^ m <= 2 * (ap + 1) + A_mid := by omega + have h_sum_hi : 2 * (ap + 1) + A_mid < (2 ^ 42 + 1) * 2 ^ m := by + have : (2 ^ 42 + 1) * 2 ^ m = 2 ^ 42 * 2 ^ m + 64 * 2 ^ (m - 6) := by + rw [Nat.add_mul, Nat.one_mul, h_pow_m] + omega + have h_pos_m : 0 < 2 ^ m := pow_two_pos m + have h_lt1 : a_top < 2 ^ 42 + 1 := Nat.lt_of_mul_lt_mul_right (lt_of_le_of_lt h_atop_lo h_sum_hi) + have h_lt2 : 2 ^ 42 < a_top + 1 := Nat.lt_of_mul_lt_mul_right (lt_of_le_of_lt h_sum_lo h_atop_hi) + omega + +theorem bound_b_mid0 {p_w v_p ds_mid : List Word} + {ap bp gp m A_mid b_mid0 : Nat} + (hm : 17 <= m) + (hS_p : Scan a_head b_head p_w ap bp v_p gp) + (hbp : 3 <= bp) + (hz13 : wordScale p_w * ((2 ^ m : Nat) : Rat) = 64) + (hzW : wordPot p_w <= 13 / 4) + (hb_mid0 : b_mid0 = 65536 * (bp - 3) + 51714) + (hD_mid : DigitVal A_mid m ds_mid) : + 2 + 4 * wordVal ds_mid < (b_mid0 : Rat) := by + have h_delta_p := (Scan_delta hS_p).2 + have h_4wv_p := two_wordVal_add_wordValQ_le_four_wordPotV v_p + have h_cw_p := scan_wordPot_contract7 hS_p + have hc_bh := (cPar77_bounds b_head).2 + have h_wv_p_lt : wordPotV v_p < 4 := by linarith + have h_z13_p := scan_wordScale_eq hS_p + have h_pow_gp_ge1 : (1 : Rat) <= ((2 ^ (3 * gp) : Nat) : Rat) := by exact_mod_cast (pow_two_pos (3 * gp)) + have h_z13_vp_pos := wordScale_pos v_p + have h_z13_vp_le : wordScale v_p <= wordScale p_w := by nlinarith + have h_bh_big : ((2 ^ 48 : Nat) : Rat) + 18 < (b_head : Rat) := by norm_num [b_head] + have h_bp2_pos : (0 : Rat) <= (bp : Rat) - 2 := by + have : (2 : Rat) <= (bp : Rat) := by exact_mod_cast (by omega : 2 <= bp) + linarith + have h_prod_p : ((2 ^ 48 : Nat) : Rat) < ((bp : Rat) - 2) * wordScale p_w := by nlinarith + have h_powm_pos : (0 : Rat) < ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + have h_mul_m : ((2 ^ 48 : Nat) : Rat) * ((2 ^ m : Nat) : Rat) < ((bp : Rat) - 2) * (wordScale p_w * ((2 ^ m : Nat) : Rat)) := by + nlinarith + rw [hz13] at h_mul_m + have h_pow_ebh : ((2 ^ 48 : Nat) : Rat) = ((2 ^ 42 : Nat) : Rat) * 64 := by norm_num + rw [h_pow_ebh] at h_mul_m + have h_bp2_gt : ((2 ^ 42 : Nat) : Rat) * ((2 ^ m : Nat) : Rat) < (bp : Rat) - 2 := by linarith + have h_bmid0_r : (b_mid0 : Rat) = 65536 * ((bp : Rat) - 3) + 51714 := by + rw [hb_mid0, Nat.cast_add, Nat.cast_mul, Nat.cast_sub hbp]; push_cast; ring + have h_z10_mid := (digitVal_scale_and_val hD_mid).2 + have h_pow_val : ((2 ^ 42 : Nat) : Rat) = 4398046511104 := by norm_num + have h_powm_ge1 : (1 : Rat) <= ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + rw [h_z10_mid, h_bmid0_r] + rw [h_pow_val] at h_bp2_gt + linarith + +theorem bound_zW_p' {p_w v_p ds_mid v_mid : List Word} + {ap bp gp m A_mid b_mid0 b_top g_mid : Nat} + (hm : 17 <= m) + (hS_p : Scan a_head b_head p_w ap bp v_p gp) + (hz13 : wordScale p_w * ((2 ^ m : Nat) : Rat) = 64) + (hzW : wordPot p_w <= 13 / 4) + (hD_mid : DigitVal A_mid m ds_mid) + (hS_mid : Scan (2 * (ap + 1)) b_mid0 ds_mid (2 ^ 42) b_top v_mid g_mid) : + wordPotV (v_p ++ v_s ++ v_mid) <= 13 / 4 := by + have h_cw_p := scan_wordPot_contract7 hS_p + have hc_bh : cPar7 b_head = 2 / 7 := by + unfold cPar7 + have hmod : b_head % 2 = 0 := by decide + rw [hmod]; rfl + rw [hc_bh] at h_cw_p + have hA : wordPotV v_p <= 43 / 14 := by linarith + have h_z13_p := scan_wordScale_eq hS_p + have h_z13_vs : wordScale v_s = 1 / 65536 := by + have h := checkScalePow_sound v_s 16 0 (by decide) + norm_num at h + linarith + have h_wv_vs : wordPotV v_s <= 9 / 8 := by + have h := checkWordPotVLe_sound v_s 9 8 (by decide) + norm_num at h + linarith + have h_powm_ge : (2 ^ 17 : Nat) <= 2 ^ m := Nat.pow_le_pow_right (by decide) hm + have h_powm_r : ((2 ^ 17 : Nat) : Rat) <= ((2 ^ m : Nat) : Rat) := by exact_mod_cast h_powm_ge + have h_z13_p_le : wordScale p_w <= 1 / 2048 := by + have h_pos_p := wordScale_pos p_w + have h_mul := mul_le_mul_of_nonneg_left h_powm_r (le_of_lt h_pos_p) + rw [hz13] at h_mul + norm_num at h_mul + linarith + have h_pow_gp_ge1 : (1 : Rat) <= ((2 ^ (3 * gp) : Nat) : Rat) := by exact_mod_cast (pow_two_pos (3 * gp)) + have h_z13_vp_pos := wordScale_pos v_p + have h_z13_vp_le : wordScale v_p <= 1 / 2048 := by nlinarith + have hB : wordScale v_p * wordPotV v_s <= 9 / 16384 := by + have h_wv_nn := wordPotV_nonneg v_s + nlinarith + have h_dc_eq := digitVal_scan_dCount hS_mid hD_mid + have h_wv_mid_dc := dCount_bound_WV v_mid + have h_vp_m : wordScale v_p * ((2 ^ m : Nat) : Rat) <= 64 := by + have h_eq : wordScale v_p * ((2 ^ m : Nat) : Rat) * ((2 ^ (3 * gp) : Nat) : Rat) = 64 := by + calc wordScale v_p * ((2 ^ m : Nat) : Rat) * ((2 ^ (3 * gp) : Nat) : Rat) + _ = (wordScale v_p * ((2 ^ (3 * gp) : Nat) : Rat)) * ((2 ^ m : Nat) : Rat) := by ring + _ = wordScale p_w * ((2 ^ m : Nat) : Rat) := by rw [h_z13_p] + _ = 64 := hz13 + have h_pos_m : (0 : Rat) < ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + have h_nn : 0 <= wordScale v_p * ((2 ^ m : Nat) : Rat) := mul_nonneg (le_of_lt h_z13_vp_pos) (le_of_lt h_pos_m) + nlinarith + have h_prod_ps : wordScale v_p * wordScale v_s * ((2 ^ m : Nat) : Rat) <= 1 / 1024 := by + rw [h_z13_vs] + linarith + have hC : wordScale (v_p ++ v_s) * wordPotV v_mid <= 7 / 8192 := by + rw [wordScale_append] + have h_wv_mid_le : wordPotV v_mid <= (7 / 8) * ((2 ^ m : Nat) : Rat) := by + have h_dc_le_m : 2 ^ (dCount v_mid) <= 2 ^ m := Nat.pow_le_pow_right (by decide) (by omega) + have h_dc_r : ((2 ^ (dCount v_mid) : Nat) : Rat) <= ((2 ^ m : Nat) : Rat) := by exact_mod_cast h_dc_le_m + have hm_256 : (256 : Rat) <= ((2 ^ m : Nat) : Rat) := by + have : (131072 : Rat) <= ((2 ^ 17 : Nat) : Rat) := by norm_num + linarith + linarith + have h_wv_mid_nn := wordPotV_nonneg v_mid + have h_z13_ps_pos : 0 < wordScale v_p * wordScale v_s := mul_pos h_z13_vp_pos (wordScale_pos v_s) + nlinarith + have h_app1 := wordPotV_append_le v_p v_s + have h_app2 := wordPotV_append_le (v_p ++ v_s) v_mid + linarith + +theorem bound_b_end_digitVal {w_all v_w : List Word} {b_top g_w k : Nat} + (hk : 10 <= k) + (hb_top : 2 <= b_top) + (hS_w : Scan a_head b_head w_all (2 ^ 42) b_top v_w g_w) + (hz13_vw : wordScale v_w * ((2 ^ k : Nat) : Rat) = 1) + (hWV_vw : wordPotV v_w <= 13 / 4) : + ∃ A_core' ds_core', + DigitVal A_core' (k + 6) ds_core' ∧ + ds_core'.length = k + 6 ∧ + A_core' * 64 <= 17 * 2 ^ (k + 6) ∧ + DigitVal (1024 * (b_top - 2) + 224) (k + 59) + ([K,K,K,K,K,Q,Q,Q,K,K] ++ ds_core' ++ top_base) := by + rcases Scan_delta hS_w with ⟨hd_lo, hd_hi⟩ + have h_4wv := two_wordVal_add_wordValQ_le_four_wordPotV v_w + have hd_hi' : ((b_head : Rat) - 2) - ((b_top : Rat) - 2) * wordScale v_w <= 13 := by linarith + have h_powk_pos : (0 : Rat) < ((2 ^ k : Nat) : Rat) := by exact_mod_cast (pow_two_pos k) + have h_mul_lo : (((b_head : Rat) - 2) - 13) * ((2 ^ k : Nat) : Rat) <= ((b_top : Rat) - 2) * (wordScale v_w * ((2 ^ k : Nat) : Rat)) := by + nlinarith + have h_mul_hi : ((b_top : Rat) - 2) * (wordScale v_w * ((2 ^ k : Nat) : Rat)) <= ((b_head : Rat) - 1) * ((2 ^ k : Nat) : Rat) := by + nlinarith + rw [hz13_vw, mul_one] at h_mul_lo h_mul_hi + have hbh_r : (b_head : Rat) - 2 = (A_top : Rat) * 64 + 16 := by norm_num [b_head, A_top] + have hbh_1_r : (b_head : Rat) - 1 = (A_top : Rat) * 64 + 17 := by norm_num [b_head, A_top] + rw [hbh_r] at h_mul_lo + rw [hbh_1_r] at h_mul_hi + let b_end := 1024 * (b_top - 2) + 224 + have hb_end_r : (b_end : Rat) = 1024 * ((b_top : Rat) - 2) + 224 := by + dsimp [b_end] + rw [Nat.cast_add, Nat.cast_mul, Nat.cast_sub hb_top] + push_cast; ring + have h_pow_ksh : ((2 ^ (k + 16) : Nat) : Rat) = 65536 * ((2 ^ k : Nat) : Rat) := by + have h_sh : ((2 ^ 16 : Nat) : Rat) = 65536 := by norm_num + rw [Nat.pow_add, Nat.cast_mul, h_sh]; ring + have h_powk_ge1 : (1 : Rat) <= ((2 ^ k : Nat) : Rat) := by exact_mod_cast (pow_two_pos k) + have h_bend_lo_r : (A_top : Rat) * ((2 ^ (k + 16) : Nat) : Rat) < (b_end : Rat) := by + rw [hb_end_r, h_pow_ksh]; linarith + have h_bend_mid_r : (b_end : Rat) <= (A_top : Rat) * ((2 ^ (k + 16) : Nat) : Rat) + 1024 * 17 * ((2 ^ k : Nat) : Rat) + 224 := by + rw [hb_end_r, h_pow_ksh]; linarith + have h_bend_hi_r : (b_end : Rat) < ((A_top : Rat) + 1) * ((2 ^ (k + 16) : Nat) : Rat) := by + rw [hb_end_r, h_pow_ksh]; linarith + have h_bend_lo : A_top * 2 ^ (k + 16) < b_end := by exact_mod_cast h_bend_lo_r + have h_bend_mid : b_end <= A_top * 2 ^ (k + 16) + 1024 * 17 * 2 ^ k + 224 := by exact_mod_cast h_bend_mid_r + have h_bend_hi : b_end < (A_top + 1) * 2 ^ (k + 16) := by exact_mod_cast h_bend_hi_r + let A_core' := (b_end / 1024) % (2 ^ (k + 6)) + have h_Acore'_lt : A_core' < 2 ^ (k + 6) := Nat.mod_lt _ (pow_two_pos (k + 6)) + rcases exists_digitVal_of_lt_pow (k + 6) A_core' h_Acore'_lt with ⟨ds_core', hD_core'⟩ + have h_len_core' := length_of_digitVal hD_core' + have h_bot_mid := digitVal_append zDg_bot hD_core' + have h_all := digitVal_append h_bot_mid zDg_top + have h_len_all : (10 + (k + 6)) + 43 = k + 59 := by omega + have h_pow_ksh_eq : 2 ^ (k + 16) = 1024 * 2 ^ (k + 6) := by + have : k + 16 = 10 + (k + 6) := by omega + rw [this, Nat.pow_add] + have h_div_top : b_end / (2 ^ (k + 16)) = A_top := by + have h_pos_ksh : 0 < 2 ^ (k + 16) := pow_two_pos (k + 16) + have h1 := (Nat.le_div_iff_mul_le h_pos_ksh).mpr (le_of_lt h_bend_lo) + have h2 := (Nat.div_lt_iff_lt_mul h_pos_ksh).mpr h_bend_hi + omega + have h_val_all : 224 + A_core' * 2 ^ 10 + A_top * 2 ^ (10 + (k + 6)) = b_end := by + have h1 : 2 ^ 10 = 1024 := by decide + have h2 : 2 ^ (10 + (k + 6)) = 1024 * 2 ^ (k + 6) := by rw [Nat.pow_add] + rw [h1, h2] + have h_assoc : A_top * (1024 * 2 ^ (k + 6)) = 1024 * (A_top * 2 ^ (k + 6)) := by ring + rw [h_assoc] + dsimp [A_core'] + have h_div_mb : (b_end / 1024) / (2 ^ (k + 6)) = A_top := by + rw [Nat.div_div_eq_div_mul, <- h_pow_ksh_eq, h_div_top] + have h_mod_div := Nat.div_add_mod (b_end / 1024) (2 ^ (k + 6)) + rw [h_div_mb, Nat.mul_comm (2 ^ (k + 6)) A_top] at h_mod_div + have h_mod_mb := Nat.div_add_mod b_end 1024 + omega + have h_Acore'_le_k : A_core' <= 17 * 2 ^ k := by + have h_eq_db : 2 ^ 10 = 1024 := by decide + have h_eq_ksh : 2 ^ (10 + (k + 6)) = 2 ^ (k + 16) := by + have : 10 + (k + 6) = k + 16 := by omega + rw [this] + rw [h_eq_db, h_eq_ksh] at h_val_all + omega + have h_Acore'_dg : A_core' * 64 <= 17 * 2 ^ (k + 6) := by + have h_pow_kdg : 2 ^ (k + 6) = 64 * 2 ^ k := by + have : k + 6 = 6 + k := by omega + rw [this, Nat.pow_add] + omega + rw [h_len_all, h_val_all] at h_all + exact ⟨A_core', ds_core', hD_core', h_len_core', h_Acore'_dg, by simpa [List.append_assoc] using h_all⟩ + +theorem Good_step {u : List Word} (hG : Good u) : + ∃ u', Step u u' ∧ Good u' := by + rcases hG with ⟨p_w, ds_core, A_core, m, rfl, ⟨p_tail, hp_start⟩, hm_def, hm, hD_core, hA_core, hz13, hzW⟩ + have hP_p_ex : ∃ ap gp, Parse a_head p_w ap gp := by + rw [hp_start]; exact Parse_V_start a_head p_tail + rcases hP_p_ex with ⟨ap, gp, hP_p⟩ + have hb_head_ok : 2 + 4 * wordVal p_w < (b_head : Rat) := by + have hz12 := wordValQ_nonneg p_w + have hz10_le := two_wordVal_add_wordValQ_le p_w + have hbh_gt : (15 : Rat) < (b_head : Rat) := by norm_num [b_head] + linarith + rcases Scan_of_Parse hP_p b_head hb_head_ok with ⟨bp, v_p, hS_p, hbp⟩ + have hS_s := Scan_s ap bp hbp + let b_mid0 := 65536 * (bp - 3) + 51714 + let ds_mid := [K] ++ ds_core + rcases digitVal_mid hm hD_core hA_core with ⟨A_mid, hD_mid, hA_hi⟩ + have hP_s_all : ∃ a_top g_all, Parse ap (s_full ++ ds_mid) a_top g_all := by + change ∃ a_top g_all, Parse ap (V :: (s_full.tail ++ ds_mid)) a_top g_all + exact Parse_V_start ap _ + rcases hP_s_all with ⟨a_top, g_all, hP_all⟩ + have hP_mid_ex : ∃ g_mid, Parse (2 * (ap + 1)) ds_mid a_top g_mid := by + dsimp [ds_mid] at hP_all ⊢ + exact Parse_s_split hP_all + rcases hP_mid_ex with ⟨g_mid, hP_mid⟩ + have hatop_eq := force_a_top hm hP_p hz13 hzW hD_mid hA_hi hP_mid + subst hatop_eq + have hb_mid0_ok := bound_b_mid0 hm hS_p hbp hz13 hzW rfl hD_mid + rcases Scan_of_Parse hP_mid b_mid0 hb_mid0_ok with ⟨b_top, v_mid, hS_mid, hb_top_ge3⟩ + have hb_top : 2 <= b_top := by omega + have hS_top := Scan_top b_top hb_top + let w_all := p_w ++ s_full ++ ds_mid + let v_w := v_p ++ v_s ++ v_mid + let g_w := gp + 5 + g_mid + have h_ap_eq : 2 * ap + 2 = 2 * (ap + 1) := by omega + rw [h_ap_eq] at hS_s + have hS_w : Scan a_head b_head w_all (2 ^ 42) b_top v_w g_w := by + have h23 := Scan_append hS_p hS_s + have h234 := Scan_append h23 hS_mid + simpa [w_all, v_w, g_w, List.append_assoc, Nat.add_assoc] using h234 + have h_u_rep1 : + (head_w ++ p_w ++ s_base ++ [K,K,K,K,K,Q,Q,Q,K,K] ++ ds_core ++ top_base) ++ List.replicate 1 K = + head_w ++ w_all ++ top_full := by + dsimp [w_all, s_full, ds_mid, top_full, List.replicate] + simp only [List.append_assoc, List.cons_append, List.nil_append] + have hS_full : + Scan 0 6 ((head_w ++ p_w ++ s_base ++ [K,K,K,K,K,Q,Q,Q,K,K] ++ ds_core ++ top_base) ++ List.replicate 1 K) + 0 (1024 * (b_top - 2) + 224) (v_head ++ v_w ++ s_base) (0 + g_w + 18) := by + rw [h_u_rep1] + exact Scan_append (Scan_append Scan_head hS_w) hS_top + let k := 10 + 3 * gp + 3 * g_mid + have hk : 10 <= k := by omega + have hWV_vw : wordPotV v_w <= 13 / 4 := + bound_zW_p' hm hS_p hz13 hzW hD_mid hS_mid + have hz13_vw : wordScale v_w * ((2 ^ k : Nat) : Rat) = 1 := by + have h_z13_w := scan_wordScale_eq hS_w + have h_w_eq : wordScale w_all = 32 := by + dsimp only [w_all] + rw [wordScale_append, wordScale_append] + have h_s : wordScale s_full = 1 / 2 := by + have h := checkScalePow_sound s_full 1 0 (by decide) + norm_num at h + linarith + have h_mid := (digitVal_scale_and_val hD_mid).1 + rw [h_s, h_mid] + linarith + rw [h_w_eq] at h_z13_w + have h_3gw : 3 * g_w = k + 5 := by dsimp [g_w, k]; omega + have h_ew : ((2 ^ 5 : Nat) : Rat) = 32 := by norm_num + rw [h_3gw, Nat.pow_add, Nat.cast_mul, h_ew] at h_z13_w + linarith + rcases bound_b_end_digitVal hk hb_top hS_w hz13_vw hWV_vw + with ⟨A_core', ds_core', hD_core', hlen_core', hA_core', hD_bend⟩ + let da := [K,K,K,K,K,Q,Q,Q,K,K] ++ ds_core' ++ top_base + let u' := V :: (v_head ++ v_w ++ s_base ++ da) + refine ⟨u', ⟨1, 1024 * (b_top - 2) + 224, v_head ++ v_w ++ s_base, da, k + 59, 0 + g_w + 18, hS_full, hD_bend, rfl⟩, ?_⟩ + let p_w' := V :: v_w + let m' := k + 7 + refine ⟨p_w', ds_core', A_core', m', ?_, ⟨v_w, rfl⟩, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · dsimp only [u', p_w', da, v_head, head_w] + simp only [List.cons_append, List.nil_append, List.append_assoc] + · dsimp [m']; omega + · dsimp [m']; omega + · have h_m'_sub : m' - 1 = k + 6 := by omega + rw [h_m'_sub]; exact hD_core' + · have h_m'_sub : m' - 1 = k + 6 := by omega + rw [h_m'_sub]; exact hA_core' + · dsimp only [p_w', m', wordScale] + have h_m'_split : k + 7 = k + 1 + 6 := by omega + have h1 : ((2 ^ 1 : Nat) : Rat) = 2 := by norm_num + have h_ep : ((2 ^ 6 : Nat) : Rat) = 64 := by norm_num + rw [h_m'_split, Nat.pow_add, Nat.pow_add, Nat.cast_mul, Nat.cast_mul, h1, h_ep] + linarith + · dsimp only [p_w'] + rw [wordPot_cons_V] + exact hWV_vw + +theorem reach_N (m : Nat) : + ∃ N, m <= N ∧ ∃ u, + multiStep tm (init []) N = some (zCf (evalWords u default)) ∧ + Good u := by + induction m with + | zero => + rcases init_to_u0 with ⟨k1, hk1⟩ + rcases Rounds_exec rounds_0_17 with ⟨k2, hk2⟩ + exact ⟨k1 + k2, Nat.zero_le _, u_17, multiStep_trans_vkq tm _ _ _ k1 k2 hk1 hk2, good_u17⟩ + | succ m ih => + rcases ih with ⟨N, hN, u, h_ms, hG⟩ + rcases Good_step hG with ⟨u', hStep, hG'⟩ + rcases Step_exec hStep with ⟨k, hk_pos, h_step_k⟩ + exact ⟨N + k, Nat.add_le_add hN hk_pos, u', multiStep_trans_vkq tm _ _ _ N k h_ms h_step_k, hG'⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n, hn⟩ + rcases reach_N (n + 1) with ⟨N, hN, _, h_N, _⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := multiStep_add_intermediate_vkq h_N + rw [multiStep_succ_vkq, hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LB0LB_0RBHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_0RBHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_0RBHHH.lean new file mode 100644 index 00000000..2783aaa5 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_0RBHHH.lean @@ -0,0 +1,935 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusF +public import BusyBeaver.Calculi.WordCalculusG +public import BusyBeaver.Calculi.WordCalculusH + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_0RBHHH + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_0RBHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 +@[reducible] def tm : Machine (Fin 2) (Fin 6) := target_tm +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 2000000 + +open WordVKQ Word + +abbrev evalCCfgVKQ (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev z0b (c : CCfg) : Option CCfg := Counter.bstep tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (evalCCfgVKQ c1) [tm]⊢⁺ (evalCCfgVKQ c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ + +abbrev pref28 : BitWord := [1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0] + + +def zCs : Call -> Fin 6 + | .ch => C + | .ca => B + +def zCR (w : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([1] +> r) {{zCs c}}> w) + +def zCL (w : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (r <{{D}} ([0] +> w)) + +def zCf (w : HalfTape) : Cfg (Fin 2) (Fin 6) := + (default <{{D}} ([0] +> pref28 +> w)) + +abbrev callStep (c : Call) (w1 w2 : HalfTape) : Prop := + ∀ r, (zCR w1 c r) [tm]⊢⁺ (zCL w2 r) + +abbrev Side := SideP callStep +abbrev Seg := SegP callStep + +theorem seg_ch_V : Seg [.ch] [.ch, .ch] V_u V_u := + segP_of_step_two (mid1 := [1, 0, 1, 1]) (mid2 := [1, 0, 1, 0]) + (fun u r => by unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_V : Seg [.ca] [.ch] V_u Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs V_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Vp : Seg [.ca] [.ca, .ca] Vp Vp := + segP_of_step_two (mid1 := [0, 1, 1, 1]) (mid2 := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_K : Seg [.ch] [] K_u Q_u := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs K_u Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ch_Q : Seg [.ch] [.ch] Q_u K_u := + segP_of_step_one (mid := [1, 1]) + (fun u r => by unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL K_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_VpQ : Seg [.ca] [.ca] (Vp ++ Q_u) (Kp ++ Vp) := + segP_of_step_one (mid := [0, 1, 0, 1, 1, 1]) + (fun u r => by unfold zCR zCs Vp Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_KpVp : Seg [.ca] [] (Kp ++ Vp) (Qp ++ Vp) := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs Kp Vp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_QpVp : Seg [.ca] [.ca, .ca] (Qp ++ Vp) (Kp ++ Vp) := + segP_of_step_two (mid1 := [0, 1, 1, 1, 1, 1]) (mid2 := [0, 1, 0, 1, 1, 1]) + (fun u r => by unfold zCR zCs Qp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL zCR zCs; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Kp : Seg [.ca] [] Kp Qp := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs Kp Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_Qp : Seg [.ca] [.ca] Qp Kp := + segP_of_step_one (mid := [1, 1]) + (fun u r => by unfold zCR zCs Qp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Kp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_KQ : Seg [.ca] [] (K_u ++ Q_u) Vp := + segP_of_step_nil (fun u r => by unfold zCR zCL zCs K_u Q_u Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + +theorem seg_ca_QQ : Seg [.ca] [.ca] (Q_u ++ Q_u) Vp := + segP_of_step_one (mid := [0, 1, 0, 1]) + (fun u r => by unfold zCR zCs Q_u; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + (fun u r => by unfold zCL Vp; simp only [List.cons_append, List.nil_append, append_cons, append_nil]; execute) + + +-- Turnaround zP0..zP14 +abbrev tr1 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1] +abbrev tr2 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1] +abbrev tr3 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1] +abbrev tr4 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1] +abbrev tr5 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1] +abbrev tr6 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1] +abbrev tr7 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1] +abbrev tr8 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1] +abbrev tr9 : BitWord := [0,1,1,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1] +abbrev tr10 : BitWord := [0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1] +abbrev tr11 : BitWord := [0,1,1,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1] +abbrev tr12 : BitWord := [0,1,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1,1,1,0,1,0,0,1,0,1,0,1] +abbrev tr13 : BitWord := [0,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1] +abbrev tr14 : BitWord := [0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1] + +theorem zP0 (w : HalfTape) : (zCf w) [tm]⊢⁺ (zCR w .ca (tr1 +> default)) := by + unfold zCf zCR zCs pref28 tr1 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP1 (w : HalfTape) : (zCL w (tr1 +> default)) [tm]⊢⁺ (zCR w .ca (tr2 +> default)) := by + unfold zCL zCR zCs tr1 tr2 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP2 (w : HalfTape) : (zCL w (tr2 +> default)) [tm]⊢⁺ (zCR w .ca (tr3 +> default)) := by + unfold zCL zCR zCs tr2 tr3 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP3 (w : HalfTape) : (zCL w (tr3 +> default)) [tm]⊢⁺ (zCR w .ca (tr4 +> default)) := by + unfold zCL zCR zCs tr3 tr4 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP4 (w : HalfTape) : (zCL w (tr4 +> default)) [tm]⊢⁺ (zCR w .ca (tr5 +> default)) := by + unfold zCL zCR zCs tr4 tr5 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP5 (w : HalfTape) : (zCL w (tr5 +> default)) [tm]⊢⁺ (zCR w .ca (tr6 +> default)) := by + unfold zCL zCR zCs tr5 tr6 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP6 (w : HalfTape) : (zCL w (tr6 +> default)) [tm]⊢⁺ (zCR w .ca (tr7 +> default)) := by + unfold zCL zCR zCs tr6 tr7 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP7 (w : HalfTape) : (zCL w (tr7 +> default)) [tm]⊢⁺ (zCR w .ca (tr8 +> default)) := by + unfold zCL zCR zCs tr7 tr8 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP8 (w : HalfTape) : (zCL w (tr8 +> default)) [tm]⊢⁺ (zCR w .ca (tr9 +> default)) := by + unfold zCL zCR zCs tr8 tr9 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP9 (w : HalfTape) : (zCL w (tr9 +> default)) [tm]⊢⁺ (zCR w .ca (tr10 +> default)) := by + unfold zCL zCR zCs tr9 tr10 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP10 (w : HalfTape) : (zCL w (tr10 +> default)) [tm]⊢⁺ (zCR w .ca (tr11 +> default)) := by + unfold zCL zCR zCs tr10 tr11 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP11 (w : HalfTape) : (zCL w (tr11 +> default)) [tm]⊢⁺ (zCR w .ca (tr12 +> default)) := by + unfold zCL zCR zCs tr11 tr12 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP12 (w : HalfTape) : (zCL w (tr12 +> default)) [tm]⊢⁺ (zCR w .ca (tr13 +> default)) := by + unfold zCL zCR zCs tr12 tr13 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP13 (w : HalfTape) : (zCL w (tr13 +> default)) [tm]⊢⁺ (zCR w .ca (tr14 +> default)) := by + unfold zCL zCR zCs tr13 tr14 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +theorem zP14 (w : HalfTape) : (zCL w (tr14 +> default)) [tm]⊢⁺ (zCf ([1, 1, 0] +> w)) := by + unfold zCL zCf tr14 pref28 + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq] + execute + +-- Section 2: Words, Shift Identity, DigitVal, Parse, Scan, Step +theorem segSpec : SegSpec callStep := + ⟨seg_ch_V, seg_ca_V, seg_ca_Vp, seg_ch_K, seg_ch_Q, + seg_ca_VpQ, seg_ca_KpVp, seg_ca_QpVp, seg_ca_Kp, seg_ca_Qp, + seg_ca_KQ, seg_ca_QQ⟩ + +abbrev Step := StepB 14 +abbrev Rounds := RoundsB 14 +abbrev Rounds.refl := @RoundsB.refl 14 +abbrev Rounds.next := @RoundsB.next 14 +abbrev checkStep := checkStepB 14 +abbrev checkStep_sound := checkStepB_sound 14 + +theorem Side_turnaround {w w' : HalfTape} (h : Side ([Call.ca] ^ 14) w w') : + (zCf w) [tm]⊢⁺ (zCf ([1, 1, 0] +> w')) := by + rcases h with _ | ⟨hc1, h⟩ + rcases h with _ | ⟨hc2, h⟩ + rcases h with _ | ⟨hc3, h⟩ + rcases h with _ | ⟨hc4, h⟩ + rcases h with _ | ⟨hc5, h⟩ + rcases h with _ | ⟨hc6, h⟩ + rcases h with _ | ⟨hc7, h⟩ + rcases h with _ | ⟨hc8, h⟩ + rcases h with _ | ⟨hc9, h⟩ + rcases h with _ | ⟨hc10, h⟩ + rcases h with _ | ⟨hc11, h⟩ + rcases h with _ | ⟨hc12, h⟩ + rcases h with _ | ⟨hc13, h⟩ + rcases h with _ | ⟨hc14, h⟩ + cases h + exact stepPlus_trans_vkq (zP0 w) + (stepPlus_trans_vkq (hc1 (tr1 +> default)) + (stepPlus_trans_vkq (zP1 _) + (stepPlus_trans_vkq (hc2 (tr2 +> default)) + (stepPlus_trans_vkq (zP2 _) + (stepPlus_trans_vkq (hc3 (tr3 +> default)) + (stepPlus_trans_vkq (zP3 _) + (stepPlus_trans_vkq (hc4 (tr4 +> default)) + (stepPlus_trans_vkq (zP4 _) + (stepPlus_trans_vkq (hc5 (tr5 +> default)) + (stepPlus_trans_vkq (zP5 _) + (stepPlus_trans_vkq (hc6 (tr6 +> default)) + (stepPlus_trans_vkq (zP6 _) + (stepPlus_trans_vkq (hc7 (tr7 +> default)) + (stepPlus_trans_vkq (zP7 _) + (stepPlus_trans_vkq (hc8 (tr8 +> default)) + (stepPlus_trans_vkq (zP8 _) + (stepPlus_trans_vkq (hc9 (tr9 +> default)) + (stepPlus_trans_vkq (zP9 _) + (stepPlus_trans_vkq (hc10 (tr10 +> default)) + (stepPlus_trans_vkq (zP10 _) + (stepPlus_trans_vkq (hc11 (tr11 +> default)) + (stepPlus_trans_vkq (zP11 _) + (stepPlus_trans_vkq (hc12 (tr12 +> default)) + (stepPlus_trans_vkq (zP12 _) + (stepPlus_trans_vkq (hc13 (tr13 +> default)) + (stepPlus_trans_vkq (zP13 _) + (stepPlus_trans_vkq (hc14 (tr14 +> default)) (zP14 w')))))))))))))))))))))))))))) + +theorem Step_exec {u u' : List Word} (h : Step u u') : + (zCf (evalWords u default)) [tm]⊢⁺ (zCf (evalWords u' default)) := by + rcases h with ⟨n, b', v, da, H, g, hScan, hDg, rfl⟩ + have hSeg := Seg_of_Scan segSpec hScan + dsimp at hSeg + have hSide0 := sideP_of_segP hSeg (Side_ca_default segSpec hDg) + rw [wordsToBits_append_tape, evalWords_append, evalWords_replicate_K, wordsToBitsShifted_append_tape, <- evalWordsShifted_append] at hSide0 + have hTurn := Side_turnaround hSide0 + rwa [evalWords_V_shift] at hTurn + +theorem Rounds_exec {u v : List Word} (h : Rounds u v) : + (zCf (evalWords u default)) [tm]⊢* (zCf (evalWords v default)) := by + induction h with + | refl _ => exact ⟨0, rfl⟩ + | next hS _ ih => exact stepStar_of_stepPlus_vkq (stepPlus_stepStar_trans_vkq (Step_exec hS) ih) + +-- Section 3: Universal Parse_V_start, Scan_of_Parse, and Trace Evaluators + +def u_0 : List Word := [K,K,K,Q] +def tags_0 : List Nat := [3,3,4] +def da_0 : List Word := [K,K,Q] +def n_0 : Nat := 0 +def u_1 : List Word := [V,K,Q,V,K,K,Q] +def tags_1 : List Nat := [0,5,2,4] +def da_1 : List Word := [K,K,K,K,K,Q,Q] +def n_1 : Nat := 0 +def u_2 : List Word := [V,V,V,Q,V,V,K,K,K,K,K,Q,Q] +def tags_2 : List Nat := [0,0,0,3,0,0,5,3,4,5] +def da_2 : List Word := [Q,Q,Q,Q,K,Q,Q,Q,K,Q] +def n_2 : Nat := 0 +def u_3 : List Word := [V,V,V,V,K,V,V,V,Q,V,V,Q,Q,Q,Q,K,Q,Q,Q,K,Q] +def tags_3 : List Nat := [0,0,0,1,0,0,0,3,0,0,4,3,4,5,3,5] +def da_3 : List Word := [Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,K,Q] +def n_3 : Nat := 0 +def u_4 : List Word := [V,V,V,V,K,V,V,V,V,K,V,V,V,K,V,V,Q,V,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,K,Q] +def tags_4 : List Nat := [0,0,0,1,0,0,0,1,0,0,1,0,0,3,0,4,5,4,4,5,3,5] +def da_4 : List Word := [Q,K,K,Q,K,K,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,K,Q] +def n_4 : Nat := 0 +def u_5 : List Word := [V,V,V,V,K,V,V,V,V,K,V,V,V,K,V,V,V,K,V,V,V,V,V,V,Q,V,Q,K,K,Q,K,K,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,K,Q] +def tags_5 : List Nat := [0,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,3,0,4,4,3,4,4,3,5,4,5,3,5] +def da_5 : List Word := [Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,K,Q] +def n_5 : Nat := 0 +def u_6 : List Word := [V,V,V,V,K,V,V,V,V,K,V,V,V,K,V,V,V,K,V,V,V,V,V,V,V,K,V,V,V,K,V,V,K,V,V,V,Q,V,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,K,Q] +def tags_6 : List Nat := [0,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,1,0,0,1,0,1,0,0,0,3,0,4,5,4,3,5,5,4,4,3,5,4,5,3,5] +def da_6 : List Word := [Q,K,Q,Q,K,Q,K,K,K,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,K,Q] +def n_6 : Nat := 0 +def u_7 : List Word := [V,V,V,V,K,V,V,V,V,K,V,V,V,K,V,V,V,K,V,V,V,V,V,V,V,K,V,V,V,K,V,V,K,V,V,V,V,K,V,V,V,V,K,V,V,V,V,K,V,V,V,Q,V,Q,K,Q,Q,K,Q,K,K,K,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,K,Q] +def tags_7 : List Nat := [0,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,1,0,0,1,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,3,0,4,5,4,3,3,3,5,3,4,4,5,5,4,4,3,5,4,5,3,5] +def da_7 : List Word := [Q,K,Q,Q,K,Q,K,K,Q,Q,K,K,Q,Q,K,Q,Q,K,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,K,Q] +def n_7 : Nat := 0 +def u_8 : List Word := [V,V,V,V,K,V,V,V,V,K,V,V,V,K,V,V,V,K,V,V,V,V,V,V,V,K,V,V,V,K,V,V,K,V,V,V,V,K,V,V,V,V,K,V,V,V,V,K,V,V,V,V,K,V,V,V,V,K,K,Q,V,Q,V,V,V,V,V,V,K,V,V,V,Q,V,Q,K,Q,Q,K,Q,K,K,Q,Q,K,K,Q,Q,K,Q,Q,K,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,K,Q] +def tags_8 : List Nat := [0,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,1,0,0,1,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,5,3,0,3,0,0,0,0,0,1,0,0,0,3,0,4,5,4,3,4,4,3,5,3,5,3,5,3,4,4,5,5,4,4,3,5,4,5,3,5] +def da_8 : List Word := [Q,K,Q,Q,K,Q,K,K,K,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,K,Q] +def n_8 : Nat := 0 +def u_9 : List Word := [V,V,V,V,K,V,V,V,V,K,V,V,V,K,V,V,V,K,V,V,V,V,V,V,V,K,V,V,V,K,V,V,K,V,V,V,V,K,V,V,V,V,K,V,V,V,V,K,V,V,V,V,K,V,V,V,V,V,V,Q,V,K,V,V,V,V,V,K,V,V,V,V,K,V,V,V,V,K,V,V,K,V,Q,V,Q,V,Q,V,V,V,V,V,V,K,V,V,V,Q,V,Q,K,Q,Q,K,Q,K,K,K,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,K,Q] +def head41 : List Word := [V,V,V,V,K,V,V,V,V,K,V,V,V,K,V,V,V,K,V,V,V,V,V,V,V,K,V,V,V,K,V,V,K,V,V,V,V,K,V,V,V] +def tags_head41 : List Nat := [0,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,1,0,0,1,0,1,0,0,0,1,0,0,0] +def v_head41 : List Word := [V,V,V,K,V,V,V,V,K,V,V,V,K,V,V,V,K,V,V,V,V,V,V,V,K,V,V,V,K,V,V,K,V,V,V,V,K,V,V,V,V] +def a_41 : Nat := 33554431 +def b_41 : Nat := 397770042 +def A_top24 : Nat := 12430313 +def s12 : List Word := [V,V,V,V,V,V,K,V,V,V,Q,V] +def s18 : List Word := s12 ++ [Q,K,Q,Q,K,Q] +def tags_s18 : List Nat := [0,0,0,0,0,1,0,0,0,3,0,4,5,4] +def v_s18 : List Word := [V,V,V,V,V,K,V,V,V,V,K,V,V,V,V] +def top22 : List Word := [K,Q,K,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,K,Q] +def tags_top22 : List Nat := [4,4,5,5,4,4,3,5,4,5,3,5] +def p_41_init : List Word := [V,K,V,V,V,V,K,V,V,V,V,K,V,V,V,V,V,V,Q,V,K,V,V,V,V,V,K,V,V,V,V,K,V,V,V,V,K,V,V,K,V,Q,V,Q,V,Q] +def ds_core_init : List Word := [K,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,K,Q] +def A_core_init : Nat := 47935404 + +-- Initial 568 steps from init [] to zCf (evalWords u_0 default) +def zInitCCfg : CCfg := ⟨0, 0, [], []⟩ +def zHit14CCfg : CCfg := ⟨3, 0, [], [0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1]⟩ + +set_option maxRecDepth 200000 in +theorem zCm_init_568 : zCm zInitCCfg 568 = some zHit14CCfg := by decide + +theorem init_to_u0 : (init []) [tm]⊢* zCf (evalWords u_0 default) := by + have h0 : (init [] : Cfg (Fin 2) (Fin 6)) = evalCCfgVKQ zInitCCfg := rfl + have h1 : evalCCfgVKQ zHit14CCfg = zCf (evalWords u_0 default) := by + dsimp [evalCCfgVKQ, zHit14CCfg, zCf, pref28, u_0, evalWords, V_u, K_u, Q_u] + simp only [List.cons_append, List.nil_append, append_cons, append_nil, zero_cons_default_vkq, default_head_vkq, default_tail_vkq] + have hPlus := zTc (by decide : 0 < 568) zCm_init_568 + rw [<- h0, h1] at hPlus + exact stepStar_of_stepPlus_vkq hPlus + +-- 9 finite rounds u_0 -> u_9 +set_option maxRecDepth 200000 in +theorem step_0 : Step u_0 u_1 := checkStep_sound n_0 tags_0 u_0 da_0 u_1 (by decide) +set_option maxRecDepth 200000 in +theorem step_1 : Step u_1 u_2 := checkStep_sound n_1 tags_1 u_1 da_1 u_2 (by decide) +set_option maxRecDepth 200000 in +theorem step_2 : Step u_2 u_3 := checkStep_sound n_2 tags_2 u_2 da_2 u_3 (by decide) +set_option maxRecDepth 200000 in +theorem step_3 : Step u_3 u_4 := checkStep_sound n_3 tags_3 u_3 da_3 u_4 (by decide) +set_option maxRecDepth 200000 in +theorem step_4 : Step u_4 u_5 := checkStep_sound n_4 tags_4 u_4 da_4 u_5 (by decide) +set_option maxRecDepth 200000 in +theorem step_5 : Step u_5 u_6 := checkStep_sound n_5 tags_5 u_5 da_5 u_6 (by decide) +set_option maxRecDepth 200000 in +theorem step_6 : Step u_6 u_7 := checkStep_sound n_6 tags_6 u_6 da_6 u_7 (by decide) +set_option maxRecDepth 200000 in +theorem step_7 : Step u_7 u_8 := checkStep_sound n_7 tags_7 u_7 da_7 u_8 (by decide) +set_option maxRecDepth 200000 in +theorem step_8 : Step u_8 u_9 := checkStep_sound n_8 tags_8 u_8 da_8 u_9 (by decide) + +theorem rounds_0_9 : Rounds u_0 u_9 := + Rounds.next step_0 (Rounds.next step_1 (Rounds.next step_2 (Rounds.next step_3 (Rounds.next step_4 (Rounds.next step_5 (Rounds.next step_6 (Rounds.next step_7 (Rounds.next step_8 (Rounds.refl u_9))))))))) + +-- Invariant Good u (5-piece decomposition) +abbrev Good (u : List Word) : Prop := + ∃ p_41 ds_core A_core m, + u = head41 ++ p_41 ++ s12 ++ [Q, K, Q, Q, K, Q, K, K] ++ ds_core ++ [Q, K] ++ top22 ∧ + (∃ p_tail, p_41 = V :: p_tail) ∧ + m = 4 + ds_core.length ∧ + 12 <= m ∧ + DigitVal A_core (m - 4) ds_core ∧ + A_core * 32 <= 25 * 2 ^ (m - 4) ∧ + wordScale p_41 * ((2 ^ m : Nat) : Rat) = 256 ∧ + wordPot p_41 <= 21 / 4 + +set_option maxRecDepth 200000 in +theorem good_u9 : Good u_9 := by + refine ⟨p_41_init, ds_core_init, A_core_init, 30, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · decide + · exact ⟨p_41_init.tail, rfl⟩ + · decide + · decide + · exact checkDg_sound A_core_init ds_core_init (by decide) + · decide + · have h := checkScalePow_sound p_41_init 30 8 (by decide) + norm_num at h + exact h + · have h := checkWordPotLe_sound p_41_init 21 4 (by decide) + norm_num at h + linarith + +-- Fixed-piece Scan lemmas +set_option maxRecDepth 200000 in +theorem Scan_head41 : Scan 0 14 head41 a_41 b_41 v_head41 0 := by + have h := checkAffineScan_sound tags_head41 0 0 0 14 head41 0 a_41 0 b_41 v_head41 0 0 0 (by decide) + simpa using h + +theorem v_head41_eq : V :: v_head41 = head41 ++ [V] := rfl + +theorem Scan_s18 (ap bp : Nat) (hbp : 3 <= bp) : + Scan ap bp s18 (4 * ap + 4) (2048 * (bp - 3) + 1972) v_s18 3 := by + have h := checkAffineScan_sound tags_s18 1 0 1 3 s18 4 4 2048 1972 v_s18 3 ap (bp - 3) (by decide) + have h_bp : 1 * (bp - 3) + 3 = bp := by omega + have h_ap : 1 * ap + 0 = ap := by omega + rwa [h_ap, h_bp] at h + +theorem Scan_top22 (b_top22 : Nat) (hb : 2 <= b_top22) : + Scan (2 ^ 19) b_top22 top22 0 (256 * (b_top22 - 2) + 45) s12 10 := by + have h := checkAffineScan_sound tags_top22 0 (2 ^ 19) 1 2 top22 0 0 256 45 s12 10 0 (b_top22 - 2) (by decide) + have h_in : 1 * (b_top22 - 2) + 2 = b_top22 := by omega + dsimp at h + rwa [h_in] at h + +theorem Parse_s18_split {ap a_end g_all : Nat} {rest : List Word} + (h : Parse ap (s18 ++ K :: rest) a_end g_all) : + ∃ g_mid, Parse (4 * (ap + 1)) (K :: rest) a_end g_mid := by + change Parse ap ([V,V,V,V,V,V,K,V,V,V,Q,V,Q,K,Q,Q,K,Q,K] ++ rest) a_end g_all at h + simp only [List.cons_append, List.nil_append] at h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + rcases Parse_VK_inv h with h | h + · -- VK at i=5 + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + cases h with + | @D _ q1_10 _ _ _ _ _ hq1_10 h => + have hq1_10_eq : q1_10 = 128 + ap * 128 := by dsimp [dVal] at hq1_10; omega + subst hq1_10_eq + have h := Parse_VQ_inv h + cases h with + | @D _ q1_12 _ _ _ _ _ hq1_12 h => + have hq1_12_eq : q1_12 = 129 + ap * 128 := by dsimp [dVal] at hq1_12; omega + subst hq1_12_eq + cases h with + | D _ hq1_13 _ => dsimp [dVal] at hq1_13; omega + | @P _ q2_13 _ _ _ _ _ _ _ hq2_13 h => + have hq2_13_eq : q2_13 = 32 + ap * 32 := by dsimp [dVal] at hq2_13; omega + subst hq2_13_eq + cases h with + | D _ hq1_15 _ => dsimp [dVal] at hq1_15; omega + | P _ _ hq2_15 _ => dsimp [dVal] at hq2_15; omega + | @P _ q2_12 _ _ _ _ _ _ _ hq2_12 h => + have hq2_12_eq : q2_12 = 64 + ap * 64 := by dsimp [dVal] at hq2_12; omega + subst hq2_12_eq + cases h with + | D _ hq1_14 _ => dsimp [dVal] at hq1_14; omega + | @P _ q2_14 _ _ _ _ _ _ _ hq2_14 h => + have hq2_14_eq : q2_14 = 16 + ap * 16 := by dsimp [dVal] at hq2_14; omega + subst hq2_14_eq + cases h with + | @D _ q1_16 _ _ _ _ _ hq1_16 h => + have hq1_16_eq : q1_16 = 8 + ap * 8 := by dsimp [dVal] at hq1_16; omega + subst hq1_16_eq + cases h with + | D _ hq1_17 _ => dsimp [dVal] at hq1_17; omega + | P _ _ hq2_17 _ => dsimp [dVal] at hq2_17; omega + | @P _ q2_16 _ _ _ _ _ _ _ hq2_16 h => + have hq2_16_eq : q2_16 = 4 + ap * 4 := by dsimp [dVal] at hq2_16; omega + subst hq2_16_eq + have h_end : 4 + ap * 4 = 4 * (ap + 1) := by omega + rw [h_end] at h + exact ⟨_, h⟩ + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + · -- T at i=5 + cases h with + | D _ hq1_6 _ => dsimp [dVal] at hq1_6; omega + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + +-- Section 6: Main Invariant Closure and Goal Proof +theorem zDg_top24 : DigitVal A_top24 24 ([Q, K] ++ top22) := + checkDg_sound A_top24 ([Q, K] ++ top22) (by decide) + +theorem zDg_bot8 : DigitVal 45 8 [Q, K, Q, Q, K, Q, K, K] := + checkDg_sound 45 [Q, K, Q, Q, K, Q, K, K] (by decide) + +theorem digitVal_mid {A_core m : Nat} {ds_core : List Word} + (hm : 12 <= m) (hD : DigitVal A_core (m - 4) ds_core) + (hA_core : A_core * 32 <= 25 * 2 ^ (m - 4)) : + ∃ A_mid, + DigitVal A_mid m ([K, K] ++ ds_core ++ [Q, K]) ∧ + 2 <= A_mid ∧ + A_mid <= 2 + 57 * 2 ^ (m - 7) := by + have h_kk : DigitVal 0 2 [K, K] := checkDg_sound 0 [K, K] (by decide) + have h_qk : DigitVal 1 2 [Q, K] := checkDg_sound 1 [Q, K] (by decide) + have h1 := digitVal_append h_kk hD + have h2 := digitVal_append h1 h_qk + have hlen1 : 2 + (m - 4) = m - 2 := by omega + have hlen2 : (m - 2) + 2 = m := by omega + rw [hlen1] at h2 + rw [hlen2] at h2 + have h_pow1 : 2 ^ (m - 4) = 8 * 2 ^ (m - 7) := by + have heq : m - 4 = 3 + (m - 7) := by omega + rw [heq, Nat.pow_add] + have h_pow2 : 2 ^ (m - 2) = 32 * 2 ^ (m - 7) := by + have heq : m - 2 = 5 + (m - 7) := by omega + rw [heq, Nat.pow_add] + have h_pos_m7 : 1 <= 2 ^ (m - 7) := pow_two_pos (m - 7) + exact ⟨0 + A_core * 4 + 1 * 2 ^ (m - 2), + by simpa [List.append_assoc] using h2, + by omega, + by omega⟩ + +theorem force_a19 {p_41 ds_mid : List Word} {ap gp m A_mid a_top g_mid : Nat} + (hm : 12 <= m) + (hP_p : Parse a_41 p_41 ap gp) + (hz13 : wordScale p_41 * ((2 ^ m : Nat) : Rat) = 256) + (hzW : wordPot p_41 <= 21 / 4) + (hD_mid : DigitVal A_mid m ds_mid) + (hA_lo : 2 <= A_mid) + (hA_hi : A_mid <= 2 + 57 * 2 ^ (m - 7)) + (hP_mid : Parse (4 * (ap + 1)) ds_mid a_top g_mid) : + a_top = 2 ^ 19 := by + rcases Parse_la hP_p with ⟨hla_lo, hla_hi⟩ + have hz12 := wordValQ_nonneg p_41 + have hz10_le := two_wordVal_add_wordValQ_le p_41 + have h_diff_hi : ((ap : Rat) + 1) * wordScale p_41 - ((a_41 : Rat) + 1) < 11 := by linarith + have h_powm_pos : (0 : Rat) < ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + have h_mul_lo : ((a_41 : Rat) + 1) * ((2 ^ m : Nat) : Rat) <= ((ap : Rat) + 1) * (wordScale p_41 * ((2 ^ m : Nat) : Rat)) := by + nlinarith + have h_mul_hi : ((ap : Rat) + 1) * (wordScale p_41 * ((2 ^ m : Nat) : Rat)) < (((a_41 : Rat) + 1) + 11) * ((2 ^ m : Nat) : Rat) := by + nlinarith + rw [hz13] at h_mul_lo h_mul_hi + have ha41_val : a_41 + 1 = 2 ^ 25 := by decide + have ha41_r : (a_41 : Rat) + 1 = ((2 ^ 25 : Nat) : Rat) := by exact_mod_cast ha41_val + rw [ha41_r] at h_mul_lo h_mul_hi + have h_nat_lo : 2 ^ 25 * 2 ^ m <= (ap + 1) * 256 := by exact_mod_cast h_mul_lo + have h_nat_hi : (ap + 1) * 256 < (2 ^ 25 + 11) * 2 ^ m := by exact_mod_cast h_mul_hi + have h_256 : (ap + 1) * 256 = (4 * (ap + 1)) * 64 := by ring + rw [h_256] at h_nat_lo h_nat_hi + have h_split1 : 2 ^ 25 * 2 ^ m = (2 ^ 19 * 2 ^ m) * 64 := by + have : (2 ^ 25 : Nat) = 2 ^ 19 * 64 := by decide + rw [this]; ring + have h_split2 : (2 ^ 25 + 11) * 2 ^ m = (2 ^ 19 * 2 ^ m + 11 * 2 ^ (m - 6)) * 64 := by + have h25 : (2 ^ 25 : Nat) = 2 ^ 19 * 64 := by decide + have hm6 : 2 ^ m = 2 ^ (m - 6) * 64 := by + have h6 : (64 : Nat) = 2 ^ 6 := rfl + rw [h6, <- Nat.pow_add, Nat.sub_add_cancel (by omega : 6 <= m)] + calc (2 ^ 25 + 11) * 2 ^ m + _ = 2 ^ 25 * 2 ^ m + 11 * 2 ^ m := by ring + _ = (2 ^ 19 * 64) * 2 ^ m + 11 * (2 ^ (m - 6) * 64) := by rw [h25, hm6] + _ = (2 ^ 19 * 2 ^ m + 11 * 2 ^ (m - 6)) * 64 := by ring + rw [h_split1] at h_nat_lo + rw [h_split2] at h_nat_hi + have h_pos64 : 0 < 64 := by decide + have hap_lo : 2 ^ 19 * 2 ^ m <= 4 * (ap + 1) := Nat.le_of_mul_le_mul_right h_nat_lo h_pos64 + have hap_hi : 4 * (ap + 1) < 2 ^ 19 * 2 ^ m + 11 * 2 ^ (m - 6) := Nat.lt_of_mul_lt_mul_right h_nat_hi + have h_pow_m6 : 2 ^ (m - 6) = 2 * 2 ^ (m - 7) := by + have heq : m - 6 = 1 + (m - 7) := by omega + rw [heq, Nat.pow_add] + have h_pow_m : 2 ^ m = 128 * 2 ^ (m - 7) := by + have h7 : (128 : Nat) = 2 ^ 7 := rfl + rw [h7, <- Nat.pow_add, Nat.add_sub_of_le (by omega : 7 <= m)] + have h_pow_m7_ge : 32 <= 2 ^ (m - 7) := by + have h5 : 5 <= m - 7 := by omega + have hle := Nat.pow_le_pow_right (by decide : 1 <= 2) h5 + simpa using hle + rcases parse_digitVal_a hP_mid hD_mid with ⟨h_atop_lo, h_atop_hi⟩ + have h_sum_lo : 2 ^ 19 * 2 ^ m < 4 * (ap + 1) + A_mid := by omega + have h_sum_hi : 4 * (ap + 1) + A_mid < (2 ^ 19 + 1) * 2 ^ m := by + have : (2 ^ 19 + 1) * 2 ^ m = 2 ^ 19 * 2 ^ m + 128 * 2 ^ (m - 7) := by + rw [Nat.add_mul, Nat.one_mul, h_pow_m] + omega + have h_pos_m : 0 < 2 ^ m := pow_two_pos m + have h_lt1 : a_top < 2 ^ 19 + 1 := Nat.lt_of_mul_lt_mul_right (lt_of_le_of_lt h_atop_lo h_sum_hi) + have h_lt2 : 2 ^ 19 < a_top + 1 := Nat.lt_of_mul_lt_mul_right (lt_trans h_sum_lo h_atop_hi) + omega + +theorem bound_b_mid0 {p_41 v_p ds_mid : List Word} + {ap bp gp m A_mid b_mid0 : Nat} + (hm : 12 <= m) + (hS_p : Scan a_41 b_41 p_41 ap bp v_p gp) + (hbp : 3 <= bp) + (hz13 : wordScale p_41 * ((2 ^ m : Nat) : Rat) = 256) + (hzW : wordPot p_41 <= 21 / 4) + (hb_mid0 : b_mid0 = 2048 * (bp - 3) + 1972) + (hD_mid : DigitVal A_mid m ds_mid) : + 2 + 4 * wordVal ds_mid < (b_mid0 : Rat) := by + have h_delta_p := (Scan_delta hS_p).2 + have h_4wv_p := two_wordVal_add_wordValQ_le_four_wordPotV v_p + have h_cw_p := scan_wordPot_contract hS_p + have hc_b41 := (cPar_bounds b_41).2 + have h_wv_p_lt : wordPotV v_p < 6 := by linarith + have h_z13_p := scan_wordScale_eq hS_p + have h_pow_gp_ge1 : (1 : Rat) <= ((2 ^ (3 * gp) : Nat) : Rat) := by exact_mod_cast (pow_two_pos (3 * gp)) + have h_z13_vp_pos := wordScale_pos v_p + have h_z13_vp_le : wordScale v_p <= wordScale p_41 := by nlinarith + have h_b41_big : ((2 ^ 28 : Nat) : Rat) + 26 < (b_41 : Rat) := by norm_num [b_41] + have h_bp2_pos : (0 : Rat) <= (bp : Rat) - 2 := by + have : (2 : Rat) <= (bp : Rat) := by exact_mod_cast (by omega : 2 <= bp) + linarith + have h_prod_p : ((2 ^ 28 : Nat) : Rat) < ((bp : Rat) - 2) * wordScale p_41 := by nlinarith + have h_powm_pos : (0 : Rat) < ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + have h_mul_m : ((2 ^ 28 : Nat) : Rat) * ((2 ^ m : Nat) : Rat) < ((bp : Rat) - 2) * (wordScale p_41 * ((2 ^ m : Nat) : Rat)) := by + nlinarith + rw [hz13] at h_mul_m + have h_pow28 : ((2 ^ 28 : Nat) : Rat) = ((2 ^ 20 : Nat) : Rat) * 256 := by norm_num + rw [h_pow28] at h_mul_m + have h_bp2_gt : ((2 ^ 20 : Nat) : Rat) * ((2 ^ m : Nat) : Rat) < (bp : Rat) - 2 := by linarith + have h_bmid0_r : (b_mid0 : Rat) = 2048 * ((bp : Rat) - 3) + 1972 := by + rw [hb_mid0, Nat.cast_add, Nat.cast_mul, Nat.cast_sub hbp]; push_cast; ring + have h_z10_mid := (digitVal_scale_and_val hD_mid).2 + have h_pow20_val : ((2 ^ 20 : Nat) : Rat) = 1048576 := by norm_num + have h_powm_ge1 : (1 : Rat) <= ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + rw [h_z10_mid, h_bmid0_r] + rw [h_pow20_val] at h_bp2_gt + linarith + +theorem bound_zW_p41' {p_41 v_p ds_mid v_mid : List Word} + {ap bp gp m A_mid b_mid0 b_top22 g_mid : Nat} + (hm : 12 <= m) + (hS_p : Scan a_41 b_41 p_41 ap bp v_p gp) + (hz13 : wordScale p_41 * ((2 ^ m : Nat) : Rat) = 256) + (hzW : wordPot p_41 <= 21 / 4) + (hD_mid : DigitVal A_mid m ds_mid) + (hS_mid : Scan (4 * (ap + 1)) b_mid0 ds_mid (2 ^ 19) b_top22 v_mid g_mid) : + wordPotV (v_p ++ v_s18 ++ v_mid) <= 21 / 4 := by + -- Step A: wordPotV v_p <= 327 / 64 + have h_cw_p := scan_wordPot_contract hS_p + have hc_b41 : cPar b_41 = 3 / 16 := by + unfold cPar + have hmod : b_41 % 2 = 0 := by decide + rw [hmod]; rfl + rw [hc_b41] at h_cw_p + have hA : wordPotV v_p <= 327 / 64 := by linarith + -- wordScale bounds + have h_z13_p := scan_wordScale_eq hS_p + have h_z13_s18 : wordScale v_s18 = 1 / 2048 := by + have h := checkScalePow_sound v_s18 11 0 (by decide) + norm_num at h + linarith + have h_wv_s18 : wordPotV v_s18 <= 9 / 256 := by + have h := checkWordPotVLe_sound v_s18 9 256 (by decide) + norm_num at h + linarith + -- Step B: wordScale v_p * wordPotV v_s18 <= 9 / 4096 + have h_powm_ge12 : (2 ^ 12 : Nat) <= 2 ^ m := Nat.pow_le_pow_right (by decide) hm + have h_powm_r : ((2 ^ 12 : Nat) : Rat) <= ((2 ^ m : Nat) : Rat) := by exact_mod_cast h_powm_ge12 + have h_z13_p_le : wordScale p_41 <= 1 / 16 := by + have h_pos_p := wordScale_pos p_41 + have h_mul := mul_le_mul_of_nonneg_left h_powm_r (le_of_lt h_pos_p) + rw [hz13] at h_mul + norm_num at h_mul + linarith + have h_pow_gp_ge1 : (1 : Rat) <= ((2 ^ (3 * gp) : Nat) : Rat) := by exact_mod_cast (pow_two_pos (3 * gp)) + have h_z13_vp_pos := wordScale_pos v_p + have h_z13_vp_le : wordScale v_p <= 1 / 16 := by nlinarith + have hB : wordScale v_p * wordPotV v_s18 <= 9 / 4096 := by + have h_wv_nn := wordPotV_nonneg v_s18 + nlinarith + -- Step C: wordScale (v_p ++ v_s18) * wordPotV v_mid <= 1 / 8 + have h_dc_eq := digitVal_scan_dCount hS_mid hD_mid + have h_wv_mid_dc := (dCount_bound v_mid).2 + have h_vp_m : wordScale v_p * ((2 ^ m : Nat) : Rat) <= 256 := by + have h_eq : wordScale v_p * ((2 ^ m : Nat) : Rat) * ((2 ^ (3 * gp) : Nat) : Rat) = 256 := by + calc wordScale v_p * ((2 ^ m : Nat) : Rat) * ((2 ^ (3 * gp) : Nat) : Rat) + _ = (wordScale v_p * ((2 ^ (3 * gp) : Nat) : Rat)) * ((2 ^ m : Nat) : Rat) := by ring + _ = wordScale p_41 * ((2 ^ m : Nat) : Rat) := by rw [h_z13_p] + _ = 256 := hz13 + have h_pos_m : (0 : Rat) < ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + have h_nn : 0 <= wordScale v_p * ((2 ^ m : Nat) : Rat) := mul_nonneg (le_of_lt h_z13_vp_pos) (le_of_lt h_pos_m) + nlinarith + have h_prod_ps : wordScale v_p * wordScale v_s18 * ((2 ^ m : Nat) : Rat) <= 1 / 8 := by + rw [h_z13_s18] + linarith + have hC : wordScale (v_p ++ v_s18) * wordPotV v_mid <= 1 / 8 := by + rw [wordScale_append] + have h_wv_mid_le : wordPotV v_mid <= ((2 ^ m : Nat) : Rat) := by + have h_dc_le_m : 2 ^ (dCount v_mid) <= 2 ^ m := Nat.pow_le_pow_right (by decide) (by omega) + have h_dc_r : ((2 ^ (dCount v_mid) : Nat) : Rat) <= ((2 ^ m : Nat) : Rat) := by exact_mod_cast h_dc_le_m + linarith + have h_wv_mid_nn := wordPotV_nonneg v_mid + have h_z13_ps_pos : 0 < wordScale v_p * wordScale v_s18 := mul_pos h_z13_vp_pos (wordScale_pos v_s18) + nlinarith + -- Combine A + B + C + have h_app1 := wordPotV_append_le v_p v_s18 + have h_app2 := wordPotV_append_le (v_p ++ v_s18) v_mid + linarith + +theorem bound_b_end_digitVal {w_41 v_w41 : List Word} {b_top22 g_w41 k : Nat} + (hk : 3 <= k) + (hb_top22 : 2 <= b_top22) + (hS_w : Scan a_41 b_41 w_41 (2 ^ 19) b_top22 v_w41 g_w41) + (hz13_vw : wordScale v_w41 * ((2 ^ k : Nat) : Rat) = 1) + (hWV_vw : wordPotV v_w41 <= 21 / 4) : + ∃ A_core' ds_core', + DigitVal A_core' (k + 5) ds_core' ∧ + ds_core'.length = k + 5 ∧ + A_core' * 32 <= 25 * 2 ^ (k + 5) ∧ + DigitVal (256 * (b_top22 - 2) + 45) (k + 37) + ([Q, K, Q, Q, K, Q, K, K] ++ ds_core' ++ [Q, K] ++ top22) := by + rcases Scan_delta hS_w with ⟨hd_lo, hd_hi⟩ + have h_4wv := two_wordVal_add_wordValQ_le_four_wordPotV v_w41 + have hd_hi' : ((b_41 : Rat) - 2) - ((b_top22 : Rat) - 2) * wordScale v_w41 <= 21 := by linarith + have h_powk_pos : (0 : Rat) < ((2 ^ k : Nat) : Rat) := by exact_mod_cast (pow_two_pos k) + have h_mul_lo : (((b_41 : Rat) - 2) - 21) * ((2 ^ k : Nat) : Rat) <= ((b_top22 : Rat) - 2) * (wordScale v_w41 * ((2 ^ k : Nat) : Rat)) := by + nlinarith + have h_mul_hi : ((b_top22 : Rat) - 2) * (wordScale v_w41 * ((2 ^ k : Nat) : Rat)) <= ((b_41 : Rat) - 1) * ((2 ^ k : Nat) : Rat) := by + nlinarith + rw [hz13_vw, mul_one] at h_mul_lo h_mul_hi + have hb41_r : (b_41 : Rat) - 2 = (A_top24 : Rat) * 32 + 24 := by norm_num [b_41, A_top24] + have hb41_1_r : (b_41 : Rat) - 1 = (A_top24 : Rat) * 32 + 25 := by norm_num [b_41, A_top24] + rw [hb41_r] at h_mul_lo + rw [hb41_1_r] at h_mul_hi + let b_end := 256 * (b_top22 - 2) + 45 + have hb_end_r : (b_end : Rat) = 256 * ((b_top22 : Rat) - 2) + 45 := by + dsimp [b_end] + rw [Nat.cast_add, Nat.cast_mul, Nat.cast_sub hb_top22] + push_cast; ring + have h_pow_k13 : ((2 ^ (k + 13) : Nat) : Rat) = 8192 * ((2 ^ k : Nat) : Rat) := by + have h13 : ((2 ^ 13 : Nat) : Rat) = 8192 := by norm_num + rw [Nat.pow_add, Nat.cast_mul, h13]; ring + have h_powk_ge1 : (1 : Rat) <= ((2 ^ k : Nat) : Rat) := by exact_mod_cast (pow_two_pos k) + have h_bend_lo_r : (A_top24 : Rat) * ((2 ^ (k + 13) : Nat) : Rat) < (b_end : Rat) := by + rw [hb_end_r, h_pow_k13]; linarith + have h_bend_mid_r : (b_end : Rat) <= (A_top24 : Rat) * ((2 ^ (k + 13) : Nat) : Rat) + 256 * 25 * ((2 ^ k : Nat) : Rat) + 45 := by + rw [hb_end_r, h_pow_k13]; linarith + have h_bend_hi_r : (b_end : Rat) < ((A_top24 : Rat) + 1) * ((2 ^ (k + 13) : Nat) : Rat) := by + rw [hb_end_r, h_pow_k13]; linarith + have h_bend_lo : A_top24 * 2 ^ (k + 13) < b_end := by exact_mod_cast h_bend_lo_r + have h_bend_mid : b_end <= A_top24 * 2 ^ (k + 13) + 256 * 25 * 2 ^ k + 45 := by exact_mod_cast h_bend_mid_r + have h_bend_hi : b_end < (A_top24 + 1) * 2 ^ (k + 13) := by exact_mod_cast h_bend_hi_r + have h_bend_mod256 : b_end % 256 = 45 := by dsimp [b_end]; omega + let A_core' := (b_end / 256) % (2 ^ (k + 5)) + have h_Acore'_lt : A_core' < 2 ^ (k + 5) := Nat.mod_lt _ (pow_two_pos (k + 5)) + rcases exists_digitVal_of_lt_pow (k + 5) A_core' h_Acore'_lt with ⟨ds_core', hD_core'⟩ + have h_len_core' := length_of_digitVal hD_core' + have h_bot_mid := digitVal_append zDg_bot8 hD_core' + have h_all := digitVal_append h_bot_mid zDg_top24 + have h_len_all : (8 + (k + 5)) + 24 = k + 37 := by omega + have h_pow_k13_eq : 2 ^ (k + 13) = 256 * 2 ^ (k + 5) := by + have : k + 13 = 8 + (k + 5) := by omega + rw [this, Nat.pow_add] + have h_div_top : b_end / (2 ^ (k + 13)) = A_top24 := by + have h_pos_k13 : 0 < 2 ^ (k + 13) := pow_two_pos (k + 13) + have h1 := (Nat.le_div_iff_mul_le h_pos_k13).mpr (le_of_lt h_bend_lo) + have h2 := (Nat.div_lt_iff_lt_mul h_pos_k13).mpr h_bend_hi + omega + have h_val_all : 45 + A_core' * 2 ^ 8 + A_top24 * 2 ^ (8 + (k + 5)) = b_end := by + have h1 : 2 ^ 8 = 256 := by decide + have h2 : 2 ^ (8 + (k + 5)) = 256 * 2 ^ (k + 5) := by rw [Nat.pow_add] + rw [h1, h2] + have h_assoc : A_top24 * (256 * 2 ^ (k + 5)) = 256 * (A_top24 * 2 ^ (k + 5)) := by ring + rw [h_assoc] + dsimp [A_core'] + have h_div256 : (b_end / 256) / (2 ^ (k + 5)) = A_top24 := by + rw [Nat.div_div_eq_div_mul, <- h_pow_k13_eq, h_div_top] + have h_mod_div := Nat.div_add_mod (b_end / 256) (2 ^ (k + 5)) + rw [h_div256, Nat.mul_comm (2 ^ (k + 5)) A_top24] at h_mod_div + have h_mod256 := Nat.div_add_mod b_end 256 + omega + have h_Acore'_le_k : A_core' <= 25 * 2 ^ k := by + have h_eq8 : 2 ^ 8 = 256 := by decide + have h_eq_k13 : 2 ^ (8 + (k + 5)) = 2 ^ (k + 13) := by + have : 8 + (k + 5) = k + 13 := by omega + rw [this] + rw [h_eq8, h_eq_k13] at h_val_all + omega + have h_Acore'_32 : A_core' * 32 <= 25 * 2 ^ (k + 5) := by + have h_pow_k5 : 2 ^ (k + 5) = 32 * 2 ^ k := by + have : k + 5 = 5 + k := by omega + rw [this, Nat.pow_add] + omega + rw [h_len_all, h_val_all] at h_all + exact ⟨A_core', ds_core', hD_core', h_len_core', h_Acore'_32, by simpa [List.append_assoc] using h_all⟩ + +theorem Good_step {u : List Word} (hG : Good u) : + ∃ u', Step u u' ∧ Good u' := by + rcases hG with ⟨p_41, ds_core, A_core, m, rfl, ⟨p_tail, hp_start⟩, hm_def, hm, hD_core, hA_core, hz13, hzW⟩ + -- Piece 2: p_41 + have hP_p_ex : ∃ ap gp, Parse a_41 p_41 ap gp := by + rw [hp_start]; exact Parse_V_start a_41 p_tail + rcases hP_p_ex with ⟨ap, gp, hP_p⟩ + have hb_41_ok : 2 + 4 * wordVal p_41 < (b_41 : Rat) := by + have hz12 := wordValQ_nonneg p_41 + have hz10_le := two_wordVal_add_wordValQ_le p_41 + have hb41_gt : (25 : Rat) < (b_41 : Rat) := by norm_num [b_41] + linarith + rcases Scan_of_Parse hP_p b_41 hb_41_ok with ⟨bp, v_p, hS_p, hbp⟩ + -- Piece 3: s18 + have hS_s18 := Scan_s18 ap bp hbp + let b_mid0 := 2048 * (bp - 3) + 1972 + -- Piece 4: ds_mid = [K, K] ++ ds_core ++ [Q, K] + let ds_mid := [K, K] ++ ds_core ++ [Q, K] + rcases digitVal_mid hm hD_core hA_core with ⟨A_mid, hD_mid, hA_lo, hA_hi⟩ + have hP_s18_all : ∃ a_top g_all, Parse ap (s18 ++ ds_mid) a_top g_all := by + change ∃ a_top g_all, Parse ap (V :: (s18.tail ++ ds_mid)) a_top g_all + exact Parse_V_start ap _ + rcases hP_s18_all with ⟨a_top, g_all, hP_all⟩ + have hP_mid_ex : ∃ g_mid, Parse (4 * (ap + 1)) ds_mid a_top g_mid := by + dsimp [ds_mid] at hP_all ⊢ + exact Parse_s18_split hP_all + rcases hP_mid_ex with ⟨g_mid, hP_mid⟩ + have hatop_eq := force_a19 hm hP_p hz13 hzW hD_mid hA_lo hA_hi hP_mid + subst hatop_eq + have hb_mid0_ok := bound_b_mid0 hm hS_p hbp hz13 hzW rfl hD_mid + rcases Scan_of_Parse hP_mid b_mid0 hb_mid0_ok with ⟨b_top22, v_mid, hS_mid, hb_top22_ge3⟩ + -- Piece 5: top22 + have hb_top22 : 2 <= b_top22 := by omega + have hS_top22 := Scan_top22 b_top22 hb_top22 + -- Combine Pieces 2 + 3 + 4 into w_41 + let w_41 := p_41 ++ s18 ++ ds_mid + let v_w41 := v_p ++ v_s18 ++ v_mid + let g_w41 := gp + 3 + g_mid + have h_ap_eq : 4 * ap + 4 = 4 * (ap + 1) := by omega + rw [h_ap_eq] at hS_s18 + have hS_w41 : Scan a_41 b_41 w_41 (2 ^ 19) b_top22 v_w41 g_w41 := by + have h23 := Scan_append hS_p hS_s18 + have h234 := Scan_append h23 hS_mid + simpa [w_41, v_w41, g_w41, List.append_assoc, Nat.add_assoc] using h234 + -- Combine Piece 1 + w_41 + Piece 5 + have h_u_rep0 : + (head41 ++ p_41 ++ s12 ++ [Q, K, Q, Q, K, Q, K, K] ++ ds_core ++ [Q, K] ++ top22) ++ List.replicate 0 K = + head41 ++ w_41 ++ top22 := by + dsimp [w_41, s18, ds_mid, List.replicate] + simp only [List.append_assoc, List.cons_append, List.nil_append, List.append_nil] + have hS_full : + Scan 0 14 ((head41 ++ p_41 ++ s12 ++ [Q, K, Q, Q, K, Q, K, K] ++ ds_core ++ [Q, K] ++ top22) ++ List.replicate 0 K) + 0 (256 * (b_top22 - 2) + 45) (v_head41 ++ v_w41 ++ s12) (0 + g_w41 + 10) := by + rw [h_u_rep0] + exact Scan_append (Scan_append Scan_head41 hS_w41) hS_top22 + -- Closure bounds for p_41' = V :: v_w41 and b_end + let k := 3 + 3 * gp + 3 * g_mid + have hk : 3 <= k := by omega + have hWV_vw : wordPotV v_w41 <= 21 / 4 := + bound_zW_p41' hm hS_p hz13 hzW hD_mid hS_mid + have hz13_vw : wordScale v_w41 * ((2 ^ k : Nat) : Rat) = 1 := by + have h_z13_w := scan_wordScale_eq hS_w41 + have h_w_eq : wordScale w_41 = 64 := by + dsimp only [w_41] + rw [wordScale_append, wordScale_append] + have h_s18 : wordScale s18 = 1 / 4 := by + have h := checkScalePow_sound s18 2 0 (by decide) + norm_num at h + linarith + have h_mid := (digitVal_scale_and_val hD_mid).1 + rw [h_s18, h_mid] + linarith + rw [h_w_eq] at h_z13_w + have h_3gw : 3 * g_w41 = k + 6 := by dsimp [g_w41, k]; omega + have h6 : ((2 ^ 6 : Nat) : Rat) = 64 := by norm_num + rw [h_3gw, Nat.pow_add, Nat.cast_mul, h6] at h_z13_w + linarith + rcases bound_b_end_digitVal hk hb_top22 hS_w41 hz13_vw hWV_vw + with ⟨A_core', ds_core', hD_core', hlen_core', hA_core', hD_bend⟩ + let da := [Q, K, Q, Q, K, Q, K, K] ++ ds_core' ++ [Q, K] ++ top22 + let u' := V :: (v_head41 ++ v_w41 ++ s12 ++ da) + refine ⟨u', ⟨0, 256 * (b_top22 - 2) + 45, v_head41 ++ v_w41 ++ s12, da, k + 37, 0 + g_w41 + 10, hS_full, hD_bend, rfl⟩, ?_⟩ + -- Prove Good u' + let p_41' := V :: v_w41 + let m' := k + 9 + refine ⟨p_41', ds_core', A_core', m', ?_, ⟨v_w41, rfl⟩, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · dsimp only [u', p_41', da, v_head41, head41] + simp only [List.cons_append, List.nil_append, List.append_assoc] + · dsimp [m']; omega + · dsimp [m']; omega + · have h_m'_4 : m' - 4 = k + 5 := by dsimp [m']; omega + rwa [h_m'_4] + · have h_m'_4 : m' - 4 = k + 5 := by dsimp [m']; omega + rwa [h_m'_4] + · dsimp only [p_41', m', wordScale] + have h_m'_split : k + 9 = k + 1 + 8 := by omega + have h1 : ((2 ^ 1 : Nat) : Rat) = 2 := by norm_num + have h8 : ((2 ^ 8 : Nat) : Rat) = 256 := by norm_num + rw [h_m'_split, Nat.pow_add, Nat.pow_add, Nat.cast_mul, Nat.cast_mul, h1, h8] + linarith + · dsimp only [p_41'] + rw [wordPot_cons_V] + exact hWV_vw + +theorem reach_N (m : Nat) : + ∃ N, m <= N ∧ ∃ u, + multiStep tm (init []) N = some (zCf (evalWords u default)) ∧ + Good u := by + induction m with + | zero => + rcases init_to_u0 with ⟨k1, hk1⟩ + rcases Rounds_exec rounds_0_9 with ⟨k2, hk2⟩ + exact ⟨k1 + k2, Nat.zero_le _, u_9, multiStep_trans_vkq tm _ _ _ k1 k2 hk1 hk2, good_u9⟩ + | succ m ih => + rcases ih with ⟨N, hN, u, h_ms, hG⟩ + rcases Good_step hG with ⟨u', hStep, hG'⟩ + rcases Step_exec hStep with ⟨k, hk_pos, h_step_k⟩ + exact ⟨N + k, Nat.add_le_add hN hk_pos, u', multiStep_trans_vkq tm _ _ _ N k h_ms h_step_k, hG'⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n, hn⟩ + rcases reach_N (n + 1) with ⟨N, hN, _, h_N, _⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := multiStep_add_intermediate_vkq h_N + rw [multiStep_succ_vkq, hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_0RBHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RAHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RAHHH.lean new file mode 100644 index 00000000..6bd55750 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RAHHH.lean @@ -0,0 +1,72 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH + +open Mathlib Relation Nat Turing BusyBeaver SixState +open BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH + +namespace BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RAHHH + + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RAHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +section + +abbrev fCR_1rahhh : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6) := + cfgCR true C B -- CR config for 1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RAHHH + +abbrev fCL_1rahhh : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6) := + cfgCL true D -- CL config for 1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RAHHH + +set_option maxHeartbeats 2000000 in +-- Justification: Symbolic execution of the 15 elementary SegRules for +-- 1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RAHHH. +theorem segRules_1rahhh : SegRules (callStep target fCR_1rahhh fCL_1rahhh) := by + unfold fCR_1rahhh fCL_1rahhh + prove_seg_rules + +theorem step_ca_1rahhh (r : HalfTape) : + (fCL_1rahhh lh r) [target]⊢⁺ (fCR_1rahhh ([1] +> default) .ca r) := by + unfold fCL_1rahhh fCR_1rahhh cfgCL cfgCR callState callWord lh + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_ca for 1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RAHHH + +theorem step_ch_1rahhh (r : HalfTape) : + (fCL_1rahhh ([1] +> default) r) [target]⊢⁺ (fCR_1rahhh lh .ch r) := by + unfold fCL_1rahhh fCR_1rahhh cfgCL cfgCR callState callWord lh + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_ch for 1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RAHHH + +theorem step_init_1rahhh : + (init []) [target]⊢⁺ fCL_1rahhh lh (initTape .kindC) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + unfold fCL_1rahhh initTape cfgCL lh t d1 d0 + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_init for 1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RAHHH + +end + +public section + +theorem is_not_halt : IsNotHalt target := + does_not_halt_of_seg_rules segRules_1rahhh step_ca_1rahhh step_ch_1rahhh .kindC step_init_1rahhh + +end + +end BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RAHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1REHHH.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1REHHH.lean new file mode 100644 index 00000000..9b18308d --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1REHHH.lean @@ -0,0 +1,73 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH + +open Mathlib Relation Nat Turing BusyBeaver SixState +open BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH + +namespace BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1REHHH + + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1REHHH" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +section + +abbrev fCR_1rehhh_c : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6) := + cfgCR true C B -- CR config for 1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1REHHH + +abbrev fCL_1rehhh_c : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6) := + cfgCL true D -- CL config for 1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1REHHH + +set_option maxHeartbeats 2000000 in +-- Justification: Symbolic execution of the 15 elementary SegRules for +-- 1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1REHHH. +theorem segRules_1rehhh_c : SegRules (callStep target fCR_1rehhh_c fCL_1rehhh_c) := by + unfold fCR_1rehhh_c fCL_1rehhh_c + prove_seg_rules + +theorem step_ca_1rehhh_c (r : HalfTape) : + (fCL_1rehhh_c lh r) [target]⊢⁺ (fCR_1rehhh_c ([1] +> default) .ca r) := by + unfold fCL_1rehhh_c fCR_1rehhh_c cfgCL cfgCR callState callWord lh + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_ca for 1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1REHHH + +theorem step_ch_1rehhh_c (r : HalfTape) : + (fCL_1rehhh_c ([1] +> default) r) [target]⊢⁺ (fCR_1rehhh_c lh .ch r) := by + unfold fCL_1rehhh_c fCR_1rehhh_c cfgCL cfgCR callState callWord lh + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_ch for 1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1REHHH + +theorem step_init_1rehhh_c : + (init []) [target]⊢⁺ fCL_1rehhh_c lh (initTape .kindC) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + unfold fCL_1rehhh_c initTape cfgCL lh t d1 d0 + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_init for 1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1REHHH + +end + +public section + +theorem is_not_halt : IsNotHalt target := + does_not_halt_of_seg_rules segRules_1rehhh_c step_ca_1rehhh_c step_ch_1rehhh_c .kindC + step_init_1rehhh_c + +end + +end BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1REHHH diff --git a/BusyBeaver/BB6/NonHalt/M_1RB1RF_1RC1RA_1LD0LA_HHH0LE_0LF1LE_0RA0LC.lean b/BusyBeaver/BB6/NonHalt/M_1RB1RF_1RC1RA_1LD0LA_HHH0LE_0LF1LE_0RA0LC.lean new file mode 100644 index 00000000..0d79f3ed --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RB1RF_1RC1RA_1LD0LA_HHH0LE_0LF1LE_0RA0LC.lean @@ -0,0 +1,3409 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Excursion +public import BusyBeaver.Calculi.Longitudinal + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.M_1RB1RF_1RC1RA_1LD0LA_HHH0LE_0LF1LE_0RA0LC + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1RC1RA_1LD0LA_HHH0LE_0LF1LE_0RA0LC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +end + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] +set_option autoImplicit true +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + +set_option linter.unusedSectionVars false +set_option maxHeartbeats 4000000 +set_option maxRecDepth 200000 +abbrev gQ:=Fin 2 +abbrev ai:=ListBlank (Fin 2) +abbrev aL:=Cfg (Fin 2) (Fin 6) +def sA : Fin 6:=B +def sB : Fin 6:=C +def sC : Fin 6:=D +def sD : Fin 6:=E +def sE : Fin 6:=F +def sF : Fin 6:=A +abbrev tm:=target_tm +@[simp] theorem sr (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config:=rfl +@[simp] theorem n9 (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config:=rfl +@[simp] theorem sn (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +theorem qO {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [M]⊢ c₂) : + c₁ [M]⊢^{1} c₂ := by simp [h] +theorem qC {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m:Nat) : + multiStep M c₁ (n + m) = (multiStep M c₁ n).bind (fun c₂ => multiStep M c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,sn,ih,Option.bind_assoc] + simp_rw [sn] +theorem qT {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c : Cfg Γ Λ) (n:Nat) : + multiStep M c (n + 1) = (step M c).bind (fun c' => multiStep M c' n) := by + rw [Nat.add_comm n 1,qC,n9] +theorem qH {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m:Nat) + (h₁ : c₁ [M]⊢^{n} c₂) (h₂ : c₂ [M]⊢^{m} c₃) : + c₁ [M]⊢^{n + m} c₃ := by + rw [qC,h₁]; simp [h₂] +theorem mm {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {M : Machine Γ Λ} (c : Cfg Γ Λ) : c [M]⊢* c:=⟨0,rfl⟩ +theorem ss {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [M]⊢* c₂) (h₂ : c₂ [M]⊢* c₃) : c₁ [M]⊢* c₃ := by + rcases h₁ with ⟨n,hn⟩; rcases h₂ with ⟨m,hm⟩ + exact ⟨n + m,qH M c₁ c₂ c₃ n m hn hm⟩ +theorem V {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [M]⊢⁺ c₂) : + c₁ [M]⊢* c₂ := by rcases h with ⟨n,_,hn⟩; exact ⟨n,hn⟩ +theorem ee {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [M]⊢⁺ c₂) (h₂ : c₂ [M]⊢* c₃) : c₁ [M]⊢⁺ c₃ := by + rcases h₁ with ⟨n,hn_pos,hn⟩; rcases h₂ with ⟨m,hm⟩ + exact ⟨n + m,by omega,qH M c₁ c₂ c₃ n m hn hm⟩ +theorem kT {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [M]⊢* c₂) (h₂ : c₂ [M]⊢⁺ c₃) : c₁ [M]⊢⁺ c₃ := by + rcases h₁ with ⟨n,hn⟩; rcases h₂ with ⟨m,hm_pos,hm⟩ + exact ⟨n + m,by omega,qH M c₁ c₂ c₃ n m hn hm⟩ +theorem sq {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [M]⊢⁺ c₂) (h₂ : c₂ [M]⊢⁺ c₃) : c₁ [M]⊢⁺ c₃ := + ee h₁ (V h₂) +@[simp] theorem oR : (0 : Fin 2)>>default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem kX : (default : ListBlank (Fin 2)).head = 0:=rfl +@[simp] theorem k5 : (default : ListBlank (Fin 2)).tail = default:=rfl +@[simp] theorem append_nil (s : ListBlank (Fin 2)) : ([] : List (Fin 2))+>s = s:=rfl +@[simp] theorem append_cons (a : Fin 2) (l : List (Fin 2)) (s : ListBlank (Fin 2)) : + (a :: l)+>s = a>>(l+>s):=rfl +@[simp] theorem append_assoc (l1 l2 : List (Fin 2)) (s : ListBlank (Fin 2)) : + (l1++l2)+>s = l1+>(l2+>s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp [ih] +theorem qZ {w : List (Fin 2)} (h : BusyBeaver.Longitudinal.BoundedConfig.all0 w = true) : + w+>default = default := + BusyBeaver.Longitudinal.BoundedConfig.all0_spec h +theorem x3 (b : Fin 2) : b = 0∨b = 1 := by + rcases b with ⟨_ | ⟨_ | n⟩,hlt⟩ + · left; rfl + · right; rfl + · omega +theorem dW (r:ai) : (∃ r',r = [0]+>r')∨(∃ r',r = [1]+>r') := by + have h : r.head>>r.tail = r:=Turing.ListBlank.cons_head_tail r + rcases x3 r.head with h0 | h1 + · left; refine ⟨r.tail,?_⟩; rw [append_cons,append_nil,← h0,h] + · right; refine ⟨r.tail,?_⟩; rw [append_cons,append_nil,← h1,h] +def bf (l:ai) (w : List gQ) : ai:=w.reverse+>l +def FR (l r:ai) : aL:=l {{sF}}> r +def DL (l r:ai) : aL:=l <{{sD}} r +def FL (l r:ai) : aL:=l <{{sF}} r +def BL (l r:ai) : aL:=l <{{sB}} r +def CE (r:ai) : aL:=default {{sE}}> ([0,0]+>r) +def wL : List gQ:=[1,1,0] +def wX : List gQ:=[1,1,0,1,1,0] +def wY : List gQ:=[1,1,1,1] +def wa : List gQ:=[1,1,1,0,1,0] +def wb : List gQ:=[1,0,1,0] +@[simp] theorem Hw (l:ai) : bf l [] = l:=rfl +theorem df (l:ai) (u v : List gQ) : bf l (u++v) = bf (bf l u) v := by + simp [bf,List.reverse_append,append_assoc] +structure pv where + past : List gQ + front : List gQ + state : Fin 6 + left_head : Bool +deriving DecidableEq +def pv.toBC (x:pv) : BusyBeaver.Longitudinal.BoundedConfig.BCfg gQ (Fin 6) := + match x.left_head with + | true => ⟨x.front, x.past, x.state, .left⟩ + | false => ⟨x.past, x.front, x.state, .right⟩ +def pv.ofBC (x : BusyBeaver.Longitudinal.BoundedConfig.BCfg gQ (Fin 6)) : pv := + match x.sgn with + | .left => ⟨x.r, x.l, x.s, true⟩ + | .right => ⟨x.l, x.r, x.s, false⟩ +theorem pv_toBC_ofBC (x : BusyBeaver.Longitudinal.BoundedConfig.BCfg gQ (Fin 6)) : + (pv.ofBC x).toBC = x := by + rcases x with ⟨l, r, s, _ | _⟩ <;> rfl +def go (x:pv) (l r:ai) : aL := + BusyBeaver.Longitudinal.BoundedConfig.toCfg x.toBC l r +def qj (x:pv) : Option pv := + (BusyBeaver.Longitudinal.BoundedConfig.step tm x.toBC).map pv.ofBC +theorem yc {x y : pv} (h : qj x = some y) (l r:ai) : + (go x l r) [tm]⊢ (go y l r) := by + rcases Option.map_eq_some_iff.mp h with ⟨b, hb, rfl⟩ + simpa only [go, pv_toBC_ofBC] using + BusyBeaver.Longitudinal.BoundedConfig.step_spec tm x.toBC hb l r +def wd : Nat→pv→Option pv + | 0,x => some x + | n + 1,x => + match qj x with + | none => none + | some z => wd n z +theorem yP {n : Nat} {x y : pv} (h : wd n x = some y) (l r:ai) : + (go x l r) [tm]⊢^{n} (go y l r) := by + induction n generalizing x with + | zero => injection h with hy; subst hy; rfl + | succ n ih => + unfold wd at h + rcases hs : qj x with _ | z + · rw [hs] at h; contradiction + · rw [hs] at h + rw [Nat.add_comm n 1] + exact qH tm _ _ _ 1 n (qO tm _ _ (yc hs l r)) (ih h) +theorem U (n:Nat) (x y:pv) (h : wd (n + 1) x = some y) (l r:ai) : + (go x l r) [tm]⊢⁺ (go y l r) := + ⟨n + 1,Nat.succ_pos n,yP h l r⟩ +theorem r2 (l r:ai) : (FR l ([0,0,0]+>r)) [tm]⊢⁺ (DL l ([1,0,1]+>r)) := + U 4 ⟨[],[0,0,0],sF,false⟩ ⟨[],[1,0,1],sD,true⟩ (by decide) l r +theorem r4 (l r:ai) : (FR l ([0,0,1]+>r)) [tm]⊢⁺ (FR (bf l wL) r) := + U 4 ⟨[],[0,0,1],sF,false⟩ ⟨wL.reverse,[],sF,false⟩ (by decide) l r +theorem xH (l r:ai) : (FR l ([0,1]+>r)) [tm]⊢⁺ (FR (bf l [1,1]) r) := + U 1 ⟨[],[0,1],sF,false⟩ ⟨[1,1],[],sF,false⟩ (by decide) l r +theorem vf (l r:ai) : (FR l ([1,0]+>r)) [tm]⊢⁺ (FR (bf l [1,0]) r) := + U 1 ⟨[],[1,0],sF,false⟩ ⟨[0,1],[],sF,false⟩ (by decide) l r +theorem vv (l r:ai) : (FR l ([1,1]+>r)) [tm]⊢⁺ (FL l ([0,0]+>r)) := + U 2 ⟨[],[1,1],sF,false⟩ ⟨[],[0,0],sF,true⟩ (by decide) l r +theorem Av (l r:ai) : (DL (bf l [1]) r) [tm]⊢⁺ (DL l ([1]+>r)) := + U 0 ⟨[1],[],sD,true⟩ ⟨[],[1],sD,true⟩ (by decide) l r +theorem xL (l r:ai) : (DL (bf l [1,0]) r) [tm]⊢⁺ (BL l ([0,0]+>r)) := + U 1 ⟨[0,1],[],sD,true⟩ ⟨[],[0,0],sB,true⟩ (by decide) l r +theorem EJ (l r:ai) : (BL (bf l [1]) ([0,0]+>r)) [tm]⊢⁺ (FL l ([0,0,0]+>r)) := + U 0 ⟨[1],[0,0],sB,true⟩ ⟨[],[0,0,0],sF,true⟩ (by decide) l r +theorem xV (l r:ai) : (BL (bf l [1,0]) ([0,0]+>r)) [tm]⊢⁺ (DL l ([0,1,0,0]+>r)) := + U 1 ⟨[0,1],[0,0],sB,true⟩ ⟨[],[0,1,0,0],sD,true⟩ (by decide) l r +theorem E6 (l r:ai) : (FL (bf l [1]) ([0,0]+>r)) [tm]⊢⁺ (FR (bf l [1,0]) ([0]+>r)) := + U 1 ⟨[1],[0,0],sF,true⟩ ⟨[0,1],[0],sF,false⟩ (by decide) l r +theorem xZ (l r:ai) : (FL (bf l [1,0]) ([0,0]+>r)) [tm]⊢⁺ (DL (bf l [1]) ([1,0,1]+>r)) := + U 4 ⟨[0,1],[0,0],sF,true⟩ ⟨[1],[1,0,1],sD,true⟩ (by decide) l r +abbrev d7 (c:aL) (n:Nat) : Prop := + BusyBeaver.Excursion.HaltsIn tm c n +abbrev cE (c:aL) (P : aL→Prop) : Prop := + BusyBeaver.Excursion.Leads tm c P +abbrev fl (c:aL) (P : aL→Prop) : Prop := + BusyBeaver.Excursion.Advances tm c P +theorem uM {c d : aL} {n : Nat} (hr : c [tm]⊢* d) (hh : d7 c n) : + ∃ m ≤ n,d7 d m := + BusyBeaver.Excursion.haltsIn_reduce_stepStar hr hh +theorem kz {c d : aL} {n : Nat} (hr : c [tm]⊢⁺ d) (hh : d7 c n) : + ∃ m < n,d7 d m := + BusyBeaver.Excursion.haltsIn_reduce_stepPlus hr hh +theorem dg {c : aL} {P : aL→Prop} (hp : P c) : cE c P := + BusyBeaver.Excursion.Leads.here hp +theorem bn {c d : aL} {P : aL→Prop} (hr : c [tm]⊢* d) (hp : P d) : cE c P := + BusyBeaver.Excursion.Leads.of_stepStar hr hp +theorem bh {c : aL} {P Q : aL→Prop} (h1 : cE c P) (h2 : ∀ d,P d→cE d Q) : + cE c Q := + BusyBeaver.Excursion.Leads.trans h1 h2 +theorem x7 {c : aL} {P Q : aL→Prop} (h : cE c P) (hinc : ∀ d,P d→Q d) : + cE c Q := + BusyBeaver.Excursion.Leads.mono h hinc +theorem yb {c : aL} {P : aL→Prop} (h : fl c P) : cE c P := + BusyBeaver.Excursion.Advances.to_leads h +theorem cr {c d : aL} {P : aL→Prop} (hr : c [tm]⊢⁺ d) (h : cE d P) : + fl c P := + BusyBeaver.Excursion.Advances.of_stepPlus_leads hr h +theorem cc {c d : aL} {P : aL→Prop} (hr : c [tm]⊢⁺ d) (h : cE d P) : + cE c P := + BusyBeaver.Excursion.Leads.of_stepPlus_leads hr h +theorem sv {c : aL} {P Q : aL→Prop} (h1 : fl c P) (h2 : ∀ d,P d→cE d Q) : + fl c Q := + BusyBeaver.Excursion.Advances.trans h1 h2 +theorem q3 {P : aL→Prop} (h : ∀ c,P c→fl c P) : + ∀ n c,P c→¬ d7 c n := + BusyBeaver.Excursion.not_haltsIn_of_advances h +inductive BA where + | GoRight | FromD | FromF | FromB +def se (b:Bool) : List gQ:=if b then [1,0] else [1] +def bJ (l:ai) : List Bool→ai + | [] => l + | b :: s => bf (bJ l s) (se b) +def aq (l:ai) (s : List Bool) (e:BA) (r:ai) : aL := + match e with + | .GoRight => FR (bJ l s) r + | .FromD => DL (bJ l s) r + | .FromF => FL (bJ l s) ([0,0]+>r) + | .FromB => BL (bJ l s) ([0,0]+>r) +inductive ip (l:ai) : aL→Prop where + | contact_D (r:ai) : ip l (DL l r) + | contact_F (r:ai) : ip l (FL l ([0,0]+>r)) + | contact_B (r:ai) : ip l (BL l ([0,0]+>r)) +theorem el {c d : aL} {P : aL→Prop} {n : Nat} + (hr : c [tm]⊢⁺ d) + (ih : ∀ m < n,d7 d m→∃ k e,k ≤ m∧P e∧d7 e k) + (hh : d7 c n) : ∃ k e,k ≤ n∧P e∧d7 e k := by + rcases kz hr hh with ⟨m,hmn,hm⟩ + rcases ih m hmn hm with ⟨k,e,hkm,hp,hk⟩ + exact ⟨k,e,by omega,hp,hk⟩ +theorem ux (n:Nat) : + ∀ (l:ai) (s : List Bool) (e:BA) (r:ai), + d7 (aq l s e r) n → + ∃ k c,k ≤ n∧ip l c∧d7 c k := by + induction n using Nat.strong_induction_on with + | h n ih => + intro l s e r hhalt + cases e with + | GoRight => + rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · have hr : (aq l s .GoRight ([0]+>([0]+>([0]+>r)))) [tm]⊢⁺ (aq l s .FromD ([1,0,1]+>r)) := by + simpa only [aq,← append_assoc] using! r2 (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l s .FromD ([1,0,1]+>r) hm) hhalt + · have hr : (aq l s .GoRight ([0]+>([0]+>([1]+>r)))) [tm]⊢⁺ (aq l (true :: false :: s) .GoRight r) := by + simpa only [aq,bJ,se,df,← append_assoc] using! r4 (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l (true :: false :: s) .GoRight r hm) hhalt + · have hr : (aq l s .GoRight ([0]+>([1]+>r))) [tm]⊢⁺ (aq l (false :: false :: s) .GoRight r) := by + simpa only [aq,bJ,se,df,← append_assoc] using! xH (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l (false :: false :: s) .GoRight r hm) hhalt + · rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · have hr : (aq l s .GoRight ([1]+>([0]+>r))) [tm]⊢⁺ (aq l (true :: s) .GoRight r) := by + simpa only [aq,bJ,se,df,← append_assoc] using! vf (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l (true :: s) .GoRight r hm) hhalt + · have hr : (aq l s .GoRight ([1]+>([1]+>r))) [tm]⊢⁺ (aq l s .FromF r) := by + simpa only [aq,← append_assoc] using! vv (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l s .FromF r hm) hhalt + | FromD => + cases s with + | nil => exact ⟨n,DL l r,le_rfl,.contact_D r,hhalt⟩ + | cons b s => + cases b + · have hr : (aq l (false :: s) .FromD r) [tm]⊢⁺ (aq l s .FromD ([1]+>r)) := + Av (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l s .FromD ([1]+>r) hm) hhalt + · have hr : (aq l (true :: s) .FromD r) [tm]⊢⁺ (aq l s .FromB r) := + xL (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l s .FromB r hm) hhalt + | FromF => + cases s with + | nil => exact ⟨n,FL l ([0,0]+>r),le_rfl,.contact_F r,hhalt⟩ + | cons b s => + cases b + · have hr : (aq l (false :: s) .FromF r) [tm]⊢⁺ (aq l (true :: s) .GoRight ([0]+>r)) := + E6 (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l (true :: s) .GoRight ([0]+>r) hm) hhalt + · have hr : (aq l (true :: s) .FromF r) [tm]⊢⁺ (aq l (false :: s) .FromD ([1,0,1]+>r)) := + xZ (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l (false :: s) .FromD ([1,0,1]+>r) hm) hhalt + | FromB => + cases s with + | nil => exact ⟨n,BL l ([0,0]+>r),le_rfl,.contact_B r,hhalt⟩ + | cons b s => + cases b + · have hr : (aq l (false :: s) .FromB r) [tm]⊢⁺ (aq l s .FromF ([0]+>r)) := by + simpa only [aq,← append_assoc] using! EJ (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l s .FromF ([0]+>r) hm) hhalt + · have hr : (aq l (true :: s) .FromB r) [tm]⊢⁺ (aq l s .FromD ([0,1,0,0]+>r)) := + xV (bJ l s) r + exact el hr (fun m hmn hm => ih m hmn l s .FromD ([0,1,0,0]+>r) hm) hhalt +theorem fv (l r:ai) : cE (FR l r) (ip l) := + fun n hn => ux n l [] .GoRight r hn +theorem jC (l:ai) (s : List Bool) (e:BA) (r:ai) : + cE (aq l s e r) (ip l) := + fun n hn => ux n l s e r hn +theorem pH (l r:ai) : fl (FR l r) (ip l) := by + rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · refine cr ?_ (dg (.contact_D ([1,0,1]+>r))) + simpa only [← append_assoc] using! r2 l r + · refine cr ?_ (jC l [true,false] .GoRight r) + simpa only [aq,bJ,se,df,← append_assoc] using! r4 l r + · refine cr ?_ (jC l [false,false] .GoRight r) + simpa only [aq,bJ,se,df,← append_assoc] using! xH l r + · rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · refine cr ?_ (jC l [true] .GoRight r) + simpa only [aq,bJ,se,df,← append_assoc] using! vf l r + · refine cr ?_ (dg (.contact_F r)) + simpa only [← append_assoc] using! vv l r +inductive gw (l:ai) : aL→Prop where + | weak_D (r:ai) : gw l (DL l r) + | weak_F (r:ai) : gw l (FL l ([0,0,0]+>r)) +inductive dU (l:ai) : aL→Prop where + | strong_D (r:ai) : dU l (DL l (wa+>r)) + | strong_F (r:ai) : dU l (FL l ([0,0,0]+>(wa+>r))) +theorem GZ (l r:ai) : (DL (bf l wL) r) [tm]⊢⁺ (FL l ([0,0,0]+>r)) := + U 2 ⟨wL.reverse,[],sD,true⟩ ⟨[],[0,0,0],sF,true⟩ (by decide) l r +theorem Ha (l r:ai) : (FL (bf l wL) ([0,0]+>r)) [tm]⊢⁺ (DL l ([1,1,1,0,1]+>r)) := + U 6 ⟨wL.reverse,[0,0],sF,true⟩ ⟨[],[1,1,1,0,1],sD,true⟩ (by decide) l r +theorem GX (l r:ai) : (BL (bf l wL) ([0,0]+>r)) [tm]⊢⁺ (DL l ([1,0,1,0,0]+>r)) := + U 2 ⟨wL.reverse,[0,0],sB,true⟩ ⟨[],[1,0,1,0,0],sD,true⟩ (by decide) l r +theorem Gn (l r:ai) : (DL (bf l [1,1]) r) [tm]⊢⁺ (DL l ([1,1]+>r)) := + U 1 ⟨[1,1],[],sD,true⟩ ⟨[],[1,1],sD,true⟩ (by decide) l r +theorem Gm (l r:ai) : (FL (bf l [1,1]) ([0,0]+>r)) [tm]⊢⁺ (FR (bf l wL) ([0]+>r)) := + U 1 ⟨[1,1],[0,0],sF,true⟩ ⟨wL.reverse,[0],sF,false⟩ (by decide) l r +theorem Hm (l r:ai) : (BL (bf l [1,1]) ([0,0]+>r)) [tm]⊢⁺ (FR (bf l [1,0]) ([0,0]+>r)) := + U 2 ⟨[1,1],[0,0],sB,true⟩ ⟨[0,1],[0,0],sF,false⟩ (by decide) l r +theorem G6 (l r:ai) : (DL (bf l wX) r) [tm]⊢⁺ (DL l (wa+>r)) := + U 9 ⟨wX.reverse,[],sD,true⟩ ⟨[],wa,sD,true⟩ (by decide) l r +theorem Dx (l r:ai) : (FL (bf l wX) ([0,0,0]+>r)) [tm]⊢⁺ (FL l ([0,0,0]+>(wa+>r))) := by + simpa only [append_assoc] using! + U 9 ⟨wX.reverse,[0,0,0],sF,true⟩ ⟨[],[0,0,0]++wa,sF,true⟩ (by decide) l r +theorem rW (l:ai) (c:aL) (h : ip (bf l wL) c) : cE c (gw l) := by + cases h with + | contact_D r => exact bn (V (GZ l r)) (.weak_F r) + | contact_F r => exact bn (V (Ha l r)) (.weak_D ([1,1,1,0,1]+>r)) + | contact_B r => exact bn (V (GX l r)) (.weak_D ([1,0,1,0,0]+>r)) +theorem yY (l r:ai) : cE (FR (bf l wL) r) (gw l) := + bh (fv (bf l wL) r) (rW l) +def lu (w : List gQ) : Prop := + ∀ l c,gw (bf l w) c→cE c (gw l) +theorem Bn : lu wL := by + intro l c h + cases h with + | weak_D r => exact rW l _ (.contact_D r) + | weak_F r => + have hc : ip (bf l wL) (FL (bf l wL) ([0,0]+>([0]+>r))):=.contact_F ([0]+>r) + simpa only [← append_assoc] using! rW l _ hc +theorem AS : lu [1,1] := by + intro l c h + cases h with + | weak_D r => exact bn (V (Gn l r)) (.weak_D ([1,1]+>r)) + | weak_F r => + have hf : (FL (bf l [1,1]) ([0,0,0]+>r)) [tm]⊢⁺ (FR (bf l wL) ([0]+>([0]+>r))) := by + simpa only [← append_assoc] using! Gm l ([0]+>r) + exact cc hf (yY l ([0]+>([0]+>r))) +theorem yX {u v : List gQ} (hu : lu u) (hv : lu v) : + lu (u++v) := by + intro l c hc + rw [df] at hc + exact bh (hv (bf l u) c hc) (hu l) +inductive b9 where + | PL | P11 +deriving DecidableEq +def x0 : b9→List gQ + | .PL => wL + | .P11 => [1,1] +def hE : List b9→List gQ + | [] => [] + | p :: ps => x0 p++hE ps +theorem xg (ps : List b9) : lu (hE ps) := by + induction ps with + | nil => intro l c h; exact dg h + | cons p ps ih => + unfold hE + refine yX ?_ ih + cases p + · exact Bn + · exact AS +theorem DZ (l:ai) (c:aL) (h : gw (bf l wX) c) : + cE c (dU l) := by + cases h with + | weak_D r => exact bn (V (G6 l r)) (.strong_D r) + | weak_F r => exact bn (V (Dx l r)) (.strong_F r) +def b5 (ps : List b9) : List gQ := + (wX++hE ps)++wL +theorem lI (ps : List b9) (l:ai) (c:aL) + (h : ip (bf l (b5 ps)) c) : cE c (dU l) := by + unfold b5 at h + rw [df,df] at h + refine bh (rW (bf (bf l wX) (hE ps)) c h) ?_ + intro d hd + refine bh (xg ps (bf l wX) d hd) ?_ + intro e he + exact DZ l e he +theorem r8 (ps : List b9) (l r:ai) : + cE (FR (bf l (b5 ps)) r) (dU l) := + bh (fv (bf l (b5 ps)) r) (lI ps l) +inductive dA (l:ai) : aL→Prop where + | phase_D (r:ai) : dA l (DL l r) + | phase_F (r:ai) : dA l (FL l ([0,0,0]+>r)) + | phase_B101 (r:ai) : dA l (BL l ([0,0,1,0,1]+>r)) + | phase_B11101 (r:ai) : dA l (BL l ([0,0,1,1,1,0,1]+>r)) +theorem x5 (l:ai) (c:aL) (h : gw l c) : dA l c := by + cases h with + | weak_D r => exact .phase_D r + | weak_F r => exact .phase_F r +theorem «GL» (l r:ai) : (DL (bf l ([1,0]++wL)) r) [tm]⊢⁺ (DL l ([1,1,0,1,0]+>r)) := + U 8 ⟨(([1,0] : List gQ)++wL).reverse,[],sD,true⟩ ⟨[],[1,1,0,1,0],sD,true⟩ (by decide) l r +theorem GH (l r:ai) : (FL (bf l ([1,0]++wL)) ([0,0]+>r)) [tm]⊢⁺ (BL l ([0,0,1,1,1,0,1]+>r)) := + U 8 ⟨(([1,0] : List gQ)++wL).reverse,[0,0],sF,true⟩ ⟨[],[0,0,1,1,1,0,1],sB,true⟩ (by decide) l r +theorem Gr (l r:ai) : (BL (bf l ([1,0]++wL)) ([0,0]+>r)) [tm]⊢⁺ (BL l ([0,0,1,0,1,0,0]+>r)) := + U 4 ⟨(([1,0] : List gQ)++wL).reverse,[0,0],sB,true⟩ ⟨[],[0,0,1,0,1,0,0],sB,true⟩ (by decide) l r +theorem CI (l r:ai) : cE (FR (bf l ([1,0]++wL)) r) (dA l) := by + refine bh (fv (bf l ([1,0]++wL)) r) ?_ + intro c h + cases h with + | contact_D r0 => exact bn (V («GL» l r0)) (.phase_D ([1,1,0,1,0]+>r0)) + | contact_F r0 => exact bn (V (GH l r0)) (.phase_B11101 r0) + | contact_B r0 => + have hp : dA l (BL l ([0,0,1,0,1,0,0]+>r0)) := by + simpa only [← append_assoc] using! dA.phase_B101 ([0,0]+>r0) + exact bn (V (Gr l r0)) hp +theorem A9 (l r:ai) : (FR (bf l [1,0]) ([0,0,0]+>r)) [tm]⊢⁺ (BL l ([0,0,1,0,1]+>r)) := + U 6 ⟨[0,1],[0,0,0],sF,false⟩ ⟨[],[0,0,1,0,1],sB,true⟩ (by decide) l r +theorem AT (l r:ai) : (FR (bf l [1,0]) ([0,0,1]+>r)) [tm]⊢⁺ (FR (bf l ([1,0]++wL)) r) := + U 4 ⟨[0,1],[0,0,1],sF,false⟩ ⟨(([1,0] : List gQ)++wL).reverse,[],sF,false⟩ (by decide) l r +theorem Bl (l r:ai) : cE (FR (bf l [1,0]) ([0,0]+>r)) (dA l) := by + rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · have hr : (FR (bf l [1,0]) ([0,0]+>([0]+>r))) [tm]⊢⁺ (BL l ([0,0,1,0,1]+>r)) := by + simpa only [← append_assoc] using! A9 l r + exact bn (V hr) (.phase_B101 r) + · have hr : (FR (bf l [1,0]) ([0,0]+>([1]+>r))) [tm]⊢⁺ (FR (bf l ([1,0]++wL)) r) := by + simpa only [← append_assoc] using! AT l r + exact cc hr (CI l r) +theorem x9 (l r:ai) : cE (FR (bf l [1,1]) r) (dA l) := by + refine bh (fv (bf l [1,1]) r) ?_ + intro c h + cases h with + | contact_D r0 => exact bn (V (Gn l r0)) (.phase_D ([1,1]+>r0)) + | contact_F r0 => exact cc (Gm l r0) (x7 (yY l ([0]+>r0)) (x5 l)) + | contact_B r0 => exact cc (Hm l r0) (Bl l r0) +theorem uR (l r:ai) : cE (FR l ([0]+>r)) (dA l) := by + rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · have hr : (FR l ([0]+>([0]+>([0]+>r)))) [tm]⊢⁺ (DL l ([1,0,1]+>r)) := by + simpa only [← append_assoc] using! r2 l r + exact bn (V hr) (.phase_D ([1,0,1]+>r)) + · have hr : (FR l ([0]+>([0]+>([1]+>r)))) [tm]⊢⁺ (FR (bf l wL) r) := by + simpa only [← append_assoc] using! r4 l r + exact cc hr (x7 (yY l r) (x5 l)) + · have hr : (FR l ([0]+>([1]+>r))) [tm]⊢⁺ (FR (bf l [1,1]) r) := by + simpa only [← append_assoc] using! xH l r + exact cc hr (x9 l r) +inductive W where + | UA | UT +deriving DecidableEq +inductive cm where + | CD | CF +deriving DecidableEq +def za : W→List gQ + | .UA => wa + | .UT => wY++wa +def yT : W→List gQ + | .UA => wa + | .UT => wa++wb +def G1 : W→List gQ + | .UA => wX + | .UT => wX++wY +def HD : List W→List gQ + | [] => [] + | u :: us => za u++HD us +def HF : List W→List gQ + | [] => [] + | u :: us => yT u++HF us +def G : List W→List gQ + | [] => [] + | u :: us => G1 u++G us +@[simp] theorem Cg (u:W) (us : List W) : HD (u :: us) = za u++HD us:=rfl +@[simp] theorem CB (u:W) (us : List W) : HF (u :: us) = yT u++HF us:=rfl +def lX : cm→List gQ + | .CD => [] + | .CF => wY +def oa (d:cm) (us : List W) : List gQ := + match d with + | .CD => HD us + | .CF => wb++HF us +def hF (d:cm) (us : List W) (r:ai) : aL := + CE (oa d us+>r) +def lr (c:aL) : Prop := + ∃ d us r,3 ≤ us.length∧c = hF d us r +def cn (d:cm) (us : List W) : ai := + bf default ([0]++lX d++G us) +theorem F0 (us vs : List W) : HD (us++vs) = HD us++HD vs := by + induction us with + | nil => rfl + | cons u us ih => simp [HD,ih,List.append_assoc] +theorem F7 (us vs : List W) : HF (us++vs) = HF us++HF vs := by + induction us with + | nil => rfl + | cons u us ih => simp [HF,ih,List.append_assoc] +theorem Gt (us vs : List W) : G (us++vs) = G us++G vs := by + induction us with + | nil => rfl + | cons u us ih => simp [G,ih,List.append_assoc] +theorem D4 (u:W) (l r:ai) : + (FR l ([0]+>(za u+>r))) [tm]⊢⁺ (FR (bf l (G1 u)) ([0]+>r)) := by + cases u + · simpa only [za,G1,append_assoc] using! + U 11 ⟨[],[0]++wa,sF,false⟩ ⟨wX.reverse,[0],sF,false⟩ (by decide) l r + · simpa only [za,G1,append_assoc] using! + U 17 ⟨[],[0]++(wY++wa),sF,false⟩ ⟨(wX++wY).reverse,[0],sF,false⟩ (by decide) l r +theorem DW (u:W) (l r:ai) : + (FR l ([0]+>(yT u+>r))) [tm]⊢⁺ (FR (bf l (G1 u)) ([0]+>r)) := by + cases u + · simpa only [yT,G1,append_assoc] using! + U 11 ⟨[],[0]++wa,sF,false⟩ ⟨wX.reverse,[0],sF,false⟩ (by decide) l r + · simpa only [yT,G1,append_assoc] using! + U 15 ⟨[],[0]++(wa++wb),sF,false⟩ ⟨(wX++wY).reverse,[0],sF,false⟩ (by decide) l r +theorem FV (l r:ai) : + (FR l ([0]+>(wb+>r))) [tm]⊢⁺ (FR (bf l wY) ([0]+>r)) := by + simpa only [append_assoc] using! + U 3 ⟨[],[0]++wb,sF,false⟩ ⟨wY.reverse,[0],sF,false⟩ (by decide) l r +theorem EP (us : List W) (l r:ai) : + (FR l ([0]+>(HD us+>r))) [tm]⊢* (FR (bf l (G us)) ([0]+>r)) := by + induction us generalizing l r with + | nil => exact mm _ + | cons u us ih => + unfold HD G + rw [append_assoc,df] + exact V (ee (D4 u l (HD us+>r)) (ih (bf l (G1 u)) r)) +theorem Ff (us : List W) (l r:ai) : + (FR l ([0]+>(HF us+>r))) [tm]⊢* (FR (bf l (G us)) ([0]+>r)) := by + induction us generalizing l r with + | nil => exact mm _ + | cons u us ih => + unfold HF G + rw [append_assoc,df] + exact V (ee (DW u l (HF us+>r)) (ih (bf l (G1 u)) r)) +theorem Fg (r:ai) : (CE r) [tm]⊢⁺ (FR (bf default [0]) ([0]+>r)) := by + refine ⟨1,by decide,?_⟩ + have hstep : target 5 0 = some (some 0, Stmt.write 0 Dir.right) := rfl + simp only [CE,FR,bf,List.reverse_singleton,n9,step,append_cons,append_nil, + Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,kX,k5,tm,target_tm,sE,sF,F,A,Option.map,Tape.write,Tape.move,hstep] +theorem tj (d:cm) (us : List W) (r:ai) : + (hF d us r) [tm]⊢⁺ (FR (cn d us) ([0]+>r)) := by + unfold hF + refine ee (Fg (oa d us+>r)) ?_ + cases d + · unfold oa cn lX + simp only [List.append_nil,df] + exact EP us (bf default [0]) r + · unfold oa cn lX + rw [append_assoc,df,df] + exact V (ee (FV (bf default [0]) (HF us+>r)) (Ff us (bf (bf default [0]) wY) r)) +theorem Hh (u:W) (l r:ai) : + (DL (bf l (G1 u)) (wa+>r)) [tm]⊢⁺ (DL l (wa+>(za u+>r))) := by + cases u + · simpa only [G1,za,append_assoc] using! + U 9 ⟨wX.reverse,wa,sD,true⟩ ⟨[],wa++wa,sD,true⟩ (by decide) l r + · simpa only [G1,za,append_assoc] using! + U 13 ⟨(wX++wY).reverse,wa,sD,true⟩ ⟨[],wa++(wY++wa),sD,true⟩ (by decide) l r +theorem Hf (u:W) (l r:ai) : + (FL (bf l (G1 u)) ([0,0,0]+>(wa+>r))) [tm]⊢⁺ (FL l ([0,0,0]+>(wa+>(yT u+>r)))) := by + cases u + · simpa only [G1,yT,append_assoc] using! + U 9 ⟨wX.reverse,[0,0,0]++wa,sF,true⟩ ⟨[],[0,0,0]++wa++wa,sF,true⟩ (by decide) l r + · simpa only [G1,yT,append_assoc] using! + U 49 ⟨(wX++wY).reverse,[0,0,0]++wa,sF,true⟩ ⟨[],[0,0,0]++wa++(wa++wb),sF,true⟩ (by decide) l r +theorem Ii (us : List W) (l r:ai) : + (DL (bf l (G us)) (wa+>r)) [tm]⊢* (DL l (wa+>(HD us+>r))) := by + induction us generalizing l r with + | nil => exact mm _ + | cons u us ih => + unfold G HD + rw [df,append_assoc] + exact ss (ih (bf l (G1 u)) r) (V (Hh u l (HD us+>r))) +theorem HT (us : List W) (l r:ai) : + (FL (bf l (G us)) ([0,0,0]+>(wa+>r))) [tm]⊢* (FL l ([0,0,0]+>(wa+>(HF us+>r)))) := by + induction us generalizing l r with + | nil => exact mm _ + | cons u us ih => + unfold G HF + rw [df,append_assoc] + exact ss (ih (bf l (G1 u)) r) (V (Hf u l (HF us+>r))) +theorem HO (l r:ai) : (DL (bf l wY) (wa+>r)) [tm]⊢⁺ (DL l (wY+>(wa+>r))) := by + simpa only [append_assoc] using! + U 3 ⟨wY.reverse,wa,sD,true⟩ ⟨[],wY++wa,sD,true⟩ (by decide) l r +theorem Ia (l r:ai) : + (FL (bf l wY) ([0,0,0]+>(wa+>r))) [tm]⊢⁺ (FL l ([0,0,0]+>(wa+>(wb+>r)))) := by + simpa only [append_assoc] using! + U 39 ⟨wY.reverse,[0,0,0]++wa,sF,true⟩ ⟨[],[0,0,0]++wa++wb,sF,true⟩ (by decide) l r +theorem B3 (r:ai) : (DL (bf default [0]) r) [tm]⊢⁺ (CE r) := by + refine ⟨1,by decide,?_⟩ + have hstep : target 4 0 = some (some 5, Stmt.write 0 Dir.left) := rfl + simp only [DL,CE,bf,List.reverse_singleton,n9,step,append_cons,append_nil, + Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,kX,k5,tm,target_tm,sD,sE,E,F,Option.map,Tape.write,Tape.move,hstep] +structure f3 where + past : List gQ + front : List gQ + state : Fin 6 +deriving DecidableEq +def dw (x:f3) (r:ai) : aL := + ⟨some x.state,⟨(x.front+>r).head,x.past+>default,(x.front+>r).tail⟩⟩ +def mr (x:f3) : Option f3 := + match x.front with + | [] => none + | b :: bs => + match tm x.state b with + | none => none + | some (none,_) => none + | some (some s',Stmt.write v .right) => some ⟨v :: x.past,bs,s'⟩ + | some (some s',Stmt.write v .left) => + match x.past with + | [] => some ⟨[],0 :: v :: bs,s'⟩ + | a :: ls => some ⟨ls,a :: v :: bs,s'⟩ +def AL : Nat→f3→Option f3 + | 0,x => some x + | n + 1,x => + match mr x with + | none => none + | some y => AL n y +theorem vX {x y : f3} (h : mr x = some y) (r:ai) : + (dw x r) [tm]⊢ (dw y r) := by + rcases x with ⟨ls,fs,s⟩ + cases fs with + | nil => contradiction + | cons b bs => + unfold mr at h; dsimp only at h + rcases htm : tm s b with _ | ⟨q',st⟩ + · rw [htm] at h; contradiction + · rw [htm] at h + rcases q' with _ | s' + · contradiction + · rcases st with ⟨v,d⟩ + cases d + · cases ls with + | nil => + injection h with hy; subst hy + unfold dw; dsimp only [append_cons,append_nil] + simp only [step,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,kX,k5,htm,Option.map,Tape.write,Tape.move] + | cons a ls => + injection h with hy; subst hy + unfold dw; dsimp only [append_cons] + simp only [step,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,htm,Option.map,Tape.write,Tape.move] + · injection h with hy; subst hy + unfold dw; dsimp only [append_cons] + simp only [step,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,htm,Option.map,Tape.write,Tape.move] +theorem Db {n : Nat} {x y : f3} (h : AL n x = some y) (r:ai) : + (dw x r) [tm]⊢^{n} (dw y r) := by + induction n generalizing x with + | zero => injection h with hy; subst hy; rfl + | succ n ih => + unfold AL at h + rcases hs : mr x with _ | z + · rw [hs] at h; contradiction + · rw [hs] at h + rw [Nat.add_comm n 1] + exact qH tm _ _ _ 1 n (qO tm _ _ (vX hs r)) (ih h) +theorem vK {n : Nat} {x y : f3} (h : AL (n + 1) x = some y) (r:ai) : + (dw x r) [tm]⊢⁺ (dw y r) := + ⟨n + 1,Nat.succ_pos n,Db h r⟩ +def r3 : List gQ→List gQ + | [] => [] + | b :: ls => + match r3 ls with + | [] => if b==0 then [] else [b] + | ys => b :: ys +theorem xx (ls : List gQ) : r3 ls+>default = ls+>default := by + induction ls with + | nil => rfl + | cons b ls ih => + unfold r3 + rcases h : r3 ls with _ | ⟨y,ys⟩ + · rw [h,append_nil] at ih + rcases x3 b with rfl | rfl + · change []+>default = (0 :: ls)+>default + rw [append_nil,append_cons,← ih,oR] + · change [1]+>default = (1 :: ls)+>default + rw [append_cons,append_nil,append_cons,← ih] + · change (b :: y :: ys)+>default = (b :: ls)+>default + rw [append_cons,← h,ih,append_cons] +def kR (x y:f3) : Bool := + r3 x.past==r3 y.past&&x.front==y.front&&x.state==y.state +theorem kE {x y : f3} (h : kR x y = true) (r:ai) : + dw x r = dw y r := by + unfold kR at h + simp only [Bool.and_eq_true,beq_iff_eq] at h + rcases h with ⟨⟨hp,hf⟩,hs⟩ + unfold dw + rw [hf,hs,← xx x.past,← xx y.past,hp] +def vN (n:Nat) (x y:f3) : Bool := + match AL n x with + | some z => kR z y + | none => false +theorem kC (n:Nat) (x y:f3) (h : vN (n + 1) x y = true) (r:ai) : + (dw x r) [tm]⊢⁺ (dw y r) := by + unfold vN at h + rcases hr : AL (n + 1) x with _ | z + · rw [hr] at h; contradiction + · rw [hr] at h + rw [← kE h r] + exact vK hr r +theorem Ck (r:ai) : (FL (bf default [0]) ([0,0,0]+>(wa+>r))) [tm]⊢⁺ (CE (wb+>(wa+>r))) := by + have h:=kC 5 ⟨[],0 :: ([0,0,0]++wa),sF⟩ ⟨[],[0,0]++wb++wa,sE⟩ (by decide) r + simpa only [dw,FL,CE,bf,List.reverse_singleton,append_cons,append_nil,append_assoc, + Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons] using h +def gJ : cm→W + | .CD => .UA + | .CF => .UT +theorem Ek (d:cm) (us : List W) (r:ai) : + (DL (cn d us) (wa+>r)) [tm]⊢⁺ (hF .CD (gJ d :: us) r) := by + unfold cn + rw [df] + refine kT (Ii us (bf default ([0]++lX d)) r) ?_ + cases d + · unfold lX gJ hF oa + simp only [Cg,za,List.append_nil,append_assoc] + exact B3 (wa+>(HD us+>r)) + · unfold lX gJ hF oa + rw [df] + refine sq (HO (bf default [0]) (HD us+>r)) ?_ + simp only [Cg,za,append_assoc] + exact B3 (wY+>(wa+>(HD us+>r))) +theorem Ea (d:cm) (us : List W) (r:ai) : + (FL (cn d us) ([0,0,0]+>(wa+>r))) [tm]⊢⁺ (hF .CF (gJ d :: us) r) := by + unfold cn + rw [df] + refine kT (HT us (bf default ([0]++lX d)) r) ?_ + cases d + · unfold lX gJ hF oa + simp only [CB,yT,List.append_nil,append_assoc] + exact Ck (HF us+>r) + · unfold lX gJ hF oa + rw [df] + refine sq (Ia (bf default [0]) (HF us+>r)) ?_ + simp only [CB,yT,append_assoc] + exact Ck (wb+>(HF us+>r)) +def Bd (d:cm) (us : List W) (c:aL) : Prop := + ∃ d' r,c = hF d' (gJ d :: us) r +theorem hN (d:cm) (us : List W) (c:aL) + (h : dU (cn d us) c) : cE c (Bd d us) := by + cases h with + | strong_D r => + exact bn (V (Ek d us r)) ⟨.CD,r,rfl⟩ + | strong_F r => + exact bn (V (Ea d us r)) ⟨.CF,r,rfl⟩ +theorem i8 (d:cm) (us : List W) (c:aL) + (hlen : 2 ≤ us.length) (h : Bd d us c) : lr c := by + rcases h with ⟨d',r,rfl⟩ + exact ⟨d',gJ d :: us,r,by simp; omega,rfl⟩ +def Ct : List gQ:=[1,1,1,1,1,1,1,1,1] +def wo : List gQ:=[1,1,1,1,1,1,0,1,0] +theorem CM (l r:ai) : + (FR l ([0]+>(Ct+>r))) [tm]⊢⁺ (FR (bf l (b5 [])) ([0]+>r)) := by + simpa only [b5,hE,append_assoc] using! + U 20 ⟨[],[0]++Ct,sF,false⟩ ⟨((wX++[])++wL).reverse,[0],sF,false⟩ (by decide) l r +theorem D2 (l r:ai) : + (FR l ([0]+>(wo+>r))) [tm]⊢⁺ (FR (bf l (b5 [])) ([0]+>r)) := by + simpa only [b5,hE,append_assoc] using! + U 18 ⟨[],[0]++wo,sF,false⟩ ⟨((wX++[])++wL).reverse,[0],sF,false⟩ (by decide) l r +theorem y7 (d:cm) (us : List W) (r:ai) (t : List gQ) + (hlen : 2 ≤ us.length) + (ht : ∀ l r,(FR l ([0]+>(t+>r))) [tm]⊢⁺ (FR (bf l (b5 [])) ([0]+>r))) : + cE (hF d us (t+>r)) lr := by + refine cc (tj d us (t+>r)) ?_ + refine cc (ht (cn d us) r) ?_ + refine bh (r8 [] (cn d us) ([0]+>r)) ?_ + intro c hc + refine bh (hN d us c hc) ?_ + intro e he + exact dg (i8 d us e hlen he) +theorem ye (d:cm) (us : List W) (r:ai) (hlen : 2 ≤ us.length) : + cE (hF d us (Ct+>r)) lr := + y7 d us r Ct hlen CM +theorem ze (d:cm) (us : List W) (r:ai) (hlen : 2 ≤ us.length) : + cE (hF d us (wo+>r)) lr := + y7 d us r wo hlen D2 +theorem xN (r:ai) : + (hF .CF [.UA,.UT] ((wY++wa++wa)+>r)) [tm]⊢⁺ + (FR (bf (cn .CF [.UA,.UT]) (b5 [.P11,.P11])) ([0,0,1,0]+>r)) := by + have h:=kC 57 + ⟨[],[0,0]++oa .CF [.UA,.UT]++(wY++wa++wa),sE⟩ + ⟨([0]++lX .CF++G [.UA,.UT]++b5 [.P11,.P11]).reverse,[0,0,1,0],sF⟩ + (by decide) r + simpa only [dw,hF,CE,FR,cn,df,bf,append_assoc] using! h +theorem Ap (r:ai) : + cE (hF .CF [.UA,.UT] ((wY++wa++wa)+>r)) lr := by + refine cc (xN r) ?_ + refine bh (r8 [.P11,.P11] (cn .CF [.UA,.UT]) ([0,0,1,0]+>r)) ?_ + intro c hc + refine bh (hN .CF [.UA,.UT] c hc) ?_ + intro e he + exact dg (i8 .CF [.UA,.UT] e (by decide) he) +inductive bR where + | RD | RF | RB +deriving DecidableEq +def jY (e:bR) (l r:ai) : aL := + match e with + | .RD => DL l r + | .RF => FL l r + | .RB => BL l r +def vT : List (bR × List gQ) := + [(.RD,[]),(.RF,[0,0]),(.RB,[0,0])] +def pN : List (bR × List gQ) := + [(.RD,[1,0,1]),(.RD,[1,1,1,0,1]),(.RD,[1,0,1,0,0]),(.RF,[0,0,0])] +def Ac : List (bR × List gQ) := + [(.RD,[1,1,0,1]),(.RD,[0,1,0,0]),(.RF,[0,0]),(.RB,[0,0])] +def xR : List (bR × List gQ):=[(.RD,[]),(.RF,[0,0])] +def Bk : List (bR × List gQ):=[(.RD,[]),(.RB,[0,0])] +def Cu : List (bR × List gQ):=[(.RF,[0,0])] +def ic (l:ai) (es : List (bR × List gQ)) (c:aL) : Prop := + ∃ e p r,(e,p) ∈ es∧c = jY e l (p+>r) +theorem we (l:ai) (c:aL) (h : ip l c) : ic l vT c := by + cases h with + | contact_D r => exact ⟨.RD,[],r,by decide,rfl⟩ + | contact_F r => exact ⟨.RF,[0,0],r,by decide,rfl⟩ + | contact_B r => exact ⟨.RB,[0,0],r,by decide,rfl⟩ +theorem Bv (l r:ai) : fl (FR l r) (ic l vT) := + sv (pH l r) (fun c h => dg (we l c h)) +theorem CT (l:ai) (c:aL) (h : ip (bf l wL) c) : + cE c (ic l pN) := by + cases h with + | contact_D r => + exact bn (V (GZ l r)) ⟨.RF,[0,0,0],r,by decide,rfl⟩ + | contact_F r => + exact bn (V (Ha l r)) ⟨.RD,[1,1,1,0,1],r,by decide,rfl⟩ + | contact_B r => + exact bn (V (GX l r)) ⟨.RD,[1,0,1,0,0],r,by decide,rfl⟩ +theorem x2 (l r:ai) : fl (FR l ([0,0]+>r)) (ic l pN) := by + rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · have hr : (FR l ([0,0]+>([0]+>r))) [tm]⊢⁺ (DL l ([1,0,1]+>r)) := by + simpa only [← append_assoc] using! r2 l r + exact cr hr (dg ⟨.RD,[1,0,1],r,by decide,rfl⟩) + · have hr : (FR l ([0,0]+>([1]+>r))) [tm]⊢⁺ (FR (bf l wL) r) := by + simpa only [← append_assoc] using! r4 l r + exact cr hr (bh (fv (bf l wL) r) (CT l)) +theorem Bp (l:ai) (c:aL) (h : ip (bf l [1,0]) c) : + cE c (ic l Ac) := by + cases h with + | contact_D r => + exact bn (V (xL l r)) ⟨.RB,[0,0],r,by decide,rfl⟩ + | contact_F r => + refine cc (xZ l r) ?_ + refine cc (Av l ([1,0,1]+>r)) ?_ + exact dg ⟨.RD,[1,1,0,1],r,by decide,by simp [jY,← append_assoc]⟩ + | contact_B r => + exact bn (V (xV l r)) ⟨.RD,[0,1,0,0],r,by decide,rfl⟩ +theorem CX (l r:ai) : fl (FR l ([1]+>r)) (ic l Ac) := by + rcases dW r with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · have hr : (FR l ([1]+>([0]+>r))) [tm]⊢⁺ (FR (bf l [1,0]) r) := by + simpa only [← append_assoc] using! vf l r + exact cr hr (bh (fv (bf l [1,0]) r) (Bp l)) + · have hr : (FR l ([1]+>([1]+>r))) [tm]⊢⁺ (FL l ([0,0]+>r)) := by + simpa only [← append_assoc] using! vv l r + exact cr hr (dg ⟨.RF,[0,0],r,by decide,rfl⟩) +theorem x8 (l:ai) (c:aL) (h : ic l pN c) : + ic l xR c := by + rcases h with ⟨e,p,r,hin,rfl⟩ + simp only [pN,List.mem_cons,List.not_mem_nil,or_false,Prod.mk.injEq] at hin + rcases hin with ⟨rfl,rfl⟩ | ⟨rfl,rfl⟩ | ⟨rfl,rfl⟩ | ⟨rfl,rfl⟩ + · exact ⟨.RD,[],[1,0,1]+>r,by decide,rfl⟩ + · exact ⟨.RD,[],[1,1,1,0,1]+>r,by decide,rfl⟩ + · exact ⟨.RD,[],[1,0,1,0,0]+>r,by decide,rfl⟩ + · exact ⟨.RF,[0,0],[0]+>r,by decide,by simp [jY,← append_assoc]⟩ +theorem xm (l r:ai) : fl (FR l ([0,0]+>r)) (ic l xR) := + sv (x2 l r) (fun c h => dg (x8 l c h)) +theorem w5 (l r:ai) : fl (FR l ([1,0]+>r)) (ic l Bk) := by + refine cr (vf l r) ?_ + refine bh (fv (bf l [1,0]) r) ?_ + intro c h + cases h with + | contact_D r0 => + exact bn (V (xL l r0)) ⟨.RB,[0,0],r0,by decide,rfl⟩ + | contact_F r0 => + refine cc (xZ l r0) ?_ + exact bn (V (Av l ([1,0,1]+>r0))) + ⟨.RD,[],[1,1,0,1]+>r0,by decide,by simp [jY,← append_assoc]⟩ + | contact_B r0 => + exact bn (V (xV l r0)) + ⟨.RD,[],[0,1,0,0]+>r0,by decide,rfl⟩ +theorem wv (l r:ai) : fl (FR l ([1,1]+>r)) (ic l Cu) := + cr (vv l r) (dg ⟨.RF,[0,0],r,by decide,rfl⟩) +inductive ax where + | qA | qB | qC | qD | qE | qF +deriving DecidableEq +def yh (b:Bool) : gQ:=if b then 1 else 0 +def be (bs : List Bool) : List gQ:=bs.map yh +@[simp] theorem y4 : be [] = []:=rfl +@[simp] theorem m7 (b:Bool) (bs : List Bool) : be (b :: bs) = yh b :: be bs:=rfl +@[simp] theorem jF (xs ys : List Bool) : be (xs++ys) = be xs++be ys := by simp [be] +@[simp] theorem sT (xs : List Bool) : be xs.reverse = (be xs).reverse := by simp [be] +def BJ : ax→Fin 6 + | .qA => sA | .qB => sB | .qC => sC | .qD => sD | .qE => sE | .qF => sF +structure R where + past : List Bool + front : List Bool + state : ax +deriving DecidableEq +def sz (x:R) : f3 := + ⟨be x.past,be x.front,BJ x.state⟩ +def dC (x:R) (r:ai) : aL:=dw (sz x) r +def v4 (x:R) : Option R := + match x.front with + | [] => none + | false :: bs => + match x.state with + | .qA => some ⟨true :: x.past,bs,.qB⟩ + | .qB => + match x.past with + | [] => some ⟨[],false :: true :: bs,.qC⟩ + | a :: ls => some ⟨ls,a :: true :: bs,.qC⟩ + | .qC => none + | .qD => + match x.past with + | [] => some ⟨[],false :: false :: bs,.qE⟩ + | a :: ls => some ⟨ls,a :: false :: bs,.qE⟩ + | .qE => some ⟨false :: x.past,bs,.qF⟩ + | .qF => some ⟨true :: x.past,bs,.qA⟩ + | true :: bs => + match x.state with + | .qA => some ⟨true :: x.past,bs,.qF⟩ + | .qB => + match x.past with + | [] => some ⟨[],false :: false :: bs,.qF⟩ + | a :: ls => some ⟨ls,a :: false :: bs,.qF⟩ + | .qC => + match x.past with + | [] => some ⟨[],false :: false :: bs,.qD⟩ + | a :: ls => some ⟨ls,a :: false :: bs,.qD⟩ + | .qD => + match x.past with + | [] => some ⟨[],false :: true :: bs,.qD⟩ + | a :: ls => some ⟨ls,a :: true :: bs,.qD⟩ + | .qE => + match x.past with + | [] => some ⟨[],false :: false :: bs,.qB⟩ + | a :: ls => some ⟨ls,a :: false :: bs,.qB⟩ + | .qF => some ⟨true :: x.past,bs,.qE⟩ +def AV (q:ax) (ih : List Bool→List Bool→ax→Option R) (bs : List Bool) : Option R := + ih [] (false :: true :: bs) q +def zI (a:Bool) (ls : List Bool) (_ : ax→(List Bool→List Bool→ax→Option R)→List Bool→Option R) + (q:ax) (ih : List Bool→List Bool→ax→Option R) (bs : List Bool) : Option R := + ih ls (a :: true :: bs) q +noncomputable def sZ (q:ax) (ih : List Bool→List Bool→ax→Option R) (past bs : List Bool) : Option R := + List.rec (motive:=fun _ => ax→(List Bool→List Bool→ax→Option R)→List Bool→Option R) + AV + zI + past q ih bs +def Ak (q:ax) (ih : List Bool→List Bool→ax→Option R) (bs : List Bool) : Option R := + ih [] (false :: false :: bs) q +def yj (a:Bool) (ls : List Bool) (_ : ax→(List Bool→List Bool→ax→Option R)→List Bool→Option R) + (q:ax) (ih : List Bool→List Bool→ax→Option R) (bs : List Bool) : Option R := + ih ls (a :: false :: bs) q +noncomputable def ln (q:ax) (ih : List Bool→List Bool→ax→Option R) (past bs : List Bool) : Option R := + List.rec (motive:=fun _ => ax→(List Bool→List Bool→ax→Option R)→List Bool→Option R) + Ak + yj + past q ih bs +def ll (q:ax) (ih : List Bool→List Bool→ax→Option R) (past bs : List Bool) : Option R := + ih (true :: past) bs q +def xG (q:ax) (ih : List Bool→List Bool→ax→Option R) (past bs : List Bool) : Option R := + ih (false :: past) bs q +def CP (_ : List Bool→List Bool→ax→Option R) (_ _ : List Bool) : Option R := + none +noncomputable def xy (state:ax) : (List Bool→List Bool→ax→Option R)→List Bool→List Bool→Option R := + ax.rec (motive:=fun _ => (List Bool→List Bool→ax→Option R)→List Bool→List Bool→Option R) + (ll .qB) + (sZ .qC) + CP + (ln .qE) + (xG .qF) + (ll .qA) + state +noncomputable def xO (state:ax) : (List Bool→List Bool→ax→Option R)→List Bool→List Bool→Option R := + ax.rec (motive:=fun _ => (List Bool→List Bool→ax→Option R)→List Bool→List Bool→Option R) + (ll .qF) + (ln .qF) + (ln .qD) + (sZ .qD) + (ln .qB) + (ll .qE) + state +noncomputable def Ca (b:Bool) : ax→(List Bool→List Bool→ax→Option R)→List Bool→List Bool→Option R := + Bool.rec (motive:=fun _ => ax→(List Bool→List Bool→ax→Option R)→List Bool→List Bool→Option R) + xy + xO + b +noncomputable def Au (b:Bool) (bs : List Bool) + (_ : ax→(List Bool→List Bool→ax→Option R)→List Bool→Option R) + (state:ax) (ih : List Bool→List Bool→ax→Option R) (past : List Bool) : Option R := + Ca b state ih past bs +def A1 (_:ax) (_ : List Bool→List Bool→ax→Option R) (_ : List Bool) : Option R := + none +noncomputable def lN (ih : List Bool→List Bool→ax→Option R) + (past front : List Bool) (state:ax) : Option R := + List.rec (motive:=fun _ => ax→(List Bool→List Bool→ax→Option R)→List Bool→Option R) + A1 + Au + front state ih past +def Aj (past front : List Bool) (state:ax) : Option R := + some ⟨past,front,state⟩ +noncomputable def zV (_:Nat) (ih : List Bool→List Bool→ax→Option R) : List Bool→List Bool→ax→Option R := + lN ih +noncomputable def l7 (n:Nat) : List Bool→List Bool→ax→Option R := + Nat.rec (motive:=fun _ => List Bool→List Bool→ax→Option R) + Aj + zV + n +noncomputable def xJ (n:Nat) (x:R) : Option R := + R.rec (motive:=fun _ => Option R) (l7 n) x +noncomputable def Ao (n:Nat) (x:R) : Option R := + R.rec (motive:=fun _ => Option R) (lN (l7 n)) x +theorem zg (x:R) : (v4 x).map sz = mr (sz x) := by + rcases x with ⟨_ | ⟨a,ls⟩,_ | ⟨_ | _,bs⟩,_ | _ | _ | _ | _ | _⟩ <;> rfl +theorem wx (ih : List Bool→List Bool→ax→Option R) + (past front : List Bool) (state:ax) : + lN ih past front state = + match v4 ⟨past,front,state⟩ with + | none => none + | some y => ih y.past y.front y.state := by + rcases past with _ | ⟨a,ls⟩ <;> rcases front with _ | ⟨_ | _,bs⟩ <;> cases state <;> rfl +theorem vQ (n:Nat) (past front : List Bool) (state:ax) : + (l7 n past front state).map sz = AL n (sz ⟨past,front,state⟩) := by + induction n generalizing past front state with + | zero => rfl + | succ n ih => + change (lN (l7 n) past front state).map sz = AL (n + 1) (sz ⟨past,front,state⟩) + rw [wx] + unfold AL + rw [← zg ⟨past,front,state⟩] + rcases v4 ⟨past,front,state⟩ with _ | ⟨p',f',s'⟩ <;> simp [ih] +theorem AX (n:Nat) (x:R) : (xJ n x).map sz = AL n (sz x) := + vQ n x.past x.front x.state +def CK : ax→ax→Bool + | .qA,.qA | .qB,.qB | .qC,.qC | .qD,.qD | .qE,.qE | .qF,.qF => true + | _,_ => false +theorem zY (x y:ax) : CK x y = true↔x = y := by + cases x <;> cases y <;> decide +def sx (_:Bool) (_ : List Bool) (_:Bool) : Bool:=false +noncomputable def zS (ys : List Bool) : Bool := + List.rec (motive:=fun _ => Bool) true sx ys +noncomputable def zK (b:Bool) (ih : List Bool→Bool) (bs : List Bool) : Bool := + Bool.rec (motive:=fun _ => Bool) (ih bs) false b +noncomputable def y5 (b:Bool) (ih : List Bool→Bool) (bs : List Bool) : Bool := + Bool.rec (motive:=fun _ => Bool) false (ih bs) b +noncomputable def rj (b:Bool) (bs : List Bool) (_ : (List Bool→Bool)→Bool→Bool) + (ih : List Bool→Bool) (a:Bool) : Bool := + Bool.rec (motive:=fun _ => Bool→(List Bool→Bool)→List Bool→Bool) zK y5 a b ih bs +def sm (_ : List Bool→Bool) (_:Bool) : Bool:=false +noncomputable def pt (a:Bool) (_ : List Bool) (ih : List Bool→Bool) (ys : List Bool) : Bool := + List.rec (motive:=fun _ => (List Bool→Bool)→Bool→Bool) + sm + rj + ys ih a +noncomputable def lp (xs ys : List Bool) : Bool := + List.rec (motive:=fun _ => List Bool→Bool) + zS + pt + xs ys +theorem oF (xs ys : List Bool) : lp xs ys = true↔xs = ys := by + induction xs generalizing ys with + | nil => + cases ys <;> simp [lp,zS,sx] + | cons a as ih => + cases ys with + | nil => simp [lp,pt,sm] + | cons b bs => + change pt a as (lp as) (b :: bs) = true↔a :: as = b :: bs + cases a <;> cases b <;> simp [pt,rj,zK,y5,ih] +def mz (b:Bool) (_ : List Bool) (ih : List Bool) : List Bool := + match ih with + | [] => if b then [true] else [] + | ys => b :: ys +noncomputable def mO (ls : List Bool) : List Bool := + List.rec (motive:=fun _ => List Bool) [] mz ls +theorem sp (ls : List Bool) : be (mO ls) = r3 (be ls) := by + induction ls with + | nil => rfl + | cons b ls ih => + change be (mz b ls (mO ls)) = r3 (yh b :: be ls) + unfold mz r3 + rw [← ih] + rcases mO ls with _ | ⟨y,ys⟩ <;> cases b <;> rfl +noncomputable def mn (xp xf : List Bool) (xs:ax) (yp yf : List Bool) (ys:ax) : Bool := + CK xs ys&&lp xf yf&&(lp xp yp||lp (mO xp) (mO yp)) +noncomputable def xt (y:R) (xp xf : List Bool) (xs:ax) : Bool := + R.rec (motive:=fun _ => Bool) (mn xp xf xs) y +noncomputable def tX (x y:R) : Bool := + R.rec (motive:=fun _ => Bool) (xt y) x +theorem wt {x y : R} (h : tX x y = true) (r:ai) : + dC x r = dC y r := by + rcases x with ⟨xp,xf,xs⟩ + rcases y with ⟨yp,yf,ys⟩ + change mn xp xf xs yp yf ys = true at h + unfold mn at h + simp only [Bool.and_eq_true,Bool.or_eq_true,zY,oF] at h + rcases h with ⟨⟨hs,hf⟩,hp | hp⟩ + · apply kE _ r + unfold kR sz + dsimp only + rw [hp,hf,hs] + simp + · apply kE _ r + unfold kR sz + dsimp only + rw [← sp xp,← sp yp,hp,hf,hs] + simp +def Be (_:R) : Bool:=false +noncomputable def Ba (z y:R) : Bool:=tX z y +noncomputable def oh (n:Nat) (x y:R) : Bool := + Option.rec (motive:=fun _ => R→Bool) Be Ba (xJ n x) y +noncomputable def eO (n:Nat) (x y:R) : Bool := + Option.rec (motive:=fun _ => R→Bool) Be Ba (Ao n x) y +theorem gi (n:Nat) (x y:R) + (h : oh (n + 1) x y = true) (r:ai) : + (dC x r) [tm]⊢⁺ (dC y r) := by + unfold oh at h + rcases hr : xJ (n + 1) x with _ | z + · rw [hr] at h; contradiction + · rw [hr] at h + change tX z y = true at h + rw [← wt h r] + have hrun : AL (n + 1) (sz x) = some (sz z) := by + rw [← AX (n + 1) x,hr]; rfl + exact vK hrun r +def bL : List Bool:=[true,true,false] +def bX : List Bool:=[true,true,false,true,true,false] +def bY : List Bool:=[true,true,true,true] +def ba : List Bool:=[true,true,true,false,true,false] +def bb : List Bool:=[true,false,true,false] +def EQ : List Bool:=[true,true,true,true,true,true,true,true,true] +def B8 : List Bool:=[true,true,true,true,true,true,false,true,false] +def Gh : W→List Bool + | .UA => ba + | .UT => bY++ba +def Gi : W→List Bool + | .UA => ba + | .UT => ba++bb +def Hy : W→List Bool + | .UA => bX + | .UT => bX++bY +def FM : List W→List Bool + | [] => [] + | u :: us => Gh u++FM us +def Gb : List W→List Bool + | [] => [] + | u :: us => Gi u++Gb us +def bG : List W→List Bool + | [] => [] + | u :: us => Hy u++bG us +def bW : cm→List Bool + | .CD => [] + | .CF => bY +def xX (d:cm) (us : List W) : List Bool := + match d with + | .CD => FM us + | .CF => bb++Gb us +def wj : b9→List Bool + | .PL => bL + | .P11 => [true,true] +def mI : List b9→List Bool + | [] => [] + | p :: ps => wj p++mI ps +def rT (ps : List b9) : List Bool := + (bX++mI ps)++bL +def Dw (b:Bool) : List Bool := + if b then [true,false] else [true] +def nU : List Bool→List Bool + | [] => [] + | b :: s => nU s++Dw b +@[simp] theorem GP : be bL = wL:=rfl +@[simp] theorem GS : be bX = wX:=rfl +@[simp] theorem DX : be bY = wY:=rfl +@[simp] theorem Bj : be ba = wa:=rfl +@[simp] theorem GR : be bb = wb:=rfl +@[simp] theorem Bt : be EQ = Ct:=rfl +@[simp] theorem Ae : be B8 = wo:=rfl +@[simp] theorem GC (us : List W) : be (FM us) = HD us := by + induction us with + | nil => rfl + | cons u us ih => cases u <;> simp [FM,HD,Gh,za,← ih] +@[simp] theorem Gv (us : List W) : be (Gb us) = HF us := by + induction us with + | nil => rfl + | cons u us ih => cases u <;> simp [Gb,HF,Gi,yT,← ih] +@[simp] theorem GQ (us : List W) : be (bG us) = G us := by + induction us with + | nil => rfl + | cons u us ih => cases u <;> simp [bG,G,Hy,G1,← ih] +@[simp] theorem FA (d:cm) : be (bW d) = lX d := by + cases d <;> rfl +@[simp] theorem n0 (d:cm) (us : List W) : be (xX d us) = oa d us := by + cases d <;> simp [xX,oa] +@[simp] theorem CH (ps : List b9) : be (mI ps) = hE ps := by + induction ps with + | nil => rfl + | cons p ps ih => cases p <;> simp [mI,hE,wj,x0,yh,← ih] +@[simp] theorem v3 (ps : List b9) : be (rT ps) = b5 ps := by + simp [rT,b5] +def lw : List Bool→List gQ + | [] => [] + | b :: s => lw s++se b +theorem xT (l:ai) (s : List Bool) : + bJ l s = bf l (lw s) := by + induction s with + | nil => rfl + | cons b s ih => + unfold bJ lw + rw [ih,df] +theorem xQ (base : List gQ) (ps : List b9) (s : List Bool) (r:ai) : + cE (FR (bf default ((base++b5 ps)++lw s)) r) + (dU (bf default base)) := by + rw [df,df,← xT] + exact bh (jC (bf (bf default base) (b5 ps)) s .GoRight r) + (lI ps (bf default base)) +@[simp] theorem v2 (s : List Bool) : be (nU s) = lw s := by + induction s with + | nil => rfl + | cons b s ih => cases b <;> simp [nU,lw,Dw,se,yh,← ih] +def pD (q w : List Bool) : R:=⟨q.reverse,w,.qF⟩ +def hG (q : List Bool) (s:ax) (w : List Bool) : R := + match q.reverse with + | [] => ⟨[],false :: w,s⟩ + | a :: ls => ⟨ls,a :: w,s⟩ +def jJ (qr w : List Bool) : R:=⟨qr,w,.qF⟩ +def gh (qr : List Bool) (s:ax) (w : List Bool) : R := + match qr with + | [] => ⟨[],false :: w,s⟩ + | a :: ls => ⟨ls,a :: w,s⟩ +def xI (w : List Bool) : R:=⟨[],false :: false :: w,.qE⟩ +theorem zO (q w : List Bool) (r:ai) : + dC (pD q w) r = FR (bf default (be q)) (be w+>r) := by + unfold dC pD sz dw FR bf + simp [BJ] +theorem pF (q : List Bool) (s:ax) (w : List Bool) (r:ai) : + dC (hG q s w) r = ((bf default (be q)) <{{BJ s}} (be w+>r)) := by + unfold dC hG sz bf dw + dsimp only + rw [← sT] + rcases q.reverse with _ | ⟨a,ls⟩ <;> + simp only [y4,m7,yh,Bool.false_eq_true,↓reduceIte, + append_cons,append_nil,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,kX,k5] +theorem vW (qr w : List Bool) (r:ai) : + dC (jJ qr w) r = FR (bf default (be qr.reverse)) (be w+>r) := by + unfold dC jJ sz dw FR bf + simp [BJ] +theorem w8 (qr : List Bool) (s:ax) (w : List Bool) (r:ai) : + dC (gh qr s w) r = ((bf default (be qr.reverse)) <{{BJ s}} (be w+>r)) := by + unfold dC gh sz bf dw + dsimp only + rw [← sT,List.reverse_reverse] + rcases qr with _ | ⟨a,ls⟩ <;> + simp only [y4,m7,yh,Bool.false_eq_true,↓reduceIte, + append_cons,append_nil,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,kX,k5] +theorem C9 (w : List Bool) (r:ai) : + dC (xI w) r = CE (be w+>r):=rfl +inductive fZ where + | Recovered (d:cm) (us : List W) (tail : List Bool) + | NineGain (d:cm) (us : List W) (tail : List Bool) + | SixGain (d:cm) (us : List W) (tail : List Bool) + | YaaGain (tail : List Bool) +deriving DecidableEq +def j6 : fZ→List Bool + | .Recovered d us tail => xX d us++tail + | .NineGain d us tail => xX d us++EQ++tail + | .SixGain d us tail => xX d us++B8++tail + | .YaaGain tail => xX .CF [.UA,.UT]++bY++ba++ba++tail +def f0 (t:fZ) : R:=xI (j6 t) +def jj : fZ→Bool + | .Recovered _ us _ => decide (3 ≤ us.length) + | .NineGain _ us _ => decide (2 ≤ us.length) + | .SixGain _ us _ => decide (2 ≤ us.length) + | .YaaGain _ => true +theorem nP (t:fZ) (h : jj t = true) (r:ai) : + cE (dC (f0 t) r) lr := by + unfold f0 + rw [C9] + cases t with + | Recovered d us tail => + have hlen : 3 ≤ us.length:=of_decide_eq_true h + unfold j6 + simp only [jF,n0,append_assoc] + exact dg ⟨d,us,be tail+>r,hlen,rfl⟩ + | NineGain d us tail => + have hlen : 2 ≤ us.length:=of_decide_eq_true h + unfold j6 + simp only [jF,n0,Bt,append_assoc] + exact ye d us (be tail+>r) hlen + | SixGain d us tail => + have hlen : 2 ≤ us.length:=of_decide_eq_true h + unfold j6 + simp only [jF,n0,Ae,append_assoc] + exact ze d us (be tail+>r) hlen + | YaaGain tail => + unfold j6 + simp only [jF,n0,DX,Bj] + have heq : (oa .CF [.UA,.UT]++wY++wa++wa++be tail)+>r = + oa .CF [.UA,.UT]+>((wY++wa++wa)+>(be tail+>r)) := by + simp only [append_assoc] + rw [heq] + exact Ap (be tail+>r) +structure mB where + guard_base : List Bool + guard_pieces : List b9 + guard_stack : List Bool + guard_D_steps : Nat + guard_D_terminal : fZ + guard_F_steps : Nat + guard_F_terminal : fZ +deriving DecidableEq +def uz (g:mB) : List Bool := + (g.guard_base++rT g.guard_pieces)++nU g.guard_stack +noncomputable def nV (g:mB) : Bool := + jj g.guard_D_terminal && + jj g.guard_F_terminal && + eO g.guard_D_steps (hG g.guard_base .qD ba) (f0 g.guard_D_terminal) && + eO g.guard_F_steps (hG g.guard_base .qF ([false,false,false]++ba)) (f0 g.guard_F_terminal) +theorem Bu (g:mB) (h : nV g = true) (r:ai) : + cE (FR (bf default (be (uz g))) r) lr := by + unfold nV at h + simp only [Bool.and_eq_true] at h + rcases h with ⟨⟨⟨hd,hf⟩,nd⟩,nf⟩ + unfold uz + simp only [jF,v3,v2] + refine bh (xQ (be g.guard_base) g.guard_pieces g.guard_stack r) ?_ + intro c hc + cases hc with + | strong_D r0 => + have hnat:=gi g.guard_D_steps (hG g.guard_base .qD ba) (f0 g.guard_D_terminal) nd r0 + rw [pF] at hnat + dsimp only [BJ,Bj] at hnat + exact cc hnat (nP g.guard_D_terminal hd r0) + | strong_F r0 => + have hnat:=gi g.guard_F_steps (hG g.guard_base .qF ([false,false,false]++ba)) (f0 g.guard_F_terminal) nf r0 + rw [pF] at hnat + have h000 : be ([false,false,false]++ba)+>r0 = [0,0,0]+>(wa+>r0) := by + simp [append_assoc,yh] + dsimp only [BJ] at hnat + rw [h000] at hnat + exact cc hnat (nP g.guard_F_terminal hf r0) +inductive k1 where + | AllCases | Cases00 | Cases1 | Coarse00 | Coarse10 | Coarse11 +deriving DecidableEq +def iW : k1→List (bR × List gQ) + | .AllCases => vT + | .Cases00 => pN + | .Cases1 => Ac + | .Coarse00 => xR + | .Coarse10 => Bk + | .Coarse11 => Cu +def so : k1→List (bR × List Bool) + | .AllCases => [(.RD,[]),(.RF,[false,false]),(.RB,[false,false])] + | .Cases00 => [(.RD,[true,false,true]),(.RD,[true,true,true,false,true]),(.RD,[true,false,true,false,false]),(.RF,[false,false,false])] + | .Cases1 => [(.RD,[true,true,false,true]),(.RD,[false,true,false,false]),(.RF,[false,false]),(.RB,[false,false])] + | .Coarse00 => [(.RD,[]),(.RF,[false,false])] + | .Coarse10 => [(.RD,[]),(.RB,[false,false])] + | .Coarse11 => [(.RF,[false,false])] +theorem vJ (s:k1) : + (so s).map (fun e => (e.1,be e.2)) = iW s := by + cases s <;> rfl +noncomputable def kq (s:k1) (w : List Bool) : Bool := + match s with + | .AllCases => true + | .Cases00 => lp w [false,false] + | .Cases1 => lp w [true] + | .Coarse00 => lp (w.take 2) [false,false] + | .Coarse10 => lp (w.take 2) [true,false] + | .Coarse11 => lp (w.take 2) [true,true] +theorem zk (s:k1) (w : List Bool) (h : kq s w = true) (l r:ai) : + fl (FR l (be w+>r)) (ic l (iW s)) := by + cases s with + | AllCases => exact Bv l (be w+>r) + | Cases00 => + unfold kq at h; rw [oF] at h; subst h + exact x2 l r + | Cases1 => + unfold kq at h; rw [oF] at h; subst h + exact CX l r + | Coarse00 => + rcases w with _ | ⟨_ | _,_ | ⟨_ | _,w'⟩⟩ <;> try contradiction + simpa only [iW,m7,yh,Bool.false_eq_true,↓reduceIte,← append_assoc] using! xm l (be w'+>r) + | Coarse10 => + rcases w with _ | ⟨_ | _,_ | ⟨_ | _,w'⟩⟩ <;> try contradiction + simpa only [iW,m7,yh,Bool.false_eq_true,↓reduceIte,← append_assoc] using! w5 l (be w'+>r) + | Coarse11 => + rcases w with _ | ⟨_ | _,_ | ⟨_ | _,w'⟩⟩ <;> try contradiction + simpa only [iW,m7,yh,Bool.false_eq_true,↓reduceIte,← append_assoc] using! wv l (be w'+>r) +def nz : bR→ax + | .RD => .qD + | .RF => .qF + | .RB => .qB +def GB : bR→Fin 6 + | .RD => sD + | .RF => sF + | .RB => sB +@[simp] theorem yd (s:bR) : BJ (nz s) = GB s := by + cases s <;> rfl +inductive Pos where + | Z : Pos + | O : Pos→Pos + | E : Pos→Pos +deriving DecidableEq +def Fl : bR→bR→Bool + | .RD,.RD | .RF,.RF | .RB,.RB => true + | _,_ => false +theorem CN (x y:bR) : Fl x y = true↔x = y := by + cases x <;> cases y <;> decide +structure py where + state : bR + pref : List Bool + steps : Nat + target : Pos + prep : List Bool +deriving DecidableEq +noncomputable def su (e : bR × List Bool) (b:py) : Bool := + Fl e.1 b.state&&lp e.2 b.pref +noncomputable def yq (s:k1) (bs : List py) : Bool := + (so s).all (fun e => bs.any (su e)) +theorem yi (s:k1) (bs : List py) (e : bR × List gQ) + (hc : yq s bs = true) (hin : e ∈ iW s) : + ∃ b ∈ bs,e.1 = b.state∧e.2 = be b.pref := by + rw [← vJ s,List.mem_map] at hin + rcases hin with ⟨⟨st,p⟩,hp,rfl⟩ + unfold yq at hc + have h1:=List.all_eq_true.mp hc (st,p) hp + rcases List.any_eq_true.mp h1 with ⟨b,hb,hm⟩ + unfold su at hm + simp only [Bool.and_eq_true,CN,oF] at hm + exact ⟨b,hb,hm.1,by rw [hm.2]⟩ +inductive dp where + | rEnd (t:fZ) + | rProt (gc:mB) (w : List Bool) + | rNat (fin:R) (steps:Nat) (target:Pos) (prep : List Bool) + | rRet (qr w : List Bool) (s:k1) (bs : List py) +def F4 (t:fZ) : R:=f0 t +def CC (gc:mB) (w : List Bool) : R:=pD (uz gc) w +def F2 (fin:R) (_:Nat) (_:Pos) (_ : List Bool) : R:=fin +def DH (qr w : List Bool) (_:k1) (_ : List py) : R:=jJ qr w +noncomputable def fw (r:dp) : R := + dp.rec (motive:=fun _ => R) F4 CC F2 DH r +def Ec (p : List Bool) (xp xf : List Bool) (xs:ax) : R := + ⟨xp,xf++p,xs⟩ +noncomputable def jE (p : List Bool) (x:R) : R := + R.rec (motive:=fun _ => R) (Ec p) x +theorem nR (p : List Bool) (x:R) (r:ai) : + dC (jE p x) r = dC x (be p+>r) := by + rcases x with ⟨xp,xf,xs⟩ + change dC ⟨xp,xf++p,xs⟩ r = dC ⟨xp,xf,xs⟩ (be p+>r) + unfold dC dw sz + simp only [jF,append_assoc] +inductive ab (α : Type) where + | empty : ab α + | node : Option α→ab α→ab α→ab α +def zi (v : Option α) (_ _ : ab α) (_ _ : Option α) : Option α:=v +noncomputable def Ce (t : ab α) : Option α := + ab.rec (motive:=fun _ => Option α) none zi t +def vL (_ : ab α→Option α) : Option α:=none +def zs (_ : Option α) (l _ : ab α) (_ _ : (ab α→Option α)→Option α) (ih : ab α→Option α) : Option α:=ih l +def AM (_ : Option α) (_ r : ab α) (_ _ : (ab α→Option α)→Option α) (ih : ab α→Option α) : Option α:=ih r +noncomputable def BS (_:Pos) (ih : ab α→Option α) (t : ab α) : Option α := + ab.rec (motive:=fun _ => (ab α→Option α)→Option α) vL zs t ih +noncomputable def B7 (_:Pos) (ih : ab α→Option α) (t : ab α) : Option α := + ab.rec (motive:=fun _ => (ab α→Option α)→Option α) vL AM t ih +noncomputable def ig (t : ab α) (p:Pos) : Option α := + Pos.rec (motive:=fun _ => ab α→Option α) + Ce + BS + B7 + p t +def n7 (_ : α→Bool) (ihl ihr:Bool) : Bool:=ihl&&ihr +def oA (x : α) (p : α→Bool) (ihl ihr:Bool) : Bool:=p x&&ihl&&ihr +noncomputable def me (p : α→Bool) (v : Option α) (_ _ : ab α) (ihl ihr:Bool) : Bool := + Option.rec (motive:=fun _ => (α→Bool)→Bool→Bool→Bool) + n7 + oA + v p ihl ihr +noncomputable def ay (p : α→Bool) (t : ab α) : Bool := + ab.rec (motive:=fun _ => Bool) true (me p) t +theorem AZ {p : α→Bool} {t : ab α} {i : Pos} {x : α} + (hall : ay p t = true) (hget : ig t i = some x) : p x = true := by + induction i generalizing t with + | Z => + cases t with + | empty => contradiction + | node v l r => + change v = some x at hget + subst hget + change (p x&&ay p l&&ay p r) = true at hall + simp only [Bool.and_eq_true] at hall + exact hall.1.1 + | O i ih => + cases t with + | empty => contradiction + | node v l r => + change ig l i = some x at hget + change me p v l r (ay p l) (ay p r) = true at hall + have hl : ay p l = true := by + cases v <;> simp only [me,n7,oA,Bool.and_eq_true] at hall <;> tauto + exact ih hl hget + | E i ih => + cases t with + | empty => contradiction + | node v l r => + change ig r i = some x at hget + change me p v l r (ay p l) (ay p r) = true at hall + have hr : ay p r = true := by + cases v <;> simp only [me,n7,oA,Bool.and_eq_true] at hall <;> tauto + exact ih hr hget +def vO (_:Nat) (_:R) (_ : List Bool) : Bool:=false +noncomputable def v0 (y:dp) (steps:Nat) (fin:R) (prep : List Bool) : Bool := + eO steps fin (jE prep (fw y)) +noncomputable def mN (opt_y : Option dp) (steps:Nat) (fin:R) (prep : List Bool) : Bool := + Option.rec (motive:=fun _ => Nat→R→List Bool→Bool) + vO + v0 + opt_y steps fin prep +noncomputable def Ee (g : ab dp) (qr : List Bool) + (state:bR) (pref : List Bool) (steps:Nat) (target:Pos) (prep : List Bool) : Bool := + mN (ig g target) steps (gh qr (nz state) pref) prep +noncomputable def pC (g : ab dp) (qr : List Bool) (b:py) : Bool := + py.rec (motive:=fun _ => Bool) (Ee g qr) b +def F9 (t:fZ) (_ : ab dp) : Bool:=jj t +noncomputable def EG (gc:mB) (_ : List Bool) (_ : ab dp) : Bool:=nV gc +noncomputable def FN (fin:R) (steps:Nat) (target:Pos) (prep : List Bool) (g : ab dp) : Bool := + mN (ig g target) steps fin prep +noncomputable def FS (qr w : List Bool) (s:k1) (bs : List py) (g : ab dp) : Bool := + kq s w&&yq s bs&&bs.all (pC g qr) +noncomputable def sg (g : ab dp) (r:dp) : Bool := + dp.rec (motive:=fun _ => ab dp→Bool) + F9 EG FN FS r g +theorem Bm (g : ab dp) (hg : ay (sg g) g = true) : + ∀ (i:Pos) (x:dp),ig g i = some x→∀ r,cE (dC (fw x) r) lr := by + intro i x hx r n hn + induction n using Nat.strong_induction_on generalizing i x r with + | h n ih => + have hchk : sg g x = true:=AZ hg hx + cases x with + | rEnd t => + change jj t = true at hchk + exact nP t hchk r n hn + | rProt gc w => + change nV gc = true at hchk + unfold fw CC at hn + rw [zO] at hn + exact Bu gc hchk (be w+>r) n hn + | rNat fin steps target prep => + change mN (ig g target) steps fin prep = true at hchk + rcases hy : ig g target with _ | y + · rw [hy] at hchk; contradiction + · rw [hy] at hchk + change eO steps fin (jE prep (fw y)) = true at hchk + have hp:=gi steps fin (jE prep (fw y)) hchk r + rw [nR] at hp + rcases kz hp hn with ⟨m,hmn,hm⟩ + rcases ih m hmn target y hy (be prep+>r) hm with ⟨k,d,hkm,hsafe,hk⟩ + exact ⟨k,d,by omega,hsafe,hk⟩ + | rRet qr w s bs => + change (kq s w&&yq s bs&&bs.all (pC g qr)) = true at hchk + simp only [Bool.and_eq_true] at hchk + rcases hchk with ⟨⟨hs,hc⟩,hbs⟩ + unfold fw DH at hn + rw [vW] at hn + rcases zk s w hs (bf default (be qr.reverse)) r n hn with ⟨m,c,hmn,hret,hm⟩ + rcases hret with ⟨e,p,r',hin,rfl⟩ + rcases yi s bs (e,p) hc hin with ⟨b,hb,he,hp⟩ + dsimp only at he hp; subst he hp + have hbv : pC g qr b = true:=List.all_eq_true.mp hbs b hb + rcases b with ⟨b_state,b_pref,b_steps,b_target,b_prep⟩ + change mN (ig g b_target) b_steps (gh qr (nz b_state) b_pref) b_prep = true at hbv + rcases hy : ig g b_target with _ | y + · rw [hy] at hbv; contradiction + · rw [hy] at hbv + change eO b_steps (gh qr (nz b_state) b_pref) (jE b_prep (fw y)) = true at hbv + have hnat:=gi b_steps (gh qr (nz b_state) b_pref) (jE b_prep (fw y)) hbv r' + rw [w8,yd,nR] at hnat + have hret_step : (jY b_state (bf default (be qr.reverse)) (be b_pref+>r')) [tm]⊢⁺ (dC (fw y) (be b_prep+>r')) := by + revert hnat; cases b_state <;> intro hnat <;> exact hnat + rcases kz hret_step hm with ⟨a,ham,ha⟩ + rcases ih a (by omega) b_target y hy (be b_prep+>r') ha with ⟨z,d,hza,hsafe,hz⟩ + exact ⟨z,d,by omega,hsafe,hz⟩ +def j9 : W→List b9 + | .UA => [.PL] + | .UT => [.P11,.P11,.PL] +theorem Gx (u:W) : G1 u++wX = b5 (j9 u) := by + cases u <;> rfl +theorem C2 (u:W) : G [u,.UA] = b5 (j9 u) := by + cases u <;> rfl +theorem C4 (u:W) : G [u,.UT] = b5 (j9 u)++wY := by + cases u <;> rfl +theorem A5 (u v:W) (l:ai) (c:aL) + (h : ip (bf l (G [u,v])) c) : cE c (dU l) := by + cases v + · rw [C2] at h + exact lI (j9 u) l c h + · rw [C4,df] at h + have hstack (e:BA) (r0:ai) : + cE (aq (bf l (b5 (j9 u))) [false,false,false,false] e r0) (dU l) := + bh (jC (bf l (b5 (j9 u))) [false,false,false,false] e r0) + (lI (j9 u) l) + cases h with + | contact_D r0 => exact hstack .FromD r0 + | contact_F r0 => exact hstack .FromF r0 + | contact_B r0 => exact hstack .FromB r0 +theorem x4 (d:cm) (us vs : List W) : + cn d (us++vs) = bf (cn d us) (G vs) := by + unfold cn + rw [Gt,← List.append_assoc,df] +theorem Bq (d:cm) (us : List W) (u:W) : + cn d (us++[u]) = bf (cn d us) (G1 u) := by + rw [x4] + simp [G] +theorem Cf (d:cm) (a b c e:W) (r:ai) : + fl (hF d [a,b,c,e] r) lr := by + refine cr (tj d [a,b,c,e] r) ?_ + have hf : cn d [a,b,c,e] = bf (cn d [a,b]) (G [c,e]) := + x4 d [a,b] [c,e] + rw [hf] + refine bh (fv (bf (cn d [a,b]) (G [c,e])) ([0]+>r)) ?_ + intro x hx + refine bh (A5 c e (cn d [a,b]) x hx) ?_ + intro y hy + refine bh (hN d [a,b] y hy) ?_ + intro z hz + exact dg (i8 d [a,b] z (by simp) hz) +theorem Ge (u:W) (l r:ai) : + (DL (bf l (G1 u)) r) [tm]⊢⁺ (DL l (wa+>((match u with | .UA => [] | .UT => wY)+>r))) := by + cases u + · simpa only [G1,append_nil] using! G6 l r + · simpa only [G1,append_assoc] using! + U 13 ⟨(wX++wY).reverse,[],sD,true⟩ ⟨[],wa++wY,sD,true⟩ (by decide) l r +theorem Ei (l r:ai) : + (FL (bf l (G1 .UA)) ([0,0,0]+>r)) [tm]⊢⁺ (FL l ([0,0,0]+>(wa+>r))) := + Dx l r +theorem D9 (l r:ai) : + (FL (bf l (G1 .UT)) ([0,0,0]+>r)) [tm]⊢⁺ (FR (bf l (b5 [.P11])) ([0,0]+>r)) := + U 1 ⟨(wX++wY).reverse,[0,0,0],sF,true⟩ ⟨(b5 [.P11]).reverse,[0,0],sF,false⟩ (by decide) l r +theorem A8 (d:cm) (us : List W) (u:W) (c:aL) + (h : dA (bf (cn d us) (G1 u)) c) + (h1 : ∀ r,cE (BL (bf (cn d us) (G1 u)) ([0,0,1,0,1]+>r)) lr) + (h2 : ∀ r,cE (BL (bf (cn d us) (G1 u)) ([0,0,1,1,1,0,1]+>r)) lr) + (hlen : 2 ≤ us.length) : cE c lr := by + cases h with + | phase_D r => + refine cc (Ge u (cn d us) r) ?_ + refine bh (hN d us _ (.strong_D _)) ?_ + intro e he + exact dg (i8 d us e hlen he) + | phase_F r => + cases u + · refine cc (Ei (cn d us) r) ?_ + refine bh (hN d us _ (.strong_F _)) ?_ + intro e he + exact dg (i8 d us e hlen he) + · refine cc (D9 (cn d us) r) ?_ + refine bh (r8 [.P11] (cn d us) ([0,0]+>r)) ?_ + intro e he + refine bh (hN d us e he) ?_ + intro f hf + exact dg (i8 d us f hlen hf) + | phase_B101 r => exact h1 r + | phase_B11101 r => exact h2 r +def r9 : Prop:=∀ d a b c r, + cE (BL (cn d [a,b,c]) ([0,0,1,0,1]+>r)) lr ∧ + cE (BL (cn d [a,b,c]) ([0,0,1,1,1,0,1]+>r)) lr +theorem Bx (hb:r9) (d:cm) (a b c:W) (r:ai) : + fl (hF d [a,b,c] r) lr := by + refine cr (tj d [a,b,c] r) ?_ + refine bh (uR (cn d [a,b,c]) r) ?_ + intro x hx + have hsnoc : cn d [a,b,c] = bf (cn d [a,b]) (G1 c) := + Bq d [a,b] c + rw [hsnoc] at hx + refine A8 d [a,b] c x hx ?_ ?_ (by simp) + · intro r'; rw [← hsnoc]; exact (hb d a b c r').1 + · intro r'; rw [← hsnoc]; exact (hb d a b c r').2 +theorem Bz (d:cm) (us vs : List W) (r:ai) : + hF d (us++vs) r = hF d us ((match d with | .CD => HD vs | .CF => HF vs)+>r) := by + cases d <;> simp [hF,oa,F0,F7,append_assoc] +theorem zb (hb:r9) (c:aL) (hs : lr c) : fl c lr := by + rcases hs with ⟨d,us,r,hlen,rfl⟩ + rcases us with _ | ⟨a,_ | ⟨b,_ | ⟨e,_ | ⟨f,us'⟩⟩⟩⟩ + · contradiction + · contradiction + · contradiction + · exact Bx hb d a b e r + · have h4 : [a,b,e,f]++us' = a :: b :: e :: f :: us':=rfl + rw [← h4,Bz] + exact Cf d a b e f _ +theorem AU (hb:r9) (c:aL) (hs : lr c) (n:Nat) : ¬ d7 c n := + q3 (zb hb) n c hs +theorem CZ : + (init []) [tm]⊢* (hF .CD [.UA,.UT,.UT] ([1,0,1]+>default)) := by + have h0 : init [] = dw ⟨[],([0] : List gQ) ^ 19,A⟩ default := by + have hz : (([0] : List gQ) ^ 19)+>default = default:=qZ (by decide) + unfold init dw + rw [append_nil,hz] + rfl + have hrun:=kC 405 + ⟨[],([0] : List gQ) ^ 19,A⟩ + ⟨[],[0,0]++oa .CD [.UA,.UT,.UT]++[1,0,1],sE⟩ + (by decide) default + rw [h0] + refine V ?_ + simpa only [dw,hF,CE,append_assoc] using! hrun +abbrev Y:=List Bool +abbrev U_:=List W +abbrev M_:=List b9 +abbrev T_:=ab dp +def cD : cm:=.CD +def cF : cm:=.CF +def Iu : ab dp:=.empty +def nd (x:dp) (l r : ab dp) : ab dp:=.node (some x) l r +def aZ (x:dp) (l : ab dp) : ab dp:=.node (some x) l .empty +def Iv (x:dp) (r : ab dp) : ab dp:=.node (some x) .empty r +def lf (x:dp) : ab dp:=.node (some x) .empty .empty +def z0:Pos:=.Z +def z1:Pos:=.O z0 +def z2:Pos:=.E z0 +def z3:Pos:=.O z1 +def z4:Pos:=.E z1 +def z5:Pos:=.O z2 +def z6:Pos:=.E z2 +def z7:Pos:=.O z3 +def z8:Pos:=.E z3 +def z9:Pos:=.O z4 +def dn:Pos:=.E z4 +def c5:Pos:=.O z5 +def cG:Pos:=.E z5 +def cM:Pos:=.O z6 +def cq:Pos:=.E z6 +def cP:Pos:=.O z7 +def cy:Pos:=.E z7 +def ct:Pos:=.O z8 +def cB:Pos:=.E z8 +def cV:Pos:=.O z9 +def dy:Pos:=.E z9 +def c9:Pos:=.O dn +def dj:Pos:=.E dn +def dP:Pos:=.O c5 +def di:Pos:=.E c5 +def da:Pos:=.O cG +def cA:Pos:=.E cG +def cS:Pos:=.O cM +def cI:Pos:=.E cM +def c8:Pos:=.O cq +def cN:Pos:=.E cq +def c7:Pos:=.O cP +def c0:Pos:=.E cP +def dI:Pos:=.O cy +def dr:Pos:=.E cy +def ds:Pos:=.O ct +def dT:Pos:=.E ct +def c6:Pos:=.O cB +def dl:Pos:=.E cB +def dL:Pos:=.O cV +def cO:Pos:=.E cV +def dM:Pos:=.O dy +def cL:Pos:=.E dy +def cU:Pos:=.O c9 +def cT:Pos:=.E c9 +def dq:Pos:=.O dj +def dY:Pos:=.E dj +def d9:Pos:=.O dP +def d1:Pos:=.E dP +def FO:Pos:=.O di +def Gs:Pos:=.E di +def GN:Pos:=.O da +def Gw:Pos:=.E da +def Gz:Pos:=.O cA +def GJ:Pos:=.E cA +def Gq:Pos:=.O cS +def GI:Pos:=.E cS +def GG:Pos:=.O cI +def Gc:Pos:=.E cI +def Fz:Pos:=.O c8 +def F3:Pos:=.E c8 +def FU:Pos:=.O cN +def GD:Pos:=.E cN +def Hz:Pos:=.O c7 +def H0:Pos:=.E c7 +def HP:Pos:=.O c0 +def HY:Pos:=.E c0 +def HK:Pos:=.O dI +def HX:Pos:=.E dI +def HQ:Pos:=.O dr +def Ik:Pos:=.E dr +def Ie:Pos:=.O ds +def Id:Pos:=.E ds +def HJ:Pos:=.O dT +def HR:Pos:=.E dT +def H8:Pos:=.O c6 +def HL:Pos:=.E c6 +def HE:Pos:=.O dl +def Ig:Pos:=.E dl +def HN:Pos:=.O dL +def HS:Pos:=.E dL +def H2:Pos:=.O cO +def HH:Pos:=.E cO +def G2:Pos:=.O dM +def Hu:Pos:=.E dM +def Ho:Pos:=.O cL +def HG:Pos:=.E cL +def HW:Pos:=.O cU +def HI:Pos:=.E cU +def HU:Pos:=.O cT +def Ib:Pos:=.E cT +def HC:Pos:=.O dq +def H6:Pos:=.E dq +def H5:Pos:=.O dY +def H9:Pos:=.E dY +def Ij:Pos:=.O d9 +def H3:Pos:=.E d9 +def Ic:Pos:=.O d1 +def H7:Pos:=.E d1 +def HZ:Pos:=.O FO +def Hk:Pos:=.E FO +def G4:Pos:=.O Gs +def Hs:Pos:=.E Gs +def Hv:Pos:=.O GN +def GW:Pos:=.E GN +def Hi:Pos:=.O Gw +def Hj:Pos:=.E Gw +def Hx:Pos:=.O Gz +def Hp:Pos:=.E Gz +def GY:Pos:=.O GJ +def G8:Pos:=.E GJ +def G9:Pos:=.O Gq +def Gl:Pos:=.E Gq +def Hr:Pos:=.O GI +def GV:Pos:=.E GI +def Hg:Pos:=.O GG +def G5:Pos:=.E GG +def He:Pos:=.O Gc +def GU:Pos:=.E Gc +def Ht:Pos:=.O Fz +def Hn:Pos:=.E Fz +def Hq:Pos:=.O F3 +def G3:Pos:=.E F3 +def G0:Pos:=.O FU +def Hb:Pos:=.E FU +def Go:Pos:=.O GD +def Hl:Pos:=.E GD +def vE(p:Pos):Pos:=.E (.E (.E p)) +def vH(p:Pos):Pos:=.O (.E (.E p)) +def vB(p:Pos):Pos:=.E (.O (.E p)) +def vy(p:Pos):Pos:=.O (.O (.E p)) +def vD(p:Pos):Pos:=.E (.E (.O p)) +def vx(p:Pos):Pos:=.O (.E (.O p)) +def vA(p:Pos):Pos:=.E (.O (.O p)) +def vI(p:Pos):Pos:=.O (.O (.O p)) +namespace Pos +def p0(p:Pos):Pos:=vE (vE p) +def p1(p:Pos):Pos:=vH (vE p) +def p2(p:Pos):Pos:=vB (vE p) +def p3(p:Pos):Pos:=vy (vE p) +def p4(p:Pos):Pos:=vD (vE p) +def p5(p:Pos):Pos:=vx (vE p) +def p6(p:Pos):Pos:=vA (vE p) +def p7(p:Pos):Pos:=vI (vE p) +def p8(p:Pos):Pos:=vE (vH p) +def p9(p:Pos):Pos:=vH (vH p) +def gL(p:Pos):Pos:=vB (vH p) +def hH(p:Pos):Pos:=vy (vH p) +def f5(p:Pos):Pos:=vD (vH p) +def gj(p:Pos):Pos:=vx (vH p) +def ga(p:Pos):Pos:=vA (vH p) +def f9(p:Pos):Pos:=vI (vH p) +def eA(p:Pos):Pos:=vE (vB p) +def gn(p:Pos):Pos:=vH (vB p) +def fx(p:Pos):Pos:=vB (vB p) +def fM(p:Pos):Pos:=vy (vB p) +def gd(p:Pos):Pos:=vD (vB p) +def gb(p:Pos):Pos:=vx (vB p) +def fq(p:Pos):Pos:=vA (vB p) +def gv(p:Pos):Pos:=vI (vB p) +def fC(p:Pos):Pos:=vE (vy p) +def gm(p:Pos):Pos:=vH (vy p) +def gH(p:Pos):Pos:=vB (vy p) +def fm(p:Pos):Pos:=vy (vy p) +def eS(p:Pos):Pos:=vD (vy p) +def eY(p:Pos):Pos:=vx (vy p) +def gg(p:Pos):Pos:=vA (vy p) +def fL(p:Pos):Pos:=vI (vy p) +def ex(p:Pos):Pos:=vE (vD p) +def fN(p:Pos):Pos:=vH (vD p) +def fK(p:Pos):Pos:=vB (vD p) +def ez(p:Pos):Pos:=vy (vD p) +def eu(p:Pos):Pos:=vD (vD p) +def fA(p:Pos):Pos:=vx (vD p) +def fT(p:Pos):Pos:=vA (vD p) +def eB(p:Pos):Pos:=vI (vD p) +def er(p:Pos):Pos:=vE (vx p) +def gk(p:Pos):Pos:=vH (vx p) +def e1(p:Pos):Pos:=vB (vx p) +def gl(p:Pos):Pos:=vy (vx p) +def fz(p:Pos):Pos:=vD (vx p) +def f8(p:Pos):Pos:=vx (vx p) +def eH(p:Pos):Pos:=vA (vx p) +def eW(p:Pos):Pos:=vI (vx p) +def fi(p:Pos):Pos:=vE (vA p) +def fU(p:Pos):Pos:=vH (vA p) +def fo(p:Pos):Pos:=vB (vA p) +def eZ(p:Pos):Pos:=vy (vA p) +def ev(p:Pos):Pos:=vD (vA p) +def gO(p:Pos):Pos:=vx (vA p) +def fu(p:Pos):Pos:=vA (vA p) +def fD(p:Pos):Pos:=vI (vA p) +def fE(p:Pos):Pos:=vE (vI p) +def f4(p:Pos):Pos:=vH (vI p) +def ft(p:Pos):Pos:=vB (vI p) +def fp(p:Pos):Pos:=vy (vI p) +def gK(p:Pos):Pos:=vD (vI p) +def fP(p:Pos):Pos:=vx (vI p) +def f6(p:Pos):Pos:=vA (vI p) +def e7(p:Pos):Pos:=vI (vI p) +end Pos +def e_:Y:=[] +def bd:Y:=false::e_ +def b1:Y:=true::e_ +def aP:Y:=false::bd +def aE:Y:=false::b1 +def fY:Y:=true::bd +def jN:Y:=true::b1 +def Gu:Y:=false::aP +def aw:Y:=false::fY +def jH:Y:=false::jN +def j:Y:=true::aP +def H:Y:=true::aE +def vV:Y:=true::fY +def xP:Y:=true::jN +def F6:Y:=false::aw +def FY:Y:=false::jH +def L:Y:=false::j +def au:Y:=false::H +def xq:Y:=false::vV +def FQ:Y:=false::xP +def F1:Y:=true::Gu +def bt:Y:=true::aw +def px:Y:=true::jH +def h9:Y:=true::j +def K:Y:=true::H +def yr:Y:=true::vV +def pr:Y:=true::xP +def af:Y:=false::L +def aA:Y:=false::au +def k9:Y:=false::bt +def kW:Y:=false::px +def hj:Y:=false::h9 +def ak:Y:=false::K +def ok:Y:=false::pr +def EV:Y:=true::F6 +def aU:Y:=true::L +def ci:Y:=true::au +def rx:Y:=true::xq +def E5:Y:=true::FQ +def bq:Y:=true::bt +def yR:Y:=true::px +def ah:Y:=true::K +def oG:Y:=true::yr +def yM:Y:=true::pr +def br:Y:=false::af +def bj:Y:=false::ak +def El:Y:=false::ok +def Ef:Y:=false::EV +def ad:Y:=false::aU +def dO:Y:=false::ci +def hO:Y:=false::bq +def X:Y:=false::ah +def vg:Y:=false::oG +def ie:Y:=true::af +def iZ:Y:=true::aA +def mE:Y:=true::k9 +def kx:Y:=true::kW +def aH:Y:=true::hj +def dN:Y:=true::ak +def Bb:Y:=true::ok +def eM:Y:=true::aU +def dV:Y:=true::ci +def pK:Y:=true::rx +def Bh:Y:=true::E5 +def aN:Y:=true::bq +def D7:Y:=true::yR +def dZ:Y:=true::ah +def xS:Y:=true::oG +def Bg:Y:=true::yM +def dD:Y:=false::ad +def Dq:Y:=false::hO +def aB:Y:=false::X +def b3:Y:=false::ie +def e4:Y:=false::iZ +def vZ:Y:=false::mE +def Dn:Y:=false::kx +def bO:Y:=false::aH +def cg:Y:=false::dN +def zq:Y:=false::Bb +def gN:Y:=false::eM +def vU:Y:=false::dV +def vP:Y:=false::pK +def vR:Y:=false::Bh +def b4:Y:=false::aN +def Da:Y:=false::D7 +def lq:Y:=false::dZ +def ao:Y:=true::br +def ar:Y:=true::bj +def CO:Y:=true::El +def C5:Y:=true::Ef +def cC:Y:=true::ad +def e3:Y:=true::dO +def v1:Y:=true::hO +def aV:Y:=true::X +def Dm:Y:=true::vg +def my:Y:=true::mE +def iE:Y:=true::kx +def op:Y:=true::aH +def rS:Y:=true::dN +def ea:Y:=true::eM +def gf:Y:=true::dV +def gS:Y:=true::aN +def bK:Y:=true::dZ +def yx:Y:=true::xS +def Im(t:Y):Y:=false::false::false::false::t +def wp(t:Y):Y:=true::false::false::false::t +def mx(t:Y):Y:=false::true::false::false::t +def wT(t:Y):Y:=true::true::false::false::t +def po(t:Y):Y:=false::false::true::false::t +def js(t:Y):Y:=true::false::true::false::t +def kU(t:Y):Y:=false::true::true::false::t +def lv(t:Y):Y:=true::true::true::false::t +def x1(t:Y):Y:=false::false::false::true::t +def mS(t:Y):Y:=true::false::false::true::t +def kd(t:Y):Y:=false::true::false::true::t +def jM(t:Y):Y:=true::true::false::true::t +def pZ(t:Y):Y:=false::false::true::true::t +def ks(t:Y):Y:=true::false::true::true::t +def nI(t:Y):Y:=false::true::true::true::t +def kI(t:Y):Y:=true::true::true::true::t +def _root_.List.sy(t:Y):Y:=wp (wp t) +def _root_.List.wi(t:Y):Y:=mx (wp t) +def _root_.List.If(t:Y):Y:=po (wp t) +def _root_.List.Hc(t:Y):Y:=js (wp t) +def _root_.List.G7(t:Y):Y:=kU (wp t) +def _root_.List.Do(t:Y):Y:=lv (wp t) +def _root_.List.GO(t:Y):Y:=kd (wp t) +def _root_.List.iG(t:Y):Y:=mx (mx t) +def _root_.List.GK(t:Y):Y:=wT (mx t) +def _root_.List.hU(t:Y):Y:=js (mx t) +def _root_.List.AY(t:Y):Y:=mS (mx t) +def _root_.List.wk(t:Y):Y:=kd (mx t) +def _root_.List.o6(t:Y):Y:=jM (mx t) +def _root_.List.A3(t:Y):Y:=pZ (mx t) +def _root_.List.xE(t:Y):Y:=ks (mx t) +def _root_.List.vS(t:Y):Y:=nI (mx t) +def _root_.List.mu(t:Y):Y:=kI (mx t) +def _root_.List.H4(t:Y):Y:=po (wT t) +def _root_.List.A7(t:Y):Y:=js (wT t) +def _root_.List.yk(t:Y):Y:=lv (wT t) +def _root_.List.zh(t:Y):Y:=po (po t) +def _root_.List.hM(t:Y):Y:=js (po t) +def _root_.List.ya(t:Y):Y:=kU (po t) +def _root_.List.Gd(t:Y):Y:=x1 (po t) +def _root_.List.Eg(t:Y):Y:=mS (po t) +def _root_.List.nj(t:Y):Y:=kd (po t) +def _root_.List.hK(t:Y):Y:=jM (po t) +def _root_.List.jd(t:Y):Y:=mx (js t) +def _root_.List.vz(t:Y):Y:=wT (js t) +def _root_.List.bi(t:Y):Y:=js (js t) +def _root_.List.bg(t:Y):Y:=kU (js t) +def _root_.List.cJ(t:Y):Y:=lv (js t) +def _root_.List.kY(t:Y):Y:=mS (js t) +def _root_.List.aD(t:Y):Y:=kd (js t) +def _root_.List.b8(t:Y):Y:=jM (js t) +def _root_.List.pE(t:Y):Y:=pZ (js t) +def _root_.List.bm(t:Y):Y:=ks (js t) +def _root_.List.ja(t:Y):Y:=nI (js t) +def _root_.List.bu(t:Y):Y:=kI (js t) +def _root_.List.fr(t:Y):Y:=po (kU t) +def _root_.List.xM(t:Y):Y:=js (kU t) +def _root_.List.mX(t:Y):Y:=kU (kU t) +def _root_.List.pU(t:Y):Y:=mS (kU t) +def _root_.List.aX(t:Y):Y:=kd (kU t) +def _root_.List.bH(t:Y):Y:=jM (kU t) +def _root_.List.CR(t:Y):Y:=pZ (kU t) +def _root_.List.cd(t:Y):Y:=ks (kU t) +def _root_.List.aS(t:Y):Y:=nI (kU t) +def _root_.List.b6(t:Y):Y:=kI (kU t) +def _root_.List.bI(t:Y):Y:=mx (lv t) +def _root_.List.Cv(t:Y):Y:=wT (lv t) +def _root_.List.aI(t:Y):Y:=js (lv t) +def _root_.List.iI(t:Y):Y:=kU (lv t) +def _root_.List.wq(t:Y):Y:=lv (lv t) +def _root_.List.F8(t:Y):Y:=mS (lv t) +def _root_.List.bw(t:Y):Y:=kd (lv t) +def _root_.List.dm(t:Y):Y:=jM (lv t) +def _root_.List.EZ(t:Y):Y:=pZ (lv t) +def _root_.List.hL(t:Y):Y:=ks (lv t) +def _root_.List.jr(t:Y):Y:=nI (lv t) +def _root_.List.fy(t:Y):Y:=kI (lv t) +def _root_.List.FH(t:Y):Y:=x1 (x1 t) +def _root_.List.Gy(t:Y):Y:=mS (x1 t) +def _root_.List.xK(t:Y):Y:=kd (x1 t) +def _root_.List.CQ(t:Y):Y:=jM (x1 t) +def _root_.List.FT(t:Y):Y:=ks (x1 t) +def _root_.List.gP(t:Y):Y:=wp (mS t) +def _root_.List.AW(t:Y):Y:=mx (mS t) +def _root_.List.Ev(t:Y):Y:=po (mS t) +def _root_.List.sl(t:Y):Y:=js (mS t) +def _root_.List.n2(t:Y):Y:=kU (mS t) +def _root_.List.eC(t:Y):Y:=lv (mS t) +def _root_.List.vG(t:Y):Y:=kd (mS t) +def _root_.List.ym(t:Y):Y:=po (kd t) +def _root_.List.ib(t:Y):Y:=js (kd t) +def _root_.List.Ej(t:Y):Y:=kU (kd t) +def _root_.List.ae(t:Y):Y:=kd (kd t) +def _root_.List.aF(t:Y):Y:=jM (kd t) +def _root_.List.kB(t:Y):Y:=pZ (kd t) +def _root_.List.e0(t:Y):Y:=ks (kd t) +def _root_.List.aC(t:Y):Y:=nI (kd t) +def _root_.List.bP(t:Y):Y:=kI (kd t) +def _root_.List.cH(t:Y):Y:=mx (jM t) +def _root_.List.vC(t:Y):Y:=wT (jM t) +def _root_.List.cx(t:Y):Y:=js (jM t) +def _root_.List.S(t:Y):Y:=kU (jM t) +def _root_.List.cz(t:Y):Y:=lv (jM t) +def _root_.List.iH(t:Y):Y:=mS (jM t) +def _root_.List.bQ(t:Y):Y:=kd (jM t) +def _root_.List.gR(t:Y):Y:=jM (jM t) +def _root_.List.FX(t:Y):Y:=pZ (jM t) +def _root_.List.fj(t:Y):Y:=ks (jM t) +def _root_.List.ia(t:Y):Y:=nI (jM t) +def _root_.List.eK(t:Y):Y:=kI (jM t) +def _root_.List.r5(t:Y):Y:=x1 (pZ t) +def _root_.List.rG(t:Y):Y:=mS (pZ t) +def _root_.List.ni(t:Y):Y:=kd (pZ t) +def _root_.List.gY(t:Y):Y:=jM (pZ t) +def _root_.List.xY(t:Y):Y:=ks (pZ t) +def _root_.List.Gp(t:Y):Y:=mx (ks t) +def _root_.List.GF(t:Y):Y:=wT (ks t) +def _root_.List.cR(t:Y):Y:=js (ks t) +def _root_.List.bV(t:Y):Y:=kU (ks t) +def _root_.List.aO(t:Y):Y:=lv (ks t) +def _root_.List.mv(t:Y):Y:=mS (ks t) +def _root_.List.aj(t:Y):Y:=kd (ks t) +def _root_.List.ag(t:Y):Y:=jM (ks t) +def _root_.List.GE(t:Y):Y:=pZ (ks t) +def _root_.List.eP(t:Y):Y:=ks (ks t) +def _root_.List.b2(t:Y):Y:=nI (ks t) +def _root_.List.nS(t:Y):Y:=kI (ks t) +def _root_.List.kv(t:Y):Y:=po (nI t) +def _root_.List.pG(t:Y):Y:=js (nI t) +def _root_.List.nT(t:Y):Y:=kU (nI t) +def _root_.List.cQ(t:Y):Y:=kd (nI t) +def _root_.List.bl(t:Y):Y:=jM (nI t) +def _root_.List.eb(t:Y):Y:=ks (nI t) +def _root_.List.iF(t:Y):Y:=nI (nI t) +def _root_.List.q6(t:Y):Y:=kI (nI t) +def _root_.List.fF(t:Y):Y:=mx (kI t) +def _root_.List.pm(t:Y):Y:=wT (kI t) +def _root_.List.eV(t:Y):Y:=js (kI t) +def _root_.List.a0(t:Y):Y:=kU (kI t) +def _root_.List.pl(t:Y):Y:=lv (kI t) +def _root_.List.Ga(t:Y):Y:=mS (kI t) +def _root_.List.eN(t:Y):Y:=kd (kI t) +def _root_.List.dJ(t:Y):Y:=jM (kI t) +def _root_.List.HV(t:Y):Y:=pZ (kI t) +def _root_.List.dK(t:Y):Y:=ks (kI t) +def _root_.List.jq(t:Y):Y:=nI (kI t) +def _root_.List.ec(t:Y):Y:=kI (kI t) +def _root_.List.bo(t:Y):Y:=t.eV.aO +def _root_.List.av(t:Y):Y:=t.aC.bi +def _root_.List.b0(t:Y):Y:=t.aC.aS +def _root_.List.eh(t:Y):Y:=t.kv.hK +def _root_.List.cw(t:Y):Y:=t.bu.aO +def _root_.List.cY(t:Y):Y:=t.pE.aF +def _root_.List.bz(t:Y):Y:=t.bm.aI +def _root_.List.qW(t:Y):Y:=t.bi.aI +def _root_.List.cK(t:Y):Y:=t.bV.ae +def _root_.List.cs(t:Y):Y:=t.S.aj +def _root_.List.eD(t:Y):Y:=t.AY.bi +def _root_.List.gD(t:Y):Y:=t.hU.fr +def _root_.List.cf(t:Y):Y:=t.cd.S +def _root_.List.k7(t:Y):Y:=t.gY.bm +def _root_.List.dv(t:Y):Y:=t.ag.aX +def _root_.List.fQ(t:Y):Y:=t.aO.iG +def _root_.List.bp(t:Y):Y:=t.ae.S +def _root_.List.ET(t:Y):Y:=t.gY.bu +def _root_.List.dB(t:Y):Y:=t.e0.S +def _root_.List.cv(t:Y):Y:=t.bQ.bl +def _root_.List.gC(t:Y):Y:=t.ag.S +def _root_.List.d6(t:Y):Y:=t.bm.bI +def _root_.List.g8(t:Y):Y:=t.e0.bI +def _root_.List.Ft(t:Y):Y:=t.bi.cR +def _root_.List.it(t:Y):Y:=t.eb.S +def _root_.List.EX(t:Y):Y:=t.b8.AY +def _root_.List.dh(t:Y):Y:=t.bm.fy +def _root_.List.EW(t:Y):Y:=t.ni.bi +def _root_.List.fg(t:Y):Y:=t.b8.aX +def _root_.List.gZ(t:Y):Y:=t.cx.S +def _root_.List.fH(t:Y):Y:=t.bV.ag +def _root_.List.iV(t:Y):Y:=t.cx.aC +def _root_.List.Aw(t:Y):Y:=t.bQ.eV +def _root_.List.ik(t:Y):Y:=t.bH.dm +def _root_.List.gE(t:Y):Y:=t.eV.gY +def _root_.List.i9(t:Y):Y:=t.bI.aC +def _root_.List.kk(t:Y):Y:=t.cR.aI +def _root_.List.i0(t:Y):Y:=t.cQ.pG +def _root_.List.ce(t:Y):Y:=t.bl.aC +def _root_.List.i2(t:Y):Y:=t.aI.gP +def _root_.List.g6(t:Y):Y:=t.S.ag +def _root_.List.h8(t:Y):Y:=t.bH.aC +def _root_.List.ho(t:Y):Y:=t.ag.aD +def _root_.List.iv(t:Y):Y:=t.n2.hK +def _root_.List.jQ(t:Y):Y:=t.aI.aO +def _root_.List.g0(t:Y):Y:=t.bH.bw +def _root_.List.kl(t:Y):Y:=t.a0.a0 +def _root_.List.db(t:Y):Y:=t.ET.aO +def _root_.List.dx(t:Y):Y:=t.hL.fy +def _root_.List.io(t:Y):Y:=t.eh.gD +def _root_.List.dt(t:Y):Y:=t.EX.qW +def _root_.List.fd(t:Y):Y:=t.EW.aO +def _root_.List.gT(t:Y):Y:=t.Ft.aI +def _root_.List.eF(t:Y):Y:=t.Aw.aO +def _root_.List.hV(t:Y):Y:=t.k7.aI +def _root_.List.gB(t:Y):Y:=t.jd.aC +def DI : List W:=[.UA,.UA] +def kD : List W:=[.UA,.UA,.UA] +def F5 : List W:=[.UA,.UA,.UA,.UA] +def f7 : List W:=[.UA,.UA,.UT] +def FK : List W:=[.UA,.UA,.UT,.UA] +def Bf : List W:=[.UA,.UT] +def nQ : List W:=[.UA,.UT,.UA] +def FZ : List W:=[.UA,.UT,.UA,.UA] +def EE : List W:=[.UA,.UT,.UA,.UA,.UA] +def Bc : List W:=[.UA,.UT,.UA,.UA,.UA,.UA] +def vY : List W:=[.UA,.UT,.UT] +def Gj : List W:=[.UT,.UA] +def dE : List W:=[.UT,.UA,.UA] +def vr : List W:=[.UT,.UA,.UA,.UA] +def FC : List W:=[.UT,.UA,.UA,.UA,.UA] +def hI : List W:=[.UT,.UA,.UT] +def Dy : List W:=[.UT,.UA,.UT,.UA] +def Gf : List W:=[.UT,.UA,.UT,.UT] +def Gk : List W:=[.UT,.UT] +def mD : List W:=[.UT,.UT,.UA] +def FW : List W:=[.UT,.UT,.UA,.UA] +def fB : List W:=[.UT,.UT,.UT] +def Dr : List W:=[.UT,.UT,.UT,.UA] +def wU : List b9:=[] +def iC : List b9:=[.P11] +def sd : List b9:=[.P11,.P11] +def By : List Bool:=[] +def GA : List Bool:=[false,false] +def rU : List Bool:=[false,false,false,false,true,true,true,true] +def BH : List Bool:=[false,false,true,false] +def rh : List Bool:=[false,false,true,false,false,false,false,false,true,true,true,true,false,false,true,false,false,true,false] +def zG : List Bool:=[false,false,true,true,true,true] +def x6 : List Bool:=[true] +def A2 : List Bool:=[true,false,false,false,false,true,true,true,true] +def D1 : List Bool:=[true,false,false,true,false] +def xF : List Bool:=[true,false,false,true,false,false,false,false,true,true,true,true] +def BB : List Bool:=[true,false,false,true,false,false,true,false] +def BI : List Bool:=[true,false,false,true,true,true,true] +def Bs : List Bool:=[true,false,false,true,true,true,true,true] +def yl : List Bool:=[true,false,false,true,true,true,true,true,false,false,false] +def EK : List Bool:=[true,false,true,false] +def yg : List Bool:=[true,false,true,false,false,false,false,true,true,true,true] +def BN : List Bool:=[true,false,true,false,false,true,false] +def r1 : List Bool:=[true,false,true,false,true,true,true,true] +def vw : List Bool:=[true,false,true,false,true,true,true,true,false,false,true,false,false,true,false] +def CV : List Bool:=[true,false,true,true,true,true] +def Cx : List Bool:=[true,false,true,true,true,true,true] +def Ax : List Bool:=[true,false,true,true,true,true,true,false,false,false] +def Dp : List Bool:=[true,true] +def sw : List Bool:=[true,true,false,false,false,false,false,true,true,true,true] +def Bw : List Bool:=[true,true,true] +def tA : List Bool:=[true,true,true,true] +def Cd : List Bool:=[true,true,true,true,false,false,false] +def Bo : List Bool:=[true,true,true,true,true,false,false,false] +def vF : List Bool:=[true,true,true,true,true,true,false,false,false,true,false,false,false,true,false] +def aM (d:cm) (us : List W) (w : List Bool) : fZ:=.Recovered d us w +def t9 (d:cm) (us : List W) (w : List Bool) : fZ:=.NineGain d us w +def t6 (d:cm) (us : List W) (w : List Bool) : fZ:=.SixGain d us w +def tY (w : List Bool) : fZ:=.YaaGain w +def eU (d:cm) (us : List W) (w : List Bool) : dp:=.rEnd (aM d us w) +def Du (d:cm) (us : List W) (w : List Bool) : dp:=.rEnd (t9 d us w) +def zr (d:cm) (us : List W) (w : List Bool) : dp:=.rEnd (t6 d us w) +def kH (w : List Bool) : dp:=.rEnd (tY w) +def DP (w : List Bool) (s:Nat) (t:Pos) (p : List Bool) : dp:=.rNat (xI w) s t p +def In (q w : List Bool) (s:Nat) (t:Pos) (p : List Bool) : dp:=.rNat (jJ q w) s t p +def Gg (q w : List Bool) (s:Nat) (t:Pos) (p : List Bool) : dp:=.rNat (gh q .qB w) s t p +def rP (b : List Bool) (ps : List b9) (st : List Bool) (nd:Nat) (td:fZ) (nf:Nat) (tf:fZ) (w : List Bool) : dp:=.rProt ⟨b,ps,st,nd,td,nf,tf⟩ w +def dH (q w : List Bool) (s1:Nat) (t1:Pos) (p1 : List Bool) (s2:Nat) (t2:Pos) (p2 : List Bool) (s3:Nat) (t3:Pos) (p3 : List Bool) : dp:=.rRet q w .AllCases [⟨.RD,[],s1,t1,p1⟩,⟨.RF,[false,false],s2,t2,p2⟩,⟨.RB,[false,false],s3,t3,p3⟩] +def eX (q : List Bool) (s1:Nat) (t1:Pos) (p1 : List Bool) (s2:Nat) (t2:Pos) (p2 : List Bool) (s3:Nat) (t3:Pos) (p3 : List Bool) (s4:Nat) (t4:Pos) (p4 : List Bool) : dp:=.rRet q [false,false] .Cases00 [⟨.RD,[true,false,true],s1,t1,p1⟩,⟨.RD,[true,true,true,false,true],s2,t2,p2⟩,⟨.RD,[true,false,true,false,false],s3,t3,p3⟩,⟨.RF,[false,false,false],s4,t4,p4⟩] +def jL (q : List Bool) (s1:Nat) (t1:Pos) (p1 : List Bool) (s2:Nat) (t2:Pos) (p2 : List Bool) (s3:Nat) (t3:Pos) (p3 : List Bool) (s4:Nat) (t4:Pos) (p4 : List Bool) : dp:=.rRet q [true] .Cases1 [⟨.RD,[true,true,false,true],s1,t1,p1⟩,⟨.RD,[false,true,false,false],s2,t2,p2⟩,⟨.RF,[false,false],s3,t3,p3⟩,⟨.RB,[false,false],s4,t4,p4⟩] +def FP (q w : List Bool) (s1:Nat) (t1:Pos) (p1 : List Bool) (s2:Nat) (t2:Pos) (p2 : List Bool) : dp:=.rRet q w .Coarse00 [⟨.RD,[],s1,t1,p1⟩,⟨.RF,[false,false],s2,t2,p2⟩] +def Br (q w : List Bool) (s1:Nat) (t1:Pos) (p1 : List Bool) (s2:Nat) (t2:Pos) (p2 : List Bool) : dp:=.rRet q w .Coarse10 [⟨.RD,[],s1,t1,p1⟩,⟨.RB,[false,false],s2,t2,p2⟩] +noncomputable section +def an:=z6.fu +def ap:=z2.fp +def bv:=dj.f4 +def bN:=z3.gm +def b7:=d1.fT +def ca:=z2.ft +def ch:=dj.fE +def c4:=z8.fT +def ey:=c9.fC +def et:=cq.ga +def dX:=z1.p0 +def ep:=z1.p1 +def fG:=z1.p9 +def hB:=cO.p3 +def fe:=cM.e1 +def hJ:=ct.eS +def hC:=cq.p1 +def iq:=z6.fP +def hD:=dy.eZ +def iK:=cq.p0 +def kA:=z2.f9 +def jK:=dr.hH +def jc:=dM.fU +def iB:=z2.fU +def kw:=z5.p0 +def iJ:=d1.fE +def lF:=cM.fD +def lo:=cP.eW +def iz:=dn.e7 +def je:=z6.ev +def mF:=z6.f6 +def mL:=cP.gm +def mf:=cP.fC +def mG:=ct.fp +def mH:=cO.p1 +def l0:=cI.p3 +def lJ:=cA.er +def mJ:=dP.gn +def nY:=z5.ez +def mK:=dr.gk +def mc:=z6.ex +def mM:=cy.p5 +def lA:=c0.fL +def lm:=cB.fq +def ky:=cP.eY +def pz:=c0.fo +def rQ:=z2.e7 +def nX:=z3.fm +def rO:=cy.gO +def nW:=cG.gm +def sf:=z4.fK +def pw:=z7.gv +def sc:=cU.f5 +def rV:=dy.eS +def r6:=z7.f5 +def nZ:=cy.p2 +def pn:=ct.p5 +def vn:=ds.fC +def sh:=ct.eY +def pB:=dn.p1 +def pq:=cM.p9 +def pA:=cM.gL +def rR:=d1.e1 +def rZ:=cS.gb +def sa:=d1.eu +def rX:=d1.er +def pu:=c0.fT +def sj:=z2.fP +def vc:=c0.fD +def sb:=cP.gH +def vk:=cU.gj +def sk:=cP.gn +def vq:=cO.p8 +def r7:=cP.gg +def pp:=c5.p5 +def vu:=cq.eY +def ve:=di.e1 +def wA:=z2.eZ +def vm:=dy.gL +def vj:=di.eH +def vi:=ds.gH +def vd:=di.fi +def vl:=dl.eA +def yt:=c9.p6 +def rY:=z6.gk +def vt:=cB.gv +def vo:=cI.gH +def xj:=dj.fD +def xr:=cy.gg +def w1:=ds.gv +def yo:=cV.fN +def vh:=da.ez +def vp:=cB.f8 +def yu:=cI.p5 +def wh:=cG.f8 +def xw:=cG.fT +def xn:=cM.gl +def yv:=cP.eS +def yw:=z5.fo +def w2:=cB.gm +def v6:=cI.p4 +def u2:=cB.fC +def uG:=cM.gg +def w6:=dL.gv +def Aq:=cM.hH +def xa:=dn.gb +def wu:=c5.eu +def w9:=dr.gd +def xi:=cL.fx +def ts:=cI.gO +def w3:=cI.fi +def wn:=c9.gl +def wK:=cG.gb +def xC:=cG.fM +def w7:=cG.fA +def wz:=dy.fz +def xl:=dy.gl +def xz:=cS.fA +def wF:=cN.fP +def wc:=c8.p1 +def wV:=dj.f9 +def wC:=dj.f5 +def un:=ct.p4 +def sM:=cM.ft +def rc:=cG.fC +def wm:=dP.fz +def wB:=cM.gk +def zu:=di.p1 +def Cc:=cM.eS +def AI:=z4.fA +def zz:=dy.f6 +def wS:=c0.fu +def wl:=c8.eY +def wO:=dj.ft +def zZ:=z8.f4 +def zE:=cO.p9 +def tO:=cU.eZ +def wg:=cP.p2 +def yS:=c6.fP +def Ai:=cS.gj +def yH:=cA.fA +def xD:=cG.gk +def yQ:=c7.p6 +def v9:=cI.eA +def uC:=cM.fu +def u7:=z7.fm +def y3:=cB.fA +def CA:=di.fz +def Ah:=cB.eH +def xd:=c6.p5 +def wy:=cG.gj +def wN:=z7.gj +def yy:=cU.p6 +def zU:=cT.p6 +def Am:=cP.eZ +def xA:=cM.fp +def zM:=cV.fC +def zx:=dM.fp +def yW:=c7.eY +def zF:=dr.gb +def AP:=dI.eS +def AA:=c5.fi +def zP:=dY.er +def yB:=dY.gk +def xc:=cP.e7 +def y6:=dP.p4 +def y0:=dl.gl +def zf:=c6.fm +def yU:=dj.p6 +def y8:=c8.ez +def AF:=dL.fU +def Ay:=c5.p4 +def w4:=c5.p7 +def Az:=da.gm +def As:=cV.eu +def AK:=dn.ex +def wJ:=c9.f9 +def zp:=dq.eZ +def xo:=cB.ex +def zX:=dj.fu +def zm:=da.fo +def nD:=bd.ag +def sS:=e_.cd +def lO:=oG.ag +def kV:=vV.a0 +def AD:=e_.jr +def yJ:=bd.dK +def i4:=xq.ag +def ql:=fY.dJ +def kt:=yr.eb +def cZ:=vP.ag +def fk:=rx.S +def il:=pK.cd +def lD:=vV.cd +def xv:=fY.S +def o1:=yx.cd +def qt:=xS.S +def B1:=vV.b6 +def yD:=rx.eK +def rF:=vP.dK +def aQ:=bd.hM +def aY:=b1.xM +def cj:=e_.bQ +def BR:=xq.nS +def Al:=fY.cz +def tc:=pK.jr +def bF:=aE.ni +def bE:=aP.xK +def rq:=yx.b6 +def cl:=e_.iG +def cX:=e_.cH +def ed:=b1.aI +def fI:=b1.bI +def dS:=e_.wk +def dk:=aE.bl +def dz:=e_.hU +def An:=xS.cz +def d8:=bd.hK +def d0:=bd.bi +def d4:=aP.FT +def eQ:=e_.cx +def Cr:=b1.eb +def e6:=aP.aF +def fX:=b1.bH +def gx:=e_.yk +def ox:=aE.eN +def gq:=aE.pG +def g5:=e_.ib +def gX:=aP.eC +def g7:=b3.bl +def g2:=K.aC +def hW:=e_.ia +def hQ:=cg.bl +def h5:=aE.xY +def iD:=bd.jd +def i6:=fY.bI +def iX:=af.bQ +def iY:=e_.iH +def iQ:=ie.aI +def iS:=aV.aI +def iN:=e_.aC +def l6:=e_.bm +def jk:=L.bP +def jv:=e_.aF +def jt:=aE.aO +def jD:=j.Do +def jw:=H.eC +def jl:=H.sl +def ju:=j.Hc +def jy:=ah.bm +def jn:=b1.nj +def jT:=bq.bl +def kn:=b1.bP +def jX:=e4.bl +def kr:=bd.bQ +def kc:=fY.bH +def ke:=ak.bQ +def ki:=e_.pE +def j5:=H.aO +def kg:=L.aC +def jZ:=bd.zh +def jU:=H.Ev +def ka:=j.If +def k6:=aP.ib +def kO:=b1.bw +def ld:=e_.vS +def kJ:=bd.kY +def kS:=L.wk +def rD:=L.bm +def kP:=e_.H4 +def k0:=b1.fr +def lk:=K.wk +def lR:=fY.aI +def mq:=bd.iH +def mh:=j.vS +def lT:=bd.aX +def lS:=e_.aD +def lV:=e_.A7 +def lM:=aE.cQ +def lG:=j.cJ +def lP:=bd.cx +def nL:=j.GO +def mW:=e_.AY +def nK:=b1.hL +def m3:=aP.bQ +def nl:=H.eV +def nH:=ao.aI +def mY:=dN.aI +def mT:=ah.kY +def m4:=K.bm +def nk:=aE.aC +def nr:=H.aC +def nC:=ar.aI +def nE:=K.bl +def np:=aP.cR +def oS:=aE.gY +def oz:=aP.CQ +def oc:=iZ.aI +def o4:=X.bQ +def oB:=aE.Ev +def oH:=br.aF +def ob:=ak.jd +def oX:=j.bH +def oo:=af.jd +def oD:=aE.sl +def o5:=j.aF +def o7:=H.ni +def oZ:=aP.Gp +def pd:=aw.bl +def oJ:=j.bQ +def oN:=bt.eV +def pY:=L.vS +def pR:=e_.S +def rb:=H.fF +def q9:=ci.aI +def qM:=br.ib +def FG:=ok.ag +def qJ:=bd.bm +def rB:=K.AY +def qI:=bj.aF +def rC:=aU.kY +def rK:=e_.bu +def qR:=aE.eV +def qz:=aP.eP +def rH:=K.vS +def rJ:=br.bQ +def q4:=b1.hK +def qq:=bq.aC +def rE:=ak.bm +def rN:=af.bm +def qc:=aw.kv +def pT:=bj.bQ +def q5:=b1.bm +def ru:=aU.bm +def q7:=H.vG +def rs:=X.bi +def qn:=L.AY +def tg:=j.bI +def u1:=ah.bu +def uP:=aE.bQ +def ul:=K.Ev +def sP:=K.bP +def uj:=j.mu +def uN:=hj.bl +def uO:=H.bl +def tF:=K.sl +def tW:=L.bl +def tk:=ak.bi +def ug:=aE.bV +def vb:=e_.cJ +def ub:=e_.fj +def t5:=cC.aI +def uK:=bd.aC +def ur:=H.gY +def ty:=H.AY +def uS:=aP.Gy +def ut:=br.xK +def Et:=fY.eb +def tP:=h9.aI +def ui:=aP.ae +def t0:=au.bi +def tS:=H.aI +def uB:=bd.ya +def tN:=aP.cx +def tq:=b1.cJ +def ue:=au.jd +def uq:=af.bi +def tE:=bd.aD +def Ez:=bd.nS +def jm:=AD.ag +def iP:=kV.ag +def fc:=ql.cd +def kb:=yJ.S +def fa:=sS.cz +def iA:=nD.a0 +def dF:=B1.ag +def ny:=sS.dJ +def hR:=kt.cz +def j0:=nD.b6 +def eT:=lO.b6 +def iy:=Al.eb +def j7:=xv.nS +def eI:=BR.cz +def h7:=lD.eK +def n3:=kV.dK +def gs:=o1.eK +def kQ:=lO.a0 +def rl:=yJ.eK +def gr:=rq.ag +def sV:=il.dK +def zt:=fk.jq +def gF:=qt.nS +def gG:=yD.b6 +def BF:=lD.gR +def eE:=nD.jr +def B5:=i4.iI +def B2:=nD.aS +def rv:=i4.fy +def pV:=AD.nS +def mU:=kt.dJ +def uk:=sS.S +def gu:=cj.bl +def BQ:=xv.eP +def zc:=il.bQ +def gU:=yD.cd +def k8:=rF.eK +def ol:=qt.eP +def tr:=fk.eb +def t7:=rF.bQ +def h3:=tc.ag +def t8:=i4.aS +def zC:=fk.eP +def ua:=ql.jr +def Cb:=o1.bQ +def nB:=xv.ag +def pc:=nD.cd +def oe:=tc.eP +def sR:=lO.aS +def BP:=il.ag +def AN:=lD.cz +def AQ:=yD.aS +def BC:=cZ.eN +def m8:=BR.S +def jA:=An.eb +def sX:=cZ.aI +def jV:=ox.bl +def rg:=tc.nS +def kp:=fI.bl +def ko:=i4.jr +def j2:=Cr.S +def kj:=rF.cz +def Er:=cZ.cz +def tH:=cZ.pl +def s5:=qt.b2 +def zJ:=kt.S +def wG:=o1.fj +def yO:=o1.S +def Fx:=xv.b2 +def FI:=Cr.dJ +def yF:=rq.cd +def Ew:=cZ.eb +def mP:=fk.dK +def BM:=qt.ag +def v7:=il.dJ +def yV:=i4.dm +def y1:=fk.a0 +def BX:=il.eb +def BE:=lD.ia +def BG:=lO.cd +def ra:=lO.ec +def Ch:=lO.ag +def qu:=FG.jr +def pS:=An.jq +def E1:=yJ.fj +def Fi:=cZ.S +def E0:=i4.hL +def FD:=AD.b2 +def E2:=An.S +def uf:=dS.bl +def sW:=rD.bI +def u8:=lD.fj +def s6:=cX.bl +def tU:=cl.bl +def uU:=ed.aI +def tT:=l6.aI +def Fe:=Et.eb +def s9:=ql.fy +def va:=ed.aO +def ES:=il.a0 +def sI:=Ez.S +def uu:=rF.fj +def ou:=jm.aI +def pf:=fc.bV +def d5:=n3.eK +def nh:=iP.e0 +def Cl:=fa.eV +def k4:=sV.cd +def uI:=kb.bl +def iT:=jm.jr +def i1:=rl.b6 +def jx:=iA.bl +def AC:=j0.bl +def g3:=kb.dK +def jp:=ny.aI +def hY:=kQ.ec +def j8:=h7.e0 +def qN:=jm.dm +def oQ:=j7.bV +def ii:=zc.ag +def o9:=zt.S +def iu:=rv.b8 +def v8:=uk.bl +def i3:=fc.dJ +def BU:=BF.bw +def lH:=pV.cz +def nn:=zC.cd +def jg:=hR.b8 +def BD:=eT.aX +def o3:=BC.ag +def E8:=B2.ag +def BZ:=tr.cQ +def jS:=mU.fy +def EO:=B5.eV +def rI:=kb.a0 +def yZ:=AN.b8 +def uW:=t8.S +def w0:=Er.ae +def li:=ua.nS +def kZ:=iA.ec +def kK:=ol.cd +def Fh:=fa.cd +def Ag:=fc.eb +def uy:=ny.jr +def mj:=iP.a0 +def EN:=BQ.fj +def uX:=Fx.cR +def l8:=Cb.ag +def tM:=dF.a0 +def Fy:=B5.aj +def l4:=FI.jr +def AE:=kb.ag +def wZ:=sR.S +def ns:=Ew.bi +def nu:=iy.eK +def nb:=sX.cz +def Fv:=fa.b6 +def nx:=ny.b6 +def Fp:=BQ.S +def wM:=iy.dJ +def m2:=dF.jr +def Ey:=B2.b2 +def wf:=j0.aX +def nM:=iA.nS +def EM:=hR.cx +def zB:=eI.eb +def oj:=pc.bV +def B4:=zJ.nS +def y9:=k8.bH +def n6:=iA.dK +def oO:=oe.cd +def n5:=t7.ag +def pg:=iP.pl +def oy:=j0.eP +def oW:=ny.fy +def E9:=BM.fy +def y2:=jm.cd +def E7:=nB.e0 +def ph:=AQ.S +def o0:=dF.e0 +def Fu:=BF.cd +def BY:=yO.ec +def oM:=iy.aO +def os:=yF.e0 +def Fj:=BP.cR +def EF:=iP.aj +def Cp:=rg.cx +def qX:=hR.iF +def rm:=eI.ec +def Fn:=wG.aF +def Fq:=eT.bV +def rd:=BX.b8 +def Cz:=zt.cz +def BT:=BE.cR +def pX:=dF.bP +def qi:=tH.cd +def BV:=BP.aX +def BW:=BG.eK +def B9:=s5.cR +def ri:=fa.iF +def Cq:=E1.S +def ro:=yV.bg +def Cm:=Fi.cR +def rk:=iy.eb +def Fr:=E0.ae +def qg:=hR.eb +def rn:=gr.dJ +def tC:=m8.dK +def uE:=gs.bH +def EA:=FD.ag +def uv:=y1.e0 +def uY:=E2.bV +def tv:=ny.dm +def tt:=j7.gR +def uQ:=gG.ec +def Eq:=hR.cd +def tL:=t7.dK +def te:=j0.cx +def Fd:=gs.aD +def Fm:=gF.e0 +def sK:=j7.aX +def EH:=iP.eV +def s7:=eT.eP +def uw:=AQ.fj +def uF:=Fe.ae +def tx:=iP.ag +def ta:=Cb.eP +def uV:=v7.S +def uA:=iP.b6 +def tz:=Ch.bH +def uh:=ES.ae +def m9:=ou.S +def g9:=pf.ag +def lK:=Cl.S +def i5:=uI.cd +def wr:=BU.e0 +def xu:=E8.bi +def uL:=EO.b8 +def j3:=BD.ag +def kL:=AC.cd +def yA:=BZ.S +def tw:=Fh.ae +def CG:=qN.bg +def wQ:=EN.bg +def l3:=Fy.ae +def ma:=yZ.dm +def lU:=nh.cz +def u5:=oQ.ag +def B6:=k4.S +def Co:=Fv.bi +def mZ:=o9.ag +def mQ:=Fp.ae +def zR:=Ey.aF +def nF:=Ag.b8 +def nG:=EM.cd +def ov:=w0.ag +def n1:=E9.ag +def n8:=v8.b6 +def Cj:=AE.jq +def oL:=E7.fj +def oK:=Fu.bi +def Cw:=Fj.cd +def qd:=uW.pl +def re:=B4.a0 +def qx:=EF.S +def qV:=Fn.cd +def rA:=Fq.ae +def qK:=rI.e0 +def qQ:=BY.S +def rf:=Fr.S +def qy:=wZ.eP +def rt:=uy.bV +def qh:=jx.b6 +def FB:=o3.cd +def tb:=zB.aX +def tB:=nh.S +def tl:=nn.cx +def tV:=EA.aD +def tR:=Cz.b8 +def sU:=BT.b8 +def tp:=Eq.ae +def uD:=Cl.bQ +def sJ:=iT.bV +def s0:=i1.eb +def uH:=Fd.aF +def uo:=Fm.bi +def tu:=tM.cx +def th:=j8.S +def s8:=uX.S +def tD:=BV.aF +def tn:=Cp.ae +def sO:=BW.eb +def u0:=y2.ec +def u3:=lH.a0 +def ED:=EH.ae +def tK:=y9.bi +def uc:=Cq.cx +def tG:=v8.cd +def sQ:=wf.ag +def um:=B9.S +def sY:=AC.aI +def ud:=Cm.bg +def u6:=wM.aD +def uJ:=jp.cz +def lW:=wr.S +def l9:=CG.ag +def m1:=xu.b8 +def na:=yA.ag +def ot:=B6.bV +def oY:=Co.S +def oV:=uL.cd +def B0:=lK.ag +def qf:=m9.eb +def q8:=Cj.ag +def qa:=wQ.ag +def qY:=Cw.S +def rr:=zR.cd +def qo:=tw.e0 +def rL:=FB.e0 +def ti:=m9.ag +def sL:=ED.S +def Eu:=u5.cd +def pI:=B0.b8 +def tJ:=Eu.cd +def zL a1 a2 a3:=DP a1 a2 a3 e_ +def zj a1 a2 a3 a4 a5 a6 a7:=dH a1 e_ a2 a3 e_ a4 a5 e_ a6 a7 e_ +def km a1:=Du cD Gk a1 +def yK a1:=eU cD kD a1 +def zn a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=jL a1 a2 a3 a4 a2 a3 a5 a6 a7 a8 a9 a7 a10 +def og a1 a2 a3 a4 a5 a6 a7:=dH a1 bd a2 a3 e_ a4 a5 e_ a6 a7 e_ +def zd a1:=zr cD DI a1 +def At a1 a2 a3 a4 a5 a6 a7 a8:=eX a1 a2 a3 a4 a2 a3 a5 a2 a3 a6 a7 a8 e_ +def Ad a1 a2 a3 a4 a5 a6 a7 a8 a9:=eX a1 a2 a3 a4 a2 a3 a5 a2 a3 a6 a7 a8 a9 +def zQ a1:=Du cD Bf a1 +def Cy a1:=eU cD vY a1 +def zH a1 a2 a3 a4 a5 a6 a7 a8:=jL a1 a2 a3 e_ a2 a4 e_ a5 a6 e_ a7 a8 e_ +def AO a1:=eU cD FZ a1 +def yG a1 a2 a3 a4 a5 a6:=eX a1 a2 a3 e_ a2 a4 e_ a2 a3 aP a5 a6 e_ +def Ab a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 e_ a2 a3 a4 a5 a6 e_ a7 a8 e_ +def Af a1:=eU cF f7 a1 +def zl a1 a2 a3 a4 a5 a6 a7:=eX a1 a2 a3 e_ a4 a5 e_ a2 a3 aP a6 a7 e_ +def zA a1 a2 a3 a4 a5 a6 a7 a8 a9:=jL a1 a2 a3 a4 a2 a3 a5 a6 a7 e_ a8 a9 e_ +def wW a1:=eU cD hI a1 +def yI a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 e_ a4 a5 a6 a7 a8 e_ +def zN a1 a2 a3 a4 a5 a6 a7 a8 a9:=jL a1 a2 a3 e_ a4 a5 e_ a6 a7 e_ a8 a9 e_ +def zv a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 e_ a4 a5 a6 a7 a5 a8 +def BO a1 a2 a3 a4 a5 a6 a7:=eX a1 a2 a3 e_ a2 a4 e_ a2 a5 e_ a6 a7 e_ +def ws a1:=eU cF fB a1 +def AH a1 a2 a3 a4 a5 a6 a7 a8 a9:=dH a1 bd a2 a3 a4 a5 a6 a7 a8 a6 a9 +def AJ a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=jL a1 a2 a3 a4 a2 a3 a5 a6 a7 e_ a8 a9 a10 +def zy a1 a2 a3 a4 a5 a6 a7 a8:=eX a1 a2 a3 e_ a4 a5 b1 a2 a3 aP a6 a7 a8 +def AG a1 a2 a3 a4 a5 a6 a7 a8 a9:=dH a1 e_ a2 a3 a4 a5 a6 a7 a8 a6 a9 +def Cn a1:=eU cF nQ a1 +def zD a1:=eU cF dE a1 +def pJ a1 a2 a3 a4 a5 a6 a7 a8:=eX a1 a2 a3 a4 a2 a3 a5 a2 a3 a6 a7 a8 bd +def ww a1:=eU cD dE a1 +def q1 a1:=Du cD DI a1 +def Ci a1:=eU cD F5 a1 +def qk a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 e_ a2 a3 e_ a4 a5 a6 a7 a5 a8 +def zW a1 a2 a3 a4 a5 a6 a7 a8 a9:=eX a1 a2 a3 e_ a4 a5 a6 a2 a3 aP a7 a8 a9 +def Fa a1 a2 a3 a4:=Gg a1 a2 a3 a4 e_ +def zw a1:=zr cD Gj a1 +def xb a1:=eU cD fB a1 +def m0 a1 a2 a3 a4 a5 a6 a7:=dH a1 b1 a2 a3 e_ a4 a5 e_ a6 a7 e_ +def oi a1 a2 a3 a4 a5 a6 a7 a8 a9:=dH a1 bd a2 a3 a4 a5 a6 a7 a8 a9 e_ +def xe a1 a2 a3 a4 a5 a6 a7 a8:=eX a1 a2 a3 e_ a4 a5 a6 a2 a3 aP a7 a8 e_ +def uT a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11:=jL a1 a2 a3 e_ a4 a5 a6 a7 a8 a9 a10 a8 a11 +def oP a1 a2 a3 a4 a5 a6 a7:=dH a1 bd a2 a3 e_ a4 a5 e_ a6 a7 bd +def pP a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 e_ a4 a5 a6 a7 a8 bd +def Fo a1:=eU cD mD a1 +def lB a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 a4 a5 a6 e_ a7 a8 e_ +def BK a1:=eU cD f7 a1 +def rp a1:=zr cD Gk a1 +def oC a1 a2 a3 a4 a5 a6 a7 a8 a9:=jL a1 a2 a3 e_ a2 a4 e_ a5 a6 a7 a8 a6 a9 +def oT a1 a2 a3 a4 a5 a6 a7 a8 a9:=jL a1 a2 a3 e_ a2 a4 e_ a5 a6 e_ a7 a8 a9 +def oE a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 bd a4 a5 a6 a7 a5 a8 +def nJ a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=jL a1 a2 a3 e_ a4 a5 e_ a6 a7 a8 a9 a7 a10 +def oI a1 a2 a3 a4 a5:=FP a1 aP a2 a3 e_ a4 a5 e_ +def Fk a1:=Du cD Gj a1 +def jo a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=jL a1 a2 a3 e_ a4 a5 e_ a6 a7 e_ a8 a9 a10 +def wI a1 a2 a3 a4 a5 a6 a7 a8:=eX a1 a2 a3 e_ a4 a5 e_ a2 a3 aP a6 a7 a8 +def jB a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11:=jL a1 a2 a3 e_ a4 a5 a6 a7 a8 a9 a10 a11 e_ +def Cs a1:=eU cF vY a1 +def Ar a1:=eU cD nQ a1 +def zT a1 a2 a3 a4 a5 a6 a7:=eX a1 a2 a3 e_ a4 a5 b1 a2 a3 aP a6 a7 e_ +def lz a1:=eU cF kD a1 +def lL a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11:=eX a1 a2 a3 e_ a4 a5 a6 a7 a8 e_ a9 a10 a11 +def wP a1 a2 a3 a4 a5 a6 a7 a8 a9:=eX a1 a2 a3 e_ a4 a5 e_ a6 a7 e_ a8 a9 e_ +def lZ a1 a2 a3 a4 a5 a6 a7:=eX a1 a2 a3 e_ a2 a4 e_ a2 a3 aP a5 a6 a7 +def l5 a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 e_ a2 a3 e_ a4 a5 e_ a6 a7 a8 +def E3 a1:=eU cD vr a1 +def FF a1:=eU cD Dy a1 +def EC a1:=zr cD Bf a1 +def pe a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=eX a1 a2 a3 e_ a4 a5 a6 a7 a8 e_ a9 a10 bd +def ow a1 a2 a3 a4 a5 a6 a7 a8:=eX a1 a2 a3 e_ a4 a5 a6 a2 a3 aP a7 a5 a8 +def pk a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11:=jL a1 a2 a3 e_ a4 a5 a6 a7 a8 e_ a9 a10 a11 +def ry a1 a2 a3 a4 a5 a6 a7:=dH a1 e_ a2 a3 e_ a4 a5 bd a6 a7 e_ +def ER a1:=eU cD EE a1 +def qL a1 a2 a3 a4 a5 a6 a7:=dH a1 e_ a2 a3 e_ a4 a5 e_ a6 a7 aP +def rM a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 e_ a2 a3 a4 a5 a6 e_ a7 a3 a8 +def qb a1 a2 a3 a4:=rP a1 iC a2 a3 (aM cD dE e_) a4 (aM cF dE e_) b1 +def Ex a1 a2 a3 a4 a5 a6 a7 a8:=eX a1 a2 a3 e_ a4 a5 e_ a2 a6 e_ a7 a8 e_ +def q2 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=jL a1 a2 a3 e_ a4 a5 a6 a7 a5 a8 a9 a5 a10 +def qP a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 aP a4 a5 a6 a7 a5 a8 +def qU a1 a2 a3 a4 a5 a6 a7 a8:=jL a1 a2 a3 a4 a2 a3 a5 a6 a7 a4 a8 a7 a5 +def qG a1:=eU cF hI a1 +def pW a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=jL a1 a2 a3 e_ a4 a5 a6 a7 a8 e_ a9 a10 e_ +def qp a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 a4 a5 a6 a7 a8 a6 a4 +def EB a1:=eU cF FC a1 +def pO a1 a2 a3 a4 a5 a6 a7 a8:=eX a1 a2 a3 a4 a2 a3 a5 a2 a3 a6 a7 a3 a8 +def tQ a1 a2 a3 a4 a5 a6 a7 a8 a9:=jL a1 a2 a3 a4 a2 a3 a5 a6 a7 e_ a8 a9 aP +def tZ a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 a4 a5 a6 e_ a7 a3 a8 +def uZ a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 bd a4 a5 a6 a7 a8 aP +def tI a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 a4 a5 a3 a6 a7 a3 a8 +def sN a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=eX a1 a2 a3 e_ a4 a5 a6 a7 a8 e_ a9 a5 a10 +def xB a1 a2 a3 a4 a5 a6 a7 a8 a9:=jL a1 a2 a3 a4 a2 a3 a5 a6 a3 a7 a8 a3 a9 +def xh a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=jL a1 a2 a3 e_ a4 a5 e_ a6 a7 a8 a9 a10 e_ +def wR a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=jL a1 a2 a3 e_ a4 a5 a6 a7 a8 e_ a9 a10 aP +def wE a1 a2 a3 a4 a5 a6 a7 a8:=dH a1 bd a2 a3 bd a4 a5 a6 a7 a8 e_ +def wH a1 a2 a3 a4 a5 a6 a7 a8:=eX a1 a2 a3 e_ a4 a5 a6 a2 a3 aP a7 a8 bd +def yL a1 a2 a3 a4 a5 a6 a7:=dH a1 bd a2 a3 e_ a4 a5 e_ a6 a7 aP +def zo a1 a2 a3 a4 a5 a6 a7 a8 a9:=jL a1 a2 a3 e_ a4 a5 bd a6 a7 e_ a8 a9 e_ +def yN a1 a2 a3 a4 a5 a6 a7 a8 a9:=eX a1 a2 a3 e_ a4 a5 a6 a2 a7 e_ a8 a9 e_ +def yC a1 a2 a3 a4 a5 a6 a7:=eX a1 a2 a3 e_ a2 a4 e_ a2 a5 e_ a6 a7 bd +def yz a1 a2 a3 a4 a5 a6 a7:=dH a1 e_ a2 a3 bd a4 a5 e_ a6 a7 e_ +def Aa a1 a2 a3 a4 a5 a6 a7 a8 a9:=jL a1 a2 a3 a4 a2 a3 a5 a6 a7 e_ a8 a3 a9 +def AB a1 a2 a3 a4:=rP a1 iC a2 a3 (aM cD nQ e_) a4 (aM cF nQ e_) e_ +def yE a1 a2 a3:=rP a1 iC x6 a2 (aM cD f7 e_) a3 (aM cF f7 e_) b1 +def ac a1 a2 a3:=lf (zL a1 a2 a3) +def al a1:=lf (km a1) +def aG a1:=lf (zd a1) +def aK a1:=lf (yK a1) +def aT a1 a2 a3 a4 a5 a6 a7:=lf (zj a1 a2 a3 a4 a5 a6 a7) +def bk a1:=lf (Cy a1) +def bC a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=lf (zn a1 a2 a3 a4 a5 a6 a7 a8 a9 a10) +def bM a1 a2 a3 a4 a5 a6 a7 a8:=lf (At a1 a2 a3 a4 a5 a6 a7 a8) +def bZ a1 a2 a3 a4 a5 a6 a7 a8 a9:=lf (Ad a1 a2 a3 a4 a5 a6 a7 a8 a9) +def co a1:=lf (ww a1) +def cp a1 a2 a3 a4 a5 a6:=lf (yG a1 a2 a3 a4 a5 a6) +def dc a1:=lf (ws a1) +def dd a1 a2 a3 a4:=lf (Fa a1 a2 a3 a4) +def d2 a1:=lf (Cn a1) +def em a1 a2 a3 a4 a5 a6 a7 a8:=lf (zH a1 a2 a3 a4 a5 a6 a7 a8) +def eo a1 a2 a3 a4 a5 a6 a7 a8:=lf (yI a1 a2 a3 a4 a5 a6 a7 a8) +def e8 a1 a2 a3 a4 a5 a6 a7 a8:=lf (pJ a1 a2 a3 a4 a5 a6 a7 a8) +def ff a1 a2 a3 a4 a5 a6 a7:=lf (zl a1 a2 a3 a4 a5 a6 a7) +def fb a1 a2 a3:=lf (eU a1 a2 a3) +def e5 a1 a2 a3 a4 a5 a6 a7 a8:=lf (qk a1 a2 a3 a4 a5 a6 a7 a8) +def fW a1:=lf (Fo a1) +def fJ a1:=lf (zQ a1) +def g4 a1 a2 a3 a4 a5 a6 a7:=lf (og a1 a2 a3 a4 a5 a6 a7) +def g1 a1 a2 a3 a4 a5 a6 a7 a8:=lf (zy a1 a2 a3 a4 a5 a6 a7 a8) +def hZ a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13:=lf (jL a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13) +def hT a1 a2 a3 a4 a5 a6 a7 a8 a9:=lf (AH a1 a2 a3 a4 a5 a6 a7 a8 a9) +def h6 a1 a2 a3 a4 a5 a6 a7 a8 a9:=lf (oi a1 a2 a3 a4 a5 a6 a7 a8 a9) +def ij a1 a2 a3 a4 a5 a6 a7 a8 a9:=lf (AG a1 a2 a3 a4 a5 a6 a7 a8 a9) +def iR a1 a2 a3 a4 a5 a6 a7 a8:=lf (Ab a1 a2 a3 a4 a5 a6 a7 a8) +def i7 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=lf (AJ a1 a2 a3 a4 a5 a6 a7 a8 a9 a10) +def iO a1 a2 a3 a4:=lf (DP a1 a2 a3 a4) +def iM a1:=lf (xb a1) +def iL a1 a2 a3 a4 a5 a6 a7 a8 a9:=lf (zA a1 a2 a3 a4 a5 a6 a7 a8 a9) +def ji a1:=lf (Fk a1) +def kf a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11:=lf (dH a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11) +def lb a1:=lf (AO a1) +def lc a1 a2 a3 a4 a5 a6 a7 a8 a9:=lf (zN a1 a2 a3 a4 a5 a6 a7 a8 a9) +def lg a1 a2 a3 a4 a5 a6 a7 a8 a9:=lf (zW a1 a2 a3 a4 a5 a6 a7 a8 a9) +def la a1 a2 a3 a4 a5 a6 a7:=lf (BO a1 a2 a3 a4 a5 a6 a7) +def ms a1:=lf (BK a1) +def ml a1:=lf (Af a1) +def ly a1:=lf (Ar a1) +def mg a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11:=lf (uT a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11) +def mb a1 a2 a3 a4 a5 a6 a7 a8:=lf (zv a1 a2 a3 a4 a5 a6 a7 a8) +def nA a1 a2 a3 a4 a5 a6 a7 a8 a9:=lf (oC a1 a2 a3 a4 a5 a6 a7 a8 a9) +def n4 a1:=lf (EC a1) +def pa a1:=lf (Ci a1) +def q0 a1 a2 a3 a4 a5:=lf (Gg a1 a2 a3 a4 a5) +def pM a1 a2 a3 a4 a5 a6 a7 a8:=lf (pP a1 a2 a3 a4 a5 a6 a7 a8) +def qm a1 a2 a3 a4 a5 a6 a7 a8 a9 a10:=lf (nJ a1 a2 a3 a4 a5 a6 a7 a8 a9 a10) +def J a1 a2 a3 l:=aZ (zL a1 a2 a3) l +def aW a1 l:=aZ (km a1) l +def bA a1 a2 a3 a4 a5 a6 a7 l:=aZ (zj a1 a2 a3 a4 a5 a6 a7) l +def bD a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 l:=aZ (zn a1 a2 a3 a4 a5 a6 a7 a8 a9 a10) l +def bT a1 a2 a3 a4 l:=aZ (DP a1 a2 a3 a4) l +def ck a1 l:=aZ (zd a1) l +def de a1 l:=aZ (yK a1) l +def du a1 a2 a3 a4 a5 a6 a7 a8 a9 l:=aZ (Ad a1 a2 a3 a4 a5 a6 a7 a8 a9) l +def dG a1 l:=aZ (Af a1) l +def ek a1 a2 a3 a4 a5 a6 a7 a8 l:=aZ (Ab a1 a2 a3 a4 a5 a6 a7 a8) l +def en a1 l:=aZ (Cy a1) l +def ej a1 a2 a3 a4 a5 a6 a7 a8 a9 l:=aZ (zA a1 a2 a3 a4 a5 a6 a7 a8 a9) l +def eG a1 a2 a3 a4 a5 a6 a7 a8 l:=aZ (At a1 a2 a3 a4 a5 a6 a7 a8) l +def e9 a1 a2 a3 a4 a5 a6 a7 a8 l:=aZ (zH a1 a2 a3 a4 a5 a6 a7 a8) l +def fh a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 l:=aZ (dH a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11) l +def fS a1 a2 a3 a4 a5 a6 a7 a8 l:=aZ (zv a1 a2 a3 a4 a5 a6 a7 a8) l +def fO a1 a2 a3 a4 a5 a6 a7 a8 l:=aZ (yI a1 a2 a3 a4 a5 a6 a7 a8) l +def fV a1 a2 a3 a4 a5 a6 a7 l:=aZ (og a1 a2 a3 a4 a5 a6 a7) l +def gz a1 a2 a3 a4 a5 a6 a7 a8 a9 l:=aZ (AH a1 a2 a3 a4 a5 a6 a7 a8 a9) l +def gy a1 l:=aZ (zQ a1) l +def gV a1 a2 a3 a4 a5 a6 a7 l:=aZ (zl a1 a2 a3 a4 a5 a6 a7) l +def gW a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 l:=aZ (AJ a1 a2 a3 a4 a5 a6 a7 a8 a9 a10) l +def hX a1 a2 a3 a4 a5 a6 a7 a8 l:=aZ (zy a1 a2 a3 a4 a5 a6 a7 a8) l +def iw a1 a2 a3 a4 a5 a6 a7 a8 a9 l:=aZ (AG a1 a2 a3 a4 a5 a6 a7 a8 a9) l +def ix a1 l:=aZ (Cn a1) l +def ir a1 a2 a3 a4 a5 a6 a7 a8 a9 l:=aZ (zN a1 a2 a3 a4 a5 a6 a7 a8 a9) l +def jz a1 l:=aZ (ws a1) l +def jW a1 a2 a3 a4 a5 a6 a7 a8 a9 l:=aZ (zW a1 a2 a3 a4 a5 a6 a7 a8 a9) l +def j4 a1 l:=aZ (rp a1) l +def kh a1 a2 a3 a4 a5 a6 l:=aZ (yG a1 a2 a3 a4 a5 a6) l +def kN a1 a2 a3 a4 a5 a6 a7 a8 l:=aZ (pJ a1 a2 a3 a4 a5 a6 a7 a8) l +def k3 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 l:=aZ (jL a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13) l +def md a1 a2 a3 a4 a5 a6 a7 a8 l:=aZ (xe a1 a2 a3 a4 a5 a6 a7 a8) l +def mR a1 a2 a3 a4 a5 a6 a7 a8 l:=aZ (pP a1 a2 a3 a4 a5 a6 a7 a8) l +def m5 a1 l:=aZ (xb a1) l +def nt a1 a2 a3 a4 a5 a6 a7 l:=aZ (oP a1 a2 a3 a4 a5 a6 a7) l +def ng a1 a2 a3 a4 a5 a6 a7 l:=aZ (zT a1 a2 a3 a4 a5 a6 a7) l +def o8 a1 a2 a3 a4 a5 a6 a7 a8 a9 l:=aZ (oT a1 a2 a3 a4 a5 a6 a7 a8 a9) l +def od a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 l:=aZ (uT a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11) l +def N a1 a2 a3 l r:=nd (zL a1 a2 a3) l r +def az a1 a2 a3 a4 a5 a6 a7 l r:=nd (og a1 a2 a3 a4 a5 a6 a7) l r +def aJ a1 a2 a3 a4 a5 a6 a7 l r:=nd (zj a1 a2 a3 a4 a5 a6 a7) l r +def aR a1 l r:=nd (wW a1) l r +def bc a1 l r:=nd (AO a1) l r +def bU a1 l r:=nd (zQ a1) l r +def bS a1 l r:=nd (zD a1) l r +def cb a1 a2 a3 a4 a5 a6 a7 l r:=nd (BO a1 a2 a3 a4 a5 a6 a7) l r +def cu a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (At a1 a2 a3 a4 a5 a6 a7 a8) l r +def c3 a1 l r:=nd (q1 a1) l r +def dQ a1 a2 a3 a4 a5 a6 a7 a8 a9 l r:=nd (zN a1 a2 a3 a4 a5 a6 a7 a8 a9) l r +def dR a1 l r:=nd (Ci a1) l r +def d3 a1 l r:=nd (zw a1) l r +def ef a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 l r:=nd (zn a1 a2 a3 a4 a5 a6 a7 a8 a9 a10) l r +def ei a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (zH a1 a2 a3 a4 a5 a6 a7 a8) l r +def eg a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (Ab a1 a2 a3 a4 a5 a6 a7 a8) l r +def eL a1 l r:=nd (Af a1) l r +def eR a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 l r:=nd (dH a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11) l r +def eJ a1 l r:=nd (yK a1) l r +def e2 a1 a2 a3 a4 l r:=nd (DP a1 a2 a3 a4) l r +def fR a1 a2 a3 a4 a5 a6 a7 l r:=nd (zl a1 a2 a3 a4 a5 a6 a7) l r +def gA a1 a2 a3 a4 a5 a6 a7 a8 a9 l r:=nd (Ad a1 a2 a3 a4 a5 a6 a7 a8 a9) l r +def gp a1 a2 a3 a4 a5 a6 a7 a8 a9 l r:=nd (zA a1 a2 a3 a4 a5 a6 a7 a8 a9) l r +def gI a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (zv a1 a2 a3 a4 a5 a6 a7 a8) l r +def hi a1 a2 a3 a4 a5 a6 l r:=nd (yG a1 a2 a3 a4 a5 a6) l r +def hS a1 a2 a3 a4 a5 a6 a7 l r:=nd (m0 a1 a2 a3 a4 a5 a6 a7) l r +def im a1 l r:=nd (km a1) l r +def ku a1 l r:=nd (Cs a1) l r +def lj a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 l r:=nd (jL a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13) l r +def k2 a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (lB a1 a2 a3 a4 a5 a6 a7 a8) l r +def lQ a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (yI a1 a2 a3 a4 a5 a6 a7 a8) l r +def lE a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (wI a1 a2 a3 a4 a5 a6 a7 a8) l r +def mi a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 l r:=nd (eX a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13) l r +def lY a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (xe a1 a2 a3 a4 a5 a6 a7 a8) l r +def lC a1 a2 a3 l r:=nd (eU a1 a2 a3) l r +def m6 a1 l r:=nd (E3 a1) l r +def mV a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 l r:=nd (AJ a1 a2 a3 a4 a5 a6 a7 a8 a9 a10) l r +def nm a1 l r:=nd (FF a1) l r +def nw a1 a2 a3 a4 a5 a6 a7 a8 a9 l r:=nd (AG a1 a2 a3 a4 a5 a6 a7 a8 a9) l r +def oq a1 l r:=nd (BK a1) l r +def o2 a1 a2 a3 a4 a5 a6 a7 a8 a9 l r:=nd (AH a1 a2 a3 a4 a5 a6 a7 a8 a9) l r +def oU a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (oE a1 a2 a3 a4 a5 a6 a7 a8) l r +def om a1 a2 a3 a4 a5 a6 a7 a8 a9 l r:=nd (zW a1 a2 a3 a4 a5 a6 a7 a8 a9) l r +def pj a1 a2 a3 a4 a5 l r:=nd (oI a1 a2 a3 a4 a5) l r +def qS a1 l r:=nd (ER a1) l r +def pL a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (Ex a1 a2 a3 a4 a5 a6 a7 a8) l r +def qs a1 a2 a3 a4 a5 a6 a7 a8 a9 l r:=nd (wP a1 a2 a3 a4 a5 a6 a7 a8 a9) l r +def rz a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (qk a1 a2 a3 a4 a5 a6 a7 a8) l r +def qv a1 l r:=nd (EB a1) l r +def qw a1 a2 a3 a4 a5 a6 a7 l r:=nd (oP a1 a2 a3 a4 a5 a6 a7) l r +def qe a1 a2 a3 a4 a5 a6 a7 a8 l r:=nd (zy a1 a2 a3 a4 a5 a6 a7 a8) l r +def pQ a1 l r:=nd (zd a1) l r +def EI : ab dp:=(oq gx (d3 cl (eL aP.FH.aF (cb i3.b8 49 z3.f4 z3.fE z3.fD 1 z3.fu (az tC.jq 4 z4.eB 87 z6.eA 83 z7.fu (N gS.i0.bo 69 cy.fu (iR m1.b8 87 bN b1.g8 1 dI.fo 2 dI.fU) (ji iD)) (e9 hY.cQ.cQ 60 da.f6 da.fP 49 da.gK 46 da.fp (bM kL.fH.bw 178 ap aE.eC.d6 K.eC.d6 L.eC.d6 19 dL.er))) (bU bO.bu (J aY.iG.hU.gT 83 dy.gd (em nh.cx.fj.cQ 145 ds.fm vi 88 ds.gm 84 vn)) (du rq.dK.cQ.fj.S 171 zu au X ad 92 mG aN (bk jV)))) (bc ed.eV (nd (tQ gs.aI.gZ 156 an cg.iV b3.iV 72 z9.fz 60 z7.p7) (N b1.bg.pU.hK.dh 57 ct.gK (aG jV.fQ) (lb dO.S)) (iw pV.dJ.cR.dm.aX 89 mG L 172 cV.er ar 168 ao (bk jk))) (hi t8.ia.aj 52 Cc cM.fm 95 uG (aW nL.aD (n4 bq.ae.bV.aS)) (J i6.iv.bm.dx 164 c8.eA (lf (pe ns.bV 24 dq.fK 100 cT.p7 H 26 dq.fN 54 dq.f4)))))) (N ed.eV.dK.fy 139 z2.f6 (bU iX (gA tC.it 122 AI jv dk e6 103 sf lR (N iE.yk.hU.bo 189 cV.gk (d2 pY.vC.bm) (dc aV)) (fh na e_ 64 ch jH 1 di.fA e_ 2 cB.gn bd (bC ot.b2.b2.aj 199 ap cX.bP.bP.av cl.bP.bP.av 145 ey cg.bQ.cv 141 b3.bQ.cv))) (bc pR (bD ii.aX.aj 91 fe bF bE 74 zz K 70 L (ij dF.jq.b2.ae.cQ 70 wS aH 176 vc oS 172 oz)) (e9 tb.cs 75 cI.hH cI.gL 184 cI.p9 180 cI.p8 (aT ns.dJ 11 cT.ev 1 cT.eZ 2 cT.fo)))) (az mj 38 mF 115 iq 14 z6.gK (N F1.Hc.iI.cx 282 dn.f6 (mR oj.b2.b2 4 cy.e1 65 ct.p0 H 61 hJ (co j.wi.bl.ec)) (aZ (ry j8.fH.dm 11 c7.p9 1 c7.fE 2 cN.gk) (ms jT))) (ef tB.aj 125 et aY aQ 66 hC ak 62 af (jW tl.aS 11 dP.p6 83 c9.p5 aE 94 fe e_.ja (bM lW.ag.bw 113 bv oc.aO iY.jQ mW.jQ 19 dl.eS)) (de K.cJ.kY.ib.fr (cp jA.eb.ag.iI 113 dY.ev dY.eZ 272 dY.fT)))))) (bc cC (cb uE.bw 54 z1.fq z1.gb z1.gd 19 z1.fM (bS nK.bm (cu nu.dm.bw 93 sf g5 gq k6 19 z7.fx (im e_.e0.mX (aK bt.io) (lf (rP rx.dJ.jr wU By 28 (aM cD mD e_) 105 (aM cF mD e_) aP))) (fS oj.b2.a0.ae 272 c7.f4 136 sh ar 132 ao (bZ o9.eP.cd.ag.bg 186 ap dO.ni.fj.bI cj.ni.fj.bI dS.ni.fj.bI 200 w6 bt))) (ef gs.iI.bV.aj 139 pB cX cl 88 fG jt.aD 84 gX.aD (kN qd.S 86 hJ ci aV cC 111 yo (bM re.eP.aF 180 b7 fI.ja.ae rb.ja.ae tg.ja.ae 1 ds.f5)) (mR tV.bQ.b2 4 cI.fE 148 cS.ex H 144 l0 (ac aN.iG.eD.aI 286 cT.eS)))) (c3 bF.aF (o2 qx.nS.S 110 an vZ.ce 116 c4 u1 112 aU.bu (aZ (yL jg.bp 63 pq 126 pA 122 Aq) (aK kO.io)) (aZ (yL i5.dK.ja 4 da.fN 47 da.fK 44 vh) (nA Cp.S 57 cL.f4 cL.fE 87 mH aV 83 cC))) (aJ uv.bQ 52 cq.fu 17 cq.gO 61 cq.ev (o8 nb.gR.bw 270 dP.fm dP.gH 17 dP.er 218 hC j.ae (aG pY.eK.ce)) (fO ns.cz.S 108 wl 70 c8.ex H 66 cN.f4 (lf (rP eE sd BB 24 (aM cD dE e_) 65 (aM cF dE e_) b1)))))) (c3 m3 (qS ah (eR qX.S.a0 e_ 66 z8.fo e_ 107 an uP.mv 14 z8.eZ aP (fR oj.b2.bl 33 vp 32 cB.fz 1 cB.gl (ac e_.aO.bP.dt 334 dr.fz) (q0 cZ.b6 aB 71 rR au)) (J ci.xM.r5.eF 171 c7.fM (bk kn))) (oU tc.b2.cR.S 95 cG.e7 57 pp X 53 ad (bA k4.cx.dJ 11 dj.fK 1 dj.fN 2 dj.ex (iR oY.ag.ag 110 bv e_.aO.aO 1 dT.p5 2 dT.p4)) (J q9.aO.bP.eV.dK.fy 134 c8.fT (ac e3.eC.bu.bz 223 dq.eY)))) (gp o1.gR.bw 42 kA bj br 17 z6.gm 361 z6.p1 (ei fk.ag.aF.bw 52 dn.fq xa 17 dn.gn 129 dn.p4 (aZ (zo ov 226 dP.p0 54 wO 1 dy.gO 2 dy.ev) (ml nl.aI.cH)) (ek rm.bV.aF.b8 121 lJ kW 1 cN.f9 2 cN.ga (bk jX))) (ef ra.bw.e0.ae 64 sb cX cl 169 cP.p1 K 165 L (aZ (oE m1.jr 4 cA.fq 87 bN H.dK.bI 83 j.hL.bI) (bM lW.fH 117 bv o4.aO hW.bQ.aO ld.bQ.aO 1 dL.fp)) (e9 Ch.aS.cQ.cs 245 dI.eW dI.eH 417 dI.f8 413 dI.fz (lb qM.bg))))))) +def FE : ab dp:=(hS gU.aX 122 d1 89 FO 194 Gs (nd (rP qu sd By 28 (aM cD hI e_) 105 (aM cF hI e_) aP) (cu eT.gC 252 iJ dO cj dS 56 z1.fK (nd (oC hR.cz.S 128 z3.gl z3.e1 55 dX X 51 ad) (aJ nu.dm.dm 11 z7.fN 1 z7.ex 2 z7.fL (nd (lz uP.bl) (bk oz.ae.eh) (ji kr)) (mR jg.aS.aF.aS 4 da.er 501 mJ K.cR 134 c7.fU (ac oc.pE.eP.aI.db 109 dL.gd))) (nd (oT k8.dJ.bw 50 c5.fA wu 17 c5.fK 509 iz kJ.sy) (aW kS.nT (co H.kB.aF.ec)) (ix mE.pm.bm (lc hY.bQ 23 cU.gl 24 cU.e1 17 cU.gk 115 cU.eA)))) (ei rv.iF.aj 124 z5.f8 z5.fz 69 z5.gl 65 z5.e1 (nd (ow qV.aj 23 z9.ex 138 c4 au.eN 112 kc) (J X.cH.hU.gT 172 cV.fo (aK ar.cJ.kY.ib.fr)) (ek ol.aS.ae.ag 65 pq jN 1 cA.p5 2 cA.p4 (aT y9.dm 11 dM.fL 1 dM.gg 2 dM.eY))) (N gN.pU.hK.dh 55 cM.eH (k3 ol.aS.ae.a0 371 ky fX 65 dP.fD e_ 146 pA aE 14 da.eW aP (bZ tV.bQ.ho 75 yu oB ul L.Ev 164 l0 kc)) (en h9.bg.hK (bk nH.gY))))) (eL K (cb rg.it 148 z4.fz z4.gl z4.e1 57 z4.gk (m6 gN.S (N L.bu.dt 334 cV.p7 (pM rg.ec.aI.ja 4 dI.p4 145 c0.fi H 141 c0.er) (lf (q1 eQ.bI))) (k3 Dm.fj.cx.bi.cx.aD 185 cN.ez e_ 587 cN.gg e_ 128 iz dN.fr.iH 62 di.f8 j (aT lH.eb.ag 55 cO.ga 1 cO.gj 2 cO.f5))) (nd (pP mP.aO.b2 4 cG.eS 92 cG.fi H 88 wh) (aZ (qL zt.cx.bp 138 dj.fi 60 dj.eW 56 di.gK) (bM jg.cd.gR.ag 89 iK aV.wq nK.wq qJ.wq 1 dT.fT)) (aZ (lL li.aj.cR.bV 24 c8.fD 207 cI.fU H 26 c8.fu 69 rZ aN) (al ke)))) (d3 lq (eJ sP.gY (J rB.aI.hV 72 cB.fE (eo kZ.dJ.bp 68 dr.f8 286 vc e_.bP 53 ds.p2)) (ck mq.sy.nj (fW g7))) (aJ i5.dJ 11 cP.fp 1 cP.ft 2 cP.f4 (ck ed.gP.nj (al ah.rG.bH.bH)) (bA uY.aF.bi.b8 77 c7.ez 1 c7.fK 2 c7.fN (co aQ.bg.eK)))))) (aR bj.eK (aR gu (bU uj (lQ nu.iI.a0 97 z8.fE 134 zZ aE 14 z8.fD (oq oH.xM (hZ g9.aS.a0 87 iK dN.wq 87 iK ie.wq 158 et dV.bP 14 da.p9 aP) (al e4)) (iw kK.S.cQ 69 iK aH 132 et oS 128 oz (lf (tZ mZ.bH.b6.aX 186 ap uj.av 29 dL.gL 206 uN.av)))) (az tv.bg 34 c5.p6 47 pp 96 cG.fu (bA nb.eK.b8 57 c9.eS 1 c9.fm 2 c9.gH (al kO.kv.aX)) (ir jS.aS.ag.aS 11 cI.fK 214 c8.eB 123 cI.fN 119 cI.ex (aK ci.bp)))) (bS ob.bu (gI rA.ag.aS 4 z9.eS 108 an uO.b0 104 oX.b0 (bA tt.ik 11 ct.f5 1 ct.hH 2 ct.gL (fJ aA.ib.iG.eC)) (J aN.aI.bV.fd 159 c7.gm (e8 BX.S 68 zE au X ad 49 dM.eA))) (nd (jo uI.aI.aD 177 cP.eB 420 cy.fC 143 cP.fT 60 cM.eW j) (J bt.hL.aI.hV 73 dP.f9 (bC oV.cs 87 ch qI.aC oH.aC 122 bv mY.aO 118 iQ.aO)) (e9 n6.e0.cJ.ag.bw 112 c7.fi c7.eW 17 c7.eH 193 c7.f8 (ac iS.bi.hL.dx 156 dY.f6))))) (N sP.dh 53 z2.ga (cb nx.ag.bw 91 z4.p4 z4.p3 z4.p2 19 z4.p1 (ef iy.gR.cd.bi.aD 106 nY ob oo 87 pw fX 83 d8 (dQ Co.bQ 82 cB.eS 220 dj.fz 17 cB.fm 59 cB.gH (hT fc.cz.dK.S.S 178 b7 bt.ni.ae 77 vd X 73 ad) (dd yO aB 71 b7)) (m5 iQ.bu (bM mU.dm.bw 47 rQ aA aB dD 19 dM.e1))) (gI rd.ae 91 cG.er 61 xw K 57 L (bT ki.ym.hM.bu.dK.fy 112 iB ki.Ej.kB (h6 i5.aj.b2.a0 195 jK bq 169 mK gf 14 c6.e1)) (du eT.cd.e0.b8.bg 131 iq H.kY.bg.jd mT.bg.jd rC.bg.jd 80 ep i6.pE.n2 (ff jS.ag.bw 157 dq.fz 314 dq.p9 19 dq.gl)))) (bc H.ec (lE gF.gR.aS 11 dn.p2 144 pB 71 fG fY.bw (gV wQ.bl 84 dy.eB 228 di.eu 1 cy.gL (bM i4.b6.aj.cQ.g6 134 w9 ah bK ea 1 dT.fM)) (gz mQ.cs 73 ca uf 92 bN m4.bI 88 sW (kf kt.cx.bp e_ 51 tO bd 88 xi K 84 xi L))) (az rl.pl.ae.aj 60 sb 165 wg 161 cP.p1 (bT jD.kY.sy.cJ.aO.aO 500 ts cl (bZ kL.bV.b2.aj 178 ap oD.hL.bI tF.hL.bI L.sl.hL.bI 128 vl aw)) (fS uQ.e0.bg.S 64 cN.gj 126 lJ cj 122 dS (lf (rP eE iC x6 24 (aM cD dE e_) 65 (aM cF dE e_) b1)))))))) +def Fw : ab dp:=(nd (kH L) (bc d0 (aR j5.bP (aR tW (nd (uT gF.aX.aC 11 z7.gl 77 kA hj.gP 53 mc aE.fF 49 aP.cH) (nd (jB jg.aX.aC 11 cy.eB 383 ap kP.CQ 364 iB lq.bH.kB 122 cy.fT) (hZ tR.cd.iF 11 dI.gn e_ 147 dI.eA e_ 120 hD dN.aO 17 cN.eB bd) (ji m3)) (bT d8.kv.pU.hK.dh 305 ky d8 (lf (xe eI.b8.dm.cJ.ag.bw 135 dL.eW 438 ap iN.eK.av 19 dL.eH)))) (bS gu (bT e_.bi.r5.Gy.bm.bz 146 ep bt.cJ.ja (eo oO.dJ.S.a0 91 ds.gO 282 yS aE 14 c6.gK)) (fO d5.eN.S.a0 74 cS.gO 88 Ai aE 14 cS.f5 (e8 rl.cd.dB 133 sa nk g2 kg 64 cU.f4)))) (nd (kH aQ) (bS h9.EZ.FT (J ok.cH.hU.gT 365 cV.fP (d2 mh.vC.bm)) (ck ed.ec.aC (aT cZ.ik 11 dM.er 1 dM.eB 2 dM.fT))) (N e3.aO.hU.bo 548 c9.fi (aZ (lB sR.cx.aF.ae 123 cq.eA L 535 cS.gn 532 cS.eA) (n4 kx.ae.bV.aS)) (bD jS.bH.bi.ae 179 w3 K L 75 rZ ar 71 ao (i7 sU.bw 58 vk jw jD 17 dq.gb 90 sc bO))))) (dR tk (aJ k8.dv 54 z4.e7 149 z4.eH 145 z4.f8 (hi nu.iI.ag 97 z8.gg z8.eY 1 z8.eS (fR n5.b6 54 ct.p2 133 cV.f5 1 ct.p1 (ac d4.bi.cJ.aO.aO 585 dT.gb) (lf (m0 tp 224 d1.fo 121 d1.fu 200 d1.f8))) (ej k8.dJ.cJ.ae 58 yH K L 226 cA.e1 222 cA.gk (aT ny.cd.ag 47 cO.fA 1 cO.eu 2 cO.ez))) (ei uX.bQ 87 xD cG.er 17 cG.eB 53 xw (bA tL.b6.dm 11 dj.f6 1 dj.fP 2 dj.gK (i7 uD.ag.g0 233 ch bF.bV bE.bV 17 dT.fK 109 hD lT.pG)) (bA ql.dm.cd.aX.bl.b8 150 cI.p2 1 cI.p1 2 cI.p0 (g4 wM.aI.cQ 99 cT.gk 57 cT.er 53 cT.eB)))) (nd (zr cF Bf Da) (N kJ.mu.bo 55 dn.e1 (aW rK.bH (lf (jo kV.a0.aj.cR.cx.aD 199 ds.fM 272 ds.fx 243 ds.gn 74 dr.fu j))) (bA uQ.bQ.bP 140 c0.fi 1 c0.eW 2 c0.eH (bk jT))) (N cj.r5.ib.bo 614 cV.fT (J d0.r5.eF 164 cA.fE (al m4.bH.bH)) (o8 te.bg.eP.S 72 c7.p8 c7.p7 110 yQ 106 v9 j (fW kP.cx.bu)))))) (az j7.dJ.S.ae 71 Go 134 Hl 130 z1.e7 (cb sJ.ag 59 z1.f9 z1.ga z1.gj 1 z1.f5 (bU bd.b6 (N aP.FH.ae.pG.cw 78 z7.p4 (mi oe.dm.bg 36 cy.ga e_ 91 cy.gj e_ 38 cy.f5 e_ 53 mL bd (aG ah.AY.sy.nj) (em i1.a0 44 d1.gK d1.fp 175 d9.gd 14 d9.fM)) (eG nn.bl.bw 116 fe g5 gq k6 19 da.fq (aG aN.bm.fr.gB))) (eJ K.GK.cJ.fr (aZ (lz aU.cY) (ac ah.hU.bP.dt 334 dT.p3)) (aZ (uZ s0.aX.b2 4 cS.ft 202 cS.fC H 198 cS.fz) (al fX)))) (ei pg.eb.aD 131 z5.f9 z5.ga 177 z5.gj 38 z5.f5 (nd (rM g3.aX.bP.aX 96 an af.ia.aS 29 z9.gj 116 op.b0) (fV nn.q6.aj 16 ct.fM 112 ct.fx 268 cV.eY (bC xu.bg.aj 68 ca jl.bI ju.bI 91 bN nr.cH 87 mh.cH)) (eG ii.fH 121 fe ed nl j.aI 1 cN.gd (bM uE.bw 54 mF jX kp iD.bl 19 cL.gm))) (ef oy.fg 124 cq.eH K L 64 wh ak 60 af (aZ (oC mZ.aD 60 dP.gb dP.gd 170 ap ak.cx 166 af.cx) (d2 gq.aI.pm.bm)) (de qR.gY.gD (lg tb.aC 11 dq.p4 182 hB iN.ya 63 dq.gm aw))))) (ei j0.a0 36 z2.fq z2.gl 95 z2.gb 14 z2.gd (cb nx.ag.dm 114 z4.ga z4.gj z4.f5 1 z4.hH (oU j3.jr 4 z8.p9 106 c4 bK 102 ea (mV oe.jr.cx.bw 99 mf cX cl 17 cB.eu 65 vu bO (lf (tZ fc.cz.dK.cz.aX 178 b7 L.ja.ae 29 ds.gg 198 aH.cK)) (q0 dF.b6 aB 111 rX au)) (bA kL.bP.aX 130 di.eY 29 cA.eA 161 cA.f9 (bM qN.bw 43 ep aA aB dD 19 dM.f8))) (aJ rd.b6 95 uC 1 cM.gO 2 cM.ev (fh oe.dm.cJ.aX bd 61 sk L 29 dj.fm e_ 81 mM aH (aT qf.b6.dm 11 dT.eA 1 dT.f9 2 dT.ga)) (j4 bF.bi.bu (aT jS.ag.dm 11 cT.gn 1 cT.eA 2 cT.f9)))) (aJ iP.cz.b8 69 z6.fM 1 z6.fx 2 z6.gn (N nL.iH.ib.bz 64 dn.hH (J aY.gP.cJ.aO.aO 221 dj.e1 (aK ki.eC.gD)) (kN k4.gZ 69 rV au X ad 140 cA.gm (fW kp))) (oq o5.xM (e9 d5.gC.aj 70 di.fx di.gn 122 di.eA 118 di.f9 (dc ju.i2)) (de g5.kY.ib.fr (lf (zD H)))))))) +def Fb : ab dp:=(eL aU (aR vU.eK (aJ mj.eb.aX 62 z1.fT 41 z1.fA 138 z1.eu (bS iZ.bm (aJ i3.e0.eK 61 u7 1 z7.gH 2 z7.gm (mV pS.eV.b8.bw 166 y3 ak af 17 cy.gm 77 mG h9 (aK oS.io) (la kQ.ag 40 d9.fK d9.fN d9.ex 1 d9.fL)) (dG op.e0.cH (lf (xB o9.eP.jr.ae.aj 178 ap ar.bg.hM.fF ao.bg.hM.fF 240 ak.aC.fj.bI 236 af.aC.fj.bI)))) (e2 K.A7.bi.cJ.aO.aO 330 iz ak.kY.sy (fV pX.b2.ae 128 dP.f6 165 c9.gO 367 dP.fP (fJ jZ.vz.aI)) (ix qz.Cv.bm (lf (ry iu.b8 51 cU.ez 1 cU.fT 2 cU.fK))))) (nd (zr cF Bf b4) (nd (qb eE xF 24 65) (aW cg.nT (bk fX.ae.eh)) (bT b1.kB.CQ.dt 370 wn ak (eo uk.bV.a0 51 dM.p3 70 rR iN 14 dM.p2))) (dR X.bg (dG jy.cH (i7 lW.ag.bw 113 bv nC.aO nH.aO 17 c6.f9 94 ch o5.aC)) (en aH.wk.bl.bH (e8 te.cJ.S 98 sc dO cj dS 60 dq.gk))))) (eL H (pL nu.jr 11 z4.fT 122 AI z4.eu 85 z4.ez (gA h3.S.cR.bg 106 nY jv dk e6 79 pw aN (lj l8.bi.aD 378 ap jU.CQ 378 ap ka.CQ 371 iB ug.bH.kB 129 cy.fT j (fJ aV.mX.eC) (ji dV)) (fh oW.dK.aX.S e_ 59 cA.eB bd 117 lJ H 53 di.fu e_ (h6 j0.gC 96 vq bt 52 cO.er H 48 cO.p6))) (ei u8.aF.aD 46 cG.fq wK 96 cG.gd 92 xC (J ah.xE.mX.aF.sl.aI 144 di.eB (fb cF vr aE.ia.mv.bm)) (du e_.dm.dm.aX.aF.aX.aj 104 CA aA aB dD 67 ve bq (bk aQ.gY)))) (eg jm.iI.q6 91 nX jH 1 z6.gg 2 z6.eY (N nL.aF.sl.aI 108 dn.gj (fS ii.cK 98 cB.fi 66 Ah K 62 L (aG nK.jQ.iG)) (gy ah.iG.eC (aK kp))) (fR qi.eN 68 cP.f8 145 cy.fm 19 cP.fz (od ov.aS 11 di.fT 101 bv j.ib 70 ch lq 66 gN (iO L.iG.bl.hU.gE.cw 240 ap L.iG.mv.bI)) (fh sV.aS.g6.aX e_ 140 cN.ex aP 103 hD ar.cJ 99 hD ao.cJ (lb ak.pG.bg)))))) (eL iZ.aF (az iA.cK 168 z1.p4 202 z1.p3 198 z1.p2 (ei dF.dK.S 50 z3.p0 z4.e7 145 z4.f6 141 z4.fP (eg uH.b6 94 an xP.b0 1 z8.e1 2 z8.gk (k2 kt.ec.S.bp 168 iB aw.nT.kB 172 ct.eW 243 cV.fU (aG g7.fQ) (al cj)) (gz ti.S 85 iK vb 138 et sP 134 jk (i7 mZ.bH.b6.b6.bw 136 ey cX.bQ.cv cl.bQ.cv 17 cO.e7 206 ap hj.bP.bP.av))) (N bd.cH.bu.cw 54 cG.fE (aW gX.bH (dc aY.bm.fr.vz)) (j4 bO.bi.bu (lf (rp jw))))) (nm bK.A7 (oU uo.S.b2 4 z9.eY 109 an nE.b0 105 tW.b0 (fS nn.q6.b2 4 cV.eA 105 hJ ah 101 aU (co jU.aF.ec)) (du g9.aS.aj 136 et e4.bP fI.bP iD.bP 91 iK bq.cJ (lf (rP fk iC rU 20 (aM cD kD e_) 25 (aM cF kD e_) e_)))) (nd (jB jx.pl.aD 35 cq.fm 84 mf j 82 vu aE 26 cq.gH) (aW bq.iv (eo iy.bV.nS.gR.bp 143 xd 131 c6.p8 H 53 dl.fN)) (kh tu.bu.aD 171 c0.ft c0.f4 65 c0.fE (bM tu.bg 167 hB ci.mX aV.mX cC.mX 62 dq.fq))))) (nd (yN gs.aS 11 z2.p0 90 dX au z3.e7 46 z3.f6) (nd (kH aU) (gA qx.aj 100 r6 H ah aU 66 an kc.aC (mV jp.eb.b8.bw 63 mL rH pY 17 cB.f5 113 cy.gj bO (lg g9.cz.aS 11 ds.f4 184 mK H 140 lA bq) (dd n3.S aB 111 sa)) (aZ (q2 l3.dJ.aj 23 c7.f6 127 ca aH.cR.bI 111 m4.bI 107 sW) (ff y1.ag 44 dM.eA 828 cU.ga 1 dM.f9))) (nd (pk tH.b8.bw 67 cM.fT 122 lF j 17 cM.fA 88 w7 hj) (fS tw.bP.ia 4 dj.p9 103 ca ub.bI 99 e_.xE.bI (i7 oV.gR.bw 114 bv s6.aO tU.aO 17 c6.f8 109 ch h9.bi.ni)) (jz jU.GF (ac cX.gP.eF 68 dq.ex)))) (nd (qP sR.cK 188 z6.fD 139 wA ar 135 ao) (bS ka.aF (fV th.S 121 dy.eY 66 rV 62 dy.fm (aK rJ.io)) (aW e_.vC.bI.aD (e8 pc.dB 53 rR nk g2 kg 56 cL.p9))) (gI s8.S 61 cq.p5 107 wy X 103 ad (aZ (rP l4 iC Bo 32 (aM cD fB e_) 145 (aM cF fB e_) bd) (lf (q2 o9.eP.jr.ae.aC 11 dL.eZ 182 ap bO.zh.hM.fF 226 ah.vG.fj.bI 222 aU.vG.fj.bI))) (ej n1.bw 170 b7 rH.ae pY.ae 17 dI.eZ 73 di.ev (la gF.eN 37 dY.p1 dY.p0 d9.e7 19 d9.f6))))))) +def EY : ab dp:=(az fa.dJ.bg 32 cO 47 dM 43 cL (qs m2.bV 150 HG 230 HW 152 HI 306 HU (cb iT.eP.bQ 55 z1.e1 z1.gk z1.er 19 z1.eB (k2 mj.S 80 dX aw 54 z3.f4 50 z3.gO (nd (oi nx.nS.S 132 kw mE.aI 95 z7.gK H 91 z7.fi) (nd (xh m9.a0 457 cV.p8 122 cy.eW 77 hC aE 14 cy.eH) (lf (lB mQ.ia.S 84 bN i6.fF 85 dI.fq 29 dI.gb)) (fb cD Dy bd)) (ix d4.pm.bm (bZ oV.dB 87 ch q9.ni iS.ni t5.ni 122 bv b4.bQ.aO))) (N mE.bi.cJ.aO.aO 215 c5.fN (nt gr.dK.gR.aS 4 dy.ga 114 dy.gj 110 dj.gn (ac iZ.Gd.eK.dt 334 dl.f4)) (fV s0.cK 96 c9.fU 64 c9.ev 60 c9.eZ (e8 BG.dB 93 b7 nk g2 kg 60 cU.fP)))) (bc nK.aI (gI qK.cz.aS 4 z9.eW 114 c4 uO 110 oX (bT aw.bQ.xY.bu.dK.fy 131 je uK.cH (bM tD.g0 92 bN q4.g8 ur.g8 j.hK.g8 19 ds.fi)) (aZ (wP kQ.jq.eP.bV 24 cV.fT 202 cS.f8 26 cS.fp 38 cS.ft) (fb cF mD aV))) (dR my.a0 (aW K.cR.nT (ac e4.i0.gE.cw 94 c6.fU)) (ir tn.dJ.aj 23 c8.f9 129 c8.ga 113 c8.gj 109 c8.f5 (aG X.bu.iG))))) (N k0.eF 59 z2.f4 (cb gG.a0.ag 52 z4.fo z4.fU z4.fi 1 z4.eW (bc hQ (lQ uI.aD.S 335 cV.er 56 ct.fK H 113 cV.eB (g4 gG.aj.cR.iI.ae 177 dI.fu 201 dI.gO 197 dI.ev) (al b3)) (o8 kZ.eN.cR.aD 92 cA.f8 cA.fz 64 cA.gl 60 di.fE j (hT iu.cd.gZ.b2.ae 107 ey nL.cv 197 ap K.iG.ce.bi 193 L.iG.ce.bi))) (aJ ko.bl.q6 87 cG.fi 1 cG.eW 2 cG.eH (aZ (lZ yZ.cd.aD 63 yt c9.p5 92 fe hO) (co L.A3.aF.ec)) (J jU.Gp.eD.kk 221 cI.p7 (al lS)))) (nd (yC hR.S 98 z6.ft z6.f4 z6.fE 43 ep) (dQ lD.S.bl.iF 11 dn.eZ 54 dn.fo 153 dn.fN 17 dn.fU (du i5.S 60 hC au X ad 127 et aN (al h9.bg.hK)) (ek sO.bQ 169 b7 gN.ae 17 c0.gO 68 c0.ev (ly jT))) (N pr.yk.hU.bo 171 cP.p0 (bT b4.bl.eC.db 166 hD vb (al rB.bH.bH)) (en aY.wk.bl.bH (bk px.fr.hK)))))) (d3 e_.FX.cH (eR eT.aj.b2.aj b1 64 z1.eA e_ 268 iJ ak.aC 264 iJ af.aC (N nE.dh 216 z3.gH (k2 qK.S 60 an qq 102 wN 98 r6 (e2 lT.xY.bu.dK.fy 131 je bO.cH (ac g5.aI.bV.fd 159 c0.fx) (fb cF fB b1)) (dG oS.e0.cH (aG H.aF.aC.S.gB))) (bU dz.aO (dG K.cR.cH (ac ar.aF.bl.dt 342 dl.fU)) (ej li.aj.cR.aX 69 rZ ar ao 181 cI.fU 177 w3 (em gr.eb.cQ 124 cU.p9 cU.p8 54 cU.p7 50 yy)))) (nm tk (lE i3.e0.dB 79 z9.fx 87 z9.gn 163 an kr.iV (dG b1.bi.cH (cp sK.dB.ag 73 dr.er dr.eB 1 dr.fT)) (dG fX.e0.cH (eo zJ.bV.a0 55 cL.eZ 110 b7 iN 14 cL.fo))) (e2 fI.bP.hV 187 cP.fE b1 (fV n8.jr.S 111 c9.gm 85 dP.ex 29 dP.fL (bk jy.bV.hK)) (bA sK.e0.gR.dm 11 cN.fD 1 cN.fu 2 cN.gO (h6 eI.cz.gR.a0 77 jc gS 176 hB q9 14 dq.p8))))) (eL cC (nd (kH fY) (gp qx.ag 62 an uO.aC oX.aC 1 z7.p6 2 z8.p7 (eR nn.iF.S e_ 41 vp bd 95 cB.eW H 29 cB.eB e_ (bM i5.g6 72 hC g2 dZ.aC eM.aC 1 c0.p6) (q0 h7.b6 aB 210 d1.ft au)) (aZ (lB tD.b6 80 bN Bb.bI 1 cA.fq 2 cA.gb) (h6 AE.S 103 b7 aw 52 cO.eS H 48 dM.f6))) (aJ tH.bu.b8 57 cM.f6 1 cM.fP 2 cM.gK (ck cC.h8 (hT Cj.aj.b2.ae 84 pu d4 189 b7 ak.hM.cK 185 af.hM.cK)) (kN jS.eV.cf 71 Ai au X ad 90 cI.eY (g4 AC.bH.ae 52 dq.e7 64 dq.f6 60 dq.fP)))) (eg iP.eN.ag 46 rY jH 1 z6.gb 2 z6.gd (eJ gN.hK (e9 zR.aD 52 dy.f8 wz 271 di.eZ 87 xl (lf (oP hY.bw.aF.aS 4 ds.eA 80 ds.f9 76 c6.fN))) (du u0.cd.a0 176 b7 ci.jr.ae aV.jr.ae cC.jr.ae 103 pu bt (co kp))) (gp eI.ja.cR.eN 55 mf bj br 17 cP.gb 25 cP.gd (gW t7.a0.aF.bw 62 mM aY aQ 17 di.gd 90 nZ aH (d2 uU.pm.bm)) (jz H.cQ.mv (lf (eX fc.eN 33 an b1 33 fG e_ 33 an j 19 dY.gb e_)))))))) +def EU : ab dp:=(d3 X (bc lV (aR bt.bP (bS dN.bm (ef kb.dJ.bi.aD 72 kA cX.gP cl.gP 60 mc ak.cH 56 af.cH (im H.cR.nT (d2 aB.aF.pm.bm) (hZ kQ.a0 113 c5.gj b1 40 c5.gb bd 135 d9.er e_ 14 d9.eB e_)) (gV kK.eK.aF 41 vh 40 da.fK 1 da.fN (aG K.o6.aC.S.gB))) (mV gF.gR.g0 79 fG jw.aD jD.aD 17 c5.fL 146 pB hj (ir sS.eb.eb.ae.aC 11 c9.ft 183 dj.p4 55 vm 51 c9.f4 (al ak.iH.bQ)) (fV lH.ag.b2.ae 71 xz 147 cS.eu 143 cS.ez (lc u3.aC 11 cU.gg 79 cU.eY 176 cT.fE 51 cU.eS)))) (c3 eQ.bI (eg sL.ag 102 an iE.b0 1 z9.eY 2 z9.eS (bT au.cH.AY.hK.dh 242 vt au (aT oO.dJ.bQ.bP 111 ds.ev 1 ds.eZ 2 ds.fo)) (bD ii.b2.b2.aj 121 cV.ex bF bE 122 hJ dN.bm 118 ie.bm (aT gr.ik 11 dM.fq 1 dM.gb 2 dM.gd))) (N aE.rG.aI.hV 70 cq.e7 (aW fY.bg.hK (bC kK.e0.q6.bi.aD 95 vn ob oo 164 vi fX 160 d8)) (ej vg.b2.aj.ae.aj.e0.cQ 118 wF K L 73 c8.p2 69 wc (e5 gr.jq.dv 164 dq.ev 66 cT.eS ar 62 ao))))) (c3 b3 (ku jy (lY s7.cd.aj 23 z8.fM 180 an dV.iV 75 z8.fx (nd (l5 jg.b6.aX 126 cy.eW 29 cB.fE 146 et gx) (bC q8.aD 173 b7 ar.nj.ae ao.nj.ae 76 vd ak 72 af) (lf (zw dD.cH))) (J cj.ni.cH.hU.aI.aI 271 cA.ex (hZ u8.S 292 xi e_ 42 cO.gL e_ 65 zE e_ 61 z2.gb aP))) (az uX.cQ 112 cG.ga 195 cM.eZ 192 cM.fo (J j.xE.mX.aF.sl.aI 134 di.fo (bC dF.jq.b2.ae.aj 66 cN.eu bF bE 180 vc jt 176 gX)) (bA d5.cx.aF.b8 204 c8.eZ 1 c8.fo 2 c8.fU (em ns.aX 54 cT.p9 cT.p8 74 cT.p7 70 zU)))) (hi gs.bP 38 z6.ez z6.fK 1 z6.fN (eJ e_.cz.gY (aZ (pe oL.bV 24 dy.gK 88 cB.eW H 26 cB.eB 38 vp) (lf (jo g9.gZ 475 dl.fD 140 ds.p8 170 jK 166 c0.fK j))) (gy fX.iG.eC (iM g7))) (mV wf.nS.S 96 lF ak af 102 Am 98 xA j (nt B4.pl.iF 4 di.fU 99 vd 17 cA.ez (aG bF.S.gB)) (bD na.aD 72 ch ar.nj ao.nj 111 bv cg.aO 107 b3.aO (fW ka.cx.bu)))))) (nd (rP eE iC tA 24 (aM cD dE e_) 65 (aM cF dE e_) e_) (aR g7 (aJ eI.dJ.dm 11 z3.p7 1 z3.p6 2 z3.p5 (lY g3.bV.b2 11 z8.eZ 100 an uP.mv 63 z8.fo (gI ph.ag.aS 4 ct.fE 68 pn dZ 64 eM (bC tr.cx.bi.cs 91 bN aY.d6 aQ.d6 84 ca ke.bl 80 iX.bl) (iM ah)) (bA ti.dm 11 da.gj 1 da.f5 2 da.hH (bZ pI.jr.aj 189 ap jn.eK.av o7.eK.av j.nj.eK.av 135 ey fY.aX.cv))) (fR iA.a0.bP 44 cG.fP 231 cG.fo 1 cG.gK (ek o0.g6 62 pn jN 1 c9.fM 2 ct.fE (bC re.bV.aj 71 pu aY aQ 188 b7 eQ.cK 184 dz.cK)) (aZ (ry kQ.jq.eP.g6 76 vo 1 cI.eY 2 cI.gm) (lf (rp aY.yk))))) (nm lV (nw j3.fg 118 c4 iX 76 an jl.i9 72 ju.i9 (fO h7.iI.bV.a0 80 ct.p9 121 zM aE 14 cV.fq (cp tK.q6.bw 197 c6.fC c6.gv 19 c6.fq)) (eG ti.bw 67 hC H.vS ah.vS aU.vS 19 c0.gH (bZ jA.it 148 zx au X ad 57 rQ b4))) (N au.cH.o6.eD.aI 58 cq.fL (aW j5.bH (mg j8.cz.b8.dm.aS 11 dl.p8 188 ap hj.sl.hL.bI 130 vl K 126 L)) (kh tb.ia.aj 176 c7.fz c7.gl 111 c7.e1 (aK iX.bp))))) (az gs.b6 42 z2.p9 1 z2.p8 2 z2.p7 (cb nM.S.a0 96 z4.p0 z5.e7 z5.f6 119 z5.fP (nd (tI uo.S 61 an lR.gP 97 g2.aS 93 kg.aS) (nd (wR uL.aC 11 cB.gb 71 cB.gH aH 234 dj.er 86 cB.eS) (g4 jg.b6.cQ.S 134 c0.p9 151 ds.fP 49 ds.gK) (dd mj aB 220 iJ)) (aZ (qU xq.b2.b2.aj.ae.cz.ae 67 wV K L 120 wC 116) (aK jk))) (ef wf.eP.aD 60 xw aY aQ 102 xD ak 98 af (eG nD.ag.ag.bi.bm.aF 64 vm aE.kv K.kv L.kv 1 dj.ga (al lM.a0.hK)) (en tk.bV.hK (aG fY.fy.iG)))) (nw jm.hL.bp 55 mc i6 79 kA mT 75 rC (gA pg.cd.a0 76 fG e3.eN ed.eN d0.eN 171 pB aw (ek oO.cQ.bP 179 lm pr 1 dy.fK 2 dy.fN (ac K.aF.bl.dt 342 dT.hH)) (gz uw.ae.b2.ae 96 nZ d4 72 mM ak.hM 68 af.hM (kf kV.aj.cR.ja bd 4 cU.fo e_ 50 cL.f5 H 46 tO aP))) (aJ fa.bl.bi.b8 87 cy.e7 1 cy.f6 2 cy.fP (ej oK.hL.eN 102 ca rE.bI rN.bI 17 di.p7 25 di.p6 (al X.bm.bH.bH)) (de ty.hK.gD (lf (qG j)))))))) +def Es : ab dp:=(nd (Br rv.iF.aj fY 124 dq e_ 65 dY e_) (pL nu.aX 149 Hi 316 Hj Hx 31 H2 (k2 eT.gC 252 iJ aw 56 z1.fo 52 z1.ez (bS ci.eP (gp h3.eN.a0 90 kw eQ.fF dz.fF 107 z7.fT 14 z7.fA (dR dk.a0 (qm m9.cQ.cs 355 dl.p7 356 dl.p6 509 mJ eQ.cR 505 dz.cR) (lf (wW gx))) (gW nn.q6.b6.bw 113 hJ ar.bm ao.bm 17 da.gl 128 cV.ex bO (lf (xB lK.bl.eV.bi.aD 177 ap bF.zh.hM.fF bE.zh.hM.fF 233 eQ.vG.fj.bI 229 dz.vG.fj.bI)))) (bU bE.bu (ck uS.h8 (pM n5.pl.aI.ja 4 c6.fA 116 ds.ev H 112 c6.eA)) (mR fk.dJ.bi.cd.jq 4 cS.p6 64 cS.ev H 60 cI.gd (ac aE.eh.dh 139 cU.fT)))) (bc tT (rz B9.cx.ae 162 z9.fD 69 an K.hU.aC 65 L.hU.aC (k3 ra.cd.bi.aD 165 cV.e7 e_ 165 cV.f6 e_ 173 iB dN.mX.kB 56 ct.ev j (bC qQ.aj 66 pz K L 179 b7 nr.ae 175 mh.ae)) (bD wG.S.cx.aD 117 iq bj.ym.jd br.ym.jd 74 ep H.kB.n2 70 j.A3.n2 (aT dF.ik 11 dM.fK 1 dM.fN 2 dM.ex))) (dQ ol.aS.aC 11 cM.f9 177 cq.eu 118 cq.ez 53 cM.eW (J aP.FH.ib.bP.eV.dK.fy 253 dP.fp (ac cj.i0.gE.cw 99 c6.f5)) (J jN.bg.cJ.bi.hL.dx 156 c8.p5 (al iS))))) (N iN.iH.qW 283 z2.fo (ku fY.bm (aJ qX.g6 67 z8.fm 1 z8.gH 2 z8.gm (nd (pJ oy.cz.S 119 lo au X ad 78 rO) (co gu.ec) (lf (kH L))) (e9 gG.jq.cR.cQ 220 cA.e1 cA.gk 60 lJ 56 yH (aT qN.dm 11 cO.gm 1 cO.fC 2 cO.gv))) (dR K.iI (ck aw.mv.nj (lg lW.b2 11 cN.er 92 ch dV.aC 105 bv aN.aO)) (e9 gG.aj.cR.hL.eN 104 c8.fP c8.gK 17 c8.fp 25 c8.ft (eo fa.aj.aF.a0 55 cT.hH 115 sc au 14 cT.gL)))) (lQ gU.bV 22 z6.fi 81 je H 120 z6.gl (ei il.cz.bu.aD 49 dn.fA dn.eu 63 dn.ez 26 dn.fK (aZ (pW rq.dK.cx.ja.aC 11 cV.p2 185 iB oZ.o6.kB 300 c9.p9 179 cV.p1) (g4 kZ.eb.bg.ae 64 ds.gk 84 ds.er 80 ds.eB)) (ek n1.b8 174 b7 e_.cK 1 cA.eH 2 c0.f8 (co jT))) (aJ ri.ag.eN 69 cq.p4 17 cq.p3 25 cq.p2 (J jN.xY.r5.eF 171 cA.eZ (em i1.pl.bp.aj 203 dl.fC dl.gv 88 dl.fq 84 dl.gb)) (ir uc.aD.aF.aj 23 c7.fA 265 dI.eu 249 dI.ez 245 dI.fK (fW cj.eV.bu)))))) (nd (rP qu sd BH 28 (aM cD hI e_) 105 (aM cF hI e_) aP) (rz i3.fg 61 z1.hH 243 iJ bF 239 bE (az dF.ec.aS 4 z3.ga 50 z3.gj 46 z3.f5 (cu m2.a0.ag 98 sf ed nl j.aI 1 z8.e7 (gA oM.bl.bg 53 vu au X ad 99 mf aw (iL u0.cd.ae 172 b7 bj.xK.ae ut.ae 71 dI.p0 67 dr.e7) (la i1.ag 44 d9.hH d9.gL d9.p9 1 d9.p8)) (du iu.cf 165 ap q9 iS t5 67 ey aN (aG g5.bm.fr.gB))) (eR eI.iF.S e_ 41 c5.f5 bd 77 c5.p1 H 29 cN.fz e_ (J aP.fj.bV.fd 159 c9.ex (em lH.dJ.cR.b8.bw 79 dl.gO dl.ev 17 dl.eZ 210 dl.fo)) (od uF.e0.aF.aj 23 cI.er 85 ve gx 131 iz fX.kv.iH 127 d8.kv.iH (ac g5.iG.eD.aI 239 cT.gv)))) (bS jv.bu (aJ j3.dm.dm 11 z9.gL 1 z9.p9 2 z9.p8 (kh ma.ag 106 yo cV.ex 1 cV.fL (i7 qf.b6.bw 190 jK cX cl 17 dr.f5 154 mK aH)) (aZ (lB l8.aD.ae 475 dX d4.bg 498 dr.eY 494 dr.eS) (nA li.gZ 61 cL.fz cL.gl 91 sj cj 87 dS))) (nd (ry qi.dJ 11 cq.er 1 cq.fU 2 cq.eB) (aZ (oE eI.b8.cf 214 un 67 pn ah 63 aU) (em n5.aj.ia.cQ 78 dl.eu dl.ez 29 dl.gd 26 dl.fA)) (jz bd.S.vz (bZ iA.kl.cR.bg 145 hB H.kY.wi mT.wi rC.wi 68 mH qc.hM))))) (oq ah (nd (kH cC) (aJ iT.bl.ik 11 z9.e7 1 z9.f6 2 z9.fP (im ar.mX (e8 tG.fj.S 76 yW au X ad 119 c0.gd) (dd k8.b6 aA 9 cO.gO)) (du t7.a0.bP.bg 62 mL aE.kB K.kB L.kB 238 vt ki (h6 kQ.gC 143 sa aw 56 cO.gd H 52 dM.gK))) (dR L.bg (m5 tP.bu (bZ fk.nS.cx.cR.cf 89 zF au X ad 139 w9 aN)) (ck kn.fQ (hT dF.ag.eP.S 139 hB lR 80 jc cj 76 dS)))) (mV fc.b6.bw 100 wA bj br 17 z6.p9 57 nX bO (nd (oC g3.ho 129 dn.p8 dn.p7 78 fG K.aD 74 L.aD) (aZ (qp w0.cK 93 xl L 62 wz K 58) (ac jH.cx.aI.eC.bu.bz 393 c6.fD)) (fS mQ.cz.ja 4 cA.gH 73 ca aE.Ga.bH 69 aP.iH.bH (e5 jA.dJ.fg 65 cL.gl 95 sj lk 91 kS))) (N j.xM.dt 73 cP.p9 (aW oD.bw (qm j8.cz.b8.dm.aD 35 dl.p1 158 dl.p0 188 ap H.e0.hL.bI 184 j.xE.hL.bI)) (o8 fa.aj.aF.cf 71 dI.gg dI.eY 95 AP 91 wl j (co bK))))))) +def E4 : ab dp:=(hS fc.dv 108 HP 225 HJ 222 HR (m6 pR (aR jk (bS e3.eP (cu nx.bl.ag 92 kw ed.fF nl.fF j.aI.fF 1 z7.gb (nd (uZ oM.iF.b2 4 cq.fN 244 cP.eu H 240 ky) (ac kW.r5.iv.bm.dx 164 dI.gL) (lf (yz i1.aX 44 c5.gb 29 d9.eY 64 d9.eS))) (dG ah.e0.cH (bZ ot.nS.S 129 ey e_.ae.cv lM.cv ui.cv 191 ap b4.eK.av))) (nd (lL kZ.dJ.bg 36 c5.gg 94 c5.fA H 38 c5.eY 56 AA aN) (k3 nb.eK.aS 11 c9.gk e_ 35 c9.er e_ 274 dP.fU e_ 110 ct.fx aP (dc af.pU.sy)) (J jZ.cJ.bi.hL.dx 156 cI.gK (aG kx.aC)))) (N jZ.Aw.bz 154 z5.ex (cu uo.eN 89 an aA.ia.aS aB.ia.aS dD.ia.aS 19 z9.gv (aW aP.sl.nT (aK fX.io)) (fh i5.gC e_ 183 c0.fK e_ 139 lA H 470 dr.eu e_ (cp h7.g0 50 cL.fA cL.eu 19 cL.ez))) (N eQ.aO.hU.bo 548 ct.eu (ng kK.bQ.aC 11 dP.eH 83 da.eu 128 dP.f8 (dc t0.gP)) (j4 oD.aI.bu (pa aN.A7))))) (c3 iD (bc rK (nd (jB nF.aS 11 z8.eH 65 an oZ.aC 103 c4 K 99 z8.eW) (eR sQ.dm e_ 11 cG.fz b1 1 cB.gO e_ 2 cB.ev e_ (al dV.mu.bH) (al dV)) (gz oY.S 67 xj aN 102 bv dk 98 e6 (g1 ny.cd.aj 23 dM.eZ 77 cL.fp 51 cO.fA aw))) (nd (wR rd.aC 11 cG.hH 65 xw aH 95 cG.gL 91 xD) (jW uL.aS 11 dj.fT 77 xj gf 94 bv gS (mb l8.b8.b2.ae 149 vi 92 vn K 88 L)) (J bt.pE.xK.cH.hU.aI.aI 317 cN.gK (lf (oP tM.bl.aS 4 cT.p2 62 cT.p1 58 dq.eu))))) (d3 hW (ei cZ.aS.e0.cQ 71 dn.fC dn.gv 58 dn.fq 54 xa (bT px.aX.rG.bm.bz 122 dX kx.fr (aK cC.fr.hK.gD)) (aZ (rM BW.q6.aX 169 b7 b3.cQ 29 cN.p7 189 bd.aS.ae) (e5 v7.fg 57 dM.p0 87 vq jl 83 ju))) (aJ jx.pl.b6 239 cP.eu 1 cP.ez 2 cP.fK (md BU.bP.bg 58 di.fL 406 b7 ak.ni.ae 254 c7.fx (iO d4.mu.hU.gE.cw 232 ap d4.xE.fF)) (e9 kt.eb.cz.aI.b8.bw 408 cN.gH cN.gm 17 cN.fL 252 cN.fC (bZ n3.fj.gR.bH.bg 70 zP au X ad 122 yB aN)))))) (eL oH (eL h5 (ku H.eP (gI dF.iI.aj.ae 72 pw 103 nY K 99 L (az s9.q6.bi.cQ 69 cP.fm 162 ct.er 241 cV.fz (aG kp.fQ) (al b3)) (gV jp.eN.b2.ag 81 da.p1 168 c7.fD 1 da.p0 (ij kL.S.S.dK.S 194 ap b4.eK.av 136 ey lM.cv 132 ui.cv))) (nd (Ar ah.yk) (iw ro.dv 105 nW L 67 lF bj 63 br (bC iy.ec.b6.bi.aD 61 wS aY aQ 179 vc fX 175 d8)) (ir ql.dm.cd.aX.bl.aS 11 cI.ga 47 cI.gj 238 c8.gv 69 cI.f5 (em i1.a0.aj 183 cT.fU cT.fi 60 cT.eW 56 cT.eH)))) (qv H.bV (cu um.a0.ag 119 c4 va nl.aO j.jQ 1 z9.p0 (bT j.bg.rG.bm.bz 114 dX aU.bg (aT oW.dK.cR.b8 105 dr.fi 1 dr.eW 2 dr.eH)) (md sY.S.b2 11 cN.p2 112 hD ci.aO 131 cN.p1 (aK jT))) (aJ zC.dm.aX 168 cP.ga 113 cP.gj 110 cP.f5 (fO nb.bQ.S 75 c9.p1 139 xn vU 41 dP.gL (h6 lW.bV.a0 117 bv aw.eN.aO 104 ch tS.ni 14 dl.fL)) (en fY.bm.bV.hK (co aH.bg.eK))))) (bc ci (bc iY.aI (gA l9.aD 105 r6 g5 gq k6 75 an v1.h8 (lE oM.cx.aD 73 cB.p8 279 dy.gg 61 mM aw (bZ l3.eP.aD 90 bN e4.vG.jd fI.vG.jd iD.vG.jd 79 ca bq.kY.bH) (dd gr.a0 aB 261 d1.p2)) (gW qN.cd.ag.bw 140 iq nC.bI nH.bI 17 cA.p3 79 ep h9.cJ.ja (d2 aV))) (fR j7.bQ.aj 35 cM.fN 43 cM.ex 53 cM.fL (fS lK.cK 67 cV.eZ 194 bN h5.fF 190 d4.fF (al H.rG.bH.bH)) (J bd.S.jd.eD.kk 221 c8.fM (bk gX.gY)))) (gI o1.ia.cR.ja 4 z7.f4 54 mc rb 50 tg (nd (lZ s7.S 129 c5.fE c5.fD 70 fG kr) (aZ (jB uw.aF.iF 11 dy.fC 64 sk bO 116 nZ K 17 dy.gv) (aK lS.io)) (bD rI.gC.aj 72 ep ar.cJ.ja ao.cJ.ja 149 iq mY.bI 145 iQ.bI (ly gu))) (nd (jo oy.cz.aj 23 cy.gk 171 ct.gv 153 cy.fU 74 cq.p4 j) (gW kt.ec.fj.cJ.S 85 mG K L 168 zu 164 cV.er j (g4 o0.fj.ae.b2.ae 106 dl.fT 82 dl.er 78 dl.eB)) (eG qa.b6 100 bv ah.aO bK.aO ea.aO 1 dT.eZ (lf (qG H)))))))) +def Fc : ab dp:=(nd (rP j2 iC Dp 24 (aM cD f7 e_) 65 (aM cF f7 e_) b1) (cb nM.S 84 HQ Ik Ie 89 Id (aR ah.bP (nd (rP eE iC tA 24 (aM cD dE e_) 65 (aM cF dE e_) e_) (aJ kj.eV.dJ 11 z7.eZ 1 z7.fo 2 z7.fU (N e_.eK.i0.bo 77 cy.fo (bZ mQ.ia.aj 84 bN aA.aF.fF aB.aF.fF dD.aF.fF 109 ca aw.cR.bI) (lf (wW ah))) (fh s5.ho.bQ bd 65 ep e_.A3.n2 17 da.eZ e_ 124 iq j.ym.jd (lf (jB th.aj.ag.iF 11 dL.fT 188 ap hj.eC.av 122 ey K.cY 17 dL.fA)))) (bU ci.fy (aZ (eU cF Dr ar) (iL wZ.bV.pl.ae 86 vn K L 151 ds.fm 147 vi)) (bA u3.cx.b6 197 cS.fC 1 cS.gv 2 cS.fq (co gu)))) (nd (kH vb) (cu iT.bl.g0 153 an e4.iV fI.iV iD.iV 19 z9.gk (fS kV.ec.b2.aF.aX 163 cP.p1 66 sb K 62 L (bC tr.cx.bi.gZ 95 bN fX.g8 d8.g8 80 ca ah.cY 76 aU.cY)) (aW nL.hM (bM rI.ag 48 ep X hW ld 1 dM.f5))) (az ri.ia.S 149 xA 85 cM.gv 29 cM.fq (aW j.mX.nT (iO o4.bV.rG.bm.bz 114 dX gu.bg)) (en pT.eh (aG af.pU.vS))))) (N nl.eV.dK.fy 188 z2.gK (ku cC (qw g3.bV.b2 4 z8.eu 61 z8.ez 58 u7 (qe fa.bl.bi.aD 47 ct.ex 650 cS.gO 91 cy.e7 aw (bk lT.eh) (al kr)) (bA sV.bH.bi.b8 139 cA.fo 1 cA.fU 2 cA.fi (ij th.aj.ag.dv 196 ap d8.bP.av 120 ey lk.cv 116 kS.cv))) (N rb.bu.cw 186 cG.eZ (bD tG.aF.aD 68 yt bj br 101 fe ug 97 aP.n2 (ac iZ.nj.vC.Eg.fy.bz 81 dT.er)) (de cX.o6.bp (lf (rP l4 iC GA 32 (aM cD fB e_) 145 (aM cF fB e_) e_))))) (bS H (dQ fa.a0.aC 11 dn.f4 71 dn.fE 148 dn.gl 43 dn.fD (gz h7.iI.nS.S 139 lo aw 80 xc ah 76 aU (al br.iH.bQ)) (fh qQ.b2 bd 4 cA.f4 aP 70 cA.f6 H 66 c0.eZ aP (ly hQ))) (nd (rP j2 wU Cx 24 (aM cD f7 e_) 65 (aM cF f7 e_) aP) (fO jp.eN.b2.a0 81 dj.fp 175 y6 aE 14 dP.p3 (hZ lK.bl.b6.aD 173 ap bF.d6 173 ap bE.d6 135 y0 aE 26 dl.gk e_)) (J aH.pE.xK.cH.hU.aI.aI 317 dl.gK (aK hW.bQ.bp)))))) (aR aE.ec (e2 j.bm.bu.bu.dh 151 iJ aP.aC (cu wG.fj.S 58 dX nk g2 kg 135 z3.eS (aJ nM.gR.dm 11 z7.eA 1 z7.f9 2 z7.ga (e2 lM.rG.bm.bz 122 dX K.fr (iO aV.hL.aI.hV 231 et H.bH) (lf (rP rx.dJ.jr iC x6 28 (aM cD mD e_) 105 (aM cF mD e_) b1))) (iw oL.cz.ae 113 sh br 86 hJ h5 82 d4 (ac iS.pE.eP.aI.db 114 dL.p3))) (gI gG.jq.b2.ae 184 c5.fT 60 wu K 56 L (dG ie.hL.cH (hT sO.S.S 76 pz aN 189 b7 ed.aC.ae 185 d0.aC.ae)) (J aU.iv.bm.dx 164 cI.fu (lf (rp aH.yk))))) (dQ iT.dK.aC 11 z5.gv 136 z5.fq 162 z5.gb 29 z5.gd (nd (tI hR.bl.bi.cf 71 an tT.gP 107 dk.b0 103 e6.b0) (J H.cR.bV.fd 159 ct.gH (aG iQ.fQ)) (dG jn.bm.cH (cp y9.bw 54 cL.fL cL.gg 19 cL.eY))) (N X.aF.vG.bi.aO 65 cq.fU (J aV.hL.bV.fd 159 dP.fK (d2 eQ.aI.pm.bm)) (J mE.aO.kY.eF 925 dT.p0 (lc ua.cK.cQ 235 dq.p0 236 dY.e7 144 dq.p2 140 dq.p1))))) (eL ci (lC cD Bc bd (bc jV (nd (pJ qi.S 99 lo aE K L 76 xr) (aT lU.eV.b8 65 c0.f5 1 c0.hH 2 c0.gL) (dd cZ.a0 aB 170 d1.ft)) (eG ud.bl 66 ca iY.bH aE.Ga.bH aP.iH.bH 1 cA.gH (g1 zB.aj 23 dM.eW 81 cL.fD 55 cO.fL aw))) (lj t8.ia.ag 91 sM aE 91 uG bd 1 cG.p0 e_ 2 cM.e7 e_ (gz mQ.S 76 bN i6 65 ca dk 61 e6 (al i6.mu.bH)) (fh jA.dK.gR.cf e_ 125 cI.gg e_ 81 vo H 77 cI.fL aP (bk gf.gY)))) (om jm.iI.iF 11 z6.gv 61 z5.gk aE 95 nX hO (k2 gF.gR.b6 67 fG zq 1 dn.eA 2 dn.f9 (gV uD.aj 35 dy.fi 43 dy.eW 99 dy.eH (al ar.iH.bQ)) (gy j.ib.iG.eC (e5 wM.fg 61 cL.fE 91 mH jl 87 ju))) (N cX.eC.db 60 cP.fq (bD jx.aj.e0.cQ 92 nZ h5 d4 68 mM aY 64 aQ (bM oV.g6 118 bv iS.aO nK.jQ qJ.jQ 1 dL.ft)) (J jn.vC.hK.bm.dx 164 cN.gv (lf (zo rI 103 d9 36 an 95 dY.gH 14 dY.gm)))))))) +def EL : ab dp:=(hS cZ.ec.bw 115 Gq 17 GI 50 GG (aJ gU.eb.cQ 78 G2 93 Hu 89 Ho (aR dV.bl (cb eT.b6.bw 125 z3.eB z3.fT z3.fA 19 z3.eu (o2 fc.a0.bp 77 kA bq.gP 61 mc X.cH 57 ad.cH (N q4.i0.bo 68 cy.eS (d2 lT.bl.pm.bm) (ji b3)) (bT bd.FX.CQ.dt 362 mJ v1 (bM iu.aS.S.eb.aF 195 w6 H ah aU 1 dL.fL))) (ef iT.eb.e0.cQ 148 pB b1.mX uB 85 fG jw.aD 81 jD.aD (aW cX.nT (al rS.mu.bH)) (e9 u6.bP.aX 174 cS.e1 cS.gk 29 cS.er 194 cS.eB (eo qt.cK.S 86 cU.fL 57 cU.eH H 191 cT.fm)))) (eL qI (eg nF.b6.ag 111 c4 jN.bu 1 z9.fL 2 z9.gg (gW ol.bH.bi.aD 296 lm aY aQ 417 dj.p5 128 ct.fz j (dc cg.cQ.mv)) (kN uI.aI.cJ.S 149 pA dO cj dS 72 da.eH (ij tx.aX 50 ep af 109 iq cX 105 cl))) (gp sX.q6.bw 492 je lk.cH kS.cH 17 cM.p5 221 cq.gv (md ta.bi.eN 62 dP.gO 368 ky ur 19 dP.ev (bC na.iI.aj 102 ch ar.bi.ni ao.bi.ni 123 bv hQ.aO 119 g7.aO)) (ix ao.Cv.bm (aT dF.ag.eP.dJ 11 dq.eS 1 dq.fm 2 dq.gH))))) (az h7.a0 38 z2.er 115 z2.eB 14 z2.fT (ku ju (gp nG.eK 101 c4 e_.eK e_.mu 1 z8.gv 2 z8.fq (fR g9.ag 124 cB.ft 459 c9.gL 1 cB.f4 (lf (lZ n1.aD 61 dI.p2 dI.p1 178 b7 aw.cK)) (lb np)) (bT aU.AW.kv.hM.bu.bu 61 iz j.fr.iH (h6 fk.gC 63 rR aw 48 cO.eH H 44 cO.hH))) (N k9.iH.ib.bo 59 cG.gH (J rB.Gd.eF 166 di.gO (mg na.aS 11 dT.eu 111 bv bd.pU.cJ 80 ch ah.aC 76 aU.aC)) (en kO.eh (aG rB.vS)))) (az gF.bV 22 z6.e1 41 rY 37 z6.er (pQ aY.yk (aZ (qk uW.aj.S 68 zz 93 fe X 89 ad) (fJ b4.ya.eC)) (gy jU.GE.eC (cp pV.S.fH 59 cU.f4 cU.fE 1 cU.fD))) (gI v8.eb.ia 4 cM.fE 99 sM K 95 L (ir rg.ec.aD.aC 11 di.fp 97 di.ft 57 di.f4 53 di.fE (al af.pU.bH.bH)) (de ah.io (bk cC.fr.hK)))))) (hS i3.iI.iF 4 z1.fp 109 z1.ft 17 z1.f4 (aR m3.bl (bU uO (m6 X.S (nd (xh ou.bQ.aC 11 cy.p1 127 ct.f6 369 je b1.aS.cH 114 cy.p0) (bM tB.eP.eN 84 iK iZ.wq iY.wq mW.wq 19 dT.eH) (al iD)) (iw ri.ag.dv 85 rO af 130 lo bF 126 bE (mg tJ.dJ.aD 35 dL.p7 165 ey hj.bQ.cv 199 ap ug.eK.av 195 aP.n2.eK.av))) (aJ n6.aX 28 c5.p2 44 c5.p1 40 c5.p0 (aZ (nJ u5.aS 11 c9.gv 65 c9.fq 163 ap qR 159 tN) (fb cF vr dN.gP.bm)) (aW jy.xM (aG aN.iG)))) (qv vU (nd (Aa fc.eN.cR.b8.bw 97 an oS.b0 oz.b0 17 z9.p5 73 lV.i2) (ek qd.q6 100 hJ jN 1 ct.p7 2 ct.p6 (lf (oT tn.pl.S 200 c6.eY c6.eS 99 zf 95 c8.p3 j))) (bD l8.cf 70 hC nr mh 137 et j5 133 lG (e8 rk.S 108 hB au X ad 53 dM.ga))) (lj sR.cz.bi.aD 228 cP.fm aY 228 cP.fm aQ 382 yv dV 64 cM.f5 j (aZ (wE uV.kl 83 cy.ev 146 lo iN 14 dP.ga) (bZ g9.cx.fj.S 152 mK tq j5 lG 200 jK kr)) (en ke.eh (aK aw.eN.bp))))) (bc H (nd (kH b1.wq) (lQ qX.S.S 53 z9.fu 153 an aE.iV 63 z9.gO (e2 aE.mv.aI.db 232 ap aE.cx (aT lU.ik 11 dr.gl 1 dr.e1 2 dI.fx) (q0 uA aB 111 b7 au)) (m5 L.xY.bu (h6 i1.gC 104 sj k9 60 cO.ga H 56 dM.fE))) (dR ak.S (m5 qR.bu (mg nh.cx.fj.cQ.aC 11 c6.gl 100 vn oZ 157 vi dZ 153 eM)) (nt tz.bi.ae.ia 4 c8.fC 241 cN.f8 72 cN.eH (aG L.bu.iG)))) (nw tp 102 yw L 55 kA k0 51 jZ (hi rm.a0 47 c5.fP c5.gK 203 c5.fp (gy j.kY.aI (bC ud.ho 78 ca aY.wk.bl aQ.wk.bl 101 bN fX.d6 97 d8.d6)) (aZ (ow oK.cd.aj 23 c7.p1 119 bN e_.bP.g8 93 hO.fj.bI) (pa dZ.fr))) (ef ro.ho 101 cM.eu aY aQ 71 cM.ez ak 67 af (bD nD.ag.ag.bi.bg.aj 105 cV.fD ak af 573 ts cg 569 b3 (mb u5.e0.gR.aX 84 dL.ev 183 ap bF.fj.bI 179 bE.fj.bI)) (gy aw.pG.iG.eC (fb cF hI b1))))))) +def Dz : ab dp:=(c3 K.AW (hS h3.ae.aC 4 HS 215 HZ 211 Hk (aR bd.aF.bl (aR e6 (aJ h3.pl.ag 89 z7.e1 1 z7.gk 2 z7.er (lY rd.aj 23 cy.ez 125 uC ci 99 cy.fK (pM pc.dJ.bm.bg.b2 4 dr.fo 131 c7.fu H 127 w9) (ji b3)) (bT q4.kv.pU.hK.dh 305 ky q4 (hZ iu.aS.eK.bi.aD 173 ap bj.ym.hM.fF 173 ap br.ym.hM.fF 247 ap au.ni.fj.bI 58 dL.f8 e_))) (nd (lZ g3.ho 129 c5.gk c5.er 78 fG bq.aD) (aZ (wP iu.cd.bV 24 ct.fi 170 dy.p4 26 dy.p3 63 dy.p2) (ac bq.i0.gE.cw 88 c6.ev)) (bA d5.cz.cd.bQ 70 cS.p9 17 cS.p8 122 cS.p7 (iM jV)))) (nd (kH j5) (k2 j3.ae 60 an aQ.aC 73 z9.eB 70 z9.fT (hX ra.cd.bi.aS 11 cV.gK 70 dy.f9 173 ct.fD aw (d2 ak.aS.vC.bm)) (aZ (jB rI.ag.bQ.aC 11 cS.fU 80 ep bO.ya.n2 169 iq dN.bV.jd 41 cS.fi) (e5 cZ.dv 46 cO.gL 69 z2.gb bj 65 br))) (nd (pP cZ.aj.S.b2 4 cM.gn 100 uC H 96 nW) (ir xq.b2.b2.aj.ae.aj 183 da.gO 184 da.ev 479 cS.p3 476 cS.p2 (lf (eX o3.aI.cz.S 122 dl.gn e_ 122 vl H 122 dl.gn aP 180 ap l6.hL.bI))) (bA tu.bu.b8 57 c8.p9 1 c8.p8 2 c8.p7 (bk dS.gY))))) (nd (rP eE sd D1 24 (aM cD dE e_) 65 (aM cF dE e_) b1) (bU cj.eN (bc kp (e2 dk.i0.bo 204 fe au (nA n1.aD 61 dI.p7 dI.p6 178 b7 ug.ae 174 aP.n2.ae) (lb d0)) (gW BY.eK.bw 98 pz K L 17 cA.fT 179 b7 o5.cQ (aT zB.ag 51 cO.fL 1 cO.gg 2 cO.eY))) (dQ h7.aI.eN 45 cG.ez 46 cG.fK 17 cG.fN 25 cG.ex (fV oY 86 bv 59 ch 55 xj (lg na.jr 11 dT.fL 112 ch jv.aC 107 bv rK.aO)) (J eQ.iv.bm.dx 164 c8.f6 (bk gx.gY)))) (az m8.bl 76 je 1 z6.eZ 2 z6.fo (pQ dN.eC (fh s8.a0 bd 103 uC bt 83 rc aE 14 cP.e1 aP (fJ aN.A3.eC)) (k3 n1.aS 11 c0.gl e_ 178 b7 h9.nj.ae 69 cA.f6 aE 65 vd aP (co hQ))) (lj rd.aD 59 cq.p9 e_ 118 cq.p8 e_ 319 cM.ga H 57 cq.fu j (J nl.r5.eF 171 cA.gO (al pT.kv.aX)) (kh sK.e0.gR.bw 69 c7.p4 c7.p3 19 c7.p2 (bZ gG.b6.wq.S 159 hB e3.aI uU d0.aI 82 jc pd)))))) (nd (rP qu sd BH 28 (aM cD hI e_) 105 (aM cF hI e_) e_) (aR kp (bU L.mu (nd (lL nM.aO.S 114 z7.p2 190 z7.fC H 116 z7.p1 97 kw lR.fF) (nd (uT uw.aF.aj 23 cy.p7 80 mL bd.aS 64 mf ak 60 af) (ff os.b8.bg 121 cA.ex 288 dr.fC 235 dr.gv) (la li.eN 41 d9.f9 d9.ga d9.gj 19 d9.f5)) (ck jU.aF.aC (aG cl.aC.S.gB))) (N C5.eV.dK.fy 51 c5.gd (J au.bm.aX.pG.bo 213 dP.e1 (lf (tQ l8.iI.cx.bw 141 w1 bj br 17 dT.fq 215 ds.fm))) (J eM.hU.bP.eV.dK.fy 92 cI.e1 (ff d5.aj 23 cT.fP 76 cT.gK 50 cT.fp)))) (lC cF vr aE.nS (nd (oi qx.bV.a0 116 c4 aw.eN 92 an q5.i9 14 z9.f5) (aZ (lz jl.cY) (lf (tI oK.iI.ae 85 bN j.wi.fF 109 ak.aS.cH 105 af.aS.cH))) (gz kL.S.S 170 ap b4.bi 76 ey dk 72 e6 (eo pV.S.bV.a0 59 cL.eH 150 sa iN 14 cL.f8))) (aJ uX.eK.dm 11 cq.gl 1 cq.e1 2 cq.gk (fS B6.b2 4 dP.fM 69 ey bK 65 ea (aG nr.eK.ce)) (de e3.gY.gD (bC rf.aj 83 sc bF bE 67 vk jt 63 gX))))) (lC cF f7 b1 (nd (kH ci) (eR l9.a0 e_ 109 c4 rK 107 an dO.ce 14 z8.p1 e_ (aJ eI.bu.gR.b8 246 cB.ez 1 cB.fK 2 cB.fN (ml dz.aI.cH) (dd tM aB 247 d1.gd)) (aZ (lL jx.aj.gR.bg 36 cA.f5 106 mM K.xM 38 cA.hH 68 sk i6) (lf (ow qg.aj 23 dM.fz 81 mF dV.bl 55 bt.bP)))) (e2 qM.hU.bo 546 je lT.cH (aZ (qP eI.ja.cR.cQ 231 vt 59 mL bj 55 br) (aK br.vC.cJ.fr)) (bA uh.ag.ag 65 c8.ex 1 c8.fL 2 c8.gg (eo n6.bQ.S 61 dq.fu 60 cT.fq H 56 dq.gO)))) (gI hR.eV.S 90 z6.gj 51 rY X 47 ad (eJ rJ.gY (bD w0.eP.aD 66 cB.gH aY aQ 97 cB.eS ak 93 af (ac g2.vC.Eg.fy.bz 319 ds.gj)) (jW tD.aS 11 c7.e7 83 ca b1.cY 84 bN bd.fj.bI (iM jX))) (nd (rP j2 wU r1 24 (aM cD f7 e_) 65 (aM cF f7 e_) e_) (ej i1.a0.cx.bw 64 yU ak af 17 di.ga 138 di.gj (al iX.kv.aX)) (jz fY.aX.mv (lf (yz BD 40 an 29 dY.f9 60 dY.ga)))))))) +def Ds : ab dp:=(c3 o5 (m6 aw.S (hS qg.b6.bw 107 z1.eY 17 z1.fm 71 z1.gH (bS mW.bm (cu h3.eN.ag 90 kw aV.bI nK.bI qJ.bI 1 z7.fq (N ah.aC.hM.gT 82 cy.fq (em kt.eb.cx.ae.cR.b8.bw 248 dr.p8 dr.p7 17 dI.fA 364 dr.p6) (fb cF mD H)) (bA nn.bl.dm 11 dP.gm 1 dP.fC 2 dP.gv (lf (tZ iu.cd.cx.cz.aX 185 ap gX.av 29 dL.ex 205 tP.av)))) (bU aY.aO (bA ta.bi.dJ 11 c9.eW 1 c9.eH 2 c9.f8 (fJ qM.iG.eC)) (j4 d4.bu (lc hY.aj 23 cU.gm 68 cU.fC 52 cU.gv 48 cU.fq)))) (az gU.a0.ae 89 z5.fK 175 z5.eY 172 z5.eS (lj rA.a0 92 an ak.ia.aS 92 an af.ia.aS 78 an tS.gP 14 z8.fN aP (aW bt.bH (em tz.bi.bp.aj 357 ds.p7 ds.p6 257 ds.p5 253 ds.p4)) (hX i5.cR.aD 68 c7.gn 239 ds.gO 135 da.eB aw (nA j7.gZ 53 dM.p1 dM.p0 83 vq aV 79 cC))) (nd (tQ ri.cs 81 w7 cX cl 73 cq.gK 70 cG.fz) (ej lU.bi.eN 492 mJ rE rN 17 dP.fi 25 dP.eW (lf (wP ph.dK.eP.bg 56 c6.fM 144 c6.fx 58 c6.gn 114 c6.eA))) (bD li.gC.ho 125 y8 bj br 89 vo cg 85 b3 (e5 tn.S 65 dq.fq 174 hB aV.mX 170 cC.mX))))) (c3 e4 (nd (kH H) (gA CG.aj 55 an e4.aC fI.aC iD.aC 101 c4 aw (e2 H.fr.bi.k7.fy 319 ap au.gY (lf (oE fc.cz.dK.S.b2 4 dr.p2 182 b7 dZ.aC.ae 178 eM.aC.ae)) (fb cD fB b1)) (gz qY 96 bv aN 69 ch X 65 ad (ly kn))) (N H.CR.ib.bo 73 cG.gn (k3 sV.aS.cs 87 hD aY 87 hD aQ 119 dj.eB e_ 116 di.fA bd (i7 l8.cd.ag.bw 92 iK jw.cJ jD.cJ 17 dT.p2 153 et o5.bP)) (fh vV.ag.ag.bi.b8.cJ.aX bd 66 vj af 29 c8.gk e_ 148 iz qz.fr.iH (bk jD.gY)))) (d3 hO (eJ ar.hK.gY (J qq.hM.gT 82 dy.fE (al vZ.a0.hK)) (gy af.pE.eC (ms jX))) (gA pc.aO.ho 57 Cc aA aB dD 104 uG bq (du ph.eV.bg 60 w2 au X ad 182 lm aN (lf (sN n5.aj.gR.bg 36 c6.fx 357 ap H.cH.mv.bI 38 dl.p3 311 mq.xE.fF))) (iw oK.cf 78 ca kr.bl 93 bN jy.bI 89 ru.bI (aK ar.CR.xK.S)))))) (eL mW.aF (nd (rP yM.it wU Dp 28 (t9 cD DI bq) 105 (aM cF f7 bt) b1) (cb eI.dJ.bw 47 z4.ft z4.f4 z4.fE 19 z4.fD (c3 bj.xK.aF (nd (pW nh.aX.aC 11 ct.f8 301 lm aH 410 c9.f6 121 ct.fz) (cp sU.iI.ag 74 c0.p0 dI.e7 1 dI.f6) (al m3)) (J bd.nj.bl.eC.db 80 da.p3 (bC kL.S.S.cz.ae 190 ap H.gP.aI.av j.sy.aI.av 104 ey h5.cY 100 d4.cY))) (N fI.bu.cw 95 cG.fD (aW K.eC.bH (aK ke.io)) (bA ns.cz.ag 66 cI.fM 1 cI.fx 2 cI.gn (al pT)))) (cb hR.q6.b6.bg 136 z5.p4 z5.p3 z5.p2 89 z5.p1 (nd (xB sL.aj 66 an jl.i2 ju.i2 106 fX.b0 102 d8.b0) (J tT.db 72 cV.ga (iR qQ.ag 175 b7 b1.aC.ae 1 dr.p2 2 dr.p1)) (du tG.aF.aD 68 yt aA aB dD 101 fe aw.bV (aK hQ))) (nd (oC v8.b2.aj 214 cP.eA cP.f9 501 je H.ae.cH 497 j.wk.cH) (bT iY.Eg.aI.hV 148 hC aE.ia (iO uK.eK.hU.gE.cw 232 ap uK.fj.fF)) (de b1.aF.o6.bp (lf (rM tc.b2.b2.q6.aX 79 jc d8 29 dY.gK 99 oJ)))))) (m6 pR (cb nM.g6 96 z5.gK z5.fp z5.ft 1 z5.f4 (eR qV.bQ e_ 66 an oX.aC 17 z9.fU e_ 112 r6 aH (N b1.kB.eC.db 161 cB.p9 (aT ph.dK.ag.dm 11 ds.fE 1 ds.fD 2 ds.fu) (q0 gr.b6 aB 151 sa au)) (bA xu.bu.b8 57 c7.gK 1 c7.fp 2 c7.ft (ly jk))) (gp uv.aX 94 xC K L 52 cG.fq 48 wK (ck kJ.h8 (hT rr.cz.S 102 ch my.aC 115 bv j5.aO 111 lG.aO)) (J jv.iv.bm.dx 164 c8.gb (lf (oT rg.cz.b8.bw 61 dq.fi dq.eW 17 dq.eH 183 mH gN.hM))))) (nw qt.bV.pl.ae 104 wA br 65 nX q7 61 nL (eJ iX.gY (gW tL.ag.bw 76 r7 jw jD 17 dy.gm 257 ky bO (dc oD.fr.vz)) (aZ (oE ta.bi.S 129 pA 70 pq ah 66 aU) (ms jV))) (N mq.cJ.hU.bo 157 ct.fL (aW dN.mX.nT (hZ o0.fj.aF.cx.aD 339 ap bj.Ej.mv.bI 339 ap br.Ej.mv.bI 319 ap K.kY.xE.fF 82 dl.p4 j)) (aZ (pW tR.cd.aj 23 dT.fD 250 ch bO.bV 141 dT.fu 138 dT.gO) (la eT.ag 40 d9.fP d9.gK d9.fp 1 d9.ft))))))) +def DC : ab dp:=(bc d0 (bc e3 (az mj.eb.aX 62 z1.fT 41 z1.fA 138 z1.eu (aR dk (gA eT.cx.bg 72 kA H.kY mT rC 52 mc i6 (fR i5.eN 119 cy.fz 454 cV.p5 19 cy.gl (ml cl.bm.cH) (ji cj)) (j4 L.xY.bu (lf (jo o0.fj.aF.it 245 dL.eu 138 dL.fo 86 AF 82 xd j)))) (nd (tZ s7.cz.aX 78 fG ie.bw 29 c5.gl 98 gx.aD) (fh vP.kl.cR.cJ.aX bd 62 vm af 29 dy.p9 e_ 583 ts hj (iR qy.gR.b8 143 lA kW 1 ds.gL 2 ds.p9)) (ej bd.kl.cR.bg.cR.eN 122 iz oS.kv.iH oz.kv.iH 17 cS.fM 25 cS.fx (fW gu)))) (cb nu.cf 102 z5.fu z5.gO z5.ev 101 z5.eZ (nd (pO fc.eN.cR.b8.aD 61 an jn.bi.gP o7.bi.gP j.nj.bi.gP 105 lP.b0) (ej rq.dK.cx.bi.aX 58 ct.ev ar ao 171 cV.e7 167 cV.f6 (bk kS.eh)) (bA li.dK.b8.dm 11 cS.fE 1 cS.fD 2 cS.fu (bM kQ.a0.ag 52 rQ X hW ld 1 dM.hH))) (nd (uZ sX.a0.b2 4 cG.p0 98 sM H 94 cM.eY) (J kJ.sy.cJ.aO.aO 405 cA.p1 (bZ kt.eb.cx.aF.dB 75 v6 au X ad 156 l0 aN)) (de bF.bH.bp (aG ur.iG))))) (ei nB.a0.aj 85 z2.fD z2.fu 121 z2.gO 118 z2.ev (bU aB.bQ (N lM.pG.eV.bz 71 z8.fL (az rl.pl.ae.cQ 64 cy.gd 161 cP.fN 157 cP.ex (d2 X.jd.pm.bm) (lf (m0 s9.eb.ae 96 z0 211 z1 219 z2))) (gy dZ.iG.eC (aT yV.dm 11 cO.gl 1 cO.e1 2 cO.gk))) (ef eI.cx.aD 67 Ay bj br 55 w4 K 51 L (aZ (lB tl.b6 90 fe ok 1 c9.p0 2 dj.e7) (mb uY.aC.S.b2 4 c6.f4 158 l0 bK 154 ea)) (jz vR.vz (em k4.aD 49 cT.f8 cT.fz 75 cT.gl 50 cT.e1)))) (bS aV (nd (oT h7.cx.aD 66 dn.f8 dn.fz 163 dn.eS 50 dn.fD j) (kN lU.S 80 hC dO cj dS 129 cB.ft (aK b1.mX.gP.ib.fr)) (ek sO.S 173 b7 b4.ae 68 c0.eZ 64 pz (bk hQ))) (qe mP.aX.aC 11 cq.hH 62 cy.gK 84 cq.fp aw (J l6.mX.aF.sl.aI 199 cA.ft (al ue.mu.bH)) (ck lG.fQ (bZ tK.aD 167 hB jn.ya o7.ya j.nj.ya 70 dY.fp aw)))))) (hS fa.jq.eb.ae 128 G0 73 Hb 69 Go (aR pd (N cl.aF.sl.aI 141 z3.gv (fR i3.e0.ia 11 z7.p8 87 z7.p7 70 z7.p6 (N aB.eC.db 147 cy.f9 (ml aN.aI.cH) (dc j)) (ej uW.eV.S 119 fe eQ dz 68 Az 64 da.fC (mb iu.bH.bi.cf 83 w6 189 ap g2.iH.wi 185 kg.iH.wi))) (o2 qX.aj.b2.ae 152 pB uB 89 fG ar.Do.aD 85 ao.Do.aD (J rD.aX.pG.bo 211 dP.gl (ac K.o6.av.k7.fy 202 dT.gL)) (nt u6.bP.ia 4 cI.eH 105 cI.f8 101 c8.ev (em lH.dJ.bw 51 cU.p5 cU.p4 17 cU.p3 190 cU.p2)))) (bS jt.bu (ef j3.iI.aj 90 an tk.i9 uq.i9 122 c4 hQ 118 g7 (e9 mP.ag.iI.aj 119 ct.gb ct.gd 165 cV.ez 162 cV.fK (aG iY.jQ.iG)) (bT X.iH.aI.hV 124 hC cj (bC gF.gZ 57 mF hQ g7 87 dX cj 83 dS))) (gp tH.bg.aj 58 wh ak af 345 cy.fA 122 cq.eH (J b4.bm.bV.fd 159 dP.eS (cp rt.aF.b2.ag 202 dl.fm dl.gH 1 dl.gm)) (e9 tV.e0.bi.eN 240 c7.eB c7.fT 17 cN.eZ 25 cN.fo (bk b1.eh))))) (N bd.ib.cw 41 z2.fC (aJ nx.ag.dm 11 z4.gn 1 z4.eA 2 z4.f9 (cu qX.cs 85 an H.wk.mv ah.wk.mv aU.wk.mv 75 z8.p5 (ef rq.dK.cQ.cs 70 mG ar ao 175 y3 K 171 L (co H.ae.bl.ec) (dd rF.S aB 71 rX)) (ek m1.bP 68 ca CO.bH 1 cA.fM 2 cA.fx (bC wG.S 46 ep ak af 105 iq K 101 L))) (dR b4.S (bD jp.dJ.cs 250 ky bF bE 85 r7 jt 81 gX (bM na.b6 76 ch dZ.aC e_.eK.aC e_.mu.aC 1 dT.gn)) (aZ (lZ kQ.jq.eP.cs 120 y8 c8.fK 80 vo aw) (aK uB.bp)))) (ef jm.iI.aj 98 yw K L 51 kA ak 47 af (eJ aQ.gY (J H.gP.aI.db 116 dy.gk (aK e_.A3.eC.gD)) (iw qo.S 86 bN l6.bI 75 ca gu 71 uf (ij i3.fg 61 mF g7 91 dX lk 87 kS))) (nd (zT t7.a0.aC 11 cP.fx 88 nZ 54 sk) (m5 nC.bu (e8 n6.e0.cJ.fj.S 102 zf au X ad 207 dl.fm)) (jz cl.cQ.mv (la AE 36 dY.gd dY.fM dY.fx 1 dY.gn))))))) +def Dt : ab dp:=(d3 ld (N nH.eV.bz 142 GY (aR gq.bP (bS bt.eP (lQ kj.q6.S 189 z7.gn 94 z7.e1 H 90 z7.gg (oU u8.aF.cf 66 rc 108 nW ah 104 aU (lf (qU e_.dm.dm.aX.aF.aX.cz.ae 71 wc K L 124 wF 120)) (lf (eX jA.eN 37 c5.gb b1 99 c5.fM e_ 37 c5.gb j 19 d9.ez e_))) (fh g9.eN.S e_ 49 vh bd 136 wm K 132 wm L (iL o3.aI.S.b2.aj 188 ap aY.bu.d6 aQ.bu.d6 138 dL.fm 134 dL.gH))) (bS oB.aF (k3 pf.cx.aD 521 cS.f4 e_ 637 iz op.kv.iH 348 ct.er aE 124 cq.eA j (fJ ao.A3.eC)) (ix L.hU.pm.bm (lc jA.ec.aD 113 cT.fu 160 cT.gO 63 cU.fm 26 cU.gH)))) (N gq.bP.dh 59 z5.er (nd (rM pg.b8.fg 160 an b3.iV 75 z9.gH 164 bd.b6.b0) (aZ (eX s9.q6.bi.S 65 mG b1 197 je g2.cH 65 mG j 166 y3 e_) (d2 lk.bl.pm.bm)) (ej l8.aI.b8.bw 500 mJ aY.cR aQ.cR 17 c7.eZ 411 dl.gj (aT d5.ik 11 dM.fM 1 dM.fx 2 dM.gn))) (N ao.bg.fd 76 cq.fP (od oL.dJ.aD 35 dP.eZ 142 hJ h9.bm 121 ct.fx ak 117 af (ij lU.ik.aX 197 jK b3 153 mK aY 149 aQ)) (e9 yr.cz.S.bp.aF.bw 67 c8.p2 wc 17 cN.f6 116 wF (aG u1.iG))))) (oq gx (bU b4.bQ (nd (ow uH.aS 11 z8.eA 76 an iN.bi.gP 98 aN.b0) (nd (pW ko.eb.gR.bw 159 ct.fq 264 As j 17 ct.gm 126 ct.fC) (iR q8.b8 72 vd jH 1 c0.f9 2 c0.ga) (fb cD hI b1)) (aZ (qP iy.ec.eV.ae.b2 4 di.eB 119 lJ ah 115 aU) (ff yV.bw 39 dM.fu 219 cL.f9 19 dM.gO))) (dR ak.bg (ck ar.aF.aC (e8 qy.dB 173 jK au X ad 147 dT.e1)) (de bO.bH.bp (bk gN.hK)))) (d3 X (pQ ar.Do (aZ (yL qd.ja 4 cB.gl 39 cB.fz 36 vp) (ac oN.bP.dt 334 dT.p8)) (J cl.xY.bi.cJ.aO.aO 585 dT.p1 (cp mU.jr.fH 63 cU.fu cU.gO 1 cU.ev))) (cu uX.eK.bw 93 lF aA aB dD 19 cP.fU (kh vV.ag.ag.bi.b8.bg 99 CA di.gl 58 ve (bM lK.bl.cd.aF 177 ap fI.d6 rb.d6 tg.d6 1 dl.p2)) (md j8.fH.bw 135 cN.er 216 ch dV.aC 19 cN.eB (fW af.cx.bu)))))) (cb qg.ag 51 z1.fo z1.fU z1.fi 1 z1.eW (N X.bu.dh 55 z1.p8 (cb eI.dJ.dm 160 z3.p4 z3.p3 z3.p2 1 z3.p1 (eR nG.bQ bd 101 z8.eW e_ 17 z8.eH e_ 67 an oZ.aC (az kt.ec.S.ae.bQ 51 ct.ev 17 ct.eZ 251 cV.fp (hZ oQ.bl.cf 135 dT.f8 e_ 136 cN.ex aP 99 hD j5 95 hD lG) (fb cD Dr bd)) (J jn.pU.aI.hV 78 da.gL (bC pI.cd.cQ 103 ey q7.cv nL.cv 193 ap s6.av 189 tU.av))) (eR dF.aj.bQ e_ 46 w4 bd 17 cG.f4 e_ 74 Ay j (bA mP.ag.dm.dm 11 c9.ga 1 c9.gj 2 c9.f5 (lg qy.gR.aD 35 dT.gv 229 jK dV 147 lA lS)) (J tN.aO.bP.eV.dK.fy 134 cI.fC (ac h5.bi.hL.dx 156 cT.gH)))) (qv af (nd (oi um.kl 119 c4 aN.aO 117 an au.cQ.ce 14 z9.p3) (J fY.hL.aX.pG.bo 666 c0.e1 (ac jn.zh.jd.eD.kk 221 dr.fK)) (ek g9.aS.ag 87 iK jN.cJ 1 da.p8 2 da.p7 (pa H.fr))) (e2 qc.pU.hK.dh 305 ky aw (aW ah.iv (bZ rr.cs 111 bv t0.aO rs.aO ad.bi.aO 88 ch kc.aC)) (e9 u6.aF.bw 174 c7.p0 c0.e7 17 c0.f6 77 c0.fP (aK aB.bQ.bp))))) (aR pr (bc iQ (nd (uZ qx.b2 4 u7 104 c4 ah 100 wN) (dQ oQ.bl.aj 23 cB.fx 125 cB.gn 119 cB.eA 94 cB.f9 (ac bt.r5.eK.dt 334 dT.eY) (q0 gs.b6 aB 260 iJ au)) (ek tz.cJ.b8.b6 153 l0 pr 1 dT.f4 2 dT.fE (lf (lz aV)))) (nd (qU cZ.aj.cx.ae 50 wK K L 100 xC 96) (e9 sS.eb.eb.ae.aF.bw 63 dj.eA wV 17 dj.gj 112 wC (aG bd.aS.eK.ce)) (ix m4.Cv.bm (aG ak.hK.iG)))) (ef kV.aj.b2.aj 50 nX bF bE 109 wA ak 105 af (gI lD.S.cQ.b2.ae 75 dn.gv 62 xa K 58 L (aZ (qU wQ.aj 57 xj K L 92 bv 88) (e5 kK.gR.fg 144 ds.p8 174 c0.fK ar 170 ao)) (aZ (rP l4 iC Ax 32 (aM cD fB e_) 145 (aM cF fB e_) aP) (aK gu))) (nd (rP fk iC sw 20 (aM cD kD e_) 25 (aM cF kD e_) b1) (jW tD.iF 11 di.p5 94 bN H.bI.fF 101 ca v1.bI (al bK.bm.bH.bH)) (de L.aF.o6.bp (em eT.a0 40 d9.eH d9.f8 135 dY.p6 14 dY.p5))))))) +def DR : ab dp:=(eL e6 (cb kj.S 64 H5 H9 Ij 225 Hg (aR dZ.bP (aR kc (cu kj.eV.eN 87 kw g5.fF gq.fF k6.fF 19 z7.fK (nw uv.dJ.aX 100 lF af 106 xA ar 102 ao (iO bq.pE.CQ.dt 362 mJ aw.cR) (lf (qG aV))) (dG ub.hL.cH (iO g2.eK.hU.gE.cw 232 ap g2.fj.fF))) (cu oW.dK.aF 51 AA ah bK ea 1 c5.ez (fV gr.dK.gR.ae 28 dy.p1 70 dy.p0 66 c9.e7 (bM ud.fH 97 bN dk.g8 nE.g8 tW.g8 1 ds.gd)) (k3 hR.S.eP.cR.aD 75 ep bF.ya.n2 75 ep bE.ya.n2 184 iq b1.kY.bg.jd 50 cS.p4 e_ (aT s9.eb.ae 96 cU.er 211 cU.fA 219 cU.eu)))) (az iy.bQ.ae 207 z5.fi 109 z5.eW 223 z5.eH (ef l9.aD 105 r6 aY aQ 75 an dN.h8 71 ie.h8 (gV rx.fj.fj.cx.bi.a0 60 cV.fE 491 di.p8 137 cV.fD (bZ m1.aD 68 ca oB.aF ul.aF L.Ev.aF 91 bN bt.g8)) (od mU.hL.fj.cQ.aC 11 cS.eH 155 cS.ez aH 79 xz dZ 75 eM (ac K.eC.bu.cw 147 dM.p6))) (nd (jB pf.cQ.aC 11 cM.gj 233 cP.fm aH 367 ky H 57 cM.f5) (J gx.hU.bP.eV.dK.fy 259 dP.fE (lf (ry kL.bV.b2.ag 124 vl 1 c6.f5 2 dl.f9))) (hX d5.cx.aF.aD 66 c8.p4 372 c6.gH 208 c8.eZ aw (ff hY.g6 162 dq.f9 319 dY.fP 1 dq.ga))))) (N b1.ib.cw 41 z2.fi (bU hW.bQ (oU um.b2 4 z7.p6 69 an nE.aC 65 tW.aC (dQ ma.aS 11 ct.gn 141 cV.eS 270 cV.fm 106 ct.eA (lg re.b2 11 dI.p5 81 c0.eZ aE 172 b7 bd.ia.ae) (kf rv.iF.aj fY 124 d1.fi e_ 69 d1.eW e_ 65 d1.eH e_)) (eG fc.cz.dK.eN 162 b7 e4.cQ fI.cQ iD.cQ 19 cA.ez (aT mU.cd.ag 51 cO.gd 1 cO.fM 2 cO.fx))) (eg gG.aX.ag 52 pp jH 1 cG.fL 2 cG.gg (gV zR.b6 56 dj.gO 235 cA.ev 1 dj.ev (lf (lB tR.cf 102 hD bt.aO 150 cN.fN 138 dT.gm))) (J jU.aO.bi.hL.dx 156 c8.f4 (dc jl)))) (ei eT.bl 36 z6.eW z6.eH 1 z6.f8 2 z6.fz (az i4.cd.aO.aX 51 AK 29 dn.fL 71 dn.gg (gW tl.bw 65 zz ak af 17 dy.e7 98 fe bO (aT AN.eb.aI.b8.b8 133 dr.fM 1 dr.fx 2 dr.gn)) (fO BC.cK.S 58 cA.eW 144 cA.fo H 313 dr.gg (bM sJ.ag 59 mF gu jV m3.bl 1 cU.ft))) (eR ri.ag.a0 e_ 73 xc e_ 136 lo aE 14 cP.f6 e_ (hX j8.aX.aC 11 di.fP 68 cA.eW 136 dj.eZ aw (al ak.aX.a0.hK)) (de op.io (aK h9.CR.xK.S)))))) (nd (rP eE iC CV 24 (aM cD dE e_) 65 (aM cF dE e_) aP) (aR dk.bl (bU uN (az iT.bl.b6 54 z8.f6 1 z8.fP 2 z8.gK (N bd.FX.eC.db 487 dy.gH (ac ty.GO.bi.k7.fy 80 c0.p5) (dc H)) (aW e_.bV.hK (bC ot.bV.aj 89 ey aY.cY aQ.cY 195 ap mY.av 191 iQ.av))) (az n6.bV 22 c5.gj 38 c5.f5 26 c5.hH (nt qd.aS 4 c9.gg 271 dP.ez 107 dP.eu (aK H.kB.eC.gD)) (aZ (pW uF.e0.aF.iF 11 cI.fT 69 vj kP 460 cN.e7 17 cI.fA) (mb n3.ia.b2.ae 128 cU.p8 58 yy K 54 L)))) (bS e6.bu (eR uH.cf e_ 110 an pd.b0 78 an jy.i2 74 an ru.i2 (aZ (pk ii.ho 141 c9.fA 627 mJ qz 277 c9.eu 113 ct.eA j) (lf (jB uD.ag.b6.aD 147 c6.eB 254 bv tP.aO 135 hD b1.kY.cJ 26 c6.fT))) (fO sX.S.b2.a0 114 da.f9 93 yW aE 14 c7.eS (cp d5.g0 58 cL.gb cL.gd 19 cL.fM))) (hi uv.S 56 lF rc 98 nW (fO uW.a0.S 98 wJ 72 c9.fx H 157 da.fM (g4 qh.aX.dJ.ae 28 dl.fA 84 dl.eu 80 dl.ez)) (J ue.iv.bm.dx 164 cN.hH (bk iQ.gY))))) (lC cD FK bd (ei kj.it 94 z4.gL z4.p9 99 z4.p8 95 z4.p7 (nd (pO uo.S 61 an q9.gP iS.gP t5.gP 97 qq.aS) (az uD.ag 91 cB.fL 1 cB.gg 2 cB.eY (ml gq.aI.cH) (pa dO.S)) (aW aQ.bm.bw (iL n3.fj.S 50 rQ ak af 145 zx 141 dM.ft))) (dQ t8.fj.ae 137 cM.p2 138 cM.p1 113 cM.p0 273 cq.f9 (fO rl.a0.cR.bg.S 60 dy.f9 181 dy.fx H 277 di.f5 (lg qY.b2 11 c6.eH 126 bv tS.aO 81 ch gS.aC)) (hX ns.cz.aj 23 c8.fm 96 cN.ev 70 cI.fM aw (lf (jo d5.it 317 dq.f5 160 dq.ev 62 zp 58 cT.eS j))))) (lY iP.cz.aD 46 z6.p6 196 kw gf.fF 77 z6.p5 (gp il.cz.bg.aj 62 dn.eH ak af 61 dn.p6 57 dn.p5 (gz yA.aj 91 bv aU 68 ch ak 64 af (lf (wI AN.eb.aI.b8.aD 79 dT.fP 409 dT.eB 137 dr.fM aw))) (gz l3.cK 75 ca uS.bH 86 bN bj.xK.jd 82 ut.jd (lf (eX jm.aD.aF 43 tO e_ 43 cL.f5 H 43 tO aP 1 cU.fo e_)))) (dQ ou.bQ.aj 35 cP.p5 36 cP.p4 181 ct.e1 178 ct.gk (m5 lP.bu (aG au.aC.S.gB)) (kh te.bg.ag.bw 68 dI.gH dI.gm 19 dI.fC (lf (rP eE wU By 24 (aM cD dE e_) 65 (aM cF dE e_) aP)))))))) +def DE : ab dp:=(d3 b4 (bc ci (eR gF.gZ b1 57 z1.gm e_ 239 iJ X 235 iJ ad (bS d0.eP (gp nM.fj.S 96 sf eQ dz 119 z4.gd 115 z4.fM (N H.n2.hM.gT 82 cy.fM (lf (wI uY.aF.bi.aD 120 dI.p9 342 dr.fN 81 c7.ez aw)) (fW bK)) (bD nb.cs 71 hJ aY aQ 118 sh ak 114 af (bM ot.eP.aF 187 ap aB.eC.av b1.EZ.eC.av bd.pE.eC.av 1 dL.eA))) (eg uF.ae.ae 111 iz ao.sy 374 c5.gv 370 c5.fq (J jy.bV.fd 159 c9.eB (al ao.fr.aX)) (ej uc.aI.aX 68 cS.eY ar ao 127 cI.fp 123 cI.ft (g4 rf 51 vk 75 sc 131 cT.gg)))) (ei i3.a0.aj 93 z5.fm z5.gH 138 z5.gm 134 z5.fC (gA j3.aD 60 an ue.aC X.gB ad.gB 110 c4 lS (hX ou.e0.aD 118 cV.e1 263 dj.p0 55 ct.fK aw (ac oD.fr.jd.eD.kk 221 dr.p5)) (kN l8.fy.bg 129 wm aE K L 46 vh (eo m8.bV.a0 55 cL.fp 110 rX iN 14 cL.ft))) (aJ mP.aX.bP 80 cq.fp 1 cq.ft 2 cq.f4 (kN ko.eb.dB 104 zM au X ad 85 c9.fK (al lS.kv.aX)) (en K.aD.bl.bH (mb BT.bg.ae 58 cT.p8 78 zU K 74 L))))) (c3 cj (az h3.pl.S 112 z4.fm 93 z4.fL 89 z4.gH (eg rA.ag 92 an b1.b0 1 z8.hH 2 z8.gL (gA ro.dK.S 105 Am au X ad 103 lF b4 (mg qy.gR.aD 35 dI.fM 219 jK hj 147 lA cg 143 b3) (dd lD.S aB 31 rR)) (gz iy.bV.b2.bp 65 u2 aN 191 lm dk 187 e6 (eo iA.kl 48 mH 125 hB aE 14 cO.p0))) (dQ ko.bl.aj 23 cG.p7 79 cG.p6 73 cG.p5 48 cG.p4 (jW oO.cQ.aC 11 dj.eu 75 u2 gf 183 lm gS (lf (q2 rr.cz.aj 23 dT.p7 131 bv uN.aO 115 H.bP.aO 111 uj.aO))) (j4 ub.aI.bu (iR rk.iF.ag 75 jc kW 1 cT.fM 2 cT.fx)))) (mi jm.fy.ja 11 z6.fm e_ 100 z6.gH e_ 11 z6.fm aP 43 z6.ez bd (nd (nJ gF.gR.aS 11 dn.fM 134 dn.fx 71 fG kO 67 tE) (hX eI.bu.gR.aD 35 dy.fD 115 dj.fp 250 cB.ez aw (dc o7.zh.vz)) (e9 yF.gR.ae.cQ 239 dr.f4 dr.fE 53 c7.fq 50 c7.gb (ly kp))) (az jp.dJ.S 69 r7 242 ky 238 yv (fO o3.bH.a0 131 di.fm 106 rV au 14 di.gH (lf (tZ o0.eK.aD.S.ae 353 ap uS.bm.fF 169 dL.eB 337 h9.bg.hM.fF))) (iw ov.cf 82 ch qq 113 bv va 109 d0.aO (aK ie.CR.xK.S)))))) (c3 L.hU.bI (N u1.dh 215 Gc (cb gG.kl 52 z4.fu z4.gO z4.ev 165 z4.eZ (nd (qp gU.dv.ae 101 nY L 78 pw K 74) (N mh.hM.gT 82 ct.fT (aT tD.ik 11 dI.fP 1 dI.gK 2 dI.fp) (iM gx)) (aZ (qk oM.bl.dm.aX 83 dP.p5 159 xo ar 155 ao) (bC rL.cs 94 ey bF.cv bE.cv 196 ap hQ.av 192 g7.av))) (N bF.bu.cw 54 cG.gO (J kJ.aF.hU.gT 116 c9.p8 (fJ jn.ya.eC)) (ix rE.Cv.bm (ff gG.ag.aC 11 cT.fK 73 cT.fN 52 cT.ex)))) (nm aN.A7 (nd (xB g3.aX.dB.aj 76 an aY.bz.gP aQ.bz.gP 116 hQ.b0 112 g7.b0) (aZ (wH jp.S.b2 11 cV.hH 224 un aE 59 ct.p2) (co ul.aF.ec)) (J lM.bl.eC.db 87 c7.fE (ms hQ))) (fR m9.bV 59 cq.fx 308 ct.fi 202 cP.p7 (J b4.pU.aI.hV 79 dP.p7 (bC qa.cf 116 bv mY.aO iQ.aO 89 ch dk.aC 85 e6.aC)) (bT nH.AW.kv.hM.bu.bu 61 iz rN.fr.iH (n4 j.G7.aS))))) (bc cC (aJ m2.dv 98 z4.p9 103 z5.fE 99 z5.fD (cu l9.ag 109 c4 j5 ah.aO aU.aO 1 z9.eH (lj nh.cR.aD 127 cB.p5 e_ 197 r7 gx 252 sb dV 121 cy.p0 j (kf i4.b6.aj.cQ.S.a0 e_ 134 c7.fu bt 106 zF aE 14 dr.f9 e_) (dd d5.b6 aA 9 cO.eW)) (J X.ia.hM.gT 82 cA.p0 (ac rK.bu.cw 178 dM.gL))) (nd (AB sI r1 24 65) (aZ (eX hY.bH.bg 48 cV.fo e_ 241 cV.fP H 50 dj.p7 e_ 64 yU e_) (aK L.A3.vC.cJ.fr)) (fO kV.a0.aj.cR.bV.S 70 c8.e7 155 cI.p2 H 373 cN.f5 (bk qR.gY)))) (k2 eT.bl.aX 48 rY af 41 z7.fD 38 z7.f4 (bS b1.cY (aZ (jB pX.bV.aC 11 dy.fq 58 cq.eS aH 100 mf H 41 dy.gb) (bZ qQ.aj 66 pz H ah aU 179 b7 bt.aC.ae)) (fV uY.aC.bQ 61 cS.eY 17 cS.eS 350 cI.ev (e8 gU.dB 93 rX nk g2 kg 60 cL.p3))) (N iS.k7.fy 72 cy.fE (eG ra.bw.bP.bw 82 mG au X ad 19 da.e7 (lf (oT k4.bQ.ag.b6.bw 129 dL.gl dL.e1 17 dL.gk 195 ap aH.bu.d6))) (fh oV.bQ e_ 102 bv L.aO 17 cN.gl e_ 79 ch h9.nj (ji e4))))))) +def DV : ab dp:=(c3 iD (az nx.aj 16 HX 143 Ig 140 HN (pL qg.aj 23 z1.eH 81 z1.f8 z1.fz 55 z1.gl (aR gS (lE m2.jq 11 z7.gO 137 z7.ev 86 z6.p0 aw (hi ri.ag.ag 73 rO cy.ev 1 cy.eZ (i7 Cm.cJ.ag.bw 110 ca aY.cR.bI aQ.cR.bI 17 dI.fi 101 bN lT.bl.fF) (aT kb.ec.aX 44 d9.gO 29 d9.ev 64 d9.eZ)) (kh oQ.nS.a0 57 da.fE da.fD 138 da.fu (aG rS.aC.S.gB))) (az rg.ec.aX 49 AA 29 c5.eW 69 c5.eH (J aQ.iG.hU.gT 190 dy.fM (ff g9.cx.aF 136 w1 471 dl.eW 1 ds.fq)) (ir s0.eP.aD 167 cI.eZ 265 cI.fo 63 cS.fm 38 cS.gH (e8 n6.dB 90 mH H.bm jy ru 64 cL.p0)))) (bc d0.eV (k2 g3.bV.bV.a0 158 an bq.iV 94 z9.gl 14 z9.e1 (fS eI.bu.gR.aS 4 cB.p4 77 r7 dZ 73 eM (e8 rf.it 113 yQ au X ad 79 c0.p0)) (aW q7.hM (co jk))) (dQ v7.aF.bw 281 cP.fD 117 cM.gH 17 cM.gm 65 cM.fC (aW H.nT.nT (ac b3.i0.gE.cw 92 c6.gO)) (de cg.gY.gD (aG ak.pU.vS))))) (nd (rP sI iC Bw 24 (aM cD nQ e_) 65 (aM cF nQ e_) b1) (ku aV (aJ l9 97 c4 1 u7 2 z8.fA (lQ j0.cK.S 52 cy.gK 92 cy.e7 H 261 c9.fD (em tu.bg.aj 70 dI.ft dI.f4 183 dI.fE 179 dI.fD) (dc cC)) (kh oQ.cx.bg 53 di.gK dj.eW 135 dj.fi (lf (sN pI.dm.bg 36 cO.gK 231 ap H.cH.ce.bi 38 cO.fp 193 mq.mu.av)))) (nd (rP sI iC tA 24 (aM cD nQ e_) 65 (aM cF nQ e_) bd) (bT bt.rG.aI.hV 199 et vb (ff jg.aS.fH 142 dT.e1 477 dl.p9 1 dT.gk)) (en np.bV.hK (ac iY.mu.eV.dK.fy 120 cT.eY)))) (lC cD hI e_ (dQ cZ.jq.cQ 101 dn.fp 102 dn.ft 29 dn.fP 26 dn.gK (hX n8.aS 11 cV.gL 108 wJ 64 ct.p0 aw (al bj.iH.bQ)) (aZ (ww zq.bl.ec) (cp ko.fH 55 cL.p6 cL.p5 1 cL.p4))) (nd (rP j2 wU Bs 24 (aM cD f7 e_) 65 (aM cF f7 e_) b1) (aZ (jo oe.jr.cz.S 159 da.p4 79 dP.p5 155 y6 151 xo j) (lf (lB k4.bQ.dv 175 ap sW 103 y0 99 dl.e1))) (bD oG.b6.cd.bi.cd.bg.aj 109 cI.ez ak af 138 iz m4.fr.iH 134 rD.fr.iH (aK o4.bp)))))) (nd (yN g3.ia 11 G5 262 iJ au He 48 GU) (e2 q5.bu.bu.dh 151 iJ iN (bS qJ.bm (bc jk (N my.eC.db 63 cy.gn (ac dz.aI.bV.fd 159 c0.gb) (lf (yC lH.S 138 d9.fm d9.gH d9.gm 47 rQ))) (J jn.bm.bV.fd 159 da.eY (lf (l5 ot.nS.bQ 19 dL.f9 17 dL.ga 191 ap aH.mu.av)))) (gp dF.ec.cz.ae 54 wu K L 186 c5.eB 182 c5.fT (dG dN.hL.cH (i7 uA.dJ.g0 179 b7 aY.cK aQ.cK 17 ds.hH 78 pu aH)) (hX os.bm.aS 11 cI.fD 80 c8.e7 147 cS.ex aw (hZ d5.cx.aD 74 cU.hH e_ 74 cU.gL e_ 191 cT.er aE 58 cU.eS j)))) (c3 bE.aF (nd (ow nF.b6.aj 23 z9.fM 141 c4 gf.aO 115 bq.bu) (J b1.bi.bV.fd 159 ct.fm (aG mY.fQ)) (ng m9.jq.aC 11 c0.eY 144 c0.p9 46 c0.eS (eo rt.a0 59 cL.fD 107 mH q5 14 cL.fu))) (N hO.aF.vG.bi.aO 59 cq.eZ (md oL.aj 23 dP.fA 143 fe gf 109 dP.eu (iL o3.b6.a0.aj 230 ap aY.qW aQ.qW 82 c6.gb 78 c6.gd)) (hX uh.ag.aj 23 cN.fE 95 cN.eA 69 c8.ex aw (lf (rP eE sd BN 24 (aM cD dE e_) 65 (aM cF dE e_) aP)))))) (cb rv.S 98 z2.eY z2.eS z2.fm 43 z2.gH (qS bK (bc gu (N cj.i0.bo 75 cy.fo (g1 qf.aj 23 c0.gj 164 mK 138 lA aw) (dd cZ.a0 aA 21 cO.f4)) (bD qo.aX 71 ca aE.rG.bH uS.bH 82 bN bF.jd 78 bE.jd (h6 gG.gC 100 mH bt 56 cO.fL H 52 dM.e7))) (lE gG.aX.aj 47 cG.p2 55 cG.p1 56 pp hO (ek qo.eK 82 bN e_.dK.bI 1 dj.fL 2 dj.gg (ij Cw.cx.ae 100 bv qM 81 ch bj.n2 77 br.n2)) (j4 tT.bu (g4 il.eK.bH.ae 40 cT.p0 131 dq.fL 128 dq.gg)))) (gI kb.eb.b2 4 z6.fC 96 nX X 92 ad (eJ oJ.gY (fV sY.S 82 hD 106 dy.fo 94 dy.fU (mb uA.dJ.bH.ae 66 dT.fp 187 b7 ar.ym.ae 183 ao.ym.ae)) (aZ (oC rm.bV.aF.aD 59 ds.fT ds.fA 125 lJ cg 121 b3) (bk kp))) (hi uw.aF 48 mL mf 1 cP.gv (jW qo.ia 11 di.fq 103 ca H.cY 86 bN aw.dK.bI (ij na.fg 119 bv iX.aO 88 ch tk.ni 84 uq.ni)) (jz hj.cQ.mv (aT i3 11 dY.eY 1 dY.eS 2 dY.fm))))))) +def DB : ab dp:=(cb eT.bl 36 GN Gw Gz 1 GJ (cb m8.cQ.ae 225 Ht Hn Hq 213 G3 (aJ uE.dm 11 z1.fN 1 z1.ex 2 z1.fL (lQ s5.b2.a0 130 z3.gk 75 dX iN 14 z3.er (qS b1.bu (fR uV.ag 71 xr 146 cy.fU 1 cy.eY (em u6.bP.cs 186 dI.gk dI.er 121 dI.eB 117 dI.fT) (ji cg)) (bA i5.cR.b8 131 da.eB 1 da.fT 2 da.fA (e5 n5.aj.ia.dv 142 dL.fo 90 xd ar 86 ao))) (bU aH.aO (bD pS.eV.b8.aD 65 sb aY aQ 174 wg ak 170 af (co j.A3.aF.ec)) (bD gr.eb.q6.bi.aD 150 cS.ez aY aQ 86 xz fX 82 d8 (ac px.fr.hK.dh 154 cT.f4)))) (eL o5 (gA qK.cz.S 90 an e_.ae.ce lM.ce ui.ce 114 c4 bt.aO (aW lT.nT (aK ao.cJ.kY.ib.fr)) (bT dk.kv.pU.hK.dh 305 ky dk (aT iP.ik 11 dM.eS 1 dM.fm 2 dM.gH))) (az jp.dJ.bQ 19 cM.p8 17 cM.p7 37 cM.p6 (fO ou.bQ.aF.a0 67 c9.fz 166 pA au 14 dP.fu (iR rr.g6 84 ch iE.aC 1 c6.gL 2 c6.p9)) (ix ar.Cv.bm (lc k8.aS.cs 115 dq.gd 116 dq.fM 70 dq.fx 66 dq.gn))))) (az fk.ec.aX 40 z2.gl 29 z2.e1 60 z2.gk (ku jl (lj j3.aD 60 an ob.aC 60 an oo.aC 110 c4 cg 106 z8.eW j (cu ti 122 et ah bK ea 1 cB.fp (g1 uQ.bQ.aC 11 dI.p3 78 dr.f8 144 c0.fi aw) (lf (q1 dz.bI))) (bT ah.AW.kv.hM.bu.bu 61 iz H.kv.iH (aK kn))) (qe ko.bl.iF 11 cG.fm 159 xA 91 cG.fi aw (fh wr.bQ e_ 58 wO bd 17 dj.eH e_ 93 zX j (lf (rM kK.S.q6.aX 91 iK ie.wq 29 dT.fA 111 gx.cJ))) (ng rt.aF.iF 11 c8.gO 186 c8.p6 103 c8.ev (al iX)))) (d3 gN (N k9.iH.ib.bz 57 dn.eY (bT qn.aI.hV 193 et gx (cp oW.dK.cR.aD 63 ds.p1 ds.p0 113 dT.e7)) (fS qQ.S 66 pu 179 b7 H.cK 175 j.bg.ae (fW jT))) (N dz.bH.hU.bo 161 cy.eu (bD uL.aD 86 zX bj br 67 wO K 63 L (al ak.pU.bH.bH)) (J bq.r5.iv.bm.dx 164 c7.fL (bC tv.dm.cs 144 hB jl.aI ju.aI 89 jc ke 85 iX)))))) (aR br.eK (aR jV (pL kZ.aj 23 z3.hH 74 z3.gL z3.p9 48 z3.p8 (hi nM.gR.bw 92 z8.fu z8.gO 19 z8.ev (nd (rP j2 wU zG 24 (aM cD f7 e_) 65 (aM cF f7 e_) aP) (h6 jg.cd.gR.a0 89 iK bt.pl 178 et jv.bP 14 dT.eW) (al fI)) (eG uV.a0.ag 83 rO X hW ld 1 da.ga (iL rL.eK.aD 184 ap aY.mu.av aQ.mu.av 63 dL.p9 26 dL.p8))) (hi uu.ae 62 Ay c5.p3 46 w4 (fS kL.S 60 ey 162 ap ed 158 d0 (lf (qb eE vF 24 65))) (aZ (eX d5.cz.cf 74 cI.fL e_ 74 vo H 74 cI.fL aP 122 cI.gg e_) (aK aV.bp)))) (bS oo.bu (nd (pO iT.cx.cJ.S 81 an e3.i2 uU.gP d0.i2 99 b4.ia.aS) (J lP.i0.bo 68 ct.p8 (fJ aB.ib.iG.eC)) (du qi.it 129 lo nk g2 kg 88 rO b4 (ac j5.bu.cw 186 cL.ga))) (N jv.o6.eD.aI 50 cq.fK (bD ko.eb.fj.S 81 rO ak af 126 lo X 122 ad (bZ sY.g6.bg 106 hD H.kY.cJ mT.cJ rC.cJ 269 bv bt.jQ)) (en op.ae.eh (e8 jA.ec.cf 65 zp au X ad 167 dq.f9))))) (aJ h3.a0 133 z2.hH 81 z2.gj 14 z2.f5 (nd (kH gf) (nd (nJ nF.aD 59 z9.fE 158 z9.fD 65 an eQ.aC 61 dz.aC) (ei uJ.ae 51 w2 u2 177 vt 173 lm (bZ q8.aD 173 b7 iZ.nj.ae iY.nj.ae mW.nj.ae 76 vd hO) (dd uA aA 9 cO.ev)) (aZ (nJ li.eb.aX.aj 59 cA.gL 60 cA.p9 73 yU K 69 L) (iM kn))) (nd (lz L.xY) (kh hY.aS.aj 60 dj.fM dj.fx 112 dj.gn (bM qf.b6.bw 190 jK e4 fI iD 19 c6.gk)) (aZ (jo tz.cJ.b8.aD 47 c8.gm 281 cN.fU 245 cN.fi 76 cI.f5 j) (aG K.bu.iG)))) (mi tC.jq 11 z6.p4 e_ 142 z4.gb e_ 11 z6.p4 aP 87 z6.eA bd (dQ uQ.iF 11 dn.p0 52 c5.e7 790 c5.fC 17 c5.f6 (ek uL.b6 90 bv pr 1 dy.eu 2 dy.ez (hT gr.ec.aX.S.ae 90 ds.e1 L 74 wn k0 70 jZ)) (gz l3.gC 93 ca fY.cY 94 bN X.fj.bI 90 ad.fj.bI (pa K.fr))) (N aN.dt 334 ct.fA (aZ (lL Al.cz.S.ae.gR.bg 36 di.hH 107 dj.eA H 38 di.gL 69 vm qc) (lb ah.bg.pG.bg)) (aZ (lZ rm.bV.aF.aD 59 dI.f9 dI.ga 125 lJ lS) (co gx))))))) +def DO : ab dp:=(nd (rP j2 iC x6 24 (aM cD f7 e_) 65 (aM cF f7 e_) fY) (nd (kH e_) (aR lG.bP (cu mj.S 80 dX dO cj dS 54 z3.fi (bc bd.bu (nd (pJ nh.cx.bg 58 cy.fA aE K L 125 cB.fu) (ac e_.eV.aI.eC.bu.bz 393 dT.ft) (la jm.fy.S 138 d9.fo d9.fU d9.fi 47 d9.eW)) (md ou.bQ.aF.ag 67 da.eH 373 ky nE 1 da.f8 (ac oN.pE.eP.aI.db 103 dL.gg))) (gI i3.S.S 134 c5.e1 79 fG ah.aD 75 aU.aD (ir mZ.aC 11 dy.p8 135 dy.p7 64 dy.p6 60 dy.p5 (lf (xe ph.dK.ag.bw 86 c6.fp 363 ap q5.hL.bI 19 c6.ft))) (ng li.dK.b8.bw 75 cS.hH 199 cI.gg 19 cS.gL (iM gu)))) (nd (kH tq) (nd (tI sL 90 an b4.aS 58 ed.gP 54 d0.gP) (aZ (uZ pS.aj.ae.b2 4 cP.p7 174 ct.fD H 170 ct.eW) (d2 j.wi.pm.bm)) (fV rf.ec 59 cS.ev 1 cS.eZ 2 cS.fo (ac oc.bo 171 cL.eA))) (dR ok.S (aW my.nT (qm lK.bl.b6.aS 11 dl.fM 35 dl.fx 181 ap ub.hL.bI 177 e_.xE.hL.bI)) (gz jA.dK.e0.bg.ae 73 rZ ao 185 w3 K 181 L (hT tv.dm.S 73 jc aw 136 hB ed 132 d0))))) (dR uq (bU dO.eN (bc jX (az n8.b6 60 ct.p0 1 cB.e7 2 cB.f6 (fJ j.sy.aI) (lf (m0 h3.a0.aj 89 d1.gO 98 d1.ev 94 d1.eZ))) (fS kZ.eb.ja.ae 224 cA.gk 64 yH K 60 L (aT tv.dm 11 cO.fK 1 cO.fN 2 cO.ex))) (fR oy.dm 88 w7 216 cG.eA 1 cG.eu (ck e_.bi.ce (qm qY.jq 11 dT.fN 23 dT.ex 108 bv e_.eK.aO 104 e_.mu.aO)) (de L.gY.gD (em wM.aI.eN 53 cT.fT cT.fA 17 cT.eu 25 cT.ez)))) (N aw.bu.dh 45 z6.gO (ei j0.cz.ae 44 dn.gk dn.er 201 dn.ga 89 dn.eB (bT ah.iG.dt 237 iB X.bH.kB (ac kJ.vS.hK.bm.dx 164 dr.gm)) (aZ (qL k8.jq.cQ.S 146 c0.er 70 c0.eB 66 dr.ft) (cp rt.ag 59 cL.p0 cU.e7 1 cU.f6))) (N L.aO.hU.bo 308 cy.f4 (J oD.mX.aF.sl.aI 115 cA.fD (al rD.bH.bH)) (fO sU.iI.a0 74 cN.ev 130 yQ aE 14 c7.p5 (g4 lH.cz.cd.aX 115 yB 67 zP 252 dY.fL)))))) (d3 ki.cH (aR jX (bU K.mu (nd (lL kj.eV.S 92 z7.eu 193 z5.eu H 94 z7.p3 95 kw l6.bI) (dQ sY.eN 91 cy.hH 92 cy.gL 17 cy.p9 25 cy.p8 (lc tV.S.aC 11 dr.fD 199 dr.fm 236 dr.gH 67 dr.fu) (g4 d5.a0 46 d9.fx 195 d9.gn 14 d9.eA)) (dG bt.e0.cH (aG cX.aC.S.gB))) (eJ L.GK.cJ.fr (gV h7.iI.fH 80 c9.fK 755 dT.gd 1 c9.fN (lf (pe lU.bH.bg 48 ds.fP 138 ds.gm H 50 dT.ez 141 w1))) (hX u3.cx.aS 11 cI.gl 81 c8.fi 201 cS.fC aw (al d8)))) (bS oZ.bu (ef qK.gZ 114 c4 ke iX 72 an aV.i9 68 cC.i9 (bD n8.jr.aj 111 As bj br 112 hJ eQ 108 dz (bC oK.fg 89 bN ar.vS.cH ao.vS.cH 74 ca jl.bI 70 ju.bI)) (iw n8.fg 123 fe dz 72 da.fC K 68 L (nA jA.gZ 57 cL.fi cL.eW 130 sa X 126 ad))) (az oy.iI.ae 73 cq.fz 505 cB.eZ 502 cB.fo (ck kP.aF.aC (e5 u6.bP.dm.aX 204 c6.eS 103 c8.p3 ar 99 ao)) (de tN.gY.gD (bk qc.hK))))) (c3 cg (qS bq (om nG.ia 11 z8.p2 95 an ci.i9 105 c4 gS (im kO.nT (ml eQ.aI.cH) (dd tM aA 21 cO.fu)) (ek oK.cd.ag 89 bN jH.fj.bI 1 cA.ga 2 cA.gj (hT eT.gC 100 dX k9 56 mF sP 52 jk))) (N bj.ib.hU.bo 60 cM.f8 (k3 oe.jr.cx.aD 53 cq.eS aY 53 cq.eS aQ 115 mL e_.kB 50 dj.gH e_ (qm qf.aX.aj 59 dT.gj 60 dT.f5 150 w1 ak 146 af)) (j4 bE.bi.bu (bk kW.gY)))) (hi m2.ec 82 z6.eA z6.f9 1 z6.ga (eJ pT.gY (J aQ.gP.cJ.aO.aO 222 dj.gk (ac nk.vC.Eg.fy.bz 172 ds.ga)) (fS ud.b2 4 cN.p0 85 bN nK.bI 81 qJ.bI (e5 ua.ag.fg 61 cL.eW 134 sa bF 130 bE))) (nd (rP j2 wU rU 24 (aM cD f7 e_) 65 (aM cF f7 e_) e_) (aW aH.bm.bw (al ke.kv.aX)) (de gq.kY.ib.fr (cp tx 38 ep dX 1 dY.eA))))))) +def DU : ab dp:=(nd (rP yM.it wU x6 28 (t9 cD DI bq) 105 (aM cF f7 bt) b1) (az g3.eK.ae 52 Gl 37 Hr 34 GV (aR dz.bP (bS iY.bm (ei kj.cd.ae 68 z7.fC pw 99 z5.eu 95 nY (lj pX.eP.aX 35 cy.gv e_ 128 mf hj 41 cq.fm e_ 86 mf j (aK oz.io) (fb cD fB e_)) (dG ak.fj.cH (iL ot.nS.aD 183 ap cX.eC.av cl.eC.av 63 dL.fK 26 dL.fN))) (e2 L.A7.bi.cJ.aO.aO 330 iz af.kY.sy (e9 rn.aI.ae 58 c9.ev c9.eZ 41 c9.fo 94 c9.fU (fJ bj.ib.iG.eC)) (de rS.o6.bp (kf o9.S e_ 53 cU.fN e_ 56 cU.ez H 52 cU.ex e_)))) (ei gU.dv 93 z5.eu nY 149 z5.fL 145 z5.gg (nd (rP eE iC yg 24 (aM cD dE e_) 65 (aM cF dE e_) aP) (aW b3.nT (bk d8.ae.eh)) (fO g9.bp 73 da.eu 136 da.eB H 433 dr.ga (cp cZ.g0 46 cL.er cL.eB 19 cL.fT))) (ef s8.aj 61 lF bj br 107 nW K 103 L (dG bK.bm.cH (bM uD.ag.cd.aF 264 bv tS.aO ah.jQ aU.jQ 1 c6.ga)) (en au.cv.bH (aT tb.bP 59 dq.gm 1 dq.fC 2 dq.gv))))) (cb h7.ag 38 z2.fN z2.ex z2.fL 1 z2.gg (aJ gU.dJ.ag 88 sf 1 z4.fN 2 z4.ex (m6 jH.S (e2 eM.iG.dt 237 iB gN.bH.kB (co ki.aF.ec) (ac rs.kk 84 d1.fA)) (bD qa.aD 96 bv bj.ib qM 77 ch ug 73 aP.n2 (g1 fa.eb.aj 23 dM.ev 77 cL.e7 51 cO.er aw))) (N j.ib.hU.bo 55 cG.fx (bD oY.aj 67 ch bF bE 102 bv jt 98 gX (bZ wZ.ag.wq.S 161 et aE.aF.bP K.aF.bP L.aF.bP 94 iK l6.wq)) (ej oG.b6.cd.bi.cd.bu.aD 64 vj jU ka 63 c8.gl 26 c8.e1 (bk jw.gY)))) (eR fc.gC e_ 97 nX k9 53 z4.er b1 49 z6.eS e_ (eJ vb.gY (bD ko.it.aj 104 lo cX cl 85 xr ak 81 af (e8 sU.cf 98 AP au X ad 78 dr.er)) (gW u0.jr.aj 172 b7 qI.cQ oH.cQ 107 c0.gm 103 pz j (e5 nB.fg 53 dM.p4 54 rR bF 50 bE))) (oU nB.bP.S.S 62 cM.fm 105 uG ah 101 aU (ek ov.b8 97 bv iE 1 di.ez 2 di.fK (ac d4.pE.eP.aI.db 97 dL.gK)) (du qY.aj 77 ch e4.aC fI.aC iD.aC 112 bv lP.aO (lb k9.pG.bg)))))) (eL iY.aF (az kb.jq.S 44 FU 85 Fz 29 F3 (az gG.kl 52 z4.gK 165 z3.p4 14 z4.fp (oU nG.S 105 wN 67 an dk.aC 63 e6.aC (nd (oC kt.ec.fj.bg.aj 247 cV.fi cV.eW 203 je nr.cH 199 mh.cH) (ac lM.pG.kY.eF 85 c0.p1) (al ox)) (ek tG.aF.b8 97 fe e_.bV 1 da.p6 2 da.p5 (bM pI.dm.bw 189 ap q4.bP.av ur.bP.av j.hK.bP.av 19 cO.fP))) (nd (AB sI Dp 24 65) (aW aE.eC.bH (dc aQ.bm.fr.vz)) (ng sU.jr 11 cI.gb 118 wl 62 cI.gd (lf (rp jD))))) (nm ea.A7 (nd (Aa iT.cx.bg.ag.bw 107 an s6.b0 tU.b0 17 z9.p1 83 aH.bz.gP) (hX qd.iF 11 cV.f9 121 c9.gm 104 hJ bq (co ka.aF.ec)) (aZ (oE oj.ag.bg.S 73 c9.p5 102 fe H.bV 98 j.bg) (lf (rP fk iC r1 20 (aM cD kD e_) 25 (aM cF kD e_) e_)))) (qw jx.aj.ia 4 cq.gm 56 cq.fC 52 sk (J iZ.Eg.aI.hV 77 dP.hH (g1 qh.eP.cR.aD 67 dl.ex 206 dL.fu 130 c6.p8 aw)) (ix i6.pm.bm (bC gG.b6.cd.bi.aD 145 hB cX.gP.wi cl.gP.wi 76 mH dN.fr.hM 72 ie.fr.hM))))) (nd (qb eE Bw 24 65) (bc oN (nw qV.S 70 an pd.aC 112 wN X 108 ad (lE pX.aX.aj 47 cB.hH 55 cB.gL 62 mL hO (bZ g9.cf 140 et e3.aO va d0.aO 77 hC qq) (dd gr.b6 aA 9 cO.fU)) (fS l3.dJ.aS 4 c7.fP 111 ca K.cR.bI 107 L.cR.bI (ms jk))) (az cZ.aj.cs 96 cM.eu 62 cM.ez 607 ct.ez (ck b1.F8.h8 (lf (ow ov.cd.aj 23 c6.fz 139 bv au.eN.aO 113 kc.aO))) (jz ka.GF (ac cl.gP.eF 651 dY.fU)))) (N aA.ib.bP.dh 58 z7.fP (eJ ke.gY (gy mT.aI (dc aH.bm.fr.vz)) (aW e_.GK.bI.aD (ms gu))) (qe sQ.aD 56 cy.ft 279 c9.fz 106 wy hO (aW i6.aD (lf (pO iu.aS.eK.bi.bg 177 ap ci.fr.hM.fF aV.fr.hM.fF cC.fr.hM.fF 225 bq.vG.fj.bI))) (bD mQ.cx.ae 80 bN bj.xK.jd ut.jd 77 ca aE.rG.bH 73 uS.bH (fb cF hI b1))))))) +def DJ : ab dp:=(pj gU.cR.bg 112 cU 214 cT (qs h3.ag 218 Ib 267 HC 220 H6 1 HE (aR fX.bl (pL i3.aD 35 z3.ev 164 z3.eZ z3.fo 53 z3.fU (lE kj.q6.aj 23 z7.eW 120 z7.eH 94 z7.gK aw (lQ g9.a0 124 cP.fE 97 hC au 14 cy.f8 (bM xu.bu.aD 79 bN ue.fF X.jd.fF ad.jd.fF 65 dI.gd) (lf (rP qu wU By 28 (aM cD hI e_) 105 (aM cF hI e_) aP))) (aZ (nJ s0.aX.aj 59 da.fU 60 da.fi 72 zm K 68 L) (bZ na.cf 92 ch dO.ce gu.aC uf.aC 123 bv tT.aO))) (gp gs.iI.nS.aD 76 fG rB.bw qn.bw 63 c5.f8 26 c5.fz (ej nD.ag.ag.bi.bu.aD 60 vm jU ka 63 dy.f5 26 dy.hH (lf (l5 kK.gR.aI.ae 136 dr.p0 41 ds.gb 172 w1 j))) (fV rn.aD.S 66 zm 200 cS.fz 53 cS.gl (bZ g3.dB 90 dX au.bQ o4 ad.bQ 64 mF kr.bl)))) (bc qJ.aI (nd (tI sL.S 66 an b4.bi.gP 106 ed.b0 102 d0.b0) (gW jp.g6.bw 67 pn jw jD 17 cB.p0 226 un bO (bk lk.eh)) (aW fY.bm.xM (dc j))) (N ok.aF.vG.bi.aO 62 cM.fM (aZ (pk B1.b6.cd.bi.aD 183 di.p3 317 iq tP.bI 491 cS.fN 58 c9.f4 j) (e5 uJ.iF.dv 93 c6.f6 266 c7.eA ar 262 ao)) (nt tn.dJ.aS 4 c8.hH 113 c8.gL 109 c7.e1 (lf (l5 sK.bP.aX 57 cT.gj 29 dq.fD 77 vk gx)))))) (N jZ.eF 138 z2.fE (bU aA.bQ (bc g7 (N ty.cJ.hU.bo 156 cV.fA (d2 ue.pm.bm) (ac gf.bH.bz 199 d1.f4)) (gy kP.GE.eC (aT i4.cd.ag 43 cO.eH 1 cO.f8 2 cO.fz))) (nd (qL v7.bP.S 93 wh 70 cG.fz 58 cG.gv) (bA ii.eP.b8 57 c9.p4 1 c9.p3 2 c9.p2 (n4 xP.ae.bV.aS)) (J ka.Gp.eD.kk 221 cI.p6 (ij ol.S.ae 53 kA jZ 108 yw cX 104 cl)))) (lC cF hI b1 (hi nB.aI.a0 49 dn.fi dn.eW 94 dn.eH (J u1.dt 334 c9.hH (fJ ci.mX.eC)) (bA dF.jq.b2.ae 164 vc 58 cN.eu 54 wS (cp m8.fH 55 cL.p3 cL.p2 1 cL.p1))) (nd (pP il.eN.cR.ja 4 cq.f5 85 cq.fp H 81 cq.fE) (J lP.r5.eF 166 cA.fp (al qn.bH.bH)) (en aQ.wk.bl.bH (h6 rt.bp 172 hB b4.ya 71 dY.fp H 67 dY.f8)))))) (d3 e_.A3.cH (aR o5.bl (ei BV 45 ap ca 171 z3.fC 60 bN (az pg.b8.jr 4 z7.hH 70 z7.gL 61 z7.p9 (e2 dS.xY.bu.dK.fy 131 je ad.cH (e5 oj.ag.dm.aX 116 c7.gg 77 wJ ar 73 ao) (fb cF mD aV)) (dG oz.e0.cH (aG j.o6.aC.S.gB))) (ef i3.S.cz.ae 83 fG ar.Do.aD ao.Do.aD 154 pB b1.mX 150 uB (dG L.cR.cH (ac ao.aF.bl.dt 342 dl.fi)) (eG s0.aX.bl 64 rZ ah bK ea 1 cI.eW (ff jA.dK.aF 49 cT.f6 170 cT.fC 1 cU.e1)))) (nm uq (gp hR.bl.bi.cd.eN 99 an K.mu.b0 L.mu.b0 17 z9.eA 25 z9.f9 (dG H.cR.cH (aG oc.fQ)) (dG d8.e0.cH (cp iP.g0 50 cL.eS cL.fm 19 cL.gH))) (N aQ.bH.hU.bo 164 cP.fu (gV nb.eK.aD 106 dP.gg 266 da.eS 65 dP.eY (d2 aN.aI.pm.bm)) (fV uk.dK.aC.aF.b6 126 c7.fu 1 c7.gO 2 c7.ev (bM dF.ag.eP.eN 72 jc q4 ur j.hK 19 dq.p5))))) (c3 kr (qS aU (eR s7.cf bd 90 an kr.mv 82 z8.p6 e_ 70 z7.gL aP (mV h7.iI.ag.bw 76 xr bj br 17 cB.fT 111 lo hj (ij tB.dv 74 hC mh 141 et ar.cJ 137 ao.cJ) (dd rF.S aA 115 dY.gL)) (eG o3.bH.ag 224 ca e_.e0.bH aE.eb.bH aP.e0.bH 1 cA.gd (g1 y2.aj 23 dM.eH 77 cL.eZ 51 cO.eS aw))) (az zc.dJ.b6 93 sM 1 cM.f4 2 cM.fE (gy bt.kY.aI (bZ lW.aj 101 bv iZ.cJ iY.cJ mW.cJ 78 ch bt.aC)) (J px.jQ.bP.eV.dK.fy 134 c8.eu (aK b1.mX.bp)))) (ef tp 102 yw cX cl 55 kA k0 51 jZ (eJ aY.gY (J bd.pU.Gd.eF 161 dj.gl (aK e_.FX.eC.gD)) (aZ (lL qo.bV 24 cN.p6 108 bN ak.ni.jd 26 cA.gn 71 ca mq.bH) (e5 BM.fg 57 cL.ev 94 b7 bF 90 bE))) (cu jx.eV.aF 94 mf aE K L 1 cP.fM (eG oe.dm.cJ.aF 233 vt aB b1.EZ bd.pE 1 di.fM (d2 nl.aI.pm.bm)) (jz cX.cQ.mv (fb cF dE b1))))))) +def DA : ab dp:=(d3 hW (N nC.eV.bz 141 Hp (aR g5.bP (bS ie.bm (bc kn (eg s8.ag 103 nW jN 1 cP.gk 2 cP.er (bk bt.ae.eh) (g4 gr.a0 42 d9.fT 155 d9.fA 14 d9.eu)) (bA m9.jq.bP 40 da.ex 1 da.fL 2 da.gg (aG L.o6.aC.S.gB))) (bS ki.aF (J ty.o6.eD.aI 58 c9.fE (al af.iH.bQ)) (ix K.hU.pm.bm (lf (pe rn.bg 36 cU.fx 92 cU.p7 H 38 cU.gn 54 cT.f6))))) (c3 dz.bI (cu g3.bV.fH 158 an cj.iV ox.iV m3.iV 1 z9.fm (aZ (wR kV.ec.b2.aF.aS 11 cV.eH 70 sb aH 167 cP.fA 163 wg) (aT uJ.iF.cQ.S 117 c6.eA 151 c6.fx 61 c6.gn)) (iw ma.dv 118 yo af 97 hJ jl 93 ju (ij gr.dv 54 rQ af 149 dM.ft K 145 L))) (N ar.bg.fd 75 cq.f6 (dG ci.hL.cH (bM i5.aj.b2.ag 195 jK cj ox m3 1 c6.gj)) (eG oG.b6.cd.bi.cd.bm.aF 68 vj aE.kv K.kv L.kv 1 c8.p0 (bZ ns.S 78 sc au X ad 58 vk aN))))) (nd (yE j2 24 65) (ku ru (gI iT.cx.bg.b2 4 z8.gn 99 an dZ.b0 95 eM.b0 (hi nb.S 102 ct.gg sh 63 hJ (al bt.eK.bH) (ac gq.bz 76 d1.gk)) (bT bq.AW.kv.hM.bu.bu 61 iz qc.iH (eo y1.a0 44 vq 85 zE aE 14 cO.p7))) (dQ ro.aj 201 cM.fU 202 cM.fi 97 wy 93 cG.f5 (gy K.kY.aI (ac iS.bP.dt 334 dl.fz)) (fV tK.cQ 74 c8.eW 171 c8.eH 167 c8.f8 (cp uh.bl 49 dq.f4 dq.fE 1 dq.e7)))) (nd (l5 gF.aX 41 mc 29 z6.fL 61 kA j) (az nB.aI.cQ 91 dn.fm 49 dn.gH 45 dn.gm (fh yZ.cd.b8 e_ 88 fe jH 1 vp bd 2 dy.fp e_ (eo jg.aS.bV.a0 142 mK 190 jK aE 14 dT.f6)) (J cX.xY.bi.cJ.aO.aO 585 dT.fx (iM jT))) (nd (wE u8.aF.jr.a0 98 rc 122 Am aE 14 cP.fo) (ir yr.cz.S.bp.aC 11 di.eW 185 cA.fK 59 vj 55 di.f8 (aG bE.S.gB)) (bD l3.ho 86 bN cX.sl.bI cl.sl.bI 83 ca K.aD.bl 79 L.aD.bl (bM ua.b2.eP.cx.aF 117 yB ah bK ea 1 dY.ez)))))) (aJ qg.ag 51 z1.ev 1 z1.eZ 2 z1.f6 (aR kr.bl (bU au.eN (eg j3.b6 64 an b1.ce 1 z8.fU 2 z8.fi (aJ ra.cd.bi.b6 169 ct.fD 1 ct.fu 2 ct.gO (lf (tQ th.cs 74 rV bF bE 153 c0.p2 150 cN.fA)) (iM bK)) (gz tG.aF.ae 68 xn br 101 wB h5 97 d4 (i7 ot.ag.bw 187 ap s6.av tU.av 17 dL.p1 101 ey bO.cv))) (N aE.vG.bu.cw 53 cG.fp (bA ma.b8 67 c9.fx 1 c9.gn 2 c9.eA (hT kK.gR.iI.S 174 mK fY 148 lA cj 144 dS)) (aZ (qk hY.cQ.dv 80 cS.ga 72 da.ft ar 68 ao) (lf (rp aQ.yk))))) (qv ak (ef nG.fj.S 117 c4 eQ.aO dz.aO 97 an lM.ce 93 ui.ce (gV tt.g0 75 cV.gb 297 dP.gk 19 cV.gd (aK px.fr.hK.gD)) (bA tB.eP.dJ 11 c7.f9 1 c7.ga 2 c7.gj (pa bd.S))) (e2 X.cH.o6.eD.aI 126 sb rS (aW ah.aO.bH (hT qa.cf 116 bv lR.aO 89 ch dk.aC 85 e6.aC)) (en ah.ae.eh (aK aA.bQ.bp))))) (cb kj.S 64 z2.p3 z2.p2 z2.p1 225 z3.fP (bc mY (nd (pO rA.aj 56 an t0.gP rs.gP ad.bi.gP 96 bt.b0) (nd (pe wr.bV 24 cB.gd 84 dy.f8 H 26 cB.fM 89 dy.eB) (ff lU.eV.aD 129 ds.fp 464 dl.f5 73 ds.ft) (dd gs.b6 aA 9 cO.fo)) (aZ (qp pK.dm.dm.aX.ae.b2.ae 118 wC L 73 wV K 69) (ac iQ.bo 169 cL.gn))) (dR lq.bg (J b1.F8.sy.cJ.aO.aO 410 cA.p2 (lf (oT k4.cz.dJ.bw 73 c6.ex c6.fL 17 c6.gg 237 ap aH.qW))) (en uq.bV.hK (cp fa.aj.aF.ag 55 dq.gk dq.er 1 dq.eB)))) (aJ m2.ec 82 z6.p0 1 z7.e7 2 z7.f6 (gp pc.bQ.cz.ae 56 xa K L 77 dn.fC 73 dn.gv (iw uJ.bp 185 lm aN 67 w2 X 63 ad (ac oc.bP.dt 334 dl.fE)) (aZ (rP l4 iC yl 32 (aM cD fB e_) 145 (aM cF fB e_) b1) (g1 fc.aX.aC 11 cU.fi 96 cU.fL 49 cL.f5 aw))) (N dO.r5.ib.bo 518 dP.e7 (ck K.kY.h8 (n4 d0.ae.bV.aS)) (de ah.AY.hK.gD (aT gF.dJ 11 dY.p9 1 dY.p8 2 dY.p7))))))) +def DM : ab dp:=(d3 aB.cH (az gU.eb.cQ 78 G2 93 Hu 89 Ho (aR sP (cu eT.b6.dm 70 dX iN aE.iF aP.aC 1 z3.fz (k2 nx.bl.a0 92 kw aN.fF 129 z7.eu 14 z7.ez (cu u8.aF.jr.ag 98 lF X hW ld 1 cy.fN (ac t0.vG.bi.k7.fy 75 dI.gl) (lf (qG ci))) (eG n8.dm.bw 111 yo aA aB dD 19 da.e1 (ac iQ.pE.eP.aI.db 107 dL.ez))) (ei kZ.eb.cQ 180 c5.eB c5.fT 56 c5.fA 52 wu (aZ (rP l4 iC Cd 32 (aM cD fB e_) 145 (aM cF fB e_) b1) (g1 oO.dJ.bQ.aC 11 c6.eu 153 xd 115 ds.ev aw)) (hX rf.jq 11 cS.p5 133 v9 63 cS.ev aw (e8 kb.cx.bg 81 xi aE K L 48 tO)))) (N dS.iH.qW 116 z5.fU (eg j3.b8 106 c4 kW 1 z9.fK 2 z9.fN (aZ (jB pK.dm.dm.aX.aF.iF 11 cV.ft 65 vm kP 285 ep K.cJ.ja 17 cV.f4) (hT mQ.S.S 73 ca ki.aF 92 bN K.g8 88 L.g8)) (J aN.hU.bP.eV.dK.fy 259 cS.eW (ac aE.eC.bu.cw 139 dM.p7))) (fR sR.cz.bg 115 cM.ga 436 cP.fL 118 cq.fN (ej u3.cx.bw 63 zm ak af 17 dP.ft 137 dP.f4 (e8 n5.pl.cf 265 yS au X ad 96 c6.eZ)) (fO jS.bH.bg.S 71 c8.fi 209 c8.eZ H 362 cN.p9 (ac oN.bi.hL.dx 156 dq.gj))))) (d3 H.ja (bU o4 (nd (l5 nG.bQ 101 z8.eW 17 z8.eH 67 an oZ.aC) (nd (qL oL.S 66 hJ 109 sh 105 ct.gg) (co uf.ec) (kf gU.cR.bg aP 112 d1.fU e_ 214 d1.fz e_ 210 d1.gl e_)) (kh rm.bV.aF 51 cA.eB cA.eu 1 dj.fz (iR qg.ag 51 mF kn 1 cO.fq 2 cO.gb))) (dR dZ.iI (fh lW e_ 62 ch bd 93 bv ah 89 bv aU (hZ lW.ag 74 ch ah.aC 74 ch aU.aC 1 cN.ex bd 2 dT.gH e_)) (en oJ.eh (cp ns.eN 50 dq.gK dq.fp 19 dq.ft)))) (gA m8.cQ 43 iB aA aB dD 80 je aw (eJ h9.hK.gY (md pS.aj.bP.bg 57 cV.p0 180 iB dk.o6.kB 299 c9.p7 (cp cZ.jr.aO.bi.S 79 dr.fq zF 129 w9)) (J kW.xY.r5.eF 189 c0.eA (cp zJ.fH 55 cU.fP cU.gK 1 cU.fp))) (az kK.S 120 et 57 hC 53 iK (mR rv.aD.cR.ja 4 di.f6 137 dj.eZ H 133 dj.fi (dc lV.i2)) (nt uc.aD.aF.aS 4 c7.eu 249 dI.fL 80 dI.ex (n4 au.bV.aS)))))) (nd (qb eE BI 24 65) (aR jv.bl (nd (rP b1.jq.nS.S iC x6 32 (t9 cD Bf bq) 145 (aM cF vY bt) b1) (nw gU.dJ.dv 100 sf dz 123 z4.gb bj 119 br (aJ oM.cx.b8 57 mM 1 cy.p4 2 cy.p3 (g4 oW.a0.aC.S 63 dr.gO 113 dr.ev 29 dr.eZ) (al bq)) (ek pI 71 ey iE 1 da.gb 2 da.gd (aG gq.bm.fr.gB))) (nd (zo uu.aF 229 c5.p8 42 w4 1 c5.f9 2 c5.ga) (aZ (jo qd.aj 23 c9.fL 287 dP.eB 271 dP.fT 107 cV.fM j) (al oJ.kv.aX)) (fS uF.e0.aF.aS 4 cI.eB 69 ve dZ 65 eM (iL i1.cz.ae 52 yy K L 130 cU.p9 126 cU.p8)))) (bS dk.bu (eR rA.ag.b6 e_ 104 an b1.ce.aS 1 z9.p7 e_ 2 z9.f9 bd (J dN.hL.bV.fd 159 cV.gg (ff lU.g0 137 dr.gL 472 dl.hH 19 dr.p9)) (aZ (jo nn.cz.S 272 c0.fq 112 c7.gg 73 yW 69 wJ j) (eo mU.jr.bV.a0 63 cL.e1 111 sj uP 14 cL.gk))) (eg pc.aO.ag.b8 100 uG jN 1 cq.fT 2 cq.fA (J jH.cx.gE.bz 509 c0.fz (em qh.aX.cz.ae 76 dl.er dl.eB 205 dL.fP 104 dl.fT)) (jz jN.bg.vz (bk mY.gY))))) (oq bK (lC cD Bc e_ (eg l9.eN 105 c4 e_.mu 17 z9.gK 25 z9.fp (im ao.mX (ml g5.aI.cH) (dd k8.b6 aB 287 d1.gn)) (aW aY.bm.bw (g1 mU.cd.aj 23 dM.gl 81 cL.eH 55 cO.gd aw))) (nd (pP t8.fj.iF 4 cM.fz 493 je cg.cH 17 cM.p3) (J e_.bV.cH.hU.gT 140 dj.gb (aK K.A3.vC.cJ.fr)) (fO fa.aj.aF.b6.S 123 v9 71 cI.fM H 67 c8.eS (bZ rk.iF.aj 134 hB t0 rs ad.bi 79 jc lS)))) (eR hR.aS.S bd 51 z5.gk bd 97 z6.p8 e_ 29 z6.p7 e_ (bS kP.aF (aZ (pk tR.bw 113 dy.fT 174 ch bO 17 dy.fA 94 hD aH) (eo i4.b6.aj.cQ.S.S 84 dr.eA 138 dr.fM H 528 dl.gL)) (jW m1.aC 11 c7.f5 105 bN dV.vG.jd 72 ca fY.F8.bH (ac aE.cH.eD.aI 226 cU.eW))) (N aE.e0.aI.k7.fy 68 cP.p8 (aW tF.bw (lf (oP j8.cz.b8.cd.iF 4 dL.e7 130 dL.f6 17 dL.er))) (fO sK.dB.a0 73 cN.eA 115 AP aE 14 dI.fm (fb cD vr bd))))))) +def DQ : ab dp:=(az fc.a0.ae 45 Hz 129 HY 126 HK (nd (rP eE iC tA 24 (aM cD dE e_) 65 (aM cF dE e_) bd) (aR bq.bP (bS ed.eP (nd (rM nu.bP.aX 94 kw dz.fF 29 z7.gd 114 qz.bI) (qe jx.pl.aS 11 cy.gb 190 xo 243 cP.eu aw (eo os.bg.bp 125 c7.ex 82 c7.ez H 243 dr.ez) (fW ah)) (dG aV.hL.cH (bC rL.e0.cQ 98 ey h5.cY d4.cY 192 ap nC.av 188 nH.av))) (gp oW.a0.aj 171 c5.fp ak af 59 c5.eS 55 c5.fm (kN ii.nS.S 106 hJ e3 ed d0 113 c9.eY (al ar.fr.aX)) (bD jg.bp.aj 134 pA bF bE 79 pq jt 75 gX (g1 iu.aD 47 cT.e7 101 cT.hH 55 cU.ez aw)))) (nd (zr cF Bf cl) (o2 um.S 65 an i6.aC 111 c4 cj 107 dS (J iE.AY.hK.dh 213 cV.gl (aK d8.io)) (aZ (nJ g9.cz.aS 11 c0.fN 35 c0.ex 140 lA K 136 L) (nA iy.gZ 53 cL.fP cL.gK 90 rX X 86 ad))) (dR hW.bg (J jy.aX.pG.bo 674 ds.f8 (dc rs.gP)) (j4 tF.aI.bu (iL te.bi.ae 72 zU K L 60 cT.p9 56 cT.p8))))) (aJ fk.ec.aX 40 z2.gl 29 z2.e1 60 z2.gk (qS jN (aJ pg.b8.b8 79 z8.ga 1 z8.gj 2 z8.f5 (dR lS.a0 (ac bd.aF.bl.dt 342 dr.fA) (dd lD.S aA 71 dY.gg)) (du ov.aD 62 xj g5 gq k6 101 bv kc (lc uu.S 233 dM.p9 46 cO.p4 105 hB 101 cO.p2))) (nd (pe uv.bV 24 cG.p9 78 cG.fq H 26 cG.p8 94 cM.eB) (fS n5.cR.ja 4 dj.fA 184 lm bK 180 ea (bC sY.S.bV.aj 102 hD lk.pG kS.pG 242 ch b1.aX.bV 238 bd.nj.bV)) (o8 rn.iI.ho 209 cN.fp cN.ft 130 c8.er 126 cI.ex j (aT uy.eP.b8 55 cT.fq 1 cT.gb 2 cT.gd)))) (d3 aE.jq (cu il.cz.bm.aF 53 AK ah bK ea 1 dn.gd (fh AQ.eK.iI.S bd 180 xo e_ 251 cB.ez H 370 dX d0.fr (dc jn.zh.vz)) (nt Cq.iF.aF.aS 4 cN.fK 409 cN.fm 165 cN.eS (ly jX))) (gp rl.pl.ae.cQ 64 cy.gd K L 161 cP.fN 157 cP.ex (aZ (xh o9.aj.a0 147 di.gg 126 di.eY 86 rV aE 14 di.eS) (hZ kL.aO.cQ.aC 11 dL.gO e_ 178 ap j.ym.hM.fF 232 ap b1.aS.fj.bI 49 dl.gj e_)) (gV yF.gR.ae.aj 70 cN.eY 235 cN.fq 167 cN.eS (aK dN.CR.xK.S)))))) (c3 K.hU.bI (eL d4 (ku j.bm (nd (qU dF.iI.aj.ae 72 pw K L 103 nY 99) (N nr.hM.gT 82 ct.eB (e5 fk.dJ.bi.cd.dv 76 c7.p7 114 v9 ar 110 ao) (lf (rP l4 iC x6 32 (aM cD fB e_) 145 (aM cF fB e_) b1))) (J jn.bl.eC.db 82 cA.e7 (mg tJ.dJ.aS 11 dL.p0 199 ap h9.nj.eK.av 137 ey H.cQ.cv 133 j.aX.cv))) (mi uu.aF 42 pp e_ 42 cG.fP e_ 42 pp aP 1 c5.f9 bd (gW s9.eb.ae.eV.aD 180 iB ob.o6.kB oo.o6.kB 307 dP.f5 186 cV.p1 j (kf iy.ec.aj.S.ae bd 65 dT.fz e_ 65 dT.gl e_ 121 cN.eu bO)) (kN uc.aI.S 149 l0 H ah aU 72 v6 (dc lV)))) (qv j.bg (nw l9.dv 121 c4 dz.aO 101 an bj.ae.ce 97 br.ae.ce (J nK.aI.db 71 cV.gj (co oB.aF.ec)) (ck H.cR.ce (cp uk.fH 51 cL.p9 cL.p8 1 cL.p7))) (dQ i5.aC 11 cq.gd 139 cP.hH 202 cP.gL 119 cq.fM (md ii.eP.aD 70 dP.p9 237 iK ci.pl 65 dP.p8 (bM qa.g0 112 bv aA.bQ.aO aB.bQ.aO dD.bQ.aO 19 dl.gg)) (bT nC.AW.kv.hM.bu.bu 61 iz rE.fr.iH (n4 H.n2.aS))))) (bc aV (bc mW.aI (eg qV.ag 108 c4 iE 1 z9.fi 2 z9.eW (N fY.Cv.aI.db 74 cB.p7 (mg l3.ag.aS 11 dr.gj 83 ca aH.wk.bl 94 bN dZ.d6 90 eM.d6) (lb aE.S)) (du tx.aS.aj 62 ep g5.ja gq.ja k6.ja 139 iq lP.bI (lf (Cs j)))) (nd (AB sI rU 24 65) (ck mq.h8 (bC ti.cs 146 et qI.bP oH.bP 101 iK jt.cJ 97 gX.cJ)) (J jN.bg.jd.eD.kk 221 c8.fx (ff n6.bQ.aj 35 dq.fT 43 dq.fA 60 dq.eu)))) (om gF.aX.aC 11 z7.fE 87 kA dV.gP 53 mc aw.fF (eg g3.ag.b8 74 fG jN.aD 1 c5.fu 2 c5.gO (du eI.ja.cR.a0 59 cq.fC au X ad 115 nZ bt (lf (oE u0.cf 71 c0.eZ 180 b7 g2.ae 176 kg.ae))) (bA os.bm.b6 143 cS.ex 1 cS.fL 2 cS.gg (ly jV))) (qw oy.cz.aS 4 cy.er 152 ct.gj 74 ct.ga (fO pS.eV.ja.a0 87 dj.p0 188 zu aE 14 di.p0 (bZ kL.fH.bg 106 y0 au X ad 182 ap i6.d6)) (bA iu.dB.ag 135 dT.fo 1 dT.fU 2 dT.fi (la gs.ag 42 d9.f4 d9.fE d9.fD 1 d9.fu))))))) +def DG : ab dp:=(c3 b1.AW (hS tC.aC 4 H8 307 HH 29 HL (aR aU.bP (aR iE (bc jN.bu (nd (wH qi.jq 11 cy.fi 149 lo au 72 cP.fP) (i7 tw.aF.bw 82 bN rH.cH pY.cH 17 dI.gv 75 ca lV.bI) (lf (wW bK))) (ix h5.pm.bm (bZ tJ.a0 183 ap H.bu.av u1.av aU.bu.av 121 ey bt.cY))) (bU aV.fy (bA pV.dJ.aX.aF.b8 176 dy.fx 1 dy.gn 2 dy.eA (g4 qy.gR.ae 28 ds.fq 482 dl.eH 478 dl.f8)) (fV rn.aD.bQ 62 rZ 17 cS.gd 339 cI.gk (co jV)))) (bc iS (nd (q2 qK.cz.aj 23 z9.er 130 c4 uN 114 H.bP 110 uj) (ir oM.iF.cQ 43 cB.p3 44 cB.p2 29 cB.p1 26 cP.fM (h6 ud.bV.a0 97 bN gS.g8 100 ca gf.cY 14 ds.fU)) (ir jA.dK.gR.aC 11 cS.f6 167 cS.gm 38 cS.fP 29 cS.gK (fW jk))) (lY tH.bu.aD 57 cM.gb 154 rc aE 65 cM.gd (aW aw.nT.nT (ff oO.dJ.g6 91 c6.eZ 190 c6.hH 1 c6.fo)) (en rJ.eh (aG au.bu.iG))))) (bc pR (bU aw.eN (fR iT.bl.aS 11 z8.fK 65 z8.fN 60 z8.ex (N ki.FH.ib.bo 582 da.ft (iL gG.aj.cR.fg 181 dI.fD K L 76 dI.ft 72 dI.f4) (al cg)) (ck e3.gP.nj (bC tJ.cz.ae 191 ap K.iG.ce.bi L.iG.ce.bi 109 ey q7.cv 105 nL.cv))) (nd (wH rk.ja 11 cG.fU 105 cG.e7 aE 49 cG.fP) (ej uW.eV.ae 60 Ah K L 41 cB.fU 96 cB.fi (lf (rP eE sd vw 24 (aM cD dE e_) 65 (aM cF dE e_) bd))) (de cl.o6.bp (iM b1.bu)))) (hi tx 38 ep dX 1 z6.fp (qs cZ.dJ.bg 36 dn.fu 84 dn.gO 38 dn.ev 147 dn.fT (jW tt.b6.aj 23 cV.p9 105 cy.ev aE 79 xc bq (iL i1.dK.ae.aj 64 wn ak af 88 ds.gl 84 ds.e1)) (jW n1.aS 11 c0.gk 188 b7 ci.ni.ae 69 cA.f6 aw (ly g7))) (nd (wR sQ.aS 11 cq.gj 106 cM.eu aH 613 c9.fp 60 cM.ez) (ng tL.b6.bw 76 dP.p2 292 cN.p1 19 dP.p1 (aK aH.cJ.kY.ib.fr)) (de bt.cJ.kY.ib.fr (i7 uu.fj.ag.bw 80 jc pT rJ 17 dY.eH 151 hB lV.aI)))))) (aR aP.eK (mi sJ.a0 59 z1.fx e_ 59 z1.gn e_ 59 z1.eA e_ 259 iJ uK (bS l6.bm (bc dV.bl (N ui.rG.bm.bz 64 cy.eA (ff sX.S.b2.ag 114 c0.gd 274 dr.fL 1 c0.fM) (fW gx)) (dG b4.bm.cH (e8 oO.eb.bu.cf 89 AF au X ad 145 dL.eY))) (bU eQ.aO (mR m9.cQ.ia 4 c9.ez 493 mJ ub 126 dP.f8 (bZ re.ho 71 pz g5 gq k6 188 b7 lP.aC.ae)) (o8 os.bm.aD 121 cI.fp cI.ft 70 ts 66 cS.eY j (ac kJ.mu.eV.dK.fy 67 cT.fD)))) (cb gs.jr.bV 131 z5.fM z5.fx z5.gn 161 z5.eA (nd (pO sL.aj 66 an oD.i2 tF.i2 L.sl.i2 106 kc.b0) (J lR.gE.bz 552 wn (ac va.kY.eF 925 dl.ga)) (dG o7.bm.cH (nA fc.gZ 53 cL.gO cL.ev 90 b7 X 86 ad))) (N e4.bP.hV 64 cq.eW (gW ii.ag.bw 109 sh bj br 17 dP.fN 78 hJ aH (d2 dz.aI.pm.bm)) (ck jk.fQ (hZ rk.iF.a0 75 jc fX 75 jc d8 156 hB tS 14 cT.fN aP))))) (eL aV (cb h3.pl.S 112 z4.gb z4.gd z4.fM 93 z4.fx (nd (pJ m2.it 117 zZ au X ad 102 z8.gg) (aJ ma.bP 32 cB.e1 1 cB.gk 2 cB.er (lf (lB g9.cz.b6 136 lA jN 1 c0.p8 2 c0.p7)) (dd h7.b6 aA 9 cO.fE)) (gV o9.aj.ag 135 cA.gm 134 cA.fC 1 cA.gv (co kn))) (fR h7.aI.a0 55 cG.gv 63 cG.fz 90 wh (ck aV.h8 (bC qQ.cz.ae 183 b7 ak.hM.cK af.hM.cK 86 pu h5 82 d4)) (od rn.iI.ag.aS 11 c8.fA 130 y8 j 82 vo K 78 L (al bt.aI)))) (N lG.bP.dh 56 z6.fq (eJ H.xM.gY (J K.xE.mX.aF.sl.aI 136 dj.f8 (al ao.iH.bQ)) (aZ (jB q8.iF 11 c0.fC 181 b7 bO.ja.ae 104 pu K 17 c0.gv) (co jX))) (N cl.eC.db 481 cB.gj (eG jp.eb.bm.aF 63 sk fI rb tg 1 di.gb (ij qY.dv 120 bv iQ.aO 93 ch qI.aC 89 oH.aC)) (J fY.aX.bl.eD.kk 239 cN.gb (g4 mj 38 dY.fC 115 dY.gv 14 dY.fq))))))) +def DD : ab dp:=(eL aH (m6 H.S (nd (yN uE.dm 102 z1.gg 254 iJ aE.iF z1.eY 1 z1.eS) (mi s5.b2.a0 130 z3.ez e_ 130 z3.fK e_ 130 z3.fN e_ 75 dX uK (gA kb.dJ.bi.aD 72 kA e4.gP fI.gP iD.gP 60 mc hO.cH (nd (l5 tt.b6.aX 75 cP.fi 29 cy.gH 95 xr j) (d2 aA.aF.pm.bm) (aT jA.dJ 11 d9.gl 1 d9.e1 2 d9.gk)) (J e_.kB.eK.dt 334 c0.ez (iR j8.cx.bp.ag 184 ap b1.aC.iH.wi 1 dL.gm 2 dL.fC))) (cu gs.iI.eP.aF 80 fG H.rG.bw ah.rG.bw aU.rG.bw 1 c5.ex (aW cl.nT (iR re.ag.b8 184 b7 kx.aC.ae 1 ds.eY 2 ds.eS)) (J pR.cJ.bi.hL.dx 156 cS.fT (g1 lO.bH.bi.aD 81 cU.fM 482 dq.fo 56 cU.eH aw)))) (eL oH (eR g3.aX.dB e_ 100 an qq.aS 68 an iS.gP 64 an t5.gP (J aU.gP.o6.eD.aI 284 c9.fP (dc b3.cQ.mv)) (gW nh.cR.b8.bw 70 pq jw jD 17 cS.fK 141 pA bO (aT uE.dm 11 dM.gm 1 dM.fC 2 dM.gv))) (fR nB.bP.bw 89 cM.p4 171 cq.gb 19 cM.p3 (bT gS.kv.pU.hK.dh 305 ky gS (aT qa.ik 11 c6.p4 1 c6.p3 2 c6.p2)) (bD vg.b2.aj.ae.aj.cs 114 di.gl bF bE 77 ve jt 73 gX (ac oc.bi.hL.dx 156 dq.gL))))) (cb j7.eN 33 z2.fA z2.eu z2.ez 19 z2.fK (ku H.bm (eR gF.bQ.gC bd 75 z8.fN bd 82 z8.gb e_ 70 z8.gd e_ (N au.bu.dt 334 cV.p6 (em lH.jq.cR.bw 79 dr.f6 dr.fP 17 dr.gK 71 dr.fp) (lf (zw aB.cH))) (J dO.ni.cH.hU.aI.aI 74 cA.fN (g1 i4.cd.aj 23 dM.fD 73 dM.p3 47 cO.eH aw))) (nd (qL fa.cx.cf 101 nW 63 rc 59 lF) (J qn.Gd.eF 258 di.ev (fJ cl.pE.eC)) (de Bh.o6.bp (aG qn.vS)))) (fR eT.cQ 31 z6.eB 39 z6.fT 40 z6.fA (pQ aQ.yk (od tl.aS 11 dy.fP 73 yt j 94 fe lq 90 gN (al kx.bl.bH)) (gy ka.GE.eC (iM hQ))) (qw fa.cx.b6.aS 4 cP.gO 101 cP.ev 97 cy.fK (aZ (pe uQ.e0.bg 48 di.fD 110 lJ H 50 di.fu 56 cA.eB) (al jy.bH.bH)) (gz gG.cK 80 pp j 48 c5.p0 K 44 L (fW jU.cx.bu)))))) (cb g3.gR.iI 60 z1.fE z1.fD z1.fu 108 z1.gO (cu g3.dB 242 iJ nk g2 kg 64 z1.gL (bU oX (m6 ad.S (lY ta.bg 58 ct.e7 221 vu au 236 mG (iR l3.eP.b8 75 ca jN.kY.bH 1 c0.p4 2 c0.p3) (aT hY.aX 48 d9.p3 29 d9.p2 68 d9.p1)) (aW eQ.iv (pM tJ.eb.iF 4 dL.p6 137 ey H.bQ.cv 17 cO.fP))) (nd (yz dF.aj.S 50 pp 92 cG.e7 41 cG.f6) (ek mZ.b6 64 ey pr 1 c9.gb 2 c9.gd (lf (sN sO.gR.bg 36 dT.eS 223 b7 K.xM.cK 38 dT.fm 185 i6.ja.ae))) (gV d5.eN.g6 85 cI.eY 84 cI.eS 1 cI.fm (ac mT.eF 177 cT.fL)))) (cb pg.cz.aF 84 z5.p8 z5.p7 z5.p6 1 z5.p5 (cu qx.fH 116 c4 o4 hW.bQ ld.bQ 1 z9.p4 (ir oy.gZ 418 wm 78 cV.gm 101 zM 97 cV.gv (eo rt.aF.b2.a0 202 c6.gH 119 zf aE 14 c6.gm)) (aZ (oi i5.S.a0 72 hC bd.ia 157 et ci.aO 14 c0.fm) (bZ Ag.S 108 iq jv dk e6 53 ep b4))) (N j.fr.pU.hK.dh 63 cq.ex (eG mP.ag.dm.bw 78 rO aA aB dD 19 dP.gj (kf u5.e0.fj.S e_ 183 ap l6.hL.bI 129 vl H 125 dl.gn aP)) (en iX.eh (aK ke.bp))))) (qs h3.ag 218 z2.p6 267 z2.p5 220 z2.p4 1 z2.gL (nd (kH bd.cJ) (lY pg.b8.aD 47 z9.ev 140 an au.jq.aS 87 z9.eZ (az iy.bV.b2.ae 175 lm 57 w2 53 u2 (lc g9.cz.aD 467 dl.fp 132 dr.p0 75 ds.e7 26 ds.f6) (dd mj aA 21 cO.eZ)) (fV jS.cz.aD.ae 63 cA.p8 103 cA.p7 99 cA.p6 (g1 lH.eb.aj 23 dM.gk 85 cL.e1 59 cO.ga aw))) (dR af.S (ej Al.cz.S.ae.e0.cQ 114 wC K L 69 dj.eA 65 wV (bZ pf.aj.b2.eV.bg 95 vn jv dk e6 156 vi aN)) (J oX.iv.bm.dx 164 c8.fq (bM uh.ag 53 vk ah bK ea 1 dq.e1)))) (eg gF.aX.bP 49 mc e_.fF 1 z6.p3 2 z6.p2 (nd (jB qX.ag.iF 11 c5.ft 81 fG bd.pU.bw 172 pB H 17 c5.f4) (bD jx.aj.cs 106 cy.gj bF bE 72 mL nr 68 mh (bC i5.aj.b2.aj 147 mK aY aQ 199 jK cg 195 b3)) (bD pX.aX.cz.ae 66 mM ak.hM af.hM 98 nZ h5 94 d4 (ac b1.eh.dh 136 cU.eB))) (hi ko.cx.bg 47 cq.gL cq.fD 83 cq.fE (bT np.r5.Gy.bm.bz 146 ep aH.cJ.ja (al X.jd.mu.bH)) (jz aU.bg.vz (lf (zD aV)))))))) +def DK : ab dp:=(c3 L.AW (qs gU.cR.bg 116 G4 248 Hs 118 Hv 214 GW (aR kn (aJ eT.b6.dm 11 z3.eW 1 z3.eH 2 z3.f8 (N e_.ae.pG.eV.bz 63 z7.eB (dR kO.a0 (g1 uk.dK.aC.aF.aS 11 dr.fU 94 dr.eA 130 c7.fu aw) (lf (rP qu iC x6 28 (aM cD hI e_) 105 (aM cF hI e_) b1))) (aZ (l5 pf.cQ.bP.aX 69 dP.fD 29 da.fz 89 pq gx) (g1 lK.cx.bg.b2 11 dL.fz 93 w6 181 ap bd.ia.iH.wi))) (bU bF.bu (ck aE.rG.h8 (iO yR.kB.ib.gE.cw 244 ap yR.xM.fF)) (ck Bg.fQ (e8 kQ.dK.dB 94 sj au.bQ o4 ad.bQ 68 cU.fu)))) (nd (kH lG) (aJ uo.dJ 11 z9.fA 1 z9.eu 2 z9.ez (bT j.fr.hM.bu.dK.fy 112 iB j.mX.kB (d2 af.aS.vC.bm)) (du qN.cd.eP.bg 75 ep ci.mX.n2 aV.mX.n2 cC.mX.n2 168 iq mE.bV.jd (aT h7.ik 11 dM.fA 1 dM.eu 2 dM.ez))) (qe rd.aS 11 cM.eA 71 cq.p5 99 uC aw (J aE.r5.ib.bP.eV.dK.fy 253 dP.gK (lf (l5 o3.aI.cz.bQ 19 dl.f6 17 dl.fP 180 ap bO.d6))) (en lS.eh (ac iQ.bi.hL.dx 156 dq.hH))))) (nd (rP eE sd EK 24 (aM cD dE e_) 65 (aM cF dE e_) aP) (bU dS.eN (rz tC.dv 99 z8.ft 118 z7.ev bj 114 br (e2 nE.i0.bo 204 fe X (co kP.aF.ec) (lf (kH K))) (aZ (ww lT.bl.ec) (aT y2.ag 47 cO.eS 1 cO.fm 2 cO.gH))) (dR j.iI (gV w0.aj 81 zX 205 cA.fu 58 wO (bM j8.fH.aD 92 hD aA.ib aB.ib dD.ib 155 dT.gg)) (jz kP.GF (hZ uh.a0 53 cT.ga e_ 53 cT.gj e_ 95 sc aE 14 cT.f5 e_)))) (N FY.cx.bz 40 z6.fU (az BE.b2.ae 91 dn.eB 50 dn.gk 46 dn.er (eG sQ.bw 98 nW au X ad 19 cV.p3 (fJ pR.vz.aI)) (ek q8.b6 177 b7 xP.aC.ae 1 c0.fA 2 c0.eu (co g7))) (nd (rP fk iC A2 20 (aM cD kD e_) 25 (aM cF kD e_) bd) (aZ (wH wQ.b2 11 di.e7 106 bv gf 61 dj.gO) (al rJ.kv.aX)) (ck jT.fQ (fW dO.eV.bu)))))) (lC cF Gf b1 (aR iD.bl (dQ dF.ec.aj 23 z3.fx 66 z3.gn 50 z3.eA 46 z3.f9 (nd (tQ dF.fy.b8.bw 95 kw rE.bI rN.bI 17 z7.p0 182 z7.fC) (gI uw.aF.aS 4 cy.p6 64 mL lq 60 gN (em d5.b2.ae.cQ 197 ds.eu ds.ez 74 ds.fK 70 ds.fN) (fb cF fB b1)) (ck ka.aF.aC (kf pI.jr.ag e_ 131 ey Dn.cv 1 dL.p3 bd 2 dL.hH e_))) (az uy.bl 23 c5.fx 1 c5.gn 2 c5.eA (aZ (qk mP.ag.fg 82 cV.gm 105 cV.gv K 101 L) (bZ qo.dB 83 ca tq.cY j5.cY lG.cY 102 bN pd.g8)) (k3 u3.cx.aD 175 cI.fU e_ 175 w3 e_ 339 c8.eH aE 67 rZ j (al kO)))) (az g3.eb.cQ 82 z5.hH 133 z5.gL 129 z5.p9 (cu nF.g0 111 c4 aA.bQ aB.bQ dD.bQ 19 z9.hH (aZ (lz ju.cY) (ij l3.cz.ae 86 bN pY.cH 83 ca K.A7.bI 79 L.A7.bI)) (du B0.aD 165 ap jn.bi o7.bi j.nj.bi 75 ey kc (cp gr.g0 54 cL.fC cL.gv 19 cL.fq))) (rz j7.bQ.cz.ae 121 cM.gH 73 cM.fC K 69 L (jW mZ.aS 11 dP.fx 180 ap iN.bi 68 ey gS (aG mh.eK.ce)) (de ed.gY.gD (mg rk.eb.ae.aC 11 dq.p6 150 hB hj.gP.wi 69 mH H.kv.hM 65 j.fr.hM))))) (cb j0.ag 36 z2.fM z2.fx z2.gn 1 z2.eA (nd (kH aV) (cu um.ec 103 c4 b1.fy H.ec j.fy 1 z8.p0 (e2 kP.FT.bu.dK.fy 131 je aH.iG (ac uU.bV.fd 159 dr.ex) (pa aE.S)) (bD jp.eb.bg.aj 83 nZ aY aQ 71 mM eQ 67 dz (fW kn))) (dR K.bg (e9 li.eb.ag.bw 113 dj.gm dj.fC 17 dj.gv 77 dj.fq (al b1.dm.mu.bH)) (ck rK.fQ (lg uy.eP.aD 55 dq.f8 131 jc e_.bP 59 cT.fq aw)))) (lE iP.eN.aj 35 z6.f5 43 z6.hH 50 rY hO (nd (lL cZ.aS.gR.bg 36 dn.gL 96 dn.fq H 38 dn.p9 58 AK aN) (aZ (qU BZ.cx.ae 56 wz K L 95 xl 91) (ac lR.aI.eC.bu.bz 393 c6.e7)) (du lK.aO.S 89 rV dO cj dS 229 ca bd.e0.bH (iM kp))) (nd (pk jg.cd.aD 139 ct.ft 200 pn gx 227 ct.f4 126 cq.fM j) (bT oB.ym.hM.bu.dK.fy 112 iB oB.Ej.kB (hZ uJ.cx.iI.aC 11 dl.p5 e_ 344 ap j.Ej.mv.bI 312 ap b1.F8.xE.fF 75 dl.p4 e_)) (du nb.dB 71 Az au X ad 126 fe lR (co ah))))))) +def DS : ab dp:=(hS jm.hL.ae 119 H0 47 GD 43 Hz (nd (qb eE Bw 24 65) (e2 h9.bm.bu.bu.dh 151 iJ j.aC (rz qN.dm.aX 132 z3.e1 59 dX bF 55 bE (gp iA.eP.S.ae 97 nY K L 74 z7.fC 70 pw (e2 b1.cQ.rG.bm.bz 122 dX xP.fr (ff os.bg.ae.aj 125 dI.fN 347 dr.p4 82 dI.ex) (cp gr.ag 42 rQ sj 1 d9.gg)) (J bt.e0.bV.fd 159 dP.fq (qm rL.eK.aS 11 dL.gj 35 dL.f5 192 ap lq.eK.av 188 gN.eK.av))) (bU aQ.aO (J ci.hL.bV.fd 159 c9.e1 (dc ak.pU.sy)) (J k0.cJ.bi.hL.dx 156 cI.fP (lf (oP hY.aS 4 cU.gb 52 cU.gd 48 cT.fp))))) (N k0.Aw.bz 67 z5.fN (eR uH.a0 bd 94 an aw.jq.aS 98 an q9.gP 14 z9.fC e_ (aW aE.cR.nT (aK oJ.io)) (J mq.GO.bi.k7.fy 327 c7.eA (eo ko.bV.a0 55 cL.e7 103 vq q5 14 cL.f6))) (dR ad.S (dG cg.cR.cH (aT qh.eP.cR.b8 126 c6.p8 1 c6.p7 2 c6.p6)) (en jH.cv.bH (bk lP.gY))))) (c3 fI (cb gU.dJ.ag 88 z4.fL z4.gg z4.eY 1 z4.eS (cu gs.aI.S 80 an dO.mv cj.mv dS.mv 60 u7 (lY pf.aj.aF 120 cB.fu 358 iB hW.bH.kB 1 cP.fu (lg q8.aS 11 ds.fz 86 pz gf 181 b7 aN.aC.ae) (ac gq.gT 92 d1.ez)) (aZ (nJ kZ.eN.cR.aS 11 cA.gg 64 cA.eY 118 lJ K 114 L) (h6 iA.gC 103 rX aw 52 cO.fA H 48 cO.p5))) (mi j7.bQ.a0 46 cM.er b1 165 cG.gd aE 48 cG.f9 e_ 93 w7 bd (aZ (qP yA.b2 4 dy.fo 95 bv bK 91 ea) (bC oY.ho 106 bv rB.cJ qn.cJ 87 ch eQ.aC 83 dz.aC)) (bT H.bu.AW.kv.hM.bu.bu 61 iz tq.kv.iH (lf (xh tM.bl.aj 23 cT.p5 78 cT.p4 62 cT.eY H 58 cT.p3))))) (mi eT.bl 36 rY e_ 36 z6.ez e_ 36 rY aP 1 z6.f8 bd (eJ ao.hK.gY (bD tL.aX.aj 58 vu bF bE 108 mf cg 104 b3 (al d0.bl.bH)) (gy bK.iG.eC (ms kp))) (eR kV.ec.b2.aF.aS bd 4 cq.f9 bd 167 cP.fA e_ 163 wg aP (ek qh.bi.b8 186 lm iE 1 di.fN 2 di.ex (iO h5.mu.hU.gE.cw 232 ap h5.xE.fF)) (gy H.gP.aI (aK ao.CR.xK.S)))))) (d3 Dq.cH (d3 bd.aS (ku q5 (c3 ut.aF (lY pf.cx.bg 53 ct.gl 296 vt X 409 c9.gK (aG jX.fQ) (la jS.S 178 d9.p0 d1.e7 d1.f6 51 d1.fP)) (J aV.cd.aI.db 126 da.p2 (hT th.aj.aj.b2.ae 102 ey d4.cY 196 ap H.gP.aI.av 192 j.sy.aI.av))) (nd (Ar H.yk) (bD kK.cs 65 hC bF bE 136 et jt 132 gX (aK iX.io)) (eG hR.S.bV.e0.aF 75 ep fI.pE.n2 rb.pE.n2 tg.pE.n2 1 cI.f9 (al rJ)))) (qv b1.bg (gA nG.dB 75 an H.d6.aC jy.i9 ru.i9 121 c4 b4.bQ (bT H.bV.rG.bm.bz 114 dX ah.bg (cp rm.eP.bg 63 dr.ft c0.eB 143 c0.er)) (ir oQ.bl.cd.ia 11 cN.p5 23 cN.p4 138 cN.ex 126 cN.p3 (aK g7))) (N au.bg.fd 73 cq.fq (bD tl.aD 86 wB aY aQ 73 xn ak 69 af (bC rr.gZ 115 bv ke.aO iX.aO 84 ch ed.ni 80 d0.ni)) (J aA.ib.hU.bP.eV.dK.fy 104 cN.p8 (aT tK.b8 66 dY.fp 1 dY.ft 2 dY.f4))))) (nd (rP eE iC tA 24 (aM cD dE e_) 65 (aM cF dE e_) bd) (bc oc (o2 qK.S.S 110 r6 aN 76 an aV.h8 72 cC.h8 (lQ pX.aX.S 78 nZ 62 mM H 123 dy.ex (hT tr.cx.bi.bQ.S 95 bN bq.vG.jd 80 ca mT.bH 76 rC.bH) (dd gr.a0 aA 21 cO.fi)) (bD mQ.cs 73 ca lk.bl kS.bl 92 bN m4.bI 88 sW (ac gX.bu.cw 137 dM.p8))) (hi ro.bl 89 cM.eB cM.fK 1 cG.fK (aZ (Aa tw.bP.aX 82 bN K.hU.fF L.hU.fF 29 dj.p8 102 qz.bI) (lf (ow oY.ag.aj 23 c6.er 140 bv ci.bo 114 aw.aO.aO))) (J dk.iv.bm.dx 164 c8.gd (bk tP.gY)))) (aJ kj.q6.ag 90 z7.gK 1 z7.fp 2 z7.ft (gI iT.eb.ia 4 dn.f9 73 fG H.eN 69 j.bw (du oM.iF.aj 240 yv H ah aU 75 r7 bq (dc tF.fr.vz)) (du ol.aS.ae.aj 124 Aq aA aB dD 69 pq bq (e8 mP.dB 86 vq H.bm jy ru 60 cL.p6))) (N ea.i0.bo 70 cy.e1 (fS eT.cd.gR.aS 4 di.p2 141 iq qR.bI 137 tN.bI (iO kJ.mu.hU.gE.cw 232 ap kJ.xE.fF)) (mR tR.cd.aS 4 dT.ev 234 ch ak.bV 153 dT.gg (ji bq))))))) +def DN : ab dp:=(nd (kH K) (bc ed (aR tq.bP (aR nE (eg kb.dJ.bi.b8 56 mc jH.cH 1 z7.f8 2 z7.fz (N fY.fy.dt 334 cB.fD (kf iu.dB.a0 e_ 134 cN.p1 e_ 119 hD ci.aO 14 cN.p2 aP) (ji ox)) (ix lV.pm.bm (eo ph.a0.bP.S.a0 140 dL.fu 106 AF aE 14 dL.fi))) (bS dO.bl (J e3.Ga.sy.cJ.aO.aO 422 di.p9 (lf (jo eI.b8.jr.it 181 c6.fu 89 c6.f6 262 yS 258 c7.eA j))) (aZ (jo i1.jq.dB 75 cS.f9 76 cS.ga 68 Ai 64 da.ft j) (fW jV)))) (nd (kH aY) (nd (qb eE sw 24 65) (du o0.cs 209 ct.p3 H ah aU 66 pn bq (d2 nr.vC.bm)) (ck e3.ec.aC (iM jk))) (om zc.dJ.aS 11 cM.fx 72 cM.fm aE 97 sM aw (bA ra.bw.bP.dm 11 dj.p3 1 dj.p2 2 dj.p1 (iR tV.bQ.ag.b8 160 l0 iE 1 c6.fi 2 c6.eW)) (de bE.bH.bp (aG ah.gY.iG))))) (dR np (bU dD.bQ (bc jT (aJ jx.cf 60 pn 211 un 207 ct.p3 (e5 tn.cz.ae 178 c0.e7 85 c0.fP K 81 L) (ac H.iI.cx.bz 119 d1.fD)) (gy eM.iG.eC (aT fa.eb.ag 47 cO.er 1 cO.eB 2 cO.fT))) (aJ h7.aI.cQ 85 cG.gl 51 cG.e1 295 cM.eW (aW kr.nT (lg tz.cJ.b8.aS 11 c6.fE 90 yu b1.pE 157 l0 gS)) (kh uY.aC.S 65 yu v6 146 l0 (bk e_.cz.gY)))) (nd (qG j) (pQ aH.yk (gW wZ.ag.bw 127 et jw jD 17 cV.p4 72 hC bO (aK uB.gP.ib.fr)) (eG uA.dJ.b6 167 b7 hW.ae aE.jq.ae aP.ia.ae 1 c0.fU (bk g7))) (N aN.yk.hU.bo 174 cy.fp (J ed.r5.eF 172 cA.f4 (al au.bm.bH.bH)) (bA te.bg.ag.dm 11 cN.fM 1 cN.fx 2 cN.gn (hZ ua.b2.eP.cz.aD 113 dY.fz e_ 113 dY.gl e_ 99 zP aE 26 dY.e1 e_)))))) (eL b1.CR.aF (aR jT (ei iy.ec.eN 41 z3.fq z3.gb 17 z3.gd 25 z3.fM (N aE.r5.ae.pG.cw 78 z7.p5 (N b1.EZ.eC.db 487 dy.e1 (aG ty.sy.nj) (aT li.dJ 11 d9.gv 1 d9.fq 2 d9.gb)) (aZ (oi ii.bV.a0 121 fe aN 88 Az aE 14 da.gv) (lf (lZ j8.cx.bp.aj 78 dL.fM dL.fx 188 ap bt.aC.iH.wi)))) (eJ aE.vC.cJ.fr (aZ (lz ah.cY) (ac L.o6.av.k7.fy 269 dT.p9)) (J vR.cJ.bi.hL.dx 156 cI.fz (al oJ)))) (bS gX.bu (cu uH.ag 94 an X.ia.aS hW.ia.aS ld.ia.aS 1 z9.ga (aZ (lz lV.cY) (e5 rf.dv 75 dI.eY 99 wl ar 95 ao)) (bT ad.iH.aI.hV 124 hC dS (h6 sJ.a0 59 mF jT 107 dX uP 14 cL.fU))) (N bO.iH.ib.bo 61 cq.f8 (ck pd.aC (d2 g5.aI.pm.bm)) (ng kV.a0.aj.cR.aX.aC 11 cN.eW 135 c7.ex 74 cN.eH (pM gG.aj.cR.ja 4 dq.p7 64 dq.gm H 60 dq.fq))))) (az j7.dJ 11 z2.gv 1 z2.f8 2 z2.fz (bc ci.eV (eg l9.b8 71 an px.h8 1 z8.p4 2 z8.p3 (im oJ.nT (iL re.nS.aD 176 b7 bF.ja.ae bE.ja.ae 63 ds.ex 26 ds.fL) (dd dF.b6 aA 9 cO.fD)) (fh oK.aS.S e_ 74 ca mq.bH 115 bN ak.ni.jd 29 cA.gn e_ (lf (wE rI.a0 48 dX 125 iq dV 14 dM.fP)))) (N va.hU.bo 548 cP.gl (ej jp.eb.bu.aD 59 sk bF bE 63 dj.eY 26 dj.eS (kf ov.cd.bQ e_ 78 ch aU.aC 17 dT.eu e_ 113 bv bd.pU.cJ)) (en tE.bl.bH (bk b1.wq.gY)))) (mi o1.gR.iI 103 z6.gL e_ 46 z4.er b1 46 z6.eS e_ 94 nX k9 (N q7.iH.ib.bz 63 dn.f5 (J j.sy.aI.db 116 dy.er (al e_.e0.fr.aX)) (od m1.aS 11 cN.e1 91 bN hj.sl.bI 76 ca kO.bl 72 tE.bl (fW jX))) (N aE.HV.eC.db 487 cB.p6 (m5 nH.bu (dc jl.i2)) (de h9.cJ.kY.ib.fr (fb cD hI e_))))))) +def DF : ab dp:=(qs gF.bV 24 Gc 78 Fz 26 F3 41 FU (hS gs.b6.cQ 27 G8 54 G9 50 Gl (aR k6.bP (cb s5.b2.ag 130 z3.ex z3.fL z3.gg 1 z3.eY (lE h3.pl.aj 23 z7.eY 119 z7.eS 93 z7.e1 aw (gA s8.aj 61 lF aA aB dD 107 nW bq (lf (qp uF.e0.ae.b2.ae 122 wF L 77 wc K 73)) (fb cF mD b1)) (ej n8.iI.aj 211 hC bj.ae br.ae 279 da.fm 275 da.gH (iR iu.aS.g6.aX 185 ap gX.d6 113 dL.fq 109 dL.gb))) (bS ul.aF (J aw.ia.hM.gT 82 c9.fu (fJ k0.vz.aI)) (e9 tu.b8.bw 175 cS.p1 cS.p0 17 cI.e7 82 cI.f6 (bM iA.eP.bg 52 iB aE.kB K.kB L.kB 227 cT.ft)))) (aJ m8.jq.S 88 z5.eB 85 z5.fT 29 z5.fA (mV nG.gR.bw 113 c4 s6 tU 17 z9.gm 97 an np.i9 (J rH.hM.gT 82 cV.f8 (d2 kS.bl.pm.bm)) (gV g9.ae.aj 73 c7.fo 157 dI.e1 136 c7.fU (nA il.gZ 49 dM.p5 dM.p4 50 rR X 46 ad))) (aJ ro.cQ 55 xw 93 xD 89 cG.er (mR oL.eb.iF 4 dP.fo 114 hJ aE.eP 17 da.e1 (aT lW.ag.dm 11 c6.p1 1 c6.p0 2 dl.e7)) (j4 H.e0.aI.bu (aG bK.bu.iG))))) (c3 bq (N fY.aO.bP.dh 59 z4.eB (nd (uT kj.cd.ae.aC 11 z8.f9 111 nY oZ 80 pw dZ 76 eM) (nd (zT qi.aj 23 ct.f9 102 ct.p9 76 ct.ga) (fJ k9.mv.aI) (ac rs.bz 84 d1.eB)) (hX kZ.eN.cR.aS 11 cA.fL 74 cN.gj 118 lJ bq (ms kn))) (dR af.bg (ck ao.aF.aC (lf (rP eE sd rh 24 (aM cD dE e_) 65 (aM cF dE e_) e_))) (gW oG.b6.cd.bi.cd.b8.bw 68 ve jw jD 17 c8.fz 121 di.gl bO (bk aY.gY)))) (d3 ad (pQ ao.Do (ng ma.aC 11 dy.ft 85 c9.p1 38 dy.f4 (aG iS.fQ)) (gy ak.pE.eC (aK jX))) (dQ uV.a0 159 cy.ex 71 cP.fi 116 lo 14 cP.eH (ek kZ.eN.cR.b6 114 lJ jN 1 di.gk 2 di.er (iO K.iG.bl.hU.gE.cw 240 ap K.iG.mv.bI)) (fh qY.ag e_ 108 bv kx.aO 1 cN.fN bd 2 cN.fT e_ (ac aY.wk.eV.eV.dK.fy 188 dY.ex)))))) (aR bd.eK (aJ ny.aS.S 135 z1.p6 145 z1.p5 29 z1.p7 (bU kc (aJ s7.cd.ag 67 z8.f8 1 z8.fz 2 z8.gl (dQ o0.S.cQ 135 ct.fo 136 ct.fU 133 cV.fu 130 cV.gO (aG hQ.fQ) (lf (rP l4 wU By 32 (aM cD fB e_) 145 (aM cF fB e_) aP))) (iw oj.ag.bi.ae 90 wB aQ 77 xn k0 73 jZ (bM rL.fj.aF 188 ap iY.mu.av aE.Ga.mu.av aP.iH.mu.av 1 cO.f6))) (dR H.iI (aW jt.bH (ac iQ.bP.dt 334 dl.fu)) (o8 jS.aS.ho 115 cI.gv cI.fq 214 c8.fN 75 cS.p9 j (ac d4.bi.hL.dx 156 cT.gm)))) (nm ah.A7 (cu j3.dm.bw 114 c4 g5.aO gq.aO k6.aO 19 z9.p2 (bA ma.eN 102 cV.fM 17 cV.fx 25 cV.gn (dc b4.zh.vz)) (gz tB.eP.S 141 et bq.bP 92 iK ah.cJ 88 aU.cJ (lf (rP fk iC zG 20 (aM cD kD e_) 25 (aM cF kD e_) aP)))) (az tL.aX 28 cq.gg 50 vu 46 cq.eS (aW aU.iv (ac cX.kB.ib.gE.cw 82 dl.fK)) (fV tb.ia.S 176 c8.p6 85 c0.gK 29 c0.fp (bM eI.cz.gR.ag 77 jc dk nE tW 1 dY.gO))))) (nd (rP qu iC By 28 (aM cD hI e_) 105 (aM cF hI e_) bd) (nd (kH ah) (om nF.aS 11 z9.fo 75 an H.i9 103 c4 bq (qw oQ.bl.aS 4 cB.eY 106 cB.ga 97 dy.eH (lf (qP lU.aS.b2 4 vh 141 lA ah 137 aU)) (dd n3.S aA 159 d9.fC)) (iw os.bm.cf 159 l0 aN 82 v6 X 78 ad (ac oN.bo 305 cU.fU))) (nd (qp wf.cK 98 xC L 56 wK K 52) (aZ (pk lK.eP.aD 135 dj.hH 231 ca qz.bI 71 dj.gL 67 dy.p5 j) (al fY.hL.bH.bH)) (ix rD.Cv.bm (aG af.hK.iG)))) (ef lO.ik.aX 107 wA k0 jZ 56 nX bF 52 bE (bS jU.aF (J au.vz.aI.db 73 dy.fL (aK pT.io)) (aW ut.aD (aK jV))) (nd (lz h9.EZ.FT) (gW m1.bw 83 bN rE.bI rN.bI 17 di.p4 80 ca lT.bl (bC k4.bQ.ag.ho 183 ap cX.sl.hL.bI cl.sl.hL.bI 137 vl cg 133 b3)) (bA tK.q6.dm 11 dI.gj 1 dI.f5 2 dI.hH (g4 gs.a0 42 dY.p4 155 dY.p3 14 dY.p2))))))) +def Dv : ab dp:=(c3 dz.bI (hS mj.jq 4 H3 50 Ic 46 H7 (aR eM.bP (aR pd (bc aU.bu (N d8.i0.bo 66 cy.fL (bk oS.ae.eh) (lf (qG cC))) (aZ (q2 jg.aS.aF.aj 23 da.gk 517 mJ aH.cR 501 m4 497 rD) (ff ph.a0.bP.g6 140 dL.eY 254 dL.p2 1 dL.eS))) (bU L.bu (aW lk.nT (ij m1.fg 99 bN d8.g8 84 ca aY.cY 80 aQ.cY)) (gz Ag.cx.aF.aX 73 ep L.pE.n2 128 iq ar.bg.jd 124 ao.bg.jd (aT lO.bH.bi.b8 52 cU.eH 1 cU.f8 2 cU.fz)))) (d3 aP.cH (o2 l9.S 85 an bt.i9 113 c4 dk 109 e6 (ej k4.cx.ae 188 bN h5.fF d4.fF 69 cV.ev 65 cV.eZ (bC tw.bP.cs 94 bN lk.bl.fF kS.bl.fF 119 ca eQ.cR.bI 115 dz.cR.bI)) (du n3.ia.b2.eV.bg 150 cS.eu au X ad 78 xz aN (e5 dF.dv 50 cO.p4 109 cO.p2 K 105 L))) (hi uI.aI.bg 119 Aq pA 60 pq (aW b1.bi.nT (hT uc.aI.S.S 80 yu ki 165 l0 dk 161 e6)) (J aw.pG.hU.bP.eV.dK.fy 188 c8.p3 (bk nC.gY))))) (dQ j7.dJ 110 z2.eW 15 z2.eH 1 z2.f8 2 z2.fz (bU ld.bQ (om j3.aS 11 z8.fC 120 r6 gf 68 an bt.ce (eg tt.b6.ag 75 xc jN 1 cB.fP 2 cB.gK (fJ jH.mv.aI) (ml e6)) (aZ (ww hQ.ec) (aT mU.dm.dm 11 cO.gn 1 cO.eA 2 cO.f9))) (N jH.iH.ib.bo 57 cG.eY (bA j8.aX.bP 132 dj.eZ 1 dj.fo 2 dj.fU (bM iu.dB.aj 97 hD iZ.cJ iY.cJ mW.cJ 143 dT.fC)) (J ka.aO.bi.hL.dx 156 c8.fE (dc ju)))) (rz gU.aX 122 z6.eu 40 z2.gm ak 36 af (eJ aE.bP.gY (bT aH.rG.aI.hV 199 et aP.aO (mg k8.eb.cQ.aC 11 ds.p3 66 wS aH 172 vc dZ 168 eM)) (aZ (lZ sV.bH.bi.aD 53 c7.fC c7.gv 143 cA.fo aw) (fW hQ))) (fR uV.ec 67 cP.fP 144 cy.fU 1 cP.gK (J bt.xY.r5.eF 174 cA.eH (al af.aX.a0.hK)) (de ak.cx.gY.gD (co aY.bg.eK)))))) (az gF.cz.aS 4 z1.f6 57 z1.fP 53 z1.gK (aR e6.bl (bU H.bP (lj nx.eP.S 95 z8.fp e_ 95 z8.ft e_ 114 zZ e_ 110 z7.ev aP (oq qI.xM (iO aw.bQ.bV.rG.bm.bz 114 dX k9.bl.bg) (la d5.ag 46 d9.p7 d9.p6 d9.p5 1 d9.p4)) (bA ii.b6.dm 11 da.fx 1 da.gn 2 da.eA (lf (sN rL.gR.bg 36 dL.p5 230 ap aE.mv.aI.av 38 dL.p4 192 ki.eC.av)))) (fR uy.cQ 47 c5.gL 109 cG.ft 31 c5.p9 (aZ (lZ ma.a0 106 As c9.eY 103 hJ bt) (cp d5.b2.ae.aj 193 c6.ez c6.fK 78 c6.fN)) (md bd.kl.cR.bg.cR.a0 64 cI.eu 126 iz j5.kv.iH 141 cI.ez (lf (oP k8.aS.ia 4 cU.p1 54 cU.p0 50 cT.ex))))) (lC cF vr fY.bu (nd (q2 rA.ag.aj 23 z9.p6 124 an uN.b0 108 H.bP.b0 104 uj.b0) (J L.cR.bV.fd 159 cV.gH (mb oY.ag.aS 4 cN.fT 114 bv qR.aO 110 tN.aO)) (gV ii.b6.bw 109 c7.fm 269 c0.gn 19 c7.gH (ac iS.bo 783 cU.f9))) (eg sQ.b8 102 wy jH 1 cq.p7 2 cq.p6 (hX ma.aD 35 dP.eA 148 da.f9 71 c9.fx aw (iO my.kB.ib.gE.cw 244 ap my.xM.fF)) (de mq.hK.gD (em nB.a0.cs 197 dY.fi dY.eW 598 dY.fK 594 dY.fN))))) (nd (rP j2 wU By 24 (aM cD f7 e_) 65 (aM cF f7 e_) aP) (az nM.S.a0 96 z4.p6 119 z4.ga 14 z4.p5 (eg fc.eN.cR.b8.b8 101 an kx.b0 1 z9.ft 2 z9.f4 (o2 tx.aj.ae 78 ep af.aS 62 dX ak.zh 58 af.zh (iL u0.cd.aD 172 b7 bj.ym.ae br.ym.ae 71 ds.eW 67 ds.eH) (dd yO aA 115 d9.fz)) (m5 mY.bu (lf (wE kQ.kl 52 sj 165 zx aE 14 dM.f4)))) (nd (pW ii.aX 58 xn 248 et aH 83 fe 79 wB) (jW pV.dJ.aX.aF.aD 55 dj.gd 168 iB ul.Ej.kB 180 dy.fx aw (bC l8.iI.cz.S 193 jK cg b3 149 mK ah 145 aU)) (J vZ.pG.kY.eF 75 c8.gH (eo hY.S.a0 162 dq.fo 82 zp aE 14 dq.fU)))) (bc b1.fy (gI gs.iI.b2 4 dn.p3 72 fG ox 68 m3 (ej wr.aX 89 xl K L 58 dy.f8 54 wz (ac bt.ni.vC.Eg.fy.bz 82 dT.gK)) (aZ (pk u5.b8.bw 147 c7.hH 232 bN aH.d6 17 c7.gL 81 rV bO) (aT fc.aX.bP 45 cL.f5 1 cL.hH 2 cL.gL))) (N kJ.o6.eD.aI 53 cP.p3 (bT jw.kY.sy.cJ.aO.aO 500 ts cX (aG jH.aC.S.gB)) (ck oN.fQ (lf (yC hR.S 98 dY.gj dY.f5 dY.hH 43 ep)))))))) +def DT : ab dp:=(d3 cX (bc aV (az sJ.a0 59 z1.fC 107 z1.gg 14 z1.gv (bS aV.bm (nd (oi m2.kl 98 sf aN 139 AI dV 14 z7.fM) (N j.G7.hM.gT 82 cy.fx (ac b4.zh.jd.eD.kk 221 dI.p8) (fb cD FW bd)) (bD oj.b2.dv 116 sh k0 jZ 77 hJ aY 73 aQ (i7 mZ.bH.g0 186 ap nC.av nH.av 17 dL.gn 96 ey aH.cY))) (nd (sN iT.eb.gR.bg 36 c5.gH 123 fG dN.eC.aD 38 c5.gm 85 bt.rG.bw) (J bK.bm.bV.fd 159 c9.fT (bC sO.e0.cQ 80 pu h5 d4 185 b7 aY.cK 181 aQ.cK)) (J vR.jd.eD.kk 221 cI.f4 (aG d0.aC)))) (nm np (aJ nF.ik 11 z9.fq 1 z9.gb 2 z9.gd (J oB.FH.ib.bo 529 da.f4 (ac lP.r5.iv.bm.dx 164 dr.p3)) (aZ (ry qf.ag 134 lA 1 vh 2 c0.gg) (cp dF.g0 50 cL.fK cL.fN 19 cL.ex))) (nd (qL cZ.eV.bp 86 cq.fE 54 cq.fD 50 cq.gL) (dG aP.fj.cH (aG rH.eK.ce)) (ck e_.aO.fQ (em pc.dJ.b8.bw 589 dY.fA dY.eu 17 dq.eA 204 dq.p3))))) (c3 ox (pL gU.dJ.aj 23 z4.gm 118 z4.fC z4.gv 92 z4.fq (k2 nF.b6 99 c4 jN 1 z8.p9 2 z8.p8 (dQ oL.aX 35 cB.fU 94 cB.fi 62 cB.eW 58 Ah (pM qy.e0.iF 4 dI.fx 191 jK H 17 dr.p9) (dd cZ.b6 aA 9 cO.ft)) (du qh.bi.aD 60 u2 g5 gq k6 190 lm kc (cp tv.bw 43 dM.fo jc 19 dM.fi))) (qw ko.bl.aS 4 cG.p3 60 cG.gv 51 cM.fL (fV Cz.ja.ae 140 dj.ez 323 cA.eS 320 cA.fm (mb rr.cz.aS 4 dT.p6 115 bv uO.aO 111 oX.aO)) (j4 e_.xE.aI.bu (bk bq.gY)))) (d3 L (eJ d8.gY (J bt.cd.aI.db 126 dy.fu (ml uU.cH)) (J aE.kB.aF.eD.kk 66 c7.gd (e5 h3.fg 57 cL.gK 94 rX bF 90 bE))) (nd (qp eI.bu.gR.aX 73 r7 L 246 yv K 242) (gV k4.cx.eN 125 di.gm 133 di.fC 19 di.gv (aT eI.b8.dm.cJ.ag.dm 11 dL.f4 1 dL.fE 2 dL.fD)) (iw oV.S 106 bv bt.aO 79 ch g2 75 kg (lb bj.ib.bg)))))) (eL aE.r5.aF (N bK.bu.dh 269 Fz (bU ke (lj m8.jq.cs 103 z8.er e_ 104 z8.eB e_ 104 kw m4.bI 100 kw sW (aJ ou.e0.b8 51 ct.fK 1 cy.fp 2 ct.fN (d2 rH.vC.bm) (dc ci)) (bA n1.b6 65 cA.f6 1 cA.fP 2 cA.gK (bC mZ.bH.b6.ho 194 ap ar.nj.eK.av ao.nj.eK.av 144 ey dN.aX.cv 140 ie.aX.cv))) (N bE.bu.cw 180 cG.ev (bT jv.vS.hM.bu.dK.fy 122 iB jv.o6.kB (fJ o7.ya.eC)) (ix rN.Cv.bm (bk dZ.gY)))) (N jN.eV.bz 46 z6.e7 (gA qV.it 100 an dO.cQ.ce cj.cQ.ce dS.cQ.ce 124 c4 lR.aO (J e_.eV.gE.bz 552 mJ (co H.AW.bl.ec)) (kN jx.eV.fj.S 158 y6 au X ad 86 da.p1 (ms g7))) (dQ ta.bw 175 cP.p6 416 ct.eH 17 cq.gn 159 cq.eA (aZ (qP ii.aX.b2 4 vp 95 fe hW 91 ld) (h6 oV.S.a0 118 bv oN.aO 109 ch au.ce 14 dl.eY)) (aZ (lL vg.b2.aj.ae.aj.gR.bg 36 c7.gk 111 c8.p2 H 38 c7.er 73 vj qc) (lc gr.gC.iF 11 dY.fE 118 dY.fD 273 dY.eB 17 dY.fu))))) (aJ i3.b8 49 z3.gK 1 z3.fp 2 z3.ft (bc e3.eV (om qV.jq 11 z9.f8 120 an e_.ae.ce 108 c4 fY.fy (N aP.cH.o6.eD.aI 56 ct.fP (aG gu.fQ) (dd d5.b6 aB 301 FO.e7)) (eG pS.eV.ja.ag 87 mG ah bK ea 1 cS.e7 (ff iA.a0.ag 48 dM.ga 235 cL.gj 1 dM.gj))) (az zC.hL.S 123 cq.fo 96 cM.eY 150 cq.fi (aW q7.aD (lb fY.bg.pG.bg)) (aZ (wI ql.dm.cd.aX.bl.aD 65 c8.gn 230 cN.gL 154 cI.p2 aw) (ff i4.b6.b6.bg 56 cT.fL 450 dY.fo 81 dq.ez)))) (bc Bg (ei oW.ec.aD 47 c5.ev c5.eZ 63 c5.fo 26 c5.fU (bD jx.cf.aj 219 un bF bE 76 pn jt 72 gX (ac qM.bP.dt 334 dl.ft)) (aW dk.nT (bk gu))) (N t5.k7.fy 64 cy.fD (bT bq.bQ.xY.bu.dK.fy 131 je aw.iF.cH (aG bd.h8.S.gB)) (du tr.cx.bi.S 68 ca dO.bl gu uf 83 bN l6.bI (ji fI))))))) +def mC : ab dp:=(pj iA.eP.bg 100 z9 225 dn (hS hY.aj 16 z3 52 z4 48 z5 (pj d5.ag 46 c5 1 cG (im kO (pj il.ec.bQ 19 dj 17 dP EI FE) (hS cZ.ec.aD 38 c0 63 dI 26 di Fw Fb)) (im kW (im dS EY EU) (hS h3.a0.aj 89 c6 98 dl 94 dL Es E4))) (im d8 (nd (Br fa.jq.iF fY 4 cP e_ 17 cy e_) (nd (ws fY) Fc EL) (c3 ob Dz Ds)) (pj i1.ag 44 dy 1 c9 (nd (rP l4 wU By 32 (aM cD fB e_) 145 (aM cF fB e_) bd) DC Dt) (c3 b3 DR DE)))) (az hY.aS 4 z6 52 z7 48 z8 (im fX (im tE (az j0.dK.aX 28 di 44 da 40 cA DV DB) (pj cZ.dK.aF 42 dr 1 ds DO DU)) (az jS.S 178 ct 51 cB 47 cV (nd (xb jN) DJ DA) (bc np DM DQ))) (pj d5.aj 16 cM 50 cq (hS tp 224 dT 121 cS 200 cI (im cj DG DD) (c3 oo DK DS)) (im cg (az fk.ec.aX 40 c8 29 cN 60 c7 DN DF) (nd (yE j2 24 65) Dv DT))))) +def bx : dp→Bool:=sg mC +theorem DY : ay bx EI = true := by decide +kernel +theorem Em : ay bx FE = true := by decide +kernel +theorem D6 : ay bx Fw = true := by decide +kernel +theorem Eh : ay bx Fb = true := by decide +kernel +theorem Ed : ay bx EY = true := by decide +kernel +theorem D3 : ay bx EU = true := by decide +kernel +theorem D8 : ay bx Es = true := by decide +kernel +theorem D0 : ay bx E4 = true := by decide +kernel +theorem Eb : ay bx Fc = true := by decide +kernel +theorem D5 : ay bx EL = true := by decide +kernel +theorem Dl : ay bx Dz = true := by decide +kernel +theorem Di : ay bx Ds = true := by decide +kernel +theorem C6 : ay bx DC = true := by decide +kernel +theorem Dh : ay bx Dt = true := by decide +kernel +theorem Dg : ay bx DR = true := by decide +kernel +theorem CW : ay bx DE = true := by decide +kernel +theorem CL : ay bx DV = true := by decide +kernel +theorem Dd : ay bx DB = true := by decide +kernel +theorem C7 : ay bx DO = true := by decide +kernel +theorem Df : ay bx DU = true := by decide +kernel +theorem C8 : ay bx DJ = true := by decide +kernel +theorem De : ay bx DA = true := by decide +kernel +theorem CU : ay bx DM = true := by decide +kernel +theorem CJ : ay bx DQ = true := by decide +kernel +theorem CY : ay bx DG = true := by decide +kernel +theorem C0 : ay bx DD = true := by decide +kernel +theorem Dc : ay bx DK = true := by decide +kernel +theorem C3 : ay bx DS = true := by decide +kernel +theorem C1 : ay bx DN = true := by decide +kernel +theorem Dj : ay bx DF = true := by decide +kernel +theorem CS : ay bx Dv = true := by decide +kernel +theorem Dk : ay bx DT = true := by decide +kernel +theorem ew (x:dp) {l r : ab dp} + (hx : bx x = true) (hl : ay bx l = true) (hr : ay bx r = true) : + ay bx (nd x l r) = true := by + change (bx x&&ay bx l&&ay bx r) = true + rw [hx,hl,hr]; rfl +theorem A0 : ay (sg mC) mC = true := + (ew (oI iA.eP.bg 100 z9 225 dn) (by decide +kernel) (ew (m0 hY.aj 16 z3 52 z4 48 z5) (by decide +kernel) (ew (oI d5.ag 46 c5 1 cG) (by decide +kernel) (ew (km kO) (by decide +kernel) (ew (oI il.ec.bQ 19 dj 17 dP) (by decide +kernel) DY Em) (ew (m0 cZ.ec.aD 38 c0 63 dI 26 di) (by decide +kernel) D6 Eh)) (ew (km kW) (by decide +kernel) (ew (km dS) (by decide +kernel) Ed D3) (ew (m0 h3.a0.aj 89 c6 98 dl 94 dL) (by decide +kernel) D8 D0))) (ew (km d8) (by decide +kernel) (ew (Br fa.jq.iF fY 4 cP e_ 17 cy e_) (by decide +kernel) (ew (ws fY) (by decide +kernel) Eb D5) (ew (q1 ob) (by decide +kernel) Dl Di)) (ew (oI i1.ag 44 dy 1 c9) (by decide +kernel) (ew (rP l4 wU By 32 (aM cD fB e_) 145 (aM cF fB e_) bd) (by decide +kernel) C6 Dh) (ew (q1 b3) (by decide +kernel) Dg CW)))) (ew (og hY.aS 4 z6 52 z7 48 z8) (by decide +kernel) (ew (km fX) (by decide +kernel) (ew (km tE) (by decide +kernel) (ew (og j0.dK.aX 28 di 44 da 40 cA) (by decide +kernel) CL Dd) (ew (oI cZ.dK.aF 42 dr 1 ds) (by decide +kernel) C7 Df)) (ew (og jS.S 178 ct 51 cB 47 cV) (by decide +kernel) (ew (xb jN) (by decide +kernel) C8 De) (ew (AO np) (by decide +kernel) CU CJ))) (ew (oI d5.aj 16 cM 50 cq) (by decide +kernel) (ew (m0 tp 224 dT 121 cS 200 cI) (by decide +kernel) (ew (km cj) (by decide +kernel) CY C0) (ew (q1 oo) (by decide +kernel) Dc C3)) (ew (km cg) (by decide +kernel) (ew (og fk.ec.aX 40 c8 29 cN 60 c7) (by decide +kernel) C1 Dj) (ew (yE j2 24 65) (by decide +kernel) CS Dk))))) +def u4 (idx:Pos) (q w : List Bool) : Bool := + match ig mC idx with + | none => false + | some x => + let y:=fw x + let z:=hG q .qB w + CK y.state z.state&&lp y.front z.front&&lp y.past z.past +theorem am (idx:Pos) (q w : List Bool) + (h : u4 idx q w = true) (r:ai) : + cE (BL (bf default (be q)) (be w+>r)) lr := by + unfold u4 at h + rcases hx : ig mC idx with _ | x + · rw [hx] at h; contradiction + · rw [hx] at h + dsimp only at h + simp only [Bool.and_eq_true,zY,oF] at h + rcases h with ⟨⟨hs,hf⟩,hp⟩ + have heq : fw x = hG q .qB w := by + rcases h1 : fw x with ⟨p1,f1,s1⟩ + rcases h2 : hG q .qB w with ⟨p2,f2,s2⟩ + rw [h1,h2] at hs hf hp + dsimp only at hs hf hp + subst hs hf hp + rfl + have hs_g:=Bm mC A0 idx x hx r + rw [heq,pF] at hs_g + exact hs_g +theorem A4 (d:cm) (us : List W) : + cn d us = bf default (be ([false]++bW d++bG us)) := by + unfold cn + simp [yh] +theorem xW : r9 := by + intro d a b c r + rw [A4 d [a,b,c]] + cases d <;> cases a <;> cases b <;> cases c + · exact ⟨am d1.fK ([false]++bW cD++bG kD) aA (by decide +kernel) r,am d1.fN ([false]++bW cD++bG kD) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.ex ([false]++bW cD++bG f7) aA (by decide +kernel) r,am d1.fL ([false]++bW cD++bG f7) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.gg ([false]++bW cD++bG nQ) aA (by decide +kernel) r,am d1.eY ([false]++bW cD++bG nQ) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.eS ([false]++bW cD++bG vY) aA (by decide +kernel) r,am d1.fm ([false]++bW cD++bG vY) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.gH ([false]++bW cD++bG dE) aA (by decide +kernel) r,am d1.gm ([false]++bW cD++bG dE) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.fC ([false]++bW cD++bG hI) aA (by decide +kernel) r,am d1.gv ([false]++bW cD++bG hI) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.fq ([false]++bW cD++bG mD) aA (by decide +kernel) r,am d1.gb ([false]++bW cD++bG mD) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.fM ([false]++bW cD++bG fB) aA (by decide +kernel) r,am d1.fx ([false]++bW cD++bG fB) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.eA ([false]++bW cF++bG kD) aA (by decide +kernel) r,am d1.f9 ([false]++bW cF++bG kD) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.ga ([false]++bW cF++bG f7) aA (by decide +kernel) r,am d1.gj ([false]++bW cF++bG f7) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.f5 ([false]++bW cF++bG nQ) aA (by decide +kernel) r,am d1.hH ([false]++bW cF++bG nQ) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.gL ([false]++bW cF++bG vY) aA (by decide +kernel) r,am d1.p9 ([false]++bW cF++bG vY) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.p8 ([false]++bW cF++bG dE) aA (by decide +kernel) r,am d1.p7 ([false]++bW cF++bG dE) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.p6 ([false]++bW cF++bG hI) aA (by decide +kernel) r,am d1.p5 ([false]++bW cF++bG hI) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.p4 ([false]++bW cF++bG mD) aA (by decide +kernel) r,am d1.p3 ([false]++bW cF++bG mD) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ + · exact ⟨am d1.p1 ([false]++bW cF++bG fB) aA (by decide +kernel) r,am d1.p0 ([false]++bW cF++bG fB) [false,false,true,true,true,false,true] (by decide +kernel) r⟩ +end + + + +@[expose] public section + +theorem is_does_not_halt : IsNotHalt target_tm := + BusyBeaver.Excursion.does_not_halt_of_advances CZ + ⟨.CD, [.UA, .UT, .UT], _, by decide, rfl⟩ (zb xW) + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RB1RF_1RC1RA_1LD0LA_HHH0LE_0LF1LE_0RA0LC diff --git a/BusyBeaver/BB6/NonHalt/M_1RBHHH_0LC1RF_1LE0RD_0RB1RC_1RD0LE_0RC1RA.lean b/BusyBeaver/BB6/NonHalt/M_1RBHHH_0LC1RF_1LE0RD_0RB1RC_1RD0LE_0RC1RA.lean new file mode 100644 index 00000000..e936c6e0 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RBHHH_0LC1RF_1LE0RD_0RB1RC_1RD0LE_0RC1RA.lean @@ -0,0 +1,49 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.BB6.NonHalt.M_1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RCHHH + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RBHHH_0LC1RF_1LE0RD_0RB1RC_1RD0LE_0RC1RA + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_0LC1RF_1LE0RD_0RB1RC_1RD0LE_0RC1RA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +def stateMap_m0792 : Fin 6 → Fin 6 + | 0 => 4 -- m0792 state A + | 1 => 3 -- m0792 state B + | 2 => 1 -- m0792 state C + | 3 => 2 -- m0792 state D + | 4 => 5 -- m0792 state E + | 5 => 0 -- m0792 state F + +public section + +theorem is_not_halt : IsNotHalt target := by + exact Counter.does_not_halt_of_conj_stem + (M_tgt := target) + (M_src := BusyBeaver.M_1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RCHHH.target) + (σ := stateMap_m0792) (f := false) + (c₁ := (default : ListBlank (Fin 2)) {{5}}> default) + (by decide) (Counter.init_reaches_conjCfg_default rfl) + BusyBeaver.M_1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RCHHH.is_not_halt_from_0792 + +end + +end BusyBeaver.M_1RBHHH_0LC1RF_1LE0RD_0RB1RC_1RD0LE_0RC1RA diff --git a/BusyBeaver/BB6/NonHalt/M_1RBHHH_0RC0LD_1RD1RC_1LB0LE_1LF0RA_0LD1LA.lean b/BusyBeaver/BB6/NonHalt/M_1RBHHH_0RC0LD_1RD1RC_1LB0LE_1LF0RA_0LD1LA.lean new file mode 100644 index 00000000..2dff6fd6 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RBHHH_0RC0LD_1RD1RC_1LB0LE_1LF0RA_0LD1LA.lean @@ -0,0 +1,49 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.BB6.NonHalt.M_1RB0RD_0LC0RA_1LA1LC_1RE0LF_0RA1RF_1LBHHH + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RBHHH_0RC0LD_1RD1RC_1LB0LE_1LF0RA_0LD1LA + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_0RC0LD_1RD1RC_1LB0LE_1LF0RA_0LD1LA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +def stateMap_m0725 : Fin 6 → Fin 6 + | 0 => 3 + | 1 => 1 + | 2 => 2 + | 3 => 4 + | 4 => 5 + | 5 => 0 + +public section + +theorem is_not_halt : IsNotHalt target := by + exact Counter.does_not_halt_of_conj_stem + (M_tgt := target) + (M_src := BusyBeaver.M_1RB0RD_0LC0RA_1LA1LC_1RE0LF_0RA1RF_1LBHHH.target) + (σ := stateMap_m0725) (f := true) + (c₁ := (default : ListBlank (Fin 2)) {{5}}> default) + (by decide) (Counter.init_reaches_conjCfg_default rfl) + BusyBeaver.M_1RB0RD_0LC0RA_1LA1LC_1RE0LF_0RA1RF_1LBHHH.is_not_halt_from_0559 + +end + +end BusyBeaver.M_1RBHHH_0RC0LD_1RD1RC_1LB0LE_1LF0RA_0LD1LA diff --git a/BusyBeaver/BB6/NonHalt/M_1RBHHH_0RC0RA_1RD1RC_1LE1LF_0LB0LD_0LE0RC.lean b/BusyBeaver/BB6/NonHalt/M_1RBHHH_0RC0RA_1RD1RC_1LE1LF_0LB0LD_0LE0RC.lean new file mode 100644 index 00000000..1588e58c --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RBHHH_0RC0RA_1RD1RC_1LE1LF_0LB0LD_0LE0RC.lean @@ -0,0 +1,49 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.BB6.NonHalt.M_1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RBHHH_0RC0RA_1RD1RC_1LE1LF_0LB0LD_0LE0RC + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_0RC0RA_1RD1RC_1LE1LF_0LB0LD_0LE0RC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +def stateMap_m0724 : Fin 6 → Fin 6 + | 0 => 2 + | 1 => 3 + | 2 => 4 + | 3 => 1 + | 4 => 5 + | 5 => 0 + +public section + +theorem is_not_halt : IsNotHalt target := by + exact Counter.does_not_halt_of_conj_stem + (M_tgt := target) + (M_src := BusyBeaver.M_1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH.target) + (σ := stateMap_m0724) (f := false) + (c₁ := (default : ListBlank (Fin 2)) {{5}}> default) + (by decide) (Counter.init_reaches_conjCfg_default rfl) + BusyBeaver.M_1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH.is_not_halt_from_0713 + +end + +end BusyBeaver.M_1RBHHH_0RC0RA_1RD1RC_1LE1LF_0LB0LD_0LE0RC diff --git a/BusyBeaver/BB6/NonHalt/M_1RBHHH_0RC1LF_0RD1RB_1LE1RC_0LB0LE_0LE0LA.lean b/BusyBeaver/BB6/NonHalt/M_1RBHHH_0RC1LF_0RD1RB_1LE1RC_0LB0LE_0LE0LA.lean new file mode 100644 index 00000000..65c1bee7 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RBHHH_0RC1LF_0RD1RB_1LE1RC_0LB0LE_0LE0LA.lean @@ -0,0 +1,48 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.BB6.NonHalt.M_1RB1LD_0RC0RB_0LD1RE_0LA1LC_0RB0RF_1LCHHH + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RBHHH_0RC1LF_0RD1RB_1LE1RC_0LB0LE_0LE0LA + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_0RC1LF_0RD1RB_1LE1RC_0LB0LE_0LE0LA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +def stateMap_m0715 : Fin 6 → Fin 6 + | 0 => 3 -- m0715 state A + | 1 => 4 -- m0715 state B + | 2 => 1 -- m0715 state C + | 3 => 2 -- m0715 state D + | 4 => 5 -- m0715 state E + | 5 => 0 -- m0715 state F + +public section + +theorem is_not_halt : IsNotHalt target := by + exact Counter.does_not_halt_of_conj_stem + (M_src := BusyBeaver.M_1RB1LD_0RC0RB_0LD1RE_0LA1LC_0RB0RF_1LCHHH.target) + (σ := stateMap_m0715) (f := true) + (c₁ := (default : ListBlank (Fin 2)) {{5}}> default) + (by decide) ⟨0, rfl⟩ + BusyBeaver.M_1RB1LD_0RC0RB_0LD1RE_0LA1LC_0RB0RF_1LCHHH.is_not_halt_from_0715 + +end + +end BusyBeaver.M_1RBHHH_0RC1LF_0RD1RB_1LE1RC_0LB0LE_0LE0LA diff --git a/BusyBeaver/BB6/NonHalt/M_1RBHHH_0RC1LF_1LC1LD_1RE0RA_0RD1RF_0LD0LF.lean b/BusyBeaver/BB6/NonHalt/M_1RBHHH_0RC1LF_1LC1LD_1RE0RA_0RD1RF_0LD0LF.lean new file mode 100644 index 00000000..2fd1c830 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RBHHH_0RC1LF_1LC1LD_1RE0RA_0RD1RF_0LD0LF.lean @@ -0,0 +1,1313 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RBHHH_0RC1LF_1LC1LD_1RE0RA_0RD1RF_0LD0LF + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_0RC1LF_1LC1LD_1RE0RA_0RD1RF_0LD0LF" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {zG_ zL_ α β γ : Type*} [Inhabited zG_] [Inhabited zL_] +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +local notation "zB" => ListBlank (Fin 2) +local notation "zF" => List (Fin 2) +set_option maxHeartbeats 8000000 +@[simp] theorem zMz (M : Machine zG_ zL_) (config : Cfg zG_ zL_) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine zG_ zL_) (config : Cfg zG_ zL_) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine zG_ zL_) (config : Cfg zG_ zL_) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : zB).head = 0 := rfl +@[simp] theorem zDt : (default : zB).tail = default := rfl +@[simp] theorem append_nil (s : zB) : ([] : zF) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : zF) (s : zB) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l₁ l₂ : zF) (s : zB) : + (l₁ ++ l₂) +> s = l₁ +> (l₂ +> s) := by + induction l₁ with + | nil => rfl + | cons a l₁ ih => simp [ih] +set_option maxHeartbeats 8000000 +@[simp] theorem zPz (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem z01 (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +theorem pow_add (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp [Nat.zero_add] + | succ m ih => simp [z01,Nat.succ_add,ih,List.append_assoc] +theorem z02 (l : List α) (n : Nat) : l ^ n ++ l = l ^ (n + 1) := by + induction n with + | zero => simp [z01] + | succ n ih => simp [z01,List.append_assoc,ih] +theorem z03 (x : α) (n : Nat) : ([x] : List α) ^ (n * 2) = [x,x] ^ n := by + induction n with + | zero => rfl + | succ n ih => + have h1 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h1,pow_add,ih] + rfl +theorem z04 (x : α) (n : Nat) (ys : List α) : [x] ^ n ++ x :: ys = [x] ^ (n + 1) ++ ys := by + have h : x :: ys = [x] ++ ys := rfl + rw [h,<- List.append_assoc,z02] +theorem zSm {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + (tm : Machine zG_ zL_) (c_1 c_2 : Cfg zG_ zL_) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z05 {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + (tm : Machine zG_ zL_) (c_1 c_2 : Cfg zG_ zL_) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + (tm : Machine zG_ zL_) (c_1 : Cfg zG_ zL_) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + (tm : Machine zG_ zL_) (c_1 c_2 c_3 : Cfg zG_ zL_) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem z06 {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} (c : Cfg zG_ zL_) : c [tm]⊢* c := ⟨0,rfl⟩ +theorem zPs {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 : Cfg zG_ zL_} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem zSt {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 c_3 : Cfg zG_ zL_} + (h₁ : c_1 [tm]⊢* c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢* c_3 := by + obtain ⟨n,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z07 {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 c_3 : Cfg zG_ zL_} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z08 {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 c_3 : Cfg zG_ zL_} + (h₁ : c_1 [tm]⊢* c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le m_pos (Nat.le_add_left m n),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem zPt {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 c_3 : Cfg zG_ zL_} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := + z07 h₁ (zPs h₂) +theorem z09 {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 c_3 : Cfg zG_ zL_} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z07 (z05 tm c_1 c_2 h₁) h₂ +theorem z0a {c_1 c_1' c_2 c_2' : Cfg (Fin 2) (Fin 6)} + (h : c_1 [target_tm]⊢* c_2) (h₁ : c_1 = c_1') (h₂ : c_2 = c_2') : + c_1' [target_tm]⊢* c_2' := h₁ ▸ h₂ ▸ h +theorem z0b {c_1 c_1' c_2 c_2' : Cfg (Fin 2) (Fin 6)} + (h : c_1 [target_tm]⊢⁺ c_2) (h₁ : c_1 = c_1') (h₂ : c_2 = c_2') : + c_1' [target_tm]⊢⁺ c_2' := h₁ ▸ h₂ ▸ h +macro "finish" : tactic => + `(tactic| exact ⟨0,rfl⟩) +macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z09 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt,append_cons,append_nil]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) +abbrev z4 : zF := [0,0,0,0] +inductive Token where + | a + | b +deriving DecidableEq +@[simp] def tk : Token -> zF + | .a => [1,0] + | .b => [1,0,0] +@[simp] def rr : Token -> zF + | .a => [1,0] + | .b => [1,1,0] +@[simp] def em : Token -> zF + | .a => [1,0] + | .b => [0,1,0] +@[simp] def enc : List Token -> zF + | [] => [] + | t :: ts => tk t ++ enc ts +@[simp] def ems : List Token -> zF + | [] => [] + | t :: ts => em t ++ ems ts +@[simp] def z0c : List Token -> zB -> zB + | [],l => l + | t :: ts,l => z0c ts (l <+ rr t) +@[simp] theorem z0d (xs ys : List Token) : enc (xs ++ ys) = enc xs ++ enc ys := by + induction xs with + | nil => rfl + | cons x xs ih => simp [ih,List.append_assoc] +@[simp] theorem z0e (xs ys : List Token) : ems (xs ++ ys) = ems xs ++ ems ys := by + induction xs with + | nil => rfl + | cons x xs ih => simp [ih,List.append_assoc] +theorem z0f (ts : List Token) (n : Nat) : enc (ts ^ n) = (enc ts) ^ n := by + induction n with + | zero => rfl + | succ n ih => + have h : ts ^ (n + 1) = ts ++ ts ^ n := rfl + rw [h,z0d,ih,z01] +theorem z0g (ts : List Token) (n : Nat) : ems (ts ^ n) = (ems ts) ^ n := by + induction n with + | zero => rfl + | succ n ih => + have h : ts ^ (n + 1) = ts ++ ts ^ n := rfl + rw [h,z0e,ih,z01] +theorem z0h (l r : zB) : + (l {{D}}> [1,0,0,1,0,1] +> r) [target_tm]⊢* + ((l <+ rr .a) {{D}}> [1,0,0,1] +> r) := by + dsimp [rr,D]; execute +theorem z0i (l r : zB) : + (l {{D}}> [1,0,0,1,0,0] +> r) [target_tm]⊢* + ((l <+ rr .b) {{D}}> [1,0,0] +> r) := by + dsimp [rr,D]; execute +theorem ls (t : Token) (l r : zB) : + ((l <+ rr t) <{{D}} z4 +> r) [target_tm]⊢* + (l <{{D}} z4 +> em t +> r) := by + cases t <;> (dsimp [rr,em,z4,D]; execute) +theorem z0j (l r : zB) : + ((l <+ [1,1,1,0]) <{{D}} z4 +> r) [target_tm]⊢* + (l <{{D}} z4 +> [0,0,1,0] +> r) := by + dsimp [z4,D]; execute +theorem le1 (l r : zB) : + (l {{D}}> [0,0,0,0,0,1,0,1] +> r) [target_tm]⊢* + ((l <+ [0,1,0,1]) {{D}}> [1,0,0,1] +> r) := by + dsimp [D]; execute +theorem le0 (l r : zB) : + (l {{D}}> [0,0,0,0,0,1,0,0] +> r) [target_tm]⊢* + ((l <+ [1,0,1,0,1]) {{D}}> [1,0,0] +> r) := by + dsimp [D]; execute +theorem evG (l r : zB) : + (l {{D}}> [1,0,0,1,1] +> r) [target_tm]⊢⁺ + (l <{{D}} z4 +> [0] +> r) := by + dsimp [z4,D]; execute +theorem evT (l r : zB) : + ((l <+ rr .b) {{D}}> [1,0,0,0] +> r) [target_tm]⊢⁺ + (l <{{D}} z4 +> [0,0,1] +> r) := by + dsimp [rr,z4,D]; execute +theorem z0k (ts : List Token) (l r : zB) : + (l {{D}}> [1,0,0] +> enc ts +> [1] +> r) [target_tm]⊢* + (z0c ts l {{D}}> [1,0,0,1] +> r) := by + induction ts generalizing l r with + | nil => exact z06 _ + | cons t ts ih => + cases t with + | a => + cases ts with + | nil => exact z0h l r + | cons t2 ts2 => + cases t2 with + | a => exact zSt (z0h l ([0] +> enc ts2 +> [1] +> r)) (ih (l <+ rr .a) r) + | b => exact zSt (z0h l ([0,0] +> enc ts2 +> [1] +> r)) (ih (l <+ rr .a) r) + | b => + exact zSt (z0i l (enc ts +> [1] +> r)) (ih (l <+ rr .b) r) +theorem z0l (ts : List Token) (l r : zB) : + (l {{D}}> [1,0,0] +> enc (ts ++ [.b]) +> r) [target_tm]⊢* + ((z0c ts l <+ rr .b) {{D}}> [1,0,0] +> r) := by + have h1 := z0k ts l ([0,0] +> r) + have h2 := z0i (z0c ts l) r + refine zSt (z0a h1 ?_ rfl) h2 + simp +theorem z0m (ts : List Token) (l r : zB) : + (z0c ts l <{{D}} z4 +> r) [target_tm]⊢* + (l <{{D}} z4 +> ems ts +> r) := by + induction ts generalizing l r with + | nil => exact z06 _ + | cons t ts ih => + cases t <;> exact zSt (ih (l <+ _) r) (ls _ l (ems ts +> r)) +theorem z0n (ts : List Token) (l r : zB) : + (l {{D}}> [1,0,0] +> enc ts +> [1,1] +> r) [target_tm]⊢⁺ + (l <{{D}} z4 +> ems ts +> [0] +> r) := by + have h1 := z0k ts l ([1] +> r) + have h2 := evG (z0c ts l) r + have h3 := z0m ts l ([0] +> r) + exact z08 h1 (z07 h2 h3) +theorem z0o (ts : List Token) (l r : zB) : + (l {{D}}> [1,0,0] +> enc (ts ++ [.b]) +> [0] +> r) [target_tm]⊢⁺ + (l <{{D}} z4 +> ems ts +> [0,0,1] +> r) := by + have h1 := z0l ts l ([0] +> r) + have h2 := evT (z0c ts l) r + have h3 := z0m ts l ([0,0,1] +> r) + exact z08 h1 (z07 h2 h3) +theorem z0p (xs : List Token) : ems (.a :: xs) ++ [0] = enc (xs ++ [.b]) := by + induction xs with + | nil => rfl + | cons t xs ih => + have ih' : (1 : Fin 2) :: 0 :: (ems xs ++ [0]) = enc (xs ++ [.b]) := ih + cases t <;> { + dsimp [ems,em,enc,tk] + rw [<- ih'] + } +theorem z0q (xs : List Token) : ems (.b :: xs) ++ [0] = 0 :: enc (xs ++ [.b]) := by + have h := congrArg (List.cons (0 : Fin 2)) (z0p xs) + exact h +theorem z0r (ts : List Token) (r : zB) : + ∃ r',enc ts +> [1] +> r = [1] +> r' := by + cases ts with + | nil => exact ⟨r,rfl⟩ + | cons t ts => cases t <;> exact ⟨_,rfl⟩ +theorem z0s (ts : List Token) (t : Token) (r : zB) : + ∃ r',enc (ts ++ [t]) +> r = [1] +> r' := by + cases ts with + | nil => cases t <;> exact ⟨_,rfl⟩ + | cons x ts => cases x <;> exact ⟨_,rfl⟩ +theorem z0t (ys : List Token) (l r : zB) : + (l {{D}}> [0] +> z4 +> enc (.a :: ys) +> [1,1] +> r) [target_tm]⊢⁺ + ((l <+ [1,0,1]) {{D}}> [0] +> z4 +> ems ys +> [0] +> r) := by + obtain ⟨r',hr'⟩ := z0r ys ([1] +> r) + have h1 := le1 l r' + have h2 := z0n ys (l <+ [0,1,0,1]) r + refine z08 (z0a h1 ?_ rfl) (z0b h2 ?_ (by simp)) + · simp [z4,enc,tk] at hr' ⊢; rw [hr'] + · simp at hr' ⊢; rw [hr'] +theorem z0u (ys : List Token) (l r : zB) : + (l {{D}}> [0] +> z4 +> enc (.a :: (ys ++ [.b])) +> [0] +> r) [target_tm]⊢⁺ + ((l <+ [1,0,1]) {{D}}> [0] +> z4 +> ems ys +> [0,0,1] +> r) := by + obtain ⟨r',hr'⟩ := z0s ys .b ([0] +> r) + have h1 := le1 l r' + have h2 := z0o ys (l <+ [0,1,0,1]) r + refine z08 (z0a h1 ?_ rfl) (z0b h2 ?_ (by simp)) + · simp [z4,enc,tk] at hr' ⊢; rw [hr'] + · simp at hr' ⊢; rw [hr'] +theorem z0v (j : Nat) (r : zB) : + ((default <+ ([1,0,1] ^ j) <+ [1]) <{{D}} z4 +> r) [target_tm]⊢* + (default {{D}}> [0] +> z4 +> [1,0] +> ([0,1,0] ^ j) +> r) := by + induction j generalizing r with + | zero => + dsimp [z4,D]; execute + | succ j ih => + have h1 := ls .b (default <+ ([1,0,1] ^ j) <+ [1]) r + have h2 := ih ([0,1,0] +> r) + refine zSt h1 (z0a h2 rfl ?_) + rw [<- z02 [0,1,0] j]; simp +theorem z0w (k : Nat) (l r : zB) : + ((l <+ ([1,0,1,0,1] ^ k) <+ [1]) <{{D}} z4 +> r) [target_tm]⊢* + ((l <+ [1]) <{{D}} z4 +> ([1,0,0,1,0] ^ k) +> r) := by + induction k generalizing l r with + | zero => exact z06 _ + | succ k ih => + have h1 := ls .b (l <+ ([1,0,1,0,1] ^ k) <+ [1,0,1]) r + have h2 := ls .a (l <+ ([1,0,1,0,1] ^ k) <+ [1]) ([0,1,0] +> r) + have h3 := ih l ([1,0,0,1,0] +> r) + refine zSt h1 (zSt h2 (z0a h3 rfl ?_)) + rw [<- z02 [1,0,0,1,0] k]; simp +theorem z0x (j : Nat) (r : zB) : + ((default <+ ([1,0,1] ^ j) <+ [1,0,1,0,1]) <{{D}} z4 +> r) [target_tm]⊢* + (default {{D}}> [0] +> z4 +> [1,0] +> ([0,1,0] ^ j) +> [1,0,1,0] +> r) := by + have h1 := ls .a (default <+ ([1,0,1] ^ j) <+ [1,0,1]) r + have h2 := ls .a (default <+ ([1,0,1] ^ j) <+ [1]) ([1,0] +> r) + have h3 := z0v j ([1,0,1,0] +> r) + exact zSt h1 (zSt h2 h3) +theorem z0y (j : Nat) (r : zB) : + [1,0] +> ([0,1,0] ^ j) +> r = ([1,0,0] ^ j) +> [1,0] +> r := by + induction j generalizing r with + | zero => rfl + | succ j ih => + have h := ih r + simp only [z01,append_assoc,append_cons,append_nil] at h ⊢ + rw [h] +theorem z0z (j : Nat) (r : zB) : + (1 : Fin 2) >> 0 >> (([0,1,0] ^ j) +> r) = ([1,0,0] ^ j) +> (1 >> 0 >> r) := + z0y j r +theorem z0A (k : Nat) (r : zB) : + [1,0] +> ([1,0,0,1,0] ^ k) +> r = ([1,0,1,0,0] ^ k) +> [1,0] +> r := by + induction k generalizing r with + | zero => rfl + | succ k ih => + have h := ih r + simp only [z01,append_assoc,append_cons,append_nil] at h ⊢ + rw [h] +theorem z0B (n : Nat) (r : zB) : + ([0,1,0] ^ n) +> [0] +> r = [0] +> ([1,0,0] ^ n) +> r := by + induction n generalizing r with + | zero => rfl + | succ n ih => + have h := ih r + simp only [z01,append_assoc,append_cons,append_nil] at h ⊢ + rw [h] +theorem z0C (xs : List Token) (r : zB) : + [1,0] +> ems xs +> [0] +> r = enc (xs ++ [.b]) +> r := by + have h := congrArg (fun l => l +> r) (z0p xs) + dsimp [ems,em] at h + simp only [append_assoc,append_cons,append_nil] at h ⊢ + exact h +theorem z0D (xs : List Token) (r : zB) : + (1 : Fin 2) >> (0 : Fin 2) >> (ems xs +> ((0 : Fin 2) >> r)) = enc (xs ++ [.b]) +> r := + z0C xs r +theorem z0E (xs : List Token) (r : zB) : + [0,1,0] +> ems xs +> [0] +> r = [0] +> enc (xs ++ [.b]) +> r := by + have h := z0C xs r + simp only [append_cons,append_nil] at h ⊢ + rw [h] +inductive Ev : List Token -> zF -> List Token -> zF -> Prop + | EvG (ts : List Token) (m : zF) : Ev ts ([1,1] ++ m) (ts ++ [.b]) m + | EvT (ts : List Token) (m : zF) : Ev (ts ++ [.b]) (0 :: m) (ts ++ [.b]) (0 :: 1 :: m) +theorem z0F (p ts : List Token) (m : zF) (ts' : List Token) (m' : zF) + (h : Ev ts m ts' m') : Ev (p ++ ts) m (p ++ ts') m' := by + cases h with + | EvG => rw [<- List.append_assoc]; exact Ev.EvG (p ++ ts) m' + | EvT ts m0 => rw [<- List.append_assoc]; exact Ev.EvT (p ++ ts) m0 +theorem z0G (ts : List Token) (m : zF) (ts' : List Token) (m' : zF) + (l r : zB) (h : Ev ts m ts' m') : + (l {{D}}> [0] +> z4 +> enc (.a :: .a :: ts) +> m +> r) [target_tm]⊢⁺ + ((l <+ [1,0,1]) {{D}}> [0] +> z4 +> enc ts' +> m' +> r) := by + cases h with + | EvG => + have h1 := z0t (.a :: ts) l (m' +> r) + refine z0b h1 (by simp) ?_ + dsimp [ems,em] + simp only [append_assoc,append_cons,append_nil,z0D] + | EvT ts m0 => + have h1 := z0u (.a :: ts) l (m0 +> r) + refine z0b h1 (by simp) ?_ + dsimp [ems,em] + simp only [append_assoc,append_cons,append_nil,z0D] +theorem z0H (j : Nat) (ts : List Token) (m : zF) (ts' : List Token) (m' : zF) + (r : zB) (h : Ev ts m ts' m') : + ((default <+ ([1,0,1] ^ j)) {{D}}> [0] +> z4 +> enc (.b :: ts) +> m +> r) [target_tm]⊢⁺ + (default {{D}}> [0] +> z4 +> enc ([.b] ^ j ++ [.a,.a] ++ ts') +> m' +> r) := by + cases h with + | EvG => + have h1 := le0 (default <+ ([1,0,1] ^ j)) (enc ts +> [1,1] +> m' +> r) + have h2 := z0n ts (default <+ ([1,0,1] ^ j) <+ [1,0,1,0,1]) (m' +> r) + have h3 := z0x j (ems ts +> [0] +> m' +> r) + refine z08 (z0a h1 (by simp [z4,enc,tk]) rfl) (z07 h2 (z0a h3 rfl ?_)) + rw [z0d,z0d,z0f]; dsimp [enc,tk] + simp only [append_assoc,append_cons,append_nil,z0z,z0D] + | EvT ts m0 => + have h1 := le0 (default <+ ([1,0,1] ^ j)) (enc (ts ++ [.b]) +> [0] +> m0 +> r) + have h2 := z0o ts (default <+ ([1,0,1] ^ j) <+ [1,0,1,0,1]) (m0 +> r) + have h3 := z0x j (ems ts +> [0,0,1] +> m0 +> r) + refine z08 (z0a h1 (by simp [z4,enc,tk]) rfl) (z07 h2 (z0a h3 rfl ?_)) + rw [z0d,z0d,z0f]; dsimp [enc,tk] + simp only [append_assoc,append_cons,append_nil,z0z,z0D] +def Evs : Nat -> List Token -> zF -> List Token -> zF -> Prop + | 0,ts,m,ts',m' => ts' = ts /\ m' = m + | n + 1,ts,m,ts',m' => ∃ ts1 m1,Ev ts m ts1 m1 /\ Evs n ts1 m1 ts' m' +theorem z0I (n : Nat) (p ts : List Token) (m : zF) (ts' : List Token) (m' : zF) + (h : Evs n ts m ts' m') : Evs n (p ++ ts) m (p ++ ts') m' := by + induction n generalizing ts m ts' m' with + | zero => + obtain ⟨rfl,rfl⟩ := h + exact ⟨rfl,rfl⟩ + | succ n ih => + obtain ⟨ts1,m1,h1,h2⟩ := h + exact ⟨p ++ ts1,m1,z0F p ts m ts1 m1 h1,ih ts1 m1 ts' m' h2⟩ +theorem z0J (n k : Nat) (ts : List Token) (m : zF) (ts' : List Token) (m' : zF) + (h : Evs (n + k) ts m ts' m') : + ∃ ts1 m1,Evs n ts m ts1 m1 /\ Evs k ts1 m1 ts' m' := by + induction n generalizing ts m with + | zero => + rw [Nat.zero_add] at h + exact ⟨ts,m,⟨rfl,rfl⟩,h⟩ + | succ n ih => + rw [Nat.succ_add] at h + obtain ⟨ts0,m0,h0,h1⟩ := h + obtain ⟨ts1,m1,h2,h3⟩ := ih ts0 m0 h1 + exact ⟨ts1,m1,⟨ts0,m0,h0,h2⟩,h3⟩ +theorem z0K (t j : Nat) (ts : List Token) (m : zF) (ts' : List Token) (m' : zF) + (r : zB) (h : Evs (t + 1) ts m ts' m') : + ((default <+ ([1,0,1] ^ j)) {{D}}> [0] +> z4 +> enc ([.a,.a] ^ t ++ .b :: ts) +> m +> r) [target_tm]⊢⁺ + (default {{D}}> [0] +> z4 +> enc ([.b] ^ (j + t) ++ [.a,.a] ++ ts') +> m' +> r) := by + induction t generalizing j ts m ts' m' with + | zero => + obtain ⟨ts1,m1,h1,rfl,rfl⟩ := h + simp only [Nat.add_zero,zPz,List.nil_append] + exact z0H j ts m ts' m' r h1 + | succ t ih => + obtain ⟨ts1,m1,h1,h2⟩ := h + have hp : Ev ([.a,.a] ^ t ++ [.b] ++ ts) m ([.a,.a] ^ t ++ [.b] ++ ts1) m1 := by + rw [List.append_assoc,List.append_assoc] + exact z0F ([.a,.a] ^ t) (.b :: ts) m (.b :: ts1) m1 (z0F [.b] ts m ts1 m1 h1) + have hs1 := z0G ([.a,.a] ^ t ++ [.b] ++ ts) m ([.a,.a] ^ t ++ [.b] ++ ts1) m1 (default <+ ([1,0,1] ^ j)) r hp + have hs2 := ih (j + 1) ts1 m1 ts' m' h2 + refine zPt (z0b hs1 ?_ rfl) (z0b hs2 ?_ ?_) + · simp [z01,List.append_assoc] + · have hj : ([1,0,1] : zF) ^ (j + 1) = [1,0,1] ++ ([1,0,1] ^ j) := rfl + rw [hj]; simp [List.append_assoc] + · have hj : j + 1 + t = j + (t + 1) := by omega + rw [hj] +theorem z0L (n : Nat) (ts : List Token) (k : Nat) (m : zF) : + Evs n ts ([1,1] ^ (n + k) ++ m) (ts ++ [.b] ^ n) ([1,1] ^ k ++ m) := by + induction n generalizing ts with + | zero => + simp [Evs] + | succ n ih => + refine ⟨ts ++ [.b],[1,1] ^ (n + k) ++ m,?_,?_⟩ + · have h1 : (n + 1 + k) = 1 + (n + k) := by omega + rw [h1,pow_add] + exact Ev.EvG ts ([1,1] ^ (n + k) ++ m) + · have h2 := ih (ts ++ [.b]) + have h3 : (ts ++ [.b]) ++ [.b] ^ n = ts ++ [.b] ^ (n + 1) := by + rw [List.append_assoc]; rfl + rw [h3] at h2 + exact h2 +theorem z0M (n : Nat) (ts : List Token) (k : Nat) (m : zF) : + Evs n (ts ++ [.b]) (0 :: ([1] ^ k ++ m)) (ts ++ [.b]) (0 :: ([1] ^ (n + k) ++ m)) := by + induction n generalizing k with + | zero => + simp [Evs] + | succ n ih => + refine ⟨ts ++ [.b],0 :: 1 :: ([1] ^ k ++ m),Ev.EvT ts ([1] ^ k ++ m),?_⟩ + have h1 : (1 : Fin 2) :: ([1] ^ k ++ m) = [1] ^ (k + 1) ++ m := rfl + rw [h1] + have h2 : n + (k + 1) = n + 1 + k := by omega + have h3 := ih (k + 1) + rw [h2] at h3 + exact h3 +inductive Num : Nat -> Nat -> Nat -> List Token -> Prop + | Num_O : Num 0 0 0 [] + | Num_0 (w n p : Nat) (xs : List Token) : Num w n p xs -> Num (w + 1) (n * 2) p (.b :: xs) + | Num_1 (w n p : Nat) (xs : List Token) : Num w n p xs -> Num (w + 1) (n * 2 + 1) (p + 1) (.a :: .a :: xs) +theorem z0N {w n p : Nat} {xs : List Token} (h : Num w n p xs) : n < 2 ^ w /\ p <= w := by + induction h with + | Num_O => simp + | Num_0 w n p xs _ ih => + have : 2 ^ (w + 1) = 2 ^ w * 2 := by rw [Nat.pow_succ] + omega + | Num_1 w n p xs _ ih => + have : 2 ^ (w + 1) = 2 ^ w * 2 := by rw [Nat.pow_succ] + omega +theorem z0O {w n p : Nat} {xs : List Token} (h : Num w n p xs) : + ∀ {w' m q : Nat} {ys : List Token},Num w' m q ys -> w' = w -> m = n -> p = q /\ xs = ys := by + induction h with + | Num_O => + intro w' m q ys h' hw hm + cases h' with + | Num_O => exact ⟨rfl,rfl⟩ + | Num_0 _ _ _ _ _ => omega + | Num_1 _ _ _ _ _ => omega + | Num_0 w n p xs h ih => + intro w' m q ys h' hw hm + cases h' with + | Num_O => omega + | Num_0 w0 n0 q0 ys0 h0 => + obtain ⟨rfl,rfl⟩ := ih h0 (by omega) (by omega) + exact ⟨rfl,rfl⟩ + | Num_1 w0 n0 q0 ys0 h0 => + omega + | Num_1 w n p xs h ih => + intro w' m q ys h' hw hm + cases h' with + | Num_O => omega + | Num_0 w0 n0 q0 ys0 h0 => + omega + | Num_1 w0 n0 q0 ys0 h0 => + obtain ⟨rfl,rfl⟩ := ih h0 (by omega) (by omega) + exact ⟨rfl,rfl⟩ +theorem z0P {w n p : Nat} {xs : List Token} (h : Num w n p xs) + {q : Nat} {ys : List Token} (h' : Num w n q ys) : p = q /\ xs = ys := + z0O h h' rfl rfl +theorem z0Q {w w' n n' p p' : Nat} {xs xs' : List Token} + (h : Num w n p xs) (hw : w = w') (hn : n = n') (hp : p = p') (hxs : xs = xs') : + Num w' n' p' xs' := hw ▸ hn ▸ hp ▸ hxs ▸ h +theorem z0R {w n p : Nat} {xs : List Token} {v m q : Nat} {ys : List Token} + (h1 : Num w n p xs) (h2 : Num v m q ys) : + Num (w + v) (n + 2 ^ w * m) (p + q) (xs ++ ys) := by + induction h1 with + | Num_O => + refine z0Q h2 (by omega) (by simp) (by omega) rfl + | Num_0 w n p xs h ih => + refine z0Q (Num.Num_0 (w + v) (n + 2 ^ w * m) (p + q) (xs ++ ys) ih) (by omega) ?_ rfl rfl + rw [Nat.pow_succ,Nat.add_mul,Nat.mul_right_comm] + | Num_1 w n p xs h ih => + refine z0Q (Num.Num_1 (w + v) (n + 2 ^ w * m) (p + q) (xs ++ ys) ih) (by omega) ?_ (by omega) rfl + rw [Nat.pow_succ,Nat.add_mul,Nat.mul_right_comm]; omega +theorem z0S (w : Nat) : Num w 0 0 ([.b] ^ w) := by + induction w with + | zero => exact Num.Num_O + | succ w ih => exact Num.Num_0 w 0 0 ([.b] ^ w) ih +theorem z0T (w : Nat) : Num w (2 ^ w - 1) w ([.a,.a] ^ w) := by + induction w with + | zero => exact Num.Num_O + | succ w ih => + have h := Num.Num_1 w (2 ^ w - 1) w ([.a,.a] ^ w) ih + have hpow : 2 ^ w >= 1 := Nat.one_le_two_pow + have hpow2 : 2 ^ (w + 1) = 2 ^ w * 2 := Nat.pow_succ 2 w + refine z0Q h rfl ?_ rfl rfl + omega +theorem z0U {w n p : Nat} {xs : List Token} (h : Num w n p xs) (hn : n + 1 < 2 ^ w) : + ∃ t rest p',xs = [.a,.a] ^ t ++ .b :: rest /\ + Num w (n + 1) p' ([.b] ^ t ++ [.a,.a] ++ rest) /\ p' + t = p + 1 := by + induction h with + | Num_O => omega + | Num_0 w n p xs h ih => + exact ⟨0,xs,p + 1,rfl,Num.Num_1 w n p xs h,by omega⟩ + | Num_1 w n p xs h ih => + have hpow : 2 ^ (w + 1) = 2 ^ w * 2 := Nat.pow_succ 2 w + obtain ⟨t,rest,p',rfl,h1,h2⟩ := ih (by omega) + refine ⟨t + 1,rest,p',rfl,?_,by omega⟩ + have h0 := Num.Num_0 w (n + 1) p' ([.b] ^ t ++ [.a,.a] ++ rest) h1 + refine z0Q h0 rfl (by omega) rfl rfl +def ck (xs ts : List Token) (m : zF) : Cfg (Fin 2) (Fin 6) := + default {{D}}> [0] +> z4 +> enc (xs ++ ts) +> m +> default +theorem z0V {w n p : Nat} {xs : List Token} (h : Num w n p xs) (hn : n + 1 < 2 ^ w) : + ∃ f p' ys,0 < f /\ Num w (n + 1) p' ys /\ f + p' = p + 2 /\ + ∀ ts m ts' m',Evs f ts m ts' m' -> ((ck xs ts m) [target_tm]⊢⁺ (ck ys ts' m')) := by + obtain ⟨t,rest,p',rfl,h1,h2⟩ := z0U h hn + refine ⟨t + 1,p',[.b] ^ t ++ [.a,.a] ++ rest,by omega,h1,by omega,?_⟩ + intro ts m ts' m' he + have hc := z0K t 0 (rest ++ ts) m (rest ++ ts') m' default (z0I (t + 1) rest ts m ts' m' he) + refine z0b hc ?_ ?_ + · dsimp [ck]; simp [List.append_assoc] + · dsimp [ck]; simp [List.append_assoc] +theorem z0W (k : Nat) {w n p : Nat} {xs : List Token} (h : Num w n p xs) (hn : n + k < 2 ^ w) : + ∃ f q ys,Num w (n + k) q ys /\ k <= f /\ f + q = p + k * 2 /\ + ∀ ts m ts' m',Evs f ts m ts' m' -> ((ck xs ts m) [target_tm]⊢* (ck ys ts' m')) := by + induction k generalizing n p xs with + | zero => + refine ⟨0,p,xs,by simpa using h,by omega,by omega,?_⟩ + intro ts m ts' m' ⟨rfl,rfl⟩ + exact z06 _ + | succ k ih => + obtain ⟨f1,p1,xs1,hf1,hn1,hc1,hs1⟩ := z0V h (by omega) + obtain ⟨f2,q,ys,hn2,hf2,hc2,hs2⟩ := ih hn1 (by omega) + refine ⟨f1 + f2,q,ys,z0Q hn2 rfl (by omega) rfl rfl,by omega,by omega,?_⟩ + intro ts m ts' m' he + obtain ⟨ts1,m1,he1,he2⟩ := z0J f1 f2 ts m ts' m' he + exact zSt (zPs (hs1 ts m ts1 m1 he1)) (hs2 ts1 m1 ts' m' he2) +theorem z0X {w n k p q : Nat} {xs ys : List Token} {f : Nat} {ts : List Token} {m : zF} + {ts' : List Token} {m' : zF} + (hn : Num w n p xs) (hn' : Num w (n + k) q ys) (hc : f + q = p + k * 2) + (he : Evs f ts m ts' m') : + (ck xs ts m) [target_tm]⊢* (ck ys ts' m') := by + have hb := (z0N hn').1 + obtain ⟨f',q',ys',hn1,_,hc1,hs⟩ := z0W k hn hb + obtain ⟨rfl,rfl⟩ := z0P hn' hn1 + have hf : f' = f := by omega + subst hf + exact hs ts m ts' m' he +theorem z0Y {w n k p q : Nat} {xs ys : List Token} {f : Nat} {ts : List Token} {rem : Nat} {m : zF} + (hn : Num w n p xs) (hn' : Num w (n + k) q ys) (hc : f + q = p + k * 2) : + (ck xs ts ([1,1] ^ (f + rem) ++ m)) [target_tm]⊢* + (ck ys (ts ++ [.b] ^ f) ([1,1] ^ rem ++ m)) := + z0X hn hn' hc (z0L f ts rem m) +def OV (j : Nat) (ts : List Token) (m : zF) : Cfg (Fin 2) (Fin 6) := + (default <+ ([1,0,1] ^ j)) {{D}}> [0] +> z4 +> [0] +> enc ts +> m +> default +theorem z0Z (l r : zB) : + (l {{D}}> [0,0,0,0,0,0,1,0,0] +> r) [target_tm]⊢* + ((l <+ [0,1,0,1,0,1]) {{D}}> [1,0,0] +> r) := by + dsimp [D]; execute +theorem z10 (n : Nat) (l r : zB) : + (l {{D}}> [0] +> z4 +> [0] +> ([1,0,0] ^ (2 + n * 2)) +> [0] +> r) [target_tm]⊢⁺ + ((l <+ [1,0,1,0,1]) {{D}}> [0] +> z4 +> [0] +> ([1,0,0] ^ (n * 2)) +> [0,1] +> r) := by + have h1 := z0Z l (([1,0,0] ^ (1 + n * 2)) +> [0] +> r) + have h2 := z0o ([.b] ^ (n * 2)) (l <+ [0,1,0,1,0,1]) r + refine z08 (z0a h1 ?_ rfl) (z0b h2 ?_ ?_) + · have hp : ([1,0,0] : zF) ^ (2 + n * 2) = [1,0,0] ++ ([1,0,0] ^ (1 + n * 2)) := by + have : 2 + n * 2 = 1 + (1 + n * 2) := by omega + rw [this,pow_add]; rfl + rw [hp]; simp [z4] + · rw [z0d,z0f]; dsimp [enc,tk] + rw [z02 [1,0,0] (n * 2)] + have : n * 2 + 1 = 1 + n * 2 := by omega + rw [this] + · rw [z0g]; dsimp [ems,em] + have hs := z0B (n * 2) ([0,1] +> r) + simp only [append_cons,append_nil] at hs + simp only [z4,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,append_cons,append_nil] + rw [hs] +theorem z11 (n : Nat) (l r : zB) : + (l {{D}}> [0] +> z4 +> [0] +> ([1,0,0] ^ (n * 2)) +> [0] +> r) [target_tm]⊢* + ((l <+ ([1,0,1,0,1] ^ n)) {{D}}> [0] +> z4 +> [0,0] +> ([1] ^ n) +> r) := by + induction n generalizing l r with + | zero => exact z06 _ + | succ n ih => + have h1 := z10 n l r + have h2 := ih (l <+ [1,0,1,0,1]) ([1] +> r) + refine zSt (zPs (z0b h1 ?_ rfl)) (z0a h2 ?_ ?_) + · have : (n + 1) * 2 = 2 + n * 2 := by omega + rw [this] + · simp + · rw [<- z02 [1,0,1,0,1] n,<- z02 [1] n] + simp +theorem z12 (l r : zB) : + (l {{D}}> [0] +> z4 +> [0,0,1,1] +> r) [target_tm]⊢⁺ + ((l <+ [1,0,1,0,1]) <{{D}} z4 +> r) := by + dsimp [z4,D]; execute +theorem z13 (j k : Nat) (r : zB) : + ((default <+ ([1,0,1] ^ j) <+ ([1,0,1,0,1] ^ k)) {{D}}> [0] +> z4 +> [0,0,1,1] +> r) [target_tm]⊢⁺ + (default {{D}}> [0] +> z4 +> ([1,0,0] ^ j) +> ([1,0,1,0,0] ^ k) +> [1,0,1,0,1,0] +> r) := by + have h1 := z12 (default <+ ([1,0,1] ^ j) <+ ([1,0,1,0,1] ^ k)) r + have h2 := ls .a (default <+ ([1,0,1] ^ j) <+ ([1,0,1,0,1] ^ k) <+ [1,0,1]) r + have h3 := ls .a (default <+ ([1,0,1] ^ j) <+ ([1,0,1,0,1] ^ k) <+ [1]) ([1,0] +> r) + have h4 := z0w k (default <+ ([1,0,1] ^ j)) ([1,0,1,0] +> r) + have h5 := z0v j (([1,0,0,1,0] ^ k) +> [1,0,1,0] +> r) + refine z07 h1 (zSt h2 (zSt h3 (zSt h4 (z0a h5 rfl ?_)))) + rw [z0y,z0A] + rfl +theorem o01 (j k p : Nat) (m : zF) (hp : 2 <= p + k) : + (OV j ([.b] ^ (k * 2)) (0 :: ([1] ^ p ++ m))) [target_tm]⊢⁺ + (ck ([.b] ^ j) ([.a,.b] ^ k ++ [.a,.a,.a]) ([1] ^ (p + k - 2) ++ m)) := by + have h1 := z11 k (default <+ ([1,0,1] ^ j)) (([1] ^ p) +> m +> default) + have h2 := z13 j k (([1] ^ (p + k - 2)) +> m +> default) + refine z08 (z0a h1 ?_ rfl) (z0b h2 ?_ ?_) + · dsimp [OV]; rw [z0f]; dsimp [enc,tk]; simp + · have hpk : ([1] : zF) ^ k ++ ([1] ^ p) = [1,1] ++ ([1] ^ (p + k - 2)) := by + have h1 : k + p = 2 + (p + k - 2) := by omega + rw [<- pow_add,h1,pow_add [1] 2 (p + k - 2)] + rfl + have hpk' := congrArg (fun l => l +> m +> (default : zB)) hpk + simp only [append_assoc,append_cons,append_nil] at hpk' ⊢ + rw [hpk'] + · dsimp [ck] + rw [z0d,z0d,z0f,z0f] + dsimp [enc,tk] + simp +theorem z14 (l r : zB) : + (l {{D}}> [0] +> z4 +> [0] +> [1,0,1,0,0] +> r) [target_tm]⊢* + ((l <+ [1,0,1,1,0,1,0,1]) {{D}}> [1,0,0] +> r) := by + dsimp [z4,D]; execute +theorem z15 (j : Nat) (r : zB) : + ((default <+ ([1,0,1] ^ j) <+ [1,0,1,1,0,1,0,1]) <{{D}} z4 +> r) [target_tm]⊢* + (default {{D}}> [0] +> z4 +> ([1,0,0] ^ j) +> enc [.a,.b,.a,.a] +> r) := by + have h1 := ls .a (default <+ ([1,0,1] ^ j) <+ [1,1,0,1,0,1]) r + have h2 := ls .b (default <+ ([1,0,1] ^ j) <+ [1,0,1]) ([1,0] +> r) + have h3 := ls .a (default <+ ([1,0,1] ^ j) <+ [1]) ([0,1,0,1,0] +> r) + have h4 := z0v j ([1,0,0,1,0,1,0] +> r) + refine zSt h1 (zSt h2 (zSt h3 (z0a h4 rfl ?_))) + rw [z0y] + rfl +theorem o2 (j : Nat) (ts : List Token) (m : zF) : + (OV j (.a :: .b :: (ts ++ [.b])) (0 :: m)) [target_tm]⊢⁺ + (ck ([.b] ^ j) (.a :: .b :: .a :: (ts ++ [.b])) (0 :: 1 :: m)) := by + have h1 := z14 (default <+ ([1,0,1] ^ j)) (enc (ts ++ [.b]) +> [0] +> m +> default) + have h2 := z0o ts (default <+ ([1,0,1] ^ j) <+ [1,0,1,1,0,1,0,1]) (m +> default) + have h3 := z15 j (ems ts +> [0,0,1] +> m +> default) + refine z08 (z0a h1 ?_ rfl) (z07 h2 (z0a h3 rfl ?_)) + · simp [OV,enc,tk] + · dsimp [ck]; rw [z0d,z0f]; dsimp [enc,tk] + simp only [append_assoc,append_cons,append_nil,z0D] +theorem z16 (l r : zB) : + (l {{D}}> [0] +> z4 +> [0] +> [1,0,1,0,1] +> r) [target_tm]⊢* + ((l <+ [0,1,1,0,1,0,1]) {{D}}> [1,0,0,1] +> r) := by + dsimp [z4,D]; execute +theorem z17 (ts : List Token) (l r : zB) : + (l {{D}}> [0] +> z4 +> [0] +> enc (.a :: .a :: .b :: (ts ++ [.b])) +> [0] +> r) [target_tm]⊢⁺ + ((l <+ [1,1,0,1,0,1]) {{D}}> [0] +> z4 +> [0] +> enc (ts ++ [.b]) +> [0,1] +> r) := by + have h1 := z16 l ([0,0] +> enc (ts ++ [.b]) +> [0] +> r) + have h2 := z0o (.b :: ts) (l <+ [0,1,1,0,1,0,1]) r + refine z08 (z0a h1 ?_ rfl) (z0b h2 ?_ ?_) + · simp [enc,tk] + · simp [enc,tk] + · dsimp [ems,em] + simp only [z4,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,append_assoc,append_cons,append_nil,z0D] +theorem z18 (j : Nat) (r : zB) : + ((default <+ ([1,0,1] ^ j) <+ [1,1,0,1,0,1] <+ [1,0,1,1,0,1,0,1]) <{{D}} z4 +> r) [target_tm]⊢* + (default {{D}}> [0] +> z4 +> ([1,0,0] ^ j) +> enc [.a,.b] +> [0] +> enc [.a,.b,.a,.a] +> r) := by + have h1 := ls .a (default <+ ([1,0,1] ^ j) <+ [1,1,0,1,0,1] <+ [1,1,0,1,0,1]) r + have h2 := ls .b (default <+ ([1,0,1] ^ j) <+ [1,1,0,1,0,1] <+ [1,0,1]) ([1,0] +> r) + have h3 := ls .a (default <+ ([1,0,1] ^ j) <+ [1,1,0,1,0,1] <+ [1]) ([0,1,0,1,0] +> r) + have h4 := z0j (default <+ ([1,0,1] ^ j) <+ [1,0,1]) ([1,0,0,1,0,1,0] +> r) + have h5 := ls .a (default <+ ([1,0,1] ^ j) <+ [1]) ([0,0,1,0,1,0,0,1,0,1,0] +> r) + have h6 := z0v j ([1,0,0,0,1,0,1,0,0,1,0,1,0] +> r) + refine zSt h1 (zSt h2 (zSt h3 (zSt h4 (zSt h5 (z0a h6 rfl ?_))))) + rw [z0y] + rfl +theorem o3 (j : Nat) (ts : List Token) (m : zF) : + (OV j (.a :: .a :: .b :: .a :: .b :: (ts ++ [.b])) (0 :: m)) [target_tm]⊢⁺ + (ck ([.b] ^ j) [.a,.b] (0 :: (enc (.a :: .b :: .a :: (ts ++ [.b])) ++ [0,1,1] ++ m))) := by + have h1 := z17 (.a :: .b :: ts) (default <+ ([1,0,1] ^ j)) (m +> default) + have h2 := z14 (default <+ ([1,0,1] ^ j) <+ [1,1,0,1,0,1]) (enc (ts ++ [.b]) +> [0,1] +> m +> default) + have h3 := z0o ts (default <+ ([1,0,1] ^ j) <+ [1,1,0,1,0,1] <+ [1,0,1,1,0,1,0,1]) ([1] +> m +> default) + have h4 := z18 j (ems ts +> [0,0,1,1] +> m +> default) + refine zPt (z0b h1 ?_ rfl) (z08 (z0a h2 ?_ rfl) (z07 (z0b h3 ?_ ?_) (z0a h4 rfl ?_))) + · dsimp [OV] + · simp [enc,tk] + · simp [enc,tk] + · rfl + · dsimp [ck]; rw [z0d,z0f]; dsimp [enc,tk] + simp only [append_assoc,append_cons,append_nil,z0D] +def z19 (ts : List Token) : Prop := ts = [] \/ ∃ us,ts = us ++ [.b] +theorem z1a {ts : List Token} (m : zF) (ht : z19 ts) : + Ev (.b :: ts) (0 :: m) (.b :: ts) (0 :: 1 :: m) := by + rcases ht with rfl | ⟨us,rfl⟩ + · exact Ev.EvT [] m + · exact Ev.EvT (.b :: us) m +theorem z1b {ts : List Token} (l r : zB) (ht : z19 ts) : + (l {{D}}> [0] +> z4 +> enc (.a :: .b :: ts) +> [0] +> r) [target_tm]⊢⁺ + ((l <+ [1,0,1]) {{D}}> [0] +> z4 +> [0] +> enc ts +> [0,1] +> r) := by + rcases ht with rfl | ⟨us,rfl⟩ + · exact z0u [] l r + · have h1 := z0u (.b :: us) l r + refine z0b h1 rfl ?_ + dsimp [ems,em] + simp only [append_assoc,append_cons,append_nil,z0D] +theorem z1c (w j : Nat) {ts : List Token} (p : Nat) (m : zF) (ht : z19 ts) : + ((default <+ ([1,0,1] ^ j)) {{D}}> [0] +> z4 +> enc ([.a,.a] ^ w ++ .a :: .b :: ts) +> (0 :: ([1] ^ p ++ m)) +> default) [target_tm]⊢⁺ + (OV (j + w + 1) ts (0 :: ([1] ^ (w + 1 + p) ++ m))) := by + induction w generalizing j p with + | zero => + have h1 := z1b (default <+ ([1,0,1] ^ j)) (([1] ^ p) +> m +> default) ht + refine z0b h1 (by simp) ?_ + dsimp [OV] + have hp : 0 + 1 + p = 1 + p := by omega + rw [hp,pow_add [1] 1 p] + simp + | succ w ih => + have hev : Ev ([.a,.a] ^ w ++ .a :: .b :: ts) (0 :: ([1] ^ p ++ m)) ([.a,.a] ^ w ++ .a :: .b :: ts) (0 :: 1 :: ([1] ^ p ++ m)) := by + have hpre := z0F ([.a,.a] ^ w ++ [.a]) (.b :: ts) (0 :: ([1] ^ p ++ m)) (.b :: ts) (0 :: 1 :: ([1] ^ p ++ m)) (z1a ([1] ^ p ++ m) ht) + simpa [List.append_assoc] using hpre + have h1 := z0G ([.a,.a] ^ w ++ .a :: .b :: ts) (0 :: ([1] ^ p ++ m)) ([.a,.a] ^ w ++ .a :: .b :: ts) (0 :: 1 :: ([1] ^ p ++ m)) (default <+ ([1,0,1] ^ j)) default hev + have h2 := ih (j + 1) (p + 1) + refine zPt (z0b h1 ?_ rfl) (z0b h2 ?_ ?_) + · simp [z01,List.append_assoc] + · have hj : ([1,0,1] : zF) ^ (j + 1) = [1,0,1] ++ ([1,0,1] ^ j) := rfl + have hp : ([1] : zF) ^ (p + 1) = 1 :: ([1] ^ p) := rfl + rw [hj,hp]; simp + · dsimp [OV] + have hj : j + 1 + w = j + (w + 1) := by omega + have hp : w + 1 + (p + 1) = w + 1 + 1 + p := by omega + rw [hj,hp] +theorem z1d (w : Nat) {ts : List Token} (p : Nat) (m : zF) (ht : z19 ts) : + (ck ([.a,.a] ^ w) (.a :: .b :: ts) (0 :: ([1] ^ p ++ m))) [target_tm]⊢⁺ + (OV (w + 1) ts (0 :: ([1] ^ (w + 1 + p) ++ m))) := by + have h := z1c w 0 p m ht + have hw : 0 + w = w := Nat.zero_add w + refine z0b h (by simp [ck]) (by dsimp [OV]; rw [hw]) +theorem z1e (n : Nat) {ts : List Token} (k : Nat) (m : zF) (ht : z19 ts) : + Evs n (.a :: .b :: ts) (0 :: ([1] ^ k ++ m)) (.a :: .b :: ts) (0 :: ([1] ^ (n + k) ++ m)) := by + rcases ht with rfl | ⟨us,rfl⟩ + · exact z0M n [.a] k m + · exact z0M n (.a :: .b :: us) k m +theorem z1f {w n p : Nat} {xs ts : List Token} (k : Nat) (m : zF) (f : Nat) + (hn : Num w n p xs) (ht : z19 ts) (hf : f + 1 + n * 2 = 2 ^ w * 2 + p) : + (ck xs (.a :: .b :: ts) (0 :: ([1] ^ k ++ m))) [target_tm]⊢⁺ + (OV (w + 1) ts (0 :: ([1] ^ (f + k) ++ m))) := by + have hb := (z0N hn).1 + have hlt : n + (2 ^ w - 1 - n) < 2 ^ w := by omega + obtain ⟨g,q,ys,hn1,_,hc,hs⟩ := z0W (2 ^ w - 1 - n) hn hlt + have hneq : n + (2 ^ w - 1 - n) = 2 ^ w - 1 := by omega + rw [hneq] at hn1 + obtain ⟨rfl,rfl⟩ := z0P (z0T w) hn1 + have h1 := hs (.a :: .b :: ts) (0 :: ([1] ^ k ++ m)) (.a :: .b :: ts) (0 :: ([1] ^ (g + k) ++ m)) (z1e g k m ht) + have h2 := z1d w (g + k) m ht + refine z08 h1 (z0b h2 rfl ?_) + dsimp [OV] + have hfg : w + 1 + (g + k) = f + k := by omega + rw [hfg] +theorem z1g : Num 1 1 1 [.a,.a] := Num.Num_1 0 0 0 [] Num.Num_O +theorem z1h (u v : Nat) : + Num (u + v + 2) (2 ^ u + 2 ^ (u + v + 1)) 2 ([.b] ^ u ++ [.a,.a] ++ [.b] ^ v ++ [.a,.a]) := by + have h1 := z0R (z0S v) z1g + have h2 := z0R z1g h1 + have h3 := z0R (z0S u) h2 + refine z0Q h3 (by omega) ?_ (by omega) (by simp [List.append_assoc]) + rw [Nat.pow_add,Nat.pow_add,Nat.pow_one] + simp [Nat.mul_add,Nat.mul_assoc,Nat.mul_comm,Nat.mul_left_comm] +theorem z1i (j : Nat) : + Num (j + 6) (2 ^ j * 7) 3 ([.b] ^ j ++ [.a,.a] ^ 3 ++ [.b] ^ 3) := by + have h1 := z0R (z0T 3) (z0S 3) + have h2 := z0R (z0S j) h1 + refine z0Q h2 (by omega) (by omega) (by omega) (by simp [List.append_assoc]) +set_option allowUnsafeReducibility true +abbrev o1 : zF := [1] +abbrev z1 : zF := [0] +abbrev p101 : zF := [1,0,1] +abbrev p100 : zF := [1,0,0] +abbrev tb : List Token := [Token.b] +abbrev tab : List Token := [Token.a,Token.b] +theorem z1j (l : List α) : l ^ (1 : Nat) = l := by simp +theorem z1k (l : List α) : l ^ (2 : Nat) = l ++ l := by simp +theorem z1l (l : List α) : l ^ (3 : Nat) = l ++ l ++ l := by simp +theorem z1m (n : Nat) (xs : List Token) : + (tb ^ n) ++ (Token.b :: xs) = (tb ^ (n + 1)) ++ xs := by + rw [<- z02 tb n,List.append_assoc]; rfl +theorem z1n {n : Nat} {ts1 ts1' : List Token} {m1 m1' : zF} {ts2 ts2' : List Token} {m2 m2' : zF} + (h : Evs n ts1 m1 ts2 m2) (h1 : ts1 = ts1') (h2 : m1 = m1') (h3 : ts2 = ts2') (h4 : m2 = m2') : + Evs n ts1' m1' ts2' m2' := h1 ▸ h2 ▸ h3 ▸ h4 ▸ h +theorem z1o {k k' : Nat} {m1 m2 : zF} (hk : k = k') (hm : m1 = m2) : + ck ([.a,.a] ++ tb ^ k) ([.a,.a,.a] ++ [.b]) m1 = + ck ([.a,.a] ++ tb ^ k' ++ [.a,.a]) [.a,.b] m2 := by + subst hk; subst hm; dsimp [ck]; simp only [List.append_assoc,List.cons_append,List.nil_append] +theorem z1p (rest ts qs : List Token) (m : zF) : + (ck (.a :: .a :: .b :: rest) ts ([1,1] ++ enc (qs ++ [.b]) ++ [0] ++ m)) [target_tm]⊢⁺ + (ck (.b :: .a :: .a :: rest) (ts ++ [.b] ++ qs ++ [.b]) (0 :: 1 :: m)) := by + have hev1 : Ev (.b :: (rest ++ ts)) ([1,1] ++ (enc (qs ++ [.b]) ++ [0] ++ m)) (.b :: (rest ++ ts) ++ [.b]) (enc (qs ++ [.b]) ++ [0] ++ m) := + Ev.EvG (.b :: (rest ++ ts)) (enc (qs ++ [.b]) ++ [0] ++ m) + have h1 := z0G (.b :: (rest ++ ts)) ([1,1] ++ (enc (qs ++ [.b]) ++ [0] ++ m)) (.b :: (rest ++ ts) ++ [.b]) (enc (qs ++ [.b]) ++ [0] ++ m) default default hev1 + have hev2 : Ev (rest ++ ts ++ [.b] ++ qs ++ [.b]) (0 :: m) (rest ++ ts ++ [.b] ++ qs ++ [.b]) (0 :: 1 :: m) := + Ev.EvT (rest ++ ts ++ [.b] ++ qs) m + have h2 := z0H 1 (rest ++ ts ++ [.b] ++ qs ++ [.b]) (0 :: m) (rest ++ ts ++ [.b] ++ qs ++ [.b]) (0 :: 1 :: m) default hev2 + refine zPt (z0b h1 ?_ rfl) (z0b h2 ?_ ?_) + · dsimp [ck] + · dsimp [ck]; simp only [z0d,enc,tk,append_assoc,append_cons,append_nil,List.append_assoc,List.cons_append,List.nil_append] + · dsimp [ck]; simp only [z0d,z0f,z01,zPz,enc,tk,append_assoc,append_cons,append_nil,List.append_assoc,List.cons_append,List.nil_append] +theorem z1q (xs ts : List Token) (m : zF) : + (ck (.b :: xs) ts ([1,1] ++ m)) [target_tm]⊢⁺ (ck ([.a,.a] ++ xs) (ts ++ [.b]) m) := by + have hev : Ev (xs ++ ts) ([1,1] ++ m) ((xs ++ ts) ++ [.b]) m := Ev.EvG (xs ++ ts) m + have h1 := z0H 0 (xs ++ ts) ([1,1] ++ m) ((xs ++ ts) ++ [.b]) m default hev + refine z0b h1 ?_ ?_ + · dsimp [ck] + · dsimp [ck]; simp only [z0d,enc,tk,zPz,append_assoc,append_cons,append_nil,List.append_assoc,List.cons_append,List.nil_append] +@[simp] theorem z1r (xs ts : List Token) (m : zF) : + ck xs ts (m ++ [0]) = ck xs ts m := by + dsimp [ck]; simp +@[simp] theorem z1s (j : Nat) (ts : List Token) (m : zF) : + OV j ts (m ++ [0]) = OV j ts m := by + dsimp [OV]; simp +theorem z1t : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl +macro "prep_exec" : tactic => + `(tactic| simp only [A,B,C,D,E,F,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,z00,zDh,zDt,append_cons,append_nil]) +abbrev cfg_of_loc := @Counter.cfg_of (Fin 2) (Fin 6) + +@[simp] theorem append_nil_loc (l : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> l = l := rfl +@[simp] theorem append_cons_loc (a : Fin 2) (as : List (Fin 2)) (l : ListBlank (Fin 2)) : + (a :: as) +> l = a >> (as +> l) := rfl + +abbrev LocalStateLoc := Counter.LocalState (Fin 2) (Fin 6) +abbrev step_local_loc := @Counter.step_local (Fin 2) (Fin 6) +abbrev step_local_spec_loc := @Counter.step_local_spec (Fin 2) (Fin 6) _ _ +abbrev run_local_loc := @Counter.run_local (Fin 2) (Fin 6) +abbrev run_local_spec_loc := @Counter.run_local_spec (Fin 2) (Fin 6) _ _ +abbrev run_local_plus_eq_loc := @Counter.run_local_plus_eq (Fin 2) (Fin 6) _ _ + +def s_loc_0 : LocalStateLoc := ⟨[(0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2)], 0, .right⟩ +def s_loc_1 : LocalStateLoc := ⟨[(1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2)], 5, .right⟩ +def s_loc_2 : LocalStateLoc := ⟨[(0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2)], [(1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2)], 3, .left⟩ +def s_loc_3 : LocalStateLoc := ⟨[(1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2)], [(1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2)], 4, .right⟩ +def s_loc_4 : LocalStateLoc := ⟨[(0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2)], 3, .left⟩ + +theorem step_loc_01 : ((default {{0}}> default) : Cfg (Fin 2) (Fin 6)) [target_tm]⊢⁺ + (cfg_of_loc s_loc_1.q s_loc_1.d (s_loc_1.l +> default) (s_loc_1.r +> default)) := + run_local_plus_eq_loc (n := 199) (s1 := s_loc_0) (s2 := s_loc_1) default default rfl + (by simp only [s_loc_0, cfg_of_loc, Counter.cfg_of, append_cons_loc, append_nil_loc, z00]) rfl +theorem step_loc_12 : (cfg_of_loc s_loc_1.q s_loc_1.d (s_loc_1.l +> default) (s_loc_1.r +> default)) [target_tm]⊢⁺ + (cfg_of_loc s_loc_2.q s_loc_2.d (s_loc_2.l +> default) (s_loc_2.r +> default)) := + run_local_plus_eq_loc (n := 199) (s1 := s_loc_1) (s2 := s_loc_2) default default rfl rfl rfl +theorem step_loc_23 : (cfg_of_loc s_loc_2.q s_loc_2.d (s_loc_2.l +> default) (s_loc_2.r +> default)) [target_tm]⊢⁺ + (cfg_of_loc s_loc_3.q s_loc_3.d (s_loc_3.l +> default) (s_loc_3.r +> default)) := + run_local_plus_eq_loc (n := 199) (s1 := s_loc_2) (s2 := s_loc_3) default default rfl rfl rfl +theorem step_loc_34 : (cfg_of_loc s_loc_3.q s_loc_3.d (s_loc_3.l +> default) (s_loc_3.r +> default)) [target_tm]⊢⁺ + (ck [.a,.a,.b,.b,.a,.a] [.a,.b] [0,1]) := + run_local_plus_eq_loc (n := 206) (s1 := s_loc_3) (s2 := s_loc_4) default default rfl rfl + (by simp only [s_loc_4, cfg_of_loc, Counter.cfg_of, ck, enc, tk, z4, D, append_cons_loc, append_nil_loc, append_cons, append_nil, List.append_assoc, List.cons_append, List.nil_append, z00, zDh, zDt]; rfl) + +theorem z1W : + (init []) [target_tm]⊢* (ck [.a,.a,.b,.b,.a,.a] [.a,.b] [0,1]) := + zPs (zPt step_loc_01 (zPt step_loc_12 (zPt step_loc_23 step_loc_34))) +set_option maxRecDepth 4000000 in attribute [-simp] z01 +def z1X (j : Nat) (ts : List Token) (z : Nat) (rest : zF) : Cfg (Fin 2) (Fin 6) := + ck ([.a,.a] ++ tb ^ (j + 5) ++ [.a,.a]) [.a,.b] + (o1 ^ (2 ^ (j + 6) - 4) ++ z1 ++ enc ts ++ z1 ++ o1 ^ z ++ rest) +def z1Y : zF := enc ([.a,.a] ++ tb ^ 28) ++ z1 ++ o1 ^ 741 +theorem z1Z {w n p : Nat} {xs : List Token} {n' q : Nat} {ys : List Token} + {f : Nat} {ts : List Token} {rem : Nat} {m : zF} + (hn : Num w n p xs) (hn' : Num w n' q ys) (hle : n <= n') (hf : f + q = p + (n' - n) * 2) : + (ck xs ts (o1 ^ ((f + rem) * 2) ++ m)) [target_tm]⊢* + (ck ys (ts ++ tb ^ f) (o1 ^ (rem * 2) ++ m)) := by + dsimp only [o1,tb] + rw [z03 1 (f + rem),z03 1 rem] + have hn'' : Num w (n + (n' - n)) q ys := z0Q hn' rfl (by omega) rfl rfl + exact z0Y hn hn'' hf +theorem z20 (n : Nat) : z19 (tb ^ n) := by + cases n with + | zero => exact Or.inl (zPz tb) + | succ n => exact Or.inr ⟨tb ^ n,(z02 tb n).symm⟩ +theorem z21 (j k : Nat) : 2 ^ (j + k) = 2 ^ j * 2 ^ k := Nat.pow_add 2 j k +theorem z22 : + (ck [.a,.a,.b,.b,.a,.a] [.a,.b] [0,1]) [target_tm]⊢* + (ck ([.a,.a] ++ tb ^ 4 ++ [.a,.a]) [.a,.b] (o1 ^ 12)) := by + have hn : Num 4 9 2 [.a,.a,.b,.b,.a,.a] := + Num.Num_1 3 4 1 [.b,.b,.a,.a] (Num.Num_0 2 2 1 [.b,.a,.a] (Num.Num_0 1 1 1 [.a,.a] z1g)) + have h1 := z1f (ts := []) 1 [] 15 hn (Or.inl rfl) (by decide) + have h2 := o01 5 0 16 [] (by decide) + have h3 := z1q (tb ^ 4) [.a,.a,.a] (o1 ^ 12) + exact zPs (zPt h1 (zPt h2 h3)) +theorem z23 : + (ck ([.a,.a] ++ tb ^ 4 ++ [.a,.a]) [.a,.b] (o1 ^ 12)) [target_tm]⊢* + (ck (tb ^ 7) (tab ^ 3 ++ [.a,.a,.a]) (o1 ^ 58)) := by + have hn0 : Num 6 33 2 ([.a,.a] ++ tb ^ 4 ++ [.a,.a]) := + z0Q (z1h 0 4) rfl rfl rfl rfl + have hn1 : Num 6 36 2 (tb ^ 2 ++ [.a,.a] ++ tb ^ 2 ++ [.a,.a]) := + z0Q (z1h 2 2) rfl rfl rfl rfl + have hg := z1Z (f := 6) (ts := [.a,.b]) (rem := 0) (m := [0]) hn0 hn1 (by decide) (by decide) + have hto := z1f (ts := tb ^ 6) 0 [] 57 hn1 (z20 6) (by decide) + have ho := o01 7 3 57 [] (by decide) + refine zSt (z0a hg ?_ rfl) (zPs (zPt (z0b hto rfl rfl) (z0b ho rfl ?_))) + · exact z1r _ _ (o1 ^ 12) + · exact List.append_nil (o1 ^ 58) ▸ rfl +theorem z24 : + (ck (tb ^ 7) (tab ^ 3 ++ [.a,.a,.a]) (o1 ^ 58)) [target_tm]⊢* + (OV 8 (tab ^ 2 ++ [.a,.a,.a] ++ tb ^ 29) (0 :: o1 ^ 226)) := by + have hn15 : Num 7 15 4 ([.a,.a] ^ 4 ++ tb ^ 3) := by + have h := z0R (z0T 4) (z0S 3) + exact z0Q h rfl rfl rfl rfl + have hn16 : Num 7 16 1 (tb ^ 4 ++ [.a,.a] ++ tb ^ 2) := by + have h := z0R (z0S 4) (z0R z1g (z0S 2)) + exact z0Q h rfl rfl rfl rfl + have hg := z1Z (f := 26) (ts := tab ^ 3 ++ [.a,.a,.a]) (rem := 3) (m := [0]) + (z0S 7) hn15 (by decide) (by decide) + have hevs : Evs 5 (tb ^ 2 ++ (tab ^ 3 ++ [.a,.a,.a] ++ tb ^ 26)) (([1,1] : zF) ^ 3 ++ [0]) + (tb ^ 2 ++ (tab ^ 3 ++ [.a,.a,.a] ++ tb ^ 29)) (0 :: o1 ^ 2) := by + have hg3 := z0L 3 (tb ^ 2 ++ (tab ^ 3 ++ [.a,.a,.a] ++ tb ^ 26)) 0 [0] + have ht2 := z0M 2 (tb ^ 2 ++ (tab ^ 3 ++ [.a,.a,.a] ++ tb ^ 28)) 0 [] + obtain ⟨tsa,ma,ha1,tsb,mb,ha2,tsc,mc,ha3,htsc,hmc⟩ := hg3 + refine ⟨tsa,ma,ha1,tsb,mb,ha2,tsc,mc,ha3,z1n ht2 ?_ ?_ (by decide) (by decide)⟩ + · rw [<- htsc]; decide + · rw [<- hmc]; decide + have hc := z0K 4 0 (tb ^ 2 ++ (tab ^ 3 ++ [.a,.a,.a] ++ tb ^ 26)) (([1,1] : zF) ^ 3 ++ [0]) + (tb ^ 2 ++ (tab ^ 3 ++ [.a,.a,.a] ++ tb ^ 29)) (0 :: o1 ^ 2) default hevs + have hend : z19 (tab ^ 2 ++ [.a,.a,.a] ++ tb ^ 29) := + Or.inr ⟨tab ^ 2 ++ [.a,.a,.a] ++ tb ^ 28,rfl⟩ + have hto := z1f (ts := tab ^ 2 ++ [.a,.a,.a] ++ tb ^ 29) 2 [] 224 hn16 hend (by decide) + refine zSt (z0a hg ?_ rfl) (zPs (zPt (z0b hc rfl rfl) (z0b hto rfl ?_))) + · exact z1r _ _ (o1 ^ 58) + · dsimp only [o1]; rw [List.append_nil] +theorem z25 (j : Nat) (r : zB) : + ((default <+ (p101 ^ j) <+ [1,1,0,1,0,1] <+ [1,1,0,1,0,1] <+ [1,0,1,0,1]) <{{D}} z4 +> r) [target_tm]⊢* + (default {{D}}> [0] +> z4 +> (p100 ^ j) +> [1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,1,0] +> r) := by + have h1 := ls .a (default <+ (p101 ^ j) <+ [1,1,0,1,0,1] <+ [1,1,0,1,0,1] <+ [1,0,1]) r + have h2 := ls .a (default <+ (p101 ^ j) <+ [1,1,0,1,0,1] <+ [1,1,0,1,0,1] <+ [1]) ([1,0] +> r) + have h3 := z0j (default <+ (p101 ^ j) <+ [1,1,0,1,0,1] <+ [1,0,1]) ([1,0,1,0] +> r) + have h4 := ls .a (default <+ (p101 ^ j) <+ [1,1,0,1,0,1] <+ [1]) ([0,0,1,0,1,0,1,0] +> r) + have h5 := z0j (default <+ (p101 ^ j) <+ [1,0,1]) ([1,0,0,0,1,0,1,0,1,0] +> r) + have h6 := ls .a (default <+ (p101 ^ j) <+ [1]) ([0,0,1,0,1,0,0,0,1,0,1,0,1,0] +> r) + have h7 := z0v j ([1,0,0,0,1,0,1,0,0,0,1,0,1,0,1,0] +> r) + refine zSt h1 (zSt h2 (zSt h3 (zSt h4 (zSt h5 (zSt h6 (z0a h7 rfl ?_)))))) + dsimp only [p100] + rw [z0y] + rfl +theorem z26 : + (OV 8 (tab ^ 2 ++ [.a,.a,.a] ++ tb ^ 29) (0 :: o1 ^ 226)) [target_tm]⊢* + (OV 9 ([.a,.a,.b,.a,.a,.a] ++ tb ^ 29) (0 :: o1 ^ 738)) := by + have h1 := o2 8 ([.a,.b,.a,.a,.a] ++ tb ^ 28) (o1 ^ 226) + have hend : z19 ([.a,.a,.b,.a,.a,.a] ++ tb ^ 29) := by + refine Or.inr ⟨[.a,.a,.b,.a,.a,.a] ++ tb ^ 28,?_⟩ + have h29 : tb ^ 29 = tb ^ 28 ++ tb := (z02 tb 28).symm + dsimp only [tb] at h29 ⊢ + simp only [h29,List.append_assoc,List.cons_append,List.nil_append] + have h2 := z1f (ts := [.a,.a,.b,.a,.a,.a] ++ tb ^ 29) 227 [] 511 (z0S 8) hend (by decide) + refine zPs (zPt (z0b h1 ?_ rfl) (z0b h2 ?_ ?_)) + · have h29 : tb ^ 29 = tb ^ 28 ++ tb := (z02 tb 28).symm + dsimp only [tab,tb] at h29 ⊢ + simp only [z1k,h29,List.append_assoc,List.cons_append,List.nil_append] + · have h29 : tb ^ 29 = tb ^ 28 ++ tb := (z02 tb 28).symm + have h227 : (1 : Fin 2) :: (o1 ^ 226) = o1 ^ 227 ++ [] := by + rw [List.append_nil] + exact (z01 o1 226).symm + dsimp only [o1,tb] at h29 h227 ⊢ + simp only [h29,h227,List.append_assoc,List.cons_append,List.nil_append] + · dsimp only [o1]; rw [List.append_nil] +theorem z27 : + (OV 9 ([.a,.a,.b,.a,.a,.a] ++ tb ^ 29) (0 :: o1 ^ 738)) [target_tm]⊢* + (ck (tb ^ 9) [.a,.b] (0 :: (enc [.a,.b] ++ z1 ++ z1Y))) := by + have h1 := z17 ([.a,.a,.a] ++ tb ^ 28) (default <+ (p101 ^ 9)) ((o1 ^ 738) +> default) + have h2 := z16 (default <+ (p101 ^ 9) <+ [1,1,0,1,0,1]) ([0] +> enc (tb ^ 29) +> [0,1] +> (o1 ^ 738) +> default) + have h3 := z0o ([.a] ++ tb ^ 28) (default <+ (p101 ^ 9) <+ [1,1,0,1,0,1] <+ [0,1,1,0,1,0,1]) ([1] +> (o1 ^ 738) +> default) + have h4 := le0 (default <+ (p101 ^ 9) <+ [1,1,0,1,0,1] <+ [1,1,0,1,0,1]) (enc (tb ^ 27 ++ [.b]) +> [0,1,1] +> (o1 ^ 738) +> default) + have h5 := z0o (tb ^ 27) (default <+ (p101 ^ 9) <+ [1,1,0,1,0,1] <+ [1,1,0,1,0,1] <+ [1,0,1,0,1]) ([1,1] +> (o1 ^ 738) +> default) + have h6 := z25 9 (ems (tb ^ 27) +> [0,0,1,1,1] +> (o1 ^ 738) +> default) + refine zPs (zPt (z0b h1 ?_ rfl) (z08 (z0a h2 ?_ rfl) (zPt (z0b h3 ?_ ?_) (z08 h4 (z07 (z0b h5 ?_ rfl) (z0a h6 rfl ?_)))))) + · have h29 : tb ^ 29 = tb ^ 28 ++ tb := (z02 tb 28).symm + dsimp only [OV,tb,p101] at h29 ⊢ + simp only [h29,z0d,enc,tk,append_assoc,append_cons,append_nil,List.append_assoc,List.cons_append,List.nil_append] + · have h29 : tb ^ 29 = tb ^ 28 ++ tb := (z02 tb 28).symm + dsimp only [tb] at h29 ⊢ + simp only [h29,z0d,enc,tk,append_assoc,append_cons,append_nil,List.append_assoc,List.cons_append,List.nil_append] + · have h29 : tb ^ 29 = tb ^ 28 ++ tb := (z02 tb 28).symm + dsimp only [tb] at h29 ⊢ + simp only [h29,z0d,enc,tk,append_assoc,append_cons,append_nil,List.append_assoc,List.cons_append,List.nil_append] + · have h28 : tb ^ 28 = tb ++ tb ^ 27 := z01 tb 27 + simp only [List.cons_append,List.nil_append,ems,em,z4,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,append_assoc,append_cons,append_nil,z0D] + rw [h28]; dsimp only [tb]; simp only [z0d,enc,tk,append_assoc,append_cons,append_nil,List.append_assoc,List.cons_append,List.nil_append] + · simp only [z0d,enc,tk,append_assoc,append_cons,append_nil,List.append_assoc,List.cons_append,List.nil_append] + · dsimp only [ck,z1Y,z1,tb,p100] + have hs := z0B 27 ([0,1,1,1] +> (o1 ^ 738) +> default) + simp only [append_cons,append_nil] at hs + have h741 : o1 ^ 741 = [1,1,1] ++ o1 ^ 738 := by + have : (741 : Nat) = 3 + 738 := rfl + rw [this,pow_add o1 3 738,z1l] + rfl + have h28 : ([Token.b] : List Token) ^ 28 = [Token.b] ++ [Token.b] ^ 27 := z01 [Token.b] 27 + rw [h741, h28] + simp only [z0d, z0f, z0g, ems, em, enc, tk, List.append_assoc, List.cons_append, List.nil_append] + generalize o1 ^ 738 = g738 at hs ⊢ + generalize ([1,0,0] : zF) ^ 27 = g27 at hs ⊢ + generalize ([0,1,0] : zF) ^ 27 = g27' at hs ⊢ + simp only [append_assoc,append_cons,append_nil,List.append_assoc,List.cons_append,List.nil_append,hs] +set_option maxRecDepth 4000000 in attribute [irreducible] ck OV +theorem z28 : + (ck (tb ^ 9) [.a,.b] (0 :: (enc [.a,.b] ++ z1 ++ z1Y))) [target_tm]⊢* + (z1X 4 [.b] 0 z1Y) := by + have h1 := z1f (ts := []) 0 (enc [.a,.b] ++ z1 ++ z1Y) 1023 (z0S 9) (Or.inl rfl) (by decide) + have h2 := o01 10 0 1023 (enc [.a,.b] ++ z1 ++ z1Y) (by decide) + have h3 := z1q (tb ^ 9) [.a,.a,.a] (o1 ^ 1019 ++ enc [.a,.b] ++ z1 ++ z1Y) + refine zPs (zPt (z0b h1 ?_ rfl) (zPt (z0b h2 ?_ rfl) (z0b h3 ?_ ?_))) + · dsimp only [tb] + simp only [zPz,List.append_assoc,List.cons_append,List.nil_append] + · simp only [Nat.zero_mul,zPz] + · have h10 : tb ^ 10 = .b :: (tb ^ 9) := z01 tb 9 + have h1021 : ([1] : zF) ^ 1021 = [1,1] ++ o1 ^ 1019 := by + have : (1021 : Nat) = 2 + 1019 := rfl + rw [this,pow_add [1] 2 1019,z1k] + rfl + rw [h10, h1021] + generalize o1 ^ 1019 = g1019 + generalize z1Y = gz1Y + dsimp only [tb,o1] + simp only [zPz,List.append_assoc,List.cons_append,List.nil_append] + · dsimp only [z1X] + refine z1o rfl ?_ + have h1020 : (2 ^ (4 + 6) - 4 : Nat) = 1020 := rfl + have hp := z04 (1 : Fin 2) 1019 (0 :: [1,0,0,0] ++ z1Y) + generalize z1Y = gz1Y at hp ⊢ + rw [h1020] + generalize ([1] : zF) ^ 1019 = g1019 at hp ⊢ + generalize ([1] : zF) ^ 1020 = g1020 at hp ⊢ + dsimp only [enc,tk,o1,z1] at hp ⊢ + simp only [zPz,List.append_assoc,List.cons_append,List.nil_append] at hp ⊢ + exact hp +theorem z29 (j : Nat) (q : List Token) (z : Nat) (rest : zF) : + (z1X j q z rest) [target_tm]⊢⁺ + (ck (tb ^ (j + 8)) (tab ^ (2 ^ j * 16 - 1) ++ [.a,.a,.a]) + (o1 ^ (2 ^ j * 112 - 2) ++ enc q ++ z1 ++ o1 ^ z ++ rest)) := by + have h2j : 2 ^ j >= 1 := Nat.one_le_two_pow + have H0 : Num (j + 7) (1 + 2 ^ j * 64) 2 ([.a,.a] ++ tb ^ (j + 5) ++ [.a,.a]) := by + have h := z1h 0 (j + 5) + have hp : 2 ^ (0 + (j + 5) + 1) = 2 ^ j * 64 := by + have : 0 + (j + 5) + 1 = j + 6 := by omega + rw [this,z21 j 6]; rfl + refine z0Q h (by omega) (by rw [hp]; omega) rfl ?_ + dsimp only [tb] + simp only [zPz,List.append_assoc,List.cons_append,List.nil_append] + have H1 : Num (j + 7) (2 ^ j * 80) 2 (tb ^ (j + 4) ++ [.a,.a] ++ tb ++ [.a,.a]) := by + have h := z1h (j + 4) 1 + have hp1 : 2 ^ (j + 4) = 2 ^ j * 16 := by rw [z21 j 4]; rfl + have hp2 : 2 ^ (j + 4 + 1 + 1) = 2 ^ j * 64 := by + have : j + 4 + 1 + 1 = j + 6 := by omega + rw [this,z21 j 6]; rfl + refine z0Q h (by omega) (by rw [hp1,hp2]; omega) rfl ?_ + dsimp only [tb] + simp only [z1j,List.append_assoc,List.cons_append,List.nil_append] + have hp6 : 2 ^ (j + 6) = 2 ^ j * 64 := by rw [z21 j 6]; rfl + have hp7 : 2 ^ (j + 7) = 2 ^ j * 128 := by rw [z21 j 7]; rfl + have hg := z1Z (f := 2 ^ j * 32 - 2) (ts := [.a,.b]) (rem := 0) + (m := z1 ++ enc q ++ z1 ++ o1 ^ z ++ rest) H0 H1 (by omega) (by omega) + have hto := z1f (ts := tb ^ (2 ^ j * 32 - 2)) 0 (enc q ++ z1 ++ o1 ^ z ++ rest) (2 ^ j * 96 + 1) + H1 (z20 _) (by omega) + have ho := o01 (j + 8) (2 ^ j * 16 - 1) (2 ^ j * 96 + 1) (enc q ++ z1 ++ o1 ^ z ++ rest) (by omega) + refine z08 (z0a hg ?_ rfl) (zPt (z0b hto ?_ rfl) (z0b ho ?_ ?_)) + · dsimp only [z1X] + have hlen : (2 ^ j * 32 - 2 + 0) * 2 = 2 ^ (j + 6) - 4 := by omega + simp only [hlen,List.append_assoc] + · dsimp only [o1,z1] + simp only [Nat.zero_mul,zPz,List.append_assoc,List.cons_append,List.nil_append] + · have hw : j + 7 + 1 = j + 8 := by omega + have hk : 2 ^ j * 32 - 2 = (2 ^ j * 16 - 1) * 2 := by omega + have hf : 2 ^ j * 96 + 1 + 0 = 2 ^ j * 96 + 1 := by omega + dsimp only [tb] + simp only [hw,hk,hf] + · have hp : 2 ^ j * 96 + 1 + (2 ^ j * 16 - 1) - 2 = 2 ^ j * 112 - 2 := by omega + dsimp only [o1,tb,tab] + simp only [hp,List.append_assoc] +theorem z2a (j : Nat) (q : List Token) (z : Nat) (rest : zF) : + (ck (tb ^ (j + 8)) (tab ^ (2 ^ j * 16 - 1) ++ [.a,.a,.a]) + (o1 ^ (2 ^ j * 112 - 2) ++ enc (q ++ [.b]) ++ z1 ++ o1 ^ z ++ rest)) [target_tm]⊢⁺ + (OV (j + 9) (tab ^ (2 ^ j * 16 - 2) ++ [.a,.a,.a] ++ tb ^ (2 ^ j * 56 - 1) ++ q ++ [.b]) + (0 :: (o1 ^ (z + 2 ^ j * 456) ++ rest))) := by + have h2j : 2 ^ j >= 1 := Nat.one_le_two_pow + have hp8 : 2 ^ (j + 8) = 2 ^ j * 256 := by rw [z21 j 8]; rfl + have H1 : Num (j + 8) (2 ^ j * 28 + 1) 4 (.a :: .a :: .b :: (tb ^ j ++ [.a,.a] ^ 3 ++ tb ^ 3)) := by + have h := Num.Num_1 (j + 7) (2 ^ j * 14) 3 (.b :: (tb ^ j ++ [.a,.a] ^ 3 ++ tb ^ 3)) + (z0Q (Num.Num_0 (j + 6) (2 ^ j * 7) 3 (tb ^ j ++ [.a,.a] ^ 3 ++ tb ^ 3) (z1i j)) (by omega) (by omega) rfl rfl) + exact z0Q h (by omega) (by omega) (by omega) rfl + have H2 : Num (j + 8) (2 ^ j * 28 + 2) 4 (.b :: .a :: .a :: (tb ^ j ++ [.a,.a] ^ 3 ++ tb ^ 3)) := by + have h := Num.Num_0 (j + 7) (2 ^ j * 14 + 1) 4 (.a :: .a :: (tb ^ j ++ [.a,.a] ^ 3 ++ tb ^ 3)) + (z0Q (Num.Num_1 (j + 6) (2 ^ j * 7) 3 (tb ^ j ++ [.a,.a] ^ 3 ++ tb ^ 3) (z1i j)) (by omega) (by omega) (by omega) rfl) + exact z0Q h (by omega) (by omega) rfl rfl + have hg := z1Z (f := 2 ^ j * 56 - 2) (ts := tab ^ (2 ^ j * 16 - 1) ++ [.a,.a,.a]) (rem := 1) + (m := enc (q ++ [.b]) ++ z1 ++ o1 ^ z ++ rest) (z0S (j + 8)) H1 (by omega) (by omega) + have hsw := z1p (tb ^ j ++ [.a,.a] ^ 3 ++ tb ^ 3) + (tab ^ (2 ^ j * 16 - 1) ++ [.a,.a,.a] ++ tb ^ (2 ^ j * 56 - 2)) q (o1 ^ z ++ rest) + have hts : (tab ^ (2 ^ j * 16 - 1) ++ [.a,.a,.a] ++ tb ^ (2 ^ j * 56 - 2)) ++ [.b] ++ q ++ [.b] = + .a :: .b :: (tab ^ (2 ^ j * 16 - 2) ++ [.a,.a,.a] ++ tb ^ (2 ^ j * 56 - 1) ++ q ++ [.b]) := by + have hk1 : 2 ^ j * 16 - 1 = 1 + (2 ^ j * 16 - 2) := by omega + have hk2 : 2 ^ j * 56 - 2 + 1 = 2 ^ j * 56 - 1 := by omega + rw [hk1,pow_add tab 1 (2 ^ j * 16 - 2)] + dsimp only [tab] + simp only [z1j,List.append_assoc,List.cons_append,List.nil_append,z1m,hk2] + have hend : z19 (tab ^ (2 ^ j * 16 - 2) ++ [.a,.a,.a] ++ tb ^ (2 ^ j * 56 - 1) ++ q ++ [.b]) := + Or.inr ⟨tab ^ (2 ^ j * 16 - 2) ++ [.a,.a,.a] ++ tb ^ (2 ^ j * 56 - 1) ++ q,rfl⟩ + have hto := z1f (ts := tab ^ (2 ^ j * 16 - 2) ++ [.a,.a,.a] ++ tb ^ (2 ^ j * 56 - 1) ++ q ++ [.b]) + (z + 1) rest (2 ^ j * 456 - 1) H2 hend (by omega) + refine z08 (z0a hg ?_ rfl) (zPt (z0b hsw ?_ rfl) (z0b hto ?_ ?_)) + · have hlen : (2 ^ j * 56 - 2 + 1) * 2 = 2 ^ j * 112 - 2 := by omega + dsimp only [tb] + simp only [hlen,List.append_assoc] + · dsimp only [o1,z1] + simp only [Nat.one_mul,z1k,List.append_assoc,List.cons_append,List.nil_append] + · rw [hts] + have hz : (1 : Fin 2) :: (o1 ^ z ++ rest) = o1 ^ (z + 1) ++ rest := by + rw [z01 o1 z]; rfl + dsimp only [o1] at hz ⊢ + rw [hz] + · have hw : j + 8 + 1 = j + 9 := by omega + have hf : 2 ^ j * 456 - 1 + (z + 1) = z + 2 ^ j * 456 := by omega + dsimp only [o1] + simp only [hw,hf] +def nq (j : Nat) (q : List Token) : List Token := + .b :: .a :: (tab ^ (2 ^ j * 16 - 5) ++ [.a,.a,.a] ++ tb ^ (2 ^ j * 56 - 1) ++ q) +theorem z2b (j : Nat) (q : List Token) (y : Nat) (rest : zF) : + (OV (j + 9) (tab ^ (2 ^ j * 16 - 2) ++ [.a,.a,.a] ++ tb ^ (2 ^ j * 56 - 1) ++ q ++ [.b]) + (0 :: (o1 ^ y ++ rest))) [target_tm]⊢⁺ + (ck (tb ^ (j + 10)) [.a,.b] + (0 :: (enc (.a :: (nq j q ++ [.b])) ++ z1 ++ o1 ^ (y + 2 ^ j * 1024 + 2) ++ rest))) := by + have h2j : 2 ^ j >= 1 := Nat.one_le_two_pow + have hp9 : 2 ^ (j + 9) = 2 ^ j * 512 := by rw [z21 j 9]; rfl + have h1 := o2 (j + 9) (tab ^ (2 ^ j * 16 - 3) ++ [.a,.a,.a] ++ tb ^ (2 ^ j * 56 - 1) ++ q) (o1 ^ y ++ rest) + have hend : z19 (.a :: .a :: .b :: .a :: .b :: (tab ^ (2 ^ j * 16 - 5) ++ [.a,.a,.a] ++ tb ^ (2 ^ j * 56 - 1) ++ q ++ [.b])) := by + refine Or.inr ⟨.a :: .a :: .b :: .a :: .b :: (tab ^ (2 ^ j * 16 - 5) ++ [.a,.a,.a] ++ tb ^ (2 ^ j * 56 - 1) ++ q),?_⟩ + simp only [List.append_assoc,List.cons_append] + have h2 := z1f (ts := .a :: .a :: .b :: .a :: .b :: (tab ^ (2 ^ j * 16 - 5) ++ [.a,.a,.a] ++ tb ^ (2 ^ j * 56 - 1) ++ q ++ [.b])) + (y + 1) rest (2 ^ j * 1024 - 1) (z0S (j + 9)) hend (by omega) + have h3 := o3 (j + 10) (tab ^ (2 ^ j * 16 - 5) ++ [.a,.a,.a] ++ tb ^ (2 ^ j * 56 - 1) ++ q) (o1 ^ (y + 2 ^ j * 1024) ++ rest) + refine zPt (z0b h1 ?_ rfl) (zPt (z0b h2 ?_ rfl) (z0b h3 ?_ ?_)) + · have hk : 2 ^ j * 16 - 2 = 1 + (2 ^ j * 16 - 3) := by omega + rw [hk,pow_add tab 1 (2 ^ j * 16 - 3)] + dsimp only [tab] + simp only [z1j,List.append_assoc,List.cons_append,List.nil_append] + · have hk : 2 ^ j * 16 - 3 = 2 + (2 ^ j * 16 - 5) := by omega + rw [hk,pow_add tab 2 (2 ^ j * 16 - 5)] + have hy : (1 : Fin 2) :: (o1 ^ y ++ rest) = o1 ^ (y + 1) ++ rest := by + rw [z01 o1 y]; rfl + dsimp only [o1,tab] at hy ⊢ + rw [hy] + simp only [z1k,List.append_assoc,List.cons_append,List.nil_append] + · have hw : j + 9 + 1 = j + 10 := by omega + have hf : 2 ^ j * 1024 - 1 + (y + 1) = y + 2 ^ j * 1024 := by omega + dsimp only [o1] + simp only [hw,hf] + · dsimp only [nq,o1,z1,tb] + have hy : (1 : Fin 2) :: 1 :: ([1] ^ (y + 2 ^ j * 1024) ++ rest) = [1] ^ (y + 2 ^ j * 1024 + 2) ++ rest := by + have : y + 2 ^ j * 1024 + 2 = 2 + (y + 2 ^ j * 1024) := by omega + rw [this,pow_add [1] 2 (y + 2 ^ j * 1024),z1k] + simp only [List.append_assoc,List.cons_append,List.nil_append] + simp only [List.append_assoc,List.cons_append,List.nil_append,hy] +theorem z2c (j : Nat) (q : List Token) (z : Nat) (rest : zF) : + (ck (tb ^ (j + 10)) [.a,.b] + (0 :: (enc (.a :: (q ++ [.b])) ++ z1 ++ o1 ^ z ++ rest))) [target_tm]⊢⁺ + (z1X (j + 5) (q ++ [.b]) z rest) := by + have h2j : 2 ^ j >= 1 := Nat.one_le_two_pow + have hp10 : 2 ^ (j + 10) = 2 ^ j * 1024 := by rw [z21 j 10]; rfl + have hp11 : 2 ^ (j + 5 + 6) = 2 ^ j * 2048 := by + have : j + 5 + 6 = j + 11 := by omega + rw [this,z21 j 11]; rfl + have h1 := z1f (ts := []) 0 (enc (.a :: (q ++ [.b])) ++ z1 ++ o1 ^ z ++ rest) (2 ^ j * 2048 - 1) + (z0S (j + 10)) (Or.inl rfl) (by omega) + have h2 := o01 (j + 11) 0 (2 ^ j * 2048 - 1) (enc (.a :: (q ++ [.b])) ++ z1 ++ o1 ^ z ++ rest) (by omega) + have h3 := z1q (tb ^ (j + 10)) [.a,.a,.a] (o1 ^ (2 ^ j * 2048 - 5) ++ enc (.a :: (q ++ [.b])) ++ z1 ++ o1 ^ z ++ rest) + refine zPt (z0b h1 ?_ rfl) (zPt (z0b h2 ?_ rfl) (z0b h3 ?_ ?_)) + · dsimp only [tb] + simp only [zPz,List.append_assoc,List.cons_append,List.nil_append] + · have hw : j + 10 + 1 = j + 11 := by omega + have hf : 2 ^ j * 2048 - 1 + 0 = 2 ^ j * 2048 - 1 := by omega + simp only [hw,hf,Nat.zero_mul,zPz] + · have hj : j + 11 = 1 + (j + 10) := by omega + have hp : 2 ^ j * 2048 - 1 + 0 - 2 = 2 + (2 ^ j * 2048 - 5) := by omega + rw [hj,pow_add [Token.b] 1 (j + 10),hp,pow_add [1] 2 (2 ^ j * 2048 - 5)] + dsimp only [o1,tb] + simp only [zPz,z1j,z1k,List.append_assoc,List.cons_append,List.nil_append] + · dsimp only [z1X] + refine z1o (by omega) ?_ + have hp := z04 (1 : Fin 2) (2 ^ j * 2048 - 5) (0 :: (enc (q ++ [.b]) ++ [0] ++ o1 ^ z ++ rest)) + have hlen : 2 ^ j * 2048 - 5 + 1 = 2 ^ (j + 5 + 6) - 4 := by omega + dsimp only [enc,tk,o1,z1] at hp ⊢ + simp only [hlen,List.append_assoc,List.cons_append,List.nil_append] at hp ⊢ + exact hp +theorem z2d (j : Nat) (q : List Token) (z : Nat) (rest : zF) : + (z1X j (q ++ [.b]) z rest) [target_tm]⊢⁺ + (z1X (j + 5) (nq j q ++ [.b]) (z + 2 ^ j * 1480 + 2) rest) := by + have h0 := z29 j (q ++ [.b]) z rest + have h1 := z2a j q z rest + have h2 := z2b j q (z + 2 ^ j * 456) rest + have h3 := z2c j (nq j q) (z + 2 ^ j * 1480 + 2) rest + refine zPt h0 (zPt h1 (zPt (z0b h2 rfl ?_) h3)) + have hz : z + 2 ^ j * 456 + 2 ^ j * 1024 + 2 = z + 2 ^ j * 1480 + 2 := by omega + simp only [hz] +theorem z2e : + (init []) [target_tm]⊢* (z1X 4 [.b] 0 z1Y) := + zSt z1W + (zSt z22 + (zSt z23 + (zSt z24 + (zSt z26 + (zSt z27 z28))))) +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d) = some c') : + (multiStep target_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +def Inv (c : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ j q z,c = z1X j (q ++ [.b]) z z1Y +theorem z2f (m : Nat) : + ∃ N ≥ m,∃ c,multiStep target_tm (init []) N = some c /\ Inv c := by + induction m with + | zero => + rcases z2e with ⟨k,hk⟩ + exact ⟨k,Nat.zero_le k,_,hk,⟨4,[],0,rfl⟩⟩ + | succ m ih => + rcases ih with ⟨N,hN,c,h_ms,⟨j,q,z,rfl⟩⟩ + rcases z2d j q z z1Y with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,_,zMt target_tm _ _ _ N k h_ms h_step_k,⟨j + 5,nq j q,z + 2 ^ j * 1480 + 2,rfl⟩⟩ + +end Solution +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + + + +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases z2f (n + 1) with ⟨N,hN,c',h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := zIm h_N + rw [zMs,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RBHHH_0RC1LF_1LC1LD_1RE0RA_0RD1RF_0LD0LF diff --git a/BusyBeaver/BB6/NonHalt/M_1RBHHH_1LC0LF_1RD1LB_1RE0RD_1LB0RB_1LB0LA.lean b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1LC0LF_1RD1LB_1RE0RD_1LB0RB_1LB0LA.lean new file mode 100644 index 00000000..0045462f --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1LC0LF_1RD1LB_1RE0RD_1LB0RB_1LB0LA.lean @@ -0,0 +1,1133 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RBHHH_1LC0LF_1RD1LB_1RE0RD_1LB0RB_1LB0LA + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1LC0LF_1RD1LB_1RE0RD_1LB0RB_1LB0LA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 2000000 +variable {α β γ : Type*} [Inhabited α] [Inhabited β] [Inhabited γ] + +namespace Solution +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 2000000 + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 2000000 + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 2000000 +@[simp] theorem zMz (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0=some config:=rfl +@[simp] theorem zMo (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1=step M config:=rfl +@[simp] theorem zMs (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : Nat) : + multiStep M config (n + 1)=Option.bind (multiStep M config n) (step M):= by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default=default:= by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : HalfTape).head=0:=rfl +@[simp] theorem zDt : (default : HalfTape).tail=default:=rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s=s:=rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s=a >> (l +> s):=rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s=l1 +> (l2 +> s):= by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢^{1} c₂:= by simp [h] +theorem z01 {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢⁺ c₂:=⟨1,by decide,zSm tm c₁ c₂ h⟩ +theorem zMa {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m)=(multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m):= by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c3 : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c3) : + c₁ [tm]⊢^{n+m} c3:= by + rw [zMa,h₁]; simp [h₂] +theorem zPs {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂:= by obtain ⟨n,_,hn⟩:=h; exact ⟨n,hn⟩ +theorem zPt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c3) : c₁ [tm]⊢⁺ c3:= by + obtain ⟨n,n_pos,hn⟩:=h₁; obtain ⟨m,m_pos,hm⟩:=h₂ + exact ⟨n + m,by omega,zMt tm c₁ c₂ c3 n m hn hm⟩ +theorem z02 {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c3) : c₁ [tm]⊢⁺ c3:= by + obtain ⟨n,n_pos,hn⟩:=h₁; obtain ⟨m,hm⟩:=h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c₁ c₂ c3 n m hn hm⟩ +theorem z03 {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c3 : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c3) : c₁ [tm]⊢⁺ c3 := + z02 (z01 tm c₁ c₂ h₁) h₂ +macro "finish" : tactic => + `(tactic| exists 0 <;> rfl) +macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) +abbrev CCfg := Counter.CCfg (Fin 2) (Fin 6) +abbrev z04 (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev z0b (c : CCfg) : Option CCfg := Counter.bstep target_tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep target_tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (z04 c1) [target_tm]⊢⁺ (z04 c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ +abbrev t : BitWord:=[1,1,0,0] +abbrev d0 : BitWord:=[0,0] +abbrev d1 : BitWord:=[1,0] +abbrev one : BitWord:=[1] +abbrev lh : HalfTape:=[1,1,0,1,0,1] +> default +abbrev w_pre : BitWord:=t +@[simp] theorem zDd : d0 +> (default : HalfTape)=default:= by + simp [d0] +inductive Call where + | ch + | cj + | cp + | ca +def zCs : Call -> Fin 6 + | .ch => C + | .cj => B + | .cp => B + | .ca => C +def zCw : Call -> BitWord + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] + | .ca => [1,1,0,1,1] +def zCR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (r <{{zCs c}} (l <+ zCw c)) +def zCL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> r) {{D}}> l) +def zCf (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + zCL lh (w_pre +> r) +def z0f (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l,(zCR l c r1) [target_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + z0f c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem z0g {α : Type*} (l : List α) : l ^ (0 : Nat)=[]:=rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1)=l ++ l ^ n:=rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n)=l ++ l ^ n:= by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z0h {α : Type*} (l : List α) : l ^ (1 : Nat)=l:= by + change l ++ []=l; exact List.append_nil l +theorem z0i {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n)=l ^ m ++ l ^ n:= by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z0j {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3:= by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z0k {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3:= by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0l (w : BitWord) : Seg [] [] w w:= by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem z0m (ls : List Call) : Seg ls ls [] []:= by + intro r1 r2 h; exact h +theorem zSc {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3:= by + intro r1 r3 h + rcases z0k h with ⟨r2,ha,hb⟩ + exact z0j (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS0 {ls1 ls2 ls3 : List Call} {w1 w2 v1 v2 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls2 ls3 v1 v2) : + Seg ls1 ls3 (w1 ++ v1) (w2 ++ v2):= by + intro r1 r2 h + rw [append_assoc,append_assoc] + exact h1 (v1 +> r1) (v2 +> r2) (h2 r1 r2 h) +theorem zS4 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2:= by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2:= by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc1 (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [target_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2:= by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem z0n : Seg [.cp] [.ch] t (t ++ [0]) := + zS2 (mid:=[1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0o : Seg [.cj] [.ch] t (t ++ one) := + zS2 (mid:=[1,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0p : Seg [.ch] [.cj] (t ++ [0]) t := + zS2 (mid:=[1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1:=[1,0,1,1]) (mid2:=[1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0q : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1:=[1,0,1,1]) (mid2:=[1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0r : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0s : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid:=[1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1 d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0t : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid:=[1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0u : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1:=[1,0,1,1]) (mid2:=[1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0v : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid:=[1,1]) + (fun l r => by unfold zCR zCw zCs d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0w : Seg [.cj] [.cp] d1 d0 := + zS2 (mid:=[1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons,append_nil]; execute) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid:=[1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem H_T (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t:= by + induction n with + | zero => exact z0l t + | succ n ih => + have h_eq : (n + 1) * 2=2 + n * 2:= by omega + rw [zLp,h_eq,z0i] + exact zSg z0q ih +theorem zSa {w2 : BitWord} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2:= by + induction n with + | zero => exact z0l w2 + | succ n ih => + have h_eq : (n + 1) * 2=2 + n * 2:= by omega + rw [h_eq,z0i,zLp] + exact zSg hw ih +theorem z0x : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0y : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem z0z (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d0 d0 := + zSa z0x n +theorem z0A (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ n) d0 d1:= by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg zH0 (zSa z0y n) +theorem z0B (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d1 d1 := + zSa z0y n +theorem z0C (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ (1 + n)) d1 d0:= by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg zH4 (zSa z0x n) +theorem z0D (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (n * 2)) t t:= by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0n z0p) (H_T n) +theorem z0E (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (1 + n * 2)) t t:= by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0o zH2) (H_T n) +theorem z0F (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t:= by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0r zH2) (H_T n) +theorem z0G (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0s (H_T n) +theorem z0H (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0t (H_T n) +theorem z0I (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t:= by + simpa only [zLp',List.cons_append,List.nil_append] using zSg z0u (H_T n) +theorem z0J (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0:= by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0v (zSg zH1 zH3) + have h1:=zSg h0 (zSa z0x n) + have heq : (2 + n * 2)=1 + (1 + n * 2):= by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0K (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0w (zSa z0x n) +theorem z0L : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0v zH1 +theorem z0M (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1:= by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0v (zSg zH1 (zSg zH3 zH0)) + have h1:=zSg h0 (zSa z0y n) + have heq : (3 + n * 2)=1 + (1 + (1 + n * 2)):= by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0N (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1:= by + have h0 : Seg [.cj,.ch] [.cp] d1 d1:=zSg z0w zH0 + have h1:=zSg h0 (zSa z0y n) + simpa only [zLp',List.cons_append,List.nil_append] using h1 +theorem z0O : Side [.ch] default (d1 +> default):= by + refine Side.cons (fun l => ?_) (Side.nil _) + unfold zCR zCL zCw zCs d1 + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute +theorem z0P {r1 r3 : HalfTape} (h : Side [.ch,.ch] r1 r3) : + Side [.ca] r1 (t +> r3):= by + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + have h0 : zCR l .ca r1=zCR ([1,0,1,1] +> l) .ch r1:= by + unfold zCR zCw zCs + simp only [List.cons_append,List.nil_append,append_cons,append_nil] + have h2 : ∀ r,(zCL ([1,0,1,1] +> l) r) [target_tm]⊢⁺ (zCR ([1,0,1,0] +> l) .ch r):= by + intro r; unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute + have h3 : (zCL ([1,0,1,0] +> l) r3) [target_tm]⊢⁺ (zCL l (t +> r3)):= by + unfold zCL t; simp only [append_cons,append_nil]; execute + rw [h0] + exact zPt (hc1 ([1,0,1,1] +> l)) + (zPt (h2 _) (zPt (hc2 ([1,0,1,0] +> l)) h3)) +theorem z0Q : Seg [.cj,.ca] ([.ch,.cj] ++ [.ch] ^ 3) w_pre (w_pre ++ t):= by + intro r1 r3 h + rcases h with _ | ⟨hch,hrest⟩ + have h1:=z0o r1 _ (Side.cons hch (Side.nil _)) + rcases h1 with _ | ⟨hcj,hnil⟩ + cases hnil + have h2:=(zSg zH2 z0q) _ r3 hrest + have h3:=z0P h2 + rw [<- append_assoc t t r3] at h3 + exact Side.cons hcj h3 +theorem z0R (r : HalfTape) : + (zCL lh r) [target_tm]⊢⁺ (zCR ([1,0,1,0,1,0,1] +> default) .cj r):= by + unfold zCL zCR lh zCw zCs + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute +theorem z0S (r : HalfTape) : + (zCL ([1,0,1,0,1,0,1] +> default) r) [target_tm]⊢⁺ (zCR lh .ca r):= by + unfold zCL zCR lh zCw zCs + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute +open WordCalculus +open WordCalculus.Word +local notation "WordList" => List Word +def z3t : WordList := + [Q,V,Q,Q,Q,V,V,V,Q,V,V,V,Q,V,V,V,Q,V] +def z3u : WordList := + [K,V,K,K,K,V,V,V,K,V,V,V,K,V,V,V,K,V] +theorem z3w (n : Nat) : + Copy (31 + 32 * n) (260 + 256 * n) z3t z3u (809 + 512 * n) (2908 + 4096 * n):= by + unfold z3t z3u + refine copy_step_d11 (n':=16 + 16 * n) (k':=128 + 128 * n) (m:=64 + 64 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=33 + 32 * n) (k':=252 + 256 * n) (m:=125 + 128 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n':=17 + 16 * n) (k':=124 + 128 * n) (m:=62 + 64 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n':=9 + 8 * n) (k':=60 + 64 * n) (m:=30 + 32 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n':=5 + 4 * n) (k':=28 + 32 * n) (m:=14 + 16 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=11 + 8 * n) (k':=52 + 64 * n) (m:=25 + 32 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=23 + 16 * n) (k':=100 + 128 * n) (m:=49 + 64 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=47 + 32 * n) (k':=196 + 256 * n) (m:=97 + 128 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n':=24 + 16 * n) (k':=96 + 128 * n) (m:=48 + 64 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=49 + 32 * n) (k':=188 + 256 * n) (m:=93 + 128 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=99 + 64 * n) (k':=372 + 512 * n) (m:=185 + 256 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=199 + 128 * n) (k':=740 + 1024 * n) (m:=369 + 512 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n':=100 + 64 * n) (k':=368 + 512 * n) (m:=184 + 256 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=201 + 128 * n) (k':=732 + 1024 * n) (m:=365 + 512 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=403 + 256 * n) (k':=1460 + 2048 * n) (m:=729 + 1024 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=807 + 512 * n) (k':=2916 + 4096 * n) (m:=1457 + 2048 * n) (by omega) (by omega) (by omega) ?_ + refine copy_step_d11 (n':=404 + 256 * n) (k':=1456 + 2048 * n) (m:=728 + 1024 * n) (by omega) (by omega) (by omega) (by omega) ?_ + refine copy_step_T (n':=809 + 512 * n) (k':=2908 + 4096 * n) (m:=1453 + 2048 * n) (by omega) (by omega) (by omega) ?_ + exact Copy.nil _ _ +theorem z3x (q : Nat) (hQ : 5 <= q) : + CopyTwelve (List.replicate q V ++ z3t) (List.replicate q V ++ z3u):= by + have hPow : 2 ^ q=32 * 2 ^ (q - 5):= by + have heq : q=5 + (q - 5):= by omega + conv_lhs => rw [heq,Nat.pow_add] + have hPos:=pow_two_pos (q - 5) + have hTs:=copy_replicate_V q 0 8 + have hBase:=z3w (2 ^ (q - 5) - 1) + have h1 : (1 + 0) * 2 ^ q - 1=31 + 32 * (2 ^ (q - 5) - 1):= by omega + have h2 : 4 + 8 * 2 ^ q=260 + 256 * (2 ^ (q - 5) - 1):= by omega + rw [h1,h2] at hTs + exact ⟨_,_,copy_append hTs hBase⟩ +theorem z3y : isSafePrefix z3u=true:= by decide +kernel +def z3Q : WordList := + [Q,K,Q,K,Q,K,Q,Q,K] ++ List.replicate 15 Q +def z3R : WordList := + List.replicate 6 V ++ [Q,V] ++ List.replicate 3 Q ++ List.replicate 3 V ++ [Q] ++ + List.replicate 3 V ++ [K] ++ List.replicate 3 V ++ [Q,V,K,K] ++ List.replicate 4 Q ++ [K,Q,Q] +def u_5 : WordList:=[V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,Q,V,Q,Q,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,Q,V,V,Q,V,V,V,Q,V,K,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,K,V,V,V,V,V,K,K,K,Q,Q,Q,K,Q,K,K,K,Q,Q,Q,K,K,K,Q,Q,Q,K,K,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,Q] +def z3S : WordList:=[V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,Q,V,Q,Q,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,Q,V,V,Q,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,Q,V,V,Q,Q,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,Q,V,V,Q,V,Q,Q,Q,V,V,V,Q,Q,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,Q,V,V,V,Q,Q,K,V,Q,V,V,Q,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,K,Q,V,K,Q,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,Q,Q,K,V,V,K,K,V,V,K,K,Q,Q,V,V,V,K,Q,K,Q,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,K,V,V,K,V,Q,Q,V,Q,Q,V,V,V,V,Q,V,V,V,K,V,Q,V,V,V,V,V,V,K,K,K,K,K,K,Q,K,Q,Q,K,Q,Q,K,K,K,Q,K,Q,K,K,K,Q,K,K,Q,K,K,Q,Q,K,Q,K,Q,K,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,Q,Q,K,K,Q,K,K,K,K,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,K,Q,K,Q,Q,Q,K,Q,Q,Q,K,Q,K,Q,Q,K,Q,K,Q,Q,K,K,Q,Q,K,K,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def z3T : WordList:=[V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,Q,V,Q,Q,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,Q,V,V,Q,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,Q,V,V,Q,Q,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,Q,V,V,Q,V,Q,Q,Q,V,V,V,Q,Q,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,Q,V,V,V,Q,V,V,Q,V,V,Q,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,Q,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,Q,Q,K,V,V,Q,V,V,Q,K,V,Q,V,K,V,Q,V,Q,K,V,V,V,Q,V,K,K,V,Q,V,K,V,V,V,V,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,Q,Q,V,Q,V,V,V,V,Q,V,V,Q,V,K,Q,V,K,Q,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,Q,Q,V,V,V,V,V,K,Q,K,K,Q,Q,K,V,K,V,Q,Q,V,V,V,V,V,V,V,Q,V,V,K,V,V,V,V,K,V,Q,V,V,V,V,V,Q,V,V,V,K,V,V,Q,K,V,V,V,Q,V,V,K,Q,V,V,K,V,V,V,V,Q,Q,V,V,V,Q,V,V,V,V,V,V,K,V,V,K,V,Q,Q,V,Q,Q,V,V,V,V,Q,V,V,V,K,V,Q,V,V,V,V,V,V,V,K,K,K,K,K,K,K,Q,K,Q,Q,K,Q,Q,Q,Q,Q,K,Q,K,K,K,K,K,Q,Q,Q,Q,K,Q,K,Q,K,K,Q,Q,K,K,Q,K,K,Q,K,K,Q,Q,K,Q,K,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,K,K,K,Q,K,Q,K,Q,Q,K,K,Q,K,Q,Q,Q,Q,K,Q,K,Q,Q,Q,K,Q,K,K,K,K,K,K,K,K,K,K,K,K,K,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,K,Q,K,K,K,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,K,K,K,K,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,K,Q,Q,K,Q,K,Q,Q,K,K,Q,Q,K,K,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def z3U : WordList:=[V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,Q,V,Q,Q,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,Q,V,V,Q,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,Q,V,V,Q,Q,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,Q,V,V,Q,V,Q,Q,Q,V,V,V,Q,Q,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,Q,V,V,V,Q,V,V,Q,V,V,Q,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,Q,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,Q,Q,V,Q,V,Q,V,K,V,Q,Q,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,Q,Q,V,K,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,Q,Q,V,V,V,V,V,V,K,K,V,K,V,Q,V,K,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,V,K,V,V,V,V,V,Q,V,V,V,Q,V,V,Q,K,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,Q,V,V,V,V,V,V,Q,V,V,Q,V,K,Q,V,K,Q,V,V,V,V,Q,V,V,V,Q,V,K,V,V,V,V,V,V,V,Q,V,V,V,V,Q,K,K,V,Q,Q,Q,V,V,K,V,V,Q,Q,V,K,V,V,V,Q,V,K,V,Q,V,Q,V,Q,V,V,K,Q,Q,K,K,Q,Q,K,Q,V,V,Q,V,K,V,Q,V,V,K,V,V,V,K,V,V,V,K,K,K,Q,Q,K,Q,Q,K,Q,K,K,V,V,V,V,K,V,V,V,Q,V,V,V,Q,V,K,Q,V,K,V,V,Q,K,V,V,V,Q,V,V,K,Q,V,V,K,V,V,V,V,Q,Q,V,V,V,Q,V,V,V,V,V,V,K,V,V,K,V,Q,Q,V,Q,Q,V,V,V,V,Q,V,V,V,K,V,V,V,V,V,V,V,V,V,K,K,K,K,K,K,K,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,K,Q,K,K,K,K,K,K,K,K,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,K,Q,Q,K,K,K,K,Q,K,Q,Q,Q,K,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,K,K,Q,K,Q,K,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,K,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,K,Q,K,K,K,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,K,K,K,K,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,K,Q,Q,K,Q,K,Q,Q,K,K,Q,Q,K,K,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def z3V : WordList:=[V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,Q,Q,V,V,V,Q,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,Q,V,Q,Q,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,Q,V,V,Q,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,V,Q,V,Q,V,Q,V,V,Q,V,V,Q,Q,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,Q,V,V,Q,V,Q,Q,Q,V,V,V,Q,Q,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,Q,V,V,V,Q,V,V,Q,V,V,Q,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,Q,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,Q,Q,V,K,V,Q,V,Q,V,K,K,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,Q,Q,V,K,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,Q,Q,V,V,V,V,V,V,V,V,K,V,K,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,Q,V,V,V,Q,V,V,Q,Q,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,Q,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,Q,Q,K,V,Q,K,Q,V,V,Q,V,V,Q,K,V,K,V,V,V,Q,V,Q,V,K,V,Q,V,Q,V,V,V,V,K,Q,Q,V,V,V,Q,V,Q,V,K,V,V,Q,V,V,V,Q,V,V,V,V,V,V,K,V,Q,Q,K,V,V,V,V,Q,V,V,V,Q,V,V,V,Q,V,V,V,K,V,V,Q,K,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,Q,V,V,V,V,V,V,Q,V,V,Q,V,K,Q,V,K,Q,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,Q,Q,V,Q,Q,K,V,V,K,V,K,V,K,V,Q,Q,Q,V,Q,Q,K,V,K,K,V,V,Q,Q,V,V,Q,V,K,V,V,Q,K,V,K,V,V,V,V,K,V,Q,V,V,V,V,Q,Q,K,V,V,Q,V,Q,V,Q,K,V,V,V,V,Q,K,V,V,V,Q,K,V,V,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,V,V,Q,V,V,V,Q,V,K,Q,V,K,V,V,Q,K,V,V,V,Q,V,V,K,Q,V,V,K,V,V,V,V,Q,Q,V,V,V,Q,V,V,V,V,V,V,K,V,V,K,V,Q,Q,V,Q,Q,V,V,V,V,Q,V,V,V,K,V,Q,V,V,V,V,V,V,V,V,K,K,K,K,K,K,K,K,Q,K,Q,Q,K,Q,Q,Q,Q,Q,K,Q,K,K,K,K,K,K,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,K,K,K,Q,Q,K,Q,K,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,Q,K,K,K,Q,K,K,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,K,K,K,Q,K,Q,K,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,K,K,Q,K,Q,Q,Q,K,K,Q,K,K,Q,K,K,K,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,K,Q,K,K,K,Q,K,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,K,K,K,K,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,K,Q,Q,Q,K,Q,K,Q,Q,K,Q,K,Q,Q,K,K,Q,Q,K,K,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +theorem z3W : EntrySpec 20 z3t z3Q 9000 := entrySpec_of_checkEntrySpec (by decide +kernel) +set_option maxRecDepth 4000000 in +theorem z3X : evalLowerRounds 5 z3R=some u_5:= by decide +kernel +set_option maxRecDepth 4000000 in +theorem z3Y : evalLowerRounds 5 u_5=some z3S:= by decide +kernel +set_option maxRecDepth 4000000 in +theorem z3Z : evalLowerRounds 2 z3S=some z3T:= by decide +kernel +set_option maxRecDepth 4000000 in +theorem z40 : evalLowerRounds 1 z3T=some z3U:= by decide +kernel +set_option maxRecDepth 4000000 in +theorem z41 : evalLowerRounds 1 z3U=some z3V:= by decide +kernel +set_option maxRecDepth 4000000 in +theorem z42 : checkEntryTwo 20 z3t z3Q 9000 (z3V ++ [Q]) 1852706365173628188237142867651181648556690957234892077209186308856837946639875 587146083964752735467109177766019616504586562932017459858360926881414728156959077196424392135657539255289087=true:= by decide +kernel +theorem z43 : ∃ v,LowerRounds z3R v /\ AggState z3t 16 20 (v ++ [Q]):= by + refine ⟨z3V,?_,good_of_checkEntryTwo 20 z3t z3Q 9000 (z3V ++ [Q]) 1852706365173628188237142867651181648556690957234892077209186308856837946639875 587146083964752735467109177766019616504586562932017459858360926881414728156959077196424392135657539255289087 z3W z42⟩ + exact lowerRounds_trans (evalLowerRounds_sound 5 z3R u_5 z3X) + (lowerRounds_trans (evalLowerRounds_sound 5 u_5 z3S z3Y) + (lowerRounds_trans (evalLowerRounds_sound 2 z3S z3T z3Z) + (lowerRounds_trans (evalLowerRounds_sound 1 z3T z3U z40) + (evalLowerRounds_sound 1 z3U z3V z41)))) +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) +theorem z44 {k : Nat} (hK : 0 < k) : ∃ hs,Num k [] hs:= by + rcases even_or_odd_mul_two k with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · cases a with + | zero => omega + | succ a => + have heq : (a + 1) * 2=2 + a * 2:= by omega + rw [heq]; exact ⟨[.cj] ++ [.ch] ^ a,Num.even a⟩ + · exact ⟨[.cp] ++ [.ch] ^ a,Num.odd a⟩ +theorem z45 {k : Nat} {hs hs' : List Call} (h1 : Num k [] hs) (h2 : Num k [] hs') : + hs=hs':= by + cases h1 with + | @odd n => + generalize hk : 1 + n * 2=k0 at h2 + cases h2 with + | @odd m => + have hnm : n=m:= by omega + subst hnm; rfl + | even _ => omega + | @even n => + generalize hk : 2 + n * 2=k0 at h2 + cases h2 with + | odd _ => omega + | @even m => + have hnm : n=m:= by omega + subst hnm; rfl +def z46 (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs,Num k w hs -> Side hs (w +> r) r' +theorem z47 {r r' : HalfTape} (h : z46 0 r r') : + r'=one +> r:= by + have h0:=h one [] Num.zero + cases h0 + rfl +theorem z48 {n : Nat} {r r' : HalfTape} + (hI : z46 (n * 2) r r') : z46 (2 + n * 4) (d0 +> r) (d0 +> r'):= by + intro w hs hN + generalize hk : 2 + n * 4=k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m=n * 2:= by omega + subst hm + cases n with + | zero => + have hr':=z47 hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0v (Side.nil r) + | succ n => + have heq : (n + 1) * 2=2 + n * 2:= by omega + rw [heq] + refine zSc (z0J n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n):= by + rw [heq]; exact Num.even n + simpa using hI [] _ hN2 +theorem z49 {n : Nat} {r r' : HalfTape} + (hI : z46 (n * 2) r r') : z46 (4 + n * 4) (d0 +> r) (d1 +> r'):= by + intro w hs hN + generalize hk : 4 + n * 4=k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m=1 + n * 2:= by omega + subst hm + cases n with + | zero => + have hr':=z47 hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0L (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2=3 + n * 2:= by omega + rw [heq] + refine zSc (z0M n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n):= by + have heq2 : (n + 1) * 2=2 + n * 2:= by omega + rw [heq2]; exact Num.even n + simpa using hI [] _ hN2 +theorem z4a {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hZ : A=0) : + evalWords da default=default:= by + induction hD with + | nil => rfl + | @zero A H u _ ih => + have hA0 : A=0:= by omega + dsimp only [evalWords] + rw [ih hA0,zDd] + | one _ => omega +theorem z4b {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hPos : 0 < A) : + z46 ((A - 1) * 2) default (evalWords da default):= by + induction hD with + | nil => omega + | @zero A H u _ ih => + have hA_pos : 0 < A:= by omega + have hIH:=ih hA_pos + have hs:=z48 hIH + rw [zDd] at hs + have heq : (A * 2 - 1) * 2=2 + (A - 1) * 4:= by omega + dsimp [evalWords] + rwa [heq] + | @one A H u hDu ih => + cases A with + | zero => + change z46 0 default (d1 +> evalWords u default) + rw [z4a hDu rfl] + intro w hs hN + generalize hk : 0=k0 at hN + cases hN with + | zero => + have hd : d1 +> (default : HalfTape)=one +> default:= by simp [d1,one] + rw [hd]; exact Side.nil (one +> default) + | odd _ => omega + | even _ => omega + | succ A => + have hA_pos : 0 < A + 1:= by omega + have hIH:=ih hA_pos + have heq_in : (A + 1 - 1) * 2=A * 2:= by omega + rw [heq_in] at hIH + have hs:=z49 hIH + rw [zDd] at hs + have heq : (1 + (A + 1) * 2 - 1) * 2=4 + A * 4:= by omega + dsimp [evalWords] + rwa [heq] +theorem zEd {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ∀ {A H : Nat},DigitVal A H v -> Seg ([Call.ch] ^ n) ([Call.ch] ^ b) (wordsToBits u) (wordsToBits v):= by + induction hI with + | nil n => + intro A H _ + exact z0m ([Call.ch] ^ n) + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | d00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0z _) (ih hD') + | d01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0A _) (ih hD') + | d10 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0B _) (ih hD') + | d11 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0C _) (ih hD') +theorem z4c {n : Nat} {hs hs' : List Call} + (hI : Num (3 + n) [] hs) (hJ : Num (2 + n * 2) [] hs') : + Seg hs ([Call.ch] ++ hs') t t:= by + generalize hk1 : 3 + n=k1 at hI + generalize hk2 : 2 + n * 2=k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1=1 + m:= by omega + have hq : q=m * 2:= by omega + subst hq + rw [h1m] + exact z0D m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1=1 + m:= by omega + have hq : q=1 + m * 2:= by omega + subst hq + rw [h1m] + exact z0E m +theorem z4d {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' (d1 ++ d0) t:= by + generalize hk1 : 1 + n=k1 at hI + generalize hk2 : n * 2=k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1=1 + m:= by omega + have hq : q=1 + m * 2:= by omega + subst hq + rw [h1m] + exact z0F m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + have hq : q=m * 2:= by omega + subst hq + exact z0G m +theorem z4e {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' (d1 ++ d1) t:= by + generalize hk1 : 1 + n=k1 at hI + generalize hk2 : 1 + n * 2=k2 at hJ + cases hI with + | @odd m => + cases hJ with + | @odd q => + have hq : q=m * 2:= by omega + subst hq + exact z0H m + | even _ => omega + | @even m => + cases hJ with + | @odd q => + have hq : q=1 + m * 2:= by omega + subst hq + exact z0I m + | even _ => omega +theorem z4f {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d0:= by + generalize hk1 : 2 + n * 4=k1 at hI + generalize hk2 : n * 2=k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m=2 + q * 2:= by omega + subst hm + exact z0J q +theorem z4g {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d0:= by + generalize hk1 : 2 + n * 4=k1 at hI + generalize hk2 : 1 + n * 2=k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m=q * 2:= by omega + subst hm + exact z0K q + | even _ => omega +theorem z4h {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d1:= by + generalize hk1 : 4 + n * 4=k1 at hI + generalize hk2 : n * 2=k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m=3 + q * 2:= by omega + subst hm + exact z0M q +theorem z4i {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d1:= by + generalize hk1 : 4 + n * 4=k1 at hI + generalize hk2 : 1 + n * 2=k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m=1 + q * 2:= by omega + subst hm + exact z0N q + | even _ => omega +theorem z4j {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : ℚ} + (hI : PhaseScan k v k' w a b) : + ∀ {u : WordList} {n n' : Nat} {hs hs' : List Call}, + WordEffect n u n' v -> Num k [] hs -> Num k' [] hs' -> + Seg (([Call.ch] ^ n) ++ hs) (([Call.ch] ^ n') ++ hs') (wordsToBits u) (wordsToBits w):= by + induction hI with + | nil k => + intro u n n' hs hs' hE hN hN' + cases hE + rw [z45 hN hN'] + exact z0m (([Call.ch] ^ n) ++ hs') + | @T m _ _ _ _ _ _ ih => + intro u0 n0 n1 hs hs' hE hN hN' + cases hE with + | T hSub => + rcases z44 (by omega : 0 < 2 + m * 2) with ⟨hs0,hN0⟩ + have hIH:=ih hSub hN0 hN' + have hStep:=zSg (H_T n0) (z4c hN hN0) + have heq : ([Call.ch] ^ (n0 * 2)) ++ ([Call.ch] ++ hs0)=([Call.ch] ^ (1 + n0 * 2)) ++ hs0:= by + have h1 : 1 + n0 * 2=n0 * 2 + 1:= by omega + rw [h1,z0i,z0h,List.append_assoc] + rw [heq] at hStep + exact zS0 hStep hIH + | @pair0 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,K] ++ u) at hE + rcases wordEffect_split_output [Q,K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2:=phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z44 hPos with ⟨hs0,hN0⟩ + have hD10 : DigitVal 1 2 [Q,K]:=DigitVal.one (DigitVal.zero DigitVal.nil) + have hStep:=zSg (zEd hL hD10) (z4d hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @pair1 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,Q] ++ u) at hE + rcases wordEffect_split_output [Q,Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z44 (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD11 : DigitVal 3 2 [Q,Q]:=DigitVal.one (DigitVal.one DigitVal.nil) + have hStep:=zSg (zEd hL hD11) (z4e hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short00 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2:=phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z44 hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K]:=DigitVal.zero DigitVal.nil + have hStep:=zSg (zEd hL hD0) (z4f hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short01 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z44 (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q]:=DigitVal.one DigitVal.nil + have hStep:=zSg (zEd hL hD1) (z4g hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short10 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2:=phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z44 hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K]:=DigitVal.zero DigitVal.nil + have hStep:=zSg (zEd hL hD0) (z4h hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short11 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z44 (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q]:=DigitVal.one DigitVal.nil + have hStep:=zSg (zEd hL hD1) (z4i hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') +theorem z4k {n : Nat} {r r' : HalfTape} + (hI : z46 (n * 2) r r') : z46 (1 + n) (d1 +> (d0 +> r)) (t +> r'):= by + intro w hs hN + generalize hk : 1 + n=k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil,<- append_assoc d1 d0 r] + cases m with + | zero => + have hn0 : n * 2=0:= by omega + rw [hn0] at hI + have hr':=z47 hI + subst hr' + rw [<- append_assoc t one r] + exact zSc z0r (Side.nil r) + | succ m => + have h1m : m + 1=1 + m:= by omega + rw [h1m] + refine zSc (z0F m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)):= by + have hm : n * 2=2 + (1 + m * 2) * 2:= by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil,<- append_assoc d1 d0 r] + refine zSc (z0G m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (m * 2)):= by + have hm : n * 2=2 + (m * 2) * 2:= by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 +theorem z4l (padding : Nat) : + evalWords (List.replicate padding K) default=default:= by + induction padding with + | zero => rfl + | succ p ih => + change d0 +> evalWords (List.replicate p K) default=default + rw [ih,zDd] +theorem z4m {orig out : WordList} (hS : LowerStep orig out) : + ∃ r,Side ([.ch,.cj] ++ [.ch] ^ 3) (evalWords orig default) r /\ + evalWords out default=t +> r:= by + cases hS with + | intro padding eff k v a b J da hE hI hPosK hDA => + have hC0 : z46 ((k - 1) * 2) default (evalWords da default) := + z4b hDA hPosK + have hC1 : z46 k (d1 +> default) (evalWords (V :: da) default):= by + have h:=z4k hC0 + have hk : 1 + (k - 1)=k:= by omega + rwa [hk,zDd] at h + have hN8 : Num 8 [] ([.cj] ++ [.ch] ^ 3):=Num.even 3 + rcases z44 hPosK with ⟨hs',hN'⟩ + have hSeg:=z4j hI hE hN8 hN' + dsimp at hSeg + have hSide:=zSc hSeg (z0j z0O (hC1 [] hs' hN')) + rw [wordsToBits_append_tape,wordsToBits_append_tape,evalWords_append,z4l] at hSide + refine ⟨evalWords (v ++ V :: da) default,?_,rfl⟩ + rwa [evalWords_append] +theorem z4n {r r' : HalfTape} (hI : Side ([.ch,.cj] ++ [.ch] ^ 3) r r') : + (zCf r) [target_tm]⊢⁺ zCf (t +> r'):= by + have hS:=zSc z0Q hI + rcases hS with _ | ⟨hcj,hrest⟩ + rcases hrest with _ | ⟨hca,hnil⟩ + cases hnil + have h1:=zPt (z0R (w_pre +> r)) (hcj ([1,0,1,0,1,0,1] +> default)) + have h2:=zPt (z0S _) (hca lh) + have h3:=zPt h1 h2 + rwa [append_assoc] at h3 +theorem z4o {orig out : WordList} (hS : LowerStep orig out) : + (zCf (evalWords orig default)) [target_tm]⊢⁺ zCf (evalWords out default):= by + rcases z4m hS with ⟨r,hSide,hEq⟩ + rw [hEq] + exact z4n hSide +theorem z4p {u v : WordList} (hR : LowerRounds u v) : + (zCf (evalWords u default)) [target_tm]⊢* zCf (evalWords v default):= by + induction hR with + | refl u => exact ⟨0,rfl⟩ + | next hS _ ih => + rcases z4o hS with ⟨n1,_,hn1⟩ + rcases ih with ⟨n2,hn2⟩ + exact ⟨n1 + n2,zMt target_tm _ _ _ n1 n2 hn1 hn2⟩ +def z4q : CCfg:=⟨0,0,[],[]⟩ +def z4r : CCfg:=⟨3,1,[0,1,1,0,0,1,1,0,0,1,0,1,1,1,0,0,1,0,1,0,0,0,1,1],[0,1,0,1,0,1,1,1,1,0,1,0,1]⟩ +def z4s : CCfg:=⟨1,1,[0,1,0,0,1,1,0,0,1,0,0,1,1,0,0,1,0,1,0,1,0,1,1,0,0,1,1,0,0,0,0,1],[1,0,1,0,1,0,1,0,1,0,1,1,1,1,0,1,0,1]⟩ +def z4t : CCfg:=⟨3,1,[1,0,1,0,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,1],[1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,1,0,1,0,1]⟩ +def z4u : CCfg:=⟨3,1,[1,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,0,0,0,1],[1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,0,1]⟩ +def z4v : CCfg:=⟨3,1,[0,0,1,1,0,0,0,0,1,0,0,0,1,0,1],[1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,0,1]⟩ +def z4w : CCfg:=⟨5,1,[0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,0,1,0,1,0,1],[0,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4x : CCfg:=⟨5,0,[1,0,0,0,0,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,0,0,1,0,1,0,1,1],[0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,0,1,0,1]⟩ +def z4y : CCfg:=⟨2,1,[1,0,0,1,0,1,1,0,0,1,1,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,0,1],[1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,0,1,0,1]⟩ +def z4z : CCfg:=⟨4,1,[1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,0,1,0,1,1,0,0,0,0,1,0,0,0,1],[1,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,0,1,0,1]⟩ +def z4A : CCfg:=⟨5,0,[0,0,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1],[0,1,0,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,0,1]⟩ +def z4B : CCfg:=⟨4,1,[1,0,0,1,0,1,1,0,0,1,0,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,0,1,0,0,0,1],[0,1,0,1,0,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,0,1]⟩ +def z4C : CCfg:=⟨5,0,[0,1,1,0,0,1,0,1,1,0,0,1,0,1,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,0,0,0,1,0,1],[0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,1,0,1,0,1]⟩ +def z4D : CCfg:=⟨2,0,[0,0,0,0,0,1,1,0,0,0,0,1,0,1,0,1,0,1],[1,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,0,1]⟩ +def z4E : CCfg:=⟨5,0,[0,1,0,1,1,0,0,1,1,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1],[0,1,1,1,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,1,0,1,0,1]⟩ +def z4F : CCfg:=⟨1,1,[0,1,0,0,0,0,1,1,0,0,1,0,0,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,1,0,0,1,1,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,1],[1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,1,0,1,0,1]⟩ +def z4G : CCfg:=⟨1,0,[1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,1,0,1],[1,0,1,0,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4H : CCfg:=⟨1,1,[0,0,0,0,1,1,0,0,0,0,1,0,1,0,0,0,0,0,1],[1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4I : CCfg:=⟨1,0,[1,1,0,0,1,0,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,1,0,1,0,1,0,1],[1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4J : CCfg:=⟨1,0,[0,1,0,0,1,0,1,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1],[1,0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4K : CCfg:=⟨1,1,[0,0,0,0,1,1,0,0,0,0,0,0,1,0,1,0,0,0,1,0,1],[1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4L : CCfg:=⟨3,1,[1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1],[1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4M : CCfg:=⟨1,1,[0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,1],[1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4N : CCfg:=⟨3,1,[0,0,0,0,0,0,1,0,1,0,1,0,0,0,1],[1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4O : CCfg:=⟨3,1,[1,0,0,0,0,0,1,0,0,0,0,0,1,0,1],[1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4P : CCfg:=⟨3,0,[0,0,1,1,0,0,1,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,1],[1,1,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4Q : CCfg:=⟨3,1,[1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,1,0,1,0,1,0,1,0,1,0,1],[1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4R : CCfg:=⟨1,1,[0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1],[1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4S : CCfg:=⟨1,0,[0,0,1,1,0,0,0,0,1,0,1,0,1,0,0,0,1,0,0,0,0,0,1],[1,0,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4T : CCfg:=⟨3,0,[0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1],[1,1,1,0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4U : CCfg:=⟨1,1,[0,0,1,0,1,1,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,1],[1,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4V : CCfg:=⟨1,1,[0,1,0,0,0,0,1,1,0,0,0,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1],[1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4W : CCfg:=⟨1,0,[0,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,1,0,1],[1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4X : CCfg:=⟨3,1,[1,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,1],[1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4Y : CCfg:=⟨3,0,[0,0,1,0,1,1,0,0,1,0,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,0,1,0,1],[1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1]⟩ +def z4Z : CCfg:=⟨3,1,[0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,1,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,0,1,0,1],[1,0,1,0,1]⟩ +set_option maxRecDepth 4000000 in +theorem z50 : zCm z4q 1000=some z4r:= by decide +set_option maxRecDepth 4000000 in +theorem z51 : zCm z4r 1000=some z4s:= by decide +set_option maxRecDepth 4000000 in +theorem z52 : zCm z4s 1000=some z4t:= by decide +set_option maxRecDepth 4000000 in +theorem z53 : zCm z4t 1000=some z4u:= by decide +set_option maxRecDepth 4000000 in +theorem z54 : zCm z4u 1000=some z4v:= by decide +set_option maxRecDepth 4000000 in +theorem z55 : zCm z4v 1000=some z4w:= by decide +set_option maxRecDepth 4000000 in +theorem z56 : zCm z4w 1000=some z4x:= by decide +set_option maxRecDepth 4000000 in +theorem z57 : zCm z4x 1000=some z4y:= by decide +set_option maxRecDepth 4000000 in +theorem z58 : zCm z4y 1000=some z4z:= by decide +set_option maxRecDepth 4000000 in +theorem z59 : zCm z4z 1000=some z4A:= by decide +set_option maxRecDepth 4000000 in +theorem z5a : zCm z4A 1000=some z4B:= by decide +set_option maxRecDepth 4000000 in +theorem z5b : zCm z4B 1000=some z4C:= by decide +set_option maxRecDepth 4000000 in +theorem z5c : zCm z4C 1000=some z4D:= by decide +set_option maxRecDepth 4000000 in +theorem z5d : zCm z4D 1000=some z4E:= by decide +set_option maxRecDepth 4000000 in +theorem z5e : zCm z4E 1000=some z4F:= by decide +set_option maxRecDepth 4000000 in +theorem z5f : zCm z4F 1000=some z4G:= by decide +set_option maxRecDepth 4000000 in +theorem z5g : zCm z4G 1000=some z4H:= by decide +set_option maxRecDepth 4000000 in +theorem z5h : zCm z4H 1000=some z4I:= by decide +set_option maxRecDepth 4000000 in +theorem z5i : zCm z4I 1000=some z4J:= by decide +set_option maxRecDepth 4000000 in +theorem z5j : zCm z4J 1000=some z4K:= by decide +set_option maxRecDepth 4000000 in +theorem z5k : zCm z4K 1000=some z4L:= by decide +set_option maxRecDepth 4000000 in +theorem z5l : zCm z4L 1000=some z4M:= by decide +set_option maxRecDepth 4000000 in +theorem z5m : zCm z4M 1000=some z4N:= by decide +set_option maxRecDepth 4000000 in +theorem z5n : zCm z4N 1000=some z4O:= by decide +set_option maxRecDepth 4000000 in +theorem z5o : zCm z4O 1000=some z4P:= by decide +set_option maxRecDepth 4000000 in +theorem z5p : zCm z4P 1000=some z4Q:= by decide +set_option maxRecDepth 4000000 in +theorem z5q : zCm z4Q 1000=some z4R:= by decide +set_option maxRecDepth 4000000 in +theorem z5r : zCm z4R 1000=some z4S:= by decide +set_option maxRecDepth 4000000 in +theorem z5s : zCm z4S 1000=some z4T:= by decide +set_option maxRecDepth 4000000 in +theorem z5t : zCm z4T 1000=some z4U:= by decide +set_option maxRecDepth 4000000 in +theorem z5u : zCm z4U 1000=some z4V:= by decide +set_option maxRecDepth 4000000 in +theorem z5v : zCm z4V 1000=some z4W:= by decide +set_option maxRecDepth 4000000 in +theorem z5w : zCm z4W 1000=some z4X:= by decide +set_option maxRecDepth 4000000 in +theorem z5x : zCm z4X 1000=some z4Y:= by decide +set_option maxRecDepth 4000000 in +theorem z5y : zCm z4Y 171=some z4Z:= by decide +theorem z5z : + (init []) [target_tm]⊢* zCf (evalWords z3R default):= by + have h0 : (init [] : Cfg (Fin 2) (Fin 6))=z04 z4q:=rfl + have h2 : z04 z4Z=zCf (evalWords z3R default):= by + unfold z04 z4Z zCf zCL lh w_pre z3R + simp only [List.replicate,List.cons_append,List.nil_append,evalWords,wordsToBits,t,d1,d0,one,append_cons,append_nil,z00] + rfl + have hPlus : (z04 z4q) [target_tm]⊢⁺ (z04 z4Z) := + zPt (zTc (by decide) z50) + (zPt (zTc (by decide) z51) + (zPt (zTc (by decide) z52) + (zPt (zTc (by decide) z53) + (zPt (zTc (by decide) z54) + (zPt (zTc (by decide) z55) + (zPt (zTc (by decide) z56) + (zPt (zTc (by decide) z57) + (zPt (zTc (by decide) z58) + (zPt (zTc (by decide) z59) + (zPt (zTc (by decide) z5a) + (zPt (zTc (by decide) z5b) + (zPt (zTc (by decide) z5c) + (zPt (zTc (by decide) z5d) + (zPt (zTc (by decide) z5e) + (zPt (zTc (by decide) z5f) + (zPt (zTc (by decide) z5g) + (zPt (zTc (by decide) z5h) + (zPt (zTc (by decide) z5i) + (zPt (zTc (by decide) z5j) + (zPt (zTc (by decide) z5k) + (zPt (zTc (by decide) z5l) + (zPt (zTc (by decide) z5m) + (zPt (zTc (by decide) z5n) + (zPt (zTc (by decide) z5o) + (zPt (zTc (by decide) z5p) + (zPt (zTc (by decide) z5q) + (zPt (zTc (by decide) z5r) + (zPt (zTc (by decide) z5s) + (zPt (zTc (by decide) z5t) + (zPt (zTc (by decide) z5u) + (zPt (zTc (by decide) z5v) + (zPt (zTc (by decide) z5w) + (zPt (zTc (by decide) z5x) + (zTc (by decide) z5y)))))))))))))))))))))))))))))))))) + rw [<- h0,h2] at hPlus + rcases hPlus with ⟨n,_,hn⟩ + exact ⟨n,hn⟩ +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d)=some c') : + (multiStep target_tm c j).isSome:= by + rw [zMa] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +theorem z5A (m : Nat) : + ∃ N ≥ m,∃ p q w, + multiStep target_tm (init []) N=some (zCf (evalWords w default)) /\ + AggState z3t p q (w ++ [Q]):= by + induction m with + | zero => + rcases z43 with ⟨v0,hRounds,hGood0⟩ + rcases z5z with ⟨k1,hk1⟩ + rcases z4p hRounds with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,16,20,v0, + zMt target_tm _ _ _ k1 k2 hk1 hk2,hGood0⟩ + | succ m ih => + rcases ih with ⟨N,hN,p,q,w,h_ms,h_good⟩ + rcases aggState_lowerStep_of_copyTwelve z3t z3u z3y z3x p q w h_good + with ⟨w',hStep,h_good'⟩ + rcases z4o hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,1 + p,1 + q,w', + zMt target_tm _ _ _ N k h_ms h_step_k,h_good'⟩ + +end Solution + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 2000000 + + + +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases z5A (n + 1) with ⟨N,hN,_,_,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1))=N:=Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some:=zIm h_N + rw [zMs,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RBHHH_1LC0LF_1RD1LB_1RE0RD_1LB0RB_1LB0LA diff --git a/BusyBeaver/BB6/NonHalt/M_1RBHHH_1LC0RC_0LD0LC_1RE1RA_0RD1LF_0LE0LF.lean b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1LC0RC_0LD0LC_1RE1RA_0RD1LF_0LE0LF.lean new file mode 100644 index 00000000..346101d2 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1LC0RC_0LD0LC_1RE1RA_0RD1LF_0LE0LF.lean @@ -0,0 +1,593 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RBHHH_1LC0RC_0LD0LC_1RE1RA_0RD1LF_0LE0LF + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1LC0RC_0LD0LC_1RE1RA_0RD1LF_0LE0LF" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +set_option maxHeartbeats 2000000 +set_option maxRecDepth 2000 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepPlus_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, _, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail]) +macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step))) +macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + +theorem rule_E_b (l r : ListBlank (Fin 2)) : + (((1 : Fin 2) >> l) {{E}}> ([0, 1, 0, 0, 0, 1] +> r)) [target_tm]⊢⁺ + (((1 : Fin 2) >> l) {{C}}> ([0, 0, 0, 1, 0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_aa (l r : ListBlank (Fin 2)) : + (((1 : Fin 2) >> l) {{E}}> ([0, 1, 0, 1, 0, 1] +> r)) [target_tm]⊢⁺ + (((1 : Fin 2) >> ([1, 1, 0, 1] +> l)) {{E}}> ([0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_ab (l r : ListBlank (Fin 2)) : + (((1 : Fin 2) >> l) {{E}}> ([0, 1, 0, 1, 0, 0, 0, 1] +> r)) [target_tm]⊢⁺ + (((1 : Fin 2) >> ([0, 1, 1, 1, 0, 1] +> l)) {{E}}> ([0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_C_a (l r : ListBlank (Fin 2)) : + (((1 : Fin 2) >> ([0, 1] +> l)) {{C}}> ([0, 0] +> r)) [target_tm]⊢⁺ + (((1 : Fin 2) >> l) {{C}}> ([0, 0, 0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_C_b (l r : ListBlank (Fin 2)) : + (((1 : Fin 2) >> ([1, 1, 0, 1] +> l)) {{C}}> ([0, 0] +> r)) [target_tm]⊢⁺ + (((1 : Fin 2) >> l) {{C}}> ([0, 0, 0, 0, 0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_C_nil (r : ListBlank (Fin 2)) : + (((1 : Fin 2) >> default) {{C}}> ([0, 0] +> r)) [target_tm]⊢⁺ + (((1 : Fin 2) >> ([0, 1] +> default)) {{E}}> ([0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_end (l : ListBlank (Fin 2)) : + (((1 : Fin 2) >> l) {{E}}> ([0, 1, 0, 1, 0, 0, 1] +> default)) [target_tm]⊢⁺ + (l {{E}}> ([1, 0, 0, 0, 1, 0, 0, 1] +> default)) := by + dsimp [ListBlank.append]; execute + +theorem rule_EL_a (l r : ListBlank (Fin 2)) : + (([0, 1] +> l) {{E}}> ((1 : Fin 2) >> r)) [target_tm]⊢⁺ + (l {{E}}> ([1, 0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_EL_b (l r : ListBlank (Fin 2)) : + (([1, 1, 0, 1] +> l) {{E}}> ((1 : Fin 2) >> r)) [target_tm]⊢⁺ + (l {{E}}> ([1, 0, 0, 0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_EL_nil (r : ListBlank (Fin 2)) : + (default {{E}}> ((1 : Fin 2) >> r)) [target_tm]⊢⁺ + (((1 : Fin 2) >> default) {{E}}> ([0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + +abbrev T0 : List (Fin 2) := [0, 0, 0, 1] +abbrev T1 : List (Fin 2) := [0, 1, 0, 1] +abbrev T2 : List (Fin 2) := [0, 1, 0, 0, 0, 1] + +abbrev RoundC (r r' : ListBlank (Fin 2)) : Prop := + ∀ l : ListBlank (Fin 2), + (((1 : Fin 2) >> l) {{E}}> ([0, 1] +> r)) [target_tm]⊢⁺ + (((1 : Fin 2) >> l) {{C}}> ([0, 0] +> r')) + +abbrev RoundA (r r_out : ListBlank (Fin 2)) : Prop := + ∀ l : ListBlank (Fin 2), + (((1 : Fin 2) >> ([0, 1] +> l)) {{E}}> ([0, 1] +> r)) [target_tm]⊢⁺ + (((1 : Fin 2) >> l) {{C}}> ([0, 0] +> r_out)) + +theorem roundC_to_roundA {r r' : ListBlank (Fin 2)} (h : RoundC r r') : + RoundA r ([0, 1] +> r') := + fun l => stepPlus_trans (h ([0, 1] +> l)) (rule_C_a l r') + +theorem roundC_T0 (u : ListBlank (Fin 2)) : + RoundC (T0 +> u) (T1 +> u) := + fun l => rule_E_b l u + +theorem roundA_T0 (u : ListBlank (Fin 2)) : + RoundA (T0 +> u) (T1 +> ([0, 1] +> u)) := + roundC_to_roundA (roundC_T0 u) + +theorem roundC_T1 {u u' : ListBlank (Fin 2)} (h : RoundC u u') : + RoundC (T1 +> u) (T0 +> u') := + fun l => stepPlus_trans (rule_E_aa l u) (stepPlus_trans (h ([1, 1, 0, 1] +> l)) (rule_C_b l u')) + +theorem roundA_T1 {u u' : ListBlank (Fin 2)} (h : RoundC u u') : + RoundA (T1 +> u) (T2 +> u') := + roundC_to_roundA (roundC_T1 h) + +theorem roundC_T2 {u u' : ListBlank (Fin 2)} (h : RoundA u u') : + RoundC (T2 +> u) (T0 +> u') := + fun l => stepPlus_trans (rule_E_ab l u) (stepPlus_trans (h ([1, 1, 0, 1] +> l)) (rule_C_b l u')) + +theorem roundA_T2 {u u' : ListBlank (Fin 2)} (h : RoundA u u') : + RoundA (T2 +> u) (T2 +> u') := + roundC_to_roundA (roundC_T2 h) + +abbrev RoundE (r r' : ListBlank (Fin 2)) : Prop := + ∀ l : ListBlank (Fin 2), + (((1 : Fin 2) >> l) {{E}}> ([0, 1] +> r)) [target_tm]⊢⁺ + (l {{E}}> ((1 : Fin 2) >> r')) + +abbrev RoundEA (r r_out : ListBlank (Fin 2)) : Prop := + ∀ l : ListBlank (Fin 2), + (((1 : Fin 2) >> ([0, 1] +> l)) {{E}}> ([0, 1] +> r)) [target_tm]⊢⁺ + (l {{E}}> ((1 : Fin 2) >> r_out)) + +theorem roundE_to_roundEA {r r' : ListBlank (Fin 2)} (h : RoundE r r') : + RoundEA r ([0, 1] +> r') := + fun l => stepPlus_trans (h ([0, 1] +> l)) (rule_EL_a l r') + +theorem roundE_end : + RoundE ([0, 1, 0, 0, 1] +> default) ([0, 0, 0, 1, 0, 0, 1] +> default) := + fun l => rule_E_end l + +theorem roundE_T1 {u u' : ListBlank (Fin 2)} (h : RoundE u u') : + RoundE (T1 +> u) (T0 +> u') := + fun l => stepPlus_trans (rule_E_aa l u) (stepPlus_trans (h ([1, 1, 0, 1] +> l)) (rule_EL_b l u')) + +theorem roundEA_T1 {u u' : ListBlank (Fin 2)} (h : RoundE u u') : + RoundEA (T1 +> u) (T2 +> u') := + roundE_to_roundEA (roundE_T1 h) + +theorem roundE_T2 {u u' : ListBlank (Fin 2)} (h : RoundEA u u') : + RoundE (T2 +> u) (T0 +> u') := + fun l => stepPlus_trans (rule_E_ab l u) (stepPlus_trans (h ([1, 1, 0, 1] +> l)) (rule_EL_b l u')) + +theorem roundEA_T2 {u u' : ListBlank (Fin 2)} (h : RoundEA u u') : + RoundEA (T2 +> u) (T2 +> u') := + roundE_to_roundEA (roundE_T2 h) + +abbrev cfgE0 (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ((1 : Fin 2) >> ([0, 1] +> default)) {{E}}> ([0, 1] +> r) + +theorem sweep_step {r r_out : ListBlank (Fin 2)} (h : RoundA r r_out) : + (cfgE0 r) [target_tm]⊢⁺ (cfgE0 r_out) := + stepPlus_trans (h default) (rule_C_nil r_out) + +theorem era_end_step {r r_era r_next : ListBlank (Fin 2)} + (h₁ : RoundEA r r_era) (h₂ : RoundC r_era r_next) : + (cfgE0 r) [target_tm]⊢⁺ (cfgE0 r_next) := + stepPlus_trans (h₁ default) + (stepPlus_trans (rule_EL_nil r_era) + (stepPlus_trans (h₂ default) (rule_C_nil r_next))) + +abbrev bot : ListBlank (Fin 2) := [0, 0, 1] +> default +abbrev bota : ListBlank (Fin 2) := [0, 1, 0, 0, 1] +> default +abbrev botc : ListBlank (Fin 2) := [0, 1, 1] +> default + +theorem roundC_bot : RoundC bot botc := by + intro l; dsimp [bot, botc, ListBlank.append]; execute + +theorem roundC_botc : RoundC botc bot := by + intro l; dsimp [bot, botc, ListBlank.append]; execute + +inductive StepsA : ℕ → ListBlank (Fin 2) → ListBlank (Fin 2) → Prop where + | zero (u : ListBlank (Fin 2)) : StepsA 0 u u + | succ {n : ℕ} {u v w : ListBlank (Fin 2)} : + RoundA u v → StepsA n v w → StepsA (n + 1) u w + +theorem stepsA_trans {a b : ℕ} {u v w : ListBlank (Fin 2)} + (h1 : StepsA a u v) (h2 : StepsA b v w) : StepsA (a + b) u w := by + induction h1 with + | zero => rw [Nat.zero_add]; exact h2 + | succ h _ ih => rw [Nat.succ_add]; exact StepsA.succ h (ih h2) + +theorem stepsA_T2 {n : ℕ} {u w : ListBlank (Fin 2)} (h : StepsA n u w) : + StepsA n (T2 +> u) (T2 +> w) := by + induction h with + | zero u => exact StepsA.zero (T2 +> u) + | succ h1 _ ih => exact StepsA.succ (roundA_T2 h1) ih + +abbrev B3 (r : ListBlank (Fin 2)) : ListBlank (Fin 2) := + T2 +> (T2 +> (T2 +> r)) + +def powB3 : ℕ → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, r => r + | m + 1, r => B3 (powB3 m r) + +theorem powB3_B3 (m : ℕ) (r : ListBlank (Fin 2)) : + powB3 m (B3 r) = B3 (powB3 m r) := by + induction m with + | zero => rfl + | succ m ih => exact congrArg B3 ih + +theorem powB3_T2 (m : ℕ) (r : ListBlank (Fin 2)) : + powB3 m (T2 +> r) = T2 +> powB3 m r := by + induction m with + | zero => rfl + | succ m ih => exact congrArg B3 ih + +theorem roundA_B3 {u u' : ListBlank (Fin 2)} (h : RoundA u u') : + RoundA (B3 u) (B3 u') := + roundA_T2 (roundA_T2 (roundA_T2 h)) + +theorem roundA_powB3 (m : ℕ) {u u' : ListBlank (Fin 2)} (h : RoundA u u') : + RoundA (powB3 m u) (powB3 m u') := by + induction m with + | zero => exact h + | succ m ih => exact roundA_B3 ih + +theorem roundEA_B3 {u u' : ListBlank (Fin 2)} (h : RoundEA u u') : + RoundEA (B3 u) (B3 u') := + roundEA_T2 (roundEA_T2 (roundEA_T2 h)) + +theorem roundEA_powB3 (m : ℕ) {u u' : ListBlank (Fin 2)} (h : RoundEA u u') : + RoundEA (powB3 m u) (powB3 m u') := by + induction m with + | zero => exact h + | succ m ih => exact roundEA_B3 ih + +theorem stepsA_B3 {n : ℕ} {u w : ListBlank (Fin 2)} (h : StepsA n u w) : + StepsA n (B3 u) (B3 w) := + stepsA_T2 (stepsA_T2 (stepsA_T2 h)) + +theorem stepsA_powB3 (m : ℕ) {n : ℕ} {u w : ListBlank (Fin 2)} (h : StepsA n u w) : + StepsA n (powB3 m u) (powB3 m w) := by + induction m with + | zero => exact h + | succ m ih => exact stepsA_B3 ih + +theorem step6_022 {v v_C : ListBlank (Fin 2)} (hC : RoundC v v_C) : + StepsA 6 (T0 +> (T2 +> (T2 +> v))) (B3 (T0 +> (T2 +> v_C))) := by + refine StepsA.succ (roundA_T0 (T2 +> (T2 +> v))) ?_ + refine StepsA.succ (roundA_T1 (roundC_T1 (roundC_T0 (T2 +> v)))) ?_ + refine StepsA.succ (roundA_T2 (roundA_T0 (T1 +> (T2 +> v)))) ?_ + refine StepsA.succ (roundA_T2 (roundA_T1 (roundC_T1 (roundC_T1 (roundC_T0 v))))) ?_ + refine StepsA.succ (roundA_T2 (roundA_T2 (roundA_T0 (T0 +> (T1 +> v))))) ?_ + refine StepsA.succ (roundA_T2 (roundA_T2 (roundA_T1 (roundC_T2 (roundA_T1 hC))))) ?_ + exact StepsA.zero _ + +theorem finish8_22 {v v_C : ListBlank (Fin 2)} (hC : RoundC v v_C) : + StepsA 8 (T0 +> (T2 +> (T2 +> v))) (B3 (T2 +> (T0 +> (T1 +> v_C)))) := by + have h2 : StepsA 2 (T0 +> (T2 +> v_C)) (T2 +> (T0 +> (T1 +> v_C))) := by + refine StepsA.succ (roundA_T0 (T2 +> v_C)) ?_ + refine StepsA.succ (roundA_T1 (roundC_T1 (roundC_T0 v_C))) ?_ + exact StepsA.zero _ + exact stepsA_trans (step6_022 hC) (stepsA_B3 h2) + +theorem cross_B3 {u u1 u2 u3 : ListBlank (Fin 2)} + (h1 : RoundA u u1) (h2 : RoundA u1 u2) (h3 : RoundA u2 u3) : + StepsA 12 (T0 +> B3 u) (B3 (B3 (T0 +> u3))) := by + have h4 : StepsA 4 (T0 +> (T1 +> (T0 +> u1))) (T2 +> (T2 +> (T0 +> u3))) := by + refine StepsA.succ (roundA_T0 (T1 +> (T0 +> u1))) ?_ + refine StepsA.succ (roundA_T1 (roundC_T1 (roundC_T2 h2))) ?_ + refine StepsA.succ (roundA_T2 (roundA_T0 (T0 +> u2))) ?_ + refine StepsA.succ (roundA_T2 (roundA_T1 (roundC_T2 h3))) ?_ + exact StepsA.zero _ + exact stepsA_trans (finish8_22 (roundC_T2 h1)) (stepsA_B3 (stepsA_T2 h4)) + +theorem cross_powB3 (m : ℕ) {u w : ListBlank (Fin 2)} (h : StepsA (3 * m) u w) : + StepsA (12 * m) (T0 +> powB3 m u) (powB3 (2 * m) (T0 +> w)) := by + induction m generalizing u with + | zero => + cases h + exact StepsA.zero _ + | succ m ih => + cases h with + | succ h1 h => + cases h with + | succ h2 h => + cases h with + | succ h3 hrest => + have hc := cross_B3 (roundA_powB3 m h1) (roundA_powB3 m h2) (roundA_powB3 m h3) + have hrec := stepsA_B3 (stepsA_B3 (ih hrest)) + have htot := stepsA_trans hc hrec + rw [Nat.add_comm 12 (12 * m)] at htot + exact htot + +def fEra (k : ℕ) (u : ListBlank (Fin 2)) : ListBlank (Fin 2) := + T2 +> powB3 (k + 1) (T1 +> (T1 +> u)) + +inductive StepEra (k : ℕ) (u w : ListBlank (Fin 2)) : Prop where + | mk (u_E w_0 w_last v_C : ListBlank (Fin 2)) + (hE : RoundE u u_E) + (hC0 : RoundC ([0, 1] +> u_E) w_0) + (hA : StepsA (3 * k + 2) w_0 w_last) + (hClast : RoundC w_last v_C) + (hw : w = [0, 1] +> v_C) : StepEra k u w + +theorem stepEra_next {k : ℕ} {u w : ListBlank (Fin 2)} (h : StepEra k u w) : + StepEra (2 * (2 * k + 2) + 2) (fEra k u) (fEra (2 * k + 2) w) := by + rcases h with ⟨u_E, w_0, w_last, v_C, hE, hC0, hA, hClast, hw⟩ + refine StepEra.mk + (T0 +> powB3 (k + 1) (T2 +> (T0 +> u_E))) + (T0 +> powB3 (k + 1) (T2 +> (T1 +> ([0, 1] +> u_E)))) + (T2 +> powB3 (2 * k + 3) (T0 +> (T1 +> v_C))) + (T0 +> powB3 (2 * k + 3) (T1 +> (T1 +> w))) + (roundE_T2 (roundEA_powB3 (k + 1) (roundEA_T1 (roundE_T1 hE)))) + (roundC_T2 (roundA_powB3 (k + 1) (roundA_T2 (roundA_T0 u_E)))) + ?_ + ?_ + rfl + · have h3 : StepsA (3 * (k + 1)) (T2 +> (T1 +> ([0, 1] +> u_E))) (T2 +> (T2 +> w_last)) := + stepsA_T2 (StepsA.succ (roundA_T1 hC0) (stepsA_T2 hA)) + have hcross := cross_powB3 (k + 1) h3 + have hfin := stepsA_powB3 (2 * (k + 1)) (finish8_22 hClast) + have htot := stepsA_trans hcross hfin + have heq_t : + powB3 (2 * (k + 1)) (B3 (T2 +> (T0 +> (T1 +> v_C)))) = + T2 +> powB3 (2 * k + 3) (T0 +> (T1 +> v_C)) := by + rw [powB3_B3] + change powB3 (2 * k + 3) (T2 +> (T0 +> (T1 +> v_C))) = _ + exact powB3_T2 (2 * k + 3) (T0 +> (T1 +> v_C)) + have heq_n : 12 * (k + 1) + 8 = 3 * (2 * (2 * k + 2) + 2) + 2 := by omega + rw [heq_t, heq_n] at htot + exact htot + · rw [hw] + exact roundC_T2 (roundA_powB3 (2 * k + 3) (roundA_T0 (T1 +> v_C))) + +abbrev u_m2 : ListBlank (Fin 2) := + T2 +> (T1 +> (T2 +> (T2 +> (T2 +> (T1 +> bota))))) + +abbrev u_m1 : ListBlank (Fin 2) := + T2 +> (T2 +> (T2 +> (T2 +> (T1 +> (T2 +> (T1 +> (T2 +> (T2 +> (T1 +> bota))))))))) + +theorem stepEra_m2 : StepEra 2 u_m2 u_m1 := by + refine StepEra.mk + (T0 +> (T2 +> (T0 +> (T2 +> (T2 +> (T2 +> (T0 +> bot))))))) + (T0 +> (T2 +> (T1 +> (T1 +> (T0 +> (T2 +> (T2 +> (T0 +> bot)))))))) + (T2 +> (T2 +> (T2 +> (T2 +> (T0 +> (T0 +> (T1 +> (T2 +> (T2 +> (T1 +> bota)))))))))) + (T0 +> (T2 +> (T2 +> (T2 +> (T1 +> (T2 +> (T1 +> (T2 +> (T2 +> (T1 +> bota)))))))))) + (roundE_T2 (roundEA_T1 (roundE_T2 (roundEA_T2 (roundEA_T2 (roundEA_T1 roundE_end)))))) + (roundC_T2 (roundA_T2 (roundA_T0 (T2 +> (T2 +> (T2 +> (T0 +> bot))))))) + ?_ + (roundC_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T0 (T0 +> (T1 +> (T2 +> (T2 +> (T1 +> bota)))))))))) + rfl + refine StepsA.succ (roundA_T0 (T2 +> (T1 +> (T1 +> (T0 +> (T2 +> (T2 +> (T0 +> bot)))))))) ?_ + refine StepsA.succ (roundA_T1 (roundC_T1 (roundC_T0 (T1 +> (T1 +> (T0 +> (T2 +> (T2 +> (T0 +> bot))))))))) ?_ + refine StepsA.succ (roundA_T2 (roundA_T0 (T1 +> (T1 +> (T1 +> (T0 +> (T2 +> (T2 +> (T0 +> bot))))))))) ?_ + refine StepsA.succ (roundA_T2 (roundA_T1 (roundC_T1 (roundC_T1 (roundC_T1 (roundC_T2 (roundA_T2 (roundA_T2 (roundA_T0 bot))))))))) ?_ + refine StepsA.succ (roundA_T2 (roundA_T2 (roundA_T0 (T0 +> (T0 +> (T0 +> (T2 +> (T2 +> (T1 +> bota))))))))) ?_ + refine StepsA.succ (roundA_T2 (roundA_T2 (roundA_T1 (roundC_T2 (roundA_T0 (T0 +> (T2 +> (T2 +> (T1 +> bota))))))))) ?_ + refine StepsA.succ (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T0 (T1 +> (T2 +> (T2 +> (T2 +> (T1 +> bota))))))))) ?_ + refine StepsA.succ (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T1 (roundC_T1 (roundC_T1 (roundC_T0 (T2 +> (T2 +> (T1 +> bota)))))))))) ?_ + exact StepsA.zero _ + +theorem stepEra_m1 : StepEra 6 u_m1 (fEra 2 u_m2) := by + refine StepEra.mk + (T0 +> (T2 +> (T2 +> (T2 +> (T2 +> (T0 +> (T2 +> (T0 +> (T2 +> (T2 +> (T0 +> bot))))))))))) + (T0 +> (T2 +> (T2 +> (T2 +> (T2 +> (T1 +> (T1 +> (T0 +> (T0 +> (T2 +> (T2 +> (T0 +> bot)))))))))))) + (T2 +> (T2 +> (T2 +> (T2 +> (T2 +> (T2 +> (T2 +> (T2 +> (T2 +> (T2 +> (T0 +> (T1 +> (T0 +> (T1 +> (T2 +> (T2 +> (T2 +> (T1 +> bota)))))))))))))))))) + (T0 +> (T2 +> (T2 +> (T2 +> (T2 +> (T2 +> (T2 +> (T2 +> (T2 +> (T2 +> (T1 +> (T1 +> (T2 +> (T1 +> (T2 +> (T2 +> (T2 +> (T1 +> bota)))))))))))))))))) + (roundE_T2 (roundEA_T2 (roundEA_T2 (roundEA_T2 (roundEA_T1 (roundE_T2 (roundEA_T1 (roundE_T2 (roundEA_T2 (roundEA_T1 roundE_end)))))))))) + (roundC_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T0 (T2 +> (T0 +> (T2 +> (T2 +> (T0 +> bot))))))))))) + ?_ + (roundC_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T0 (T1 +> (T0 +> (T1 +> (T2 +> (T2 +> (T2 +> (T1 +> bota)))))))))))))))))) + rfl + have hc12 := cross_B3 + (roundA_T2 (roundA_T1 (roundC_T1 (roundC_T0 (T0 +> (T2 +> (T2 +> (T0 +> bot)))))))) + (roundA_T2 (roundA_T2 (roundA_T0 (T1 +> (T0 +> (T2 +> (T2 +> (T0 +> bot)))))))) + (roundA_T2 (roundA_T2 (roundA_T1 (roundC_T1 (roundC_T2 (roundA_T2 (roundA_T2 (roundA_T0 bot)))))))) + have hf8 := stepsA_B3 (stepsA_B3 (finish8_22 (roundC_T2 (roundA_T0 (T0 +> (T2 +> (T2 +> (T1 +> bota)))))))) + have htot := stepsA_trans hc12 hf8 + exact htot + +theorem stepsA_run {n : ℕ} {u v w : ListBlank (Fin 2)} + (h1 : (cfgE0 u) [target_tm]⊢⁺ (cfgE0 v)) (h2 : StepsA n v w) : + (cfgE0 u) [target_tm]⊢⁺ (cfgE0 w) := by + induction h2 generalizing u with + | zero => exact h1 + | succ ha _ ih => exact ih (stepPlus_trans h1 (sweep_step ha)) + +theorem stepEra_run {k : ℕ} {u w : ListBlank (Fin 2)} (h : StepEra k u w) : + (cfgE0 u) [target_tm]⊢⁺ (cfgE0 w) := by + rcases h with ⟨u_E, w_0, w_last, v_C, hE, hC0, hA, hClast, hw⟩ + rw [hw] + have h0 : (cfgE0 u) [target_tm]⊢⁺ (cfgE0 w_0) := + era_end_step (roundE_to_roundEA hE) hC0 + have h1 : (cfgE0 u) [target_tm]⊢⁺ (cfgE0 w_last) := + stepsA_run h0 hA + exact stepPlus_trans h1 (sweep_step (roundC_to_roundA hClast)) + +theorem init_to_botc : (init []) [target_tm]⊢⁺ (cfgE0 botc) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + dsimp [cfgE0, botc, ListBlank.append] + execute; exists 0 + +theorem botc_to_u0 : (cfgE0 botc) [target_tm]⊢⁺ (cfgE0 (fEra 2 u_m2)) := by + refine stepPlus_trans (sweep_step (roundC_to_roundA roundC_botc)) ?_ + refine stepPlus_trans (era_end_step (roundE_to_roundEA roundE_end) (roundC_T2 (roundC_to_roundA roundC_bot))) ?_ + refine stepPlus_trans (sweep_step (roundA_T0 ([0, 1] +> botc))) ?_ + refine stepPlus_trans (sweep_step (roundA_T1 (roundC_T1 roundC_botc))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T0 bot))) ?_ + refine stepPlus_trans (era_end_step (roundEA_T2 (roundEA_T1 roundE_end)) (roundC_T2 (roundA_T2 (roundA_T0 bot)))) ?_ + refine stepPlus_trans (sweep_step (roundA_T0 (T2 +> (T1 +> bota)))) ?_ + refine stepPlus_trans (sweep_step (roundA_T1 (roundC_T1 (roundC_T0 (T1 +> bota))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T0 (T1 +> (T1 +> bota))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T1 (roundC_T1 (roundC_T1 (roundC_T1 roundC_bot)))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T0 (T0 +> (T0 +> botc)))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T1 (roundC_T2 (roundA_T0 botc)))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T0 (T1 +> ([0, 1] +> botc))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T1 (roundC_T1 (roundC_T1 roundC_botc))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T0 (T0 +> bot))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T1 (roundC_T2 (roundC_to_roundA roundC_bot)))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T0 ([0, 1] +> botc)))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T1 (roundC_T1 roundC_botc)))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T0 bot)))))))) ?_ + refine stepPlus_trans (era_end_step (roundEA_T2 (roundEA_T2 (roundEA_T2 (roundEA_T2 (roundEA_T2 (roundEA_T2 (roundEA_T1 roundE_end))))))) (roundC_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T0 bot))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T0 (T2 +> (T2 +> (T2 +> (T2 +> (T2 +> (T2 +> (T1 +> bota))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T1 (roundC_T1 (roundC_T0 (T2 +> (T2 +> (T2 +> (T2 +> (T2 +> (T1 +> bota)))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T0 (T1 +> (T2 +> (T2 +> (T2 +> (T2 +> (T2 +> (T1 +> bota)))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T1 (roundC_T1 (roundC_T1 (roundC_T0 (T2 +> (T2 +> (T2 +> (T2 +> (T1 +> bota))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T0 (T0 +> (T1 +> (T2 +> (T2 +> (T2 +> (T2 +> (T1 +> bota))))))))))) ?_ + refine stepPlus_trans (era_end_step (roundEA_T2 (roundEA_T2 (roundEA_T1 (roundE_T2 (roundEA_T1 (roundE_T2 (roundEA_T2 (roundEA_T2 (roundEA_T2 (roundEA_T1 roundE_end)))))))))) (roundC_T2 (roundA_T2 (roundA_T2 (roundA_T0 (T2 +> (T0 +> (T2 +> (T2 +> (T2 +> (T2 +> (T0 +> bot)))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T0 (T2 +> (T2 +> (T1 +> (T1 +> (T0 +> (T0 +> (T2 +> (T2 +> (T2 +> (T2 +> (T0 +> bot))))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T1 (roundC_T1 (roundC_T0 (T2 +> (T1 +> (T1 +> (T0 +> (T0 +> (T2 +> (T2 +> (T2 +> (T2 +> (T0 +> bot)))))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T0 (T1 +> (T2 +> (T1 +> (T1 +> (T0 +> (T0 +> (T2 +> (T2 +> (T2 +> (T2 +> (T0 +> bot)))))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T1 (roundC_T1 (roundC_T1 (roundC_T0 (T1 +> (T1 +> (T0 +> (T0 +> (T2 +> (T2 +> (T2 +> (T2 +> (T0 +> bot))))))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T0 (T0 +> (T1 +> (T1 +> (T1 +> (T0 +> (T0 +> (T2 +> (T2 +> (T2 +> (T2 +> (T0 +> bot))))))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T1 (roundC_T2 (roundA_T1 (roundC_T1 (roundC_T1 (roundC_T0 (T0 +> (T2 +> (T2 +> (T2 +> (T2 +> (T0 +> bot))))))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T0 (T2 +> (T0 +> (T0 +> (T1 +> (T0 +> (T2 +> (T2 +> (T2 +> (T2 +> (T0 +> bot))))))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T1 (roundC_T1 (roundC_T0 (T0 +> (T0 +> (T1 +> (T0 +> (T2 +> (T2 +> (T2 +> (T2 +> (T0 +> bot)))))))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T0 (T1 +> (T0 +> (T0 +> (T1 +> (T0 +> (T2 +> (T2 +> (T2 +> (T2 +> (T0 +> bot)))))))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T1 (roundC_T1 (roundC_T2 (roundA_T0 (T1 +> (T0 +> (T2 +> (T2 +> (T2 +> (T2 +> (T0 +> bot)))))))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T0 (T0 +> (T1 +> (T1 +> (T2 +> (T2 +> (T2 +> (T2 +> (T2 +> (T0 +> bot)))))))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T1 (roundC_T2 (roundA_T1 (roundC_T1 (roundC_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T0 bot)))))))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T0 (T2 +> (T0 +> (T0 +> (T2 +> (T2 +> (T2 +> (T2 +> (T1 +> bota)))))))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T1 (roundC_T1 (roundC_T0 (T0 +> (T0 +> (T2 +> (T2 +> (T2 +> (T2 +> (T1 +> bota))))))))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T0 (T1 +> (T0 +> (T0 +> (T2 +> (T2 +> (T2 +> (T2 +> (T1 +> bota))))))))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T1 (roundC_T1 (roundC_T2 (roundA_T0 (T2 +> (T2 +> (T2 +> (T2 +> (T1 +> bota))))))))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T0 (T0 +> (T1 +> (T1 +> (T0 +> (T2 +> (T2 +> (T2 +> (T1 +> bota)))))))))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T1 (roundC_T2 (roundA_T1 (roundC_T1 (roundC_T0 (T2 +> (T2 +> (T2 +> (T1 +> bota)))))))))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T0 (T2 +> (T0 +> (T1 +> (T2 +> (T2 +> (T2 +> (T1 +> bota)))))))))))))))))) ?_ + refine stepPlus_trans (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T1 (roundC_T1 (roundC_T0 (T0 +> (T1 +> (T2 +> (T2 +> (T2 +> (T1 +> bota))))))))))))))))))) ?_ + exact (sweep_step (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T2 (roundA_T0 (T1 +> (T0 +> (T1 +> (T2 +> (T2 +> (T2 +> (T1 +> bota))))))))))))))))))) + +theorem multiStep_step_isSome {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₀ cfg cfg' : Cfg Γ Λ) (n m : Nat) + (hn : multiStep M c₀ n = some cfg) + (hnm : multiStep M c₀ (n + (1 + m)) = some cfg') : + (step M cfg).isSome := by + rw [multiStep_add M c₀ n (1 + m), hn] at hnm + dsimp [Option.bind] at hnm + rw [multiStep_add M cfg 1 m, multiStep_one] at hnm + cases hs : step M cfg with + | none => + rw [hs] at hnm + nomatch hnm + | some c₁ => rfl + +theorem inv_reaches_beyond {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') + (N : Nat) : + ∃ (m : Nat) (cfg' : Cfg Γ Λ), multiStep M (init []) (N + m) = some cfg' ∧ Inv cfg' := by + induction N with + | zero => + obtain ⟨cfg₀, ⟨n₀, hn₀⟩, h_inv₀⟩ := h_init + refine ⟨n₀, cfg₀, ?_, h_inv₀⟩ + rwa [Nat.zero_add] + | succ N ih => + obtain ⟨m, cfg₁, hm, h_inv₁⟩ := ih + cases m with + | zero => + obtain ⟨cfg₂, ⟨k, hk_pos, hk⟩, h_inv₂⟩ := h_step cfg₁ h_inv₁ + cases k with + | zero => omega + | succ k' => + refine ⟨k', cfg₂, ?_, h_inv₂⟩ + have h_trans := multiStep_trans M (init []) cfg₁ cfg₂ N (k' + 1) hm hk + have h_eq : (N + 1) + k' = N + (k' + 1) := by omega + rwa [h_eq] + | succ m' => + refine ⟨m', cfg₁, ?_, h_inv₁⟩ + have h_eq : (N + 1) + m' = N + (m' + 1) := by omega + rwa [h_eq] + +theorem closed_inv_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') : + IsDoesNotHalt M := by + intro cfg ⟨n, hn⟩ + obtain ⟨m, cfg', hnm, _⟩ := inv_reaches_beyond M Inv h_init h_step (n + 1) + have h_eq : (n + 1) + m = n + (1 + m) := by omega + rw [h_eq] at hnm + exact multiStep_step_isSome M (init []) cfg cfg' n m hn hnm + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + refine closed_inv_does_not_halt target_tm + (fun cfg => ∃ (k : ℕ) (u w : ListBlank (Fin 2)), + cfg = cfgE0 u ∧ StepEra k u w ∧ StepEra (2 * k + 2) w (fEra k u)) + ⟨cfgE0 (fEra 2 u_m2), stepPlus_stepStar (stepPlus_trans init_to_botc botc_to_u0), + ⟨14, fEra 2 u_m2, fEra 6 u_m1, rfl, stepEra_next stepEra_m2, stepEra_next stepEra_m1⟩⟩ + ?_ + intro cfg ⟨k, u, w, hcfg, h1, h2⟩ + subst hcfg + exact ⟨cfgE0 w, stepEra_run h1, ⟨2 * k + 2, w, fEra k u, rfl, h2, stepEra_next h1⟩⟩ + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RBHHH_1LC0RC_0LD0LC_1RE1RA_0RD1LF_0LE0LF diff --git a/BusyBeaver/BB6/NonHalt/M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_0RA0RC.lean b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_0RA0RC.lean new file mode 100644 index 00000000..f39f5907 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_0RA0RC.lean @@ -0,0 +1,970 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_0RA0RC + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_0RA0RC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 8000000 +set_option maxRecDepth 4000000 +@[simp] theorem zMz (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : HalfTape).head = 0 := rfl +@[simp] theorem zDt : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem zPs {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem zPt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,by omega,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) +abbrev t : BitWord := [1,1,0,0] +abbrev d0 : BitWord := [0,0] +abbrev d1 : BitWord := [1,0] +abbrev one : BitWord := [1] +abbrev lh : HalfTape := default +abbrev w_pre : BitWord := t ++ t ++ [0] ++ t ++ t ++ one +abbrev w_word : BitWord := w_pre +@[simp] theorem zDd : d0 +> (default : HalfTape) = default := by + simp [d0] +inductive Call where + | ch + | cj + | cp + | ca +def zCs : Call -> Fin 6 + | .ch => D + | .cj => C + | .cp => C + | .ca => C +def zCw : Call -> BitWord + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] + | .ca => [1,0,1,0,1,0] +def zCR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (r <{{zCs c}} (l <+ zCw c)) +def zCL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> r) {{E}}> l) +def zCf (q : Nat) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + zCL lh ((w_pre ++ (t ^ (2 + q) ++ (d1 ++ one))) +> r) +def z04 (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l,(zCR l c r1) [target_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + z04 c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem z05 {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z06 {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem z07 {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z08 {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z09 {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0a (w : BitWord) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem z0b (ls : List Call) : Seg ls ls [] [] := by + intro r1 r2 h; exact h +theorem zSc {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases z09 h with ⟨r2,ha,hb⟩ + exact z08 (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS0 {ls1 ls2 ls3 : List Call} {w1 w2 v1 v2 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls2 ls3 v1 v2) : + Seg ls1 ls3 (w1 ++ v1) (w2 ++ v2) := by + intro r1 r2 h + rw [append_assoc,append_assoc] + exact h1 (v1 +> r1) (v2 +> r2) (h2 r1 r2 h) +theorem zS4 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc1 (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [target_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem z0c : Seg [.cp] [.ch] t (t ++ [0]) := + zS2 (mid := [1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0d : Seg [.cj] [.ch] t (t ++ one) := + zS2 (mid := [1,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0e : Seg [.ch] [.cj] (t ++ [0]) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0f : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0g : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0h : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1 d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0i : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0j : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0k : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0l : Seg [.cj] [.cp] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons,append_nil]; execute) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem H_T (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact z0a t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [zLp,h_eq,z07] + exact zSg z0f ih +theorem zSa {w2 : BitWord} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact z0a w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq,z07,zLp] + exact zSg hw ih +theorem z0m : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0n : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem z0o (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d0 d0 := + zSa z0m n +theorem z0p (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ n) d0 d1 := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg zH0 (zSa z0n n) +theorem z0q (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d1 d1 := + zSa z0n n +theorem z0r (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ (1 + n)) d1 d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg zH4 (zSa z0m n) +theorem z0s (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0c z0e) (H_T n) +theorem z0t (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0d zH2) (H_T n) +theorem z0u (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0g zH2) (H_T n) +theorem z0v (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0h (H_T n) +theorem z0w (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0i (H_T n) +theorem z0x (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [zLp',List.cons_append,List.nil_append] using! zSg z0j (H_T n) +theorem z0y (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0k (zSg zH1 zH3) + have h1 := zSg h0 (zSa z0m n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using! h1 +theorem z0z (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0l (zSa z0m n) +theorem z0A : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0k zH1 +theorem z0B (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0k (zSg zH1 (zSg zH3 zH0)) + have h1 := zSg h0 (zSa z0n n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using! h1 +theorem z0C (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg [.cj,.ch] [.cp] d1 d1 := zSg z0l zH0 + have h1 := zSg h0 (zSa z0n n) + simpa only [zLp',List.cons_append,List.nil_append] using! h1 +theorem z0D (n : Nat) : Seg (([Call.ch] ^ n) ++ [.cj,.ch]) (([Call.ch] ^ (1 + n * 2)) ++ [.cj,.ch]) t t := by + have h1 : Seg (([Call.ch] ^ n) ++ [.cj,.ch]) (([Call.ch] ^ (n * 2)) ++ [.ch,.cj,.ch]) t t := + zSg (H_T n) (z0t 0) + have heq : (([Call.ch] ^ (n * 2)) ++ [.ch,.cj,.ch]) = (([Call.ch] ^ (1 + n * 2)) ++ [.cj,.ch]) := by + have h2 : 1 + n * 2 = n * 2 + 1 := by omega + rw [h2,z07,z06,List.append_assoc] + rfl + rwa [heq] at h1 +theorem z0E (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([.cj] ++ [.ch] ^ n) (d1 ++ one) d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using! zSg zH3 (z0o n) +theorem z0F (n : Nat) : Seg (([Call.ch] ^ (1 + n * 2)) ++ [.cj,.ch]) ([.cj] ++ [.ch] ^ n) (d1 ++ one) (d1 ++ one) := by + simpa only [List.append_nil] using! zSg (z0E n) z0A +theorem z0G (q : Nat) : + ∀ n,Seg (([Call.ch] ^ n) ++ [.cj,.ch]) (([Call.ch] ^ ((1 + n) * 2 ^ q - 1)) ++ [.cj,.ch]) (t ^ q) (t ^ q) := by + induction q with + | zero => + intro n + have heq : (1 + n) * 2 ^ 0 - 1 = n := by simp + rw [heq] + exact z0b _ + | succ q ih => + intro n + have h1 := zS0 (z0D n) (ih (1 + n * 2)) + have heq : (1 + (1 + n * 2)) * 2 ^ q - 1 = (1 + n) * 2 ^ (q + 1) - 1 := by + rw [Nat.pow_succ]; ring_nf + rw [heq] at h1 + exact h1 +theorem z0H : Seg [.ca] [.cj,.ch] w_pre (w_pre ++ t) := + zS5 + (mid1 := [1,0,1,1,1,1,0,1,1,1,0,1,0,1,1,0,1,0,1,0,1,0]) + (mid2 := [1,0,1,0,1,1,0,1,1,1,0,1,0,1,1,0,1,0,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs w_pre t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL w_pre t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0I (r : HalfTape) : + (zCL lh r) [target_tm]⊢⁺ (zCR lh .ca r) := by + unfold zCL zCR lh zCw zCs + simp only [append_cons,append_nil,z00] + execute +open WordCalculus Word ChoiceE +local notation "WordList" => List Word +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) +theorem loc_z2t {k : Nat} (hK : 0 < k) : ∃ hs,Num k [] hs := by + rcases even_or_odd_mul_two k with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · cases a with + | zero => omega + | succ a => + have heq : (a + 1) * 2 = 2 + a * 2 := by omega + rw [heq]; exact ⟨[.cj] ++ [.ch] ^ a,Num.even a⟩ + · exact ⟨[.cp] ++ [.ch] ^ a,Num.odd a⟩ +theorem loc_z2u {k : Nat} {hs hs' : List Call} (h1 : Num k [] hs) (h2 : Num k [] hs') : + hs = hs' := by + cases h1 with + | @odd n => + generalize hk : 1 + n * 2 = k0 at h2 + cases h2 with + | @odd m => + have hnm : n = m := by omega + subst hnm; rfl + | even _ => omega + | @even n => + generalize hk : 2 + n * 2 = k0 at h2 + cases h2 with + | odd _ => omega + | @even m => + have hnm : n = m := by omega + subst hnm; rfl +def loc_z2v (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs,Num k w hs -> Side hs (w +> r) r' +theorem loc_z2w {r r' : HalfTape} (h : loc_z2v 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl +theorem loc_z2x {n : Nat} {r r' : HalfTape} + (hI : loc_z2v (n * 2) r r') : loc_z2v (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2w hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0k (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine zSc (z0y n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using! hI [] _ hN2 +theorem loc_z2y {n : Nat} {r r' : HalfTape} + (hI : loc_z2v (n * 2) r r') : loc_z2v (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2w hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0A (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine zSc (z0B n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using! hI [] _ hN2 +theorem loc_z2z {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hZ : A = 0) : + evalWords da default = default := by + induction hD with + | nil => rfl + | @zero A H u _ ih => + have hA0 : A = 0 := by omega + rw [evalWords,ih hA0,zDd] + | one _ => omega +theorem loc_z2A {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hPos : 0 < A) : + loc_z2v ((A - 1) * 2) default (evalWords da default) := by + induction hD with + | nil => omega + | @zero A H u _ ih => + have hA_pos : 0 < A := by omega + have hIH := ih hA_pos + have hs := loc_z2x hIH + rw [zDd] at hs + have heq : (A * 2 - 1) * 2 = 2 + (A - 1) * 4 := by omega + rw [evalWords] + rwa [heq] + | @one A H u hDu ih => + cases A with + | zero => + have h_side : evalWords (Q :: u) default = one +> default := by + rw [evalWords,loc_z2z hDu rfl] + simp [d1,one] + rw [h_side] + intro w hs hN + have hk0 : (1 + 0 * 2 - 1) * 2 = 0 := rfl + rw [hk0] at hN + generalize hk : (0 : Nat) = k0 at hN + cases hN with + | zero => exact Side.nil (one +> default) + | odd _ => omega + | even _ => omega + | succ A => + have hA_pos : 0 < A + 1 := by omega + have hIH := ih hA_pos + have heq_in : (A + 1 - 1) * 2 = A * 2 := by omega + rw [heq_in] at hIH + have hs := loc_z2y hIH + rw [zDd] at hs + have heq : (1 + (A + 1) * 2 - 1) * 2 = 4 + A * 4 := by omega + rw [evalWords] + rwa [heq] +theorem zEd {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ∀ {A H : Nat},DigitVal A H v -> Seg ([Call.ch] ^ n) ([Call.ch] ^ b) (wordsToBits u) (wordsToBits v) := by + induction hI with + | nil n => + intro A H _ + exact z0b _ + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | d00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0o _) (ih hD') + | d01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0p _) (ih hD') + | d10 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0q _) (ih hD') + | d11 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0r _) (ih hD') +theorem loc_z2B {n : Nat} {hs hs' : List Call} + (hI : Num (3 + n) [] hs) (hJ : Num (2 + n * 2) [] hs') : + Seg hs ([Call.ch] ++ hs') t t := by + generalize hk1 : 3 + n = k1 at hI + generalize hk2 : 2 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = m * 2 := by omega + subst hq + rw [h1m] + exact z0s m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0t m +theorem loc_z2C {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' (d1 ++ d0) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0u m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + have hq : q = m * 2 := by omega + subst hq + exact z0v m +theorem loc_z2D {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' (d1 ++ d1) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | @odd q => + have hq : q = m * 2 := by omega + subst hq + exact z0w m + | even _ => omega + | @even m => + cases hJ with + | @odd q => + have hq : q = 1 + m * 2 := by omega + subst hq + exact z0x m + | even _ => omega +theorem loc_z2E {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 2 + q * 2 := by omega + subst hm + exact z0y q +theorem loc_z2F {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = q * 2 := by omega + subst hm + exact z0z q + | even _ => omega +theorem loc_z2G {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 3 + q * 2 := by omega + subst hm + exact z0B q +theorem loc_z2H {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = 1 + q * 2 := by omega + subst hm + exact z0C q + | even _ => omega +theorem loc_z2I {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) : + ∀ {u : WordList} {n n' : Nat} {hs hs' : List Call}, + WordEffect n u n' v -> Num k [] hs -> Num k' [] hs' -> + Seg (([Call.ch] ^ n) ++ hs) (([Call.ch] ^ n') ++ hs') (wordsToBits u) (wordsToBits w) := by + induction hI with + | nil k => + intro u n n' hs hs' hE hN hN' + cases hE + rw [loc_z2u hN hN'] + exact z0b _ + | @T m _ _ _ _ _ _ ih => + intro u0 n0 n1 hs hs' hE hN hN' + cases hE with + | T hSub => + rcases loc_z2t (by omega : 0 < 2 + m * 2) with ⟨hs0,hN0⟩ + have hIH := ih hSub hN0 hN' + have hStep := zSg (H_T n0) (loc_z2B hN hN0) + have heq : ([Call.ch] ^ (n0 * 2)) ++ ([Call.ch] ++ hs0) = ([Call.ch] ^ (1 + n0 * 2)) ++ hs0 := by + have h1 : 1 + n0 * 2 = n0 * 2 + 1 := by omega + rw [h1,z07,z06,List.append_assoc] + rw [heq] at hStep + exact zS0 hStep hIH + | @pair0 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,K] ++ u) at hE + rcases wordEffect_split_output [Q,K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD10 : DigitVal 1 2 [Q,K] := DigitVal.one (DigitVal.zero DigitVal.nil) + have hStep := zSg (zEd hL hD10) (loc_z2C hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @pair1 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,Q] ++ u) at hE + rcases wordEffect_split_output [Q,Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD11 : DigitVal 3 2 [Q,Q] := DigitVal.one (DigitVal.one DigitVal.nil) + have hStep := zSg (zEd hL hD11) (loc_z2D hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short00 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (loc_z2E hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short01 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (loc_z2F hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short10 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (loc_z2G hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short11 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (loc_z2H hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') +theorem loc_z2J {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) {u : WordList} {r r' : HalfTape} + (hE : WordEffect 0 u 0 v) (hK : 0 < k') (hC : loc_z2v k' r r') : + loc_z2v k (evalWords u r) (evalWords w r') := by + intro w0 hs hN + have hPosK : 0 < k := phaseScan_pos_of_out_pos hI hK + have hw0 : w0 = [] := by + cases hN with + | zero => omega + | odd _ => rfl + | even _ => rfl + subst hw0 + rcases loc_z2t hK with ⟨hs',hN'⟩ + have hSeg := loc_z2I hI hE hN hN' + dsimp at hSeg + have hSide := zSc hSeg (hC [] hs' hN') + rwa [wordsToBits_append_tape,wordsToBits_append_tape] at hSide +theorem loc_z2K {q : Nat} {orig out : WordList} (hS : EStep q orig out) : + loc_z2v (4 * 2 ^ q) (evalWords orig default) (evalWords out default) := by + rcases hS with ⟨eff,n,v,a0,b0,J,da,hE,hI,hPos,hDA⟩ + have hBlank : evalWords [K] default = default := by simp [evalWords,d0] + have hC : loc_z2v (n * 2) default (evalWords da default) := by + have heq : n * 2 = ((1 + n) - 1) * 2 := by omega + rw [heq] + exact loc_z2A hDA (by omega) + have hRun := loc_z2J hI hE (by omega : 0 < n * 2) hC + rwa [evalWords_append,hBlank,<- evalWords_append] at hRun +theorem loc_z2L (q : Nat) : + Seg [.cj,.ch] ([.cj] ++ [.ch] ^ (2 ^ q - 1)) (t ^ (1 + q) ++ (d1 ++ one)) (t ^ (1 + q) ++ (d1 ++ one)) := by + have hpos := pow_two_pos q + have hT := z0G (1 + q) 0 + have heq : (1 + 0) * 2 ^ (1 + q) - 1 = 1 + (2 ^ q - 1) * 2 := by + rw [pow_two_one_add]; omega + rw [heq] at hT + dsimp at hT + exact zS0 hT (z0F (2 ^ q - 1)) +theorem loc_z2M (q : Nat) : + Seg [.ca] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) + (w_pre ++ (t ^ (2 + q) ++ (d1 ++ one))) + (w_pre ++ (t ^ (2 + (q + 1)) ++ (d1 ++ one))) := by + have h1 := zS0 z0H (loc_z2L (1 + q)) + have heq1 : 1 + (1 + q) = 2 + q := by omega + have heq2 : (w_pre ++ t) ++ (t ^ (2 + q) ++ (d1 ++ one)) = w_pre ++ (t ^ (2 + (q + 1)) ++ (d1 ++ one)) := by + have h3 : 2 + (q + 1) = 1 + (2 + q) := by omega + rw [h3,zLp'] + simp only [List.append_assoc] + rw [heq1] at h1 + rwa [heq2] at h1 +theorem loc_z2N (q : Nat) {r r' : HalfTape} (hI : loc_z2v (4 * 2 ^ q) r r') : + (zCf q r) [target_tm]⊢⁺ zCf (q + 1) r' := by + have hpos := pow_two_pos q + have h_num : Num (4 * 2 ^ q) [] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) := by + have heq : 4 * 2 ^ q = 2 + (2 ^ (1 + q) - 1) * 2 := by rw [pow_two_one_add]; omega + rw [heq]; exact Num.even (2 ^ (1 + q) - 1) + have hC := hI [] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) h_num + have hS := zSc (loc_z2M q) hC + rcases hS with _ | ⟨hca,hnil⟩ + cases hnil + exact zPt (z0I _) (hca lh) +theorem loc_z2O {q : Nat} {orig out : WordList} (hS : EStep q orig out) : + (zCf q (evalWords orig default)) [target_tm]⊢⁺ zCf (q + 1) (evalWords out default) := + loc_z2N q (loc_z2K hS) +theorem loc_z2P {h : Nat} {u : WordList} {j : Nat} {v : WordList} (hR : ERounds h u j v) : + (zCf h (evalWords u default)) [target_tm]⊢* zCf j (evalWords v default) := by + induction hR with + | refl _ _ => exact ⟨0,rfl⟩ + | next hS _ ih => + rcases loc_z2O hS with ⟨n,_,hn⟩ + rcases ih with ⟨m,hm⟩ + exact ⟨n + m,zMt target_tm _ _ _ n m hn hm⟩ +def loc_z2Q : WordList := [V,V,V,V,V,V,V,K,Q,K,Q,K,K,K,K,Q] +abbrev CCfg := Counter.CCfg (Fin 2) (Fin 6) +abbrev CCfg.head (c : CCfg) : Fin 2 := c.cur +abbrev CCfg.left (c : CCfg) : List (Fin 2) := c.l +abbrev CCfg.right (c : CCfg) : List (Fin 2) := c.r +abbrev loc_z2R (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev loc_z2Y (c : CCfg) : Option CCfg := Counter.bstep target_tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep target_tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (loc_z2R c1) [target_tm]⊢⁺ (loc_z2R c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ +def loc_z31 : CCfg := + ⟨A,0,[],[]⟩ +def loc_z32 : CCfg := + ⟨B,0,[1,0,0,1,0,0,0,0,0,1],[0,1,0,1,0,1,0,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,0,1,1,0,1,0,1,0,1]⟩ +def loc_z33 : CCfg := + ⟨C,1,[0,0,0,0,1,0,1,0,0,0,1],[1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,0,1,1,0,1,0,1,0,1]⟩ +def loc_z34 : CCfg := + ⟨E,1,[1,0,0,0,0,0,0,0,0,0,0,0,1],[1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,0,1,1,0,1,0,1,0,1]⟩ +def loc_z35 : CCfg := + ⟨C,1,[0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,1,0,0,0,1,0,1],[1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,0,1,1,0,1,0,1,0,1]⟩ +def loc_z36 : CCfg := + ⟨E,0,[0,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],[1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,0,1,1,0,1,0,1,0,1]⟩ +def loc_z37 : CCfg := + ⟨C,0,[1,1,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,0,1],[1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,0,1,1,0,1,0,1,0,1]⟩ +def loc_z38 : CCfg := + ⟨C,1,[0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,1],[1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,0,1,1,0,1,0,1,0,1]⟩ +def loc_z39 : CCfg := + ⟨E,0,[0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1],[]⟩ +set_option maxRecDepth 4000000 in +theorem loc_z3a : zCm loc_z31 1000 = some loc_z32 := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3b : zCm loc_z32 1000 = some loc_z33 := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3c : zCm loc_z33 1000 = some loc_z34 := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3d : zCm loc_z34 1000 = some loc_z35 := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3e : zCm loc_z35 1000 = some loc_z36 := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3f : zCm loc_z36 1000 = some loc_z37 := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3g : zCm loc_z37 1000 = some loc_z38 := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3h : zCm loc_z38 976 = some loc_z39 := by decide +theorem loc_z3i : + (init []) [target_tm]⊢⁺ zCf 2 (evalWords loc_z2Q default) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = loc_z2R loc_z31 := rfl + have h_end : loc_z2R loc_z39 = zCf 2 (evalWords loc_z2Q default) := by + simp [loc_z2R,loc_z39,zCf,zCL,lh,w_pre,t,d0,d1,one,loc_z2Q,evalWords] + rw [h_init,<- h_end] + exact zPt (zTc (by decide) loc_z3a) + (zPt (zTc (by decide) loc_z3b) + (zPt (zTc (by decide) loc_z3c) + (zPt (zTc (by decide) loc_z3d) + (zPt (zTc (by decide) loc_z3e) + (zPt (zTc (by decide) loc_z3f) + (zPt (zTc (by decide) loc_z3g) + (zTc (by decide) loc_z3h))))))) +def loc_z3j : List CodeE := [ + (.More CT 13 (.More CT 25 (.More CT 49 (.More CT 97 (.More CT 193 (.More CT 385 (.More CT 769 (.More CP0 1539 (.More CS00 769 (.More CP0 1537 (.More CS00 768 (.More CS10 383 (.More CS01 191 (.More CP0 382 (.Stop 382))))))))))))))), + (.More CT 29 (.More CT 57 (.More CT 113 (.More CT 225 (.More CT 449 (.More CT 897 (.More CT 1793 (.More CT 3585 (.More CS11 1792 (.More CT 3582 (.More CP0 7165 (.More CS00 3582 (.More CT 7161 (.More CS10 3580 (.More CS10 1789 (.More CS00 894 (.More CS10 446 (.More CS10 222 (.More CS10 110 (.More CP1 219 (.More CP0 438 (.Stop 438)))))))))))))))))))))), + (.More CT 61 (.More CT 121 (.More CT 241 (.More CT 481 (.More CT 961 (.More CT 1921 (.More CT 3841 (.More CT 7681 (.More CS10 3840 (.More CT 7677 (.More CT 15353 (.More CS11 7676 (.More CT 15350 (.More CS00 7675 (.More CS01 3837 (.More CP1 7674 (.More CP1 15348 (.More CT 30694 (.More CT 61387 (.More CS10 30693 (.More CP0 61385 (.More CS01 30692 (.More CP0 61384 (.More CP1 122767 (.More CP0 245534 (.Stop 245534)))))))))))))))))))))))))), + (.More CT 125 (.More CT 249 (.More CT 497 (.More CT 993 (.More CT 1985 (.More CT 3969 (.More CT 7937 (.More CT 15873 (.More CS10 7936 (.More CT 15869 (.More CT 31737 (.More CS10 15868 (.More CT 31733 (.More CP0 63467 (.More CT 126931 (.More CT 253861 (.More CT 507721 (.More CT 1015441 (.More CS10 507720 (.More CT 1015437 (.More CS11 507718 (.More CT 1015434 (.More CT 2030867 (.More CT 4061733 (.More CS10 2030866 (.More CS11 1015432 (.More CP0 2030864 (.More CS10 1015431 (.More CP0 2030861 (.More CS01 1015430 (.More CP1 2030860 (.More CP1 4061720 (.More CP0 8123440 (.More CS11 4061719 (.More CP1 8123438 (.More CP0 16246876 (.Stop 16246876))))))))))))))))))))))))))))))))))))), + (.More CT 253 (.More CT 505 (.More CT 1009 (.More CT 2017 (.More CT 4033 (.More CT 8065 (.More CT 16129 (.More CT 32257 (.More CS10 16128 (.More CT 32253 (.More CT 64505 (.More CS10 32252 (.More CT 64501 (.More CT 129001 (.More CT 258001 (.More CT 516001 (.More CT 1032001 (.More CT 2064001 (.More CS10 1032000 (.More CT 2063997 (.More CS10 1031998 (.More CT 2063993 (.More CT 4127985 (.More CT 8255969 (.More CS10 4127984 (.More CS11 2063991 (.More CT 4127980 (.More CS00 2063990 (.More CT 4127977 (.More CS11 2063988 (.More CT 4127974 (.More CT 8255947 (.More CT 16511893 (.More CS10 8255946 (.More CT 16511889 (.More CT 33023777 (.More CS10 16511888 (.More CS10 8255943 (.More CS00 4127971 (.More CS00 2063985 (.More CS00 1031992 (.More CS10 515995 (.More CS01 257997 (.More CP0 515994 (.More CS10 257996 (.More CP0 515991 (.More CS01 257995 (.More CP1 515990 (.More CP1 1031980 (.More CP0 2063960 (.More CP1 4127919 (.More CP1 8255838 (.More CP0 16511676 (.Stop 16511676)))))))))))))))))))))))))))))))))))))))))))))))))))))), + (.More CT 509 (.More CT 1017 (.More CT 2033 (.More CT 4065 (.More CT 8129 (.More CT 16257 (.More CT 32513 (.More CT 65025 (.More CS10 32512 (.More CT 65021 (.More CT 130041 (.More CS10 65020 (.More CT 130037 (.More CT 260073 (.More CT 520145 (.More CT 1040289 (.More CT 2080577 (.More CT 4161153 (.More CS10 2080576 (.More CT 4161149 (.More CS10 2080574 (.More CT 4161145 (.More CT 8322289 (.More CT 16644577 (.More CS10 8322288 (.More CS11 4161143 (.More CT 8322284 (.More CS01 4161142 (.More CT 8322282 (.More CS00 4161141 (.More CT 8322279 (.More CT 16644557 (.More CT 33289113 (.More CS10 16644556 (.More CT 33289109 (.More CT 66578217 (.More CS10 33289108 (.More CS11 16644553 (.More CP0 33289106 (.More CS10 16644552 (.More CS10 8322275 (.More CS00 4161137 (.More CT 8322271 (.More CS10 4161135 (.More CT 8322267 (.More CS11 4161133 (.More CT 8322264 (.More CT 16644527 (.More CT 33289053 (.More CT 66578105 (.More CT 133156209 (.More CT 266312417 (.More CS10 133156208 (.More CS10 66578103 (.More CP1 133156205 (.More CP1 266312410 (.More CP0 532624820 (.More CP0 1065249639 (.More CS00 532624819 (.More CS01 266312409 (.More CP1 532624818 (.More CP1 1065249636 (.More CP0 2130499272 (.More CS11 1065249635 (.More CP1 2130499270 (.More CP1 4260998540 (.More CP0 8521997080 (.Stop 8521997080)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))), + (.More CT 1021 (.More CT 2041 (.More CT 4081 (.More CT 8161 (.More CT 16321 (.More CT 32641 (.More CT 65281 (.More CT 130561 (.More CS10 65280 (.More CT 130557 (.More CT 261113 (.More CS10 130556 (.More CT 261109 (.More CT 522217 (.More CT 1044433 (.More CT 2088865 (.More CT 4177729 (.More CT 8355457 (.More CS10 4177728 (.More CT 8355453 (.More CS10 4177726 (.More CT 8355449 (.More CT 16710897 (.More CT 33421793 (.More CS10 16710896 (.More CS11 8355447 (.More CT 16710892 (.More CS01 8355446 (.More CT 16710890 (.More CS01 8355445 (.More CT 16710888 (.More CT 33421775 (.More CT 66843549 (.More CS10 33421774 (.More CT 66843545 (.More CT 133687089 (.More CS10 66843544 (.More CS11 33421771 (.More CT 66843540 (.More CS00 33421770 (.More CP1 66843539 (.More CT 133687076 (.More CS00 66843538 (.More CT 133687073 (.More CS10 66843536 (.More CT 133687069 (.More CT 267374137 (.More CT 534748273 (.More CT 1069496545 (.More CT 2138993089 (.More CT 4277986177 (.More CS10 2138993088 (.More CS11 1069496543 (.More CT 2138993084 (.More CT 4277986167 (.More CT 8555972333 (.More CT 17111944665 (.More CP1 34223889331 (.More CT 68447778660 (.More CT 136895557319 (.More CT 273791114637 (.More CS10 136895557318 (.More CT 273791114633 (.More CT 547582229265 (.More CT 1095164458529 (.More CS10 547582229264 (.More CS10 273791114631 (.More CS00 136895557315 (.More CS00 68447778657 (.More CS00 34223889328 (.More CP0 68447778655 (.More CP1 136895557309 (.More CP0 273791114618 (.More CS11 136895557308 (.More CP0 273791114616 (.More CS10 136895557307 (.More CS01 68447778653 (.More CP0 136895557306 (.More CS10 68447778652 (.More CS11 34223889325 (.More CP1 68447778650 (.More CP1 136895557300 (.More CP0 273791114600 (.More CP1 547582229199 (.More CP1 1095164458398 (.More CP1 2190328916796 (.More CP0 4380657833592 (.Stop 4380657833592)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))), + (.More CT 2045 (.More CT 4089 (.More CT 8177 (.More CT 16353 (.More CT 32705 (.More CT 65409 (.More CT 130817 (.More CT 261633 (.More CS10 130816 (.More CT 261629 (.More CT 523257 (.More CS10 261628 (.More CT 523253 (.More CT 1046505 (.More CT 2093009 (.More CT 4186017 (.More CT 8372033 (.More CT 16744065 (.More CS10 8372032 (.More CT 16744061 (.More CS10 8372030 (.More CT 16744057 (.More CT 33488113 (.More CT 66976225 (.More CS10 33488112 (.More CS11 16744055 (.More CT 33488108 (.More CS01 16744054 (.More CT 33488106 (.More CS01 16744053 (.More CT 33488104 (.More CT 66976207 (.More CT 133952413 (.More CS10 66976206 (.More CT 133952409 (.More CT 267904817 (.More CS10 133952408 (.More CS11 66976203 (.More CT 133952404 (.More CS01 66976202 (.More CT 133952402 (.More CT 267904803 (.More CS11 133952401 (.More CT 267904800 (.More CS00 133952400 (.More CT 267904797 (.More CT 535809593 (.More CT 1071619185 (.More CT 2143238369 (.More CT 4286476737 (.More CT 8572953473 (.More CS10 4286476736 (.More CS11 2143238367 (.More CT 4286476732 (.More CT 8572953463 (.More CT 17145906925 (.More CT 34291813849 (.More CT 68583627697 (.More CT 137167255393 (.More CT 274334510785 (.More CT 548669021569 (.More CS10 274334510784 (.More CT 548669021565 (.More CT 1097338043129 (.More CT 2194676086257 (.More CS10 1097338043128 (.More CP0 2194676086255 (.More CP0 4389352172509 (.More CT 8778704345015 (.More CT 17557408690029 (.More CT 35114817380057 (.More CS10 17557408690028 (.More CT 35114817380053 (.More CS10 17557408690026 (.More CS11 8778704345012 (.More CT 17557408690022 (.More CS00 8778704345011 (.More CS00 4389352172505 (.More CT 8778704345007 (.More CT 17557408690013 (.More CT 35114817380025 (.More CT 70229634760049 (.More CT 140459269520097 (.More CT 280918539040193 (.More CT 561837078080385 (.More CS10 280918539040192 (.More CS10 140459269520095 (.More CS00 70229634760047 (.More CS01 35114817380023 (.More CP1 70229634760046 (.More CP1 140459269520092 (.More CP1 280918539040184 (.More CP0 561837078080368 (.More CS10 280918539040183 (.More CP1 561837078080365 (.More CP0 1123674156160730 (.More CP0 2247348312321459 (.More CP1 4494696624642917 (.More CP0 8989393249285834 (.More CS11 4494696624642916 (.More CP0 8989393249285832 (.More CS10 4494696624642915 (.More CS01 2247348312321457 (.More CP1 4494696624642914 (.More CP1 8989393249285828 (.More CP0 17978786498571656 (.More CS11 8989393249285827 (.More CP1 17978786498571654 (.More CP1 35957572997143308 (.More CP1 71915145994286616 (.More CP0 143830291988573232 (.Stop 143830291988573232)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +] +def loc_z3k : WordList := [V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,Q,V,K,V,K,V,V,V,Q,V,V,Q,Q,V,K,V,V,Q,V,K,V,V,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,Q,V,K,K,V,V,V,V,V,V,V,Q,Q,K,K,V,V,V,V,Q,V,V,V,V,V,Q,V,Q,K,V,V,V,Q,V,V,V,V] +def loc_z3l : WordList := [Q,K,K,K,Q,Q,K,K,K,K,Q,Q,K,Q,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,K,K,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q] +def loc_z3m : WordList := [K,K,K,K,K,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q] +set_option maxRecDepth 4000000 in +theorem loc_z3n : + ERounds 2 loc_z2Q 10 (loc_z3k ++ loc_z3l) := by + have h1 : ERounds 2 loc_z2Q (2 + loc_z3j.length) (loc_z3k ++ loc_z3l) := by + apply evalERounds_sound loc_z3j + decide + simpa using! h1 +set_option maxRecDepth 4000000 in +theorem loc_z3o : + EGood 10 (loc_z3k ++ loc_z3l) := by + apply eGood_of_check 10 loc_z3k loc_z3l loc_z3m + · decide + · exact EGuard.T 0 _ + · decide + · decide + · decide + · decide + · decide + · decide + · decide + · norm_num [loc_z3k,loc_z3m,wordMass,wordMassK,wordScale] +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d) = some c') : + (multiStep target_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +theorem z3p (m : Nat) : + ∃ N ≥ m,∃ h w,multiStep target_tm (init []) N = some (zCf h (evalWords w default)) /\ EGood h w := by + induction m with + | zero => + rcases loc_z3i with ⟨k1,_,hk1⟩ + rcases loc_z2P loc_z3n with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,10,loc_z3k ++ loc_z3l, + zMt target_tm _ _ _ k1 k2 hk1 hk2,loc_z3o⟩ + | succ m ih => + rcases ih with ⟨N,hN,h,w,h_ms,h_good⟩ + rcases eGood_progress h_good with ⟨w',hStep,h_good'⟩ + rcases loc_z2O hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,h + 1,w', + zMt target_tm _ _ _ N k h_ms h_step_k,h_good'⟩ + +end Solution + + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases z3p (n + 1) with ⟨N,hN,_,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := zIm h_N + rw [zMs,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_0RA0RC diff --git a/BusyBeaver/BB6/NonHalt/M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_1RA0RC.lean b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_1RA0RC.lean new file mode 100644 index 00000000..b881366c --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_1RA0RC.lean @@ -0,0 +1,1010 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_1RA0RC + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_1RA0RC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +namespace Solution + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 8000000 +set_option maxRecDepth 4000000 +@[simp] theorem zMz (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : HalfTape).head = 0 := rfl +@[simp] theorem zDt : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem zPs {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem zPt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,by omega,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) +abbrev t : BitWord := [1,1,0,0] +abbrev d0 : BitWord := [0,0] +abbrev d1 : BitWord := [1,0] +abbrev one : BitWord := [1] +abbrev lh : HalfTape := [1,0,1] +> default +abbrev w_word : BitWord := t ++ one +abbrev w_pre : BitWord := w_word +@[simp] theorem zDd : d0 +> (default : HalfTape) = default := by + simp [d0] +inductive Call where + | ch + | cj + | cp + | ca +def zCs : Call -> Fin 6 + | .ch => D + | .cj => C + | .cp => C + | .ca => D +def zCw : Call -> BitWord + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] + | .ca => [1,1,1,0,1,1] +def zCR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (r <{{zCs c}} (l <+ zCw c)) +def zCL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (([0] +> r) {{E}}> l) +def zCf (q : Nat) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + zCL lh ((w_pre ++ (t ^ (2 + q) ++ (d1 ++ one))) +> r) +def z04 (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l,(zCR l c r1) [target_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + z04 c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem z05 {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z06 {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem z07 {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z08 {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z09 {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0a (w : BitWord) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem z0b (ls : List Call) : Seg ls ls [] [] := by + intro r1 r2 h; simpa using! h +theorem zSc {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases z09 h with ⟨r2,ha,hb⟩ + exact z08 (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS0 {ls1 ls2 ls3 : List Call} {u1 u2 v1 v2 : BitWord} + (h1 : Seg ls1 ls2 u1 u2) (h2 : Seg ls2 ls3 v1 v2) : + Seg ls1 ls3 (u1 ++ v1) (u2 ++ v2) := by + intro r1 r2 h + rw [append_assoc u1 v1 r1,append_assoc u2 v2 r2] + exact h1 (v1 +> r1) (v2 +> r2) (h2 r1 r2 h) +theorem zS4 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc1 (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [target_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem z0c : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons,append_nil]; execute) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0d : Seg [.cp] [.ch] t (t ++ [0]) := + zS2 (mid := [1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0e : Seg [.ch] [.cj] (t ++ [0]) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0f : Seg [.cj] [.ch] t (t ++ one) := + zS2 (mid := [1,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0g : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0h : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1 d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0i : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0j : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0k : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0l : Seg [.cj] [.cp] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0m : Seg [.ca] [.cj,.ch] w_word (w_word ++ t) := + zS5 (mid1 := [1,0,1,1,1,1,0,1,1]) (mid2 := [1,0,1,0,1,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs w_word t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL w_word t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0n (r : HalfTape) : + (zCL lh r) [target_tm]⊢⁺ (zCR lh .ca r) := by + unfold zCL zCR lh zCw zCs + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute +theorem H_T (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact z0a t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [zLp,h_eq,z07] + exact zSg z0c ih +theorem zSa {w2 : BitWord} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact z0a w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq,z07,zLp] + exact zSg hw ih +theorem z0o : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0p : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem z0q (n : Nat) : Seg ([.ch] ^ (n * 2)) ([.ch] ^ n) d0 d0 := + zSa z0o n +theorem z0r (n : Nat) : Seg ([.ch] ^ (1 + n * 2)) ([.ch] ^ n) d0 d1 := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg zH0 (zSa z0p n) +theorem z0s (n : Nat) : Seg ([.ch] ^ (n * 2)) ([.ch] ^ n) d1 d1 := + zSa z0p n +theorem z0t (n : Nat) : Seg ([.ch] ^ (1 + n * 2)) ([.ch] ^ (1 + n)) d1 d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg zH4 (z0q n) +theorem z0u (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0d z0e) (H_T n) +theorem z0v (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0f zH2) (H_T n) +theorem z0w (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0g zH2) (H_T n) +theorem z0x (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0h (H_T n) +theorem z0y (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0i (H_T n) +theorem z0z (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [zLp',List.cons_append,List.nil_append] using! zSg z0j (H_T n) +theorem z0A (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0k (zSg zH1 zH3) + have h1 := zSg h0 (z0q n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using! h1 +theorem z0B (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0l (z0q n) +theorem z0C : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0k zH1 +theorem z0D (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0k (zSg zH1 (zSg zH3 zH0)) + have h1 := zSg h0 (z0s n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using! h1 +theorem z0E (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg [.cj,.ch] [.cp] d1 d1 := zSg z0l zH0 + have h1 := zSg h0 (z0s n) + simpa only [zLp',List.cons_append,List.nil_append] using! h1 +theorem z0F (n : Nat) : Seg ([.ch] ^ n ++ [.cj,.ch]) ([.ch] ^ (1 + n * 2) ++ [.cj,.ch]) t t := by + have h1 := zSg (H_T n) (z0v 0) + have heq : 1 + n * 2 = n * 2 + 1 := by omega + rw [heq,z07] + simpa only [z06,List.append_assoc,List.cons_append,List.nil_append] using! h1 +theorem z0G (n : Nat) : Seg ([.ch] ^ (1 + n * 2)) ([.cj] ++ [.ch] ^ n) (d1 ++ one) d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg zH3 (z0q n) +theorem z0H (n : Nat) : Seg ([.ch] ^ (1 + n * 2) ++ [.cj,.ch]) ([.cj] ++ [.ch] ^ n) + (d1 ++ one) (d1 ++ one) := by + simpa only [List.append_nil] using! zSg (z0G n) z0C +theorem z0I (q : Nat) : ∀ n,Seg ([.ch] ^ n ++ [.cj,.ch]) + ([.ch] ^ ((1 + n) * 2 ^ q - 1) ++ [.cj,.ch]) (t ^ q) (t ^ q) := by + induction q with + | zero => + intro n + have heq : (1 + n) * 2 ^ 0 - 1 = n := by omega + rw [heq]; exact z0b _ + | succ q ih => + intro n + have heq : (1 + n) * 2 ^ (q + 1) - 1 = (1 + (1 + n * 2)) * 2 ^ q - 1 := by + rw [Nat.pow_succ]; ring_nf + rw [zLp,heq] + exact zS0 (z0F n) (ih (1 + n * 2)) +open WordCalculus Word ChoiceE +local notation "WordList" => List Word +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) +theorem loc_z2t {k : Nat} (hK : 0 < k) : ∃ hs,Num k [] hs := by + rcases even_or_odd_mul_two k with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · cases a with + | zero => omega + | succ a => + have heq : (a + 1) * 2 = 2 + a * 2 := by omega + rw [heq]; exact ⟨[.cj] ++ [.ch] ^ a,Num.even a⟩ + · exact ⟨[.cp] ++ [.ch] ^ a,Num.odd a⟩ +theorem loc_z2u {k : Nat} {hs hs' : List Call} (h1 : Num k [] hs) (h2 : Num k [] hs') : + hs = hs' := by + cases h1 with + | @odd n => + generalize hk : 1 + n * 2 = k0 at h2 + cases h2 with + | @odd m => + have hnm : n = m := by omega + subst hnm; rfl + | even _ => omega + | @even n => + generalize hk : 2 + n * 2 = k0 at h2 + cases h2 with + | odd _ => omega + | @even m => + have hnm : n = m := by omega + subst hnm; rfl +def loc_z2v (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs,Num k w hs -> Side hs (w +> r) r' +theorem loc_z2w {r r' : HalfTape} (h : loc_z2v 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl +theorem loc_z2x {n : Nat} {r r' : HalfTape} + (hI : loc_z2v (n * 2) r r') : loc_z2v (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2w hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0k (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine zSc (z0A n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using! hI [] _ hN2 +theorem loc_z2y {n : Nat} {r r' : HalfTape} + (hI : loc_z2v (n * 2) r r') : loc_z2v (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2w hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0C (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine zSc (z0D n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using! hI [] _ hN2 +theorem loc_z2z {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hZ : A = 0) : + evalWords da default = default := by + induction hD with + | nil => rfl + | @zero A H u _ ih => + have hA0 : A = 0 := by omega + rw [evalWords,ih hA0,zDd] + | one _ => omega +theorem loc_z2A {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hPos : 0 < A) : + loc_z2v ((A - 1) * 2) default (evalWords da default) := by + induction hD with + | nil => omega + | @zero A H u _ ih => + have hA_pos : 0 < A := by omega + have hIH := ih hA_pos + have hs := loc_z2x hIH + rw [zDd] at hs + have heq : (A * 2 - 1) * 2 = 2 + (A - 1) * 4 := by omega + rw [evalWords] + rwa [heq] + | @one A H u hDu ih => + cases A with + | zero => + have h_side : evalWords (Q :: u) default = one +> default := by + rw [evalWords,loc_z2z hDu rfl] + simp [d1,one] + rw [h_side] + intro w hs hN + have hk0 : (1 + 0 * 2 - 1) * 2 = 0 := rfl + rw [hk0] at hN + generalize hk : (0 : Nat) = k0 at hN + cases hN with + | zero => exact Side.nil (one +> default) + | odd _ => omega + | even _ => omega + | succ A => + have hA_pos : 0 < A + 1 := by omega + have hIH := ih hA_pos + have heq_in : (A + 1 - 1) * 2 = A * 2 := by omega + rw [heq_in] at hIH + have hs := loc_z2y hIH + rw [zDd] at hs + have heq : (1 + (A + 1) * 2 - 1) * 2 = 4 + A * 4 := by omega + rw [evalWords] + rwa [heq] +theorem zEd {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ∀ {A H : Nat},DigitVal A H v -> Seg ([Call.ch] ^ n) ([Call.ch] ^ b) (wordsToBits u) (wordsToBits v) := by + induction hI with + | nil n => + intro A H _ + exact z0b _ + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | d00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0q _) (ih hD') + | d01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0r _) (ih hD') + | d10 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0s _) (ih hD') + | d11 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0t _) (ih hD') +theorem loc_z2B {n : Nat} {hs hs' : List Call} + (hI : Num (3 + n) [] hs) (hJ : Num (2 + n * 2) [] hs') : + Seg hs ([Call.ch] ++ hs') t t := by + generalize hk1 : 3 + n = k1 at hI + generalize hk2 : 2 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = m * 2 := by omega + subst hq + rw [h1m] + exact z0u m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0v m +theorem loc_z2C {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' (d1 ++ d0) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0w m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + have hq : q = m * 2 := by omega + subst hq + exact z0x m +theorem loc_z2D {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' (d1 ++ d1) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | @odd q => + have hq : q = m * 2 := by omega + subst hq + exact z0y m + | even _ => omega + | @even m => + cases hJ with + | @odd q => + have hq : q = 1 + m * 2 := by omega + subst hq + exact z0z m + | even _ => omega +theorem loc_z2E {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 2 + q * 2 := by omega + subst hm + exact z0A q +theorem loc_z2F {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = q * 2 := by omega + subst hm + exact z0B q + | even _ => omega +theorem loc_z2G {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 3 + q * 2 := by omega + subst hm + exact z0D q +theorem loc_z2H {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = 1 + q * 2 := by omega + subst hm + exact z0E q + | even _ => omega +theorem loc_z2I {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) : + ∀ {u : WordList} {n n' : Nat} {hs hs' : List Call}, + WordEffect n u n' v -> Num k [] hs -> Num k' [] hs' -> + Seg (([Call.ch] ^ n) ++ hs) (([Call.ch] ^ n') ++ hs') (wordsToBits u) (wordsToBits w) := by + induction hI with + | nil k => + intro u n n' hs hs' hE hN hN' + cases hE + rw [loc_z2u hN hN'] + exact z0b _ + | @T m _ _ _ _ _ _ ih => + intro u0 n0 n1 hs hs' hE hN hN' + cases hE with + | T hSub => + rcases loc_z2t (by omega : 0 < 2 + m * 2) with ⟨hs0,hN0⟩ + have hIH := ih hSub hN0 hN' + have hStep := zSg (H_T n0) (loc_z2B hN hN0) + have heq : ([Call.ch] ^ (n0 * 2)) ++ ([Call.ch] ++ hs0) = ([Call.ch] ^ (1 + n0 * 2)) ++ hs0 := by + have h1 : 1 + n0 * 2 = n0 * 2 + 1 := by omega + rw [h1,z07,z06,List.append_assoc] + rw [heq] at hStep + exact zS0 hStep hIH + | @pair0 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,K] ++ u) at hE + rcases wordEffect_split_output [Q,K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD10 : DigitVal 1 2 [Q,K] := DigitVal.one (DigitVal.zero DigitVal.nil) + have hStep := zSg (zEd hL hD10) (loc_z2C hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @pair1 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,Q] ++ u) at hE + rcases wordEffect_split_output [Q,Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD11 : DigitVal 3 2 [Q,Q] := DigitVal.one (DigitVal.one DigitVal.nil) + have hStep := zSg (zEd hL hD11) (loc_z2D hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short00 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (loc_z2E hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short01 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (loc_z2F hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short10 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases loc_z2t hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (loc_z2G hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short11 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases loc_z2t (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (loc_z2H hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') +theorem loc_z2J {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) {u : WordList} {r r' : HalfTape} + (hE : WordEffect 0 u 0 v) (hK : 0 < k') (hC : loc_z2v k' r r') : + loc_z2v k (evalWords u r) (evalWords w r') := by + intro w0 hs hN + have hPosK : 0 < k := phaseScan_pos_of_out_pos hI hK + have hw0 : w0 = [] := by + cases hN with + | zero => omega + | odd _ => rfl + | even _ => rfl + subst hw0 + rcases loc_z2t hK with ⟨hs',hN'⟩ + have hSeg := loc_z2I hI hE hN hN' + dsimp at hSeg + have hSide := zSc hSeg (hC [] hs' hN') + rwa [wordsToBits_append_tape,wordsToBits_append_tape] at hSide +theorem loc_z2K {q : Nat} {orig out : WordList} (hS : EStep q orig out) : + loc_z2v (4 * 2 ^ q) (evalWords orig default) (evalWords out default) := by + rcases hS with ⟨eff,n,v,a0,b0,J,da,hE,hI,hPos,hDA⟩ + have hBlank : evalWords [K] default = default := by simp [evalWords,d0] + have hC : loc_z2v (n * 2) default (evalWords da default) := by + have heq : n * 2 = ((1 + n) - 1) * 2 := by omega + rw [heq] + exact loc_z2A hDA (by omega) + have hRun := loc_z2J hI hE (by omega : 0 < n * 2) hC + rwa [evalWords_append,hBlank,<- evalWords_append] at hRun +theorem loc_z2L (q : Nat) : + Seg [.cj,.ch] ([.cj] ++ [.ch] ^ (2 ^ q - 1)) (t ^ (1 + q) ++ (d1 ++ one)) (t ^ (1 + q) ++ (d1 ++ one)) := by + have hpos := pow_two_pos q + have hT := z0I (1 + q) 0 + have heq : (1 + 0) * 2 ^ (1 + q) - 1 = 1 + (2 ^ q - 1) * 2 := by + rw [pow_two_one_add]; omega + rw [heq] at hT + dsimp at hT + exact zS0 hT (z0H (2 ^ q - 1)) +theorem loc_z2M (q : Nat) : + Seg [.ca] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) + (w_pre ++ (t ^ (2 + q) ++ (d1 ++ one))) + (w_pre ++ (t ^ (2 + (q + 1)) ++ (d1 ++ one))) := by + have h1 := zS0 z0m (loc_z2L (1 + q)) + have heq1 : 1 + (1 + q) = 2 + q := by omega + have heq2 : (w_pre ++ t) ++ (t ^ (2 + q) ++ (d1 ++ one)) = w_pre ++ (t ^ (2 + (q + 1)) ++ (d1 ++ one)) := by + have h3 : 2 + (q + 1) = 1 + (2 + q) := by omega + rw [h3,zLp'] + simp only [List.append_assoc] + rw [heq1] at h1 + rwa [heq2] at h1 +theorem loc_z2N (q : Nat) {r r' : HalfTape} (hI : loc_z2v (4 * 2 ^ q) r r') : + (zCf q r) [target_tm]⊢⁺ zCf (q + 1) r' := by + have hpos := pow_two_pos q + have h_num : Num (4 * 2 ^ q) [] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) := by + have heq : 4 * 2 ^ q = 2 + (2 ^ (1 + q) - 1) * 2 := by rw [pow_two_one_add]; omega + rw [heq]; exact Num.even (2 ^ (1 + q) - 1) + have hC := hI [] ([.cj] ++ [.ch] ^ (2 ^ (1 + q) - 1)) h_num + have hS := zSc (loc_z2M q) hC + rcases hS with _ | ⟨hca,hnil⟩ + cases hnil + exact zPt (z0n _) (hca lh) +theorem loc_z2O {q : Nat} {orig out : WordList} (hS : EStep q orig out) : + (zCf q (evalWords orig default)) [target_tm]⊢⁺ zCf (q + 1) (evalWords out default) := + loc_z2N q (loc_z2K hS) +theorem loc_z2P {h : Nat} {u : WordList} {j : Nat} {v : WordList} (hR : ERounds h u j v) : + (zCf h (evalWords u default)) [target_tm]⊢* zCf j (evalWords v default) := by + induction hR with + | refl _ _ => exact ⟨0,rfl⟩ + | next hS _ ih => + rcases loc_z2O hS with ⟨n,_,hn⟩ + rcases ih with ⟨m,hm⟩ + exact ⟨n + m,zMt target_tm _ _ _ n m hn hm⟩ +def loc_z2Q : WordList := [V,Q,V,Q,Q,V,V,V,Q,V,V,K,V,V,K,K,K,Q,K,Q,Q,K,Q] +abbrev CCfg := Counter.CCfg (Fin 2) (Fin 6) +abbrev CCfg.head (c : CCfg) : Fin 2 := c.cur +abbrev CCfg.left (c : CCfg) : List (Fin 2) := c.l +abbrev CCfg.right (c : CCfg) : List (Fin 2) := c.r +abbrev loc_z2R (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev loc_z2Y (c : CCfg) : Option CCfg := Counter.bstep target_tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep target_tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (loc_z2R c1) [target_tm]⊢⁺ (loc_z2R c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ +def loc_z31 : CCfg := + ⟨A,0,[],[]⟩ +def loc_z32 : CCfg := + ⟨E,1,[0,1,0,0,0,1,1],[0,1,0,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def loc_z33 : CCfg := + ⟨F,1,[1,0,0,0,0,0,1,1,0,0,1,0,0,0,1,1,0,0,1,1,0,0,0,0,1,0,1],[1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def loc_z34 : CCfg := + ⟨D,1,[0,0,0,1],[1,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z35 : CCfg := + ⟨D,0,[0,1,1,0,0,1,0,1,1,0,0,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,0,1,0,0,0,1],[1,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z36 : CCfg := + ⟨E,1,[0,0,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,0,1,0,0,0,0,0,1],[0,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def loc_z37 : CCfg := + ⟨E,1,[1,1,0,0,0,1,0,0,0,1,0,1,0,0,0,1],[1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def loc_z38 : CCfg := + ⟨C,0,[1,0,1,0,1,0,0,0,1],[1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def loc_z39 : CCfg := + ⟨E,0,[0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,0,1],[1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def loc_z3a : CCfg := + ⟨C,0,[1,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1],[1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def loc_z3b : CCfg := + ⟨C,1,[0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1],[1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1]⟩ +def loc_z3c : CCfg := + ⟨E,1,[0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],[1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3d : CCfg := + ⟨C,0,[1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1],[1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3e : CCfg := + ⟨E,1,[0,0,1,0,0,0,0,0,1,0,1,0,0,0,1],[1,0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3f : CCfg := + ⟨E,0,[0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1],[1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3g : CCfg := + ⟨C,0,[1,1,0,0,1,0,1,1,0,0,1,0,1,1,0,0,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,1],[1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3h : CCfg := + ⟨C,0,[0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1],[1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3i : CCfg := + ⟨E,1,[0,0,1,1,0,0,1,1,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,1],[1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3j : CCfg := + ⟨C,0,[0,0,1,1,0,0,1,1,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,1],[1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3k : CCfg := + ⟨C,1,[0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1],[1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3l : CCfg := + ⟨C,1,[0,1,0,0,0,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1],[1,1,1,0,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,1]⟩ +def loc_z3m : CCfg := + ⟨E,1,[0,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,1,0,0,1,0,1,1,0,0,1,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1],[0,1]⟩ +set_option maxRecDepth 4000000 in +theorem loc_z3n : zCm loc_z31 1000 = some loc_z32 := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3o : zCm loc_z32 1000 = some loc_z33 := by decide +set_option maxRecDepth 4000000 in +theorem z3p : zCm loc_z33 1000 = some loc_z34 := by decide +set_option maxRecDepth 4000000 in +theorem z3q : zCm loc_z34 1000 = some loc_z35 := by decide +set_option maxRecDepth 4000000 in +theorem z3r : zCm loc_z35 1000 = some loc_z36 := by decide +set_option maxRecDepth 4000000 in +theorem z3s : zCm loc_z36 1000 = some loc_z37 := by decide +set_option maxRecDepth 4000000 in +theorem z3t : zCm loc_z37 1000 = some loc_z38 := by decide +set_option maxRecDepth 4000000 in +theorem z3u : zCm loc_z38 1000 = some loc_z39 := by decide +set_option maxRecDepth 4000000 in +theorem z3v : zCm loc_z39 1000 = some loc_z3a := by decide +set_option maxRecDepth 4000000 in +theorem z3w : zCm loc_z3a 1000 = some loc_z3b := by decide +set_option maxRecDepth 4000000 in +theorem z3x : zCm loc_z3b 1000 = some loc_z3c := by decide +set_option maxRecDepth 4000000 in +theorem z3y : zCm loc_z3c 1000 = some loc_z3d := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3z : zCm loc_z3d 1000 = some loc_z3e := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3A : zCm loc_z3e 1000 = some loc_z3f := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3B : zCm loc_z3f 1000 = some loc_z3g := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3C : zCm loc_z3g 1000 = some loc_z3h := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3D : zCm loc_z3h 1000 = some loc_z3i := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3E : zCm loc_z3i 1000 = some loc_z3j := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3F : zCm loc_z3j 1000 = some loc_z3k := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3G : zCm loc_z3k 1000 = some loc_z3l := by decide +set_option maxRecDepth 4000000 in +theorem loc_z3H : zCm loc_z3l 137 = some loc_z3m := by decide +theorem loc_z3I : + (init []) [target_tm]⊢⁺ zCf 5 (evalWords loc_z2Q default) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = loc_z2R loc_z31 := rfl + have h_end : loc_z2R loc_z3m = zCf 5 (evalWords loc_z2Q default) := by + simp [loc_z2R,loc_z3m,zCf,zCL,lh,w_pre,w_word,t,d0,d1,one,loc_z2Q,evalWords] + rw [h_init,<- h_end] + exact zPt (zTc (by decide) loc_z3n) (zPt (zTc (by decide) loc_z3o) (zPt (zTc (by decide) z3p) (zPt (zTc (by decide) z3q) (zPt (zTc (by decide) z3r) (zPt (zTc (by decide) z3s) (zPt (zTc (by decide) z3t) (zPt (zTc (by decide) z3u) (zPt (zTc (by decide) z3v) (zPt (zTc (by decide) z3w) (zPt (zTc (by decide) z3x) (zPt (zTc (by decide) z3y) (zPt (zTc (by decide) loc_z3z) (zPt (zTc (by decide) loc_z3A) (zPt (zTc (by decide) loc_z3B) (zPt (zTc (by decide) loc_z3C) (zPt (zTc (by decide) loc_z3D) (zPt (zTc (by decide) loc_z3E) (zPt (zTc (by decide) loc_z3F) (zPt (zTc (by decide) loc_z3G) ((zTc (by decide) loc_z3H))))))))))))))))))))) +def loc_z3J : List CodeE := [ + (.More CT 125 (.More CS10 62 (.More CT 121 (.More CS10 60 (.More CS11 29 (.More CT 56 (.More CT 111 (.More CT 221 (.More CS10 110 (.More CT 217 (.More CT 433 (.More CS11 216 (.More CT 430 (.More CT 859 (.More CS11 429 (.More CP1 858 (.More CP0 1716 (.More CP0 3431 (.More CS01 1715 (.More CP0 3430 (.Stop 3430))))))))))))))))))))), + (.More CT 253 (.More CS10 126 (.More CT 249 (.More CS10 124 (.More CS11 61 (.More CT 120 (.More CT 239 (.More CT 477 (.More CS10 238 (.More CT 473 (.More CT 945 (.More CS10 472 (.More CT 941 (.More CT 1881 (.More CS10 940 (.More CT 1877 (.More CT 3753 (.More CT 7505 (.More CS11 3752 (.More CT 7502 (.More CS00 3751 (.More CS01 1875 (.More CP1 3750 (.More CP0 7500 (.More CS10 3749 (.More CP0 7497 (.More CP1 14993 (.More CP0 29986 (.Stop 29986))))))))))))))))))))))))))))), + (.More CT 509 (.More CS10 254 (.More CT 505 (.More CS10 252 (.More CS11 125 (.More CT 248 (.More CT 495 (.More CT 989 (.More CS10 494 (.More CT 985 (.More CT 1969 (.More CS10 984 (.More CT 1965 (.More CT 3929 (.More CS10 1964 (.More CT 3925 (.More CT 7849 (.More CT 15697 (.More CS10 7848 (.More CT 15693 (.More CP0 31387 (.More CT 62771 (.More CT 125541 (.More CS10 62770 (.More CT 125537 (.More CT 251073 (.More CT 502145 (.More CS10 251072 (.More CP0 502143 (.More CS01 251071 (.More CP0 502142 (.More CS10 251070 (.More CS10 125534 (.More CS10 62766 (.More CP0 125531 (.More CS01 62765 (.More CP1 125530 (.More CP0 251060 (.Stop 251060))))))))))))))))))))))))))))))))))))))), + (.More CT 1021 (.More CS10 510 (.More CT 1017 (.More CS10 508 (.More CS11 253 (.More CT 504 (.More CT 1007 (.More CT 2013 (.More CS10 1006 (.More CT 2009 (.More CT 4017 (.More CS10 2008 (.More CT 4013 (.More CT 8025 (.More CS10 4012 (.More CT 8021 (.More CT 16041 (.More CT 32081 (.More CS10 16040 (.More CT 32077 (.More CT 64153 (.More CT 128305 (.More CT 256609 (.More CS10 128304 (.More CT 256605 (.More CT 513209 (.More CT 1026417 (.More CS10 513208 (.More CT 1026413 (.More CS11 513206 (.More CT 1026410 (.More CS00 513205 (.More CS00 256602 (.More CS10 128300 (.More CT 256597 (.More CS11 128298 (.More CT 256594 (.More CT 513187 (.More CS10 256593 (.More CS00 128296 (.More CS10 64147 (.More CS00 32073 (.More CS00 16036 (.More CS11 8017 (.More CP0 16034 (.More CS10 8016 (.More CS10 4007 (.More CS00 2003 (.More CP0 4005 (.More CP1 8009 (.More CP1 16018 (.More CP0 32036 (.Stop 32036))))))))))))))))))))))))))))))))))))))))))))))))))))), + (.More CT 2045 (.More CS10 1022 (.More CT 2041 (.More CS10 1020 (.More CS11 509 (.More CT 1016 (.More CT 2031 (.More CT 4061 (.More CS10 2030 (.More CT 4057 (.More CT 8113 (.More CS10 4056 (.More CT 8109 (.More CT 16217 (.More CS10 8108 (.More CT 16213 (.More CT 32425 (.More CT 64849 (.More CS10 32424 (.More CT 64845 (.More CT 129689 (.More CT 259377 (.More CT 518753 (.More CS10 259376 (.More CT 518749 (.More CT 1037497 (.More CT 2074993 (.More CS10 1037496 (.More CT 2074989 (.More CS10 1037494 (.More CT 2074985 (.More CS11 1037492 (.More CP1 2074984 (.More CT 4149966 (.More CS00 2074983 (.More CT 4149963 (.More CT 8299925 (.More CS10 4149962 (.More CS10 2074980 (.More CS10 1037489 (.More CS00 518744 (.More CP0 1037487 (.More CT 2074971 (.More CS10 1037485 (.More CP0 2074969 (.More CT 4149935 (.More CT 8299869 (.More CT 16599737 (.More CT 33199473 (.More CS10 16599736 (.More CS10 8299867 (.More CP0 16599733 (.More CP1 33199465 (.More CP0 66398930 (.More CS10 33199464 (.More CS11 16599731 (.More CP1 33199462 (.More CP1 66398924 (.More CP0 132797848 (.Stop 132797848)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))), + (.More CT 4093 (.More CS10 2046 (.More CT 4089 (.More CS10 2044 (.More CS11 1021 (.More CT 2040 (.More CT 4079 (.More CT 8157 (.More CS10 4078 (.More CT 8153 (.More CT 16305 (.More CS10 8152 (.More CT 16301 (.More CT 32601 (.More CS10 16300 (.More CT 32597 (.More CT 65193 (.More CT 130385 (.More CS10 65192 (.More CT 130381 (.More CT 260761 (.More CT 521521 (.More CT 1043041 (.More CS10 521520 (.More CT 1043037 (.More CT 2086073 (.More CT 4172145 (.More CS10 2086072 (.More CT 4172141 (.More CS10 2086070 (.More CT 4172137 (.More CS10 2086068 (.More CT 4172133 (.More CT 8344265 (.More CS11 4172132 (.More CT 8344262 (.More CT 16688523 (.More CS10 8344261 (.More CS01 4172130 (.More CP1 8344260 (.More CT 16688518 (.More CT 33377035 (.More CS10 16688517 (.More CT 33377031 (.More CT 66754061 (.More CT 133508121 (.More CT 267016241 (.More CT 534032481 (.More CS10 267016240 (.More CS11 133508119 (.More CT 267016236 (.More CT 534032471 (.More CT 1068064941 (.More CS10 534032470 (.More CS11 267016234 (.More CT 534032466 (.More CT 1068064931 (.More CT 2136129861 (.More CS10 1068064930 (.More CS10 534032464 (.More CS10 267016231 (.More CS00 133508115 (.More CS01 66754057 (.More CP0 133508114 (.More CS10 66754056 (.More CS10 33377027 (.More CP0 66754053 (.More CP0 133508105 (.More CP0 267016209 (.More CS00 133508104 (.More CS10 66754051 (.More CS00 33377025 (.More CP0 66754049 (.More CP1 133508097 (.More CP1 267016194 (.More CP1 534032388 (.More CP0 1068064776 (.Stop 1068064776)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))), + (.More CT 8189 (.More CS10 4094 (.More CT 8185 (.More CS10 4092 (.More CS11 2045 (.More CT 4088 (.More CT 8175 (.More CT 16349 (.More CS10 8174 (.More CT 16345 (.More CT 32689 (.More CS10 16344 (.More CT 32685 (.More CT 65369 (.More CS10 32684 (.More CT 65365 (.More CT 130729 (.More CT 261457 (.More CS10 130728 (.More CT 261453 (.More CT 522905 (.More CT 1045809 (.More CT 2091617 (.More CS10 1045808 (.More CT 2091613 (.More CT 4183225 (.More CT 8366449 (.More CS10 4183224 (.More CT 8366445 (.More CS10 4183222 (.More CT 8366441 (.More CS10 4183220 (.More CT 8366437 (.More CT 16732873 (.More CS10 8366436 (.More CT 16732869 (.More CT 33465737 (.More CS10 16732868 (.More CS10 8366433 (.More CT 16732863 (.More CT 33465725 (.More CT 66931449 (.More CS10 33465724 (.More CT 66931445 (.More CT 133862889 (.More CT 267725777 (.More CT 535451553 (.More CT 1070903105 (.More CS10 535451552 (.More CS11 267725775 (.More CT 535451548 (.More CT 1070903095 (.More CT 2141806189 (.More CS10 1070903094 (.More CS11 535451546 (.More CT 1070903090 (.More CT 2141806179 (.More CT 4283612357 (.More CS10 2141806178 (.More CP1 4283612355 (.More CP1 8567224710 (.More CT 17134449418 (.More CS00 8567224709 (.More CS00 4283612354 (.More CT 8567224705 (.More CT 17134449409 (.More CT 34268898817 (.More CP0 68537797635 (.More CS00 34268898817 (.More CT 68537797631 (.More CT 137075595261 (.More CT 274151190521 (.More CT 548302381041 (.More CT 1096604762081 (.More CS10 548302381040 (.More CS10 274151190519 (.More CS00 137075595259 (.More CP0 274151190517 (.More CP0 548302381033 (.More CP0 1096604762065 (.More CS00 548302381032 (.More CS10 274151190515 (.More CS00 137075595257 (.More CS01 68537797628 (.More CP0 137075595256 (.More CP0 274151190511 (.More CS00 137075595255 (.More CS00 68537797627 (.More CS00 34268898813 (.More CP0 68537797625 (.More CS01 34268898812 (.More CP1 68537797624 (.More CP1 137075595248 (.More CP1 274151190496 (.More CP0 548302380992 (.Stop 548302380992)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))), + (.More CT 16381 (.More CS10 8190 (.More CT 16377 (.More CS10 8188 (.More CS11 4093 (.More CT 8184 (.More CT 16367 (.More CT 32733 (.More CS10 16366 (.More CT 32729 (.More CT 65457 (.More CS10 32728 (.More CT 65453 (.More CT 130905 (.More CS10 65452 (.More CT 130901 (.More CT 261801 (.More CT 523601 (.More CS10 261800 (.More CT 523597 (.More CT 1047193 (.More CT 2094385 (.More CT 4188769 (.More CS10 2094384 (.More CT 4188765 (.More CT 8377529 (.More CT 16755057 (.More CS10 8377528 (.More CT 16755053 (.More CS10 8377526 (.More CT 16755049 (.More CS10 8377524 (.More CT 16755045 (.More CT 33510089 (.More CS10 16755044 (.More CT 33510085 (.More CT 67020169 (.More CS10 33510084 (.More CS11 16755041 (.More CT 33510080 (.More CT 67020159 (.More CT 134040317 (.More CS10 67020158 (.More CT 134040313 (.More CT 268080625 (.More CT 536161249 (.More CT 1072322497 (.More CT 2144644993 (.More CS10 1072322496 (.More CS11 536161247 (.More CT 1072322492 (.More CT 2144644983 (.More CT 4289289965 (.More CS10 2144644982 (.More CS11 1072322490 (.More CT 2144644978 (.More CT 4289289955 (.More CT 8578579909 (.More CS10 4289289954 (.More CT 8578579905 (.More CT 17157159809 (.More CT 34314319617 (.More CP1 68628639235 (.More CT 137257278468 (.More CT 274514556935 (.More CT 549029113869 (.More CT 1098058227737 (.More CS11 549029113868 (.More CT 1098058227734 (.More CT 2196116455467 (.More CT 4392232910933 (.More CT 8784465821865 (.More CT 17568931643729 (.More CS10 8784465821864 (.More CP0 17568931643727 (.More CT 35137863287451 (.More CT 70275726574901 (.More CT 140551453149801 (.More CP0 281102906299603 (.More CS00 140551453149801 (.More CS01 70275726574900 (.More CT 140551453149798 (.More CT 281102906299595 (.More CS11 140551453149797 (.More CP0 281102906299594 (.More CT 562205812599185 (.More CS11 281102906299592 (.More CT 562205812599182 (.More CT 1124411625198363 (.More CT 2248823250396725 (.More CT 4497646500793449 (.More CS10 2248823250396724 (.More CS10 1124411625198361 (.More CS00 562205812599180 (.More CS10 281102906299589 (.More CP0 562205812599177 (.More CS01 281102906299588 (.More CP0 562205812599176 (.More CS10 281102906299587 (.More CS01 140551453149793 (.More CP0 281102906299586 (.More CP0 562205812599171 (.More CP0 1124411625198341 (.More CP1 2248823250396681 (.More CP0 4497646500793362 (.More CP0 8995293001586723 (.More CP0 17990586003173445 (.More CS00 8995293001586722 (.More CS10 4497646500793360 (.More CS10 2248823250396679 (.More CP0 4497646500793357 (.More CP1 8995293001586713 (.More CP1 17990586003173426 (.More CP1 35981172006346852 (.More CP1 71962344012693704 (.More CP0 143924688025387408 (.Stop 143924688025387408))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +] +def z3K : WordList := [V,Q,V,Q,Q,V,V,V,Q,V,V,Q,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,V,V,Q,V,Q,V,Q,V,V,Q,V,V,Q,Q,V,V,V,Q,V,V,V,V,V,Q,Q,V,V,V,Q,Q,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,K,K,V,V,Q,V,V,Q,V,V,V,V,Q,Q,K,Q,V,K,V,Q,K,V,V,V,V,V,V,V,K,Q,Q,V,V,V,V,V,V] +def z3L : WordList := [Q,K,K,K,Q,K,K,Q,Q,K,K,K,K,K,K,Q,Q,K,K,Q,K,Q,K,K,K,K,K,K,K,K,Q,Q,Q,K,Q,Q,Q,Q,K,Q,K,Q,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def z3M : WordList := [K,K,K,K,Q,K,Q,Q,Q,K,Q,Q,K,K,Q,Q,Q,K,Q,Q,K,Q,K,K,K,Q,K,Q,Q,K,Q,K,K,Q,Q,Q,Q,K,Q,K,Q,K,K,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +set_option maxRecDepth 4000000 in +theorem z3N : + ERounds 5 loc_z2Q 13 (z3K ++ z3L) := by + have h1 : ERounds 5 loc_z2Q (5 + loc_z3J.length) (z3K ++ z3L) := by + apply evalERounds_sound loc_z3J + decide + simpa using! h1 +set_option maxRecDepth 4000000 in +theorem z3O : + EGood 13 (z3K ++ z3L) := by + apply eGood_of_check 13 z3K z3L z3M + · decide + · exact EGuard.T 1 _ + · decide + · decide + · decide + · decide + · decide + · decide + · decide + · norm_num [z3K,z3M,wordMass,wordMassK,wordScale] +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d) = some c') : + (multiStep target_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +theorem z3P (m : Nat) : + ∃ N ≥ m,∃ h w,multiStep target_tm (init []) N = some (zCf h (evalWords w default)) /\ EGood h w := by + induction m with + | zero => + rcases loc_z3I with ⟨k1,_,hk1⟩ + rcases loc_z2P z3N with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,13,z3K ++ z3L, + zMt target_tm _ _ _ k1 k2 hk1 hk2,z3O⟩ + | succ m ih => + rcases ih with ⟨N,hN,h,w,h_ms,h_good⟩ + rcases eGood_progress h_good with ⟨w',hStep,h_good'⟩ + rcases loc_z2O hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,h + 1,w', + zMt target_tm _ _ _ N k h_ms h_step_k,h_good'⟩ + +end Solution + + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 +open Solution in +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases z3P (n + 1) with ⟨N,hN,_,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := zIm h_N + rw [zMs,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_1RA0RC diff --git a/BusyBeaver/BB6/NonHalt/M_1RBHHH_1LC1LD_1LD0LB_1RE1LC_1RF0RE_1RA0RC.lean b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1LC1LD_1LD0LB_1RE1LC_1RF0RE_1RA0RC.lean new file mode 100644 index 00000000..9bda539c --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1LC1LD_1LD0LB_1RE1LC_1RF0RE_1RA0RC.lean @@ -0,0 +1,402 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusH +public import BusyBeaver.Calculi.WordCalculusI + + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.M_1RBHHH_1LC1LD_1LD0LB_1RE1LC_1RF0RE_1RA0RC + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1LC1LD_1LD0LB_1RE1LC_1RF0RE_1RA0RC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +open WordCalculus Word WordCanonBR WordCanonBR.BRIncs WordCanonBR.Choice +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +local notation "WordList" => List Word + +def z29_0581 : WordList := [V,V,V,V,V,V,K,V,V,K,V,V,V,Q,V,V,Q,K,K,V,K,K,Q,K,Q,Q,K,K,K,K,K,K,Q] + +def z2a_0581 : List (List Choice) := [ + [CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, CT, (COC0 0), CSP1, CT, CT, CP0, + (CEC 0), CSP0, CS10, CP0, CS01, CP0, CS10, CS10, CS00, CS10, CS10, CP0], + [CT, (COC1 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP1, (COC1 0), (CSC0 0), CSP1, CP0, CP1, + (COC0 0), CSP0, CP1, CP0, CS10, CS11, CP0, CS10, CP1, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), + CSP1, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CP0, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CP1, (COC1 0), CSP1, CT, CT, CT, CP0, CP0, CP0, CP0, CP0, + CS00, CP0, CP0, CP1, CP0, CP0, CS01, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), + CSP0, CT, (COC1 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, + CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, CT, + CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CP0, CP0, CS00, CS00, + CP1, CP0, CS10, CS10, CS10, CP1, CP0, CS10, CP0, CS00, CP0, CP1, CP0, CS10, CP0, CP0, + CP1, CP0, CS10, CP0, CS01, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, CT, CT, + CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CT, + CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, + CT, (COC0 0), CSP0, CS10, CT, (COC1 0), CSP1, CP1, CT, (COC0 0), CSP1, (COC1 0), CSP0, + CT, CT, (COC0 0), CSP1, CT, CT, CT, (COC0 0), CSP1, (COC1 0), CSP0, CT, CT, CP0, CP1, + CP0, CS11, CP0, CS10, CS00, CP0, CS00, CP1, CP1, CP1, CP0, CS11, CP0, CS10, CP1, CP0, + CS10, CP1, CP0, CS10, CP0, CP0, CS01, CP0, CS10, CS00, CS10, CP0, CS01, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, (COC0 0), + CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, + CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP1, CT, CT, + (COC0 0), (CSC1 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, + CT, CT, CT, CT, CT, (COC0 0), CSP1, CT, (COC0 1), CSP0, CT, CT, CT, (COC0 0), CSP1, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, CP0, + CS11, (COC0 0), CSP0, CT, CT, CP0, CS10, CS11, CP1, CP0, CS10, CS00, CS00, CP0, CS00, + CS10, CP0, CS00, CS10, CS00, CS10, CS11, CP0, CS10, CS01, CP1, CP1, CP0, CS10, CS01, CP0, + CS10, CP1, CP0, CS10, CP1, CP0, CS10, CP0, CP0, CS01, CP0, CS10, CP1, CP0, CS10, CS11, + CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), + CSP1, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), + CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, (COC0 0), + CSP1, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), + CSP0, CS11, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, CT, CT, CT, + (COC0 0), (CSC1 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, (COC1 0), CSP0, CT, + CT, CT, CP0, CT, CT, CT, CT, CP1, CT, CT, CP0, (CEC 0), CSP0, CS11, (COC1 0), CSP0, CP0, + CP1, CT, CP0, CT, CT, CT, (COC0 1), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP1, CT, + (COC0 0), (CSC0 0), CSP1, CT, CT, CP1, CT, CT, CP0, CS11, CP1, CP1, CP1, CP0, CP1, CP0, + CP1, CP0, CS10, CS11, CP1, CP1, CP0, CP0, CS00, CS01, CP1, CP1, CP0, CS10, CS01, CP0, + CS10, CP1, CP0, CS10, CP1, CP0, CS10, CP0, CP0, CP1, CP0, CP0, CS01, CP0, CS10, CS11, + CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), + CSP0, CT, (COC1 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, + CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, + CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, (COC1 0), CSP0, CT, CT, (COC0 0), (CSC0 0), CSP1, CT, CT, (COC0 0), CSP0, + CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), + CSP1, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, + CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CP1, CT, + CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP0, CS10, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, CT, + CT, CT, CP1, CT, CT, CT, (COC0 0), CSP0, CS10, CT, CT, CT, (COC0 1), CSP1, CT, (COC0 0), + CSP1, CT, (COC0 0), CSP1, CT, CT, CT, CT, (COC0 0), CSP0, CT, CP1, CT, CT, CP0, CP1, CP0, + CS10, CS10, CP0, CS01, CP0, CP1, CP1, CP0, CS10, CS00, CS11, CP1, CP0, CP0, CS00, CS00, + CS00, CS00, CS01, CP0, CP0, CS00, CS00, CS00, CP0, CS00, CS00, CP0, CP0, CP0, CS00, CS10, + CS00, CP0, CP1, CP1, CP1, CP0, CP1, CP0, CS10, CS10, CS10, CS11, CP0, CS10, CS01, CP1, + CP1, CP0, CS10, CS01, CP0, CS10, CP1, CP0, CS10, CP1, CP0, CS10, CP0, CP0, CP1, CP0, + CS10, CP0, CS01, CP0, CS10, CS11, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, CT, CT, + CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CT, + CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, + CT, (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, CT, CT, (COC0 0), CSP0, CS10, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, + CT, (COC1 0), CSP1, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, (COC0 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, (COC1 0), CSP1, CT, CT, CT, CT, CT, CT, (COC0 0), + CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, + (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, CT, CT, CT, (COC0 0), + CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CP1, (COC1 0), CSP0, CT, CT, CT, CT, CP0, CS11, CT, + CT, (COC0 0), CSP0, CS10, CS00, CS10, CS10, CT, (COC1 0), CSP0, CS10, (CEC 0), CSP0, + CS10, CT, CT, (COC0 0), CSP0, CP0, CT, CT, CT, CT, CT, CT, CT, CP1, CP1, CT, CP0, CT, CT, + CT, (COC0 1), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP1, CT, CT, CT, (COC0 0), CSP1, + (COC1 0), CSP0, CT, CP1, CT, CT, CP0, CS10, CP0, CS00, CS00, CP0, CP0, CP0, CS01, CP0, + CS10, CS00, CS01, CP0, CP0, CS00, CS00, CS10, CS10, CS00, CS00, CS00, CS10, CS00, CS01, + CP1, CP1, CP0, CS11, CP0, CP0, CP1, CP1, CP0, CS10, CS00, CS10, CS00, CS10, CS00, CS10, + CS00, CS00, CS10, CS00, CS00, CS00, CS10, CS10, CP0, CP0, CP0, CP0, CP0, CP1, CP0, CP1, + CP0, CS10, CS11, CP1, CP1, CP0, CP0, CS00, CS01, CP1, CP1, CP0, CS10, CS01, CP0, CS10, + CP1, CP0, CS10, CP1, CP0, CS10, CP0, CP0, CS01, CP0, CS10, CS00, CS10, CP0, CS01, CP0, + CS10, CS01, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, (COC1 0), + CSP1, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, (COC0 0), CSP0, CT, + CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), + CSP0, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP0, CT, CT, (COC0 0), + (CSC0 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, + CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, CT, + (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, + (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, (COC0 0), (CSC0 0), CSP1, CT, CT, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, + CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, + (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, CP0, CP1, (COC0 0), CSP1, (COC1 0), CSP1, CT, + (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), CSP1, (COC1 0), CSP0, CS10, CT, CT, + (COC0 0), CSP0, CT, CP0, CS10, CT, (COC1 0), CSP0, CS10, CS11, CP0, CS10, CS00, CP0, + CS00, CT, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, CP0, CP0, CP0, CP0, CS00, CP0, CS00, + CS00, CP1, CT, CT, CT, CT, CT, CT, CT, CT, CT, CP1, CT, CT, CT, (COC0 0), CSP0, CS10, CT, + CT, CT, (COC0 1), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, + CP0, CS11, (COC0 0), CSP0, CT, CP0, CT, CT, CP0, CS10, CS10, CS10, CS01, CP1, CP1, CP1, + CP0, CS11, CP1, CP0, CP0, CS00, CS00, CP0, CS00, CS10, CS01, CP1, CP1, CP0, CS10, CS01, + CP0, CS10, CP1, CP0, CS10, CP0, CS01, CP1, CP1, CP1, CP0, CS10, CP1, CP1, CP0, CP0, CS01, + CP0, CS11, CP1, CP1, CP1, CP1, CP1, CP1, CP1, CP1, CP1, CP0, CS10, CS00, CS01, CP0, CS10, + CP0, CP0, CP1, CP1, CP1, CP0, CS10, CS01, CP0, CS10, CS10, CS00, CS01, CP0, CS10, CS11, + CP1, CP1, CP0, CS10, CS01, CP0, CS10, CP1, CP0, CS10, CP1, CP0, CS10, CP0, CP0, CS01, + CP0, CS10, CP1, CP0, CS10, CS11, CP0, CS10, CS11, CP1, CP0], + [CT, (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, + (COC1 0), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, (COC1 0), + CSP1, CT, (COC0 0), CSP1, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, + (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, (COC0 0), CSP0, + CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, + CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, (COC0 0), CSP0, CS11, CT, (COC0 0), CSP1, CT, CT, + (COC0 0), CSP0, CS10, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, (COC0 0), CSP0, CS11, CT, + CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, (COC0 0), CSP0, CT, CT, CT, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), + CSP0, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, (COC0 0), CSP0, CS10, CT, CT, CT, + CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), + (CSC1 0), CSP1, CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, + CT, CT, CT, (COC0 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), CSP0, CT, CT, + CT, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, + (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, + CT, CT, (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP1, CT, CT, CT, (COC0 0), + CSP0, CS11, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, (COC1 0), CSP1, CT, + (COC0 0), CSP0, CT, CT, (COC0 0), CSP1, (COC1 0), CSP1, CT, CP1, CT, (COC0 1), CSP0, CT, + (COC1 0), CSP0, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP0, CS10, CT, + CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, + (COC0 0), CSP0, CT, CT, (COC0 0), CSP0, CT, (COC1 0), CSP0, CT, (COC1 0), CSP0, CT, CT, + CT, CP0, CT, CT, CT, CT, CT, CT, CP1, CP0, CT, CT, CT, (COC0 0), CSP1, CT, CT, (COC0 0), + CSP0, (CEC 0), CSP0, CP0, CT, CT, CT, (COC0 1), CSP1, CT, (COC0 0), CSP1, (COC1 0), CSP0, + CT, CT, CT, (COC0 0), CSP1, CT, CT, CT, (COC0 0), (CSC1 0), CSP1, CT, CT, CT, CT, CT, CT, + CT, CT, CT, CT, CP0, (CEC 0), CSP1, CT, CT, CT, CT, CT, CT, (COC0 1), CSP1, CP0, CS10, + CT, CP1, CT, CT, CT, (COC0 1), CSP1, CT, (COC0 0), CSP1, CT, (COC0 0), CSP1, CT, + (COC0 0), (CSC0 0), CSP1, CT, CT, CP1, CT, CP1, CT, CT, CP0, CS10, CS11, CP0, CS10, CS10, + CP1, CP1, CP0, CS10, CS00, CS11, CP0, CS10, CS10, CS00, CS01, CP0, CP1, CP0, CP0, CP0, + CS00, CS10, CS10, CS00, CS10, CS00, CS10, CS00, CS10, CS10, CS10, CS00, CS10, CS10, CS00, + CS10, CS10, CS00, CP0, CS01, CP0, CS10, CP0, CP1, CP0, CS11, CP0, CS11, CP1, CP1, CP1, + CP1, CP1, CP0, CS10, CS00, CS00, CP0, CS00, CS10, CS11, CP1, CP0, CP1, CP1, CP1, CP0, + CS10, CP1, CP0, CP1, CP0, CS11, CP0, CS11, CP1, CP1, CP1, CP0, CS10, CP1, CP1, CP0, CP0, + CS01, CP0, CS11, CP1, CP1, CP1, CP1, CP1, CP1, CP1, CP1, CP1, CP0, CS10, CS00, CP0, CP0, + CP0, CP0, CP1, CP0, CP1, CP0, CS10, CS11, CP1, CP1, CP0, CP0, CS00, CS01, CP1, CP1, CP0, + CS10, CS01, CP0, CS10, CP1, CP0, CS10, CP1, CP0, CS10, CP0, CP0, CP1, CP0, CP0, CS01, + CP0, CS10, CS11, CP0, CS10, CS11, CP1, CP0] +] + +def z2b_0581 : WordList := [V, V, V, V, V, V, K, V, V, Q, V, V, V, K, V, V, V, V, V, V, K, V, + V, V, V, V, V, K, V, V, V, V, V, K, V, V, V, V, V, V, V, V, V, K, V, V, V, V, V, K, V, V, + V, V, V, K, V, Q, V, K, V, V, V, K, V, Q, V, V, V, K, V, V, V, V, K, V, Q, V, V, V, V, V, + V, K, V, V, Q, V, V, V, V, V, K, Q, V, V, V, K, V, V, Q, V, V, K, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, K, V, V, V, K, V, V, Q, V, V, K, V, Q, V, + V, V, V, V, V, V, K, V, V, V, V, V, V, V, V, V, V, V, V, V, K, Q, V, V, V, V, K, V, V, V, + K, V, V, Q, V, V, V, V, V, K, V, V, V, V, V, V, V, V, V, V, K, V, V, V, V, V, V, K, V, V, + Q, V, V, V, V, K, Q, V, V, V, K, V, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + K, V, V, V, K, V, V, Q, V, V, V, V, K, V, Q, V, V, V, V, V, V, K, Q, V, V, Q, V, V, K, V, + V, V, K, V, Q, V, V, V, V, K, V, V, V, Q, V, V, V, V, V, V, V, V, V, V, K, Q, V, V, Q, V, + V, V, V, V, V, V, V, V, V, V, V, V, K, Q, V, V, V, V, K, V, V, V, K, V, V, Q, V, V, Q, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, K, V, V, V, K, V, V, V, V, V, V, V, K, V, V, + V, K, V, Q, V, V, V, V, K, V, V, V, V, K, Q, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, K, V, V, V, Q, V, V, V, V, V, K, V, V, V, K, V, V, K, V, V, K, K, V, V, + V, V, V, V, V, V, V, V, Q, Q, V, Q, Q, V, V, V, Q, K, Q, V, Q, Q, K, K, V, V, V, V, V, K, + Q, Q, K, Q, K, Q, K, Q, Q, Q, K, Q, Q, K, Q, Q, K, V, K, V, Q, V, V, V, Q, V, Q, V, V, V, + V, V, V, Q, K, K, V, K, Q, Q, V, V, V, V, V, V, Q, V, V, V, V, Q, V, Q, V, V, V, V, Q, V, + V, V, V, K, V, Q, V, V, V, V, V, V, V, V, V, V, Q, K, V, V, V, V, V, V, V, V, Q, Q, V, V, + V, V, K, K, V, V, V, Q, K, V, Q, V, V, Q, V, V, Q, V, V, V, V, V, K, V, Q, Q, V, Q, Q, V, V] + +def z2c_low_0581 : WordList := [Q, K, K, Q, K, K, K, Q, K, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, + Q, Q, Q, K, K, K, Q, Q, K, K, K, K, Q, K, Q, Q, Q, Q, K, K, Q, K, Q, Q, K, K, Q, Q, Q, Q, + Q, Q, Q, Q, Q, Q, Q, K, Q, K, K, Q, K, K, Q, K, Q, K, Q, K, K, Q, K, K, Q, K, K, Q, K, K, + K, K, K, Q, K, K, K, Q, K, Q, K, Q, Q, K, K, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, K, + Q, Q, Q, Q, K, K, Q, K, K, K, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, K, K, Q, Q, Q, K, Q, Q, Q, Q, + Q, Q, Q, Q, Q, Q, Q, Q, K, K, Q, Q, K, Q, Q, K, K, Q, Q, K, K, Q, Q, Q, Q, Q, Q, Q, K, K, + Q, Q, Q, K, Q, Q, Q, K, K, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, K, K, Q, Q, Q, Q, Q, K, K, K, Q, + Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, K, K, Q, Q, K, K, Q, + K, Q, K, Q, Q, Q, Q, Q, Q, Q, K, K, Q, Q, K, K, K, K, Q, Q, K, K, Q, Q, Q, Q, Q, Q, K, K, + Q, Q, K, K, Q, Q, Q, K, K, Q, Q, Q, K] + +def z2c_top_0581 : WordList := [K,Q,K,Q,K,Q,Q,Q,K,K,Q,K,Q,Q,K,K] + +def z2c_0581 : WordList := z2c_low_0581 ++ z2c_top_0581 + +theorem z2d_0581 : + CanonRounds (evalWords z29_0581 default) + (evalWords (prefix33Words ++ (z2b_0581 ++ (z2c_0581 ++ tail8Words))) default) := + evalCanonRounds_sound z2a_0581 z29_0581 + (prefix33Words ++ (z2b_0581 ++ (z2c_0581 ++ tail8Words))) + (by decide +kernel) + +theorem z2e_0581 : + BGood (z2b_0581 ++ (z2c_0581 ++ tail8Words)) := by + apply bGood_of_check z2b_0581 z2c_low_0581 z2c_top_0581 <;> decide +kernel + +def zPre_0581 : WordList := [V,V,V,V,V,V,K,V,V,K,V,V,V,Q,V,V,Q,K,K,V,K,K,Q,K,Q,Q,K,K,K,K,K,K,K] + +def zCk0_0581 : CCfg := ⟨F,0,[],[]⟩ + +def zCk1_0581 : CCfg := ⟨B,0, + [1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, + 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1], + [1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1]⟩ + +def zCk2_0581 : CCfg := ⟨E,0, + [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, + 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1], + [0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1]⟩ + +def zCk3_0581 : CCfg := ⟨E,0, + [0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 0, 0, 1], + [0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0, 1, 0, 1, 0, 0, 0, 1]⟩ + +def zCk4_0581 : CCfg := ⟨E,0, + [0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, + 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1], + [0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]⟩ + +def zCk5_0581 : CCfg := ⟨A,0, + [1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1], + [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1]⟩ + +def zCk6_0581 : CCfg := ⟨C,1, + [0, 1], + [0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, + 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, + 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, + 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, + 0, 1]⟩ + +private theorem zCk_step1_0581 : (c_to_cfg zCk0_0581) [canon_tm]⊢⁺ (c_to_cfg zCk1_0581) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk0_0581 10000 = some zCk1_0581) + +private theorem zCk_step2_0581 : (c_to_cfg zCk1_0581) [canon_tm]⊢⁺ (c_to_cfg zCk2_0581) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk1_0581 10000 = some zCk2_0581) + +private theorem zCk_step3_0581 : (c_to_cfg zCk2_0581) [canon_tm]⊢⁺ (c_to_cfg zCk3_0581) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk2_0581 10000 = some zCk3_0581) + +private theorem zCk_step4_0581 : (c_to_cfg zCk3_0581) [canon_tm]⊢⁺ (c_to_cfg zCk4_0581) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk3_0581 10000 = some zCk4_0581) + +private theorem zCk_step5_0581 : (c_to_cfg zCk4_0581) [canon_tm]⊢⁺ (c_to_cfg zCk5_0581) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk4_0581 10000 = some zCk5_0581) + +private theorem zCk_step6_0581 : (c_to_cfg zCk5_0581) [canon_tm]⊢⁺ (c_to_cfg zCk6_0581) := + canonBMultiStepFast_sound (by decide) + (by decide +kernel : canonBMultiStepFast zCk5_0581 1601 = some zCk6_0581) + +private theorem zPre_side_0581 : + Side ([Call.ch] ^ 16) (evalWords zPre_0581 default) (evalWords z29_0581 default) := + evalChPow_sound zPre_0581 16 z29_0581 (by decide +kernel) + +theorem z0E_0581 : (c_to_cfg zCk0_0581) [canon_tm]⊢⁺ (cfgCanon (evalWords z29_0581 default)) := by + have h_all := stepPlus_trans_canon zCk_step1_0581 + (stepPlus_trans_canon zCk_step2_0581 + (stepPlus_trans_canon zCk_step3_0581 + (stepPlus_trans_canon zCk_step4_0581 + (stepPlus_trans_canon zCk_step5_0581 zCk_step6_0581)))) + have heq : c_to_cfg zCk6_0581 = cfgLeft lh (w_pre +> evalWords zPre_0581 default) := by + simp only [c_to_cfg, C, WordCanonBR.C, zCk6_0581, zCL, cfgLeft, lh, w_pre, w_pre_rest, + w_pre5_rest, w_pre3_rest, w_word, + zPre_0581, evalWords, t, d0, d1, one, List.cons_append, List.nil_append, append_cons, + append_nil, z00, zero_cons_default_canon, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] + rw [heq] at h_all + exact stepPlus_trans_canon h_all (stepPlus_word_pre_full zPre_side_0581) + +theorem z2s_0581 (m : Nat) : + ∃ N ≥ m,∃ w,multiStep canon_tm (c_to_cfg zCk0_0581) N = + some (cfgCanon (evalWords (prefix33Words ++ w) default)) /\ BGood w := by + induction m with + | zero => + rcases z0E_0581 with ⟨k1,_,hk1⟩ + rcases stepStar_of_canonRounds z2d_0581 with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,z2b_0581 ++ (z2c_0581 ++ tail8Words), + multiStep_trans_canon canon_tm _ _ _ k1 k2 hk1 hk2,z2e_0581⟩ + | succ m ih => + rcases ih with ⟨N,hN,w,h_ms,h_good⟩ + rcases bGood_progress h_good with ⟨w',hStep,h_good'⟩ + rcases stepPlus_of_bStep hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,w', + multiStep_trans_canon canon_tm _ _ _ N k h_ms h_step_k,h_good'⟩ + +def zStMap_0581 : Fin 6 -> Fin 6 + | 0 => 2 + | 1 => 3 + | 2 => 4 + | 3 => 5 + | 4 => 1 + | 5 => 0 + +def zCfgMap_0581 (c : Cfg (Fin 2) (Fin 6)) : Cfg (Fin 2) (Fin 6) := + ⟨c.q.map zStMap_0581,⟨c.tape.head,c.tape.right,c.tape.left⟩⟩ + +theorem zStepMap_0581 (c : Cfg (Fin 2) (Fin 6)) : + step target_tm (zCfgMap_0581 c) = (step canon_tm c).map zCfgMap_0581 := by + rcases c with ⟨_ | ⟨_ | _ | _ | _ | _ | _ | q,hq⟩,⟨h,l,r⟩⟩ <;> + rcases h with ⟨_ | _ | a,ha⟩ <;> + first | omega | rfl + +theorem zMultiStepMap_0581 (c : Cfg (Fin 2) (Fin 6)) (n : Nat) : + multiStep target_tm (zCfgMap_0581 c) n = (multiStep canon_tm c n).map zCfgMap_0581 := by + induction n with + | zero => rfl + | succ n ih => + rw [multiStep_succ_canon,multiStep_succ_canon,ih] + cases multiStep canon_tm c n with + | none => rfl + | some c' => exact zStepMap_0581 c' + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases z2s_0581 (n + 1) with ⟨N,hN,_,h_N,_⟩ + have h_init : zCfgMap_0581 (c_to_cfg zCk0_0581) = init [] := rfl + have h_map := zMultiStepMap_0581 (c_to_cfg zCk0_0581) N + rw [h_init,h_N] at h_map + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_map + have h_some := multiStep_add_Intermediate h_map + rw [multiStep_succ_canon,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RBHHH_1LC1LD_1LD0LB_1RE1LC_1RF0RE_1RA0RC diff --git a/BusyBeaver/BB6/NonHalt/M_1RBHHH_1LC1RE_1LD0LC_1LE1LC_1RF0RE_1RA0RB.lean b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1LC1RE_1LD0LC_1LE1LC_1RF0RE_1RA0RB.lean new file mode 100644 index 00000000..47edfe28 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1LC1RE_1LD0LC_1LE1LC_1RF0RE_1RA0RB.lean @@ -0,0 +1,2079 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.Longitudinal + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RBHHH_1LC1RE_1LD0LC_1LE1LC_1RF0RE_1RA0RB + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1LC1RE_1LD0LC_1LE1LC_1RF0RE_1RA0RB" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open BusyBeaver.Longitudinal + +local notation "zB" => ListBlank (Fin 2) +local notation "zF" => List (Fin 2) + +set_option linter.unusedSectionVars false +set_option maxHeartbeats 2000000 +set_option maxRecDepth 200000 + +/-- `BLECv5.v:TM4.tm` is `flipTM target_tm` (`1LB---_1RC1LE_1RD0RC_1RE1RC_1LF0LE_1LA0LB`). +Under the state relabeling `rename` (`A↦4, B↦5, C↦0, D↦1, E↦2, F↦3`), `tm` is identical +to `BLECv2.v:TM4.tm` (`1LB0LA_1LC0LD_1LD---_1RE1LA_1RF0RE_1RA1RE`). -/ +abbrev tm : Machine (Fin 2) (Fin 6) := flipTM target_tm + +abbrev A : Fin 6 := 4 +abbrev B : Fin 6 := 5 +abbrev C : Fin 6 := 0 +abbrev D : Fin 6 := 1 +abbrev E : Fin 6 := 2 +abbrev F : Fin 6 := 3 + +def runSteps (M : Machine (Fin 2) (Fin 6)) : + ℕ → BoundedConfig.BCfg (Fin 2) (Fin 6) → Option (BoundedConfig.BCfg (Fin 2) (Fin 6)) + | 0, x => some x + | n + 1, x => (BoundedConfig.step M x).bind (runSteps M n) + +theorem runSteps_spec (M : Machine (Fin 2) (Fin 6)) (n : ℕ) + (x x' : BoundedConfig.BCfg (Fin 2) (Fin 6)) + (h : runSteps M n x = some x') (l₀ r₀ : zB) : + (BoundedConfig.toCfg x l₀ r₀) [M]⊢* (BoundedConfig.toCfg x' l₀ r₀) := by + induction n generalizing x with + | zero => cases h; try exact stepStar_refl M _ + | succ n ih => + dsimp [runSteps] at h + rcases hst : BoundedConfig.step M x with _ | y <;> rw [hst] at h + · cases h + · exact stepStar_trans ⟨1, BoundedConfig.step_spec M x hst l₀ r₀⟩ (ih y h) + +theorem runSteps1_spec (M : Machine (Fin 2) (Fin 6)) (n : ℕ) + (x x' : BoundedConfig.BCfg (Fin 2) (Fin 6)) + (h : runSteps M (n + 1) x = some x') (l₀ r₀ : zB) : + (BoundedConfig.toCfg x l₀ r₀) [M]⊢⁺ (BoundedConfig.toCfg x' l₀ r₀) := by + dsimp [runSteps] at h + rcases hst : BoundedConfig.step M x with _ | y <;> rw [hst] at h + · cases h + · exact stepPlus_stepStar_trans ⟨1, by decide, BoundedConfig.step_spec M x hst l₀ r₀⟩ + (runSteps_spec M n y x' h l₀ r₀) + +theorem stepStar_congr {c₁ c₁' c₂ c₂' : Cfg (Fin 2) (Fin 6)} + (h : c₁ [tm]⊢* c₂) (hc₁ : c₁ = c₁') (hc₂ : c₂ = c₂') : + c₁' [tm]⊢* c₂' := by + subst hc₁ hc₂; exact h + +theorem stepPlus_congr {c₁ c₁' c₂ c₂' : Cfg (Fin 2) (Fin 6)} + (h : c₁ [tm]⊢⁺ c₂) (hc₁ : c₁ = c₁') (hc₂ : c₂ = c₂') : + c₁' [tm]⊢⁺ c₂' := by + subst hc₁ hc₂; exact h + +theorem SideRLs.congr {M : Machine (Fin 2) (Fin 6)} + {ls ls' : List (DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6))} + {r₁ r₁' r₂ r₂' : zB} + (h : SideRLs M ls r₁ r₂) (hls : ls = ls') (hr₁ : r₁ = r₁') (hr₂ : r₂ = r₂') : + SideRLs M ls' r₁' r₂' := by + subst hls hr₁ hr₂; exact h + +theorem segRLs_addmul'' {M : Machine (Fin 2) (Fin 6)} + {h : List (DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6))} + {a x b : ℕ} {w₁ w₂ : zF} + (hb : SegRLs M (h ^ b) [] w₁ w₂) + (ha : SegRLs M (h ^ a) h w₂ w₂) : + SegRLs M (h ^ (x * a + b)) (h ^ x) w₁ w₂ := by + simpa only [Nat.add_zero] using SegRLs.addmul (c := 0) hb ha + +-- ============================================================================ +-- Section 1: Right/Left Counters & Base Transitions (`BLECv2.v:910-1391`) +-- ============================================================================ + +inductive Tp where + | t0 | t1 | t2 | t3 | t4 | t5 | t6 | t7 + deriving DecidableEq, Repr + +def rhList : Tp → zF + | .t0 => [1, 0, 1] + | .t1 => [0, 0, 0, 0, 1] + | .t2 => [1, 0, 1, 0, 1, 0, 1] + | .t3 => [1, 0, 1, 0, 0, 0, 1, 0, 1] + | .t4 => [0, 0, 0, 0, 1, 1, 0, 1] + | .t5 => [0, 0, 0, 0, 1, 0, 0, 1, 0, 1] + | .t6 => [1, 0, 1, 0, 0, 0, 0, 0, 1] + | .t7 => [0, 0, 0, 0, 1, 0, 0, 1] + +def rh (t : Tp) : zB := rhList t +> default + +def nxt : Tp → Tp + | .t0 => .t1 + | .t1 => .t2 + | .t2 => .t3 + | .t3 => .t4 + | .t4 => .t5 + | .t5 => .t6 + | .t6 => .t7 + | .t7 => .t0 + +def offset : Tp → ℕ + | .t0 => 0 + | .t1 => 1 + | .t2 => 0 + | .t3 => 0 + | .t4 => 1 + | .t5 => 1 + | .t6 => 0 + | .t7 => 1 + +theorem offset_le_one (t : Tp) : offset t ≤ 1 := by + cases t <;> decide + +abbrev d0 : zF := [0, 0, 1, 1, 1, 1] +abbrev d1 : zF := [0, 0, 0, 1, 1, 1] +abbrev d2 : zF := [1, 0, 1, 1, 1, 1] +abbrev w : zF := [0, 1, 1, 1, 1] +abbrev v : zF := [0, 0, 0, 1, 1] +abbrev z0 : zF := [0, 0, 0, 0] +abbrev z1 : zF := [0, 0, 0, 1] + +inductive RC : ℕ → Tp → zB → Prop where + | RC_0 (t : Tp) : RC 0 t (d0 +> rh t) + | RC_1 (t : Tp) : RC 1 t (d1 +> rh t) + | RC_2 (t : Tp) : RC 2 t (d2 +> rh t) + | RC_3 (n : ℕ) (t : Tp) (r : zB) : + RC (n * 2 + (1 - offset t)) (nxt t) r → + RC (n * 3 + 3) t (d0 +> (w ^ ((n + 1 + offset t) / 3) +> r)) + | RC_4 (n : ℕ) (t : Tp) (r : zB) : + RC (n * 2 + (1 - offset t)) (nxt t) r → + RC (n * 3 + 4) t (d1 +> (w ^ ((n + 1 + offset t) / 3) +> r)) + | RC_5 (n : ℕ) (t : Tp) (r : zB) : + RC (n * 2 + (1 - offset t)) (nxt t) r → + RC (n * 3 + 5) t (d2 +> (w ^ ((n + 1 + offset t) / 3) +> r)) + +theorem RC.congr {n n' : ℕ} {t t' : Tp} {r r' : zB} + (h : RC n t r) (hn : n = n') (ht : t = t') (hr : r = r') : RC n' t' r' := by + subst hn ht hr; exact h + +private theorem rinc_d0 (l r : zB) : + (l {{E}}> (d0 +> r)) [tm]⊢⁺ (l <{{A}} (d1 +> r)) := by + have h := runSteps1_spec tm 4 ⟨[], d0, E, .right⟩ ⟨d1, [], A, .left⟩ (by decide) l r + simpa only [BoundedConfig.toCfg, append_nil] using h + +private theorem rinc_d1 (l r : zB) : + (l {{E}}> (d1 +> r)) [tm]⊢⁺ (l <{{A}} (d2 +> r)) := by + have h := runSteps1_spec tm 4 ⟨[], d1, E, .right⟩ ⟨d2, [], A, .left⟩ (by decide) l r + simpa only [BoundedConfig.toCfg, append_nil] using h + +private theorem shift_E_w_step (l r : zB) : + (l {{E}}> (w +> r)) [tm]⊢* ((v +> l) {{E}}> r) := by + have h := runSteps_spec tm 5 ⟨[], w, E, .right⟩ ⟨v, [], E, .right⟩ (by decide) l r + simpa only [BoundedConfig.toCfg, append_nil] using h + +private theorem shift_E_w (k : ℕ) (l r : zB) : + (l {{E}}> (w ^ k +> r)) [tm]⊢* ((v ^ k +> l) {{E}}> r) := by + induction k generalizing l with + | zero => exact stepStar_refl tm _ + | succ k ih => + rw [pow_succ_list, append_assoc] + refine stepStar_trans (shift_E_w_step l (w ^ k +> r)) ?_ + refine stepStar_congr (ih (v +> l)) rfl ?_ + rw [← append_assoc, ← pow_succ_list'] + +private theorem shift_A_v_step (l r : zB) : + ((v +> l) <{{A}} r) [tm]⊢* (l <{{A}} (w +> r)) := by + have h := runSteps_spec tm 5 ⟨[], v, A, .left⟩ ⟨w, [], A, .left⟩ (by decide) l r + simpa only [BoundedConfig.toCfg, append_nil] using h + +private theorem shift_A_v (k : ℕ) (l r : zB) : + ((v ^ k +> l) <{{A}} r) [tm]⊢* (l <{{A}} (w ^ k +> r)) := by + induction k generalizing r with + | zero => exact stepStar_refl tm _ + | succ k ih => + rw [pow_succ_list, append_assoc] + refine stepStar_trans (shift_A_v_step (v ^ k +> l) r) ?_ + refine stepStar_congr (ih (w +> r)) rfl ?_ + rw [← append_assoc (w ^ k) w r, ← pow_succ_list'] + +private theorem pow_v_comm (k : ℕ) (l : zB) : + v ^ (k + 1) +> l = v +> (v ^ k +> l) := by + rw [pow_succ_list, append_assoc] + +private theorem enter_d2_base (l r : zB) : + ((v +> l) {{E}}> (d2 +> r)) [tm]⊢* ((v +> (([0] ++ v) +> l)) {{E}}> r) := by + have h := runSteps_spec tm 6 ⟨v, d2, E, .right⟩ ⟨v ++ ([0] ++ v), [], E, .right⟩ (by decide) l r + simpa only [BoundedConfig.toCfg, append_nil, append_assoc] using h + +private theorem enter_d2 (k : ℕ) (l r : zB) : + ((v +> l) {{E}}> (d2 +> (w ^ k +> r))) [tm]⊢* + ((v ^ (k + 1) +> (([0] ++ v) +> l)) {{E}}> r) := by + refine stepStar_trans (enter_d2_base l (w ^ k +> r)) ?_ + refine stepStar_congr (shift_E_w k (v +> (([0] ++ v) +> l)) r) rfl ?_ + rw [← append_assoc, ← pow_succ_list'] + +private theorem bounce_mid_base (l r : zB) : + ((([0] ++ v) +> l) <{{A}} r) [tm]⊢* ((d1 +> l) {{E}}> r) := by + have h := runSteps_spec tm 7 ⟨[], [0] ++ v, A, .left⟩ ⟨d1, [], E, .right⟩ (by decide) l r + simpa only [BoundedConfig.toCfg, append_nil] using h + +private theorem bounce_mid (k : ℕ) (l r : zB) : + ((v ^ k +> (([0] ++ v) +> l)) <{{A}} r) [tm]⊢* + ((v ^ k +> (d1 +> l)) {{E}}> r) := by + refine stepStar_trans (shift_A_v k (([0] ++ v) +> l) r) ?_ + refine stepStar_trans (bounce_mid_base l (w ^ k +> r)) ?_ + exact shift_E_w k (d1 +> l) r + +private theorem exit_d0_base (l r : zB) : + ((d1 +> l) <{{A}} r) [tm]⊢* (l <{{A}} (d0 +> r)) := by + have h := runSteps_spec tm 6 ⟨[], d1, A, .left⟩ ⟨d0, [], A, .left⟩ (by decide) l r + simpa only [BoundedConfig.toCfg, append_nil] using h + +private theorem exit_d0 (k : ℕ) (l r : zB) : + ((v ^ k +> (d1 +> l)) <{{A}} r) [tm]⊢* + (l <{{A}} (d0 +> (w ^ k +> r))) := by + refine stepStar_trans (shift_A_v k (d1 +> l) r) ?_ + exact exit_d0_base l (w ^ k +> r) + +private theorem rinc_rc2 (t : Tp) : + ∃ r', RC 3 t r' ∧ ∀ l, ((v +> l) {{E}}> (d2 +> rh t)) [tm]⊢⁺ (l <{{A}} r') := by + cases t + · refine ⟨d0 +> (w ^ ((0 + 1 + offset .t0) / 3) +> (d1 +> rh .t1)), + RC.RC_3 0 .t0 _ (RC.RC_1 .t1), fun l => ?_⟩ + have h := (BoundedConfig.sideRLs_c_spec tm (hs := [((E, v), (A, []))]) + (r := d2 ++ rhList .t0) (r' := d0 ++ d1 ++ rhList .t1) (T := 100) (by decide)).elim_single l + rw [show (0 + 1 + offset .t0) / 3 = 0 by rfl, pow_zero_list, append_nil] + simpa only [toDHCfg, rh, append_nil, append_assoc] using h + · refine ⟨d0 +> (w ^ ((0 + 1 + offset .t1) / 3) +> (d0 +> rh .t2)), + RC.RC_3 0 .t1 _ (RC.RC_0 .t2), fun l => ?_⟩ + have h := (BoundedConfig.sideRLs_c_spec tm (hs := [((E, v), (A, []))]) + (r := d2 ++ rhList .t1) (r' := d0 ++ d0 ++ rhList .t2) (T := 100) (by decide)).elim_single l + rw [show (0 + 1 + offset .t1) / 3 = 0 by rfl, pow_zero_list, append_nil] + simpa only [toDHCfg, rh, append_nil, append_assoc] using h + · refine ⟨d0 +> (w ^ ((0 + 1 + offset .t2) / 3) +> (d1 +> rh .t3)), + RC.RC_3 0 .t2 _ (RC.RC_1 .t3), fun l => ?_⟩ + have h := (BoundedConfig.sideRLs_c_spec tm (hs := [((E, v), (A, []))]) + (r := d2 ++ rhList .t2) (r' := d0 ++ d1 ++ rhList .t3) (T := 100) (by decide)).elim_single l + rw [show (0 + 1 + offset .t2) / 3 = 0 by rfl, pow_zero_list, append_nil] + simpa only [toDHCfg, rh, append_nil, append_assoc] using h + · refine ⟨d0 +> (w ^ ((0 + 1 + offset .t3) / 3) +> (d1 +> rh .t4)), + RC.RC_3 0 .t3 _ (RC.RC_1 .t4), fun l => ?_⟩ + have h := (BoundedConfig.sideRLs_c_spec tm (hs := [((E, v), (A, []))]) + (r := d2 ++ rhList .t3) (r' := d0 ++ d1 ++ rhList .t4) (T := 100) (by decide)).elim_single l + rw [show (0 + 1 + offset .t3) / 3 = 0 by rfl, pow_zero_list, append_nil] + simpa only [toDHCfg, rh, append_nil, append_assoc] using h + · refine ⟨d0 +> (w ^ ((0 + 1 + offset .t4) / 3) +> (d0 +> rh .t5)), + RC.RC_3 0 .t4 _ (RC.RC_0 .t5), fun l => ?_⟩ + have h := (BoundedConfig.sideRLs_c_spec tm (hs := [((E, v), (A, []))]) + (r := d2 ++ rhList .t4) (r' := d0 ++ d0 ++ rhList .t5) (T := 100) (by decide)).elim_single l + rw [show (0 + 1 + offset .t4) / 3 = 0 by rfl, pow_zero_list, append_nil] + simpa only [toDHCfg, rh, append_nil, append_assoc] using h + · refine ⟨d0 +> (w ^ ((0 + 1 + offset .t5) / 3) +> (d0 +> rh .t6)), + RC.RC_3 0 .t5 _ (RC.RC_0 .t6), fun l => ?_⟩ + have h := (BoundedConfig.sideRLs_c_spec tm (hs := [((E, v), (A, []))]) + (r := d2 ++ rhList .t5) (r' := d0 ++ d0 ++ rhList .t6) (T := 100) (by decide)).elim_single l + rw [show (0 + 1 + offset .t5) / 3 = 0 by rfl, pow_zero_list, append_nil] + simpa only [toDHCfg, rh, append_nil, append_assoc] using h + · refine ⟨d0 +> (w ^ ((0 + 1 + offset .t6) / 3) +> (d1 +> rh .t7)), + RC.RC_3 0 .t6 _ (RC.RC_1 .t7), fun l => ?_⟩ + have h := (BoundedConfig.sideRLs_c_spec tm (hs := [((E, v), (A, []))]) + (r := d2 ++ rhList .t6) (r' := d0 ++ d1 ++ rhList .t7) (T := 100) (by decide)).elim_single l + rw [show (0 + 1 + offset .t6) / 3 = 0 by rfl, pow_zero_list, append_nil] + simpa only [toDHCfg, rh, append_nil, append_assoc] using h + · refine ⟨d0 +> (w ^ ((0 + 1 + offset .t7) / 3) +> (d0 +> rh .t0)), + RC.RC_3 0 .t7 _ (RC.RC_0 .t0), fun l => ?_⟩ + have h := (BoundedConfig.sideRLs_c_spec tm (hs := [((E, v), (A, []))]) + (r := d2 ++ rhList .t7) (r' := d0 ++ d0 ++ rhList .t0) (T := 100) (by decide)).elim_single l + rw [show (0 + 1 + offset .t7) / 3 = 0 by rfl, pow_zero_list, append_nil] + simpa only [toDHCfg, rh, append_nil, append_assoc] using h + +theorem RInc (n : ℕ) (t : Tp) (r : zB) (h : RC n t r) : + ∃ r', RC (n + 1) t r' ∧ + (n % 3 ≠ 2 → ∀ l, (l {{E}}> r) [tm]⊢⁺ (l <{{A}} r')) ∧ + (n % 3 = 2 → ∀ l, ((v +> l) {{E}}> r) [tm]⊢⁺ (l <{{A}} r')) := by + induction n using Nat.strongRecOn generalizing t r with + | ind n ih => + cases h with + | RC_0 t => + exact ⟨d1 +> rh t, .RC_1 t, fun _ l => rinc_d0 l (rh t), fun hm => by omega⟩ + | RC_1 t => + exact ⟨d2 +> rh t, .RC_2 t, fun _ l => rinc_d1 l (rh t), fun hm => by omega⟩ + | RC_2 t => + rcases rinc_rc2 t with ⟨r', hr', hstep⟩ + exact ⟨r', hr', fun hm => by omega, fun _ => hstep⟩ + | RC_3 n0 t r0 h0 => + exact ⟨_, .RC_4 n0 t r0 h0, fun _ l => rinc_d0 l _, fun hm => by omega⟩ + | RC_4 n0 t r0 h0 => + exact ⟨_, .RC_5 n0 t r0 h0, fun _ l => rinc_d1 l _, fun hm => by omega⟩ + | RC_5 n0 t r0 h0 => + have hoff := offset_le_one t + rcases ih (n0 * 2 + (1 - offset t)) (by omega) (nxt t) r0 h0 with ⟨r1, h1, i2, i3⟩ + rcases ih (n0 * 2 + (1 - offset t) + 1) (by omega) (nxt t) r1 h1 with ⟨r2, h2, i5, i6⟩ + have h2' : RC ((n0 + 1) * 2 + (1 - offset t)) (nxt t) r2 := + h2.congr (by omega) rfl rfl + refine ⟨d0 +> (w ^ (((n0 + 1) + 1 + offset t) / 3) +> r2), + (RC.RC_3 (n0 + 1) t r2 h2').congr (by omega) rfl rfl, + fun hm => by omega, fun _ l => ?_⟩ + set m := (n0 + 1 + offset t) / 3 + have h_enter := enter_d2 m l r0 + by_cases hm1 : (n0 * 2 + (1 - offset t)) % 3 = 2 + · have h_mid1 : ((v ^ (m + 1) +> (([0] ++ v) +> l)) {{E}}> r0) [tm]⊢⁺ + ((v ^ m +> (([0] ++ v) +> l)) <{{A}} r1) := by + rw [pow_v_comm m] + exact i3 hm1 _ + have h_bm := bounce_mid m l r1 + have hm2 : (n0 * 2 + (1 - offset t) + 1) % 3 ≠ 2 := by omega + have h_mid2 := i5 hm2 (v ^ m +> (d1 +> l)) + have hm_eq : ((n0 + 1) + 1 + offset t) / 3 = m := by omega + rw [hm_eq] + exact stepStar_stepPlus_trans h_enter + (stepPlus_stepStar_trans h_mid1 + (stepStar_trans h_bm + (stepPlus_to_stepStar (stepPlus_stepStar_trans h_mid2 (exit_d0 m l r2))))) + · have h_mid1 := i2 hm1 (v ^ (m + 1) +> (([0] ++ v) +> l)) + have h_bm := bounce_mid (m + 1) l r1 + by_cases hm2 : (n0 * 2 + (1 - offset t) + 1) % 3 = 2 + · have h_mid2 : ((v ^ (m + 1) +> (d1 +> l)) {{E}}> r1) [tm]⊢⁺ + ((v ^ m +> (d1 +> l)) <{{A}} r2) := by + rw [pow_v_comm m] + exact i6 hm2 _ + have hm_eq : ((n0 + 1) + 1 + offset t) / 3 = m := by omega + rw [hm_eq] + exact stepStar_stepPlus_trans h_enter + (stepPlus_stepStar_trans h_mid1 + (stepStar_trans h_bm + (stepPlus_to_stepStar (stepPlus_stepStar_trans h_mid2 (exit_d0 m l r2))))) + · have h_mid2 := i5 hm2 (v ^ (m + 1) +> (d1 +> l)) + have hm_eq : ((n0 + 1) + 1 + offset t) / 3 = m + 1 := by omega + rw [hm_eq] + exact stepStar_stepPlus_trans h_enter + (stepPlus_stepStar_trans h_mid1 + (stepStar_trans h_bm + (stepPlus_to_stepStar (stepPlus_stepStar_trans h_mid2 (exit_d0 (m + 1) l r2))))) + +abbrev hR : DH0 (Fin 2) (Fin 6) := (E, []) +abbrev hL : DH0 (Fin 2) (Fin 6) := (A, []) +abbrev hRL : List (DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6)) := [(hR, hL)] +abbrev hLR : List (DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6)) := [(hL, hR)] + +private theorem sideRL_w_mod2 (m : ℕ) {r r0 : zB} + (hstep : ∀ l, ((v +> l) {{E}}> r) [tm]⊢⁺ (l <{{A}} r0)) : + SideRL tm hR hL (w +> (w ^ m +> r)) (w ^ m +> r0) := by + intro l + dsimp [toDHCfg] + refine stepStar_stepPlus_trans (shift_E_w_step l (w ^ m +> r)) ?_ + refine stepStar_stepPlus_trans (shift_E_w m (v +> l) r) ?_ + have hv : v ^ m +> (v +> l) = v +> (v ^ m +> l) := by + rw [← append_assoc, ← pow_succ_list', pow_succ_list, append_assoc] + rw [hv] + exact stepPlus_stepStar_trans (hstep (v ^ m +> l)) (shift_A_v m l r0) + +private theorem sideRL_w_ne2 (m : ℕ) {r r0 : zB} + (hstep : ∀ l, (l {{E}}> r) [tm]⊢⁺ (l <{{A}} r0)) : + SideRL tm hR hL (w ^ m +> r) (w ^ m +> r0) := by + intro l + dsimp [toDHCfg] + exact stepStar_stepPlus_trans (shift_E_w m l r) + (stepPlus_stepStar_trans (hstep (v ^ m +> l)) (shift_A_v m l r0)) + +theorem RIncs2 (m n : ℕ) (t : Tp) (r : zB) (h : RC n t r) (hm : n % 3 = 2) : + ∃ r', RC (n + m * 3) t r' ∧ SideRLs tm (hRL ^ (m * 3)) (w ^ m +> r) r' := by + induction m generalizing n t r with + | zero => + exact ⟨r, h, .nil r⟩ + | succ m ih => + rcases RInc n t r h with ⟨r0, h0, _, i2⟩ + rcases RInc (n + 1) t r0 h0 with ⟨r1, h1, i4, _⟩ + rcases RInc (n + 2) t r1 h1 with ⟨r2, h2, i6, _⟩ + rcases ih (n + 3) t r2 h2 (by omega) with ⟨r', hr', hside⟩ + refine ⟨r', hr'.congr (by omega) rfl rfl, ?_⟩ + have hm_pow : hRL ^ ((m + 1) * 3) = (hR, hL) :: (hR, hL) :: (hR, hL) :: (hRL ^ (m * 3)) := by + have : (m + 1) * 3 = 3 + m * 3 := by omega + rw [this, pow_add_list]; rfl + rw [hm_pow, pow_succ_list, append_assoc] + exact .cons (sideRL_w_mod2 m (i2 hm)) + (.cons (sideRL_w_ne2 m (i4 (by omega))) + (.cons (sideRL_w_ne2 m (i6 (by omega))) hside)) + +theorem RIncs1 (m n : ℕ) (t : Tp) (r : zB) (h : RC n t r) (hm : n % 3 = 1) : + ∃ r', RC (n + m * 3 + 1) t r' ∧ SideRLs tm (hRL ^ (m * 3 + 1)) (w ^ m +> r) r' := by + rcases RInc n t r h with ⟨r0, h0, i2, _⟩ + rcases RIncs2 m (n + 1) t r0 h0 (by omega) with ⟨r', hr', hside⟩ + refine ⟨r', hr'.congr (by omega) rfl rfl, ?_⟩ + have hm_pow : hRL ^ (m * 3 + 1) = (hR, hL) :: (hRL ^ (m * 3)) := by + rw [Nat.add_comm (m * 3) 1, pow_add_list]; rfl + rw [hm_pow] + exact .cons (sideRL_w_ne2 m (i2 (by omega))) hside + +theorem RIncs0 (m n : ℕ) (t : Tp) (r : zB) (h : RC n t r) (hm : n % 3 = 0) : + ∃ r', RC (n + m * 3 + 2) t r' ∧ SideRLs tm (hRL ^ (m * 3 + 2)) (w ^ m +> r) r' := by + rcases RInc n t r h with ⟨r0, h0, i2, _⟩ + rcases RIncs1 m (n + 1) t r0 h0 (by omega) with ⟨r', hr', hside⟩ + refine ⟨r', hr'.congr (by omega) rfl rfl, ?_⟩ + have hm_pow : hRL ^ (m * 3 + 2) = (hR, hL) :: (hRL ^ (m * 3 + 1)) := by + have : m * 3 + 2 = 1 + (m * 3 + 1) := by omega + rw [this, pow_add_list]; rfl + rw [hm_pow] + exact .cons (sideRL_w_ne2 m (i2 (by omega))) hside + +theorem RIncs (m n : ℕ) (t : Tp) (r : zB) (h : RC n t r) : + ∃ r', RC (n + m * 3 + (2 - n % 3)) t r' ∧ + SideRLs tm (hRL ^ (m * 3 + (2 - n % 3))) (w ^ m +> r) r' := by + have hmod : n % 3 = 0 ∨ n % 3 = 1 ∨ n % 3 = 2 := by omega + rcases hmod with hm | hm | hm + · simpa [hm] using RIncs0 m n t r h hm + · simpa [hm] using RIncs1 m n t r h hm + · simpa [hm] using RIncs2 m n t r h hm + +inductive LC : ℕ → List ℕ → zB → Prop where + | LC_0 : LC 0 [] default + | LC_1 (n : ℕ) (l : zB) : LC n [] l → LC (n * 2 + 1) [] (z1 +> l) + | LC_2 (n : ℕ) (l : zB) : LC (n + 1) [] l → LC (n * 2 + 2) [] (z0 +> l) + | LC_1' (n h : ℕ) (t : List ℕ) (l : zB) : + LC n (h :: t) l → LC (n * 2 + 1) ((h + 1) :: t) (z1 +> l) + | LC_0' (n h : ℕ) (t : List ℕ) (l : zB) : + LC n (h :: t) l → LC (n * 2) ((h + 1) :: t) (z0 +> l) + | LC_w (n : ℕ) (ls : List ℕ) (l : zB) : + LC n ls l → LC n (0 :: ls) (v +> l) + +theorem LC.congr {n n' : ℕ} {ls ls' : List ℕ} {l l' : zB} + (h : LC n ls l) (hn : n = n') (hls : ls = ls') (hl : l = l') : LC n' ls' l' := by + subst hn hls hl; exact h + +private theorem linc_z0 (l r : zB) : + ((z0 +> l) <{{A}} r) [tm]⊢⁺ ((z1 +> l) {{E}}> r) := by + have h := runSteps1_spec tm 6 ⟨[], z0, A, .left⟩ ⟨z1, [], E, .right⟩ (by decide) l r + simpa only [BoundedConfig.toCfg, append_nil] using h + +private theorem linc_z1_left (l r : zB) : + ((z1 +> l) <{{A}} r) [tm]⊢* (l <{{A}} ([1, 1, 1, 1] +> r)) := by + have h := runSteps_spec tm 4 ⟨[], z1, A, .left⟩ ⟨[1, 1, 1, 1], [], A, .left⟩ (by decide) l r + simpa only [BoundedConfig.toCfg, append_nil] using h + +private theorem linc_z1_right (l r : zB) : + (l {{E}}> ([1, 1, 1, 1] +> r)) [tm]⊢* ((z0 +> l) {{E}}> r) := by + have h := runSteps_spec tm 4 ⟨[], [1, 1, 1, 1], E, .right⟩ ⟨z0, [], E, .right⟩ (by decide) l r + simpa only [BoundedConfig.toCfg, append_nil] using h + +theorem LInc (n : ℕ) (ls : List ℕ) (l : zB) (h : LC n ls l) : + ∃ l', LC (n + 1) ls l' ∧ ∀ r, (l <{{A}} r) [tm]⊢⁺ (l' {{E}}> r) := by + induction h with + | LC_0 => + refine ⟨z1 +> default, LC.LC_1 0 default LC.LC_0, fun r => ?_⟩ + have hd : z0 +> (default : zB) = default := BoundedConfig.all0_spec (by decide) + simpa only [hd] using linc_z0 default r + | LC_1 n l h ih => + rcases ih with ⟨l', hl', hstep⟩ + refine ⟨z0 +> l', (LC.LC_2 n l' hl').congr (by omega) rfl rfl, fun r => ?_⟩ + exact stepStar_stepPlus_trans (linc_z1_left l r) + (stepPlus_stepStar_trans (hstep ([1, 1, 1, 1] +> r)) (linc_z1_right l' r)) + | LC_2 n l h _ => + exact ⟨z1 +> l, (LC.LC_1 (n + 1) l h).congr (by omega) rfl rfl, fun r => linc_z0 l r⟩ + | LC_1' n h t l hlc ih => + rcases ih with ⟨l', hl', hstep⟩ + refine ⟨z0 +> l', (LC.LC_0' (n + 1) h t l' hl').congr (by omega) rfl rfl, fun r => ?_⟩ + exact stepStar_stepPlus_trans (linc_z1_left l r) + (stepPlus_stepStar_trans (hstep ([1, 1, 1, 1] +> r)) (linc_z1_right l' r)) + | LC_0' n h t l hlc _ => + exact ⟨z1 +> l, LC.LC_1' n h t l hlc, fun r => linc_z0 l r⟩ + | LC_w n ls l hlc ih => + rcases ih with ⟨l', hl', hstep⟩ + refine ⟨v +> l', LC.LC_w (n + 1) ls l' hl', fun r => ?_⟩ + exact stepStar_stepPlus_trans (shift_A_v_step l r) + (stepPlus_stepStar_trans (hstep (w +> r)) (shift_E_w_step l' r)) + +theorem LIncs (m n : ℕ) (ls : List ℕ) (l : zB) (h : LC n ls l) : + ∃ l', LC (n + m) ls l' ∧ SideRLs (flipTM tm) (hLR ^ m) l l' := by + induction m generalizing n l with + | zero => + exact ⟨l, h, .nil l⟩ + | succ m ih => + rcases LInc n ls l h with ⟨l0, hl0, hstep⟩ + rcases ih (n + 1) l0 hl0 with ⟨l', hl', hside⟩ + refine ⟨l', hl'.congr (by omega) rfl rfl, ?_⟩ + have hm_pow : hLR ^ (m + 1) = (hL, hR) :: (hLR ^ m) := rfl + rw [hm_pow] + refine .cons (fun r => ?_) hside + exact toDHCfg_stepPlus_flip (h₁ := hL) (h₂ := hR) (d₁ := .left) (d₂ := .right) (hstep r) + +private theorem rov_enter (k : ℕ) (l r : zB) : + (l {{E}}> (d2 +> (w ^ k +> r))) [tm]⊢* + ((v ^ (k + 1) +> ([0] +> l)) {{E}}> r) := by + have h1 : (l {{E}}> (d2 +> (w ^ k +> r))) [tm]⊢* + ((v +> ([0] +> l)) {{E}}> (w ^ k +> r)) := by + have h := runSteps_spec tm 6 ⟨[], d2, E, .right⟩ ⟨v ++ [0], [], E, .right⟩ (by decide) l (w ^ k +> r) + simpa only [BoundedConfig.toCfg, append_nil, append_assoc] using h + refine stepStar_trans h1 ?_ + refine stepStar_congr (shift_E_w k (v +> ([0] +> l)) r) rfl ?_ + rw [← append_assoc, ← pow_succ_list'] + +theorem ROv01 (n : ℕ) (t : Tp) (r : zB) (h : RC (n * 3 + 5) t r) + (hm : (n * 2 + (1 - offset t)) % 3 ≠ 2) : + ∃ r', RC (n * 2 + (1 - offset t) + 1) (nxt t) r' ∧ + ∀ l, (l {{E}}> r) [tm]⊢* + (([0] +> l) <{{A}} (w ^ ((n + 1 + offset t) / 3 + 1) +> r')) := by + generalize h_idx : n * 3 + 5 = idx at h + cases h with + | RC_5 n0 t r0 h0 => + have hn0 : n0 = n := by omega + subst n0 + rcases RInc (n * 2 + (1 - offset t)) (nxt t) r0 h0 with ⟨r', hr', i2, _⟩ + refine ⟨r', hr', fun l => ?_⟩ + set k := (n + 1 + offset t) / 3 + exact stepStar_trans (rov_enter k l r0) + (stepStar_trans (stepPlus_to_stepStar (i2 hm (v ^ (k + 1) +> ([0] +> l)))) + (shift_A_v (k + 1) ([0] +> l) r')) + | _ => omega + +theorem ROv2 (n : ℕ) (t : Tp) (r : zB) (h : RC (n * 3 + 5) t r) + (hm : (n * 2 + (1 - offset t)) % 3 = 2) : + ∃ r', RC (n * 2 + (1 - offset t) + 1) (nxt t) r' ∧ + ∀ l, (l {{E}}> r) [tm]⊢* + (([0] +> l) <{{A}} (w ^ ((n + 1 + offset t) / 3) +> r')) := by + generalize h_idx : n * 3 + 5 = idx at h + cases h with + | RC_5 n0 t r0 h0 => + have hn0 : n0 = n := by omega + subst n0 + rcases RInc (n * 2 + (1 - offset t)) (nxt t) r0 h0 with ⟨r', hr', _, i3⟩ + refine ⟨r', hr', fun l => ?_⟩ + set k := (n + 1 + offset t) / 3 + have hmid : ((v ^ (k + 1) +> ([0] +> l)) {{E}}> r0) [tm]⊢⁺ + ((v ^ k +> ([0] +> l)) <{{A}} r') := by + rw [pow_v_comm k] + exact i3 hm (v ^ k +> ([0] +> l)) + exact stepStar_trans (rov_enter k l r0) + (stepStar_trans (stepPlus_to_stepStar hmid) + (shift_A_v k ([0] +> l) r')) + | _ => omega + +theorem ROv (n : ℕ) (t : Tp) (r : zB) (h : RC (n * 3 + 5) t r) : + ∃ r', RC (n * 2 + (1 - offset t) + 1) (nxt t) r' ∧ + ∀ l, (l {{E}}> r) [tm]⊢* + (([0] +> l) <{{A}} + (w ^ ((n + 1 + offset t) / 3 + (1 - ((n * 2 + (1 - offset t)) % 3) / 2)) +> r')) := by + by_cases hm : (n * 2 + (1 - offset t)) % 3 = 2 + · have hdiv : 1 - ((n * 2 + (1 - offset t)) % 3) / 2 = 0 := by omega + rw [hdiv, Nat.add_zero] + exact ROv2 n t r h hm + · have hdiv : 1 - ((n * 2 + (1 - offset t)) % 3) / 2 = 1 := by omega + rw [hdiv] + exact ROv01 n t r h hm + +theorem BigStep0 {k : ℕ} {ls : List ℕ} {l : zB} {n : ℕ} {t : Tp} {r : zB} + (hlc : LC k (0 :: ls) l) (hrc : RC (n * 3 + 5) t r) : + ∃ l' r', LC (3 + k) ls l' ∧ RC ((n + 1) * 3 + 5) t r' ∧ + (l {{E}}> r) [tm]⊢⁺ (l' {{E}}> r') := by + generalize h_ls : (0 :: ls : List ℕ) = ls0 at hlc + cases hlc with + | LC_w k ls1 l0 hlc0 => + injection h_ls with _ h_eq + subst h_eq + rcases RInc (n * 3 + 5) t r hrc with ⟨r0, hrc0, _, ir1⟩ + rcases LInc k ls l0 hlc0 with ⟨l1, hlc1, il1⟩ + rcases RInc (n * 3 + 6) t r0 hrc0 with ⟨r1, hrc1, ir2, _⟩ + rcases LInc (k + 1) ls l1 hlc1 with ⟨l2, hlc2, il2⟩ + rcases RInc (n * 3 + 7) t r1 hrc1 with ⟨r2, hrc2, ir3, _⟩ + rcases LInc (k + 2) ls l2 hlc2 with ⟨l3, hlc3, il3⟩ + refine ⟨l3, r2, hlc3.congr (by omega) rfl rfl, hrc2.congr (by omega) rfl rfl, ?_⟩ + exact stepPlus_trans (ir1 (by omega) l0) + (stepPlus_trans (il1 r0) + (stepPlus_trans (ir2 (by omega) l1) + (stepPlus_trans (il2 r1) + (stepPlus_trans (ir3 (by omega) l2) (il3 r2))))) + | _ => cases h_ls + +-- ============================================================================ +-- Section 2: Longitudinal Reset & Symbolic State System (`BLECv5.v:412-645`) +-- ============================================================================ + +abbrev Hs : List (DH0 (Fin 2) (Fin 6) × DH0 (Fin 2) (Fin 6)) := hLR + +abbrev LH (n : ℕ) (l l' : zB) : Prop := + SideRLs (flipTM tm) (Hs ^ n) l l' + +theorem LH.congr {n n' : ℕ} {l l₀ l' l₀' : zB} + (h : LH n l l') (hn : n = n') (hl : l = l₀) (hl' : l' = l₀') : LH n' l₀ l₀' := by + subst hn hl hl'; exact h + +theorem LH_add {a b : ℕ} {l l' l'' : zB} (h1 : LH a l l') (h2 : LH b l' l'') : + LH (a + b) l l'' := + h1.trans_add h2 + +theorem LH_inc (m k : ℕ) (ls : List ℕ) (l : zB) (h : LC k ls l) : + ∃ l', LC (k + m) ls l' ∧ LH m l l' := + LIncs m k ls l h + +theorem LH_word {n : ℕ} {l l' : zB} (h : LH n l l') : + LH n (v +> l) (v +> l') := by + have hseg : SegRLs (flipTM tm) Hs Hs v v := + BoundedConfig.segRLs_c_spec (flipTM tm) (T := 100) (by decide) + exact (SegRLs.wall_pow hseg n).sideRLs_concat h + +theorem LH_zero {n : ℕ} {l l' : zB} (h : LH n l l') : + LH (n * 2) (z0 +> l) (z0 +> l') := by + have ha : SegRLs (flipTM tm) (Hs ^ 2) Hs z0 z0 := + BoundedConfig.segRLs_c_spec (flipTM tm) (T := 100) (by decide) + have hseg := segRLs_addmul'' (x := n) (a := 2) (b := 0) (.nil z0) ha + simpa only [Nat.add_zero] using hseg.sideRLs_concat h + +theorem LH_cross {l l' : zB} (h : LH 3 l l') : + LH 2 ([0] +> (v +> l)) (v +> ([0] +> l')) := by + have hseg : SegRLs (flipTM tm) (Hs ^ 2) (Hs ^ 3) ([0] ++ v) (v ++ [0]) := + BoundedConfig.segRLs_c_spec (flipTM tm) (T := 200) (by decide) + simpa only [append_assoc, append_cons, append_nil] using hseg.sideRLs_concat h + +def up : List ℕ → List ℕ + | [] => [] + | h :: ls => (h + 1) :: ls + +def down : List ℕ → List ℕ + | [] => [] + | h :: ls => (h - 1) :: ls + +theorem LC_even_intro (n : ℕ) (ls : List ℕ) (l : zB) (h : LC n ls l) : + LC (n * 2) (up ls) (z0 +> l) := by + rcases ls with _ | ⟨hd, tl⟩ + · rcases n with _ | n + · generalize hm : (0 : ℕ) = m at h + cases h with + | LC_0 => + have hd0 : z0 +> (default : zB) = default := BoundedConfig.all0_spec (by decide) + simpa only [up, Nat.zero_mul, hd0] using LC.LC_0 + | _ => omega + · exact (LC.LC_2 n l h).congr (by omega) rfl rfl + · exact (LC.LC_0' n hd tl l h).congr rfl (by simp [up]; try omega) rfl + +theorem LC_even (n : ℕ) (ls : List ℕ) (l : zB) (h : LC (n * 2) (up ls) l) : + ∃ l', LC n ls l' ∧ l = z0 +> l' := by + generalize hm : n * 2 = m at h + generalize hls : up ls = ls0 at h + rcases ls with _ | ⟨hd, tl⟩ <;> dsimp [up] at hls + · cases h with + | LC_0 => + have hn : n = 0 := by omega + subst hn + have hd0 : (default : zB) = z0 +> default := (BoundedConfig.all0_spec (by decide)).symm + exact ⟨default, .LC_0, hd0⟩ + | LC_1 n0 l0 _ => omega + | LC_2 n0 l0 h0 => + exact ⟨l0, h0.congr (by omega) rfl rfl, rfl⟩ + | _ => cases hls + · cases h with + | LC_1' n0 h0 t0 l0 _ => omega + | LC_0' n0 h0 t0 l0 h0 => + injection hls with hh ht + exact ⟨l0, h0.congr (by omega) (by rw [ht]; congr; omega) rfl, rfl⟩ + | LC_w n0 ls1 l0 _ => injection hls with hh; omega + | _ => cases hls + +theorem LC_odd (n : ℕ) (ls : List ℕ) (l : zB) (h : LC (n * 2 + 1) (up ls) l) : + ∃ l', LC n ls l' ∧ l = z1 +> l' := by + generalize hm : n * 2 + 1 = m at h + generalize hls : up ls = ls0 at h + rcases ls with _ | ⟨hd, tl⟩ <;> dsimp [up] at hls + · cases h with + | LC_0 => omega + | LC_1 n0 l0 h0 => + exact ⟨l0, h0.congr (by omega) rfl rfl, rfl⟩ + | LC_2 n0 l0 _ => omega + | _ => cases hls + · cases h with + | LC_1' n0 h0 t0 l0 h0 => + injection hls with hh ht + exact ⟨l0, h0.congr (by omega) (by rw [ht]; congr; omega) rfl, rfl⟩ + | LC_0' n0 h0 t0 l0 _ => omega + | LC_w n0 ls1 l0 _ => injection hls with hh; omega + | _ => cases hls + +inductive Reset : ℕ → List ℕ → ℕ → ℕ → List ℕ → Prop where + | RZero : Reset 0 [] 0 0 [] + | ROdd (n : ℕ) (ls : List ℕ) : Reset (n * 2 + 1) (up ls) 1 n (0 :: ls) + | REven (n : ℕ) (ls : List ℕ) (c k : ℕ) (ls' : List ℕ) : + Reset n ls c k ls' → Reset (n * 2) (up ls) (c * 2) (k * 2) (up ls') + | RMark (n : ℕ) (ls : List ℕ) (c k : ℕ) (ls' : List ℕ) : + Reset (n + 3) ls c k ls' → Reset n (0 :: ls) (2 + c) k (0 :: ls') + +theorem Reset.congr {n n' : ℕ} {ls ls₀ : List ℕ} {c c' k k' : ℕ} {ls' ls₀' : List ℕ} + (h : Reset n ls c k ls') + (hn : n = n') (hls : ls = ls₀) (hc : c = c') (hk : k = k') (hls' : ls' = ls₀') : + Reset n' ls₀ c' k' ls₀' := by + subst hn hls hc hk hls'; exact h + +theorem LH_absorb (l : zB) : LH 1 ([0] +> (z1 +> l)) (v +> l) := by + have hseg : SegRLs (flipTM tm) (Hs ^ 1) [] ([0] ++ z1) v := + BoundedConfig.segRLs_c_spec (flipTM tm) (T := 100) (by decide) + simpa only [append_assoc, append_cons, append_nil] using hseg.sideRLs_concat (.nil l) + +theorem Reset_spec {n : ℕ} {ls : List ℕ} {c k : ℕ} {ls' : List ℕ} + (h : Reset n ls c k ls') (l : zB) (hl : LC n ls l) : + ∃ l', LC k ls' l' ∧ LH c ([0] +> l) l' := by + induction h generalizing l with + | RZero => + generalize hm : (0 : ℕ) = m at hl + generalize hls : ([] : List ℕ) = ls0 at hl + cases hl with + | LC_0 => + have hd : ([0] : zF) +> (default : zB) = default := BoundedConfig.all0_spec (by decide) + exact ⟨default, .LC_0, by rw [hd]; exact .nil default⟩ + | LC_1 => omega + | LC_2 => omega + | _ => cases hls + | ROdd n ls => + rcases LC_odd n ls l hl with ⟨l', hl', rfl⟩ + exact ⟨v +> l', .LC_w n ls l' hl', LH_absorb l'⟩ + | REven n ls c k ls' _ ih => + rcases LC_even n ls l hl with ⟨l0, hl0, rfl⟩ + rcases ih l0 hl0 with ⟨l', hl', hr⟩ + refine ⟨z0 +> l', LC_even_intro k ls' l' hl', ?_⟩ + have hz : ([0] : zF) +> (z0 +> l0) = z0 +> (([0] : zF) +> l0) := rfl + rw [hz] + exact LH_zero hr + | RMark n ls c k ls' _ ih => + generalize hls : (0 :: ls : List ℕ) = ls0 at hl + cases hl with + | LC_w _ ls1 l0 hl0 => + injection hls with _ h_eq + subst h_eq + rcases LH_inc 3 n ls l0 hl0 with ⟨l1, hl1, h3⟩ + rcases ih l1 hl1 with ⟨l', hl', hr⟩ + exact ⟨v +> l', .LC_w k ls' l' hl', LH_add (LH_cross h3) (LH_word hr)⟩ + | _ => cases hls + +theorem LH_first {n : ℕ} {l l' : zB} (h : LH (1 + n) l l') : + ∃ l0, LH n l0 l' ∧ ∀ r, (l <{{A}} r) [tm]⊢⁺ (l0 {{E}}> r) := by + have hpow : Hs ^ (1 + n) = (hL, hR) :: (Hs ^ n) := by + rw [pow_add_list]; rfl + unfold LH at h + rw [hpow] at h + cases h with + | cons h_first h_rest => + exact ⟨_, h_rest, fun r => + toDHCfg_stepPlus_unflip (h₁ := hL) (h₂ := hR) (d₁ := .right) (d₂ := .left) (h_first r)⟩ + +theorem phase_calls (n : ℕ) {l l' r r' : zB} + (hl : LH (1 + n) l l') (hr : SideRLs tm (hRL ^ n) r r') : + (l <{{A}} r) [tm]⊢⁺ (l' {{E}}> r') := by + induction n generalizing l r with + | zero => + cases hr + rcases LH_first hl with ⟨l0, hl0, hleft⟩ + cases hl0 + exact hleft _ + | succ n ih => + rcases LH_first hl with ⟨l0, hl0, hleft⟩ + have hpow : hRL ^ (n + 1) = (hR, hL) :: (hRL ^ n) := rfl + rw [hpow] at hr + cases hr with + | cons hr_first hr_rest => + have h1 : (1 + n : ℕ) = n + 1 := by omega + rw [← h1] at hl0 + exact stepPlus_trans (hleft r) + (stepPlus_trans (hr_first l0) (ih hl0 hr_rest)) + +theorem Phase {n : ℕ} {t : Tp} {r l l' : zB} + (hr : RC (n * 3 + 5) t r) (hl : LH (n + 4 + offset t) ([0] +> l) l') : + ∃ r', RC (n * 3 + 5) (nxt t) r' ∧ (l {{E}}> r) [tm]⊢⁺ (l' {{E}}> r') := by + have hoff := offset_le_one t + rcases ROv n t r hr with ⟨r0, hr0, h0⟩ + set m := (n + 1 + offset t) / 3 + (1 - ((n * 2 + (1 - offset t)) % 3) / 2) + rcases RIncs m (n * 2 + (1 - offset t) + 1) (nxt t) r0 hr0 with ⟨r', hr', h1⟩ + have he : m * 3 + (2 - (n * 2 + (1 - offset t) + 1) % 3) = n + 3 + offset t := by omega + refine ⟨r', hr'.congr (by omega) rfl rfl, ?_⟩ + rw [he] at h1 + exact stepStar_stepPlus_trans (h0 l) + (phase_calls (n + 3 + offset t) (hl.congr (by omega) rfl rfl) h1) + +theorem Phase_reset {n : ℕ} {t : Tp} {r : zB} {k : ℕ} {ls : List ℕ} {c k' : ℕ} {ls' : List ℕ} {l : zB} + (hr : RC (n * 3 + 5) t r) (hl : LC k ls l) + (hreset : Reset k ls c k' ls') (hc : c ≤ n + 4 + offset t) : + ∃ l' r', LC (k' + (n + 4 + offset t - c)) ls' l' ∧ + RC (n * 3 + 5) (nxt t) r' ∧ (l {{E}}> r) [tm]⊢⁺ (l' {{E}}> r') := by + rcases Reset_spec hreset l hl with ⟨l0, hl0, h0⟩ + rcases LH_inc (n + 4 + offset t - c) k' ls' l0 hl0 with ⟨l', hl', h1⟩ + have h2 : LH (n + 4 + offset t) ([0] +> l) l' := + (LH_add h0 h1).congr (by omega) rfl rfl + rcases Phase hr h2 with ⟨r', hr', hrun⟩ + exact ⟨l', r', hl', hr', hrun⟩ + + + + + + + + +-- ============================================================================ +-- Section 3: High-Level State Machine & Phase Cycles (`BLECv5.v:573-1330`) +-- ============================================================================ + +inductive State where + | st (k : ℕ) (ls : List ℕ) (n : ℕ) (t : Tp) + deriving DecidableEq, Repr + +inductive Next : State → State → Prop where + | Drop (k : ℕ) (ls : List ℕ) (n : ℕ) (t : Tp) : + Next (.st k (0 :: ls) n t) (.st (k + 3) ls (n + 1) t) + | Reset_next (k : ℕ) (ls : List ℕ) (n : ℕ) (t : Tp) (c k' : ℕ) (ls' : List ℕ) : + Reset k ls c k' ls' → c ≤ n + 4 + offset t → + Next (.st k ls n t) (.st (k' + (n + 4 + offset t - c)) ls' n (nxt t)) + +def Denote (s : State) (l r : zB) : Prop := + match s with + | .st k ls n t => LC k ls l ∧ RC (n * 3 + 5) t r + +theorem Denote.congr {s s' : State} {l l' r r' : zB} + (h : Denote s l r) (hs : s = s') (hl : l = l') (hr : r = r') : + Denote s' l' r' := by + subst hs hl hr; exact h + +theorem Next_spec {s s' : State} (h : Next s s') (l r : zB) (hd : Denote s l r) : + ∃ l' r', Denote s' l' r' ∧ (l {{E}}> r) [tm]⊢⁺ (l' {{E}}> r') := by + rcases h with ⟨k, ls, n, t⟩ | ⟨k, ls, n, t, c, k', ls', hres, hc⟩ + · rcases hd with ⟨hl, hr⟩ + rcases BigStep0 hl hr with ⟨l', r', hl', hr', hrun⟩ + exact ⟨l', r', ⟨hl'.congr (by omega) rfl rfl, hr'.congr (by omega) rfl rfl⟩, hrun⟩ + · rcases hd with ⟨hl, hr⟩ + rcases Phase_reset hr hl hres hc with ⟨l', r', hl', hr', hrun⟩ + exact ⟨l', r', ⟨hl', hr'⟩, hrun⟩ + +def shift (i : ℕ) : List ℕ → List ℕ + | [] => [] + | h :: ls => (i + h) :: ls + +theorem Reset_scale (i : ℕ) {n : ℕ} {ls : List ℕ} {c k : ℕ} {ls' : List ℕ} + (h : Reset n ls c k ls') : + Reset (n * 2 ^ i) (shift i ls) (c * 2 ^ i) (k * 2 ^ i) (shift i ls') := by + induction i with + | zero => + refine h.congr (by omega) ?_ (by omega) (by omega) ?_ + · cases ls <;> simp [shift] + · cases ls' <;> simp [shift] + | succ i ih => + have hev := Reset.REven (n * 2 ^ i) (shift i ls) (c * 2 ^ i) (k * 2 ^ i) (shift i ls') ih + have hp : 2 ^ (i + 1) = 2 ^ i * 2 := by rw [Nat.pow_succ] + refine hev.congr (by rw [hp]; ring) ?_ (by rw [hp]; ring) (by rw [hp]; ring) ?_ + · cases ls <;> simp [shift, up]; omega + · cases ls' <;> simp [shift, up]; omega + +inductive Steps : State → State → Prop where + | Done (s : State) : Steps s s + | Advance {s t u : State} : Next s t → Steps t u → Steps s u + +theorem Steps.congr {s s' t t' : State} (h : Steps s t) (hs : s = s') (ht : t = t') : + Steps s' t' := by + subst hs ht; exact h + +theorem Steps_spec {s s' : State} (h : Steps s s') (l r : zB) (hd : Denote s l r) : + ∃ l' r', Denote s' l' r' ∧ (l {{E}}> r) [tm]⊢* (l' {{E}}> r') := by + induction h generalizing l r with + | Done s => + exact ⟨l, r, hd, stepStar_refl tm _⟩ + | Advance hnext _ ih => + rcases Next_spec hnext l r hd with ⟨l0, r0, hmid, hrun⟩ + rcases ih l0 r0 hmid with ⟨l', r', h', hrun'⟩ + exact ⟨l', r', h', stepPlus_to_stepStar (stepPlus_stepStar_trans hrun hrun')⟩ + +theorem reset_odd (n : ℕ) (ls' : List ℕ) {k : ℕ} {ls : List ℕ} + (hk : k = n * 2 + 1) (hls : ls = up ls') : + Reset k ls 1 n (0 :: ls') := + (Reset.ROdd n ls').congr hk.symm hls.symm rfl rfl rfl + +theorem reset_even (n : ℕ) (ls0 : List ℕ) {k : ℕ} {ls : List ℕ} {c k' : ℕ} {ls' : List ℕ} + (hk : k = n * 2) (hls : ls = up ls0) + (h : Reset n ls0 c k' ls') : + Reset k ls (c * 2) (k' * 2) (up ls') := + (Reset.REven n ls0 c k' ls' h).congr hk.symm hls.symm rfl rfl rfl + +theorem reset_mark {k : ℕ} {ls : List ℕ} {c k' : ℕ} {ls' : List ℕ} + (h : Reset (k + 3) ls c k' ls') : + Reset k (0 :: ls) (2 + c) k' (0 :: ls') := + .RMark k ls c k' ls' h + +macro "rodd" n:term:arg ls:term:arg : tactic => + `(tactic| (apply reset_odd $n ($ls : List ℕ); { omega }; { rfl })) + +macro "reven" n:term:arg ls:term:arg : tactic => + `(tactic| (apply reset_even $n ($ls : List ℕ); { omega }; { rfl })) + +macro "rmark" : tactic => + `(tactic| apply reset_mark) + +theorem step_drop {k : ℕ} {ls : List ℕ} {n : ℕ} {t : Tp} {s' : State} + (h : Steps (.st (k + 3) ls (n + 1) t) s') : + Steps (.st k (0 :: ls) n t) s' := + .Advance (.Drop k ls n t) h + +theorem step_reset_as (k_new n_new : ℕ) + {k : ℕ} {ls : List ℕ} {n : ℕ} {t : Tp} {c k' : ℕ} {ls' : List ℕ} {s' : State} + (hr : Reset k ls c k' ls') + (hc : c ≤ n + 4 + offset t) + (hk : k' + (n + 4 + offset t - c) = k_new) + (hn : n = n_new) + (h : Steps (.st k_new ls' n_new (nxt t)) s') : + Steps (.st k ls n t) s' := by + subst hk hn + exact .Advance (.Reset_next k ls n t c k' ls' hr hc) h + +macro "phase_with" k_new:term:arg n_new:term:arg "{" tacs:tacticSeq "}" : tactic => + `(tactic| ( + repeat' apply step_drop + refine step_reset_as $k_new $n_new (by $tacs) (by dsimp [offset]; omega) (by dsimp [offset]; omega) (by omega) ?_ + dsimp only [up, down, nxt] + )) + +def RootG (n : ℕ) : State := .st (n * 2 + 7) [0] n .t5 +def RootD (h n : ℕ) : State := .st (n * 2 + 7 - 3 * 2 ^ (h - 1)) [0, h] n .t5 +def RootE (n : ℕ) : State := .st (n * 2 + 3) [1, 0] n .t5 +def RootF (n : ℕ) : State := .st (n * 2 + 3) [0, 0, 1] n .t5 + +theorem E_cycle (n : ℕ) (hn : 64 ≤ n) (hmod : n % 8 = 2) : + Steps (RootE n) (RootG (n + 9)) := by + set q := n / 8 + have hq : n = q * 8 + 2 := by omega + unfold RootE RootG + phase_with (n * 2 + 5) n { rodd (q * 8 + 3) [0, 0] } + phase_with (n * 2 + 11) (n + 3) { reven (q * 8 + 9) []; rodd (q * 4 + 4) [] } + phase_with (n * 2 + 12) (n + 3) { rodd (q * 8 + 7) [0] } + phase_with (n * 2 + 15) (n + 5) { reven (q * 8 + 11) []; rodd (q * 4 + 5) [] } + phase_with (n * 2 + 16) (n + 5) { rodd (q * 8 + 9) [0] } + phase_with (n * 2 + 19) (n + 7) { reven (q * 8 + 13) []; rodd (q * 4 + 6) [] } + phase_with (n * 2 + 19) (n + 7) { rodd (q * 8 + 11) [0] } + phase_with (n * 2 + 25) (n + 9) { rodd (q * 8 + 14) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +theorem F_cycle (n : ℕ) (hn : 64 ≤ n) (hmod : n % 8 = 1) : + Steps (RootF n) (RootG (n + 10)) := by + set q := n / 8 + have hq : n = q * 8 + 1 := by omega + unfold RootF RootG + phase_with (n * 2 + 10) (n + 2) { rodd (q * 8 + 5) [0] } + phase_with (n * 2 + 13) (n + 4) { reven (q * 8 + 9) []; rodd (q * 4 + 4) [] } + phase_with (n * 2 + 14) (n + 4) { rodd (q * 8 + 7) [0] } + phase_with (n * 2 + 17) (n + 6) { reven (q * 8 + 11) []; rodd (q * 4 + 5) [] } + phase_with (n * 2 + 18) (n + 6) { rodd (q * 8 + 9) [0] } + phase_with (n * 2 + 21) (n + 8) { reven (q * 8 + 13) []; rodd (q * 4 + 6) [] } + phase_with (n * 2 + 21) (n + 8) { rodd (q * 8 + 11) [0] } + phase_with (n * 2 + 27) (n + 10) { rodd (q * 8 + 14) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +theorem D_shrink (j n : ℕ) (hn : 384 * 2 ^ j ≤ n) (hmod : n % 8 = 2) : + Steps (RootD (9 + j) n) (RootD (1 + j) (n + 8)) := by + set q := n / 8 + have hq : n = q * 8 + 2 := by omega + unfold RootD + have hp : 3 * 2 ^ (9 + j - 1) = 768 * 2 ^ j := by + rw [show 9 + j - 1 = j + 8 by omega, Nat.pow_add]; ring + rw [hp, show 1 + j - 1 = j by omega, show 9 + j = j + 9 by omega, show 1 + j = j + 1 by omega] + phase_with (n * 2 + 8 - 384 * 2 ^ j) (n + 1) { reven (q * 8 + 7 - 384 * 2 ^ j) [(j + 8)]; rodd (q * 4 + 3 - 192 * 2 ^ j) [(j + 7)] } + phase_with (n * 2 + 5 - 192 * 2 ^ j) (n + 1) { reven (q * 8 + 6 - 192 * 2 ^ j) [0, (j + 7)]; rmark; rodd (q * 4 + 4 - 96 * 2 ^ j) [(j + 6)] } + phase_with (n * 2 + 7 - 96 * 2 ^ j) (n + 1) { rodd (q * 8 + 4 - 96 * 2 ^ j) [0, 0, (j + 6)] } + phase_with (n * 2 + 10 - 48 * 2 ^ j) (n + 4) { reven (q * 8 + 10 - 48 * 2 ^ j) [(j + 5)]; reven (q * 4 + 5 - 24 * 2 ^ j) [(j + 4)]; rodd (q * 2 + 2 - 12 * 2 ^ j) [(j + 3)] } + phase_with (n * 2 + 11 - 24 * 2 ^ j) (n + 4) { reven (q * 8 + 7 - 24 * 2 ^ j) [1, (j + 3)]; rodd (q * 4 + 3 - 12 * 2 ^ j) [0, (j + 3)] } + phase_with (n * 2 + 12 - 12 * 2 ^ j) (n + 4) { rodd (q * 8 + 7 - 12 * 2 ^ j) [0, 0, (j + 3)] } + phase_with (n * 2 + 20 - 6 * 2 ^ j) (n + 7) { rodd (q * 8 + 12 - 6 * 2 ^ j) [(j + 2)] } + phase_with (n * 2 + 23 - 3 * 2 ^ j) (n + 8) { rodd (q * 8 + 13 - 3 * 2 ^ j) [(j + 1)] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +theorem D_small (h n : ℕ) (hh1 : 1 ≤ h) (hh2 : h ≤ 5) (hn : 64 ≤ n) (hmod : n % 8 = 2) : + Steps (RootD h n) (RootG (n + 9)) := by + set q := n / 8 + have hq : n = q * 8 + 2 := by omega + rcases (by omega : h = 1 ∨ h = 2 ∨ h = 3 ∨ h = 4 ∨ h = 5) with rfl | rfl | rfl | rfl | rfl <;> + dsimp [RootD, RootG] + · -- h = 1 + phase_with (n * 2 + 8) (n + 1) { rodd (q * 8 + 5) [0] } + phase_with (n * 2 + 11) (n + 3) { reven (q * 8 + 9) []; rodd (q * 4 + 4) [] } + phase_with (n * 2 + 12) (n + 3) { rodd (q * 8 + 7) [0] } + phase_with (n * 2 + 15) (n + 5) { reven (q * 8 + 11) []; rodd (q * 4 + 5) [] } + phase_with (n * 2 + 16) (n + 5) { rodd (q * 8 + 9) [0] } + phase_with (n * 2 + 19) (n + 7) { reven (q * 8 + 13) []; rodd (q * 4 + 6) [] } + phase_with (n * 2 + 19) (n + 7) { rodd (q * 8 + 11) [0] } + phase_with (n * 2 + 25) (n + 9) { rodd (q * 8 + 14) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + · -- h = 2 + phase_with (n * 2) (n + 1) { reven (q * 8 + 4) [1]; reven (q * 4 + 2) [0]; rmark; rodd (q * 2 + 2) [] } + phase_with (n * 2 - 5) (n + 1) { reven (q * 8 + 2) [1, 0]; reven (q * 4 + 1) [0, 0]; rmark; rmark; rodd (q * 2 + 3) [] } + phase_with (n * 2 + 2) (n + 1) { rodd (q * 8 - 1) [1, 0, 0] } + phase_with (n * 2 + 7) (n + 2) { rodd (q * 8 + 4) [0, 0, 0] } + phase_with (n * 2 + 19) (n + 6) { rodd (q * 8 + 11) [] } + phase_with (n * 2 + 19) (n + 7) { reven (q * 8 + 13) []; rodd (q * 4 + 6) [] } + phase_with (n * 2 + 19) (n + 7) { rodd (q * 8 + 11) [0] } + phase_with (n * 2 + 25) (n + 9) { rodd (q * 8 + 14) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + · -- h = 3 + phase_with (n * 2 + 2) (n + 1) { reven (q * 8 + 1) [2]; rodd (q * 4) [1] } + phase_with (n * 2 - 9) (n + 1) { reven (q * 8 + 3) [0, 1]; rmark; reven (q * 4 + 3) [0]; rmark; reven (q * 2 + 3) []; rodd (q + 1) [] } + phase_with (n * 2) (n + 1) { rodd (q * 8 - 3) [0, 1, 1] } + phase_with (n * 2 + 1) (n + 3) { reven (q * 8 + 5) [0, 1]; rmark; reven (q * 4 + 4) [0]; rmark; rodd (q * 2 + 3) [] } + phase_with (n * 2 + 7) (n + 3) { rodd (q * 8 + 2) [0, 1, 0] } + phase_with (n * 2 + 14) (n + 5) { rodd (q * 8 + 8) [0, 0] } + phase_with (n * 2 + 22) (n + 8) { rodd (q * 8 + 13) [] } + phase_with (n * 2 + 25) (n + 9) { rodd (q * 8 + 14) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + · -- h = 4 + phase_with (n * 2 - 4) (n + 1) { reven (q * 8 - 5) [3]; rodd (q * 4 - 3) [2] } + phase_with (n * 2 - 1) (n + 1) { reven (q * 8) [0, 2]; rmark; rodd (q * 4 + 1) [1] } + phase_with (n * 2 + 4) (n + 1) { rodd (q * 8 + 1) [0, 0, 1] } + phase_with (n * 2 + 13) (n + 4) { rodd (q * 8 + 8) [0] } + phase_with (n * 2 + 19) (n + 6) { rodd (q * 8 + 11) [] } + phase_with (n * 2 + 19) (n + 7) { reven (q * 8 + 13) []; rodd (q * 4 + 6) [] } + phase_with (n * 2 + 19) (n + 7) { rodd (q * 8 + 11) [0] } + phase_with (n * 2 + 25) (n + 9) { rodd (q * 8 + 14) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + · -- h = 5 + phase_with (n * 2 - 16) (n + 1) { reven (q * 8 - 17) [4]; rodd (q * 4 - 9) [3] } + phase_with (n * 2 - 7) (n + 1) { reven (q * 8 - 6) [0, 3]; rmark; rodd (q * 4 - 2) [2] } + phase_with (n * 2 + 1) (n + 1) { rodd (q * 8 - 2) [0, 0, 2] } + phase_with (n * 2 + 10) (n + 4) { reven (q * 8 + 7) [1]; rodd (q * 4 + 3) [0] } + phase_with (n * 2 + 9) (n + 4) { reven (q * 8 + 7) [0, 0]; rmark; rmark; rodd (q * 4 + 6) [] } + phase_with (n * 2 + 11) (n + 4) { rodd (q * 8 + 6) [0, 0, 0] } + phase_with (n * 2 + 22) (n + 8) { rodd (q * 8 + 13) [] } + phase_with (n * 2 + 25) (n + 9) { rodd (q * 8 + 14) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +theorem D7 (n : ℕ) (hn : 96 ≤ n) (hmod : n % 8 = 2) : + Steps (RootD 7 n) (RootF (n + 7)) := by + set q := n / 8 + have hq : n = q * 8 + 2 := by omega + dsimp [RootD, RootF] + phase_with (n * 2 - 88) (n + 1) { reven (q * 8 - 89) [6]; rodd (q * 4 - 45) [5] } + phase_with (n * 2 - 43) (n + 1) { reven (q * 8 - 42) [0, 5]; rmark; rodd (q * 4 - 20) [4] } + phase_with (n * 2 - 17) (n + 1) { rodd (q * 8 - 20) [0, 0, 4] } + phase_with (n * 2 - 2) (n + 4) { reven (q * 8 - 2) [3]; reven (q * 4 - 1) [2]; rodd (q * 2 - 1) [1] } + phase_with (n * 2 + 5) (n + 4) { reven (q * 8 + 1) [1, 1]; rodd (q * 4) [0, 1] } + phase_with (n * 2 + 9) (n + 4) { rodd (q * 8 + 4) [0, 0, 1] } + phase_with (n * 2 + 13) (n + 7) { reven (q * 8 + 11) [0]; rmark; reven (q * 4 + 7) []; rodd (q * 2 + 3) [] } + phase_with (n * 2 + 17) (n + 7) { rodd (q * 8 + 8) [0, 1] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +theorem D8 (n : ℕ) (hn : 192 ≤ n) (hmod : n % 8 = 2) : + Steps (RootD 8 n) (RootE (n + 8)) := by + set q := n / 8 + have hq : n = q * 8 + 2 := by omega + dsimp [RootD, RootE] + phase_with (n * 2 - 184) (n + 1) { reven (q * 8 - 185) [7]; rodd (q * 4 - 93) [6] } + phase_with (n * 2 - 91) (n + 1) { reven (q * 8 - 90) [0, 6]; rmark; rodd (q * 4 - 44) [5] } + phase_with (n * 2 - 41) (n + 1) { rodd (q * 8 - 44) [0, 0, 5] } + phase_with (n * 2 - 14) (n + 4) { reven (q * 8 - 14) [4]; reven (q * 4 - 7) [3]; rodd (q * 2 - 4) [2] } + phase_with (n * 2 - 1) (n + 4) { reven (q * 8 - 5) [1, 2]; rodd (q * 4 - 3) [0, 2] } + phase_with (n * 2 + 6) (n + 4) { rodd (q * 8 + 1) [0, 0, 2] } + phase_with (n * 2 + 17) (n + 7) { rodd (q * 8 + 9) [1] } + phase_with (n * 2 + 19) (n + 8) { reven (q * 8 + 12) [0]; rmark; rodd (q * 4 + 7) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +theorem D6_even (n : ℕ) (hn : 64 ≤ n) (hmod : n % 16 = 10) : + Steps (RootD 6 n) (RootE (n + 8)) := by + set q := n / 16 + have hq : n = q * 16 + 10 := by omega + dsimp [RootD, RootE] + phase_with (n * 2 - 40) (n + 1) { reven (q * 16 - 33) [5]; rodd (q * 8 - 17) [4] } + phase_with (n * 2 - 19) (n + 1) { reven (q * 16 - 10) [0, 4]; rmark; rodd (q * 8 - 4) [3] } + phase_with (n * 2 - 5) (n + 1) { rodd (q * 16) [0, 0, 3] } + phase_with (n * 2 - 18) (n + 4) { reven (q * 16 + 12) [2]; reven (q * 8 + 6) [1]; reven (q * 4 + 3) [0]; rmark; reven (q * 2 + 3) []; rodd (q + 1) [] } + phase_with (n * 2 - 3) (n + 4) { reven (q * 16 + 1) [2, 1]; rodd (q * 8) [1, 1] } + phase_with (n * 2 + 5) (n + 4) { rodd (q * 16 + 8) [0, 1, 1] } + phase_with (n * 2 + 14) (n + 6) { rodd (q * 16 + 15) [0, 1] } + phase_with (n * 2 + 19) (n + 8) { reven (q * 16 + 20) [0]; rmark; rodd (q * 8 + 11) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +theorem Reset_power (i u : ℕ) : + Reset ((u * 2 + 1) * 2 ^ i) [] (2 ^ i) (u * 2 ^ i) [i] := by + have h := Reset_scale i (Reset.ROdd u []) + exact h.congr rfl rfl (by omega) rfl (by simp [shift]) + +theorem Reset_cross (a u : ℕ) : + Reset ((u * 2 + 3) * 32 * 2 ^ a - 24) [3] (16 + 32 * 2 ^ a) ((u + 1) * 32 * 2 ^ a) [3, a + 2] := by + have hp : 2 ^ (a + 2) = 4 * 2 ^ a := by rw [Nat.pow_add]; ring + have h1 : 1 ≤ 2 ^ a := Nat.one_le_pow a 2 (by decide) + have hc0 : ((u + 1) * 2 + 1) * 2 ^ (a + 2) = 8 * (u * 2 ^ a) + 12 * 2 ^ a := by rw [hp]; ring + have hc1 : (u * 2 + 3) * 2 ^ (a + 2) = 8 * (u * 2 ^ a) + 12 * 2 ^ a := by rw [hp]; ring + have h0 : Reset (((u * 2 + 3) * 2 ^ (a + 2) - 3) + 3) [] (2 ^ (a + 2)) ((u + 1) * 2 ^ (a + 2)) [a + 2] := by + refine (Reset_power (a + 2) (u + 1)).congr ?_ rfl rfl rfl rfl + omega + have hmark := Reset.RMark ((u * 2 + 3) * 2 ^ (a + 2) - 3) [] (2 ^ (a + 2)) ((u + 1) * 2 ^ (a + 2)) [a + 2] h0 + have hscale := Reset_scale 3 hmark + refine hscale.congr ?_ rfl ?_ ?_ rfl + · change (((u * 2 + 3) * 2 ^ (a + 2) - 3) * 8) = (u * 2 + 3) * 32 * 2 ^ a - 24 + have hc2 : (u * 2 + 3) * 32 * 2 ^ a = 64 * (u * 2 ^ a) + 96 * 2 ^ a := by ring + omega + · change (2 + 2 ^ (a + 2)) * 8 = 16 + 32 * 2 ^ a + rw [hp]; omega + · change ((u + 1) * 2 ^ (a + 2)) * 8 = (u + 1) * 32 * 2 ^ a + rw [hp]; ring + +theorem D6_odd_ge3 (a u n : ℕ) (hn : 64 ≤ n) (hval : n + 14 = (u * 2 + 3) * 16 * 2 ^ a) : + Steps (RootD 6 n) (RootD (1 + a) (n + 8)) := by + have h1 : 1 ≤ 2 ^ a := Nat.one_le_pow a 2 (by decide) + have hval_lin : n + 14 = 32 * (u * 2 ^ a) + 48 * 2 ^ a := by rw [hval]; ring + have hc1 : (u * 2 + 3) * 32 * 2 ^ a = 64 * (u * 2 ^ a) + 96 * 2 ^ a := by ring + have hc2 : (u + 1) * 32 * 2 ^ a = 32 * (u * 2 ^ a) + 32 * 2 ^ a := by ring + have hlow : 48 * 2 ^ a ≤ n + 14 := by omega + have hmod : n % 8 = 2 := by omega + set q := n / 8 + have hq : n = q * 8 + 2 := by omega + dsimp [RootD] + rw [show 1 + a - 1 = a by omega, show 1 + a = a + 1 by omega] + phase_with (n * 2 - 40) (n + 1) { reven (q * 8 - 41) [5]; rodd (q * 4 - 21) [4] } + phase_with (n * 2 - 19) (n + 1) { reven (q * 8 - 18) [0, 4]; rmark; rodd (q * 4 - 8) [3] } + phase_with (n * 2 - 5) (n + 1) { rodd (q * 8 - 8) [0, 0, 3] } + apply step_drop; apply step_drop; apply step_drop + have hcross : Reset (n * 2 - 5 + 3 + 3 + 3) [3] (16 + 32 * 2 ^ a) ((u + 1) * 32 * 2 ^ a) [3, a + 2] := + (Reset_cross a u).congr (by omega) rfl rfl rfl rfl + refine step_reset_as (n * 2 + 6 - 48 * 2 ^ a) (n + 4) hcross (by dsimp [offset]; omega) (by dsimp [offset]; omega) (by omega) ?_ + dsimp only [nxt] + phase_with (n * 2 + 9 - 24 * 2 ^ a) (n + 4) { reven (q * 8 + 5 - 24 * 2 ^ a) [2, (a + 2)]; rodd (q * 4 + 2 - 12 * 2 ^ a) [1, (a + 2)] } + phase_with (n * 2 + 11 - 12 * 2 ^ a) (n + 4) { rodd (q * 8 + 6 - 12 * 2 ^ a) [0, 1, (a + 2)] } + phase_with (n * 2 + 17 - 6 * 2 ^ a) (n + 6) { rodd (q * 8 + 10 - 6 * 2 ^ a) [0, (a + 2)] } + phase_with (n * 2 + 23 - 3 * 2 ^ a) (n + 8) { rodd (q * 8 + 13 - 3 * 2 ^ a) [(a + 1)] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +theorem LH_one {n : ℕ} {l l' : zB} (h : LH n l l') : + LH (n * 2) (z1 +> l) (z1 +> l') := by + have hb : SegRLs (flipTM tm) (Hs ^ 0) [] z1 z1 := .nil z1 + have ha : SegRLs (flipTM tm) (Hs ^ 2) Hs z1 z1 := + BoundedConfig.segRLs_c_spec (flipTM tm) (T := 100) (by decide) + have hseg := segRLs_addmul'' (x := n) (a := 2) (b := 0) hb ha + simpa only [Nat.add_zero] using hseg.sideRLs_concat h + +theorem LH_zeros (j : ℕ) {n : ℕ} {l l' : zB} (h : LH n l l') : + LH (n * 2 ^ j) (z0 ^ j +> l) (z0 ^ j +> l') := by + induction j with + | zero => + exact h.congr (by omega) rfl rfl + | succ j ih => + rw [pow_succ_list, append_assoc] + have hz := LH_zero ih + have hp : 2 ^ (j + 1) = 2 ^ j * 2 := by rw [Nat.pow_succ] + exact hz.congr (by rw [hp]; ring) rfl rfl + +theorem G_start (j u n : ℕ) (hj : 2 ≤ j) (hval : n + 5 = (u * 2 + 3) * 2 ^ (1 + j)) : + Steps (RootG n) (.st (n * 2 + 9 - 3 * 2 ^ j) [0, 1 + j] (n + 1) .t7) := by + have hp1 : 2 ^ (1 + j) = 2 * 2 ^ j := by rw [Nat.add_comm 1 j, Nat.pow_succ]; ring + have hp2 : 2 ^ (2 + j) = 4 * 2 ^ j := by rw [Nat.add_comm 2 j, Nat.pow_add]; ring + have h1 : 1 ≤ 2 ^ j := Nat.one_le_pow j 2 (by decide) + have hval_lin : n + 5 = 4 * (u * 2 ^ j) + 6 * 2 ^ j := by rw [hval, hp1]; ring + have hc1 : ((u + 1) * 2 + 1) * 2 ^ (2 + j) = 8 * (u * 2 ^ j) + 12 * 2 ^ j := by rw [hp2]; ring + have hc2 : (u + 1) * 2 ^ (2 + j) = 4 * (u * 2 ^ j) + 4 * 2 ^ j := by rw [hp2]; ring + have hlow : 6 * 2 ^ j ≤ n + 5 := by omega + unfold RootG + apply step_drop + have hpow : Reset (n * 2 + 7 + 3) [] (2 ^ (2 + j)) ((u + 1) * 2 ^ (2 + j)) [2 + j] := by + refine (Reset_power (2 + j) (u + 1)).congr ?_ rfl rfl rfl rfl + omega + refine step_reset_as (n * 2 + 11 - 6 * 2 ^ j) (n + 1) hpow + (by dsimp [offset]; omega) + (by dsimp [offset]; omega) + rfl ?_ + dsimp only [nxt] + rw [show 2 + j = j + 2 by omega, show 1 + j = j + 1 by omega] + phase_with (n * 2 + 9 - 3 * 2 ^ j) (n + 1) { rodd (n + 5 - 3 * 2 ^ j) [(j + 1)] } + exact (Steps.Done _) + +theorem LH_set (l : zB) : LH 1 (z0 +> l) (z1 +> l) := by + have hseg : SegRLs (flipTM tm) (Hs ^ 1) [] z0 z1 := + BoundedConfig.segRLs_c_spec (flipTM tm) (T := 100) (by decide) + exact hseg.sideRLs_concat (.nil l) + +theorem LH_last (l : zB) : LH 1 (z1 +> ([0] +> (z1 +> l))) (z0 +> (v +> l)) := by + have hseg : SegRLs (flipTM tm) (Hs ^ 1) [] (z1 ++ [0] ++ z1) (z0 ++ v) := + BoundedConfig.segRLs_c_spec (flipTM tm) (T := 100) (by decide) + simpa only [append_assoc, append_cons, append_nil] using hseg.sideRLs_concat (.nil l) + +theorem LH_fill (j : ℕ) {n : ℕ} {l l' : zB} (h : LH n l l') : + LH ((n + 1) * 2 ^ j - 1) (z0 ^ j +> l) (z1 ^ j +> l') := by + induction j with + | zero => + exact h.congr (by omega) rfl rfl + | succ j ih => + have hb : SegRLs (flipTM tm) (Hs ^ 1) [] z0 z1 := + BoundedConfig.segRLs_c_spec (flipTM tm) (T := 100) (by decide) + have ha : SegRLs (flipTM tm) (Hs ^ 2) Hs z1 z1 := + BoundedConfig.segRLs_c_spec (flipTM tm) (T := 100) (by decide) + have hseg := segRLs_addmul'' (x := (n + 1) * 2 ^ j - 1) (a := 2) (b := 1) hb ha + have hp : 2 ^ (j + 1) = 2 ^ j * 2 := by rw [Nat.pow_succ] + have h1 : 1 ≤ 2 ^ j := Nat.one_le_pow j 2 (by decide) + have h_eq : ((n + 1) * 2 ^ j - 1) * 2 + 1 = (n + 1) * 2 ^ (j + 1) - 1 := by + rw [hp, ← Nat.mul_assoc] + have : 0 < (n + 1) * 2 ^ j := Nat.mul_pos (by omega) h1 + omega + rw [pow_succ_list, pow_succ_list, append_assoc, append_assoc] + exact LH.congr (hseg.sideRLs_concat ih) h_eq rfl rfl + +theorem LH_clear (j : ℕ) {l l' : zB} (h : LH 1 l l') : + LH 1 (z1 ^ j +> l) (z0 ^ j +> l') := by + induction j with + | zero => exact h + | succ j ih => + have hseg : SegRLs (flipTM tm) (Hs ^ 1) (Hs ^ 1) z1 z0 := + BoundedConfig.segRLs_c_spec (flipTM tm) (T := 100) (by decide) + rw [pow_succ_list, pow_succ_list, append_assoc, append_assoc] + exact hseg.sideRLs_concat ih + +theorem LH_partial_D (j : ℕ) : + LH (2 ^ (5 + j) - 22) + (z0 +> (z0 +> (z0 +> (v +> (z0 +> (z0 +> (z0 ^ j +> (z0 +> ([0] +> (z1 +> default)))))))))) + (z0 +> (z1 +> (z0 +> (v +> (z1 +> (z0 +> (z1 ^ j +> (z0 +> ([0] +> (z1 +> default)))))))))) := by + have hp : 2 ^ (5 + j) = 32 * 2 ^ j := by rw [Nat.add_comm 5 j, Nat.pow_add]; ring + have h1 : 1 ≤ 2 ^ j := Nat.one_le_pow j 2 (by decide) + have hb1 : SegRLs (flipTM tm) (Hs ^ 2) [] (z0 ++ z0 ++ z0 ++ v) (z0 ++ z1 ++ z0 ++ v) := + BoundedConfig.segRLs_c_spec (flipTM tm) (T := 2000) (by decide) + have ha1 : SegRLs (flipTM tm) (Hs ^ 8) Hs (z0 ++ z1 ++ z0 ++ v) (z0 ++ z1 ++ z0 ++ v) := + BoundedConfig.segRLs_c_spec (flipTM tm) (T := 2000) (by decide) + have hseg1 := segRLs_addmul'' (x := (2 ^ j - 1) * 4 + 1) (a := 8) (b := 2) hb1 ha1 + have hb2 : SegRLs (flipTM tm) (Hs ^ 1) [] (z0 ++ z0) (z1 ++ z0) := + BoundedConfig.segRLs_c_spec (flipTM tm) (T := 1000) (by decide) + have ha2 : SegRLs (flipTM tm) (Hs ^ 4) Hs (z1 ++ z0) (z1 ++ z0) := + BoundedConfig.segRLs_c_spec (flipTM tm) (T := 1000) (by decide) + have hseg2 := segRLs_addmul'' (x := 2 ^ j - 1) (a := 4) (b := 1) hb2 ha2 + have hfill : LH (2 ^ j - 1) + (z0 ^ j +> (z0 +> ([0] +> (z1 +> default)))) + (z1 ^ j +> (z0 +> ([0] +> (z1 +> default)))) := + (LH_fill j (n := 0) (.nil _)).congr (by omega) rfl rfl + have hmid := hseg2.sideRLs_concat hfill + have htot := hseg1.sideRLs_concat hmid + refine LH.congr htot ?_ ?_ ?_ + · rw [hp]; omega + · simp only [append_assoc] + · simp only [append_assoc] + +theorem LH_partial (j : ℕ) (r : zB) : + LH (1 + 2 ^ j * 2) (z0 +> (z0 ^ j +> (z0 +> ([0] +> (z1 +> r))))) + (z1 +> (z0 ^ j +> (z1 +> ([0] +> (z1 +> r))))) := by + refine LH_add (LH_set _) ?_ + refine LH_one ?_ + exact (LH_zeros j (LH_set ([0] +> (z1 +> r)))).congr (by omega) rfl rfl + +theorem LC_zero_words (j : ℕ) {ls : List ℕ} {l : zB} (h : LC 0 ls l) : + LC 0 (shift j ls) (z0 ^ j +> l) := by + induction j with + | zero => + refine h.congr rfl ?_ rfl + cases ls <;> simp [shift] + | succ j ih => + rw [pow_succ_list, append_assoc] + refine (LC_even_intro 0 (shift j ls) (z0 ^ j +> l) ih).congr rfl ?_ rfl + cases ls <;> simp [shift, up]; omega + +theorem LH_partial_finish (j : ℕ) : + ∃ l', LC (2 ^ j - 1) [0, 1 + j] l' ∧ + LH (2 ^ j * 2) ([0] +> (z1 +> (z0 ^ j +> (z1 +> ([0] +> (z1 +> default)))))) l' := by + have h1 : 1 ≤ 2 ^ j := Nat.one_le_pow j 2 (by decide) + have hnum : LC 0 [0, 1 + j] (v +> (z0 ^ j +> (z0 +> (v +> default)))) := by + apply LC.LC_w + have hzw := LC_zero_words (j + 1) (LC.LC_w 0 [] default .LC_0) + rw [pow_succ_list', append_assoc] at hzw + exact hzw.congr rfl (by simp [shift]; omega) rfl + rcases LH_inc (2 ^ j - 1) 0 [0, 1 + j] _ hnum with ⟨l', hl', hrun⟩ + refine ⟨l', hl'.congr (by omega) rfl rfl, ?_⟩ + have hstep1 := LH_absorb (z0 ^ j +> (z1 +> ([0] +> (z1 +> default)))) + have hstep2 : LH (2 ^ j) (v +> (z0 ^ j +> (z1 +> ([0] +> (z1 +> default))))) + (v +> (z0 ^ j +> (z0 +> (v +> default)))) := + LH_word ((LH_zeros j (LH_last default)).congr (by omega) rfl rfl) + exact (LH_add hstep1 (LH_add hstep2 hrun)).congr (by omega) rfl rfl + +theorem LC_unzeros (j : ℕ) {n : ℕ} {ls : List ℕ} {l : zB} (h : LC (n * 2 ^ j) (shift j ls) l) : + ∃ l', LC n ls l' ∧ l = z0 ^ j +> l' := by + induction j generalizing l with + | zero => + refine ⟨l, h.congr (by omega) ?_ rfl, rfl⟩ + cases ls <;> simp [shift] + | succ j ih => + have hp : 2 ^ (j + 1) = 2 ^ j * 2 := by rw [Nat.pow_succ] + have he : LC ((n * 2 ^ j) * 2) (up (shift j ls)) l := by + refine h.congr (by rw [hp]; ring) ?_ rfl + cases ls <;> simp [shift, up]; omega + rcases LC_even (n * 2 ^ j) (shift j ls) l he with ⟨l0, hl0, rfl⟩ + rcases ih hl0 with ⟨l', hl', rfl⟩ + refine ⟨l', hl', ?_⟩ + rw [pow_succ_list, append_assoc] + +theorem LC_pow (j : ℕ) {l : zB} (h : LC (2 ^ j) [] l) : + l = z0 ^ j +> (z1 +> default) := by + have he : LC (1 * 2 ^ j) (shift j []) l := h.congr (by omega) rfl rfl + rcases LC_unzeros j he with ⟨l0, hl0, rfl⟩ + rcases LC_odd 0 [] l0 (hl0.congr rfl rfl rfl) with ⟨l', hl', rfl⟩ + generalize hm : (0 : ℕ) = m at hl' + generalize hls : ([] : List ℕ) = ls0 at hl' + cases hl' with + | LC_0 => rfl + | LC_w => cases hls + | LC_0' => cases hls + | LC_1' => cases hls + | _ => omega + +theorem zero_move (j : ℕ) (l : zB) : + ([0] : zF) +> (z0 ^ j +> l) = z0 ^ j +> ([0] +> l) := by + induction j with + | zero => rfl + | succ j ih => + rw [pow_succ_list, append_assoc, append_assoc, ← ih] + rfl + +theorem LC_mark {k : ℕ} {ls : List ℕ} {l : zB} (h : LC k (0 :: ls) l) : + ∃ l', LC k ls l' ∧ l = v +> l' := by + generalize hls : (0 :: ls : List ℕ) = ls0 at h + cases h with + | LC_w _ ls1 l0 hl0 => + injection hls with _ heq + subst heq + exact ⟨l0, hl0, rfl⟩ + | _ => cases hls + +theorem LH_partial_D_start (j k : ℕ) (l : zB) (hk : k + 24 = 2 ^ (6 + j)) (hl : LC k [3] l) : + LH (2 ^ (5 + j) - 6) ([0] +> l) + (z0 +> (z1 +> (z0 +> (v +> (z1 +> (z0 +> (z1 ^ j +> (z0 +> ([0] +> (z1 +> default)))))))))) := by + have hp6 : 2 ^ (6 + j) = 64 * 2 ^ j := by rw [Nat.add_comm 6 j, Nat.pow_add]; ring + have hp5 : 2 ^ (5 + j) = 32 * 2 ^ j := by rw [Nat.add_comm 5 j, Nat.pow_add]; ring + have hp3 : 2 ^ (3 + j) = 8 * 2 ^ j := by rw [Nat.add_comm 3 j, Nat.pow_add]; ring + have h1 : 1 ≤ 2 ^ j := Nat.one_le_pow j 2 (by decide) + have he : LC ((2 ^ (3 + j) - 3) * 2 ^ 3) (shift 3 [0]) l := by + refine hl.congr ?_ rfl rfl + change k = (2 ^ (3 + j) - 3) * 8 + omega + rcases LC_unzeros 3 he with ⟨l0, hl0, rfl⟩ + rcases LC_mark hl0 with ⟨l1, hl1, rfl⟩ + rcases LH_inc 3 (2 ^ (3 + j) - 3) [] l1 hl1 with ⟨l2, hl2, hinc⟩ + have hpow : LC (2 ^ (3 + j)) [] l2 := hl2.congr (by omega) rfl rfl + have hl2_eq := LC_pow (3 + j) hpow + subst hl2_eq + rw [zero_move 3] + have hstep1 : LH 16 (z0 ^ 3 +> ([0] +> (v +> l1))) + (z0 ^ 3 +> (v +> ([0] +> (z0 ^ (3 + j) +> (z1 +> default))))) := + (LH_zeros 3 (LH_cross hinc)).congr rfl rfl rfl + rw [zero_move (3 + j)] at hstep1 + have hsplit : z0 ^ 3 +> (v +> (z0 ^ (3 + j) +> ([0] +> (z1 +> default)))) = + z0 +> (z0 +> (z0 +> (v +> (z0 +> (z0 +> (z0 ^ j +> (z0 +> ([0] +> (z1 +> default))))))))) := by + have h3j : 3 + j = 2 + (j + 1) := by omega + rw [h3j, pow_add_list, pow_succ_list' z0 j] + simp only [pow_succ_list, pow_zero_list, append_assoc, append_nil, List.nil_append] + rw [hsplit] at hstep1 + exact (LH_add hstep1 (LH_partial_D j)).congr (by omega) rfl rfl + +theorem LH_partial_D_recover (j : ℕ) : + LH (2 ^ (4 + j) + 12) + (z0 +> (v +> (z0 +> (v +> (z1 +> (z0 +> (z1 ^ j +> (z0 +> ([0] +> (z1 +> default)))))))))) + (z0 +> (v +> (z0 +> (v +> (z0 +> (z0 +> (z0 ^ j +> (z0 +> (v +> default))))))))) := by + have hp4 : 2 ^ (4 + j) = 16 * 2 ^ j := by rw [Nat.add_comm 4 j, Nat.pow_add]; ring + have h1 : 1 ≤ 2 ^ j := Nat.one_le_pow j 2 (by decide) + have hb : SegRLs (flipTM tm) (Hs ^ 3) (Hs ^ 1) (z1 ++ z0) (z0 ++ z0) := + BoundedConfig.segRLs_c_spec (flipTM tm) (T := 1000) (by decide) + have ha : SegRLs (flipTM tm) (Hs ^ 4) Hs (z0 ++ z0) (z0 ++ z0) := + BoundedConfig.segRLs_c_spec (flipTM tm) (T := 1000) (by decide) + have hseg := SegRLs.addmul (x := 2 ^ j) (a := 4) (b := 3) (c := 1) hb ha + have htail : LH (2 ^ j + 1) + (z1 ^ j +> (z0 +> ([0] +> (z1 +> default)))) + (z0 ^ j +> (z0 +> (v +> default))) := by + have hc1 : LH 1 (z1 ^ j +> (z0 +> ([0] +> (z1 +> default)))) + (z0 ^ j +> (z1 +> ([0] +> (z1 +> default)))) := + LH_clear j (LH_set _) + have hc2 : LH (2 ^ j) (z0 ^ j +> (z1 +> ([0] +> (z1 +> default)))) + (z0 ^ j +> (z0 +> (v +> default))) := + (LH_zeros j (LH_last default)).congr (by omega) rfl rfl + exact (LH_add hc1 hc2).congr (by omega) rfl rfl + have hmid : LH (2 ^ j * 4 + 3) + (z1 +> (z0 +> (z1 ^ j +> (z0 +> ([0] +> (z1 +> default)))))) + (z0 +> (z0 +> (z0 ^ j +> (z0 +> (v +> default))))) := by + simpa only [append_assoc] using hseg.sideRLs_concat htail + have houter := LH_zero (LH_word (LH_zero (LH_word hmid))) + exact houter.congr (by rw [hp4]; omega) rfl rfl + +theorem LH_partial_D_finish (j : ℕ) (hj : 2 ≤ j) : + ∃ l', LC (2 ^ (4 + j) - 19) [1, 1, 3 + j] l' ∧ + LH (2 ^ (5 + j) - 5) + ([0] +> (z0 +> (z1 +> (z0 +> (v +> (z1 +> (z0 +> (z1 ^ j +> (z0 +> ([0] +> (z1 +> default))))))))))) l' := by + have hp4 : 2 ^ (4 + j) = 16 * 2 ^ j := by rw [Nat.add_comm 4 j, Nat.pow_add]; ring + have hp5 : 2 ^ (5 + j) = 32 * 2 ^ j := by rw [Nat.add_comm 5 j, Nat.pow_add]; ring + have h4 : 4 ≤ 2 ^ j := by + have := Nat.pow_le_pow_right (by decide : 0 < 2) hj + simpa using this + have hnum : LC 0 [1, 1, 3 + j] + (z0 +> (v +> (z0 +> (v +> (z0 +> (z0 +> (z0 ^ j +> (z0 +> (v +> default))))))))) := by + rw [show 3 + j = j + 3 by omega] + apply LC.LC_0' 0 0 [1, j + 3] + apply LC.LC_w 0 [1, j + 3] + apply LC.LC_0' 0 0 [j + 3] + apply LC.LC_w 0 [j + 3] + apply LC.LC_0' 0 (j + 2) [] + apply LC.LC_0' 0 (j + 1) [] + have hzw := LC_zero_words (j + 1) (LC.LC_w 0 [] default .LC_0) + rw [pow_succ_list', append_assoc] at hzw + exact hzw.congr rfl (by simp [shift]) rfl + rcases LH_inc (2 ^ (4 + j) - 19) 0 [1, 1, 3 + j] _ hnum with ⟨l', hl', hrun⟩ + refine ⟨l', hl'.congr (by omega) rfl rfl, ?_⟩ + have h0_comm : ([0] : zF) +> (z0 +> (z1 +> (z0 +> (v +> (z1 +> (z0 +> (z1 ^ j +> (z0 +> ([0] +> (z1 +> default)))))))))) = + z0 +> ([0] +> (z1 +> (z0 +> (v +> (z1 +> (z0 +> (z1 ^ j +> (z0 +> ([0] +> (z1 +> default)))))))))) := rfl + rw [h0_comm] + have hstep1 : LH 2 + (z0 +> ([0] +> (z1 +> (z0 +> (v +> (z1 +> (z0 +> (z1 ^ j +> (z0 +> ([0] +> (z1 +> default))))))))))) + (z0 +> (v +> (z0 +> (v +> (z1 +> (z0 +> (z1 ^ j +> (z0 +> ([0] +> (z1 +> default)))))))))) := + LH_zero (LH_absorb _) + exact (LH_add hstep1 (LH_add (LH_partial_D_recover j) hrun)).congr (by omega) rfl rfl + +theorem G_partial (j n : ℕ) (hn : n + 5 = 2 ^ (1 + j)) (l r : zB) (hd : Denote (RootG n) l r) : + ∃ l' r', Denote (.st (2 ^ j - 1) [0, 1 + j] (n + 1) .t7) l' r' ∧ + (l {{E}}> r) [tm]⊢⁺ (l' {{E}}> r') := by + have hp1 : 2 ^ (1 + j) = 2 * 2 ^ j := by rw [Nat.add_comm 1 j, Nat.pow_succ]; ring + have hp2 : 2 ^ (2 + j) = 4 * 2 ^ j := by rw [Nat.add_comm 2 j, Nat.pow_add]; ring + rcases hd with ⟨hl, hr⟩ + rcases BigStep0 hl hr with ⟨l0, r0, hl0, hr0, hdrop⟩ + have he : LC (2 ^ (2 + j)) [] l0 := hl0.congr (by omega) rfl rfl + have hl0_eq := LC_pow (2 + j) he + subst hl0_eq + set midleft : zB := z1 +> (z0 ^ j +> (z1 +> ([0] +> (z1 +> default)))) + have hfirst : LH ((n + 1) + 4 + offset .t5) ([0] +> (z0 ^ (2 + j) +> (z1 +> default))) midleft := by + rw [zero_move (2 + j)] + have hsplit : z0 ^ (2 + j) +> ([0] +> (z1 +> default)) = + z0 +> (z0 ^ j +> (z0 +> ([0] +> (z1 +> default)))) := by + have h2j : 2 + j = (j + 1) + 1 := by omega + rw [h2j, pow_add_list, pow_succ_list z0 j] + simp only [pow_one_list, append_assoc] + rw [hsplit] + exact (LH_partial j default).congr (by dsimp [offset]; omega) rfl rfl + rcases Phase hr0 hfirst with ⟨r1, hr1, hphase1⟩ + rcases LH_partial_finish j with ⟨l', hl', hfinish⟩ + have hlast : LH ((n + 1) + 4 + offset .t6) ([0] +> midleft) l' := + hfinish.congr (by dsimp [offset]; omega) rfl rfl + rcases Phase hr1 hlast with ⟨r', hr', hphase2⟩ + exact ⟨l', r', ⟨hl', hr'⟩, stepPlus_trans hdrop (stepPlus_trans hphase1 hphase2)⟩ + +theorem D6_partial (j n : ℕ) (hj : 2 ≤ j) (hn : n + 14 = 2 ^ (5 + j)) (l r : zB) (hd : Denote (RootD 6 n) l r) : + ∃ l' r', Denote (RootD (2 + j) (n + 8)) l' r' ∧ + (l {{E}}> r) [tm]⊢⁺ (l' {{E}}> r') := by + have hp5 : 2 ^ (5 + j) = 32 * 2 ^ j := by rw [Nat.add_comm 5 j, Nat.pow_add]; ring + have hp4 : 2 ^ (4 + j) = 16 * 2 ^ j := by rw [Nat.add_comm 4 j, Nat.pow_add]; ring + have hp6 : 2 ^ (6 + j) = 64 * 2 ^ j := by rw [Nat.add_comm 6 j, Nat.pow_add]; ring + have h4 : 4 ≤ 2 ^ j := by + have := Nat.pow_le_pow_right (by decide : 0 < 2) hj + simpa using this + have hmod : n % 8 = 2 := by omega + set q := n / 8 + have hq : n = q * 8 + 2 := by omega + have hfirst : Steps (RootD 6 n) (.st (n * 2 + 4) [3] (n + 4) .t0) := by + dsimp [RootD] + phase_with (n * 2 - 40) (n + 1) { reven (q * 8 - 41) [5]; rodd (q * 4 - 21) [4] } + phase_with (n * 2 - 19) (n + 1) { reven (q * 8 - 18) [0, 4]; rmark; rodd (q * 4 - 8) [3] } + phase_with (n * 2 - 5) (n + 1) { rodd (q * 8 - 8) [0, 0, 3] } + apply step_drop; apply step_drop; apply step_drop + exact (Steps.Done _).congr (by congr 1; omega) rfl + rcases Steps_spec hfirst l r hd with ⟨l0, r0, ⟨hl0, hr0⟩, hrun0⟩ + have hstart : (n * 2 + 4) + 24 = 2 ^ (6 + j) := by omega + have hleft : LH ((n + 4) + 4 + offset .t0) ([0] +> l0) _ := + (LH_partial_D_start j (n * 2 + 4) l0 hstart hl0).congr (by dsimp [offset]; omega) rfl rfl + rcases Phase hr0 hleft with ⟨r1, hr1, hrun1⟩ + rcases LH_partial_D_finish j hj with ⟨l1, hl1, hleft1_raw⟩ + have hleft1 : LH ((n + 4) + 4 + offset .t1) _ l1 := + hleft1_raw.congr (by dsimp [offset]; omega) rfl rfl + rcases Phase hr1 hleft1 with ⟨r2, hr2, hrun2⟩ + have htail : Steps (.st (2 ^ (4 + j) - 19) [1, 1, 3 + j] (n + 4) .t2) (RootD (2 + j) (n + 8)) := by + rw [show 2 ^ (4 + j) - 19 = n * 2 + 9 - 48 * 2 ^ j by omega] + rw [show 3 + j = j + 3 by omega] + phase_with (n * 2 + 11 - 24 * 2 ^ j) (n + 4) { rodd (q * 8 + 6 - 24 * 2 ^ j) [0, 1, (j + 3)] } + phase_with (n * 2 + 17 - 12 * 2 ^ j) (n + 6) { rodd (q * 8 + 10 - 12 * 2 ^ j) [0, (j + 3)] } + phase_with (n * 2 + 23 - 6 * 2 ^ j) (n + 8) { rodd (q * 8 + 13 - 6 * 2 ^ j) [(j + 2)] } + unfold RootD + have hp1 : 2 ^ (2 + j - 1) = 2 * 2 ^ j := by + rw [show 2 + j - 1 = j + 1 by omega, Nat.pow_succ]; ring + rw [hp1, show 2 + j = j + 2 by omega] + exact (Steps.Done _).congr (by congr 1; omega) rfl + rcases Steps_spec htail l1 r2 ⟨hl1, hr2⟩ with ⟨l', r', hd', hrun3⟩ + exact ⟨l', r', hd', stepStar_stepPlus_trans hrun0 (stepPlus_trans hrun1 (stepPlus_stepStar_trans hrun2 hrun3))⟩ + +theorem G_large_tail (a n : ℕ) (hlow : 2 ^ 15 * 2 ^ a ≤ n + 5) (hmod : n % 8 = 3) : + Steps (.st (n * 2 + 9 - 3 * 2 ^ 14 * 2 ^ a) [0, 15 + a] (n + 1) .t7) + (RootD (1 + a) (n + 15)) := by + have h1 : 1 ≤ 2 ^ a := Nat.one_le_pow a 2 (by decide) + set q := n / 8 + have hq : n = q * 8 + 3 := by omega + unfold RootD + rw [show 1 + a - 1 = a by omega, show 15 + a = a + 15 by omega, show 1 + a = a + 1 by omega] + have hlow' : 32768 * 2 ^ a ≤ n + 5 := hlow + change Steps (.st (n * 2 + 9 - 49152 * 2 ^ a) [0, a + 15] (n + 1) .t7) _ + phase_with (n * 2 + 10 - 24576 * 2 ^ a) (n + 2) { reven (q * 8 + 9 - 24576 * 2 ^ a) [(a + 14)]; rodd (q * 4 + 4 - 12288 * 2 ^ a) [(a + 13)] } + phase_with (n * 2 + 7 - 12288 * 2 ^ a) (n + 2) { reven (q * 8 + 8 - 12288 * 2 ^ a) [0, (a + 13)]; rmark; rodd (q * 4 + 5 - 6144 * 2 ^ a) [(a + 12)] } + phase_with (n * 2 + 9 - 6144 * 2 ^ a) (n + 2) { rodd (q * 8 + 6 - 6144 * 2 ^ a) [0, 0, (a + 12)] } + phase_with (n * 2 + 6 - 3072 * 2 ^ a) (n + 5) { reven (q * 8 + 12 - 3072 * 2 ^ a) [(a + 11)]; reven (q * 4 + 6 - 1536 * 2 ^ a) [(a + 10)]; reven (q * 2 + 3 - 768 * 2 ^ a) [(a + 9)]; rodd (q + 1 - 384 * 2 ^ a) [(a + 8)] } + phase_with (n * 2 + 6 - 1536 * 2 ^ a) (n + 5) { reven (q * 8 + 6 - 1536 * 2 ^ a) [2, (a + 8)]; reven (q * 4 + 3 - 768 * 2 ^ a) [1, (a + 8)]; rodd (q * 2 + 1 - 384 * 2 ^ a) [0, (a + 8)] } + phase_with (n * 2 + 3 - 768 * 2 ^ a) (n + 5) { reven (q * 8 + 6 - 768 * 2 ^ a) [1, 0, (a + 8)]; reven (q * 4 + 3 - 384 * 2 ^ a) [0, 0, (a + 8)]; rmark; rmark; rodd (q * 2 + 4 - 192 * 2 ^ a) [(a + 7)] } + phase_with (n * 2 + 10 - 384 * 2 ^ a) (n + 5) { rodd (q * 8 + 4 - 384 * 2 ^ a) [1, 0, 0, (a + 7)] } + phase_with (n * 2 + 15 - 192 * 2 ^ a) (n + 6) { rodd (q * 8 + 9 - 192 * 2 ^ a) [0, 0, 0, (a + 7)] } + phase_with (n * 2 + 27 - 96 * 2 ^ a) (n + 10) { rodd (q * 8 + 16 - 96 * 2 ^ a) [(a + 6)] } + phase_with (n * 2 + 24 - 48 * 2 ^ a) (n + 11) { reven (q * 8 + 18 - 48 * 2 ^ a) [(a + 5)]; reven (q * 4 + 9 - 24 * 2 ^ a) [(a + 4)]; rodd (q * 2 + 4 - 12 * 2 ^ a) [(a + 3)] } + phase_with (n * 2 + 25 - 24 * 2 ^ a) (n + 11) { reven (q * 8 + 15 - 24 * 2 ^ a) [1, (a + 3)]; rodd (q * 4 + 7 - 12 * 2 ^ a) [0, (a + 3)] } + phase_with (n * 2 + 26 - 12 * 2 ^ a) (n + 11) { rodd (q * 8 + 15 - 12 * 2 ^ a) [0, 0, (a + 3)] } + phase_with (n * 2 + 34 - 6 * 2 ^ a) (n + 14) { rodd (q * 8 + 20 - 6 * 2 ^ a) [(a + 2)] } + phase_with (n * 2 + 37 - 3 * 2 ^ a) (n + 15) { rodd (q * 8 + 21 - 3 * 2 ^ a) [(a + 1)] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +private theorem G_small_tail_2 (n : ℕ) (hn : 11 ≤ n) (hmod : n % 16 = 3) : + Steps (.st (n * 2 + 9 - 12) [0, 3] (n + 1) .t7) (RootG (n + 8)) := by + set q := n / 16 + have hq : n = q * 16 + 3 := by omega + dsimp [RootG] + phase_with (n * 2 + 4) (n + 2) { reven (q * 16 + 3) [2]; rodd (q * 8 + 1) [1] } + phase_with (n * 2 - 1) (n + 2) { reven (q * 16 + 5) [0, 1]; rmark; reven (q * 8 + 4) [0]; rmark; rodd (q * 4 + 3) [] } + phase_with (n * 2 + 5) (n + 2) { rodd (q * 16 + 2) [0, 1, 0] } + phase_with (n * 2 + 12) (n + 4) { rodd (q * 16 + 8) [0, 0] } + phase_with (n * 2 + 20) (n + 7) { rodd (q * 16 + 13) [] } + phase_with (n * 2 + 23) (n + 8) { rodd (q * 16 + 14) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +private theorem G_small_tail_3 (n : ℕ) (hn : 11 ≤ n) (hmod : n % 32 = 11) : + Steps (.st (n * 2 + 9 - 24) [0, 4] (n + 1) .t7) (RootG (n + 16)) := by + set q := n / 32 + have hq : n = q * 32 + 11 := by omega + dsimp [RootG] + phase_with (n * 2 - 2) (n + 2) { reven (q * 32 + 5) [3]; rodd (q * 16 + 2) [2] } + phase_with (n * 2 + 1) (n + 2) { reven (q * 32 + 10) [0, 2]; rmark; rodd (q * 16 + 6) [1] } + phase_with (n * 2 + 6) (n + 2) { rodd (q * 32 + 11) [0, 0, 1] } + phase_with (n * 2 + 15) (n + 5) { rodd (q * 32 + 18) [0] } + phase_with (n * 2 + 20) (n + 7) { rodd (q * 32 + 21) [] } + phase_with (n * 2 + 23) (n + 8) { rodd (q * 32 + 22) [] } + phase_with (n * 2 + 3) (n + 9) { reven (q * 32 + 24) []; reven (q * 16 + 12) []; reven (q * 8 + 6) []; reven (q * 4 + 3) []; rodd (q * 2 + 1) [] } + phase_with (n * 2 + 13) (n + 9) { rodd (q * 32 + 12) [3] } + phase_with (n * 2 + 20) (n + 10) { reven (q * 32 + 19) [2]; rodd (q * 16 + 9) [1] } + phase_with (n * 2 + 15) (n + 10) { reven (q * 32 + 21) [0, 1]; rmark; reven (q * 16 + 12) [0]; rmark; rodd (q * 8 + 7) [] } + phase_with (n * 2 + 21) (n + 10) { rodd (q * 32 + 18) [0, 1, 0] } + phase_with (n * 2 + 28) (n + 12) { rodd (q * 32 + 24) [0, 0] } + phase_with (n * 2 + 36) (n + 15) { rodd (q * 32 + 29) [] } + phase_with (n * 2 + 39) (n + 16) { rodd (q * 32 + 30) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +private theorem G_small_tail_4 (n : ℕ) (hn : 11 ≤ n) (hmod : n % 64 = 27) : + Steps (.st (n * 2 + 9 - 48) [0, 5] (n + 1) .t7) (RootG (n + 16)) := by + set q := n / 64 + have hq : n = q * 64 + 27 := by omega + dsimp [RootG] + phase_with (n * 2 - 14) (n + 2) { reven (q * 64 + 9) [4]; rodd (q * 32 + 4) [3] } + phase_with (n * 2 - 5) (n + 2) { reven (q * 64 + 20) [0, 3]; rmark; rodd (q * 32 + 11) [2] } + phase_with (n * 2 + 3) (n + 2) { rodd (q * 64 + 24) [0, 0, 2] } + phase_with (n * 2 + 12) (n + 5) { reven (q * 64 + 33) [1]; rodd (q * 32 + 16) [0] } + phase_with (n * 2 + 10) (n + 5) { reven (q * 64 + 33) [0, 0]; rmark; rmark; rodd (q * 32 + 19) [] } + phase_with (n * 2 + 9) (n + 5) { reven (q * 64 + 32) [0, 0, 0]; rmark; rmark; rmark; rodd (q * 32 + 20) [] } + phase_with (n * 2 + 13) (n + 5) { rodd (q * 64 + 31) [0, 0, 0, 0] } + phase_with (n * 2 + 25) (n + 10) { reven (q * 64 + 41) []; rodd (q * 32 + 20) [] } + phase_with (n * 2 + 26) (n + 10) { rodd (q * 64 + 39) [0] } + phase_with (n * 2 + 29) (n + 12) { reven (q * 64 + 43) []; rodd (q * 32 + 21) [] } + phase_with (n * 2 + 30) (n + 12) { rodd (q * 64 + 41) [0] } + phase_with (n * 2 + 33) (n + 14) { reven (q * 64 + 45) []; rodd (q * 32 + 22) [] } + phase_with (n * 2 + 33) (n + 14) { rodd (q * 64 + 43) [0] } + phase_with (n * 2 + 39) (n + 16) { rodd (q * 64 + 46) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +private theorem G_small_tail_5 (n : ℕ) (hn : 11 ≤ n) (hmod : n % 128 = 59) : + Steps (.st (n * 2 + 9 - 96) [0, 6] (n + 1) .t7) (RootG (n + 16)) := by + set q := n / 128 + have hq : n = q * 128 + 59 := by omega + dsimp [RootG] + phase_with (n * 2 - 38) (n + 2) { reven (q * 128 + 17) [5]; rodd (q * 64 + 8) [4] } + phase_with (n * 2 - 17) (n + 2) { reven (q * 128 + 40) [0, 4]; rmark; rodd (q * 64 + 21) [3] } + phase_with (n * 2 - 3) (n + 2) { rodd (q * 128 + 50) [0, 0, 3] } + phase_with (n * 2 + 6) (n + 5) { reven (q * 128 + 62) [2]; reven (q * 64 + 31) [1]; rodd (q * 32 + 15) [0] } + phase_with (n * 2 + 2) (n + 5) { reven (q * 128 + 62) [1, 0]; reven (q * 64 + 31) [0, 0]; rmark; rmark; rodd (q * 32 + 18) [] } + phase_with (n * 2 - 1) (n + 5) { reven (q * 128 + 60) [1, 0, 0]; reven (q * 64 + 30) [0, 0, 0]; rmark; rmark; rmark; rodd (q * 32 + 19) [] } + phase_with (n * 2 + 8) (n + 5) { rodd (q * 128 + 58) [1, 0, 0, 0] } + phase_with (n * 2 + 14) (n + 6) { rodd (q * 128 + 64) [0, 0, 0, 0] } + phase_with (n * 2 + 29) (n + 11) { rodd (q * 128 + 73) [] } + phase_with (n * 2 + 29) (n + 12) { reven (q * 128 + 75) []; rodd (q * 64 + 37) [] } + phase_with (n * 2 + 30) (n + 12) { rodd (q * 128 + 73) [0] } + phase_with (n * 2 + 33) (n + 14) { reven (q * 128 + 77) []; rodd (q * 64 + 38) [] } + phase_with (n * 2 + 33) (n + 14) { rodd (q * 128 + 75) [0] } + phase_with (n * 2 + 39) (n + 16) { rodd (q * 128 + 78) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +private theorem G_small_tail_6 (n : ℕ) (hn : 11 ≤ n) (hmod : n % 256 = 123) : + Steps (.st (n * 2 + 9 - 192) [0, 7] (n + 1) .t7) (RootG (n + 16)) := by + set q := n / 256 + have hq : n = q * 256 + 123 := by omega + dsimp [RootG] + phase_with (n * 2 - 86) (n + 2) { reven (q * 256 + 33) [6]; rodd (q * 128 + 16) [5] } + phase_with (n * 2 - 41) (n + 2) { reven (q * 256 + 80) [0, 5]; rmark; rodd (q * 128 + 41) [4] } + phase_with (n * 2 - 15) (n + 2) { rodd (q * 256 + 102) [0, 0, 4] } + phase_with (n * 2 - 50) (n + 5) { reven (q * 256 + 120) [3]; reven (q * 128 + 60) [2]; reven (q * 64 + 30) [1]; reven (q * 32 + 15) [0]; rmark; reven (q * 16 + 9) []; rodd (q * 8 + 4) [] } + phase_with (n * 2 - 22) (n + 5) { reven (q * 256 + 98) [3, 1]; reven (q * 128 + 49) [2, 1]; rodd (q * 64 + 24) [1, 1] } + phase_with (n * 2 - 9) (n + 5) { reven (q * 256 + 112) [1, 1, 1]; reven (q * 128 + 56) [0, 1, 1]; rmark; rodd (q * 64 + 29) [0, 1] } + phase_with (n * 2 + 4) (n + 5) { rodd (q * 256 + 118) [1, 0, 0, 1] } + phase_with (n * 2 + 12) (n + 6) { rodd (q * 256 + 126) [0, 0, 0, 1] } + phase_with (n * 2 + 20) (n + 10) { reven (q * 256 + 135) [0]; rmark; reven (q * 128 + 69) []; rodd (q * 64 + 34) [] } + phase_with (n * 2 + 15) (n + 10) { reven (q * 256 + 133) [0, 1]; rmark; reven (q * 128 + 68) [0]; rmark; rodd (q * 64 + 35) [] } + phase_with (n * 2 + 21) (n + 10) { rodd (q * 256 + 130) [0, 1, 0] } + phase_with (n * 2 + 28) (n + 12) { rodd (q * 256 + 136) [0, 0] } + phase_with (n * 2 + 36) (n + 15) { rodd (q * 256 + 141) [] } + phase_with (n * 2 + 39) (n + 16) { rodd (q * 256 + 142) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +private theorem G_small_tail_7 (n : ℕ) (hn : 11 ≤ n) (hmod : n % 512 = 251) : + Steps (.st (n * 2 + 9 - 384) [0, 8] (n + 1) .t7) (RootG (n + 16)) := by + set q := n / 512 + have hq : n = q * 512 + 251 := by omega + dsimp [RootG] + phase_with (n * 2 - 182) (n + 2) { reven (q * 512 + 65) [7]; rodd (q * 256 + 32) [6] } + phase_with (n * 2 - 89) (n + 2) { reven (q * 512 + 160) [0, 6]; rmark; rodd (q * 256 + 81) [5] } + phase_with (n * 2 - 39) (n + 2) { rodd (q * 512 + 206) [0, 0, 5] } + phase_with (n * 2 - 18) (n + 5) { reven (q * 512 + 236) [4]; reven (q * 256 + 118) [3]; reven (q * 128 + 59) [2]; rodd (q * 64 + 29) [1] } + phase_with (n * 2 - 6) (n + 5) { reven (q * 512 + 242) [2, 1]; reven (q * 256 + 121) [1, 1]; rodd (q * 128 + 60) [0, 1] } + phase_with (n * 2 - 49) (n + 5) { reven (q * 512 + 248) [1, 0, 1]; reven (q * 256 + 124) [0, 0, 1]; rmark; rmark; reven (q * 128 + 65) [0]; rmark; reven (q * 64 + 34) []; reven (q * 32 + 17) []; rodd (q * 16 + 8) [] } + phase_with (n * 2 - 16) (n + 5) { rodd (q * 512 + 226) [1, 0, 1, 2] } + phase_with (n * 2 + 2) (n + 6) { rodd (q * 512 + 244) [0, 0, 1, 2] } + phase_with (n * 2 + 18) (n + 9) { rodd (q * 512 + 256) [0, 2] } + phase_with (n * 2 + 24) (n + 11) { reven (q * 512 + 263) [1]; rodd (q * 256 + 131) [0] } + phase_with (n * 2 + 23) (n + 11) { reven (q * 512 + 263) [0, 0]; rmark; rmark; rodd (q * 256 + 134) [] } + phase_with (n * 2 + 25) (n + 11) { rodd (q * 512 + 262) [0, 0, 0] } + phase_with (n * 2 + 36) (n + 15) { rodd (q * 512 + 269) [] } + phase_with (n * 2 + 39) (n + 16) { rodd (q * 512 + 270) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +private theorem G_small_tail_8 (n : ℕ) (hn : 11 ≤ n) (hmod : n % 1024 = 507) : + Steps (.st (n * 2 + 9 - 768) [0, 9] (n + 1) .t7) (RootG (n + 16)) := by + set q := n / 1024 + have hq : n = q * 1024 + 507 := by omega + dsimp [RootG] + phase_with (n * 2 - 374) (n + 2) { reven (q * 1024 + 129) [8]; rodd (q * 512 + 64) [7] } + phase_with (n * 2 - 185) (n + 2) { reven (q * 1024 + 320) [0, 7]; rmark; rodd (q * 512 + 161) [6] } + phase_with (n * 2 - 87) (n + 2) { rodd (q * 1024 + 414) [0, 0, 6] } + phase_with (n * 2 - 42) (n + 5) { reven (q * 1024 + 468) [5]; reven (q * 512 + 234) [4]; reven (q * 256 + 117) [3]; rodd (q * 128 + 58) [2] } + phase_with (n * 2 - 18) (n + 5) { reven (q * 1024 + 486) [2, 2]; reven (q * 512 + 243) [1, 2]; rodd (q * 256 + 121) [0, 2] } + phase_with (n * 2 - 9) (n + 5) { reven (q * 1024 + 498) [1, 0, 2]; reven (q * 512 + 249) [0, 0, 2]; rmark; rmark; rodd (q * 256 + 127) [1] } + phase_with (n * 2 + 4) (n + 5) { rodd (q * 1024 + 502) [1, 0, 0, 1] } + phase_with (n * 2 + 12) (n + 6) { rodd (q * 1024 + 510) [0, 0, 0, 1] } + phase_with (n * 2 + 20) (n + 10) { reven (q * 1024 + 519) [0]; rmark; reven (q * 512 + 261) []; rodd (q * 256 + 130) [] } + phase_with (n * 2 + 15) (n + 10) { reven (q * 1024 + 517) [0, 1]; rmark; reven (q * 512 + 260) [0]; rmark; rodd (q * 256 + 131) [] } + phase_with (n * 2 + 21) (n + 10) { rodd (q * 1024 + 514) [0, 1, 0] } + phase_with (n * 2 + 28) (n + 12) { rodd (q * 1024 + 520) [0, 0] } + phase_with (n * 2 + 36) (n + 15) { rodd (q * 1024 + 525) [] } + phase_with (n * 2 + 39) (n + 16) { rodd (q * 1024 + 526) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +private theorem G_small_tail_9 (n : ℕ) (hn : 11 ≤ n) (hmod : n % 2048 = 1019) : + Steps (.st (n * 2 + 9 - 1536) [0, 10] (n + 1) .t7) (RootG (n + 16)) := by + set q := n / 2048 + have hq : n = q * 2048 + 1019 := by omega + dsimp [RootG] + phase_with (n * 2 - 758) (n + 2) { reven (q * 2048 + 257) [9]; rodd (q * 1024 + 128) [8] } + phase_with (n * 2 - 377) (n + 2) { reven (q * 2048 + 640) [0, 8]; rmark; rodd (q * 1024 + 321) [7] } + phase_with (n * 2 - 183) (n + 2) { rodd (q * 2048 + 830) [0, 0, 7] } + phase_with (n * 2 - 90) (n + 5) { reven (q * 2048 + 932) [6]; reven (q * 1024 + 466) [5]; reven (q * 512 + 233) [4]; rodd (q * 256 + 116) [3] } + phase_with (n * 2 - 42) (n + 5) { reven (q * 2048 + 974) [2, 3]; reven (q * 1024 + 487) [1, 3]; rodd (q * 512 + 243) [0, 3] } + phase_with (n * 2 - 21) (n + 5) { reven (q * 2048 + 998) [1, 0, 3]; reven (q * 1024 + 499) [0, 0, 3]; rmark; rmark; rodd (q * 512 + 252) [2] } + phase_with (n * 2 - 2) (n + 5) { rodd (q * 2048 + 1008) [1, 0, 0, 2] } + phase_with (n * 2 + 9) (n + 6) { rodd (q * 2048 + 1019) [0, 0, 0, 2] } + phase_with (n * 2 + 24) (n + 10) { rodd (q * 2048 + 1029) [1] } + phase_with (n * 2 + 27) (n + 11) { rodd (q * 2048 + 1032) [0] } + phase_with (n * 2 + 33) (n + 13) { rodd (q * 2048 + 1035) [] } + phase_with (n * 2 + 33) (n + 14) { reven (q * 2048 + 1037) []; rodd (q * 1024 + 518) [] } + phase_with (n * 2 + 33) (n + 14) { rodd (q * 2048 + 1035) [0] } + phase_with (n * 2 + 39) (n + 16) { rodd (q * 2048 + 1038) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +private theorem G_small_tail_10 (n : ℕ) (hn : 11 ≤ n) (hmod : n % 4096 = 2043) : + Steps (.st (n * 2 + 9 - 3072) [0, 11] (n + 1) .t7) (RootG (n + 16)) := by + set q := n / 4096 + have hq : n = q * 4096 + 2043 := by omega + dsimp [RootG] + phase_with (n * 2 - 1526) (n + 2) { reven (q * 4096 + 513) [10]; rodd (q * 2048 + 256) [9] } + phase_with (n * 2 - 761) (n + 2) { reven (q * 4096 + 1280) [0, 9]; rmark; rodd (q * 2048 + 641) [8] } + phase_with (n * 2 - 375) (n + 2) { rodd (q * 4096 + 1662) [0, 0, 8] } + phase_with (n * 2 - 186) (n + 5) { reven (q * 4096 + 1860) [7]; reven (q * 2048 + 930) [6]; reven (q * 1024 + 465) [5]; rodd (q * 512 + 232) [4] } + phase_with (n * 2 - 90) (n + 5) { reven (q * 4096 + 1950) [2, 4]; reven (q * 2048 + 975) [1, 4]; rodd (q * 1024 + 487) [0, 4] } + phase_with (n * 2 - 45) (n + 5) { reven (q * 4096 + 1998) [1, 0, 4]; reven (q * 2048 + 999) [0, 0, 4]; rmark; rmark; rodd (q * 1024 + 502) [3] } + phase_with (n * 2 - 14) (n + 5) { rodd (q * 4096 + 2020) [1, 0, 0, 3] } + phase_with (n * 2 + 3) (n + 6) { rodd (q * 4096 + 2037) [0, 0, 0, 3] } + phase_with (n * 2 + 21) (n + 10) { rodd (q * 4096 + 2050) [2] } + phase_with (n * 2 + 24) (n + 11) { reven (q * 4096 + 2055) [1]; rodd (q * 2048 + 1027) [0] } + phase_with (n * 2 + 23) (n + 11) { reven (q * 4096 + 2055) [0, 0]; rmark; rmark; rodd (q * 2048 + 1030) [] } + phase_with (n * 2 + 25) (n + 11) { rodd (q * 4096 + 2054) [0, 0, 0] } + phase_with (n * 2 + 36) (n + 15) { rodd (q * 4096 + 2061) [] } + phase_with (n * 2 + 39) (n + 16) { rodd (q * 4096 + 2062) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +private theorem G_small_tail_11 (n : ℕ) (hn : 11 ≤ n) (hmod : n % 8192 = 4091) : + Steps (.st (n * 2 + 9 - 6144) [0, 12] (n + 1) .t7) (RootG (n + 24)) := by + set q := n / 8192 + have hq : n = q * 8192 + 4091 := by omega + dsimp [RootG] + phase_with (n * 2 - 3062) (n + 2) { reven (q * 8192 + 1025) [11]; rodd (q * 4096 + 512) [10] } + phase_with (n * 2 - 1529) (n + 2) { reven (q * 8192 + 2560) [0, 10]; rmark; rodd (q * 4096 + 1281) [9] } + phase_with (n * 2 - 759) (n + 2) { rodd (q * 8192 + 3326) [0, 0, 9] } + phase_with (n * 2 - 378) (n + 5) { reven (q * 8192 + 3716) [8]; reven (q * 4096 + 1858) [7]; reven (q * 2048 + 929) [6]; rodd (q * 1024 + 464) [5] } + phase_with (n * 2 - 186) (n + 5) { reven (q * 8192 + 3902) [2, 5]; reven (q * 4096 + 1951) [1, 5]; rodd (q * 2048 + 975) [0, 5] } + phase_with (n * 2 - 93) (n + 5) { reven (q * 8192 + 3998) [1, 0, 5]; reven (q * 4096 + 1999) [0, 0, 5]; rmark; rmark; rodd (q * 2048 + 1002) [4] } + phase_with (n * 2 - 38) (n + 5) { rodd (q * 8192 + 4044) [1, 0, 0, 4] } + phase_with (n * 2 - 9) (n + 6) { rodd (q * 8192 + 4073) [0, 0, 0, 4] } + phase_with (n * 2 + 15) (n + 10) { rodd (q * 8192 + 4092) [3] } + phase_with (n * 2 - 28) (n + 11) { reven (q * 8192 + 4100) [2]; reven (q * 4096 + 2050) [1]; reven (q * 2048 + 1025) [0]; rmark; reven (q * 1024 + 514) []; reven (q * 512 + 257) []; rodd (q * 256 + 128) [] } + phase_with (n * 2 - 1) (n + 11) { reven (q * 8192 + 4077) [2, 2]; rodd (q * 4096 + 2038) [1, 2] } + phase_with (n * 2 + 13) (n + 11) { rodd (q * 8192 + 4090) [0, 1, 2] } + phase_with (n * 2 + 25) (n + 13) { rodd (q * 8192 + 4100) [0, 2] } + phase_with (n * 2 + 34) (n + 15) { rodd (q * 8192 + 4106) [1] } + phase_with (n * 2 + 38) (n + 16) { rodd (q * 8192 + 4109) [0] } + phase_with (n * 2 + 41) (n + 18) { reven (q * 8192 + 4113) []; rodd (q * 4096 + 2056) [] } + phase_with (n * 2 + 42) (n + 18) { rodd (q * 8192 + 4111) [0] } + phase_with (n * 2 + 45) (n + 20) { reven (q * 8192 + 4115) []; rodd (q * 4096 + 2057) [] } + phase_with (n * 2 + 46) (n + 20) { rodd (q * 8192 + 4113) [0] } + phase_with (n * 2 + 49) (n + 22) { reven (q * 8192 + 4117) []; rodd (q * 4096 + 2058) [] } + phase_with (n * 2 + 49) (n + 22) { rodd (q * 8192 + 4115) [0] } + phase_with (n * 2 + 55) (n + 24) { rodd (q * 8192 + 4118) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +private theorem G_small_tail_12 (n : ℕ) (hn : 11 ≤ n) (hmod : n % 16384 = 8187) : + Steps (.st (n * 2 + 9 - 12288) [0, 13] (n + 1) .t7) (RootG (n + 24)) := by + set q := n / 16384 + have hq : n = q * 16384 + 8187 := by omega + dsimp [RootG] + phase_with (n * 2 - 6134) (n + 2) { reven (q * 16384 + 2049) [12]; rodd (q * 8192 + 1024) [11] } + phase_with (n * 2 - 3065) (n + 2) { reven (q * 16384 + 5120) [0, 11]; rmark; rodd (q * 8192 + 2561) [10] } + phase_with (n * 2 - 1527) (n + 2) { rodd (q * 16384 + 6654) [0, 0, 10] } + phase_with (n * 2 - 762) (n + 5) { reven (q * 16384 + 7428) [9]; reven (q * 8192 + 3714) [8]; reven (q * 4096 + 1857) [7]; rodd (q * 2048 + 928) [6] } + phase_with (n * 2 - 378) (n + 5) { reven (q * 16384 + 7806) [2, 6]; reven (q * 8192 + 3903) [1, 6]; rodd (q * 4096 + 1951) [0, 6] } + phase_with (n * 2 - 189) (n + 5) { reven (q * 16384 + 7998) [1, 0, 6]; reven (q * 8192 + 3999) [0, 0, 6]; rmark; rmark; rodd (q * 4096 + 2002) [5] } + phase_with (n * 2 - 86) (n + 5) { rodd (q * 16384 + 8092) [1, 0, 0, 5] } + phase_with (n * 2 - 33) (n + 6) { rodd (q * 16384 + 8145) [0, 0, 0, 5] } + phase_with (n * 2 + 3) (n + 10) { rodd (q * 16384 + 8176) [4] } + phase_with (n * 2 + 12) (n + 11) { reven (q * 16384 + 8190) [3]; reven (q * 8192 + 4095) [2]; rodd (q * 4096 + 2047) [1] } + phase_with (n * 2 + 19) (n + 11) { reven (q * 16384 + 8193) [1, 1]; rodd (q * 8192 + 4096) [0, 1] } + phase_with (n * 2 + 23) (n + 11) { rodd (q * 16384 + 8196) [0, 0, 1] } + phase_with (n * 2 + 27) (n + 14) { reven (q * 16384 + 8203) [0]; rmark; reven (q * 8192 + 4103) []; rodd (q * 4096 + 2051) [] } + phase_with (n * 2 + 31) (n + 14) { rodd (q * 16384 + 8200) [0, 1] } + phase_with (n * 2 + 38) (n + 16) { rodd (q * 16384 + 8205) [0] } + phase_with (n * 2 + 41) (n + 18) { reven (q * 16384 + 8209) []; rodd (q * 8192 + 4104) [] } + phase_with (n * 2 + 42) (n + 18) { rodd (q * 16384 + 8207) [0] } + phase_with (n * 2 + 45) (n + 20) { reven (q * 16384 + 8211) []; rodd (q * 8192 + 4105) [] } + phase_with (n * 2 + 46) (n + 20) { rodd (q * 16384 + 8209) [0] } + phase_with (n * 2 + 49) (n + 22) { reven (q * 16384 + 8213) []; rodd (q * 8192 + 4106) [] } + phase_with (n * 2 + 49) (n + 22) { rodd (q * 16384 + 8211) [0] } + phase_with (n * 2 + 55) (n + 24) { rodd (q * 16384 + 8214) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +private theorem G_small_tail_13 (n : ℕ) (hn : 11 ≤ n) (hmod : n % 32768 = 16379) : + Steps (.st (n * 2 + 9 - 24576) [0, 14] (n + 1) .t7) (RootG (n + 24)) := by + set q := n / 32768 + have hq : n = q * 32768 + 16379 := by omega + dsimp [RootG] + phase_with (n * 2 - 12278) (n + 2) { reven (q * 32768 + 4097) [13]; rodd (q * 16384 + 2048) [12] } + phase_with (n * 2 - 6137) (n + 2) { reven (q * 32768 + 10240) [0, 12]; rmark; rodd (q * 16384 + 5121) [11] } + phase_with (n * 2 - 3063) (n + 2) { rodd (q * 32768 + 13310) [0, 0, 11] } + phase_with (n * 2 - 1530) (n + 5) { reven (q * 32768 + 14852) [10]; reven (q * 16384 + 7426) [9]; reven (q * 8192 + 3713) [8]; rodd (q * 4096 + 1856) [7] } + phase_with (n * 2 - 762) (n + 5) { reven (q * 32768 + 15614) [2, 7]; reven (q * 16384 + 7807) [1, 7]; rodd (q * 8192 + 3903) [0, 7] } + phase_with (n * 2 - 381) (n + 5) { reven (q * 32768 + 15998) [1, 0, 7]; reven (q * 16384 + 7999) [0, 0, 7]; rmark; rmark; rodd (q * 8192 + 4002) [6] } + phase_with (n * 2 - 182) (n + 5) { rodd (q * 32768 + 16188) [1, 0, 0, 6] } + phase_with (n * 2 - 81) (n + 6) { rodd (q * 32768 + 16289) [0, 0, 0, 6] } + phase_with (n * 2 - 21) (n + 10) { rodd (q * 32768 + 16344) [5] } + phase_with (n * 2) (n + 11) { reven (q * 32768 + 16370) [4]; reven (q * 16384 + 8185) [3]; rodd (q * 8192 + 4092) [2] } + phase_with (n * 2 + 13) (n + 11) { reven (q * 32768 + 16379) [1, 2]; rodd (q * 16384 + 8189) [0, 2] } + phase_with (n * 2 + 20) (n + 11) { rodd (q * 32768 + 16385) [0, 0, 2] } + phase_with (n * 2 + 31) (n + 14) { rodd (q * 32768 + 16393) [1] } + phase_with (n * 2 + 33) (n + 15) { reven (q * 32768 + 16396) [0]; rmark; rodd (q * 16384 + 8199) [] } + phase_with (n * 2 + 35) (n + 15) { rodd (q * 32768 + 16395) [0, 0] } + phase_with (n * 2 + 41) (n + 18) { reven (q * 32768 + 16401) []; rodd (q * 16384 + 8200) [] } + phase_with (n * 2 + 42) (n + 18) { rodd (q * 32768 + 16399) [0] } + phase_with (n * 2 + 45) (n + 20) { reven (q * 32768 + 16403) []; rodd (q * 16384 + 8201) [] } + phase_with (n * 2 + 46) (n + 20) { rodd (q * 32768 + 16401) [0] } + phase_with (n * 2 + 49) (n + 22) { reven (q * 32768 + 16405) []; rodd (q * 16384 + 8202) [] } + phase_with (n * 2 + 49) (n + 22) { rodd (q * 32768 + 16403) [0] } + phase_with (n * 2 + 55) (n + 24) { rodd (q * 32768 + 16406) [] } + exact (Steps.Done _).congr (by congr 1; omega) rfl + +theorem G_small_tail (j n : ℕ) (hj1 : 2 ≤ j) (hj2 : j ≤ 13) (hn : 11 ≤ n) + (hmod : n % 2 ^ (j + 2) = 2 ^ (j + 1) - 5) : + Steps (.st (n * 2 + 9 - 3 * 2 ^ j) [0, 1 + j] (n + 1) .t7) + (RootG (n + 8 * ((j + 13) / 8))) := by + rcases (by omega : j = 2 ∨ j = 3 ∨ j = 4 ∨ j = 5 ∨ j = 6 ∨ j = 7 ∨ + j = 8 ∨ j = 9 ∨ j = 10 ∨ j = 11 ∨ j = 12 ∨ j = 13) with + rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl + · exact G_small_tail_2 n hn hmod + · exact G_small_tail_3 n hn hmod + · exact G_small_tail_4 n hn hmod + · exact G_small_tail_5 n hn hmod + · exact G_small_tail_6 n hn hmod + · exact G_small_tail_7 n hn hmod + · exact G_small_tail_8 n hn hmod + · exact G_small_tail_9 n hn hmod + · exact G_small_tail_10 n hn hmod + · exact G_small_tail_11 n hn hmod + · exact G_small_tail_12 n hn hmod + · exact G_small_tail_13 n hn hmod + +def Forward (s s' : State) : Prop := + ∀ l r, Denote s l r → ∃ l' r', Denote s' l' r' ∧ (l {{E}}> r) [tm]⊢⁺ (l' {{E}}> r') + +theorem Steps_forward {s s' : State} (hneq : s ≠ s') (hsteps : Steps s s') : + Forward s s' := by + intro l r hd + cases hsteps with + | Done => contradiction + | Advance hnext hrest => + rcases Next_spec hnext l r hd with ⟨l0, r0, hd0, hrun0⟩ + rcases Steps_spec hrest l0 r0 hd0 with ⟨l', r', hd', hrun'⟩ + exact ⟨l', r', hd', stepPlus_stepStar_trans hrun0 hrun'⟩ + +theorem Forward_steps {s t u : State} (h0 : Forward s t) (h1 : Steps t u) : + Forward s u := by + intro l r hd + rcases h0 l r hd with ⟨l0, r0, hd0, hrun0⟩ + rcases Steps_spec h1 l0 r0 hd0 with ⟨l', r', hd', hrun'⟩ + exact ⟨l', r', hd', stepPlus_stepStar_trans hrun0 hrun'⟩ + +theorem factor2 (n : ℕ) (hn : 0 < n) : ∃ i u, n = (u * 2 + 1) * 2 ^ i := by + induction n using Nat.strong_induction_on with + | h n ih => + by_cases hodd : n % 2 = 1 + · exact ⟨0, n / 2, by omega⟩ + · rcases ih (n / 2) (by omega) (by omega) with ⟨i, u, hu⟩ + refine ⟨i + 1, u, ?_⟩ + rw [Nat.pow_succ, ← Nat.mul_assoc] + omega + +theorem G_begin (j u n : ℕ) (hj : 2 ≤ j) (hval : n + 5 = (u * 2 + 1) * 2 ^ (1 + j)) : + Forward (RootG n) (.st (n * 2 + 9 - 3 * 2 ^ j) [0, 1 + j] (n + 1) .t7) := by + rcases u with _ | u + · have hval' : n + 5 = 2 ^ (1 + j) := by simpa using hval + have hp1 : 2 ^ (1 + j) = 2 * 2 ^ j := by rw [Nat.add_comm 1 j, Nat.pow_succ]; ring + intro l r hd + rcases G_partial j n hval' l r hd with ⟨l', r', hd', hrun⟩ + exact ⟨l', r', hd'.congr (by congr 1; omega) rfl rfl, hrun⟩ + · rw [show (u + 1) * 2 + 1 = u * 2 + 3 by omega] at hval + refine Steps_forward ?_ (G_start j u n hj hval) + unfold RootG + intro heq + injection heq with _ _ hn_eq + omega + +inductive Ready : State → Prop where + | ReadyG (n : ℕ) : 11 ≤ n → n % 8 = 3 → Ready (RootG n) + | ReadyD (h n : ℕ) : 1 ≤ h → 64 ≤ n → n % 8 = 2 → 3 * 2 ^ (h - 1) ≤ n * 2 → Ready (RootD h n) + | ReadyE (n : ℕ) : 64 ≤ n → n % 8 = 2 → Ready (RootE n) + | ReadyF (n : ℕ) : 64 ≤ n → n % 8 = 1 → Ready (RootF n) + +theorem G_ready (n : ℕ) (hn : 11 ≤ n) (hmod : n % 8 = 3) : + ∃ s, Ready s ∧ Forward (RootG n) s := by + rcases factor2 ((n + 5) / 8) (by omega) with ⟨i, u, hu⟩ + have hval : n + 5 = (u * 2 + 1) * 2 ^ (1 + (2 + i)) := by + rw [show 1 + (2 + i) = i + 3 by omega, Nat.pow_add, ← Nat.mul_assoc] + change n + 5 = ((u * 2 + 1) * 2 ^ i) * 8 + omega + have hlow : 2 ^ (1 + (2 + i)) ≤ n + 5 := by + have : 1 * 2 ^ (1 + (2 + i)) ≤ (u * 2 + 1) * 2 ^ (1 + (2 + i)) := + Nat.mul_le_mul_right _ (by omega) + omega + have hbegin := G_begin (2 + i) u n (by omega) hval + by_cases hi : i ≤ 11 + · refine ⟨RootG (n + 8 * ((2 + i + 13) / 8)), .ReadyG _ (by omega) (by omega), ?_⟩ + refine Forward_steps hbegin (G_small_tail (2 + i) n (by omega) (by omega) hn ?_) + have hp4 : 4 ≤ 2 ^ (2 + i) := by + rw [Nat.add_comm 2 i, Nat.pow_add] + have : 1 ≤ 2 ^ i := Nat.one_le_pow i 2 (by decide) + omega + have hp_2 : 2 ^ (2 + i + 2) = 2 ^ (2 + i) * 4 := by rw [Nat.pow_add] + have hp_1 : 2 ^ (2 + i + 1) = 2 ^ (2 + i) * 2 := by rw [Nat.pow_succ] + have hval' : n + 5 = 2 ^ (2 + i) * 2 + (2 ^ (2 + i) * 4) * u := by + have h0 : n + 5 = (u * 2 + 1) * (2 ^ (2 + i) * 2) := by + rwa [show 1 + (2 + i) = 2 + i + 1 by omega, hp_1] at hval + rw [h0]; ring + have h_eq : n = (2 ^ (2 + i) * 2 - 5) + (2 ^ (2 + i) * 4) * u := by omega + rw [hp_2, hp_1, h_eq, Nat.add_mul_mod_self_left] + exact Nat.mod_eq_of_lt (by omega) + · set a := i - 12 + have hi' : i = 12 + a := by omega + have h1 : 1 ≤ 2 ^ a := Nat.one_le_pow a 2 (by decide) + have hpow : 2 ^ (1 + (2 + i)) = 2 ^ 15 * 2 ^ a := by + rw [show 1 + (2 + i) = 15 + a by omega, Nat.pow_add] + have hbound : 2 ^ 15 * 2 ^ a ≤ n + 5 := by + rw [← hpow]; exact hlow + have hbound' : 32768 * 2 ^ a ≤ n + 5 := hbound + refine ⟨RootD (1 + a) (n + 15), .ReadyD (1 + a) (n + 15) (by omega) (by omega) (by omega) ?_, ?_⟩ + · rw [show 1 + a - 1 = a by omega] + omega + · refine Forward_steps hbegin ?_ + have htail := G_large_tail a n hbound hmod + refine htail.congr ?_ rfl + have hpow2 : 2 ^ (2 + i) = 2 ^ 14 * 2 ^ a := by + rw [show 2 + i = 14 + a by omega, Nat.pow_add] + rw [hpow2, show 15 + a = 1 + (2 + i) by omega, ← Nat.mul_assoc] + +theorem D6_ready (n : ℕ) (hn : 64 ≤ n) (hmod : n % 8 = 2) : + ∃ s, Ready s ∧ Forward (RootD 6 n) s := by + by_cases he : n % 16 = 10 + · refine ⟨RootE (n + 8), .ReadyE (n + 8) (by omega) (by omega), ?_⟩ + refine Steps_forward ?_ (D6_even n hn he) + unfold RootD RootE + intro h; injection h with _ hls; injection hls with hh; omega + · have hrem : n % 16 = 2 := by omega + rcases factor2 ((n + 14) / 16) (by omega) with ⟨i, u, hu⟩ + have hval : n + 14 = (u * 2 + 1) * 16 * 2 ^ i := by + have hdiv : n + 14 = ((u * 2 + 1) * 2 ^ i) * 16 := by omega + rw [hdiv]; ring + have hlow : 16 * 2 ^ i ≤ n + 14 := by + have : n + 14 = 32 * (u * 2 ^ i) + 16 * 2 ^ i := by rw [hval]; ring + omega + refine ⟨RootD (1 + i) (n + 8), .ReadyD (1 + i) (n + 8) (by omega) (by omega) (by omega) ?_, ?_⟩ + · rw [show 1 + i - 1 = i by omega]; omega + · rcases u with _ | u + · rcases i with _ | _ | _ | i + · dsimp at hval; omega + · dsimp at hval; omega + · dsimp at hval; omega + · have hcase : n + 14 = 2 ^ (5 + (2 + i)) := by + have hp1 : 2 ^ (5 + (2 + i)) = 2 ^ i * 128 := by + rw [show 5 + (2 + i) = i + 7 by omega, Nat.pow_add] + have hp2 : 2 ^ (i + 1 + 1 + 1) = 2 ^ i * 8 := by + rw [show i + 1 + 1 + 1 = i + 3 by omega, Nat.pow_add] + rw [hp2] at hval + rw [hp1] + omega + have h_eq_d : 1 + (i + 1 + 1 + 1) = 2 + (2 + i) := by omega + rw [h_eq_d] + exact D6_partial (2 + i) n (by omega) hcase + · rw [show (u + 1) * 2 + 1 = u * 2 + 3 by omega] at hval + refine Steps_forward ?_ (D6_odd_ge3 i u n hn hval) + unfold RootD + intro h; injection h with _ _ hn_eq; omega + +theorem D_ready (h n : ℕ) (hh : 1 ≤ h) (hn : 64 ≤ n) (hmod : n % 8 = 2) + (hbound : 3 * 2 ^ (h - 1) ≤ n * 2) : + ∃ s, Ready s ∧ Forward (RootD h n) s := by + by_cases hlarge : 9 ≤ h + · set j := h - 9 + have hj : h = 9 + j := by omega + have hlow : 384 * 2 ^ j ≤ n := by + have hb : 3 * 2 ^ (8 + j) ≤ n * 2 := by + rwa [hj, show 9 + j - 1 = 8 + j by omega] at hbound + rw [Nat.add_comm 8 j, Nat.pow_add] at hb + change 3 * (2 ^ j * 256) ≤ n * 2 at hb + omega + refine ⟨RootD (1 + j) (n + 8), .ReadyD (1 + j) (n + 8) (by omega) (by omega) (by omega) ?_, ?_⟩ + · rw [show 1 + j - 1 = j by omega]; omega + · rw [hj] + refine Steps_forward ?_ (D_shrink j n hlow hmod) + unfold RootD + intro heq; injection heq with _ _ hn_eq; omega + · by_cases hfive : h ≤ 5 + · refine ⟨RootG (n + 9), .ReadyG (n + 9) (by omega) (by omega), ?_⟩ + refine Steps_forward ?_ (D_small h n hh hfive hn hmod) + unfold RootD RootG + intro heq; injection heq with _ _ hn_eq; omega + · rcases (by omega : h = 6 ∨ h = 7 ∨ h = 8) with rfl | rfl | rfl + · exact D6_ready n hn hmod + · refine ⟨RootF (n + 7), .ReadyF (n + 7) (by omega) (by omega), ?_⟩ + refine Steps_forward ?_ (D7 n ?_ hmod) + · unfold RootD RootF; intro heq; injection heq with _ _ hn_eq; omega + · change 3 * 64 ≤ n * 2 at hbound; omega + · refine ⟨RootE (n + 8), .ReadyE (n + 8) (by omega) (by omega), ?_⟩ + refine Steps_forward ?_ (D8 n ?_ hmod) + · unfold RootD RootE; intro heq; injection heq with _ _ hn_eq; omega + · change 3 * 128 ≤ n * 2 at hbound; omega + +theorem Ready_step {s : State} (hs : Ready s) : + ∃ s', Ready s' ∧ Forward s s' := by + cases hs with + | ReadyG n hn hmod => exact G_ready n hn hmod + | ReadyD h n hh hn hmod hbound => exact D_ready h n hh hn hmod hbound + | ReadyE n hn hmod => + refine ⟨RootG (n + 9), .ReadyG (n + 9) (by omega) (by omega), ?_⟩ + refine Steps_forward ?_ (E_cycle n hn hmod) + unfold RootE RootG; intro heq; injection heq with _ _ hn_eq; omega + | ReadyF n hn hmod => + refine ⟨RootG (n + 10), .ReadyG (n + 10) (by omega) (by omega), ?_⟩ + refine Steps_forward ?_ (F_cycle n hn hmod) + unfold RootF RootG; intro heq; injection heq with _ _ hn_eq; omega + +def Inv (c : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ s l r, Ready s ∧ Denote s l r ∧ c = (l {{E}}> r) + +theorem Inv_step (c : Cfg (Fin 2) (Fin 6)) (hc : Inv c) : + ∃ c', (c [tm]⊢⁺ c') ∧ Inv c' := by + rcases hc with ⟨s, l, r, hs, hd, rfl⟩ + rcases Ready_step hs with ⟨s', hs', hstep⟩ + rcases hstep l r hd with ⟨l', r', hd', hrun⟩ + exact ⟨l' {{E}}> r', hrun, s', l', r', hs', hd', rfl⟩ + +theorem init_to_rootG : + ∃ l r, Denote (RootG 11) l r ∧ (init []) [tm]⊢* (l {{E}}> r) := by + refine ⟨decodeHalf 17891608, decodeHalf 202949321582694304249789, ⟨?_, ?_⟩, ?_⟩ + · have hL : LC 29 [0] (v +> (z1 +> (z0 +> (z1 +> (z1 +> (z1 +> default)))))) := + LC.LC_w 29 [] _ + (LC.LC_1 14 _ + (LC.LC_2 6 _ + (LC.LC_1 3 _ + (LC.LC_1 1 _ + (LC.LC_1 0 _ LC.LC_0))))) + refine hL.congr rfl rfl ?_ + simp only [← decodeHalf_zero, decodeHalf_encodeList] + rfl + · have hR0 := RC.RC_0 .t2 + have hR1 := RC.RC_3 0 .t1 _ hR0 + have hR2 := RC.RC_3 1 .t0 _ hR1 + have hR3 := RC.RC_4 3 .t7 _ hR2 + have hR4 := RC.RC_4 6 .t6 _ hR3 + have hR5 := RC.RC_5 11 .t5 _ hR4 + refine hR5.congr rfl rfl ?_ + rw [show (11 + 1 + offset .t5) / 3 = 4 by rfl, + show (6 + 1 + offset .t6) / 3 = 2 by rfl, + show (3 + 1 + offset .t7) / 3 = 1 by rfl, + show (1 + 1 + offset .t0) / 3 = 0 by rfl, + show (0 + 1 + offset .t1) / 3 = 0 by rfl, + rh] + simp only [pow_succ_list, pow_zero_list, append_nil, ← decodeHalf_zero, decodeHalf_encodeList] + rfl + · have hsteps : multiStep tm (NatCfg.toCfg (K := 6) ⟨0, 0, 0, 0⟩) 11347 = + some (NatCfg.toCfg (K := 6) ⟨2, 1, 17891608, 101474660791347152124894⟩) := + stepsNat_sound tm 11347 ⟨0, 0, 0, 0⟩ ⟨2, 1, 17891608, 101474660791347152124894⟩ + (by decide) (by decide) + have hcfg : NatCfg.toCfg (K := 6) ⟨2, 1, 17891608, 101474660791347152124894⟩ = + Cfg.headRight E (decodeHalf 17891608) (decodeHalf 202949321582694304249789) := + toCfg_headRight (K := 6) E 17891608 202949321582694304249789 + rw [toCfg_zero (K := 6), hcfg] at hsteps + exact ⟨11347, hsteps⟩ + +theorem neverHaltsFrom_of_reachesStar {M : Machine (Fin 2) (Fin 6)} {c₁ c₀ : Cfg (Fin 2) (Fin 6)} + (hinit : c₁ [M]⊢* c₀) (h_never : NeverHaltsFrom M c₀) : NeverHaltsFrom M c₁ := by + obtain ⟨k₀, hk₀⟩ := hinit + intro cfg ⟨k, hk⟩ + rcases Nat.lt_or_ge k k₀ with hlt | hge + · rcases hstep_cfg : step M cfg with _ | _ + · have hnone : (step M cfg).isNone := by simp [hstep_cfg] + have hnone_k₀ : multiStep M c₁ k₀ = none := by + have hsplit : k₀ = k + (k₀ - k) := by omega + rw [hsplit] + exact multiStep_eq_none_of_isNone hk hnone (by omega) + rw [hnone_k₀] at hk₀ + cases hk₀ + · rfl + · have hsplit : k = k₀ + (k - k₀) := by omega + rw [hsplit, BusyBeaver.multiStep_add, hk₀, Option.bind_some] at hk + exact h_never cfg ⟨k - k₀, hk⟩ + +theorem neverHaltsFrom_tm : NeverHaltsFrom tm (init []) := by + rcases init_to_rootG with ⟨l, r, hd, hrun⟩ + refine neverHaltsFrom_of_reachesStar hrun ?_ + refine NeverHaltsFrom.of_reachesPlus_invariant Inv_step ?_ + exact ⟨RootG 11, l, r, .ReadyG 11 (by decide) (by decide), hd, rfl⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg ⟨k, hk⟩ + have hflip : multiStep tm (init []) k = some (flipCfg cfg) := by + have h0 : flipCfg (init [] : Cfg (Fin 2) (Fin 6)) = init [] := rfl + rw [← h0, multiStep_flipTM, hk]; rfl + have hsome := neverHaltsFrom_tm (flipCfg cfg) ⟨k, hflip⟩ + rw [step_flipTM] at hsome + cases hst : step target_tm cfg <;> simp_all + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RBHHH_1LC1RE_1LD0LC_1LE1LC_1RF0RE_1RA0RB diff --git a/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA.lean b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA.lean new file mode 100644 index 00000000..b2ec78a5 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA.lean @@ -0,0 +1,72 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH + +open Mathlib Relation Nat Turing BusyBeaver SixState +open BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH + +namespace BusyBeaver.M_1RBHHH_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA + + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +section + +abbrev fCR_1rc1ra : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6) := + cfgCR true D C -- CR config for 1RBHHH_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA + +abbrev fCL_1rc1ra : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6) := + cfgCL true E -- CL config for 1RBHHH_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA + +set_option maxHeartbeats 2000000 in +-- Justification: Symbolic execution of the 15 elementary SegRules for +-- 1RBHHH_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA. +theorem segRules_1rc1ra : SegRules (callStep target fCR_1rc1ra fCL_1rc1ra) := by + unfold fCR_1rc1ra fCL_1rc1ra + prove_seg_rules + +theorem step_ca_1rc1ra (r : HalfTape) : + (fCL_1rc1ra lh r) [target]⊢⁺ (fCR_1rc1ra ([1] +> default) .ca r) := by + unfold fCL_1rc1ra fCR_1rc1ra cfgCL cfgCR callState callWord lh + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_ca for 1RBHHH_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA + +theorem step_ch_1rc1ra (r : HalfTape) : + (fCL_1rc1ra ([1] +> default) r) [target]⊢⁺ (fCR_1rc1ra lh .ch r) := by + unfold fCL_1rc1ra fCR_1rc1ra cfgCL cfgCR callState callWord lh + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_ch for 1RBHHH_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA + +theorem step_init_1rc1ra : + (init []) [target]⊢⁺ fCL_1rc1ra lh (initTape .kindD) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + unfold fCL_1rc1ra initTape cfgCL lh t d1 d0 + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_init for 1RBHHH_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA + +end + +public section + +theorem is_not_halt : IsNotHalt target := + does_not_halt_of_seg_rules segRules_1rc1ra step_ca_1rc1ra step_ch_1rc1ra .kindD step_init_1rc1ra + +end + +end BusyBeaver.M_1RBHHH_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA diff --git a/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC0RF_1LD1RB_1LE0LD_1RB0LB_1RB1RA.lean b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC0RF_1LD1RB_1LE0LD_1RB0LB_1RB1RA.lean new file mode 100644 index 00000000..daf67a79 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC0RF_1LD1RB_1LE0LD_1RB0LB_1RB1RA.lean @@ -0,0 +1,2906 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB +public import BusyBeaver.Calculi.WordCalculusC +public import BusyBeaver.Calculi.WordCalculusD +public import BusyBeaver.Calculi.WordCalculusE + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RBHHH_1RC0RF_1LD1RB_1LE0LD_1RB0LB_1RB1RA + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1RC0RF_1LD1RB_1LE0LD_1RB0LB_1RB1RA" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +open Counter +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 2000000 +variable {α β γ : Type*} [Inhabited α] [Inhabited β] [Inhabited γ] + +namespace Solution +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 2000000 +set_option linter.dupNamespace false +set_option linter.deprecated false +set_option maxHeartbeats 2000000 + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] +variable {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 + +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +set_option maxHeartbeats 2000000 +set_option maxRecDepth 2000000 +@[simp] theorem zMz (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 0 = some config := rfl +@[simp] theorem zMo (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 1 = step M config := rfl +@[simp] theorem zMs (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem zDh : (default : HalfTape).head = 0 := rfl +@[simp] theorem zDt : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem zPs {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem zPt {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,by omega,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ +theorem refl_star (c : Cfg (Fin 2) (Fin 6)) : c [target_tm]⊢* c := ⟨0, rfl⟩ +theorem step_L_p {q q' : Fin 6} {s a b : Fin 2} {l r : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q s = some (some q', Stmt.write a Dir.left)) + (h : ⟨some q', ⟨b, l, a >> r⟩⟩ [target_tm]⊢* ce) : + ⟨some q, ⟨s, b >> l, r⟩⟩ [target_tm]⊢⁺ ce := by + refine z03 ?_ h; simp only [step, ht, Option.map, Tape.write, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] +theorem step_L0_p {q q' : Fin 6} {s a : Fin 2} {r : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q s = some (some q', Stmt.write a Dir.left)) + (h : ⟨some q', ⟨0, default, a >> r⟩⟩ [target_tm]⊢* ce) : + ⟨some q, ⟨s, default, r⟩⟩ [target_tm]⊢⁺ ce := by + rw [← z00]; exact step_L_p ht h +theorem step_R_p {q0 q1 : Fin 6} {s a b : Fin 2} {l r : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q0 s = some (some q1, Stmt.write a Dir.right)) + (h : ⟨some q1, ⟨b, a >> l, r⟩⟩ [target_tm]⊢* ce) : + ⟨some q0, ⟨s, l, b >> r⟩⟩ [target_tm]⊢⁺ ce := by + refine z03 ?_ h; simp only [step, ht, Option.map, Tape.write, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] +theorem step_R0_p {q0 q1 : Fin 6} {s a : Fin 2} {l : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q0 s = some (some q1, Stmt.write a Dir.right)) + (h : ⟨some q1, ⟨0, a >> l, default⟩⟩ [target_tm]⊢* ce) : + ⟨some q0, ⟨s, l, default⟩⟩ [target_tm]⊢⁺ ce := by + rw [← z00]; exact step_R_p ht h +theorem step_L_s {q q' : Fin 6} {s a b : Fin 2} {l r : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q s = some (some q', Stmt.write a Dir.left)) + (h : ⟨some q', ⟨b, l, a >> r⟩⟩ [target_tm]⊢* ce) : + ⟨some q, ⟨s, b >> l, r⟩⟩ [target_tm]⊢* ce := zPs (step_L_p ht h) +theorem step_L0_s {q q' : Fin 6} {s a : Fin 2} {r : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q s = some (some q', Stmt.write a Dir.left)) + (h : ⟨some q', ⟨0, default, a >> r⟩⟩ [target_tm]⊢* ce) : + ⟨some q, ⟨s, default, r⟩⟩ [target_tm]⊢* ce := zPs (step_L0_p ht h) +theorem step_R_s {q0 q1 : Fin 6} {s a b : Fin 2} {l r : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q0 s = some (some q1, Stmt.write a Dir.right)) + (h : ⟨some q1, ⟨b, a >> l, r⟩⟩ [target_tm]⊢* ce) : + ⟨some q0, ⟨s, l, b >> r⟩⟩ [target_tm]⊢* ce := zPs (step_R_p ht h) +theorem step_R0_s {q0 q1 : Fin 6} {s a : Fin 2} {l : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q0 s = some (some q1, Stmt.write a Dir.right)) + (h : ⟨some q1, ⟨0, a >> l, default⟩⟩ [target_tm]⊢* ce) : + ⟨some q0, ⟨s, l, default⟩⟩ [target_tm]⊢* ce := zPs (step_R0_p ht h) +local macro "finish" : tactic => + `(tactic| exact refl_star _) +local macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons,zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move,Turing.ListBlank.head_cons,Turing.ListBlank.tail_cons,Tape.write,z00,zDh,zDt]) +theorem step_Lg_p {q q' : Fin 6} {s a : Fin 2} {l r : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q s = some (some q', Stmt.write a Dir.left)) + (h : ⟨some q', ⟨l.head, l.tail, a >> r⟩⟩ [target_tm]⊢* ce) : + ⟨some q, ⟨s, l, r⟩⟩ [target_tm]⊢⁺ ce := z03 (by rw [step, ht]; rfl) h +theorem step_Rg_p {q0 q1 : Fin 6} {s a : Fin 2} {l r : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q0 s = some (some q1, Stmt.write a Dir.right)) + (h : ⟨some q1, ⟨r.head, a >> l, r.tail⟩⟩ [target_tm]⊢* ce) : + ⟨some q0, ⟨s, l, r⟩⟩ [target_tm]⊢⁺ ce := z03 (by rw [step, ht]; rfl) h +theorem step_Lg_s {q q' : Fin 6} {s a : Fin 2} {l r : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q s = some (some q', Stmt.write a Dir.left)) + (h : ⟨some q', ⟨l.head, l.tail, a >> r⟩⟩ [target_tm]⊢* ce) : + ⟨some q, ⟨s, l, r⟩⟩ [target_tm]⊢* ce := zPs (step_Lg_p ht h) +theorem step_Rg_s {q0 q1 : Fin 6} {s a : Fin 2} {l r : HalfTape} {ce : Cfg (Fin 2) (Fin 6)} + (ht : target_tm q0 s = some (some q1, Stmt.write a Dir.right)) + (h : ⟨some q1, ⟨r.head, a >> l, r.tail⟩⟩ [target_tm]⊢* ce) : + ⟨some q0, ⟨s, l, r⟩⟩ [target_tm]⊢* ce := zPs (step_Rg_p ht h) +local macro "fast_step" : tactic => + `(tactic| ( + first + | refine step_R_s rfl ?_ + | refine step_L_s rfl ?_ + | refine step_R0_s rfl ?_ + | refine step_L0_s rfl ?_ + | refine step_Rg_s rfl ?_ + | refine step_Lg_s rfl ?_ + | refine step_R_p rfl ?_ + | refine step_L_p rfl ?_ + | refine step_R0_p rfl ?_ + | refine step_L0_p rfl ?_ + | refine step_Rg_p rfl ?_ + | refine step_Lg_p rfl ?_ + | step) <;> try rw [z00]) +local macro "execute" : tactic => + `(tactic| ( + simp only [Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, zDh, zDt, z00]; + repeat (first | finish | fast_step))) +abbrev t : BitWord := [1,1,0,0] +abbrev d0 : BitWord := [0,0] +abbrev d1 : BitWord := [1,0] +abbrev one : BitWord := [1] +abbrev lh : HalfTape := (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default +abbrev w_pre : BitWord := t ++ one +@[simp] theorem zDd : d0 +> (default : HalfTape) = default := by + simp [d0] +inductive Call where + | ch + | cj + | cp + | ca +def zCs : Call -> Fin 6 + | .ch => C + | .cj => B + | .cp => B + | .ca => C +def zCw : Call -> BitWord + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] + | .ca => [1,1,1,0,1,0] +def zCR (l : HalfTape) (c : Call) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + ((l <+ zCw c) {{zCs c}}> r) +def zCL (l : HalfTape) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + (l <{{D}} ([0] +> r)) +abbrev w_init : BitWord := t ++ (t ++ one) +def zCf (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + zCL lh (w_init +> r) +def z04 (c : Call) (r1 r2 : HalfTape) : Prop := + ∀ l,(zCR l c r1) [target_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> HalfTape -> HalfTape -> Prop where + | nil (r : HalfTape) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : HalfTape} : + z04 c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[simp] theorem z05 {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem z06 {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem z07 {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z08 {ls1 ls2 : List Call} {r1 r2 r3 : HalfTape} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z09 {ls1 ls2 : List Call} {r1 r3 : HalfTape} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0a (w : BitWord) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem z0b (ls : List Call) : Seg ls ls [] [] := by + intro r1 r2 h; exact h +theorem zSc {ls1 ls2 : List Call} {w1 w2 : BitWord} {r1 r2 : HalfTape} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases z09 h with ⟨r2,ha,hb⟩ + exact z08 (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS0 {ls1 ls2 ls3 : List Call} {w1 w2 v1 v2 : BitWord} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls2 ls3 v1 v2) : + Seg ls1 ls3 (w1 ++ v1) (w2 ++ v2) := by + intro r1 r2 h + rw [append_assoc,append_assoc] + exact h1 (v1 +> r1) (v2 +> r2) (h2 r1 r2 h) +theorem zS4 {c : Call} {w1 w2 : BitWord} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc1,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc1 (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [target_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [target_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [target_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem z0c : Seg [.cp] [.ch] t (t ++ [0]) := + zS2 (mid := [1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0d : Seg [.cj] [.ch] t (t ++ one) := + zS2 (mid := [1,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0e : Seg [.ch] [.cj] (t ++ [0]) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0f : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0g : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0h : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1 d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0i : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0j : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0k : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0l : Seg [.cj] [.cp] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons,append_nil]; execute) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem H_T (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact z0a t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [zLp,h_eq,z07] + exact zSg z0f ih +theorem zSa {w2 : BitWord} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact z0a w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq,z07,zLp] + exact zSg hw ih +theorem z0m : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0n : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem z0o (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d0 d0 := + zSa z0m n +theorem z0p (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ n) d0 d1 := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg zH0 (zSa z0n n) +theorem z0q (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d1 d1 := + zSa z0n n +theorem z0r (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ (1 + n)) d1 d0 := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg zH4 (zSa z0m n) +theorem z0s (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0c z0e) (H_T n) +theorem z0t (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n)) ([.ch,.cj] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0d zH2) (H_T n) +theorem z0u (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [zLp',List.cons_append,List.nil_append] using + zSg (zSg z0g zH2) (H_T n) +theorem z0v (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0h (H_T n) +theorem z0w (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0i (H_T n) +theorem z0x (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [zLp',List.cons_append,List.nil_append] using zSg z0j (H_T n) +theorem z0y (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0k (zSg zH1 zH3) + have h1 := zSg h0 (zSa z0m n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0z (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0l (zSa z0m n) +theorem z0A : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0k zH1 +theorem z0B (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0k (zSg zH1 (zSg zH3 zH0)) + have h1 := zSg h0 (zSa z0n n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using h1 +theorem z0C (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg [.cj,.ch] [.cp] d1 d1 := zSg z0l zH0 + have h1 := zSg h0 (zSa z0n n) + simpa only [zLp',List.cons_append,List.nil_append] using h1 +theorem z0D : Side [.ch] default (d1 +> default) := by + refine Side.cons (fun l => ?_) (Side.nil _) + unfold zCR zCL zCw zCs d1 + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute +theorem z0E : Seg [.ca] [.ch,.ch] t ((t ++ [0]) ++ t) := + zS5 + (mid1 := [1,0,1,1,1,1,0,1,0]) + (mid2 := [1,0,1,0,1,1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0F : Seg [.ca,.ch] ([.cj] ++ [.ch] ^ 5) w_init (w_init ++ t) := by + have h1a : Seg [.ch,.ch] [.cj,.ch,.ch,.ch] (t ++ one) t := + zSg zH2 z0f + have h1 : Seg [.ca] [.cj,.ch,.ch,.ch] (t ++ (t ++ one)) (((t ++ [0]) ++ t) ++ t) := + zS0 z0E h1a + have h2 : Seg [.ch] [.ch,.ch] (((t ++ [0]) ++ t) ++ t) ((t ++ (t ++ one)) ++ t) := + zS0 (zS0 z0e z0d) z0f + exact zSg h1 h2 +theorem z0G (r : HalfTape) : + (zCL lh r) [target_tm]⊢⁺ (zCR ([1] +> default) .ca r) := by + unfold zCL zCR lh zCw zCs + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute +theorem z0H (r : HalfTape) : + (zCL ([1] +> default) r) [target_tm]⊢⁺ (zCR lh .ch r) := by + unfold zCL zCR lh zCw zCs + simp only [List.cons_append,List.nil_append,append_cons,append_nil,z00] + execute +open WordCalculus Word +local notation "WordList" => List Word +theorem loc_z1L {n : Nat} {ds : WordList} {A H B : Nat} + (hD : DigitVal A H ds) (hSum : A + n = B + 2 ^ H) (hBound : B < 2 ^ H) : + ∃ v,DigitVal B H v /\ WordEffect n (ds ++ [Q]) 1 (v ++ [K]) := by + rcases exists_wordEffect ds n with ⟨b,v,hE⟩ + rcases wordEffect_digitVal hE hD with ⟨C,hV,hEq⟩ + have hCb := lt_pow_of_digitVal hV + have hb1 : b = 1 := by + rcases b with _ | _ | b' + · omega + · rfl + · rw [Nat.add_mul,Nat.add_mul,Nat.one_mul] at hEq + omega + subst hb1 + have hCB : C = B := by omega + subst hCB + exact ⟨v,hV,wordEffect_append hE (@WordEffect.d11 0 [] 1 [] (WordEffect.nil 1))⟩ +theorem loc_z1M {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ((1 + n : Nat) : Rat) <= ((1 + b : Nat) : Rat) * wordScale u /\ + ((1 + b : Nat) : Rat) * wordScale u <= ((1 + n : Nat) : Rat) + 2 * wordMass u := by + have hBud := wordEffect_budget_eq hI + have hW := wordEffect_preserves_scale_and_mass hI + have hSu := wordMass_eq_add u + have hSv := wordMass_eq_add v + have hNu := wordMass_nonneg u + have hNv := wordMass_nonneg v + refine ⟨by linarith,by linarith⟩ +theorem loc_z1N (u : WordList) (A H : Nat) (ds : WordList) + (hD : DigitVal A H ds) + (hHeight : wordScale u * ((2 ^ H : Nat) : Rat) = 1) + (hCut : notEndsWithQ u = true) + (hNe : u ≠ []) + (hBound : wordMass u + wordScale u * (1 + wordMassK ds) <= 1 / 128) : + ∃ k v a b,PhaseScan 12 (u ++ ds ++ [K]) k v a b /\ 4 < k := by + have hWu := wordMass_nonneg u + have hWd := wordMass_nonneg ds + have hSu := wordScale_pos u + have hEx_in : 8 * wordMass u < ((6 * 2 : Nat) : Rat) - 4 := by + push_cast; nlinarith + rcases exists_phaseScan_of_mass_lt u 6 hEx_in with ⟨k,v,a,b,hI,hK⟩ + rcases phaseScan_even_out_of_notEndsWithQ hI hCut hNe with ⟨n,rfl⟩ + have hBudget := phaseScan_budget_eq hI + have hLoss := phaseScan_loss_bounds hI + have hSv := phaseScan_scale_le hI + have hPv := wordScale_pos v + have hCarry : 7 < (((n * 2 : Nat) : Rat) - 4) * wordScale v := by + push_cast at hBudget ⊢; nlinarith + rcases digitVal_scale_and_mass hD with ⟨hSd,hMd,_⟩ + have hRest : 2 * (wordMass (ds ++ [K]) + wordMassK (ds ++ [K])) * wordScale v < 7 := by + rw [wordMass_append,wordMassK_append] + dsimp [wordMass,wordMassK] + have h1 : wordScale u * wordMassK ds <= 1 / 128 := by nlinarith + have h2 : wordScale u * wordScale ds = 1 := by rwa [hSd] + have h3 : wordScale v * wordScale ds <= 1 := by nlinarith + have h4 : wordScale v * wordMass ds <= 1 := by nlinarith + have h5 : wordScale v * wordMassK ds <= 1 / 128 := by nlinarith + nlinarith + have hTail1 : 2 * (wordMass (ds ++ [K]) + wordMassK (ds ++ [K])) < ((n * 2 : Nat) : Rat) := by + nlinarith + have hTail2 : 8 * (1 + 2 * wordMassK ds) < ((n * 2 : Nat) : Rat) - 4 := by + have h1 : wordScale v * wordMassK ds <= 1 / 128 := by nlinarith + have h2 : 8 * (1 + 2 * wordMassK ds) * wordScale v < 1 := by nlinarith + nlinarith + rcases scan_tailDefect_step_bound (ds ++ [K]) (wordMassK ds) n (tailDefect_append_K_of_digitVal hD) hTail1 hTail2 + with ⟨k',w,c,d,hJ,hK'⟩ + rcases phaseScan_append hI hJ with ⟨a',b',hIJ,_,_⟩ + refine ⟨k',v ++ w,a',b',?_,hK'⟩ + simpa [List.append_assoc] using hIJ +theorem loc_z1O (n : Nat) : (0 : Rat) < ((2 ^ n : Nat) : Rat) := by + exact_mod_cast pow_two_pos n +theorem loc_z1P (n : Nat) : + wordMass (List.replicate n V) = 0 /\ + wordScale (List.replicate n V) * ((2 ^ n : Nat) : Rat) = 1 := by + induction n with + | zero => simp [wordMass,wordScale] + | succ n ih => + dsimp [List.replicate,wordMass,wordScale] + refine ⟨by linarith [ih.1],?_⟩ + have hpow : ((2 ^ (n + 1) : Nat) : Rat) = ((2 ^ n : Nat) : Rat) * 2 := by + rw [Nat.pow_succ]; push_cast; ring + rw [hpow] + linarith [ih.2] +theorem loc_z1Q (n : Nat) (x : Rat) : + wordScale (List.replicate n V) * x * ((2 ^ n : Nat) : Rat) = x := by + have h := (loc_z1P n).2 + calc wordScale (List.replicate n V) * x * ((2 ^ n : Nat) : Rat) + _ = x * (wordScale (List.replicate n V) * ((2 ^ n : Nat) : Rat)) := by ring + _ = x * 1 := by rw [h] + _ = x := by ring +theorem loc_z1R {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) : + ∀ (p q : WordList),u = p ++ q -> SplitCond p q -> + ∃ c x y s t0,Scan a p c x s /\ Scan c q b y t0 /\ + v = x ++ y /\ l = s + wordScale x * t0 := by + induction h with + | nil k => + intro p q hE _ + cases p with + | nil => + simp at hE; subst hE + exact ⟨k,[],[],0,0,Scan.nil k,Scan.nil k,rfl,by simp [wordScale]⟩ + | cons _ _ => simp at hE + | T hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,_,Scan.nil _,Scan.T hI,rfl,by simp [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + rcases ih p q hE (splitCond_of_cons V p q hP) with ⟨c,x,y,s1,t1,hJ,hK,rfl,hL⟩ + exact ⟨c,V :: x,y,s1 * (1 / 2),t1,Scan.T hJ,hK,rfl,by dsimp [wordScale]; rw [hL]; ring⟩ + | pair0 hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,_,Scan.nil _,Scan.pair0 hI,rfl,by simp [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + cases p with + | nil => + simp at hE; subst hE + rcases hP with hP | ⟨r,hP⟩ <;> nomatch hP + | cons s2 p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + have hP' := splitCond_of_cons K p q (splitCond_of_cons Q (K :: p) q hP) + rcases ih p q hE hP' with ⟨c,x,y,s1,t1,hJ,hK,rfl,hL⟩ + exact ⟨c,V :: x,y,(1 + s1) * (1 / 2),t1,Scan.pair0 hJ,hK,rfl,by dsimp [wordScale]; rw [hL]; ring⟩ + | pair1 hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,_,Scan.nil _,Scan.pair1 hI,rfl,by simp [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + cases p with + | nil => + simp at hE; subst hE + rcases hP with hP | ⟨r,hP⟩ <;> nomatch hP + | cons s2 p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + have hP' := splitCond_of_cons Q p q (splitCond_of_cons Q (Q :: p) q hP) + rcases ih p q hE hP' with ⟨c,x,y,s1,t1,hJ,hK,rfl,hL⟩ + exact ⟨c,V :: x,y,(1 / 4) + s1 * (1 / 2),t1,Scan.pair1 hJ,hK,rfl,by dsimp [wordScale]; rw [hL]; ring⟩ + | short00 hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,_,Scan.nil _,Scan.short00 hI,rfl,by simp [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + rcases ih p q hE (splitCond_of_cons K p q hP) with ⟨c,x,y,s1,t1,hJ,hK,rfl,hL⟩ + exact ⟨c,K :: x,y,1 + s1 * 2,t1,Scan.short00 hJ,hK,rfl,by dsimp [wordScale]; rw [hL]; ring⟩ + | short01 hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,_,Scan.nil _,Scan.short01 hI,rfl,by simp [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + rcases ih p q hE (splitCond_of_cons Q p q hP) with ⟨c,x,y,s1,t1,hJ,hK,rfl,hL⟩ + exact ⟨c,K :: x,y,s1 * 2,t1,Scan.short01 hJ,hK,rfl,by dsimp [wordScale]; rw [hL]; ring⟩ + | short10 hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,_,Scan.nil _,Scan.short10 hI,rfl,by simp [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + rcases ih p q hE (splitCond_of_cons K p q hP) with ⟨c,x,y,s1,t1,hJ,hK,rfl,hL⟩ + exact ⟨c,Q :: x,y,1 + s1 * 2,t1,Scan.short10 hJ,hK,rfl,by dsimp [wordScale]; rw [hL]; ring⟩ + | short11 hI ih => + intro p q hE hP + cases p with + | nil => + simp at hE; subst hE + exact ⟨_,[],_,0,_,Scan.nil _,Scan.short11 hI,rfl,by simp [wordScale]⟩ + | cons s p => + simp at hE; rcases hE with ⟨rfl,hE⟩ + rcases ih p q hE (splitCond_of_cons Q p q hP) with ⟨c,x,y,s1,t1,hJ,hK,rfl,hL⟩ + exact ⟨c,Q :: x,y,s1 * 2,t1,Scan.short11 hJ,hK,rfl,by dsimp [wordScale]; rw [hL]; ring⟩ +theorem loc_z1S (r a b : Nat) (v : WordList) (l : Rat) (u : WordList) (z : Rat) + (hI : Scan a ((List.replicate (1 + r * 2) Q ++ [K]) ++ u) b v l) + (hZ : TailDefect u z) : + wordMass v * ((2 ^ (1 + r) : Nat) : Rat) <= 1 + 2 * z /\ + (l - 1 / 2) * ((2 ^ (1 + r) : Nat) : Rat) <= 1 + 2 * z := by + have hCut : SplitCond (List.replicate (1 + r * 2) Q ++ [K]) u := by + left; rw [notEndsWithQ_append_singleton]; rfl + rcases loc_z1R hI (List.replicate (1 + r * 2) Q ++ [K]) u rfl hCut + with ⟨c,x,y,s,t0,hJ,hK,rfl,hL⟩ + rcases scan_odd_Q_K_inv r a c x s hJ with ⟨rfl,_,rfl⟩ + rcases scan_tailDefect_bound hK hZ with ⟨hMy,hLy,_⟩ + rcases loc_z1P (1 + r) with ⟨hMx,hSx⟩ + have hF1 := loc_z1Q (1 + r) (wordMass y) + have hF2 := loc_z1Q (1 + r) t0 + have hPos := loc_z1O (1 + r) + rw [wordMass_append] + refine ⟨by nlinarith,by nlinarith⟩ +theorem loc_z1T (r a b : Nat) (v : WordList) (l : Rat) (u : WordList) (z : Rat) + (hI : Scan a ((List.replicate (2 + r * 2) Q ++ [K]) ++ u) b v l) + (hZ : TailDefect u z) : + (wordMass v - 1) * ((2 ^ r : Nat) : Rat) <= 1 + 2 * z /\ + (l - 1) * ((2 ^ r : Nat) : Rat) <= 1 + 2 * z := by + have hCut : SplitCond (List.replicate (2 + r * 2) Q ++ [K]) u := by + left; rw [notEndsWithQ_append_singleton]; rfl + rcases loc_z1R hI (List.replicate (2 + r * 2) Q ++ [K]) u rfl hCut + with ⟨c,x,y,s,t0,hJ,hK,rfl,hL⟩ + rcases scan_even_Q_K_inv r a c x s hJ with ⟨d,n,rfl,_,rfl⟩ + rcases scan_tailDefect_bound hK hZ with ⟨hMy,hLy,_⟩ + rcases loc_z1P (1 + r) with ⟨hMx,hSx⟩ + have hF1 := loc_z1Q (1 + r) (wordMass y) + have hF2 := loc_z1Q (1 + r) t0 + have hPos := loc_z1O r + have hWy := wordMass_nonneg y + have hPow1 : ((2 ^ (1 + r) : Nat) : Rat) = 2 * ((2 ^ r : Nat) : Rat) := by + rw [pow_two_one_add]; push_cast; ring + cases d <;> ( + dsimp [List.cons_append,wordMass,wordScale] at hL ⊢ + rw [wordMass_append] + rw [hPow1] at hF1 hF2 + refine ⟨by nlinarith,by nlinarith⟩ + ) +theorem loc_z1U (c a b : Nat) (v : WordList) (l : Rat) (u : WordList) (z : Rat) + (hI : Scan a ((List.replicate c Q ++ [K]) ++ u) b v l) + (hZ : TailDefect u z) (hC : 0 < c) : + wordMass v * ((2 ^ (c + c / 2) : Nat) : Rat) <= ((2 ^ (c + c / 2) : Nat) : Rat) + 2 * ((2 ^ c : Nat) : Rat) * (1 + 2 * z) /\ + l * ((2 ^ (c + c / 2) : Nat) : Rat) <= ((2 ^ (c + c / 2) : Nat) : Rat) + 2 * ((2 ^ c : Nat) : Rat) * (1 + 2 * z) := by + have hZn := tailDefect_nonneg hZ + rcases even_or_odd_mul_two c with ⟨a0,rfl⟩ | ⟨a0,rfl⟩ + · cases a0 with + | zero => omega + | succ r => + have heq : (r + 1) * 2 = 2 + r * 2 := by omega + rw [heq] at hI ⊢ + rcases loc_z1T r a b v l u z hI hZ with ⟨hM,hL⟩ + have hP : 2 + r * 2 + (2 + r * 2) / 2 = (2 + r * 2) + r + 1 := by omega + have hPow : ((2 ^ (2 + r * 2 + (2 + r * 2) / 2) : Nat) : Rat) = + ((2 ^ (2 + r * 2) : Nat) : Rat) * ((2 ^ r : Nat) : Rat) * 2 := by + rw [hP,Nat.pow_add,Nat.pow_add] + push_cast; ring + have hp1 := loc_z1O (2 + r * 2) + have hp2 := loc_z1O r + rw [hPow] + refine ⟨by nlinarith,by nlinarith⟩ + · rcases loc_z1S a0 a b v l u z hI hZ with ⟨hM,hL⟩ + have hP : 1 + a0 * 2 + (1 + a0 * 2) / 2 = (1 + a0 * 2) + a0 := by omega + have hPow : ((2 ^ (1 + a0 * 2 + (1 + a0 * 2) / 2) : Nat) : Rat) = + ((2 ^ (1 + a0 * 2) : Nat) : Rat) * ((2 ^ a0 : Nat) : Rat) := by + rw [hP,Nat.pow_add]; push_cast; ring + have hPow1 : ((2 ^ (1 + a0) : Nat) : Rat) = 2 * ((2 ^ a0 : Nat) : Rat) := by + rw [pow_two_one_add]; push_cast; ring + rw [hPow1] at hM hL + have hp1 := loc_z1O (1 + a0 * 2) + have hp2 := loc_z1O a0 + rw [hPow] + refine ⟨by nlinarith,by nlinarith⟩ +theorem loc_z1V (c : Nat) : + ∀ (u : WordList) (z : Rat),TailDefect (List.replicate c Q ++ u) z -> + ∃ z',TailDefect u z' /\ z = ((2 ^ c : Nat) : Rat) * z' := by + induction c with + | zero => + intro u z hI + exact ⟨z,hI,by simp⟩ + | succ c ih => + intro u z hI + dsimp [List.replicate] at hI + rcases tailDefect_cons_Q_inv hI with ⟨y,hJ,rfl⟩ + rcases ih u y hJ with ⟨x,hK,rfl⟩ + refine ⟨x,hK,?_⟩ + rw [Nat.pow_succ]; push_cast; ring +theorem loc_z1W (x z p q : Rat) (hp : 0 < p) (hpq : p <= q) (hz : 0 <= z) + (h : x * q <= q + 2 * z) : x * p <= p + 2 * z := by + rcases le_or_gt x 1 with hle | hgt + · nlinarith + · nlinarith +theorem loc_z1X (s c : Nat) (u : WordList) (A H a b : Nat) (v : WordList) (l : Rat) + (hD : DigitVal A H (List.replicate c Q ++ K :: u)) + (hI : Scan a ((List.replicate c Q ++ K :: u) ++ [K]) b v l) + (hC : 0 < c) (hSC : s <= c) : + wordMass v * ((2 ^ (s + s / 2) : Nat) : Rat) <= ((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK (List.replicate c Q ++ K :: u) /\ + l * ((2 ^ (s + s / 2) : Nat) : Rat) <= ((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK (List.replicate c Q ++ K :: u) := by + have hZ := tailDefect_append_K_of_digitVal hD + rw [List.append_assoc] at hZ + rcases loc_z1V c (K :: u ++ [K]) (wordMassK (List.replicate c Q ++ K :: u)) hZ with ⟨x,hU,hX⟩ + rcases tailDefect_cons_K_inv hU with ⟨hNil,_⟩ | ⟨z,hV,rfl⟩ + · simp at hNil + · have hE : (List.replicate c Q ++ K :: u) ++ [K] = + (List.replicate c Q ++ [K]) ++ (u ++ [K]) := by + simp [List.append_assoc] + rw [hE] at hI + rcases loc_z1U c a b v l (u ++ [K]) z hI hV hC with ⟨hM,hL⟩ + have hPos := loc_z1O (s + s / 2) + have hMono_nat : 2 ^ (s + s / 2) <= 2 ^ (c + c / 2) := + Nat.pow_le_pow_right (by decide) (by omega) + have hMono : ((2 ^ (s + s / 2) : Nat) : Rat) <= ((2 ^ (c + c / 2) : Nat) : Rat) := by + exact_mod_cast hMono_nat + have hW := (wordMass_nonneg (List.replicate c Q ++ K :: u)).2.1 + refine ⟨loc_z1W (wordMass v) (wordMassK (List.replicate c Q ++ K :: u)) _ _ hPos hMono hW (by linarith), + loc_z1W l (wordMassK (List.replicate c Q ++ K :: u)) _ _ hPos hMono hW (by linarith)⟩ +theorem loc_z1Y (s : Nat) (ds : WordList) (A H k k' : Nat) (v : WordList) (a b : Rat) + (hD : DigitVal A H ds) + (hI : PhaseScan k (ds ++ [K]) k' v a b) + (hLow : ∃ c u,(0 < c /\ s <= c) /\ ds = List.replicate c Q ++ K :: u) : + wordMass v * ((2 ^ (s + s / 2) : Nat) : Rat) <= ((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK ds /\ + a * ((2 ^ (s + s / 2) : Nat) : Rat) <= 4 * (((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK ds) /\ + b * ((2 ^ (s + s / 2) : Nat) : Rat) <= 3 * (((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK ds) := by + rcases hLow with ⟨c,u,⟨hC,hSC⟩,rfl⟩ + have hFull := digitVal_append hD (DigitVal.zero DigitVal.nil) + rcases phaseScan_digitVal_loss_bound hI hFull with ⟨l,hJ,hP,hN⟩ + rcases loc_z1X s c u A H k k' v l hD hJ hC hSC with ⟨hM,hL⟩ + have hPos := loc_z1O (s + s / 2) + refine ⟨hM,by nlinarith,by nlinarith⟩ +theorem loc_z1Z (r J k b A B : Nat) + (hR : r <= J) + (hK : ∃ n,k = n * 2 ^ r) + (hB : ∃ n,1 + b = n * 2 ^ r) + (hAsum : A + 2 ^ J = k) + (hBsum : B + 2 ^ J = A + b) : + ∃ n,1 + B = n * 2 ^ r := by + rcases hK with ⟨n,rfl⟩ + rcases hB with ⟨m,hM⟩ + have hP : 2 ^ J = 2 ^ (J - r) * 2 ^ r := by + rw [<- Nat.pow_add,Nat.sub_add_cancel hR] + refine ⟨n + m - 2 * 2 ^ (J - r),?_⟩ + rw [Nat.sub_mul,Nat.add_mul] + have h2 : 2 * 2 ^ (J - r) * 2 ^ r = 2 ^ J + 2 ^ J := by + calc 2 * 2 ^ (J - r) * 2 ^ r + _ = 2 * (2 ^ (J - r) * 2 ^ r) := by ring + _ = 2 * 2 ^ J := by rw [<- hP] + _ = 2 ^ J + 2 ^ J := by ring + omega +theorem loc_z20 (s : Nat) : + ∀ (B H : Nat) (ds : WordList), + DigitVal B H ds -> s <= H -> (∃ n,1 + B = n * 2 ^ s) -> + ∃ u,ds = List.replicate s Q ++ u := by + induction s with + | zero => + intro B H ds _ _ _ + exact ⟨ds,rfl⟩ + | succ s ih => + intro B H ds hD hSH ⟨n,hN⟩ + have hN2 : 1 + B = (n * 2 ^ s) * 2 := by rw [Nat.pow_succ] at hN; linarith + cases hD with + | nil => omega + | zero _ => omega + | @one A' H' u' hSub => + rcases ih A' H' u' hSub (by omega) ⟨n,by omega⟩ with ⟨w,rfl⟩ + exact ⟨w,rfl⟩ +theorem loc_z21 (p : Nat) : + ∀ (n : Nat) (u : WordList) (b : Nat) (v : WordList), + WordEffect n (List.replicate p V ++ u) b v -> + ∃ q w,v = List.replicate p V ++ w /\ 1 + q = (1 + n) * 2 ^ p /\ WordEffect q u b w := by + induction p with + | zero => + intro n u b v hI + exact ⟨n,v,rfl,by simp,hI⟩ + | succ p ih => + intro n u b v hI + dsimp [List.replicate] at hI + cases hI with + | T hSub => + rcases ih (1 + n * 2) u b _ hSub with ⟨q,w,rfl,hEq,hJ⟩ + refine ⟨q,w,rfl,?_,hJ⟩ + rw [Nat.pow_succ]; ring_nf at hEq ⊢; omega +theorem loc_z22 (n : Nat) (w : Word) : + List.replicate (1 + n) w = w :: List.replicate n w := by + rw [Nat.add_comm 1 n,List.replicate_succ] +theorem loc_z23 (p : Nat) (u : WordList) (b : Nat) (v : WordList) + (hI : WordEffect 0 (List.replicate (1 + p) V ++ Q :: u) b v) : + ∃ w,v = List.replicate (1 + p) V ++ K :: w /\ WordEffect (2 ^ p) u b w := by + rcases loc_z21 (1 + p) 0 (Q :: u) b v hI with ⟨q,w0,rfl,hEq,hJ⟩ + have hp := pow_two_pos p + have hpow : 2 ^ (1 + p) = 2 ^ p + 2 ^ p := pow_two_one_add p + generalize hq0 : q = q0 at hJ + generalize hu0 : Q :: u = u0 at hJ + cases hJ with + | nil _ => nomatch hu0 + | T _ => nomatch hu0 + | d00 _ => nomatch hu0 + | d01 _ => nomatch hu0 + | d10 _ => omega + | @d11 m u' _ w hSub => + injection hu0 with _ hu'; subst hu' + have hm : 1 + m = 2 ^ p := by omega + rw [hm] at hSub + exact ⟨w,rfl,hSub⟩ +theorem loc_z24 (p : Nat) (u : WordList) (k : Nat) (v : WordList) (a b : Rat) + (hI : PhaseScan 12 (List.replicate p V ++ K :: u) k v a b) : + ∃ w a' b',v = List.replicate p V ++ Q :: w /\ + PhaseScan (4 * 2 ^ p) u k w a' b' /\ + a = wordScale (List.replicate p V) * (4 + 2 * a') /\ + b = wordScale (List.replicate p V) * (2 * b') := by + rcases phaseScan_split_of_splitCond hI (List.replicate p V) (K :: u) rfl (Or.inl (notEndsWithQ_replicate_V p)) + with ⟨m,x,y,a1,b1,a2,b2,hJ,hK,rfl,hA,hB⟩ + rcases phaseScan_replicate_V_inv p 12 m x a1 b1 hJ with ⟨rfl,hEq,rfl,rfl⟩ + have hp := pow_two_pos p + generalize hm0 : m = m0 at hK + generalize hu0 : K :: u = u0 at hK + cases hK with + | nil _ => nomatch hu0 + | T _ => nomatch hu0 + | pair0 _ => nomatch hu0 + | pair1 _ => nomatch hu0 + | short01 _ => nomatch hu0 + | short11 _ => nomatch hu0 + | short00 _ => omega + | @short10 n u' _ w a' b' hSub => + injection hu0 with _ hu'; subst hu' + have hn : n * 2 = 4 * 2 ^ p := by omega + rw [hn] at hSub + refine ⟨w,a',b',rfl,hSub,by linarith,by linarith⟩ +theorem loc_z25 (r k : Nat) (u : WordList) (k' : Nat) (v : WordList) (a b : Rat) + (carry : Nat) (eff : WordList) (A B J : Nat) (ds : WordList) + (hI : PhaseScan k (u ++ List.replicate (1 + r * 2) Q ++ [K]) k' v a b) + (hE : WordEffect 0 (V :: (v ++ [V])) carry eff) + (hD : DigitVal B J ds) (hR : 1 + r <= J) + (hAsum : A + 2 ^ J = k') (hBsum : B + 2 ^ J = A + carry) : + ∃ w,ds = List.replicate (1 + r) Q ++ w := by + rcases phaseScan_append_odd_Q_K_inv r k u k' v a b hI with ⟨w,n,rfl,hK⟩ + have hEq : V :: ((w ++ List.replicate (1 + r) V) ++ [V]) = + (V :: w) ++ List.replicate (2 + r) V := by + have h1 : 2 + r = (1 + r) + 1 := by omega + rw [h1,replicate_succ_append]; simp [List.append_assoc] + rw [hEq] at hE + rcases wordEffect_append_replicate_V_inv (V :: w) (2 + r) 0 carry eff hE with ⟨x,m,_,hC⟩ + apply loc_z20 (1 + r) B J ds hD hR + refine loc_z1Z (1 + r) J k' carry A B hR ⟨n,hK⟩ ⟨m * 2,?_⟩ hAsum hBsum + have h2 : 2 + r = (1 + r) + 1 := by omega + rw [h2,Nat.pow_succ] at hC + linarith +theorem loc_z26 (x p q s f : Rat) (hp : 0 < p) (hs : 0 <= s) + (h1 : x * p <= q) (h2 : s * q <= f * p) : s * x <= f := by + nlinarith +theorem loc_z27 (s : Nat) (ds : WordList) (A H k k' : Nat) (v : WordList) (a b sigma f : Rat) + (hD : DigitVal A H ds) (hI : PhaseScan k (ds ++ [K]) k' v a b) + (hLow : ∃ c u,(0 < c /\ s <= c) /\ ds = List.replicate c Q ++ K :: u) + (hSig : 0 <= sigma) + (hBound : sigma * (((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK ds) <= f * ((2 ^ (s + s / 2) : Nat) : Rat)) : + sigma * wordMass v <= f /\ sigma * a <= 4 * f /\ sigma * b <= 3 * f := by + rcases loc_z1Y s ds A H k k' v a b hD hI hLow with ⟨hM,hP,hN⟩ + have hPos := loc_z1O (s + s / 2) + refine ⟨loc_z26 (wordMass v) _ _ sigma f hPos hSig hM hBound, + loc_z26 a _ _ sigma (4 * f) hPos hSig hP (by linarith), + loc_z26 b _ _ sigma (3 * f) hPos hSig hN (by linarith)⟩ +theorem le_of_mul_le_mul_pos_right {a b u : Rat} (hu : 0 < u) (h : a * u <= b * u) : a <= b := by + by_contra hlt + have : b < a := not_le.mp hlt + nlinarith +theorem lt_of_mul_lt_mul_pos_right {a b u : Rat} (hu : 0 < u) (h : a * u < b * u) : a < b := by + by_contra hle + have : b <= a := not_lt.mp hle + nlinarith +theorem loc_z28 (a b : Nat) : ((2 ^ (a + b) : Nat) : Rat) = ((2 ^ a : Nat) : Rat) * ((2 ^ b : Nat) : Rat) := by + rw [Nat.pow_add,Nat.cast_mul] +theorem loc_z29 : ((2 ^ 2 : Nat) : Rat) = 4 := by norm_num +theorem loc_z2a : ((2 ^ 10 : Nat) : Rat) = 1024 := by norm_num +theorem loc_z2b (p : Nat) (u ds : WordList) (A H k : Nat) (v : WordList) (a b : Rat) (s : Nat) (e f : Rat) + (hI : PhaseScan 12 (List.replicate p V ++ K :: (u ++ ds ++ [K])) k v a b) + (hD : DigitVal A H ds) (hCut : notEndsWithQ u = true) + (hLow : ∃ c w,(0 < c /\ s <= c) /\ ds = List.replicate c Q ++ K :: w) + (hError : e = 2 * wordScale (List.replicate p V) * wordMass u) + (hBound : (2 * wordScale (List.replicate p V) * wordScale u) * (((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK ds) <= f * ((2 ^ (s + s / 2) : Nat) : Rat)) : + ∃ w,v = List.replicate p V ++ Q :: w /\ + wordMass (V :: (v ++ [V])) <= wordScale (List.replicate p V) * (1 / 2) + (e + f) * (1 / 2) /\ + 4 * wordScale (List.replicate p V) - e * (1 / 4) - 3 * f <= a - b /\ + a - b <= 4 * wordScale (List.replicate p V) + 4 * e + 4 * f := by + rcases loc_z24 p (u ++ ds ++ [K]) k v a b hI with ⟨w,c,d,rfl,hJ,hPos,hNeg⟩ + have hEq_u : u ++ ds ++ [K] = u ++ (ds ++ [K]) := by simp [List.append_assoc] + rw [hEq_u] at hJ + rcases phaseScan_split_of_splitCond hJ u (ds ++ [K]) rfl (Or.inl hCut) + with ⟨m,x,y,a1,b1,a2,b2,hK,hL,rfl,hC,hDlt⟩ + have hBounds := phaseScan_loss_bounds hK + have hTailBounds := phaseScan_loss_bounds hL + have hScale := phaseScan_scale_le hK + have hSu := wordScale_pos u + have hSx := wordScale_pos x + have hSp := wordScale_pos (List.replicate p V) + have hWds := wordMass_nonneg ds + have hPow := loc_z1O (s + s / 2) + have h1 : 2 * wordScale (List.replicate p V) * wordScale x <= 2 * wordScale (List.replicate p V) * wordScale u := by nlinarith + have h2 : 0 <= ((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK ds := by linarith + have hF : (2 * wordScale (List.replicate p V) * wordScale x) * (((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK ds) <= + f * ((2 ^ (s + s / 2) : Nat) : Rat) := by + nlinarith + rcases loc_z27 s ds A H m k y a2 b2 (2 * wordScale (List.replicate p V) * wordScale x) f hD hL hLow (by positivity) hF + with ⟨hMt,hPt,hNt⟩ + have hPa : 0 <= (2 * wordScale (List.replicate p V) * wordScale x) * a2 := by + have : 0 <= a2 := hTailBounds.2.1 + positivity + have hPb : 0 <= (2 * wordScale (List.replicate p V) * wordScale x) * b2 := by + have : 0 <= b2 := hTailBounds.2.2.2.1 + positivity + have hA1 : 0 <= 2 * wordScale (List.replicate p V) * a1 := by + have : 0 <= a1 := hBounds.2.1 + positivity + have hA1u : 2 * wordScale (List.replicate p V) * a1 <= 4 * e := by + have : a1 <= 4 * wordMass u := hBounds.2.2.1 + nlinarith + have hB1 : 0 <= 2 * wordScale (List.replicate p V) * b1 := by + have : 0 <= b1 := hBounds.2.2.2.1 + positivity + have hB1u : 2 * wordScale (List.replicate p V) * b1 <= e * (1 / 4) := by + have : b1 <= wordMass u * (1 / 4) := hBounds.2.2.2.2 + nlinarith + have hMx : 2 * wordScale (List.replicate p V) * wordMass x <= e := by + have : wordMass x <= wordMass u := hBounds.1 + nlinarith + have hMassP := (loc_z1P p).1 + have hAb_eq : a - b = 4 * wordScale (List.replicate p V) + + 2 * wordScale (List.replicate p V) * a1 + + (2 * wordScale (List.replicate p V) * wordScale x) * a2 - + 2 * wordScale (List.replicate p V) * b1 - + (2 * wordScale (List.replicate p V) * wordScale x) * b2 := by + rw [hPos,hNeg,hC,hDlt]; ring + refine ⟨x ++ y,rfl,?_,?_,?_⟩ + · have hE1 : wordMass (V :: ((List.replicate p V ++ Q :: (x ++ y)) ++ [V])) = + wordScale (List.replicate p V) * (1 / 2) + + (2 * wordScale (List.replicate p V) * wordMass x + (2 * wordScale (List.replicate p V) * wordScale x) * wordMass y) * (1 / 2) := by + simp only [List.cons_append,List.append_assoc,wordMass,wordMass_append,wordScale,hMassP] + ring + rw [hE1] + linarith + · rw [hAb_eq]; linarith + · rw [hAb_eq]; linarith +theorem loc_z2c (p : Nat) (u : WordList) (b : Nat) (v : WordList) + (hI : WordEffect 0 (List.replicate (1 + p) V ++ Q :: u) b v) : + 2 * wordScale (List.replicate (1 + p) V) <= + ((1 + b : Nat) : Rat) * wordScale (List.replicate (1 + p) V ++ Q :: u) - 1 /\ + ((1 + b : Nat) : Rat) * wordScale (List.replicate (1 + p) V ++ Q :: u) - 1 <= + 2 * wordMass (List.replicate (1 + p) V ++ Q :: u) := by + rcases loc_z23 p u b v hI with ⟨w,rfl,hE⟩ + rcases loc_z1M hE with ⟨hLo,hHi⟩ + have hSp := wordScale_pos (List.replicate (1 + p) V) + rcases loc_z1P (1 + p) with ⟨hM,hS⟩ + have hS' : wordScale (List.replicate (1 + p) V) * (2 * ((2 ^ p : Nat) : Rat)) = 1 := by + rw [pow_two_one_add,Nat.cast_add] at hS + linarith + have htmp : ((1 + 2 ^ p : Nat) : Rat) = 1 + ((2 ^ p : Nat) : Rat) := by + rw [Nat.cast_add,Nat.cast_one] + rw [htmp] at hLo hHi + have h1 : ((1 + b : Nat) : Rat) * wordScale (List.replicate (1 + p) V ++ Q :: u) = + 2 * wordScale (List.replicate (1 + p) V) * (((1 + b : Nat) : Rat) * wordScale u) := by + rw [wordScale_append]; dsimp [wordScale]; ring + have h2 : 2 * wordMass (List.replicate (1 + p) V ++ Q :: u) = + 2 * wordScale (List.replicate (1 + p) V) * (1 + 2 * wordMass u) := by + rw [wordMass_append,hM]; dsimp [wordMass]; ring + rw [h1,h2] + refine ⟨by nlinarith,by nlinarith⟩ +theorem loc_z2d (alpha e f unit delta R e' : Rat) + (_ : 0 < alpha) (_ : 0 <= e) (_ : 0 <= f) (_ : 0 <= unit) + (_ : e <= alpha * (3 / 64)) (_ : f <= alpha * (1 / 128)) (_ : unit <= alpha * (1 / 1024)) + (_ : 0 <= e') (_ : e' <= (e + f) * (1 / 2)) (_ : alpha <= R) (_ : R <= alpha + 2 * e') + (_ : 4 * alpha - e * (1 / 4) - 3 * f <= delta) (_ : delta <= 4 * alpha + 4 * e + 4 * f) : + (3 / 4) * alpha <= delta * (1 / 2) - 4 * unit - R /\ + delta * (1 / 2) - 4 * unit - R <= (5 / 4) * alpha := by + exact ⟨by linarith,by linarith⟩ +theorem loc_z2e {u : WordList} {k : Nat} {v : WordList} {a b : Rat} + (hI : PhaseScan 12 u k v a b) : + (k : Rat) * wordScale (V :: (v ++ [V])) = + 2 + 4 * wordScale (V :: (v ++ [V])) - (a - b) * (1 / 2) := by + have hEq := phaseScan_budget_eq hI + push_cast at hEq + dsimp [wordScale] + rw [wordScale_append] + dsimp [wordScale] + linarith +theorem loc_z2f {u : WordList} {k : Nat} {v : WordList} {a b : Rat} {J A B carry : Nat} + (hI : PhaseScan 12 u k v a b) + (hHeight : wordScale (V :: (v ++ [V])) * ((2 ^ J : Nat) : Rat) = 1) + (hAsum : A + 2 ^ J = k) + (hBsum : B + 2 ^ J = A + carry) : + 1 - ((1 + B : Nat) : Rat) * wordScale (V :: (v ++ [V])) = + (a - b) * (1 / 2) - 4 * wordScale (V :: (v ++ [V])) - + (((1 + carry : Nat) : Rat) * wordScale (V :: (v ++ [V])) - 1) := by + have hBudget := loc_z2e hI + have hSum : B + 2 ^ J + 2 ^ J = k + carry := by omega + have hQsum : ((B + 2 ^ J + 2 ^ J : Nat) : Rat) = ((k + carry : Nat) : Rat) := by exact_mod_cast hSum + rw [Nat.cast_add,Nat.cast_add,Nat.cast_add] at hQsum + have hQ_u : ((B : Rat) + ((2 ^ J : Nat) : Rat) + ((2 ^ J : Nat) : Rat)) * wordScale (V :: (v ++ [V])) = + ((k : Rat) + (carry : Rat)) * wordScale (V :: (v ++ [V])) := by rw [hQsum] + rw [Nat.cast_add,Nat.cast_one,Nat.cast_add,Nat.cast_one] + linarith +theorem loc_z2g (J k carry : Nat) (alpha unit delta R : Rat) + (hPos : 0 < alpha) (hSmall : alpha <= 1 / 32) (hUnit : 0 < unit) (hTiny : unit <= alpha * (1 / 1024)) + (hHeight : unit * ((2 ^ J : Nat) : Rat) = 1) + (hDl : (15 / 4) * alpha <= delta) (hDu : delta <= (17 / 4) * alpha) + (hRl : alpha <= R) (hRu : R <= (5 / 4) * alpha) + (hK : (k : Rat) * unit = 2 + 4 * unit - delta * (1 / 2)) + (hC : ((1 + carry : Nat) : Rat) * unit = 1 + R) : + ∃ A B,A + 2 ^ J = k /\ B + 2 ^ J = A + carry /\ + 2 ^ J <= A * 2 /\ A < 2 ^ J /\ 2 ^ J <= B * 2 /\ B < 2 ^ J := by + rw [Nat.cast_add,Nat.cast_one] at hC + have hH' : ((2 ^ J : Nat) : Rat) * unit = 1 := by linarith + have hK_u : ((2 ^ J : Nat) : Rat) * unit <= (k : Rat) * unit := by linarith + have hK_q : ((2 ^ J : Nat) : Rat) <= (k : Rat) := le_of_mul_le_mul_pos_right hUnit hK_u + have hKnat : 2 ^ J <= k := by exact_mod_cast hK_q + have hB_u : (((2 ^ J + 2 ^ J : Nat) : Rat)) * unit <= ((k + carry : Nat) : Rat) * unit := by + rw [Nat.cast_add,Nat.cast_add]; linarith + have hB_q : ((2 ^ J + 2 ^ J : Nat) : Rat) <= ((k + carry : Nat) : Rat) := le_of_mul_le_mul_pos_right hUnit hB_u + have hBnat : 2 ^ J + 2 ^ J <= k + carry := by exact_mod_cast hB_q + refine ⟨k - 2 ^ J,k + carry - (2 ^ J + 2 ^ J),by omega,by omega,?_,?_,?_,?_⟩ + · have hq_u : ((2 ^ J : Nat) : Rat) * unit <= (((k - 2 ^ J) * 2 : Nat) : Rat) * unit := by + rw [Nat.cast_mul,Nat.cast_sub hKnat,Nat.cast_ofNat]; linarith + have hq := le_of_mul_le_mul_pos_right hUnit hq_u + exact_mod_cast hq + · have hq_u : ((k - 2 ^ J : Nat) : Rat) * unit < ((2 ^ J : Nat) : Rat) * unit := by + rw [Nat.cast_sub hKnat]; linarith + have hq := lt_of_mul_lt_mul_pos_right hUnit hq_u + exact_mod_cast hq + · have hq_u : ((2 ^ J : Nat) : Rat) * unit <= (((k + carry - (2 ^ J + 2 ^ J)) * 2 : Nat) : Rat) * unit := by + rw [Nat.cast_mul,Nat.cast_sub hBnat,Nat.cast_add,Nat.cast_add,Nat.cast_ofNat]; linarith + have hq := le_of_mul_le_mul_pos_right hUnit hq_u + exact_mod_cast hq + · have hq_u : ((k + carry - (2 ^ J + 2 ^ J) : Nat) : Rat) * unit < ((2 ^ J : Nat) : Rat) * unit := by + rw [Nat.cast_sub hBnat,Nat.cast_add,Nat.cast_add]; linarith + have hq := lt_of_mul_lt_mul_pos_right hUnit hq_u + exact_mod_cast hq +inductive loc_Reserve : Nat -> Rat -> Prop where + | even (n : Nat) (tau : Rat) : tau * ((2 ^ n : Nat) : Rat) = 8 -> loc_Reserve (n * 2) tau + | odd (n : Nat) (tau : Rat) : tau * ((2 ^ n : Nat) : Rat) = 6 -> loc_Reserve (1 + n * 2) tau +theorem loc_z2h {p : Nat} {tau : Rat} (hI : loc_Reserve p tau) : + ∃ tau',loc_Reserve (1 + p) tau' /\ tau' <= (3 / 4) * tau := by + cases hI with + | @even n tau hEq => + exact ⟨(3 / 4) * tau,loc_Reserve.odd n ((3 / 4) * tau) (by linarith),by linarith⟩ + | @odd n tau hEq => + have hpos := loc_z1O n + have htau : 0 <= tau := by nlinarith + refine ⟨(2 / 3) * tau,?_,by linarith⟩ + have heq : 1 + (1 + n * 2) = (1 + n) * 2 := by omega + rw [heq] + refine loc_Reserve.even (1 + n) ((2 / 3) * tau) ?_ + rw [pow_two_one_add,Nat.cast_add]; linarith +theorem loc_z2i {p : Nat} {tau : Rat} (hI : loc_Reserve p tau) (hP : 16 <= p) : + 0 < tau /\ tau <= 1 / 32 := by + cases hI with + | @even n tau hEq => + have hpos := loc_z1O n + have hBound_nat : 2 ^ 8 <= 2 ^ n := Nat.pow_le_pow_right (by decide) (by omega) + have hBound : (256 : Rat) <= ((2 ^ n : Nat) : Rat) := by exact_mod_cast hBound_nat + exact ⟨by nlinarith,by nlinarith⟩ + | @odd n tau hEq => + have hpos := loc_z1O n + have hBound_nat : 2 ^ 8 <= 2 ^ n := Nat.pow_le_pow_right (by decide) (by omega) + have hBound : (256 : Rat) <= ((2 ^ n : Nat) : Rat) := by exact_mod_cast hBound_nat + exact ⟨by nlinarith,by nlinarith⟩ +theorem loc_z2j (p n H s : Nat) + (hN : 8 <= n) (hP : p = n * 2 \/ p = 1 + n * 2) + (hS : s = (p - 2) / 2) (hH : p + p / 2 + 9 <= H) : + 4 * ((2 ^ n : Nat) : Rat) <= ((2 ^ (s + s / 2) : Nat) : Rat) /\ + 4 * ((2 ^ p : Nat) : Rat) * ((2 ^ n : Nat) : Rat) <= ((2 ^ H : Nat) : Rat) := by + refine ⟨?_,?_⟩ + · have hle : 2 ^ (2 + n) <= 2 ^ (s + s / 2) := + Nat.pow_le_pow_right (by decide) (by omega) + have hq : ((2 ^ (2 + n) : Nat) : Rat) <= ((2 ^ (s + s / 2) : Nat) : Rat) := by exact_mod_cast hle + rw [loc_z28 2 n,loc_z29] at hq + linarith + · have hle : 2 ^ (2 + p + n) <= 2 ^ H := + Nat.pow_le_pow_right (by decide) (by omega) + have hq : ((2 ^ (2 + p + n) : Nat) : Rat) <= ((2 ^ H : Nat) : Rat) := by exact_mod_cast hle + rw [loc_z28 (2 + p) n,loc_z28 2 p,loc_z29] at hq + linarith +theorem loc_z2k (alpha unit f t0 q tau : Rat) + (ht0 : 0 < t0) (_ : 0 <= alpha) (_ : 0 <= unit) + (hGap : 4 * t0 * unit <= alpha) (hLow : 4 * t0 <= q) + (hF : f * q <= unit * q + 5 * alpha) (hTau : 6 <= tau * t0) : + f <= alpha * tau * (1 / 4) := by + rcases le_or_gt f unit with hle | hgt + · have h1 : alpha * 6 <= alpha * (tau * t0) := by nlinarith + have h2 : unit * (4 * t0) <= (alpha * tau * (1 / 4)) * (4 * t0) := by linarith + have h3 : unit <= alpha * tau * (1 / 4) := le_of_mul_le_mul_pos_right (by linarith) h2 + linarith + · have h1 : (f - unit) * (4 * t0) <= (f - unit) * q := by nlinarith + have h2 : alpha * 6 <= alpha * (tau * t0) := by nlinarith + have h3 : f * (4 * t0) <= (alpha * tau * (1 / 4)) * (4 * t0) := by linarith + exact le_of_mul_le_mul_pos_right (by linarith) h3 +theorem loc_z2l (t0 q h alpha unit : Rat) + (hQ : 0 < q) (_ : 0 <= unit) + (hAq : alpha * q = 1) (hUh : unit * h = 1) + (hLe : 4 * q * t0 <= h) : + 4 * t0 * unit <= alpha := by + have h1 : (4 * q * t0) * unit <= h * unit := by nlinarith + have h2 : (4 * t0 * unit) * q <= alpha * q := by linarith + exact le_of_mul_le_mul_pos_right hQ h2 +theorem loc_z2m (p H s : Nat) (alpha unit tau f : Rat) + (hI : loc_Reserve p tau) (hP : 16 <= p) (hH : p + p / 2 + 9 <= H) (hS : s = (p - 2) / 2) + (hA : 0 < alpha) (hU : 0 < unit) + (hAp : alpha * ((2 ^ p : Nat) : Rat) = 1) (hUh : unit * ((2 ^ H : Nat) : Rat) = 1) + (hF : f * ((2 ^ (s + s / 2) : Nat) : Rat) <= unit * ((2 ^ (s + s / 2) : Nat) : Rat) + 5 * alpha) : + f <= alpha * tau * (1 / 4) := by + cases hI with + | @even n tau hTau => + rcases loc_z2j (n * 2) n H s (by omega) (Or.inl rfl) hS hH with ⟨hLow,hHigh⟩ + have hpos := loc_z1O n + have hposP := loc_z1O (n * 2) + have hGap := loc_z2l ((2 ^ n : Nat) : Rat) ((2 ^ (n * 2) : Nat) : Rat) ((2 ^ H : Nat) : Rat) + alpha unit hposP (by linarith) hAp hUh (by linarith) + exact loc_z2k alpha unit f ((2 ^ n : Nat) : Rat) ((2 ^ (s + s / 2) : Nat) : Rat) tau + hpos (by linarith) (by linarith) hGap hLow hF (by linarith) + | @odd n tau hTau => + rcases loc_z2j (1 + n * 2) n H s (by omega) (Or.inr rfl) hS hH with ⟨hLow,hHigh⟩ + have hpos := loc_z1O n + have hposP := loc_z1O (1 + n * 2) + have hGap := loc_z2l ((2 ^ n : Nat) : Rat) ((2 ^ (1 + n * 2) : Nat) : Rat) ((2 ^ H : Nat) : Rat) + alpha unit hposP (by linarith) hAp hUh (by linarith) + exact loc_z2k alpha unit f ((2 ^ n : Nat) : Rat) ((2 ^ (s + s / 2) : Nat) : Rat) tau + hpos (by linarith) (by linarith) hGap hLow hF (by linarith) +theorem loc_z2n (p : Nat) (hP : 16 <= p) : + (p + 1) + (p + 1) / 2 + 9 <= 1 + 3 * (((p - 2) / 2 + 1) / 2) + 3 * ((p - 1) / 2) := by + omega +theorem loc_z2o (alpha tau tau' e f e' : Rat) + (_ : 0 <= alpha) (_ : tau' <= (3 / 4) * tau) + (_ : e <= alpha * ((3 / 64) - tau)) (_ : f <= alpha * tau * (1 / 4)) + (_ : e' <= (e + f) * (1 / 2)) : + e' <= (alpha * (1 / 2)) * ((3 / 64) - tau') := by + nlinarith +theorem loc_z2p {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (hI : PhaseScan k u k' v a b) : + ∃ g,wordScale u = wordScale v * ((8 ^ g : Nat) : Rat) /\ u.length = v.length + g := by + induction hI with + | nil _ => exact ⟨0,by simp [wordScale],rfl⟩ + | T _ ih => + rcases ih with ⟨g,hE,hL⟩ + exact ⟨g,by dsimp [wordScale]; rw [hE]; ring,by dsimp; omega⟩ + | pair0 _ ih => + rcases ih with ⟨g,hE,hL⟩ + refine ⟨1 + g,?_,by dsimp; omega⟩ + have h8 : ((8 ^ (1 + g) : Nat) : Rat) = 8 * ((8 ^ g : Nat) : Rat) := by + rw [Nat.add_comm 1 g,Nat.pow_succ]; push_cast; ring + dsimp [wordScale]; rw [h8,hE]; ring + | pair1 _ ih => + rcases ih with ⟨g,hE,hL⟩ + refine ⟨1 + g,?_,by dsimp; omega⟩ + have h8 : ((8 ^ (1 + g) : Nat) : Rat) = 8 * ((8 ^ g : Nat) : Rat) := by + rw [Nat.add_comm 1 g,Nat.pow_succ]; push_cast; ring + dsimp [wordScale]; rw [h8,hE]; ring + | short00 _ ih => + rcases ih with ⟨g,hE,hL⟩ + exact ⟨g,by dsimp [wordScale]; rw [hE]; ring,by dsimp; omega⟩ + | short01 _ ih => + rcases ih with ⟨g,hE,hL⟩ + exact ⟨g,by dsimp [wordScale]; rw [hE]; ring,by dsimp; omega⟩ + | short10 _ ih => + rcases ih with ⟨g,hE,hL⟩ + exact ⟨g,by dsimp [wordScale]; rw [hE]; ring,by dsimp; omega⟩ + | short11 _ ih => + rcases ih with ⟨g,hE,hL⟩ + exact ⟨g,by dsimp [wordScale]; rw [hE]; ring,by dsimp; omega⟩ +theorem loc_z2q {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (hI : PhaseScan k u k' v a b) : v.length <= u.length := by + rcases loc_z2p hI with ⟨g,_,hL⟩ + omega +theorem loc_z2r (c k k' : Nat) (v : WordList) (l : Rat) + (hC : 0 < c) (hI : Scan k (List.replicate c Q ++ [K]) k' v l) : + v.length + (c + 1) / 2 = c + 1 := by + rcases even_or_odd_mul_two c with ⟨r,rfl⟩ | ⟨r,rfl⟩ + · cases r with + | zero => omega + | succ r => + have heq : (r + 1) * 2 = 2 + r * 2 := by omega + rw [heq] at hI + rcases scan_even_Q_K_inv r k k' v l hI with ⟨d,n,rfl,_,_⟩ + simp; try omega + · rcases scan_odd_Q_K_inv r k k' v l hI with ⟨rfl,_,_⟩ + simp; try omega +theorem loc_z2s (c k k' : Nat) (v : WordList) (a b : Rat) + (hC : 0 < c) (hI : PhaseScan k (List.replicate c Q ++ [K]) k' v a b) : + v.length + (c + 1) / 2 = c + 1 := by + have hD := digitVal_append (digitVal_replicate_Q c) (DigitVal.zero DigitVal.nil) + rcases phaseScan_digitVal_loss_bound hI hD with ⟨l,hJ,_,_⟩ + exact loc_z2r c k k' v l hC hJ +theorem loc_z2t (k : Nat) (u : WordList) (c : Nat) (mid : WordList) (t0 k' : Nat) (v : WordList) (a b : Rat) + (hC : 0 < c) (hT : 0 < t0) (hU : notEndsWithQ u = true) (hM : notEndsWithQ mid = true) + (hI : PhaseScan k (u ++ List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ [K])) k' v a b) : + ∃ g,wordScale (u ++ List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ [K])) = + wordScale v * ((8 ^ g : Nat) : Rat) /\ (c + 1) / 2 + (t0 + 1) / 2 <= g := by + rcases loc_z2p hI with ⟨g,hG,hL⟩ + refine ⟨g,hG,?_⟩ + have hE0 : u ++ List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ [K]) = + u ++ (List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ [K])) := by + simp [List.append_assoc] + rw [hE0] at hI + rcases phaseScan_split_of_splitCond hI u _ rfl (Or.inl hU) with ⟨m,x,y,_,_,_,_,hJ,hK,hV,_,_⟩ + have hSplit : List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ [K]) = + (List.replicate c Q ++ [K]) ++ (mid ++ (List.replicate t0 Q ++ [K])) := by + simp [List.append_assoc] + have hCut1 : SplitCond (List.replicate c Q ++ [K]) (mid ++ (List.replicate t0 Q ++ [K])) := by + left; rw [notEndsWithQ_append_singleton]; rfl + rcases phaseScan_split_of_splitCond hK _ _ hSplit hCut1 with ⟨m1,x1,y1,_,_,_,_,hJ1,hK1,hV1,_,_⟩ + rcases phaseScan_split_of_splitCond hK1 mid (List.replicate t0 Q ++ [K]) rfl (Or.inl hM) + with ⟨m2,x2,y2,_,_,_,_,hJ2,hK2,hV2,_,_⟩ + have hL_x := loc_z2q hJ + have hL_x2 := loc_z2q hJ2 + have hL_x1 := loc_z2s c m m1 x1 _ _ hC hJ1 + have hL_y2 := loc_z2s t0 m2 k' y2 _ _ hT hK2 + rw [hV,hV1,hV2] at hL + simp only [List.length_append,List.length_cons,List.length_replicate,List.length_nil] at hL hL_x1 hL_y2 + omega +theorem loc_z2u (n : Nat) : 8 ^ n = 2 ^ (3 * n) := by + induction n with + | zero => rfl + | succ n ih => + have heq : 3 * (n + 1) = 3 * n + 3 := by omega + rw [Nat.pow_succ,heq,Nat.pow_add,ih] +theorem loc_z2v (u ds : WordList) (A H k k' : Nat) (v : WordList) (a b : Rat) + (p c : Nat) (mid : WordList) (t0 : Nat) + (hD : DigitVal A H ds) (hHeight : wordScale u * ((2 ^ H : Nat) : Rat) = 1) + (hI : PhaseScan k (u ++ ds ++ [K]) k' v a b) + (hU : notEndsWithQ u = true) (hM : notEndsWithQ mid = true) + (hDs : ds = List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q)) + (hP : 16 <= p) (hC : (p - 2) / 2 <= c) (hT : p - 2 <= t0) : + ∃ J,(p + 1) + (p + 1) / 2 + 9 <= J /\ wordScale (V :: (v ++ [V])) * ((2 ^ J : Nat) : Rat) = 1 := by + have hEq : u ++ ds ++ [K] = u ++ List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ [K]) := by + rw [hDs]; simp [List.append_assoc] + have hI' : PhaseScan k (u ++ List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ [K])) k' v a b := by + rwa [<- hEq] + rcases loc_z2t k u c mid t0 k' v a b (by omega) (by omega) hU hM hI' with ⟨g,hGain,hCount⟩ + rw [<- hEq] at hGain + refine ⟨1 + 3 * g,?_,?_⟩ + · have hArith := loc_z2n p hP + omega + · have hWidth := (digitVal_scale_and_mass hD).1 + have hG1 : wordScale (u ++ ds ++ [K]) = wordScale u * wordScale ds * 2 := by + rw [wordScale_append,wordScale_append]; dsimp [wordScale]; ring + rw [hG1] at hGain + have hG2 : wordScale (V :: (v ++ [V])) = wordScale v * (1 / 4) := by + dsimp [wordScale]; rw [wordScale_append]; dsimp [wordScale]; ring + rw [hG2,pow_two_one_add,<- loc_z2u,Nat.cast_add] + calc wordScale v * (1 / 4) * (((8 ^ g : Nat) : Rat) + ((8 ^ g : Nat) : Rat)) + _ = (wordScale v * ((8 ^ g : Nat) : Rat)) * (1 / 2) := by ring + _ = (wordScale u * wordScale ds * 2) * (1 / 2) := by rw [<- hGain] + _ = wordScale u * wordScale ds := by ring + _ = wordScale u * ((2 ^ H : Nat) : Rat) := by rw [hWidth] + _ = 1 := hHeight +theorem loc_z2w (p H : Nat) (alpha unit : Rat) + (hPH : p + 10 <= H) (hA : 0 < alpha) (hU : 0 < unit) + (hAp : alpha * ((2 ^ p : Nat) : Rat) = 1) (hUh : unit * ((2 ^ H : Nat) : Rat) = 1) : + unit <= alpha * (1 / 1024) := by + have hHigh_nat : 2 ^ (p + 10) <= 2 ^ H := Nat.pow_le_pow_right (by decide) hPH + have hHigh_q : ((2 ^ (p + 10) : Nat) : Rat) <= ((2 ^ H : Nat) : Rat) := by exact_mod_cast hHigh_nat + rw [loc_z28 p 10,loc_z2a] at hHigh_q + have h1 : unit * (((2 ^ p : Nat) : Rat) * 1024) <= unit * ((2 ^ H : Nat) : Rat) := by nlinarith + have h2 : unit * ((2 ^ p : Nat) : Rat) <= (alpha * (1 / 1024)) * ((2 ^ p : Nat) : Rat) := by linarith + exact le_of_mul_le_mul_pos_right (loc_z1O p) h2 +theorem loc_z2x (p J : Nat) (alpha unit : Rat) + (hP : 16 <= p) (hJ : (p + 1) + (p + 1) / 2 + 9 <= J) + (hA : 0 < alpha) (hU : 0 < unit) + (hAp : alpha * ((2 ^ p : Nat) : Rat) = 1) (hUj : unit * ((2 ^ J : Nat) : Rat) = 1) : + unit <= alpha * (1 / 1024) := + loc_z2w p J alpha unit (by omega) hA hU hAp hUj +theorem loc_z2y (p H : Nat) (alpha unit : Rat) + (hPH : p <= H) (hA : alpha * ((2 ^ p : Nat) : Rat) = 1) (hU : unit * ((2 ^ H : Nat) : Rat) = 1) : + unit * ((2 ^ (H - p) : Nat) : Rat) = alpha := by + have hPos := loc_z1O p + have hEq : 2 ^ H = 2 ^ (H - p) * 2 ^ p := by rw [<- Nat.pow_add,Nat.sub_add_cancel hPH] + have hEq_q : ((2 ^ H : Nat) : Rat) = ((2 ^ (H - p) : Nat) : Rat) * ((2 ^ p : Nat) : Rat) := by + rw [hEq,Nat.cast_mul] + rw [hEq_q] at hU + have hle1 := le_of_mul_le_mul_pos_right hPos (show (unit * ((2 ^ (H - p) : Nat) : Rat)) * ((2 ^ p : Nat) : Rat) <= alpha * ((2 ^ p : Nat) : Rat) by linarith) + have hle2 := le_of_mul_le_mul_pos_right hPos (show alpha * ((2 ^ p : Nat) : Rat) <= (unit * ((2 ^ (H - p) : Nat) : Rat)) * ((2 ^ p : Nat) : Rat) by linarith) + linarith +theorem loc_z2z (n t0 B : Nat) (ds : WordList) + (hD : DigitVal B (n + t0) ds) (hL : 2 ^ (n + t0) <= B + 2 ^ n) : + ∃ u,ds = u ++ List.replicate t0 Q := by + have hBound := lt_pow_of_digitVal hD + have hPos := pow_two_pos t0 + rw [Nat.pow_add] at hL hBound + let a := B - (2 ^ t0 - 1) * 2 ^ n + have hSum : a + (2 ^ t0 - 1) * 2 ^ n = B := by + have : (2 ^ t0 - 1) * 2 ^ n + 2 ^ n = 2 ^ n * 2 ^ t0 := by + have h1 : (2 ^ t0 - 1) + 1 = 2 ^ t0 := by omega + calc (2 ^ t0 - 1) * 2 ^ n + 2 ^ n + _ = ((2 ^ t0 - 1) + 1) * 2 ^ n := by ring + _ = 2 ^ t0 * 2 ^ n := by rw [h1] + _ = 2 ^ n * 2 ^ t0 := by ring + omega + have ha_lt : a < 2 ^ n := by + have : (2 ^ t0 - 1) * 2 ^ n + 2 ^ n = 2 ^ n * 2 ^ t0 := by + have h1 : (2 ^ t0 - 1) + 1 = 2 ^ t0 := by omega + calc (2 ^ t0 - 1) * 2 ^ n + 2 ^ n + _ = ((2 ^ t0 - 1) + 1) * 2 ^ n := by ring + _ = 2 ^ t0 * 2 ^ n := by rw [h1] + _ = 2 ^ n * 2 ^ t0 := by ring + omega + rcases exists_digitVal_of_lt_pow n a ha_lt with ⟨u,hU⟩ + refine ⟨u,digitVal_unique hD ?_⟩ + rw [<- hSum] + exact digitVal_append hU (digitVal_replicate_Q t0) +theorem loc_z2A (p H B : Nat) (ds : WordList) (alpha unit : Rat) + (hD : DigitVal B H ds) (hP : 2 <= p) (hPH : p <= H) + (_ : 0 < alpha) (hU : 0 < unit) (_ : unit <= alpha) + (hAp : alpha * ((2 ^ p : Nat) : Rat) = 1) (hUh : unit * ((2 ^ H : Nat) : Rat) = 1) + (hDeficit : unit * wordMassK ds <= (5 / 2) * alpha) : + ∃ u,ds = u ++ List.replicate (p - 2) Q := by + have hShift : unit * ((2 ^ (H - (p - 2)) : Nat) : Rat) = 4 * alpha := by + have heq : H - (p - 2) = (H - p) + 2 := by omega + rw [heq,loc_z28 (H - p) 2,loc_z29] + have hd := loc_z2y p H alpha unit hPH hAp hUh + linarith + have hZ := digitVal_wordMassK_eq hD + have hH_split : (H - (p - 2)) + (p - 2) = H := by omega + have hD' : DigitVal B ((H - (p - 2)) + (p - 2)) ds := by rwa [hH_split] + apply loc_z2z (H - (p - 2)) (p - 2) B ds hD' + have hZ_u : (B : Rat) * unit + unit + unit * wordMassK ds = 1 := by + calc (B : Rat) * unit + unit + unit * wordMassK ds + _ = unit * (wordMassK ds + (B : Rat) + 1) := by ring + _ = unit * ((2 ^ H : Nat) : Rat) := by rw [hZ] + _ = 1 := hUh + have hL_u : ((2 ^ H : Nat) : Rat) * unit <= ((B + 2 ^ (H - (p - 2)) : Nat) : Rat) * unit := by + rw [Nat.cast_add]; linarith + have hL_q : ((2 ^ ((H - (p - 2)) + (p - 2)) : Nat) : Rat) <= ((B + 2 ^ (H - (p - 2)) : Nat) : Rat) := by + rw [hH_split] + exact le_of_mul_le_mul_pos_right hU hL_u + exact_mod_cast hL_q +theorem loc_z2B {B H : Nat} {ds : WordList} (hI : DigitVal B H ds) (hZ : 0 < wordMassK ds) : + ∃ c w,ds = List.replicate c Q ++ K :: w := by + induction hI with + | nil => dsimp [wordMassK] at hZ; linarith + | @zero A H u _ _ => exact ⟨0,u,rfl⟩ + | @one A H u _ ih => + dsimp [wordMassK] at hZ + rcases ih (by linarith) with ⟨c,w,rfl⟩ + exact ⟨c + 1,w,rfl⟩ +theorem loc_z2C (c : Nat) : + ∀ (s : Nat) (u v : WordList), + List.replicate s Q ++ u = List.replicate c Q ++ K :: v -> s <= c := by + induction c with + | zero => + intro s u v hE + cases s with + | zero => omega + | succ s => nomatch hE + | succ c ih => + intro s u v hE + cases s with + | zero => omega + | succ s => + dsimp [List.replicate] at hE + injection hE with _ hE' + have h := ih s u v hE' + omega +theorem loc_z2D (u v : WordList) (c s : Nat) + (hC : notEndsWithQ u = true) + (hE : u ++ List.replicate c Q = v ++ List.replicate s Q) : s <= c := by + by_contra hGt + have hlt : c < s := by omega + have h_eq : s = (s - c) + c := by omega + rw [h_eq,List.replicate_add,<- List.append_assoc] at hE + have hU := List.append_inj_left' hE rfl + subst hU + rcases Nat.exists_eq_succ_of_ne_zero (by omega : s - c ≠ 0) with ⟨n,hn⟩ + rw [hn,replicate_succ_append,<- List.append_assoc,notEndsWithQ_append_singleton] at hC + contradiction +theorem loc_z2E (u v : WordList) (h : notEndsWithQ (u ++ v) = true) : notEndsWithQ v = true := by + induction u with + | nil => exact h + | cons w u ih => exact ih (notEndsWithQ_of_cons w (u ++ v) h) +theorem loc_z2F {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) (hEnd : ∃ w,u = w ++ [V]) : + ∃ w,v = w ++ [V] := by + rcases hEnd with ⟨w,rfl⟩ + rcases wordEffect_append_replicate_V_inv w 1 n b v hI with ⟨x,m,hE,_⟩ + exact ⟨x,hE⟩ +theorem loc_z2G (p : Nat) (u : WordList) : + wordMass (List.replicate p V ++ Q :: u) = wordScale (List.replicate p V) * (1 + 2 * wordMass u) := by + rw [wordMass_append] + dsimp [wordMass] + have h := (loc_z1P p).1 + linarith +theorem loc_z2H (p : Nat) (hP : 16 <= p) : + wordScale (List.replicate p V) <= 1 / 65536 := by + have h1 := (loc_z1P p).2 + have h2 := wordScale_pos (List.replicate p V) + have hle : 2 ^ 16 <= 2 ^ p := Nat.pow_le_pow_right (by decide) (by omega) + have hq : (65536 : Rat) <= ((2 ^ p : Nat) : Rat) := by exact_mod_cast hle + nlinarith +inductive Good : Nat -> WordList -> Prop where + | intro (p H : Nat) (u : WordList) (A : Nat) (da : WordList) (carry : Nat) (eff : WordList) + (B : Nat) (db : WordList) (tau : Rat) : + 16 <= p -> p + p / 2 + 9 <= H -> + (∃ rest,u = List.replicate p V ++ Q :: rest) -> + (∃ rest,u = rest ++ [V]) -> + wordScale u * ((2 ^ H : Nat) : Rat) = 1 -> + DigitVal A H da -> + WordEffect 0 u carry eff -> + A + carry = B + 2 ^ H -> + DigitVal B H db -> + loc_Reserve p tau -> + wordMass u <= wordScale (List.replicate p V) * (1 + (3 / 64) - tau) -> + (3 / 2) * wordScale (List.replicate p V) <= wordScale u * wordMassK db -> + wordScale u * wordMassK db <= (5 / 2) * wordScale (List.replicate p V) -> + (∃ rest,db = List.replicate ((p - 2) / 2) Q ++ rest) -> + Good p (u ++ da ++ [Q]) +inductive loc_Step : WordList -> WordList -> Prop where + | intro (orig eff : WordList) (k : Nat) (v : WordList) (a b : Rat) (J A : Nat) (da : WordList) : + WordEffect 0 orig 1 eff -> + PhaseScan 12 eff k v a b -> + DigitVal A J da -> + A + 2 ^ J = k -> + loc_Step orig (V :: (v ++ V :: (da ++ [Q]))) +theorem loc_z2I (c : Nat) (mid : WordList) (hM : notEndsWithQ mid = true) : + notEndsWithQ (List.replicate c Q ++ K :: mid) = true := by + cases mid with + | nil => rw [notEndsWithQ_append_singleton]; rfl + | cons x xs => + induction c with + | zero => exact hM + | succ c ih => + cases c with + | zero => exact hM + | succ c' => exact ih +theorem loc_z2J {B H : Nat} {ds : WordList} {s t0 : Nat} + (hD : DigitVal B H ds) (hZ : 0 < wordMassK ds) + (hLo : ∃ u,ds = List.replicate s Q ++ u) + (hHi : ∃ u,ds = u ++ List.replicate t0 Q) : + ∃ c mid n,ds = List.replicate c Q ++ K :: (mid ++ List.replicate n Q) /\ + notEndsWithQ mid = true /\ s <= c /\ t0 <= n := by + rcases hLo with ⟨lo,hLo_eq⟩ + rcases hHi with ⟨hi,hHi_eq⟩ + rcases loc_z2B hD hZ with ⟨c,w,hE⟩ + rcases split_trailing_Q w with ⟨mid,n,rfl,hM⟩ + refine ⟨c,mid,n,hE,hM,?_,?_⟩ + · apply loc_z2C c s lo (mid ++ List.replicate n Q) + rw [<- hLo_eq,hE] + · apply loc_z2D (List.replicate c Q ++ K :: mid) hi n t0 (loc_z2I c mid hM) + have h1 : (List.replicate c Q ++ K :: mid) ++ List.replicate n Q = + List.replicate c Q ++ K :: (mid ++ List.replicate n Q) := by + simp [List.append_assoc] + rw [h1,<- hE,hHi_eq] +theorem loc_z2K (p : Nat) (u : WordList) (carry : Nat) (eff : WordList) + (hP : 0 < p) (hE : WordEffect 0 (List.replicate p V ++ Q :: u) carry eff) : + ∃ v,eff = List.replicate p V ++ K :: v := by + cases p with + | zero => omega + | succ p => + have heq : p + 1 = 1 + p := by omega + rw [heq] at hE ⊢ + rcases loc_z23 p u carry eff hE with ⟨v,hV,_⟩ + exact ⟨v,hV⟩ +theorem loc_z2L {p : Nat} {orig : WordList} (hI : Good p orig) : + ∃ out,loc_Step orig out /\ Good (1 + p) out := by + rcases hI with ⟨H,u,A,da,carry,eff,B,db,tau, + hP,hHbound,⟨rest,hStart⟩,hEnd,hHeight,hDA,hEff,hSum,hDB,hRes,hM,hDlo,hDhi,hLow⟩ + let alpha := wordScale (List.replicate p V) + let unit := wordScale u + have hAlpha : 0 < alpha := wordScale_pos (List.replicate p V) + have hUnit : 0 < unit := wordScale_pos u + have hAp : alpha * ((2 ^ p : Nat) : Rat) = 1 := (loc_z1P p).2 + have hAsmall : alpha <= 1 / 65536 := loc_z2H p hP + rcases loc_z2i hRes hP with ⟨hTau,hTauSmall⟩ + have hUsmall : unit <= alpha * (1 / 1024) := + loc_z2w p H alpha unit (by omega) hAlpha hUnit hAp hHeight + rcases wordEffect_preserves_scale_and_mass hEff with ⟨hEffScale,hEffMass⟩ + rcases loc_z2F hEff hEnd with ⟨last,hElast⟩ + have hCut : notEndsWithQ eff = true := by rw [hElast,notEndsWithQ_append_singleton]; rfl + have hNe : eff ≠ [] := by rw [hElast]; simp + have hEffHeight : wordScale eff * ((2 ^ H : Nat) : Rat) = 1 := by rw [hEffScale]; exact hHeight + have hEffBound : wordMass eff + wordScale eff * (1 + wordMassK db) <= 1 / 128 := by + rw [hEffScale,hEffMass] + change wordMass u + unit * (1 + wordMassK db) <= 1 / 128 + have : unit * wordMassK db <= (5 / 2) * alpha := hDhi + have : wordMass u <= alpha * (1 + (3 / 64) - tau) := hM + nlinarith + rcases loc_z1N eff B H db hDB hEffHeight hCut hNe hEffBound with ⟨k,v,a,b,hIscan,hK⟩ + have hZ : 0 < wordMassK db := by + have : (3 / 2) * alpha <= unit * wordMassK db := hDlo + nlinarith + rcases loc_z2A p H B db alpha unit hDB (by omega) (by omega) + hAlpha hUnit (by linarith) hAp hHeight hDhi with ⟨hi,hHi⟩ + rcases loc_z2J hDB hZ hLow ⟨hi,hHi⟩ with ⟨c,mid,t0,hSplit,hMidCut,hC,hT⟩ + rcases loc_z2v eff db B H 12 k v a b p c mid t0 hDB hEffHeight hIscan + hCut hMidCut hSplit hP hC hT with ⟨J,hJbound,hJheight⟩ + let new := V :: (v ++ [V]) + let nu := wordScale new + have hNu : 0 < nu := wordScale_pos new + have hNuSmall : nu <= alpha * (1 / 1024) := + loc_z2x p J alpha nu hP hJbound hAlpha hNu hAp hJheight + have hEffStart : ∃ w,eff = List.replicate p V ++ K :: w := by + rw [hStart] at hEff + exact loc_z2K p rest carry eff (by omega) hEff + rcases hEffStart with ⟨w,hEstart⟩ + have hWcut : notEndsWithQ w = true := by + rw [hEstart] at hCut + exact notEndsWithQ_of_cons K w (loc_z2E (List.replicate p V) (K :: w) hCut) + let e := wordMass u - alpha + have hEeq : e = 2 * alpha * wordMass w := by + have h1 : wordMass eff = wordMass u := hEffMass + rw [hEstart,wordMass_append] at h1 + dsimp [wordMass] at h1 + have h2 := (loc_z1P p).1 + change wordMass u - alpha = 2 * alpha * wordMass w + linarith + have hWw := wordMass_nonneg w + have hMw : 0 <= wordMass w := hWw.1 + have hEpos : 0 <= e := by rw [hEeq]; positivity + have hEbound : e <= alpha * ((3 / 64) - tau) := by + change wordMass u - alpha <= alpha * ((3 / 64) - tau) + linarith + let s := (p - 2) / 2 + let pow := ((2 ^ (s + s / 2) : Nat) : Rat) + have hPow : 0 < pow := loc_z1O (s + s / 2) + let f := unit + 2 * unit * wordMassK db / pow + have hFeq : f * pow = unit * pow + 2 * unit * wordMassK db := by + change (unit + 2 * unit * wordMassK db / pow) * pow = unit * pow + 2 * unit * wordMassK db + have hne : pow ≠ 0 := ne_of_gt hPow + rw [add_mul,div_mul_cancel₀ _ hne] + have hWdb := wordMass_nonneg db + have hZdb : 0 <= wordMassK db := hWdb.2.1 + have hFpos : 0 <= f := + le_of_mul_le_mul_pos_right hPow (by nlinarith [hFeq,hPow,hUnit,hZdb]) + have hFbound : f <= alpha * tau * (1 / 4) := by + apply loc_z2m p H s alpha unit tau f hRes hP hHbound rfl hAlpha hUnit hAp hHeight + change f * pow <= unit * pow + 5 * alpha + have : unit * wordMassK db <= (5 / 2) * alpha := hDhi + linarith + have hLow' : ∃ c w0,(0 < c /\ s <= c) /\ db = List.replicate c Q ++ K :: w0 := + ⟨c,mid ++ List.replicate t0 Q,⟨by omega,hC⟩,hSplit⟩ + have hFactor : 2 * alpha * wordScale w = unit := by + have h1 : wordScale eff = unit := hEffScale + rw [hEstart,wordScale_append] at h1 + dsimp [wordScale] at h1 + change 2 * alpha * wordScale w = unit + have : wordScale (List.replicate p V) = alpha := rfl + linarith + have hScanStart : PhaseScan 12 (List.replicate p V ++ K :: (w ++ db ++ [K])) k v a b := by + rw [hEstart] at hIscan + simpa [List.append_assoc] using hIscan + have hStageBound : (2 * alpha * wordScale w) * (pow + 2 * wordMassK db) <= f * pow := by + rw [hFactor]; linarith + rcases loc_z2b p w db B H k v a b s e f hScanStart hDB hWcut hLow' hEeq hStageBound + with ⟨tail,hVstart,hMnext,hDl,hDu⟩ + rcases exists_wordEffect new 0 with ⟨carry',eff',hEff'⟩ + have hNewStart : new = List.replicate (1 + p) V ++ Q :: (tail ++ [V]) := by + change V :: (v ++ [V]) = List.replicate (1 + p) V ++ Q :: (tail ++ [V]) + rw [hVstart,loc_z22]; simp [List.append_assoc] + have hEff'_start : WordEffect 0 (List.replicate (1 + p) V ++ Q :: (tail ++ [V])) carry' eff' := by + rwa [<- hNewStart] + rcases loc_z2c p (tail ++ [V]) carry' eff' hEff'_start with ⟨hRlo0,hRhi0⟩ + rw [<- hNewStart] at hRlo0 hRhi0 + let R := ((1 + carry' : Nat) : Rat) * nu - 1 + have hScale1p : wordScale (List.replicate (1 + p) V) = alpha * (1 / 2) := by + rw [loc_z22]; rfl + have hRlo : alpha <= R := by + rw [hScale1p] at hRlo0 + change 2 * (alpha * (1 / 2)) <= R at hRlo0 + linarith + have hRhi : R <= 2 * wordMass new := hRhi0 + have hEnew : 0 <= wordMass new - alpha * (1 / 2) := by + rw [hNewStart,loc_z2G,hScale1p] + have hWt := wordMass_nonneg (tail ++ [V]) + nlinarith + have hFtiny : f <= alpha * (1 / 128) := by nlinarith + have hEtiny : e <= alpha * (3 / 64) := by nlinarith + have hBudget := loc_z2e hIscan + have hMnext' : wordMass new <= alpha * (1 / 2) + (e + f) * (1 / 2) := hMnext + rcases loc_z2g J k carry' alpha nu (a - b) R hAlpha (by linarith) + hNu hNuSmall hJheight (by linarith) (by linarith) hRlo (by linarith) hBudget (by change ((1 + carry' : Nat) : Rat) * nu = 1 + (((1 + carry' : Nat) : Rat) * nu - 1); ring) + with ⟨A',B',hAsum,hBsum,hAl,hAu,hBl,hBu⟩ + rcases exists_digitVal_of_lt_pow J A' hAu with ⟨da',hDA'⟩ + rcases exists_digitVal_of_lt_pow J B' hBu with ⟨db',hDB'⟩ + rcases loc_z2h hRes with ⟨tau',hRes',hTauStep⟩ + have hMkeep := loc_z2o alpha tau tau' e f (wordMass new - alpha * (1 / 2)) + (by linarith) hTauStep hEbound hFbound (by linarith) + rcases loc_z2d alpha e f nu (a - b) R (wordMass new - alpha * (1 / 2)) + hAlpha hEpos hFpos (by linarith) hEtiny hFtiny hNuSmall hEnew (by linarith) + hRlo (by linarith) hDl hDu with ⟨hDkeepL,hDkeepU⟩ + have hDef := loc_z2f hIscan hJheight hAsum hBsum + have hZnew := digitVal_wordMassK_eq hDB' + have hDnew : nu * wordMassK db' = (a - b) * (1 / 2) - 4 * nu - R := by + have h1 : 1 - ((1 + B' : Nat) : Rat) * nu = (a - b) * (1 / 2) - 4 * nu - R := hDef + rw [Nat.cast_add,Nat.cast_one] at h1 + have h2 : nu * (wordMassK db' + (B' : Rat) + 1) = 1 := by + rw [hZnew]; exact hJheight + linarith + have hLowNew : ∃ rest',db' = List.replicate (((1 + p) - 2) / 2) Q ++ rest' := by + let r := ((1 + p) - 2) / 2 - 1 + have hHr1 : 1 + r = ((1 + p) - 2) / 2 := by omega + have hHr2 : 1 + r * 2 <= p - 2 := by omega + have hHighEnd : ∃ z,db = z ++ List.replicate (1 + r * 2) Q := by + refine ⟨hi ++ List.replicate ((p - 2) - (1 + r * 2)) Q,?_⟩ + have heq_p : (p - 2) - (1 + r * 2) + (1 + r * 2) = p - 2 := by omega + rw [hHi,List.append_assoc,<- List.replicate_add,heq_p] + rcases hHighEnd with ⟨z,hHZ⟩ + have hSC : PhaseScan 12 ((eff ++ z) ++ List.replicate (1 + r * 2) Q ++ [K]) k v a b := by + rw [hHZ] at hIscan + simpa [List.append_assoc] using hIscan + rcases loc_z25 r 12 (eff ++ z) k v a b carry' eff' A' B' J db' + hSC hEff' hDB' (by omega) hAsum hBsum with ⟨z',hL⟩ + rw [hHr1] at hL + exact ⟨z',hL⟩ + refine ⟨new ++ da' ++ [Q],?_,?_⟩ + · have hOut_eq : new ++ da' ++ [Q] = V :: (v ++ V :: (da' ++ [Q])) := by + change V :: (v ++ [V]) ++ da' ++ [Q] = V :: (v ++ V :: (da' ++ [Q])) + simp [List.append_assoc] + rw [hOut_eq] + rcases loc_z1L hDA hSum (lt_pow_of_digitVal hDB) with ⟨d,hDD,hEE⟩ + have hd_eq : d = db := digitVal_unique hDD hDB + subst d + have hFull : WordEffect 0 (u ++ da ++ [Q]) 1 (eff ++ db ++ [K]) := by + simpa only [List.append_assoc] using wordEffect_append hEff hEE + exact loc_Step.intro (u ++ da ++ [Q]) (eff ++ db ++ [K]) k v a b J A' da' hFull hIscan hDA' hAsum + · refine Good.intro (1 + p) J new A' da' carry' eff' B' db' tau' + (by omega) (by omega) ⟨tail ++ [V],hNewStart⟩ ⟨V :: v,rfl⟩ hJheight hDA' hEff' + (by omega) hDB' hRes' ?_ ?_ ?_ hLowNew + · rw [hScale1p] + linarith + · rw [hScale1p] + change (3 / 2) * (alpha * (1 / 2)) <= nu * wordMassK db' + linarith + · rw [hScale1p] + change nu * wordMassK db' <= (5 / 2) * (alpha * (1 / 2)) + linarith +theorem ne_of_beq_eq_false {a b : Nat} (h : (a == b) = false) : a ≠ b := by + intro heq; subst heq; rw [beq_self_eq_true] at h; contradiction +def loc_z2M : Word -> Bool + | V => false + | _ => true +theorem loc_z2N (ds : WordList) (h : ds.all loc_z2M = true) : + ∃ A,DigitVal A ds.length ds := by + induction ds with + | nil => exact ⟨0,DigitVal.nil⟩ + | cons w ds ih => + cases w + · contradiction + · dsimp [List.all,loc_z2M] at h + rcases ih h with ⟨A,hI⟩ + have heq : (K :: ds).length = 1 + ds.length := by simp [Nat.add_comm] + rw [heq]; exact ⟨A * 2,DigitVal.zero hI⟩ + · dsimp [List.all,loc_z2M] at h + rcases ih h with ⟨A,hI⟩ + have heq : (Q :: ds).length = 1 + ds.length := by simp [Nat.add_comm] + rw [heq]; exact ⟨1 + A * 2,DigitVal.one hI⟩ +theorem loc_z2O {A H : Nat} {u : WordList} (hI : DigitVal A H u) : + u.all loc_z2M = true := by + induction hI with + | nil => rfl + | zero _ ih => exact ih + | one _ ih => exact ih +def loc_z2P (e : Bool) (n : Nat) : Nat := if e then 1 + n * 2 else n * 2 +def loc_z2Q (e : Bool) : Word := if e then Q else K +def loc_z2R (w : Word) (n : Nat) : Word × Nat := + match w with + | V => (V,1 + n * 2) + | K => (if n % 2 == 0 then K else Q,n / 2) + | Q => + let m := n + 1 + (if m % 2 == 0 then K else Q,m / 2) +theorem loc_z2S (w : Word) (n : Nat) (d : Word) (m : Nat) + (hE : loc_z2R w n = (d,m)) : + ∀ {u : WordList} {b : Nat} {v : WordList}, + WordEffect m u b v -> WordEffect n (w :: u) b (d :: v) := by + intro u b v hI + cases w with + | V => + dsimp [loc_z2R] at hE + injection hE with hd hm; subst hd hm + exact WordEffect.T hI + | K => + dsimp [loc_z2R] at hE + injection hE with hd hm; subst hd hm + rcases Nat.mod_two_eq_zero_or_one n with hmod | hmod + · have hcond : (n % 2 == 0) = true := beq_iff_eq.mpr hmod + rw [hcond] + have h1 := WordEffect.d00 hI + have heq : (n / 2) * 2 = n := by omega + rwa [heq] at h1 + · have hcond : (n % 2 == 0) = false := beq_false_of_ne (by omega) + rw [hcond] + have h1 := WordEffect.d01 hI + have heq : 1 + (n / 2) * 2 = n := by omega + rwa [heq] at h1 + | Q => + dsimp [loc_z2R] at hE + injection hE with hd hm; subst hd hm + rcases Nat.mod_two_eq_zero_or_one n with hmod | hmod + · have hcond : ((n + 1) % 2 == 0) = false := beq_false_of_ne (by omega) + rw [hcond] + have hm_eq : (n + 1) / 2 = n / 2 := by omega + rw [hm_eq] at hI + have h1 := WordEffect.d10 hI + have heq : (n / 2) * 2 = n := by omega + rwa [heq] at h1 + · have hcond : ((n + 1) % 2 == 0) = true := beq_iff_eq.mpr (by omega) + rw [hcond] + have hm_eq : (n + 1) / 2 = 1 + n / 2 := by omega + rw [hm_eq] at hI + have h1 := WordEffect.d11 hI + have heq : 1 + (n / 2) * 2 = n := by omega + rwa [heq] at h1 +def forceLit {α : Type} (n : Nat) (k : Nat -> α) : α := + Nat.casesOn n (k 0) (fun m => k (Nat.succ m)) +@[simp] theorem forceLit_eq {α : Type} (n : Nat) (k : Nat -> α) : forceLit n k = k n := by + cases n <;> rfl +def strictWord {α : Type} (w : Word) (k : Word -> α) : α := + Word.casesOn w (k V) (k K) (k Q) +@[simp] theorem strictWord_eq {α : Type} (w : Word) (k : Word -> α) : strictWord w k = k w := by + cases w <;> rfl +def loc_z2T : WordList -> Nat -> WordList -> Nat × WordList + | [],n,acc => (n,acc.reverseAux []) + | w :: u,n,acc => + let (d,m) := loc_z2R w n + strictWord d (fun d' => forceLit m (fun m' => loc_z2T u m' (d' :: acc))) +theorem loc_z2U (u : WordList) : + ∀ (n : Nat) (acc : WordList) (b : Nat) (out : WordList), + loc_z2T u n acc = (b,out) -> + ∃ v,out = acc.reverseAux v /\ WordEffect n u b v := by + induction u with + | nil => + intro n acc b out hE + dsimp [loc_z2T] at hE + injection hE with hb hout; subst hb hout + exact ⟨[],rfl,WordEffect.nil n⟩ + | cons w u ih => + intro n acc b out hE + dsimp [loc_z2T] at hE + generalize hC : loc_z2R w n = dm at hE + rcases dm with ⟨d,m⟩ + simp only [strictWord_eq, forceLit_eq] at hE + rcases ih m (d :: acc) b out hE with ⟨v,rfl,hI⟩ + exact ⟨d :: v,rfl,loc_z2S w n d m hC hI⟩ +def loc_z2V (e : Bool) (k : Nat) : Option (Word × Nat) := + if k == 0 then none + else if k % 2 == 0 then + if k % 4 == 2 then + some (K,loc_z2P e (k / 4)) + else + some (Q,loc_z2P e (k / 4 - 1)) + else none +theorem loc_z2W (e : Bool) (k : Nat) (d : Word) (k' : Nat) (u : WordList) (c : Nat) (v : WordList) (a b : Rat) + (hS : loc_z2V e k = some (d,k')) (hI : PhaseScan k' u c v a b) : + ∃ x y,PhaseScan k (loc_z2Q e :: u) c (d :: v) x y := by + dsimp [loc_z2V] at hS + cases hk0 : (k == 0) with + | true => rw [hk0] at hS; contradiction + | false => + rw [hk0] at hS; dsimp at hS + have hk0' : k ≠ 0 := ne_of_beq_eq_false hk0 + cases hk2 : (k % 2 == 0) with + | false => rw [hk2] at hS; contradiction + | true => + rw [hk2] at hS; dsimp at hS + have hk2' : k % 2 = 0 := beq_iff_eq.mp hk2 + cases hk4 : (k % 4 == 2) with + | true => + rw [hk4] at hS; dsimp at hS + injection hS with hS1; injection hS1 with hS1 hS2; subst hS1 hS2 + have hk4' : k % 4 = 2 := beq_iff_eq.mp hk4 + have hk_eq : k = 2 + (k / 4) * 4 := by omega + rw [hk_eq] + cases e + · exact ⟨3 + a * 2,b * 2,PhaseScan.short00 hI⟩ + · exact ⟨2 + a * 2,b * 2,PhaseScan.short01 hI⟩ + | false => + rw [hk4] at hS; dsimp at hS + injection hS with hS1; injection hS1 with hS1 hS2; subst hS1 hS2 + have hk4' : k % 4 ≠ 2 := ne_of_beq_eq_false hk4 + have hk_eq : k = 4 + (k / 4 - 1) * 4 := by omega + rw [hk_eq] + cases e + · exact ⟨4 + a * 2,b * 2,PhaseScan.short10 hI⟩ + · exact ⟨3 + a * 2,b * 2,PhaseScan.short11 hI⟩ +def loc_z2X : WordList -> Bool + | [] => true + | K :: _ => true + | V :: _ => false + | Q :: u => !loc_z2X u +def loc_z2Y : WordList -> WordList -> Nat -> WordList -> Option (Nat × WordList) + | [],_,_,_ => none + | _ :: fuel,[],k,acc => some (k,acc.reverseAux []) + | _ :: fuel,w :: u,k,acc => + if k == 0 then none + else match w with + | V => + if 3 <= k then forceLit (2 + (k - 3) * 2) (fun m' => loc_z2Y fuel u m' (V :: acc)) + else none + | K => + match loc_z2V false k with + | some (d,k') => strictWord d (fun d' => forceLit k' (fun m' => loc_z2Y fuel u m' (d' :: acc))) + | none => none + | Q => + if (k % 2 == 0) && loc_z2X (Q :: u) then + match loc_z2V true k with + | some (d,k') => strictWord d (fun d' => forceLit k' (fun m' => loc_z2Y fuel u m' (d' :: acc))) + | none => none + else + match u with + | K :: v => forceLit ((k - 1) * 2) (fun m' => loc_z2Y fuel v m' (V :: acc)) + | Q :: v => forceLit (1 + (k - 1) * 2) (fun m' => loc_z2Y fuel v m' (V :: acc)) + | _ => none +theorem loc_z2Z (fuel : WordList) : + ∀ (u : WordList) (k : Nat) (acc : WordList) (k' : Nat) (out : WordList), + loc_z2Y fuel u k acc = some (k',out) -> + ∃ v a b,out = acc.reverseAux v /\ PhaseScan k u k' v a b := by + induction fuel with + | nil => intro u k acc k' out hE; contradiction + | cons _ fuel ih => + intro u k acc k' out hE + cases u with + | nil => + dsimp [loc_z2Y] at hE + injection hE with hE1; injection hE1 with hk hout; subst hk hout + exact ⟨[],0,0,rfl,PhaseScan.nil k⟩ + | cons w u => + dsimp [loc_z2Y] at hE + cases hk0 : (k == 0) with + | true => rw [hk0] at hE; contradiction + | false => + rw [hk0] at hE; dsimp at hE + have hk0' : k ≠ 0 := ne_of_beq_eq_false hk0 + cases w with + | V => + dsimp at hE + by_cases h3 : 3 <= k + · rw [if_pos h3] at hE; simp only [strictWord_eq, forceLit_eq] at hE + rcases ih u (2 + (k - 3) * 2) (V :: acc) k' out hE with ⟨v,a,b,rfl,hI⟩ + have hk_eq : k = 3 + (k - 3) := by omega + rw [hk_eq] + exact ⟨V :: v,a * (1 / 2),b * (1 / 2),rfl,PhaseScan.T hI⟩ + · rw [if_neg h3] at hE; contradiction + | K => + dsimp at hE + cases hS : loc_z2V false k with + | none => rw [hS] at hE; contradiction + | some dk => + rcases dk with ⟨d,m⟩ + rw [hS] at hE; dsimp at hE; simp only [strictWord_eq, forceLit_eq] at hE + rcases ih u m (d :: acc) k' out hE with ⟨v,a,b,rfl,hI⟩ + rcases loc_z2W false k d m u k' v a b hS hI with ⟨x,y,hSub⟩ + exact ⟨d :: v,x,y,rfl,hSub⟩ + | Q => + dsimp at hE + cases hcond : ((k % 2 == 0) && loc_z2X (Q :: u)) with + | true => + rw [hcond] at hE; dsimp at hE + cases hS : loc_z2V true k with + | none => rw [hS] at hE; contradiction + | some dk => + rcases dk with ⟨d,m⟩ + rw [hS] at hE; dsimp at hE; simp only [strictWord_eq, forceLit_eq] at hE + rcases ih u m (d :: acc) k' out hE with ⟨v,a,b,rfl,hI⟩ + rcases loc_z2W true k d m u k' v a b hS hI with ⟨x,y,hSub⟩ + exact ⟨d :: v,x,y,rfl,hSub⟩ + | false => + rw [hcond] at hE; dsimp at hE + cases u with + | nil => contradiction + | cons w2 v0 => + cases w2 with + | V => contradiction + | K => + dsimp at hE; simp only [strictWord_eq, forceLit_eq] at hE + rcases ih v0 ((k - 1) * 2) (V :: acc) k' out hE with ⟨v,a,b,rfl,hI⟩ + have hk_eq : k = 1 + (k - 1) := by omega + rw [hk_eq] + exact ⟨V :: v,a * (1 / 2),(1 + b) * (1 / 2),rfl,PhaseScan.pair0 hI⟩ + | Q => + dsimp at hE; simp only [strictWord_eq, forceLit_eq] at hE + rcases ih v0 (1 + (k - 1) * 2) (V :: acc) k' out hE with ⟨v,a,b,rfl,hI⟩ + have hk_eq : k = 1 + (k - 1) := by omega + rw [hk_eq] + exact ⟨V :: v,a * (1 / 2),(3 / 4) + b * (1 / 2),rfl,PhaseScan.pair1 hI⟩ +def loc_zPf : WordList -> Nat -> Option (WordList) + | [],_ => none + | _ :: fuel,k => + if k == 0 then none + else if k == 1 then some [Q] + else match loc_zPf fuel (k / 2) with + | none => none + | some ws => strictWord (if k % 2 == 0 then K else Q) (fun d' => some (d' :: ws)) +theorem loc_z30 (fuel : WordList) : + ∀ (k : Nat) (ws : WordList),loc_zPf fuel k = some ws -> + ∃ A H da,ws = da ++ [Q] /\ DigitVal A H da /\ A + 2 ^ H = k := by + induction fuel with + | nil => intro k ws h; contradiction + | cons _ fuel ih => + intro k ws h + dsimp [loc_zPf] at h + cases hk0 : (k == 0) with + | true => rw [hk0] at h; contradiction + | false => + rw [hk0] at h; dsimp at h + have hk0' : k ≠ 0 := ne_of_beq_eq_false hk0 + cases hk1 : (k == 1) with + | true => + rw [hk1] at h; dsimp at h + injection h with h; subst h + have rfl_k : k = 1 := beq_iff_eq.mp hk1 + subst rfl_k + exact ⟨0,0,[],rfl,DigitVal.nil,rfl⟩ + | false => + rw [hk1] at h; dsimp at h + have hk1' : k ≠ 1 := ne_of_beq_eq_false hk1 + cases hrec : loc_zPf fuel (k / 2) with + | none => rw [hrec] at h; contradiction + | some ws' => + rw [hrec] at h; dsimp at h; simp only [strictWord_eq] at h + injection h with h; subst h + rcases ih (k / 2) ws' hrec with ⟨A,H,da,rfl,hD,hSum⟩ + rcases Nat.mod_two_eq_zero_or_one k with hmod | hmod + · have hcond : (k % 2 == 0) = true := beq_iff_eq.mpr hmod + rw [hcond] + refine ⟨A * 2,1 + H,K :: da,rfl,DigitVal.zero hD,?_⟩ + rw [pow_two_one_add]; omega + · have hcond : (k % 2 == 0) = false := beq_false_of_ne (by omega) + rw [hcond] + refine ⟨1 + A * 2,1 + H,Q :: da,rfl,DigitVal.one hD,?_⟩ + rw [pow_two_one_add]; omega +def loc_z31 (u : WordList) : Option (WordList) := + let (carry,eff) := loc_z2T u 0 [] + if carry == 1 then + let fuel := V :: V :: V :: V :: eff + match loc_z2Y fuel eff 12 [] with + | some (k,v) => + match loc_zPf fuel k with + | some ws => some (V :: (v ++ V :: ws)) + | none => none + | none => none + else none +theorem loc_z32 (u out : WordList) (hR : loc_z31 u = some out) : loc_Step u out := by + dsimp [loc_z31] at hR + generalize hE : loc_z2T u 0 [] = ce at hR + rcases ce with ⟨carry,eff⟩ + dsimp at hR + cases hC : (carry == 1) with + | false => rw [hC] at hR; contradiction + | true => + rw [hC] at hR; dsimp at hR + have rfl_c : carry = 1 := beq_iff_eq.mp hC + subst rfl_c + cases hS : loc_z2Y (V :: V :: V :: V :: eff) eff 12 [] with + | none => rw [hS] at hR; contradiction + | some kv => + rcases kv with ⟨k,v⟩ + rw [hS] at hR; dsimp at hR + cases hP : loc_zPf (V :: V :: V :: V :: eff) k with + | none => rw [hP] at hR; contradiction + | some ws => + rw [hP] at hR; dsimp at hR + injection hR with hR; subst hR + rcases loc_z2U u 0 [] 1 eff hE with ⟨w1,rfl,hEff⟩ + rcases loc_z2Z (V :: V :: V :: V :: eff) eff 12 [] k v hS with ⟨w2,a,b,rfl,hScan⟩ + rcases loc_z30 (V :: V :: V :: V :: eff) k ws hP with ⟨A,J,da,rfl,hDA,hSum⟩ + exact loc_Step.intro u eff k v a b J A da hEff hScan hDA hSum +def loc_zSw : WordList -> WordList -> Option (WordList) + | [],u => some u + | V :: p,V :: u => loc_zSw p u + | K :: p,K :: u => loc_zSw p u + | Q :: p,Q :: u => loc_zSw p u + | _,_ => none +theorem loc_z33 (p : WordList) : + ∀ (u v : WordList),loc_zSw p u = some v -> u = p ++ v := by + induction p with + | nil => intro u v h; injection h + | cons w p ih => + intro u v h + cases u with + | nil => cases w <;> contradiction + | cons x u => + cases w <;> cases x <;> try contradiction + all_goals + dsimp [loc_zSw] at h + rw [ih u v h]; rfl +theorem loc_z34 (u pre rest : WordList) + (hE : loc_zSw pre (u.reverseAux []) = some rest) : + u = rest.reverseAux pre.reverse := by + have h1 := loc_z33 pre u.reverse rest hE + have h2 := congrArg List.reverse h1 + simp [List.reverseAux_eq] at h2 ⊢ + exact h2 +def loc_zHn : WordList -> Nat -> Option Nat + | [],h => some h + | V :: u,h => loc_zHn u (h + 1) + | _ :: _,0 => none + | _ :: u,h + 1 => loc_zHn u h +theorem loc_z35 (u : WordList) : + ∀ (h H : Nat),loc_zHn u h = some H -> + wordScale u * ((2 ^ H : Nat) : Rat) = ((2 ^ h : Nat) : Rat) := by + induction u with + | nil => + intro h H hE + injection hE with hE; subst hE + simp [wordScale] + | cons w u ih => + intro h H hE + cases w + · dsimp [loc_zHn,wordScale] at hE ⊢ + have hih := ih (h + 1) H hE + rw [Nat.pow_succ] at hih + push_cast at hih ⊢; linarith + · cases h with + | zero => contradiction + | succ h => + dsimp [loc_zHn,wordScale] at hE ⊢ + have hih := ih h H hE + rw [Nat.pow_succ] + push_cast at hih ⊢; linarith + · cases h with + | zero => contradiction + | succ h => + dsimp [loc_zHn,wordScale] at hE ⊢ + have hih := ih h H hE + rw [Nat.pow_succ] + push_cast at hih ⊢; linarith +def loc_z36 : WordList -> WordList -> Option (WordList × WordList) + | [],_ => none + | V :: u,ds => some (u.reverseAux [V],ds) + | w :: u,ds => loc_z36 u (w :: ds) +theorem loc_z37 (u : WordList) : + ∀ (ds p tail : WordList),loc_z36 u ds = some (p,tail) -> + ds.all loc_z2M = true -> + u.reverseAux ds = p ++ tail /\ tail.all loc_z2M = true /\ (∃ v,p = v ++ [V]) := by + induction u with + | nil => intro ds p tail hE _; contradiction + | cons w u ih => + intro ds p tail hE hD + cases w + · dsimp [loc_z36] at hE + injection hE with h1; injection h1 with h1 h2; subst h1 h2 + refine ⟨by simp [List.reverseAux_eq],hD,u.reverse,by simp [List.reverseAux_eq]⟩ + · dsimp [loc_z36] at hE + have hD' : (K :: ds).all loc_z2M = true := by simp [loc_z2M,hD] + exact ih (K :: ds) p tail hE hD' + · dsimp [loc_z36] at hE + have hD' : (Q :: ds).all loc_z2M = true := by simp [loc_z2M,hD] + exact ih (Q :: ds) p tail hE hD' +def loc_z38 (u : WordList) : Option (WordList × WordList) := + loc_z36 (u.reverseAux []) [] +theorem loc_z39 (u p ds : WordList) (hE : loc_z38 u = some (p,ds)) : + u = p ++ ds /\ ds.all loc_z2M = true /\ (∃ v,p = v ++ [V]) := by + rcases loc_z37 (u.reverseAux []) [] p ds hE rfl with ⟨hU,hD,hEnd⟩ + simp [List.reverseAux_eq] at hU + exact ⟨hU,hD,hEnd⟩ +def loc_z3a (n : Nat) : Nat := (n + 1) / 2 +theorem loc_z3b (n : Nat) : (n : Rat) <= 2 * ((loc_z3a n : Nat) : Rat) := by + have h : n <= (loc_z3a n) * 2 := by unfold loc_z3a; omega + have hq : (n : Rat) <= (((loc_z3a n) * 2 : Nat) : Rat) := by exact_mod_cast h + push_cast at hq + linarith +def loc_z3c (c0 c1 : Nat) : WordList -> Nat -> Nat + | [],n => n + | V :: u,n => loc_z3c c0 c1 u (loc_z3a n) + | K :: u,n => loc_z3c c0 c1 u (n * 2 + c0) + | Q :: u,n => loc_z3c c0 c1 u (n * 2 + c1) +theorem loc_z3d (c0 c1 : Nat) (u : WordList) : + ∀ (n : Nat), + (c0 : Rat) * wordMassK u.reverse + (c1 : Rat) * wordMassQ u.reverse + wordScale u.reverse * (n : Rat) <= + ((loc_z3c c0 c1 u n : Nat) : Rat) := by + induction u with + | nil => + intro n + simp [wordMassK,wordMassQ,wordScale,loc_z3c] + | cons w u ih => + intro n + have hsp := wordScale_pos u.reverse + cases w + · dsimp [loc_z3c] + rw [List.reverse_cons,wordMassK_append,wordMassQ_append,wordScale_append] + dsimp [wordMassK,wordMassQ,wordScale] + have hhu := loc_z3b n + have hih := ih (loc_z3a n) + nlinarith + · dsimp [loc_z3c] + rw [List.reverse_cons,wordMassK_append,wordMassQ_append,wordScale_append] + dsimp [wordMassK,wordMassQ,wordScale] + have hih := ih (n * 2 + c0) + push_cast at hih + nlinarith + · dsimp [loc_z3c] + rw [List.reverse_cons,wordMassK_append,wordMassQ_append,wordScale_append] + dsimp [wordMassK,wordMassQ,wordScale] + have hih := ih (n * 2 + c1) + push_cast at hih + nlinarith +theorem loc_z3e (c0 c1 : Nat) (u : WordList) (n : Nat) : + (c0 : Rat) * wordMassK u + (c1 : Rat) * wordMassQ u + wordScale u * (n : Rat) <= + ((loc_z3c c0 c1 (u.reverseAux []) n : Nat) : Rat) := by + have h := loc_z3d c0 c1 u.reverse n + simpa [List.reverseAux_eq,List.reverse_reverse] using h +def loc_z3f : WordList := [Q,Q,K] ++ List.replicate 14 Q +theorem loc_z3g : + wordMassK loc_z3f = 4 /\ wordScale loc_z3f * wordScale (List.replicate 16 V) = 2 := by + constructor + · norm_num [loc_z3f,List.replicate,wordMassK] + · norm_num [loc_z3f,List.replicate,wordScale] +theorem loc_z3h {B H : Nat} {db u : WordList} + (hD : DigitVal B H db) + (hHeight : wordScale u * ((2 ^ H : Nat) : Rat) = 1) + (hHi : ∃ lo,db = lo ++ loc_z3f) : + (3 / 2) * wordScale (List.replicate 16 V) <= wordScale u * wordMassK db /\ + wordScale u * wordMassK db <= (5 / 2) * wordScale (List.replicate 16 V) := by + rcases hHi with ⟨lo,rfl⟩ + have hDig := loc_z2O hD + rw [List.all_append] at hDig + rcases Bool.and_eq_true_iff.mp hDig with ⟨hDigLo,_⟩ + rcases loc_z2N lo hDigLo with ⟨A,hDA⟩ + rcases digitVal_scale_and_mass hDA with ⟨hLs,hLm,_⟩ + rcases digitVal_scale_and_mass hD with ⟨hDs,_,_⟩ + have hSplitLo := wordMass_eq_add lo + have hWlo := wordMass_nonneg lo + have hSu := wordScale_pos u + have hSlo := wordScale_pos lo + have hSh := wordScale_pos loc_z3f + have hS16 := wordScale_pos (List.replicate 16 V) + rcases loc_z3g with ⟨hZ,hS⟩ + rw [wordScale_append] at hDs + let x := wordScale u * wordScale lo + have hX : x * wordScale loc_z3f = 1 := by + change (wordScale u * wordScale lo) * wordScale loc_z3f = 1 + nlinarith + have hXa : 2 * x = wordScale (List.replicate 16 V) := by nlinarith + rw [wordMassK_append,hZ] + have hZlo_le : wordMassK lo <= wordScale lo - 1 := by linarith + refine ⟨by nlinarith,by nlinarith⟩ +def loc_z3i (rest : WordList) : Bool := + decide (loc_z3c 65536 65536 (rest.reverseAux []) 0 <= 16) +theorem loc_z3j (rest : WordList) (hE : loc_z3i rest = true) : + wordMass rest <= 1 / 4096 := by + have hle : loc_z3c 65536 65536 (rest.reverseAux []) 0 <= 16 := of_decide_eq_true hE + have hle_q : ((loc_z3c 65536 65536 (rest.reverseAux []) 0 : Nat) : Rat) <= 16 := by exact_mod_cast hle + have hR := loc_z3e 65536 65536 rest 0 + have hSplit := wordMass_eq_add rest + push_cast at hR + linarith +def loc_z3k (orig : WordList) : Bool := + match loc_z38 orig with + | none => false + | some (u,tail) => + match loc_zSw [Q] (tail.reverseAux []) with + | none => false + | some rd => + let da := rd.reverseAux [] + match loc_zSw (List.replicate 16 V ++ [Q]) u,loc_zHn u 0 with + | some rest,some H => + if 33 <= H && H == da.length then + let (carry,_) := loc_z2T u 0 [] + let (last,db) := loc_z2T da carry [] + if last == 1 then + match loc_zSw (List.replicate 7 Q) db, + loc_zSw loc_z3f.reverse (db.reverseAux []) with + | some _,some _ => loc_z3i rest + | _,_ => false + else false + else false + | _,_ => false +theorem loc_z3l (orig : WordList) (hCheck : loc_z3k orig = true) : + Good 16 orig := by + unfold loc_z3k at hCheck + cases hC : loc_z38 orig with + | none => rw [hC] at hCheck; contradiction + | some utail => + rcases utail with ⟨u,tail⟩ + rw [hC] at hCheck; dsimp only [] at hCheck + cases hTop : loc_zSw [Q] (tail.reverseAux []) with + | none => rw [hTop] at hCheck; contradiction + | some rd => + rw [hTop] at hCheck; dsimp only [] at hCheck + cases hStart : loc_zSw (List.replicate 16 V ++ [Q]) u with + | none => rw [hStart] at hCheck; contradiction + | some rest => + rw [hStart] at hCheck + cases hHeight : loc_zHn u 0 with + | none => rw [hHeight] at hCheck; contradiction + | some H => + rw [hHeight] at hCheck; dsimp only [] at hCheck + cases hCondH : (decide (33 <= H) && (H == (rd.reverseAux []).length)) with + | false => rw [hCondH] at hCheck; contradiction + | true => + rw [hCondH] at hCheck + rcases Bool.and_eq_true_iff.mp hCondH with ⟨hH33,hWidth⟩ + have hHbound : 33 <= H := of_decide_eq_true hH33 + have hWidth_eq : H = (rd.reverseAux []).length := beq_iff_eq.mp hWidth + generalize hE : loc_z2T u 0 [] = ce at hCheck + rcases ce with ⟨carry,eff⟩ + generalize hF : loc_z2T (rd.reverseAux []) carry [] = ldb at hCheck + rcases ldb with ⟨last,db⟩ + cases hLast : (last == 1) with + | false => rw [hLast] at hCheck; contradiction + | true => + rw [hLast] at hCheck + have rfl_last : last = 1 := beq_iff_eq.mp hLast + subst rfl_last + cases hLow : loc_zSw (List.replicate 7 Q) db with + | none => rw [hLow] at hCheck; contradiction + | some lo => + rw [hLow] at hCheck + cases hHigh : loc_zSw loc_z3f.reverse (db.reverseAux []) with + | none => rw [hHigh] at hCheck; contradiction + | some hi => + rw [hHigh] at hCheck + have hMass := loc_z3j rest hCheck + rcases loc_z39 orig u tail hC with ⟨hOrig,hDig,hEnd⟩ + have hTail : tail = rd.reverseAux [] ++ [Q] := by + have h1 := loc_z34 tail [Q] rd hTop + simpa [List.reverseAux_eq] using h1 + rw [hTail,List.all_append] at hDig + rcases Bool.and_eq_true_iff.mp hDig with ⟨hDigDa,_⟩ + rcases loc_z2N (rd.reverseAux []) hDigDa with ⟨A,hDA⟩ + rw [<- hWidth_eq] at hDA + rcases loc_z2U u 0 [] carry eff hE with ⟨v1,rfl,hEff⟩ + rcases loc_z2U (rd.reverseAux []) carry [] 1 db hF with ⟨v2,rfl,hEffD⟩ + rcases wordEffect_digitVal hEffD hDA with ⟨B,hDB,hSum⟩ + have hStart_eq := loc_z33 (List.replicate 16 V ++ [Q]) u rest hStart + simp only [List.append_assoc,List.singleton_append] at hStart_eq + have hHeight_eq := loc_z35 u 0 H hHeight + have hHigh' : ∃ x,db = x ++ loc_z3f := by + have h1 := loc_z34 db loc_z3f.reverse hi hHigh + refine ⟨hi.reverse,?_⟩ + simpa [List.reverseAux_eq] using h1 + rcases loc_z3h hDB hHeight_eq hHigh' with ⟨hDlo,hDhi⟩ + rw [hOrig,hTail,<- List.append_assoc] + refine Good.intro 16 H u A (rd.reverseAux []) carry eff B db (1 / 32) + (by decide) hHbound ⟨rest,hStart_eq⟩ hEnd hHeight_eq hDA hEff (by omega) hDB + (loc_Reserve.even 8 (1 / 32) (by norm_num)) ?_ hDlo hDhi + ⟨lo,loc_z33 (List.replicate 7 Q) db lo hLow⟩ + rw [hStart_eq,loc_z2G] + have hSp := wordScale_pos (List.replicate 16 V) + nlinarith +inductive loc_Rounds : WordList -> WordList -> Prop where + | refl (u : WordList) : loc_Rounds u u + | next {u v w : WordList} : loc_Step u v -> loc_Rounds v w -> loc_Rounds u w +def loc_z3m : Nat -> WordList -> Bool + | 0,u => loc_z3k u + | n + 1,u => + match loc_z31 u with + | none => false + | some v => loc_z3m n v +theorem loc_z3n (n : Nat) : + ∀ (u : WordList),loc_z3m n u = true -> + ∃ v,loc_Rounds u v /\ Good 16 v := by + induction n with + | zero => + intro u hE + exact ⟨u,loc_Rounds.refl u,loc_z3l u hE⟩ + | succ n ih => + intro u hE + dsimp [loc_z3m] at hE + cases hV : loc_z31 u with + | none => rw [hV] at hE; contradiction + | some v => + rw [hV] at hE + rcases ih v hE with ⟨w,hR,hG⟩ + exact ⟨w,loc_Rounds.next (loc_z32 u v hV) hR,hG⟩ +def loc_z3o : WordList := [V,V,Q,V,V,V,V,K,Q,K,Q,K,Q] +def u_0 : WordList := loc_z3o +def u_1 : WordList := [V,V,V,Q,V,V,V,V,V,K,K,V,V,K,K,K,K,K,K,Q,Q] +def u_2 : WordList := [V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,K,Q,Q,Q,K,Q,Q,Q,K,K,K,K,K,K,Q,Q,Q] +def u_3 : WordList := [V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,V,V,Q,Q,Q,K,V,V,V,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q] +def u_4 : WordList := [V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q] +def u_5 : WordList := [V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,K,K,V,V,V,V,V,V,V,Q,V,V,V,K,K,K,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q] +def u_6 : WordList := [V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,Q,K,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,K,K,K,K,K,K,Q,Q,V,K,K,Q,V,V,V,V,V,V,V,V,V,V,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q] +def u_7 : WordList := [V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,K,K,V,K,V,V,V,K,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,Q,K,K,K,V,V,V,V,V,V,Q,V,V,V,V,K,K,K,K,Q,Q,Q,Q,Q,Q,K,K,K,K,K,K,K,K,K,K,Q,K,K,Q,Q,K,K,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q] +def u_8 : WordList := [V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,K,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,Q,Q,K,K,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,K,K,K,K,K,K,K,V,K,V,K,V,V,V,V,V,V,V,V,V,Q,K,K,Q,V,V,V,V,V,V,V,V,V,V,V,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,K,K,Q,K,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q] +def u_9 : WordList := [V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,K,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,Q,V,K,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,K,V,V,V,V,V,V,V,V,V,Q,Q,K,K,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,K,V,V,K,K,V,V,V,K,V,V,V,V,V,V,V,V,K,V,V,V,Q,V,V,V,V,V,Q,K,K,Q,V,V,V,V,V,V,Q,V,V,V,V,V,K,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def u_10 : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,K,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,Q,K,K,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,K,Q,Q,K,Q,Q,K,Q,V,V,V,Q,Q,V,K,Q,K,K,V,V,V,V,V,V,K,K,V,V,V,V,V,V,K,V,V,K,V,V,V,Q,V,V,V,V,V,Q,K,K,Q,V,V,V,V,V,V,V,V,V,V,V,V,K,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,K,Q,Q,Q,Q,K,K,K,Q,K,K,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,K,K,Q,Q,K,Q,Q,Q,Q,K,Q,Q,K,Q,Q,K,K,K,Q,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def u_11 : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,K,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,K,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,Q,K,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,K,V,K,Q,K,Q,V,V,Q,K,Q,K,V,V,V,V,V,K,Q,Q,Q,Q,V,V,V,V,V,V,V,V,Q,K,V,Q,V,V,Q,V,V,V,Q,Q,V,Q,K,V,V,V,V,V,Q,V,V,V,K,V,V,V,Q,V,V,V,V,V,Q,K,K,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,K,K,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,K,K,K,K,K,K,K,K,K,K,K,Q,Q,K,Q,K,Q,K,Q,Q,K,Q,K,K,K,K,K,K,K,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def u_12 : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,K,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,K,V,Q,V,V,Q,K,V,V,V,V,V,V,V,K,V,V,V,V,V,V,V,V,V,Q,Q,V,Q,V,V,Q,V,V,V,Q,Q,V,K,Q,V,V,V,V,V,Q,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,Q,K,K,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,K,K,Q,Q,K,Q,K,Q,Q,V,K,K,K,Q,V,V,V,K,K,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,K,Q,K,Q,K,K,V,V,V,V,V,Q,V,V,K,V,V,V,V,V,Q,Q,Q,Q,V,V,V,V,Q,K,V,V,V,V,V,K,V,V,Q,V,V,V,V,V,K,K,V,V,V,V,V,V,K,V,V,K,V,V,V,Q,V,V,V,V,V,Q,K,K,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,K,K,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,Q,K,K,Q,Q,Q,K,Q,Q,Q,Q,Q,K,Q,K,Q,Q,K,Q,K,K,K,K,K,K,Q,Q,K,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,K,K,K,Q,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def u_13 : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,K,V,V,Q,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,Q,Q,V,K,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,K,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,Q,K,V,K,V,V,V,V,K,Q,V,V,V,Q,V,V,V,V,V,V,Q,Q,Q,Q,V,Q,V,Q,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,Q,Q,V,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,Q,K,K,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,Q,V,K,V,V,K,V,Q,Q,Q,Q,K,Q,V,Q,V,V,K,V,V,V,V,V,V,V,Q,V,V,K,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,K,V,V,V,V,V,Q,Q,Q,Q,V,V,V,V,V,V,V,V,V,V,K,V,V,Q,V,V,V,V,V,K,K,V,V,V,V,V,V,K,V,V,K,V,V,V,Q,V,V,V,V,V,Q,K,K,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,K,K,K,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,K,Q,Q,K,Q,K,K,K,K,K,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,K,Q,K,Q,Q,Q,K,K,K,K,K,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,Q,K,Q,K,Q,Q,Q,K,K,Q,K,Q,Q,Q,K,K,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +def u_14 : WordList := [V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,Q,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,V,Q,V,Q,V,Q,V,V,Q,K,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,Q,Q,V,K,V,V,Q,V,V,V,Q,Q,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,Q,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,V,Q,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,Q,Q,V,V,K,V,Q,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,Q,Q,V,V,V,V,V,Q,Q,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,V,K,V,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,Q,V,V,V,V,Q,Q,V,V,V,V,Q,V,Q,V,V,Q,V,K,V,K,V,V,Q,V,V,Q,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,Q,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,Q,V,V,V,Q,V,V,V,V,V,Q,Q,K,K,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,Q,V,V,V,V,Q,Q,V,Q,V,V,V,V,Q,K,Q,V,V,V,V,Q,V,V,V,Q,K,V,V,V,V,V,V,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,V,K,Q,K,Q,V,V,V,K,K,K,K,K,V,V,V,V,V,V,V,V,Q,Q,K,V,Q,Q,K,V,Q,V,V,V,V,V,V,V,V,Q,V,V,V,K,V,Q,V,Q,Q,K,K,V,V,V,V,V,V,Q,K,V,K,V,V,V,V,V,V,Q,V,V,V,K,V,V,V,V,V,V,V,Q,V,V,V,V,V,V,V,V,V,V,V,V,Q,V,V,K,V,V,V,V,V,Q,Q,Q,Q,V,V,V,V,V,V,V,V,V,V,K,V,V,Q,V,V,V,V,V,K,K,V,V,V,V,V,V,K,V,V,K,V,V,V,Q,V,V,V,V,V,Q,K,K,Q,V,V,V,V,V,V,V,V,V,V,V,V,V,V,K,K,K,K,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,K,K,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,K,K,K,K,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,K,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,K,Q,K,Q,Q,K,Q,K,K,K,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,K,K,K,Q,K,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,K,Q,Q,Q,K,K,K,K,K,Q,Q,K,K,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,K,Q,K,Q,K,K,Q,K,Q,Q,K,K,Q,Q,K,K,K,Q,Q,Q,K,K,K,K,K,Q,Q,Q,K,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,K,K,Q,Q,Q,K,Q,K,Q,K,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,K,Q,Q,Q,K,K,Q,Q,K,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,K,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,K,Q,K,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,K,Q,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,K,K,Q,K,Q,K,Q,Q,Q,Q,Q,Q,K,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,K,K,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,K,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q] +theorem step_0 : loc_z31 u_0 = some u_1 := by decide +theorem step_1 : loc_z31 u_1 = some u_2 := by decide +theorem step_2 : loc_z31 u_2 = some u_3 := by decide +theorem step_3 : loc_z31 u_3 = some u_4 := by decide +theorem step_4 : loc_z31 u_4 = some u_5 := by decide +theorem step_5 : loc_z31 u_5 = some u_6 := by decide +theorem step_6 : loc_z31 u_6 = some u_7 := by decide +theorem step_7 : loc_z31 u_7 = some u_8 := by decide +theorem step_8 : loc_z31 u_8 = some u_9 := by decide +theorem step_9 : loc_z31 u_9 = some u_10 := by decide +theorem step_10 : loc_z31 u_10 = some u_11 := by decide +theorem step_11 : loc_z31 u_11 = some u_12 := by decide +theorem step_12 : loc_z31 u_12 = some u_13 := by decide +theorem step_13 : loc_z31 u_13 = some u_14 := by decide +theorem good_14 : loc_z3k u_14 = true := by decide +theorem z3p_rounds : loc_Rounds loc_z3o u_14 := by + exact loc_Rounds.next (loc_z32 u_0 u_1 step_0) (loc_Rounds.next (loc_z32 u_1 u_2 step_1) (loc_Rounds.next (loc_z32 u_2 u_3 step_2) (loc_Rounds.next (loc_z32 u_3 u_4 step_3) (loc_Rounds.next (loc_z32 u_4 u_5 step_4) (loc_Rounds.next (loc_z32 u_5 u_6 step_5) (loc_Rounds.next (loc_z32 u_6 u_7 step_6) (loc_Rounds.next (loc_z32 u_7 u_8 step_7) (loc_Rounds.next (loc_z32 u_8 u_9 step_8) (loc_Rounds.next (loc_z32 u_9 u_10 step_9) (loc_Rounds.next (loc_z32 u_10 u_11 step_10) (loc_Rounds.next (loc_z32 u_11 u_12 step_11) (loc_Rounds.next (loc_z32 u_12 u_13 step_12) (loc_Rounds.next (loc_z32 u_13 u_14 step_13) (loc_Rounds.refl u_14)))))))))))))) +theorem z3p : ∃ v, loc_Rounds loc_z3o v /\ Good 16 v := ⟨u_14, z3p_rounds, loc_z3l u_14 good_14⟩ +inductive Num : Nat -> BitWord -> List Call -> Prop where + | zero : Num 0 one [] + | odd (n : Nat) : Num (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) +theorem z3q {k : Nat} (hK : 0 < k) : ∃ hs,Num k [] hs := by + rcases even_or_odd_mul_two k with ⟨a,rfl⟩ | ⟨a,rfl⟩ + · cases a with + | zero => omega + | succ a => + have heq : (a + 1) * 2 = 2 + a * 2 := by omega + rw [heq]; exact ⟨[.cj] ++ [.ch] ^ a,Num.even a⟩ + · exact ⟨[.cp] ++ [.ch] ^ a,Num.odd a⟩ +theorem z3r {k : Nat} {hs hs' : List Call} (h1 : Num k [] hs) (h2 : Num k [] hs') : + hs = hs' := by + cases h1 with + | @odd n => + generalize hk : 1 + n * 2 = k0 at h2 + cases h2 with + | @odd m => + have hnm : n = m := by omega + subst hnm; rfl + | even _ => omega + | @even n => + generalize hk : 2 + n * 2 = k0 at h2 + cases h2 with + | odd _ => omega + | @even m => + have hnm : n = m := by omega + subst hnm; rfl +def z3s (k : Nat) (r r' : HalfTape) : Prop := + ∀ w hs,Num k w hs -> Side hs (w +> r) r' +theorem z3t {r r' : HalfTape} (h : z3s 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl +theorem z3u {n : Nat} {r r' : HalfTape} + (hI : z3s (n * 2) r r') : z3s (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := z3t hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0k (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine zSc (z0y n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using hI [] _ hN2 +theorem z3v {n : Nat} {r r' : HalfTape} + (hI : z3s (n * 2) r r') : z3s (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := z3t hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0A (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine zSc (z0B n) ?_ + have hN2 : Num ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using hI [] _ hN2 +theorem z3w {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hZ : A = 0) : + evalWords da default = default := by + induction hD with + | nil => rfl + | @zero A H u _ ih => + have hA0 : A = 0 := by omega + dsimp only [evalWords] + rw [ih hA0,zDd] + | one _ => omega +theorem z3x {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hPos : 0 < A) : + z3s ((A - 1) * 2) default (evalWords da default) := by + induction hD with + | nil => omega + | @zero A H u _ ih => + have hA_pos : 0 < A := by omega + have hIH := ih hA_pos + have hs := z3u hIH + rw [zDd] at hs + have heq : (A * 2 - 1) * 2 = 2 + (A - 1) * 4 := by omega + dsimp [evalWords] + rwa [heq] + | @one A H u hDu ih => + cases A with + | zero => + change z3s 0 default (d1 +> evalWords u default) + rw [z3w hDu rfl] + intro w hs hN + generalize hk : 0 = k0 at hN + cases hN with + | zero => + have hd : d1 +> (default : HalfTape) = one +> default := by simp [d1,one] + rw [hd]; exact Side.nil (one +> default) + | odd _ => omega + | even _ => omega + | succ A => + have hA_pos : 0 < A + 1 := by omega + have hIH := ih hA_pos + have heq_in : (A + 1 - 1) * 2 = A * 2 := by omega + rw [heq_in] at hIH + have hs := z3v hIH + rw [zDd] at hs + have heq : (1 + (A + 1) * 2 - 1) * 2 = 4 + A * 4 := by omega + dsimp [evalWords] + rwa [heq] +theorem zEd {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ∀ {A H : Nat},DigitVal A H v -> Seg ([Call.ch] ^ n) ([Call.ch] ^ b) (wordsToBits u) (wordsToBits v) := by + induction hI with + | nil n => + intro A H _ + exact z0b ([Call.ch] ^ n) + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | d00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0o _) (ih hD') + | d01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0p _) (ih hD') + | d10 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0q _) (ih hD') + | d11 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A',H',hD',_,_⟩ + exact zS0 (z0r _) (ih hD') +theorem z3y {n : Nat} {hs hs' : List Call} + (hI : Num (3 + n) [] hs) (hJ : Num (2 + n * 2) [] hs') : + Seg hs ([Call.ch] ++ hs') t t := by + generalize hk1 : 3 + n = k1 at hI + generalize hk2 : 2 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = m * 2 := by omega + subst hq + rw [h1m] + exact z0s m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0t m +theorem loc_z3z {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' (d1 ++ d0) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | odd _ => omega + | @even q => + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + have hq : q = 1 + m * 2 := by omega + subst hq + rw [h1m] + exact z0u m + | @even m => + cases hJ with + | odd _ => omega + | @even q => + have hq : q = m * 2 := by omega + subst hq + exact z0v m +theorem loc_z3A {n : Nat} {hs hs' : List Call} + (hI : Num (1 + n) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' (d1 ++ d1) t := by + generalize hk1 : 1 + n = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | @odd m => + cases hJ with + | @odd q => + have hq : q = m * 2 := by omega + subst hq + exact z0w m + | even _ => omega + | @even m => + cases hJ with + | @odd q => + have hq : q = 1 + m * 2 := by omega + subst hq + exact z0x m + | even _ => omega +theorem loc_z3B {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 2 + q * 2 := by omega + subst hm + exact z0y q +theorem loc_z3C {n : Nat} {hs hs' : List Call} + (hI : Num (2 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d0 := by + generalize hk1 : 2 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = q * 2 := by omega + subst hm + exact z0z q + | even _ => omega +theorem loc_z3D {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (n * 2) [] hs') : + Seg hs hs' d0 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | odd _ => omega + | @even q => + cases n with + | zero => omega + | succ n => + have hm : m = 3 + q * 2 := by omega + subst hm + exact z0B q +theorem loc_z3E {n : Nat} {hs hs' : List Call} + (hI : Num (4 + n * 4) [] hs) (hJ : Num (1 + n * 2) [] hs') : + Seg hs hs' d1 d1 := by + generalize hk1 : 4 + n * 4 = k1 at hI + generalize hk2 : 1 + n * 2 = k2 at hJ + cases hI with + | odd _ => omega + | @even m => + cases hJ with + | @odd q => + have hm : m = 1 + q * 2 := by omega + subst hm + exact z0C q + | even _ => omega +theorem loc_z3F {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) : + ∀ {u : WordList} {n n' : Nat} {hs hs' : List Call}, + WordEffect n u n' v -> Num k [] hs -> Num k' [] hs' -> + Seg (([Call.ch] ^ n) ++ hs) (([Call.ch] ^ n') ++ hs') (wordsToBits u) (wordsToBits w) := by + induction hI with + | nil k => + intro u n n' hs hs' hE hN hN' + cases hE + rw [z3r hN hN'] + exact z0b (([Call.ch] ^ n) ++ hs') + | @T m _ _ _ _ _ _ ih => + intro u0 n0 n1 hs hs' hE hN hN' + cases hE with + | T hSub => + rcases z3q (by omega : 0 < 2 + m * 2) with ⟨hs0,hN0⟩ + have hIH := ih hSub hN0 hN' + have hStep := zSg (H_T n0) (z3y hN hN0) + have heq : ([Call.ch] ^ (n0 * 2)) ++ ([Call.ch] ++ hs0) = ([Call.ch] ^ (1 + n0 * 2)) ++ hs0 := by + have h1 : 1 + n0 * 2 = n0 * 2 + 1 := by omega + rw [h1,z07,z06,List.append_assoc] + rw [heq] at hStep + exact zS0 hStep hIH + | @pair0 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,K] ++ u) at hE + rcases wordEffect_split_output [Q,K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z3q hPos with ⟨hs0,hN0⟩ + have hD10 : DigitVal 1 2 [Q,K] := DigitVal.one (DigitVal.zero DigitVal.nil) + have hStep := zSg (zEd hL hD10) (loc_z3z hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @pair1 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q,Q] ++ u) at hE + rcases wordEffect_split_output [Q,Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z3q (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD11 : DigitVal 3 2 [Q,Q] := DigitVal.one (DigitVal.one DigitVal.nil) + have hStep := zSg (zEd hL hD11) (loc_z3A hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short00 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z3q hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (loc_z3B hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short01 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z3q (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (loc_z3C hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short10 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([K] ++ u) at hE + rcases wordEffect_split_output [K] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + have hPos : 0 < m * 2 := phaseScan_pos_of_out_pos hSub (by cases hN' <;> omega) + rcases z3q hPos with ⟨hs0,hN0⟩ + have hD0 : DigitVal 0 1 [K] := DigitVal.zero DigitVal.nil + have hStep := zSg (zEd hL hD0) (loc_z3D hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') + | @short11 m u _ _ _ _ hSub ih => + intro u0 n0 n1 hs hs' hE hN hN' + change WordEffect n0 u0 n1 ([Q] ++ u) at hE + rcases wordEffect_split_output [Q] hE with ⟨u1,u2,q,rfl,hL,hR⟩ + rcases z3q (by omega : 0 < 1 + m * 2) with ⟨hs0,hN0⟩ + have hD1 : DigitVal 1 1 [Q] := DigitVal.one DigitVal.nil + have hStep := zSg (zEd hL hD1) (loc_z3E hN hN0) + rw [wordsToBits_append] + exact zS0 hStep (ih hR hN0 hN') +theorem loc_z3G {n : Nat} {r r' : HalfTape} + (hI : z3s (n * 2) r r') : z3s (1 + n) (d1 +> (d0 +> r)) (t +> r') := by + intro w hs hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil,<- append_assoc d1 d0 r] + cases m with + | zero => + have hn0 : n * 2 = 0 := by omega + rw [hn0] at hI + have hr' := z3t hI + subst hr' + rw [<- append_assoc t one r] + exact zSc z0g (Side.nil r) + | succ m => + have h1m : m + 1 = 1 + m := by omega + rw [h1m] + refine zSc (z0u m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : n * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using hI [] _ hN2 + | @even m => + simp only [append_nil,<- append_assoc d1 d0 r] + refine zSc (z0v m) ?_ + have hN2 : Num (n * 2) [] ([.cj] ++ [.ch] ^ (m * 2)) := by + have hm : n * 2 = 2 + (m * 2) * 2 := by omega + rw [hm]; exact Num.even (m * 2) + simpa using hI [] _ hN2 +theorem loc_z3H {k : Nat} {v : WordList} {k' : Nat} {w : WordList} {a b : Rat} + (hI : PhaseScan k v k' w a b) {u : WordList} {r' : HalfTape} + (hE : WordEffect 0 u 1 v) (hK : 0 < k') (hC : z3s k' (d1 +> default) r') : + z3s k (evalWords u default) (evalWords w r') := by + intro w0 hs hN + have hPosK : 0 < k := phaseScan_pos_of_out_pos hI hK + have hw0 : w0 = [] := by + cases hN with + | zero => omega + | odd _ => rfl + | even _ => rfl + subst hw0 + rcases z3q hK with ⟨hs',hN'⟩ + have hSeg := loc_z3F hI hE hN hN' + dsimp at hSeg + have hSide_out : Side ([Call.ch] ++ hs') (d0 +> default) r' := by + rw [zDd] + exact z08 z0D (hC [] hs' hN') + have hSide := zSc hSeg hSide_out + rw [zDd] at hSide + rwa [wordsToBits_append_tape,wordsToBits_append_tape] at hSide +theorem loc_z3I {orig out : WordList} (hS : loc_Step orig out) : + ∃ r,z3s 12 (evalWords orig default) r /\ evalWords out default = t +> r := by + rcases hS with ⟨eff,k,v,a,b,J,A,da,hE,hI,hDA,hSum⟩ + have hDA1 : DigitVal (A + 2 ^ J) (J + 1) (da ++ [Q]) := by + have h1 := digitVal_append hDA (DigitVal.one DigitVal.nil) + simpa using h1 + rw [hSum] at hDA1 + have hK_pos : 0 < k := by + have hp := pow_two_pos J + omega + have hC0 : z3s ((k - 1) * 2) default (evalWords (da ++ [Q]) default) := + z3x hDA1 hK_pos + have hC1 : z3s (1 + (k - 1)) (d1 +> (d0 +> default)) (t +> evalWords (da ++ [Q]) default) := + loc_z3G hC0 + have hk_eq : 1 + (k - 1) = k := by omega + rw [hk_eq,zDd] at hC1 + have hRun := loc_z3H hI hE hK_pos hC1 + refine ⟨evalWords v (t +> evalWords (da ++ [Q]) default),hRun,?_⟩ + simp [evalWords,evalWords_append] +theorem loc_z3J {r r' : HalfTape} (hI : z3s 12 r r') : + (zCf r) [target_tm]⊢⁺ zCf (t +> r') := by + have h_num : Num 12 [] ([.cj] ++ [.ch] ^ 5) := Num.even 5 + have hC := hI [] ([.cj] ++ [.ch] ^ 5) h_num + have hS := zSc z0F hC + rcases hS with _ | ⟨hca,hrest⟩ + rcases hrest with _ | ⟨hch,hnil⟩ + cases hnil + have h1 := zPt (z0G (w_init +> r)) (hca ([1] +> default)) + have h2 := zPt (z0H _) (hch lh) + have h3 := zPt h1 h2 + have heq : (w_init ++ t) +> r' = w_init +> (t +> r') := append_assoc w_init t r' + unfold zCf + rwa [heq] at h3 +theorem z3K {orig out : WordList} (hS : loc_Step orig out) : + (zCf (evalWords orig default)) [target_tm]⊢⁺ zCf (evalWords out default) := by + rcases loc_z3I hS with ⟨r,hC,hOut⟩ + rw [hOut] + exact loc_z3J hC +theorem z3L {u v : WordList} (hR : loc_Rounds u v) : + (zCf (evalWords u default)) [target_tm]⊢* zCf (evalWords v default) := by + induction hR with + | refl _ => exact ⟨0,rfl⟩ + | next hS _ ih => + rcases z3K hS with ⟨n,_,hn⟩ + rcases ih with ⟨m,hm⟩ + exact ⟨n + m,zMt target_tm _ _ _ n m hn hm⟩ +abbrev CCfg := Counter.CCfg (Fin 2) (Fin 6) +abbrev z3M (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev z3T (c : CCfg) : Option CCfg := Counter.bstep target_tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep target_tm n c +def z3X : CCfg := + ⟨A,0,[],[]⟩ +def z3Y : CCfg := + ⟨D,1,[0,1],[0,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,1,0,0,0,1]⟩ +def z3X_1 : CCfg := ⟨D,1,[0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1],[0, 0, 0, 1, 0, 0, 1]⟩ +def z3X_2 : CCfg := ⟨B,1,[1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1],[0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1]⟩ +def z3X_3 : CCfg := ⟨B,1,[1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1],[0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1]⟩ +def z3X_4 : CCfg := ⟨B,0,[1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1],[0, 0, 0, 0, 1, 0, 0, 0, 1]⟩ +def z3X_5 : CCfg := ⟨B,1,[1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1],[0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]⟩ +theorem z3Z_1 : zCm z3X 300 = some z3X_1 := by decide +theorem z40_1 : (z3M z3X) [target_tm]⊢^{300} (z3M z3X_1) := + Counter.bmultiStep_sound 300 z3X z3X_1 z3Z_1 +theorem z3Z_2 : zCm z3X_1 300 = some z3X_2 := by decide +theorem z40_2 : (z3M z3X_1) [target_tm]⊢^{300} (z3M z3X_2) := + Counter.bmultiStep_sound 300 z3X_1 z3X_2 z3Z_2 +theorem loc_z3Z_3 : zCm z3X_2 300 = some z3X_3 := by decide +theorem loc_z40_3 : (z3M z3X_2) [target_tm]⊢^{300} (z3M z3X_3) := + Counter.bmultiStep_sound 300 z3X_2 z3X_3 loc_z3Z_3 +theorem z3Z_4 : zCm z3X_3 300 = some z3X_4 := by decide +theorem z40_4 : (z3M z3X_3) [target_tm]⊢^{300} (z3M z3X_4) := + Counter.bmultiStep_sound 300 z3X_3 z3X_4 z3Z_4 +theorem z3Z_5 : zCm z3X_4 300 = some z3X_5 := by decide +theorem z40_5 : (z3M z3X_4) [target_tm]⊢^{300} (z3M z3X_5) := + Counter.bmultiStep_sound 300 z3X_4 z3X_5 z3Z_5 +theorem z3Z_6 : zCm z3X_5 272 = some z3Y := by decide +theorem z40_6 : (z3M z3X_5) [target_tm]⊢^{272} (z3M z3Y) := + Counter.bmultiStep_sound 272 z3X_5 z3Y z3Z_6 +theorem z40 : (z3M z3X) [target_tm]⊢^{1772} (z3M z3Y) := by + have h1 := zMt target_tm _ _ _ 300 300 z40_1 z40_2 + have h2 := zMt target_tm _ _ _ 600 300 h1 loc_z40_3 + have h3 := zMt target_tm _ _ _ 900 300 h2 z40_4 + have h4 := zMt target_tm _ _ _ 1200 300 h3 z40_5 + exact zMt target_tm _ _ _ 1500 272 h4 z40_6 +theorem z41 : + (init []) [target_tm]⊢* zCf (evalWords loc_z3o default) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = z3M z3X := rfl + have h_end : z3M z3Y = zCf (evalWords loc_z3o default) := by + simp [z3M,z3Y,zCf,zCL,lh,w_init,t,d0,d1,one,loc_z3o,evalWords] + refine ⟨1772,?_⟩ + rw [h_init,<- h_end] + exact z40 +theorem zIm {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d) = some c') : + (multiStep target_tm c j).isSome := by + rw [zMa] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +theorem z42 (m : Nat) : + ∃ N ≥ m,∃ p w,multiStep target_tm (init []) N = some (zCf (evalWords w default)) /\ Good p w := by + induction m with + | zero => + rcases z41 with ⟨k1,hk1⟩ + rcases z3p with ⟨v,hR,hG⟩ + rcases z3L hR with ⟨k2,hk2⟩ + exact ⟨k1 + k2,Nat.zero_le _,16,v, + zMt target_tm _ _ _ k1 k2 hk1 hk2,hG⟩ + | succ m ih => + rcases ih with ⟨N,hN,p,w,h_ms,h_good⟩ + rcases loc_z2L h_good with ⟨w',hStep,h_good'⟩ + rcases z3K hStep with ⟨k,hk_pos,h_step_k⟩ + exact ⟨N + k,Nat.add_le_add hN hk_pos,1 + p,w', + zMt target_tm _ _ _ N k h_ms h_step_k,h_good'⟩ + +end Solution + + +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 2000000 + + + +theorem is_does_not_halt : IsNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n,hn⟩ + rcases Solution.z42 (n + 1) with ⟨N,hN,_,_,h_N,_⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := Solution.zIm h_N + rw [Solution.zMs,hn] at h_some + exact h_some + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RBHHH_1RC0RF_1LD1RB_1LE0LD_1RB0LB_1RB1RA diff --git a/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC.lean b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC.lean new file mode 100644 index 00000000..9ae40c12 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC.lean @@ -0,0 +1,49 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +def stateMap_m0762 : Fin 6 → Fin 6 + | 0 => 4 + | 1 => 1 + | 2 => 2 + | 3 => 0 + | 4 => 3 + | 5 => 5 + +public section + +theorem is_not_halt : IsNotHalt target := by + exact Counter.does_not_halt_of_conj_stem + (M_tgt := target) + (M_src := BusyBeaver.M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC.target) + (σ := stateMap_m0762) (f := true) + (c₁ := (default : ListBlank (Fin 2)) {{3}}> default) + (by decide) (Counter.init_reaches_conjCfg_default rfl) + BusyBeaver.M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC.is_not_halt_from_0756 + +end + +end BusyBeaver.M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC diff --git a/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RB0LC.lean b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RB0LC.lean new file mode 100644 index 00000000..0f7d81d8 --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RB0LC.lean @@ -0,0 +1,537 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge + + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RB0LC + + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RB0LC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target +-- ============================================================================ +-- Wave 25 Standalone verified Canonical Proof Library for holdout_0756 (1RB---_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC) +-- Cluster: Untouched 12/12 & 11/12 Septet IV (0220..0766) | Donor: holdout_0220 (1RB0RA_1LC0LF_1LE0LD_1LB---_1RA1LB_0LB0RC) +-- S_6 x Z_2 Isomorphism: 11/12 match | perm = (E,B,C,A,D,F) | mirror = 1 +-- Differing transition(s): D.F0=0LB vs M.F0=0RA +-- ============================================================================ + +set_option maxHeartbeats 2000000 +set_option maxRecDepth 2000 + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[simp] theorem pow_zero_list (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +omit [Inhabited Γ] in +@[simp] +theorem list_pow_append_one (u : List (Fin 2)) (k : Nat) : + u^k ++ u = u^(k + 1) := by + have h := list_pow_add_comm u k 1 + dsimp [HPow.hPow] at h ⊢ + rw [List.append_nil] at h + exact h + +theorem pow_add_append_right (u : List (Fin 2)) (m n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (m + n)) +> r = (u ^ m) +> ((u ^ n) +> r) := by + rw [list_pow_add, ← listblank_append_append] + +theorem pow_succ_append_right (u : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + (u ^ (n + 1)) +> r = u +> ((u ^ n) +> r) := by + rw [pow_succ_list, ← listblank_append_append] + +theorem pow_succ_append_right' (u : List (Fin 2)) (k : Nat) (r : ListBlank (Fin 2)) : + (u ^ k) +> (u +> r) = (u ^ (k + 1)) +> r := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (m n : Nat) : + s <+ (u ^ (m + n)) = (s <+ (u ^ m)) <+ (u ^ n) := by + rw [listblank_append_append, ← list_pow_add, add_comm] + +theorem pow_succ_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k : Nat) : + (s <+ u) <+ (u ^ k) = s <+ (u ^ (k + 1)) := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add3_append_right (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) (r : ListBlank (Fin 2)) : + (u ^ (k₁ + k₂ + k₃)) +> r = (u ^ k₁) +> ((u ^ k₂) +> ((u ^ k₃) +> r)) := by + rw [pow_add_append_right u (k₁ + k₂) k₃ r, pow_add_append_right u k₁ k₂ ((u ^ k₃) +> r)] + +theorem pow_add3_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (k₁ k₂ k₃ : Nat) : + s <+ (u ^ (k₁ + k₂ + k₃)) = ((s <+ (u ^ k₁)) <+ (u ^ k₂)) <+ (u ^ k₃) := by + rw [pow_add_append_left s u (k₁ + k₂) k₃, pow_add_append_left s u k₁ k₂] + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, _, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le m_pos (Nat.le_add_left m n), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +theorem step_some {c c' : Cfg (Fin 2) (Fin 6)} (h : step target_tm c = some c') : + c [target_tm]⊢⁺ c' := ⟨1, Nat.zero_lt_one, h⟩ + +theorem stepPlus_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := step_stepStar_stepPlus h1 (stepPlus_stepStar h2) + +theorem stepStar_step_left {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : step target_tm c₁ = some c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢* c₃ := stepStar_trans (step_stepStar target_tm c₁ c₂ h1) h2 + +theorem stepPlus_stepStar_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢⁺ c₂) (h2 : c₂ [target_tm]⊢* c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepPlus_stepStar_stepPlus h1 h2 + +theorem stepStar_stepPlus_trans {c₁ c₂ c₃ : Cfg (Fin 2) (Fin 6)} + (h1 : c₁ [target_tm]⊢* c₂) (h2 : c₂ [target_tm]⊢⁺ c₃) : + c₁ [target_tm]⊢⁺ c₃ := stepStar_stepPlus_stepPlus h1 h2 + +theorem stepPlus_of_step {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢ c₂) : + c₁ [target_tm]⊢⁺ c₂ := step_stepPlus target_tm c₁ c₂ h + +theorem stepStar_of_stepPlus {c₁ c₂ : Cfg (Fin 2) (Fin 6)} (h : c₁ [target_tm]⊢⁺ c₂) : + c₁ [target_tm]⊢* c₂ := stepPlus_stepStar h + +macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, default_head, default_tail]) +macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step)) <;> (any_goals (first | finish | step))) +macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) + +theorem multiStep_step_isSome {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (c₀ cfg cfg' : Cfg Γ Λ) (n m : Nat) + (hn : multiStep M c₀ n = some cfg) + (hnm : multiStep M c₀ (n + (1 + m)) = some cfg') : + (step M cfg).isSome := by + rw [multiStep_add M c₀ n (1 + m), hn] at hnm + dsimp [Option.bind] at hnm + rw [multiStep_add M cfg 1 m, multiStep_one] at hnm + cases hs : step M cfg with + | none => + rw [hs] at hnm + nomatch hnm + | some c₁ => rfl + +theorem inv_reaches_beyond {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') + (N : Nat) : + ∃ (m : Nat) (cfg' : Cfg Γ Λ), multiStep M (init []) (N + m) = some cfg' ∧ Inv cfg' := by + induction N with + | zero => + obtain ⟨cfg₀, ⟨n₀, hn₀⟩, h_inv₀⟩ := h_init + refine ⟨n₀, cfg₀, ?_, h_inv₀⟩ + rwa [Nat.zero_add] + | succ N ih => + obtain ⟨m, cfg₁, hm, h_inv₁⟩ := ih + cases m with + | zero => + obtain ⟨cfg₂, ⟨k, hk_pos, hk⟩, h_inv₂⟩ := h_step cfg₁ h_inv₁ + cases k with + | zero => omega + | succ k' => + refine ⟨k', cfg₂, ?_, h_inv₂⟩ + have h_trans := multiStep_trans M (init []) cfg₁ cfg₂ N (k' + 1) hm hk + have h_eq : (N + 1) + k' = N + (k' + 1) := by omega + rwa [h_eq] + | succ m' => + refine ⟨m', cfg₁, ?_, h_inv₁⟩ + have h_eq : (N + 1) + m' = N + (m' + 1) := by omega + rwa [h_eq] + +theorem closed_inv_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ cfg₀, ((init []) [M]⊢* cfg₀) ∧ Inv cfg₀) + (h_step : ∀ cfg, Inv cfg → ∃ cfg', (cfg [M]⊢⁺ cfg') ∧ Inv cfg') : + IsDoesNotHalt M := by + intro cfg ⟨n, hn⟩ + obtain ⟨m, cfg', hnm, _⟩ := inv_reaches_beyond M Inv h_init h_step (n + 1) + have h_eq : (n + 1) + m = n + (1 + m) := by omega + rw [h_eq] at hnm + exact multiStep_step_isSome M (init []) cfg cfg' n m hn hnm + +theorem closed_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) + (n₀ : Nat) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, ∃ n', (hub n) [M]⊢⁺ (hub n')) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hcfg⟩ + subst hcfg + obtain ⟨n', hn'⟩ := h_step n + exact ⟨hub n', hn', ⟨n', rfl⟩⟩ + +theorem closed_guarded_hub_does_not_halt {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (hub : Nat → Cfg Γ Λ) (P : Nat → Prop) + (n₀ : Nat) (h_P₀ : P n₀) (h_init : (init []) [M]⊢* hub n₀) + (h_step : ∀ n, P n → ∃ n', P n' ∧ ((hub n) [M]⊢⁺ (hub n'))) : + IsDoesNotHalt M := by + refine closed_inv_does_not_halt M (fun cfg => ∃ n, P n ∧ cfg = hub n) ⟨hub n₀, h_init, ⟨n₀, h_P₀, rfl⟩⟩ ?_ + intro cfg ⟨n, hPn, hcfg⟩ + subst hcfg + obtain ⟨n', hPn', hn'⟩ := h_step n hPn + exact ⟨hub n', hn', ⟨n', hPn', rfl⟩⟩ + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +abbrev sA : Fin 6 := 0 +abbrev sB : Fin 6 := 1 +abbrev sC : Fin 6 := 2 +abbrev sD : Fin 6 := 3 +abbrev sE : Fin 6 := 4 +abbrev sF : Fin 6 := 5 +abbrev holdout_0673_tm : Machine (Fin 2) (Fin 6) := target_tm +abbrev M : Machine (Fin 2) (Fin 6) := target_tm +@[simp] theorem init_nil : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + + + +-- ============================================================================ +-- ============================================================================ +-- Sweeps Transducer & Valid Tape Closure for Holdout 0673 +-- ============================================================================ + +theorem rule_B_000 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 0, 0] +> r)) [target_tm]⊢⁺ (l <{{E}} ([0, 0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_001 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 0, 1] +> r)) [target_tm]⊢⁺ ((l <+ [1, 1, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_010 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 1, 0] +> r)) [target_tm]⊢⁺ ((l <+ [1, 0, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_B_10 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([1, 0] +> r)) [target_tm]⊢⁺ ((l <+ [0, 0]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_111 (l r : ListBlank (Fin 2)) : + ((l <+ [1, 1, 1]) <{{E}} r) [target_tm]⊢⁺ (l <{{E}} ([0, 0, 0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_101 (l r : ListBlank (Fin 2)) : + ((l <+ [1, 0, 1]) <{{E}} r) [target_tm]⊢⁺ (l <{{E}} ([0, 1, 0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_00 (l r : ListBlank (Fin 2)) : + ((l <+ [0, 0]) <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ (l {{B}}> ([0, 1, 0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem rule_E_nil (r : ListBlank (Fin 2)) : + (default <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ ((default <+ [1, 0, 1]) {{B}}> r) := by + dsimp [ListBlank.append]; execute + +abbrev Round (r r' : ListBlank (Fin 2)) : Prop := + ∀ l : ListBlank (Fin 2), (l {{B}}> r) [target_tm]⊢⁺ (l <{{E}} r') + +inductive Sweeps : Nat → ListBlank (Fin 2) → ListBlank (Fin 2) → Prop + | zero (r : ListBlank (Fin 2)) : Sweeps 0 r r + | succ {n : Nat} {r r₁ r₂ : ListBlank (Fin 2)} : + Round r r₁ → Sweeps n r₁ r₂ → Sweeps (n + 1) r r₂ + +theorem Sweeps.trans {a b : Nat} {r₁ r₂ r₃ : ListBlank (Fin 2)} + (h₁ : Sweeps a r₁ r₂) (h₂ : Sweeps b r₂ r₃) : Sweeps (a + b) r₁ r₃ := by + induction h₁ with + | zero _ => simpa using h₂ + | succ hr _ ih => + rw [Nat.succ_add] + exact Sweeps.succ hr (ih h₂) + +theorem sweeps_split_last {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps (n + 1) r r') : + ∃ r₁ : ListBlank (Fin 2), Sweeps n r r₁ ∧ Round r₁ r' := by + induction n generalizing r with + | zero => + cases h with + | succ hr h0 => + cases h0 with + | zero _ => exact ⟨r, Sweeps.zero r, hr⟩ + | succ m ih => + cases h with + | succ hr hs => + obtain ⟨r₁, hs₁, hr₁⟩ := ih hs + exact ⟨r₁, Sweeps.succ hr hs₁, hr₁⟩ + +theorem round_000 (r : ListBlank (Fin 2)) : + Round ([0, 0, 0] +> r) ([0, 0, 1] +> r) := + fun l => rule_B_000 l r + +theorem round_001 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 0, 1] +> r) ([0, 0, 0] +> r') := + fun l => stepPlus_trans (rule_B_001 l r) (stepPlus_trans (h (l <+ [1, 1, 1])) (rule_E_111 l r')) + +theorem round_010 {r r' : ListBlank (Fin 2)} (h : Round r r') : + Round ([0, 1, 0] +> r) ([0, 1, 0] +> r') := + fun l => stepPlus_trans (rule_B_010 l r) (stepPlus_trans (h (l <+ [1, 0, 1])) (rule_E_101 l r')) + +theorem round_10 {r₁ r r₂ : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Round r r₂) : + Round ([1, 0] +> r₁) ([0, 1, 0] +> r₂) := + fun l => stepPlus_trans (rule_B_10 l r₁) + (stepPlus_trans (h₁ (l <+ [0, 0])) + (stepPlus_trans (rule_E_00 l r) (round_010 h₂ l))) + +theorem sweeps_010 {n : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps n r r') : + Sweeps n ([0, 1, 0] +> r) ([0, 1, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | succ hr _ ih => exact Sweeps.succ (round_010 hr) ih + +theorem sweeps_10 {n : Nat} {r₁ r r' : ListBlank (Fin 2)} + (h₁ : Round r₁ ((0 : Fin 2) >> r)) (h₂ : Sweeps (n + 1) r r') : + Sweeps (n + 1) ([1, 0] +> r₁) ([0, 1, 0] +> r') := by + cases h₂ with + | succ hr₂ hs => + exact Sweeps.succ (round_10 h₁ hr₂) (sweeps_010 hs) + +theorem sweeps_000_even {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k) ([0, 0, 0] +> r) ([0, 0, 0] +> r') := by + induction h with + | zero r => exact Sweeps.zero _ + | @succ m r₀ r₁ r₂ hr _ ih => + have h2 : Sweeps 2 ([0, 0, 0] +> r₀) ([0, 0, 0] +> r₁) := + Sweeps.succ (round_000 r₀) (Sweeps.succ (round_001 hr) (Sweeps.zero _)) + have htr := Sweeps.trans h2 ih + rw [show 2 + 2 * m = 2 * (m + 1) by omega] at htr + exact htr + +theorem sweeps_000_odd {k : Nat} {r r' : ListBlank (Fin 2)} (h : Sweeps k r r') : + Sweeps (2 * k + 1) ([0, 0, 0] +> r) ([0, 0, 1] +> r') := by + have he := sweeps_000_even h + have h1 : Sweeps 1 ([0, 0, 0] +> r') ([0, 0, 1] +> r') := + Sweeps.succ (round_000 r') (Sweeps.zero _) + exact Sweeps.trans he h1 + +theorem default_eq_b000 : + (default : ListBlank (Fin 2)) = [0, 0, 0] +> default := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b000_cons_zero (r : ListBlank (Fin 2)) : + [0, 0, 0] +> ((0 : Fin 2) >> r) = (0 : Fin 2) >> ([0, 0, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +theorem b001_cons_zero (r : ListBlank (Fin 2)) : + [0, 0, 1] +> ((0 : Fin 2) >> r) = (0 : Fin 2) >> ([0, 1, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +theorem b001_default_eq : + ([0, 0, 1] +> default : ListBlank (Fin 2)) = (0 : Fin 2) >> ([0, 1, 0] +> default) := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + +theorem b010_eq_zero_cons_b10 (r : ListBlank (Fin 2)) : + [0, 1, 0] +> r = (0 : Fin 2) >> ([1, 0] +> r) := by + simp only [listblank_append_cons, listblank_append_nil] + +inductive Valid : Nat → ListBlank (Fin 2) → Prop + | nil {n : Nat} (hn : n ≥ 1) : + Valid n default + | t0 {n : Nat} {r : ListBlank (Fin 2)} (hn : n ≥ 2) (hr : Valid (n / 2) r) : + Valid n ([0, 0, 0] +> r) + | t1 {n : Nat} {r : ListBlank (Fin 2)} (hn : n ≥ 1) (hr : Valid (n + 1) r) : + Valid n ([0, 1, 0] +> r) + | t2 {n : Nat} {r₁ r : ListBlank (Fin 2)} (hn : n ≥ 1) + (hround : Round r₁ ((0 : Fin 2) >> r)) (hr : Valid (n + 1) r) : + Valid n ([1, 0] +> r₁) + +theorem Valid.mono {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) {n' : Nat} (hle : n ≤ n') : + Valid n' r := by + induction h generalizing n' with + | nil hn => exact Valid.nil (by omega) + | t0 hn _ ih => exact Valid.t0 (by omega) (ih (by omega)) + | t1 hn _ ih => exact Valid.t1 (by omega) (ih (by omega)) + | t2 hn hround _ ih => exact Valid.t2 (by omega) hround (ih (by omega)) + +theorem valid_sweeps_nil : ∀ n : Nat, n ≥ 1 → + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ Sweeps n default ((0 : Fin 2) >> r') := by + intro n + induction n using Nat.strongRecOn with + | ind n ih => + intro hn + rcases ( by omega : n = 1 ∨ (n ≥ 2 ∧ n % 2 = 0) ∨ (n ≥ 2 ∧ n % 2 = 1) ) with rfl | ⟨hn2, hev⟩ | ⟨hn2, hod⟩ + · refine ⟨[0, 1, 0] +> default, Valid.t1 (by omega) (Valid.nil (by omega)), ?_⟩ + have h1 : Sweeps 1 ([0, 0, 0] +> default) ([0, 0, 1] +> default) := + Sweeps.succ (round_000 default) (Sweeps.zero _) + rw [b001_default_eq, ← default_eq_b000] at h1 + exact h1 + · obtain ⟨r', hr', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨[0, 0, 0] +> r', Valid.t0 hn2 hr', ?_⟩ + have he := sweeps_000_even hs' + rw [← default_eq_b000, b000_cons_zero, show 2 * (n / 2) = n by omega] at he + exact he + · obtain ⟨r', hr', hs'⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨[0, 1, 0] +> r', Valid.t1 (by omega) (hr'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [← default_eq_b000, b001_cons_zero, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + +theorem valid_sweeps {n : Nat} {r : ListBlank (Fin 2)} (h : Valid n r) : + ∃ r' : ListBlank (Fin 2), Valid n r' ∧ Sweeps n r ((0 : Fin 2) >> r') := by + induction h with + | @nil n hn => exact valid_sweeps_nil n hn + | @t0 n r hn hr ih => + obtain ⟨r', hr', hs'⟩ := ih + rcases ( by omega : n % 2 = 0 ∨ n % 2 = 1 ) with hev | hod + · refine ⟨[0, 0, 0] +> r', Valid.t0 hn hr', ?_⟩ + have he := sweeps_000_even hs' + rw [b000_cons_zero, show 2 * (n / 2) = n by omega] at he + exact he + · refine ⟨[0, 1, 0] +> r', Valid.t1 (by omega) (hr'.mono (by omega)), ?_⟩ + have ho := sweeps_000_odd hs' + rw [b001_cons_zero, show 2 * (n / 2) + 1 = n by omega] at ho + exact ho + | @t1 n r hn hr ih => + obtain ⟨r', hr', hs'⟩ := ih + obtain ⟨r₁, hs₁, hr₁⟩ := sweeps_split_last hs' + refine ⟨[1, 0] +> r₁, Valid.t2 hn hr₁ hr', ?_⟩ + rw [← b010_eq_zero_cons_b10] + exact sweeps_010 hs₁ + | @t2 n r₁ r hn hround hr ih => + obtain ⟨r', hr', hs'⟩ := ih + obtain ⟨r₂, hs₂, hr₂⟩ := sweeps_split_last hs' + refine ⟨[1, 0] +> r₂, Valid.t2 hn hr₂ hr', ?_⟩ + rw [← b010_eq_zero_cons_b10] + rw [show n = (n - 1) + 1 by omega] at hs₂ ⊢ + exact sweeps_10 hround hs₂ + +theorem era_step {r : ListBlank (Fin 2)} (h : Valid 1 r) : + ∃ r' : ListBlank (Fin 2), Valid 1 r' ∧ + ((default <{{E}} ((0 : Fin 2) >> r)) [target_tm]⊢⁺ (default <{{E}} ((0 : Fin 2) >> r'))) := by + obtain ⟨r', hr', hs'⟩ := valid_sweeps (h.mono (by omega : 1 ≤ 2)) + obtain ⟨r₁, hs₁, hr₂⟩ := sweeps_split_last hs' + obtain ⟨r₀, hs₀, hr₁⟩ := sweeps_split_last hs₁ + cases hs₀ with + | zero _ => + refine ⟨[1, 0] +> r₁, Valid.t2 (by omega) hr₂ hr', ?_⟩ + have s1 := rule_E_nil r + have s2 := hr₁ (default <+ [1, 0, 1]) + have s3 := rule_E_101 default r₁ + rw [← b010_eq_zero_cons_b10] + exact stepPlus_trans s1 (stepPlus_trans s2 s3) + +def era0_r1 : ListBlank (Fin 2) := + [0, 0, 0] +> ([0, 0, 1] +> default) + +def era0_r : ListBlank (Fin 2) := + [1, 0] +> era0_r1 + +theorem init_reaches_era0 : + (init []) [target_tm]⊢* (default <{{E}} ((0 : Fin 2) >> era0_r)) := by + apply stepPlus_stepStar + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + dsimp [era0_r, era0_r1, ListBlank.append] + execute + +theorem valid_era0 : Valid 1 era0_r := by + have hround : Round era0_r1 ((0 : Fin 2) >> ([0, 1, 0] +> ([0, 1, 0] +> default))) := by + have h0 := round_000 ([0, 0, 1] +> default) + have heq : ([0, 0, 1] +> ([0, 0, 1] +> default) : ListBlank (Fin 2)) = + (0 : Fin 2) >> ([0, 1, 0] +> ([0, 1, 0] +> default)) := by + simp only [listblank_append_cons, listblank_append_nil, zero_cons_default] + rw [heq] at h0 + exact h0 + exact Valid.t2 (by omega) hround + (Valid.t1 (by omega) (Valid.t1 (by omega) (Valid.nil (by omega)))) + +theorem holdout_0673_nonhalt : IsDoesNotHalt holdout_0673_tm := by + refine closed_inv_does_not_halt target_tm + (fun cfg => ∃ r : ListBlank (Fin 2), Valid 1 r ∧ cfg = (default <{{E}} ((0 : Fin 2) >> r))) + ⟨default <{{E}} ((0 : Fin 2) >> era0_r), init_reaches_era0, ⟨era0_r, valid_era0, rfl⟩⟩ ?_ + intro cfg ⟨r, hr, hcfg⟩ + subst hcfg + obtain ⟨r', hr', hstep⟩ := era_step hr + exact ⟨default <{{E}} ((0 : Fin 2) >> r'), hstep, ⟨r', hr', rfl⟩⟩ + + + +theorem is_does_not_halt : IsNotHalt target_tm := + holdout_0673_nonhalt + +public section + +theorem is_not_halt : IsNotHalt target := is_does_not_halt + +end + +end BusyBeaver.M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RB0LC diff --git a/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC1LF_1LD1RE_1LB0LD_1RA0RC_1RC0LE.lean b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC1LF_1LD1RE_1LB0LD_1RA0RC_1RC0LE.lean new file mode 100644 index 00000000..09f2f52f --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC1LF_1LD1RE_1LB0LD_1RA0RC_1RC0LE.lean @@ -0,0 +1,49 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.BB6.NonHalt.M_1RB1LD_1RC0RB_1LA1RE_1LF0LA_1LA0RD_1LCHHH + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RBHHH_1RC1LF_1LD1RE_1LB0LD_1RA0RC_1RC0LE + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1RC1LF_1LD1RE_1LB0LD_1RA0RC_1RC0LE" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +def stateMap_m0781 : Fin 6 → Fin 6 + | 0 => 2 + | 1 => 3 + | 2 => 1 + | 3 => 4 + | 4 => 5 + | 5 => 0 + +public section + +theorem is_not_halt : IsNotHalt target := by + exact Counter.does_not_halt_of_conj_stem + (M_tgt := target) + (M_src := BusyBeaver.M_1RB1LD_1RC0RB_1LA1RE_1LF0LA_1LA0RD_1LCHHH.target) + (σ := stateMap_m0781) (f := true) + (c₁ := (default : ListBlank (Fin 2)) {{5}}> default) + (by decide) (Counter.init_reaches_conjCfg_default rfl) + BusyBeaver.M_1RB1LD_1RC0RB_1LA1RE_1LF0LA_1LA0RD_1LCHHH.is_not_halt_from_0757 + +end + +end BusyBeaver.M_1RBHHH_1RC1LF_1LD1RE_1LB0LD_1RA0RC_1RC0LE diff --git a/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC.lean b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC.lean new file mode 100644 index 00000000..54a1a29d --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC.lean @@ -0,0 +1,72 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.BB6.NonHalt.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH + +open Mathlib Relation Nat Turing BusyBeaver SixState +open BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH + +namespace BusyBeaver.M_1RBHHH_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC + + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +section + +abbrev fCR_1rc0lc : HalfTape → Call → HalfTape → Cfg (Fin 2) (Fin 6) := + cfgCR true D C -- CR config for 1RBHHH_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC + +abbrev fCL_1rc0lc : HalfTape → HalfTape → Cfg (Fin 2) (Fin 6) := + cfgCL true E -- CL config for 1RBHHH_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC + +set_option maxHeartbeats 2000000 in +-- Justification: Symbolic execution of the 15 elementary SegRules for +-- 1RBHHH_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC. +theorem segRules_1rc0lc : SegRules (callStep target fCR_1rc0lc fCL_1rc0lc) := by + unfold fCR_1rc0lc fCL_1rc0lc + prove_seg_rules + +theorem step_ca_1rc0lc (r : HalfTape) : + (fCL_1rc0lc lh r) [target]⊢⁺ (fCR_1rc0lc ([1] +> default) .ca r) := by + unfold fCL_1rc0lc fCR_1rc0lc cfgCL cfgCR callState callWord lh + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_ca for 1RBHHH_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC + +theorem step_ch_1rc0lc (r : HalfTape) : + (fCL_1rc0lc ([1] +> default) r) [target]⊢⁺ (fCR_1rc0lc lh .ch r) := by + unfold fCL_1rc0lc fCR_1rc0lc cfgCL cfgCR callState callWord lh + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_ch for 1RBHHH_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC + +theorem step_init_1rc0lc : + (init []) [target]⊢⁺ fCL_1rc0lc lh (initTape .kindD) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + unfold fCL_1rc0lc initTape cfgCL lh t d1 d0 + simp only [↓reduceIte, Bool.false_eq_true, append_cons, append_nil] + execute -- step_init for 1RBHHH_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC + +end + +public section + +theorem is_not_halt : IsNotHalt target := + does_not_halt_of_seg_rules segRules_1rc0lc step_ca_1rc0lc step_ch_1rc0lc .kindD step_init_1rc0lc + +end + +end BusyBeaver.M_1RBHHH_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC diff --git a/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC1RE_1LD0RC_0RE0LD_1LC0LF_1RA0RF.lean b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC1RE_1LD0RC_0RE0LD_1LC0LF_1RA0RF.lean new file mode 100644 index 00000000..7fc806ba --- /dev/null +++ b/BusyBeaver/BB6/NonHalt/M_1RBHHH_1RC1RE_1LD0RC_0RE0LD_1LC0LF_1RA0RF.lean @@ -0,0 +1,49 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +import BusyBeaver.Basic +public import BusyBeaver.Bridge +import BusyBeaver.Calculi.Counter +import BusyBeaver.BB6.NonHalt.M_1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC + +open Mathlib Relation Nat Turing BusyBeaver SixState + + +namespace BusyBeaver.M_1RBHHH_1RC1RE_1LD0RC_0RE0LD_1LC0LF_1RA0RF + + +@[expose] public section + +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1RC1RE_1LD0RC_0RE0LD_1LC0LF_1RA0RF" + +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB + +end + + +def stateMap_m0772 : Fin 6 → Fin 6 + | 0 => 2 + | 1 => 3 + | 2 => 4 + | 3 => 5 + | 4 => 0 + | 5 => 1 + +public section + +theorem is_not_halt : IsNotHalt target := by + exact Counter.does_not_halt_of_conj_stem + (M_tgt := target) + (M_src := BusyBeaver.M_1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC.target) + (σ := stateMap_m0772) (f := true) + (c₁ := (default : ListBlank (Fin 2)) {{4}}> default) + (by decide) (Counter.init_reaches_conjCfg_default rfl) + BusyBeaver.M_1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC.is_not_halt_from_0772 + +end + +end BusyBeaver.M_1RBHHH_1RC1RE_1LD0RC_0RE0LD_1LC0LF_1RA0RF diff --git a/BusyBeaver/BB6/Pomme/NonHalt.lean b/BusyBeaver/BB6/Pomme/NonHalt.lean new file mode 100644 index 00000000..b17d7295 --- /dev/null +++ b/BusyBeaver/BB6/Pomme/NonHalt.lean @@ -0,0 +1,3536 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +import BusyBeaver.Basic + +/-! +# 2-Adic Laurent-Determinant Non-Halting Proof for `1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RB---` + +Self-contained, Baker-free non-halting proof for the Pomme / Baker machine +`1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RB---` (following the resolution by mxdys, Pomme, +Autumn Pan, and vyx7). All internal algebraic and trajectory helper lemmas are module-private; +only `machine`, `target`, and `is_not_halt` are exported. +-/ + +namespace BusyBeaver.Pomme.NonHalt + +open Mathlib Relation Nat Turing BusyBeaver + +@[expose] public section + +/-- The `(6, 2)` Turing machine in `ConjectureMachines.Machine` form. -/ +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RB---" + +/-- The `(6, 2)` Turing machine in `BusyBeaver.Machine` form. -/ +abbrev target : Machine (Fin 2) (Fin 6) := + machine.toBB + +end + +abbrev target_tm : Machine (Fin 2) (Fin 6) := target + +namespace Solution + +theorem dvd_add {a b c : Int} (h1 : a ∣ b) (h2 : a ∣ c) : a ∣ b + c := Int.dvd_add h1 h2 +theorem dvd_sub {a b c : Int} (h1 : a ∣ b) (h2 : a ∣ c) : a ∣ b - c := Int.dvd_sub h1 h2 +theorem abs_mul (a b : Int) : |a * b| = |a| * |b| := by + rcases le_or_gt 0 a with ha | ha <;> rcases le_or_gt 0 b with hb | hb + · rw [abs_of_nonneg ha, abs_of_nonneg hb, abs_of_nonneg (mul_nonneg ha hb)] + · rw [abs_of_nonneg ha, abs_of_neg hb, abs_of_nonpos (mul_nonpos_of_nonneg_of_nonpos ha (le_of_lt + hb))]; ring + · rw [abs_of_neg ha, abs_of_nonneg hb, abs_of_nonpos (mul_nonpos_of_nonpos_of_nonneg (le_of_lt ha) + hb)]; ring + · rw [abs_of_neg ha, abs_of_neg hb, abs_of_nonneg (mul_nonneg_of_nonpos_of_nonpos (le_of_lt ha) + (le_of_lt hb))]; ring +macro "positivity" : tactic => + `(tactic| first + | omega + | exact pow_pos (by omega) _ + | exact pow_nonneg (by omega) _ + | exact pow_nonneg (pow_nonneg (by omega) _) _ + | exact pow_nonneg (mul_nonneg (pow_nonneg (by omega) _) (pow_nonneg (by omega) _)) _ + | exact mul_pos (pow_pos (by omega) _) (pow_pos (by omega) _) + | exact mul_pos (by omega) (pow_pos (by omega) _) + | exact mul_nonneg (pow_nonneg (by omega) _) (pow_nonneg (by omega) _) + | nlinarith) +namespace FiniteDiff +def fwdDiff : Nat -> (Nat -> Int) -> Nat -> Int + | 0, f, x => f x + | d + 1, f, x => fwdDiff d f (x + 1) - fwdDiff d f x +theorem fwdDiff_congr (d : Nat) (f g : Nat -> Int) (h : ∀ x, f x = g x) (x : Nat) : + fwdDiff d f x = fwdDiff d g x := by + induction d generalizing x with + | zero => exact h x + | succ d ih => simp [fwdDiff, ih] +theorem fwdDiff_add (d : Nat) (f g : Nat -> Int) (x : Nat) : + fwdDiff d (fun x => f x + g x) x = fwdDiff d f x + fwdDiff d g x := by + induction d generalizing x with + | zero => rfl + | succ d ih => simp only [fwdDiff, ih]; ring +theorem fwdDiff_smul (d : Nat) (c : Int) (f : Nat -> Int) (x : Nat) : + fwdDiff d (fun x => c * f x) x = c * fwdDiff d f x := by + induction d generalizing x with + | zero => rfl + | succ d ih => simp only [fwdDiff, ih]; ring +theorem fwdDiff_shift (d : Nat) (f : Nat -> Int) (x : Nat) : + fwdDiff d (fun x => f (x + 1)) x = fwdDiff d f (x + 1) := by + induction d generalizing x with + | zero => rfl + | succ d ih => simp only [fwdDiff, ih] +theorem fwdDiff_mul_self (d : Nat) (f : Nat -> Int) (x : Nat) : + fwdDiff (d + 1) (fun x => (x : Int) * f x) x = + (x : Int) * fwdDiff (d + 1) f x + ((d + 1 : Nat) : Int) * fwdDiff d f (x + 1) := by + induction d generalizing x with + | zero => + simp only [fwdDiff, Nat.cast_add, Nat.cast_one, Nat.cast_zero] + ring + | succ d ih => + have h1 := ih (x + 1) + have h2 := ih x + have h3 : fwdDiff (d + 1 + 1) (fun x => (x : Int) * f x) x = + fwdDiff (d + 1) (fun x => (x : Int) * f x) (x + 1) - + fwdDiff (d + 1) (fun x => (x : Int) * f x) x := rfl + have h4 : fwdDiff (d + 1 + 1) f x = fwdDiff (d + 1) f (x + 1) - fwdDiff (d + 1) f x := rfl + have h5 : fwdDiff (d + 1) f (x + 1) = fwdDiff d f (x + 1 + 1) - fwdDiff d f (x + 1) := rfl + rw [h3, h1, h2, h4, h5] + push_cast + ring +theorem fwdDiff_geom (d : Nat) (q : Int) (x : Nat) : + fwdDiff d (fun x => q ^ x) x = (q - 1) ^ d * q ^ x := by + induction d generalizing x with + | zero => simp [fwdDiff] + | succ d ih => + simp only [fwdDiff, ih, pow_succ] + ring +theorem pow_dvd_pow_of_le (a b : Nat) (h : a ≤ b) : ((4 : Int) ^ a) ∣ ((4 : Int) ^ b) := by + refine ⟨(4 : Int) ^ (b - a), ?_⟩ + rw [<- pow_add, Nat.add_sub_of_le h] +theorem four_pow_dvd_fwdDiff_monomial_geom (q : Int) (hq : (4 : Int) ∣ (q - 1)) (k d x : Nat) : + ((4 : Int) ^ (d - k)) ∣ fwdDiff d (fun x => (x : Int) ^ k * q ^ x) x := by + rcases hq with ⟨t, ht⟩ + induction k generalizing d x with + | zero => + rw [Nat.sub_zero] + have hext : (fun x : Nat => (x : Int) ^ 0 * q ^ x) = (fun x : Nat => q ^ x) := by + funext y; ring + rw [hext, fwdDiff_geom, ht, mul_pow] + refine ⟨t ^ d * q ^ x, ?_⟩ + ring + | succ k ih => + cases d with + | zero => + simp [fwdDiff] + | succ d => + have hext : (fun x : Nat => (x : Int) ^ (k + 1) * q ^ x) = + (fun x : Nat => (x : Int) * ((x : Int) ^ k * q ^ x)) := by + funext y; rw [pow_succ]; ring + rw [hext, fwdDiff_mul_self, Nat.succ_sub_succ_eq_sub] + apply dvd_add + · apply dvd_mul_of_dvd_right + exact dvd_trans (pow_dvd_pow_of_le (d - k) (d + 1 - k) (by omega)) (ih (d + 1) x) + · apply dvd_mul_of_dvd_right + exact ih d (x + 1) +def sum : Nat -> (Nat -> Int) -> Int + | 0, _ => 0 + | n + 1, f => sum n f + f n +theorem sum_congr (n : Nat) (f g : Nat -> Int) (h : ∀ k, k < n -> f k = g k) : + sum n f = sum n g := by + induction n with + | zero => rfl + | succ n ih => + simp only [sum] + rw [ih (fun k hk => h k (by omega)), h n (by omega)] +theorem sum_add (n : Nat) (f g : Nat -> Int) : + sum n (fun k => f k + g k) = sum n f + sum n g := by + induction n with + | zero => rfl + | succ n ih => simp only [sum, ih]; ring +theorem sum_succ_shift (n : Nat) (f : Nat -> Int) : + sum (n + 1) f = f 0 + sum n (fun k => f (k + 1)) := by + induction n with + | zero => simp [sum] + | succ n ih => + calc sum (n + 1 + 1) f = sum (n + 1) f + f (n + 1) := rfl + _ = f 0 + sum n (fun k => f (k + 1)) + f (n + 1) := by rw [ih] + _ = f 0 + sum (n + 1) (fun k => f (k + 1)) := by simp only [sum]; ring +def binomInt : Nat -> Nat -> Int + | _, 0 => 1 + | 0, _ + 1 => 0 + | n + 1, d + 1 => binomInt n d + binomInt n (d + 1) +theorem binomInt_eq_zero_of_lt (n d : Nat) (h : n < d) : binomInt n d = 0 := by + induction n generalizing d with + | zero => + cases d with + | zero => omega + | succ d => rfl + | succ n ih => + cases d with + | zero => omega + | succ d => + simp only [binomInt] + rw [ih d (by omega), ih (d + 1) (by omega)] + ring +theorem binomInt_zero_right (n : Nat) : binomInt n 0 = 1 := by + cases n <;> rfl +theorem sum_binomInt_succ (n : Nat) (f : Nat -> Int) : + sum (n + 2) (fun k => binomInt (n + 1) k * f k) = + sum (n + 1) (fun k => binomInt n k * f k) + sum (n + 1) (fun k => binomInt n k * f (k + 1)) := + by + rw [sum_succ_shift (n + 1) (fun k => binomInt (n + 1) k * f k)] + have hext : sum (n + 1) (fun k => binomInt (n + 1) (k + 1) * f (k + 1)) = + sum (n + 1) (fun k => binomInt n k * f (k + 1) + binomInt n (k + 1) * f (k + 1)) := by + apply sum_congr + intro k _ + simp only [binomInt] + ring + rw [hext, sum_add] + rw [sum_succ_shift n (fun k => binomInt n k * f k), binomInt_zero_right, binomInt_zero_right] + have htail : sum (n + 1) (fun k => binomInt n (k + 1) * f (k + 1)) = + sum n (fun k => binomInt n (k + 1) * f (k + 1)) + binomInt n (n + 1) * f (n + 1) := rfl + rw [htail, binomInt_eq_zero_of_lt n (n + 1) (by omega)] + ring +theorem newton_forward_diff (f : Nat -> Int) (n x : Nat) : + f (x + n) = sum (n + 1) (fun d => binomInt n d * fwdDiff d f x) := by + induction n generalizing x with + | zero => + simp [sum, binomInt, fwdDiff] + | succ n ih => + have h1 : x + (n + 1) = (x + 1) + n := by omega + rw [h1, ih (x + 1), sum_binomInt_succ, <- sum_add] + apply sum_congr + intro k _ + simp only [fwdDiff] + ring +end FiniteDiff +namespace Determinant +def lap {I : Type} : List I -> (I -> List I -> Int) -> Int + | [], _ => 0 + | c :: cs, f => f c cs - lap cs (fun x xs => f x (c :: xs)) +theorem lap_congr {I : Type} (cols : List I) (f g : I -> List I -> Int) + (h : ∀ c cs, f c cs = g c cs) : lap cols f = lap cols g := by + induction cols generalizing f g with + | nil => rfl + | cons c cs ih => + simp only [lap, h] +theorem lap_zero {I : Type} (cols : List I) : lap cols (fun _ _ => 0) = 0 := by + induction cols with + | nil => rfl + | cons c cs ih => simp [lap, ih] +theorem lap_add {I : Type} (cols : List I) (f g : I -> List I -> Int) : + lap cols (fun c cs => f c cs + g c cs) = lap cols f + lap cols g := by + induction cols generalizing f g with + | nil => rfl + | cons c cs ih => simp only [lap, ih]; ring +theorem lap_sub {I : Type} (cols : List I) (f g : I -> List I -> Int) : + lap cols (fun c cs => f c cs - g c cs) = lap cols f - lap cols g := by + induction cols generalizing f g with + | nil => rfl + | cons c cs ih => simp only [lap, ih]; ring +theorem lap_smul {I : Type} (cols : List I) (a : Int) (f : I -> List I -> Int) : + lap cols (fun c cs => a * f c cs) = a * lap cols f := by + induction cols generalizing f with + | nil => simp [lap] + | cons c cs ih => simp only [lap, ih]; ring +theorem lap_swap {I : Type} (cols : List I) (F : I -> I -> List I -> Int) : + lap cols (fun c cs => lap cs (fun d ds => F c d ds)) = + -lap cols (fun d ds => lap ds (fun c cs => F c d cs)) := by + induction cols generalizing F with + | nil => simp [lap] + | cons c cs ih => + simp only [lap, lap_sub] + rw [ih (fun x y ys => F x y (c :: ys))] + ring +theorem perm_cons_swap {I : Type} (c x : I) (cs xs : List I) (h : (x :: xs).Perm cs) : + (x :: c :: xs).Perm (c :: cs) := + (List.Perm.swap c x xs).trans (h.cons c) +theorem lap_congr_perm {I : Type} (cols : List I) (f g : I -> List I -> Int) + (h : ∀ c cs, (c :: cs).Perm cols -> f c cs = g c cs) : lap cols f = lap cols g := by + induction cols generalizing f g with + | nil => rfl + | cons c cs ih => + simp only [lap] + rw [h c cs (List.Perm.refl _)] + congr 1 + exact ih _ _ (fun x xs hxs => h x (c :: xs) (perm_cons_swap c x cs xs hxs)) +theorem dvd_lap {I : Type} (cols : List I) (f : I -> List I -> Int) (m : Int) + (h : ∀ c cs, (c :: cs).Perm cols -> m ∣ f c cs) : m ∣ lap cols f := by + induction cols generalizing f with + | nil => simp [lap] + | cons c cs ih => + simp only [lap] + apply dvd_sub + · exact h c cs (List.Perm.refl _) + · exact ih _ (fun x xs hxs => h x (c :: xs) (perm_cons_swap c x cs xs hxs)) +theorem abs_lap_le {I : Type} (cols : List I) (f : I -> List I -> Int) (b : Int) (_hb : 0 ≤ b) + (h : ∀ c cs, (c :: cs).Perm cols -> |f c cs| ≤ b) : + |lap cols f| ≤ (cols.length : Int) * b := by + induction cols generalizing f with + | nil => simp [lap] + | cons c cs ih => + simp only [lap, List.length_cons] + have hhead : |f c cs| ≤ b := h c cs (List.Perm.refl _) + have htail : |lap cs (fun x xs => f x (c :: xs))| ≤ (cs.length : Int) * b := + ih _ (fun x xs hxs => h x (c :: xs) (perm_cons_swap c x cs xs hxs)) + have habs : |f c cs - lap cs (fun x xs => f x (c :: xs))| ≤ + |f c cs| + |lap cs (fun x xs => f x (c :: xs))| := abs_sub _ _ + push_cast + linarith +def det {I : Type} : List (I -> Int) -> List I -> Int + | [], _ => 1 + | r :: rs, cols => lap cols (fun c cs => r c * det rs cs) +theorem det_row_add {I : Type} (pre : List (I -> Int)) (r s : I -> Int) (post : List (I -> Int)) + (cols : List I) : + det (pre ++ (fun c => r c + s c) :: post) cols = + det (pre ++ r :: post) cols + det (pre ++ s :: post) cols := by + induction pre generalizing cols with + | nil => + simp only [List.nil_append, det, <- lap_add] + apply lap_congr; intro c cs; ring + | cons t pre ih => + simp only [List.cons_append, det, <- lap_add] + apply lap_congr; intro c cs; rw [ih]; ring +theorem det_row_smul {I : Type} (pre : List (I -> Int)) (a : Int) (r : I -> Int) (post : List (I -> + Int)) (cols : List I) : + det (pre ++ (fun c => a * r c) :: post) cols = a * det (pre ++ r :: post) cols := by + induction pre generalizing cols with + | nil => + simp only [List.nil_append, det, <- lap_smul] + apply lap_congr; intro c cs; ring + | cons t pre ih => + simp only [List.cons_append, det, <- lap_smul] + apply lap_congr; intro c cs; rw [ih]; ring +theorem det_row_zero {I : Type} (pre post : List (I -> Int)) (cols : List I) : + det (pre ++ (fun _ => 0) :: post) cols = 0 := by + have h : (fun _ : I => (0 : Int)) = (fun _ : I => 0 * (0 : Int)) := by funext _; ring + rw [h, det_row_smul]; ring +theorem det_swap_head {I : Type} (r s : I -> Int) (post : List (I -> Int)) (cols : List I) : + det (r :: s :: post) cols = -det (s :: r :: post) cols := by + simp only [det] + rw [lap_congr cols (fun c cs => r c * lap cs (fun d ds => s d * det post ds)) + (fun c cs => lap cs (fun d ds => r c * (s d * det post ds))) + (fun c cs => (lap_smul cs (r c) _).symm)] + rw [lap_swap] + congr 1 + apply lap_congr; intro c cs + rw [<- lap_smul] + apply lap_congr; intro d ds; ring +theorem det_swap_adj {I : Type} (pre : List (I -> Int)) (r s : I -> Int) (post : List (I -> Int)) + (cols : List I) : + det (pre ++ r :: s :: post) cols = -det (pre ++ s :: r :: post) cols := by + induction pre generalizing cols with + | nil => exact det_swap_head r s post cols + | cons t pre ih => + simp only [List.cons_append, det] + have h : -lap cols (fun c cs => t c * det (pre ++ s :: r :: post) cs) = + (-1) * lap cols (fun c cs => t c * det (pre ++ s :: r :: post) cs) := by ring + rw [h, <- lap_smul] + apply lap_congr; intro c cs; rw [ih]; ring +theorem det_dup_row {I : Type} (pre mid : List (I -> Int)) (r : I -> Int) (post : List (I -> Int)) + (cols : List I) : + det (pre ++ r :: mid ++ r :: post) cols = 0 := by + have hbase : ∀ (ms : List (I -> Int)) (cs : List I), det (r :: ms ++ r :: post) cs = 0 := by + intro ms + induction ms with + | nil => + intro cs + have h := det_swap_head r r post cs + change det (r :: r :: post) cs = 0 + linarith + | cons s ms ih => + intro cs + change det (r :: s :: (ms ++ r :: post)) cs = 0 + rw [det_swap_head] + change -lap cs (fun c xs => s c * det (r :: ms ++ r :: post) xs) = 0 + rw [lap_congr cs (fun c xs => s c * det (r :: ms ++ r :: post) xs) (fun _ _ => 0) + (fun c xs => by rw [ih xs]; ring)] + rw [lap_zero]; ring + induction pre generalizing cols with + | nil => + simp only [List.nil_append] + exact hbase mid cols + | cons s pre ih => + simp only [List.cons_append, det] + rw [lap_congr cols (fun c xs => s c * det (pre ++ r :: mid ++ r :: post) xs) (fun _ _ => 0) + (fun c xs => by rw [ih xs]; ring)] + exact lap_zero cols +theorem mem_of_cons_perm {I : Type} (c : I) (cs cols : List I) (h : (c :: cs).Perm cols) : + c ∈ cols /\ ∀ x ∈ cs, x ∈ cols := + ⟨h.subset (by simp), fun x hx => h.subset (by simp [hx])⟩ +theorem dvd_det_sub_det {I : Type} (m : Int) (rows rows' : List (I -> Int)) (cols : List I) + (h : List.Forall₂ (fun r s => ∀ c ∈ cols, m ∣ (r c - s c)) rows rows') : + m ∣ (det rows cols - det rows' cols) := by + induction rows generalizing rows' cols with + | nil => + cases h + simp [det] + | cons r rs ih => + cases h with + | @cons _ s _ ss hr hrs => + simp only [det, <- lap_sub] + apply dvd_lap + intro c cs hp + obtain ⟨hc, hcs⟩ := mem_of_cons_perm c cs cols hp + rcases hr c hc with ⟨a, ha⟩ + have htail : m ∣ (det rs cs - det ss cs) := + ih ss cs (hrs.imp (fun _ _ huv d hd => huv d (hcs d hd))) + rcases htail with ⟨b, hb⟩ + refine ⟨r c * b + a * det ss cs, ?_⟩ + have h1 : s c = r c - m * a := by linarith + have h2 : det ss cs = det rs cs - m * b := by linarith + rw [h1, h2]; ring +theorem det_congr_cols {I : Type} (rows rows' : List (I -> Int)) (cols : List I) + (h : List.Forall₂ (fun r s => ∀ c ∈ cols, r c = s c) rows rows') : + det rows cols = det rows' cols := by + have hz : (0 : Int) ∣ (det rows cols - det rows' cols) := by + apply dvd_det_sub_det + exact h.imp (fun r s hrs c hc => by rw [hrs c hc]; simp) + rcases hz with ⟨k, hk⟩ + linarith +def listProd : List Int -> Int + | [] => 1 + | x :: xs => x * listProd xs +theorem listProd_nonneg (xs : List Int) (h : ∀ x ∈ xs, 0 ≤ x) : 0 ≤ listProd xs := by + induction xs with + | nil => simp [listProd] + | cons x xs ih => + simp only [listProd] + exact mul_nonneg (h x (by simp)) (ih (fun y hy => h y (by simp [hy]))) +def RowBounds {I : Type} (cols : List I) (rows : List (I -> Int)) (bounds : List Int) : Prop := + List.Forall₂ (fun r b => 0 ≤ b /\ ∀ c ∈ cols, |r c| ≤ b) rows bounds +theorem bounds_nonneg_of_rowBounds {I : Type} (cols : List I) (rows : List (I -> Int)) (bounds : + List Int) + (h : RowBounds cols rows bounds) : ∀ b ∈ bounds, 0 ≤ b := by + induction h with + | nil => intro b hb; cases hb + | @cons r b rs bs hrb _ ih => + intro x hx + rcases List.mem_cons.mp hx with rfl | hmem + · exact hrb.1 + · exact ih x hmem +theorem rowBounds_mono_cols {I : Type} (cols cs : List I) (rows : List (I -> Int)) (bounds : List + Int) + (hcs : ∀ x ∈ cs, x ∈ cols) (h : RowBounds cols rows bounds) : RowBounds cs rows bounds := + h.imp (fun _ _ hrb => ⟨hrb.1, fun c hc => hrb.2 c (hcs c hc)⟩) +theorem abs_det_le_factorial_mul_listProd {I : Type} (rows : List (I -> Int)) (cols : List I) + (bounds : List Int) + (hlen : rows.length = cols.length) (hbounds : RowBounds cols rows bounds) : + |det rows cols| ≤ (rows.length.factorial : Int) * listProd bounds := by + induction rows generalizing cols bounds with + | nil => + cases hbounds + simp [det, listProd] + | cons r rs ih => + cases hbounds with + | @cons _ b _ bs hrb hrs => + simp only [det, List.length_cons, Nat.factorial_succ, listProd] + have hprod : 0 ≤ listProd bs := listProd_nonneg bs (bounds_nonneg_of_rowBounds cols rs bs hrs) + have hfact : (0 : Int) ≤ (rs.length.factorial : Int) := Nat.cast_nonneg _ + have hstep1 : |lap cols (fun c cs => r c * det rs cs)| ≤ + (cols.length : Int) * (b * ((rs.length.factorial : Int) * listProd bs)) := by + apply abs_lap_le + · exact mul_nonneg hrb.1 (mul_nonneg hfact hprod) + · intro c cs hp + obtain ⟨hc, hcs⟩ := mem_of_cons_perm c cs cols hp + have hcslen : rs.length = cs.length := by + have hp_len := hp.length_eq + simp only [List.length_cons] at hp_len hlen + omega + have hd := ih cs bs hcslen (rowBounds_mono_cols cols cs rs bs hcs hrs) + rw [abs_mul] + exact mul_le_mul (hrb.2 c hc) hd (abs_nonneg _) hrb.1 + have hstep2 : (cols.length : Int) * (b * ((rs.length.factorial : Int) * listProd bs)) = + (((rs.length + 1) * rs.length.factorial : Nat) : Int) * (b * listProd bs) := by + rw [<- hlen] + simp only [List.length_cons] + push_cast + ring + linarith +theorem sum_smul (n : Nat) (a : Int) (f : Nat -> Int) : + FiniteDiff.sum n (fun d => a * f d) = a * FiniteDiff.sum n f := by + induction n with + | zero => simp [FiniteDiff.sum] + | succ n ih => simp only [FiniteDiff.sum, ih]; ring +theorem dvd_sum (n : Nat) (m : Int) (f : Nat -> Int) + (h : ∀ d, d < n -> m ∣ f d) : m ∣ FiniteDiff.sum n f := by + induction n with + | zero => simp [FiniteDiff.sum] + | succ n ih => + simp only [FiniteDiff.sum] + exact dvd_add (ih (fun d hd => h d (by omega))) (h n (by omega)) +theorem det_row_sum {I : Type} (pre : List (I -> Int)) (n : Nat) (f : Nat -> I -> Int) + (post : List (I -> Int)) (cols : List I) : + det (pre ++ (fun c => FiniteDiff.sum n (fun d => f d c)) :: post) cols = + FiniteDiff.sum n (fun d => det (pre ++ f d :: post) cols) := by + induction n with + | zero => exact det_row_zero pre post cols + | succ n ih => + simp only [FiniteDiff.sum] + rw [det_row_add, ih] +def coeffProd {J : Type} (coef : J -> Nat -> Int) : List J -> List Nat -> Int + | [], [] => 1 + | r :: rs, d :: ds => coef r d * coeffProd coef rs ds + | _, _ => 0 +theorem dvd_det_map_sum_basis {I J : Type} (coef : J -> Nat -> Int) (basis : Nat -> I -> Int) + (D : Nat) (m : Int) (rows : List J) (pre : List (I -> Int)) (cols : List I) (a : Int) + (h : ∀ ds : List Nat, ds.length = rows.length -> (∀ d ∈ ds, d < D) -> + m ∣ (a * coeffProd coef rows ds * det (pre ++ ds.map basis) cols)) : + m ∣ (a * det (pre ++ rows.map (fun r c => FiniteDiff.sum D (fun d => coef r d * basis d c))) + cols) := by + induction rows generalizing pre a with + | nil => + have h0 := h [] rfl (by intro d hd; cases hd) + simp only [List.map_nil, coeffProd, mul_one] at h0 ⊢ + exact h0 + | cons r rs ih => + simp only [List.map_cons] + rw [det_row_sum, <- sum_smul] + apply dvd_sum + intro d hd + rw [det_row_smul] + have heq : a * (coef r d * det (pre ++ basis d :: rs.map (fun r c => FiniteDiff.sum D (fun d => + coef r d * basis d c))) cols) = + (a * coef r d) * det ((pre ++ [basis d]) ++ rs.map (fun r c => FiniteDiff.sum D (fun d => + coef r d * basis d c))) cols := by + simp only [List.append_assoc, List.singleton_append] + ring + rw [heq] + apply ih (pre ++ [basis d]) (a * coef r d) + intro ds hlen hds + have hstep := h (d :: ds) (by simp [hlen]) (by + intro x hx + rcases List.mem_cons.mp hx with rfl | hmem + · exact hd + · exact hds x hmem) + simp only [coeffProd, List.map_cons, List.append_assoc, List.singleton_append] at hstep ⊢ + have hmul : a * coef r d * coeffProd coef rs ds * det (pre ++ basis d :: ds.map basis) cols = + a * (coef r d * coeffProd coef rs ds) * det (pre ++ basis d :: ds.map basis) cols := by ring + rw [hmul] + exact hstep +theorem exists_split_of_mem {α : Type} {x : α} {l : List α} (h : x ∈ l) : + ∃ pre post : List α, l = pre ++ x :: post := by + induction l with + | nil => cases h + | cons y ys ih => + rcases List.mem_cons.mp h with rfl | hmem + · exact ⟨[], ys, rfl⟩ + · obtain ⟨pre, post, rfl⟩ := ih hmem + exact ⟨y :: pre, post, rfl⟩ +theorem det_map_eq_zero_of_not_nodup_nat {I : Type} (basis : Nat -> I -> Int) (ds : List Nat) (cols + : List I) + (h : ¬ ds.Nodup) : det (ds.map basis) cols = 0 := by + induction ds generalizing cols with + | nil => exact absurd (by simp) h + | cons d ds ih => + by_cases hin : d ∈ ds + · obtain ⟨pre, post, rfl⟩ := exists_split_of_mem hin + have hmap : (d :: (pre ++ d :: post)).map basis = + [] ++ basis d :: pre.map basis ++ basis d :: post.map basis := by simp + rw [hmap] + exact det_dup_row [] (pre.map basis) (basis d) (post.map basis) cols + · have hds : ¬ ds.Nodup := fun hnd => h (List.Nodup.cons hin hnd) + simp only [List.map_cons, det] + rw [lap_congr cols _ (fun _ _ => 0) (fun c cs => by rw [ih cs hds, mul_zero])] + exact lap_zero cols +end Determinant +namespace DegreeSum +def natListSum : List Nat -> Nat + | [] => 0 + | d :: ds => d + natListSum ds +def intListSum (ds : List Nat) : Int := (natListSum ds : Int) +@[simp] theorem intListSum_nil : intListSum [] = 0 := rfl +@[simp] theorem intListSum_cons (d : Nat) (ds : List Nat) : + intListSum (d :: ds) = (d : Int) + intListSum ds := by + simp [intListSum, natListSum, Nat.cast_add] +theorem intListSum_perm (ds es : List Nat) (h : ds.Perm es) : intListSum ds = intListSum es := by + induction h with + | nil => rfl + | cons x _ ih => simp only [intListSum_cons, ih] + | swap x y l => simp only [intListSum_cons]; ring + | trans _ _ ih1 ih2 => rw [ih1, ih2] +theorem intListSum_nonneg (ds : List Nat) : 0 ≤ intListSum ds := Nat.cast_nonneg _ +theorem exists_min_perm_cons (ds : List Nat) (h : ds ≠ []) : + ∃ d es, ds.Perm (d :: es) /\ ∀ e ∈ es, d ≤ e := by + induction ds with + | nil => contradiction + | cons d ds ih => + cases ds with + | nil => + refine ⟨d, [], List.Perm.refl _, ?_⟩ + intro e he; cases he + | cons e es => + obtain ⟨m, ms, hp, hm⟩ := ih (by simp) + by_cases hdm : d ≤ m + · refine ⟨d, e :: es, List.Perm.refl _, ?_⟩ + intro x hx + have hx' : x ∈ m :: ms := hp.subset hx + rcases List.mem_cons.mp hx' with rfl | hmem + · exact hdm + · exact Nat.le_trans hdm (hm x hmem) + · refine ⟨m, d :: ms, (hp.cons d).trans (List.Perm.swap m d ms), ?_⟩ + intro x hx + rcases List.mem_cons.mp hx with rfl | hmem + · omega + · exact hm x hmem +theorem nodup_map_pred (ds : List Nat) (hnd : ds.Nodup) (hpos : ∀ d ∈ ds, 0 < d) : + (ds.map Nat.pred).Nodup := by + induction ds with + | nil => simp + | cons x xs ih => + obtain ⟨hnot, hnd'⟩ := List.nodup_cons.mp hnd + simp only [List.map_cons] + refine List.Nodup.cons ?_ (ih hnd' (fun d hd => hpos d (by simp [hd]))) + intro hin + rcases List.mem_map.mp hin with ⟨d, hd, hpred⟩ + have hx0 : 0 < x := hpos x (by simp) + have hd0 : 0 < d := hpos d (by simp [hd]) + simp only [Nat.pred_eq_sub_one] at hpred + have hxd : x = d := by omega + subst hxd + exact hnot hd +theorem intListSum_eq_map_pred_add_length (ds : List Nat) (hpos : ∀ d ∈ ds, 0 < d) : + intListSum ds = intListSum (ds.map Nat.pred) + (ds.length : Int) := by + induction ds with + | nil => simp + | cons x xs ih => + simp only [intListSum_cons, List.map_cons, List.length_cons] + have hx : 0 < x := hpos x (by simp) + have hih := ih (fun d hd => hpos d (by simp [hd])) + have hpred : (x : Int) = (x.pred : Int) + 1 := by + simp only [Nat.pred_eq_sub_one] + omega + push_cast + linarith +theorem length_mul_pred_le_two_mul_intListSum (ds : List Nat) (hdup : ds.Nodup) : + (ds.length : Int) * ((ds.length : Int) - 1) ≤ 2 * intListSum ds := by + generalize hlen : ds.length = n + induction n generalizing ds with + | zero => + cases ds with + | nil => simp + | cons _ _ => simp at hlen + | succ n ih => + have hne : ds ≠ [] := by + intro h; subst h; simp at hlen + obtain ⟨d, es, hp, hmin⟩ := exists_min_perm_cons ds hne + have hlen' : es.length = n := by + have := hp.length_eq + simp only [List.length_cons] at this + omega + have hes : (d :: es).Nodup := hp.nodup_iff.mp hdup + obtain ⟨hnot, hdup'⟩ := List.nodup_cons.mp hes + have hpos : ∀ e ∈ es, 0 < e := by + intro e he + have hde := hmin e he + have hne' : e ≠ d := fun h => hnot (h ▸ he) + omega + have hlow := ih (es.map Nat.pred) (nodup_map_pred es hdup' hpos) (by simp [hlen']) + rw [intListSum_perm ds (d :: es) hp, intListSum_cons, intListSum_eq_map_pred_add_length es hpos, + hlen'] + have hd0 : (0 : Int) ≤ (d : Int) := Nat.cast_nonneg _ + push_cast + linarith +theorem intListSum_sub_le_map_sub (ds : List Nat) (K : Nat) : + intListSum ds - (ds.length : Int) * (K : Int) ≤ intListSum (ds.map (fun d => d - K)) := by + induction ds with + | nil => simp + | cons a ds ih => + simp only [intListSum_cons, List.map_cons, List.length_cons] + have ha : (a : Int) - (K : Int) ≤ ((a - K : Nat) : Int) := by omega + push_cast + linarith +end DegreeSum +namespace DivisibilityBound +theorem two_pow_dvd_two_pow (a b : Nat) (h : a ≤ b) : ((2 : Int) ^ a) ∣ ((2 : Int) ^ b) := by + refine ⟨(2 : Int) ^ (b - a), ?_⟩ + rw [<- pow_add, Nat.add_sub_of_le h] +theorem four_pow_dvd_coeffProd {J : Type} (coef : J -> Nat -> Int) (K : Nat) (rows : List J) (ds : + List Nat) + (hlen : ds.length = rows.length) + (hcoef : ∀ r ∈ rows, ∀ d, ((4 : Int) ^ (d - K)) ∣ coef r d) : + ((4 : Int) ^ (DegreeSum.natListSum (ds.map (fun d => d - K)))) ∣ Determinant.coeffProd coef rows + ds := by + induction rows generalizing ds with + | nil => + cases ds with + | nil => simp [Determinant.coeffProd, DegreeSum.natListSum] + | cons _ _ => simp at hlen + | cons r rs ih => + cases ds with + | nil => simp at hlen + | cons d ds => + simp only [List.map_cons, DegreeSum.natListSum, Determinant.coeffProd, pow_add] + rcases hcoef r (by simp) d with ⟨a, ha⟩ + have hih := ih ds (by simpa using hlen) (fun s hs => hcoef s (by simp [hs])) + rcases hih with ⟨b, hb⟩ + refine ⟨a * b, ?_⟩ + rw [ha, hb]; ring +theorem two_pow_dvd_det_basis {I J : Type} (coef : J -> Nat -> Int) (basis : Nat -> I -> Int) + (K D e : Nat) (rows : List J) (cols : List I) + (he : (e : Int) ≤ (rows.length : Int) * ((rows.length : Int) - 1 - 2 * (K : Int))) + (hcoef : ∀ r ∈ rows, ∀ d, ((4 : Int) ^ (d - K)) ∣ coef r d) : + ((2 : Int) ^ e) ∣ Determinant.det (rows.map (fun r c => FiniteDiff.sum D (fun d => coef r d * + basis d c))) cols := by + have h1 : Determinant.det (rows.map (fun r c => FiniteDiff.sum D (fun d => coef r d * basis d c))) + cols = + 1 * Determinant.det ([] ++ rows.map (fun r c => FiniteDiff.sum D (fun d => coef r d * basis d + c))) cols := by + simp + rw [h1] + apply Determinant.dvd_det_map_sum_basis + intro ds hlen _ + simp only [List.nil_append, one_mul] + by_cases hnd : ds.Nodup + · have hsum := DegreeSum.length_mul_pred_le_two_mul_intListSum ds hnd + have hcost := DegreeSum.intListSum_sub_le_map_sub ds K + have hexp : e ≤ 2 * DegreeSum.natListSum (ds.map (fun d => d - K)) := by + rw [hlen] at hsum hcost + unfold DegreeSum.intListSum at hsum hcost + have hlin : (rows.length : Int) * ((rows.length : Int) - 1 - 2 * (K : Int)) = + (rows.length : Int) * ((rows.length : Int) - 1) - 2 * ((rows.length : Int) * (K : Int)) := + by ring + have hexp_int : (e : Int) ≤ 2 * (DegreeSum.natListSum (ds.map (fun d => d - K)) : Int) := by + linarith + omega + have hweight : ((2 : Int) ^ e) ∣ Determinant.coeffProd coef rows ds := by + apply dvd_trans (two_pow_dvd_two_pow e (2 * DegreeSum.natListSum (ds.map (fun d => d - K))) + hexp) + have h4 : ((2 : Int) ^ (2 * DegreeSum.natListSum (ds.map (fun d => d - K)))) = + ((4 : Int) ^ (DegreeSum.natListSum (ds.map (fun d => d - K)))) := by + rw [pow_mul] + rfl + rw [h4] + exact four_pow_dvd_coeffProd coef K rows ds hlen hcoef + exact dvd_mul_of_dvd_left hweight _ + · rw [Determinant.det_map_eq_zero_of_not_nodup_nat basis ds cols hnd, mul_zero] + exact dvd_zero _ +theorem sum_eq_of_eq_zero_range (n m : Nat) (f : Nat -> Int) (hnm : n ≤ m) + (hz : ∀ d, n ≤ d /\ d < m -> f d = 0) : + FiniteDiff.sum m f = FiniteDiff.sum n f := by + induction m with + | zero => + have : n = 0 := by omega + subst this; rfl + | succ m ih => + by_cases hne : n = m + 1 + · subst hne; rfl + · simp only [FiniteDiff.sum] + rw [hz m ⟨by omega, by omega⟩, ih (by omega) (fun d hd => hz d ⟨hd.1, by omega⟩), add_zero] +theorem eq_sum_fwdDiff_binomInt (f : Nat -> Int) (D x : Nat) (hx : x < D) : + f x = FiniteDiff.sum D (fun d => FiniteDiff.fwdDiff d f 0 * FiniteDiff.binomInt x d) := by + have h := FiniteDiff.newton_forward_diff f x 0 + rw [Nat.zero_add] at h + rw [h, sum_eq_of_eq_zero_range (x + 1) D (fun d => FiniteDiff.fwdDiff d f 0 * FiniteDiff.binomInt + x d) (by omega)] + · apply FiniteDiff.sum_congr + intro k _; ring + · intro d hd + rw [FiniteDiff.binomInt_eq_zero_of_lt x d (by omega), mul_zero] +theorem two_pow_dvd_det_monomial_geom (K e : Nat) (rows : List (Nat × Int)) (cols : List Nat) + (he : (e : Int) ≤ (rows.length : Int) * ((rows.length : Int) - 1 - 2 * (K : Int))) + (hrows : ∀ k q, (k, q) ∈ rows -> k ≤ K /\ ((4 : Int) ∣ (q - 1))) : + ((2 : Int) ^ e) ∣ Determinant.det (rows.map (fun p (x : Nat) => (x : Int) ^ p.1 * p.2 ^ x)) cols + := by + let D := cols.foldr Nat.max 0 + 1 + have hcols : ∀ x ∈ cols, x < D := by + change ∀ x ∈ cols, x < cols.foldr Nat.max 0 + 1 + induction cols with + | nil => intro x hx; cases hx + | cons y ys ih => + intro x hx + simp only [List.foldr_cons] + have h1 : y ≤ Nat.max y (ys.foldr Nat.max 0) := Nat.le_max_left y _ + have h2 : ys.foldr Nat.max 0 ≤ Nat.max y (ys.foldr Nat.max 0) := Nat.le_max_right y _ + rcases List.mem_cons.mp hx with rfl | hmem + · omega + · have := ih x hmem; omega + have hext : Determinant.det (rows.map (fun p (x : Nat) => (x : Int) ^ p.1 * p.2 ^ x)) cols = + Determinant.det (rows.map (fun p (x : Nat) => FiniteDiff.sum D (fun d => + FiniteDiff.fwdDiff d (fun (y : Nat) => (y : Int) ^ p.1 * p.2 ^ y) 0 * FiniteDiff.binomInt x + d))) cols := by + apply Determinant.det_congr_cols + rw [List.forall₂_map_left_iff, List.forall₂_map_right_iff] + exact List.forall₂_same.mpr (fun p _ x hx => eq_sum_fwdDiff_binomInt (fun (y : Nat) => (y : Int) + ^ p.1 * p.2 ^ y) D x (hcols x hx)) + rw [hext] + apply two_pow_dvd_det_basis _ (fun d x => FiniteDiff.binomInt x d) K D e rows cols he + intro ⟨k, q⟩ hp d + obtain ⟨hk, hq⟩ := hrows k q hp + exact dvd_trans (FiniteDiff.pow_dvd_pow_of_le (d - K) (d - k) (by omega)) + (FiniteDiff.four_pow_dvd_fwdDiff_monomial_geom q hq k d 0) +end DivisibilityBound +namespace GaussianElim +theorem det_row_sub {I : Type} (pre : List (I -> Int)) (r s : I -> Int) (post : List (I -> Int)) + (cols : List I) : + Determinant.det (pre ++ (fun c => r c - s c) :: post) cols = + Determinant.det (pre ++ r :: post) cols - Determinant.det (pre ++ s :: post) cols := by + induction pre generalizing cols with + | nil => + simp only [List.nil_append, Determinant.det, <- Determinant.lap_sub] + apply Determinant.lap_congr; intro c cs; ring + | cons t pre ih => + simp only [List.cons_append, Determinant.det, <- Determinant.lap_sub] + apply Determinant.lap_congr; intro c cs; rw [ih]; ring +theorem det_col_zero {I : Type} (rows : List (I -> Int)) (c : I) (cols : List I) + (hlen : rows.length = cols.length + 1) (hz : ∀ r ∈ rows, r c = 0) : + Determinant.det rows (c :: cols) = 0 := by + induction rows generalizing c cols with + | nil => simp at hlen + | cons r rs ih => + simp only [Determinant.det, Determinant.lap] + rw [hz r (by simp), zero_mul, zero_sub, neg_eq_zero] + rw [Determinant.lap_congr_perm cols (fun d ds => r d * Determinant.det rs (c :: ds)) (fun _ _ => + 0)] + · exact Determinant.lap_zero cols + · intro d ds hp + have hp_len := hp.length_eq + simp only [List.length_cons] at hlen hp_len + rw [ih c ds (by omega) (fun s hs => hz s (by simp [hs])), mul_zero] +theorem det_col_head_only {I : Type} (r : I -> Int) (rs : List (I -> Int)) (c : I) (cols : List I) + (hlen : rs.length = cols.length) (hz : ∀ s ∈ rs, s c = 0) : + Determinant.det (r :: rs) (c :: cols) = r c * Determinant.det rs cols := by + simp only [Determinant.det, Determinant.lap] + rw [Determinant.lap_congr_perm cols (fun d ds => r d * Determinant.det rs (c :: ds)) (fun _ _ => + 0)] + · rw [Determinant.lap_zero]; ring + · intro d ds hp + have hp_len := hp.length_eq + simp only [List.length_cons] at hp_len + rw [det_col_zero rs c ds (by omega) hz, mul_zero] +theorem det_row_elim_one {I : Type} (r s : I -> Int) (a b : Int) (pre post : List (I -> Int)) (cols + : List I) : + Determinant.det (r :: (pre ++ (fun x => a * s x - b * r x) :: post)) cols = + a * Determinant.det (r :: (pre ++ s :: post)) cols := by + change Determinant.det ((r :: pre) ++ (fun x => a * s x - b * r x) :: post) cols = + a * Determinant.det ((r :: pre) ++ s :: post) cols + rw [det_row_sub, Determinant.det_row_smul, Determinant.det_row_smul] + have hzero := Determinant.det_dup_row [] pre r post cols + simp only [List.nil_append] at hzero + change Determinant.det ((r :: pre) ++ r :: post) cols = 0 at hzero + rw [hzero]; ring +theorem det_row_elim_map {I : Type} (r : I -> Int) (c : I) (a : Int) (rs pre : List (I -> Int)) + (cols : List I) : + Determinant.det (r :: (pre ++ rs.map (fun s x => a * s x - s c * r x))) cols = + a ^ rs.length * Determinant.det (r :: (pre ++ rs)) cols := by + induction rs generalizing pre cols with + | nil => simp + | cons s rs ih => + simp only [List.map_cons, List.length_cons] + rw [det_row_elim_one] + have h1 : pre ++ s :: rs.map (fun s x => a * s x - s c * r x) = + (pre ++ [s]) ++ rs.map (fun s x => a * s x - s c * r x) := by simp + have h2 : pre ++ s :: rs = (pre ++ [s]) ++ rs := by simp + rw [h1, ih (pre ++ [s]) cols, h2, pow_succ] + ring +def linComb {I : Type} : List (I -> Int) -> List Int -> I -> Int + | r :: rs, w :: ws, c => w * r c + linComb rs ws c + | _, _, _ => 0 +theorem linComb_replicate_zero {I : Type} (rows : List (I -> Int)) (c : I) : + linComb rows (List.replicate rows.length 0) c = 0 := by + induction rows with + | nil => rfl + | cons r rs ih => simp [List.replicate_succ, linComb, ih] +theorem linComb_map_smul {I : Type} (rows : List (I -> Int)) (ws : List Int) (a : Int) (c : I) : + linComb rows (ws.map (fun w => a * w)) c = a * linComb rows ws c := by + induction rows generalizing ws with + | nil => simp [linComb] + | cons r rs ih => + cases ws with + | nil => simp [linComb] + | cons w ws => simp only [List.map_cons, linComb, ih]; ring +theorem linComb_map_elim {I : Type} (rows : List (I -> Int)) (ws : List Int) + (r : I -> Int) (c : I) (a : Int) (x : I) : + linComb (rows.map (fun s x => a * s x - s c * r x)) ws x = + a * linComb rows ws x - r x * linComb rows ws c := by + induction rows generalizing ws with + | nil => simp [linComb] + | cons s rs ih => + cases ws with + | nil => simp [linComb] + | cons w ws => simp only [List.map_cons, linComb, ih]; ring +def RowIndep {I : Type} (rows : List (I -> Int)) (cols : List I) : Prop := + ∀ ws : List Int, ws.length = rows.length -> + (∀ c ∈ cols, linComb rows ws c = 0) -> + ∀ w ∈ ws, w = 0 +theorem exists_col_ne_zero_of_rowIndep {I : Type} (r : I -> Int) (rs : List (I -> Int)) (cols : List + I) + (hind : RowIndep (r :: rs) cols) : ∃ c ∈ cols, r c ≠ 0 := by + by_contra h + push Not at h + have hbad := hind (1 :: List.replicate rs.length 0) (by simp) (by + intro c hc + simp only [linComb, linComb_replicate_zero, h c hc] + ring) + have h1 : (1 : Int) = 0 := hbad 1 (by simp) + omega +theorem rowIndep_elim {I : Type} (r : I -> Int) (rs : List (I -> Int)) (cols : List I) (c : I) + (hind : RowIndep (r :: rs) cols) (hc : r c ≠ 0) : + RowIndep (rs.map (fun s x => r c * s x - s c * r x)) cols := by + intro ws hlen hz + rw [List.length_map] at hlen + have hrel := hind (-linComb rs ws c :: ws.map (fun w => r c * w)) + (by simp [hlen]) + (by + intro x hx + have hzx := hz x hx + rw [linComb_map_elim] at hzx + simp only [linComb, linComb_map_smul] + linarith) + intro w hw + have hmem : r c * w ∈ -linComb rs ws c :: ws.map (fun w => r c * w) := + List.mem_cons_of_mem _ (List.mem_map.mpr ⟨w, hw, rfl⟩) + have hmul : r c * w = 0 := hrel (r c * w) hmem + rcases mul_eq_zero.mp hmul with hrc | hw0 + · exact absurd hrc hc + · exact hw0 +theorem exists_cols_det_ne_zero {I : Type} (rows : List (I -> Int)) (cols : List I) + (hind : RowIndep rows cols) : + ∃ cs : List I, cs.length = rows.length /\ (∀ x ∈ cs, x ∈ cols) /\ Determinant.det rows cs ≠ 0 := + by + generalize hlen : rows.length = n + induction n generalizing rows with + | zero => + cases rows with + | nil => + refine ⟨[], rfl, ?_, by simp [Determinant.det]⟩ + intro x hx; cases hx + | cons _ _ => simp at hlen + | succ n ih => + cases rows with + | nil => simp at hlen + | cons r rs => + obtain ⟨c, hc, hr⟩ := exists_col_ne_zero_of_rowIndep r rs cols hind + obtain ⟨cs, hcs, hin, hdet⟩ := ih (rs.map (fun s x => r c * s x - s c * r x)) + (rowIndep_elim r rs cols c hind hr) + (by simp only [List.length_cons] at hlen; rw [List.length_map]; omega) + refine ⟨c :: cs, by simp [hcs], ?_, ?_⟩ + · intro x hx + rcases List.mem_cons.mp hx with rfl | hmem + · exact hc + · exact hin x hmem + · intro hzero + have heq := det_row_elim_map r c (r c) rs [] (c :: cs) + simp only [List.nil_append] at heq + rw [hzero, mul_zero] at heq + rw [det_col_head_only r (rs.map (fun s x => r c * s x - s c * r x)) c cs + (by simp only [List.length_cons] at hlen; simp [hcs]; omega) + (by + intro s hs + rcases List.mem_map.mp hs with ⟨t, _, rfl⟩ + ring)] at heq + rcases mul_eq_zero.mp heq with hrc | hdet0 + · exact hr hrc + · exact hdet hdet0 +theorem det_linComb_cons_eq_zero {I : Type} (rows : List (I -> Int)) (ws : List Int) + (pre : List (I -> Int)) (cols : List I) : + Determinant.det (linComb rows ws :: (pre ++ rows)) cols = 0 := by + induction rows generalizing ws pre cols with + | nil => + have : linComb ([] : List (I -> Int)) ws = (fun _ => 0) := by funext _; rfl + rw [this] + exact Determinant.det_row_zero [] (pre ++ []) cols + | cons r rs ih => + cases ws with + | nil => + have : linComb (r :: rs) [] = (fun _ => 0) := by funext _; rfl + rw [this] + exact Determinant.det_row_zero [] (pre ++ r :: rs) cols + | cons w ws => + change Determinant.det ([] ++ (fun c => w * r c + linComb rs ws c) :: (pre ++ r :: rs)) cols = + 0 + rw [Determinant.det_row_add, Determinant.det_row_smul] + have hr := Determinant.det_dup_row [] pre r rs cols + simp only [List.nil_append, List.cons_append] at hr ⊢ + rw [hr] + have h1 : pre ++ r :: rs = (pre ++ [r]) ++ rs := by simp + rw [h1, ih ws (pre ++ [r]) cols] + ring +theorem det_cons_eq_zero_of_linComb_eq_zero {I : Type} (r : I -> Int) (rs : List (I -> Int)) + (a : Int) (ws : List Int) (cols : List I) (ha : a ≠ 0) + (hrel : ∀ c ∈ cols, a * r c + linComb rs ws c = 0) : + Determinant.det (r :: rs) cols = 0 := by + have hdet : Determinant.det ((fun c => a * r c + linComb rs ws c) :: rs) cols = 0 := by + rw [Determinant.det_congr_cols _ ((fun _ => 0) :: rs) cols] + · exact Determinant.det_row_zero [] rs cols + · refine List.Forall₂.cons hrel ?_ + exact List.forall₂_same.mpr (fun _ _ _ _ => rfl) + change Determinant.det ([] ++ (fun c => a * r c + linComb rs ws c) :: rs) cols = 0 at hdet + rw [Determinant.det_row_add, Determinant.det_row_smul] at hdet + have hzero := det_linComb_cons_eq_zero rs ws [] cols + simp only [List.nil_append] at hdet hzero + rw [hzero, add_zero] at hdet + rcases mul_eq_zero.mp hdet with ha0 | hr0 + · exact absurd ha0 ha + · exact hr0 +end GaussianElim +namespace HadamardBound +theorem listProd_replicate (a : Int) (n : Nat) : + Determinant.listProd (List.replicate n a) = a ^ n := by + induction n with + | zero => simp [Determinant.listProd] + | succ n ih => + simp only [List.replicate_succ, Determinant.listProd, ih]; ring +theorem factorial_le_pow (n : Nat) (b : Int) (hb : 0 ≤ b) (hn : (n : Int) ≤ b) : + (n.factorial : Int) ≤ b ^ n := by + induction n with + | zero => simp + | succ n ih => + simp only [Nat.factorial_succ, Nat.cast_mul] + calc ((n + 1 : Nat) : Int) * (n.factorial : Int) + _ ≤ b * b ^ n := mul_le_mul hn (ih (by push_cast at hn; linarith)) (Nat.cast_nonneg _) hb + _ = b ^ (n + 1) := by ring +theorem abs_det_le_two_pow {I : Type} (rows : List (I -> Int)) (cols : List I) (m b : Nat) + (hlen : rows.length = cols.length) + (hsize : rows.length ≤ 2 ^ m) + (hrows : ∀ r ∈ rows, ∀ c ∈ cols, |r c| ≤ (2 : Int) ^ b) : + |Determinant.det rows cols| ≤ (2 : Int) ^ (rows.length * (m + b)) := by + have hbounds : Determinant.RowBounds cols rows (List.replicate rows.length ((2 : Int) ^ b)) := by + clear hlen hsize + induction rows with + | nil => exact List.Forall₂.nil + | cons r rs ih => + simp only [List.length_cons, List.replicate_succ] + refine List.Forall₂.cons ⟨by positivity, hrows r (by simp)⟩ ?_ + exact ih (fun s hs => hrows s (by simp [hs])) + have hdet := Determinant.abs_det_le_factorial_mul_listProd rows cols _ hlen hbounds + rw [listProd_replicate] at hdet + have hsize' : (rows.length : Int) ≤ (2 : Int) ^ m := by exact_mod_cast hsize + have hfact := factorial_le_pow rows.length ((2 : Int) ^ m) (by positivity) hsize' + have hp : (0 : Int) ≤ ((2 : Int) ^ b) ^ rows.length := by positivity + have hmul := mul_le_mul_of_nonneg_right hfact hp + have hpow : ((2 : Int) ^ m) ^ rows.length * ((2 : Int) ^ b) ^ rows.length = + (2 : Int) ^ (rows.length * (m + b)) := by + rw [<- pow_mul, <- pow_mul, <- pow_add] + congr 1 + ring + linarith +theorem false_of_two_pow_dvd_and_abs_le (D : Int) (U T : Nat) + (hut : U < T) (hd : D ≠ 0) (hdiv : ((2 : Int) ^ T) ∣ D) (hbound : |D| ≤ (2 : Int) ^ U) : + False := by + rcases hdiv with ⟨w, rfl⟩ + have hw0 : w ≠ 0 := fun h => hd (by simp [h]) + have hw_abs : 1 ≤ |w| := Int.one_le_abs hw0 + have hpow_pos : (0 : Int) < (2 : Int) ^ T := by positivity + have hstrict : (2 : Int) ^ U < (2 : Int) ^ T := by + exact pow_lt_pow_right₀ (by norm_num) hut + rw [abs_mul, abs_of_pos hpow_pos] at hbound + have hle : (2 : Int) ^ T * 1 ≤ (2 : Int) ^ T * |w| := + mul_le_mul_of_nonneg_left hw_abs (le_of_lt hpow_pos) + linarith +theorem lap_map {I J : Type} (f : I -> J) (cs : List I) (g : J -> List J -> Int) : + Determinant.lap (cs.map f) g = Determinant.lap cs (fun c cs => g (f c) (cs.map f)) := by + induction cs generalizing g with + | nil => rfl + | cons c cs ih => + simp only [List.map_cons, Determinant.lap, ih] +theorem det_map_cols {I J : Type} (f : I -> J) (rows : List (J -> Int)) (cs : List I) : + Determinant.det rows (cs.map f) = Determinant.det (rows.map (fun r c => r (f c))) cs := by + induction rows generalizing cs with + | nil => rfl + | cons r rs ih => + simp only [List.map_cons, Determinant.det, lap_map] + apply Determinant.lap_congr + intro c ds + rw [ih] +end HadamardBound +namespace Poly +def eval : List Int -> Int -> Int + | [], _ => 0 + | a :: p, x => a + x * Poly.eval p x +def divLinear : List Int -> Int -> List Int + | [], _ => [] + | _ :: [], _ => [] + | _ :: d :: ps, a => Poly.eval (d :: ps) a :: divLinear (d :: ps) a +theorem length_divLinear (p : List Int) (a : Int) : + (divLinear p a).length = p.length - 1 := by + induction p with + | nil => rfl + | cons c p ih => + cases p with + | nil => rfl + | cons d ps => + simp only [divLinear, List.length_cons, ih] + omega +theorem eval_sub_eval_eq_mul_divLinear (p : List Int) (a x : Int) : + Poly.eval p x - Poly.eval p a = (x - a) * Poly.eval (divLinear p a) x := by + induction p with + | nil => simp [Poly.eval, divLinear] + | cons c p ih => + cases p with + | nil => simp [Poly.eval, divLinear] + | cons d ps => + simp only [Poly.eval, divLinear] at ih ⊢ + have h1 : d + x * Poly.eval ps x = d + a * Poly.eval ps a + (x - a) * Poly.eval (divLinear (d + :: ps) a) x := by linarith + rw [h1]; ring +theorem eval_eq_zero_of_forall_zero (p : List Int) (x : Int) (h : ∀ a ∈ p, a = 0) : Poly.eval p x = + 0 := by + induction p with + | nil => rfl + | cons a p ih => + simp only [Poly.eval, h a (by simp), ih (fun b hb => h b (by simp [hb])), mul_zero, add_zero] +theorem forall_tail_zero_of_divLinear_zero (p : List Int) (a : Int) (h : ∀ c ∈ divLinear p a, c = 0) + : + ∀ c ∈ p.tail, c = 0 := by + induction p with + | nil => intro c hc; cases hc + | cons c p ih => + cases p with + | nil => intro x hx; cases hx + | cons d ps => + simp only [divLinear] at h + have hd : Poly.eval (d :: ps) a = 0 := h (Poly.eval (d :: ps) a) (by simp) + have hps : ∀ x ∈ ps, x = 0 := ih (fun x hx => h x (by simp [hx])) + simp only [Poly.eval, eval_eq_zero_of_forall_zero ps a hps, mul_zero, add_zero] at hd + intro x hx + rcases List.mem_cons.mp hx with rfl | hmem + · exact hd + · exact hps x hmem +theorem forall_zero_of_nodup_roots (p roots : List Int) (hnd : roots.Nodup) + (hz : ∀ x ∈ roots, Poly.eval p x = 0) (hsize : p.length ≤ roots.length) : + ∀ a ∈ p, a = 0 := by + generalize hlen : p.length = n + induction n generalizing p roots with + | zero => + cases p with + | nil => intro a ha; cases ha + | cons _ _ => simp at hlen + | succ n ih => + cases p with + | nil => simp at hlen + | cons c p => + cases roots with + | nil => simp at hsize + | cons a rs => + obtain ⟨hnot, hnd'⟩ := List.nodup_cons.mp hnd + have ha : Poly.eval (c :: p) a = 0 := hz a (by simp) + have hquot : ∀ x ∈ divLinear (c :: p) a, x = 0 := by + apply ih (divLinear (c :: p) a) rs hnd' + · intro x hx + have hq := eval_sub_eval_eq_mul_divLinear (c :: p) a x + have hzx : Poly.eval (c :: p) x = 0 := hz x (by simp [hx]) + rw [hzx, ha, sub_zero] at hq + have hxa : x - a ≠ 0 := sub_ne_zero.mpr (fun h => hnot (h ▸ hx)) + rcases mul_eq_zero.mp hq.symm with h1 | h2 + · exact absurd h1 hxa + · exact h2 + · rw [length_divLinear] + simp only [List.length_cons] at hsize ⊢ + omega + · rw [length_divLinear] + simp only [List.length_cons] at hlen ⊢ + omega + have hp : ∀ x ∈ p, x = 0 := forall_tail_zero_of_divLinear_zero (c :: p) a hquot + simp only [Poly.eval, eval_eq_zero_of_forall_zero p a hp, mul_zero, add_zero] at ha + intro x hx + rcases List.mem_cons.mp hx with rfl | hmem + · exact ha + · exact hp x hmem +def add : List Int -> List Int -> List Int + | [], q => q + | p, [] => p + | a :: ps, b :: qs => (a + b) :: add ps qs +def smul (a : Int) (p : List Int) : List Int := p.map (a * ·) +def mul : List Int -> List Int -> List Int + | [], _ => [] + | _, [] => [] + | a :: ps, q => add (smul a q) (0 :: mul ps q) +theorem eval_add (p q : List Int) (x : Int) : Poly.eval (add p q) x = Poly.eval p x + Poly.eval q x + := by + induction p generalizing q with + | nil => simp [add, Poly.eval] + | cons a p ih => + cases q with + | nil => simp [add, Poly.eval] + | cons b q => simp only [add, Poly.eval, ih]; ring +theorem eval_smul (a : Int) (p : List Int) (x : Int) : Poly.eval (smul a p) x = a * Poly.eval p x := + by + induction p with + | nil => simp [smul, Poly.eval] + | cons b p ih => + simp only [smul, List.map_cons, Poly.eval] + rw [ <- smul, ih] + ring +theorem eval_mul (p q : List Int) (x : Int) : Poly.eval (mul p q) x = Poly.eval p x * Poly.eval q x + := by + induction p generalizing q with + | nil => simp [mul, Poly.eval] + | cons a p ih => + cases q with + | nil => simp [mul, Poly.eval] + | cons b q => + simp only [mul, eval_add, eval_smul, Poly.eval, ih] + ring +def shift : List Int -> Int -> List Int + | [], _ => [] + | c :: ps, a => add [c] (mul [a, 1] (shift ps a)) +theorem eval_shift (p : List Int) (a x : Int) : Poly.eval (shift p a) x = Poly.eval p (x + a) := by + induction p with + | nil => rfl + | cons c ps ih => + simp only [shift, eval_add, eval_mul, ih, Poly.eval] + ring +def coeff (p : List Int) (n : Nat) : Int := p.getD n 0 +@[simp] theorem coeff_nil (n : Nat) : coeff [] n = 0 := by + simp [coeff] +@[simp] theorem coeff_cons_zero (a : Int) (p : List Int) : coeff (a :: p) 0 = a := by + simp [coeff] +@[simp] theorem coeff_cons_succ (a : Int) (p : List Int) (n : Nat) : + coeff (a :: p) (n + 1) = coeff p n := by + simp [coeff] +theorem coeff_eq_zero_of_length_le (p : List Int) (n : Nat) (h : p.length ≤ n) : coeff p n = 0 := by + induction p generalizing n with + | nil => exact coeff_nil n + | cons a p ih => + cases n with + | zero => simp at h + | succ n => + rw [coeff_cons_succ] + exact ih n (by simp at h; omega) +theorem coeff_eq_zero_of_forall_zero (p : List Int) (n : Nat) (h : ∀ a ∈ p, a = 0) : + coeff p n = 0 := by + induction p generalizing n with + | nil => exact coeff_nil n + | cons a p ih => + cases n with + | zero => exact h a (by simp) + | succ n => exact ih n (fun b hb => h b (by simp [hb])) +theorem coeff_add (p q : List Int) (n : Nat) : + coeff (add p q) n = coeff p n + coeff q n := by + induction p generalizing q n with + | nil => simp [add] + | cons a p ih => + cases q with + | nil => simp [add] + | cons b q => + cases n with + | zero => simp [add] + | succ n => simp only [add, coeff_cons_succ, ih] +theorem coeff_smul (a : Int) (p : List Int) (n : Nat) : + coeff (smul a p) n = a * coeff p n := by + induction p generalizing n with + | nil => simp [smul] + | cons b p ih => + cases n with + | zero => simp [smul] + | succ n => + simp only [smul, List.map_cons, coeff_cons_succ] + exact ih n +theorem length_add (p q : List Int) : (add p q).length = max p.length q.length := by + induction p generalizing q with + | nil => simp [add] + | cons a p ih => + cases q with + | nil => simp [add] + | cons b q => + simp only [add, List.length_cons, ih] + omega +theorem length_smul (a : Int) (p : List Int) : (smul a p).length = p.length := by + simp [smul] +theorem length_mul_le (p q : List Int) : (mul p q).length ≤ p.length + q.length - 1 := by + induction p generalizing q with + | nil => simp [mul] + | cons a p ih => + cases q with + | nil => simp [mul] + | cons b q => + simp only [mul, length_add, length_smul, List.length_cons] + have := ih (b :: q) + simp only [List.length_cons] at this + omega +theorem length_shift_le (p : List Int) (a : Int) : (shift p a).length ≤ p.length := by + induction p with + | nil => simp [shift] + | cons c p ih => + simp only [shift, length_add, List.length_cons, List.length_nil] + have hmul := length_mul_le [a, 1] (shift p a) + simp only [List.length_cons, List.length_nil] at hmul + omega +theorem coeff_mul_top (p q : List Int) (d e : Nat) + (hp : p.length ≤ d + 1) (hq : q.length ≤ e + 1) : + coeff (mul p q) (d + e) = coeff p d * coeff q e := by + induction d generalizing p q with + | zero => + cases p with + | nil => simp [mul] + | cons a p => + cases p with + | nil => + cases q with + | nil => simp [mul] + | cons b q => + simp only [mul, coeff_add, coeff_smul, Nat.zero_add, coeff_cons_zero] + have hz : coeff [0] e = 0 := by + cases e <;> simp + rw [hz, add_zero] + | cons _ _ => simp at hp + | succ d ih => + cases p with + | nil => simp [mul] + | cons a p => + cases q with + | nil => simp [mul] + | cons b q => + have hstep : d + 1 + e = (d + e) + 1 := by omega + rw [hstep] + simp only [mul, coeff_add, coeff_smul, coeff_cons_succ] + rw [coeff_eq_zero_of_length_le q (d + e) (by simp at hq; omega), mul_zero, zero_add] + exact ih p (b :: q) (by simp at hp; omega) hq +theorem coeff_shift_top (p : List Int) (a : Int) (d : Nat) (hp : p.length ≤ d + 1) : + coeff (shift p a) d = coeff p d := by + induction d generalizing p with + | zero => + cases p with + | nil => rfl + | cons c p => + cases p with + | nil => rfl + | cons _ _ => simp at hp + | succ d ih => + cases p with + | nil => rfl + | cons c p => + simp only [shift, coeff_add, coeff_cons_succ, coeff_nil, zero_add] + have h1 : d + 1 = 1 + d := by omega + rw [h1, coeff_mul_top [a, 1] (shift p a) 1 d (by simp) + (Nat.le_trans (length_shift_le p a) (by simp at hp; omega))] + have h2 : coeff [a, 1] 1 = 1 := rfl + rw [h2, one_mul] + exact ih p (by simp at hp; omega) +end Poly +namespace PolyDet +def polyLap {I : Type} : List I -> (I -> List I -> List Int) -> List Int + | [], _ => [] + | c :: cs, f => Poly.add (f c cs) (Poly.smul (-1) (polyLap cs (fun d ds => f d (c :: ds)))) +theorem eval_polyLap {I : Type} (cols : List I) (f : I -> List I -> List Int) (x : Int) : + Poly.eval (polyLap cols f) x = Determinant.lap cols (fun c cs => Poly.eval (f c cs) x) := by + induction cols generalizing f with + | nil => rfl + | cons c cs ih => + simp only [polyLap, Determinant.lap, Poly.eval_add, Poly.eval_smul, ih] + ring +theorem coeff_polyLap {I : Type} (cols : List I) (f : I -> List I -> List Int) (n : Nat) : + Poly.coeff (polyLap cols f) n = Determinant.lap cols (fun c cs => Poly.coeff (f c cs) n) := by + induction cols generalizing f with + | nil => simp [polyLap, Determinant.lap] + | cons c cs ih => + simp only [polyLap, Determinant.lap, Poly.coeff_add, Poly.coeff_smul, ih] + ring +theorem length_polyLap_le {I : Type} (cols : List I) (f : I -> List I -> List Int) (n : Nat) + (h : ∀ c cs, (f c cs).length ≤ n) : (polyLap cols f).length ≤ n := by + induction cols generalizing f with + | nil => simp [polyLap] + | cons c cs ih => + simp only [polyLap, Poly.length_add, Poly.length_smul] + have h1 := h c cs + have h2 := ih (fun d ds => f d (c :: ds)) (fun d ds => h d (c :: ds)) + omega +def totalDeg {I : Type} : List (Nat × (I -> List Int)) -> Nat + | [] => 0 + | (d, _) :: rs => d + totalDeg rs +def polyDet {I : Type} : List (Nat × (I -> List Int)) -> List I -> List Int + | [], _ => [1] + | (_, r) :: rs, cols => polyLap cols (fun c cs => Poly.mul (r c) (polyDet rs cs)) +def DegBounded {I : Type} (rows : List (Nat × (I -> List Int))) : Prop := + ∀ p ∈ rows, ∀ c, (p.2 c).length ≤ p.1 + 1 +theorem eval_polyDet {I : Type} (rows : List (Nat × (I -> List Int))) (cols : List I) (x : Int) : + Poly.eval (polyDet rows cols) x = + Determinant.det (rows.map (fun p c => Poly.eval (p.2 c) x)) cols := by + induction rows generalizing cols with + | nil => simp [polyDet, Determinant.det, Poly.eval] + | cons p rs ih => + rcases p with ⟨d, r⟩ + simp only [polyDet, List.map_cons, Determinant.det, eval_polyLap] + apply Determinant.lap_congr + intro c cs + rw [Poly.eval_mul, ih] +theorem length_polyDet_le {I : Type} (rows : List (Nat × (I -> List Int))) (h : DegBounded rows) + (cols : List I) : + (polyDet rows cols).length ≤ totalDeg rows + 1 := by + induction rows generalizing cols with + | nil => simp [polyDet, totalDeg] + | cons p rs ih => + rcases p with ⟨d, r⟩ + simp only [polyDet, totalDeg] + apply length_polyLap_le + intro c cs + have hmul := Poly.length_mul_le (r c) (polyDet rs cs) + have hr := h (d, r) (by simp) c + simp only at hr + have hrs := ih (fun q hq => h q (by simp [hq])) cs + omega +theorem coeff_polyDet_totalDeg {I : Type} (rows : List (Nat × (I -> List Int))) (h : DegBounded + rows) (cols : List I) : + Poly.coeff (polyDet rows cols) (totalDeg rows) = + Determinant.det (rows.map (fun p c => Poly.coeff (p.2 c) p.1)) cols := by + induction rows generalizing cols with + | nil => rfl + | cons p rs ih => + rcases p with ⟨d, r⟩ + simp only [polyDet, totalDeg, List.map_cons, Determinant.det, coeff_polyLap] + apply Determinant.lap_congr + intro c cs + have hvalid_rs : DegBounded rs := fun q hq => h q (by simp [hq]) + rw [Poly.coeff_mul_top (r c) (polyDet rs cs) d (totalDeg rs) + (h (d, r) (by simp) c) (length_polyDet_le rs hvalid_rs cs)] + rw [ih hvalid_rs cs] +end PolyDet +namespace DetTranspose +theorem lap_comm {I J : Type} (xs : List I) (ys : List J) (F : I -> List I -> J -> List J -> Int) : + Determinant.lap xs (fun x xs => Determinant.lap ys (fun y ys => F x xs y ys)) = + Determinant.lap ys (fun y ys => Determinant.lap xs (fun x xs => F x xs y ys)) := by + induction xs generalizing F with + | nil => + simp only [Determinant.lap] + exact (Determinant.lap_zero ys).symm + | cons x xs ih => + simp only [Determinant.lap, ih, Determinant.lap_sub] +theorem det_cons_col_eq_lap_rows {I J : Type} (M : J -> I -> Int) (xs : List J) (y : I) (ys : List + I) + (hlen : xs.length = ys.length + 1) : + Determinant.det (xs.map M) (y :: ys) = + Determinant.lap xs (fun x xs => M x y * Determinant.det (xs.map M) ys) := by + induction xs generalizing y ys with + | nil => simp at hlen + | cons x xs ih => + simp only [List.map_cons, Determinant.det, Determinant.lap] + congr 1 + rw [Determinant.lap_congr_perm ys + (fun z zs => M x z * Determinant.det (xs.map M) (y :: zs)) + (fun z zs => Determinant.lap xs (fun t ts => M x z * (M t y * Determinant.det (ts.map M) + zs)))] + · rw [lap_comm] + apply Determinant.lap_congr + intro t ts + rw [<- Determinant.lap_smul] + apply Determinant.lap_congr + intro z zs; ring + · intro z zs hp + have hp_len := hp.length_eq + simp only [List.length_cons] at hlen hp_len + rw [ih y zs (by omega), Determinant.lap_smul] +theorem det_transpose {I J : Type} (M : J -> I -> Int) (xs : List J) (ys : List I) + (hlen : xs.length = ys.length) : + Determinant.det (xs.map M) ys = Determinant.det (ys.map (fun y x => M x y)) xs := by + induction ys generalizing xs with + | nil => + cases xs with + | nil => rfl + | cons _ _ => simp at hlen + | cons y ys ih => + rw [det_cons_col_eq_lap_rows M xs y ys hlen] + simp only [List.map_cons, Determinant.det] + apply Determinant.lap_congr_perm + intro x xs' hp + have hp_len := hp.length_eq + simp only [List.length_cons] at hlen hp_len + rw [ih xs' (by omega)] +theorem det_eq_zero_iff_of_perm_rows {I : Type} (rows rows' : List (I -> Int)) (h : rows.Perm rows') + (pre : List (I -> Int)) (cols : List I) : + Determinant.det (pre ++ rows) cols = 0 <-> Determinant.det (pre ++ rows') cols = 0 := by + induction h generalizing pre cols with + | nil => rfl + | @cons x l₁ l₂ _ ih => + have h1 : pre ++ x :: l₁ = (pre ++ [x]) ++ l₁ := by simp + have h2 : pre ++ x :: l₂ = (pre ++ [x]) ++ l₂ := by simp + rw [h1, h2] + exact ih (pre ++ [x]) cols + | swap x y l => + rw [Determinant.det_swap_adj] + exact neg_eq_zero + | trans _ _ ih1 ih2 => + exact (ih1 pre cols).trans (ih2 pre cols) +theorem det_eq_zero_iff_of_perm_cols {I J : Type} (M : J -> I -> Int) (xs : List J) (ys zs : List I) + (hlen : xs.length = ys.length) (hp : ys.Perm zs) : + Determinant.det (xs.map M) ys = 0 <-> Determinant.det (xs.map M) zs = 0 := by + have hlen' : xs.length = zs.length := hlen.trans hp.length_eq + rw [det_transpose M xs ys hlen, det_transpose M xs zs hlen'] + exact det_eq_zero_iff_of_perm_rows _ _ (hp.map (fun y x => M x y)) [] xs +theorem det_map_eq_zero_of_not_nodup {I J : Type} (basis : J -> I -> Int) (xs : List J) (cols : List + I) + (h : ¬ xs.Nodup) : Determinant.det (xs.map basis) cols = 0 := by + induction xs generalizing cols with + | nil => exact absurd (by simp) h + | cons x xs ih => + by_cases hin : x ∈ xs + · obtain ⟨pre, post, rfl⟩ := Determinant.exists_split_of_mem hin + have hmap : (x :: (pre ++ x :: post)).map basis = + [] ++ basis x :: pre.map basis ++ basis x :: post.map basis := by simp + rw [hmap] + exact Determinant.det_dup_row [] (pre.map basis) (basis x) (post.map basis) cols + · have hxs : ¬ xs.Nodup := fun hnd => h (List.Nodup.cons hin hnd) + simp only [List.map_cons, Determinant.det] + rw [Determinant.lap_congr cols _ (fun _ _ => 0) (fun c cs => by rw [ih cs hxs, mul_zero])] + exact Determinant.lap_zero cols +theorem perm_cons_append {α : Type} (c : α) (pre post : List α) : + (c :: (pre ++ post)).Perm (pre ++ c :: post) := by + induction pre with + | nil => exact List.Perm.refl _ + | cons x pre ih => + simp only [List.cons_append] + exact (List.Perm.swap x c (pre ++ post)).trans (ih.cons x) +theorem perm_of_nodup_length_subset {I : Type} {cs cols : List I} + (hnd : cs.Nodup) (hlen : cs.length = cols.length) (hsub : ∀ x ∈ cs, x ∈ cols) : + cs.Perm cols := by + induction cs generalizing cols with + | nil => + cases cols with + | nil => exact List.Perm.refl _ + | cons _ _ => simp at hlen + | cons c cs ih => + obtain ⟨hnot, hnd'⟩ := List.nodup_cons.mp hnd + obtain ⟨pre, post, rfl⟩ := Determinant.exists_split_of_mem (hsub c (by simp)) + have hsub' : ∀ x ∈ cs, x ∈ pre ++ post := by + intro x hx + have hx_in := hsub x (by simp [hx]) + rcases List.mem_append.mp hx_in with hpre | hpost + · exact List.mem_append_left post hpre + · rcases List.mem_cons.mp hpost with rfl | hpost' + · exact absurd hx hnot + · exact List.mem_append_right pre hpost' + have hlen' : cs.length = (pre ++ post).length := by + simp only [List.length_cons, List.length_append] at hlen ⊢ + omega + exact ((ih hnd' hlen' hsub').cons c).trans (perm_cons_append c pre post) +theorem det_ne_zero_of_rowIndep {I : Type} (rows : List (I -> Int)) (cols : List I) + (hlen : rows.length = cols.length) (hind : GaussianElim.RowIndep rows cols) : + Determinant.det rows cols ≠ 0 := by + intro hzero + obtain ⟨cs, hcs, hincl, hdet⟩ := GaussianElim.exists_cols_det_ne_zero rows cols hind + have hnd : cs.Nodup := by + by_contra h + apply hdet + have ht := det_transpose (fun (r : I -> Int) c => r c) rows cs hcs.symm + simp only [List.map_id'] at ht + rw [ht] + exact det_map_eq_zero_of_not_nodup (fun c (r : I -> Int) => r c) cs rows h + have hp : cs.Perm cols := perm_of_nodup_length_subset hnd (hcs.trans hlen) hincl + have hperm := det_eq_zero_iff_of_perm_cols (fun (r : I -> Int) c => r c) rows cs cols hcs.symm hp + simp only [List.map_id'] at hperm + exact hdet (hperm.mpr hzero) +end DetTranspose +namespace Vandermonde +def seq : Nat -> Nat -> List Nat + | _, 0 => [] + | a, n + 1 => a :: seq (a + 1) n +@[simp] theorem length_seq (a n : Nat) : (seq a n).length = n := by + induction n generalizing a with + | zero => rfl + | succ n ih => simp [seq, ih] +theorem seq_succ_append (a n : Nat) : seq a (n + 1) = seq a n ++ [a + n] := by + induction n generalizing a with + | zero => simp [seq] + | succ n ih => + rw [seq, ih (a + 1), seq, List.cons_append] + have : a + 1 + n = a + (n + 1) := by omega + rw [this] +theorem seq_zero_eq_range (n : Nat) : seq 0 n = List.range n := by + induction n with + | zero => rfl + | succ n ih => + rw [seq_succ_append, ih, List.range_succ, Nat.zero_add] +theorem linComb_seq_pow (n : Nat) (ws : List Int) (a : Nat) (x : Int) (hlen : ws.length = n) : + GaussianElim.linComb ((seq a n).map (fun k x => x ^ k)) ws x = + x ^ a * Poly.eval ws x := by + induction n generalizing ws a with + | zero => + cases ws with + | nil => simp [seq, GaussianElim.linComb, Poly.eval] + | cons _ _ => simp at hlen + | succ n ih => + cases ws with + | nil => simp at hlen + | cons w ws => + simp only [seq, List.map_cons, GaussianElim.linComb, Poly.eval] + rw [ih ws (a + 1) (by simpa using hlen), pow_succ] + ring +theorem det_vandermonde_ne_zero (qs : List Int) (hnd : qs.Nodup) : + Determinant.det ((List.range qs.length).map (fun k x => x ^ k)) qs ≠ 0 := by + apply DetTranspose.det_ne_zero_of_rowIndep + · simp + · intro ws hlen hz + simp only [List.length_map, List.length_range] at hlen + apply Poly.forall_zero_of_nodup_roots ws qs hnd + · intro x hx + have hzx := hz x hx + rw [<- seq_zero_eq_range, linComb_seq_pow qs.length ws 0 x hlen] at hzx + simpa using hzx + · omega +theorem det_vandermonde_transpose_ne_zero (qs : List Int) (hnd : qs.Nodup) : + Determinant.det (qs.map (fun q a => q ^ a)) (List.range qs.length) ≠ 0 := by + rw [DetTranspose.det_transpose (fun q a => q ^ a) qs (List.range qs.length) (by simp)] + exact det_vandermonde_ne_zero qs hnd +end Vandermonde +namespace ExpPoly +theorem det_map_row_scale {I J : Type} (f : J -> I -> Int) (a : J -> Int) (rs : List J) (cols : List + I) : + Determinant.det (rs.map (fun r c => a r * f r c)) cols = + Determinant.listProd (rs.map a) * Determinant.det (rs.map f) cols := by + induction rs generalizing cols with + | nil => simp [Determinant.det, Determinant.listProd] + | cons r rs ih => + simp only [List.map_cons, Determinant.listProd, Determinant.det, <- Determinant.lap_smul] + apply Determinant.lap_congr + intro c cs + rw [ih]; ring +theorem listProd_ne_zero (xs : List Int) (h : ∀ x ∈ xs, x ≠ 0) : Determinant.listProd xs ≠ 0 := by + induction xs with + | nil => simp [Determinant.listProd] + | cons x xs ih => + simp only [Determinant.listProd] + exact mul_ne_zero (h x (by simp)) (ih (fun y hy => h y (by simp [hy]))) +structure ExpTerm where + base : Int + order : Nat + polynomial : List Int +def lc (t : ExpTerm) : Int := Poly.coeff t.polynomial t.order +def ValidExpTerm (t : ExpTerm) : Prop := t.polynomial.length ≤ t.order + 1 /\ lc t ≠ 0 +def rows (ts : List ExpTerm) : List (Nat × (Nat -> List Int)) := + ts.map (fun t => (t.order, fun a => Poly.smul (t.base ^ a) (Poly.shift t.polynomial (a : Int)))) +def cols (ts : List ExpTerm) : List Nat := List.range ts.length +def H (ts : List ExpTerm) : List Int := PolyDet.polyDet (rows ts) (cols ts) +def totalDeg (ts : List ExpTerm) : Nat := PolyDet.totalDeg (rows ts) +theorem degBounded_rows (ts : List ExpTerm) (hg : ∀ t ∈ ts, ValidExpTerm t) : + PolyDet.DegBounded (rows ts) := by + intro p hp a + rcases List.mem_map.mp hp with ⟨t, ht, rfl⟩ + obtain ⟨hlen, _⟩ := hg t ht + simp only [Poly.length_smul] + exact Nat.le_trans (Poly.length_shift_le t.polynomial (a : Int)) hlen +theorem coeff_H_totalDeg_ne_zero (ts : List ExpTerm) (hnd : (ts.map ExpTerm.base).Nodup) (hg : ∀ t ∈ + ts, ValidExpTerm t) : + Poly.coeff (H ts) (totalDeg ts) ≠ 0 := by + unfold H totalDeg + rw [PolyDet.coeff_polyDet_totalDeg (rows ts) (degBounded_rows ts hg) (cols ts)] + unfold rows + rw [List.map_map] + rw [Determinant.det_congr_cols _ (ts.map (fun t a => lc t * t.base ^ a)) (cols ts)] + · rw [det_map_row_scale (fun t a => t.base ^ a) lc ts (cols ts)] + intro heq + rcases mul_eq_zero.mp heq with h1 | h2 + · apply listProd_ne_zero (ts.map lc) _ h1 + intro x hx + rcases List.mem_map.mp hx with ⟨t, ht, rfl⟩ + exact (hg t ht).2 + · have hv := Vandermonde.det_vandermonde_transpose_ne_zero (ts.map ExpTerm.base) hnd + simp only [List.map_map, List.length_map] at hv + exact hv h2 + · rw [List.forall₂_map_left_iff, List.forall₂_map_right_iff] + refine List.forall₂_same.mpr ?_ + intro t ht a _ + obtain ⟨hlen, _⟩ := hg t ht + simp only [Function.comp_apply, Poly.coeff_smul, Poly.coeff_shift_top _ _ _ hlen] + unfold lc; ring +theorem roots_length_le_totalDeg (ts : List ExpTerm) (roots : List Int) + (hnd : (ts.map ExpTerm.base).Nodup) + (hg : ∀ t ∈ ts, ValidExpTerm t) + (hr : roots.Nodup) + (hz : ∀ x ∈ roots, Poly.eval (H ts) x = 0) : + roots.length ≤ totalDeg ts := by + by_contra hgt + push Not at hgt + apply coeff_H_totalDeg_ne_zero ts hnd hg + have hp : ∀ a ∈ H ts, a = 0 := by + apply Poly.forall_zero_of_nodup_roots (H ts) roots hr hz + have hlen := PolyDet.length_polyDet_le (rows ts) (degBounded_rows ts hg) (cols ts) + unfold H totalDeg at * + omega + exact Poly.coeff_eq_zero_of_forall_zero (H ts) (totalDeg ts) hp +end ExpPoly +namespace GrowthBounds +theorem succ_pow_le_mul_pow (a b p c : Nat) (hb : 0 < b) (hba : b ≤ a) + (hbase : (b + 1) ^ p ≤ c * b ^ p) : + (a + 1) ^ p ≤ c * a ^ p := by + have h1 : b * (a + 1) ≤ (b + 1) * a := by nlinarith + have h2 : (b * (a + 1)) ^ p ≤ ((b + 1) * a) ^ p := Nat.pow_le_pow_left h1 p + rw [Nat.mul_pow, Nat.mul_pow] at h2 + have h3 : (b + 1) ^ p * a ^ p ≤ (c * b ^ p) * a ^ p := Nat.mul_le_mul_right (a ^ p) hbase + have h4 : b ^ p * (a + 1) ^ p ≤ b ^ p * (c * a ^ p) := by linarith + have hbp : 0 < b ^ p := by positivity + exact Nat.le_of_mul_le_mul_left h4 hbp +theorem two_pow_22_mul_pow_6_lt (m : Nat) (hm : 59 ≤ m) : 2 ^ 22 * m ^ 6 < 2 ^ (m - 1) := by + have h : ∀ i : Nat, 2 ^ 22 * (59 + i) ^ 6 < 2 ^ (58 + i) := by + intro i + induction i with + | zero => decide + | succ i ih => + have hr : (59 + i + 1) ^ 6 ≤ 2 * (59 + i) ^ 6 := + succ_pow_le_mul_pow (59 + i) 16 6 2 (by omega) (by omega) (by decide) + have hmul : 2 ^ 22 * (59 + (i + 1)) ^ 6 ≤ 2 * (2 ^ 22 * (59 + i) ^ 6) := by + have : 59 + (i + 1) = 59 + i + 1 := by omega + rw [this] + nlinarith + have hpow : 2 ^ (58 + (i + 1)) = 2 * 2 ^ (58 + i) := by + have : 58 + (i + 1) = (58 + i) + 1 := by omega + rw [this, Nat.pow_succ] + ring + omega + have hspec := h (m - 59) + have hm1 : 59 + (m - 59) = m := by omega + have hm2 : 58 + (m - 59) = m - 1 := by omega + rw [hm1, hm2] at hspec + exact hspec +theorem cube_sq_lt_of_two_pow_le (m n : Nat) (hm : 59 ≤ m) (hn : 2 ^ (m - 1) ≤ n) : + (2048 * m ^ 3) ^ 2 < n := by + have h1 := two_pow_22_mul_pow_6_lt m hm + have h2 : (2048 * m ^ 3) ^ 2 = 2 ^ 22 * m ^ 6 := by ring + omega +theorem archimedean_lt_padic_exp (m : Nat) (hm : 2 ≤ m) : + (2048 * m ^ 3) * (1664 * m ^ 3 + m) < + (2048 * m ^ 3) * (2048 * m ^ 3 - 1 - 2 * (256 * m ^ 2)) := by + have hpos : 0 < 2048 * m ^ 3 := by positivity + apply Nat.mul_lt_mul_of_pos_left _ hpos + obtain ⟨k, rfl⟩ : ∃ k, m = k + 2 := ⟨m - 2, by omega⟩ + have h1 : 1664 * (k + 2) ^ 3 + (k + 2) + 1 + 2 * (256 * (k + 2) ^ 2) < 2048 * (k + 2) ^ 3 := by + nlinarith + omega +end GrowthBounds +namespace SmallModuli +def F (n : Nat) : Int := 2 * (3 : Int) ^ n + (n : Int) + 5 +theorem two_pow_pos (a : Nat) : (0 : Int) < (2 : Int) ^ a := by positivity +theorem dvd_sub_iff_emod_eq (m x y : Int) (_hm : 0 < m) : (m ∣ (x - y)) <-> x % m = y % m := by + constructor + · rintro ⟨q, hq⟩ + have hx : x = y + m * q := by linarith + rw [hx, Int.add_mul_emod_self_left] + · intro h + refine ⟨x / m - y / m, ?_⟩ + have h1 := Int.mul_ediv_add_emod x m + have h2 := Int.mul_ediv_add_emod y m + linarith +theorem pow_dvd_pow_of_le (a b : Nat) (h : a ≤ b) : ((2 : Int) ^ a) ∣ ((2 : Int) ^ b) := by + refine ⟨(2 : Int) ^ (b - a), ?_⟩ + have hb : b = a + (b - a) := (Nat.add_sub_of_le h).symm + conv_lhs => rw [hb] + rw [pow_add] +theorem three_pow_two_pow_lift (a : Nat) : ∃ t : Int, (3 : Int) ^ (2 ^ a) = 1 + (2 : Int) ^ (a + 1) + * t := by + induction a with + | zero => exact ⟨1, by decide⟩ + | succ a ih => + rcases ih with ⟨t, ht⟩ + refine ⟨t + (2 : Int) ^ a * t * t, ?_⟩ + have hpow : 2 ^ (a + 1) = 2 ^ a * 2 := by rw [Nat.pow_succ] + rw [hpow, pow_mul, ht] + have h2 : (2 : Int) ^ (a + 1 + 1) = (2 : Int) ^ (a + 1) * 2 := by rw [pow_succ] + have h3 : (2 : Int) ^ (a + 1) = (2 : Int) ^ a * 2 := by rw [pow_succ] + rw [h2, h3] + ring +theorem sub_one_dvd_pow_sub_one (A : Int) (w : Nat) : (A - 1) ∣ (A ^ w - 1) := by + induction w with + | zero => exact ⟨0, by ring⟩ + | succ w ih => + rcases ih with ⟨k, hk⟩ + refine ⟨A * k + 1, ?_⟩ + calc A ^ (w + 1) - 1 + = A * (A ^ w - 1) + (A - 1) := by ring + _ = A * ((A - 1) * k) + (A - 1) := by rw [hk] + _ = (A - 1) * (A * k + 1) := by ring +theorem two_pow_succ_dvd_three_pow_sub_le (a x y : Nat) (hxy : y ≤ x) + (hdvd : ((2 : Int) ^ a) ∣ ((x : Int) - (y : Int))) : + ((2 : Int) ^ (a + 1)) ∣ ((3 : Int) ^ x - (3 : Int) ^ y) := by + have hdvd_nat : 2 ^ a ∣ (x - y) := by + have h1 : ((x - y : Nat) : Int) = (x : Int) - (y : Int) := Int.ofNat_sub hxy + rw [<- h1] at hdvd + exact Int.ofNat_dvd.mp hdvd + rcases hdvd_nat with ⟨w, hw⟩ + have hx : x = y + 2 ^ a * w := by omega + rcases three_pow_two_pow_lift a with ⟨t, ht⟩ + have hd1 : ((2 : Int) ^ (a + 1)) ∣ ((3 : Int) ^ (2 ^ a) - 1) := ⟨t, by linarith⟩ + have hd2 : ((3 : Int) ^ (2 ^ a) - 1) ∣ (((3 : Int) ^ (2 ^ a)) ^ w - 1) := + sub_one_dvd_pow_sub_one ((3 : Int) ^ (2 ^ a)) w + have hd3 : ((2 : Int) ^ (a + 1)) ∣ (((3 : Int) ^ (2 ^ a)) ^ w - 1) := dvd_trans hd1 hd2 + rcases hd3 with ⟨u, hu⟩ + refine ⟨(3 : Int) ^ y * u, ?_⟩ + calc (3 : Int) ^ x - (3 : Int) ^ y + = (3 : Int) ^ (y + 2 ^ a * w) - (3 : Int) ^ y := by rw [hx] + _ = (3 : Int) ^ y * (((3 : Int) ^ (2 ^ a)) ^ w - 1) := by rw [pow_add, pow_mul]; ring + _ = (3 : Int) ^ y * ((2 : Int) ^ (a + 1) * u) := by rw [hu] + _ = (2 : Int) ^ (a + 1) * ((3 : Int) ^ y * u) := by ring +theorem two_pow_succ_dvd_three_pow_sub (a x y : Nat) + (hdvd : ((2 : Int) ^ a) ∣ ((x : Int) - (y : Int))) : + ((2 : Int) ^ (a + 1)) ∣ ((3 : Int) ^ x - (3 : Int) ^ y) := by + by_cases hxy : y ≤ x + · exact two_pow_succ_dvd_three_pow_sub_le a x y hxy hdvd + · push Not at hxy + have hdvd' : ((2 : Int) ^ a) ∣ ((y : Int) - (x : Int)) := by + rcases hdvd with ⟨w, hw⟩ + exact ⟨-w, by linarith⟩ + rcases two_pow_succ_dvd_three_pow_sub_le a y x (by omega) hdvd' with ⟨v, hv⟩ + exact ⟨-v, by linarith⟩ +theorem two_pow_dvd_sub_of_dvd_F_sub (a x y : Nat) + (h : ((2 : Int) ^ a) ∣ (F x - F y)) : + ((2 : Int) ^ a) ∣ ((x : Int) - (y : Int)) := by + induction a with + | zero => exact ⟨(x : Int) - (y : Int), by ring⟩ + | succ a ih => + have hlow : ((2 : Int) ^ a) ∣ (F x - F y) := by + rcases h with ⟨w, hw⟩ + exact ⟨2 * w, by rw [pow_succ] at hw; linarith⟩ + rcases two_pow_succ_dvd_three_pow_sub a x y (ih hlow) with ⟨v, hv⟩ + rcases h with ⟨w, hw⟩ + refine ⟨w - 2 * v, ?_⟩ + have hp2 : (2 : Int) ^ (a + 1) = (2 : Int) ^ a * 2 := by rw [pow_succ] + unfold F at hw + linarith +def powMod : Nat -> Nat -> Nat -> Nat -> Nat + | 0, _, _, m => 1 % m + | k + 1, b, e, m => + if e = 0 then 1 % m + else + if e % 2 = 0 then ((powMod k b (e / 2) m) * (powMod k b (e / 2) m)) % m + else (b * (((powMod k b (e / 2) m) * (powMod k b (e / 2) m)) % m)) % m +theorem powMod_eq_pow_mod (k b e m : Nat) (he : e < 2 ^ k) : + powMod k b e m = (b ^ e) % m := by + induction k generalizing e with + | zero => + have he0 : e = 0 := by omega + subst he0 + simp [powMod] + | succ k ih => + unfold powMod + split_ifs with he0 hmod + · subst he0; simp + · have he2 : e / 2 < 2 ^ k := by rw [Nat.pow_succ] at he; omega + rw [ih (e / 2) he2, <- Nat.mul_mod] + have he_eq : e = (e / 2) + (e / 2) := by omega + conv_rhs => rw [he_eq, Nat.pow_add] + · have he2 : e / 2 < 2 ^ k := by rw [Nat.pow_succ] at he; omega + rw [ih (e / 2) he2, <- Nat.mul_mod, Nat.mul_mod b, Nat.mod_mod, <- Nat.mul_mod] + have he_eq : e = 1 + ((e / 2) + (e / 2)) := by omega + conv_rhs => rw [he_eq, Nat.pow_add, Nat.pow_one, Nat.pow_add] +theorem two_pow_dvd_F_of_powMod (r q a k : Nat) + (he : r < 2 ^ k) + (hpow : powMod k 3 r (2 ^ a) = q) + (hroot : 2 * q + r + 5 = 2 * 2 ^ a) : + ((2 : Int) ^ a) ∣ F r := by + have h1 : (3 ^ r) % (2 ^ a) = q := by + rw [<- powMod_eq_pow_mod k 3 r (2 ^ a) he] + exact hpow + have h2 : (2 * 3 ^ r + r + 5) % (2 ^ a) = 0 := by + have hdiv := Nat.div_add_mod (3 ^ r) (2 ^ a) + have h3 : 2 * 3 ^ r + r + 5 = 2 ^ a * (2 * (3 ^ r / 2 ^ a) + 2) := by linarith + rw [h3, Nat.mul_mod_right] + have hdvd : 2 ^ a ∣ (2 * 3 ^ r + r + 5) := Nat.dvd_of_mod_eq_zero h2 + have hF : F r = ((2 * 3 ^ r + r + 5 : Nat) : Int) := by + unfold F; push_cast; ring + rw [hF] + exact Int.ofNat_dvd.mpr hdvd +theorem two_pow_8_dvd_F_149 : ((2 : Int) ^ 8) ∣ F 149 := + two_pow_dvd_F_of_powMod 149 179 8 8 (by decide) (by decide) (by decide) +set_option maxRecDepth 200000 in +theorem two_pow_64_dvd_F_root : ((2 : Int) ^ 64) ∣ F 767351889479380629 := + two_pow_dvd_F_of_powMod 767351889479380629 18063068128969861299 64 60 (by decide) (by decide) (by + decide) +theorem mod_two_pow_eq_of_dvd_F (a n r : Nat) (hroot : ((2 : Int) ^ a) ∣ F r) + (hn : ((2 : Int) ^ a) ∣ F n) : + n % (2 ^ a) = r % (2 ^ a) := by + have hsub : ((2 : Int) ^ a) ∣ (F n - F r) := Int.dvd_sub hn hroot + have hinj : ((2 : Int) ^ a) ∣ ((n : Int) - (r : Int)) := two_pow_dvd_sub_of_dvd_F_sub a n r hsub + have hmod := (dvd_sub_iff_emod_eq ((2 : Int) ^ a) (n : Int) (r : Int) (two_pow_pos a)).mp hinj + exact_mod_cast hmod +theorem not_two_pow_succ_dvd_F_small (n : Nat) (hn1 : 7 ≤ n) (hn2 : n < 2 ^ 58) : + ¬ (((2 : Int) ^ (n + 1)) ∣ F n) := by + intro hbad + by_cases hsmall : n < 64 + · have h8 : ((2 : Int) ^ 8) ∣ F n := + dvd_trans (pow_dvd_pow_of_le 8 (n + 1) (by omega)) hbad + have hu := mod_two_pow_eq_of_dvd_F 8 n 149 two_pow_8_dvd_F_149 h8 + have h1 : n % (2 ^ 8) = n := Nat.mod_eq_of_lt (by omega) + have h2 : 149 % (2 ^ 8) = 149 := by decide + omega + · have h64 : ((2 : Int) ^ 64) ∣ F n := + dvd_trans (pow_dvd_pow_of_le 64 (n + 1) (by omega)) hbad + have hu := mod_two_pow_eq_of_dvd_F 64 n 767351889479380629 two_pow_64_dvd_F_root h64 + have hcut1 : 2 ^ 58 < 767351889479380629 := by decide + have hcut2 : 767351889479380629 < 2 ^ 64 := by decide + have h1 : n % (2 ^ 64) = n := Nat.mod_eq_of_lt (by omega) + have h2 : 767351889479380629 % (2 ^ 64) = 767351889479380629 := Nat.mod_eq_of_lt hcut2 + omega +def large_exclusion : Prop := + ∀ n u : Nat, 2 ^ 58 ≤ n -> 1 ≤ u /\ u ≤ n -> ¬ (((2 : Int) ^ n) ∣ ((-3 : Int) ^ n - (u : Int))) +theorem not_two_pow_succ_dvd_F (hlarge : large_exclusion) (n : Nat) (hn : 7 ≤ n) : + ¬ (((2 : Int) ^ (n + 1)) ∣ F n) := by + intro hbad + by_cases hsmall : n < 2 ^ 58 + · exact not_two_pow_succ_dvd_F_small n hn hsmall hbad + · push Not at hsmall + have htwo : (2 : Int) ∣ F n := by + have h1 : ((2 : Int) ^ 1) ∣ F n := dvd_trans (pow_dvd_pow_of_le 1 (n + 1) (by omega)) hbad + simpa using h1 + rcases htwo with ⟨w, hw⟩ + have hodd : n % 2 = 1 := by + have h3 : (2 * (3 : Int) ^ n + (n : Int) + 5) % 2 = 0 := by + unfold F at hw + omega + omega + have hhalf : 2 * ((n + 5) / 2) = n + 5 := by omega + apply hlarge n ((n + 5) / 2) hsmall ⟨by omega, by omega⟩ + have hopp : (-3 : Int) ^ n = -((3 : Int) ^ n) := by + obtain ⟨k, hk⟩ : ∃ k, n = 2 * k + 1 := ⟨n / 2, by omega⟩ + have hsq : (-3 : Int) ^ (2 * k) = (3 : Int) ^ (2 * k) := by + rw [pow_mul, pow_mul] + have : (-3 : Int) ^ 2 = (3 : Int) ^ 2 := by decide + rw [this] + rw [hk, pow_add, pow_one, hsq, pow_add, pow_one] + ring + rw [hopp] + rcases hbad with ⟨q, hq⟩ + refine ⟨-q, ?_⟩ + have h2 : (2 : Int) ^ (n + 1) = 2 * (2 : Int) ^ n := by rw [pow_succ]; ring + unfold F at hq + rw [h2] at hq + have hhalf_int : 2 * (((n + 5) / 2 : Nat) : Int) = (n : Int) + 5 := by exact_mod_cast hhalf + linarith +end SmallModuli +namespace GridPoints +open Poly +def trimPoly : List Int -> List Int + | [] => [] + | a :: p => + match trimPoly p with + | [] => if a = 0 then [] else [a] + | q => a :: q +theorem trimPoly_spec (p : List Int) : + (trimPoly p).length ≤ p.length /\ + (∀ x, Poly.eval (trimPoly p) x = Poly.eval p x) /\ + (trimPoly p = [] \/ coeff (trimPoly p) ((trimPoly p).length - 1) ≠ 0) := by + induction p with + | nil => + simp [trimPoly, Poly.eval] + | cons a p ih => + rcases ih with ⟨hlen, he, hlc⟩ + simp only [trimPoly] + cases hp : trimPoly p with + | nil => + by_cases ha : a = 0 + · refine ⟨by simp [ha], ?_, Or.inl (by simp [ha])⟩ + intro x + have hpx := he x + rw [hp] at hpx + simp [Poly.eval, ha, <- hpx] + · refine ⟨by simp [ha], ?_, Or.inr (by simp [coeff, ha])⟩ + intro x + have hpx := he x + rw [hp] at hpx + simp [Poly.eval, ha, <- hpx] + | cons b q => + rw [hp] at hlen hlc + simp only [List.length_cons] at hlen ⊢ + refine ⟨by omega, ?_, Or.inr ?_⟩ + · intro x + have hpx := he x + rw [hp] at hpx + change a + x * Poly.eval (b :: q) x = a + x * Poly.eval p x + rw [hpx] + · rcases hlc with hnil | hlc + · nomatch hnil + · simpa [coeff] using hlc +theorem forall_zero_of_trimPoly_nil (p : List Int) (h : trimPoly p = []) : ∀ a ∈ p, a = 0 := by + induction p with + | nil => intro a ha; nomatch ha + | cons a p ih => + simp only [trimPoly] at h + cases hp : trimPoly p with + | nil => + rw [hp] at h + by_cases ha : a = 0 + · intro x hx + rcases List.mem_cons.mp hx with rfl | hx + · exact ha + · exact ih hp x hx + · simp [ha] at h + | cons b q => + rw [hp] at h + nomatch h +def gridX (n : Nat) (rs : Nat × Nat) : Int := + (rs.1 : Int) + (n : Int) * (rs.2 : Int) +def gridRect (R : Nat) : Nat -> List (Nat × Nat) + | 0 => [] + | s + 1 => gridRect R s ++ (List.range R).map (fun r => (r, s)) +theorem length_gridRect (R S : Nat) : (gridRect R S).length = R * S := by + induction S with + | zero => simp [gridRect] + | succ s ih => + simp [gridRect, ih, Nat.mul_succ] +theorem mem_gridRect_iff (R S r s : Nat) : (r, s) ∈ gridRect R S <-> r < R /\ s < S := by + induction S with + | zero => simp [gridRect] + | succ S ih => + simp only [gridRect, List.mem_append, ih, List.mem_map, List.mem_range, Prod.mk.injEq] + constructor + · rintro (⟨hr, hs⟩ | ⟨r', hr', rfl, rfl⟩) + · exact ⟨hr, by omega⟩ + · exact ⟨hr', by omega⟩ + · rintro ⟨hr, hs⟩ + by_cases h : s = S + · subst h + exact Or.inr ⟨r, hr, rfl, rfl⟩ + · exact Or.inl ⟨hr, by omega⟩ +theorem nodup_map_of_injOn {A B : Type} (f : A -> B) (xs : List A) (hnd : xs.Nodup) + (hinj : ∀ x ∈ xs, ∀ y ∈ xs, f x = f y -> x = y) : (xs.map f).Nodup := by + induction xs with + | nil => simp + | cons x xs ih => + rcases List.nodup_cons.mp hnd with ⟨hnot, hnd'⟩ + rw [List.map_cons, List.nodup_cons] + refine ⟨?_, ih hnd' (fun u hu v hv h => hinj u (List.mem_cons_of_mem _ hu) v + (List.mem_cons_of_mem _ hv) h)⟩ + intro hmem + rcases List.mem_map.mp hmem with ⟨y, hy, hfy⟩ + have hyx : y = x := hinj y (List.mem_cons_of_mem _ hy) x List.mem_cons_self hfy + subst hyx + exact hnot hy +theorem nodup_append_of_disjoint {A : Type} (xs ys : List A) (hx : xs.Nodup) (hy : ys.Nodup) + (hdis : ∀ x ∈ xs, x ∉ ys) : (xs ++ ys).Nodup := by + induction xs with + | nil => exact hy + | cons x xs ih => + rcases List.nodup_cons.mp hx with ⟨hnot, hx'⟩ + rw [List.cons_append, List.nodup_cons] + refine ⟨?_, ih hx' (fun y hy' => hdis y (List.mem_cons_of_mem _ hy'))⟩ + rw [List.mem_append] + rintro (h1 | h2) + · exact hnot h1 + · exact hdis x List.mem_cons_self h2 +theorem gridX_inj (n R r s r' s' : Nat) (hn : R ≤ n) (hr : r < R) (hr' : r' < R) + (he : gridX n (r, s) = gridX n (r', s')) : r = r' /\ s = s' := by + unfold gridX at he + dsimp -failIfUnchanged at he + have hss : s = s' := by + rcases lt_trichotomy s s' with hlt | rfl | hgt + · exfalso + have h1 : (s + 1 : Int) ≤ (s' : Int) := by omega + have h2 : (n : Int) * (s + 1 : Int) ≤ (n : Int) * (s' : Int) := + mul_le_mul_of_nonneg_left h1 (by positivity) + nlinarith + · rfl + · exfalso + have h1 : (s' + 1 : Int) ≤ (s : Int) := by omega + have h2 : (n : Int) * (s' + 1 : Int) ≤ (n : Int) * (s : Int) := + mul_le_mul_of_nonneg_left h1 (by positivity) + nlinarith + subst hss + exact ⟨by omega, rfl⟩ +theorem nodup_map_gridX (n R S : Nat) (hn : R ≤ n) : ((gridRect R S).map (gridX n)).Nodup := by + induction S with + | zero => simp [gridRect] + | succ S ih => + simp only [gridRect, List.map_append, List.map_map] + apply nodup_append_of_disjoint _ _ ih + · apply nodup_map_of_injOn _ _ List.nodup_range + intro r hr r' hr' he + simp only [Function.comp_apply, gridX] at he + omega + · intro x hx hy + rcases List.mem_map.mp hx with ⟨⟨r, s⟩, hrs, rfl⟩ + rcases List.mem_map.mp hy with ⟨r', hr', he⟩ + simp only [Function.comp_apply] at he + rw [mem_gridRect_iff] at hrs + rw [List.mem_range] at hr' + have ⟨_, hss⟩ := gridX_inj n R r s r' S hn hrs.1 hr' he.symm + omega +end GridPoints +namespace LaurentPoly +open Poly GridPoints +abbrev LaurentTerm := Nat × List Int +def negThreePow (l : Nat) : Int := (-3 : Int) ^ l +def evalLaurent : List LaurentTerm -> Int -> Int -> Int + | [], _, _ => 0 + | (l, p) :: ts, x, y => Poly.eval p x * y ^ l + evalLaurent ts x y +def trimLaurent : List LaurentTerm -> List LaurentTerm + | [] => [] + | (l, p) :: ts => + match trimPoly p with + | [] => trimLaurent ts + | q => (l, q) :: trimLaurent ts +def toExpTerm (t : LaurentTerm) : ExpPoly.ExpTerm := + ⟨negThreePow t.1, t.2.length - 1, t.2⟩ +theorem evalLaurent_trimLaurent (ts : List LaurentTerm) (x y : Int) : evalLaurent (trimLaurent ts) x + y = evalLaurent ts x y := by + induction ts with + | nil => rfl + | cons t ts ih => + rcases t with ⟨l, p⟩ + rcases trimPoly_spec p with ⟨_, he, _⟩ + simp only [trimLaurent] + cases hp : trimPoly p with + | nil => + simp only [evalLaurent, ih] + have hpx := he x + rw [hp] at hpx + simp [Poly.eval, <- hpx] + | cons a q => + simp only [evalLaurent, ih] + have hpx := he x + rw [hp] at hpx + rw [hpx] +theorem length_trimLaurent_le (ts : List LaurentTerm) : (trimLaurent ts).length ≤ ts.length := by + induction ts with + | nil => rfl + | cons t ts ih => + rcases t with ⟨l, p⟩ + simp only [trimLaurent] + cases trimPoly p <;> simp <;> omega +theorem forall_zero_of_trimLaurent_nil (ts : List LaurentTerm) (h : trimLaurent ts = []) : + ∀ t ∈ ts, ∀ a ∈ t.2, a = 0 := by + induction ts with + | nil => intro t ht; nomatch ht + | cons t ts ih => + rcases t with ⟨l, p⟩ + simp only [trimLaurent] at h + cases hp : trimPoly p with + | nil => + rw [hp] at h + intro u hu + rcases List.mem_cons.mp hu with rfl | hu + · exact forall_zero_of_trimPoly_nil p hp + · exact ih h u hu + | cons a q => + rw [hp] at h + nomatch h +theorem mem_trimLaurent_iff (ts : List LaurentTerm) (l : Nat) (p : List Int) (h : (l, p) ∈ + trimLaurent ts) : + ∃ q, (l, q) ∈ ts /\ p = trimPoly q /\ p ≠ [] := by + induction ts with + | nil => nomatch h + | cons t ts ih => + rcases t with ⟨a, q⟩ + simp only [trimLaurent] at h + cases hq : trimPoly q with + | nil => + rw [hq] at h + rcases ih h with ⟨p', hi, hp⟩ + exact ⟨p', List.mem_cons_of_mem _ hi, hp⟩ + | cons b qs => + rw [hq] at h + rcases List.mem_cons.mp h with heq | hi + · injection heq with hl hp + subst hl hp + exact ⟨q, List.mem_cons_self, hq.symm, by simp⟩ + · rcases ih hi with ⟨p', hj, hp⟩ + exact ⟨p', List.mem_cons_of_mem _ hj, hp⟩ +theorem validExpTerm_of_mem_trimLaurent (ts : List LaurentTerm) : ∀ t ∈ (trimLaurent ts).map + toExpTerm, ExpPoly.ValidExpTerm t := by + intro t ht + rcases List.mem_map.mp ht with ⟨⟨l, p⟩, hp, rfl⟩ + rcases mem_trimLaurent_iff ts l p hp with ⟨q, _, rfl, hne⟩ + rcases trimPoly_spec q with ⟨_, _, hlc⟩ + unfold ExpPoly.ValidExpTerm ExpPoly.lc toExpTerm + dsimp -failIfUnchanged + refine ⟨by omega, ?_⟩ + rcases hlc with hnil | hlc + · exact absurd hnil hne + · exact hlc +theorem length_le_of_mem_trimLaurent (ts : List LaurentTerm) (K : Nat) (h : ∀ t ∈ ts, t.2.length ≤ + K) : + ∀ t ∈ trimLaurent ts, t.2.length ≤ K := by + rintro ⟨l, p⟩ hp + rcases mem_trimLaurent_iff ts l p hp with ⟨q, hq, rfl, _⟩ + have h1 := h (l, q) hq + have h2 := (trimPoly_spec q).1 + dsimp -failIfUnchanged at h1 ⊢ + omega +theorem fst_mem_of_mem_trimLaurent (ts : List LaurentTerm) : + ∀ l ∈ (trimLaurent ts).map Prod.fst, l ∈ ts.map Prod.fst := by + intro l hl + rcases List.mem_map.mp hl with ⟨⟨l', p⟩, hp, rfl⟩ + rcases mem_trimLaurent_iff ts l' p hp with ⟨q, hq, _⟩ + exact List.mem_map.mpr ⟨(l', q), hq, rfl⟩ +theorem nodup_fst_trimLaurent (ts : List LaurentTerm) (h : (ts.map Prod.fst).Nodup) : + ((trimLaurent ts).map Prod.fst).Nodup := by + induction ts with + | nil => simp [trimLaurent] + | cons t ts ih => + rcases t with ⟨l, p⟩ + rw [List.map_cons, List.nodup_cons] at h + rcases h with ⟨hnot, hnd⟩ + simp only [trimLaurent] + cases trimPoly p with + | nil => exact ih hnd + | cons a q => + rw [List.map_cons, List.nodup_cons] + refine ⟨fun hi => hnot (fst_mem_of_mem_trimLaurent ts l hi), ih hnd⟩ +theorem negThreePow_inj (l k : Nat) (he : negThreePow l = negThreePow k) : l = k := by + unfold negThreePow at he + have habs : ((-3 : Int) ^ l).natAbs = ((-3 : Int) ^ k).natAbs := congrArg Int.natAbs he + rw [Int.natAbs_pow, Int.natAbs_pow] at habs + change 3 ^ l = 3 ^ k at habs + rcases lt_trichotomy l k with h | rfl | h + · exfalso + have := Nat.pow_lt_pow_right (by decide : 1 < 3) h + omega + · rfl + · exfalso + have := Nat.pow_lt_pow_right (by decide : 1 < 3) h + omega +theorem nodup_base_map_toExpTerm (ts : List LaurentTerm) (h : (ts.map Prod.fst).Nodup) : + ((ts.map toExpTerm).map ExpPoly.ExpTerm.base).Nodup := by + have hmap : (ts.map toExpTerm).map ExpPoly.ExpTerm.base = (ts.map Prod.fst).map negThreePow := by + induction ts <;> simp [toExpTerm, *] + rw [hmap] + exact nodup_map_of_injOn negThreePow (ts.map Prod.fst) h (fun x _ y _ he => negThreePow_inj x y + he) +theorem totalDeg_map_toExpTerm_le (ts : List LaurentTerm) (K : Nat) (h : ∀ t ∈ ts, t.2.length ≤ K) : + ExpPoly.totalDeg (ts.map toExpTerm) ≤ (K - 1) * ts.length := by + induction ts with + | nil => simp [ExpPoly.totalDeg, ExpPoly.rows, PolyDet.totalDeg] + | cons t ts ih => + rcases t with ⟨l, p⟩ + have hp : p.length ≤ K := h (l, p) List.mem_cons_self + have hts : ∀ u ∈ ts, u.2.length ≤ K := fun u hu => h u (List.mem_cons_of_mem _ hu) + have ih' := ih hts + unfold ExpPoly.totalDeg ExpPoly.rows at ih' ⊢ + simp only [List.map_cons, PolyDet.totalDeg, toExpTerm, List.length_cons] + rw [Nat.mul_succ] + omega +def gridY (u : Int) (rs : Nat × Nat) : Int := + (-3 : Int) ^ rs.1 * u ^ rs.2 +def laurentRowFns (ts : List LaurentTerm) (x : Int) : List (Nat -> Int) := + ts.map (fun t a => (negThreePow t.1) ^ a * Poly.eval t.2 (x + (a : Int))) +def laurentWeights (ts : List LaurentTerm) (y : Int) : List Int := + ts.map (fun t => y ^ t.1) +theorem gridY_ne_zero (u : Int) (rs : Nat × Nat) (hu : u ≠ 0) : gridY u rs ≠ 0 := by + unfold gridY + exact mul_ne_zero (pow_ne_zero _ (by decide)) (pow_ne_zero _ hu) +theorem negThreePow_pow_comm (l a : Nat) : (negThreePow l) ^ a = ((-3 : Int) ^ a) ^ l := by + unfold negThreePow + rw [<- pow_mul, <- pow_mul, Nat.mul_comm] +theorem linComb_laurentRowFns (ts : List LaurentTerm) (x y : Int) (a : Nat) : + GaussianElim.linComb (laurentRowFns ts x) (laurentWeights ts y) a = + evalLaurent ts (x + (a : Int)) ((-3 : Int) ^ a * y) := by + induction ts with + | nil => rfl + | cons t ts ih => + rcases t with ⟨l, p⟩ + unfold laurentRowFns laurentWeights + rw [List.map_cons, List.map_cons] + simp only [GaussianElim.linComb, evalLaurent] + change y ^ l * (negThreePow l ^ a * Poly.eval p (x + ↑a)) + + GaussianElim.linComb (laurentRowFns ts x) (laurentWeights ts y) a = _ + rw [ih, mul_pow, negThreePow_pow_comm] + ring +theorem eval_H_eq_det_laurentRowFns (ts : List LaurentTerm) (x : Int) : + Poly.eval (ExpPoly.H (ts.map toExpTerm)) x = + Determinant.det (laurentRowFns ts x) (List.range ts.length) := by + unfold ExpPoly.H ExpPoly.cols + rw [List.length_map, PolyDet.eval_polyDet] + unfold ExpPoly.rows laurentRowFns + rw [List.map_map, List.map_map] + generalize List.range ts.length = cs + apply Determinant.det_congr_cols + induction ts with + | nil => exact List.Forall₂.nil + | cons t ts ih => + rcases t with ⟨l, p⟩ + refine List.Forall₂.cons ?_ ih + intro a _ + simp [toExpTerm, eval_smul, eval_shift] +theorem eval_H_eq_zero_of_evalLaurent_zero (ts : List LaurentTerm) (x y : Int) (hts : ts ≠ []) (hy : + y ≠ 0) + (hrel : ∀ a, a < ts.length -> evalLaurent ts (x + (a : Int)) ((-3 : Int) ^ a * y) = 0) : + Poly.eval (ExpPoly.H (ts.map toExpTerm)) x = 0 := by + rw [eval_H_eq_det_laurentRowFns] + cases ts with + | nil => contradiction + | cons t ts => + rcases t with ⟨l, p⟩ + unfold laurentRowFns + rw [List.map_cons] + apply GaussianElim.det_cons_eq_zero_of_linComb_eq_zero _ _ (y ^ l) (laurentWeights ts y) + · exact pow_ne_zero _ hy + · intro a ha + change GaussianElim.linComb (laurentRowFns ((l, p) :: ts) x) (laurentWeights ((l, p) :: ts) y) + a = 0 + rw [linComb_laurentRowFns] + apply hrel + exact List.mem_range.mp ha +theorem gridX_shift_fst (n r s a : Nat) : gridX n (r + a, s) = gridX n (r, s) + (a : Int) := by + unfold gridX + dsimp -failIfUnchanged + omega +theorem gridY_shift_fst (u : Int) (r s a : Nat) : + gridY u (r + a, s) = (-3 : Int) ^ a * gridY u (r, s) := by + unfold gridY + dsimp -failIfUnchanged + rw [pow_add] + ring +theorem forall_zero_of_evalLaurent_grid_zero (K L n : Nat) (u : Int) (R0 S : Nat) (ts : List + LaurentTerm) + (hn : R0 ≤ n) (hsize : (K - 1) * L < R0 * S) (hlength : ts.length ≤ L) (hu : u ≠ 0) + (hnd : (ts.map Prod.fst).Nodup) (hbound : ∀ t ∈ ts, t.2.length ≤ K) + (hz : ∀ r s, r < R0 + L - 1 -> s < S -> evalLaurent ts (gridX n (r, s)) (gridY u (r, s)) = 0) : + ∀ t ∈ ts, ∀ a ∈ t.2, a = 0 := by + cases hprep : trimLaurent ts with + | nil => exact forall_zero_of_trimLaurent_nil ts hprep + | cons t pts => + exfalso + have hne : trimLaurent ts ≠ [] := by rw [hprep]; simp + have hroots : ∀ x ∈ (gridRect R0 S).map (gridX n), + Poly.eval (ExpPoly.H ((trimLaurent ts).map toExpTerm)) x = 0 := by + intro x hx + rcases List.mem_map.mp hx with ⟨⟨r, s⟩, hrs, rfl⟩ + rw [mem_gridRect_iff] at hrs + apply eval_H_eq_zero_of_evalLaurent_zero _ _ (gridY u (r, s)) hne (gridY_ne_zero u (r, s) hu) + intro a ha + rw [<- gridX_shift_fst, <- gridY_shift_fst, evalLaurent_trimLaurent] + have hplen := length_trimLaurent_le ts + exact hz (r + a) s (by omega) hrs.2 + have hcount := ExpPoly.roots_length_le_totalDeg ((trimLaurent ts).map toExpTerm) ((gridRect R0 + S).map (gridX n)) + (nodup_base_map_toExpTerm _ (nodup_fst_trimLaurent ts hnd)) (validExpTerm_of_mem_trimLaurent + ts) + (nodup_map_gridX n R0 S hn) hroots + have hdegree := totalDeg_map_toExpTerm_le (trimLaurent ts) K (length_le_of_mem_trimLaurent ts K + hbound) + have hplen := length_trimLaurent_le ts + rw [List.length_map, length_gridRect] at hcount + have hmul : (K - 1) * (trimLaurent ts).length ≤ (K - 1) * L := + Nat.mul_le_mul_left (K - 1) (Nat.le_trans hplen hlength) + omega +end LaurentPoly +namespace LaurentInterp +open Poly GaussianElim GridPoints LaurentPoly +def monomialGrid (K : Nat) : Nat -> Nat -> List (Nat × Nat) + | _, 0 => [] + | a, len + 1 => (List.range K).map (fun k => (k, a)) ++ monomialGrid K (a + 1) len +def entry (n : Nat) (u : Int) (kl rs : Nat × Nat) : Int := + (gridX n rs) ^ kl.1 * (gridY u rs) ^ kl.2 +def unflattenLaurent (K : Nat) : Nat -> Nat -> List Int -> List LaurentTerm + | _, 0, _ => [] + | a, len + 1, ws => (a, ws.take K) :: unflattenLaurent K (a + 1) len (ws.drop K) +theorem length_monomialGrid (K a L : Nat) : (monomialGrid K a L).length = K * L := by + induction L generalizing a with + | zero => simp [monomialGrid] + | succ L ih => + simp [monomialGrid, ih (a + 1), Nat.mul_succ, Nat.add_comm] +theorem mem_monomialGrid_iff (K L a k l : Nat) : + (k, l) ∈ monomialGrid K a L <-> k < K /\ a ≤ l /\ l < a + L := by + induction L generalizing a with + | zero => simp [monomialGrid] + | succ L ih => + simp only [monomialGrid, List.mem_append, List.mem_map, List.mem_range, Prod.mk.injEq, ih (a + + 1)] + constructor + · rintro (⟨k', hk', rfl, rfl⟩ | ⟨hk, hl1, hl2⟩) + · exact ⟨hk', by omega, by omega⟩ + · exact ⟨hk, by omega, by omega⟩ + · rintro ⟨hk, hl1, hl2⟩ + by_cases h : l = a + · subst h + exact Or.inl ⟨k, hk, rfl, rfl⟩ + · exact Or.inr ⟨hk, by omega, by omega⟩ +theorem map_fst_unflattenLaurent (K a L : Nat) (ws : List Int) : + (unflattenLaurent K a L ws).map Prod.fst = List.range' a L := by + induction L generalizing a ws with + | zero => rfl + | succ L ih => + simp [unflattenLaurent, List.range', ih (a + 1) (ws.drop K)] +theorem length_unflattenLaurent (K a L : Nat) (ws : List Int) : (unflattenLaurent K a L ws).length = + L := by + have h := congrArg List.length (map_fst_unflattenLaurent K a L ws) + simpa using h +theorem length_snd_unflattenLaurent_le (K a L : Nat) (ws : List Int) : + ∀ t ∈ unflattenLaurent K a L ws, t.2.length ≤ K := by + induction L generalizing a ws with + | zero => intro t ht; nomatch ht + | succ L ih => + intro t ht + rcases List.mem_cons.mp ht with rfl | ht + · simp [List.length_take] + · exact ih (a + 1) (ws.drop K) t ht +theorem forall_zero_of_unflattenLaurent_zero (K a L : Nat) (ws : List Int) (hlen : ws.length = K * + L) + (hz : ∀ t ∈ unflattenLaurent K a L ws, ∀ x ∈ t.2, x = 0) : + ∀ x ∈ ws, x = 0 := by + induction L generalizing a ws with + | zero => + cases ws with + | nil => intro x hx; nomatch hx + | cons _ _ => nomatch hlen + | succ L ih => + rw [<- List.take_append_drop K ws] + intro x hx + rcases List.mem_append.mp hx with htake | hdrop + · exact hz (a, ws.take K) List.mem_cons_self x htake + · apply ih (a + 1) (ws.drop K) + · rw [List.length_drop, hlen, Nat.mul_succ] + omega + · intro t ht + exact hz t (List.mem_cons_of_mem _ ht) + · exact hdrop +theorem linComb_append {I : Type} (rs ss : List (I -> Int)) (ws : List Int) (c : I) : + linComb (rs ++ ss) ws c = + linComb rs (ws.take rs.length) c + linComb ss (ws.drop rs.length) c := by + have hnil : ∀ qs : List (I -> Int), linComb qs [] c = 0 := by + intro qs; cases qs <;> rfl + induction rs generalizing ws with + | nil => simp [linComb] + | cons r rs ih => + cases ws with + | nil => simp [hnil] + | cons w ws => + simp only [List.cons_append, List.length_cons, List.take_succ_cons, List.drop_succ_cons, + linComb] + rw [ih] + ring +theorem linComb_range_entry (n : Nat) (u : Int) (l K : Nat) (ws : List Int) (a : Nat) (rs : Nat × + Nat) + (hlen : ws.length = K) : + linComb ((List.range' a K).map (fun k => entry n u (k, l))) ws rs = + (gridX n rs) ^ a * Poly.eval ws (gridX n rs) * (gridY u rs) ^ l := by + induction K generalizing ws a with + | zero => + cases ws with + | nil => simp [List.range', linComb, Poly.eval] + | cons _ _ => nomatch hlen + | succ K ih => + cases ws with + | nil => nomatch hlen + | cons w ws => + simp only [List.length_cons, Nat.succ.injEq] at hlen + simp only [List.range', List.map_cons, linComb, Poly.eval] + rw [ih ws (a + 1) hlen] + unfold entry + dsimp -failIfUnchanged + rw [pow_succ] + ring +theorem linComb_monomialGrid_eq_evalLaurent (n : Nat) (u : Int) (K a L : Nat) (ws : List Int) (rs : + Nat × Nat) + (hlen : ws.length = K * L) : + linComb ((monomialGrid K a L).map (entry n u)) ws rs = + evalLaurent (unflattenLaurent K a L ws) (gridX n rs) (gridY u rs) := by + induction L generalizing a ws with + | zero => + cases ws with + | nil => rfl + | cons _ _ => nomatch hlen + | succ L ih => + simp only [monomialGrid, unflattenLaurent, evalLaurent, List.map_append, linComb_append, + List.map_map, + List.length_map, List.length_range] + have htake : (ws.take K).length = K := by + rw [List.length_take, hlen, Nat.mul_succ] + omega + have hdrop : (ws.drop K).length = K * L := by + rw [List.length_drop, hlen, Nat.mul_succ] + omega + have hr : (List.range K).map (entry n u ∘ fun k => (k, a)) = + (List.range' 0 K).map (fun k => entry n u (k, a)) := by + rw [List.range_eq_range'] + rfl + rw [hr, linComb_range_entry n u a K (ws.take K) 0 rs htake, ih (a + 1) (ws.drop K) hdrop] + ring +theorem rowIndep_monomialGrid (K L n : Nat) (u : Int) (R0 S : Nat) + (hn : R0 ≤ n) (hsize : (K - 1) * L < R0 * S) (hu : u ≠ 0) : + RowIndep ((monomialGrid K 0 L).map (entry n u)) (gridRect (R0 + L - 1) S) := by + intro ws hlen hz + rw [List.length_map, length_monomialGrid] at hlen + apply forall_zero_of_unflattenLaurent_zero K 0 L ws hlen + apply forall_zero_of_evalLaurent_grid_zero K L n u R0 S (unflattenLaurent K 0 L ws) hn hsize + · rw [length_unflattenLaurent] + · exact hu + · rw [map_fst_unflattenLaurent] + exact List.nodup_range' + · exact length_snd_unflattenLaurent_le K 0 L ws + · intro r s hr hs + rw [<- linComb_monomialGrid_eq_evalLaurent n u K 0 L ws (r, s) hlen] + exact hz (r, s) ((mem_gridRect_iff (R0 + L - 1) S r s).mpr ⟨hr, hs⟩) +theorem exists_cols_det_monomialGrid_ne_zero (K L n : Nat) (u : Int) (R0 S : Nat) + (hn : R0 ≤ n) (hsize : (K - 1) * L < R0 * S) (hu : u ≠ 0) : + ∃ cs, cs.length = K * L /\ (∀ x ∈ cs, x ∈ gridRect (R0 + L - 1) S) /\ + Determinant.det ((monomialGrid K 0 L).map (entry n u)) cs ≠ 0 := by + rcases exists_cols_det_ne_zero _ _ (rowIndep_monomialGrid K L n u R0 S hn hsize hu) with ⟨cs, hcs, + hrest⟩ + rw [List.length_map, length_monomialGrid] at hcs + exact ⟨cs, hcs, hrest⟩ +end LaurentInterp +namespace LaurentCongr +open Determinant GridPoints LaurentPoly LaurentInterp +theorem det_map_congr {I J : Type} (xs : List J) (f g : J -> I -> Int) (cols : List I) + (h : ∀ x ∈ xs, ∀ c ∈ cols, f x c = g x c) : + det (xs.map f) cols = det (xs.map g) cols := by + apply det_congr_cols + induction xs with + | nil => exact List.Forall₂.nil + | cons x xs ih => + refine List.Forall₂.cons ?_ (ih (fun y hy c hc => h y (List.mem_cons_of_mem _ hy) c hc)) + intro c hc + exact h x List.mem_cons_self c hc +theorem dvd_det_map_sub {I J : Type} (xs : List J) (f g : J -> I -> Int) (cols : List I) (M : Int) + (h : ∀ x ∈ xs, ∀ c ∈ cols, M ∣ (f x c - g x c)) : + M ∣ (det (xs.map f) cols - det (xs.map g) cols) := by + apply dvd_det_sub_det + induction xs with + | nil => exact List.Forall₂.nil + | cons x xs ih => + refine List.Forall₂.cons ?_ (ih (fun y hy c hc => h y (List.mem_cons_of_mem _ hy) c hc)) + intro c hc + exact h x List.mem_cons_self c hc +theorem pow_emod_congr (M a b : Int) (e : Nat) (h : a % M = b % M) : + (a ^ e) % M = (b ^ e) % M := by + induction e with + | zero => simp + | succ e ih => + rw [pow_succ, pow_succ, Int.mul_emod, ih, h, <- Int.mul_emod] +theorem four_dvd_negThreePow_sub_one (l : Nat) : (4 : Int) ∣ (negThreePow l - 1) := by + rw [SmallModuli.dvd_sub_iff_emod_eq 4 (negThreePow l) 1 (by decide)] + unfold negThreePow + have h := pow_emod_congr 4 (-3) 1 l (by decide) + simpa using h +def gridExp (n : Nat) (rs : Nat × Nat) : Nat := + rs.1 + n * rs.2 +theorem cast_gridExp_eq_gridX (n : Nat) (rs : Nat × Nat) : + (gridExp n rs : Int) = gridX n rs := by + unfold gridExp gridX + push_cast + rfl +def approxEntry (n : Nat) (kl rs : Nat × Nat) : Int := + (gridX n rs) ^ kl.1 * (negThreePow kl.2) ^ (gridExp n rs) +theorem two_pow_dvd_entry_sub_approxEntry (n : Nat) (u : Int) (kl rs : Nat × Nat) + (hbad : ((2 : Int) ^ n) ∣ ((-3 : Int) ^ n - u)) : + ((2 : Int) ^ n) ∣ (entry n u kl rs - approxEntry n kl rs) := by + set M : Int := (2 : Int) ^ n + have hM : 0 < M := SmallModuli.two_pow_pos n + have hb : ((-3 : Int) ^ n) % M = u % M := (SmallModuli.dvd_sub_iff_emod_eq M _ _ hM).mp hbad + rcases kl with ⟨k, l⟩ + rcases rs with ⟨r, s⟩ + have hy : (gridY u (r, s)) % M = ((-3 : Int) ^ (gridExp n (r, s))) % M := by + unfold gridY gridExp + dsimp -failIfUnchanged + rw [pow_add, pow_mul, Int.mul_emod, Int.mul_emod ((-3 : Int) ^ r)] + rw [pow_emod_congr M u ((-3 : Int) ^ n) s hb.symm] + have he : ((gridY u (r, s)) ^ l) % M = ((negThreePow l) ^ (gridExp n (r, s))) % M := by + unfold negThreePow + rw [<- pow_mul, Nat.mul_comm l, pow_mul] + exact pow_emod_congr M _ _ l hy + rw [SmallModuli.dvd_sub_iff_emod_eq M _ _ hM] + unfold entry approxEntry + dsimp -failIfUnchanged + rw [Int.mul_emod, he, <- Int.mul_emod] +theorem two_pow_dvd_det_approxEntry (K L n : Nat) (cs : List (Nat × Nat)) (E : Nat) + (hbound : (E : Int) ≤ (K * L : Int) * ((K * L : Int) - 1 - 2 * (K : Int))) : + ((2 : Int) ^ E) ∣ det ((monomialGrid K 0 L).map (approxEntry n)) cs := by + set rs := (monomialGrid K 0 L).map (fun kl => (kl.1, negThreePow kl.2)) + have hdiv : ((2 : Int) ^ E) ∣ + det (rs.map (fun p (x : Nat) => (x : Int) ^ p.1 * p.2 ^ x)) (cs.map (gridExp n)) := by + apply DivisibilityBound.two_pow_dvd_det_monomial_geom K E + · simp only [rs, List.length_map, length_monomialGrid, Nat.cast_mul] at hbound ⊢ + exact hbound + · intro k q hkq + rcases List.mem_map.mp hkq with ⟨⟨k', l⟩, hin, heq⟩ + injection heq with hk hq + subst hk hq + rw [mem_monomialGrid_iff] at hin + exact ⟨by omega, four_dvd_negThreePow_sub_one l⟩ + rw [HadamardBound.det_map_cols] at hdiv + simp only [rs, List.map_map] at hdiv + have hext : det ((monomialGrid K 0 L).map + ((fun r c => r (gridExp n c)) ∘ (fun p (x : Nat) => (x : Int) ^ p.1 * p.2 ^ x) ∘ + (fun kl => (kl.1, negThreePow kl.2)))) cs = + det ((monomialGrid K 0 L).map (approxEntry n)) cs := by + apply det_map_congr + intro ⟨k, l⟩ _ c _ + simp [Function.comp_apply, approxEntry, cast_gridExp_eq_gridX] + rwa [hext] at hdiv +theorem two_pow_dvd_det_entry (K L n : Nat) (u : Int) (cs : List (Nat × Nat)) (E : Nat) + (hE : E ≤ n) + (hbound : (E : Int) ≤ (K * L : Int) * ((K * L : Int) - 1 - 2 * (K : Int))) + (hbad : ((2 : Int) ^ n) ∣ ((-3 : Int) ^ n - u)) : + ((2 : Int) ^ E) ∣ det ((monomialGrid K 0 L).map (entry n u)) cs := by + have hcongr : ((2 : Int) ^ n) ∣ + (det ((monomialGrid K 0 L).map (entry n u)) cs - + det ((monomialGrid K 0 L).map (approxEntry n)) cs) := by + apply dvd_det_map_sub + intro kl _ rs _ + exact two_pow_dvd_entry_sub_approxEntry n u kl rs hbad + have hd : ((2 : Int) ^ E) ∣ + (det ((monomialGrid K 0 L).map (entry n u)) cs - + det ((monomialGrid K 0 L).map (approxEntry n)) cs) := + dvd_trans (SmallModuli.pow_dvd_pow_of_le E n hE) hcongr + have hcomp := two_pow_dvd_det_approxEntry K L n cs E hbound + rcases hd with ⟨a, ha⟩ + rcases hcomp with ⟨b, hb⟩ + refine ⟨a + b, by linarith⟩ +end LaurentCongr +namespace LaurentArch +open Determinant GridPoints LaurentPoly LaurentInterp +private theorem pow_le_pow_of_le {a b : Int} (ha : 0 ≤ a) (hab : a ≤ b) : + ∀ n : Nat, a ^ n ≤ b ^ n + | 0 => by simp + | n + 1 => by + rw [pow_succ, pow_succ] + have hb : 0 ≤ b := le_trans ha hab + exact mul_le_mul (pow_le_pow_of_le ha hab n) hab ha (pow_nonneg hb n) +private theorem one_le_pow_of_one_le {a : Int} (ha : 1 ≤ a) : ∀ k : Nat, 1 ≤ a ^ k + | 0 => by simp + | k + 1 => by + rw [pow_succ] + have hk := one_le_pow_of_one_le ha k + nlinarith +private theorem pow_le_pow_right_of_one_le {a : Int} (ha : 1 ≤ a) {n m : Nat} (hnm : n ≤ m) : + a ^ n ≤ a ^ m := by + rcases Nat.le.dest hnm with ⟨k, rfl⟩ + rw [pow_add] + have hk : 1 ≤ a ^ k := one_le_pow_of_one_le ha k + have hn : 0 ≤ a ^ n := pow_nonneg (by linarith) n + nlinarith +private theorem abs_mul_eq (a b : Int) : |a * b| = |a| * |b| := by + rcases le_total 0 a with ha | ha <;> rcases le_total 0 b with hb | hb + · rw [abs_of_nonneg ha, abs_of_nonneg hb, abs_of_nonneg (mul_nonneg ha hb)] + · rw [abs_of_nonneg ha, abs_of_nonpos hb, abs_of_nonpos (mul_nonpos_of_nonneg_of_nonpos ha hb)] + ring + · rw [abs_of_nonpos ha, abs_of_nonneg hb, abs_of_nonpos (mul_nonpos_of_nonpos_of_nonneg ha hb)] + ring + · rw [abs_of_nonpos ha, abs_of_nonpos hb, abs_of_nonneg (mul_nonneg_of_nonpos_of_nonpos ha hb)] + ring +private theorem abs_pow_eq (a : Int) : ∀ n : Nat, |a ^ n| = |a| ^ n + | 0 => by simp + | n + 1 => by rw [pow_succ, pow_succ, abs_mul_eq, abs_pow_eq a n] +theorem gridX_bounds (n m R S r s : Nat) + (hR : R ≤ n) (hn : n ≤ 2 ^ m) (hS : S ≤ 2 ^ m) (hr : r < R) (hs : s < S) : + 0 ≤ gridX n (r, s) /\ gridX n (r, s) ≤ (2 : Int) ^ (2 * m) := by + unfold gridX + dsimp -failIfUnchanged + refine ⟨by positivity, ?_⟩ + have h1 : (r : Int) + (n : Int) * (s : Int) ≤ (n : Int) * (S : Int) := by + have : (s + 1 : Int) ≤ (S : Int) := by omega + have : (n : Int) * (s + 1 : Int) ≤ (n : Int) * (S : Int) := + mul_le_mul_of_nonneg_left this (by positivity) + linarith + have hn' : (n : Int) ≤ (2 : Int) ^ m := by exact_mod_cast hn + have hS' : (S : Int) ≤ (2 : Int) ^ m := by exact_mod_cast hS + have h2 : (n : Int) * (S : Int) ≤ (2 : Int) ^ m * (2 : Int) ^ m := + mul_le_mul hn' hS' (by positivity) (by positivity) + have h3 : (2 : Int) ^ m * (2 : Int) ^ m = (2 : Int) ^ (2 * m) := by + rw [<- pow_add, Nat.two_mul] + linarith +theorem abs_entry_le_two_pow (n : Nat) (u : Int) (k l r s m : Nat) + (hu0 : 0 ≤ u) (hu : u ≤ (2 : Int) ^ m) + (hp0 : 0 ≤ gridX n (r, s)) (hp : gridX n (r, s) ≤ (2 : Int) ^ (2 * m)) : + |entry n u (k, l) (r, s)| ≤ (2 : Int) ^ (2 * m * k + (2 * r + m * s) * l) := by + have h3r : (3 : Int) ^ r ≤ (2 : Int) ^ (2 * r) := by + rw [pow_mul] + exact pow_le_pow_of_le (by decide) (by decide) r + have hus : u ^ s ≤ (2 : Int) ^ (m * s) := by + rw [pow_mul] + exact pow_le_pow_of_le hu0 hu s + have hheight : (3 : Int) ^ r * u ^ s ≤ (2 : Int) ^ (2 * r + m * s) := by + rw [pow_add] + exact mul_le_mul h3r hus (pow_nonneg hu0 s) (by positivity) + have hpoint : (gridX n (r, s)) ^ k ≤ ((2 : Int) ^ (2 * m)) ^ k := + pow_le_pow_of_le hp0 hp k + have hpower : ((3 : Int) ^ r * u ^ s) ^ l ≤ ((2 : Int) ^ (2 * r + m * s)) ^ l := + pow_le_pow_of_le (mul_nonneg (by positivity) (pow_nonneg hu0 s)) hheight l + unfold entry gridY + dsimp -failIfUnchanged + rw [abs_mul_eq, abs_pow_eq, abs_pow_eq, abs_mul_eq, abs_pow_eq, abs_pow_eq] + rw [abs_of_nonneg hp0, abs_of_nonneg hu0] + have habs3 : |(-3 : Int)| = 3 := by decide + rw [habs3] + calc (gridX n (r, s)) ^ k * ((3 : Int) ^ r * u ^ s) ^ l + _ ≤ ((2 : Int) ^ (2 * m)) ^ k * ((2 : Int) ^ (2 * r + m * s)) ^ l := + mul_le_mul hpoint hpower (by positivity) (by positivity) + _ = (2 : Int) ^ (2 * m * k + (2 * r + m * s) * l) := by + rw [<- pow_mul, <- pow_mul, <- pow_add] +theorem abs_det_entry_le_two_pow (K L n : Nat) (u : Int) (R S : Nat) (cs : List (Nat × Nat)) (m B : + Nat) + (hlen : cs.length = K * L) (hcols : ∀ c ∈ cs, c ∈ gridRect R S) + (hu0 : 0 ≤ u) (hu : u ≤ (2 : Int) ^ m) + (hR : R ≤ n) (hn : n ≤ 2 ^ m) (hS : S ≤ 2 ^ m) + (hN : K * L ≤ 2 ^ m) + (hex : 2 * m * K + (2 * R + m * S) * L ≤ B) : + |det ((monomialGrid K 0 L).map (entry n u)) cs| ≤ (2 : Int) ^ ((K * L) * (m + B)) := by + have hlen_rows : ((monomialGrid K 0 L).map (entry n u)).length = K * L := by + rw [List.length_map, length_monomialGrid] + have hbound := HadamardBound.abs_det_le_two_pow ((monomialGrid K 0 L).map (entry n u)) cs m B + (by rw [hlen_rows, hlen]) (by rw [hlen_rows]; exact hN) + rw [hlen_rows] at hbound + apply hbound + intro row hrow ⟨r, s⟩ hrs + rcases List.mem_map.mp hrow with ⟨⟨k, l⟩, hkl, rfl⟩ + rw [mem_monomialGrid_iff] at hkl + have hrs_grid := (mem_gridRect_iff R S r s).mp (hcols (r, s) hrs) + have hpb := gridX_bounds n m R S r s hR hn hS hrs_grid.1 hrs_grid.2 + have heb := abs_entry_le_two_pow n u k l r s m hu0 hu hpb.1 hpb.2 + refine le_trans heb ?_ + apply pow_le_pow_right_of_one_le (by decide : (1 : Int) ≤ 2) + have h1 : 2 * m * k ≤ 2 * m * K := Nat.mul_le_mul_left (2 * m) (by omega) + have h2 : 2 * r + m * s ≤ 2 * R + m * S := by + have : m * s ≤ m * S := Nat.mul_le_mul_left m (by omega) + omega + have h3 : (2 * r + m * s) * l ≤ (2 * R + m * S) * L := + Nat.mul_le_mul h2 (by omega) + omega +end LaurentArch +namespace LargeExclusion +open Determinant GridPoints LaurentPoly LaurentInterp LaurentCongr LaurentArch +theorem exclusion : SmallModuli.large_exclusion := by + intro n u hn hu hbad + have hn0 : n ≠ 0 := by omega + set m := Nat.log2 n + 1 + have hbits1 : 2 ^ (m - 1) ≤ n := Nat.log2_self_le hn0 + have hbits2 : n < 2 ^ m := Nat.lt_log2_self + have hm : 59 ≤ m := by + by_contra hlt + push Not at hlt + have hle : m ≤ 58 := by omega + have hpow : 2 ^ m ≤ 2 ^ 58 := Nat.pow_le_pow_right (by decide) hle + omega + set K := 256 * m ^ 2 + set L := 8 * m + set R0 := 32 * m ^ 2 + set S := 64 * m + set R := R0 + L - 1 + have hKL : K * L = 2048 * m ^ 3 := by + dsimp -failIfUnchanged [K, L] + ring + have hRS : R0 * S = K * L := by + dsimp -failIfUnchanged [R0, S, K, L] + ring + have hdim := GrowthBounds.cube_sq_lt_of_two_pow_le m n hm hbits1 + have hm2 : m ≤ m ^ 2 := by nlinarith + have hm3 : m ^ 2 ≤ m ^ 3 := by nlinarith + have hNsmall : 2048 * m ^ 3 < n := by nlinarith + have hR_le_n : R ≤ n := by + have : R0 + L ≤ 2048 * m ^ 3 := by dsimp -failIfUnchanged [R0, L]; omega + omega + have hR0_le_n : R0 ≤ n := by + dsimp -failIfUnchanged [R0] + omega + have hS_le_2m : S ≤ 2 ^ m := by + dsimp -failIfUnchanged [S] + omega + have hKL_le_2m : K * L ≤ 2 ^ m := by + rw [hKL] + omega + have hroot : (K - 1) * L < R0 * S := by + rw [hRS] + have hKpos : 0 < K := by dsimp -failIfUnchanged [K]; positivity + have hLpos : 0 < L := by dsimp -failIfUnchanged [L]; positivity + exact Nat.mul_lt_mul_of_pos_right (by omega) hLpos + rcases exists_cols_det_monomialGrid_ne_zero K L n (u : Int) R0 S hR0_le_n hroot (by omega) with + ⟨cs, hlen, hcols, hnz⟩ + set T := (2048 * m ^ 3) * (2048 * m ^ 3 - 1 - 2 * (256 * m ^ 2)) + set B := 1664 * m ^ 3 + set U := (2048 * m ^ 3) * (m + B) + have hgap := GrowthBounds.archimedean_lt_padic_exp m (by omega) + have hUT : U < T := by + dsimp -failIfUnchanged [U, B, T] + linarith + have hT_le_n : T ≤ n := by + dsimp -failIfUnchanged [T] + have : 2048 * m ^ 3 - 1 - 2 * (256 * m ^ 2) ≤ 2048 * m ^ 3 := by omega + calc (2048 * m ^ 3) * (2048 * m ^ 3 - 1 - 2 * (256 * m ^ 2)) + _ ≤ (2048 * m ^ 3) * (2048 * m ^ 3) := Nat.mul_le_mul_left _ this + _ = (2048 * m ^ 3) ^ 2 := by ring + _ ≤ n := by omega + have hdiv : ((2 : Int) ^ T) ∣ det ((monomialGrid K 0 L).map (entry n (u : Int))) cs := by + apply two_pow_dvd_det_entry K L n (u : Int) cs T hT_le_n _ hbad + have hT_eq : T = (K * L) * (K * L - 1 - 2 * K) := by rw [hKL] + have hsub1 : 1 ≤ K * L := by rw [hKL]; omega + have hsub2 : 2 * K ≤ K * L - 1 := by rw [hKL]; dsimp -failIfUnchanged [K]; omega + rw [hT_eq] + push_cast [hsub1, hsub2] + rfl + have hupper : |det ((monomialGrid K 0 L).map (entry n (u : Int))) cs| ≤ (2 : Int) ^ U := by + have hU : U = (K * L) * (m + B) := by rw [hKL] + rw [hU] + apply abs_det_entry_le_two_pow K L n (u : Int) R S cs m B hlen hcols (by omega) + · have : (u : Int) ≤ (2 : Int) ^ m := by + have : u ≤ 2 ^ m := by omega + exact_mod_cast this + exact this + · exact hR_le_n + · omega + · exact hS_le_2m + · exact hKL_le_2m + · have hR_le : R ≤ R0 + L := by omega + have hstep1 : 2 * m * K + (2 * R + m * S) * L ≤ 2 * m * K + (2 * (R0 + L) + m * S) * L := by + have : 2 * R + m * S ≤ 2 * (R0 + L) + m * S := by omega + have : (2 * R + m * S) * L ≤ (2 * (R0 + L) + m * S) * L := Nat.mul_le_mul_right L this + omega + have hstep2 : 2 * m * K + (2 * (R0 + L) + m * S) * L = 1536 * m ^ 3 + 128 * m ^ 2 := by + dsimp -failIfUnchanged [K, L, R0, S] + ring + have hstep3 : 1536 * m ^ 3 + 128 * m ^ 2 ≤ B := by + dsimp -failIfUnchanged [B] + omega + omega + exact HadamardBound.false_of_two_pow_dvd_and_abs_le _ U T hUT hnz hdiv hupper +end LargeExclusion +namespace TrajectoryGraph +def A (i : Nat) : Nat := 3 ^ i * 4 - 1 +def B (i : Nat) : Nat := 3 ^ i * 6 + i + 4 +def F (i : Nat) : Nat := 3 ^ i * 2 + i + 5 +def core : Prop := ∀ i : Nat, 7 ≤ i -> ¬ (2 ^ (i + 1) ∣ F i) +inductive MacroStep : Nat -> Nat -> Prop where + | R1 (i n : Nat) : 3 ^ i * 2 - i - 2 ≤ n /\ n ≤ 3 ^ i * 6 - i - 6 -> n % 2 = i % 2 -> + MacroStep n ((n + B i) / 2) + | R2 (i n : Nat) : 3 ^ i * 2 - i ≤ n /\ n ≤ 3 ^ i * 6 - i - 10 -> n % 2 = (i + 1) % 2 -> + MacroStep n (A (i + 1)) +inductive MacroReaches : Nat -> Nat -> Prop where + | one (x y : Nat) : MacroStep x y -> MacroReaches x y + | cons (x y z : Nat) : MacroStep x y -> MacroReaches y z -> MacroReaches x z +theorem succ_le_three_pow (i : Nat) : i + 1 ≤ 3 ^ i := by + induction i with + | zero => decide + | succ i ih => + rw [Nat.pow_succ] + omega +theorem two_pow_mul_linear_lt_three_pow (i : Nat) (hi : 7 ≤ i) : 2 ^ i * (2 * i + 13) < 3 ^ i * 2 := + by + induction i, hi using Nat.le_induction with + | base => decide + | succ m hm ih => + have hpos : 0 < 2 ^ m := by positivity + rw [Nat.pow_succ, Nat.pow_succ] + nlinarith +theorem exists_two_pow_mul_odd (n : Nat) (hn : 0 < n) : ∃ v q : Nat, n = 2 ^ v * q /\ q % 2 = 1 /\ 0 + < q := by + induction n using Nat.strong_induction_on with + | h n ih => + by_cases heven : n % 2 = 0 + · obtain ⟨v, q, he, ho, hq⟩ := ih (n / 2) (by omega) (by omega) + refine ⟨v + 1, q, ?_, ho, hq⟩ + have hn2 : n = 2 * (n / 2) := by omega + rw [hn2, he, Nat.pow_succ] + ring + · exact ⟨0, n, by simp, by omega, hn⟩ +theorem exists_two_pow_odd_factor_F (i : Nat) (hc : core) (hi : 7 ≤ i) : + ∃ v q : Nat, F i = 2 ^ v * q /\ q % 2 = 1 /\ 2 * i + 15 ≤ q := by + obtain ⟨v, q, hf, ho, hq⟩ := exists_two_pow_mul_odd (F i) (by unfold F; omega) + have hv : v ≤ i := by + by_contra hgt + push Not at hgt + apply hc i hi + refine ⟨2 ^ (v - (i + 1)) * q, ?_⟩ + have hv_eq : v = (i + 1) + (v - (i + 1)) := by omega + conv_lhs => rw [hf, hv_eq, Nat.pow_add] + ring + have hp : 2 ^ v ≤ 2 ^ i := Nat.pow_le_pow_right (by decide) hv + have hlarge := two_pow_mul_linear_lt_three_pow i hi + have hqbound : 2 * i + 13 < q := by + by_contra hle + push Not at hle + have hmul : 2 ^ v * q ≤ 2 ^ i * (2 * i + 13) := Nat.mul_le_mul hp hle + unfold F at hf + omega + exact ⟨v, q, hf, ho, by omega⟩ +theorem macroReaches_from_sub (i v q : Nat) (hi : 7 ≤ i) (ho : q % 2 = 1) + (hq : 2 * i + 15 ≤ q) (hd : 2 ^ v * q ≤ F i) : + MacroReaches (B i - 2 ^ v * q) (A (i + 1)) := by + induction v with + | zero => + apply MacroReaches.one + apply MacroStep.R2 i + · have hp3 := succ_le_three_pow i + unfold B F at * + simp only [Nat.pow_zero, Nat.one_mul] at * + omega + · unfold B F at * + simp only [Nat.pow_zero, Nat.one_mul] at * + omega + | succ v ih => + have hp : 0 < 2 ^ v := by positivity + rw [Nat.pow_succ] at hd ⊢ + have hmul2 : 2 ^ v * 2 * q = 2 * (2 ^ v * q) := by ring + have hp3 := succ_le_three_pow i + have hdiv : (B i - 2 ^ v * 2 * q + B i) / 2 = B i - 2 ^ v * q := by + unfold B F at * + omega + have hstep : MacroStep (B i - 2 ^ v * 2 * q) (B i - 2 ^ v * q) := by + rw [<- hdiv] + apply MacroStep.R1 i + · have hq_pos : 1 * (2 * i + 15) ≤ 2 ^ v * q := Nat.mul_le_mul hp hq + unfold B F at * + omega + · unfold B F at * + omega + exact MacroReaches.cons _ _ _ hstep (ih (by omega)) +theorem macroReaches_next_layer (i : Nat) (hc : core) (hi : 7 ≤ i) : MacroReaches (A i) (A (i + 1)) + := by + obtain ⟨v, q, hf, ho, hq⟩ := exists_two_pow_odd_factor_F i hc hi + have h := macroReaches_from_sub i v q hi ho hq (by omega) + rw [<- hf] at h + have hba : B i - F i = A i := by + have hp3 := succ_le_three_pow i + unfold A B F + omega + rw [hba] at h + exact h +end TrajectoryGraph +namespace CoreBridge +theorem core (hlarge : SmallModuli.large_exclusion) : TrajectoryGraph.core := by + intro i hi ⟨q, hq⟩ + apply SmallModuli.not_two_pow_succ_dvd_F hlarge i hi + refine ⟨(q : Int), ?_⟩ + have hq_int : (TrajectoryGraph.F i : Int) = ((2 ^ (i + 1) * q : Nat) : Int) := by exact_mod_cast + hq + unfold TrajectoryGraph.F at hq_int + unfold SmallModuli.F + push_cast at hq_int + linarith +end CoreBridge + + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +abbrev HalfTape := ListBlank (Fin 2) +abbrev BitWord := List (Fin 2) +@[simp] theorem multiStep_zero_eq (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 0 = + some config := rfl +@[simp] theorem multiStep_one_eq (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M config 1 = + step M config := rfl +@[simp] theorem multiStep_succ_bind (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] +@[simp] theorem cons_zero_default_eq : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem head_default_eq : (default : HalfTape).head = 0 := rfl +@[simp] theorem tail_default_eq : (default : HalfTape).tail = default := rfl +@[simp] theorem nil_append_halfTape (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem cons_append_halfTape (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append, cons_append_halfTape, ih] +theorem step_to_multiStep_one {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c1 c2 : Cfg Γ₀ Λ₀) (h : c1 [tm]⊢ c2) : + c1 [tm]⊢^{1} c2 := by simp [h] +theorem step_to_reachesPlus {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c1 c2 : Cfg Γ₀ Λ₀) (h : c1 [tm]⊢ c2) : + c1 [tm]⊢⁺ c2 := ⟨1, by decide, step_to_multiStep_one tm c1 c2 h⟩ +theorem multiStep_add_bind {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep tm c1 (n + m) = (multiStep tm c1 n).bind (fun c2 => multiStep tm c2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ_bind, ih, Option.bind_assoc] + simp_rw [multiStep_succ_bind] +theorem multiStep_trans_explicit {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (tm : Machine Γ₀ Λ₀) (c1 c2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h₁ : c1 [tm]⊢^{n} c2) (h₂ : c2 [tm]⊢^{m} c_3) : + c1 [tm]⊢^{n+m} c_3 := by + rw [multiStep_add_bind, h₁]; simp [h₂] +theorem reachesStar_trans {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c1 c2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c1 [tm]⊢* c2) (h₂ : c2 [tm]⊢* c_3) : c1 [tm]⊢* c_3 := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans_explicit tm c1 c2 c_3 n m hn hm⟩ +theorem reachesPlus_to_reachesStar {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c1 c2 : Cfg Γ₀ Λ₀} (h : c1 [tm]⊢⁺ c2) : + c1 [tm]⊢* c2 := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ +theorem reachesPlus_trans {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c1 c2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c1 [tm]⊢⁺ c2) (h₂ : c2 [tm]⊢⁺ c_3) : c1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, by omega, multiStep_trans_explicit tm c1 c2 c_3 n m hn hm⟩ +theorem reachesPlus_reachesStar_trans {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c1 c2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c1 [tm]⊢⁺ c2) (h₂ : c2 [tm]⊢* c_3) : c1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans_explicit tm c1 c2 c_3 n + m hn hm⟩ +theorem reachesStar_reachesPlus_trans {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c1 c2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c1 [tm]⊢* c2) (h₂ : c2 [tm]⊢⁺ c_3) : c1 [tm]⊢⁺ c_3 := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, by omega, multiStep_trans_explicit tm c1 c2 c_3 n m hn hm⟩ +theorem step_reachesStar_reachesPlus {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {tm : Machine Γ₀ Λ₀} {c1 c2 c_3 : Cfg Γ₀ Λ₀} + (h₁ : c1 [tm]⊢ c2) (h₂ : c2 [tm]⊢* c_3) : c1 [tm]⊢⁺ c_3 := + reachesPlus_reachesStar_trans (step_to_reachesPlus tm c1 c2 h₁) h₂ +macro "finish" : tactic => + `(tactic| exists 0 <;> rfl) +macro "step" : tactic => + `(tactic| (try refine reachesPlus_to_reachesStar ?_) <;> + refine step_reachesStar_reachesPlus (by (try simp only [BusyBeaver.Cfg.headRight, + BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, head_default_eq]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, cons_zero_default_eq, + head_default_eq, tail_default_eq]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) +def rep01 : Nat -> HalfTape -> HalfTape + | 0, r => r + | b + 1, r => (0 : Fin 2) >> (1 : Fin 2) >> rep01 b r +def rep11 : Nat -> HalfTape -> HalfTape + | 0, r => r + | a + 1, r => (1 : Fin 2) >> (1 : Fin 2) >> rep11 a r +@[simp] theorem rep01_zero (r : HalfTape) : rep01 0 r = r := rfl +@[simp] theorem rep01_succ (b : Nat) (r : HalfTape) : rep01 (b + 1) r = (0 : Fin 2) >> (1 : Fin 2) + >> rep01 b r := rfl +theorem rep01_succ_inner (b : Nat) (r : HalfTape) : + rep01 (b + 1) r = rep01 b ((0 : Fin 2) >> (1 : Fin 2) >> r) := by + induction b with + | zero => rfl + | succ b ih => rw [rep01_succ (b + 1), ih, <- rep01_succ b] +theorem rep01_add (b1 b2 : Nat) (r : HalfTape) : rep01 (b1 + b2) r = rep01 b1 (rep01 b2 r) := by + induction b1 with + | zero => simp + | succ b1 ih => rw [Nat.succ_add, rep01_succ, rep01_succ, ih] +@[simp] theorem rep11_zero (r : HalfTape) : rep11 0 r = r := rfl +@[simp] theorem rep11_succ (a : Nat) (r : HalfTape) : rep11 (a + 1) r = (1 : Fin 2) >> (1 : Fin 2) + >> rep11 a r := rfl +theorem rep11_succ_inner (a : Nat) (r : HalfTape) : + rep11 (a + 1) r = rep11 a ((1 : Fin 2) >> (1 : Fin 2) >> r) := by + induction a with + | zero => rfl + | succ a ih => rw [rep11_succ (a + 1), ih, <- rep11_succ a] +theorem rep11_add (a1 a2 : Nat) (r : HalfTape) : rep11 (a1 + a2) r = rep11 a1 (rep11 a2 r) := by + induction a1 with + | zero => simp + | succ a1 ih => rw [Nat.succ_add, rep11_succ, rep11_succ, ih] +theorem shift_B_rep01 (b : Nat) (l r : HalfTape) : + (l {{B}}> rep01 b r) [target_tm]⊢* (rep01 b l {{B}}> r) := by + induction b generalizing l with + | zero => exact ⟨0, rfl⟩ + | succ b ih => + rw [rep01_succ, rep01_succ_inner] + have h1 : (l {{B}}> ((0 : Fin 2) >> (1 : Fin 2) >> rep01 b r)) [target_tm]⊢⁺ + (((0 : Fin 2) >> (1 : Fin 2) >> l) {{B}}> rep01 b r) := by execute + exact reachesStar_trans (reachesPlus_to_reachesStar h1) (ih _) +theorem shift_C_rep01 (b : Nat) (l r : HalfTape) : + (rep01 b l <{{C}} r) [target_tm]⊢* (l <{{C}} rep01 b r) := by + induction b generalizing r with + | zero => exact ⟨0, rfl⟩ + | succ b ih => + rw [rep01_succ, rep01_succ_inner] + have h1 : (((0 : Fin 2) >> (1 : Fin 2) >> rep01 b l) <{{C}} r) [target_tm]⊢⁺ + (rep01 b l <{{C}} ((0 : Fin 2) >> (1 : Fin 2) >> r)) := by execute + exact reachesStar_trans (reachesPlus_to_reachesStar h1) (ih _) +theorem shift_A_rep01_to_rep11 (b : Nat) (l r : HalfTape) : + (l {{A}}> ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> rep01 b r)) [target_tm]⊢* + (rep11 b l {{A}}> ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> r)) := by + induction b generalizing l with + | zero => exact ⟨0, rfl⟩ + | succ b ih => + rw [rep01_succ, rep11_succ_inner] + have h1 : (l {{A}}> ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + rep01 b r)) + [target_tm]⊢⁺ + (((1 : Fin 2) >> (1 : Fin 2) >> l) {{A}}> ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + rep01 b r)) := by execute + exact reachesStar_trans (reachesPlus_to_reachesStar h1) (ih _) +theorem shift_A_rep11 (a : Nat) (l r : HalfTape) : + (rep11 a l <{{A}} r) [target_tm]⊢* (l <{{A}} rep11 a r) := by + induction a generalizing r with + | zero => exact ⟨0, rfl⟩ + | succ a ih => + rw [rep11_succ, rep11_succ_inner] + have h1 : (((1 : Fin 2) >> (1 : Fin 2) >> rep11 a l) <{{A}} r) [target_tm]⊢⁺ + (rep11 a l <{{A}} ((1 : Fin 2) >> (1 : Fin 2) >> r)) := by execute + exact reachesStar_trans (reachesPlus_to_reachesStar h1) (ih _) +abbrev d0 : HalfTape := default +def S1 (a b c : Nat) : Cfg (Fin 2) (Fin 6) := + ((1 : Fin 2) >> rep11 a d0) <{{C}} rep01 b (rep11 c ((0 : Fin 2) >> (1 : Fin 2) >> d0)) +def S2 (a b : Nat) : Cfg (Fin 2) (Fin 6) := + ((1 : Fin 2) >> rep11 a d0) <{{C}} rep01 b ((1 : Fin 2) >> d0) +def S3 (a b : Nat) : Cfg (Fin 2) (Fin 6) := + ((1 : Fin 2) >> rep11 a d0) <{{C}} rep01 b d0 +theorem step_S1_one (a b c : Nat) : + (S1 (1 + a) b (2 + c)) [target_tm]⊢* (S1 a (3 + b) c) := by + unfold S1 + rw [Nat.add_comm 1 a, Nat.add_comm 2 c, Nat.add_comm 3 b] + simp only [rep11_succ] + set l0 := (1 : Fin 2) >> rep11 a d0 + set r0 := rep11 c ((0 : Fin 2) >> (1 : Fin 2) >> d0) + have h1 : (((1 : Fin 2) >> (1 : Fin 2) >> l0) <{{C}} rep01 b ((1 : Fin 2) >> (1 : Fin 2) >> (1 : + Fin 2) >> (1 : Fin 2) >> r0)) + [target_tm]⊢⁺ (((0 : Fin 2) >> (1 : Fin 2) >> l0) {{B}}> rep01 b ((1 : Fin 2) >> (1 : Fin 2) + >> (1 : Fin 2) >> (1 : Fin 2) >> r0)) := by execute + have h2 := shift_B_rep01 b ((0 : Fin 2) >> (1 : Fin 2) >> l0) ((1 : Fin 2) >> (1 : Fin 2) >> (1 : + Fin 2) >> (1 : Fin 2) >> r0) + rw [<- rep01_succ_inner b l0] at h2 + have h3 : (rep01 (b + 1) l0 {{B}}> ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + r0)) + [target_tm]⊢⁺ (rep01 (b + 2) l0 <{{C}} ((0 : Fin 2) >> (1 : Fin 2) >> r0)) := by + simp only [rep01_succ] + execute + have h4 := shift_C_rep01 (b + 2) l0 ((0 : Fin 2) >> (1 : Fin 2) >> r0) + rw [<- rep01_succ_inner (b + 2) r0] at h4 + exact reachesStar_trans (reachesPlus_to_reachesStar h1) (reachesStar_trans h2 (reachesStar_trans + (reachesPlus_to_reachesStar h3) h4)) +theorem step_S1_iter (n a b c : Nat) : + (S1 (n + a) b (n * 2 + c)) [target_tm]⊢* (S1 a (n * 3 + b) c) := by + induction n generalizing a b c with + | zero => + simp only [Nat.zero_add, Nat.zero_mul] + exact ⟨0, rfl⟩ + | succ n ih => + have h1 : n + 1 + a = 1 + (n + a) := by omega + have h2 : (n + 1) * 2 + c = 2 + (n * 2 + c) := by omega + have h3 : (n + 1) * 3 + b = n * 3 + (3 + b) := by omega + rw [h1, h2, h3] + exact reachesStar_trans (step_S1_one (n + a) b (n * 2 + c)) (ih a (3 + b) c) +theorem step_S1_zero_left (b c : Nat) : + (S1 0 b (3 + c)) [target_tm]⊢* (S1 (2 + b) 2 c) := by + unfold S1 + rw [Nat.add_comm 3 c, Nat.add_comm 2 b] + simp only [rep11_zero, rep11_succ] + set r0 := rep11 c ((0 : Fin 2) >> (1 : Fin 2) >> d0) + have h1 : (((1 : Fin 2) >> d0) <{{C}} rep01 b ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : + Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> r0)) + [target_tm]⊢⁺ (d0 {{B}}> rep01 b ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> r0)) := by execute + have h2 := shift_B_rep01 b d0 ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : + Fin 2) >> (1 : Fin 2) >> r0) + have h3 : (rep01 b d0 {{B}}> ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin + 2) >> (1 : Fin 2) >> r0)) + [target_tm]⊢⁺ (rep01 (b + 1) d0 <{{C}} ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin + 2) >> r0)) := by + simp only [rep01_succ] + execute + have h4 := shift_C_rep01 (b + 1) d0 ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + r0) + have h5 : (d0 <{{C}} rep01 (b + 1) ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + r0)) + [target_tm]⊢⁺ (d0 {{A}}> ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> rep01 (b + 2) ((1 : Fin + 2) >> (1 : Fin 2) >> r0))) := by + rw [rep01_succ_inner (b + 1) ((1 : Fin 2) >> (1 : Fin 2) >> r0)] + execute + have h6 := shift_A_rep01_to_rep11 (b + 2) d0 ((1 : Fin 2) >> (1 : Fin 2) >> r0) + have h7 : (rep11 (b + 2) d0 {{A}}> ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 + : Fin 2) >> r0)) + [target_tm]⊢⁺ (((1 : Fin 2) >> rep11 (b + 2) d0) <{{C}} rep01 2 r0) := by + simp only [rep01_succ, rep01_zero] + execute + exact reachesStar_trans (reachesPlus_to_reachesStar h1) (reachesStar_trans h2 (reachesStar_trans + (reachesPlus_to_reachesStar h3) (reachesStar_trans h4 (reachesStar_trans + (reachesPlus_to_reachesStar h5) (reachesStar_trans h6 (reachesPlus_to_reachesStar h7)))))) +theorem step_S2_one (a b : Nat) : + (S2 (1 + a) b) [target_tm]⊢* (S2 a (3 + b)) := by + unfold S2 + rw [Nat.add_comm 1 a, Nat.add_comm 3 b] + simp only [rep11_succ] + set l0 := (1 : Fin 2) >> rep11 a d0 + have h1 : (((1 : Fin 2) >> (1 : Fin 2) >> l0) <{{C}} rep01 b ((1 : Fin 2) >> d0)) + [target_tm]⊢⁺ (((0 : Fin 2) >> (1 : Fin 2) >> l0) {{B}}> rep01 b ((1 : Fin 2) >> d0)) := by + execute + have h2 := shift_B_rep01 b ((0 : Fin 2) >> (1 : Fin 2) >> l0) ((1 : Fin 2) >> d0) + rw [<- rep01_succ_inner b l0] at h2 + have h3 : (rep01 (b + 1) l0 {{B}}> ((1 : Fin 2) >> d0)) + [target_tm]⊢⁺ (rep01 (b + 3) l0 <{{C}} ((1 : Fin 2) >> d0)) := by + simp only [rep01_succ] + execute + have h4 := shift_C_rep01 (b + 3) l0 ((1 : Fin 2) >> d0) + exact reachesStar_trans (reachesPlus_to_reachesStar h1) (reachesStar_trans h2 (reachesStar_trans + (reachesPlus_to_reachesStar h3) h4)) +theorem step_S2_iter (a b : Nat) : + (S2 a b) [target_tm]⊢* (S2 0 (a * 3 + b)) := by + induction a generalizing b with + | zero => + simp only [Nat.zero_mul, Nat.zero_add] + exact ⟨0, rfl⟩ + | succ a ih => + have h1 : a + 1 = 1 + a := by omega + have h2 : (a + 1) * 3 + b = a * 3 + (3 + b) := by omega + rw [h2, h1] + exact reachesStar_trans (step_S2_one a b) (ih (3 + b)) +theorem Ov2 (b : Nat) : + (S2 0 b) [target_tm]⊢* (S3 (2 + b) 1) := by + unfold S2 S3 + rw [Nat.add_comm 2 b] + simp only [rep11_zero] + have h1 : (((1 : Fin 2) >> d0) <{{C}} rep01 b ((1 : Fin 2) >> d0)) + [target_tm]⊢⁺ (d0 {{B}}> rep01 b ((1 : Fin 2) >> d0)) := by execute + have h2 := shift_B_rep01 b d0 ((1 : Fin 2) >> d0) + have h3 : (rep01 b d0 {{B}}> ((1 : Fin 2) >> d0)) + [target_tm]⊢⁺ (rep01 (b + 2) d0 <{{C}} ((1 : Fin 2) >> d0)) := by + cases b with + | zero => + simp only [Nat.zero_add, rep01_succ, rep01_zero] + execute + | succ b => + simp only [Nat.succ_add, rep01_succ] + execute + have h4 := shift_C_rep01 (b + 2) d0 ((1 : Fin 2) >> d0) + have h5 : (d0 <{{C}} rep01 (b + 2) ((1 : Fin 2) >> d0)) + [target_tm]⊢⁺ (d0 {{A}}> ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> rep01 (b + 2) ((1 : Fin + 2) >> d0))) := by execute + have h6 := shift_A_rep01_to_rep11 (b + 2) d0 ((1 : Fin 2) >> d0) + have h7 : (rep11 (b + 2) d0 {{A}}> ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + d0)) + [target_tm]⊢⁺ (((1 : Fin 2) >> rep11 (b + 2) d0) <{{C}} rep01 1 d0) := by + simp only [rep01_succ, rep01_zero] + execute + exact reachesStar_trans (reachesPlus_to_reachesStar h1) (reachesStar_trans h2 (reachesStar_trans + (reachesPlus_to_reachesStar h3) (reachesStar_trans h4 (reachesStar_trans + (reachesPlus_to_reachesStar h5) (reachesStar_trans h6 (reachesPlus_to_reachesStar h7)))))) +theorem step_S3_one (a b : Nat) : + (S3 (1 + a) b) [target_tm]⊢* (S3 a (2 + b)) := by + unfold S3 + rw [Nat.add_comm 1 a, Nat.add_comm 2 b] + simp only [rep11_succ] + set l0 := (1 : Fin 2) >> rep11 a d0 + have h1 : (((1 : Fin 2) >> (1 : Fin 2) >> l0) <{{C}} rep01 b d0) + [target_tm]⊢⁺ (((0 : Fin 2) >> (1 : Fin 2) >> l0) {{B}}> rep01 b d0) := by execute + have h2 := shift_B_rep01 b ((0 : Fin 2) >> (1 : Fin 2) >> l0) d0 + rw [<- rep01_succ_inner b l0] at h2 + have h3 : (rep01 (b + 1) l0 {{B}}> d0) + [target_tm]⊢⁺ (rep01 (b + 2) l0 <{{C}} d0) := by + simp only [rep01_succ] + execute + have h4 := shift_C_rep01 (b + 2) l0 d0 + exact reachesStar_trans (reachesPlus_to_reachesStar h1) (reachesStar_trans h2 (reachesStar_trans + (reachesPlus_to_reachesStar h3) h4)) +theorem step_S3_iter (a b : Nat) : + (S3 a b) [target_tm]⊢* (S3 0 (a * 2 + b)) := by + induction a generalizing b with + | zero => + simp only [Nat.zero_mul, Nat.zero_add] + exact ⟨0, rfl⟩ + | succ a ih => + have h1 : a + 1 = 1 + a := by omega + have h2 : (a + 1) * 2 + b = a * 2 + (2 + b) := by omega + rw [h2, h1] + exact reachesStar_trans (step_S3_one a b) (ih (2 + b)) +theorem Ov3 (b : Nat) : + (S3 0 b) [target_tm]⊢⁺ (S1 0 2 (2 + b)) := by + unfold S3 S1 + rw [Nat.add_comm 2 b] + simp only [rep11_zero] + have h1 : (((1 : Fin 2) >> d0) <{{C}} rep01 b d0) + [target_tm]⊢⁺ (d0 {{B}}> rep01 b d0) := by execute + have h2 := shift_B_rep01 b d0 d0 + have h3 : (rep01 b d0 {{B}}> d0) + [target_tm]⊢⁺ (rep01 (b + 1) d0 <{{C}} d0) := by + simp only [rep01_succ] + execute + have h4 := shift_C_rep01 (b + 1) d0 d0 + have h5 : (d0 <{{C}} rep01 (b + 1) d0) + [target_tm]⊢⁺ (d0 {{A}}> ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> rep01 (b + 1) d0)) := + by execute + have h6 := shift_A_rep01_to_rep11 (b + 1) d0 d0 + have h7 : (rep11 (b + 1) d0 {{A}}> ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> d0)) + [target_tm]⊢⁺ (rep11 (b + 3) d0 <{{A}} ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin + 2) >> d0)) := by + simp only [rep11_succ] + execute + have h8 := shift_A_rep11 (b + 3) d0 ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + d0) + have h9 : (d0 <{{A}} rep11 (b + 3) ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + d0)) + [target_tm]⊢⁺ (((1 : Fin 2) >> d0) <{{C}} rep01 2 (rep11 (b + 2) ((0 : Fin 2) >> (1 : Fin 2) + >> d0))) := by + rw [<- rep11_succ_inner (b + 3) ((0 : Fin 2) >> (1 : Fin 2) >> d0)] + simp only [rep11_succ, rep01_succ, rep01_zero] + execute + exact reachesPlus_reachesStar_trans h1 (reachesStar_trans h2 (reachesStar_trans + (reachesPlus_to_reachesStar h3) (reachesStar_trans h4 (reachesStar_trans + (reachesPlus_to_reachesStar h5) (reachesStar_trans h6 (reachesStar_trans + (reachesPlus_to_reachesStar h7) (reachesStar_trans h8 (reachesPlus_to_reachesStar h9)))))))) +theorem step_S3_to_S1 (a b : Nat) : + (S3 a b) [target_tm]⊢⁺ (S1 0 2 (2 + a * 2 + b)) := by + have h1 := step_S3_iter a b + have h2 := Ov3 (a * 2 + b) + have heq : 2 + (a * 2 + b) = 2 + a * 2 + b := by omega + rw [heq] at h2 + exact reachesStar_reachesPlus_trans h1 h2 +theorem step_S2_to_S1 (a b : Nat) : + (S2 a b) [target_tm]⊢* (S1 0 2 (7 + a * 6 + b * 2)) := by + have h1 := step_S2_iter a b + have h2 := Ov2 (a * 3 + b) + have h3 := reachesPlus_to_reachesStar (step_S3_to_S1 (2 + (a * 3 + b)) 1) + have heq : 2 + (2 + (a * 3 + b)) * 2 + 1 = 7 + a * 6 + b * 2 := by omega + rw [heq] at h3 + exact reachesStar_trans h1 (reachesStar_trans h2 h3) +theorem step_S1_to_S2 (a b : Nat) : + (S1 (2 + a) b 1) [target_tm]⊢⁺ (S2 a (6 + b)) := by + unfold S1 S2 + rw [Nat.add_comm 2 a, Nat.add_comm 6 b] + simp only [rep11_succ, rep11_zero] + set l0 := (1 : Fin 2) >> rep11 a d0 + have h1 : (((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> l0) <{{C}} + rep01 b ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> d0)) + [target_tm]⊢⁺ + (((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> l0) {{B}}> + rep01 b ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> d0)) := by execute + have h2 := shift_B_rep01 b ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> l0) + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> d0) + rw [<- rep01_succ_inner b ((1 : Fin 2) >> (1 : Fin 2) >> l0)] at h2 + have h3 : (rep01 (b + 1) ((1 : Fin 2) >> (1 : Fin 2) >> l0) {{B}}> + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> d0)) + [target_tm]⊢⁺ + (((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> rep01 (b + 1) ((1 : Fin 2) >> (1 : Fin 2) >> + l0)) <{{A}} + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + d0)) := by + simp only [rep01_succ] + execute + have h4 : (((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> rep01 (b + 1) ((1 : Fin 2) >> (1 : Fin 2) + >> l0)) <{{A}} + ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + d0)) + [target_tm]⊢⁺ + (rep01 (b + 4) ((1 : Fin 2) >> (1 : Fin 2) >> l0) <{{C}} + ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> d0)) := by + simp only [rep01_succ] + execute + have h5 := shift_C_rep01 (b + 4) ((1 : Fin 2) >> (1 : Fin 2) >> l0) + ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> d0) + have h6 : (((1 : Fin 2) >> (1 : Fin 2) >> l0) <{{C}} + rep01 (b + 4) ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> d0)) + [target_tm]⊢⁺ + (((0 : Fin 2) >> (1 : Fin 2) >> l0) {{B}}> + rep01 (b + 4) ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> d0)) := by execute + have h7 := shift_B_rep01 (b + 4) ((0 : Fin 2) >> (1 : Fin 2) >> l0) + ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> d0) + rw [<- rep01_succ_inner (b + 4) l0] at h7 + have h8 : (rep01 (b + 5) l0 {{B}}> ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> d0)) + [target_tm]⊢⁺ + (rep01 (b + 6) l0 <{{C}} ((1 : Fin 2) >> d0)) := by + simp only [rep01_succ] + execute + have h9 := shift_C_rep01 (b + 6) l0 ((1 : Fin 2) >> d0) + exact reachesPlus_reachesStar_trans h1 (reachesStar_trans h2 (reachesStar_trans + (reachesPlus_to_reachesStar h3) (reachesStar_trans (reachesPlus_to_reachesStar h4) + (reachesStar_trans h5 (reachesStar_trans (reachesPlus_to_reachesStar h6) (reachesStar_trans h7 + (reachesStar_trans (reachesPlus_to_reachesStar h8) h9))))))) +theorem step_S1_odd (a b : Nat) : + (S1 (2 + a) b 1) [target_tm]⊢⁺ (S1 0 2 (19 + a * 6 + b * 2)) := by + have h1 := step_S1_to_S2 a b + have h2 := step_S2_to_S1 a (6 + b) + have heq : 7 + a * 6 + (6 + b) * 2 = 19 + a * 6 + b * 2 := by omega + rw [heq] at h2 + exact reachesPlus_reachesStar_trans h1 h2 +theorem step_S1_zero_right (a b : Nat) : + (S1 a b 0) [target_tm]⊢⁺ (S1 0 2 (3 + a * 2 + b)) := by + have heq1 : S1 a b 0 = S3 a (1 + b) := by + rw [Nat.add_comm 1 b] + unfold S1 S3 + simp only [rep11_zero, <- rep01_succ_inner] + rw [heq1] + have h := step_S3_to_S1 a (1 + b) + have heq2 : 2 + a * 2 + (1 + b) = 3 + a * 2 + b := by omega + rw [heq2] at h + exact h +def P (n1 n2 : Nat) : Prop := + ∀ c : Nat, (S1 0 2 (n1 + c)) [target_tm]⊢* (S1 n2 2 c) +theorem P_O : P 0 0 := by + intro c + simp only [Nat.zero_add] + exact ⟨0, rfl⟩ +theorem P_S (n1 n2 : Nat) (hp : P n1 n2) : + P (n1 + n2 * 2 + 3) (4 + n2 * 3) := by + intro c + have h1 := hp (n2 * 2 + (3 + c)) + have heq1 : n1 + (n2 * 2 + (3 + c)) = n1 + n2 * 2 + 3 + c := by omega + rw [heq1] at h1 + have h2 := step_S1_iter n2 0 2 (3 + c) + simp only [Nat.add_zero] at h2 + have h3 := step_S1_zero_left (n2 * 3 + 2) c + have heq2 : 2 + (n2 * 3 + 2) = 4 + n2 * 3 := by omega + rw [heq2] at h3 + exact reachesStar_trans h1 (reachesStar_trans h2 h3) +theorem P_n (i : Nat) : P (3 ^ i * 2 - i - 2) (3 ^ i * 2 - 2) := by + induction i with + | zero => exact P_O + | succ i ih => + have hps := P_S _ _ ih + have hp3 := TrajectoryGraph.succ_le_three_pow i + have heq1 : 3 ^ i * 2 - i - 2 + (3 ^ i * 2 - 2) * 2 + 3 = 3 ^ (i + 1) * 2 - (i + 1) - 2 := by + rw [Nat.pow_succ] + omega + have heq2 : 4 + (3 ^ i * 2 - 2) * 3 = 3 ^ (i + 1) * 2 - 2 := by + rw [Nat.pow_succ] + omega + rw [heq1, heq2] at hps + exact hps +def S' (n : Nat) : Cfg (Fin 2) (Fin 6) := S1 0 2 n +theorem step_S'_odd (n1 n2 c : Nat) (hp : P n1 (c + (2 + n2))) : + (S' (n1 + c * 2 + 1)) [target_tm]⊢⁺ (S' (23 + n2 * 6 + c * 6)) := by + unfold S' + have h1 := hp (c * 2 + 1) + have heq1 : n1 + (c * 2 + 1) = n1 + c * 2 + 1 := by omega + rw [heq1] at h1 + have h2 := step_S1_iter c (2 + n2) 2 1 + have h3 := step_S1_odd n2 (c * 3 + 2) + have heq2 : 19 + n2 * 6 + (c * 3 + 2) * 2 = 23 + n2 * 6 + c * 6 := by omega + rw [heq2] at h3 + exact reachesStar_reachesPlus_trans h1 (reachesStar_reachesPlus_trans h2 h3) +theorem step_S'_even (n1 n2 c : Nat) (hp : P n1 (c + n2)) : + (S' (n1 + c * 2 + 0)) [target_tm]⊢⁺ (S' (5 + n2 * 2 + c * 3)) := by + unfold S' + have h1 := hp (c * 2 + 0) + have heq1 : n1 + (c * 2 + 0) = n1 + c * 2 + 0 := by omega + rw [heq1] at h1 + have h2 := step_S1_iter c n2 2 0 + have h3 := step_S1_zero_right n2 (c * 3 + 2) + have heq2 : 3 + n2 * 2 + (c * 3 + 2) = 5 + n2 * 2 + c * 3 := by omega + rw [heq2] at h3 + exact reachesStar_reachesPlus_trans h1 (reachesStar_reachesPlus_trans h2 h3) +theorem step_S'_R1 (i n : Nat) (hn : 3 ^ i * 2 - i - 2 ≤ n /\ n ≤ 3 ^ i * 6 - i - 6) + (hp : n % 2 = i % 2) : + (S' n) [target_tm]⊢⁺ (S' ((n + (3 ^ i * 6 + i + 4)) / 2)) := by + have hp3 := TrajectoryGraph.succ_le_three_pow i + have hpn := P_n i + set c := (n - (3 ^ i * 2 - i - 2)) / 2 + have hc_eq : c + (3 ^ i * 2 - 2 - c) = 3 ^ i * 2 - 2 := by omega + rw [<- hc_eq] at hpn + have hbs := step_S'_even (3 ^ i * 2 - i - 2) (3 ^ i * 2 - 2 - c) c hpn + have heq1 : 3 ^ i * 2 - i - 2 + c * 2 + 0 = n := by omega + have heq2 : 5 + (3 ^ i * 2 - 2 - c) * 2 + c * 3 = (n + (3 ^ i * 6 + i + 4)) / 2 := by omega + rw [heq1, heq2] at hbs + exact hbs +theorem step_S'_R2 (i n : Nat) (hn : 3 ^ i * 2 - i ≤ n /\ n ≤ 3 ^ i * 6 - i - 10) + (hp : n % 2 = (i + 1) % 2) : + (S' n) [target_tm]⊢⁺ (S' (3 ^ i * 12 - 1)) := by + have hp3 := TrajectoryGraph.succ_le_three_pow i + have hpn := P_n i + set c := (n - (3 ^ i * 2 - i - 2)) / 2 + have hc_eq : c + (2 + (3 ^ i * 2 - 4 - c)) = 3 ^ i * 2 - 2 := by omega + rw [<- hc_eq] at hpn + have hbs := step_S'_odd (3 ^ i * 2 - i - 2) (3 ^ i * 2 - 4 - c) c hpn + have heq1 : 3 ^ i * 2 - i - 2 + c * 2 + 1 = n := by omega + have heq2 : 23 + (3 ^ i * 2 - 4 - c) * 6 + c * 6 = 3 ^ i * 12 - 1 := by omega + rw [heq1, heq2] at hbs + exact hbs +theorem step_S1_two (b : Nat) : + (S1 0 b 2) [target_tm]⊢* (S1 0 2 (b + 4)) := by + unfold S1 + simp only [rep11_zero, rep11_succ] + have h1 : (((1 : Fin 2) >> d0) <{{C}} rep01 b ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : + Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> d0)) + [target_tm]⊢⁺ (d0 {{B}}> rep01 b ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> d0)) := by execute + have h2 := shift_B_rep01 b d0 ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : + Fin 2) >> (1 : Fin 2) >> d0) + have h3 : (rep01 b d0 {{B}}> ((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin + 2) >> (1 : Fin 2) >> d0)) + [target_tm]⊢⁺ (rep01 (b + 1) d0 <{{C}} ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin + 2) >> d0)) := by + simp only [rep01_succ] + execute + have h4 := shift_C_rep01 (b + 1) d0 ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + d0) + have h5 : (d0 <{{C}} rep01 (b + 1) ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + d0)) + [target_tm]⊢⁺ (d0 {{A}}> ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> rep01 (b + 2) ((0 : Fin + 2) >> (1 : Fin 2) >> d0))) := by + rw [rep01_succ_inner (b + 1) ((0 : Fin 2) >> (1 : Fin 2) >> d0)] + execute + have h6 := shift_A_rep01_to_rep11 (b + 2) d0 ((0 : Fin 2) >> (1 : Fin 2) >> d0) + have h7 : (rep11 (b + 2) d0 {{A}}> ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 + : Fin 2) >> d0)) + [target_tm]⊢⁺ (rep11 (b + 5) d0 <{{A}} ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin + 2) >> d0)) := by + simp only [rep11_succ] + execute + have h8 := shift_A_rep11 (b + 5) d0 ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + d0) + have h9 : (d0 <{{A}} rep11 (b + 5) ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + d0)) + [target_tm]⊢⁺ (((1 : Fin 2) >> d0) <{{C}} rep01 2 (rep11 (b + 4) ((0 : Fin 2) >> (1 : Fin 2) + >> d0))) := by + rw [<- rep11_succ_inner (b + 5) ((0 : Fin 2) >> (1 : Fin 2) >> d0)] + simp only [rep11_succ, rep01_succ, rep01_zero] + execute + exact reachesStar_trans (reachesPlus_to_reachesStar h1) (reachesStar_trans h2 (reachesStar_trans + (reachesPlus_to_reachesStar h3) (reachesStar_trans h4 (reachesStar_trans + (reachesPlus_to_reachesStar h5) (reachesStar_trans h6 (reachesStar_trans + (reachesPlus_to_reachesStar h7) (reachesStar_trans h8 (reachesPlus_to_reachesStar h9)))))))) +theorem init_reaches_S'_18 : (init []) [target_tm]⊢* (S' 18) := by + have h1 : (init []) [target_tm]⊢⁺ (S3 0 1) := by + change (d0 {{A}}> d0) [target_tm]⊢⁺ (S3 0 1) + unfold S3 + simp only [rep11_zero, rep01_succ, rep01_zero] + execute + have h2 := reachesPlus_to_reachesStar (Ov3 1) + have h3 := reachesPlus_to_reachesStar (step_S'_R1 1 3 ⟨by decide, by decide⟩ (by decide)) + have h4 := step_S1_zero_left 2 10 + have h5 := step_S1_iter 4 0 2 2 + have h6 := step_S1_two 14 + exact reachesStar_trans (reachesPlus_to_reachesStar h1) (reachesStar_trans h2 (reachesStar_trans + h3 (reachesStar_trans h4 (reachesStar_trans h5 h6)))) +theorem reachesPlus_of_macroStep (x y : Nat) (h : TrajectoryGraph.MacroStep x y) : + (S' x) [target_tm]⊢⁺ (S' y) := by + cases h with + | R1 i _ hn hp => + exact step_S'_R1 i x hn hp + | R2 i _ hn hp => + have h1 := step_S'_R2 i x hn hp + have heq : 3 ^ i * 12 - 1 = TrajectoryGraph.A (i + 1) := by + unfold TrajectoryGraph.A + rw [Nat.pow_succ] + omega + rw [heq] at h1 + exact h1 +theorem reachesPlus_of_macroReaches (x y : Nat) (h : TrajectoryGraph.MacroReaches x y) : + (S' x) [target_tm]⊢⁺ (S' y) := by + induction h with + | one x y hs => exact reachesPlus_of_macroStep x y hs + | cons x y z hs _ ih => exact reachesPlus_trans (reachesPlus_of_macroStep x y hs) ih +theorem multiStep_isSome_of_add {c c' : Cfg (Fin 2) (Fin 6)} {j d : Nat} + (h : multiStep target_tm c (j + d) = some c') : + (multiStep target_tm c j).isSome := by + rw [multiStep_add_bind] at h + cases h_j : multiStep target_tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl +theorem init_reaches_A_7 : (init []) [target_tm]⊢* (S' (TrajectoryGraph.A 7)) := by + have h0 := init_reaches_S'_18 + have h1 := reachesPlus_to_reachesStar (step_S'_R1 2 18 ⟨by decide, by decide⟩ (by decide)) + have h2 := reachesPlus_to_reachesStar (step_S'_R2 2 39 ⟨by decide, by decide⟩ (by decide)) + have h3 := reachesPlus_to_reachesStar (step_S'_R1 3 107 ⟨by decide, by decide⟩ (by decide)) + have h4 := reachesPlus_to_reachesStar (step_S'_R2 3 138 ⟨by decide, by decide⟩ (by decide)) + have h5 := reachesPlus_to_reachesStar (step_S'_R2 4 323 ⟨by decide, by decide⟩ (by decide)) + have h6 := reachesPlus_to_reachesStar (step_S'_R1 5 971 ⟨by decide, by decide⟩ (by decide)) + have h7 := reachesPlus_to_reachesStar (step_S'_R1 5 1219 ⟨by decide, by decide⟩ (by decide)) + have h8 := reachesPlus_to_reachesStar (step_S'_R1 5 1343 ⟨by decide, by decide⟩ (by decide)) + have h9 := reachesPlus_to_reachesStar (step_S'_R1 5 1405 ⟨by decide, by decide⟩ (by decide)) + have h10 := reachesPlus_to_reachesStar (step_S'_R2 5 1436 ⟨by decide, by decide⟩ (by decide)) + have h11 := reachesPlus_to_reachesStar (step_S'_R2 6 2915 ⟨by decide, by decide⟩ (by decide)) + exact reachesStar_trans h0 (reachesStar_trans h1 (reachesStar_trans h2 (reachesStar_trans h3 + (reachesStar_trans h4 (reachesStar_trans h5 (reachesStar_trans h6 (reachesStar_trans h7 + (reachesStar_trans h8 (reachesStar_trans h9 (reachesStar_trans h10 h11)))))))))) +theorem exists_unbounded_steps (hc : TrajectoryGraph.core) (m : Nat) : + ∃ N ≥ m, ∃ k, multiStep target_tm (init []) N = some (S' (TrajectoryGraph.A (7 + k))) := by + induction m with + | zero => + obtain ⟨n0, hn0⟩ := init_reaches_A_7 + exact ⟨n0, Nat.zero_le n0, 0, hn0⟩ + | succ m ih => + obtain ⟨N, hN, k, h_ms⟩ := ih + have hlayer := reachesPlus_of_macroReaches (TrajectoryGraph.A (7 + k)) (TrajectoryGraph.A (7 + k + + 1)) (TrajectoryGraph.macroReaches_next_layer (7 + k) hc (by omega)) + obtain ⟨d, hd_pos, hd⟩ := hlayer + refine ⟨N + d, by omega, k + 1, ?_⟩ + have heq : 7 + (k + 1) = 7 + k + 1 := by omega + rw [heq] + exact multiStep_trans_explicit target_tm _ _ _ N d h_ms hd +theorem nonhalt_of_core (hc : TrajectoryGraph.core) : IsDoesNotHalt target_tm := by + intro cfg h_reach + rcases h_reach with ⟨n, hn⟩ + rcases exists_unbounded_steps hc (n + 1) with ⟨N, hN, k, h_N⟩ + have h_eq : (n + 1) + (N - (n + 1)) = N := Nat.add_sub_of_le hN + rw [<- h_eq] at h_N + have h_some := multiStep_isSome_of_add h_N + rw [multiStep_succ_bind, hn] at h_some + exact h_some + + +end Solution + +public section + +/-- Main non-halting theorem for `1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RB---`. -/ +theorem is_not_halt : IsNotHalt target := + Solution.nonhalt_of_core (Solution.CoreBridge.core Solution.LargeExclusion.exclusion) + +end + +end BusyBeaver.Pomme.NonHalt diff --git a/BusyBeaver/BB6/README.md b/BusyBeaver/BB6/README.md index 9a093773..15830e7f 100644 --- a/BusyBeaver/BB6/README.md +++ b/BusyBeaver/BB6/README.md @@ -1,6 +1,6 @@ # Busy Beaver 6 Holdouts (`BusyBeaver/BB6/`) -This directory contains formal Lean 4 specifications and kernel-verified Collatz-like reductions for 54 Busy Beaver 6 (`BB(6)`, 6-state 2-symbol) holdout Turing machines (the [A6 nonhalting certificate](../artifacts/a6/README.md) and 53 closed-pattern holdouts), together with 35 stacked, odometer, and transducer holdouts (15 machines formalized under `HasStackReduction`, `HasOdometerReduction`, and `HasTransducerReduction`—12 `bbchallenge` Wiki machines and 3 Halving Tower holdouts—plus 20 open acceleration problems under `IsValidAcceleration`, 13 with higher-level accelerations) in **[`BusyBeaver/BB6/Accelerations/`](./Accelerations/README.md)** (89 `BB(6)` holdouts total). Each machine module in `BusyBeaver/BB6/` below exposes both **Level A** (`ps`, `is_closed_pattern_set`, `has_collatz_reduction`) and **Level B** (`State`, `start`, `encode`, `next`, `is_valid_acceleration`, `isHalt_iff_acceleration`), and 33 modules (all 20 novel discovery modules together with 13 multi-family or multi-counter wiki/busycoq holdouts) additionally expose a higher-level Collatz-like acceleration (`HighLevelState`, `highLevelStart`, `highLevelEncode`, `highLevelNext`, `is_valid_highLevel_acceleration`, `isHalt_iff_highLevel_acceleration`, `acceleration_iff_highLevel_acceleration`); see [`BusyBeaver/README.md`](../README.md) for definitions of the behavioral predicates and [`BusyBeaver/BB6/Accelerations/README.md`](./Accelerations/README.md) for the stacked, odometer, and transducer formalizations and open problem statements. +This directory contains formal Lean 4 specifications and kernel-verified Collatz-like reductions for 54 Busy Beaver 6 (`BB(6)`, 6-state 2-symbol) holdout Turing machines (the [A6 nonhalting certificate](../../artifacts/a6/README.md) and 53 closed-pattern holdouts, including a Baker-free 2-adic Laurent-determinant non-halting proof for `1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RB---`), together with 35 stacked, odometer, and transducer holdouts (15 machines formalized under `HasStackReduction`, `HasOdometerReduction`, and `HasTransducerReduction`—12 `bbchallenge` Wiki machines and 3 Halving Tower holdouts—plus 20 open acceleration problems under `IsValidAcceleration`, 13 with higher-level accelerations) in **[`BusyBeaver/BB6/Accelerations/`](./Accelerations/README.md)** (89 `BB(6)` holdouts total), alongside 180 resolved `BB(6)` holdouts categorized under **[`BusyBeaver/BB6/Halt/`](./Halt/)** (31 kernel-verified halting machines, `IsHalt`) and **[`BusyBeaver/BB6/NonHalt/`](./NonHalt/)** (149 kernel-verified non-halting machines, `IsNotHalt`), resolving machines from the `bbchallenge` holdout set and `busycoq` formalizations (269 distinct `BB(6)` machines overall). Each machine module in `BusyBeaver/BB6/` below exposes both **Level A** (`ps`, `is_closed_pattern_set`, `has_collatz_reduction`) and **Level B** (`State`, `start`, `encode`, `next`, `is_valid_acceleration`, `isHalt_iff_acceleration`), and 33 modules (all 20 novel discovery modules together with 13 multi-family or multi-counter wiki/busycoq holdouts) additionally expose a higher-level Collatz-like acceleration (`HighLevelState`, `highLevelStart`, `highLevelEncode`, `highLevelNext`, `is_valid_highLevel_acceleration`, `isHalt_iff_highLevel_acceleration`, `acceleration_iff_highLevel_acceleration`); see [`BusyBeaver/README.md`](../README.md) for definitions of the behavioral predicates and [`BusyBeaver/BB6/Accelerations/README.md`](./Accelerations/README.md) for the stacked, odometer, and transducer formalizations and open problem statements. The A6 module exports a closed blank-tape `IsNotHalt` proof using a checked entry certificate and a universal return family; it has a separate @@ -40,7 +40,7 @@ entry certificate and a universal return family; it has a separate | `1RB1LA_0LC0RC_1LE1RD_1RE1RC_1LF0LA_---1LE` | `6` | `2` | `IsClosedPatternSet`, `HasCollatzReduction`, `IsValidAcceleration` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LA_0LC0RC_1LE1RD_1RE1RC_1LF0LA_---1LE) (*The Sheep Machine*) | [`M_1RB1LA_0LC0RC_1LE1RD_1RE1RC_1LF0LA_HHH1LE.lean`](./M_1RB1LA_0LC0RC_1LE1RD_1RE1RC_1LF0LA_HHH1LE.lean) | | `1RB1LA_1LC0RE_1LF1LD_0RB0LA_1RC1RE_---0LD` | `6` | `2` | `IsClosedPatternSet`, `HasCollatzReduction`, `IsValidAcceleration` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LA_1LC0RE_1LF1LD_0RB0LA_1RC1RE_---0LD) (*Space Needle* / BMO6) | [`M_1RB1LA_1LC0RE_1LF1LD_0RB0LA_1RC1RE_HHH0LD.lean`](./M_1RB1LA_1LC0RE_1LF1LD_0RB0LA_1RC1RE_HHH0LD.lean) | | `1RB1LA_1LC0RE_1LF1LD_1RE0LC_1LB1RA_---0LA` | `6` | `2` | `IsClosedPatternSet`, `HasCollatzReduction`, `IsValidAcceleration` | — | [`M_1RB1LA_1LC0RE_1LF1LD_1RE0LC_1LB1RA_HHH0LA.lean`](./M_1RB1LA_1LC0RE_1LF1LD_1RE0LC_1LB1RA_HHH0LA.lean) | -| `1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RB---` | `6` | `2` | `IsClosedPatternSet`, `HasCollatzReduction`, `IsValidAcceleration` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RB---) (*Pomme* / Baker machine; **resolved non-halting**) | [`M_1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RBHHH.lean`](./M_1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RBHHH.lean) | +| `1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RB---` | `6` | `2` | `IsClosedPatternSet`, `HasCollatzReduction`, `IsValidAcceleration`, `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RB---) (*Pomme* / Baker machine; **resolved non-halting** via Baker-free 2-adic Laurent-determinant) | [`M_1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RBHHH.lean`](./M_1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RBHHH.lean) | | `1RB1LC_1LC1RD_1LA0LB_0RB1RE_1RF0RA_---0RC` | `6` | `2` | `IsClosedPatternSet`, `HasCollatzReduction`, `IsValidAcceleration` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LC_1LC1RD_1LA0LB_0RB1RE_1RF0RA_---0RC) | [`M_1RB1LC_1LC1RD_1LA0LB_0RB1RE_1RF0RA_HHH0RC.lean`](./M_1RB1LC_1LC1RD_1LA0LB_0RB1RE_1RF0RA_HHH0RC.lean) | | `1RB1LC_1RC0LD_1LA0RB_1LB1LE_1RF0LA_---0RE` | `6` | `2` | `IsClosedPatternSet`, `HasCollatzReduction`, `IsValidAcceleration` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LC_1RC0LD_1LA0RB_1LB1LE_1RF0LA_---0RE) (redirects to BMO5) | [`M_1RB1LC_1RC0LD_1LA0RB_1LB1LE_1RF0LA_HHH0RE.lean`](./M_1RB1LC_1RC0LD_1LA0RB_1LB1LE_1RF0LA_HHH0RE.lean) | | `1RB1LC_1RC0RF_1RD0LB_1RE0LD_1LF---_0RA1LA` | `6` | `2` | `IsClosedPatternSet`, `HasCollatzReduction`, `IsValidAcceleration` | — | [`M_1RB1LC_1RC0RF_1RD0LB_1RE0LD_1LFHHH_0RA1LA.lean`](./M_1RB1LC_1RC0RF_1RD0LB_1RE0LD_1LFHHH_0RA1LA.lean) | @@ -1020,3 +1020,203 @@ T(P(a, d)) = \begin{cases} $$ Under $(a, d) = (c, b + 1)$ (for $d \ge 1$), this map is identical to that of [`1RB1RF_1LC---_1LE1RD_1RA0RC_0LF0LA_0LD0RB`](./M_1RB1RF_1LCHHH_1LE1RD_1RA0RC_0LF0LA_0LD0RB.lean), which starts from $(b, c) = (1, 0)$ (corresponding to $(a, d) = (0, 2)$). + + +## Resolved `BB(6)` Machines + +This directory formalizes 181 resolved `BB(6)` Turing machines reproducing community proofs and `busycoq` results directly verified in Lean 4 without axioms (`sorry`-free and `native_decide`-free kernel verification): + +- **[`BusyBeaver/BB6/Halt/`](./Halt/)**: 31 resolved halting machines (`IsHalt`), each reaching a halting configuration from `init []` with verified multi-step traces. +- **[`BusyBeaver/BB6/NonHalt/`](./NonHalt/)**: 150 resolved non-halting machines (`IsNotHalt`), verified via inductive invariants, simulated cycles, or closed-set reachability certificates. + +### Resolved BB(6) Halt Machines (31 machines) + +| Machine (`bbchallenge` RLE) | States | Symbols | Proved Property | Origin / Wiki | Lean 4 Proof | +| :--- | :--- | :--- | :--- | :--- | :--- | +| `1RB0LD_1RC0RF_1LC1LA_0LE---_1LF0RB_0RC0RE` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LD_1RC0RF_1LC1LA_0LE---_1LF0RB_0RC0RE) (Community) | [`M_1RB0LD_1RC0RF_1LC1LA_0LEHHH_1LF0RB_0RC0RE.lean`](./Halt/M_1RB0LD_1RC0RF_1LC1LA_0LEHHH_1LF0RB_0RC0RE.lean) | +| `1RB0LC_1LC0RE_1RF1LD_1LA0LB_1RD1RA_1LB---` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LC_1LC0RE_1RF1LD_1LA0LB_1RD1RA_1LB---) | [`M_1RB0LC_1LC0RE_1RF1LD_1LA0LB_1RD1RA_1LBHHH.lean`](./Halt/M_1RB0LC_1LC0RE_1RF1LD_1LA0LB_1RD1RA_1LBHHH.lean) | +| `1RB0RE_1RC0RA_0LD0LB_0LA1LE_1LC1LF_0LA---` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RE_1RC0RA_0LD0LB_0LA1LE_1LC1LF_0LA---) | [`M_1RB0RE_1RC0RA_0LD0LB_0LA1LE_1LC1LF_0LAHHH.lean`](./Halt/M_1RB0RE_1RC0RA_0LD0LB_0LA1LE_1LC1LF_0LAHHH.lean) | +| `1RB1RC_1LC0LF_1RF0LD_0RE1LB_1RC---_1LD0RA` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RC_1LC0LF_1RF0LD_0RE1LB_1RC---_1LD0RA) | [`M_1RB1RC_1LC0LF_1RF0LD_0RE1LB_1RCHHH_1LD0RA.lean`](./Halt/M_1RB1RC_1LC0LF_1RF0LD_0RE1LB_1RCHHH_1LD0RA.lean) | +| `1RB1RF_0RC0RE_0RD1RA_1LE0LA_1LB0LD_0RD---` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RF_0RC0RE_0RD1RA_1LE0LA_1LB0LD_0RD---) | [`M_1RB1RF_0RC0RE_0RD1RA_1LE0LA_1LB0LD_0RDHHH.lean`](./Halt/M_1RB1RF_0RC0RE_0RD1RA_1LE0LA_1LB0LD_0RDHHH.lean) | +| `1RB0LB_0LC0RE_1LA1LD_0LB1LD_1RA0RF_1RA---` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LB_0LC0RE_1LA1LD_0LB1LD_1RA0RF_1RA---) | [`M_1RB0LB_0LC0RE_1LA1LD_0LB1LD_1RA0RF_1RAHHH.lean`](./Halt/M_1RB0LB_0LC0RE_1LA1LD_0LB1LD_1RA0RF_1RAHHH.lean) | +| `1RB0LB_0LC0RE_1LA1LD_0LB1LF_1RA1RD_0LB---` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LB_0LC0RE_1LA1LD_0LB1LF_1RA1RD_0LB---) | [`M_1RB0LB_0LC0RE_1LA1LD_0LB1LF_1RA1RD_0LBHHH.lean`](./Halt/M_1RB0LB_0LC0RE_1LA1LD_0LB1LF_1RA1RD_0LBHHH.lean) | +| `1RB0LB_0LC0RE_1LA1LD_0LB1RF_1RA1RD_---1LC` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LB_0LC0RE_1LA1LD_0LB1RF_1RA1RD_---1LC) | [`M_1RB0LB_0LC0RE_1LA1LD_0LB1RF_1RA1RD_HHH1LC.lean`](./Halt/M_1RB0LB_0LC0RE_1LA1LD_0LB1RF_1RA1RD_HHH1LC.lean) | +| `1RB0LD_1LC0RD_1RE0RA_1LE0RF_1LA1RC_0LB---` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LD_1LC0RD_1RE0RA_1LE0RF_1LA1RC_0LB---) | [`M_1RB0LD_1LC0RD_1RE0RA_1LE0RF_1LA1RC_0LBHHH.lean`](./Halt/M_1RB0LD_1LC0RD_1RE0RA_1LE0RF_1LA1RC_0LBHHH.lean) | +| `1RB0LE_0RC0RB_1LD0LD_1RA1LC_---1LF_1LA0LC` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LE_0RC0RB_1LD0LD_1RA1LC_---1LF_1LA0LC) | [`M_1RB0LE_0RC0RB_1LD0LD_1RA1LC_HHH1LF_1LA0LC.lean`](./Halt/M_1RB0LE_0RC0RB_1LD0LD_1RA1LC_HHH1LF_1LA0LC.lean) | +| `1RB0LF_1RC---_1LD0RF_1RA0LE_0LD1LD_0RD0RB` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LF_1RC---_1LD0RF_1RA0LE_0LD1LD_0RD0RB) | [`M_1RB0LF_1RCHHH_1LD0RF_1RA0LE_0LD1LD_0RD0RB.lean`](./Halt/M_1RB0LF_1RCHHH_1LD0RF_1RA0LE_0LD1LD_0RD0RB.lean) | +| `1RB0RA_1LC0RE_1LD0LC_1RA1LE_1LC0LF_0RA---` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RA_1LC0RE_1LD0LC_1RA1LE_1LC0LF_0RA---) | [`M_1RB0RA_1LC0RE_1LD0LC_1RA1LE_1LC0LF_0RAHHH.lean`](./Halt/M_1RB0RA_1LC0RE_1LD0LC_1RA1LE_1LC0LF_0RAHHH.lean) | +| `1RB0RB_1RC0RD_1LD1RC_1RF0LE_1LC1LE_---0RA` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RB_1RC0RD_1LD1RC_1RF0LE_1LC1LE_---0RA) | [`M_1RB0RB_1RC0RD_1LD1RC_1RF0LE_1LC1LE_HHH0RA.lean`](./Halt/M_1RB0RB_1RC0RD_1LD1RC_1RF0LE_1LC1LE_HHH0RA.lean) | +| `1RB0RC_1LC1RF_1RA1LD_1RD0LE_1LD1LC_0RE---` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RC_1LC1RF_1RA1LD_1RD0LE_1LD1LC_0RE---) | [`M_1RB0RC_1LC1RF_1RA1LD_1RD0LE_1LD1LC_0REHHH.lean`](./Halt/M_1RB0RC_1LC1RF_1RA1LD_1RD0LE_1LD1LC_0REHHH.lean) | +| `1RB0RC_1RC0LD_1LD1RA_1LF0LE_---0RD_1LB0LA` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RC_1RC0LD_1LD1RA_1LF0LE_---0RD_1LB0LA) | [`M_1RB0RC_1RC0LD_1LD1RA_1LF0LE_HHH0RD_1LB0LA.lean`](./Halt/M_1RB0RC_1RC0LD_1LD1RA_1LF0LE_HHH0RD_1LB0LA.lean) | +| `1RB0RD_1LC0RA_---1RD_1RA1LE_1RC0LF_1LE0LB` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RD_1LC0RA_---1RD_1RA1LE_1RC0LF_1LE0LB) | [`M_1RB0RD_1LC0RA_HHH1RD_1RA1LE_1RC0LF_1LE0LB.lean`](./Halt/M_1RB0RD_1LC0RA_HHH1RD_1RA1LE_1RC0LF_1LE0LB.lean) | +| `1RB0RD_1LC1RE_1LA0LD_0RE0RF_1LC1RA_0LE---` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RD_1LC1RE_1LA0LD_0RE0RF_1LC1RA_0LE---) | [`M_1RB0RD_1LC1RE_1LA0LD_0RE0RF_1LC1RA_0LEHHH.lean`](./Halt/M_1RB0RD_1LC1RE_1LA0LD_0RE0RF_1LC1RA_0LEHHH.lean) | +| `1RB0RD_1RC0LC_1RE1RA_0LD1LA_0LF0LD_0RE---` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RD_1RC0LC_1RE1RA_0LD1LA_0LF0LD_0RE---) | [`M_1RB0RD_1RC0LC_1RE1RA_0LD1LA_0LF0LD_0REHHH.lean`](./Halt/M_1RB0RD_1RC0LC_1RE1RA_0LD1LA_0LF0LD_0REHHH.lean) | +| `1RB0RF_0RC1RD_0LD---_1LE1RA_1LA0LF_0RD0RC` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RF_0RC1RD_0LD---_1LE1RA_1LA0LF_0RD0RC) | [`M_1RB0RF_0RC1RD_0LDHHH_1LE1RA_1LA0LF_0RD0RC.lean`](./Halt/M_1RB0RF_0RC1RD_0LDHHH_1LE1RA_1LA0LF_0RD0RC.lean) | +| `1RB0RF_1LC1RE_1LD0LC_0LE0RE_1RA1LD_1RB---` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RF_1LC1RE_1LD0LC_0LE0RE_1RA1LD_1RB---) | [`M_1RB0RF_1LC1RE_1LD0LC_0LE0RE_1RA1LD_1RBHHH.lean`](./Halt/M_1RB0RF_1LC1RE_1LD0LC_0LE0RE_1RA1LD_1RBHHH.lean) | +| `1RB0RF_1RC0RB_1LD1RA_1LE0LD_1RB0LA_0LD---` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RF_1RC0RB_1LD1RA_1LE0LD_1RB0LA_0LD---) | [`M_1RB0RF_1RC0RB_1LD1RA_1LE0LD_1RB0LA_0LDHHH.lean`](./Halt/M_1RB0RF_1RC0RB_1LD1RA_1LE0LD_1RB0LA_0LDHHH.lean) | +| `1RB1LA_0LB1LC_1RD0LD_0LA0RE_1RC1RF_0LD---` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LA_0LB1LC_1RD0LD_0LA0RE_1RC1RF_0LD---) | [`M_1RB1LA_0LB1LC_1RD0LD_0LA0RE_1RC1RF_0LDHHH.lean`](./Halt/M_1RB1LA_0LB1LC_1RD0LD_0LA0RE_1RC1RF_0LDHHH.lean) | +| `1RB1LC_1RC1RE_0LF1RD_0RA0LD_---1RC_1LA0LA` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LC_1RC1RE_0LF1RD_0RA0LD_---1RC_1LA0LA) | [`M_1RB1LC_1RC1RE_0LF1RD_0RA0LD_HHH1RC_1LA0LA.lean`](./Halt/M_1RB1LC_1RC1RE_0LF1RD_0RA0LD_HHH1RC_1LA0LA.lean) | +| `1RB1RA_1LC0RD_1LD1LB_1RA0LE_0LB1LF_1RC---` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RA_1LC0RD_1LD1LB_1RA0LE_0LB1LF_1RC---) | [`M_1RB1RA_1LC0RD_1LD1LB_1RA0LE_0LB1LF_1RCHHH.lean`](./Halt/M_1RB1RA_1LC0RD_1LD1LB_1RA0LE_0LB1LF_1RCHHH.lean) | +| `1RB1RA_1LC0RE_1LD1LB_1RA0LE_1RA0LF_0LB---` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RA_1LC0RE_1LD1LB_1RA0LE_1RA0LF_0LB---) | [`M_1RB1RA_1LC0RE_1LD1LB_1RA0LE_1RA0LF_0LBHHH.lean`](./Halt/M_1RB1RA_1LC0RE_1LD1LB_1RA0LE_1RA0LF_0LBHHH.lean) | +| `1RB1RC_1LC1RD_1LD0LE_1LA0LD_0LB1RF_---0LF` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RC_1LC1RD_1LD0LE_1LA0LD_0LB1RF_---0LF) | [`M_1RB1RC_1LC1RD_1LD0LE_1LA0LD_0LB1RF_HHH0LF.lean`](./Halt/M_1RB1RC_1LC1RD_1LD0LE_1LA0LD_0LB1RF_HHH0LF.lean) | +| `1RB1RE_1LC0LB_1LD1LC_0RA1RF_1RD1RE_---1LB` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RE_1LC0LB_1LD1LC_0RA1RF_1RD1RE_---1LB) | [`M_1RB1RE_1LC0LB_1LD1LC_0RA1RF_1RD1RE_HHH1LB.lean`](./Halt/M_1RB1RE_1LC0LB_1LD1LC_0RA1RF_1RD1RE_HHH1LB.lean) | +| `1RB1RE_1LC0RC_0RA0LD_1LB1LE_0RC1LF_---1RA` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RE_1LC0RC_0RA0LD_1LB1LE_0RC1LF_---1RA) | [`M_1RB1RE_1LC0RC_0RA0LD_1LB1LE_0RC1LF_HHH1RA.lean`](./Halt/M_1RB1RE_1LC0RC_0RA0LD_1LB1LE_0RC1LF_HHH1RA.lean) | +| `1RB1RE_1RC1LE_1LD0RA_1LF0LA_1LB0LC_---1RA` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RE_1RC1LE_1LD0RA_1LF0LA_1LB0LC_---1RA) | [`M_1RB1RE_1RC1LE_1LD0RA_1LF0LA_1LB0LC_HHH1RA.lean`](./Halt/M_1RB1RE_1RC1LE_1LD0RA_1LF0LA_1LB0LC_HHH1RA.lean) | +| `1RB1RF_1LC0RA_---0LD_1RE1LD_0LF0LB_1RA1LE` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RF_1LC0RA_---0LD_1RE1LD_0LF0LB_1RA1LE) | [`M_1RB1RF_1LC0RA_HHH0LD_1RE1LD_0LF0LB_1RA1LE.lean`](./Halt/M_1RB1RF_1LC0RA_HHH0LD_1RE1LD_0LF0LB_1RA1LE.lean) | +| `1RB---_1LC1RE_1LA0LD_0RE1LC_1LC1RF_1RB0RD` | `6` | `2` | `IsHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB---_1LC1RE_1LA0LD_0RE1LC_1LC1RF_1RB0RD) | [`M_1RBHHH_1LC1RE_1LA0LD_0RE1LC_1LC1RF_1RB0RD.lean`](./Halt/M_1RBHHH_1LC1RE_1LA0LD_0RE1LC_1LC1RF_1RB0RD.lean) | + +### Resolved BB(6) NonHalt Machines (150 machines) + +| Machine (`bbchallenge` RLE) | States | Symbols | Proved Property | Origin / Wiki | Lean 4 Proof | +| :--- | :--- | :--- | :--- | :--- | :--- | +| `1RB0LE_1LC1RA_---1LD_0RB1LF_1RD1LA_0LA0RD` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LE_1LC1RA_---1LD_0RB1LF_1RD1LA_0LA0RD) (Community) | [`M_1RB0LE_1LC1RA_HHH1LD_0RB1LF_1RD1LA_0LA0RD.lean`](./NonHalt/M_1RB0LE_1LC1RA_HHH1LD_0RB1LF_1RD1LA_0LA0RD.lean) | +| `1RB0RD_0LC1RA_0RA1LB_1RE1LB_1LF1LB_---1LE` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RD_0LC1RA_0RA1LB_1RE1LB_1LF1LB_---1LE) (Community) | [`M_1RB0RD_0LC1RA_0RA1LB_1RE1LB_1LF1LB_HHH1LE.lean`](./NonHalt/M_1RB0RD_0LC1RA_0RA1LB_1RE1LB_1LF1LB_HHH1LE.lean) | +| `1RB0LC_1LC0RB_0LE0LD_1LC---_0RA1LF_1LA1LF` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LC_1LC0RB_0LE0LD_1LC---_0RA1LF_1LA1LF) | [`M_1RB0LC_1LC0RB_0LE0LD_1LCHHH_0RA1LF_1LA1LF.lean`](./NonHalt/M_1RB0LC_1LC0RB_0LE0LD_1LCHHH_0RA1LF_1LA1LF.lean) | +| `1RB0RA_0RC0LD_1LA1RF_1LE1LD_1LB1RE_---1RA` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RA_0RC0LD_1LA1RF_1LE1LD_1LB1RE_---1RA) | [`M_1RB0RA_0RC0LD_1LA1RF_1LE1LD_1LB1RE_HHH1RA.lean`](./NonHalt/M_1RB0RA_0RC0LD_1LA1RF_1LE1LD_1LB1RE_HHH1RA.lean) | +| `1RB0RA_0RC0LE_1LD1RF_1LB1RD_1LD1LE_---1RA` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RA_0RC0LE_1LD1RF_1LB1RD_1LD1LE_---1RA) | [`M_1RB0RA_0RC0LE_1LD1RF_1LB1RD_1LD1LE_HHH1RA.lean`](./NonHalt/M_1RB0RA_0RC0LE_1LD1RF_1LB1RD_1LD1LE_HHH1RA.lean) | +| `1RB0RA_1RC0LC_0LD1RF_1RA1LE_1LD0LB_0RE---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RA_1RC0LC_0LD1RF_1RA1LE_1LD0LB_0RE---) | [`M_1RB0RA_1RC0LC_0LD1RF_1RA1LE_1LD0LB_0REHHH.lean`](./NonHalt/M_1RB0RA_1RC0LC_0LD1RF_1RA1LE_1LD0LB_0REHHH.lean) | +| `1RB1RA_1RC1LB_0LD0RA_1RF1LE_---1LF_1LC0LF` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RA_1RC1LB_0LD0RA_1RF1LE_---1LF_1LC0LF) | [`M_1RB1RA_1RC1LB_0LD0RA_1RF1LE_HHH1LF_1LC0LF.lean`](./NonHalt/M_1RB1RA_1RC1LB_0LD0RA_1RF1LE_HHH1LF_1LC0LF.lean) | +| `1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LF---_1LA1LC` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LF---_1LA1LC) | [`M_1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC.lean`](./NonHalt/M_1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC.lean) | +| `1RB0LA_0RC1LE_0RD1RE_1LA1RF_1RB0LD_1RC---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LA_0RC1LE_0RD1RE_1LA1RF_1RB0LD_1RC---) | [`M_1RB0LA_0RC1LE_0RD1RE_1LA1RF_1RB0LD_1RCHHH.lean`](./NonHalt/M_1RB0LA_0RC1LE_0RD1RE_1LA1RF_1RB0LD_1RCHHH.lean) | +| `1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RC---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RC---) | [`M_1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RCHHH.lean`](./NonHalt/M_1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RCHHH.lean) | +| `1RB0LB_1LC1LB_1RD1LA_0RE0RE_0RA1RF_---1RD` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LB_1LC1LB_1RD1LA_0RE0RE_0RA1RF_---1RD) | [`M_1RB0LB_1LC1LB_1RD1LA_0RE0RE_0RA1RF_HHH1RD.lean`](./NonHalt/M_1RB0LB_1LC1LB_1RD1LA_0RE0RE_0RA1RF_HHH1RD.lean) | +| `1RB0LC_0LC1RE_1LD1LC_1LA1RD_---1RF_0RA0RF` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LC_0LC1RE_1LD1LC_1LA1RD_---1RF_0RA0RF) | [`M_1RB0LC_0LC1RE_1LD1LC_1LA1RD_HHH1RF_0RA0RF.lean`](./NonHalt/M_1RB0LC_0LC1RE_1LD1LC_1LA1RD_HHH1RF_0RA0RF.lean) | +| `1RB0LC_1LA0RE_0RD0LA_1RE1RA_0LD1RF_0RB---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LC_1LA0RE_0RD0LA_1RE1RA_0LD1RF_0RB---) | [`M_1RB0LC_1LA0RE_0RD0LA_1RE1RA_0LD1RF_0RBHHH.lean`](./NonHalt/M_1RB0LC_1LA0RE_0RD0LA_1RE1RA_0LD1RF_0RBHHH.lean) | +| `1RB0LC_1LA0RE_0RD1LF_1LC1LB_0LD0RB_0LA---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LC_1LA0RE_0RD1LF_1LC1LB_0LD0RB_0LA---) | [`M_1RB0LC_1LA0RE_0RD1LF_1LC1LB_0LD0RB_0LAHHH.lean`](./NonHalt/M_1RB0LC_1LA0RE_0RD1LF_1LC1LB_0LD0RB_0LAHHH.lean) | +| `1RB0LC_1LC0RE_1LA1LD_1LA1LB_0RF1RA_---0RE` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LC_1LC0RE_1LA1LD_1LA1LB_0RF1RA_---0RE) | [`M_1RB0LC_1LC0RE_1LA1LD_1LA1LB_0RF1RA_HHH0RE.lean`](./NonHalt/M_1RB0LC_1LC0RE_1LA1LD_1LA1LB_0RF1RA_HHH0RE.lean) | +| `1RB0LC_1LC0RE_1LA1LD_1LA1LF_0RB1RA_1LC---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LC_1LC0RE_1LA1LD_1LA1LF_0RB1RA_1LC---) | [`M_1RB0LC_1LC0RE_1LA1LD_1LA1LF_0RB1RA_1LCHHH.lean`](./NonHalt/M_1RB0LC_1LC0RE_1LA1LD_1LA1LF_0RB1RA_1LCHHH.lean) | +| `1RB0LD_1LC1RB_0LA0LD_1LE0RB_1RF0RE_---0RD` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LD_1LC1RB_0LA0LD_1LE0RB_1RF0RE_---0RD) | [`M_1RB0LD_1LC1RB_0LA0LD_1LE0RB_1RF0RE_HHH0RD.lean`](./NonHalt/M_1RB0LD_1LC1RB_0LA0LD_1LE0RB_1RF0RE_HHH0RD.lean) | +| `1RB0LD_1RC0RA_1RD1RF_1LA0LE_1RE1LD_0RB---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LD_1RC0RA_1RD1RF_1LA0LE_1RE1LD_0RB---) | [`M_1RB0LD_1RC0RA_1RD1RF_1LA0LE_1RE1LD_0RBHHH.lean`](./NonHalt/M_1RB0LD_1RC0RA_1RD1RF_1LA0LE_1RE1LD_0RBHHH.lean) | +| `1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RB---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RB---) | [`M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH.lean`](./NonHalt/M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH.lean) | +| `1RB0LD_1RC1RF_0RD1RA_1LE1RC_0LA0LD_0RC---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LD_1RC1RF_0RD1RA_1LE1RC_0LA0LD_0RC---) | [`M_1RB0LD_1RC1RF_0RD1RA_1LE1RC_0LA0LD_0RCHHH.lean`](./NonHalt/M_1RB0LD_1RC1RF_0RD1RA_1LE1RC_0LA0LD_0RCHHH.lean) | +| `1RB0LE_1LC1RD_1LA0LC_1RA1RE_0RF0RB_1LC---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LE_1LC1RD_1LA0LC_1RA1RE_0RF0RB_1LC---) | [`M_1RB0LE_1LC1RD_1LA0LC_1RA1RE_0RF0RB_1LCHHH.lean`](./NonHalt/M_1RB0LE_1LC1RD_1LA0LC_1RA1RE_0RF0RB_1LCHHH.lean) | +| `1RB0LE_1RC0LF_0LD0RC_1RA1LD_1LB0LE_---0RE` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LE_1RC0LF_0LD0RC_1RA1LD_1LB0LE_---0RE) | [`M_1RB0LE_1RC0LF_0LD0RC_1RA1LD_1LB0LE_HHH0RE.lean`](./NonHalt/M_1RB0LE_1RC0LF_0LD0RC_1RA1LD_1LB0LE_HHH0RE.lean) | +| `1RB0LE_1RC0RC_1LD0RB_1LA0LE_1LD1LF_1LD---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LE_1RC0RC_1LD0RB_1LA0LE_1LD1LF_1LD---) | [`M_1RB0LE_1RC0RC_1LD0RB_1LA0LE_1LD1LF_1LDHHH.lean`](./NonHalt/M_1RB0LE_1RC0RC_1LD0RB_1LA0LE_1LD1LF_1LDHHH.lean) | +| `1RB0LE_1RC1LA_1LD1RE_1LB0LD_1RF0RC_1RB---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LE_1RC1LA_1LD1RE_1LB0LD_1RF0RC_1RB---) | [`M_1RB0LE_1RC1LA_1LD1RE_1LB0LD_1RF0RC_1RBHHH.lean`](./NonHalt/M_1RB0LE_1RC1LA_1LD1RE_1LB0LD_1RF0RC_1RBHHH.lean) | +| `1RB0LF_0RC---_1RD0RA_1LE0RC_0LA0LE_1LE1LB` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0LF_0RC---_1RD0RA_1LE0RC_0LA0LE_1LE1LB) | [`M_1RB0LF_0RCHHH_1RD0RA_1LE0RC_0LA0LE_1LE1LB.lean`](./NonHalt/M_1RB0LF_0RCHHH_1RD0RA_1LE0RC_0LA0LE_1LE1LB.lean) | +| `1RB0RA_0LC0LA_1RF1LD_1LE0LD_1LC1LF_---1RA` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RA_0LC0LA_1RF1LD_1LE0LD_1LC1LF_---1RA) | [`M_1RB0RA_0LC0LA_1RF1LD_1LE0LD_1LC1LF_HHH1RA.lean`](./NonHalt/M_1RB0RA_0LC0LA_1RF1LD_1LE0LD_1LC1LF_HHH1RA.lean) | +| `1RB0RA_0RC0RE_0LD---_1LE1LD_1LF0LD_1RA0RD` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RA_0RC0RE_0LD---_1LE1LD_1LF0LD_1RA0RD) | [`M_1RB0RA_0RC0RE_0LDHHH_1LE1LD_1LF0LD_1RA0RD.lean`](./NonHalt/M_1RB0RA_0RC0RE_0LDHHH_1LE1LD_1LF0LD_1RA0RD.lean) | +| `1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_---0RA` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_---0RA) | [`M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA.lean`](./NonHalt/M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA.lean) | +| `1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF1LB_---0RA` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF1LB_---0RA) | [`M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF1LB_HHH0RA.lean`](./NonHalt/M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF1LB_HHH0RA.lean) | +| `1RB0RA_1LC0LD_1LE1LD_0LB0RF_1RA1LB_1RA---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RA_1LC0LD_1LE1LD_0LB0RF_1RA1LB_1RA---) | [`M_1RB0RA_1LC0LD_1LE1LD_0LB0RF_1RA1LB_1RAHHH.lean`](./NonHalt/M_1RB0RA_1LC0LD_1LE1LD_0LB0RF_1RA1LB_1RAHHH.lean) | +| `1RB0RA_1LC0LF_1LE0LD_1LB---_1RA1LB_0LB0RC` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RA_1LC0LF_1LE0LD_1LB---_1RA1LB_0LB0RC) | [`M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LB0RC.lean`](./NonHalt/M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LB0RC.lean) | +| `1RB0RA_1LC0LF_1LE0LD_1LB---_1RA1LB_0LD0RC` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RA_1LC0LF_1LE0LD_1LB---_1RA1LB_0LD0RC) | [`M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC.lean`](./NonHalt/M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC.lean) | +| `1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_0LC---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_0LC---) | [`M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_0LCHHH.lean`](./NonHalt/M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_0LCHHH.lean) | +| `1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LB---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LB---) | [`M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH.lean`](./NonHalt/M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH.lean) | +| `1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LC---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LC---) | [`M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LCHHH.lean`](./NonHalt/M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LCHHH.lean) | +| `1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LD---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LD---) | [`M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LDHHH.lean`](./NonHalt/M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LDHHH.lean) | +| `1RB0RA_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RB---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RA_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RB---) | [`M_1RB0RA_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH.lean`](./NonHalt/M_1RB0RA_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH.lean) | +| `1RB0RA_1RC0LE_1LD0RA_---1LE_0RE0LF_1LB1LC` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RA_1RC0LE_1LD0RA_---1LE_0RE0LF_1LB1LC) | [`M_1RB0RA_1RC0LE_1LD0RA_HHH1LE_0RE0LF_1LB1LC.lean`](./NonHalt/M_1RB0RA_1RC0LE_1LD0RA_HHH1LE_0RE0LF_1LB1LC.lean) | +| `1RB0RA_1RC0RC_1LD0LE_1RA1LC_1LC1LF_0LC---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RA_1RC0RC_1LD0LE_1RA1LC_1LC1LF_0LC---) | [`M_1RB0RA_1RC0RC_1LD0LE_1RA1LC_1LC1LF_0LCHHH.lean`](./NonHalt/M_1RB0RA_1RC0RC_1LD0LE_1RA1LC_1LC1LF_0LCHHH.lean) | +| `1RB0RA_1RC0RD_1LD1LE_1LF0LC_0LD---_1RA1LD` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RA_1RC0RD_1LD1LE_1LF0LC_0LD---_1RA1LD) | [`M_1RB0RA_1RC0RD_1LD1LE_1LF0LC_0LDHHH_1RA1LD.lean`](./NonHalt/M_1RB0RA_1RC0RD_1LD1LE_1LF0LC_0LDHHH_1RA1LD.lean) | +| `1RB0RA_1RC0RE_1RD---_1LE1LD_1LF0LD_1RA1LE` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RA_1RC0RE_1RD---_1LE1LD_1LF0LD_1RA1LE) | [`M_1RB0RA_1RC0RE_1RDHHH_1LE1LD_1LF0LD_1RA1LE.lean`](./NonHalt/M_1RB0RA_1RC0RE_1RDHHH_1LE1LD_1LF0LD_1RA1LE.lean) | +| `1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LA---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LA---) | [`M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LAHHH.lean`](./NonHalt/M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LAHHH.lean) | +| `1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LB---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LB---) | [`M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LBHHH.lean`](./NonHalt/M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LBHHH.lean) | +| `1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_1LE---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_1LE---) | [`M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_1LEHHH.lean`](./NonHalt/M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_1LEHHH.lean) | +| `1RB0RB_1LC0RA_1LE0LD_1LC1LF_1RA0LD_1LC---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RB_1LC0RA_1LE0LD_1LC1LF_1RA0LD_1LC---) | [`M_1RB0RB_1LC0RA_1LE0LD_1LC1LF_1RA0LD_1LCHHH.lean`](./NonHalt/M_1RB0RB_1LC0RA_1LE0LD_1LC1LF_1RA0LD_1LCHHH.lean) | +| `1RB0RB_1RC1LC_0LD1RA_1LF1LE_0LA1LC_1LB---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RB_1RC1LC_0LD1RA_1LF1LE_0LA1LC_1LB---) | [`M_1RB0RB_1RC1LC_0LD1RA_1LF1LE_0LA1LC_1LBHHH.lean`](./NonHalt/M_1RB0RB_1RC1LC_0LD1RA_1LF1LE_0LA1LC_1LBHHH.lean) | +| `1RB0RC_1LC0LD_1RA1RC_1RA1LE_0LB1RE_---1RA` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RC_1LC0LD_1RA1RC_1RA1LE_0LB1RE_---1RA) | [`M_1RB0RC_1LC0LD_1RA1RC_1RA1LE_0LB1RE_HHH1RA.lean`](./NonHalt/M_1RB0RC_1LC0LD_1RA1RC_1RA1LE_0LB1RE_HHH1RA.lean) | +| `1RB0RC_1LC1LF_1LD0LB_1RE1LC_1RA0RE_0LC---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RC_1LC1LF_1LD0LB_1RE1LC_1RA0RE_0LC---) | [`M_1RB0RC_1LC1LF_1LD0LB_1RE1LC_1RA0RE_0LCHHH.lean`](./NonHalt/M_1RB0RC_1LC1LF_1LD0LB_1RE1LC_1RA0RE_0LCHHH.lean) | +| `1RB0RC_1LC1RA_0RF0LD_1LE0RB_1LB0LD_---1RD` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RC_1LC1RA_0RF0LD_1LE0RB_1LB0LD_---1RD) | [`M_1RB0RC_1LC1RA_0RF0LD_1LE0RB_1LB0LD_HHH1RD.lean`](./NonHalt/M_1RB0RC_1LC1RA_0RF0LD_1LE0RB_1LB0LD_HHH1RD.lean) | +| `1RB0RC_1LC1RD_1RA1LE_1LA0RD_0LE1RF_1LB---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RC_1LC1RD_1RA1LE_1LA0RD_0LE1RF_1LB---) | [`M_1RB0RC_1LC1RD_1RA1LE_1LA0RD_0LE1RF_1LBHHH.lean`](./NonHalt/M_1RB0RC_1LC1RD_1RA1LE_1LA0RD_0LE1RF_1LBHHH.lean) | +| `1RB0RD_0LC0RA_1LA1LC_1RE0LF_0RA1RF_1LB---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RD_0LC0RA_1LA1LC_1RE0LF_0RA1RF_1LB---) | [`M_1RB0RD_0LC0RA_1LA1LC_1RE0LF_0RA1RF_1LBHHH.lean`](./NonHalt/M_1RB0RD_0LC0RA_1LA1LC_1RE0LF_0RA1RF_1LBHHH.lean) | +| `1RB0RD_0RC0LB_0RD1RD_1LE1RA_1RC1LF_---1LA` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RD_0RC0LB_0RD1RD_1LE1RA_1RC1LF_---1LA) | [`M_1RB0RD_0RC0LB_0RD1RD_1LE1RA_1RC1LF_HHH1LA.lean`](./NonHalt/M_1RB0RD_0RC0LB_0RD1RD_1LE1RA_1RC1LF_HHH1LA.lean) | +| `1RB0RD_1RC1RF_1LD0LE_1RA0LC_1RE1LC_0RA---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RD_1RC1RF_1LD0LE_1RA0LC_1RE1LC_0RA---) | [`M_1RB0RD_1RC1RF_1LD0LE_1RA0LC_1RE1LC_0RAHHH.lean`](./NonHalt/M_1RB0RD_1RC1RF_1LD0LE_1RA0LC_1RE1LC_0RAHHH.lean) | +| `1RB0RD_1RC---_1LD1LC_1LE0LC_1RF0RC_1RA0RF` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RD_1RC---_1LD1LC_1LE0LC_1RF0RC_1RA0RF) | [`M_1RB0RD_1RCHHH_1LD1LC_1LE0LC_1RF0RC_1RA0RF.lean`](./NonHalt/M_1RB0RD_1RCHHH_1LD1LC_1LE0LC_1RF0RC_1RA0RF.lean) | +| `1RB0RD_1RC---_1LD1LE_1LE0LC_1RF1LD_1RA0RF` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RD_1RC---_1LD1LE_1LE0LC_1RF1LD_1RA0RF) | [`M_1RB0RD_1RCHHH_1LD1LE_1LE0LC_1RF1LD_1RA0RF.lean`](./NonHalt/M_1RB0RD_1RCHHH_1LD1LE_1LE0LC_1RF1LD_1RA0RF.lean) | +| `1RB0RE_1LC0LE_1LD0LC_1RA0LA_1RA1RF_1RA---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RE_1LC0LE_1LD0LC_1RA0LA_1RA1RF_1RA---) | [`M_1RB0RE_1LC0LE_1LD0LC_1RA0LA_1RA1RF_1RAHHH.lean`](./NonHalt/M_1RB0RE_1LC0LE_1LD0LC_1RA0LA_1RA1RF_1RAHHH.lean) | +| `1RB0RE_1LC0RA_0RA0LD_1LE---_1RF0LF_0LC0RA` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RE_1LC0RA_0RA0LD_1LE---_1RF0LF_0LC0RA) | [`M_1RB0RE_1LC0RA_0RA0LD_1LEHHH_1RF0LF_0LC0RA.lean`](./NonHalt/M_1RB0RE_1LC0RA_0RA0LD_1LEHHH_1RF0LF_0LC0RA.lean) | +| `1RB0RE_1LC0RA_1LD0LB_1LA1LF_1LE1RA_0LC---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RE_1LC0RA_1LD0LB_1LA1LF_1LE1RA_0LC---) | [`M_1RB0RE_1LC0RA_1LD0LB_1LA1LF_1LE1RA_0LCHHH.lean`](./NonHalt/M_1RB0RE_1LC0RA_1LD0LB_1LA1LF_1LE1RA_0LCHHH.lean) | +| `1RB0RE_1LC0RE_1LD0LD_1RA0LC_1RA1RF_1RA---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RE_1LC0RE_1LD0LD_1RA0LC_1RA1RF_1RA---) | [`M_1RB0RE_1LC0RE_1LD0LD_1RA0LC_1RA1RF_1RAHHH.lean`](./NonHalt/M_1RB0RE_1LC0RE_1LD0LD_1RA0LC_1RA1RF_1RAHHH.lean) | +| `1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RA---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RA---) | [`M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RAHHH.lean`](./NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RAHHH.lean) | +| `1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RD---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RD---) | [`M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RDHHH.lean`](./NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RDHHH.lean) | +| `1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0LB---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0LB---) | [`M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0LBHHH.lean`](./NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0LBHHH.lean) | +| `1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0RA---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0RA---) | [`M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0RAHHH.lean`](./NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0RAHHH.lean) | +| `1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RD---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RD---) | [`M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RDHHH.lean`](./NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RDHHH.lean) | +| `1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RE---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RE---) | [`M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1REHHH.lean`](./NonHalt/M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1REHHH.lean) | +| `1RB0RE_1LC1RD_1LD0LC_1RA0RF_1RD---_0RD0LA` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RE_1LC1RD_1LD0LC_1RA0RF_1RD---_0RD0LA) | [`M_1RB0RE_1LC1RD_1LD0LC_1RA0RF_1RDHHH_0RD0LA.lean`](./NonHalt/M_1RB0RE_1LC1RD_1LD0LC_1RA0RF_1RDHHH_0RD0LA.lean) | +| `1RB0RE_1LC1RF_---0LD_0LE1LB_1LF1LD_1RD0RA` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RE_1LC1RF_---0LD_0LE1LB_1LF1LD_1RD0RA) | [`M_1RB0RE_1LC1RF_HHH0LD_0LE1LB_1LF1LD_1RD0RA.lean`](./NonHalt/M_1RB0RE_1LC1RF_HHH0LD_0LE1LB_1LF1LD_1RD0RA.lean) | +| `1RB0RE_1RC0RB_0RD0RF_0LE---_1LF1LE_1LA0LE` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RE_1RC0RB_0RD0RF_0LE---_1LF1LE_1LA0LE) | [`M_1RB0RE_1RC0RB_0RD0RF_0LEHHH_1LF1LE_1LA0LE.lean`](./NonHalt/M_1RB0RE_1RC0RB_0RD0RF_0LEHHH_1LF1LE_1LA0LE.lean) | +| `1RB0RE_1RC1LF_0LD0RE_---1LE_1RA0LB_1LB0LC` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RE_1RC1LF_0LD0RE_---1LE_1RA0LB_1LB0LC) | [`M_1RB0RE_1RC1LF_0LD0RE_HHH1LE_1RA0LB_1LB0LC.lean`](./NonHalt/M_1RB0RE_1RC1LF_0LD0RE_HHH1LE_1RA0LB_1LB0LC.lean) | +| `1RB0RE_1RC1RE_1LD1RA_1LA0LD_0RA0LF_1LD---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RE_1RC1RE_1LD1RA_1LA0LD_0RA0LF_1LD---) | [`M_1RB0RE_1RC1RE_1LD1RA_1LA0LD_0RA0LF_1LDHHH.lean`](./NonHalt/M_1RB0RE_1RC1RE_1LD1RA_1LA0LD_0RA0LF_1LDHHH.lean) | +| `1RB0RE_1RC---_0LD1LE_0RE1LD_1RF0LC_0RA1RE` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RE_1RC---_0LD1LE_0RE1LD_1RF0LC_0RA1RE) | [`M_1RB0RE_1RCHHH_0LD1LE_0RE1LD_1RF0LC_0RA1RE.lean`](./NonHalt/M_1RB0RE_1RCHHH_0LD1LE_0RE1LD_1RF0LC_0RA1RE.lean) | +| `1RB0RF_1LC0LF_1LD0LC_0LE0LA_1LF---_1RA1RF` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RF_1LC0LF_1LD0LC_0LE0LA_1LF---_1RA1RF) | [`M_1RB0RF_1LC0LF_1LD0LC_0LE0LA_1LFHHH_1RA1RF.lean`](./NonHalt/M_1RB0RF_1LC0LF_1LD0LC_0LE0LA_1LFHHH_1RA1RF.lean) | +| `1RB0RF_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RB---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RF_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RB---) | [`M_1RB0RF_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH.lean`](./NonHalt/M_1RB0RF_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH.lean) | +| `1RB0RF_1LC1RA_1LD0LC_0LE0LA_0RF---_1RA1RF` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RF_1LC1RA_1LD0LC_0LE0LA_0RF---_1RA1RF) | [`M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_0RFHHH_1RA1RF.lean`](./NonHalt/M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_0RFHHH_1RA1RF.lean) | +| `1RB0RF_1LC1RA_1LD0LC_0LE0LA_1RF---_1RA1RE` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RF_1LC1RA_1LD0LC_0LE0LA_1RF---_1RA1RE) | [`M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_1RFHHH_1RA1RE.lean`](./NonHalt/M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_1RFHHH_1RA1RE.lean) | +| `1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LF---_1RA1RB` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LF---_1RA1RB) | [`M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RB.lean`](./NonHalt/M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RB.lean) | +| `1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LF---_1RA1RF` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LF---_1RA1RF) | [`M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RF.lean`](./NonHalt/M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RF.lean) | +| `1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RA---_0RA0LB` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RA---_0RA0LB) | [`M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RA0LB.lean`](./NonHalt/M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RA0LB.lean) | +| `1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RA---_0RE0LB` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RA---_0RE0LB) | [`M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RE0LB.lean`](./NonHalt/M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RE0LB.lean) | +| `1RB0RF_1RC1RF_1LD0RE_---0LE_1LA0LE_0RA0LC` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RF_1RC1RF_1LD0RE_---0LE_1LA0LE_0RA0LC) | [`M_1RB0RF_1RC1RF_1LD0RE_HHH0LE_1LA0LE_0RA0LC.lean`](./NonHalt/M_1RB0RF_1RC1RF_1LD0RE_HHH0LE_1LA0LE_0RA0LC.lean) | +| `1RB0RF_1RC1RF_1LD1RA_---0LE_1LA0LE_0RA0LC` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB0RF_1RC1RF_1LD1RA_---0LE_1LA0LE_0RA0LC) | [`M_1RB0RF_1RC1RF_1LD1RA_HHH0LE_1LA0LE_0RA0LC.lean`](./NonHalt/M_1RB0RF_1RC1RF_1LD1RA_HHH0LE_1LA0LE_0RA0LC.lean) | +| `1RB1LA_0RC0RD_1LC1LA_1RE1RD_1LF0LA_---0LE` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LA_0RC0RD_1LC1LA_1RE1RD_1LF0LA_---0LE) | [`M_1RB1LA_0RC0RD_1LC1LA_1RE1RD_1LF0LA_HHH0LE.lean`](./NonHalt/M_1RB1LA_0RC0RD_1LC1LA_1RE1RD_1LF0LA_HHH0LE.lean) | +| `1RB1LA_1LA1RC_1RD0RB_1LE0LF_---1LD_0LE1LA` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LA_1LA1RC_1RD0RB_1LE0LF_---1LD_0LE1LA) | [`M_1RB1LA_1LA1RC_1RD0RB_1LE0LF_HHH1LD_0LE1LA.lean`](./NonHalt/M_1RB1LA_1LA1RC_1RD0RB_1LE0LF_HHH1LD_0LE1LA.lean) | +| `1RB1LA_1LC0RA_0LD1RC_---0LE_0LF1LE_1RF1LB` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LA_1LC0RA_0LD1RC_---0LE_0LF1LE_1RF1LB) | [`M_1RB1LA_1LC0RA_0LD1RC_HHH0LE_0LF1LE_1RF1LB.lean`](./NonHalt/M_1RB1LA_1LC0RA_0LD1RC_HHH0LE_0LF1LE_1RF1LB.lean) | +| `1RB1LA_1RC0LE_1RD0LF_0LA0RD_1LC0LE_---0RE` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LA_1RC0LE_1RD0LF_0LA0RD_1LC0LE_---0RE) | [`M_1RB1LA_1RC0LE_1RD0LF_0LA0RD_1LC0LE_HHH0RE.lean`](./NonHalt/M_1RB1LA_1RC0LE_1RD0LF_0LA0RD_1LC0LE_HHH0RE.lean) | +| `1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RB---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RB---) | [`M_1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RBHHH.lean`](./NonHalt/M_1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RBHHH.lean) | +| `1RB1LB_1LC0LF_1LD0RC_1RE0LA_1RE1RC_---0LE` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LB_1LC0LF_1LD0RC_1RE0LA_1RE1RC_---0LE) | [`M_1RB1LB_1LC0LF_1LD0RC_1RE0LA_1RE1RC_HHH0LE.lean`](./NonHalt/M_1RB1LB_1LC0LF_1LD0RC_1RE0LA_1RE1RC_HHH0LE.lean) | +| `1RB1LB_1LC1RB_1RF1LD_0LE0LC_0RC---_1LA0RF` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LB_1LC1RB_1RF1LD_0LE0LC_0RC---_1LA0RF) | [`M_1RB1LB_1LC1RB_1RF1LD_0LE0LC_0RCHHH_1LA0RF.lean`](./NonHalt/M_1RB1LB_1LC1RB_1RF1LD_0LE0LC_0RCHHH_1LA0RF.lean) | +| `1RB1LB_1RC0LA_1LD1RF_1RB0LE_---1LA_1RD0RD` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LB_1RC0LA_1LD1RF_1RB0LE_---1LA_1RD0RD) | [`M_1RB1LB_1RC0LA_1LD1RF_1RB0LE_HHH1LA_1RD0RD.lean`](./NonHalt/M_1RB1LB_1RC0LA_1LD1RF_1RB0LE_HHH1LA_1RD0RD.lean) | +| `1RB1LC_1LA1RB_1LD0LA_1RE0RF_---1RD_0RE1RB` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LC_1LA1RB_1LD0LA_1RE0RF_---1RD_0RE1RB) | [`M_1RB1LC_1LA1RB_1LD0LA_1RE0RF_HHH1RD_0RE1RB.lean`](./NonHalt/M_1RB1LC_1LA1RB_1LD0LA_1RE0RF_HHH1RD_0RE1RB.lean) | +| `1RB1LC_1RC1LB_1LD0RB_0LE1RD_---0LF_0LA1LF` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LC_1RC1LB_1LD0RB_0LE1RD_---0LF_0LA1LF) | [`M_1RB1LC_1RC1LB_1LD0RB_0LE1RD_HHH0LF_0LA1LF.lean`](./NonHalt/M_1RB1LC_1RC1LB_1LD0RB_0LE1RD_HHH0LF_0LA1LF.lean) | +| `1RB1LD_0RC0RB_0LD1RE_0LA1LC_0RB0RF_1LC---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LD_0RC0RB_0LD1RE_0LA1LC_0RB0RF_1LC---) | [`M_1RB1LD_0RC0RB_0LD1RE_0LA1LC_0RB0RF_1LCHHH.lean`](./NonHalt/M_1RB1LD_0RC0RB_0LD1RE_0LA1LC_0RB0RF_1LCHHH.lean) | +| `1RB1LD_0RC1RC_1LA1RE_---1LE_1RF0RC_0RB0LF` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LD_0RC1RC_1LA1RE_---1LE_1RF0RC_0RB0LF) | [`M_1RB1LD_0RC1RC_1LA1RE_HHH1LE_1RF0RC_0RB0LF.lean`](./NonHalt/M_1RB1LD_0RC1RC_1LA1RE_HHH1LE_1RF0RC_0RB0LF.lean) | +| `1RB1LD_1LC1RA_0LD0LC_0RE1RB_1RD0RF_0RB---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LD_1LC1RA_0LD0LC_0RE1RB_1RD0RF_0RB---) | [`M_1RB1LD_1LC1RA_0LD0LC_0RE1RB_1RD0RF_0RBHHH.lean`](./NonHalt/M_1RB1LD_1LC1RA_0LD0LC_0RE1RB_1RD0RF_0RBHHH.lean) | +| `1RB1LD_1RC0RB_1LA0RE_1LC1LE_1LF0LA_0RE---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LD_1RC0RB_1LA0RE_1LC1LE_1LF0LA_0RE---) | [`M_1RB1LD_1RC0RB_1LA0RE_1LC1LE_1LF0LA_0REHHH.lean`](./NonHalt/M_1RB1LD_1RC0RB_1LA0RE_1LC1LE_1LF0LA_0REHHH.lean) | +| `1RB1LD_1RC0RB_1LA1RE_1LF0LA_1LA0RD_1LC---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LD_1RC0RB_1LA1RE_1LF0LA_1LA0RD_1LC---) | [`M_1RB1LD_1RC0RB_1LA1RE_1LF0LA_1LA0RD_1LCHHH.lean`](./NonHalt/M_1RB1LD_1RC0RB_1LA1RE_1LF0LA_1LA0RD_1LCHHH.lean) | +| `1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD0LF_1RD---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD0LF_1RD---) | [`M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD0LF_1RDHHH.lean`](./NonHalt/M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD0LF_1RDHHH.lean) | +| `1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_0LD---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_0LD---) | [`M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_0LDHHH.lean`](./NonHalt/M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_0LDHHH.lean) | +| `1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_1LA---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_1LA---) | [`M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_1LAHHH.lean`](./NonHalt/M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_1LAHHH.lean) | +| `1RB1LE_1LC0RF_1LA0RD_1LC1RC_1LB0LB_---1RD` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LE_1LC0RF_1LA0RD_1LC1RC_1LB0LB_---1RD) | [`M_1RB1LE_1LC0RF_1LA0RD_1LC1RC_1LB0LB_HHH1RD.lean`](./NonHalt/M_1RB1LE_1LC0RF_1LA0RD_1LC1RC_1LB0LB_HHH1RD.lean) | +| `1RB1LE_1LC1RD_0LA1LA_---1RE_1LF0LA_0LC0RF` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LE_1LC1RD_0LA1LA_---1RE_1LF0LA_0LC0RF) | [`M_1RB1LE_1LC1RD_0LA1LA_HHH1RE_1LF0LA_0LC0RF.lean`](./NonHalt/M_1RB1LE_1LC1RD_0LA1LA_HHH1RE_1LF0LA_0LC0RF.lean) | +| `1RB1LF_0RC0RB_0LD1LA_1LC0LE_0LA---_1LA1LF` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LF_0RC0RB_0LD1LA_1LC0LE_0LA---_1LA1LF) | [`M_1RB1LF_0RC0RB_0LD1LA_1LC0LE_0LAHHH_1LA1LF.lean`](./NonHalt/M_1RB1LF_0RC0RB_0LD1LA_1LC0LE_0LAHHH_1LA1LF.lean) | +| `1RB1LF_1LC1RB_1RE1LD_1LB0LC_1LA0RE_1LD---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LF_1LC1RB_1RE1LD_1LB0LC_1LA0RE_1LD---) | [`M_1RB1LF_1LC1RB_1RE1LD_1LB0LC_1LA0RE_1LDHHH.lean`](./NonHalt/M_1RB1LF_1LC1RB_1RE1LD_1LB0LC_1LA0RE_1LDHHH.lean) | +| `1RB1LF_1RC0RB_1RD0RF_1RE---_1LF1LA_1LA0LE` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LF_1RC0RB_1RD0RF_1RE---_1LF1LA_1LA0LE) | [`M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LA_1LA0LE.lean`](./NonHalt/M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LA_1LA0LE.lean) | +| `1RB1LF_1RC0RB_1RD0RF_1RE---_1LF1LE_1LA0LE` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1LF_1RC0RB_1RD0RF_1RE---_1LF1LE_1LA0LE) | [`M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LE_1LA0LE.lean`](./NonHalt/M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LE_1LA0LE.lean) | +| `1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RD---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RD---) | [`M_1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH.lean`](./NonHalt/M_1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH.lean) | +| `1RB1RA_1LC1LE_1RF1LD_1RE0LD_0LB0RA_---0RC` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RA_1LC1LE_1RF1LD_1RE0LD_0LB0RA_---0RC) | [`M_1RB1RA_1LC1LE_1RF1LD_1RE0LD_0LB0RA_HHH0RC.lean`](./NonHalt/M_1RB1RA_1LC1LE_1RF1LD_1RE0LD_0LB0RA_HHH0RC.lean) | +| `1RB1RA_1LC1RE_0LD0LD_0LE1LF_1LA0RA_---1LC` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RA_1LC1RE_0LD0LD_0LE1LF_1LA0RA_---1LC) | [`M_1RB1RA_1LC1RE_0LD0LD_0LE1LF_1LA0RA_HHH1LC.lean`](./NonHalt/M_1RB1RA_1LC1RE_0LD0LD_0LE1LF_1LA0RA_HHH1LC.lean) | +| `1RB1RA_1RC0RA_1LD0LA_1LE0LD_1LF0LB_1RE---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RA_1RC0RA_1LD0LA_1LE0LD_1LF0LB_1RE---) | [`M_1RB1RA_1RC0RA_1LD0LA_1LE0LD_1LF0LB_1REHHH.lean`](./NonHalt/M_1RB1RA_1RC0RA_1LD0LA_1LE0LD_1LF0LB_1REHHH.lean) | +| `1RB1RA_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LA---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RA_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LA---) | [`M_1RB1RA_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH.lean`](./NonHalt/M_1RB1RA_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH.lean) | +| `1RB1RA_1RC1LB_1LD0RA_1LA0LE_---0LF_0RC0LB` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RA_1RC1LB_1LD0RA_1LA0LE_---0LF_0RC0LB) | [`M_1RB1RA_1RC1LB_1LD0RA_1LA0LE_HHH0LF_0RC0LB.lean`](./NonHalt/M_1RB1RA_1RC1LB_1LD0RA_1LA0LE_HHH0LF_0RC0LB.lean) | +| `1RB1RC_0LA1RF_1RD0LE_1LC0RB_0RA0LC_0RD---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RC_0LA1RF_1RD0LE_1LC0RB_0RA0LC_0RD---) | [`M_1RB1RC_0LA1RF_1RD0LE_1LC0RB_0RA0LC_0RDHHH.lean`](./NonHalt/M_1RB1RC_0LA1RF_1RD0LE_1LC0RB_0RA0LC_0RDHHH.lean) | +| `1RB1RC_1LC0LE_0RA1RD_1RF1LB_1LD0LA_---0RC` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RC_1LC0LE_0RA1RD_1RF1LB_1LD0LA_---0RC) | [`M_1RB1RC_1LC0LE_0RA1RD_1RF1LB_1LD0LA_HHH0RC.lean`](./NonHalt/M_1RB1RC_1LC0LE_0RA1RD_1RF1LB_1LD0LA_HHH0RC.lean) | +| `1RB1RC_1LC0RA_1RA0LD_0RE0LF_0LB---_0RF0RE` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RC_1LC0RA_1RA0LD_0RE0LF_0LB---_0RF0RE) | [`M_1RB1RC_1LC0RA_1RA0LD_0RE0LF_0LBHHH_0RF0RE.lean`](./NonHalt/M_1RB1RC_1LC0RA_1RA0LD_0RE0LF_0LBHHH_0RF0RE.lean) | +| `1RB1RC_1LC0RF_1RE0LD_1LB0LD_---1RF_0LF0RA` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RC_1LC0RF_1RE0LD_1LB0LD_---1RF_0LF0RA) | [`M_1RB1RC_1LC0RF_1RE0LD_1LB0LD_HHH1RF_0LF0RA.lean`](./NonHalt/M_1RB1RC_1LC0RF_1RE0LD_1LB0LD_HHH1RF_0LF0RA.lean) | +| `1RB1RC_1LC1RE_---1LD_0LE0LD_1RA0RF_1LD1RB` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RC_1LC1RE_---1LD_0LE0LD_1RA0RF_1LD1RB) | [`M_1RB1RC_1LC1RE_HHH1LD_0LE0LD_1RA0RF_1LD1RB.lean`](./NonHalt/M_1RB1RC_1LC1RE_HHH1LD_0LE0LD_1RA0RF_1LD1RB.lean) | +| `1RB1RC_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LA---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RC_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LA---) | [`M_1RB1RC_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH.lean`](./NonHalt/M_1RB1RC_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH.lean) | +| `1RB1RD_1LC0RB_0RD0LC_1LB0LE_1RF0RE_1RA---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RD_1LC0RB_0RD0LC_1LB0LE_1RF0RE_1RA---) | [`M_1RB1RD_1LC0RB_0RD0LC_1LB0LE_1RF0RE_1RAHHH.lean`](./NonHalt/M_1RB1RD_1LC0RB_0RD0LC_1LB0LE_1RF0RE_1RAHHH.lean) | +| `1RB1RE_0RC0RA_0LD0LF_1LA1LD_0RB0LD_1LC---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RE_0RC0RA_0LD0LF_1LA1LD_0RB0LD_1LC---) | [`M_1RB1RE_0RC0RA_0LD0LF_1LA1LD_0RB0LD_1LCHHH.lean`](./NonHalt/M_1RB1RE_0RC0RA_0LD0LF_1LA1LD_0RB0LD_1LCHHH.lean) | +| `1RB1RE_1LC1RB_1RA0LD_1RC0LB_0RF---_0LD1RA` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RE_1LC1RB_1RA0LD_1RC0LB_0RF---_0LD1RA) | [`M_1RB1RE_1LC1RB_1RA0LD_1RC0LB_0RFHHH_0LD1RA.lean`](./NonHalt/M_1RB1RE_1LC1RB_1RA0LD_1RC0LB_0RFHHH_0LD1RA.lean) | +| `1RB1RE_1LC1RD_1LD0LC_1RA0RF_0RD---_0RD0LB` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RE_1LC1RD_1LD0LC_1RA0RF_0RD---_0RD0LB) | [`M_1RB1RE_1LC1RD_1LD0LC_1RA0RF_0RDHHH_0RD0LB.lean`](./NonHalt/M_1RB1RE_1LC1RD_1LD0LC_1RA0RF_0RDHHH_0RD0LB.lean) | +| `1RB1RF_0RC1RE_1LD1RB_0LE0LC_1RA0LC_0RB---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RF_0RC1RE_1LD1RB_0LE0LC_1RA0LC_0RB---) | [`M_1RB1RF_0RC1RE_1LD1RB_0LE0LC_1RA0LC_0RBHHH.lean`](./NonHalt/M_1RB1RF_0RC1RE_1LD1RB_0LE0LC_1RA0LC_0RBHHH.lean) | +| `1RB1RF_1LC0LE_1RD0LB_1RA0RC_1RE1LB_0RD---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RF_1LC0LE_1RD0LB_1RA0RC_1RE1LB_0RD---) | [`M_1RB1RF_1LC0LE_1RD0LB_1RA0RC_1RE1LB_0RDHHH.lean`](./NonHalt/M_1RB1RF_1LC0LE_1RD0LB_1RA0RC_1RE1LB_0RDHHH.lean) | +| `1RB1RF_1LC0LF_---0LD_0LE1LD_0RF0LB_1RA1RE` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RF_1LC0LF_---0LD_0LE1LD_0RF0LB_1RA1RE) | [`M_1RB1RF_1LC0LF_HHH0LD_0LE1LD_0RF0LB_1RA1RE.lean`](./NonHalt/M_1RB1RF_1LC0LF_HHH0LD_0LE1LD_0RF0LB_1RA1RE.lean) | +| `1RB1RF_1LC0RD_---0LD_1LE0LD_1RA0RF_0RE0LB` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RF_1LC0RD_---0LD_1LE0LD_1RA0RF_0RE0LB) | [`M_1RB1RF_1LC0RD_HHH0LD_1LE0LD_1RA0RF_0RE0LB.lean`](./NonHalt/M_1RB1RF_1LC0RD_HHH0LD_1LE0LD_1RA0RF_0RE0LB.lean) | +| `1RB1RF_1LC1RE_---0LD_1LE0LD_1RA0RF_0RE0LB` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RF_1LC1RE_---0LD_1LE0LD_1RA0RF_0RE0LB) | [`M_1RB1RF_1LC1RE_HHH0LD_1LE0LD_1RA0RF_0RE0LB.lean`](./NonHalt/M_1RB1RF_1LC1RE_HHH0LD_1LE0LD_1RA0RF_0RE0LB.lean) | +| `1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LA0LB_0RB---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LA0LB_0RB---) | [`M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LA0LB_0RBHHH.lean`](./NonHalt/M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LA0LB_0RBHHH.lean) | +| `1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LB0LB_0RB---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LB0LB_0RB---) | [`M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LB0LB_0RBHHH.lean`](./NonHalt/M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LB0LB_0RBHHH.lean) | +| `1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_0RB---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_0RB---) | [`M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_0RBHHH.lean`](./NonHalt/M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_0RBHHH.lean) | +| `1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RA---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RA---) | [`M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RAHHH.lean`](./NonHalt/M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RAHHH.lean) | +| `1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RE---` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RE---) | [`M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1REHHH.lean`](./NonHalt/M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1REHHH.lean) | +| `1RB1RF_1RC1RA_1LD0LA_---0LE_0LF1LE_0RA0LC` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB1RF_1RC1RA_1LD0LA_---0LE_0LF1LE_0RA0LC) | [`M_1RB1RF_1RC1RA_1LD0LA_HHH0LE_0LF1LE_0RA0LC.lean`](./NonHalt/M_1RB1RF_1RC1RA_1LD0LA_HHH0LE_0LF1LE_0RA0LC.lean) | +| `1RB---_0LC1RF_1LE0RD_0RB1RC_1RD0LE_0RC1RA` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB---_0LC1RF_1LE0RD_0RB1RC_1RD0LE_0RC1RA) | [`M_1RBHHH_0LC1RF_1LE0RD_0RB1RC_1RD0LE_0RC1RA.lean`](./NonHalt/M_1RBHHH_0LC1RF_1LE0RD_0RB1RC_1RD0LE_0RC1RA.lean) | +| `1RB---_0RC0LD_1RD1RC_1LB0LE_1LF0RA_0LD1LA` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB---_0RC0LD_1RD1RC_1LB0LE_1LF0RA_0LD1LA) | [`M_1RBHHH_0RC0LD_1RD1RC_1LB0LE_1LF0RA_0LD1LA.lean`](./NonHalt/M_1RBHHH_0RC0LD_1RD1RC_1LB0LE_1LF0RA_0LD1LA.lean) | +| `1RB---_0RC0RA_1RD1RC_1LE1LF_0LB0LD_0LE0RC` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB---_0RC0RA_1RD1RC_1LE1LF_0LB0LD_0LE0RC) | [`M_1RBHHH_0RC0RA_1RD1RC_1LE1LF_0LB0LD_0LE0RC.lean`](./NonHalt/M_1RBHHH_0RC0RA_1RD1RC_1LE1LF_0LB0LD_0LE0RC.lean) | +| `1RB---_0RC1LF_0RD1RB_1LE1RC_0LB0LE_0LE0LA` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB---_0RC1LF_0RD1RB_1LE1RC_0LB0LE_0LE0LA) | [`M_1RBHHH_0RC1LF_0RD1RB_1LE1RC_0LB0LE_0LE0LA.lean`](./NonHalt/M_1RBHHH_0RC1LF_0RD1RB_1LE1RC_0LB0LE_0LE0LA.lean) | +| `1RB---_0RC1LF_1LC1LD_1RE0RA_0RD1RF_0LD0LF` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB---_0RC1LF_1LC1LD_1RE0RA_0RD1RF_0LD0LF) | [`M_1RBHHH_0RC1LF_1LC1LD_1RE0RA_0RD1RF_0LD0LF.lean`](./NonHalt/M_1RBHHH_0RC1LF_1LC1LD_1RE0RA_0RD1RF_0LD0LF.lean) | +| `1RB---_1LC0LF_1RD1LB_1RE0RD_1LB0RB_1LB0LA` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB---_1LC0LF_1RD1LB_1RE0RD_1LB0RB_1LB0LA) | [`M_1RBHHH_1LC0LF_1RD1LB_1RE0RD_1LB0RB_1LB0LA.lean`](./NonHalt/M_1RBHHH_1LC0LF_1RD1LB_1RE0RD_1LB0RB_1LB0LA.lean) | +| `1RB---_1LC0RC_0LD0LC_1RE1RA_0RD1LF_0LE0LF` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB---_1LC0RC_0LD0LC_1RE1RA_0RD1LF_0LE0LF) | [`M_1RBHHH_1LC0RC_0LD0LC_1RE1RA_0RD1LF_0LE0LF.lean`](./NonHalt/M_1RBHHH_1LC0RC_0LD0LC_1RE1RA_0RD1LF_0LE0LF.lean) | +| `1RB---_1LC1LB_1LD0LB_1RE1LC_1RF0RE_0RA0RC` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB---_1LC1LB_1LD0LB_1RE1LC_1RF0RE_0RA0RC) | [`M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_0RA0RC.lean`](./NonHalt/M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_0RA0RC.lean) | +| `1RB---_1LC1LB_1LD0LB_1RE1LC_1RF0RE_1RA0RC` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB---_1LC1LB_1LD0LB_1RE1LC_1RF0RE_1RA0RC) | [`M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_1RA0RC.lean`](./NonHalt/M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_1RA0RC.lean) | +| `1RB---_1LC1LD_1LD0LB_1RE1LC_1RF0RE_1RA0RC` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB---_1LC1LD_1LD0LB_1RE1LC_1RF0RE_1RA0RC) | [`M_1RBHHH_1LC1LD_1LD0LB_1RE1LC_1RF0RE_1RA0RC.lean`](./NonHalt/M_1RBHHH_1LC1LD_1LD0LB_1RE1LC_1RF0RE_1RA0RC.lean) | +| `1RB---_1LC1RE_1LD0LC_1LE1LC_1RF0RE_1RA0RB` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB---_1LC1RE_1LD0LC_1LE1LC_1RF0RE_1RA0RB) | [`M_1RBHHH_1LC1RE_1LD0LC_1LE1LC_1RF0RE_1RA0RB.lean`](./NonHalt/M_1RBHHH_1LC1RE_1LD0LC_1LE1LC_1RF0RE_1RA0RB.lean) | +| `1RB---_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB---_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA) | [`M_1RBHHH_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA.lean`](./NonHalt/M_1RBHHH_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA.lean) | +| `1RB---_1RC0RF_1LD1RB_1LE0LD_1RB0LB_1RB1RA` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB---_1RC0RF_1LD1RB_1LE0LD_1RB0LB_1RB1RA) | [`M_1RBHHH_1RC0RF_1LD1RB_1LE0LD_1RB0LB_1RB1RA.lean`](./NonHalt/M_1RBHHH_1RC0RF_1LD1RB_1LE0LD_1RB0LB_1RB1RA.lean) | +| `1RB---_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB---_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC) | [`M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC.lean`](./NonHalt/M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC.lean) | +| `1RB---_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RB0LC` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB---_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RB0LC) | [`M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RB0LC.lean`](./NonHalt/M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RB0LC.lean) | +| `1RB---_1RC1LF_1LD1RE_1LB0LD_1RA0RC_1RC0LE` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB---_1RC1LF_1LD1RE_1LB0LD_1RA0RC_1RC0LE) | [`M_1RBHHH_1RC1LF_1LD1RE_1LB0LD_1RA0RC_1RC0LE.lean`](./NonHalt/M_1RBHHH_1RC1LF_1LD1RE_1LB0LD_1RA0RC_1RC0LE.lean) | +| `1RB---_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB---_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC) | [`M_1RBHHH_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC.lean`](./NonHalt/M_1RBHHH_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC.lean) | +| `1RB---_1RC1RE_1LD0RC_0RE0LD_1LC0LF_1RA0RF` | `6` | `2` | `IsNotHalt` | [Wiki](https://wiki.bbchallenge.org/wiki/1RB---_1RC1RE_1LD0RC_0RE0LD_1LC0LF_1RA0RF) | [`M_1RBHHH_1RC1RE_1LD0RC_0RE0LD_1LC0LF_1RA0RF.lean`](./NonHalt/M_1RBHHH_1RC1RE_1LD0RC_0RE0LD_1LC0LF_1RA0RF.lean) | + diff --git a/BusyBeaver/Basic.lean b/BusyBeaver/Basic.lean index 338eac3f..e2266e2b 100644 --- a/BusyBeaver/Basic.lean +++ b/BusyBeaver/Basic.lean @@ -6,6 +6,7 @@ module public import BusyBeaver.Defs + /-! # Basic Lemmas for `BusyBeaver` Turing Machines (`BusyBeaver.Basic`) @@ -76,7 +77,6 @@ theorem multiStep_of_step_eq_none {M : Machine Γ Λ} {c : Cfg Γ Λ} (h : step M c = none) (n : ℕ) : multiStep M c (n + 1) = none := by rw [multiStep_succ, h, Option.bind_none] - /-- Addition law for `multiStep`: `m + n` steps is `m` steps followed by `n` steps. -/ theorem multiStep_add (M : Machine Γ Λ) (c : Cfg Γ Λ) (m n : ℕ) : multiStep M c (m + n) = (multiStep M c m).bind (fun c' => multiStep M c' n) := by @@ -224,6 +224,37 @@ instance (M : Machine Γ Λ) : Trans (ReachesPlus M) (ReachesStar M) (ReachesPlu instance (M : Machine Γ Λ) : Trans (ReachesStar M) (ReachesPlus M) (ReachesPlus M) := ⟨ReachesStar.trans_plus⟩ +/-! ## Reachability Aliases for Proof Modules -/ + +abbrev stepStar_trans := @ReachesStar.trans +abbrev stepPlus_stepStar := @ReachesPlus.to_star +abbrev stepPlus_trans := @ReachesPlus.trans +abbrev stepPlus_stepStar_stepPlus := @ReachesPlus.trans_star +abbrev stepStar_stepPlus_stepPlus := @ReachesStar.trans_plus +abbrev stepPlus_stepStar_trans := @ReachesPlus.trans_star +abbrev stepStar_stepPlus_trans := @ReachesStar.trans_plus +abbrev stepPlus_to_stepStar := @ReachesPlus.to_star +abbrev stepStar_of_multiStep := @ReachesIn.to_star +abbrev stepStar_refl := @ReachesStar.refl + +theorem step_multiStep (M : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : step M c₁ = some c₂) : + c₁ [M]⊢^{1} c₂ := + h + +theorem step_stepStar (M : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : step M c₁ = some c₂) : + c₁ [M]⊢* c₂ := + ⟨1, h⟩ + +theorem step_stepPlus (M : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : step M c₁ = some c₂) : + c₁ [M]⊢⁺ c₂ := + ⟨1, by decide, h⟩ + +theorem step_stepStar_stepPlus {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [M]⊢ c₂) (h₂ : c₂ [M]⊢* c₃) : + c₁ [M]⊢⁺ c₃ := by + obtain ⟨m, hm⟩ := h₂ + exact ⟨1 + m, by omega, multiStep_trans h₁ hm⟩ + /-! ## Halting and Non-Halting Invariants -/ /-- `M` eventually reaches a halting configuration starting from `c`. -/ @@ -491,6 +522,71 @@ theorem append_zero_10_pow_one_succ (k : ℕ) (s : ListBlank (Fin 2)) : rw [append_10_pow_one, ListBlank.append_pow_succ] rfl +/-! ## Standard List, ListBlank, and Power Lemmas + +Common List and ListBlank lemmas used across official proofs. -/ + +theorem pow_zero_list {α : Type*} (u : List α) : u ^ (0 : ℕ) = [] := rfl +theorem pow_succ_list {α : Type*} (u : List α) (n : ℕ) : u ^ (n + 1) = u ++ u ^ n := rfl +theorem nil_append_list {α : Type*} (l : List α) : ([] : List α) ++ l = l := rfl +theorem cons_append_list {α : Type*} (x : α) (xs ys : List α) : + (x :: xs) ++ ys = x :: (xs ++ ys) := rfl +theorem append_nil_list {α : Type*} (l : List α) : l ++ [] = l := List.append_nil l +theorem listblank_append_nil {α : Type*} [Inhabited α] (b : ListBlank α) : + ([] : List α) +> b = b := rfl +theorem listblank_append_cons {α : Type*} [Inhabited α] (x : α) (xs : List α) (b : ListBlank α) : + (x :: xs) +> b = x >> (xs +> b) := rfl +theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl +theorem zero_cons_default : (0 : Fin 2) >> default = default := ListBlank.cons_zero_default +theorem init_nil : (init ([] : List (Fin 2))) = ⟨some (0 : Fin 6), ⟨0, default, default⟩⟩ := rfl + +theorem listblank_append_right_assoc {α : Type*} [Inhabited α] (l₁ l₂ : List α) (s : ListBlank α) : + (l₁ ++ l₂) +> s = l₁ +> (l₂ +> s) := by + induction l₁ with + | nil => rfl + | cons x xs ih => simp only [List.cons_append, ListBlank.append, ih] + +theorem listblank_append_append {α : Type*} [Inhabited α] (s : ListBlank α) (l₁ l₂ : List α) : + (s <+ l₁) <+ l₂ = s <+ (l₂ ++ l₁) := + ListBlank.append_append s l₁ l₂ + +theorem list_pow_append_one {α : Type*} (u : List α) (k : ℕ) : + u ^ k ++ u = u ^ (k + 1) := + (list_pow_succ' u k).symm + +theorem pow_append_pow {α : Type*} [Inhabited α] (u : List α) (n m : ℕ) (T : ListBlank α) : + (u ^ n) +> ((u ^ m) +> T) = (u ^ (n + m)) +> T := by + rw [list_pow_add, listblank_append_right_assoc] + +theorem ones_append_cons_one (n : ℕ) (T : ListBlank (Fin 2)) : + (([1] : List (Fin 2)) ^ n) +> ((1 : Fin 2) >> T) = + (1 : Fin 2) >> ((([1] : List (Fin 2)) ^ n) +> T) := by + induction n with + | zero => rfl + | succ k ih => + simp only [pow_succ_list, cons_append_list, nil_append_list, listblank_append_cons, ih] + +theorem zeros_append_cons_zero (n : ℕ) (T : ListBlank (Fin 2)) : + (([0] : List (Fin 2)) ^ n) +> ((0 : Fin 2) >> T) = + (0 : Fin 2) >> ((([0] : List (Fin 2)) ^ n) +> T) := by + induction n with + | zero => rfl + | succ k ih => + simp only [pow_succ_list, cons_append_list, nil_append_list, listblank_append_cons, ih] + +theorem zeros_append_default (n : ℕ) : + (([0] : List (Fin 2)) ^ n) +> (default : ListBlank (Fin 2)) = default := by + induction n with + | zero => rfl + | succ k ih => + simp only [pow_succ_list, cons_append_list, nil_append_list, listblank_append_cons, ih, + zero_cons_default] + +theorem listblank_eq_one_cons_tail {Z : ListBlank (Fin 2)} (hZ : Z.head = 1) : + Z = (1 : Fin 2) >> Z.tail := by + rw [← hZ, Turing.ListBlank.cons_head_tail] + theorem init_nil_eq_headRight : (init ([] : List Γ) : Cfg Γ Λ) = Cfg.headRight default default default := rfl @@ -519,13 +615,13 @@ theorem step_headRight_left {M : Machine Γ Λ} {q q' : Λ} {a b : Γ} (hM : M q a = some (some q', Stmt.write b Dir.left)) (l r : ListBlank Γ) : step M (Cfg.headRight q l (ListBlank.cons a r)) = some (Cfg.headLeft q' l (ListBlank.cons b r)) := by - simp [Cfg.headRight, Cfg.headLeft, step, hM, Tape.write, Tape.move] + simp [Cfg.headLeft, step, hM, Tape.write, Tape.move] theorem step_headLeft_right {M : Machine Γ Λ} {q q' : Λ} {a b : Γ} (hM : M q a = some (some q', Stmt.write b Dir.right)) (l r : ListBlank Γ) : step M (Cfg.headLeft q (ListBlank.cons a l) r) = some (Cfg.headRight q' (ListBlank.cons b l) r) := by - simp [Cfg.headRight, Cfg.headLeft, step, hM, Tape.write, Tape.move] + simp [Cfg.headRight, step, hM, Tape.write, Tape.move] theorem step_headLeft_left {M : Machine Γ Λ} {q q' : Λ} {a b : Γ} (hM : M q a = some (some q', Stmt.write b Dir.left)) (l r : ListBlank Γ) : @@ -536,12 +632,12 @@ theorem step_headLeft_left {M : Machine Γ Λ} {q q' : Λ} {a b : Γ} theorem step_headRight_none {M : Machine Γ Λ} {q : Λ} {a : Γ} (hM : M q a = none) (l r : ListBlank Γ) : step M (Cfg.headRight q l (ListBlank.cons a r)) = none := by - simp [Cfg.headRight, step, hM] + simp [step, hM] theorem step_headLeft_none {M : Machine Γ Λ} {q : Λ} {a : Γ} (hM : M q a = none) (l r : ListBlank Γ) : step M (Cfg.headLeft q (ListBlank.cons a l) r) = none := by - simp [Cfg.headLeft, step, hM] + simp [step, hM] theorem step_headRight_default_right {M : Machine Γ Λ} {q q' : Λ} {b : Γ} (hM : M q default = some (some q', Stmt.write b Dir.right)) (l : ListBlank Γ) : @@ -766,37 +862,8 @@ macro "bb_halt" : tactic => rfl)) -/-! ## Directed-Head and Reachability Notations -/ - -@[inherit_doc ListBlank.cons] -scoped notation:67 s:67 " << " a:68 => ListBlank.cons a s - -@[inherit_doc ListBlank.cons] -scoped infixr:67 " >> " => ListBlank.cons - -@[inherit_doc ListBlank.append] -scoped notation:67 s:67 " <+ " l:68 => ListBlank.append l s - -@[inherit_doc ListBlank.append] -scoped infixr:67 " +> " => ListBlank.append - -@[inherit_doc Cfg.headRight] -scoped notation3 l " {{" q "}}> " r => Cfg.headRight q l r - -@[inherit_doc Cfg.headLeft] -scoped notation3 l " <{{" q "}} " r => Cfg.headLeft q l r - -@[inherit_doc step] -scoped notation3 c₁ " [" M "]⊢ " c₂ => step M c₁ = some c₂ - -@[inherit_doc multiStep] -scoped notation3 c₁ " [" M "]⊢^{" n "} " c₂ => multiStep M c₁ n = some c₂ - -@[inherit_doc ReachesStar] -scoped notation3 c₁ " [" M "]⊢* " c₂ => ReachesStar M c₁ c₂ - -@[inherit_doc ReachesPlus] -scoped notation3 c₁ " [" M "]⊢⁺ " c₂ => ReachesPlus M c₁ c₂ +/-! ## Directed-Head and Reachability Notations +(Defined in `BusyBeaver.Defs`) -/ /-! ## Additional Half-Tape Power Lemmas -/ diff --git a/BusyBeaver/Bridge.lean b/BusyBeaver/Bridge.lean index e59ff163..44ef97dd 100644 --- a/BusyBeaver/Bridge.lean +++ b/BusyBeaver/Bridge.lean @@ -38,7 +38,8 @@ private def parseRleBlock (block : String) : TermElabM (TSyntax `term) := do let wChar := chars[3 * i]! let dChar := chars[3 * i + 1]! let sChar := chars[3 * i + 2]! - if wChar == '-' && dChar == '-' && sChar == '-' then + if (wChar == '-' && dChar == '-' && sChar == '-') || + (wChar == 'H' && dChar == 'H' && sChar == 'H') then cellStxs := cellStxs.push (← `(none)) else if !wChar.isDigit then diff --git a/BusyBeaver/Calculi/CertTree.lean b/BusyBeaver/Calculi/CertTree.lean new file mode 100644 index 00000000..f10e4aba --- /dev/null +++ b/BusyBeaver/Calculi/CertTree.lean @@ -0,0 +1,3924 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter + +/-! +# Certified Search Tree Calculus (`BusyBeaver.Calculi.CertTree`) + +Compact tree-structured inductive certificates for finite reachability +and halting/non-halting state exploration in complex Busy Beaver machines. +-/ + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.CertTreeEngine + +private theorem if_pos {c : Prop} [Decidable c] (hc : c) {α : Sort*} {t e : α} : + (if c then t else e) = t := by + simp [hc] + +private theorem if_neg {c : Prop} [Decidable c] (hnc : ¬c) {α : Sort*} {t e : α} : + (if c then t else e) = e := by + simp [hnc] + +theorem pow_one_add (u : List (Fin 2)) (n : Nat) : u ^ (1 + n) = u ++ u ^ n := by + rw [Nat.add_comm 1 n, pow_succ_list] + +def D_word (n : Nat) : List (Fin 2) := [1] ++ ([1, 1] : List (Fin 2)) ^ n ++ [0, 0] +def S_word (n : Nat) : List (Fin 2) := [1] ++ ([0, 1] : List (Fin 2)) ^ (1 + n) +def PL_word (n : Nat) : List (Fin 2) := + ([1, 0] : List (Fin 2)) ^ (n + 4) ++ ([1, 1] : List (Fin 2)) ^ n ++ S_word 0 ++ S_word 0 + +def CfgR (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + Cfg.headRight A l ([0, 1, 0, 0] +> r) + +def CfgL (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + Cfg.headLeft B l ([1] +> r) + +def CfgJ (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + Cfg.headLeft C l ([1, 0, 0] +> r) +theorem rot_pow_cons (a : Fin 2) (w : List (Fin 2)) (k : Nat) (s : ListBlank (Fin 2)) : + ((a :: w) ^ k) +> (a >> s) = a >> (((w ++ [a]) ^ k) +> s) := by + induction k generalizing s with + | zero => rfl + | succ k ih => + rw [pow_succ_list, pow_succ_list, listblank_append_right_assoc, ih] + simp only [List.cons_append, List.nil_append, List.append_assoc, + listblank_append_right_assoc, listblank_append_cons] + +theorem rot_01 (k : Nat) (s : ListBlank (Fin 2)) : + (([0, 1] : List (Fin 2)) ^ k) +> ((0 : Fin 2) >> s) = + (0 : Fin 2) >> ((([1, 0] : List (Fin 2)) ^ k) +> s) := + rot_pow_cons 0 [1] k s + +theorem rot_10 (k : Nat) (s : ListBlank (Fin 2)) : + (([1, 0] : List (Fin 2)) ^ k) +> ((1 : Fin 2) >> s) = + (1 : Fin 2) >> ((([0, 1] : List (Fin 2)) ^ k) +> s) := + rot_pow_cons 1 [0] k s + +theorem rot_11 (k : Nat) (s : ListBlank (Fin 2)) : + (([1, 1] : List (Fin 2)) ^ k) +> ((1 : Fin 2) >> s) = + (1 : Fin 2) >> ((([1, 1] : List (Fin 2)) ^ k) +> s) := + rot_pow_cons 1 [1] k s + +theorem rot_0101 (k : Nat) (s : ListBlank (Fin 2)) : + (([0, 1, 0, 1] : List (Fin 2)) ^ k) +> ((0 : Fin 2) >> s) = + (0 : Fin 2) >> ((([1, 0, 1, 0] : List (Fin 2)) ^ k) +> s) := + rot_pow_cons 0 [1, 0, 1] k s + +theorem rot_1010 (k : Nat) (s : ListBlank (Fin 2)) : + (([1, 0, 1, 0] : List (Fin 2)) ^ k) +> ((1 : Fin 2) >> s) = + (1 : Fin 2) >> ((([0, 1, 0, 1] : List (Fin 2)) ^ k) +> s) := + rot_pow_cons 1 [0, 1, 0] k s + +theorem rot_1101 (k : Nat) (s : ListBlank (Fin 2)) : + (([1, 1, 0, 1] : List (Fin 2)) ^ k) +> ((1 : Fin 2) >> s) = + (1 : Fin 2) >> ((([1, 0, 1, 1] : List (Fin 2)) ^ k) +> s) := + rot_pow_cons 1 [1, 0, 1] k s + +theorem rot_1011 (k : Nat) (s : ListBlank (Fin 2)) : + (([1, 0, 1, 1] : List (Fin 2)) ^ k) +> ((1 : Fin 2) >> s) = + (1 : Fin 2) >> ((([0, 1, 1, 1] : List (Fin 2)) ^ k) +> s) := + rot_pow_cons 1 [0, 1, 1] k s + +theorem rot_0111 (k : Nat) (s : ListBlank (Fin 2)) : + (([0, 1, 1, 1] : List (Fin 2)) ^ k) +> ((0 : Fin 2) >> s) = + (0 : Fin 2) >> ((([1, 1, 1, 0] : List (Fin 2)) ^ k) +> s) := + rot_pow_cons 0 [1, 1, 1] k s + +theorem rot_1110 (k : Nat) (s : ListBlank (Fin 2)) : + (([1, 1, 1, 0] : List (Fin 2)) ^ k) +> ((1 : Fin 2) >> s) = + (1 : Fin 2) >> ((([1, 1, 0, 1] : List (Fin 2)) ^ k) +> s) := + rot_pow_cons 1 [1, 1, 0] k s + +theorem pow_two_add (u : List (Fin 2)) (n : Nat) : u ^ (2 + n) = u ++ (u ++ u ^ n) := by + have h : 2 + n = 1 + (1 + n) := by omega + rw [h, pow_one_add, pow_one_add] + +theorem pow_add_two (u : List (Fin 2)) (n : Nat) : u ^ (n + 2) = u ++ (u ++ u ^ n) := by + rw [Nat.add_comm n 2, pow_two_add] + +theorem pow_add_four (u : List (Fin 2)) (n : Nat) : u ^ (n + 4) = u ++ (u ++ (u ++ (u ++ u ^ n))) := + by + have h : n + 4 = (n + 2) + 2 := by omega + rw [h, pow_add_two, pow_add_two] + +theorem pow_mul_two (u : List (Fin 2)) (k : Nat) : u ^ (k * 2) = (u ++ u) ^ k := by + rw [Nat.mul_comm k 2, list_pow_mul] + simp only [pow_succ_list, pow_zero_list, List.append_nil] + +macro "norm_cb" : tactic => + `(tactic| try simp only [CfgR, CfgL, CfgJ, D_word, S_word, PL_word, + List.append_assoc, List.cons_append, List.nil_append, List.append_nil, + listblank_append_right_assoc, listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, default_head, default_tail, + zero_cons_default, pow_zero_list, pow_succ_list, pow_one_add, pow_two_add, pow_add_two, + pow_add_four, pow_mul_two, + ones_append_cons_one, zeros_append_cons_zero, pow_append_pow, zeros_append_default, + rot_01, rot_10, rot_11, rot_0101, rot_1010, rot_1101, rot_1011, rot_0111, rot_1110, + Nat.zero_add, Nat.add_zero]) + +macro "follow" t:term : tactic => + `(tactic| (norm_cb; refine ReachesStar.trans $t ?_; norm_cb)) + +macro "nsteps" n:num : tactic => + `(tactic| (norm_cb; iterate $n bb_step)) + +macro "fsteps" : tactic => + `(tactic| (norm_cb; bb_steps)) + +def withNat {α : Type} (x : Nat) (k : Nat → α) : α := + match x + 1 with + | 0 => k 0 + | v + 1 => k v + +@[simp] theorem withNat_apply {α : Type} (x : Nat) (k : Nat → α) : withNat x k = k x := by + cases x <;> rfl + +-- ============================================================================ +-- Section 1: Runs (Certified Symbolic RLE Half-Tapes) +-- ============================================================================ + + +def beqFin2 (a b : Fin 2) : Bool := Nat.beq a.val b.val + +theorem beqFin2_eq (a b : Fin 2) (h : beqFin2 a b = true) : a = b := + Fin.ext (Nat.eq_of_beq_eq_true h) + +def beqFin6 (a b : Fin 6) : Bool := Nat.beq a.val b.val + +theorem beqFin6_eq (a b : Fin 6) (h : beqFin6 a b = true) : a = b := + Fin.ext (Nat.eq_of_beq_eq_true h) + +def beqListFin2 : List (Fin 2) → List (Fin 2) → Bool + | [], [] => true + | a :: as, b :: bs => if beqFin2 a b then beqListFin2 as bs else false + | _, _ => false + +theorem beqListFin2_eq (xs ys : List (Fin 2)) (h : beqListFin2 xs ys = true) : xs = ys := by + induction xs generalizing ys with + | nil => cases ys <;> first | rfl | contradiction + | cons a as ih => + cases ys with + | nil => contradiction + | cons b bs => + dsimp [beqListFin2] at h + cases hab : beqFin2 a b + · rw [hab] at h; contradiction + · rw [hab] at h; simp only [↓reduceIte] at h + rw [beqFin2_eq a b hab, ih bs h] + +inductive SymWord where + | raw (w : List (Fin 2)) + | D (n : Nat) + | S (n : Nat) + | PL (n : Nat) + deriving DecidableEq + +def SymWord.toList : SymWord → List (Fin 2) + | .raw w => w + | .D n => D_word n + | .S n => S_word n + | .PL n => PL_word n + +def SymWord.isEmpty : SymWord → Bool + | .raw [] => true + | _ => false + +theorem SymWord.isEmpty_spec (w : SymWord) (h : w.isEmpty = true) : w.toList = [] := by + cases w with + | raw l => cases l <;> first | rfl | contradiction + | D _ => contradiction + | S _ => contradiction + | PL _ => contradiction + +def SymWord.beq : SymWord → SymWord → Bool + | .raw w, .raw v => beqListFin2 w v + | .D n, .D m => Nat.beq n m + | .S n, .S m => Nat.beq n m + | .PL n, .PL m => Nat.beq n m + | _, _ => false + +theorem SymWord.beq_eq (w v : SymWord) (h : SymWord.beq w v = true) : w.toList = v.toList := by + cases w <;> cases v <;> try contradiction + · exact beqListFin2_eq _ _ h + · rw [Nat.eq_of_beq_eq_true h] + · rw [Nat.eq_of_beq_eq_true h] + · rw [Nat.eq_of_beq_eq_true h] + +abbrev Runs := List (SymWord × Nat) + +def Runs.denote : Runs → ListBlank (Fin 2) + | [] => default + | (w, n) :: xs => (w.toList ^ n) +> denote xs + + +def Runs.push (w : SymWord) (n : Nat) (xs : Runs) : Runs := + if w.isEmpty || Nat.beq n 0 then xs + else + match xs with + | (v, m) :: ys => + if SymWord.beq w v then + withNat (n + m) fun nm => (w, nm) :: ys + else (w, n) :: (v, m) :: ys + | [] => [(w, n)] + +theorem Runs.push_spec (w : SymWord) (n : Nat) (xs : Runs) : + denote (push w n xs) = (w.toList ^ n) +> denote xs := by + dsimp only [push] + cases he : w.isEmpty + · cases hn : Nat.beq n 0 + · simp only [Bool.or_self, Bool.false_eq_true, ↓reduceIte] + cases xs with + | nil => rfl + | cons vm ys => + rcases vm with ⟨v, m⟩ + dsimp only [withNat] + cases h : SymWord.beq w v + · simp [denote] + · simp [denote, ← SymWord.beq_eq w v h, pow_append_pow] + · simp [Nat.eq_of_beq_eq_true hn] + · simp [SymWord.isEmpty_spec w he, nil_pow] + +def Runs.pop : Runs → Fin 2 × Runs + | [] => (0, []) + | (_, 0) :: xs => pop xs + | (.raw [], _ + 1) :: xs => pop xs + | (.raw (b :: rest), n + 1) :: xs => + (b, push (.raw rest) 1 (push (.raw (b :: rest)) n xs)) + | (.D k, n + 1) :: xs => + (1, push (.raw [1, 1]) k (push (.raw [0, 0]) 1 (push (.D k) n xs))) + | (.S k, n + 1) :: xs => + withNat (1 + k) fun k1 => + (1, push (.raw [0, 1]) k1 (push (.S k) n xs)) + | (.PL k, n + 1) :: xs => + withNat (k + 3) fun k3 => + (1, push (.raw [0]) 1 (push (.raw [1, 0]) k3 (push (.raw [1, + 1]) k (push (.S 0) 2 (push (.PL k) n xs))))) + +theorem Runs.pop_spec (xs : Runs) : + denote xs = (pop xs).1 >> denote (pop xs).2 := by + induction xs with + | nil => + dsimp [pop, denote] + exact zero_cons_default.symm + | cons wn xs ih => + rcases wn with ⟨w, n⟩ + cases n with + | zero => + dsimp [pop, denote] + exact ih + | succ n => + cases w with + | raw l => + cases l with + | nil => + dsimp only [pop, denote, SymWord.toList] + rw [nil_pow, listblank_append_nil] + exact ih + | cons b rest => + dsimp only [pop, denote, SymWord.toList] + rw [push_spec, push_spec] + simp only [SymWord.toList, pow_succ_list, pow_zero_list, List.append_nil, + List.cons_append, listblank_append_right_assoc, listblank_append_cons] + | D k => + dsimp only [pop, denote, SymWord.toList] + rw [push_spec, push_spec, push_spec] + simp only [D_word, SymWord.toList, pow_succ_list, pow_zero_list, List.append_nil, + List.cons_append, List.nil_append, List.append_assoc, + listblank_append_right_assoc, listblank_append_cons, listblank_append_nil] + | S k => + dsimp only [pop, denote, SymWord.toList, withNat] + rw [push_spec, push_spec] + simp only [S_word, SymWord.toList, pow_succ_list, + List.cons_append, List.nil_append, + listblank_append_right_assoc, listblank_append_cons] + | PL k => + dsimp only [pop, denote, SymWord.toList, withNat] + rw [push_spec, push_spec, push_spec, push_spec, push_spec] + dsimp only [PL_word, SymWord.toList] + have hk4 : k + 4 = 1 + (k + 3) := by omega + rw [hk4, pow_one_add] + simp only [pow_succ_list, pow_zero_list, List.append_nil, + List.cons_append, List.nil_append, List.append_assoc, + listblank_append_right_assoc, listblank_append_cons, listblank_append_nil] + +def Runs.remove : List (Fin 2) → Runs → Option Runs + | [], xs => some xs + | b :: w, xs => + let (c, ys) := pop xs + if beqFin2 b c then remove w ys else none + +theorem Runs.remove_spec (w : List (Fin 2)) (xs ys : Runs) + (h : remove w xs = some ys) : denote xs = w +> denote ys := by + induction w generalizing xs with + | nil => + simp only [remove, Option.some.injEq] at h + subst h; rfl + | cons b w ih => + dsimp only [remove] at h + have hp := pop_spec xs + rcases hpop : pop xs with ⟨c, zs⟩ + rw [hpop] at h hp + dsimp only at h hp + cases hbc : beqFin2 b c + · rw [hbc] at h; simp at h + · rw [hbc] at h; simp only [↓reduceIte] at h + rw [beqFin2_eq b c hbc, hp, ih zs h, listblank_append_cons] + + +def strip_prefix : List (Fin 2) → List (Fin 2) → Option (List (Fin 2)) + | [], ys => some ys + | x :: xs, y :: ys => if beqFin2 x y then strip_prefix xs ys else none + | _ :: _, [] => none + +theorem strip_prefix_spec (xs ys zs : List (Fin 2)) (h : strip_prefix xs ys = some zs) : + ys = xs ++ zs := by + induction xs generalizing ys with + | nil => + dsimp [strip_prefix] at h + injection h with h + | cons x xs ih => + cases ys with + | nil => simp [strip_prefix] at h + | cons y ys => + dsimp [strip_prefix] at h + cases hxy : beqFin2 x y + · rw [hxy] at h; simp at h + · rw [hxy] at h; simp only [↓reduceIte] at h + rw [beqFin2_eq x y hxy, ih ys h, List.cons_append] + +def strip_many : Nat → List (Fin 2) → List (Fin 2) → Nat × List (Fin 2) + | 0, _, v => (0, v) + | limit + 1, u, v => + match strip_prefix u v with + | some v' => + let (k, r) := strip_many limit u v' + withNat (1 + k) fun k' => (k', r) + | none => (0, v) + +theorem strip_many_spec (limit : Nat) (u v : List (Fin 2)) : + let (k, r) := strip_many limit u v + k ≤ limit ∧ v = (u ^ k) ++ r := by + induction limit generalizing v with + | zero => simp [strip_many] + | succ limit ih => + dsimp only [strip_many] + cases hsp : strip_prefix u v with + | none => simp + | some v' => + dsimp only + have hv := strip_prefix_spec u v v' hsp + have ih' := ih v' + rcases hsm : strip_many limit u v' with ⟨k, r⟩ + rw [hsm] at ih' + dsimp only [withNat] at ih' ⊢ + refine ⟨by omega, ?_⟩ + rw [hv, ih'.2, pow_one_add, List.append_assoc] + +theorem commute_power (x v w : List (Fin 2)) (a b k : Nat) + (h : x ++ (v ^ a) = (w ^ b) ++ x) : + x ++ (v ^ (k * a)) = (w ^ (k * b)) ++ x := by + induction k with + | zero => simp + | succ k ih => + have hka : (k + 1) * a = a + k * a := by ring + have hkb : (k + 1) * b = b + k * b := by ring + rw [hka, hkb, list_pow_add, list_pow_add, ← List.append_assoc, h, List.append_assoc, ih, + List.append_assoc] + +def first_bit_eq : List (Fin 2) → List (Fin 2) → List (Fin 2) → Bool + | x :: _, _, w :: _ => beqFin2 x w + | [], v :: _, w :: _ => beqFin2 v w + | _, _, _ => false + +def Runs.skip_block (w : List (Fin 2)) (limit : Nat) (x v : List (Fin 2)) (m : Nat) (ys : Runs) : + Option (Nat × Runs) := + if first_bit_eq x v w then + let a := w.length + if Nat.ble a m && Nat.ble a 4 then + let b := v.length + if Nat.ble b 4 then + if beqListFin2 (x ++ (v ^ a)) ((w ^ b) ++ x) then + withNat (Nat.min (limit / b) (m / a)) fun k => + if Nat.blt 0 k then + withNat (k * b) fun kb => + withNat (k * a) fun ka => + if Nat.ble kb limit then + if Nat.ble ka m then + withNat (m - ka) fun rem => + some (kb, push (.raw x) 1 (push (.raw v) rem ys)) + else none + else none + else none + else none + else none + else none + else none + +theorem Runs.skip_block_spec (w : List (Fin 2)) (limit : Nat) (x v : List (Fin 2)) (m : Nat) + (ys : Runs) (n : Nat) (zs : Runs) + (h : skip_block w limit x v m ys = some (n, zs)) : + n ≤ limit ∧ (x +> ((v ^ m) +> denote ys)) = ((w ^ n) +> denote zs) := by + dsimp only [skip_block] at h + simp only [withNat] at h + generalize hk : Nat.min (limit / v.length) (m / w.length) = k at h + cases hfb : first_bit_eq x v w <;> rw [hfb] at h + · contradiction + simp only [↓reduceIte] at h + cases ham : Nat.ble w.length m && Nat.ble w.length 4 <;> rw [ham] at h + · contradiction + simp only [↓reduceIte] at h + cases hb4 : Nat.ble v.length 4 <;> rw [hb4] at h + · contradiction + simp only [↓reduceIte] at h + cases heq : beqListFin2 (x ++ (v ^ w.length)) ((w ^ v.length) ++ x) <;> rw [heq] at h + · contradiction + simp only [↓reduceIte] at h + cases hk0 : Nat.blt 0 k <;> rw [hk0] at h + · contradiction + simp only [↓reduceIte] at h + cases hkb : Nat.ble (k * v.length) limit <;> rw [hkb] at h + · contradiction + simp only [↓reduceIte] at h + cases hka : Nat.ble (k * w.length) m <;> rw [hka] at h + · contradiction + simp only [↓reduceIte, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + have hkb' : k * v.length ≤ limit := Nat.le_of_ble_eq_true hkb + have hka' : k * w.length ≤ m := Nat.le_of_ble_eq_true hka + refine ⟨hkb', ?_⟩ + rw [push_spec, push_spec] + dsimp only [SymWord.toList] + have hm : m = k * w.length + (m - k * w.length) := by omega + conv_lhs => rw [hm, list_pow_add, listblank_append_right_assoc] + rw [← listblank_append_right_assoc x (v ^ (k * w.length))] + rw [commute_power x v w w.length v.length k (beqListFin2_eq _ _ heq)] + simp only [pow_succ_list, pow_zero_list, List.append_nil, listblank_append_right_assoc] + +def Runs.skip_periodic (w : List (Fin 2)) (n : Nat) : Runs → Option (Nat × Runs) + | (.raw x, 1) :: (.raw v, m) :: ys => skip_block w n x v m ys + | (.raw v, m) :: ys => skip_block w n [] v m ys + | _ => none + +theorem Runs.skip_periodic_spec (w : List (Fin 2)) (n : Nat) (xs : Runs) (k : Nat) (ys : Runs) + (h : skip_periodic w n xs = some (k, ys)) : + k ≤ n ∧ denote xs = (w ^ k) +> denote ys := by + cases xs with + | nil => simp [skip_periodic] at h + | cons xm rest => + rcases xm with ⟨xw, m1⟩ + cases xw with + | D _ => simp [skip_periodic] at h + | S _ => simp [skip_periodic] at h + | PL _ => simp [skip_periodic] at h + | raw x => + cases m1 with + | zero => + dsimp [skip_periodic] at h + have hs := skip_block_spec w n [] x 0 rest k ys h + simpa [denote, SymWord.toList] using hs + | succ m1' => + cases m1' with + | zero => + cases rest with + | nil => + dsimp [skip_periodic] at h + have hs := skip_block_spec w n [] x 1 [] k ys h + simpa [denote, SymWord.toList] using hs + | cons vm ys' => + rcases vm with ⟨vw, m⟩ + cases vw with + | D _ => + dsimp [skip_periodic] at h + have hs := skip_block_spec w n [] x 1 ((.D _, m) :: ys') k ys h + simpa [denote, SymWord.toList] using hs + | S _ => + dsimp [skip_periodic] at h + have hs := skip_block_spec w n [] x 1 ((.S _, m) :: ys') k ys h + simpa [denote, SymWord.toList] using hs + | PL _ => + dsimp [skip_periodic] at h + have hs := skip_block_spec w n [] x 1 ((.PL _, m) :: ys') k ys h + simpa [denote, SymWord.toList] using hs + | raw v => + dsimp [skip_periodic] at h + have hs := skip_block_spec w n x v m ys' k ys h + simpa [denote, SymWord.toList, pow_succ_list, pow_zero_list, List.append_nil] using hs + | succ m1'' => + dsimp [skip_periodic] at h + have hs := skip_block_spec w n [] x (m1'' + 2) rest k ys h + simpa [denote, SymWord.toList] using hs + +def Runs.skip (w : SymWord) (n : Nat) (xs : Runs) : Option (Nat × Runs) := + match xs with + | (v, m) :: ys => + if SymWord.beq w v then + withNat (Nat.min n m) fun k => + withNat (m - k) fun rem => + some (k, push v rem ys) + else + match w, v with + | .raw wl, .raw vl => + match skip_periodic wl n xs with + | some res => some res + | none => + if Nat.blt 0 m then + let (k, v_rest) := strip_many (Nat.min n 512) wl vl + if Nat.blt 0 k then + withNat (m - 1) fun m' => + some (k, push (.raw v_rest) 1 (push (.raw vl) m' ys)) + else none + else none + | _, _ => none + | [] => none + +theorem Runs.skip_spec (w : SymWord) (n : Nat) (xs : Runs) (k : Nat) (ys : Runs) + (h : skip w n xs = some (k, ys)) : + k ≤ n ∧ denote xs = (w.toList ^ k) +> denote ys := by + cases xs with + | nil => simp [skip] at h + | cons vm rest => + rcases vm with ⟨v, m⟩ + dsimp only [skip, withNat] at h + cases hwv : SymWord.beq w v + · rw [hwv] at h; simp only [Bool.false_eq_true, ↓reduceIte] at h + cases w <;> cases v <;> try contradiction + rename_i wl vl + dsimp only [SymWord.toList] at h ⊢ + cases hsp : skip_periodic wl n ((.raw vl, m) :: rest) with + | some res => + rw [hsp] at h; simp only [Option.some.injEq] at h; subst h + exact skip_periodic_spec wl n ((.raw vl, m) :: rest) k ys hsp + | none => + rw [hsp] at h; dsimp only at h + cases hm0 : Nat.blt 0 m <;> rw [hm0] at h + · contradiction + simp only [↓reduceIte] at h + have hm0' : 0 < m := Nat.le_of_ble_eq_true hm0 + have hsm := strip_many_spec (Nat.min n 512) wl vl + rcases hstrip : strip_many (Nat.min n 512) wl vl with ⟨k', v_rest⟩ + rw [hstrip] at h hsm + dsimp only at h hsm + cases hk0 : Nat.blt 0 k' <;> rw [hk0] at h + · contradiction + simp only [↓reduceIte, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + have hmin : Nat.min n 512 ≤ n := Nat.min_le_left n 512 + refine ⟨by omega, ?_⟩ + dsimp only [denote] + rw [push_spec, push_spec] + dsimp only [SymWord.toList] + have hm1 : m = 1 + (m - 1) := by omega + conv_lhs => rw [hm1, pow_one_add, listblank_append_right_assoc] + simp only [pow_succ_list, pow_zero_list, List.append_nil, + ← listblank_append_right_assoc (wl ^ k') v_rest, ← hsm.2] + · rw [hwv] at h; simp only [↓reduceIte, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + rw [SymWord.beq_eq w v hwv] + refine ⟨Nat.min_le_left n m, ?_⟩ + dsimp only [denote] + rw [push_spec, pow_append_pow] + have hmin : Nat.min n m ≤ m := Nat.min_le_right n m + have hm : Nat.min n m + (m - Nat.min n m) = m := by omega + rw [hm] + +def Runs.remove_one : Nat → List (Fin 2) → Runs → Option Runs + | _, [], xs => some xs + | 0, b :: w, xs => remove (b :: w) xs + | fuel + 1, b :: w, xs => + match xs with + | (.raw v, m) :: ys => + if Nat.beq m 1 then + match strip_prefix v (b :: w) with + | some w_rest => remove_one fuel w_rest ys + | none => + let (c, zs) := pop xs + if beqFin2 b c then remove_one fuel w zs else none + else if Nat.blt 0 m then + let (k, w_rest) := strip_many (Nat.min m 512) v (b :: w) + if Nat.blt 0 k then + withNat (m - k) fun rem => + remove_one fuel w_rest (push (.raw v) rem ys) + else + let (c, zs) := pop xs + if beqFin2 b c then remove_one fuel w zs else none + else remove (b :: w) xs + | _ :: _ => + let (c, zs) := pop xs + if beqFin2 b c then remove_one fuel w zs else none + | [] => remove (b :: w) [] + +theorem Runs.remove_one_spec (fuel : Nat) (w : List (Fin 2)) (xs ys : Runs) + (h : remove_one fuel w xs = some ys) : denote xs = w +> denote ys := by + induction fuel generalizing w xs with + | zero => + cases w with + | nil => simp only [remove_one, Option.some.injEq] at h; subst h; rfl + | cons b w' => exact remove_spec (b :: w') xs ys h + | succ fuel ih => + cases w with + | nil => simp only [remove_one, Option.some.injEq] at h; subst h; rfl + | cons b w' => + cases xs with + | nil => exact remove_spec (b :: w') [] ys h + | cons vm rest => + rcases vm with ⟨v, m⟩ + cases v with + | raw vl => + dsimp only [remove_one, withNat] at h + cases hm1 : Nat.beq m 1 <;> rw [hm1] at h + · simp only [Bool.false_eq_true, ↓reduceIte] at h + cases hm : Nat.blt 0 m <;> rw [hm] at h + · simp only [Bool.false_eq_true, ↓reduceIte] at h + exact remove_spec (b :: w') ((.raw vl, m) :: rest) ys h + · simp only [↓reduceIte] at h + have hm' : 0 < m := Nat.le_of_ble_eq_true hm + have hsm := strip_many_spec (Nat.min m 512) vl (b :: w') + rcases hstrip : strip_many (Nat.min m 512) vl (b :: w') with ⟨k, w_rest⟩ + rw [hstrip] at h hsm + dsimp only at h hsm + cases hk : Nat.blt 0 k <;> rw [hk] at h + · simp only [Bool.false_eq_true, ↓reduceIte] at h + have hp := pop_spec ((.raw vl, m) :: rest) + rcases hpop : pop ((.raw vl, m) :: rest) with ⟨c, zs⟩ + rw [hpop] at h hp + dsimp only at h hp + cases hbc : beqFin2 b c <;> rw [hbc] at h + · contradiction + · simp only [↓reduceIte] at h + rw [beqFin2_eq b c hbc, hp, ih w' zs h, listblank_append_cons] + · simp only [↓reduceIte] at h + have ih' := ih w_rest (push (.raw vl) (m - k) rest) h + rw [push_spec] at ih' + dsimp only [denote, SymWord.toList] at ih' ⊢ + have hmin : Nat.min m 512 ≤ m := Nat.min_le_left m 512 + have hmk : m = k + (m - k) := by omega + rw [hmk, list_pow_add, listblank_append_right_assoc, ih', + ← listblank_append_right_assoc, ← hsm.2] + · simp only [↓reduceIte] at h + cases hsp : strip_prefix vl (b :: w') with + | none => + rw [hsp] at h; dsimp only at h + have hp := pop_spec ((.raw vl, m) :: rest) + rcases hpop : pop ((.raw vl, m) :: rest) with ⟨c, zs⟩ + rw [hpop] at h hp + dsimp only at h hp + cases hbc : beqFin2 b c <;> rw [hbc] at h + · contradiction + · simp only [↓reduceIte] at h + rw [beqFin2_eq b c hbc, hp, ih w' zs h, listblank_append_cons] + | some w_rest => + rw [hsp] at h; dsimp only at h + have ih' := ih w_rest rest h + dsimp only [denote, SymWord.toList] + rw [Nat.eq_of_beq_eq_true hm1, pow_succ_list, pow_zero_list, List.append_nil, + strip_prefix_spec vl (b :: w') w_rest hsp, listblank_append_right_assoc, ih'] + | D d => + dsimp only [remove_one] at h + have hp := pop_spec ((.D d, m) :: rest) + rcases hpop : pop ((.D d, m) :: rest) with ⟨c, zs⟩ + rw [hpop] at h hp; dsimp only at h hp + cases hbc : beqFin2 b c <;> rw [hbc] at h + · contradiction + · simp only [↓reduceIte] at h + rw [beqFin2_eq b c hbc, hp, ih w' zs h, listblank_append_cons] + | S d => + dsimp only [remove_one] at h + have hp := pop_spec ((.S d, m) :: rest) + rcases hpop : pop ((.S d, m) :: rest) with ⟨c, zs⟩ + rw [hpop] at h hp; dsimp only at h hp + cases hbc : beqFin2 b c <;> rw [hbc] at h + · contradiction + · simp only [↓reduceIte] at h + rw [beqFin2_eq b c hbc, hp, ih w' zs h, listblank_append_cons] + | PL d => + dsimp only [remove_one] at h + have hp := pop_spec ((.PL d, m) :: rest) + rcases hpop : pop ((.PL d, m) :: rest) with ⟨c, zs⟩ + rw [hpop] at h hp; dsimp only at h hp + cases hbc : beqFin2 b c <;> rw [hbc] at h + · contradiction + · simp only [↓reduceIte] at h + rw [beqFin2_eq b c hbc, hp, ih w' zs h, listblank_append_cons] + + +def remove_prefix (w : List (Fin 2)) (xs : Runs) : Option Runs := + match w, xs with + | [], _ => some xs + | b :: _, (.raw (b' :: v_rest), m) :: ys => + if beqFin2 b b' then + if Nat.beq m 1 && beqListFin2 w (b' :: v_rest) then + some ys + else Runs.remove_one 16 w xs + else none + | b :: _, (.D _, _ + 1) :: _ => + if beqFin2 b 1 then Runs.remove_one 16 w xs else none + | b :: _, (.S _, _ + 1) :: _ => + if beqFin2 b 1 then Runs.remove_one 16 w xs else none + | b :: _, (.PL _, _ + 1) :: _ => + if beqFin2 b 1 then Runs.remove_one 16 w xs else none + | _, _ => Runs.remove_one 16 w xs + +theorem remove_prefix_spec (w : List (Fin 2)) (xs ys : Runs) + (h : remove_prefix w xs = some ys) : Runs.denote xs = w +> Runs.denote ys := by + unfold remove_prefix at h + rcases w with _ | ⟨b, w_rest⟩ + · simp only [Option.some.injEq] at h; subst h; rfl + rcases xs with _ | ⟨⟨v, m⟩, rest⟩ + · exact Runs.remove_one_spec 16 (b :: w_rest) [] ys h + cases v with + | raw vl => + rcases vl with _ | ⟨b', v_rest⟩ + · exact Runs.remove_one_spec 16 (b :: w_rest) ((.raw [], m) :: rest) ys h + dsimp only at h + cases hbb : beqFin2 b b' <;> rw [hbb] at h + · contradiction + simp only [↓reduceIte] at h + cases hm1 : Nat.beq m 1 && beqListFin2 (b :: w_rest) (b' :: v_rest) <;> rw [hm1] at h + · simp only [Bool.false_eq_true, ↓reduceIte] at h + exact Runs.remove_one_spec 16 (b :: w_rest) ((.raw (b' :: v_rest), m) :: rest) ys h + · simp only [↓reduceIte, Option.some.injEq] at h; subst h + rcases Bool.and_eq_true_iff.mp hm1 with ⟨hm, hwv⟩ + rw [Nat.eq_of_beq_eq_true hm, ← beqListFin2_eq _ _ hwv] + simp [Runs.denote, SymWord.toList, pow_succ_list] + | D d => + cases m with + | zero => exact Runs.remove_one_spec 16 (b :: w_rest) ((.D d, 0) :: rest) ys h + | succ m' => + dsimp only at h + split_ifs at h + exact Runs.remove_one_spec 16 (b :: w_rest) ((.D d, m' + 1) :: rest) ys h + | S d => + cases m with + | zero => exact Runs.remove_one_spec 16 (b :: w_rest) ((.S d, 0) :: rest) ys h + | succ m' => + dsimp only at h + split_ifs at h + exact Runs.remove_one_spec 16 (b :: w_rest) ((.S d, m' + 1) :: rest) ys h + | PL d => + cases m with + | zero => exact Runs.remove_one_spec 16 (b :: w_rest) ((.PL d, 0) :: rest) ys h + | succ m' => + dsimp only at h + split_ifs at h + exact Runs.remove_one_spec 16 (b :: w_rest) ((.PL d, m' + 1) :: rest) ys h + +def Runs.remove_fast_raw : Nat → List (Fin 2) → Nat → Runs → Option Runs + | _, _, 0, xs => some xs + | 0, _, _ + 1, _ => none + | _fuel + 1, [], _ + 1, xs => some xs + | fuel + 1, b :: wl, n + 1, xs => + match skip (.raw (b :: wl)) (n + 1) xs with + | some (k, ys) => + withNat (n + 1 - k) fun rem => + remove_fast_raw fuel (b :: wl) rem ys + | none => + match remove_one 16 (b :: wl) xs with + | some ys => remove_fast_raw fuel (b :: wl) n ys + | none => none + +theorem Runs.remove_fast_raw_spec (fuel : Nat) (wl : List (Fin 2)) (n : Nat) (xs ys : Runs) + (h : remove_fast_raw fuel wl n xs = some ys) : denote xs = (wl ^ n) +> denote ys := by + induction fuel generalizing n xs with + | zero => + cases n with + | zero => simp only [remove_fast_raw, Option.some.injEq] at h; subst h; rfl + | succ n => simp [remove_fast_raw] at h + | succ fuel ih => + cases n with + | zero => simp only [remove_fast_raw, Option.some.injEq] at h; subst h; rfl + | succ n => + cases wl with + | nil => + simp only [remove_fast_raw, Option.some.injEq] at h; subst h + simp [nil_pow] + | cons b wl' => + dsimp only [remove_fast_raw, withNat] at h + cases hsk : skip (.raw (b :: wl')) (n + 1) xs with + | some kys => + rcases kys with ⟨k, zs⟩ + rw [hsk] at h; dsimp only at h + rcases skip_spec (.raw (b :: wl')) (n + 1) xs k zs hsk with ⟨hk, hden⟩ + dsimp only [SymWord.toList] at hden + rw [hden, ih (n + 1 - k) zs h, pow_append_pow] + have hnk : k + (n + 1 - k) = n + 1 := by omega + rw [hnk] + | none => + rw [hsk] at h; dsimp only at h + cases hro : remove_one 16 (b :: wl') xs with + | none => rw [hro] at h; contradiction + | some zs => + rw [hro] at h; dsimp only at h + rw [remove_one_spec 16 (b :: wl') xs zs hro, ih n zs h, + pow_succ_list, listblank_append_right_assoc] + +def Runs.exact_head (w : SymWord) (n : Nat) : Runs → Option Runs + | (v, m) :: ys => + if SymWord.beq w v then + if Nat.beq n m then some ys + else if Nat.blt n m then + withNat (m - n) fun rem => some ((v, rem) :: ys) + else none + else none + | [] => none + +theorem Runs.exact_head_spec (w : SymWord) (n : Nat) (xs ys : Runs) + (h : exact_head w n xs = some ys) : denote xs = (w.toList ^ n) +> denote ys := by + cases xs with + | nil => contradiction + | cons vm rest => + rcases vm with ⟨v, m⟩ + dsimp only [exact_head, withNat] at h + cases hwv : SymWord.beq w v <;> rw [hwv] at h + · contradiction + simp only [↓reduceIte] at h + cases hnm : Nat.beq n m <;> rw [hnm] at h + · simp only [Bool.false_eq_true, ↓reduceIte] at h + cases hlt : Nat.blt n m <;> rw [hlt] at h + · contradiction + simp only [↓reduceIte, Option.some.injEq] at h + subst h + dsimp only [denote] + rw [SymWord.beq_eq w v hwv, pow_append_pow] + have hlt' : n < m := Nat.le_of_ble_eq_true hlt + have hm : n + (m - n) = m := by omega + rw [hm] + · simp only [↓reduceIte, Option.some.injEq] at h + subst h + dsimp only [denote] + rw [SymWord.beq_eq w v hwv, Nat.eq_of_beq_eq_true hnm] + +theorem pow_11_eq_pow_1 (m : Nat) : + (([1, 1] : List (Fin 2)) ^ m) = ([1] : List (Fin 2)) ^ (m * 2) := by + induction m with + | zero => rfl + | succ m ih => + have hm : (m + 1) * 2 = 2 + m * 2 := by omega + rw [pow_succ_list, ih, hm, list_pow_add] + rfl + +theorem pow_111_eq_pow_1 (m : Nat) : + (([1, 1, 1] : List (Fin 2)) ^ m) = ([1] : List (Fin 2)) ^ (m * 3) := by + induction m with + | zero => rfl + | succ m ih => + have hm : (m + 1) * 3 = 3 + m * 3 := by omega + rw [pow_succ_list, ih, hm, list_pow_add] + rfl + +def Runs.remove_ones : Nat → Nat → Runs → Option Runs + | _, 0, xs => some xs + | 0, _ + 1, _ => none + | _ + 1, _ + 1, [] => none + | fuel + 1, k + 1, (v, m) :: ys => + if SymWord.beq v (.raw [1]) && Nat.blt 0 m then + withNat (Nat.min (k + 1) m) fun tk => + withNat (m - tk) fun rem_m => + withNat (k + 1 - tk) fun rem_k => + remove_ones fuel rem_k (push (.raw [1]) rem_m ys) + else if SymWord.beq v (.raw [1, 1]) && Nat.blt 0 m then + withNat (m * 2) fun m2 => + if Nat.ble m2 (k + 1) then + withNat (k + 1 - m2) fun rem_k => + remove_ones fuel rem_k ys + else + withNat (m2 - (k + 1)) fun diff => + withNat (diff / 2) fun q => + if Nat.beq (diff % 2) 0 then + some (push (.raw [1, 1]) q ys) + else + some (push (.raw [1]) 1 (push (.raw [1, 1]) q ys)) + else + let (b, zs) := pop ((v, m) :: ys) + if beqFin2 1 b then remove_ones fuel k zs else none + +theorem Runs.remove_ones_spec (fuel k : Nat) (xs ys : Runs) + (h : remove_ones fuel k xs = some ys) : denote xs = (([1] : List (Fin 2)) ^ k) +> denote ys := + by + induction fuel generalizing k xs with + | zero => + cases k with + | zero => simp only [remove_ones, Option.some.injEq] at h; subst h; rfl + | succ k => simp [remove_ones] at h + | succ fuel ih => + cases k with + | zero => simp only [remove_ones, Option.some.injEq] at h; subst h; rfl + | succ k => + cases xs with + | nil => simp [remove_ones] at h + | cons vm rest => + rcases vm with ⟨v, m⟩ + dsimp only [remove_ones, withNat] at h + cases hc1 : SymWord.beq v (.raw [1]) && Nat.blt 0 m <;> rw [hc1] at h + · simp only [Bool.false_eq_true, ↓reduceIte] at h + cases hc2 : SymWord.beq v (.raw [1, 1]) && Nat.blt 0 m <;> rw [hc2] at h + · simp only [Bool.false_eq_true, ↓reduceIte] at h + have hp := pop_spec ((v, m) :: rest) + rcases hpop : pop ((v, m) :: rest) with ⟨b, zs⟩ + rw [hpop] at h hp + dsimp only at h hp + cases hb : beqFin2 1 b <;> rw [hb] at h + · contradiction + · simp only [↓reduceIte] at h + rw [hp, ← beqFin2_eq 1 b hb, ih k zs h, pow_succ_list] + simp only [List.cons_append, List.nil_append, listblank_append_cons] + · simp only [↓reduceIte] at h + rcases Bool.and_eq_true_iff.mp hc2 with ⟨hv, hm⟩ + have hv' : v.toList = [1, 1] := SymWord.beq_eq v (.raw [1, 1]) hv + dsimp only [denote] + rw [hv', pow_11_eq_pow_1 m] + cases hle : Nat.ble (m * 2) (k + 1) <;> rw [hle] at h + · simp only [Bool.false_eq_true, ↓reduceIte] at h + have hlt : k + 1 < m * 2 := Nat.gt_of_not_le (fun hle' => by + rw [Nat.ble_eq.mpr hle'] at hle; contradiction) + cases hmod : Nat.beq ((m * 2 - (k + 1)) % 2) 0 <;> rw [hmod] at h + · simp only [Bool.false_eq_true, ↓reduceIte, Option.some.injEq] at h + subst h + rw [push_spec, push_spec] + dsimp only [SymWord.toList] + rw [pow_11_eq_pow_1, pow_append_pow, pow_append_pow] + have hmod' : (m * 2 - (k + 1)) % 2 ≠ 0 := fun h0 => by + rw [Nat.beq_eq.mpr h0] at hmod; contradiction + have hm2 : m * 2 = k + 1 + 1 + (m * 2 - (k + 1)) / 2 * 2 := by omega + conv_lhs => rw [hm2] + · simp only [↓reduceIte, Option.some.injEq] at h + subst h + rw [push_spec] + dsimp only [SymWord.toList] + rw [pow_11_eq_pow_1, pow_append_pow] + have hmod' := Nat.eq_of_beq_eq_true hmod + have hm2 : m * 2 = k + 1 + (m * 2 - (k + 1)) / 2 * 2 := by omega + conv_lhs => rw [hm2] + · simp only [↓reduceIte] at h + have hle' : m * 2 ≤ k + 1 := Nat.le_of_ble_eq_true hle + rw [ih (k + 1 - m * 2) rest h, pow_append_pow] + have hk : m * 2 + (k + 1 - m * 2) = k + 1 := by omega + rw [hk] + · simp only [↓reduceIte] at h + rcases Bool.and_eq_true_iff.mp hc1 with ⟨hv, hm⟩ + have hv' : v.toList = [1] := SymWord.beq_eq v (.raw [1]) hv + have ih' := + ih (k + 1 - Nat.min (k + 1) m) (push (.raw [1]) (m - Nat.min (k + 1) m) rest) h + rw [push_spec] at ih' + dsimp only [SymWord.toList] at ih' + dsimp only [denote] + have hmin1 : Nat.min (k + 1) m ≤ m := Nat.min_le_right (k + 1) m + have hmin2 : Nat.min (k + 1) m ≤ k + 1 := Nat.min_le_left (k + 1) m + have hm_eq : m = Nat.min (k + 1) m + (m - Nat.min (k + 1) m) := by omega + have hk_eq : Nat.min (k + 1) m + (k + 1 - Nat.min (k + 1) m) = k + 1 := by omega + rw [hv', hm_eq, list_pow_add, listblank_append_right_assoc, ih', pow_append_pow, hk_eq] + +def Runs.remove_sym_one (w : SymWord) (xs : Runs) : Option Runs := + match w with + | .raw wl => remove_one 16 wl xs + | .D n => + withNat (1 + n * 2) fun n2_1 => + match remove_ones 16 n2_1 xs with + | some xs2 => remove_one 16 [0, 0] xs2 + | none => none + | .S n => + withNat (1 + n) fun n1 => + match exact_head (.raw [1, 0]) n1 xs with + | some xs1 => remove_ones 16 1 xs1 + | none => + match remove_ones 16 1 xs with + | some xs1 => remove_fast_raw 16 [0, 1] n1 xs1 + | none => none + | .PL n => + withNat (n + 4) fun n4 => + match remove_fast_raw 16 [1, 0] n4 xs with + | some xs1 => + match remove_fast_raw 16 [1, 1] n xs1 with + | some xs2 => remove_one 16 [1, 0, 1, 1, 0, 1] xs2 + | none => none + | none => none + +theorem Runs.remove_sym_one_spec (w : SymWord) (xs ys : Runs) + (h : remove_sym_one w xs = some ys) : denote xs = w.toList +> denote ys := by + cases w with + | raw wl => exact remove_one_spec 16 wl xs ys h + | D n => + dsimp only [remove_sym_one, SymWord.toList, D_word, withNat] at h ⊢ + cases h1 : remove_ones 16 (1 + n * 2) xs <;> rw [h1] at h + · contradiction + rename_i xs2; dsimp only at h + rw [remove_ones_spec 16 (1 + n * 2) xs xs2 h1, + remove_one_spec 16 [0, 0] xs2 ys h, + pow_one_add, ← pow_11_eq_pow_1 n] + simp only [List.append_assoc, listblank_append_right_assoc] + | S n => + dsimp only [remove_sym_one, SymWord.toList, S_word, withNat] at h ⊢ + cases hex : exact_head (.raw [1, 0]) (1 + n) xs with + | some xs1 => + rw [hex] at h; dsimp only at h + have h1 := exact_head_spec (.raw [1, 0]) (1 + n) xs xs1 hex + have h2 := remove_ones_spec 16 1 xs1 ys h + dsimp only [SymWord.toList] at h1 + rw [pow_succ_list, pow_zero_list, List.append_nil, + listblank_append_cons, listblank_append_nil] at h2 + rw [h1, h2, rot_10 (1 + n) (denote ys)] + simp only [List.cons_append, List.nil_append, listblank_append_cons] + | none => + rw [hex] at h; dsimp only at h + cases h1 : remove_ones 16 1 xs <;> rw [h1] at h + · contradiction + rename_i xs1; dsimp only at h + rw [remove_ones_spec 16 1 xs xs1 h1, + remove_fast_raw_spec 16 [0, 1] (1 + n) xs1 ys h] + simp only [pow_succ_list, pow_zero_list, List.append_nil, listblank_append_right_assoc] + | PL n => + dsimp only [remove_sym_one, SymWord.toList, PL_word, S_word, withNat] at h ⊢ + cases h1 : remove_fast_raw 16 [1, 0] (n + 4) xs <;> rw [h1] at h + · contradiction + rename_i xs1; dsimp only at h + cases h2 : remove_fast_raw 16 [1, 1] n xs1 <;> rw [h2] at h + · contradiction + rename_i xs2; dsimp only at h + rw [remove_fast_raw_spec 16 [1, 0] (n + 4) xs xs1 h1, + remove_fast_raw_spec 16 [1, 1] n xs1 xs2 h2, + remove_one_spec 16 [1, 0, 1, 1, 0, 1] xs2 ys h] + simp only [pow_succ_list, pow_zero_list, List.append_nil, List.cons_append, List.nil_append, + List.append_assoc, listblank_append_right_assoc, listblank_append_cons] + +def Runs.remove_fast : Nat → SymWord → Nat → Runs → Option Runs + | _, _, 0, xs => some xs + | 0, _, _ + 1, _ => none + | fuel + 1, w, n + 1, xs => + match exact_head w (n + 1) xs with + | some ys => some ys + | none => + if w.isEmpty then some xs + else + match skip w (n + 1) xs with + | some (k, ys) => + withNat (n + 1 - k) fun rem => + remove_fast fuel w rem ys + | none => + match remove_sym_one w xs with + | some ys => remove_fast fuel w n ys + | none => none + +theorem Runs.remove_fast_spec (fuel : Nat) (w : SymWord) (n : Nat) (xs ys : Runs) + (h : remove_fast fuel w n xs = some ys) : denote xs = (w.toList ^ n) +> denote ys := by + induction fuel generalizing n xs with + | zero => + cases n with + | zero => + simp only [remove_fast, Option.some.injEq] at h; subst h; rfl + | succ n => simp [remove_fast] at h + | succ fuel ih => + cases n with + | zero => + simp only [remove_fast, Option.some.injEq] at h; subst h; rfl + | succ n => + dsimp only [remove_fast, withNat] at h + cases hex : exact_head w (n + 1) xs with + | some zs => + rw [hex] at h; simp only [Option.some.injEq] at h; subst h + exact exact_head_spec w (n + 1) xs zs hex + | none => + rw [hex] at h; dsimp only at h + cases he : w.isEmpty + · rw [he] at h; simp only [Bool.false_eq_true, ↓reduceIte] at h + cases hsk : skip w (n + 1) xs with + | some kys => + rcases kys with ⟨k, zs⟩ + rw [hsk] at h; dsimp only at h + rcases skip_spec w (n + 1) xs k zs hsk with ⟨hk, hden⟩ + rw [hden, ih (n + 1 - k) zs h, pow_append_pow] + have hnk : k + (n + 1 - k) = n + 1 := by omega + rw [hnk] + | none => + rw [hsk] at h; dsimp only at h + cases hro : remove_sym_one w xs with + | none => rw [hro] at h; simp at h + | some zs => + rw [hro] at h; dsimp only at h + rw [remove_sym_one_spec w xs zs hro, ih n zs h, + pow_succ_list, listblank_append_right_assoc] + · rw [he] at h; simp only [↓reduceIte, Option.some.injEq] at h; subst h + simp [SymWord.isEmpty_spec w he, nil_pow] + +-- ============================================================================ +-- Section 2: RunMachine & CBExec +-- ============================================================================ + +structure RMConfig where + left : Runs + right : Runs + state : Fin 6 + dir : Dir + +def RMConfig.denote (c : RMConfig) : Cfg (Fin 2) (Fin 6) := + match c.dir with + | Dir.left => Cfg.headLeft c.state (Runs.denote c.left) (Runs.denote c.right) + | Dir.right => Cfg.headRight c.state (Runs.denote c.left) (Runs.denote c.right) + + +class HasCertRules (target_tm : Machine (Fin 2) (Fin 6)) : Prop where + no_some_none : ∀ (q : Fin 6) (b : Fin 2), (target_tm q b).map Prod.fst ≠ some none + scanR : ∀ (l r : ListBlank (Fin 2)) (n : Nat), + ReachesStar target_tm + ⟨some A, ⟨0, l, (1 : Fin 2) >> ((([1, 1] : List (Fin 2)) ^ n) +> r)⟩⟩ + ⟨some A, ⟨0, (([1, 0] : List (Fin 2)) ^ n) +> l, (1 : Fin 2) >> r⟩⟩ + scanB : ∀ (l r : ListBlank (Fin 2)) (n : Nat), + ReachesStar target_tm + (Cfg.headLeft B ((([0, 1] : List (Fin 2)) ^ n) +> l) r) + (Cfg.headLeft B l ((([1, 1] : List (Fin 2)) ^ n) +> r)) + scanC : ∀ (l r : ListBlank (Fin 2)) (n : Nat), + ReachesStar target_tm + (Cfg.headLeft C ((([1, 0] : List (Fin 2)) ^ n) +> l) r) + (Cfg.headLeft C l ((([1, 1] : List (Fin 2)) ^ n) +> r)) + scanPair : ∀ (l r : ListBlank (Fin 2)) (n : Nat), + ReachesStar target_tm + ⟨some A, ⟨0, l, (1 : Fin 2) >> ((([0, 1, 0, 1] : List (Fin 2)) ^ n) +> r)⟩⟩ + ⟨some A, ⟨0, (([1, 1, 0, 1] : List (Fin 2)) ^ n) +> l, (1 : Fin 2) >> r⟩⟩ + ones : ∀ (l r : ListBlank (Fin 2)) (n : Nat), + ReachesStar target_tm + (Cfg.headRight A l ((([1] : List (Fin 2)) ^ n) +> r)) + (Cfg.headRight A ((([1] : List (Fin 2)) ^ n) +> l) r) + rule_right : ∀ (l r : ListBlank (Fin 2)) (n : Nat), + ReachesStar target_tm (CfgR l (D_word n +> r)) (CfgR (S_word n +> l) r) + rule_left : ∀ (l r : ListBlank (Fin 2)) (n : Nat), + ReachesStar target_tm (CfgL (S_word n +> l) r) (CfgL l (D_word n +> r)) + rule_blank : ∀ (l r : ListBlank (Fin 2)), + ReachesStar target_tm (CfgR l ([0, 0, 0] +> r)) (CfgL l (D_word 0 +> (D_word 0 +> r))) + rule_even : ∀ (l r : ListBlank (Fin 2)) (n : Nat), + ReachesStar target_tm + (CfgR l ((([1, 1] : List (Fin 2)) ^ (1 + n)) +> ([0, 0] +> r))) + (CfgL l (D_word (1 + n) +> ([1, 0] +> r))) + rule_restart : ∀ (l r : ListBlank (Fin 2)) (b : Nat), + ReachesStar target_tm + (CfgL ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> ([1, 1, 1] +> l)) r) + (CfgR ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> l) r) + rule_overflow2 : ∀ (r : ListBlank (Fin 2)) (b : Nat), + ReachesStar target_tm + (CfgL ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> ([1, 1] +> default)) r) + (CfgR ((([1, 0] : List (Fin 2)) ^ 2) +> ((([1, 1] : List (Fin 2)) ^ (1 + b)) +> default)) + ([1] +> r)) + rule_overflow1 : ∀ (r : ListBlank (Fin 2)) (b n : Nat), + ReachesStar target_tm + (CfgL ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> ([1] +> default)) (D_word n +> r)) + (CfgR ((([1, 0] : List (Fin 2)) ^ (n + 2)) +> ((([1, 1] : List (Fin 2)) ^ b) +> default)) + ([1, 0] +> r)) + rule_collision : ∀ (l r : ListBlank (Fin 2)), + ReachesStar target_tm + (CfgL ([0, 0, 1, 1, 0, 1] +> l) r) + (CfgJ l ([1, 1, 1, 1] +> r)) + rule_leftJ : ∀ (l r : ListBlank (Fin 2)) (n : Nat), + ReachesStar target_tm + (CfgJ (S_word n +> l) r) + (CfgL l (D_word (1 + n) +> r)) + rule_turnB : ∀ (l r : ListBlank (Fin 2)) (n : Nat), + ReachesStar target_tm + (CfgL ([1, 1] +> l) (D_word n +> r)) + (CfgR ((([1, 0] : List (Fin 2)) ^ (1 + n)) +> l) r) + rule_turnJ : ∀ (l r : ListBlank (Fin 2)) (b : Nat), + ReachesStar target_tm + (CfgJ ((([1, 0] : List (Fin 2)) ^ b) +> ([1, 1, 1] +> l)) r) + (CfgR ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> l) r) + rule_finishP : ∀ (l r : ListBlank (Fin 2)) (b : Nat), + ReachesStar target_tm + (CfgL ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> ([0, 1] +> (S_word 0 +> l))) r) + (CfgJ l (D_word (1 + b) +> r)) + rule_defect0 : ∀ (l r : ListBlank (Fin 2)) (m : Nat), + ReachesStar target_tm + (CfgR l ([1, 0] +> (D_word 0 +> ([1] +> ((([1, 1] : List (Fin 2)) ^ m) +> ([0] +> r)))))) + (CfgJ l ([1, 1, 1, 1] +> (D_word m +> ([1] +> r)))) + rule_defect1 : ∀ (l r : ListBlank (Fin 2)) (m : Nat), + ReachesStar target_tm + (CfgR l ([1, 0] +> (D_word 1 +> ([1] +> ((([1, 1] : List (Fin 2)) ^ m) +> ([0] +> r)))))) + (CfgL l (D_word 0 +> (D_word 0 +> (D_word (1 + m) +> ([1] +> r))))) + rule_defect2 : ∀ (l r : ListBlank (Fin 2)) (n m : Nat), + ReachesStar target_tm + (CfgR l ([1, 0] +> (D_word (2 + + n) +> ([1] +> ((([1, 1] : List (Fin 2)) ^ m) +> ([0] +> r)))))) + (CfgR ((([1, 0] : List (Fin 2)) ^ (2 + m)) +> + ((([1, 1] : List (Fin 2)) ^ n) +> (S_word 0 +> (S_word 0 +> l)))) ([1] +> r)) + rule_defect_blank0 : ∀ (l r : ListBlank (Fin 2)), + ReachesStar target_tm + (CfgR l ([1, 0] +> (D_word 0 +> ([0, 0] +> r)))) + (CfgR ([1, 0, 0, 1] +> (S_word 0 +> l)) r) + rule_defect_blankS : ∀ (l r : ListBlank (Fin 2)) (n : Nat), + ReachesStar target_tm + (CfgR l ([1, 0] +> (D_word (1 + n) +> ([0, 0] +> r)))) + (CfgR ([1, 0] +> ((([1, 1] : List (Fin 2)) ^ n) +> ([1] +> (S_word 0 +> (S_word 0 +> l))))) r) + rule_paired : ∀ (l r : ListBlank (Fin 2)) (k n : Nat), + ReachesStar target_tm + (CfgR l ((([1, 0] : List (Fin 2)) ^ (k * 2)) +> (D_word n +> r))) + (CfgR ((([1, 0] : List (Fin 2)) ^ n) +> + ((([1, 1, 0, 1] : List (Fin 2)) ^ k) +> (S_word 0 +> l))) r) + rule_emptyR : ∀ (l : ListBlank (Fin 2)), + ReachesStar target_tm (CfgR l default) (CfgL l (D_word 0 +> (D_word 0 +> default))) + rule_collide : ∀ (l r : ListBlank (Fin 2)), + ReachesStar target_tm + (CfgR l ([1, 0] +> (D_word 0 +> (D_word 0 +> r)))) + (CfgJ l (D_word 2 +> ([1, 0] +> r))) + rule_pairR : ∀ (l r : ListBlank (Fin 2)) (n : Nat), + ReachesStar target_tm + (CfgR l ([1, 0] +> (D_word (2 + n) +> (D_word (2 + n) +> r)))) + (CfgR (PL_word n +> l) ([1, 0] +> r)) + +inductive CertTree where + | nil : CertTree + | leaf : Nat → CertTree + | leaf8 : Nat → Nat → Nat → Nat → Nat → Nat → Nat → Nat → CertTree + | bin : CertTree → CertTree → CertTree + +def h240 (a b : Nat) : Nat := (a <<< 240) + b + +section Engine + +variable {target_tm : Machine (Fin 2) (Fin 6)} [rules : HasCertRules target_tm] + +def raw_step (target_tm : Machine (Fin 2) (Fin 6)) (c : RMConfig) : Option RMConfig := + let (b, l, r) := match c.dir with + | Dir.left => + let (b, l) := Runs.pop c.left + (b, l, c.right) + | Dir.right => + let (b, r) := Runs.pop c.right + (b, c.left, r) + match target_tm c.state b with + | some (some q', Stmt.write b' Dir.left) => + some ⟨l, Runs.push (.raw [b']) 1 r, q', Dir.left⟩ + | some (some q', Stmt.write b' Dir.right) => + some ⟨Runs.push (.raw [b']) 1 l, r, q', Dir.right⟩ + | _ => none + + +theorem raw_step_spec (c : RMConfig) : + match raw_step target_tm c with + | some c' => ReachesStar target_tm c.denote c'.denote + | none => HaltsFrom target_tm c.denote := by + rcases c with ⟨l, r, q, d⟩ + cases d + · dsimp only [raw_step, RMConfig.denote] + have hp := Runs.pop_spec l + rcases hpop : Runs.pop l with ⟨b, l'⟩ + rw [hpop] at hp + dsimp only at hp ⊢ + rw [hp] + rcases htm : target_tm q b with _ | ⟨_ | q', ⟨b', d'⟩⟩ + · exact ⟨_, ReachesStar.refl _ _, by simp [step_headLeft_none htm]⟩ + · exact False.elim (rules.no_some_none q b (congrArg (Option.map Prod.fst) htm)) + · cases d' <;> dsimp only [RMConfig.denote] <;> rw [Runs.push_spec] <;> + simp only [SymWord.toList, pow_succ_list, pow_zero_list, List.append_nil, + listblank_append_cons, listblank_append_nil] + · exact ReachesStar.single (step_headLeft_left htm (Runs.denote l') (Runs.denote r)) + · exact ReachesStar.single (step_headLeft_right htm (Runs.denote l') (Runs.denote r)) + · dsimp only [raw_step, RMConfig.denote] + have hp := Runs.pop_spec r + rcases hpop : Runs.pop r with ⟨b, r'⟩ + rw [hpop] at hp + dsimp only at hp ⊢ + rw [hp] + rcases htm : target_tm q b with _ | ⟨_ | q', ⟨b', d'⟩⟩ + · exact ⟨_, ReachesStar.refl _ _, by simp [step_headRight_none htm]⟩ + · exact False.elim (rules.no_some_none q b (congrArg (Option.map Prod.fst) htm)) + · cases d' <;> dsimp only [RMConfig.denote] <;> rw [Runs.push_spec] <;> + simp only [SymWord.toList, pow_succ_list, pow_zero_list, List.append_nil, + listblank_append_cons, listblank_append_nil] + · exact ReachesStar.single (step_headRight_left htm (Runs.denote l) (Runs.denote r')) + · exact ReachesStar.single (step_headRight_right htm (Runs.denote l) (Runs.denote r')) + +def orient (d : Dir) (c : RMConfig) : RMConfig := + match d, c.dir with + | Dir.left, Dir.right => + let (b, r) := Runs.pop c.right + ⟨Runs.push (.raw [b]) 1 c.left, r, c.state, Dir.left⟩ + | Dir.right, Dir.left => + let (b, l) := Runs.pop c.left + ⟨l, Runs.push (.raw [b]) 1 c.right, c.state, Dir.right⟩ + | _, _ => c + +theorem orient_spec (d : Dir) (c : RMConfig) : (orient d c).denote = c.denote := by + rcases c with ⟨l, r, q, cd⟩ + cases d <;> cases cd <;> try rfl + · dsimp only [orient, RMConfig.denote] + have hp := Runs.pop_spec r + rcases hpop : Runs.pop r with ⟨b, r'⟩ + rw [hpop] at hp; dsimp only at hp ⊢ + rw [Runs.push_spec, hp] + simp [SymWord.toList, pow_succ_list, Cfg.headRight_cons] + · dsimp only [orient, RMConfig.denote] + have hp := Runs.pop_spec l + rcases hpop : Runs.pop l with ⟨b, l'⟩ + rw [hpop] at hp; dsimp only at hp ⊢ + rw [Runs.push_spec, hp] + simp [SymWord.toList, pow_succ_list, Cfg.headLeft_cons] + +theorem orient_dir (d : Dir) (c : RMConfig) : (orient d c).dir = d := by + rcases c with ⟨l, r, q, cd⟩ + cases d <;> cases cd <;> rfl + +theorem orient_state (d : Dir) (c : RMConfig) : (orient d c).state = c.state := by + rcases c with ⟨l, r, q, cd⟩ + cases d <;> cases cd <;> rfl + +def all_zero_word : List (Fin 2) → Bool + | [] => true + | b :: w => if beqFin2 b 0 then all_zero_word w else false + +theorem all_zero_word_spec (w : List (Fin 2)) (h : all_zero_word w = true) : + w +> (default : ListBlank (Fin 2)) = default := by + induction w with + | nil => rfl + | cons b w ih => + dsimp [all_zero_word] at h + cases hb : beqFin2 b 0 + · rw [hb] at h; simp at h + · rw [hb] at h; simp only [↓reduceIte] at h + rw [beqFin2_eq b 0 hb, listblank_append_cons, ih h, zero_cons_default] + +def SymWord.all_zero : SymWord → Bool + | .raw w => all_zero_word w + | _ => false + +theorem SymWord.all_zero_spec (w : SymWord) (h : w.all_zero = true) : + w.toList +> (default : ListBlank (Fin 2)) = default := by + cases w with + | raw l => exact all_zero_word_spec l h + | D _ => contradiction + | S _ => contradiction + | PL _ => contradiction + +theorem all_zero_pow_spec (w : SymWord) (n : Nat) (h : w.all_zero = true) : + (w.toList ^ n) +> (default : ListBlank (Fin 2)) = default := by + induction n with + | zero => rfl + | succ n ih => + rw [pow_succ_list, listblank_append_right_assoc, ih, SymWord.all_zero_spec w h] + +def zeros : Runs → Bool + | [] => true + | (w, _) :: xs => if w.all_zero then zeros xs else false + +theorem zeros_spec (xs : Runs) (h : zeros xs = true) : Runs.denote xs = default := by + induction xs with + | nil => rfl + | cons wn xs ih => + rcases wn with ⟨w, n⟩ + dsimp [zeros, Runs.denote] at h ⊢ + cases hw : w.all_zero + · rw [hw] at h; simp at h + · rw [hw] at h; simp only [↓reduceIte] at h + rw [ih h, all_zero_pow_spec w n hw] + +def plug : Runs → ListBlank (Fin 2) → ListBlank (Fin 2) + | [], r => r + | (w, n) :: xs, r => (w.toList ^ n) +> plug xs r + +def put : Runs → Runs → Runs + | [], ys => ys + | (w, n) :: xs, ys => Runs.push w n (put xs ys) + + +def Runs.take_one (w : SymWord) (n : Nat) (ys : Runs) : Option Runs := + match exact_head w n ys with + | some zs => some zs + | none => + if SymWord.beq w (.raw [1]) then + remove_ones 16 n ys + else if SymWord.beq w (.raw [1, 1]) then + withNat (n * 2) fun n2 => remove_ones 16 n2 ys + else if SymWord.beq w (.raw [1, 1, 1]) then + withNat (n * 3) fun n3 => remove_ones 16 n3 ys + else if Nat.beq n 1 then + remove_sym_one w ys + else + remove_fast 512 w n ys + +theorem Runs.take_one_spec (w : SymWord) (n : Nat) (ys zs : Runs) + (h : take_one w n ys = some zs) : denote ys = (w.toList ^ n) +> denote zs := by + dsimp only [take_one, withNat] at h + cases hex : exact_head w n ys with + | some ts => + rw [hex] at h; simp only [Option.some.injEq] at h; subst h + exact exact_head_spec w n ys ts hex + | none => + rw [hex] at h; dsimp only at h + cases h1 : SymWord.beq w (.raw [1]) <;> rw [h1] at h + · simp only [Bool.false_eq_true, ↓reduceIte] at h + cases h2 : SymWord.beq w (.raw [1, 1]) <;> rw [h2] at h + · simp only [Bool.false_eq_true, ↓reduceIte] at h + cases h3 : SymWord.beq w (.raw [1, 1, 1]) <;> rw [h3] at h + · simp only [Bool.false_eq_true, ↓reduceIte] at h + cases hn1 : Nat.beq n 1 <;> rw [hn1] at h + · simp only [Bool.false_eq_true, ↓reduceIte] at h + exact remove_fast_spec 512 w n ys zs h + · simp only [↓reduceIte] at h + rw [Nat.eq_of_beq_eq_true hn1, pow_succ_list, pow_zero_list, List.append_nil] + exact remove_sym_one_spec w ys zs h + · simp only [↓reduceIte] at h + rw [SymWord.beq_eq w (.raw [1, 1, 1]) h3] + dsimp only [SymWord.toList] + rw [pow_111_eq_pow_1 n] + exact remove_ones_spec 16 (n * 3) ys zs h + · simp only [↓reduceIte] at h + rw [SymWord.beq_eq w (.raw [1, 1]) h2] + dsimp only [SymWord.toList] + rw [pow_11_eq_pow_1 n] + exact remove_ones_spec 16 (n * 2) ys zs h + · simp only [↓reduceIte] at h + rw [SymWord.beq_eq w (.raw [1]) h1] + exact remove_ones_spec 16 n ys zs h + +def take : Runs → Runs → Option Runs + | [], ys => some ys + | (w, n) :: xs, ys => + match Runs.take_one w n ys with + | some zs => take xs zs + | none => none + +theorem put_spec (xs ys : Runs) : Runs.denote (put xs ys) = plug xs (Runs.denote ys) := by + induction xs with + | nil => rfl + | cons wn xs ih => + rcases wn with ⟨w, n⟩ + dsimp [put, plug] + rw [Runs.push_spec, ih] + +theorem take_spec (xs ys zs : Runs) (h : take xs ys = some zs) : + Runs.denote ys = plug xs (Runs.denote zs) := by + induction xs generalizing ys with + | nil => simp only [take, Option.some.injEq] at h; subst h; rfl + | cons wn xs ih => + rcases wn with ⟨w, n⟩ + dsimp only [take, plug] at h ⊢ + cases hto : Runs.take_one w n ys with + | none => rw [hto] at h; contradiction + | some ts => + rw [hto] at h; dsimp only at h + rw [Runs.take_one_spec w n ys ts hto, ih ts h] + +theorem plug_app (xs ys : Runs) (r : ListBlank (Fin 2)) : + plug (xs ++ ys) r = plug xs (plug ys r) := by + induction xs with + | nil => rfl + | cons wn xs ih => + rcases wn with ⟨w, n⟩ + dsimp [plug] + rw [ih] + +-- ============================================================================ +-- Section 3: Symbolic Rules & Higher-Order Macros for CB1 +-- ============================================================================ + +abbrev Digits := List (Nat × Nat) + +def ds (v : Digits) : Runs := v.map (fun (n, k) => (.D n, k)) +def ss (v : Digits) : Runs := (v.map (fun (n, k) => (.S n, k))).reverse + +theorem ds_cons (n k : Nat) (v : Digits) : ds ((n, k) :: v) = (.D n, k) :: ds v := rfl + +theorem ss_cons (n k : Nat) (v : Digits) : ss ((n, k) :: v) = ss v ++ [(.S n, k)] := by + simp [ss] + +theorem ds_app (u v : Digits) : ds (u ++ v) = ds u ++ ds v := List.map_append + +inductive Mode where + | MR | ML | MJ | MA | MB | MC + deriving DecidableEq + +def Mode.mq : Mode → Fin 6 + | .MR | .MA => A + | .ML | .MB => B + | .MJ | .MC => C + +def Mode.md : Mode → Dir + | .MR | .MA => Dir.right + | _ => Dir.left + +def Mode.payload : Mode → List (Fin 2) + | .MR => [0, 1, 0, 0] + | .ML => [1] + | .MJ => [1, 0, 0] + | _ => [] + +def Mode.hat : Mode → ListBlank (Fin 2) → ListBlank (Fin 2) → Cfg (Fin 2) (Fin 6) + | .MR, l, r => CfgR l r + | .ML, l, r => CfgL l r + | .MJ, l, r => CfgJ l r + | .MA, l, r => Cfg.headRight A l r + | .MB, l, r => Cfg.headLeft B l r + | .MC, l, r => Cfg.headLeft C l r + +structure Recipe where + hi : Mode + li : Runs + ri : Runs + ho : Mode + lo : Runs + ro_pre : Runs + ro : Runs + keep_d : Nat + zl : Bool + zr : Bool + +def valid (target_tm : Machine (Fin 2) (Fin 6)) (p : Recipe) : Prop := + ∀ (v : Digits) (l r : ListBlank (Fin 2)), + (p.keep_d = 0 → v = []) → + (p.zl = true → l = default) → + (p.zr = true → r = default) → + ReachesStar target_tm + (p.hi.hat (plug p.li l) (plug (ds v) (plug p.ri r))) + (p.ho.hat (plug p.lo l) (plug p.ro_pre (plug (ds v) (plug p.ro r)))) + +def check_zero (z : Bool) (xs : Runs) : Bool := + if z then zeros xs else true + +theorem check_zero_spec (z : Bool) (xs : Runs) (h : check_zero z xs = true) : + z = true → Runs.denote xs = default := by + intro hz; rw [hz] at h; exact zeros_spec xs h + +def take_keep_put : Nat → Runs → Runs → Bool → Runs → Option Runs + | 0, ri, ro, zr, rs => + match take ri rs with + | some r => if check_zero zr r then some (put ro r) else none + | none => none + | 1, ri, ro, zr, (.D n, k) :: rs => + match take ri rs with + | some r => + if check_zero zr r then + some (Runs.push (.D n) k (put ro r)) + else none + | none => none + | m + 2, ri, ro, zr, (.D n, k) :: rs => + match take_keep_put (m + 1) ri ro zr rs with + | some rs' => some ((.D n, k) :: rs') + | none => none + | _ + 1, _, _, _, _ => none + +theorem take_keep_put_spec (m : Nat) (ri ro : Runs) (zr : Bool) (rs rs' : Runs) + (h : take_keep_put m ri ro zr rs = some rs') : + ∃ (v : Digits) (r : ListBlank (Fin 2)), + (m = 0 → v = []) ∧ + (zr = true → r = default) ∧ + Runs.denote rs = plug (ds v) (plug ri r) ∧ + Runs.denote rs' = plug (ds v) (plug ro r) := by + induction m generalizing rs rs' with + | zero => + dsimp only [take_keep_put] at h + cases htr : take ri rs with + | none => rw [htr] at h; contradiction + | some r => + rw [htr] at h; dsimp only at h + split_ifs at h with hzr + injection h with h; subst h + exact ⟨[], Runs.denote r, fun _ => rfl, check_zero_spec zr r hzr, + take_spec ri rs r htr, put_spec ro r⟩ + | succ m ih => + cases m with + | zero => + rcases rs with _ | ⟨⟨w, k⟩, rest⟩; · contradiction + cases w <;> try contradiction + rename_i n + dsimp only [take_keep_put] at h + cases htr : take ri rest with + | none => rw [htr] at h; contradiction + | some r => + rw [htr] at h; dsimp only at h + split_ifs at h with hzr + injection h with h; subst h + refine ⟨[(n, k)], Runs.denote r, by intro hc; contradiction, check_zero_spec zr r hzr, ?_, + ?_⟩ + · dsimp only [Runs.denote, ds, List.map, plug, SymWord.toList] + rw [take_spec ri rest r htr] + · rw [Runs.push_spec, put_spec] + rfl + | succ m' => + rcases rs with _ | ⟨⟨w, k⟩, rest⟩; · contradiction + cases w <;> try contradiction + rename_i n + dsimp only [take_keep_put] at h + cases htk : take_keep_put (m' + 1) ri ro zr rest with + | none => rw [htk] at h; contradiction + | some rest' => + rw [htk] at h; injection h with h; subst h + obtain ⟨v, r, _, hzr, hrs, hrs'⟩ := ih rest rest' htk + refine ⟨(n, k) :: v, r, by intro hc; contradiction, hzr, ?_, ?_⟩ + · dsimp only [Runs.denote, ds_cons, plug, SymWord.toList] + rw [hrs] + · dsimp only [Runs.denote, ds_cons, plug, SymWord.toList] + rw [hrs'] + +def use (p : Recipe) (c : RMConfig) : Option RMConfig := + if beqFin6 c.state p.hi.mq then + let c := orient p.hi.md c + match take p.li c.left, remove_prefix p.hi.payload c.right with + | some l, some rs => + if check_zero p.zl l then + match take_keep_put p.keep_d p.ri p.ro p.zr rs with + | some r_out => + some ⟨put p.lo l, Runs.push (.raw p.ho.payload) 1 (put p.ro_pre r_out), p.ho.mq, p.ho.md⟩ + | none => none + else none + | _, _ => none + else none + +omit rules in +theorem use_spec (p : Recipe) (c c' : RMConfig) (hv : valid target_tm p) (hu : use p c = some c') : + ReachesStar target_tm c.denote c'.denote := by + rcases p with ⟨hi, li, ri, ho, lo, ro_pre, ro, keep_d, zl, zr⟩ + dsimp only [use] at hu + cases hst : beqFin6 c.state hi.mq + · rw [hst] at hu; simp at hu + · rw [hst] at hu; simp only [↓reduceIte] at hu + have h_or_den := orient_spec hi.md c + have h_or_dir := orient_dir hi.md c + have h_or_st := orient_state hi.md c + rw [← h_or_den] + generalize hz : orient hi.md c = z at hu h_or_dir h_or_st + rcases z with ⟨ls, rs, q, d⟩ + dsimp only at hu h_or_dir h_or_st + have hq : q = hi.mq := by rw [h_or_st, beqFin6_eq _ _ hst] + subst hq h_or_dir + cases htl : take li ls with + | none => rw [htl] at hu; simp at hu + | some l => + rw [htl] at hu + cases hrp : remove_prefix hi.payload rs with + | none => rw [hrp] at hu; simp at hu + | some rs0 => + rw [hrp] at hu; dsimp only at hu + split_ifs at hu with hzl + cases htk : take_keep_put keep_d ri ro zr rs0 with + | none => rw [htk] at hu; simp at hu + | some r_out => + rw [htk] at hu; simp only [Option.some.injEq] at hu + subst hu + have hl0 := check_zero_spec zl l hzl + obtain ⟨v, r, hv0, hr0, hrs1, hrs2⟩ := take_keep_put_spec keep_d ri ro zr rs0 r_out htk + have hmain := hv v (Runs.denote l) r hv0 hl0 hr0 + have hls := take_spec li ls l htl + have hrs0 := remove_prefix_spec hi.payload rs rs0 hrp + cases hi <;> cases ho <;> ( + dsimp only [RMConfig.denote, Mode.md, Mode.mq, Mode.hat, Mode.payload] at hmain hrs0 ⊢ + rw [hls, hrs0, hrs1, Runs.push_spec, put_spec, put_spec, hrs2] + simpa [SymWord.toList, pow_succ_list, pow_zero_list, List.append_nil, + listblank_append_nil, + CfgR, CfgL, CfgJ] using hmain) + + +theorem rule_right_pow (l r : ListBlank (Fin 2)) (n k : Nat) : + ReachesStar target_tm (CfgR l (((D_word n) ^ k) +> r)) (CfgR (((S_word n) ^ k) +> l) r) := by + induction k generalizing l with + | zero => + simp only [pow_zero_list, listblank_append_nil] + try exact ReachesStar.refl _ _ + | succ k ih => + rw [pow_succ_list, listblank_append_right_assoc] + refine (rules.rule_right l _ n).trans ((ih (S_word n +> l)).trans ?_) + rw [ListBlank.append_pow_comm, ← listblank_append_right_assoc, ← pow_succ_list] + try exact ReachesStar.refl _ _ + +theorem rule_left_pow (l r : ListBlank (Fin 2)) (n k : Nat) : + ReachesStar target_tm (CfgL (((S_word n) ^ k) +> l) r) (CfgL l (((D_word n) ^ k) +> r)) := by + induction k generalizing r with + | zero => + simp only [pow_zero_list, listblank_append_nil] + try exact ReachesStar.refl _ _ + | succ k ih => + rw [pow_succ_list, listblank_append_right_assoc] + refine (rules.rule_left _ r n).trans ((ih (D_word n +> r)).trans ?_) + rw [ListBlank.append_pow_comm, ← listblank_append_right_assoc, ← pow_succ_list] + try exact ReachesStar.refl _ _ + +theorem right_list (v : Digits) (l r : ListBlank (Fin 2)) : + ReachesStar target_tm (CfgR l (plug (ds v) r)) (CfgR (plug (ss v) l) r) := by + induction v generalizing l with + | nil => try exact ReachesStar.refl _ _ + | cons nk v ih => + rcases nk with ⟨n, k⟩ + rw [ds_cons, ss_cons, plug_app] + dsimp only [plug, SymWord.toList] + exact (rule_right_pow l (plug (ds v) r) n k).trans (ih (((S_word n) ^ k) +> l)) + +theorem left_list (v : Digits) (l r : ListBlank (Fin 2)) : + ReachesStar target_tm (CfgL (plug (ss v) l) r) (CfgL l (plug (ds v) r)) := by + induction v generalizing l r with + | nil => try exact ReachesStar.refl _ _ + | cons nk v ih => + rcases nk with ⟨n, k⟩ + rw [ds_cons, ss_cons, plug_app] + dsimp only [plug, SymWord.toList] + exact (ih (((S_word n) ^ k) +> l) r).trans (rule_left_pow l (plug (ds v) r) n k) + +def call (target_tm : Machine (Fin 2) (Fin 6)) (r s : ListBlank (Fin 2)) : Prop := + ∀ l : ListBlank (Fin 2), ReachesStar target_tm (CfgR l r) (CfgL l s) + +inductive calls (target_tm : Machine (Fin 2) (Fin 6)) : Nat → ListBlank (Fin 2) → + ListBlank (Fin 2) → Prop where + | zero (r : ListBlank (Fin 2)) : calls target_tm 0 r r + | succ {n : Nat} {r s t : ListBlank (Fin 2)} : call target_tm r s → calls target_tm n s t → + calls target_tm (n + 1) r t + +theorem call_prefix (v : Digits) {r s : ListBlank (Fin 2)} (h : call target_tm r s) : + call target_tm (plug (ds v) r) (plug (ds v) s) := by + intro l + exact (right_list v l r).trans ((h (plug (ss v) l)).trans (left_list v l s)) + +theorem call_blank (v : Digits) : + call target_tm (plug (ds v) default) (plug (ds v) (((D_word 0) ^ 2) +> default)) := by + apply call_prefix + intro l + simpa [pow_succ_list, pow_zero_list, listblank_append_right_assoc] using rules.rule_emptyR l + +theorem calls_blank (k : Nat) (v : Digits) : + calls target_tm k (plug (ds v) default) (plug (ds v) (((D_word 0) ^ (k * 2)) +> default)) := by + induction k generalizing v with + | zero => + simpa [pow_zero_list, listblank_append_nil] using calls.zero (plug (ds v) default) + | succ k ih => + refine calls.succ (call_blank v) ?_ + have ih' := ih (v ++ [(0, 2)]) + have hds0 : ds [(0, 2)] = [(.D 0, 2)] := rfl + simp only [ds_app, plug_app, hds0, plug, SymWord.toList] at ih' + have hmul : (k + 1) * 2 = 2 + k * 2 := by omega + rw [hmul, list_pow_add, listblank_append_right_assoc] + exact ih' + +theorem call_collision (v : Digits) (j : Nat) (r : ListBlank (Fin 2)) : + call target_tm (plug (ds v) (D_word j +> ([1, 0] +> (D_word 0 +> (D_word 0 +> r))))) + (plug (ds v) (D_word (1 + j) +> (D_word 2 +> ([1, 0] +> r)))) := by + apply call_prefix + intro l + exact (rules.rule_right l _ j).trans ((rules.rule_collide _ r).trans (rules.rule_leftJ l _ j)) + +theorem calls_collision (k : Nat) (v : Digits) (j : Nat) (r : ListBlank (Fin 2)) : + calls target_tm (k + 1) + (plug (ds v) (D_word j +> ([1, 0] +> (((D_word 0) ^ ((k + 1) * 2)) +> r)))) + (plug (ds v) (D_word (1 + j) +> (((D_word 3) ^ k) +> (D_word 2 +> ([1, 0] +> r))))) := by + induction k generalizing v j with + | zero => + have h1 : (0 + 1) * 2 = 2 := rfl + rw [h1] + simp only [pow_succ_list, pow_zero_list, List.append_nil, listblank_append_right_assoc, + listblank_append_nil] + exact calls.succ (call_collision v j r) (calls.zero _) + | succ k ih => + have hmul : (k + 1 + 1) * 2 = 2 + (k + 1) * 2 := by omega + rw [hmul, pow_two_add, listblank_append_right_assoc, listblank_append_right_assoc] + refine calls.succ (call_collision v j (((D_word 0) ^ ((k + 1) * 2)) +> r)) ?_ + have ih' := ih (v ++ [(1 + j, 1)]) 2 + have hds1 : ds [(1 + j, 1)] = [(.D (1 + j), 1)] := rfl + simp only [ds_app, plug_app, hds1, plug, SymWord.toList] at ih' + simpa [pow_succ_list, pow_zero_list, List.append_nil, listblank_append_right_assoc] using ih' + +theorem pairsR (k n : Nat) (l r : ListBlank (Fin 2)) : + ReachesStar target_tm + (CfgR l ([1, 0] +> (((D_word (2 + n)) ^ (k * 2)) +> r))) + (CfgR (((PL_word n) ^ k) +> l) ([1, 0] +> r)) := by + induction k generalizing l with + | zero => + simp only [Nat.zero_mul, pow_zero_list, listblank_append_nil] + try exact ReachesStar.refl _ _ + | succ k ih => + have hmul : (k + 1) * 2 = 2 + k * 2 := by omega + rw [hmul, pow_two_add, listblank_append_right_assoc, listblank_append_right_assoc] + refine (rules.rule_pairR l _ n).trans ((ih (PL_word n +> l)).trans ?_) + rw [ListBlank.append_pow_comm, ← listblank_append_right_assoc, ← pow_succ_list] + try exact ReachesStar.refl _ _ + +theorem loopL {k : Nat} {r s : ListBlank (Fin 2)} (h : calls target_tm k r s) (l : ListBlank (Fin + 2)) (b : Nat) : + ReachesStar target_tm + (CfgL ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> ((([1, 1, 1] : List (Fin 2)) ^ k) +> l)) r) + (CfgL ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> l) s) := by + induction h generalizing l with + | zero r => + simp only [pow_zero_list, listblank_append_nil] + try exact ReachesStar.refl _ _ + | @succ n r0 u t hcall htail ih => + rw [pow_succ_list [1, 1, 1] n, listblank_append_right_assoc] + exact (rules.rule_restart _ r0 b).trans ((hcall _).trans (ih l)) + +theorem loopR {k : Nat} {r s : ListBlank (Fin 2)} (h : calls target_tm k r s) (l : ListBlank (Fin + 2)) (b : Nat) : + ReachesStar target_tm + (CfgR ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> ((([1, 1, 1] : List (Fin 2)) ^ k) +> l)) r) + (CfgR ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> l) s) := by + induction h generalizing l with + | zero r => + simp only [pow_zero_list, listblank_append_nil] + try exact ReachesStar.refl _ _ + | @succ n r0 u t hcall htail ih => + rw [pow_succ_list [1, 1, 1] n, listblank_append_right_assoc] + exact (hcall _).trans ((rules.rule_restart _ u b).trans (ih l)) + +theorem pl_inner_eq (n : Nat) : + (([1, 1] : List (Fin 2)) ^ (1 + n * 3)) ++ S_word 0 = + (([1, 1, 1] : List (Fin 2)) ^ (1 + n * 2)) ++ [0, 1] := by + induction n with + | zero => rfl + | succ n ih => + have h1 : 1 + (n + 1) * 3 = 3 + (1 + n * 3) := by omega + have h2 : 1 + (n + 1) * 2 = 2 + (1 + n * 2) := by omega + rw [h1, h2, list_pow_add [1, 1] 3 (1 + n * 3), list_pow_add [1, 1, 1] 2 (1 + n * 2), + List.append_assoc, ih, ← List.append_assoc] + rfl + +theorem pl_decomp (n : Nat) (l : ListBlank (Fin 2)) : + PL_word (1 + n * 3) +> l = + (([1, 0] : List (Fin 2)) ^ (5 + n * 3)) +> + ((([1, 1, 1] : List (Fin 2)) ^ (1 + n * 2)) +> + ([0, 1] +> (S_word 0 +> l))) := by + dsimp only [PL_word] + have h5 : 1 + n * 3 + 4 = 5 + n * 3 := by omega + rw [h5, List.append_assoc (([1, 0] : List (Fin 2)) ^ (5 + n * 3)), pl_inner_eq n] + simp only [List.append_assoc, listblank_append_right_assoc] + +theorem returnP_L {n : Nat} {r s : ListBlank (Fin 2)} (h : calls target_tm (1 + + n * 2) r s) (l : ListBlank (Fin 2)) : + ReachesStar target_tm + (CfgL (PL_word (1 + n * 3) +> l) r) + (CfgJ l (D_word (5 + n * 3) +> s)) := by + rw [pl_decomp n l] + have h5 : 5 + n * 3 = 1 + (4 + n * 3) := by omega + rw [h5] + exact (loopL h ([0, 1] +> (S_word 0 +> l)) (4 + n * 3)).trans (rules.rule_finishP l s (4 + n * 3)) + +theorem loopJ {k : Nat} {r s : ListBlank (Fin 2)} (h : calls target_tm (k + + 1) r s) (l : ListBlank (Fin 2)) (b : Nat) : + ReachesStar target_tm + (CfgJ ((([1, 0] : List (Fin 2)) ^ b) +> ((([1, 1, 1] : List (Fin 2)) ^ (k + 1)) +> l)) r) + (CfgL ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> l) s) := by + cases h with + | @succ _ _ u _ hcall htail => + rw [pow_succ_list [1, 1, 1] k, listblank_append_right_assoc] + exact (rules.rule_turnJ _ r b).trans ((hcall _).trans (loopL htail l b)) + +theorem returnP_J {n : Nat} {r s : ListBlank (Fin 2)} (h : calls target_tm (1 + + n * 2) r s) (l : ListBlank (Fin 2)) : + ReachesStar target_tm + (CfgJ (PL_word (1 + n * 3) +> l) r) + (CfgJ l (D_word (6 + n * 3) +> s)) := by + rw [pl_decomp n l] + rw [Nat.add_comm 1 (n * 2)] at h ⊢ + refine (loopJ h ([0, 1] +> (S_word 0 +> l)) (5 + n * 3)).trans ?_ + have h6 : 6 + n * 3 = 1 + (5 + n * 3) := by omega + rw [h6] + exact rules.rule_finishP l s (5 + n * 3) + +theorem calls_prefix (v : Digits) {k : Nat} {r s : ListBlank (Fin 2)} (h : calls target_tm k r s) : + calls target_tm k (plug (ds v) r) (plug (ds v) s) := by + induction h with + | zero r => exact calls.zero _ + | succ hcall _ ih => exact calls.succ (call_prefix v hcall) ih + +omit rules in +theorem calls_split (a b : Nat) {r s : ListBlank (Fin 2)} (h : calls target_tm (a + b) r s) : + ∃ t, calls target_tm a r t ∧ calls target_tm b t s := by + induction a generalizing r with + | zero => + rw [Nat.zero_add] at h + exact ⟨r, calls.zero r, h⟩ + | succ a ih => + have hab : a + 1 + b = (a + b) + 1 := by omega + rw [hab] at h + cases h with + | @succ _ _ u _ hcall htail => + obtain ⟨t, ht1, ht2⟩ := ih htail + exact ⟨t, calls.succ hcall ht1, ht2⟩ + +theorem returnsP_J (k n : Nat) {r s : ListBlank (Fin 2)} (h : calls target_tm (k * (1 + + n * 2)) r s) (l : ListBlank (Fin 2)) : + ReachesStar target_tm + (CfgJ (((PL_word (1 + n * 3)) ^ k) +> l) r) + (CfgJ l (((D_word (6 + n * 3)) ^ k) +> s)) := by + induction k generalizing r s with + | zero => + have hz : 0 * (1 + n * 2) = 0 := Nat.zero_mul _ + rw [hz] at h + cases h + simp only [pow_zero_list, listblank_append_nil] + try exact ReachesStar.refl _ _ + | succ k ih => + have hmul : (k + 1) * (1 + n * 2) = (1 + n * 2) + k * (1 + n * 2) := by ring + rw [hmul] at h + obtain ⟨u, hu, hv⟩ := calls_split (1 + n * 2) (k * (1 + n * 2)) h + rw [pow_succ_list, listblank_append_right_assoc] + refine (returnP_J hu _).trans ?_ + have hv' := calls_prefix [(6 + n * 3, 1)] hv + dsimp only [ds, List.map, plug, SymWord.toList] at hv' + simp only [pow_succ_list, pow_zero_list, List.append_nil] at hv' + refine (ih hv').trans ?_ + rw [ListBlank.append_pow_comm, ← listblank_append_right_assoc, ← pow_succ_list] + try exact ReachesStar.refl _ _ + +theorem returnsP_L (k n : Nat) {r s : ListBlank (Fin 2)} (h : calls target_tm ((1 + k) * (1 + + n * 2)) r s) (l : ListBlank (Fin 2)) : + ReachesStar target_tm + (CfgL (((PL_word (1 + n * 3)) ^ (1 + k)) +> l) r) + (CfgJ l (((D_word (6 + n * 3)) ^ k) +> (D_word (5 + n * 3) +> s))) := by + have hmul : (1 + k) * (1 + n * 2) = (1 + n * 2) + k * (1 + n * 2) := by ring + rw [hmul] at h + obtain ⟨u, hu, hv⟩ := calls_split (1 + n * 2) (k * (1 + n * 2)) h + rw [pow_one_add, listblank_append_right_assoc] + refine (returnP_L hu _).trans ?_ + have hv' := calls_prefix [(5 + n * 3, 1)] hv + dsimp only [ds, List.map, plug, SymWord.toList] at hv' + simp only [pow_succ_list, pow_zero_list, List.append_nil] at hv' + exact returnsP_J k n hv' l + + + +theorem rule_collisionD (l r : ListBlank (Fin 2)) (n : Nat) : + ReachesStar target_tm + (CfgL ([0, 0, 1, 1, 0, 1] +> l) (D_word n +> r)) + (CfgJ l (D_word (2 + n) +> r)) := by + have h : D_word (2 + n) +> r = [1, 1, 1, 1] +> (D_word n +> r) := by + dsimp [D_word] + rw [pow_two_add] + simp only [List.cons_append, List.nil_append, listblank_append_cons, + listblank_append_right_assoc] + rw [h] + exact rules.rule_collision l (D_word n +> r) + +theorem rule_defect0D (l r : ListBlank (Fin 2)) (m : Nat) : + ReachesStar target_tm + (CfgR l ([1, 0] +> (D_word 0 +> (D_word m +> r)))) + (CfgJ l (D_word (2 + m) +> ([1, 0] +> r))) := by + have h1 : D_word m +> r = [1] +> ((([1, 1] : List (Fin 2)) ^ m) +> ([0] +> ([0] +> r))) := by + dsimp [D_word] + simp only [ + listblank_append_cons, listblank_append_right_assoc, listblank_append_nil] + have h2 : D_word (2 + m) +> ([1, 0] +> r) = [1, 1, 1, 1] +> (D_word m +> ([1] +> ([0] +> r))) := + by + dsimp [D_word] + rw [pow_two_add] + simp only [List.cons_append, List.nil_append, + listblank_append_cons, listblank_append_right_assoc, listblank_append_nil] + rw [h1, h2] + exact rules.rule_defect0 l ([0] +> r) m + +theorem rule_defect1D (l r : ListBlank (Fin 2)) (m : Nat) : + ReachesStar target_tm + (CfgR l ([1, 0] +> (D_word 1 +> (D_word m +> r)))) + (CfgL l (D_word 0 +> (D_word 0 +> (D_word (1 + m) +> ([1, 0] +> r))))) := by + have h1 : D_word m +> r = [1] +> ((([1, 1] : List (Fin 2)) ^ m) +> ([0] +> ([0] +> r))) := by + dsimp [D_word] + simp only [ + listblank_append_cons, listblank_append_right_assoc, listblank_append_nil] + have h2 : ([1, 0] : List (Fin 2)) +> r = [1] +> ([0] +> r) := rfl + rw [h1, h2] + exact rules.rule_defect1 l ([0] +> r) m + +theorem rule_defect2D (l r : ListBlank (Fin 2)) (n m : Nat) : + ReachesStar target_tm + (CfgR l ([1, 0] +> (D_word (2 + n) +> (D_word m +> r)))) + (CfgR ((([1, 0] : List (Fin 2)) ^ (2 + + m)) +> ((([1, 1] : List (Fin 2)) ^ n) +> (S_word 0 +> (S_word 0 +> l)))) ([1, 0] +> r)) := + by + have h1 : D_word m +> r = [1] +> ((([1, 1] : List (Fin 2)) ^ m) +> ([0] +> ([0] +> r))) := by + dsimp [D_word] + simp only [ + listblank_append_cons, listblank_append_right_assoc, listblank_append_nil] + have h2 : ([1, 0] : List (Fin 2)) +> r = [1] +> ([0] +> r) := rfl + rw [h1, h2] + exact rules.rule_defect2 l ([0] +> r) n m + +theorem call_defect0 (v : Digits) (j m : Nat) (r : ListBlank (Fin 2)) : + call target_tm (plug (ds v) (D_word j +> ([1, 0] +> (D_word 0 +> (D_word m +> r))))) + (plug (ds v) (D_word (1 + j) +> (D_word (2 + m) +> ([1, 0] +> r)))) := by + apply call_prefix + intro l + exact (rules.rule_right l _ j).trans ((rule_defect0D _ r m).trans (rules.rule_leftJ l _ j)) + +theorem call_defect1 (v : Digits) (m : Nat) (r : ListBlank (Fin 2)) : + call target_tm (plug (ds v) ([1, 0] +> (D_word 1 +> (D_word m +> r)))) + (plug (ds v) (D_word 0 +> (D_word 0 +> (D_word (1 + m) +> ([1, 0] +> r))))) := by + apply call_prefix + intro l + exact rule_defect1D l r m + +theorem loopR_to_L {k : Nat} {r t : ListBlank (Fin 2)} (h : calls target_tm (k + + 1) r t) (l : ListBlank (Fin 2)) (b : Nat) : + ReachesStar target_tm + (CfgR ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> ((([1, 1, 1] : List (Fin 2)) ^ k) +> l)) r) + (CfgL ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> l) t) := by + obtain ⟨s, hs1, hs2⟩ := calls_split k 1 h + cases hs2 with + | @succ _ _ u _ hcall hzero => + cases hzero + exact (loopR hs1 l b).trans (hcall _) + +theorem loopR_to_L' {h : Nat} {r t : ListBlank (Fin 2)} (hh : 0 < h) (hc : calls target_tm h r t) (l + : ListBlank (Fin 2)) (b : Nat) : + ReachesStar target_tm + (CfgR ((([1, 0] : List (Fin 2)) ^ (1 + + b)) +> ((([1, 1, 1] : List (Fin 2)) ^ (h - 1)) +> l)) r) + (CfgL ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> l) t) := by + have h1 : (h - 1) + 1 = h := by omega + rw [← h1] at hc + exact loopR_to_L hc l b + +theorem loopJ' {h : Nat} {r s : ListBlank (Fin 2)} (hh : 0 < h) (hc : calls target_tm h r s) (l : + ListBlank (Fin 2)) (b : Nat) : + ReachesStar target_tm + (CfgJ ((([1, 0] : List (Fin 2)) ^ b) +> ((([1, 1, 1] : List (Fin 2)) ^ h) +> l)) r) + (CfgL ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> l) s) := by + have h1 : (h - 1) + 1 = h := by omega + rw [← h1] at hc ⊢ + exact loopJ hc l b + + + +-- ============================================================================ +-- Section 5: CBMacros (Basic & High Recipes) +-- ============================================================================ + +def word (w : List (Fin 2)) : Runs := [(.raw w, 1)] +def power (w : List (Fin 2)) (n : Nat) : Runs := [(.raw w, n)] +def dn (n : Nat) : Runs := [(.D n, 1)] +def sn (n : Nat) : Runs := [(.S n, 1)] +def imm : Runs := word [1, 0] +def mk_rule (h : Mode) (l r : Runs) (h' : Mode) (l' r' : Runs) : Recipe := + ⟨h, l, r, h', l', [], r', 0, false, false⟩ +def mk_leftzero (h : Mode) (l r : Runs) (h' : Mode) (l' r' : Runs) : Recipe := + ⟨h, l, r, h', l', [], r', 0, true, false⟩ + +@[simp] theorem plug_word (w : List (Fin 2)) (r : ListBlank (Fin 2)) : + plug (word w) r = w +> r := by + simp [word, plug, SymWord.toList, pow_succ_list] + +@[simp] theorem plug_power (w : List (Fin 2)) (n : Nat) (r : ListBlank (Fin 2)) : + plug (power w n) r = (w ^ n) +> r := rfl + +@[simp] theorem plug_dn (n : Nat) (r : ListBlank (Fin 2)) : + plug (dn n) r = D_word n +> r := by + simp [dn, plug, SymWord.toList, pow_succ_list] + +@[simp] theorem plug_sn (n : Nat) (r : ListBlank (Fin 2)) : + plug (sn n) r = S_word n +> r := by + simp [sn, plug, SymWord.toList, pow_succ_list] + +@[simp] theorem plug_run (w : SymWord) (n : Nat) (r : ListBlank (Fin 2)) : + plug [(w, n)] r = (w.toList ^ n) +> r := rfl + +inductive Basic where + | ScanR (k : Nat) | ScanB (k : Nat) | ScanC (k : Nat) | ScanPair (k : Nat) | Ones (k : Nat) + | Blank | Even (n : Nat) | Restart (b : Nat) | Over2 (b : Nat) | Over1 (b n : Nat) + | Collision | CollisionD (n : Nat) | LeftJ (n : Nat) | TurnB (n : Nat) | TurnJ (b : Nat) + | Defect0 (m : Nat) | Defect1 (m : Nat) | Defect2 (n m : Nat) + | Defect0D (m : Nat) | Defect1D (m : Nat) | Defect2D (n m : Nat) + | DefectBlank0 | DefectBlankS (n : Nat) | Paired (k n : Nat) + +def basic_rule : Basic → Recipe + | .ScanR k => mk_rule .MA [] (word [0, 1] ++ [(.raw [1, 1], k)]) .MA [(.raw [1, 0], k)] (word [0, + 1]) + | .ScanB k => mk_rule .MB [(.raw [0, 1], k)] [] .MB [] [(.raw [1, 1], k)] + | .ScanC k => mk_rule .MC [(.raw [1, 0], k)] [] .MC [] [(.raw [1, 1], k)] + | .ScanPair k => mk_rule .MA [] (word [0, 1] ++ [(.raw [0, 1, 0, 1], k)]) .MA [(.raw [1, 1, 0, 1], + k)] (word [0, 1]) + | .Ones k => mk_rule .MA [] [(.raw [1], k)] .MA [(.raw [1], k)] [] + | .Blank => mk_rule .MR [] (word [0, 0, 0]) .ML [] (dn 0 ++ dn 0) + | .Even n => mk_rule .MR [] (power [1, 1] (1 + n) ++ word [0, 0]) .ML [] (dn (1 + n) ++ imm) + | .Restart b => mk_rule .ML (power [1, 0] (1 + b) ++ word [1, 1, 1]) [] .MR (power [1, 0] (1 + + b)) [] + | .Over2 b => mk_leftzero .ML (power [1, 0] (1 + + b) ++ word [1, 1]) [] .MR (power [1, 0] 2 ++ power [1, 1] (1 + b)) (word [1]) + | .Over1 b n => mk_leftzero .ML (power [1, 0] (1 + b) ++ word [1]) (dn n) .MR (power [1, 0] (n + + 2) ++ power [1, 1] b) imm + | .Collision => mk_rule .ML (word [0, 0, 1, 1, 0, 1]) [] .MJ [] (word [1, 1, 1, 1]) + | .CollisionD n => + withNat (2 + n) fun n2 => + mk_rule .ML (word [0, 0, 1, 1, 0, 1]) (dn n) .MJ [] (dn n2) + | .LeftJ n => mk_rule .MJ (sn n) [] .ML [] (dn (1 + n)) + | .TurnB n => mk_rule .ML (word [1, 1]) (dn n) .MR (power [1, 0] (1 + n)) [] + | .TurnJ b => mk_rule .MJ (power [1, 0] b ++ word [1, 1, 1]) [] .MR (power [1, 0] (1 + b)) [] + | .Defect0 m => mk_rule .MR [] (imm ++ dn 0 ++ word [1] ++ power [1, + 1] m ++ word [0]) .MJ [] (word [1, 1, 1, 1] ++ dn m ++ word [1]) + | .Defect1 m => mk_rule .MR [] (imm ++ dn 1 ++ word [1] ++ power [1, + 1] m ++ word [0]) .ML [] (dn 0 ++ dn 0 ++ dn (1 + m) ++ word [1]) + | .Defect2 n m => mk_rule .MR [] (imm ++ dn (2 + + n) ++ word [1] ++ power [1, 1] m ++ word [0]) .MR (power [1, 0] (2 + + m) ++ power [1, 1] n ++ sn 0 ++ sn 0) (word [1]) + | .Defect0D m => + withNat (2 + m) fun m2 => + mk_rule .MR [] (imm ++ dn 0 ++ dn m) .MJ [] (dn m2 ++ imm) + | .Defect1D m => + withNat (1 + m) fun m1 => + mk_rule .MR [] (imm ++ dn 1 ++ dn m) .ML [] (dn 0 ++ dn 0 ++ dn m1 ++ imm) + | .Defect2D n m => + withNat (2 + n) fun n2 => + withNat (2 + m) fun m2 => + mk_rule .MR [] (imm ++ dn n2 ++ dn m) .MR (power [1, 0] m2 ++ power [1, + 1] n ++ sn 0 ++ sn 0) imm + | .DefectBlank0 => mk_rule .MR [] (imm ++ dn 0 ++ word [0, 0]) .MR (word [1, 0, 0, 1] ++ sn 0) [] + | .DefectBlankS n => mk_rule .MR [] (imm ++ dn (1 + + n) ++ word [0, 0]) .MR (word [1, 0] ++ power [1, 1] n ++ word [1] ++ sn 0 ++ sn 0) [] + | .Paired k n => + withNat (k * 2) fun k2 => + mk_rule .MR [] ([(.raw [1, 0], k2)] ++ dn n) .MR (power [1, 0] n ++ [(.raw [1, 1, 0, 1], + k)] ++ sn 0) [] + +theorem basic_valid (t : Basic) : valid target_tm (basic_rule t) := by + cases t with + | ScanR k => + intro v l r hv _ _; rw [hv rfl]; dsimp only [basic_rule, mk_rule, Mode.hat] + simpa [ds, plug_app, plug_word, plug, SymWord.toList, Cfg.headRight] using + rules.scanR l r k + | ScanB k => + intro v l r hv _ _; rw [hv rfl]; dsimp only [basic_rule, mk_rule, Mode.hat] + simp only [ds, plug, SymWord.toList]; exact rules.scanB l r k + | ScanC k => + intro v l r hv _ _; rw [hv rfl]; dsimp only [basic_rule, mk_rule, Mode.hat] + simp only [ds, plug, SymWord.toList]; exact rules.scanC l r k + | ScanPair k => + intro v l r hv _ _; rw [hv rfl]; dsimp only [basic_rule, mk_rule, Mode.hat] + simpa [ds, plug_app, plug_word, plug, SymWord.toList, Cfg.headRight] using + rules.scanPair l r k + | Ones k => + intro v l r hv _ _; rw [hv rfl]; dsimp only [basic_rule, mk_rule, Mode.hat] + simp only [ds, plug, SymWord.toList]; exact rules.ones l r k + | Blank => + intro v l r hv _ _; rw [hv rfl]; dsimp only [basic_rule, mk_rule, Mode.hat] + simp only [ds, plug_app, plug_word, plug_dn, plug]; exact rules.rule_blank l r + | Even n => + intro v l r hv _ _; rw [hv rfl]; dsimp only [basic_rule, mk_rule, imm, Mode.hat] + simp only [ds, plug_app, plug_word, plug_dn, plug_power, plug]; exact rules.rule_even l r n + | Restart b => + intro v l r hv _ _; rw [hv rfl]; dsimp only [basic_rule, mk_rule, Mode.hat] + simp only [ds, plug_app, plug_word, plug_power, plug]; exact rules.rule_restart l r b + | Over2 b => + intro v l r hv hl _; rw [hv rfl, hl rfl]; dsimp only [basic_rule, mk_leftzero, Mode.hat] + simp only [ds, plug_app, plug_word, plug_power, plug]; exact rules.rule_overflow2 r b + | Over1 b n => + intro v l r hv hl _; rw [hv rfl, hl rfl]; dsimp only [basic_rule, mk_leftzero, imm, Mode.hat] + simp only [ds, plug_app, plug_word, plug_dn, plug_power, plug]; exact rules.rule_overflow1 r b n + | Collision => + intro v l r hv _ _; rw [hv rfl]; dsimp only [basic_rule, mk_rule, Mode.hat] + simp only [ds, plug_word, plug]; exact rules.rule_collision l r + | CollisionD n => + intro v l r hv _ _; dsimp only [basic_rule, mk_rule, withNat, Mode.hat] at hv ⊢ + rw [hv rfl]; simp only [ds, plug_word, plug_dn, plug]; exact rule_collisionD l r n + | LeftJ n => + intro v l r hv _ _; rw [hv rfl]; dsimp only [basic_rule, mk_rule, Mode.hat] + simp only [ds, plug_sn, plug_dn, plug]; exact rules.rule_leftJ l r n + | TurnB n => + intro v l r hv _ _; rw [hv rfl]; dsimp only [basic_rule, mk_rule, Mode.hat] + simp only [ds, plug_word, plug_dn, plug_power, plug]; exact rules.rule_turnB l r n + | TurnJ b => + intro v l r hv _ _; rw [hv rfl]; dsimp only [basic_rule, mk_rule, Mode.hat] + simp only [ds, plug_app, plug_word, plug_power, plug]; exact rules.rule_turnJ l r b + | Defect0 m => + intro v l r hv _ _; rw [hv rfl]; dsimp only [basic_rule, mk_rule, imm, Mode.hat] + simp only [ds, List.append_assoc, plug_app, plug_word, plug_dn, plug_power, + plug]; exact rules.rule_defect0 l r m + | Defect1 m => + intro v l r hv _ _; rw [hv rfl]; dsimp only [basic_rule, mk_rule, imm, Mode.hat] + simp only [ds, List.append_assoc, plug_app, plug_word, plug_dn, plug_power, + plug]; exact rules.rule_defect1 l r m + | Defect2 n m => + intro v l r hv _ _; rw [hv rfl]; dsimp only [basic_rule, mk_rule, imm, Mode.hat] + simp only [ds, List.append_assoc, plug_app, plug_word, plug_dn, plug_sn, plug_power, + plug]; exact rules.rule_defect2 l r n m + | Defect0D m => + intro v l r hv _ _; dsimp only [basic_rule, mk_rule, imm, withNat, Mode.hat] at hv ⊢ + rw [hv rfl]; simp only [ds, List.append_assoc, plug_app, plug_word, plug_dn, + plug]; exact rule_defect0D l r m + | Defect1D m => + intro v l r hv _ _; dsimp only [basic_rule, mk_rule, imm, withNat, Mode.hat] at hv ⊢ + rw [hv rfl]; simp only [ds, List.append_assoc, plug_app, plug_word, plug_dn, + plug]; exact rule_defect1D l r m + | Defect2D n m => + intro v l r hv _ _; dsimp only [basic_rule, mk_rule, imm, withNat, Mode.hat] at hv ⊢ + rw [hv rfl]; simp only [ds, List.append_assoc, plug_app, plug_word, plug_dn, plug_sn, + plug_power, plug]; exact rule_defect2D l r n m + | DefectBlank0 => + intro v l r hv _ _; rw [hv rfl]; dsimp only [basic_rule, mk_rule, imm, Mode.hat] + simp only [ds, List.append_assoc, plug_app, plug_word, plug_dn, plug_sn, + plug]; exact rules.rule_defect_blank0 l r + | DefectBlankS n => + intro v l r hv _ _; rw [hv rfl]; dsimp only [basic_rule, mk_rule, imm, Mode.hat] + simp only [ds, List.append_assoc, plug_app, plug_word, plug_dn, plug_sn, plug_power, + plug]; exact rules.rule_defect_blankS l r n + | Paired k n => + intro v l r hv _ _; dsimp only [basic_rule, mk_rule, withNat, Mode.hat] at hv ⊢ + rw [hv rfl] + simp only [ds, List.append_assoc, plug_app, plug_dn, plug_sn, plug_power, + plug, SymWord.toList] + exact rules.rule_paired l r k n + +inductive Tail where + | TBlank (m : Nat) (v : Digits) + | TCollision (m : Nat) (v : Digits) (j : Nat) + | TDefect0 (m : Nat) (v : Digits) (j d : Nat) + | TDefect1 (m : Nat) (v : Digits) (d : Nat) + +def Tail.keep_d : Tail → Nat + | .TBlank m _ => m + | .TCollision m _ _ => m + | .TDefect0 m _ _ _ => m + | .TDefect1 m _ _ => m + +def Tail.is_zero : Tail → Bool + | .TBlank _ _ => true + | _ => false + +def before (h : Nat) : Tail → Runs + | .TBlank _ v => ds v + | .TCollision _ v j => + withNat (h * 2) fun h2 => + ds v ++ dn j ++ imm ++ [(.D 0, h2)] + | .TDefect0 _ v j d => + ds v ++ dn j ++ imm ++ dn 0 ++ dn d + | .TDefect1 _ v d => + ds v ++ imm ++ dn 1 ++ dn d + +def after (h : Nat) : Tail → Runs + | .TBlank _ v => + withNat (h * 2) fun h2 => + ds v ++ [(.D 0, h2)] + | .TCollision _ v j => + withNat (1 + j) fun j1 => + withNat (h - 1) fun hm1 => + ds v ++ dn j1 ++ [(.D 3, hm1)] ++ dn 2 ++ imm + | .TDefect0 _ v j d => + withNat (1 + j) fun j1 => + withNat (2 + d) fun d2 => + ds v ++ dn j1 ++ dn d2 ++ imm + | .TDefect1 _ v d => + withNat (1 + d) fun d1 => + ds v ++ [(.D 0, 2)] ++ dn d1 ++ imm + +def Tail.valid_h (h : Nat) : Tail → Bool + | .TBlank _ _ => Nat.blt 0 h + | .TCollision _ _ _ => Nat.blt 0 h + | .TDefect0 _ _ _ _ => Nat.beq h 1 + | .TDefect1 _ _ _ => Nat.beq h 1 + +theorem tail_spec (u : Digits) (h : Nat) (t : Tail) (r : ListBlank (Fin 2)) + (hh : 0 < h) (hr : t.is_zero = true → r = default) : + calls target_tm (if match t with | .TDefect0 _ _ _ _ | .TDefect1 _ _ _ => true | _ => false then + 1 else h) + (plug (ds u) (plug (before h t) r)) + (plug (ds u) (plug (after h t) r)) := by + apply calls_prefix u + cases t with + | TBlank m v => + rw [hr rfl] + dsimp only [before, after, withNat, ↓reduceIte] + rw [plug_app, plug_run] + exact calls_blank h v + | TCollision m v j => + dsimp only [before, after, imm, withNat, ↓reduceIte] + simp only [List.append_assoc, plug_app, plug_word, plug_dn, plug_run, SymWord.toList] + have hh1 : (h - 1) + 1 = h := by omega + have hc := calls_collision (target_tm := target_tm) (h - 1) v j r + rwa [hh1] at hc + | TDefect0 m v j d => + dsimp only [before, after, imm, withNat, ↓reduceIte] + simp only [List.append_assoc, plug_app, plug_word, plug_dn] + exact calls.succ (call_defect0 v j d r) (calls.zero _) + | TDefect1 m v d => + dsimp only [before, after, imm, withNat, ↓reduceIte] + simp only [List.append_assoc, plug_app, plug_word, plug_dn, plug_run, SymWord.toList, + pow_succ_list, pow_zero_list, List.append_nil, listblank_append_right_assoc] + exact calls.succ (call_defect1 v d r) (calls.zero _) + +inductive High where + | RightList (v : Digits) + | LeftList (v : Digits) + | Call (t : Tail) + | Pairs (n k : Nat) + | Loops (fromR : Bool) (k b : Nat) (t : Tail) + | LoopsJ (k b : Nat) (t : Tail) + | Returns (fromJ : Bool) (n k : Nat) (t : Tail) + +def tail_calls (h : Nat) (t : Tail) : Nat := + match t with + | .TDefect0 _ _ _ _ | .TDefect1 _ _ _ => 1 + | _ => h + +def high_rule : High → Recipe + | .RightList v => mk_rule .MR [] (ds v) .MR (ss v) [] + | .LeftList v => mk_rule .ML (ss v) [] .ML [] (ds v) + | .Call t => ⟨.MR, [], before 1 t, .ML, [], [], after 1 t, t.keep_d, false, t.is_zero⟩ + | .Pairs n k => + withNat (2 + n) fun n2 => + withNat (k * 2) fun k2 => + mk_rule .MR [] (imm ++ [(.D n2, k2)]) .MR [(.PL n, k)] imm + | .Loops fromR k b t => + withNat (if fromR then 2 + k else 1 + k) fun h0 => + let h := tail_calls h0 t + withNat (1 + b) fun b1 => + let head_in := if fromR then Mode.MR else Mode.ML + let shares := if fromR then h - 1 else h + ⟨head_in, power [1, 0] b1 ++ [(.raw [1, 1, 1], shares)], before h t, + .ML, power [1, 0] b1, [], after h t, t.keep_d, false, t.is_zero⟩ + | .LoopsJ k b t => + withNat (1 + k) fun h0 => + let h := tail_calls h0 t + withNat (1 + b) fun b1 => + ⟨.MJ, power [1, 0] b ++ [(.raw [1, 1, 1], h)], before h t, + .ML, power [1, 0] b1, [], after h t, t.keep_d, false, t.is_zero⟩ + | .Returns fromJ n k t => + withNat (1 + k) fun count => + withNat (1 + n * 2) fun step => + withNat (count * step) fun h => + withNat (1 + n * 3) fun n3_1 => + withNat (6 + n * 3) fun n3_6 => + withNat (5 + n * 3) fun n3_5 => + let t_clean := match t with + | .TBlank m v => Tail.TBlank m v + | .TCollision m v j => Tail.TCollision m v j + | .TDefect0 m v _ _ => Tail.TBlank m v + | .TDefect1 m v _ => Tail.TBlank m v + ⟨if fromJ then .MJ else .ML, [(.PL n3_1, count)], before h t_clean, + .MJ, [], (if fromJ then [(.D n3_6, count)] else [(.D n3_6, k)] ++ dn n3_5), after h t_clean, + t_clean.keep_d, false, t_clean.is_zero⟩ + +theorem high_valid (x : High) : valid target_tm (high_rule x) := by + cases x with + | RightList v => + intro u l r hu _ _; rw [hu rfl] + dsimp [high_rule, mk_rule, Mode.hat, ds, plug] + exact right_list v l r + | LeftList v => + intro u l r hu _ _; rw [hu rfl] + dsimp [high_rule, mk_rule, Mode.hat, ds, plug] + exact left_list v l r + | Call t => + intro u l r _ _ hr + dsimp only [high_rule, Mode.hat, plug] + have ht := tail_spec (target_tm := target_tm) u 1 t r (by omega) hr + revert ht + cases t + all_goals + intro ht + cases ht with + | @succ _ _ s _ hcall hzero => + cases hzero + exact hcall l + | Pairs n k => + intro u l r hu _ _; dsimp only [high_rule, mk_rule, imm, Mode.hat, withNat] at hu ⊢ + rw [hu rfl] + simp only [ds, plug_app, plug_word, plug, SymWord.toList] + exact pairsR k n l r + | Loops fromR k b t => + intro u l r _ _ hr + dsimp only [high_rule, withNat, plug] + let h0 := if fromR then 2 + k else 1 + k + let h := tail_calls h0 t + have hh : 0 < h := by + cases t <;> cases fromR <;> dsimp [h, h0, tail_calls] <;> omega + have ht := tail_spec (target_tm := target_tm) u h t r hh hr + revert ht + cases t + all_goals + intro ht + rw [plug_app, plug_power, plug_run, plug_power] + cases fromR <;> dsimp [Mode.hat, SymWord.toList] + · exact loopL ht l b + · exact loopR_to_L' hh ht l b + | LoopsJ k b t => + intro u l r _ _ hr + dsimp only [high_rule, withNat, Mode.hat, SymWord.toList, plug] + let h := tail_calls (1 + k) t + have hh : 0 < h := by + cases t <;> dsimp [h, tail_calls] <;> omega + have ht := tail_spec (target_tm := target_tm) u h t r hh hr + revert ht + cases t + all_goals + intro ht + rw [plug_app, plug_power, plug_run, plug_power] + exact loopJ' hh ht l b + | Returns fromJ n k t => + intro u l r _ _ hr + dsimp only [high_rule, withNat] + let t_clean := match t with + | .TBlank m v => Tail.TBlank m v + | .TCollision m v j => Tail.TCollision m v j + | .TDefect0 m v _ _ => Tail.TBlank m v + | .TDefect1 m v _ => Tail.TBlank m v + have hpos : 0 < (1 + k) * (1 + n * 2) := by positivity + have ht := tail_spec (target_tm := target_tm) u ((1 + k) * (1 + n * 2)) t_clean r hpos hr + revert ht + cases t + all_goals + intro ht + cases fromJ <;> ( + simp only [Bool.false_eq_true, ↓reduceIte, Mode.hat, plug_app, + plug_dn, plug_run, plug, SymWord.toList]) + · exact returnsP_L k n ht l + · exact returnsP_J (1 + k) n ht l + + +-- ============================================================================ +-- Section 6: CBSim (Untrusted Oracle & Verified Checker) +-- ============================================================================ + +abbrev Instruction := Sum Basic High + +def bi (b : Basic) : Option Instruction := some (.inl b) +def hi (h : High) : Option Instruction := some (.inr h) + +def recipe_of : Instruction → Recipe + | .inl b => basic_rule b + | .inr h => high_rule h + +theorem certified (i : Instruction) : valid target_tm (recipe_of i) := by + cases i with + | inl b => exact basic_valid b + | inr h => exact high_valid h + + +def align (c : RMConfig) : RMConfig := + if beqFin6 c.state A then orient Dir.right c + else if beqFin6 c.state B || beqFin6 c.state C then orient Dir.left c + else c + +theorem align_spec (c : RMConfig) : (align c).denote = c.denote := by + dsimp [align] + split_ifs <;> try exact orient_spec _ c + rfl + + +def initial : RMConfig := ⟨[], [], A, Dir.right⟩ + +def Runs.move_right_sym : Nat → Runs → Runs → Option (Runs × Runs) + | 0, l, r => some (l, r) + | m + 1, l, (.D n, k) :: r => move_right_sym m (Runs.push (.S n) k l) r + | _ + 1, _, _ => none + +theorem Runs.move_right_sym_spec (m : Nat) (l r l' r' : Runs) + (h : move_right_sym m l r = some (l', r')) : + ReachesStar target_tm (CfgR (Runs.denote l) (Runs.denote r)) (CfgR (Runs.denote l') (Runs.denote + r')) := by + induction m generalizing l r with + | zero => + simp only [move_right_sym, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + try exact ReachesStar.refl _ _ + | succ m ih => + rcases r with _ | ⟨⟨w, k⟩, r_rest⟩; · contradiction + cases w <;> try contradiction + rename_i n + dsimp only [move_right_sym] at h + have ih' := ih (Runs.push (.S n) k l) r_rest h + rw [Runs.push_spec] at ih' + dsimp only [Runs.denote, SymWord.toList] at ih' ⊢ + exact (rule_right_pow (Runs.denote l) (Runs.denote r_rest) n k).trans ih' + +def Runs.move_left_sym : Nat → Runs → Runs → Option (Runs × Runs) + | 0, l, r => some (l, r) + | m + 1, (.S n, k) :: l, r => move_left_sym m l (Runs.push (.D n) k r) + | _ + 1, _, _ => none + +theorem Runs.move_left_sym_spec (m : Nat) (l r l' r' : Runs) + (h : move_left_sym m l r = some (l', r')) : + ReachesStar target_tm (CfgL (Runs.denote l) (Runs.denote r)) (CfgL (Runs.denote l') (Runs.denote + r')) := by + induction m generalizing l r with + | zero => + simp only [move_left_sym, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + try exact ReachesStar.refl _ _ + | succ m ih => + rcases l with _ | ⟨⟨w, k⟩, l_rest⟩; · contradiction + cases w <;> try contradiction + rename_i n + dsimp only [move_left_sym] at h + have ih' := ih l_rest (Runs.push (.D n) k r) h + rw [Runs.push_spec] at ih' + dsimp only [Runs.denote, SymWord.toList] at ih' ⊢ + exact (rule_left_pow (Runs.denote l_rest) (Runs.denote r) n k).trans ih' + + +def raw_steps (target_tm : Machine (Fin 2) (Fin 6)) : Nat → RMConfig → Sum RMConfig Bool + | 0, c => .inl c + | k + 1, c => + let d := if Nat.ble 3 c.state.val then c else align c + match raw_step target_tm d with + | some c' => raw_steps target_tm k c' + | none => .inr true + +theorem raw_steps_spec (k : Nat) (c : RMConfig) : + match raw_steps target_tm k c with + | .inl c' => ReachesStar target_tm c.denote c'.denote + | .inr b => b = true → HaltsFrom target_tm c.denote := by + induction k generalizing c with + | zero => try exact ReachesStar.refl _ _ + | succ k ih => + dsimp only [raw_steps] + have hd_eq : (if Nat.ble 3 c.state.val then c else align c).denote = c.denote := by + split_ifs + · rfl + · exact align_spec c + rw [← hd_eq] + generalize (if Nat.ble 3 c.state.val then c else align c) = d + have hr := raw_step_spec (target_tm := target_tm) d + cases hraw : raw_step target_tm d with + | none => + rw [hraw] at hr; dsimp only at hr ⊢ + intro _; exact hr + | some c' => + rw [hraw] at hr; dsimp only at hr ⊢ + have ih' := ih c' + cases hrs : raw_steps target_tm k c' with + | inl c'' => rw [hrs] at ih'; exact hr.trans ih' + | inr b => rw [hrs] at ih'; intro hb; exact HaltsFrom.of_reachesStar hr (ih' hb) + + +theorem denote_eq_plug_default (r : Runs) : Runs.denote r = plug r default := by + induction r with + | nil => rfl + | cons wn xs ih => rcases wn with ⟨w, n⟩; dsimp only [Runs.denote, plug]; rw [ih] + +theorem push_plug (w : SymWord) (n : Nat) (xs : Runs) (t : ListBlank (Fin 2)) : + plug (Runs.push w n xs) t = (w.toList ^ n) +> plug xs t := by + dsimp only [Runs.push] + cases he : w.isEmpty + · cases hn : Nat.beq n 0 + · simp only [Bool.or_self, Bool.false_eq_true, ↓reduceIte] + cases xs with + | nil => rfl + | cons vm ys => + rcases vm with ⟨v, m⟩ + dsimp only [withNat] + cases h : SymWord.beq w v + · simp [plug] + · simp [plug, ← SymWord.beq_eq w v h, pow_append_pow] + · simp [Nat.eq_of_beq_eq_true hn] + · simp [SymWord.isEmpty_spec w he, nil_pow] + +theorem put_plug (xs ys : Runs) (t : ListBlank (Fin 2)) : + plug (put xs ys) t = plug xs (plug ys t) := by + induction xs with + | nil => rfl + | cons wn xs ih => + rcases wn with ⟨w, n⟩ + dsimp [put, plug] + rw [push_plug, ih] + +theorem exact_head_plug (w : SymWord) (n : Nat) (xs ys : Runs) (t : ListBlank (Fin 2)) + (h : Runs.exact_head w n xs = some ys) : plug xs t = (w.toList ^ n) +> plug ys t := by + cases xs with + | nil => contradiction + | cons vm rest => + rcases vm with ⟨v, m⟩ + dsimp only [Runs.exact_head, withNat] at h + cases hwv : SymWord.beq w v <;> rw [hwv] at h + · contradiction + simp only [↓reduceIte] at h + cases hnm : Nat.beq n m <;> rw [hnm] at h + · simp only [Bool.false_eq_true, ↓reduceIte] at h + cases hlt : Nat.blt n m <;> rw [hlt] at h + · contradiction + simp only [↓reduceIte, Option.some.injEq] at h + subst h + dsimp only [plug] + rw [SymWord.beq_eq w v hwv, pow_append_pow] + have hlt' : n < m := Nat.le_of_ble_eq_true hlt + have hm : n + (m - n) = m := by omega + rw [hm] + · simp only [↓reduceIte, Option.some.injEq] at h + subst h + dsimp only [plug] + rw [SymWord.beq_eq w v hwv, Nat.eq_of_beq_eq_true hnm] + +def Mode.beq : Mode → Mode → Bool + | .MR, .MR => true + | .ML, .ML => true + | .MJ, .MJ => true + | .MA, .MA => true + | .MB, .MB => true + | .MC, .MC => true + | _, _ => false + +theorem Mode.beq_eq (a b : Mode) (h : Mode.beq a b = true) : a = b := by + cases a <;> cases b <;> first | rfl | contradiction + +def append_d0 (z : Nat) : Runs → Runs + | [] => if Nat.beq z 0 then [] else [(.D 0, z)] + | [(w, k)] => Runs.push w k (if Nat.beq z 0 then [] else [(.D 0, z)]) + | x :: xs => x :: append_d0 z xs + +theorem denote_d0_ite (z : Nat) : + Runs.denote (if Nat.beq z 0 then [] else [(.D 0, z)]) = ((D_word 0) ^ z) +> default := by + by_cases hz : Nat.beq z 0 = true + · rw [if_pos hz] + have hz0 : z = 0 := Nat.eq_of_beq_eq_true hz + subst hz0 + rfl + · rw [if_neg hz] + rfl + +theorem append_d0_spec (z : Nat) (r : Runs) : + Runs.denote (append_d0 z r) = plug r (((D_word 0) ^ z) +> default) := by + induction r with + | nil => + dsimp only [append_d0, plug] + exact denote_d0_ite z + | cons x xs ih => + rcases x with ⟨w, k⟩ + cases xs with + | nil => + dsimp only [append_d0, plug] + rw [Runs.push_spec, denote_d0_ite] + | cons y ys => + dsimp only [append_d0, Runs.denote, plug] + rw [ih] + rfl + +def is_all_d : Runs → Bool + | [] => true + | (.D _, _) :: xs => is_all_d xs + | _ => false + +def to_digits : Runs → Digits + | [] => [] + | (.D n, k) :: xs => (n, k) :: to_digits xs + | _ :: xs => to_digits xs + +theorem ds_to_digits (r : Runs) (h : is_all_d r = true) : ds (to_digits r) = r := by + induction r with + | nil => rfl + | cons x xs ih => + rcases x with ⟨w, k⟩ + cases w <;> try contradiction + dsimp only [is_all_d] at h + dsimp only [to_digits, ds_cons] + rw [ih h] + +theorem is_all_d_push (n k : Nat) (r : Runs) (hr : is_all_d r = true) : + is_all_d (Runs.push (.D n) k r) = true := by + unfold Runs.push + split_ifs + · exact hr + · cases r with + | nil => rfl + | cons x xs => + rcases x with ⟨v, m⟩ + cases v <;> try contradiction + dsimp only [is_all_d] at hr + dsimp only [withNat] + split_ifs <;> exact hr + +theorem is_all_d_put (xs r : Runs) (hxs : is_all_d xs = true) (hr : is_all_d r = true) : + is_all_d (put xs r) = true := by + induction xs with + | nil => exact hr + | cons x xs ih => + rcases x with ⟨w, k⟩ + cases w <;> try contradiction + dsimp only [is_all_d] at hxs + dsimp only [put] + exact is_all_d_push _ k (put xs r) (ih hxs) + +theorem is_all_d_append_d0 (z : Nat) (r : Runs) (hr : is_all_d r = true) : + is_all_d (append_d0 z r) = true := by + have hd0 : is_all_d (if Nat.beq z 0 then [] else [(.D 0, z)]) = true := by + split_ifs <;> rfl + induction r with + | nil => exact hd0 + | cons x xs ih => + rcases x with ⟨w, k⟩ + cases w <;> try contradiction + dsimp only [is_all_d] at hr + cases xs with + | nil => exact is_all_d_push _ k _ hd0 + | cons y ys => dsimp only [append_d0, is_all_d]; exact ih hr + +def take_d : Runs → Runs → Option Runs + | [], ys => some ys + | [(.D n, k)], ys => Runs.exact_head (.D n) k ys + | _, _ => none + +theorem take_d_plug (ri ys zs : Runs) (t : ListBlank (Fin 2)) (h : take_d ri ys = some zs) : + plug ys t = plug ri (plug zs t) := by + rcases ri with _ | ⟨⟨w, k⟩, rest⟩ + · injection h with h; subst h; rfl + · cases w <;> try contradiction + cases rest <;> try contradiction + dsimp only [take_d] at h + dsimp only [plug] + exact exact_head_plug _ k ys zs t h + +theorem is_all_d_take_d (ri ys zs : Runs) (hys : is_all_d ys = true) (h : take_d ri ys = some zs) : + is_all_d zs = true := by + rcases ri with _ | ⟨⟨w, k⟩, rest⟩ + · injection h with h; subst h; exact hys + · cases w <;> try contradiction + cases rest <;> try contradiction + dsimp only [take_d] at h + rcases ys with _ | ⟨⟨v, m⟩, ys_rest⟩; · contradiction + cases v <;> try contradiction + dsimp only [is_all_d] at hys + dsimp only [Runs.exact_head, withNat] at h + split_ifs at h <;> (injection h with h; subst h; exact hys) + +theorem is_all_d_move_right (m : Nat) (l r l' r' : Runs) (hr : is_all_d r = true) + (h : Runs.move_right_sym m l r = some (l', r')) : is_all_d r' = true := by + induction m generalizing l r with + | zero => simp only [Runs.move_right_sym, Option.some.injEq, Prod.mk.injEq] at h; rcases h with + ⟨_, rfl⟩; exact hr + | succ m ih => + rcases r with _ | ⟨⟨w, k⟩, r_rest⟩; · contradiction + cases w <;> try contradiction + dsimp only [is_all_d] at hr + exact ih _ r_rest hr h + +theorem is_all_d_move_left (m : Nat) (l r l' r' : Runs) (hr : is_all_d r = true) + (h : Runs.move_left_sym m l r = some (l', r')) : is_all_d r' = true := by + induction m generalizing l r with + | zero => simp only [Runs.move_left_sym, Option.some.injEq, Prod.mk.injEq] at h; rcases h with + ⟨_, rfl⟩; exact hr + | succ m ih => + rcases l with _ | ⟨⟨w, k⟩, l_rest⟩; · contradiction + cases w <;> try contradiction + exact ih l_rest _ (is_all_d_push _ k r hr) h + +theorem move_right_sym_plug (m : Nat) (l r l' r' : Runs) (t : ListBlank (Fin 2)) + (h : Runs.move_right_sym m l r = some (l', r')) : + ReachesStar target_tm (CfgR (Runs.denote l) (plug r t)) (CfgR (Runs.denote l') (plug r' t)) := + by + induction m generalizing l r with + | zero => + simp only [Runs.move_right_sym, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + try exact ReachesStar.refl _ _ + | succ m ih => + rcases r with _ | ⟨⟨w, k⟩, r_rest⟩; · contradiction + cases w <;> try contradiction + rename_i n + dsimp only [Runs.move_right_sym] at h + have ih' := ih (Runs.push (.S n) k l) r_rest h + rw [Runs.push_spec] at ih' + dsimp only [plug, SymWord.toList] at ih' ⊢ + exact (rule_right_pow (Runs.denote l) (plug r_rest t) n k).trans ih' + +theorem move_left_sym_plug (m : Nat) (l r l' r' : Runs) (t : ListBlank (Fin 2)) + (h : Runs.move_left_sym m l r = some (l', r')) : + ReachesStar target_tm (CfgL (Runs.denote l) (plug r t)) (CfgL (Runs.denote l') (plug r' t)) := + by + induction m generalizing l r with + | zero => + simp only [Runs.move_left_sym, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + try exact ReachesStar.refl _ _ + | succ m ih => + rcases l with _ | ⟨⟨w, k⟩, l_rest⟩; · contradiction + cases w <;> try contradiction + rename_i n + dsimp only [Runs.move_left_sym] at h + have ih' := ih l_rest (Runs.push (.D n) k r) h + rw [push_plug] at ih' + dsimp only [Runs.denote, SymWord.toList] at ih' ⊢ + exact (rule_left_pow (Runs.denote l_rest) (plug r t) n k).trans ih' + +structure FastConfig where + left : Runs + right : Runs + mode : Mode + d_tail : Option Nat + deriving DecidableEq + +def FastConfig.WF (fc : FastConfig) : Prop := + match fc.d_tail with + | none => True + | some _ => is_all_d fc.right = true + +def tail_denote : Option Nat → ListBlank (Fin 2) + | none => default + | some z => ((D_word 0) ^ z) +> default + +def flush_d_runs (dt : Option Nat) (r : Runs) : Runs := + match dt with + | none => r + | some z => if Nat.beq z 0 then r else append_d0 z r + +theorem flush_d_runs_spec (dt : Option Nat) (r : Runs) : + Runs.denote (flush_d_runs dt r) = plug r (tail_denote dt) := by + cases dt with + | none => exact denote_eq_plug_default r + | some z => + dsimp only [flush_d_runs, tail_denote] + by_cases hz : Nat.beq z 0 = true + · rw [if_pos hz] + have hz0 : z = 0 := Nat.eq_of_beq_eq_true hz + subst hz0 + rw [denote_eq_plug_default] + rfl + · rw [if_neg hz] + exact append_d0_spec z r + +def flush_fc (fc : FastConfig) : RMConfig := + let r1 := flush_d_runs fc.d_tail fc.right + ⟨fc.left, Runs.push (.raw fc.mode.payload) 1 r1, fc.mode.mq, fc.mode.md⟩ + +theorem mode_push_denote (m : Mode) (l r : Runs) : + (RMConfig.mk l (Runs.push (.raw m.payload) 1 r) m.mq m.md).denote = + m.hat (Runs.denote l) (Runs.denote r) := by + cases m <;> ( + dsimp only [RMConfig.denote, Mode.md, Mode.mq, Mode.hat, Mode.payload] + rw [Runs.push_spec] + simp [SymWord.toList, pow_succ_list, List.append_nil, CfgR, CfgL, CfgJ]) + +theorem flush_fc_denote (fc : FastConfig) : + (flush_fc fc).denote = + fc.mode.hat (Runs.denote fc.left) (plug fc.right (tail_denote fc.d_tail)) := by + dsimp only [flush_fc] + rw [mode_push_denote, flush_d_runs_spec] + +def of_rm (c : RMConfig) : Option FastConfig := + if beqFin6 c.state A then + let d := orient Dir.right c + some ⟨d.left, d.right, .MA, none⟩ + else if beqFin6 c.state B then + let d := orient Dir.left c + some ⟨d.left, d.right, .MB, none⟩ + else if beqFin6 c.state C then + let d := orient Dir.left c + some ⟨d.left, d.right, .MC, none⟩ + else none + +theorem of_rm_spec (c : RMConfig) (fc : FastConfig) (h : of_rm c = some fc) : + (flush_fc fc).denote = c.denote ∧ fc.WF := by + dsimp only [of_rm] at h + split_ifs at h with hA hB hC + · injection h with h; subst h + refine ⟨?_, trivial⟩ + rw [flush_fc_denote, ← orient_spec Dir.right c] + have hd_dir := orient_dir Dir.right c + have hd_st := orient_state Dir.right c + generalize orient Dir.right c = d at hd_dir hd_st + rcases d with ⟨dl, dr, dq, ddir⟩ + dsimp only at hd_dir hd_st ⊢ + have hq : dq = A := by rw [hd_st, beqFin6_eq _ _ hA] + subst hq hd_dir + dsimp only [Mode.hat, tail_denote, RMConfig.denote] + rw [← denote_eq_plug_default] + · injection h with h; subst h + refine ⟨?_, trivial⟩ + rw [flush_fc_denote, ← orient_spec Dir.left c] + have hd_dir := orient_dir Dir.left c + have hd_st := orient_state Dir.left c + generalize orient Dir.left c = d at hd_dir hd_st + rcases d with ⟨dl, dr, dq, ddir⟩ + dsimp only at hd_dir hd_st ⊢ + have hq : dq = B := by rw [hd_st, beqFin6_eq _ _ hB] + subst hq hd_dir + dsimp only [Mode.hat, tail_denote, RMConfig.denote] + rw [← denote_eq_plug_default] + · injection h with h; subst h + refine ⟨?_, trivial⟩ + rw [flush_fc_denote, ← orient_spec Dir.left c] + have hd_dir := orient_dir Dir.left c + have hd_st := orient_state Dir.left c + generalize orient Dir.left c = d at hd_dir hd_st + rcases d with ⟨dl, dr, dq, ddir⟩ + dsimp only at hd_dir hd_st ⊢ + have hq : dq = C := by rw [hd_st, beqFin6_eq _ _ hC] + subst hq hd_dir + dsimp only [Mode.hat, tail_denote, RMConfig.denote] + rw [← denote_eq_plug_default] + +def enter_mode (hi : Mode) (l r : Runs) (m : Mode) : Option (Runs × Runs) := + if Mode.beq m hi then + some (l, r) + else + let c : RMConfig := ⟨l, Runs.push (.raw m.payload) 1 r, m.mq, m.md⟩ + if beqFin6 c.state hi.mq then + let d := orient hi.md c + match remove_prefix hi.payload d.right with + | some rs => some (d.left, rs) + | none => none + else none + +theorem enter_mode_spec (hi : Mode) (l r : Runs) (m : Mode) (ls rs : Runs) + (h : enter_mode hi l r m = some (ls, rs)) : + (flush_fc ⟨l, r, m, none⟩).denote = hi.hat (Runs.denote ls) (Runs.denote rs) := by + dsimp only [enter_mode] at h + by_cases hm : Mode.beq m hi = true + · rw [if_pos hm] at h + injection h with h; rcases h with ⟨rfl, rfl⟩ + rw [Mode.beq_eq m hi hm, flush_fc_denote] + dsimp only [tail_denote] + rw [← denote_eq_plug_default] + · rw [if_neg hm] at h + let c : RMConfig := ⟨l, Runs.push (.raw m.payload) 1 r, m.mq, m.md⟩ + change (if beqFin6 c.state hi.mq then _ else none) = some (ls, rs) at h + cases hst : beqFin6 c.state hi.mq <;> rw [hst] at h; · contradiction + simp only [↓reduceIte] at h + have hc_eq : (flush_fc ⟨l, r, m, none⟩).denote = c.denote := rfl + rw [hc_eq, ← orient_spec hi.md c] + have hd_dir := orient_dir hi.md c + have hd_st := orient_state hi.md c + generalize orient hi.md c = d at h hd_dir hd_st + rcases d with ⟨dl, dr, dq, ddir⟩ + dsimp only at h hd_dir hd_st + have hq : dq = hi.mq := by rw [hd_st, beqFin6_eq _ _ hst] + subst hq hd_dir + cases hrp : remove_prefix hi.payload dr <;> rw [hrp] at h; · contradiction + injection h with h; rcases h with ⟨rfl, rfl⟩ + have hrs := remove_prefix_spec hi.payload dr rs hrp + cases hi <;> ( + dsimp only [RMConfig.denote, Mode.md, Mode.mq, Mode.hat, Mode.payload] at hrs ⊢ + rw [hrs] + simp [CfgR, CfgL, CfgJ]) + +def mk_fc_out (check_all_d : Bool) (l r : Runs) (m : Mode) : FastConfig := + let dt := if check_all_d then (if is_all_d r then some 0 else none) else none + ⟨l, r, m, dt⟩ + +theorem mk_fc_out_spec (check_all_d : Bool) (l r : Runs) (m : Mode) : + (flush_fc (mk_fc_out check_all_d l r m)).denote = m.hat (Runs.denote l) (Runs.denote r) ∧ + (mk_fc_out check_all_d l r m).WF := by + dsimp only [mk_fc_out] + split_ifs with h1 h2 + · refine ⟨?_, h2⟩ + dsimp only [flush_fc, flush_d_runs] + rw [mode_push_denote] + rfl + · refine ⟨?_, trivial⟩ + dsimp only [flush_fc, flush_d_runs] + rw [mode_push_denote] + · refine ⟨?_, trivial⟩ + dsimp only [flush_fc, flush_d_runs] + rw [mode_push_denote] + +def use_fast_none (p : Recipe) (check_all_d : Bool) (fc : FastConfig) : Option FastConfig := + let r0 := flush_d_runs fc.d_tail fc.right + match enter_mode p.hi fc.left r0 fc.mode with + | some (ls, rs) => + match take p.li ls with + | some l => + if check_zero p.zl l then + match take_keep_put p.keep_d p.ri p.ro p.zr rs with + | some r_out => + some (mk_fc_out check_all_d (put p.lo l) (put p.ro_pre r_out) p.ho) + | none => none + else none + | none => none + | none => none + +omit rules in +theorem use_fast_none_spec (p : Recipe) (check_all_d : Bool) (fc fc' : FastConfig) + (hv : valid target_tm p) (hu : use_fast_none p check_all_d fc = some fc') : + ReachesStar target_tm (flush_fc fc).denote (flush_fc fc').denote ∧ fc'.WF := by + dsimp only [use_fast_none] at hu + cases hem : enter_mode p.hi fc.left (flush_d_runs fc.d_tail fc.right) fc.mode with + | none => rw [hem] at hu; contradiction + | some lr => + rcases lr with ⟨ls, rs⟩ + rw [hem] at hu; dsimp only at hu + cases htl : take p.li ls with + | none => rw [htl] at hu; contradiction + | some l => + rw [htl] at hu; dsimp only at hu + split_ifs at hu with hzl + cases htk : take_keep_put p.keep_d p.ri p.ro p.zr rs with + | none => rw [htk] at hu; contradiction + | some r_out => + rw [htk] at hu; injection hu with hu; subst hu + rcases mk_fc_out_spec check_all_d (put p.lo l) (put p.ro_pre r_out) p.ho with ⟨hden_out, + hwf_out⟩ + refine ⟨?_, hwf_out⟩ + have hem_den := + enter_mode_spec p.hi fc.left (flush_d_runs fc.d_tail fc.right) fc.mode ls rs hem + change (flush_fc fc).denote = _ at hem_den + rw [hem_den, hden_out, take_spec p.li ls l htl, put_spec p.lo l, put_spec p.ro_pre r_out] + obtain ⟨v, r, hkd, hzr, hrs, hrout⟩ := + take_keep_put_spec p.keep_d p.ri p.ro p.zr rs r_out htk + rw [hrs, hrout] + exact hv v (Runs.denote l) r hkd (check_zero_spec p.zl l hzl) hzr + +def use_pres_d_step (p : Recipe) (l r : Runs) (m : Mode) (z : Nat) : Option FastConfig := + if Mode.beq m p.hi && Nat.beq p.keep_d 0 && !p.zl && !p.zr && p.ro_pre.isEmpty && is_all_d p.ro + then + match take p.li l, take_d p.ri r with + | some l', some r1 => + some ⟨put p.lo l', put p.ro r1, p.ho, some z⟩ + | _, _ => none + else none + +omit rules in +theorem use_pres_d_step_spec (p : Recipe) (l r : Runs) (m : Mode) (z : Nat) (fc' : FastConfig) + (hr : is_all_d r = true) (hv : valid target_tm p) + (hu : use_pres_d_step p l r m z = some fc') : + ReachesStar target_tm (flush_fc ⟨l, r, m, some z⟩).denote (flush_fc fc').denote ∧ fc'.WF := by + dsimp only [use_pres_d_step] at hu + split_ifs at hu with hcond + rcases Bool.and_eq_true_iff.mp hcond with ⟨hcond1, hro⟩ + rcases Bool.and_eq_true_iff.mp hcond1 with ⟨hcond2, hro_pre⟩ + rcases Bool.and_eq_true_iff.mp hcond2 with ⟨hcond3, hzr⟩ + rcases Bool.and_eq_true_iff.mp hcond3 with ⟨hcond4, hzl⟩ + rcases Bool.and_eq_true_iff.mp hcond4 with ⟨hm, hkd⟩ + cases htl : take p.li l <;> rw [htl] at hu; · contradiction + rename_i l' + cases htr : take_d p.ri r <;> rw [htr] at hu; · contradiction + rename_i r1 + injection hu with hu; subst hu + have hwf' : is_all_d (put p.ro r1) = true := + is_all_d_put p.ro r1 hro (is_all_d_take_d p.ri r r1 hr htr) + refine ⟨?_, hwf'⟩ + rw [flush_fc_denote, flush_fc_denote] + dsimp only + rw [Mode.beq_eq m p.hi hm, take_spec p.li l l' htl, put_spec p.lo l', + take_d_plug p.ri r r1 (tail_denote (some z)) htr, + put_plug p.ro r1 (tail_denote (some z))] + have hv' := hv [] (Runs.denote l') (plug r1 (tail_denote (some z))) + (fun _ => rfl) + (by intro h; rw [h] at hzl; contradiction) + (by intro h; rw [h] at hzr; contradiction) + rw [List.isEmpty_iff.mp hro_pre] at hv' + exact hv' + +def use_pres_all_d (p : Recipe) (fc : FastConfig) : Option FastConfig := + match fc.d_tail with + | none => use_fast_none p false fc + | some z => + match use_pres_d_step p fc.left fc.right fc.mode z with + | some fc' => some fc' + | none => + if Nat.beq z 0 then none + else use_pres_d_step p fc.left (append_d0 z fc.right) fc.mode 0 + +theorem flush_append_d0_eq (l r : Runs) (m : Mode) (z : Nat) : + (flush_fc ⟨l, append_d0 z r, m, some 0⟩).denote = (flush_fc ⟨l, r, m, some z⟩).denote := by + rw [flush_fc_denote, flush_fc_denote] + dsimp only [tail_denote] + rw [pow_zero_list, listblank_append_nil, ← denote_eq_plug_default, append_d0_spec] + +omit rules in +theorem use_pres_all_d_spec (p : Recipe) (fc fc' : FastConfig) + (hwf : fc.WF) (hv : valid target_tm p) (hu : use_pres_all_d p fc = some fc') : + ReachesStar target_tm (flush_fc fc).denote (flush_fc fc').denote ∧ fc'.WF := by + rcases fc with ⟨l, r, m, dt⟩ + cases dt with + | none => exact use_fast_none_spec p false ⟨l, r, m, none⟩ fc' hv hu + | some z => + dsimp only [use_pres_all_d] at hu + dsimp only [FastConfig.WF] at hwf + cases hstep : use_pres_d_step p l r m z <;> rw [hstep] at hu + · dsimp only at hu + split_ifs at hu with hz0 + rw [← flush_append_d0_eq l r m z] + exact use_pres_d_step_spec p l (append_d0 z r) m 0 fc' (is_all_d_append_d0 z r hwf) hv hu + · injection hu with hu; subst fc' + exact use_pres_d_step_spec p l r m z _ hwf hv hstep + +def exec_tblank1_step (p : Recipe) (l r : Runs) (m : Mode) (z : Nat) : Option FastConfig := + if Mode.beq m p.hi && Nat.beq p.keep_d 1 && !p.zl && p.ri.isEmpty && is_all_d p.ro_pre then + match p.ro, take p.li l with + | [(.D 0, h2)], some l' => + withNat (z + h2) fun z' => + some ⟨put p.lo l', put p.ro_pre r, p.ho, some z'⟩ + | _, _ => none + else none + +omit rules in +theorem exec_tblank1_step_spec (p : Recipe) (l r : Runs) (m : Mode) (z : Nat) (fc' : FastConfig) + (hr : is_all_d r = true) (hv : valid target_tm p) + (hu : exec_tblank1_step p l r m z = some fc') : + ReachesStar target_tm (flush_fc ⟨l, r, m, some z⟩).denote (flush_fc fc').denote ∧ fc'.WF := by + dsimp only [exec_tblank1_step, withNat] at hu + split_ifs at hu with hcond + rcases Bool.and_eq_true_iff.mp hcond with ⟨hcond1, hro_pre⟩ + rcases Bool.and_eq_true_iff.mp hcond1 with ⟨hcond2, hri⟩ + rcases Bool.and_eq_true_iff.mp hcond2 with ⟨hcond3, hzl⟩ + rcases Bool.and_eq_true_iff.mp hcond3 with ⟨hm, hkd⟩ + rcases hro : p.ro with _ | ⟨⟨w, h2⟩, ro_rest⟩ <;> rw [hro] at hu; · contradiction + cases w <;> try contradiction + rename_i d + cases d <;> try contradiction + cases ro_rest <;> try contradiction + cases htl : take p.li l <;> rw [htl] at hu; · contradiction + rename_i l' + injection hu with hu; subst hu + refine ⟨?_, is_all_d_put p.ro_pre r hro_pre hr⟩ + rw [flush_fc_denote, flush_fc_denote] + dsimp only + rw [Mode.beq_eq m p.hi hm, take_spec p.li l l' htl, put_spec p.lo l', + put_plug p.ro_pre r (tail_denote (some (z + h2)))] + let u : Digits := to_digits r ++ [(0, z)] + have hdu : ds u = r ++ [(.D 0, z)] := by + dsimp only [u] + rw [ds_app, ds_to_digits r hr] + rfl + have hin : plug r (tail_denote (some z)) = plug (ds u) (plug p.ri default) := by + rw [hdu, List.isEmpty_iff.mp hri, plug_app] + rfl + have hout : plug r (tail_denote (some (z + h2))) = plug (ds u) (plug p.ro default) := by + rw [hdu, hro, plug_app] + dsimp only [plug, tail_denote, SymWord.toList] + rw [pow_append_pow] + rw [hin, hout] + have hkd1 : p.keep_d = 1 := Nat.eq_of_beq_eq_true hkd + exact hv u (Runs.denote l') default + (by intro hc; rw [hkd1] at hc; contradiction) + (by intro h; rw [h] at hzl; contradiction) + (fun _ => rfl) + +def step_right_d_step (m : Nat) (l r : Runs) (mode : Mode) (z : Nat) : Option FastConfig := + if Mode.beq mode .MR then + match Runs.move_right_sym m l r with + | some (l', r') => some ⟨l', r', .MR, some z⟩ + | none => none + else none + +theorem step_right_d_step_spec (m : Nat) (l r : Runs) (mode : Mode) (z : Nat) (fc' : FastConfig) + (hr : is_all_d r = true) (h : step_right_d_step m l r mode z = some fc') : + ReachesStar target_tm (flush_fc ⟨l, r, mode, some z⟩).denote (flush_fc fc').denote ∧ fc'.WF := + by + dsimp only [step_right_d_step] at h + split_ifs at h with hm + cases hmr : Runs.move_right_sym m l r <;> rw [hmr] at h; · contradiction + rename_i lr'; rcases lr' with ⟨l', r'⟩ + injection h with h; subst h + refine ⟨?_, is_all_d_move_right m l r l' r' hr hmr⟩ + rw [flush_fc_denote, flush_fc_denote, Mode.beq_eq mode .MR hm] + exact move_right_sym_plug m l r l' r' (tail_denote (some z)) hmr + +def step_right_sym_fast (m : Nat) (fc : FastConfig) : Option FastConfig := + match fc.d_tail with + | none => + match enter_mode .MR fc.left fc.right fc.mode with + | some (ls, rs) => + match Runs.move_right_sym m ls rs with + | some (l', r') => some ⟨l', r', .MR, none⟩ + | none => none + | none => none + | some z => + match step_right_d_step m fc.left fc.right fc.mode z with + | some fc' => some fc' + | none => + if Nat.beq z 0 then none + else step_right_d_step m fc.left (append_d0 z fc.right) fc.mode 0 + +theorem step_right_sym_fast_spec (m : Nat) (fc fc' : FastConfig) + (hwf : fc.WF) (h : step_right_sym_fast m fc = some fc') : + ReachesStar target_tm (flush_fc fc).denote (flush_fc fc').denote ∧ fc'.WF := by + rcases fc with ⟨l, r, mode, dt⟩ + cases dt with + | none => + dsimp only [step_right_sym_fast] at h + cases hem : enter_mode .MR l r mode <;> rw [hem] at h; · contradiction + rename_i lrs; rcases lrs with ⟨ls, rs⟩ + dsimp only at h + cases hmr : Runs.move_right_sym m ls rs <;> rw [hmr] at h; · contradiction + rename_i lr'; rcases lr' with ⟨l', r'⟩ + injection h with h; subst h + refine ⟨?_, trivial⟩ + rw [enter_mode_spec .MR l r mode ls rs hem, flush_fc_denote] + dsimp only [Mode.hat, tail_denote] + rw [denote_eq_plug_default rs] + exact move_right_sym_plug m ls rs l' r' default hmr + | some z => + dsimp only [step_right_sym_fast] at h + dsimp only [FastConfig.WF] at hwf + cases hstep : step_right_d_step m l r mode z <;> rw [hstep] at h + · dsimp only at h + split_ifs at h with hz0 + rw [← flush_append_d0_eq l r mode z] + exact step_right_d_step_spec m l (append_d0 z r) mode 0 fc' (is_all_d_append_d0 z r hwf) h + · injection h with h; subst fc' + exact step_right_d_step_spec m l r mode z _ hwf hstep + +def step_left_sym_fast (m : Nat) (fc : FastConfig) : Option FastConfig := + match fc.d_tail with + | none => + match enter_mode .ML fc.left fc.right fc.mode with + | some (ls, rs) => + match Runs.move_left_sym m ls rs with + | some (l', r') => some ⟨l', r', .ML, none⟩ + | none => none + | none => none + | some z => + if Mode.beq fc.mode .ML then + match Runs.move_left_sym m fc.left fc.right with + | some (l', r') => some ⟨l', r', .ML, some z⟩ + | none => none + else none + +theorem step_left_sym_fast_spec (m : Nat) (fc fc' : FastConfig) + (hwf : fc.WF) (h : step_left_sym_fast m fc = some fc') : + ReachesStar target_tm (flush_fc fc).denote (flush_fc fc').denote ∧ fc'.WF := by + rcases fc with ⟨l, r, mode, dt⟩ + cases dt with + | none => + dsimp only [step_left_sym_fast] at h + cases hem : enter_mode .ML l r mode <;> rw [hem] at h; · contradiction + rename_i lrs; rcases lrs with ⟨ls, rs⟩ + dsimp only at h + cases hml : Runs.move_left_sym m ls rs <;> rw [hml] at h; · contradiction + rename_i lr'; rcases lr' with ⟨l', r'⟩ + injection h with h; subst h + refine ⟨?_, trivial⟩ + rw [enter_mode_spec .ML l r mode ls rs hem, flush_fc_denote] + dsimp only [Mode.hat, tail_denote] + rw [denote_eq_plug_default rs] + exact move_left_sym_plug m ls rs l' r' default hml + | some z => + dsimp only [step_left_sym_fast] at h + dsimp only [FastConfig.WF] at hwf + split_ifs at h with hm + cases hml : Runs.move_left_sym m l r <;> rw [hml] at h; · contradiction + rename_i lr'; rcases lr' with ⟨l', r'⟩ + injection h with h; subst h + refine ⟨?_, is_all_d_move_left m l r l' r' hwf hml⟩ + rw [flush_fc_denote, flush_fc_denote, Mode.beq_eq mode .ML hm] + exact move_left_sym_plug m l r l' r' (tail_denote (some z)) hml + +def step_left_raw_sym_fast (n0 m : Nat) (fc : FastConfig) : Option FastConfig := + match fc.d_tail with + | none => + match enter_mode .ML fc.left fc.right fc.mode with + | some (ls, rs) => + match Runs.remove_sym_one (.S n0) ls with + | some l1 => + match Runs.move_left_sym m l1 (Runs.push (.D n0) 1 rs) with + | some (l', r') => some ⟨l', r', .ML, none⟩ + | none => none + | none => none + | none => none + | some z => + if Mode.beq fc.mode .ML then + match Runs.remove_sym_one (.S n0) fc.left with + | some l1 => + match Runs.move_left_sym m l1 (Runs.push (.D n0) 1 fc.right) with + | some (l', r') => some ⟨l', r', .ML, some z⟩ + | none => none + | none => none + else none + +theorem step_left_raw_sym_fast_spec (n0 m : Nat) (fc fc' : FastConfig) + (hwf : fc.WF) (h : step_left_raw_sym_fast n0 m fc = some fc') : + ReachesStar target_tm (flush_fc fc).denote (flush_fc fc').denote ∧ fc'.WF := by + rcases fc with ⟨l, r, mode, dt⟩ + cases dt with + | none => + dsimp only [step_left_raw_sym_fast] at h + cases hem : enter_mode .ML l r mode <;> rw [hem] at h; · contradiction + rename_i lrs; rcases lrs with ⟨ls, rs⟩ + dsimp only at h + cases hro : Runs.remove_sym_one (.S n0) ls <;> rw [hro] at h; · contradiction + rename_i l1 + dsimp only at h + cases hml : Runs.move_left_sym m l1 (Runs.push (.D n0) 1 rs) <;> rw [hml] at h; · contradiction + rename_i lr'; rcases lr' with ⟨l', r'⟩ + injection h with h; subst h + refine ⟨?_, trivial⟩ + rw [enter_mode_spec .ML l r mode ls rs hem, flush_fc_denote, + Runs.remove_sym_one_spec (.S n0) ls l1 hro] + dsimp only [Mode.hat, tail_denote, SymWord.toList] + rw [denote_eq_plug_default rs] + have h1 : ReachesStar target_tm (CfgL (S_word n0 +> Runs.denote l1) (plug rs default)) + (CfgL (Runs.denote l1) (plug (Runs.push (.D n0) 1 rs) default)) := by + rw [push_plug] + simpa [SymWord.toList, pow_succ_list, pow_zero_list, List.append_nil] using + rules.rule_left (Runs.denote l1) (plug rs default) n0 + exact h1.trans (move_left_sym_plug m l1 (Runs.push (.D n0) 1 rs) l' r' default hml) + | some z => + dsimp only [step_left_raw_sym_fast] at h + dsimp only [FastConfig.WF] at hwf + split_ifs at h with hm + cases hro : Runs.remove_sym_one (.S n0) l <;> rw [hro] at h; · contradiction + rename_i l1 + dsimp only at h + cases hml : Runs.move_left_sym m l1 (Runs.push (.D n0) 1 r) <;> rw [hml] at h; · contradiction + rename_i lr'; rcases lr' with ⟨l', r'⟩ + injection h with h; subst h + refine ⟨?_, + is_all_d_move_left m l1 (Runs.push (.D n0) 1 r) l' r' (is_all_d_push n0 1 r hwf) hml⟩ + rw [flush_fc_denote, flush_fc_denote, Mode.beq_eq mode .ML hm, + Runs.remove_sym_one_spec (.S n0) l l1 hro] + dsimp only [Mode.hat, SymWord.toList] + have h1 : ReachesStar target_tm (CfgL (S_word n0 +> + Runs.denote l1) (plug r (tail_denote (some z)))) + (CfgL (Runs.denote l1) (plug (Runs.push (.D n0) 1 r) (tail_denote (some z)))) := by + rw [push_plug] + simpa [SymWord.toList, pow_succ_list, pow_zero_list, List.append_nil] using + rules.rule_left (Runs.denote l1) (plug r (tail_denote (some z))) n0 + exact h1.trans (move_left_sym_plug m l1 (Runs.push (.D n0) 1 r) l' r' (tail_denote (some z)) + hml) + +def is_pres_d_inst : Instruction → Bool + | .inl (.Restart _) | .inl (.CollisionD _) | .inl (.LeftJ _) | .inl (.TurnB _) | .inl (.TurnJ _) + => true + | .inr (.LeftList _) => true + | _ => false + +def to_tblank1_inst : Instruction → Option Instruction + | .inr (.Call (.TBlank _ [])) => some (.inr (.Call (.TBlank 1 []))) + | .inr (.Loops fromR k b (.TBlank _ [])) => some (.inr (.Loops fromR k b (.TBlank 1 []))) + | .inr (.LoopsJ k b (.TBlank _ [])) => some (.inr (.LoopsJ k b (.TBlank 1 []))) + | .inr (.Returns fromJ n k (.TBlank _ [])) => some (.inr (.Returns fromJ n k (.TBlank 1 []))) + | _ => none + +def is_tblank_inst : Instruction → Bool + | .inr (.Call (.TBlank _ _)) => true + | .inr (.Loops _ _ _ (.TBlank _ _)) => true + | .inr (.LoopsJ _ _ (.TBlank _ _)) => true + | .inr (.Returns _ _ _ (.TBlank _ _)) => true + | _ => false + +def exec_inst_fast (i : Instruction) (fc : FastConfig) : Option FastConfig := + if is_pres_d_inst i then + use_pres_all_d (recipe_of i) fc + else + match fc.d_tail, to_tblank1_inst i with + | some z, some i1 => + match exec_tblank1_step (recipe_of i1) fc.left fc.right fc.mode z with + | some fc' => some fc' + | none => use_fast_none (recipe_of i) (is_tblank_inst i) fc + | _, _ => + use_fast_none (recipe_of i) (is_tblank_inst i) fc + +theorem exec_inst_fast_spec (i : Instruction) (fc fc' : FastConfig) + (hwf : fc.WF) (h : exec_inst_fast i fc = some fc') : + ReachesStar target_tm (flush_fc fc).denote (flush_fc fc').denote ∧ fc'.WF := by + rcases fc with ⟨l, r, mode, dt⟩ + dsimp only [exec_inst_fast] at h + have hcert := certified (target_tm := target_tm) i + split_ifs at h with hpres + · exact use_pres_all_d_spec (recipe_of i) ⟨l, r, mode, dt⟩ fc' hwf hcert h + · cases dt with + | none => + exact use_fast_none_spec (recipe_of i) (is_tblank_inst i) ⟨l, r, mode, none⟩ fc' hcert h + | some z => + cases ht1 : to_tblank1_inst i <;> rw [ht1] at h + · exact use_fast_none_spec (recipe_of i) (is_tblank_inst i) ⟨l, r, mode, some z⟩ fc' hcert h + · rename_i i1 + dsimp only at h + cases hex : exec_tblank1_step (recipe_of i1) l r mode z <;> rw [hex] at h + · exact use_fast_none_spec (recipe_of i) (is_tblank_inst i) ⟨l, r, mode, some z⟩ fc' hcert h + · injection h with h; subst fc' + have hcert1 := certified (target_tm := target_tm) i1 + exact exec_tblank1_step_spec (recipe_of i1) l r mode z _ hwf hcert1 hex + +def mask6 : Nat := 63 +def mask10 : Nat := 1023 +def mask40 : Nat := 1099511627775 + +def pop40 {α : Type} (w : Nat) (k : Nat → Nat → α) : α := + withNat (Nat.land w mask40) fun x => + withNat (Nat.shiftRight w 40) fun w' => + k x w' + +def decode_digits : Nat → Nat → Digits + | 0, _ => [] + | len + 1, w => + pop40 w fun n w1 => + pop40 w1 fun m w2 => + (n, m) :: decode_digits len w2 + +def decode_tail (w : Nat) : Tail := + pop40 w fun tag w1 => + pop40 w1 fun m w2 => + if Nat.beq tag 0 then + pop40 w2 fun len w3 => + .TBlank m (decode_digits len w3) + else if Nat.beq tag 1 then + pop40 w2 fun j w3 => + pop40 w3 fun len w4 => + .TCollision m (decode_digits len w4) j + else if Nat.beq tag 2 then + pop40 w2 fun j w3 => + pop40 w3 fun d w4 => + pop40 w4 fun len w5 => + .TDefect0 m (decode_digits len w5) j d + else + pop40 w2 fun d w3 => + pop40 w3 fun len w4 => + .TDefect1 m (decode_digits len w4) d + +def decode_inst (tag : Nat) (w1 : Nat) : Instruction := + if Nat.ble tag 16 then + if Nat.ble tag 8 then + if Nat.beq tag 2 then .inl (.ScanR w1) + else if Nat.beq tag 3 then .inl (.ScanB w1) + else if Nat.beq tag 4 then .inl (.ScanC w1) + else if Nat.beq tag 5 then .inl (.ScanPair w1) + else if Nat.beq tag 6 then .inl (.Ones w1) + else if Nat.beq tag 7 then .inl .Blank + else .inl (.Even w1) + else + if Nat.beq tag 9 then .inl (.Restart w1) + else if Nat.beq tag 10 then .inl (.Over2 w1) + else if Nat.beq tag 11 then + pop40 w1 fun a b => .inl (.Over1 a b) + else if Nat.beq tag 12 then .inl .Collision + else if Nat.beq tag 13 then .inl (.CollisionD w1) + else if Nat.beq tag 14 then .inl (.LeftJ w1) + else if Nat.beq tag 15 then .inl (.TurnB w1) + else .inl (.TurnJ w1) + else + if Nat.ble tag 25 then + if Nat.beq tag 17 then .inl (.Defect0 w1) + else if Nat.beq tag 18 then .inl (.Defect1 w1) + else if Nat.beq tag 19 then + pop40 w1 fun a b => .inl (.Defect2 a b) + else if Nat.beq tag 20 then .inl (.Defect0D w1) + else if Nat.beq tag 21 then .inl (.Defect1D w1) + else if Nat.beq tag 22 then + pop40 w1 fun a b => .inl (.Defect2D a b) + else if Nat.beq tag 23 then .inl .DefectBlank0 + else if Nat.beq tag 24 then .inl (.DefectBlankS w1) + else + pop40 w1 fun a b => .inl (.Paired a b) + else + if Nat.beq tag 26 then + pop40 w1 fun a b => .inr (.Pairs a b) + else if Nat.beq tag 27 then + pop40 w1 fun len w2 => .inr (.RightList (decode_digits len w2)) + else if Nat.beq tag 28 then + pop40 w1 fun len w2 => .inr (.LeftList (decode_digits len w2)) + else if Nat.beq tag 29 then + .inr (.Call (decode_tail w1)) + else if Nat.beq tag 30 then + pop40 w1 fun a w2 => + pop40 w2 fun k w3 => + pop40 w3 fun b w4 => + .inr (.Loops (Nat.beq a 1) k b (decode_tail w4)) + else if Nat.beq tag 31 then + pop40 w1 fun a w2 => + pop40 w2 fun b w3 => + .inr (.LoopsJ a b (decode_tail w3)) + else + pop40 w1 fun a w2 => + pop40 w2 fun n w3 => + pop40 w3 fun k w4 => + .inr (.Returns (Nat.beq a 1) n k (decode_tail w4)) + +def exec_macro_fast (tag : Nat) (w1 : Nat) (fc : FastConfig) : Option FastConfig := + if Nat.beq tag 33 then + step_right_sym_fast w1 fc + else if Nat.beq tag 34 then + step_left_sym_fast w1 fc + else if Nat.beq tag 35 then + pop40 w1 fun n0 m => + step_left_raw_sym_fast n0 m fc + else + exec_inst_fast (decode_inst tag w1) fc + +theorem exec_macro_fast_spec (tag : Nat) (w1 : Nat) (fc fc' : FastConfig) + (hwf : fc.WF) (h : exec_macro_fast tag w1 fc = some fc') : + ReachesStar target_tm (flush_fc fc).denote (flush_fc fc').denote ∧ fc'.WF := by + dsimp only [exec_macro_fast, pop40, withNat] at h + split_ifs at h with h33 h34 h35 + · exact step_right_sym_fast_spec w1 fc fc' hwf h + · exact step_left_sym_fast_spec w1 fc fc' hwf h + · exact step_left_raw_sym_fast_spec _ _ fc fc' hwf h + · exact exec_inst_fast_spec (decode_inst tag w1) fc fc' hwf h + + +def run_word_fast_base (target_tm : Machine (Fin 2) (Fin 6)) (w : Nat) (fc : FastConfig) : + Sum FastConfig Bool := + withNat (Nat.land w mask6) fun tag => + withNat (Nat.land (Nat.shiftRight w 6) mask10) fun r => + withNat (Nat.shiftRight w 16) fun w1 => + if Nat.beq tag 1 then + match raw_steps target_tm r (flush_fc fc) with + | .inl c' => + match of_rm c' with + | some fc' => .inl fc' + | none => .inr false + | .inr b => .inr b + else if Nat.beq r 0 then + match exec_macro_fast tag w1 fc with + | some fc' => .inl fc' + | none => .inr false + else + match raw_steps target_tm r (flush_fc fc) with + | .inl c1 => + match of_rm c1 with + | some fc1 => + match exec_macro_fast tag w1 fc1 with + | some fc' => .inl fc' + | none => .inr false + | none => .inr false + | .inr b => .inr b + +def run_word_fast (target_tm : Machine (Fin 2) (Fin 6)) (oldW newW w : Nat) (fc : FastConfig) : + Sum FastConfig Bool := + run_word_fast_base target_tm (if Nat.beq w oldW then newW else w) fc + +theorem run_word_fast_base_spec (w : Nat) (fc : FastConfig) (hwf : fc.WF) : + match run_word_fast_base target_tm w fc with + | .inl fc' => ReachesStar target_tm (flush_fc fc).denote (flush_fc fc').denote ∧ fc'.WF + | .inr b => b = true → HaltsFrom target_tm (flush_fc fc).denote := by + dsimp only [run_word_fast_base, withNat] + split_ifs with htag1 hr0 + · have hrs := raw_steps_spec (target_tm := target_tm) + (Nat.land (Nat.shiftRight w 6) mask10) (flush_fc fc) + cases hraw : raw_steps target_tm (Nat.land (Nat.shiftRight w 6) mask10) (flush_fc fc) <;> + rw [hraw] at hrs + · rename_i c' + dsimp only at hrs ⊢ + cases hof : of_rm c' + · intro hc; contradiction + · rename_i fc' + rcases of_rm_spec c' fc' hof with ⟨hden, hwf'⟩ + rw [← hden] at hrs + exact ⟨hrs, hwf'⟩ + · exact hrs + · cases hex : exec_macro_fast (Nat.land w mask6) (Nat.shiftRight w 16) fc + · intro hc; contradiction + · rename_i fc' + exact exec_macro_fast_spec _ _ fc fc' hwf hex + · have hrs := raw_steps_spec (target_tm := target_tm) + (Nat.land (Nat.shiftRight w 6) mask10) (flush_fc fc) + cases hraw : raw_steps target_tm (Nat.land (Nat.shiftRight w 6) mask10) (flush_fc fc) <;> + rw [hraw] at hrs + · rename_i c1 + dsimp only at hrs ⊢ + cases hof : of_rm c1 + · intro hc; contradiction + · rename_i fc1 + rcases of_rm_spec c1 fc1 hof with ⟨hden1, hwf1⟩ + dsimp only + cases hex : exec_macro_fast (Nat.land w mask6) (Nat.shiftRight w 16) fc1 + · intro hc; contradiction + · rename_i fc' + rcases exec_macro_fast_spec (target_tm := target_tm) _ _ fc1 fc' hwf1 hex with + ⟨hstep, hwf'⟩ + rw [hden1] at hstep + exact ⟨hrs.trans hstep, hwf'⟩ + · exact hrs + +theorem run_word_fast_spec (oldW newW w : Nat) (fc : FastConfig) (hwf : fc.WF) : + match run_word_fast target_tm oldW newW w fc with + | .inl fc' => ReachesStar target_tm (flush_fc fc).denote (flush_fc fc').denote ∧ fc'.WF + | .inr b => b = true → HaltsFrom target_tm (flush_fc fc).denote := + run_word_fast_base_spec (if Nat.beq w oldW then newW else w) fc hwf + +def seq_word (target_tm : Machine (Fin 2) (Fin 6)) (oldW newW w : Nat) : + Sum FastConfig Bool → Sum FastConfig Bool + | .inl fc => run_word_fast target_tm oldW newW w fc + | .inr b => .inr b + +theorem seq_word_spec (oldW newW w : Nat) (fc0 : FastConfig) (res : Sum FastConfig Bool) + (h : match res with + | .inl fc => ReachesStar target_tm (flush_fc fc0).denote (flush_fc fc).denote ∧ fc.WF + | .inr b => b = true → HaltsFrom target_tm (flush_fc fc0).denote) : + match seq_word target_tm oldW newW w res with + | .inl fc' => ReachesStar target_tm (flush_fc fc0).denote (flush_fc fc').denote ∧ fc'.WF + | .inr b => b = true → HaltsFrom target_tm (flush_fc fc0).denote := by + cases res with + | inr b => + exact h + | inl fc => + dsimp only [seq_word] + have hw := run_word_fast_spec (target_tm := target_tm) oldW newW w fc h.2 + cases hr : run_word_fast target_tm oldW newW w fc <;> rw [hr] at hw + · exact ⟨h.1.trans hw.1, hw.2⟩ + · intro hb + exact HaltsFrom.of_reachesStar h.1 (hw hb) + +def run_tree (target_tm : Machine (Fin 2) (Fin 6)) (oldW newW : Nat) : + CertTree → FastConfig → Sum FastConfig Bool + | .nil, c => .inl c + | .leaf w, c => run_word_fast target_tm oldW newW w c + | .leaf8 w1 w2 w3 w4 w5 w6 w7 w8, c => + seq_word target_tm oldW newW w8 + (seq_word target_tm oldW newW w7 + (seq_word target_tm oldW newW w6 + (seq_word target_tm oldW newW w5 + (seq_word target_tm oldW newW w4 + (seq_word target_tm oldW newW w3 + (seq_word target_tm oldW newW w2 + (run_word_fast target_tm oldW newW w1 c))))))) + | .bin t1 t2, c => + match run_tree target_tm oldW newW t1 c with + | .inl c' => run_tree target_tm oldW newW t2 c' + | .inr b => .inr b + +theorem run_tree_spec (oldW newW : Nat) (t : CertTree) (fc : FastConfig) (hwf : fc.WF) : + match run_tree target_tm oldW newW t fc with + | .inl fc' => ReachesStar target_tm (flush_fc fc).denote (flush_fc fc').denote ∧ fc'.WF + | .inr b => b = true → HaltsFrom target_tm (flush_fc fc).denote := by + induction t generalizing fc with + | nil => + exact ⟨ReachesStar.refl _ _, hwf⟩ + | leaf w => + exact run_word_fast_spec oldW newW w fc hwf + | leaf8 w1 w2 w3 w4 w5 w6 w7 w8 => + dsimp only [run_tree] + apply seq_word_spec; apply seq_word_spec; apply seq_word_spec; apply seq_word_spec + apply seq_word_spec; apply seq_word_spec; apply seq_word_spec + exact run_word_fast_spec oldW newW w1 fc hwf + | bin t1 t2 ih1 ih2 => + dsimp only [run_tree] + have h1 := ih1 fc hwf + cases hr1 : run_tree target_tm oldW newW t1 fc <;> rw [hr1] at h1 + · rename_i fc1 + dsimp only + have h2 := ih2 fc1 h1.2 + cases hr2 : run_tree target_tm oldW newW t2 fc1 <;> rw [hr2] at h2 + · exact ⟨h1.1.trans h2.1, h2.2⟩ + · intro hb + exact HaltsFrom.of_reachesStar h1.1 (h2 hb) + · exact h1 + +theorem chain_tree (target_tm : Machine (Fin 2) (Fin 6)) [HasCertRules target_tm] + (oldW newW : Nat) {t : CertTree} {fc fc' : FastConfig} + (hwf : fc.WF) (h : run_tree target_tm oldW newW t fc = .inl fc') + (hrest : fc'.WF → HaltsFrom target_tm (flush_fc fc').denote) : + HaltsFrom target_tm (flush_fc fc).denote := by + have hs := run_tree_spec (target_tm := target_tm) oldW newW t fc hwf + rw [h] at hs + exact HaltsFrom.of_reachesStar hs.1 (hrest hs.2) + +theorem done_tree (target_tm : Machine (Fin 2) (Fin 6)) [HasCertRules target_tm] + (oldW newW : Nat) {t : CertTree} {fc : FastConfig} + (hwf : fc.WF) (h : run_tree target_tm oldW newW t fc = .inr true) : + HaltsFrom target_tm (flush_fc fc).denote := by + have hs := run_tree_spec (target_tm := target_tm) oldW newW t fc hwf + rw [h] at hs + exact hs rfl + +end Engine + +def cert_tm : Bool → Machine (Fin 2) (Fin 6) + | false, 0, 0 => some (some 1, Stmt.write 1 Dir.right) + | false, 0, 1 => some (some 0, Stmt.write 1 Dir.right) + | false, 1, 0 => some (some 2, Stmt.write 1 Dir.left) + | false, 1, 1 => some (some 3, Stmt.write 0 Dir.right) + | false, 2, 0 => some (some 3, Stmt.write 1 Dir.left) + | false, 2, 1 => some (some 1, Stmt.write 1 Dir.left) + | false, 3, 0 => some (some 0, Stmt.write 1 Dir.right) + | false, 3, 1 => some (some 4, Stmt.write 0 Dir.left) + | false, 4, 0 => some (some 1, Stmt.write 0 Dir.left) + | false, 4, 1 => some (some 5, Stmt.write 1 Dir.left) + | false, 5, 0 => some (some 2, Stmt.write 1 Dir.right) + | false, 5, 1 => none + | true, 0, 0 => some (some 1, Stmt.write 1 Dir.right) + | true, 0, 1 => some (some 0, Stmt.write 1 Dir.right) + | true, 1, 0 => some (some 2, Stmt.write 1 Dir.left) + | true, 1, 1 => some (some 4, Stmt.write 0 Dir.right) + | true, 2, 0 => some (some 3, Stmt.write 1 Dir.left) + | true, 2, 1 => some (some 1, Stmt.write 1 Dir.left) + | true, 3, 0 => some (some 0, Stmt.write 1 Dir.right) + | true, 3, 1 => some (some 4, Stmt.write 0 Dir.left) + | true, 4, 0 => some (some 0, Stmt.write 1 Dir.right) + | true, 4, 1 => some (some 5, Stmt.write 0 Dir.left) + | true, 5, 0 => some (some 1, Stmt.write 0 Dir.left) + | true, 5, 1 => none + +section CertTmRules + +variable (var : Bool) + +theorem scanR (l r : ListBlank (Fin 2)) (n : Nat) : + ReachesStar (cert_tm var) + ⟨some A, ⟨0, l, (1 : Fin 2) >> ((([1, 1] : List (Fin 2)) ^ n) +> r)⟩⟩ + ⟨some A, ⟨0, (([1, 0] : List (Fin 2)) ^ n) +> l, (1 : Fin 2) >> r⟩⟩ := by + induction n generalizing l with + | zero => norm_cb; bb_refl + | succ n ih => + cases var <;> ( + nsteps 6 + refine (ih ((1 : Fin 2) >> (0 : Fin 2) >> l)).trans ?_ + norm_cb; bb_refl) + +theorem scanR1 (l r : ListBlank (Fin 2)) (n : Nat) : + ReachesStar (cert_tm var) + ⟨some A, ⟨0, l, (1 : Fin 2) >> (1 : Fin 2) >> ((([1, 1] : List (Fin 2)) ^ n) +> r)⟩⟩ + ⟨some A, ⟨0, (([1, 0] : List (Fin 2)) ^ n) +> l, (1 : Fin 2) >> (1 : Fin 2) >> r⟩⟩ := by + rw [← rot_11 n r] + exact scanR var l ((1 : Fin 2) >> r) n + +theorem scanB (l r : ListBlank (Fin 2)) (n : Nat) : + ReachesStar (cert_tm var) + (Cfg.headLeft B ((([0, 1] : List (Fin 2)) ^ n) +> l) r) + (Cfg.headLeft B l ((([1, 1] : List (Fin 2)) ^ n) +> r)) := by + induction n generalizing r with + | zero => norm_cb; bb_refl + | succ n ih => + cases var <;> ( + nsteps 2 + refine (ih ([1, 1] +> r)).trans ?_ + norm_cb; bb_refl) + +theorem scanC (l r : ListBlank (Fin 2)) (n : Nat) : + ReachesStar (cert_tm var) + (Cfg.headLeft C ((([1, 0] : List (Fin 2)) ^ n) +> l) r) + (Cfg.headLeft C l ((([1, 1] : List (Fin 2)) ^ n) +> r)) := by + induction n generalizing r with + | zero => norm_cb; bb_refl + | succ n ih => + cases var <;> ( + nsteps 2 + refine (ih ([1, 1] +> r)).trans ?_ + norm_cb; bb_refl) + +theorem scanPair (l r : ListBlank (Fin 2)) (n : Nat) : + ReachesStar (cert_tm var) + ⟨some A, ⟨0, l, (1 : Fin 2) >> ((([0, 1, 0, 1] : List (Fin 2)) ^ n) +> r)⟩⟩ + ⟨some A, ⟨0, (([1, 1, 0, 1] : List (Fin 2)) ^ n) +> l, (1 : Fin 2) >> r⟩⟩ := by + induction n generalizing l with + | zero => norm_cb; bb_refl + | succ n ih => + cases var <;> ( + nsteps 4 + refine (ih ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> l)).trans ?_ + norm_cb; bb_refl) + +theorem ones (l r : ListBlank (Fin 2)) (n : Nat) : + ReachesStar (cert_tm var) + (Cfg.headRight A l ((([1] : List (Fin 2)) ^ n) +> r)) + (Cfg.headRight A ((([1] : List (Fin 2)) ^ n) +> l) r) := by + induction n generalizing l with + | zero => norm_cb; bb_refl + | succ n ih => + cases var <;> ( + nsteps 1 + refine (ih ([1] +> l)).trans ?_ + norm_cb; bb_refl) + +theorem ones2 (l r : ListBlank (Fin 2)) (n : Nat) : + ReachesStar (cert_tm var) + (Cfg.headRight A l ((([1, 1] : List (Fin 2)) ^ n) +> r)) + (Cfg.headRight A ((([1, 1] : List (Fin 2)) ^ n) +> l) r) := by + rw [one_pow_two_mul] + exact ones var l r (2 * n) + +theorem rule_right (l r : ListBlank (Fin 2)) (n : Nat) : + ReachesStar (cert_tm var) (CfgR l (D_word n +> r)) (CfgR (S_word n +> l) r) := by + cases var <;> (nsteps 3; follow (scanR _ _ _ n); bb_refl) + +theorem rule_left (l r : ListBlank (Fin 2)) (n : Nat) : + ReachesStar (cert_tm var) (CfgL (S_word n +> l) r) (CfgL l (D_word n +> r)) := by + cases var <;> (nsteps 5; follow (scanB _ _ _ n); bb_refl) + +theorem rule_blank (l r : ListBlank (Fin 2)) : + ReachesStar (cert_tm var) (CfgR l ([0, 0, 0] +> r)) (CfgL l (D_word 0 +> (D_word 0 +> r))) := by + cases var <;> fsteps + +theorem rule_even (l r : ListBlank (Fin 2)) (n : Nat) : + ReachesStar (cert_tm var) + (CfgR l ((([1, 1] : List (Fin 2)) ^ (1 + n)) +> ([0, 0] +> r))) + (CfgL l (D_word (1 + n) +> ([1, 0] +> r))) := by + cases var <;> (nsteps 3; follow (scanR1 _ _ _ n); nsteps 16; follow (scanB _ _ _ n); bb_refl) + +theorem rule_restart (l r : ListBlank (Fin 2)) (b : Nat) : + ReachesStar (cert_tm var) + (CfgL ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> ([1, 1, 1] +> l)) r) + (CfgR ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> l) r) := by + have h : ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> ([1, 1, 1] +> l)) = + S_word b +> ([1, 1] +> l) := by + norm_cb + rw [h] + refine (rule_left var ([1, 1] +> l) r b).trans ?_ + cases var <;> (nsteps 5; follow (scanR _ _ _ b); bb_refl) + +theorem rule_overflow2 (r : ListBlank (Fin 2)) (b : Nat) : + ReachesStar (cert_tm var) + (CfgL ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> ([1, 1] +> default)) r) + (CfgR ((([1, 0] : List (Fin 2)) ^ 2) +> ((([1, 1] : List (Fin 2)) ^ (1 + + b)) +> default)) ([1] +> r)) := by + cases var <;> ( + nsteps 5; follow (scanB _ _ _ b); nsteps 16; follow (scanR1 _ _ _ b) + nsteps 16; follow (scanB _ _ _ b); nsteps 9; follow (ones2 _ _ _ b); fsteps) + +theorem rule_overflow1 (r : ListBlank (Fin 2)) (b n : Nat) : + ReachesStar (cert_tm var) + (CfgL ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> ([1] +> default)) (D_word n +> r)) + (CfgR ((([1, 0] : List (Fin 2)) ^ (n + + 2)) +> ((([1, 1] : List (Fin 2)) ^ b) +> default)) ([1, 0] +> r)) := by + cases var <;> ( + nsteps 5; follow (scanB _ _ _ b); nsteps 7; follow (ones2 _ _ _ b) + nsteps 8; follow (scanR1 _ _ _ n); nsteps 16; follow (scanB _ _ _ n) + nsteps 11; follow (scanR _ _ _ n); bb_refl) + +theorem rule_collision (l r : ListBlank (Fin 2)) : + ReachesStar (cert_tm var) + (CfgL ([0, 0, 1, 1, 0, 1] +> l) r) + (CfgJ l ([1, 1, 1, 1] +> r)) := by + cases var <;> fsteps + +theorem rule_leftJ (l r : ListBlank (Fin 2)) (n : Nat) : + ReachesStar (cert_tm var) + (CfgJ (S_word n +> l) r) + (CfgL l (D_word (1 + n) +> r)) := by + cases var <;> (nsteps 3; follow (scanB _ _ _ n); bb_refl) + +theorem rule_turnB (l r : ListBlank (Fin 2)) (n : Nat) : + ReachesStar (cert_tm var) + (CfgL ([1, 1] +> l) (D_word n +> r)) + (CfgR ((([1, 0] : List (Fin 2)) ^ (1 + n)) +> l) r) := by + cases var <;> (nsteps 5; follow (scanR _ _ _ n); bb_refl) + +theorem rule_turnJ (l r : ListBlank (Fin 2)) (b : Nat) : + ReachesStar (cert_tm var) + (CfgJ ((([1, 0] : List (Fin 2)) ^ b) +> ([1, 1, 1] +> l)) r) + (CfgR ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> l) r) := by + cases var <;> (nsteps 1; follow (scanB _ _ _ b); nsteps 5; follow (scanR _ _ _ b); bb_refl) + +theorem rule_finishP (l r : ListBlank (Fin 2)) (b : Nat) : + ReachesStar (cert_tm var) + (CfgL ((([1, 0] : List (Fin 2)) ^ (1 + b)) +> ([0, 1] +> (S_word 0 +> l))) r) + (CfgJ l (D_word (1 + b) +> r)) := by + cases var <;> (nsteps 4; follow (scanC _ _ _ b); fsteps) + +theorem rule_defect0 (l r : ListBlank (Fin 2)) (m : Nat) : + ReachesStar (cert_tm var) + (CfgR l ([1, 0] +> (D_word 0 +> ([1] +> ((([1, 1] : List (Fin 2)) ^ m) +> ([0] +> r)))))) + (CfgJ l ([1, 1, 1, 1] +> (D_word m +> ([1] +> r)))) := by + cases var <;> (nsteps 15; follow (scanR1 _ _ _ m); nsteps 15; follow (scanC _ _ _ m); fsteps) + +theorem rule_defect1 (l r : ListBlank (Fin 2)) (m : Nat) : + ReachesStar (cert_tm var) + (CfgR l ([1, 0] +> (D_word 1 +> ([1] +> ((([1, 1] : List (Fin 2)) ^ m) +> ([0] +> r)))))) + (CfgL l (D_word 0 +> (D_word 0 +> (D_word (1 + m) +> ([1] +> r))))) := by + cases var <;> (nsteps 17; follow (scanR1 _ _ _ m); nsteps 16; follow (scanB _ _ _ m); fsteps) + +theorem rule_defect2 (l r : ListBlank (Fin 2)) (n m : Nat) : + ReachesStar (cert_tm var) + (CfgR l ([1, 0] +> (D_word (2 + + n) +> ([1] +> ((([1, 1] : List (Fin 2)) ^ m) +> ([0] +> r)))))) + (CfgR ((([1, 0] : List (Fin 2)) ^ (2 + + m)) +> ((([1, 1] : List (Fin 2)) ^ n) +> (S_word 0 +> (S_word 0 +> l)))) ([1] +> r)) := by + cases var <;> ( + nsteps 11; follow (ones2 _ _ _ n); nsteps 8; follow (scanR1 _ _ _ m) + nsteps 16; follow (scanB _ _ _ m); nsteps 11; follow (scanR _ _ _ m); bb_refl) + +theorem rule_defect_blank0 (l r : ListBlank (Fin 2)) : + ReachesStar (cert_tm var) + (CfgR l ([1, 0] +> (D_word 0 +> ([0, 0] +> r)))) + (CfgR ([1, 0, 0, 1] +> (S_word 0 +> l)) r) := by + cases var <;> fsteps + +theorem rule_defect_blankS (l r : ListBlank (Fin 2)) (n : Nat) : + ReachesStar (cert_tm var) + (CfgR l ([1, 0] +> (D_word (1 + n) +> ([0, 0] +> r)))) + (CfgR ([1, 0] +> ((([1, + 1] : List (Fin 2)) ^ n) +> ([1] +> (S_word 0 +> (S_word 0 +> l))))) r) := by + cases var <;> (nsteps 9; follow (ones2 _ _ _ n); fsteps) + +theorem rule_paired (l r : ListBlank (Fin 2)) (k n : Nat) : + ReachesStar (cert_tm var) + (CfgR l ((([1, 0] : List (Fin 2)) ^ (k * 2)) +> (D_word n +> r))) + (CfgR ((([1, 0] : List (Fin 2)) ^ n) +> ((([1, 1, 0, + 1] : List (Fin 2)) ^ k) +> (S_word 0 +> l))) r) := by + cases var <;> (nsteps 3; follow (scanPair _ _ _ k); follow (scanR _ _ _ n); bb_refl) + +theorem rule_emptyR (l : ListBlank (Fin 2)) : + ReachesStar (cert_tm var) (CfgR l default) (CfgL l (D_word 0 +> (D_word 0 +> default))) := by + cases var <;> fsteps + +theorem rule_collide (l r : ListBlank (Fin 2)) : + ReachesStar (cert_tm var) + (CfgR l ([1, 0] +> (D_word 0 +> (D_word 0 +> r)))) + (CfgJ l (D_word 2 +> ([1, 0] +> r))) := by + cases var <;> fsteps + +theorem rule_pairR (l r : ListBlank (Fin 2)) (n : Nat) : + ReachesStar (cert_tm var) + (CfgR l ([1, 0] +> (D_word (2 + n) +> (D_word (2 + n) +> r)))) + (CfgR (PL_word n +> l) ([1, 0] +> r)) := by + cases var <;> ( + nsteps 11; follow (ones2 _ _ _ n); nsteps 20; follow (scanR1 _ _ _ n) + nsteps 20; follow (scanB _ _ _ n); nsteps 23; follow (scanR _ _ _ n); bb_refl) + +theorem cert_tm_no_some_none : + ∀ (q : Fin 6) (b : Fin 2), (cert_tm var q b).map Prod.fst ≠ some none := by + cases var <;> decide + +instance : HasCertRules (cert_tm var) where + no_some_none := cert_tm_no_some_none var + scanR := scanR var + scanB := scanB var + scanC := scanC var + scanPair := scanPair var + ones := ones var + rule_right := rule_right var + rule_left := rule_left var + rule_blank := rule_blank var + rule_even := rule_even var + rule_restart := rule_restart var + rule_overflow2 := rule_overflow2 var + rule_overflow1 := rule_overflow1 var + rule_collision := rule_collision var + rule_leftJ := rule_leftJ var + rule_turnB := rule_turnB var + rule_turnJ := rule_turnJ var + rule_finishP := rule_finishP var + rule_defect0 := rule_defect0 var + rule_defect1 := rule_defect1 var + rule_defect2 := rule_defect2 var + rule_defect_blank0 := rule_defect_blank0 var + rule_defect_blankS := rule_defect_blankS var + rule_paired := rule_paired var + rule_emptyR := rule_emptyR var + rule_collide := rule_collide var + rule_pairR := rule_pairR var + +end CertTmRules + +end BusyBeaver.CertTreeEngine diff --git a/BusyBeaver/Calculi/CertTreeDataA.lean b/BusyBeaver/Calculi/CertTreeDataA.lean new file mode 100644 index 00000000..99542182 --- /dev/null +++ b/BusyBeaver/Calculi/CertTreeDataA.lean @@ -0,0 +1,7895 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Calculi.CertTree + +/-! +# Certified Search Tree Data Bank A (`BusyBeaver.Calculi.CertTreeDataA`) + +Precomputed node and branch data tables supporting tree-structured certificates +in `BusyBeaver.Calculi.CertTree`. +-/ + +@[expose] public section + +namespace BusyBeaver.CertTreeEngine + +set_option maxRecDepth 20000 in +def st_0 : CertTree := + (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x10043 0x400c6 0x10043 0xf 0x1001e + 0x20186 0x10043 0x10303) (.leaf8 0x10023 0x600c6 0x10043 0x10303 0x10009 0x8 0x1000a 0x10008)) + (.bin (.leaf8 0x10009 0x10021 0x10019 0x10000000000001d 0xf 0x10000000000001d 0x103c3 + 0x10000000003000000000100000000010000000002001c) (.leaf8 0x600c6 0x10043 0x30142 0x101c3 + 0x3000000000400000000000000000000001e 0x4000a 0x8 (h240 0x10000 + 0x100000000000000000002000000000100000000000000000000001e)))) (.bin (.bin (.leaf8 0x10009 0x20021 + 0x10019 0x10000000000001d 0xf 0x10000000000001d 0x103c3 (h240 0x10000 + 0x400000000010000000002000000000100000000010000000003001c)) (.leaf8 0x1000f (h240 0x50000 + 0x10000000001000000000200000000020000000000001d) 0x20000000001000b 0x100000000020016 0x14 + 0x20000000000000000000100000000030000000000001f (h240 0x10000 + 0x300000000020000000000000000000100000000030000000003001c) 0x20186)) (.bin (.leaf8 0x10043 0x30142 + 0x101c3 0x40023 0xc00c6 0x10043 0x10303 0x10009) (.leaf8 0x8 (h240 0x30000 + 0x100000000000000000002000000000100000000000000000000001e) 0x10009 0x20021 0x200000000010016 + 0x10019 0x10000000000001d 0xf)))) (.bin (.bin (.bin (.leaf8 0x10000000000001d 0x103c3 (h240 + 0x50000000000000000000100000000010000 0x200000000000000000000000000000400000000000000000000001e) + 0x30023 0x3000d 0x5000e 0x10000000002000000000100000000010000000002001c 0x20186) (.leaf8 0x10043 + 0x10142 0x101c3 0x20023 0x800c6 0x10043 0x10303 0x10009)) (.bin (.leaf8 0x20008 0x10009 0x10021 + 0x500000000040016 0x3001d 0x100000000010000000001000000000600000000020000000000001e 0x50023 + 0x5000d) (.leaf8 0x3000e 0x40000000001000b 0x50016 0x20014 0x20010 0x10021 0x10000000001001a + 0x16))) (.bin (.bin (.leaf8 0x10000000000000000000100000000000000000000001d 0x100000000020023 + 0x300000000000000000000000000000000000000000020 0x4000e + 0x40000000000000000000200000000010000000000001e (h240 0x10000 + 0x200000000020000000000000000000100000000050000000003001c) 0x20186 0x10043) (.leaf8 0x50142 + 0x101c3 0x60023 0x1000c6 0x10043 0x10303 0x10009 0x8)) (.bin (.leaf8 (h240 0x20000 + 0x100000000000000000002000000000100000000000000000000001e) 0x10009 0x20021 0x10000000003001a + 0x20014 0x40000000000000000000100000000070000000001001f (h240 + 0x100000000080000000001000000000000000000010000 + 0x400000000010000000002000000000100000000010000000005001c) 0x1000f) (.leaf8 + 0x200000000060000000001000000000100000000000000000001001e 0x20000000000000b 0x20016 + 0x500000000060016 0x10000000001001a 0x200000000010016 0x10019 0x1d))))) (.bin (.bin (.bin (.bin + (.leaf8 0xf 0x10000000000001d 0x103c3 (h240 0x30000000000000000000100000000010000 + 0x200000000000000000000000000000400000000000000000000001e) 0x30023 0x3000d + 0x300000000000000000000000000000000000000010020 0x4000000000000000000070000000003001f) (.leaf8 + (h240 0x10000 0x800000000010000000000000000000100000000010000000003001c) 0x1000f 0x60000000000001d + (h240 0x10000 0x100000000020000000000000000000100000000020000000003001c) 0x800c6 0x10043 0x10303 + 0x10009)) (.bin (.leaf8 0x10014 0x800000000030000000000000000000200000000020000000000001f + 0x40000000002000b 0x80013 0x60008 0x10009 0x10021 0x100000000030016) (.leaf8 0x14 + 0x20000000000000000000100000000030000000001001f (h240 0x1000000000400000000010000 + 0x10000000007000000000100000000010000000004001c) 0x1000f + 0x200000000040000000001000000000100000000020000000001001e (h240 0x10000 + 0x100000000020000000000000000000100000000050000000003001c) 0x5000f 0x200000000060000000001001d))) + (.bin (.bin (.leaf8 0x5000b 0x10014 0x20010 0x10021 0x50016 0x300000000020016 0x30000000001001a + 0x13) (.leaf8 0x8 0x100000000020023 (h240 0x100000000000000 + 0x1000000000300000000000000000002000000000000000000000020) 0x6000000000000000000050000000000001f + (h240 0x10000 0x500000000020000000000000000000100000000010000000003001c) 0x1000f + 0x80000000000000000000100000000010000000001001e (h240 0x1000000000100000000020000 + 0x10000000003000000000100000000020000000004001c))) (.bin (.leaf8 0x2000f + 0xb0000000000000000000200000000000000000001001e 0x30000000002000b 0x14 + 0x1000000000300000000050000000000001f 0x20000000005000b 0x14 0x40010) (.leaf8 0x10021 0x12 + 0x10000000002000000000100000000040000000002001c 0x4000f 0x30021 0x8 (h240 + 0x1000000000100000000020000 0x10000000002000000000100000000040000000004001c) 0x4000f)))) (.bin + (.bin (.bin (.leaf8 0x30021 0x600000000030016 0x500000000040016 0x20014 + 0x1000000000300000000070000000000001f 0x100000000020000000001000000000700000000010000000000001e + 0x60023 0x6000d) (.leaf8 0x20000000005000000000100000000080000000001001f (h240 (h240 0x10000 + 0x9000000000100000000000000000002000000000100000000020000) + 0x10000000002000000000100000000040000000006001c) 0xc00c6 0x10043 0x20142 0x101c3 0x30009 0x14)) + (.bin (.leaf8 0x10000000001000000000300000000040000000000001f (h240 0x90000 + 0x200000000020000000002000000000400000000000000000000001e) 0x4000a 0x20008 + 0x300000000000000000001000000000100000000000000000000001e 0x10009 0x20021 0xb00000000010016) + (.leaf8 0x800000000010019 0x200000000040000000001001d 0x60023 0x300000000000000000001009c 0xc0003 + 0xc000f (h240 (h240 0x400000000030000 0x1000000000200000000020000000000000000000100000000040000) + 0x100000000070000000005000000000200000000010000000001001d) 0xb0023))) (.bin (.bin (.leaf8 0xb000d + 0x2000e 0x10000000004000000000100000000010000000002001c 0x1000f 0x200000000090000000001001d + 0x40000000001000b 0xd00000000010016 0x14) (.leaf8 0xf0010 0x10021 0x400000000050016 0x14 0x60010 + 0x10021 0x300000000000016 0x20000000001001a)) (.bin (.leaf8 0x200000000010016 0x10019 + 0x10000000000001d 0xf 0x10000000000001d 0x103c3 (h240 0x60000000000000000000100000000010000 + 0x200000000000000000000000000000400000000000000000000001e) 0x30023) (.leaf8 0x3000d + 0x300000000000000000001000000000000000000010020 0x5000e (h240 0x10000 + 0x10000000002000000000100000000060000000003001c) 0x6000f + 0x60000000000000000000600000000000000000001001e (h240 0x1000000000600000000020000 + 0x100000000020000000001000000000e0000000004001c) 0xe000d)))))) (.bin (.bin (.bin (.bin (.bin + (.leaf8 0x5000e 0x20186 0x10043 0x60142 0x101c3 0x70023 0x1200c6 0x10043) (.leaf8 0x10303 0x10009 + 0x100008 0x10009 0x10021 0x16 0x60014 0x2000e)) (.bin (.leaf8 (h240 0x10000 + 0x10000000011000000000100000000010000000003001c) 0x1000f 0x40021 0x16 0x10000000004001a + 0x500000000040016 0x3001d 0x100000000010000000001000000000600000000020000000000001e) (.leaf8 + 0x50023 0x5000d 0x2000000000400000000010000000000000000000100000000010020 0x2000e (h240 (h240 + 0x10000 0x100000000080000000001000000000300000000010000) + 0x10000000011000000000100000000010000000006001c) 0x1000f 0x2000000000b0000000001001d 0x10009))) + (.bin (.bin (.leaf8 0xc0021 0x17 0x1d 0x103c3 (h240 (h240 (h240 (h240 0x70000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x7000000000100000000090000000001000000000300000000010000) + 0x100000000080000000001000000000300000000010000) 0x1000000001100000000010000000001000000000c001c) + 0x20186 0x10043 0x10142) (.leaf8 0x101c3 0x20023 0x800c6 0x10043 0x10303 0x10009 0x110008 (h240 + 0x30000 0x1200000000000000000002000000000100000000000000000000001e))) (.bin (.leaf8 + 0x130000000001000b 0x30013 0x80008 (h240 0x30000 + 0x900000000000000000002000000000100000000000000000000001e) 0x10009 0x20021 0x700000000070016 0x14) + (.leaf8 0x90010 0x10021 0x300000000000016 0x30000000001001a 0x3001d 0x40009 0x20021 0x17)))) (.bin + (.bin (.bin (.leaf8 0x1d 0x103c3 (h240 0x10000 + 0x200000000020000000000000000000100000000030000000003001c) 0x3000d (h240 + 0x20000000000000000000100000000010000 0x2000000000300000000000000000001000000000000000000010020) + 0x5000e (h240 0x10000 0x10000000002000000000100000000090000000003001c) 0x9000f) (.leaf8 + 0x80000000000000000000900000000020000000001001e 0x80023 0x8000d 0x5000e (h240 + 0x1000000000a00000000010000 0x200000000010000000000000000000100000000140000000004001c) 0x20186 + 0x10043 0x140142)) (.bin (.leaf8 0x101c3 0x150023 0x2e00c6 0x10043 0x10303 0x10009 0x8 0x10009) + (.leaf8 0x10021 0xa00000000000016 0xa00000000040016 0x16 0x10000000004001a 0x500000000040016 0x14 + 0x70010))) (.bin (.bin (.leaf8 0x10021 0x100000000000016 0x14 0x3000e (h240 0x10000 + 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x200000000030000000001000000000700000000000000000001001e 0x60023) (.leaf8 0x6000d + 0x2000000000500000000010000000000000000000100000000010020 0x2000e + 0x100000000000000000001000000000b0000000002001c 0xb000f 0x200000000080000000001001d (h240 + 0x100000000000000 0x100000000090000000000000000000b00000000010000000000001e) 0xa0023)) (.bin + (.leaf8 0xa000d 0xc000e (h240 0x10000 0x10000000001000000000100000000010000000003001c) 0x1000f + 0xe00000000000000000001000000000b0000000001001e 0x10000000000000b 0xd0014 0x1000e) (.leaf8 0x800c6 + 0x10043 0xf0142 0x101c3 0x100009 0xc00000000010019 0xa0000000000001d 0xa0023))))) (.bin (.bin + (.bin (.bin (.leaf8 0x300000000000000000001009c 0x100003 0x10000f (h240 (h240 (h240 (h240 0x210000 + 0x100000000020000000006000000000300000000010000) + 0x4000000000100000000000000000001000000000200000000010000) + 0x8000000000100000000090000000001000000000300000000010000) + 0x1000000000b000000000b00000000010000000000001d) 0x10000b 0xb0014 + 0x3000000000d0000000000000000000200000000020000000000001f 0x20009) (.leaf8 0x20021 + 0x800000000070016 0x16 0x300000000020016 0x20000000001001a 0x200000000010016 0x14 + 0x20000000000000000000100000000040000000000001f)) (.bin (.leaf8 0x30023 0x3000d + 0x2000000000200000000010000000001000000000000000000010020 + 0x20000000003000000000100000000050000000000001f (h240 + 0x100000000050000000002000000000000000000010000 + 0x200000000010000000000000000000100000000090000000005001c) 0x9000f + 0x200000000070000000001000000000900000000030000000001001e 0x80023) (.leaf8 0x8000d 0x5000e + 0x1000000000e000000000100000000020000000002001c 0x2000f + 0x2000000000a0000000001000000000200000000050000000001001e 0x20009 0xb0021 0x17))) (.bin (.bin + (.leaf8 0x1d 0x103c3 (h240 (h240 (h240 0x1100000000030000000001000000000500000000020000 + 0x6000000000100000000050000000002000000000000000000010000) + 0x2000000000100000000000000000001000000000a00000000010000) + 0x60000000001000000000e00000000010000000002000000000b001c) 0x20186 0x10043 0x20142 0x101c3 + 0x30023) (.leaf8 0xa00c6 0x10043 0x10303 0x10009 0xe0008 0x10009 0x10021 0xa00000000040016)) (.bin + (.leaf8 0x20014 0x400000000000000000001000000000c0000000000001f 0xc0009 0x20021 0x600000000030016 + 0x500000000040016 0x80000000001001a 0x100000000010016) (.leaf8 0x14 (h240 0x10000 + 0x10000000001000000000000000000030000000000001f) 0x20023 0x2000d + 0x300000000000000000007000000000000000000010020 0x4000000000000000000070000000002001f 0x60023 + 0x6000d)))) (.bin (.bin (.bin (.leaf8 0x5000000000000000000080000000001001f (h240 + 0x100000000090000000001000000000000000000010000 + 0x2000000000100000000050000000001000000000c0000000005001c) 0xc000f 0x90000000000001d 0xb0023 + 0xb000d 0xf000e 0xb0000000000000000000100000000000000000000001e) (.leaf8 0x100000000000000b + 0x5000000000b0016 0x16 0x800000000070016 0x40000000004001a 0x200000000020016 0x14 + 0x20000000000000000000100000000040000000000001f)) (.bin (.leaf8 0x100000000040023 + 0x2000000000300000000010000000003000000000100000000000020 + 0x200000000050000000001000000000a0000000001001f 0xa0009 0x60021 0x17 0x1d 0x103c3) (.leaf8 (h240 + (h240 0x100000 0x3000000000100000000040000000002000000000000000000010000) + 0x8000000000300000000090000000001000000000a0000000006001c) 0xa000f (h240 + 0x20000000000000000000100000000010000 0x200000000050000000000000000000a00000000000000000001001e) + 0x90023 0x9000d 0x2000e 0x10000000000000000000100000000060000000002001c 0x6000f))) (.bin (.bin + (.leaf8 0xa0000000000000000000600000000050000000001001e (h240 0x10000 + 0x600000000020000000000000000000100000000100000000003001c) 0x2400c6 0x10043 0x10303 0x10009 + 0x60014 0x300000000080000000000000000000200000000020000000000001f) (.leaf8 0x20009 0x20021 + 0x900000000090016 0x10000000007001a 0x60016 0x40014 0x20010 0x10021)) (.bin (.leaf8 + 0x80000000001001a 0x3001d 0x1000000000100000000010000000007000000000000000000000020 0x6000e + 0x200000000060000000001000000000200000000000000000000001e 0x20009 0x70021 0x17) (.leaf8 0x1d + 0x103c3 (h240 (h240 0x9000000000300000000010000 + 0x2000000000200000000000000000001000000000500000000070000) + 0x600000000010000000007000000000100000000020000000007001c) 0x2000f (h240 0x20000 + 0x10000000001000000000200000000060000000000001d) 0x100000000030023 + 0xa00000000000000000000000000000200000000000020 0xb0000000000000000000b0000000005001f))))))) (.bin + (.bin (.bin (.bin (.bin (.bin (.leaf8 (h240 0x1000000000c0000000001000000000000000000010000 + 0x500000000010000000009000000000100000000020000000005001c) 0x2000f + 0xf0000000000000000000200000000060000000001001e 0x2000a 0x90008 0x10009 0x10021 0x30016) (.leaf8 + 0xb000000000a0016 0x30014 0xd0010 0x10021 0x600000000050016 0x30000000004001a 0x30016 0x20014)) + (.bin (.leaf8 0x20010 0x10021 0x40000000001001a 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d) (.leaf8 + 0x2000000000200000000010000000003000000000000000000010020 0x4000e + 0x200000000040000000001000000000200000000000000000000001e 0x100000000030023 + 0x2000000000600000000010000000002000000000100000000000020 + 0x20000000008000000000100000000080000000002001f (h240 0x1000000000800000000020000 + 0x100000000050000000001000000000d0000000004001c) 0xd000f))) (.bin (.bin (.leaf8 + 0x2000000000b0000000001000000000d00000000000000000001001e (h240 0x100000000000000 + 0x1000000000c0000000000000000000d00000000030000000000001e) 0xc0023 0xc000d + 0xe000000000000000000020000000001001f (h240 0x1000000000300000000010000 + 0x1000000000a000000000100000000010000000004001c) 0x1000f 0x110000000000001d) (.leaf8 + 0xa0000000000000b 0x30014 0xa000e 0x1a00c6 0x10043 0x50142 0x101c3 0x60009)) (.bin (.leaf8 + 0xe00000000010019 0xd0000000000001d 0xc0023 0x300000000000000000001009c 0x60003 0x6000f (h240 + (h240 (h240 (h240 (h240 0x110000000000000000000100000000020000 + 0x14000000000300000000010000000004000000000400000000060000) + 0x1000000000500000000010000000003000000000100000000000000) + 0x1000000000800000000020000000009000000000100000000080000) + 0x20000000000000000000100000000050000000001000000000d0000) + 0xe00000000010000000000000000000600000000050000000001001e) 0x6000b) (.leaf8 0xd0014 0x20010 + 0x10021 0x30016 0x80014 0x20010 0x10021 0x10000000007001a)))) (.bin (.bin (.bin (.leaf8 0x60016 + 0x500000000010016 0x20000000004001a 0x300000000020016 0x90000000001001a 0x200000000010016 0x14 + 0x20000000000000000000100000000040000000000001f) (.leaf8 0x30023 0x3000d + 0x2000000000200000000010000000008000000000000000000010020 + 0x20000000003000000000100000000050000000000001f 0x100000000050023 + 0x2000000000500000000010000000000000000000100000000000020 0x80010 0x70021)) (.bin (.leaf8 0x17 + 0x1d 0x103c3 (h240 (h240 0xf000000000300000000010000 + 0x5000000000900000000060000000001000000000500000000020000) + 0x10000000008000000000100000000080000000007001c) 0x8000f (h240 + 0x20000000000000000000100000000010000 0x200000000060000000000000000000800000000000000000001001e) + 0x70023 0x7000d) (.leaf8 0x9000000000000000000070000000000001f 0x60023 0x6000d + 0xa000000000000000000020000000003001f 0x100000000030023 + 0xc00000000000000000000000000000200000000000020 0xa000e + 0xd0000000000000000000200000000000000000000001e))) (.bin (.bin (.leaf8 (h240 + 0x1000000000300000000010000 0x1000000000f000000000100000000020000000004001c) 0x2000f + 0x100000000000000000000200000000010000000001001e 0xf0000000001000b 0x30014 0x10000e 0x20186 + 0x10043) (.leaf8 0x110142 0x101c3 0x120023 0x2800c6 0x10043 0x10303 0x10009 0x50008)) (.bin + (.leaf8 0x10009 0x10021 0xb00000000010019 0xd0000000000001d 0x90023 (h240 0x20000 + 0x10000000006000000000100000000010000000003009c) 0x1000f (h240 (h240 (h240 (h240 (h240 + 0x240000000000000000000100000000010000 0xf000000000300000000010000000005000000000900000000060000) + 0x1000000000500000000020000000000000000000100000000080000) + 0x1000000000900000000010000000008000000000100000000030000) + 0x100000000000000000001000000000b0000000001000000000a0000) + 0xe00000000020000000000000000000100000000090000000001001e)) (.leaf8 0x60000000000000b 0x14 0x6000e + 0x1200c6 0x10043 0x20142 0x101c3 0x30009))))) (.bin (.bin (.bin (.bin (.leaf8 0xa00000000010019 + 0xd0000000000001d 0x80023 0x300000000000000000001009c 0x30003 0x3000f (h240 (h240 (h240 (h240 + (h240 0x3c0000000000000000000100000000010000 + 0xf000000000300000000010000000005000000000900000000060000) + 0x1000000000500000000020000000000000000000100000000080000) + 0x1000000000900000000010000000008000000000100000000030000) + 0x100000000000000000001000000000b000000000100000000090000) + 0xe00000000010000000000000000000300000000020000000001001e) 0x3000a) (.leaf8 0x8 (h240 0x90000 + 0x100000000000000000002000000000100000000000000000000001e) 0x10009 0x20021 0x90016 + 0x800000000010016 0x800000000070016 0x14)) (.bin (.leaf8 0xa0010 0x10021 0x600000000030016 + 0x40000000004001a 0x300000000030016 0x70000000001001a 0x3001d + 0x1000000000100000000010000000006000000000000000000000020) (.leaf8 + 0x20000000005000000000100000000050000000001001f 0x100000000060023 + 0x2000000000600000000010000000003000000000100000000000020 + 0x20000000008000000000100000000080000000001001f (h240 0x1000000000900000000010000 + 0x100000000020000000001000000000a0000000004001c) 0xa000f + 0x2000000000a0000000001000000000a00000000020000000001001e 0x90023))) (.bin (.bin (.leaf8 0x9000d + 0x2000000000b0000000001000000000a0000000000001f 0x90023 0x9000d + 0x2000000000b000000000100000000020000000004001f 0x20009 0xc0021 0x17) (.leaf8 0x1d 0x103c3 (h240 + (h240 (h240 (h240 (h240 0x21000000000300000000010000 + 0x2000000000200000000000000000001000000000500000000070000) + 0x6000000000100000000000000000001000000000800000000040000) + 0x9000000000100000000000000000001000000000200000000020000) + 0xb000000000100000000030000000001000000000000000000010000) + 0xb00000000010000000002000000000100000000010000000010001c) 0x20186 0x10043 0x10142 0x101c3 + 0x20023)) (.bin (.leaf8 0x800c6 0x10043 0x10303 0x10009 0x20008 0x10009 0x10021 0x90016) (.leaf8 + 0xb00000000010016 0x200000000090016 0x90014 0x40010 0x10021 0x10000000007001a 0x800000000070016 + 0x60014)))) (.bin (.bin (.bin (.leaf8 0xa0010 0x10021 0x30000000004001a 0x30016 0x20014 0x20010 + 0x10021 0x100000000001001a) (.leaf8 0x100000000010016 0x14 (h240 0x10000 + 0x10000000001000000000000000000030000000000001f) 0x20023 0x2000d + 0x30000000000000000000f000000000000000000010020 0x4000e + 0x50000000000000000000200000000000000000000001e)) (.bin (.leaf8 0x100000000030023 + 0x700000000000000000002000000000100000000000020 0x8000e + 0x90000000000000000000a00000000030000000000001e 0x90023 0x9000d + 0xa00000000000000000000000000000200000000010020 0xb000e) (.leaf8 + 0xb0000000000000000000400000000040000000000001e (h240 0x10000 + 0x5000000000100000000000000000001000000000c0000000003001c) 0xc000f 0xd0000000000001d 0xb0023 + 0xb000d 0xe000000000000000000020000000005001f (h240 0x1000000000300000000010000 + 0x10000000003000000000100000000010000000004001c)))) (.bin (.bin (.leaf8 0x600c6 0x10043 0x30142 + 0x101c3 0x40009 0x30014 0x4000e 0x20186) (.leaf8 0x10043 0x50142 0x101c3 0x60023 0x1000c6 0x10043 + 0x10303 0x10009)) (.bin (.leaf8 0x50008 0x10009 0x10021 0xd00000000010019 0xd0000000000001d + 0xb0023 (h240 0x20000 0x10000000006000000000100000000010000000003009c) 0x1000f) (.leaf8 (h240 + (h240 (h240 (h240 (h240 0x630000000000000000000100000000020000 + 0x1000000000400000000100000000006000000000100000000050000) + 0x1000000000300000000010000000000000000000100000000080000) + 0x300000000090000000001000000000b0000000002000000000c0000) + 0x10000000005000000000100000000000000000001000000000c0000) + 0xe00000000020000000000000000000100000000010000000001001e) 0x60000000000000b 0x14 0x6000e 0x1200c6 + 0x10043 0x20142 0x101c3)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 0x30009 0xc00000000010019 + 0xd0000000000001d 0xa0023 0x300000000000000000001009c 0x30003 0x3000f (h240 (h240 (h240 (h240 + (h240 0x6b0000000000000000000100000000020000 + 0x1000000000400000000100000000006000000000100000000050000) + 0x1000000000300000000010000000000000000000100000000080000) + 0x300000000090000000001000000000b0000000002000000000c0000) + 0x10000000005000000000100000000000000000001000000000b0000) + 0xe00000000010000000000000000000300000000020000000001001e)) (.leaf8 0x3000a 0x8 (h240 0xb0000 + 0x100000000000000000002000000000100000000000000000000001e) (h240 0x50000 + 0xd00000000010000000002000000000100000000000000000000001e) 0x1000a 0x20008 0x10009 0x10021)) (.bin + (.leaf8 0x7000000000c0016 0xc00000000010019 0xb0000000000001d 0xa0023 0x300000000000000000001009c + 0x80003 0x8000f (h240 (h240 (h240 (h240 0x75000000000000000000010000000002000000000100000000040000 + 0x10000000000600000000010000000005000000000100000000030000) + 0x1000000000000000000010000000008000000000300000000090000) + 0x1000000000b0000000001000000000c0000000001000000000b0000) + 0xc00000000010000000000000000000800000000060000000001001e)) (.leaf8 (h240 + 0x1000000000900000000010000 0x10000000003000000000100000000010000000004001c) 0x600c6 0x10043 + 0x30142 0x101c3 0x40009 0x90014 0x4000e))) (.bin (.bin (.leaf8 0x20186 0x10043 0x50142 0x101c3 + 0x60023 0x1000c6 0x10043 0x10303) (.leaf8 0x10009 0xb0008 0x10009 0x10021 0x10019 + 0xd0000000000001d 0xf 0xc0000000000001d)) (.bin (.leaf8 0x103c3 + 0x1000000000d000000000100000000010000000002001c 0x1000f (h240 (h240 (h240 (h240 (h240 + 0x8900000000000000 0x1000000000200000000010000000004000000001000000000060000) + 0x1000000000500000000010000000003000000000100000000000000) + 0x10000000008000000000300000000090000000001000000000b0000) + 0x1000000000c0000000001000000000b000000000100000000010000) + 0xd00000000010000000000000000000100000000010000000001001e) 0xd0000000000000b + 0xb00000000000000000003001d 0xd000b 0xc0014) (.leaf8 0x20010 0x10021 0xc00000000010019 + 0xa0000000000001d 0xa0023 (h240 0x20000 0x1000000000e000000000100000000020000000003009c) 0x2000f + (h240 (h240 (h240 (h240 0x9100000000000000 + 0x1000000000200000000010000000004000000001000000000060000) + 0x1000000000500000000010000000003000000000100000000000000) + 0x10000000008000000000300000000090000000002000000000b0000) + 0xa00000000020000000000000000000200000000050000000001001e))))) (.bin (.bin (.bin (.leaf8 0x2000a + 0xe0008 0xf00000000000000000001000000000100000000000000000000001e 0x10009 0x20021 + 0x10000000009001a 0x10000000007001a 0x800000000070016) (.leaf8 0x30014 0xa0010 0x10021 + 0x600000000030016 0x70000000004001a 0x400000000040016 0x16 0x14)) (.bin (.leaf8 0x2000e + 0x10000000000000000000100000000050000000002001c 0x5000f + 0x200000000020000000001000000000500000000010000000001001e 0x40023 0x4000d + 0x2000000000300000000010000000006000000000100000000010020 + 0x20000000004000000000100000000080000000001001f) (.leaf8 (h240 0x1000000000900000000010000 + 0x100000000050000000001000000000a0000000004001c) 0xa000f + 0x200000000060000000001000000000a00000000020000000001001e 0x90023 0x9000d + 0x2000000000700000000010000000000000000000200000000010020 + 0x200000000080000000001000000000d0000000005001f (h240 + 0x1000000000e0000000001000000000000000000010000 + 0x200000000010000000010000000000100000000000000000005001c)))) (.bin (.bin (.leaf8 0x400c6 0x10043 + 0x100142 0x101c3 0x110009 0x16 0xc000000000c0016 0x500000000090016) (.leaf8 0x90014 0x70010 + 0x10021 0x30000000007001a 0x600000000070016 0x30014 0x80010 0x10021)) (.bin (.leaf8 + 0x140000000001001a 0x200000000010016 0x10019 0x10000000000001d 0xf 0x10000000000001d 0x103c3 (h240 + 0x4c0000000000000000000100000000010000 0x200000000000000000000000000000400000000000000000000001e)) + (.leaf8 0x30023 0x3000d 0x300000000000000000013000000000000000000010020 0x5000e + 0x40000000000000000000800000000030000000000001e 0x70023 0x7000d + 0x500000000000000000002000000000200000000010020))))) (.bin (.bin (.bin (.bin (.leaf8 0xb000e + 0x60000000000000000000700000000040000000000001e (h240 0x10000 + 0x8000000000100000000000000000001000000000d0000000003001c) 0xd000f + 0x80000000000000000000d00000000060000000001001e (h240 + 0x1000000000e0000000001000000000000000000010000 + 0x200000000010000000000000000000100000000100000000005001c) 0x2400c6 0x10043) (.leaf8 0x10303 + 0x10009 0x16 0xc0016 0xc00000000060016 0x1000000000a001a 0x9000000000a0016 0xa0000000004001a)) + (.bin (.leaf8 0x500000000040016 0x3001d 0x100000000010000000001000000000600000000020000000000001e + 0x50023 0x5000d 0x2000000000400000000010000000009000000000100000000010020 + 0x200000000050000000001000000000b0000000006001f 0xa0023) (.leaf8 0xa000d + 0x2000000000600000000010000000000000000000300000000010020 + 0x200000000070000000001000000000e0000000003001f (h240 0x10000 + 0xf00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x200000000080000000001000000000100000000060000000001001e (h240 + 0x100000000020000000001000000000000000000010000 + 0x200000000010000000000000000000100000000010000000005001c) 0x1000f))) (.bin (.bin (.leaf8 + 0x2000000000c0000000001000000000100000000080000000001001e 0x1000a 0x8 0x10009 0x10021 0x16 0x16 + 0x1000000000d001a) (.leaf8 0x9000000000a0016 0x40000000007001a 0x700000000070016 0x14 0x90010 + 0x10021 0x300000000000016 0x210000000001001a)) (.bin (.leaf8 0x200000000010016 0x10019 + 0x10000000000001d 0xf 0x10000000000001d 0x103c3 (h240 0x2d0000000000000000000100000000010000 + 0x200000000000000000000000000000400000000000000000000001e) 0x30023) (.leaf8 0x3000d + 0x300000000000000000020000000000000000000010020 0x5000e (h240 0x10000 + 0x10000000002000000000100000000090000000003001c) 0x9000f + 0x60000000000000000000900000000020000000001001e 0x80023 0x8000d)))) (.bin (.bin (.bin (.leaf8 + 0x700000000000000000003000000000200000000010020 0x80000000000000000000b0000000006001f 0xa0023 + 0xa000d 0x800000000000000000000000000000400000000010020 0x2000e (h240 + 0x100000000000000000001000000000200000000010000 0x10000000001000000000100000000010000000005001c) + 0x600c6) (.leaf8 0x10043 0x10142 0x101c3 0x20009 0x20014 0x2000e 0x20186 0x10043)) (.bin (.leaf8 + 0x30142 0x101c3 0x40023 0xc00c6 0x10043 0x10303 0x10009 0x40008) (.leaf8 0x10009 0x10021 0x10019 + 0xa0000000000001d 0x3000f 0x90000000000001d 0x20023 0x2000d))) (.bin (.bin (.leaf8 0x5000e + 0xb0000000000000000000100000000000000000000001e 0x1000a 0x60008 0x10009 0x10021 0x1200000000020016 + 0x2000000000a001a) (.leaf8 0xa000000000a0016 0x16 0x110000000004001a 0x100000000030016 0x14 + 0x20000000000000000000100000000030000000001001f 0x100000000040023 + 0x2000000000300000000010000000010000000000100000000000020)) (.bin (.leaf8 0x2000e + 0x100000000000000000001000000000b0000000002001c 0xb000f + 0x200000000070000000001000000000b00000000050000000001001e 0xa0023 0xa000d + 0x2000000000800000000010000000001000000000300000000010020 + 0x20000000009000000000100000000140000000000001f) (.leaf8 (h240 0x1000000001400000000020000 + 0x10000000007000000000100000000010000000004001c) 0x600c6 0x10043 0x70142 0x101c3 0x80009 0x14 + 0x8000e)))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x20186 0x10043 0x90142 0x101c3 + 0xa0023 0x1800c6 0x10043 0x10303) (.leaf8 0x10009 0x20008 0x10009 0x10021 0x1400000000010019 + 0x200000000090000000001001d 0x120023 (h240 0x20000 + 0x10000000003000000000100000000010000000003009c))) (.bin (.leaf8 0x1000f (h240 (h240 (h240 (h240 + 0x4c000000000300000000010000 0x4000000000100000000000000000001000000000800000000100000) + 0x9000000000100000000030000000001000000000000000000010000) + 0xc0000000002000000000f00000000010000000013000000000a0000) + 0x200000000020000000001000000000100000000030000000001001e) 0x1000a 0x30008 + 0x400000000000000000001000000000100000000000000000000001e 0x50000000001000b 0x13 0x130008) (.leaf8 + (h240 0x10000 0x200000000010000000000000000000100000000060000000003001c) 0x20186 0x10043 0x60142 + 0x101c3 0x70023 0x1200c6 0x10043))) (.bin (.bin (.leaf8 0x10303 0x10009 0x8 0x10009 0x10021 + 0x1400000000000016 0xf00000000010019 0x200000000090000000001001d) (.leaf8 0xd0023 + 0x300000000000000000001009c 0x160003 (h240 0x10000 + 0x10000000001000000000100000000010000000003001c) 0x1000f (h240 (h240 (h240 (h240 (h240 0x520000 + 0x3000000000100000000040000000001000000000000000000010000) + 0x8000000001000000000090000000001000000000300000000010000) + 0x1000000000c0000000001000000000f00000000010000) + 0xe0000000002000000000000000000010000000016000000000c0000) + 0x200000000020000000001000000000100000000010000000001001e) 0x1000a 0x10008)) (.bin (.leaf8 (h240 + 0x160000 0x200000000000000000002000000000100000000000000000000001e) 0x30000000001000b 0x160013 0x8 + (h240 0xe0000 0x100000000000000000002000000000100000000000000000000001e) 0x10009 0x20021 + 0xc000000000d0016) (.leaf8 0x30014 0xe0010 0x10021 0x80000000007001a 0x60016 0x300000000020016 + 0x2a0000000001001a 0x13)))) (.bin (.bin (.bin (.leaf8 0x8 0x100000000020023 + 0x100000000020000000001000000000c000000000000000000000020 (h240 0x100000000000000 + 0x100000000060000000000000000001c000000000000000000010020) 0x7000000000000000000050000000000001f + (h240 0x10000 0x500000000020000000000000000000100000000010000000003001c) 0x1000f + 0x90000000000000000000100000000020000000001001e) (.leaf8 0x100000000020023 + 0xb00000000000000000007000000000200000000000020 0x5000e + 0xe0000000000000000000e00000000070000000000001e 0xd0023 0xd000d 0x10000e + 0x10000000002000000000100000000010000000002001c)) (.bin (.leaf8 0x1000f + 0x1100000000000000000001000000000b0000000001001e 0x23 0xd 0x4000e 0x20186 0x10043 0x50142) (.leaf8 + 0x101c3 0x60023 0x1000c6 0x10043 0x10303 0x10009 0x20008 0x10009))) (.bin (.bin (.leaf8 0x10021 + 0x1100000000000016 0x6000000000d0016 0x3000000000a001a 0xb000000000a0016 0x20014 + 0x400000000000000000001000000000d0000000000001f 0xd0009) (.leaf8 0x20021 0x600000000030016 + 0x140000000004001a 0x30016 0x10000000000001a 0x60000000001001a 0x16 0x14)) (.bin (.leaf8 0x2000e + 0x10022 0x2000000000200000000010000000005000000000000000000000020 0x40004 0x10004 + 0x10000000000000000000100000000010000000002005c 0x1000f (h240 (h240 + 0x700000000030000000001000000000000000000010000 + 0x5000000000500000000060000000001000000000500000000050000) + 0x200000000010000000001000000000100000000000000000001001e)) (.leaf8 0x100000000020023 + 0x2000000000800000000010000000013000000000100000000000020 + 0x2000000000a000000000100000000080000000001001f (h240 + 0x100000000090000000001000000000000000000010000 + 0x2000000000100000000050000000001000000000d0000000005001c) 0xd000f + 0x2000000000d0000000001000000000d00000000030000000001001e 0xc0023 0xc000d))))) (.bin (.bin (.bin + (.bin (.leaf8 0x2000000000e00000000010000000001000000000300000000010020 + 0x2000000000f0000000001000000000e0000000004001f (h240 0x100000000000000 + 0x100000000100000000000000000000e00000000010000000000001e) 0xd0023 0xd000d + 0x11000000000000000000080000000008001f 0x70023 0x7000d) (.leaf8 0x13000e (h240 0x10000 + 0x10000000003000000000100000000010000000003001c) 0x1000f + 0x150000000000000000000100000000010000000001001e 0x30000000000000b 0x140014 0x3000e 0xc00c6)) + (.bin (.leaf8 0x10043 0x160142 0x101c3 0x170009 0x900000000010019 0x110000000000001d 0x70023 + 0x300000000000000000001009c) (.leaf8 0x170003 0x17000f (h240 (h240 (h240 (h240 (h240 (h240 + 0x1f000000000000000000010000000002000000005f00000000030000 + 0x1000000000000000000010000000005000000000500000000060000) + 0x1000000000500000000010000000000000000000100000000020000) + 0x1000000000000000000010000000008000000001400000000090000) + 0x1000000000000000000010000000002000000000100000000050000) + 0x1000000000e0000000003000000000f000000000100000000080000) + 0x1200000000010000000000000000001700000000000000000001001e) 0x17000a 0x8 (h240 0x80000 + 0x100000000000000000002000000000100000000000000000000001e) 0x10009 0x20021))) (.bin (.bin (.leaf8 + 0x1000000000d001a 0xe000000000d0016 0x200000000030016 0x90014 0x40010 0x10021 0x90000000007001a + 0x800000000070016) (.leaf8 0x20014 0x5000000000400000000000000000002000000000a0000000000001f + 0xa0009 0x20021 0x20000000004001a 0x500000000040016 0x30014 0x70010)) (.bin (.leaf8 0x10021 + 0x2f0000000001001a 0x16 0x14 0x2000e 0x10022 + 0x200000000020000000001000000000f000000000000000000000020 (h240 0x100000000000000 + 0x100000000050000000000000000001e000000000000000000010020)) (.leaf8 0x5000e + 0x60000000000000000000700000000010000000000001e 0x60023 0x6000d + 0x700000000000000000001000000000100000000010020 0x7000e + 0x100000000050000000001000000000a0000000002001c 0xa000f)))) (.bin (.bin (.bin (.leaf8 + 0xa0000000000000000000a00000000010000000001001e 0x90023 0x9000d + 0xb00000000000000000008000000000200000000010020 0xb000e + 0xc0000000000000000000400000000000000000000001e (h240 0x10000 + 0x5000000000100000000000000000001000000000f0000000003001c) 0xf000f) (.leaf8 + 0xe0000000000000000000f00000000070000000001001e 0xe0023 0xe000d + 0xf00000000000000000000000000000400000000010020 0xa000e + 0x10000000002000000000100000000010000000002001c 0x1000f + 0x1200000000000000000001000000000c0000000001001e)) (.bin (.leaf8 0x20000000000000b + 0x1200000000090016 0xe0016 0xc00000000030016 0x4000000000a001a 0xb000000000a0016 0x800000000030016 + 0x10000000007001a) (.leaf8 0x600000000060016 0x170000000004001a 0x30016 0x80000000001001a + 0x200000000010016 0x14 0x20000000000000000000100000000040000000000001f 0x30023))) (.bin (.bin + (.leaf8 0x3000d 0x2000000000200000000010000000007000000000000000000010020 + 0x20000000003000000000100000000020000000001001f 0x100000000030023 + 0x2000000000500000000010000000016000000000100000000000020 + 0x20000000007000000000100000000080000000003001f 0x100000000090023 + 0x2000000000800000000010000000000000000000200000000000020) (.leaf8 + 0x200000000090000000001000000000a0000000001001f (h240 0x10000 + 0xb000000000100000000000000000001000000000c0000000003001c) 0xc000f + 0x2000000000a0000000001000000000c00000000050000000001001e 0xb0023 0xb000d + 0x2000000000b00000000010000000002000000000300000000010020 0xe0010)) (.bin (.leaf8 0xd0021 0x17 + 0x1d 0x103c3 (h240 (h240 (h240 (h240 0x78000000000300000000010000 + 0x5000000000800000000060000000001000000000300000000010000) + 0x100000000080000000017000000000900000000010000) 0x2000000000b0000000001000000000000000000010000) + 0xd0000000003000000000f0000000001000000000e000000000d001c) 0xe000f (h240 + 0x20000000000000000000100000000010000 0x2000000000c0000000000000000000e00000000040000000001001e) + 0xd0023) (.leaf8 0xd000d 0xe0000000000000000000e0000000001001f (h240 0x10000 + 0xf00000000010000000000000000000100000000010000000003001c) 0x1000f + 0xf0000000000000000000100000000070000000001001e (h240 0x10000 + 0x100000000020000000000000000000100000000130000000003001c) 0x13000f + 0x110000000000000000001300000000040000000001001e)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 (h240 + 0x10000 0x1400000000010000000000000000000100000000020000000003001c) 0x800c6 0x10043 0x10303 + 0x10009 0x120016 0x10014 0xf00000000030000000000000000000200000000020000000000001f) (.leaf8 + 0x20009 0x20021 0x2000000000d001a 0xb0016 0x10000000009001a 0x90014 0xd0010 0x10021)) (.bin + (.leaf8 0xb0000000007001a 0x60016 0x600000000010016 0x30000000004001a 0x500000000040016 + 0x3c0000000001001a 0x3001d 0x1000000000100000000010000000016000000000000000000000020) (.leaf8 + 0x50010 0x60021 0x17 0x1d 0x103c3 (h240 (h240 0x170000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x500000000160000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 + 0x2000000000500000000000000000023000000000000000000010020)))) (.bin (.bin (.leaf8 + 0x7000000000000000000070000000002001f 0x60023 0x6000d + 0x800000000000000000002000000000100000000010020 0x9000000000000000000080000000000001f 0x70023 + 0x7000d 0x9000000000000000000020000000003001f) (.leaf8 0x100000000030023 + 0xb0000000000000000000a000000000200000000000020 0xb000e + 0xd0000000000000000000d00000000040000000000001e (h240 0x10000 + 0xe00000000010000000000000000000100000000010000000003001c) 0x1000f + 0xf0000000000000000000100000000050000000001001e 0x100000000010023)) (.bin (.leaf8 + 0x1100000000000000000001000000000400000000000020 0x11000e + 0x10000000004000000000100000000020000000002001c 0x2000f + 0x140000000000000000000200000000080000000001001e (h240 0x10000 + 0x300000000010000000000000000000100000000010000000003001c) 0x1000f 0x160000000000001d) (.leaf8 + 0x1000b 0x400000000010016 0x10000000010001a 0xf0016 0x10014 + 0xe00000000030000000000000000000200000000020000000000001f 0x20009 0x20021)))) (.bin (.bin (.bin + (.leaf8 0x5000000000a001a 0xb000000000a0016 0x30014 0xd0010 0x10021 0x20000000007001a + 0x600000000060016 0x1d0000000004001a) (.leaf8 0x30016 0x20014 0x20010 0x10021 0xb0000000001001a + 0x100000000010016 0x14 0x20000000000000000000100000000030000000000001f)) (.bin (.leaf8 0x20023 + 0x2000d 0x200000000020000000001000000000a000000000000000000010020 0x4000e + 0x200000000040000000001000000000200000000000000000000001e 0x100000000030023 + 0x200000000060000000001000000001c000000000100000000000020 + 0x20000000008000000000100000000080000000003001f) (.leaf8 0x100000000090023 + 0x2000000000900000000010000000001000000000200000000000020 0x5000e + 0x2000000000c0000000001000000000d00000000050000000000001e 0xc0023 0xc000d + 0x2000000000d00000000010000000003000000000300000000010020 + 0x2000000000e0000000001000000000e0000000000001f))) (.bin (.bin (.leaf8 (h240 0x100000000000000 + 0x1000000000f0000000000000000000e00000000050000000000001e) 0xd0023 0xd000d 0x10000e + 0x10000000004000000000100000000020000000002001c 0x2000f + 0x120000000000000000000200000000060000000001001e 0x100000000030023) (.leaf8 + 0x1400000000000000000000000000000500000000000020 0x15000000000000000000060000000000001f 0x50023 + 0x5000d 0x1000e 0x20186 0x10043 0x20142)) (.bin (.leaf8 0x101c3 0x30023 0xa00c6 0x10043 0x10303 + 0x10009 0x70008 0x10009) (.leaf8 0x10021 0x120016 0x400000000010016 0xf000000000f0016 + 0x2000000000d001a 0x6000000000c0016 0xb000000000a0016 0x90014))))) (.bin (.bin (.bin (.bin (.leaf8 + 0xd0010 0x10021 0xe0000000007001a 0x60016 0x500000000010016 0x50000000004001a 0x400000000040016 + 0x4a0000000001001a) (.leaf8 0x200000000010016 0x14 0x20000000000000000000100000000040000000000001f + 0x30023 0x3000d 0x2000000000200000000010000000017000000000000000000010020 0x50010 0x40021)) (.bin + (.leaf8 0x17 0x1d 0x103c3 (h240 0x1a000000000300000000010000 + 0x500000000180000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000300000000000000000030000000000000000000010020) + 0x5000000000000000000060000000002001f 0x50023) (.leaf8 0x5000d + 0x600000000000000000004000000000100000000010020 0x7000000000000000000070000000000001f 0x60023 + 0x6000d 0x8000000000000000000020000000003001f 0x100000000030023 + 0xa0000000000000000000d000000000200000000000020))) (.bin (.bin (.leaf8 0xb000e + 0xc0000000000000000000d00000000050000000000001e 0xc0023 0xc000d + 0xd000000000000000000080000000007001f 0x100000000090023 + 0xf00000000000000000001000000000400000000000020 0x11000000000000000000110000000009001f) (.leaf8 + (h240 0x10000 0x1200000000010000000000000000000100000000050000000003001c) 0x5000f + 0x120000000000001d 0x40023 0x4000d 0x1300000000000000000002000000000b001f (h240 + 0x1000000000300000000010000 0x10000000008000000000100000000010000000004001c) 0x1000f)) (.bin + (.leaf8 0x160000000000001d 0x80000000000000b 0x30014 0x8000e 0x1600c6 0x10043 0x50142 0x101c3) + (.leaf8 0x60009 0x600000000010019 0x120000000000001d 0x40023 0x300000000000000000001009c 0x60003 + 0x6000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x19000000000000000 + 0x10000000001000000001a0000000003000000000100000000050000) + 0x4a000000000600000000010000000007000000000500000000090000) + 0x1000000000800000000010000000003000000000100000000000000) + 0x1000000000b000000000e000000000c0000000001000000000e0000) + 0x1000000000900000000010000000000000000000100000000110000) + 0x2000000001200000000010000000000000000000100000000050000) + 0x1300000000010000000000000000000600000000040000000001001e))))) (.bin (.bin (.bin (.leaf8 0x5000b + 0x50014 0x1200000000070000000000000000000200000000020000000000001f 0x20009 0x20021 + 0x1100000000100016 0x90014 0x130010) (.leaf8 0x10021 0xc000000000c0016 0x6000000000a001a + 0xb000000000a0016 0x30014 0xd0010 0x10021 0x900000000060016)) (.bin (.leaf8 0x20000000007001a + 0x600000000050016 0x240000000004001a 0x500000000040016 0xd0000000001001a 0x3001d + 0x100000000010000000001000000000c000000000000000000000020 + 0x20000000005000000000100000000070000000002001f) (.leaf8 0x60023 0x6000d + 0x2000000000600000000010000000023000000000100000000010020 + 0x20000000007000000000100000000080000000002001f 0x100000000080023 + 0x2000000000900000000010000000001000000000200000000000020 + 0x2000000000b0000000001000000000b0000000003001f (h240 0x1000000000c00000000010000 + 0x100000000050000000001000000000d0000000004001c)))) (.bin (.bin (.leaf8 0xd000f + 0x2000000000d0000000001000000000d00000000040000000001001e 0xc0023 0xc000d + 0x2000000000e00000000010000000005000000000300000000010020 + 0x2000000000f0000000001000000000e0000000007001f (h240 0x1000000000f00000000010000 + 0x1000000000b000000000100000000130000000004001c) 0x13000f) (.leaf8 + 0x200000000110000000001000000001300000000060000000001001e 0x130009 0x120021 0x17 0x1d 0x103c3 + (h240 (h240 (h240 (h240 (h240 (h240 0xcd0000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x5000000000c00000000060000000001000000000800000000240000) + 0x9000000000100000000080000000002000000000000000000010000) + 0xb0000000002000000000c0000000001000000000000000000010000) + 0x50000000001000000000e0000000007000000000f00000000010000) + 0x1000000000b000000000100000000130000000012001c) 0x13000f)) (.bin (.leaf8 (h240 0x20000 + 0x10000000001000000000200000000110000000000001d) 0x120023 0x12000d 0x14000e + 0x10000000008000000000100000000020000000002001c 0x2000f 0x160000000000001d 0x80000000002000b) + (.leaf8 0x1400000000130016 0x90016 0x3000000000d001a 0xe000000000d0016 0x30016 0x1000000000a001a + 0x90016 0x80014))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x20010 0x10021 + 0x120000000007001a 0x600000000060016 0x50000000004001a 0x500000000040016 0x14 0x70010) (.leaf8 + 0x10021 0x300000000000016 0x660000000001001a 0x3001d + 0x1000000000100000000010000000001000000000000000000000020 0x50010 0x60021 0x17)) (.bin (.leaf8 + 0x1d 0x103c3 (h240 (h240 0x20000 0x3000000000100000000020000000002000000000000000000010000) + 0x500000000010000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000500000000000000000062000000000000000000010020) + 0x5000e (h240 0x10000 0x10000000002000000000100000000070000000003001c) 0x7000f) (.leaf8 + 0x90000000000000000000700000000000000000001001e 0x60023 0x6000d + 0xa00000000000000000004000000000100000000010020 0xb000000000000000000080000000003001f + 0x100000000090023 0xc00000000000000000011000000000200000000000020 0xa000e))) (.bin (.bin (.leaf8 + 0xf0000000000000000000200000000040000000000001e 0x100000000030023 + 0x1100000000000000000000000000000300000000000020 0x12000000000000000000020000000001001f (h240 + 0x10000 0x3000000000100000000000000000001000000000f0000000003001c) 0xf000f + 0x140000000000000000000f00000000070000000001001e 0xe0023) (.leaf8 0xe000d + 0x1500000000000000000002000000000400000000010020 0x16000000000000000000020000000005001f (h240 + 0x10000 0x300000000010000000000000000000100000000150000000003001c) 0x15000f + 0x1800000000000000000015000000000b0000000001001e 0x140023 0x14000d)) (.bin (.leaf8 + 0x190000000000000000000a0000000000001f 0x16000000000a000b 0x30014 0x180010 0x10021 + 0x10000000010001a 0x1000000000100016 0x30014) (.leaf8 0x120010 0x10021 0xc0016 0xb00000000010016 + 0x8000000000a001a 0xb000000000a0016 0x90014 0xd0010)))) (.bin (.bin (.bin (.leaf8 0x10021 + 0x20000000007001a 0x800000000070016 0x16 0x330000000004001a 0x30016 0x20014 0x20010) (.leaf8 + 0x10021 0x10000000001001a 0x3001d 0x1000000000100000000010000000000000000000000000000000020 + 0x4000e (h240 0x1000000000200000000010000 + 0x200000000020000000001000000000200000000000000000000001e) 0x100000000030023 + 0x2000000000600000000010000000032000000000100000000000020)) (.bin (.leaf8 0x2000e + 0x10000000000000000000100000000090000000002001c 0x9000f + 0x2000000000a0000000001000000000900000000030000000001001e 0x80023 0x8000d + 0x2000000000b00000000010000000001000000000200000000010020 0xb000e) (.leaf8 + 0x2000000000c0000000001000000000d00000000050000000000001e 0xc0023 0xc000d + 0x2000000000d00000000010000000007000000000300000000010020 + 0x2000000000e0000000001000000000d0000000000001f 0xc0023 0xc000d + 0x2000000000f000000000100000000020000000007001f))) (.bin (.bin (.leaf8 (h240 + 0x1000000000300000000010000 0x10000000005000000000100000000120000000004001c) 0x12000f + 0x200000000120000000001000000001200000000080000000001001e 0x110023 0x11000d + 0x2000000001300000000010000000000000000000500000000010020 0x5000e + 0x200000000150000000001000000001800000000040000000000001e) (.leaf8 0x18000a 0x60008 0x10009 + 0x10021 0x1300000000130016 0x30016 0xe00000000010016 0x4000000000d001a)) (.bin (.leaf8 + 0xc000000000c0016 0x1000000000a001a 0x80016 0x900000000010016 0x180000000007001a 0x800000000070016 + 0x30014 0xa0010) (.leaf8 0x10021 0x10000000003001a 0x14 0x70010 0x10021 0x300000000000016 + 0x840000000001001a 0x200000000010016))))) (.bin (.bin (.bin (.bin (.leaf8 0x10019 + 0x10000000000001d 0xf 0x10000000000001d 0x103c3 (h240 0x1d0000000000000000000100000000010000 + 0x200000000000000000000000000000400000000000000000000001e) 0x30023 0x3000d) (.leaf8 + 0x300000000000000000083000000000000000000010020 0x5000e (h240 0x10000 + 0x10000000002000000000100000000070000000003001c) 0x7000f 0x60000000000001d (h240 + 0x1000000000800000000010000 0x100000000050000000001000000000a0000000004001c) 0xa000f + 0x90000000000000000000a00000000020000000001001e)) (.bin (.leaf8 0x90023 0x9000d + 0xa00000000000000000017000000000200000000010020 0xb0000000000000000000b0000000000001f 0xa0023 + 0xa000d 0xb000000000000000000020000000004001f 0x100000000020023) (.leaf8 + 0xd00000000000000000000000000000300000000000020 0xe0000000000000000000e0000000007001f + 0x1000000000f0023 0x1000000000000000000003000000000400000000000020 + 0x12000000000000000000100000000000001f 0xf0023 0xf000d 0x13000000000000000000020000000001001f))) + (.bin (.bin (.leaf8 (h240 0x10000 0x300000000010000000000000000000100000000140000000003001c) + 0x14000f 0x1500000000000000000014000000000b0000000001001e 0x130023 0x13000d 0x7000e + 0x1700000000000000000001000000000e0000000000001e 0x1000a) (.leaf8 0x80008 0x10009 0x10021 0x130016 + 0x1100000000010016 0x10000000010001a 0x1100000000100016 0xf0014)) (.bin (.leaf8 0x130010 0x10021 + 0xc0016 0x20014 0x20010 0x10021 0xc000000000a001a 0xb000000000a0016) (.leaf8 0x30016 + 0x200000000060016 0x60014 0x40010 0x10021 0x420000000004001a 0x100000000030016 0x14)))) (.bin + (.bin (.bin (.leaf8 0x20000000000000000000100000000030000000001001f 0x100000000040023 + 0x2000000000300000000010000000041000000000100000000000020 0x8000e + 0x200000000050000000001000000000400000000020000000000001e (h240 0x10000 + 0x500000000010000000000000000000100000000010000000003001c) 0x1000f + 0x200000000070000000001000000000100000000000000000001001e) (.leaf8 (h240 0x10000 + 0x2000000000100000000000000000001000000000c0000000003001c) 0xc000f + 0x200000000090000000001000000000c00000000050000000001001e 0xb0023 0xb000d + 0x2000000000a0000000001000000000b000000000300000000010020 0x4000e + 0x2000000000c0000000001000000000200000000060000000000001e)) (.bin (.leaf8 (h240 + 0x1000000000300000000010000 0x10000000011000000000100000000130000000004001c) 0x13000f + 0x2000000000f0000000001000000001300000000080000000001001e 0x120023 0x12000d + 0x2000000001000000000010000000000000000000500000000010020 + 0x20000000011000000000100000000130000000000001f 0x120023) (.leaf8 0x12000d + 0x2000000001200000000010000000002000000000c001f 0x10023 0x1000d 0x9000e 0xa0000000001000b + 0x1400000000010016 0x1400000000130016))) (.bin (.bin (.leaf8 0xf0016 0x500000000010016 + 0x6000000000d001a 0xb0016 0x16 0x900000000030016 0x200000000007001a 0x800000000070016) (.leaf8 + 0x40014 0xa0010 0x10021 0xa90000000001001a 0x13 0x8 0x100000000020023 + 0x1000000000200000000010000000014000000000000000000000020)) (.bin (.leaf8 (h240 0x100000000000000 + 0x1000000000600000000000000000093000000000000000000010020) 0x6000e + 0x80000000000000000000a00000000030000000000001e 0x90023 0x9000d + 0x90000000000000000001f000000000200000000010020 0xa0000000000000000000b0000000001001f (h240 + 0x1000000000c0000000001000000000000000000010000 + 0x200000000010000000000000000000100000000010000000005001c)) (.leaf8 0x1000f + 0xd0000000000000000000100000000050000000001001e 0x100000000010023 + 0xf00000000000000000005000000000400000000000020 0x11000000000000000000070000000000001f 0x60023 + 0x6000d 0x12000000000000000000020000000009001f)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 (h240 + 0x10000 0x300000000010000000000000000000100000000150000000003001c) 0x15000f + 0x1400000000000000000015000000000b0000000001001e 0x140023 0x14000d + 0x15000000000000000000160000000000001f 0x150023 0x15000d) (.leaf8 0xb000e 0x20186 0x10043 0xc0142 + 0x101c3 0xd0023 0x1e00c6 0x10043)) (.bin (.leaf8 0x10303 0x10009 0x170008 0x10009 0x10021 0x140016 + 0x800000000010016 0x20000000010001a) (.leaf8 0x1100000000100016 0x14 + 0x1000000000300000000130000000000001f 0x130009 0x30021 0x16 0x10000000000a001a + 0xb000000000a0016))) (.bin (.bin (.leaf8 0x600000000050016 0x530000000004001a 0x500000000040016 + 0x20014 0x70010 0x10021 0x300000000000016 0x90000000001001a) (.leaf8 0x200000000010016 0x14 + 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x2000000000200000000010000000008000000000000000000010020 0x5000e (h240 0x10000 + 0x10000000004000000000100000000070000000003001c))) (.bin (.leaf8 0x7000f + 0x200000000050000000001000000000700000000000000000001001e 0x60023 0x6000d + 0x2000000000600000000010000000052000000000100000000010020 + 0x20000000007000000000100000000080000000002001f (h240 0x10000 + 0x8000000000200000000000000000001000000000c0000000003001c) 0xc000f) (.leaf8 + 0x200000000090000000001000000000c00000000050000000001001e 0xb0023 0xb000d + 0x2000000000a0000000001000000000f000000000300000000010020 0x2000e (h240 + 0x100000000000000000001000000000100000000020000 0x10000000002000000000100000000130000000005001c) + 0x13000f 0x200000000100000000001000000001300000000070000000001001e)))) (.bin (.bin (.bin (.leaf8 + 0x120023 0x12000d 0x20000000011000000000100000000140000000006001f 0x140009 0x120021 0x17 0x1d + 0x103c3) (.leaf8 (h240 (h240 (h240 (h240 (h240 (h240 0x1900000 + 0x300000000010000000005000000000a000000000600000000010000) + 0x100000000040000000001000000000800000000530000) + 0x9000000000100000000080000000002000000000000000000010000) + 0xd0000000010000000000f0000000001000000000300000000010000) + 0x100000000010000000002000000000000000000010000) + 0x200000000010000000014000000000100000000140000000012001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000110000000000000000001400000000010000000001001e) + 0x130023 0x13000d 0x1400000000000000000000000000000500000000010020 + 0x140000000000000000000a0000000000001f 0x90023)) (.bin (.leaf8 0x9000d + 0x1500000000000000000002000000000c001f (h240 0x1000000000200000000020000 + 0x10000000018000000000100000000010000000004001c) 0x1000f + 0x180000000000000000000100000000050000000001001e 0x1000a 0x180008 + 0x1900000000000000000001000000000100000000000000000000001e) (.leaf8 0x1a0000000001000b 0x13 + 0x20008 (h240 0x10000 0x2000000000100000000000000000001000000001b0000000003001c) 0x20186 0x10043 + 0x1b0142 0x101c3))) (.bin (.bin (.leaf8 0x1c0023 0x3c00c6 0x10043 0x10303 0x10009 0x8 0x10009 + 0x10021) (.leaf8 0x300000000000016 0xb00000000010019 0x140000000000001d 0x90023 + 0x300000000000000000001009c 0x50003 (h240 0x10000 0x10000000001000000000100000000010000000003001c) + 0x1000f)) (.bin (.leaf8 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x4a0000000000000000000100000000010000 + 0x190000000000300000000010000000005000000000a00000000060000) + 0x1000000000000000000010000000004000000000100000000080000) + 0x53000000000900000000010000000008000000000200000000000000) + 0x1000000000d0000000010000000000f000000000100000000030000) + 0x1000000000000000000010000000001000000000200000000000000) + 0x1000000000200000000010000000014000000000200000000150000) + 0x1000000000a00000000020000000000000000000100000000050000) + 0x17000000000200000000000000000001000000000f0000000001001e) 0x1000a 0x10008 (h240 0x50000 + 0x200000000000000000002000000000100000000000000000000001e) 0x30000000001000b 0x50013 0x8 (h240 + 0xa0000 0x100000000000000000002000000000100000000000000000000001e)) (.leaf8 0x10009 0x20021 + 0x10000000013001a 0x200000000120016 0x14 0x1000000000300000000040000000000001f 0x40009 + 0x30021))))) (.bin (.bin (.bin (.bin (.leaf8 0xf00000000010016 0x7000000000d001a 0xd000000000d0016 + 0x14 0xf0010 0x10021 0x900000000060016 0x290000000007001a) (.leaf8 0x400000000060016 0x60014 + 0x60010 0x10021 0x40000000004001a 0x500000000040016 0xc80000000001001a 0x3001d)) (.bin (.leaf8 + 0x1000000000100000000010000000034000000000000000000000020 0x50010 0x60021 0x17 0x1d 0x103c3 (h240 + (h240 0x350000 0x3000000000100000000020000000002000000000000000000010000) + 0x500000000340000000006000000000100000000040000000006001c) 0x4000d) (.leaf8 (h240 + 0x20000000000000000000100000000010000 0x2000000000500000000000000000091000000000000000000010020) + 0x7000000000000000000070000000002001f 0x60023 0x6000d + 0x800000000000000000003000000000100000000010020 0x8000e + 0x90000000000000000000600000000020000000000001e 0x100000000070023))) (.bin (.bin (.leaf8 + 0xb00000000000000000028000000000200000000000020 0xd0000000000000000000b0000000003001f (h240 + 0x1000000000c00000000010000 0x100000000020000000001000000000f0000000004001c) 0xf000f + 0xf0000000000000000000f00000000060000000001001e 0xe0023 0xe000d + 0x1000000000000000000006000000000400000000010020) (.leaf8 0x11000000000000000000110000000000001f + 0x100023 0x10000d 0x1000e (h240 0x20000 0x10000000002000000000100000000040000000003001c) 0x4000f + 0x140000000000000000000400000000080000000001001e 0x100000000050023)) (.bin (.leaf8 + 0x1600000000000000000000000000000600000000000020 0xc000e + 0x10000000002000000000100000000010000000002001c 0x1000f 0x190000000000001d (h240 0x10000 + 0x100000000020000000000000000000100000000040000000003001c) 0x20186 0x10043) (.leaf8 0x40142 + 0x101c3 0x50023 0xe00c6 0x10043 0x10303 0x10009 0x8)))) (.bin (.bin (.bin (.leaf8 (h240 0x10000 + 0x100000000000000000002000000000100000000000000000000001e) 0x10009 0x20021 0xd00000000000016 + 0x150016 0x200000000030016 0x14 0x40010) (.leaf8 0x10021 0x1200000000000016 0x30000000010001a + 0x1000000000100016 0x16 0x14000000000a001a 0xb000000000a0016 0x70014)) (.bin (.leaf8 0xd0010 + 0x10021 0x20000000007001a 0x800000000070016 0x630000000004001a 0x500000000040016 0x14 0x70010) + (.leaf8 0x10021 0x300000000000016 0x1a0000000001001a 0x3001d + 0x1000000000100000000010000000019000000000000000000000020 0x5000e (h240 0x10000 + 0x10000000002000000000100000000070000000003001c) 0x7000f))) (.bin (.bin (.leaf8 + 0x200000000070000000001000000000700000000000000000001001e 0x60023 0x6000d + 0x2000000000800000000010000000062000000000100000000010020 + 0x200000000090000000001000000000a0000000004001f 0x90023 0x9000d + 0x2000000000a00000000010000000001000000000200000000010020) (.leaf8 0x9000e + 0x2000000000c0000000001000000000d00000000050000000000001e 0xc0023 0xc000d + 0x2000000000d00000000010000000010000000000300000000010020 + 0x2000000000e0000000001000000000e0000000003001f 0xe0009 0xf0021)) (.bin (.leaf8 0x17 0x1d 0x103c3 + (h240 (h240 (h240 (h240 (h240 0x1d50000 0x3000000000100000000020000000002000000000000000000010000) + 0x5000000001a00000000060000000001000000000000000000010000) + 0x2000000000100000000080000000063000000000900000000010000) + 0xb0000000002000000000c0000000001000000000a00000000010000) + 0xe0000000011000000000f0000000001000000000e000000000f001c) 0xe000f (h240 + 0x20000000000000000000100000000010000 0x2000000000e0000000000000000000e00000000000000000001001e) + 0xd0023 0xd000d) (.leaf8 0x1000000000000000000001000000000300000000010020 0x2000e + 0x10000000000000000000100000000110000000002001c 0x11000f + 0x120000000000000000001100000000090000000001001e 0x100023 0x10000d + 0x1300000000000000000002000000000500000000010020))))))))) (.bin (.bin (.bin (.bin (.bin (.bin + (.bin (.bin (.leaf8 0x14000e (h240 0x10000 0x10000000002000000000100000000040000000003001c) + 0x4000f 0x160000000000001d (h240 0x10000 + 0x500000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1800000000000000000001000000000c0000000001001e (h240 (h240 0x1000000000200000000010000 + 0x1000000000f0000000001000000000000000000010000) + 0x300000000010000000002000000000100000000010000000007001c)) (.leaf8 0x1000f 0x1e0000000000001d + 0x20000000001000b 0x10016 0xd0016 0x16 0x200000000030016 0x150014)) (.bin (.leaf8 0x40010 0x10021 + 0x10000000013001a 0x1200000000130016 0x30014 0x140010 0x10021 0xa000000000d001a) (.leaf8 + 0xa000000000c0016 0x1000000000a001a 0x900000000090016 0x310000000007001a 0x200000000060016 0x60014 + 0x40010 0x10021))) (.bin (.bin (.leaf8 0xc0000000004001a 0x500000000040016 0x14 0x70010 0x10021 + 0x300000000000016 0xea0000000001001a 0x3001d) (.leaf8 + 0x100000000010000000001000000004b000000000000000000000020 0x50010 0x60021 0x17 0x1d 0x103c3 (h240 + (h240 0x4c0000 0x3000000000100000000020000000002000000000000000000010000) + 0x5000000004b0000000006000000000100000000040000000006001c) 0x4000d)) (.bin (.leaf8 (h240 + 0x20000000000000000000100000000010000 0x200000000050000000000000000009c000000000000000000010020) + 0x5000e (h240 0x10000 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x90000000000000000000700000000000000000001001e 0x60023 0x6000d + 0xa0000000000000000000b000000000100000000010020) (.leaf8 0x8000e + 0xb0000000000000000000400000000020000000000001e 0x100000000050023 + 0xd00000000000000000030000000000200000000000020 0xf0000000000000000000b0000000005001f + 0x1000000000c0023 0x1000000000000000000000000000000300000000000020 + 0x110000000000000000000c0000000007001f)))) (.bin (.bin (.bin (.leaf8 0x1000000000d0023 + 0x1300000000000000000009000000000400000000000020 0x5000e + 0x1600000000000000000014000000000b0000000000001e 0x130023 0x13000d + 0x1700000000000000000000000000000600000000010020 0x17000e) (.leaf8 + 0x180000000000000000000400000000000000000000001e (h240 + 0x100000000050000000001000000000000000000010000 + 0x200000000010000000000000000000100000000010000000005001c) 0x1000f + 0x1c0000000000000000000100000000070000000001001e 0x23 0xd 0x1d000000000000000000020000000000001f + 0x10023)) (.bin (.leaf8 0x1000d 0x3000e 0x20186 0x10043 0x40142 0x101c3 0x50023 0xe00c6) (.leaf8 + 0x10043 0x10303 0x10009 0x30008 0x10009 0x10021 0x16 0x16))) (.bin (.bin (.leaf8 + 0x1800000000030016 0x1500000000160016 0x1200000000040016 0x40000000010001a 0xf0016 + 0xe000000000b0016 0xc0014 0x100010) (.leaf8 0x10021 0x18000000000a001a 0x90016 0x900000000030016 + 0x60000000007001a 0x200000000060016 0x60014 0x40010)) (.bin (.leaf8 0x10021 0x740000000004001a + 0x500000000040016 0x14 0x70010 0x10021 0x300000000000016 0x250000000001001a) (.leaf8 + 0x100000000010016 0x14 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x2000000000200000000010000000024000000000000000000010020 0x5000e (h240 0x10000 + 0x10000000002000000000100000000070000000003001c)))))) (.bin (.bin (.bin (.bin (.leaf8 0x7000f + 0x200000000050000000001000000000700000000000000000001001e 0x60023 0x6000d + 0x2000000000600000000010000000073000000000100000000010020 0x8000e + 0x200000000070000000001000000000400000000020000000000001e 0x100000000050023) (.leaf8 + 0x2000000000900000000010000000005000000000200000000000020 + 0x2000000000b0000000001000000000b0000000001001f (h240 0x10000 + 0xc00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x2000000000c0000000001000000000100000000040000000001001e 0x100000000020023 + 0x2000000000e00000000010000000016000000000300000000000020 (h240 0x100000000000000 + 0x1000000001100000000000000000000000000000300000000010020))) (.bin (.leaf8 0xe000e + 0x120000000000000000001000000000050000000000001e (h240 0x10000 + 0x1000000000020000000000000000000100000000010000000003001c) 0x1000f + 0x140000000000000000000100000000080000000001001e 0x100000000020023 + 0x1600000000000000000003000000000500000000000020 0x18000000000000000000140000000002001f) (.leaf8 + 0x130023 0x13000d 0x1800000000000000000017000000000e001f 0x160023 0x16000d + 0x190000000000000000001a0000000001001f (h240 (h240 0x1000000001b0000000001000000000000000000010000 + 0x2000000000100000000000000000001000000000200000000010000) + 0x10000000004000000000100000000010000000008001c) 0x1000f))) (.bin (.bin (.leaf8 + 0x200000000000000000000100000000000000000001001e 0x40000000001000b 0x20014 0x5000e 0x20186 0x10043 + 0x60142 0x101c3) (.leaf8 0x70023 0x1200c6 0x10043 0x10303 0x10009 0x40008 0x10009 0x10021)) (.bin + (.leaf8 0x10019 0x1c0000000000001d 0x2000f 0x1b0000000000001d 0x10023 0x1000d 0x5000e + 0x1d0000000000000000000100000000020000000000001e) (.leaf8 0x1000a 0x60008 0x10009 0x10021 0x10016 + 0x1800000000190016 0x20000000013001a 0x120016)))) (.bin (.bin (.bin (.leaf8 0x16 0x100014 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f 0x30021 0xc000000000d001a 0xc0016) (.leaf8 + 0x16 0x3000000000a001a 0x90016 0x900000000030016 0x3a0000000007001a 0x200000000060016 0x60014 + 0x40010)) (.bin (.leaf8 0x10021 0x120000000004001a 0x400000000040016 0x1270000000001001a 0x16 0x14 + 0x2000e 0x10022) (.leaf8 0x200000000020000000001000000005c000000000000000000000020 (h240 + 0x100000000000000 0x10000000005000000000000000000c9000000000000000000010020) + 0x6000000000000000000060000000002001f 0x50023 0x5000d + 0x700000000000000000011000000000100000000010020 0x8000e + 0x80000000000000000000400000000020000000000001e))) (.bin (.bin (.leaf8 0x100000000050023 + 0xa00000000000000000039000000000200000000000020 0xc0000000000000000000b0000000001001f (h240 + 0x10000 0xc00000000010000000000000000000100000000010000000003001c) 0x1000f + 0xd0000000000000000000100000000040000000001001e 0x100000000020023 + 0xf00000000000000000002000000000300000000000020) (.leaf8 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x130000000000000000000100000000060000000001001e 0x100000000020023 + 0x150000000000000000000b000000000400000000000020 0x12000e (h240 0x10000 + 0x300000000010000000000000000000100000000010000000003001c))) (.bin (.leaf8 0x1000f + 0x1a0000000000000000000100000000090000000001001e 0x100000000020023 + 0x1c00000000000000000001000000000600000000000020 0x1e0000000000000000001a0000000010001f 0x190023 + 0x19000d 0x1f000000000000000000020000000000001f) (.leaf8 0x10023 0x1000d 0x7000e 0x80000000001000b + 0x1b00000000010016 0x1700000000160016 0x20014 + 0x300000000040000000000000000000200000000190000000000001f)))))) (.bin (.bin (.bin (.bin (.bin + (.leaf8 0x190009 0x10021 0x1200000000110016 0x50000000010001a 0xf0016 0x16 0xf00000000010016 + 0xe000000000d0016) (.leaf8 0x20014 0xc00000000040000000000000000000200000000100000000000001f + 0x100009 0x20021 0x1c000000000a001a 0xb000000000a0016 0x50014 0xd0010)) (.bin (.leaf8 0x10021 + 0x90000000007001a 0x700000000070016 0x930000000004001a 0x30016 0x2f0000000001001a 0x16 0x14) + (.leaf8 0x2000e 0x10022 0x200000000020000000001000000002e000000000000000000000020 + 0x20000000004000000000100000000020000000001001f 0x100000000030023 + 0x2000000000600000000010000000092000000000100000000000020 + 0x20000000008000000000100000000090000000004001f 0x80023))) (.bin (.bin (.leaf8 0x8000d + 0x2000000000900000000010000000008000000000200000000010020 0x7000e + 0x2000000000b0000000001000000000d00000000050000000000001e 0xc0023 0xc000d + 0x2000000000c0000000001000000001b000000000300000000010020 0xe000e) (.leaf8 + 0x10000000005000000000100000000100000000002001c 0x10000f + 0x2000000000e0000000001000000001000000000050000000001001e 0xf0023 0xf000d + 0x2000000000f000000000100000000110000000000001f 0x100023 0x10000d)) (.bin (.leaf8 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f 0x200000000120000000001001d (h240 + 0x100000000000000 0x100000000130000000000000000000100000000080000000000001e) 0x100000000020023 + 0x1600000000000000000004000000000500000000000020 0x1800000000000000000014000000000a001f) (.leaf8 + (h240 0x1000000001400000000020000 0x20000000005000000000100000000190000000004001c) 0x19000f + 0x1b00000000000000000019000000000b0000000001001e 0x180023 0x18000d + 0x1c0000000000000000001d0000000000001f 0x1c0023 0x1c000d)))) (.bin (.bin (.bin (.leaf8 0x9000e + 0x20186 0x10043 0xa0142 0x101c3 0xb0023 0x1a00c6 0x10043) (.leaf8 0x10303 0x10009 0x1e0008 0x10009 + 0x10021 0x500000000180016 0x30016 0x140014)) (.bin (.leaf8 0x20010 0x10021 0x20000000013001a + 0x120016 0x16 0x1200000000010016 0x5000000000f0016 0xe000000000d001a) (.leaf8 0xe000000000d0016 + 0xc00000000060016 0x4000000000a001a 0x900000000080016 0x480000000007001a 0x800000000070016 0x30014 + 0xa0010))) (.bin (.bin (.leaf8 0x10021 0x170000000004001a 0x30016 0x1780000000001001a 0x16 0x14 + 0x2000e 0x10022) (.leaf8 0x2000000000200000000010000000057000000000000000000000020 (h240 + 0x100000000000000 0x100000000050000000000000000011f000000000000000000010020) + 0x6000000000000000000020000000001001f 0x100000000030023 + 0x800000000000000000016000000000100000000000020 0x5000e + 0xb0000000000000000000a00000000030000000000001e 0x90023)) (.bin (.leaf8 0x9000d + 0xc00000000000000000047000000000200000000010020 0xd0000000000000000000b0000000004001f + 0x1000000000b0023 0xf00000000000000000003000000000300000000000020 + 0x110000000000000000000e0000000003001f (h240 0x10000 + 0xf000000000100000000000000000001000000000f0000000003001c) 0xf000f) (.leaf8 + 0x120000000000000000000f00000000070000000001001e 0xe0023 0xe000d + 0x130000000000000000000d000000000400000000010020 0x14000000000000000000070000000009001f (h240 + 0x10000 0x800000000010000000000000000000100000000130000000003001c) 0x13000f + 0x160000000000001d))))) (.bin (.bin (.bin (.bin (.leaf8 0x120023 0x12000d 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x1900000000000000000001000000000a0000000001001e 0x100000000020023 + 0x1b00000000000000000001000000000600000000000020) (.leaf8 0x16000e + 0x1e0000000000000000000200000000000000000000001e (h240 0x10000 + 0x300000000010000000000000000000100000000060000000003001c) 0x6000f + 0x2000000000000000000006000000000e0000000001001e (h240 0x1000000000700000000010000 + 0x1000000001f000000000100000000010000000004001c) 0x1000f + 0x230000000000000000000100000000040000000001001e)) (.bin (.leaf8 0x1f0000000001000b 0x70014 + 0x20000e 0x20186 0x10043 0x210142 0x101c3 0x220023) (.leaf8 0x4800c6 0x10043 0x10303 0x10009 + 0x90008 0x10009 0x10021 0x10019))) (.bin (.bin (.leaf8 0x1f0000000000001d 0x3000f + 0x1e0000000000001d 0x20023 0x2000d 0xa000e 0x200000000000000000000100000000140000000000001e + 0x1000a) (.leaf8 0xb0008 0x10009 0x10021 0x1700000000020016 0x1700000000160016 0x20014 + 0x300000000040000000000000000000200000000190000000000001f 0x190009)) (.bin (.leaf8 0x10021 + 0x120016 0x1200000000060016 0x60000000010001a 0x1000000000100016 0xf0014 0x120010 0x10021) (.leaf8 + 0x1000000000d001a 0xe000000000d0016 0x14 0x100010 0x10021 0xc00000000090016 0x23000000000a001a + 0xb000000000a0016)))) (.bin (.bin (.bin (.leaf8 0x900000000040016 0xa0000000007001a + 0x800000000070016 0x30014 0xa0010 0x10021 0xbb0000000004001a 0x500000000040016) (.leaf8 0x30014 + 0x70010 0x10021 0x2c0000000001001a 0x16 0x14 0x2000e 0x10022)) (.bin (.leaf8 + 0x200000000020000000001000000002b000000000000000000000020 0x5000e + 0x200000000040000000001000000000700000000010000000000001e 0x60023 0x6000d + 0x20000000005000000000100000000ba000000000100000000010020 0x5000e + 0x200000000070000000001000000000a00000000030000000000001e) (.leaf8 0x90023 0x9000d + 0x2000000000800000000010000000009000000000200000000010020 + 0x200000000090000000001000000000b0000000002001f 0xa0023 0xa000d + 0x200000000090000000001000000000d0000000006001f 0xc0023))) (.bin (.bin (.leaf8 0xc000d + 0x2000000000a00000000010000000022000000000300000000010020 + 0x2000000000b0000000001000000000e0000000005001f (h240 0x1000000000f00000000010000 + 0x10000000002000000000100000000100000000004001c) 0x10000f + 0x2000000000d0000000001000000001000000000060000000001001e 0xf0023 0xf000d) (.leaf8 + 0x2000000000e00000000010000000000000000000400000000010020 0x11000e + 0x2000000000f0000000001000000001200000000090000000000001e 0x110023 0x11000d + 0x2000000001000000000010000000002000000000500000000010020 + 0x20000000011000000000100000000140000000006001f (h240 0x100000000000000 + 0x100000000120000000000000000001400000000030000000000001e))) (.bin (.leaf8 0x130023 0x13000d + 0x1300000000000000000001000000000500000000010020 0x13000000000000000000140000000003001f (h240 + 0x10000 0x1500000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1400000000000000000001000000000a0000000001001e (h240 0x1000000000200000000010000 + 0x20000000005000000000100000000190000000004001c)) (.leaf8 0x19000f + 0x1700000000000000000019000000000b0000000001001e 0x180023 0x18000d + 0x18000000000000000000190000000000001f (h240 0x1000000001900000000020000 + 0x1000000000c000000000100000000010000000004001c) 0x600c6 0x10043))))))) (.bin (.bin (.bin (.bin + (.bin (.bin (.leaf8 0xc0142 0x101c3 0xd0009 0x14 0xd000e 0x20186 0x10043 0xe0142) (.leaf8 0x101c3 + 0xf0023 0x2200c6 0x10043 0x10303 0x10009 0x20008 0x10009)) (.bin (.leaf8 0x10021 + 0x1900000000010019 0x180000000000001d 0x170023 (h240 0x20000 + 0x10000000003000000000100000000010000000003009c) 0x1000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 0x7300000000000000 0x1000000000200000003de0000000003000000000100000000000000) + 0x10000000005000000002c0000000006000000000100000000080000) + 0xbb0000000009000000000100000000060000000001000000000b0000) + 0xb000000000c0000000001000000000e0000000024000000000f0000) + 0x1000000000000000000010000000002000000000100000000110000) + 0x2000000001200000000010000000013000000000700000000150000) + 0x1000000000000000000010000000002000000000100000000000000) + 0x200000000050000000001000000001a000000000100000000180000) + 0x1900000000020000000000000000000100000000070000000001001e) 0x30000000000000b) (.leaf8 0x14 + 0x3000e 0xc00c6 0x10043 0x20142 0x101c3 0x30009 0x1800000000010019))) (.bin (.bin (.leaf8 + 0x180000000000001d 0x160023 0x300000000000000000001009c 0x30003 0x3000f (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 0x8700000000000000 + 0x1000000000200000003de0000000003000000000100000000000000) + 0x10000000005000000002c0000000006000000000100000000080000) + 0xbb0000000009000000000100000000060000000001000000000b0000) + 0xb000000000c0000000001000000000e0000000024000000000f0000) + 0x1000000000000000000010000000002000000000100000000110000) + 0x2000000001200000000010000000013000000000700000000150000) + 0x1000000000000000000010000000002000000000100000000000000) + 0x200000000050000000001000000001a000000000100000000170000) + 0x1900000000010000000000000000000300000000000000000001001e) 0x3000a 0x8) (.leaf8 (h240 0x170000 + 0x100000000000000000002000000000100000000000000000000001e) 0x10009 0x20021 0x500000000180016 + 0x30016 0x16 0x30000000013001a 0x1300000000130016)) (.bin (.leaf8 0x10000000010001a + 0x2000000000f0016 0xf0014 0x40010 0x10021 0x11000000000d001a 0xe000000000d0016 0x5000000000a001a) + (.leaf8 0xb000000000a0016 0x900000000040016 0x5d0000000007001a 0x600000000060016 + 0x150000000004001a 0x500000000040016 0x30014 0x70010)))) (.bin (.bin (.bin (.leaf8 0x10021 + 0x1ee0000000001001a 0x200000000010016 0x14 0x20000000000000000000100000000040000000000001f 0x30023 + 0x3000d 0x2000000000200000000010000000042000000000000000000010020) (.leaf8 0x50010 0x40021 0x17 + 0x1d 0x103c3 (h240 0x45000000000300000000010000 + 0x500000000430000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x20000000003000000000000000001a9000000000000000000010020))) + (.bin (.leaf8 0x5000e 0x50000000000000000000700000000010000000000001e 0x60023 0x6000d + 0x600000000000000000014000000000100000000010020 0x7000000000000000000080000000003001f + 0x100000000090023 0x80000000000000000005c000000000200000000000020) (.leaf8 + 0xa0000000000000000000b0000000002001f 0xa0023 0xa000d 0xa0000000000000000000d0000000006001f + 0xc0023 0xc000d 0xb00000000000000000004000000000300000000010020 + 0xc000000000000000000100000000008001f))) (.bin (.bin (.leaf8 0xf0023 0xf000d + 0xd00000000000000000010000000000400000000010020 0x11000e + 0xe0000000000000000000400000000080000000000001e 0x100000000050023 + 0x1000000000000000000000000000000500000000000020 0x1100000000000000000015000000000c001f) (.leaf8 + 0x140023 0x14000d 0x1200000000000000000002000000000600000000010020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x150000000000000000000100000000000000000001001e (h240 0x10000 + 0x200000000010000000000000000000100000000060000000003001c))) (.bin (.leaf8 0x6000f + 0x1700000000000000000006000000000e0000000001001e (h240 + 0x100000000070000000001000000000000000000010000 + 0x1900000000010000000002000000000100000000010000000005001c) 0x20186 0x10043 0x10142 0x101c3 + 0x20023) (.leaf8 0x800c6 0x10043 0x10303 0x10009 0x20008 0x10009 0x10021 0x170016))))) (.bin (.bin + (.bin (.bin (.leaf8 0x50016 0x16 0x1800000000010016 0x10000000016001a 0x1400000000140016 0x50014 + 0x160010 0x10021) (.leaf8 0x90000000010001a 0xf000000000f0016 0x2000000000d001a 0xc000000000c0016 + 0x2e000000000a001a 0x90016 0xb0000000007001a 0x600000000060016)) (.bin (.leaf8 0xf70000000004001a + 0x300000000030016 0x220000000001001a 0x3001d + 0x1000000000100000000010000000021000000000000000000000020 + 0x20000000005000000000100000000050000000001001f 0x100000000060023 + 0x20000000006000000000100000000f6000000000100000000000020) (.leaf8 + 0x20000000008000000000100000000080000000003001f 0x100000000090023 + 0x200000000090000000001000000000a000000000200000000000020 + 0x2000000000b000000000100000000020000000005001f 0x100000000030023 + 0x2000000000d0000000001000000002d000000000300000000000020 + 0x2000000000f0000000001000000000e0000000007001f 0x1000000000f0023))) (.bin (.bin (.leaf8 + 0x2000000001000000000010000000001000000000400000000000020 + 0x20000000012000000000100000000110000000009001f 0x100000000120023 + 0x2000000001300000000010000000004000000000500000000000020 + 0x20000000015000000000100000000140000000001001f 0x140009 0x160021 0x17) (.leaf8 0x1d 0x103c3 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 0x4e9000000000300000000010000 + 0x2000000000200000000000000000001000000000500000000220000) + 0x6000000000100000000000000000001000000000800000000f70000) + 0x9000000000100000000000000000001000000000b000000000a0000) + 0xc000000000100000000030000000001000000000000000000010000) + 0xe000000002e000000000f0000000001000000000000000000010000) + 0x11000000000200000000120000000001000000000000000000010000) + 0x1400000000040000000015000000000100000000140000000016001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000150000000000000000001400000000060000000001001e) + 0x130023 0x13000d 0x1700000000000000000002000000000500000000010020)) (.bin (.leaf8 0x7000e + 0x1800000000000000000016000000000b0000000000001e 0x100000000160023 + 0x1a00000000000000000000000000000700000000000020 0x1b0000000000000000001a0000000000001f 0x190023 + 0x19000d 0x2000e) (.leaf8 0x10000000000000000000100000000010000000002001c 0x1000f + 0x1e0000000000000000000100000000010000000001001e (h240 0x10000 + 0x100000000020000000000000000000100000000010000000003001c) 0x1000f + 0x2000000000000000000001000000000d0000000001001e (h240 0x1000000000100000000020000 + 0x10000000003000000000100000000010000000004001c) 0x600c6)))) (.bin (.bin (.bin (.leaf8 0x10043 + 0x30142 0x101c3 0x40009 0x14 0x4000e 0x20186 0x10043) (.leaf8 0x50142 0x101c3 0x60023 0x1000c6 + 0x10043 0x10303 0x10009 0x20008)) (.bin (.leaf8 0x10009 0x10021 0x100000000010019 + 0x200000000000001d (h240 0x20000 0x10000000003000000000100000000010000000003015c) 0x1000f (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0xb20000000000000000000100000000010000 + 0x4e9000000000300000000010000000002000000000200000000000000) + 0x1000000000500000000220000000006000000000100000000000000) + 0x1000000000800000000f70000000009000000000100000000000000) + 0x1000000000b000000000a000000000c000000000100000000030000) + 0x100000000000000000001000000000e000000002e000000000f0000) + 0x1000000000000000000010000000011000000000200000000120000) + 0x1000000000000000000010000000014000000000800000000150000) + 0x1000000000800000000010000000016000000000200000000000000) + 0x1000000001a0000000001000000001b000000000100000000030000) + 0x1000000000000000000010000000001000000000300000000000000) + 0x2000000000020000000000000000000100000000010000000001001e) 0x30000000000000b) (.leaf8 0x14 + 0x3000e 0xc00c6 0x10043 0x20142 0x101c3 0x30009 0x10186))) (.bin (.bin (.leaf8 0x200000000000001d + 0xf 0x200000000000001d 0x103c3 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0xbc00000000000000000001000000000100000004e900000000030000 + 0x1000000000200000000020000000000000000000100000000050000) + 0x22000000000600000000010000000000000000000100000000080000) + 0xf70000000009000000000100000000000000000001000000000b0000) + 0xa000000000c00000000010000000003000000000100000000000000) + 0x1000000000e000000002e000000000f000000000100000000000000) + 0x1000000001100000000020000000012000000000100000000000000) + 0x1000000001400000000080000000015000000000100000000080000) + 0x10000000016000000000200000000000000000001000000001a0000) + 0x1000000001b00000000010000000003000000000100000000000000) + 0x1000000000100000000010000000000000000000100000000010000) + 0x2100000000000000000000000000000400000000010000000000001e) 0x4000a 0x10008 (h240 0x10000 + 0x200000000000000000002000000000100000000000000000000001e)) (.leaf8 (h240 + 0x10000000003000000000100000000030000 0x300000000000000000002000000000100000000000000000000001e) + 0x10009 0x30021 0x1a00000000190016 0x14 0x1c0010 0x10021 0x800000000140016)) (.bin (.leaf8 + 0x40000000013001a 0x120016 0x10000000010001a 0xf0016 0x17000000000d001a 0xc0016 0xc00000000010016 + 0x4000000000a001a) (.leaf8 0xb000000000a0016 0x90014 0xd0010 0x10021 0x7b0000000007001a 0x60016 + 0x110000000004001a 0x30016)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 0x20014 0x20010 0x10021 + 0x2740000000001001a 0x100000000010016 0x14 0x20000000000000000000100000000030000000000001f + 0x20023) (.leaf8 0x2000d 0x200000000020000000001000000005d000000000000000000010020 (h240 + 0x100000000000000 0x1000000000400000000000000000215000000000000000000010020) 0x4000e + 0x60000000000000000000200000000000000000000001e 0x100000000030023 + 0x800000000000000000010000000000100000000000020 0xa000000000000000000020000000003001f)) (.bin + (.leaf8 0x100000000030023 0xc0000000000000000007a000000000200000000000020 0xb000e + 0xe0000000000000000000d00000000050000000000001e 0xc0023 0xc000d + 0xf00000000000000000003000000000300000000010020 0x100000000000000000000e0000000000001f) (.leaf8 + 0xd0023 0xd000d 0x10000000000000000000020000000007001f 0x100000000030023 + 0x1200000000000000000016000000000400000000000020 0x14000000000000000000020000000009001f + 0x100000000030023 0x1600000000000000000000000000000500000000000020))) (.bin (.bin (.leaf8 + 0x1700000000000000000002000000000b001f 0x100000000030023 + 0x1900000000000000000003000000000600000000000020 0x1b0000000000000000000a000000000c001f (h240 + 0x1000000000a00000000020000 0x100000000020000000001000000001c0000000004001c) 0x1c000f + 0x1e0000000000000000001c000000000e0000000001001e 0x1b0023) (.leaf8 0x1b000d 0x5000e (h240 0x10000 + 0x400000000010000000003000000000100000000010000000003001c) 0x600c6 0x10043 0x30142 0x101c3 + 0x40009)) (.bin (.leaf8 0x600000000020016 0x2000000001b0016 0x14 0x40010 0x10021 + 0x1800000000080016 0x10000000016001a 0x150016) (.leaf8 0x1400000000010016 0x30014 0x160010 0x10021 + 0xb0000000010001a 0xf0016 0xf00000000010016 0x2000000000d001a)))) (.bin (.bin (.bin (.leaf8 + 0xc000000000c0016 0x3d000000000a001a 0x90016 0x900000000010016 0x70000000007001a 0x800000000070016 + 0x30014 0xa0010) (.leaf8 0x10021 0x600000000030016 0x1390000000004001a 0x400000000040016 + 0x2f0000000001001a 0x200000000010016 0x14 0x20000000000000000000100000000040000000000001f)) (.bin + (.leaf8 0x30023 0x3000d 0x200000000020000000001000000002e000000000000000000010020 + 0x20000000003000000000100000000060000000002001f 0x50023 0x5000d + 0x2000000000400000000010000000138000000000100000000010020 + 0x20000000005000000000100000000080000000001001f) (.leaf8 (h240 0x1000000000900000000010000 + 0x100000000050000000001000000000a0000000004001c) 0xa000f + 0x200000000070000000001000000000a00000000020000000001001e 0x90023 0x9000d + 0x2000000000800000000010000000006000000000200000000010020 + 0x200000000090000000001000000000b0000000000001f 0xa0023))) (.bin (.bin (.leaf8 0xa000d + 0x20000000009000000000100000000020000000005001f 0x100000000030023 + 0x2000000000b0000000001000000003c000000000300000000000020 + 0x2000000000d0000000001000000000e0000000007001f 0x1000000000f0023 + 0x2000000000e00000000010000000001000000000400000000000020 + 0x20000000010000000000100000000110000000000001f) (.leaf8 0x100023 0x10000d + 0x20000000010000000000100000000020000000009001f 0x100000000030023 + 0x2000000001200000000010000000005000000000500000000000020 0x140010 0x150021 0x17)) (.bin (.leaf8 + 0x1d 0x103c3 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x6210000 + 0x300000000010000000005000000002f000000000600000000010000) + 0x7000000013a00000000090000000001000000000000000000010000) + 0x50000000001000000000b0000000008000000000c00000000010000) + 0x3000000000100000000000000000001000000000e000000003d0000) + 0xf000000000100000000000000000001000000001100000000020000) + 0x12000000000100000000030000000001000000000000000000010000) + 0x1400000000050000000015000000000100000000140000000015001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000140000000000000000001400000000080000000001001e) + 0x130023 0x13000d 0x1600000000000000000003000000000500000000010020) (.leaf8 0x5000e 0x150023 + 0x15000d 0x1800000000000000000002000000000d001f 0x100000000030023 + 0x1a00000000000000000000000000000700000000000020 0x1b0000000000000000001a0000000004001f (h240 + 0x1000000001a00000000020000 0x10000000002000000000100000000040000000004001c)))))) (.bin (.bin + (.bin (.bin (.leaf8 0x4000f 0x1d00000000000000000004000000000f0000000001001e (h240 0x10000 + 0x500000000010000000000000000000100000000070000000003001c) 0x7000f 0x1f0000000000001d (h240 + 0x10000 0x700000000020000000000000000000100000000040000000003001c) 0x20186 0x10043) (.leaf8 + 0x40142 0x101c3 0x50023 0xe00c6 0x10043 0x10303 0x10009 0x8)) (.bin (.leaf8 (h240 0x70000 + 0x100000000000000000002000000000100000000000000000000001e) (h240 0x50000 + 0x900000000010000000002000000000100000000000000000000001e) 0x10009 0x30021 0x16 0x1a0014 0x2000e + (h240 0x100000000000000000001000000000700000000010000 + 0xa00000000010000000002000000000100000000010000000005001c)) (.leaf8 0x600c6 0x10043 0x20142 + 0x101c3 0x30009 0x700000000080016 0x30014 0x90010))) (.bin (.bin (.leaf8 0x10021 0x1a0013 0x1a0008 + (h240 0x30000 0x1b00000000000000000002000000000100000000000000000000001e) 0x10009 0x20021 + 0x600000000150016 0x50000000013001a) (.leaf8 0x120016 0x1200000000010016 0x1100000000100016 + 0xf0014 0x130010 0x10021 0x1e000000000d001a 0xc0016)) (.bin (.leaf8 0xc00000000010016 + 0x3000000000a001a 0xb000000000a0016 0x30016 0x9d0000000007001a 0x600000000050016 + 0x170000000004001a 0x300000000030016) (.leaf8 0x3100000000001001a 0x3001d + 0x1000000000100000000010000000069000000000000000000000020 0x50010 0x60021 0x17 0x1d 0x103c3)))) + (.bin (.bin (.bin (.leaf8 (h240 (h240 0x6a0000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x500000000690000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x20000000005000000000000000002a4000000000000000000010020) + 0x7000000000000000000050000000001001f 0x100000000060023 + 0x800000000000000000016000000000100000000000020 0xa000000000000000000080000000002001f + 0x100000000080023) (.leaf8 0xc0000000000000000009c000000000200000000000020 + 0xe000000000000000000020000000001001f (h240 0x10000 + 0x3000000000100000000000000000001000000000c0000000003001c) 0xc000f + 0x100000000000000000000c00000000050000000001001e 0xb0023 0xb000d + 0x1100000000000000000002000000000300000000010020)) (.bin (.leaf8 + 0x120000000000000000000e0000000000001f 0xd0023 0xd000d 0x12000000000000000000020000000007001f + 0x100000000030023 0x140000000000000000001d000000000400000000000020 0x11000e + 0x160000000000000000001300000000090000000000001e) (.leaf8 0x120023 0x12000d + 0x17000000000000000000140000000000001f 0x130023 0x13000d 0x1800000000000000000002000000000b001f + 0x100000000030023 0x1a00000000000000000004000000000600000000000020))) (.bin (.bin (.leaf8 + 0x1c00000000000000000008000000000d001f (h240 0x100000000090000000001000000000000000000010000 + 0x50000000001000000001c000000000100000000010000000005001c) 0x1000f + 0x2000000000000000000001000000000d0000000001001e (h240 0x1000000000100000000020000 + 0x10000000005000000000100000000090000000004001c) 0x9000f + 0x230000000000000000000900000000020000000001001e (h240 0x10000 + 0x900000000020000000000000000000100000000030000000003001c)) (.leaf8 0x20186 0x10043 0x30142 + 0x101c3 0x40023 0xc00c6 0x10043 0x10303)) (.bin (.leaf8 0x10009 0x8 (h240 0x90000 + 0x100000000000000000002000000000100000000000000000000001e) 0x10009 0x20021 0x30016 0x10014 + 0x20010) (.leaf8 0x10021 0x5000000001a0016 0x90014 0x70010 0x10021 0x20000000016001a 0x150016 + 0x1500000000010016)))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x1200000000120016 + 0xe0000000010001a 0x1100000000100016 0x30014 0x130010 0x10021 0x2000000000d001a 0xb0016) (.leaf8 + 0xc00000000010016 0x4d000000000a001a 0xb000000000a0016 0x14 0xd0010 0x10021 0x900000000060016 + 0xa0000000007001a)) (.bin (.leaf8 0x800000000070016 0x60014 0xa0010 0x10021 0x1870000000004001a + 0x500000000040016 0x14 0x70010) (.leaf8 0x10021 0x300000000000016 0x340000000001001a + 0x100000000010016 0x14 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d))) (.bin + (.bin (.leaf8 0x2000000000200000000010000000033000000000000000000010020 0x5000e (h240 0x10000 + 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x200000000050000000001000000000700000000000000000001001e 0x60023 0x6000d + 0x2000000000600000000010000000186000000000100000000010020) (.leaf8 0x8000e + 0x200000000070000000001000000000a00000000030000000000001e 0x90023 0x9000d + 0x2000000000800000000010000000009000000000200000000010020 + 0x200000000090000000001000000000b0000000003001f (h240 0x1000000000c00000000010000 + 0x100000000020000000001000000000d0000000004001c) 0xd000f)) (.bin (.leaf8 + 0x2000000000b0000000001000000000d00000000040000000001001e 0xc0023 0xc000d + 0x2000000000c0000000001000000004c000000000300000000010020 + 0x2000000000d0000000001000000000e0000000000001f 0xd0023 0xd000d + 0x2000000000d000000000100000000020000000006001f) (.leaf8 0x100000000020023 + 0x2000000000f00000000010000000001000000000400000000000020 0x5000e + 0x200000000120000000001000000001300000000090000000000001e 0x120023 0x12000d + 0x2000000001300000000010000000008000000000500000000010020 (h240 0x100000000000000 + 0x1000000001500000000000000000004000000000500000000010020))))) (.bin (.bin (.bin (.leaf8 + 0x1600000000000000000014000000000b001f (h240 0x10000 + 0x1500000000010000000000000000000100000000160000000003001c) 0x16000f 0x170000000000001d 0x150023 + 0x15000d 0x1800000000000000000002000000000d001f 0x100000000030023) (.leaf8 + 0x1a00000000000000000001000000000700000000000020 0xb000e + 0x1d00000000000000000007000000000f0000000000001e (h240 0x1000000000700000000020000 + 0x10000000003000000000100000000020000000004001c) 0x2000f 0x200000000000001d (h240 + 0x100000000030000000001000000000000000000010000 + 0xb00000000010000000002000000000100000000010000000005001c) 0x20186)) (.bin (.leaf8 0x10043 0x10142 + 0x101c3 0x20023 0x800c6 0x10043 0x10303 0x10009) (.leaf8 0x20008 0x10009 0x10021 0x90016 + 0x10000000001001a 0x14 0x50010 0x10021))) (.bin (.bin (.leaf8 0xc00000000050016 0x1a00000000190016 + 0x30014 0x1c0010 0x10021 0x150016 0x70000000013001a 0x1400000000130016) (.leaf8 0x1200000000040016 + 0xf0016 0x20014 0x20010 0x10021 0x27000000000d001a 0x2000000000c0016 0xc0014)) (.bin (.leaf8 + 0x40010 0x10021 0x5000000000a001a 0x900000000090016 0xc30000000007001a 0x800000000070016 0x16 + 0x1a0000000004001a) (.leaf8 0x400000000040016 0x3d70000000001001a 0x16 0x14 0x2000e 0x10022 + 0x200000000020000000001000000007f000000000000000000000020 (h240 0x100000000000000 + 0x1000000000500000000000000000356000000000000000000010020)))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x6000000000000000000060000000002001f 0x50023 0x5000d + 0x700000000000000000019000000000100000000010020 0x2000e + 0x10000000000000000000100000000090000000002001c 0x9000f + 0xa0000000000000000000900000000030000000001001e) (.leaf8 0x80023 0x8000d + 0xb000000000000000000c2000000000200000000010020 0xc0000000000000000000b0000000005001f + 0x1000000000c0023 0xd00000000000000000004000000000300000000000020 0xe000e + 0xf0000000000000000000400000000060000000000001e)) (.bin (.leaf8 0x100000000050023 + 0x1100000000000000000026000000000400000000000020 0x4000e + 0x140000000000000000000200000000080000000000001e (h240 0x10000 + 0x300000000010000000000000000000100000000130000000003001c) 0x13000f + 0x160000000000000000001300000000010000000001001e 0x120023) (.leaf8 0x12000d + 0x1700000000000000000016000000000c001f 0x150023 0x15000d + 0x1800000000000000000006000000000600000000010020 0x1900000000000000000002000000000d001f (h240 + 0x1000000000300000000010000 0x100000000050000000001000000001c0000000004001c) 0x1c000f))) (.bin + (.bin (.leaf8 0x1c0000000000000000001c000000000e0000000001001e 0x1b0023 0x1b000d + 0x1d0000000000000000000e0000000002001f (h240 0x1000000000e00000000020000 + 0x10000000002000000000100000000040000000004001c) 0x4000d 0x21000000000000000000020000000005001f + (h240 0x1000000000300000000010000 0x10000000003000000000100000000010000000004001c)) (.leaf8 + 0x600c6 0x10043 0x30142 0x101c3 0x40009 0x30014 0x4000e 0x20186)) (.bin (.leaf8 0x10043 0x50142 + 0x101c3 0x60023 0x1000c6 0x10043 0x10303 0x10009) (.leaf8 0x50008 0x10009 0x10021 + 0x600000000010019 0x200000000000001d 0x40023 (h240 0x20000 + 0x10000000006000000000100000000010000000003009c) 0x1000f)))) (.bin (.bin (.bin (.leaf8 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x134f000000000000000000010000000002000000008100000000030000 + 0x100000000000000000001000000000500000003d600000000060000) + 0x10000000007000000001a0000000009000000000100000000030000) + 0x100000000000000000001000000000a00000000c4000000000c0000) + 0x100000000000000000001000000000e0000000005000000000f0000) + 0x1000000000500000000010000000000000000000100000000110000) + 0x26000000001200000000010000000005000000000100000000030000) + 0x1000000000000000000010000000014000000000100000000170000) + 0x7000000001800000000010000000003000000000100000000000000) + 0x100000000050000000001000000001d0000000001000000000e0000) + 0x2000000000000000000010000000002000000000100000000050000) + 0x2100000000020000000000000000000100000000010000000001001e) 0x60000000000000b 0x14 0x6000e + 0x1200c6 0x10043 0x20142 0x101c3) (.leaf8 0x30009 0x500000000010019 0x200000000000001d 0x30023 + 0x300000000000000000001009c 0x30003 0x3000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 0x1357000000000000000000010000000002000000008100000000030000 + 0x100000000000000000001000000000500000003d600000000060000) + 0x10000000007000000001a0000000009000000000100000000030000) + 0x100000000000000000001000000000a00000000c4000000000c0000) + 0x100000000000000000001000000000e0000000005000000000f0000) + 0x1000000000500000000010000000000000000000100000000110000) + 0x26000000001200000000010000000005000000000100000000030000) + 0x1000000000000000000010000000014000000000100000000170000) + 0x7000000001800000000010000000003000000000100000000000000) + 0x100000000050000000001000000001d0000000001000000000e0000) + 0x2000000000000000000010000000002000000000100000000040000) + 0x2100000000010000000000000000000300000000020000000001001e))) (.bin (.leaf8 0x3000a 0x8 (h240 + 0x40000 0x100000000000000000002000000000100000000000000000000001e) 0x10009 0x20021 0x16 0xe0014 + 0x2000e) (.leaf8 (h240 0x1000000000000000000010000 + 0x600000000010000000002000000000100000000010000000004001c) 0x20186 0x10043 0x10142 0x101c3 0x20023 + 0x800c6 0x10043))) (.bin (.bin (.leaf8 0x10303 0x10009 0x20008 0x10009 0x10021 0x40016 + 0x1000000000010016 0x1d00000000010019) (.leaf8 0x1c0000000000001d 0x1b0023 + 0x300000000000000000001009c 0x110003 0x11000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 0x13610000 0x100000000020000000081000000000300000000010000) + 0x1000000000500000003d6000000000600000000010000) + 0x7000000001a00000000090000000001000000000300000000010000) + 0x1000000000a00000000c4000000000c00000000010000) 0x1000000000e0000000005000000000f00000000010000) + 0x5000000000100000000000000000001000000001100000000260000) + 0x12000000000100000000050000000001000000000300000000010000) + 0x100000000140000000001000000001700000000070000) + 0x18000000000100000000030000000001000000000000000000010000) + 0x50000000001000000001c000000001d00000000010000000000001d) 0x100023 0x10000d)) (.bin (.leaf8 + 0x1f000000000000000000020000000002001f 0x10023 0x1000d 0x3000e 0x40000000001000b + 0x1200000000010016 0x14 0x140010) (.leaf8 0x10021 0x5000000001a0016 0x30014 0x70010 0x10021 + 0x30000000016001a 0x1700000000160016 0x120016)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x500000000010016 0x130000000010001a 0xf0016 0xf00000000030016 0x2000000000d001a 0xc0016 + 0x62000000000a001a 0x80016) (.leaf8 0x900000000010016 0xc0000000007001a 0x700000000070016 + 0x1eb0000000004001a 0x30016 0x400000000001001a 0x200000000010016 0x14)) (.bin (.leaf8 + 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x200000000020000000001000000003f000000000000000000010020 + 0x20000000003000000000100000000020000000001001f 0x100000000030023 + 0x20000000005000000000100000001ea000000000100000000000020 + 0x20000000007000000000100000000090000000004001f) (.leaf8 0x80023 0x8000d + 0x200000000080000000001000000000b000000000200000000010020 + 0x200000000090000000001000000000b0000000000001f 0xa0023 0xa000d + 0x20000000009000000000100000000020000000004001f 0x100000000020023))) (.bin (.bin (.leaf8 + 0x2000000000b00000000010000000061000000000300000000000020 + 0x2000000000d000000000100000000020000000007001f 0x100000000030023 + 0x2000000000f00000000010000000001000000000400000000000020 + 0x20000000011000000000100000000110000000001001f (h240 0x10000 + 0x1200000000010000000000000000000100000000010000000003001c) 0x1000f + 0x200000000120000000001000000000100000000080000000001001e) (.leaf8 0x100000000020023 + 0x200000000140000000001000000000c000000000500000000000020 + 0x20000000016000000000100000000140000000004001f 0x140009 0x170021 0x17 0x1d 0x103c3)) (.bin + (.leaf8 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x9b400000000030000000001000000000500000000400000 + 0x6000000000100000000030000000001000000000000000000010000) + 0x800000001ea00000000090000000001000000000a000000000d0000) + 0xc000000000100000000020000000002000000000000000000010000) + 0xe0000000061000000000f0000000001000000000300000000010000) + 0x100000000110000000002000000001200000000010000) 0x100000000020000000001000000000000000000010000) + 0x14000000000c0000000015000000000100000000140000000017001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000160000000000000000001400000000030000000001001e) + 0x130023 0x13000d 0x1800000000000000000004000000000500000000010020 + 0x18000000000000000000070000000000001f 0x60023) (.leaf8 0x6000d + 0x1900000000000000000002000000000b001f (h240 0x10000 + 0x300000000010000000000000000000100000000180000000003001c) 0x18000f + 0x1b00000000000000000018000000000d0000000001001e 0x170023 0x17000d + 0x1c00000000000000000002000000000700000000010020)))) (.bin (.bin (.bin (.leaf8 0x5000e + 0x1e00000000000000000007000000000f0000000000001e (h240 0x1000000000700000000020000 + 0x10000000002000000000100000000130000000004001c) 0x13000d 0x5000e 0x20186 0x10043 0x60142) (.leaf8 + 0x101c3 0x70023 0x1200c6 0x10043 0x10303 0x10009 0x150008 0x10009)) (.bin (.leaf8 0x10021 0x16 + 0x70014 0x2000e (h240 0x10000 0x10000000016000000000100000000010000000003001c) 0x1000f 0x40021 + 0x1b00000000040016) (.leaf8 0x10000000019001a 0x170016 0x800000000010016 0x90000000013001a + 0x120016 0x16 0x10000000010001a 0xf0016))) (.bin (.bin (.leaf8 0xf00000000010016 + 0x30000000000d001a 0xc0016 0x20014 0x20010 0x10021 0x6000000000a001a 0xa000000000a0016) (.leaf8 + 0xf50000000007001a 0x60016 0x600000000010016 0x1f0000000004001a 0x500000000040016 + 0x4da0000000001001a 0x3001d 0x1000000000100000000010000000094000000000000000000000020)) (.bin + (.leaf8 0x50010 0x60021 0x17 0x1d 0x103c3 (h240 (h240 0x950000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x500000000940000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000500000000000000000443000000000000000000010020)) + (.leaf8 0x7000000000000000000070000000002001f 0x60023 0x6000d + 0x80000000000000000001e000000000100000000010020 0x9000000000000000000080000000000001f 0x70023 + 0x7000d 0x9000000000000000000020000000003001f))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x100000000030023 0xb000000000000000000f4000000000200000000000020 + 0xd0000000000000000000c0000000006001f 0xb0023 0xb000d + 0xe00000000000000000005000000000300000000010020 0x4000e + 0x100000000000000000000200000000060000000000001e) (.leaf8 0x100000000030023 + 0x120000000000000000002f000000000400000000000020 0x14000000000000000000110000000000001f 0x100023 + 0x10000d 0x14000000000000000000020000000009001f 0x100000000030023 + 0x1600000000000000000000000000000500000000000020)) (.bin (.leaf8 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x1900000000000000000001000000000a0000000001001e 0x100000000020023 + 0x1b00000000000000000008000000000600000000000020 0x1d0000000000000000000a0000000000001f 0x90023) + (.leaf8 0x9000d 0x1e00000000000000000002000000000e001f 0x100000000020023 + 0x2000000000000000000000000000000800000000000020 0x210000000000000000001d0000000002001f 0x1c0023 + 0x1c000d 0x9000e))) (.bin (.bin (.leaf8 (h240 0x1000000000300000000010000 + 0x10000000016000000000100000000010000000004001c) 0x1000f + 0x260000000000000000000100000000000000000001001e 0x1000a 0x160008 (h240 0x30000 + 0x1700000000000000000002000000000100000000000000000000001e) 0x180000000001000b 0x30013) (.leaf8 + 0xa0008 0x10009 0x10021 0x1d000000001c0016 0x14 0x1f0010 0x10021 0xb00000000000016)) (.bin (.leaf8 + 0x40000000016001a 0x150016 0x16 0x1400000000010016 0x30014 0x160010 0x10021 0x180000000010001a) + (.leaf8 0xf0016 0x500000000010016 0x3000000000d001a 0xc000000000b0016 0x79000000000a001a + 0xb000000000a0016 0x30014 0xd0010)))) (.bin (.bin (.bin (.leaf8 0x10021 0x100000000007001a + 0x600000000060016 0x26c0000000004001a 0x30016 0x20014 0x20010 0x10021) (.leaf8 0x4a0000000001001a + 0x100000000010016 0x14 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x2000000000200000000010000000049000000000000000000010020 0x4000e)) (.bin (.leaf8 + 0x200000000040000000001000000000200000000000000000000001e 0x100000000030023 + 0x200000000060000000001000000026b000000000100000000000020 + 0x20000000008000000000100000000080000000003001f 0x100000000090023 + 0x200000000090000000001000000000f000000000200000000000020 0x5000e + 0x2000000000c0000000001000000000d00000000050000000000001e) (.leaf8 0xc0023 0xc000d + 0x2000000000d00000000010000000078000000000300000000010020 + 0x2000000000e0000000001000000000e0000000006001f 0x1000000000e0023 + 0x2000000001000000000010000000002000000000400000000000020 + 0x20000000012000000000100000000070000000000001f 0x60023))) (.bin (.bin (.leaf8 0x6000d + 0x20000000013000000000100000000020000000009001f 0x100000000030023 + 0x200000000150000000001000000000f000000000500000000000020 + 0x20000000017000000000100000000140000000000001f (h240 0x100000000000000 + 0x100000000180000000000000000001400000000090000000000001e) 0x130023 0x13000d) (.leaf8 + 0x1900000000000000000006000000000500000000010020 0x5000e 0x150023 0x15000d 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x1d00000000000000000001000000000c0000000001001e)) (.bin (.leaf8 0x100000000020023 + 0x1f00000000000000000003000000000700000000000020 0xd000e (h240 0x10000 + 0x100000000020000000001000000001f0000000003001c) 0x1f000f + 0x240000000000000000001f00000000100000000001001e 0x1e0023 0x1e000d) (.leaf8 0xb000e + 0x260000000000000000000100000000000000000000001e (h240 0x10000 + 0x200000000010000000000000000000100000000190000000003001c) 0x20186 0x10043 0x190142 0x101c3 + 0x1a0023))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x3800c6 0x10043 0x10303 0x10009 0x8 + 0x10009 0x10021 0xc00000000000016) (.leaf8 0x2000000001e0016 0xe0014 0x40010 0x10021 + 0x10000000019001a 0x1a00000000190016 0x20014 + 0x3000000000400000000000000000002000000001c0000000000001f)) (.bin (.leaf8 0x1c0009 0x10021 + 0x600000000150016 0xb0000000013001a 0x1400000000130016 0x30014 0x160010 0x10021) (.leaf8 + 0x1200000000060016 0x1100000000100016 0x14 0x130010 0x10021 0xf000000000c0016 0x3c000000000d001a + 0x6000000000c0016))) (.bin (.bin (.leaf8 0x7000000000a001a 0xb000000000a0016 0x90014 0xd0010 + 0x10021 0x1350000000007001a 0x800000000070016 0x30014) (.leaf8 0xa0010 0x10021 0x600000000030016 + 0x240000000004001a 0x400000000040016 0x60b0000000001001a 0x200000000010016 0x14)) (.bin (.leaf8 + 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x20000000002000000000100000000b1000000000000000000010020 0x50010 0x40021 0x17 0x1d) (.leaf8 + 0x103c3 (h240 0xb4000000000300000000010000 + 0x500000000b20000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000300000000000000000557000000000000000000010020) + 0x5000000000000000000060000000002001f 0x50023 0x5000d + 0x600000000000000000023000000000100000000010020)))) (.bin (.bin (.bin (.leaf8 + 0x7000000000000000000080000000001001f (h240 0x1000000000900000000010000 + 0x100000000050000000001000000000a0000000004001c) 0xa000f + 0x90000000000000000000a00000000020000000001001e 0x90023 0x9000d + 0xa00000000000000000134000000000200000000010020 0xb000e) (.leaf8 + 0xb0000000000000000000d00000000050000000000001e 0xc0023 0xc000d + 0xc00000000000000000006000000000300000000010020 0xd000000000000000000080000000007001f + 0x100000000090023 0xf0000000000000000003b000000000400000000000020 + 0x11000000000000000000110000000007001f)) (.bin (.leaf8 (h240 0x1000000001200000000010000 + 0x10000000002000000000100000000130000000004001c) 0x13000f + 0x130000000000000000001300000000080000000001001e 0x120023 0x12000d + 0x14000000000000000000140000000003001f (h240 0x1000000001500000000010000 + 0x10000000005000000000100000000160000000004001c) 0x16000f) (.leaf8 + 0x1700000000000000000016000000000a0000000001001e 0x150023 0x15000d + 0x180000000000000000000a000000000600000000010020 0x1900000000000000000008000000000d001f (h240 + 0x1000000000900000000010000 0x200000000050000000001000000001c0000000004001c) 0x1c000f + 0x1c0000000000000000001c000000000d0000000001001e))) (.bin (.bin (.leaf8 0x1b0023 0x1b000d + 0x1d00000000000000000000000000000800000000010020 0x10000e + 0x1f0000000000000000000400000000120000000000001e (h240 (h240 0x10000 + 0x5000000000100000000000000000001000000000e00000000010000) + 0x10000000001000000000100000000010000000006001c) 0x1000f + 0x2400000000000000000001000000000e0000000001001e) (.leaf8 0x10000000001000b 0xe0014 0x2000e + 0x20186 0x10043 0x30142 0x101c3 0x40023)) (.bin (.leaf8 0xc00c6 0x10043 0x10303 0x10009 0x100008 + 0x10009 0x10021 0x10019) (.leaf8 0x200000000000001d 0x5000f 0x1f0000000000001d 0x40023 0x4000d + 0x11000e 0x210000000000000000000100000000000000000000001e 0x1000a))))) (.bin (.bin (.bin (.bin + (.leaf8 0x120008 0x10009 0x10021 0x1100000000040016 0x1d000000001c0016 0x10000000003001a 0x90014 + 0x70010) (.leaf8 0x10021 0x50000000016001a 0x1700000000160016 0x30016 0x1400000000130016 0x16 + 0x1e0000000010001a 0xf0016)) (.bin (.leaf8 0xf00000000070016 0x3000000000d001a 0xc000000000c0016 + 0x9a000000000a001a 0xb000000000a0016 0x30016 0x120000000007001a 0x700000000070016) (.leaf8 + 0x3050000000004001a 0x500000000040016 0x5a0000000001001a 0x3001d + 0x1000000000100000000010000000059000000000000000000000020 + 0x20000000005000000000100000000070000000002001f 0x60023 0x6000d))) (.bin (.bin (.leaf8 + 0x2000000000600000000010000000304000000000100000000010020 + 0x20000000007000000000100000000090000000004001f 0x80023 0x8000d + 0x2000000000800000000010000000011000000000200000000010020 + 0x20000000009000000000100000000020000000001001f (h240 0x10000 + 0x3000000000100000000000000000001000000000c0000000003001c) 0xc000f) (.leaf8 + 0x2000000000b0000000001000000000c00000000050000000001001e 0xb0023 0xb000d + 0x2000000000c00000000010000000099000000000300000000010020 + 0x2000000000d0000000001000000000e0000000007001f 0x1000000000f0023 + 0x2000000000e00000000010000000002000000000400000000000020 + 0x20000000010000000000100000000110000000004001f)) (.bin (.leaf8 0x100023 0x10000d + 0x20000000010000000000100000000020000000009001f 0x100000000030023 + 0x2000000001200000000010000000015000000000500000000000020 + 0x20000000014000000000100000000140000000007001f 0x140009 0x150021) (.leaf8 0x17 0x1d 0x103c3 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 0xf360000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x5000000005900000000060000000001000000000800000003050000) + 0x90000000001000000000a0000000012000000000c00000000010000) + 0x3000000000100000000000000000001000000000d000000009b0000) + 0xf000000000100000000000000000001000000001100000000030000) + 0x12000000000100000000030000000001000000000000000000010000) + 0x1400000000150000000015000000000100000000140000000015001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000140000000000000000001400000000000000000001001e) + 0x130023 0x13000d)))) (.bin (.bin (.bin (.leaf8 0x1600000000000000000006000000000500000000010020 + 0x2000e 0x10000000000000000000100000000150000000002001c 0x15000f + 0x1800000000000000000015000000000b0000000001001e 0x140023 0x14000d + 0x19000000000000000000020000000001001f) (.leaf8 (h240 0x10000 + 0x300000000010000000000000000000100000000180000000003001c) 0x18000f + 0x1b00000000000000000018000000000d0000000001001e 0x170023 0x17000d + 0x1c00000000000000000004000000000700000000010020 0xb000e + 0x1e0000000000000000000700000000000000000000001e)) (.bin (.leaf8 (h240 0x10000 + 0x8000000000100000000000000000001000000001e0000000003001c) 0x1e000f + 0x200000000000000000001e00000000110000000001001e 0x1d0023 0x1d000d + 0x21000000000000000000130000000002001f 0x120023 0x12000d) (.leaf8 0x13000e 0x140000000001000b + 0x1f00000000120016 0x80014 0x210010 0x10021 0x1b000000000a0016 0x20000000019001a))) (.bin (.bin + (.leaf8 0x170016 0x1600000000010016 0x30014 0x180010 0x10021 0xe0000000013001a 0x1400000000130016 + 0x30014) (.leaf8 0x160010 0x10021 0x10000000010001a 0x1100000000100016 0xf0014 0x130010 0x10021 + 0x4d000000000d001a)) (.bin (.leaf8 0xb0016 0xc00000000010016 0x8000000000a001a 0xa000000000a0016 + 0x1820000000007001a 0x800000000070016 0x2c0000000004001a 0x500000000040016) (.leaf8 0x14 0x70010 + 0x10021 0x300000000000016 0x79a0000000001001a 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x20023 0x2000d 0x20000000002000000000100000000cd000000000000000000010020 (h240 0x100000000000000 + 0x10000000004000000000000000006cb000000000000000000010020) 0x5000e (h240 0x10000 + 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x70000000000000000000700000000000000000001001e) (.leaf8 0x60023 0x6000d + 0x80000000000000000002b000000000100000000010020 0x90000000000000000000a0000000004001f 0x90023 + 0x9000d 0xa00000000000000000181000000000200000000010020 0xb0000000000000000000c0000000006001f)) + (.bin (.leaf8 0xb0023 0xb000d 0xc00000000000000000007000000000300000000010020 + 0xd0000000000000000000e0000000000001f 0xd0023 0xd000d 0xd000000000000000000020000000006001f + 0x100000000020023) (.leaf8 0xf0000000000000000004c000000000400000000000020 0x11000e + 0x110000000000000000001300000000090000000000001e 0x120023 0x12000d + 0x1200000000000000000000000000000500000000010020 0x5000e + 0x1400000000000000000016000000000b0000000000001e))) (.bin (.bin (.leaf8 0x150023 0x15000d + 0x150000000000000000000d000000000600000000010020 0x5000e 0x170023 0x17000d + 0x1800000000000000000002000000000e001f 0x100000000020023) (.leaf8 + 0x1a00000000000000000001000000000800000000000020 0x1c0000000000000000001d0000000006001f 0x1c0023 + 0x1c000d 0xa000e 0x1d00000000000000000021000000000a0000000000001e (h240 0x10000 + 0x2200000000010000000000000000000100000000150000000003001c) 0x20186)) (.bin (.leaf8 0x10043 + 0x150142 0x101c3 0x160023 0x3000c6 0x10043 0x10303 0x10009) (.leaf8 0x8 0x10009 0x10021 + 0xb00000000200016 0x1000000001c001a 0x1b0016 0x20014 0x20010)))) (.bin (.bin (.bin (.leaf8 0x10021 + 0x600000000170016 0x70000000016001a 0x600000000150016 0x1400000000130016 0x260000000010001a + 0x1100000000100016 0x14) (.leaf8 0x130010 0x10021 0xf00000000000016 0x4000000000d001a + 0xc000000000b0016 0xc0000000000a001a 0xb000000000a0016 0x160000000007001a)) (.bin (.leaf8 + 0x200000000060016 0x60014 0x40010 0x10021 0x3cd0000000004001a 0x300000000020016 0x670000000001001a + 0x16) (.leaf8 0x14 0x2000e 0x10022 0x2000000000200000000010000000066000000000000000000000020 + 0x20000000004000000000100000000050000000000001f 0x100000000050023 + 0x20000000006000000000100000003cc000000000100000000000020 0x8000e))) (.bin (.bin (.leaf8 + 0x200000000080000000001000000000400000000020000000000001e 0x100000000050023 + 0x2000000000a00000000010000000015000000000200000000000020 + 0x2000000000c0000000001000000000d0000000006001f 0xc0023 0xc000d + 0x2000000000d000000000100000000bf000000000300000000010020 + 0x2000000000e0000000001000000000e0000000006001f) (.leaf8 0x1000000000e0023 + 0x2000000001000000000010000000003000000000400000000000020 0x11000e (h240 0x10000 + 0x10000000002000000000100000000130000000003001c) 0x13000f + 0x200000000140000000001000000001300000000080000000001001e 0x120023 0x12000d)) (.bin (.leaf8 + 0x200000000150000000001000000001b000000000500000000010020 + 0x20000000016000000000100000000140000000005001f (h240 0x100000000000000 + 0x100000000170000000000000000001400000000040000000000001e) 0x130023 0x13000d + 0x1800000000000000000008000000000500000000010020 0x1800000000000000000016000000000c001f 0x150023) + (.leaf8 0x15000d 0x1900000000000000000008000000000d001f 0x100000000090023 + 0x1b00000000000000000006000000000700000000000020 0x1d00000000000000000008000000000e001f (h240 + 0x1000000000800000000020000 0x10000000004000000000100000000020000000004001c) 0x2000f + 0x2000000000000000000002000000000f0000000001001e))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x100000000030023 0x2200000000000000000000000000000900000000000020 + 0x230000000000000000000d0000000014001f (h240 0x1000000000d00000000020000 + 0x10000000001000000000100000000010000000004001c) 0x1000f + 0x2600000000000000000001000000000b0000000001001e 0x1000a 0x10008) (.leaf8 + 0x200000000000000000001000000000100000000000000000000001e 0x30000000001000b 0x13 0xd0008 (h240 + 0x10000 0x200000000010000000000000000000100000000040000000003001c) 0x20186 0x10043 0x40142)) (.bin + (.leaf8 0x101c3 0x50023 0xe00c6 0x10043 0x10303 0x10009 0x8 0x10009) (.leaf8 0x10021 + 0xe00000000000016 0x2000000000010019 0x220000000000001d 0x1e0023 0x300000000000000000001009c + 0x100003 (h240 0x10000 0x10000000001000000000100000000010000000003001c)))) (.bin (.bin (.leaf8 + 0x1000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x28500000000000000 0x1000000000200000012f70000000003000000000100000000000000) + 0x1000000000500000000660000000006000000000100000000050000) + 0x200000000000000000001000000000800000003cd00000000090000) + 0x10000000005000000000100000000000000000001000000000b0000) + 0x15000000000c0000000001000000000e00000000c0000000000f0000) + 0x1000000000e00000000020000000000000000000100000000110000) + 0x4000000001200000000010000000000000000000100000000020000) + 0x1000000001400000000260000000015000000000100000000170000) + 0x10000000009000000000100000000000000000001000000001a0000) + 0x6000000001b00000000010000000008000000000200000000000000) + 0x1000000000400000000010000000003000000000100000000000000) + 0x1000000001f00000000020000000000000000000100000000100000) + 0x2500000000020000000000000000000100000000000000000001001e) 0x10000000001000b 0x100014 0x2000e + 0x20186 0x10043 0x30142) (.leaf8 0x101c3 0x40023 0xc00c6 0x10043 0x10303 0x10009 0x120008 + 0x10009)) (.bin (.leaf8 0x10021 0x10019 0x240000000000001d 0xf 0x230000000000001d 0x103c3 + 0x10000000014000000000100000000010000000002001c 0x1000f) (.leaf8 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x28d000000000000000000010000 + 0x200000012f700000000030000000001000000000000000000010000) + 0x5000000006600000000060000000001000000000500000000020000) + 0x1000000000800000003cd000000000900000000010000) + 0x5000000000100000000000000000001000000000b00000000150000) + 0xc0000000001000000000e00000000c0000000000f00000000010000) + 0xe000000000200000000000000000001000000001100000000040000) + 0x12000000000100000000000000000001000000000200000000010000) + 0x14000000002600000000150000000001000000001700000000010000) + 0x9000000000100000000000000000001000000001a00000000060000) + 0x1b000000000100000000080000000002000000000000000000010000) + 0x4000000000100000000030000000001000000000000000000010000) + 0x1f00000000010000000001000000002400000000010000000000001d) 0x1000a 0x140008 + 0x1f00000000010000000003000000000100000000000000000000001e 0x150000000001000b 0x14 0x16000e + 0x20186)))) (.bin (.bin (.bin (.leaf8 0x10043 0x170142 0x101c3 0x180023 0x3400c6 0x10043 0x10303 + 0x10009) (.leaf8 0x20008 0x10009 0x10021 0x2000000000010019 0x30014 0x1e000e (h240 0x20000 + 0x10000000003000000000100000000010000000003009c) 0x1000f)) (.bin (.leaf8 (h240 + 0x1000000000500000000010000 0x2000000000020000000000000000000100000000030000000004001b) 0x20016 + 0x80014 0x20010 0x10021 0x30000000019001a 0x180016 0x1700000000070016) (.leaf8 0x130000000013001a + 0x200000000120016 0x120014 0x40010 0x10021 0x10000000010001a 0x1100000000100016 0x14))) (.bin + (.bin (.leaf8 0x130010 0x10021 0xf000000000c0016 0x5f000000000d001a 0xe000000000d0016 + 0xa000000000a001a 0xb000000000a0016 0x50014) (.leaf8 0xd0010 0x10021 0x1e60000000007001a + 0x800000000070016 0x14 0xa0010 0x10021 0x600000000030016)) (.bin (.leaf8 0x320000000004001a + 0x500000000040016 0x30014 0x70010 0x10021 0x97b0000000001001a 0x16 0x14) (.leaf8 0x2000e 0x10022 + 0x2000000000200000000010000000145000000000000000000000020 (h240 0x100000000000000 + 0x1000000000500000000000000000834000000000000000000010020) 0x5000e + 0x60000000000000000000700000000010000000000001e 0x60023 0x6000d)))))))))) + +set_option maxRecDepth 20000 in +def st_1 : CertTree := + (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x700000000000000000031000000000100000000010020 0x8000000000000000000080000000001001f (h240 + 0x1000000000900000000010000 0x100000000020000000001000000000a0000000004001c) 0xa000f + 0xa0000000000000000000a00000000020000000001001e 0x90023 0x9000d + 0xb000000000000000001e5000000000200000000010020) (.leaf8 0x7000e + 0xd0000000000000000000d00000000050000000000001e 0xc0023 0xc000d + 0xe00000000000000000009000000000300000000010020 0xf000000000000000000100000000008001f 0xf0023 + 0xf000d)) (.bin (.leaf8 0x100000000000000000005e000000000400000000010020 + 0x11000000000000000000110000000007001f (h240 0x1000000001200000000010000 + 0x10000000002000000000100000000130000000004001c) 0x13000f + 0x130000000000000000001300000000080000000001001e 0x120023 0x12000d + 0x1400000000000000000000000000000500000000010020) (.leaf8 0x14000e + 0x1500000000000000000004000000000a0000000000001e 0x100000000050023 + 0x1700000000000000000012000000000600000000000020 0x19000000000000000000190000000004001f 0x180023 + 0x18000d 0x1a00000000000000000002000000000f001f))) (.bin (.bin (.leaf8 0x100000000030023 + 0x1c00000000000000000002000000000800000000000020 0xa000e (h240 (h240 0x1000000000200000000020000 + 0x100000000050000000001000000002000000000020000) 0x10000000003000000000100000000010000000007001c) + 0x1000f 0x2500000000000000000001000000000c0000000001001e 0x30000000000000b 0x14) (.leaf8 0x3000e + 0xc00c6 0x10043 0x20142 0x101c3 0x30009 0x2000000000010019 0x220000000000001d)) (.bin (.leaf8 + 0x1e0023 0x300000000000000000001009c 0x30003 0x3000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 0x2ee70000000000000000000100000000020000 + 0x147000000000300000000010000000000000000000100000000050000) + 0x97b000000000600000000010000000008000000003300000000090000) + 0x10000000000000000000100000000020000000001000000000b0000) + 0x1e6000000000c000000000100000000080000000001000000000e0000) + 0xa000000000f00000000010000000011000000006000000000120000) + 0x1000000000000000000010000000002000000000100000000140000) + 0x2000000001500000000010000000005000000000100000000000000) + 0x10000000017000000001200000000180000000001000000001a0000) + 0x10000000003000000000100000000000000000001000000001d0000) + 0x2000000001e0000000001000000000b000000000100000000020000) + 0x20000000000000000000100000000050000000001000000001f0000) + 0x2300000000010000000000000000000300000000000000000001001e) 0x3000a 0x8 (h240 0x1f0000 + 0x100000000000000000002000000000100000000000000000000001e)) (.leaf8 0x10009 0x20021 0x30016 + 0x20014 0x20010 0x10021 0x1e00000000090016 0x1d000000001c0016)))) (.bin (.bin (.bin (.leaf8 + 0x30014 0x1f0010 0x10021 0x1800000000180016 0x80000000016001a 0x1700000000160016 0x50014 0x190010) + (.leaf8 0x10021 0x10000000013001a 0x200000000120016 0x120014 0x40010 0x10021 0x2f0000000010001a + 0x1100000000100016)) (.bin (.leaf8 0x5000000000d001a 0x8000000000c0016 0xf3000000000a001a + 0x200000000090016 0x90014 0x40010 0x10021 0x190000000007001a) (.leaf8 0x600000000060016 + 0x4bd0000000004001a 0x30016 0xa30000000001001a 0x200000000010016 0x14 + 0x20000000000000000000100000000040000000000001f 0x30023))) (.bin (.bin (.leaf8 0x3000d + 0x20000000002000000000100000000a2000000000000000000010020 + 0x20000000003000000000100000000020000000001001f 0x100000000030023 + 0x20000000005000000000100000004bc000000000100000000000020 + 0x20000000007000000000100000000080000000003001f 0x100000000090023 + 0x2000000000800000000010000000018000000000200000000000020) (.leaf8 0xb000e + 0x2000000000a0000000001000000000400000000040000000000001e 0x100000000050023 + 0x2000000000c000000000100000000f2000000000300000000000020 + 0x2000000000e0000000001000000000a0000000007001f 0x1000000000b0023 + 0x2000000001000000000010000000004000000000400000000000020 + 0x2000000001200000000010000000013000000000a001f)) (.bin (.leaf8 0x120023 0x12000d + 0x200000000130000000001000000001a000000000500000000010020 + 0x20000000014000000000100000000140000000002001f 0x140009 0x150021 0x17 0x1d) (.leaf8 0x103c3 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 0x17750000 + 0x30000000001000000000500000000a3000000000600000000010000) + 0x3000000000100000000000000000001000000000800000004bd0000) + 0x9000000000100000000000000000001000000000b00000000190000) + 0xc000000000100000000050000000001000000000000000000010000) + 0xe00000000f2000000000f0000000001000000000b00000000010000) + 0x100000000110000000004000000001200000000010000) + 0x14000000001b0000000015000000000100000000140000000015001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000140000000000000000001400000000050000000001001e) + 0x130023 0x13000d 0x1600000000000000000012000000000500000000010020 0x14000e))))) (.bin (.bin (.bin + (.bin (.leaf8 0x1600000000000000000004000000000a0000000000001e 0x100000000050023 + 0x1800000000000000000000000000000600000000000020 0x7000e + 0x1a00000000000000000019000000000d0000000000001e 0x180023 0x18000d + 0x1b00000000000000000007000000000700000000010020) (.leaf8 0x1c0000000000000000001a000000000f001f + (h240 0x1000000001b00000000010000 0x100000000050000000001000000001f0000000004001c) 0x1f000f + 0x1e0000000000000000001f00000000100000000001001e 0x1e0023 0x1e000d + 0x1f000000000000000000200000000005001f (h240 0x1000000002100000000010000 + 0x10000000004000000000100000000020000000004001c))) (.bin (.leaf8 0x2000f 0x220000000000001d (h240 + 0x100000000030000000001000000000000000000010000 + 0x2100000000010000000002000000000100000000010000000005001c) 0x20186 0x10043 0x10142 0x101c3 + 0x20023) (.leaf8 0x800c6 0x10043 0x10303 0x10009 0x20008 0x10009 0x10021 0x1f0016))) (.bin (.bin + (.leaf8 0x400000000010016 0x210014 0x60010 0x10021 0x5000000001e0016 0x1b0014 0x70010 0x10021) + (.leaf8 0x40000000019001a 0x800000000180016 0x150016 0x1500000000030016 0x170000000013001a + 0x1400000000130016 0x20000000010001a 0xf0016)) (.bin (.leaf8 0xf00000000090016 0x78000000000d001a + 0xe000000000d0016 0x50014 0x100010 0x10021 0xc000000000a001a 0xb000000000a0016) (.leaf8 0x90014 + 0xd0010 0x10021 0x25e0000000007001a 0x60016 0x600000000010016 0x510000000004001a + 0x300000000030016)))) (.bin (.bin (.bin (.leaf8 0xbba0000000001001a 0x3001d + 0x100000000010000000001000000019e000000000000000000000020 0x50010 0x60021 0x17 0x1d 0x103c3) + (.leaf8 (h240 (h240 0x19f0000 0x3000000000100000000020000000002000000000000000000010000) + 0x5000000019e0000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000500000000000000000a19000000000000000000010020) + 0x7000000000000000000050000000001001f 0x100000000060023 + 0x800000000000000000050000000000100000000000020 0xa000000000000000000080000000000001f 0x70023)) + (.bin (.leaf8 0x7000d 0xa000000000000000000020000000003001f 0x100000000030023 + 0xc0000000000000000025d000000000200000000000020 0xb000e + 0xe0000000000000000000d00000000050000000000001e 0xc0023 0xc000d) (.leaf8 + 0xf0000000000000000000b000000000300000000010020 0x7000e + 0x110000000000000000001000000000070000000000001e 0xf0023 0xf000d + 0x1200000000000000000077000000000400000000010020 0x13000000000000000000110000000005001f (h240 + 0x10000 0x1200000000010000000000000000000100000000010000000003001c)))) (.bin (.bin (.leaf8 0x1000f + 0x140000000000000000000100000000080000000001001e 0x100000000020023 + 0x1600000000000000000001000000000500000000000020 0x1800000000000000000016000000000c001f 0x150023 + 0x15000d 0x1900000000000000000016000000000600000000010020) (.leaf8 + 0x1a000000000000000000170000000001001f (h240 0x10000 + 0x1800000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1b00000000000000000001000000000c0000000001001e (h240 0x10000 + 0x200000000010000000000000000000100000000090000000003001c) 0x9000f + 0x1d00000000000000000009000000000e0000000001001e 0x1000000000a0023)) (.bin (.leaf8 + 0x1f00000000000000000003000000000800000000000020 0x1d000e + 0x210000000000000000000700000000120000000000001e (h240 0x1000000000800000000010000 + 0x10000000023000000000100000000050000000004001c) 0x5000d 0x25000000000000000000020000000014001f + 0x10023 0x1000d) (.leaf8 0x3000e 0x40000000001000b 0x700000000010016 0x210016 0x1e00000000060016 + 0x1000000001c001a 0x1d000000001c0016 0xa0014)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x2000000000c00000000000000000002000000001f0000000000001f (h240 0x180000 + 0x400000000010000000002000000001f00000000000000000000001e) 0x1f0009 0x30021 0xb0000000016001a + 0x1700000000160016 0x1400000000130016 0x20014) (.leaf8 + 0x1200000000040000000000000000000200000000160000000000001f 0x160009 0x20021 0x3c0000000010001a + 0x8000000000f0016 0x6000000000d001a 0xc000000000c0016 0x12e000000000a001a)) (.bin (.leaf8 + 0xb000000000a0016 0x30014 0xd0010 0x10021 0x280000000007001a 0x800000000070016 0x60014 0xa0010) + (.leaf8 0x10021 0x5dc0000000004001a 0x500000000040016 0x14 0x70010 0x10021 0x300000000000016 + 0xcf0000000001001a))) (.bin (.bin (.leaf8 0x3001d + 0x10000000001000000000100000000ce000000000000000000000020 0x5000e (h240 0x10000 + 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x200000000070000000001000000000700000000000000000001001e 0x60023 0x6000d) (.leaf8 + 0x20000000008000000000100000005db000000000100000000010020 0x8000e + 0x200000000090000000001000000000a00000000030000000000001e 0x90023 0x9000d + 0x2000000000a00000000010000000027000000000200000000010020 0x5000e + 0x2000000000c0000000001000000000d00000000050000000000001e)) (.bin (.leaf8 0xc0023 0xc000d + 0x2000000000d0000000001000000012d000000000300000000010020 + 0x2000000000e0000000001000000000e0000000007001f 0x1000000000f0023 + 0x2000000000f00000000010000000005000000000400000000000020 + 0x200000000110000000001000000000a0000000009001f 0x1000000000b0023) (.leaf8 + 0x2000000001300000000010000000026000000000500000000000020 0x140010 0x160021 0x17 0x1d 0x103c3 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x1d6e000000000300000000010000 + 0x2000000000200000000000000000001000000000500000000cf0000) + 0x6000000000100000000000000000001000000000200000000010000) + 0x800000005dd00000000090000000001000000000b00000000280000) + 0xc000000000100000000060000000001000000000e000000012f0000) + 0xf000000000100000000000000000001000000001100000000050000) + 0x120000000001000000000b0000000001000000000000000000010000) + 0x1400000000260000000015000000000100000000140000000016001c) 0x14000f)))) (.bin (.bin (.bin (.leaf8 + (h240 0x20000000000000000000100000000010000 + 0x200000000150000000000000000001400000000080000000001001e) 0x130023 0x13000d + 0x1700000000000000000013000000000500000000010020 0x14000e + 0x10000000005000000000100000000160000000002001c 0x16000f + 0x180000000000000000001600000000090000000001001e) (.leaf8 0x150023 0x15000d + 0x1900000000000000000019000000000e001f 0x180023 0x18000d + 0x1a0000000000000000000a000000000700000000010020 0x1a000e (h240 0x10000 + 0x50000000001000000000d0000000001000000001f0000000003001c))) (.bin (.leaf8 0x1f000f + 0x1d0000000000000000001f000000000e0000000001001e 0x1e0023 0x1e000d + 0x1e00000000000000000000000000000900000000010020 0x1f000000000000000000200000000003001f (h240 + 0x10000 0x2100000000010000000000000000000100000000010000000003001c) 0x1000f) (.leaf8 + 0x200000000000000000000100000000140000000001001e (h240 0x10000 + 0x200000000010000000000000000000100000000080000000003001c) 0x8000f 0x220000000000001d 0x70023 + 0x7000d 0x5000e 0x20186))) (.bin (.bin (.leaf8 0x10043 0x60142 0x101c3 0x70023 0x1200c6 0x10043 + 0x10303 0x10009) (.leaf8 0x90008 (h240 0x20000 + 0xa00000000000000000002000000000100000000000000000000001e) (h240 0x210000 + 0x400000000010000000002000000000100000000000000000000001e) 0x10009 0x30021 0x20000000001f0016 + 0x5000000000b0016 0x60000000019001a)) (.bin (.leaf8 0x1700000000180016 0x1500000000030016 + 0x1d0000000013001a 0x1400000000130016 0xb0014 0x160010 0x10021 0x20000000010001a) (.leaf8 + 0x1100000000100016 0xf0014 0x130010 0x10021 0x97000000000d001a 0x6000000000c0016 + 0x14000000000a001a 0x900000000090016))))) (.bin (.bin (.bin (.bin (.leaf8 0x2ee0000000007001a + 0x200000000060016 0x60014 0x40010 0x10021 0x670000000004001a 0x30016 0x20014) (.leaf8 0x20010 + 0x10021 0xeb70000000001001a 0x3001d 0x10000000001000000000100000001e2000000000000000000000020 + 0x50010 0x60021 0x17)) (.bin (.leaf8 0x1d 0x103c3 (h240 (h240 0x1e30000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x500000001e20000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000500000000000000000cd2000000000000000000010020) + 0x4000e 0x80000000000000000000200000000000000000000001e 0x100000000030023) (.leaf8 + 0xa00000000000000000066000000000100000000000020 0x8000e + 0xc0000000000000000000400000000020000000000001e 0x100000000050023 + 0xe000000000000000002ed000000000200000000000020 0x100000000000000000000b0000000005001f + 0x1000000000c0023 0x1100000000000000000013000000000300000000000020))) (.bin (.bin (.leaf8 + 0x13000000000000000000080000000007001f 0x100000000090023 + 0x1500000000000000000096000000000400000000000020 0x11000e + 0x170000000000000000001300000000090000000000001e 0x120023 0x12000d + 0x1800000000000000000001000000000500000000010020) (.leaf8 0xd000e + 0x1a00000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x1b0000000000000000001c000000000600000000010020 0x1c000000000000000000170000000001001f (h240 + 0x10000 0x1800000000010000000000000000000100000000180000000003001c) 0x18000f)) (.bin (.leaf8 + 0x1d00000000000000000018000000000e0000000001001e 0x100000000190023 + 0x1f00000000000000000005000000000800000000000020 0x21000000000000000000070000000006001f (h240 + 0x10000 0x700000000020000000000000000000100000000210000000003001c) 0x21000f + 0x230000000000000000002100000000130000000001001e 0x200023) (.leaf8 0x20000d 0x23000e (h240 0x10000 + 0x50000000001000000000b000000000100000000010000000003001c) 0x1000f 0x270000000000001d 0x1000a + 0xb0008 0x10009)))) (.bin (.bin (.bin (.leaf8 0x10021 0x2400000000030016 0x200016 0x70014 0x20010 + 0x10021 0x2000000001c001a 0x1d000000001c0016) (.leaf8 0x190014 + 0x18000000001b00000000000000000002000000001f0000000000001f 0x1f0009 0x20021 0xe0000000016001a + 0x1700000000160016 0x15000000000c0016 0x1400000000130016)) (.bin (.leaf8 0x4b0000000010001a + 0x1100000000100016 0x90014 0x130010 0x10021 0x9000000000d001a 0xe000000000d0016 0xc0014) (.leaf8 + 0x100010 0x10021 0x176000000000a001a 0xb000000000a0016 0x50014 0xd0010 0x10021 + 0x330000000007001a))) (.bin (.bin (.leaf8 0x800000000070016 0x30014 0xa0010 0x10021 + 0x600000000030016 0x75a0000000004001a 0x500000000040016 0x14) (.leaf8 0x70010 0x10021 + 0x300000000000016 0xf10000000001001a 0x3001d + 0x10000000001000000000100000000f0000000000000000000000020 0x5000e (h240 0x10000 + 0x10000000002000000000100000000070000000003001c))) (.bin (.leaf8 0x7000f + 0x200000000070000000001000000000700000000000000000001001e 0x60023 0x6000d + 0x2000000000800000000010000000759000000000100000000010020 + 0x20000000009000000000100000000080000000001001f (h240 0x1000000000900000000010000 + 0x100000000050000000001000000000a0000000004001c) 0xa000f) (.leaf8 + 0x2000000000b0000000001000000000a00000000020000000001001e 0x90023 0x9000d + 0x2000000000c00000000010000000032000000000200000000010020 0x7000e + 0x2000000000e0000000001000000000d00000000050000000000001e 0xc0023 0xc000d))))))) (.bin (.bin (.bin + (.bin (.bin (.bin (.leaf8 0x2000000000f00000000010000000175000000000300000000010020 0xe000e + 0x200000000100000000001000000001000000000070000000000001e 0xf0023 0xf000d + 0x2000000001100000000010000000008000000000400000000010020 0xb000e + 0x200000000130000000001000000001300000000090000000000001e) (.leaf8 0x120023 0x12000d + 0x2000000001400000000010000000031000000000500000000010020 + 0x20000000015000000000100000000140000000005001f 0x140009 0x160021 0x17 0x1d)) (.bin (.leaf8 + 0x103c3 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x24d5000000000300000000010000 + 0x2000000000200000000000000000001000000000500000000f10000) + 0x6000000000100000000000000000001000000000200000000010000) + 0x8000000075b00000000090000000001000000000000000000010000) + 0x50000000001000000000b0000000033000000000c00000000010000) + 0x80000000001000000000e0000000177000000000f00000000010000) + 0x11000000000900000000120000000001000000000c00000000010000) + 0x1400000000320000000015000000000100000000140000000016001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000150000000000000000001400000000020000000001001e) + 0x130023 0x13000d 0x1700000000000000000017000000000500000000010020 + 0x1700000000000000000016000000000c001f) (.leaf8 0x150023 0x15000d + 0x18000000000000000000170000000007001f (h240 0x10000 + 0x1800000000010000000000000000000100000000180000000003001c) 0x18000f + 0x1a00000000000000000018000000000d0000000001001e 0x170023 0x17000d))) (.bin (.bin (.leaf8 + 0x1b0000000000000000000d000000000700000000010020 0x1a000e + 0x1000000001c0000000001000000001f0000000002001c 0x1f000f + 0x1d0000000000000000001f000000000f0000000001001e 0x1e0023 0x1e000d + 0x1e00000000000000000001000000000900000000010020) (.leaf8 0x9000e + 0x200000000000000000000200000000130000000000001e (h240 0x10000 + 0x200000000020000000000000000000100000000250000000003001c) 0x25000f + 0x220000000000000000002500000000000000000001001e (h240 0x1000000002600000000010000 + 0x1000000000c000000000100000000010000000004001c) 0x600c6 0x10043)) (.bin (.leaf8 0xc0142 0x101c3 + 0xd0009 0x260014 0xd000e 0x20186 0x10043 0xe0142) (.leaf8 0x101c3 0xf0023 0x2200c6 0x10043 0x10303 + 0x10009 0x280008 0x10009)))) (.bin (.bin (.bin (.leaf8 0x10021 0x10019 0x220000000000001d 0xf + 0x210000000000001d 0x103c3 0x1000000002a000000000100000000010000000002001c 0x1000f) (.leaf8 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x4a400000000000000 + 0x1000000000100000024d50000000003000000000100000000020000) + 0x200000000000000000001000000000500000000f100000000060000) + 0x1000000000000000000010000000002000000000100000000080000) + 0x75b000000000900000000010000000000000000000100000000050000) + 0x1000000000b0000000033000000000c000000000100000000080000) + 0x1000000000e0000000177000000000f000000000100000000110000) + 0x900000000120000000001000000000c000000000100000000140000) + 0x4b000000001500000000010000000017000000000100000000180000) + 0x1000000000000000000010000000019000000000f000000001b0000) + 0x1000000001c00000000010000000020000000000200000000210000) + 0x1000000000a00000000010000000002000000000100000000010000) + 0x2200000000010000000000000000000100000000070000000001001e) 0x2a0000000000000b + 0x200000000000000000003001d 0x2a000b 0x30014 0x20010 0x10021 0xa00000000010019)) (.bin (.leaf8 + 0x1f0000000000001d 0x80023 (h240 0x20000 0x10000000005000000000100000000020000000003009c) 0x2000f + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x4b80000000000000000000100000000010000 + 0x24d5000000000300000000010000000002000000000200000000000000) + 0x1000000000500000000f10000000006000000000100000000000000) + 0x1000000000200000000010000000008000000075b00000000090000) + 0x10000000000000000000100000000050000000001000000000b0000) + 0x33000000000c000000000100000000080000000001000000000e0000) + 0x177000000000f00000000010000000011000000000900000000120000) + 0x1000000000c00000000010000000014000000004b00000000150000) + 0x1000000001700000000010000000018000000000100000000000000) + 0x10000000019000000000f000000001b0000000001000000001c0000) + 0x1000000002000000000020000000021000000000100000000090000) + 0x2000000000020000000000000000000200000000190000000001001e) 0x50000000001000b 0x14 0x6000e) + (.leaf8 0x20186 0x10043 0x70142 0x101c3 0x80023 0x1400c6 0x10043 0x10303))) (.bin (.bin (.leaf8 + 0x10009 0x20008 0x10009 0x10021 0x900000000010019 0x1f0000000000001d 0x70023 (h240 0x20000 + 0x10000000003000000000100000000010000000003009c)) (.leaf8 0x1000f (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 0x4f00000000000000000000100000000010000 + 0x24d5000000000300000000010000000002000000000200000000000000) + 0x1000000000500000000f10000000006000000000100000000000000) + 0x1000000000200000000010000000008000000075b00000000090000) + 0x10000000000000000000100000000050000000001000000000b0000) + 0x33000000000c000000000100000000080000000001000000000e0000) + 0x177000000000f00000000010000000011000000000900000000120000) + 0x1000000000c00000000010000000014000000004b00000000150000) + 0x1000000001700000000010000000018000000000100000000000000) + 0x10000000019000000000f000000001b0000000001000000001c0000) + 0x1000000002000000000020000000021000000000100000000080000) + 0x2000000000020000000000000000000100000000020000000001001e) 0x30000000001000b 0x14 0x4000e 0x20186 + 0x10043 0x50142)) (.bin (.leaf8 0x101c3 0x60023 0x1000c6 0x10043 0x10303 0x10009 0x20008 0x10009) + (.leaf8 0x10021 0x800000000010019 0x1f0000000000001d 0x60023 (h240 0x20000 + 0x10000000003000000000100000000010000000003009c) 0x1000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 0x4fa0000000000000000000100000000010000 + 0x24d5000000000300000000010000000002000000000200000000000000) + 0x1000000000500000000f10000000006000000000100000000000000) + 0x1000000000200000000010000000008000000075b00000000090000) + 0x10000000000000000000100000000050000000001000000000b0000) + 0x33000000000c000000000100000000080000000001000000000e0000) + 0x177000000000f00000000010000000011000000000900000000120000) + 0x1000000000c00000000010000000014000000004b00000000150000) + 0x1000000001700000000010000000018000000000100000000000000) + 0x10000000019000000000f000000001b0000000001000000001c0000) + 0x1000000002000000000020000000021000000000100000000070000) + 0x2000000000020000000000000000000100000000010000000001001e) 0x30000000000000b))))) (.bin (.bin + (.bin (.bin (.leaf8 0x14 0x3000e 0xc00c6 0x10043 0x20142 0x101c3 0x30009 0x700000000010019) + (.leaf8 0x1f0000000000001d 0x50023 0x300000000000000000001009c 0x30003 0x3000f (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x5020000000000000000000100000000010000 + 0x24d5000000000300000000010000000002000000000200000000000000) + 0x1000000000500000000f10000000006000000000100000000000000) + 0x1000000000200000000010000000008000000075b00000000090000) + 0x10000000000000000000100000000050000000001000000000b0000) + 0x33000000000c000000000100000000080000000001000000000e0000) + 0x177000000000f00000000010000000011000000000900000000120000) + 0x1000000000c00000000010000000014000000004b00000000150000) + 0x1000000001700000000010000000018000000000100000000000000) + 0x10000000019000000000f000000001b0000000001000000001c0000) + 0x1000000002000000000020000000021000000000100000000060000) + 0x2000000000010000000000000000000300000000000000000001001e) 0x3000a 0x8)) (.bin (.leaf8 (h240 + 0x60000 0x100000000000000000002000000000100000000000000000000001e) 0x10009 0x20021 + 0x1000000001f001a 0x1c000000001e0016 0x70000000019001a 0x1900000000190016 0x180014) (.leaf8 + 0x1b0010 0x10021 0x1500000000150016 0x250000000013001a 0xc00000000120016 0x40000000010001a + 0x1100000000100016 0xbb000000000d001a))) (.bin (.bin (.leaf8 0xe000000000d0016 0xc00000000060016 + 0x19000000000a001a 0x500000000090016 0x90014 0x70010 0x10021 0x3ad0000000007001a) (.leaf8 + 0x200000000060016 0x60014 0x40010 0x10021 0x780000000004001a 0x30016 0x20014 0x20010)) (.bin + (.leaf8 0x10021 0x126a0000000001001a 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x2000000000200000000010000000280000000000000000000010020) (.leaf8 (h240 0x100000000000000 + 0x1000000000400000000000000000fe8000000000000000000010020) 0x4000e + 0x60000000000000000000200000000000000000000001e 0x100000000030023 + 0x800000000000000000077000000000100000000000020 0x8000e + 0xa0000000000000000000400000000020000000000001e 0x100000000050023)))) (.bin (.bin (.bin (.leaf8 + 0xc000000000000000003ac000000000200000000000020 0xb000e + 0xe0000000000000000000700000000040000000000001e 0x100000000080023 + 0x1000000000000000000018000000000300000000000020 0x120000000000000000000e0000000003001f (h240 + 0x10000 0xf000000000100000000000000000001000000000f0000000003001c) 0xf000f) (.leaf8 + 0x130000000000000000000f00000000070000000001001e 0xe0023 0xe000d + 0x14000000000000000000ba000000000400000000010020 0x1500000000000000000013000000000a001f 0x120023 + 0x12000d 0x1600000000000000000003000000000500000000010020)) (.bin (.leaf8 + 0x170000000000000000000e000000000b001f 0x1000000000f0023 + 0x1900000000000000000024000000000600000000000020 0x1b00000000000000000017000000000d001f (h240 + 0x1000000001800000000010000 0x1000000001a0000000001000000001b0000000004001c) 0x1b000f + 0x1d0000000000000000001b000000000e0000000001001e 0x1a0023) (.leaf8 0x1a000d + 0x1e00000000000000000006000000000800000000010020 0x1f0000000000000000001e0000000013001f + 0x1000000001f0023 0x2100000000000000000000000000000a00000000000020 0x8000e + 0x10000000002000000000100000000010000000002001c 0x20186))) (.bin (.bin (.leaf8 0x10043 0x10142 + 0x101c3 0x20023 0x800c6 0x10043 0x10303 0x10009) (.leaf8 0x20008 0x10009 0x10021 + 0x2300000000070016 0x1f0014 0x250010 0x10021 0x3000000001c001a)) (.bin (.leaf8 0x1c000000001c0016 + 0x180016 0x120000000016001a 0x1700000000160016 0xf0014 0x190010 0x10021 0x20000000013001a) (.leaf8 + 0x1200000000120016 0x5d0000000010001a 0xe0016 0xc000000000d001a 0xe000000000d0016 0x80014 0x100010 + 0x10021)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 0x1d6000000000a001a 0xb000000000a0016 0x50014 + 0xd0010 0x10021 0x3c0000000007001a 0x60016 0x500000000010016) (.leaf8 0x9350000000004001a + 0x300000000020016 0x1400000000001001a 0x200000000010016 0x14 + 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d)) (.bin (.leaf8 + 0x200000000020000000001000000013f000000000000000000010020 + 0x20000000003000000000100000000050000000000001f 0x100000000050023 + 0x2000000000500000000010000000934000000000100000000000020 + 0x20000000007000000000100000000070000000000001f 0x60023 0x6000d + 0x20000000008000000000100000000020000000003001f) (.leaf8 0x100000000030023 + 0x2000000000a0000000001000000003b000000000200000000000020 0x7000e + 0x2000000000d0000000001000000000d00000000050000000000001e 0xc0023 0xc000d + 0x2000000000e000000000100000001d5000000000300000000010020 0xa000e))) (.bin (.bin (.leaf8 + 0x200000000100000000001000000001000000000070000000000001e 0xf0023 0xf000d + 0x200000000110000000001000000000b000000000400000000010020 + 0x20000000012000000000100000000020000000008001f 0x100000000020023 + 0x2000000001400000000010000000038000000000500000000000020 + 0x20000000016000000000100000000140000000008001f) (.leaf8 0x140009 0x170021 0x17 0x1d 0x103c3 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 0x2dec00000000030000000001000000000500000001400000 + 0x6000000000100000000050000000002000000000000000000010000) + 0x8000000093400000000090000000001000000000800000000010000) + 0x3000000000100000000000000000001000000000b000000003b0000) + 0xc000000000100000000080000000001000000000e00000001d60000) + 0xf0000000001000000000b00000000010000000011000000000c0000) + 0x12000000000100000000020000000002000000000000000000010000) + 0x1400000000380000000015000000000100000000140000000017001c) 0x14000f (h240 0x20000 + 0x10000000001000000000200000000160000000000001d))) (.bin (.leaf8 0x130023 0x13000d + 0x1800000000000000000022000000000500000000010020 0x1800000000000000000014000000000b001f + 0x100000000150023 0x1900000000000000000001000000000600000000000020 0x11000e + 0x1c00000000000000000019000000000d0000000000001e) (.leaf8 0x180023 0x18000d + 0x1d00000000000000000011000000000700000000010020 0x1e00000000000000000002000000000f001f (h240 + 0x10000 0x3000000000100000000000000000001000000001d0000000003001c) 0x1d000f + 0x200000000000000000001d00000000110000000001001e 0x1c0023)))) (.bin (.bin (.bin (.leaf8 0x1c000d + 0x2100000000000000000002000000000900000000010020 0x21000e + 0x230000000000000000002500000000030000000000001e 0x240023 0x24000d 0x3000e 0x40000000001000b) + (.leaf8 0x2200000000240016 0x1000000001f001a 0x1e000000001f0016 0x30014 0x200010 0x10021 + 0x90000000019001a 0x1200000000180016)) (.bin (.leaf8 0x1700000000160016 0x150014 0x190010 0x10021 + 0x2e0000000013001a 0x120016 0x20014 0x20010) (.leaf8 0x10021 0x60000000010001a 0xb000000000f0016 + 0xeb000000000d001a 0x8000000000c0016 0x1d000000000a001a 0xb000000000a0016 0x30014))) (.bin (.bin + (.leaf8 0xd0010 0x10021 0x900000000060016 0x4990000000007001a 0x800000000070016 0x14 0xa0010 + 0x10021) (.leaf8 0x600000000030016 0x9f0000000004001a 0x500000000040016 0x16f60000000001001a + 0x3001d 0x1000000000100000000010000000323000000000000000000000020 0x50010 0x60021)) (.bin (.leaf8 + 0x17 0x1d 0x103c3 (h240 (h240 0x3240000 0x3000000000100000000020000000002000000000000000000010000) + 0x500000003230000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x20000000005000000000000000013d0000000000000000000010020) + 0x7000000000000000000070000000002001f 0x60023) (.leaf8 0x6000d + 0x80000000000000000009e000000000100000000010020 0x9000000000000000000080000000001001f (h240 + 0x1000000000900000000010000 0x100000000020000000001000000000a0000000004001c) 0xa000f + 0xb0000000000000000000a00000000020000000001001e 0x90023 0x9000d))))) (.bin (.bin (.bin (.bin + (.leaf8 0xc00000000000000000498000000000200000000010020 0xd0000000000000000000b0000000003001f + (h240 0x1000000000c00000000010000 0x100000000050000000001000000000d0000000004001c) 0xd000f + 0xf0000000000000000000d00000000040000000001001e 0xc0023 0xc000d + 0x100000000000000000001c000000000300000000010020) (.leaf8 0x110000000000000000000a0000000007001f + 0x1000000000b0023 0x13000000000000000000ea000000000400000000000020 + 0x150000000000000000000d0000000009001f 0x1000000000e0023 + 0x1700000000000000000005000000000500000000000020 0x4000e + 0x1a00000000000000000002000000000a0000000000001e)) (.bin (.leaf8 0x100000000030023 + 0x1c0000000000000000002d000000000600000000000020 0x17000e + 0x1e00000000000000000019000000000d0000000000001e 0x180023 0x18000d + 0x1f00000000000000000014000000000f001f 0x100000000150023) (.leaf8 + 0x2100000000000000000008000000000800000000000020 0x5000e + 0x240000000000000000002000000000130000000000001e 0x1f0023 0x1f000d + 0x2500000000000000000000000000000a00000000010020 0x26000000000000000000240000000017001f (h240 + 0x10000 0x2500000000010000000000000000000100000000050000000003001c)))) (.bin (.bin (.leaf8 0x20186 + 0x10043 0x50142 0x101c3 0x60023 0x1000c6 0x10043 0x10303) (.leaf8 0x10009 0x8 0x10009 0x10021 + 0x2400000000230016 0x6000000001f0016 0x4000000001c001a 0x1b0016)) (.bin (.leaf8 0x1a00000000130016 + 0x170000000016001a 0x150016 0x500000000010016 0x20000000013001a 0x1400000000130016 0xe0014 + 0x160010) (.leaf8 0x10021 0x750000000010001a 0xf0016 0xf00000000090016 0xe000000000d001a + 0x5000000000c0016 0xc0014 0x70010)))) (.bin (.bin (.bin (.leaf8 0x10021 0x24c000000000a001a + 0xb000000000a0016 0x16 0x500000000007001a 0x600000000060016 0xb7a0000000004001a 0x30016) (.leaf8 + 0x20014 0x20010 0x10021 0x1920000000001001a 0x3001d + 0x1000000000100000000010000000191000000000000000000000020 0x4000e + 0x200000000060000000001000000000200000000000000000000001e)) (.bin (.leaf8 0x100000000030023 + 0x2000000000800000000010000000b79000000000100000000000020 + 0x2000000000a000000000100000000080000000003001f 0x100000000090023 + 0x2000000000b0000000001000000004f000000000200000000000020 0x2000e + 0x100000000000000000001000000000c0000000002001c 0xc000f) (.leaf8 + 0x2000000000f0000000001000000000c00000000050000000001001e 0xb0023 0xb000d + 0x200000000100000000001000000024b000000000300000000010020 0xe000e + 0x200000000110000000001000000000700000000060000000000001e 0x100000000080023 + 0x200000000130000000001000000000d000000000400000000000020))) (.bin (.bin (.leaf8 + 0x20000000015000000000100000000110000000005001f (h240 0x10000 + 0x1200000000010000000000000000000100000000010000000003001c) 0x1000f + 0x200000000160000000001000000000100000000080000000001001e 0x100000000020023 + 0x2000000001800000000010000000049000000000500000000000020 + 0x2000000001a000000000100000000140000000005001f 0x140009) (.leaf8 0x1b0021 0x17 0x1d 0x103c3 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x39790000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x5000000019100000000060000000001000000000500000000010000) + 0x300000000010000000000000000000100000000080000000b7a0000) + 0x9000000000100000000000000000001000000000b000000004f0000) + 0xc000000000100000000030000000001000000000000000000010000) + 0xd000000024d000000000f0000000001000000000800000000010000) + 0x10000000011000000000e000000001200000000010000) 0x100000000020000000001000000000000000000010000) + 0x140000000049000000001500000000010000000014000000001b001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x2000000001a0000000000000000001400000000020000000001001e) + 0x130023)) (.bin (.leaf8 0x13000d 0x1c00000000000000000029000000000500000000010020 0x10000e + 0x1d00000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x1e00000000000000000001000000000600000000010020 0x1f000000000000000000070000000000001f) (.leaf8 + 0x60023 0x6000d 0x2000000000000000000002000000000d001f 0x100000000030023 + 0x2200000000000000000016000000000700000000000020 0x240000000000000000001c000000000c001f 0x1b0023 + 0x1b000d)))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x25000000000000000000020000000011001f 0x100000000030023 + 0x2700000000000000000003000000000900000000000020 0x29000000000000000000080000000014001f 0x70023 + 0x7000d 0x2a000000000000000000260000000016001f (h240 0x1000000002600000000020000 + 0x10000000001000000000100000000010000000004001c)) (.leaf8 0x1000f + 0x2d0000000000000000000100000000010000000001001e 0x10000000000000b 0x14 0x1000e 0x800c6 0x10043 + 0x20142)) (.bin (.leaf8 0x101c3 0x30009 0x2600000000010019 0x2a0000000000001d 0x240023 + 0x300000000000000000001009c 0x30003 0x3000f) (.leaf8 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x7f800000000000000000001000000000100000039790000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x5000000019100000000060000000001000000000500000000010000) + 0x300000000010000000000000000000100000000080000000b7a0000) + 0x9000000000100000000000000000001000000000b000000004f0000) + 0xc000000000100000000030000000001000000000000000000010000) + 0xd000000024d000000000f0000000001000000000800000000010000) + 0x10000000011000000000e000000001200000000010000) 0x100000000020000000001000000000000000000010000) + 0x14000000007400000000150000000001000000001100000000010000) + 0x17000000000200000000180000000001000000000800000000010000) + 0x3000000000100000000000000000001000000001a00000000160000) + 0x1b0000000001000000001d0000000001000000000300000000010000) + 0x100000000200000000003000000002100000000010000) + 0x900000000010000000025000000002b00000000010000000000001d) 0x3000b 0x250014 0x20010 0x10021 + 0x2100000000070016 0x1000000001f001a 0x1e0016))) (.bin (.bin (.leaf8 0x1d00000000010016 + 0xb0000000019001a 0x180016 0x800000000010016 0x10000000016001a 0x1100000000150016 + 0x3a0000000013001a 0x120016) (.leaf8 0x16 0x70000000010001a 0xf0016 0xf00000000060016 + 0x126000000000d001a 0xb0016 0xc00000000010016 0x27000000000a001a)) (.bin (.leaf8 0x90016 + 0x5bd0000000007001a 0x60016 0x500000000010016 0xc80000000004001a 0x500000000040016 0x14 0x70010) + (.leaf8 0x10021 0x300000000000016 0x1cbc0000000001001a 0x3001d + 0x10000000001000000000100000003fb000000000000000000000020 0x50010 0x60021 0x17)))) (.bin (.bin + (.bin (.leaf8 0x1d 0x103c3 (h240 (h240 0x3fc0000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x500000003fb0000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x20000000005000000000000000018be000000000000000000010020) + 0x5000e (h240 0x10000 0x10000000002000000000100000000070000000003001c) 0x7000f) (.leaf8 + 0x90000000000000000000700000000000000000001001e 0x60023 0x6000d + 0xa000000000000000000c7000000000100000000010020 0xb000000000000000000070000000000001f 0x60023 + 0x6000d 0xc000000000000000000020000000003001f)) (.bin (.leaf8 0x100000000030023 + 0xe000000000000000005bc000000000200000000000020 0x10000000000000000000020000000005001f + 0x100000000030023 0x1200000000000000000026000000000300000000000020 + 0x140000000000000000000e0000000000001f 0xd0023 0xd000d) (.leaf8 + 0x14000000000000000000020000000006001f 0x100000000020023 + 0x1600000000000000000125000000000400000000000020 0x18000000000000000000110000000003001f (h240 + 0x10000 0x1200000000010000000000000000000100000000010000000003001c) 0x1000f + 0x190000000000000000000100000000080000000001001e 0x100000000020023))) (.bin (.bin (.leaf8 + 0x1b00000000000000000006000000000500000000000020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x1f00000000000000000001000000000a0000000001001e 0x100000000020023 + 0x2100000000000000000039000000000600000000000020 0x2300000000000000000013000000000d001f) (.leaf8 + 0x100000000140023 0x2500000000000000000000000000000700000000000020 + 0x260000000000000000000a0000000000001f 0x90023 0x9000d 0x2700000000000000000002000000000f001f + 0x100000000030023 0x290000000000000000000a000000000800000000000020)) (.bin (.leaf8 + 0x2b0000000000000000001f0000000000001f 0x1e0023 0x1e000d 0x2c000000000000000000020000000013001f + 0x100000000030023 0x2e00000000000000000000000000000a00000000000020 + 0x2f000000000000000000230000000004001f 0x220023) (.leaf8 0x22000d 0x27000e + 0x310000000000000000000200000000000000000000001e 0x280000000001000b 0x2300000000220016 0x30014 + 0x250010 0x10021))))) (.bin (.bin (.bin (.bin (.leaf8 0x1e000000001e0016 0x4000000001c001a + 0x1d000000001c0016 0x30014 0x1f0010 0x10021 0x1a00000000090016 0x140014) (.leaf8 0x1c0010 0x10021 + 0x1c0000000016001a 0x1700000000160016 0x20014 + 0x300000000040000000000000000000200000000190000000000001f 0x190009 0x10021)) (.bin (.leaf8 + 0x30000000013001a 0x120016 0x16 0x930000000010001a 0xf0016 0x20014 0x20010 0x10021) (.leaf8 + 0x13000000000d001a 0xe000000000d0016 0x30014 0x100010 0x10021 0x2de000000000a001a 0x90016 + 0x800000000010016))) (.bin (.bin (.leaf8 0x640000000007001a 0x200000000060016 0x60014 0x40010 + 0x10021 0xe5d0000000004001a 0x500000000040016 0x14) (.leaf8 0x70010 0x10021 0x300000000000016 + 0x1fd0000000001001a 0x100000000010016 0x14 0x20000000000000000000100000000030000000000001f + 0x20023)) (.bin (.leaf8 0x2000d 0x20000000002000000000100000001fc000000000000000000010020 0x5000e + (h240 0x10000 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x200000000050000000001000000000700000000000000000001001e 0x60023 0x6000d) (.leaf8 + 0x2000000000600000000010000000e5c000000000100000000010020 0x8000e + 0x200000000070000000001000000000400000000020000000000001e 0x100000000050023 + 0x2000000000900000000010000000063000000000200000000000020 + 0x2000000000b0000000001000000000a0000000000001f 0x90023 0x9000d)))) (.bin (.bin (.bin (.leaf8 + 0x2000000000c000000000100000000020000000005001f 0x100000000030023 + 0x2000000000e000000000100000002dd000000000300000000000020 0x5000e + 0x200000000110000000001000000001000000000070000000000001e 0xf0023 0xf000d + 0x2000000001200000000010000000012000000000400000000010020) (.leaf8 0x4000e + 0x200000000140000000001000000000200000000080000000000001e 0x100000000030023 + 0x2000000001600000000010000000058000000000500000000000020 (h240 0x100000000000000 + 0x1000000001900000000000000000039000000000500000000010020) 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f)) (.bin (.leaf8 + 0x1c00000000000000000001000000000a0000000001001e 0x100000000020023 + 0x1e00000000000000000002000000000600000000000020 0x5000e + 0x10000000005000000000100000000190000000002001c 0x19000f + 0x2200000000000000000019000000000b0000000001001e 0x180023) (.leaf8 0x18000d + 0x230000000000000000001b000000000700000000010020 0x16000e + 0x250000000000000000001c00000000040000000000001e (h240 0x1000000001d00000000010000 + 0x100000000050000000001000000001f0000000004001c) 0x1f000f + 0x280000000000000000001f00000000100000000001001e 0x1e0023))) (.bin (.bin (.leaf8 0x1e000d + 0x2900000000000000000003000000000900000000010020 0x2a000000000000000000200000000013001f (h240 + 0x1000000002100000000010000 0x10000000005000000000100000000250000000004001c) 0x25000f + 0x2c0000000000000000002500000000140000000001001e 0x240023 0x24000d) (.leaf8 0x29000e 0x20186 + 0x10043 0x2a0142 0x101c3 0x2b0023 0x5a00c6 0x10043)) (.bin (.leaf8 0x10303 0x10009 0x260008 + 0x10009 0x10021 0x30016 0x2000000001f001a 0x20000000001f0016) (.leaf8 0x30016 0x17000000001b0016 + 0xe0000000019001a 0x500000000180016 0x1800000000040016 0x1700000000160016 0x20014 + 0x300000000040000000000000000000200000000190000000000001f)))))) (.bin (.bin (.bin (.bin (.bin + (.leaf8 0x190009 0x10021 0x490000000013001a 0x120016 0x500000000010016 0x90000000010001a + 0x1100000000100016 0xf00000000040016) (.leaf8 0x16e000000000d001a 0xc0016 0xb00000000010016 + 0x31000000000a001a 0xb000000000a0016 0x50014 0xd0010 0x10021)) (.bin (.leaf8 0x72f0000000007001a + 0x200000000060016 0x60014 0x40010 0x10021 0xfe0000000004001a 0x400000000040016 + 0x23db0000000001001a) (.leaf8 0x16 0x14 0x2000e 0x10022 + 0x20000000002000000000100000004ed000000000000000000000020 (h240 0x100000000000000 + 0x1000000000500000000000000001eec000000000000000000010020) 0x6000000000000000000060000000002001f + 0x50023))) (.bin (.bin (.leaf8 0x5000d 0x7000000000000000000fd000000000100000000010020 0x8000e + 0x80000000000000000000400000000020000000000001e 0x100000000050023 + 0xa0000000000000000072e000000000200000000000020 0x7000e + 0xd0000000000000000000d00000000050000000000001e) (.leaf8 0xc0023 0xc000d + 0xe00000000000000000030000000000300000000010020 0xf0000000000000000000d0000000000001f 0xc0023 + 0xc000d 0x10000000000000000000020000000007001f 0x100000000030023)) (.bin (.leaf8 + 0x120000000000000000016d000000000400000000000020 0x14000000000000000000110000000002001f 0x100023 + 0x10000d 0x1400000000000000000013000000000a001f 0x120023 0x12000d + 0x1500000000000000000008000000000500000000010020) (.leaf8 0x16000000000000000000070000000000001f + 0x60023 0x6000d 0x1700000000000000000002000000000b001f 0x100000000030023 + 0x1900000000000000000048000000000600000000000020 0x5000e + 0x10000000005000000000100000000190000000002001c)))) (.bin (.bin (.bin (.leaf8 0x19000f + 0x1d00000000000000000019000000000b0000000001001e 0x180023 0x18000d + 0x1e0000000000000000001a0000000002001f 0x190023 0x19000d 0x1f00000000000000000007000000000f001f) + (.leaf8 0x100000000080023 0x210000000000000000000d000000000800000000000020 + 0x23000000000000000000190000000011001f (h240 0x10000 + 0x1a00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x250000000000000000000100000000000000000001001e (h240 0x10000 + 0x200000000010000000000000000000100000000210000000003001c) 0x21000f)) (.bin (.leaf8 + 0x270000000000000000002100000000130000000001001e 0x200023 0x20000d + 0x2800000000000000000001000000000a00000000010020 0x29000000000000000000020000000001001f (h240 + 0x1000000000300000000010000 0x10000000027000000000100000000010000000004001c) 0x1000f + 0x2c0000000000000000000100000000190000000001001e) (.leaf8 0x1000a 0x270008 (h240 0x30000 + 0x2800000000000000000002000000000100000000000000000000001e) 0x290000000001000b 0x30013 0x240008 + 0x10009 0x10021))) (.bin (.bin (.leaf8 0x2200000000220016 0x20014 + 0x1a00000000040000000000000000000200000000240000000000001f 0x240009 0x20021 0x6000000001c001a + 0x1d000000001c0016 0x80014) (.leaf8 0x1f0010 0x10021 0x1a00000000190016 0x600000000030016 + 0x240000000016001a 0x150016 0x800000000010016 0x40000000013001a)) (.bin (.leaf8 0x1400000000130016 + 0xb70000000010001a 0xf0016 0xe00000000010016 0x18000000000d001a 0xe000000000d0016 + 0xc00000000060016 0x396000000000a001a) (.leaf8 0xb000000000a0016 0x50014 0xd0010 0x10021 + 0x7f0000000007001a 0x700000000070016 0x11ed0000000004001a 0x30016))))) (.bin (.bin (.bin (.bin + (.leaf8 0x2770000000001001a 0x200000000010016 0x14 0x20000000000000000000100000000040000000000001f + 0x30023 0x3000d 0x2000000000200000000010000000276000000000000000000010020 + 0x20000000003000000000100000000020000000001001f) (.leaf8 0x100000000030023 + 0x20000000005000000000100000011ec000000000100000000000020 + 0x20000000007000000000100000000090000000004001f 0x80023 0x8000d + 0x200000000080000000001000000007e000000000200000000010020 0x7000e + 0x2000000000a0000000001000000000d00000000050000000000001e)) (.bin (.leaf8 0xc0023 0xc000d + 0x2000000000b00000000010000000395000000000300000000010020 + 0x2000000000c0000000001000000000e0000000003001f (h240 0x10000 + 0xf000000000100000000000000000001000000000f0000000003001c) 0xf000f + 0x2000000000d0000000001000000000f00000000070000000001001e 0xe0023) (.leaf8 0xe000d + 0x2000000000e00000000010000000017000000000400000000010020 + 0x2000000000f000000000100000000100000000000001f 0xf0023 0xf000d + 0x20000000010000000000100000000020000000009001f 0x100000000030023 + 0x2000000001200000000010000000072000000000500000000000020))) (.bin (.bin (.leaf8 + 0x20000000014000000000100000000140000000009001f 0x140009 0x150021 0x17 0x1d 0x103c3 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 0x59cd0000 + 0x3000000000100000000050000000277000000000600000000010000) + 0x3000000000100000000000000000001000000000800000011ec0000) + 0x90000000001000000000a000000007f000000000c00000000010000) + 0x80000000001000000000e0000000397000000000f00000000010000) + 0x100000000100000000018000000001200000000010000) + 0x11000000000100000000030000000001000000000000000000010000) + 0x1400000000720000000015000000000100000000130000000015001c) 0x13000d) (.leaf8 (h240 + 0x20000000000000000000100000000010000 0x2000000001400000000000000000042000000000500000000010020) + 0x1600000000000000000016000000000c001f 0x150023 0x15000d + 0x1700000000000000000003000000000600000000010020 0x180000000000000000000a0000000000001f 0x90023 + 0x9000d)) (.bin (.leaf8 0x1900000000000000000002000000000d001f 0x100000000030023 + 0x1b00000000000000000023000000000700000000000020 0x1d000000000000000000080000000001001f (h240 + 0x10000 0x9000000000100000000000000000001000000001b0000000003001c) 0x1b000f + 0x1f0000000000000000001b000000000f0000000001001e 0x1a0023) (.leaf8 0x1a000d 0xa000e + 0x210000000000000000001f00000000110000000000001e 0x1e0023 0x1e000d + 0x2200000000000000000005000000000900000000010020 0x1c000e + 0x10000000005000000000100000000240000000002001c)))) (.bin (.bin (.bin (.leaf8 0x24000f + 0x250000000000000000002400000000130000000001001e 0x230023 0x23000d 0x25000e + 0x270000000000000000000100000000000000000000001e (h240 0x10000 + 0x2000000000100000000000000000001000000002a0000000003001c) 0x20186) (.leaf8 0x10043 0x2a0142 + 0x101c3 0x2b0023 0x5a00c6 0x10043 0x10303 0x10009)) (.bin (.leaf8 0x8 0x10009 0x10021 + 0x2600000000000016 0x500000000230016 0x21000000001b0016 0x2000000001f001a 0x20000000001f0016) + (.leaf8 0x1c00000000090016 0x90014 0x1e0010 0x10021 0x110000000019001a 0x1a00000000190016 0x30014 + 0x1c0010))) (.bin (.bin (.leaf8 0x10021 0x1800000000090016 0x10000000016001a 0x1700000000160016 + 0x5b0000000013001a 0x120016 0x1100000000010016 0xc0000000010001a) (.leaf8 0xe0016 + 0x1cb000000000d001a 0xe000000000d0016 0xc00000000060016 0x3f000000000a001a 0x900000000080016 + 0x8f50000000007001a 0x800000000070016)) (.bin (.leaf8 0x30014 0xa0010 0x10021 0x13b0000000004001a + 0x500000000040016 0x2ce60000000001001a 0x100000000010016 0x14) (.leaf8 + 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x20000000002000000000100000005f8000000000000000000010020 (h240 0x100000000000000 + 0x10000000004000000000000000026ec000000000000000000010020) 0x5000000000000000000070000000002001f + 0x60023 0x6000d))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x60000000000000000013a000000000100000000010020 0x5000e + 0x80000000000000000000a00000000030000000000001e 0x90023 0x9000d + 0x9000000000000000008f4000000000200000000010020 0xa0000000000000000000b0000000004001f + 0x1000000000b0023) (.leaf8 0xc0000000000000000003e000000000300000000000020 + 0xe0000000000000000000e0000000003001f (h240 0x10000 + 0xf000000000100000000000000000001000000000f0000000003001c) 0xf000f + 0xf0000000000000000000f00000000070000000001001e 0xe0023 0xe000d + 0x10000000000000000001ca000000000400000000010020)) (.bin (.leaf8 + 0x11000000000000000000020000000008001f 0x100000000020023 + 0x130000000000000000000b000000000500000000000020 0x15000000000000000000130000000000001f 0x120023 + 0x12000d 0x1600000000000000000002000000000b001f 0x100000000030023) (.leaf8 + 0x180000000000000000005a000000000600000000000020 0x1a00000000000000000019000000000e001f 0x180023 + 0x18000d 0x1b00000000000000000000000000000700000000010020 0x1c0000000000000000001a0000000005001f + (h240 0x1000000001b00000000010000 0x100000000050000000001000000001c0000000004001c) 0x1c000f))) + (.bin (.bin (.leaf8 0x1e0000000000000000001c000000000e0000000001001e 0x1b0023 0x1b000d + 0x1f00000000000000000010000000000800000000010020 0xb000e + 0x210000000000000000001e00000000040000000000001e (h240 0x10000 + 0x1f00000000010000000000000000000100000000210000000003001c) 0x21000f) (.leaf8 + 0x230000000000000000002100000000130000000001001e 0x200023 0x20000d + 0x2400000000000000000001000000000a00000000010020 0x25000000000000000000230000000011001f (h240 + 0x10000 0x2400000000010000000000000000000100000000060000000003001c) 0x6000f + 0x260000000000000000000600000000150000000001001e)) (.bin (.leaf8 (h240 (h240 0x10000 + 0x6000000000200000000000000000001000000002800000000010000) + 0x10000000001000000000100000000010000000006001c) 0x1000f + 0x2b0000000000000000000100000000190000000001001e 0x1000a 0x10008 (h240 0x280000 + 0x200000000000000000002000000000100000000000000000000001e) 0x30000000001000b 0x280013) (.leaf8 0x8 + (h240 0x60000 0x100000000000000000002000000000100000000000000000000001e) (h240 0x240000 + 0x800000000010000000002000000000100000000000000000000001e) 0x10009 0x30021 0x10000000022001a + 0x200016 0xc000000001d0016)))) (.bin (.bin (.bin (.leaf8 0x8000000001c001a 0x1d000000001c0016 + 0x30016 0x10000000019001a 0x1800000000180016 0x2c0000000016001a 0x1700000000160016 0x30014) + (.leaf8 0x190010 0x10021 0x1500000000120016 0x50000000013001a 0x120016 0x20014 0x20010 0x10021)) + (.bin (.leaf8 0xe50000000010001a 0x1000000000100016 0xf0014 0x120010 0x10021 0x1f000000000d001a + 0xc0016 0xb0014) (.leaf8 0x20010 0x10021 0x47a000000000a001a 0xb000000000a0016 0x900000000040016 + 0x9d0000000007001a 0x600000000060016 0x16720000000004001a))) (.bin (.bin (.leaf8 0x400000000040016 + 0x2fd0000000001001a 0x16 0x14 0x2000e 0x10022 + 0x20000000002000000000100000002fc000000000000000000000020 + 0x20000000004000000000100000000060000000002001f) (.leaf8 0x50023 0x5000d + 0x2000000000500000000010000001671000000000100000000010020 + 0x20000000006000000000100000000080000000003001f 0x100000000090023 + 0x200000000070000000001000000009c000000000200000000000020 + 0x200000000090000000001000000000b0000000002001f 0xa0023)) (.bin (.leaf8 0xa000d + 0x200000000090000000001000000000d0000000006001f 0xc0023 0xc000d + 0x2000000000a00000000010000000479000000000300000000010020 0xd000e + 0x2000000000c0000000001000000000200000000060000000000001e 0x100000000030023) (.leaf8 + 0x2000000000e0000000001000000001e000000000400000000000020 0x11000e + 0x200000000100000000001000000001200000000090000000000001e 0x110023 0x11000d + 0x2000000001100000000010000000096000000000500000000010020 + 0x20000000012000000000100000000140000000000001f (h240 0x100000000000000 + 0x100000000130000000000000000001400000000090000000000001e)))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x130023 0x13000d 0x140000000000000000004c000000000500000000010020 0x4000e + 0x1500000000000000000002000000000a0000000000001e 0x100000000030023 + 0x1700000000000000000004000000000600000000000020 0x1900000000000000000017000000000b001f) (.leaf8 + (h240 0x1000000001800000000010000 0x10000000005000000000100000000190000000004001c) 0x19000f + 0x1b00000000000000000019000000000c0000000001001e 0x180023 0x18000d + 0x1c0000000000000000002b000000000700000000010020 0x1d0000000000000000001a000000000f001f + 0x1000000001b0023)) (.bin (.leaf8 0x1e00000000000000000000000000000800000000000020 + 0x1f000000000000000000020000000001001f (h240 0x10000 + 0x3000000000100000000000000000001000000001e0000000003001c) 0x1e000f + 0x210000000000000000001e00000000110000000001001e 0x1d0023 0x1d000d + 0x2200000000000000000007000000000900000000010020) (.leaf8 0x230000000000000000000e0000000012001f + (h240 0x10000 0xe00000000020000000000000000000100000000010000000003001c) 0x1000f + 0x250000000000000000000100000000130000000001001e 0x100000000010023 + 0x2700000000000000000000000000000b00000000000020 0x26000e (h240 0x10000 + 0x900000000010000000002000000000100000000010000000003001c)))) (.bin (.bin (.leaf8 0x1000f + 0x2b0000000000000000000100000000160000000001001e 0x23 0xd 0x4000e 0x20186 0x10043 0x50142) (.leaf8 + 0x101c3 0x60023 0x1000c6 0x10043 0x10303 0x10009 0x20008 0x10009)) (.bin (.leaf8 0x10021 + 0x900000000000016 0x2600000000250016 0x14 0x1000000000300000000280000000000001f (h240 0xe0000 + 0x100000000020000000002000000002800000000000000000000001e) 0x280009 0x40021) (.leaf8 + 0x4000000001f001a 0x1d0016 0x1d00000000010016 0x1b0014 0x1f0010 0x10021 0x160000000019001a + 0x500000000180016)))) (.bin (.bin (.bin (.leaf8 0x180014 0x70010 0x10021 0x20000000016001a + 0x150016 0x500000000010016 0x720000000013001a 0x1300000000130016) (.leaf8 0xf0000000010001a + 0x1100000000100016 0x30014 0x130010 0x10021 0xf000000000c0016 0x23c000000000d001a + 0xe000000000d0016)) (.bin (.leaf8 0x4e000000000a001a 0xb000000000a0016 0x90014 0xd0010 0x10021 + 0xb390000000007001a 0x600000000050016 0x17d0000000004001a) (.leaf8 0x500000000040016 0x30014 + 0x70010 0x10021 0x38380000000001001a 0x200000000010016 0x14 + 0x20000000000000000000100000000040000000000001f))) (.bin (.bin (.leaf8 0x30023 0x3000d + 0x2000000000200000000010000000775000000000000000000010020 0x50010 0x40021 0x17 0x1d 0x103c3) + (.leaf8 (h240 0x778000000000300000000010000 + 0x500000007760000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x20000000003000000000000000030c0000000000000000000010020) + 0x5000e 0x50000000000000000000700000000010000000000001e 0x60023 0x6000d + 0x60000000000000000017c000000000100000000010020)) (.bin (.leaf8 + 0x7000000000000000000080000000002001f 0x100000000080023 + 0x900000000000000000b38000000000200000000000020 0xb000e + 0xb0000000000000000000d00000000050000000000001e 0xc0023 0xc000d + 0xc0000000000000000004d000000000300000000010020) (.leaf8 0xd000000000000000000100000000008001f + 0xf0023 0xf000d 0xe0000000000000000023b000000000400000000010020 + 0xf000000000000000000110000000007001f (h240 0x1000000001200000000010000 + 0x10000000005000000000100000000130000000004001c) 0x13000f + 0x110000000000000000001300000000080000000001001e)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x120023 0x12000d 0x120000000000000000000e000000000500000000010020 + 0x1300000000000000000015000000000c001f 0x140023 0x14000d + 0x1400000000000000000071000000000600000000010020 0x15000000000000000000070000000000001f) (.leaf8 + 0x60023 0x6000d 0x1600000000000000000002000000000d001f 0x100000000030023 + 0x1800000000000000000001000000000700000000000020 0x1a000e + 0x1a00000000000000000007000000000e0000000000001e 0x100000000080023)) (.bin (.leaf8 + 0x1c00000000000000000015000000000800000000000020 0x1d000e 0x1e0023 0x1e000d + 0x1f000000000000000000020000000012001f 0x100000000020023 + 0x2100000000000000000003000000000a00000000000020 0x10000e) (.leaf8 (h240 + 0x1000000000200000000020000 0x10000000002000000000100000000280000000004001c) 0x28000f + 0x270000000000000000002800000000140000000001001e 0x270023 0x27000d 0xb000e (h240 0x10000 + 0x10000000003000000000100000000010000000003001c) 0x1000f))) (.bin (.bin (.leaf8 + 0x2b0000000000000000000100000000010000000001001e 0x30000000000000b 0xc0014 0x3000e 0xc00c6 0x10043 + 0xe0142 0x101c3) (.leaf8 0xf0009 0x2900000000010019 0x270000000000001d 0x270023 + 0x300000000000000000001009c 0xf0003 0xf000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 0x118d200000000000000 + 0x1000000000100000007780000000003000000000100000000050000) + 0x3839000000000600000000010000000008000000017d00000000090000) + 0x10000000008000000000200000000000000000001000000000b0000) + 0xb39000000000c0000000001000000000e000000004e000000000f0000) + 0x10000000011000000023d0000000012000000000100000000000000) + 0x1000000000500000000010000000014000000000f00000000150000) + 0x1000000001600000000720000000018000000000100000000080000) + 0x10000000003000000000100000000000000000001000000001a0000) + 0x2000000001b00000000010000000008000000000100000000000000) + 0x1000000001d0000000016000000001e000000000100000000200000) + 0x1000000000200000000020000000000000000000100000000230000) + 0x3000000002400000000010000000011000000000100000000020000) + 0x2000000000000000000010000000002000000000100000000280000) + 0x2800000000010000000000000000000f00000000000000000001001e))) (.bin (.leaf8 0xf000a 0x8 (h240 + 0x280000 0x100000000000000000002000000000100000000000000000000001e) 0x10009 0x20021 0x16 0x20014 + 0x2000e) (.leaf8 (h240 0x1000000000000000000010000 + 0x2a00000000010000000002000000000100000000010000000004001c) 0x1000f 0x50021 0x24000000000f0016 + 0x10000000022001a 0x210016 0x20014 0x20010)))) (.bin (.bin (.bin (.leaf8 0x10021 + 0x1e000000001e0016 0xa000000001c001a 0x1d000000001c0016 0x80014 0x1f0010 0x10021 + 0x10000000019001a) (.leaf8 0x180016 0x800000000010016 0x390000000016001a 0x1500000000140016 + 0x70000000013001a 0x500000000120016 0x120014 0x70010)) (.bin (.leaf8 0x10021 0x11e0000000010001a + 0xf000000000f0016 0x26000000000d001a 0xe000000000d0016 0x59c000000000a001a 0xb000000000a0016 0x14) + (.leaf8 0xd0010 0x10021 0x900000000060016 0xbe0000000007001a 0x600000000060016 + 0x1c1c0000000004001a 0x300000000030016 0x3bb0000000001001a))) (.bin (.bin (.leaf8 + 0x100000000010016 0x14 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x20000000002000000000100000003ba000000000000000000010020 + 0x20000000003000000000100000000050000000001001f 0x100000000060023) (.leaf8 + 0x2000000000400000000010000001c1b000000000100000000000020 + 0x20000000006000000000100000000080000000003001f 0x100000000090023 + 0x20000000007000000000100000000bd000000000200000000000020 + 0x200000000090000000001000000000b0000000003001f (h240 0x1000000000c00000000010000 + 0x100000000020000000001000000000d0000000004001c) 0xd000f + 0x2000000000b0000000001000000000d00000000040000000001001e)) (.bin (.leaf8 0xc0023 0xc000d + 0x2000000000c0000000001000000059b000000000300000000010020 + 0x2000000000d000000000100000000100000000008001f 0xf0023 0xf000d + 0x2000000000e00000000010000000025000000000400000000010020 + 0x2000000000f000000000100000000110000000009001f) (.leaf8 0x100000000120023 + 0x20000000010000000000100000000b6000000000500000000000020 + 0x20000000012000000000100000000140000000009001f (h240 0x100000000000000 + 0x100000000130000000000000000001400000000000000000000001e) 0x130023 0x13000d + 0x1400000000000000000065000000000500000000010020 0x14000e))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x1400000000000000000007000000000a0000000000001e 0x100000000080023 + 0x1600000000000000000006000000000600000000000020 0x1800000000000000000017000000000c001f + 0x100000000170023 0x1a00000000000000000038000000000700000000000020 + 0x1c0000000000000000000a0000000000001f 0x90023) (.leaf8 0x9000d + 0x1d00000000000000000002000000000f001f 0x100000000030023 + 0x1f00000000000000000000000000000800000000000020 0xa000e + 0x210000000000000000001f00000000110000000000001e 0x1e0023 0x1e000d)) (.bin (.leaf8 + 0x2200000000000000000009000000000900000000010020 0x23000000000000000000200000000013001f (h240 + 0x1000000002100000000010000 0x10000000004000000000100000000020000000004001c) 0x2000f + 0x250000000000000000000200000000130000000001001e 0x100000000030023 + 0x2700000000000000000000000000000b00000000000020 0x28000000000000000000260000000009001f) (.leaf8 + (h240 (h240 0x100000000270000000001000000000000000000010000 + 0x4000000000100000000030000000001000000000000000000010000) + 0x2a00000000010000000002000000000100000000010000000008001c) 0x1000f + 0x2f0000000000000000000100000000050000000001001e 0x1000a 0x20008 0x10009 0x10021 0x280016))) (.bin + (.bin (.leaf8 0x400000000010016 0x270014 0x60010 0x10021 0x240016 0x400000000010016 0x210014 + 0x60010) (.leaf8 0x10021 0x5000000001f001a 0xb000000001e0016 0x1b0016 0xb00000000010016 + 0x1c0000000019001a 0x180016 0x170014)) (.bin (.leaf8 0x20010 0x10021 0x30000000016001a 0x150016 + 0x1500000000060016 0x8e0000000013001a 0x1400000000130016 0x120014) (.leaf8 0x160010 0x10021 + 0x130000000010001a 0xf000000000f0016 0x2cd000000000d001a 0xe000000000d0016 0x16 + 0x5f000000000a001a)))) (.bin (.bin (.bin (.leaf8 0x90016 0xe0e0000000007001a 0x60016 + 0x1de0000000004001a 0x300000000020016 0x46340000000001001a 0x200000000010016 0x14) (.leaf8 + 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x200000000020000000001000000096d000000000000000000010020 0x50010 0x40021 0x17 0x1d)) (.bin + (.leaf8 0x103c3 (h240 0x970000000000300000000010000 + 0x5000000096e0000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000300000000000000003cc4000000000000000000010020) + 0x5000000000000000000050000000000001f 0x100000000050023 + 0x7000000000000000001dd000000000100000000000020 0x9000000000000000000020000000003001f) (.leaf8 + 0x100000000030023 0xb00000000000000000e0d000000000200000000000020 + 0xd000000000000000000020000000005001f 0x100000000030023 + 0xf0000000000000000005e000000000300000000000020 0x2000e + 0x100000000000000000001000000000f0000000002001c 0xf000f))) (.bin (.bin (.leaf8 + 0x130000000000000000000f00000000070000000001001e 0xe0023 0xe000d + 0x14000000000000000002cc000000000400000000010020 0x15000000000000000000110000000009001f + 0x100000000120023 0x1600000000000000000012000000000500000000000020 0x14000e) (.leaf8 + 0x1800000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x190000000000000000008d000000000600000000010020 0x1a000000000000000000170000000003001f (h240 + 0x10000 0x1800000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1b00000000000000000001000000000c0000000001001e)) (.bin (.leaf8 0x100000000020023 + 0x1d00000000000000000002000000000700000000000020 0x19000e + 0x2000000000000000000002000000000e0000000000001e 0x100000000030023 + 0x220000000000000000001b000000000800000000000020 0x240000000000000000000d0000000000001f 0xc0023) + (.leaf8 0xc000d 0x25000000000000000000020000000011001f (h240 0x10000 + 0x3000000000100000000000000000001000000000c0000000003001c) 0xc000f + 0x270000000000000000000c00000000120000000001001e 0x1000000000d0023 + 0x2900000000000000000004000000000a00000000000020 0x23000e))))))))) (.bin (.bin (.bin (.bin (.bin + (.bin (.bin (.bin (.leaf8 0x50023 0x5000d 0x2c000000000000000000020000000017001f (h240 + 0x1000000000300000000010000 0x10000000029000000000100000000050000000004001c) 0x5000d + 0x3000000000000000000002000000001a001f 0x10023 0x1000d) (.leaf8 0x3000e 0x40000000001000b + 0x700000000010016 0x270016 0x700000000010016 0x20000000022001a 0x2300000000220016 0xd0014)) (.bin + (.leaf8 0x3000000000f0000000000000000000200000000250000000000001f 0x250009 0x20021 + 0x1e000000000c0016 0xd000000001c001a 0x1b0016 0x1a00000000010016 0x10000000019001a) (.leaf8 + 0x180016 0x16 0x470000000016001a 0x1700000000160016 0x90000000013001a 0x1400000000130016 0x120014 + 0x160010))) (.bin (.bin (.leaf8 0x10021 0x1660000000010001a 0x1000000000100016 0x30014 0x120010 + 0x10021 0x2f000000000d001a 0xc0016) (.leaf8 0xc00000000010016 0x706000000000a001a 0x90016 + 0x900000000010016 0xee0000000007001a 0x60016 0x50014 0x20010)) (.bin (.leaf8 0x10021 + 0x231a0000000004001a 0x300000000030016 0x4b70000000001001a 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f 0x20023) (.leaf8 0x2000d + 0x20000000002000000000100000004b6000000000000000000010020 + 0x20000000003000000000100000000050000000001001f 0x100000000060023 + 0x2000000000400000000010000002319000000000100000000000020 0x7000e + 0x200000000070000000001000000000200000000020000000000001e 0x100000000030023)))) (.bin (.bin (.bin + (.leaf8 0x20000000009000000000100000000ed000000000200000000000020 + 0x2000000000b0000000001000000000b0000000000001f 0xa0023 0xa000d + 0x2000000000b000000000100000000020000000005001f 0x100000000030023 + 0x2000000000d00000000010000000705000000000300000000000020 + 0x2000000000f0000000001000000000e0000000000001f) (.leaf8 0xd0023 0xd000d + 0x2000000000f000000000100000000020000000007001f 0x100000000030023 + 0x200000000110000000001000000002e000000000400000000000020 0x5000e + 0x200000000140000000001000000001200000000090000000000001e 0x110023)) (.bin (.leaf8 0x11000d + 0x20000000015000000000100000000e6000000000500000000010020 + 0x20000000016000000000100000000140000000007001f (h240 0x100000000000000 + 0x100000000170000000000000000001400000000020000000000001e) 0x130023 0x13000d + 0x180000000000000000007d000000000500000000010020 0x14000e) (.leaf8 + 0x1800000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x1900000000000000000008000000000600000000010020 0x1a00000000000000000019000000000e001f 0x180023 + 0x18000d 0x1b00000000000000000046000000000700000000010020))) (.bin (.bin (.leaf8 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x1e00000000000000000001000000000e0000000001001e 0x100000000020023 + 0x2000000000000000000000000000000800000000000020 0x210000000000000000001c0000000000001f 0x1b0023) + (.leaf8 0x1b000d 0x21000000000000000000020000000011001f 0x100000000030023 + 0x230000000000000000000c000000000900000000000020 0x25000000000000000000200000000007001f (h240 + 0x100000000210000000001000000000000000000010000 + 0x500000000010000000010000000000100000000250000000005001c) 0x25000f + 0x280000000000000000002500000000130000000001001e)) (.bin (.leaf8 0x240023 0x24000d + 0x2900000000000000000001000000000b00000000010020 0x2a000000000000000000090000000000001f 0x80023 + 0x8000d 0x2b000000000000000000020000000019001f (h240 0x10000 + 0x300000000010000000000000000000100000000080000000003001c)) (.leaf8 0x8000f 0x2d0000000000001d + 0x70023 0x7000d 0x5000e 0x20186 0x10043 0x60142))))) (.bin (.bin (.bin (.bin (.leaf8 0x101c3 + 0x70023 0x1200c6 0x10043 0x10303 0x10009 0x90008 (h240 0x30000 + 0xa00000000000000000002000000000100000000000000000000001e)) (.leaf8 0x10009 0x20021 + 0x2700000000080016 0x2600000000250016 0x5000000000e0016 0x210014 0x70010 0x10021)) (.bin (.leaf8 + 0x6000000001f001a 0x1e0016 0x1d00000000010016 0x1b0016 0x16 0x1b00000000010016 0x230000000019001a + 0x1800000000180016) (.leaf8 0x40000000016001a 0x1500000000150016 0xb30000000013001a + 0x600000000110016 0x170000000010001a 0xf0016 0xf00000000010016 0x382000000000d001a))) (.bin (.bin + (.leaf8 0xe000000000d0016 0x30014 0x100010 0x10021 0x77000000000a001a 0x90016 0x800000000010016 + 0x118c0000000007001a) (.leaf8 0x800000000070016 0x60014 0xa0010 0x10021 0x25b0000000004001a + 0x400000000040016 0x57c80000000001001a 0x200000000010016)) (.bin (.leaf8 0x14 + 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x2000000000200000000010000000bb5000000000000000000010020 0x50010 0x40021 0x17) (.leaf8 0x1d + 0x103c3 (h240 0xbb8000000000300000000010000 + 0x50000000bb60000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000300000000000000004c10000000000000000000010020) + 0x5000000000000000000060000000002001f 0x50023 0x5000d)))) (.bin (.bin (.bin (.leaf8 + 0x60000000000000000025a000000000100000000010020 0x8000e + 0x70000000000000000000a00000000030000000000001e 0x90023 0x9000d + 0x80000000000000000118b000000000200000000010020 0x90000000000000000000a0000000000001f 0x90023) + (.leaf8 0x9000d 0xa000000000000000000020000000005001f 0x100000000030023 + 0xc00000000000000000076000000000300000000000020 0x5000e + 0xf0000000000000000001000000000070000000000001e 0xf0023 0xf000d)) (.bin (.leaf8 + 0x1000000000000000000381000000000400000000010020 0x11000000000000000000110000000000001f 0x100023 + 0x10000d 0x11000000000000000000020000000009001f 0x100000000030023 + 0x1300000000000000000016000000000500000000000020 0x1500000000000000000008000000000a001f) (.leaf8 + 0x100000000080023 0x17000000000000000000b2000000000600000000000020 + 0x1900000000000000000017000000000d001f 0x100000000180023 + 0x1a00000000000000000003000000000700000000000020 0x1c0000000000000000001a000000000f001f + 0x1000000001b0023 0x1d00000000000000000022000000000800000000000020))) (.bin (.bin (.leaf8 + 0x1f0000000000000000001d0000000000001f 0x1c0023 0x1c000d 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x210000000000000000000100000000100000000001001e (h240 0x10000 + 0x2000000000100000000000000000001000000001e0000000003001c)) (.leaf8 0x1e000f 0x230000000000001d + 0x1d0023 0x1d000d 0x24000000000000000000020000000013001f 0x100000000030023 + 0x2600000000000000000005000000000a00000000000020 0x23000e)) (.bin (.leaf8 + 0x280000000000000000000700000000070000000000001e (h240 0x10000 + 0x700000000020000000000000000000100000000270000000003001c) 0x27000f + 0x2a0000000000000000002700000000170000000001001e 0x260023 0x26000d + 0x2b000000000000000000290000000004001f (h240 0x100000000290000000002000000000000000000010000 + 0x50000000001000000000b000000000100000000010000000005001c)) (.leaf8 0x1000f + 0x2f0000000000000000000100000000000000000001001e 0x1000a 0xb0008 0x10009 0x10021 0x30016 + 0x290014)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 0x20010 0x10021 0x260016 0x70014 0x20010 + 0x10021 0x30000000022001a 0x210016) (.leaf8 0x1f00000000010016 0x20014 + 0x300000000040000000000000000000200000000210000000000001f 0x200023 0x20000d 0x20010 0x20021 + 0x11000000001c001a)) (.bin (.leaf8 0x1d000000001c0016 0x1b0014 0x1f0010 0x10021 0x10000000019001a + 0x1a00000000190016 0x180014 0x1c0010) (.leaf8 0x10021 0x590000000016001a 0x150016 0x80014 0x20010 + 0x10021 0xb0000000013001a 0x120016))) (.bin (.bin (.leaf8 0x1200000000010016 0x1c10000000010001a + 0x6000000000f0016 0x3b000000000d001a 0xc0016 0xb00000000010016 0x8c6000000000a001a + 0x900000000090016) (.leaf8 0x12d0000000007001a 0x700000000070016 0x2be40000000004001a + 0x300000000030016 0x5db0000000001001a 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f)) (.bin (.leaf8 0x20023 0x2000d + 0x20000000002000000000100000005da000000000000000000010020 + 0x20000000003000000000100000000050000000001001f 0x100000000060023 + 0x2000000000400000000010000002be3000000000100000000000020 + 0x20000000006000000000100000000090000000004001f 0x80023) (.leaf8 0x8000d + 0x200000000070000000001000000012c000000000200000000010020 + 0x200000000080000000001000000000b0000000005001f 0x1000000000c0023 + 0x20000000009000000000100000008c5000000000300000000000020 + 0x2000000000b0000000001000000000d0000000000001f 0xc0023 0xc000d)))) (.bin (.bin (.bin (.leaf8 + 0x2000000000c000000000100000000020000000007001f 0x100000000030023 + 0x2000000000e0000000001000000003a000000000400000000000020 + 0x20000000010000000000100000000080000000009001f 0x100000000090023 + 0x200000000120000000001000000011f000000000500000000000020 + 0x20000000014000000000100000000140000000005001f (h240 0x100000000000000 + 0x100000000150000000000000000001400000000040000000000001e)) (.leaf8 0x130023 0x13000d + 0x160000000000000000009f000000000500000000010020 0x16000000000000000000140000000000001f 0x130023 + 0x13000d 0x1600000000000000000002000000000b001f 0x100000000030023)) (.bin (.leaf8 + 0x180000000000000000000a000000000600000000000020 0xa000e + 0x1b00000000000000000002000000000c0000000000001e 0x100000000030023 + 0x1d00000000000000000058000000000700000000000020 0x1a000e + 0x1f0000000000000000001c000000000f0000000000001e 0x1b0023) (.leaf8 0x1b000d + 0x2000000000000000000000000000000800000000010020 0x1d000e + 0x210000000000000000001f00000000110000000000001e 0x1e0023 0x1e000d + 0x2200000000000000000010000000000900000000010020 0x5000e))) (.bin (.bin (.leaf8 (h240 0x10000 + 0x500000000010000000022000000000100000000020000000003001c) 0x2000f + 0x260000000000000000000200000000130000000001001e 0x100000000030023 + 0x2800000000000000000002000000000b00000000000020 0x9000e + 0x2b0000000000000000000200000000170000000000001e (h240 0x1000000000200000000020000 + 0x1000000002b000000000100000000020000000004001c)) (.leaf8 0x2000f 0x2e0000000000001d (h240 + 0x1000000000300000000010000 0x1000000000c000000000100000000010000000004001c) 0x600c6 0x10043 + 0xc0142 0x101c3 0xd0009)) (.bin (.leaf8 0x30014 0xd000e 0x20186 0x10043 0xe0142 0x101c3 0xf0023 + 0x2200c6) (.leaf8 0x10043 0x10303 0x10009 0x50008 0x10009 0x10021 0x2b00000000010019 + 0x2d0000000000001d))))) (.bin (.bin (.bin (.bin (.leaf8 0x290023 (h240 0x20000 + 0x10000000006000000000100000000010000000003009c) 0x1000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x1d5f00000000000000 + 0x10000000002000000db6c0000000003000000000100000000040000) + 0x5dc000000000600000000010000000000000000000100000000080000) + 0x2be300000000090000000001000000000a000000012e000000000c0000) + 0x100000000000000000001000000000e00000008c5000000000f0000) + 0x1000000000e00000000010000000003000000000100000000000000) + 0x10000000011000000003a0000000012000000000100000000090000) + 0x100000000000000000001000000001400000001c100000000150000) + 0x1000000000300000000010000000000000000000100000000170000) + 0xa00000000180000000001000000000b000000000100000000030000) + 0x100000000000000000001000000001a0000000059000000001b0000) + 0x1000000001d0000000002000000001e000000000100000000200000) + 0x11000000002100000000010000000006000000000100000000050000) + 0x1000000002200000000010000000003000000000100000000000000) + 0x10000000026000000000200000000270000000001000000000a0000) + 0x10000000002000000000200000000000000000001000000002a0000) + 0x2e00000000020000000000000000000100000000070000000001001e) 0x60000000000000b 0x14 0x6000e + 0x1200c6) (.leaf8 0x10043 0x20142 0x101c3 0x30009 0x2a00000000010019 0x2d0000000000001d 0x280023 + 0x300000000000000000001009c)) (.bin (.leaf8 0x30003 0x3000f (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x1d7300000000000000 + 0x10000000002000000db6c0000000003000000000100000000040000) + 0x5dc000000000600000000010000000000000000000100000000080000) + 0x2be300000000090000000001000000000a000000012e000000000c0000) + 0x100000000000000000001000000000e00000008c5000000000f0000) + 0x1000000000e00000000010000000003000000000100000000000000) + 0x10000000011000000003a0000000012000000000100000000090000) + 0x100000000000000000001000000001400000001c100000000150000) + 0x1000000000300000000010000000000000000000100000000170000) + 0xa00000000180000000001000000000b000000000100000000030000) + 0x100000000000000000001000000001a0000000059000000001b0000) + 0x1000000001d0000000002000000001e000000000100000000200000) + 0x11000000002100000000010000000006000000000100000000050000) + 0x1000000002200000000010000000003000000000100000000000000) + 0x10000000026000000000200000000270000000001000000000a0000) + 0x1000000000200000000020000000000000000000100000000290000) + 0x2e00000000010000000000000000000300000000020000000001001e) 0x3000a 0x8 (h240 0x290000 + 0x100000000000000000002000000000100000000000000000000001e) + 0x2b00000000010000000001000000000100000000000000000000001e 0x1000a) (.leaf8 0x20008 0x10009 + 0x10021 0x2000000002a0016 0x200000000010019 0x2b0000000000001d 0x23 0x300000000000000000001009c))) + (.bin (.bin (.leaf8 0x30003 0x3000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 0x1d7d0000000000000000000100000000020000 + 0xdb6c00000000030000000001000000000400000005dc00000000060000) + 0x10000000000000000000100000000080000002be300000000090000) + 0x1000000000a000000012e000000000c000000000100000000000000) + 0x1000000000e00000008c5000000000f0000000001000000000e0000) + 0x1000000000300000000010000000000000000000100000000110000) + 0x3a000000001200000000010000000009000000000100000000000000) + 0x1000000001400000001c10000000015000000000100000000030000) + 0x1000000000000000000010000000017000000000a00000000180000) + 0x1000000000b00000000010000000003000000000100000000000000) + 0x1000000001a0000000059000000001b0000000001000000001d0000) + 0x2000000001e00000000010000000020000000001100000000210000) + 0x1000000000600000000010000000005000000000100000000220000) + 0x1000000000300000000010000000000000000000100000000260000) + 0x200000000270000000001000000000a000000000100000000010000) + 0x2c000000000100000000000000000003000000001a0000000001001e) (h240 0x1000000000400000000010000 + 0x10000000003000000000100000000010000000004001c) 0x600c6 0x10043 0x30142 0x101c3) (.leaf8 0x40009 + 0x40014 0x4000e 0x20186 0x10043 0x50142 0x101c3 0x60023)) (.bin (.leaf8 0x1000c6 0x10043 0x10303 + 0x10009 0x60008 0x10009 0x10021 0x10019) (.leaf8 0x2d0000000000001d 0xf 0x2c0000000000001d 0x103c3 + 0x10000000008000000000100000000010000000002001c 0x1000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x1db90000000000000000000100000000020000 + 0xdb6c00000000030000000001000000000400000005dc00000000060000) + 0x10000000000000000000100000000080000002be300000000090000) + 0x1000000000a000000012e000000000c000000000100000000000000) + 0x1000000000e00000008c5000000000f0000000001000000000e0000) + 0x1000000000300000000010000000000000000000100000000110000) + 0x3a000000001200000000010000000009000000000100000000000000) + 0x1000000001400000001c10000000015000000000100000000030000) + 0x1000000000000000000010000000017000000000a00000000180000) + 0x1000000000b00000000010000000003000000000100000000000000) + 0x1000000001a0000000059000000001b0000000001000000001d0000) + 0x2000000001e00000000010000000020000000001100000000210000) + 0x1000000000600000000010000000005000000000100000000220000) + 0x1000000000300000000010000000000000000000100000000260000) + 0x200000000270000000001000000000a000000000200000000010000) + 0x2c00000000010000000000000000000100000000010000000001001e) 0x80000000000000b)))) (.bin (.bin + (.bin (.leaf8 0x100000000000000000003001d 0x8000b 0x20014 0x20010 0x10021 0xa00000000010019 + 0x2a0000000000001d 0x80023) (.leaf8 (h240 0x20000 0x10000000004000000000100000000020000000003009c) + 0x2000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x1dc100000000000000 0x10000000002000000db6c0000000003000000000100000000040000) + 0x5dc000000000600000000010000000000000000000100000000080000) + 0x2be300000000090000000001000000000a000000012e000000000c0000) + 0x100000000000000000001000000000e00000008c5000000000f0000) + 0x1000000000e00000000010000000003000000000100000000000000) + 0x10000000011000000003a0000000012000000000100000000090000) + 0x100000000000000000001000000001400000001c100000000150000) + 0x1000000000300000000010000000000000000000100000000170000) + 0xa00000000180000000001000000000b000000000100000000030000) + 0x100000000000000000001000000001a0000000059000000001b0000) + 0x1000000001d0000000002000000001e000000000100000000200000) + 0x11000000002100000000010000000006000000000100000000050000) + 0x1000000002200000000010000000003000000000100000000000000) + 0x1000000002600000000020000000027000000000100000000090000) + 0x2b00000000020000000000000000000200000000020000000001001e) 0x40000000002000b 0x14 0x60010 0x10021 + 0x2700000000070016)) (.bin (.leaf8 0x2600000000250016 0x30014 0x280010 0x10021 0x500000000200016 + 0x2100000000040016 0x8000000001f001a 0x1e000000001e0016) (.leaf8 0x1d000000001c0016 + 0x2c0000000019001a 0x1a00000000190016 0x30014 0x1c0010 0x10021 0x1800000000090016 + 0x40000000016001a))) (.bin (.bin (.leaf8 0x1700000000160016 0x30014 0x190010 0x10021 + 0xe00000000013001a 0x1400000000130016 0x90014 0x160010) (.leaf8 0x10021 0x1d0000000010001a 0xf0016 + 0xe00000000010016 0x462000000000d001a 0xe000000000d0016 0xc0014 0x100010)) (.bin (.leaf8 0x10021 + 0x96000000000a001a 0xa000000000a0016 0x15f10000000007001a 0x800000000070016 0x60014 0xa0010 + 0x10021) (.leaf8 0x2ed0000000004001a 0x400000000040016 0x6db60000000001001a 0x16 0x14 0x2000e + 0x10022 0x2000000000200000000010000000ee2000000000000000000000020))))))) (.bin (.bin (.bin (.bin + (.bin (.bin (.leaf8 (h240 0x100000000000000 + 0x1000000000500000000000000005ed2000000000000000000010020) 0x6000000000000000000060000000002001f + 0x50023 0x5000d 0x7000000000000000002ec000000000100000000010020 0x8000e + 0x80000000000000000000a00000000030000000000001e 0x90023) (.leaf8 0x9000d + 0x9000000000000000015f0000000000200000000010020 0xa0000000000000000000c0000000006001f 0xb0023 + 0xb000d 0xb00000000000000000095000000000300000000010020 0xe000e + 0xc0000000000000000001000000000070000000000001e)) (.bin (.leaf8 0xf0023 0xf000d + 0xd00000000000000000461000000000400000000010020 0xe000000000000000000100000000000001f 0xf0023 + 0xf000d 0xf000000000000000000020000000009001f 0x100000000030023) (.leaf8 + 0x110000000000000000001c000000000500000000000020 0xb000e + 0x1400000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x15000000000000000000df000000000600000000010020 0x5000e + 0x1700000000000000000019000000000d0000000000001e))) (.bin (.bin (.leaf8 0x180023 0x18000d + 0x1800000000000000000003000000000700000000010020 0x190000000000000000001a0000000005001f (h240 + 0x1000000001b00000000010000 0x100000000050000000001000000001c0000000004001c) 0x1c000f + 0x1b0000000000000000001c000000000e0000000001001e 0x1b0023) (.leaf8 0x1b000d + 0x1c0000000000000000002b000000000800000000010020 0x1d0000000000000000001f0000000012001f 0x1e0023 + 0x1e000d 0x1e000000000000000000200000000013001f 0x100000000210023 + 0x2000000000000000000007000000000a00000000000020)) (.bin (.leaf8 + 0x22000000000000000000230000000002001f 0x220023 0x22000d 0x22000000000000000000070000000014001f + (h240 0x1000000000700000000020000 0x10000000005000000000100000000280000000004001c) 0x28000f + 0x250000000000000000002800000000160000000001001e 0x270023) (.leaf8 0x27000d + 0x26000000000000000000290000000004001f 0x280023 0x28000d 0x2000e 0x30000000006000b + 0x2900000000280016 0x30016)))) (.bin (.bin (.bin (.leaf8 0x70014 0x20010 0x10021 0x40000000022001a + 0x210016 0x20000000001f0016 0x16000000001c001a 0x5000000001b0016) (.leaf8 0x1b0014 0x70010 0x10021 + 0x20000000019001a 0x600000000180016 0x700000000016001a 0xc00000000150016 0xe0000000013001a)) (.bin + (.leaf8 0x120016 0x1100000000010016 0x2310000000010001a 0xf000000000f0016 0x4b000000000d001a + 0xc000000000b0016 0xaf8000000000a001a 0x900000000090016) (.leaf8 0x1760000000007001a + 0x700000000070016 0x36da0000000004001a 0x500000000040016 0x30014 0x70010 0x10021 + 0x7710000000001001a))) (.bin (.bin (.leaf8 0x200000000010016 0x14 + 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x2000000000200000000010000000770000000000000000000010020 0x5000e + 0x200000000030000000001000000000700000000010000000000001e) (.leaf8 0x60023 0x6000d + 0x20000000004000000000100000036d9000000000100000000010020 + 0x20000000005000000000100000000090000000004001f 0x80023 0x8000d + 0x2000000000600000000010000000175000000000200000000010020 + 0x200000000070000000001000000000b0000000005001f)) (.bin (.leaf8 0x1000000000c0023 + 0x2000000000800000000010000000af7000000000300000000000020 + 0x2000000000a0000000001000000000e0000000006001f 0x1000000000e0023 + 0x2000000000c0000000001000000004a000000000400000000000020 + 0x2000000000e000000000100000000110000000009001f 0x100000000120023 + 0x2000000000f0000000001000000015e000000000500000000000020) (.leaf8 + 0x20000000011000000000100000000140000000009001f 0x140009 0x120021 0x17 0x1d 0x103c3 (h240 (h240 + (h240 (h240 (h240 (h240 0x111f70000 0x3000000000100000000050000000772000000000600000000010000) + 0x800000036da00000000090000000001000000000a00000001770000) + 0xc000000000100000000000000000001000000000e0000000af70000) + 0xf0000000001000000000e0000000002000000000000000000010000) + 0x11000000004b00000000120000000001000000000000000000010000) + 0x14000000015e0000000015000000000100000000130000000012001c) 0x13000d))))) (.bin (.bin (.bin (.bin + (.leaf8 (h240 0x20000000000000000000100000000010000 + 0x20000000011000000000000000000d0000000000500000000010020) 0x13000000000000000000130000000000001f + 0x120023 0x12000d 0x1400000000000000000002000000000b001f 0x100000000030023 + 0x160000000000000000000d000000000600000000000020 0x180000000000000000000e000000000d001f) (.leaf8 + 0x1000000000f0023 0x1a0000000000000000006f000000000700000000000020 + 0x1c00000000000000000008000000000f001f 0x100000000090023 + 0x1e00000000000000000001000000000800000000000020 0x1d000e + 0x200000000000000000000700000000100000000000001e 0x100000000080023)) (.bin (.leaf8 + 0x2200000000000000000015000000000900000000000020 0x24000000000000000000220000000014001f 0x210023 + 0x21000d 0x25000000000000000000020000000015001f 0x100000000030023 + 0x2700000000000000000003000000000b00000000000020 0x9000e) (.leaf8 + 0x2a0000000000000000000200000000000000000000001e (h240 0x10000 + 0x3000000000100000000000000000001000000002a0000000003001c) 0x2a000f + 0x2c0000000000000000002a00000000190000000001001e 0x290023 0x29000d + 0x2d000000000000000000050000000003001f 0x2b0000000004000b))) (.bin (.bin (.leaf8 0x30014 0x2d0010 + 0x10021 0x2700000000080016 0x10000000025001a 0x240016 0x2300000000010016 0xa000000001f001a) + (.leaf8 0x20000000001f0016 0x80014 0x220010 0x10021 0x1000000001c001a 0x1b0016 0x1b00000000070016 + 0x370000000019001a)) (.bin (.leaf8 0x180016 0x18000000000d0016 0x60000000016001a 0x150016 + 0x1400000000010016 0x1180000000013001a 0x120016 0x250000000010001a) (.leaf8 0x1100000000100016 + 0x14 0x130010 0x10021 0xf000000000c0016 0x57b000000000d001a 0xc0016 0xbb000000000a001a)))) (.bin + (.bin (.bin (.leaf8 0xa000000000a0016 0x1b6d0000000007001a 0x600000000060016 0x3b80000000004001a + 0x500000000040016 0x88fb0000000001001a 0x100000000010016 0x14) (.leaf8 + 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x20000000002000000000100000012e6000000000000000000010020 (h240 0x100000000000000 + 0x1000000000400000000000000007613000000000000000000010020) 0x5000000000000000000070000000002001f + 0x60023 0x6000d)) (.bin (.leaf8 0x6000000000000000003b7000000000100000000010020 + 0x7000000000000000000080000000003001f 0x100000000090023 + 0x800000000000000001b6c000000000200000000000020 0xa0000000000000000000c0000000006001f 0xb0023 + 0xb000d 0xb000000000000000000ba000000000300000000010020) (.leaf8 + 0xc000000000000000000020000000007001f 0x100000000030023 + 0xe0000000000000000057a000000000400000000000020 0x10000000000000000000110000000007001f (h240 + 0x1000000001200000000010000 0x10000000002000000000100000000130000000004001c) 0x13000f + 0x120000000000000000001300000000080000000001001e 0x120023))) (.bin (.bin (.leaf8 0x12000d + 0x1300000000000000000024000000000500000000010020 0x1400000000000000000002000000000b001f + 0x100000000030023 0x1600000000000000000117000000000600000000000020 + 0x18000000000000000000160000000000001f 0x150023 0x15000d) (.leaf8 + 0x1900000000000000000002000000000d001f 0x100000000030023 + 0x1b00000000000000000005000000000700000000000020 0x1d0000000000000000001a0000000008001f 0x190023 + 0x19000d 0x1d00000000000000000002000000000f001f 0x100000000030023)) (.bin (.leaf8 + 0x1f00000000000000000036000000000800000000000020 0x210000000000000000001d0000000004001f 0x1c0023 + 0x1c000d 0x21000000000000000000020000000011001f 0x100000000030023 + 0x2300000000000000000000000000000900000000000020 0xa000e) (.leaf8 + 0x250000000000000000002200000000130000000000001e 0x210023 0x21000d + 0x2600000000000000000009000000000a00000000010020 0x27000000000000000000250000000000001f 0x240023 + 0x24000d 0x28000000000000000000020000000017001f)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x100000000030023 0x2a00000000000000000000000000000c00000000000020 + 0x2b000000000000000000290000000004001f (h240 0x1000000002900000000020000 + 0x100000000050000000001000000002d0000000004001c) 0x2d000f 0x2d0000000000001d 0x2d000a 0x50008) + (.leaf8 0x600000000000000000001000000000100000000000000000000001e 0x10009 0x20021 + 0x10000000027001a 0x30014 0x2b0010 0x10021 0x2400000000240016)) (.bin (.leaf8 0x40000000022001a + 0x2300000000220016 0x2000000000090016 0x30014 0x220010 0x10021 0x1b000000001c001a + 0x1d000000001c0016) (.leaf8 0x30014 0x1f0010 0x10021 0x30000000019001a 0x180016 0x1700000000010016 + 0x8b0000000016001a 0x1700000000160016))) (.bin (.bin (.leaf8 0x30014 0x190010 0x10021 + 0x120000000013001a 0x1400000000130016 0x16 0x2bd0000000010001a 0x1100000000100016) (.leaf8 0x30014 + 0x130010 0x10021 0x5d000000000d001a 0xd000000000d0016 0xdb6000000000a001a 0x90016 + 0x1dc0000000007001a)) (.bin (.leaf8 0x800000000070016 0x447d0000000004001a 0x400000000040016 + 0x9740000000001001a 0x16 0x14 0x2000e 0x10022) (.leaf8 + 0x2000000000200000000010000000973000000000000000000000020 + 0x20000000004000000000100000000060000000002001f 0x50023 0x5000d + 0x200000000050000000001000000447c000000000100000000010020 + 0x200000000060000000001000000000a0000000004001f 0x90023 0x9000d)))) (.bin (.bin (.bin (.leaf8 + 0x20000000007000000000100000001db000000000200000000010020 + 0x20000000008000000000100000000020000000005001f 0x100000000030023 + 0x2000000000a00000000010000000db5000000000300000000000020 + 0x2000000000c0000000001000000000f0000000008001f 0xe0023 0xe000d + 0x2000000000d0000000001000000005c000000000400000000010020) (.leaf8 0x5000e + 0x2000000000f0000000001000000001300000000090000000000001e 0x120023 0x12000d + 0x20000000010000000000100000001b1000000000500000000010020 + 0x20000000011000000000100000000140000000002001f (h240 0x100000000000000 + 0x100000000120000000000000000001400000000070000000000001e) 0x130023)) (.bin (.leaf8 0x13000d + 0x1300000000000000000109000000000500000000010020 0x2000e + 0x10000000000000000000100000000150000000002001c 0x15000f + 0x1500000000000000000015000000000b0000000001001e 0x140023 0x14000d) (.leaf8 + 0x1600000000000000000011000000000600000000010020 0x5000e + 0x1800000000000000000019000000000d0000000000001e 0x180023 0x18000d + 0x190000000000000000008a000000000700000000010020 0x1a000000000000000000190000000000001f + 0x180023))) (.bin (.bin (.leaf8 0x18000d 0x1b00000000000000000002000000000f001f 0x100000000030023 + 0x1d00000000000000000002000000000800000000000020 0x5000e + 0x200000000000000000001f00000000110000000000001e 0x1e0023 0x1e000d) (.leaf8 + 0x210000000000000000001a000000000900000000010020 0x5000e + 0x230000000000000000002200000000040000000000001e (h240 0x10000 + 0x2300000000010000000000000000000100000000240000000003001c) 0x24000f + 0x250000000000000000002400000000150000000001001e 0x230023 0x23000d)) (.bin (.leaf8 + 0x2600000000000000000003000000000b00000000010020 0x27000000000000000000260000000017001f (h240 + 0x1000000002700000000010000 0x100000000050000000001000000002b0000000004001c) 0x2b000f + 0x290000000000000000002b00000000170000000001001e (h240 + 0x1000000002c0000000001000000000000000000010000 + 0x200000000010000000007000000000100000000010000000005001c) 0x1000f + 0x2d00000000000000000001000000001a0000000001001e) (.leaf8 0x1000a 0x70008 0x10009 0x10021 0x16 + 0x5000000002a0016 0x270014 0x70010))))) (.bin (.bin (.bin (.bin (.leaf8 0x10021 0x20000000025001a + 0x230016 0x600000000210016 0xd000000001f001a 0x20000000001f0016 0x1e00000000040016 + 0x1d000000001c0016) (.leaf8 0x30014 0x1f0010 0x10021 0x1b00000000180016 0x450000000019001a + 0x600000000180016 0x90000000016001a 0x140016)) (.bin (.leaf8 0x1500000000010016 + 0x15e0000000013001a 0x600000000120016 0x2e0000000010001a 0x1000000000100016 0x6da000000000d001a + 0xe000000000d0016 0x30014) (.leaf8 0x100010 0x10021 0xee000000000a001a 0x900000000090016 + 0x223e0000000007001a 0x600000000050016 0x4b90000000004001a 0x30016))) (.bin (.bin (.leaf8 + 0xab200000000001001a 0x200000000010016 0x14 0x20000000000000000000100000000040000000000001f + 0x30023 0x3000d 0x20000000002000000000100000017b9000000000000000000010020 0x50010) (.leaf8 0x40021 + 0x17 0x1d 0x103c3 (h240 0x17bc000000000300000000010000 + 0x500000017ba0000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000300000000000000009364000000000000000000010020) + 0x5000000000000000000020000000001001f)) (.bin (.leaf8 0x100000000030023 + 0x7000000000000000004b8000000000100000000000020 0x9000000000000000000080000000002001f + 0x100000000080023 0xb0000000000000000223d000000000200000000000020 + 0xd0000000000000000000b0000000005001f 0x1000000000c0023 + 0xe000000000000000000ed000000000300000000000020) (.leaf8 0x5000e + 0x110000000000000000001000000000070000000000001e 0xf0023 0xf000d + 0x12000000000000000006d9000000000400000000010020 0x1300000000000000000012000000000a001f 0x110023 + 0x11000d)))) (.bin (.bin (.bin (.leaf8 0x140000000000000000002d000000000500000000010020 + 0x1500000000000000000008000000000b001f 0x100000000090023 + 0x170000000000000000015d000000000600000000000020 0x19000000000000000000170000000000001f 0x160023 + 0x16000d 0x1900000000000000000002000000000c001f) (.leaf8 0x100000000020023 + 0x1b00000000000000000008000000000700000000000020 0x1d00000000000000000008000000000f001f + 0x100000000090023 0x1f00000000000000000044000000000800000000000020 + 0x210000000000000000001d000000000f001f (h240 0x1000000001e00000000010000 + 0x100000000050000000001000000001f0000000004001c) 0x1f000f)) (.bin (.leaf8 + 0x230000000000000000001f00000000100000000001001e 0x1e0023 0x1e000d + 0x24000000000000000000200000000002001f 0x1f0023 0x1f000d 0x25000000000000000000220000000014001f + 0x210023) (.leaf8 0x21000d 0x260000000000000000000c000000000a00000000010020 + 0x27000000000000000000080000000015001f (h240 0x10000 + 0x900000000010000000000000000000100000000010000000003001c) 0x1000f + 0x290000000000000000000100000000150000000001001e 0x100000000010023 + 0x2b00000000000000000001000000000c00000000000020))) (.bin (.bin (.leaf8 0x29000e + 0x2d00000000000000000007000000001a0000000000001e (h240 (h240 0x10000 + 0x8000000000100000000000000000001000000000200000000010000) + 0x10000000008000000000100000000010000000006001c) 0x600c6 0x10043 0x80142 0x101c3 0x90009) (.leaf8 + 0x20014 0x9000e 0x20186 0x10043 0xa0142 0x101c3 0xb0023 0x1a00c6)) (.bin (.leaf8 0x10043 0x10303 + 0x10009 0x40008 0x10009 0x10021 0x10019 0x2e0000000000001d) (.leaf8 0x8000f 0x2d0000000000001d + 0x70023 0x7000d 0x5000e 0x2f0000000000000000000100000000050000000000001e 0x60000000001000b + 0x2a00000000070016)))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x2900000000280016 + 0x14 0x10000000003000000002b0000000000001f 0x2b0009 0x30021 0x2400000000070016 0x60000000022001a + 0x2100000000210016) (.leaf8 0x5000000001e0016 0x1e0014 0x70010 0x10021 0x22000000001c001a 0x1b0016 + 0x1b00000000070016 0x30000000019001a)) (.bin (.leaf8 0x1a00000000190016 0x14 0x1c0010 0x10021 + 0x1800000000000016 0xae0000000016001a 0x1700000000160016 0x90014) (.leaf8 0x190010 0x10021 + 0x170000000013001a 0x1200000000110016 0x36c0000000010001a 0x1100000000100016 0xf00000000040016 + 0x76000000000d001a))) (.bin (.bin (.leaf8 0xc0016 0x111f000000000a001a 0x90016 0x80014 0x20010 + 0x10021 0x25c0000000007001a 0x60016) (.leaf8 0x600000000010016 0x558f0000000004001a + 0x500000000040016 0xbde0000000001001a 0x3001d + 0x1000000000100000000010000000bdd000000000000000000000020 + 0x20000000005000000000100000000070000000002001f 0x60023)) (.bin (.leaf8 0x6000d + 0x200000000060000000001000000558e000000000100000000010020 + 0x20000000007000000000100000000080000000000001f 0x70023 0x7000d + 0x20000000007000000000100000000020000000003001f 0x100000000030023 + 0x200000000090000000001000000025b000000000200000000000020) (.leaf8 0xa000e + 0x2000000000c0000000001000000000200000000040000000000001e 0x100000000030023 + 0x2000000000e0000000001000000111e000000000300000000000020 + 0x20000000010000000000100000000020000000007001f 0x100000000030023 + 0x2000000001200000000010000000075000000000400000000000020 + 0x20000000014000000000100000000110000000002001f)))) (.bin (.bin (.bin (.leaf8 0x100023 0x10000d + 0x2000000001400000000010000000013000000000a001f 0x120023 0x12000d + 0x200000000150000000001000000021f000000000500000000010020 + 0x20000000016000000000100000000140000000009001f 0x140009) (.leaf8 0x170021 0x17 0x1d 0x103c3 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 0x1abe300000000030000000001000000000200000000020000 + 0x100000000050000000bdd000000000600000000010000) + 0x8000000559000000000090000000001000000000300000000010000) + 0x1000000000b000000025b000000000c00000000010000) + 0xb000000000100000000030000000001000000000000000000010000) + 0xe000000111e000000000f0000000001000000000300000000010000) + 0x100000000110000000076000000001200000000010000) + 0x1400000002200000000015000000000100000000130000000017001c) 0x13000d (h240 + 0x20000000000000000000100000000010000 0x200000000160000000000000000014a000000000500000000010020) + 0x1800000000000000000014000000000a001f)) (.bin (.leaf8 0x100000000140023 + 0x1a00000000000000000016000000000600000000000020 0xb000e + 0x1d00000000000000000019000000000d0000000000001e 0x180023 0x18000d + 0x1e000000000000000000ad000000000700000000010020 0x1a000e) (.leaf8 (h240 0x10000 + 0x100000000020000000001000000001c0000000003001c) 0x1c000f + 0x210000000000000000001c000000000e0000000001001e 0x1b0023 0x1b000d + 0x2200000000000000000002000000000800000000010020 0x230000000000000000001d0000000004001f + 0x1c0023))) (.bin (.bin (.leaf8 0x1c000d 0x23000000000000000000020000000011001f 0x100000000030023 + 0x2500000000000000000021000000000900000000000020 0x20000e + 0x270000000000000000000700000000120000000000001e (h240 0x10000 + 0x800000000010000000000000000000100000000220000000003001c) 0x22000f) (.leaf8 + 0x290000000000000000002200000000140000000001001e 0x100000000230023 + 0x2b00000000000000000005000000000b00000000000020 0x2d000000000000000000260000000004001f 0x250023 + 0x25000d 0x1000e (h240 0x20000 0x100000000020000000001000000002b0000000003001c))) (.bin (.leaf8 + 0x2b000f 0x300000000000000000002b00000000170000000001001e 0x2a0023 0x2a000d + 0x310000000000000000002c0000000004001f 0x2b0023 0x2b000d 0x7000e) (.leaf8 0x20186 0x10043 0x80142 + 0x101c3 0x90023 0x1600c6 0x10043 0x10303))))) (.bin (.bin (.bin (.bin (.leaf8 0x10009 0x2d0008 + 0x10009 0x10021 0x2000000002a0016 0x14 0x40010 0x10021) (.leaf8 0x2700000000000016 + 0x20000000025001a 0x2600000000250016 0x230014 + 0x800000000250000000000000000000200000000280000000000001f 0x280009 0x20021 0x11000000001f001a)) + (.bin (.leaf8 0x1e0016 0x1e00000000010016 0x1000000001c001a 0x1d000000001c0016 0x16 + 0x570000000019001a 0x1a00000000190016 0x18000000000a0016) (.leaf8 0xa0000000016001a + 0x1700000000160016 0x14 0x190010 0x10021 0x1500000000120016 0x1b50000000013001a + 0x1400000000130016))) (.bin (.bin (.leaf8 0x3b0000000010001a 0xf0016 0xf00000000010016 + 0x88e000000000d001a 0xe000000000d0016 0x30014 0x100010 0x10021) (.leaf8 0xc00000000090016 + 0x12d000000000a001a 0x90016 0x900000000010016 0x2ac70000000007001a 0x800000000070016 + 0x5ee0000000004001a 0x500000000040016)) (.bin (.leaf8 0x14 0x70010 0x10021 0x300000000000016 + 0xd5f10000000001001a 0x3001d 0x1000000000100000000010000001d64000000000000000000000020 0x50010) + (.leaf8 0x60021 0x17 0x1d 0x103c3 (h240 (h240 0x1d650000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x50000001d640000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x200000000050000000000000000b88a000000000000000000010020) + 0x5000e)))) (.bin (.bin (.bin (.leaf8 (h240 0x10000 + 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x90000000000000000000700000000000000000001001e 0x60023 0x6000d + 0xa000000000000000005ed000000000100000000010020 0xb0000000000000000000a0000000004001f 0x90023) + (.leaf8 0x9000d 0xc00000000000000002ac6000000000200000000010020 + 0xd0000000000000000000b0000000000001f 0xa0023 0xa000d 0xd000000000000000000020000000005001f + 0x100000000030023 0xf0000000000000000012c000000000300000000000020)) (.bin (.leaf8 + 0x110000000000000000000e0000000005001f (h240 0x1000000000f00000000010000 + 0x10000000005000000000100000000100000000004001c) 0x10000f + 0x130000000000000000001000000000060000000001001e 0xf0023 0xf000d + 0x140000000000000000088d000000000400000000010020 0x15000000000000000000110000000000001f) (.leaf8 + 0x100023 0x10000d 0x15000000000000000000020000000009001f 0x100000000030023 + 0x170000000000000000003a000000000500000000000020 0x1900000000000000000016000000000c001f 0x150023 + 0x15000d))) (.bin (.bin (.leaf8 0x1a000000000000000001b4000000000600000000010020 + 0x1b00000000000000000017000000000b001f (h240 0x1000000001800000000010000 + 0x10000000002000000000100000000190000000004001c) 0x19000f + 0x1d00000000000000000019000000000c0000000001001e 0x180023 0x18000d + 0x1e00000000000000000009000000000700000000010020) (.leaf8 0x1f0000000000000000001a0000000006001f + 0x190023 0x19000d 0x1f0000000000000000001c0000000010001f 0x1b0023 0x1b000d + 0x2000000000000000000056000000000800000000010020 0x2000e)) (.bin (.leaf8 + 0x100000000000000000001000000001e0000000002001c 0x1e000f + 0x230000000000000000001e00000000110000000001001e 0x1d0023 0x1d000d + 0x2400000000000000000000000000000900000000010020 0x25000000000000000000200000000000001f 0x1f0023) + (.leaf8 0x1f000d 0x25000000000000000000020000000013001f 0x100000000030023 + 0x2700000000000000000010000000000a00000000000020 0xa000e + 0x10000000026000000000100000000280000000002001c 0x28000f + 0x2b0000000000000000002800000000150000000001001e)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x270023 0x27000d 0x2c00000000000000000001000000000c00000000010020 0x29000e (h240 0x10000 + 0x10000000002000000000100000000040000000003001c) 0x4000f + 0x2f0000000000000000000400000000190000000001001e (h240 0x1000000000500000000010000 + 0x1000000002e000000000100000000010000000004001c)) (.leaf8 0x1000f + 0x320000000000000000000100000000030000000001001e 0x2e0000000000000b 0x50014 0x2e000e 0x6200c6 + 0x10043 0x70142)) (.bin (.leaf8 0x101c3 0x80009 0x200000000010019 0x2e0000000000001d 0x23 + 0x300000000000000000001009c 0x80003 0x8000f) (.leaf8 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x42df20000000000000000000100000000010000 + 0x1d65000000000300000000010000000002000000000200000000000000) + 0x10000000005000000d5f10000000006000000000100000000000000) + 0x100000000020000000001000000000800000005ee00000000090000) + 0x1000000000b0000002ac8000000000c000000000100000000030000) + 0x100000000000000000001000000000e000000012d000000000f0000) + 0x1000000000000000000010000000005000000000100000000110000) + 0x88f000000001200000000010000000003000000000100000000000000) + 0x10000000014000000003a0000000015000000000100000000170000) + 0x1b6000000001800000000010000000000000000000100000000020000) + 0x1000000001a000000000b000000001b0000000001000000001d0000) + 0x57000000001e00000000010000000003000000000100000000000000) + 0x1000000001f00000000020000000021000000000100000000030000) + 0x1000000000000000000010000000023000000001000000000240000) + 0x1000000000b00000000010000000026000000000100000000290000) + 0x3000000002a00000000010000000000000000000100000000010000) + 0x2f000000000100000000000000000008000000001d0000000001001e) 0x8000b 0x10014 + 0x2a00000000030000000000000000000200000000020000000000001f 0x20009 0x20021 0x10000000028001a + 0x2600000000270016))) (.bin (.bin (.leaf8 0x2400000000090016 0x70000000022001a 0x2300000000220016 + 0x30014 0x250010 0x10021 0x1000000001f001a 0x1d0016) (.leaf8 0x1e00000000010016 0x2b000000001c001a + 0x1b000000001b0016 0x50000000019001a 0x200000000180016 0x180014 0x40010 0x10021)) (.bin (.leaf8 + 0xda0000000016001a 0x1700000000160016 0x1d0000000013001a 0x120016 0x1200000000010016 + 0x4470000000010001a 0x5000000000f0016 0xf0014) (.leaf8 0x70010 0x10021 0x96000000000d001a 0xc0016 + 0xc00000000010016 0x1563000000000a001a 0xb000000000a0016 0x2f70000000007001a)))) (.bin (.bin (.bin + (.leaf8 0x200000000060016 0x60014 0x40010 0x10021 0x6af80000000004001a 0x30016 0x20014 0x20010) + (.leaf8 0x10021 0xeb20000000001001a 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x2000000000200000000010000000eb1000000000000000000010020)) (.bin (.leaf8 0x4000e + 0x200000000040000000001000000000200000000000000000000001e 0x100000000030023 + 0x2000000000600000000010000006af7000000000100000000000020 0x8000e + 0x200000000080000000001000000000400000000020000000000001e 0x100000000050023 + 0x2000000000a000000000100000002f6000000000200000000000020) (.leaf8 + 0x2000000000c0000000001000000000d0000000006001f 0xc0023 0xc000d + 0x2000000000d00000000010000001562000000000300000000010020 + 0x2000000000e0000000001000000000e0000000000001f 0xd0023 0xd000d + 0x2000000000e000000000100000000020000000007001f))) (.bin (.bin (.leaf8 0x100000000030023 + 0x2000000001000000000010000000095000000000400000000000020 0x11000e + 0x200000000120000000001000000000700000000080000000000001e 0x100000000080023 + 0x20000000014000000000100000002af000000000500000000000020 + 0x20000000016000000000100000000140000000000001f (h240 0x100000000000000 + 0x100000000170000000000000000001400000000090000000000001e)) (.leaf8 0x130023 0x13000d + 0x1800000000000000000195000000000500000000010020 0x18000000000000000000140000000000001f 0x130023 + 0x13000d 0x1800000000000000000002000000000b001f 0x100000000030023)) (.bin (.leaf8 + 0x1a0000000000000000001c000000000600000000000020 0x1c00000000000000000019000000000e001f 0x180023 + 0x18000d 0x1d000000000000000000d9000000000700000000010020 0x1a000e + 0x1e00000000000000000004000000000e0000000000001e 0x100000000050023) (.leaf8 + 0x2000000000000000000004000000000800000000000020 0x220000000000000000001d0000000011001f + 0x1000000001e0023 0x230000000000000000002a000000000900000000000020 + 0x25000000000000000000200000000000001f 0x1f0023 0x1f000d + 0x25000000000000000000020000000012001f))))) (.bin (.bin (.bin (.bin (.leaf8 0x100000000020023 + 0x2700000000000000000000000000000a00000000000020 0x5000e + 0x290000000000000000002500000000150000000000001e 0x240023 0x24000d + 0x2a00000000000000000006000000000b00000000010020 0x2b000000000000000000260000000005001f) (.leaf8 + (h240 0x10000 0x2700000000010000000000000000000100000000270000000003001c) 0x27000f + 0x2c0000000000000000002700000000180000000001001e 0x100000000280023 + 0x2e00000000000000000000000000000d00000000000020 0x2c000e + 0x10000000004000000000100000000020000000002001c 0x2000f)) (.bin (.leaf8 + 0x310000000000000000000200000000010000000001001e 0x40000000002000b 0x2c000000002b0016 0x280014 + 0x27000000002a00000000000000000002000000002e0000000000001f 0x2e0009 0x20021 0x30000000025001a) + (.leaf8 0x2600000000250016 0x2300000000040016 0x14 0x250010 0x10021 0x2100000000000016 + 0x15000000001f001a 0x1e0016))) (.bin (.bin (.leaf8 0x2000000001c001a 0x1d000000001c0016 0x50014 + 0x1f0010 0x10021 0x6d0000000019001a 0x1a00000000190016 0xe0000000016001a) (.leaf8 0x150016 + 0x1500000000010016 0x2230000000013001a 0x120016 0x1200000000060016 0x4a0000000010001a + 0x1100000000100016 0x30014)) (.bin (.leaf8 0x130010 0x10021 0xab2000000000d001a 0xc000000000c0016 + 0x17a000000000a001a 0xb000000000a0016 0x50014 0xd0010) (.leaf8 0x10021 0x357c0000000007001a + 0x60016 0x500000000010016 0x7590000000004001a 0x300000000020016 0x10b8b0000000001001a 0x16)))) + (.bin (.bin (.bin (.leaf8 0x14 0x2000e 0x10022 + 0x200000000020000000001000000249a000000000000000000000020 (h240 0x100000000000000 + 0x100000000050000000000000000e6ef000000000000000000010020) 0x6000000000000000000050000000000001f + 0x100000000050023 0x800000000000000000758000000000100000000000020) (.leaf8 + 0xa000000000000000000070000000000001f 0x60023 0x6000d 0xb000000000000000000020000000003001f + 0x100000000030023 0xd0000000000000000357b000000000200000000000020 0x7000e + 0x100000000000000000000d00000000050000000000001e)) (.bin (.leaf8 0xc0023 0xc000d + 0x1100000000000000000179000000000300000000010020 0x120000000000000000000e0000000007001f + 0x1000000000f0023 0x1300000000000000000ab1000000000400000000000020 0x5000e + 0x160000000000000000001300000000090000000000001e) (.leaf8 0x120023 0x12000d + 0x1700000000000000000049000000000500000000010020 0x18000000000000000000140000000003001f (h240 + 0x10000 0x1500000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1900000000000000000001000000000a0000000001001e 0x100000000020023))) (.bin (.bin (.leaf8 + 0x1b00000000000000000222000000000600000000000020 0x1d000000000000000000170000000000001f 0x160023 + 0x16000d 0x1d00000000000000000002000000000d001f 0x100000000030023 + 0x1f0000000000000000000d000000000700000000000020 0x210000000000000000001c0000000010001f) (.leaf8 + 0x1b0023 0x1b000d 0x220000000000000000006c000000000800000000010020 0x7000e + 0x240000000000000000001f00000000110000000000001e 0x1e0023 0x1e000d + 0x2500000000000000000001000000000900000000010020)) (.bin (.leaf8 + 0x26000000000000000000020000000013001f 0x100000000030023 + 0x2800000000000000000014000000000a00000000000020 0x23000e (h240 0x10000 + 0x10000000002000000000100000000250000000003001c) 0x25000f + 0x2c0000000000000000002500000000000000000001001e 0x240023) (.leaf8 0x24000d + 0x2d000000000000000000280000000018001f 0x270023 0x27000d + 0x2e00000000000000000002000000000c00000000010020 0x29000e + 0x1000000002b0000000001000000002e0000000002001c 0x2e000f))))))) (.bin (.bin (.bin (.bin (.bin + (.bin (.leaf8 0x300000000000000000002e00000000190000000001001e 0x2d0023 0x2d000d + 0x31000000000000000000060000000000001f 0x2f0000000006000b 0x2a00000000290016 0x10000000028001a + 0x2900000000280016) (.leaf8 0x200000000240016 0x240014 0x40010 0x10021 0xa0000000022001a 0x210016 + 0x2100000000010016 0x20000000001f0016)) (.bin (.leaf8 0x1e00000000060016 0x36000000001c001a + 0x1b000000001b0016 0x60000000019001a 0x180016 0x1800000000010016 0x1110000000016001a 0x150016) + (.leaf8 0x16 0x250000000013001a 0x1400000000130016 0x1200000000040016 0x5580000000010001a 0xf0016 + 0xbd000000000d001a 0xe000000000d0016))) (.bin (.bin (.leaf8 0xc00000000060016 0x1abd000000000a001a + 0x90016 0x800000000010016 0x3ac0000000007001a 0x60016 0x50014 0x20010) (.leaf8 0x10021 + 0x85c50000000004001a 0x30016 0x124e0000000001001a 0x16 0x14 0x2000e 0x10022)) (.bin (.leaf8 + 0x200000000020000000001000000124d000000000000000000000020 + 0x20000000004000000000100000000020000000001001f 0x100000000030023 + 0x20000000006000000000100000085c4000000000100000000000020 0x7000e + 0x200000000090000000001000000000200000000020000000000001e 0x100000000030023 + 0x2000000000b000000000100000003ab000000000200000000000020) (.leaf8 + 0x2000000000d0000000001000000000a0000000000001f 0x90023 0x9000d + 0x2000000000e000000000100000000020000000005001f 0x100000000030023 + 0x2000000001000000000010000001abc000000000300000000000020 + 0x200000000120000000001000000000e0000000003001f (h240 0x10000 + 0xf000000000100000000000000000001000000000f0000000003001c))))) (.bin (.bin (.bin (.leaf8 0xf000f + 0x200000000130000000001000000000f00000000070000000001001e 0xe0023 0xe000d + 0x20000000014000000000100000000bc000000000400000000010020 + 0x20000000015000000000100000000020000000009001f 0x100000000030023 + 0x200000000170000000001000000035a000000000500000000000020) (.leaf8 + 0x20000000019000000000100000000140000000001001f (h240 0x100000000000000 + 0x1000000001a0000000000000000001400000000080000000000001e) 0x130023 0x13000d + 0x1b000000000000000001fb000000000500000000010020 0x1b000000000000000000140000000002001f 0x130023 + 0x13000d)) (.bin (.leaf8 0x1b00000000000000000016000000000c001f 0x150023 0x15000d + 0x1c00000000000000000024000000000600000000010020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x1f00000000000000000001000000000c0000000001001e) (.leaf8 0x100000000020023 + 0x2100000000000000000110000000000700000000000020 0x230000000000000000001a0000000000001f 0x190023 + 0x19000d 0x2300000000000000000002000000000f001f 0x100000000030023 + 0x2500000000000000000005000000000800000000000020))) (.bin (.bin (.leaf8 + 0x270000000000000000001d0000000011001f 0x1000000001e0023 + 0x2800000000000000000035000000000900000000000020 0x2a000000000000000000200000000003001f (h240 + 0x10000 0x2100000000010000000000000000000100000000210000000003001c) 0x21000f + 0x2b0000000000000000002100000000130000000001001e 0x200023) (.leaf8 0x20000d + 0x2c000000000000000000230000000000001f 0x220023 0x22000d 0x2d000000000000000000020000000015001f + 0x100000000030023 0x2f00000000000000000009000000000b00000000000020 0x26000e)) (.bin (.leaf8 + 0x310000000000000000000400000000160000000000001e (h240 0x10000 + 0x5000000000100000000000000000001000000002a0000000003001c) 0x2a000f + 0x330000000000000000002a00000000190000000001001e 0x290023 0x29000d + 0x3400000000000000000000000000000d00000000010020 0x350000000000000000002c000000001a001f) (.leaf8 + (h240 0x10000 0x2c00000000020000000000000000000100000000300000000003001c) 0x30000f + 0x370000000000000000003000000000020000000001001e 0x2f000b 0x2c0014 0x20010 0x10021 + 0x2b000000002b0016))))) (.bin (.bin (.bin (.bin (.leaf8 0x50014 0x2d0010 0x10021 0x50000000025001a + 0x240016 0x2400000000010016 0x200016 0x1b000000001f001a) (.leaf8 0x1e0016 0x3000000001c001a + 0x1b0016 0x1b00000000010016 0x880000000019001a 0x180016 0x16 0x1800000000010016)) (.bin (.leaf8 + 0x120000000016001a 0x1500000000150016 0x2ab0000000013001a 0x1400000000130016 0x30014 0x160010 + 0x10021 0x5e0000000010001a) (.leaf8 0x1000000000100016 0xf0014 0x120010 0x10021 + 0xd5e000000000d001a 0xc0016 0xb00000000010016 0x1d5000000000a001a))) (.bin (.bin (.leaf8 + 0xb000000000a0016 0x30014 0xd0010 0x10021 0x900000000060016 0x42e10000000007001a 0x800000000070016 + 0x30014) (.leaf8 0xa0010 0x10021 0x9260000000004001a 0x500000000040016 0x30014 0x70010 0x10021 + 0x14e6b0000000001001a)) (.bin (.leaf8 0x200000000010016 0x14 + 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x2000000000200000000010000002de5000000000000000000010020 0x50010 0x40021) (.leaf8 0x17 0x1d + 0x103c3 (h240 0x2de8000000000300000000010000 + 0x50000002de60000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000300000000000000012083000000000000000000010020) + 0x5000e 0x50000000000000000000700000000010000000000001e)))) (.bin (.bin (.bin (.leaf8 0x60023 + 0x6000d 0x600000000000000000925000000000100000000010020 0x5000e + 0x80000000000000000000a00000000030000000000001e 0x90023 0x9000d + 0x9000000000000000042e0000000000200000000010020) (.leaf8 0xa0000000000000000000b0000000003001f + (h240 0x1000000000c00000000010000 0x100000000050000000001000000000d0000000004001c) 0xd000f + 0xc0000000000000000000d00000000040000000001001e 0xc0023 0xc000d + 0xd000000000000000001d4000000000300000000010020 0xe0000000000000000000d0000000000001f)) (.bin + (.leaf8 0xc0023 0xc000d 0xf000000000000000000020000000007001f 0x100000000030023 + 0x1100000000000000000d5d000000000400000000000020 0x11000e + 0x130000000000000000001200000000090000000000001e 0x110023) (.leaf8 0x11000d + 0x140000000000000000005d000000000500000000010020 0x5000e + 0x1600000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x17000000000000000002aa000000000600000000010020 0x1800000000000000000017000000000d001f))) (.bin + (.bin (.leaf8 0x100000000180023 0x1900000000000000000011000000000700000000000020 + 0x1b0000000000000000001a0000000000001f 0x190023 0x19000d 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f) (.leaf8 + 0x1d00000000000000000001000000000e0000000001001e 0x100000000020023 + 0x1f00000000000000000087000000000800000000000020 0x210000000000000000001d0000000000001f 0x1c0023 + 0x1c000d 0x21000000000000000000020000000011001f 0x100000000030023)) (.bin (.leaf8 + 0x2300000000000000000002000000000900000000000020 0x25000000000000000000020000000013001f + 0x100000000030023 0x270000000000000000001a000000000a00000000000020 + 0x29000000000000000000020000000014001f (h240 0x10000 + 0x200000000020000000000000000000100000000250000000003001c) 0x25000f 0x2b0000000000001d) (.leaf8 + 0x240023 0x24000d 0x2c000000000000000000020000000017001f 0x100000000030023 + 0x2e00000000000000000004000000000c00000000000020 0x7000e + 0x310000000000000000002d000000001b0000000000001e 0x2c0023)))))) (.bin (.bin (.bin (.bin (.bin + (.leaf8 0x2c000d 0x2e000e 0x3300000000000000000002000000001d0000000000001e 0x2f0000000002000b + 0x8000000002c0016 0x20000000028001a 0x270016 0x2600000000010016) (.leaf8 0x14 0x280010 0x10021 + 0x2400000000000016 0xc0000000022001a 0x2300000000220016 0x30014 0x250010)) (.bin (.leaf8 0x10021 + 0x1000000001f001a 0x1e0016 0x1e00000000010016 0x43000000001c001a 0x1d000000001c0016 0x20014 + 0x3000000000400000000000000000002000000001f0000000000001f) (.leaf8 0x1f0009 0x10021 + 0x90000000019001a 0x180016 0x1560000000016001a 0x600000000150016 0x2f0000000013001a + 0x1200000000110016))) (.bin (.bin (.leaf8 0x6ae0000000010001a 0x1100000000100016 0x30014 0x130010 + 0x10021 0xf000000000c0016 0xea000000000d001a 0x5000000000c0016) (.leaf8 0xc0014 0x70010 0x10021 + 0x2170000000000a001a 0xb000000000a0016 0x900000000040016 0x4920000000007001a 0x800000000070016)) + (.bin (.leaf8 0xa7360000000004001a 0x300000000030016 0x16f30000000001001a 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d) (.leaf8 + 0x20000000002000000000100000016f2000000000000000000010020 + 0x20000000003000000000100000000050000000001001f 0x100000000060023 + 0x200000000040000000001000000a735000000000100000000000020 + 0x200000000060000000001000000000a0000000004001f 0x90023 0x9000d + 0x2000000000700000000010000000491000000000200000000010020)))) (.bin (.bin (.bin (.leaf8 + 0x200000000080000000001000000000b0000000002001f 0xa0023 0xa000d + 0x200000000080000000001000000000d0000000006001f 0xc0023 0xc000d + 0x200000000090000000001000000216f000000000300000000010020 0xe000e) (.leaf8 + 0x2000000000a0000000001000000000700000000060000000000001e 0x100000000080023 + 0x2000000000c000000000100000000e9000000000400000000000020 + 0x2000000000e000000000100000000110000000007001f (h240 0x1000000001200000000010000 + 0x10000000005000000000100000000130000000004001c) 0x13000f + 0x200000000100000000001000000001300000000080000000001001e 0x120023)) (.bin (.leaf8 0x12000d + 0x2000000001100000000010000000432000000000500000000010020 (h240 0x100000000000000 + 0x100000000130000000000000000027a000000000500000000010020) 0x1400000000000000000014000000000a001f + 0x100000000140023 0x160000000000000000002e000000000600000000000020 + 0x1800000000000000000008000000000d001f 0x100000000090023) (.leaf8 + 0x1a00000000000000000155000000000700000000000020 0x1c00000000000000000002000000000f001f + 0x100000000030023 0x1e00000000000000000008000000000800000000000020 0x5000e + 0x100000000050000000001000000001f0000000002001c 0x1f000f + 0x220000000000000000001f000000000f0000000001001e))) (.bin (.bin (.leaf8 0x1e0023 0x1e000d + 0x2300000000000000000042000000000900000000010020 0x24000000000000000000200000000000001f 0x1f0023 + 0x1f000d 0x24000000000000000000020000000013001f 0x100000000030023) (.leaf8 + 0x2600000000000000000000000000000a00000000000020 0x5000e + 0x280000000000000000002500000000150000000000001e 0x240023 0x24000d + 0x290000000000000000000b000000000b00000000010020 0x26000e (h240 0x10000 + 0x10000000002000000000100000000270000000003001c))) (.bin (.leaf8 0x27000d + 0x2d000000000000000000020000000019001f 0x100000000030023 + 0x2f00000000000000000001000000000d00000000000020 0x310000000000000000000a000000001c001f (h240 + 0x10000 0xa00000000020000000000000000000100000000300000000003001c) 0x30000f 0x330000000000001d) + (.leaf8 0x30000b 0xa0014 0x20010 0x10021 0x2c000000002b0016 0x30014 0x2e0010 0x10021))))) (.bin + (.bin (.bin (.bin (.leaf8 0x200000000270016 0x270014 0x40010 0x10021 0x60000000025001a + 0x600000000240016 0x210016 0x2100000000010016) (.leaf8 0x21000000001f001a 0x20000000001f0016 + 0x600000000030016 0x4000000001c001a 0x1b0016 0x1b00000000010016 0xaa0000000019001a 0x180016)) + (.bin (.leaf8 0x1800000000070016 0x160000000016001a 0x1700000000160016 0x14 0x190010 0x10021 + 0x1500000000120016 0x3560000000013001a) (.leaf8 0x1400000000130016 0x30016 0x750000000010001a + 0xf0016 0xf00000000060016 0x10b8000000000d001a 0xc000000000c0016 0x249000000000a001a))) (.bin + (.bin (.leaf8 0x900000000090016 0x539a0000000007001a 0x60016 0xb7a0000000004001a 0x300000000020016 + 0x1a20a0000000001001a 0x16 0x14) (.leaf8 0x2000e 0x10022 + 0x2000000000200000000010000003942000000000000000000000020 (h240 0x100000000000000 + 0x10000000005000000000000000168c6000000000000000000010020) 0x6000000000000000000050000000000001f + 0x100000000050023 0x800000000000000000b79000000000100000000000020 + 0xa000000000000000000020000000003001f)) (.bin (.leaf8 0x100000000030023 + 0xc00000000000000005399000000000200000000000020 0xe0000000000000000000b0000000005001f + 0x1000000000c0023 0xf00000000000000000248000000000300000000000020 + 0x110000000000000000000e0000000007001f 0x1000000000f0023 + 0x12000000000000000010b7000000000400000000000020) (.leaf8 0x14000000000000000000110000000003001f + (h240 0x10000 0x1200000000010000000000000000000100000000010000000003001c) 0x1000f + 0x150000000000000000000100000000080000000001001e 0x100000000020023 + 0x1700000000000000000074000000000500000000000020 0x19000000000000000000020000000001001f (h240 + 0x10000 0x300000000010000000000000000000100000000150000000003001c))))) (.bin (.bin (.bin (.leaf8 + 0x15000f 0x1b00000000000000000015000000000b0000000001001e 0x140023 0x14000d + 0x1c00000000000000000355000000000600000000010020 0x1d00000000000000000017000000000b001f (h240 + 0x1000000001800000000010000 0x10000000002000000000100000000190000000004001c) 0x19000f) (.leaf8 + 0x1f00000000000000000019000000000c0000000001001e 0x180023 0x18000d + 0x2000000000000000000015000000000700000000010020 0x210000000000000000001a0000000004001f 0x190023 + 0x19000d 0x2100000000000000000002000000000f001f)) (.bin (.leaf8 0x100000000030023 + 0x23000000000000000000a9000000000800000000000020 0x250000000000000000001d0000000000001f 0x1c0023 + 0x1c000d 0x25000000000000000000020000000011001f 0x100000000030023 + 0x2700000000000000000003000000000900000000000020) (.leaf8 0x29000000000000000000080000000001001f + (h240 0x10000 0x900000000010000000000000000000100000000210000000003001c) 0x21000f + 0x2b0000000000000000002100000000130000000001001e 0x200023 0x20000d + 0x2c00000000000000000020000000000a00000000010020 0x2d000000000000000000230000000000001f))) (.bin + (.bin (.leaf8 0x220023 0x22000d 0x2d000000000000000000020000000015001f (h240 0x10000 + 0x300000000010000000000000000000100000000070000000003001c) 0x7000f + 0x2f0000000000000000000700000000160000000001001e 0x100000000080023 + 0x3100000000000000000005000000000c00000000000020) (.leaf8 0x29000e + 0x330000000000000000000400000000180000000000001e (h240 0x1000000000500000000010000 + 0x100000000050000000001000000002e0000000004001c) 0x2e000f + 0x360000000000000000002e000000001a0000000001001e 0x2d0023 0x2d000d 0xc000e)) (.bin (.leaf8 + 0x3800000000000000000002000000001e0000000000001e 0xd0000000001000b 0x5000000002d0016 0x50014 + 0x70010 0x10021 0x30000000028001a 0x270016) (.leaf8 0x60016 0x2400000000010016 0x100000000022001a + 0x2200000000220016 0x90014 0x240010 0x10021 0x1000000001f001a)))))))))) + +set_option maxRecDepth 20000 in +def st_2 : CertTree := + (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x20000000001f0016 0x30014 0x220010 + 0x10021 0x55000000001c001a 0x1b0016 0x1b00000000010016 0xb0000000019001a) (.leaf8 + 0x200000000180016 0x180014 0x40010 0x10021 0x1ab0000000016001a 0x140016 0x1500000000010016 + 0x390000000013001a)) (.bin (.leaf8 0x1400000000130016 0x20014 + 0x1200000000040000000000000000000200000000160000000000001f 0x160009 0x20021 0x85b0000000010001a + 0x1100000000100016 0xf0014) (.leaf8 0x130010 0x10021 0x124000000000d001a 0xc0016 + 0x29cd000000000a001a 0x90016 0x900000000010016 0x5bc0000000007001a))) (.bin (.bin (.leaf8 0x60016 + 0x50014 0x20010 0x10021 0xd1040000000004001a 0x500000000040016 0x30014 0x70010) (.leaf8 0x10021 + 0x1ca10000000001001a 0x200000000010016 0x14 0x20000000000000000000100000000040000000000001f + 0x30023 0x3000d 0x2000000000200000000010000001ca0000000000000000000010020)) (.bin (.leaf8 0x5000e + 0x200000000030000000001000000000700000000010000000000001e 0x60023 0x6000d + 0x200000000040000000001000000d103000000000100000000010020 0x7000e + 0x200000000060000000001000000000200000000020000000000001e 0x100000000030023) (.leaf8 + 0x20000000008000000000100000005bb000000000200000000000020 + 0x2000000000a0000000001000000000b0000000000001f 0xa0023 0xa000d + 0x2000000000a000000000100000000020000000005001f 0x100000000030023 + 0x2000000000c000000000100000029cc000000000300000000000020 + 0x2000000000e000000000100000000020000000007001f)))) (.bin (.bin (.bin (.leaf8 0x100000000030023 + 0x2000000001000000000010000000123000000000400000000000020 0x11000e + 0x200000000120000000001000000001300000000090000000000001e 0x120023 0x12000d + 0x2000000001300000000010000000543000000000500000000010020 + 0x20000000014000000000100000000140000000005001f) (.leaf8 0x140009 0x150021 0x17 0x1d 0x103c3 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 0x4154a0000 + 0x3000000000100000000050000001ca2000000000600000000010000) + 0x8000000d10400000000090000000001000000000800000000010000) + 0x3000000000100000000000000000001000000000b00000005bc0000) + 0xc000000000100000000030000000001000000000000000000010000) + 0xe00000029cc000000000f0000000001000000000300000000010000) + 0x100000000110000000124000000001200000000010000) + 0x1400000005440000000015000000000100000000140000000015001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000140000000000000000001400000000020000000001001e))) + (.bin (.leaf8 0x130023 0x13000d 0x1600000000000000000315000000000500000000010020 0x14000e + 0x10000000005000000000100000000160000000002001c 0x16000f + 0x170000000000000000001600000000090000000001001e 0x150023) (.leaf8 0x15000d + 0x1800000000000000000038000000000600000000010020 0x19000000000000000000170000000000001f 0x160023 + 0x16000d 0x1900000000000000000002000000000c001f 0x100000000020023 + 0x1b000000000000000001aa000000000700000000000020))) (.bin (.bin (.leaf8 0x1a000e + 0x1d00000000000000000004000000000e0000000000001e 0x100000000050023 + 0x1f0000000000000000000a000000000800000000000020 0x210000000000000000001d0000000000001f 0x1c0023 + 0x1c000d 0x21000000000000000000020000000011001f) (.leaf8 0x100000000030023 + 0x2300000000000000000054000000000900000000000020 0x5000e + 0x260000000000000000002200000000130000000000001e 0x210023 0x21000d + 0x2700000000000000000000000000000a00000000010020 0xb000e)) (.bin (.leaf8 + 0x290000000000000000002400000000150000000000001e 0x230023 0x23000d + 0x2a0000000000000000000f000000000b00000000010020 0x2b000000000000000000260000000000001f 0x250023 + 0x25000d 0x2b000000000000000000020000000003001f) (.leaf8 (h240 0x10000 + 0x300000000010000000000000000000100000000010000000003001c) 0x1000f + 0x2d0000000000000000000100000000180000000001001e 0x100000000020023 + 0x2f00000000000000000002000000000d00000000000020 0x7000e + 0x3200000000000000000007000000001c0000000000001e (h240 0x10000 + 0x8000000000100000000000000000001000000000e0000000003001c)))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x20186 0x10043 0xe0142 0x101c3 0xf0023 0x2200c6 0x10043 0x10303) (.leaf8 0x10009 0x8 0x10009 + 0x10021 0x10000000006001a 0x1000000002b001a 0x2a0016 0x16)) (.bin (.leaf8 0x2700000000010016 + 0x80000000025001a 0xc00000000230016 0x2300000000220016 0x2100000000040016 0x29000000001f001a + 0x20000000001f0016 0x30014) (.leaf8 0x220010 0x10021 0x5000000001c001a 0x1d000000001c0016 0x50014 + 0x1f0010 0x10021 0xd50000000019001a))) (.bin (.bin (.leaf8 0x1a00000000190016 0x14 0x1c0010 + 0x10021 0x1800000000000016 0x1c0000000016001a 0x1700000000160016 0x1500000000030016) (.leaf8 + 0x42d0000000013001a 0x1400000000130016 0x920000000010001a 0xf0016 0xf00000000010016 + 0x14e5000000000d001a 0xe000000000d0016 0x30014)) (.bin (.leaf8 0x100010 0x10021 + 0x2de000000000a001a 0x90016 0x800000000010016 0x68820000000007001a 0x600000000060016 + 0xe500000000004001a) (.leaf8 0x500000000040016 0x20aa50000000001001a 0x3001d + 0x1000000000100000000010000004760000000000000000000000020 0x50010 0x60021 0x17 0x1d)))) (.bin + (.bin (.bin (.leaf8 0x103c3 (h240 (h240 0x47610000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x500000047600000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x200000000050000000000000001c342000000000000000000010020) + 0x7000000000000000000070000000002001f 0x60023 0x6000d + 0x800000000000000000e4f000000000100000000010020) (.leaf8 0x9000000000000000000080000000003001f + 0x100000000090023 0xa00000000000000006881000000000200000000000020 + 0xc0000000000000000000a0000000000001f 0x90023 0x9000d 0xd000000000000000000020000000005001f + 0x100000000030023)) (.bin (.leaf8 0xf000000000000000002dd000000000300000000000020 0x5000e + 0x120000000000000000001000000000070000000000001e 0xf0023 0xf000d + 0x13000000000000000014e4000000000400000000010020 0x14000000000000000000110000000000001f 0x100023) + (.leaf8 0x10000d 0x14000000000000000000020000000009001f 0x100000000030023 + 0x1600000000000000000091000000000500000000000020 0x1800000000000000000016000000000c001f 0x150023 + 0x15000d 0x190000000000000000042c000000000600000000010020))) (.bin (.bin (.leaf8 + 0x1a000000000000000000170000000001001f (h240 0x10000 + 0x1800000000010000000000000000000100000000180000000003001c) 0x18000f + 0x1b00000000000000000018000000000d0000000001001e 0x170023 0x17000d + 0x1c0000000000000000001b000000000700000000010020 0x1a000e) (.leaf8 (h240 0x10000 + 0x100000000020000000001000000001c0000000003001c) 0x1c000f + 0x1f0000000000000000001c000000000e0000000001001e 0x1b0023 0x1b000d + 0x20000000000000000000d4000000000800000000010020 0x7000e + 0x220000000000000000001f00000000110000000000001e)) (.bin (.leaf8 0x1e0023 0x1e000d + 0x2300000000000000000004000000000900000000010020 0x5000e + 0x250000000000000000002200000000130000000000001e 0x210023 0x21000d + 0x2600000000000000000028000000000a00000000010020) (.leaf8 0x27000000000000000000230000000002001f + 0x220023 0x22000d 0x27000000000000000000250000000016001f 0x240023 0x24000d + 0x280000000000000000000e0000000016001f 0x1000000000e0023)))))) (.bin (.bin (.bin (.bin (.bin + (.leaf8 0x2a00000000000000000007000000000c00000000000020 0x2c000000000000000000290000000000001f + 0x280023 0x28000d 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x2e00000000000000000001000000001a0000000001001e) (.leaf8 0x100000000020023 + 0x3000000000000000000000000000000e00000000000020 0x310000000000000000000a0000000003001f (h240 + 0x1000000000b00000000010000 0x10000000001000000000100000000010000000004001c) 0x1000f + 0x340000000000000000000100000000070000000001001e 0x10000000000000b 0xb0014)) (.bin (.leaf8 0x1000e + 0x800c6 0x10043 0xd0142 0x101c3 0xe0009 0x2f00000000010019 0x300000000000001d) (.leaf8 0x2d0023 + 0x300000000000000000001009c 0xe0003 0xe000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 0xa354e00000000000000000001000000000100000047610000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x50000020aa40000000006000000000100000000080000000e510000) + 0x9000000000100000000000000000001000000000b00000068810000) + 0xc0000000001000000000b0000000001000000000300000000010000) + 0x1000000000e00000002dd000000000f00000000010000) + 0x60000000001000000001100000014e6000000001200000000010000) + 0x3000000000100000000000000000001000000001400000000910000) + 0x1500000000010000000017000000042e000000001800000000010000) + 0x10000000019000000001d000000001b00000000010000) 0x100000000020000000001000000001d00000000d50000) + 0x1e000000000100000000080000000001000000002000000000050000) + 0x210000000001000000000600000000010000000023000000002a0000) + 0x24000000000100000000260000000001000000000e00000000020000) + 0x100000000290000000008000000002a00000000010000) + 0x3000000000100000000000000000001000000000200000000010000) + 0x1000000002e000000003100000000010000000000001d) 0xe000b 0x2e0014 + 0x200000000300000000000000000000200000000020000000000001f))) (.bin (.bin (.leaf8 (h240 0x30000 + 0x400000000010000000002000000000200000000000000000000001e) 0x20009 0x20021 0x40000000028001a + 0x270016 0xe0014 0x20010 0x10021) (.leaf8 0x2400000000240016 0x140000000022001a 0x2300000000220016 + 0x2100000000040016 0x2000000001f001a 0x8000000001e0016 0x6a000000001c001a 0x1d000000001c0016)) + (.bin (.leaf8 0x16 0xe0000000019001a 0x1900000000190016 0x180014 0x1b0010 0x10021 + 0x2160000000016001a 0x1700000000160016) (.leaf8 0x480000000013001a 0x1400000000130016 0x30014 + 0x160010 0x10021 0xa730000000010001a 0x6000000000f0016 0x16e000000000d001a)))) (.bin (.bin (.bin + (.leaf8 0xe000000000d0016 0x30014 0x100010 0x10021 0xc00000000090016 0x3440000000000a001a 0x90016 + 0x7280000000007001a) (.leaf8 0x800000000070016 0x105520000000004001a 0x30016 0x20014 0x20010 + 0x10021 0x23b00000000001001a 0x100000000010016)) (.bin (.leaf8 0x14 + 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x20000000002000000000100000023af000000000000000000010020 0x4000e + 0x200000000040000000001000000000200000000000000000000001e 0x100000000030023) (.leaf8 + 0x2000000000600000000010000010551000000000100000000000020 + 0x200000000080000000001000000000a0000000004001f 0x90023 0x9000d + 0x2000000000900000000010000000727000000000200000000010020 + 0x2000000000a000000000100000000020000000005001f 0x100000000030023 + 0x2000000000c0000000001000000343f000000000300000000000020))) (.bin (.bin (.leaf8 + 0x2000000000e0000000001000000000e0000000005001f (h240 0x1000000000f00000000010000 + 0x10000000005000000000100000000100000000004001c) 0x10000f + 0x200000000100000000001000000001000000000060000000001001e 0xf0023 0xf000d + 0x200000000110000000001000000016d000000000400000000010020 + 0x20000000012000000000100000000080000000009001f) (.leaf8 0x100000000090023 + 0x2000000001400000000010000000695000000000500000000000020 + 0x20000000016000000000100000000140000000003001f (h240 0x100000000000000 + 0x100000000170000000000000000001400000000060000000000001e) 0x130023 0x13000d + 0x18000000000000000003db000000000500000000010020 0x5000e)) (.bin (.leaf8 + 0x1900000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x1a00000000000000000047000000000600000000010020 0x1b00000000000000000019000000000e001f 0x180023 + 0x18000d 0x1c00000000000000000215000000000700000000010020) (.leaf8 0x1a000e + 0x1d0000000000000000001b000000000f0000000000001e 0x1a0023 0x1a000d + 0x1e0000000000000000000d000000000800000000010020 0x2000e + 0x100000000000000000001000000001e0000000002001c 0x1e000f))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x210000000000000000001e00000000110000000001001e 0x1d0023 0x1d000d + 0x2200000000000000000069000000000900000000010020 0x230000000000000000000a0000000013001f + 0x1000000000b0023 0x2500000000000000000001000000000a00000000000020 + 0x27000000000000000000230000000002001f) (.leaf8 0x220023 0x22000d + 0x27000000000000000000250000000016001f 0x240023 0x24000d + 0x2800000000000000000013000000000b00000000010020 0x29000000000000000000260000000017001f (h240 + 0x1000000002700000000010000 0x10000000010000000000100000000020000000004001c))) (.bin (.leaf8 + 0x2000f 0x2b0000000000000000000200000000170000000001001e 0x100000000030023 + 0x2d00000000000000000003000000000d00000000000020 0x5000e (h240 0x10000 + 0x500000000010000000031000000000100000000020000000003001c) 0x2000f + 0x320000000000000000000200000000040000000001001e) (.leaf8 0x310000000002000b 0x600000000030016 + 0x1000000002b001a 0x2c000000002b0016 0x30014 0x2e0010 0x10021 0xe0016))) (.bin (.bin (.leaf8 + 0xa0000000025001a 0x2600000000250016 0x10000000022001a 0x210016 0x2100000000090016 + 0x34000000001f001a 0x1f000000001f0016 0x30014) (.leaf8 0x210010 0x10021 0x7000000001c001a + 0x1b000000001a0016 0x10b0000000019001a 0x1800000000180016 0x230000000016001a 0x1700000000160016)) + (.bin (.leaf8 0x1500000000040016 0x5380000000013001a 0x1400000000130016 0x90014 0x160010 0x10021 + 0xb70000000010001a 0x5000000000f0016) (.leaf8 0xf0014 0x70010 0x10021 0x1a1f000000000d001a + 0xe000000000d0016 0x30014 0x100010 0x10021)))) (.bin (.bin (.bin (.leaf8 0x394000000000a001a + 0x900000000090016 0x82a80000000007001a 0x60016 0x500000000010016 0x11d80000000004001a + 0x300000000020016 0x28d530000000001001a) (.leaf8 0x16 0x14 0x2000e 0x10022 + 0x200000000020000000001000000593c000000000000000000000020 (h240 0x100000000000000 + 0x1000000000500000000000000023415000000000000000000010020) 0x6000000000000000000050000000000001f + 0x100000000050023)) (.bin (.leaf8 0x8000000000000000011d7000000000100000000000020 + 0xa000000000000000000070000000000001f 0x60023 0x6000d 0xb000000000000000000020000000003001f + 0x100000000030023 0xd000000000000000082a7000000000200000000000020 + 0xf0000000000000000000b0000000005001f) (.leaf8 0x1000000000c0023 + 0x1000000000000000000393000000000300000000000020 0x5000e + 0x130000000000000000001000000000070000000000001e 0xf0023 0xf000d + 0x1400000000000000001a1e000000000400000000010020 0x11000e))) (.bin (.bin (.leaf8 + 0x150000000000000000000700000000080000000000001e 0x100000000080023 + 0x17000000000000000000b6000000000500000000000020 0xb000e + 0x1a00000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x1b00000000000000000537000000000600000000010020) (.leaf8 0x1c000000000000000000170000000002001f + 0x160023 0x16000d 0x1c00000000000000000019000000000e001f 0x180023 0x18000d + 0x1d00000000000000000022000000000700000000010020 0x1e0000000000000000001a000000000f001f)) (.bin + (.leaf8 0x1000000001b0023 0x1f0000000000000000010a000000000800000000000020 + 0x210000000000000000001d0000000010001f 0x1000000001d0023 + 0x2300000000000000000006000000000900000000000020 0x5000e + 0x260000000000000000002100000000130000000000001e 0x200023) (.leaf8 0x20000d + 0x2700000000000000000033000000000a00000000010020 0x28000000000000000000230000000005001f (h240 + 0x10000 0x2400000000010000000000000000000100000000010000000003001c) 0x1000f + 0x290000000000000000000100000000140000000001001e 0x100000000020023 + 0x2b00000000000000000000000000000b00000000000020))))))) (.bin (.bin (.bin (.bin (.bin (.bin + (.leaf8 0x2c000000000000000000280000000018001f 0x270023 0x27000d + 0x2d00000000000000000009000000000c00000000010020 0x2e000000000000000000020000000008001f (h240 + 0x1000000000200000000020000 0x100000000050000000001000000002e0000000004001c) 0x2e000f + 0x310000000000000000002e000000001a0000000001001e) (.leaf8 0x2d0023 0x2d000d + 0x3200000000000000000000000000000e00000000010020 0x33000000000000000000080000000001001f (h240 + 0x10000 0x900000000010000000000000000000100000000320000000003001c) 0x32000f 0x350000000000001d + 0x32000b)) (.bin (.leaf8 0x3000000000070016 0x5000000002d0016 0x14 0x70010 0x10021 + 0x2a00000000000016 0x40000000028001a 0x2900000000280016) (.leaf8 0x240016 0x16 0x1a0000000022001a + 0x2200000000220016 0x2100000000040016 0x2000000001f001a 0x20000000001f0016 0x14))) (.bin (.bin + (.leaf8 0x220010 0x10021 0x1e000000001b0016 0x84000000001c001a 0x1d000000001c0016 0x1b0014 + 0x1f0010 0x10021) (.leaf8 0x110000000019001a 0x1a00000000190016 0x29c0000000016001a + 0x1700000000160016 0x15000000000a0016 0x5a0000000013001a 0x1400000000130016 0x80014)) (.bin + (.leaf8 0x160010 0x10021 0xd100000000010001a 0x6000000000f0016 0x1c9000000000d001a + 0xe000000000d0016 0xc0014 0x100010) (.leaf8 0x10021 0x4153000000000a001a 0xb000000000a0016 0x30014 + 0xd0010 0x10021 0x900000000060016 0x8eb0000000007001a)))) (.bin (.bin (.bin (.leaf8 0x60016 + 0x50014 0x20010 0x10021 0x146a90000000004001a 0x30016 0x2c9f0000000001001a 0x16) (.leaf8 0x14 + 0x2000e 0x10022 0x2000000000200000000010000002c9e000000000000000000000020 + 0x20000000004000000000100000000020000000001001f 0x100000000030023 + 0x20000000006000000000100000146a8000000000100000000000020 0x7000e)) (.bin (.leaf8 + 0x200000000090000000001000000000200000000020000000000001e 0x100000000030023 + 0x2000000000b000000000100000008ea000000000200000000000020 + 0x2000000000d0000000001000000000b0000000003001f (h240 0x1000000000c00000000010000 + 0x100000000050000000001000000000d0000000004001c) 0xd000f + 0x2000000000f0000000001000000000d00000000040000000001001e 0xc0023) (.leaf8 0xc000d + 0x2000000001000000000010000004152000000000300000000010020 0xe000e + 0x200000000110000000001000000001000000000070000000000001e 0xf0023 0xf000d + 0x20000000012000000000100000001c8000000000400000000010020 + 0x20000000013000000000100000000080000000009001f))) (.bin (.bin (.leaf8 0x100000000090023 + 0x200000000150000000001000000083c000000000500000000000020 + 0x20000000017000000000100000000140000000001001f (h240 0x100000000000000 + 0x100000000180000000000000000001400000000080000000000001e) 0x130023 0x13000d + 0x19000000000000000004d1000000000500000000010020 0xa000e) (.leaf8 + 0x1a00000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x1b00000000000000000059000000000600000000010020 0x1c000000000000000000170000000006001f 0x160023 + 0x16000d 0x1c00000000000000000019000000000e001f)) (.bin (.leaf8 0x180023 0x18000d + 0x1d0000000000000000029b000000000700000000010020 0x1e0000000000000000001c0000000010001f 0x1b0023 + 0x1b000d 0x1f00000000000000000010000000000800000000010020 0x1d000e) (.leaf8 + 0x200000000000000000001f00000000110000000000001e 0x1e0023 0x1e000d + 0x2100000000000000000083000000000900000000010020 0x22000000000000000000200000000011001f (h240 + 0x1000000002100000000010000 0x10000000002000000000100000000220000000004001c) 0x22000f + 0x240000000000000000002200000000120000000001001e))))) (.bin (.bin (.bin (.bin (.leaf8 0x210023 + 0x21000d 0x2500000000000000000001000000000a00000000010020 0x26000000000000000000230000000002001f + 0x220023 0x22000d 0x26000000000000000000240000000016001f 0x230023) (.leaf8 0x23000d + 0x2700000000000000000019000000000b00000000010020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x2a0000000000000000000100000000160000000001001e (h240 0x10000 + 0x2000000000100000000000000000001000000002a0000000003001c) 0x2a000f)) (.bin (.leaf8 + 0x2c0000000000000000002a00000000190000000001001e 0x290023 0x29000d + 0x2d00000000000000000003000000000d00000000010020 0x2c000e (h240 0x10000 + 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x3000000000000000000007000000001b0000000001001e) (.leaf8 (h240 0x10000 + 0x800000000010000000000000000000100000000310000000003001c) 0x31000f + 0x320000000000000000003100000000030000000001001e 0x300023 0x30000d + 0x33000000000000000000020000000020001f 0x320000000002000b 0x80014))) (.bin (.bin (.leaf8 0x340010 + 0x10021 0x16 0x2000000002b001a 0x2b000000002b0016 0x20014 + 0x3000000000400000000000000000002000000002d0000000000001f 0x2d0009) (.leaf8 0x10021 + 0xd0000000025001a 0x2400000000230016 0x10000000022001a 0x200000000210016 0x210014 0x40010 + 0x10021)) (.bin (.leaf8 0x42000000001f001a 0x1e000000001e0016 0x8000000001c001a 0x1d000000001c0016 + 0x14e0000000019001a 0x1800000000180016 0x2d0000000016001a 0xb00000000150016) (.leaf8 + 0x6870000000013001a 0x1400000000130016 0x90014 0x160010 0x10021 0xe40000000010001a + 0x1100000000100016 0x20aa000000000d001a)))) (.bin (.bin (.bin (.leaf8 0x5000000000c0016 0xc0014 + 0x70010 0x10021 0x475000000000a001a 0x90016 0x800000000010016 0xa3540000000007001a) (.leaf8 + 0x60016 0x600000000010016 0x164e0000000004001a 0x500000000040016 0x30014 0x70010 0x10021 + 0x330a40000000001001a)) (.bin (.leaf8 0x200000000010016 0x14 + 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x2000000000200000000010000006f96000000000000000000010020 0x50010 0x40021) (.leaf8 0x17 0x1d + 0x103c3 (h240 0x6f99000000000300000000010000 + 0x50000006f970000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x200000000030000000000000002c10b000000000000000000010020) + 0x5000e 0x50000000000000000000700000000010000000000001e))) (.bin (.bin (.leaf8 0x60023 0x6000d + 0x60000000000000000164d000000000100000000010020 0x7000000000000000000080000000000001f 0x70023 + 0x7000d 0x7000000000000000000020000000003001f 0x100000000030023) (.leaf8 + 0x90000000000000000a353000000000200000000000020 0xb0000000000000000000a0000000000001f 0x90023 + 0x9000d 0xc000000000000000000020000000005001f 0x100000000030023 + 0xe00000000000000000474000000000300000000000020 0xe000e)) (.bin (.leaf8 + 0x100000000000000000000700000000060000000000001e 0x100000000080023 + 0x12000000000000000020a9000000000400000000000020 0x1400000000000000000013000000000a001f 0x120023 + 0x12000d 0x15000000000000000000e3000000000500000000010020 0xb000e) (.leaf8 + 0x1700000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x1800000000000000000686000000000600000000010020 0x190000000000000000000d000000000d001f + 0x1000000000e0023 0x1b0000000000000000002c000000000700000000000020 + 0x1d0000000000000000001a000000000f001f)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x1000000001b0023 0x1e0000000000000000014d000000000800000000000020 + 0x200000000000000000001f0000000012001f 0x1e0023 0x1e000d + 0x2100000000000000000007000000000900000000010020 0x22000000000000000000200000000013001f + 0x100000000210023) (.leaf8 0x2300000000000000000041000000000a00000000000020 0x23000e + 0x250000000000000000000400000000140000000000001e 0x100000000050023 + 0x2700000000000000000000000000000b00000000000020 0x28000000000000000000260000000016001f + 0x100000000260023 0x290000000000000000000c000000000c00000000000020)) (.bin (.leaf8 0x5000e + 0x100000000050000000001000000002d0000000002001c 0x2d000f + 0x2d0000000000000000002d00000000190000000001001e 0x2c0023 0x2c000d + 0x2e00000000000000000001000000000e00000000010020 0x2000e) (.leaf8 (h240 0x10000 + 0x1000000000a000000000100000000340000000003001c) 0x6c00c6 0x10043 0xa0142 0x101c3 0xb0009 0x30014 + 0xc0010))) (.bin (.bin (.leaf8 0x10021 0x1000000002e001a 0x5000000002c0016 0x2a00000000040016 + 0x50000000028001a 0x2900000000280016 0x14 0x2b0010) (.leaf8 0x10021 0x10000000024001a 0x50014 + 0x280010 0x10021 0x210000000022001a 0x210016 0x4000000001f001a)) (.bin (.leaf8 0x20000000001f0016 + 0xa6000000001c001a 0x1d000000001c0016 0x1b0014 0x1f0010 0x10021 0x160000000019001a 0x180016) + (.leaf8 0x18000000000c0016 0x3430000000016001a 0xc00000000150016 0x720000000013001a + 0x1200000000120016 0x10540000000010001a 0xf0016 0xf00000000060016)))) (.bin (.bin (.bin (.leaf8 + 0x23a000000000d001a 0xc0016 0xb00000000010016 0x51a9000000000a001a 0xb000000000a0016 0x30014 + 0xd0010 0x10021) (.leaf8 0xb270000000007001a 0x800000000070016 0x198520000000004001a + 0x500000000040016 0x37cc0000000001001a 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f)) (.bin (.leaf8 0x20023 0x2000d + 0x20000000002000000000100000037cb000000000000000000010020 + 0x20000000003000000000100000000070000000002001f 0x60023 0x6000d + 0x2000000000400000000010000019851000000000100000000010020 + 0x200000000050000000001000000000a0000000004001f) (.leaf8 0x90023 0x9000d + 0x2000000000600000000010000000b26000000000200000000010020 0x5000e + 0x200000000080000000001000000000d00000000050000000000001e 0xc0023 0xc000d + 0x20000000009000000000100000051a8000000000300000000010020))) (.bin (.bin (.leaf8 + 0x2000000000a0000000001000000000d0000000000001f 0xc0023 0xc000d + 0x2000000000b000000000100000000020000000007001f 0x100000000030023 + 0x2000000000d00000000010000000239000000000400000000000020 + 0x2000000000f000000000100000000110000000003001f (h240 0x10000 + 0x1200000000010000000000000000000100000000010000000003001c)) (.leaf8 0x1000f + 0x200000000100000000001000000000100000000080000000001001e 0x100000000020023 + 0x2000000001200000000010000000a4a000000000500000000000020 + 0x20000000014000000000100000000140000000001001f (h240 0x100000000000000 + 0x100000000150000000000000000001400000000080000000000001e) 0x130023 0x13000d)) (.bin (.leaf8 + 0x1600000000000000000607000000000500000000010020 0x1600000000000000000014000000000b001f + 0x100000000150023 0x1700000000000000000071000000000600000000000020 + 0x190000000000000000000e000000000d001f 0x1000000000f0023 + 0x1b00000000000000000342000000000700000000000020 0x1d0000000000000000001a0000000007001f) (.leaf8 + (h240 0x10000 0x1b00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1e00000000000000000001000000000e0000000001001e 0x100000000020023 + 0x2000000000000000000015000000000800000000000020 0x1d000e + 0x220000000000000000001f00000000110000000000001e 0x1e0023))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x1e000d 0x23000000000000000000a5000000000900000000010020 0x24000000000000000000220000000014001f + 0x210023 0x21000d 0x2500000000000000000003000000000a00000000010020 + 0x26000000000000000000020000000015001f 0x100000000030023) (.leaf8 + 0x2800000000000000000020000000000b00000000000020 0x7000e + 0x2b0000000000000000002800000000160000000000001e (h240 0x1000000002900000000010000 + 0x100000000020000000001000000002b0000000004001c) 0x2b000f + 0x2e0000000000000000002b00000000180000000001001e 0x2a0023 0x2a000d)) (.bin (.leaf8 + 0x2f00000000000000000004000000000d00000000010020 0x300000000000000000002c0000000002001f 0x2b0023 + 0x2b000d 0x3000000000000000000007000000001c001f 0x100000000070023 + 0x3200000000000000000000000000000f00000000000020 0x5000e) (.leaf8 + 0x340000000000000000000c00000000200000000000001e 0xc000a 0x60008 0x10009 0x10021 0x300016 0x70014 + 0x20010))) (.bin (.bin (.leaf8 0x10021 0x3000000002b001a 0x2000000002a0016 0x290014 0x40010 + 0x10021 0x2700000000060016 0xf0000000025001a) (.leaf8 0x2600000000250016 0x30014 0x280010 0x10021 + 0x20000000022001a 0x2100000000210016 0x52000000001f001a 0x20000000001f0016)) (.bin (.leaf8 + 0xb000000001c001a 0x1b0016 0x16 0x1a10000000019001a 0x1a00000000190016 0xf0014 0x1c0010 0x10021) + (.leaf8 0x380000000016001a 0x1700000000160016 0x150014 0x190010 0x10021 0x8290000000013001a + 0x1400000000130016 0x20014)))) (.bin (.bin (.bin (.leaf8 + 0x1200000000040000000000000000000200000000160000000000001f 0x160009 0x20021 0x11c0000000010001a + 0x1100000000100016 0x30014 0x130010 0x10021) (.leaf8 0xf000000000c0016 0x28d4000000000d001a + 0x6000000000c0016 0x593000000000a001a 0xb000000000a0016 0xcc290000000007001a 0x600000000060016 + 0x1be50000000004001a)) (.bin (.leaf8 0x400000000040016 0x3fcc70000000001001a 0x200000000010016 + 0x14 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x2000000000200000000010000008baf000000000000000000010020) (.leaf8 0x50010 0x40021 0x17 0x1d + 0x103c3 (h240 0x8bb2000000000300000000010000 + 0x50000008bb00000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 + 0x2000000000300000000000000037115000000000000000000010020)))) (.bin (.bin (.leaf8 + 0x5000000000000000000060000000002001f 0x50023 0x5000d + 0x600000000000000001be4000000000100000000010020 0x7000000000000000000080000000003001f + 0x100000000090023 0x80000000000000000cc28000000000200000000000020 + 0xa0000000000000000000d0000000006001f) (.leaf8 0xc0023 0xc000d + 0xb00000000000000000592000000000300000000010020 0xc000000000000000000080000000007001f + 0x100000000090023 0xe000000000000000028d3000000000400000000000020 + 0x10000000000000000000110000000007001f (h240 0x1000000001200000000010000 + 0x10000000005000000000100000000130000000004001c))) (.bin (.leaf8 0x13000f + 0x120000000000000000001300000000080000000001001e 0x120023 0x12000d + 0x130000000000000000011b000000000500000000010020 0x14000e + 0x10000000005000000000100000000160000000002001c 0x16000f) (.leaf8 + 0x150000000000000000001600000000090000000001001e 0x150023 0x15000d + 0x1600000000000000000828000000000600000000010020 0x17000e + 0x1700000000000000000019000000000d0000000000001e 0x180023 0x18000d)))))))) (.bin (.bin (.bin (.bin + (.bin (.bin (.bin (.leaf8 0x1800000000000000000037000000000700000000010020 0x11000e + 0x1a0000000000000000001c000000000f0000000000001e 0x1b0023 0x1b000d + 0x1b000000000000000001a0000000000800000000010020 0x2000e + 0x10000000000000000000100000000010000000002001c) (.leaf8 0x1000f + 0x1e0000000000000000000100000000100000000001001e 0x100000000020023 + 0x200000000000000000000a000000000900000000000020 0x22000000000000000000220000000014001f 0x210023 + 0x21000d 0x2300000000000000000051000000000a00000000010020)) (.bin (.leaf8 + 0x24000000000000000000230000000015001f 0x100000000240023 + 0x2500000000000000000001000000000b00000000000020 0x5000e + 0x280000000000000000002800000000170000000000001e 0x270023 0x27000d + 0x290000000000000000000e000000000c00000000010020) (.leaf8 0x2a000000000000000000290000000003001f + (h240 0x1000000002a00000000010000 0x1000000002b000000000100000000040000000004001c) 0x4000f + 0x2c0000000000000000000400000000190000000001001e 0x100000000050023 + 0x2e00000000000000000002000000000e00000000000020 0x9000e + 0x3100000000000000000002000000001e0000000000001e))) (.bin (.bin (.leaf8 (h240 + 0x1000000000300000000010000 0x10000000007000000000100000000010000000004001c) 0x1000f + 0x340000000000000000000100000000050000000001001e 0x1000a 0x70008 (h240 0x30000 + 0x800000000000000000002000000000100000000000000000000001e) 0x90000000001000b 0x30013) (.leaf8 + 0xa0008 0x10009 0x10021 0x1000000002e001a 0x2d0016 0x2b00000000030016 0x2a0014 0x2d0010)) (.bin + (.leaf8 0x10021 0x70000000028001a 0x2900000000280016 0x2700000000040016 0x240016 + 0x290000000022001a 0x2300000000220016 0x5000000001f001a) (.leaf8 0x1e0016 0x16 0x1e00000000010016 + 0xd0000000001c001a 0x12000000001b0016 0x1c0000000019001a 0x1800000000180016 + 0x4140000000016001a)))) (.bin (.bin (.bin (.leaf8 0x1700000000160016 0x1500000000030016 + 0x8e0000000013001a 0x500000000120016 0x120014 0x70010 0x10021 0x14690000000010001a) (.leaf8 + 0x1100000000100016 0x90014 0x130010 0x10021 0x2c9000000000d001a 0xe000000000d0016 + 0x6614000000000a001a 0x90016)) (.bin (.leaf8 0xdf30000000007001a 0x600000000050016 + 0x1fe630000000004001a 0x300000000030016 0x45d80000000001001a 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f) (.leaf8 0x20023 0x2000d + 0x20000000002000000000100000045d7000000000000000000010020 + 0x20000000003000000000100000000050000000001001f 0x100000000060023 + 0x200000000040000000001000001fe62000000000100000000000020 + 0x20000000006000000000100000000080000000002001f 0x100000000080023))) (.bin (.bin (.leaf8 + 0x2000000000800000000010000000df2000000000200000000000020 + 0x2000000000a000000000100000000020000000005001f 0x100000000030023 + 0x2000000000c00000000010000006613000000000300000000000020 + 0x2000000000e000000000100000000100000000008001f 0xf0023 0xf000d + 0x2000000000f000000000100000002c8000000000400000000010020) (.leaf8 0xb000e + 0x200000000110000000001000000001300000000090000000000001e 0x120023 0x12000d + 0x2000000001200000000010000000cd6000000000500000000010020 + 0x20000000013000000000100000000140000000005001f (h240 0x100000000000000 + 0x100000000140000000000000000001400000000040000000000001e) 0x130023)) (.bin (.leaf8 0x13000d + 0x1500000000000000000790000000000500000000010020 0x14000e + 0x1500000000000000000007000000000a0000000000001e 0x100000000080023 + 0x170000000000000000008d000000000600000000000020 0x19000000000000000000170000000001001f (h240 + 0x10000 0x1800000000010000000000000000000100000000180000000003001c)) (.leaf8 0x18000f + 0x1a00000000000000000018000000000d0000000001001e 0x170023 0x17000d + 0x1b00000000000000000413000000000700000000010020 0x1c0000000000000000001a000000000f001f + 0x1000000001b0023 0x1d0000000000000000001b000000000800000000000020))))) (.bin (.bin (.bin (.bin + (.leaf8 0x1f000000000000000000140000000011001f 0x100000000150023 + 0x21000000000000000000cf000000000900000000000020 0x23000000000000000000200000000000001f 0x1f0023 + 0x1f000d 0x2000e 0x10000000000000000000100000000010000000002001c) (.leaf8 0x1000f + 0x250000000000000000000100000000120000000001001e 0x100000000020023 + 0x2700000000000000000004000000000a00000000000020 0x29000000000000000000250000000016001f 0x240023 + 0x24000d 0x2a00000000000000000028000000000b00000000010020)) (.bin (.leaf8 + 0x2b000000000000000000020000000017001f (h240 0x10000 + 0x300000000010000000000000000000100000000280000000003001c) 0x28000f + 0x2d0000000000000000002800000000010000000001001e 0x270023 0x27000d + 0x2e0000000000000000002b000000001a001f 0x2a0023) (.leaf8 0x2a000d + 0x2f00000000000000000006000000000d00000000010020 0x2c000e + 0x300000000000000000002d00000000000000000000001e (h240 0x10000 + 0x2e00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x3200000000000000000001000000001c0000000001001e 0x100000000020023))) (.bin (.bin (.leaf8 + 0x3400000000000000000000000000000f00000000000020 0xb000e + 0x360000000000000000000100000000000000000000001e (h240 0x10000 + 0x2000000000100000000000000000001000000000a0000000003001c) 0x20186 0x10043 0xa0142 0x101c3) + (.leaf8 0xb0023 0x1a00c6 0x10043 0x10303 0x10009 0x8 0x10009 0x10021)) (.bin (.leaf8 + 0xc00000000000016 0x300016 0x16 0x2d000000002c0016 0x3000000002b001a 0x2c000000002b0016 0x270016 + 0x2700000000010016) (.leaf8 0x140000000025001a 0x2400000000240016 0x10000000022001a + 0x2300000000220016 0x20014 0x300000000040000000000000000000200000000250000000000001f 0x250009 + 0x10021)))) (.bin (.bin (.bin (.leaf8 0x68000000001f001a 0x1e0016 0x1e00000000130016 + 0xd000000001c001a 0x1b0016 0x20a0000000019001a 0x1900000000190016 0x180014) (.leaf8 0x1b0010 + 0x10021 0x460000000016001a 0x1700000000160016 0x80014 0x190010 0x10021 0xa350000000013001a)) (.bin + (.leaf8 0xc00000000120016 0x1640000000010001a 0x1100000000100016 0x3309000000000d001a + 0xe000000000d0016 0x30014 0x100010 0x10021) (.leaf8 0x6f9000000000a001a 0x90016 0x80014 0x20010 + 0x10021 0xff310000000007001a 0x60016 0x22ec0000000004001a))) (.bin (.bin (.leaf8 0x400000000040016 + 0x4fbdf0000000001001a 0x200000000010016 0x14 0x20000000000000000000100000000040000000000001f + 0x30023 0x3000d 0x200000000020000000001000000ae9f000000000000000000010020) (.leaf8 0x50010 0x40021 + 0x17 0x1d 0x103c3 (h240 0xaea2000000000300000000010000 + 0x5000000aea00000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000300000000000000044d3d000000000000000000010020))) + (.bin (.leaf8 0x5000000000000000000060000000002001f 0x50023 0x5000d + 0x6000000000000000022eb000000000100000000010020 0x7000000000000000000020000000003001f + 0x100000000030023 0x90000000000000000ff30000000000200000000000020 0xa000e) (.leaf8 + 0xc0000000000000000000200000000040000000000001e 0x100000000030023 + 0xe000000000000000006f8000000000300000000000020 0x5000e + 0x110000000000000000001000000000070000000000001e 0xf0023 0xf000d + 0x1200000000000000003308000000000400000000010020)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x1300000000000000000013000000000a001f 0x120023 0x12000d + 0x1400000000000000000163000000000500000000010020 0x150000000000000000000e000000000b001f + 0x1000000000f0023 0x1700000000000000000a34000000000600000000000020 0xa000e) (.leaf8 + 0x1a00000000000000000019000000000d0000000000001e 0x180023 0x18000d + 0x1b00000000000000000045000000000700000000010020 0x1a000e + 0x1c0000000000000000001b000000000f0000000000001e 0x1a0023 0x1a000d)) (.bin (.leaf8 + 0x1d00000000000000000209000000000800000000010020 0x1e000000000000000000020000000011001f + 0x100000000030023 0x200000000000000000000c000000000900000000000020 + 0x2200000000000000000020000000000c001f 0x1f0023 0x1f000d 0x22000000000000000000020000000013001f) + (.leaf8 0x100000000030023 0x2400000000000000000067000000000a00000000000020 0x5000e + 0x10000000005000000000100000000250000000002001c 0x25000f + 0x280000000000000000002500000000130000000001001e 0x240023 0x24000d))) (.bin (.bin (.leaf8 + 0x2900000000000000000000000000000b00000000010020 0x2a000000000000000000260000000017001f + 0x100000000270023 0x2b00000000000000000013000000000c00000000000020 + 0x2d000000000000000000290000000000001f 0x280023 0x28000d 0x2d000000000000000000020000000019001f) + (.leaf8 (h240 0x10000 0x3000000000100000000000000000001000000002d0000000003001c) 0x2d000f + 0x2f0000000000000000002d000000001b0000000001001e 0x2c0023 0x2c000d + 0x3000000000000000000002000000000e00000000010020 0x310000000000000000002f000000001c001f (h240 + 0x1000000002f0000000002000000000000000000010000 + 0x200000000010000000000000000000100000000010000000005001c))) (.bin (.leaf8 0x1000f + 0x3500000000000000000001000000001e0000000001001e (h240 (h240 0x10000 + 0x2000000000100000000000000000001000000000e00000000010000) + 0x10000000001000000000100000000010000000006001c) 0x1000f + 0x3a0000000000000000000100000000040000000001001e 0x10000000001000b 0xe0014 0x2000e) (.leaf8 + 0x20186 0x10043 0x30142 0x101c3 0x40023 0xc00c6 0x10043 0x10303)))) (.bin (.bin (.bin (.leaf8 + 0x10009 0x100008 0x10009 0x10021 0x10019 0x360000000000001d 0x2000f 0x350000000000001d) (.leaf8 + 0x10023 0x1000d 0x11000e 0x370000000000000000000100000000000000000000001e 0x1000a 0x120008 0x10009 + 0x10021)) (.bin (.leaf8 0x10016 0x16 0x2f0014 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f 0x30021 0x1000000002e001a) (.leaf8 + 0x2e000000002e0016 0x30014 0x300010 0x10021 0xa0000000028001a 0x270016 0x10000000025001a + 0x500000000240016))) (.bin (.bin (.leaf8 0x2400000000040016 0x330000000022001a 0x210016 + 0x2100000000010016 0x6000000001f001a 0x1e0016 0x1e00000000010016 0x104000000001c001a) (.leaf8 + 0x1c000000001c0016 0x230000000019001a 0x1a00000000190016 0x1800000000090016 0x5190000000016001a + 0x1700000000160016 0xf0014 0x190010)) (.bin (.leaf8 0x10021 0xb20000000013001a 0x1200000000120016 + 0x19840000000010001a 0x6000000000f0016 0x37c000000000d001a 0xc0016 0xb00000000010016) (.leaf8 + 0x7f98000000000a001a 0x90016 0x900000000010016 0x11750000000007001a 0x700000000070016 + 0x27def0000000004001a 0x500000000040016 0x57510000000001001a))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x3001d 0x1000000000100000000010000005750000000000000000000000020 + 0x20000000005000000000100000000070000000002001f 0x60023 0x6000d + 0x2000000000600000000010000027dee000000000100000000010020 + 0x20000000007000000000100000000090000000004001f 0x80023) (.leaf8 0x8000d + 0x2000000000800000000010000001174000000000200000000010020 + 0x200000000090000000001000000000b0000000000001f 0xa0023 0xa000d + 0x20000000009000000000100000000020000000005001f 0x100000000030023 + 0x2000000000b00000000010000007f97000000000300000000000020)) (.bin (.leaf8 + 0x2000000000d0000000001000000000d0000000000001f 0xc0023 0xc000d + 0x2000000000e000000000100000000020000000007001f 0x100000000030023 + 0x200000000100000000001000000037b000000000400000000000020 + 0x20000000012000000000100000000080000000009001f 0x100000000090023) (.leaf8 + 0x2000000001400000000010000001012000000000500000000000020 + 0x20000000016000000000100000000140000000001001f 0x140009 0x170021 0x17 0x1d 0x103c3 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 0xc75e000000000030000000001000000000200000000020000 + 0x100000000050000005750000000000600000000010000) + 0x80000027def00000000090000000001000000000a00000011760000) + 0xc000000000100000000030000000001000000000000000000010000) + 0xe0000007f97000000000f0000000001000000000e00000000010000) + 0x30000000001000000000000000000010000000011000000037b0000) + 0x12000000000100000000090000000001000000000000000000010000) + 0x1400000010120000000015000000000100000000140000000017001c)))) (.bin (.bin (.leaf8 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000160000000000000000001400000000060000000001001e) + 0x130023 0x13000d 0x180000000000000000096f000000000500000000010020 + 0x1800000000000000000014000000000b001f 0x100000000150023 + 0x19000000000000000000b1000000000600000000000020) (.leaf8 0x11000e + 0x1c00000000000000000019000000000d0000000000001e 0x180023 0x18000d + 0x1d00000000000000000518000000000700000000010020 0x1e0000000000000000001a0000000005001f (h240 + 0x10000 0x1b000000000100000000000000000001000000001b0000000003001c) 0x1b000f)) (.bin (.leaf8 + 0x1f0000000000000000001b000000000f0000000001001e 0x1a0023 0x1a000d + 0x2000000000000000000022000000000800000000010020 0x210000000000000000001e0000000012001f 0x1d0023 + 0x1d000d 0x2200000000000000000103000000000900000000010020) (.leaf8 + 0x23000000000000000000200000000000001f 0x1f0023 0x1f000d 0x23000000000000000000020000000013001f + 0x100000000030023 0x2500000000000000000005000000000a00000000000020 + 0x27000000000000000000230000000000001f 0x220023)))) (.bin (.bin (.bin (.leaf8 0x22000d + 0x27000000000000000000020000000015001f 0x100000000030023 + 0x2900000000000000000032000000000b00000000000020 0x2b000000000000000000260000000002001f 0x250023 + 0x25000d 0x2b000000000000000000070000000017001f) (.leaf8 0x100000000080023 + 0x2d00000000000000000000000000000c00000000000020 0x2e000000000000000000020000000019001f + 0x100000000030023 0x3000000000000000000009000000000d00000000000020 0x5000e + 0x3300000000000000000030000000001d0000000000001e 0x2f0023)) (.bin (.leaf8 0x2f000d + 0x3400000000000000000000000000000f00000000010020 0x31000e (h240 0x10000 + 0x300000000010000000000000000000100000000000000000003001c) 0xd 0x13000e 0x140000000001000b 0x16) + (.leaf8 0x3200000000010016 0x3100000000310016 0x2d00000000040016 0x4000000002b001a 0x2a0016 + 0x2900000000010016 0x80014 0x2b0010))) (.bin (.bin (.leaf8 0x10021 0x190000000025001a + 0x2600000000250016 0x30014 0x280010 0x10021 0x30000000022001a 0x210016) (.leaf8 0x2100000000010016 + 0x82000000001f001a 0x1e000000001d0016 0x11000000001c001a 0x1a0016 0x28d0000000019001a + 0x1200000000180016 0x580000000016001a)) (.bin (.leaf8 0x1700000000160016 0x150014 0x190010 0x10021 + 0xcc10000000013001a 0x1400000000130016 0x90014 0x160010) (.leaf8 0x10021 0x1bd0000000010001a + 0x1100000000100016 0x30014 0x130010 0x10021 0xf000000000c0016 0x3fcb000000000d001a))))))) (.bin + (.bin (.bin (.bin (.bin (.bin (.leaf8 0xc0016 0xc00000000010016 0x8ba000000000a001a + 0xa000000000a0016 0x13ef70000000007001a 0x800000000070016 0x2ba80000000004001a 0x30016) (.leaf8 + 0x20014 0x20010 0x10021 0x63af00000000001001a 0x3001d + 0x100000000010000000001000000da13000000000000000000000020 0x50010 0x60021)) (.bin (.leaf8 0x17 + 0x1d 0x103c3 (h240 (h240 0xda140000 0x3000000000100000000020000000002000000000000000000010000) + 0x5000000da130000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x20000000005000000000000000560da000000000000000000010020) + 0x4000e 0x80000000000000000000200000000000000000000001e) (.leaf8 0x100000000030023 + 0xa00000000000000002ba7000000000100000000000020 0xc0000000000000000000a0000000004001f 0x90023 + 0x9000d 0xd00000000000000013ef6000000000200000000010020 0xe0000000000000000000c0000000006001f + 0xb0023))) (.bin (.bin (.leaf8 0xb000d 0xf000000000000000008b9000000000300000000010020 + 0x100000000000000000000e0000000000001f 0xd0023 0xd000d 0x10000000000000000000020000000007001f + 0x100000000030023 0x1200000000000000003fca000000000400000000000020) (.leaf8 + 0x14000000000000000000110000000007001f (h240 0x1000000001200000000010000 + 0x10000000005000000000100000000130000000004001c) 0x13000f + 0x160000000000000000001300000000080000000001001e 0x120023 0x12000d + 0x17000000000000000001bc000000000500000000010020 0xb000e)) (.bin (.leaf8 + 0x1900000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x1a00000000000000000cc0000000000600000000010020 0x17000e + 0x1b00000000000000000019000000000d0000000000001e 0x180023 0x18000d) (.leaf8 + 0x1c00000000000000000057000000000700000000010020 0x1d00000000000000000014000000000f001f + 0x100000000150023 0x1f0000000000000000028c000000000800000000000020 + 0x21000000000000000000020000000010001f 0x100000000020023 + 0x2300000000000000000010000000000900000000000020 0x25000000000000000000200000000012001f)))) (.bin + (.bin (.bin (.leaf8 0x100000000200023 0x2700000000000000000081000000000a00000000000020 + 0x29000000000000000000230000000000001f 0x220023 0x22000d 0x29000000000000000000020000000015001f + 0x100000000030023 0x2b00000000000000000002000000000b00000000000020) (.leaf8 0x5000e + 0x2e0000000000000000002800000000170000000000001e 0x270023 0x27000d + 0x2f00000000000000000018000000000c00000000010020 0xa000e 0x2a0023 0x2a000d)) (.bin (.leaf8 + 0x3200000000000000000002000000001b001f 0x100000000030023 + 0x3400000000000000000003000000000e00000000000020 0x360000000000000000002f0000000002001f 0x2e0023 + 0x2e000d 0x36000000000000000000330000000020001f 0x320023) (.leaf8 0x32000d + 0x37000000000000000000340000000000001f 0x330023 0x33000d 0x2000e + 0x10000000000000000000100000000150000000002001c 0x20186 0x10043))) (.bin (.bin (.leaf8 0x150142 + 0x101c3 0x160023 0x3000c6 0x10043 0x10303 0x10009 0x8) (.leaf8 0x10009 0x10021 0x3500000000010016 + 0x3000000000320016 0x1000000002e001a 0x2f000000002e0016 0x30014 0x310010)) (.bin (.leaf8 0x10021 + 0xb000000002a0016 0xc0000000028001a 0x2900000000280016 0x2700000000040016 0x2600000000250016 + 0x30014 0x280010) (.leaf8 0x10021 0x410000000022001a 0x210016 0x200014 0x20010 0x10021 + 0x8000000001f001a 0x1e0016))))) (.bin (.bin (.bin (.bin (.leaf8 0x20014 0x20010 0x10021 + 0x146000000001c001a 0x1b0016 0x1b00000000130016 0x2b0000000019001a 0x1a00000000190016) (.leaf8 + 0x6610000000016001a 0xc00000000150016 0xde0000000013001a 0x1400000000130016 0x30016 + 0x1fe50000000010001a 0x1100000000100016 0x30014)) (.bin (.leaf8 0x130010 0x10021 + 0x45d000000000d001a 0xd000000000d0016 0x9f7b000000000a001a 0xb000000000a0016 0x15d30000000007001a + 0x800000000070016) (.leaf8 0x30014 0xa0010 0x10021 0x600000000030016 0x31d770000000004001a 0x30016 + 0x20014 0x20010))) (.bin (.bin (.leaf8 0x10021 0x6d0a0000000001001a 0x3001d + 0x1000000000100000000010000006d09000000000000000000000020 0x4000e + 0x200000000060000000001000000000200000000000000000000001e 0x100000000030023 + 0x2000000000800000000010000031d76000000000100000000000020) (.leaf8 + 0x2000000000a000000000100000000080000000001001f (h240 0x1000000000900000000010000 + 0x100000000050000000001000000000a0000000004001c) 0xa000f + 0x2000000000c0000000001000000000a00000000020000000001001e 0x90023 0x9000d + 0x2000000000d000000000100000015d2000000000200000000010020 + 0x2000000000e0000000001000000000d0000000006001f)) (.bin (.leaf8 0xc0023 0xc000d + 0x2000000000f00000000010000009f7a000000000300000000010020 + 0x200000000100000000001000000000f0000000008001f 0xe0023 0xe000d + 0x200000000110000000001000000045c000000000400000000010020 0x5000e) (.leaf8 + 0x200000000130000000001000000001300000000090000000000001e 0x120023 0x12000d + 0x2000000001400000000010000001415000000000500000000010020 + 0x20000000015000000000100000000140000000009001f 0x140009 0x160021 0x17)))) (.bin (.bin (.bin + (.leaf8 0x1d 0x103c3 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0xf934d000000000300000000010000 + 0x200000000020000000000000000000100000000050000006d090000) + 0x6000000000100000000050000000001000000000300000000010000) + 0x100000000080000031d77000000000900000000010000) 0x100000000050000000001000000000b00000015d30000) + 0xc0000000001000000000e0000009f7b000000000f00000000010000) + 0x10000000045d00000000120000000001000000000600000000010000) + 0x1400000014160000000015000000000100000000130000000016001c) 0x13000d (h240 + 0x20000000000000000000100000000010000 0x2000000001500000000000000000bcd000000000500000000010020) + 0x17000000000000000000020000000001001f (h240 0x10000 + 0x300000000010000000000000000000100000000150000000003001c) 0x15000f) (.leaf8 + 0x1900000000000000000015000000000b0000000001001e 0x140023 0x14000d + 0x1a000000000000000000dd000000000600000000010020 0x1b0000000000000000000e000000000d001f + 0x1000000000f0023 0x1d00000000000000000660000000000700000000000020 + 0x1f0000000000000000001c0000000010001f)) (.bin (.leaf8 0x1b0023 0x1b000d + 0x200000000000000000002a000000000800000000010020 0x210000000000000000001d000000000c001f 0x1c0023 + 0x1c000d 0x21000000000000000000020000000011001f 0x100000000030023) (.leaf8 + 0x2300000000000000000145000000000900000000000020 0x4000e + 0x260000000000000000000200000000120000000000001e 0x100000000030023 + 0x2800000000000000000007000000000a00000000000020 0x22000e + 0x2b0000000000000000000200000000140000000000001e 0x100000000030023))) (.bin (.bin (.leaf8 + 0x2d00000000000000000040000000000b00000000000020 0x5000e + 0x300000000000000000002800000000170000000000001e 0x270023 0x27000d + 0x31000000000000000000290000000002001f 0x280023 0x28000d) (.leaf8 + 0x320000000000000000002b000000001a001f 0x2a0023 0x2a000d + 0x330000000000000000000b000000000d00000000010020 0x340000000000000000000d000000001b001f (h240 + 0x1000000000e00000000010000 0x10000000005000000000100000000310000000004001c) 0x31000f + 0x3700000000000000000031000000001c0000000001001e)) (.bin (.leaf8 0x300023 0x30000d + 0x3800000000000000000000000000000f00000000010020 0x39000000000000000000320000000020001f (h240 + 0x10000 0x3200000000020000000000000000000100000000360000000003001c) 0x36000f 0x3b0000000000001d + 0x350023) (.leaf8 0x35000d 0x1000e 0x3d00000000000000000001000000000c0000000000001e 0x1000a + 0x20008 0x10009 0x10021 0x350016)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 0x320014 0x20010 + 0x10021 0x3200000000310016 0x30016 0x2d000000000c0016 0x5000000002b001a 0x2c000000002b0016) + (.leaf8 0x2900000000280016 0x2700000000040016 0x1f0000000025001a 0x2600000000250016 0x30014 + 0x280010 0x10021 0x2400000000210016)) (.bin (.leaf8 0x30000000022001a 0x210016 0x500000000010016 + 0xa2000000001f001a 0x20000000001f0016 0x30014 0x220010 0x10021) (.leaf8 0x16000000001c001a + 0x1b000000001b0016 0x32f0000000019001a 0x1a00000000190016 0xf0014 0x1c0010 0x10021 + 0x6f0000000016001a))) (.bin (.bin (.leaf8 0x140016 0x1500000000010016 0xff20000000013001a + 0x600000000120016 0x22e0000000010001a 0x1000000000100016 0x4fbd000000000d001a 0xe000000000d0016) + (.leaf8 0xae9000000000a001a 0xb000000000a0016 0x30016 0x18ebb0000000007001a 0x800000000070016 + 0x30014 0xa0010 0x10021)) (.bin (.leaf8 0x600000000030016 0x36840000000004001a 0x30016 0x20014 + 0x20010 0x10021 0x7c9a60000000001001a 0x100000000010016) (.leaf8 0x14 + 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x20000000002000000000100000110d0000000000000000000010020 (h240 0x100000000000000 + 0x100000000040000000000000006b8d4000000000000000000010020) 0x4000e + 0x60000000000000000000200000000000000000000001e)))) (.bin (.bin (.bin (.leaf8 0x100000000030023 + 0x800000000000000003683000000000100000000000020 0xa000000000000000000080000000001001f (h240 + 0x1000000000900000000010000 0x100000000050000000001000000000a0000000004001c) 0xa000f + 0xc0000000000000000000a00000000020000000001001e 0x90023 0x9000d) (.leaf8 + 0xd00000000000000018eba000000000200000000010020 0xe000000000000000000020000000001001f (h240 + 0x10000 0x3000000000100000000000000000001000000000c0000000003001c) 0xc000f + 0x100000000000000000000c00000000050000000001001e 0xb0023 0xb000d + 0x1100000000000000000ae8000000000300000000010020)) (.bin (.leaf8 + 0x12000000000000000000100000000008001f 0xf0023 0xf000d + 0x1300000000000000004fbc000000000400000000010020 0x1400000000000000000012000000000a001f 0x110023 + 0x11000d 0x150000000000000000022d000000000500000000010020) (.leaf8 + 0x1600000000000000000008000000000b001f 0x100000000090023 + 0x1800000000000000000ff1000000000600000000000020 0x1a000000000000000000170000000000001f 0x160023 + 0x16000d 0x1a00000000000000000002000000000c001f 0x100000000020023))) (.bin (.bin (.leaf8 + 0x1c0000000000000000006e000000000700000000000020 0x11000e + 0x1f0000000000000000001c000000000f0000000000001e 0x1b0023 0x1b000d + 0x200000000000000000032e000000000800000000010020 0x210000000000000000001d0000000011001f + 0x1000000001e0023) (.leaf8 0x2200000000000000000015000000000900000000000020 0x5000e + 0x250000000000000000002200000000130000000000001e 0x210023 0x21000d + 0x26000000000000000000a1000000000a00000000010020 0x27000000000000000000070000000000001f 0x60023)) + (.bin (.leaf8 0x6000d 0x28000000000000000000020000000015001f 0x100000000030023 + 0x2a00000000000000000002000000000b00000000000020 0x2c000000000000000000260000000015001f (h240 + 0x1000000002700000000010000 0x10000000005000000000100000000280000000004001c) 0x28000f + 0x2e0000000000000000002800000000160000000001001e) (.leaf8 0x270023 0x27000d + 0x2f0000000000000000001e000000000c00000000010020 0x30000000000000000000290000000002001f 0x280023 + 0x28000d 0x300000000000000000002b000000001a001f 0x2a0023))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x2a000d 0x310000000000000000002e000000001c001f 0x2d0023 0x2d000d + 0x3200000000000000000004000000000e00000000010020 0x330000000000000000002f0000000007001f (h240 + 0x10000 0x3000000000010000000000000000000100000000010000000003001c) 0x1000f) (.leaf8 + 0x340000000000000000000100000000000000000001001e (h240 0x10000 + 0x200000000010000000000000000000100000000330000000003001c) 0x33000f + 0x3600000000000000000033000000001f0000000001001e 0x320023 0x32000d 0x34000e + 0x380000000000000000000200000000210000000000001e)) (.bin (.leaf8 (h240 0x1000000000200000000020000 + 0x10000000003000000000100000000010000000004001c) 0x600c6 0x10043 0x30142 0x101c3 0x40009 0x14 + 0x4000e) (.leaf8 0x20186 0x10043 0x50142 0x101c3 0x60023 0x1000c6 0x10043 0x10303))) (.bin (.bin + (.leaf8 0x10009 0x20008 0x10009 0x10021 0x200000000010019 0x380000000000001d 0x23 (h240 0x20000 + 0x10000000003000000000100000000010000000003009c)) (.leaf8 0x1000f (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x26eff700000000000000000001000000000200000110d200000000030000 + 0x10000000004000007c9a60000000006000000000100000000050000) + 0x1000000000300000000010000000000000000000100000000080000) + 0x3684000000000900000000010000000000000000000100000000050000) + 0x1000000000b0000018ebb000000000c000000000100000000030000) + 0x100000000000000000001000000000d0000000ae9000000000f0000) + 0x100000000110000004fbd0000000012000000000100000000130000) + 0x22e000000001500000000010000000009000000000100000000000000) + 0x100000000170000000ff20000000018000000000100000000020000) + 0x200000000000000000001000000001a000000006e000000001b0000) + 0x100000000120000000001000000001d0000000330000000001e0000) + 0x1000000000000000000010000000020000000001500000000210000) + 0x100000000060000000001000000002300000000a200000000240000) + 0x1000000000800000000010000000003000000000100000000000000) + 0x1000000002600000000030000000027000000000100000000000000) + 0x10000000005000000000100000000290000000020000000002a0000) + 0x1000000002c0000000001000000002f000000000600000000300000) + 0x1000000000000000000010000000002000000000100000000000000) + 0x1000000003400000000010000000035000000000100000000010000) + 0x3900000000020000000000000000000100000000010000000001001e) 0x30000000000000b 0x14 0x3000e 0xc00c6 + 0x10043 0x20142)) (.bin (.leaf8 0x101c3 0x30009 0x100000000010019 0x380000000000001d + 0x300000000000000000001015c 0x30003 0x3000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x26efff00000000000000000001000000000200000110d200000000030000 + 0x10000000004000007c9a60000000006000000000100000000050000) + 0x1000000000300000000010000000000000000000100000000080000) + 0x3684000000000900000000010000000000000000000100000000050000) + 0x1000000000b0000018ebb000000000c000000000100000000030000) + 0x100000000000000000001000000000d0000000ae9000000000f0000) + 0x100000000110000004fbd0000000012000000000100000000130000) + 0x22e000000001500000000010000000009000000000100000000000000) + 0x100000000170000000ff20000000018000000000100000000020000) + 0x200000000000000000001000000001a000000006e000000001b0000) + 0x100000000120000000001000000001d0000000330000000001e0000) + 0x1000000000000000000010000000020000000001500000000210000) + 0x100000000060000000001000000002300000000a200000000240000) + 0x1000000000800000000010000000003000000000100000000000000) + 0x1000000002600000000030000000027000000000100000000000000) + 0x10000000005000000000100000000290000000020000000002a0000) + 0x1000000002c0000000001000000002f000000000600000000300000) + 0x1000000000000000000010000000002000000000100000000000000) + 0x1000000003400000000010000000035000000000100000000000000) + 0x3900000000010000000000000000000300000000000000000001001e)) (.leaf8 0x3000a 0x8 + 0x100000000000000000001000000000100000000000000000000001e 0x10009 0x10021 0x3400000000330016 + 0x20014 0x3000000000040000000000000000000200000000360000000000001f)))) (.bin (.bin (.bin (.leaf8 + 0x360009 0x20021 0x2000000002e001a 0x2f000000002e0016 0x2a000000002a0016 0xf0000000028001a + 0x2900000000280016 0x30016) (.leaf8 0x10000000025001a 0x2600000000250016 0x30014 0x280010 0x10021 + 0x2400000000060016 0x500000000022001a 0x2300000000220016)) (.bin (.leaf8 0x2100000000040016 + 0xa000000001f001a 0x1e0016 0x198000000001c001a 0x12000000001b0016 0x370000000019001a 0x180016 + 0x20014) (.leaf8 0x20010 0x10021 0x7f90000000016001a 0x150016 0x1500000000070016 + 0x1160000000013001a 0x1300000000130016 0x27de0000000010001a))) (.bin (.bin (.leaf8 + 0x1100000000100016 0x574000000000d001a 0xd000000000d0016 0x30014 0xf0010 0x10021 + 0xc75d000000000a001a 0xb000000000a0016) (.leaf8 0x30016 0x1b420000000007001a 0x60016 + 0x500000000010016 0x3e4d30000000004001a 0x300000000020016 0x88680000000001001a 0x200000000010016)) + (.bin (.leaf8 0x14 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x2000000000200000000010000008867000000000000000000010020 + 0x20000000003000000000100000000050000000000001f 0x100000000050023 + 0x200000000050000000001000003e4d2000000000100000000000020) (.leaf8 + 0x20000000007000000000100000000070000000000001f 0x60023 0x6000d + 0x20000000008000000000100000000020000000003001f 0x100000000030023 + 0x2000000000a00000000010000001b41000000000200000000000020 + 0x2000000000c000000000100000000020000000001001f (h240 0x10000 + 0x3000000000100000000000000000001000000000c0000000003001c)))))))))) (.bin (.bin (.bin (.bin (.bin + (.bin (.bin (.bin (.leaf8 0xc000f 0x2000000000e0000000001000000000c00000000050000000001001e + 0xb0023 0xb000d 0x2000000000f0000000001000000c75c000000000300000000010020 0x5000e + 0x200000000110000000001000000000f00000000070000000000001e 0xe0023) (.leaf8 0xe000d + 0x2000000001200000000010000000573000000000400000000010020 + 0x2000000001300000000010000000013000000000a001f 0x120023 0x12000d + 0x2000000001400000000010000001918000000000500000000010020 0x140010 0x160021)) (.bin (.leaf8 0x17 + 0x1d 0x103c3 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x137801000000000300000000010000 + 0x5000000886800000000060000000001000000000500000000020000) + 0x10000000008000003e4d2000000000900000000010000) + 0x8000000000100000000030000000001000000000000000000010000) + 0xb0000001b41000000000c0000000001000000000300000000010000) + 0x1000000000d000000c75d000000000f00000000010000) + 0x6000000000100000000100000000574000000001200000000010000) + 0x1400000019190000000015000000000100000000140000000016001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000150000000000000000001400000000080000000001001e) + 0x130023 0x13000d) (.leaf8 0x1700000000000000000ec3000000000500000000010020 + 0x1700000000000000000015000000000c001f 0x140023 0x14000d + 0x1800000000000000000115000000000600000000010020 0x19000000000000000000170000000004001f 0x160023 + 0x16000d))) (.bin (.bin (.leaf8 0x1900000000000000000002000000000d001f 0x100000000030023 + 0x1b000000000000000007f8000000000700000000000020 0x4000e + 0x1e00000000000000000002000000000e0000000000001e 0x100000000030023 + 0x2000000000000000000036000000000800000000000020 0x22000000000000000000140000000011001f) (.leaf8 + 0x100000000150023 0x2400000000000000000197000000000900000000000020 + 0x26000000000000000000020000000013001f 0x100000000030023 + 0x2800000000000000000009000000000a00000000000020 0x2a000000000000000000230000000002001f 0x220023 + 0x22000d)) (.bin (.leaf8 0x2a000000000000000000250000000016001f 0x240023 0x24000d + 0x2b0000000000000000004f000000000b00000000010020 0x2c000000000000000000260000000003001f (h240 + 0x1000000002700000000010000 0x10000000005000000000100000000280000000004001c) 0x28000f + 0x2e0000000000000000002800000000160000000001001e) (.leaf8 0x270023 0x27000d + 0x2f00000000000000000000000000000c00000000010020 0x30000000000000000000020000000001001f (h240 + 0x10000 0x3000000000100000000000000000001000000002a0000000003001c) 0x2a000f + 0x320000000000000000002a00000000190000000001001e 0x290023)))) (.bin (.bin (.bin (.leaf8 0x29000d + 0x330000000000000000000e000000000d00000000010020 0x340000000000000000002c000000001b001f (h240 + 0x10000 0x2d00000000010000000000000000000100000000300000000003001c) 0x30000f + 0x3500000000000000000030000000001d0000000001001e 0x2f0023 0x2f000d) (.leaf8 + 0x3600000000000000000001000000000f00000000010020 0x32000e + 0x10000000005000000000100000000360000000002001c 0x36000f + 0x3800000000000000000036000000001e0000000001001e (h240 0x1000000003700000000010000 + 0x20000000002000000000100000000010000000004001c) 0x20186 0x10043)) (.bin (.leaf8 0x10142 0x101c3 + 0x20023 0x800c6 0x10043 0x10303 0x10009 0x20008) (.leaf8 0x10009 0x10021 0x16 0x500000000350016 + 0x10000000031001a 0x3100000000310016 0x2d0014 0x330010))) (.bin (.bin (.leaf8 0x10021 + 0x7000000002b001a 0x2b000000002b0016 0x30014 0x2d0010 0x10021 0x2900000000280016 0x30016) (.leaf8 + 0x280000000025001a 0x2600000000250016 0x50000000022001a 0x210016 0x2100000000010016 + 0xcb000000001f001a 0x1e0016 0x1e00000000130016)) (.bin (.leaf8 0x1a000000001c001a + 0x1d000000001c0016 0x30014 0x1f0010 0x10021 0x1b00000000030016 0x3fb0000000019001a + 0x1a00000000190016) (.leaf8 0x30014 0x1c0010 0x10021 0x8b0000000016001a 0x1600000000160016 + 0x13ef0000000013001a 0x1200000000120016 0x2b90000000010001a))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x1000000000100016 0xf00000000040016 0x63ae000000000d001a 0xb0016 0xc00000000010016 + 0xda0000000000a001a 0x90016 0x800000000010016) (.leaf8 0x1f2690000000007001a 0x60016 0x50014 + 0x20010 0x10021 0x44340000000004001a 0x300000000030016 0x9bc000000000001001a)) (.bin (.leaf8 + 0x3001d 0x100000000010000000001000001550a000000000000000000000020 0x50010 0x60021 0x17 0x1d + 0x103c3 (h240 (h240 0x1550b0000 0x3000000000100000000020000000002000000000000000000010000) + 0x5000001550a0000000006000000000100000000040000000006001c)) (.leaf8 0x4000d (h240 + 0x20000000000000000000100000000010000 0x20000000005000000000000000866f3000000000000000000010020) + 0x7000000000000000000050000000001001f 0x100000000060023 + 0x800000000000000004433000000000100000000000020 0x7000e + 0xb0000000000000000000200000000020000000000001e 0x100000000030023))) (.bin (.bin (.leaf8 + 0xd0000000000000001f268000000000200000000000020 0xf0000000000000000000a0000000000001f 0x90023 + 0x9000d 0x10000000000000000000020000000005001f 0x100000000030023 + 0x1200000000000000000d9f000000000300000000000020 0x140000000000000000000e0000000000001f) (.leaf8 + 0xd0023 0xd000d 0x14000000000000000000020000000006001f 0x100000000020023 + 0x16000000000000000063ad000000000400000000000020 0x18000000000000000000110000000002001f 0x100023 + 0x10000d)) (.bin (.leaf8 0x1800000000000000000012000000000a001f 0x110023 0x11000d + 0x19000000000000000002b8000000000500000000010020 0x1a00000000000000000014000000000b001f + 0x100000000150023 0x1b000000000000000013ee000000000600000000000020 + 0x1d00000000000000000018000000000e001f) (.leaf8 0x170023 0x17000d + 0x1e0000000000000000008a000000000700000000010020 0x5000e + 0x200000000000000000001c000000000f0000000000001e 0x1b0023 0x1b000d + 0x21000000000000000003fa000000000800000000010020)))) (.bin (.bin (.bin (.leaf8 + 0x220000000000000000001d0000000001001f (h240 0x1000000001e00000000010000 + 0x100000000050000000001000000001f0000000004001c) 0x1f000f + 0x240000000000000000001f00000000100000000001001e 0x1e0023 0x1e000d + 0x2500000000000000000019000000000900000000010020 0x2600000000000000000020000000000c001f) (.leaf8 + 0x1f0023 0x1f000d 0x26000000000000000000020000000013001f 0x100000000030023 + 0x28000000000000000000ca000000000a00000000000020 0x2a000000000000000000230000000000001f 0x220023 + 0x22000d)) (.bin (.leaf8 0x2a000000000000000000020000000015001f 0x100000000030023 + 0x2c00000000000000000004000000000b00000000000020 0x2e000000000000000000280000000018001f 0x270023 + 0x27000d 0x2f00000000000000000027000000000c00000000010020 0x30000000000000000000020000000001001f) + (.leaf8 (h240 0x10000 0x3000000000100000000000000000001000000002a0000000003001c) 0x2a000f + 0x320000000000000000002a00000000190000000001001e 0x290023 0x29000d 0x5000e + 0x340000000000000000002d000000001b0000000000001e 0x2c0023))) (.bin (.bin (.leaf8 0x2c000d + 0x3500000000000000000006000000000e00000000010020 0x2f000e + 0x3600000000000000000033000000001f0000000000001e 0x320023 0x32000d + 0x3700000000000000000000000000001000000000010020 0x38000000000000000000070000000022001f) (.leaf8 + (h240 (h240 0x10000 0x7000000000200000000000000000001000000000200000000010000) + 0x10000000003000000000100000000010000000006001c) 0x600c6 0x10043 0x30142 0x101c3 0x40009 0x20014 + 0x4000e)) (.bin (.leaf8 0x20186 0x10043 0x50142 0x101c3 0x60023 0x1000c6 0x10043 0x10303) (.leaf8 + 0x10009 0x40008 0x10009 0x10021 0x10019 0x3a0000000000001d 0xf 0x390000000000001d)))))) (.bin + (.bin (.bin (.bin (.bin (.leaf8 0x103c3 0x10000000006000000000100000000010000000002001c 0x1000f + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 0x30ac1c00000000000000 + 0x10000000001000001550b0000000003000000000100000000020000) + 0x2000000000000000000010000000005000009bc0000000000060000) + 0x1000000000000000000010000000008000000443300000000090000) + 0x1000000000800000000010000000003000000000100000000000000) + 0x1000000000b000001f268000000000c0000000001000000000b0000) + 0x10000000003000000000100000000000000000001000000000e0000) + 0xda0000000000f00000000010000000002000000000200000000000000) + 0x1000000001100000063ae0000000012000000000100000000130000) + 0x2ba000000001500000000010000000000000000000100000000170000) + 0x13ee000000001800000000010000000019000000008b000000001b0000) + 0x100000000060000000001000000001d00000003fc000000001e0000) + 0x1000000000000000000010000000005000000000100000000200000) + 0x1b000000002100000000010000000003000000000100000000000000) + 0x1000000002300000000cb0000000024000000000100000000030000) + 0x1000000000000000000010000000026000000000400000000270000) + 0x100000000290000000028000000002a000000000100000000030000) + 0x100000000000000000001000000002b000000000100000000060000) + 0x1000000002e00000000080000000030000000000100000000340000) + 0x1000000003600000000010000000007000000000100000000010000) + 0x3a00000000010000000000000000000100000000010000000001001e) 0x60000000000000b + 0x700000000000000000003001d 0x6000b 0x80014) (.leaf8 0x20010 0x10021 0x3600000000010019 + 0x370000000000001d 0x340023 (h240 0x20000 0x1000000000a000000000100000000020000000003009c) 0x2000f + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 0x30ac240000000000000000000100000000010000 + 0x1550b000000000300000000010000000002000000000200000000000000) + 0x10000000005000009bc000000000006000000000100000000000000) + 0x1000000000800000044330000000009000000000100000000080000) + 0x10000000003000000000100000000000000000001000000000b0000) + 0x1f268000000000c0000000001000000000b000000000100000000030000) + 0x100000000000000000001000000000e0000000da0000000000f0000) + 0x1000000000200000000020000000000000000000100000000110000) + 0x63ae00000000120000000001000000001300000002ba00000000150000) + 0x100000000000000000001000000001700000013ee00000000180000) + 0x10000000019000000008b000000001b000000000100000000060000) + 0x1000000001d00000003fc000000001e000000000100000000000000) + 0x1000000000500000000010000000020000000001b00000000210000) + 0x1000000000300000000010000000000000000000100000000230000) + 0xcb000000002400000000010000000003000000000100000000000000) + 0x1000000002600000000040000000027000000000100000000290000) + 0x28000000002a00000000010000000003000000000100000000000000) + 0x1000000002b000000000100000000060000000001000000002e0000) + 0x8000000003000000000010000000034000000000100000000350000) + 0x3800000000020000000000000000000200000000010000000001001e))) (.bin (.leaf8 0xa0000000001000b 0x14 + 0xb000e 0x20186 0x10043 0xc0142 0x101c3 0xd0023) (.leaf8 0x1e00c6 0x10043 0x10303 0x10009 0x20008 + 0x10009 0x10021 0x3500000000010019))) (.bin (.bin (.leaf8 0x370000000000001d 0x330023 (h240 + 0x20000 0x10000000003000000000100000000010000000003009c) 0x1000f (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x30ac2c00000000000000 0x10000000001000001550b0000000003000000000100000000020000) + 0x2000000000000000000010000000005000009bc0000000000060000) + 0x1000000000000000000010000000008000000443300000000090000) + 0x1000000000800000000010000000003000000000100000000000000) + 0x1000000000b000001f268000000000c0000000001000000000b0000) + 0x10000000003000000000100000000000000000001000000000e0000) + 0xda0000000000f00000000010000000002000000000200000000000000) + 0x1000000001100000063ae0000000012000000000100000000130000) + 0x2ba000000001500000000010000000000000000000100000000170000) + 0x13ee000000001800000000010000000019000000008b000000001b0000) + 0x100000000060000000001000000001d00000003fc000000001e0000) + 0x1000000000000000000010000000005000000000100000000200000) + 0x1b000000002100000000010000000003000000000100000000000000) + 0x1000000002300000000cb0000000024000000000100000000030000) + 0x1000000000000000000010000000026000000000400000000270000) + 0x100000000290000000028000000002a000000000100000000030000) + 0x100000000000000000001000000002b000000000100000000060000) + 0x1000000002e00000000080000000030000000000200000000340000) + 0x3700000000020000000000000000000100000000050000000001001e) 0x1000a 0x30008 + 0x400000000000000000001000000000100000000000000000000001e) (.leaf8 0x50000000001000b 0x13 0x340008 + (h240 0x10000 0x200000000010000000000000000000100000000060000000003001c) 0x20186 0x10043 0x60142 + 0x101c3)) (.bin (.leaf8 0x70023 0x1200c6 0x10043 0x10303 0x10009 0x8 0x10009 0x10021) (.leaf8 + 0x3500000000000016 0x3400000000010019 0x360000000000001d 0x320023 0x300000000000000000001009c + 0x370003 (h240 0x10000 0x10000000001000000000100000000010000000003001c) 0x1000f)))) (.bin (.bin + (.bin (.leaf8 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 0x30ac3c000000000000000000010000000001000001550b00000000030000 + 0x1000000000200000000020000000000000000000100000000050000) + 0x9bc00000000000600000000010000000000000000000100000000080000) + 0x4433000000000900000000010000000008000000000100000000030000) + 0x100000000000000000001000000000b000001f268000000000c0000) + 0x1000000000b00000000010000000003000000000100000000000000) + 0x1000000000e0000000da0000000000f000000000100000000020000) + 0x200000000000000000001000000001100000063ae00000000120000) + 0x1000000001300000002ba0000000015000000000100000000000000) + 0x1000000001700000013ee0000000018000000000100000000190000) + 0x8b000000001b000000000100000000060000000001000000001d0000) + 0x3fc000000001e00000000010000000000000000000100000000050000) + 0x10000000020000000001b0000000021000000000100000000030000) + 0x100000000000000000001000000002300000000cb00000000240000) + 0x1000000000300000000010000000000000000000100000000260000) + 0x40000000027000000000100000000290000000028000000002a0000) + 0x10000000003000000000100000000000000000001000000002b0000) + 0x100000000060000000001000000002e000000000800000000300000) + 0x1000000003300000000020000000000000000000100000000370000) + 0x3900000000020000000000000000000100000000010000000001001e) 0x1000a 0x10008 (h240 0x370000 + 0x200000000000000000002000000000100000000000000000000001e) 0x30000000001000b 0x370013 0x8 (h240 + 0x330000 0x100000000000000000002000000000100000000000000000000001e)) (.leaf8 0x10009 0x20021 + 0x4000000002e001a 0x6000000002c0016 0x290016 0x2a00000000010016 0x130000000028001a + 0x2900000000280016)) (.bin (.leaf8 0x20000000025001a 0x240016 0x2400000000010016 + 0x650000000022001a 0x210016 0x2100000000010016 0xd000000001f001a 0x5000000001e0016) (.leaf8 + 0x1e0014 0x70010 0x10021 0x1fd000000001c001a 0x1d000000001c0016 0x1b00000000040016 + 0x450000000019001a 0x1800000000170016))) (.bin (.bin (.leaf8 0x9f60000000016001a + 0x1700000000160016 0x150014 0x190010 0x10021 0x15c0000000013001a 0x1300000000130016 + 0x31d70000000010001a) (.leaf8 0xf0016 0x20014 0x20010 0x10021 0x6d0000000000d001a 0xc0016 + 0xb00000000010016 0xf934000000000a001a)) (.bin (.leaf8 0x90016 0x800000000010016 + 0x22190000000007001a 0x800000000070016 0x60014 0xa0010 0x10021 0x4ddff0000000004001a) (.leaf8 + 0x500000000040016 0x14 0x70010 0x10021 0x300000000000016 0xaa850000000001001a 0x3001d + 0x100000000010000000001000000aa84000000000000000000000020))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x5000e (h240 0x10000 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x200000000070000000001000000000700000000000000000001001e 0x60023 0x6000d + 0x200000000080000000001000004ddfe000000000100000000010020 0x8000e) (.leaf8 + 0x200000000090000000001000000000a00000000030000000000001e 0x90023 0x9000d + 0x2000000000a00000000010000002218000000000200000000010020 + 0x2000000000b0000000001000000000a0000000000001f 0x90023 0x9000d + 0x2000000000c000000000100000000020000000005001f)) (.bin (.leaf8 0x100000000030023 + 0x2000000000e0000000001000000f933000000000300000000000020 + 0x200000000100000000001000000000d0000000000001f 0xc0023 0xc000d + 0x20000000011000000000100000000020000000007001f 0x100000000030023 + 0x20000000013000000000100000006cf000000000400000000000020) (.leaf8 0x4000e + 0x200000000160000000001000000000200000000080000000000001e 0x100000000030023 + 0x2000000001800000000010000001f62000000000500000000000020 + 0x2000000001a000000000100000000140000000004001f 0x140009 0x1b0021 0x17))) (.bin (.bin (.leaf8 0x1d + 0x103c3 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x1856200000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x5000000aa8500000000060000000001000000000000000000010000) + 0x200000000010000000008000004de00000000000900000000010000) + 0xb0000002219000000000c0000000001000000000b00000000010000) + 0x3000000000100000000000000000001000000000e000000f9330000) + 0xf0000000001000000000e0000000001000000000300000000010000) + 0x1000000001100000006cf000000001200000000010000) + 0x5000000000100000000030000000001000000000000000000010000) + 0x140000001f62000000001500000000010000000014000000001b001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x2000000001a0000000000000000001400000000030000000001001e) + 0x130023 0x13000d 0x1c00000000000000001272000000000500000000010020) (.leaf8 + 0x1c00000000000000000015000000000c001f 0x140023 0x14000d + 0x1d0000000000000000015b000000000600000000010020 0x17000e + 0x1e00000000000000000019000000000d0000000000001e 0x180023 0x18000d)) (.bin (.leaf8 + 0x1f000000000000000009f5000000000700000000010020 0x200000000000000000001a000000000e001f + 0x1000000001a0023 0x2200000000000000000044000000000800000000000020 + 0x240000000000000000001d0000000002001f 0x1c0023 0x1c000d 0x240000000000000000001f0000000012001f) + (.leaf8 0x1e0023 0x1e000d 0x25000000000000000001fc000000000900000000010020 0x20000e + 0x260000000000000000000700000000120000000000001e 0x100000000080023 + 0x280000000000000000000c000000000a00000000000020 0x2a000000000000000000230000000000001f)))) (.bin + (.bin (.bin (.leaf8 0x220023 0x22000d 0x2a000000000000000000020000000015001f 0x100000000030023 + 0x2c00000000000000000064000000000b00000000000020 0x2e000000000000000000260000000000001f 0x250023 + 0x25000d) (.leaf8 0x2e000000000000000000020000000017001f 0x100000000030023 + 0x3000000000000000000001000000000c00000000000020 0x320000000000000000002b000000001a001f 0x2a0023 + 0x2a000d 0x3300000000000000000012000000000d00000000010020 0x340000000000000000002c0000000000001f)) + (.bin (.leaf8 0x2b0023 0x2b000d 0x3400000000000000000002000000001a001f (h240 0x10000 + 0x200000000020000000000000000000100000000070000000003001c) 0x7000f + 0x3600000000000000000007000000001b0000000001001e 0x100000000070023 + 0x3800000000000000000003000000000f00000000000020) (.leaf8 0x35000e + 0x10000000002000000000100000000010000000002001c 0x1000f + 0x3c0000000000000000000100000000210000000001001e 0x23 0xd 0x4000e 0x20186))) (.bin (.bin (.leaf8 + 0x10043 0x50142 0x101c3 0x60023 0x1000c6 0x10043 0x10303 0x10009) (.leaf8 0x20008 0x10009 0x10021 + 0x3600000000000016 0x10000000031001a 0x3200000000310016 0x14 0x340010)) (.bin (.leaf8 0x10021 + 0x50016 0x20014 0x20010 0x10021 0xa000000002b001a 0x2a000000002a0016 0x270016) (.leaf8 + 0x2700000000010016 0x320000000025001a 0x240016 0x2400000000010016 0x60000000022001a 0x210016 + 0x2100000000060016 0xfe000000001f001a))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x20000000001f0016 0x22000000001c001a 0x1d000000001c0016 0x14 0x1f0010 0x10021 0x1b00000000180016 + 0x4fa0000000019001a) (.leaf8 0x1a00000000190016 0xae0000000016001a 0x1600000000160016 + 0x18eb0000000013001a 0x120016 0x500000000010016 0x3670000000010001a 0x1100000000100016)) (.bin + (.leaf8 0x30014 0x130010 0x10021 0xf000000000c0016 0x7c99000000000d001a 0xc0016 0xb00000000010016 + 0x110c000000000a001a) (.leaf8 0xb000000000a0016 0x26f000000000007001a 0x200000000060016 0x60014 + 0x40010 0x10021 0x55420000000004001a 0x30016))) (.bin (.bin (.leaf8 0x20014 0x20010 0x10021 + 0xc2b100000000001001a 0x3001d 0x100000000010000000001000001aa34000000000000000000000020 0x50010 + 0x60021) (.leaf8 0x17 0x1d 0x103c3 (h240 (h240 0x1aa350000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x5000001aa340000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x20000000005000000000000000a80d9000000000000000000010020) + 0x4000e 0x80000000000000000000200000000000000000000001e)) (.bin (.leaf8 0x100000000030023 + 0xa00000000000000005541000000000100000000000020 0x8000e + 0xc0000000000000000000400000000020000000000001e 0x100000000050023 + 0xe00000000000000026eff000000000200000000000020 0x100000000000000000000d0000000006001f 0xc0023) + (.leaf8 0xc000d 0x110000000000000000110b000000000300000000010020 + 0x120000000000000000000d0000000000001f 0xc0023 0xc000d 0x13000000000000000000020000000007001f + 0x100000000030023 0x1500000000000000007c98000000000400000000000020)))) (.bin (.bin (.bin (.leaf8 + 0x17000000000000000000110000000007001f (h240 0x1000000001200000000010000 + 0x10000000005000000000100000000130000000004001c) 0x13000f + 0x190000000000000000001300000000080000000001001e 0x120023 0x12000d + 0x1a00000000000000000366000000000500000000010020 0x1b000000000000000000070000000000001f) (.leaf8 + 0x60023 0x6000d 0x1c00000000000000000002000000000b001f 0x100000000030023 + 0x1e000000000000000018ea000000000600000000000020 0x2000000000000000000018000000000e001f 0x170023 + 0x17000d)) (.bin (.leaf8 0x21000000000000000000ad000000000700000000010020 + 0x220000000000000000001c0000000010001f 0x1b0023 0x1b000d + 0x23000000000000000004f9000000000800000000010020 0x240000000000000000001d000000000f001f (h240 + 0x1000000001e00000000010000 0x100000000020000000001000000001f0000000004001c) 0x1f000f) (.leaf8 + 0x260000000000000000001f00000000100000000001001e 0x1e0023 0x1e000d + 0x2700000000000000000021000000000900000000010020 0x28000000000000000000220000000014001f 0x210023 + 0x21000d 0x29000000000000000000fd000000000a00000000010020))) (.bin (.bin (.leaf8 + 0x2a000000000000000000230000000003001f (h240 0x10000 + 0x2400000000010000000000000000000100000000010000000003001c) 0x1000f + 0x2b0000000000000000000100000000140000000001001e 0x100000000020023 + 0x2d00000000000000000005000000000b00000000000020 0x2f000000000000000000260000000000001f 0x250023) + (.leaf8 0x25000d 0x2f000000000000000000020000000017001f 0x100000000030023 + 0x3100000000000000000031000000000c00000000000020 0x33000000000000000000290000000000001f 0x280023 + 0x28000d 0x33000000000000000000020000000019001f)) (.bin (.leaf8 (h240 0x10000 + 0x3000000000100000000000000000001000000002b0000000003001c) 0x2b000f + 0x350000000000000000002b000000001a0000000001001e 0x1000000002c0023 + 0x3700000000000000000009000000000e00000000000020 0x4000e + 0x3a0000000000000000000200000000010000000000001e (h240 0x1000000000200000000020000 + 0x10000000002000000000100000000340000000004001c)) (.leaf8 0x34000f + 0x3d00000000000000000034000000001e0000000001001e 0x330023 0x33000d + 0x3e00000000000000000000000000001000000000010020 0x38000e (h240 0x10000 + 0x10000000003000000000100000000010000000003001c) 0x1000f))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x420000000000000000000100000000010000000001001e 0x30000000000000b 0x390014 0x3000e 0xc00c6 + 0x10043 0x3b0142 0x101c3) (.leaf8 0x3c0009 0x3600000000010019 0x3e0000000000001d 0x340023 + 0x300000000000000000001009c 0x3c0003 0x3c000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x3cd7460000000000000000000100000000010000 + 0x1aa35000000000300000000010000000002000000000200000000000000) + 0x1000000000500000c2b0f0000000006000000000100000000050000) + 0x1000000000300000000010000000000000000000100000000080000) + 0x5542000000000900000000010000000005000000000100000000000000) + 0x1000000000b0000026eff000000000c0000000001000000000e0000) + 0x110c000000000f0000000001000000000e000000000100000000030000) + 0x10000000000000000000100000000110000007c9900000000120000) + 0x1000000000000000000010000000005000000000100000000140000) + 0x367000000001500000000010000000008000000000100000000030000) + 0x100000000000000000001000000001700000018ea00000000180000) + 0x1000000001900000000ae000000001b0000000001000000001d0000) + 0x4fb000000001e00000000010000000000000000000100000000020000) + 0x1000000002000000000220000000021000000000100000000230000) + 0xff000000002400000000010000000000000000000100000000020000) + 0x1000000000000000000010000000026000000000600000000270000) + 0x1000000000300000000010000000000000000000100000000290000) + 0x32000000002a00000000010000000003000000000100000000000000) + 0x1000000002c000000000100000000000000000001000000002f0000) + 0x9000000003000000000010000000005000000000100000000020000) + 0x2000000000000000000010000000002000000000200000000350000) + 0x3e00000000010000000000000000003c00000000000000000001001e))) (.bin (.leaf8 0x3c000a 0x8 (h240 + 0x350000 0x100000000000000000002000000000100000000000000000000001e) 0x10009 0x20021 + 0x200000000330016 0x14 0x40010) (.leaf8 0x10021 0x500000000000016 0x4000000002e001a + 0x2f000000002e0016 0x2c0014 0x3000000002e0000000000000000000200000000310000000000001f 0x310009 + 0x20021))) (.bin (.bin (.leaf8 0x190000000028001a 0x270016 0x2700000000010016 0x20000000025001a + 0x2600000000250016 0x20014 0x2400000000040000000000000000000200000000280000000000001f 0x280009) + (.leaf8 0x20021 0x7f0000000022001a 0x2100000000210016 0x10000000001f001a 0x20000000001f0016 0x16 + 0x27d000000001c001a 0x1d000000001c0016)) (.bin (.leaf8 0x570000000019001a 0x1800000000170016 + 0xc740000000016001a 0x1700000000160016 0x30014 0x190010 0x10021 0x1500000000060016) (.leaf8 + 0x1b30000000013001a 0x500000000120016 0x120014 0x70010 0x10021 0x3e4c0000000010001a 0xf0016 + 0xe00000000010016)))) (.bin (.bin (.bin (.leaf8 0x886000000000d001a 0xc000000000c0016 + 0x1377f000000000a001a 0x90016 0x900000000030016 0x2aa00000000007001a 0x800000000070016 0x30014) + (.leaf8 0xa0010 0x10021 0x600000000030016 0x615870000000004001a 0x30016 0x20014 0x20010 0x10021)) + (.bin (.leaf8 0xd51a0000000001001a 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x200000000020000000001000000d519000000000000000000010020 0x4000e) (.leaf8 + 0x200000000040000000001000000000200000000000000000000001e 0x100000000030023 + 0x2000000000600000000010000061586000000000100000000000020 + 0x20000000008000000000100000000080000000001001f (h240 0x1000000000900000000010000 + 0x100000000050000000001000000000a0000000004001c) 0xa000f + 0x2000000000a0000000001000000000a00000000020000000001001e 0x90023))) (.bin (.bin (.leaf8 0x9000d + 0x2000000000b00000000010000002a9f000000000200000000010020 + 0x2000000000c0000000001000000000b0000000001001f (h240 0x10000 + 0xc00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x2000000000d0000000001000000000100000000040000000001001e 0x100000000020023 + 0x2000000000f0000000001000001377e000000000300000000000020) (.leaf8 + 0x200000000110000000001000000000e0000000007001f 0x1000000000f0023 + 0x2000000001200000000010000000885000000000400000000000020 + 0x20000000014000000000100000000100000000000001f 0xf0023 0xf000d + 0x20000000015000000000100000000020000000009001f 0x100000000030023)) (.bin (.leaf8 + 0x2000000001700000000010000002739000000000500000000000020 + 0x20000000019000000000100000000140000000004001f (h240 0x100000000000000 + 0x1000000001a0000000000000000001400000000050000000000001e) 0x130023 0x13000d + 0x1b00000000000000001710000000000500000000010020 0x14000e + 0x1b00000000000000000007000000000a0000000000001e) (.leaf8 0x100000000080023 + 0x1d000000000000000001b2000000000600000000000020 0x1f000000000000000000170000000003001f (h240 + 0x1000000001800000000010000 0x10000000005000000000100000000190000000004001c) 0x19000f + 0x2100000000000000000019000000000c0000000001001e 0x180023 0x18000d)))))) (.bin (.bin (.bin (.bin + (.bin (.leaf8 0x2200000000000000000c73000000000700000000010020 + 0x230000000000000000001a000000000e001f 0x1000000001a0023 + 0x2500000000000000000056000000000800000000000020 0x270000000000000000001f0000000012001f 0x1e0023 + 0x1e000d 0x280000000000000000027c000000000900000000010020) (.leaf8 0x2000e + 0x10000000000000000000100000000210000000002001c 0x21000f + 0x2b0000000000000000002100000000130000000001001e 0x200023 0x20000d + 0x2c0000000000000000000f000000000a00000000010020 0x2d000000000000000000230000000015001f)) (.bin + (.leaf8 0x100000000240023 0x2e0000000000000000007e000000000b00000000000020 0x26000e + 0x10000000005000000000100000000280000000002001c 0x28000f + 0x310000000000000000002800000000150000000001001e 0x270023 0x27000d) (.leaf8 + 0x3200000000000000000001000000000c00000000010020 0x33000000000000000000290000000000001f 0x280023 + 0x28000d 0x33000000000000000000020000000019001f 0x100000000030023 + 0x3500000000000000000018000000000d00000000000020 0x5000e))) (.bin (.bin (.leaf8 + 0x1000000002f000000000100000000310000000002001c 0x31000f + 0x3900000000000000000031000000001b0000000001001e 0x300023 0x30000d + 0x3a00000000000000000003000000000f00000000010020 0x7000e (h240 0x10000 + 0x10000000002000000000100000000040000000003001c)) (.leaf8 0x4000f + 0x3e00000000000000000004000000001f0000000001001e (h240 + 0x100000000050000000001000000000000000000010000 + 0x3700000000010000000002000000000100000000010000000005001c) 0x1000f + 0x420000000000000000000100000000240000000001001e 0x1000a 0x20008 0x10009)) (.bin (.leaf8 0x10021 + 0x350016 0x200000000030016 0x80014 0x40010 0x10021 0x20000000031001a 0x2f00000000300016) (.leaf8 + 0x2d00000000040016 0xb000000002b001a 0x2c000000002b0016 0x30014 0x2e0010 0x10021 0x10000000028001a + 0x2900000000280016)))) (.bin (.bin (.bin (.leaf8 0x2700000000030016 0x3f0000000025001a 0x240016 + 0x80000000022001a 0x2200000000220016 0x30014 0x240010 0x10021) (.leaf8 0x13e000000001f001a + 0x20000000001f0016 0x2b000000001c001a 0x1b0016 0x1a0014 0x20010 0x10021 0x63a0000000019001a)) + (.bin (.leaf8 0x500000000180016 0x180014 0x70010 0x10021 0xd90000000016001a 0x150016 + 0x1500000000060016 0x1f250000000013001a) (.leaf8 0x1400000000130016 0x30014 0x160010 0x10021 + 0x12000000000f0016 0x4420000000010001a 0xf0016 0x9bbf000000000d001a))) (.bin (.bin (.leaf8 + 0xe000000000d0016 0x20014 0xc00000000040000000000000000000200000000100000000000001f 0x100009 + 0x20021 0x1550000000000a001a 0x500000000090016 0x90014) (.leaf8 0x70010 0x10021 + 0x30ac30000000007001a 0x60016 0x500000000010016 0x6a8d0000000004001a 0x300000000020016 + 0xf35d10000000001001a)) (.bin (.leaf8 0x200000000010016 0x14 + 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x20000000002000000000100000214b9000000000000000000010020 0x50010 0x40021) (.leaf8 0x17 0x1d + 0x103c3 (h240 0x214bc000000000300000000010000 + 0x500000214ba0000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x20000000003000000000000000d2115000000000000000000010020) + 0x5000000000000000000050000000000001f 0x100000000050023))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x700000000000000006a8c000000000100000000000020 0x9000000000000000000070000000000001f 0x60023 + 0x6000d 0xa000000000000000000020000000003001f 0x100000000030023 + 0xc00000000000000030ac2000000000200000000000020 0xb000e) (.leaf8 + 0xe0000000000000000000700000000040000000000001e 0x100000000080023 + 0x100000000000000000154f000000000300000000000020 0xe000e + 0x10000000005000000000100000000100000000002001c 0x10000f + 0x130000000000000000001000000000050000000001001e 0xf0023)) (.bin (.leaf8 0xf000d + 0x1400000000000000009bbe000000000400000000010020 0x15000000000000000000020000000009001f + 0x100000000030023 0x1700000000000000000441000000000500000000000020 + 0x19000000000000000000140000000009001f (h240 0x1000000001500000000010000 + 0x10000000005000000000100000000160000000004001c) 0x16000f) (.leaf8 + 0x1b00000000000000000016000000000a0000000001001e 0x150023 0x15000d + 0x1c00000000000000001f24000000000600000000010020 0x1d000000000000000000170000000003001f (h240 + 0x10000 0x1800000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1e00000000000000000001000000000c0000000001001e))) (.bin (.bin (.leaf8 0x100000000020023 + 0x20000000000000000000d8000000000700000000000020 0x1a000e + 0x2200000000000000000007000000000e0000000000001e 0x100000000080023 + 0x2400000000000000000639000000000800000000000020 0x1c000e + 0x270000000000000000000200000000100000000000001e) (.leaf8 0x100000000030023 + 0x290000000000000000002a000000000900000000000020 0x2b000000000000000000220000000014001f 0x210023 + 0x21000d 0x2c0000000000000000013d000000000a00000000010020 0x5000e + 0x2e0000000000000000002400000000150000000000001e)) (.bin (.leaf8 0x230023 0x23000d + 0x2f00000000000000000007000000000b00000000010020 0x30000000000000000000020000000017001f + 0x100000000030023 0x320000000000000000003e000000000c00000000000020 + 0x34000000000000000000290000000001001f (h240 0x10000 + 0x2a000000000100000000000000000001000000002a0000000003001c)) (.leaf8 0x2a000f + 0x350000000000000000002a00000000190000000001001e 0x290023 0x29000d + 0x3600000000000000000000000000000d00000000010020 0x5000e + 0x380000000000000000002e000000001b0000000000001e 0x2d0023)))) (.bin (.bin (.bin (.leaf8 0x2d000d + 0x390000000000000000000a000000000e00000000010020 0x3a0000000000000000002f0000000002001f 0x2e0023 + 0x2e000d 0x3a00000000000000000031000000001f001f 0x100000000320023 + 0x3c00000000000000000001000000001000000000000020) (.leaf8 0xa000e + 0x3f0000000000000000000400000000000000000000001e (h240 0x10000 + 0x500000000010000000000000000000100000000010000000003001c) 0x1000f + 0x410000000000000000000100000000210000000001001e (h240 0x1000000000100000000020000 + 0x10000000003000000000100000000010000000004001c) 0x600c6 0x10043)) (.bin (.leaf8 0x30142 0x101c3 + 0x40009 0x14 0x4000e 0x20186 0x10043 0x50142) (.leaf8 0x101c3 0x60023 0x1000c6 0x10043 0x10303 + 0x10009 0x20008 0x10009))) (.bin (.bin (.leaf8 0x10021 0x100000000010019 0x410000000000001d (h240 + 0x20000 0x10000000003000000000100000000010000000003015c) 0x1000f (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 0x4c0d4c0000000000000000000100000000010000 + 0x214bc00000000030000000001000000000500000f35d100000000060000) + 0x1000000000500000000020000000000000000000100000000080000) + 0x6a8c000000000900000000010000000008000000000100000000030000) + 0x100000000000000000001000000000b0000030ac3000000000c0000) + 0x10000000008000000000100000000000000000001000000000e0000) + 0x1550000000000f00000000010000000005000000000100000000110000) + 0x9bbf000000001200000000010000000003000000000100000000000000) + 0x1000000001400000004420000000015000000000100000000000000) + 0x10000000005000000000100000000170000001f2600000000180000) + 0x1000000000000000000010000000002000000000100000000000000) + 0x1000000001a00000000d9000000001b000000000100000000080000) + 0x100000000000000000001000000001d0000000639000000001e0000) + 0x1000000001d00000000010000000003000000000100000000000000) + 0x10000000020000000002a0000000021000000000100000000230000) + 0x13e000000002400000000010000000006000000000100000000250000) + 0x8000000002700000000010000000003000000000100000000000000) + 0x10000000029000000003f000000002a000000000100000000000000) + 0x1000000002b0000000001000000002d000000000100000000060000) + 0x1000000002f000000000c0000000030000000000100000000320000) + 0x1000000000000000000010000000035000000000100000000360000) + 0x1000000000b00000000010000000005000000000200000000000000) + 0x4100000000020000000000000000000100000000010000000001001e) 0x30000000000000b 0x14) (.leaf8 + 0x3000e 0xc00c6 0x10043 0x20142 0x101c3 0x30009 0x10186 0x410000000000001d)) (.bin (.leaf8 0xf + 0x400000000000001d 0x103c3 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x4c0d560000000000000000000100000000010000 + 0x214bc00000000030000000001000000000500000f35d100000000060000) + 0x1000000000500000000020000000000000000000100000000080000) + 0x6a8c000000000900000000010000000008000000000100000000030000) + 0x100000000000000000001000000000b0000030ac3000000000c0000) + 0x10000000008000000000100000000000000000001000000000e0000) + 0x1550000000000f00000000010000000005000000000100000000110000) + 0x9bbf000000001200000000010000000003000000000100000000000000) + 0x1000000001400000004420000000015000000000100000000000000) + 0x10000000005000000000100000000170000001f2600000000180000) + 0x1000000000000000000010000000002000000000100000000000000) + 0x1000000001a00000000d9000000001b000000000100000000080000) + 0x100000000000000000001000000001d0000000639000000001e0000) + 0x1000000001d00000000010000000003000000000100000000000000) + 0x10000000020000000002a0000000021000000000100000000230000) + 0x13e000000002400000000010000000006000000000100000000250000) + 0x8000000002700000000010000000003000000000100000000000000) + 0x10000000029000000003f000000002a000000000100000000000000) + 0x1000000002b0000000001000000002d000000000100000000060000) + 0x1000000002f000000000c0000000030000000000100000000320000) + 0x1000000000000000000010000000035000000000100000000360000) + 0x1000000000b00000000010000000005000000000100000000010000) + 0x4100000000000000000000000000000400000000010000000000001e) 0x4000a 0x10008 0x10009 0x10021) + (.leaf8 0xb00000000030016 0x3500000000340016 0x320014 0x370010 0x10021 0x6000000002e001a + 0x6000000002d0016 0x2b000000002b0016)))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x2a0014 0x2d0010 0x10021 0x1f0000000028001a 0x270016 0x2700000000010016 0x30000000025001a + 0x2500000000250016) (.leaf8 0x2400000000040016 0x9e0000000022001a 0x2300000000220016 + 0x15000000001f001a 0x1e0016 0x1d00000000010016 0x31c000000001c001a 0x1d000000001c0016)) (.bin + (.leaf8 0x80014 0x1f0010 0x10021 0x6c0000000019001a 0x1a00000000190016 0x20014 + 0x18000000000400000000000000000002000000001c0000000000001f 0x1c0009) (.leaf8 0x20021 + 0xf920000000016001a 0x1700000000160016 0x30016 0x2210000000013001a 0x120016 0x1200000000010016 + 0x4ddf0000000010001a))) (.bin (.bin (.leaf8 0x5000000000f0016 0xaa8000000000d001a 0xc0016 + 0xc00000000060016 0x18561000000000a001a 0x90016 0x800000000010016 0x35460000000007001a) (.leaf8 + 0x60016 0x50014 0x20010 0x10021 0x79ae80000000004001a 0x500000000040016 0x10a5e0000000001001a + 0x3001d)) (.bin (.leaf8 0x1000000000100000000010000010a5d000000000000000000000020 + 0x20000000005000000000100000000070000000002001f 0x60023 0x6000d + 0x2000000000600000000010000079ae7000000000100000000010020 0x7000e + 0x200000000080000000001000000000200000000020000000000001e 0x100000000030023) (.leaf8 + 0x2000000000a00000000010000003545000000000200000000000020 + 0x2000000000c0000000001000000000a0000000000001f 0x90023 0x9000d + 0x2000000000d000000000100000000020000000005001f 0x100000000030023 + 0x2000000000f00000000010000018560000000000300000000000020 + 0x200000000110000000001000000000e0000000003001f)))) (.bin (.bin (.bin (.leaf8 (h240 0x10000 + 0xf00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x200000000120000000001000000000100000000060000000001001e 0x100000000020023 + 0x2000000001400000000010000000aa7000000000400000000000020 + 0x20000000016000000000100000000070000000009001f 0x100000000080023 + 0x200000000180000000001000000310b000000000500000000000020) (.leaf8 + 0x2000000001a000000000100000000140000000001001f 0x140009 0x1b0021 0x17 0x1d 0x103c3 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x2606ac0000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x50000010a5d0000000006000000000100000000080000079ae80000) + 0x9000000000100000000080000000001000000000300000000010000) + 0x1000000000b0000003545000000000c00000000010000) + 0xb000000000100000000030000000001000000000000000000010000) + 0xe0000018561000000000f0000000001000000000000000000010000) + 0x200000000010000000000000000000100000000110000000aa70000) + 0x12000000000100000000080000000001000000000000000000010000) + 0x14000000310b000000001500000000010000000014000000001b001c) 0x14000f)) (.bin (.leaf8 (h240 + 0x20000000000000000000100000000010000 0x2000000001a0000000000000000001400000000060000000001001e) + 0x130023 0x13000d 0x1c00000000000000001cd1000000000500000000010020 + 0x1c000000000000000000140000000000001f 0x130023 0x13000d 0x1c00000000000000000002000000000b001f) + (.leaf8 0x100000000030023 0x1e00000000000000000220000000000600000000000020 + 0x20000000000000000000020000000001001f (h240 0x10000 + 0x300000000010000000000000000000100000000180000000003001c) 0x18000f + 0x2200000000000000000018000000000d0000000001001e 0x170023 0x17000d))) (.bin (.bin (.leaf8 + 0x2300000000000000000f91000000000700000000010020 0x1a000e + 0x100000000050000000001000000001c0000000002001c 0x1c000f + 0x250000000000000000001c000000000d0000000001001e 0x1b0023 0x1b000d + 0x260000000000000000006b000000000800000000010020) (.leaf8 0xa000e + 0x280000000000000000001f00000000110000000000001e 0x1e0023 0x1e000d + 0x290000000000000000031b000000000900000000010020 0x2a0000000000000000001f0000000000001f 0x1e0023 + 0x1e000d)) (.bin (.leaf8 0x2b000000000000000000020000000013001f 0x100000000030023 + 0x2d00000000000000000014000000000a00000000000020 0x2f000000000000000000250000000016001f 0x240023 + 0x24000d 0x300000000000000000009d000000000b00000000010020 0x31000000000000000000260000000002001f) + (.leaf8 0x250023 0x25000d 0x31000000000000000000270000000018001f 0x260023 0x26000d + 0x3200000000000000000002000000000c00000000010020 0x33000000000000000000290000000000001f + 0x280023))))) (.bin (.bin (.bin (.bin (.leaf8 0x28000d 0x33000000000000000000020000000019001f + 0x100000000030023 0x350000000000000000001e000000000d00000000000020 0x2c000e + 0x370000000000000000002d000000001b0000000000001e 0x2c0023 0x2c000d) (.leaf8 + 0x3800000000000000000008000000001d001f 0x100000000090023 + 0x3a00000000000000000005000000000f00000000000020 0x34000e + 0x3d0000000000000000003700000000210000000000001e 0x360023 0x36000d + 0x3e0000000000000000000d0000000001001f)) (.bin (.leaf8 (h240 0x1000000000e00000000010000 + 0x10000000002000000000100000000010000000004001c) 0x1000f + 0x410000000000000000000100000000000000000001001e 0x20000000001000b 0xe0014 0x3000e 0x20186 + 0x10043) (.leaf8 0x40142 0x101c3 0x50023 0xe00c6 0x10043 0x10303 0x10009 0x100008))) (.bin (.bin + (.leaf8 0x10009 0x10021 0x3800000000010019 0x3d0000000000001d 0x360023 (h240 0x20000 + 0x10000000011000000000100000000010000000003009c) 0x1000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x533840000000000000000000100000000010000 + 0x2606ac000000000300000000010000000002000000000200000000000000) + 0x100000000050000010a5d0000000006000000000100000000080000) + 0x79ae8000000000900000000010000000008000000000100000000030000) + 0x100000000000000000001000000000b0000003545000000000c0000) + 0x1000000000b00000000010000000003000000000100000000000000) + 0x1000000000e0000018561000000000f000000000100000000000000) + 0x1000000000200000000010000000000000000000100000000110000) + 0xaa7000000001200000000010000000008000000000100000000000000) + 0x100000000140000004ddf0000000015000000000100000000030000) + 0x1000000000000000000010000000017000000022000000000180000) + 0x1000000000300000000010000000000000000000100000000190000) + 0xf93000000001b000000000100000000050000000001000000001d0000) + 0x6c000000001e0000000001000000000b000000000100000000200000) + 0x31c000000002100000000010000000020000000000100000000030000) + 0x1000000000000000000010000000023000000001400000000240000) + 0x10000000026000000009f0000000027000000000100000000280000) + 0x4000000002a00000000010000000003000000000100000000000000) + 0x1000000002c000000001f000000002d0000000001000000002e0000) + 0x1000000000900000000010000000000000000000100000000320000) + 0x5000000003300000000010000000035000000000100000000370000) + 0x3e00000000020000000000000000000100000000000000000001001e)) (.leaf8 0x110000000001000b 0x14 + 0x12000e 0x20186 0x10043 0x130142 0x101c3 0x140023)) (.bin (.leaf8 0x2c00c6 0x10043 0x10303 + 0x10009 0x20008 0x10009 0x10021 0x3700000000010019) (.leaf8 0x3d0000000000001d 0x350023 (h240 + 0x20000 0x10000000003000000000100000000010000000003009c) 0x1000f (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x5338a0000000000000000000100000000010000 + 0x2606ac000000000300000000010000000002000000000200000000000000) + 0x100000000050000010a5d0000000006000000000100000000080000) + 0x79ae8000000000900000000010000000008000000000100000000030000) + 0x100000000000000000001000000000b0000003545000000000c0000) + 0x1000000000b00000000010000000003000000000100000000000000) + 0x1000000000e0000018561000000000f000000000100000000000000) + 0x1000000000200000000010000000000000000000100000000110000) + 0xaa7000000001200000000010000000008000000000100000000000000) + 0x100000000140000004ddf0000000015000000000100000000030000) + 0x1000000000000000000010000000017000000022000000000180000) + 0x1000000000300000000010000000000000000000100000000190000) + 0xf93000000001b000000000100000000050000000001000000001d0000) + 0x6c000000001e0000000001000000000b000000000100000000200000) + 0x31c000000002100000000010000000020000000000100000000030000) + 0x1000000000000000000010000000023000000001400000000240000) + 0x10000000026000000009f0000000027000000000100000000280000) + 0x4000000002a00000000010000000003000000000100000000000000) + 0x1000000002c000000001f000000002d0000000001000000002e0000) + 0x1000000000900000000010000000000000000000100000000320000) + 0x5000000003300000000010000000035000000000100000000360000) + 0x3e000000000200000000000000000001000000000a0000000001001e) 0x30000000001000b 0x14 0x4000e)))) + (.bin (.bin (.bin (.leaf8 0x20186 0x10043 0x50142 0x101c3 0x60023 0x1000c6 0x10043 0x10303) + (.leaf8 0x10009 0x20008 0x10009 0x10021 0x3600000000010019 0x3d0000000000001d 0x340023 (h240 + 0x20000 0x10000000003000000000100000000010000000003009c))) (.bin (.leaf8 0x1000f (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 0x533a400000000000000 0x1000000000100002606ac0000000003000000000100000000020000) + 0x20000000000000000000100000000050000010a5d00000000060000) + 0x100000000080000079ae80000000009000000000100000000080000) + 0x10000000003000000000100000000000000000001000000000b0000) + 0x3545000000000c0000000001000000000b000000000100000000030000) + 0x100000000000000000001000000000e0000018561000000000f0000) + 0x1000000000000000000010000000002000000000100000000000000) + 0x100000000110000000aa70000000012000000000100000000080000) + 0x10000000000000000000100000000140000004ddf00000000150000) + 0x1000000000300000000010000000000000000000100000000170000) + 0x220000000001800000000010000000003000000000100000000000000) + 0x100000000190000000f93000000001b000000000100000000050000) + 0x1000000001d000000006c000000001e0000000001000000000b0000) + 0x10000000020000000031c0000000021000000000100000000200000) + 0x1000000000300000000010000000000000000000100000000230000) + 0x14000000002400000000010000000026000000009f00000000270000) + 0x100000000280000000004000000002a000000000100000000030000) + 0x100000000000000000001000000002c000000001f000000002d0000) + 0x1000000002e00000000010000000009000000000100000000000000) + 0x1000000003200000000050000000033000000000200000000350000) + 0x3d00000000020000000000000000000100000000010000000001001e) 0x30000000000000b 0x14 0x3000e 0xc00c6 + 0x10043 0x20142) (.leaf8 0x101c3 0x30009 0x3500000000010019 0x3d0000000000001d 0x330023 + 0x300000000000000000001009c 0x30003 0x3000f))) (.bin (.bin (.leaf8 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x533ac0000000000000000000100000000010000 + 0x2606ac000000000300000000010000000002000000000200000000000000) + 0x100000000050000010a5d0000000006000000000100000000080000) + 0x79ae8000000000900000000010000000008000000000100000000030000) + 0x100000000000000000001000000000b0000003545000000000c0000) + 0x1000000000b00000000010000000003000000000100000000000000) + 0x1000000000e0000018561000000000f000000000100000000000000) + 0x1000000000200000000010000000000000000000100000000110000) + 0xaa7000000001200000000010000000008000000000100000000000000) + 0x100000000140000004ddf0000000015000000000100000000030000) + 0x1000000000000000000010000000017000000022000000000180000) + 0x1000000000300000000010000000000000000000100000000190000) + 0xf93000000001b000000000100000000050000000001000000001d0000) + 0x6c000000001e0000000001000000000b000000000100000000200000) + 0x31c000000002100000000010000000020000000000100000000030000) + 0x1000000000000000000010000000023000000001400000000240000) + 0x10000000026000000009f0000000027000000000100000000280000) + 0x4000000002a00000000010000000003000000000100000000000000) + 0x1000000002c000000001f000000002d0000000001000000002e0000) + 0x1000000000900000000010000000000000000000100000000320000) + 0x5000000003300000000010000000035000000000100000000340000) + 0x3e00000000010000000000000000000300000000000000000001001e) 0x3000a 0x8 (h240 0x340000 + 0x100000000000000000002000000000100000000000000000000001e) 0x10009 0x20021 0x3300000000330016 + 0x20000000031001a) (.leaf8 0x300016 0x2e00000000070016 0xf000000002b001a 0x2c000000002b0016 + 0x30014 0x2e0010 0x10021 0x20000000028001a)) (.bin (.leaf8 0x2700000000260016 0x4f0000000025001a + 0x2400000000240016 0x90000000022001a 0x2300000000220016 0x30014 0x250010 0x10021) (.leaf8 + 0x21000000001e0016 0x18d000000001f001a 0x20000000001f0016 0x1e00000000090016 0x35000000001c001a + 0x1d000000001c0016 0x1b00000000030016 0x7c90000000019001a)))))) (.bin (.bin (.bin (.bin (.bin + (.leaf8 0x170016 0x1800000000010016 0x10f0000000016001a 0x1700000000160016 0x30014 0x190010 + 0x10021 0x26ef0000000013001a) (.leaf8 0x1400000000130016 0x80014 0x160010 0x10021 + 0x5530000000010001a 0x1100000000100016 0x20014 + 0xf00000000040000000000000000000200000000130000000000001f)) (.bin (.leaf8 0x130009 0x20021 + 0xc2b0000000000d001a 0xc0016 0xb00000000010016 0x1aa2000000000a001a 0xb000000000a0016 0x30014) + (.leaf8 0xd0010 0x10021 0x900000000060016 0x3cd730000000007001a 0x800000000070016 + 0x852e0000000004001a 0x500000000040016 0x14))) (.bin (.bin (.leaf8 0x70010 0x10021 + 0x300000000000016 0x1303550000000001001a 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f 0x20023) (.leaf8 0x2000d + 0x20000000002000000000100000299d5000000000000000000010020 (h240 0x100000000000000 + 0x100000000040000000000000010697e000000000000000000010020) 0x5000e (h240 0x10000 + 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x70000000000000000000700000000000000000001001e 0x60023)) (.bin (.leaf8 0x6000d + 0x80000000000000000852d000000000100000000010020 0x90000000000000000000a0000000004001f 0x90023 + 0x9000d 0xa0000000000000003cd72000000000200000000010020 0xb0000000000000000000b0000000003001f + (h240 0x1000000000c00000000010000 0x100000000050000000001000000000d0000000004001c)) (.leaf8 + 0xd000f 0xd0000000000000000000d00000000040000000001001e 0xc0023 0xc000d + 0xe00000000000000001aa1000000000300000000010020 0xf0000000000000000000d0000000000001f 0xc0023 + 0xc000d)))) (.bin (.bin (.bin (.leaf8 0x10000000000000000000020000000007001f 0x100000000030023 + 0x120000000000000000c2af000000000400000000000020 0x11000e + 0x10000000005000000000100000000130000000002001c 0x13000f + 0x150000000000000000001300000000070000000001001e 0x120023) (.leaf8 0x12000d + 0x1600000000000000000552000000000500000000010020 0xa000e + 0x1800000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x19000000000000000026ee000000000600000000010020 0x5000e)) (.bin (.leaf8 + 0x1b00000000000000000019000000000d0000000000001e 0x180023 0x18000d + 0x1c0000000000000000010e000000000700000000010020 0x1d0000000000000000001a0000000000001f 0x190023 + 0x19000d 0x1d00000000000000000002000000000e001f) (.leaf8 0x100000000020023 + 0x1f000000000000000007c8000000000800000000000020 0x210000000000000000001d0000000001001f (h240 + 0x10000 0x1e000000000100000000000000000001000000001e0000000003001c) 0x1e000f + 0x220000000000000000001e00000000110000000001001e 0x1d0023 0x1d000d))) (.bin (.bin (.leaf8 + 0x2300000000000000000034000000000900000000010020 0x24000000000000000000200000000005001f (h240 + 0x10000 0x2100000000010000000000000000000100000000210000000003001c) 0x21000f + 0x250000000000000000002100000000130000000001001e 0x200023 0x20000d + 0x260000000000000000018c000000000a00000000010020) (.leaf8 0x27000000000000000000230000000013001f + (h240 0x1000000002400000000010000 0x10000000005000000000100000000250000000004001c) 0x25000f + 0x290000000000000000002500000000140000000001001e 0x240023 0x24000d + 0x2a00000000000000000008000000000b00000000010020 0x2b000000000000000000260000000017001f)) (.bin + (.leaf8 0x100000000270023 0x2c0000000000000000004e000000000c00000000000020 + 0x2e000000000000000000290000000018001f 0x100000000290023 + 0x3000000000000000000001000000000d00000000000020 0x5000e + 0x330000000000000000002e000000001b0000000000001e 0x2d0023) (.leaf8 0x2d000d + 0x340000000000000000000e000000000e00000000010020 0x35000000000000000000300000000004001f 0x2f0023 + 0x2f000d 0x3600000000000000000002000000001f001f 0x100000000030023 + 0x3800000000000000000001000000001000000000000020))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x3a000000000000000000350000000021001f (h240 0x100000000360000000001000000000000000000010000 + 0x3600000000010000000002000000000100000000010000000005001c) 0x20186 0x10043 0x10142 0x101c3 + 0x20023 0x800c6) (.leaf8 0x10043 0x10303 0x10009 0x20008 0x10009 0x10021 0x340016 + 0x10000000034001a)) (.bin (.leaf8 0x330016 0x3100000000010016 0x7000000002e001a 0x2f000000002e0016 + 0x2d00000000040016 0x2a0016 0x290014 0x20010) (.leaf8 0x10021 0x270000000028001a 0x270016 + 0x50000000025001a 0x500000000240016 0x240014 0x70010 0x10021))) (.bin (.bin (.leaf8 + 0xc60000000022001a 0x2200000000220016 0x210014 0x240010 0x10021 0x1a000000001f001a + 0x1f000000001f0016 0x1e0014) (.leaf8 0x210010 0x10021 0x3e4000000001c001a 0x1b0016 0x20014 0x20010 + 0x10021 0x880000000019001a)) (.bin (.leaf8 0x600000000180016 0x13770000000016001a + 0x1700000000160016 0x1500000000090016 0x2a90000000013001a 0x500000000120016 0x61580000000010001a + 0xf0016) (.leaf8 0xe00000000010016 0xd51000000000d001a 0x5000000000c0016 0xc0014 0x70010 0x10021 + 0x1e6b9000000000a001a 0xb000000000a0016)))) (.bin (.bin (.bin (.leaf8 0x42970000000007001a + 0x200000000060016 0x60014 0x40010 0x10021 0x981aa0000000004001a 0x400000000040016 + 0x14ceb0000000001001a) (.leaf8 0x200000000010016 0x14 + 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x2000000000200000000010000014cea000000000000000000010020 + 0x20000000003000000000100000000060000000002001f 0x50023)) (.bin (.leaf8 0x5000d + 0x20000000004000000000100000981a9000000000100000000010020 0x8000e + 0x200000000050000000001000000000400000000020000000000001e 0x100000000050023 + 0x2000000000700000000010000004296000000000200000000000020 + 0x200000000090000000001000000000d0000000006001f 0xc0023) (.leaf8 0xc000d + 0x2000000000a0000000001000001e6b8000000000300000000010020 0xe000e + 0x2000000000b0000000001000000000700000000060000000000001e 0x100000000080023 + 0x2000000000d00000000010000000d50000000000400000000000020 + 0x2000000000f000000000100000000100000000000001f 0xf0023))) (.bin (.bin (.leaf8 0xf000d + 0x20000000010000000000100000000020000000009001f 0x100000000030023 + 0x2000000001200000000010000003d4d000000000500000000000020 + 0x20000000014000000000100000000140000000000001f 0x140009 0x150021 0x17) (.leaf8 0x1d 0x103c3 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 0x2f88400000 + 0x3000000000100000000050000014ceb000000000600000000010000) + 0x700000981ab00000000090000000001000000000500000000010000) + 0x1000000000b0000004296000000000c00000000010000) + 0xe000001e6ba000000000f0000000001000000000800000000010000) + 0x100000000110000000d50000000001200000000010000) + 0x11000000000100000000030000000001000000000000000000010000) + 0x140000003d4d0000000015000000000100000000140000000015001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000140000000000000000001400000000070000000001001e) + 0x130023 0x13000d 0x1600000000000000002408000000000500000000010020)) (.bin (.leaf8 + 0x1600000000000000000007000000000b001f 0x100000000080023 + 0x18000000000000000002a8000000000600000000000020 0x1a000000000000000000170000000005001f (h240 + 0x10000 0x1800000000010000000000000000000100000000180000000003001c) 0x18000f + 0x1b00000000000000000018000000000d0000000001001e 0x170023) (.leaf8 0x17000d + 0x1c00000000000000001376000000000700000000010020 0x1d00000000000000000008000000000f001f + 0x100000000090023 0x1f00000000000000000087000000000800000000000020 0x4000e + 0x220000000000000000000200000000100000000000001e 0x100000000030023))))))) (.bin (.bin (.bin (.bin + (.bin (.bin (.leaf8 0x24000000000000000003e3000000000900000000000020 0x20000e + 0x260000000000000000002100000000130000000000001e 0x200023 0x20000d + 0x2700000000000000000019000000000a00000000010020 0x23000e + 0x280000000000000000002400000000150000000000001e) (.leaf8 0x230023 0x23000d + 0x29000000000000000000c5000000000b00000000010020 0x26000e + 0x2a0000000000000000000700000000160000000000001e 0x100000000080023 + 0x2c00000000000000000004000000000c00000000000020 0x2e000000000000000000020000000019001f)) (.bin + (.leaf8 0x100000000030023 0x3000000000000000000026000000000d00000000000020 0x2b000e + 0x3300000000000000000002000000001a0000000000001e (h240 0x10000 + 0x3000000000100000000000000000001000000002e0000000003001c) 0x2e000f + 0x350000000000000000002e00000000010000000001001e 0x2d0023) (.leaf8 0x2d000d + 0x3600000000000000000031000000001e001f 0x300023 0x30000d + 0x3700000000000000000006000000000f00000000010020 0x38000000000000000000330000000000001f 0x320023 + 0x32000d))) (.bin (.bin (.leaf8 0x39000000000000000000020000000021001f 0x100000000030023 + 0x3b00000000000000000000000000001100000000000020 0x3c000000000000000000020000000022001f 0x10023 + 0x1000d 0x3000e 0x40000000001000b) (.leaf8 0x3800000000010016 0x30014 0x3a0010 0x10021 + 0x3300000000320016 0x30000000031001a 0x2f00000000300016 0x30014)) (.bin (.leaf8 0x310010 0x10021 + 0x2d000000002a0016 0x12000000002b001a 0x2c000000002b0016 0x30014 0x2e0010 0x10021) (.leaf8 + 0x20000000028001a 0x270016 0x2700000000060016 0x630000000025001a 0x2400000000230016 + 0xd0000000022001a 0x2100000000200016 0x1f1000000001f001a)))) (.bin (.bin (.bin (.leaf8 + 0x20000000001f0016 0x30014 0x220010 0x10021 0x1e00000000030016 0x43000000001c001a 0x1b0016 + 0x1b00000000070016) (.leaf8 0x9bb0000000019001a 0x170016 0x1540000000016001a 0x1700000000160016 + 0x80014 0x190010 0x10021 0x30ab0000000013001a)) (.bin (.leaf8 0x1400000000130016 0x30014 0x160010 + 0x10021 0x12000000000f0016 0x6a70000000010001a 0x1100000000100016 0x80014) (.leaf8 0x130010 + 0x10021 0xf35d000000000d001a 0xc000000000c0016 0x214a000000000a001a 0xb000000000a0016 0x50014 + 0xd0010))) (.bin (.bin (.leaf8 0x10021 0x4c0d50000000007001a 0x700000000070016 + 0xa6750000000004001a 0x500000000040016 0x17c4200000000001001a 0x3001d + 0x100000000010000000001000003408f000000000000000000000020) (.leaf8 0x50010 0x60021 0x17 0x1d + 0x103c3 (h240 (h240 0x340900000 0x3000000000100000000020000000002000000000000000000010000) + 0x5000003408f0000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x200000000050000000000000014838e000000000000000000010020))) + (.bin (.leaf8 0x7000000000000000000070000000002001f 0x60023 0x6000d + 0x80000000000000000a674000000000100000000010020 0x9000000000000000000090000000004001f 0x80023 + 0x8000d 0xa0000000000000004c0d4000000000200000000010020) (.leaf8 0x7000e + 0xc0000000000000000000d00000000050000000000001e 0xc0023 0xc000d + 0xd00000000000000002149000000000300000000010020 0xe0000000000000000000e0000000007001f + 0x1000000000f0023 0xf0000000000000000f35c000000000400000000000020))))) (.bin (.bin (.bin (.bin + (.leaf8 0xa000e 0x120000000000000000001300000000090000000000001e 0x120023 0x12000d + 0x13000000000000000006a6000000000500000000010020 0x14000000000000000000140000000009001f (h240 + 0x1000000001500000000010000 0x10000000005000000000100000000160000000004001c) 0x16000f) (.leaf8 + 0x1600000000000000000016000000000a0000000001001e 0x150023 0x15000d + 0x17000000000000000030aa000000000600000000010020 0xa000e + 0x1900000000000000000019000000000d0000000000001e 0x180023 0x18000d)) (.bin (.leaf8 + 0x1a00000000000000000153000000000700000000010020 0x1b00000000000000000002000000000e001f + 0x100000000020023 0x1d000000000000000009ba000000000800000000000020 + 0x1f0000000000000000001d0000000004001f 0x1c0023 0x1c000d 0x1f000000000000000000020000000011001f) + (.leaf8 0x100000000030023 0x2100000000000000000042000000000900000000000020 + 0x23000000000000000000200000000001001f (h240 0x1000000002100000000010000 + 0x10000000005000000000100000000220000000004001c) 0x22000f + 0x250000000000000000002200000000120000000001001e 0x210023 0x21000d))) (.bin (.bin (.leaf8 + 0x26000000000000000001f0000000000a00000000010020 0x27000000000000000000230000000014001f + 0x100000000230023 0x290000000000000000000c000000000b00000000000020 + 0x2b000000000000000000260000000016001f 0x100000000260023 + 0x2d00000000000000000062000000000c00000000000020 0x2f000000000000000000290000000003001f) (.leaf8 + (h240 0x10000 0x2a00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x300000000000000000000100000000180000000001001e 0x100000000020023 + 0x3200000000000000000001000000000d00000000000020 0x5000e + 0x350000000000000000002e000000001b0000000000001e 0x2d0023)) (.bin (.leaf8 0x2d000d + 0x3600000000000000000011000000000e00000000010020 0x370000000000000000002f000000001b001f (h240 + 0x1000000003000000000010000 0x10000000005000000000100000000310000000004001c) 0x31000f + 0x3900000000000000000031000000001d0000000001001e 0x100000000320023 + 0x3b00000000000000000002000000001000000000000020) (.leaf8 0x3d000000000000000000350000000020001f + (h240 0x1000000003500000000020000 0x10000000005000000000100000000390000000004001c) 0x39000d + 0x5000e 0x20186 0x10043 0x60142 0x101c3)))) (.bin (.bin (.bin (.leaf8 0x70023 0x1200c6 0x10043 + 0x10303 0x10009 0x3b0008 0x10009 0x10021) (.leaf8 0x30016 0x350014 0x20010 0x10021 + 0x10000000034001a 0x330016 0x500000000300016 0x300014)) (.bin (.leaf8 0x70010 0x10021 + 0x9000000002e001a 0x6000000002d0016 0x2c000000002b0016 0x20014 + 0x2a000000000400000000000000000002000000002e0000000000001f 0x2e0009) (.leaf8 0x20021 + 0x310000000028001a 0x270016 0x260014 0x20010 0x10021 0x60000000025001a 0x240016))) (.bin (.bin + (.leaf8 0x230014 0x20010 0x10021 0xf80000000022001a 0x2300000000220016 0x30016 0x21000000001f001a + 0x20000000001f0016) (.leaf8 0x30014 0x220010 0x10021 0x4dd000000001c001a 0x1d000000001c0016 0x14 + 0x1f0010 0x10021)) (.bin (.leaf8 0x1b00000000000016 0xa90000000019001a 0x1a00000000190016 + 0x1800000000090016 0x18550000000016001a 0x500000000150016 0x150014 0x70010) (.leaf8 0x10021 + 0x3530000000013001a 0x1400000000130016 0x1200000000090016 0x79ad0000000010001a 0x1100000000100016 + 0xf0014 0x130010)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 0x10021 0x10a5000000000d001a + 0x8000000000c0016 0x2606a000000000a001a 0xa000000000a0016 0x533a0000000007001a 0x800000000070016 + 0xbe20f0000000004001a) (.leaf8 0x500000000040016 0x14 0x70010 0x10021 0x300000000000016 + 0x1a0470000000001001a 0x100000000010016 0x14)) (.bin (.leaf8 + 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x200000000020000000001000001a046000000000000000000010020 0x5000e (h240 0x10000 + 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x200000000050000000001000000000700000000000000000001001e) (.leaf8 0x60023 0x6000d + 0x20000000006000000000100000be20e000000000100000000010020 + 0x200000000070000000001000000000a0000000004001f 0x90023 0x9000d + 0x2000000000800000000010000005339000000000200000000010020 + 0x200000000090000000001000000000c0000000006001f))) (.bin (.bin (.leaf8 0xb0023 0xb000d + 0x2000000000a00000000010000026069000000000300000000010020 + 0x2000000000b0000000001000000000a0000000007001f 0x1000000000b0023 + 0x2000000000d000000000100000010a4000000000400000000000020 0x11000e + 0x2000000000f0000000001000000001300000000090000000000001e) (.leaf8 0x120023 0x12000d + 0x2000000001000000000010000004c99000000000500000000010020 + 0x20000000011000000000100000000140000000005001f (h240 0x100000000000000 + 0x100000000120000000000000000001400000000040000000000001e) 0x130023 0x13000d + 0x1300000000000000002d11000000000500000000010020)) (.bin (.leaf8 + 0x13000000000000000000140000000005001f (h240 0x10000 + 0x1500000000010000000000000000000100000000150000000003001c) 0x15000f + 0x1400000000000000000015000000000b0000000001001e 0x140023 0x14000d + 0x1500000000000000000352000000000600000000010020 0x17000e) (.leaf8 + 0x1600000000000000000007000000000c0000000000001e 0x100000000080023 + 0x1800000000000000001854000000000700000000000020 0x1a0000000000000000001a0000000005001f (h240 + 0x10000 0x1b000000000100000000000000000001000000001b0000000003001c) 0x1b000f + 0x1b0000000000000000001b000000000f0000000001001e 0x1a0023)))) (.bin (.bin (.bin (.leaf8 0x1a000d + 0x1c000000000000000000a8000000000800000000010020 0x1d000e (h240 0x10000 + 0x100000000020000000001000000001f0000000003001c) 0x1f000f + 0x1f0000000000000000001f00000000100000000001001e 0x1e0023 0x1e000d) (.leaf8 + 0x20000000000000000004dc000000000900000000010020 0x5000e + 0x220000000000000000002200000000130000000000001e 0x210023 0x21000d + 0x2300000000000000000020000000000a00000000010020 0x24000000000000000000020000000001001f (h240 + 0x10000 0x300000000010000000000000000000100000000240000000003001c))) (.bin (.leaf8 0x24000f + 0x260000000000000000002400000000150000000001001e 0x230023 0x23000d + 0x27000000000000000000f7000000000b00000000010020 0x25000e + 0x290000000000000000000200000000160000000000001e 0x100000000030023) (.leaf8 + 0x2b00000000000000000005000000000c00000000000020 0x28000e + 0x2e0000000000000000000200000000180000000000001e 0x100000000030023 + 0x3000000000000000000030000000000d00000000000020 0x2c000e + 0x100000000050000000001000000002e0000000002001c 0x2e000f))) (.bin (.bin (.leaf8 + 0x330000000000000000002e00000000190000000001001e 0x2d0023 0x2d000d + 0x3400000000000000000008000000001d001f 0x100000000090023 + 0x3600000000000000000008000000000f00000000000020 0x32000e + 0x3800000000000000000007000000001e0000000000001e) (.leaf8 (h240 0x10000 + 0x800000000010000000000000000000100000000010000000003001c) 0x1000f + 0x3a0000000000000000000100000000200000000001001e 0x100000000020023 + 0x3c00000000000000000000000000001100000000000020 0x37000e + 0x3d0000000000000000000200000000000000000000001e (h240 0x1000000000300000000010000 + 0x1000000003c000000000100000000010000000004001c))) (.bin (.leaf8 0x1000f + 0x400000000000000000000100000000010000000001001e 0x1000a 0x3c0008 (h240 0x30000 + 0x3d00000000000000000002000000000100000000000000000000001e) 0x3e0000000001000b 0x30013 0x380008) + (.leaf8 0x10009 0x10021 0x360016 0x16 0x3300000000060016 0x40000000031001a 0x300016 + 0x2f00000000070016))))) (.bin (.bin (.bin (.bin (.leaf8 0x2d00000000030016 0x18000000002b001a + 0x2a0016 0x2900000000010016 0x20000000028001a 0x2900000000280016 0x30014 0x2b0010) (.leaf8 0x10021 + 0x2700000000240016 0x7b0000000025001a 0x2500000000250016 0x30014 0x270010 0x10021 + 0x100000000022001a)) (.bin (.leaf8 0x2300000000220016 0x2100000000040016 0x26e000000001f001a + 0x2000000001e0016 0x1e0014 0x40010 0x10021 0x54000000001c001a) (.leaf8 0x1c000000001c0016 0x1b0014 + 0x1e0010 0x10021 0xc2a0000000019001a 0x180016 0x1800000000060016 0x1a90000000016001a))) (.bin + (.bin (.leaf8 0x1600000000160016 0x150014 0x180010 0x10021 0x3cd60000000013001a 0x1400000000130016 + 0x8520000000010001a 0x1100000000100016) (.leaf8 0xb0014 0x130010 0x10021 0x13035000000000d001a + 0xc000000000b0016 0x299c000000000a001a 0xb000000000a0016 0x5f1070000000007001a)) (.bin (.leaf8 + 0x800000000070016 0x16 0xd0240000000004001a 0x300000000020016 0x1db5060000000001001a + 0x200000000010016 0x14 0x20000000000000000000100000000040000000000001f) (.leaf8 0x30023 0x3000d + 0x20000000002000000000100000410b6000000000000000000010020 0x50010 0x40021 0x17 0x1d 0x103c3)))) + (.bin (.bin (.bin (.leaf8 (h240 0x410b9000000000300000000010000 + 0x500000410b70000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x200000000030000000000000019a44d000000000000000000010020) + 0x5000000000000000000050000000000001f 0x100000000050023 + 0x70000000000000000d023000000000100000000000020 0x2000e + 0x10000000000000000000100000000090000000002001c) (.leaf8 0x9000f + 0xb0000000000000000000900000000030000000001001e 0x80023 0x8000d + 0xc0000000000000005f106000000000200000000010020 0xd0000000000000000000d0000000006001f 0xc0023 + 0xc000d)) (.bin (.leaf8 0xe0000000000000000299b000000000300000000010020 + 0xf0000000000000000000e0000000006001f 0x1000000000e0023 + 0x1100000000000000013034000000000400000000000020 0xd000e + 0x140000000000000000001300000000090000000000001e 0x120023 0x12000d) (.leaf8 + 0x1500000000000000000851000000000500000000010020 0x1600000000000000000016000000000c001f 0x150023 + 0x15000d 0x1700000000000000003cd5000000000600000000010020 0x17000e + 0x1800000000000000000018000000000d0000000000001e 0x170023))) (.bin (.bin (.leaf8 0x17000d + 0x19000000000000000001a8000000000700000000010020 0x1a0000000000000000001a0000000003001f (h240 + 0x10000 0x1b00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1b00000000000000000001000000000e0000000001001e 0x100000000020023 + 0x1d00000000000000000c29000000000800000000000020) (.leaf8 0x1d000e + 0x1f0000000000000000001e00000000110000000000001e 0x1d0023 0x1d000d + 0x2000000000000000000053000000000900000000010020 0x20000e + 0x210000000000000000000400000000120000000000001e 0x100000000050023)) (.bin (.leaf8 + 0x230000000000000000026d000000000a00000000000020 0x25000000000000000000230000000002001f 0x220023 + 0x22000d 0x25000000000000000000250000000016001f 0x240023 0x24000d + 0x260000000000000000000f000000000b00000000010020) (.leaf8 0x5000e + 0x280000000000000000002700000000170000000000001e 0x260023 0x26000d + 0x290000000000000000007a000000000c00000000010020 0x2a000000000000000000290000000017001f (h240 + 0x1000000002a00000000010000 0x100000000050000000001000000002b0000000004001c) 0x2b000f)))))))))) + +set_option maxRecDepth 20000 in +def st_3 : CertTree := + (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x2c0000000000000000002b00000000180000000001001e 0x2a0023 0x2a000d + 0x2d00000000000000000001000000000d00000000010020 0x2e0000000000000000002b0000000000001f 0x2a0023 + 0x2a000d 0x2f00000000000000000002000000001b001f) (.leaf8 0x100000000030023 + 0x3100000000000000000017000000000e00000000000020 0x330000000000000000002f0000000001001f (h240 + 0x10000 0x3000000000010000000000000000000100000000300000000003001c) 0x30000f + 0x340000000000000000003000000000030000000001001e 0x2f0023 0x2f000d)) (.bin (.leaf8 + 0x3500000000000000000002000000001f001f 0x100000000030023 + 0x3700000000000000000003000000001000000000000020 0x39000000000000000000350000000003001f (h240 + 0x100000000360000000001000000000000000000010000 + 0x200000000010000000000000000000100000000010000000005001c) 0x1000f + 0x3c0000000000000000000100000000220000000001001e (h240 0x1000000000200000000010000 + 0x10000000039000000000100000000010000000004001c)) (.leaf8 0x1000f 0x3f0000000000001d (h240 0x10000 + 0x2000000000100000000000000000001000000003f0000000003001c) 0x20186 0x10043 0x3f0142 0x101c3 + 0x400023))) (.bin (.bin (.leaf8 0x8400c6 0x10043 0x10303 0x10009 0x8 0x10009 0x10021 + 0x3900000000000016) (.leaf8 0x20014 0x3b000e (h240 0x10000 + 0x10000000001000000000100000000010000000003001c) 0x1000f 0x2000000000400000000030000000002001d + (h240 0x360000 0x400000000040000000002000000000100000000000000000000001e) 0x10009 0x50021)) (.bin + (.leaf8 0x10000000034001a 0x3500000000340016 0x30014 0x370010 0x10021 0x2f0016 0xc000000002e001a + 0x2d0016) (.leaf8 0x2c00000000010016 0x1000000002b001a 0x5000000002a0016 0x2a0014 0x70010 0x10021 + 0x3d0000000028001a 0x2800000000280016)))) (.bin (.bin (.bin (.leaf8 0x2700000000040016 + 0x70000000025001a 0x2600000000250016 0x1370000000022001a 0x210016 0x2100000000030016 + 0x2a000000001f001a 0x1e000000001d0016) (.leaf8 0x614000000001c001a 0x1d000000001c0016 0x20014 + 0x1b000000000400000000000000000002000000001f0000000000001f 0x1f0009 0x20021 0xd40000000019001a + 0x1900000000190016)) (.bin (.leaf8 0x1e6b0000000016001a 0x1700000000160016 0x4290000000013001a + 0xe00000000120016 0x981a0000000010001a 0xf0016 0xe0014 0x20010) (.leaf8 0x10021 + 0x14ce000000000d001a 0xc000000000c0016 0x2f883000000000a001a 0x80016 0x900000000010016 + 0x68110000000007001a 0x60016))) (.bin (.bin (.leaf8 0x50014 0x20010 0x10021 0xeda830000000004001a + 0x300000000030016 0x2085c0000000001001a 0x3001d + 0x100000000010000000001000002085b000000000000000000000020) (.leaf8 + 0x20000000005000000000100000000050000000001001f 0x100000000060023 + 0x20000000006000000000100000eda82000000000100000000000020 0x7000e + 0x200000000090000000001000000000200000000020000000000001e 0x100000000030023 + 0x2000000000b00000000010000006810000000000200000000000020 + 0x2000000000d0000000001000000000b0000000000001f)) (.bin (.leaf8 0xa0023 0xa000d + 0x2000000000d000000000100000000020000000004001f 0x100000000020023 + 0x2000000000f0000000001000002f882000000000300000000000020 + 0x200000000110000000001000000000e0000000007001f 0x1000000000f0023 + 0x20000000012000000000100000014cd000000000400000000000020) (.leaf8 0x10000e + 0x200000000150000000001000000000200000000080000000000001e 0x100000000030023 + 0x2000000001700000000010000005fc0000000000500000000000020 + 0x20000000019000000000100000000140000000008001f 0x140009 0x1a0021 0x17))))) (.bin (.bin (.bin + (.bin (.leaf8 0x1d 0x103c3 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x4a447d00000000030000000001000000000200000000020000 + 0x10000000005000002085c000000000600000000010000) 0x1000000000800000eda82000000000900000000010000) + 0x8000000000100000000030000000001000000000000000000010000) + 0xb0000006811000000000c0000000001000000000200000000020000) + 0x1000000000e000002f883000000000f00000000010000) 0x1000000001100000014cd000000001200000000010000) + 0x11000000000100000000030000000001000000000000000000010000) + 0x140000005fc0000000001500000000010000000014000000001a001c) 0x14000f (h240 0x20000 + 0x10000000001000000000200000000190000000000001d) 0x130023 0x13000d + 0x1b00000000000000003857000000000500000000010020) (.leaf8 0x1b00000000000000000010000000000b001f + 0x100000000110023 0x1d00000000000000000428000000000600000000000020 + 0x1f00000000000000000019000000000e001f 0x180023 0x18000d + 0x2000000000000000001e6a000000000700000000010020 0x210000000000000000001b0000000010001f)) (.bin + (.leaf8 0x1a0023 0x1a000d 0x22000000000000000000d3000000000800000000010020 0x1d000e + 0x100000000050000000001000000001f0000000002001c 0x1f000f + 0x240000000000000000001f000000000f0000000001001e 0x1e0023) (.leaf8 0x1e000d + 0x2500000000000000000613000000000900000000010020 0x26000000000000000000200000000012001f + 0x100000000200023 0x2800000000000000000029000000000a00000000000020 + 0x2a000000000000000000230000000001001f (h240 0x10000 + 0x2400000000010000000000000000000100000000010000000003001c) 0x1000f))) (.bin (.bin (.leaf8 + 0x2b0000000000000000000100000000140000000001001e 0x100000000020023 + 0x2d00000000000000000136000000000b00000000000020 0x2f000000000000000000280000000018001f 0x270023 + 0x27000d 0x3000000000000000000006000000000c00000000010020 0x31000000000000000000290000000002001f) + (.leaf8 0x280023 0x28000d 0x310000000000000000002a000000001a001f 0x290023 0x29000d + 0x320000000000000000003c000000000d00000000010020 0x2c000e + 0x3300000000000000000007000000001a0000000000001e)) (.bin (.leaf8 0x100000000080023 + 0x3500000000000000000000000000000e00000000000020 0x360000000000000000002e0000000000001f 0x2d0023 + 0x2d000d 0x3600000000000000000002000000001d001f 0x100000000030023 + 0x380000000000000000000b000000000f00000000000020) (.leaf8 0x3a00000000000000000002000000001e001f + (h240 0x1000000000200000000020000 0x10000000005000000000100000000370000000004001c) 0x37000f + 0x3d0000000000000000003700000000200000000001001e 0x360023 0x36000d + 0x3e00000000000000000000000000001100000000010020 0x38000e)))) (.bin (.bin (.bin (.leaf8 (h240 + 0x200000000050000000001000000003c00000000010000 0x10000000001000000000100000000010000000005001c) + 0x1000f 0x430000000000000000000100000000240000000001001e 0x1000a 0x10008 (h240 0x3c0000 + 0x200000000000000000002000000000100000000000000000000001e) 0x30000000001000b 0x3c0013) (.leaf8 + 0x50008 0x10009 0x10021 0x3900000000030016 0x3800000000370016 0x30016 0x20014 0x20010)) (.bin + (.leaf8 0x10021 0x50000000031001a 0x3200000000310016 0x30014 0x340010 0x10021 0x1000000002d001a + 0x80014) (.leaf8 0x310010 0x10021 0x1f000000002b001a 0x2a00000000290016 0x30000000028001a + 0x2900000000280016 0x9b0000000025001a 0x240016))) (.bin (.bin (.leaf8 0x16 0x150000000022001a + 0x210016 0x200014 0x20010 0x10021 0x30a000000001f001a 0x5000000001e0016) (.leaf8 + 0x6a000000001c001a 0x1c000000001c0016 0xf350000000019001a 0x1a00000000190016 0x2140000000016001a + 0x150016 0x15000000000f0016 0x4c0c0000000013001a)) (.bin (.leaf8 0x120016 0x1100000000010016 + 0xa660000000010001a 0x1100000000100016 0xf0014 0x130010 0x10021 0x17c41000000000d001a) (.leaf8 + 0xc0016 0x20014 0x20010 0x10021 0x3408000000000a001a 0xb000000000a0016 0x30014 0xd0010)))))) (.bin + (.bin (.bin (.bin (.bin (.leaf8 0x10021 0x900000000060016 0x76d400000000007001a 0x800000000070016 + 0x60014 0xa0010 0x10021 0x1042d0000000004001a) (.leaf8 0x500000000040016 0x14 0x70010 0x10021 + 0x300000000000016 0x25223e0000000001001a 0x3001d + 0x1000000000100000000010000051527000000000000000000000020)) (.bin (.leaf8 0x50010 0x60021 0x17 + 0x1d 0x103c3 (h240 (h240 0x515280000 0x3000000000100000000020000000002000000000000000000010000) + 0x500000515270000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000500000000000000200d14000000000000000000010020)) + (.leaf8 0x5000e (h240 0x10000 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x90000000000000000000700000000000000000001001e 0x60023 0x6000d + 0xa0000000000000001042c000000000100000000010020 0x8000e))) (.bin (.bin (.leaf8 + 0xb0000000000000000000a00000000030000000000001e 0x90023 0x9000d + 0xc00000000000000076d3f000000000200000000010020 0xd0000000000000000000b0000000003001f (h240 + 0x1000000000c00000000010000 0x100000000050000000001000000000d0000000004001c) 0xd000f + 0xf0000000000000000000d00000000040000000001001e) (.leaf8 0xc0023 0xc000d + 0x1000000000000000003407000000000300000000010020 0x4000e + 0x120000000000000000000200000000060000000000001e 0x100000000030023 + 0x1400000000000000017c40000000000400000000000020 0x11000e)) (.bin (.leaf8 + 0x160000000000000000001300000000090000000000001e 0x120023 0x12000d + 0x1700000000000000000a65000000000500000000010020 0x18000000000000000000130000000000001f 0x120023 + 0x12000d 0x1900000000000000000002000000000b001f) (.leaf8 0x100000000030023 + 0x1b00000000000000004c0b000000000600000000000020 0x1d000000000000000000170000000009001f (h240 + 0x10000 0x1800000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1e00000000000000000001000000000c0000000001001e 0x100000000020023 + 0x2000000000000000000213000000000700000000000020)))) (.bin (.bin (.bin (.leaf8 + 0x220000000000000000001c0000000010001f 0x1b0023 0x1b000d + 0x2300000000000000000f34000000000800000000010020 0x240000000000000000001e0000000012001f 0x1d0023 + 0x1d000d 0x2500000000000000000069000000000900000000010020) (.leaf8 + 0x26000000000000000000070000000013001f 0x100000000080023 + 0x2800000000000000000309000000000a00000000000020 0x22000e + 0x2b0000000000000000000200000000140000000000001e 0x100000000030023 + 0x2d00000000000000000014000000000b00000000000020 0x2000e)) (.bin (.leaf8 + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x310000000000000000000100000000160000000001001e 0x100000000020023 + 0x330000000000000000009a000000000c00000000000020 0x350000000000000000002b000000001a001f 0x2a0023 + 0x2a000d) (.leaf8 0x3600000000000000000002000000000d00000000010020 + 0x370000000000000000002c000000001a001f 0x1000000002c0023 + 0x390000000000000000001e000000000e00000000000020 0xa000e + 0x3c00000000000000000031000000001c0000000000001e (h240 0x1000000003200000000010000 + 0x10000000005000000000100000000340000000004001c) 0x34000f))) (.bin (.bin (.leaf8 + 0x3f00000000000000000034000000001e0000000001001e 0x330023 0x33000d + 0x4000000000000000000004000000001000000000010020 0x4000e + 0x420000000000000000000200000000000000000000001e (h240 0x10000 + 0x300000000010000000000000000000100000000390000000003001c) 0x39000f) (.leaf8 + 0x440000000000000000003900000000230000000001001e 0x380023 0x38000d + 0x450000000000000000003b0000000001001f (h240 0x1000000003c00000000010000 + 0x10000000006000000000100000000010000000004001c) 0x1000f + 0x480000000000000000000100000000250000000001001e (h240 0x10000 + 0x200000000010000000000000000000100000000040000000003001c))) (.bin (.leaf8 0x20186 0x10043 0x40142 + 0x101c3 0x50023 0xe00c6 0x10043 0x10303) (.leaf8 0x10009 0x8 0x10009 0x10021 0x600000000000016 + 0x3c0014 0x8000e (h240 0x10000 0x10000000001000000000100000000010000000003001c)))))) (.bin (.bin + (.bin (.bin (.leaf8 0x1000f 0x40021 0x380016 0x500000000010016 0x20000000034001a + 0x3500000000340016 0x30016 0xb00000000300016) (.leaf8 0xf000000002e001a 0x2d0016 0x2c0014 0x20010 + 0x10021 0x1000000002b001a 0x2c000000002b0016 0x4d0000000028001a)) (.bin (.leaf8 0x270016 0x16 + 0x2700000000010016 0x90000000025001a 0x2600000000250016 0x30014 0x280010 0x10021) (.leaf8 + 0x2400000000210016 0x1840000000022001a 0x210016 0x2100000000060016 0x34000000001f001a + 0x1f000000001f0016 0x79a000000001c001a 0x1d000000001c0016))) (.bin (.bin (.leaf8 + 0x1090000000019001a 0x1a00000000190016 0x20014 + 0x18000000000400000000000000000002000000001c0000000000001f 0x1c0009 0x20021 0x26050000000016001a + 0x1700000000160016) (.leaf8 0x30014 0x190010 0x10021 0x1500000000120016 0x5320000000013001a + 0x1400000000130016 0xbe200000000010001a 0x1100000000100016)) (.bin (.leaf8 0x30014 0x130010 + 0x10021 0xf00000000030016 0x1a03000000000d001a 0xe000000000d0016 0x30016 0x3b6a0000000000a001a) + (.leaf8 0xb000000000a0016 0x82170000000007001a 0x200000000060016 0x60014 0x40010 0x10021 + 0x12911e0000000004001a 0x500000000040016)))) (.bin (.bin (.bin (.leaf8 0x14 0x70010 0x10021 + 0x300000000000016 0x28a930000000001001a 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f) (.leaf8 0x20023 0x2000d + 0x2000000000200000000010000028a92000000000000000000010020 0x5000e (h240 0x10000 + 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x200000000050000000001000000000700000000000000000001001e 0x60023)) (.bin (.leaf8 0x6000d + 0x200000000060000000001000012911d000000000100000000010020 0x8000e + 0x200000000070000000001000000000400000000020000000000001e 0x100000000050023 + 0x2000000000900000000010000008216000000000200000000000020 + 0x2000000000b0000000001000000000d0000000006001f 0xc0023) (.leaf8 0xc000d + 0x2000000000c0000000001000003b69f000000000300000000010020 + 0x2000000000d000000000100000000020000000001001f (h240 0x10000 + 0x3000000000100000000000000000001000000000f0000000003001c) 0xf000f + 0x2000000000f0000000001000000000f00000000070000000001001e 0xe0023 0xe000d))) (.bin (.bin (.leaf8 + 0x2000000001000000000010000001a02000000000400000000010020 + 0x20000000011000000000100000000110000000001001f (h240 0x1000000001200000000010000 + 0x10000000005000000000100000000130000000004001c) 0x13000f + 0x200000000130000000001000000001300000000080000000001001e 0x120023 0x12000d + 0x20000000014000000000100000077b1000000000500000000010020) (.leaf8 + 0x20000000015000000000100000000140000000002001f (h240 0x100000000000000 + 0x100000000160000000000000000001400000000070000000000001e) 0x130023 0x13000d + 0x170000000000000000466c000000000500000000010020 0x1700000000000000000016000000000c001f 0x150023 + 0x15000d)) (.bin (.leaf8 0x1800000000000000000531000000000600000000010020 + 0x1900000000000000000017000000000b001f (h240 0x1000000001800000000010000 + 0x10000000005000000000100000000190000000004001c) 0x19000f + 0x1b00000000000000000019000000000c0000000001001e 0x180023 0x18000d + 0x1c00000000000000002604000000000700000000010020) (.leaf8 0x1a000e + 0x100000000050000000001000000001c0000000002001c 0x1c000f + 0x1e0000000000000000001c000000000d0000000001001e 0x1b0023 0x1b000d + 0x1f00000000000000000108000000000800000000010020 0x200000000000000000001f0000000012001f))))))) + (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x1e0023 0x1e000d + 0x2100000000000000000799000000000900000000010020 0x22000000000000000000210000000014001f 0x200023 + 0x20000d 0x2300000000000000000033000000000a00000000010020 0x24000000000000000000230000000003001f) + (.leaf8 (h240 0x10000 0x2400000000010000000000000000000100000000010000000003001c) 0x1000f + 0x250000000000000000000100000000140000000001001e 0x100000000020023 + 0x2700000000000000000183000000000b00000000000020 0x29000000000000000000260000000015001f (h240 + 0x1000000002700000000010000 0x10000000005000000000100000000280000000004001c) 0x28000f)) (.bin + (.leaf8 0x2b0000000000000000002800000000160000000001001e 0x270023 0x27000d + 0x2c00000000000000000008000000000c00000000010020 0x2d000000000000000000290000000000001f 0x280023 + 0x28000d 0x2000e) (.leaf8 0x10000000000000000000100000000010000000002001c 0x1000f + 0x2f0000000000000000000100000000180000000001001e 0x100000000020023 + 0x310000000000000000004c000000000d00000000000020 0x330000000000000000002e000000001c001f 0x2d0023 + 0x2d000d))) (.bin (.bin (.leaf8 0x3400000000000000000000000000000e00000000010020 0x2e000e + 0x3600000000000000000002000000001c0000000000001e 0x100000000030023 + 0x380000000000000000000e000000000f00000000000020 0x3a0000000000000000000d000000001f001f (h240 + 0x10000 0xe00000000010000000000000000000100000000010000000003001c) 0x1000f) (.leaf8 + 0x3c0000000000000000000100000000000000000001001e (h240 0x10000 + 0x200000000010000000000000000000100000000360000000003001c) 0x36000f + 0x3e0000000000000000003600000000210000000001001e 0x350023 0x35000d + 0x3f00000000000000000001000000001100000000010020 0x40000000000000000000070000000000001f)) (.bin + (.leaf8 0x60023 0x6000d 0x41000000000000000000020000000024001f (h240 (h240 + 0x1000000000200000000020000 0x1000000003e0000000001000000000900000000010000) + 0x10000000001000000000100000000010000000007001c) 0x1000f 0x470000000000001d 0x10000000001000b + 0x90014) (.leaf8 0x2000e 0x20186 0x10043 0x30142 0x101c3 0x40023 0xc00c6 0x10043)))) (.bin (.bin + (.bin (.leaf8 0x10303 0x10009 0xb0008 0x10009 0x10021 0x3e00000000010019 0x430000000000001d + 0x3c0023) (.leaf8 (h240 0x20000 0x1000000000c000000000100000000010000000003009c) 0x1000f (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 0xcb49f0000 0x1000000000200005cd5a8000000000300000000010000) + 0x40000028a9400000000060000000001000000000000000000010000) + 0x200000000010000000008000012911f000000000900000000010000) + 0x5000000000100000000000000000001000000000b00000082160000) + 0xc0000000001000000000e000003b6a0000000000f00000000010000) + 0x300000000010000000000000000000100000000100000001a040000) + 0x12000000000100000000000000000001000000000500000000010000) + 0x14000000be2000000000150000000001000000001700000005330000) + 0x18000000000100000000000000000001000000000500000000010000) + 0x1a0000002606000000001b0000000001000000000500000000010000) + 0x1d0000000109000000001e00000000010000000020000000079a0000) + 0x21000000000100000000220000000035000000002400000000010000) + 0x100000000020000000001000000000000000000010000) + 0x26000000018400000000270000000001000000000000000000010000) + 0x500000000010000000029000000000a000000002a00000000010000) + 0x3000000000100000000000000000001000000000200000000010000) + 0x1000000002c000000004c000000002d00000000010000) + 0x2f000000000100000000300000000001000000002f00000000010000) + 0x30000000001000000000000000000010000000032000000000e0000) + 0x330000000001000000000e0000000001000000000000000000010000) + 0x2000000000100000000000000000001000000003700000000020000) + 0x39000000000100000000080000000001000000000200000000020000) + 0x1000000003d000000004400000000020000000000001d) 0x1000a 0xc0008 + 0xd00000000000000000001000000000100000000000000000000001e 0xe0000000001000b 0x13)) (.bin (.leaf8 + 0x3d0008 (h240 0x10000 0x2000000000100000000000000000001000000000f0000000003001c) 0x20186 0x10043 + 0xf0142 0x101c3 0x100023 0x2400c6) (.leaf8 0x10043 0x10303 0x10009 0x8 0x10009 0x10021 + 0x3e00000000000016 0x10019))) (.bin (.bin (.leaf8 0x430000000000001d 0xf 0x420000000000001d + 0x103c3 (h240 0x1000000004100000000010000 0x10000000001000000000100000000010000000004001c) 0x1000f + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 0xcb4a500000000000000 + 0x1000000000200005cd5a80000000003000000000100000000040000) + 0x28a94000000000600000000010000000000000000000100000000020000) + 0x10000000008000012911f0000000009000000000100000000050000) + 0x100000000000000000001000000000b0000008216000000000c0000) + 0x1000000000e000003b6a0000000000f000000000100000000030000) + 0x10000000000000000000100000000100000001a0400000000120000) + 0x1000000000000000000010000000005000000000100000000140000) + 0xbe20000000001500000000010000000017000000053300000000180000) + 0x10000000000000000000100000000050000000001000000001a0000) + 0x2606000000001b000000000100000000050000000001000000001d0000) + 0x109000000001e00000000010000000020000000079a00000000210000) + 0x1000000002200000000350000000024000000000100000000000000) + 0x1000000000200000000010000000000000000000100000000260000) + 0x184000000002700000000010000000000000000000100000000050000) + 0x10000000029000000000a000000002a000000000100000000030000) + 0x1000000000000000000010000000002000000000100000000000000) + 0x1000000002c000000004c000000002d0000000001000000002f0000) + 0x100000000300000000001000000002f000000000100000000030000) + 0x1000000000000000000010000000032000000000e00000000330000) + 0x1000000000e00000000010000000000000000000100000000020000) + 0x1000000000000000000010000000037000000000200000000390000) + 0x1000000000800000000010000000002000000000100000000010000) + 0x4300000000030000000000000000000100000000070000000001001e) 0x1000a) (.leaf8 0x10008 (h240 + 0x410000 0x200000000000000000002000000000100000000000000000000001e) 0x30000000001000b 0x410013 + 0x10008 0x10009 0x10021 0x800000000000016)) (.bin (.leaf8 0x10000000037001a 0x350016 0x16 + 0x33000000000c0016 0x60000000031001a 0x3200000000310016 0x30014 0x340010) (.leaf8 0x10021 + 0x30000000002d0016 0x2d000000002d0016 0x25000000002b001a 0x2c000000002b0016 0x20014 + 0x3000000000400000000000000000002000000002e0000000000001f 0x2e0009))))) (.bin (.bin (.bin (.bin + (.leaf8 0x10021 0x50000000028001a 0x500000000270016 0x270014 0x70010 0x10021 0xc10000000025001a + 0x2600000000250016) (.leaf8 0x20014 0x2400000000040000000000000000000200000000280000000000001f + 0x280009 0x20021 0x1a0000000022001a 0x2100000000200016 0x3cc000000001f001a 0x20000000001f0016)) + (.bin (.leaf8 0x84000000001c001a 0x1d000000001c0016 0x1b00000000030016 0x13020000000019001a + 0x1a00000000190016 0x30016 0x2990000000016001a 0x1700000000160016) (.leaf8 0x5f100000000013001a + 0x500000000120016 0x120014 0x70010 0x10021 0xd010000000010001a 0x1000000000100016 0x30014))) (.bin + (.bin (.leaf8 0x120010 0x10021 0x1db50000000000d001a 0xc000000000c0016 0x410a000000000a001a + 0xb000000000a0016 0x50014 0xd0010) (.leaf8 0x10021 0x9488f0000000007001a 0x800000000070016 0x16 + 0x1454a0000000004001a 0x300000000020016 0x2e6ad30000000001001a 0x200000000010016)) (.bin (.leaf8 + 0x14 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x2000000000200000000010000065a58000000000000000000010020 0x50010 0x40021 0x17) (.leaf8 0x1d + 0x103c3 (h240 0x65a5b000000000300000000010000 + 0x50000065a590000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000300000000000000281078000000000000000000010020) + 0x5000000000000000000050000000000001f 0x100000000050023 + 0x700000000000000014549000000000100000000000020)))) (.bin (.bin (.bin (.leaf8 0x2000e + 0x10000000000000000000100000000090000000002001c 0x9000f + 0xb0000000000000000000900000000030000000001001e 0x80023 0x8000d + 0xc0000000000000009488e000000000200000000010020 0x7000e) (.leaf8 + 0xe0000000000000000000d00000000050000000000001e 0xc0023 0xc000d + 0xf00000000000000004109000000000300000000010020 0x100000000000000000000e0000000007001f + 0x1000000000f0023 0x110000000000000001db4f000000000400000000000020 0x5000e)) (.bin (.leaf8 + 0x140000000000000000001200000000090000000000001e 0x110023 0x11000d + 0x1500000000000000000d00000000000500000000010020 0x14000e + 0x1600000000000000000007000000000a0000000000001e 0x100000000080023 + 0x1800000000000000005f0f000000000600000000000020) (.leaf8 0x1a00000000000000000019000000000e001f + 0x180023 0x18000d 0x1b00000000000000000298000000000700000000010020 + 0x1c000000000000000000020000000001001f (h240 0x10000 + 0x3000000000100000000000000000001000000001b0000000003001c) 0x1b000f + 0x1e0000000000000000001b000000000f0000000001001e))) (.bin (.bin (.leaf8 0x1a0023 0x1a000d + 0x1f00000000000000001301000000000800000000010020 0x200000000000000000001d0000000001001f (h240 + 0x10000 0x1e000000000100000000000000000001000000001e0000000003001c) 0x1e000f + 0x210000000000000000001e00000000110000000001001e 0x1d0023) (.leaf8 0x1d000d + 0x2200000000000000000083000000000900000000010020 0x23000000000000000000220000000014001f 0x210023 + 0x21000d 0x24000000000000000003cb000000000a00000000010020 0x25000000000000000000230000000014001f + 0x100000000230023)) (.bin (.leaf8 0x2700000000000000000019000000000b00000000000020 0x26000e + 0x10000000005000000000100000000280000000002001c 0x28000f + 0x2a0000000000000000002800000000150000000001001e 0x270023 0x27000d + 0x2b000000000000000000c0000000000c00000000010020) (.leaf8 0x29000e + 0x2c0000000000000000000700000000180000000000001e 0x100000000080023 + 0x2e00000000000000000004000000000d00000000000020 0x5000e + 0x100000000050000000001000000002e0000000002001c 0x2e000f + 0x320000000000000000002e00000000190000000001001e)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x2d0023 0x2d000d 0x3300000000000000000024000000000e00000000010020 + 0x340000000000000000002f000000001d001f (h240 0x10000 + 0x3000000000010000000000000000000100000000310000000003001c) 0x31000f + 0x3500000000000000000031000000001c0000000001001e (h240 0x1000000003200000000010000 + 0x10000000005000000000100000000340000000004001c)) (.leaf8 0x34000f + 0x3800000000000000000034000000001e0000000001001e 0x330023 0x33000d + 0x3900000000000000000005000000001000000000010020 0x3a000000000000000000350000000007001f (h240 + 0x100000000360000000001000000000000000000010000 + 0x200000000010000000000000000000100000000010000000005001c) 0x1000f)) (.bin (.leaf8 + 0x3d0000000000000000000100000000210000000001001e 0x100000000010023 + 0x3f00000000000000000000000000001200000000000020 0xa000e (h240 0x10000 + 0x10000000002000000000100000000010000000003001c) 0x1000f + 0x430000000000000000000100000000280000000001001e (h240 0x10000 + 0x100000000020000000000000000000100000000040000000003001c)) (.leaf8 0x20186 0x10043 0x40142 + 0x101c3 0x50023 0xe00c6 0x10043 0x10303))) (.bin (.bin (.leaf8 0x10009 0x8 (h240 0x10000 + 0x100000000000000000002000000000100000000000000000000001e) 0x10009 0x20021 0x16 0x3b00000000090016 + 0x14) (.leaf8 0x10000000003000000003d0000000000001f 0x3d0009 0x30021 0x16 0x30000000034001a + 0x3500000000340016 0x30016 0x300016)) (.bin (.leaf8 0x13000000002e001a 0x5000000002d0016 + 0x2d00000000040016 0x1000000002b001a 0x2c000000002b0016 0x80014 0x2e0010 0x10021) (.leaf8 + 0x610000000028001a 0x500000000270016 0xd0000000025001a 0x240016 0x230014 0x20010 0x10021 + 0x1e60000000022001a)))) (.bin (.bin (.bin (.leaf8 0x2100000000210016 0x41000000001f001a + 0x1f000000001f0016 0x1e0014 0x210010 0x10021 0x981000000001c001a 0x1a0016) (.leaf8 + 0x1b00000000010016 0x14c0000000019001a 0x1800000000180016 0x2f870000000016001a 0x150016 + 0x1500000000060016 0x6800000000013001a 0x1300000000130016)) (.bin (.leaf8 0x1200000000040016 + 0xeda70000000010001a 0xf0016 0x2085000000000d001a 0xe000000000d0016 0xc00000000060016 + 0x4a447000000000a001a 0x80016) (.leaf8 0x900000000010016 0xa2a40000000007001a 0x60016 0x50014 + 0x20010 0x10021 0x1735690000000004001a 0x500000000040016))) (.bin (.bin (.leaf8 + 0x32d2d0000000001001a 0x100000000010016 0x14 0x20000000000000000000100000000030000000000001f + 0x20023 0x2000d 0x2000000000200000000010000032d2c000000000000000000010020 + 0x20000000003000000000100000000070000000002001f) (.leaf8 0x60023 0x6000d + 0x2000000000400000000010000173568000000000100000000010020 0x7000e + 0x200000000060000000001000000000200000000020000000000001e 0x100000000030023 + 0x200000000080000000001000000a2a3000000000200000000000020 + 0x2000000000a0000000001000000000b0000000000001f)) (.bin (.leaf8 0xa0023 0xa000d + 0x2000000000a000000000100000000020000000004001f 0x100000000020023 + 0x2000000000c0000000001000004a446000000000300000000000020 + 0x2000000000e0000000001000000000e0000000003001f (h240 0x10000 + 0xf000000000100000000000000000001000000000f0000000003001c) 0xf000f) (.leaf8 + 0x2000000000f0000000001000000000f00000000070000000001001e 0xe0023 0xe000d + 0x2000000001000000000010000002084000000000400000000010020 + 0x20000000011000000000100000000020000000009001f 0x100000000030023 + 0x200000000130000000001000000959a000000000500000000000020 + 0x20000000015000000000100000000140000000004001f))))) (.bin (.bin (.bin (.bin (.leaf8 (h240 + 0x100000000000000 0x100000000160000000000000000001400000000050000000000001e) 0x130023 0x13000d + 0x170000000000000000580a000000000500000000010020 0x17000000000000000000140000000002001f 0x130023 + 0x13000d 0x1700000000000000000015000000000c001f) (.leaf8 0x140023 0x14000d + 0x180000000000000000067f000000000600000000010020 0x19000000000000000000170000000003001f (h240 + 0x10000 0x1800000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1a00000000000000000001000000000c0000000001001e 0x100000000020023)) (.bin (.leaf8 + 0x1c00000000000000002f86000000000700000000000020 0x1e0000000000000000001a000000000f001f + 0x1000000001b0023 0x1f0000000000000000014b000000000800000000000020 + 0x210000000000000000001d0000000000001f 0x1c0023 0x1c000d 0x21000000000000000000020000000010001f) + (.leaf8 0x100000000020023 0x2300000000000000000980000000000900000000000020 0x20000e + 0x250000000000000000002100000000130000000000001e 0x200023 0x20000d + 0x2600000000000000000040000000000a00000000010020 0x27000000000000000000230000000015001f))) (.bin + (.bin (.leaf8 0x100000000240023 0x28000000000000000001e5000000000b00000000000020 0x25000e + 0x2b0000000000000000000200000000160000000000001e 0x100000000030023 + 0x2d0000000000000000000c000000000c00000000000020 0x2f000000000000000000070000000019001f + 0x100000000080023) (.leaf8 0x3100000000000000000060000000000d00000000000020 0xa000e + 0x340000000000000000002e000000001b0000000000001e 0x2d0023 0x2d000d + 0x3500000000000000000000000000000e00000000010020 0x360000000000000000002f0000000002001f 0x2e0023)) + (.bin (.leaf8 0x2e000d 0x3600000000000000000007000000001d001f 0x100000000080023 + 0x3800000000000000000012000000000f00000000000020 0x3a00000000000000000002000000001f001f (h240 + 0x10000 0x300000000010000000000000000000100000000010000000003001c) 0x1000f + 0x3c0000000000000000000100000000000000000001001e) (.leaf8 (h240 0x10000 + 0x200000000010000000000000000000100000000360000000003001c) 0x36000f + 0x3e0000000000000000003600000000210000000001001e 0x350023 0x35000d + 0x3f00000000000000000002000000001100000000010020 0x2000e (h240 + 0x100000000000000000001000000000100000000020000 + 0x100000000020000000001000000003d0000000005001c))))) (.bin (.bin (.bin (.leaf8 0x3d000f + 0x450000000000000000003d00000000020000000001001e (h240 (h240 0x1000000003e00000000010000 + 0x100000000020000000001000000000000000000010000) + 0x300000000010000000002000000000100000000010000000007001c) 0x1000f 0x4b0000000000001d + 0x20000000001000b 0x10016 0x16) (.leaf8 0x2000000003c0016 0x14 + 0x1000000000300000000040000000000001f 0x40009 0x30021 0x3900000000010016 0x10000000037001a + 0x350016)) (.bin (.leaf8 0x16 0x3300000000010016 0x80000000031001a 0x3200000000310016 0x80014 + 0x340010 0x10021 0x1000000002e001a) (.leaf8 0xb000000002d0016 0x30000000002b001a 0x2a0016 + 0x2a00000000060016 0x50000000028001a 0x2900000000280016 0x30014 0x2b0010))) (.bin (.bin (.leaf8 + 0x10021 0x2700000000240016 0xf20000000025001a 0x240016 0x210000000022001a 0x2100000000200016 + 0x4c0000000001f001a 0x1e0016) (.leaf8 0x20014 0x20010 0x10021 0xa6000000001c001a 0x1b0016 + 0x17c30000000019001a 0x1a00000000190016 0x20014)) (.bin (.leaf8 + 0x18000000000400000000000000000002000000001c0000000000001f 0x1c0009 0x20021 0x3400000000016001a + 0x1500000000140016 0x76d30000000013001a 0x120016 0x1200000000010016) (.leaf8 0x10420000000010001a + 0xe0016 0x25223000000000d001a 0xe000000000d0016 0x14 0x100010 0x10021 0xc00000000000016)))))))) + (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x5151000000000a001a 0xb000000000a0016 0x30014 + 0xd0010 0x10021 0x900000000060016 0xb9ab40000000007001a 0x600000000060016) (.leaf8 + 0x196960000000004001a 0x300000000020016 0x3a05850000000001001a 0x200000000010016 0x14 + 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d)) (.bin (.leaf8 + 0x200000000020000000001000007f0fc000000000000000000010020 0x50010 0x40021 0x17 0x1d 0x103c3 (h240 + 0x7f0ff000000000300000000010000 0x5000007f0fd0000000006000000000100000000040000000004001c) + 0x4000d) (.leaf8 (h240 0x20000000000000000000100000000010000 + 0x2000000000300000000000000321486000000000000000000010020) 0x5000000000000000000050000000000001f + 0x100000000050023 0x700000000000000019695000000000100000000000020 + 0x9000000000000000000080000000003001f 0x100000000090023 + 0xa000000000000000b9ab3000000000200000000000020 0xc0000000000000000000b0000000003001f))) (.bin + (.bin (.leaf8 (h240 0x1000000000c00000000010000 0x100000000050000000001000000000d0000000004001c) + 0xd000f 0xe0000000000000000000d00000000040000000001001e 0xc0023 0xc000d + 0xf00000000000000005150000000000300000000010020 0xe000e (h240 0x10000 + 0x10000000002000000000100000000100000000003001c)) (.leaf8 0x10000f + 0x120000000000000000001000000000060000000001001e 0xf0023 0xf000d + 0x1300000000000000025222000000000400000000010020 0x14000000000000000000020000000008001f + 0x100000000020023 0x1600000000000000001041000000000500000000000020)) (.bin (.leaf8 + 0x18000000000000000000140000000000001f 0x130023 0x13000d 0x1800000000000000000002000000000b001f + 0x100000000030023 0x1a000000000000000076d2000000000600000000000020 + 0x1c00000000000000000017000000000c001f 0x100000000170023) (.leaf8 + 0x1e0000000000000000033f000000000700000000000020 0x1a000e + 0x100000000050000000001000000001c0000000002001c 0x1c000f + 0x210000000000000000001c000000000d0000000001001e 0x1b0023 0x1b000d + 0x22000000000000000017c2000000000800000000010020)))) (.bin (.bin (.bin (.leaf8 + 0x23000000000000000000020000000011001f 0x100000000030023 + 0x25000000000000000000a5000000000900000000000020 0x4000e + 0x280000000000000000000200000000120000000000001e 0x100000000030023 + 0x2a000000000000000004bf000000000a00000000000020 0x2c000000000000000000230000000014001f) (.leaf8 + 0x100000000230023 0x2e00000000000000000020000000000b00000000000020 + 0x30000000000000000000020000000017001f 0x100000000030023 + 0x32000000000000000000f1000000000c00000000000020 0x34000000000000000000290000000017001f (h240 + 0x1000000002a00000000010000 0x100000000050000000001000000002b0000000004001c) 0x2b000f)) (.bin + (.leaf8 0x360000000000000000002b00000000180000000001001e 0x2a0023 0x2a000d + 0x3700000000000000000004000000000d00000000010020 0x380000000000000000002c0000000003001f (h240 + 0x10000 0x2d00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x3900000000000000000001000000001a0000000001001e) (.leaf8 0x100000000020023 + 0x3b0000000000000000002f000000000e00000000000020 0x3d0000000000000000000d000000001d001f + 0x1000000000e0023 0x3f00000000000000000000000000000f00000000000020 0xa000e + 0x4100000000000000000034000000001f0000000000001e 0x330023))) (.bin (.bin (.leaf8 0x33000d + 0x4200000000000000000007000000001000000000010020 0x43000000000000000000350000000000001f 0x340023 + 0x34000d 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f) (.leaf8 + 0x450000000000000000000100000000210000000001001e 0x100000000010023 + 0x4700000000000000000000000000001200000000000020 0x480000000000000000003b0000000000001f 0x3a0023 + 0x3a000d 0x1000e (h240 0x20000 0x10000000002000000000100000000040000000003001c))) (.bin (.leaf8 + 0x4000f 0x4c0000000000000000000400000000240000000001001e (h240 + 0x100000000050000000001000000000000000000010000 + 0x200000000010000000000000000000100000000010000000005001c) 0x1000f 0x500000000000001d 0x23 0xd + 0x3000e) (.leaf8 0x20186 0x10043 0x40142 0x101c3 0x50023 0xe00c6 0x10043 0x10303))))) (.bin (.bin + (.bin (.bin (.leaf8 0x10009 0x20008 (h240 0x20000 + 0x300000000000000000002000000000100000000000000000000001e) (h240 + 0x10000000004000000000100000000050000 0x400000000000000000002000000000100000000000000000000001e) + 0x10009 0x30021 0x16 0x20014) (.leaf8 0x2000e (h240 + 0x100000000000000000001000000000700000000010000 + 0x500000000010000000004000000000100000000010000000005001c) 0x600c6 0x10043 0x40142 0x101c3 0x50009 + 0x700000000030016)) (.bin (.leaf8 0x30014 0x90010 0x10021 0x20013 0x3c0008 0x10009 0x10021 + 0x390016) (.leaf8 0x10014 0x300000000030000000000000000000200000000020000000000001f 0x20009 + 0x20021 0x40000000034001a 0x3500000000340016 0x3200000000090016 0xe0014))) (.bin (.bin (.leaf8 + 0x340010 0x10021 0x17000000002e001a 0x2f000000002e0016 0x20014 + 0x2d00000000040000000000000000000200000000310000000000001f 0x310009 0x20021) (.leaf8 + 0x2000000002b001a 0x2c000000002b0016 0x30016 0x790000000028001a 0x270016 0x2700000000010016 + 0xf0000000025001a 0x2600000000250016)) (.bin (.leaf8 0x14 0x280010 0x10021 0x2400000000210016 + 0x25f0000000022001a 0x210016 0x500000000010016 0x52000000001f001a) (.leaf8 0x20000000001f0016 + 0x30014 0x220010 0x10021 0xbe1000000001c001a 0x1d000000001c0016 0x1b00000000030016 + 0x19f0000000019001a)))) (.bin (.bin (.bin (.leaf8 0x1a00000000190016 0x14 0x1c0010 0x10021 + 0x1800000000150016 0x3b680000000016001a 0x1700000000160016 0x30014) (.leaf8 0x190010 0x10021 + 0x8210000000013001a 0x120016 0x20014 0x20010 0x10021 0x129110000000010001a)) (.bin (.leaf8 + 0x1100000000100016 0x16 0x28a9000000000d001a 0x5000000000c0016 0xc0014 0x70010 0x10021 + 0x5cd59000000000a001a) (.leaf8 0xb000000000a0016 0x90014 0xd0010 0x10021 0xcb4a0000000007001a + 0x800000000070016 0x14 0xa0010))) (.bin (.bin (.leaf8 0x10021 0x600000000030016 + 0x1d02c20000000004001a 0x300000000030016 0x3f87f0000000001001a 0x3001d + 0x100000000010000000001000003f87e000000000000000000000020 + 0x20000000005000000000100000000050000000001001f) (.leaf8 0x100000000060023 + 0x20000000006000000000100001d02c1000000000100000000000020 + 0x20000000008000000000100000000080000000001001f (h240 0x1000000000900000000010000 + 0x100000000020000000001000000000a0000000004001c) 0xa000f + 0x2000000000a0000000001000000000a00000000020000000001001e 0x90023 0x9000d)) (.bin (.leaf8 + 0x2000000000b0000000001000000cb49000000000200000000010020 0xb000e + 0x2000000000c0000000001000000000d00000000050000000000001e 0xc0023 0xc000d + 0x2000000000d0000000001000005cd58000000000300000000010020 0xe000e + 0x2000000000e0000000001000000000700000000060000000000001e) (.leaf8 0x100000000080023 + 0x20000000010000000000100000028a8000000000400000000000020 0x2000e + 0x10000000000000000000100000000120000000002001c 0x12000f + 0x200000000140000000001000000001200000000090000000001001e 0x110023 0x11000d)))))) (.bin (.bin + (.bin (.bin (.bin (.leaf8 0x200000000150000000001000000bb03000000000500000000010020 + 0x20000000016000000000100000000140000000000001f 0x140009 0x170021 0x17 0x1d 0x103c3 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 0x910de400000000030000000001000000000200000000020000 + 0x10000000005000003f87f000000000600000000010000) 0x1000000000800001d02c2000000000900000000010000) + 0x100000000020000000001000000000b000000cb4b0000) + 0xc0000000001000000000e000005cd5a000000000f00000000010000) + 0x8000000000100000000000000000001000000001100000028a80000) + 0x12000000000100000000030000000001000000000000000000010000) + 0x13000000bb040000000015000000000100000000140000000017001c)) (.leaf8 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000160000000000000000001400000000070000000001001e) + 0x130023 0x13000d 0x1800000000000000006e0b000000000500000000010020 0x4000e + 0x1900000000000000000002000000000a0000000000001e 0x100000000030023)) (.bin (.leaf8 + 0x1b00000000000000000820000000000600000000000020 0x5000e + 0x1e00000000000000000019000000000d0000000000001e 0x180023 0x18000d + 0x1f00000000000000003b67000000000700000000010020 0x200000000000000000001a000000000d001f (h240 + 0x1000000001b00000000010000 0x100000000020000000001000000001c0000000004001c)) (.leaf8 0x1c000f + 0x220000000000000000001c000000000e0000000001001e 0x1b0023 0x1b000d + 0x230000000000000000019e000000000800000000010020 0x240000000000000000001d0000000001001f (h240 + 0x10000 0x1e000000000100000000000000000001000000001e0000000003001c) 0x1e000f))) (.bin (.bin + (.leaf8 0x250000000000000000001e00000000110000000001001e 0x1d0023 0x1d000d + 0x2600000000000000000be0000000000900000000010020 0x5000e + 0x280000000000000000002200000000130000000000001e 0x210023 0x21000d) (.leaf8 + 0x2900000000000000000051000000000a00000000010020 0x2a000000000000000000070000000000001f 0x60023 + 0x6000d 0x2b000000000000000000020000000015001f 0x100000000030023 + 0x2d0000000000000000025e000000000b00000000000020 0x2f000000000000000000260000000015001f)) (.bin + (.leaf8 (h240 0x1000000002700000000010000 0x10000000002000000000100000000280000000004001c) + 0x28000f 0x310000000000000000002800000000160000000001001e 0x270023 0x27000d + 0x320000000000000000000e000000000c00000000010020 0x33000000000000000000290000000000001f 0x280023) + (.leaf8 0x28000d 0x33000000000000000000020000000019001f 0x100000000030023 + 0x3500000000000000000078000000000d00000000000020 0x37000000000000000000020000000001001f (h240 + 0x10000 0x3000000000100000000000000000001000000002d0000000003001c) 0x2d000f + 0x390000000000000000002d000000001b0000000001001e)))) (.bin (.bin (.bin (.leaf8 0x2c0023 0x2c000d + 0x3a00000000000000000001000000000e00000000010020 0x2f000e + 0x10000000005000000000100000000310000000002001c 0x31000f + 0x3c00000000000000000031000000001b0000000001001e 0x300023) (.leaf8 0x30000d + 0x3d00000000000000000016000000000f00000000010020 0x10000e + 0x3f0000000000000000003400000000040000000000001e (h240 0x10000 + 0x3500000000010000000000000000000100000000360000000003001c) 0x36000f + 0x410000000000000000003600000000210000000001001e 0x350023)) (.bin (.leaf8 0x35000d + 0x4200000000000000000003000000001100000000010020 0x5000e + 0x10000000004000000000100000000020000000002001c 0x2000f + 0x450000000000000000000200000000220000000001001e (h240 (h240 0x1000000000300000000010000 + 0x1000000003d0000000001000000000100000000020000) 0x10000000005000000000100000000090000000007001c) + 0x9000f) (.leaf8 0x4b0000000000001d (h240 0x10000 + 0xa00000000010000000000000000000100000000050000000003001c) 0x20186 0x10043 0x50142 0x101c3 0x60023 + 0x1000c6))) (.bin (.bin (.leaf8 0x10043 0x10303 0x10009 0x8 0x10009 0x10021 0x500000000080016 + 0x14) (.leaf8 0x3d0000000001000000000300000000070000000000001f (h240 0x30000 + 0x3e00000000020000000002000000000700000000000000000000001e) 0x70009 0x40021 0x600000000020016 + 0x20000000037001a 0x350016 0x1100000000330016)) (.bin (.leaf8 0xb0000000031001a 0x3200000000310016 + 0x3000000000030016 0x1000000002e001a 0x2c0016 0x2d00000000010016 0x3b000000002b001a + 0x2c000000002b0016) (.leaf8 0x30014 0x2e0010 0x10021 0x80000000028001a 0x200000000270016 0x270014 + 0x40010 0x10021))))) (.bin (.bin (.bin (.bin (.leaf8 0x12f0000000025001a 0x240016 + 0x800000000010016 0x290000000022001a 0x600000000210016 0x5f0000000001f001a 0x1f000000001f0016 + 0x1e0014) (.leaf8 0x210010 0x10021 0xcf000000001c001a 0x1d000000001c0016 0x16 0x1db40000000019001a + 0x1a00000000190016 0x1800000000040016)) (.bin (.leaf8 0x40f0000000016001a 0x1700000000160016 + 0x30014 0x190010 0x10021 0x1500000000030016 0x94880000000013001a 0x110016) (.leaf8 + 0x1200000000010016 0x14530000000010001a 0x1100000000100016 0x80014 0x130010 0x10021 + 0x2e6ad000000000d001a 0xc000000000c0016))) (.bin (.bin (.leaf8 0x65a5000000000a001a + 0x200000000090016 0x90014 0x40010 0x10021 0xe81600000000007001a 0x800000000070016 0x60014) (.leaf8 + 0xa0010 0x10021 0x1fc3f0000000004001a 0x30016 0x20014 0x20010 0x10021 0x4886f20000000001001a)) + (.bin (.leaf8 0x3001d 0x100000000010000000001000009ece8000000000000000000000020 0x50010 0x60021 + 0x17 0x1d 0x103c3 (h240 (h240 0x9ece90000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x5000009ece80000000006000000000100000000040000000006001c)) (.leaf8 0x4000d (h240 + 0x20000000000000000000100000000010000 0x20000000005000000000000003e9a07000000000000000000010020) + 0x4000e 0x80000000000000000000200000000000000000000001e 0x100000000030023 + 0xa0000000000000001fc3e000000000100000000000020 0x8000e + 0xc0000000000000000000a00000000030000000000001e)))) (.bin (.bin (.bin (.leaf8 0x90023 0x9000d + 0xd000000000000000e815f000000000200000000010020 0xb000e + 0xe0000000000000000000400000000040000000000001e 0x100000000050023 + 0x10000000000000000065a4000000000300000000000020 0x120000000000000000000e0000000007001f) (.leaf8 + 0x1000000000f0023 0x130000000000000002e6ac000000000400000000000020 0xa000e + 0x160000000000000000001300000000090000000000001e 0x120023 0x12000d + 0x1700000000000000001452000000000500000000010020 0x18000000000000000000140000000000001f)) (.bin + (.leaf8 0x130023 0x13000d 0x1800000000000000000002000000000a001f 0x100000000020023 + 0x1a00000000000000009487000000000600000000000020 0x1c000000000000000000170000000001001f (h240 + 0x1000000001800000000010000 0x10000000005000000000100000000190000000004001c) 0x19000f) (.leaf8 + 0x1e00000000000000000019000000000c0000000001001e 0x180023 0x18000d + 0x1f0000000000000000040e000000000700000000010020 0x200000000000000000001a0000000002001f 0x190023 + 0x19000d 0x200000000000000000001c0000000010001f))) (.bin (.bin (.leaf8 0x1b0023 0x1b000d + 0x2100000000000000001db3000000000800000000010020 0x2000e + 0x100000000000000000001000000001e0000000002001c 0x1e000f + 0x240000000000000000001e00000000110000000001001e 0x1d0023) (.leaf8 0x1d000d + 0x25000000000000000000ce000000000900000000010020 0x20000e + 0x260000000000000000002100000000130000000000001e 0x200023 0x20000d + 0x27000000000000000005ef000000000a00000000010020 0x28000000000000000000080000000015001f)) (.bin + (.leaf8 0x100000000090023 0x2a00000000000000000028000000000b00000000000020 + 0x2c0000000000000000000a0000000000001f 0x90023 0x9000d 0x2d000000000000000000020000000017001f + 0x100000000030023 0x2f0000000000000000012e000000000c00000000000020) (.leaf8 0x29000e + 0x310000000000000000000400000000180000000000001e 0x100000000050023 + 0x3300000000000000000007000000000d00000000000020 0x5000e + 0x360000000000000000002e000000001b0000000000001e 0x2d0023 0x2d000d))))))) (.bin (.bin (.bin (.bin + (.bin (.bin (.leaf8 0x370000000000000000003a000000000e00000000010020 + 0x380000000000000000002f0000000000001f 0x2e0023 0x2e000d 0x3800000000000000000002000000001c001f + 0x100000000020023 0x3a00000000000000000000000000000f00000000000020 + 0x3b000000000000000000320000000001001f) (.leaf8 (h240 0x10000 + 0x3300000000010000000000000000000100000000330000000003001c) 0x33000f + 0x3d00000000000000000033000000001f0000000001001e 0x320023 0x32000d + 0x3e0000000000000000000a000000001000000000010020 0x3f000000000000000000130000000021001f (h240 + 0x10000 0x1400000000010000000000000000000100000000010000000003001c))) (.bin (.leaf8 0x1000f + 0x410000000000000000000100000000210000000001001e 0x100000000010023 + 0x4300000000000000000001000000001200000000000020 0x45000000000000000000080000000000001f (h240 + (h240 0x1000000000800000000020000 0x100000000050000000001000000003f00000000020000) + 0x10000000002000000000100000000070000000007001c) 0x7000f + 0x4b0000000000000000000700000000000000000001001e) (.leaf8 (h240 0x1000000000700000000020000 + 0x10000000001000000000100000000010000000004001c) 0x1000f + 0x4e0000000000000000000100000000010000000001001e 0x10000000000000b 0x14 0x1000e 0x800c6 0x10043))) + (.bin (.bin (.leaf8 0x20142 0x101c3 0x30009 0x700000000010019 0x4b0000000000001d 0x50023 + 0x300000000000000000001009c 0x30003) (.leaf8 0x3000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 0x16aa33c000000000000000000010000000001000009ece90000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x500004886f100000000060000000001000000000500000000010000) + 0x30000000001000000000000000000010000000008000001fc3f0000) + 0x90000000001000000000b00000e8161000000000c00000000010000) + 0x5000000000100000000000000000001000000000e00000065a50000) + 0xf0000000001000000000000000000010000000011000002e6ac0000) + 0x120000000001000000000b0000000001000000001400000014540000) + 0x15000000000100000000020000000002000000000000000000010000) + 0x17000000948800000000180000000001000000000000000000010000) + 0x50000000001000000001a0000000410000000001b00000000010000) + 0x1d0000001db4000000001e0000000001000000000300000000010000) + 0x1000000001f00000000d0000000002100000000010000) + 0x2200000005f000000000240000000001000000000900000000010000) + 0x100000000260000000028000000002700000000010000) + 0xb000000000100000000030000000001000000000000000000010000) + 0x29000000012f000000002a0000000001000000000500000000010000) + 0x1000000002c0000000007000000002d00000000010000) + 0x60000000001000000002f000000003c000000003000000000010000) + 0x2000000000200000000000000000001000000003200000000010000) + 0x330000000001000000000000000000010000000034000000000b0000) + 0x36000000000100000000140000000001000000000000000000010000) + 0x1000000000200000000000000000001000000003b00000000010000) + 0x3c000000000100000000080000000002000000000000000000010000) + 0x50000000001000000003f0000000002000000000000000000010000) + 0x200000000010000000006000000004c00000000010000000000001d) 0x3000b 0x60014 0x20010 0x10021 0x16 + 0x3f0014)) (.bin (.leaf8 0x2000e (h240 0x10000 0x10000000008000000000100000000020000000003001c) + 0x2000f 0x40021 0x30016 0x80014 0x20010 0x10021) (.leaf8 0x3b000000003a0016 0x14 + 0x10000000003000000003d0000000000001f 0x3d0009 0x30021 0x3600000000120016 0x50000000034001a + 0x320016)))) (.bin (.bin (.bin (.leaf8 0x3200000000310016 0x14 0x340010 0x10021 0x3000000000000016 + 0x1d000000002e001a 0x2f000000002e0016 0x2d00000000040016) (.leaf8 0x3000000002b001a 0x2a0016 + 0x2a00000000030016 0x970000000028001a 0x270016 0xb00000000010016 0x140000000025001a 0x240016)) + (.bin (.leaf8 0x2400000000070016 0x2f70000000022001a 0x2200000000220016 0x68000000001f001a + 0x1d0016 0x1e00000000010016 0xed9000000001c001a 0x1d000000001c0016) (.leaf8 0x2080000000019001a + 0x500000000180016 0x180014 0x70010 0x10021 0x4a430000000016001a 0x1700000000160016 0x14))) (.bin + (.bin (.leaf8 0x190010 0x10021 0x1500000000000016 0xa290000000013001a 0x1400000000130016 + 0x1200000000090016 0x173550000000010001a 0x1100000000100016) (.leaf8 0xf0014 0x130010 0x10021 + 0x32d2000000000d001a 0xc0016 0xc00000000030016 0x740b0000000000a001a 0x900000000090016)) (.bin + (.leaf8 0xfe1f0000000007001a 0x60016 0x500000000010016 0x2443780000000004001a 0x500000000040016 + 0x14 0x70010 0x10021) (.leaf8 0x300000000000016 0x4f6740000000001001a 0x3001d + 0x100000000010000000001000004f673000000000000000000000020 0x5000e (h240 0x10000 + 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x200000000070000000001000000000700000000000000000001001e))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x60023 0x6000d 0x2000000000800000000010000244377000000000100000000010020 + 0x20000000009000000000100000000070000000000001f 0x60023 0x6000d + 0x2000000000a000000000100000000020000000003001f 0x100000000030023) (.leaf8 + 0x2000000000c0000000001000000fe1e000000000200000000000020 + 0x2000000000e0000000001000000000b0000000005001f 0x1000000000c0023 + 0x2000000000f000000000100000740af000000000300000000000020 + 0x200000000110000000001000000000e0000000001001f (h240 0x10000 + 0xf00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x200000000120000000001000000000100000000060000000001001e)) (.bin (.leaf8 0x100000000020023 + 0x20000000014000000000100000032d1000000000400000000000020 0x11000e + 0x200000000160000000001000000001300000000090000000000001e 0x120023 0x12000d + 0x200000000170000000001000000e9cc000000000500000000010020 + 0x20000000018000000000100000000140000000004001f) (.leaf8 0x140009 0x190021 0x17 0x1d 0x103c3 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 0xb5519e000000000300000000010000 + 0x20000000002000000000000000000010000000005000004f6740000) + 0x6000000000100000000000000000001000000000200000000010000) + 0x8000024437800000000090000000001000000000800000000010000) + 0x3000000000100000000000000000001000000000b000000fe1f0000) + 0xc000000000100000000000000000001000000000e00000740b00000) + 0xf000000000100000000000000000001000000000200000000010000) + 0x1000000001100000032d2000000001200000000010000) + 0x14000000e9cd0000000015000000000100000000140000000019001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 + 0x200000000180000000000000000001400000000030000000001001e)))) (.bin (.bin (.leaf8 0x130023 + 0x13000d 0x1a00000000000000008986000000000500000000010020 0x1a000000000000000000140000000005001f + (h240 0x10000 0x1500000000010000000000000000000100000000150000000003001c) 0x15000f + 0x1b00000000000000000015000000000b0000000001001e 0x140023) (.leaf8 0x14000d + 0x1c00000000000000000a28000000000600000000010020 0x17000e (h240 0x10000 + 0x10000000002000000000100000000190000000003001c) 0x19000f + 0x1f00000000000000000019000000000c0000000001001e 0x180023 0x18000d)) (.bin (.leaf8 + 0x2000000000000000004a42000000000700000000010020 0x1a000e + 0x2100000000000000000007000000000e0000000000001e 0x100000000080023 + 0x2300000000000000000207000000000800000000000020 0x250000000000000000001f0000000012001f 0x1e0023 + 0x1e000d) (.leaf8 0x2600000000000000000ed8000000000900000000010020 + 0x27000000000000000000200000000000001f 0x1f0023 0x1f000d 0x27000000000000000000020000000012001f + 0x100000000020023 0x2900000000000000000067000000000a00000000000020 + 0x2b000000000000000000240000000016001f)))) (.bin (.bin (.bin (.leaf8 0x230023 0x23000d + 0x2c000000000000000002f6000000000b00000000010020 0x2d000000000000000000260000000004001f 0x250023 + 0x25000d 0x2d000000000000000000020000000017001f 0x100000000030023) (.leaf8 + 0x2f00000000000000000013000000000c00000000000020 0x310000000000000000000d0000000000001f 0xc0023 + 0xc000d 0x32000000000000000000020000000019001f 0x100000000030023 + 0x3400000000000000000096000000000d00000000000020 0x360000000000000000002c0000000001001f)) (.bin + (.leaf8 (h240 0x10000 0x2d00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x3700000000000000000001000000001a0000000001001e 0x100000000020023 + 0x3900000000000000000002000000000e00000000000020 0x3b0000000000000000002f0000000002001f 0x2e0023 + 0x2e000d) (.leaf8 0x3b00000000000000000031000000001e001f 0x300023 0x30000d + 0x3c0000000000000000001c000000000f00000000010020 0x32000e (h240 0x10000 + 0x10000000002000000000100000000340000000003001c) 0x34000f + 0x3f00000000000000000034000000001e0000000001001e))) (.bin (.bin (.leaf8 0x330023 0x33000d + 0x40000000000000000000020000000020001f 0x100000000020023 + 0x4200000000000000000004000000001100000000000020 0x4400000000000000000038000000000b001f (h240 + (h240 0x10000 0x39000000000100000000000000000001000000000100000000020000) + 0x100000000020000000001000000003d0000000006001c) 0x3d000f) (.leaf8 + 0x480000000000000000003d00000000230000000001001e 0x3c0023 0x3c000d 0xa000e + 0x4a0000000000000000000200000000000000000000001e (h240 (h240 0x1000000000300000000010000 + 0x100000000410000000001000000000300000000010000) 0x10000000008000000000100000000010000000007001c) + 0x600c6 0x10043)) (.bin (.leaf8 0x80142 0x101c3 0x90009 0x30014 0x9000e 0x20186 0x10043 0xa0142) + (.leaf8 0x101c3 0xb0023 0x1a00c6 0x10043 0x10303 0x10009 0x50008 0x10009)))))) (.bin (.bin (.bin + (.bin (.bin (.leaf8 0x10021 0x4100000000010019 0x4c0000000000001d 0x3f0023 (h240 0x20000 + 0x10000000006000000000100000000010000000003009c) 0x1000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 0x18cfea0000000000000000000100000000010000 + 0xb5519e000000000300000000010000000002000000000200000000000000) + 0x10000000005000004f6740000000006000000000100000000000000) + 0x1000000000200000000010000000008000024437800000000090000) + 0x1000000000800000000010000000003000000000100000000000000) + 0x1000000000b000000fe1f000000000c000000000100000000000000) + 0x1000000000e00000740b0000000000f000000000100000000000000) + 0x1000000000200000000010000000000000000000100000000110000) + 0x32d2000000001200000000010000000014000001735600000000150000) + 0x10000000000000000000100000000160000000a2a00000000180000) + 0x10000000000000000000100000000020000000001000000001a0000) + 0x4a44000000001b00000000010000000008000000000100000000000000) + 0x1000000001d0000000207000000001e000000000100000000200000) + 0xeda000000002100000000010000000002000000000200000000000000) + 0x1000000002300000000670000000024000000000100000000250000) + 0x2f8000000002700000000010000000003000000000100000000000000) + 0x100000000290000000013000000002a0000000001000000000e0000) + 0x10000000003000000000100000000000000000001000000002c0000) + 0x97000000002d00000000010000000000000000000100000000020000) + 0x100000000000000000001000000002f000000000300000000300000) + 0x10000000032000000001e0000000033000000000100000000000000) + 0x1000000000200000000010000000035000000000100000000020000) + 0x2000000000000000000010000000038000000000500000000390000) + 0x1000000000000000000010000000001000000000200000000000000) + 0x100000000020000000001000000003e0000000001000000000b0000) + 0x1000000000300000000010000000000000000000100000000400000) + 0x4d00000000020000000000000000000100000000040000000001001e) 0x60000000001000b) (.leaf8 0x14 + 0x7000e 0x20186 0x10043 0x80142 0x101c3 0x90023 0x1600c6)) (.bin (.leaf8 0x10043 0x10303 0x10009 + 0x20008 0x10009 0x10021 0x4000000000010019 0x4c0000000000001d) (.leaf8 0x3e0023 (h240 0x20000 + 0x10000000003000000000100000000010000000003009c) 0x1000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 0x18cff80000000000000000000100000000010000 + 0xb5519e000000000300000000010000000002000000000200000000000000) + 0x10000000005000004f6740000000006000000000100000000000000) + 0x1000000000200000000010000000008000024437800000000090000) + 0x1000000000800000000010000000003000000000100000000000000) + 0x1000000000b000000fe1f000000000c000000000100000000000000) + 0x1000000000e00000740b0000000000f000000000100000000000000) + 0x1000000000200000000010000000000000000000100000000110000) + 0x32d2000000001200000000010000000014000001735600000000150000) + 0x10000000000000000000100000000160000000a2a00000000180000) + 0x10000000000000000000100000000020000000001000000001a0000) + 0x4a44000000001b00000000010000000008000000000100000000000000) + 0x1000000001d0000000207000000001e000000000100000000200000) + 0xeda000000002100000000010000000002000000000200000000000000) + 0x1000000002300000000670000000024000000000100000000250000) + 0x2f8000000002700000000010000000003000000000100000000000000) + 0x100000000290000000013000000002a0000000001000000000e0000) + 0x10000000003000000000100000000000000000001000000002c0000) + 0x97000000002d00000000010000000000000000000100000000020000) + 0x100000000000000000001000000002f000000000300000000300000) + 0x10000000032000000001e0000000033000000000100000000000000) + 0x1000000000200000000010000000035000000000100000000020000) + 0x2000000000000000000010000000038000000000500000000390000) + 0x1000000000000000000010000000001000000000200000000000000) + 0x100000000020000000001000000003e0000000001000000000b0000) + 0x10000000003000000000100000000000000000001000000003f0000) + 0x4d00000000020000000000000000000100000000030000000001001e) 0x30000000000000b 0x14 0x3000e + 0xc00c6))) (.bin (.bin (.leaf8 0x10043 0x20142 0x101c3 0x30009 0x3f00000000010019 + 0x4c0000000000001d 0x3d0023 0x300000000000000000001009c) (.leaf8 0x30003 0x3000f (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x18d0040000000000000000000100000000010000 + 0xb5519e000000000300000000010000000002000000000200000000000000) + 0x10000000005000004f6740000000006000000000100000000000000) + 0x1000000000200000000010000000008000024437800000000090000) + 0x1000000000800000000010000000003000000000100000000000000) + 0x1000000000b000000fe1f000000000c000000000100000000000000) + 0x1000000000e00000740b0000000000f000000000100000000000000) + 0x1000000000200000000010000000000000000000100000000110000) + 0x32d2000000001200000000010000000014000001735600000000150000) + 0x10000000000000000000100000000160000000a2a00000000180000) + 0x10000000000000000000100000000020000000001000000001a0000) + 0x4a44000000001b00000000010000000008000000000100000000000000) + 0x1000000001d0000000207000000001e000000000100000000200000) + 0xeda000000002100000000010000000002000000000200000000000000) + 0x1000000002300000000670000000024000000000100000000250000) + 0x2f8000000002700000000010000000003000000000100000000000000) + 0x100000000290000000013000000002a0000000001000000000e0000) + 0x10000000003000000000100000000000000000001000000002c0000) + 0x97000000002d00000000010000000000000000000100000000020000) + 0x100000000000000000001000000002f000000000300000000300000) + 0x10000000032000000001e0000000033000000000100000000000000) + 0x1000000000200000000010000000035000000000100000000020000) + 0x2000000000000000000010000000038000000000500000000390000) + 0x1000000000000000000010000000001000000000200000000000000) + 0x100000000020000000001000000003e0000000001000000000b0000) + 0x10000000003000000000100000000000000000001000000003e0000) + 0x4d00000000010000000000000000000300000000000000000001001e) 0x3000a 0x8 (h240 0x3e0000 + 0x100000000000000000002000000000100000000000000000000001e) (h240 0x30000 + 0x4000000000010000000002000000000100000000000000000000001e) 0x1000a)) (.bin (.leaf8 0x20008 + 0x10009 0x10021 0x5000000003f0016 0xb00000000010019 0x490000000000001d 0x90023 + 0x300000000000000000001009c) (.leaf8 0x60003 0x6000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 0x18d00a0000000000000000000100000000010000 + 0xb5519e000000000300000000010000000002000000000200000000000000) + 0x10000000005000004f6740000000006000000000100000000000000) + 0x1000000000200000000010000000008000024437800000000090000) + 0x1000000000800000000010000000003000000000100000000000000) + 0x1000000000b000000fe1f000000000c000000000100000000000000) + 0x1000000000e00000740b0000000000f000000000100000000000000) + 0x1000000000200000000010000000000000000000100000000110000) + 0x32d2000000001200000000010000000014000001735600000000150000) + 0x10000000000000000000100000000160000000a2a00000000180000) + 0x10000000000000000000100000000020000000001000000001a0000) + 0x4a44000000001b00000000010000000008000000000100000000000000) + 0x1000000001d0000000207000000001e000000000100000000200000) + 0xeda000000002100000000010000000002000000000200000000000000) + 0x1000000002300000000670000000024000000000100000000250000) + 0x2f8000000002700000000010000000003000000000100000000000000) + 0x100000000290000000013000000002a0000000001000000000e0000) + 0x10000000003000000000100000000000000000001000000002c0000) + 0x97000000002d00000000010000000000000000000100000000020000) + 0x100000000000000000001000000002f000000000300000000300000) + 0x10000000032000000001e0000000033000000000100000000000000) + 0x1000000000200000000010000000035000000000100000000020000) + 0x2000000000000000000010000000038000000000500000000390000) + 0x1000000000000000000010000000001000000000200000000000000) + 0x100000000020000000001000000003e0000000001000000000a0000) + 0x4a00000000010000000000000000000600000000280000000001001e) (h240 0x1000000000700000000010000 + 0x10000000003000000000100000000010000000004001c) 0x600c6 0x10043 0x30142 0x101c3)))) (.bin (.bin + (.bin (.leaf8 0x40009 0x70014 0x4000e 0x20186 0x10043 0x50142 0x101c3 0x60023) (.leaf8 0x1000c6 + 0x10043 0x10303 0x10009 0x90008 0x10009 0x10021 0x10019)) (.bin (.leaf8 0x4b0000000000001d 0xf + 0x4a0000000000001d 0x103c3 0x1000000000b000000000100000000010000000002001c 0x1000f (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x18d0620000000000000000000100000000010000b5519e00000000030000 + 0x1000000000200000000020000000000000000000100000000050000) + 0x4f674000000000600000000010000000000000000000100000000020000) + 0x1000000000800002443780000000009000000000100000000080000) + 0x10000000003000000000100000000000000000001000000000b0000) + 0xfe1f000000000c000000000100000000000000000001000000000e0000) + 0x740b0000000000f00000000010000000000000000000100000000020000) + 0x100000000000000000001000000001100000032d200000000120000) + 0x1000000001400000173560000000015000000000100000000000000) + 0x100000000160000000a2a0000000018000000000100000000000000) + 0x100000000020000000001000000001a0000004a44000000001b0000) + 0x10000000008000000000100000000000000000001000000001d0000) + 0x207000000001e000000000100000000200000000eda00000000210000) + 0x1000000000200000000020000000000000000000100000000230000) + 0x6700000000240000000001000000002500000002f800000000270000) + 0x1000000000300000000010000000000000000000100000000290000) + 0x13000000002a0000000001000000000e000000000100000000030000) + 0x100000000000000000001000000002c0000000097000000002d0000) + 0x1000000000000000000010000000002000000000100000000000000) + 0x1000000002f00000000030000000030000000000100000000320000) + 0x1e000000003300000000010000000000000000000100000000020000) + 0x1000000003500000000010000000002000000000200000000000000) + 0x1000000003800000000050000000039000000000100000000000000) + 0x1000000000100000000020000000000000000000100000000020000) + 0x1000000003e0000000001000000000a000000000100000000010000) + 0x4b00000000010000000000000000000100000000010000000001001e) 0xb0000000000000b) (.leaf8 + 0xa00000000000000000003001d 0xb000b 0xb0014 0x20010 0x10021 0x3e00000000010019 0x480000000000001d + 0x3c0023))) (.bin (.bin (.leaf8 (h240 0x20000 0x1000000000d000000000100000000020000000003009c) + 0x2000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x18d06a00000000000000 + 0x100000000010000b5519e0000000003000000000100000000020000) + 0x2000000000000000000010000000005000004f67400000000060000) + 0x1000000000000000000010000000002000000000100000000080000) + 0x244378000000000900000000010000000008000000000100000000030000) + 0x100000000000000000001000000000b000000fe1f000000000c0000) + 0x100000000000000000001000000000e00000740b0000000000f0000) + 0x1000000000000000000010000000002000000000100000000000000) + 0x1000000001100000032d20000000012000000000100000000140000) + 0x17356000000001500000000010000000000000000000100000000160000) + 0xa2a000000001800000000010000000000000000000100000000020000) + 0x1000000001a0000004a44000000001b000000000100000000080000) + 0x100000000000000000001000000001d0000000207000000001e0000) + 0x100000000200000000eda0000000021000000000100000000020000) + 0x2000000000000000000010000000023000000006700000000240000) + 0x1000000002500000002f80000000027000000000100000000030000) + 0x10000000000000000000100000000290000000013000000002a0000) + 0x1000000000e00000000010000000003000000000100000000000000) + 0x1000000002c0000000097000000002d000000000100000000000000) + 0x10000000002000000000100000000000000000001000000002f0000) + 0x3000000003000000000010000000032000000001e00000000330000) + 0x1000000000000000000010000000002000000000100000000350000) + 0x1000000000200000000020000000000000000000100000000380000) + 0x5000000003900000000010000000000000000000100000000010000) + 0x20000000000000000000100000000020000000001000000003d0000) + 0x4900000000020000000000000000000200000000040000000001001e) 0xd0000000002000b 0x14 0xf0010 0x10021 + 0x2000000003b0016) (.leaf8 0x14 0x1000000000300000000040000000000001f 0x40009 0x30021 + 0x20000000037001a 0x3800000000370016 0x14 0x3a0010)) (.bin (.leaf8 0x10021 0x3500000000000016 0x16 + 0xf0000000031001a 0x3000000000300016 0x1000000002e001a 0x2d0016 0x16) (.leaf8 0x4b000000002b001a + 0x2c000000002b0016 0x30014 0x2e0010 0x10021 0x2a000000000c0016 0x90000000028001a 0x270016))))) + (.bin (.bin (.bin (.bin (.leaf8 0x2700000000010016 0x17b0000000025001a 0x2500000000250016 + 0x330000000022001a 0x2300000000220016 0x14 0x250010 0x10021) (.leaf8 0x2100000000000016 + 0x76c000000001f001a 0x20000000001f0016 0x103000000001c001a 0x1d000000001c0016 0x80014 0x1f0010 + 0x10021)) (.bin (.leaf8 0x25220000000019001a 0x200000000180016 0x180014 0x40010 0x10021 + 0x5140000000016001a 0x1600000000160016 0x150014) (.leaf8 0x180010 0x10021 0xb9aa0000000013001a + 0x1400000000130016 0x19690000000010001a 0xf0016 0x16 0x3a058000000000d001a))) (.bin (.bin (.leaf8 + 0xc0016 0x7f0f000000000a001a 0xb000000000a0016 0x30014 0xd0010 0x10021 0x900000000060016 + 0x1221bb0000000007001a) (.leaf8 0x800000000070016 0x16 0x27b3a0000000004001a 0x30016 0x20014 + 0x20010 0x10021 0x5aa8cf0000000001001a)) (.bin (.leaf8 0x3001d + 0x10000000001000000000100000c6839000000000000000000000020 0x50010 0x60021 0x17 0x1d 0x103c3 (h240 + (h240 0xc683a0000 0x3000000000100000000020000000002000000000000000000010000) + 0x500000c68390000000006000000000100000000040000000006001c)) (.leaf8 0x4000d (h240 + 0x20000000000000000000100000000010000 0x20000000005000000000000004e4093000000000000000000010020) + 0x4000e 0x80000000000000000000200000000000000000000001e 0x100000000030023 + 0xa00000000000000027b39000000000100000000000020 0x2000e + 0x10000000000000000000100000000090000000002001c)))) (.bin (.bin (.bin (.leaf8 0x9000f + 0xe0000000000000000000900000000030000000001001e 0x80023 0x8000d + 0xf000000000000001221ba000000000200000000010020 0x100000000000000000000b0000000003001f (h240 + 0x1000000000c00000000010000 0x100000000050000000001000000000d0000000004001c) 0xd000f) (.leaf8 + 0x120000000000000000000d00000000040000000001001e 0xc0023 0xc000d + 0x1300000000000000007f0e000000000300000000010020 0x14000000000000000000020000000007001f + 0x100000000030023 0x160000000000000003a057000000000400000000000020 0x2000e)) (.bin (.leaf8 + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x1a0000000000000000000100000000080000000001001e 0x100000000020023 + 0x1c00000000000000001968000000000500000000000020 0x1e00000000000000000016000000000c001f 0x150023 + 0x15000d) (.leaf8 0x1f0000000000000000b9a9000000000600000000010020 0x17000e + 0x2000000000000000000018000000000d0000000000001e 0x170023 0x17000d + 0x2100000000000000000513000000000700000000010020 0x1a000e + 0x2200000000000000000004000000000e0000000000001e))) (.bin (.bin (.leaf8 0x100000000050023 + 0x2400000000000000002521000000000800000000000020 0xa000e + 0x270000000000000000001f00000000110000000000001e 0x1e0023 0x1e000d + 0x2800000000000000000102000000000900000000010020 0x29000000000000000000220000000014001f) (.leaf8 + 0x210023 0x21000d 0x2a0000000000000000076b000000000a00000000010020 0x23000e (h240 0x10000 + 0x10000000002000000000100000000250000000003001c) 0x25000f + 0x2d0000000000000000002500000000140000000001001e 0x240023)) (.bin (.leaf8 0x24000d + 0x2e00000000000000000032000000000b00000000010020 0x2f000000000000000000270000000018001f 0x260023 + 0x26000d 0x300000000000000000017a000000000c00000000010020 0x31000000000000000000290000000000001f + 0x280023) (.leaf8 0x28000d 0x31000000000000000000020000000019001f 0x100000000030023 + 0x3300000000000000000008000000000d00000000000020 0x350000000000000000002c0000000007001f (h240 + 0x1000000002d00000000010000 0x100000000050000000001000000002e0000000004001c) 0x2e000f + 0x370000000000000000002e000000001a0000000001001e))))))))) (.bin (.bin (.bin (.bin (.bin (.bin + (.bin (.bin (.leaf8 0x2d0023 0x2d000d 0x380000000000000000004a000000000e00000000010020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x3b00000000000000000001000000001c0000000001001e 0x100000000020023) (.leaf8 + 0x3d00000000000000000000000000000f00000000000020 0x3e00000000000000000032000000001f001f + 0x100000000330023 0x400000000000000000000e000000001000000000000020 0x2000e (h240 + 0x100000000000000000001000000003700000000010000 0x100000000020000000001000000003a0000000005001c) + 0x3a000f 0x470000000000000000003a00000000220000000001001e)) (.bin (.leaf8 0x390023 0x39000d + 0x4800000000000000000001000000001200000000010020 0x1000e (h240 0x20000 + 0x10000000002000000000100000000040000000003001c) 0x4000f + 0x4c0000000000000000000400000000230000000001001e (h240 0x1000000000400000000020000 + 0x100000000020000000001000000000f0000000004001c)) (.leaf8 0x2200c6 0x10043 0x20142 0x101c3 0x30009 + 0x14 0x40010 0x10021))) (.bin (.bin (.leaf8 0x200000000020016 0x14 0x40010 0x10021 + 0x3c00000000000016 0x3b000000003a0016 0x16 0x350016) (.leaf8 0x3600000000010016 0x60000000034001a + 0x3500000000340016 0x330014 0x370010 0x10021 0x300016 0x16)) (.bin (.leaf8 0x3000000000010016 + 0x25000000002e001a 0x5000000002d0016 0x2d0014 0x70010 0x10021 0x4000000002b001a 0x2a0016) (.leaf8 + 0x2a00000000010016 0xbd0000000028001a 0x2800000000280016 0x190000000025001a 0x2600000000250016 + 0x16 0x3b60000000022001a 0x2300000000220016)))) (.bin (.bin (.bin (.leaf8 0x81000000001f001a + 0x20000000001f0016 0x1e00000000090016 0x1290000000001c001a 0x1b0016 0x1b00000000030016 + 0x28a0000000019001a 0x1800000000170016) (.leaf8 0x5cd50000000016001a 0x1500000000150016 + 0xcb30000000013001a 0x1400000000130016 0x20014 + 0x300000000040000000000000000000200000000160000000000001f 0x160009 0x10021)) (.bin (.leaf8 + 0x1d02b0000000010001a 0x1100000000100016 0x30014 0x130010 0x10021 0x3f87000000000d001a + 0xe000000000d0016 0x30016) (.leaf8 0x910de000000000a001a 0x80016 0x900000000010016 + 0x13d9c0000000007001a 0x60016 0x500000000010016 0x2d54670000000004001a 0x30016))) (.bin (.bin + (.leaf8 0x20014 0x20010 0x10021 0x6341d0000000001001a 0x3001d + 0x100000000010000000001000006341c000000000000000000000020 0x4000e + 0x200000000060000000001000000000200000000000000000000001e) (.leaf8 0x100000000030023 + 0x20000000008000000000100002d5466000000000100000000000020 + 0x2000000000a000000000100000000070000000000001f 0x60023 0x6000d + 0x2000000000b000000000100000000020000000003001f 0x100000000030023 + 0x2000000000d00000000010000013d9b000000000200000000000020)) (.bin (.leaf8 + 0x2000000000f0000000001000000000b0000000000001f 0xa0023 0xa000d + 0x2000000000f000000000100000000020000000004001f 0x100000000020023 + 0x20000000011000000000100000910dd000000000300000000000020 + 0x20000000013000000000100000000020000000001001f (h240 0x10000 + 0x3000000000100000000000000000001000000000f0000000003001c)) (.leaf8 0xf000f + 0x200000000150000000001000000000f00000000070000000001001e 0xe0023 0xe000d + 0x2000000001600000000010000003f86000000000400000000010020 0x5000e + 0x200000000180000000001000000001300000000090000000000001e 0x120023))))) (.bin (.bin (.bin (.bin + (.leaf8 0x12000d 0x200000000190000000001000001243a000000000500000000010020 + 0x2000000001a000000000100000000140000000002001f 0x140009 0x1b0021 0x17 0x1d 0x103c3) (.leaf8 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0xe2a5dc0000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x5000006341c00000000060000000001000000000500000000010000) + 0x3000000000100000000000000000001000000000800002d54660000) + 0x9000000000100000000080000000001000000000300000000010000) + 0x1000000000b0000013d9c000000000c00000000010000) + 0x2000000000200000000000000000001000000000e00000910dd0000) + 0xf000000000100000000030000000001000000000000000000010000) + 0x100000003f8700000000120000000001000000000600000000010000) + 0x14000001243b000000001500000000010000000014000000001b001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x2000000001a0000000000000000001400000000050000000001001e) + 0x130023 0x13000d 0x1c0000000000000000abee000000000500000000010020 0x5000e + 0x10000000005000000000100000000160000000002001c)) (.bin (.leaf8 0x16000f + 0x1e0000000000000000001600000000090000000001001e 0x150023 0x15000d + 0x1f00000000000000000cb2000000000600000000010020 0x2000000000000000000017000000000d001f + 0x100000000180023 0x2100000000000000005cd4000000000700000000000020) (.leaf8 + 0x230000000000000000001a000000000e001f 0x1000000001a0023 + 0x2500000000000000000289000000000800000000000020 0x270000000000000000001d0000000001001f (h240 + 0x10000 0x1e00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x280000000000000000000100000000100000000001001e 0x100000000020023))) (.bin (.bin (.leaf8 + 0x2a0000000000000000128f000000000900000000000020 0x2c000000000000000000200000000005001f (h240 + 0x10000 0x2100000000010000000000000000000100000000210000000003001c) 0x21000f + 0x2d0000000000000000002100000000130000000001001e 0x200023 0x20000d + 0x2e00000000000000000080000000000a00000000010020) (.leaf8 0x2f000000000000000000250000000016001f + 0x240023 0x24000d 0x30000000000000000003b5000000000b00000000010020 0x2000e + 0x10000000000000000000100000000270000000002001c 0x27000f + 0x330000000000000000002700000000170000000001001e)) (.bin (.leaf8 0x260023 0x26000d + 0x3400000000000000000018000000000c00000000010020 0x350000000000000000002a000000001a001f 0x290023 + 0x29000d 0x36000000000000000000bc000000000d00000000010020 0x370000000000000000002c0000000000001f) + (.leaf8 0x2b0023 0x2b000d 0x3700000000000000000002000000001b001f 0x100000000030023 + 0x3900000000000000000003000000000e00000000000020 0x2f000e + 0x3b00000000000000000007000000001c0000000000001e 0x100000000080023)))) (.bin (.bin (.bin (.leaf8 + 0x3d00000000000000000024000000000f00000000000020 0x3f000000000000000000320000000000001f 0x310023 + 0x31000d 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x4100000000000000000001000000001e0000000001001e) (.leaf8 (h240 0x1000000000200000000010000 + 0x10000000035000000000100000000370000000004001c) 0x37000f + 0x440000000000000000003700000000200000000001001e 0x360023 0x36000d + 0x4500000000000000000005000000001100000000010020 0x46000000000000000000380000000000001f 0x370023)) + (.bin (.leaf8 0x37000d 0x46000000000000000000020000000022001f (h240 + 0x100000000020000000002000000000000000000010000 + 0x2000000000100000000000000000001000000003c0000000005001c) 0x3c000f + 0x4a0000000000000000003c00000000250000000001001e 0x3b0023 0x3b000d 0x3e000e) (.leaf8 (h240 (h240 + 0x10000 0x100000000020000000001000000000400000000020000) + 0x10000000002000000000100000000040000000006001c) 0x4000f + 0x510000000000000000000400000000070000000001001e 0x20000000003000b 0x14 0x40010 0x10021 + 0x200000000020016))) (.bin (.bin (.leaf8 0x3f0014 0x40010 0x10021 0x3b0016 0x16 0x20014 0x2000e + 0x10000000000000000000100000000010000000002001c) (.leaf8 0x1000f 0x30021 0x30000000037001a + 0x3800000000370016 0x330016 0x16 0x3300000000010016 0x120000000031001a)) (.bin (.leaf8 0x300016 + 0x3000000000060016 0x1000000002e001a 0x2f000000002e0016 0x30014 0x310010 0x10021 + 0x5f000000002b001a) (.leaf8 0x2a00000000290016 0xc0000000028001a 0x260016 0x2700000000010016 + 0x1da0000000025001a 0x2600000000250016 0x400000000022001a 0x2200000000220016)))))) (.bin (.bin + (.bin (.bin (.bin (.leaf8 0x210014 0x240010 0x10021 0x947000000001f001a 0x20000000001f0016 0x20014 + 0x1e00000000040000000000000000000200000000220000000000001f 0x220009) (.leaf8 0x20021 + 0x144000000001c001a 0x1d000000001c0016 0x14 0x1f0010 0x10021 0x1b00000000180016 + 0x2e690000000019001a)) (.bin (.leaf8 0x1a00000000190016 0x180014 0x1c0010 0x10021 + 0x6590000000016001a 0x1700000000160016 0x600000000030016 0xe8150000000013001a) (.leaf8 + 0x1400000000130016 0x1200000000040016 0x1fc30000000010001a 0xe0016 0xf00000000010016 + 0x4886e000000000d001a 0xc0016 0x20014))) (.bin (.bin (.leaf8 0x20010 0x10021 0x9ece000000000a001a + 0x90016 0x800000000010016 0x16aa330000000007001a 0x60016 0x500000000010016) (.leaf8 + 0x31a0e0000000004001a 0x30016 0x20014 0x20010 0x10021 0x7152ee0000000001001a 0x3001d + 0x10000000001000000000100000f823a000000000000000000000020)) (.bin (.leaf8 0x50010 0x60021 0x17 + 0x1d 0x103c3 (h240 (h240 0xf823b0000 0x3000000000100000000020000000002000000000000000000010000) + 0x500000f823a0000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x200000000050000000000000061d0b1000000000000000000010020)) + (.leaf8 0x4000e 0x80000000000000000000200000000000000000000001e 0x100000000030023 + 0xa00000000000000031a0d000000000100000000000020 0xc000000000000000000070000000000001f 0x60023 + 0x6000d 0xd000000000000000000020000000003001f)))) (.bin (.bin (.bin (.leaf8 0x100000000030023 + 0xf0000000000000016aa32000000000200000000000020 0x110000000000000000000a0000000000001f 0x90023 + 0x9000d 0x12000000000000000000020000000005001f 0x100000000030023 + 0x1400000000000000009ecd000000000300000000000020) (.leaf8 0x4000e + 0x170000000000000000000200000000060000000000001e 0x100000000030023 + 0x190000000000000004886d000000000400000000000020 0x1b000000000000000000110000000000001f 0x100023 + 0x10000d 0x1b000000000000000000020000000008001f)) (.bin (.leaf8 0x100000000020023 + 0x1d00000000000000001fc2000000000500000000000020 0x1f000000000000000000140000000002001f 0x130023 + 0x13000d 0x1f00000000000000000016000000000c001f 0x150023 0x15000d) (.leaf8 + 0x200000000000000000e814000000000600000000010020 0x21000000000000000000080000000001001f (h240 + 0x10000 0x900000000010000000000000000000100000000180000000003001c) 0x18000f + 0x2300000000000000000018000000000d0000000001001e 0x170023 0x17000d + 0x2400000000000000000658000000000700000000010020))) (.bin (.bin (.leaf8 0x1a000e + 0x250000000000000000001c000000000f0000000000001e 0x1b0023 0x1b000d + 0x2600000000000000002e68000000000800000000010020 0x270000000000000000001d000000000f001f (h240 + 0x1000000001e00000000010000 0x100000000020000000001000000001f0000000004001c) 0x1f000f) (.leaf8 + 0x290000000000000000001f00000000100000000001001e 0x1e0023 0x1e000d + 0x2a00000000000000000143000000000900000000010020 0x20000e + 0x10000000005000000000100000000220000000002001c 0x22000f + 0x2c0000000000000000002200000000110000000001001e)) (.bin (.leaf8 0x210023 0x21000d + 0x2d00000000000000000946000000000a00000000010020 0x23000e + 0x2e0000000000000000002400000000150000000000001e 0x230023 0x23000d + 0x2f0000000000000000003f000000000b00000000010020) (.leaf8 0x30000000000000000000280000000018001f + 0x270023 0x27000d 0x31000000000000000001d9000000000c00000000010020 + 0x32000000000000000000290000000000001f 0x280023 0x28000d + 0x32000000000000000000020000000018001f))))) (.bin (.bin (.bin (.bin (.leaf8 0x100000000020023 + 0x340000000000000000000b000000000d00000000000020 0x360000000000000000002c000000001a001f + 0x1000000002c0023 0x380000000000000000005e000000000e00000000000020 0x5000e + 0x3b00000000000000000031000000001d0000000000001e 0x300023) (.leaf8 0x30000d + 0x3c00000000000000000000000000000f00000000010020 0x3d000000000000000000320000000003001f (h240 + 0x10000 0x3300000000010000000000000000000100000000010000000003001c) 0x1000f + 0x3e00000000000000000001000000001e0000000001001e 0x100000000020023 + 0x4000000000000000000011000000001000000000000020)) (.bin (.leaf8 + 0x42000000000000000000350000000000001f 0x340023 0x34000d 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x440000000000000000000100000000200000000001001e (h240 0x10000 + 0x200000000010000000000000000000100000000390000000003001c)) (.leaf8 0x39000f + 0x460000000000000000003900000000230000000001001e 0x380023 0x38000d + 0x4700000000000000000002000000001200000000010020 0x4000e (h240 0x10000 + 0x300000000010000000000000000000100000000010000000003001c) 0x1000f))) (.bin (.bin (.leaf8 + 0x4b0000000000000000000100000000240000000001001e (h240 (h240 0x1000000000100000000020000 + 0x100000000410000000001000000000400000000020000) 0x10000000002000000000100000000040000000007001c) + 0x4000f 0x510000000000001d 0x20000000003000b 0x14 0x40010 0x10021) (.leaf8 0x4100000000020016 0x14 + 0x1000000000300000000430000000000001f (h240 0x1000000004300000000020000 + 0x10000000002000000000100000000040000000004001c) 0x4000f 0x60021 0x500000000010016 + 0x1000000003a001a)) (.bin (.leaf8 0x3a000000003a0016 0x20014 + 0x3000000000400000000000000000002000000003c0000000000001f 0x3c0009 0x10021 0x90000000034001a + 0x330016 0x16) (.leaf8 0x10000000031001a 0x600000000300016 0x2f000000002e001a 0x2d0016 0x2c0014 + 0x20010 0x10021 0x5000000002b001a)))) (.bin (.bin (.bin (.leaf8 0x2c000000002b0016 0x14 0x2e0010 + 0x10021 0x2a00000000000016 0xed0000000028001a 0x2700000000270016 0x1f0000000025001a) (.leaf8 + 0x2500000000250016 0x4a40000000022001a 0x500000000210016 0xa2000000001f001a 0x20000000001f0016 + 0x16 0x1735000000001c001a 0x1b000000001b0016)) (.bin (.leaf8 0x32c0000000019001a + 0x1900000000190016 0x90014 0x1b0010 0x10021 0x740a0000000016001a 0x1700000000160016 + 0xfe10000000013001a) (.leaf8 0x1400000000130016 0x14 0x160010 0x10021 0x1200000000000016 + 0x244360000000010001a 0x1100000000100016 0x30014))) (.bin (.bin (.leaf8 0x130010 0x10021 + 0xf00000000030016 0x4f66000000000d001a 0xc0016 0xb00000000010016 0xb5519000000000a001a 0x90016) + (.leaf8 0x800000000010016 0x18d060000000007001a 0x800000000070016 0x30014 0xa0010 0x10021 + 0x600000000030016 0x38a9760000000004001a)) (.bin (.leaf8 0x30016 0x20014 0x20010 0x10021 + 0x7c11d0000000001001a 0x100000000010016 0x14 0x20000000000000000000100000000030000000000001f) + (.leaf8 0x20023 0x2000d 0x200000000020000000001000007c11c000000000000000000010020 0x4000e + 0x200000000040000000001000000000200000000000000000000001e 0x100000000030023 + 0x200000000060000000001000038a975000000000100000000000020 + 0x20000000008000000000100000000080000000001001f))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 + (h240 0x1000000000900000000010000 0x100000000050000000001000000000a0000000004001c) 0xa000f + 0x2000000000a0000000001000000000a00000000020000000001001e 0x90023 0x9000d + 0x2000000000b00000000010000018d05000000000200000000010020 + 0x2000000000c0000000001000000000a0000000000001f 0x90023) (.leaf8 0x9000d + 0x2000000000d000000000100000000020000000005001f 0x100000000030023 + 0x2000000000f000000000100000b5518000000000300000000000020 + 0x200000000110000000001000000000d0000000000001f 0xc0023 0xc000d + 0x20000000012000000000100000000020000000007001f)) (.bin (.leaf8 0x100000000030023 + 0x2000000001400000000010000004f65000000000400000000000020 + 0x20000000016000000000100000000110000000001001f (h240 0x1000000001200000000010000 + 0x10000000005000000000100000000130000000004001c) 0x13000f + 0x200000000180000000001000000001300000000080000000001001e 0x120023 0x12000d) (.leaf8 + 0x2000000001900000000010000016d4d000000000500000000010020 + 0x2000000001a000000000100000000140000000005001f (h240 0x100000000000000 + 0x1000000001b0000000000000000001400000000040000000000001e) 0x130023 0x13000d + 0x1c0000000000000000d6e6000000000500000000010020 0x14000e (h240 0x10000 + 0x10000000002000000000100000000160000000003001c)))) (.bin (.bin (.leaf8 0x16000f + 0x1e00000000000000000016000000000a0000000001001e 0x150023 0x15000d + 0x1f00000000000000000fe0000000000600000000010020 0x2000000000000000000019000000000e001f 0x180023 + 0x18000d) (.leaf8 0x2100000000000000007409000000000700000000010020 0xb000e + 0x230000000000000000001b000000000f0000000000001e 0x1a0023 0x1a000d + 0x240000000000000000032b000000000800000000010020 0x250000000000000000001d0000000011001f + 0x1000000001e0023)) (.bin (.leaf8 0x2600000000000000001734000000000900000000000020 0x2000e + 0x10000000000000000000100000000210000000002001c 0x21000f + 0x2a0000000000000000002100000000130000000001001e 0x200023 0x20000d + 0x2b000000000000000000a1000000000a00000000010020) (.leaf8 0x2c000000000000000000070000000015001f + 0x100000000080023 0x2e000000000000000004a3000000000b00000000000020 + 0x30000000000000000000270000000018001f 0x260023 0x26000d + 0x310000000000000000001e000000000c00000000010020 0x32000000000000000000290000000019001f)))) (.bin + (.bin (.bin (.leaf8 0x1000000002a0023 0x33000000000000000000ec000000000d00000000000020 0x2c000e + (h240 0x10000 0x100000000020000000001000000002e0000000003001c) 0x2e000f + 0x370000000000000000002e000000001a0000000001001e 0x2d0023 0x2d000d) (.leaf8 + 0x3800000000000000000004000000000e00000000010020 0x2e000e + 0x3a00000000000000000002000000001c0000000000001e 0x100000000030023 + 0x3c0000000000000000002e000000000f00000000000020 0x3e00000000000000000008000000001f001f + 0x100000000090023 0x4000000000000000000000000000001000000000000020)) (.bin (.leaf8 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x430000000000000000000100000000200000000001001e 0x100000000020023 + 0x4500000000000000000008000000001100000000000020 0x5000e + 0x100000000050000000001000000003c0000000002001c) (.leaf8 0x3c000f + 0x490000000000000000003c00000000230000000001001e 0x3b0023 0x3b000d + 0x4a00000000000000000000000000001300000000010020 0x4b000000000000000000070000000000001f 0x60023 + 0x6000d))) (.bin (.bin (.leaf8 0x1000e (h240 (h240 0x20000 + 0x100000000020000000001000000004300000000020000) 0x10000000002000000000100000000030000000006001c) + 0xa00c6 0x10043 0x20142 0x101c3 0x30009 0x14) (.leaf8 0x40010 0x10021 0x200000000410016 0x14 + 0x40010 0x10021 0x800000000000016 0x3d000000003d0016)) (.bin (.leaf8 0x600000000030016 + 0x40000000037001a 0x360016 0x16 0x3500000000010016 0x90014 0x370010 0x10021) (.leaf8 + 0x170000000031001a 0x300016 0x2f00000000010016 0x2000000002e001a 0x2f000000002e0016 0x16 + 0x76000000002b001a 0x2c000000002b0016))))) (.bin (.bin (.bin (.bin (.leaf8 0x2a0014 0x2e0010 + 0x10021 0xf0000000028001a 0x2800000000280016 0x2510000000025001a 0x2600000000250016 0x80014) + (.leaf8 0x280010 0x10021 0x510000000022001a 0x200016 0x2100000000010016 0xb99000000001f001a + 0x20000000001f0016 0x1e0014)) (.bin (.leaf8 0x220010 0x10021 0x196000000001c001a 0xc000000001a0016 + 0x3a050000000019001a 0x1800000000180016 0x7f00000000016001a 0x200000000150016) (.leaf8 0x150014 + 0x40010 0x10021 0x1221b0000000013001a 0x500000000120016 0x120014 0x70010 0x10021))) (.bin (.bin + (.leaf8 0x27b20000000010001a 0x1100000000100016 0x30014 0x130010 0x10021 0xf000000000c0016 + 0x5aa8b000000000d001a 0xe000000000d0016) (.leaf8 0x30014 0x100010 0x10021 0xc00000000090016 + 0xc682000000000a001a 0xb000000000a0016 0x30016 0x1c54bb0000000007001a)) (.bin (.leaf8 0x60016 + 0x500000000010016 0x3e08e0000000004001a 0x400000000040016 0x8da7b30000000001001a 0x16 0x14 + 0x2000e) (.leaf8 0x10022 0x20000000002000000000100001362db000000000000000000000020 (h240 + 0x100000000000000 0x10000000005000000000000007a44d6000000000000000000010020) + 0x6000000000000000000060000000002001f 0x50023 0x5000d + 0x70000000000000003e08d000000000100000000010020 0x8000000000000000000070000000000001f)))) (.bin + (.bin (.bin (.leaf8 0x60023 0x6000d 0x9000000000000000000020000000003001f 0x100000000030023 + 0xb000000000000001c54ba000000000200000000000020 0xd000000000000000000020000000001001f (h240 + 0x10000 0x3000000000100000000000000000001000000000c0000000003001c) 0xc000f) (.leaf8 + 0xf0000000000000000000c00000000050000000001001e 0xb0023 0xb000d + 0x100000000000000000c681000000000300000000010020 0x110000000000000000000e0000000005001f (h240 + 0x1000000000f00000000010000 0x10000000005000000000100000000100000000004001c) 0x10000f + 0x130000000000000000001000000000060000000001001e)) (.bin (.leaf8 0xf0023 0xf000d + 0x140000000000000005aa8a000000000400000000010020 0x15000000000000000000110000000007001f (h240 + 0x1000000001200000000010000 0x10000000005000000000100000000130000000004001c) 0x13000f + 0x170000000000000000001300000000080000000001001e 0x120023) (.leaf8 0x12000d + 0x18000000000000000027b1000000000500000000010020 0x14000e + 0x1900000000000000000007000000000a0000000000001e 0x100000000080023 + 0x1b0000000000000001221a000000000600000000000020 0x17000e + 0x1d00000000000000000004000000000c0000000000001e))) (.bin (.bin (.leaf8 0x100000000050023 + 0x1f000000000000000007ef000000000700000000000020 0x210000000000000000001a000000000f001f + 0x1000000001b0023 0x2200000000000000003a04000000000800000000000020 + 0x240000000000000000000e0000000010001f 0x1000000000e0023 + 0x2600000000000000000195000000000900000000000020) (.leaf8 0x20000e + 0x280000000000000000002200000000130000000000001e 0x210023 0x21000d + 0x2900000000000000000b98000000000a00000000010020 0x2a000000000000000000230000000000001f 0x220023 + 0x22000d)) (.bin (.leaf8 0x2a000000000000000000020000000014001f 0x100000000020023 + 0x2c00000000000000000050000000000b00000000000020 0xa000e + 0x2f0000000000000000002800000000170000000000001e 0x270023 0x27000d + 0x3000000000000000000250000000000c00000000010020) (.leaf8 0x310000000000000000002a000000001a001f + 0x290023 0x29000d 0x320000000000000000000e000000000d00000000010020 0x2c000e + 0x330000000000000000002e000000001b0000000000001e 0x2d0023 0x2d000d)))))) (.bin (.bin (.bin (.bin + (.bin (.leaf8 0x3400000000000000000075000000000e00000000010020 0x2000e + 0x10000000000000000000100000000300000000002001c 0x30000f + 0x3700000000000000000030000000001d0000000001001e 0x2f0023 0x2f000d + 0x3800000000000000000001000000000f00000000010020) (.leaf8 0x39000000000000000000310000000000001f + 0x300023 0x30000d 0x3a00000000000000000002000000001f001f 0x100000000030023 + 0x3c00000000000000000016000000001000000000000020 0xb000e 0x360023)) (.bin (.leaf8 0x36000d 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x420000000000000000000100000000220000000001001e 0x100000000020023 + 0x4400000000000000000003000000001200000000000020 0x46000000000000000000080000000001001f) (.leaf8 + (h240 0x10000 0x9000000000100000000000000000001000000003e0000000003001c) 0x3e000f + 0x480000000000000000003e00000000270000000001001e 0x3d0023 0x3d000d 0xa000e (h240 0x10000 + 0x10000000002000000000100000000040000000003001c) 0x4000f))) (.bin (.bin (.leaf8 + 0x4c0000000000000000000400000000280000000001001e (h240 0x1000000000400000000020000 + 0x10000000002000000000100000000040000000004001c) 0x4000f 0x4f0000000000001d 0x20000000003000b 0x14 + 0x40010 0x10021) (.leaf8 0x200000000020016 0xb0014 0x40010 0x10021 0x3d0016 0x3c00000000070016 + 0x1000000003a001a 0x390016)) (.bin (.leaf8 0x16 0x3800000000010016 0x36000000000a0016 + 0xa0000000034001a 0x3500000000340016 0x30014 0x370010 0x10021) (.leaf8 0x3300000000300016 + 0x3100000000310016 0x30014 0x330010 0x10021 0x3b000000002e001a 0x2d000000002d0016 + 0x7000000002b001a)))) (.bin (.bin (.bin (.leaf8 0x2b000000002b0016 0x1280000000028001a + 0x2900000000280016 0x2700000000090016 0x270000000025001a 0x2600000000250016 0x14 0x280010) (.leaf8 + 0x10021 0x2400000000000016 0x5cc0000000022001a 0x2300000000220016 0xcb000000001f001a 0x1e0016 + 0xe0014 0x20010)) (.bin (.leaf8 0x10021 0x1d02000000001c001a 0x1b0016 0x3f80000000019001a 0x180016 + 0x1800000000030016 0x910d0000000016001a 0x150016) (.leaf8 0x1500000000060016 0x13d90000000013001a + 0x500000000120016 0x120014 0x70010 0x10021 0x2d5450000000010001a 0x1100000000100016))) (.bin (.bin + (.leaf8 0x30016 0x6341000000000d001a 0xd000000000d0016 0x30014 0xf0010 0x10021 + 0xe2a5d000000000a001a 0x90016) (.leaf8 0x800000000010016 0x1f0470000000007001a 0x600000000050016 + 0x46d3d80000000004001a 0x500000000040016 0x30014 0x70010 0x10021)) (.bin (.leaf8 + 0x9b16e0000000001001a 0x16 0x14 0x2000e 0x10022 + 0x200000000020000000001000009b16d000000000000000000000020 0x5000e + 0x200000000040000000001000000000700000000010000000000001e) (.leaf8 0x60023 0x6000d + 0x200000000050000000001000046d3d7000000000100000000010020 + 0x20000000006000000000100000000080000000002001f 0x100000000080023 + 0x200000000080000000001000001f046000000000200000000000020 + 0x2000000000a0000000001000000000a0000000000001f 0x90023))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x9000d 0x2000000000b000000000100000000020000000005001f 0x100000000030023 + 0x2000000000d000000000100000e2a5c000000000300000000000020 0x5000e + 0x200000000100000000001000000000f00000000070000000000001e 0xe0023 0xe000d) (.leaf8 + 0x2000000001100000000010000006340000000000400000000010020 + 0x20000000012000000000100000000020000000001001f (h240 0x10000 + 0x300000000010000000000000000000100000000120000000003001c) 0x12000f + 0x200000000140000000001000000001200000000090000000001001e 0x110023 0x11000d + 0x200000000150000000001000001c8a0000000000500000000010020)) (.bin (.leaf8 + 0x20000000016000000000100000000140000000000001f (h240 0x100000000000000 + 0x100000000170000000000000000001400000000090000000000001e) 0x130023 0x13000d + 0x1800000000000000010ca2000000000500000000010020 0x14000e + 0x1800000000000000000007000000000a0000000000001e 0x100000000080023) (.leaf8 + 0x1a000000000000000013d8000000000600000000000020 0x1c000000000000000000170000000003001f (h240 + 0x10000 0x1800000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1d00000000000000000001000000000c0000000001001e 0x100000000020023 + 0x1f0000000000000000910c000000000700000000000020 0x210000000000000000001a0000000001001f))) (.bin + (.bin (.leaf8 (h240 0x10000 0x1b00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x2200000000000000000001000000000e0000000001001e 0x100000000020023 + 0x24000000000000000003f7000000000800000000000020 0x26000000000000000000020000000011001f + 0x100000000030023 0x2800000000000000001d01000000000900000000000020) (.leaf8 0x10000e + 0x2b0000000000000000000200000000120000000000001e 0x100000000030023 + 0x2d000000000000000000ca000000000a00000000000020 0x2f000000000000000000250000000016001f 0x240023 + 0x24000d 0x30000000000000000005cb000000000b00000000010020)) (.bin (.leaf8 0x26000e (h240 0x10000 + 0x10000000002000000000100000000280000000003001c) 0x28000f + 0x330000000000000000002800000000160000000001001e 0x270023 0x27000d + 0x3400000000000000000026000000000c00000000010020 0x35000000000000000000290000000005001f) (.leaf8 + (h240 0x10000 0x2a000000000100000000000000000001000000002a0000000003001c) 0x2a000f + 0x360000000000000000002a00000000190000000001001e 0x290023 0x29000d + 0x3700000000000000000127000000000d00000000010020 0x380000000000000000002d000000001c001f + 0x2c0023)))) (.bin (.bin (.bin (.leaf8 0x2c000d 0x3900000000000000000006000000000e00000000010020 + 0x3a0000000000000000002f000000001d001f 0x100000000300023 + 0x3b0000000000000000003a000000000f00000000000020 0x5000e + 0x3e00000000000000000033000000001f0000000000001e 0x320023) (.leaf8 0x32000d + 0x3f00000000000000000035000000001f001f (h240 0x1000000003600000000010000 + 0x10000000005000000000100000000370000000004001c) 0x37000f + 0x420000000000000000003700000000200000000001001e 0x360023 0x36000d + 0x4300000000000000000009000000001100000000010020)) (.bin (.leaf8 + 0x44000000000000000000380000000006001f 0x370023 0x37000d 0x440000000000000000003a0000000000001f + 0x390023 0x39000d 0x2000e 0x10000000000000000000100000000010000000002001c) (.leaf8 0x1000f + 0x470000000000000000000100000000240000000001001e 0x100000000020023 + 0x4900000000000000000000000000001300000000000020 0x4a0000000000000000003e0000000004001f 0x3d0023 + 0x3d000d 0x4b000000000000000000020000000028001f))) (.bin (.bin (.leaf8 0x10023 0x1000d 0xd000e + (h240 0x1000000000400000000020000 0x10000000002000000000100000000040000000004001c) 0x4000f + 0x500000000000001d 0x20000000003000b 0x14) (.leaf8 0x40010 0x10021 0xe00000000020016 + 0x3f00000000010016 0x3c0016 0x16 0x3b00000000010016 0x50000000037001a)) (.bin (.leaf8 + 0x3800000000370016 0x30016 0x3400000000340016 0x3300000000040016 0x1c0000000031001a + 0x3200000000310016 0x300014 0x340010) (.leaf8 0x10021 0x3000000002e001a 0x2e000000002e0016 + 0x94000000002b001a 0x290016 0x140000000028001a 0x200000000270016 0x270014)))))))) (.bin (.bin + (.bin (.bin (.bin (.bin (.bin (.leaf8 0x40010 0x10021 0x2e60000000025001a 0x2400000000240016 + 0x640000000022001a 0x2300000000220016 0x30014 0x250010) (.leaf8 0x10021 0x21000000000f0016 + 0xe80000000001f001a 0x1e0016 0x1e00000000010016 0x1fb000000001c001a 0x1b0016 0x16)) (.bin (.leaf8 + 0x48860000000019001a 0x1a00000000190016 0x20014 + 0x18000000000400000000000000000002000000001c0000000000001f 0x1c0009 0x20021 0x9ec0000000016001a + 0x150016) (.leaf8 0x1500000000060016 0x16aa20000000013001a 0x1300000000130016 0x30014 0x150010 + 0x10021 0x31a00000000010001a 0x1000000000100016))) (.bin (.bin (.leaf8 0xf00000000040016 + 0x7152d000000000d001a 0xe000000000d0016 0x30014 0x100010 0x10021 0xc00000000090016 + 0xf822000000000a001a) (.leaf8 0xb000000000a0016 0x14 0xd0010 0x10021 0x900000000060016 + 0x2369eb0000000007001a 0x800000000070016 0x4d8b70000000004001a)) (.bin (.leaf8 0x30016 + 0xb1119d0000000001001a 0x200000000010016 0x14 0x20000000000000000000100000000040000000000001f + 0x30023 0x3000d 0x2000000000200000000010000183b83000000000000000000010020) (.leaf8 0x50010 0x40021 + 0x17 0x1d 0x103c3 (h240 0x183b86000000000300000000010000 + 0x50000183b840000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 + 0x200000000030000000000000098d617000000000000000000010020))))) (.bin (.bin (.bin (.leaf8 + 0x5000000000000000000020000000001001f 0x100000000030023 + 0x70000000000000004d8b6000000000100000000000020 0x90000000000000000000a0000000004001f 0x90023 + 0x9000d 0xa000000000000002369ea000000000200000000010020 0xb0000000000000000000b0000000003001f) + (.leaf8 (h240 0x1000000000c00000000010000 0x100000000020000000001000000000d0000000004001c) 0xd000f + 0xd0000000000000000000d00000000040000000001001e 0xc0023 0xc000d + 0xe0000000000000000f821000000000300000000010020 0xf0000000000000000000e0000000005001f (h240 + 0x1000000000f00000000010000 0x10000000005000000000100000000100000000004001c))) (.bin (.leaf8 + 0x10000f 0x110000000000000000001000000000060000000001001e 0xf0023 0xf000d + 0x120000000000000007152c000000000400000000010020 0x13000000000000000000110000000002001f 0x100023 + 0x10000d) (.leaf8 0x1300000000000000000012000000000a001f 0x110023 0x11000d + 0x140000000000000000319f000000000500000000010020 0x5000e + 0x1600000000000000000015000000000b0000000000001e 0x140023 0x14000d))) (.bin (.bin (.leaf8 + 0x1700000000000000016aa1000000000600000000010020 0x18000000000000000000170000000003001f (h240 + 0x10000 0x1800000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1900000000000000000001000000000c0000000001001e 0x100000000020023 + 0x1b000000000000000009eb000000000700000000000020 0x1a000e) (.leaf8 + 0x100000000050000000001000000001c0000000002001c 0x1c000f + 0x1e0000000000000000001c000000000d0000000001001e 0x1b0023 0x1b000d + 0x1f00000000000000004885000000000800000000010020 0x2000e + 0x10000000000000000000100000000010000000002001c)) (.bin (.leaf8 0x1000f + 0x220000000000000000000100000000100000000001001e 0x100000000020023 + 0x24000000000000000001fa000000000900000000000020 0x26000000000000000000200000000000001f 0x1f0023 + 0x1f000d 0x26000000000000000000020000000013001f) (.leaf8 0x100000000030023 + 0x2800000000000000000e7f000000000a00000000000020 0x2a000000000000000000230000000009001f (h240 + 0x1000000002400000000010000 0x10000000005000000000100000000250000000004001c) 0x25000f + 0x2c0000000000000000002500000000140000000001001e 0x240023 0x24000d))))) (.bin (.bin (.bin (.bin + (.leaf8 0x2d00000000000000000063000000000b00000000010020 0x2e000000000000000000260000000017001f + 0x100000000270023 0x2f000000000000000002e5000000000c00000000000020 0x29000e + 0x310000000000000000000400000000180000000000001e 0x100000000050023 + 0x3300000000000000000013000000000d00000000000020) (.leaf8 0x3500000000000000000002000000001a001f + 0x100000000020023 0x3700000000000000000093000000000e00000000000020 + 0x3900000000000000000030000000001e001f 0x2f0023 0x2f000d + 0x3a00000000000000000002000000000f00000000010020 0x32000e)) (.bin (.leaf8 + 0x3b00000000000000000034000000001f0000000000001e 0x330023 0x33000d + 0x3c0000000000000000001b000000001000000000010020 0x3d000000000000000000350000000002001f 0x340023 + 0x34000d 0x3d000000000000000000360000000022001f) (.leaf8 0x350023 0x35000d + 0x3e000000000000000000020000000001001f (h240 0x10000 + 0x300000000010000000000000000000100000000390000000003001c) 0x39000f + 0x400000000000000000003900000000230000000001001e 0x380023 0x38000d))) (.bin (.bin (.leaf8 + 0x4100000000000000000004000000001200000000010020 0x420000000000000000003d0000000000001f 0x3c0023 + 0x3c000d 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x450000000000000000000100000000260000000001001e) (.leaf8 (h240 0x10000 + 0x200000000010000000000000000000100000000400000000003001c) 0x40000f 0x470000000000001d 0x3f0023 + 0x3f000d 0x48000000000000000000100000000000001f (h240 0x1000000001000000000020000 + 0x10000000002000000000100000000040000000004001c) 0x4000f)) (.bin (.leaf8 0x4b0000000000001d + 0x20000000003000b 0x14 0x40010 0x10021 0x41000000000e0016 0x20014 + 0x300000000040000000000000000000200000000430000000000001f) (.leaf8 0x430009 0x10021 + 0x3c000000003c0016 0x2000000003a001a 0x380016 0x3700000000010016 0xe0000000034001a + 0x3500000000340016)))) (.bin (.bin (.bin (.leaf8 0x20000000031001a 0x30000000002f0016 + 0x49000000002e001a 0x2d0016 0x20014 0x20010 0x10021 0x9000000002b001a) (.leaf8 0x2c000000002b0016 + 0x50014 0x2e0010 0x10021 0x1730000000028001a 0x270016 0x320000000025001a 0x2600000000250016)) + (.bin (.leaf8 0x30016 0x7400000000022001a 0x210016 0x2100000000010016 0xfd000000001f001a 0x1e0016 + 0x16 0x1e00000000010016) (.leaf8 0x2442000000001c001a 0x1d000000001c0016 0x1b00000000030016 + 0x4f50000000019001a 0x1a00000000190016 0x20014 + 0x18000000000400000000000000000002000000001c0000000000001f 0x1c0009))) (.bin (.bin (.leaf8 0x20021 + 0xb5510000000016001a 0x600000000140016 0x18d00000000013001a 0x1200000000110016 + 0x38a960000000010001a 0x1100000000100016 0x30016) (.leaf8 0x7c11000000000d001a 0xe000000000d0016 + 0x16 0x11b4f6000000000a001a 0x900000000090016 0x26c5a0000000007001a 0x800000000070016 0x30014)) + (.bin (.leaf8 0xa0010 0x10021 0x5888ce0000000004001a 0x500000000040016 0xc1dc30000000001001a + 0x3001d 0x10000000001000000000100000c1dc2000000000000000000000020 + 0x20000000005000000000100000000070000000002001f) (.leaf8 0x60023 0x6000d + 0x20000000006000000000100005888cd000000000100000000010020 0x5000e + 0x200000000080000000001000000000a00000000030000000000001e 0x90023 0x9000d + 0x2000000000900000000010000026c59000000000200000000010020)))))) (.bin (.bin (.bin (.bin (.bin + (.leaf8 0x2000000000a0000000001000000000b0000000005001f 0x1000000000c0023 + 0x2000000000b0000000001000011b4f5000000000300000000000020 0x2000e + 0x100000000000000000001000000000f0000000002001c 0xf000f + 0x2000000000f0000000001000000000f00000000070000000001001e 0xe0023) (.leaf8 0xe000d + 0x2000000001000000000010000007c10000000000400000000010020 + 0x20000000011000000000100000000020000000001001f (h240 0x10000 + 0x300000000010000000000000000000100000000120000000003001c) 0x12000f + 0x200000000130000000001000000001200000000090000000001001e 0x110023 0x11000d)) (.bin (.leaf8 + 0x2000000001400000000010000023ac6000000000500000000010020 + 0x20000000015000000000100000000140000000002001f 0x140009 0x160021 0x17 0x1d 0x103c3 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 0x1baabf5000000000300000000010000 + 0x2000000000200000000000000000001000000000500000c1dc20000) + 0x60000000001000000000800005888ce000000000900000000010000) + 0x60000000001000000000b0000026c5b000000000c00000000010000) + 0x1000000000e000011b4f5000000000f00000000010000) + 0x300000000010000000000000000000100000000100000007c110000) + 0x12000000000100000000030000000001000000000000000000010000) + 0x130000023ac70000000015000000000100000000140000000016001c)) (.leaf8 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000150000000000000000001400000000050000000001001e) + 0x130023 0x13000d 0x1700000000000000014fcd000000000500000000010020 + 0x1700000000000000000014000000000a001f 0x100000000140023 + 0x19000000000000000018cf000000000600000000000020))) (.bin (.bin (.leaf8 + 0x1b00000000000000000008000000000c001f 0x100000000080023 + 0x1d0000000000000000b550000000000700000000000020 0x1a000e + 0x100000000050000000001000000001c0000000002001c 0x1c000f + 0x200000000000000000001c000000000d0000000001001e 0x1b0023) (.leaf8 0x1b000d + 0x21000000000000000004f4000000000800000000010020 0x220000000000000000001d0000000001001f (h240 + 0x10000 0x1e000000000100000000000000000001000000001e0000000003001c) 0x1e000f + 0x230000000000000000001e00000000110000000001001e 0x1d0023 0x1d000d)) (.bin (.leaf8 + 0x2400000000000000002441000000000900000000010020 0x25000000000000000000200000000000001f 0x1f0023 + 0x1f000d 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x270000000000000000000100000000120000000001001e) (.leaf8 0x100000000020023 + 0x29000000000000000000fc000000000a00000000000020 0x2b000000000000000000230000000000001f 0x220023 + 0x22000d 0x2b000000000000000000020000000015001f 0x100000000030023 + 0x2d0000000000000000073f000000000b00000000000020)))) (.bin (.bin (.bin (.leaf8 + 0x2f000000000000000000020000000001001f (h240 0x10000 + 0x300000000010000000000000000000100000000270000000003001c) 0x27000f + 0x310000000000000000002700000000170000000001001e 0x260023 0x26000d + 0x3200000000000000000031000000000c00000000010020 0x33000000000000000000020000000019001f) (.leaf8 + 0x100000000030023 0x3500000000000000000172000000000d00000000000020 0x7000e + 0x380000000000000000002e000000001b0000000000001e 0x2d0023 0x2d000d + 0x3900000000000000000008000000000e00000000010020 0x4000e)) (.bin (.leaf8 + 0x3b00000000000000000002000000001c0000000000001e 0x100000000030023 + 0x3d00000000000000000048000000000f00000000000020 0x3f00000000000000000032000000001e001f + 0x100000000320023 0x4100000000000000000001000000001000000000000020 + 0x43000000000000000000370000000022001f 0x360023) (.leaf8 0x36000d + 0x440000000000000000000d000000001100000000010020 0x45000000000000000000390000000000001f 0x380023 + 0x38000d 0x46000000000000000000020000000024001f 0x100000000020023 + 0x4800000000000000000001000000001300000000000020))) (.bin (.bin (.leaf8 + 0x4a0000000000000000003e0000000027001f (h240 0x1000000003f00000000010000 + 0x20000000005000000000100000000430000000004001c) 0x43000f + 0x4c0000000000000000004300000000050000000001001e (h240 0x1000000004300000000020000 + 0x10000000002000000000100000000040000000004001c) 0x4000f 0x4f0000000000001d 0x20000000003000b) + (.leaf8 0x14 0x40010 0x10021 0x500000000410016 0x30016 0x1000000003d001a 0x3c0016 0x20014)) (.bin + (.leaf8 0x20010 0x10021 0x3900000000380016 0x60000000037001a 0x3800000000370016 0x3500000000340016 + 0x14 0x370010) (.leaf8 0x10021 0x3300000000300016 0x230000000031001a 0x3200000000310016 0x30014 + 0x340010 0x10021 0x3000000000030016))))) (.bin (.bin (.bin (.bin (.leaf8 0x4000000002e001a + 0x8000000002d0016 0xb9000000002b001a 0x2a0016 0x2a00000000010016 0x180000000028001a + 0x2800000000280016 0x30014) (.leaf8 0x2a0010 0x10021 0x39f0000000025001a 0x2600000000250016 + 0x30014 0x280010 0x10021 0x7e0000000022001a)) (.bin (.leaf8 0x2300000000220016 0x20014 + 0x300000000040000000000000000000200000000250000000000001f 0x250009 0x10021 0x1221000000001f001a + 0x1f000000001f0016 0x1e0014) (.leaf8 0x210010 0x10021 0x27a000000001c001a 0x1d000000001c0016 + 0x1b00000000030016 0x5aa80000000019001a 0x180016 0x80014))) (.bin (.bin (.leaf8 0x20010 0x10021 + 0xc670000000016001a 0x1700000000160016 0x14 0x190010 0x10021 0x1500000000120016) (.leaf8 + 0x1c54a0000000013001a 0x1300000000130016 0x30014 0x150010 0x10021 0x3e080000000010001a + 0x1000000000100016 0x30014)) (.bin (.leaf8 0x120010 0x10021 0x8da7a000000000d001a + 0xe000000000d0016 0xc0014 0x100010 0x10021 0x1362d000000000a001a) (.leaf8 0x600000000090016 + 0x2c44670000000007001a 0x600000000060016 0x60ee00000000004001a 0x500000000040016 0x14 0x70010 + 0x10021)))) (.bin (.bin (.bin (.leaf8 0x300000000000016 0xdd55fa0000000001001a 0x3001d + 0x10000000001000000000100001e4aa2000000000000000000000020 0x50010 0x60021 0x17 0x1d) (.leaf8 + 0x103c3 (h240 (h240 0x1e4aa30000 0x3000000000100000000020000000002000000000000000000010000) + 0x500001e4aa20000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000500000000000000bf0b55000000000000000000010020) + 0x5000e (h240 0x10000 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x90000000000000000000700000000000000000001001e)) (.bin (.leaf8 0x60023 0x6000d + 0xa00000000000000060edf000000000100000000010020 0xb000000000000000000080000000003001f + 0x100000000090023 0xc000000000000002c4466000000000200000000000020 + 0xe000000000000000000080000000005001f 0x100000000090023) (.leaf8 + 0x100000000000000001362c000000000300000000000020 0xe000e + 0x120000000000000000001000000000070000000000001e 0xf0023 0xf000d + 0x130000000000000008da79000000000400000000010020 0x5000e + 0x150000000000000000001200000000090000000000001e))) (.bin (.bin (.leaf8 0x110023 0x11000d + 0x1600000000000000003e07000000000500000000010020 0x5000e + 0x1800000000000000000015000000000b0000000000001e 0x140023 0x14000d + 0x190000000000000001c549000000000600000000010020) (.leaf8 0x1a00000000000000000017000000000b001f + (h240 0x1000000001800000000010000 0x10000000002000000000100000000190000000004001c) 0x19000f + 0x1c00000000000000000019000000000c0000000001001e 0x180023 0x18000d + 0x1d00000000000000000c66000000000700000000010020 0xa000e)) (.bin (.leaf8 + 0x1f00000000000000000002000000000e0000000000001e 0x100000000030023 + 0x2100000000000000005aa7000000000800000000000020 0x230000000000000000001d0000000001001f (h240 + 0x10000 0x1e000000000100000000000000000001000000001e0000000003001c) 0x1e000f + 0x240000000000000000001e00000000110000000001001e 0x1d0023) (.leaf8 0x1d000d + 0x2500000000000000000279000000000900000000010020 0x20000e + 0x260000000000000000002100000000130000000000001e 0x200023 0x20000d + 0x2700000000000000001220000000000a00000000010020 0x5000e))))))) (.bin (.bin (.bin (.bin (.bin + (.bin (.leaf8 0x10000000005000000000100000000250000000002001c 0x25000f + 0x2a0000000000000000002500000000130000000001001e 0x240023 0x24000d + 0x2b0000000000000000007d000000000b00000000010020 0x5000e + 0x2d0000000000000000002800000000170000000000001e) (.leaf8 0x270023 0x27000d + 0x2e0000000000000000039e000000000c00000000010020 0x5000e + 0x300000000000000000002a00000000190000000000001e 0x290023 0x29000d + 0x3100000000000000000017000000000d00000000010020)) (.bin (.leaf8 + 0x320000000000000000002c0000000000001f 0x2b0023 0x2b000d 0x3200000000000000000002000000001b001f + 0x100000000030023 0x34000000000000000000b8000000000e00000000000020 + 0x360000000000000000000a000000001d001f 0x1000000000b0023) (.leaf8 + 0x3800000000000000000003000000000f00000000000020 0x3a000000000000000000320000000001001f (h240 + 0x1000000003300000000010000 0x10000000005000000000100000000340000000004001c) 0x34000f + 0x3c00000000000000000034000000001e0000000001001e 0x330023 0x33000d + 0x3d00000000000000000022000000001000000000010020))) (.bin (.bin (.leaf8 + 0x3e00000000000000000035000000001f001f (h240 0x1000000003600000000010000 + 0x10000000002000000000100000000370000000004001c) 0x37000f + 0x400000000000000000003700000000200000000001001e 0x360023 0x36000d + 0x410000000000000000003a0000000024001f 0x390023) (.leaf8 0x39000d + 0x4200000000000000000005000000001200000000010020 0x430000000000000000003b0000000024001f (h240 + 0x1000000003b00000000020000 0x10000000004000000000100000000020000000004001c) 0x2000f + 0x460000000000000000000200000000250000000001001e 0x100000000030023 + 0x4800000000000000000000000000001400000000000020)) (.bin (.leaf8 + 0x49000000000000000000020000000001001f (h240 0x10000 + 0x300000000010000000000000000000100000000060000000003001c) 0x6000f + 0x4b0000000000000000000600000000290000000001001e (h240 0x1000000000600000000020000 + 0x10000000002000000000100000000040000000004001c) 0x4000f 0x4e0000000000001d 0x20000000003000b) + (.leaf8 0x14 0x40010 0x10021 0x40016 0x4100000000010016 0x30014 0x430010 0x10021)))) (.bin (.bin + (.bin (.leaf8 0x20016 0x3b0014 0x20010 0x10021 0x3000000003a001a 0x3800000000390016 0x16 + 0x120000000034001a) (.leaf8 0x500000000330016 0x330014 0x70010 0x10021 0x10000000031001a + 0x3200000000310016 0xb0014 0x340010)) (.bin (.leaf8 0x10021 0x5c000000002e001a 0x2d0016 + 0x2d00000000010016 0xc000000002b001a 0x600000000290016 0x1cf0000000028001a 0x2900000000280016) + (.leaf8 0x2700000000040016 0x3e0000000025001a 0x2600000000250016 0x600000000030016 + 0x9100000000022001a 0x2200000000220016 0x13d000000001f001a 0x1f000000001f0016))) (.bin (.bin + (.leaf8 0x1e0014 0x210010 0x10021 0x2d53000000001c001a 0x1d000000001c0016 0x30014 0x1f0010 + 0x10021) (.leaf8 0x1b00000000090016 0x6330000000019001a 0x200000000180016 0x180014 0x40010 0x10021 + 0xe2a50000000016001a 0x600000000140016)) (.bin (.leaf8 0x1f040000000013001a 0x600000000110016 + 0x46d3d0000000010001a 0xf000000000f0016 0x9b16000000000d001a 0xc0016 0xc00000000070016 + 0x162232000000000a001a) (.leaf8 0xb000000000a0016 0x90014 0xd0010 0x10021 0x307700000000007001a + 0x200000000060016 0x60014 0x40010))))) (.bin (.bin (.bin (.bin (.leaf8 0x10021 + 0x6eaafc0000000004001a 0x500000000040016 0x14 0x70010 0x10021 0x300000000000016 + 0xf25510000000001001a) (.leaf8 0x3001d 0x10000000001000000000100000f2550000000000000000000000020 + 0x5000e (h240 0x10000 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x200000000070000000001000000000700000000000000000001001e 0x60023 0x6000d)) (.bin (.leaf8 + 0x20000000008000000000100006eaafb000000000100000000010020 0x8000e + 0x200000000090000000001000000000400000000020000000000001e 0x100000000050023 + 0x2000000000b0000000001000003076f000000000200000000000020 0xb000e + 0x2000000000d0000000001000000000d00000000050000000000001e 0xc0023) (.leaf8 0xc000d + 0x2000000000e00000000010000162231000000000300000000010020 + 0x2000000000f0000000001000000000e0000000004001f 0xd0023 0xd000d + 0x2000000000f000000000100000000020000000007001f 0x100000000030023 + 0x2000000001100000000010000009b15000000000400000000000020))) (.bin (.bin (.leaf8 + 0x20000000013000000000100000000110000000009001f 0x100000000120023 + 0x200000000140000000001000002c977000000000500000000000020 + 0x20000000016000000000100000000140000000005001f 0x140009 0x170021 0x17 0x1d) (.leaf8 0x103c3 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 0x22956e900000000030000000001000000000200000000020000 + 0x1000000000500000f2551000000000600000000010000) 0x100000000020000000001000000000800006eaafd0000) + 0x9000000000100000000050000000001000000000000000000010000) + 0xb0000030770000000000c0000000001000000000e00001622330000) + 0xf000000000100000000030000000001000000000000000000010000) + 0x110000009b1600000000120000000001000000000000000000010000) + 0x14000002c9770000000015000000000100000000140000000017001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000160000000000000000001400000000020000000001001e) + 0x130023 0x13000d 0x180000000000000001a3c3000000000500000000010020 + 0x1800000000000000000008000000000a001f)) (.bin (.leaf8 0x100000000080023 + 0x1a00000000000000001f03000000000600000000000020 0x1c00000000000000000008000000000c001f + 0x100000000080023 0x1e0000000000000000e2a4000000000700000000000020 0x1a000e + 0x2000000000000000000004000000000e0000000000001e 0x100000000050023) (.leaf8 + 0x2200000000000000000632000000000800000000000020 0x240000000000000000001d0000000005001f (h240 + 0x1000000001e00000000010000 0x100000000050000000001000000001f0000000004001c) 0x1f000f + 0x260000000000000000001f00000000100000000001001e 0x1e0023 0x1e000d + 0x2700000000000000002d52000000000900000000010020)))) (.bin (.bin (.bin (.leaf8 0x20000e + 0x280000000000000000002100000000130000000000001e 0x200023 0x20000d + 0x290000000000000000013c000000000a00000000010020 0x2a000000000000000000240000000016001f 0x230023 + 0x23000d) (.leaf8 0x2b0000000000000000090f000000000b00000000010020 + 0x2c000000000000000000080000000001001f (h240 0x10000 + 0x900000000010000000000000000000100000000270000000003001c) 0x27000f + 0x2e0000000000000000002700000000170000000001001e 0x260023 0x26000d + 0x2f0000000000000000003d000000000c00000000010020)) (.bin (.leaf8 + 0x30000000000000000000290000000002001f 0x280023 0x28000d 0x300000000000000000002b000000001a001f + 0x2a0023 0x2a000d 0x31000000000000000001ce000000000d00000000010020 + 0x3200000000000000000008000000001a001f) (.leaf8 0x100000000080023 + 0x340000000000000000000b000000000e00000000000020 0x360000000000000000002f0000000000001f 0x2e0023 + 0x2e000d 0x3600000000000000000002000000001d001f 0x100000000030023 + 0x380000000000000000005b000000000f00000000000020))) (.bin (.bin (.leaf8 0xd000e + 0x3b00000000000000000034000000001f0000000000001e 0x330023 0x33000d + 0x3c00000000000000000000000000001000000000010020 0x35000e + 0x3d0000000000000000000700000000200000000000001e 0x100000000080023) (.leaf8 + 0x3f00000000000000000011000000001100000000000020 0x2000e + 0x10000000000000000000100000000390000000002001c 0x39000f + 0x430000000000000000003900000000240000000001001e 0x1000000003a0023 + 0x4500000000000000000002000000001300000000000020 0x3d000e)) (.bin (.leaf8 (h240 + 0x1000000000200000000020000 0x10000000005000000000100000000420000000004001c) 0x42000d + 0x4c000000000000000000020000000002001f 0x10023 0x1000d 0x2000e + 0x4d0000000000000000000400000000000000000000001e 0x30000000003000b) (.leaf8 0x4400000000010016 + 0x30016 0x20014 0x20010 0x10021 0x3f000000003c0016 0x3e000000003d0016 0x3a0014)))))) (.bin (.bin + (.bin (.bin (.bin (.leaf8 0x3000000003c0000000000000000000200000000400000000000001f 0x400009 + 0x20021 0x80000000037001a 0x3800000000370016 0x80014 0x3a0010 0x10021) (.leaf8 0x10000000034001a + 0xe00000000330016 0x2d0000000031001a 0x3200000000310016 0x30014 0x340010 0x10021 + 0x6000000002e001a)) (.bin (.leaf8 0x2d0016 0x80014 0x20010 0x10021 0xe7000000002b001a + 0x2c000000002b0016 0x1f0000000028001a 0x2800000000280016) (.leaf8 0x90014 0x2a0010 0x10021 + 0x4880000000025001a 0x2400000000230016 0x9e0000000022001a 0x2100000000200016 + 0x16a9000000001f001a))) (.bin (.bin (.leaf8 0x20000000001f0016 0x30016 0x319000000001c001a + 0x1d000000001c0016 0x50014 0x1f0010 0x10021 0x71520000000019001a) (.leaf8 0x1a00000000190016 0x14 + 0x1c0010 0x10021 0x1800000000060016 0xf810000000016001a 0x150016 0x80014)) (.bin (.leaf8 0x20010 + 0x10021 0x2369e0000000013001a 0x120016 0x4d8b0000000010001a 0xf0016 0xf00000000010016 + 0xb1119000000000d001a) (.leaf8 0xc000000000c0016 0x183b7000000000a001a 0xb000000000a0016 0x50014 + 0xd0010 0x10021 0x37557e0000000007001a 0x800000000070016)))) (.bin (.bin (.bin (.leaf8 0x16 + 0x792a80000000004001a 0x500000000040016 0x14 0x70010 0x10021 0x300000000000016 + 0x114ab740000000001001a) (.leaf8 0x3001d 0x100000000010000000001000025dd02000000000000000000000020 + 0x50010 0x60021 0x17 0x1d 0x103c3 (h240 (h240 0x25dd030000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x5000025dd020000000006000000000100000000040000000006001c))) (.bin (.leaf8 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000500000000000000eece6f000000000000000000010020) + 0x5000e (h240 0x10000 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x90000000000000000000700000000000000000001001e 0x60023 0x6000d) (.leaf8 + 0xa000000000000000792a7000000000100000000010020 0x2000e + 0x10000000000000000000100000000090000000002001c 0x9000f + 0xd0000000000000000000900000000030000000001001e 0x80023 0x8000d + 0xe0000000000000037557d000000000200000000010020))) (.bin (.bin (.leaf8 0x7000e + 0x100000000000000000000d00000000050000000000001e 0xc0023 0xc000d + 0x11000000000000000183b6000000000300000000010020 0x120000000000000000000e0000000007001f + 0x1000000000f0023 0x13000000000000000b1118000000000400000000000020) (.leaf8 + 0x15000000000000000000110000000000001f 0x100023 0x10000d 0x15000000000000000000020000000009001f + 0x100000000030023 0x1700000000000000004d8a000000000500000000000020 + 0x1900000000000000000002000000000b001f 0x100000000030023)) (.bin (.leaf8 + 0x1b0000000000000002369d000000000600000000000020 0xa000e + 0x1e00000000000000000002000000000c0000000000001e 0x100000000030023 + 0x2000000000000000000f80000000000700000000000020 0x220000000000000000001a0000000003001f (h240 + 0x1000000001b00000000010000 0x100000000020000000001000000001c0000000004001c) 0x1c000f) (.leaf8 + 0x240000000000000000001c000000000e0000000001001e 0x1b0023 0x1b000d + 0x2500000000000000007151000000000800000000010020 0x7000e + 0x270000000000000000001f00000000110000000000001e 0x1e0023 0x1e000d))))) (.bin (.bin (.bin (.bin + (.leaf8 0x2800000000000000000318000000000900000000010020 0x29000000000000000000020000000001001f + (h240 0x10000 0x300000000010000000000000000000100000000210000000003001c) 0x21000f + 0x2b0000000000000000002100000000130000000001001e 0x200023 0x20000d + 0x2c000000000000000016a8000000000a00000000010020) (.leaf8 0x2d000000000000000000230000000014001f + 0x100000000230023 0x2f0000000000000000009d000000000b00000000000020 + 0x31000000000000000000260000000016001f 0x100000000260023 + 0x3300000000000000000487000000000c00000000000020 0xb000e + 0x360000000000000000002a00000000190000000000001e)) (.bin (.leaf8 0x290023 0x29000d + 0x370000000000000000001e000000000d00000000010020 0x380000000000000000002e000000001c001f 0x2d0023 + 0x2d000d 0x39000000000000000000e6000000000e00000000010020 0xa000e) (.leaf8 + 0x3b00000000000000000002000000001c0000000000001e 0x100000000030023 + 0x3d00000000000000000005000000000f00000000000020 0x5000e + 0x4000000000000000000034000000001f0000000000001e 0x330023 0x33000d + 0x410000000000000000002c000000001000000000010020))) (.bin (.bin (.leaf8 + 0x42000000000000000000100000000021001f 0x100000000110023 + 0x4400000000000000000000000000001100000000000020 0xa000e + 0x460000000000000000003a00000000230000000000001e 0x390023 0x39000d + 0x4700000000000000000007000000001200000000010020) (.leaf8 0x5000e + 0x1000000003d000000000100000000400000000002001c 0x40000f + 0x4a0000000000000000004000000000250000000001001e 0x3f0023 0x3f000d + 0x4b000000000000000000410000000027001f (h240 0x1000000004200000000010000 + 0x10000000004000000000100000000020000000004001c))) (.bin (.leaf8 0x2000f 0x4e0000000000001d (h240 + 0x10000 0x300000000010000000000000000000100000000450000000003001c) 0x45000f 0x500000000000001d + 0x440023 0x44000d 0x51000000000000000000050000000001001f) (.leaf8 0x460000000004000b 0x30014 + 0x480010 0x10021 0x20016 0x4100000000400016 0x6000000003b0016 0x4000000003a001a)))) (.bin (.bin + (.bin (.leaf8 0xb00000000390016 0x360016 0x36000000000f0016 0x160000000034001a 0x600000000330016 + 0x20000000031001a 0x3200000000310016 0x30014) (.leaf8 0x340010 0x10021 0x3000000000090016 + 0x73000000002e001a 0x2d000000002d0016 0xf000000002b001a 0xc00000000290016 0x2430000000028001a)) + (.bin (.leaf8 0x2900000000280016 0x14 0x2b0010 0x10021 0x2700000000240016 0x4e0000000025001a + 0x240016 0x230014) (.leaf8 0x20010 0x10021 0xb540000000022001a 0x2200000000220016 0x30014 0x240010 + 0x10021 0x18c000000001f001a))) (.bin (.bin (.leaf8 0x20000000001f0016 0x1e00000000060016 + 0x38a8000000001c001a 0x1d000000001c0016 0x16 0x7c00000000019001a 0x1a00000000190016 0x30014) + (.leaf8 0x1c0010 0x10021 0x1800000000090016 0x11b4e0000000016001a 0x150016 0x1500000000010016 + 0x26c40000000013001a 0x1400000000130016)) (.bin (.leaf8 0x30014 0x160010 0x10021 + 0x5888c0000000010001a 0x1100000000100016 0xf0014 0x130010 0x10021) (.leaf8 0xc1db000000000d001a + 0xe000000000d0016 0xc00000000060016 0x1baabe000000000a001a 0xa000000000a0016 0x30014 0xc0010 + 0x10021)))))))))) + +set_option maxRecDepth 20000 in +def st_4 : CertTree := + (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x3c9540000000007001a + 0x200000000060016 0x60014 0x40010 0x10021 0x8a55b90000000004001a 0x500000000040016 0x14) (.leaf8 + 0x70010 0x10021 0x300000000000016 0x12ee810000000001001a 0x3001d + 0x100000000010000000001000012ee80000000000000000000000020 0x5000e (h240 0x10000 + 0x10000000002000000000100000000070000000003001c))) (.bin (.leaf8 0x7000f + 0x200000000070000000001000000000700000000000000000001001e 0x60023 0x6000d + 0x20000000008000000000100008a55b8000000000100000000010020 0x8000e + 0x200000000090000000001000000000400000000020000000000001e 0x100000000050023) (.leaf8 + 0x2000000000b0000000001000003c953000000000200000000000020 0x5000e + 0x2000000000e0000000001000000000c00000000050000000000001e 0xb0023 0xb000d + 0x2000000000f000000000100001baabd000000000300000000010020 + 0x200000000100000000001000000000e0000000003001f (h240 0x10000 + 0xf000000000100000000000000000001000000000f0000000003001c)))) (.bin (.bin (.leaf8 0xf000f + 0x200000000110000000001000000000f00000000070000000001001e 0xe0023 0xe000d + 0x200000000120000000001000000c1da000000000400000000010020 0x11000e + 0x200000000130000000001000000001300000000090000000000001e 0x120023) (.leaf8 0x12000d + 0x2000000001400000000010000037bdd000000000500000000010020 + 0x20000000015000000000100000000140000000001001f 0x140009 0x160021 0x17 0x1d 0x103c3)) (.bin + (.leaf8 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x2b3ace3000000000300000000010000 + 0x20000000002000000000000000000010000000005000012ee810000) + 0x6000000000100000000000000000001000000000200000000010000) + 0x800008a55ba00000000090000000001000000000500000000010000) + 0x1000000000b000003c953000000000c00000000010000) + 0x60000000001000000000d00001baabf000000000f00000000010000) + 0x10000000010000000c1dc000000001200000000010000) + 0x140000037bde0000000015000000000100000000140000000016001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000150000000000000000001400000000060000000001001e) + 0x130023 0x13000d 0x1700000000000000020cac000000000500000000010020 0x5000e + 0x1800000000000000000016000000000b0000000000001e) (.leaf8 0x150023 0x15000d + 0x19000000000000000026c3000000000600000000010020 0x1a000000000000000000170000000000001f 0x160023 + 0x16000d 0x1a00000000000000000002000000000d001f 0x100000000030023)))) (.bin (.bin (.bin (.leaf8 + 0x1c00000000000000011b4d000000000700000000000020 0x1e0000000000000000001a0000000005001f (h240 + 0x1000000001b00000000010000 0x100000000050000000001000000001c0000000004001c) 0x1c000f + 0x200000000000000000001c000000000e0000000001001e 0x1b0023 0x1b000d + 0x21000000000000000007bf000000000800000000010020) (.leaf8 0x2000e + 0x100000000000000000001000000001e0000000002001c 0x1e000f + 0x240000000000000000001e00000000110000000001001e 0x1d0023 0x1d000d + 0x25000000000000000038a7000000000900000000010020 0x26000000000000000000200000000003001f)) (.bin + (.leaf8 (h240 0x10000 0x2100000000010000000000000000000100000000210000000003001c) 0x21000f + 0x270000000000000000002100000000130000000001001e 0x200023 0x20000d + 0x280000000000000000018b000000000a00000000010020 0x5000e + 0x2a0000000000000000002400000000150000000000001e) (.leaf8 0x230023 0x23000d + 0x2b00000000000000000b53000000000b00000000010020 0x25000e + 0x2d0000000000000000000200000000160000000000001e 0x100000000030023 + 0x2f0000000000000000004d000000000c00000000000020 0x31000000000000000000290000000017001f))) (.bin + (.bin (.leaf8 (h240 0x1000000002a00000000010000 0x100000000020000000001000000002b0000000004001c) + 0x2b000f 0x330000000000000000002b00000000180000000001001e 0x2a0023 0x2a000d + 0x3400000000000000000242000000000d00000000010020 0x350000000000000000000e000000001a001f + 0x1000000000e0023) (.leaf8 0x370000000000000000000e000000000e00000000000020 + 0x390000000000000000002f000000001d001f 0x100000000300023 + 0x3a00000000000000000072000000000f00000000000020 0x3c000000000000000000320000000005001f (h240 + 0x1000000003300000000010000 0x10000000005000000000100000000340000000004001c) 0x34000f + 0x3e00000000000000000034000000001e0000000001001e)) (.bin (.leaf8 0x330023 0x33000d + 0x3f00000000000000000001000000001000000000010020 0x40000000000000000000080000000021001f + 0x100000000090023 0x4200000000000000000015000000001100000000000020 + 0x44000000000000000000380000000009001f (h240 0x10000 + 0x3900000000010000000000000000000100000000010000000003001c)) (.leaf8 0x1000f + 0x450000000000000000000100000000220000000001001e (h240 0x10000 + 0x2000000000100000000000000000001000000000c0000000003001c) 0xc000f + 0x470000000000000000000c00000000240000000001001e 0x1000000000d0023 + 0x4900000000000000000003000000001300000000000020 0x4b000000000000000000080000000026001f))))) (.bin + (.bin (.bin (.bin (.leaf8 (h240 0x10000 0x800000000020000000000000000000100000000420000000003001c) + 0x42000f 0x4d0000000000000000004200000000290000000001001e 0x410023 0x41000d + 0x4e000000000000000000020000000000001f (h240 0x1000000000200000000020000 + 0x10000000005000000000100000000480000000004001c) 0x48000f) (.leaf8 0x510000000000001d 0x48000a + 0x50008 0x600000000000000000001000000000100000000000000000000001e 0x10009 0x20021 + 0x4300000000000016 0x14)) (.bin (.leaf8 0x45000e (h240 0x1000000000000000000010000 + 0x200000000010000000007000000000100000000010000000004001c) 0x1000f 0x50021 0x3f00000000060016 + 0x1000000003d001a 0x3c0016 0xb0016) (.leaf8 0x16 0xb0000000037001a 0x360016 0x3600000000070016 + 0x3500000000340016 0x30016 0x390000000031001a 0x3200000000310016))) (.bin (.bin (.leaf8 0x300014 + 0x340010 0x10021 0x7000000002e001a 0x2d0016 0xe0014 0x20010 0x10021) (.leaf8 0x121000000002b001a + 0x2c000000002b0016 0x16 0x270000000028001a 0x270016 0x2600000000010016 0x5aa0000000025001a + 0x600000000230016)) (.bin (.leaf8 0xc60000000022001a 0x200016 0x1c54000000001f001a + 0x1f000000001f0016 0x30014 0x210010 0x10021 0x3e0000000001c001a) (.leaf8 0x5000000001b0016 + 0x1b0014 0x70010 0x10021 0x8da60000000019001a 0x1a00000000190016 0x30014 0x1c0010)))) (.bin (.bin + (.bin (.leaf8 0x10021 0x13620000000016001a 0x1700000000160016 0x1500000000040016 + 0x2c4450000000013001a 0x1400000000130016 0x60ee0000000010001a 0xe0016) (.leaf8 + 0xdd55f000000000d001a 0xd000000000d0016 0xc00000000040016 0x1e4a9000000000a001a 0x90016 + 0x900000000030016 0x452adc0000000007001a 0x800000000070016)) (.bin (.leaf8 0x16 + 0x977400000000004001a 0x500000000040016 0x14 0x70010 0x10021 0x300000000000016 + 0x159d6710000000001001a) (.leaf8 0x3001d 0x10000000001000000000100002f5450000000000000000000000020 + 0x50010 0x60021 0x17 0x1d 0x103c3 (h240 (h240 0x2f54510000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x500002f54500000000006000000000100000000040000000006001c)))) (.bin (.bin (.leaf8 0x4000d (h240 + 0x20000000000000000000100000000010000 0x20000000005000000000000012a821e000000000000000000010020) + 0x5000e (h240 0x10000 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x90000000000000000000700000000000000000001001e 0x60023 0x6000d) (.leaf8 + 0xa0000000000000009773f000000000100000000010020 0x2000e + 0x10000000000000000000100000000090000000002001c 0x9000f + 0xd0000000000000000000900000000030000000001001e 0x80023 0x8000d + 0xe00000000000000452adb000000000200000000010020)) (.bin (.leaf8 + 0xf0000000000000000000b0000000001001f (h240 0x10000 + 0xc00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x100000000000000000000100000000040000000001001e 0x100000000020023 + 0x120000000000000001e4a8000000000300000000000020 0x140000000000000000000e0000000002001f 0xd0023) + (.leaf8 0xd000d 0x140000000000000000000f0000000008001f 0xe0023 0xe000d + 0x15000000000000000dd55e000000000400000000010020 0x16000000000000000000020000000008001f + 0x100000000020023 0x18000000000000000060ed000000000500000000000020)))))) (.bin (.bin (.bin (.bin + (.bin (.leaf8 0x1a00000000000000000016000000000c001f 0x150023 0x15000d + 0x1b0000000000000002c444000000000600000000010020 0x1c000000000000000000170000000002001f 0x160023 + 0x16000d 0x1c00000000000000000019000000000e001f) (.leaf8 0x180023 0x18000d + 0x1d00000000000000001361000000000700000000010020 0x5000e + 0x1f0000000000000000001c000000000f0000000000001e 0x1b0023 0x1b000d + 0x2000000000000000008da5000000000800000000010020)) (.bin (.leaf8 0x1d000e + 0x210000000000000000000700000000100000000000001e 0x100000000080023 + 0x23000000000000000003df000000000900000000000020 0x5000e + 0x260000000000000000002100000000130000000000001e 0x200023 0x20000d) (.leaf8 + 0x2700000000000000001c53000000000a00000000010020 0x28000000000000000000020000000014001f + 0x100000000020023 0x2a000000000000000000c5000000000b00000000000020 + 0x2c000000000000000000080000000016001f 0x100000000080023 + 0x2e000000000000000005a9000000000c00000000000020 0x30000000000000000000280000000000001f))) (.bin + (.bin (.leaf8 0x270023 0x27000d 0x31000000000000000000020000000019001f 0x100000000030023 + 0x3300000000000000000026000000000d00000000000020 0x2000e + 0x100000000000000000001000000002d0000000002001c 0x2d000f) (.leaf8 + 0x370000000000000000002d000000001b0000000001001e 0x2c0023 0x2c000d + 0x3800000000000000000120000000000e00000000010020 0x10000e + 0x3a00000000000000000002000000001c0000000000001e 0x100000000030023 + 0x3c00000000000000000006000000000f00000000000020)) (.bin (.leaf8 0x32000e + 0x3e00000000000000000034000000001f0000000000001e 0x330023 0x33000d + 0x3f00000000000000000038000000001000000000010020 0x40000000000000000000020000000001001f (h240 + 0x10000 0x300000000010000000000000000000100000000360000000003001c) 0x36000f) (.leaf8 + 0x420000000000000000003600000000210000000001001e 0x350023 0x35000d + 0x43000000000000000000380000000004001f 0x370023 0x37000d 0x44000000000000000000020000000023001f + 0x100000000030023)))) (.bin (.bin (.bin (.leaf8 0x460000000000000000000a000000001200000000000020 + 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x4a0000000000000000000100000000050000000001001e (h240 0x10000 + 0x100000000020000000000000000000100000000010000000003001c) 0x1000f + 0x4c0000000000000000000100000000260000000001001e) (.leaf8 0x100000000020023 + 0x4e00000000000000000000000000001400000000000020 0x4f000000000000000000410000000003001f (h240 + (h240 0x100000000420000000001000000000000000000010000 + 0x2000000000100000000460000000001000000000000000000010000) + 0x200000000010000000007000000000100000000010000000008001c) 0x1000f + 0x5600000000000000000001000000002b0000000001001e 0x1000a 0x70008)) (.bin (.leaf8 0x10009 0x10021 + 0x16 0x200000000440016 0x420014 0x40010 0x10021 0x3f0016) (.leaf8 0x16 0x10014 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f (h240 0x10000 + 0x300000000010000000003000000000300000000010000000002001d) 0x10009 0x40021))) (.bin (.bin (.leaf8 + 0x5000000003a001a 0x390016 0x3900000000010016 0x350016 0x3600000000010016 0x1c0000000034001a + 0x3300000000330016 0x30000000031001a) (.leaf8 0x300016 0x1100000000010016 0x90000000002e001a + 0x2e000000002e0016 0x30014 0x300010 0x10021 0x13000000002b001a)) (.bin (.leaf8 0x2a0016 + 0x2900000000010016 0x2d40000000028001a 0x2900000000280016 0x14 0x2b0010 0x10021 + 0x2700000000060016) (.leaf8 0x620000000025001a 0x240016 0x20014 0x20010 0x10021 + 0xe2a0000000022001a 0x600000000200016 0x1ef000000001f001a))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x20000000001f0016 0x80014 0x220010 0x10021 0x46d3000000001c001a 0x1d000000001c0016 + 0x1b00000000040016 0x9b00000000019001a) (.leaf8 0x1a00000000190016 0x162230000000016001a + 0x1500000000150016 0x30760000000013001a 0x120016 0x20014 0x20010 0x10021)) (.bin (.leaf8 + 0x6eaaf0000000010001a 0x1000000000100016 0xf254000000000d001a 0xe000000000d0016 0x20014 + 0xc00000000040000000000000000000200000000100000000000001f 0x100009 0x20021) (.leaf8 + 0x22956e000000000a001a 0x80016 0x900000000010016 0x4bb9f0000000007001a 0x800000000070016 0x16 + 0xaceb380000000004001a 0x500000000040016))) (.bin (.bin (.leaf8 0x14 0x70010 0x10021 + 0x300000000000016 0x17aa280000000001001a 0x3001d + 0x100000000010000000001000017aa27000000000000000000000020 0x5000e) (.leaf8 (h240 0x10000 + 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x200000000070000000001000000000700000000000000000001001e 0x60023 0x6000d + 0x2000000000800000000010000aceb37000000000100000000010020 0x2000e + 0x10000000000000000000100000000090000000002001c)) (.bin (.leaf8 0x9000f + 0x2000000000b0000000001000000000900000000030000000001001e 0x80023 0x8000d + 0x2000000000c0000000001000004bb9e000000000200000000010020 + 0x2000000000d0000000001000000000b0000000000001f 0xa0023 0xa000d) (.leaf8 + 0x2000000000d000000000100000000020000000004001f 0x100000000020023 + 0x2000000000f0000000001000022956d000000000300000000000020 0xe000e + 0x10000000005000000000100000000100000000002001c 0x10000f + 0x200000000120000000001000000001000000000050000000001001e 0xf0023)))) (.bin (.bin (.bin (.leaf8 + 0xf000d 0x200000000130000000001000000f253000000000400000000010020 + 0x2000000001400000000010000000012000000000a001f 0x110023 0x11000d + 0x2000000001500000000010000045ad2000000000500000000010020 + 0x20000000016000000000100000000140000000009001f 0x140009) (.leaf8 0x170021 0x17 0x1d 0x103c3 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 0x360981b00000000030000000001000000000200000000020000 + 0x10000000005000017aa28000000000600000000010000) 0x10000000002000000000100000000080000aceb380000) + 0x9000000000100000000030000000001000000000000000000010000) + 0xa000004bba0000000000c0000000001000000000200000000020000) + 0x1000000000e000022956e000000000f00000000010000) + 0x500000000010000000011000000f254000000001200000000010000) + 0x130000045ad30000000015000000000100000000130000000017001c) 0x13000d (h240 + 0x20000000000000000000100000000010000 0x2000000001600000000000000028fda000000000500000000010020) + 0x4000e)) (.bin (.leaf8 0x1900000000000000000002000000000a0000000000001e 0x100000000030023 + 0x1b00000000000000003075000000000600000000000020 0x1d00000000000000000017000000000d001f + 0x100000000180023 0x1e00000000000000016222000000000700000000000020 + 0x200000000000000000001c0000000010001f 0x1b0023) (.leaf8 0x1b000d + 0x21000000000000000009af000000000800000000010020 0x220000000000000000001d0000000002001f 0x1c0023 + 0x1c000d 0x220000000000000000001f0000000012001f 0x1e0023 0x1e000d))) (.bin (.bin (.leaf8 + 0x23000000000000000046d2000000000900000000010020 0xa000e + 0x250000000000000000002200000000130000000000001e 0x210023 0x21000d + 0x26000000000000000001ee000000000a00000000010020 0x27000000000000000000080000000014001f + 0x100000000080023) (.leaf8 0x2900000000000000000e29000000000b00000000000020 0x4000e + 0x2c0000000000000000000200000000160000000000001e 0x100000000030023 + 0x2e00000000000000000061000000000c00000000000020 0x30000000000000000000290000000003001f (h240 + 0x1000000002a00000000010000 0x100000000020000000001000000002b0000000004001c) 0x2b000f)) (.bin + (.leaf8 0x320000000000000000002b00000000180000000001001e 0x2a0023 0x2a000d + 0x33000000000000000002d3000000000d00000000010020 0x340000000000000000002b0000000000001f 0x2a0023 + 0x2a000d 0x3500000000000000000002000000001b001f) (.leaf8 0x100000000030023 + 0x3700000000000000000012000000000e00000000000020 0x5000e + 0x3a00000000000000000030000000001d0000000000001e 0x2f0023 0x2f000d + 0x3b0000000000000000008f000000000f00000000010020 0x3c000000000000000000130000000000001f))))))) + (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x120023 0x12000d + 0x3d00000000000000000002000000001f001f 0x100000000030023 + 0x3f00000000000000000002000000001000000000000020 0x41000000000000000000350000000021001f + 0x100000000360023 0x420000000000000000001b000000001100000000000020) (.leaf8 + 0x44000000000000000000380000000000001f 0x370023 0x37000d 0x44000000000000000000020000000022001f + (h240 0x10000 0x2000000000200000000000000000001000000003a0000000003001c) 0x3a000f + 0x460000000000001d 0x390023)) (.bin (.leaf8 0x39000d 0x47000000000000000000020000000025001f + 0x100000000030023 0x4900000000000000000004000000001300000000000020 0x5000e (h240 + 0x1000000000400000000010000 0x300000000010000000000000000000100000000010000000004001c) 0x1000f + 0x4f0000000000000000000100000000260000000001001e) (.leaf8 (h240 0x1000000000200000000010000 + 0x10000000044000000000100000000040000000004001c) 0x4000f + 0x5200000000000000000004000000002a0000000001001e (h240 (h240 0x10000 + 0x4000000000200000000000000000001000000000200000000010000) + 0x10000000008000000000100000000010000000006001c) 0x600c6 0x10043 0x80142 0x101c3))) (.bin (.bin + (.leaf8 0x90009 0x20014 0x9000e 0x20186 0x10043 0xa0142 0x101c3 0xb0023) (.leaf8 0x1a00c6 0x10043 + 0x10303 0x10009 0x40008 0x10009 0x10021 0x10019)) (.bin (.leaf8 0x540000000000001d 0xf + 0x530000000000001d 0x103c3 0x10000000006000000000100000000010000000002001c 0x1000f (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x7652d6000000000000000000010000000001000360981b00000000030000 + 0x1000000000200000000020000000000000000000100000000050000) + 0x17aa28000000000600000000010000000000000000000100000000020000) + 0x100000000080000aceb380000000009000000000100000000030000) + 0x100000000000000000001000000000a000004bba0000000000c0000) + 0x10000000002000000000200000000000000000001000000000e0000) + 0x22956e000000000f00000000010000000005000000000100000000110000) + 0xf254000000001200000000010000000013000006eaaf00000000150000) + 0x1000000000500000000010000000003000000000100000000000000) + 0x1000000001700000030760000000018000000000100000000000000) + 0x1000000001a0000016222000000001b0000000001000000001d0000) + 0x9b1000000001e0000000001000000002000000046d300000000210000) + 0x1000000000b0000000001000000002300000001ef00000000240000) + 0x1000000000800000000020000000000000000000100000000260000) + 0xe29000000002700000000010000000005000000000100000000030000) + 0x10000000000000000000100000000290000000062000000002a0000) + 0x10000000000000000000100000000020000000001000000002c0000) + 0x2d4000000002d0000000001000000002c000000000100000000030000) + 0x100000000000000000001000000002f000000001200000000300000) + 0x1000000000600000000010000000031000000009000000000330000) + 0x1000000001400000000010000000003000000000100000000000000) + 0x1000000003500000000030000000036000000000100000000000000) + 0x10000000038000000001c0000000039000000000100000000020000) + 0x200000000000000000001000000003b000000000100000000030000) + 0x100000000000000000001000000003e0000000004000000003f0000) + 0x1000000000600000000010000000004000000000100000000030000) + 0x1000000000000000000010000000002000000000100000000000000) + 0x1000000004400000000010000000004000000000100000000010000) + 0x5400000000010000000000000000000100000000040000000001001e) 0x60000000001000b) (.leaf8 + 0x400000000000000000003001d 0x7000a 0x8 (h240 0x50000 + 0x100000000000000000002000000000100000000000000000000001e) 0x10009 0x20021 0x4400000000010019 + 0x510000000000001d)))) (.bin (.bin (.bin (.leaf8 0x420023 (h240 0x2000000000000000000010000 + 0x700000000010000000002000000000100000000010000000004009c) 0x1000f (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x7652e400000000000000 + 0x10000000001000360981b0000000003000000000100000000020000) + 0x2000000000000000000010000000005000017aa2800000000060000) + 0x1000000000000000000010000000002000000000100000000080000) + 0xaceb38000000000900000000010000000003000000000100000000000000) + 0x1000000000a000004bba0000000000c000000000100000000020000) + 0x200000000000000000001000000000e000022956e000000000f0000) + 0x1000000000500000000010000000011000000f25400000000120000) + 0x10000000013000006eaaf0000000015000000000100000000050000) + 0x1000000000300000000010000000000000000000100000000170000) + 0x30760000000018000000000100000000000000000001000000001a0000) + 0x16222000000001b0000000001000000001d00000009b1000000001e0000) + 0x1000000002000000046d300000000210000000001000000000b0000) + 0x1000000002300000001ef0000000024000000000100000000080000) + 0x20000000000000000000100000000260000000e2900000000270000) + 0x1000000000500000000010000000003000000000100000000000000) + 0x100000000290000000062000000002a000000000100000000000000) + 0x100000000020000000001000000002c00000002d4000000002d0000) + 0x1000000002c00000000010000000003000000000100000000000000) + 0x1000000002f00000000120000000030000000000100000000060000) + 0x1000000003100000000900000000033000000000100000000140000) + 0x1000000000300000000010000000000000000000100000000350000) + 0x3000000003600000000010000000000000000000100000000380000) + 0x1c000000003900000000010000000002000000000200000000000000) + 0x1000000003b00000000010000000003000000000100000000000000) + 0x1000000003e0000000004000000003f000000000100000000060000) + 0x1000000000400000000010000000003000000000100000000000000) + 0x1000000000200000000010000000000000000000100000000430000) + 0x5200000000030000000000000000000100000000010000000001001e) 0x20000000001000b 0x50016 0x430014 + 0x200000000450000000000000000000200000000020000000000001f) (.leaf8 (h240 0x30000 + 0x400000000010000000002000000000200000000000000000000001e) 0x20009 0x20021 0x600000000020016 + 0x2000000003d001a 0x3c0016 0x3b00000000010016 0x14)) (.bin (.leaf8 0x3d0010 0x10021 + 0x3900000000000016 0xd0000000037001a 0x3800000000370016 0x360014 0x3a0010 0x10021) (.leaf8 + 0x10000000034001a 0x330016 0x1400000000010016 0x480000000031001a 0x6000000002f0016 + 0x9000000002e001a 0x2d0016 0x2c00000000010016))) (.bin (.bin (.leaf8 0x16a000000002b001a + 0x2000000002a0016 0x2a0014 0x40010 0x10021 0x300000000028001a 0x2900000000280016 0x30014) (.leaf8 + 0x2b0010 0x10021 0x2700000000030016 0x7140000000025001a 0x240016 0x80014 0x20010 0x10021)) (.bin + (.leaf8 0xf70000000022001a 0x2300000000220016 0x2100000000090016 0x2369000000001f001a + 0x1e000000001e0016 0x4d8000000001c001a 0x1b000000001b0016 0xb1100000000019001a) (.leaf8 + 0x1a00000000190016 0x180014 0x1c0010 0x10021 0x183a0000000016001a 0x1700000000160016 0x30014 + 0x190010))))) (.bin (.bin (.bin (.bin (.leaf8 0x10021 0x1500000000030016 0x375570000000013001a + 0x1200000000110016 0x79290000000010001a 0x1100000000100016 0xf00000000030016 + 0x114ab6000000000d001a) (.leaf8 0xe000000000d0016 0x14 0x100010 0x10021 0xc00000000000016 + 0x25dcf000000000a001a 0xa000000000a0016 0x30014)) (.bin (.leaf8 0xc0010 0x10021 + 0x56759c0000000007001a 0x200000000060016 0x60014 0x40010 0x10021 0xbd5130000000004001a) (.leaf8 + 0x500000000040016 0x14 0x70010 0x10021 0x300000000000016 0x1b04c0d0000000001001a 0x3001d + 0x10000000001000000000100003b2973000000000000000000000020))) (.bin (.bin (.leaf8 0x50010 0x60021 + 0x17 0x1d 0x103c3 (h240 (h240 0x3b29740000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x500003b29730000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000500000000000001752297000000000000000000010020)) + (.leaf8 0x5000e (h240 0x10000 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x90000000000000000000700000000000000000001001e 0x60023 0x6000d + 0xa000000000000000bd512000000000100000000010020 0x8000e)) (.bin (.leaf8 + 0xb0000000000000000000400000000020000000000001e 0x100000000050023 + 0xd0000000000000056759b000000000200000000000020 0x5000e + 0x100000000000000000000c00000000050000000000001e 0xb0023 0xb000d + 0x1100000000000000025dce000000000300000000010020) (.leaf8 0xe000e (h240 0x10000 + 0x10000000002000000000100000000100000000003001c) 0x10000f + 0x140000000000000000001000000000060000000001001e 0xf0023 0xf000d + 0x1500000000000000114ab5000000000400000000010020 0x16000000000000000000110000000001001f)))) (.bin + (.bin (.bin (.leaf8 (h240 0x10000 0x1200000000010000000000000000000100000000120000000003001c) + 0x12000f 0x170000000000000000001200000000090000000001001e 0x110023 0x11000d + 0x1800000000000000007928000000000500000000010020 0x1900000000000000000014000000000a001f + 0x100000000140023) (.leaf8 0x1b00000000000000037556000000000600000000000020 + 0x1d000000000000000000170000000001001f (h240 0x1000000001800000000010000 + 0x10000000005000000000100000000190000000004001c) 0x19000f + 0x1f00000000000000000019000000000c0000000001001e 0x180023 0x18000d + 0x2000000000000000001839000000000700000000010020)) (.bin (.leaf8 0x1a000e + 0x210000000000000000001c000000000f0000000000001e 0x1b0023 0x1b000d + 0x220000000000000000b10f000000000800000000010020 0x230000000000000000001d0000000011001f + 0x1000000001e0023 0x24000000000000000004d7000000000900000000000020) (.leaf8 + 0x26000000000000000000200000000013001f 0x100000000210023 + 0x2700000000000000002368000000000a00000000000020 0x29000000000000000000230000000005001f (h240 + 0x10000 0x2400000000010000000000000000000100000000240000000003001c) 0x24000f + 0x2a0000000000000000002400000000150000000001001e 0x230023))) (.bin (.bin (.leaf8 0x23000d + 0x2b000000000000000000f6000000000b00000000010020 0xa000e + 0x2d0000000000000000000200000000160000000000001e 0x100000000030023 + 0x2f00000000000000000713000000000c00000000000020 0x31000000000000000000290000000001001f (h240 + 0x1000000002a00000000010000 0x100000000050000000001000000002b0000000004001c)) (.leaf8 0x2b000f + 0x330000000000000000002b00000000180000000001001e 0x2a0023 0x2a000d + 0x340000000000000000002f000000000d00000000010020 0x2c000e + 0x3500000000000000000004000000001a0000000000001e 0x100000000050023)) (.bin (.leaf8 + 0x3700000000000000000169000000000e00000000000020 0x390000000000000000002e0000000000001f 0x2d0023 + 0x2d000d 0x3a00000000000000000002000000001d001f 0x100000000030023 + 0x3c00000000000000000008000000000f00000000000020 0x3e00000000000000000008000000001e001f) (.leaf8 + 0x100000000080023 0x4000000000000000000047000000001000000000000020 + 0x42000000000000000000160000000000001f 0x150023 0x15000d 0x43000000000000000000020000000021001f + 0x100000000030023 0x4500000000000000000000000000001100000000000020)))))) (.bin (.bin (.bin (.bin + (.bin (.leaf8 0x38000e 0x470000000000000000003a00000000230000000000001e 0x390023 0x39000d + 0x480000000000000000000c000000001200000000010020 0x3b000e (h240 0x10000 + 0x100000000020000000001000000003c0000000003001c) 0x3c000d) (.leaf8 + 0x4c000000000000000000020000000027001f 0x100000000030023 + 0x4e00000000000000000001000000001400000000000020 0x50000000000000000000080000000000001f (h240 + (h240 0x1000000000800000000020000 0x200000000050000000001000000004600000000010000) + 0x200000000020000000000000000000100000000030000000007001c) 0x20186 0x10043 0x30142)) (.bin (.leaf8 + 0x101c3 0x40023 0xc00c6 0x10043 0x10303 0x10009 0x8 (h240 0x20000 + 0x100000000000000000002000000000100000000000000000000001e)) (.leaf8 0x10009 0x20021 + 0x500000000440016 0x30016 0x80014 0x20010 0x10021 0x4100000000400016))) (.bin (.bin (.leaf8 + 0x30014 0x430010 0x10021 0x2000000003c0016 0x3c0014 0x40010 0x10021 0x6000000003a001a) (.leaf8 + 0x3b000000003a0016 0x3800000000370016 0x30014 0x3a0010 0x10021 0x3600000000150016 + 0x230000000034001a 0x330016)) (.bin (.leaf8 0x80014 0x20010 0x10021 0x40000000031001a 0x300016 + 0x2f00000000010016 0xb4000000002e001a 0x2f000000002e0016) (.leaf8 0x50014 0x310010 0x10021 + 0x18000000002b001a 0x2c000000002b0016 0x30016 0x38a0000000028001a 0x270016)))) (.bin (.bin (.bin + (.leaf8 0xb00000000010016 0x7b0000000025001a 0x2500000000250016 0x240014 0x270010 0x10021 + 0x11b40000000022001a 0x210016) (.leaf8 0x26c000000001f001a 0x1e0016 0x5888000000001c001a + 0x1d000000001c0016 0xc1d0000000019001a 0x1a00000000190016 0x30016 0x1baab0000000016001a)) (.bin + (.leaf8 0x1700000000160016 0x14 0x190010 0x10021 0x1500000000120016 0x3c940000000013001a 0x110016 + 0x8a55b0000000010001a) (.leaf8 0x1100000000100016 0x16 0x12ee8000000000d001a 0x6000000000b0016 + 0x2b3acd000000000a001a 0xb000000000a0016 0x50014 0xd0010))) (.bin (.bin (.leaf8 0x10021 + 0x5ea8a0000000007001a 0x200000000060016 0x60014 0x40010 0x10021 0xd826060000000004001a 0x30016) + (.leaf8 0x20014 0x20010 0x10021 0x1d94ba0000000001001a 0x3001d + 0x10000000001000000000100001d94b9000000000000000000000020 0x4000e + 0x200000000060000000001000000000200000000000000000000001e)) (.bin (.leaf8 0x100000000030023 + 0x2000000000800000000010000d82605000000000100000000000020 0x8000e + 0x2000000000a0000000001000000000400000000020000000000001e 0x100000000050023 + 0x2000000000c0000000001000005ea89000000000200000000000020 0x7000e + 0x2000000000f0000000001000000000d00000000050000000000001e) (.leaf8 0xc0023 0xc000d + 0x20000000010000000000100002b3acc000000000300000000010020 + 0x20000000011000000000100000000080000000006001f 0x100000000080023 + 0x2000000001300000000010000012ee7000000000400000000000020 0x2000e + 0x10000000000000000000100000000120000000002001c))))) (.bin (.bin (.bin (.bin (.leaf8 0x12000f + 0x200000000170000000001000000001200000000090000000001001e 0x110023 0x11000d + 0x200000000180000000001000005717a000000000500000000010020 + 0x20000000019000000000100000000140000000004001f 0x140009 0x1a0021) (.leaf8 0x17 0x1d 0x103c3 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x438bdab00000000030000000001000000000200000000020000 + 0x1000000000500001d94b9000000000600000000010000) + 0x5000000000100000000030000000001000000000000000000010000) + 0x80000d8260600000000090000000001000000000500000000010000) + 0x1000000000b000005ea89000000000c00000000010000) + 0x80000000001000000000e00002b3acd000000000f00000000010000) + 0x800000000020000000000000000000100000000110000012ee70000) + 0x12000000000100000000030000000001000000000000000000010000) + 0x13000005717b000000001500000000010000000014000000001a001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000190000000000000000001400000000030000000001001e) + 0x130023 0x13000d)) (.bin (.leaf8 0x1b000000000000000333de000000000500000000010020 + 0x1b00000000000000000002000000000a001f 0x100000000020023 + 0x1d00000000000000003c93000000000600000000000020 0x1f00000000000000000017000000000b001f (h240 + 0x1000000001800000000010000 0x10000000002000000000100000000190000000004001c) 0x19000f + 0x2100000000000000000019000000000c0000000001001e) (.leaf8 0x180023 0x18000d + 0x220000000000000001baaa000000000700000000010020 0x23000000000000000000020000000001001f (h240 + 0x10000 0x3000000000100000000000000000001000000001b0000000003001c) 0x1b000f + 0x250000000000000000001b000000000f0000000001001e 0x1a0023))) (.bin (.bin (.leaf8 0x1a000d + 0x2600000000000000000c1c000000000800000000010020 0x270000000000000000001f0000000012001f 0x1e0023 + 0x1e000d 0x2800000000000000005887000000000900000000010020 0x29000000000000000000020000000013001f + 0x100000000030023) (.leaf8 0x2b0000000000000000026b000000000a00000000000020 + 0x2d000000000000000000020000000015001f 0x100000000030023 + 0x2f000000000000000011b3000000000b00000000000020 0x26000e + 0x310000000000000000002700000000170000000000001e 0x260023 0x26000d)) (.bin (.leaf8 + 0x320000000000000000007a000000000c00000000010020 0x330000000000000000000d0000000000001f 0xc0023 + 0xc000d 0x34000000000000000000020000000019001f 0x100000000030023 + 0x3600000000000000000389000000000d00000000000020 0x38000000000000000000020000000001001f) (.leaf8 + (h240 0x10000 0x3000000000100000000000000000001000000002d0000000003001c) 0x2d000f + 0x3a0000000000000000002d000000001b0000000001001e 0x2c0023 0x2c000d + 0x3b00000000000000000017000000000e00000000010020 0x7000e + 0x3d00000000000000000031000000001d0000000000001e)))) (.bin (.bin (.bin (.leaf8 0x300023 0x30000d + 0x3e000000000000000000b3000000000f00000000010020 0x3f000000000000000000310000000000001f 0x300023 + 0x30000d 0x4000000000000000000002000000001f001f 0x100000000030023) (.leaf8 + 0x4200000000000000000003000000001000000000000020 0xa000e + 0x450000000000000000000200000000200000000000001e 0x100000000030023 + 0x4700000000000000000022000000001100000000000020 0x4900000000000000000038000000000d001f (h240 + 0x1000000003900000000010000 0x100000000050000000001000000003a0000000004001c) 0x3a000f)) (.bin + (.leaf8 0x4b0000000000000000003a00000000220000000001001e 0x390023 0x39000d + 0x4c0000000000000000003d0000000026001f 0x3c0023 0x3c000d + 0x4d00000000000000000005000000001300000000010020 0x3e000e) (.leaf8 + 0x4e0000000000000000000400000000260000000000001e (h240 0x1000000000500000000010000 + 0x10000000005000000000100000000430000000004001c) 0x43000f + 0x510000000000000000004300000000280000000001001e 0x420023 0x42000d 0xa000e + 0x530000000000000000000200000000000000000000001e))) (.bin (.bin (.leaf8 (h240 0x10000 + 0x300000000010000000000000000000100000000060000000003001c) 0x6000f + 0x5500000000000000000006000000002b0000000001001e (h240 + 0x100000000060000000002000000000000000000010000 + 0x400000000010000000002000000000100000000010000000005001c) 0x20186 0x10043 0x10142 0x101c3) + (.leaf8 0x20023 0x800c6 0x10043 0x10303 0x10009 0x20008 0x10009 0x10021)) (.bin (.leaf8 0x20016 + 0x60014 0x300000000080000000000000000000200000000020000000000001f (h240 + 0x1000000000200000000020000 0x10000000003000000000100000000010000000004001c) 0x600c6 0x10043 + 0x30142 0x101c3) (.leaf8 0x40009 0x14 0x4000e 0x20186 0x10043 0x50142 0x101c3 0x60023)))))))) + (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x1000c6 0x10043 0x10303 0x10009 0x20008 0x10009 + 0x10021 0x200000000010019) (.leaf8 0x20021 0x4400000000090016 0x30016 0x3f00000000030016 + 0x3000000003d001a 0x3b000000003c0016 0x30016 0x110000000037001a)) (.bin (.leaf8 0x3800000000370016 + 0x30014 0x3a0010 0x10021 0x3600000000090016 0x10000000034001a 0x330016 0x3200000000010016) (.leaf8 + 0x5a0000000031001a 0x800000000300016 0xc000000002e001a 0x2c0016 0x2d00000000010016 + 0x1c4000000002b001a 0x2a0016 0xe00000000010016))) (.bin (.bin (.leaf8 0x3d0000000028001a + 0x2800000000280016 0x8da0000000025001a 0x240016 0x2400000000010016 0x1350000000022001a 0x210016 + 0x2100000000010016) (.leaf8 0x2c43000000001f001a 0x20000000001f0016 0x60e000000001c001a + 0x1c000000001c0016 0x30014 0x1e0010 0x10021 0xdd550000000019001a)) (.bin (.leaf8 + 0x1a00000000190016 0x16 0x1e4a0000000016001a 0x150016 0x20014 0x20010 0x10021 + 0x452ad0000000013001a) (.leaf8 0x1300000000130016 0x30014 0x150010 0x10021 0x97730000000010001a + 0x1100000000100016 0x14 0x130010)))) (.bin (.bin (.bin (.leaf8 0x10021 0xf00000000060016 + 0x159d66000000000d001a 0x8000000000c0016 0x2f544000000000a001a 0xb000000000a0016 0x50014 0xd0010) + (.leaf8 0x10021 0x6c13030000000007001a 0x60016 0x500000000010016 0xeca5c0000000004001a + 0x500000000040016 0x14 0x70010)) (.bin (.leaf8 0x10021 0x300000000000016 0x21c5ed50000000001001a + 0x3001d 0x100000000010000000001000049f47a000000000000000000000020 0x50010 0x60021 0x17) (.leaf8 + 0x1d 0x103c3 (h240 (h240 0x49f47b0000 0x3000000000100000000020000000002000000000000000000010000) + 0x5000049f47a0000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000500000000000001d26a58000000000000000000010020) + 0x5000e (h240 0x10000 0x10000000002000000000100000000070000000003001c) 0x7000f))) (.bin (.bin + (.leaf8 0x90000000000000000000700000000000000000001001e 0x60023 0x6000d + 0xa000000000000000eca5b000000000100000000010020 0xb000000000000000000070000000000001f 0x60023 + 0x6000d 0xc000000000000000000020000000003001f) (.leaf8 0x100000000030023 + 0xe000000000000006c1302000000000200000000000020 0x7000e + 0x110000000000000000000d00000000050000000000001e 0xc0023 0xc000d + 0x120000000000000002f543000000000300000000010020 0x130000000000000000000a0000000007001f)) (.bin + (.leaf8 0x1000000000b0023 0x1500000000000000159d65000000000400000000000020 + 0x17000000000000000000110000000003001f (h240 0x1000000001200000000010000 + 0x10000000002000000000100000000130000000004001c) 0x13000f + 0x190000000000000000001300000000080000000001001e 0x120023 0x12000d) (.leaf8 + 0x1a00000000000000009772000000000500000000010020 0x5000e + 0x1c00000000000000000015000000000b0000000000001e 0x140023 0x14000d + 0x1d000000000000000452ac000000000600000000010020 0x4000e + 0x1f00000000000000000002000000000c0000000000001e))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x100000000030023 0x2100000000000000001e49000000000700000000000020 0x2000e + 0x100000000000000000001000000001b0000000002001c 0x1b000f + 0x250000000000000000001b000000000f0000000001001e 0x1a0023 0x1a000d) (.leaf8 + 0x260000000000000000dd54000000000800000000010020 0x5000e + 0x280000000000000000001e00000000110000000000001e 0x1d0023 0x1d000d + 0x290000000000000000060d000000000900000000010020 0x2a000000000000000000220000000014001f 0x210023)) + (.bin (.leaf8 0x21000d 0x2b00000000000000002c42000000000a00000000010020 + 0x2c000000000000000000230000000000001f 0x220023 0x22000d 0x2c000000000000000000020000000015001f + 0x100000000030023 0x2e00000000000000000134000000000b00000000000020) (.leaf8 + 0x30000000000000000000260000000000001f 0x250023 0x25000d 0x30000000000000000000020000000017001f + 0x100000000030023 0x32000000000000000008d9000000000c00000000000020 + 0x340000000000000000002a000000001a001f 0x290023))) (.bin (.bin (.leaf8 0x29000d + 0x350000000000000000003c000000000d00000000010020 0x36000000000000000000100000000000001f 0xf0023 + 0xf000d 0x3700000000000000000002000000001b001f 0x100000000030023 + 0x39000000000000000001c3000000000e00000000000020) (.leaf8 0x3b0000000000000000002f0000000000001f + 0x2e0023 0x2e000d 0x3b00000000000000000002000000001c001f 0x100000000020023 + 0x3d0000000000000000000b000000000f00000000000020 0x3f0000000000000000000a000000001f001f + 0x1000000000b0023)) (.bin (.leaf8 0x4100000000000000000059000000001000000000000020 + 0x43000000000000000000340000000000001f 0x330023 0x33000d 0x44000000000000000000020000000021001f + 0x100000000030023 0x4600000000000000000000000000001100000000000020 + 0x47000000000000000000380000000005001f) (.leaf8 (h240 0x1000000003900000000010000 + 0x100000000050000000001000000003a0000000004001c) 0x3a000f + 0x4a0000000000000000003a00000000220000000001001e 0x390023 0x39000d + 0x4b00000000000000000010000000001200000000010020 0x4c000000000000000000020000000001001f (h240 + 0x10000 0x3000000000100000000000000000001000000003c0000000003001c))))) (.bin (.bin (.bin (.leaf8 + 0x3c000f 0x4e0000000000000000003c00000000260000000001001e 0x1000000003d0023 + 0x5000000000000000000002000000001400000000000020 0x52000000000000000000410000000001001f (h240 + 0x10000 0x4200000000010000000000000000000100000000010000000003001c) 0x1000f + 0x530000000000000000000100000000000000000001001e) (.leaf8 (h240 0x10000 + 0x200000000010000000000000000000100000000450000000003001c) 0x45000f + 0x550000000000000000004500000000040000000001001e (h240 + 0x100000000460000000001000000000000000000010000 + 0x500000000010000000009000000000100000000000000000005001c) (h240 0x20000 + 0x10000000003000000000100000000010000000003009c) 0x1000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0xa + 0x8dd932000000000000000000010000000001000049f47b00000000030000) + 0x1000000000200000000020000000000000000000100000000050002) + 0x1c5ed5000000000600000000010000000000000000000100000000020000) + 0x1000000000800000eca5c0000000009000000000100000000080000) + 0x10000000003000000000100000000000000000001000000000b0000) + 0x6c1302000000000c000000000100000000080000000001000000000e0000) + 0x2f544000000000f0000000001000000000b000000000100000000000000) + 0x100000000110000159d660000000012000000000100000000000000) + 0x1000000000200000000010000000014000000977300000000150000) + 0x100000000060000000001000000001600000452ad00000000180000) + 0x1000000000500000000010000000003000000000100000000000000) + 0x1000000001a0000001e49000000001b000000000100000000030000) + 0x100000000000000000001000000001c000000dd55000000001e0000) + 0x100000000060000000001000000001f000000060e00000000210000) + 0x100000000230000002c440000000024000000000100000000030000) + 0x1000000000000000000010000000026000000013500000000270000) + 0x1000000000300000000010000000000000000000100000000290000) + 0x8d9000000002a0000000001000000002b000000003d000000002d0000) + 0x1000000001100000000010000000003000000000100000000000000) + 0x1000000002f00000001c40000000030000000000100000000020000) + 0x2000000000000000000010000000032000000000b00000000330000) + 0x1000000000b00000000010000000000000000000100000000350000) + 0x59000000003600000000010000000035000000000100000000030000) + 0x1000000000000000000010000000038000000000100000000390000) + 0x10000000000000000000100000000050000000001000000003b0000) + 0x11000000003c00000000010000000003000000000100000000000000) + 0x1000000003d00000000010000000000000000000100000000410000) + 0x3000000004200000000010000000000000000000100000000020000) + 0x1000000000000000000010000000046000000000100000000000000) + 0x1000000000500000000010000000009000000000100000000010000) + 0x5a00000000020000000000000000000100000000010000000001001e) 0x30000000000000b)) (.bin (.leaf8 0x14 + 0x3000e 0xc00c6 0x10043 0x20142 0x101c3 0x30009 0x100000000010019) (.leaf8 0x590000000000001d + 0x300000000000000000001015c 0x30003 0x3000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 0xa + 0x8dd93a000000000000000000010000000001000049f47b00000000030000) + 0x1000000000200000000020000000000000000000100000000050002) + 0x1c5ed5000000000600000000010000000000000000000100000000020000) + 0x1000000000800000eca5c0000000009000000000100000000080000) + 0x10000000003000000000100000000000000000001000000000b0000) + 0x6c1302000000000c000000000100000000080000000001000000000e0000) + 0x2f544000000000f0000000001000000000b000000000100000000000000) + 0x100000000110000159d660000000012000000000100000000000000) + 0x1000000000200000000010000000014000000977300000000150000) + 0x100000000060000000001000000001600000452ad00000000180000) + 0x1000000000500000000010000000003000000000100000000000000) + 0x1000000001a0000001e49000000001b000000000100000000030000) + 0x100000000000000000001000000001c000000dd55000000001e0000) + 0x100000000060000000001000000001f000000060e00000000210000) + 0x100000000230000002c440000000024000000000100000000030000) + 0x1000000000000000000010000000026000000013500000000270000) + 0x1000000000300000000010000000000000000000100000000290000) + 0x8d9000000002a0000000001000000002b000000003d000000002d0000) + 0x1000000001100000000010000000003000000000100000000000000) + 0x1000000002f00000001c40000000030000000000100000000020000) + 0x2000000000000000000010000000032000000000b00000000330000) + 0x1000000000b00000000010000000000000000000100000000350000) + 0x59000000003600000000010000000035000000000100000000030000) + 0x1000000000000000000010000000038000000000100000000390000) + 0x10000000000000000000100000000050000000001000000003b0000) + 0x11000000003c00000000010000000003000000000100000000000000) + 0x1000000003d00000000010000000000000000000100000000410000) + 0x3000000004200000000010000000000000000000100000000020000) + 0x1000000000000000000010000000046000000000100000000000000) + 0x1000000000500000000010000000009000000000100000000000000) + 0x5a00000000010000000000000000000300000000000000000001001e) 0x3000a 0x8 + 0x100000000000000000001000000000100000000000000000000001e))) (.bin (.bin (.leaf8 0x10009 0x10021 + 0x500000000070016 0x460014 0x200000000480000000000000000000200000000070000000000001f (h240 + 0x420000 0x400000000010000000002000000000700000000000000000000001e) 0x70009 0x30021) (.leaf8 + 0x10000000040001a 0x3f0016 0x3b0016 0x3c00000000010016 0x8000000003a001a 0x500000000390016 + 0x390014 0x70010)) (.bin (.leaf8 0x10021 0x360016 0x3500000000010016 0x2c0000000034001a + 0x3500000000340016 0xb0014 0x370010 0x10021) (.leaf8 0x50000000031001a 0x3200000000310016 0x14 + 0x340010 0x10021 0x3000000000000016 0xe1000000002e001a 0x2f000000002e0016)))))) (.bin (.bin (.bin + (.bin (.bin (.leaf8 0x30014 0x310010 0x10021 0x2d000000000f0016 0x1e000000002b001a + 0x2a00000000290016 0x46c0000000028001a 0x270016) (.leaf8 0x2700000000010016 0x9a0000000025001a + 0x240016 0x2400000000010016 0x16210000000022001a 0x2300000000220016 0x307000000001f001a + 0x6000000001d0016)) (.bin (.leaf8 0x6eaa000000001c001a 0x1c000000001c0016 0x30014 0x1e0010 0x10021 + 0xf240000000019001a 0x1a00000000190016 0x30014) (.leaf8 0x1c0010 0x10021 0x1800000000030016 + 0x229560000000016001a 0x600000000140016 0x4bb90000000013001a 0x1400000000130016 0x16))) (.bin + (.bin (.leaf8 0xaceb30000000010001a 0xf0016 0xf00000000090016 0x17aa1000000000d001a + 0xe000000000d0016 0xc00000000060016 0x360980000000000a001a 0xb000000000a0016) (.leaf8 0x30014 + 0xd0010 0x10021 0x900000000060016 0x7652d0000000007001a 0x800000000070016 0x16 + 0x10e2f6a0000000004001a)) (.bin (.leaf8 0x500000000040016 0x14 0x70010 0x10021 0x300000000000016 + 0x24fa3d0000000001001a 0x3001d 0x100000000010000000001000024fa3c000000000000000000000020) (.leaf8 + 0x5000e (h240 0x10000 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x200000000070000000001000000000700000000000000000001001e 0x60023 0x6000d + 0x20000000008000000000100010e2f69000000000100000000010020 0x2000e)))) (.bin (.bin (.bin (.leaf8 + 0x10000000000000000000100000000090000000002001c 0x9000f + 0x2000000000b0000000001000000000900000000030000000001001e 0x80023 0x8000d + 0x2000000000c0000000001000007652c000000000200000000010020 + 0x2000000000d0000000001000000000b0000000003001f (h240 0x1000000000c00000000010000 + 0x100000000050000000001000000000d0000000004001c)) (.leaf8 0xd000f + 0x2000000000f0000000001000000000d00000000040000000001001e 0xc0023 0xc000d + 0x200000000100000000001000036097f000000000300000000010020 + 0x200000000110000000001000000000e0000000003001f (h240 0x10000 + 0xf000000000100000000000000000001000000000f0000000003001c) 0xf000f)) (.bin (.leaf8 + 0x200000000120000000001000000000f00000000070000000001001e 0xe0023 0xe000d + 0x2000000001300000000010000017aa0000000000400000000010020 + 0x20000000014000000000100000000110000000005001f (h240 0x10000 + 0x1200000000010000000000000000000100000000010000000003001c) 0x1000f + 0x200000000150000000001000000000100000000080000000001001e) (.leaf8 0x100000000020023 + 0x200000000170000000001000006cdce000000000500000000000020 + 0x20000000019000000000100000000140000000005001f 0x140009 0x1a0021 0x17 0x1d 0x103c3))) (.bin (.bin + (.leaf8 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x546ec9e00000000030000000001000000000200000000020000 + 0x10000000005000024fa3d000000000600000000010000) 0x100000000020000000001000000000800010e2f6a0000) + 0x9000000000100000000030000000001000000000000000000010000) + 0xa000007652e000000000c0000000001000000000000000000010000) + 0x50000000001000000000e0000360981000000000f00000000010000) + 0x100000000100000017aa2000000001200000000010000) 0x100000000020000000001000000000000000000010000) + 0x14000006cdce000000001500000000010000000014000000001a001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000190000000000000000001400000000020000000001001e) + 0x130023 0x13000d 0x1b000000000000000400e2000000000500000000010020 0x2000e + 0x10000000000000000000100000000150000000002001c) (.leaf8 0x15000f + 0x1d00000000000000000015000000000b0000000001001e 0x140023 0x14000d + 0x1e00000000000000004bb8000000000600000000010020 0x1f00000000000000000008000000000c001f + 0x100000000080023 0x2100000000000000022955000000000700000000000020)) (.bin (.leaf8 + 0x230000000000000000001a0000000001001f (h240 0x1000000001b00000000010000 + 0x100000000050000000001000000001c0000000004001c) 0x1c000f + 0x250000000000000000001c000000000e0000000001001e 0x1b0023 0x1b000d + 0x2600000000000000000f23000000000800000000010020 0x5000e) (.leaf8 + 0x280000000000000000001e00000000110000000000001e 0x1d0023 0x1d000d + 0x2900000000000000006ea9000000000900000000010020 0x2a000000000000000000080000000012001f + 0x100000000080023 0x2c00000000000000000306000000000a00000000000020 + 0x2e000000000000000000250000000016001f))))) (.bin (.bin (.bin (.bin (.leaf8 0x240023 0x24000d + 0x2f00000000000000001620000000000b00000000010020 0x30000000000000000000260000000000001f 0x250023 + 0x25000d 0x30000000000000000000020000000017001f 0x100000000030023) (.leaf8 + 0x3200000000000000000099000000000c00000000000020 0x34000000000000000000290000000000001f 0x280023 + 0x28000d 0x34000000000000000000020000000019001f 0x100000000030023 + 0x360000000000000000046b000000000d00000000000020 0x380000000000000000002c000000001a001f)) (.bin + (.leaf8 0x1000000002c0023 0x3a0000000000000000001d000000000e00000000000020 + 0x3c0000000000000000002f0000000009001f (h240 0x1000000003000000000010000 + 0x10000000005000000000100000000310000000004001c) 0x31000f + 0x3e00000000000000000031000000001c0000000001001e 0x300023 0x30000d) (.leaf8 + 0x3f000000000000000000e0000000000f00000000010020 0x32000e (h240 0x10000 + 0x10000000002000000000100000000340000000003001c) 0x34000f + 0x4200000000000000000034000000001e0000000001001e 0x330023 0x33000d + 0x4300000000000000000004000000001000000000010020))) (.bin (.bin (.leaf8 0xd000e + 0x450000000000000000003700000000210000000000001e 0x360023 0x36000d + 0x460000000000000000002b000000001100000000010020 0x47000000000000000000370000000000001f 0x360023 + 0x36000d) (.leaf8 0x48000000000000000000020000000023001f (h240 0x1000000000300000000010000 + 0x1000000003b000000000100000000070000000004001c) 0x7000f + 0x4b0000000000000000000700000000230000000001001e 0x100000000080023 + 0x4d00000000000000000007000000001300000000000020 0x4f0000000000000000003e0000000000001f 0x3d0023)) + (.bin (.leaf8 0x3d000d 0x4f000000000000000000020000000026001f (h240 0x10000 + 0x200000000020000000000000000000100000000010000000003001c) 0x1000f + 0x510000000000000000000100000000280000000001001e 0x100000000020023 + 0x5300000000000000000000000000001500000000000020 0x44000e) (.leaf8 (h240 0x10000 + 0x500000000010000000049000000000100000000070000000003001c) 0x7000f + 0x570000000000000000000700000000000000000001001e 0x60023 0x6000d 0x2000e + 0x10000000002000000000100000000010000000002001c 0x20186)))) (.bin (.bin (.bin (.leaf8 0x10043 + 0x10142 0x101c3 0x20023 0x800c6 0x10043 0x10303 0x10009) (.leaf8 0x20008 0x10009 0x10021 + 0x800000000010016 0x500000000470016 0x4400000000430016 0x20014 + 0x40000000000000000000100000000460000000000001f)) (.bin (.leaf8 0x460009 0x20021 + 0x3f00000000000016 0x3000000003d001a 0x3e000000003d0016 0x80014 0x400010 0x10021) (.leaf8 0x390016 + 0x3800000000010016 0x160000000037001a 0xe00000000360016 0x20000000034001a 0x3500000000340016 0x16 + 0x710000000031001a))) (.bin (.bin (.leaf8 0x500000000300016 0x300014 0x70010 0x10021 + 0xe000000002e001a 0x2f000000002e0016 0x14 0x310010) (.leaf8 0x10021 0x2d000000002a0016 + 0x235000000002b001a 0x2a0016 0x2a00000000010016 0x4c0000000028001a 0x2900000000280016 0x30014)) + (.bin (.leaf8 0x2b0010 0x10021 0xb110000000025001a 0x2400000000240016 0x1820000000022001a + 0x2300000000220016 0x14 0x250010) (.leaf8 0x10021 0x2100000000060016 0x3754000000001f001a + 0x1f000000001f0016 0x1e00000000040016 0x791000000001c001a 0x1d000000001c0016 0x30016))))))) (.bin + (.bin (.bin (.bin (.bin (.bin (.leaf8 0x114ab0000000019001a 0x180016 0x80014 0x20010 0x10021 + 0x25dc0000000016001a 0x1600000000160016 0x30014) (.leaf8 0x180010 0x10021 0x567590000000013001a + 0x120016 0x16 0xbd510000000010001a 0xe0016 0x1b04c0000000000d001a)) (.bin (.leaf8 + 0xe000000000d0016 0x30016 0x3b297000000000a001a 0x80016 0x900000000010016 0x8717b40000000007001a + 0x800000000070016 0x16) (.leaf8 0x127d1e0000000004001a 0x500000000040016 0x14 0x70010 0x10021 + 0x300000000000016 0x2a3764e0000000001001a 0x100000000010016))) (.bin (.bin (.leaf8 0x14 + 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x20000000002000000000100005c719c000000000000000000010020 (h240 0x100000000000000 + 0x10000000004000000000000024704b0000000000000000000010020) 0x5000e (h240 0x10000 + 0x10000000002000000000100000000070000000003001c)) (.leaf8 0x7000f + 0x70000000000000000000700000000000000000001001e 0x60023 0x6000d + 0x800000000000000127d1d000000000100000000010020 0x2000e + 0x10000000000000000000100000000090000000002001c 0x9000f)) (.bin (.leaf8 + 0xb0000000000000000000900000000030000000001001e 0x80023 0x8000d + 0xc000000000000008717b3000000000200000000010020 0xd0000000000000000000b0000000000001f 0xa0023 + 0xa000d 0xd000000000000000000020000000004001f) (.leaf8 0x100000000020023 + 0xf0000000000000003b296000000000300000000000020 0x11000000000000000000020000000001001f (h240 + 0x10000 0x3000000000100000000000000000001000000000f0000000003001c) 0xf000f + 0x130000000000000000000f00000000070000000001001e 0xe0023 0xe000d)))) (.bin (.bin (.bin (.leaf8 + 0x14000000000000001b04bf000000000400000000010020 0x15000000000000000000020000000008001f + 0x100000000020023 0x170000000000000000bd50000000000500000000000020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x1b00000000000000000001000000000a0000000001001e) (.leaf8 0x100000000020023 + 0x1d00000000000000056758000000000600000000000020 0x5000e + 0x2000000000000000000018000000000d0000000000001e 0x170023 0x17000d + 0x21000000000000000025db000000000700000000010020 0xa000e)) (.bin (.leaf8 + 0x2300000000000000000002000000000e0000000000001e 0x100000000030023 + 0x25000000000000000114aa000000000800000000000020 0x27000000000000000000020000000001001f (h240 + 0x10000 0x3000000000100000000000000000001000000001e0000000003001c) 0x1e000f + 0x290000000000000000001e00000000110000000001001e 0x1d0023) (.leaf8 0x1d000d + 0x2a00000000000000000790000000000900000000010020 0x2b000000000000000000200000000002001f 0x1f0023 + 0x1f000d 0x2b000000000000000000210000000014001f 0x200023 0x20000d))) (.bin (.bin (.leaf8 + 0x2c00000000000000003753000000000a00000000010020 0x2d000000000000000000230000000003001f (h240 + 0x1000000002400000000010000 0x10000000002000000000100000000250000000004001c) 0x25000f + 0x2f0000000000000000002500000000140000000001001e 0x240023 0x24000d + 0x3000000000000000000181000000000b00000000010020) (.leaf8 0x31000000000000000000260000000017001f + 0x100000000270023 0x3200000000000000000b10000000000c00000000000020 0x5000e + 0x350000000000000000002b00000000190000000000001e 0x2a0023 0x2a000d + 0x360000000000000000004b000000000d00000000010020)) (.bin (.leaf8 + 0x370000000000000000002c0000000000001f 0x2b0023 0x2b000d 0x3700000000000000000002000000001b001f + 0x100000000030023 0x3900000000000000000234000000000e00000000000020 + 0x3b0000000000000000002f000000001b001f (h240 0x1000000003000000000010000 + 0x10000000002000000000100000000310000000004001c)) (.leaf8 0x31000f + 0x3d00000000000000000031000000001c0000000001001e 0x300023 0x30000d + 0x3e0000000000000000000d000000000f00000000010020 0x32000e + 0x3f00000000000000000007000000001e0000000000001e 0x100000000080023))))) (.bin (.bin (.bin (.bin + (.leaf8 0x4100000000000000000070000000001000000000000020 0x2000e + 0x10000000000000000000100000000360000000002001c 0x36000f + 0x450000000000000000003600000000210000000001001e 0x350023 0x35000d + 0x4600000000000000000001000000001100000000010020) (.leaf8 0x47000000000000000000100000000023001f + 0x100000000110023 0x4900000000000000000015000000001200000000000020 + 0x4b0000000000000000003a0000000000001f 0x390023 0x39000d 0x4c000000000000000000020000000025001f + (h240 0x1000000000300000000010000 0x1000000000a000000000100000000400000000004001c))) (.bin (.leaf8 + 0x40000f 0x4f0000000000000000004000000000260000000001001e 0x3f0023 0x3f000d + 0x5000000000000000000002000000001400000000010020 0x41000e (h240 0x1000000000000000000010000 + 0x200000000010000000005000000000100000000460000000004001c) 0x46000f) (.leaf8 + 0x540000000000000000004600000000290000000001001e 0x450023 0x45000d + 0x5500000000000000000007000000002e001f (h240 0x10000 + 0x700000000020000000000000000000100000000090000000003001c) 0x9000f 0x570000000000001d 0x80023))) + (.bin (.bin (.leaf8 0x8000d 0x3000e 0x40000000001000b 0x80016 0x70014 0x20010 0x10021 + 0x500000000450016) (.leaf8 0x16 0x20000000040001a 0xa000000003f0016 0x30014 0xc0010 0x10021 + 0x3c00000000390016 0xa000000003a001a)) (.bin (.leaf8 0x390016 0x39000000000f0016 + 0x3700000000370016 0x30014 0x390010 0x10021 0x380000000034001a 0x330016) (.leaf8 + 0x3300000000060016 0x70000000031001a 0x200000000300016 0x300014 0x40010 0x10021 + 0x11a000000002e001a 0x2d0016)))) (.bin (.bin (.bin (.leaf8 0x2d00000000010016 0x26000000002b001a + 0x6000000002a0016 0x5880000000028001a 0x270016 0xc10000000025001a 0x2600000000250016 0x16) (.leaf8 + 0x1baa0000000022001a 0x2200000000220016 0x3c9000000001f001a 0x1d0016 0x1e00000000010016 + 0x8a54000000001c001a 0x1d000000001c0016 0x30014)) (.bin (.leaf8 0x1f0010 0x10021 + 0x1b00000000090016 0x12ed0000000019001a 0x1900000000190016 0x1800000000040016 + 0x2b3ab0000000016001a 0x1700000000160016) (.leaf8 0x20014 + 0x300000000040000000000000000000200000000190000000000001f 0x190009 0x10021 0x5ea80000000013001a + 0x120016 0x20014 0x20010))) (.bin (.bin (.leaf8 0x10021 0xd82600000000010001a 0xe0016 + 0xf00000000010016 0x1d94a000000000d001a 0xe000000000d0016 0x14 0x100010) (.leaf8 0x10021 + 0xc00000000000016 0x438bda000000000a001a 0x80016 0x900000000010016 0x93e8e0000000007001a + 0x800000000070016 0x16)) (.bin (.leaf8 0x151bb270000000004001a 0x400000000040016 + 0x2e38cf0000000001001a 0x16 0x14 0x2000e 0x10022 + 0x20000000002000000000100002e38ce000000000000000000000020) (.leaf8 + 0x20000000004000000000100000000060000000002001f 0x50023 0x5000d + 0x200000000050000000001000151bb26000000000100000000010020 0x2000e + 0x10000000000000000000100000000090000000002001c 0x9000f + 0x200000000080000000001000000000900000000030000000001001e)))))) (.bin (.bin (.bin (.bin (.bin + (.leaf8 0x80023 0x8000d 0x2000000000900000000010000093e8d000000000200000000010020 + 0x2000000000a0000000001000000000b0000000000001f 0xa0023 0xa000d + 0x2000000000a000000000100000000020000000004001f 0x100000000020023) (.leaf8 + 0x2000000000c00000000010000438bd9000000000300000000000020 0xe000e (h240 0x10000 + 0x10000000002000000000100000000100000000003001c) 0x10000f + 0x200000000100000000001000000001000000000060000000001001e 0xf0023 0xf000d + 0x200000000110000000001000001d949000000000400000000010020)) (.bin (.leaf8 + 0x20000000012000000000100000000110000000000001f 0x100023 0x10000d + 0x20000000012000000000100000000020000000008001f 0x100000000020023 + 0x200000000140000000001000008814c000000000500000000000020 + 0x20000000016000000000100000000140000000003001f (h240 0x100000000000000 + 0x100000000170000000000000000001400000000060000000000001e)) (.leaf8 0x130023 0x13000d + 0x1800000000000000050111000000000500000000010020 0x4000e + 0x1900000000000000000002000000000a0000000000001e 0x100000000030023 + 0x1b00000000000000005ea7000000000600000000000020 0x5000e))) (.bin (.bin (.leaf8 + 0x10000000005000000000100000000190000000002001c 0x19000f + 0x1f00000000000000000019000000000b0000000001001e 0x180023 0x18000d + 0x200000000000000002b3aa000000000700000000010020 0x210000000000000000001a0000000002001f 0x190023) + (.leaf8 0x19000d 0x210000000000000000001b0000000010001f 0x1a0023 0x1a000d + 0x22000000000000000012ec000000000800000000010020 0x230000000000000000001d0000000005001f (h240 + 0x1000000001e00000000010000 0x100000000050000000001000000001f0000000004001c) 0x1f000f)) (.bin + (.leaf8 0x250000000000000000001f00000000100000000001001e 0x1e0023 0x1e000d + 0x2600000000000000008a53000000000900000000010020 0x27000000000000000000200000000000001f 0x1f0023 + 0x1f000d 0x27000000000000000000020000000012001f) (.leaf8 0x100000000020023 + 0x29000000000000000003c8000000000a00000000000020 0x2b000000000000000000240000000016001f 0x230023 + 0x23000d 0x2c00000000000000001ba9000000000b00000000010020 0x2000e + 0x10000000000000000000100000000270000000002001c)))) (.bin (.bin (.bin (.leaf8 0x27000f + 0x2f0000000000000000002700000000170000000001001e 0x260023 0x26000d + 0x30000000000000000000c0000000000c00000000010020 0x31000000000000000000020000000019001f + 0x100000000030023 0x3300000000000000000587000000000d00000000000020) (.leaf8 + 0x3500000000000000000008000000001b001f 0x100000000090023 + 0x3700000000000000000025000000000e00000000000020 0x390000000000000000002f0000000000001f 0x2e0023 + 0x2e000d 0x3900000000000000000002000000001d001f 0x100000000030023)) (.bin (.leaf8 + 0x3b00000000000000000119000000000f00000000000020 0x32000e + 0x3d00000000000000000004000000001e0000000000001e 0x100000000050023 + 0x3f00000000000000000006000000001000000000000020 0x41000000000000000000350000000003001f (h240 + 0x10000 0x3600000000010000000000000000000100000000010000000003001c) 0x1000f) (.leaf8 + 0x420000000000000000000100000000200000000001001e 0x100000000020023 + 0x4400000000000000000037000000001100000000000020 0x5000e + 0x470000000000000000003900000000230000000000001e 0x380023 0x38000d + 0x480000000000000000003b0000000009001f))) (.bin (.bin (.leaf8 (h240 0x10000 + 0x3c00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x4a0000000000000000000100000000240000000001001e 0x100000000020023 + 0x4c00000000000000000009000000001300000000000020 0x4e0000000000000000003e0000000025001f (h240 + 0x1000000003f00000000010000 0x100000000050000000001000000000c0000000004001c) 0xc000f) (.leaf8 + 0x500000000000000000000c00000000270000000001001e 0x1000000000d0023 + 0x5200000000000000000001000000001500000000000020 0x2000e + 0x10000000000000000000100000000060000000002001c 0x6000f + 0x5600000000000000000006000000002c0000000001001e (h240 0x1000000000700000000010000 + 0x10000000009000000000100000000020000000004001c))) (.bin (.leaf8 0x2000f + 0x590000000000000000000200000000020000000001001e (h240 0x10000 + 0x200000000020000000000000000000100000000050000000003001c) 0x20186 0x10043 0x50142 0x101c3 + 0x60023) (.leaf8 0x1000c6 0x10043 0x10303 0x10009 0x8 (h240 0x20000 + 0x100000000000000000002000000000100000000000000000000001e) 0x10009 0x20021))))) (.bin (.bin (.bin + (.bin (.leaf8 0x70016 0x50016 0x4500000000010016 0x420016 0x5000000000b0016 0x3f0014 0x70010 + 0x10021) (.leaf8 0x4000000003d001a 0x3e000000003d0016 0x20014 + 0x3c00000000040000000000000000000200000000400000000000001f 0x400009 0x20021 0x600000000380016 + 0x1b0000000037001a)) (.bin (.leaf8 0x3800000000370016 0x20014 + 0x36000000000400000000000000000002000000003a0000000000001f 0x3a0009 0x20021 0x30000000034001a + 0x330016 0x3300000000030016) (.leaf8 0x8c0000000031001a 0x3200000000310016 0x30014 0x340010 + 0x10021 0x13000000002e001a 0x2d0016 0x2d00000000070016))) (.bin (.bin (.leaf8 0x2c3000000002b001a + 0x2a0016 0x2a00000000010016 0x600000000028001a 0x260016 0x2700000000010016 0xdd40000000025001a + 0x2500000000250016) (.leaf8 0x1e40000000022001a 0x210016 0x20014 0x20010 0x10021 + 0x452a000000001f001a 0x20000000001f0016 0x30016)) (.bin (.leaf8 0x977000000001c001a + 0x1b000000001a0016 0x159d50000000019001a 0x1a00000000190016 0x600000000030016 0x2f530000000016001a + 0x1700000000160016 0x30014) (.leaf8 0x190010 0x10021 0x1500000000030016 0x6c12f0000000013001a + 0x120016 0x20014 0x20010 0x10021)))) (.bin (.bin (.bin (.leaf8 0xeca50000000010001a + 0x1100000000100016 0x16 0x21c5ed000000000d001a 0xc0016 0x20014 0x20010 0x10021) (.leaf8 + 0x49f47000000000a001a 0xa000000000a0016 0x30014 0xc0010 0x10021 0xa8dd930000000007001a + 0x700000000070016 0x171c670000000004001a)) (.bin (.leaf8 0x30016 0x34c54070000000001001a 0x16 0x14 + 0x2000e 0x10022 0x2000000000200000000010000738e1b000000000000000000000020 (h240 0x100000000000000 + 0x1000000000500000000000002d8c5ea000000000000000000010020)) (.leaf8 + 0x6000000000000000000020000000001001f 0x100000000030023 + 0x800000000000000171c66000000000100000000000020 0xa000000000000000000090000000004001f 0x80023 + 0x8000d 0xb00000000000000a8dd92000000000200000000010020 0x5000e))) (.bin (.bin (.leaf8 + 0xd0000000000000000000c00000000050000000000001e 0xb0023 0xb000d + 0xe00000000000000049f46000000000300000000010020 0x4000e + 0x100000000000000000000200000000060000000000001e 0x100000000030023 + 0x120000000000000021c5ec000000000400000000000020) (.leaf8 0x2000e + 0x10000000000000000000100000000120000000002001c 0x12000f + 0x160000000000000000001200000000090000000001001e 0x110023 0x11000d + 0x170000000000000000eca4000000000500000000010020 0x4000e)) (.bin (.leaf8 + 0x1900000000000000000002000000000a0000000000001e 0x100000000030023 + 0x1b0000000000000006c12e000000000600000000000020 0x1d000000000000000000170000000001001f (h240 + 0x1000000001800000000010000 0x10000000005000000000100000000190000000004001c) 0x19000f + 0x1f00000000000000000019000000000c0000000001001e 0x180023) (.leaf8 0x18000d + 0x2000000000000000002f52000000000700000000010020 0x21000000000000000000080000000001001f (h240 + 0x10000 0x9000000000100000000000000000001000000001b0000000003001c) 0x1b000f + 0x230000000000000000001b000000000f0000000001001e 0x1a0023 0x1a000d))))))))) (.bin (.bin (.bin + (.bin (.bin (.bin (.bin (.bin (.leaf8 0x24000000000000000159d4000000000800000000010020 + 0x250000000000000000001d0000000010001f 0x1000000001d0023 + 0x2700000000000000000976000000000900000000000020 0x29000000000000000000020000000001001f (h240 + 0x10000 0x300000000010000000000000000000100000000210000000003001c) 0x21000f + 0x2b0000000000000000002100000000130000000001001e) (.leaf8 0x200023 0x20000d + 0x2c00000000000000004529000000000a00000000010020 0x4000e + 0x2e0000000000000000000200000000140000000000001e 0x100000000030023 + 0x30000000000000000001e3000000000b00000000000020 0x32000000000000000000270000000018001f)) (.bin + (.leaf8 0x260023 0x26000d 0x3300000000000000000dd3000000000c00000000010020 + 0x34000000000000000000290000000000001f 0x280023 0x28000d 0x34000000000000000000020000000018001f + 0x100000000020023) (.leaf8 0x360000000000000000005f000000000d00000000000020 + 0x380000000000000000002c0000000000001f 0x2b0023 0x2b000d 0x3800000000000000000002000000001b001f + 0x100000000030023 0x3a000000000000000002c2000000000e00000000000020 + 0x3c0000000000000000002f0000000004001f))) (.bin (.bin (.leaf8 0x2e0023 0x2e000d + 0x3c00000000000000000002000000001d001f 0x100000000030023 + 0x3e00000000000000000012000000000f00000000000020 0x5000e + 0x4100000000000000000034000000001f0000000000001e 0x330023) (.leaf8 0x33000d + 0x420000000000000000008b000000001000000000010020 0x43000000000000000000350000000001001f (h240 + 0x10000 0x3600000000010000000000000000000100000000010000000003001c) 0x1000f + 0x440000000000000000000100000000200000000001001e 0x100000000020023 + 0x4600000000000000000002000000001100000000000020)) (.bin (.leaf8 0x38000e + 0x100000000050000000001000000003a0000000002001c 0x3a000f + 0x490000000000000000003a00000000210000000001001e 0x390023 0x39000d + 0x4a0000000000000000001a000000001200000000010020 0x4b000000000000000000080000000024001f) (.leaf8 + (h240 0x100000000080000000002000000000000000000010000 + 0x3e00000000010000000005000000000100000000400000000005001c) 0x40000f + 0x4f0000000000000000004000000000250000000001001e 0x3f0023 0x3f000d + 0x5000000000000000000003000000001400000000010020 0x41000e + 0x510000000000000000000700000000050000000000001e)))) (.bin (.bin (.bin (.leaf8 (h240 0x10000 + 0x700000000020000000000000000000100000000010000000003001c) 0x1000f + 0x5300000000000000000001000000002a0000000001001e (h240 0x10000 + 0x200000000010000000000000000000100000000460000000003001c) 0x46000f 0x550000000000001d 0x450023 + 0x45000d) (.leaf8 0x56000000000000000000020000000002001f (h240 0x10000 + 0x200000000020000000000000000000100000000010000000003001c) 0x1000f + 0x580000000000000000000100000000030000000001001e 0x23 0xd 0x4000e + 0x10000000002000000000100000000010000000002001c)) (.bin (.leaf8 0x1000f + 0x5b0000000000000000000100000000000000000001001e 0x20000000000000b 0x200000000030016 0x14 0x40010 + 0x10021 0x4700000000000016) (.leaf8 0x20014 0x49000e (h240 0x10000 + 0x10000000002000000000100000000040000000003001c) 0x4000f 0x400000000030000000001001d (h240 0x10000 + 0x500000000010000000000000000000100000000020000000003001c) 0x800c6 0x10043))) (.bin (.bin (.leaf8 + 0x10303 0x10009 0x200000000030016 0x4a0014 0x40010 0x10021 0x200000000030016 0x700000000010019) + (.leaf8 0x510000000000001d 0x50023 0x300000000000000000001009c 0x30003 0x3000f (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x107da35500000000000000 + 0x100000000020000738e1d0000000003000000000100000000000000) + 0x1000000000500034c54060000000006000000000100000000030000) + 0x10000000000000000000100000000080000171c6600000000090000) + 0x1000000000a0000a8dd93000000000c000000000100000000060000) + 0x1000000000d0000049f47000000000f000000000100000000050000) + 0x1000000000300000000010000000000000000000100000000110000) + 0x21c5ec000000001200000000010000000003000000000100000000000000) + 0x10000000013000000eca50000000015000000000100000000050000) + 0x1000000000300000000010000000000000000000100000000170000) + 0x6c12f000000001800000000010000000000000000000100000000050000) + 0x1000000001a0000002f53000000001b000000000100000000090000) + 0x100000000000000000001000000001c00000159d5000000001e0000) + 0x1000000001d00000000020000000000000000000100000000200000) + 0x976000000002100000000010000000003000000000100000000000000) + 0x10000000022000000452a0000000024000000000100000000050000) + 0x1000000000300000000010000000000000000000100000000260000) + 0x1e30000000027000000000100000000280000000dd5000000002a0000) + 0x10000000002000000000200000000000000000001000000002c0000) + 0x60000000002d00000000010000000003000000000100000000000000) + 0x1000000002f00000002c30000000030000000000100000000030000) + 0x1000000000000000000010000000032000000001200000000330000) + 0x1000000000600000000010000000035000000008d00000000360000) + 0x1000000000000000000010000000002000000000100000000000000) + 0x1000000003800000000030000000039000000000100000000050000) + 0x1000000003b000000001b000000003c000000000100000000080000) + 0x200000000000000000001000000003e000000000100000000050000) + 0x1000000004100000000050000000042000000000100000000060000) + 0x5200000000010000000000000000000300000000000000000001001e) (h240 0x1000000000400000000010000 + 0x1000000004c000000000100000000040000000004001c) 0x4000f)) (.bin (.leaf8 0x560000000000001d (h240 + 0x10000 0x500000000010000000000000000000100000000010000000003001c) 0x1000f 0x580000000000001d + 0x1000b 0x4c00000000030016 0x40014 0x600000000000000000001000000004e0000000000001f) (.leaf8 + 0x4e0009 0x20021 0x4200000000040016 0x20000000040001a 0x5000000003f0016 0x3c0016 0x80014 + 0x20010))))) (.bin (.bin (.bin (.bin (.leaf8 0x10021 0xd000000003a001a 0x3b000000003a0016 + 0x3900000000030016 0x10000000037001a 0x360016 0x16 0x460000000034001a) (.leaf8 0x3500000000340016 + 0x3300000000040016 0x80000000031001a 0x3200000000310016 0x30014 0x340010 0x10021 + 0x161000000002e001a)) (.bin (.leaf8 0x2f000000002e0016 0x30014 0x310010 0x10021 0x30000000002b001a + 0x2a0016 0x20014 0x20010) (.leaf8 0x10021 0x6ea0000000028001a 0x2800000000280016 + 0xf10000000025001a 0x2600000000250016 0x30014 0x280010 0x10021))) (.bin (.bin (.leaf8 + 0x2400000000030016 0x22940000000022001a 0x2200000000220016 0x30014 0x240010 0x10021 + 0x4bb000000001f001a 0x1e0016) (.leaf8 0x1d0014 0x20010 0x10021 0xacea000000001c001a + 0x1c000000001c0016 0x90014 0x1e0010 0x10021)) (.bin (.leaf8 0x17a90000000019001a + 0x1a00000000190016 0x30016 0x360970000000016001a 0x1700000000160016 0x30014 0x190010 0x10021) + (.leaf8 0x1500000000030016 0x76520000000013001a 0x110016 0x1200000000010016 0x10e2f50000000010001a + 0x1100000000100016 0x30014 0x130010)))) (.bin (.bin (.bin (.leaf8 0x10021 0xf00000000030016 + 0x24fa3000000000d001a 0x6000000000b0016 0x546ec9000000000a001a 0xa000000000a0016 + 0xb8e330000000007001a 0x60016) (.leaf8 0x600000000010016 0x1a62a020000000004001a 0x500000000040016 + 0x30014 0x70010 0x10021 0x39c70e0000000001001a 0x16)) (.bin (.leaf8 0x14 0x2000e 0x10022 + 0x200000000020000000001000039c70d000000000000000000000020 0x5000e + 0x200000000040000000001000000000700000000010000000000001e 0x60023 0x6000d) (.leaf8 + 0x2000000000500000000010001a62a01000000000100000000010020 + 0x20000000006000000000100000000080000000000001f 0x70023 0x7000d + 0x20000000006000000000100000000020000000003001f 0x100000000030023 + 0x20000000008000000000100000b8e32000000000200000000000020 + 0x2000000000a0000000001000000000c0000000006001f))) (.bin (.bin (.leaf8 0xb0023 0xb000d + 0x2000000000b00000000010000546ec8000000000300000000010020 + 0x2000000000c000000000100000000080000000006001f 0x100000000080023 + 0x2000000000e00000000010000024fa2000000000400000000000020 + 0x20000000010000000000100000000110000000001001f (h240 0x1000000001200000000010000 + 0x10000000005000000000100000000130000000004001c)) (.leaf8 0x13000f + 0x200000000120000000001000000001300000000080000000001001e 0x120023 0x12000d + 0x20000000013000000000100000aa190000000000500000000010020 + 0x20000000014000000000100000000140000000003001f (h240 0x100000000000000 + 0x100000000150000000000000000001400000000060000000000001e) 0x130023)) (.bin (.leaf8 0x13000d + 0x1600000000000000064162000000000500000000010020 0x16000000000000000000140000000000001f 0x130023 + 0x13000d 0x1600000000000000000002000000000a001f 0x100000000020023 + 0x1800000000000000007651000000000600000000000020) (.leaf8 0x1a000000000000000000170000000001001f + (h240 0x1000000001800000000010000 0x10000000005000000000100000000190000000004001c) 0x19000f + 0x1c00000000000000000019000000000c0000000001001e 0x180023 0x18000d + 0x1d00000000000000036096000000000700000000010020 0x1e000000000000000000020000000001001f)))))) + (.bin (.bin (.bin (.bin (.bin (.leaf8 (h240 0x10000 + 0x3000000000100000000000000000001000000001b0000000003001c) 0x1b000f + 0x200000000000000000001b000000000f0000000001001e 0x1a0023 0x1a000d + 0x21000000000000000017a8000000000800000000010020 0xb000e + 0x230000000000000000001e00000000110000000000001e) (.leaf8 0x1d0023 0x1d000d + 0x240000000000000000ace9000000000900000000010020 0x1f000e + 0x260000000000000000000200000000120000000000001e 0x100000000030023 + 0x28000000000000000004ba000000000a00000000000020 0x5000e)) (.bin (.leaf8 + 0x2b0000000000000000002400000000150000000000001e 0x230023 0x23000d + 0x2c00000000000000002293000000000b00000000010020 0x2d000000000000000000260000000001001f (h240 + 0x1000000002700000000010000 0x10000000005000000000100000000280000000004001c) 0x28000f + 0x2f0000000000000000002800000000160000000001001e) (.leaf8 0x270023 0x27000d + 0x30000000000000000000f0000000000c00000000010020 0x310000000000000000002a000000001a001f 0x290023 + 0x29000d 0x32000000000000000006e9000000000d00000000010020 0x4000e))) (.bin (.bin (.leaf8 + 0x3400000000000000000002000000001a0000000000001e 0x100000000030023 + 0x360000000000000000002f000000000e00000000000020 0x5000e + 0x3900000000000000000031000000001d0000000000001e 0x300023 0x30000d + 0x3a00000000000000000160000000000f00000000010020) (.leaf8 0x5000e + 0x3c00000000000000000034000000001f0000000000001e 0x330023 0x33000d + 0x3d00000000000000000007000000001000000000010020 0x3e000000000000000000350000000002001f 0x340023 + 0x34000d)) (.bin (.leaf8 0x3e000000000000000000370000000022001f 0x360023 0x36000d + 0x3f00000000000000000045000000001100000000010020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x420000000000000000000100000000220000000001001e) (.leaf8 0x100000000020023 + 0x4400000000000000000000000000001200000000000020 0x450000000000000000003b0000000001001f (h240 + 0x10000 0x3c000000000100000000000000000001000000003c0000000003001c) 0x3c000f + 0x470000000000000000003c00000000250000000001001e 0x3b0023 0x3b000d)))) (.bin (.bin (.bin (.leaf8 + 0x480000000000000000000c000000001300000000010020 0xa000e + 0x4a0000000000000000000200000000260000000000001e (h240 0x10000 + 0x300000000010000000000000000000100000000060000000003001c) 0x6000f + 0x4c0000000000000000000600000000280000000001001e 0x100000000070023 + 0x4e00000000000000000001000000001500000000000020) (.leaf8 0x50000000000000000000440000000002001f + 0x430023 0x43000d 0x2000e (h240 0x1000000000700000000010000 + 0x4f00000000010000000000000000000100000000010000000004001c) 0x20186 0x10043 0x10142)) (.bin + (.leaf8 0x101c3 0x20023 0x800c6 0x10043 0x10303 0x10009 0x8 0x10009) (.leaf8 0x10021 + 0x7000000004d0016 0x4500000000010016 0x4400000000430016 0x70014 + 0x300000000090000000000000000000200000000460000000000001f 0x460009 0x20021))) (.bin (.bin (.leaf8 + 0x3f00000000090016 0x6000000003d001a 0x3b0016 0x3b000000003a0016 0x20014 + 0x3000000000400000000000000000002000000003d0000000000001f 0x3d0009 0x10021) (.leaf8 + 0x230000000037001a 0x3600000000360016 0x40000000034001a 0x600000000330016 0xb00000000031001a + 0x3200000000310016 0x3000000000040016 0x17000000002e001a)) (.bin (.leaf8 0x2d0016 + 0x500000000010016 0x375000000002b001a 0x2a00000000290016 0x780000000028001a 0x500000000270016 + 0x270014 0x70010) (.leaf8 0x10021 0x114a0000000025001a 0x600000000230016 0x25d0000000022001a + 0x210016 0x2000000000010016 0x5675000000001f001a 0xc000000001d0016))))) (.bin (.bin (.bin (.bin + (.leaf8 0xbd4000000001c001a 0x1c000000001c0016 0x30014 0x1e0010 0x10021 0x1b04b0000000019001a + 0x1a00000000190016 0x30016) (.leaf8 0x3b290000000016001a 0x150016 0x20014 0x20010 0x10021 + 0x8717b0000000013001a 0x500000000120016 0x120014)) (.bin (.leaf8 0x70010 0x10021 + 0x127d10000000010001a 0xf0016 0x80014 0x20010 0x10021 0x2a3764000000000d001a) (.leaf8 + 0xd000000000d0016 0x5c719000000000a001a 0x90016 0x900000000010016 0xd315010000000007001a + 0x600000000060016 0x1ce3860000000004001a 0x500000000040016))) (.bin (.bin (.leaf8 0x30014 0x70010 + 0x10021 0x41f68d60000000001001a 0x200000000010016 0x14 + 0x20000000000000000000100000000040000000000001f 0x30023) (.leaf8 0x3000d + 0x20000000002000000000100009071b7000000000000000000010020 0x50010 0x40021 0x17 0x1d 0x103c3 (h240 + 0x9071ba000000000300000000010000 0x500009071b80000000006000000000100000000040000000004001c))) + (.bin (.leaf8 0x4000d (h240 0x20000000000000000000100000000010000 + 0x20000000003000000000000038ef71c000000000000000000010020) 0x5000e + 0x50000000000000000000700000000010000000000001e 0x60023 0x6000d + 0x6000000000000001ce385000000000100000000010020 0x7000000000000000000080000000003001f) (.leaf8 + 0x100000000090023 0x800000000000000d31500000000000200000000000020 + 0xa0000000000000000000b0000000000001f 0xa0023 0xa000d 0xa000000000000000000020000000005001f + 0x100000000030023 0xc0000000000000005c718000000000300000000000020)))) (.bin (.bin (.bin (.leaf8 + 0xe0000000000000000000f0000000008001f 0xe0023 0xe000d + 0xf000000000000002a3763000000000400000000010020 0xa000e + 0x110000000000000000000200000000080000000000001e 0x100000000030023 + 0x13000000000000000127d0000000000500000000000020) (.leaf8 0x14000e + 0x1500000000000000000007000000000a0000000000001e 0x100000000080023 + 0x170000000000000008717a000000000600000000000020 0x4000e + 0x1a00000000000000000002000000000c0000000000001e 0x100000000030023 + 0x1c00000000000000003b28000000000700000000000020)) (.bin (.leaf8 + 0x1e000000000000000000020000000001001f (h240 0x10000 + 0x3000000000100000000000000000001000000001b0000000003001c) 0x1b000f + 0x200000000000000000001b000000000f0000000001001e 0x1a0023 0x1a000d + 0x210000000000000001b04a000000000800000000010020 0x5000e) (.leaf8 + 0x230000000000000000001e00000000110000000000001e 0x1d0023 0x1d000d + 0x2400000000000000000bd3000000000900000000010020 0x250000000000000000000e0000000012001f + 0x1000000000e0023 0x2700000000000000005674000000000a00000000000020 + 0x29000000000000000000220000000000001f))) (.bin (.bin (.leaf8 0x210023 0x21000d + 0x2a000000000000000000020000000015001f 0x100000000030023 + 0x2c0000000000000000025c000000000b00000000000020 0x2e000000000000000000080000000016001f + 0x100000000080023 0x3000000000000000001149000000000c00000000000020) (.leaf8 0x29000e + 0x320000000000000000000700000000180000000000001e 0x100000000080023 + 0x3400000000000000000077000000000d00000000000020 0x360000000000000000002c000000001a001f + 0x1000000002c0023 0x3800000000000000000374000000000e00000000000020 + 0x3a000000000000000000070000000000001f)) (.bin (.leaf8 0x60023 0x6000d + 0x3b00000000000000000002000000001d001f 0x100000000030023 + 0x3d00000000000000000016000000000f00000000000020 0x3f000000000000000000320000000002001f 0x310023 + 0x31000d) (.leaf8 0x3f000000000000000000340000000020001f 0x330023 0x33000d + 0x40000000000000000000af000000001000000000010020 0x41000000000000000000080000000021001f + 0x100000000090023 0x4300000000000000000003000000001100000000000020 + 0x45000000000000000000380000000023001f))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x100000000390023 0x4600000000000000000022000000001200000000000020 0x5000e + 0x100000000050000000001000000003d0000000002001c 0x3d000f + 0x4a0000000000000000003d00000000230000000001001e 0x3c0023 0x3c000d) (.leaf8 + 0x4b000000000000000000020000000026001f 0x100000000020023 + 0x4d00000000000000000005000000001400000000000020 0x4f000000000000000000410000000005001f (h240 + 0x100000000420000000001000000000000000000010000 + 0x50000000001000000000a000000000100000000460000000005001c) 0x46000f + 0x520000000000000000004600000000290000000001001e 0x450023)) (.bin (.leaf8 0x45000d + 0x53000000000000000000470000000000001f 0x460023 0x46000d 0x54000000000000000000090000000032001f + (h240 0x1000000000900000000020000 0x10000000001000000000100000000010000000004001c) 0x600c6 + 0x10043) (.leaf8 0x10142 0x101c3 0x20009 0x14 0x2000e 0x20186 0x10043 0x30142))) (.bin (.bin + (.leaf8 0x101c3 0x40023 0xc00c6 0x10043 0x10303 0x10009 0x20008 0x10009) (.leaf8 0x10021 + 0x900000000010019 0x540000000000001d 0x70023 (h240 0x20000 + 0x10000000003000000000100000000010000000003009c) 0x1000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 0x149d0cda00000000000000000001000000000100009071ba0000 + 0x30000000001000000000500041f68d7000000000600000000010000) + 0x800001ce38700000000090000000001000000000000000000010000) + 0xb0000d31501000000000c0000000001000000000300000000010000) + 0x1000000000e000005c718000000000f00000000010000) + 0x1000002a376400000000120000000001000000000b00000000010000) + 0x3000000000100000000000000000001000000001400000127d10000) + 0x15000000000100000000080000000001000000000000000000010000) + 0x17000008717a00000000180000000001000000000500000000010000) + 0x3000000000100000000000000000001000000001a0000003b280000) + 0x1b000000000100000000030000000001000000000000000000010000) + 0x1c000001b04b000000001e0000000001000000000600000000010000) + 0x1f0000000bd400000000210000000001000000000e00000000020000) + 0x100000000230000005674000000002400000000010000) + 0x23000000000100000000030000000001000000000000000000010000) + 0x26000000025c00000000270000000001000000000800000000020000) + 0x10000000029000000114a000000002a00000000010000) + 0x8000000000100000000000000000001000000002c00000000770000) + 0x2d0000000001000000002c0000000002000000000000000000010000) + 0x2f000000037400000000300000000001000000000800000000010000) + 0x3000000000100000000000000000001000000003200000000170000) + 0x330000000001000000003500000000b0000000003600000000010000) + 0x9000000000100000000000000000001000000003800000000040000) + 0x39000000000100000000000000000001000000003b00000000220000) + 0x3c000000000100000000060000000001000000000500000000010000) + 0x3e000000000100000000020000000002000000000000000000010000) + 0x41000000000600000000420000000001000000000000000000010000) + 0x50000000001000000000a0000000001000000004700000000010000) + 0x4800000000010000000008000000005500000000020000000000001d) 0x1000a)) (.bin (.leaf8 0x30008 + 0x400000000000000000001000000000100000000000000000000001e 0x50000000001000b 0x13 0x80008 (h240 + 0x10000 0x200000000010000000000000000000100000000060000000003001c) 0x20186 0x10043) (.leaf8 + 0x60142 0x101c3 0x70023 0x1200c6 0x10043 0x10303 0x10009 0x8)))) (.bin (.bin (.bin (.leaf8 0x10009 + 0x10021 0x900000000000016 0x4800000000010019 0x530000000000001d 0x460023 + 0x300000000000000000001009c 0xb0003) (.leaf8 (h240 0x10000 + 0x10000000001000000000100000000010000000003001c) 0x1000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 0x149d0cde00000000000000 + 0x1000000000100009071ba0000000003000000000100000000050004) + 0x1f68d700000000060000000001000000000800001ce38700000000090000) + 0x100000000000000000001000000000b0000d31501000000000c0000) + 0x10000000003000000000100000000000000000001000000000e0000) + 0x5c718000000000f0000000001000000001000002a376400000000120000) + 0x1000000000b00000000010000000003000000000100000000000000) + 0x1000000001400000127d10000000015000000000100000000080000) + 0x1000000000000000000010000000017000008717a00000000180000) + 0x1000000000500000000010000000003000000000100000000000000) + 0x1000000001a0000003b28000000001b000000000100000000030000) + 0x100000000000000000001000000001c000001b04b000000001e0000) + 0x100000000060000000001000000001f0000000bd400000000210000) + 0x1000000000e00000000020000000000000000000100000000230000) + 0x5674000000002400000000010000000023000000000100000000030000) + 0x1000000000000000000010000000026000000025c00000000270000) + 0x1000000000800000000020000000000000000000100000000290000) + 0x114a000000002a00000000010000000008000000000100000000000000) + 0x1000000002c0000000077000000002d0000000001000000002c0000) + 0x200000000000000000001000000002f000000037400000000300000) + 0x1000000000800000000010000000003000000000100000000000000) + 0x1000000003200000000170000000033000000000100000000350000) + 0xb0000000003600000000010000000009000000000100000000000000) + 0x1000000003800000000040000000039000000000100000000000000) + 0x1000000003b0000000022000000003c000000000100000000060000) + 0x100000000050000000001000000003e000000000100000000020000) + 0x2000000000000000000010000000041000000000600000000420000) + 0x10000000000000000000100000000050000000001000000000a0000) + 0x20000000047000000000200000000000000000001000000000b0000) + 0x5500000000020000000000000000000100000000010000000001001e) 0x1000a 0x10008 (h240 0xb0000 + 0x200000000000000000002000000000100000000000000000000001e) 0x30000000001000b 0xb0013)) (.bin + (.leaf8 0x8 (h240 0x470000 0x100000000000000000002000000000100000000000000000000001e) 0x10009 + 0x20021 0xa00000000450016 0x30016 0x30000000040001a 0x3f0016) (.leaf8 0x20014 0x20010 0x10021 + 0x5000000003c0016 0x3c00000000040016 0x10000000003a001a 0x3b000000003a0016 0x390014))) (.bin (.bin + (.leaf8 0x3d0010 0x10021 0x10000000037001a 0x3800000000370016 0x90014 0x3a0010 0x10021 + 0x580000000034001a) (.leaf8 0x3300000000330016 0xb0000000031001a 0x300016 0x800000000010016 + 0x1ba000000002e001a 0x2d0016 0x2c0014 0x20010)) (.bin (.leaf8 0x10021 0x3b000000002b001a + 0x2c000000002b0016 0x80014 0x2e0010 0x10021 0x8a50000000028001a 0x270016) (.leaf8 0x80014 0x20010 + 0x10021 0x12e0000000025001a 0x240016 0x2300000000010016 0x2b3a0000000022001a 0x210016))))) (.bin + (.bin (.bin (.bin (.leaf8 0xe0014 0x20010 0x10021 0x5ea000000001f001a 0x6000000001d0016 + 0xd825000000001c001a 0x1c000000001c0016 0x30014) (.leaf8 0x1e0010 0x10021 0x1d940000000019001a + 0x180016 0x500000000010016 0x438bd0000000016001a 0x150016 0x1500000000060016)) (.bin (.leaf8 + 0x93e80000000013001a 0x120016 0xb00000000010016 0x151bb20000000010001a 0xf000000000e0016 + 0x2e38b000000000d001a 0xe000000000d0016 0x30014) (.leaf8 0x100010 0x10021 0x698a80000000000a001a + 0xb000000000a0016 0x90014 0xd0010 0x10021 0xe71c30000000007001a))) (.bin (.bin (.leaf8 + 0x600000000060016 0x20fb46b0000000004001a 0x300000000030016 0x4838dc0000000001001a + 0x100000000010016 0x14 0x20000000000000000000100000000030000000000001f 0x20023) (.leaf8 0x2000d + 0x20000000002000000000100004838db000000000000000000010020 + 0x20000000003000000000100000000050000000001001f 0x100000000060023 + 0x20000000004000000000100020fb46a000000000100000000000020 + 0x20000000006000000000100000000080000000003001f 0x100000000090023 + 0x20000000007000000000100000e71c2000000000200000000000020)) (.bin (.leaf8 0xb000e + 0x200000000090000000001000000000d00000000050000000000001e 0xc0023 0xc000d + 0x2000000000a00000000010000698a7f000000000300000000010020 0x5000e + 0x2000000000c0000000001000000001000000000070000000000001e 0xf0023) (.leaf8 0xf000d + 0x2000000000d0000000001000002e38a000000000400000000010020 + 0x2000000000e000000000100000000110000000008001f 0x100000000110023 + 0x20000000010000000000100000d49ff000000000500000000000020 + 0x20000000012000000000100000000140000000003001f (h240 0x100000000000000 + 0x100000000130000000000000000001400000000060000000000001e) 0x130023)))) (.bin (.bin (.bin (.leaf8 + 0x13000d 0x140000000000000007d1b0000000000500000000010020 0x140000000000000000000d0000000000001f + 0xc0023 0xc000d 0x1500000000000000000002000000000b001f 0x100000000030023 + 0x17000000000000000093e7000000000600000000000020) (.leaf8 0x19000000000000000000170000000003001f + (h240 0x10000 0x1800000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1a00000000000000000001000000000c0000000001001e 0x100000000020023 + 0x1c000000000000000438bc000000000700000000000020 0x1e000000000000000000070000000000001f 0x60023)) + (.bin (.leaf8 0x6000d 0x1f00000000000000000002000000000f001f 0x100000000030023 + 0x2100000000000000001d93000000000800000000000020 0x5000e + 0x240000000000000000001e00000000110000000000001e 0x1d0023 0x1d000d) (.leaf8 + 0x250000000000000000d824000000000900000000010020 0x26000000000000000000080000000012001f + 0x100000000080023 0x28000000000000000005e9000000000a00000000000020 0x10000e + 0x2b0000000000000000000200000000140000000000001e 0x100000000030023 + 0x2d00000000000000002b39000000000b00000000000020))) (.bin (.bin (.leaf8 + 0x2f000000000000000000250000000000001f 0x240023 0x24000d 0x30000000000000000000020000000017001f + 0x100000000030023 0x320000000000000000012d000000000c00000000000020 0xa000e + 0x350000000000000000000200000000180000000000001e) (.leaf8 0x100000000030023 + 0x37000000000000000008a4000000000d00000000000020 0xa000e + 0x3a0000000000000000002e000000001b0000000000001e 0x2d0023 0x2d000d + 0x3b0000000000000000003a000000000e00000000010020 0x2e000e)) (.bin (.leaf8 + 0x3d00000000000000000002000000001c0000000000001e 0x100000000030023 + 0x3f000000000000000001b9000000000f00000000000020 0x410000000000000000000a0000000000001f 0x90023 + 0x9000d 0x4200000000000000000002000000001f001f 0x100000000030023) (.leaf8 + 0x440000000000000000000a000000001000000000000020 0x46000000000000000000350000000021001f + 0x100000000360023 0x4700000000000000000057000000001100000000000020 0xb000e + 0x4a0000000000000000003a00000000230000000000001e 0x390023 0x39000d)))))) (.bin (.bin (.bin (.bin + (.bin (.leaf8 0x4b00000000000000000000000000001200000000010020 0x3b000e + 0x4c0000000000000000003d00000000250000000000001e 0x3c0023 0x3c000d + 0x4d0000000000000000000f000000001300000000010020 0x4e0000000000000000003e0000000002001f 0x3d0023) + (.leaf8 0x3d000d 0x4e000000000000000000070000000027001f (h240 0x1000000000800000000010000 + 0x10000000004000000000100000000020000000004001c) 0x2000f + 0x510000000000000000000200000000270000000001001e 0x100000000030023 + 0x5300000000000000000002000000001500000000000020 0x55000000000000000000020000000001001f)) (.bin + (.leaf8 (h240 0x10000 0x3000000000100000000000000000001000000000b0000000003001c) 0xb000f + 0x570000000000000000000b000000002c0000000001001e (h240 + 0x1000000000c0000000001000000000000000000010000 + 0x4900000000010000000002000000000100000000010000000005001c) 0x1000f + 0x5b0000000000000000000100000000030000000001001e (h240 0x10000 + 0x100000000020000000000000000000100000000040000000003001c) 0x20186) (.leaf8 0x10043 0x40142 + 0x101c3 0x50023 0xe00c6 0x10043 0x10303 0x10009))) (.bin (.bin (.leaf8 0x8 (h240 0x10000 + 0x100000000000000000002000000000100000000000000000000001e) 0x10009 0x20021 0x4900000000000016 + 0xc0014 0x4b000e (h240 0x1000000000000000000010000 + 0x300000000010000000002000000000100000000010000000004001c)) (.leaf8 0x1000f + 0x3000000000e00000000040000000002001d 0x20000000001000b 0x10016 0xf000000004a0016 0x30013 0x450008 + 0x10009)) (.bin (.leaf8 0x10021 0x4400000000430016 0x30014 0x460010 0x10021 0x20016 + 0x3f00000000060016 0x8000000003d001a) (.leaf8 0x3c000000003c0016 0x3b000000003a0016 + 0x39000000000a0016 0x2b0000000037001a 0x360016 0x50000000034001a 0x3500000000340016 0x30014)))) + (.bin (.bin (.bin (.leaf8 0x370010 0x10021 0x3300000000090016 0xdc0000000031001a 0x300016 + 0x2f00000000010016 0x1d000000002e001a 0x2f000000002e0016) (.leaf8 0x2d00000000090016 + 0x451000000002b001a 0x2c000000002b0016 0x30014 0x2e0010 0x10021 0x2a00000000090016 + 0x960000000028001a)) (.bin (.leaf8 0x270016 0x2600000000010016 0x159c0000000025001a + 0x2600000000250016 0x30014 0x280010 0x10021 0x24000000000f0016) (.leaf8 0x2f40000000022001a + 0x210016 0x80014 0x20010 0x10021 0x6c12000000001f001a 0x1f000000001f0016 0x1e00000000040016))) + (.bin (.bin (.leaf8 0xec9000000001c001a 0x1b0016 0x800000000010016 0x21c5e0000000019001a 0x180016 + 0x16 0x49f40000000016001a 0x150016) (.leaf8 0xe00000000010016 0xa8dd80000000013001a + 0x1400000000130016 0x14 0x160010 0x10021 0x12000000000f0016 0x171c50000000010001a)) (.bin (.leaf8 + 0x6000000000f0016 0x34c540000000000d001a 0xc000000000c0016 0x738e1000000000a001a 0x90016 + 0x107da350000000007001a 0x800000000070016 0x60014) (.leaf8 0xa0010 0x10021 0x241c6e0000000004001a + 0x300000000020016 0x52743380000000001001a 0x16 0x14 0x2000e))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x10022 0x2000000000200000000010000b48e04000000000000000000000020 (h240 0x100000000000000 + 0x100000000050000000000000472b532000000000000000000010020) 0x6000000000000000000050000000000001f + 0x100000000050023 0x800000000000000241c6d000000000100000000000020 0x8000e + 0xa0000000000000000000a00000000030000000000001e) (.leaf8 0x90023 0x9000d + 0xb0000000000000107da34000000000200000000010020 0xc000000000000000000020000000005001f + 0x100000000030023 0xe000000000000000738e0000000000300000000000020 + 0x100000000000000000000e0000000007001f 0x1000000000f0023)) (.bin (.leaf8 + 0x110000000000000034c53f000000000400000000000020 0x13000000000000000000080000000009001f + 0x100000000090023 0x15000000000000000171c4000000000500000000000020 + 0x17000000000000000000140000000009001f (h240 0x1000000001500000000010000 + 0x10000000002000000000100000000160000000004001c) 0x16000f + 0x1900000000000000000016000000000a0000000001001e) (.leaf8 0x150023 0x15000d + 0x1a000000000000000a8dd7000000000600000000010020 0x1b000000000000000000100000000000001f 0xf0023 + 0xf000d 0x1c00000000000000000002000000000d001f 0x100000000030023))) (.bin (.bin (.leaf8 + 0x1e000000000000000049f3000000000700000000000020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x2200000000000000000001000000000e0000000001001e 0x100000000020023 + 0x2400000000000000021c5d000000000800000000000020 0x260000000000000000000a0000000000001f) (.leaf8 + 0x90023 0x9000d 0x27000000000000000000020000000011001f 0x100000000030023 + 0x2900000000000000000ec8000000000900000000000020 0x2b000000000000000000200000000002001f 0x1f0023 + 0x1f000d)) (.bin (.leaf8 0x2b000000000000000000210000000014001f 0x200023 0x20000d + 0x2c00000000000000006c11000000000a00000000010020 0xa000e + 0x2e0000000000000000000200000000140000000000001e 0x100000000030023 + 0x30000000000000000002f3000000000b00000000000020) (.leaf8 0x32000000000000000000260000000009001f + (h240 0x1000000002700000000010000 0x10000000005000000000100000000280000000004001c) 0x28000f + 0x340000000000000000002800000000160000000001001e 0x270023 0x27000d + 0x350000000000000000159b000000000c00000000010020 0x36000000000000000000280000000000001f)))) (.bin + (.bin (.bin (.leaf8 0x270023 0x27000d 0x37000000000000000000020000000019001f 0x100000000030023 + 0x3900000000000000000095000000000d00000000000020 0x3b0000000000000000002c0000000005001f (h240 + 0x1000000002d00000000010000 0x100000000050000000001000000002e0000000004001c) 0x2e000f) (.leaf8 + 0x3d0000000000000000002e000000001a0000000001001e 0x2d0023 0x2d000d + 0x3e00000000000000000450000000000e00000000010020 0x3f0000000000000000002f0000000005001f (h240 + 0x10000 0x3000000000010000000000000000000100000000300000000003001c) 0x30000f + 0x4000000000000000000030000000001d0000000001001e)) (.bin (.leaf8 0x2f0023 0x2f000d + 0x410000000000000000001c000000000f00000000010020 0x42000000000000000000310000000000001f 0x300023 + 0x30000d 0x4300000000000000000002000000001f001f 0x100000000030023) (.leaf8 + 0x45000000000000000000db000000001000000000000020 0x47000000000000000000350000000005001f (h240 + 0x1000000003600000000010000 0x10000000005000000000100000000370000000004001c) 0x37000f + 0x490000000000000000003700000000200000000001001e 0x360023 0x36000d + 0x4a00000000000000000004000000001100000000010020))) (.bin (.bin (.leaf8 + 0x4b000000000000000000020000000023001f 0x100000000030023 + 0x4d0000000000000000002a000000001200000000000020 0x4f0000000000000000003b0000000006001f 0x3a0023 + 0x3a000d 0x4f0000000000000000003d0000000026001f 0x3c0023) (.leaf8 0x3c000d + 0x500000000000000000003e0000000027001f 0x1000000003f0023 + 0x5200000000000000000007000000001400000000000020 0x54000000000000000000410000000003001f (h240 + 0x10000 0x4200000000010000000000000000000100000000010000000003001c) 0x1000f 0x550000000000001d)) + (.bin (.leaf8 (h240 0x1000000000100000000020000 0x10000000005000000000100000000460000000004001c) + 0x46000f 0x5800000000000000000046000000002a0000000001001e 0x450023 0x45000d 0x46000e + 0x590000000000000000000100000000000000000000001e (h240 0x10000 + 0x200000000010000000000000000000100000000100000000003001c)) (.leaf8 0x10000f + 0x5b00000000000000000010000000002f0000000001001e (h240 0x10000 + 0x1000000000020000000000000000000100000000010000000003001c) 0x1000f 0x5d0000000000001d 0x23 0xd + 0x3000e)))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x20186 0x10043 0x40142 0x101c3 + 0x50023 0xe00c6 0x10043 0x10303) (.leaf8 0x10009 0x20008 + 0x300000000000000000001000000000100000000000000000000001e 0x10009 0x20021 0xe0016 + 0x4700000000000016 0x500000000450016)) (.bin (.leaf8 0x14 0x1000000000300000000070000000000001f + 0x70009 0x30021 0x40000000040001a 0x3f0016 0x3e000000003d0016 0x15000000003a001a) (.leaf8 + 0x3b000000003a0016 0x30014 0x3d0010 0x10021 0x20000000037001a 0x3800000000370016 0x30016 + 0x6e0000000034001a))) (.bin (.bin (.leaf8 0x330016 0x3200000000010016 0xe0000000031001a + 0x3100000000310016 0x300014 0x330010 0x10021 0x228000000002e001a) (.leaf8 0x2f000000002e0016 + 0x30016 0x4b000000002b001a 0x2a0016 0x2900000000010016 0xace0000000028001a 0x500000000270016 + 0x270014)) (.bin (.leaf8 0x70010 0x10021 0x1790000000025001a 0x2600000000250016 0x30014 0x280010 + 0x10021 0x2400000000090016) (.leaf8 0x36080000000022001a 0x2200000000220016 0x764000000001f001a + 0x20000000001f0016 0x30014 0x220010 0x10021 0x1e00000000090016)))) (.bin (.bin (.bin (.leaf8 + 0x10e2e000000001c001a 0x1b0016 0x16 0x1b00000000010016 0x24f90000000019001a 0x180016 + 0x1100000000010016 0x546ec0000000016001a) (.leaf8 0x200000000150016 0x150014 0x40010 0x10021 + 0xb8e20000000013001a 0x120016 0x1200000000070016 0x1a629f0000000010001a)) (.bin (.leaf8 0xf0016 + 0x39c70000000000d001a 0xe000000000d0016 0x30014 0x100010 0x10021 0x83ed1a000000000a001a + 0xb000000000a0016) (.leaf8 0x120e370000000007001a 0x60016 0x50014 0x20010 0x10021 + 0x293a19b0000000004001a 0x500000000040016 0x30014))) (.bin (.bin (.leaf8 0x70010 0x10021 + 0x5a47020000000001001a 0x200000000010016 0x14 0x20000000000000000000100000000040000000000001f + 0x30023 0x3000d) (.leaf8 0x20000000002000000000100005a4701000000000000000000010020 0x5000e + 0x200000000030000000001000000000700000000010000000000001e 0x60023 0x6000d + 0x200000000040000000001000293a19a000000000100000000010020 0x7000e + 0x200000000060000000001000000000200000000020000000000001e)) (.bin (.leaf8 0x100000000030023 + 0x2000000000800000000010000120e36000000000200000000000020 + 0x2000000000a0000000001000000000d0000000006001f 0xc0023 0xc000d + 0x2000000000b0000000001000083ed19000000000300000000010020 0x5000e + 0x2000000000d0000000001000000001000000000070000000000001e) (.leaf8 0xf0023 0xf000d + 0x2000000000e00000000010000039c6f000000000400000000010020 + 0x2000000000f000000000100000000020000000009001f 0x100000000030023 + 0x2000000001100000000010000109c74000000000500000000000020 + 0x20000000013000000000100000000140000000008001f 0x140009))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x140021 0x17 0x1d 0x103c3 (h240 (h240 (h240 (h240 (h240 (h240 + 0xce227bc00000000030000000001000000000500005a47030000 + 0x600000000010000000008000293a19b000000000900000000010000) + 0x8000000000100000000030000000001000000000000000000010000) + 0xb0000120e36000000000c0000000001000000000e000083ed1a0000) + 0xf00000000010000000006000000000100000000110000039c700000) + 0x12000000000100000000030000000001000000000000000000010000) + 0x140000109c740000000015000000000100000000140000000014001c) 0x14000f (h240 0x20000 + 0x10000000001000000000200000000130000000000001d) 0x130023) (.leaf8 0x13000d + 0x150000000000000009c628000000000500000000010020 0x15000000000000000000140000000004001f 0x130023 + 0x13000d 0x1500000000000000000002000000000b001f 0x100000000030023 + 0x170000000000000000b8e1000000000600000000000020)) (.bin (.leaf8 0x17000e + 0x1900000000000000000004000000000c0000000000001e 0x100000000050023 + 0x1b000000000000000546eb000000000700000000000020 0x1d000000000000000000130000000000001f 0x120023 + 0x12000d 0x1e00000000000000000002000000000f001f) (.leaf8 0x100000000030023 + 0x20000000000000000024f8000000000800000000000020 0x220000000000000000001d0000000000001f 0x1c0023 + 0x1c000d 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f))) (.bin (.bin (.leaf8 + 0x240000000000000000000100000000100000000001001e 0x100000000020023 + 0x2600000000000000010e2d000000000900000000000020 0x28000000000000000000200000000005001f (h240 + 0x1000000002100000000010000 0x10000000005000000000100000000220000000004001c) 0x22000f + 0x2a0000000000000000002200000000120000000001001e 0x210023) (.leaf8 0x21000d + 0x2b00000000000000000763000000000a00000000010020 0x2c000000000000000000240000000016001f 0x230023 + 0x23000d 0x2d00000000000000003607000000000b00000000010020 0x2e000000000000000000260000000005001f + (h240 0x1000000002700000000010000 0x10000000005000000000100000000280000000004001c))) (.bin (.leaf8 + 0x28000f 0x300000000000000000002800000000160000000001001e 0x270023 0x27000d + 0x3100000000000000000178000000000c00000000010020 0x29000e + 0x320000000000000000000700000000180000000000001e 0x100000000080023) (.leaf8 + 0x3400000000000000000acd000000000d00000000000020 0x360000000000000000002b0000000000001f 0x2a0023 + 0x2a000d 0x3700000000000000000002000000001b001f 0x100000000030023 + 0x390000000000000000004a000000000e00000000000020 0x3b000000000000000000020000000001001f)))) (.bin + (.bin (.bin (.leaf8 (h240 0x10000 0x300000000010000000000000000000100000000300000000003001c) + 0x30000f 0x3d00000000000000000030000000001d0000000001001e 0x2f0023 0x2f000d + 0x3e00000000000000000227000000000f00000000010020 0x32000e + 0x3f00000000000000000033000000001f0000000000001e) (.leaf8 0x320023 0x32000d + 0x400000000000000000000d000000001000000000010020 0x41000000000000000000340000000000001f 0x330023 + 0x33000d 0x42000000000000000000020000000021001f 0x100000000030023)) (.bin (.leaf8 + 0x440000000000000000006d000000001100000000000020 0x46000000000000000000020000000001001f (h240 + 0x10000 0x300000000010000000000000000000100000000390000000003001c) 0x39000f + 0x480000000000000000003900000000230000000001001e 0x380023 0x38000d + 0x4900000000000000000001000000001200000000010020) (.leaf8 0x5000e + 0x4b0000000000000000003d00000000250000000000001e 0x3c0023 0x3c000d + 0x4c00000000000000000014000000001300000000010020 0x4d000000000000000000400000000028001f 0x3f0023 + 0x3f000d))) (.bin (.bin (.leaf8 0x4e000000000000000000020000000029001f 0x100000000030023 + 0x5000000000000000000003000000001500000000000020 0x1000e (h240 0x20000 + 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x5500000000000000000007000000002a0000000001001e (h240 + 0x100000000080000000001000000000000000000010000 + 0x4900000000010000000000000000000100000000010000000005001c)) (.leaf8 0x1000f + 0x590000000000000000000100000000070000000001001e (h240 + 0x100000000010000000002000000000000000000010000 + 0x200000000010000000004000000000100000000010000000005001c) 0x1000f 0x5d0000000000001d + 0x40000000001000b 0x16 0x10014)) (.bin (.leaf8 0x2000e + 0x10000000000000000000100000000050000000002001c 0x20186 0x10043 0x50142 0x101c3 0x60023 0x1000c6) + (.leaf8 0x10043 0x10303 0x10009 0x8 0x10009 0x10021 0x10000000001001a 0x10019)))))) (.bin (.bin + (.bin (.bin (.bin (.leaf8 0x580000000000001d 0x49000f 0x570000000000001d 0x480023 0x48000d + 0x5800000000000000000000000000000000000000010020 0x1000e + 0x5a0000000000000000000100000000020000000000001e) (.leaf8 0x20000000000000b 0x4a00000000040016 + 0x80014 0x4c0010 0x10021 0x16 0x20014 0x2000e)) (.bin (.leaf8 (h240 0x10000 + 0x1000000000a0000000001000000004c0000000003001c) 0x4c000f 0x40021 0x10000000043001a + 0x4400000000430016 0x30014 0x460010 0x10021) (.leaf8 0x3f000000003f0016 0xa000000003d001a + 0x6000000003c0016 0x1000000003a001a 0x380016 0x3900000000010016 0x360000000037001a 0x360016))) + (.bin (.bin (.leaf8 0x3500000000010016 0x70000000034001a 0x3300000000320016 0x1140000000031001a + 0x2f0016 0x3000000000010016 0x24000000002e001a 0x2f000000002e0016) (.leaf8 0x30014 0x310010 + 0x10021 0x2d000000002a0016 0x566000000002b001a 0x2a0016 0x2a00000000060016 0xbc0000000028001a)) + (.bin (.leaf8 0x2900000000280016 0x30016 0x1b040000000025001a 0x2500000000250016 + 0x3b20000000022001a 0x500000000210016 0x210014 0x70010) (.leaf8 0x10021 0x8716000000001f001a + 0x20000000001f0016 0x20014 0x300000000040000000000000000000200000000220000000000001f 0x220009 + 0x10021 0x127c000000001c001a)))) (.bin (.bin (.bin (.leaf8 0x1d000000001c0016 0x30014 0x1f0010 + 0x10021 0x1b00000000120016 0x2a3750000000019001a 0x180016 0x1800000000030016) (.leaf8 + 0x5c700000000016001a 0x1700000000160016 0x30014 0x190010 0x10021 0xd314f0000000013001a + 0x1400000000130016 0x30014)) (.bin (.leaf8 0x160010 0x10021 0x1ce380000000010001a + 0x6000000000f0016 0x41f68d000000000d001a 0xc000000000c0016 0x9071a000000000a001a + 0xb000000000a0016) (.leaf8 0x30014 0xd0010 0x10021 0x900000000060016 0x149d0cd0000000007001a + 0x600000000060016 0x2d23810000000004001a 0x300000000030016))) (.bin (.bin (.leaf8 + 0x67113dd0000000001001a 0x100000000010016 0x14 0x20000000000000000000100000000030000000000001f + 0x20023 0x2000d 0x2000000000200000000010000e1b1d9000000000000000000010020 (h240 0x100000000000000 + 0x10000000004000000000000058f6202000000000000000000010020)) (.leaf8 + 0x5000000000000000000050000000001001f 0x100000000060023 + 0x6000000000000002d2380000000000100000000000020 0x8000000000000000000080000000003001f + 0x100000000090023 0x90000000000000149d0cc000000000200000000000020 + 0xb0000000000000000000b0000000003001f (h240 0x1000000000c00000000010000 + 0x100000000050000000001000000000d0000000004001c))) (.bin (.leaf8 0xd000f + 0xd0000000000000000000d00000000040000000001001e 0xc0023 0xc000d + 0xe00000000000000090719000000000300000000010020 0xf0000000000000000000e0000000007001f + 0x1000000000f0023 0x100000000000000041f68c000000000400000000000020) (.leaf8 + 0x12000000000000000000080000000009001f 0x100000000090023 + 0x140000000000000001ce37000000000500000000000020 0x5000e + 0x1700000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x18000000000000000d314e000000000600000000010020))))) (.bin (.bin (.bin (.bin (.leaf8 0x5000e + 0x1a00000000000000000019000000000d0000000000001e 0x180023 0x18000d + 0x1b00000000000000005c6f000000000700000000010020 0x1c0000000000000000001a0000000001001f (h240 + 0x10000 0x1b00000000010000000000000000000100000000010000000003001c) 0x1000f) (.leaf8 + 0x1d00000000000000000001000000000e0000000001001e 0x100000000020023 + 0x1f0000000000000002a374000000000800000000000020 0x210000000000000000001d000000000b001f (h240 + 0x1000000001e00000000010000 0x100000000050000000001000000001f0000000004001c) 0x1f000f + 0x230000000000000000001f00000000100000000001001e 0x1e0023)) (.bin (.leaf8 0x1e000d + 0x240000000000000000127b000000000900000000010020 0x5000e + 0x10000000005000000000100000000220000000002001c 0x22000f + 0x270000000000000000002200000000110000000001001e 0x210023 0x21000d) (.leaf8 + 0x2800000000000000008715000000000a00000000010020 0x23000e + 0x290000000000000000000700000000140000000000001e 0x100000000080023 + 0x2b000000000000000003b1000000000b00000000000020 0x2d000000000000000000270000000018001f 0x260023 + 0x26000d))) (.bin (.bin (.leaf8 0x2e00000000000000001b03000000000c00000000010020 + 0x2f000000000000000000020000000001001f (h240 0x10000 + 0x3000000000100000000000000000001000000002a0000000003001c) 0x2a000f + 0x310000000000000000002a00000000190000000001001e 0x290023 0x29000d + 0x32000000000000000000bb000000000d00000000010020) (.leaf8 0x330000000000000000002c0000000003001f + (h240 0x10000 0x2d00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x3400000000000000000001000000001a0000000001001e 0x100000000020023 + 0x3600000000000000000565000000000e00000000000020 0x380000000000000000002f000000001b001f (h240 + 0x1000000003000000000010000 0x10000000005000000000100000000310000000004001c))) (.bin (.leaf8 + 0x31000f 0x3a00000000000000000031000000001c0000000001001e 0x300023 0x30000d + 0x3b00000000000000000023000000000f00000000010020 0x3c000000000000000000320000000000001f 0x310023 + 0x31000d) (.leaf8 0x3c00000000000000000002000000001e001f 0x100000000020023 + 0x3e00000000000000000113000000001000000000000020 0x40000000000000000000350000000020001f + 0x100000000350023 0x4200000000000000000006000000001100000000000020 + 0x44000000000000000000370000000000001f 0x360023)))) (.bin (.bin (.bin (.leaf8 0x36000d + 0x45000000000000000000020000000023001f 0x100000000030023 + 0x4700000000000000000035000000001200000000000020 0x490000000000000000003b0000000000001f 0x3a0023 + 0x3a000d 0x49000000000000000000020000000024001f) (.leaf8 0x100000000020023 + 0x4b00000000000000000000000000001300000000000020 0x4c000000000000000000080000000027001f + 0x100000000090023 0x4e00000000000000000009000000001400000000000020 + 0x50000000000000000000410000000029001f (h240 0x1000000004200000000010000 + 0x10000000005000000000100000000460000000004001c) 0x46000f)) (.bin (.leaf8 + 0x5200000000000000000046000000002a0000000001001e 0x450023 0x45000d + 0x5300000000000000000000000000001600000000010020 0x4000e (h240 0x1000000000300000000010000 + 0x1000000000a0000000001000000004c0000000004001c) 0x4c000f 0x580000000000001d) (.leaf8 0x4b0023 + 0x4b000d 0x2000e 0xa00c6 0x10043 0x4d0142 0x101c3 0x4e0009))) (.bin (.bin (.leaf8 0x80016 + 0x500000000010016 0x4700000000460016 0x30016 0x50000000040001a 0x3f0016 0x3e00000000070016 0x14) + (.leaf8 0x400010 0x10021 0x3c00000000000016 0x1a000000003a001a 0x3b000000003a0016 0x30014 0x3d0010 + 0x10021)) (.bin (.leaf8 0x3900000000360016 0x20000000037001a 0x3800000000370016 0x14 0x3a0010 + 0x10021 0x3600000000330016 0x890000000034001a) (.leaf8 0x330016 0x20014 0x20010 0x10021 + 0x120000000031001a 0x3200000000310016 0x30016 0x2b3000000002e001a))))))) (.bin (.bin (.bin (.bin + (.bin (.bin (.leaf8 0x2d0016 0x16 0x5e000000002b001a 0x2b000000002b0016 0x30014 0x2d0010 0x10021 + 0xd820000000028001a) (.leaf8 0x2700000000260016 0x1d80000000025001a 0x240016 0x2400000000060016 + 0x438b0000000022001a 0x500000000210016 0x2100000000040016 0x93d000000001f001a)) (.bin (.leaf8 + 0x20000000001f0016 0x30016 0x151ba000000001c001a 0x1d000000001c0016 0x20014 + 0x1b000000000400000000000000000002000000001f0000000000001f 0x1f0009 0x20021) (.leaf8 + 0x2e380000000019001a 0x600000000180016 0x698a70000000016001a 0x1700000000160016 0x1500000000040016 + 0xe71b0000000013001a 0x120016 0x1200000000070016))) (.bin (.bin (.leaf8 0x20fb450000000010001a + 0x1100000000100016 0xf0014 0x130010 0x10021 0x4838d000000000d001a 0x5000000000c0016 0xc0014) + (.leaf8 0x70010 0x10021 0xa4e866000000000a001a 0x90016 0x1691c00000000007001a 0x800000000070016 + 0x60014 0xa0010)) (.bin (.leaf8 0x10021 0x33889ee0000000004001a 0x400000000040016 + 0x70d8ed0000000001001a 0x200000000010016 0x14 0x20000000000000000000100000000040000000000001f + 0x30023) (.leaf8 0x3000d 0x200000000020000000001000070d8ec000000000000000000010020 + 0x20000000003000000000100000000060000000002001f 0x50023 0x5000d + 0x20000000004000000000100033889ed000000000100000000010020 0x8000e + 0x200000000050000000001000000000a00000000030000000000001e)))) (.bin (.bin (.bin (.leaf8 0x90023 + 0x9000d 0x20000000006000000000100001691bf000000000200000000010020 + 0x20000000007000000000100000000020000000005001f 0x100000000030023 + 0x2000000000900000000010000a4e865000000000300000000000020 0xe000e + 0x2000000000b0000000001000000000700000000060000000000001e) (.leaf8 0x100000000080023 + 0x2000000000d0000000001000004838c000000000400000000000020 0x11000e + 0x2000000000f0000000001000000001300000000090000000000001e 0x120023 0x12000d + 0x200000000100000000001000014c38f000000000500000000010020 + 0x20000000011000000000100000000140000000001001f)) (.bin (.leaf8 0x140009 0x120021 0x17 0x1d + 0x103c3 (h240 (h240 (h240 (h240 (h240 (h240 0x101ab1880000 + 0x300000000010000000005000070d8ed000000000600000000010000) + 0x700033889ef00000000090000000001000000000b00001691c00000) + 0xc000000000100000000030000000001000000000000000000010000) + 0xe0000a4e866000000000f0000000001000000000800000000010000) + 0x10000000011000004838d000000001200000000010000) + 0x14000014c3900000000015000000000100000000140000000012001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000110000000000000000001400000000060000000001001e)) + (.leaf8 0x130023 0x13000d 0x13000000000000000c37b3000000000500000000010020 + 0x13000000000000000000140000000004001f 0x130023 0x13000d 0x1300000000000000000002000000000b001f + 0x100000000030023))) (.bin (.bin (.leaf8 0x150000000000000000e71a000000000600000000000020 + 0x17000000000000000000170000000002001f 0x160023 0x16000d 0x1700000000000000000019000000000e001f + 0x180023 0x18000d 0x18000000000000000698a6000000000700000000010020) (.leaf8 + 0x1900000000000000000008000000000f001f 0x100000000090023 + 0x1b00000000000000002e37000000000800000000000020 0x1d000e + 0x100000000050000000001000000001f0000000002001c 0x1f000f + 0x1e0000000000000000001f000000000f0000000001001e 0x1e0023)) (.bin (.leaf8 0x1e000d + 0x1f000000000000000151b9000000000900000000010020 0x20000000000000000000020000000001001f (h240 + 0x10000 0x300000000010000000000000000000100000000210000000003001c) 0x21000f + 0x220000000000000000002100000000130000000001001e 0x200023 0x20000d) (.leaf8 + 0x230000000000000000093c000000000a00000000010020 0x24000000000000000000230000000002001f 0x220023 + 0x22000d 0x24000000000000000000070000000015001f 0x100000000080023 + 0x260000000000000000438a000000000b00000000000020 0x28000000000000000000260000000003001f))))) (.bin + (.bin (.bin (.bin (.leaf8 (h240 0x10000 + 0x2700000000010000000000000000000100000000010000000003001c) 0x1000f + 0x290000000000000000000100000000160000000001001e 0x100000000020023 + 0x2b000000000000000001d7000000000c00000000000020 0x2d000000000000000000290000000018001f + 0x100000000290023 0x2f00000000000000000d81000000000d00000000000020) (.leaf8 0x5000e + 0x320000000000000000002d000000001b0000000000001e 0x2c0023 0x2c000d + 0x330000000000000000005d000000000e00000000010020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f)) (.bin (.leaf8 + 0x3600000000000000000001000000001c0000000001001e 0x100000000020023 + 0x38000000000000000002b2000000000f00000000000020 0x3a000000000000000000020000000001001f (h240 + 0x10000 0x300000000010000000000000000000100000000330000000003001c) 0x33000f + 0x3c00000000000000000033000000001f0000000001001e 0x320023) (.leaf8 0x32000d + 0x3d00000000000000000011000000001000000000010020 0x4000e + 0x3f0000000000000000000200000000200000000000001e 0x100000000030023 + 0x4100000000000000000088000000001100000000000020 0x43000000000000000000380000000021001f (h240 + 0x1000000003900000000010000 0x100000000020000000001000000003a0000000004001c)))) (.bin (.bin + (.leaf8 0x3a000f 0x450000000000000000003a00000000220000000001001e 0x390023 0x39000d + 0x4600000000000000000001000000001200000000010020 0x470000000000000000003b0000000023001f (h240 + 0x1000000003c00000000010000 0x100000000050000000001000000003d0000000004001c) 0x3d000f) (.leaf8 + 0x490000000000000000003d00000000240000000001001e 0x3c0023 0x3c000d + 0x4a00000000000000000019000000001300000000010020 0x3e000e (h240 0x10000 + 0x10000000002000000000100000000400000000003001c) 0x40000f + 0x4d0000000000000000004000000000020000000001001e)) (.bin (.leaf8 0x3f0023 0x3f000d + 0x4e000000000000000000020000000029001f 0x100000000030023 + 0x5000000000000000000004000000001500000000000020 0x52000000000000000000020000000001001f (h240 + 0x10000 0x300000000010000000000000000000100000000480000000003001c) 0x48000f) (.leaf8 + 0x5400000000000000000048000000002d0000000001001e 0x470023 0x47000d + 0x55000000000000000000070000000000001f 0x60023 0x6000d 0x56000000000000000000020000000004001f + (h240 0x10000 0x2000000000200000000000000000001000000004e0000000003001c))))) (.bin (.bin (.bin + (.leaf8 0x4e000f 0x580000000000000000004e00000000000000000001001e 0x4d000b 0x20014 0x20010 0x10021 + 0x4900000000060016 0x30014) (.leaf8 0x4b0010 0x10021 0x20000000043001a 0x420016 0x4100000000010016 + 0x16 0xd000000003d001a 0x3e000000003d0016)) (.bin (.leaf8 0x30016 0x1000000003a001a + 0x3b000000003a0016 0x16 0x440000000037001a 0x3800000000370016 0x30014 0x3a0010) (.leaf8 0x10021 + 0x3600000000030016 0x80000000034001a 0x3400000000340016 0x30014 0x360010 0x10021 + 0x1590000000031001a))) (.bin (.bin (.leaf8 0x300016 0x16 0x3000000000010016 0x2e000000002e001a + 0x2e000000002e0016 0x2d00000000040016 0x6c0000000002b001a 0x2a0016) (.leaf8 0x290014 0x20010 + 0x10021 0xeb0000000028001a 0x2900000000280016 0x20014 + 0x27000000000400000000000000000002000000002b0000000000001f 0x2b0009)) (.bin (.leaf8 0x20021 + 0x21c50000000025001a 0x240016 0x2400000000060016 0x49e0000000022001a 0x2200000000220016 0x30014 + 0x240010) (.leaf8 0x10021 0xa8dd000000001f001a 0x5000000001e0016 0x171c000000001c001a 0x1b0016 + 0x1b00000000070016 0x34c530000000019001a 0x1800000000180016)))))) (.bin (.bin (.bin (.bin (.bin + (.leaf8 0x738d0000000016001a 0x150016 0x1500000000010016 0x107da20000000013001a 0x1400000000130016 + 0x241c60000000010001a 0x1100000000100016 0x80014) (.leaf8 0x130010 0x10021 0x527433000000000d001a + 0xc0016 0xc00000000010016 0xb48df000000000a001a 0xb000000000a0016 0x19c44f70000000007001a)) (.bin + (.leaf8 0x700000000070016 0x386c760000000004001a 0x500000000040016 0x80d58c40000000001001a 0x3001d + 0x10000000001000000000100011a1e52000000000000000000000020 0x50010 0x60021) (.leaf8 0x17 0x1d + 0x103c3 (h240 (h240 0x11a1e530000 0x3000000000100000000020000000002000000000000000000010000) + 0x500011a1e520000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000500000000000006f33a6f000000000000000000010020) + 0x7000000000000000000070000000002001f 0x60023))) (.bin (.bin (.leaf8 0x6000d + 0x800000000000000386c75000000000100000000010020 0x9000000000000000000090000000004001f 0x80023 + 0x8000d 0xa000000000000019c44f6000000000200000000010020 0xb0000000000000000000d0000000006001f + 0xc0023) (.leaf8 0xc000d 0xc000000000000000b48de000000000300000000010020 + 0xd0000000000000000000e0000000000001f 0xd0023 0xd000d 0xd000000000000000000020000000007001f + 0x100000000030023 0xf00000000000000527432000000000400000000000020)) (.bin (.leaf8 0xa000e + 0x120000000000000000001300000000090000000000001e 0x120023 0x12000d + 0x13000000000000000241c5000000000500000000010020 0x1400000000000000000016000000000c001f 0x150023 + 0x15000d) (.leaf8 0x1500000000000000107da1000000000600000000010020 + 0x16000000000000000000170000000000001f 0x160023 0x16000d 0x1600000000000000000002000000000d001f + 0x100000000030023 0x180000000000000000738c000000000700000000000020 + 0x1a0000000000000000001a000000000f001f)))) (.bin (.bin (.bin (.leaf8 0x1000000001b0023 + 0x1b00000000000000034c52000000000800000000000020 0x1d0000000000000000001d0000000004001f 0x1c0023 + 0x1c000d 0x1d000000000000000000020000000011001f 0x100000000030023 + 0x1f0000000000000000171b000000000900000000000020) (.leaf8 0x21000000000000000000070000000013001f + 0x100000000080023 0x230000000000000000a8dc000000000a00000000000020 0x5000e + 0x260000000000000000002400000000150000000000001e 0x230023 0x23000d + 0x270000000000000000049d000000000b00000000010020)) (.bin (.leaf8 + 0x28000000000000000000260000000003001f (h240 0x10000 + 0x2700000000010000000000000000000100000000010000000003001c) 0x1000f + 0x290000000000000000000100000000160000000001001e 0x100000000020023 + 0x2b000000000000000021c4000000000c00000000000020 0x29000e + 0x100000000050000000001000000002b0000000002001c) (.leaf8 0x2b000f + 0x2e0000000000000000002b00000000170000000001001e 0x2a0023 0x2a000d + 0x2f000000000000000000ea000000000d00000000010020 0x2b000e + 0x3100000000000000000002000000001a0000000000001e 0x100000000030023))) (.bin (.bin (.leaf8 + 0x33000000000000000006bf000000000e00000000000020 0x350000000000000000002f0000000002001f 0x2e0023 + 0x2e000d 0x3500000000000000000030000000001e001f 0x2f0023 0x2f000d + 0x360000000000000000002d000000000f00000000010020) (.leaf8 0x37000000000000000000320000000000001f + 0x310023 0x31000d 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x3900000000000000000001000000001e0000000001001e 0x100000000020023)) (.bin (.leaf8 + 0x3b00000000000000000158000000001000000000000020 0x5000e + 0x3e0000000000000000003600000000210000000000001e 0x350023 0x35000d + 0x3f00000000000000000007000000001100000000010020 0x40000000000000000000380000000001001f (h240 + 0x1000000003900000000010000 0x100000000050000000001000000003a0000000004001c)) (.leaf8 0x3a000f + 0x420000000000000000003a00000000220000000001001e 0x390023 0x39000d + 0x4300000000000000000043000000001200000000010020 0x2000e + 0x100000000000000000001000000003c0000000002001c 0x3c000f))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x460000000000000000003c00000000250000000001001e 0x3b0023 0x3b000d + 0x4700000000000000000000000000001300000000010020 0x48000000000000000000020000000001001f (h240 + 0x10000 0x3000000000100000000000000000001000000003f0000000003001c) 0x3f000f + 0x4a0000000000000000003f00000000270000000001001e) (.leaf8 0x3e0023 0x3e000d + 0x4b0000000000000000000c000000001400000000010020 0x2000e + 0x10000000000000000000100000000420000000002001c 0x42000f 0x4e0000000000001d 0x410023)) (.bin + (.leaf8 0x41000d 0x4f00000000000000000002000000002b001f 0x100000000030023 + 0x5100000000000000000001000000001600000000000020 0x5000e + 0x540000000000000000004b00000000020000000000001e (h240 0x1000000004c00000000010000 + 0x10000000004000000000100000000020000000004001c) 0x2000f) (.leaf8 + 0x570000000000000000000200000000300000000001001e 0x40000000002000b 0x4c0014 0x60010 0x10021 + 0x4800000000040016 0x450016 0x4300000000010016))) (.bin (.bin (.leaf8 0x30014 0x450010 0x10021 + 0x60000000040001a 0x4000000000400016 0x30014 0x420010 0x10021) (.leaf8 0x3d000000003d0016 0x30014 + 0x3f0010 0x10021 0x22000000003a001a 0x500000000390016 0x390014 0x70010)) (.bin (.leaf8 0x10021 + 0x40000000037001a 0x600000000350016 0xac0000000034001a 0x330016 0x16 0x3300000000010016 + 0x170000000031001a) (.leaf8 0x30000000002f0016 0x35f000000002e001a 0x2f000000002e0016 0x30014 + 0x310010 0x10021 0x2d000000002a0016 0x75000000002b001a)))) (.bin (.bin (.bin (.leaf8 + 0x5000000002a0016 0x10e20000000028001a 0x2900000000280016 0x20014 + 0x27000000000400000000000000000002000000002b0000000000001f 0x2b0009 0x20021 0x24f0000000025001a) + (.leaf8 0x600000000230016 0x546e0000000022001a 0x210016 0x2100000000060016 0xb8d000000001f001a + 0x1e0016 0x1e00000000010016 0x1a629000000001c001a)) (.bin (.leaf8 0x1b0016 0x39c60000000019001a + 0x1a00000000190016 0x30014 0x1c0010 0x10021 0x83ed10000000016001a 0x1700000000160016) (.leaf8 + 0x120e30000000013001a 0xb00000000120016 0x293a190000000010001a 0xf0016 0xf00000000010016 + 0x5a46f000000000d001a 0xe000000000d0016 0xce227b000000000a001a))) (.bin (.bin (.leaf8 + 0xa000000000a0016 0x1c363b0000000007001a 0x600000000060016 0x406ac610000000004001a 0x30016 0x20014 + 0x20010 0x10021) (.leaf8 0x8d0f290000000001001a 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x20000000002000000000100008d0f28000000000000000000010020 0x4000e)) (.bin (.leaf8 + 0x200000000040000000001000000000200000000000000000000001e 0x100000000030023 + 0x200000000060000000001000406ac60000000000100000000000020 + 0x20000000008000000000100000000080000000003001f 0x100000000090023 + 0x20000000009000000000100001c363a000000000200000000000020 + 0x2000000000b0000000001000000000c0000000006001f 0xb0023) (.leaf8 0xb000d + 0x2000000000c00000000010000ce227a000000000300000000010020 + 0x2000000000d000000000100000000100000000008001f 0xf0023 0xf000d + 0x2000000000e0000000001000005a46e000000000400000000010020 + 0x2000000000f000000000100000000110000000000001f 0x100023)))))))))) + + +end BusyBeaver.CertTreeEngine diff --git a/BusyBeaver/Calculi/CertTreeDataB.lean b/BusyBeaver/Calculi/CertTreeDataB.lean new file mode 100644 index 00000000..888fc577 --- /dev/null +++ b/BusyBeaver/Calculi/CertTreeDataB.lean @@ -0,0 +1,6182 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Calculi.CertTreeDataA + +/-! +# Certified Search Tree Data Bank B (`BusyBeaver.Calculi.CertTreeDataB`) + +Second partition of precomputed node and transition tables for tree-structured +certificates in `BusyBeaver.Calculi.CertTree`. +-/ + +@[expose] public section + +open BusyBeaver SixState + +namespace BusyBeaver.CertTreeEngine + +set_option maxRecDepth 20000 in +def st_5 : CertTree := + (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x10000d + 0x2000000000f000000000100000000020000000009001f 0x100000000030023 + 0x200000000110000000001000019f474000000000500000000000020 + 0x20000000013000000000100000000140000000003001f (h240 0x100000000000000 + 0x100000000140000000000000000001400000000060000000000001e) 0x130023 0x13000d) (.leaf8 + 0x15000000000000000f45a2000000000500000000010020 0x150000000000000000000d000000000b001f + 0x1000000000e0023 0x17000000000000000120e2000000000600000000000020 + 0x1900000000000000000019000000000e001f 0x180023 0x18000d + 0x1a00000000000000083ed0000000000700000000010020)) (.bin (.leaf8 0x5000e + 0x1c0000000000000000001c000000000f0000000000001e 0x1b0023 0x1b000d + 0x1d000000000000000039c5000000000800000000010020 0x1e000000000000000000020000000011001f + 0x100000000030023 0x200000000000000001a628000000000900000000000020) (.leaf8 + 0x22000000000000000000200000000000001f 0x1f0023 0x1f000d 0x22000000000000000000020000000013001f + 0x100000000030023 0x2400000000000000000b8c000000000a00000000000020 + 0x26000000000000000000230000000003001f (h240 0x10000 + 0x2400000000010000000000000000000100000000010000000003001c)))) (.bin (.bin (.leaf8 0x1000f + 0x270000000000000000000100000000140000000001001e 0x100000000020023 + 0x290000000000000000546d000000000b00000000000020 0x2b000000000000000000080000000016001f + 0x100000000080023 0x2d0000000000000000024e000000000c00000000000020 0x29000e) (.leaf8 + 0x100000000050000000001000000002b0000000002001c 0x2b000f + 0x300000000000000000002b00000000170000000001001e 0x2a0023 0x2a000d + 0x31000000000000000010e1000000000d00000000010020 0x3200000000000000000007000000001b001f + 0x100000000080023)) (.bin (.leaf8 0x3400000000000000000074000000000e00000000000020 + 0x360000000000000000002f000000001b001f (h240 0x1000000003000000000010000 + 0x10000000005000000000100000000310000000004001c) 0x31000f + 0x3800000000000000000031000000001c0000000001001e 0x300023 0x30000d + 0x390000000000000000035e000000000f00000000010020) (.leaf8 0x3a00000000000000000032000000001e001f + 0x100000000320023 0x3c00000000000000000016000000001000000000000020 + 0x3e000000000000000000350000000000001f 0x340023 0x34000d 0x2000e + 0x10000000000000000000100000000010000000002001c)))) (.bin (.bin (.bin (.leaf8 0x1000f + 0x400000000000000000000100000000200000000001001e 0x100000000020023 + 0x42000000000000000000ab000000001100000000000020 0x44000000000000000000080000000022001f + 0x100000000080023 0x4600000000000000000003000000001200000000000020 0x3b000e) (.leaf8 + 0x480000000000000000000700000000240000000000001e 0x100000000080023 + 0x4a00000000000000000021000000001300000000000020 0x5000e + 0x4d0000000000000000003f00000000270000000000001e 0x3e0023 0x3e000d 0x5000e)) (.bin (.leaf8 + 0x4f0000000000000000004200000000290000000000001e 0x410023 0x41000d + 0x5000000000000000000005000000001500000000010020 0x5000e 0x440023 0x44000d + 0x5300000000000000000002000000002d001f) (.leaf8 (h240 0x10000 + 0x300000000010000000000000000000100000000490000000003001c) 0x49000f + 0x550000000000000000004900000000010000000001001e 0x480023 0x48000d 0x4e000e 0x4f0000000006000b + 0x480016))) (.bin (.bin (.leaf8 0x4600000000010016 0x4500000000040016 0x20000000043001a + 0x4300000000430016 0x4000000000040016 0x3f00000000040016 0x10000000003d001a 0x3c0016) (.leaf8 + 0x3c00000000060016 0x1000000003a001a 0x3b000000003a0016 0x14 0x3d0010 0x10021 0x3900000000060016 + 0x550000000037001a)) (.bin (.leaf8 0x360016 0x16 0x3600000000010016 0xb0000000034001a 0x330016 + 0x320014 0x20010 0x10021) (.leaf8 0x1af0000000031001a 0x3200000000310016 0x30016 + 0x3a000000002e001a 0x2f000000002e0016 0x80014 0x310010 0x10021))))) (.bin (.bin (.bin (.bin + (.leaf8 0x871000000002b001a 0x5000000002a0016 0x1270000000028001a 0x2900000000280016 0x14 0x2b0010 + 0x10021 0x2700000000060016) (.leaf8 0x2a360000000025001a 0x240016 0x16 0x5c60000000022001a + 0x2300000000220016 0x30014 0x250010 0x10021)) (.bin (.leaf8 0xd314000000001f001a + 0x20000000001f0016 0x30014 0x220010 0x10021 0x1ce3000000001c001a 0x6000000001b0016 + 0x41f680000000019001a) (.leaf8 0x1a00000000190016 0x90710000000016001a 0x150016 0x15000000000c0016 + 0x149d0b0000000013001a 0x1400000000130016 0x30014 0x160010))) (.bin (.bin (.leaf8 0x10021 + 0x2d2380000000010001a 0xf000000000f0016 0x67113d000000000d001a 0xc000000000b0016 + 0xe1b1c000000000a001a 0xb000000000a0016 0x90014) (.leaf8 0xd0010 0x10021 0x20356300000000007001a + 0x60016 0x500000000010016 0x4687940000000004001a 0x400000000040016 0xa10aef10000000001001a)) (.bin + (.leaf8 0x200000000010016 0x14 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x200000000020000000001000160a5fc000000000000000000010020 0x50010 0x40021) (.leaf8 0x17 0x1d + 0x103c3 (h240 0x160a5ff000000000300000000010000 + 0x5000160a5fd0000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000300000000000008b008f2000000000000000000010020) + 0x5000000000000000000060000000002001f 0x50023)))) (.bin (.bin (.bin (.leaf8 0x5000d + 0x600000000000000468793000000000100000000010020 0x7000000000000000000070000000000001f 0x60023 + 0x6000d 0x8000000000000000000020000000003001f 0x100000000030023 + 0xa0000000000000203562f000000000200000000000020) (.leaf8 0xb000e + 0xc0000000000000000000d00000000050000000000001e 0xc0023 0xc000d + 0xd000000000000000e1b1b000000000300000000010020 0xe0000000000000000000e0000000006001f + 0x1000000000e0023 0x100000000000000067113c000000000400000000000020)) (.bin (.leaf8 + 0x12000000000000000000110000000009001f 0x100000000120023 + 0x130000000000000002d237000000000500000000000020 0x5000e + 0x1600000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x1700000000000000149d0a000000000600000000010020) (.leaf8 0x18000000000000000000170000000007001f + (h240 0x10000 0x1800000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1900000000000000000001000000000c0000000001001e 0x100000000020023 + 0x1b00000000000000009070000000000700000000000020 0x1d0000000000000000001c0000000010001f + 0x1b0023))) (.bin (.bin (.leaf8 0x1b000d 0x1e00000000000000041f67000000000800000000010020 + 0x1f000000000000000000080000000011001f 0x100000000090023 + 0x2100000000000000001ce2000000000900000000000020 0x5000e + 0x240000000000000000002200000000130000000000001e 0x210023) (.leaf8 0x21000d + 0x250000000000000000d313000000000a00000000010020 0x5000e + 0x270000000000000000002500000000150000000000001e 0x240023 0x24000d + 0x28000000000000000005c5000000000b00000000010020 0x2000e)) (.bin (.leaf8 + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x2b0000000000000000000100000000160000000001001e 0x100000000020023 + 0x2d00000000000000002a35000000000c00000000000020 0x2f000000000000000000290000000003001f (h240 + 0x1000000002a00000000010000 0x100000000020000000001000000002b0000000004001c) 0x2b000f) (.leaf8 + 0x310000000000000000002b00000000180000000001001e 0x2a0023 0x2a000d + 0x3200000000000000000126000000000d00000000010020 0x3300000000000000000007000000001b001f + 0x100000000080023 0x3500000000000000000870000000000e00000000000020 0xa000e)))))) (.bin (.bin (.bin + (.bin (.bin (.leaf8 0x3800000000000000000031000000001d0000000000001e 0x300023 0x30000d + 0x3900000000000000000039000000000f00000000010020 0x3a000000000000000000020000000001001f (h240 + 0x10000 0x300000000010000000000000000000100000000330000000003001c) 0x33000f + 0x3c00000000000000000033000000001f0000000001001e) (.leaf8 0x320023 0x32000d + 0x3d000000000000000001ae000000001000000000010020 0x34000e + 0x3f0000000000000000000200000000200000000000001e 0x100000000030023 + 0x410000000000000000000a000000001100000000000020 0x43000000000000000000380000000000001f)) (.bin + (.leaf8 0x370023 0x37000d 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x450000000000000000000100000000220000000001001e 0x100000000020023 + 0x4700000000000000000054000000001200000000000020) (.leaf8 0x490000000000000000003b0000000003001f + (h240 0x1000000003c00000000010000 0x100000000020000000001000000003d0000000004001c) 0x3d000f + 0x4b0000000000000000003d00000000240000000001001e 0x3c0023 0x3c000d + 0x4c00000000000000000000000000001300000000010020 0x4d0000000000000000003e0000000003001f))) (.bin + (.bin (.leaf8 (h240 0x10000 0x3f00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x4e0000000000000000000100000000260000000001001e 0x100000000020023 + 0x500000000000000000000f000000001400000000000020 0x52000000000000000000410000000002001f 0x400023 + 0x40000d) (.leaf8 0x52000000000000000000420000000002001f 0x410023 0x41000d + 0x5300000000000000000045000000002c001f 0x440023 0x44000d + 0x5400000000000000000001000000001600000000010020 0x55000000000000000000470000000002001f)) (.bin + (.leaf8 0x460023 0x46000d 0x55000000000000000000480000000000001f 0x470023 0x47000d + 0x5600000000000000000002000000002f001f (h240 0x10000 + 0x300000000010000000000000000000100000000500000000003001c) 0x50000f) (.leaf8 + 0x580000000000000000005000000000020000000001001e 0x4f000b 0x4900000000010016 0x10000000046001a + 0x4600000000460016 0x4200000000410016 0x70000000040001a 0x4100000000400016)))) (.bin (.bin (.bin + (.leaf8 0x20014 0x3f00000000040000000000000000000200000000430000000000001f 0x430009 0x20021 + 0x3e000000003d0016 0x16 0x2a000000003a001a 0x3b000000003a0016) (.leaf8 0x20014 + 0x3000000000400000000000000000002000000003d0000000000001f 0x3d0009 0x10021 0x50000000037001a + 0x3800000000370016 0x30014 0x3a0010)) (.bin (.leaf8 0x10021 0x3600000000330016 0xd70000000034001a + 0x320016 0x3300000000010016 0x1c0000000031001a 0x3200000000310016 0x3000000000090016) (.leaf8 + 0x437000000002e001a 0x2f000000002e0016 0x80014 0x310010 0x10021 0x93000000002b001a + 0x2c000000002b0016 0x16))) (.bin (.bin (.leaf8 0x151b0000000028001a 0x270016 0x16 + 0x2700000000010016 0x2e20000000025001a 0x2600000000250016 0x2400000000040016 0x69890000000022001a) + (.leaf8 0x2300000000220016 0x2100000000040016 0xe70000000001f001a 0x20000000001f0016 0x90014 + 0x220010 0x10021 0x20fb4000000001c001a)) (.bin (.leaf8 0x1b000000001b0016 0x48370000000019001a + 0x1a00000000190016 0x20014 0x18000000000400000000000000000002000000001c0000000000001f 0x1c0009 + 0x20021 0xa4e850000000016001a) (.leaf8 0x1700000000160016 0x1500000000040016 0x1691b0000000013001a + 0x120016 0x33889e0000000010001a 0x1100000000100016 0x14 0x130010))))) (.bin (.bin (.bin (.bin + (.leaf8 0x10021 0xf000000000c0016 0x70d8d000000000d001a 0xe000000000d0016 0x101ab18000000000a001a + 0x90016 0x800000000010016 0x2343ca0000000007001a) (.leaf8 0x600000000050016 + 0x50857780000000004001a 0x300000000030016 0xb052ff0000000001001a 0x3001d + 0x1000000000100000000010000b052fe000000000000000000000020 + 0x20000000005000000000100000000050000000001001f 0x100000000060023)) (.bin (.leaf8 + 0x2000000000600000000010005085777000000000100000000000020 + 0x20000000008000000000100000000080000000002001f 0x100000000080023 + 0x2000000000a000000000100002343c9000000000200000000000020 + 0x2000000000c0000000001000000000a0000000000001f 0x90023 0x9000d + 0x2000000000d000000000100000000020000000005001f) (.leaf8 0x100000000030023 + 0x2000000000f0000000001000101ab17000000000300000000000020 + 0x20000000011000000000100000000100000000008001f 0xf0023 0xf000d + 0x2000000001200000000010000070d8c000000000400000000010020 + 0x20000000013000000000100000000110000000007001f (h240 0x1000000001200000000010000 + 0x10000000002000000000100000000130000000004001c)))) (.bin (.bin (.leaf8 0x13000f + 0x200000000150000000001000000001300000000080000000001001e 0x120023 0x12000d + 0x2000000001600000000010000207189000000000500000000010020 + 0x20000000017000000000100000000140000000009001f 0x140009 0x180021) (.leaf8 0x17 0x1d 0x103c3 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x1929b5150000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x50000b052ff00000000060000000001000000000000000000010000) + 0x8000508577700000000090000000001000000000800000000020000) + 0x1000000000b00002343c9000000000c00000000010000) + 0xb000000000100000000030000000001000000000000000000010000) + 0xe000101ab17000000000f000000000100000000110000070d8e0000) + 0x12000000000100000000000000000001000000000200000000010000) + 0x14000020718a0000000015000000000100000000130000000018001c) 0x13000d (h240 + 0x20000000000000000000100000000010000 0x2000000001700000000000000131712000000000500000000010020) + 0x1900000000000000000002000000000b001f 0x100000000030023)) (.bin (.leaf8 + 0x1b0000000000000001691a000000000600000000000020 0x1d000000000000000000170000000002001f 0x160023 + 0x16000d 0x1d00000000000000000019000000000e001f 0x180023 0x18000d + 0x1e000000000000000a4e84000000000700000000010020) (.leaf8 0x1a000e + 0x100000000050000000001000000001c0000000002001c 0x1c000f + 0x200000000000000000001c000000000d0000000001001e 0x1b0023 0x1b000d + 0x2100000000000000004836000000000800000000010020 0x220000000000000000001d0000000011001f)))) (.bin + (.bin (.bin (.leaf8 0x1000000001e0023 0x2300000000000000020fb3000000000900000000000020 0xb000e + 0x260000000000000000002200000000130000000000001e 0x210023 0x21000d + 0x2700000000000000000e6f000000000a00000000010020 0x28000000000000000000230000000002001f) (.leaf8 + 0x220023 0x22000d 0x28000000000000000000250000000016001f 0x240023 0x24000d + 0x2900000000000000006988000000000b00000000010020 0x2a000000000000000000260000000002001f 0x250023)) + (.bin (.leaf8 0x25000d 0x2a000000000000000000280000000018001f 0x270023 0x27000d + 0x2b000000000000000002e1000000000c00000000010020 0x2c000000000000000000290000000000001f 0x280023 + 0x28000d) (.leaf8 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x2e0000000000000000000100000000180000000001001e 0x100000000020023 + 0x300000000000000000151a000000000d00000000000020 0x2000e + 0x100000000000000000001000000002d0000000002001c))) (.bin (.bin (.leaf8 0x2d000f + 0x340000000000000000002d000000001b0000000001001e 0x2c0023 0x2c000d + 0x3500000000000000000092000000000e00000000010020 0xa000e + 0x3700000000000000000031000000001d0000000000001e 0x300023) (.leaf8 0x30000d + 0x3800000000000000000436000000000f00000000010020 0x39000000000000000000320000000005001f (h240 + 0x10000 0x3300000000010000000000000000000100000000330000000003001c) 0x33000f + 0x3a00000000000000000033000000001f0000000001001e 0x320023 0x32000d)) (.bin (.leaf8 + 0x3b0000000000000000001b000000001000000000010020 0x3c000000000000000000350000000000001f 0x340023 + 0x34000d 0x3c000000000000000000020000000020001f 0x100000000020023 + 0x3e000000000000000000d6000000001100000000000020 0x40000000000000000000380000000021001f) (.leaf8 + (h240 0x1000000003900000000010000 0x100000000050000000001000000003a0000000004001c) 0x3a000f + 0x420000000000000000003a00000000220000000001001e 0x390023 0x39000d + 0x4300000000000000000004000000001200000000010020 0x5000e + 0x100000000050000000001000000003d0000000002001c))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x3d000f 0x460000000000000000003d00000000230000000001001e 0x3c0023 0x3c000d + 0x4700000000000000000029000000001300000000010020 0x2000e + 0x100000000000000000001000000003f0000000002001c 0x3f000f) (.leaf8 + 0x4a0000000000000000003f00000000270000000001001e 0x3e0023 0x3e000d 0x41000e + 0x10000000005000000000100000000430000000002001c 0x43000f + 0x4d0000000000000000004300000000270000000001001e 0x420023)) (.bin (.leaf8 0x42000d + 0x4e00000000000000000006000000001500000000010020 0x4f00000000000000000044000000002a001f (h240 + 0x10000 0x4400000000020000000000000000000100000000470000000003001c) 0x47000f + 0x5100000000000000000047000000002d0000000001001e 0x460023 0x46000d) (.leaf8 + 0x5200000000000000000000000000001700000000010020 0x530000000000000000004b0000000000001f 0x4a0023 + 0x4a000d 0x54000000000000000000020000000033001f 0x2000a 0x4c0008 0x10009))) (.bin (.bin (.leaf8 + 0x10021 0x4800000000490016 0x14 0x4a0010 0x10021 0x4500000000420016 0x30000000043001a + 0x500000000420016) (.leaf8 0x4000000000400016 0x30014 0x420010 0x10021 0x15000000003d001a + 0x5000000003c0016 0x3c00000000040016 0x2000000003a001a)) (.bin (.leaf8 0x500000000390016 0x390014 + 0x70010 0x10021 0x6b0000000037001a 0x360016 0x20014 0x20010) (.leaf8 0x10021 0xe0000000034001a + 0x3400000000340016 0x330014 0x360010 0x10021 0x21b0000000031001a 0x3200000000310016)))) (.bin + (.bin (.bin (.leaf8 0x3000000000090016 0x49000000002e001a 0x2c0016 0x2d00000000010016 + 0xa8c000000002b001a 0x2c000000002b0016 0x20014 + 0x3000000000400000000000000000002000000002e0000000000001f) (.leaf8 0x2e0009 0x10021 + 0x1710000000028001a 0x2900000000280016 0x34c50000000025001a 0x2400000000240016 0x7380000000022001a + 0xc00000000210016)) (.bin (.leaf8 0x107d9000000001f001a 0x20000000001f0016 0x1e0014 0x220010 + 0x10021 0x241b000000001c001a 0x1d000000001c0016 0x1b00000000030016) (.leaf8 0x527420000000019001a + 0x1a00000000190016 0xb48d0000000016001a 0x1700000000160016 0x30014 0x190010 0x10021 + 0x19c44f0000000013001a))) (.bin (.bin (.leaf8 0x200000000120016 0x120014 0x40010 0x10021 + 0x386c60000000010001a 0x1100000000100016 0x80d58b000000000d001a 0xe000000000d0016) (.leaf8 0x30014 + 0x100010 0x10021 0xc00000000090016 0x11a1e4000000000a001a 0x90016 0x80014 0x20010)) (.bin (.leaf8 + 0x10021 0x2842bbb0000000007001a 0x800000000070016 0x60014 0xa0010 0x10021 0x58297f0000000004001a + 0x30016) (.leaf8 0x20014 0x20010 0x10021 0xc94da8a0000000001001a 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f 0x20023))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x2000d 0x2000000000200000000010001b8cfa6000000000000000000010020 (h240 0x100000000000000 + 0x100000000040000000000000adc0ae2000000000000000000010020) 0x4000e + 0x60000000000000000000200000000000000000000001e 0x100000000030023 + 0x80000000000000058297e000000000100000000000020 0x8000e) (.leaf8 + 0xa0000000000000000000a00000000030000000000001e 0x90023 0x9000d + 0xb00000000000002842bba000000000200000000010020 0xa000e + 0xd0000000000000000000200000000040000000000001e 0x100000000030023 + 0xf0000000000000011a1e3000000000300000000000020)) (.bin (.leaf8 + 0x110000000000000000000e0000000005001f (h240 0x1000000000f00000000010000 + 0x10000000005000000000100000000100000000004001c) 0x10000f + 0x130000000000000000001000000000060000000001001e 0xf0023 0xf000d + 0x140000000000000080d58a000000000400000000010020 0x1500000000000000000013000000000a001f) (.leaf8 + 0x120023 0x12000d 0x16000000000000000386c5000000000500000000010020 0x14000e + 0x1700000000000000000004000000000a0000000000001e 0x100000000050023 + 0x190000000000000019c44e000000000600000000000020 0x5000e))) (.bin (.bin (.leaf8 + 0x1c00000000000000000019000000000d0000000000001e 0x180023 0x18000d + 0x1d0000000000000000b48c000000000700000000010020 0x1e0000000000000000001c0000000010001f 0x1b0023 + 0x1b000d 0x1f00000000000000052741000000000800000000010020) (.leaf8 + 0x200000000000000000001d0000000001001f (h240 0x10000 + 0x1e000000000100000000000000000001000000001e0000000003001c) 0x1e000f + 0x210000000000000000001e00000000110000000001001e 0x1d0023 0x1d000d + 0x220000000000000000241a000000000900000000010020 0x20000e)) (.bin (.leaf8 + 0x230000000000000000002200000000130000000000001e 0x210023 0x21000d + 0x24000000000000000107d8000000000a00000000010020 0x250000000000000000000e0000000015001f + 0x1000000000f0023 0x2700000000000000000737000000000b00000000000020 + 0x29000000000000000000260000000017001f) (.leaf8 0x100000000270023 + 0x2a000000000000000034c4000000000c00000000000020 0x2c0000000000000000002b000000001a001f 0x2a0023 + 0x2a000d 0x2d00000000000000000170000000000d00000000010020 0x5000e + 0x100000000050000000001000000002e0000000002001c)))) (.bin (.bin (.bin (.leaf8 0x2e000f + 0x300000000000000000002e00000000190000000001001e 0x2d0023 0x2d000d + 0x3100000000000000000a8b000000000e00000000010020 0x320000000000000000002f0000000000001f 0x2e0023 + 0x2e000d) (.leaf8 0x3200000000000000000002000000001c001f 0x100000000020023 + 0x3400000000000000000048000000000f00000000000020 0x36000000000000000000320000000005001f (h240 + 0x10000 0x3300000000010000000000000000000100000000330000000003001c) 0x33000f + 0x3700000000000000000033000000001f0000000001001e 0x320023)) (.bin (.leaf8 0x32000d + 0x380000000000000000021a000000001000000000010020 0x35000e + 0x390000000000000000003600000000210000000000001e 0x350023 0x35000d + 0x3a0000000000000000000d000000001100000000010020 0x4000e) (.leaf8 + 0x3c0000000000000000000200000000220000000000001e 0x100000000030023 + 0x3e0000000000000000006a000000001200000000000020 0x3b000e + 0x400000000000000000000700000000240000000000001e 0x100000000080023 + 0x4200000000000000000001000000001300000000000020 0x440000000000000000003e0000000002001f))) (.bin + (.bin (.leaf8 0x3d0023 0x3d000d 0x44000000000000000000070000000027001f 0x100000000080023 + 0x4600000000000000000014000000001400000000000020 0x5000e + 0x490000000000000000004200000000290000000000001e 0x410023) (.leaf8 0x41000d + 0x4a00000000000000000007000000002b001f 0x100000000080023 + 0x4c00000000000000000002000000001600000000000020 0x4e00000000000000000047000000002b001f (h240 + 0x1000000004800000000010000 0x100000000020000000001000000004a0000000004001c) 0x4a000f + 0x500000000000000000004a000000002e0000000001001e)) (.bin (.leaf8 0x490023 0x49000d 0x4d000e + 0x520000000000000000000100000000000000000000001e 0x4e0000000000000b 0x200000000490016 0x480014 + 0x40010) (.leaf8 0x10021 0x10000000046001a 0x450016 0x4300000000060016 0x4200000000040016 + 0x90000000040001a 0x4100000000400016 0x80014)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 0x430010 + 0x10021 0x1000000003d001a 0x3c0016 0x3c00000000060016 0x35000000003a001a 0x390016 + 0x500000000010016) (.leaf8 0x70000000037001a 0x3600000000350016 0x10d0000000034001a + 0x3400000000340016 0x330014 0x360010 0x10021 0x240000000031001a)) (.bin (.leaf8 0x300016 0x20014 + 0x20010 0x10021 0x546000000002e001a 0x2f000000002e0016 0x600000000030016 0xb8000000002b001a) + (.leaf8 0x2c000000002b0016 0x1a620000000028001a 0x270016 0x39c0000000025001a 0x240016 + 0x24000000000d0016 0x83ec0000000022001a 0x2100000000210016))) (.bin (.bin (.leaf8 + 0x120d000000001f001a 0x1f000000001f0016 0x1e0014 0x210010 0x10021 0x293a1000000001c001a + 0x1b000000001b0016 0x5a460000000019001a) (.leaf8 0x600000000180016 0xce2270000000016001a 0x150016 + 0x1500000000030016 0x1c3630000000013001a 0x1200000000120016 0x406ac50000000010001a + 0x5000000000f0016)) (.bin (.leaf8 0xf0014 0x70010 0x10021 0x8d0f1000000000d001a 0xe000000000d0016 + 0x30014 0x100010 0x10021) (.leaf8 0xc00000000090016 0x14215dd000000000a001a 0x900000000090016 + 0x2c14bf0000000007001a 0x60016 0x500000000010016 0x64a6d450000000004001a 0x300000000020016)))) + (.bin (.bin (.bin (.leaf8 0xdc67d30000000001001a 0x200000000010016 0x14 + 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x2000000000200000000010000dc67d2000000000000000000010020 + 0x20000000003000000000100000000050000000000001f) (.leaf8 0x100000000050023 + 0x20000000005000000000100064a6d44000000000100000000000020 + 0x20000000007000000000100000000070000000000001f 0x60023 0x6000d + 0x20000000008000000000100000000020000000003001f 0x100000000030023 + 0x2000000000a000000000100002c14be000000000200000000000020)) (.bin (.leaf8 + 0x2000000000c0000000001000000000b0000000005001f 0x1000000000c0023 + 0x2000000000d000000000100014215dc000000000300000000000020 + 0x2000000000f0000000001000000000e0000000005001f (h240 0x1000000000f00000000010000 + 0x10000000005000000000100000000100000000004001c) 0x10000f + 0x200000000110000000001000000001000000000060000000001001e 0xf0023) (.leaf8 0xf000d + 0x200000000120000000001000008d0f0000000000400000000010020 0x11000e + 0x200000000130000000001000000000700000000080000000000001e 0x100000000080023 + 0x2000000001500000000010000288df1000000000500000000000020 + 0x20000000017000000000100000000140000000009001f 0x140009))) (.bin (.bin (.leaf8 0x180021 0x17 0x1d + 0x103c3 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x1f7422760000 + 0x3000000000100000000050000dc67d3000000000600000000010000) + 0x5000000000200000000000000000001000000000800064a6d440000) + 0x9000000000100000000080000000001000000000300000000010000) + 0x1000000000b00002c14bf000000000c00000000010000) 0x1000000000e00014215dd000000000f00000000010000) + 0x1000000000500000000010000000011000008d0f20000) + 0x12000000000100000000080000000001000000000000000000010000) + 0x140000288df10000000015000000000100000000130000000018001c) 0x13000d (h240 + 0x20000000000000000000100000000010000 0x200000000170000000000000017dcd1000000000500000000010020) + 0x1900000000000000000014000000000b001f) (.leaf8 0x100000000150023 + 0x1a0000000000000001c362000000000600000000000020 0x1c000000000000000000170000000001001f (h240 + 0x10000 0x1800000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1d00000000000000000001000000000c0000000001001e 0x100000000020023 + 0x1f000000000000000ce226000000000700000000000020)) (.bin (.leaf8 + 0x2100000000000000000008000000000f001f 0x100000000090023 + 0x2300000000000000005a45000000000800000000000020 0x250000000000000000001d0000000011001f + 0x1000000001e0023 0x26000000000000000293a0000000000900000000000020 0x20000e + 0x280000000000000000002100000000130000000000001e) (.leaf8 0x200023 0x20000d + 0x290000000000000000120c000000000a00000000010020 0x2a000000000000000000230000000015001f + 0x100000000240023 0x2b000000000000000083eb000000000b00000000000020 + 0x2d000000000000000000260000000008001f 0x250023))))) (.bin (.bin (.bin (.bin (.leaf8 0x25000d + 0x2d000000000000000000020000000017001f 0x100000000030023 + 0x2f0000000000000000039b000000000c00000000000020 0x31000000000000000000020000000019001f + 0x100000000030023 0x3300000000000000001a61000000000d00000000000020 + 0x350000000000000000002e000000001c001f) (.leaf8 0x2d0023 0x2d000d + 0x36000000000000000000b7000000000e00000000010020 0x37000000000000000000080000000001001f (h240 + 0x10000 0x900000000010000000000000000000100000000300000000003001c) 0x30000f + 0x3900000000000000000030000000001d0000000001001e 0x2f0023)) (.bin (.leaf8 0x2f000d + 0x3a00000000000000000545000000000f00000000010020 0x4000e + 0x3c00000000000000000002000000001e0000000000001e 0x100000000030023 + 0x3e00000000000000000023000000001000000000000020 0x35000e + 0x400000000000000000003600000000210000000000001e) (.leaf8 0x350023 0x35000d + 0x410000000000000000010c000000001100000000010020 0x42000000000000000000380000000022001f + 0x100000000380023 0x4400000000000000000006000000001200000000000020 + 0x46000000000000000000070000000000001f 0x60023))) (.bin (.bin (.leaf8 0x6000d + 0x47000000000000000000020000000025001f 0x100000000030023 + 0x4900000000000000000034000000001300000000000020 0x4b0000000000000000003e0000000003001f (h240 + 0x10000 0x3f00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x4c0000000000000000000100000000260000000001001e) (.leaf8 0x100000000020023 + 0x4e00000000000000000000000000001400000000000020 0xa000e + 0x500000000000000000004300000000290000000000001e 0x420023 0x42000d + 0x5100000000000000000008000000001500000000010020 0x52000000000000000000440000000002001f)) (.bin + (.leaf8 0x430023 0x43000d 0x52000000000000000000450000000003001f (h240 0x10000 + 0x4600000000010000000000000000000100000000010000000003001c) 0x1000f + 0x5400000000000000000001000000002c0000000001001e 0x100000000020023 + 0x5600000000000000000000000000001700000000000020) (.leaf8 0x4a000e + 0x5800000000000000000004000000002f0000000000001e 0x30023 0x3000d 0x4e000e 0xa200c6 0x10043 + 0x50142)))) (.bin (.bin (.bin (.leaf8 0x101c3 0x60009 0x4a00000000490016 0x20014 + 0x46000000000400000000000000000002000000004c0000000000001f 0x4c0009 0x20021 0x50000000043001a) + (.leaf8 0xb00000000420016 0x3f0016 0x16 0x1a000000003d001a 0x3e000000003d0016 0x30014 0x400010 + 0x10021)) (.bin (.leaf8 0x3c00000000060016 0x2000000003a001a 0x3b000000003a0016 0x14 0x3d0010 + 0x10021 0x3900000000360016 0x860000000037001a) (.leaf8 0x3600000000350016 0x110000000034001a + 0x3500000000340016 0x30014 0x370010 0x10021 0x3300000000030016 0x2a20000000031001a))) (.bin (.bin + (.leaf8 0x3100000000310016 0x90014 0x330010 0x10021 0x5c000000002e001a 0x2d000000002d0016 + 0xd30000000002b001a 0x2a0016) (.leaf8 0x2a00000000010016 0x1cd0000000028001a 0x270016 + 0x2700000000010016 0x41f50000000025001a 0x2600000000250016 0x240014 0x280010)) (.bin (.leaf8 + 0x10021 0x9060000000022001a 0x2200000000220016 0x149d0000000001f001a 0x20000000001f0016 0x1e0014 + 0x220010 0x10021) (.leaf8 0x2d22000000001c001a 0x1d000000001c0016 0x90014 0x1f0010 0x10021 + 0x671130000000019001a 0x180016 0x16)))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0xe1b10000000016001a 0x1700000000160016 0x150014 0x190010 0x10021 0x2035620000000013001a 0x120016 + 0x1200000000060016) (.leaf8 0x468780000000010001a 0x1100000000100016 0x30016 + 0xa10aee000000000d001a 0xe000000000d0016 0xc0014 0x100010 0x10021)) (.bin (.leaf8 + 0x160a5f000000000a001a 0x90016 0x800000000010016 0x32536a20000000007001a 0x60016 0x50014 0x20010 + 0x10021) (.leaf8 0x6e33e90000000004001a 0x500000000040016 0xfba113b0000000001001a 0x3001d + 0x100000000010000000001000227039a000000000000000000000020 0x50010 0x60021 0x17))) (.bin (.bin + (.leaf8 0x1d 0x103c3 (h240 (h240 0x227039b0000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x5000227039a0000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x200000000050000000000000d930d9e000000000000000000010020) + 0x7000000000000000000070000000002001f 0x60023 0x6000d) (.leaf8 + 0x8000000000000006e33e8000000000100000000010020 0x7000e + 0xa0000000000000000000200000000020000000000001e 0x100000000030023 + 0xc000000000000032536a1000000000200000000000020 0xe0000000000000000000a0000000000001f 0x90023 + 0x9000d)) (.bin (.leaf8 0xf000000000000000000020000000005001f 0x100000000030023 + 0x1100000000000000160a5e000000000300000000000020 0xe000e + 0x130000000000000000001000000000070000000000001e 0xf0023 0xf000d + 0x1400000000000000a10aed000000000400000000010020) (.leaf8 0x15000000000000000000020000000001001f + (h240 0x10000 0x300000000010000000000000000000100000000120000000003001c) 0x12000f + 0x170000000000000000001200000000090000000001001e 0x110023 0x11000d + 0x1800000000000000046877000000000500000000010020 0x19000000000000000000140000000003001f)))) (.bin + (.bin (.bin (.leaf8 (h240 0x10000 0x1500000000010000000000000000000100000000010000000003001c) + 0x1000f 0x1a00000000000000000001000000000a0000000001001e 0x100000000020023 + 0x1c00000000000000203561000000000600000000000020 0x17000e + 0x1e00000000000000000019000000000d0000000000001e 0x180023) (.leaf8 0x18000d + 0x1f0000000000000000e1b0000000000700000000010020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x2200000000000000000001000000000e0000000001001e 0x100000000020023 + 0x2400000000000000067112000000000800000000000020)) (.bin (.leaf8 0xb000e + 0x270000000000000000001f00000000110000000000001e 0x1e0023 0x1e000d + 0x2800000000000000002d21000000000900000000010020 0x20000e + 0x290000000000000000002200000000130000000000001e 0x210023) (.leaf8 0x21000d + 0x2a000000000000000149cf000000000a00000000010020 0x2b000000000000000000240000000016001f 0x230023 + 0x23000d 0x2c00000000000000000905000000000b00000000010020 0x26000e + 0x2d0000000000000000002800000000170000000000001e))) (.bin (.bin (.leaf8 0x270023 0x27000d + 0x2e000000000000000041f4000000000c00000000010020 0x2f000000000000000000290000000000001f 0x280023 + 0x28000d 0x2f000000000000000000020000000019001f 0x100000000030023) (.leaf8 + 0x31000000000000000001cc000000000d00000000000020 0x330000000000000000002c0000000000001f 0x2b0023 + 0x2b000d 0x3300000000000000000002000000001b001f 0x100000000030023 + 0x3500000000000000000d2f000000000e00000000000020 0x370000000000000000002f000000001d001f)) (.bin + (.leaf8 0x100000000300023 0x380000000000000000005b000000000f00000000000020 0xb000e + 0x3b00000000000000000033000000001f0000000000001e 0x320023 0x32000d + 0x3c000000000000000002a1000000001000000000010020 0x3d000000000000000000350000000001001f) (.leaf8 + (h240 0x1000000003600000000010000 0x10000000005000000000100000000370000000004001c) 0x37000f + 0x3f0000000000000000003700000000200000000001001e 0x360023 0x36000d + 0x4000000000000000000010000000001100000000010020 0x41000000000000000000380000000022001f + 0x100000000380023))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x4300000000000000000085000000001200000000000020 0x450000000000000000003b0000000023001f (h240 + 0x1000000003c00000000010000 0x100000000020000000001000000003d0000000004001c) 0x3d000f + 0x470000000000000000003d00000000240000000001001e 0x3c0023 0x3c000d + 0x4800000000000000000001000000001300000000010020) (.leaf8 0x490000000000000000003e0000000003001f + (h240 0x1000000003f00000000010000 0x10000000005000000000100000000400000000004001c) 0x40000f + 0x4b0000000000000000004000000000260000000001001e 0x3f0023 0x3f000d + 0x4c00000000000000000019000000001400000000010020 0x2000e)) (.bin (.leaf8 + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x4f0000000000000000000100000000280000000001001e (h240 0x10000 + 0x2000000000100000000000000000001000000000c0000000003001c) 0xc000f + 0x510000000000000000000c000000002a0000000001001e 0x1000000000d0023 + 0x5300000000000000000004000000001600000000000020) (.leaf8 0x48000e + 0x100000000050000000001000000004c0000000002001c 0x4c000f + 0x570000000000000000004c000000002d0000000001001e 0x4b0023 0x4b000d + 0x58000000000000000000070000000033001f 0x7000a))) (.bin (.bin (.leaf8 0x4d0008 0x10009 0x10021 + 0x4900000000030016 0x20000000046001a 0x450016 0xb0016 0x16) (.leaf8 0x4200000000010016 + 0xc0000000040001a 0x4100000000400016 0x30016 0x1000000003d001a 0x3e000000003d0016 0x16 + 0x43000000003a001a)) (.bin (.leaf8 0x390016 0x380014 0x20010 0x10021 0x80000000037001a + 0x3800000000370016 0x30016 0x1510000000034001a) (.leaf8 0x3400000000340016 0x33000000000a0016 + 0x2d0000000031001a 0x300016 0x698000000002e001a 0x2d0016 0x2d00000000010016 0xe6000000002b001a)))) + (.bin (.bin (.bin (.leaf8 0x2a0016 0x2a00000000010016 0x20fa0000000028001a 0x2900000000280016 + 0x4830000000025001a 0x2500000000250016 0xa4e80000000022001a 0x2100000000210016) (.leaf8 + 0x1691000000001f001a 0xc000000001e0016 0x33889000000001c001a 0x1b0016 0x16 0x1b00000000010016 + 0x70d80000000019001a 0x1800000000180016)) (.bin (.leaf8 0x101ab00000000016001a 0x1700000000160016 + 0x20014 0x1500000000040000000000000000000200000000190000000000001f 0x190009 0x20021 + 0x2343c0000000013001a 0x110016) (.leaf8 0x1200000000010016 0x5085760000000010001a + 0x1100000000100016 0xb052f000000000d001a 0xe000000000d0016 0x30014 0x100010 0x10021))) (.bin (.bin + (.leaf8 0xc00000000090016 0x1929b50000000000a001a 0x90016 0x800000000010016 0x3719f40000000007001a + 0x800000000070016 0x7dd089d0000000004001a 0x30016) (.leaf8 0x20014 0x20010 0x10021 + 0x11381cd0000000001001a 0x100000000010016 0x14 0x20000000000000000000100000000030000000000001f + 0x20023)) (.bin (.leaf8 0x2000d 0x20000000002000000000100011381cc000000000000000000010020 0x4000e + 0x200000000040000000001000000000200000000000000000000001e 0x100000000030023 + 0x2000000000600000000010007dd089c000000000100000000000020 + 0x200000000080000000001000000000a0000000004001f 0x90023) (.leaf8 0x9000d + 0x20000000009000000000100003719f3000000000200000000010020 + 0x2000000000a0000000001000000000a0000000000001f 0x90023 0x9000d + 0x2000000000b000000000100000000020000000005001f 0x100000000030023 + 0x2000000000d00000000010001929b4f000000000300000000000020)))))) (.bin (.bin (.bin (.bin (.bin + (.leaf8 0x2000000000f0000000001000000000e0000000005001f (h240 0x1000000000f00000000010000 + 0x10000000005000000000100000000100000000004001c) 0x10000f + 0x200000000110000000001000000001000000000060000000001001e 0xf0023 0xf000d + 0x20000000012000000000100000b052e000000000400000000010020 + 0x2000000001300000000010000000013000000000a001f) (.leaf8 0x120023 0x12000d + 0x200000000140000000001000032b169000000000500000000010020 + 0x20000000015000000000100000000140000000007001f (h240 0x100000000000000 + 0x100000000160000000000000000001400000000020000000000001e) 0x130023 0x13000d + 0x17000000000000001dd40a000000000500000000010020)) (.bin (.leaf8 + 0x17000000000000000000140000000000001f 0x130023 0x13000d 0x1700000000000000000002000000000a001f + 0x100000000020023 0x190000000000000002343b000000000600000000000020 0x17000e + 0x10000000005000000000100000000190000000002001c) (.leaf8 0x19000f + 0x1c00000000000000000019000000000b0000000001001e 0x180023 0x18000d + 0x1d00000000000000101aaf000000000700000000010020 0x1e0000000000000000001a000000000f001f + 0x1000000001b0023 0x1f000000000000000070d7000000000800000000000020))) (.bin (.bin (.leaf8 + 0x210000000000000000001d0000000000001f 0x1c0023 0x1c000d 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x230000000000000000000100000000100000000001001e 0x100000000020023) (.leaf8 + 0x2500000000000000033888000000000900000000000020 0x270000000000000000000e0000000013001f + 0x1000000000f0023 0x2900000000000000001690000000000a00000000000020 + 0x2b000000000000000000230000000015001f 0x100000000240023 + 0x2c0000000000000000a4e7000000000b00000000000020 0x2e000000000000000000270000000018001f)) (.bin + (.leaf8 0x260023 0x26000d 0x2f00000000000000000482000000000c00000000010020 + 0x300000000000000000002b000000001a001f 0x2a0023 0x2a000d + 0x31000000000000000020f9000000000d00000000010020 0x320000000000000000002c0000000000001f) (.leaf8 + 0x2b0023 0x2b000d 0x3200000000000000000002000000001b001f 0x100000000030023 + 0x34000000000000000000e5000000000e00000000000020 0x360000000000000000002f0000000000001f 0x2e0023 + 0x2e000d)))) (.bin (.bin (.bin (.leaf8 0x3600000000000000000002000000001d001f 0x100000000030023 + 0x3800000000000000000697000000000f00000000000020 0x3a00000000000000000002000000001f001f + 0x100000000030023 0x3c0000000000000000002c000000001000000000000020 + 0x3e000000000000000000350000000006001f 0x340023) (.leaf8 0x34000d + 0x3e000000000000000000360000000022001f 0x350023 0x35000d + 0x3f00000000000000000150000000001100000000010020 0x40000000000000000000020000000001001f (h240 + 0x10000 0x300000000010000000000000000000100000000390000000003001c) 0x39000f)) (.bin (.leaf8 + 0x420000000000000000003900000000230000000001001e 0x380023 0x38000d + 0x4300000000000000000007000000001200000000010020 0x3a000e + 0x450000000000000000000200000000240000000000001e 0x100000000030023 + 0x4700000000000000000042000000001300000000000020) (.leaf8 0x2000e + 0x100000000000000000001000000003f0000000002001c 0x3f000f + 0x4b0000000000000000003f00000000270000000001001e 0x3e0023 0x3e000d + 0x4c00000000000000000000000000001400000000010020 0x4d000000000000000000020000000001001f))) (.bin + (.bin (.leaf8 (h240 0x10000 0x300000000010000000000000000000100000000420000000003001c) 0x42000f + 0x4f0000000000000000004200000000290000000001001e 0x410023 0x41000d + 0x500000000000000000000b000000001500000000010020 0x51000000000000000000440000000000001f 0x430023) + (.leaf8 0x43000d 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x530000000000000000000100000000050000000001001e (h240 0x10000 + 0x100000000020000000000000000000100000000010000000003001c) 0x1000f + 0x5500000000000000000001000000002c0000000001001e)) (.bin (.leaf8 0x100000000020023 + 0x5700000000000000000001000000001700000000000020 0x590000000000000000004b0000000001001f (h240 + 0x1000000004c00000000010000 0x1000000004e000000000100000000010000000004001c) 0x1000f + 0x5c0000000000000000000100000000020000000001001e 0x4e0000000001000b 0x4c0014) (.leaf8 0x4f000e + 0x20186 0x10043 0x500142 0x101c3 0x510023 0xa600c6 0x10043))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x10303 0x10009 0x4e0008 0x10009 0x10021 0x4b00000000010019 0x580000000000001d 0x490023) (.leaf8 + (h240 0x20000 0x1000000004f000000000100000000010000000003009c) 0x1000f (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x56188fd00000000000000 + 0x100000000020027512afc0000000003000000000100000000040001) + 0x1381cd000000000600000000010000000005000000000100000000030000) + 0x10000000000000000000100000000080007dd089c00000000090000) + 0x1000000000b00003719f4000000000c0000000001000000000b0000) + 0x10000000003000000000100000000000000000001000000000e0001) + 0x929b50000000000f00000000010000000000000000000100000000050000) + 0x1000000001100000b052f0000000012000000000100000000140000) + 0x508577000000001500000000010000000002000000000200000000000000) + 0x10000000017000002343c0000000018000000000100000000050000) + 0x1000000001a0000101ab1000000001b000000000100000000000000) + 0x1000000001d00000070d8000000001e000000000100000000030000) + 0x1000000000000000000010000000002000000000100000000000000) + 0x10000000020000003388800000000210000000001000000000f0000) + 0x1000000000000000000010000000023000000169100000000240000) + 0x1000000000000000000010000000026000000a4e700000000270000) + 0x100000000280000000483000000002a0000000001000000002c0000) + 0x20fb000000002d00000000010000000003000000000100000000000000) + 0x1000000002f00000000e60000000030000000000100000000030000) + 0x1000000000000000000010000000032000000069700000000330000) + 0x1000000000300000000010000000000000000000100000000350000) + 0x2d000000003600000000010000000037000000015100000000390000) + 0x10000000003000000000100000000000000000001000000003a0000) + 0x8000000003c0000000001000000003b000000000100000000030000) + 0x100000000000000000001000000003e0000000042000000003f0000) + 0x1000000000300000000010000000000000000000100000000400000) + 0x1000000004200000000010000000003000000000100000000000000) + 0x10000000043000000000d0000000045000000000100000000030000) + 0x1000000000000000000010000000001000000000200000000000000) + 0x10000000002000000000100000000000000000002000000004a0000) + 0x5800000000020000000000000000000100000000330000000001001e) 0x4f0000000000000b 0x14 0x4f000e + 0xa400c6 0x10043)) (.bin (.leaf8 0x20142 0x101c3 0x30009 0x4a00000000010019 0x580000000000001d + 0x480023 0x300000000000000000001009c 0x30003) (.leaf8 0x3000f (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x56189690000000000000000000100000000020027 + 0x512afc00000000030000000001000000000400011381cd00000000060000) + 0x1000000000500000000010000000003000000000100000000000000) + 0x100000000080007dd089c00000000090000000001000000000b0000) + 0x3719f4000000000c0000000001000000000b000000000100000000030000) + 0x100000000000000000001000000000e0001929b50000000000f0000) + 0x1000000000000000000010000000005000000000100000000110000) + 0xb052f000000001200000000010000000014000050857700000000150000) + 0x1000000000200000000020000000000000000000100000000170000) + 0x2343c0000000018000000000100000000050000000001000000001a0000) + 0x101ab1000000001b000000000100000000000000000001000000001d0000) + 0x70d8000000001e00000000010000000003000000000100000000000000) + 0x1000000000200000000010000000000000000000100000000200000) + 0x3388800000000210000000001000000000f000000000100000000000000) + 0x1000000002300000016910000000024000000000100000000000000) + 0x10000000026000000a4e70000000027000000000100000000280000) + 0x483000000002a0000000001000000002c00000020fb000000002d0000) + 0x10000000003000000000100000000000000000001000000002f0000) + 0xe6000000003000000000010000000003000000000100000000000000) + 0x1000000003200000006970000000033000000000100000000030000) + 0x1000000000000000000010000000035000000002d00000000360000) + 0x1000000003700000001510000000039000000000100000000030000) + 0x100000000000000000001000000003a0000000008000000003c0000) + 0x1000000003b00000000010000000003000000000100000000000000) + 0x1000000003e0000000042000000003f000000000100000000030000) + 0x1000000000000000000010000000040000000000100000000420000) + 0x1000000000300000000010000000000000000000100000000430000) + 0xd000000004500000000010000000003000000000100000000000000) + 0x1000000000100000000020000000000000000000100000000020000) + 0x100000000000000000001000000004a000000000100000000490000) + 0x5900000000010000000000000000000300000000330000000001001e) 0x3000b 0x490014 0x20010 0x10021 + 0x480016 0x16))) (.bin (.bin (.leaf8 0x10014 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f (h240 0x10000 + 0x300000000010000000003000000000300000000010000000002001d) 0x10009 0x40021 0x60000000043001a) + (.leaf8 0x4300000000430016 0x30014 0x450010 0x10021 0x4000000000400016 0x30014 0x420010 0x10021)) + (.bin (.leaf8 0x21000000003d001a 0x3c0016 0x3b00000000010016 0x4000000003a001a 0x380016 + 0x3900000000010016 0xa80000000037001a 0x3600000000350016) (.leaf8 0x160000000034001a 0x330016 + 0x3300000000010016 0x34b0000000031001a 0x300016 0x3000000000010016 0x72000000002e001a + 0x2f000000002e0016)))) (.bin (.bin (.bin (.leaf8 0x30014 0x310010 0x10021 0x107d000000002b001a + 0x2c000000002b0016 0x2410000000028001a 0x2800000000280016 0x52730000000025001a) (.leaf8 + 0x2600000000250016 0x240014 0x280010 0x10021 0xb480000000022001a 0x210016 0x21000000000d0016 + 0x19c43000000001f001a)) (.bin (.leaf8 0x20000000001f0016 0x20014 + 0x300000000040000000000000000000200000000220000000000001f 0x220009 0x10021 0x386c000000001c001a + 0x1b0016 0x80d580000000019001a) (.leaf8 0x1a00000000190016 0x1800000000030016 + 0x11a1d0000000016001a 0x1700000000160016 0x14 0x190010 0x10021 0x1500000000000016))) (.bin (.bin + (.leaf8 0x2842bb0000000013001a 0x1200000000120016 0x582970000000010001a 0x5000000000f0016 0xf0014 + 0x70010 0x10021 0xc94da7000000000d001a) (.leaf8 0xe000000000d0016 0x30014 0x100010 0x10021 + 0xc00000000090016 0x1b8cf9000000000a001a 0xb000000000a0016 0x3ee844e0000000007001a)) (.bin (.leaf8 + 0x60016 0x500000000010016 0x89c0e60000000004001a 0x400000000040016 0x13a8957e0000000001001a 0x16 + 0x14 0x2000e) (.leaf8 0x10022 0x2000000000200000000010002b0c4e7000000000000000000000020 (h240 + 0x100000000000000 0x1000000000500000000000010f7d095000000000000000000010020) + 0x6000000000000000000060000000002001f 0x50023 0x5000d + 0x70000000000000089c0e5000000000100000000010020 0x8000000000000000000070000000000001f))))))) (.bin + (.bin (.bin (.bin (.bin (.bin (.leaf8 0x60023 0x6000d 0x9000000000000000000020000000003001f + 0x100000000030023 0xb00000000000003ee844d000000000200000000000020 + 0xd0000000000000000000d0000000006001f 0xc0023 0xc000d) (.leaf8 + 0xe000000000000001b8cf8000000000300000000010020 0xf0000000000000000000e0000000005001f (h240 + 0x1000000000f00000000010000 0x10000000005000000000100000000100000000004001c) 0x10000f + 0x110000000000000000001000000000060000000001001e 0xf0023 0xf000d + 0x1200000000000000c94da6000000000400000000010020)) (.bin (.leaf8 0x11000e + 0x130000000000000000000700000000080000000000001e 0x100000000080023 + 0x1500000000000000058296000000000500000000000020 0x1700000000000000000014000000000b001f + 0x100000000150023 0x18000000000000002842ba000000000600000000000020 0x17000e) (.leaf8 (h240 0x10000 + 0x10000000002000000000100000000190000000003001c) 0x19000f + 0x1c00000000000000000019000000000c0000000001001e 0x180023 0x18000d + 0x1d00000000000000011a1c000000000700000000010020 0x1e0000000000000000001a0000000001001f (h240 + 0x10000 0x1b000000000100000000000000000001000000001b0000000003001c)))) (.bin (.bin (.leaf8 + 0x1b000f 0x1f0000000000000000001b000000000f0000000001001e 0x1a0023 0x1a000d + 0x2000000000000000080d57000000000800000000010020 0x21000000000000000000020000000011001f + 0x100000000030023 0x230000000000000000386b000000000900000000000020) (.leaf8 0x5000e + 0x10000000005000000000100000000220000000002001c 0x22000f + 0x270000000000000000002200000000110000000001001e 0x210023 0x21000d + 0x2800000000000000019c42000000000a00000000010020 0x29000000000000000000230000000008001f)) (.bin + (.leaf8 0x220023 0x22000d 0x29000000000000000000020000000015001f 0x100000000030023 + 0x2b00000000000000000b47000000000b00000000000020 0x26000e + 0x2d0000000000000000002800000000170000000000001e 0x270023) (.leaf8 0x27000d + 0x2e00000000000000005272000000000c00000000010020 0x2f0000000000000000002a000000001a001f 0x290023 + 0x29000d 0x3000000000000000000240000000000d00000000010020 0x310000000000000000002e000000001c001f + 0x2d0023)))) (.bin (.bin (.bin (.leaf8 0x2d000d 0x320000000000000000107c000000000e00000000010020 + 0x5000e 0x3400000000000000000031000000001d0000000000001e 0x300023 0x30000d + 0x3500000000000000000071000000000f00000000010020 0x36000000000000000000320000000000001f) (.leaf8 + 0x310023 0x31000d 0x3600000000000000000002000000001f001f 0x100000000030023 + 0x380000000000000000034a000000001000000000000020 0x3a000000000000000000350000000000001f 0x340023 + 0x34000d)) (.bin (.leaf8 0x3a000000000000000000020000000021001f 0x100000000030023 + 0x3c00000000000000000015000000001100000000000020 0x3e000000000000000000380000000022001f + 0x100000000380023 0x40000000000000000000a7000000001200000000000020 + 0x420000000000000000003b0000000000001f 0x3a0023) (.leaf8 0x3a000d + 0x42000000000000000000020000000024001f 0x100000000020023 + 0x4400000000000000000003000000001300000000000020 0x460000000000000000003d0000000000001f 0x3c0023 + 0x3c000d 0x47000000000000000000020000000027001f))) (.bin (.bin (.leaf8 0x100000000030023 + 0x4900000000000000000020000000001400000000000020 0x5000e + 0x4c0000000000000000004200000000290000000000001e 0x410023 0x41000d 0x5000e + 0x4e00000000000000000045000000002b0000000000001e) (.leaf8 0x440023 0x44000d + 0x4f00000000000000000005000000001600000000010020 0x5000e (h240 0x1000000000400000000010000 + 0x300000000010000000000000000000100000000010000000004001c) 0x1000f + 0x5400000000000000000001000000002c0000000001001e (h240 0x1000000000200000000010000 + 0x1000000004b000000000100000000020000000004001c))) (.bin (.leaf8 0x2000f 0x570000000000001d + 0x4b0000000001000b 0x20014 0x4c000e 0x20186 0x10043 0x4d0142) (.leaf8 0x101c3 0x4e0023 0xa000c6 + 0x10043 0x10303 0x10009 0x40008 0x10009))))) (.bin (.bin (.bin (.bin (.leaf8 0x10021 0x10019 + 0x530000000000001d 0x3000f 0x520000000000001d 0x20023 0x2000d 0x5000e) (.leaf8 + 0x530000000000000000000100000000320000000000001e 0x60000000000000b 0x10000000002001a + 0x4800000000040016 0x20000000046001a 0x4600000000460016 0x4300000000040016 0x4200000000040016)) + (.bin (.leaf8 0xf0000000040001a 0x4100000000400016 0x30014 0x430010 0x10021 0x3f000000003c0016 + 0x1000000003d001a 0x3c0016) (.leaf8 0x20014 0x20010 0x10021 0x54000000003a001a 0x390016 0x380014 + 0x20010 0x10021))) (.bin (.bin (.leaf8 0xa0000000037001a 0x3800000000370016 0x30014 0x3a0010 + 0x10021 0x1a50000000034001a 0x3500000000340016 0x30014) (.leaf8 0x370010 0x10021 + 0x390000000031001a 0x3200000000310016 0x3000000000040016 0x83e000000002e001a 0x2d000000002d0016 + 0x120000000002b001a)) (.bin (.leaf8 0x2a00000000290016 0x29390000000028001a 0x2700000000270016 + 0x5a30000000025001a 0x2600000000250016 0x30014 0x280010 0x10021) (.leaf8 0xce220000000022001a + 0x500000000210016 0x2100000000040016 0x1c35000000001f001a 0x1e0016 0x1e00000000010016 + 0x406ab000000001c001a 0x1c000000001c0016)))) (.bin (.bin (.bin (.leaf8 0x1b0014 0x1e0010 0x10021 + 0x8d0e0000000019001a 0x1a00000000190016 0x16 0x14215d0000000016001a 0x1700000000160016) (.leaf8 + 0x150014 0x190010 0x10021 0x2c14b0000000013001a 0x120016 0x1200000000060016 0x64a6d30000000010001a + 0x1100000000100016)) (.bin (.leaf8 0x30016 0xdc67d000000000d001a 0xc000000000c0016 + 0x1f74226000000000a001a 0x90016 0x800000000010016 0x44e0730000000007001a 0x600000000050016) + (.leaf8 0x9d44abe0000000004001a 0x30016 0x15862740000000001001a 0x200000000010016 0x14 + 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d))) (.bin (.bin (.leaf8 + 0x2000000000200000000010001586273000000000000000000010020 + 0x20000000003000000000100000000020000000001001f 0x100000000030023 + 0x2000000000500000000010009d44abd000000000100000000000020 + 0x20000000007000000000100000000080000000002001f 0x100000000080023 + 0x200000000090000000001000044e072000000000200000000000020 + 0x2000000000b0000000001000000000a0000000000001f) (.leaf8 0x90023 0x9000d + 0x2000000000c000000000100000000020000000005001f 0x100000000030023 + 0x2000000000e00000000010001f74225000000000300000000000020 + 0x200000000100000000001000000000e0000000007001f 0x1000000000f0023 + 0x20000000011000000000100000dc67c000000000400000000000020)) (.bin (.leaf8 + 0x20000000013000000000100000000020000000001001f (h240 0x10000 + 0x300000000010000000000000000000100000000120000000003001c) 0x12000f + 0x200000000150000000001000000001200000000090000000001001e 0x110023 0x11000d + 0x20000000016000000000100003f5db7000000000500000000010020 + 0x20000000017000000000100000000140000000000001f) (.leaf8 0x140009 0x180021 0x17 0x1d 0x103c3 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x312575680000 + 0x3000000000100000000050001586274000000000600000000010000) + 0x300000000010000000000000000000100000000080009d44abd0000) + 0x9000000000100000000080000000002000000000000000000010000) + 0xb000044e072000000000c0000000001000000000b00000000010000) + 0x3000000000100000000000000000001000000000e0001f742260000) + 0xf000000000100000000000000000001000000001100000dc67c0000) + 0x12000000000100000000030000000001000000000000000000010000) + 0x1300003f5db80000000015000000000100000000140000000018001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 + 0x200000000170000000000000000001400000000070000000001001e))))))) (.bin (.bin (.bin (.bin (.bin + (.leaf8 0x130023 0x13000d 0x1900000000000000254919000000000500000000010020 + 0x19000000000000000000140000000003001f (h240 0x10000 + 0x1500000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1a00000000000000000001000000000a0000000001001e 0x100000000020023) (.leaf8 + 0x1c0000000000000002c14a000000000600000000000020 0x17000e + 0x1e00000000000000000019000000000d0000000000001e 0x180023 0x18000d + 0x1f0000000000000014215c000000000700000000010020 0x2000e + 0x100000000000000000001000000001b0000000002001c)) (.bin (.leaf8 0x1b000f + 0x220000000000000000001b000000000f0000000001001e 0x1a0023 0x1a000d + 0x2300000000000000008d0d000000000800000000010020 0x1d000e + 0x240000000000000000001e00000000110000000000001e 0x1d0023) (.leaf8 0x1d000d + 0x25000000000000000406aa000000000900000000010020 0x26000000000000000000200000000000001f 0x1f0023 + 0x1f000d 0x26000000000000000000020000000013001f 0x100000000030023 + 0x2800000000000000001c34000000000a00000000000020))) (.bin (.bin (.leaf8 + 0x2a000000000000000000230000000002001f 0x220023 0x22000d 0x2a000000000000000000070000000015001f + 0x100000000080023 0x2c0000000000000000ce21000000000b00000000000020 0x5000e + 0x2f0000000000000000002800000000170000000000001e) (.leaf8 0x270023 0x27000d + 0x30000000000000000005a2000000000c00000000010020 0x31000000000000000000290000000019001f + 0x1000000002a0023 0x3200000000000000002938000000000d00000000000020 + 0x340000000000000000002c000000001a001f 0x1000000002c0023)) (.bin (.leaf8 + 0x360000000000000000011f000000000e00000000000020 0x380000000000000000002f000000001d001f + 0x100000000300023 0x390000000000000000083d000000000f00000000000020 + 0x3b000000000000000000320000000002001f 0x310023 0x31000d 0x3b000000000000000000340000000020001f) + (.leaf8 0x330023 0x33000d 0x3c00000000000000000038000000001000000000010020 0x5000e + 0x3e0000000000000000003700000000210000000000001e 0x360023 0x36000d + 0x3f000000000000000001a4000000001100000000010020)))) (.bin (.bin (.bin (.leaf8 0x5000e + 0x410000000000000000003a00000000230000000000001e 0x390023 0x39000d + 0x4200000000000000000009000000001200000000010020 0x3a000e + 0x440000000000000000000200000000240000000000001e 0x100000000030023) (.leaf8 + 0x4600000000000000000053000000001300000000000020 0x4000e + 0x490000000000000000000200000000260000000000001e 0x100000000030023 + 0x4b00000000000000000000000000001400000000000020 0x4c000000000000000000410000000027001f (h240 + 0x1000000004200000000010000 0x10000000005000000000100000000430000000004001c) 0x43000f)) (.bin + (.leaf8 0x4f0000000000000000004300000000280000000001001e 0x420023 0x42000d + 0x500000000000000000000e000000001500000000010020 0x51000000000000000000440000000002001f 0x430023 + 0x43000d 0x51000000000000000000450000000002001f) (.leaf8 0x440023 0x44000d + 0x5200000000000000000048000000002e001f 0x470023 0x47000d + 0x5300000000000000000001000000001700000000010020 0x540000000000000000004a0000000002001f + 0x490023))) (.bin (.bin (.leaf8 0x49000d 0x54000000000000000000060000000000001f (h240 0x10000 + 0x600000000020000000000000000000100000000060000000003001c) 0x1000c6 0x10043 0x10303 0x10009 + 0x60014) (.leaf8 0x20010 0x10021 0x10000000049001a 0x4900000000490016 0x4500000000440016 + 0x70000000043001a 0x4400000000430016 0x30016)) (.bin (.leaf8 0x4100000000400016 0x30014 0x430010 + 0x10021 0x3f00000000030016 0x29000000003d001a 0x3c0016 0x3b00000000010016) (.leaf8 + 0x5000000003a001a 0x600000000390016 0xd20000000037001a 0x3800000000370016 0x3600000000040016 + 0x1c0000000034001a 0x3300000000330016 0x41e0000000031001a))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x3200000000310016 0x300014 0x340010 0x10021 0x8f000000002e001a 0x2f000000002e0016 0x14 0x310010) + (.leaf8 0x10021 0x2d000000002a0016 0x149b000000002b001a 0x2c000000002b0016 0x2a0014 0x2e0010 + 0x10021 0x2d10000000028001a)) (.bin (.leaf8 0x2900000000280016 0x2700000000040016 + 0x67100000000025001a 0x240016 0x2400000000060016 0xe1a0000000022001a 0x210016 0x2100000000010016) + (.leaf8 0x20355000000001f001a 0x1f000000001f0016 0x4687000000001c001a 0x1c000000001c0016 0x30014 + 0x1e0010 0x10021 0xa10ae0000000019001a))) (.bin (.bin (.leaf8 0x1a00000000190016 + 0x160a50000000016001a 0x1700000000160016 0x20014 + 0x1500000000040000000000000000000200000000190000000000001f 0x190009 0x20021 + 0x3253690000000013001a) (.leaf8 0x1300000000130016 0x30014 0x150010 0x10021 0x6e33e0000000010001a + 0xf0016 0xfba113000000000d001a 0xc0016)) (.bin (.leaf8 0xb00000000010016 0x227039000000000a001a + 0x90016 0x80014 0x20010 0x10021 0x4ea255e0000000007001a 0x800000000070016) (.leaf8 0x30014 0xa0010 + 0x10021 0xac313a0000000004001a 0x300000000030016 0x1892bab30000000001001a 0x100000000010016 + 0x14)))) (.bin (.bin (.bin (.leaf8 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x20000000002000000000100035cf5ca000000000000000000010020 (h240 0x100000000000000 + 0x100000000040000000000001535c4e7000000000000000000010020) 0x5000000000000000000050000000001001f + 0x100000000060023 0x600000000000000ac3139000000000100000000000020) (.leaf8 0x5000e + 0x90000000000000000000a00000000030000000000001e 0x90023 0x9000d + 0xa00000000000004ea255d000000000200000000010020 0xa000e + 0xc0000000000000000000200000000040000000000001e 0x100000000030023)) (.bin (.leaf8 + 0xe00000000000000227038000000000300000000000020 0x100000000000000000000d0000000000001f 0xc0023 + 0xc000d 0x11000000000000000000020000000007001f 0x100000000030023 + 0x1300000000000000fba112000000000400000000000020 0x15000000000000000000020000000009001f) (.leaf8 + 0x100000000030023 0x170000000000000006e33d000000000500000000000020 0x5000e + 0x1a00000000000000000015000000000b0000000000001e 0x140023 0x14000d + 0x1b00000000000000325368000000000600000000010020 0x17000e))) (.bin (.bin (.leaf8 + 0x10000000005000000000100000000190000000002001c 0x19000f + 0x1d00000000000000000019000000000b0000000001001e 0x180023 0x18000d + 0x1e000000000000000160a4000000000700000000010020 0x1f0000000000000000001c0000000010001f 0x1b0023) + (.leaf8 0x1b000d 0x20000000000000000a10ad000000000800000000010020 0x5000e + 0x220000000000000000001e00000000110000000000001e 0x1d0023 0x1d000d + 0x2300000000000000004686000000000900000000010020 0x24000000000000000000210000000014001f)) (.bin + (.leaf8 0x200023 0x20000d 0x2500000000000000020354000000000a00000000010020 + 0x26000000000000000000230000000000001f 0x220023 0x22000d 0x26000000000000000000020000000015001f + 0x100000000030023) (.leaf8 0x2800000000000000000e19000000000b00000000000020 + 0x2a000000000000000000260000000003001f (h240 0x10000 + 0x2700000000010000000000000000000100000000010000000003001c) 0x1000f + 0x2b0000000000000000000100000000160000000001001e 0x100000000020023 + 0x2d0000000000000000670f000000000c00000000000020 0x2f000000000000000000290000000002001f))))))))) + (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x280023 0x28000d + 0x2f0000000000000000002b000000001a001f 0x2a0023 0x2a000d + 0x30000000000000000002d0000000000d00000000010020 0x2c000e + 0x310000000000000000002e000000001b0000000000001e) (.leaf8 0x2d0023 0x2d000d + 0x320000000000000000149a000000000e00000000010020 0x330000000000000000002f000000001b001f (h240 + 0x1000000003000000000010000 0x10000000002000000000100000000310000000004001c) 0x31000f + 0x3500000000000000000031000000001c0000000001001e 0x300023)) (.bin (.leaf8 0x30000d + 0x360000000000000000008e000000000f00000000010020 0x32000e + 0x3700000000000000000034000000001f0000000000001e 0x330023 0x33000d + 0x380000000000000000041d000000001000000000010020 0x39000000000000000000350000000021001f) (.leaf8 + 0x100000000360023 0x3a0000000000000000001b000000001100000000000020 + 0x3c000000000000000000380000000002001f 0x370023 0x37000d 0x3c0000000000000000003a0000000024001f + 0x390023 0x39000d))) (.bin (.bin (.leaf8 0x3d000000000000000000d1000000001200000000010020 + 0x3e000000000000000000080000000025001f 0x100000000090023 + 0x4000000000000000000004000000001300000000000020 0x420000000000000000003d0000000000001f 0x3c0023 + 0x3c000d 0x43000000000000000000020000000027001f) (.leaf8 0x100000000030023 + 0x4500000000000000000028000000001400000000000020 0x47000000000000000000410000000001001f (h240 + 0x1000000004200000000010000 0x10000000005000000000100000000430000000004001c) 0x43000f + 0x490000000000000000004300000000280000000001001e 0x420023 0x42000d)) (.bin (.leaf8 + 0x4a000000000000000000020000000001001f (h240 0x10000 + 0x300000000010000000000000000000100000000450000000003001c) 0x45000f + 0x4c00000000000000000045000000002b0000000001001e 0x440023 0x44000d + 0x4d00000000000000000006000000001600000000010020 0x4e00000000000000000047000000002c001f) (.leaf8 + (h240 0x10000 0x47000000000200000000000000000001000000004a0000000003001c) 0x4a000f + 0x500000000000000000004a000000002f0000000001001e 0x490023 0x49000d + 0x5100000000000000000000000000001800000000010020 0x8000e + 0x530000000000000000000200000000020000000000001e)))) (.bin (.bin (.bin (.leaf8 0x90000000001000b + 0x4b000000004c0016 0x14 0x4d0010 0x10021 0x4800000000450016 0x30000000046001a 0x440016) (.leaf8 + 0x4400000000010016 0x30016 0x140000000040001a 0x4100000000400016 0x30014 0x430010 0x10021 + 0x3f000000003c0016)) (.bin (.leaf8 0x1000000003d001a 0x3e000000003d0016 0x90014 0x400010 0x10021 + 0x69000000003a001a 0x3900000000390016 0xd0000000037001a) (.leaf8 0x3800000000370016 0x360014 + 0x3a0010 0x10021 0x20f0000000034001a 0x3300000000330016 0x470000000031001a 0x3200000000310016))) + (.bin (.bin (.leaf8 0x16 0xa4e000000002e001a 0x2d000000002d0016 0x168000000002b001a + 0x2c000000002b0016 0x33880000000028001a 0x270016 0x16) (.leaf8 0x70d0000000025001a 0x240016 + 0x2400000000010016 0x101aa0000000022001a 0x2200000000220016 0x2343000000001f001a + 0x1f000000001f0016 0x1e00000000040016)) (.bin (.leaf8 0x50856000000001c001a 0x1d000000001c0016 + 0xb0520000000019001a 0x1a00000000190016 0x1800000000030016 0x1929b40000000016001a + 0x1600000000160016 0x1500000000040016) (.leaf8 0x3719e0000000013001a 0x120016 0x1200000000010016 + 0x7dd0880000000010001a 0x1100000000100016 0x30014 0x130010 0x10021))))) (.bin (.bin (.bin (.bin + (.leaf8 0xf000000000c0016 0x11381b000000000d001a 0xe000000000d0016 0x30014 0x100010 0x10021 + 0xc00000000090016 0x27512ae000000000a001a) (.leaf8 0xb000000000a0016 0x900000000040016 + 0x56189c0000000007001a 0x60016 0xc495d5a0000000004001a 0x300000000020016 0x1ae7ae50000000001001a + 0x200000000010016)) (.bin (.leaf8 0x14 0x20000000000000000000100000000040000000000001f 0x30023 + 0x3000d 0x2000000000200000000010001ae7ae4000000000000000000010020 + 0x20000000003000000000100000000050000000000001f 0x100000000050023 + 0x200000000050000000001000c495d59000000000100000000000020) (.leaf8 + 0x20000000007000000000100000000020000000003001f 0x100000000030023 + 0x200000000090000000001000056189b000000000200000000000020 + 0x2000000000b0000000001000000000b0000000002001f 0xa0023 0xa000d + 0x2000000000b0000000001000000000d0000000006001f 0xc0023))) (.bin (.bin (.leaf8 0xc000d + 0x2000000000c000000000100027512ad000000000300000000010020 + 0x2000000000d0000000001000000000e0000000005001f (h240 0x1000000000f00000000010000 + 0x10000000005000000000100000000100000000004001c) 0x10000f + 0x2000000000f0000000001000000001000000000060000000001001e 0xf0023 0xf000d) (.leaf8 + 0x200000000100000000001000011381a000000000400000000010020 + 0x20000000011000000000100000000110000000007001f (h240 0x1000000001200000000010000 + 0x10000000005000000000100000000130000000004001c) 0x13000f + 0x200000000130000000001000000001300000000080000000001001e 0x120023 0x12000d + 0x20000000014000000000100004f3530000000000500000000010020)) (.bin (.leaf8 + 0x20000000015000000000100000000140000000003001f 0x140009 0x160021 0x17 0x1d 0x103c3 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 0x3d6ed304000000000300000000010000 + 0x50001ae7ae500000000060000000001000000000500000000020000) + 0x10000000008000c495d59000000000900000000010000) + 0x3000000000100000000000000000001000000000b000056189c0000) + 0xc0000000001000000000e00027512af000000000f00000000010000) + 0x1000000000500000000010000000011000011381c0000) + 0x12000000000100000000000000000001000000000500000000010000) + 0x1400004f35310000000015000000000100000000140000000016001c) 0x14000f) (.leaf8 (h240 + 0x20000000000000000000100000000010000 0x200000000150000000000000000001400000000040000000001001e) + 0x130023 0x13000d 0x17000000000000002e9b55000000000500000000010020 + 0x17000000000000000000140000000000001f 0x130023 0x13000d + 0x1700000000000000000002000000000b001f)))) (.bin (.bin (.bin (.leaf8 0x100000000030023 + 0x190000000000000003719d000000000600000000000020 0x1b000000000000000000170000000002001f 0x160023 + 0x16000d 0x1b00000000000000000018000000000e001f 0x170023 0x17000d) (.leaf8 + 0x1c000000000000001929b3000000000700000000010020 0x1d0000000000000000001a0000000001001f (h240 + 0x10000 0x1b000000000100000000000000000001000000001b0000000003001c) 0x1b000f + 0x1e0000000000000000001b000000000f0000000001001e 0x1a0023 0x1a000d + 0x1f0000000000000000b051000000000800000000010020)) (.bin (.leaf8 + 0x200000000000000000001f0000000012001f 0x1e0023 0x1e000d + 0x2100000000000000050855000000000900000000010020 0x22000000000000000000200000000002001f 0x1f0023 + 0x1f000d 0x22000000000000000000210000000014001f) (.leaf8 0x200023 0x20000d + 0x2300000000000000002342000000000a00000000010020 0x24000000000000000000240000000016001f 0x230023 + 0x23000d 0x25000000000000000101a9000000000b00000000010020 + 0x26000000000000000000260000000000001f))) (.bin (.bin (.leaf8 0x250023 0x25000d + 0x26000000000000000000020000000017001f 0x100000000030023 + 0x280000000000000000070c000000000c00000000000020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f) (.leaf8 + 0x2c0000000000000000000100000000180000000001001e 0x100000000020023 + 0x2e00000000000000003387000000000d00000000000020 0x300000000000000000002e000000001c001f 0x2d0023 + 0x2d000d 0x3100000000000000000167000000000e00000000010020 0x320000000000000000002f000000001d001f)) + (.bin (.leaf8 0x100000000300023 0x3300000000000000000a4d000000000f00000000000020 0x2000e + 0x10000000000000000000100000000330000000002001c 0x33000f + 0x3700000000000000000033000000001f0000000001001e 0x320023 0x32000d) (.leaf8 + 0x3800000000000000000046000000001000000000010020 0x39000000000000000000350000000021001f + 0x100000000360023 0x3a0000000000000000020e000000001100000000000020 0x38000e + 0x3c0000000000000000003a00000000230000000000001e 0x390023 0x39000d)))))) (.bin (.bin (.bin (.bin + (.bin (.leaf8 0x3d0000000000000000000c000000001200000000010020 + 0x3e0000000000000000003b0000000025001f 0x1000000003c0023 + 0x3f00000000000000000068000000001300000000000020 0xb000e + 0x420000000000000000004000000000270000000000001e 0x3f0023 0x3f000d) (.leaf8 + 0x4300000000000000000000000000001400000000010020 0x44000000000000000000410000000027001f (h240 + 0x1000000004200000000010000 0x10000000005000000000100000000430000000004001c) 0x43000f + 0x460000000000000000004300000000280000000001001e 0x420023 0x42000d + 0x4700000000000000000013000000001500000000010020)) (.bin (.leaf8 + 0x48000000000000000000020000000001001f (h240 0x10000 + 0x300000000010000000000000000000100000000450000000003001c) 0x45000f 0x4a0000000000001d 0x440023 + 0x44000d 0x4b00000000000000000002000000002c001f 0x100000000020023) (.leaf8 + 0x4d00000000000000000002000000001700000000000020 0x4f0000000000000000004a000000002d001f (h240 + 0x1000000004b00000000010000 0x100000000020000000001000000004d0000000004001c) 0x4d000f + 0x510000000000000000004d00000000300000000001001e 0x4c0023 0x4c000d 0xa000e))) (.bin (.bin (.leaf8 + 0x20186 0x10043 0xb0142 0x101c3 0xc0023 0x1c00c6 0x10043 0x10303) (.leaf8 0x10009 0x4e0008 0x10009 + 0x10021 0x16 0x10000000049001a 0x4a00000000490016 0x14)) (.bin (.leaf8 0x4c0010 0x10021 + 0x4600000000000016 0x30014 0x48000e (h240 0x10000 0x100000000020000000001000000004c0000000003001c) + 0x4c000f 0x40021) (.leaf8 0xa0000000043001a 0x500000000420016 0x420014 0x70010 0x10021 + 0x4100000000400016 0x3f000000000a0016 0x33000000003d001a)))) (.bin (.bin (.bin (.leaf8 + 0x3e000000003d0016 0x3c0014 0x400010 0x10021 0x6000000003a001a 0x3b000000003a0016 + 0x1070000000037001a 0x3800000000370016) (.leaf8 0x360014 0x3a0010 0x10021 0x230000000034001a + 0x3400000000340016 0x30014 0x360010 0x10021)) (.bin (.leaf8 0x5260000000031001a 0x3200000000310016 + 0x300014 0x340010 0x10021 0xb4000000002e001a 0x2d000000002d0016 0x19c3000000002b001a) (.leaf8 + 0x2a0016 0x16 0x2a00000000010016 0x3850000000028001a 0x2900000000280016 0x30014 0x2b0010 + 0x10021))) (.bin (.bin (.leaf8 0x80d50000000025001a 0x2500000000250016 0x11a10000000022001a + 0x2200000000220016 0x2842b000000001f001a 0x20000000001f0016 0x5829000000001c001a 0x1a0016) (.leaf8 + 0xc94da0000000019001a 0x1900000000190016 0x1b8cf0000000016001a 0x150016 0x1500000000010016 + 0x3ee8440000000013001a 0x500000000120016 0x120014)) (.bin (.leaf8 0x70010 0x10021 + 0x89c0d0000000010001a 0x1100000000100016 0x30016 0x13a8957000000000d001a 0xe000000000d0016 + 0x2b0c4e000000000a001a) (.leaf8 0x90016 0x900000000010016 0x624aeac0000000007001a 0x60016 0x50014 + 0x20010 0x10021 0xd73d720000000004001a))))) (.bin (.bin (.bin (.bin (.leaf8 0x500000000040016 + 0x1eb769820000000001001a 0x3001d 0x1000000000100000000010004343358000000000000000000000020 0x50010 + 0x60021 0x17 0x1d) (.leaf8 0x103c3 (h240 (h240 0x43433590000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x500043433580000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x200000000050000000000001a833627000000000000000000010020) + 0x7000000000000000000070000000002001f 0x60023 0x6000d + 0x800000000000000d73d71000000000100000000010020)) (.bin (.leaf8 0x7000e + 0xa0000000000000000000200000000020000000000001e 0x100000000030023 + 0xc0000000000000624aeab000000000200000000000020 0xe0000000000000000000b0000000000001f 0xa0023 + 0xa000d 0xe000000000000000000020000000005001f) (.leaf8 0x100000000030023 + 0x10000000000000002b0c4d000000000300000000000020 0x12000000000000000000100000000008001f 0xf0023 + 0xf000d 0x13000000000000013a8956000000000400000000010020 0x14000000000000000000020000000001001f + (h240 0x10000 0x300000000010000000000000000000100000000120000000003001c)))) (.bin (.bin (.leaf8 + 0x12000f 0x160000000000000000001200000000090000000001001e 0x110023 0x11000d + 0x1700000000000000089c0c000000000500000000010020 0x14000e + 0x1800000000000000000007000000000a0000000000001e 0x100000000080023) (.leaf8 + 0x1a000000000000003ee843000000000600000000000020 0x1c000000000000000000170000000000001f 0x160023 + 0x16000d 0x1c00000000000000000002000000000d001f 0x100000000030023 + 0x1e0000000000000001b8ce000000000700000000000020 0x200000000000000000001b0000000010001f)) (.bin + (.leaf8 0x1a0023 0x1a000d 0x21000000000000000c94d9000000000800000000010020 + 0x22000000000000000000020000000010001f 0x100000000020023 + 0x2400000000000000005828000000000900000000000020 0x26000000000000000000220000000014001f 0x210023) + (.leaf8 0x21000d 0x270000000000000002842a000000000a00000000010020 + 0x28000000000000000000240000000016001f 0x230023 0x23000d + 0x29000000000000000011a0000000000b00000000010020 0x2a000000000000000000270000000018001f + 0x260023)))) (.bin (.bin (.bin (.leaf8 0x26000d 0x2b000000000000000080d4000000000c00000000010020 + 0x5000e 0x2d0000000000000000002b00000000190000000000001e 0x2a0023 0x2a000d + 0x2e00000000000000000384000000000d00000000010020 0x2f0000000000000000002c0000000000001f) (.leaf8 + 0x2b0023 0x2b000d 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x3100000000000000000001000000001a0000000001001e 0x100000000020023 + 0x33000000000000000019c2000000000e00000000000020)) (.bin (.leaf8 + 0x350000000000000000002f000000001d001f 0x100000000300023 + 0x36000000000000000000b3000000000f00000000000020 0x32000e + 0x3800000000000000000034000000001f0000000000001e 0x330023 0x33000d + 0x3900000000000000000525000000001000000000010020) (.leaf8 0x5000e + 0x3b0000000000000000003600000000210000000000001e 0x350023 0x35000d + 0x3c00000000000000000022000000001100000000010020 0x38000e + 0x3d0000000000000000003a00000000230000000000001e 0x390023))) (.bin (.bin (.leaf8 0x39000d + 0x3e00000000000000000106000000001200000000010020 0x3f0000000000000000003d0000000026001f 0x3c0023 + 0x3c000d 0x4000000000000000000005000000001300000000010020 0x3e000e + 0x410000000000000000004000000000270000000000001e) (.leaf8 0x3f0023 0x3f000d + 0x4200000000000000000032000000001400000000010020 0x43000000000000000000410000000006001f 0x400023 + 0x40000d 0x4300000000000000000043000000002a001f 0x420023)) (.bin (.leaf8 0x42000d 0x44000e + 0x4500000000000000000007000000002a0000000000001e 0x100000000080023 + 0x4700000000000000000009000000001600000000000020 0x5000e (h240 0x1000000004900000000010000 + 0x100000000020000000001000000004c0000000004001c) 0x4c000f) (.leaf8 + 0x4d0000000000000000004c000000002d0000000001001e 0x4b0023 0x4b000d + 0x4e00000000000000000000000000001800000000010020 0x2000e (h240 0x10000 + 0x1000000004f000000000100000000010000000003001c) 0x1000f + 0x520000000000000000000100000000050000000001001e))))))) (.bin (.bin (.bin (.bin (.bin (.bin + (.leaf8 0x4f0000000000000b 0x30014 0x4f000e 0xa400c6 0x10043 0x50142 0x101c3 0x60009) (.leaf8 + 0x4e00000000010019 0x4e0000000000001d 0x4c0023 0x300000000000000000001009c 0x60003 0x6000f (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x99 + 0x950ecc000000000000000000010000000001000434335900000000030000) + 0x100000000020000000002000000000000000000010000000005001e) + 0xb769810000000006000000000100000000080000d73d7200000000090000) + 0x1000000000800000000010000000003000000000100000000000000) + 0x1000000000b000624aeac000000000c000000000100000000030000) + 0x100000000000000000001000000000e00002b0c4d000000000f0000) + 0x1000000001100013a89570000000012000000000100000000030000) + 0x10000000000000000000100000000130000089c0e00000000150000) + 0x1000000000800000000010000000000000000000100000000170000) + 0x3ee844000000001800000000010000000003000000000100000000000000) + 0x1000000001a000001b8ce000000001b0000000001000000001c0000) + 0xc94da000000001e00000000010000000002000000000200000000000000) + 0x1000000002000000058280000000021000000000100000000230000) + 0x2842b00000000240000000001000000002500000011a100000000270000) + 0x1000000002800000080d5000000002a000000000100000000060000) + 0x1000000002c0000000386000000002d000000000100000000030000) + 0x1000000000000000000010000000002000000000100000000000000) + 0x1000000002f00000019c30000000030000000000100000000000000) + 0x1000000003200000000b40000000033000000000100000000350000) + 0x526000000003600000000010000000006000000000100000000370000) + 0x2400000000390000000001000000003b0000000107000000003c0000) + 0x1000000003e0000000007000000003f000000000100000000410000) + 0x34000000004200000000010000000044000000000100000000450000) + 0x1000000000800000000010000000000000000000100000000470000) + 0x9000000004800000000010000000006000000000100000000490000) + 0x10000000000000000000100000000020000000002000000004d0000) + 0x4e00000000010000000000000000000600000000330000000001001e) 0x6000b)) (.bin (.leaf8 0x4d0014 + 0x20010 0x10021 0x2000000004b0016 0x490014 0x40010 0x10021 0x4800000000040016) (.leaf8 + 0x40000000046001a 0x450016 0x4500000000060016 0x4200000000420016 0x190000000040001a + 0x4100000000400016 0x3000000003d001a 0x3e000000003d0016))) (.bin (.bin (.leaf8 0x83000000003a001a + 0x3b000000003a0016 0x120000000037001a 0x600000000350016 0x2930000000034001a 0x3300000000330016 + 0x590000000031001a 0x3200000000310016) (.leaf8 0x300014 0x340010 0x10021 0xce1000000002e001a + 0x2d0016 0x16 0x2d00000000010016 0x1c2000000002b001a)) (.bin (.leaf8 0x2c000000002b0016 + 0x2a00000000040016 0x406a0000000028001a 0x2700000000260016 0x8d00000000025001a 0x2400000000230016 + 0x142150000000022001a 0x2100000000210016) (.leaf8 0x2c13000000001f001a 0x20000000001f0016 0x14 + 0x220010 0x10021 0x1e00000000000016 0x64a6c000000001c001a 0x1c000000001c0016)))) (.bin (.bin (.bin + (.leaf8 0xdc670000000019001a 0x180016 0x1800000000010016 0x1f74210000000016001a 0x1700000000160016 + 0x80014 0x190010 0x10021) (.leaf8 0x44e070000000013001a 0x110016 0x1200000000010016 + 0x9d44ab0000000010001a 0xf000000000f0016 0x158626000000000d001a 0xc0016 0xc00000000010016)) (.bin + (.leaf8 0x3125755000000000a001a 0xb000000000a0016 0x30014 0xd0010 0x10021 0x900000000060016 + 0x6b9eb80000000007001a 0x800000000070016) (.leaf8 0xf5bb4c00000000004001a 0x500000000040016 0x14 + 0x70010 0x10021 0x300000000000016 0x21a19ac0000000001001a 0x3001d))) (.bin (.bin (.leaf8 + 0x10000000001000000000100021a19ab000000000000000000000020 0x5000e (h240 0x10000 + 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x200000000070000000001000000000700000000000000000001001e 0x60023 0x6000d + 0x200000000080000000001000f5bb4bf000000000100000000010020) (.leaf8 + 0x200000000090000000001000000000a0000000004001f 0x90023 0x9000d + 0x2000000000a000000000100006b9eb7000000000200000000010020 + 0x2000000000b0000000001000000000b0000000003001f (h240 0x1000000000c00000000010000 + 0x100000000050000000001000000000d0000000004001c) 0xd000f + 0x2000000000d0000000001000000000d00000000040000000001001e)) (.bin (.leaf8 0xc0023 0xc000d + 0x2000000000e00000000010003125754000000000300000000010020 + 0x2000000000f0000000001000000000e0000000000001f 0xd0023 0xd000d + 0x2000000000f000000000100000000020000000007001f 0x100000000030023) (.leaf8 + 0x2000000001100000000010000158625000000000400000000000020 + 0x20000000013000000000100000000110000000009001f 0x100000000120023 + 0x200000000140000000001000063027a000000000500000000000020 0x140010 0x170021 0x17 0x1d))))) (.bin + (.bin (.bin (.bin (.leaf8 0x103c3 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x4cca879a00000000030000000001000000000200000000020000 + 0x1000000000500021a19ac000000000600000000010000) 0x1000000000200000000010000000008000f5bb4c00000) + 0x90000000001000000000b00006b9eb9000000000c00000000010000) + 0x100000000050000000001000000000e00031257560000) + 0xf000000000100000000030000000001000000000000000000010000) + 0x11000015862600000000120000000001000000000000000000010000) + 0x14000063027a0000000015000000000100000000140000000017001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000160000000000000000001400000000080000000001001e) + 0x130023 0x13000d 0x18000000000000003a422e000000000500000000010020 + 0x18000000000000000000140000000000001f) (.leaf8 0x130023 0x13000d + 0x1800000000000000000002000000000a001f 0x100000000020023 + 0x1a00000000000000044e06000000000600000000000020 0xa000e + 0x1d00000000000000000019000000000d0000000000001e 0x180023)) (.bin (.leaf8 0x18000d + 0x1e000000000000001f7420000000000700000000010020 0x1f0000000000000000001a0000000000001f 0x190023 + 0x19000d 0x1f00000000000000000002000000000f001f 0x100000000030023 + 0x210000000000000000dc66000000000800000000000020) (.leaf8 0x230000000000000000001e0000000012001f + 0x1d0023 0x1d000d 0x2400000000000000064a6b000000000900000000010020 0x20000e (h240 0x10000 + 0x10000000002000000000100000000220000000003001c) 0x22000f + 0x270000000000000000002200000000120000000001001e))) (.bin (.bin (.leaf8 0x210023 0x21000d + 0x2800000000000000002c12000000000a00000000010020 0x29000000000000000000230000000015001f + 0x100000000240023 0x2a00000000000000014214000000000b00000000000020 + 0x2c000000000000000000260000000016001f 0x100000000260023) (.leaf8 + 0x2e000000000000000008cf000000000c00000000000020 0x30000000000000000000290000000018001f + 0x100000000290023 0x3200000000000000004069000000000d00000000000020 + 0x340000000000000000002c0000000002001f 0x2b0023 0x2b000d 0x340000000000000000002e000000001c001f)) + (.bin (.leaf8 0x2d0023 0x2d000d 0x35000000000000000001c1000000000e00000000010020 + 0x360000000000000000002f0000000000001f 0x2e0023 0x2e000d 0x2000e + 0x10000000000000000000100000000010000000002001c) (.leaf8 0x1000f + 0x3800000000000000000001000000001c0000000001001e 0x100000000020023 + 0x3a00000000000000000ce0000000000f00000000000020 0x32000e + 0x3c00000000000000000034000000001f0000000000001e 0x330023 0x33000d)))) (.bin (.bin (.bin (.leaf8 + 0x3d00000000000000000058000000001000000000010020 0x3e000000000000000000350000000021001f + 0x100000000360023 0x3f00000000000000000292000000001100000000000020 + 0x41000000000000000000080000000022001f 0x100000000080023 + 0x4300000000000000000011000000001200000000000020 0x450000000000000000003d0000000026001f) (.leaf8 + 0x3c0023 0x3c000d 0x4600000000000000000082000000001300000000010020 + 0x47000000000000000000400000000028001f 0x3f0023 0x3f000d + 0x4800000000000000000002000000001400000000010020 0x4900000000000000000043000000002a001f)) (.bin + (.leaf8 0x420023 0x42000d 0x4a00000000000000000018000000001500000000010020 + 0x4b00000000000000000044000000002b001f (h240 0x10000 + 0x4500000000010000000000000000000100000000460000000003001c) 0x46000f + 0x4c0000000000000000004600000000020000000001001e (h240 0x10000 + 0x4700000000010000000000000000000100000000010000000003001c)) (.leaf8 0x1000f + 0x4e00000000000000000001000000002c0000000001001e 0x100000000020023 + 0x5000000000000000000003000000001700000000000020 0x520000000000000000004a0000000002001f 0x490023 + 0x49000d 0x4b000e))) (.bin (.bin (.leaf8 0x530000000000000000000400000000300000000000001e (h240 + 0x1000000000500000000010000 0x1000000004f000000000100000000020000000004001c) 0x2000f + 0x560000000000000000000200000000010000000001001e 0x4f0000000001000b 0x50014 0x50000e 0x20186) + (.leaf8 0x10043 0x510142 0x101c3 0x520023 0xa800c6 0x10043 0x10303 0x10009)) (.bin (.leaf8 0x70008 + 0x10009 0x10021 0x4c00000000010019 0x520000000000001d 0x4a0023 (h240 0x20000 + 0x10000000008000000000100000000010000000003009c) 0x1000f) (.leaf8 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 0xa82806c00000000000000 + 0x10000000001004cca879a0000000003000000000100000000020000) + 0x200000000000000000001000000000500021a19ac00000000060000) + 0x100000000000000000001000000000200000000010000000008000f) + 0x5bb4c000000000090000000001000000000b00006b9eb9000000000c0000) + 0x10000000000000000000100000000050000000001000000000e0003) + 0x125756000000000f00000000010000000003000000000100000000000000) + 0x1000000001100001586260000000012000000000100000000000000) + 0x1000000001400009d44ab0000000015000000000100000000020000) + 0x20000000000000000000100000000170000044e0600000000180000) + 0x1000000000b0000000001000000001a00001f7422000000001b0000) + 0x10000000003000000000100000000000000000001000000001d0000) + 0xdc66000000001e0000000001000000001f0000064a6d00000000210000) + 0x1000000000000000000010000000002000000000100000000230000) + 0x2c14000000002400000000010000000000000000000100000000260000) + 0x14214000000002700000000010000000026000000000200000000000000) + 0x1000000002900000008cf000000002a000000000100000000290000) + 0x200000000000000000001000000002c000000406a000000002d0000) + 0x1000000002f00000001c30000000030000000000100000000030000) + 0x1000000000000000000010000000002000000000100000000000000) + 0x100000000320000000ce10000000033000000000100000000350000) + 0x5a000000003600000000010000000000000000000100000000380000) + 0x292000000003900000000010000000008000000000200000000000000) + 0x1000000003b0000000011000000003c0000000001000000003e0000) + 0x83000000003f00000000010000000041000000000300000000420000) + 0x10000000044000000001a0000000045000000000100000000000000) + 0x1000000004700000000010000000000000000000100000000020000) + 0x100000000000000000001000000004a0000000005000000004b0000) + 0x5200000000020000000000000000000100000000330000000001001e) 0x1000a 0x80008 + 0x900000000000000000001000000000100000000000000000000001e 0xa0000000001000b 0x13 0x4b0008 (h240 + 0x10000 0x2000000000100000000000000000001000000000b0000000003001c))))))) (.bin (.bin (.bin (.bin + (.bin (.leaf8 0x20186 0x10043 0xb0142 0x101c3 0xc0023 0x1c00c6 0x10043 0x10303) (.leaf8 0x10009 + 0x8 0x10009 0x10021 0x4c00000000000016 0x4b00000000010019 0x520000000000001d 0x490023)) (.bin + (.leaf8 0x300000000000000000001009c 0x4e0003 (h240 0x10000 + 0x10000000001000000000100000000010000000003001c) 0x1000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 0xa8280d800000000000000 + 0x10000000001004cca879a0000000003000000000100000000020000) + 0x200000000000000000001000000000500021a19ac00000000060000) + 0x100000000000000000001000000000200000000010000000008000f) + 0x5bb4c000000000090000000001000000000b00006b9eb9000000000c0000) + 0x10000000000000000000100000000050000000001000000000e0003) + 0x125756000000000f00000000010000000003000000000100000000000000) + 0x1000000001100001586260000000012000000000100000000000000) + 0x1000000001400009d44ab0000000015000000000100000000020000) + 0x20000000000000000000100000000170000044e0600000000180000) + 0x1000000000b0000000001000000001a00001f7422000000001b0000) + 0x10000000003000000000100000000000000000001000000001d0000) + 0xdc66000000001e0000000001000000001f0000064a6d00000000210000) + 0x1000000000000000000010000000002000000000100000000230000) + 0x2c14000000002400000000010000000000000000000100000000260000) + 0x14214000000002700000000010000000026000000000200000000000000) + 0x1000000002900000008cf000000002a000000000100000000290000) + 0x200000000000000000001000000002c000000406a000000002d0000) + 0x1000000002f00000001c30000000030000000000100000000030000) + 0x1000000000000000000010000000002000000000100000000000000) + 0x100000000320000000ce10000000033000000000100000000350000) + 0x5a000000003600000000010000000000000000000100000000380000) + 0x292000000003900000000010000000008000000000200000000000000) + 0x1000000003b0000000011000000003c0000000001000000003e0000) + 0x83000000003f00000000010000000041000000000300000000420000) + 0x10000000044000000001a0000000045000000000100000000000000) + 0x1000000004700000000010000000000000000000100000000020000) + 0x100000000000000000001000000004a0000000003000000004b0000) + 0x1000000004a000000000200000000000000000001000000004e0000) + 0x5500000000020000000000000000000100000000050000000001001e) 0x10000000000000b 0x4e0014 0x1000e) + (.leaf8 0x800c6 0x10043 0x500142 0x101c3 0x510009 0x10186 0x540000000000001d 0xf))) (.bin (.bin + (.leaf8 0x530000000000001d 0x103c3 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 0xa 0x8280ea000000000000000000010000000001004cca879a00000000030000) + 0x1000000000200000000020000000000000000000100000000050002) + 0x1a19ac000000000600000000010000000000000000000100000000020000) + 0x10000000008000f5bb4c000000000090000000001000000000b0000) + 0x6b9eb9000000000c00000000010000000000000000000100000000050000) + 0x1000000000e0003125756000000000f000000000100000000030000) + 0x1000000000000000000010000000011000015862600000000120000) + 0x100000000000000000001000000001400009d44ab00000000150000) + 0x1000000000200000000020000000000000000000100000000170000) + 0x44e0600000000180000000001000000000b0000000001000000001a0000) + 0x1f7422000000001b00000000010000000003000000000100000000000000) + 0x1000000001d000000dc66000000001e0000000001000000001f0000) + 0x64a6d000000002100000000010000000000000000000100000000020000) + 0x100000000230000002c140000000024000000000100000000000000) + 0x1000000002600000142140000000027000000000100000000260000) + 0x200000000000000000001000000002900000008cf000000002a0000) + 0x10000000029000000000200000000000000000001000000002c0000) + 0x406a000000002d0000000001000000002f00000001c300000000300000) + 0x1000000000300000000010000000000000000000100000000020000) + 0x10000000000000000000100000000320000000ce100000000330000) + 0x10000000035000000005a0000000036000000000100000000000000) + 0x1000000003800000002920000000039000000000100000000080000) + 0x200000000000000000001000000003b0000000011000000003c0000) + 0x1000000003e0000000083000000003f000000000100000000410000) + 0x3000000004200000000010000000044000000001a00000000450000) + 0x1000000000000000000010000000047000000000100000000000000) + 0x10000000002000000000100000000000000000001000000004a0000) + 0x3000000004b0000000001000000004a000000000100000000010000) + 0x5400000000000000000000000000005200000000000000000000001e) 0x10000000052000b 0x4b00000000480016 + 0x10000000049001a 0x480016 0x16) (.leaf8 0x450016 0xd0000000043001a 0x4200000000420016 + 0x10000000040001a 0x3f000000003f0016 0x41000000003d001a 0x3c000000003c0016 0x8000000003a001a)) + (.bin (.leaf8 0x390016 0x80014 0x20010 0x10021 0x1490000000037001a 0x360016 0x2d0000000034001a + 0x3300000000330016) (.leaf8 0x6700000000031001a 0x300016 0x16 0x3000000000010016 + 0xe1000000002e001a 0x2d000000002d0016 0x2034000000002b001a 0x2c000000002b0016)))) (.bin (.bin + (.bin (.leaf8 0x14 0x2e0010 0x10021 0x2a00000000270016 0x4670000000028001a 0x270016 0x260014 + 0x20010) (.leaf8 0x10021 0xa10a0000000025001a 0x240016 0x160a0000000022001a 0x200000000210016 + 0x210014 0x40010 0x10021)) (.bin (.leaf8 0x32536000000001f001a 0x1e000000001d0016 + 0x6e32000000001c001a 0x1d000000001c0016 0x30014 0x1f0010 0x10021 0xfba110000000019001a) (.leaf8 + 0xb00000000180016 0x227030000000016001a 0x150016 0x20014 0x20010 0x10021 0x4ea2550000000013001a + 0x1400000000130016))) (.bin (.bin (.leaf8 0x120014 0x160010 0x10021 0xac3120000000010001a + 0x1100000000100016 0x30014 0x130010 0x10021) (.leaf8 0x1892bab000000000d001a 0x5000000000c0016 + 0xc0014 0x70010 0x10021 0x35cf5c000000000a001a 0x900000000090016 0x7adda5f0000000007001a)) (.bin + (.leaf8 0x800000000070016 0x16 0x10d0cd60000000004001a 0x30016 0x20014 0x20010 0x10021 + 0x266543cd0000000001001a) (.leaf8 0x3001d + 0x1000000000100000000010005414074000000000000000000000020 0x50010 0x60021 0x17 0x1d 0x103c3 (h240 + (h240 0x54140750000 0x3000000000100000000020000000002000000000000000000010000) + 0x500054140740000000006000000000100000000040000000006001c)))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x4000d (h240 0x20000000000000000000100000000010000 + 0x2000000000500000000000021240356000000000000000000010020) 0x4000e + 0x80000000000000000000200000000000000000000001e 0x100000000030023 + 0xa000000000000010d0cd5000000000100000000000020 0x2000e + 0x10000000000000000000100000000090000000002001c) (.leaf8 0x9000f + 0xe0000000000000000000900000000030000000001001e 0x80023 0x8000d + 0xf00000000000007adda5e000000000200000000010020 0x100000000000000000000b0000000005001f + 0x1000000000c0023 0x110000000000000035cf5b000000000300000000000020)) (.bin (.leaf8 0xe000e + 0x130000000000000000000700000000060000000000001e 0x100000000080023 + 0x1500000000000001892baa000000000400000000000020 0x5000e + 0x180000000000000000001300000000090000000000001e 0x120023 0x12000d) (.leaf8 + 0x19000000000000000ac311000000000500000000010020 0x14000e + 0x1a00000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x1b000000000000004ea254000000000600000000010020 0x4000e + 0x1d00000000000000000002000000000c0000000000001e))) (.bin (.bin (.leaf8 0x100000000030023 + 0x1f00000000000000022702000000000700000000000020 0x210000000000000000000d000000000f001f + 0x1000000000e0023 0x23000000000000000fba10000000000800000000000020 0x5000e + 0x260000000000000000001f00000000110000000000001e 0x1e0023) (.leaf8 0x1e000d + 0x2700000000000000006e31000000000900000000010020 0x28000000000000000000200000000012001f + 0x100000000200023 0x2a00000000000000032535000000000a00000000000020 0x23000e + 0x2c0000000000000000000400000000140000000000001e 0x100000000050023)) (.bin (.leaf8 + 0x2e00000000000000001609000000000b00000000000020 0x30000000000000000000020000000017001f + 0x100000000030023 0x320000000000000000a109000000000c00000000000020 0x28000e + 0x350000000000000000000200000000180000000000001e 0x100000000030023 + 0x3700000000000000000466000000000d00000000000020) (.leaf8 0x390000000000000000002c0000000019001f + (h240 0x1000000002d00000000010000 0x100000000020000000001000000002e0000000004001c) 0x2e000f + 0x3b0000000000000000002e000000001a0000000001001e 0x2d0023 0x2d000d + 0x3c00000000000000002033000000000e00000000010020 0x3d0000000000000000002f000000001d001f)))) (.bin + (.bin (.bin (.leaf8 0x100000000300023 0x3e000000000000000000e0000000000f00000000000020 + 0x40000000000000000000320000000000001f 0x310023 0x31000d 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f) (.leaf8 + 0x4200000000000000000001000000001e0000000001001e 0x100000000020023 + 0x440000000000000000066f000000001000000000000020 0x46000000000000000000350000000021001f + 0x100000000360023 0x470000000000000000002c000000001100000000000020 + 0x49000000000000000000020000000023001f 0x100000000030023)) (.bin (.leaf8 + 0x4b00000000000000000148000000001200000000000020 0xa000e + 0x4e0000000000000000000200000000240000000000001e 0x100000000030023 + 0x5000000000000000000007000000001300000000000020 0x520000000000000000003e0000000027001f + 0x1000000003f0023 0x5300000000000000000040000000001400000000000020) (.leaf8 + 0x55000000000000000000410000000029001f 0x100000000420023 + 0x5600000000000000000000000000001500000000000020 0x5700000000000000000044000000002b001f + 0x100000000450023 0x590000000000000000000c000000001600000000000020 + 0x5b00000000000000000002000000002d001f (h240 0x100000000030000000001000000000000000000010000 + 0x200000000010000000000000000000100000000010000000005001c)))) (.bin (.bin (.leaf8 0x1000f + 0x5f00000000000000000001000000002e0000000001001e 0x100000000020023 + 0x6100000000000000000000000000001800000000000020 0x620000000000000000004d000000002f001f (h240 + 0x10000 0x4e00000000010000000000000000000100000000020000000003001c) 0x2000f + 0x640000000000000000000200000000340000000001001e) (.leaf8 0x2000a 0x8 0x10009 0x10021 + 0x4d000000004c0016 0x20014 0x2000000000400000000000000000002000000004f0000000000001f (h240 0x30000 + 0x400000000010000000002000000004f00000000000000000000001e))) (.bin (.leaf8 0x4f0009 0x10021 + 0x60000000046001a 0x450016 0x4400000000430016 0x420014 0x460010 0x10021) (.leaf8 + 0x200000000040001a 0x3f0016 0x4000000003d001a 0x3c0016 0xb00000000010016 0xa4000000003a001a + 0x390016 0x3900000000010016)))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x150000000037001a 0x3800000000370016 0x360014 0x3a0010 0x10021 0x3370000000034001a + 0x3500000000340016 0x20014) (.leaf8 0x300000000040000000000000000000200000000370000000000001f + 0x370009 0x10021 0x700000000031001a 0x3200000000310016 0x300014 0x340010 0x10021)) (.bin (.leaf8 + 0x101a000000002e001a 0x2000000002d0016 0x2d0014 0x40010 0x10021 0x233000000002b001a 0x2a0016 + 0x2900000000010016) (.leaf8 0x50840000000028001a 0x2900000000280016 0x30014 0x2b0010 0x10021 + 0xb040000000025001a 0x2600000000250016 0x50014))) (.bin (.bin (.leaf8 0x280010 0x10021 + 0x1929b0000000022001a 0x210016 0x200014 0x20010 0x10021 0x3719000000001f001a) (.leaf8 + 0x6000000001e0016 0x7dd08000000001c001a 0x1b0016 0x1b000000000c0016 0x113800000000019001a + 0x1a00000000190016 0x30014 0x1c0010)) (.bin (.leaf8 0x10021 0x1800000000030016 + 0x27512a0000000016001a 0x1500000000150016 0x561890000000013001a 0x600000000120016 + 0xc495d50000000010001a 0xf0016) (.leaf8 0xf00000000060016 0x1ae7ad000000000d001a 0xe000000000d0016 + 0xc0014 0x100010 0x10021 0x3d6ed2f000000000a001a 0xa000000000a0016)))) (.bin (.bin (.bin (.leaf8 + 0x30014 0xc0010 0x10021 0x86866a0000000007001a 0x800000000070016 0x30014 0xa0010 0x10021) (.leaf8 + 0x600000000030016 0x1332a1e50000000004001a 0x500000000040016 0x14 0x70010 0x10021 + 0x300000000000016 0x2a0a03a0000000001001a)) (.bin (.leaf8 0x3001d + 0x1000000000100000000010002a0a039000000000000000000000020 0x5000e (h240 0x10000 + 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x200000000070000000001000000000700000000000000000001001e 0x60023 0x6000d) (.leaf8 + 0x200000000080000000001001332a1e4000000000100000000010020 + 0x20000000009000000000100000000080000000001001f (h240 0x1000000000900000000010000 + 0x100000000050000000001000000000a0000000004001c) 0xa000f + 0x2000000000b0000000001000000000a00000000020000000001001e 0x90023 0x9000d + 0x2000000000c00000000010000868669000000000200000000010020))) (.bin (.bin (.leaf8 0x5000e + 0x2000000000e0000000001000000000c00000000050000000000001e 0xb0023 0xb000d + 0x2000000000f00000000010003d6ed2e000000000300000000010020 0xe000e + 0x200000000100000000001000000001000000000070000000000001e 0xf0023) (.leaf8 0xf000d + 0x20000000011000000000100001ae7ac000000000400000000010020 + 0x20000000012000000000100000000110000000003001f (h240 0x10000 + 0x1200000000010000000000000000000100000000010000000003001c) 0x1000f + 0x200000000130000000001000000000100000000080000000001001e 0x100000000020023 + 0x20000000015000000000100007bc31f000000000500000000000020)) (.bin (.leaf8 + 0x20000000017000000000100000000140000000003001f 0x140009 0x180021 0x17 0x1d 0x103c3 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 0x5ffd29e10000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x50002a0a03a00000000060000000001000000000000000000010000) + 0x200000000010000000008001332a1e6000000000900000000010000) + 0x100000000050000000001000000000b000086866a0000) + 0xc000000000100000000060000000001000000000d0003d6ed300000) + 0xf0000000001000000001100001ae7ae000000001200000000010000) + 0x100000000020000000001000000000000000000010000) + 0x1400007bc31f0000000015000000000100000000140000000018001c) 0x14000f) (.leaf8 (h240 + 0x20000000000000000000100000000010000 0x200000000170000000000000000001400000000040000000001001e) + 0x130023 0x13000d 0x190000000000000048d2b3000000000500000000010020 + 0x1900000000000000000008000000000b001f 0x100000000090023 + 0x1b00000000000000056188000000000600000000000020 0x1d00000000000000000017000000000d001f))))) (.bin + (.bin (.bin (.bin (.leaf8 0x100000000180023 0x1e00000000000000275129000000000700000000000020 + 0x200000000000000000001a0000000001001f (h240 0x1000000001b00000000010000 + 0x100000000050000000001000000001c0000000004001c) 0x1c000f + 0x220000000000000000001c000000000e0000000001001e 0x1b0023 0x1b000d) (.leaf8 + 0x230000000000000001137f000000000800000000010020 0x240000000000000000001d0000000007001f (h240 + 0x10000 0x1e00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x250000000000000000000100000000100000000001001e 0x100000000020023 + 0x270000000000000007dd07000000000900000000000020 0x29000000000000000000080000000013001f)) (.bin + (.leaf8 0x100000000090023 0x2b00000000000000003718000000000a00000000000020 0x22000e + 0x2e0000000000000000000200000000140000000000001e 0x100000000030023 + 0x300000000000000001929a000000000b00000000000020 0x7000e + 0x330000000000000000002800000000170000000000001e) (.leaf8 0x270023 0x27000d + 0x3400000000000000000b03000000000c00000000010020 0x5000e + 0x360000000000000000002b00000000190000000000001e 0x2a0023 0x2a000d + 0x3700000000000000005083000000000d00000000010020))) (.bin (.bin (.leaf8 + 0x380000000000000000002b0000000000001f 0x2a0023 0x2a000d 0x3900000000000000000002000000001b001f + 0x100000000030023 0x3b00000000000000000232000000000e00000000000020 0x2f000e + 0x3d00000000000000000004000000001c0000000000001e) (.leaf8 0x100000000050023 + 0x3f00000000000000001019000000000f00000000000020 0x32000e + 0x4100000000000000000034000000001f0000000000001e 0x330023 0x33000d + 0x420000000000000000006f000000001000000000010020 0x5000e)) (.bin (.leaf8 + 0x10000000005000000000100000000370000000002001c 0x37000f + 0x4500000000000000000037000000001f0000000001001e 0x360023 0x36000d + 0x4600000000000000000336000000001100000000010020 0x38000e + 0x470000000000000000003a00000000230000000000001e) (.leaf8 0x390023 0x39000d + 0x4800000000000000000014000000001200000000010020 0x490000000000000000003b0000000000001f 0x3a0023 + 0x3a000d 0x49000000000000000000020000000025001f 0x100000000030023)))) (.bin (.bin (.bin (.leaf8 + 0x4b000000000000000000a3000000001300000000000020 0x4d0000000000000000000d0000000000001f 0xc0023 + 0xc000d 0x4e000000000000000000020000000027001f 0x100000000030023 + 0x5000000000000000000003000000001400000000000020 0x52000000000000000000020000000029001f) (.leaf8 + 0x100000000030023 0x540000000000000000001f000000001500000000000020 0x44000e + 0x5600000000000000000046000000002b0000000000001e 0x450023 0x45000d + 0x5700000000000000000002000000002d001f 0x100000000030023)) (.bin (.leaf8 + 0x5900000000000000000005000000001700000000000020 0x5000e + 0x200000000050000000001000000004f0000000002001c 0x4f000f + 0x5d0000000000000000004f000000002e0000000001001e 0x4e0023 0x4e000d 0x1000e) (.leaf8 + 0x5f0000000000000000000100000000000000000000001e 0x20000000000000b 0x5000000004e0016 + 0x600000000030016 0x20000000049001a 0x4a00000000490016 0x30014 0x4c0010))) (.bin (.bin (.leaf8 + 0x10021 0x4500000000450016 0xf0000000043001a 0x4400000000430016 0x30014 0x460010 0x10021 + 0x10000000040001a) (.leaf8 0x4100000000400016 0x30014 0x430010 0x10021 0x3f000000000c0016 + 0x51000000003d001a 0x3c0016 0x3c00000000010016)) (.bin (.leaf8 0xa000000003a001a + 0x3b000000003a0016 0x19c0000000037001a 0x500000000360016 0x3600000000040016 0x370000000034001a + 0x3500000000340016 0x80d0000000031001a) (.leaf8 0x300016 0x3000000000030016 0x119000000002e001a + 0x2d0016 0x2c00000000010016 0x2842000000002b001a 0x6000000002a0016 0x5820000000028001a)))))) (.bin + (.bin (.bin (.bin (.bin (.leaf8 0x800000000270016 0xc94d0000000025001a 0x240016 0x2300000000010016 + 0x1b8c0000000022001a 0x210016 0x2100000000070016 0x3ee83000000001f001a) (.leaf8 0x1e0016 0x16 + 0x89c0000000001c001a 0x1d000000001c0016 0x30016 0x13a8950000000019001a 0x180016 + 0x2b0c40000000016001a)) (.bin (.leaf8 0x1700000000160016 0x90014 0x190010 0x10021 + 0x624aea0000000013001a 0x120016 0x16 0xd73d70000000010001a) (.leaf8 0xf000000000f0016 + 0x1eb7697000000000d001a 0xd000000000d0016 0xc00000000040016 0x434334000000000a001a + 0xb000000000a0016 0x30016 0x99950f30000000007001a))) (.bin (.bin (.leaf8 0x200000000060016 0x60014 + 0x40010 0x10021 0x150501c0000000004001a 0x500000000040016 0x14 0x70010) (.leaf8 0x10021 + 0x300000000000016 0x2ffe94f00000000001001a 0x3001d + 0x1000000000100000000010006918fd8000000000000000000000020 0x50010 0x60021 0x17)) (.bin (.leaf8 + 0x1d 0x103c3 (h240 (h240 0x6918fd90000 0x3000000000100000000020000000002000000000000000000010000) + 0x50006918fd80000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x20000000005000000000000296d0515000000000000000000010020) + 0x5000e (h240 0x10000 0x10000000002000000000100000000070000000003001c) 0x7000f) (.leaf8 + 0x90000000000000000000700000000000000000001001e 0x60023 0x6000d + 0xa0000000000000150501b000000000100000000010020 0x8000e + 0xb0000000000000000000400000000020000000000001e 0x100000000050023 + 0xd000000000000099950f2000000000200000000000020)))) (.bin (.bin (.bin (.leaf8 + 0xf000000000000000000020000000001001f (h240 0x10000 + 0x3000000000100000000000000000001000000000c0000000003001c) 0xc000f + 0x110000000000000000000c00000000050000000001001e 0xb0023 0xb000d + 0x1200000000000000434333000000000300000000010020 0x130000000000000000000e0000000002001f) (.leaf8 + 0xd0023 0xd000d 0x130000000000000000000f0000000008001f 0xe0023 0xe000d + 0x1400000000000001eb7696000000000400000000010020 0x15000000000000000000110000000009001f + 0x100000000120023)) (.bin (.leaf8 0x16000000000000000d73d6000000000500000000000020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x1a00000000000000000001000000000a0000000001001e 0x100000000020023 + 0x1c00000000000000624ae9000000000600000000000020 0xb000e) (.leaf8 + 0x1f00000000000000000019000000000d0000000000001e 0x180023 0x18000d + 0x200000000000000002b0c3000000000700000000010020 0x2100000000000000000002000000000f001f + 0x100000000030023 0x230000000000000013a894000000000800000000000020 + 0x25000000000000000000020000000001001f))) (.bin (.bin (.leaf8 (h240 0x10000 + 0x3000000000100000000000000000001000000001e0000000003001c) 0x1e000f + 0x270000000000000000001e00000000110000000001001e 0x1d0023 0x1d000d + 0x28000000000000000089bf000000000900000000010020 0x2000e + 0x10000000000000000000100000000010000000002001c) (.leaf8 0x1000f + 0x2b0000000000000000000100000000120000000001001e 0x100000000020023 + 0x2d0000000000000003ee82000000000a00000000000020 0x2f000000000000000000230000000004001f 0x220023 + 0x22000d 0x2f000000000000000000020000000015001f)) (.bin (.leaf8 0x100000000030023 + 0x3100000000000000001b8b000000000b00000000000020 0x33000000000000000000250000000000001f 0x240023 + 0x24000d 0x34000000000000000000020000000017001f 0x100000000030023 + 0x360000000000000000c94c000000000c00000000000020) (.leaf8 0x380000000000000000000a0000000019001f + 0x1000000000b0023 0x3a00000000000000000581000000000d00000000000020 + 0x3c00000000000000000008000000001b001f 0x100000000090023 + 0x3e00000000000000002841000000000e00000000000020 0x400000000000000000002e0000000000001f + 0x2d0023))))) (.bin (.bin (.bin (.bin (.leaf8 0x2d000d 0x4100000000000000000002000000001d001f + 0x100000000030023 0x4300000000000000000118000000000f00000000000020 + 0x45000000000000000000320000000001001f (h240 0x10000 + 0x3300000000010000000000000000000100000000010000000003001c) 0x1000f + 0x4600000000000000000001000000001e0000000001001e) (.leaf8 0x100000000020023 + 0x480000000000000000080c000000001000000000000020 0x4a000000000000000000370000000022001f 0x360023 + 0x36000d 0x4b00000000000000000036000000001100000000010020 0x4c000000000000000000380000000002001f + 0x370023)) (.bin (.leaf8 0x37000d 0x4c000000000000000000070000000023001f 0x100000000080023 + 0x4e0000000000000000019b000000001200000000000020 0x500000000000000000003d0000000026001f 0x3c0023 + 0x3c000d 0x5100000000000000000009000000001300000000010020) (.leaf8 + 0x520000000000000000003e0000000000001f 0x3d0023 0x3d000d 0x52000000000000000000020000000027001f + 0x100000000030023 0x5400000000000000000050000000001400000000000020 + 0x56000000000000000000410000000007001f (h240 0x1000000004200000000010000 + 0x10000000005000000000100000000430000000004001c)))) (.bin (.bin (.leaf8 0x43000f + 0x580000000000000000004300000000280000000001001e 0x420023 0x42000d + 0x5900000000000000000000000000001500000000010020 0x5000e + 0x5b00000000000000000046000000002b0000000000001e 0x450023) (.leaf8 0x45000d + 0x5c0000000000000000000e000000001600000000010020 0x5d00000000000000000047000000002d001f (h240 + 0x1000000004800000000010000 0x100000000050000000001000000004c0000000004001c) 0x4c000f + 0x5f0000000000000000004c000000002e0000000001001e 0x4b0023 0x4b000d)) (.bin (.leaf8 + 0x6000000000000000000001000000001800000000010020 0x61000000000000000000080000000001001f (h240 + 0x10000 0x900000000010000000000000000000100000000060000000003001c) 0x6000f + 0x630000000000000000000600000000320000000001001e (h240 0x10000 + 0x700000000010000000000000000000100000000020000000003001c) 0x800c6 0x10043) (.leaf8 0x10303 + 0x10009 0x50016 0x4e00000000070016 0x4d000000004c0016 0x30016 0x80000000046001a + 0x600000000450016)))) (.bin (.bin (.bin (.leaf8 0x4400000000430016 0x30016 0x280000000040001a + 0x4100000000400016 0x30014 0x430010 0x10021 0x5000000003d001a) (.leaf8 0x3e000000003d0016 + 0xcd000000003a001a 0x3b000000003a0016 0x80014 0x3d0010 0x10021 0x1c0000000037001a + 0x3600000000360016)) (.bin (.leaf8 0x4050000000034001a 0x3500000000340016 0x20014 + 0x3300000000040000000000000000000200000000370000000000001f 0x370009 0x20021 0x8c0000000031001a + 0x300016) (.leaf8 0x2f00000000010016 0x1420000000002e001a 0x2f000000002e0016 0x90014 0x310010 + 0x10021 0x2c0000000002b001a 0x2c000000002b0016))) (.bin (.bin (.leaf8 0xb0014 0x2e0010 0x10021 + 0x64a60000000028001a 0x270016 0x2600000000010016 0xdc50000000025001a 0x2600000000250016) (.leaf8 + 0x30014 0x280010 0x10021 0x1f7410000000022001a 0x2300000000220016 0x20014 + 0x300000000040000000000000000000200000000250000000000001f 0x250009)) (.bin (.leaf8 0x10021 + 0x44e0000000001f001a 0x1d0016 0x1e00000000010016 0x9d449000000001c001a 0x1d000000001c0016 0x30014 + 0x1f0010) (.leaf8 0x10021 0x158620000000019001a 0xc00000000180016 0x3125740000000016001a + 0x1700000000160016 0x20014 0x300000000040000000000000000000200000000190000000000001f + 0x190009))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x10021 0x6b9eb0000000013001a 0x120016 + 0xf5bb4c0000000010001a 0xf000000000e0016 0x21a19a000000000d001a 0xb0016 0xc00000000010016) (.leaf8 + 0x4cca878000000000a001a 0xb000000000a0016 0x50014 0xd0010 0x10021 0xa8280e0000000007001a + 0x800000000070016 0x16)) (.bin (.leaf8 0x17ff4a780000000004001a 0x30016 0x20014 0x20010 0x10021 + 0x348c7ec0000000001001a 0x100000000010016 0x14) (.leaf8 + 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x200000000020000000001000348c7eb000000000000000000010020 0x4000e + 0x200000000040000000001000000000200000000000000000000001e 0x100000000030023 + 0x2000000000600000000010017ff4a77000000000100000000000020))) (.bin (.bin (.leaf8 0x2000e + 0x10000000000000000000100000000090000000002001c 0x9000f + 0x2000000000a0000000001000000000900000000030000000001001e 0x80023 0x8000d + 0x2000000000b00000000010000a8280d000000000200000000010020 0x7000e) (.leaf8 + 0x2000000000d0000000001000000000d00000000050000000000001e 0xc0023 0xc000d + 0x2000000000e00000000010004cca877000000000300000000010020 + 0x2000000000f0000000001000000000e0000000000001f 0xd0023 0xd000d + 0x2000000000f000000000100000000020000000006001f)) (.bin (.leaf8 0x100000000020023 + 0x200000000110000000001000021a199000000000400000000000020 + 0x20000000013000000000100000000110000000008001f 0x100000000110023 + 0x20000000015000000000100009ab3f0000000000500000000000020 + 0x20000000017000000000100000000140000000008001f (h240 0x100000000000000 + 0x100000000180000000000000000001400000000010000000000001e) 0x130023) (.leaf8 0x13000d + 0x19000000000000005b0759000000000500000000010020 0x1900000000000000000002000000000b001f + 0x100000000030023 0x1b0000000000000006b9ea000000000600000000000020 0x5000e + 0x10000000005000000000100000000190000000002001c 0x19000f)))) (.bin (.bin (.bin (.leaf8 + 0x1f00000000000000000019000000000b0000000001001e 0x180023 0x18000d + 0x2000000000000000312573000000000700000000010020 0x210000000000000000000e000000000f001f + 0x1000000000f0023 0x2300000000000000015861000000000800000000000020 0x5000e) (.leaf8 + 0x260000000000000000001f00000000110000000000001e 0x1e0023 0x1e000d + 0x270000000000000009d448000000000900000000010020 0x28000000000000000000200000000000001f 0x1f0023 + 0x1f000d 0x28000000000000000000020000000012001f)) (.bin (.leaf8 0x100000000020023 + 0x2a000000000000000044df000000000a00000000000020 0x5000e + 0x10000000005000000000100000000250000000002001c 0x25000f + 0x2e0000000000000000002500000000130000000001001e 0x240023 0x24000d) (.leaf8 + 0x2f0000000000000001f740000000000b00000000010020 0x5000e + 0x310000000000000000002800000000170000000000001e 0x270023 0x27000d + 0x3200000000000000000dc4000000000c00000000010020 0x33000000000000000000280000000000001f + 0x270023))) (.bin (.bin (.leaf8 0x27000d 0x34000000000000000000020000000019001f 0x100000000030023 + 0x36000000000000000064a5000000000d00000000000020 0xd000e + 0x390000000000000000002e000000001b0000000000001e 0x2d0023 0x2d000d) (.leaf8 + 0x3a000000000000000002bf000000000e00000000010020 0xb000e + 0x3c00000000000000000031000000001d0000000000001e 0x300023 0x30000d + 0x3d0000000000000000141f000000000f00000000010020 0x3e000000000000000000310000000000001f 0x300023)) + (.bin (.leaf8 0x30000d 0x3f00000000000000000002000000001f001f 0x100000000030023 + 0x410000000000000000008b000000001000000000000020 0x35000e + 0x10000000005000000000100000000370000000002001c 0x37000f + 0x4400000000000000000037000000001f0000000001001e) (.leaf8 0x360023 0x36000d + 0x4500000000000000000404000000001100000000010020 0x46000000000000000000380000000023001f + 0x100000000390023 0x470000000000000000001b000000001200000000000020 0xa000e + 0x4a0000000000000000003d00000000250000000000001e))))) (.bin (.bin (.bin (.bin (.leaf8 0x3c0023 + 0x3c000d 0x4b000000000000000000cc000000001300000000010020 0x4c000000000000000000400000000028001f + 0x3f0023 0x3f000d 0x4d00000000000000000004000000001400000000010020 0x5000e) (.leaf8 + 0x4f0000000000000000004300000000290000000000001e 0x420023 0x42000d + 0x5000000000000000000027000000001500000000010020 0x51000000000000000000020000000001001f (h240 + 0x10000 0x300000000010000000000000000000100000000450000000003001c) 0x45000f + 0x5300000000000000000045000000002b0000000001001e)) (.bin (.leaf8 0x440023 0x44000d + 0x5400000000000000000008000000002d001f 0x100000000090023 + 0x5600000000000000000007000000001700000000000020 0x58000000000000000000020000000001001f (h240 + 0x10000 0x3000000000100000000000000000001000000004e0000000003001c) 0x4e000f) (.leaf8 + 0x5a0000000000000000004e00000000310000000001001e 0x4d0023 0x4d000d + 0x5b000000000000000000500000000004001f 0x4f0023 0x4f000d 0x5c000000000000000000020000000002001f + (h240 0x10000 0x200000000020000000000000000000100000000010000000003001c)))) (.bin (.bin (.leaf8 + 0x1000f 0x5e0000000000001d 0x1000b 0x20014 0x1000e 0x20186 0x10043 0x20142) (.leaf8 0x101c3 + 0x30023 0xa00c6 0x10043 0x10303 0x10009 0x40008 0x10009)) (.bin (.leaf8 0x10021 0x5100000000010019 + 0x5b0000000000001d 0x4f0023 (h240 0x20000 0x10000000005000000000100000000010000000003009c) 0x1000f + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x106be6d30000 0x100000000020077fc74ce000000000300000000010000) + 0x4000348c7ec00000000060000000001000000000500000000010000) + 0x300000000010000000000000000000100000000080017ff4a770000) + 0x9000000000100000000030000000001000000000000000000010000) + 0xa0000a8280e000000000c0000000001000000000800000000010000) + 0xe0004cca879000000000f0000000001000000000200000000020000) + 0x10000000011000021a199000000001200000000010000) + 0x1100000000020000000000000000000100000000140000f5bb4b0000) + 0x15000000000100000000030000000001000000000000000000010000) + 0x17000006b9ea00000000180000000001000000000600000000010000) + 0x50000000001000000001a0000312574000000001b00000000010000) + 0xf000000000100000000000000000001000000001d00000158610000) + 0x1e0000000001000000000600000000010000000020000009d44a0000) + 0x21000000000100000000020000000002000000000000000000010000) + 0x2300000044df00000000240000000001000000000600000000010000) + 0x500000000010000000026000001f741000000002700000000010000) + 0x6000000000100000000290000000dc5000000002a00000000010000) + 0x29000000000100000000030000000001000000000000000000010000) + 0x2c00000064a5000000002d0000000001000000000e00000000010000) + 0x2f00000002c000000000300000000001000000000c00000000010000) + 0x32000000142000000000330000000001000000003200000000010000) + 0x30000000001000000000000000000010000000035000000008c0000) + 0x36000000000100000000050000000001000000003800000004060000) + 0x39000000000100000000000000000001000000003b000000001b0000) + 0x3c0000000001000000000b0000000001000000003e00000000cd0000) + 0x3f000000000100000000410000000005000000004200000000010000) + 0x6000000000100000000440000000028000000004500000000010000) + 0x3000000000100000000000000000001000000004600000000010000) + 0x9000000000100000000000000000001000000004a00000000070000) + 0x4b000000000100000000030000000001000000000000000000010000) + 0x4f00000000010000000050000000005c00000000020000000000001d) 0x50000000000000b) (.leaf8 0x14 + 0x5000e 0x1000c6 0x10043 0x20142 0x101c3 0x30009 0x5000000000010019)))) (.bin (.bin (.bin (.leaf8 + 0x5b0000000000001d 0x4e0023 0x300000000000000000001009c 0x30003 0x3000f (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x106be6d700000000000000 + 0x100000000020077fc74ce0000000003000000000100000000040003) + 0x48c7ec000000000600000000010000000005000000000100000000030000) + 0x10000000000000000000100000000080017ff4a7700000000090000) + 0x10000000003000000000100000000000000000001000000000a0000) + 0xa8280e000000000c000000000100000000080000000001000000000e0004) + 0xcca879000000000f00000000010000000002000000000200000000000000) + 0x10000000011000021a1990000000012000000000100000000110000) + 0x20000000000000000000100000000140000f5bb4b00000000150000) + 0x1000000000300000000010000000000000000000100000000170000) + 0x6b9ea000000001800000000010000000006000000000100000000050000) + 0x1000000001a0000312574000000001b0000000001000000000f0000) + 0x100000000000000000001000000001d0000015861000000001e0000) + 0x1000000000600000000010000000020000009d44a00000000210000) + 0x1000000000200000000020000000000000000000100000000230000) + 0x44df000000002400000000010000000006000000000100000000050000) + 0x10000000026000001f7410000000027000000000100000000060000) + 0x100000000290000000dc5000000002a000000000100000000290000) + 0x10000000003000000000100000000000000000001000000002c0000) + 0x64a5000000002d0000000001000000000e0000000001000000002f0000) + 0x2c000000000300000000001000000000c000000000100000000320000) + 0x1420000000003300000000010000000032000000000100000000030000) + 0x1000000000000000000010000000035000000008c00000000360000) + 0x1000000000500000000010000000038000000040600000000390000) + 0x100000000000000000001000000003b000000001b000000003c0000) + 0x1000000000b0000000001000000003e00000000cd000000003f0000) + 0x1000000004100000000050000000042000000000100000000060000) + 0x1000000004400000000280000000045000000000100000000030000) + 0x1000000000000000000010000000046000000000100000000090000) + 0x100000000000000000001000000004a0000000007000000004b0000) + 0x10000000003000000000100000000000000000002000000004f0000) + 0x5b00000000010000000000000000000300000000020000000001001e) 0x2000b 0x4f0014) (.leaf8 0x20010 + 0x10021 0x4d0016 0x4b00000000010016 0x30000000049001a 0x480016 0x4600000000070016 0x30014)) (.bin + (.leaf8 0x480010 0x10021 0x140000000043001a 0x600000000420016 0x20000000040001a 0x4100000000400016 + 0x66000000003d001a 0x3e000000003d0016) (.leaf8 0x3c00000000090016 0xd000000003a001a 0x390016 + 0x2030000000037001a 0x500000000360016 0x460000000034001a 0x330016 0x3200000000010016))) (.bin + (.bin (.leaf8 0xa100000000031001a 0xc00000000300016 0x160000000002e001a 0xe000000002d0016 + 0x3252000000002b001a 0x2c000000002b0016 0x30014 0x2e0010) (.leaf8 0x10021 0x2a00000000270016 + 0x6e20000000028001a 0x600000000270016 0xfba00000000025001a 0x2600000000250016 0x600000000030016 + 0x226f0000000022001a)) (.bin (.leaf8 0x2300000000220016 0x14 0x250010 0x10021 0x2100000000000016 + 0x4ea24000000001f001a 0x20000000001f0016 0x1e00000000040016) (.leaf8 0xac30000000001c001a 0x1b0016 + 0x1b000000000d0016 0x1892b90000000019001a 0x1a00000000190016 0x600000000030016 + 0x35cf50000000016001a 0x150016)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 0x1500000000010016 + 0x7adda50000000013001a 0x120016 0x110014 0x20010 0x10021 0x10d0cc0000000010001a + 0x1100000000100016) (.leaf8 0x14 0x130010 0x10021 0xf00000000000016 0x266543c000000000d001a + 0x8000000000c0016 0x541407000000000a001a 0x80016)) (.bin (.leaf8 0x900000000010016 + 0xbffa53b0000000007001a 0x60016 0x500000000010016 0x1a463f60000000004001a 0x300000000020016 + 0x3bfe3a660000000001001a 0x200000000010016) (.leaf8 0x14 + 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x200000000020000000001000835f36c000000000000000000010020 0x50010 0x40021 0x17))) (.bin (.bin + (.leaf8 0x1d 0x103c3 (h240 0x835f36f000000000300000000010000 + 0x5000835f36d0000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000300000000000033c846f7000000000000000000010020) + 0x5000000000000000000050000000000001f 0x100000000050023 + 0x700000000000001a463f5000000000100000000000020) (.leaf8 0x9000000000000000000070000000000001f + 0x60023 0x6000d 0xa000000000000000000020000000003001f 0x100000000030023 + 0xc0000000000000bffa53a000000000200000000000020 0xe0000000000000000000b0000000000001f 0xa0023)) + (.bin (.leaf8 0xa000d 0xe000000000000000000020000000004001f 0x100000000020023 + 0x1000000000000000541406000000000300000000000020 0x120000000000000000000a0000000007001f + 0x1000000000b0023 0x140000000000000266543b000000000400000000000020 0x11000e) (.leaf8 (h240 0x10000 + 0x10000000002000000000100000000130000000003001c) 0x13000f + 0x180000000000000000001300000000080000000001001e 0x120023 0x12000d + 0x190000000000000010d0cb000000000500000000010020 0x13000e + 0x1b00000000000000000002000000000a0000000000001e)))) (.bin (.bin (.bin (.leaf8 0x100000000030023 + 0x1d000000000000007adda4000000000600000000000020 0x1f000000000000000000170000000000001f 0x160023 + 0x16000d 0x1f00000000000000000002000000000d001f 0x100000000030023 + 0x2100000000000000035cf4000000000700000000000020) (.leaf8 0x23000000000000000000080000000001001f + (h240 0x10000 0x9000000000100000000000000000001000000001b0000000003001c) 0x1b000f + 0x250000000000000000001b000000000f0000000001001e 0x1a0023 0x1a000d + 0x26000000000000001892b8000000000800000000010020 0x270000000000000000001d0000000008001f)) (.bin + (.leaf8 0x1c0023 0x1c000d 0x27000000000000000000020000000011001f 0x100000000030023 + 0x290000000000000000ac2f000000000900000000000020 0x2b000000000000000000200000000002001f 0x1f0023 + 0x1f000d) (.leaf8 0x2b000000000000000000220000000014001f 0x210023 0x21000d + 0x2c0000000000000004ea23000000000a00000000010020 0x23000e (h240 0x10000 + 0x10000000002000000000100000000250000000003001c) 0x25000f + 0x2f0000000000000000002500000000140000000001001e))) (.bin (.bin (.leaf8 0x240023 0x24000d + 0x300000000000000000226e000000000b00000000010020 0x31000000000000000000080000000001001f (h240 + 0x10000 0x900000000010000000000000000000100000000270000000003001c) 0x27000f + 0x330000000000000000002700000000170000000001001e 0x260023) (.leaf8 0x26000d + 0x340000000000000000fb9f000000000c00000000010020 0x35000000000000000000080000000019001f + 0x100000000090023 0x37000000000000000006e1000000000d00000000000020 + 0x390000000000000000002c0000000019001f (h240 0x1000000002d00000000010000 + 0x100000000050000000001000000002e0000000004001c) 0x2e000f)) (.bin (.leaf8 + 0x3b0000000000000000002e000000001a0000000001001e 0x2d0023 0x2d000d + 0x3c00000000000000003251000000000e00000000010020 0x3d00000000000000000010000000001d001f + 0x100000000110023 0x3f0000000000000000015f000000000f00000000000020 + 0x410000000000000000000e000000001f001f) (.leaf8 0x1000000000f0023 + 0x4300000000000000000a0f000000001000000000000020 0x45000000000000000000340000000000001f 0x330023 + 0x33000d 0x46000000000000000000020000000021001f 0x100000000030023 + 0x4800000000000000000045000000001100000000000020))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x4a000000000000000000070000000023001f 0x100000000080023 + 0x4c00000000000000000202000000001200000000000020 0x4e000000000000000000020000000025001f + 0x100000000030023 0x500000000000000000000c000000001300000000000020 + 0x520000000000000000003e0000000005001f (h240 0x10000 + 0x3f000000000100000000000000000001000000003f0000000003001c)) (.leaf8 0x3f000f + 0x530000000000000000003f00000000270000000001001e 0x3e0023 0x3e000d + 0x5400000000000000000065000000001400000000010020 0x5500000000000000000043000000002a001f 0x420023 + 0x42000d)) (.bin (.leaf8 0x5600000000000000000001000000001500000000010020 + 0x5700000000000000000008000000002b001f 0x100000000090023 + 0x5900000000000000000013000000001600000000000020 0x5000e + 0x5c0000000000000000004800000000030000000000001e 0x470023 0x47000d) (.leaf8 + 0x5d00000000000000000002000000002f001f 0x100000000030023 + 0x5f00000000000000000002000000001800000000000020 0x610000000000000000004d0000000000001f 0x4c0023 + 0x4c000d 0x61000000000000000000020000000032001f (h240 0x1000000000200000000020000 + 0x10000000051000000000100000000020000000004001c)))) (.bin (.bin (.leaf8 0x800c6 0x10043 0x510142 + 0x101c3 0x520009 0x14 0x530010 0x10021) (.leaf8 0x4e00000000000016 0x1000000004c001a 0x4b0016 + 0x4900000000010016 0x4800000000040016 0x90000000046001a 0x450016 0x4500000000070016)) (.bin + (.leaf8 0x4400000000430016 0x330000000040001a 0x3e0016 0x6000000003d001a 0x3e000000003d0016 + 0x30014 0x400010 0x10021) (.leaf8 0x101000000003a001a 0x390016 0x3900000000060016 + 0x220000000037001a 0x360016 0x3500000000010016 0x5070000000034001a 0x3500000000340016)))) (.bin + (.bin (.bin (.leaf8 0xf0014 0x370010 0x10021 0xaf0000000031001a 0x3200000000310016 0x110014 + 0x340010 0x10021) (.leaf8 0x1929000000002e001a 0x5000000002d0016 0x2d0014 0x70010 0x10021 + 0x370000000002b001a 0x2c000000002b0016 0x90014)) (.bin (.leaf8 0x2e0010 0x10021 + 0x7dd00000000028001a 0x260016 0x2700000000070016 0x11370000000025001a 0x200000000240016 0x240014) + (.leaf8 0x40010 0x10021 0x275120000000022001a 0x2100000000210016 0x5617000000001f001a + 0x20000000001f0016 0x30014 0x220010))) (.bin (.bin (.leaf8 0x10021 0xc495d000000001c001a 0x1a0016 + 0x1b00000000070016 0x1ae790000000019001a 0x1a00000000190016 0x30014 0x1c0010) (.leaf8 0x10021 + 0x3d6ed20000000016001a 0x1700000000160016 0x30014 0x190010 0x10021 0x1500000000120016 + 0x868650000000013001a)) (.bin (.leaf8 0x1400000000130016 0x16 0x1332a1e0000000010001a 0xf0016 + 0xf00000000090016 0x2a0a02000000000d001a 0xe000000000d0016 0x14) (.leaf8 0x100010 0x10021 + 0xc00000000000016 0x5ffd29d000000000a001a 0x90016 0x800000000010016 0xd231fa0000000007001a + 0x800000000070016)))))))))) + +set_option maxRecDepth 20000 in +def st_6 : CertTree := + (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x14 0xa0010 0x10021 + 0x600000000030016 0x1dff1d320000000004001a 0x500000000040016 0x41af9b70000000001001a + 0x100000000010016) (.leaf8 0x14 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x20000000002000000000100041af9b6000000000000000000010020 + 0x20000000003000000000100000000070000000002001f 0x60023 0x6000d)) (.bin (.leaf8 + 0x200000000040000000001001dff1d31000000000100000000010020 + 0x20000000005000000000100000000080000000001001f (h240 0x1000000000900000000010000 + 0x100000000020000000001000000000a0000000004001c) 0xa000f + 0x200000000070000000001000000000a00000000020000000001001e 0x90023 0x9000d + 0x2000000000800000000010000d231f9000000000200000000010020) (.leaf8 + 0x200000000090000000001000000000a0000000000001f 0x90023 0x9000d + 0x2000000000a000000000100000000020000000005001f 0x100000000030023 + 0x2000000000c00000000010005ffd29c000000000300000000000020 0xe000e (h240 0x10000 + 0x10000000002000000000100000000100000000003001c)))) (.bin (.bin (.leaf8 0x10000f + 0x200000000100000000001000000001000000000060000000001001e 0xf0023 0xf000d + 0x20000000011000000000100002a0a01000000000400000000010020 + 0x20000000012000000000100000000110000000005001f (h240 0x10000 + 0x1200000000010000000000000000000100000000010000000003001c) 0x1000f) (.leaf8 + 0x200000000130000000001000000000100000000080000000001001e 0x100000000020023 + 0x2000000001500000000010000c160f6000000000500000000000020 + 0x20000000017000000000100000000140000000008001f (h240 0x100000000000000 + 0x100000000180000000000000000001400000000010000000000001e) 0x130023 0x13000d + 0x190000000000000071c925000000000500000000010020)) (.bin (.leaf8 0x2000e + 0x10000000000000000000100000000150000000002001c 0x15000f + 0x1b00000000000000000015000000000b0000000001001e 0x140023 0x14000d + 0x1c00000000000000086864000000000600000000010020 0x1d00000000000000000017000000000b001f) (.leaf8 + (h240 0x1000000001800000000010000 0x10000000005000000000100000000190000000004001c) 0x19000f + 0x1f00000000000000000019000000000c0000000001001e 0x180023 0x18000d + 0x20000000000000003d6ed1000000000700000000010020 0x5000e + 0x220000000000000000001c000000000f0000000000001e)))) (.bin (.bin (.bin (.leaf8 0x1b0023 0x1b000d + 0x230000000000000001ae78000000000800000000010020 0x240000000000000000001d0000000004001f 0x1c0023 + 0x1c000d 0x24000000000000000000020000000010001f 0x100000000020023) (.leaf8 + 0x26000000000000000c495c000000000900000000000020 0x5000e + 0x290000000000000000002200000000130000000000001e 0x210023 0x21000d + 0x2a00000000000000005616000000000a00000000010020 0x2b000000000000000000230000000015001f + 0x100000000240023)) (.bin (.leaf8 0x2c00000000000000027511000000000b00000000000020 0x26000e + 0x2e0000000000000000000400000000160000000000001e 0x100000000050023 + 0x3000000000000000001136000000000c00000000000020 0x32000000000000000000290000000004001f 0x280023 + 0x28000d) (.leaf8 0x32000000000000000000020000000018001f 0x100000000020023 + 0x3400000000000000007dcf000000000d00000000000020 0xb000e + 0x370000000000000000002e000000001b0000000000001e 0x2d0023 0x2d000d + 0x380000000000000000036f000000000e00000000010020))) (.bin (.bin (.leaf8 0x2f000e + 0x3900000000000000000007000000001c0000000000001e 0x100000000080023 + 0x3b00000000000000001928000000000f00000000000020 0x13000e + 0x3e00000000000000000034000000001f0000000000001e 0x330023 0x33000d) (.leaf8 + 0x3f000000000000000000ae000000001000000000010020 0x11000e + 0x410000000000000000003700000000210000000000001e 0x360023 0x36000d + 0x4200000000000000000506000000001100000000010020 0x43000000000000000000370000000000001f 0x360023)) + (.bin (.leaf8 0x36000d 0x44000000000000000000020000000023001f 0x100000000030023 + 0x4600000000000000000021000000001200000000000020 0x480000000000000000003b0000000003001f (h240 + 0x10000 0x3c00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x490000000000000000000100000000240000000001001e) (.leaf8 0x100000000020023 + 0x4b00000000000000000100000000001300000000000020 0x5000e + 0x4e0000000000000000004000000000270000000000001e 0x3f0023 0x3f000d + 0x4f00000000000000000005000000001400000000010020 0x50000000000000000000020000000028001f))))) (.bin + (.bin (.bin (.bin (.leaf8 0x100000000020023 0x5200000000000000000032000000001500000000000020 + 0x5400000000000000000046000000002c001f 0x450023 0x45000d 0x55000000000000000000470000000004001f + 0x460023 0x46000d) (.leaf8 0x5600000000000000000002000000002d001f 0x100000000030023 + 0x5800000000000000000008000000001700000000000020 0x5a0000000000000000004a0000000002001f 0x490023 + 0x49000d 0x5a0000000000000000004b0000000000001f 0x4a0023)) (.bin (.leaf8 0x4a000d + 0x5b000000000000000000020000000031001f 0x100000000030023 + 0x5d00000000000000000000000000001900000000000020 0x50000e (h240 0x10000 + 0x10000000002000000000100000000530000000003001c) 0xaa00c6 0x10043) (.leaf8 0x20142 0x101c3 0x30009 + 0x510014 0x40010 0x10021 0x4e0016 0x4c00000000010016))) (.bin (.bin (.leaf8 0x40000000049001a + 0x4a00000000490016 0x30014 0x4c0010 0x10021 0x4700000000460016 0x190000000043001a 0x420016) + (.leaf8 0x20014 0x20010 0x10021 0x30000000040001a 0x6000000003f0016 0x80000000003d001a 0x3c0016 + 0x16)) (.bin (.leaf8 0x11000000003a001a 0x390016 0x3800000000010016 0x2830000000037001a + 0x3800000000370016 0x3600000000100016 0x570000000034001a 0x1400000000330016) (.leaf8 + 0xc940000000031001a 0x300016 0x3000000000060016 0x1b8000000002e001a 0xc000000002d0016 + 0x3ee7000000002b001a 0x2c000000002b0016 0x14)))) (.bin (.bin (.bin (.leaf8 0x2e0010 0x10021 + 0x2a00000000000016 0x89b0000000028001a 0x270016 0x2700000000030016 0x13a880000000025001a + 0x2600000000250016) (.leaf8 0x240014 0x280010 0x10021 0x2b0b0000000022001a 0x2300000000220016 + 0x2100000000040016 0x624ad000000001f001a 0x20000000001f0016)) (.bin (.leaf8 0x14 0x220010 0x10021 + 0x1e00000000000016 0xd73c000000001c001a 0x1d000000001c0016 0x1b00000000040016 + 0x1eb7680000000019001a) (.leaf8 0x1a00000000190016 0x30016 0x434330000000016001a 0x140016 + 0x1500000000010016 0x99950e0000000013001a 0x120016 0x16))) (.bin (.bin (.leaf8 + 0x1505010000000010001a 0x1100000000100016 0x16 0x2ffe94e000000000d001a 0xe000000000d0016 0x30014 + 0x100010 0x10021) (.leaf8 0xc00000000090016 0x6918fc000000000a001a 0xb000000000a0016 0x16 + 0xeff8e990000000007001a 0x800000000070016 0x20d7cdb0000000004001a 0x400000000040016)) (.bin + (.leaf8 0x4afdc92d0000000001001a 0x200000000010016 0x14 + 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x200000000020000000001000a436fca000000000000000000010020 0x50010) (.leaf8 0x40021 0x17 0x1d + 0x103c3 (h240 0xa436fcd000000000300000000010000 + 0x5000a436fcb0000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000300000000000040ba5960000000000000000000010020) + 0x5000000000000000000060000000002001f)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 0x50023 0x5000d + 0x6000000000000020d7cda000000000100000000010020 0x70000000000000000000a0000000004001f 0x90023 + 0x9000d 0x80000000000000eff8e98000000000200000000010020 0x2000e) (.leaf8 + 0x100000000000000000001000000000c0000000002001c 0xc000f + 0xb0000000000000000000c00000000050000000001001e 0xb0023 0xb000d + 0xc000000000000006918fb000000000300000000010020 0xd0000000000000000000e0000000005001f (h240 + 0x1000000000f00000000010000 0x10000000005000000000100000000100000000004001c))) (.bin (.leaf8 + 0x10000f 0xf0000000000000000001000000000060000000001001e 0xf0023 0xf000d + 0x1000000000000002ffe94d000000000400000000010020 0x2000e + 0x10000000000000000000100000000120000000002001c 0x12000f) (.leaf8 + 0x130000000000000000001200000000090000000001001e 0x110023 0x11000d + 0x1400000000000000150500000000000500000000010020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x1700000000000000000001000000000a0000000001001e))) (.bin (.bin (.leaf8 0x100000000020023 + 0x190000000000000099950d000000000600000000000020 0x1b000000000000000000170000000000001f 0x160023 + 0x16000d 0x1b00000000000000000002000000000c001f 0x100000000020023 + 0x1d00000000000000043432000000000700000000000020) (.leaf8 0x1f000000000000000000020000000001001f + (h240 0x10000 0x3000000000100000000000000000001000000001b0000000003001c) 0x1b000f + 0x210000000000000000001b000000000f0000000001001e 0x1a0023 0x1a000d + 0x22000000000000001eb767000000000800000000010020 0x230000000000000000001d0000000002001f)) (.bin + (.leaf8 0x1c0023 0x1c000d 0x230000000000000000001f0000000012001f 0x1e0023 0x1e000d + 0x240000000000000000d73b000000000900000000010020 0x20000e (h240 0x10000 + 0x10000000002000000000100000000220000000003001c)) (.leaf8 0x22000f + 0x270000000000000000002200000000120000000001001e 0x210023 0x21000d + 0x28000000000000000624ac000000000a00000000010020 0x29000000000000000000230000000002001f 0x220023 + 0x22000d)))) (.bin (.bin (.bin (.leaf8 0x29000000000000000000250000000016001f 0x240023 0x24000d + 0x2a00000000000000002b0a000000000b00000000010020 0x26000e + 0x2b0000000000000000002800000000170000000000001e 0x270023 0x27000d) (.leaf8 + 0x2c00000000000000013a87000000000c00000000010020 0x2d000000000000000000290000000001001f (h240 + 0x10000 0x2a00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x2e0000000000000000000100000000180000000001001e 0x100000000020023 + 0x300000000000000000089a000000000d00000000000020 0x2c000e)) (.bin (.leaf8 (h240 0x10000 + 0x100000000020000000001000000002e0000000003001c) 0x2e000f + 0x340000000000000000002e000000001a0000000001001e 0x2d0023 0x2d000d + 0x3500000000000000003ee6000000000e00000000010020 0x360000000000000000000e000000001d001f + 0x1000000000f0023) (.leaf8 0x38000000000000000001b7000000000f00000000000020 + 0x3a000000000000000000320000000003001f (h240 0x10000 + 0x3300000000010000000000000000000100000000010000000003001c) 0x1000f + 0x3b00000000000000000001000000001e0000000001001e 0x100000000020023 + 0x3d00000000000000000c93000000001000000000000020 0x3f000000000000000000160000000021001f))) (.bin + (.bin (.leaf8 0x100000000170023 0x4100000000000000000056000000001100000000000020 + 0x4300000000000000000038000000000a001f 0x370023 0x37000d 0x430000000000000000003a0000000024001f + 0x390023 0x39000d) (.leaf8 0x4400000000000000000282000000001200000000010020 + 0x450000000000000000003a0000000000001f 0x390023 0x39000d 0x46000000000000000000020000000025001f + 0x100000000030023 0x4800000000000000000010000000001300000000000020 0x2000e)) (.bin (.leaf8 + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x4c0000000000000000000100000000260000000001001e 0x100000000020023 + 0x4e0000000000000000007f000000001400000000000020 0x50000000000000000000080000000029001f + 0x100000000090023 0x5200000000000000000002000000001500000000000020) (.leaf8 0x4000e + 0x5500000000000000000002000000002a0000000000001e 0x100000000030023 + 0x5700000000000000000018000000001600000000000020 0x5900000000000000000049000000002e001f 0x480023 + 0x48000d 0x5000e))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x5b0000000000000000004c000000002f0000000000001e 0x4b0023 0x4b000d + 0x5c00000000000000000003000000001800000000010020 0x5d0000000000000000004e0000000000001f 0x4d0023 + 0x4d000d 0x5e000000000000000000020000000033001f) (.leaf8 (h240 0x1000000000300000000010000 + 0x10000000053000000000100000000040000000004001c) 0x4000f + 0x610000000000000000000400000000340000000001001e 0x530000000004000b 0x30014 0x550010 0x10021 + 0x4e000000004d0016)) (.bin (.leaf8 0x1000000004c001a 0x4d000000004c0016 0x4a00000000040016 + 0xc0000000046001a 0x450016 0x500000000010016 0x10000000043001a 0x420016) (.leaf8 + 0x4200000000070016 0x3f0000000040001a 0x3f0016 0x16 0x3f00000000010016 0x7000000003d001a + 0x3e000000003d0016 0x30014))) (.bin (.bin (.leaf8 0x400010 0x10021 0x3c00000000390016 + 0x141000000003a001a 0x3900000000390016 0x2b0000000037001a 0x360016 0x3600000000150016) (.leaf8 + 0x6490000000034001a 0x330016 0x16 0xdc0000000031001a 0x300016 0x30000000000d0016 + 0x1f73000000002e001a 0x2000000002d0016)) (.bin (.leaf8 0x2d0014 0x40010 0x10021 + 0x44d000000002b001a 0x2a0016 0x16 0x9d440000000028001a 0x2900000000280016) (.leaf8 + 0x15860000000025001a 0x2400000000240016 0x312560000000022001a 0x2300000000220016 0x16 + 0x6b9e000000001f001a 0x20000000001f0016 0xf5bb4000000001c001a)))) (.bin (.bin (.bin (.leaf8 + 0x1c000000001c0016 0x30014 0x1e0010 0x10021 0x21a190000000019001a 0x180016 0x20014 0x20010) + (.leaf8 0x10021 0x4cca870000000016001a 0x150016 0x16 0x1500000000010016 0xa82800000000013001a + 0x110016 0x1200000000010016)) (.bin (.leaf8 0x17ff4a60000000010001a 0x1100000000100016 0x30016 + 0x348c7e000000000d001a 0xd000000000d0016 0x30014 0xf0010 0x10021) (.leaf8 0x77fc74c000000000a001a + 0xb000000000a0016 0x106be6d0000000007001a 0x700000000070016 0x257ee4960000000004001a + 0x500000000040016 0x521b7e60000000001001a 0x100000000010016))) (.bin (.bin (.leaf8 0x14 + 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x200000000020000000001000521b7e5000000000000000000010020 + 0x20000000003000000000100000000070000000002001f 0x60023 0x6000d) (.leaf8 + 0x20000000004000000000100257ee495000000000100000000010020 + 0x20000000005000000000100000000090000000004001f 0x80023 0x8000d + 0x200000000060000000001000106be6c000000000200000000010020 + 0x200000000070000000001000000000d0000000006001f 0xc0023 0xc000d)) (.bin (.leaf8 + 0x20000000008000000000100077fc74b000000000300000000010020 0x5000e + 0x2000000000a0000000001000000000f00000000070000000000001e 0xe0023 0xe000d + 0x2000000000b00000000010000348c7d000000000400000000010020 + 0x2000000000c000000000100000000020000000001001f (h240 0x10000 + 0x300000000010000000000000000000100000000120000000003001c)) (.leaf8 0x12000f + 0x2000000000e0000000001000000001200000000090000000001001e 0x110023 0x11000d + 0x2000000000f00000000010000f1b946000000000500000000010020 + 0x20000000010000000000100000000140000000003001f (h240 0x100000000000000 + 0x100000000110000000000000000001400000000060000000000001e) 0x130023))))))) (.bin (.bin (.bin (.bin + (.bin (.bin (.leaf8 0x13000d 0x12000000000000008e3b5d000000000500000000010020 + 0x12000000000000000000140000000000001f 0x130023 0x13000d 0x1200000000000000000002000000000a001f + 0x100000000020023 0x14000000000000000a827f000000000600000000000020) (.leaf8 + 0x16000000000000000000170000000000001f 0x160023 0x16000d 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x1800000000000000000001000000000c0000000001001e 0x100000000020023)) (.bin (.leaf8 + 0x1a000000000000004cca86000000000700000000000020 0x4000e + 0x1d00000000000000000002000000000e0000000000001e 0x100000000030023 + 0x1f00000000000000021a18000000000800000000000020 0x5000e + 0x220000000000000000001e00000000110000000000001e 0x1d0023) (.leaf8 0x1d000d + 0x23000000000000000f5bb3000000000900000000010020 0x24000000000000000000220000000014001f 0x210023 + 0x21000d 0x2500000000000000006b9d000000000a00000000010020 0x2000e + 0x10000000000000000000100000000240000000002001c))) (.bin (.bin (.leaf8 0x24000f + 0x280000000000000000002400000000150000000001001e 0x230023 0x23000d + 0x2900000000000000031255000000000b00000000010020 0x2a000000000000000000260000000017001f + 0x100000000270023 0x2b00000000000000001585000000000c00000000000020) (.leaf8 + 0x2d0000000000000000002b000000001a001f 0x2a0023 0x2a000d + 0x2e00000000000000009d43000000000d00000000010020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x3100000000000000000001000000001a0000000001001e)) (.bin (.leaf8 0x100000000020023 + 0x330000000000000000044c000000000e00000000000020 0x2f000e + 0x3500000000000000000004000000001c0000000000001e 0x100000000050023 + 0x3700000000000000001f72000000000f00000000000020 0x39000000000000000000320000000008001f 0x310023) + (.leaf8 0x31000d 0x3900000000000000000002000000001f001f 0x100000000030023 + 0x3b000000000000000000db000000001000000000000020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x3f0000000000000000000100000000200000000001001e)))) (.bin (.bin (.bin (.leaf8 0x100000000020023 + 0x4100000000000000000648000000001100000000000020 0x4300000000000000000038000000000d001f (h240 + 0x10000 0x3900000000010000000000000000000100000000010000000003001c) 0x1000f + 0x440000000000000000000100000000220000000001001e 0x100000000020023 + 0x460000000000000000002a000000001200000000000020) (.leaf8 0x480000000000000000003b0000000025001f + 0x1000000003c0023 0x4900000000000000000140000000001300000000000020 + 0x4b0000000000000000003e0000000025001f (h240 0x1000000003f00000000010000 + 0x10000000005000000000100000000400000000004001c) 0x40000f + 0x4d0000000000000000004000000000260000000001001e 0x3f0023)) (.bin (.leaf8 0x3f000d + 0x4e00000000000000000006000000001400000000010020 0x4f000000000000000000410000000000001f 0x400023 + 0x40000d 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f) (.leaf8 + 0x510000000000000000000100000000280000000001001e 0x100000000020023 + 0x530000000000000000003e000000001500000000000020 0x55000000000000000000440000000004001f 0x430023 + 0x43000d 0x5500000000000000000002000000002b001f 0x100000000030023))) (.bin (.bin (.leaf8 + 0x5700000000000000000000000000001600000000000020 0x58000000000000000000070000000000001f 0x60023 + 0x6000d 0x5900000000000000000002000000002d001f 0x100000000030023 + 0x5b0000000000000000000b000000001700000000000020 0x5d0000000000000000004c0000000002001f) (.leaf8 + 0x4b0023 0x4b000d 0x5e0000000000000000004f0000000032001f 0x4e0023 0x4e000d + 0x5f00000000000000000000000000001900000000010020 0x60000000000000000000500000000032001f (h240 + 0x1000000005000000000020000 0x10000000005000000000100000000550000000004001c))) (.bin (.leaf8 + 0x55000f 0x630000000000001d 0x55000a 0x50008 + 0x600000000000000000001000000000100000000000000000000001e 0x10009 0x20021 0x51000000004e0016) + (.leaf8 0x4d000000004e0016 0x50000000049001a 0x4a00000000490016 0x30014 0x4c0010 0x10021 + 0x4700000000060016 0x30014))))) (.bin (.bin (.bin (.bin (.leaf8 0x490010 0x10021 + 0x1f0000000043001a 0x4400000000430016 0x20014 + 0x300000000040000000000000000000200000000460000000000001f 0x460009 0x10021) (.leaf8 + 0x40000000040001a 0x5000000003f0016 0x3f0014 0x70010 0x10021 0xa0000000003d001a 0x3c0016 + 0x15000000003a001a)) (.bin (.leaf8 0x3b000000003a0016 0x20014 + 0x39000000000400000000000000000002000000003d0000000000001f 0x3d0009 0x20021 0x3240000000037001a + 0x360016 0x16) (.leaf8 0x3600000000010016 0x6d0000000034001a 0x330016 0x3300000000010016 + 0xfb90000000031001a 0x300016 0x3000000000030016 0x226000000002e001a))) (.bin (.bin (.leaf8 + 0x2d0016 0x16 0x2d00000000010016 0x4ea1000000002b001a 0x2c000000002b0016 0xac20000000028001a + 0x2900000000280016 0x270014) (.leaf8 0x2b0010 0x10021 0x1892b0000000025001a 0x230016 + 0x2400000000010016 0x35ce0000000022001a 0x2300000000220016 0x7adda000000001f001a)) (.bin (.leaf8 + 0x6000000001d0016 0x10d0c000000001c001a 0x1b0016 0x500000000010016 0x2665430000000019001a 0x180016 + 0x16 0x1800000000010016) (.leaf8 0x5413f0000000016001a 0x1700000000160016 0x14 0x190010 0x10021 + 0x1500000000000016 0xbffa530000000013001a 0x110016)))) (.bin (.bin (.bin (.leaf8 + 0x1200000000010016 0x1a463e0000000010001a 0x1000000000100016 0xf00000000040016 + 0x3bfe3a5000000000d001a 0xe000000000d0016 0x835f36000000000a001a 0xa000000000a0016) (.leaf8 + 0x12bf724b0000000007001a 0x600000000060016 0x290dbf20000000004001a 0x400000000040016 + 0x5dbd3bc00000000001001a 0x200000000010016 0x14 0x20000000000000000000100000000040000000000001f)) + (.bin (.leaf8 0x30023 0x3000d 0x200000000020000000001000cd44b8b000000000000000000010020 0x50010 + 0x40021 0x17 0x1d 0x103c3) (.leaf8 (h240 0xcd44b8e000000000300000000010000 + 0x5000cd44b8c0000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000300000000000050e8f032000000000000000000010020) + 0x5000000000000000000060000000002001f 0x50023 0x5000d + 0x60000000000000290dbf1000000000100000000010020 0x7000000000000000000080000000003001f))) (.bin + (.bin (.leaf8 0x100000000090023 0x800000000000012bf724a000000000200000000000020 + 0xa0000000000000000000c0000000006001f 0xb0023 0xb000d + 0xb00000000000000835f35000000000300000000010020 0xc000000000000000000100000000008001f 0xf0023) + (.leaf8 0xf000d 0xd00000000000003bfe3a4000000000400000000010020 + 0xe000000000000000000110000000002001f 0x100023 0x10000d 0xe00000000000000000012000000000a001f + 0x110023 0x11000d)) (.bin (.leaf8 0xf000000000000001a463d000000000500000000010020 + 0x10000000000000000000140000000000001f 0x130023 0x13000d 0x1000000000000000000002000000000a001f + 0x100000000020023 0x1200000000000000bffa52000000000600000000000020 0x17000e) (.leaf8 (h240 0x10000 + 0x10000000002000000000100000000190000000003001c) 0x19000f + 0x1600000000000000000019000000000c0000000001001e 0x180023 0x18000d + 0x170000000000000005413e000000000700000000010020 0x180000000000000000001a0000000000001f + 0x190023)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 0x19000d 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x1a00000000000000000001000000000e0000000001001e 0x100000000020023 + 0x1c00000000000000266542000000000800000000000020 0x1e000000000000000000070000000000001f) (.leaf8 + 0x60023 0x6000d 0x1f000000000000000000020000000011001f 0x100000000030023 + 0x2100000000000000010d0b000000000900000000000020 0x23000000000000000000080000000012001f + 0x100000000080023 0x250000000000000007add9000000000a00000000000020)) (.bin (.leaf8 + 0x27000000000000000000250000000016001f 0x240023 0x24000d + 0x28000000000000000035cd000000000b00000000010020 0x29000000000000000000260000000000001f 0x250023 + 0x25000d 0x29000000000000000000020000000016001f) (.leaf8 0x100000000020023 + 0x2b0000000000000001892a000000000c00000000000020 0x29000e + 0x2d0000000000000000002b00000000190000000000001e 0x2a0023 0x2a000d + 0x2e00000000000000000ac1000000000d00000000010020 0x2f0000000000000000002e000000001c001f))) (.bin + (.bin (.leaf8 0x2d0023 0x2d000d 0x3000000000000000004ea0000000000e00000000010020 + 0x310000000000000000002f0000000000001f 0x2e0023 0x2e000d 0x2000e + 0x10000000000000000000100000000010000000002001c) (.leaf8 0x1000f + 0x3300000000000000000001000000001c0000000001001e 0x100000000020023 + 0x3500000000000000000225000000000f00000000000020 0x37000000000000000000320000000001001f (h240 + 0x10000 0x3300000000010000000000000000000100000000010000000003001c) 0x1000f + 0x3800000000000000000001000000001e0000000001001e)) (.bin (.leaf8 0x100000000020023 + 0x3a00000000000000000fb8000000001000000000000020 0x3c000000000000000000350000000000001f 0x340023 + 0x34000d 0x3c000000000000000000020000000021001f 0x100000000030023 + 0x3e0000000000000000006c000000001100000000000020) (.leaf8 0x40000000000000000000380000000000001f + 0x370023 0x37000d 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x420000000000000000000100000000220000000001001e 0x100000000020023)))) (.bin (.bin (.bin (.leaf8 + 0x4400000000000000000323000000001200000000000020 0x3b000e + 0x100000000050000000001000000003d0000000002001c 0x3d000f + 0x470000000000000000003d00000000230000000001001e 0x3c0023 0x3c000d + 0x4800000000000000000014000000001300000000010020) (.leaf8 0x49000000000000000000020000000027001f + 0x100000000030023 0x4b0000000000000000009f000000001400000000000020 0x41000e + 0x4d0000000000000000000700000000280000000000001e 0x100000000080023 + 0x4f00000000000000000003000000001500000000000020 0x5000e)) (.bin (.leaf8 + 0x10000000005000000000100000000460000000002001c 0x46000f + 0x530000000000000000004600000000290000000001001e 0x450023 0x45000d + 0x540000000000000000001e000000001600000000010020 0x5000e + 0x560000000000000000004900000000020000000000001e) (.leaf8 (h240 0x1000000004a00000000010000 + 0x100000000050000000001000000004c0000000004001c) 0x4c000f + 0x590000000000000000004c000000002e0000000001001e 0x4b0023 0x4b000d + 0x5a00000000000000000004000000001800000000010020 0x5b0000000000000000004f0000000033001f (h240 + 0x10000 0x5000000000010000000000000000000100000000520000000003001c)))) (.bin (.bin (.leaf8 + 0x52000f 0x5d0000000000000000005200000000320000000001001e (h240 + 0x100000000530000000001000000000000000000010000 + 0x200000000010000000007000000000100000000010000000005001c) 0x1000f + 0x610000000000000000000100000000350000000001001e 0x70000000001000b 0x16 0x510016) (.leaf8 + 0x4e000000004e0016 0x2000000004c001a 0x5000000004b0016 0x4a0014 0x70010 0x10021 0x4800000000040016 + 0xf0000000046001a)) (.bin (.leaf8 0x500000000450016 0x4500000000040016 0x10000000043001a 0x420016 + 0x4200000000060016 0x4f0000000040001a 0x4100000000400016 0x30014) (.leaf8 0x430010 0x10021 + 0xa000000003d001a 0x3e000000003d0016 0x3c00000000030016 0x191000000003a001a 0x3b000000003a0016 + 0x20014))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x3000000000400000000000000000002000000003d0000000000001f 0x3d0009 0x10021 0x360000000037001a + 0x3800000000370016 0x30014 0x3a0010 0x10021) (.leaf8 0x7dc0000000034001a 0x3500000000340016 + 0x20014 0x3300000000040000000000000000000200000000370000000000001f 0x370009 0x20021 + 0x1120000000031001a 0x3200000000310016)) (.bin (.leaf8 0x20014 + 0x300000000040000000000000000000200000000340000000000001f 0x340009 0x10021 0x2751000000002e001a + 0x2d000000002d0016 0x560000000002b001a 0x2c000000002b0016) (.leaf8 0xc4950000000028001a + 0x2900000000280016 0x14 0x2b0010 0x10021 0x2700000000000016 0x1ae70000000025001a + 0x2400000000240016))) (.bin (.bin (.leaf8 0x3d6ec0000000022001a 0x210016 0x80014 0x20010 0x10021 + 0x8685000000001f001a 0x20000000001f0016 0x30014) (.leaf8 0x220010 0x10021 0x1e00000000060016 + 0x1332a0000000001c001a 0x1d000000001c0016 0x20014 + 0x3000000000400000000000000000002000000001f0000000000001f 0x1f0009)) (.bin (.leaf8 0x10021 + 0x2a0a00000000019001a 0x200000000180016 0x180014 0x40010 0x10021 0x5ffd290000000016001a 0x150016) + (.leaf8 0x20014 0x20010 0x10021 0xd231f0000000013001a 0x1300000000130016 0x1dff1d30000000010001a + 0xf000000000f0016 0x41af9a000000000d001a)))) (.bin (.bin (.bin (.leaf8 0xd000000000d0016 + 0x95fb925000000000a001a 0x90016 0x1486df90000000007001a 0x700000000070016 0x2ede9de00000000004001a + 0x300000000030016 0x66a25c60000000001001a) (.leaf8 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x20000000002000000000100066a25c5000000000000000000010020 + 0x20000000003000000000100000000050000000001001f 0x100000000060023)) (.bin (.leaf8 + 0x200000000040000000001002ede9ddf000000000100000000000020 + 0x20000000006000000000100000000090000000004001f 0x80023 0x8000d + 0x2000000000700000000010001486df8000000000200000000010020 + 0x20000000008000000000100000000020000000005001f 0x100000000030023 + 0x2000000000a000000000100095fb924000000000300000000000020) (.leaf8 + 0x2000000000c0000000001000000000f0000000008001f 0xe0023 0xe000d + 0x2000000000d0000000001000041af99000000000400000000010020 + 0x2000000000e000000000100000000110000000009001f 0x100000000120023 + 0x2000000000f000000000100012e2795000000000500000000000020 + 0x20000000011000000000100000000140000000003001f))) (.bin (.bin (.leaf8 (h240 0x100000000000000 + 0x100000000120000000000000000001400000000060000000000001e) 0x130023 0x13000d + 0x1300000000000000b1ca3b000000000500000000010020 0x1300000000000000000015000000000c001f 0x140023 + 0x14000d 0x14000000000000000d231e000000000600000000010020) (.leaf8 0x4000e + 0x1600000000000000000002000000000c0000000000001e 0x100000000030023 + 0x18000000000000005ffd28000000000700000000000020 0x1a000e + 0x1a00000000000000000004000000000e0000000000001e 0x100000000050023 + 0x1c0000000000000002a09f000000000800000000000020)) (.bin (.leaf8 0x5000e + 0x100000000050000000001000000001f0000000002001c 0x1f000f + 0x200000000000000000001f000000000f0000000001001e 0x1e0023 0x1e000d + 0x210000000000000013329f000000000900000000010020 0x22000000000000000000200000000003001f) (.leaf8 + (h240 0x1000000002100000000010000 0x10000000005000000000100000000220000000004001c) 0x22000f + 0x240000000000000000002200000000120000000001001e 0x210023 0x21000d + 0x2500000000000000008684000000000a00000000010020 0xa000e + 0x270000000000000000000200000000140000000000001e)))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.bin + (.leaf8 0x100000000030023 0x290000000000000003d6eb000000000b00000000000020 + 0x2b000000000000000000260000000017001f 0x100000000270023 + 0x2c00000000000000001ae6000000000c00000000000020 0x29000e (h240 0x10000 + 0x100000000020000000001000000002b0000000003001c) 0x2b000f) (.leaf8 + 0x300000000000000000002b00000000180000000001001e 0x2a0023 0x2a000d + 0x310000000000000000c494000000000d00000000010020 0x320000000000000000002e000000001c001f 0x2d0023 + 0x2d000d 0x330000000000000000055f000000000e00000000010020)) (.bin (.leaf8 + 0x340000000000000000002f000000001d001f 0x100000000300023 + 0x3500000000000000002750000000000f00000000000020 0x5000e + 0x10000000005000000000100000000340000000002001c 0x34000f + 0x3900000000000000000034000000001d0000000001001e 0x330023) (.leaf8 0x33000d + 0x3a00000000000000000111000000001000000000010020 0x35000e + 0x10000000005000000000100000000370000000002001c 0x37000f + 0x3c00000000000000000037000000001f0000000001001e 0x360023 0x36000d))) (.bin (.bin (.leaf8 + 0x3d000000000000000007db000000001100000000010020 0x5000e + 0x3f0000000000000000003a00000000230000000000001e 0x390023 0x39000d + 0x4000000000000000000035000000001200000000010020 0x5000e + 0x100000000050000000001000000003d0000000002001c) (.leaf8 0x3d000f + 0x430000000000000000003d00000000230000000001001e 0x3c0023 0x3c000d + 0x4400000000000000000190000000001300000000010020 0x450000000000000000003e0000000001001f (h240 + 0x10000 0x3f000000000100000000000000000001000000003f0000000003001c) 0x3f000f)) (.bin (.leaf8 + 0x460000000000000000003f00000000270000000001001e 0x3e0023 0x3e000d + 0x4700000000000000000009000000001400000000010020 0x5000e + 0x490000000000000000004300000000290000000000001e 0x420023 0x42000d) (.leaf8 + 0x4a0000000000000000004e000000001500000000010020 0x4b000000000000000000440000000003001f (h240 + 0x10000 0x4500000000010000000000000000000100000000010000000003001c) 0x1000f + 0x4c00000000000000000001000000002a0000000001001e 0x100000000020023 + 0x4e00000000000000000000000000001600000000000020 0x4f000000000000000000470000000002001f)))) (.bin + (.bin (.bin (.leaf8 0x460023 0x46000d 0x5000000000000000000007000000002d001f 0x100000000080023 + 0x520000000000000000000e000000001700000000000020 0x540000000000000000004a0000000002001f 0x490023 + 0x49000d) (.leaf8 0x4c000e 0x550000000000000000000700000000300000000000001e 0x100000000080023 + 0x5700000000000000000001000000001900000000000020 0x59000000000000000000500000000033001f (h240 + 0x10000 0x5100000000010000000000000000000100000000010000000003001c) 0x1000f + 0x5a0000000000000000000100000000340000000001001e)) (.bin (.leaf8 (h240 + 0x100000000020000000001000000000000000000010000 + 0x200000000010000000000000000000100000000080000000005001c) 0x20186 0x10043 0x80142 0x101c3 0x90023 + 0x1600c6 0x10043) (.leaf8 0x10303 0x10009 0x8 0x10009 0x10021 0x16 0x16 0x1000000004f001a))) (.bin + (.bin (.leaf8 0x4e0016 0x4d00000000060016 0x70000000049001a 0x4a00000000490016 0x80014 0x4c0010 + 0x10021 0x4700000000460016) (.leaf8 0x20014 + 0x4500000000040000000000000000000200000000490000000000001f 0x490009 0x20021 0x270000000043001a + 0x4400000000430016 0x4200000000040016 0x40000000040001a)) (.bin (.leaf8 0x4000000000400016 + 0x3f0014 0x420010 0x10021 0xc8000000003d001a 0x3e000000003d0016 0x600000000030016 + 0x1b000000003a001a) (.leaf8 0x600000000390016 0x3ee0000000037001a 0x500000000360016 + 0x890000000034001a 0x3500000000340016 0x600000000030016 0x13a80000000031001a 0x300016))))) (.bin + (.bin (.bin (.bin (.leaf8 0x2b0000000002e001a 0x2f000000002e0016 0x624a000000002b001a + 0x2c000000002b0016 0x16 0xd730000000028001a 0x2900000000280016 0x270014) (.leaf8 0x2b0010 0x10021 + 0x1eb750000000025001a 0x2600000000250016 0x30014 0x280010 0x10021 0x2400000000090016)) (.bin + (.leaf8 0x43420000000022001a 0x500000000210016 0x210014 0x70010 0x10021 0x99950000000001f001a + 0x5000000001e0016 0x1e00000000040016) (.leaf8 0x1504f000000001c001a 0x1b0016 0x1b00000000030016 + 0x2ffe940000000019001a 0x180016 0x500000000010016 0x6918f0000000016001a 0x1600000000160016))) + (.bin (.bin (.leaf8 0xeff8e90000000013001a 0x120016 0x20d7cd0000000010001a 0x1000000000100016 + 0x4afdc92000000000d001a 0xc0016 0xc00000000010016 0xa436fc000000000a001a) (.leaf8 + 0x900000000080016 0x176f4eef0000000007001a 0x60016 0x33512e30000000004001a 0x400000000040016 + 0x752c8aa30000000001001a 0x200000000010016 0x14)) (.bin (.leaf8 + 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x2000000000200000000010010095e53000000000000000000010020 0x50010 0x40021 0x17 0x1d) (.leaf8 + 0x103c3 (h240 0x10095e56000000000300000000010000 + 0x50010095e540000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000300000000000065232c4d000000000000000000010020) + 0x5000000000000000000060000000002001f 0x50023 0x5000d + 0x6000000000000033512e2000000000100000000010020)))) (.bin (.bin (.bin (.leaf8 + 0x7000000000000000000020000000003001f 0x100000000030023 + 0x9000000000000176f4eee000000000200000000000020 0xb0000000000000000000b0000000004001f + 0x1000000000b0023 0xd00000000000000a436fb000000000300000000000020 + 0xf0000000000000000000e0000000000001f 0xd0023) (.leaf8 0xd000d + 0xf000000000000000000020000000007001f 0x100000000030023 + 0x1100000000000004afdc91000000000400000000000020 0x1300000000000000000012000000000a001f 0x110023 + 0x11000d 0x140000000000000020d7cc000000000500000000010020)) (.bin (.leaf8 + 0x1500000000000000000002000000000b001f 0x100000000030023 + 0x1700000000000000eff8e8000000000600000000000020 0x1900000000000000000018000000000e001f 0x170023 + 0x17000d 0x1a0000000000000006918e000000000700000000010020 0x1b000000000000000000070000000000001f) + (.leaf8 0x60023 0x6000d 0x1c00000000000000000002000000000f001f 0x100000000030023 + 0x1e000000000000002ffe93000000000800000000000020 0x200000000000000000001d0000000001001f (h240 + 0x10000 0x1e00000000010000000000000000000100000000010000000003001c) 0x1000f))) (.bin (.bin (.leaf8 + 0x210000000000000000000100000000100000000001001e 0x100000000020023 + 0x230000000000000001504e000000000900000000000020 0x25000000000000000000200000000002001f 0x1f0023 + 0x1f000d 0x25000000000000000000070000000013001f 0x100000000080023) (.leaf8 + 0x270000000000000009994f000000000a00000000000020 0x23000e + 0x290000000000000000000700000000140000000000001e 0x100000000080023 + 0x2b00000000000000004341000000000b00000000000020 0x2d000000000000000000260000000005001f (h240 + 0x1000000002700000000010000 0x10000000005000000000100000000280000000004001c) 0x28000f)) (.bin + (.leaf8 0x2f0000000000000000002800000000160000000001001e 0x270023 0x27000d + 0x300000000000000001eb74000000000c00000000010020 0x29000e + 0x310000000000000000002b00000000190000000000001e 0x2a0023 0x2a000d) (.leaf8 + 0x3200000000000000000d72000000000d00000000010020 0x2000e + 0x100000000000000000001000000002d0000000002001c 0x2d000f + 0x350000000000000000002d000000001b0000000001001e 0x2c0023 0x2c000d + 0x3600000000000000006249000000000e00000000010020)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x3700000000000000000031000000001e001f 0x300023 0x30000d + 0x38000000000000000002af000000000f00000000010020 0x3900000000000000000002000000001f001f + 0x100000000030023 0x3b000000000000000013a7000000001000000000000020 + 0x3d000000000000000000080000000001001f) (.leaf8 (h240 0x10000 + 0x900000000010000000000000000000100000000360000000003001c) 0x36000f + 0x3f0000000000000000003600000000210000000001001e 0x350023 0x35000d + 0x4000000000000000000088000000001100000000010020 0x41000000000000000000070000000023001f + 0x100000000080023)) (.bin (.leaf8 0x43000000000000000003ed000000001200000000000020 + 0x45000000000000000000080000000025001f 0x100000000090023 + 0x470000000000000000001a000000001300000000000020 0x49000000000000000000080000000001001f (h240 + 0x10000 0x9000000000100000000000000000001000000003f0000000003001c) 0x3f000f + 0x4b0000000000000000003f00000000270000000001001e) (.leaf8 0x3e0023 0x3e000d + 0x4c000000000000000000c7000000001400000000010020 0x41000e + 0x4d0000000000000000004200000000290000000000001e 0x410023 0x41000d + 0x4e00000000000000000003000000001500000000010020))) (.bin (.bin (.leaf8 + 0x4f000000000000000000440000000002001f 0x430023 0x43000d 0x4f00000000000000000046000000002c001f + 0x450023 0x45000d 0x5000000000000000000026000000001600000000010020 0x47000e) (.leaf8 + 0x10000000005000000000100000000490000000002001c 0x49000f + 0x5200000000000000000049000000002b0000000001001e 0x480023 0x48000d 0xa000e + 0x540000000000000000004c000000002f0000000000001e 0x4b0023)) (.bin (.leaf8 0x4b000d + 0x5500000000000000000006000000001800000000010020 0x560000000000000000004f0000000003001f (h240 + 0x10000 0x5000000000010000000000000000000100000000010000000003001c) 0x1000f + 0x580000000000000000000100000000320000000001001e 0x100000000020023 + 0x5a00000000000000000000000000001a00000000000020) (.leaf8 0x2000e (h240 + 0x100000000000000000001000000000200000000010000 0x10000000001000000000100000000010000000005001c) + 0x1000f 0x600000000000000000000100000000030000000001001e 0x10000000000000b 0x20014 0x1000e + 0x800c6)))) (.bin (.bin (.bin (.leaf8 0x10043 0x40142 0x101c3 0x50009 0x10186 0x5c0000000000001d + 0x3000f 0x5b0000000000001d) (.leaf8 0x20023 0x2000d 0x5c000000000000000000060000000000001f + 0x40000000006000b 0x510016 0x16 0x4e000000004e0016 0x3000000004c001a)) (.bin (.leaf8 + 0xb000000004b0016 0x500000000480016 0x140000000046001a 0x4500000000450016 0x20000000043001a + 0x4200000000410016 0x640000000040001a 0x3e0016) (.leaf8 0x3f00000000070016 0xc000000003d001a + 0x3e000000003d0016 0x90014 0x400010 0x10021 0x1f6000000003a001a 0x3b000000003a0016))) (.bin (.bin + (.leaf8 0x80014 0x3d0010 0x10021 0x440000000037001a 0x3700000000370016 0x90014 0x390010 0x10021) + (.leaf8 0x9d30000000034001a 0x3500000000340016 0x30014 0x370010 0x10021 0x1580000000031001a + 0x3000000000300016 0x3124000000002e001a)) (.bin (.leaf8 0x2e000000002e0016 0x30014 0x300010 + 0x10021 0x6b9000000002b001a 0x2c000000002b0016 0xf5bb0000000028001a 0x500000000270016) (.leaf8 + 0x270014 0x70010 0x10021 0x21a00000000025001a 0x2600000000250016 0x80014 0x280010 0x10021))))) + (.bin (.bin (.bin (.bin (.leaf8 0x4cca80000000022001a 0x210016 0x2100000000060016 + 0xa827000000001f001a 0x1e0016 0x16 0x17ff4a000000001c001a 0x1b0016) (.leaf8 0x800000000010016 + 0x348c70000000019001a 0x1900000000190016 0x77fc740000000016001a 0x150016 0x1500000000010016 + 0x106be60000000013001a 0x1200000000110016)) (.bin (.leaf8 0x257ee480000000010001a 0xf0016 + 0xf00000000010016 0x521b7d000000000d001a 0xe000000000d0016 0x14 0x100010 0x10021) (.leaf8 + 0xc00000000090016 0xbb7a776000000000a001a 0xb000000000a0016 0x30014 0xd0010 0x10021 + 0x19a89710000000007001a 0x700000000070016))) (.bin (.bin (.leaf8 0x3a9645510000000004001a + 0x500000000040016 0x804af2b0000000001001a 0x3001d + 0x100000000010000000001000804af2a000000000000000000000020 + 0x20000000005000000000100000000070000000002001f 0x60023 0x6000d) (.leaf8 + 0x200000000060000000001003a964550000000000100000000010020 + 0x20000000007000000000100000000090000000004001f 0x80023 0x8000d + 0x20000000008000000000100019a8970000000000200000000010020 0x5000e + 0x2000000000a0000000001000000000d00000000050000000000001e 0xc0023)) (.bin (.leaf8 0xc000d + 0x2000000000b0000000001000bb7a775000000000300000000010020 + 0x2000000000c0000000001000000000e0000000005001f (h240 0x1000000000f00000000010000 + 0x10000000002000000000100000000100000000004001c) 0x10000f + 0x2000000000e0000000001000000001000000000060000000001001e 0xf0023 0xf000d) (.leaf8 + 0x2000000000f00000000010000521b7c000000000400000000010020 + 0x20000000010000000000100000000110000000000001f 0x100023 0x10000d + 0x20000000010000000000100000000020000000009001f 0x100000000030023 + 0x200000000120000000001000179b183000000000500000000000020 + 0x20000000014000000000100000000140000000008001f)))) (.bin (.bin (.bin (.leaf8 0x140009 0x150021 + 0x17 0x1d 0x103c3 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x124ef5ace0000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x5000804af2a000000000600000000010000000008003a9645510000) + 0x90000000001000000000a00019a8971000000000c00000000010000) + 0x60000000001000000000e000bb7a777000000000f00000000010000) + 0x10000000002000000000100000000110000521b7e0000) + 0x12000000000100000000030000000001000000000000000000010000) + 0x14000179b1830000000015000000000100000000140000000015001c) 0x14000f (h240 0x20000 + 0x10000000001000000000200000000140000000000001d)) (.leaf8 0x130023 0x13000d + 0x1600000000000000de3cc2000000000500000000010020 0x1600000000000000000014000000000a001f + 0x100000000140023 0x1800000000000000106be5000000000600000000000020 + 0x1a000000000000000000170000000000001f 0x160023)) (.bin (.leaf8 0x16000d + 0x1a00000000000000000002000000000d001f 0x100000000030023 + 0x1c0000000000000077fc73000000000700000000000020 0x1e0000000000000000001b0000000010001f 0x1a0023 + 0x1a000d 0x1f000000000000000348c6000000000800000000010020) (.leaf8 + 0x200000000000000000000a0000000000001f 0x90023 0x9000d 0x21000000000000000000020000000011001f + 0x100000000030023 0x230000000000000017ff49000000000900000000000020 0x2000e + 0x10000000000000000000100000000010000000002001c))) (.bin (.bin (.leaf8 0x1000f + 0x270000000000000000000100000000120000000001001e 0x100000000020023 + 0x290000000000000000a826000000000a00000000000020 0x2b000000000000000000230000000003001f (h240 + 0x10000 0x2400000000010000000000000000000100000000010000000003001c) 0x1000f + 0x2c0000000000000000000100000000140000000001001e) (.leaf8 0x100000000020023 + 0x2e0000000000000004cca7000000000b00000000000020 0xa000e + 0x310000000000000000002800000000170000000000001e 0x270023 0x27000d + 0x320000000000000000219f000000000c00000000010020 0x29000e)) (.bin (.leaf8 + 0x330000000000000000000700000000180000000000001e 0x100000000080023 + 0x350000000000000000f5ba000000000d00000000000020 0x370000000000000000002e000000001c001f 0x2d0023 + 0x2d000d 0x38000000000000000006b8000000000e00000000010020 0x5000e) (.leaf8 + 0x3a00000000000000000030000000001d0000000000001e 0x2f0023 0x2f000d + 0x3b00000000000000003123000000000f00000000010020 0x3c00000000000000000032000000001f001f + 0x100000000330023 0x3d00000000000000000157000000001000000000000020 0x5000e))))))) (.bin (.bin + (.bin (.bin (.bin (.bin (.leaf8 0x400000000000000000003700000000210000000000001e 0x360023 0x36000d + 0x41000000000000000009d2000000001100000000010020 0xb000e + 0x430000000000000000003900000000230000000000001e 0x380023 0x38000d) (.leaf8 + 0x4400000000000000000043000000001200000000010020 0xa000e + 0x460000000000000000003d00000000250000000000001e 0x3c0023 0x3c000d + 0x47000000000000000001f5000000001300000000010020 0xb000e + 0x490000000000000000004000000000270000000000001e)) (.bin (.leaf8 0x3f0023 0x3f000d + 0x4a0000000000000000000b000000001400000000010020 0x4b000000000000000000410000000004001f 0x400023 + 0x40000d 0x4b000000000000000000020000000028001f 0x100000000020023) (.leaf8 + 0x4d00000000000000000063000000001500000000000020 0x4f00000000000000000044000000002a001f + 0x100000000440023 0x5100000000000000000001000000001600000000000020 + 0x5300000000000000000047000000002d001f 0x100000000480023 + 0x5400000000000000000013000000001700000000000020 0x5600000000000000000007000000002f001f))) (.bin + (.bin (.leaf8 (h240 0x10000 0x8000000000100000000000000000001000000000c0000000003001c) 0xc000f + 0x580000000000000000000c00000000300000000001001e 0x1000000000d0023 + 0x5a00000000000000000002000000001900000000000020 0x5c000000000000000000500000000033001f (h240 + 0x100000000510000000001000000000000000000010000 + 0x200000000010000000000000000000100000000010000000005001c) 0x1000f) (.leaf8 + 0x5f0000000000000000000100000000340000000001001e (h240 0x10000 + 0x200000000010000000000000000000100000000050000000003001c) 0x5000f + 0x610000000000000000000500000000020000000001001e 0x4000b 0x16 0x16 0x1000000004f001a)) (.bin + (.leaf8 0x50000000004f0016 0xd0014 0x8000000000f0000000000000000000200000000520000000000001f + 0x520009 0x20021 0x90000000049001a 0x4a00000000490016 0x480014) (.leaf8 0x4c0010 0x10021 + 0x4700000000460016 0x14 0x490010 0x10021 0x4500000000420016 0x310000000043001a)))) (.bin (.bin + (.bin (.leaf8 0x420016 0x20014 0x20010 0x10021 0x60000000040001a 0x4100000000400016 + 0x3f000000000a0016 0xfa000000003d001a) (.leaf8 0x3e000000003d0016 0x3c00000000090016 + 0x21000000003a001a 0x3a000000003a0016 0x39000000000a0016 0x4e90000000037001a 0x600000000360016 + 0xab0000000034001a)) (.bin (.leaf8 0x3500000000340016 0x330014 0x370010 0x10021 + 0x18920000000031001a 0x6000000002f0016 0x35c000000002e001a 0x2f000000002e0016) (.leaf8 + 0x7add000000002b001a 0x2a0016 0x2a00000000060016 0x10d00000000028001a 0xb00000000270016 + 0x266530000000025001a 0x2600000000250016 0x20014))) (.bin (.bin (.leaf8 + 0x2400000000040000000000000000000200000000280000000000001f 0x280009 0x20021 0x54130000000022001a + 0x210016 0x16 0x2100000000010016 0xbffa4000000001f001a) (.leaf8 0x1e0016 0xb00000000010016 + 0x1a463000000001c001a 0x1c000000001c0016 0x3bfe390000000019001a 0x1a00000000190016 0x30014 + 0x1c0010)) (.bin (.leaf8 0x10021 0x835f30000000016001a 0x150016 0x140014 0x20010 0x10021 + 0x12bf7230000000013001a 0x1400000000130016) (.leaf8 0x30014 0x160010 0x10021 + 0x290dbf0000000010001a 0x2000000000f0016 0xf0014 0x40010 0x10021))))) (.bin (.bin (.bin (.bin + (.leaf8 0x5dbd3bb000000000d001a 0x6000000000c0016 0xcd44b8000000000a001a 0xa000000000a0016 + 0x1d4b22a80000000007001a 0x800000000070016 0x40257950000000004001a 0x30016) (.leaf8 0x20014 + 0x20010 0x10021 0x9277ad670000000001001a 0x3001d + 0x10000000001000000000100140bb63e000000000000000000000020 0x50010 0x60021)) (.bin (.leaf8 0x17 + 0x1d 0x103c3 (h240 (h240 0x140bb63f0000 0x3000000000100000000020000000002000000000000000000010000) + 0x500140bb63e0000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x200000000050000000000007e6bf726000000000000000000010020) + 0x4000e 0x80000000000000000000200000000000000000000001e) (.leaf8 0x100000000030023 + 0xa00000000000004025794000000000100000000000020 0xc0000000000000000000a0000000004001f 0x90023 + 0x9000d 0xd0000000000001d4b22a7000000000200000000010020 0xe0000000000000000000c0000000006001f + 0xb0023))) (.bin (.bin (.leaf8 0xb000d 0xf00000000000000cd44b7000000000300000000010020 + 0x10000000000000000000080000000007001f 0x100000000090023 + 0x1200000000000005dbd3ba000000000400000000000020 0x11000e + 0x140000000000000000000400000000080000000000001e 0x100000000050023) (.leaf8 + 0x1600000000000000290dbe000000000500000000000020 0x5000e + 0x1900000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x1a000000000000012bf722000000000600000000010020 0x16000e + 0x1c00000000000000000002000000000c0000000000001e)) (.bin (.leaf8 0x100000000030023 + 0x1e000000000000000835f2000000000700000000000020 0x5000e + 0x210000000000000000001c000000000f0000000000001e 0x1b0023 0x1b000d + 0x22000000000000003bfe38000000000800000000010020 0x230000000000000000001e0000000012001f) (.leaf8 + 0x1d0023 0x1d000d 0x240000000000000001a462000000000900000000010020 + 0x250000000000000000000d0000000000001f 0xc0023 0xc000d 0x26000000000000000000020000000013001f + 0x100000000030023)))) (.bin (.bin (.bin (.leaf8 0x28000000000000000bffa3000000000a00000000000020 + 0x2a000000000000000000230000000000001f 0x220023 0x22000d 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x2c0000000000000000000100000000140000000001001e) (.leaf8 0x100000000020023 + 0x2e00000000000000005412000000000b00000000000020 0x26000e + 0x10000000005000000000100000000280000000002001c 0x28000f + 0x310000000000000000002800000000150000000001001e 0x270023 0x27000d)) (.bin (.leaf8 + 0x3200000000000000026652000000000c00000000010020 0x330000000000000000000d0000000019001f + 0x1000000000e0023 0x35000000000000000010cf000000000d00000000000020 + 0x370000000000000000002c0000000003001f (h240 0x10000 + 0x2d00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x3800000000000000000001000000001a0000000001001e) (.leaf8 0x100000000020023 + 0x3a00000000000000007adc000000000e00000000000020 0x3c00000000000000000031000000001e001f 0x300023 + 0x30000d 0x3d0000000000000000035b000000000f00000000010020 0x3e00000000000000000008000000001e001f + 0x100000000080023))) (.bin (.bin (.leaf8 0x4000000000000000001891000000001000000000000020 0x35000e + 0x420000000000000000003700000000210000000000001e 0x360023 0x36000d + 0x43000000000000000000aa000000001100000000010020 0x44000000000000000000080000000023001f + 0x100000000090023) (.leaf8 0x46000000000000000004e8000000001200000000000020 + 0x480000000000000000003b0000000006001f 0x3a0023 0x3a000d 0x480000000000000000003c0000000026001f + 0x3b0023 0x3b000d 0x4900000000000000000020000000001300000000010020)) (.bin (.leaf8 + 0x4a0000000000000000003e0000000005001f (h240 0x10000 + 0x3f000000000100000000000000000001000000003f0000000003001c) 0x3f000f + 0x4b0000000000000000003f00000000270000000001001e 0x3e0023 0x3e000d + 0x4c000000000000000000f9000000001400000000010020 0x4d000000000000000000410000000006001f) (.leaf8 + 0x400023 0x40000d 0x4d00000000000000000043000000002a001f 0x420023 0x42000d + 0x4e00000000000000000005000000001500000000010020 0x4000e + 0x5000000000000000000002000000002a0000000000001e)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x100000000030023 0x5200000000000000000030000000001600000000000020 + 0x5400000000000000000047000000002b001f (h240 0x1000000004800000000010000 + 0x10000000002000000000100000000490000000004001c) 0x49000f + 0x5600000000000000000049000000002c0000000001001e 0x480023 0x48000d) (.leaf8 0x4a000e + 0x580000000000000000004c000000002f0000000000001e 0x4b0023 0x4b000d + 0x5900000000000000000008000000001800000000010020 0xa000e + 0x10000000010000000000100000000520000000002001c 0x52000f)) (.bin (.leaf8 + 0x5c0000000000000000005200000000310000000001001e 0x510023 0x51000d + 0x5d00000000000000000000000000001a00000000010020 0x2000e (h240 0x1000000000000000000010000 + 0x200000000010000000000000000000100000000010000000004001c) 0x1000f + 0x620000000000000000000100000000000000000001001e) (.leaf8 0x1000a 0x8 0x10009 0x10021 0x16 + 0x5400000000010016 0x1000000000510016 0x4e00000000090016))) (.bin (.bin (.leaf8 0x4000000004c001a + 0x4b000000004b0016 0x200000000480016 0x480014 0x40010 0x10021 0x180000000046001a 0x450016) (.leaf8 + 0x500000000010016 0x30000000043001a 0x4200000000420016 0x7d0000000040001a 0x3e0016 + 0x11000000003d001a 0x3c000000003b0016 0x274000000003a001a)) (.bin (.leaf8 0x390016 + 0x3900000000070016 0x550000000037001a 0x3600000000360016 0xc480000000034001a 0x3500000000340016 + 0x14 0x370010) (.leaf8 0x10021 0x3300000000060016 0x1ad0000000031001a 0x3200000000310016 + 0x3d6e000000002e001a 0x2d0016 0x16 0x868000000002b001a)))) (.bin (.bin (.bin (.leaf8 0x2a0016 + 0x2a000000000c0016 0x133290000000028001a 0x500000000270016 0x2a090000000025001a 0x2600000000250016 + 0x20014 0x300000000040000000000000000000200000000280000000000001f) (.leaf8 0x280009 0x10021 + 0x5ffd20000000022001a 0x210016 0xe00000000010016 0xd231000000001f001a 0x1f000000001f0016 + 0x1dff1c000000001c001a)) (.bin (.leaf8 0x1d000000001c0016 0x1b00000000040016 0x41af80000000019001a + 0x1a00000000190016 0x30014 0x1c0010 0x10021 0x1800000000150016) (.leaf8 0x95fb910000000016001a + 0x600000000150016 0x1486df0000000013001a 0x120016 0x1200000000030016 0x2ede9dd0000000010001a + 0xf0016 0xf00000000070016))) (.bin (.bin (.leaf8 0x66a25b000000000d001a 0xd000000000d0016 + 0xea59154000000000a001a 0x900000000090016 0x2012bc90000000007001a 0x800000000070016 0x30014 + 0xa0010) (.leaf8 0x10021 0x600000000030016 0x493bd6b20000000004001a 0x500000000040016 0x14 0x70010 + 0x10021 0x300000000000016)) (.bin (.leaf8 0xa05db1f0000000001001a 0x3001d + 0x100000000010000000001000a05db1e000000000000000000000020 0x5000e (h240 0x10000 + 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x200000000070000000001000000000700000000000000000001001e 0x60023) (.leaf8 0x6000d + 0x20000000008000000000100493bd6b1000000000100000000010020 + 0x20000000009000000000100000000080000000001001f (h240 0x1000000000900000000010000 + 0x100000000050000000001000000000a0000000004001c) 0xa000f + 0x2000000000b0000000001000000000a00000000020000000001001e 0x90023 0x9000d))))) (.bin (.bin (.bin + (.bin (.leaf8 0x2000000000c00000000010002012bc8000000000200000000010020 + 0x2000000000d0000000001000000000b0000000005001f 0x1000000000c0023 + 0x2000000000e0000000001000ea59153000000000300000000000020 + 0x200000000100000000001000000000f0000000008001f 0xe0023 0xe000d + 0x200000000110000000001000066a25a000000000400000000010020) (.leaf8 + 0x20000000012000000000100000000110000000004001f 0x100023 0x10000d + 0x20000000012000000000100000000020000000009001f 0x100000000030023 + 0x2000000001400000000010001d81dd1000000000500000000000020 + 0x20000000016000000000100000000140000000009001f 0x140009)) (.bin (.leaf8 0x170021 0x17 0x1d + 0x103c3 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x16e2b30d700000000030000000001000000000200000000020000 + 0x10000000005000a05db1f000000000600000000010000) 0x100000000020000000001000000000800493bd6b30000) + 0x9000000000100000000000000000001000000000500000000010000) + 0xb0002012bca000000000c0000000001000000000000000000010000) + 0xe000ea59153000000000f00000000010000000010000066a25c0000) + 0x12000000000100000000030000000001000000000000000000010000) + 0x140001d81dd10000000015000000000100000000130000000017001c) 0x13000d (h240 + 0x20000000000000000000100000000010000 0x200000000160000000000000115cc09000000000500000000010020) + 0x18000000000000000000140000000001001f) (.leaf8 (h240 0x10000 + 0x1500000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1900000000000000000001000000000a0000000001001e 0x100000000020023 + 0x1b000000000000001486de000000000600000000000020 0x1d00000000000000000008000000000d001f + 0x100000000090023 0x1f0000000000000095fb90000000000700000000000020))) (.bin (.bin (.leaf8 + 0x210000000000000000001a000000000d001f (h240 0x1000000001b00000000010000 + 0x100000000050000000001000000001c0000000004001c) 0x1c000f + 0x230000000000000000001c000000000e0000000001001e 0x1b0023 0x1b000d + 0x2400000000000000041af7000000000800000000010020 0x250000000000000000001d0000000002001f) (.leaf8 + 0x1c0023 0x1c000d 0x250000000000000000001f0000000012001f 0x1e0023 0x1e000d + 0x26000000000000001dff1b000000000900000000010020 0x27000000000000000000210000000014001f 0x200023)) + (.bin (.leaf8 0x20000d 0x280000000000000000d230000000000a00000000010020 + 0x29000000000000000000100000000000001f 0xf0023 0xf000d 0x2a000000000000000000020000000015001f + 0x100000000030023 0x2c0000000000000005ffd1000000000b00000000000020) (.leaf8 0x5000e + 0x10000000005000000000100000000280000000002001c 0x28000f + 0x300000000000000000002800000000150000000001001e 0x270023 0x27000d + 0x3100000000000000002a08000000000c00000000010020 0x32000000000000000000070000000019001f)))) (.bin + (.bin (.bin (.leaf8 0x100000000080023 0x3400000000000000013328000000000d00000000000020 + 0x360000000000000000002c0000000007001f (h240 0x10000 + 0x2d00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x3700000000000000000001000000001a0000000001001e 0x100000000020023 + 0x3900000000000000000867000000000e00000000000020) (.leaf8 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x3d00000000000000000001000000001c0000000001001e 0x100000000020023 + 0x3f00000000000000003d6d000000000f00000000000020 0x41000000000000000000340000000020001f 0x330023)) + (.bin (.leaf8 0x33000d 0x42000000000000000001ac000000001000000000010020 + 0x43000000000000000000350000000003001f (h240 0x1000000003600000000010000 + 0x10000000002000000000100000000370000000004001c) 0x37000f + 0x450000000000000000003700000000200000000001001e 0x360023 0x36000d) (.leaf8 + 0x4600000000000000000c47000000001100000000010020 0x47000000000000000000380000000023001f + 0x100000000390023 0x4800000000000000000054000000001200000000000020 + 0x4a0000000000000000003b0000000004001f 0x3a0023 0x3a000d 0x4a000000000000000000020000000025001f))) + (.bin (.bin (.leaf8 0x100000000030023 0x4c00000000000000000273000000001300000000000020 + 0x4e0000000000000000003e0000000026001f 0x1000000003e0023 + 0x5000000000000000000010000000001400000000000020 0x52000000000000000000020000000028001f + 0x100000000020023 0x540000000000000000007c000000001500000000000020) (.leaf8 + 0x5600000000000000000044000000002b001f 0x100000000450023 + 0x5700000000000000000002000000001600000000000020 0x59000000000000000000070000000000001f 0x60023 + 0x6000d 0x5a00000000000000000002000000002d001f 0x100000000030023)) (.bin (.leaf8 + 0x5c00000000000000000017000000001700000000000020 0x4a000e + 0x5e00000000000000000004000000002e0000000000001e (h240 0x10000 + 0x5000000000100000000000000000001000000004c0000000003001c) 0x4c000f + 0x600000000000000000004c00000000300000000001001e 0x1000000004d0023 + 0x6200000000000000000003000000001900000000000020) (.leaf8 0x64000000000000000000500000000005001f + (h240 0x10000 0x5100000000010000000000000000000100000000110000000003001c) 0x11000f + 0x650000000000000000001100000000340000000001001e (h240 0x10000 + 0x1200000000010000000000000000000100000000550000000003001c) 0x55000f 0x670000000000001d + 0x540023))))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x54000d 0x2000e (h240 + 0x10000 0x10000000001000000000100000000010000000003001c) 0x600c6 0x10043 0x10142 0x101c3 0x20009) + (.leaf8 0x30014 0x2000e 0x20186 0x10043 0x30142 0x101c3 0x40023 0xc00c6)) (.bin (.leaf8 0x10043 + 0x10303 0x10009 0x50008 0x10009 0x10021 0x5600000000010019 0x670000000000001d) (.leaf8 0x540023 + (h240 0x20000 0x10000000006000000000100000000010000000003009c) 0x1000f (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x321d48b40000 0x10000000001016e2b30d7000000000300000000010000) + 0x20000000002000000000000000000010000000005000a05db1f0000) + 0x6000000000100000000000000000001000000000200000000010000) + 0x800493bd6b300000000090000000001000000000000000000010000) + 0x50000000001000000000b0002012bca000000000c00000000010000) + 0x1000000000e000ea59153000000000f00000000010000) + 0x10000066a25c00000000120000000001000000000300000000010000) + 0x100000000140002ede9dd000000001500000000010000) 0x100000000020000000001000000000000000000010000) + 0x1700001486de00000000180000000001000000000900000000010000) + 0x1000000001a000095fb91000000001b00000000010000) 0x100000000050000000001000000001d0000041af90000) + 0x1e0000000001000000002000001dff1c000000002100000000010000) + 0x22000000d23100000000240000000001000000001100000000010000) + 0x30000000001000000000000000000010000000026000005ffd10000) + 0x27000000000100000000060000000001000000000500000000010000) + 0x290000002a09000000002a0000000001000000000800000000010000) + 0x1000000002c0000013329000000002d00000000010000) 0x100000000020000000001000000000000000000010000) + 0x2f000000086700000000300000000001000000000300000000010000) + 0x100000000020000000001000000000000000000010000) + 0x320000003d6d00000000330000000001000000003500000001ae0000) + 0x36000000000100000000000000000001000000000200000000010000) + 0x380000000c4900000000390000000001000000000000000000010000) + 0x3b0000000055000000003c0000000001000000000300000000010000) + 0x1000000003e0000000273000000003f00000000010000) + 0x3e000000000200000000000000000001000000004100000000100000) + 0x42000000000100000000020000000002000000000000000000010000) + 0x44000000007d00000000450000000001000000000000000000010000) + 0x47000000000200000000480000000001000000000800000000010000) + 0x3000000000100000000000000000001000000004a00000000180000) + 0x4b000000000100000000050000000001000000000000000000010000) + 0x4d000000000100000000000000000001000000005000000000040000) + 0x51000000000100000000000000000001000000001200000000010000) + 0x10000000055000000006800000000020000000000001d) 0x1000a 0x60008 + 0x700000000000000000001000000000100000000000000000000001e 0x80000000001000b))) (.bin (.bin (.leaf8 + 0x13 0x550008 (h240 0x10000 0x200000000010000000000000000000100000000090000000003001c) 0x20186 + 0x10043 0x90142 0x101c3 0xa0023) (.leaf8 0x1800c6 0x10043 0x10303 0x10009 0x8 0x10009 0x10021 + 0x5600000000000016)) (.bin (.leaf8 0x10019 0x660000000000001d 0x12000f 0x650000000000001d 0x110023 + 0x11000d 0x58000e (h240 0x10000 0x10000000001000000000100000000010000000003001c)) (.leaf8 0x1000f + 0x690000000000000000000100000000030000000001001e 0x1000a 0x10008 (h240 0x590000 + 0x200000000000000000002000000000100000000000000000000001e) 0x30000000001000b 0x590013 0x130008)))) + (.bin (.bin (.bin (.leaf8 (h240 0x510000 + 0x1400000000000000000002000000000100000000000000000000001e) 0x10009 0x20021 0x1000000004f001a + 0x50000000004f0016 0x4d0014 0x5000000004f0000000000000000000200000000520000000000001f 0x520009) + (.leaf8 0x20021 0xc0000000049001a 0x480016 0x800000000010016 0x10000000046001a 0x450016 + 0x3e0000000043001a 0x4400000000430016)) (.bin (.leaf8 0x14 0x460010 0x10021 0x4200000000000016 + 0x70000000040001a 0x4100000000400016 0x14 0x430010) (.leaf8 0x10021 0x3f000000003c0016 + 0x139000000003d001a 0x3c0016 0x3c00000000010016 0x2a000000003a001a 0x390016 0x6240000000037001a))) + (.bin (.bin (.leaf8 0x3800000000370016 0x16 0xd70000000034001a 0x3300000000330016 + 0x1eb60000000031001a 0x300016 0x16 0x3000000000010016) (.leaf8 0x433000000002e001a 0x2d0016 0x16 + 0x9994000000002b001a 0x2c000000002b0016 0x80014 0x2e0010 0x10021)) (.bin (.leaf8 + 0x15040000000028001a 0x2900000000280016 0x600000000030016 0x2ffe80000000025001a 0x2600000000250016 + 0x30014 0x280010 0x10021) (.leaf8 0x24000000000f0016 0x69180000000022001a 0x2100000000200016 + 0xeff8d000000001f001a 0x20000000001f0016 0x20d7c000000001c001a 0x1d000000001c0016 0x30016))))) + (.bin (.bin (.bin (.bin (.leaf8 0x4afdc80000000019001a 0x1a00000000190016 0x90014 0x1c0010 0x10021 + 0xa436f0000000016001a 0x150016 0x16) (.leaf8 0x176f4ee0000000013001a 0x1400000000130016 0x30014 + 0x160010 0x10021 0x33512e0000000010001a 0xf000000000e0016 0x752c8a9000000000d001a)) (.bin (.leaf8 + 0xc0016 0x10095e5000000000a001a 0x500000000090016 0x90014 0x70010 0x10021 0x249deb590000000007001a + 0x200000000060016) (.leaf8 0x60014 0x40010 0x10021 0x502ed8f0000000004001a 0x30016 0x20014 0x20010 + 0x10021))) (.bin (.bin (.leaf8 0xb715986b0000000001001a 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x20000000002000000000100190ea45f000000000000000000010020 (h240 0x100000000000000 + 0x100000000040000000000009e06f40a000000000000000000010020)) (.leaf8 0x4000e + 0x60000000000000000000200000000000000000000001e 0x100000000030023 + 0x80000000000000502ed8e000000000100000000000020 0x8000e + 0xa0000000000000000000400000000020000000000001e 0x100000000050023 + 0xc000000000000249deb58000000000200000000000020)) (.bin (.leaf8 0xb000e + 0xe0000000000000000000700000000040000000000001e 0x100000000080023 + 0x10000000000000010095e4000000000300000000000020 0x12000000000000000000020000000007001f + 0x100000000030023 0x140000000000000752c8a8000000000400000000000020 + 0x16000000000000000000110000000008001f) (.leaf8 0x100000000110023 + 0x180000000000000033512d000000000500000000000020 0x5000e + 0x1b00000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x1c0000000000000176f4ed000000000600000000010020 0x2000e)))) (.bin (.bin (.bin (.leaf8 + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x1f00000000000000000001000000000c0000000001001e 0x100000000020023 + 0x21000000000000000a436e000000000700000000000020 0xb000e + 0x240000000000000000001c000000000f0000000000001e 0x1b0023) (.leaf8 0x1b000d + 0x25000000000000004afdc7000000000800000000010020 0x26000000000000000000020000000001001f (h240 + 0x10000 0x3000000000100000000000000000001000000001e0000000003001c) 0x1e000f + 0x280000000000000000001e00000000110000000001001e 0x1d0023 0x1d000d)) (.bin (.leaf8 + 0x2900000000000000020d7b000000000900000000010020 0x2a000000000000000000220000000014001f 0x210023 + 0x21000d 0x2b000000000000000eff8c000000000a00000000010020 0x2c000000000000000000230000000014001f + 0x100000000230023 0x2e00000000000000006917000000000b00000000000020) (.leaf8 + 0x30000000000000000000260000000009001f (h240 0x1000000002700000000010000 + 0x10000000005000000000100000000280000000004001c) 0x28000f + 0x320000000000000000002800000000160000000001001e 0x270023 0x27000d + 0x330000000000000002ffe7000000000c00000000010020 0x34000000000000000000080000000001001f))) (.bin + (.bin (.leaf8 (h240 0x10000 0x9000000000100000000000000000001000000002a0000000003001c) 0x2a000f + 0x360000000000000000002a00000000190000000001001e 0x290023 0x29000d + 0x3700000000000000001503000000000d00000000010020 0xa000e + 0x390000000000000000002e000000001b0000000000001e) (.leaf8 0x2d0023 0x2d000d + 0x3a00000000000000009993000000000e00000000010020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x3d00000000000000000001000000001c0000000001001e 0x100000000020023)) (.bin (.leaf8 + 0x3f00000000000000000432000000000f00000000000020 0x41000000000000000000320000000000001f 0x310023 + 0x31000d 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x4300000000000000000001000000001e0000000001001e) (.leaf8 0x100000000020023 + 0x4500000000000000001eb5000000001000000000000020 0x47000000000000000000350000000021001f + 0x100000000360023 0x48000000000000000000d6000000001100000000000020 0x2000e + 0x10000000000000000000100000000390000000002001c 0x39000f)))))) (.bin (.bin (.bin (.bin (.bin + (.leaf8 0x4c0000000000000000003900000000230000000001001e 0x380023 0x38000d + 0x4d00000000000000000623000000001200000000010020 0x4e000000000000000000020000000025001f + 0x100000000030023 0x5000000000000000000029000000001300000000000020 + 0x520000000000000000003e0000000000001f) (.leaf8 0x3d0023 0x3d000d + 0x52000000000000000000020000000027001f 0x100000000030023 + 0x5400000000000000000138000000001400000000000020 0x56000000000000000000410000000027001f (h240 + 0x1000000004200000000010000 0x10000000002000000000100000000430000000004001c) 0x43000f)) (.bin + (.leaf8 0x580000000000000000004300000000280000000001001e 0x420023 0x42000d + 0x5900000000000000000006000000001500000000010020 0x44000e (h240 0x10000 + 0x10000000002000000000100000000460000000003001c) 0x46000f + 0x5c00000000000000000046000000002a0000000001001e) (.leaf8 0x450023 0x45000d + 0x5d0000000000000000003d000000001600000000010020 0x5e00000000000000000002000000002d001f + 0x100000000030023 0x6000000000000000000000000000001700000000000020 + 0x610000000000000000000a0000000000001f 0x90023))) (.bin (.bin (.leaf8 0x9000d + 0x6200000000000000000002000000002f001f 0x100000000030023 + 0x640000000000000000000b000000001800000000000020 0x7000e + 0x10000000050000000000100000000520000000002001c 0x52000f + 0x680000000000000000005200000000310000000001001e) (.leaf8 0x510023 0x51000d + 0x6900000000000000000000000000001a00000000010020 0x53000e + 0x10000000015000000000100000000010000000002001c 0x1000f + 0x6b0000000000000000000100000000370000000001001e (h240 0x10000 + 0x100000000020000000000000000000100000000040000000003001c))) (.bin (.leaf8 0x20186 0x10043 0x40142 + 0x101c3 0x50023 0xe00c6 0x10043 0x10303) (.leaf8 0x10009 0x8 (h240 0x10000 + 0x100000000000000000002000000000100000000000000000000001e) 0x10009 0x20021 0x5400000000130016 + 0x5300000000520016 0x8000000004e0016)))) (.bin (.bin (.bin (.leaf8 0x5000000004c001a + 0x4d000000004c0016 0x30014 0x4f0010 0x10021 0x4a00000000090016 0x30014 0x4c0010) (.leaf8 0x10021 + 0x1f0000000046001a 0x200000000450016 0x450014 0x40010 0x10021 0x30000000043001a + 0x4400000000430016)) (.bin (.leaf8 0x16 0x9c0000000040001a 0x4100000000400016 0x30014 0x430010 + 0x10021 0x15000000003d001a 0x3c0016) (.leaf8 0x3c00000000010016 0x311000000003a001a + 0x3a000000003a0016 0x30014 0x3c0010 0x10021 0x6b0000000037001a 0x360016))) (.bin (.bin (.leaf8 + 0xf5b0000000034001a 0x330016 0x16 0x3300000000010016 0x2190000000031001a 0x300016 0x16 + 0x3000000000010016) (.leaf8 0x4cc9000000002e001a 0x2f000000002e0016 0x2d00000000090016 + 0xa81000000002b001a 0x2b000000002b0016 0x90014 0x2d0010 0x10021)) (.bin (.leaf8 + 0x17ff40000000028001a 0x500000000270016 0x270014 0x70010 0x10021 0x348b0000000025001a + 0x2600000000250016 0x14) (.leaf8 0x280010 0x10021 0x2400000000210016 0x77fc60000000022001a + 0x2100000000210016 0x106bd000000001f001a 0x1f000000001f0016 0x30014))))) (.bin (.bin (.bin (.bin + (.leaf8 0x210010 0x10021 0x257ee4000000001c001a 0xc000000001b0016 0x521b70000000019001a 0x180016 + 0x16 0x1800000000010016) (.leaf8 0xbb7a760000000016001a 0x1700000000160016 0x1500000000040016 + 0x19a8960000000013001a 0x120016 0x110014 0x20010 0x10021)) (.bin (.leaf8 0x3a964540000000010001a + 0xf0016 0xf00000000010016 0x804af1000000000d001a 0xe000000000d0016 0x80014 0x100010 0x10021) + (.leaf8 0x124ef5ac000000000a001a 0xb000000000a0016 0x50014 0xd0010 0x10021 0x28176c70000000007001a + 0x800000000070016 0x30014))) (.bin (.bin (.leaf8 0xa0010 0x10021 0x600000000030016 + 0x5b8acc350000000004001a 0x300000000020016 0xc8752300000000001001a 0x16 0x14) (.leaf8 0x2000e + 0x10022 0x200000000020000000001000c87522f000000000000000000000020 + 0x20000000004000000000100000000050000000000001f 0x100000000050023 + 0x200000000060000000001005b8acc34000000000100000000000020 + 0x20000000008000000000100000000080000000001001f (h240 0x1000000000900000000010000 + 0x100000000050000000001000000000a0000000004001c))) (.bin (.leaf8 0xa000f + 0x2000000000a0000000001000000000a00000000020000000001001e 0x90023 0x9000d + 0x2000000000b000000000100028176c6000000000200000000010020 0x7000e + 0x2000000000d0000000001000000000d00000000050000000000001e 0xc0023) (.leaf8 0xc000d + 0x2000000000e000000000100124ef5ab000000000300000000010020 0xa000e + 0x200000000100000000001000000001000000000070000000000001e 0xf0023 0xf000d + 0x2000000001100000000010000804af0000000000400000000010020 + 0x20000000012000000000100000000110000000000001f)))) (.bin (.bin (.bin (.leaf8 0x100023 0x10000d + 0x20000000012000000000100000000020000000009001f 0x100000000030023 + 0x20000000014000000000100024e253f000000000500000000000020 + 0x20000000016000000000100000000140000000008001f (h240 0x100000000000000 + 0x100000000170000000000000000001400000000010000000000001e) 0x130023) (.leaf8 0x13000d + 0x18000000000000015b3f12000000000500000000010020 0x13000e + 0x1900000000000000000002000000000a0000000000001e 0x100000000030023 + 0x1b0000000000000019a895000000000600000000000020 0x1d000000000000000000170000000002001f 0x160023)) + (.bin (.leaf8 0x16000d 0x1d00000000000000000019000000000e001f 0x180023 0x18000d + 0x1e00000000000000bb7a75000000000700000000010020 0x1f0000000000000000001a0000000000001f 0x190023 + 0x19000d) (.leaf8 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x2100000000000000000001000000000e0000000001001e 0x100000000020023 + 0x23000000000000000521b6000000000800000000000020 0x250000000000000000000e0000000011001f + 0x1000000000f0023))) (.bin (.bin (.leaf8 0x2700000000000000257ee3000000000900000000000020 0x5000e + 0x2a0000000000000000002100000000130000000000001e 0x200023 0x20000d + 0x2b000000000000000106bc000000000a00000000010020 0x2c000000000000000000230000000015001f + 0x100000000240023) (.leaf8 0x2d00000000000000077fc5000000000b00000000000020 + 0x2f000000000000000000260000000015001f (h240 0x1000000002700000000010000 + 0x10000000002000000000100000000280000000004001c) 0x28000f + 0x310000000000000000002800000000160000000001001e 0x270023 0x27000d + 0x320000000000000000348a000000000c00000000010020)) (.bin (.leaf8 0x29000e + 0x330000000000000000000700000000180000000000001e 0x100000000080023 + 0x3500000000000000017ff3000000000d00000000000020 0xb000e + 0x380000000000000000002d000000001b0000000000001e 0x2c0023 0x2c000d) (.leaf8 + 0x3900000000000000000a80000000000e00000000010020 0x3a0000000000000000002f0000000005001f (h240 + 0x10000 0x3000000000010000000000000000000100000000300000000003001c) 0x30000f + 0x3b00000000000000000030000000001d0000000001001e 0x2f0023 0x2f000d + 0x3c00000000000000004cc8000000000f00000000010020))))))) (.bin (.bin (.bin (.bin (.bin (.bin + (.leaf8 0x3d000000000000000000320000000000001f 0x310023 0x31000d 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x3f00000000000000000001000000001e0000000001001e 0x100000000020023) (.leaf8 + 0x4100000000000000000218000000001000000000000020 0x43000000000000000000350000000000001f 0x340023 + 0x34000d 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x450000000000000000000100000000200000000001001e)) (.bin (.leaf8 0x100000000020023 + 0x4700000000000000000f5a000000001100000000000020 0x49000000000000000000020000000023001f + 0x100000000030023 0x4b0000000000000000006a000000001200000000000020 0x5000e + 0x4e0000000000000000003c00000000250000000000001e 0x3b0023) (.leaf8 0x3b000d + 0x4f00000000000000000310000000001300000000010020 0x500000000000000000003e0000000000001f 0x3d0023 + 0x3d000d 0x50000000000000000000020000000027001f 0x100000000030023 + 0x5200000000000000000014000000001400000000000020))) (.bin (.bin (.leaf8 0x5000e + 0x550000000000000000004300000000290000000000001e 0x420023 0x42000d + 0x560000000000000000009b000000001500000000010020 0x2000e + 0x10000000000000000000100000000450000000002001c 0x45000f) (.leaf8 + 0x5900000000000000000045000000002b0000000001001e 0x440023 0x44000d + 0x5a00000000000000000002000000001600000000010020 0x47000e + 0x5b00000000000000000004000000002c0000000000001e 0x100000000050023 + 0x5d0000000000000000001e000000001700000000000020)) (.bin (.leaf8 0x5000e + 0x600000000000000000004c00000000040000000000001e (h240 0x1000000004d00000000010000 + 0x100000000050000000001000000004f0000000004001c) 0x4f000f + 0x630000000000000000004f00000000300000000001001e 0x4e0023 0x4e000d + 0x6400000000000000000004000000001900000000010020) (.leaf8 0x650000000000000000000a0000000033001f + (h240 0x10000 0xb00000000010000000000000000000100000000540000000003001c) 0x54000f + 0x670000000000000000005400000000350000000001001e 0x530023 0x53000d + 0x6800000000000000000056000000000c001f 0x550023)))) (.bin (.bin (.bin (.leaf8 0x55000d 0x3000e + 0x10000000002000000000100000000010000000002001c 0x1000f 0x6b0000000000001d 0x20000000001000b + 0x5700000000020016 0x530016) (.leaf8 0x5100000000090016 0x2000000004f001a 0x5000000004e0016 + 0x4d0014 0x70010 0x10021 0x4b00000000040016 0xe0000000049001a)) (.bin (.leaf8 0x4a00000000490016 + 0x50014 0x4c0010 0x10021 0x20000000046001a 0x440016 0x4500000000010016 0x4d0000000043001a) (.leaf8 + 0x4400000000430016 0x4200000000040016 0x90000000040001a 0x4100000000400016 0x30014 0x430010 + 0x10021 0x189000000003d001a))) (.bin (.bin (.leaf8 0x6000000003b0016 0x35000000003a001a 0x390016 + 0x3900000000010016 0x7ac0000000037001a 0x3800000000370016 0x20014 + 0x3000000000400000000000000000002000000003a0000000000001f) (.leaf8 0x3a0009 0x10021 + 0x10c0000000034001a 0x3500000000340016 0x20014 + 0x300000000040000000000000000000200000000370000000000001f 0x370009 0x10021)) (.bin (.leaf8 + 0x26650000000031001a 0x2f0016 0x541000000002e001a 0xc000000002c0016 0xbff9000000002b001a + 0x2c000000002b0016 0x80014 0x2e0010) (.leaf8 0x10021 0x1a460000000028001a 0x200000000270016 + 0x270014 0x40010 0x10021 0x3bfe20000000025001a 0x2600000000250016))))) (.bin (.bin (.bin (.bin + (.leaf8 0x240014 0x280010 0x10021 0x835e0000000022001a 0x2200000000220016 0x2100000000040016 + 0x12bf71000000001f001a 0x1e0016) (.leaf8 0x1e000000000d0016 0x290da000000001c001a + 0x1d000000001c0016 0x20014 0x3000000000400000000000000000002000000001f0000000000001f 0x1f0009 + 0x10021 0x5dbd3b0000000019001a)) (.bin (.leaf8 0x1a00000000190016 0xcd44b0000000016001a 0x150016 + 0x1400000000010016 0x1d4b2290000000013001a 0x1400000000130016 0x30014 0x160010) (.leaf8 0x10021 + 0x4025790000000010001a 0xb000000000f0016 0x9277ad6000000000d001a 0x8000000000c0016 + 0x140bb63000000000a001a 0xb000000000a0016 0x30016))) (.bin (.bin (.leaf8 0x2dc5661a0000000007001a + 0x800000000070016 0x14 0xa0010 0x10021 0x600000000030016 0x643a9170000000004001a 0x30016) (.leaf8 + 0xe4dafe640000000001001a 0x200000000010016 0x14 0x20000000000000000000100000000040000000000001f + 0x30023 0x3000d 0x200000000020000000001001f524d56000000000000000000010020 0x50010)) (.bin (.leaf8 + 0x40021 0x17 0x1d 0x103c3 (h240 0x1f524d59000000000300000000010000 + 0x5001f524d570000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x20000000003000000000000c588b10b000000000000000000010020) + 0x5000000000000000000020000000001001f) (.leaf8 0x100000000030023 + 0x70000000000000643a916000000000100000000000020 0x9000000000000000000080000000001001f (h240 + 0x1000000000900000000010000 0x100000000020000000001000000000a0000000004001c) 0xa000f + 0xb0000000000000000000a00000000020000000001001e 0x90023 0x9000d)))) (.bin (.bin (.bin (.leaf8 + 0xc0000000000002dc56619000000000200000000010020 0xd000000000000000000020000000001001f (h240 + 0x10000 0x3000000000100000000000000000001000000000c0000000003001c) 0xc000f + 0xf0000000000000000000c00000000050000000001001e 0xb0023 0xb000d + 0x100000000000000140bb62000000000300000000010020) (.leaf8 0x110000000000000000000a0000000007001f + 0x1000000000b0023 0x1300000000000009277ad5000000000400000000000020 + 0x150000000000000000000d0000000009001f 0x1000000000e0023 + 0x1700000000000000402578000000000500000000000020 0x5000e + 0x1a00000000000000000016000000000b0000000000001e)) (.bin (.leaf8 0x150023 0x15000d + 0x1b00000000000001d4b228000000000600000000010020 0x1c000000000000000000160000000000001f 0x150023 + 0x15000d 0x1d00000000000000000002000000000d001f 0x100000000030023) (.leaf8 + 0x1f000000000000000cd44a000000000700000000000020 0x210000000000000000001c0000000010001f 0x1b0023 + 0x1b000d 0x22000000000000005dbd3a000000000800000000010020 0x5000e + 0x100000000050000000001000000001f0000000002001c 0x1f000f))) (.bin (.bin (.leaf8 + 0x250000000000000000001f000000000f0000000001001e 0x1e0023 0x1e000d + 0x26000000000000000290d9000000000900000000010020 0x27000000000000000000200000000008001f 0x1f0023 + 0x1f000d 0x27000000000000000000020000000013001f) (.leaf8 0x100000000030023 + 0x290000000000000012bf70000000000a00000000000020 0x2b000000000000000000230000000002001f 0x220023 + 0x22000d 0x2b000000000000000000240000000016001f 0x230023 0x23000d)) (.bin (.leaf8 + 0x2c0000000000000000835d000000000b00000000010020 0x26000e + 0x2d0000000000000000002800000000170000000000001e 0x270023 0x27000d + 0x2e0000000000000003bfe1000000000c00000000010020 0x29000e + 0x2f0000000000000000000400000000180000000000001e) (.leaf8 0x100000000050023 + 0x3100000000000000001a45000000000d00000000000020 0xa000e + 0x340000000000000000002e000000001b0000000000001e 0x2d0023 0x2d000d + 0x350000000000000000bff8000000000e00000000010020 0x360000000000000000000e000000001c001f)))))) + (.bin (.bin (.bin (.bin (.bin (.leaf8 0x1000000000e0023 + 0x3800000000000000000540000000000f00000000000020 0x3a00000000000000000002000000001e001f + 0x100000000020023 0x3c00000000000000002664000000001000000000000020 0x5000e + 0x10000000005000000000100000000370000000002001c 0x37000f) (.leaf8 + 0x4000000000000000000037000000001f0000000001001e 0x360023 0x36000d + 0x410000000000000000010b000000001100000000010020 0x5000e + 0x100000000050000000001000000003a0000000002001c 0x3a000f + 0x440000000000000000003a00000000210000000001001e)) (.bin (.leaf8 0x390023 0x39000d + 0x45000000000000000007ab000000001200000000010020 0x460000000000000000003b0000000000001f 0x3a0023 + 0x3a000d 0x46000000000000000000020000000025001f 0x100000000030023) (.leaf8 + 0x4800000000000000000034000000001300000000000020 0x4a000000000000000000080000000026001f + 0x100000000080023 0x4c00000000000000000188000000001400000000000020 0x5000e + 0x4f0000000000000000004300000000290000000000001e 0x420023 0x42000d))) (.bin (.bin (.leaf8 + 0x5000000000000000000008000000001500000000010020 0x51000000000000000000440000000002001f 0x430023 + 0x43000d 0x5100000000000000000046000000002c001f 0x450023 0x45000d + 0x520000000000000000004c000000001600000000010020) (.leaf8 0x53000000000000000000470000000000001f + 0x460023 0x46000d 0x5300000000000000000002000000002c001f 0x100000000020023 + 0x5500000000000000000001000000001700000000000020 0x7000e + 0x580000000000000000004c000000002f0000000000001e)) (.bin (.leaf8 0x4b0023 0x4b000d + 0x590000000000000000000d000000001800000000010020 0x5a0000000000000000004d0000000002001f 0x4c0023 + 0x4c000d 0x4f000e 0x5b0000000000000000000700000000320000000000001e) (.leaf8 0x100000000080023 + 0x5d00000000000000000001000000001a00000000000020 0x5f000000000000000000530000000005001f (h240 + 0x10000 0x5400000000010000000000000000000100000000010000000003001c) 0x1000f + 0x600000000000000000000100000000350000000001001e (h240 0x10000 + 0x100000000020000000000000000000100000000580000000003001c) 0x58000f)))) (.bin (.bin (.bin (.leaf8 + 0x620000000000001d (h240 0x10000 0x5800000000020000000000000000000100000000030000000003001c) + 0x20186 0x10043 0x30142 0x101c3 0x40023 0xc00c6) (.leaf8 0x10043 0x10303 0x10009 0x8 (h240 + 0x580000 0x100000000000000000002000000000100000000000000000000001e) + 0x5a00000000010000000001000000000100000000000000000000001e 0x1000a 0x20008)) (.bin (.leaf8 0x10009 + 0x10021 0x200000000590016 0x100000000010019 0x600000000000001d 0x300000000000000000001015c 0x30003 + 0x3000f) (.leaf8 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 0x478 0x46f7fc000000000000000000010000000001001f524d5900000000030000) + 0x1000000000500e4dafe640000000006000000000100000000030000) + 0x1000000000000000000010000000008000643a91700000000090000) + 0x10000000000000000000100000000020000000001000000000b002d) + 0xc5661a000000000c00000000010000000003000000000100000000000000) + 0x1000000000d000140bb63000000000f0000000001000000000b0000) + 0x10000000000000000000100000000110009277ad500000000120000) + 0x1000000000e00000000010000000000000000000100000000140000) + 0x402578000000001500000000010000000006000000000100000000170001) + 0xd4b229000000001800000000010000000017000000000100000000030000) + 0x100000000000000000001000000001a00000cd44a000000001b0000) + 0x1000000001d00005dbd3b000000001e000000000100000000060000) + 0x100000000050000000001000000002000000290db00000000210000) + 0x1000000000300000000010000000000000000000100000000230000) + 0x12bf71000000002400000000010000000025000000835f00000000270000) + 0x10000000029000003bfe3000000002a000000000100000000050000) + 0x100000000000000000001000000002c0000001a45000000002d0000) + 0x1000000000b0000000001000000002f000000bff900000000300000) + 0x1000000000e00000000020000000000000000000100000000320000) + 0x540000000003300000000010000000002000000000200000000000000) + 0x1000000003500000026640000000036000000000100000000060000) + 0x1000000000500000000010000000038000000010c00000000390000) + 0x10000000006000000000100000000050000000001000000003b0000) + 0x7ad000000003c00000000010000000003000000000100000000000000) + 0x1000000003e0000000034000000003f000000000100000000080000) + 0x2000000000000000000010000000041000000018800000000420000) + 0x1000000000600000000010000000044000000000a00000000450000) + 0x10000000047000000004e0000000048000000000100000000020000) + 0x200000000000000000001000000004a0000000001000000004b0000) + 0x100000000080000000001000000004d000000000f000000004e0000) + 0x1000000005000000000010000000008000000000100000000000000) + 0x1000000005300000000020000000054000000000200000000000000) + 0x6000000000010000000000000000000300000000390000000001001e) (h240 0x1000000000300000000020000 + 0x10000000003000000000100000000010000000004001c) 0x600c6 0x10043 0x30142 0x101c3 0x40009 0x14))) + (.bin (.bin (.leaf8 0x4000e 0x20186 0x10043 0x50142 0x101c3 0x60023 0x1000c6 0x10043) (.leaf8 + 0x10303 0x10009 0x20008 0x10009 0x10021 0x300000000010019 0x600000000000001d 0x10023)) (.bin + (.leaf8 (h240 0x20000 0x10000000003000000000100000000010000000003009c) 0x1000f (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x47846f87400000000000000 0x10000000001001f524d5900000000030000000001000000000500e4) + 0xdafe64000000000600000000010000000003000000000100000000000000) + 0x10000000008000643a9170000000009000000000100000000000000) + 0x100000000020000000001000000000b002dc5661a000000000c0000) + 0x10000000003000000000100000000000000000001000000000d0001) + 0x40bb63000000000f0000000001000000000b000000000100000000000000) + 0x100000000110009277ad500000000120000000001000000000e0000) + 0x1000000000000000000010000000014000040257800000000150000) + 0x10000000006000000000100000000170001d4b22900000000180000) + 0x1000000001700000000010000000003000000000100000000000000) + 0x1000000001a00000cd44a000000001b0000000001000000001d0000) + 0x5dbd3b000000001e00000000010000000006000000000100000000050000) + 0x1000000002000000290db0000000021000000000100000000030000) + 0x1000000000000000000010000000023000012bf7100000000240000) + 0x10000000025000000835f0000000027000000000100000000290000) + 0x3bfe3000000002a00000000010000000005000000000100000000000000) + 0x1000000002c0000001a45000000002d0000000001000000000b0000) + 0x1000000002f000000bff900000000300000000001000000000e0000) + 0x2000000000000000000010000000032000000054000000000330000) + 0x1000000000200000000020000000000000000000100000000350000) + 0x2664000000003600000000010000000006000000000100000000050000) + 0x10000000038000000010c0000000039000000000100000000060000) + 0x100000000050000000001000000003b00000007ad000000003c0000) + 0x10000000003000000000100000000000000000001000000003e0000) + 0x34000000003f00000000010000000008000000000200000000000000) + 0x1000000004100000001880000000042000000000100000000060000) + 0x10000000044000000000a0000000045000000000100000000470000) + 0x4e000000004800000000010000000002000000000200000000000000) + 0x1000000004a0000000001000000004b000000000100000000080000) + 0x1000000004d000000000f000000004e000000000100000000500000) + 0x1000000000800000000010000000000000000000100000000530000) + 0x2000000005400000000040000000000000000000100000000020000) + 0x6100000000020000000000000000000100000000010000000001001e) 0x30000000000000b 0x14 0x3000e 0xc00c6 + 0x10043) (.leaf8 0x20142 0x101c3 0x30009 0x200000000010019 0x600000000000001d 0x23 + 0x300000000000000000001009c 0x30003))))) (.bin (.bin (.bin (.bin (.leaf8 0x3000f (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x47846f87c00000000000000 0x10000000001001f524d5900000000030000000001000000000500e4) + 0xdafe64000000000600000000010000000003000000000100000000000000) + 0x10000000008000643a9170000000009000000000100000000000000) + 0x100000000020000000001000000000b002dc5661a000000000c0000) + 0x10000000003000000000100000000000000000001000000000d0001) + 0x40bb63000000000f0000000001000000000b000000000100000000000000) + 0x100000000110009277ad500000000120000000001000000000e0000) + 0x1000000000000000000010000000014000040257800000000150000) + 0x10000000006000000000100000000170001d4b22900000000180000) + 0x1000000001700000000010000000003000000000100000000000000) + 0x1000000001a00000cd44a000000001b0000000001000000001d0000) + 0x5dbd3b000000001e00000000010000000006000000000100000000050000) + 0x1000000002000000290db0000000021000000000100000000030000) + 0x1000000000000000000010000000023000012bf7100000000240000) + 0x10000000025000000835f0000000027000000000100000000290000) + 0x3bfe3000000002a00000000010000000005000000000100000000000000) + 0x1000000002c0000001a45000000002d0000000001000000000b0000) + 0x1000000002f000000bff900000000300000000001000000000e0000) + 0x2000000000000000000010000000032000000054000000000330000) + 0x1000000000200000000020000000000000000000100000000350000) + 0x2664000000003600000000010000000006000000000100000000050000) + 0x10000000038000000010c0000000039000000000100000000060000) + 0x100000000050000000001000000003b00000007ad000000003c0000) + 0x10000000003000000000100000000000000000001000000003e0000) + 0x34000000003f00000000010000000008000000000200000000000000) + 0x1000000004100000001880000000042000000000100000000060000) + 0x10000000044000000000a0000000045000000000100000000470000) + 0x4e000000004800000000010000000002000000000200000000000000) + 0x1000000004a0000000001000000004b000000000100000000080000) + 0x1000000004d000000000f000000004e000000000100000000500000) + 0x1000000000800000000010000000000000000000100000000530000) + 0x2000000005400000000040000000000000000000100000000010000) + 0x6100000000010000000000000000000300000000000000000001001e) 0x3000a 0x8 (h240 0x10000 + 0x100000000000000000002000000000100000000000000000000001e) + 0x300000000010000000001000000000100000000000000000000001e 0x1000a 0x20008) (.leaf8 0x10009 0x10021 + 0x200000000020016 0x10019 0x600000000000001d 0xf 0x5f0000000000001d 0x103c3)) (.bin (.leaf8 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x478 0x46f884000000000000000000010000000001001f524d5900000000030000) + 0x1000000000500e4dafe640000000006000000000100000000030000) + 0x1000000000000000000010000000008000643a91700000000090000) + 0x10000000000000000000100000000020000000001000000000b002d) + 0xc5661a000000000c00000000010000000003000000000100000000000000) + 0x1000000000d000140bb63000000000f0000000001000000000b0000) + 0x10000000000000000000100000000110009277ad500000000120000) + 0x1000000000e00000000010000000000000000000100000000140000) + 0x402578000000001500000000010000000006000000000100000000170001) + 0xd4b229000000001800000000010000000017000000000100000000030000) + 0x100000000000000000001000000001a00000cd44a000000001b0000) + 0x1000000001d00005dbd3b000000001e000000000100000000060000) + 0x100000000050000000001000000002000000290db00000000210000) + 0x1000000000300000000010000000000000000000100000000230000) + 0x12bf71000000002400000000010000000025000000835f00000000270000) + 0x10000000029000003bfe3000000002a000000000100000000050000) + 0x100000000000000000001000000002c0000001a45000000002d0000) + 0x1000000000b0000000001000000002f000000bff900000000300000) + 0x1000000000e00000000020000000000000000000100000000320000) + 0x540000000003300000000010000000002000000000200000000000000) + 0x1000000003500000026640000000036000000000100000000060000) + 0x1000000000500000000010000000038000000010c00000000390000) + 0x10000000006000000000100000000050000000001000000003b0000) + 0x7ad000000003c00000000010000000003000000000100000000000000) + 0x1000000003e0000000034000000003f000000000100000000080000) + 0x2000000000000000000010000000041000000018800000000420000) + 0x1000000000600000000010000000044000000000a00000000450000) + 0x10000000047000000004e0000000048000000000100000000020000) + 0x200000000000000000001000000004a0000000001000000004b0000) + 0x100000000080000000001000000004d000000000f000000004e0000) + 0x1000000005000000000010000000008000000000100000000000000) + 0x1000000005300000000020000000054000000000100000000010000) + 0x6000000000000000000000000000000400000000000000000000001e) (h240 0x1000000000400000000020000 + 0x10000000003000000000100000000010000000004001c) 0x600c6 0x10043 0x30142 0x101c3 0x40009 0x14) + (.leaf8 0x4000e 0x20186 0x10043 0x50142 0x101c3 0x60023 0x1000c6 0x10043))) (.bin (.bin (.leaf8 + 0x10303 0x10009 0x20008 0x10009 0x10021 0x400000000010019 0x600000000000001d 0x20023) (.leaf8 + (h240 0x20000 0x10000000003000000000100000000010000000003009c) 0x1000f (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x47846f88800000000000000 0x10000000001001f524d5900000000030000000001000000000500e4) + 0xdafe64000000000600000000010000000003000000000100000000000000) + 0x10000000008000643a9170000000009000000000100000000000000) + 0x100000000020000000001000000000b002dc5661a000000000c0000) + 0x10000000003000000000100000000000000000001000000000d0001) + 0x40bb63000000000f0000000001000000000b000000000100000000000000) + 0x100000000110009277ad500000000120000000001000000000e0000) + 0x1000000000000000000010000000014000040257800000000150000) + 0x10000000006000000000100000000170001d4b22900000000180000) + 0x1000000001700000000010000000003000000000100000000000000) + 0x1000000001a00000cd44a000000001b0000000001000000001d0000) + 0x5dbd3b000000001e00000000010000000006000000000100000000050000) + 0x1000000002000000290db0000000021000000000100000000030000) + 0x1000000000000000000010000000023000012bf7100000000240000) + 0x10000000025000000835f0000000027000000000100000000290000) + 0x3bfe3000000002a00000000010000000005000000000100000000000000) + 0x1000000002c0000001a45000000002d0000000001000000000b0000) + 0x1000000002f000000bff900000000300000000001000000000e0000) + 0x2000000000000000000010000000032000000054000000000330000) + 0x1000000000200000000020000000000000000000100000000350000) + 0x2664000000003600000000010000000006000000000100000000050000) + 0x10000000038000000010c0000000039000000000100000000060000) + 0x100000000050000000001000000003b00000007ad000000003c0000) + 0x10000000003000000000100000000000000000001000000003e0000) + 0x34000000003f00000000010000000008000000000200000000000000) + 0x1000000004100000001880000000042000000000100000000060000) + 0x10000000044000000000a0000000045000000000100000000470000) + 0x4e000000004800000000010000000002000000000200000000000000) + 0x1000000004a0000000001000000004b000000000100000000080000) + 0x1000000004d000000000f000000004e000000000100000000500000) + 0x1000000000800000000010000000000000000000100000000530000) + 0x2000000005400000000010000000001000000000100000000030000) + 0x6100000000020000000000000000000100000000010000000001001e) 0x30000000000000b 0x14 0x3000e 0xc00c6 + 0x10043)) (.bin (.leaf8 0x20142 0x101c3 0x30009 0x300000000010019 0x600000000000001d 0x10023 + 0x300000000000000000001009c 0x30003) (.leaf8 0x3000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x47846f89000000000000000 + 0x10000000001001f524d5900000000030000000001000000000500e4) + 0xdafe64000000000600000000010000000003000000000100000000000000) + 0x10000000008000643a9170000000009000000000100000000000000) + 0x100000000020000000001000000000b002dc5661a000000000c0000) + 0x10000000003000000000100000000000000000001000000000d0001) + 0x40bb63000000000f0000000001000000000b000000000100000000000000) + 0x100000000110009277ad500000000120000000001000000000e0000) + 0x1000000000000000000010000000014000040257800000000150000) + 0x10000000006000000000100000000170001d4b22900000000180000) + 0x1000000001700000000010000000003000000000100000000000000) + 0x1000000001a00000cd44a000000001b0000000001000000001d0000) + 0x5dbd3b000000001e00000000010000000006000000000100000000050000) + 0x1000000002000000290db0000000021000000000100000000030000) + 0x1000000000000000000010000000023000012bf7100000000240000) + 0x10000000025000000835f0000000027000000000100000000290000) + 0x3bfe3000000002a00000000010000000005000000000100000000000000) + 0x1000000002c0000001a45000000002d0000000001000000000b0000) + 0x1000000002f000000bff900000000300000000001000000000e0000) + 0x2000000000000000000010000000032000000054000000000330000) + 0x1000000000200000000020000000000000000000100000000350000) + 0x2664000000003600000000010000000006000000000100000000050000) + 0x10000000038000000010c0000000039000000000100000000060000) + 0x100000000050000000001000000003b00000007ad000000003c0000) + 0x10000000003000000000100000000000000000001000000003e0000) + 0x34000000003f00000000010000000008000000000200000000000000) + 0x1000000004100000001880000000042000000000100000000060000) + 0x10000000044000000000a0000000045000000000100000000470000) + 0x4e000000004800000000010000000002000000000200000000000000) + 0x1000000004a0000000001000000004b000000000100000000080000) + 0x1000000004d000000000f000000004e000000000100000000500000) + 0x1000000000800000000010000000000000000000100000000530000) + 0x2000000005400000000010000000001000000000100000000020000) + 0x6100000000010000000000000000000300000000000000000001001e) 0x3000a 0x8 (h240 0x20000 + 0x100000000000000000002000000000100000000000000000000001e) + 0x5400000000020000000003000000000100000000000000000000001e 0x1000a 0x20008)))) (.bin (.bin (.bin + (.leaf8 0x10009 0x10021 0x20016 0x550014 0x20010 0x10021 0x5400000000010019 0x5e0000000000001d) + (.leaf8 0x520023 (h240 (h240 0x20000 0x100000000570000000001000000000200000000020000) + 0x10000000003000000000100000000010000000006009c) 0x600c6 0x10043 0x30142 0x101c3 0x40009 0x14)) + (.bin (.leaf8 0x4000e 0x20186 0x10043 0x50142 0x101c3 0x60023 0x1000c6 0x10043) (.leaf8 0x10303 + 0x10009 0x20008 0x10009 0x10021 0x200000000010019 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x47846f896000000000000000000010000000001001f524d590000 + 0x30000000001000000000500e4dafe64000000000600000000010000) + 0x30000000001000000000000000000010000000008000643a9170000) + 0x9000000000100000000000000000001000000000200000000010000) + 0xb002dc5661a000000000c0000000001000000000300000000010000) + 0x1000000000d000140bb63000000000f00000000010000) + 0xb00000000010000000000000000000100000000110009277ad50000) + 0x120000000001000000000e0000000001000000000000000000010000) + 0x14000040257800000000150000000001000000000600000000010000) + 0x170001d4b22900000000180000000001000000001700000000010000) + 0x3000000000100000000000000000001000000001a00000cd44a0000) + 0x1b0000000001000000001d00005dbd3b000000001e00000000010000) + 0x6000000000100000000050000000001000000002000000290db0000) + 0x21000000000100000000030000000001000000000000000000010000) + 0x23000012bf71000000002400000000010000000025000000835f0000) + 0x2700000000010000000029000003bfe3000000002a00000000010000) + 0x5000000000100000000000000000001000000002c0000001a450000) + 0x2d0000000001000000000b0000000001000000002f000000bff90000) + 0x300000000001000000000e0000000002000000000000000000010000) + 0x32000000054000000000330000000001000000000200000000020000) + 0x100000000350000002664000000003600000000010000) + 0x60000000001000000000500000000010000000038000000010c0000) + 0x39000000000100000000060000000001000000000500000000010000) + 0x3b00000007ad000000003c0000000001000000000300000000010000) + 0x1000000003e0000000034000000003f00000000010000) + 0x8000000000200000000000000000001000000004100000001880000) + 0x420000000001000000000600000000010000000044000000000a0000) + 0x4500000000010000000047000000004e000000004800000000010000) + 0x2000000000200000000000000000001000000004a00000000010000) + 0x4b000000000100000000080000000001000000004d000000000f0000) + 0x4e000000000100000000500000000001000000000800000000010000) + 0x20000000053000000005e00000000020000000000001d) 0x23))) (.bin (.bin (.leaf8 (h240 0x20000 + 0x10000000003000000000100000000010000000003009c) 0x1000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x47846f89800000000000000 + 0x10000000001001f524d5900000000030000000001000000000500e4) + 0xdafe64000000000600000000010000000003000000000100000000000000) + 0x10000000008000643a9170000000009000000000100000000000000) + 0x100000000020000000001000000000b002dc5661a000000000c0000) + 0x10000000003000000000100000000000000000001000000000d0001) + 0x40bb63000000000f0000000001000000000b000000000100000000000000) + 0x100000000110009277ad500000000120000000001000000000e0000) + 0x1000000000000000000010000000014000040257800000000150000) + 0x10000000006000000000100000000170001d4b22900000000180000) + 0x1000000001700000000010000000003000000000100000000000000) + 0x1000000001a00000cd44a000000001b0000000001000000001d0000) + 0x5dbd3b000000001e00000000010000000006000000000100000000050000) + 0x1000000002000000290db0000000021000000000100000000030000) + 0x1000000000000000000010000000023000012bf7100000000240000) + 0x10000000025000000835f0000000027000000000100000000290000) + 0x3bfe3000000002a00000000010000000005000000000100000000000000) + 0x1000000002c0000001a45000000002d0000000001000000000b0000) + 0x1000000002f000000bff900000000300000000001000000000e0000) + 0x2000000000000000000010000000032000000054000000000330000) + 0x1000000000200000000020000000000000000000100000000350000) + 0x2664000000003600000000010000000006000000000100000000050000) + 0x10000000038000000010c0000000039000000000100000000060000) + 0x100000000050000000001000000003b00000007ad000000003c0000) + 0x10000000003000000000100000000000000000001000000003e0000) + 0x34000000003f00000000010000000008000000000200000000000000) + 0x1000000004100000001880000000042000000000100000000060000) + 0x10000000044000000000a0000000045000000000100000000470000) + 0x4e000000004800000000010000000002000000000200000000000000) + 0x1000000004a0000000001000000004b000000000100000000080000) + 0x1000000004d000000000f000000004e000000000100000000500000) + 0x1000000000800000000010000000000000000000200000000530000) + 0x2000000000000000000010000000057000000000100000000010000) + 0x6100000000020000000000000000000100000000010000000001001e) 0x30000000000000b 0x14 0x3000e 0xc00c6 + 0x10043) (.leaf8 0x20142 0x101c3 0x30009 0x100000000010019 0x600000000000001d + 0x300000000000000000001015c 0x30003 0x3000f)) (.bin (.leaf8 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x47846f8a000000000000000 + 0x10000000001001f524d5900000000030000000001000000000500e4) + 0xdafe64000000000600000000010000000003000000000100000000000000) + 0x10000000008000643a9170000000009000000000100000000000000) + 0x100000000020000000001000000000b002dc5661a000000000c0000) + 0x10000000003000000000100000000000000000001000000000d0001) + 0x40bb63000000000f0000000001000000000b000000000100000000000000) + 0x100000000110009277ad500000000120000000001000000000e0000) + 0x1000000000000000000010000000014000040257800000000150000) + 0x10000000006000000000100000000170001d4b22900000000180000) + 0x1000000001700000000010000000003000000000100000000000000) + 0x1000000001a00000cd44a000000001b0000000001000000001d0000) + 0x5dbd3b000000001e00000000010000000006000000000100000000050000) + 0x1000000002000000290db0000000021000000000100000000030000) + 0x1000000000000000000010000000023000012bf7100000000240000) + 0x10000000025000000835f0000000027000000000100000000290000) + 0x3bfe3000000002a00000000010000000005000000000100000000000000) + 0x1000000002c0000001a45000000002d0000000001000000000b0000) + 0x1000000002f000000bff900000000300000000001000000000e0000) + 0x2000000000000000000010000000032000000054000000000330000) + 0x1000000000200000000020000000000000000000100000000350000) + 0x2664000000003600000000010000000006000000000100000000050000) + 0x10000000038000000010c0000000039000000000100000000060000) + 0x100000000050000000001000000003b00000007ad000000003c0000) + 0x10000000003000000000100000000000000000001000000003e0000) + 0x34000000003f00000000010000000008000000000200000000000000) + 0x1000000004100000001880000000042000000000100000000060000) + 0x10000000044000000000a0000000045000000000100000000470000) + 0x4e000000004800000000010000000002000000000200000000000000) + 0x1000000004a0000000001000000004b000000000100000000080000) + 0x1000000004d000000000f000000004e000000000100000000500000) + 0x1000000000800000000010000000000000000000200000000530000) + 0x2000000000000000000010000000057000000000100000000000000) + 0x6100000000010000000000000000000300000000000000000001001e) 0x3000a 0x8 + 0x100000000000000000001000000000100000000000000000000001e 0x10009 0x10021 0x550016 0x530014) + (.leaf8 0x20010 0x10021 0x510016 0x5000000000060016 0x7000000004c001a 0x4d000000004c0016 + 0x4b00000000060016 0x480016)))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x20014 + 0x20010 0x10021 0x270000000046001a 0x4500000000450016 0x40000000043001a 0x4400000000430016 + 0x4200000000040016) (.leaf8 0xc30000000040001a 0x4100000000400016 0x14 0x430010 0x10021 + 0x3f00000000060016 0x19000000003d001a 0x3e000000003d0016)) (.bin (.leaf8 0x30014 0x400010 0x10021 + 0x3d6000000003a001a 0x3b000000003a0016 0x600000000030016 0x860000000037001a 0x500000000360016) + (.leaf8 0x3600000000040016 0x13310000000034001a 0x3500000000340016 0x14 0x370010 0x10021 + 0x3300000000000016 0x29f0000000031001a))) (.bin (.bin (.leaf8 0x3200000000310016 0x14 0x340010 + 0x10021 0x30000000000c0016 0x5ffc000000002e001a 0xb000000002d0016 0xd22000000002b001a) (.leaf8 + 0x2c000000002b0016 0x50014 0x2e0010 0x10021 0x1dff10000000028001a 0x2900000000280016 + 0x41af0000000025001a 0x2500000000250016)) (.bin (.leaf8 0x95fb80000000022001a 0x2300000000220016 + 0x30014 0x250010 0x10021 0x1486d000000001f001a 0x20000000001f0016 0x600000000030016) (.leaf8 + 0x2ede9d000000001c001a 0x1d000000001c0016 0x66a250000000019001a 0x180016 0x1700000000010016 + 0xea59140000000016001a 0x1700000000160016 0x1500000000040016)))) (.bin (.bin (.bin (.leaf8 + 0x2012bb0000000013001a 0x1400000000130016 0xe0014 0x160010 0x10021 0x493bd6a0000000010001a + 0x1100000000100016 0xb0014) (.leaf8 0x130010 0x10021 0xa05db1000000000d001a 0xd000000000d0016 + 0x30014 0xf0010 0x10021 0x16e2b30d000000000a001a)) (.bin (.leaf8 0x200000000090016 0x90014 0x40010 + 0x10021 0x321d48b0000000007001a 0x60016 0x600000000010016 0x726d7f310000000004001a) (.leaf8 + 0x500000000040016 0xfa926ac0000000001001a 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x200000000020000000001000fa926ab000000000000000000010020))) (.bin (.bin (.leaf8 + 0x20000000003000000000100000000070000000002001f 0x60023 0x6000d + 0x20000000004000000000100726d7f30000000000100000000010020 + 0x20000000005000000000100000000080000000000001f 0x70023 0x7000d + 0x20000000005000000000100000000020000000003001f) (.leaf8 0x100000000030023 + 0x200000000070000000001000321d48a000000000200000000000020 0xb000e + 0x200000000090000000001000000000400000000040000000000001e 0x100000000050023 + 0x2000000000b00000000010016e2b30c000000000300000000000020 0x5000e + 0x2000000000e0000000001000000000f00000000070000000000001e)) (.bin (.leaf8 0xe0023 0xe000d + 0x2000000000f00000000010000a05db0000000000400000000010020 0xd000e + 0x200000000110000000001000000001300000000090000000000001e 0x120023 0x12000d + 0x2000000001200000000010002e1ae99000000000500000000010020) (.leaf8 + 0x20000000013000000000100000000140000000008001f (h240 0x100000000000000 + 0x100000000140000000000000000001400000000010000000000001e) 0x130023 0x13000d + 0x1500000000000001b20ece000000000500000000010020 0x10000e + 0x1600000000000000000016000000000b0000000000001e 0x150023))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x15000d 0x17000000000000002012ba000000000600000000010020 0x18000000000000000000170000000002001f + 0x160023 0x16000d 0x1800000000000000000019000000000e001f 0x180023 0x18000d) (.leaf8 + 0x1900000000000000ea5913000000000700000000010020 0x1a000000000000000000190000000000001f 0x180023 + 0x18000d 0x1b00000000000000000002000000000f001f 0x100000000030023 + 0x1d00000000000000066a24000000000800000000000020 0x1f0000000000000000001f0000000012001f)) (.bin + (.leaf8 0x1e0023 0x1e000d 0x20000000000000002ede9c000000000900000000010020 + 0x21000000000000000000080000000001001f (h240 0x10000 + 0x900000000010000000000000000000100000000210000000003001c) 0x21000f + 0x230000000000000000002100000000130000000001001e 0x200023) (.leaf8 0x20000d + 0x240000000000000001486c000000000a00000000010020 0x5000e + 0x260000000000000000002500000000150000000000001e 0x240023 0x24000d + 0x2700000000000000095fb7000000000b00000000010020 0x28000000000000000000270000000018001f))) (.bin + (.bin (.leaf8 0x260023 0x26000d 0x29000000000000000041ae000000000c00000000010020 + 0x2a0000000000000000002b000000001a001f 0x2a0023 0x2a000d + 0x2b0000000000000001dff0000000000d00000000010020 0x7000e) (.leaf8 + 0x2d0000000000000000002e000000001b0000000000001e 0x2d0023 0x2d000d + 0x2e00000000000000000d21000000000e00000000010020 0x2f0000000000000000000d000000001d001f + 0x1000000000e0023 0x3100000000000000005ffb000000000f00000000000020 + 0x33000000000000000000320000000007001f)) (.bin (.leaf8 (h240 0x1000000003300000000010000 + 0x10000000002000000000100000000340000000004001c) 0x34000f + 0x3500000000000000000034000000001e0000000001001e 0x330023 0x33000d + 0x360000000000000000029e000000001000000000010020 0x35000e (h240 0x10000 + 0x10000000002000000000100000000370000000003001c)) (.leaf8 0x37000f + 0x390000000000000000003700000000200000000001001e 0x360023 0x36000d + 0x3a00000000000000001330000000001100000000010020 0x3b000000000000000000380000000002001f 0x370023 + 0x37000d)))) (.bin (.bin (.bin (.leaf8 0x3b000000000000000000070000000023001f 0x100000000080023 + 0x3d00000000000000000085000000001200000000000020 0x3f000000000000000000080000000001001f (h240 + 0x10000 0x9000000000100000000000000000001000000003c0000000003001c) 0x3c000f + 0x410000000000000000003c00000000250000000001001e 0x3b0023) (.leaf8 0x3b000d + 0x42000000000000000003d5000000001300000000010020 0x5000e + 0x440000000000000000004000000000270000000000001e 0x3f0023 0x3f000d + 0x4500000000000000000018000000001400000000010020 0x46000000000000000000410000000003001f)) (.bin + (.leaf8 (h240 0x1000000004200000000010000 0x10000000002000000000100000000430000000004001c) + 0x43000f 0x480000000000000000004300000000280000000001001e 0x420023 0x42000d + 0x49000000000000000000c2000000001500000000010020 0x4a000000000000000000440000000002001f 0x430023) + (.leaf8 0x43000d 0x4a00000000000000000046000000002c001f 0x450023 0x45000d + 0x4b00000000000000000003000000001600000000010020 0x4c00000000000000000047000000002d001f + 0x100000000480023 0x4d00000000000000000026000000001700000000000020))) (.bin (.bin (.leaf8 0x4000e + 0x5000000000000000000002000000002e0000000000001e (h240 0x10000 + 0x3000000000100000000000000000001000000004c0000000003001c) 0x4c000f + 0x520000000000000000004c00000000020000000001001e (h240 0x10000 + 0x4d000000000100000000000000000001000000004e0000000003001c) 0x4e000f + 0x540000000000000000004e00000000310000000001001e) (.leaf8 0x4d0023 0x4d000d + 0x5500000000000000000006000000001900000000010020 0x56000000000000000000520000000003001f (h240 + 0x10000 0x5300000000010000000000000000000100000000010000000003001c) 0x1000f + 0x580000000000000000000100000000340000000001001e (h240 0x1000000000200000000010000 + 0x10000000055000000000100000000020000000004001c))) (.bin (.leaf8 0x2000f + 0x5b0000000000000000000200000000360000000001001e 0x10023 0x1000d 0x2000e + 0x10000000002000000000100000000010000000002001c 0x20186 0x10043) (.leaf8 0x10142 0x101c3 0x20023 + 0x800c6 0x10043 0x10303 0x10009 0x20008)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 0x10009 + 0x10021 0x10000000001001a 0x530016 0x16 0x5100000000510016 0x3000000004f001a 0x4d0016) (.leaf8 + 0x4b0016 0x500000000010016 0x130000000049001a 0x480016 0x20000000046001a 0x4700000000460016 + 0x620000000043001a 0x200000000420016)) (.bin (.leaf8 0x420014 0x40010 0x10021 0xc0000000040001a + 0x4100000000400016 0x3f00000000040016 0x1ea000000003d001a 0x3d000000003d0016) (.leaf8 0x90014 + 0x3f0010 0x10021 0x42000000003a001a 0x3b000000003a0016 0x80014 0x3d0010 0x10021))) (.bin (.bin + (.leaf8 0x9990000000037001a 0x200000000360016 0x360014 0x40010 0x10021 0x14f0000000034001a + 0x3500000000340016 0x16) (.leaf8 0x2ffe0000000031001a 0x300016 0x30000000000c0016 + 0x690000000002e001a 0x2f000000002e0016 0x2d00000000060016 0xeff8000000002b001a + 0x2a000000002a0016)) (.bin (.leaf8 0x20d70000000028001a 0x2700000000260016 0x4afdb0000000025001a + 0x2600000000250016 0x2400000000040016 0xa4360000000022001a 0x200016 0x2100000000070016) (.leaf8 + 0x176f4e000000001f001a 0x1e000000001e0016 0x33511000000001c001a 0x1d000000001c0016 0x30014 + 0x1f0010 0x10021 0x1b00000000180016)))) (.bin (.bin (.bin (.leaf8 0x752c890000000019001a + 0x1a00000000190016 0x10095e0000000016001a 0x1100000000150016 0x249deb50000000013001a + 0xe00000000120016 0x502ed80000000010001a 0x1000000000100016) (.leaf8 0xf00000000040016 + 0xb715985000000000d001a 0xe000000000d0016 0x50014 0x100010 0x10021 0x190ea45000000000a001a + 0xb000000000a0016)) (.bin (.leaf8 0x30014 0xd0010 0x10021 0x3936bf990000000007001a + 0x600000000060016 0x7d493550000000004001a 0x400000000040016 0x11e11be280000000001001a) (.leaf8 + 0x200000000010016 0x14 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x200000000020000000001002726e035000000000000000000010020 0x50010 0x40021))) (.bin (.bin (.leaf8 + 0x17 0x1d 0x103c3 (h240 0x2726e038000000000300000000010000 + 0x5002726e0360000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x20000000003000000000000f6eaddf0000000000000000000010020) + 0x5000000000000000000060000000002001f 0x50023) (.leaf8 0x5000d + 0x600000000000007d49354000000000100000000010020 0x7000000000000000000080000000003001f + 0x100000000090023 0x80000000000003936bf98000000000200000000000020 0x5000e + 0xb0000000000000000000d00000000050000000000001e 0xc0023)) (.bin (.leaf8 0xc000d + 0xc0000000000000190ea44000000000300000000010020 0x7000e + 0xe0000000000000000001000000000070000000000001e 0xf0023 0xf000d + 0xf0000000000000b715984000000000400000000010020 0x10000000000000000000110000000002001f) (.leaf8 + 0x100023 0x10000d 0x1000000000000000000012000000000a001f 0x110023 0x11000d + 0x1100000000000000502ed7000000000500000000010020 0x1200000000000000000010000000000b001f + 0x100000000110023))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x140000000000000249deb4000000000600000000000020 0x1600000000000000000013000000000d001f + 0x100000000140023 0x180000000000000010095d000000000700000000000020 + 0x1a0000000000000000001c0000000010001f 0x1b0023 0x1b000d + 0x1b00000000000000752c88000000000800000000010020) (.leaf8 0x1c0000000000000000001d000000000f001f + (h240 0x1000000001e00000000010000 0x100000000050000000001000000001f0000000004001c) 0x1f000f + 0x1e0000000000000000001f00000000100000000001001e 0x1e0023 0x1e000d + 0x1f00000000000000033510000000000900000000010020 0x20000000000000000000200000000013001f)) (.bin + (.leaf8 0x100000000210023 0x2100000000000000176f4d000000000a00000000000020 + 0x23000000000000000000230000000004001f 0x220023 0x22000d 0x23000000000000000000020000000014001f + 0x100000000020023 0x250000000000000000a435000000000b00000000000020) (.leaf8 + 0x27000000000000000000260000000002001f 0x250023 0x25000d 0x27000000000000000000280000000018001f + 0x270023 0x27000d 0x280000000000000004afda000000000c00000000010020 + 0x29000000000000000000290000000018001f))) (.bin (.bin (.leaf8 0x100000000290023 + 0x2b000000000000000020d6000000000d00000000000020 0x2d0000000000000000002c000000001b001f + 0x1000000002d0023 0x2e0000000000000000eff7000000000e00000000000020 + 0x300000000000000000002f0000000003001f (h240 0x10000 + 0x3000000000010000000000000000000100000000300000000003001c) 0x30000f) (.leaf8 + 0x3100000000000000000030000000001d0000000001001e 0x2f0023 0x2f000d + 0x320000000000000000068f000000000f00000000010020 0x33000000000000000000320000000007001f (h240 + 0x10000 0x3300000000010000000000000000000100000000010000000003001c) 0x1000f + 0x3400000000000000000001000000001e0000000001001e)) (.bin (.leaf8 0x100000000020023 + 0x3600000000000000002ffd000000001000000000000020 0x2000e + 0x10000000000000000000100000000360000000002001c 0x36000f + 0x3a0000000000000000003600000000210000000001001e 0x350023 0x35000d) (.leaf8 + 0x3b0000000000000000014e000000001100000000010020 0x38000e + 0x3c0000000000000000000400000000220000000000001e 0x100000000050023 + 0x3e00000000000000000998000000001200000000000020 0xa000e + 0x410000000000000000003d00000000250000000000001e 0x3c0023)))) (.bin (.bin (.bin (.leaf8 0x3c000d + 0x4200000000000000000041000000001300000000010020 0xb000e + 0x440000000000000000003f00000000270000000000001e 0x3e0023 0x3e000d + 0x45000000000000000001e9000000001400000000010020 0x46000000000000000000410000000002001f) (.leaf8 + 0x400023 0x40000d 0x4600000000000000000043000000002a001f 0x420023 0x42000d + 0x470000000000000000000b000000001500000000010020 0x44000e + 0x4800000000000000000004000000002a0000000000001e)) (.bin (.leaf8 0x100000000050023 + 0x4a00000000000000000061000000001600000000000020 0x4c00000000000000000049000000002e001f 0x480023 + 0x48000d 0x4d00000000000000000001000000001700000000010020 0x4e00000000000000000002000000002f001f + 0x100000000030023) (.leaf8 0x5000000000000000000012000000001800000000000020 + 0x52000000000000000000070000000000001f 0x60023 0x6000d 0x53000000000000000000020000000031001f + (h240 0x10000 0x300000000010000000000000000000100000000010000000003001c) 0x1000f + 0x550000000000000000000100000000310000000001001e))) (.bin (.bin (.leaf8 0x100000000010023 + 0x5700000000000000000002000000001a00000000000020 0x59000000000000000000530000000035001f (h240 + 0x100000000540000000001000000000000000000010000 + 0x200000000010000000000000000000100000000010000000005001c) 0x1000f + 0x5c0000000000000000000100000000350000000001001e 0x100000000010023 + 0x5e00000000000000000000000000000000000000000020) (.leaf8 0x3000e 0x40000000001000b 0x30016 + 0x10014 0x200000000030000000000000000000200000000020000000000001f (h240 + 0x10000000004000000000100000000540000 0x400000000000000000002000000000200000000000000000000001e) + (h240 0x10000 0x300000000010000000000000000000100000000050000000003001c) 0x20186)) (.bin (.leaf8 + 0x10043 0x50142 0x101c3 0x60023 0x1000c6 0x10043 0x10303 0x10009) (.leaf8 0x8 0x10009 0x10021 + 0x400000000010016 0x5600000000030016 0x5400000000010019 0x590000000000001d 0x520023))))))) (.bin + (.bin (.bin (.bin (.bin (.bin (.leaf8 0x300000000000000000001009c 0x570003 0x57000f (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x596 + 0x58b82c000000000000000000010000000001002726e03800000000030000) + 0x10000000005011e11be280000000006000000000100000000070007) + 0xd493560000000009000000000100000000000000000001000000000b0039) + 0x36bf98000000000c000000000100000000060000000001000000000e0001) + 0x90ea45000000000f0000000001000000000800000000010000000011000b) + 0x7159860000000012000000000100000000130000502ed800000000150000) + 0x1000000001100000000010000000000000000000100000000170002) + 0x49deb4000000001800000000010000000014000000000100000000000000) + 0x1000000001a000010095d000000001b0000000001000000001d0000) + 0x752c8a000000001e00000000010000000000000000000100000000050000) + 0x1000000002000000335120000000021000000000100000000000000) + 0x100000000230000176f4e0000000024000000000100000000020000) + 0x2000000000000000000010000000026000000a43600000000270000) + 0x10000000029000004afdb000000002a000000000100000000290000) + 0x200000000000000000001000000002c00000020d7000000002d0000) + 0x100000000000000000001000000002f000000eff800000000300000) + 0x1000000000000000000010000000031000000069100000000330000) + 0x1000000000000000000010000000002000000000100000000000000) + 0x100000000350000002ffd0000000036000000000100000000030000) + 0x1000000000000000000010000000037000000015000000000390000) + 0x10000000005000000000100000000000000000001000000003b0000) + 0x998000000003c0000000001000000000b0000000001000000003e0000) + 0x42000000003f0000000001000000000c000000000100000000400000) + 0x1eb000000004200000000010000000044000000000d00000000450000) + 0x1000000000500000000010000000000000000000100000000470000) + 0x6100000000480000000001000000004a0000000002000000004b0000) + 0x10000000003000000000100000000000000000001000000004d0000) + 0x12000000004e00000000010000000008000000000100000000030000) + 0x1000000000000000000010000000001000000000200000000000000) + 0x1000000005300000000010000000054000000000100000000530000) + 0x5a00000000010000000000000000005700000000000000000001001e) (h240 0x10000 + 0x5800000000010000000000000000000100000000050000000003001c) 0x5000f 0x5d0000000000001d 0x40023) + (.leaf8 0x4000d 0x1000e 0x5f0000000000000000000100000000020000000000001e 0x20000000000000b 0x40016 + 0x560016 0x530014 0x20010)) (.bin (.leaf8 0x10021 0x5300000000520016 0x14 + 0x1000000000300000000550000000000001f 0x550009 0x30021 0x800000000010016 0x9000000004c001a) + (.leaf8 0x4b0016 0x4b00000000010016 0x4a00000000490016 0x300000000046001a 0x4700000000460016 + 0x50014 0x490010 0x10021))) (.bin (.bin (.leaf8 0x60000000043001a 0x4400000000430016 + 0xf50000000040001a 0x4000000000400016 0x3f000000000a0016 0x20000000003d001a 0x3e000000003d0016 + 0x3c00000000090016) (.leaf8 0x4cb000000003a001a 0x3b000000003a0016 0x50014 0x3d0010 0x10021 + 0xa80000000037001a 0x350016 0x3600000000010016)) (.bin (.leaf8 0x17fe0000000034001a 0x330016 0x16 + 0x3480000000031001a 0x3100000000310016 0x300014 0x330010 0x10021) (.leaf8 0x77fb000000002e001a + 0x2f000000002e0016 0x2d0014 0x310010 0x10021 0x106b000000002b001a 0x2a0016 0x290014)))) (.bin + (.bin (.bin (.leaf8 0x20010 0x10021 0x257ed0000000028001a 0x2900000000280016 0x521b0000000025001a + 0x240016 0x20014 0x20010) (.leaf8 0x10021 0xbb7a70000000022001a 0x210016 0x19a89000000001f001a + 0x5000000001e0016 0x1e0014 0x70010 0x10021)) (.bin (.leaf8 0x3a9644000000001c001a + 0x1d000000001c0016 0x804ae0000000019001a 0x1a00000000190016 0x140014 0x1c0010 0x10021 + 0x124ef5a0000000016001a) (.leaf8 0x150016 0x15000000000f0016 0x28176b0000000013001a + 0x1300000000130016 0x5b8acc30000000010001a 0x8000000000f0016 0xc87522000000000d001a + 0xe000000000d0016))) (.bin (.bin (.leaf8 0xc00000000040016 0x1c9b5fcb000000000a001a + 0xb000000000a0016 0x90014 0xd0010 0x10021 0x3ea49aa0000000007001a 0x700000000070016) (.leaf8 + 0x8f08df140000000004001a 0x300000000030016 0x1393701b0000000001001a 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d)) (.bin (.leaf8 + 0x200000000020000000001001393701a000000000000000000010020 + 0x20000000003000000000100000000050000000001001f 0x100000000060023 + 0x200000000040000000001008f08df13000000000100000000000020 + 0x20000000006000000000100000000090000000004001f 0x80023 0x8000d + 0x2000000000700000000010003ea49a9000000000200000000010020) (.leaf8 0xb000e + 0x200000000080000000001000000000d00000000050000000000001e 0xc0023 0xc000d + 0x200000000090000000001001c9b5fca000000000300000000010020 + 0x2000000000a0000000001000000000e0000000002001f 0xd0023 0xd000d))))) (.bin (.bin (.bin (.bin + (.leaf8 0x2000000000a000000000100000000100000000008001f 0xf0023 0xf000d + 0x2000000000b00000000010000c87521000000000400000000010020 + 0x2000000000c0000000001000000000a0000000009001f 0x1000000000b0023 + 0x2000000000e000000000100039a1a51000000000500000000000020 + 0x20000000010000000000100000000140000000008001f) (.leaf8 (h240 0x100000000000000 + 0x100000000110000000000000000001400000000010000000000001e) 0x130023 0x13000d + 0x12000000000000021e926f000000000500000000010020 0x1200000000000000000015000000000c001f 0x140023 + 0x14000d 0x130000000000000028176a000000000600000000010020)) (.bin (.leaf8 + 0x14000000000000000000170000000009001f (h240 0x10000 + 0x1800000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1500000000000000000001000000000c0000000001001e 0x100000000020023 + 0x170000000000000124ef59000000000700000000000020 0x16000e + 0x1a0000000000000000001c000000000f0000000000001e) (.leaf8 0x1b0023 0x1b000d + 0x1b000000000000000804ad000000000800000000010020 0x1c0000000000000000001f0000000012001f 0x1e0023 + 0x1e000d 0x1d000000000000003a9643000000000900000000010020 0x20000e))) (.bin (.bin (.leaf8 + 0x1e0000000000000000000700000000120000000000001e 0x100000000080023 + 0x2000000000000000019a88000000000a00000000000020 0x22000000000000000000020000000015001f + 0x100000000030023 0x24000000000000000bb7a6000000000b00000000000020 0x4000e + 0x270000000000000000000200000000160000000000001e) (.leaf8 0x100000000030023 + 0x290000000000000000521a000000000c00000000000020 0x2b0000000000000000002b000000001a001f 0x2a0023 + 0x2a000d 0x2c000000000000000257ec000000000d00000000010020 0x2b000e + 0x2e00000000000000000002000000001a0000000000001e)) (.bin (.leaf8 0x100000000030023 + 0x300000000000000000106a000000000e00000000000020 0x2f000e + 0x3200000000000000000031000000001d0000000000001e 0x300023 0x30000d + 0x33000000000000000077fa000000000f00000000010020 0x32000e) (.leaf8 + 0x3400000000000000000033000000001f0000000000001e 0x320023 0x32000d + 0x3500000000000000000347000000001000000000010020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x380000000000000000000100000000200000000001001e)))) (.bin (.bin (.bin (.leaf8 0x100000000020023 + 0x3a000000000000000017fd000000001100000000000020 0x3c000000000000000000380000000000001f 0x370023 + 0x37000d 0x3c000000000000000000020000000022001f 0x100000000020023 + 0x3e000000000000000000a7000000001200000000000020) (.leaf8 0x7000e + 0x410000000000000000003d00000000250000000000001e 0x3c0023 0x3c000d + 0x42000000000000000004ca000000001300000000010020 0x430000000000000000003e0000000005001f (h240 + 0x10000 0x3f000000000100000000000000000001000000003f0000000003001c) 0x3f000f)) (.bin (.leaf8 + 0x440000000000000000003f00000000270000000001001e 0x3e0023 0x3e000d + 0x450000000000000000001f000000001400000000010020 0x46000000000000000000410000000006001f 0x400023 + 0x40000d 0x4600000000000000000042000000002a001f) (.leaf8 0x410023 0x41000d + 0x47000000000000000000f4000000001500000000010020 0x4800000000000000000046000000002c001f 0x450023 + 0x45000d 0x4900000000000000000005000000001600000000010020 0x7000e))) (.bin (.bin (.leaf8 + 0x4b00000000000000000049000000002d0000000000001e 0x480023 0x48000d + 0x4c0000000000000000002f000000001700000000010020 0x4d0000000000000000004c0000000030001f 0x4b0023 + 0x4b000d 0x4e0000000000000000004d0000000000001f) (.leaf8 0x4c0023 0x4c000d + 0x4f000000000000000000020000000031001f 0x100000000030023 + 0x5100000000000000000008000000001900000000000020 0x530000000000000000000a0000000000001f 0x90023 + 0x9000d)) (.bin (.leaf8 0x1000e (h240 0x20000 0x10000000002000000000100000000550000000003001c) + 0x55000f 0x570000000000000000005500000000330000000001001e 0x540023 0x54000d 0x55000e + 0x580000000000000000000200000000370000000000001e) (.leaf8 (h240 0x10000 + 0x200000000020000000000000000000100000000010000000003001c) 0x1000f + 0x5a0000000000000000000100000000010000000001001e 0x23 0xd 0x2000e 0xa00c6 0x10043)))))) (.bin + (.bin (.bin (.bin (.bin (.leaf8 0x20142 0x101c3 0x30009 0x14 0x40010 0x10021 0x5600000000000016 + 0x200000000540016) (.leaf8 0x14 0x40010 0x10021 0xb00000000000016 0x4000000004f001a 0x4e0016 + 0x4e00000000010016 0x4b000000004b0016)) (.bin (.leaf8 0x170000000049001a 0x4a00000000490016 + 0x4800000000060016 0x20000000046001a 0x4700000000460016 0x7a0000000043001a 0x4300000000430016 + 0x100000000040001a) (.leaf8 0x4000000000400016 0x3f0014 0x420010 0x10021 0x265000000003d001a + 0x3e000000003d0016 0x3c00000000060016 0x53000000003a001a))) (.bin (.bin (.leaf8 0x390016 0x20014 + 0x20010 0x10021 0xbff0000000037001a 0x360016 0x16 0x3600000000010016) (.leaf8 0x1a30000000034001a + 0x3400000000340016 0x3bfe0000000031001a 0x3000000000300016 0x835000000002e001a 0x2d0016 + 0x2c00000000010016 0x12bf6000000002b001a)) (.bin (.leaf8 0x2c000000002b0016 0x290d0000000028001a + 0x270016 0x500000000010016 0x5dbd30000000025001a 0x240016 0x2400000000010016 0xcd430000000022001a) + (.leaf8 0x2300000000220016 0x80014 0x250010 0x10021 0x1d4b22000000001f001a 0x20000000001f0016 + 0x40257000000001c001a 0x17000000001b0016)))) (.bin (.bin (.bin (.leaf8 0x9277ac0000000019001a + 0x1a00000000190016 0x20014 0x18000000000400000000000000000002000000001c0000000000001f 0x1c0009 + 0x20021 0x140bb50000000016001a 0x1600000000160016) (.leaf8 0x2dc56610000000013001a 0x120016 + 0x1200000000090016 0x643a900000000010001a 0x1100000000100016 0xe4dafe6000000000d001a + 0xc000000000c0016 0x1f524d5000000000a001a)) (.bin (.leaf8 0x900000000080016 + 0x47846f890000000007001a 0x60016 0x9c9b80e0000000004001a 0x300000000020016 + 0x165962e0d0000000001001a 0x16 0x14) (.leaf8 0x2000e 0x10022 + 0x2000000000200000000010030f097a3000000000000000000000020 (h240 0x100000000000000 + 0x1000000000500000000000134a59668000000000000000000010020) 0x6000000000000000000050000000000001f + 0x100000000050023 0x800000000000009c9b80d000000000100000000000020 + 0xa000000000000000000020000000003001f))) (.bin (.bin (.leaf8 0x100000000030023 + 0xc00000000000047846f88000000000200000000000020 0xe0000000000000000000b0000000004001f + 0x1000000000b0023 0x1000000000000001f524d4000000000300000000000020 + 0x120000000000000000000e0000000007001f 0x1000000000f0023 + 0x130000000000000e4dafe5000000000400000000000020) (.leaf8 0x1500000000000000000013000000000a001f + 0x120023 0x12000d 0x1600000000000000643a8f000000000500000000010020 + 0x17000000000000000000140000000005001f (h240 0x10000 + 0x1500000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1800000000000000000001000000000a0000000001001e)) (.bin (.leaf8 0x100000000020023 + 0x1a00000000000002dc5660000000000600000000000020 0x1c00000000000000000018000000000e001f 0x170023 + 0x17000d 0x1d00000000000000140bb4000000000700000000010020 0x1a000e + 0x100000000050000000001000000001c0000000002001c) (.leaf8 0x1c000f + 0x1f0000000000000000001c000000000d0000000001001e 0x1b0023 0x1b000d + 0x20000000000000009277ab000000000800000000010020 0x21000000000000000000190000000011001f + 0x1000000001a0023 0x2300000000000000040256000000000900000000000020))))) (.bin (.bin (.bin (.bin + (.leaf8 0x25000000000000000000220000000014001f 0x210023 0x21000d + 0x26000000000000001d4b21000000000a00000000010020 0xa000e + 0x280000000000000000002500000000150000000000001e 0x240023 0x24000d) (.leaf8 + 0x290000000000000000cd42000000000b00000000010020 0x2a000000000000000000260000000000001f 0x250023 + 0x25000d 0x2a000000000000000000020000000017001f 0x100000000030023 + 0x2c0000000000000005dbd2000000000c00000000000020 0x2e000000000000000000070000000000001f)) (.bin + (.leaf8 0x60023 0x6000d 0x2f000000000000000000020000000019001f 0x100000000030023 + 0x310000000000000000290c000000000d00000000000020 0x330000000000000000002e000000001c001f 0x2d0023 + 0x2d000d) (.leaf8 0x3400000000000000012bf5000000000e00000000010020 + 0x350000000000000000002e0000000000001f 0x2d0023 0x2d000d 0x3600000000000000000002000000001d001f + 0x100000000030023 0x3800000000000000000834000000000f00000000000020 + 0x3a00000000000000000032000000001f001f))) (.bin (.bin (.leaf8 0x100000000330023 + 0x3b00000000000000003bfd000000001000000000000020 0x3d000000000000000000360000000022001f 0x350023 + 0x35000d 0x3e000000000000000001a2000000001100000000010020 0x3f000000000000000000380000000000001f + 0x370023) (.leaf8 0x37000d 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x410000000000000000000100000000220000000001001e 0x100000000020023 + 0x4300000000000000000bfe000000001200000000000020 0x4000e)) (.bin (.leaf8 + 0x460000000000000000000200000000240000000000001e 0x100000000030023 + 0x4800000000000000000052000000001300000000000020 0x4a0000000000000000003e0000000003001f (h240 + 0x10000 0x3f000000000100000000000000000001000000003f0000000003001c) 0x3f000f + 0x4b0000000000000000003f00000000270000000001001e 0x3e0023) (.leaf8 0x3e000d + 0x4c00000000000000000264000000001400000000010020 0x41000e + 0x4d0000000000000000004200000000290000000000001e 0x410023 0x41000d + 0x4e0000000000000000000f000000001500000000010020 0x4f00000000000000000045000000002c001f)))) (.bin + (.bin (.bin (.leaf8 0x440023 0x44000d 0x5000000000000000000079000000001600000000010020 + 0x5100000000000000000049000000002e001f 0x480023 0x48000d + 0x5200000000000000000001000000001700000000010020 0x530000000000000000004a0000000003001f) (.leaf8 + (h240 0x10000 0x4b000000000100000000000000000001000000004b0000000003001c) 0x4b000f + 0x540000000000000000004b000000002f0000000001001e 0x4a0023 0x4a000d + 0x5500000000000000000016000000001800000000010020 0x560000000000000000004d0000000031001f (h240 + 0x10000 0x4e000000000100000000000000000001000000004f0000000003001c))) (.bin (.leaf8 0x4f000f + 0x570000000000001d 0x4e0023 0x4e000d 0x58000000000000000000020000000033001f 0x100000000030023 + 0x5a00000000000000000003000000001a00000000000020 0xd000e) (.leaf8 (h240 0x10000 + 0x10000000002000000000100000000040000000003001c) 0x4000f + 0x5f0000000000000000000400000000350000000001001e (h240 (h240 0x10000 + 0x5000000000100000000000000000001000000005800000000010000) + 0x10000000002000000000100000000040000000006001c) 0x4000f 0x640000000000001d 0x20000000003000b + 0x580014))) (.bin (.bin (.leaf8 0x5000000005a0000000000000000000200000000040000000000001f 0x40009 + 0x20021 0x16 0x54000000000c0016 0x10000000052001a 0x510016 0x5000000000010016) (.leaf8 0x4e0014 + 0x520010 0x10021 0xb000000004c001a 0x4c000000004c0016 0x4b0014 0x4e0010 0x10021)) (.bin (.leaf8 + 0x10000000049001a 0x4800000000480016 0x3c0000000046001a 0x4600000000460016 0x80000000043001a + 0x4200000000410016 0x1320000000040001a 0x4000000000400016) (.leaf8 0x3f0014 0x420010 0x10021 + 0x29000000003d001a 0x3c0016 0x500000000010016 0x5ff000000003a001a 0x390016)))))))))) + +set_option maxRecDepth 20000 in +def st_7 : CertTree := + (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x16 0x3900000000010016 + 0xd10000000037001a 0x3700000000370016 0x1dfe0000000034001a 0x3500000000340016 0x330014 0x370010) + (.leaf8 0x10021 0x41a0000000031001a 0x300016 0x2f00000000010016 0x95fb000000002e001a + 0x2d000000002d0016 0x1485000000002b001a 0x2c000000002b0016)) (.bin (.leaf8 0x30014 0x2e0010 + 0x10021 0x2a00000000060016 0x2ede80000000028001a 0x2900000000280016 0x30014 0x2b0010) (.leaf8 + 0x10021 0x66a20000000025001a 0xb00000000240016 0xea5910000000022001a 0x2100000000210016 + 0x2012a000000001f001a 0x20000000001f0016 0x1a0014))) (.bin (.bin (.leaf8 0x220010 0x10021 + 0x493bd6000000001c001a 0x5000000001b0016 0xa05db0000000019001a 0x1800000000170016 + 0x16e2b2f0000000016001a 0x1700000000160016) (.leaf8 0x20014 + 0x1500000000040000000000000000000200000000190000000000001f 0x190009 0x20021 0x321d480000000013001a + 0x1200000000120016 0x726d7f20000000010001a 0xf0016)) (.bin (.leaf8 0xfa926a000000000d001a + 0xe000000000d0016 0x14 0x100010 0x10021 0xc00000000090016 0x23c237c3000000000a001a + 0xb000000000a0016) (.leaf8 0x30014 0xd0010 0x10021 0x4e4dc060000000007001a 0x800000000070016 0x14 + 0xa0010 0x10021)))) (.bin (.bin (.bin (.leaf8 0x600000000030016 0xb2cb17050000000004001a + 0x500000000040016 0x30014 0x70010 0x10021 0x18784bd20000000001001a 0x16) (.leaf8 0x14 0x2000e + 0x10022 0x2000000000200000000010018784bd1000000000000000000000020 0x5000e + 0x200000000040000000001000000000700000000010000000000001e 0x60023 0x6000d)) (.bin (.leaf8 + 0x20000000005000000000100b2cb1704000000000100000000010020 + 0x20000000006000000000100000000080000000001001f (h240 0x1000000000900000000010000 + 0x100000000020000000001000000000a0000000004001c) 0xa000f + 0x200000000080000000001000000000a00000000020000000001001e 0x90023 0x9000d + 0x2000000000900000000010004e4dc05000000000200000000010020) (.leaf8 0x5000e + 0x2000000000b0000000001000000000d00000000050000000000001e 0xc0023 0xc000d + 0x2000000000c00000000010023c237c2000000000300000000010020 + 0x2000000000d0000000001000000000e0000000005001f (h240 0x1000000000f00000000010000 + 0x10000000002000000000100000000100000000004001c) 0x10000f))) (.bin (.bin (.leaf8 + 0x2000000000f0000000001000000001000000000060000000001001e 0xf0023 0xf000d + 0x2000000001000000000010000fa9269000000000400000000010020 + 0x20000000011000000000100000000020000000009001f 0x100000000030023 + 0x200000000130000000001000480a0ea000000000500000000000020 + 0x20000000015000000000100000000140000000002001f) (.leaf8 (h240 0x100000000000000 + 0x100000000160000000000000000001400000000070000000000001e) 0x130023 0x13000d + 0x1700000000000002a63705000000000500000000010020 0x1700000000000000000014000000000b001f + 0x100000000150023 0x1800000000000000321d47000000000600000000000020 0x17000e)) (.bin (.leaf8 + 0x10000000005000000000100000000190000000002001c 0x19000f + 0x1b00000000000000000019000000000b0000000001001e 0x180023 0x18000d + 0x1c000000000000016e2b2e000000000700000000010020 0x1d0000000000000000001a000000000e001f + 0x1000000001a0023) (.leaf8 0x1f000000000000000a05da000000000800000000000020 + 0x21000000000000000000070000000011001f 0x100000000080023 + 0x2300000000000000493bd5000000000900000000000020 0x1c000e + 0x260000000000000000002200000000130000000000001e 0x210023 0x21000d))))) (.bin (.bin (.bin (.bin + (.leaf8 0x2700000000000000020129000000000a00000000010020 0x28000000000000000000230000000015001f + 0x100000000240023 0x29000000000000000ea590000000000b00000000000020 + 0x2b0000000000000000000d0000000017001f 0x1000000000e0023 + 0x2d000000000000000066a1000000000c00000000000020 0x5000e) (.leaf8 + 0x300000000000000000002b00000000190000000000001e 0x2a0023 0x2a000d + 0x310000000000000002ede7000000000d00000000010020 0x320000000000000000002c0000000003001f (h240 + 0x1000000002d00000000010000 0x100000000050000000001000000002e0000000004001c) 0x2e000f + 0x340000000000000000002e000000001a0000000001001e)) (.bin (.leaf8 0x2d0023 0x2d000d + 0x3500000000000000001484000000000e00000000010020 0x360000000000000000002f000000001d001f + 0x100000000300023 0x37000000000000000095fa000000000f00000000000020 + 0x39000000000000000000310000000000001f 0x300023) (.leaf8 0x30000d + 0x3a00000000000000000002000000001f001f 0x100000000030023 + 0x3c00000000000000000419000000001000000000000020 0x35000e + 0x3e0000000000000000003700000000210000000000001e 0x360023 0x36000d))) (.bin (.bin (.leaf8 + 0x3f00000000000000001dfd000000001100000000010020 0x40000000000000000000390000000024001f 0x380023 + 0x38000d 0x41000000000000000000d0000000001200000000010020 0x420000000000000000003b0000000000001f + 0x3a0023 0x3a000d) (.leaf8 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x440000000000000000000100000000240000000001001e 0x100000000020023 + 0x46000000000000000005fe000000001300000000000020 0x48000000000000000000070000000000001f 0x60023)) + (.bin (.leaf8 0x6000d 0x49000000000000000000020000000027001f 0x100000000030023 + 0x4b00000000000000000028000000001400000000000020 0x41000e + 0x4d0000000000000000004200000000290000000000001e 0x410023 0x41000d) (.leaf8 + 0x4e00000000000000000131000000001500000000010020 0x4f00000000000000000044000000002a001f + 0x100000000440023 0x5100000000000000000007000000001600000000000020 + 0x5300000000000000000048000000002e001f 0x470023 0x47000d + 0x540000000000000000003b000000001700000000010020)))) (.bin (.bin (.bin (.leaf8 + 0x550000000000000000004a000000002f001f 0x1000000004b0023 + 0x5600000000000000000000000000001800000000000020 0x4d000e + 0x580000000000000000004e00000000310000000000001e 0x4d0023 0x4d000d + 0x590000000000000000000a000000001900000000010020) (.leaf8 0x50000e 0x510023 0x51000d + 0x5b000000000000000000020000000035001f 0x100000000030023 + 0x5d00000000000000000000000000001b00000000000020 0x5e000000000000000000560000000007001f (h240 + (h240 0x1000000005700000000010000 0x100000000020000000001000000000000000000010000) + 0x70000000001000000005b000000000100000000030000000007001c))) (.bin (.leaf8 0xa00c6 0x10043 + 0x5b0142 0x101c3 0x5c0009 0x50016 0x16 0x5600000000550016) (.leaf8 0x30014 0x580010 0x10021 + 0x5100000000510016 0x5000000004f001a 0x4f000000004f0016 0x4d000000004c0016 0x4b0014))) (.bin (.bin + (.leaf8 0x4f0010 0x10021 0x1e0000000049001a 0x4800000000470016 0x30000000046001a 0x450016 0x440014 + 0x20010) (.leaf8 0x10021 0x990000000043001a 0x4200000000410016 0x140000000040001a 0x3f0016 + 0x800000000010016 0x2ff000000003d001a 0x3c0016)) (.bin (.leaf8 0x16 0x3c00000000010016 + 0x68000000003a001a 0x3a000000003a0016 0xeff0000000037001a 0x3600000000360016 0x20c0000000034001a + 0x3500000000340016) (.leaf8 0x30014 0x370010 0x10021 0x3300000000300016 0x4afc0000000031001a + 0x3200000000310016 0x300014 0x340010)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 0x10021 + 0xa42000000002e001a 0x2f000000002e0016 0x30016 0x176f4000000002b001a 0x2c000000002b0016 + 0x2a00000000040016 0x33500000000028001a) (.leaf8 0x270016 0x27000000000c0016 0x752c70000000025001a + 0x2600000000250016 0x240014 0x280010 0x10021 0x100950000000022001a)) (.bin (.leaf8 + 0x1d00000000210016 0x249dea000000001f001a 0x20000000001f0016 0x80014 0x220010 0x10021 + 0x502ed000000001c001a 0x1b0016) (.leaf8 0x1a0014 0x20010 0x10021 0xb715970000000019001a + 0x1a00000000190016 0x1800000000030016 0x190ea30000000016001a 0x1700000000160016))) (.bin (.bin + (.leaf8 0x150014 0x190010 0x10021 0x3936bf80000000013001a 0x1400000000130016 0x30014 0x160010 + 0x10021) (.leaf8 0x7d49350000000010001a 0x2000000000f0016 0xf0014 0x40010 0x10021 + 0x11e11be1000000000d001a 0xe000000000d0016 0xc00000000040016)) (.bin (.leaf8 + 0x2726e02000000000a001a 0xb000000000a0016 0x16 0x59658b830000000007001a 0x600000000060016 + 0xc3c25e80000000004001a 0x500000000040016 0x30014) (.leaf8 0x70010 0x10021 + 0x1befbb9a80000000001001a 0x16 0x14 0x2000e 0x10022 + 0x200000000020000000001003d2cbd25000000000000000000000020)))) (.bin (.bin (.bin (.leaf8 (h240 + 0x100000000000000 0x1000000000500000000000181cefc81000000000000000000010020) 0x5000e + 0x60000000000000000000700000000010000000000001e 0x60023 0x6000d + 0x70000000000000c3c25e7000000000100000000010020 0x8000000000000000000080000000003001f + 0x100000000090023) (.leaf8 0x900000000000059658b82000000000200000000000020 0x2000e + 0x100000000000000000001000000000c0000000002001c 0xc000f + 0xd0000000000000000000c00000000050000000001001e 0xb0023 0xb000d + 0xe00000000000002726e01000000000300000000010020)) (.bin (.leaf8 + 0xf0000000000000000000e0000000002001f 0xd0023 0xd000d 0xf000000000000000000100000000008001f + 0xf0023 0xf000d 0x1000000000000011e11be0000000000400000000010020 0x11000e) (.leaf8 + 0x110000000000000000000400000000080000000000001e 0x100000000050023 + 0x13000000000000007d4934000000000500000000000020 0x5000e + 0x1600000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x1700000000000003936bf7000000000600000000010020))) (.bin (.bin (.leaf8 0x17000e + 0x1800000000000000000019000000000d0000000000001e 0x180023 0x18000d + 0x1900000000000000190ea2000000000700000000010020 0x1a0000000000000000001a0000000001001f (h240 + 0x10000 0x1b000000000100000000000000000001000000001b0000000003001c) 0x1b000f) (.leaf8 + 0x1b0000000000000000001b000000000f0000000001001e 0x1a0023 0x1a000d + 0x1c00000000000000b71596000000000800000000010020 0x1c000e + 0x1e0000000000000000000200000000100000000000001e 0x100000000030023 + 0x20000000000000000502ec000000000900000000000020)) (.bin (.leaf8 0xa000e + 0x230000000000000000002200000000130000000000001e 0x210023 0x21000d + 0x2400000000000000249de9000000000a00000000010020 0x250000000000000000001f0000000015001f + 0x100000000200023 0x2700000000000000010094000000000b00000000000020) (.leaf8 0x26000e + 0x290000000000000000002800000000170000000000001e 0x270023 0x27000d + 0x2a000000000000000752c6000000000c00000000010020 0x2b000000000000000000290000000007001f (h240 + 0x10000 0x2a00000000010000000000000000000100000000010000000003001c) 0x1000f))))) (.bin (.bin (.bin + (.bin (.leaf8 0x2c0000000000000000000100000000180000000001001e 0x100000000020023 + 0x2e0000000000000000334f000000000d00000000000020 0x300000000000000000002c0000000002001f 0x2b0023 + 0x2b000d 0x300000000000000000002e000000001c001f 0x2d0023) (.leaf8 0x2d000d + 0x31000000000000000176f3000000000e00000000010020 0x32000000000000000000020000000001001f (h240 + 0x10000 0x300000000010000000000000000000100000000300000000003001c) 0x30000f + 0x3400000000000000000030000000001d0000000001001e 0x2f0023 0x2f000d)) (.bin (.leaf8 + 0x3500000000000000000a41000000000f00000000010020 0x32000e + 0x3600000000000000000034000000001f0000000000001e 0x330023 0x33000d + 0x3700000000000000004afb000000001000000000010020 0x3800000000000000000035000000001f001f (h240 + 0x1000000003600000000010000 0x10000000005000000000100000000370000000004001c)) (.leaf8 0x37000f + 0x3a0000000000000000003700000000200000000001001e 0x360023 0x36000d + 0x3b0000000000000000020b000000001100000000010020 0x3c000000000000000000380000000023001f + 0x100000000390023 0x3d00000000000000000efe000000001200000000000020))) (.bin (.bin (.leaf8 + 0x3f0000000000000000003c0000000026001f 0x3b0023 0x3b000d + 0x4000000000000000000067000000001300000000010020 0x410000000000000000003e0000000000001f 0x3d0023 + 0x3d000d 0x2000e) (.leaf8 0x10000000000000000000100000000010000000002001c 0x1000f + 0x430000000000000000000100000000260000000001001e 0x100000000020023 + 0x45000000000000000002fe000000001400000000000020 0x470000000000000000000a0000000000001f 0x90023 + 0x9000d)) (.bin (.leaf8 0x48000000000000000000020000000029001f 0x100000000030023 + 0x4a00000000000000000013000000001500000000000020 0x4c00000000000000000044000000002a001f + 0x100000000440023 0x4e00000000000000000098000000001600000000000020 0x46000e + 0x5100000000000000000002000000002c0000000000001e) (.leaf8 0x100000000030023 + 0x5300000000000000000002000000001700000000000020 0x550000000000000000004a000000002e001f + 0x1000000004a0023 0x570000000000000000001d000000001800000000000020 0x4d000e + 0x590000000000000000004f00000000310000000000001e 0x4e0023)))) (.bin (.bin (.bin (.leaf8 0x4e000d + 0x5a000000000000000000510000000034001f 0x500023 0x50000d + 0x5b00000000000000000004000000001a00000000010020 0x5c000000000000000000530000000035001f (h240 + 0x1000000005400000000010000 0x10000000005000000000100000000580000000004001c) 0x58000f) (.leaf8 + 0x5e0000000000000000005800000000360000000001001e 0x570023 0x57000d 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x610000000000000000000100000000010000000001001e (h240 0x10000 + 0x1000000000200000000000000000001000000005c0000000003001c))) (.bin (.leaf8 0x5c000f + 0x630000000000000000005c00000000000000000001001e 0x5b000b 0x10014 + 0x300000000030000000000000000000200000000020000000000001f 0x20009 0x20021 0x500000000570016) + (.leaf8 0x540014 0x70010 0x10021 0x20000000052001a 0x5200000000520016 0x4e000000004e0016 + 0xe000000004c001a 0x4d000000004c0016))) (.bin (.bin (.leaf8 0x14 0x4f0010 0x10021 + 0x4b00000000480016 0x4a00000000490016 0x30014 0x4c0010 0x10021) (.leaf8 0x4800000000450016 + 0x4b0000000046001a 0x4700000000460016 0x14 0x490010 0x10021 0x4500000000420016 0x90000000043001a)) + (.bin (.leaf8 0x420016 0xb00000000010016 0x17f0000000040001a 0x3f0016 0x16 0x3f00000000010016 + 0x34000000003d001a 0x3c000000003b0016) (.leaf8 0x77e000000003a001a 0x3b000000003a0016 0x390014 + 0x3d0010 0x10021 0x1060000000037001a 0x500000000360016 0x360014))))))) (.bin (.bin (.bin (.bin + (.bin (.bin (.leaf8 0x70010 0x10021 0x257e0000000034001a 0x3300000000330016 0x5210000000031001a + 0x2f0016 0x3000000000010016 0xbb79000000002e001a) (.leaf8 0x2f000000002e0016 0x19a8000000002b001a + 0x2a0016 0x16 0x3a9640000000028001a 0x2700000000270016 0x804a0000000025001a 0x240016)) (.bin + (.leaf8 0x24000000001e0016 0x124ef40000000022001a 0x2300000000220016 0x2100000000090016 + 0x28175000000001f001a 0x20000000001f0016 0x30014 0x220010) (.leaf8 0x10021 0x1e000000001b0016 + 0x5b8acb000000001c001a 0x1a0016 0xc87520000000019001a 0x1800000000180016 0x1c9b5fc0000000016001a + 0x600000000150016))) (.bin (.bin (.leaf8 0x3ea49a0000000013001a 0x120016 0x1200000000030016 + 0x8f08df00000000010001a 0x1100000000100016 0x1393701000000000d001a 0xd000000000d0016 0x30014) + (.leaf8 0xf0010 0x10021 0x2cb2c5c1000000000a001a 0x90016 0x61e12f40000000007001a 0x800000000070016 + 0xdf7ddcd40000000004001a 0x30016)) (.bin (.leaf8 0x1e965e930000000001001a 0x200000000010016 0x14 + 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x200000000020000000001001e965e92000000000000000000010020 + 0x20000000003000000000100000000020000000001001f) (.leaf8 0x100000000030023 + 0x20000000005000000000100df7ddcd3000000000100000000000020 + 0x200000000070000000001000000000a0000000004001f 0x90023 0x9000d + 0x20000000008000000000100061e12f3000000000200000000010020 + 0x20000000009000000000100000000020000000005001f 0x100000000030023)))) (.bin (.bin (.bin (.leaf8 + 0x2000000000b0000000001002cb2c5c0000000000300000000000020 0x5000e + 0x2000000000e0000000001000000000f00000000070000000000001e 0xe0023 0xe000d + 0x2000000000f00000000010001393700000000000400000000010020 + 0x2000000001000000000010000000013000000000a001f 0x120023) (.leaf8 0x12000d + 0x2000000001100000000010005a0c933000000000500000000010020 + 0x20000000012000000000100000000140000000004001f 0x140009 0x130021 0x17 0x1d 0x103c3)) (.bin + (.leaf8 (h240 (h240 (h240 (h240 (h240 (h240 0x45d755086000000000300000000010000 + 0x5001e965e9300000000060000000001000000000300000000010000) + 0x1000000000800df7ddcd3000000000900000000010000) + 0xb00061e12f4000000000c0000000001000000000300000000010000) + 0x1000000000e002cb2c5c0000000000f00000000010000) + 0x6000000000100000000100001393701000000001200000000010000) + 0x140005a0c9340000000015000000000100000000140000000013001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000120000000000000000001400000000030000000001001e) + 0x130023 0x13000d 0x14000000000000034fc4ba000000000500000000010020 + 0x14000000000000000000140000000001001f (h240 0x10000 + 0x1500000000010000000000000000000100000000010000000003001c)) (.leaf8 0x1000f + 0x1500000000000000000001000000000a0000000001001e 0x100000000020023 + 0x17000000000000003ea499000000000600000000000020 0x1900000000000000000008000000000d001f + 0x100000000090023 0x1b00000000000001c9b5fb000000000700000000000020 + 0x1d0000000000000000001a000000000f001f))) (.bin (.bin (.leaf8 0x1000000001b0023 + 0x1e000000000000000c8751000000000800000000000020 0x20000000000000000000020000000010001f + 0x100000000020023 0x22000000000000005b8aca000000000900000000000020 + 0x24000000000000000000200000000011001f (h240 0x1000000002100000000010000 + 0x10000000005000000000100000000220000000004001c) 0x22000f) (.leaf8 + 0x260000000000000000002200000000120000000001001e 0x210023 0x21000d + 0x2700000000000000028174000000000a00000000010020 0x28000000000000000000230000000005001f (h240 + 0x10000 0x2400000000010000000000000000000100000000240000000003001c) 0x24000f + 0x290000000000000000002400000000150000000001001e)) (.bin (.leaf8 0x230023 0x23000d + 0x2a00000000000000124ef3000000000b00000000010020 0x2b000000000000000000260000000013001f (h240 + 0x10000 0x2700000000010000000000000000000100000000010000000003001c) 0x1000f + 0x2c0000000000000000000100000000160000000001001e 0x100000000020023) (.leaf8 + 0x2e00000000000000008049000000000c00000000000020 0x30000000000000000000290000000019001f + 0x1000000002a0023 0x310000000000000003a963000000000d00000000000020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x3500000000000000000001000000001a0000000001001e))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x100000000020023 0x37000000000000000019a7000000000e00000000000020 + 0x3900000000000000000031000000001e001f 0x300023 0x30000d + 0x3a0000000000000000bb78000000000f00000000010020 0x3b000000000000000000320000000000001f 0x310023) + (.leaf8 0x31000d 0x3b00000000000000000002000000001e001f 0x100000000020023 + 0x3d00000000000000000520000000001000000000000020 0x3f000000000000000000350000000021001f + 0x100000000360023 0x400000000000000000257d000000001100000000000020 0x38000e)) (.bin (.leaf8 + 0x420000000000000000000700000000220000000000001e 0x100000000080023 + 0x4400000000000000000105000000001200000000000020 0x3b000e + 0x460000000000000000003d00000000250000000000001e 0x3c0023 0x3c000d + 0x470000000000000000077d000000001300000000010020) (.leaf8 0x480000000000000000003e0000000026001f + 0x1000000003e0023 0x4a00000000000000000033000000001400000000000020 + 0x4c000000000000000000410000000000001f 0x400023 0x40000d 0x2000e + 0x10000000000000000000100000000010000000002001c))) (.bin (.bin (.leaf8 0x1000f + 0x4e0000000000000000000100000000280000000001001e 0x100000000020023 + 0x500000000000000000017e000000001500000000000020 0x520000000000000000000d0000000000001f 0xc0023 + 0xc000d 0x5300000000000000000002000000002b001f) (.leaf8 0x100000000030023 + 0x5500000000000000000008000000001600000000000020 0x5700000000000000000047000000002b001f (h240 + 0x1000000004800000000010000 0x10000000002000000000100000000490000000004001c) 0x49000f + 0x5900000000000000000049000000002c0000000001001e 0x480023 0x48000d)) (.bin (.leaf8 + 0x5a0000000000000000004a000000001700000000010020 0x5b0000000000000000004a000000002d001f (h240 + 0x1000000004b00000000010000 0x100000000050000000001000000004c0000000004001c) 0x4c000f + 0x5d0000000000000000004c000000002e0000000001001e 0x4b0023 0x4b000d + 0x5e0000000000000000004d000000002f001f) (.leaf8 (h240 0x1000000004e00000000010000 + 0x100000000020000000001000000004f0000000004001c) 0x4f000f + 0x610000000000000000004f00000000300000000001001e 0x4e0023 0x4e000d + 0x620000000000000000000d000000001900000000010020 0x63000000000000000000500000000033001f (h240 + 0x10000 0x5100000000010000000000000000000100000000530000000003001c))))) (.bin (.bin (.bin (.leaf8 + 0x53000f 0x640000000000000000005300000000350000000001001e 0x520023 0x52000d + 0x6500000000000000000001000000001b00000000010020 0x56000e + 0x660000000000000000000700000000380000000000001e (h240 + 0x100000000080000000001000000000000000000010000 + 0x500000000010000000004000000000100000000020000000005001c)) (.leaf8 0x2000f + 0x6a0000000000000000000200000000380000000001001e 0x2000a 0x40008 0x10009 0x10021 0x30016 + 0x5700000000060016)) (.bin (.leaf8 0x10000000055001a 0x520016 0x7000000004f001a 0x50000000004f0016 + 0x16 0x4d000000004c0016 0x30016 0x260000000049001a) (.leaf8 0x200000000480016 0x480014 0x40010 + 0x10021 0x40000000046001a 0x450016 0xe00000000010016 0xbf0000000043001a))) (.bin (.bin (.leaf8 + 0x420016 0x16 0x4200000000010016 0x190000000040001a 0x4100000000400016 0x14 0x430010 0x10021) + (.leaf8 0x3f000000003c0016 0x3be000000003d001a 0x3e000000003d0016 0x83000000003a001a 0x390016 + 0x3900000000060016 0x12be0000000037001a 0x3800000000370016)) (.bin (.leaf8 0x360014 0x3a0010 + 0x10021 0x2900000000034001a 0x330016 0x20014 0x20010 0x10021) (.leaf8 0x5dbd0000000031001a + 0x3000000000300016 0xcd3000000002e001a 0x2d0016 0x16 0x2d00000000010016 0x1d4b1000000002b001a + 0x2a0016)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 0x40250000000028001a 0x270016 0x16 + 0x9277a0000000025001a 0x2500000000250016 0x240014 0x270010 0x10021) (.leaf8 0x140ba0000000022001a + 0x2300000000220016 0x30016 0x2dc565000000001f001a 0x20000000001f0016 0x14 0x220010 0x10021)) (.bin + (.leaf8 0x1e00000000000016 0x643a8000000001c001a 0x1b0016 0xe4dafe0000000019001a 0x180016 + 0x1800000000070016 0x1f524c0000000016001a 0x150016) (.leaf8 0x16 0x47846f80000000013001a + 0x1400000000130016 0x9c9b800000000010001a 0x1000000000100016 0xf00000000040016 + 0x165962df000000000d001a 0xe000000000d0016))) (.bin (.bin (.leaf8 0x30014 0x100010 0x10021 + 0x30f097a000000000a001a 0x900000000090016 0x6fbeee690000000007001a 0x60016 0x600000000010016) + (.leaf8 0xf4b2f490000000004001a 0x300000000030016 0x22ebaa8420000000001001a 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d)) (.bin (.leaf8 + 0x200000000020000000001004c77ece8000000000000000000010020 (h240 0x100000000000000 + 0x10000000004000000000001e242bb58000000000000000000010020) 0x5000000000000000000050000000001001f + 0x100000000060023 0x60000000000000f4b2f48000000000100000000000020 + 0x8000000000000000000080000000000001f 0x70023 0x7000d) (.leaf8 + 0x8000000000000000000020000000003001f 0x100000000030023 + 0xa0000000000006fbeee68000000000200000000000020 0xc0000000000000000000b0000000005001f + 0x1000000000c0023 0xd000000000000030f0979000000000300000000000020 0x5000e + 0x100000000000000000001000000000070000000000001e)))) (.bin (.bin (.bin (.leaf8 0xf0023 0xf000d + 0x11000000000000165962de000000000400000000010020 0x12000000000000000000110000000002001f 0x100023 + 0x10000d 0x1200000000000000000012000000000a001f 0x110023) (.leaf8 0x11000d + 0x13000000000000009c9b7f000000000500000000010020 0x1400000000000000000016000000000c001f 0x150023 + 0x15000d 0x15000000000000047846f7000000000600000000010020 0x2000e + 0x10000000000000000000100000000010000000002001c)) (.bin (.leaf8 0x1000f + 0x1800000000000000000001000000000c0000000001001e 0x100000000020023 + 0x1a000000000000001f524b000000000700000000000020 0x1c0000000000000000001a0000000004001f 0x190023 + 0x19000d 0x1c00000000000000000002000000000f001f) (.leaf8 0x100000000030023 + 0x1e00000000000000e4dafd000000000800000000000020 0x20000000000000000000020000000011001f + 0x100000000030023 0x22000000000000000643a7000000000900000000000020 0x20000e (h240 0x10000 + 0x10000000002000000000100000000220000000003001c) 0x22000f))) (.bin (.bin (.leaf8 + 0x260000000000000000002200000000120000000001001e 0x210023 0x21000d + 0x27000000000000002dc564000000000a00000000010020 0x28000000000000000000020000000001001f (h240 + 0x10000 0x300000000010000000000000000000100000000240000000003001c) 0x24000f + 0x2a0000000000000000002400000000150000000001001e) (.leaf8 0x230023 0x23000d + 0x2b000000000000000140b9000000000b00000000010020 0x26000e + 0x2c0000000000000000002700000000170000000000001e 0x260023 0x26000d + 0x2d00000000000000092779000000000c00000000010020)) (.bin (.leaf8 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x300000000000000000000100000000180000000001001e 0x100000000020023 + 0x3200000000000000004024000000000d00000000000020 0x3400000000000000000002000000001b001f + 0x100000000030023) (.leaf8 0x360000000000000001d4b0000000000e00000000000020 + 0x380000000000000000002f0000000000001f 0x2e0023 0x2e000d 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x3a00000000000000000001000000001c0000000001001e))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x100000000020023 0x3c00000000000000000cd2000000000f00000000000020 + 0x3e00000000000000000032000000001f001f 0x100000000330023 + 0x3f00000000000000005dbc000000001000000000000020 0x4000e + 0x420000000000000000000200000000200000000000001e 0x100000000030023) (.leaf8 + 0x440000000000000000028f000000001100000000000020 0x38000e + 0x460000000000000000003a00000000230000000000001e 0x390023 0x39000d + 0x47000000000000000012bd000000001200000000010020 0x480000000000000000003b0000000003001f (h240 + 0x10000 0x3c00000000010000000000000000000100000000010000000003001c))) (.bin (.leaf8 0x1000f + 0x490000000000000000000100000000240000000001001e 0x100000000020023 + 0x4b00000000000000000082000000001300000000000020 0x4d000000000000000000400000000028001f 0x3f0023 + 0x3f000d 0x4e000000000000000003bd000000001400000000010020) (.leaf8 + 0x4f000000000000000000410000000027001f (h240 0x1000000004200000000010000 + 0x10000000002000000000100000000430000000004001c) 0x43000f + 0x510000000000000000004300000000280000000001001e 0x420023 0x42000d + 0x5200000000000000000018000000001500000000010020 0x53000000000000000000440000000000001f))) (.bin + (.bin (.leaf8 0x430023 0x43000d 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x5500000000000000000001000000002a0000000001001e 0x100000000020023 + 0x57000000000000000000be000000001600000000000020) (.leaf8 0x59000000000000000000100000000000001f + 0xf0023 0xf000d 0x5a00000000000000000002000000002d001f 0x100000000030023 + 0x5c00000000000000000003000000001700000000000020 0x4a000e + 0x5e00000000000000000004000000002e0000000000001e)) (.bin (.leaf8 0x100000000050023 + 0x6000000000000000000025000000001800000000000020 0x62000000000000000000020000000001001f (h240 + 0x10000 0x3000000000100000000000000000001000000004e0000000003001c) 0x4e000f + 0x640000000000000000004e00000000310000000001001e 0x4d0023 0x4d000d) (.leaf8 0x2000e + 0x10000000000000000000100000000510000000002001c 0x51000f + 0x670000000000000000005100000000330000000001001e 0x500023 0x50000d + 0x6800000000000000000006000000001a00000000010020 0x69000000000000000000020000000036001f)))) (.bin + (.bin (.bin (.leaf8 0x10023 0x1000d 0x6a00000000000000000000000000001c00000000010020 + 0x6b000000000000000000590000000003001f (h240 0x10000 + 0x5a00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x6c0000000000000000000100000000000000000001001e (h240 0x1000000000200000000010000 + 0x10000000005000000000100000000010000000004001c)) (.leaf8 0x1000f 0x6f0000000000001d + 0x50000000000000b 0x20014 0x5000e 0x1000c6 0x10043 0x40142)) (.bin (.leaf8 0x101c3 0x50009 0x10186 + 0x6b0000000000001d 0x5a000f 0x6b0000000000001d 0x590023 0x59000d) (.leaf8 + 0x6c000000000000000000060000000003001f 0x5b0000000005000b 0x300000000580016 0x30000000052001a + 0x5200000000520016 0x30014 0x540010 0x10021))) (.bin (.bin (.leaf8 0x4d0016 0x4e00000000010016 + 0x12000000004c001a 0x4b0016 0x4b00000000030016 0x10000000049001a 0x4a00000000490016 0x30014) + (.leaf8 0x4c0010 0x10021 0x48000000000f0016 0x5e0000000046001a 0x4700000000460016 0x20014 + 0x300000000040000000000000000000200000000490000000000001f 0x490009)) (.bin (.leaf8 0x10021 + 0xd0000000043001a 0x200000000420016 0x420014 0x40010 0x10021 0x1df0000000040001a + 0x3f000000003f0016) (.leaf8 0x40000000003d001a 0x3e000000003d0016 0x20014 + 0x3c00000000040000000000000000000200000000400000000000001f 0x400009 0x20021 0x95f000000003a001a + 0x3900000000390016)))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x1470000000037001a + 0x3800000000370016 0x30014 0x3a0010 0x10021 0x3600000000030016 0x2edd0000000034001a + 0x3500000000340016) (.leaf8 0x330014 0x370010 0x10021 0x6690000000031001a 0x300016 0x16 + 0x3000000000010016 0xea58000000002e001a)) (.bin (.leaf8 0x2d0016 0x2d00000000010016 + 0x2011000000002b001a 0x2c000000002b0016 0x20014 + 0x3000000000400000000000000000002000000002e0000000000001f 0x2e0009 0x10021) (.leaf8 + 0x493bd0000000028001a 0x2700000000260016 0xa05d0000000025001a 0x230016 0x2400000000010016 + 0x16e2b20000000022001a 0x200000000210016 0x210014))) (.bin (.bin (.leaf8 0x40010 0x10021 + 0x321d3000000001f001a 0x20000000001f0016 0x30014 0x220010 0x10021 0x726d7e000000001c001a) (.leaf8 + 0x1d000000001c0016 0x30014 0x1f0010 0x10021 0xfa9260000000019001a 0x180016 0x16 + 0x1800000000010016)) (.bin (.leaf8 0x23c237b0000000016001a 0x1700000000160016 + 0x4e4dc00000000013001a 0x1200000000110016 0xb2cb16f0000000010001a 0x1100000000100016 + 0xf00000000040016 0x18784bc000000000d001a) (.leaf8 0xc0016 0x37df7734000000000a001a + 0xb000000000a0016 0x30014 0xd0010 0x10021 0x7a597a40000000007001a 0x800000000070016)))) (.bin + (.bin (.bin (.leaf8 0x60014 0xa0010 0x10021 0x1175d54210000000004001a 0x300000000020016 + 0x263bf6740000000001001a 0x200000000010016 0x14) (.leaf8 + 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x20000000002000000000100263bf673000000000000000000010020 + 0x20000000003000000000100000000050000000000001f 0x100000000050023 + 0x20000000005000000000101175d5420000000000100000000000020 0x8000e)) (.bin (.leaf8 + 0x200000000070000000001000000000a00000000030000000000001e 0x90023 0x9000d + 0x2000000000800000000010007a597a3000000000200000000010020 0x5000e + 0x2000000000a0000000001000000000d00000000050000000000001e 0xc0023 0xc000d) (.leaf8 + 0x2000000000b00000000010037df7733000000000300000000010020 + 0x2000000000c000000000100000000020000000007001f 0x100000000030023 + 0x2000000000e000000000100018784bb000000000400000000000020 + 0x20000000010000000000100000000110000000002001f 0x100023 0x10000d + 0x2000000001000000000010000000013000000000a001f))) (.bin (.bin (.leaf8 0x120023 0x12000d + 0x200000000110000000001000708fb76000000000500000000010020 + 0x20000000012000000000100000000140000000002001f 0x140009 0x130021 0x17 0x1d) (.leaf8 0x103c3 (h240 + (h240 (h240 (h240 (h240 (h240 0x574d2a456000000000300000000010000 + 0x500263bf67400000000060000000001000000000500000000020000) + 0x1000000000801175d5421000000000900000000010000) + 0xb0007a597a4000000000c0000000001000000000600000000010000) + 0xe0037df7734000000000f0000000001000000000300000000010000) + 0x1000000001100018784bc000000001200000000010000) + 0x14000708fb770000000015000000000100000000140000000013001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000120000000000000000001400000000050000000001001e) + 0x130023 0x13000d 0x140000000000000423b5f6000000000500000000010020 + 0x1400000000000000000014000000000a001f)) (.bin (.leaf8 0x100000000140023 + 0x16000000000000004e4dbf000000000600000000000020 0x1800000000000000000019000000000e001f 0x180023 + 0x18000d 0x19000000000000023c237a000000000700000000010020 0x1a0000000000000000001a0000000000001f + 0x190023) (.leaf8 0x19000d 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x1c00000000000000000001000000000e0000000001001e 0x100000000020023 + 0x1e000000000000000fa925000000000800000000000020 0x5000e))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x210000000000000000001f00000000110000000000001e 0x1e0023 0x1e000d + 0x2200000000000000726d7d000000000900000000010020 0x5000e + 0x240000000000000000002200000000130000000000001e 0x210023 0x21000d) (.leaf8 + 0x25000000000000000321d2000000000a00000000010020 0x23000e + 0x260000000000000000000400000000140000000000001e 0x100000000050023 + 0x280000000000000016e2b1000000000b00000000000020 0x2a000000000000000000260000000000001f 0x250023 + 0x25000d)) (.bin (.leaf8 0x2a000000000000000000020000000016001f 0x100000000020023 + 0x2c0000000000000000a05c000000000c00000000000020 0x2e000000000000000000290000000018001f + 0x100000000290023 0x30000000000000000493bc000000000d00000000000020 0x5000e + 0x100000000050000000001000000002e0000000002001c) (.leaf8 0x2e000f + 0x340000000000000000002e00000000190000000001001e 0x2d0023 0x2d000d + 0x3500000000000000002010000000000e00000000010020 0x360000000000000000002f0000000000001f 0x2e0023 + 0x2e000d))) (.bin (.bin (.leaf8 0x3600000000000000000002000000001d001f 0x100000000030023 + 0x380000000000000000ea57000000000f00000000000020 0x3a000000000000000000320000000000001f 0x310023 + 0x31000d 0x2000e 0x10000000000000000000100000000010000000002001c) (.leaf8 0x1000f + 0x3c00000000000000000001000000001e0000000001001e 0x100000000020023 + 0x3e00000000000000000668000000001000000000000020 0x35000e + 0x400000000000000000003700000000210000000000001e 0x360023 0x36000d)) (.bin (.leaf8 + 0x4100000000000000002edc000000001100000000010020 0x42000000000000000000380000000001001f (h240 + 0x1000000003900000000010000 0x100000000050000000001000000003a0000000004001c) 0x3a000f + 0x440000000000000000003a00000000220000000001001e 0x390023 0x39000d + 0x4500000000000000000146000000001200000000010020) (.leaf8 0x460000000000000000003b0000000025001f + 0x1000000003c0023 0x470000000000000000095e000000001300000000000020 0x3e000e + 0x10000000005000000000100000000400000000002001c 0x40000f + 0x4a0000000000000000004000000000250000000001001e 0x3f0023)))) (.bin (.bin (.bin (.leaf8 0x3f000d + 0x4b0000000000000000003f000000001400000000010020 0x4c000000000000000000410000000029001f + 0x100000000420023 0x4d000000000000000001de000000001500000000000020 0x44000e + 0x4f00000000000000000004000000002a0000000000001e 0x100000000050023) (.leaf8 + 0x510000000000000000000c000000001600000000000020 0x5000e + 0x10000000005000000000100000000490000000002001c 0x49000f + 0x5500000000000000000049000000002b0000000001001e 0x480023 0x48000d + 0x560000000000000000005d000000001700000000010020)) (.bin (.leaf8 + 0x570000000000000000004a0000000009001f (h240 0x1000000004b00000000010000 + 0x100000000050000000001000000004c0000000004001c) 0x4c000f + 0x590000000000000000004c000000002e0000000001001e 0x4b0023 0x4b000d + 0x5a00000000000000000000000000001800000000010020 0x5b0000000000000000004d0000000001001f) (.leaf8 + (h240 0x10000 0x4e00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x5c0000000000000000000100000000300000000001001e 0x100000000020023 + 0x5e00000000000000000011000000001900000000000020 0x60000000000000000000500000000000001f 0x4f0023 + 0x4f000d))) (.bin (.bin (.leaf8 0x60000000000000000000020000000032001f (h240 + 0x1000000000200000000020000 0x10000000005000000000100000000540000000004001c) 0x54000f + 0x630000000000000000005400000000340000000001001e 0x530023 0x53000d + 0x6400000000000000000002000000001b00000000010020 0x6500000000000000000005000000003a001f) (.leaf8 + 0x40023 0x4000d 0x660000000000000000005d0000000002001f 0x6000000005d000b 0x10000000055001a + 0x5500000000550016 0x30016 0x20014)) (.bin (.leaf8 0x20010 0x10021 0x9000000004f001a 0x4e0016 0x16 + 0x1000000004c001a 0x5000000004b0016 0x4b0014) (.leaf8 0x70010 0x10021 0x2f0000000049001a + 0x500000000480016 0x4800000000040016 0x50000000046001a 0x4700000000460016 0x50014)))))) (.bin + (.bin (.bin (.bin (.bin (.leaf8 0x490010 0x10021 0xef0000000043001a 0x4400000000430016 0x420014 + 0x460010 0x10021 0x200000000040001a) (.leaf8 0x5000000003f0016 0x4af000000003d001a + 0x3e000000003d0016 0x3c0014 0x400010 0x10021 0xa3000000003a001a 0x3b000000003a0016)) (.bin (.leaf8 + 0x30016 0x176f0000000037001a 0x3600000000360016 0x3340000000034001a 0x330016 0x16 + 0x3300000000010016 0x752b0000000031001a) (.leaf8 0x3200000000310016 0x30014 0x340010 0x10021 + 0x1009000000002e001a 0x5000000002d0016 0x2d00000000040016 0x249dd000000002b001a))) (.bin (.bin + (.leaf8 0x2c000000002b0016 0x14 0x2e0010 0x10021 0x2a00000000270016 0x502d0000000028001a + 0x2900000000280016 0x14) (.leaf8 0x2b0010 0x10021 0x2700000000000016 0xb71580000000025001a + 0x2600000000250016 0x50014 0x280010 0x10021)) (.bin (.leaf8 0x190ea0000000022001a + 0x600000000210016 0x3936bf000000001f001a 0x6000000001e0016 0x7d492000000001c001a + 0x1d000000001c0016 0x20014 0x3000000000400000000000000000002000000001f0000000000001f) (.leaf8 + 0x1f0009 0x10021 0x11e11be0000000019001a 0x1800000000180016 0x2726df0000000016001a 0x150016 + 0x140014 0x20010)))) (.bin (.bin (.bin (.leaf8 0x10021 0x59658b70000000013001a 0x1400000000130016 + 0xc3c25e0000000010001a 0xf0016 0xf00000000010016 0x1befbb99000000000d001a 0xe000000000d0016) + (.leaf8 0xc00000000040016 0x3d2cbd1000000000a001a 0xb000000000a0016 0x8baeaa100000000007001a + 0x800000000070016 0x14 0xa0010 0x10021)) (.bin (.leaf8 0x600000000030016 0x131dfb390000000004001a + 0x500000000040016 0x2ba69522b0000000001001a 0x3001d + 0x100000000010000000001005f95e7a5000000000000000000000020 0x50010 0x60021) (.leaf8 0x17 0x1d + 0x103c3 (h240 (h240 0x5f95e7a60000 0x3000000000100000000020000000002000000000000000000010000) + 0x5005f95e7a50000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x200000000050000000000025ad36a83000000000000000000010020) + 0x7000000000000000000070000000002001f 0x60023))) (.bin (.bin (.leaf8 0x6000d + 0x8000000000000131dfb38000000000100000000010020 0x9000000000000000000080000000001001f (h240 + 0x1000000000900000000010000 0x100000000020000000001000000000a0000000004001c) 0xa000f + 0xb0000000000000000000a00000000020000000001001e 0x90023 0x9000d) (.leaf8 + 0xc0000000000008baeaa0f000000000200000000010020 0xd0000000000000000000d0000000006001f 0xc0023 + 0xc000d 0xe00000000000003d2cbd0000000000300000000010020 0xf0000000000000000000e0000000002001f + 0xd0023 0xd000d)) (.bin (.leaf8 0xf000000000000000000100000000008001f 0xf0023 0xf000d + 0x100000000000001befbb98000000000400000000010020 0x11000000000000000000110000000000001f 0x100023 + 0x10000d 0x11000000000000000000020000000009001f) (.leaf8 0x100000000030023 + 0x1300000000000000c3c25d000000000500000000000020 0x1500000000000000000016000000000c001f 0x150023 + 0x15000d 0x16000000000000059658b6000000000600000000010020 0x16000e + 0x1800000000000000000002000000000c0000000000001e))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x100000000030023 0x1a000000000000002726de000000000700000000000020 + 0x1c0000000000000000001a000000000f001f 0x1000000001b0023 + 0x1d000000000000011e11bd000000000800000000000020 0x5000e + 0x100000000050000000001000000001f0000000002001c 0x1f000f) (.leaf8 + 0x210000000000000000001f000000000f0000000001001e 0x1e0023 0x1e000d + 0x220000000000000007d491000000000900000000010020 0x23000000000000000000080000000013001f + 0x100000000090023 0x25000000000000003936be000000000a00000000000020 + 0x27000000000000000000080000000015001f)) (.bin (.leaf8 0x100000000090023 + 0x29000000000000000190e9000000000b00000000000020 0x7000e + 0x2c0000000000000000002800000000170000000000001e 0x270023 0x27000d + 0x2d000000000000000b7157000000000c00000000010020 0x29000e) (.leaf8 (h240 0x10000 + 0x100000000020000000001000000002b0000000003001c) 0x2b000f + 0x300000000000000000002b00000000180000000001001e 0x2a0023 0x2a000d + 0x310000000000000000502c000000000d00000000010020 0x320000000000000000002c0000000019001f (h240 + 0x1000000002d00000000010000 0x100000000020000000001000000002e0000000004001c)))) (.bin (.bin + (.leaf8 0x2e000f 0x340000000000000000002e000000001a0000000001001e 0x2d0023 0x2d000d + 0x35000000000000000249dc000000000e00000000010020 0x360000000000000000002f0000000002001f 0x2e0023 + 0x2e000d) (.leaf8 0x3600000000000000000007000000001d001f 0x100000000080023 + 0x3800000000000000001008000000000f00000000000020 0x5000e + 0x3b00000000000000000034000000001f0000000000001e 0x330023 0x33000d + 0x3c0000000000000000752a000000001000000000010020)) (.bin (.leaf8 + 0x3d000000000000000000350000000000001f 0x340023 0x34000d 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x3f0000000000000000000100000000200000000001001e 0x100000000020023) (.leaf8 + 0x4100000000000000000333000000001100000000000020 0x43000000000000000000380000000023001f + 0x100000000390023 0x440000000000000000176e000000001200000000000020 + 0x46000000000000000000020000000001001f (h240 0x10000 + 0x3000000000100000000000000000001000000003c0000000003001c) 0x3c000f + 0x480000000000000000003c00000000250000000001001e)))) (.bin (.bin (.bin (.leaf8 0x3b0023 0x3b000d + 0x49000000000000000000a2000000001300000000010020 0x3e000e + 0x4a0000000000000000004000000000270000000000001e 0x3f0023 0x3f000d + 0x4b000000000000000004ae000000001400000000010020) (.leaf8 0x4c000000000000000000070000000029001f + 0x100000000080023 0x4e0000000000000000001f000000001500000000000020 0x44000e + 0x5000000000000000000046000000002b0000000000001e 0x450023 0x45000d + 0x51000000000000000000ee000000001600000000010020)) (.bin (.leaf8 0x7000e + 0x5300000000000000000049000000002d0000000000001e 0x480023 0x48000d + 0x5400000000000000000004000000001700000000010020 0x550000000000000000004a0000000002001f 0x490023 + 0x49000d) (.leaf8 0x5500000000000000000007000000002f001f 0x100000000080023 + 0x570000000000000000002e000000001800000000000020 0x4d000e + 0x590000000000000000000700000000300000000000001e 0x100000000080023 + 0x5b00000000000000000000000000001900000000000020 0x2000e))) (.bin (.bin (.leaf8 + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x5e0000000000000000000100000000320000000001001e 0x100000000020023 + 0x6000000000000000000008000000001a00000000000020 0x4000e + 0x630000000000000000000200000000000000000000001e (h240 0x10000 + 0x300000000010000000000000000000100000000560000000003001c)) (.leaf8 0x56000f + 0x650000000000000000005600000000370000000001001e 0x550023 0x55000d + 0x6600000000000000000000000000001c00000000010020 0x6700000000000000000008000000003d001f + 0x5a0000000007000b 0x550016)) (.bin (.leaf8 0x500000000010016 0x40000000052001a 0x510016 0x16 + 0x5000000000010016 0x80014 0x520010 0x10021) (.leaf8 0x17000000004c001a 0x4d000000004c0016 0x80014 + 0x4f0010 0x10021 0x30000000049001a 0x800000000480016 0x770000000046001a))))))) (.bin (.bin (.bin + (.bin (.bin (.bin (.leaf8 0x4700000000460016 0x100000000043001a 0x420016 0x4200000000060016 + 0x2570000000040001a 0x3f000000003f0016 0x51000000003d001a 0x3d000000003d0016) (.leaf8 0x30014 + 0x3f0010 0x10021 0xbb7000000003a001a 0x390016 0x19a0000000037001a 0x360016 0x16)) (.bin (.leaf8 + 0x3600000000010016 0x3a950000000034001a 0x3500000000340016 0x3300000000040016 0x8030000000031001a + 0x3200000000310016 0x80014 0x340010) (.leaf8 0x10021 0x124ef000000002e001a 0x2000000002d0016 + 0x2d0014 0x40010 0x10021 0x2816000000002b001a 0x2c000000002b0016))) (.bin (.bin (.leaf8 0x16 + 0x5b8ac0000000028001a 0x2900000000280016 0x2700000000060016 0xc8740000000025001a 0x240016 + 0x2400000000070016 0x1c9b5e0000000022001a) (.leaf8 0x2300000000220016 0x90014 0x250010 0x10021 + 0x3ea49000000001f001a 0x5000000001e0016 0x1e00000000040016 0x8f08de000000001c001a)) (.bin (.leaf8 + 0x1b0016 0x13936f0000000019001a 0x1a00000000190016 0x30014 0x1c0010 0x10021 0x1800000000150016 + 0x2cb2c5b0000000016001a) (.leaf8 0x1500000000150016 0x61e12e0000000013001a 0x120016 + 0x1200000000010016 0xdf7ddcc0000000010001a 0x1100000000100016 0x1e965e9000000000d001a + 0xc000000000c0016)))) (.bin (.bin (.bin (.leaf8 0x45d75507000000000a001a 0xb000000000a0016 0x16 + 0x98efd9d0000000007001a 0x600000000060016 0x15d34a9140000000004001a 0x500000000040016 0x14) + (.leaf8 0x70010 0x10021 0x300000000000016 0x2fcaf3d20000000001001a 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f 0x20023)) (.bin (.leaf8 0x2000d + 0x200000000020000000001002fcaf3d1000000000000000000010020 0x5000e (h240 0x10000 + 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x200000000050000000001000000000700000000000000000001001e 0x60023 0x6000d) (.leaf8 + 0x200000000060000000001015d34a913000000000100000000010020 + 0x20000000007000000000100000000080000000003001f 0x100000000090023 + 0x20000000008000000000100098efd9c000000000200000000000020 0x2000e + 0x100000000000000000001000000000c0000000002001c 0xc000f + 0x2000000000c0000000001000000000c00000000050000000001001e))) (.bin (.bin (.leaf8 0xb0023 0xb000d + 0x2000000000d00000000010045d75506000000000300000000010020 + 0x2000000000e0000000001000000000e0000000007001f 0x1000000000f0023 + 0x2000000000f00000000010001e965e8000000000400000000000020 + 0x2000000001100000000010000000013000000000a001f 0x120023) (.leaf8 0x12000d + 0x2000000001200000000010008cb3a67000000000500000000010020 + 0x20000000013000000000100000000140000000003001f (h240 0x100000000000000 + 0x100000000140000000000000000001400000000060000000000001e) 0x130023 0x13000d + 0x15000000000000052ca362000000000500000000010020 0x15000000000000000000140000000000001f)) (.bin + (.leaf8 0x130023 0x13000d 0x1500000000000000000002000000000b001f 0x100000000030023 + 0x170000000000000061e12d000000000600000000000020 0x1900000000000000000017000000000d001f + 0x100000000180023 0x1a00000000000002cb2c5a000000000700000000000020) (.leaf8 + 0x1c0000000000000000001a000000000d001f (h240 0x1000000001b00000000010000 + 0x100000000050000000001000000001c0000000004001c) 0x1c000f + 0x1e0000000000000000001c000000000e0000000001001e 0x1b0023 0x1b000d + 0x1f0000000000000013936e000000000800000000010020 0x20000000000000000000020000000011001f))))) (.bin + (.bin (.bin (.bin (.leaf8 0x100000000030023 0x22000000000000008f08dd000000000900000000000020 + 0x24000000000000000000200000000002001f 0x1f0023 0x1f000d 0x24000000000000000000070000000013001f + 0x100000000080023 0x260000000000000003ea48000000000a00000000000020) (.leaf8 0xb000e + 0x290000000000000000002500000000150000000000001e 0x240023 0x24000d + 0x2a000000000000001c9b5d000000000b00000000010020 0x2b000000000000000000260000000004001f 0x250023 + 0x25000d)) (.bin (.leaf8 0x2b000000000000000000020000000017001f 0x100000000030023 + 0x2d0000000000000000c873000000000c00000000000020 0x2f000000000000000000290000000003001f (h240 + 0x10000 0x2a000000000100000000000000000001000000002a0000000003001c) 0x2a000f + 0x300000000000000000002a00000000190000000001001e 0x290023) (.leaf8 0x29000d + 0x310000000000000005b8ab000000000d00000000010020 0x2000e + 0x100000000000000000001000000002d0000000002001c 0x2d000f + 0x340000000000000000002d000000001b0000000001001e 0x2c0023 0x2c000d))) (.bin (.bin (.leaf8 + 0x3500000000000000002815000000000e00000000010020 0x2f000e + 0x3600000000000000000004000000001c0000000000001e 0x100000000050023 + 0x38000000000000000124ee000000000f00000000000020 0xa000e + 0x3b00000000000000000034000000001f0000000000001e 0x330023) (.leaf8 0x33000d + 0x3c00000000000000000802000000001000000000010020 0x3d000000000000000000350000000002001f 0x340023 + 0x34000d 0x3d000000000000000000370000000022001f 0x360023 0x36000d)) (.bin (.leaf8 + 0x3e00000000000000003a94000000001100000000010020 0x3f000000000000000000380000000000001f 0x370023 + 0x37000d 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x410000000000000000000100000000220000000001001e) (.leaf8 0x100000000020023 + 0x4300000000000000000199000000001200000000000020 0x45000000000000000000020000000025001f + 0x100000000030023 0x4700000000000000000bb6000000001300000000000020 0x5000e + 0x4a0000000000000000003f00000000270000000000001e 0x3e0023)))) (.bin (.bin (.bin (.leaf8 0x3e000d + 0x4b00000000000000000050000000001400000000010020 0x4c000000000000000000410000000029001f + 0x100000000420023 0x4d00000000000000000256000000001500000000000020 + 0x4f000000000000000000440000000003001f (h240 0x10000 + 0x4500000000010000000000000000000100000000010000000003001c) 0x1000f) (.leaf8 + 0x5000000000000000000001000000002a0000000001001e 0x100000000020023 + 0x520000000000000000000f000000001600000000000020 0x5400000000000000000049000000002e001f 0x480023 + 0x48000d 0x5500000000000000000076000000001700000000010020 0x560000000000000000000a000000002f001f)) + (.bin (.leaf8 0x1000000000b0023 0x5800000000000000000002000000001800000000000020 0xa000e + 0x5b0000000000000000004f00000000310000000000001e 0x4e0023 0x4e000d + 0x5c00000000000000000016000000001900000000010020 0xa000e) (.leaf8 0x510023 0x51000d 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x610000000000000000000100000000340000000001001e 0x100000000020023 + 0x6300000000000000000003000000001b00000000000020))) (.bin (.bin (.leaf8 + 0x65000000000000000000070000000000001f 0x60023 0x6000d 0x66000000000000000000020000000038001f + 0x10023 0x1000d 0x670000000000000000005c0000000003001f 0x5c000a) (.leaf8 0x30008 0x10009 0x10021 + 0x5700000000060016 0x10000000055001a 0x540016 0x16 0x5300000000010016)) (.bin (.leaf8 + 0x5100000000090016 0xb000000004f001a 0xb000000004e0016 0x1000000004c001a 0x4b0016 + 0x4b00000000090016 0x3b0000000049001a 0x4800000000480016) (.leaf8 0x70000000046001a 0x450016 0x16 + 0x12b0000000043001a 0x4400000000430016 0x420014 0x460010 0x10021)))))) (.bin (.bin (.bin (.bin + (.bin (.leaf8 0x280000000040001a 0x4000000000400016 0x3f00000000040016 0x5da000000003d001a + 0x3e000000003d0016 0x30014 0x400010 0x10021) (.leaf8 0xcc000000003a001a 0x3b000000003a0016 0x20014 + 0x3000000000400000000000000000002000000003d0000000000001f 0x3d0009 0x10021 0x1d4b0000000037001a + 0x3600000000360016)) (.bin (.leaf8 0x4010000000034001a 0x3500000000340016 0x3300000000090016 + 0x92760000000031001a 0x3200000000310016 0x50014 0x340010 0x10021) (.leaf8 0x140b000000002e001a + 0x2e000000002e0016 0x30014 0x300010 0x10021 0x2dc56000000002b001a 0x290016 0x643a0000000028001a))) + (.bin (.bin (.leaf8 0x270016 0x2700000000010016 0xe4daf0000000025001a 0xc00000000240016 + 0x1f5240000000022001a 0x210016 0x2100000000060016 0x47846e000000001f001a) (.leaf8 + 0x20000000001f0016 0x30014 0x220010 0x10021 0x9c9b7000000001c001a 0x1d000000001c0016 0x30016 + 0x165962d0000000019001a)) (.bin (.leaf8 0x1a00000000190016 0x180014 0x1c0010 0x10021 + 0x30f0960000000016001a 0x1700000000160016 0x30014 0x190010) (.leaf8 0x10021 + 0x6fbeee60000000013001a 0x1400000000130016 0xf4b2f40000000010001a 0xf0016 0x22ebaa84000000000d001a + 0xb0016 0xc00000000010016)))) (.bin (.bin (.bin (.leaf8 0x4c77ecd000000000a001a 0xb000000000a0016 + 0x90014 0xd0010 0x10021 0xae9a548a0000000007001a 0x200000000060016 0x60014) (.leaf8 0x40010 + 0x10021 0x17e579e90000000004001a 0x300000000020016 0x36903a70e0000000001001a 0x200000000010016 + 0x14 0x20000000000000000000100000000040000000000001f)) (.bin (.leaf8 0x30023 0x3000d + 0x20000000002000000000100777b614d000000000000000000010020 0x50010 0x40021 0x17 0x1d 0x103c3) + (.leaf8 (h240 0x777b6150000000000300000000010000 + 0x500777b614e0000000006000000000100000000040000000004001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x20000000003000000000002f18845be000000000000000000010020) + 0x5000000000000000000050000000000001f 0x100000000050023 + 0x700000000000017e579e8000000000100000000000020 0x8000e + 0x90000000000000000000400000000020000000000001e))) (.bin (.bin (.leaf8 0x100000000050023 + 0xb000000000000ae9a5489000000000200000000000020 0xb000e + 0xd0000000000000000000d00000000050000000000001e 0xc0023 0xc000d + 0xe00000000000004c77ecc000000000300000000010020 0xf0000000000000000000e0000000000001f) (.leaf8 + 0xd0023 0xd000d 0xf000000000000000000020000000006001f 0x100000000020023 + 0x1100000000000022ebaa83000000000400000000000020 0x13000000000000000000020000000009001f + 0x100000000030023 0x1500000000000000f4b2f3000000000500000000000020)) (.bin (.leaf8 + 0x1700000000000000000016000000000c001f 0x150023 0x15000d + 0x1800000000000006fbeee5000000000600000000010020 0x5000e + 0x1a00000000000000000019000000000d0000000000001e 0x180023 0x18000d) (.leaf8 + 0x1b0000000000000030f095000000000700000000010020 0x1a000e + 0x1c0000000000000000001c000000000f0000000000001e 0x1b0023 0x1b000d + 0x1d0000000000000165962c000000000800000000010020 0x1e000000000000000000020000000001001f (h240 + 0x10000 0x3000000000100000000000000000001000000001e0000000003001c)))))) (.bin (.bin (.bin (.bin + (.leaf8 0x1e000f 0x200000000000000000001e00000000110000000001001e 0x1d0023 0x1d000d + 0x210000000000000009c9b6000000000900000000010020 0x5000e + 0x230000000000000000002200000000130000000000001e 0x210023) (.leaf8 0x21000d + 0x240000000000000047846d000000000a00000000010020 0x25000000000000000000230000000003001f (h240 + 0x10000 0x2400000000010000000000000000000100000000010000000003001c) 0x1000f + 0x260000000000000000000100000000140000000001001e 0x100000000020023 + 0x280000000000000001f523000000000b00000000000020)) (.bin (.leaf8 + 0x2a0000000000000000000e0000000017001f 0x1000000000f0023 + 0x2c000000000000000e4dae000000000c00000000000020 0x2e000000000000000000290000000000001f 0x280023 + 0x28000d 0x2e000000000000000000020000000019001f 0x100000000030023) (.leaf8 + 0x3000000000000000006439000000000d00000000000020 0x3200000000000000000002000000001a001f + 0x100000000020023 0x340000000000000002dc55000000000e00000000000020 0x5000e + 0x3700000000000000000030000000001d0000000000001e 0x2f0023 0x2f000d))) (.bin (.bin (.leaf8 + 0x380000000000000000140a000000000f00000000010020 0x7000e + 0x3a00000000000000000034000000001f0000000000001e 0x330023 0x33000d + 0x3b00000000000000009275000000001000000000010020 0x3c000000000000000000350000000005001f (h240 + 0x10000 0x3600000000010000000000000000000100000000360000000003001c)) (.leaf8 0x36000f + 0x3d0000000000000000003600000000210000000001001e 0x350023 0x35000d + 0x3e00000000000000000400000000001100000000010020 0x3f000000000000000000380000000023001f + 0x100000000390023 0x4000000000000000001d4a000000001200000000000020)) (.bin (.leaf8 0x5000e + 0x100000000050000000001000000003d0000000002001c 0x3d000f + 0x440000000000000000003d00000000230000000001001e 0x3c0023 0x3c000d + 0x45000000000000000000cb000000001300000000010020 0x5000e) (.leaf8 + 0x470000000000000000004000000000270000000000001e 0x3f0023 0x3f000d + 0x48000000000000000005d9000000001400000000010020 0x49000000000000000000410000000002001f 0x400023 + 0x40000d 0x4900000000000000000042000000002a001f)))) (.bin (.bin (.bin (.leaf8 0x410023 0x41000d + 0x4a00000000000000000027000000001500000000010020 0x44000e + 0x4b00000000000000000046000000002b0000000000001e 0x450023 0x45000d + 0x4c0000000000000000012a000000001600000000010020) (.leaf8 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x4f00000000000000000001000000002c0000000001001e 0x100000000020023 + 0x5100000000000000000006000000001700000000000020 0x530000000000000000004a000000002f001f + 0x1000000004b0023)) (.bin (.leaf8 0x540000000000000000003a000000001800000000000020 + 0x560000000000000000004d0000000005001f (h240 0x10000 + 0x4e00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x570000000000000000000100000000300000000001001e 0x100000000020023 + 0x5900000000000000000000000000001900000000000020 0x5a0000000000000000000d0000000033001f) (.leaf8 + 0x1000000000e0023 0x5c0000000000000000000a000000001a00000000000020 + 0x5e000000000000000000530000000005001f (h240 0x10000 + 0x5400000000010000000000000000000100000000540000000003001c) 0x54000f 0x5f0000000000001d 0x530023 + 0x53000d))) (.bin (.bin (.leaf8 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x620000000000000000000100000000360000000001001e 0x100000000020023 + 0x6400000000000000000000000000001c00000000000020 0x65000000000000000000590000000003001f (h240 + 0x1000000005a00000000010000 0x10000000004000000000100000000010000000004001c)) (.leaf8 0x1000f + 0x6800000000000000000001000000003b0000000001001e 0x40000000000000b 0x5a0014 0x4000e 0xe00c6 + 0x10043 0x5c0142)) (.bin (.leaf8 0x101c3 0x5d0009 0x5900000000010019 0x640000000000001d 0x570023 + 0x300000000000000000001009c 0x5d0003 0x5d000f) (.leaf8 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x110d12431a0000000000000000000100000000010077 + 0x7b6150000000000300000000010000000005036903a70e00000000060000) + 0x1000000000500000000020000000000000000000100000000080017) + 0xe579e9000000000900000000010000000005000000000100000000000000) + 0x1000000000b00ae9a548a000000000c0000000001000000000e0004) + 0xc77ece000000000f00000000010000000002000000000200000000000000) + 0x100000000110022ebaa830000000012000000000100000000030000) + 0x10000000000000000000100000000140000f4b2f300000000150000) + 0x100000000170006fbeee60000000018000000000100000000060000) + 0x1000000001a000030f097000000001b0000000001000000001d0001) + 0x65962d000000001e00000000010000000003000000000100000000000000) + 0x1000000001f000009c9b70000000021000000000100000000060000) + 0x10000000023000047846f0000000024000000000100000000000000) + 0x1000000000200000000010000000000000000000100000000260000) + 0x1f52300000000270000000001000000000f000000000100000000000000) + 0x1000000002900000e4daf000000002a000000000100000000030000) + 0x100000000000000000001000000002c0000006439000000002d0000) + 0x10000000002000000000200000000000000000001000000002f0000) + 0x2dc55000000003000000000010000000006000000000100000000310000) + 0x140b000000003300000000010000000008000000000100000000350000) + 0x9277000000003600000000010000000000000000000100000000370000) + 0x4020000000039000000000100000000000000000001000000003b0000) + 0x1d4a000000003c00000000010000000006000000000100000000050000) + 0x1000000003e00000000cc000000003f000000000100000000060000) + 0x1000000004100000005db0000000042000000000100000000430000) + 0x29000000004500000000010000000047000000012b00000000480000) + 0x1000000000300000000010000000000000000000100000000020000) + 0x100000000000000000001000000004a0000000007000000004b0000) + 0x100000000000000000001000000004d000000003b000000004e0000) + 0x1000000000000000000010000000002000000000100000000000000) + 0x100000000500000000001000000000e000000000100000000000000) + 0x10000000053000000000b0000000054000000000100000000000000) + 0x1000000005500000000010000000003000000000100000000000000) + 0x1000000000200000000010000000000000000000100000000580000) + 0x6500000000010000000000000000005d00000000010000000001001e) 0x5d000b 0x580014 + 0x2000000005a0000000000000000000200000000020000000000001f (h240 0x30000 + 0x400000000010000000002000000000200000000000000000000001e) 0x20009 0x20021 0x530016))))))))) (.bin + (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x50000000052001a 0x5300000000520016 0xe0014 + 0x550010 0x10021 0x4e0016 0x16 0x1d000000004c001a) (.leaf8 0x4d000000004c0016 0x4b0014 0x4f0010 + 0x10021 0x30000000049001a 0x480016 0x16 0x4800000000010016)) (.bin (.leaf8 0x950000000046001a + 0x4500000000450016 0x140000000043001a 0x4200000000410016 0x2ed0000000040001a 0x6000000003f0016 + 0x66000000003d001a 0x5000000003c0016) (.leaf8 0x3c00000000040016 0xea4000000003a001a + 0x3b000000003a0016 0x390014 0x3d0010 0x10021 0x2000000000037001a 0x3700000000370016))) (.bin (.bin + (.leaf8 0x360014 0x390010 0x10021 0x493b0000000034001a 0x800000000330016 0xa050000000031001a + 0x3100000000310016 0x3000000000040016) (.leaf8 0x16e2a000000002e001a 0x2d0016 0x20014 0x20010 + 0x10021 0x321c000000002b001a 0x2c000000002b0016 0x30014)) (.bin (.leaf8 0x2e0010 0x10021 + 0x726d70000000028001a 0x2900000000280016 0xf0014 0x2b0010 0x10021 0xfa910000000025001a) (.leaf8 + 0x2600000000250016 0x20014 0x2400000000040000000000000000000200000000280000000000001f 0x280009 + 0x20021 0x23c2370000000022001a 0x600000000210016 0x4e4db000000001f001a)))) (.bin (.bin (.bin + (.leaf8 0x1f000000001f0016 0x30014 0x210010 0x10021 0xb2cb16000000001c001a 0x1d000000001c0016 + 0x18784b0000000019001a 0x1a00000000190016) (.leaf8 0x1800000000040016 0x37df7720000000016001a + 0x1700000000160016 0x7a59790000000013001a 0x1400000000130016 0x30014 0x160010 0x10021)) (.bin + (.leaf8 0x1175d5410000000010001a 0x1100000000100016 0x14 0x130010 0x10021 0xf00000000000016 + 0x263bf66000000000d001a 0xe000000000d0016) (.leaf8 0x574d2a45000000000a001a 0x90016 + 0x900000000030016 0xbf2bcf40000000007001a 0x60016 0x50014 0x20010 0x10021))) (.bin (.bin (.leaf8 + 0x1b481d3870000000004001a 0x300000000030016 0x3bbdb0a70000000001001a 0x100000000010016 0x14 + 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d) (.leaf8 + 0x200000000020000000001003bbdb0a6000000000000000000010020 + 0x20000000003000000000100000000050000000001001f 0x100000000060023 + 0x20000000004000000000101b481d386000000000100000000000020 0x7000e + 0x200000000070000000001000000000200000000020000000000001e 0x100000000030023 + 0x200000000090000000001000bf2bcf3000000000200000000000020)) (.bin (.leaf8 + 0x2000000000b0000000001000000000b0000000001001f (h240 0x10000 + 0xc00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x2000000000c0000000001000000000100000000040000000001001e 0x100000000020023 + 0x2000000000e000000000100574d2a44000000000300000000000020 + 0x20000000010000000000100000000100000000008001f 0xf0023) (.leaf8 0xf000d + 0x200000000110000000001000263bf65000000000400000000010020 0x11000e (h240 0x10000 + 0x10000000002000000000100000000130000000003001c) 0x13000f + 0x200000000140000000001000000001300000000080000000001001e 0x120023 0x12000d))))) (.bin (.bin (.bin + (.bin (.leaf8 0x200000000150000000001000afe08fe000000000500000000010020 (h240 0x100000000000000 + 0x100000000170000000000000677cc41000000000500000000010020) 0x5000e + 0x1900000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x1a000000000000007a5978000000000600000000010020 0x1b00000000000000000019000000000e001f) (.leaf8 + 0x180023 0x18000d 0x1c000000000000037df771000000000700000000010020 + 0x1d0000000000000000001a0000000002001f 0x190023 0x19000d 0x1d0000000000000000001c0000000010001f + 0x1b0023)) (.bin (.leaf8 0x1b000d 0x1e0000000000000018784a000000000800000000010020 + 0x1f0000000000000000001f0000000012001f 0x1e0023 0x1e000d + 0x2000000000000000b2cb15000000000900000000010020 0x5000e + 0x220000000000000000002100000000130000000000001e) (.leaf8 0x200023 0x20000d + 0x230000000000000004e4da000000000a00000000010020 0x24000000000000000000080000000015001f + 0x100000000090023 0x260000000000000023c236000000000b00000000000020 0x26000e + 0x10000000005000000000100000000280000000002001c))) (.bin (.bin (.leaf8 0x28000f + 0x290000000000000000002800000000150000000001001e 0x270023 0x27000d + 0x2a0000000000000000fa90000000000c00000000010020 0x11000e + 0x2c0000000000000000002b00000000190000000000001e 0x2a0023) (.leaf8 0x2a000d + 0x2d000000000000000726d6000000000d00000000010020 0x5000e + 0x2f0000000000000000002e000000001b0000000000001e 0x2d0023 0x2d000d + 0x300000000000000000321b000000000e00000000010020 0x4000e)) (.bin (.leaf8 + 0x3200000000000000000002000000001c0000000000001e 0x100000000030023 + 0x3400000000000000016e29000000000f00000000000020 0x36000000000000000000320000000002001f 0x310023 + 0x31000d 0x36000000000000000000330000000020001f 0x320023) (.leaf8 0x32000d + 0x3700000000000000000a04000000001000000000010020 0x380000000000000000000a0000000021001f + 0x1000000000b0023 0x3a0000000000000000493a000000001100000000000020 0x38000e + 0x3c0000000000000000003900000000230000000000001e 0x380023)))) (.bin (.bin (.bin (.leaf8 0x38000d + 0x3d000000000000000001ff000000001200000000010020 0x3b000e + 0x3e0000000000000000003d00000000250000000000001e 0x3c0023 0x3c000d + 0x3f00000000000000000ea3000000001300000000010020 0x400000000000000000003e0000000002001f) (.leaf8 + 0x3d0023 0x3d000d 0x40000000000000000000070000000027001f 0x100000000080023 + 0x4200000000000000000065000000001400000000000020 0x44000000000000000000080000000029001f + 0x100000000090023 0x46000000000000000002ec000000001500000000000020)) (.bin (.leaf8 + 0x4800000000000000000044000000002a001f 0x100000000440023 + 0x4a00000000000000000013000000001600000000000020 0x4c00000000000000000047000000002d001f + 0x100000000480023 0x4d00000000000000000094000000001700000000000020 + 0x4f0000000000000000004a0000000000001f 0x490023) (.leaf8 0x49000d 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x5100000000000000000001000000002e0000000001001e 0x100000000020023 + 0x5300000000000000000002000000001800000000000020 0x4d000e))) (.bin (.bin (.leaf8 + 0x550000000000000000004f00000000310000000000001e 0x4e0023 0x4e000d + 0x560000000000000000001c000000001900000000010020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x590000000000000000000100000000320000000001001e) (.leaf8 (h240 0x1000000000200000000010000 + 0x10000000010000000000100000000550000000004001c) 0x55000f + 0x5c0000000000000000005500000000340000000001001e 0x540023 0x54000d + 0x5d00000000000000000004000000001b00000000010020 0x5e000000000000000000020000000036001f (h240 + 0x100000000020000000002000000000000000000020000 + 0x50000000001000000005b000000000100000000020000000005001c))) (.bin (.leaf8 0x2000f + 0x620000000000000000000200000000390000000001001e 0x5b0000000001000b 0x10000000003001a 0x14 0x70010 + 0x10021 0x5700000000000016) (.leaf8 0x20000000055001a 0x1000000000540016 0x20014 + 0x300000000040000000000000000000200000000120000000000001f 0x120009 0x10021 0xe000000004f001a + 0x50000000004f0016)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 0x1000000004c001a + 0x4d000000004c0016 0x20014 0x3000000000400000000000000000002000000004f0000000000001f 0x4f0009 + 0x10021 0x4a0000000049001a 0x4a00000000490016) (.leaf8 0x480014 0x4c0010 0x10021 0x90000000046001a + 0x4700000000460016 0x14 0x490010 0x10021)) (.bin (.leaf8 0x4500000000420016 0x1750000000043001a + 0x4400000000430016 0x90014 0x460010 0x10021 0x320000000040001a 0x4100000000400016) (.leaf8 0x80014 + 0x430010 0x10021 0x752000000003d001a 0x3e000000003d0016 0x100000000003a001a 0x3a000000003a0016 + 0x249d0000000037001a))) (.bin (.bin (.leaf8 0x3800000000370016 0xb0014 0x3a0010 0x10021 + 0x5020000000034001a 0x3400000000340016 0xb7150000000031001a 0x300016) (.leaf8 0x500000000010016 + 0x190e000000002e001a 0x6000000002d0016 0x3936b000000002b001a 0x2c000000002b0016 0x2a00000000100016 + 0x7d480000000028001a 0x500000000270016)) (.bin (.leaf8 0x11e11b0000000025001a 0x2600000000250016 + 0x90014 0x280010 0x10021 0x2726d0000000022001a 0x2200000000220016 0x2100000000040016) (.leaf8 + 0x59658a000000001f001a 0x20000000001f0016 0xc3c25000000001c001a 0x1d000000001c0016 + 0x1befbb90000000019001a 0x1a00000000190016 0x3d2cbc0000000016001a 0x1700000000160016)))) (.bin + (.bin (.bin (.leaf8 0x1500000000040016 0x8baeaa00000000013001a 0x200000000120016 0x120014 0x40010 + 0x10021 0x131dfb30000000010001a 0xf000000000f0016) (.leaf8 0x2ba69521000000000d001a + 0xe000000000d0016 0x20014 0xc00000000040000000000000000000200000000100000000000001f 0x100009 + 0x20021 0x5f95e79000000000a001a 0xb000000000a0016)) (.bin (.leaf8 0x30014 0xd0010 0x10021 + 0x900000000060016 0xda40e9c20000000007001a 0x800000000070016 0x60014 0xa0010) (.leaf8 0x10021 + 0x1dded8530000000004001a 0x400000000040016 0x4434490c70000000001001a 0x200000000010016 0x14 + 0x20000000000000000000100000000040000000000001f 0x30023))) (.bin (.bin (.leaf8 0x3000d + 0x20000000002000000000100955a39b9000000000000000000010020 0x50010 0x40021 0x17 0x1d 0x103c3 (h240 + 0x955a39bc000000000300000000010000 0x500955a39ba0000000006000000000100000000040000000004001c)) + (.leaf8 0x4000d (h240 0x20000000000000000000100000000010000 + 0x20000000003000000000003adea570b000000000000000000010020) 0x5000000000000000000060000000002001f + 0x50023 0x5000d 0x60000000000001dded852000000000100000000010020 0x8000e + 0x70000000000000000000a00000000030000000000001e)) (.bin (.leaf8 0x90023 0x9000d + 0x8000000000000da40e9c1000000000200000000010020 0x90000000000000000000b0000000003001f (h240 + 0x1000000000c00000000010000 0x100000000050000000001000000000d0000000004001c) 0xd000f + 0xb0000000000000000000d00000000040000000001001e 0xc0023) (.leaf8 0xc000d + 0xc00000000000005f95e78000000000300000000010020 0xe000e + 0x10000000005000000000100000000100000000002001c 0x10000f + 0xe0000000000000000001000000000050000000001001e 0xf0023 0xf000d))))) (.bin (.bin (.bin (.bin + (.leaf8 0xf0000000000002ba69520000000000400000000010020 0x10000000000000000000110000000009001f + 0x100000000120023 0x110000000000000131dfb2000000000500000000000020 0x14000e + 0x1300000000000000000004000000000a0000000000001e 0x100000000050023 + 0x1500000000000008baea9f000000000600000000000020) (.leaf8 0x17000000000000000000170000000002001f + 0x160023 0x16000d 0x1700000000000000000019000000000e001f 0x180023 0x18000d + 0x18000000000000003d2cbb000000000700000000010020 0x190000000000000000001c0000000010001f)) (.bin + (.leaf8 0x1b0023 0x1b000d 0x1a00000000000001befbb8000000000800000000010020 + 0x1b0000000000000000001f0000000012001f 0x1e0023 0x1e000d + 0x1c000000000000000c3c24000000000900000000010020 0x1d000000000000000000220000000014001f) (.leaf8 + 0x210023 0x21000d 0x1e00000000000000596589000000000a00000000010020 + 0x1f000000000000000000230000000002001f 0x220023 0x22000d 0x1f000000000000000000240000000016001f + 0x230023))) (.bin (.bin (.leaf8 0x23000d 0x200000000000000002726c000000000b00000000010020 0xb000e + 0x220000000000000000002800000000170000000000001e 0x270023 0x27000d + 0x230000000000000011e11a000000000c00000000010020 0x24000000000000000000070000000019001f) (.leaf8 + 0x100000000080023 0x2600000000000000007d47000000000d00000000000020 + 0x280000000000000000002c000000000a001f 0x2b0023 0x2b000d 0x280000000000000000002e000000001c001f + 0x2d0023 0x2d000d)) (.bin (.leaf8 0x290000000000000003936a000000000e00000000010020 + 0x2a00000000000000000008000000001d001f 0x100000000090023 + 0x2c0000000000000000190d000000000f00000000000020 0x2e000000000000000000070000000000001f 0x60023 + 0x6000d 0x2f00000000000000000002000000001f001f) (.leaf8 0x100000000030023 + 0x310000000000000000b714000000001000000000000020 0x33000000000000000000360000000022001f 0x350023 + 0x35000d 0x3400000000000000000501000000001100000000010020 0xd000e + 0x360000000000000000003a00000000230000000000001e)))) (.bin (.bin (.bin (.leaf8 0x390023 0x39000d + 0x370000000000000000249c000000001200000000010020 0x380000000000000000003c0000000026001f 0x3b0023 + 0x3b000d 0x39000000000000000000ff000000001300000000010020 0x3a000000000000000000400000000028001f) + (.leaf8 0x3f0023 0x3f000d 0x3b00000000000000000751000000001400000000010020 0xa000e + 0x3d0000000000000000004300000000290000000000001e 0x420023 0x42000d + 0x3e00000000000000000031000000001500000000010020)) (.bin (.leaf8 0xb000e + 0x4000000000000000000046000000002b0000000000001e 0x450023 0x45000d + 0x4100000000000000000174000000001600000000010020 0x4200000000000000000047000000002b001f (h240 + 0x1000000004800000000010000 0x10000000002000000000100000000490000000004001c) 0x49000f) (.leaf8 + 0x4400000000000000000049000000002c0000000001001e 0x480023 0x48000d + 0x4500000000000000000008000000001700000000010020 0x4a000e + 0x460000000000000000004c000000002f0000000000001e 0x4b0023 0x4b000d))) (.bin (.bin (.leaf8 + 0x4700000000000000000049000000001800000000010020 0x5000e + 0x100000000050000000001000000004f0000000002001c 0x4f000f + 0x4a0000000000000000004f000000002f0000000001001e 0x4e0023 0x4e000d + 0x4b00000000000000000000000000001900000000010020) (.leaf8 0x4c000000000000000000520000000034001f + 0x510023 0x51000d 0x4d0000000000000000000d000000001a00000000010020 0x5000e + 0x10000000005000000000100000000120000000002001c 0x12000f + 0x500000000000000000001200000000340000000001001e)) (.bin (.leaf8 0x100000000130023 + 0x5200000000000000000001000000001c00000000000020 0x59000e (h240 0x10000 + 0x10000000002000000000100000000070000000003001c) 0x7000f 0x560000000000001d (h240 0x10000 + 0x8000000000100000000000000000001000000005c0000000003001c) 0x20186) (.leaf8 0x10043 0x5c0142 + 0x101c3 0x5d0023 0xbe00c6 0x10043 0x10303 0x10009))))))) (.bin (.bin (.bin (.bin (.bin (.bin + (.leaf8 0x8 0x10009 0x10021 0x200000000060016 0x5a0014 0x40010 0x10021 0x5900000000580016) (.leaf8 + 0x130014 0x5b0010 0x10021 0x600000000030016 0x70000000052001a 0x5100000000510016 0x5000000004e0016 + 0x4e00000000040016)) (.bin (.leaf8 0x24000000004c001a 0x4d000000004c0016 0x50000000049001a + 0x200000000480016 0x480014 0x40010 0x10021 0xba0000000046001a) (.leaf8 0x4700000000460016 + 0x45000000000a0016 0x180000000043001a 0x4400000000430016 0x4200000000090016 0x3a80000000040001a + 0x4100000000400016 0x80000000003d001a))) (.bin (.bin (.leaf8 0x3c000000003b0016 + 0x124e000000003a001a 0xe00000000390016 0x2810000000037001a 0x3600000000350016 0x5b890000000034001a + 0x3500000000340016 0x30014) (.leaf8 0x370010 0x10021 0x3300000000060016 0xc860000000031001a + 0x300016 0x3000000000070016 0x1c9b5000000002e001a 0x2d000000002d0016)) (.bin (.leaf8 + 0x3ea3000000002b001a 0x2c000000002b0016 0x80014 0x2e0010 0x10021 0x8f08d0000000028001a + 0x2900000000280016 0x27000000000a0016) (.leaf8 0x139360000000025001a 0x2400000000230016 + 0x2cb2c50000000022001a 0x2100000000210016 0x61e12000000001f001a 0x1e000000001e0016 + 0xdf7ddc000000001c001a 0x1b000000001b0016)))) (.bin (.bin (.bin (.leaf8 0x1e965d0000000019001a + 0x1a00000000190016 0x45d75500000000016001a 0x150016 0x1500000000030016 0x98efd90000000013001a + 0x120016 0x15d34a910000000010001a) (.leaf8 0x5000000000f0016 0x2fcaf3d000000000d001a + 0x5000000000c0016 0xc0014 0x70010 0x10021 0x6d2074e1000000000a001a 0x900000000090016)) (.bin + (.leaf8 0xeef6c290000000007001a 0x700000000070016 0x221a248630000000004001a 0x500000000040016 + 0x4aad1cde0000000001001a 0x3001d 0x100000000010000000001004aad1cdd000000000000000000000020 + 0x20000000005000000000100000000070000000002001f) (.leaf8 0x60023 0x6000d + 0x2000000000600000000010221a24862000000000100000000010020 + 0x20000000007000000000100000000090000000004001f 0x80023 0x8000d + 0x200000000080000000001000eef6c28000000000200000000010020 + 0x200000000090000000001000000000b0000000005001f))) (.bin (.bin (.leaf8 0x1000000000c0023 + 0x2000000000a0000000001006d2074e0000000000300000000000020 0xe000e + 0x2000000000c0000000001000000000700000000060000000000001e 0x100000000080023 + 0x2000000000e00000000010002fcaf3c000000000400000000000020 + 0x20000000010000000000100000000070000000009001f 0x100000000080023) (.leaf8 + 0x200000000120000000001000dbd8b37000000000500000000000020 + 0x20000000014000000000100000000140000000005001f 0x140009 0x150021 0x17 0x1d 0x103c3 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 0xaa82b69ad0000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x5004aad1cdd0000000006000000000100000000080221a248630000) + 0x90000000001000000000a000eef6c2a000000000c00000000010000) + 0x1000000000e006d2074e1000000000f00000000010000) + 0x800000000010000000000000000000100000000110002fcaf3c0000) + 0x12000000000100000000080000000001000000000000000000010000) + 0x14000dbd8b370000000015000000000100000000140000000015001c))) (.bin (.leaf8 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000140000000000000000001400000000020000000001001e) + 0x130023 0x13000d 0x160000000000000815bf57000000000500000000010020 + 0x1600000000000000000002000000000b001f 0x100000000030023 + 0x180000000000000098efd8000000000600000000000020) (.leaf8 0x1a000000000000000000170000000001001f + (h240 0x10000 0x1800000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1b00000000000000000001000000000c0000000001001e 0x100000000020023 + 0x1d000000000000045d754f000000000700000000000020 0x1f0000000000000000001c0000000010001f + 0x1b0023))))) (.bin (.bin (.bin (.bin (.leaf8 0x1b000d + 0x20000000000000001e965c000000000800000000010020 0x210000000000000000001d0000000011001f + 0x1000000001e0023 0x2200000000000000df7ddb000000000900000000000020 + 0x24000000000000000000200000000013001f 0x100000000210023 + 0x2500000000000000061e11000000000a00000000000020) (.leaf8 0x27000000000000000000230000000015001f + 0x100000000240023 0x28000000000000002cb2c4000000000b00000000000020 + 0x2a000000000000000000260000000016001f 0x100000000260023 + 0x2c00000000000000013935000000000c00000000000020 0x2e000000000000000000290000000006001f 0x280023)) + (.bin (.leaf8 0x28000d 0x2e0000000000000000002b000000001a001f 0x2a0023 0x2a000d + 0x2f0000000000000008f08c000000000d00000000010020 0xa000e + 0x310000000000000000002e000000001b0000000000001e 0x2d0023) (.leaf8 0x2d000d + 0x3200000000000000003ea2000000000e00000000010020 0x330000000000000000002f000000001d001f + 0x100000000300023 0x340000000000000001c9b4000000000f00000000000020 + 0x36000000000000000000320000000004001f 0x310023 0x31000d))) (.bin (.bin (.leaf8 + 0x3600000000000000000002000000001f001f 0x100000000030023 + 0x3800000000000000000c85000000001000000000000020 0x3a000000000000000000350000000003001f (h240 + 0x1000000003600000000010000 0x10000000005000000000100000000370000000004001c) 0x37000f + 0x3c0000000000000000003700000000200000000001001e 0x360023) (.leaf8 0x36000d + 0x3d00000000000000005b88000000001100000000010020 0x3e000000000000000000380000000022001f + 0x100000000380023 0x4000000000000000000280000000001200000000000020 + 0x42000000000000000000100000000025001f 0x100000000110023 + 0x440000000000000000124d000000001300000000000020)) (.bin (.leaf8 + 0x460000000000000000003e0000000026001f 0x1000000003e0023 + 0x480000000000000000007f000000001400000000000020 0x4a00000000000000000043000000002a001f 0x420023 + 0x42000d 0x4b000000000000000003a7000000001500000000010020 0x4c000000000000000000440000000005001f) + (.leaf8 (h240 0x10000 0x4500000000010000000000000000000100000000450000000003001c) 0x45000f + 0x4d00000000000000000045000000002b0000000001001e 0x440023 0x44000d + 0x4e00000000000000000017000000001600000000010020 0x4f000000000000000000470000000006001f + 0x460023)))) (.bin (.bin (.bin (.leaf8 0x46000d 0x4f00000000000000000049000000002e001f 0x480023 + 0x48000d 0x50000000000000000000b9000000001700000000010020 0x4a000e + 0x5100000000000000000004000000002e0000000000001e 0x100000000050023) (.leaf8 + 0x5300000000000000000004000000001800000000000020 0x550000000000000000004f0000000032001f 0x4e0023 + 0x4e000d 0x5600000000000000000023000000001900000000010020 0x57000000000000000000500000000002001f + 0x4f0023 0x4f000d)) (.bin (.leaf8 0x57000000000000000000070000000033001f (h240 0x10000 + 0x800000000010000000000000000000100000000520000000003001c) 0x52000f + 0x590000000000000000005200000000340000000001001e 0x100000000530023 + 0x5b00000000000000000006000000001b00000000000020 0x5d000000000000000000080000000001001f (h240 + 0x1000000000900000000010000 0x100000000150000000001000000005b0000000004001c)) (.leaf8 0x5b000f + 0x600000000000000000005b00000000380000000001001e 0x5a0023 0x5a000d 0x5c000e + 0x620000000000000000000400000000020000000000001e (h240 0x1000000000500000000010000 + 0x10000000001000000000100000000010000000004001c) 0x1000f))) (.bin (.bin (.leaf8 + 0x6500000000000000000001000000003b0000000001001e 0x10000000000000b 0x50014 0x1000e 0x800c6 0x10043 + 0x70142 0x101c3) (.leaf8 0x80009 0x5d00000000010019 0x610000000000001d 0x5b0023 + 0x300000000000000000001009c 0x80003 0x8000f (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x1756190dc0000000000000000000100000000010aa82b69ad0000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x5004aad1cdd0000000006000000000100000000080221a248630000) + 0x90000000001000000000a000eef6c2a000000000c00000000010000) + 0x1000000000e006d2074e1000000000f00000000010000) + 0x800000000010000000000000000000100000000110002fcaf3c0000) + 0x12000000000100000000080000000001000000000000000000010000) + 0x140015d34a9000000000150000000001000000000300000000010000) + 0x10000000017000098efd9000000001800000000010000) 0x100000000020000000001000000000000000000010000) + 0x1a00045d754f000000001b0000000001000000001d00001e965e0000) + 0x1e00000000010000000000000000000100000000200000df7ddc0000) + 0x2100000000010000000000000000000100000000230000061e120000) + 0x24000000000100000000000000000001000000002600002cb2c40000) + 0x27000000000100000000260000000002000000000000000000010000) + 0x290000013936000000002a0000000001000000002c000008f08d0000) + 0x2d0000000001000000000b0000000001000000002f0000003ea40000) + 0x300000000001000000000000000000010000000032000001c9b50000) + 0x33000000000100000000030000000001000000000000000000010000) + 0x350000000c8600000000360000000001000000000000000000010000) + 0x5000000000100000000380000005b89000000003900000000010000) + 0x38000000000200000000000000000001000000003b00000002800000) + 0x3c000000000100000000110000000001000000000000000000010000) + 0x3e000000124d000000003f0000000001000000003e00000000020000) + 0x10000000041000000007f000000004200000000010000) + 0x4400000003a900000000450000000001000000000000000000010000) + 0x46000000001900000000480000000001000000004a00000000bb0000) + 0x4b000000000100000000050000000001000000000000000000010000) + 0x4d0000000004000000004e0000000001000000005000000000250000) + 0x51000000000100000000080000000001000000000000000000010000) + 0x53000000000100000000000000000001000000005600000000060000) + 0x57000000000100000000090000000001000000000000000000010000) + 0x150000000002000000005c000000006100000000010000000000001d))) (.bin (.leaf8 0x8000b 0x5c0014 + 0x20010 0x10021 0x15000000005a0016 0x90014 0x170010 0x10021) (.leaf8 0x30000000055001a 0x540016 + 0x510016 0x5100000000060016 0x12000000004f001a 0x4e000000004e0016 0x1000000004c001a + 0x4d000000004c0016)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 0x50014 0x4f0010 0x10021 + 0x5d0000000049001a 0x4a00000000490016 0xc0000000046001a 0x4600000000460016 0x450014) (.leaf8 + 0x480010 0x10021 0x1d40000000043001a 0x4200000000420016 0x3f0000000040001a 0x3f0016 0x3e0014 + 0x20010)) (.bin (.leaf8 0x10021 0x926000000003d001a 0x3e000000003d0016 0x110014 0x400010 0x10021 + 0x140000000003a001a 0x390016) (.leaf8 0x380014 0x20010 0x10021 0x2dc40000000037001a + 0x3800000000370016 0x30016 0x6430000000034001a 0x330016))) (.bin (.bin (.leaf8 0x3300000000010016 + 0xe4da0000000031001a 0x300016 0x1f52000000002e001a 0xb000000002d0016 0x47846000000002b001a + 0x2c000000002b0016 0x9c9b0000000028001a) (.leaf8 0x270016 0x260014 0x20010 0x10021 + 0x1659620000000025001a 0x240016 0x30f090000000022001a 0x210016)) (.bin (.leaf8 + 0x6fbeee000000001f001a 0x1e0016 0xf4b2f000000001c001a 0x1b000000001b0016 0x22ebaa70000000019001a + 0x180016 0x16 0x4c77ec0000000016001a) (.leaf8 0x1700000000160016 0x30014 0x190010 0x10021 + 0xae9a5480000000013001a 0x120016 0x1200000000060016 0x17e579d0000000010001a)))) (.bin (.bin (.bin + (.leaf8 0x1100000000100016 0x80014 0x130010 0x10021 0x36903a70000000000d001a 0xe000000000d0016 + 0xc0014 0x100010) (.leaf8 0x10021 0x777b614000000000a001a 0xa000000000a0016 + 0x110d124310000000007001a 0x800000000070016 0x25568e6e0000000004001a 0x500000000040016 0x14)) + (.bin (.leaf8 0x70010 0x10021 0x300000000000016 0x55415b4d60000000001001a 0x3001d + 0x10000000001000000000100bab0c86d000000000000000000000020 0x50010 0x60021) (.leaf8 0x17 0x1d + 0x103c3 (h240 (h240 0xbab0c86e0000 0x3000000000100000000020000000002000000000000000000010000) + 0x500bab0c86d0000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x200000000050000000000049964ec66000000000000000000010020) + 0x5000e (h240 0x10000 0x10000000002000000000100000000070000000003001c)))) (.bin (.bin (.leaf8 + 0x7000f 0x90000000000000000000700000000000000000001001e 0x60023 0x6000d + 0xa00000000000025568e6d000000000100000000010020 0xb0000000000000000000a0000000004001f 0x90023 + 0x9000d) (.leaf8 0xc00000000000110d12430000000000200000000010020 + 0xd0000000000000000000c0000000006001f 0xb0023 0xb000d + 0xe0000000000000777b613000000000300000000010020 0xe000e + 0xf0000000000000000001000000000070000000000001e 0xf0023)) (.bin (.leaf8 0xf000d + 0x1000000000000036903a6f000000000400000000010020 0xa000e + 0x120000000000000000001300000000090000000000001e 0x120023 0x12000d + 0x13000000000000017e579c000000000500000000010020 0x14000000000000000000140000000003001f) (.leaf8 + (h240 0x10000 0x1500000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1500000000000000000001000000000a0000000001001e 0x100000000020023 + 0x170000000000000ae9a547000000000600000000000020 0x5000e + 0x1a00000000000000000019000000000d0000000000001e 0x180023))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x18000d 0x1b000000000000004c77eb000000000700000000010020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x1e00000000000000000001000000000e0000000001001e 0x100000000020023 + 0x20000000000000022ebaa6000000000800000000000020) (.leaf8 0x220000000000000000001d0000000011001f + 0x1000000001e0023 0x23000000000000000f4b2e000000000900000000000020 + 0x25000000000000000000020000000013001f 0x100000000030023 + 0x27000000000000006fbeed000000000a00000000000020 0x29000000000000000000020000000015001f + 0x100000000030023)) (.bin (.leaf8 0x2b00000000000000030f08000000000b00000000000020 + 0x2d000000000000000000020000000017001f 0x100000000030023 + 0x2f00000000000000165961000000000c00000000000020 0x28000e + 0x320000000000000000000200000000180000000000001e 0x100000000030023 + 0x3400000000000000009c9a000000000d00000000000020) (.leaf8 0x360000000000000000002e000000001c001f + 0x2d0023 0x2d000d 0x3700000000000000047845000000000e00000000010020 + 0x380000000000000000000d000000001d001f 0x1000000000e0023 + 0x3a00000000000000001f51000000000f00000000000020 0x3c00000000000000000002000000001f001f))) (.bin + (.bin (.leaf8 0x100000000030023 0x3e0000000000000000e4d9000000001000000000000020 + 0x40000000000000000000350000000000001f 0x340023 0x34000d 0x40000000000000000000020000000021001f + 0x100000000030023 0x4200000000000000000642000000001100000000000020) (.leaf8 + 0x44000000000000000000020000000001001f (h240 0x10000 + 0x300000000010000000000000000000100000000390000000003001c) 0x39000f + 0x460000000000000000003900000000230000000001001e 0x380023 0x38000d + 0x4700000000000000002dc3000000001200000000010020 0x3a000e)) (.bin (.leaf8 + 0x490000000000000000000200000000240000000000001e 0x100000000030023 + 0x4b0000000000000000013f000000001300000000000020 0x13000e + 0x4e0000000000000000004000000000270000000000001e 0x3f0023 0x3f000d + 0x4f00000000000000000925000000001400000000010020) (.leaf8 0x40000e + 0x510000000000000000000200000000280000000000001e 0x100000000030023 + 0x530000000000000000003e000000001500000000000020 0x5500000000000000000044000000002b001f + 0x100000000450023 0x56000000000000000001d3000000001600000000000020 0x47000e)))) (.bin (.bin (.bin + (.leaf8 0x5800000000000000000048000000002d0000000000001e 0x470023 0x47000d + 0x590000000000000000000b000000001700000000010020 0x5a0000000000000000004c0000000030001f 0x4b0023 + 0x4b000d 0x5b0000000000000000005c000000001800000000010020) (.leaf8 0x7000e + 0x5d0000000000000000004f00000000310000000000001e 0x4e0023 0x4e000d + 0x5e00000000000000000000000000001900000000010020 0x5f000000000000000000500000000033001f + 0x100000000510023 0x6000000000000000000011000000001a00000000000020)) (.bin (.leaf8 + 0x62000000000000000000530000000003001f (h240 0x10000 + 0x5400000000010000000000000000000100000000010000000003001c) 0x1000f + 0x630000000000000000000100000000340000000001001e (h240 0x10000 + 0x200000000010000000000000000000100000000010000000003001c) 0x1000f + 0x650000000000000000000100000000360000000001001e 0x100000000020023) (.leaf8 + 0x6700000000000000000002000000001c00000000000020 0xb000e + 0x6a00000000000000000017000000003a0000000000001e (h240 0x1000000001800000000010000 + 0x1000000005e000000000100000000020000000004001c) 0x2000f + 0x6d0000000000000000000200000000020000000001001e 0x5e0000000002000b 0x180014))) (.bin (.bin + (.leaf8 0x600010 0x10021 0x5a000000000a0016 0x5900000000580016 0x20014 + 0x2000000000400000000000000000002000000005b0000000000001f (h240 0x540000 + 0x400000000010000000002000000005b00000000000000000000001e) 0x5b0009) (.leaf8 0x20021 + 0x80000000052001a 0x5300000000520016 0x510014 0x550010 0x10021 0x50000000004f0016 + 0x4e00000000060016)) (.bin (.leaf8 0x2e000000004c001a 0x4b000000004b0016 0x50000000049001a + 0x4900000000490016 0xea0000000046001a 0x450016 0x1f0000000043001a 0x4400000000430016) (.leaf8 + 0x30014 0x460010 0x10021 0x42000000003f0016 0x4920000000040001a 0x4100000000400016 + 0x3f00000000120016 0x9f000000003d001a)))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x3c0016 0x3b00000000010016 0x16e2000000003a001a 0x380016 0x3900000000010016 0x3200000000037001a + 0x3800000000370016 0x30014) (.leaf8 0x3a0010 0x10021 0x726d0000000034001a 0x330016 + 0x3300000000010016 0xfa80000000031001a 0x300016 0x30000000000c0016)) (.bin (.leaf8 + 0x23c22000000002e001a 0x2f000000002e0016 0x4e4d000000002b001a 0x2a0016 0x2900000000010016 + 0xb2cb00000000028001a 0x2900000000280016 0x30014) (.leaf8 0x2b0010 0x10021 0x187840000000025001a + 0x240016 0x2400000000010016 0x37df760000000022001a 0x210016 0x2100000000010016))) (.bin (.bin + (.leaf8 0x7a596000000001f001a 0x20000000001f0016 0x1e0014 0x220010 0x10021 0x1175d53000000001c001a + 0x1b0016 0x16) (.leaf8 0x1b00000000010016 0x263bf50000000019001a 0x1a00000000190016 + 0x1800000000040016 0x574d2a30000000016001a 0x150016 0x16 0xbf2bcf0000000013001a)) (.bin (.leaf8 + 0xb00000000120016 0x1b481d380000000010001a 0xf000000000f0016 0x3bbdb0a000000000d001a + 0xc000000000b0016 0x88689218000000000a001a 0x900000000090016 0x12ab47360000000007001a) (.leaf8 + 0x800000000070016 0x16 0x2aa0ada6b0000000004001a 0x30016 0x20014 0x20010 0x10021 + 0x5d5864370000000001001a)))) (.bin (.bin (.bin (.leaf8 0x3001d + 0x100000000010000000001005d586436000000000000000000000020 0x4000e + 0x200000000060000000001000000000200000000000000000000001e 0x100000000030023 + 0x20000000008000000000102aa0ada6a000000000100000000000020 0x2000e + 0x10000000000000000000100000000090000000002001c) (.leaf8 0x9000f + 0x2000000000c0000000001000000000900000000030000000001001e 0x80023 0x8000d + 0x2000000000d00000000010012ab4735000000000200000000010020 + 0x2000000000e0000000001000000000b0000000005001f 0x1000000000c0023 + 0x2000000000f00000000010088689217000000000300000000000020)) (.bin (.leaf8 + 0x200000000110000000001000000000e0000000006001f 0x1000000000e0023 + 0x2000000001300000000010003bbdb09000000000400000000000020 + 0x20000000015000000000100000000110000000009001f 0x100000000120023 + 0x20000000016000000000100112cee10000000000500000000000020 + 0x20000000018000000000100000000140000000003001f 0x140009) (.leaf8 0x190021 0x17 0x1d 0x103c3 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 0xd52364464000000000300000000010000 + 0x20000000002000000000000000000010000000005005d5864360000) + 0x6000000000100000000050000000001000000000300000000010000) + 0x1000000000802aa0ada6a000000000900000000010000) + 0x3000000000100000000000000000001000000000a0012ab47370000) + 0xc000000000100000000000000000001000000000e00886892170000) + 0xf0000000001000000000e0000000002000000000000000000010000) + 0x110003bbdb0a00000000120000000001000000000000000000010000) + 0x1400112cee100000000015000000000100000000140000000019001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000180000000000000000001400000000040000000001001e) + 0x130023))) (.bin (.bin (.leaf8 0x13000d 0x1a0000000000000a1b2f25000000000500000000010020 + 0x1a0000000000000000000d000000000b001f 0x1000000000e0023 + 0x1c00000000000000bf2bce000000000600000000000020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f) (.leaf8 + 0x2000000000000000000001000000000c0000000001001e 0x100000000020023 + 0x220000000000000574d2a2000000000700000000000020 0x240000000000000000001a0000000002001f 0x190023 + 0x19000d 0x240000000000000000001c0000000010001f 0x1b0023)) (.bin (.leaf8 0x1b000d + 0x2500000000000000263bf4000000000800000000010020 0x260000000000000000001d0000000000001f 0x1c0023 + 0x1c000d 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f) (.leaf8 + 0x280000000000000000000100000000100000000001001e 0x100000000020023 + 0x2a00000000000001175d52000000000900000000000020 0x20000e + 0x2c0000000000000000002200000000130000000000001e 0x210023 0x21000d + 0x2d0000000000000007a595000000000a00000000010020))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x2e000000000000000000230000000000001f 0x220023 0x22000d 0x2e000000000000000000020000000015001f + 0x100000000030023 0x300000000000000037df75000000000b00000000000020 + 0x32000000000000000000260000000000001f 0x250023) (.leaf8 0x25000d + 0x32000000000000000000020000000017001f 0x100000000030023 + 0x3400000000000000018783000000000c00000000000020 0x5000e + 0x370000000000000000002b00000000190000000000001e 0x2a0023 0x2a000d)) (.bin (.leaf8 + 0x38000000000000000b2caf000000000d00000000010020 0x390000000000000000002b0000000000001f 0x2a0023 + 0x2a000d 0x3a00000000000000000002000000001b001f 0x100000000030023 + 0x3c00000000000000004e4c000000000e00000000000020 0x3e00000000000000000031000000001e001f) (.leaf8 + 0x300023 0x30000d 0x3f00000000000000023c21000000000f00000000010020 + 0x40000000000000000000320000000007001f (h240 0x10000 + 0x3300000000010000000000000000000100000000010000000003001c) 0x1000f + 0x4100000000000000000001000000001e0000000001001e 0x100000000020023))) (.bin (.bin (.leaf8 + 0x4300000000000000000fa7000000001000000000000020 0x45000000000000000000350000000000001f 0x340023 + 0x34000d 0x45000000000000000000020000000021001f 0x100000000030023 + 0x470000000000000000726c000000001100000000000020 0x5000e) (.leaf8 + 0x4a0000000000000000003a00000000230000000000001e 0x390023 0x39000d + 0x4b0000000000000000031f000000001200000000010020 0x4c0000000000000000003b0000000000001f 0x3a0023 + 0x3a000d 0x4c000000000000000000020000000024001f)) (.bin (.leaf8 0x100000000020023 + 0x4e000000000000000016e1000000001300000000000020 0x500000000000000000003d0000000000001f 0x3c0023 + 0x3c000d 0x51000000000000000000020000000027001f 0x100000000030023 + 0x530000000000000000009e000000001400000000000020) (.leaf8 0x5500000000000000000041000000000b001f + (h240 0x10000 0x4200000000010000000000000000000100000000420000000003001c) 0x42000f + 0x560000000000000000004200000000290000000001001e 0x410023 0x41000d + 0x5700000000000000000491000000001500000000010020 0x58000000000000000000440000000029001f)))) (.bin + (.bin (.bin (.leaf8 (h240 0x1000000004500000000010000 + 0x10000000005000000000100000000460000000004001c) 0x46000f + 0x5a00000000000000000046000000002a0000000001001e 0x450023 0x45000d + 0x5b0000000000000000001e000000001600000000010020 0x5c00000000000000000002000000002d001f + 0x100000000030023) (.leaf8 0x5e000000000000000000e9000000001700000000000020 + 0x600000000000000000004b0000000030001f 0x4a0023 0x4a000d + 0x6100000000000000000004000000001800000000010020 0x620000000000000000004d0000000031001f + 0x1000000004e0023 0x630000000000000000002d000000001900000000000020)) (.bin (.leaf8 + 0x65000000000000000000500000000003001f (h240 0x10000 + 0x5100000000010000000000000000000100000000510000000003001c) 0x51000f + 0x660000000000000000005100000000330000000001001e 0x500023 0x50000d 0x53000e + 0x680000000000000000005500000000350000000000001e) (.leaf8 0x540023 0x54000d + 0x6900000000000000000007000000001b00000000010020 0x56000e + 0x200000000050000000001000000005b0000000002001c 0x5b000f + 0x6b0000000000000000005b00000000360000000001001e 0x5a0023))) (.bin (.bin (.leaf8 0x5a000d + 0x6c0000000000000000005c0000000006001f 0x5b0023 0x5b000d 0x1a000e 0x1b0000000060000b + 0x5c000000005b0016 0x10000000003001a) (.leaf8 0x40000000055001a 0x5600000000550016 + 0x5200000000520016 0x510014 0x540010 0x10021 0x16000000004f001a 0x50000000004f0016)) (.bin (.leaf8 + 0x4e0014 0x520010 0x10021 0x2000000004c001a 0x4c000000004c0016 0x740000000049001a + 0x4a00000000490016 0x30014) (.leaf8 0x4c0010 0x10021 0xf0000000046001a 0x4700000000460016 0x30016 + 0x2490000000043001a 0x4300000000430016 0x420014)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x450010 0x10021 0x4f0000000040001a 0x3f0016 0x3e00000000010016 0xb70000000003d001a + 0x3e000000003d0016 0x14) (.leaf8 0x400010 0x10021 0x3c00000000000016 0x190000000003a001a + 0x600000000390016 0x39360000000037001a 0x360016 0x3600000000010016)) (.bin (.leaf8 + 0x7d30000000034001a 0x3500000000340016 0x20014 + 0x3300000000040000000000000000000200000000370000000000001f 0x370009 0x20021 0x11e110000000031001a + 0x3000000000300016) (.leaf8 0x2725000000002e001a 0x2f000000002e0016 0x30014 0x310010 0x10021 + 0x2d000000002a0016 0x59657000000002b001a 0x2c000000002b0016))) (.bin (.bin (.leaf8 + 0x2a00000000040016 0xc3c10000000028001a 0x270016 0x2700000000010016 0x1befba0000000025001a + 0x2600000000250016 0x30014 0x280010) (.leaf8 0x10021 0x3d2cb0000000022001a 0x2300000000220016 + 0x8baea9000000001f001a 0x20000000001f0016 0x20014 + 0x300000000040000000000000000000200000000220000000000001f 0x220009)) (.bin (.leaf8 0x10021 + 0x131dfb000000001c001a 0x1b000000001b0016 0x2ba69510000000019001a 0x180016 0x16 0x1800000000010016 + 0x5f95e60000000016001a) (.leaf8 0x1700000000160016 0xe0014 0x190010 0x10021 + 0xda40e9b0000000013001a 0x1400000000130016 0x120014 0x160010)))) (.bin (.bin (.bin (.leaf8 0x10021 + 0x1dded840000000010001a 0x1100000000100016 0x14 0x130010 0x10021 0xf000000000c0016 + 0x4434490b000000000d001a) (.leaf8 0xc0016 0x955a39b000000000a001a 0xa000000000a0016 0x30014 + 0xc0010 0x10021 0x155056d350000000007001a 0x60016)) (.bin (.leaf8 0x500000000010016 + 0x2eac321b0000000004001a 0x30016 0x20014 0x20010 0x10021 0x6a91b22320000000001001a 0x3001d) + (.leaf8 0x10000000001000000000100e95cf997000000000000000000000020 0x50010 0x60021 0x17 0x1d + 0x103c3 (h240 (h240 0xe95cf9980000 0x3000000000100000000020000000002000000000000000000010000) + 0x500e95cf9970000000006000000000100000000040000000006001c) 0x4000d))) (.bin (.bin (.leaf8 (h240 + 0x20000000000000000000100000000010000 0x20000000005000000000005bfbe2898000000000000000000010020) + 0x4000e 0x80000000000000000000200000000000000000000001e 0x100000000030023 + 0xa0000000000002eac321a000000000100000000000020 0xc000000000000000000070000000000001f 0x60023 + 0x6000d) (.leaf8 0xd000000000000000000020000000003001f 0x100000000030023 + 0xf00000000000155056d34000000000200000000000020 0x5000e + 0x120000000000000000000c00000000050000000000001e 0xb0023 0xb000d + 0x130000000000000955a39a000000000300000000010020)) (.bin (.leaf8 + 0x14000000000000000000020000000007001f 0x100000000030023 + 0x160000000000004434490a000000000400000000000020 0x18000000000000000000110000000007001f (h240 + 0x1000000001200000000010000 0x10000000002000000000100000000130000000004001c) 0x13000f + 0x1a0000000000000000001300000000080000000001001e 0x120023) (.leaf8 0x12000d + 0x1b00000000000001dded83000000000500000000010020 0x14000e + 0x1c00000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x1d0000000000000da40e9a000000000600000000010020 0x10000e))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x1f00000000000000000019000000000d0000000000001e 0x180023 0x18000d + 0x20000000000000005f95e5000000000700000000010020 0x210000000000000000001a0000000000001f 0x190023 + 0x19000d 0x2000e) (.leaf8 0x10000000000000000000100000000010000000002001c 0x1000f + 0x2300000000000000000001000000000e0000000001001e 0x100000000020023 + 0x2500000000000002ba6950000000000800000000000020 0x270000000000000000001d0000000011001f + 0x1000000001e0023 0x2800000000000000131dfa000000000900000000000020)) (.bin (.leaf8 0x5000e + 0x10000000005000000000100000000220000000002001c 0x22000f + 0x2c0000000000000000002200000000110000000001001e 0x210023 0x21000d + 0x2d000000000000008baea8000000000a00000000010020 0x2e000000000000000000250000000016001f) (.leaf8 + 0x240023 0x24000d 0x2f0000000000000003d2ca000000000b00000000010020 0x5000e + 0x310000000000000000002800000000170000000000001e 0x270023 0x27000d + 0x32000000000000001befb9000000000c00000000010020))) (.bin (.bin (.leaf8 + 0x33000000000000000000290000000000001f 0x280023 0x28000d 0x33000000000000000000020000000019001f + 0x100000000030023 0x350000000000000000c3c0000000000d00000000000020 + 0x370000000000000000002c0000000002001f 0x2b0023) (.leaf8 0x2b000d + 0x370000000000000000002e000000001c001f 0x2d0023 0x2d000d + 0x3800000000000000059656000000000e00000000010020 0x390000000000000000002f000000001b001f (h240 + 0x1000000003000000000010000 0x10000000005000000000100000000310000000004001c) 0x31000f)) (.bin + (.leaf8 0x3b00000000000000000031000000001c0000000001001e 0x300023 0x30000d + 0x3c00000000000000002724000000000f00000000010020 0x3d00000000000000000032000000001f001f + 0x100000000330023 0x3e00000000000000011e10000000001000000000000020 0x35000e) (.leaf8 + 0x10000000005000000000100000000370000000002001c 0x37000f + 0x4100000000000000000037000000001f0000000001001e 0x360023 0x36000d + 0x42000000000000000007d2000000001100000000010020 0x43000000000000000000380000000000001f + 0x370023)))) (.bin (.bin (.bin (.leaf8 0x37000d 0x43000000000000000000020000000023001f + 0x100000000030023 0x4500000000000000003935000000001200000000000020 + 0x47000000000000000000080000000025001f 0x100000000090023 + 0x490000000000000000018f000000001300000000000020 0x3e000e) (.leaf8 (h240 0x10000 + 0x10000000002000000000100000000400000000003001c) 0x40000f + 0x4d0000000000000000004000000000260000000001001e 0x3f0023 0x3f000d + 0x4e00000000000000000b6f000000001400000000010020 0x4f000000000000000000400000000000001f 0x3f0023)) + (.bin (.leaf8 0x3f000d 0x50000000000000000000020000000029001f 0x100000000030023 + 0x520000000000000000004e000000001500000000000020 0x44000e + 0x5400000000000000000045000000002b0000000000001e 0x440023 0x44000d) (.leaf8 + 0x5500000000000000000248000000001600000000010020 0x56000000000000000000020000000001001f (h240 + 0x10000 0x300000000010000000000000000000100000000480000000003001c) 0x48000f + 0x5800000000000000000048000000002d0000000001001e 0x470023 0x47000d + 0x590000000000000000000e000000001700000000010020))) (.bin (.bin (.leaf8 0x5000e + 0x5b0000000000000000004c000000002f0000000000001e 0x4b0023 0x4b000d + 0x5c00000000000000000073000000001800000000010020 0x5d0000000000000000004e0000000032001f 0x4d0023 + 0x4d000d) (.leaf8 0x5e00000000000000000001000000001900000000010020 0x50000e + 0x5f0000000000000000005200000000330000000000001e 0x510023 0x51000d + 0x6000000000000000000015000000001a00000000010020 0x53000e + 0x610000000000000000005400000000350000000000001e)) (.bin (.leaf8 0x530023 0x53000d + 0x62000000000000000000580000000038001f 0x570023 0x57000d + 0x6300000000000000000003000000001c00000000010020 0x64000000000000000000070000000001001f (h240 + 0x10000 0x8000000000100000000000000000001000000005d0000000003001c)) (.leaf8 0x5d000f + 0x660000000000000000005d000000003b0000000001001e 0x5c0023 0x5c000d + 0x670000000000000000001d000000003f001f 0x5e000000001c000b 0x80014 0x600010))))))) (.bin (.bin + (.bin (.bin (.bin (.bin (.leaf8 0x10021 0x20000000058001a 0x5500000000570016 0xb0000000052001a + 0x5300000000520016 0x1000000004f001a 0x4f000000004f0016 0x3a000000004c001a) (.leaf8 + 0x6000000004b0016 0x70000000049001a 0x4900000000490016 0x30014 0x4b0010 0x10021 + 0x1240000000046001a 0x4600000000460016)) (.bin (.leaf8 0x270000000043001a 0x4400000000430016 + 0x30014 0x460010 0x10021 0x42000000003f0016 0x5b70000000040001a 0x4100000000400016) (.leaf8 0x16 + 0xc8000000003d001a 0x3c0016 0x3c00000000070016 0x1c9a000000003a001a 0x390016 0x3900000000010016 + 0x3e90000000037001a))) (.bin (.bin (.leaf8 0x3800000000370016 0x3600000000030016 + 0x8f080000000034001a 0x330016 0x13930000000031001a 0x500000000300016 0x300014 0x70010) (.leaf8 + 0x10021 0x2cb2b000000002e001a 0x2f000000002e0016 0x61e0000000002b001a 0x2c000000002b0016 0x30014 + 0x2e0010 0x10021)) (.bin (.leaf8 0xdf7dd0000000028001a 0x2900000000280016 0x2700000000040016 + 0x1e9650000000025001a 0x2400000000240016 0x45d7540000000022001a 0x500000000210016 + 0x2100000000040016) (.leaf8 0x98efc000000001f001a 0x20000000001f0016 0x1e0014 0x220010 0x10021 + 0x15d34a8000000001c001a 0x1b0016 0x16)))) (.bin (.bin (.bin (.leaf8 0x1b00000000010016 + 0x2fcaf30000000019001a 0x1100000000180016 0x6d2074d0000000016001a 0x1700000000160016 + 0xeef6c20000000013001a 0x1400000000130016 0x16) (.leaf8 0x221a24850000000010001a + 0x1100000000100016 0x30014 0x130010 0x10021 0x4aad1cd000000000d001a 0xd000000000d0016 + 0xc00000000040016)) (.bin (.leaf8 0xaa82b699000000000a001a 0xb000000000a0016 0x30014 0xd0010 + 0x10021 0x900000000060016 0x1756190c0000000007001a 0x800000000070016) (.leaf8 0x30014 0xa0010 + 0x10021 0x600000000030016 0x3548d91180000000004001a 0x30016 0x20014 0x20010))) (.bin (.bin (.leaf8 + 0x10021 0x74ae7ccc0000000001001a 0x3001d 0x1000000000100000000010074ae7ccb000000000000000000000020 + 0x4000e 0x200000000060000000001000000000200000000000000000000001e 0x100000000030023 + 0x20000000008000000000103548d9117000000000100000000000020) (.leaf8 + 0x2000000000a000000000100000000080000000001001f (h240 0x1000000000900000000010000 + 0x100000000050000000001000000000a0000000004001c) 0xa000f + 0x2000000000c0000000001000000000a00000000020000000001001e 0x90023 0x9000d + 0x2000000000d0000000001001756190b000000000200000000010020 + 0x2000000000e0000000001000000000b0000000003001f)) (.bin (.leaf8 (h240 0x1000000000c00000000010000 + 0x100000000050000000001000000000d0000000004001c) 0xd000f + 0x200000000100000000001000000000d00000000040000000001001e 0xc0023 0xc000d + 0x20000000011000000000100aa82b698000000000300000000010020 + 0x200000000120000000001000000000e0000000002001f 0xd0023) (.leaf8 0xd000d + 0x200000000120000000001000000000f0000000008001f 0xe0023 0xe000d + 0x2000000001300000000010004aad1cc000000000400000000010020 0x5000e + 0x200000000150000000001000000001300000000090000000000001e 0x120023))))) (.bin (.bin (.bin (.bin + (.leaf8 0x12000d 0x20000000016000000000100157829a6000000000500000000010020 + 0x20000000017000000000100000000140000000000001f 0x140009 0x180021 0x17 0x1d 0x103c3) (.leaf8 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x10a6c3d6090000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x50074ae7ccb00000000060000000001000000000500000000010000) + 0x3000000000100000000000000000001000000000803548d91180000) + 0x9000000000100000000000000000001000000000500000000010000) + 0xb001756190d000000000c0000000001000000000000000000010000) + 0x50000000001000000000e00aa82b69a000000000f00000000010000) + 0x100004aad1cd00000000120000000001000000000600000000010000) + 0x1400157829a70000000015000000000100000000140000000018001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000170000000000000000001400000000070000000001001e) + 0x130023 0x13000d 0x190000000000000ca1fadc000000000500000000010020 0x2000e + 0x10000000000000000000100000000150000000002001c)) (.bin (.leaf8 0x15000f + 0x1b00000000000000000015000000000b0000000001001e 0x140023 0x14000d + 0x1c00000000000000eef6c1000000000600000000010020 0x1d00000000000000000019000000000e001f 0x180023 + 0x18000d) (.leaf8 0x1e00000000000006d2074c000000000700000000010020 + 0x1f00000000000000000013000000000f001f 0x100000000140023 + 0x21000000000000002fcaf2000000000800000000000020 0x230000000000000000001d0000000000001f 0x1c0023 + 0x1c000d 0x2000e))) (.bin (.bin (.leaf8 0x10000000000000000000100000000010000000002001c 0x1000f + 0x250000000000000000000100000000100000000001001e 0x100000000020023 + 0x27000000000000015d34a7000000000900000000000020 0x20000e + 0x290000000000000000002200000000130000000000001e 0x210023) (.leaf8 0x21000d + 0x2a00000000000000098efb000000000a00000000010020 0x2b000000000000000000230000000002001f 0x220023 + 0x22000d 0x2b000000000000000000070000000015001f 0x100000000080023 + 0x2d0000000000000045d753000000000b00000000000020)) (.bin (.leaf8 + 0x2f000000000000000000260000000017001f 0x100000000270023 + 0x300000000000000001e964000000000c00000000000020 0x32000000000000000000290000000002001f 0x280023 + 0x28000d 0x320000000000000000002b000000001a001f 0x2a0023) (.leaf8 0x2a000d + 0x33000000000000000df7dc000000000d00000000010020 0x5000e + 0x350000000000000000002e000000001b0000000000001e 0x2d0023 0x2d000d + 0x36000000000000000061df000000000e00000000010020 0x3700000000000000000031000000001e001f)))) (.bin + (.bin (.bin (.leaf8 0x300023 0x30000d 0x380000000000000002cb2a000000000f00000000010020 0x32000e + 0x3900000000000000000007000000001e0000000000001e 0x100000000080023 + 0x3b00000000000000001392000000001000000000000020 0x3d000000000000000000020000000021001f) (.leaf8 + 0x100000000030023 0x3f00000000000000008f07000000001100000000000020 + 0x41000000000000000000380000000001001f (h240 0x10000 + 0x3900000000010000000000000000000100000000390000000003001c) 0x39000f + 0x420000000000000000003900000000230000000001001e 0x380023 0x38000d)) (.bin (.leaf8 + 0x43000000000000000003e8000000001200000000010020 0x440000000000000000003b0000000000001f 0x3a0023 + 0x3a000d 0x44000000000000000000020000000025001f 0x100000000030023 + 0x4600000000000000001c99000000001300000000000020 0x480000000000000000003e0000000004001f) (.leaf8 + 0x3d0023 0x3d000d 0x48000000000000000000020000000027001f 0x100000000030023 + 0x4a000000000000000000c7000000001400000000000020 0x2000e + 0x10000000000000000000100000000420000000002001c 0x42000f))) (.bin (.bin (.leaf8 + 0x4e0000000000000000004200000000290000000001001e 0x410023 0x41000d + 0x4f000000000000000005b6000000001500000000010020 0x50000000000000000000440000000029001f (h240 + 0x1000000004500000000010000 0x10000000005000000000100000000460000000004001c) 0x46000f + 0x5200000000000000000046000000002a0000000001001e) (.leaf8 0x450023 0x45000d + 0x5300000000000000000026000000001600000000010020 0x5400000000000000000048000000002e001f 0x470023 + 0x47000d 0x5500000000000000000123000000001700000000010020 0x5000e)) (.bin (.leaf8 + 0x570000000000000000004b000000002f0000000000001e 0x4a0023 0x4a000d + 0x5800000000000000000006000000001800000000010020 0x59000000000000000000080000000031001f + 0x100000000090023 0x5b00000000000000000039000000001900000000000020 + 0x5d000000000000000000510000000034001f) (.leaf8 0x500023 0x50000d + 0x5e00000000000000000000000000001a00000000010020 0x5f000000000000000000550000000036001f 0x540023 + 0x54000d 0x600000000000000000000a000000001b00000000010020 + 0x61000000000000000000570000000039001f)))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x100000000580023 0x6300000000000000000001000000001d00000000000020 0xa000e + 0x660000000000000000006000000000100000000000001e 0x60000a 0xb0008 0x10009 0x10021) (.leaf8 + 0x5c000000005b0016 0x580014 0x5e0010 0x10021 0x50000000055001a 0x5600000000550016 + 0x5200000000520016 0x1c000000004f001a)) (.bin (.leaf8 0x50000000004f0016 0x90014 0x520010 0x10021 + 0x3000000004c001a 0x4c000000004c0016 0x4b00000000040016 0x910000000049001a) (.leaf8 + 0x4900000000490016 0x130000000046001a 0x4700000000460016 0x30016 0x2dc0000000043001a 0x410016 + 0x4200000000010016 0x630000000040001a))) (.bin (.bin (.leaf8 0x3f0016 0x3f00000000010016 + 0xe4c000000003d001a 0x3e000000003d0016 0x30014 0x400010 0x10021 0x1f5000000003a001a) (.leaf8 + 0x380016 0x47840000000037001a 0x360016 0x3600000000010016 0x9c80000000034001a 0x3500000000340016 + 0x80014 0x370010)) (.bin (.leaf8 0x10021 0x165960000000031001a 0x3000000000300016 + 0x30ef000000002e001a 0x2f000000002e0016 0x2d00000000040016 0x6fbee000000002b001a + 0x2a000000002a0016) (.leaf8 0xf4b20000000028001a 0x270016 0x22ebaa0000000025001a 0x240016 + 0x2400000000060016 0x4c77e0000000022001a 0x2100000000210016 0xae9a53000000001f001a)))) (.bin (.bin + (.bin (.leaf8 0x20000000001f0016 0x20014 0x300000000040000000000000000000200000000220000000000001f + 0x220009 0x10021 0x17e579000000001c001a 0x1d000000001c0016 0x140014) (.leaf8 0x1f0010 0x10021 + 0x36903a60000000019001a 0x1a00000000190016 0x777b610000000016001a 0x140016 0x1500000000010016 + 0x110d12420000000013001a)) (.bin (.leaf8 0x600000000120016 0x25568e60000000010001a + 0x1000000000100016 0x55415b4d000000000d001a 0x5000000000c0016 0xc0014 0x70010 0x10021) (.leaf8 + 0xbab0c86000000000a001a 0x500000000090016 0x90014 0x70010 0x10021 0x1aa46c88b0000000007001a + 0x800000000070016 0x30014))) (.bin (.bin (.leaf8 0xa0010 0x10021 0x600000000030016 + 0x3a573e650000000004001a 0x30016 0x20014 0x20010 0x10021) (.leaf8 0x85361eb040000000001001a + 0x100000000010016 0x14 0x20000000000000000000100000000030000000000001f 0x20023 0x2000d + 0x2000000000200000000010123b43830000000000000000000010020 (h240 0x100000000000000 + 0x100000000040000000000072fadb2d2000000000000000000010020))) (.bin (.leaf8 0x4000e + 0x60000000000000000000200000000000000000000001e 0x100000000030023 + 0x80000000000003a573e64000000000100000000000020 0xa000000000000000000080000000001001f (h240 + 0x1000000000900000000010000 0x100000000050000000001000000000a0000000004001c) 0xa000f + 0xc0000000000000000000a00000000020000000001001e) (.leaf8 0x90023 0x9000d + 0xd000000000001aa46c88a000000000200000000010020 0xb000e + 0xe0000000000000000000700000000040000000000001e 0x100000000080023 + 0x100000000000000bab0c85000000000300000000000020 0xe000e))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x120000000000000000000700000000060000000000001e 0x100000000080023 + 0x1400000000000055415b4c000000000400000000000020 0x1600000000000000000012000000000a001f 0x110023 + 0x11000d 0x17000000000000025568e5000000000500000000010020 0x1800000000000000000008000000000b001f) + (.leaf8 0x100000000090023 0x1a000000000000110d1241000000000600000000000020 + 0x1c000000000000000000170000000000001f 0x160023 0x16000d 0x1c00000000000000000002000000000c001f + 0x100000000020023 0x1e00000000000000777b60000000000700000000000020)) (.bin (.leaf8 + 0x200000000000000000001c0000000010001f 0x1b0023 0x1b000d + 0x21000000000000036903a5000000000800000000010020 0x16000e + 0x230000000000000000001f00000000110000000000001e 0x1e0023 0x1e000d) (.leaf8 + 0x240000000000000017e578000000000900000000010020 0x5000e + 0x10000000005000000000100000000220000000002001c 0x22000f + 0x270000000000000000002200000000110000000001001e 0x210023 0x21000d + 0x2800000000000000ae9a52000000000a00000000010020))) (.bin (.bin (.leaf8 + 0x29000000000000000000230000000015001f 0x100000000240023 + 0x2a0000000000000004c77d000000000b00000000000020 0x2c000000000000000000260000000003001f (h240 + 0x10000 0x2700000000010000000000000000000100000000010000000003001c) 0x1000f + 0x2d0000000000000000000100000000160000000001001e 0x100000000020023) (.leaf8 + 0x2f0000000000000022eba9000000000c00000000000020 0x31000000000000000000020000000019001f + 0x100000000030023 0x330000000000000000f4b1000000000d00000000000020 + 0x350000000000000000002c000000001b001f 0x1000000002d0023 + 0x360000000000000006fbed000000000e00000000000020 0x380000000000000000002f0000000002001f)) (.bin + (.leaf8 0x2e0023 0x2e000d 0x3800000000000000000031000000001e001f 0x300023 0x30000d + 0x39000000000000000030ee000000000f00000000010020 0x3a00000000000000000032000000001f001f + 0x100000000330023) (.leaf8 0x3b00000000000000016595000000001000000000000020 0xa000e + 0x3e0000000000000000003700000000210000000000001e 0x360023 0x36000d + 0x3f000000000000000009c7000000001100000000010020 0x40000000000000000000380000000000001f + 0x370023)))) (.bin (.bin (.bin (.leaf8 0x37000d 0x40000000000000000000020000000023001f + 0x100000000030023 0x4200000000000000004783000000001200000000000020 + 0x44000000000000000000020000000024001f 0x100000000020023 + 0x46000000000000000001f4000000001300000000000020 0x5000e) (.leaf8 + 0x490000000000000000004000000000270000000000001e 0x3f0023 0x3f000d + 0x4a00000000000000000e4b000000001400000000010020 0x4b000000000000000000410000000000001f 0x400023 + 0x40000d 0x4b000000000000000000020000000029001f)) (.bin (.leaf8 0x100000000030023 + 0x4d00000000000000000062000000001500000000000020 0x4f000000000000000000440000000000001f 0x430023 + 0x43000d 0x4f00000000000000000002000000002a001f 0x100000000020023 + 0x51000000000000000002db000000001600000000000020) (.leaf8 0x53000000000000000000020000000001001f + (h240 0x10000 0x300000000010000000000000000000100000000480000000003001c) 0x48000f + 0x5500000000000000000048000000002d0000000001001e 0x470023 0x47000d + 0x5600000000000000000012000000001700000000010020 0x570000000000000000004b0000000030001f))) (.bin + (.bin (.leaf8 0x4a0023 0x4a000d 0x5800000000000000000090000000001800000000010020 + 0x590000000000000000004d0000000002001f 0x4c0023 0x4c000d 0x590000000000000000004e0000000032001f + 0x4d0023) (.leaf8 0x4d000d 0x5a00000000000000000002000000001900000000010020 0xb000e + 0x5c0000000000000000005200000000330000000000001e 0x510023 0x51000d + 0x5d0000000000000000001b000000001a00000000010020 0x5e000000000000000000540000000036001f)) (.bin + (.leaf8 0x530023 0x53000d 0x5f000000000000000000580000000038001f 0x570023 0x57000d + 0x6000000000000000000004000000001c00000000010020 0x5a000e + 0x620000000000000000005e000000003b0000000000001e) (.leaf8 0x5d0023 0x5d000d 0xc000e + 0x6400000000000000000001000000003e0000000000001e 0x1000a 0xd0008 0x10009 0x10021)))))))))) + +set_option maxRecDepth 20000 in +def st_8 : CertTree := + (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x5b000000005d0016 0x20000000058001a + 0x5900000000580016 0x5400000000530016 0xd0000000052001a 0x5300000000520016 0x51000000000a0016 + 0x1000000004f001a) (.bin (.leaf8 0x4e000000004d0016 0x48000000004c001a 0x4c000000004c0016 + 0x90000000049001a 0x4900000000490016 0x30014 0x4b0010 0x10021) (.leaf8 0x16d0000000046001a + 0x4700000000460016 0x14 0x490010 0x10021 0x4500000000000016 0x310000000043001a 0x420016))) (.bin + (.leaf8 0x4200000000010016 0x7260000000040001a 0x6000000003f0016 0xfa000000003d001a 0x3c0016 + 0x20014 0x20010 0x10021) (.bin (.leaf8 0x23c1000000003a001a 0x3b000000003a0016 0x30014 0x3d0010 + 0x10021 0x4e40000000037001a 0x3800000000370016 0x3600000000090016) (.leaf8 0xb2ca0000000034001a + 0x330016 0x18780000000031001a 0x3000000000300016 0x37df6000000002e001a 0x2f000000002e0016 0x2d0014 + 0x310010)))) (.bin (.bin (.leaf8 0x10021 0x7a58000000002b001a 0x2c000000002b0016 0x30014 0x2e0010 + 0x10021 0x1175d40000000028001a 0x2900000000280016) (.bin (.leaf8 0x20014 + 0x27000000000400000000000000000002000000002b0000000000001f 0x2b0009 0x20021 0x263be0000000025001a + 0x2600000000250016 0x240014 0x280010) (.leaf8 0x10021 0x574d290000000022001a 0x2300000000220016 + 0x600000000030016 0xbf2bc000000001f001a 0x20000000001f0016 0x1e00000000150016 + 0x1b481d2000000001c001a))) (.bin (.leaf8 0x1d000000001c0016 0x3bbdb00000000019001a 0x180016 + 0x20014 0x20010 0x10021 0x88689210000000016001a 0x150016) (.bin (.leaf8 0x1500000000070016 + 0x12ab4720000000013001a 0x1300000000130016 0x2aa0ada60000000010001a 0xf0016 0xf00000000060016 + 0x5d58642000000000d001a 0xe000000000d0016) (.leaf8 0x80014 0x100010 0x10021 + 0xd5236446000000000a001a 0x500000000090016 0x90014 0x70010 0x10021))))) (.bin (.bin (.bin (.leaf8 + 0x1d2b9f320000000007001a 0x60016 0x500000000010016 0x429b0f5820000000004001a 0x300000000020016 + 0x91da1c180000000001001a 0x200000000010016 0x14) (.bin (.leaf8 + 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d + 0x2000000000200000000010091da1c17000000000000000000010020 + 0x20000000003000000000100000000050000000000001f 0x100000000050023 + 0x2000000000500000000010429b0f581000000000100000000000020 + 0x20000000007000000000100000000070000000000001f) (.leaf8 0x60023 0x6000d + 0x20000000008000000000100000000020000000003001f 0x100000000030023 + 0x2000000000a0000000001001d2b9f31000000000200000000000020 0xb000e + 0x2000000000c0000000001000000000700000000040000000000001e 0x100000000080023))) (.bin (.leaf8 + 0x2000000000e000000000100d5236445000000000300000000000020 0xa000e + 0x200000000110000000001000000001000000000070000000000001e 0xf0023 0xf000d + 0x2000000001200000000010005d58641000000000400000000010020 + 0x20000000013000000000100000000110000000003001f (h240 0x10000 + 0x1200000000010000000000000000000100000000010000000003001c)) (.bin (.leaf8 0x1000f + 0x200000000140000000001000000000100000000080000000001001e 0x100000000020023 + 0x200000000160000000001001ad6340a000000000500000000000020 + 0x20000000018000000000100000000140000000003001f 0x140009 0x190021 0x17) (.leaf8 0x1d 0x103c3 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x14d074cb74000000000300000000010000 + 0x50091da1c1800000000060000000001000000000500000000020000) + 0x100000000080429b0f581000000000900000000010000) + 0x8000000000100000000030000000001000000000000000000010000) + 0xb001d2b9f32000000000c0000000001000000000800000000010000) + 0x1000000000e00d5236445000000000f00000000010000) + 0xb000000000100000000110005d58643000000001200000000010000) + 0x100000000020000000001000000000000000000010000) + 0x14001ad6340a0000000015000000000100000000140000000019001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000180000000000000000001400000000040000000001001e) + 0x130023 0x13000d 0x1a0000000000000fca7999000000000500000000010020)))) (.bin (.bin (.leaf8 + 0x1a00000000000000000015000000000c001f 0x140023 0x14000d + 0x1b000000000000012ab471000000000600000000010020 0x1c000000000000000000170000000004001f 0x160023 + 0x16000d 0x1c00000000000000000002000000000d001f) (.bin (.leaf8 0x100000000030023 + 0x1e00000000000008868920000000000700000000000020 0x4000e + 0x2100000000000000000002000000000e0000000000001e 0x100000000030023 + 0x23000000000000003bbdaf000000000800000000000020 0x250000000000000000001f0000000012001f 0x1e0023) + (.leaf8 0x1e000d 0x2600000000000001b481d1000000000900000000010020 + 0x2700000000000000000020000000000d001f (h240 0x10000 + 0x2100000000010000000000000000000100000000210000000003001c) 0x21000f + 0x280000000000000000002100000000130000000001001e 0x200023 0x20000d))) (.bin (.bin (.leaf8 + 0x29000000000000000bf2bb000000000a00000000010020 0x2a000000000000000000080000000001001f (h240 + 0x10000 0x900000000010000000000000000000100000000240000000003001c) 0x24000f + 0x2c0000000000000000002400000000150000000001001e 0x230023 0x23000d + 0x2d00000000000000574d28000000000b00000000010020) (.leaf8 0x26000e + 0x2e0000000000000000002800000000170000000000001e 0x270023 0x27000d + 0x2f000000000000000263bd000000000c00000000010020 0x29000e + 0x100000000050000000001000000002b0000000002001c 0x2b000f)) (.bin (.leaf8 + 0x310000000000000000002b00000000170000000001001e 0x2a0023 0x2a000d + 0x32000000000000001175d3000000000d00000000010020 0x5000e + 0x340000000000000000002e000000001b0000000000001e 0x2d0023 0x2d000d) (.leaf8 + 0x3500000000000000007a57000000000e00000000010020 0x2f000e + 0x3600000000000000000031000000001d0000000000001e 0x300023 0x30000d + 0x3700000000000000037df5000000000f00000000010020 0x3800000000000000000032000000001f001f + 0x100000000330023)))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x3900000000000000001877000000001000000000000020 0x3b000000000000000000020000000021001f + 0x100000000030023 0x3d0000000000000000b2c9000000001100000000000020 + 0x3f000000000000000000380000000005001f (h240 0x10000 + 0x3900000000010000000000000000000100000000390000000003001c) 0x39000f + 0x400000000000000000003900000000230000000001001e) (.bin (.leaf8 0x380023 0x38000d + 0x41000000000000000004e3000000001200000000010020 0x5000e + 0x430000000000000000003d00000000250000000000001e 0x3c0023 0x3c000d + 0x44000000000000000023c0000000001300000000010020) (.leaf8 0x4000e + 0x460000000000000000000200000000260000000000001e 0x100000000030023 + 0x48000000000000000000f9000000001400000000000020 0x4a000000000000000000080000000029001f + 0x100000000090023 0x4c00000000000000000725000000001500000000000020 + 0x4e000000000000000000440000000000001f))) (.bin (.leaf8 0x430023 0x43000d + 0x4e00000000000000000002000000002b001f 0x100000000030023 + 0x5000000000000000000030000000001600000000000020 0x47000e (h240 0x10000 + 0x10000000002000000000100000000490000000003001c) 0x49000f) (.bin (.leaf8 + 0x5400000000000000000049000000002c0000000001001e 0x480023 0x48000d + 0x550000000000000000016c000000001700000000010020 0x5000e + 0x570000000000000000004b000000002f0000000000001e 0x4a0023 0x4a000d) (.leaf8 + 0x5800000000000000000008000000001800000000010020 0x590000000000000000004e0000000032001f 0x4d0023 + 0x4d000d 0x5a00000000000000000047000000001900000000010020 0x5b000000000000000000500000000032001f + 0x100000000500023 0x5d00000000000000000000000000001a00000000000020)))) (.bin (.bin (.leaf8 + 0x5e000000000000000000530000000006001f 0x520023 0x52000d 0x5f000000000000000000550000000036001f + 0x540023 0x54000d 0x600000000000000000000c000000001b00000000010020 + 0x61000000000000000000560000000036001f) (.bin (.leaf8 (h240 0x10000 + 0x56000000000200000000000000000001000000005a0000000003001c) 0x5a000f + 0x630000000000000000005a00000000390000000001001e 0x590023 0x59000d + 0x6400000000000000000001000000001d00000000010020 0x650000000000000000005d000000003d001f (h240 + 0x1000000005e00000000010000 0x1000000000e000000000100000000010000000004001c)) (.leaf8 0x600c6 + 0x10043 0xe0142 0x101c3 0xf0009 0x5e0014 0xf000e 0x20186))) (.bin (.leaf8 0x10043 0x100142 0x101c3 + 0x110023 0x2600c6 0x10043 0x10303 0x10009) (.bin (.leaf8 0x600008 0x10009 0x10021 + 0x5d00000000010019 0x650000000000001d 0x5b0023 (h240 0x20000 + 0x10000000061000000000100000000010000000003009c) 0x1000f) (.leaf8 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x2d9 + 0x428c3800000000000000000001000000000114d074cb7400000000030000) + 0x100000000050091da1c180000000006000000000100000000050000) + 0x20000000000000000000100000000080429b0f58100000000090000) + 0x1000000000800000000010000000003000000000100000000000000) + 0x1000000000b001d2b9f32000000000c000000000100000000080000) + 0x100000000000000000001000000000e00d5236445000000000f0000) + 0x1000000000b000000000100000000110005d5864300000000120000) + 0x1000000000000000000010000000002000000000100000000000000) + 0x10000000014002aa0ada50000000015000000000100000000160001) + 0x2ab473000000001800000000010000000003000000000100000000000000) + 0x1000000001a0008868920000000001b000000000100000000050000) + 0x10000000003000000000100000000000000000001000000001d0000) + 0x3bbdaf000000001e000000000100000000200001b481d300000000210000) + 0x100000000000000000001000000002200000bf2bc00000000240000) + 0x1000000000900000000010000000000000000000100000000250000) + 0x574d2a00000000270000000001000000002900000263bf000000002a0000) + 0x100000000050000000001000000002c00001175d4000000002d0000) + 0x100000000060000000001000000002f0000007a5900000000300000) + 0x100000000320000037df70000000033000000000100000000000000) + 0x1000000003500000018770000000036000000000100000000030000) + 0x1000000000000000000010000000038000000b2ca00000000390000) + 0x100000000000000000001000000003a00000004e4000000003c0000) + 0x100000000060000000001000000003e00000023c1000000003f0000) + 0x1000000000500000000010000000003000000000100000000000000) + 0x1000000004100000000f90000000042000000000100000000090000) + 0x1000000000000000000010000000044000000072600000000450000) + 0x1000000000300000000010000000000000000000100000000470000) + 0x31000000004800000000010000000000000000000100000000020000) + 0x1000000004a000000016d000000004b000000000100000000060000) + 0x1000000004c0000000009000000004e0000000001000000004f0000) + 0x48000000005100000000010000000050000000000200000000000000) + 0x1000000005300000000010000000054000000000100000000560000) + 0xd000000005700000000010000000056000000000200000000000000) + 0x1000000005b0000000001000000005d0000000001000000005c0000) + 0x6600000000020000000000000000000100000000080000000001001e) 0x610000000001000b 0x14 0x62000e + 0x20186 0x10043 0x630142 0x101c3))))) (.bin (.bin (.bin (.leaf8 0x640023 0xcc00c6 0x10043 0x10303 + 0x10009 0x20008 0x10009 0x10021) (.bin (.leaf8 0x5c00000000010019 0x650000000000001d 0x5a0023 + (h240 0x20000 0x10000000003000000000100000000010000000003009c) 0x1000f (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x2d9 + 0x428c4e00000000000000000001000000000114d074cb7400000000030000) + 0x100000000050091da1c180000000006000000000100000000050000) + 0x20000000000000000000100000000080429b0f58100000000090000) + 0x1000000000800000000010000000003000000000100000000000000) + 0x1000000000b001d2b9f32000000000c000000000100000000080000) + 0x100000000000000000001000000000e00d5236445000000000f0000) + 0x1000000000b000000000100000000110005d5864300000000120000) + 0x1000000000000000000010000000002000000000100000000000000) + 0x10000000014002aa0ada50000000015000000000100000000160001) + 0x2ab473000000001800000000010000000003000000000100000000000000) + 0x1000000001a0008868920000000001b000000000100000000050000) + 0x10000000003000000000100000000000000000001000000001d0000) + 0x3bbdaf000000001e000000000100000000200001b481d300000000210000) + 0x100000000000000000001000000002200000bf2bc00000000240000) + 0x1000000000900000000010000000000000000000100000000250000) + 0x574d2a00000000270000000001000000002900000263bf000000002a0000) + 0x100000000050000000001000000002c00001175d4000000002d0000) + 0x100000000060000000001000000002f0000007a5900000000300000) + 0x100000000320000037df70000000033000000000100000000000000) + 0x1000000003500000018770000000036000000000100000000030000) + 0x1000000000000000000010000000038000000b2ca00000000390000) + 0x100000000000000000001000000003a00000004e4000000003c0000) + 0x100000000060000000001000000003e00000023c1000000003f0000) + 0x1000000000500000000010000000003000000000100000000000000) + 0x1000000004100000000f90000000042000000000100000000090000) + 0x1000000000000000000010000000044000000072600000000450000) + 0x1000000000300000000010000000000000000000100000000470000) + 0x31000000004800000000010000000000000000000100000000020000) + 0x1000000004a000000016d000000004b000000000100000000060000) + 0x1000000004c0000000009000000004e0000000001000000004f0000) + 0x48000000005100000000010000000050000000000200000000000000) + 0x1000000005300000000010000000054000000000100000000560000) + 0xd000000005700000000010000000056000000000200000000000000) + 0x1000000005b0000000001000000005d0000000001000000005b0000) + 0x66000000000200000000000000000001000000003f0000000001001e) 0x1000a 0x30008) (.leaf8 + 0x400000000000000000001000000000100000000000000000000001e 0x50000000001000b 0x13 0x5b0008 (h240 + 0x10000 0x200000000010000000000000000000100000000060000000003001c) 0x20186 0x10043 0x60142))) + (.bin (.leaf8 0x101c3 0x70023 0x1200c6 0x10043 0x10303 0x10009 0x8 0x10009) (.bin (.leaf8 0x10021 + 0x5c00000000000016 0x5d00000000010019 0x640000000000001d 0x5b0023 0x300000000000000000001009c + 0x5e0003 (h240 0x10000 0x10000000001000000000100000000010000000003001c)) (.leaf8 0x1000f (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 0x2d9428cd200000000000000 0x1000000000114d074cb740000000003000000000100000000050091) + 0xda1c18000000000600000000010000000005000000000200000000000000) + 0x100000000080429b0f5810000000009000000000100000000080000) + 0x10000000003000000000100000000000000000001000000000b001d) + 0x2b9f32000000000c00000000010000000008000000000100000000000000) + 0x1000000000e00d5236445000000000f0000000001000000000b0000) + 0x100000000110005d586430000000012000000000100000000000000) + 0x100000000020000000001000000000000000000010000000014002a) + 0xa0ada500000000150000000001000000001600012ab47300000000180000) + 0x10000000003000000000100000000000000000001000000001a0008) + 0x868920000000001b00000000010000000005000000000100000000030000) + 0x100000000000000000001000000001d00003bbdaf000000001e0000) + 0x100000000200001b481d30000000021000000000100000000000000) + 0x1000000002200000bf2bc0000000024000000000100000000090000) + 0x10000000000000000000100000000250000574d2a00000000270000) + 0x1000000002900000263bf000000002a000000000100000000050000) + 0x1000000002c00001175d4000000002d000000000100000000060000) + 0x1000000002f0000007a590000000030000000000100000000320000) + 0x37df7000000003300000000010000000000000000000100000000350000) + 0x1877000000003600000000010000000003000000000100000000000000) + 0x10000000038000000b2ca0000000039000000000100000000000000) + 0x1000000003a00000004e4000000003c000000000100000000060000) + 0x1000000003e00000023c1000000003f000000000100000000050000) + 0x1000000000300000000010000000000000000000100000000410000) + 0xf9000000004200000000010000000009000000000100000000000000) + 0x1000000004400000007260000000045000000000100000000030000) + 0x1000000000000000000010000000047000000003100000000480000) + 0x10000000000000000000100000000020000000001000000004a0000) + 0x16d000000004b000000000100000000060000000001000000004c0000) + 0x9000000004e0000000001000000004f000000004800000000510000) + 0x1000000005000000000020000000000000000000100000000530000) + 0x1000000005400000000010000000056000000000d00000000570000) + 0x10000000056000000000200000000000000000001000000005b0000) + 0x1000000005c000000000200000000000000000001000000005e0000) + 0x6700000000020000000000000000000100000000010000000001001e) 0x1000a 0x10008 (h240 0x5e0000 + 0x200000000000000000002000000000100000000000000000000001e) 0x30000000001000b 0x5e0013 0x8)))) + (.bin (.bin (.leaf8 (h240 0x5c0000 0x100000000000000000002000000000100000000000000000000001e) + 0x10009 0x20021 0x590016 0x560014 0x20010 0x10021 0x60000000055001a) (.bin (.leaf8 + 0x5600000000550016 0x5300000000520016 0x14 0x550010 0x10021 0x51000000004e0016 0x23000000004f001a + 0x4f000000004f0016) (.leaf8 0x4000000004c001a 0x4c000000004c0016 0x4b00000000040016 + 0xb60000000049001a 0x200000000480016 0x480014 0x40010 0x10021))) (.bin (.bin (.leaf8 + 0x180000000046001a 0x450016 0x4500000000010016 0x3920000000043001a 0x4400000000430016 0x90014 + 0x460010 0x10021) (.leaf8 0x7c0000000040001a 0x4100000000400016 0x30014 0x430010 0x10021 + 0x3f00000000030016 0x11e0000000003d001a 0x6000000003c0016)) (.bin (.leaf8 0x272000000003a001a + 0x380016 0x59650000000037001a 0x360016 0x3600000000010016 0xc3b0000000034001a 0x330016 + 0x1befb0000000031001a) (.leaf8 0x3200000000310016 0x3d2c000000002e001a 0x2f000000002e0016 + 0x2d00000000040016 0x8bae9000000002b001a 0x2c000000002b0016 0x2a00000000030016 + 0x131df0000000028001a))))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 0x2700000000270016 + 0x2ba6940000000025001a 0x2500000000250016 0x90014 0x270010 0x10021 0x5f95e0000000022001a 0x200016) + (.bin (.leaf8 0xda40e9000000001f001a 0x20000000001f0016 0x1dded7000000001c001a 0x1d000000001c0016 + 0x30014 0x1f0010 0x10021 0x1b00000000030016) (.leaf8 0x443448f0000000019001a 0x1a00000000190016 + 0x30014 0x1c0010 0x10021 0x955a390000000016001a 0x1600000000160016 0x155056d20000000013001a))) + (.bin (.leaf8 0x1400000000130016 0x20014 + 0x1200000000040000000000000000000200000000160000000000001f 0x160009 0x20021 + 0x2eac3210000000010001a 0xb000000000f0016 0x6a91b222000000000d001a) (.bin (.leaf8 + 0xe000000000d0016 0x80014 0x100010 0x10021 0xe95cf99000000000a001a 0x90016 0x800000000010016 + 0x214d87ac00000000007001a) (.leaf8 0x800000000070016 0x14 0xa0010 0x10021 0x600000000030016 + 0x48ed0e0b0000000004001a 0x500000000040016 0xa683a65ba0000000001001a)))) (.bin (.bin (.leaf8 + 0x3001d 0x100000000010000000001016ca1466a000000000000000000000020 0x50010 0x60021 0x17 0x1d + 0x103c3 (h240 (h240 0x16ca1466b0000 0x3000000000100000000020000000002000000000000000000010000) + 0x5016ca1466a0000000006000000000100000000040000000006001c)) (.bin (.leaf8 0x4000d (h240 + 0x20000000000000000000100000000010000 0x20000000005000000000008fb991f4d000000000000000000010020) + 0x7000000000000000000070000000002001f 0x60023 0x6000d + 0x800000000000048ed0e0a000000000100000000010020 0x9000000000000000000080000000001001f (h240 + 0x1000000000900000000010000 0x100000000020000000001000000000a0000000004001c)) (.leaf8 0xa000f + 0xb0000000000000000000a00000000020000000001001e 0x90023 0x9000d + 0xc00000000000214d87abf000000000200000000010020 0xd0000000000000000000a0000000000001f 0x90023 + 0x9000d))) (.bin (.leaf8 0xe000000000000000000020000000005001f 0x100000000030023 + 0x100000000000000e95cf98000000000300000000000020 0xa000e + 0x130000000000000000001000000000070000000000001e 0xf0023 0xf000d + 0x140000000000006a91b221000000000400000000010020) (.bin (.leaf8 + 0x150000000000000000000d0000000009001f 0x1000000000e0023 + 0x1700000000000002eac320000000000500000000000020 0x14000e + 0x10000000005000000000100000000160000000002001c 0x16000f + 0x1a0000000000000000001600000000090000000001001e 0x150023) (.leaf8 0x15000d + 0x1b000000000000155056d1000000000600000000010020 0x1c00000000000000000018000000000e001f 0x170023 + 0x17000d 0x1d00000000000000955a38000000000700000000010020 0x5000e + 0x1f0000000000000000001c000000000f0000000000001e))))) (.bin (.bin (.bin (.leaf8 0x1b0023 0x1b000d + 0x200000000000000443448e000000000800000000010020 0x210000000000000000001d0000000001001f (h240 + 0x1000000001e00000000010000 0x100000000050000000001000000001f0000000004001c) 0x1f000f + 0x230000000000000000001f00000000100000000001001e 0x1e0023) (.bin (.leaf8 0x1e000d + 0x24000000000000001dded6000000000900000000010020 0x25000000000000000000220000000014001f 0x210023 + 0x21000d 0x2600000000000000da40e8000000000a00000000010020 0x27000000000000000000020000000014001f + 0x100000000020023) (.leaf8 0x290000000000000005f95d000000000b00000000000020 0xb000e + 0x2c0000000000000000002700000000170000000000001e 0x260023 0x26000d + 0x2d000000000000002ba693000000000c00000000010020 0x2e000000000000000000290000000019001f + 0x1000000002a0023))) (.bin (.leaf8 0x2f000000000000000131de000000000d00000000000020 + 0x310000000000000000002c0000000001001f (h240 0x10000 + 0x2d000000000100000000000000000001000000002d0000000003001c) 0x2d000f + 0x320000000000000000002d000000001b0000000001001e 0x2c0023 0x2c000d + 0x330000000000000008bae8000000000e00000000010020) (.bin (.leaf8 + 0x340000000000000000002f0000000002001f 0x2e0023 0x2e000d 0x3400000000000000000031000000001e001f + 0x300023 0x30000d 0x3500000000000000003d2b000000000f00000000010020 + 0x36000000000000000000340000000020001f) (.leaf8 0x330023 0x33000d + 0x370000000000000001befa000000001000000000010020 0x38000000000000000000020000000021001f + 0x100000000030023 0x3a00000000000000000c3a000000001100000000000020 + 0x3c000000000000000000380000000000001f 0x370023)))) (.bin (.bin (.leaf8 0x37000d + 0x3c000000000000000000020000000023001f 0x100000000030023 + 0x3e00000000000000005964000000001200000000000020 0x40000000000000000000020000000024001f + 0x100000000020023 0x4200000000000000000271000000001300000000000020 + 0x44000000000000000000080000000027001f) (.bin (.leaf8 0x100000000090023 + 0x46000000000000000011df000000001400000000000020 0x48000000000000000000410000000001001f (h240 + 0x1000000004200000000010000 0x10000000005000000000100000000430000000004001c) 0x43000f + 0x4a0000000000000000004300000000280000000001001e 0x420023 0x42000d) (.leaf8 + 0x4b0000000000000000007b000000001500000000010020 0xb000e + 0x4d00000000000000000046000000002b0000000000001e 0x450023 0x45000d + 0x4e00000000000000000391000000001600000000010020 0x4f000000000000000000470000000000001f + 0x460023))) (.bin (.bin (.leaf8 0x46000d 0x4f00000000000000000002000000002d001f 0x100000000030023 + 0x5100000000000000000017000000001700000000000020 0x4a000e + 0x5300000000000000000004000000002e0000000000001e 0x100000000050023 + 0x55000000000000000000b5000000001800000000000020) (.leaf8 0x570000000000000000004d0000000002001f + 0x4c0023 0x4c000d 0x570000000000000000004e0000000032001f 0x4d0023 0x4d000d + 0x5800000000000000000003000000001900000000010020 0x59000000000000000000510000000034001f)) (.bin + (.leaf8 0x500023 0x50000d 0x5a00000000000000000022000000001a00000000010020 + 0x5b000000000000000000530000000033001f (h240 0x1000000005400000000010000 + 0x10000000002000000000100000000550000000004001c) 0x55000f + 0x5d0000000000000000005500000000340000000001001e 0x540023) (.leaf8 0x54000d + 0x5e000000000000000000580000000038001f 0x570023 0x57000d + 0x5f00000000000000000005000000001c00000000010020 0x58000e + 0x610000000000000000000200000000390000000000001e (h240 + 0x100000000020000000002000000000000000000010000 + 0x5e00000000010000000002000000000100000000010000000005001c))))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x1000f 0x6500000000000000000001000000003b0000000001001e 0x23 0xd 0x4000e 0x20186 0x10043 0x50142) + (.bin (.leaf8 0x101c3 0x60023 0x1000c6 0x10043 0x10303 0x10009 0x20008 0x10009) (.leaf8 0x10021 + 0x5e00000000000016 0x14 0x60000e (h240 0x10000 0x10000000003000000000100000000010000000003001c) + 0x1000f 0x40021 0x5900000000000016))) (.bin (.leaf8 0x30000000058001a 0x5600000000570016 0x16 + 0x120000000052001a 0x5100000000500016 0x1000000004f001a 0x4f000000004f0016 0x5b000000004c001a) + (.bin (.leaf8 0x4b0016 0x4b00000000030016 0xb0000000049001a 0x4a00000000490016 0x30014 0x4c0010 + 0x10021 0x1c90000000046001a) (.leaf8 0x4700000000460016 0x45000000000a0016 0x3d0000000043001a + 0x4400000000430016 0x30016 0x8f00000000040001a 0x3f0016 0x3f00000000070016)))) (.bin (.bin (.leaf8 + 0x138000000003d001a 0x3c0016 0x20014 0x20010 0x10021 0x2cb2000000003a001a 0x390016 + 0x3900000000010016) (.bin (.leaf8 0x61d0000000037001a 0x360016 0x3600000000010016 + 0xdf7d0000000034001a 0x3300000000330016 0x1e950000000031001a 0x3200000000310016 + 0x45d75000000002e001a) (.leaf8 0x2c0016 0x98ef000000002b001a 0x2c000000002b0016 0x2a0014 0x2e0010 + 0x10021 0x15d34a0000000028001a 0xc00000000260016))) (.bin (.leaf8 0x2fcae0000000025001a + 0x2600000000250016 0x14 0x280010 0x10021 0x2400000000000016 0x6d20740000000022001a + 0x2100000000210016) (.bin (.leaf8 0xeef6b000000001f001a 0x5000000001e0016 0x1e0014 0x70010 0x10021 + 0x221a247000000001c001a 0x1d000000001c0016 0x1b00000000040016) (.leaf8 0x4aad1c0000000019001a + 0x1800000000170016 0xaa82b680000000016001a 0x1700000000160016 0x1500000000030016 + 0x17561900000000013001a 0x120016 0x12000000000c0016))))) (.bin (.bin (.bin (.leaf8 + 0x3548d9100000000010001a 0x1100000000100016 0xf00000000090016 0x74ae7cb000000000d001a + 0xe000000000d0016 0x30014 0x100010 0x10021) (.bin (.leaf8 0xc00000000090016 + 0x10a6c3d5f000000000a001a 0xb000000000a0016 0x16 0x247687060000000007001a 0x600000000060016 + 0x5341d32dc0000000004001a 0x30016) (.leaf8 0x20014 0x20010 0x10021 0xb650a3350000000001001a + 0x100000000010016 0x14 0x20000000000000000000100000000030000000000001f 0x20023))) (.bin (.leaf8 + 0x2000d 0x20000000002000000000100b650a334000000000000000000010020 0x4000e + 0x200000000040000000001000000000200000000000000000000001e 0x100000000030023 + 0x20000000006000000000105341d32db000000000100000000000020 + 0x20000000008000000000100000000080000000003001f 0x100000000090023) (.bin (.leaf8 + 0x2000000000900000000010024768705000000000200000000000020 0x2000e + 0x100000000000000000001000000000c0000000002001c 0xc000f + 0x2000000000d0000000001000000000c00000000050000000001001e 0xb0023 0xb000d + 0x2000000000e0000000001010a6c3d5e000000000300000000010020) (.leaf8 + 0x2000000000f0000000001000000000e0000000005001f (h240 0x1000000000f00000000010000 + 0x10000000005000000000100000000100000000004001c) 0x10000f + 0x200000000110000000001000000001000000000060000000001001e 0xf0023 0xf000d + 0x20000000012000000000100074ae7ca000000000400000000010020 + 0x20000000013000000000100000000110000000005001f)))) (.bin (.bin (.leaf8 (h240 0x10000 + 0x1200000000010000000000000000000100000000120000000003001c) 0x12000f + 0x200000000140000000001000000001200000000090000000001001e 0x110023 0x11000d + 0x20000000015000000000100218bc103000000000500000000010020 + 0x20000000016000000000100000000140000000002001f (h240 0x100000000000000 + 0x100000000170000000000000000001400000000070000000000001e)) (.bin (.leaf8 0x130023 0x13000d + 0x1800000000000013bd180a000000000500000000010020 0x18000000000000000000140000000007001f (h240 + 0x10000 0x1500000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1900000000000000000001000000000a0000000001001e 0x100000000020023) (.leaf8 + 0x1b0000000000000175618f000000000600000000000020 0x1d000000000000000000170000000001001f (h240 + 0x10000 0x1800000000010000000000000000000100000000180000000003001c) 0x18000f + 0x1e00000000000000000018000000000d0000000001001e 0x170023 0x17000d + 0x1f0000000000000aa82b67000000000700000000010020))) (.bin (.bin (.leaf8 + 0x200000000000000000001a000000000e001f 0x1000000001a0023 + 0x22000000000000004aad1b000000000800000000000020 0x240000000000000000001d0000000002001f 0x1c0023 + 0x1c000d 0x240000000000000000001f0000000012001f 0x1e0023) (.leaf8 0x1e000d + 0x250000000000000221a246000000000900000000010020 0x20000e + 0x260000000000000000000700000000120000000000001e 0x100000000080023 + 0x28000000000000000eef6a000000000a00000000000020 0x2a000000000000000000230000000015001f + 0x100000000240023)) (.bin (.leaf8 0x2b000000000000006d2073000000000b00000000000020 0x26000e (h240 + 0x10000 0x10000000002000000000100000000280000000003001c) 0x28000f + 0x2f0000000000000000002800000000160000000001001e 0x270023 0x27000d + 0x300000000000000002fcad000000000c00000000010020) (.leaf8 0x310000000000000000000e0000000018001f + 0x1000000000e0023 0x330000000000000015d349000000000d00000000000020 0x2c000e + 0x350000000000000000002e000000001b0000000000001e 0x2d0023 0x2d000d + 0x36000000000000000098ee000000000e00000000010020)))))))) (.bin (.bin (.bin (.bin (.bin (.bin + (.leaf8 0x3700000000000000000002000000001c001f 0x100000000020023 + 0x3900000000000000045d74000000000f00000000000020 0x3b000000000000000000340000000020001f 0x330023 + 0x33000d 0x3c00000000000000001e94000000001000000000010020 0x3d000000000000000000350000000021001f) + (.bin (.leaf8 0x100000000360023 0x3e0000000000000000df7c000000001100000000000020 + 0x40000000000000000000380000000000001f 0x370023 0x37000d 0x40000000000000000000020000000023001f + 0x100000000030023 0x420000000000000000061c000000001200000000000020) (.leaf8 + 0x440000000000000000003b0000000000001f 0x3a0023 0x3a000d 0x44000000000000000000020000000025001f + 0x100000000030023 0x4600000000000000002cb1000000001300000000000020 0x4000e + 0x490000000000000000000200000000260000000000001e))) (.bin (.leaf8 0x100000000030023 + 0x4b00000000000000000137000000001400000000000020 0x4d000000000000000000410000000004001f 0x400023 + 0x40000d 0x4d000000000000000000020000000029001f 0x100000000030023 + 0x4f000000000000000008ef000000001500000000000020) (.bin (.leaf8 + 0x51000000000000000000020000000001001f (h240 0x10000 + 0x300000000010000000000000000000100000000450000000003001c) 0x45000f + 0x5300000000000000000045000000002b0000000001001e 0x440023 0x44000d + 0x540000000000000000003c000000001600000000010020 0x55000000000000000000470000000006001f) (.leaf8 + 0x460023 0x46000d 0x5500000000000000000049000000002e001f 0x480023 0x48000d + 0x56000000000000000001c8000000001700000000010020 0x5000e + 0x580000000000000000004c000000002f0000000000001e)))) (.bin (.bin (.leaf8 0x4b0023 0x4b000d + 0x590000000000000000000a000000001800000000010020 0x5a0000000000000000004d0000000001001f (h240 + 0x10000 0x4e00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x5b0000000000000000000100000000300000000001001e 0x100000000020023) (.bin (.leaf8 + 0x5d0000000000000000005a000000001900000000000020 0x5f000000000000000000510000000034001f 0x500023 + 0x50000d 0x6000000000000000000000000000001a00000000010020 0x61000000000000000000530000000034001f + 0x100000000530023 0x6300000000000000000011000000001b00000000000020) (.leaf8 0x2000e + 0x10000000000000000000100000000570000000002001c 0x57000f + 0x670000000000000000005700000000380000000001001e 0x100000000580023 + 0x6900000000000000000002000000001d00000000000020 0x5b000e (h240 (h240 0x10000 + 0x100000000020000000001000000006100000000010000) + 0x10000000003000000000100000000010000000006001c)))) (.bin (.leaf8 0x1000f + 0x710000000000000000000100000000000000000001001e 0x30000000000000b 0x610014 0x3000e 0xc00c6 + 0x10043 0x630142) (.bin (.leaf8 0x101c3 0x640009 0x200000000010019 0x6d0000000000001d 0x23 + 0x300000000000000000001009c 0x640003 0x64000f) (.leaf8 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 (h240 + 0x38f932ff90000000000000000000100000000021a04 + 0x91fdfe00000000030000000001000000000400b650a33500000000060000) + 0x1000000000500000000010000000003000000000100000000000000) + 0x1000000000805341d32dc0000000009000000000100000000000000) + 0x1000000000b0024768705000000000c000000000100000000030000) + 0x100000000000000000001000000000d010a6c3d60000000000f0000) + 0x1000000000000000000010000000005000000000100000000110007) + 0x4ae7cc000000001200000000010000000000000000000100000000130035) + 0x48d911000000001500000000010000000000000000000100000000020000) + 0x1000000000000000000010000000017000175619000000000180000) + 0x1000000000000000000010000000019000aa82b68000000001b0000) + 0x1000000001a000000000200000000000000000001000000001d0000) + 0x4aad1c000000001e00000000010000000020000221a24800000000210000) + 0x1000000000800000000010000000000000000000100000000230000) + 0xeef6b000000002400000000010000000000000000000100000000260000) + 0x6d2074000000002700000000010000000000000000000100000000020000) + 0x10000000029000002fcae000000002a0000000001000000000e0000) + 0x200000000000000000001000000002c000015d34a000000002d0000) + 0x1000000002f00000098ef0000000030000000000100000000020000) + 0x20000000000000000000100000000320000045d7400000000330000) + 0x100000000350000001e960000000036000000000100000000000000) + 0x10000000038000000df7d0000000039000000000100000000030000) + 0x100000000000000000001000000003b000000061d000000003c0000) + 0x10000000003000000000100000000000000000001000000003e0000) + 0x2cb1000000003f00000000010000000005000000000100000000030000) + 0x1000000000000000000010000000041000000013800000000420000) + 0x1000000000300000000010000000000000000000100000000440000) + 0x8ef000000004500000000010000000003000000000100000000000000) + 0x10000000046000000003e00000000480000000001000000004a0000) + 0x1c9000000004b000000000100000000060000000001000000004d0000) + 0xc000000004e00000000010000000000000000000100000000020000) + 0x1000000000000000000010000000050000000005a00000000510000) + 0x1000000005200000000010000000054000000000100000000530000) + 0x2000000000000000000010000000056000000001100000000570000) + 0x1000000000300000000010000000000000000000100000000580000) + 0x100000000000000000001000000005c0000000002000000005d0000) + 0x1000000005c00000000010000000000000000000100000000010000) + 0x6e00000000010000000000000000006400000000000000000001001e) 0x64000a 0x8 (h240 0x10000 + 0x100000000000000000002000000000100000000000000000000001e) (h240 0x5c0000 + 0x300000000010000000002000000000100000000000000000000001e) 0x10009 0x30021 0x1000000005b001a))))) + (.bin (.bin (.bin (.leaf8 0x5a0016 0x560016 0x5700000000010016 0x80000000055001a 0x540016 0x530014 + 0x20010 0x10021) (.bin (.leaf8 0x5200000000520016 0x2d000000004f001a 0x4e0016 0x16 + 0x6000000004c001a 0x6000000004b0016 0xe40000000049001a 0x4a00000000490016) (.leaf8 + 0x1f0000000046001a 0x440016 0x4500000000010016 0x4770000000043001a 0x420016 0x4200000000010016 + 0x9b0000000040001a 0x4100000000400016))) (.bin (.leaf8 0x30014 0x430010 0x10021 0x3f00000000030016 + 0x1658000000003d001a 0x3c0016 0x3c00000000010016 0x30e000000003a001a) (.bin (.leaf8 0x390016 + 0x3900000000010016 0x6fbe0000000037001a 0x360016 0xf4b0000000034001a 0x3300000000330016 + 0x22eb90000000031001a 0x3200000000310016) (.leaf8 0x14 0x340010 0x10021 0x3000000000000016 + 0x4c77000000002e001a 0x2d000000002d0016 0xae9a4000000002b001a 0x2c000000002b0016)))) (.bin (.bin + (.leaf8 0x14 0x2e0010 0x10021 0x2a000000000c0016 0x17e560000000028001a 0x2900000000280016 0x16 + 0x36903a0000000025001a) (.bin (.leaf8 0x240016 0x777b50000000022001a 0x2300000000220016 0x80014 + 0x250010 0x10021 0x110d124000000001f001a 0x1e000000001e0016) (.leaf8 0x25568d000000001c001a + 0x1d000000001c0016 0x14 0x1f0010 0x10021 0x1b00000000180016 0x55415b30000000019001a + 0x1900000000190016))) (.bin (.bin (.leaf8 0x180014 0x1b0010 0x10021 0xbab0c70000000016001a + 0x1700000000160016 0x20014 0x1500000000040000000000000000000200000000190000000000001f 0x190009) + (.leaf8 0x20021 0x1aa46c880000000013001a 0x110016 0x3a573e60000000010001a 0x5000000000f0016 + 0xf0014 0x70010 0x10021)) (.bin (.leaf8 0x85361eaf000000000d001a 0xd000000000d0016 0x30014 0xf0010 + 0x10021 0x123b4382000000000a001a 0xb000000000a0016 0x90014) (.leaf8 0xd0010 0x10021 + 0x29a0e996d0000000007001a 0x800000000070016 0x30014 0xa0010 0x10021 0x600000000030016)))))) (.bin + (.bin (.bin (.bin (.leaf8 0x5b28519a0000000004001a 0x300000000020016 0xd0248fefe0000000001001a + 0x200000000010016 0x14 0x20000000000000000000100000000040000000000001f 0x30023 0x3000d) (.bin + (.leaf8 0x20000000002000000000101c7c997fb000000000000000000010020 0x50010 0x40021 0x17 0x1d + 0x103c3 (h240 0x1c7c997fe000000000300000000010000 + 0x501c7c997fc0000000006000000000100000000040000000004001c) 0x4000d) (.leaf8 (h240 + 0x20000000000000000000100000000010000 0x2000000000300000000000b3a7f6700000000000000000000010020) + 0x5000000000000000000050000000000001f 0x100000000050023 + 0x70000000000005b285199000000000100000000000020 0x9000000000000000000080000000001001f (h240 + 0x1000000000900000000010000 0x100000000050000000001000000000a0000000004001c) 0xa000f + 0xb0000000000000000000a00000000020000000001001e))) (.bin (.leaf8 0x90023 0x9000d + 0xc0000000000029a0e996c000000000200000000010020 0xb000e + 0xd0000000000000000000d00000000050000000000001e 0xc0023 0xc000d + 0xe000000000000123b4381000000000300000000010020) (.bin (.leaf8 0x5000e + 0x100000000000000000000f00000000070000000000001e 0xe0023 0xe000d + 0x1100000000000085361eae000000000400000000010020 0x11000e + 0x120000000000000000000700000000080000000000001e 0x100000000080023) (.leaf8 + 0x1400000000000003a573e5000000000500000000000020 0x1600000000000000000002000000000a001f + 0x100000000020023 0x180000000000001aa46c87000000000600000000000020 0x17000e + 0x10000000005000000000100000000190000000002001c 0x19000f + 0x1b00000000000000000019000000000b0000000001001e)))) (.bin (.bin (.leaf8 0x180023 0x18000d + 0x1c00000000000000bab0c6000000000700000000010020 0x1a000e + 0x1d0000000000000000001b000000000f0000000000001e 0x1a0023 0x1a000d + 0x1e000000000000055415b2000000000800000000010020) (.bin (.leaf8 + 0x1f0000000000000000001d000000000f001f (h240 0x1000000001e00000000010000 + 0x100000000020000000001000000001f0000000004001c) 0x1f000f + 0x210000000000000000001f00000000100000000001001e 0x1e0023 0x1e000d + 0x220000000000000025568c000000000900000000010020 0x23000000000000000000200000000013001f) (.leaf8 + 0x100000000210023 0x240000000000000110d123000000000a00000000000020 0xa000e + 0x270000000000000000002500000000150000000000001e 0x240023 0x24000d + 0x28000000000000000777b4000000000b00000000010020 0x29000000000000000000020000000017001f))) (.bin + (.leaf8 0x100000000030023 0x2b00000000000000369039000000000c00000000000020 0x2000e + 0x100000000000000000001000000002a0000000002001c 0x2a000f + 0x2f0000000000000000002a00000000190000000001001e 0x290023 0x29000d) (.bin (.leaf8 + 0x3000000000000000017e55000000000d00000000010020 0x310000000000000000002c0000000007001f (h240 + 0x1000000002d00000000010000 0x100000000020000000001000000002e0000000004001c) 0x2e000f + 0x330000000000000000002e000000001a0000000001001e 0x2d0023 0x2d000d + 0x34000000000000000ae9a3000000000e00000000010020) (.leaf8 0x350000000000000000002f000000001d001f + 0x100000000300023 0x3600000000000000004c76000000000f00000000000020 0x32000e (h240 0x10000 + 0x10000000002000000000100000000340000000003001c) 0x34000f + 0x3a00000000000000000034000000001e0000000001001e 0x330023))))) (.bin (.bin (.bin (.leaf8 0x33000d + 0x3b00000000000000022eb8000000001000000000010020 0x3c000000000000000000350000000021001f + 0x100000000360023 0x3d00000000000000000f4a000000001100000000000020 + 0x3f000000000000000000020000000023001f 0x100000000030023 + 0x4100000000000000006fbd000000001200000000000020) (.bin (.leaf8 + 0x430000000000000000003b0000000000001f 0x3a0023 0x3a000d 0x43000000000000000000020000000025001f + 0x100000000030023 0x450000000000000000030d000000001300000000000020 + 0x470000000000000000003e0000000000001f 0x3d0023) (.leaf8 0x3d000d + 0x47000000000000000000020000000027001f 0x100000000030023 + 0x4900000000000000001657000000001400000000000020 0x4b000000000000000000410000000001001f (h240 + 0x1000000004200000000010000 0x10000000005000000000100000000430000000004001c) 0x43000f + 0x4d0000000000000000004300000000280000000001001e))) (.bin (.leaf8 0x420023 0x42000d + 0x4e0000000000000000009a000000001500000000010020 0x4f000000000000000000440000000000001f 0x430023 + 0x43000d 0x4f00000000000000000002000000002b001f 0x100000000030023) (.bin (.leaf8 + 0x5100000000000000000476000000001600000000000020 0x53000000000000000000470000000000001f 0x460023 + 0x46000d 0x5300000000000000000002000000002c001f 0x100000000020023 + 0x550000000000000000001e000000001700000000000020 0x570000000000000000004c0000000030001f) (.leaf8 + 0x4b0023 0x4b000d 0x58000000000000000000e3000000001800000000010020 + 0x59000000000000000000080000000031001f 0x100000000090023 + 0x5b00000000000000000005000000001900000000000020 0x2000e + 0x10000000000000000000100000000010000000002001c)))) (.bin (.bin (.leaf8 0x1000f + 0x5f0000000000000000000100000000320000000001001e 0x100000000020023 + 0x610000000000000000002c000000001a00000000000020 0x63000000000000000000540000000036001f 0x530023 + 0x53000d 0x55000e) (.bin (.leaf8 0x650000000000000000000200000000360000000000001e + 0x100000000030023 0x6700000000000000000007000000001c00000000000020 + 0x69000000000000000000590000000000001f 0x580023 0x58000d 0x69000000000000000000020000000038001f + (h240 0x10000 0x200000000020000000000000000000100000000010000000003001c)) (.leaf8 0x1000f + 0x6b00000000000000000001000000003a0000000001001e 0x100000000020023 + 0x6d00000000000000000000000000001e00000000000020 0x5e000e (h240 0x10000 + 0x400000000010000000002000000000100000000010000000003001c) 0x1000f + 0x7000000000000000000001000000003e0000000001001e))) (.bin (.bin (.leaf8 0x20000000001000b + 0x5f00000000020016 0x5d0016 0x16 0x20014 0x2000e 0x10000000000000000000100000000010000000002001c + 0x1000f) (.leaf8 0x30021 0x40000000058001a 0x570016 0x5600000000010016 0x5400000000530016 + 0x150000000052001a 0x5300000000520016 0x20014)) (.bin (.leaf8 + 0x300000000040000000000000000000200000000550000000000001f 0x550009 0x10021 0x2000000004f001a + 0x50000000004f0016 0x90014 0x520010 0x10021) (.leaf8 0x72000000004c001a 0x4b000000004b0016 + 0xe0000000049001a 0x4a00000000490016 0x14 0x4c0010 0x10021 0x4800000000000016))))))) (.bin (.bin + (.bin (.bin (.bin (.leaf8 0x23b0000000046001a 0x450016 0x4500000000010016 0x4d0000000043001a + 0x4400000000430016 0x30016 0xb2c0000000040001a 0x3f0016) (.bin (.leaf8 0x3f00000000010016 + 0x186000000003d001a 0x3e000000003d0016 0x30014 0x400010 0x10021 0x37df000000003a001a 0x390016) + (.leaf8 0x3900000000010016 0x7a40000000037001a 0x3800000000370016 0x360014 0x3a0010 0x10021 + 0x1175c0000000034001a 0x3500000000340016))) (.bin (.leaf8 0x16 0x263b0000000031001a + 0x3200000000310016 0x300014 0x340010 0x10021 0x574d2000000002e001a 0x2000000002d0016) (.bin + (.leaf8 0x2d0014 0x40010 0x10021 0xbf2b000000002b001a 0x290016 0x2a00000000010016 + 0x1b481c0000000028001a 0x270016) (.leaf8 0x2700000000010016 0x3bbda0000000025001a + 0xb00000000240016 0x8868910000000022001a 0x2300000000220016 0x210014 0x250010 0x10021)))) (.bin + (.bin (.leaf8 0x12ab46000000001f001a 0x20000000001f0016 0x16 0x2aa0ada000000001c001a + 0x1b000000001a0016 0x5d58630000000019001a 0x1a00000000190016 0x1800000000030016) (.bin (.leaf8 + 0xd5236430000000016001a 0x1700000000160016 0x14 0x190010 0x10021 0x1500000000000016 + 0x1d2b9f20000000013001a 0x120016) (.leaf8 0x1200000000060016 0x429b0f570000000010001a + 0x1000000000100016 0xf00000000040016 0x91da1c0000000000d001a 0xe000000000d0016 + 0x14d074cb7000000000a001a 0x500000000090016))) (.bin (.leaf8 0x90014 0x70010 0x10021 + 0x2d9428cc0000000007001a 0x800000000070016 0x14 0xa0010 0x10021) (.bin (.leaf8 0x600000000030016 + 0x681247f7e0000000004001a 0x500000000040016 0xe3e4cbff0000000001001a 0x3001d + 0x10000000001000000000100e3e4cbfe000000000000000000000020 + 0x20000000005000000000100000000070000000002001f 0x60023) (.leaf8 0x6000d + 0x2000000000600000000010681247f7d000000000100000000010020 + 0x20000000007000000000100000000080000000001001f (h240 0x1000000000900000000010000 + 0x100000000020000000001000000000a0000000004001c) 0xa000f + 0x200000000090000000001000000000a00000000020000000001001e 0x90023 0x9000d))))) (.bin (.bin (.bin + (.leaf8 0x2000000000a0000000001002d9428cb000000000200000000010020 0xb000e + 0x2000000000b0000000001000000000700000000040000000000001e 0x100000000080023 + 0x2000000000d0000000001014d074cb6000000000300000000000020 + 0x2000000000f000000000100000000100000000008001f 0xf0023 0xf000d) (.bin (.leaf8 + 0x20000000010000000000100091da1bf000000000400000000010020 + 0x20000000011000000000100000000110000000002001f 0x100023 0x10000d + 0x2000000001100000000010000000012000000000a001f 0x110023 0x11000d + 0x2000000001200000000010029eeb153000000000500000000010020) (.leaf8 + 0x20000000013000000000100000000140000000004001f 0x140009 0x140021 0x17 0x1d 0x103c3 (h240 (h240 + (h240 (h240 (h240 (h240 0x2085b67dfc00000000030000000001000000000200000000020000 + 0x1000000000500e3e4cbfe000000000600000000010000) + 0x80681247f7f00000000090000000001000000000000000000010000) + 0x20000000001000000000b002d9428cd000000000c00000000010000) + 0x8000000000100000000000000000001000000000e014d074cb60000) + 0xf0000000001000000001100091da1c1000000001200000000010000) + 0x130029eeb1540000000015000000000100000000140000000014001c) 0x14000f))) (.bin (.leaf8 (h240 + 0x20000000000000000000100000000010000 0x200000000130000000000000000001400000000030000000001001e) + 0x130023 0x13000d 0x1500000000000018ac5e01000000000500000000010020 + 0x15000000000000000000140000000003001f (h240 0x10000 + 0x1500000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1600000000000000000001000000000a0000000001001e) (.bin (.leaf8 0x100000000020023 + 0x1800000000000001d2b9f1000000000600000000000020 0x17000e (h240 0x10000 + 0x10000000002000000000100000000190000000003001c) 0x19000f + 0x1c00000000000000000019000000000c0000000001001e 0x180023 0x18000d) (.leaf8 + 0x1d0000000000000d523642000000000700000000010020 0x1e0000000000000000001a0000000001001f (h240 + 0x10000 0x1b000000000100000000000000000001000000001b0000000003001c) 0x1b000f + 0x1f0000000000000000001b000000000f0000000001001e 0x1a0023 0x1a000d + 0x20000000000000005d5862000000000800000000010020)))) (.bin (.bin (.leaf8 + 0x210000000000000000001d0000000010001f 0x1000000001d0023 + 0x2300000000000002aa0ad9000000000900000000000020 0x2000e + 0x10000000000000000000100000000210000000002001c 0x21000f + 0x270000000000000000002100000000130000000001001e 0x200023) (.bin (.leaf8 0x20000d + 0x280000000000000012ab45000000000a00000000010020 0x23000e + 0x290000000000000000002500000000150000000000001e 0x240023 0x24000d + 0x2a00000000000000886890000000000b00000000010020 0x2b0000000000000000000d0000000017001f) (.leaf8 + 0x1000000000e0023 0x2d0000000000000003bbd9000000000c00000000000020 + 0x2f000000000000000000290000000000001f 0x280023 0x28000d 0x2f000000000000000000020000000019001f + 0x100000000030023 0x31000000000000001b481b000000000d00000000000020))) (.bin (.bin (.leaf8 + 0x330000000000000000002c0000000000001f 0x2b0023 0x2b000d 0x3300000000000000000002000000001a001f + 0x100000000020023 0x350000000000000000bf2a000000000e00000000000020 0x2f000e + 0x3700000000000000000004000000001c0000000000001e) (.leaf8 0x100000000050023 + 0x39000000000000000574d1000000000f00000000000020 0x32000e + 0x3b00000000000000000034000000001f0000000000001e 0x330023 0x33000d + 0x3c0000000000000000263a000000001000000000010020 0x2000e)) (.bin (.leaf8 + 0x10000000000000000000100000000360000000002001c 0x36000f + 0x3f0000000000000000003600000000210000000001001e 0x350023 0x35000d + 0x400000000000000001175b000000001100000000010020 0x38000e + 0x410000000000000000003a00000000230000000000001e) (.leaf8 0x390023 0x39000d + 0x42000000000000000007a3000000001200000000010020 0x430000000000000000003b0000000000001f 0x3a0023 + 0x3a000d 0x43000000000000000000020000000025001f 0x100000000030023)))))) (.bin (.bin (.bin (.bin + (.leaf8 0x45000000000000000037de000000001300000000000020 0x5000e + 0x480000000000000000004000000000270000000000001e 0x3f0023 0x3f000d + 0x4900000000000000000185000000001400000000010020 0x4a000000000000000000410000000000001f 0x400023) + (.bin (.leaf8 0x40000d 0x4a000000000000000000020000000029001f 0x100000000030023 + 0x4c00000000000000000b2b000000001500000000000020 0x4e000000000000000000020000000001001f (h240 + 0x10000 0x300000000010000000000000000000100000000450000000003001c) 0x45000f + 0x5000000000000000000045000000002b0000000001001e) (.leaf8 0x440023 0x44000d + 0x510000000000000000004c000000001600000000010020 0x52000000000000000000470000000000001f 0x460023 + 0x46000d 0x5200000000000000000002000000002d001f 0x100000000030023))) (.bin (.leaf8 + 0x540000000000000000023a000000001700000000000020 0x4a000e (h240 0x10000 + 0x100000000020000000001000000004c0000000003001c) 0x4c000f + 0x580000000000000000004c000000002e0000000001001e 0x4b0023 0x4b000d + 0x590000000000000000000d000000001800000000010020) (.bin (.leaf8 + 0x5a0000000000000000004d0000000031001f 0x1000000004e0023 + 0x5b00000000000000000071000000001900000000000020 0xb000e + 0x5e0000000000000000005200000000330000000000001e 0x510023 0x51000d + 0x5f00000000000000000001000000001a00000000010020) (.leaf8 0x5000e + 0x10000000005000000000100000000550000000002001c 0x55000f + 0x620000000000000000005500000000330000000001001e 0x540023 0x54000d + 0x6300000000000000000014000000001b00000000010020 0x64000000000000000000560000000036001f)))) (.bin + (.bin (.leaf8 (h240 0x10000 0x5600000000020000000000000000000100000000570000000003001c) 0x57000f + 0x660000000000001d 0x560023 0x56000d 0x67000000000000000000020000000039001f 0x100000000030023 + 0x6900000000000000000003000000001d00000000000020) (.bin (.leaf8 0x4000e (h240 0x10000 + 0x300000000010000000000000000000100000000010000000003001c) 0x1000f + 0x6e00000000000000000001000000003b0000000001001e (h240 0x10000 + 0x200000000010000000000000000000100000000600000000003001c) 0x60000f 0x700000000000001d (h240 + 0x10000 0x6000000000020000000000000000000100000000030000000003001c)) (.leaf8 0x20186 0x10043 + 0x30142 0x101c3 0x40023 0xc00c6 0x10043 0x10303))) (.bin (.leaf8 0x10009 0x8 (h240 0x600000 + 0x100000000000000000002000000000100000000000000000000001e) (h240 0x20000 + 0x6200000000010000000002000000000100000000000000000000001e) 0x1000a 0x20008 0x10009 0x10021) (.bin + (.leaf8 0x400000000610016 0x10019 0x6d0000000000001d 0x3000f 0x6c0000000000001d 0x20023 0x2000d + 0x6d000000000000000000060000000040001f) (.leaf8 0x50023 0x5000d 0x3000e 0x40000000001000b + 0x400000000050016 0x5d00000000030016 0x1000000005b001a 0x5a0016))))) (.bin (.bin (.bin (.leaf8 + 0x5800000000010016 0x14 0x5a0010 0x10021 0x5700000000540016 0xa0000000055001a 0x500000000540016 + 0x5400000000040016) (.bin (.leaf8 0x5300000000520016 0x51000000000a0016 0x38000000004f001a + 0x4e0016 0x7000000004c001a 0x4d000000004c0016 0x16 0x11d0000000049001a) (.leaf8 0x4a00000000490016 + 0x30014 0x4c0010 0x10021 0x270000000046001a 0x440016 0x4500000000010016 0x5950000000043001a))) + (.bin (.leaf8 0x420016 0x4200000000010016 0xc30000000040001a 0x6000000003f0016 + 0x1bef000000003d001a 0x3c0016 0x3c00000000010016 0x3d2000000003a001a) (.bin (.leaf8 + 0x3900000000390016 0x8bae0000000037001a 0x350016 0x3600000000010016 0x131d0000000034001a + 0x3300000000330016 0x2ba680000000031001a 0x3200000000310016) (.leaf8 0x50014 0x340010 0x10021 + 0x5f95000000002e001a 0x2f000000002e0016 0x14 0x310010 0x10021)))) (.bin (.bin (.leaf8 + 0x2d00000000000016 0xda40d000000002b001a 0x2c000000002b0016 0x30014 0x2e0010 0x10021 + 0x1dded0000000028001a 0x270016) (.bin (.leaf8 0x27000000000c0016 0x4434480000000025001a + 0x2400000000240016 0x955a30000000022001a 0x200016 0x2100000000010016 0x155056c000000001f001a + 0x1e0016) (.leaf8 0x1d0014 0x20010 0x10021 0x2eac31000000001c001a 0x1c000000001c0016 0x1b0014 + 0x1e0010 0x10021))) (.bin (.bin (.leaf8 0x6a91b210000000019001a 0x1a00000000190016 0x16 + 0xe95cf90000000016001a 0x150016 0x16 0x214d87ac0000000013001a 0x1200000000110016) (.leaf8 + 0x48ed0e00000000010001a 0xf000000000f0016 0xa683a65a000000000d001a 0xe000000000d0016 0x80014 + 0x100010 0x10021 0x16ca1466000000000a001a)) (.bin (.leaf8 0xb000000000a0016 0x16 + 0x340923fbf0000000007001a 0x800000000070016 0x71f265ff0000000004001a 0x30016 0x20014 0x20010) + (.leaf8 0x10021 0x1042db3efe0000000001001a 0x3001d + 0x1000000000100000000010239bbfd89000000000000000000000020 0x50010 0x60021 0x17 0x1d))))))))) (.bin + (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x103c3 (h240 (h240 0x239bbfd8a0000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x50239bbfd890000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x2000000000500000000000e091f4172000000000000000000010020) + 0x4000e 0x80000000000000000000200000000000000000000001e 0x100000000030023 + 0xa00000000000071f265fe000000000100000000000020) (.bin (.leaf8 + 0xc0000000000000000000a0000000004001f 0x90023 0x9000d + 0xd00000000000340923fbe000000000200000000010020 0x2000e + 0x100000000000000000001000000000c0000000002001c 0xc000f + 0x100000000000000000000c00000000050000000001001e) (.leaf8 0xb0023 0xb000d + 0x1100000000000016ca1465000000000300000000010020 0xa000e + 0x130000000000000000001000000000070000000000001e 0xf0023 0xf000d + 0x14000000000000a683a659000000000400000000010020))) (.bin (.leaf8 + 0x15000000000000000000110000000009001f 0x100000000120023 + 0x16000000000000048ed0df000000000500000000000020 0x1800000000000000000014000000000a001f + 0x100000000140023 0x1a000000000000214d87ab000000000600000000000020 0x2000e + 0x10000000000000000000100000000010000000002001c) (.bin (.leaf8 0x1000f + 0x1e00000000000000000001000000000c0000000001001e 0x100000000020023 + 0x2000000000000000e95cf8000000000700000000000020 0x2000e + 0x100000000000000000001000000001b0000000002001c 0x1b000f + 0x240000000000000000001b000000000f0000000001001e) (.leaf8 0x1a0023 0x1a000d + 0x2500000000000006a91b20000000000800000000010020 0x1d000e + 0x260000000000000000001e00000000110000000000001e 0x1d0023 0x1d000d + 0x27000000000000002eac30000000000900000000010020)))) (.bin (.bin (.leaf8 0x1f000e + 0x290000000000000000000200000000120000000000001e 0x100000000030023 + 0x2b0000000000000155056b000000000a00000000000020 0x2d000000000000000000230000000000001f 0x220023 + 0x22000d 0x2d000000000000000000020000000014001f) (.bin (.leaf8 0x100000000020023 + 0x2f000000000000000955a2000000000b00000000000020 0x31000000000000000000260000000017001f + 0x100000000270023 0x3200000000000000443447000000000c00000000000020 + 0x34000000000000000000290000000007001f (h240 0x10000 + 0x2a00000000010000000000000000000100000000010000000003001c) 0x1000f) (.leaf8 + 0x350000000000000000000100000000180000000001001e 0x100000000020023 + 0x370000000000000001ddec000000000d00000000000020 0x5000e + 0x3a0000000000000000002e000000001b0000000000001e 0x2d0023 0x2d000d + 0x3b000000000000000da40c000000000e00000000010020))) (.bin (.leaf8 0x2f000e (h240 0x10000 + 0x10000000002000000000100000000310000000003001c) 0x31000f + 0x3e00000000000000000031000000001c0000000001001e 0x300023 0x30000d + 0x3f00000000000000005f94000000000f00000000010020 0x7000e) (.bin (.leaf8 + 0x4100000000000000000034000000001f0000000000001e 0x330023 0x33000d + 0x420000000000000002ba67000000001000000000010020 0x43000000000000000000350000000021001f + 0x100000000360023 0x440000000000000000131c000000001100000000000020 + 0x46000000000000000000380000000000001f) (.leaf8 0x370023 0x37000d + 0x46000000000000000000020000000022001f 0x100000000020023 + 0x4800000000000000008bad000000001200000000000020 0x4a0000000000000000003b0000000025001f + 0x1000000003c0023 0x4b000000000000000003d1000000001300000000000020))))) (.bin (.bin (.bin (.leaf8 + 0x4d0000000000000000003e0000000000001f 0x3d0023 0x3d000d 0x4d000000000000000000020000000027001f + 0x100000000030023 0x4f00000000000000001bee000000001400000000000020 + 0x51000000000000000000080000000029001f 0x100000000090023) (.bin (.leaf8 + 0x53000000000000000000c2000000001500000000000020 0x55000000000000000000440000000000001f 0x430023 + 0x43000d 0x5500000000000000000002000000002b001f 0x100000000030023 + 0x5700000000000000000594000000001600000000000020 0x59000000000000000000470000000000001f) (.leaf8 + 0x460023 0x46000d 0x5900000000000000000002000000002c001f 0x100000000020023 + 0x5b00000000000000000026000000001700000000000020 0x5000e + 0x5e0000000000000000004c000000002f0000000000001e 0x4b0023))) (.bin (.leaf8 0x4b000d + 0x5f0000000000000000011c000000001800000000010020 0x2000e + 0x100000000000000000001000000004e0000000002001c 0x4e000f + 0x620000000000000000004e00000000310000000001001e 0x4d0023 0x4d000d) (.bin (.leaf8 + 0x6300000000000000000006000000001900000000010020 0x64000000000000000000020000000033001f + 0x100000000030023 0x6600000000000000000037000000001a00000000000020 + 0x68000000000000000000530000000006001f 0x520023 0x52000d 0x68000000000000000000550000000036001f) + (.leaf8 0x540023 0x54000d 0x69000000000000000000560000000002001f 0x550023 0x55000d + 0x6a000000000000000000070000000037001f 0x100000000080023 + 0x6c00000000000000000009000000001c00000000000020)))) (.bin (.bin (.leaf8 + 0x6e000000000000000000590000000037001f (h240 0x1000000005a00000000010000 + 0x10000000002000000000100000000590000000004001c) 0x59000d 0x7100000000000000000002000000003b001f + 0x100000000030023 0x7300000000000000000000000000001e00000000000020 + 0x740000000000000000005f0000000001001f (h240 0x10000 + 0x6000000000010000000000000000000100000000050000000003001c)) (.bin (.leaf8 0x5000f + 0x760000000000000000000500000000010000000001001e (h240 0x10000 + 0x500000000020000000000000000000100000000050000000003001c) 0x20186 0x10043 0x50142 0x101c3 + 0x60023) (.leaf8 0x1000c6 0x10043 0x10303 0x10009 0x8 (h240 0x50000 + 0x100000000000000000002000000000100000000000000000000001e) (h240 0x600000 + 0x700000000010000000002000000000100000000000000000000001e) 0x10009))) (.bin (.bin (.leaf8 0x30021 + 0x5d0016 0x5b00000000010016 0x16 0x50000000058001a 0x570016 0x5700000000060016 0x5400000000540016) + (.leaf8 0x1b0000000052001a 0x5300000000520016 0x30014 0x550010 0x10021 0x3000000004f001a + 0x4f000000004f0016 0x30014)) (.bin (.leaf8 0x510010 0x10021 0x8e000000004c001a 0x4d000000004c0016 + 0x4b00000000040016 0x120000000049001a 0x4a00000000490016 0x14) (.leaf8 0x4c0010 0x10021 + 0x4800000000000016 0x2ca0000000046001a 0x450016 0x4500000000010016 0x610000000043001a + 0x420016)))))) (.bin (.bin (.bin (.bin (.leaf8 0x4200000000070016 0xdf60000000040001a + 0x4100000000400016 0x30014 0x430010 0x10021 0x1e9000000003d001a 0x3c0016) (.bin (.leaf8 + 0x45d7000000003a001a 0x390016 0x20014 0x20010 0x10021 0x98e0000000037001a 0x3800000000370016 + 0x360014) (.leaf8 0x3a0010 0x10021 0x15d340000000034001a 0x800000000330016 0x2fca0000000031001a + 0x3200000000310016 0x16 0x6d207000000002e001a))) (.bin (.leaf8 0x6000000002d0016 + 0xeef6000000002b001a 0x2a0016 0x16 0x221a240000000028001a 0x270016 0x4aad10000000025001a + 0x2600000000250016) (.bin (.leaf8 0x14 0x280010 0x10021 0x2400000000000016 0xaa82b50000000022001a + 0x2300000000220016 0x30014 0x250010) (.leaf8 0x10021 0x21000000001e0016 0x175618000000001f001a + 0x1e000000001d0016 0x3548d90000000001c001a 0x1c000000001c0016 0x30014 0x1e0010)))) (.bin (.bin + (.leaf8 0x10021 0x74ae7c0000000019001a 0x180016 0x16 0x1800000000010016 0x10a6c3d50000000016001a + 0x150016 0x140014) (.bin (.leaf8 0x20010 0x10021 0x247686f0000000013001a 0x1400000000130016 + 0x120014 0x160010 0x10021 0x5341d32d0000000010001a) (.leaf8 0xb000000000f0016 + 0xb650a33000000000d001a 0xb0016 0xc00000000010016 0x1a0491fdf000000000a001a 0x900000000090016 + 0x38f932fe0000000007001a 0x800000000070016))) (.bin (.leaf8 0x30014 0xa0010 0x10021 + 0x600000000030016 0x8216d9f7e0000000004001a 0x30016 0x20014 0x20010) (.bin (.leaf8 0x10021 + 0x11cddfec50000000001001a 0x3001d 0x100000000010000000001011cddfec4000000000000000000000020 + 0x4000e 0x200000000060000000001000000000200000000000000000000001e 0x100000000030023 + 0x20000000008000000000108216d9f7d000000000100000000000020) (.leaf8 + 0x2000000000a000000000100000000080000000001001f (h240 0x1000000000900000000010000 + 0x100000000050000000001000000000a0000000004001c) 0xa000f + 0x2000000000c0000000001000000000a00000000020000000001001e 0x90023 0x9000d + 0x2000000000d00000000010038f932fd000000000200000000010020 + 0x2000000000e0000000001000000000b0000000005001f))))) (.bin (.bin (.bin (.leaf8 0x1000000000c0023 + 0x2000000000f000000000101a0491fde000000000300000000000020 + 0x200000000110000000001000000000e0000000000001f 0xd0023 0xd000d + 0x20000000011000000000100000000020000000006001f 0x100000000020023 + 0x200000000130000000001000b650a32000000000400000000000020) (.bin (.leaf8 + 0x200000000150000000001000000000d0000000009001f 0x1000000000e0023 + 0x20000000017000000000100346a5daa000000000500000000000020 + 0x20000000019000000000100000000140000000001001f 0x140009 0x1a0021 0x17 0x1d) (.leaf8 0x103c3 (h240 + (h240 (h240 (h240 (h240 (h240 (h240 (h240 0x28a7241d9300000000030000000001000000000200000000020000 + 0x10000000005011cddfec4000000000600000000010000) + 0x5000000000100000000030000000001000000000000000000010000) + 0x808216d9f7e00000000090000000001000000000000000000010000) + 0x50000000001000000000b0038f932ff000000000c00000000010000) + 0x1000000000e01a0491fdf000000000f00000000010000) + 0x20000000002000000000000000000010000000011000b650a320000) + 0x120000000001000000000e0000000001000000000000000000010000) + 0x1400346a5daa000000001500000000010000000014000000001a001c) 0x14000f (h240 + 0x20000000000000000000100000000010000 0x200000000190000000000000000001400000000060000000001001e) + 0x130023 0x13000d 0x1b0000000000001ed77580000000000500000000010020 0x14000e))) (.bin (.leaf8 + 0x1b00000000000000000016000000000b0000000000001e 0x150023 0x15000d + 0x1c0000000000000247686e000000000600000000010020 0x16000e + 0x1e00000000000000000002000000000c0000000000001e 0x100000000030023 + 0x2000000000000010a6c3d4000000000700000000000020) (.bin (.leaf8 + 0x220000000000000000001a0000000000001f 0x190023 0x19000d 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x2400000000000000000001000000000e0000000001001e 0x100000000020023) (.leaf8 + 0x260000000000000074ae7b000000000800000000000020 0x5000e + 0x290000000000000000001e00000000110000000000001e 0x1d0023 0x1d000d + 0x2a00000000000003548d8f000000000900000000010020 0x2b000000000000000000200000000012001f + 0x100000000200023)))) (.bin (.bin (.leaf8 0x2d00000000000000175617000000000a00000000000020 + 0x2f000000000000000000230000000013001f (h240 0x1000000002400000000010000 + 0x10000000005000000000100000000250000000004001c) 0x25000f + 0x310000000000000000002500000000140000000001001e 0x240023 0x24000d + 0x3200000000000000aa82b4000000000b00000000010020) (.bin (.leaf8 0x26000e (h240 0x10000 + 0x10000000002000000000100000000280000000003001c) 0x28000f + 0x350000000000000000002800000000160000000001001e 0x270023 0x27000d + 0x360000000000000004aad0000000000c00000000010020 0x37000000000000000000020000000019001f) (.leaf8 + 0x100000000030023 0x3900000000000000221a23000000000d00000000000020 0x2000e + 0x10000000000000000000100000000010000000002001c 0x1000f + 0x3d00000000000000000001000000001a0000000001001e 0x100000000020023 + 0x3f0000000000000000eef5000000000e00000000000020))) (.bin (.bin (.leaf8 + 0x4100000000000000000008000000001d001f 0x100000000090023 + 0x430000000000000006d206000000000f00000000000020 0x2000e + 0x10000000000000000000100000000330000000002001c 0x33000f + 0x4700000000000000000033000000001f0000000001001e 0x320023) (.leaf8 0x32000d + 0x4800000000000000002fc9000000001000000000010020 0x490000000000000000000a0000000021001f + 0x1000000000b0023 0x4b00000000000000015d33000000001100000000000020 0x38000e + 0x4d0000000000000000003a00000000230000000000001e 0x390023)) (.bin (.leaf8 0x39000d + 0x4e0000000000000000098d000000001200000000010020 0x4000e + 0x500000000000000000000200000000240000000000001e 0x100000000030023 + 0x52000000000000000045d6000000001300000000000020 0x54000000000000000000020000000027001f + 0x100000000030023) (.leaf8 0x56000000000000000001e8000000001400000000000020 0x5000e + 0x590000000000000000004300000000290000000000001e 0x420023 0x42000d + 0x5a00000000000000000df5000000001500000000010020 0x5b000000000000000000440000000004001f + 0x430023))))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 0x43000d + 0x5b00000000000000000002000000002b001f 0x100000000030023 + 0x5d00000000000000000060000000001600000000000020 0x5f000000000000000000470000000000001f 0x460023 + 0x46000d 0x5f00000000000000000002000000002d001f) (.bin (.leaf8 0x100000000030023 + 0x61000000000000000002c9000000001700000000000020 0x4a000e (h240 0x10000 + 0x100000000020000000001000000004c0000000003001c) 0x4c000f + 0x650000000000000000004c000000002e0000000001001e 0x4b0023 0x4b000d) (.leaf8 + 0x6600000000000000000011000000001800000000010020 0x670000000000000000004d0000000002001f 0x4c0023 + 0x4c000d 0x670000000000000000004f0000000032001f 0x4e0023 0x4e000d + 0x680000000000000000008d000000001900000000010020))) (.bin (.leaf8 0x5000e + 0x6a0000000000000000005100000000330000000000001e 0x500023 0x50000d + 0x6b00000000000000000002000000001a00000000010020 0x5000e + 0x6d0000000000000000005500000000350000000000001e 0x540023) (.bin (.leaf8 0x54000d + 0x6e0000000000000000001a000000001b00000000010020 0x6f000000000000000000560000000037001f (h240 + 0x10000 0x5700000000010000000000000000000100000000580000000003001c) 0x58000f + 0x700000000000000000005800000000020000000001001e (h240 0x10000 + 0x5900000000010000000000000000000100000000010000000003001c) 0x1000f) (.leaf8 + 0x720000000000000000000100000000380000000001001e 0x100000000020023 + 0x7400000000000000000004000000001d00000000000020 0x2000e + 0x100000000000000000001000000005c0000000002001c 0x5c000f 0x780000000000001d 0x5b0023)))) (.bin + (.bin (.leaf8 0x5b000d 0x7900000000000000000002000000003d001f (h240 (h240 0x10000 + 0x3000000000100000000000000000001000000006200000000010000) + 0x800000000010000000002000000000100000000010000000006001c) 0x1000f 0x7e0000000000001d + 0x20000000000000b 0x6200000000060016 0x30014) (.bin (.leaf8 0x640010 0x10021 0x5b0016 + 0x5d00000000010016 0x1000000005b001a 0x5c000000005b0016 0x20014 + 0x59000000000400000000000000000002000000005e0000000000001f) (.leaf8 (h240 0x570000 + 0x5b00000000010000000002000000005e00000000000000000000001e) 0x5e0009 0x30021 0xd0000000055001a + 0x5600000000550016 0x5400000000040016 0x10000000052001a 0x600000000500016))) (.bin (.leaf8 + 0x47000000004f001a 0x4e000000004e0016 0x9000000004c001a 0x2000000004b0016 0x4b0014 0x40010 0x10021 + 0x1640000000049001a) (.bin (.leaf8 0x4a00000000490016 0x30014 0x4c0010 0x10021 0x300000000046001a + 0x4700000000460016 0x30014 0x490010) (.leaf8 0x10021 0x6fb0000000043001a 0x4400000000430016 + 0x4200000000040016 0xf30000000040001a 0x4100000000400016 0x30014 0x430010))))) (.bin (.bin (.bin + (.leaf8 0x10021 0x22eb000000003d001a 0x3c0016 0x500000000010016 0x4c7000000003a001a + 0x3900000000390016 0xae990000000037001a 0x3800000000370016) (.bin (.leaf8 0xb0014 0x3a0010 0x10021 + 0x17e50000000034001a 0x320016 0x3300000000010016 0x369020000000031001a 0x3200000000310016) (.leaf8 + 0x90014 0x340010 0x10021 0x777a000000002e001a 0x2f000000002e0016 0x20014 + 0x300000000040000000000000000000200000000310000000000001f 0x310009))) (.bin (.leaf8 0x10021 + 0x110d11000000002b001a 0x2c000000002b0016 0x30014 0x2e0010 0x10021 0x255680000000028001a + 0x2900000000280016) (.bin (.leaf8 0x16 0x55415b0000000025001a 0x500000000240016 0x240014 0x70010 + 0x10021 0xbab0b0000000022001a 0x2300000000220016) (.leaf8 0x14 0x250010 0x10021 0x21000000001e0016 + 0x1aa46c7000000001f001a 0x1f000000001f0016 0x1e00000000040016 0x3a573d000000001c001a)))) (.bin + (.bin (.leaf8 0x1b0016 0x16 0x1b00000000010016 0x85361ea0000000019001a 0x180016 0x1700000000010016 + 0x123b4370000000016001a 0x1700000000160016) (.bin (.leaf8 0x29a0e9960000000013001a + 0x1400000000130016 0xe0014 0x160010 0x10021 0x5b285190000000010001a 0xf0016 0x20014) (.leaf8 + 0x20010 0x10021 0xd0248fef000000000d001a 0xe000000000d0016 0xc0014 0x100010 0x10021 + 0x1c7c997f000000000a001a))) (.bin (.bin (.leaf8 0x500000000090016 0x90014 0x70010 0x10021 + 0x410b6cfbe0000000007001a 0x800000000070016 0x30014 0xa0010) (.leaf8 0x10021 0x600000000030016 + 0x8e6eff610000000004001a 0x500000000040016 0x14 0x70010 0x10021 0x300000000000016)) (.bin (.leaf8 + 0x1453920ec90000000001001a 0x3001d 0x10000000001000000000102c82afcee000000000000000000000020 + 0x50010 0x60021 0x17 0x1d 0x103c3) (.leaf8 (h240 (h240 0x2c82afcef0000 + 0x3000000000100000000020000000002000000000000000000010000) + 0x502c82afcee0000000006000000000100000000040000000006001c) 0x4000d (h240 + 0x20000000000000000000100000000010000 0x200000000050000000000118b6711d8000000000000000000010020) + 0x5000e (h240 0x10000 0x10000000002000000000100000000070000000003001c) 0x7000f + 0x90000000000000000000700000000000000000001001e 0x60023)))))) (.bin (.bin (.bin (.bin (.leaf8 + 0x6000d 0xa0000000000008e6eff60000000000100000000010020 0xb000000000000000000080000000001001f + (h240 0x1000000000900000000010000 0x100000000050000000001000000000a0000000004001c) 0xa000f + 0xd0000000000000000000a00000000020000000001001e 0x90023 0x9000d) (.bin (.leaf8 + 0xe00000000000410b6cfbd000000000200000000010020 0xb000e + 0xf0000000000000000000700000000040000000000001e 0x100000000080023 + 0x110000000000001c7c997e000000000300000000000020 0xe000e + 0x130000000000000000001000000000070000000000001e 0xf0023) (.leaf8 0xf000d + 0x14000000000000d0248fee000000000400000000010020 0x4000e + 0x160000000000000000000200000000080000000000001e 0x100000000030023 + 0x1800000000000005b28518000000000500000000000020 0x10000e + 0x1b00000000000000000016000000000b0000000000001e))) (.bin (.leaf8 0x150023 0x15000d + 0x1c00000000000029a0e995000000000600000000010020 0x1d00000000000000000019000000000e001f 0x180023 + 0x18000d 0x1e0000000000000123b436000000000700000000010020 0x1f000000000000000000190000000000001f) + (.bin (.leaf8 0x180023 0x18000d 0x2000000000000000000002000000000f001f 0x100000000030023 + 0x22000000000000085361e9000000000800000000000020 0x240000000000000000001d0000000000001f 0x1c0023 + 0x1c000d) (.leaf8 0x2000e 0x10000000000000000000100000000010000000002001c 0x1000f + 0x260000000000000000000100000000100000000001001e 0x100000000020023 + 0x28000000000000003a573c000000000900000000000020 0x2a000000000000000000200000000002001f + 0x1f0023)))) (.bin (.bin (.leaf8 0x1f000d 0x2a000000000000000000210000000014001f 0x200023 0x20000d + 0x2b00000000000001aa46c6000000000a00000000010020 0x2c000000000000000000230000000013001f (h240 + 0x1000000002400000000010000 0x10000000002000000000100000000250000000004001c) 0x25000f) (.bin + (.leaf8 0x2e0000000000000000002500000000140000000001001e 0x240023 0x24000d + 0x2f000000000000000bab0a000000000b00000000010020 0x26000e + 0x300000000000000000000700000000160000000000001e 0x100000000080023 + 0x320000000000000055415a000000000c00000000000020) (.leaf8 0x2000e + 0x100000000000000000001000000002a0000000002001c 0x2a000f + 0x360000000000000000002a00000000190000000001001e 0x290023 0x29000d + 0x3700000000000000025567000000000d00000000010020 0x5000e))) (.bin (.leaf8 + 0x390000000000000000002e000000001b0000000000001e 0x2d0023 0x2d000d + 0x3a00000000000000110d10000000000e00000000010020 0x5000e + 0x10000000005000000000100000000310000000002001c 0x31000f + 0x3d00000000000000000031000000001b0000000001001e) (.bin (.leaf8 0x300023 0x30000d + 0x3e00000000000000007779000000000f00000000010020 0xb000e + 0x4000000000000000000034000000001f0000000000001e 0x330023 0x33000d + 0x4100000000000000036901000000001000000000010020) (.leaf8 0x42000000000000000000350000000000001f + 0x340023 0x34000d 0x42000000000000000000020000000020001f 0x100000000020023 + 0x44000000000000000017e4000000001100000000000020 0xd000e + 0x470000000000000000003a00000000230000000000001e))))) (.bin (.bin (.bin (.leaf8 0x390023 0x39000d + 0x480000000000000000ae98000000001200000000010020 0x490000000000000000003b0000000025001f + 0x1000000003c0023 0x4a000000000000000004c6000000001300000000000020 + 0x4c000000000000000000070000000000001f 0x60023) (.bin (.leaf8 0x6000d + 0x4d000000000000000000020000000027001f 0x100000000030023 + 0x4f000000000000000022ea000000001400000000000020 0x5000e + 0x520000000000000000004300000000290000000000001e 0x420023 0x42000d) (.leaf8 + 0x53000000000000000000f2000000001500000000010020 0x54000000000000000000440000000002001f 0x430023 + 0x43000d 0x5400000000000000000046000000002c001f 0x450023 0x45000d + 0x55000000000000000006fa000000001600000000010020))) (.bin (.leaf8 0x5000e + 0x5700000000000000000049000000002d0000000000001e 0x480023 0x48000d + 0x580000000000000000002f000000001700000000010020 0x5000e + 0x5a0000000000000000004c000000002f0000000000001e 0x4b0023) (.bin (.leaf8 0x4b000d + 0x5b00000000000000000163000000001800000000010020 0x4d000e + 0x5c0000000000000000000400000000300000000000001e 0x100000000050023 + 0x5e00000000000000000008000000001900000000000020 0x60000000000000000000500000000033001f + 0x100000000510023) (.leaf8 0x6100000000000000000046000000001a00000000000020 + 0x63000000000000000000080000000034001f 0x100000000080023 + 0x6500000000000000000000000000001b00000000000020 0x66000000000000000000560000000002001f 0x550023 + 0x55000d 0x67000000000000000000580000000038001f)))) (.bin (.bin (.leaf8 0x570023 0x57000d + 0x680000000000000000000c000000001c00000000010020 0x59000e (h240 0x10000 + 0x5c000000000100000000050000000001000000005e0000000003001c) 0x5e000f + 0x6b0000000000000000005e00000000380000000001001e 0x5d0023) (.bin (.leaf8 0x5d000d + 0x6c00000000000000000000000000001e00000000010020 0x6d0000000000000000005f0000000000001f 0x5e0023 + 0x5e000d 0x6d00000000000000000002000000003c001f 0x10023 0x1000d) (.leaf8 0x5000e + 0x6f0000000000000000006400000000020000000000001e (h240 0x10000 + 0x6500000000010000000000000000000100000000020000000003001c) 0x800c6 0x10043 0x10303 0x10009 + 0x600000000630016))) (.bin (.bin (.leaf8 0x6000000000010016 0x5f000000005e0016 0x5c00000000030016 + 0x70000000058001a 0x5700000000570016 0x540016 0x80014 0x20010) (.leaf8 0x10021 0x230000000052001a + 0x510016 0x4000000004f001a 0x50000000004f0016 0x50014 0x520010 0x10021)) (.bin (.leaf8 + 0xb2000000004c001a 0x4d000000004c0016 0x4b00000000040016 0x170000000049001a 0x4a00000000490016 + 0x4800000000040016 0x37d0000000046001a 0x4500000000450016) (.leaf8 0x790000000043001a + 0x4400000000430016 0x4200000000040016 0x11740000000040001a 0x4100000000400016 0x30014 0x430010 + 0x10021)))))))) (.bin (.bin (.bin (.bin (.bin (.bin (.leaf8 0x3f00000000060016 0x262000000003d001a + 0x3e000000003d0016 0x3c0014 0x400010 0x10021 0x574c000000003a001a 0x3b000000003a0016) (.bin + (.leaf8 0x39000000000c0016 0xbf10000000037001a 0x3800000000370016 0x14 0x3a0010 0x10021 + 0x3600000000000016 0x1b4810000000034001a) (.leaf8 0xc00000000330016 0x3bbd0000000031001a + 0x500000000300016 0x3000000000040016 0x88688000000002e001a 0x6000000002d0016 0x12ab4000000002b001a + 0x290016))) (.bin (.leaf8 0x2a00000000010016 0x2aa0ac0000000028001a 0x2900000000280016 0x80014 + 0x2b0010 0x10021 0x5d5860000000025001a 0x200000000240016) (.bin (.leaf8 0x240014 0x40010 0x10021 + 0xd523630000000022001a 0x2200000000220016 0x1d2b9e000000001f001a 0x20000000001f0016 0x20014) + (.leaf8 0x300000000040000000000000000000200000000220000000000001f 0x220009 0x10021 + 0x429b0f5000000001c001a 0x1b0016 0x1a00000000010016 0x91da1b0000000019001a 0x1a00000000190016)))) + (.bin (.bin (.leaf8 0x14d074cb0000000016001a 0x1100000000150016 0x2d9428c0000000013001a 0x120016 + 0x500000000010016 0x681247f70000000010001a 0x1100000000100016 0xe3e4cbf000000000d001a) (.bin + (.leaf8 0xe000000000d0016 0x80014 0x100010 0x10021 0x2085b67df000000000a001a 0xb000000000a0016 + 0x30016 0x47377fb10000000007001a) (.leaf8 0x200000000060016 0x60014 0x40010 0x10021 + 0xa29c907640000000004001a 0x30016 0x20014 0x20010))) (.bin (.leaf8 0x10021 + 0x164157e770000000001001a 0x100000000010016 0x14 0x20000000000000000000100000000030000000000001f + 0x20023 0x2000d 0x2000000000200000000010164157e76000000000000000000010020) (.bin (.leaf8 0x4000e + 0x200000000040000000001000000000200000000000000000000001e 0x100000000030023 + 0x2000000000600000000010a29c90763000000000100000000000020 0x8000e + 0x200000000080000000001000000000400000000020000000000001e 0x100000000050023 + 0x2000000000a00000000010047377fb0000000000200000000000020) (.leaf8 + 0x2000000000c000000000100000000020000000001001f (h240 0x10000 + 0x3000000000100000000000000000001000000000c0000000003001c) 0xc000f + 0x2000000000e0000000001000000000c00000000050000000001001e 0xb0023 0xb000d + 0x2000000000f000000000102085b67de000000000300000000010020 0xa000e))))) (.bin (.bin (.bin (.leaf8 + 0x200000000110000000001000000001000000000070000000000001e 0xf0023 0xf000d + 0x200000000120000000001000e3e4cbe000000000400000000010020 + 0x2000000001300000000010000000013000000000a001f 0x120023 0x12000d + 0x200000000140000000001004184f50b000000000500000000010020) (.bin (.leaf8 + 0x20000000015000000000100000000140000000002001f (h240 0x100000000000000 + 0x100000000160000000000000000001400000000070000000000001e) 0x130023 0x13000d + 0x17000000000000268d52e9000000000500000000010020 0x17000000000000000000070000000000001f 0x60023 + 0x6000d) (.leaf8 0x1800000000000000000002000000000b001f 0x100000000030023 + 0x1a00000000000002d9428b000000000600000000000020 0x1c00000000000000000013000000000d001f + 0x100000000140023 0x1e00000000000014d074ca000000000700000000000020 + 0x200000000000000000001c0000000010001f 0x1b0023))) (.bin (.leaf8 0x1b000d + 0x210000000000000091da1a000000000800000000010020 0x220000000000000000001c0000000000001f 0x1b0023 + 0x1b000d 0x23000000000000000000020000000011001f 0x100000000030023 + 0x250000000000000429b0f4000000000900000000000020) (.bin (.leaf8 0x5000e + 0x10000000005000000000100000000220000000002001c 0x22000f + 0x290000000000000000002200000000110000000001001e 0x210023 0x21000d + 0x2a000000000000001d2b9d000000000a00000000010020 0x2b000000000000000000240000000016001f) (.leaf8 + 0x230023 0x23000d 0x2c00000000000000d52362000000000b00000000010020 0x26000e + 0x2d0000000000000000000400000000160000000000001e 0x100000000050023 + 0x2f0000000000000005d585000000000c00000000000020 0xa000e)))) (.bin (.bin (.leaf8 + 0x320000000000000000002b00000000190000000000001e 0x2a0023 0x2a000d + 0x33000000000000002aa0ab000000000d00000000010020 0x340000000000000000002c0000000000001f 0x2b0023 + 0x2b000d 0x3400000000000000000002000000001a001f) (.bin (.leaf8 0x100000000020023 + 0x3600000000000000012ab3000000000e00000000000020 0x3800000000000000000008000000001d001f + 0x100000000090023 0x3a00000000000000088687000000000f00000000000020 + 0x3c000000000000000000320000000002001f 0x310023 0x31000d) (.leaf8 + 0x3c00000000000000000007000000001f001f 0x100000000080023 + 0x3e00000000000000003bbc000000001000000000000020 0x400000000000000000000e0000000021001f + 0x1000000000f0023 0x420000000000000001b480000000001100000000000020 0x38000e (h240 0x10000 + 0x100000000020000000001000000003a0000000003001c)))) (.bin (.bin (.leaf8 0x3a000f + 0x460000000000000000003a00000000220000000001001e 0x390023 0x39000d + 0x4700000000000000000bf0000000001200000000010020 0x480000000000000000003b0000000007001f (h240 + 0x10000 0x3c000000000100000000000000000001000000003c0000000003001c) 0x3c000f) (.leaf8 + 0x490000000000000000003c00000000250000000001001e 0x3b0023 0x3b000d + 0x4a0000000000000000574b000000001300000000010020 0x3e000e + 0x4b0000000000000000004000000000270000000000001e 0x3f0023 0x3f000d)) (.bin (.leaf8 + 0x4c00000000000000000261000000001400000000010020 0x4d000000000000000000410000000003001f (h240 + 0x1000000004200000000010000 0x10000000005000000000100000000430000000004001c) 0x43000f + 0x4f0000000000000000004300000000280000000001001e 0x420023 0x42000d + 0x5000000000000000001173000000001500000000010020) (.leaf8 0x51000000000000000000440000000002001f + 0x430023 0x43000d 0x5100000000000000000046000000002c001f 0x450023 0x45000d + 0x5200000000000000000078000000001600000000010020 0x5300000000000000000047000000002d001f)))))) + (.bin (.bin (.bin (.bin (.leaf8 0x100000000480023 0x540000000000000000037c000000001700000000000020 + 0x560000000000000000004a0000000002001f 0x490023 0x49000d 0x560000000000000000004c0000000030001f + 0x4b0023 0x4b000d) (.bin (.leaf8 0x5700000000000000000016000000001800000000010020 + 0x580000000000000000004d0000000002001f 0x4c0023 0x4c000d 0x580000000000000000004f0000000032001f + 0x4e0023 0x4e000d 0x59000000000000000000b1000000001900000000010020) (.leaf8 0x7000e + 0x5b0000000000000000005200000000330000000000001e 0x510023 0x51000d + 0x5c00000000000000000003000000001a00000000010020 0x5d000000000000000000020000000035001f + 0x100000000030023 0x5f00000000000000000022000000001b00000000000020))) (.bin (.leaf8 0xa000e + 0x620000000000000000000200000000360000000000001e (h240 0x10000 + 0x300000000010000000000000000000100000000580000000003001c) 0x58000f + 0x640000000000000000005800000000380000000001001e 0x100000000590023 + 0x6600000000000000000006000000001d00000000000020 0x680000000000000000005e0000000001001f) (.bin + (.leaf8 (h240 0x10000 0x5f00000000010000000000000000000100000000600000000003001c) 0x60000f + 0x6a00000000000000000060000000003d0000000001001e 0x5f0023 0x5f000d + 0x6b000000000000000000620000000000001f 0x610023 0x61000d) (.leaf8 + 0x6c000000000000000000080000000041001f (h240 0x10000 + 0x900000000010000000000000000000100000000010000000003001c) 0x1000f 0x6e0000000000001d 0x1000b + 0x6300000000070016 0x5f0016 0x5d000000005d0016)))) (.bin (.bin (.leaf8 0x2000000005b001a + 0x5c000000005b0016 0x590014 0x3000000005b00000000000000000002000000005e0000000000001f 0x5e0009 + 0x20021 0x5700000000090016 0x100000000055001a) (.bin (.leaf8 0x5600000000550016 0x30014 0x580010 + 0x10021 0x20000000052001a 0x800000000510016 0x59000000004f001a 0x4e000000004e0016) (.leaf8 + 0xb000000004c001a 0x4d000000004c0016 0x1be0000000049001a 0x4a00000000490016 0x480014 0x4c0010 + 0x10021 0x3c0000000046001a))) (.bin (.leaf8 0x4700000000460016 0x8ba0000000043001a + 0x4400000000430016 0x30016 0x1310000000040001a 0x4100000000400016 0x2ba6000000003d001a + 0x3d000000003d0016) (.bin (.leaf8 0x3c0014 0x3f0010 0x10021 0x5f8000000003a001a 0x3b000000003a0016 + 0x16 0xda400000000037001a 0x3800000000370016) (.leaf8 0xf0014 0x3a0010 0x10021 + 0x1dde0000000034001a 0x330016 0x3300000000060016 0x443430000000031001a 0x3200000000310016))))) + (.bin (.bin (.bin (.leaf8 0x90014 0x340010 0x10021 0x9559000000002e001a 0x2f000000002e0016 0x14 + 0x310010 0x10021) (.bin (.leaf8 0x2d00000000000016 0x155056000000002b001a 0xb000000002a0016 + 0x2eac20000000028001a 0x2900000000280016 0x50014 0x2b0010 0x10021) (.leaf8 0x6a91b20000000025001a + 0x2400000000230016 0xe95ce0000000022001a 0x2300000000220016 0x600000000030016 + 0x214d87a000000001f001a 0x1e0016 0x1d00000000010016))) (.bin (.leaf8 0x48ed0d000000001c001a + 0x1d000000001c0016 0xa683a650000000019001a 0x180016 0x1800000000120016 0x16ca1450000000016001a + 0x150016 0x800000000010016) (.bin (.leaf8 0x340923fb0000000013001a 0x1400000000130016 + 0x71f265f0000000010001a 0x1100000000100016 0xf00000000090016 0x1042db3ef000000000d001a 0xb0016 + 0xc00000000010016) (.leaf8 0x239bbfd7000000000a001a 0xb000000000a0016 0x50014 0xd0010 0x10021 + 0x514e483b20000000007001a 0x60016 0x500000000010016)))) (.bin (.bin (.leaf8 + 0xb20abf3b0000000004001a 0x400000000040016 0x19687692480000000001001a 0x16 0x14 0x2000e 0x10022 + 0x200000000020000000001037a35bc8c000000000000000000000020) (.bin (.leaf8 (h240 0x100000000000000 + 0x10000000005000000000015ee40d5ba000000000000000000010020) 0x6000000000000000000060000000002001f + 0x50023 0x5000d 0x7000000000000b20abf3a000000000100000000010020 + 0x8000000000000000000070000000000001f 0x60023 0x6000d) (.leaf8 + 0x9000000000000000000020000000003001f 0x100000000030023 + 0xb00000000000514e483b1000000000200000000000020 0x7000e + 0xe0000000000000000000d00000000050000000000001e 0xc0023 0xc000d + 0xf000000000000239bbfd6000000000300000000010020))) (.bin (.bin (.leaf8 + 0x100000000000000000000e0000000000001f 0xd0023 0xd000d 0x10000000000000000000020000000006001f + 0x100000000020023 0x12000000000001042db3ee000000000400000000000020 + 0x14000000000000000000110000000005001f (h240 0x10000 + 0x1200000000010000000000000000000100000000120000000003001c)) (.leaf8 0x12000f + 0x150000000000000000001200000000090000000001001e 0x110023 0x11000d + 0x16000000000000071f265e000000000500000000010020 0x1700000000000000000016000000000c001f 0x150023 + 0x15000d)) (.bin (.leaf8 0x18000000000000340923fa000000000600000000010020 + 0x190000000000000000000a0000000000001f 0x90023 0x9000d 0x1a00000000000000000002000000000d001f + 0x100000000030023 0x1c000000000000016ca144000000000700000000000020 + 0x1e0000000000000000001a000000000b001f) (.leaf8 (h240 0x10000 + 0x1b00000000010000000000000000000100000000010000000003001c) 0x1000f + 0x1f00000000000000000001000000000e0000000001001e 0x100000000020023 + 0x210000000000000a683a64000000000800000000000020 0x230000000000000000001f0000000012001f 0x1e0023 + 0x1e000d))))))) (.bin (.bin (.bin (.bin (.bin (.leaf8 + 0x240000000000000048ed0c000000000900000000010020 0x250000000000000000001f0000000000001f 0x1e0023 + 0x1e000d 0x26000000000000000000020000000013001f 0x100000000030023 + 0x280000000000000214d879000000000a00000000000020 0x2a000000000000000000080000000001001f) (.bin + (.leaf8 (h240 0x10000 0x900000000010000000000000000000100000000240000000003001c) 0x24000f + 0x2c0000000000000000002400000000150000000001001e 0x230023 0x23000d + 0x2d000000000000000e95cd000000000b00000000010020 0x2e000000000000000000260000000016001f + 0x100000000260023) (.leaf8 0x30000000000000006a91b1000000000c00000000000020 0x7000e + 0x330000000000000000002b00000000190000000000001e 0x2a0023 0x2a000d + 0x340000000000000002eac1000000000d00000000010020 0x350000000000000000000d000000001b001f + 0x1000000000e0023))) (.bin (.leaf8 0x3700000000000000155055000000000e00000000000020 0x2f000e (h240 + 0x10000 0x10000000002000000000100000000310000000003001c) 0x31000f + 0x3b00000000000000000031000000001c0000000001001e 0x300023 0x30000d + 0x3c00000000000000009558000000000f00000000010020) (.bin (.leaf8 0xb000e + 0x3e00000000000000000034000000001f0000000000001e 0x330023 0x33000d + 0x3f00000000000000044342000000001000000000010020 0x40000000000000000000350000000003001f (h240 + 0x10000 0x3600000000010000000000000000000100000000010000000003001c) 0x1000f) (.leaf8 + 0x410000000000000000000100000000200000000001001e 0x100000000020023 + 0x4300000000000000001ddd000000001100000000000020 0x11000e + 0x460000000000000000003a00000000230000000000001e 0x390023 0x39000d + 0x470000000000000000da3f000000001200000000010020)))) (.bin (.bin (.leaf8 0x2000e + 0x100000000000000000001000000003c0000000002001c 0x3c000f + 0x4a0000000000000000003c00000000250000000001001e 0x3b0023 0x3b000d + 0x4b000000000000000005f7000000001300000000010020 0x3e000e) (.bin (.leaf8 + 0x4c0000000000000000003f00000000270000000000001e 0x3e0023 0x3e000d + 0x4d00000000000000002ba5000000001400000000010020 0x4e00000000000000000043000000002a001f 0x420023 + 0x42000d 0x4f00000000000000000130000000001500000000010020) (.leaf8 + 0x50000000000000000000020000000001001f (h240 0x10000 + 0x300000000010000000000000000000100000000450000000003001c) 0x45000f + 0x5200000000000000000045000000002b0000000001001e 0x440023 0x44000d + 0x53000000000000000008b9000000001600000000010020 0x5400000000000000000049000000002e001f))) (.bin + (.leaf8 0x480023 0x48000d 0x550000000000000000003b000000001700000000010020 0x4a000e + 0x560000000000000000004c000000002f0000000000001e 0x4b0023 0x4b000d + 0x57000000000000000001bd000000001800000000010020) (.bin (.leaf8 + 0x580000000000000000004f0000000032001f 0x4e0023 0x4e000d + 0x590000000000000000000a000000001900000000010020 0x5a000000000000000000500000000033001f + 0x100000000510023 0x5b00000000000000000058000000001a00000000000020 + 0x5d0000000000000000000a0000000035001f) (.leaf8 0x1000000000b0023 + 0x5f00000000000000000001000000001b00000000000020 0x5000e + 0x620000000000000000005800000000370000000000001e 0x570023 0x57000d + 0x630000000000000000000f000000001c00000000010020 0x64000000000000000000590000000005001f))))) (.bin + (.bin (.bin (.leaf8 (h240 0x1000000005a0000000001000000000000000000010000 + 0x50000000001000000005c0000000001000000005e0000000005001c) 0x5e000f + 0x670000000000000000005e00000000390000000001001e 0x5d0023 0x5d000d + 0x6800000000000000000001000000001e00000000010020 0x690000000000000000005f000000003d001f (h240 + 0x10000 0x6000000000010000000000000000000100000000010000000003001c)) (.bin (.leaf8 0x1000f + 0x6a00000000000000000001000000003d0000000001001e (h240 0x10000 + 0x100000000020000000000000000000100000000640000000003001c) 0x64000f + 0x6c0000000000000000006400000000030000000001001e 0x630023 0x63000d 0x1000e) (.leaf8 0x20186 + 0x10043 0x20142 0x101c3 0x30023 0xa00c6 0x10043 0x10303))) (.bin (.leaf8 0x10009 0x650008 + 0x6600000000000000000001000000000100000000000000000000001e + 0x20000000003000000000100000000000000000000001e 0x670000000000000b 0x16 0x10014 0x2000e) (.bin + (.leaf8 0x10000000000000000000100000000670000000002001c 0xd200c6 0x10043 0x10303 0x10009 + 0x10000000001001a 0x10186 0xc100c6) (.leaf8 0x10043 0x600142 0x101c3 0x610009 0x5f000000005e0016 + 0x5000000005a0016 0x5a0014 0x70010)))) (.bin (.bin (.leaf8 0x10021 0x80000000058001a + 0x600000000570016 0x5600000000550016 0xb0014 0x580010 0x10021 0x2c0000000052001a) (.bin (.leaf8 + 0x510016 0x6000000004f001a 0x4e000000004e0016 0xde000000004c001a 0x4d000000004c0016 + 0x1e0000000049001a 0x4a00000000490016 0x45d0000000046001a) (.leaf8 0x440016 0x4500000000010016 + 0x980000000043001a 0x4200000000420016 0x15d20000000040001a 0x4000000000400016 0x2fc000000003d001a + 0x3d000000003d0016))) (.bin (.bin (.leaf8 0x30014 0x3f0010 0x10021 0x6d20000000003a001a + 0x1200000000390016 0xeee0000000037001a 0x3800000000370016 0x20014) (.leaf8 + 0x36000000000400000000000000000002000000003a0000000000001f 0x3a0009 0x20021 0x221a10000000034001a + 0x3500000000340016 0x33000000000a0016 0x4aac0000000031001a 0x200000000300016)) (.bin (.leaf8 + 0x300014 0x40010 0x10021 0xaa82a000000002e001a 0x2f000000002e0016 0xe0014 0x310010 0x10021) + (.leaf8 0x17561000000002b001a 0x8000000002a0016 0x3548d80000000028001a 0x2900000000280016 0x14 + 0x2b0010 0x10021 0x2700000000240016)))))) (.bin (.bin (.bin (.bin (.leaf8 0x74ae60000000025001a + 0x2500000000250016 0x90014 0x270010 0x10021 0x10a6c3c0000000022001a 0x2300000000220016 0x30014) + (.bin (.leaf8 0x250010 0x10021 0x21000000001e0016 0x247686000000001f001a 0x1e000000001e0016 + 0x5341d31000000001c001a 0x1d000000001c0016 0x20014) (.leaf8 + 0x1b000000000400000000000000000002000000001f0000000000001f 0x1f0009 0x20021 0xb650a20000000019001a + 0x180016 0xb00000000010016 0x1a0491fd0000000016001a 0x1700000000160016))) (.bin (.leaf8 + 0x38f932f0000000013001a 0x1300000000130016 0x120014 0x150010 0x10021 0x8216d9f70000000010001a + 0xf0016 0x20014) (.bin (.leaf8 0x20010 0x10021 0x11cddfec000000000d001a 0x8000000000c0016 + 0x28a7241d8000000000a001a 0xb000000000a0016 0x30014 0xd0010) (.leaf8 0x10021 0x900000000060016 + 0x59055f9d0000000007001a 0x600000000050016 0xcb43b49230000000004001a 0x30016 + 0x1bd1ade470000000001001a 0x16)))) (.bin (.bin (.leaf8 0x14 0x2000e 0x10022 + 0x20000000002000000000101bd1ade46000000000000000000000020 + 0x20000000004000000000100000000020000000001001f 0x100000000030023 + 0x2000000000600000000010cb43b4922000000000100000000000020 + 0x20000000008000000000100000000080000000002001f) (.bin (.leaf8 0x100000000080023 + 0x2000000000a00000000010059055f9c000000000200000000000020 + 0x2000000000c0000000001000000000b0000000003001f (h240 0x1000000000c00000000010000 + 0x100000000050000000001000000000d0000000004001c) 0xd000f + 0x2000000000e0000000001000000000d00000000040000000001001e 0xc0023 0xc000d) (.leaf8 + 0x2000000000f0000000001028a7241d7000000000300000000010020 + 0x200000000100000000001000000000a0000000007001f 0x1000000000b0023 + 0x2000000001200000000010011cddfeb000000000400000000000020 0x4000e + 0x200000000150000000001000000000200000000080000000000001e 0x100000000030023 + 0x2000000001700000000010051e63252000000000500000000000020))) (.bin (.leaf8 + 0x20000000019000000000100000000140000000007001f (h240 0x100000000000000 + 0x1000000001a0000000000000000001400000000020000000000001e) 0x130023 0x13000d + 0x1b0000000000003030a7a2000000000500000000010020 0x14000e + 0x1b00000000000000000015000000000b0000000000001e 0x140023) (.bin (.leaf8 0x14000d + 0x1c000000000000038f932e000000000600000000010020 0x1d00000000000000000019000000000e001f 0x180023 + 0x18000d 0x1e0000000000001a0491fc000000000700000000010020 0x1f0000000000000000000d0000000000001f + 0xc0023) (.leaf8 0xc000d 0x2000000000000000000002000000000f001f 0x100000000030023 + 0x2200000000000000b650a1000000000800000000000020 0x1d000e + 0x100000000050000000001000000001f0000000002001c 0x1f000f + 0x250000000000000000001f000000000f0000000001001e))))) (.bin (.bin (.bin (.leaf8 0x1e0023 0x1e000d + 0x2600000000000005341d30000000000900000000010020 0x27000000000000000000200000000013001f + 0x100000000210023 0x2800000000000000247685000000000a00000000000020 + 0x2a000000000000000000230000000013001f (h240 0x1000000002400000000010000 + 0x10000000005000000000100000000250000000004001c)) (.bin (.leaf8 0x25000f + 0x2c0000000000000000002500000000140000000001001e 0x240023 0x24000d + 0x2d000000000000010a6c3b000000000b00000000010020 0xb000e + 0x2f0000000000000000002700000000170000000000001e 0x260023) (.leaf8 0x26000d + 0x3000000000000000074ae5000000000c00000000010020 0x31000000000000000000290000000017001f (h240 + 0x1000000002a00000000010000 0x100000000020000000001000000002b0000000004001c) 0x2b000f + 0x330000000000000000002b00000000180000000001001e 0x2a0023 0x2a000d))) (.bin (.leaf8 + 0x34000000000000003548d7000000000d00000000010020 0x350000000000000000000a000000001b001f + 0x1000000000b0023 0x3700000000000000017560000000000e00000000000020 0x10000e + 0x3a00000000000000000031000000001d0000000000001e 0x300023 0x30000d) (.bin (.leaf8 + 0x3b000000000000000aa829000000000f00000000010020 0x32000e + 0x3c00000000000000000004000000001e0000000000001e 0x100000000050023 + 0x3e00000000000000004aab000000001000000000000020 0x40000000000000000000350000000006001f 0x340023 + 0x34000d) (.leaf8 0x40000000000000000000370000000022001f 0x360023 0x36000d + 0x41000000000000000221a0000000001100000000010020 0x38000e + 0x100000000050000000001000000003a0000000002001c 0x3a000f + 0x430000000000000000003a00000000210000000001001e)))) (.bin (.bin (.leaf8 0x390023 0x39000d + 0x4400000000000000000eed000000001200000000010020 0x45000000000000000000140000000025001f + 0x100000000150023 0x4700000000000000006d1f000000001300000000000020 0x5000e + 0x4a0000000000000000003f00000000270000000000001e) (.bin (.leaf8 0x3e0023 0x3e000d + 0x4b000000000000000002fb000000001400000000010020 0x4c00000000000000000042000000002a001f 0x410023 + 0x41000d 0x4d000000000000000015d1000000001500000000010020 0x4e00000000000000000044000000002b001f) + (.leaf8 0x100000000450023 0x4f00000000000000000097000000001600000000000020 + 0x51000000000000000000470000000000001f 0x460023 0x46000d 0x5100000000000000000002000000002c001f + 0x100000000020023 0x530000000000000000045c000000001700000000000020))) (.bin (.bin (.leaf8 + 0x550000000000000000004c0000000030001f 0x4b0023 0x4b000d + 0x560000000000000000001d000000001800000000010020 0x570000000000000000004f0000000032001f 0x4e0023 + 0x4e000d 0x58000000000000000000dd000000001900000000010020) (.leaf8 + 0x59000000000000000000500000000033001f 0x100000000510023 + 0x5a00000000000000000005000000001a00000000000020 0x5c000000000000000000020000000035001f + 0x100000000030023 0x5e0000000000000000002b000000001b00000000000020 0xd000e + 0x610000000000000000005800000000370000000000001e)) (.bin (.leaf8 0x570023 0x57000d + 0x62000000000000000000080000000039001f 0x100000000090023 + 0x6400000000000000000007000000001d00000000000020 0x5c000e + 0x6600000000000000000007000000003a0000000000001e (h240 0x10000 + 0x800000000010000000000000000000100000000600000000003001c)) (.bin (.bin (.leaf 0x60000f) (.bin + (.leaf 0x6800000000000000000060000000003d0000000001001e) (.leaf 0x5f0023))) (.bin (.bin (.leaf + 0x5f000d) (.leaf 0x6900000000000000000062000000003e001f)) (.bin (.leaf 0x610023) (.leaf + 0x141))))))))))))) + +def fc_0 : FastConfig := ⟨[], [], .MA, none⟩ +def fc_1 : FastConfig := + ⟨[(.PL 4, 50), (.raw [1, 0], 8), (.raw [1, 1], 3), (.S 0, 2), (.S 2, 1), (.raw [1, 0], 11), + (.raw [1], 1), (.raw [1, 1], 5), (.S 0, 2), (.PL 7, 486), (.S 7, 1), (.raw [1, 0], 14), (.raw [1], + 1), (.raw [1, 1], 8), (.S 0, 2), (.PL 10, 10), (.raw [1, 0], 16), (.raw [1, 1], 13), (.S 0, 2), + (.PL 13, 95), (.raw [1, 0], 17), (.raw [1, 1], 12), (.S 0, 2), (.S 2, 1), (.raw [1, 0], 20), + (.raw [1], 1), (.raw [1, 1], 14), (.S 0, 2), (.PL 16, 1), (.S 20, 1), (.raw [1, 0], 5), (.raw [1], + 1), (.raw [1, 1], 16), (.S 0, 2), (.PL 19, 19), (.raw [1, 0], 25), (.raw [1, 1], 7), (.S 0, 2), + (.raw [1, 0], 2), (.raw [1, 1], 24), (.S 0, 2), (.PL 25, 3), (.S 10, 1), (.raw [1, 0], 3), + (.raw [1], 1), (.S 0, 2), (.S 5, 1), (.S 32, 1), (.S 0, 2), (.S 3, 1), (.raw [1, 0], 2), + (.raw [1], 42)], [(.D 8, 1), (.D 6, 2427), (.D 5, 1), (.D 0, 1), (.D 3, 327), (.D 2, 1), (.D 0, + 4203)], .MJ, (some 4)⟩ +def fc_2 : FastConfig := + ⟨[(.PL 31, 1), (.S 11, 1), (.raw [1, 0], 37), (.raw [1], 1), (.raw [1, 1], 32), (.S 0, 2), + (.PL 34, 16), (.raw [1, 0], 38), (.raw [1, 1], 1), (.S 0, 2), (.raw [1, 0], 2), (.raw [1, 1], 6), + (.S 0, 2), (.raw [1, 0], 2), (.raw [1, 1], 39), (.S 0, 2), (.PL 40, 3), (.S 7, 1), (.raw [1, 0], + 8), (.raw [1], 1), (.raw [1, 1], 43), (.S 0, 2), (.raw [1, 0], 15), (.raw [1, 1], 1), (.raw [0], + 2)], [(.raw [1, 0], 1), (.D 33, 1), (.D 32, 1), (.D 0, 1), (.D 3, 1), (.D 30, 170), (.D 29, 1), + (.D 0, 1), (.D 3, 1), (.D 27, 23), (.D 26, 1), (.D 2, 1), (.D 0, 1), (.D 24, 855), (.D 22, 1), + (.D 0, 1), (.D 3, 1), (.D 21, 116), (.D 20, 1), (.D 0, 1), (.D 2, 1), (.D 0, 1), (.D 18, 4280), + (.D 17, 1), (.D 0, 1), (.D 15, 585), (.D 14, 1), (.D 0, 1), (.D 12, 21402), (.D 11, 1), (.D 0, 1), + (.D 3, 1), (.D 9, 2937), (.D 8, 1), (.D 0, 2), (.D 5, 1), (.D 6, 107017), (.D 5, 1), (.D 0, 1), + (.D 3, 14660), (.D 2, 1), (.D 0, 535189)], .MR, none⟩ +def fc_3 : FastConfig := + ⟨[(.raw [1, 0], 44), (.raw [1, 1], 37), (.S 0, 2), (.PL 40, 2), (.raw [1, 0], 43), (.raw [1, 1], + 1), (.S 0, 2), (.raw [1, 0], 2), (.raw [1, 1], 42), (.S 0, 2), (.PL 43, 24), (.raw [1, 0], 47), + (.raw [1, 1], 3), (.S 0, 2), (.raw [1, 0], 49), (.raw [1, 1], 7), (.S 0, 2), (.raw [1, 0], 2), + (.raw [1, 1], 48), (.S 0, 2), (.PL 49, 4), (.raw [1, 0], 53), (.raw [1, 1], 6), (.S 0, 2), + (.raw [1, 0], 2), (.S 0, 2), (.raw [1, 0], 2), (.raw [1, 1], 54), (.S 0, 2), (.S 57, 1), (.raw [1, + 0], 2), (.raw [1], 1), (.raw [1, 1], 1), (.S 0, 2), (.raw [1, 0], 64), (.raw [1, 1], 1)], [(.D 5, + 1), (.D 0, 1), (.D 42, 124), (.D 40, 1), (.D 6, 1), (.D 39, 16), (.D 38, 1), (.D 36, 622), (.D 35, + 1), (.D 0, 1), (.D 5, 1), (.D 33, 85), (.D 31, 1), (.D 30, 3114), (.D 29, 1), (.D 0, 1), (.D 2, + 1), (.D 0, 1), (.D 27, 426), (.D 25, 1), (.D 24, 15575), (.D 23, 1), (.D 21, 2130), (.D 20, 1), + (.D 14, 1), (.D 18, 77876), (.D 17, 1), (.D 0, 2), (.D 14, 1), (.D 15, 10652), (.D 14, 1), (.D 12, + 389383), (.D 10, 1), (.D 0, 1), (.D 3, 1), (.D 9, 53283), (.D 8, 1), (.D 0, 2), (.D 5, 1), (.D 6, + 1946886), (.D 5, 1), (.D 3, 266425), (.D 1, 1), (.D 0, 3360926)], .MR, (some 6371436)⟩ +def fc_4 : FastConfig := + ⟨[(.S 5, 1), (.raw [1, 0], 13), (.raw [1], 1), (.raw [1, 1], 8), (.S 0, 2), (.PL 10, 1813182), + (.raw [1, 0], 14), (.raw [1, 1], 6), (.S 0, 2), (.raw [1, 0], 16), (.raw [1, 1], 13), (.S 0, 2), + (.PL 13, 49627), (.S 17, 1), (.raw [1, 0], 20), (.raw [1], 1), (.raw [1, 1], 14), (.S 0, 2), + (.PL 16, 362636), (.S 5, 1), (.raw [1, 0], 23), (.raw [1], 1), (.raw [1, 1], 17), (.S 0, 2), + (.PL 19, 9924), (.raw [1, 0], 23), (.raw [1, 1], 1), (.S 0, 2), (.raw [1, 0], 2), (.raw [1, 1], + 21), (.S 0, 2), (.PL 22, 72526), (.raw [1, 0], 26), (.raw [1, 1], 9), (.S 0, 2), (.S 5, 1), + (.raw [1, 0], 29), (.raw [1], 1), (.raw [1, 1], 23), (.S 0, 2), (.PL 25, 1984), (.raw [1, 0], 2), + (.S 0, 2), (.raw [1, 0], 31), (.raw [1, 1], 28), (.S 0, 2), (.PL 28, 14504), (.raw [1, 0], 32), + (.raw [1, 1], 6), (.S 0, 2), (.raw [1, 0], 34), (.raw [1, 1], 31), (.S 0, 2), (.PL 31, 396), + (.S 5, 1), (.raw [1, 0], 37), (.raw [1], 1), (.raw [1, 1], 32), (.S 0, 2), (.PL 34, 2900), (.S 37, + 1), (.raw [1, 0], 3), (.raw [1], 1), (.raw [1, 1], 34), (.S 0, 2), (.PL 37, 78), (.raw [1, 0], + 41), (.raw [1, 1], 36), (.S 0, 2), (.S 2, 1), (.raw [1, 0], 44), (.raw [1], 1), (.raw [1, 1], 38), + (.S 0, 2), (.PL 40, 579), (.raw [1, 0], 14), (.raw [1, 1], 41), (.S 0, 2), (.PL 43, 15), (.raw [1, + 0], 47), (.raw [1, 1], 45), (.S 0, 2), (.PL 46, 115), (.raw [1, 0], 50), (.raw [1, 1], 9), (.S 0, + 2), (.S 5, 1), (.raw [1, 0], 53), (.raw [1], 1), (.raw [1, 1], 47), (.S 0, 2), (.PL 49, 2), + (.raw [1, 0], 8), (.raw [1, 1], 51), (.S 0, 2), (.PL 52, 22), (.raw [1, 0], 56), (.raw [1, 1], + 15), (.S 0, 2), (.raw [1, 0], 2), (.raw [1, 1], 54), (.S 0, 2), (.raw [1, 0], 13), (.raw [1, 1], + 57), (.S 0, 2), (.PL 58, 4), (.raw [1, 0], 8), (.raw [1, 1], 59), (.S 0, 2), (.raw [1, 0], 67), + (.raw [1, 1], 64), (.S 0, 2), (.raw [1, 0], 2), (.raw [1, 1], 2), (.S 0, 2), (.S 5, 1), (.raw [1, + 0], 73), (.raw [1], 1), (.raw [1, 1], 2), (.raw [0], 7)], [(.raw [1, 0], 1), (.D 9, 496296), + (.D 8, 1), (.D 2, 1), (.D 0, 1), (.D 6, 18131828), (.D 5, 1), (.D 0, 2), (.D 2, 1), (.D 3, + 2481411), (.D 1, 1), (.D 0, 90659272)], .MR, none⟩ +def fc_5 : FastConfig := + ⟨[(.raw [0], 1), (.raw [0, 1], 1), (.S 0, 1), (.raw [1, 0], 2), (.raw [1, 1], 15), (.S 0, 2), + (.PL 16, 2701849), (.raw [1, 0], 13), (.raw [1, 1], 18), (.S 0, 2), (.PL 19, 73955), (.raw [1, 0], + 25), (.raw [1, 1], 22), (.S 0, 2), (.PL 22, 540369), (.S 5, 1), (.raw [1, 0], 29), (.raw [1], 1), + (.raw [1, 1], 23), (.S 0, 2), (.PL 25, 14790), (.raw [1, 0], 2), (.raw [1, 1], 27), (.S 0, 2), + (.PL 28, 108073), (.raw [1, 0], 32), (.raw [1, 1], 1), (.S 0, 2), (.raw [1, 0], 2), (.raw [1, 1], + 30), (.S 0, 2), (.PL 31, 2957), (.raw [1, 0], 35), (.raw [1, 1], 6), (.S 0, 2), (.raw [1, 0], 2), + (.raw [1, 1], 33), (.S 0, 2), (.PL 34, 21614), (.raw [1, 0], 8), (.raw [1, 1], 35), (.S 0, 2), + (.PL 37, 591), (.S 41, 1), (.S 5, 1), (.raw [1, 0], 44), (.raw [1, 1], 37), (.S 0, 2), (.PL 40, + 4322), (.raw [1, 0], 7), (.raw [1, 1], 42), (.S 0, 2), (.PL 43, 117), (.raw [1, 0], 47), (.raw [1, + 1], 42), (.S 0, 2), (.S 5, 1), (.raw [1, 0], 50), (.raw [1], 1), (.raw [1, 1], 44), (.S 0, 2), + (.PL 46, 863), (.raw [1, 0], 50), (.raw [1, 1], 47), (.S 0, 2), (.PL 49, 23), (.raw [1, 0], 53), + (.raw [1, 1], 1), (.S 0, 2), (.raw [1, 0], 2), (.S 0, 2), (.raw [1, 0], 2), (.raw [1, 1], 51), + (.S 0, 2), (.PL 52, 172), (.raw [1, 0], 8), (.raw [1, 1], 53), (.S 0, 2), (.PL 55, 4), (.S 59, 1), + (.raw [1, 0], 8), (.raw [1], 1), (.raw [1, 1], 55), (.S 0, 2), (.PL 58, 34), (.S 5, 1), (.raw [1, + 0], 64), (.raw [1], 1), (.raw [1, 1], 59), (.S 0, 2), (.S 5, 1), (.raw [1, 0], 67), (.raw [1], 1), + (.raw [1, 1], 62), (.S 0, 2), (.PL 64, 6), (.S 5, 1), (.raw [1, 0], 70), (.raw [0, 1], 1), (.S 0, + 1), (.raw [1, 0], 2), (.raw [1, 1], 69), (.S 0, 2), (.raw [1, 0], 74), (.raw [1, 1], 4), (.S 0, + 2), (.S 78, 1), (.raw [1, 0], 7), (.raw [1], 1), (.raw [0], 1)], [(.D 16, 1), (.D 18, 369775), + (.D 17, 1), (.D 15, 13509243), (.D 13, 1), (.D 12, 1848890), (.D 11, 1), (.D 0, 1), (.D 9, + 67546209), (.D 8, 1), (.D 0, 1), (.D 3, 1), (.D 5, 1), (.D 6, 9244457), (.D 4, 1), (.D 3, + 319020238), (.D 2, 1), (.raw [1, 0], 1), (.D 0, 37421610)], .ML, none⟩ +def fc_6 : FastConfig := + ⟨[(.raw [1, 0], 10), (.raw [1, 1], 7), (.S 0, 2), (.PL 7, 13775354), (.raw [1, 0], 10), (.raw [1, + 1], 1), (.S 0, 2), (.raw [1, 0], 2), (.raw [1, 1], 9), (.S 0, 2), (.PL 10, 100651677), (.raw [1, + 0], 14), (.S 0, 2), (.S 2, 1), (.raw [1, 0], 17), (.raw [1], 1), (.raw [1, 1], 11), (.S 0, 2), + (.PL 13, 2755074), (.raw [1, 0], 17), (.raw [1, 1], 9), (.S 0, 2), (.raw [1, 0], 2), (.raw [1, 1], + 15), (.S 0, 2), (.PL 16, 20130334), (.raw [1, 0], 2), (.S 0, 2), (.raw [1, 0], 22), (.raw [1, 1], + 19), (.S 0, 2), (.PL 19, 551013), (.raw [1, 0], 23), (.raw [1, 1], 18), (.S 0, 2), (.S 5, 1), + (.raw [1, 0], 26), (.raw [1], 1), (.raw [1, 1], 20), (.S 0, 2), (.PL 22, 4026066), (.S 5, 1), + (.raw [1, 0], 29), (.raw [1], 1), (.raw [1, 1], 23), (.S 0, 2), (.PL 25, 110201), (.raw [1, 0], + 29), (.raw [1, 1], 7), (.S 0, 2), (.raw [1, 0], 2), (.raw [1, 1], 26), (.S 0, 2), (.PL 28, + 805213), (.S 5, 1), (.raw [1, 0], 35), (.raw [1], 1), (.raw [1, 1], 29), (.S 0, 2), (.PL 31, + 22039), (.raw [1, 0], 35), (.raw [1, 1], 33), (.S 0, 2), (.PL 34, 161042), (.S 38, 1), (.raw [1, + 0], 5), (.raw [1], 1), (.raw [1, 1], 34), (.S 0, 2), (.PL 37, 4407), (.raw [1, 0], 41), (.raw [1, + 1], 7), (.S 0, 2), (.raw [1, 0], 2), (.raw [1, 1], 38), (.S 0, 2), (.PL 40, 32208), (.S 11, 1), + (.raw [1, 0], 47), (.raw [1], 1), (.raw [1, 1], 41), (.S 0, 2), (.PL 43, 880), (.S 47, 1), + (.raw [1, 0], 8), (.raw [1], 1), (.raw [1, 1], 43), (.S 0, 2), (.PL 46, 6441), (.S 19, 1), + (.raw [1, 0], 53), (.raw [1], 1), (.raw [1, 1], 47), (.S 0, 2), (.PL 49, 175), (.S 17, 1), + (.raw [1, 0], 56), (.raw [1], 1), (.raw [1, 1], 50), (.S 0, 2), (.PL 52, 1287), (.raw [1, 0], 55), + (.raw [1, 1], 1), (.S 0, 2), (.raw [1, 0], 2), (.raw [1, 1], 54), (.S 0, 2), (.PL 55, 34), + (.raw [1, 0], 59), (.raw [1, 1], 6), (.S 0, 2), (.raw [1, 0], 2), (.raw [1, 1], 57), (.S 0, 2), + (.PL 58, 257), (.S 5, 1), (.raw [1, 0], 65), (.raw [1], 1), (.raw [1, 1], 59), (.S 0, 2), (.PL 61, + 6), (.raw [1, 0], 2), (.raw [1, 1], 62), (.S 0, 2), (.PL 64, 51), (.raw [1, 0], 70), (.raw [1, 1], + 67), (.S 0, 2), (.raw [1, 0], 71), (.raw [1, 1], 7), (.S 0, 2), (.raw [1, 0], 2), (.raw [1, 1], + 69), (.S 0, 2), (.PL 70, 9), (.raw [1, 0], 74), (.raw [1, 1], 4), (.S 0, 2), (.raw [1, 0], 75), + (.raw [1, 1], 1), (.S 0, 2), (.raw [1, 0], 2), (.raw [1, 1], 75), (.S 0, 2), (.PL 76, 1), + (.raw [1, 0], 80), (.S 0, 2), (.S 2, 1), (.raw [1, 0], 84), (.raw [1], 1)], [(.raw [1, 0], 1), + (.D 0, 2), (.D 5, 1), (.D 6, 1006516838), (.D 5, 1), (.D 3, 137753455), (.D 1, 1), (.D 0, + 5032584376)], .MR, none⟩ +def fc_7 : FastConfig := + ⟨[(.raw [1, 0], 2), (.raw [1, 1], 57), (.S 0, 2), (.PL 58, 1535), (.raw [1, 0], 7), (.raw [1, 1], + 1), (.S 0, 2), (.raw [1, 0], 2), (.raw [1, 1], 60), (.S 0, 2), (.PL 61, 41), (.S 65, 1), (.raw [1, + 0], 67), (.raw [1], 1), (.raw [1, 1], 62), (.S 0, 2), (.PL 64, 306), (.raw [1, 0], 68), (.raw [1, + 1], 65), (.S 0, 2), (.PL 67, 8), (.raw [1, 0], 72), (.raw [1, 1], 70), (.S 0, 2), (.PL 70, 60), + (.raw [1, 0], 74), (.raw [1, 1], 72), (.S 0, 2), (.PL 73, 1), (.S 77, 1), (.raw [1, 0], 79), + (.raw [1], 1), (.raw [1, 1], 74), (.S 0, 2), (.PL 76, 11), (.S 80, 1), (.raw [1, 0], 83), + (.raw [0, 1], 1), (.S 0, 1), (.raw [1, 0], 2), (.raw [1, 1], 81), (.S 0, 2), (.PL 82, 1), + (.raw [1, 0], 86), (.raw [1, 1], 12), (.S 0, 2), (.raw [1, 0], 2), (.S 0, 2), (.S 7, 1), (.S 91, + 1), (.raw [1, 0], 5), (.raw [0], 1)], [(.raw [1, 0], 1), (.D 2, 1), (.D 0, 1), (.D 3, 1), (.D 57, + 420), (.D 55, 1), (.D 54, 15357), (.D 53, 1), (.D 0, 1), (.D 51, 2101), (.D 50, 1), (.D 0, 1), + (.D 3, 1), (.D 47, 1), (.D 48, 76790), (.D 47, 1), (.D 45, 10508), (.D 44, 1), (.D 0, 1), (.D 3, + 1), (.D 8, 1), (.D 42, 383954), (.D 41, 1), (.D 0, 1), (.D 3, 1), (.D 39, 52548), (.D 38, 1), + (.D 11, 1), (.D 36, 1919778), (.D 35, 1), (.D 33, 262742), (.D 32, 1), (.D 0, 1), (.D 26, 1), + (.D 30, 9598892), (.D 29, 1), (.D 5, 1), (.D 27, 1313718), (.D 25, 1), (.D 24, 47994464), (.D 23, + 1), (.D 0, 1), (.D 2, 1), (.D 0, 1), (.D 21, 6568593), (.D 20, 1), (.D 18, 239972325), (.D 17, 1), + (.D 0, 1), (.D 15, 32842965), (.D 14, 1), (.D 0, 2), (.D 11, 1), (.D 12, 1199861640), (.D 11, 1), + (.D 0, 1), (.D 3, 1), (.D 9, 164214797), (.D 8, 1), (.D 0, 2), (.D 5, 1), (.D 6, 5999308300), + (.D 5, 1), (.D 0, 1), (.D 3, 821073829), (.D 2, 1), (.D 0, 29996541603)], .MR, none⟩ +def fc_8 : FastConfig := + ⟨[(.S 14, 1), (.raw [1, 0], 2), (.raw [1], 1), (.raw [0], 1)], [(.raw [1, 0], 1), (.D 95, 1), + (.D 91, 1), (.D 90, 5), (.D 89, 1), (.D 85, 1), (.D 84, 28), (.D 83, 1), (.D 12, 1), (.D 81, 3), + (.D 79, 1), (.D 78, 146), (.D 76, 1), (.D 75, 19), (.D 73, 1), (.D 0, 1), (.D 3, 1), (.D 72, 731), + (.D 71, 1), (.D 0, 2), (.D 2, 1), (.D 69, 99), (.D 68, 1), (.D 0, 1), (.D 3, 1), (.D 66, 3661), + (.D 65, 1), (.D 6, 1), (.D 63, 500), (.D 62, 1), (.D 0, 2), (.D 2, 1), (.D 60, 18307), (.D 59, 1), + (.D 0, 1), (.D 3, 1), (.D 57, 2505), (.D 56, 1), (.D 11, 1), (.D 54, 91541), (.D 53, 1), (.D 0, + 1), (.D 51, 12528), (.D 50, 1), (.D 48, 457710), (.D 47, 1), (.D 0, 1), (.D 45, 62642), (.D 44, + 1), (.D 0, 1), (.D 3, 1), (.D 42, 2288553), (.D 41, 1), (.D 0, 1), (.D 2, 1), (.D 0, 1), (.D 39, + 313214), (.D 38, 1), (.D 0, 1), (.D 36, 11442772), (.D 35, 1), (.D 5, 1), (.D 6, 1), (.D 33, + 1566073), (.D 32, 1), (.D 23, 1), (.D 30, 57213862), (.D 29, 1), (.D 27, 7830368), (.D 26, 1), + (.D 0, 2), (.D 2, 1), (.D 24, 286069314), (.D 23, 1), (.D 0, 1), (.D 9, 1), (.D 21, 39151846), + (.D 19, 1), (.D 18, 1430346572), (.D 17, 1), (.D 0, 1), (.D 8, 1), (.D 15, 195759238), (.D 14, 1), + (.D 0, 1), (.D 8, 1), (.D 12, 7151732876), (.D 11, 1), (.D 5, 1), (.D 0, 1), (.D 9, 978796133), + (.D 8, 1), (.D 0, 1), (.D 3, 1), (.D 5, 1), (.D 6, 35758664452), (.D 4, 1), (.D 3, 4893980722), + (.D 2, 1), (.D 0, 178793322217)], .MR, none⟩ + + +theorem full_halt_of_steps (tm : Machine (Fin 2) (Fin 6)) [HasCertRules tm] (ov1 ov2 : Nat) + (s0 : run_tree tm ov1 ov2 st_0 fc_0 = .inl fc_1) + (s1 : run_tree tm ov1 ov2 st_1 fc_1 = .inl fc_2) + (s2 : run_tree tm ov1 ov2 st_2 fc_2 = .inl fc_3) + (s3 : run_tree tm ov1 ov2 st_3 fc_3 = .inl fc_4) + (s4 : run_tree tm ov1 ov2 st_4 fc_4 = .inl fc_5) + (s5 : run_tree tm ov1 ov2 st_5 fc_5 = .inl fc_6) + (s6 : run_tree tm ov1 ov2 st_6 fc_6 = .inl fc_7) + (s7 : run_tree tm ov1 ov2 st_7 fc_7 = .inl fc_8) + (s8 : run_tree tm ov1 ov2 st_8 fc_8 = .inr true) : + HaltsFrom tm (init []) := by + have hinit : (flush_fc fc_0).denote = init [] := by + simp [fc_0, flush_fc, flush_d_runs, Runs.push, SymWord.isEmpty, Mode.payload, + Mode.mq, Mode.md, RMConfig.denote, Runs.denote, init_nil_eq_headRight, A] + rw [← hinit] + have hwf0 : fc_0.WF := trivial + exact chain_tree tm ov1 ov2 hwf0 s0 fun hwf1 => + chain_tree tm ov1 ov2 hwf1 s1 fun hwf2 => + chain_tree tm ov1 ov2 hwf2 s2 fun hwf3 => + chain_tree tm ov1 ov2 hwf3 s3 fun hwf4 => + chain_tree tm ov1 ov2 hwf4 s4 fun hwf5 => + chain_tree tm ov1 ov2 hwf5 s5 fun hwf6 => + chain_tree tm ov1 ov2 hwf6 s6 fun hwf7 => + chain_tree tm ov1 ov2 hwf7 s7 fun hwf8 => + done_tree tm ov1 ov2 hwf8 s8 + +end BusyBeaver.CertTreeEngine diff --git a/BusyBeaver/Calculi/Counter.lean b/BusyBeaver/Calculi/Counter.lean new file mode 100644 index 00000000..344c3004 --- /dev/null +++ b/BusyBeaver/Calculi/Counter.lean @@ -0,0 +1,1870 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +import Mathlib.Tactic.Ring + +/-! +# Shared Counter Infrastructure (`BusyBeaver.Calculi.Counter`) + +Reusable symbolic execution, finite-window stepping, digit-stack carry cascade, +run-compressed counter increment, and machine-conjugation infrastructure for +Busy Beaver counter / odometer machines (`#166`, `#128`, `#737`, etc.). + +All declarations live in `namespace BusyBeaver.Counter` with `@[scoped simp]` +attributes so that importing `BusyBeaver.Basic` (which re-exports +`BusyBeaver.Calculi.Counter`) does not alter the default `simp` set of non-counter +proofs; counter proofs activate these definitions and simp rules via +`open Counter`. +-/ + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.Counter + + + + +-- ============================================================================ +-- 1. Multi-Step & Tape / List-Repeat Algebra +-- ============================================================================ + +section MultiStepAlgebra + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[scoped simp] private theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : + multiStep M config 0 = some config := rfl + +@[scoped simp] private theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : + multiStep M config 1 = step M config := rfl + +@[scoped simp] private theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +theorem step_multiStep (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢^{1} c₂ := by simp [h] + +theorem step_stepPlus (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢⁺ c₂ := ⟨1, by decide, step_multiStep tm c₁ c₂ h⟩ + +private theorem multiStep_add (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem multiStep_step {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} {n : Nat} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢^{n} c₃) : c₁ [tm]⊢^{n + 1} c₃ := by + have := multiStep_trans tm c₁ c₂ c₃ 1 n h₁ h₂ + rwa [Nat.add_comm 1 n] at this + +theorem stepStar_refl (tm : Machine Γ Λ) (c : Cfg Γ Λ) : c [tm]⊢* c := + ⟨0, rfl⟩ + +theorem stepStar_of_multiStep {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} {n : Nat} + (h : c₁ [tm]⊢^{n} c₂) : c₁ [tm]⊢* c₂ := ⟨n, h⟩ + +theorem stepStar_trans {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + rcases h₁ with ⟨n, hn⟩; rcases h₂ with ⟨m, hm⟩ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} + (h : c₁ [tm]⊢⁺ c₂) : c₁ [tm]⊢* c₂ := by + rcases h with ⟨n, _, hn⟩; exact ⟨n, hn⟩ + +theorem stepPlus_stepPlus_stepPlus {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + rcases h₁ with ⟨n, n_pos, hn⟩; rcases h₂ with ⟨m, _, hm⟩ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_trans {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepPlus_stepPlus h₁ h₂ + +theorem stepPlus_to_stepStar {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := + stepPlus_stepStar h + +theorem stepPlus_stepStar_stepPlus {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + rcases h₁ with ⟨n, n_pos, hn⟩; rcases h₂ with ⟨m, hm⟩ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepStar_stepPlus_stepPlus {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + rcases h₁ with ⟨n, hn⟩; rcases h₂ with ⟨m, m_pos, hm⟩ + exact ⟨n + m, Nat.lt_add_left n m_pos, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar_trans {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus h₁ h₂ + +theorem stepStar_stepPlus_trans {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := + stepStar_stepPlus_stepPlus h₁ h₂ + +theorem step_stepStar_stepPlus {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +omit [Inhabited Γ] in +@[scoped simp] theorem pow_zero_list (l : List Γ) : l ^ (0 : Nat) = [] := rfl + +omit [Inhabited Γ] in +theorem pow_succ_list (l : List Γ) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl + +omit [Inhabited Γ] in +@[scoped simp] private theorem list_pow_add (l : List Γ) (n m : Nat) : l ^ (n + m) = l ^ n ++ l ^ m + := by + induction n with + | zero => simp + | succ n ih => + rw [Nat.succ_add, pow_succ_list, pow_succ_list, ih, List.append_assoc] + +omit [Inhabited Γ] in +theorem pow_succ_right (l : List Γ) (n : Nat) : l ^ (n + 1) = l ^ n ++ l := by + rw [list_pow_add]; simp [pow_succ_list] + +omit [Inhabited Γ] in +@[scoped simp] theorem nil_pow_list : ∀ (n : Nat), ([] : List Γ) ^ n = [] + | 0 => rfl + | n + 1 => by simp [pow_succ_list, nil_pow_list n] + +@[scoped simp] theorem listblank_append_nil (s : ListBlank Γ) : ([] : List Γ) +> s = s := rfl + +@[scoped simp] theorem listblank_append_cons (a : Γ) (l : List Γ) (s : ListBlank Γ) : + (a :: l) +> s = a >> (l +> s) := rfl + +@[scoped simp] theorem listblank_append_assoc (l₁ l₂ : List Γ) (s : ListBlank Γ) : + (l₁ ++ l₂) +> s = l₁ +> (l₂ +> s) := + Turing.ListBlank.append_assoc l₁ l₂ s + +@[scoped simp] theorem default_head_gen : (default : ListBlank Γ).head = default := rfl +@[scoped simp] theorem default_tail_gen : (default : ListBlank Γ).tail = default := rfl + +@[scoped simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[scoped simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +@[scoped simp] theorem zero_cons_default : (0 : Fin 2) >> (default : ListBlank (Fin 2)) = default := + by + change ListBlank.cons default default = default + exact ListBlank.cons_head_tail default + +@[scoped simp] theorem zeros_append_default : + ∀ (k : ℕ), (([0] : List (Fin 2)) ^ k) +> (default : ListBlank (Fin 2)) = default + | 0 => rfl + | k + 1 => by simp [pow_succ_list, zeros_append_default k] + +theorem right_pow_succ (u : List Γ) (n : Nat) (r : ListBlank Γ) : + u ^ (n + 1) +> r = u +> (u ^ n +> r) := by + rw [pow_succ_list, listblank_append_assoc] + +theorem right_pow_succ_right (u : List Γ) (n : Nat) (r : ListBlank Γ) : + u ^ (n + 1) +> r = u ^ n +> (u +> r) := by + rw [pow_succ_right, listblank_append_assoc] + +end MultiStepAlgebra + +-- ============================================================================ +-- 2. Symbolic Window Steppers (`CCfg` & `LocalState`) +-- ============================================================================ + +section WindowSteppers + +/-- Head-centered finite-window configuration over symbol type `Γ` and state type `Λ`. -/ +structure CCfg (Γ Λ : Type*) where + q : Λ + cur : Γ + l : List Γ + r : List Γ + deriving DecidableEq + +abbrev CCfg.head {Γ Λ : Type*} (c : CCfg Γ Λ) : Γ := c.cur +abbrev CCfg.left {Γ Λ : Type*} (c : CCfg Γ Λ) : List Γ := c.l +abbrev CCfg.right {Γ Λ : Type*} (c : CCfg Γ Λ) : List Γ := c.r + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +/-- Evaluates a `CCfg` with arbitrary left and right `ListBlank` tails. -/ +@[reducible] def evalWindow (l_tail r_tail : ListBlank Γ) (c : CCfg Γ Λ) : Cfg Γ Λ := + ⟨some c.q, ⟨c.cur, c.l +> l_tail, c.r +> r_tail⟩⟩ + +/-- Evaluates a `CCfg` with a blank (`default`) left tail and symbolic right tail `r_tail`. -/ +@[reducible] def evalCCfg (r_tail : ListBlank Γ) (c : CCfg Γ Λ) : Cfg Γ Λ := + evalWindow default r_tail c + +/-- Evaluates a `CCfg` with a symbolic left tail `l_tail` and blank (`default`) right tail. -/ +@[reducible] def evalRCCfg (l_tail : ListBlank Γ) (c : CCfg Γ Λ) : Cfg Γ Λ := + evalWindow l_tail default c + +/-- Evaluates a `CCfg` with blank (`default`) tails on both sides. -/ +@[reducible] def evalBCfg (c : CCfg Γ Λ) : Cfg Γ Λ := + evalWindow default default c + +/-- Pushes symbol `w` onto window list `xs`; when `blank = true`, `xs = []`, and `w = default`, + keeps the window list empty `[]` since `[default] +> default = default`. -/ +def pushWindow [DecidableEq Γ] (blank : Bool) (w : Γ) (xs : List Γ) : List Γ := + if blank && xs.isEmpty && w == default then [] else w :: xs + +theorem pushWindow_append [DecidableEq Γ] {blank : Bool} (w : Γ) (xs : List Γ) + (tail : ListBlank Γ) (h_blank : blank = true → tail = default) : + pushWindow blank w xs +> tail = w >> (xs +> tail) := by + unfold pushWindow + cases blank with + | false => simp + | true => + have ht := h_blank rfl + subst ht + cases xs with + | nil => + by_cases hw : w = default + · subst hw + simp only [List.isEmpty_nil, Bool.true_and, beq_self_eq_true, ↓reduceIte, + listblank_append_nil] + exact (Turing.ListBlank.cons_head_tail default).symm + · simp [hw] + | cons _ _ => simp + +/-- Unified finite-window step function parameterized by `(blankL, blankR)`: + when `blankL = true` (resp. `blankR = true`), stepping off the empty left (resp. right) + window pops `default : Γ` from the blank tail and pushing `default` onto an empty window + keeps it empty; when `false`, stepping off `[]` returns `none`. -/ +def stepWindow [DecidableEq Γ] (blankL blankR : Bool) (tm : Machine Γ Λ) (c : CCfg Γ Λ) : + Option (CCfg Γ Λ) := + match tm c.q c.cur with + | none => none + | some (none, _) => none + | some (some q', Stmt.write w Dir.left) => + let r' := pushWindow blankR w c.r + match c.l with + | [] => if blankL then some ⟨q', default, [], r'⟩ else none + | b :: ls => some ⟨q', b, ls, r'⟩ + | some (some q', Stmt.write w Dir.right) => + let l' := pushWindow blankL w c.l + match c.r with + | [] => if blankR then some ⟨q', default, l', []⟩ else none + | b :: rs => some ⟨q', b, l', rs⟩ + +theorem stepWindow_sound [DecidableEq Γ] {blankL blankR : Bool} {tm : Machine Γ Λ} {c c' : CCfg Γ Λ} + (l_tail r_tail : ListBlank Γ) + (hL : blankL = true → l_tail = default) + (hR : blankR = true → r_tail = default) + (h : stepWindow blankL blankR tm c = some c') : + (evalWindow l_tail r_tail c) [tm]⊢ (evalWindow l_tail r_tail c') := by + unfold stepWindow at h + revert h + cases h_tm : tm c.q c.cur with + | none => intro h; nomatch h + | some val => + rcases val with ⟨q_opt, stmt⟩ + cases q_opt with + | none => intro h; nomatch h + | some q' => + rcases stmt with ⟨w, dir⟩ + cases dir with + | left => + cases hl : c.l with + | nil => + cases h_bl : blankL with + | false => intro h; nomatch h + | true => + intro h; injection h with h'; subst h' + have hlt := hL h_bl; subst hlt + simp [step, evalWindow, h_tm, hl, Turing.Tape.write, Turing.Tape.move, + pushWindow_append w c.r r_tail hR] + | cons b ls => + intro h; injection h with h'; subst h' + simp [step, evalWindow, h_tm, hl, Turing.Tape.write, Turing.Tape.move, + pushWindow_append w c.r r_tail hR] + | right => + cases hr : c.r with + | nil => + cases h_br : blankR with + | false => intro h; nomatch h + | true => + intro h; injection h with h'; subst h' + have hrt := hR h_br; subst hrt + simp [step, evalWindow, h_tm, hr, Turing.Tape.write, Turing.Tape.move, + pushWindow_append w c.l l_tail hL] + | cons b rs => + intro h; injection h with h'; subst h' + simp [step, evalWindow, h_tm, hr, Turing.Tape.write, Turing.Tape.move, + pushWindow_append w c.l l_tail hL] + +def multiStepWindow [DecidableEq Γ] (blankL blankR : Bool) (tm : Machine Γ Λ) : + ℕ → CCfg Γ Λ → Option (CCfg Γ Λ) + | 0, c => some c + | n + 1, c => (stepWindow blankL blankR tm c).bind (multiStepWindow blankL blankR tm n) + +theorem multiStepWindow_sound [DecidableEq Γ] {blankL blankR : Bool} {tm : Machine Γ Λ} + (l_tail r_tail : ListBlank Γ) + (hL : blankL = true → l_tail = default) + (hR : blankR = true → r_tail = default) : + ∀ (n : ℕ) (c c' : CCfg Γ Λ), + multiStepWindow blankL blankR tm n c = some c' → + (evalWindow l_tail r_tail c) [tm]⊢^{n} (evalWindow l_tail r_tail c') + | 0, c, c', h => by + injection h with h'; subst h'; rfl + | n + 1, c, c', h => by + simp only [multiStepWindow, Option.bind_eq_some_iff] at h + rcases h with ⟨c₁, h₁, h₂⟩ + exact multiStep_step (stepWindow_sound l_tail r_tail hL hR h₁) + (multiStepWindow_sound l_tail r_tail hL hR n c₁ c' h₂) + +/-- Strict window stepper (neither side blank-extended). -/ +def wstep [DecidableEq Γ] (tm : Machine Γ Λ) : CCfg Γ Λ → Option (CCfg Γ Λ) := + stepWindow false false tm +def wmultiStep [DecidableEq Γ] (tm : Machine Γ Λ) : ℕ → CCfg Γ Λ → Option (CCfg Γ Λ) := + multiStepWindow false false tm + +theorem wstep_sound [DecidableEq Γ] {tm : Machine Γ Λ} (c c' : CCfg Γ Λ) + (l_tail r_tail : ListBlank Γ) (h : wstep tm c = some c') : + (evalWindow l_tail r_tail c) [tm]⊢ (evalWindow l_tail r_tail c') := + stepWindow_sound l_tail r_tail (by intro hc; nomatch hc) (by intro hc; nomatch hc) h + +theorem wmultiStep_sound [DecidableEq Γ] {tm : Machine Γ Λ} (n : ℕ) (c c' : CCfg Γ Λ) + (l_tail r_tail : ListBlank Γ) (h : wmultiStep tm n c = some c') : + (evalWindow l_tail r_tail c) [tm]⊢^{n} (evalWindow l_tail r_tail c') := + multiStepWindow_sound l_tail r_tail (by intro hc; nomatch hc) (by intro hc; nomatch hc) n c c' h + +/-- Left-blank-extended window stepper (`evalCCfg`). -/ +def cstep [DecidableEq Γ] (tm : Machine Γ Λ) : CCfg Γ Λ → Option (CCfg Γ Λ) := + stepWindow true false tm +def cmultiStep [DecidableEq Γ] (tm : Machine Γ Λ) : ℕ → CCfg Γ Λ → Option (CCfg Γ Λ) := + multiStepWindow true false tm + +theorem cstep_sound [DecidableEq Γ] {tm : Machine Γ Λ} (c c' : CCfg Γ Λ) (r_tail : ListBlank Γ) + (h : cstep tm c = some c') : + (evalCCfg r_tail c) [tm]⊢ (evalCCfg r_tail c') := + stepWindow_sound default r_tail (fun _ => rfl) (by intro hc; nomatch hc) h + +theorem cmultiStep_sound [DecidableEq Γ] {tm : Machine Γ Λ} (n : ℕ) (c c' : CCfg Γ Λ) + (r_tail : ListBlank Γ) (h : cmultiStep tm n c = some c') : + (evalCCfg r_tail c) [tm]⊢^{n} (evalCCfg r_tail c') := + multiStepWindow_sound default r_tail (fun _ => rfl) (by intro hc; nomatch hc) n c c' h + +/-- Right-blank-extended window stepper (`evalRCCfg`). -/ +def rcstep [DecidableEq Γ] (tm : Machine Γ Λ) : CCfg Γ Λ → Option (CCfg Γ Λ) := + stepWindow false true tm +def rcmultiStep [DecidableEq Γ] (tm : Machine Γ Λ) : ℕ → CCfg Γ Λ → Option (CCfg Γ Λ) := + multiStepWindow false true tm + +theorem rcstep_sound [DecidableEq Γ] {tm : Machine Γ Λ} (c c' : CCfg Γ Λ) (l_tail : ListBlank Γ) + (h : rcstep tm c = some c') : + (evalRCCfg l_tail c) [tm]⊢ (evalRCCfg l_tail c') := + stepWindow_sound l_tail default (by intro hc; nomatch hc) (fun _ => rfl) h + +theorem rcmultiStep_sound [DecidableEq Γ] {tm : Machine Γ Λ} (n : ℕ) (c c' : CCfg Γ Λ) + (l_tail : ListBlank Γ) (h : rcmultiStep tm n c = some c') : + (evalRCCfg l_tail c) [tm]⊢^{n} (evalRCCfg l_tail c') := + multiStepWindow_sound l_tail default (by intro hc; nomatch hc) (fun _ => rfl) n c c' h + +/-- Both-sides-blank-extended window stepper (`evalBCfg`). -/ +def bstep [DecidableEq Γ] (tm : Machine Γ Λ) : CCfg Γ Λ → Option (CCfg Γ Λ) := + stepWindow true true tm +def bmultiStep [DecidableEq Γ] (tm : Machine Γ Λ) : ℕ → CCfg Γ Λ → Option (CCfg Γ Λ) := + multiStepWindow true true tm + +theorem bstep_sound [DecidableEq Γ] {tm : Machine Γ Λ} (c c' : CCfg Γ Λ) (h : bstep tm c = some c') + : + (evalBCfg c) [tm]⊢ (evalBCfg c') := + stepWindow_sound default default (fun _ => rfl) (fun _ => rfl) h + +theorem bmultiStep_sound [DecidableEq Γ] {tm : Machine Γ Λ} (n : ℕ) (c c' : CCfg Γ Λ) + (h : bmultiStep tm n c = some c') : + (evalBCfg c) [tm]⊢^{n} (evalBCfg c') := + multiStepWindow_sound default default (fun _ => rfl) (fun _ => rfl) n c c' h + +/-- Directional half-tape configuration constructor (`l <{{q}} r` vs `l {{q}}> r`). -/ +def cfg_of (q : Λ) (d : Dir) (l r : ListBlank Γ) : Cfg Γ Λ := + match d with + | .left => ⟨some q, ⟨ListBlank.head l, ListBlank.tail l, r⟩⟩ + | .right => ⟨some q, ⟨ListBlank.head r, l, ListBlank.tail r⟩⟩ + +/-- Directional finite-window state (`l`, `r`, state `q`, head direction `d`). -/ +structure LocalState (Γ Λ : Type*) where + l : List Γ + r : List Γ + q : Λ + d : Dir + deriving DecidableEq + +def step_local (tm : Machine Γ Λ) (s : LocalState Γ Λ) : Option (LocalState Γ Λ) := + match s.d with + | .left => + match s.l with + | [] => none + | b :: l => + match tm s.q b with + | some (some q', Stmt.write b' .left) => some ⟨l, b' :: s.r, q', .left⟩ + | some (some q', Stmt.write b' .right) => some ⟨b' :: l, s.r, q', .right⟩ + | _ => none + | .right => + match s.r with + | [] => none + | b :: r => + match tm s.q b with + | some (some q', Stmt.write b' .left) => some ⟨s.l, b' :: r, q', .left⟩ + | some (some q', Stmt.write b' .right) => some ⟨b' :: s.l, r, q', .right⟩ + | _ => none + +theorem step_local_spec {tm : Machine Γ Λ} {s1 s2 : LocalState Γ Λ} + (h : step_local tm s1 = some s2) (L R : ListBlank Γ) : + (cfg_of s1.q s1.d (s1.l +> L) (s1.r +> R)) [tm]⊢ + (cfg_of s2.q s2.d (s2.l +> L) (s2.r +> R)) := by + rcases s1 with ⟨l1, r1, q1, d1⟩ + rcases s2 with ⟨l2, r2, q2, d2⟩ + unfold step_local at h + cases d1 + · cases l1 with + | nil => contradiction + | cons b l => + dsimp only at h + cases htm : tm q1 b with + | none => rw [htm] at h; contradiction + | some qa => + rcases qa with ⟨_ | q', ⟨b', _ | _⟩⟩ + · rw [htm] at h; contradiction + · rw [htm] at h; contradiction + · rw [htm] at h + injection h with hs; cases hs + unfold cfg_of step; dsimp only + rw [listblank_append_cons, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, htm] + simp only [listblank_append_cons]; rfl + · rw [htm] at h + injection h with hs; cases hs + unfold cfg_of step; dsimp only + rw [listblank_append_cons, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, htm] + simp only [listblank_append_cons]; rfl + · cases r1 with + | nil => contradiction + | cons b r => + dsimp only at h + cases htm : tm q1 b with + | none => rw [htm] at h; contradiction + | some qa => + rcases qa with ⟨_ | q', ⟨b', _ | _⟩⟩ + · rw [htm] at h; contradiction + · rw [htm] at h; contradiction + · rw [htm] at h + injection h with hs; cases hs + unfold cfg_of step; dsimp only + rw [listblank_append_cons, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, htm] + simp only [listblank_append_cons]; rfl + · rw [htm] at h + injection h with hs; cases hs + unfold cfg_of step; dsimp only + rw [listblank_append_cons, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, htm] + simp only [listblank_append_cons]; rfl + +def run_local (tm : Machine Γ Λ) : Nat → LocalState Γ Λ → Option (LocalState Γ Λ) + | 0, s => some s + | n + 1, s => + match step_local tm s with + | some s' => run_local tm n s' + | none => none + +theorem run_local_spec {tm : Machine Γ Λ} {n : Nat} {s1 s2 : LocalState Γ Λ} + (h : run_local tm n s1 = some s2) (L R : ListBlank Γ) : + (cfg_of s1.q s1.d (s1.l +> L) (s1.r +> R)) [tm]⊢* + (cfg_of s2.q s2.d (s2.l +> L) (s2.r +> R)) := by + induction n generalizing s1 with + | zero => + unfold run_local at h + injection h with hs; subst hs + exact ⟨0, rfl⟩ + | succ n ih => + unfold run_local at h + cases hs : step_local tm s1 with + | none => rw [hs] at h; contradiction + | some sm => + rw [hs] at h + exact stepPlus_stepStar (step_stepStar_stepPlus (step_local_spec hs L R) (ih h)) + +theorem run_local_plus_eq {tm : Machine Γ Λ} {n : Nat} {s1 s2 : LocalState Γ Λ} + {c1 c2 : Cfg Γ Λ} (L R : ListBlank Γ) + (h : run_local tm (n + 1) s1 = some s2) + (h1 : cfg_of s1.q s1.d (s1.l +> L) (s1.r +> R) = c1) + (h2 : cfg_of s2.q s2.d (s2.l +> L) (s2.r +> R) = c2) : + c1 [tm]⊢⁺ c2 := by + rw [← h1, ← h2] + unfold run_local at h + cases hs : step_local tm s1 with + | none => rw [hs] at h; contradiction + | some sm => + rw [hs] at h + exact step_stepStar_stepPlus (step_local_spec hs L R) (run_local_spec h L R) + +end WindowSteppers + +-- ============================================================================ +-- 3. Fixed-Block Token Tape Codec (`encWords`, `encTape`) +-- ============================================================================ + +section WordCodec + +variable {Tok Γ : Type*} [Inhabited Γ] + +/-- Concatenates the word encodings of a token list `List Tok`. -/ +def encWords (w : Tok → List Γ) : List Tok → List Γ + | [] => [] + | d :: xs => w d ++ encWords w xs + +omit [Inhabited Γ] in +@[scoped simp] theorem encWords_nil (w : Tok → List Γ) : encWords w [] = [] := rfl + +omit [Inhabited Γ] in +@[scoped simp] theorem encWords_cons (w : Tok → List Γ) (d : Tok) (xs : List Tok) : + encWords w (d :: xs) = w d ++ encWords w xs := rfl + +omit [Inhabited Γ] in +@[scoped simp] theorem encWords_append (w : Tok → List Γ) (x y : List Tok) : + encWords w (x ++ y) = encWords w x ++ encWords w y := by + induction x with + | nil => rfl + | cons d xs ih => simp [ih, List.append_assoc] + +/-- Encodes a token list `List Tok` onto a half-tape ending in `sentinel : ListBlank Γ`. -/ +def encTape (w : Tok → List Γ) (sentinel : ListBlank Γ) (x : List Tok) : ListBlank Γ := + encWords w x +> sentinel + +@[scoped simp] theorem encTape_nil (w : Tok → List Γ) (sentinel : ListBlank Γ) : + encTape w sentinel [] = sentinel := rfl + +theorem encTape_cons (w : Tok → List Γ) (sentinel : ListBlank Γ) (d : Tok) (xs : List Tok) : + encTape w sentinel (d :: xs) = w d +> encTape w sentinel xs := by + simp only [encTape, encWords_cons, listblank_append_assoc] + +@[scoped simp] theorem encTape_append (w : Tok → List Γ) (sentinel : ListBlank Γ) (x y : List Tok) : + encTape w sentinel (x ++ y) = encWords w x +> encTape w sentinel y := by + simp only [encTape, encWords_append, listblank_append_assoc] + +end WordCodec + +-- ============================================================================ +-- 4A. Binary & Shift-Overflow Counter Algebra (`IterRel`, `BinDigit`, `BinSweep`, `DigitVal`) +-- ============================================================================ + +section BinaryCounterAlgebra + +/-- `n`-fold relational composition of a single-step counter increment relation `Inc`. -/ +inductive IterRel {α : Type*} (Inc : α → α → Prop) : ℕ → α → α → Prop + | zero (x : α) : IterRel Inc 0 x x + | succ {n : ℕ} {x y z : α} : Inc x y → IterRel Inc n y z → IterRel Inc (n + 1) x z + +/-- Composition of iterated relation steps: `IterRel Inc m x y → IterRel Inc n y z → IterRel Inc (m + + n) x z`. -/ +theorem IterRel_trans {α : Type*} {Inc : α → α → Prop} {m n : ℕ} {x y z : α} + (h₁ : IterRel Inc m x y) (h₂ : IterRel Inc n y z) : IterRel Inc (m + n) x z := by + induction h₁ with + | zero => simpa only [Nat.zero_add] using h₂ + | succ hstep _ ih => + rw [Nat.succ_add] + exact IterRel.succ hstep (ih h₂) + +/-- Lifts a single-step counter increment `cfg (x, m) ⊢* cfg (x', m + 1)` to `n` increments. -/ +theorem IterRel_lift_rc {α Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {Inc : α → α → Prop} + (evalCfg : α → ℕ → Cfg Γ Λ) + (h_step : ∀ {x x'}, Inc x x' → ∀ m, (evalCfg x m) [tm]⊢* (evalCfg x' (m + 1))) + {n : ℕ} {x x' : α} (h : IterRel Inc n x x') : + ∀ (m : ℕ), (evalCfg x m) [tm]⊢* (evalCfg x' (m + n)) := by + induction h with + | zero x => + intro m; rw [Nat.add_zero]; try exact stepStar_refl _ _ + | @succ n x y z h1 _ ih => + intro m + rw [← Nat.add_assoc, Nat.add_right_comm m n 1] + exact stepStar_trans (h_step h1 m) (ih (m + 1)) + +/-- Canonical 2-word digit alphabet (`W0`, `W1`) for shift-overflow binary counters (`SOBC`). -/ +inductive LD + | W0 : LD + | W1 : LD + deriving DecidableEq, Repr + +theorem pow_W1_odd : ∀ (m : ℕ) (s : List LD), + ((([.W1] : List LD) ^ (2 * m + 1)) ++ s) = + ((([.W1, .W1] : List LD) ^ m) ++ (.W1 :: s)) + | 0, s => rfl + | m + 1, s => by + have h2 : 2 * (m + 1) + 1 = 2 + (2 * m + 1) := by omega + rw [h2, list_pow_add, List.append_assoc, pow_W1_odd m s]; rfl + +/-- Single-step carry increment relation on `List LD` (`SOBC` word algebra). -/ +inductive LInc : List LD → List LD → Prop + | w0 {xs xs' : List LD} : LInc xs xs' → LInc (.W0 :: xs) (.W0 :: xs') + | w10 (xs : List LD) : LInc (.W1 :: .W0 :: xs) (.W1 :: .W1 :: xs) + | w11 {xs xs' : List LD} : LInc xs xs' → LInc (.W1 :: .W1 :: xs) (.W1 :: .W0 :: xs') + +theorem LInc_append {a a' : List LD} (h : LInc a a') (b : List LD) : + LInc (a ++ b) (a' ++ b) := by + induction h with + | w0 _ ih => exact .w0 ih + | w10 xs => exact .w10 (xs ++ b) + | w11 _ ih => exact .w11 ih + +theorem LInc_pow_11_10 : ∀ (k : ℕ) (s : List LD), + LInc ((([.W1, .W1] : List LD) ^ k) ++ (.W1 :: .W0 :: s)) + ((([.W1, .W0] : List LD) ^ k) ++ (.W1 :: .W1 :: s)) + | 0, s => .w10 s + | k + 1, s => .w11 (LInc_pow_11_10 k s) + +abbrev LIncs : ℕ → List LD → List LD → Prop := IterRel LInc + +theorem LIncs_w0 {n : ℕ} {xs xs' : List LD} (h : LIncs n xs xs') : + LIncs n (.W0 :: xs) (.W0 :: xs') := by + induction h with + | zero xs => exact .zero (.W0 :: xs) + | succ h1 _ ih => exact .succ (.w0 h1) ih + +theorem LIncs_w11 {n : ℕ} {xs xs' : List LD} (h : LIncs n xs xs') : + LIncs (2 * n) (.W1 :: .W1 :: xs) (.W1 :: .W1 :: xs') := by + induction h with + | zero xs => exact .zero (.W1 :: .W1 :: xs) + | @succ n x y z h1 _ ih => + rw [Nat.mul_succ] + exact .succ (.w11 h1) (.succ (.w10 y) ih) + +theorem LIncs_w10 {n : ℕ} {xs xs' : List LD} (h : LIncs n xs xs') : + LIncs (2 * n + 1) (.W1 :: .W0 :: xs) (.W1 :: .W1 :: xs') := + .succ (.w10 xs) (LIncs_w11 h) + +/-- Full-saturation binary counter sweep relation (`LIncsP`): + saturates every `(.W1, .W0)` pair to `(.W1, .W1)` in `n` increments. -/ +inductive LIncsP : ℕ → List LD → List LD → Prop + | nil : LIncsP 0 [] [] + | w0 {n : ℕ} {xs xs' : List LD} : LIncsP n xs xs' → LIncsP n (.W0 :: xs) (.W0 :: xs') + | w10 {n : ℕ} {xs xs' : List LD} : LIncsP n xs xs' → LIncsP (2 * n + 1) (.W1 :: .W0 :: xs) (.W1 :: + .W1 :: xs') + | w11 {n : ℕ} {xs xs' : List LD} : LIncsP n xs xs' → LIncsP (2 * n) (.W1 :: .W1 :: xs) (.W1 :: .W1 + :: xs') + +theorem LIncsP_to_LIncs {n : ℕ} {x x' : List LD} (h : LIncsP n x x') : LIncs n x x' := by + induction h with + | nil => exact .zero [] + | w0 _ ih => exact LIncs_w0 ih + | w10 _ ih => exact LIncs_w10 ih + | w11 _ ih => exact LIncs_w11 ih + +theorem LIncsP_append {m : ℕ} {a a' : List LD} (ha : LIncsP m a a') : + ∀ {n : ℕ} {b b' : List LD}, LIncsP n b b' → ∃ k, LIncsP k (a ++ b) (a' ++ b') := by + induction ha with + | nil => intro n b b' hb; exact ⟨n, hb⟩ + | w0 _ ih => + intro n b b' hb + rcases ih hb with ⟨k, hk⟩ + exact ⟨k, .w0 hk⟩ + | w10 _ ih => + intro n b b' hb + rcases ih hb with ⟨k, hk⟩ + exact ⟨2 * k + 1, .w10 hk⟩ + | w11 _ ih => + intro n b b' hb + rcases ih hb with ⟨k, hk⟩ + exact ⟨2 * k, .w11 hk⟩ + +theorem LIncsP_pow_10 : ∀ (k : ℕ) {n : ℕ} {xs xs' : List LD}, + LIncsP n xs xs' → + ∃ m, LIncsP m ((([.W1, .W0] : List LD) ^ k) ++ xs) ((([.W1, .W1] : List LD) ^ k) ++ xs') + | 0, _, _, _, h => ⟨_, h⟩ + | k + 1, _, _, _, h => by + rcases LIncsP_pow_10 k h with ⟨m, hm⟩ + exact ⟨2 * m + 1, .w10 hm⟩ + +theorem LIncsP_pow10_bound {n : ℕ} {xs xs' : List LD} (h : LIncsP n xs xs') : + LIncsP (2 * (512 * n + 511) + 1) + ((([.W1, .W0] : List LD) ^ 10) ++ xs) + ((([.W1, .W1] : List LD) ^ 10) ++ xs') := by + have h1 := LIncsP.w10 h + have h2 := LIncsP.w10 h1 + have h3 := LIncsP.w10 h2 + have h4 := LIncsP.w10 h3 + have h5 := LIncsP.w10 h4 + have h6 := LIncsP.w10 h5 + have h7 := LIncsP.w10 h6 + have h8 := LIncsP.w10 h7 + have h9 := LIncsP.w10 h8 + have h10 := LIncsP.w10 h9 + have heq : 2 * (2 * (2 * (2 * (2 * (2 * (2 * (2 * (2 * (2 * n + 1) + 1) + 1) + 1) + 1) + 1) + 1) + + 1) + 1) + 1 = + 2 * (512 * n + 511) + 1 := by omega + rwa [heq] at h10 + +/-- Shift-overflow transducer relation (`LOv2`) on `List LD`. -/ +inductive LOv2 : List LD → List LD → List LD → Prop + | nil (u : List LD) : LOv2 [] u u + | w0 {xs u u' : List LD} : + LOv2 xs u u' → LOv2 (.W0 :: xs) u (.W1 :: u') + | w11_0 {xs u x : List LD} : + LOv2 xs u (.W0 :: x) → + LOv2 (.W1 :: .W1 :: xs) u (.W0 :: .W0 :: .W1 :: x) + | w11_1 {xs u z z' : List LD} : + LOv2 xs u (.W1 :: z) → LInc z z' → + LOv2 (.W1 :: .W1 :: xs) u (.W0 :: .W0 :: .W0 :: z') + +theorem LOv2_append {a b u v w : List LD} (ha : LOv2 a v w) (hb : LOv2 b u v) : + LOv2 (a ++ b) u w := by + induction ha with + | nil => exact hb + | w0 _ ih => exact .w0 (ih hb) + | w11_0 _ ih => exact .w11_0 (ih hb) + | w11_1 _ hz ih => exact .w11_1 (ih hb) hz + +theorem LOv2_suffix {w u y : List LD} (h : LOv2 w u y) (s : List LD) : + LOv2 w (u ++ s) (y ++ s) := by + induction h with + | nil _ => exact .nil _ + | w0 _ ih => exact .w0 ih + | w11_0 _ ih => exact .w11_0 ih + | w11_1 _ hz ih => exact .w11_1 ih (LInc_append hz s) + +theorem LOv2_pow_11 : ∀ (k : ℕ) (s : List LD), + LOv2 ((([.W1, .W1] : List LD) ^ k)) + ([.W0, .W0, .W1, .W0] ++ s) + ([.W0, .W0, .W1, .W0] ++ ((([.W1, .W0] : List LD) ^ k) ++ s)) + | 0, _ => .nil _ + | k + 1, s => .w11_0 (LOv2_pow_11 k s) + +def lincFinite : List LD → Option (List LD) + | [] => none + | [.W1] => none + | .W0 :: xs => (lincFinite xs).map (.W0 :: ·) + | .W1 :: .W0 :: xs => some (.W1 :: .W1 :: xs) + | .W1 :: .W1 :: xs => (lincFinite xs).map (.W1 :: .W0 :: ·) + +theorem lincFinite_sound : ∀ {x x' : List LD}, lincFinite x = some x' → LInc x x' + | [], _, h => by nomatch h + | [.W1], _, h => by nomatch h + | .W0 :: xs, _, h => by + simp only [lincFinite, Option.map_eq_some_iff] at h + rcases h with ⟨xs', hxs, rfl⟩ + exact .w0 (lincFinite_sound hxs) + | .W1 :: .W0 :: xs, _, h => by + injection h with h'; subst h' + exact .w10 xs + | .W1 :: .W1 :: xs, _, h => by + simp only [lincFinite, Option.map_eq_some_iff] at h + rcases h with ⟨xs', hxs, rfl⟩ + exact .w11 (lincFinite_sound hxs) + +def lincspFinite : List LD → Option (List LD) + | [] => some [] + | [.W1] => none + | .W0 :: xs => (lincspFinite xs).map (.W0 :: ·) + | .W1 :: .W0 :: xs => (lincspFinite xs).map (.W1 :: .W1 :: ·) + | .W1 :: .W1 :: xs => (lincspFinite xs).map (.W1 :: .W1 :: ·) + +def lincspCount : List LD → ℕ + | [] => 0 + | [.W1] => 0 + | .W0 :: xs => lincspCount xs + | .W1 :: .W0 :: xs => 2 * lincspCount xs + 1 + | .W1 :: .W1 :: xs => 2 * lincspCount xs + +theorem lincspFinite_sound : ∀ {x x' : List LD}, + lincspFinite x = some x' → LIncsP (lincspCount x) x x' + | [], _, h => by + injection h with h'; subst h'; exact .nil + | [.W1], _, h => by nomatch h + | .W0 :: xs, _, h => by + simp only [lincspFinite, Option.map_eq_some_iff] at h + rcases h with ⟨xs', hxs, rfl⟩ + exact .w0 (lincspFinite_sound hxs) + | .W1 :: .W0 :: xs, _, h => by + simp only [lincspFinite, Option.map_eq_some_iff] at h + rcases h with ⟨xs', hxs, rfl⟩ + exact .w10 (lincspFinite_sound hxs) + | .W1 :: .W1 :: xs, _, h => by + simp only [lincspFinite, Option.map_eq_some_iff] at h + rcases h with ⟨xs', hxs, rfl⟩ + exact .w11 (lincspFinite_sound hxs) + +def lov2Finite : List LD → List LD → Option (List LD) + | [], u => some u + | .W0 :: xs, u => (lov2Finite xs u).map (.W1 :: ·) + | .W1 :: .W1 :: xs, u => + match lov2Finite xs u with + | some (.W0 :: x) => some (.W0 :: .W0 :: .W1 :: x) + | some (.W1 :: z) => (lincFinite z).map (.W0 :: .W0 :: .W0 :: ·) + | _ => none + | _, _ => none + +theorem lov2Finite_sound : ∀ {w u y : List LD}, + lov2Finite w u = some y → LOv2 w u y + | [], u, _, h => by + injection h with h'; subst h'; exact .nil u + | .W0 :: xs, u, _, h => by + simp only [lov2Finite, Option.map_eq_some_iff] at h + rcases h with ⟨u', hu, rfl⟩ + exact .w0 (lov2Finite_sound hu) + | .W1 :: .W0 :: _, _, _, h => by nomatch h + | [.W1], _, _, h => by nomatch h + | .W1 :: .W1 :: xs, u, _, h => by + unfold lov2Finite at h + revert h + cases hov : lov2Finite xs u with + | none => intro h; nomatch h + | some r => + cases r with + | nil => intro h; nomatch h + | cons d tail => + cases d with + | W0 => + intro h; injection h with h'; subst h' + exact .w11_0 (lov2Finite_sound hov) + | W1 => + simp only [Option.map_eq_some_iff] + rintro ⟨z', hz, rfl⟩ + exact .w11_1 (lov2Finite_sound hov) (lincFinite_sound hz) + +def stepBuffer (b : List LD) : Option (List LD) := + match (lincspFinite b).bind (fun bp => lov2Finite bp [.W0, .W0, .W1, .W0]) with + | some (.W0 :: x) => some (.W1 :: x) + | some (.W1 :: z) => (lincFinite z).map (.W0 :: ·) + | _ => none + +def checkBuffer : ℕ → List LD → Bool + | 0, b => (lincspFinite b).isSome + | r + 1, b => + match stepBuffer b with + | some b' => checkBuffer r b' + | none => false + +abbrev IsBuffer (r : ℕ) (b : List LD) : Prop := checkBuffer r b = true + +theorem checkBuffer_mono : ∀ {r : ℕ} {b : List LD}, + checkBuffer (r + 1) b = true → checkBuffer r b = true + | 0, b, h => by + unfold checkBuffer stepBuffer at h + cases h1 : lincspFinite b with + | none => simp [h1] at h + | some bp => simp [checkBuffer, h1] + | r + 1, b, h => by + unfold checkBuffer at h ⊢ + cases hs : stepBuffer b with + | none => simp [hs] at h + | some b' => + rw [hs] at h + exact checkBuffer_mono h + +theorem isBuffer_le {k r : ℕ} (hkr : k ≤ r) {b : List LD} (hb : IsBuffer r b) : + IsBuffer k b := by + induction r generalizing k with + | zero => + have : k = 0 := by omega + subst this; exact hb + | succ r' ih => + rcases Nat.of_le_succ hkr with hlt | rfl + · exact ih hlt (checkBuffer_mono hb) + · exact hb + +theorem stepBuffer_spec {r : ℕ} {b : List LD} (hb : IsBuffer (r + 1) b) : + ∃ (n : ℕ) (bp b' : List LD), + LIncsP n b bp ∧ + IsBuffer r b' ∧ + ∀ (s : List LD), + LOv2 ([.W1, .W1, .W1, .W1] ++ bp) + ([.W0, .W0, .W1, .W0] ++ s) + ([.W0, .W0, .W1, .W0] ++ (b' ++ s)) := by + unfold IsBuffer checkBuffer at hb + cases hs : stepBuffer b with + | none => rw [hs] at hb; nomatch hb + | some b' => + rw [hs] at hb + unfold stepBuffer at hs + revert hs + cases h_lp : lincspFinite b with + | none => intro hs; nomatch hs + | some bp => + simp only [Option.bind_some] + cases h_ov : lov2Finite bp [.W0, .W0, .W1, .W0] with + | none => intro hs; nomatch hs + | some ov => + cases ov with + | nil => intro hs; nomatch hs + | cons d tail => + cases d with + | W0 => + intro hs; injection hs with hs'; subst hs' + refine ⟨lincspCount b, bp, .W1 :: tail, lincspFinite_sound h_lp, hb, ?_⟩ + intro s + have hov_s := LOv2_suffix (lov2Finite_sound h_ov) s + exact .w11_0 (.w11_0 hov_s) + | W1 => + simp only [Option.map_eq_some_iff] + rintro ⟨z', hz, rfl⟩ + refine ⟨lincspCount b, bp, .W0 :: z', lincspFinite_sound h_lp, hb, ?_⟩ + intro s + have hov_s := LOv2_suffix (lov2Finite_sound h_ov) s + have hz_s := LInc_append (lincFinite_sound hz) s + exact .w11_0 (.w11_1 hov_s hz_s) + +def macroStepFinite (u : List LD) : Option (List LD) := + match (lincspFinite u).bind (fun up => lov2Finite up [.W0, .W0]) with + | some (.W0 :: x) => some (.W1 :: x) + | some (.W1 :: z) => (lincFinite z).map (.W0 :: ·) + | _ => none + +theorem macroStepFinite_spec {u u' : List LD} (h : macroStepFinite u = some u') : + ∃ (n : ℕ) (up : List LD), + LIncsP n u up ∧ + LOv2 ([.W1, .W1, .W1, .W1] ++ up) [.W0, .W0] ([.W0, .W0, .W1, .W0] ++ u') := by + unfold macroStepFinite at h + revert h + cases h_lp : lincspFinite u with + | none => intro h; nomatch h + | some up => + simp only [Option.bind_some] + cases h_ov : lov2Finite up [.W0, .W0] with + | none => intro h; nomatch h + | some ov => + cases ov with + | nil => intro h; nomatch h + | cons d tail => + cases d with + | W0 => + intro h; injection h with h'; subst h' + exact ⟨lincspCount u, up, lincspFinite_sound h_lp, .w11_0 (.w11_0 (lov2Finite_sound + h_ov))⟩ + | W1 => + simp only [Option.map_eq_some_iff] + rintro ⟨z', hz, rfl⟩ + exact ⟨lincspCount u, up, lincspFinite_sound h_lp, + .w11_0 (.w11_1 (lov2Finite_sound h_ov) (lincFinite_sound hz))⟩ + +def runU : ℕ → List LD → Option (List LD) + | 0, u => some u + | k + 1, u => (macroStepFinite u).bind (runU k) + +inductive ChainTail (r : ℕ) : List LD → Prop + | nil : ChainTail r (([.W1, .W0] : List LD) ^ (2 * r)) + | pair {T : List LD} : ChainTail r T → ChainTail r (.W1 :: .W0 :: T) + | buf {B T : List LD} : + IsBuffer r B → ChainTail r T → + ChainTail r ((([.W1, .W0] : List LD) ^ (2 * r)) ++ (B ++ T)) + +theorem ChainTail_pow_pair : ∀ (k : ℕ) {r : ℕ} {T : List LD}, + ChainTail r T → ChainTail r ((([.W1, .W0] : List LD) ^ k) ++ T) + | 0, _, _, h => h + | k + 1, _, _, h => ChainTail.pair (ChainTail_pow_pair k h) + +theorem ChainTail_step {r : ℕ} {T : List LD} (hT : ChainTail (r + 1) T) + {u u' : List LD} (hu : macroStepFinite u = some u') : + ∃ (n : ℕ) (W' T' : List LD), + LIncsP n (T ++ u) W' ∧ + LOv2 W' [.W0, .W0] ([.W0, .W0, .W1, .W0] ++ (T' ++ u')) ∧ + ChainTail r T' := by + induction hT with + | nil => + rcases macroStepFinite_spec hu with ⟨nu, up, h_up, h_ovu⟩ + have h_2 : ((([.W1, .W0] : List LD) ^ (2 * (r + 1))) ++ u) = + ((([.W1, .W0] : List LD) ^ (2 * r)) ++ ([.W1, .W0, .W1, .W0] ++ u)) := by + have : 2 * (r + 1) = 2 * r + 2 := by omega + rw [this, list_pow_add, List.append_assoc]; rfl + rw [h_2] + have h_lp2 : LIncsP (2 * (2 * nu + 1) + 1) ([.W1, .W0, .W1, .W0] ++ u) ([.W1, .W1, .W1, .W1] ++ + up) := + .w10 (.w10 h_up) + rcases LIncsP_pow_10 (2 * r) h_lp2 with ⟨n_all, h_all⟩ + refine ⟨n_all, _, ([.W1, .W0] : List LD) ^ (2 * r), h_all, ?_, .nil⟩ + exact LOv2_append (LOv2_pow_11 (2 * r) u') h_ovu + | @pair T₀ _ ih => + rcases ih with ⟨n₀, W₀', T₀', h_lp0, h_ov0, h_ct0⟩ + refine ⟨2 * n₀ + 1, .W1 :: .W1 :: W₀', .W1 :: .W0 :: T₀', .w10 h_lp0, ?_, .pair h_ct0⟩ + exact .w11_0 h_ov0 + | @buf B T₀ hB _ ih => + rcases ih with ⟨n₀, W₀', T₀', h_lp0, h_ov0, h_ct0⟩ + rcases stepBuffer_spec hB with ⟨nB, bp, B', h_lpB, hB', h_ovB⟩ + have h_2 : ((([.W1, .W0] : List LD) ^ (2 * (r + 1))) ++ (B ++ T₀) ++ u) = + ((([.W1, .W0] : List LD) ^ (2 * r)) ++ ([.W1, .W0, .W1, .W0] ++ B ++ (T₀ ++ u))) := by + have : 2 * (r + 1) = 2 * r + 2 := by omega + rw [this, list_pow_add] + simp only [List.append_assoc]; rfl + rw [h_2] + rcases LIncsP_append (.w10 (.w10 h_lpB)) h_lp0 with ⟨n_mid, h_mid⟩ + rcases LIncsP_pow_10 (2 * r) h_mid with ⟨n_all, h_all⟩ + refine ⟨n_all, _, ((([.W1, .W0] : List LD) ^ (2 * r)) ++ (B' ++ T₀')), h_all, ?_, .buf hB' + h_ct0⟩ + have h_ov_mid : LOv2 (([.W1, .W1, .W1, .W1] ++ bp) ++ W₀') [.W0, .W0] + ([.W0, .W0, .W1, .W0] ++ (B' ++ (T₀' ++ u'))) := + LOv2_append (h_ovB (T₀' ++ u')) h_ov0 + have h_ov_top := LOv2_append (LOv2_pow_11 (2 * r) (B' ++ (T₀' ++ u'))) h_ov_mid + simpa only [List.append_assoc] using! h_ov_top + +theorem ChainTail_zero_lincsp {T : List LD} (hT : ChainTail 0 T) : + ∃ n T', LIncsP n T T' := by + induction hT with + | nil => exact ⟨0, [], .nil⟩ + | pair _ ih => + rcases ih with ⟨n, T', h⟩ + exact ⟨2 * n + 1, .W1 :: .W1 :: T', .w10 h⟩ + | @buf B T₀ hB _ ih => + rcases ih with ⟨n, T', h⟩ + unfold IsBuffer checkBuffer at hB + cases h_lp : lincspFinite B with + | none => rw [h_lp] at hB; nomatch hB + | some bp => + rcases LIncsP_append (lincspFinite_sound h_lp) h with ⟨k, hk⟩ + exact ⟨k, bp ++ T', hk⟩ + +inductive Only011 : List LD → Prop + | nil : Only011 [] + | w0 {xs : List LD} : Only011 xs → Only011 (.W0 :: xs) + | w11 {xs : List LD} : Only011 xs → Only011 (.W1 :: .W1 :: xs) + +theorem Only011_append {a b : List LD} (ha : Only011 a) (hb : Only011 b) : + Only011 (a ++ b) := by + induction ha with + | nil => exact hb + | w0 _ ih => exact .w0 ih + | w11 _ ih => exact .w11 ih + +theorem LIncsP_only011 {n : ℕ} {x x' : List LD} (h : LIncsP n x x') : Only011 x' := by + induction h with + | nil => exact .nil + | w0 _ ih => exact .w0 ih + | w10 _ ih => exact .w11 ih + | w11 _ ih => exact .w11 ih + +def checkOnly011 : List LD → Bool + | [] => true + | .W0 :: xs => checkOnly011 xs + | .W1 :: .W1 :: xs => checkOnly011 xs + | _ => false + +theorem checkOnly011_sound : ∀ {w : List LD}, checkOnly011 w = true → Only011 w + | [], _ => .nil + | .W0 :: xs, h => .w0 (checkOnly011_sound h) + | .W1 :: .W1 :: xs, h => .w11 (checkOnly011_sound h) + | [.W1], h => by nomatch h + | .W1 :: .W0 :: _, h => by nomatch h + +/-- LSB-first positional binary value relation over two chosen digit tokens `d0, d1 : Tok`. -/ +inductive DigitVal {Tok : Type*} (d0 d1 : Tok) : Nat → Nat → List Tok → Prop where + | nil : DigitVal d0 d1 0 0 [] + | zero {A H : Nat} {u : List Tok} : DigitVal d0 d1 A H u → DigitVal d0 d1 (A * 2) (1 + H) (d0 :: + u) + | one {A H : Nat} {u : List Tok} : DigitVal d0 d1 A H u → DigitVal d0 d1 (1 + A * 2) (1 + H) (d1 + :: u) + +theorem digitVal_exists {Tok : Type*} (d0 d1 : Tok) (H : Nat) : + ∀ A, A < 2 ^ H → ∃ u, DigitVal d0 d1 A H u := by + induction H with + | zero => + intro A hA + have h0 : A = 0 := by omega + subst h0; exact ⟨[], DigitVal.nil⟩ + | succ H ih => + intro A hA + have hpow : 2 ^ (H + 1) = 2 ^ H * 2 := Nat.pow_succ 2 H + have h1H : H + 1 = 1 + H := by omega + rcases Nat.even_or_odd' A with ⟨a, rfl | rfl⟩ + · rcases ih a (by omega) with ⟨u, hI⟩ + have ha2 : 2 * a = a * 2 := Nat.mul_comm 2 a + rw [h1H, ha2]; exact ⟨d0 :: u, DigitVal.zero hI⟩ + · rcases ih a (by omega) with ⟨u, hI⟩ + have ha2 : 2 * a + 1 = 1 + a * 2 := by omega + rw [h1H, ha2]; exact ⟨d1 :: u, DigitVal.one hI⟩ + +theorem digitVal_append {Tok : Type*} {d0 d1 : Tok} {A H : Nat} {u : List Tok} + (h1 : DigitVal d0 d1 A H u) : + ∀ {B J : Nat} {v : List Tok}, + DigitVal d0 d1 B J v → DigitVal d0 d1 (A + B * 2 ^ H) (H + J) (u ++ v) := by + induction h1 with + | nil => + intro B J v h2 + simpa using h2 + | @zero A H u _ ih => + intro B J v h2 + have h3 := DigitVal.zero (ih h2) + have heq1 : (A + B * 2 ^ H) * 2 = A * 2 + B * 2 ^ (1 + H) := by + rw [Nat.add_comm 1 H, Nat.pow_succ]; ring + have heq2 : 1 + (H + J) = (1 + H) + J := by omega + rwa [heq1, heq2] at h3 + | @one A H u _ ih => + intro B J v h2 + have h3 := DigitVal.one (ih h2) + have heq1 : 1 + (A + B * 2 ^ H) * 2 = (1 + A * 2) + B * 2 ^ (1 + H) := by + rw [Nat.add_comm 1 H, Nat.pow_succ]; ring + have heq2 : 1 + (H + J) = (1 + H) + J := by omega + rwa [heq1, heq2] at h3 + +end BinaryCounterAlgebra + +-- ============================================================================ +-- 4B. Recursive Capacity Counter (`LTok`, `cap`, `dec_l`) +-- ============================================================================ + +section CapacityCounter + +/-- Canonical 3-token alphabet for 1-mode capacity counters: + `L0` (odd capacity `2c + 1`), `L1` (even capacity `2c`), `L2` (halving frame `c / 2`). -/ +inductive LTok where + | L0 + | L1 + | L2 + deriving DecidableEq, Repr + +@[simp] +def cap : List LTok → Nat + | [] => 0 + | .L0 :: l => 2 * cap l + 1 + | .L1 :: l => 2 * cap l + | .L2 :: l => cap l / 2 + +@[simp] +def dec_l_fuel : Nat → List LTok → List LTok + | 0, l => l + | _ + 1, [] => [] + | _ + 1, .L0 :: l => .L1 :: l + | n + 1, .L1 :: l => .L0 :: dec_l_fuel n l + | n + 1, .L2 :: l => .L2 :: dec_l_fuel n (dec_l_fuel n l) + +def dec_l (l : List LTok) : List LTok := dec_l_fuel l.length l + +@[scoped simp] +theorem length_dec_l_fuel (n : Nat) (l : List LTok) : (dec_l_fuel n l).length = l.length := by + induction n generalizing l with + | zero => rfl + | succ n ih => + cases l with + | nil => rfl + | cons t tl => cases t <;> simp [dec_l_fuel, ih] + +@[scoped simp] +theorem length_dec_l (l : List LTok) : (dec_l l).length = l.length := + length_dec_l_fuel l.length l + +@[scoped simp] theorem dec_l_nil : dec_l [] = [] := rfl +@[scoped simp] theorem dec_l_L0 (l : List LTok) : dec_l (.L0 :: l) = .L1 :: l := rfl +@[scoped simp] theorem dec_l_L1 (l : List LTok) : dec_l (.L1 :: l) = .L0 :: dec_l l := rfl +@[scoped simp] theorem dec_l_L2 (l : List LTok) : dec_l (.L2 :: l) = .L2 :: dec_l (dec_l l) := by + simp only [dec_l, List.length_cons, dec_l_fuel, length_dec_l_fuel] + +theorem cap_dec_l_aux (n : Nat) : + ∀ l : List LTok, l.length ≤ n → cap l ≥ 1 → cap (dec_l l) = cap l - 1 := by + induction n with + | zero => + intro l hlen h + cases l <;> simp at hlen h + | succ n ih => + intro l hlen h + cases l with + | nil => simp at h + | cons t l => + simp only [List.length_cons, Nat.add_le_add_iff_right] at hlen + cases t with + | L0 => simp + | L1 => + simp only [cap, dec_l_L1] at h ⊢ + have h1 : cap l ≥ 1 := by omega + rw [ih l hlen h1]; omega + | L2 => + simp only [cap, dec_l_L2] at h ⊢ + have h2 : cap l ≥ 1 := by omega + have ih1 := ih l hlen h2 + have h3 : cap (dec_l l) ≥ 1 := by omega + have ih2 := ih (dec_l l) (by rw [length_dec_l]; exact hlen) h3 + rw [ih2, ih1]; omega + +theorem cap_dec_l (l : List LTok) (h : cap l ≥ 1) : cap (dec_l l) = cap l - 1 := + cap_dec_l_aux l.length l (Nat.le_refl _) h + +end CapacityCounter + +-- ============================================================================ +-- 4C. Multi-Stage Counter (`add_last`, `bump_enc`, `ValidKS`, `GoodKS`) +-- ============================================================================ + +section MultiStageCounter + +def add_last : List ℕ → ℕ → List ℕ + | [], _ => [] + | [x], c => [x + c] + | x :: y :: rest, c => x :: add_last (y :: rest) c + +theorem add_last_cons (x : ℕ) {ks : List ℕ} (hne : ks ≠ []) (c : ℕ) : + add_last (x :: ks) c = x :: add_last ks c := by + cases ks with + | nil => contradiction + | cons _ _ => rfl + +@[scoped simp] theorem add_last_length : ∀ (ks : List ℕ) (c : ℕ), (add_last ks c).length = ks.length + | [], _ => rfl + | [_], _ => rfl + | _ :: _ :: _, _ => by simp [add_last, add_last_length] + +@[scoped simp] theorem add_last_ne_nil : ∀ (ks : List ℕ) (c : ℕ), ks ≠ [] → add_last ks c ≠ [] + | [], _, h => absurd rfl h + | [_], _, _ => by simp [add_last] + | _ :: _ :: _, _, _ => by simp [add_last] + +@[scoped simp] theorem add_last_zero : ∀ (ks : List ℕ), add_last ks 0 = ks + | [] => rfl + | [x] => by simp [add_last] + | x :: y :: rest => by simp [add_last, add_last_zero] + +theorem add_last_add : ∀ (ks : List ℕ) (a b : ℕ), + add_last (add_last ks a) b = add_last ks (a + b) + | [], _, _ => rfl + | [x], a, b => by simp [add_last, Nat.add_assoc] + | x :: y :: rest, a, b => by + have hne : add_last (y :: rest) a ≠ [] := add_last_ne_nil (y :: rest) a (by simp) + rw [add_last_cons x (by simp), add_last_cons x hne, add_last_cons x (by simp), add_last_add] + +def bump_enc (k₀ : ℕ) : List ℕ → ℕ × List ℕ + | [] => (k₀ + 3, []) + | k₁ :: ks => (k₀, add_last (k₁ :: ks) 3) + +def bump_enc_twice (m₀ : ℕ) (ms : List ℕ) : ℕ × List ℕ := + let p := bump_enc m₀ ms + bump_enc p.1 p.2 + +theorem bump_enc_nonempty (k₀ : ℕ) {ks : List ℕ} (hne : ks ≠ []) : + bump_enc k₀ ks = (k₀, add_last ks 3) := by + cases ks with + | nil => contradiction + | cons _ _ => rfl + +theorem bump_enc_twice_nonempty (m₀ : ℕ) {ms : List ℕ} (hne : ms ≠ []) : + bump_enc_twice m₀ ms = (m₀, add_last ms 6) := by + unfold bump_enc_twice + rw [bump_enc_nonempty m₀ hne, bump_enc_nonempty m₀ (add_last_ne_nil ms 3 hne), add_last_add] + +def ValidKS : List ℕ → Prop + | [] => True + | [_] => True + | k :: k' :: rest => k ≥ 1 ∧ ValidKS (k' :: rest) + +theorem ValidKS_add_last : ∀ (ks : List ℕ) (c : ℕ), ValidKS ks → ValidKS (add_last ks c) + | [], _, _ => trivial + | [_], _, _ => trivial + | k :: y :: rest, c, ⟨hk, hrest⟩ => by + have hne : add_last (y :: rest) c ≠ [] := add_last_ne_nil (y :: rest) c (by simp) + cases h_al : add_last (y :: rest) c with + | nil => exact absurd h_al hne + | cons z zs => + simp only [add_last, h_al, ValidKS] + have h_ih := ValidKS_add_last (y :: rest) c hrest + rw [h_al] at h_ih + exact ⟨hk, h_ih⟩ + +theorem ValidKS_bump_enc (k₀ : ℕ) (ks : List ℕ) (h : ValidKS ks) : ValidKS (bump_enc k₀ ks).2 := by + cases ks with + | nil => trivial + | cons k₁ rest => exact ValidKS_add_last (k₁ :: rest) 3 h + +def GoodKS (s : ℕ) : List ℕ → Prop + | [] => True + | k :: rest => s ≤ 35 * (k + 2) ∧ GoodKS (s + 63 * (k + 2)) rest + +theorem GoodKS_mono : ∀ (ks : List ℕ) (s₁ s₂ : ℕ), s₁ ≤ s₂ → GoodKS s₂ ks → GoodKS s₁ ks + | [], _, _, _, _ => trivial + | k :: rest, s₁, s₂, hle, ⟨h1, h2⟩ => + ⟨by omega, GoodKS_mono rest (s₁ + 63 * (k + 2)) (s₂ + 63 * (k + 2)) (by omega) h2⟩ + +theorem GoodKS_add_last : ∀ (ks : List ℕ) (s c : ℕ), GoodKS s ks → GoodKS s (add_last ks c) + | [], _, _, _ => trivial + | [k], s, c, ⟨h1, _⟩ => ⟨by omega, trivial⟩ + | k :: y :: rest, s, c, ⟨h1, h2⟩ => + ⟨h1, GoodKS_add_last (y :: rest) (s + 63 * (k + 2)) c h2⟩ + +theorem GoodKS_valid : ∀ (ks : List ℕ) (s : ℕ), s ≥ 71 → GoodKS s ks → ValidKS ks + | [], _, _, _ => trivial + | [_], _, _, _ => trivial + | k :: y :: rest, s, hs, ⟨h1, h2⟩ => + ⟨by omega, GoodKS_valid (y :: rest) (s + 63 * (k + 2)) (by omega) h2⟩ + +theorem GoodKS_succ_valid (s w : ℕ) (ws : List ℕ) (h : GoodKS s ((w + 1) :: ws)) : + ValidKS ((w + 1) :: ws) := by + cases ws with + | nil => trivial + | cons y rest => + exact ⟨by omega, GoodKS_valid (y :: rest) (s + 63 * (w + 1 + 2)) (by omega) h.2⟩ + +def InvNil (k₀ : ℕ) (ks : List ℕ) : Prop := + (ks = [] ∧ k₀ ≥ 5) ∨ + (ks ≠ [] ∧ GoodKS (if k₀ = 1 then 81 else 36 * (k₀ + 2)) ks) + +end MultiStageCounter + +-- ============================================================================ +-- 4D. Call-Stack Segment Counter (`Side`, `Seg`) +-- ============================================================================ + +section CallCounter + +variable {Call Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +/-- Multi-call right-half-tape transduction relation parameterized by `CallStep`. -/ +inductive Side (CallStep : Call → ListBlank Γ → ListBlank Γ → Prop) : + List Call → ListBlank Γ → ListBlank Γ → Prop where + | nil (r : ListBlank Γ) : Side CallStep [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : ListBlank Γ} : + CallStep c r1 r2 → Side CallStep ls r2 r3 → Side CallStep (c :: ls) r1 r3 + +/-- Segment transformer lifting `Side CallStep ls_out` to `Side CallStep ls_in` across finite words + `w1 ↦ w2`. -/ +def Seg (CallStep : Call → ListBlank Γ → ListBlank Γ → Prop) + (ls_in ls_out : List Call) (w1 w2 : List Γ) : Prop := + ∀ r1 r2, Side CallStep ls_out r1 r2 → Side CallStep ls_in (w1 +> r1) (w2 +> r2) + +theorem Side_append {CallStep : Call → ListBlank Γ → ListBlank Γ → Prop} + {ls1 ls2 : List Call} {r1 r2 r3 : ListBlank Γ} + (h1 : Side CallStep ls1 r1 r2) (h2 : Side CallStep ls2 r2 r3) : + Side CallStep (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) + +theorem Side_split {CallStep : Call → ListBlank Γ → ListBlank Γ → Prop} + {ls1 ls2 : List Call} {r1 r3 : ListBlank Γ} + (h : Side CallStep (ls1 ++ ls2) r1 r3) : + ∃ r2, Side CallStep ls1 r1 r2 ∧ Side CallStep ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1, Side.nil r1, h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc, hrest⟩ + rcases ih hrest with ⟨r2, h1, h2⟩ + exact ⟨r2, Side.cons hc h1, h2⟩ + +theorem Seg_nil {CallStep : Call → ListBlank Γ → ListBlank Γ → Prop} (w : List Γ) : + Seg CallStep [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) + +theorem Seg_refl {CallStep : Call → ListBlank Γ → ListBlank Γ → Prop} (ls : List Call) : + Seg CallStep ls ls [] [] := by + intro r1 r2 h; exact h + +theorem Seg_apply {CallStep : Call → ListBlank Γ → ListBlank Γ → Prop} + {ls1 ls2 : List Call} {w1 w2 : List Γ} {r1 r2 : ListBlank Γ} + (h1 : Seg CallStep ls1 ls2 w1 w2) (h2 : Side CallStep ls2 r1 r2) : + Side CallStep ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 + +theorem Seg_par {CallStep : Call → ListBlank Γ → ListBlank Γ → Prop} + {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : List Γ} + (h1 : Seg CallStep ls1 ls2 w1 w2) (h2 : Seg CallStep ls3 ls4 w2 w3) : + Seg CallStep (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases Side_split h with ⟨r2, ha, hb⟩ + exact Side_append (h1 r1 r2 ha) (h2 r2 r3 hb) + +theorem Seg_seq {CallStep : Call → ListBlank Γ → ListBlank Γ → Prop} + {ls1 ls2 ls3 : List Call} {w1 w2 v1 v2 : List Γ} + (h1 : Seg CallStep ls1 ls2 w1 w2) (h2 : Seg CallStep ls2 ls3 v1 v2) : + Seg CallStep ls1 ls3 (w1 ++ v1) (w2 ++ v2) := by + intro r1 r2 h + rw [listblank_append_assoc, listblank_append_assoc] + exact h1 (v1 +> r1) (v2 +> r2) (h2 r1 r2 h) + +end CallCounter + +-- ============================================================================ +-- 5. General Non-Halting & Halting Era Closure Combinators +-- ============================================================================ + +section EraClosure + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +theorem isSome_step_of_multiStep_gt {M : Machine Γ Λ} {c₀ c c' : Cfg Γ Λ} {n M_steps : ℕ} + (hn : multiStep M c₀ n = some c) + (hM : multiStep M c₀ M_steps = some c') + (h_lt : n < M_steps) : + (step M c).isSome := by + obtain ⟨d, hd⟩ : ∃ d, M_steps = (n + 1) + d := ⟨M_steps - (n + 1), by omega⟩ + rw [hd] at hM + cases h_step : step M c with + | some c₁ => simp + | none => + have h_n1 : multiStep M c₀ (n + 1) = none := by + rw [multiStep_succ, hn, Option.bind, h_step] + have h_none : ∀ k, multiStep M c₀ ((n + 1) + k) = none := by + intro k + induction k with + | zero => exact h_n1 + | succ k ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind] + rw [h_none d] at hM + cases hM + +theorem does_not_halt_of_arbitrarily_long {M : Machine Γ Λ} {c_init : Cfg Γ Λ} + (h_long : ∀ N : ℕ, ∃ k ≥ N, ∃ c', c_init [M]⊢^{k} c') : + ∀ (cfg : Cfg Γ Λ), (c_init [M]⊢* cfg) → (step M cfg).isSome := by + intro cfg ⟨n, hn⟩ + obtain ⟨k, hk, c', hc'⟩ := h_long (n + 1) + exact isSome_step_of_multiStep_gt hn hc' (by omega) + +theorem does_not_halt_of_invariant {M : Machine Γ Λ} {c_init : Cfg Γ Λ} (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ c₀, (c_init [M]⊢* c₀) ∧ Inv c₀) + (h_step : ∀ c, Inv c → ∃ c', (c [M]⊢⁺ c') ∧ Inv c') : + ∀ (cfg : Cfg Γ Λ), (c_init [M]⊢* cfg) → (step M cfg).isSome := by + rcases h_init with ⟨c₀, ⟨n₀, hn₀⟩, h_inv₀⟩ + have h_chain : ∀ m : ℕ, ∃ k ≥ m, ∃ c, (c₀ [M]⊢^{k} c) ∧ Inv c := by + intro m + induction m with + | zero => exact ⟨0, by omega, c₀, rfl, h_inv₀⟩ + | succ m ih => + rcases ih with ⟨k, hk, c, hc, h_inv⟩ + rcases h_step c h_inv with ⟨c', ⟨d, hd, hc'⟩, h_inv'⟩ + exact ⟨k + d, by omega, c', multiStep_trans M c₀ c c' k d hc hc', h_inv'⟩ + apply does_not_halt_of_arbitrarily_long + intro N + rcases h_chain N with ⟨k, hk, c, hc, _⟩ + exact ⟨n₀ + k, by omega, c, multiStep_trans M c_init c₀ c n₀ k hn₀ hc⟩ + +theorem does_not_halt_of_stepPlus_chain {M : Machine Γ Λ} + (C : ℕ → Cfg Γ Λ) (i₀ : ℕ) + (h_init : (init []) [M]⊢* C i₀) + (h_chain : ∀ i ≥ i₀, (C i) [M]⊢⁺ (C (i + 1))) : + ∀ (cfg : Cfg Γ Λ), ((init []) [M]⊢* cfg) → (step M cfg).isSome := by + refine does_not_halt_of_invariant (fun cfg => ∃ i ≥ i₀, cfg = C i) ?_ ?_ + · exact ⟨C i₀, h_init, i₀, le_rfl, rfl⟩ + · rintro _ ⟨i, hi, rfl⟩ + exact ⟨C (i + 1), h_chain i hi, i + 1, by omega, rfl⟩ + +def flipDir : Dir → Dir + | Dir.left => Dir.right + | Dir.right => Dir.left + +def conjStmt (f : Bool) : Stmt Γ → Stmt Γ + | ⟨w, d⟩ => ⟨w, if f then flipDir d else d⟩ + +instance [DecidableEq Γ] : DecidableEq (Stmt Γ) := + fun ⟨s₁, d₁⟩ ⟨s₂, d₂⟩ => + if hs : s₁ = s₂ then + if hd : d₁ = d₂ then isTrue (by subst hs hd; rfl) + else isFalse (fun h => hd (Stmt.write.inj h).2) + else isFalse (fun h => hs (Stmt.write.inj h).1) + +def conjOut (σ : Λ → Λ) (f : Bool) : + Option Λ × Stmt Γ → Option Λ × Stmt Γ + | (q', st) => (q'.map σ, conjStmt f st) + +def mirrorTape (f : Bool) (T : Tape Γ) : Tape Γ := + if f then ⟨T.head, T.right, T.left⟩ else T + +def conjCfg (σ : Λ → Λ) (f : Bool) (c : Cfg Γ Λ) : Cfg Γ Λ := + ⟨c.q.map σ, mirrorTape f c.tape⟩ + +theorem head_mirrorTape (f : Bool) (T : Tape Γ) : (mirrorTape f T).head = T.head := by + cases f <;> rfl + +theorem mirrorTape_write (f : Bool) (T : Tape Γ) (w : Γ) : + mirrorTape f (T.write w) = (mirrorTape f T).write w := by + cases f <;> rfl + +theorem mirrorTape_move (f : Bool) (T : Tape Γ) (d : Dir) : + mirrorTape f (T.move d) = (mirrorTape f T).move (if f then flipDir d else d) := by + cases f <;> cases d <;> rfl + +theorem step_conj_of_tableIso {M_tgt M_src : Machine Γ Λ} {σ : Λ → Λ} {f : Bool} + (h_iso : ∀ (q : Λ) (a : Γ), M_tgt (σ q) a = (M_src q a).map (conjOut σ f)) + (c : Cfg Γ Λ) : + step M_tgt (conjCfg σ f c) = (step M_src c).map (conjCfg σ f) := by + rcases c with ⟨_ | q, T⟩ + · rfl + · simp only [conjCfg, step, Option.map_some, head_mirrorTape, h_iso q T.head, Option.map_map] + congr 1 + funext ⟨q', w, d⟩ + simp only [Function.comp_apply, conjOut, conjStmt, conjCfg, mirrorTape_write, mirrorTape_move] + +theorem multiStep_conj_of_tableIso {M_tgt M_src : Machine Γ Λ} {σ : Λ → Λ} {f : Bool} + (h_iso : ∀ (q : Λ) (a : Γ), M_tgt (σ q) a = (M_src q a).map (conjOut σ f)) + (c : Cfg Γ Λ) (k : ℕ) : + multiStep M_tgt (conjCfg σ f c) k = (multiStep M_src c k).map (conjCfg σ f) := by + induction k with + | zero => rfl + | succ k ih => + rw [multiStep_succ, multiStep_succ, ih] + cases multiStep M_src c k with + | none => rfl + | some W => simp [step_conj_of_tableIso h_iso] + +theorem does_not_halt_of_conj_invariant {M_tgt M_src : Machine Γ Λ} {σ : Λ → Λ} {f : Bool} + (h_iso : ∀ (q : Λ) (a : Γ), M_tgt (σ q) a = (M_src q a).map (conjOut σ f)) + (Inv : Cfg Γ Λ → Prop) + (h_init : ∃ c₀, ((init []) [M_tgt]⊢* conjCfg σ f c₀) ∧ Inv c₀) + (h_step : ∀ c, Inv c → ∃ c', (c [M_src]⊢⁺ c') ∧ Inv c') : + ∀ (cfg : Cfg Γ Λ), ((init []) [M_tgt]⊢* cfg) → (step M_tgt cfg).isSome := by + refine does_not_halt_of_invariant (fun cfg => ∃ c, cfg = conjCfg σ f c ∧ Inv c) ?_ ?_ + · rcases h_init with ⟨c₀, h_reach, h_inv₀⟩ + exact ⟨conjCfg σ f c₀, h_reach, c₀, rfl, h_inv₀⟩ + · rintro _ ⟨c, rfl, h_inv⟩ + rcases h_step c h_inv with ⟨c', ⟨k, hk_pos, h_ms⟩, h_inv'⟩ + refine ⟨conjCfg σ f c', ⟨k, hk_pos, ?_⟩, c', rfl, h_inv'⟩ + rw [multiStep_conj_of_tableIso h_iso c k, h_ms, Option.map_some] + +theorem does_not_halt_of_conj_stem {M_tgt M_src : Machine Γ Λ} {σ : Λ → Λ} {f : Bool} + (h_iso : ∀ (q : Λ) (a : Γ), M_tgt (σ q) a = (M_src q a).map (conjOut σ f)) + (c₁ : Cfg Γ Λ) + (h_stem : (init []) [M_tgt]⊢* conjCfg σ f c₁) + (h_src : ∀ cfg : Cfg Γ Λ, (c₁ [M_src]⊢* cfg) → (step M_src cfg).isSome) : + ∀ (cfg : Cfg Γ Λ), ((init []) [M_tgt]⊢* cfg) → (step M_tgt cfg).isSome := by + rcases h_stem with ⟨k₀, hk₀⟩ + intro cfg ⟨n, hn⟩ + by_cases hlt : n < k₀ + · exact isSome_step_of_multiStep_gt hn hk₀ hlt + · have h_split : n = k₀ + (n - k₀) := by omega + rw [h_split, multiStep_add, hk₀] at hn + dsimp [Option.bind] at hn + rw [multiStep_conj_of_tableIso h_iso c₁ (n - k₀)] at hn + rcases Option.map_eq_some_iff.mp hn with ⟨c, hc, rfl⟩ + have hsome := h_src c ⟨n - k₀, hc⟩ + rw [step_conj_of_tableIso h_iso c, Option.isSome_map] + exact hsome + +theorem init_reaches_conjCfg_default {M_tgt : Machine (Fin 2) (Fin 6)} + {σ : Fin 6 → Fin 6} {f : Bool} {q₀ : Fin 6} (hq : σ q₀ = 0) : + (init []) [M_tgt]⊢* conjCfg σ f ((default : ListBlank (Fin 2)) {{q₀}}> default) := by + refine ⟨0, ?_⟩ + cases f <;> simp [multiStep, conjCfg, mirrorTape, init, Tape.mk₁, Tape.mk₂, Tape.mk', hq] + +end EraClosure + +-- ============================================================================ +-- 9. Inductive Tape Binary Counter (RC and FC) +-- ============================================================================ + +section InductiveTapeCounter + +def rd0 : List (Fin 2) := [0, 0, 0, 0] + +@[scoped simp] theorem rd0_append_default : rd0 +> (default : ListBlank (Fin 2)) = default := by + simp [rd0] + +@[scoped simp] theorem three_zeros_append_default : + ([0, 0, 0] : List (Fin 2)) +> (default : ListBlank (Fin 2)) = default := by + simp + +inductive RC (d : List (Fin 2)) : Nat → ListBlank (Fin 2) → Prop + | zero : RC d 0 default + | d0 (n : Nat) (r : ListBlank (Fin 2)) : RC d n r → RC d (n * 2) (rd0 +> r) + | d1 (n : Nat) (r : ListBlank (Fin 2)) : RC d n r → RC d (1 + n * 2) (d +> r) + +inductive FC (d : List (Fin 2)) (tail : ListBlank (Fin 2)) : Nat → Nat → ListBlank (Fin 2) → Prop + | nil : FC d tail 0 0 tail + | d0 (k n : Nat) (r : ListBlank (Fin 2)) : FC d tail k n r → FC d tail (k + 1) (n * 2) (rd0 +> r) + | d1 (k n : Nat) (r : ListBlank (Fin 2)) : FC d tail k n r → FC d tail (k + 1) (1 + n * 2) (d +> + r) + +theorem RC_eq {d : List (Fin 2)} {n m : Nat} {r s : ListBlank (Fin 2)} + (h : RC d n r) (hn : n = m) (hr : r = s) : RC d m s := by + subst hn; subst hr; exact h + +theorem FC_eq {d : List (Fin 2)} {tail : ListBlank (Fin 2)} {k k' n n' : Nat} {r r' : ListBlank (Fin + 2)} + (h : FC d tail k n r) (hk : k = k') (hn : n = n') (hr : r = r') : + FC d tail k' n' r' := by + subst hk; subst hn; subst hr; exact h + +theorem RC_zero_unique {d : List (Fin 2)} {r : ListBlank (Fin 2)} (h : RC d 0 r) : r = default := by + generalize hn : (0 : Nat) = n at h + induction h with + | zero => rfl + | d0 n r _ ih => + have hn0 : n = 0 := by omega + rw [ih hn0.symm, rd0_append_default] + | d1 _ _ _ _ => omega + +theorem RC_inv_d0 {d : List (Fin 2)} {n : Nat} {s : ListBlank (Fin 2)} (hs : RC d (n * 2) s) : + (n = 0 ∧ s = default) ∨ ∃ s0, s = rd0 +> s0 ∧ RC d n s0 := by + generalize hm : n * 2 = m at hs + cases hs with + | zero => exact Or.inl ⟨by omega, rfl⟩ + | d0 n0 s0 hs0 => + have hn : n0 = n := by omega + subst hn + exact Or.inr ⟨s0, rfl, hs0⟩ + | d1 _ _ _ => omega + +theorem RC_inv_d1 {d : List (Fin 2)} {n : Nat} {s : ListBlank (Fin 2)} (hs : RC d (1 + n * 2) s) : + ∃ s0, s = d +> s0 ∧ RC d n s0 := by + generalize hm : 1 + n * 2 = m at hs + cases hs with + | zero => omega + | d0 _ _ _ => omega + | d1 n0 s0 hs0 => + have hn : n0 = n := by omega + subst hn + exact ⟨s0, rfl, hs0⟩ + +theorem FC_inv_nil {d : List (Fin 2)} {tail : ListBlank (Fin 2)} {n : Nat} {s : ListBlank (Fin 2)} + (hs : FC d tail 0 n s) : s = tail := by + generalize hk : (0 : Nat) = k at hs + cases hs with + | nil => rfl + | d0 _ _ _ _ => omega + | d1 _ _ _ _ => omega + +theorem FC_inv_d0 {d : List (Fin 2)} {tail : ListBlank (Fin 2)} {k n : Nat} {s : ListBlank (Fin 2)} + (hs : FC d tail (k + 1) (n * 2) s) : ∃ s0, s = rd0 +> s0 ∧ FC d tail k n s0 := by + generalize hk : k + 1 = K, hm : n * 2 = m at hs + cases hs with + | nil => omega + | d0 k0 n0 s0 hs0 => + have hk0 : k0 = k := by omega + have hn0 : n0 = n := by omega + subst hk0; subst hn0 + exact ⟨s0, rfl, hs0⟩ + | d1 _ _ _ _ => omega + +theorem FC_inv_d1 {d : List (Fin 2)} {tail : ListBlank (Fin 2)} {k n : Nat} {s : ListBlank (Fin 2)} + (hs : FC d tail (k + 1) (1 + n * 2) s) : ∃ s0, s = d +> s0 ∧ FC d tail k n s0 := by + generalize hk : k + 1 = K, hm : 1 + n * 2 = m at hs + cases hs with + | nil => omega + | d0 _ _ _ _ => omega + | d1 k0 n0 s0 hs0 => + have hk0 : k0 = k := by omega + have hn0 : n0 = n := by omega + subst hk0; subst hn0 + exact ⟨s0, rfl, hs0⟩ + +theorem RC_unique {d : List (Fin 2)} {n : Nat} {r s : ListBlank (Fin 2)} + (hr : RC d n r) (hs : RC d n s) : r = s := by + induction hr generalizing s with + | zero => exact (RC_zero_unique hs).symm + | d0 n r hr ih => + rcases RC_inv_d0 hs with ⟨rfl, rfl⟩ | ⟨s0, rfl, hs0⟩ + · rw [RC_zero_unique hr, rd0_append_default] + · rw [ih hs0] + | d1 n r _ ih => + rcases RC_inv_d1 hs with ⟨s0, rfl, hs0⟩ + rw [ih hs0] + +theorem FC_unique {d : List (Fin 2)} {tail : ListBlank (Fin 2)} {k n : Nat} {r s : ListBlank (Fin + 2)} + (hr : FC d tail k n r) (hs : FC d tail k n s) : r = s := by + induction hr generalizing s with + | nil => exact (FC_inv_nil hs).symm + | d0 k n r _ ih => + rcases FC_inv_d0 hs with ⟨s0, rfl, hs0⟩ + rw [ih hs0] + | d1 k n r _ ih => + rcases FC_inv_d1 hs with ⟨s0, rfl, hs0⟩ + rw [ih hs0] + +theorem pow2_pos (k : Nat) : 0 < 2 ^ k := Nat.two_pow_pos k + +theorem FC_zero (d : List (Fin 2)) (tail : ListBlank (Fin 2)) (k : Nat) : + FC d tail k 0 (rd0 ^ k +> tail) := by + induction k with + | zero => exact FC.nil + | succ k ih => + rw [right_pow_succ rd0 k tail] + exact FC_eq (FC.d0 k 0 (rd0 ^ k +> tail) ih) rfl (by omega) rfl + +theorem FC_full (d : List (Fin 2)) (tail : ListBlank (Fin 2)) (k : Nat) : + FC d tail k (2 ^ k - 1) (d ^ k +> tail) := by + induction k with + | zero => exact FC.nil + | succ k ih => + have hp := pow2_pos k + rw [right_pow_succ d k tail] + exact FC_eq (FC.d1 k (2 ^ k - 1) (d ^ k +> tail) ih) rfl (by rw [Nat.pow_succ]; omega) rfl + +theorem FC_full_unique {d : List (Fin 2)} {tail : ListBlank (Fin 2)} {k : Nat} {r : ListBlank (Fin + 2)} + (h : FC d tail k (2 ^ k - 1) r) : r = d ^ k +> tail := + FC_unique h (FC_full d tail k) + +theorem FC_RC {d : List (Fin 2)} {tail : ListBlank (Fin 2)} {k n : Nat} {r : ListBlank (Fin 2)} {m : + Nat} + (hf : FC d tail k n r) (hr : RC d m tail) : RC d (n + 2 ^ k * m) r := by + induction hf with + | nil => exact RC_eq hr (by omega) rfl + | d0 k n r _ ih => exact RC_eq (RC.d0 (n + 2 ^ k * m) r ih) (by rw [Nat.pow_succ]; ring) rfl + | d1 k n r _ ih => exact RC_eq (RC.d1 (n + 2 ^ k * m) r ih) (by rw [Nat.pow_succ]; ring) rfl + +theorem RC_zeros {d : List (Fin 2)} {n : Nat} {r : ListBlank (Fin 2)} (k : Nat) (hr : RC d n r) : + RC d (2 ^ k * n) (rd0 ^ k +> r) := by + simpa using FC_RC (FC_zero d r k) hr + +theorem RC_carry {d : List (Fin 2)} {n : Nat} {r : ListBlank (Fin 2)} (h : RC d n r) : + ∃ (k : Nat) (s : ListBlank (Fin 2)), + r = d ^ k +> (rd0 +> s) ∧ RC d (n + 1) (rd0 ^ k +> (d +> s)) := by + induction h with + | zero => + refine ⟨(0 : Nat), default, ?_, ?_⟩ + · simp + · exact RC_eq (RC.d1 0 default RC.zero) (by omega) rfl + | d0 n r hr _ => + exact ⟨(0 : Nat), r, rfl, RC_eq (RC.d1 n r hr) (by omega) rfl⟩ + | d1 n r _ ih => + rcases ih with ⟨k, s, rfl, hs⟩ + refine ⟨k + 1, s, ?_, ?_⟩ + · rw [right_pow_succ d k (rd0 +> s)] + · rw [right_pow_succ rd0 k (d +> s)] + exact RC_eq (RC.d0 (n + 1) (rd0 ^ k +> (d +> s)) hs) (by omega) rfl + +theorem RC_positive_split {d : List (Fin 2)} {n : Nat} {r : ListBlank (Fin 2)} + (h : RC d n r) (hn : 0 < n) : + ∃ t q s, r = rd0 ^ t +> (d +> s) ∧ RC d q s ∧ n = 2 ^ t * (1 + q * 2) ∧ q < n := by + induction h with + | zero => omega + | d0 n r _ ih => + rcases ih (by omega) with ⟨t, q, s, rfl, hs, heq, hlt⟩ + refine ⟨t + 1, q, s, ?_, hs, ?_, by omega⟩ + · rw [right_pow_succ rd0 t (d +> s)] + · rw [Nat.pow_succ, heq]; ring + | d1 n r hr _ => + exact ⟨0, n, r, rfl, hr, by omega, by omega⟩ + +theorem FC_carry {d : List (Fin 2)} {tail : ListBlank (Fin 2)} {k n : Nat} {r : ListBlank (Fin 2)} + (h : FC d tail k n r) (hb : n + 1 < 2 ^ k) : + ∃ j s, j < k ∧ r = d ^ j +> (rd0 +> s) ∧ FC d tail k (n + 1) (rd0 ^ j +> (d +> s)) := by + induction h with + | nil => simp at hb + | d0 k n r hr _ => + exact ⟨0, r, by omega, rfl, FC_eq (FC.d1 k n r hr) rfl (by omega) rfl⟩ + | d1 k n r _ ih => + have hb' : n + 1 < 2 ^ k := by rw [Nat.pow_succ] at hb; omega + rcases ih hb' with ⟨j, s, hj, rfl, hs⟩ + refine ⟨j + 1, s, by omega, ?_, ?_⟩ + · rw [right_pow_succ d j (rd0 +> s)] + · rw [right_pow_succ rd0 j (d +> s)] + exact FC_eq (FC.d0 k (n + 1) (rd0 ^ j +> (d +> s)) hs) rfl (by omega) rfl + +theorem zero3_rd0 (n : Nat) (r : ListBlank (Fin 2)) : + ([0, 0, 0] : List (Fin 2)) +> (rd0 ^ n +> r) = rd0 ^ n +> ([0, 0, 0] +> r) := by + induction n with + | zero => rfl + | succ n ih => + rw [right_pow_succ rd0 n r, right_pow_succ rd0 n ([0, 0, 0] +> r), ← ih] + rfl + +theorem one_zero_comm_rd0_pow (t : Nat) (s : ListBlank (Fin 2)) : + ([0] : List (Fin 2)) +> (rd0 ^ t +> s) = rd0 ^ t +> ([0] +> s) := by + induction t with + | zero => rfl + | succ t ih => + rw [right_pow_succ rd0 t s, right_pow_succ rd0 t ([0] +> s), ← ih] + rfl + +end InductiveTapeCounter + +-- ============================================================================ +-- 10. Base-4 Separator Odometer +-- ============================================================================ + +section Base4SeparatorOdometer + +/-- 3-Step Composition helper for stepPlus transitions. -/ +theorem stepPlus_trans3 {α : Type*} {stepPlus : α → α → Prop} + (htrans : ∀ {a b c : α}, stepPlus a b → stepPlus b c → stepPlus a c) + {a b c d : α} (h1 : stepPlus a b) (h2 : stepPlus b c) (h3 : stepPlus c d) : + stepPlus a d := + htrans h1 (htrans h2 h3) + +/-- Abstract 4-Phase Base-4 Separator Odometer Cycle (`[0] ↦ [2] ↦ [0, 2] ↦ [3] ↦ carry`): + Chains the 4 odometer phase transitions into a single multi-step transition: + - Phase 1: `(0 :: 1 :: R) ↦ (2 :: R)` with `m ↦ m + 1` + - Phase 2: `(2 :: 1 :: R) ↦ (0 :: 2 :: R)` with `m ↦ m + 1` + - Phase 3: `(0 :: 2 :: R) ↦ (3 :: R)` with `m ↦ m + 1` + - Phase 4: `(3 :: R) ↦ carry` with `m ↦ m + 1` + yielding `(0 :: 1 :: 1 :: R) ↦ carry` with `m ↦ m + 4`. -/ +theorem odom_full_cycle_stepPlus + {α : Type*} {stepPlus : α → α → Prop} + (htrans : ∀ {a b c : α}, stepPlus a b → stepPlus b c → stepPlus a c) + (cfgB : ℕ → List ℕ → α) (carryCfg : ℕ → List ℕ → α) + (h02 : ∀ m R, stepPlus (cfgB m (0 :: 1 :: R)) (cfgB (m + 1) (2 :: R))) + (h2_02 : ∀ m R, stepPlus (cfgB m (2 :: 1 :: R)) (cfgB (m + 1) (0 :: 2 :: R))) + (h02_3 : ∀ m R, stepPlus (cfgB m (0 :: 2 :: R)) (cfgB (m + 1) (3 :: R))) + (h3_carry : ∀ m R, stepPlus (cfgB m (3 :: R)) (carryCfg (m + 1) R)) + (m : ℕ) (R : List ℕ) : + stepPlus (cfgB m (0 :: 1 :: 1 :: R)) (carryCfg (m + 4) R) := by + have s1 := h02 m (1 :: R) + have s2 := h2_02 (m + 1) R + have s3 := h02_3 (m + 2) R + have s4 := h3_carry (m + 3) R + exact htrans s1 (htrans s2 (htrans s3 s4)) + +/-- Concrete 4-Phase Base-4 Separator Odometer Cycle for Turing Machine configurations. -/ +theorem odom_full_cycle_compose + {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] (tm : Machine Γ Λ) + (cfgB : ℕ → List ℕ → Cfg Γ Λ) (carryCfg : ℕ → List ℕ → Cfg Γ Λ) + (h02 : ∀ m R, (cfgB m (0 :: 1 :: R)) [tm]⊢⁺ (cfgB (m + 1) (2 :: R))) + (h2_02 : ∀ m R, (cfgB m (2 :: 1 :: R)) [tm]⊢⁺ (cfgB (m + 1) (0 :: 2 :: R))) + (h02_3 : ∀ m R, (cfgB m (0 :: 2 :: R)) [tm]⊢⁺ (cfgB (m + 1) (3 :: R))) + (h3_carry : ∀ m R, (cfgB m (3 :: R)) [tm]⊢⁺ (carryCfg (m + 1) R)) + (m : ℕ) (R : List ℕ) : + (cfgB m (0 :: 1 :: 1 :: R)) [tm]⊢⁺ (carryCfg (m + 4) R) := by + have s1 := h02 m (1 :: R) + have s2 := h2_02 (m + 1) R + have s3 := h02_3 (m + 2) R + have s4 := h3_carry (m + 3) R + exact stepPlus_trans s1 (stepPlus_trans s2 (stepPlus_trans s3 s4)) + +/-- Inductive right-stack grammar `ValidOdomR` for Base-4 Separator Odometer sweeps. -/ +inductive ValidOdomR : List ℕ → Prop + | end_nil : ValidOdomR [] + | end_one : ValidOdomR [1] + | cons_one (d : ℕ) (R : List ℕ) : ValidOdomR (d :: R) → ValidOdomR (1 :: d :: R) + | cons_three (R : List ℕ) : ValidOdomR R → ValidOdomR (3 :: R) + | cons_five (R : List ℕ) : ValidOdomR (1 :: R) → ValidOdomR (5 :: 1 :: 1 :: R) + +/-- Complete Phase-2 right-stack grammar `ValidPhase2R` covering all 5 Phase-2 blocks + and terminal/separator suffixes (`[]`, `[1]`, `[2]`, `0 :: R`, including + `[0]`, `[1, 0]`, and `[1, 1, 0]`). -/ +inductive ValidPhase2R : List ℕ → Prop + | end_nil : ValidPhase2R [] + | end_one : ValidPhase2R [1] + | end_two : ValidPhase2R [2] + | end_zero (R : List ℕ) : ValidPhase2R (0 :: R) + | end_two_cons (d : ℕ) (R : List ℕ) : ValidPhase2R (2 :: d :: R) + | end_four_one (R : List ℕ) : ValidPhase2R (4 :: 1 :: R) + | cons_one (d : ℕ) (R : List ℕ) : ValidPhase2R (d :: R) → ValidPhase2R (1 :: d :: R) + | cons_three (R : List ℕ) : ValidPhase2R R → ValidPhase2R (3 :: R) + | cons_five (R : List ℕ) : ValidPhase2R (1 :: R) → ValidPhase2R (5 :: 1 :: 1 :: R) + +theorem validOdomR_imp_validPhase2R (R : List ℕ) (hR : ValidOdomR R) : ValidPhase2R R := by + induction hR with + | end_nil => exact .end_nil + | end_one => exact .end_one + | cons_one d R' _ ih => exact .cons_one d R' ih + | cons_three R' _ ih => exact .cons_three R' ih + | cons_five R' _ ih => exact .cons_five R' ih + +theorem validPhase2R_zero : ValidPhase2R [0] := .end_zero [] + +theorem validPhase2R_one_zero : ValidPhase2R [1, 0] := .cons_one 0 [] (.end_zero []) + +theorem validPhase2R_one_one_zero : ValidPhase2R [1, 1, 0] := + .cons_one 1 [0] (.cons_one 0 [] (.end_zero [])) + +/-- Any run of `1`s followed by `0 :: R` satisfies `ValidPhase2R`. -/ +theorem replicate_one_zero_validPhase2R (k : ℕ) (R : List ℕ) : + ValidPhase2R (List.replicate k 1 ++ (0 :: R)) := by + induction k with + | zero => exact .end_zero R + | succ k ih => + rw [List.replicate_succ, List.cons_append] + cases hrep : List.replicate k 1 ++ (0 :: R) with + | nil => + have hlen := congrArg List.length hrep + simp at hlen + | cons d R' => + rw [hrep] at ih + exact .cons_one d R' ih + +end Base4SeparatorOdometer + +end BusyBeaver.Counter diff --git a/BusyBeaver/Calculi/CtlCertificate.lean b/BusyBeaver/Calculi/CtlCertificate.lean new file mode 100644 index 00000000..9854e575 --- /dev/null +++ b/BusyBeaver/Calculi/CtlCertificate.lean @@ -0,0 +1,237 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Defs + +/-! +# Two-DFA Closed Tape Language Certificates (`BusyBeaver.Calculi.CtlCertificate`) + +A *two-DFA CTL certificate* (FAR / CTL style) for a binary Turing machine +`M : Machine (Fin 2) Λ` consists of + +* a left DFA `dL : Fin nL → Fin 2 → Fin nL` with start state `0` and the + blank-absorbing property `dL 0 0 = 0`; +* a right DFA `dR : Fin nR → Fin 2 → Fin nR` with the same properties; +* a finite accept set `acc : List (Fin nL × Λ × Fin 2 × Fin nR)`. + +Each DFA reads its half-tape from the far (blank) end towards the head, so the +abstraction of a configuration `⟨some s, ⟨a, L, R⟩⟩` is the tuple +`(readBlank dL L, s, a, readBlank dR R)`. The Boolean checker `ctlCheck` +verifies by finite enumeration that + +1. `dL 0 0 = 0` and `dR 0 0 = 0`; +2. the abstraction `(0, default, default, 0)` of the initial configuration is + accepted; +3. every accepted tuple has a defined, non-halting machine transition, and the + abstraction of every possible successor configuration is accepted again + (moving right pushes the written symbol onto the left DFA and pops an + arbitrary predecessor state off the right DFA, and symmetrically for left + moves). + +`CtlCert.ctl_certificate_implies_is_does_not_halt` shows that `ctlCheck … = true` +implies `IsNotHalt M`. Only the computational checker functions (`readList`, +`closureOk`, `ctlCheck`) carry `@[expose]` for kernel reduction (`by decide +kernel`), +while `readBlank` and `ctlInv` keep their bodies in `.olean.private`. +-/ + +public section + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver + +namespace CtlCert + +/-- Run a binary DFA over a half-tape representative `l` (head-adjacent cell +first), processing the far end first and the head-adjacent cell last. -/ +@[expose] def readList {n : ℕ} [NeZero n] (d : Fin n → Fin 2 → Fin n) (l : List (Fin 2)) : + Fin n := + l.foldr (fun a q => d q a) 0 + +theorem readList_nil {n : ℕ} [NeZero n] (d : Fin n → Fin 2 → Fin n) : + readList d [] = 0 := rfl + +theorem readList_cons {n : ℕ} [NeZero n] (d : Fin n → Fin 2 → Fin n) (a : Fin 2) + (l : List (Fin 2)) : readList d (a :: l) = d (readList d l) a := rfl + +/-- Appending blanks at the far end does not change the DFA state. -/ +theorem readList_append_replicate {n : ℕ} [NeZero n] (d : Fin n → Fin 2 → Fin n) + (h0 : d 0 0 = 0) (l : List (Fin 2)) (k : ℕ) : + readList d (l ++ List.replicate k default) = readList d l := by + unfold readList + rw [List.foldr_append] + congr 1 + induction k with + | zero => rfl + | succ k ih => + rw [List.replicate_succ, List.foldr_cons, ih] + exact h0 + +/-- The DFA state of a half-tape (`ListBlank`), well defined thanks to blank +absorption. -/ +def readBlank {n : ℕ} [NeZero n] (d : Fin n → Fin 2 → Fin n) (h0 : d 0 0 = 0) + (L : ListBlank (Fin 2)) : Fin n := + L.liftOn (readList d) (by + rintro a _ ⟨k, rfl⟩ + exact (readList_append_replicate d h0 a k).symm) + +theorem readBlank_mk {n : ℕ} [NeZero n] (d : Fin n → Fin 2 → Fin n) (h0 : d 0 0 = 0) + (l : List (Fin 2)) : readBlank d h0 (ListBlank.mk l) = readList d l := by + rfl + +theorem readBlank_cons {n : ℕ} [NeZero n] (d : Fin n → Fin 2 → Fin n) (h0 : d 0 0 = 0) + (a : Fin 2) (L : ListBlank (Fin 2)) : + readBlank d h0 (L.cons a) = d (readBlank d h0 L) a := by + refine ListBlank.induction_on L (fun l => ?_) + rfl + +/-- Closure check for a single accepted tuple `(p, s, a, q)`: the transition +must be defined and non-halting, and every abstract successor must be accepted. -/ +@[expose] def closureOk {Λ : Type*} [Inhabited Λ] [DecidableEq Λ] {nL nR : ℕ} + [NeZero nL] [NeZero nR] + (M : Machine (Fin 2) Λ) + (dL : Fin nL → Fin 2 → Fin nL) (dR : Fin nR → Fin 2 → Fin nR) + (acc : List (Fin nL × Λ × Fin 2 × Fin nR)) : Fin nL × Λ × Fin 2 × Fin nR → Bool + | (p, s, a, q) => + match M s a with + | none => false + | some (none, _) => false + | some (some s', Stmt.write b Dir.right) => + (List.finRange 2).all fun a' => (List.finRange nR).all fun q' => + if dR q' a' = q then decide ((dL p b, s', a', q') ∈ acc) else true + | some (some s', Stmt.write b Dir.left) => + (List.finRange 2).all fun a' => (List.finRange nL).all fun p' => + if dL p' a' = p then decide ((p', s', a', dR q b) ∈ acc) else true + +/-- The complete Boolean certificate check. -/ +@[expose] def ctlCheck {Λ : Type*} [Inhabited Λ] [DecidableEq Λ] {nL nR : ℕ} [NeZero nL] [NeZero nR] + (M : Machine (Fin 2) Λ) + (dL : Fin nL → Fin 2 → Fin nL) (dR : Fin nR → Fin 2 → Fin nR) + (acc : List (Fin nL × Λ × Fin 2 × Fin nR)) : Bool := + decide (dL 0 0 = 0) && decide (dR 0 0 = 0) && + decide (((0 : Fin nL), (default : Λ), (default : Fin 2), (0 : Fin nR)) ∈ acc) && + acc.all (closureOk M dL dR acc) + +/-- The invariant induced by a certificate: the abstraction of the +configuration is an accepted tuple. -/ +def ctlInv {Λ : Type*} {nL nR : ℕ} [NeZero nL] [NeZero nR] + (dL : Fin nL → Fin 2 → Fin nL) (hL : dL 0 0 = 0) + (dR : Fin nR → Fin 2 → Fin nR) (hR : dR 0 0 = 0) + (acc : List (Fin nL × Λ × Fin 2 × Fin nR)) (c : Cfg (Fin 2) Λ) : Prop := + ∃ s, c.q = some s ∧ + (readBlank dL hL c.tape.left, s, c.tape.head, readBlank dR hR c.tape.right) ∈ acc + +theorem ctlInv_init {Λ : Type*} [Inhabited Λ] {nL nR : ℕ} [NeZero nL] [NeZero nR] + (dL : Fin nL → Fin 2 → Fin nL) (hL : dL 0 0 = 0) + (dR : Fin nR → Fin 2 → Fin nR) (hR : dR 0 0 = 0) + (acc : List (Fin nL × Λ × Fin 2 × Fin nR)) + (h : ((0 : Fin nL), (default : Λ), (default : Fin 2), (0 : Fin nR)) ∈ acc) : + ctlInv dL hL dR hR acc (init []) := by + exact ⟨default, rfl, h⟩ + +theorem ctlInv_step {Λ : Type*} [Inhabited Λ] [DecidableEq Λ] {nL nR : ℕ} [NeZero nL] [NeZero nR] + (M : Machine (Fin 2) Λ) + (dL : Fin nL → Fin 2 → Fin nL) (hL : dL 0 0 = 0) + (dR : Fin nR → Fin 2 → Fin nR) (hR : dR 0 0 = 0) + (acc : List (Fin nL × Λ × Fin 2 × Fin nR)) + (hclos : acc.all (closureOk M dL dR acc) = true) + (c : Cfg (Fin 2) Λ) (hc : ctlInv dL hL dR hR acc c) : + ∃ c', step M c = some c' ∧ ctlInv dL hL dR hR acc c' := by + obtain ⟨s, hq, hmem⟩ := hc + obtain ⟨q, ⟨a, L, R⟩⟩ := c + simp only at hq hmem + subst hq + have hrow := List.all_eq_true.mp hclos _ hmem + simp only [closureOk] at hrow + cases hM : M s a with + | none => + rw [hM] at hrow + exact absurd hrow Bool.false_ne_true + | some r => + obtain ⟨s', b, dir⟩ := r + cases s' with + | none => + rw [hM] at hrow + exact absurd hrow Bool.false_ne_true + | some s' => + cases dir with + | right => + rw [hM] at hrow + refine ⟨⟨some s', ⟨R.head, L.cons b, R.tail⟩⟩, ?_, ?_⟩ + · simp only [step, hM, Option.map_some] + rfl + · refine ⟨s', rfl, ?_⟩ + have h1 := List.all_eq_true.mp hrow R.head (List.mem_finRange _) + have h2 := List.all_eq_true.mp h1 (readBlank dR hR R.tail) (List.mem_finRange _) + have hcondR : dR (readBlank dR hR R.tail) R.head = readBlank dR hR R := by + rw [← readBlank_cons dR hR, ListBlank.cons_head_tail] + simp only [hcondR, ↓reduceIte] at h2 + have h3 := of_decide_eq_true h2 + simpa only [readBlank_cons] using h3 + | left => + rw [hM] at hrow + refine ⟨⟨some s', ⟨L.head, L.tail, R.cons b⟩⟩, ?_, ?_⟩ + · simp only [step, hM, Option.map_some] + rfl + · refine ⟨s', rfl, ?_⟩ + have h1 := List.all_eq_true.mp hrow L.head (List.mem_finRange _) + have h2 := List.all_eq_true.mp h1 (readBlank dL hL L.tail) (List.mem_finRange _) + have hcondL : dL (readBlank dL hL L.tail) L.head = readBlank dL hL L := by + rw [← readBlank_cons dL hL, ListBlank.cons_head_tail] + simp only [hcondL, ↓reduceIte] at h2 + have h3 := of_decide_eq_true h2 + simpa only [readBlank_cons] using h3 + +/-- Every configuration reachable from `c₀` satisfies an inductive invariant. -/ +theorem ctl_multiStep_inv {Λ : Type*} [Inhabited Λ] (M : Machine (Fin 2) Λ) + (Inv : Cfg (Fin 2) Λ → Prop) + (h_step : ∀ c, Inv c → ∃ c', step M c = some c' ∧ Inv c') + (c₀ : Cfg (Fin 2) Λ) (h₀ : Inv c₀) : + ∀ n c, multiStep M c₀ n = some c → Inv c := by + intro n + induction n with + | zero => + intro c hc + have hc' : some c₀ = some c := hc + cases hc' + exact h₀ + | succ n ih => + intro c hc + have hc' : Option.bind (multiStep M c₀ n) (step M) = some c := by + rw [← hc, multiStep, multiStep, Function.iterate_succ_apply'] + cases hmid : multiStep M c₀ n with + | none => + rw [hmid] at hc' + exact absurd hc' (by simp) + | some cm => + rw [hmid] at hc' + obtain ⟨c', hstep, hinv'⟩ := h_step cm (ih cm hmid) + have hc'' : step M cm = some c := hc' + rw [hstep] at hc'' + cases hc'' + exact hinv' + +/-- **Soundness of two-DFA CTL certificates.** If the finite checker +`ctlCheck` accepts `(dL, dR, acc)` for `M`, then `M` never halts from the blank +tape. -/ +theorem ctl_certificate_implies_is_does_not_halt {Λ : Type*} [Inhabited Λ] [DecidableEq Λ] + {nL nR : ℕ} [NeZero nL] [NeZero nR] (M : Machine (Fin 2) Λ) + (dL : Fin nL → Fin 2 → Fin nL) (dR : Fin nR → Fin 2 → Fin nR) + (acc : List (Fin nL × Λ × Fin 2 × Fin nR)) + (h : ctlCheck M dL dR acc = true) : IsNotHalt M := by + simp only [ctlCheck, Bool.and_eq_true, decide_eq_true_eq] at h + obtain ⟨⟨⟨hL, hR⟩, hinit⟩, hclos⟩ := h + intro cfg ⟨n, hn⟩ + have hinv := ctl_multiStep_inv M (ctlInv dL hL dR hR acc) + (ctlInv_step M dL hL dR hR acc hclos) (init []) + (ctlInv_init dL hL dR hR acc hinit) n cfg hn + obtain ⟨c', hc', -⟩ := ctlInv_step M dL hL dR hR acc hclos cfg hinv + rw [hc'] + rfl + +end CtlCert + +end BusyBeaver diff --git a/BusyBeaver/Calculi/Excursion.lean b/BusyBeaver/Calculi/Excursion.lean new file mode 100644 index 00000000..c1780fa4 --- /dev/null +++ b/BusyBeaver/Calculi/Excursion.lean @@ -0,0 +1,637 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. + -/ +module + +public import BusyBeaver.Calculi.Counter + +/-! +# Decreasing Halt-Budget Calculus, Conjugate-Shift Excursion Algebra & Arithmetic Views + (`BusyBeaver.Calculi.Excursion`) + +Ported from the Coq BB(6) verification suite (`ccz181078/busycoq`, branch `BB6`): +- `Queue_v1.v`: Decreasing halt-budget non-halting calculus (`HaltsIn`, `Leads`, `Advances`, + `haltsIn_reduce_multiStep`, `haltsIn_reduce_stepStar`, `haltsIn_reduce_stepPlus`, + `not_haltsIn_of_advances`, `does_not_halt_of_advances`). +- `ChaoticFractalOthers_v1.v` & `ChaoticBell1Halt.v`: Conjugate-shift excursion word algebra + (`ConjWord`, `ConjWord.nil`, `ConjWord.append`, `ConjWord.pow`, `ConjWord.excursion`, + `ConjWord.excursion_plus`) and periodic RLE word commutation (`commute_pow`, + `commute_pow_left`, `commute_pow_single`, `append_commute_pow`, `append_commute_pow_single`). +- `DivModCases.v`: Dependent Euclidean division-modulo views (`DivMod2`..`DivMod6`, `mod2`..`mod6`) + and dependent subtraction view (`SubView`, `subView`). +- `Eqv_WordPairs.v` & `Eqv_v2.v`: Constructive (excluded-middle-free) halting and non-halting + equivalence via common abstract transition models (`IsValidAcceleration.collatzHalts_of_haltsIn`, + `IsValidAcceleration.isHalt_iff_constructive`, `IsValidAcceleration.isDoesNotHalt_iff`, + `IsValidAcceleration.equiv_halt`, `IsValidAcceleration.equiv_doesNotHalt`). + +All declarations live in `namespace BusyBeaver.Excursion` with `@[scoped simp]` attributes so that +importing `BusyBeaver.Basic` does not alter the default `simp` set of existing proofs. + -/ + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver BusyBeaver.Counter + +namespace BusyBeaver.Excursion + + + + +-- ============================================================================ +-- 1. Decreasing Halt-Budget Calculus (`HaltsIn`, `Leads`, `Advances`) +-- ============================================================================ + +section HaltBudgetCalculus + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +/-- `M` reaches a halting configuration from `c` in exactly `n` steps (`halts_in` in `Queue_v1.v`). +-/ +def HaltsIn (M : Machine Γ Λ) (c : Cfg Γ Λ) (n : ℕ) : Prop := + ∃ cfg : Cfg Γ Λ, (c [M]⊢^{n} cfg) ∧ (step M cfg).isNone + +theorem haltsIn_zero_iff {M : Machine Γ Λ} {c : Cfg Γ Λ} : + HaltsIn M c 0 ↔ (step M c).isNone := by + constructor + · rintro ⟨cfg, hms, hnone⟩ + change some c = some cfg at hms + injection hms with h_eq + subst h_eq + exact hnone + · intro hnone + exact ⟨c, rfl, hnone⟩ + +theorem haltsIn_iff_reachesStar_isNone {M : Machine Γ Λ} {c : Cfg Γ Λ} : + (∃ n, HaltsIn M c n) ↔ ∃ cfg, (c [M]⊢* cfg) ∧ (step M cfg).isNone := by + constructor + · rintro ⟨n, cfg, hms, hnone⟩ + exact ⟨cfg, ⟨n, hms⟩, hnone⟩ + · rintro ⟨cfg, ⟨n, hms⟩, hnone⟩ + exact ⟨n, cfg, hms, hnone⟩ + +theorem isHalt_iff_exists_haltsIn (M : Machine Γ Λ) : + IsHalt M ↔ ∃ n, HaltsIn M (init []) n := + haltsIn_iff_reachesStar_isNone.symm + +private theorem multiStep_succ_local (M : Machine Γ Λ) (c : Cfg Γ Λ) (n : ℕ) : + multiStep M c (n + 1) = Option.bind (multiStep M c n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +private theorem multiStep_add_local (M : Machine Γ Λ) (c : Cfg Γ Λ) (m n : ℕ) : + multiStep M c (m + n) = (multiStep M c m).bind (fun c' => multiStep M c' n) := by + induction n with + | zero => simp [multiStep] + | succ n ih => + rw [Nat.add_succ, multiStep_succ_local, ih, Option.bind_assoc] + simp_rw [multiStep_succ_local] + +private theorem multiStep_eq_none_of_halt {M : Machine Γ Λ} {c cfg : Cfg Γ Λ} {n : ℕ} + (hn : c [M]⊢^{n} cfg) (hnone : (step M cfg).isNone) : + ∀ d : ℕ, multiStep M c (n + 1 + d) = none + | 0 => by + have hstep : step M cfg = none := Option.isNone_iff_eq_none.mp hnone + rw [Nat.add_zero, multiStep_succ_local, hn, Option.bind_some, hstep] + | d + 1 => by + have ih := multiStep_eq_none_of_halt hn hnone d + have h1 : n + 1 + (d + 1) = (n + 1 + d) + 1 := by omega + rw [h1, multiStep_succ_local, ih, Option.bind_none] + +/-- Deterministic step-budget subtraction: if `c₁` reaches `c₂` in `k` steps and halts in `n` + steps, then `k ≤ n` and `c₂` halts in `n - k` steps. -/ +theorem haltsIn_reduce_multiStep {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} {k n : ℕ} + (h_reach : c₁ [M]⊢^{k} c₂) (h_halt : HaltsIn M c₁ n) : + k ≤ n ∧ HaltsIn M c₂ (n - k) := by + rcases h_halt with ⟨cfg, hn, hnone⟩ + rcases Nat.lt_or_ge n k with hlt | hge + · have hk : k = n + 1 + (k - (n + 1)) := by omega + have h_absurd : multiStep M c₁ k = none := by + rw [hk] + exact multiStep_eq_none_of_halt hn hnone (k - (n + 1)) + rw [h_reach] at h_absurd + nomatch h_absurd + · refine ⟨hge, cfg, ?_, hnone⟩ + have hn_eq : n = k + (n - k) := by omega + rw [hn_eq, multiStep_add_local, h_reach, Option.bind_some] at hn + exact hn + +theorem haltsIn_of_multiStep {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} {k m : ℕ} + (h_reach : c₁ [M]⊢^{k} c₂) (h_halt : HaltsIn M c₂ m) : + HaltsIn M c₁ (k + m) := by + rcases h_halt with ⟨cfg, hm, hnone⟩ + refine ⟨cfg, ?_, hnone⟩ + rw [multiStep_add_local, h_reach, Option.bind_some] + exact hm + +/-- If `c₁ [M]⊢* c₂` and `c₁` halts in `n` steps, then `c₂` halts in `m ≤ n` steps. -/ +theorem haltsIn_reduce_stepStar {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} {n : ℕ} + (h_reach : c₁ [M]⊢* c₂) (h_halt : HaltsIn M c₁ n) : + ∃ m, m ≤ n ∧ HaltsIn M c₂ m := by + rcases h_reach with ⟨k, hk⟩ + rcases haltsIn_reduce_multiStep hk h_halt with ⟨hkn, h_sub⟩ + exact ⟨n - k, by omega, h_sub⟩ + +/-- If `c₁ [M]⊢⁺ c₂` and `c₁` halts in `n` steps, then `c₂` halts in `m < n` steps. -/ +theorem haltsIn_reduce_stepPlus {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} {n : ℕ} + (h_reach : c₁ [M]⊢⁺ c₂) (h_halt : HaltsIn M c₁ n) : + ∃ m, m < n ∧ HaltsIn M c₂ m := by + rcases h_reach with ⟨k, hk_pos, hk⟩ + rcases haltsIn_reduce_multiStep hk h_halt with ⟨hkn, h_sub⟩ + exact ⟨n - k, by omega, h_sub⟩ + +/-- `Leads M c P` (`leads` in `Queue_v1.v`): if `M` halts from `c` in `n` steps, then `M` + reaches some configuration `d` satisfying `P d` that halts in `m ≤ n` steps. + Crucially, if a branch never halts (`¬ HaltsIn M c n`), `Leads M c P` holds vacuously! -/ +def Leads (M : Machine Γ Λ) (c : Cfg Γ Λ) (P : Cfg Γ Λ → Prop) : Prop := + ∀ n, HaltsIn M c n → ∃ m d, m ≤ n ∧ P d ∧ HaltsIn M d m + +/-- `Advances M c P` (`advances` in `Queue_v1.v`): if `M` halts from `c` in `n` steps, then `M` + reaches some configuration `d` satisfying `P d` that halts in strictly fewer (`m < n`) steps. -/ +def Advances (M : Machine Γ Λ) (c : Cfg Γ Λ) (P : Cfg Γ Λ → Prop) : Prop := + ∀ n, HaltsIn M c n → ∃ m d, m < n ∧ P d ∧ HaltsIn M d m + +theorem Leads.here {M : Machine Γ Λ} {c : Cfg Γ Λ} {P : Cfg Γ Λ → Prop} + (hc : P c) : Leads M c P := + fun n hn => ⟨n, c, Nat.le_refl n, hc, hn⟩ + +theorem Leads.of_not_halts {M : Machine Γ Λ} {c : Cfg Γ Λ} (P : Cfg Γ Λ → Prop) + (h_nonhalt : ∀ n, ¬ HaltsIn M c n) : Leads M c P := + fun n hn => False.elim (h_nonhalt n hn) + +theorem Advances.of_not_halts {M : Machine Γ Λ} {c : Cfg Γ Λ} (P : Cfg Γ Λ → Prop) + (h_nonhalt : ∀ n, ¬ HaltsIn M c n) : Advances M c P := + fun n hn => False.elim (h_nonhalt n hn) + +theorem Leads.of_stepStar {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} {P : Cfg Γ Λ → Prop} + (h₁ : c₁ [M]⊢* c₂) (h₂ : P c₂) : Leads M c₁ P := by + intro n hn + rcases haltsIn_reduce_stepStar h₁ hn with ⟨m, hmn, hm⟩ + exact ⟨m, c₂, hmn, h₂, hm⟩ + +theorem Advances.of_stepPlus {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} {P : Cfg Γ Λ → Prop} + (h₁ : c₁ [M]⊢⁺ c₂) (h₂ : P c₂) : Advances M c₁ P := by + intro n hn + rcases haltsIn_reduce_stepPlus h₁ hn with ⟨m, hmn, hm⟩ + exact ⟨m, c₂, hmn, h₂, hm⟩ + +theorem Leads.mono {M : Machine Γ Λ} {c : Cfg Γ Λ} {P Q : Cfg Γ Λ → Prop} + (h₁ : Leads M c P) (h₂ : ∀ d, P d → Q d) : Leads M c Q := by + intro n hn + rcases h₁ n hn with ⟨m, d, hmn, hP, hm⟩ + exact ⟨m, d, hmn, h₂ d hP, hm⟩ + +theorem Advances.mono {M : Machine Γ Λ} {c : Cfg Γ Λ} {P Q : Cfg Γ Λ → Prop} + (h₁ : Advances M c P) (h₂ : ∀ d, P d → Q d) : Advances M c Q := by + intro n hn + rcases h₁ n hn with ⟨m, d, hmn, hP, hm⟩ + exact ⟨m, d, hmn, h₂ d hP, hm⟩ + +theorem Advances.to_leads {M : Machine Γ Λ} {c : Cfg Γ Λ} {P : Cfg Γ Λ → Prop} + (h : Advances M c P) : Leads M c P := by + intro n hn + rcases h n hn with ⟨m, d, hmn, hP, hm⟩ + exact ⟨m, d, Nat.le_of_lt hmn, hP, hm⟩ + +theorem Leads.trans {M : Machine Γ Λ} {c : Cfg Γ Λ} {P Q : Cfg Γ Λ → Prop} + (h₁ : Leads M c P) (h₂ : ∀ d, P d → Leads M d Q) : Leads M c Q := by + intro n hn + rcases h₁ n hn with ⟨m, d, hmn, hP, hm⟩ + rcases h₂ d hP m hm with ⟨k, e, hkm, hQ, hk⟩ + exact ⟨k, e, Nat.le_trans hkm hmn, hQ, hk⟩ + +theorem Advances.trans {M : Machine Γ Λ} {c : Cfg Γ Λ} {P Q : Cfg Γ Λ → Prop} + (h₁ : Advances M c P) (h₂ : ∀ d, P d → Leads M d Q) : Advances M c Q := by + intro n hn + rcases h₁ n hn with ⟨m, d, hmn, hP, hm⟩ + rcases h₂ d hP m hm with ⟨k, e, hkm, hQ, hk⟩ + exact ⟨k, e, Nat.lt_of_le_of_lt hkm hmn, hQ, hk⟩ + +theorem Leads.trans_advances {M : Machine Γ Λ} {c : Cfg Γ Λ} {P Q : Cfg Γ Λ → Prop} + (h₁ : Leads M c P) (h₂ : ∀ d, P d → Advances M d Q) : Advances M c Q := by + intro n hn + rcases h₁ n hn with ⟨m, d, hmn, hP, hm⟩ + rcases h₂ d hP m hm with ⟨k, e, hkm, hQ, hk⟩ + exact ⟨k, e, Nat.lt_of_lt_of_le hkm hmn, hQ, hk⟩ + +theorem Leads.of_stepStar_leads {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} {P : Cfg Γ Λ → Prop} + (h₁ : c₁ [M]⊢* c₂) (h₂ : Leads M c₂ P) : Leads M c₁ P := + (Leads.of_stepStar h₁ rfl).trans (fun _ h_eq => h_eq ▸ h₂) + +theorem Advances.of_stepPlus_leads {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} {P : Cfg Γ Λ → Prop} + (h₁ : c₁ [M]⊢⁺ c₂) (h₂ : Leads M c₂ P) : Advances M c₁ P := + (Advances.of_stepPlus h₁ rfl).trans (fun _ h_eq => h_eq ▸ h₂) + +theorem Leads.of_stepPlus_leads {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} {P : Cfg Γ Λ → Prop} + (h₁ : c₁ [M]⊢⁺ c₂) (h₂ : Leads M c₂ P) : Leads M c₁ P := + (Advances.of_stepPlus_leads h₁ h₂).to_leads + +theorem Advances.of_stepStar_advances {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} {P : Cfg Γ Λ → Prop} + (h₁ : c₁ [M]⊢* c₂) (h₂ : Advances M c₂ P) : Advances M c₁ P := + (Leads.of_stepStar h₁ rfl).trans_advances (fun _ h_eq => h_eq ▸ h₂) + +theorem Leads.or_left {M : Machine Γ Λ} {c : Cfg Γ Λ} {P Q : Cfg Γ Λ → Prop} + (h : Leads M c P) : Leads M c (fun d => P d ∨ Q d) := + h.mono (fun _ hP => Or.inl hP) + +theorem Leads.or_right {M : Machine Γ Λ} {c : Cfg Γ Λ} {P Q : Cfg Γ Λ → Prop} + (h : Leads M c Q) : Leads M c (fun d => P d ∨ Q d) := + h.mono (fun _ hQ => Or.inr hQ) + +theorem Leads.or_elim {M : Machine Γ Λ} {c : Cfg Γ Λ} {P Q R : Cfg Γ Λ → Prop} + (h : Leads M c (fun d => P d ∨ Q d)) + (hP : ∀ d, P d → Leads M d R) + (hQ : ∀ d, Q d → Leads M d R) : Leads M c R := + h.trans (fun d hd => hd.elim (hP d) (hQ d)) + +theorem Advances.or_elim {M : Machine Γ Λ} {c : Cfg Γ Λ} {P Q R : Cfg Γ Λ → Prop} + (h : Advances M c (fun d => P d ∨ Q d)) + (hP : ∀ d, P d → Leads M d R) + (hQ : ∀ d, Q d → Leads M d R) : Advances M c R := + h.trans (fun d hd => hd.elim (hP d) (hQ d)) + +/-- Well-foundedness of halt-budget descent: if every configuration satisfying `P` advances to + `P` with strictly smaller remaining halt budget, then no `P`-configuration can halt in `n` + steps. -/ +theorem not_haltsIn_of_advances {M : Machine Γ Λ} {P : Cfg Γ Λ → Prop} + (h_adv : ∀ c, P c → Advances M c P) : + ∀ (n : ℕ) (c : Cfg Γ Λ), P c → ¬ HaltsIn M c n := by + intro n + induction n using Nat.strong_induction_on with + | h n ih => + intro c hc hn + rcases h_adv c hc n hn with ⟨m, d, hmn, hd, hm⟩ + exact ih m hmn d hd hm + +/-- Constructive (excluded-middle-free) non-halting theorem from decreasing halt budget + (`decreasing_halt_budget` in `Queue_v1.v`): if `Leads M (init []) P` and every `P` + configuration `Advances` to `P`, then `IsDoesNotHalt M`. -/ +theorem does_not_halt_of_leads_advances {M : Machine Γ Λ} {P : Cfg Γ Λ → Prop} + (h_init : Leads M (init []) P) + (h_adv : ∀ c, P c → Advances M c P) : + IsDoesNotHalt M := by + intro cfg ⟨n, hn⟩ + cases h_step : step M cfg with + | some _ => rfl + | none => + have h_halt_init : HaltsIn M (init []) n := ⟨cfg, hn, by simp [h_step]⟩ + rcases h_init n h_halt_init with ⟨m, d, _, hPd, h_halt_d⟩ + exact False.elim (not_haltsIn_of_advances h_adv m d hPd h_halt_d) + +/-- Specialization of `does_not_halt_of_leads_advances` when `(init []) [M]⊢* c₀` and `P c₀`. -/ +theorem does_not_halt_of_advances {M : Machine Γ Λ} {P : Cfg Γ Λ → Prop} {c₀ : Cfg Γ Λ} + (h_init : (init []) [M]⊢* c₀) (h₀ : P c₀) + (h_adv : ∀ c, P c → Advances M c P) : + IsDoesNotHalt M := + does_not_halt_of_leads_advances (Leads.of_stepStar h_init h₀) h_adv + +end HaltBudgetCalculus + +-- ============================================================================ +-- 2. Conjugate-Shift Excursion Word Algebra (`ConjWord`, `commute_pow`) +-- ============================================================================ + +section ConjugateShiftAlgebra + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +/-- Conjugate-shift excursion triple (`conj_word` in `ChaoticFractalOthers_v1.v`): + 1. `word_conj`: `w ++ u = u ++ x` (pushing `w` on the left of `u` equals shifting `u` past `x`), + 2. `scan_fwd`: scanning right in state `qF` across `x` leaves `y.reverse` on the left tape, and + 3. `scan_bwd`: scanning left in state `qB` across `y.reverse` leaves `w` on the right tape. -/ +structure ConjWord (M : Machine Γ Λ) (qF qB : Λ) (u w x y : List Γ) : Prop where + word_conj : w ++ u = u ++ x + scan_fwd : ∀ (l r : ListBlank Γ), + (l {{qF}}> (x +> r)) [M]⊢* ((y.reverse +> l) {{qF}}> r) + scan_bwd : ∀ (l r : ListBlank Γ), + ((y.reverse +> l) <{{qB}} r) [M]⊢* (l <{{qB}} (w +> r)) + +theorem ConjWord.nil (M : Machine Γ Λ) (qF qB : Λ) (u : List Γ) : + ConjWord M qF qB u [] [] [] where + word_conj := by simp + scan_fwd _ _ := stepStar_refl M _ + scan_bwd _ _ := stepStar_refl M _ + +theorem ConjWord.append {M : Machine Γ Λ} {qF qB : Λ} {u w₁ x₁ y₁ w₂ x₂ y₂ : List Γ} + (h₁ : ConjWord M qF qB u w₁ x₁ y₁) (h₂ : ConjWord M qF qB u w₂ x₂ y₂) : + ConjWord M qF qB u (w₁ ++ w₂) (x₁ ++ x₂) (y₁ ++ y₂) where + word_conj := by + rw [List.append_assoc, h₂.word_conj, ← List.append_assoc, h₁.word_conj, List.append_assoc] + scan_fwd l r := by + rw [listblank_append_assoc, List.reverse_append, listblank_append_assoc] + exact stepStar_trans (h₁.scan_fwd l (x₂ +> r)) (h₂.scan_fwd (y₁.reverse +> l) r) + scan_bwd l r := by + rw [List.reverse_append, listblank_append_assoc, listblank_append_assoc] + exact stepStar_trans (h₂.scan_bwd (y₁.reverse +> l) r) (h₁.scan_bwd l (w₂ +> r)) + +theorem ConjWord.pow {M : Machine Γ Λ} {qF qB : Λ} {u w x y : List Γ} + (h : ConjWord M qF qB u w x y) : + ∀ (n : ℕ), ConjWord M qF qB u (w ^ n) (x ^ n) (y ^ n) + | 0 => ConjWord.nil M qF qB u + | n + 1 => h.append (h.pow n) + +/-- Full right-scan + turnaround + left-scan excursion across `x` followed by `u`: + if `(l {{qF}}> (u +> r₀)) [M]⊢* (l <{{qB}} (u +> r₁))`, then + `(l {{qF}}> (x +> (u +> r₀))) [M]⊢* (l <{{qB}} (u +> (x +> r₁)))`. -/ +theorem ConjWord.excursion {M : Machine Γ Λ} {qF qB : Λ} {u w x y : List Γ} + (h : ConjWord M qF qB u w x y) + {r₀ r₁ : ListBlank Γ} + (h_turn : ∀ l : ListBlank Γ, (l {{qF}}> (u +> r₀)) [M]⊢* (l <{{qB}} (u +> r₁))) + (l : ListBlank Γ) : + (l {{qF}}> (x +> (u +> r₀))) [M]⊢* (l <{{qB}} (u +> (x +> r₁))) := by + have h₁ := h.scan_fwd l (u +> r₀) + have h₂ := h_turn (y.reverse +> l) + have h₃ := h.scan_bwd l (u +> r₁) + have h_eq : w +> (u +> r₁) = u +> (x +> r₁) := by + rw [← listblank_append_assoc, h.word_conj, listblank_append_assoc] + rw [h_eq] at h₃ + exact stepStar_trans h₁ (stepStar_trans h₂ h₃) + +/-- `ReachesPlus` version of `ConjWord.excursion` when the turnaround takes at least 1 step. -/ +theorem ConjWord.excursion_plus {M : Machine Γ Λ} {qF qB : Λ} {u w x y : List Γ} + (h : ConjWord M qF qB u w x y) + {r₀ r₁ : ListBlank Γ} + (h_turn : ∀ l : ListBlank Γ, (l {{qF}}> (u +> r₀)) [M]⊢⁺ (l <{{qB}} (u +> r₁))) + (l : ListBlank Γ) : + (l {{qF}}> (x +> (u +> r₀))) [M]⊢⁺ (l <{{qB}} (u +> (x +> r₁))) := by + have h₁ := h.scan_fwd l (u +> r₀) + have h₂ := h_turn (y.reverse +> l) + have h₃ := h.scan_bwd l (u +> r₁) + have h_eq : w +> (u +> r₁) = u +> (x +> r₁) := by + rw [← listblank_append_assoc, h.word_conj, listblank_append_assoc] + rw [h_eq] at h₃ + exact stepPlus_stepStar_stepPlus (stepStar_stepPlus_stepPlus h₁ h₂) h₃ + +omit [Inhabited Γ] in +private theorem list_pow_add_local (l : List Γ) (m n : ℕ) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.succ_add, pow_succ_list, pow_succ_list, ih, List.append_assoc] + +omit [Inhabited Γ] in +/-- Periodic RLE commutation theorem (`commute_pow` in `ChaoticBell1Halt.v`): + if `x ++ v ^ a = w ^ b ++ x`, then `x ++ v ^ (a * k) = w ^ (b * k) ++ x` for all `k`. -/ +theorem commute_pow {x v w : List Γ} {a b : ℕ} + (h : x ++ v ^ a = w ^ b ++ x) : + ∀ (k : ℕ), x ++ v ^ (a * k) = w ^ (b * k) ++ x + | 0 => by simp + | k + 1 => by + rw [Nat.mul_succ, Nat.mul_succ, list_pow_add_local, list_pow_add_local, + ← List.append_assoc, commute_pow h k, List.append_assoc, h, ← List.append_assoc] + +omit [Inhabited Γ] in +theorem commute_pow_left {x v w : List Γ} {a b : ℕ} + (h : x ++ v ^ a = w ^ b ++ x) (k : ℕ) : + x ++ v ^ (k * a) = w ^ (k * b) ++ x := by + rw [Nat.mul_comm k a, Nat.mul_comm k b] + exact commute_pow h k + +omit [Inhabited Γ] in +theorem commute_pow_single {x v w : List Γ} + (h : x ++ v = w ++ x) : + ∀ (k : ℕ), x ++ v ^ k = w ^ k ++ x + | 0 => by simp + | k + 1 => by + rw [pow_succ_list, pow_succ_list, ← List.append_assoc, h, List.append_assoc, + commute_pow_single h k, ← List.append_assoc] + +/-- Half-tape (`ListBlank`) corollary of `commute_pow`. -/ +theorem append_commute_pow {x v w : List Γ} {a b : ℕ} + (h : x ++ v ^ a = w ^ b ++ x) (k : ℕ) (s : ListBlank Γ) : + x +> (v ^ (a * k) +> s) = w ^ (b * k) +> (x +> s) := by + rw [← listblank_append_assoc, commute_pow h k, listblank_append_assoc] + +/-- Half-tape (`ListBlank`) corollary of `commute_pow_single`. -/ +theorem append_commute_pow_single {x v w : List Γ} + (h : x ++ v = w ++ x) (k : ℕ) (s : ListBlank Γ) : + x +> (v ^ k +> s) = w ^ k +> (x +> s) := by + rw [← listblank_append_assoc, commute_pow_single h k, listblank_append_assoc] + +end ConjugateShiftAlgebra + +-- ============================================================================ +-- 3. Dependent Division-Modulo & Subtraction Views (`DivMod2`..`DivMod6`, `SubView`) +-- ============================================================================ + +section DependentArithmeticViews + +/-- Dependent modulo-2 view (`DivMod2` in `DivModCases.v`). -/ +inductive DivMod2 (n : ℕ) : Type where + | eq0 (a : ℕ) (h : n = a * 2) : DivMod2 n + | eq1 (a : ℕ) (h : n = 1 + a * 2) : DivMod2 n + +def mod2 (n : ℕ) : DivMod2 n := + if h0 : n % 2 = 0 then + .eq0 (n / 2) (by omega) + else + .eq1 (n / 2) (by omega) + +/-- Dependent modulo-3 view (`DivMod3` in `DivModCases.v`). -/ +inductive DivMod3 (n : ℕ) : Type where + | eq0 (a : ℕ) (h : n = a * 3) : DivMod3 n + | eq1 (a : ℕ) (h : n = 1 + a * 3) : DivMod3 n + | eq2 (a : ℕ) (h : n = 2 + a * 3) : DivMod3 n + +def mod3 (n : ℕ) : DivMod3 n := + if h0 : n % 3 = 0 then + .eq0 (n / 3) (by omega) + else if h1 : n % 3 = 1 then + .eq1 (n / 3) (by omega) + else + .eq2 (n / 3) (by omega) + +/-- Dependent modulo-4 view (`DivMod4` in `DivModCases.v`). -/ +inductive DivMod4 (n : ℕ) : Type where + | eq0 (a : ℕ) (h : n = a * 4) : DivMod4 n + | eq1 (a : ℕ) (h : n = 1 + a * 4) : DivMod4 n + | eq2 (a : ℕ) (h : n = 2 + a * 4) : DivMod4 n + | eq3 (a : ℕ) (h : n = 3 + a * 4) : DivMod4 n + +def mod4 (n : ℕ) : DivMod4 n := + if h0 : n % 4 = 0 then + .eq0 (n / 4) (by omega) + else if h1 : n % 4 = 1 then + .eq1 (n / 4) (by omega) + else if h2 : n % 4 = 2 then + .eq2 (n / 4) (by omega) + else + .eq3 (n / 4) (by omega) + +/-- Dependent modulo-5 view (`DivMod5` in `DivModCases.v`). -/ +inductive DivMod5 (n : ℕ) : Type where + | eq0 (a : ℕ) (h : n = a * 5) : DivMod5 n + | eq1 (a : ℕ) (h : n = 1 + a * 5) : DivMod5 n + | eq2 (a : ℕ) (h : n = 2 + a * 5) : DivMod5 n + | eq3 (a : ℕ) (h : n = 3 + a * 5) : DivMod5 n + | eq4 (a : ℕ) (h : n = 4 + a * 5) : DivMod5 n + +def mod5 (n : ℕ) : DivMod5 n := + if h0 : n % 5 = 0 then + .eq0 (n / 5) (by omega) + else if h1 : n % 5 = 1 then + .eq1 (n / 5) (by omega) + else if h2 : n % 5 = 2 then + .eq2 (n / 5) (by omega) + else if h3 : n % 5 = 3 then + .eq3 (n / 5) (by omega) + else + .eq4 (n / 5) (by omega) + +/-- Dependent modulo-6 view (`DivMod6` in `DivModCases.v`). -/ +inductive DivMod6 (n : ℕ) : Type where + | eq0 (a : ℕ) (h : n = a * 6) : DivMod6 n + | eq1 (a : ℕ) (h : n = 1 + a * 6) : DivMod6 n + | eq2 (a : ℕ) (h : n = 2 + a * 6) : DivMod6 n + | eq3 (a : ℕ) (h : n = 3 + a * 6) : DivMod6 n + | eq4 (a : ℕ) (h : n = 4 + a * 6) : DivMod6 n + | eq5 (a : ℕ) (h : n = 5 + a * 6) : DivMod6 n + +def mod6 (n : ℕ) : DivMod6 n := + if h0 : n % 6 = 0 then + .eq0 (n / 6) (by omega) + else if h1 : n % 6 = 1 then + .eq1 (n / 6) (by omega) + else if h2 : n % 6 = 2 then + .eq2 (n / 6) (by omega) + else if h3 : n % 6 = 3 then + .eq3 (n / 6) (by omega) + else if h4 : n % 6 = 4 then + .eq4 (n / 6) (by omega) + else + .eq5 (n / 6) (by omega) + +/-- Dependent subtraction view (`Sub` in `DivModCases.v`): splits `(a, b)` into `a = b + c` vs `a < + b`. -/ +inductive SubView (a b : ℕ) : Type where + | ge (c : ℕ) (h : a = b + c) : SubView a b + | lt (h : a < b) : SubView a b + +def subView (a b : ℕ) : SubView a b := + if h : a < b then + .lt h + else + .ge (a - b) (by omega) + +end DependentArithmeticViews + +-- ============================================================================ +-- 4. Constructive Halting & Non-Halting Equivalence via Abstract Models +-- ============================================================================ + +section ConstructiveModelEquivalence + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +private theorem collatzHalts_of_next_none {S : Type*} {next : S → Option S} {s : S} + (h : next s = none) : CollatzHalts next s := + ⟨1, by simp [h]⟩ + +private theorem collatzHalts_of_next_some {S : Type*} {next : S → Option S} {s s' : S} + (h : next s = some s') (h' : CollatzHalts next s') : CollatzHalts next s := by + rcases h' with ⟨n, hn⟩ + refine ⟨n + 1, ?_⟩ + rw [Function.iterate_succ_apply] + simpa [h] using hn + +/-- Constructive (excluded-middle-free) proof that if `encode s` halts in `n` steps under a valid + acceleration `h`, then the abstract model `next` halts from `s`. -/ +theorem IsValidAcceleration.collatzHalts_of_haltsIn {M : Machine Γ Λ} {S : Type*} + {start : S} {encode : S → Cfg Γ Λ} {next : S → Option S} + (h : IsValidAcceleration M start encode next) : + ∀ (n : ℕ) (s : S), HaltsIn M (encode s) n → CollatzHalts next s := by + intro n + induction n using Nat.strong_induction_on with + | h n ih => + intro s hn + rcases hnext : next s with _ | s' + · exact collatzHalts_of_next_none hnext + · rcases haltsIn_reduce_stepPlus (h.step_some s s' hnext) hn with ⟨m, hmn, hm⟩ + exact collatzHalts_of_next_some hnext (ih m hmn s' hm) + +private theorem haltsIn_of_collatzHalts {M : Machine Γ Λ} {S : Type*} + {start : S} {encode : S → Cfg Γ Λ} {next : S → Option S} + (h : IsValidAcceleration M start encode next) {s : S} + (hs : CollatzHalts next s) : ∃ n, HaltsIn M (encode s) n := by + rcases hs with ⟨k, hk⟩ + induction k generalizing s with + | zero => simp at hk + | succ k ih => + rw [Function.iterate_succ_apply] at hk + rcases hnext : next s with _ | s' + · rcases h.step_none s hnext with ⟨cfg', ⟨m, hm⟩, hnone⟩ + exact ⟨m, cfg', hm, hnone⟩ + · have hk' : ((Option.bind · next)^[k] (some s')).isNone := by + simpa [hnext] using hk + rcases ih hk' with ⟨m, hm⟩ + rcases h.step_some s s' hnext with ⟨d, _, hd⟩ + exact ⟨d + m, haltsIn_of_multiStep hd hm⟩ + +/-- Constructive (excluded-middle-free) characterization of `IsHalt M` via `CollatzHalts next + start`. -/ +theorem IsValidAcceleration.isHalt_iff_constructive {M : Machine Γ Λ} {S : Type*} + {start : S} {encode : S → Cfg Γ Λ} {next : S → Option S} + (h : IsValidAcceleration M start encode next) : + IsHalt M ↔ CollatzHalts next start := by + rw [isHalt_iff_exists_haltsIn] + constructor + · rintro ⟨n, hn⟩ + rcases haltsIn_reduce_stepStar h.init_reaches hn with ⟨m, _, hm⟩ + exact IsValidAcceleration.collatzHalts_of_haltsIn h m start hm + · intro hs + rcases h.init_reaches with ⟨k, hk⟩ + rcases haltsIn_of_collatzHalts h hs with ⟨m, hm⟩ + exact ⟨k + m, haltsIn_of_multiStep hk hm⟩ + +/-- Constructive (excluded-middle-free) characterization of `IsDoesNotHalt M` via `¬ CollatzHalts + next start`. -/ +theorem IsValidAcceleration.isDoesNotHalt_iff {M : Machine Γ Λ} {S : Type*} + {start : S} {encode : S → Cfg Γ Λ} {next : S → Option S} + (h : IsValidAcceleration M start encode next) : + IsDoesNotHalt M ↔ ¬ CollatzHalts next start := by + constructor + · intro h_dnh h_collatz + rcases (IsValidAcceleration.isHalt_iff_constructive h).mpr h_collatz with ⟨cfg, hreach, hnone⟩ + have hsome := h_dnh cfg hreach + rw [Option.isNone_iff_eq_none] at hnone + simp [hnone] at hsome + · intro h_not_collatz + refine does_not_halt_of_advances + (P := fun cfg => ∃ s, cfg = encode s ∧ ¬ CollatzHalts next s) + h.init_reaches + ⟨start, rfl, h_not_collatz⟩ + ?_ + rintro _ ⟨s, rfl, hns⟩ + rcases hnext : next s with _ | s' + · exact False.elim (hns (collatzHalts_of_next_none hnext)) + · refine Advances.of_stepPlus (h.step_some s s' hnext) ⟨s', rfl, ?_⟩ + intro hs' + exact hns (collatzHalts_of_next_some hnext hs') + +/-- Two machines `M₁` and `M₂` (possibly over different tape/state alphabets) that simulate the + same abstract transition system `(start, next)` have equivalent `IsHalt` behavior + (`Eqv_WordPairs.v` / `Eqv_v2.v`). -/ +theorem IsValidAcceleration.equiv_halt + {Γ₁ Λ₁ Γ₂ Λ₂ S : Type*} [Inhabited Γ₁] [Inhabited Λ₁] [Inhabited Γ₂] [Inhabited Λ₂] + {M₁ : Machine Γ₁ Λ₁} {M₂ : Machine Γ₂ Λ₂} + {start : S} {encode₁ : S → Cfg Γ₁ Λ₁} {encode₂ : S → Cfg Γ₂ Λ₂} {next : S → Option S} + (h₁ : IsValidAcceleration M₁ start encode₁ next) + (h₂ : IsValidAcceleration M₂ start encode₂ next) : + IsHalt M₁ ↔ IsHalt M₂ := + (IsValidAcceleration.isHalt_iff_constructive h₁).trans + (IsValidAcceleration.isHalt_iff_constructive h₂).symm + +/-- Two machines `M₁` and `M₂` that simulate the same abstract transition system `(start, next)` + have equivalent `IsDoesNotHalt` behavior (`Eqv_WordPairs.v` / `Eqv_v2.v`). -/ +theorem IsValidAcceleration.equiv_doesNotHalt + {Γ₁ Λ₁ Γ₂ Λ₂ S : Type*} [Inhabited Γ₁] [Inhabited Λ₁] [Inhabited Γ₂] [Inhabited Λ₂] + {M₁ : Machine Γ₁ Λ₁} {M₂ : Machine Γ₂ Λ₂} + {start : S} {encode₁ : S → Cfg Γ₁ Λ₁} {encode₂ : S → Cfg Γ₂ Λ₂} {next : S → Option S} + (h₁ : IsValidAcceleration M₁ start encode₁ next) + (h₂ : IsValidAcceleration M₂ start encode₂ next) : + IsDoesNotHalt M₁ ↔ IsDoesNotHalt M₂ := + (IsValidAcceleration.isDoesNotHalt_iff h₁).trans + (IsValidAcceleration.isDoesNotHalt_iff h₂).symm + +end ConstructiveModelEquivalence + +end BusyBeaver.Excursion diff --git a/BusyBeaver/Calculi/HaltShared.lean b/BusyBeaver/Calculi/HaltShared.lean new file mode 100644 index 00000000..6815914d --- /dev/null +++ b/BusyBeaver/Calculi/HaltShared.lean @@ -0,0 +1,4936 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter + +/-! +# Shared Halting Proof Infrastructure (`BusyBeaver.Calculi.HaltShared`) + +Common lemmas, bounded-reachability lemmas, and step-reduction tactics +shared across multiple Busy Beaver halting machine proofs. +-/ + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver + +/-- `true` iff `M` reaches, after exactly `n` steps, a configuration without a successor. -/ +def BusyBeaver.haltsAt (M : Machine (Fin 2) (Fin 6)) (n : ℕ) : Bool := + match multiStep M (init []) n with + | some cfg => (step M cfg).isNone + | none => false + +theorem BusyBeaver.is_halt_of_haltsAt (M : Machine (Fin 2) (Fin 6)) (n : ℕ) + (h : BusyBeaver.haltsAt M n = true) : IsHalt M := by + unfold BusyBeaver.haltsAt at h + cases hm : multiStep M (init []) n with + | none => + rw [hm] at h + exact absurd h Bool.false_ne_true + | some cfg => + rw [hm] at h + exact ⟨cfg, ⟨n, hm⟩, h⟩ + +namespace BusyBeaver.RleStackEngine + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +@[simp] theorem multiStep_zero (M : Machine Γ Λ) (c : Cfg Γ Λ) : multiStep M c 0 = some c := rfl + +@[simp] theorem pow_zero_list (u : List (Fin 2)) : u ^ (0 : Nat) = [] := rfl +@[simp] theorem pow_succ_list (u : List (Fin 2)) (n : Nat) : u ^ (n + 1) = u ++ u ^ n := rfl +@[simp] theorem nil_append_list (l : List (Fin 2)) : ([] : List (Fin 2)) ++ l = l := rfl +@[simp] theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : + (x :: xs) ++ ys = x :: (xs ++ ys) := rfl +@[simp] theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +@[simp] theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +@[simp] theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : + (x :: xs) +> b = x >> (xs +> b) := rfl +@[simp] theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +@[simp] theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +@[simp] +theorem listblank_append_pow_add (s : ListBlank (Fin 2)) (n m : ℕ) : + (s <+ (([1] : List (Fin 2)) ^ n)) <+ (([1] : List (Fin 2)) ^ m) = + s <+ (([1] : List (Fin 2)) ^ (n + m)) := by + rw [listblank_append_append, list_pow_add_comm, ← list_pow_add] + +theorem listblank_right_pow_add (s : ListBlank (Fin 2)) (n m : ℕ) : + (([1] : List (Fin 2)) ^ n) +> ((([1] : List (Fin 2)) ^ m) +> s) = + (([1] : List (Fin 2)) ^ (n + m)) +> s := by + rw [← listblank_append_right_assoc, ← list_pow_add] + +def encLeft1 : List ℕ → ListBlank (Fin 2) + | [] => default + | a :: L => ((encLeft1 L).cons 0) <+ (([1] : List (Fin 2)) ^ (a + 1)) + +def encRight1 : List ℕ → ListBlank (Fin 2) + | [] => default + | d :: R => (([1] : List (Fin 2)) ^ (d + 1)) +> ((encRight1 R).cons 0) + +@[simp] theorem encLeft_nil : encLeft1 [] = default := rfl +@[simp] theorem encLeft_cons (a : ℕ) (L : List ℕ) : + encLeft1 (a :: L) = ((encLeft1 L).cons 0) <+ (([1] : List (Fin 2)) ^ (a + 1)) := rfl +@[simp] theorem encRight_nil : encRight1 [] = default := rfl +@[simp] theorem encRight_cons (d : ℕ) (R : List ℕ) : + encRight1 (d :: R) = (([1] : List (Fin 2)) ^ (d + 1)) +> ((encRight1 R).cons 0) := rfl + +def bumpHead : List ℕ → List ℕ + | [] => [0] + | b :: L => (b + 1) :: L + +@[simp] theorem encLeft_cons_one (L : List ℕ) : + (1 : Fin 2) >> encLeft1 L = encLeft1 (bumpHead L) := by + cases L with + | nil => simp [bumpHead, encLeft1] + | cons b L' => rfl + +@[simp] theorem encRight_cons_one (R : List ℕ) : + (1 : Fin 2) >> encRight1 R = encRight1 (bumpHead R) := by + cases R with + | nil => simp [bumpHead, encRight1] + | cons d R' => rfl + +theorem encLeft_zero (L : List ℕ) : + encLeft1 (0 :: L) = (1 : Fin 2) >> ((0 : Fin 2) >> encLeft1 L) := rfl +theorem encLeft_succ (a : ℕ) (L : List ℕ) : + encLeft1 ((a + 1) :: L) = (1 : Fin 2) >> encLeft1 (a :: L) := rfl +theorem encRight_zero (R : List ℕ) : + encRight1 (0 :: R) = (1 : Fin 2) >> ((0 : Fin 2) >> encRight1 R) := rfl +theorem encRight_succ (d : ℕ) (R : List ℕ) : + encRight1 ((d + 1) :: R) = (1 : Fin 2) >> encRight1 (d :: R) := rfl + +theorem encRight_expose (d : ℕ) (R : List ℕ) : + encRight1 (d :: R) = + (1 : Fin 2) >> ((([1] : List (Fin 2)) ^ d) +> ((encRight1 R).cons 0)) := by + rw [encRight_cons d R, Nat.add_comm d 1, ← listblank_right_pow_add ((encRight1 R).cons 0) 1 d] + rfl + +theorem encLeft_expose (a : ℕ) (L : List ℕ) : + encLeft1 (a :: L) = + (1 : Fin 2) >> (((encLeft1 L).cons 0) <+ (([1] : List (Fin 2)) ^ a)) := by + rw [encLeft_cons a L, ← listblank_append_pow_add ((encLeft1 L).cons 0) a 1] + rfl + +def isFlipped (target_tm : Machine (Fin 2) (Fin 6)) : Bool := + match target_tm 0 1 with + | some (some 5, _) => true + | _ => false + +def cfg_BR (target_tm : Machine (Fin 2) (Fin 6)) (L R : List ℕ) : Cfg (Fin 2) (Fin 6) := + if isFlipped target_tm then + (encLeft1 R) <{{(4 : Fin 6)}} (encRight1 L) + else + (encLeft1 L) {{(1 : Fin 6)}}> (encRight1 R) + +def cfg_C (target_tm : Machine (Fin 2) (Fin 6)) (L R : List ℕ) : Cfg (Fin 2) (Fin 6) := + if isFlipped target_tm then + ⟨some 1, ⟨0, encLeft1 R, encRight1 L⟩⟩ + else + ⟨some 2, ⟨0, encLeft1 L, encRight1 R⟩⟩ + +def cfg_B (target_tm : Machine (Fin 2) (Fin 6)) (L R : List ℕ) : Cfg (Fin 2) (Fin 6) := + if isFlipped target_tm then + ⟨some 4, ⟨0, encLeft1 R, encRight1 L⟩⟩ + else + ⟨some 1, ⟨0, encLeft1 L, encRight1 R⟩⟩ + +def cfg_DR0 (target_tm : Machine (Fin 2) (Fin 6)) (L R : List ℕ) : Cfg (Fin 2) (Fin 6) := + if isFlipped target_tm then + ⟨some 2, ⟨0, (0 : Fin 2) >> encLeft1 R, encRight1 L⟩⟩ + else + ⟨some 3, ⟨0, encLeft1 L, (0 : Fin 2) >> encRight1 R⟩⟩ + +inductive StackMode + | BR + | C + | B + | DR0 + deriving DecidableEq + +def evalStackCfg1 (target_tm : Machine (Fin 2) (Fin 6)) : + StackMode → List ℕ → List ℕ → Cfg (Fin 2) (Fin 6) + | .BR, L, R => cfg_BR target_tm L R + | .C, L, R => cfg_C target_tm L R + | .B, L, R => cfg_B target_tm L R + | .DR0, L, R => cfg_DR0 target_tm L R + +class HasRleStackRules (target_tm : Machine (Fin 2) (Fin 6)) : Prop where + rule_B_nil (L : List ℕ) : + (cfg_B target_tm L []) [target_tm]⊢⁺ (cfg_C target_tm (bumpHead L) []) + rule_B_zero (L R : List ℕ) : + (cfg_B target_tm L (0 :: R)) [target_tm]⊢⁺ (cfg_B target_tm (0 :: L) R) + rule_B_succ (d : ℕ) (L R : List ℕ) : + (cfg_B target_tm L ((d + 1) :: R)) [target_tm]⊢⁺ (cfg_BR target_tm L (0 :: d :: R)) + rule_BR_nil (L : List ℕ) : + (cfg_BR target_tm L []) [target_tm]⊢⁺ (cfg_C target_tm (bumpHead L) []) + rule_BR_zero (L R : List ℕ) : + (cfg_BR target_tm L (0 :: R)) [target_tm]⊢⁺ (cfg_BR target_tm (0 :: L) R) + rule_BR_one (L R : List ℕ) : + (cfg_BR target_tm L (1 :: R)) [target_tm]⊢⁺ (cfg_DR0 target_tm L (bumpHead R)) + rule_BR_add_two (d : ℕ) (L R : List ℕ) : + (cfg_BR target_tm L ((d + 2) :: R)) [target_tm]⊢⁺ (cfg_B target_tm (bumpHead L) (d :: R)) + rule_DR0_nil (R : List ℕ) : + (cfg_DR0 target_tm [] R) [target_tm]⊢⁺ (cfg_C target_tm [1] R) + rule_DR0_zero (L R : List ℕ) : + (cfg_DR0 target_tm (0 :: L) R) [target_tm]⊢⁺ (cfg_DR0 target_tm L (0 :: R)) + rule_DR0_succ (a : ℕ) (L R : List ℕ) : + (cfg_DR0 target_tm ((a + 1) :: L) R) [target_tm]⊢⁺ (cfg_C target_tm (a :: L) (0 :: R)) + rule_C_nil (R : List ℕ) : + (cfg_C target_tm [] R) [target_tm]⊢⁺ (cfg_DR0 target_tm [] R) + rule_C_zero_nil (R : List ℕ) : + (cfg_C target_tm [0] R) [target_tm]⊢⁺ (cfg_C target_tm [] (1 :: R)) + rule_C_zero_zero (L R : List ℕ) : + (cfg_C target_tm (0 :: 0 :: L) R) [target_tm]⊢⁺ (cfg_C target_tm (bumpHead L) (1 :: R)) + rule_C_zero_one (L R : List ℕ) : + (cfg_C target_tm (0 :: 1 :: L) R) [target_tm]⊢⁺ + (cfg_C target_tm (bumpHead (bumpHead L)) (0 :: bumpHead R)) + rule_C_zero_add_two (a : ℕ) (L R : List ℕ) : + (cfg_C target_tm (0 :: (a + 2) :: L) R) [target_tm]⊢⁺ + (cfg_BR target_tm (a :: L) (0 :: 1 :: R)) + rule_C_one_nil (R : List ℕ) : + (cfg_C target_tm [1] R) [target_tm]⊢⁺ (cfg_B target_tm [0] (1 :: R)) + rule_C_one_zero (L R : List ℕ) : + (cfg_C target_tm (1 :: 0 :: L) R) [target_tm]⊢⁺ (cfg_DR0 target_tm L (2 :: R)) + rule_C_one_succ (a : ℕ) (L R : List ℕ) : + (cfg_C target_tm (1 :: (a + 1) :: L) R) [target_tm]⊢⁺ (cfg_C target_tm (a :: L) (2 :: R)) + rule_C_add_two_halt (a : ℕ) (L R : List ℕ) : + ∃ cfg', ((cfg_C target_tm ((a + 2) :: L) R) [target_tm]⊢⁺ cfg') ∧ + (step target_tm cfg').isNone + +variable {target_tm : Machine (Fin 2) (Fin 6)} [HasRleStackRules target_tm] + +abbrev rule_B_nil := HasRleStackRules.rule_B_nil (target_tm := target_tm) +abbrev rule_B_zero := HasRleStackRules.rule_B_zero (target_tm := target_tm) +abbrev rule_B_succ := HasRleStackRules.rule_B_succ (target_tm := target_tm) +abbrev rule_BR_nil := HasRleStackRules.rule_BR_nil (target_tm := target_tm) +abbrev rule_BR_zero := HasRleStackRules.rule_BR_zero (target_tm := target_tm) +abbrev rule_BR_one := HasRleStackRules.rule_BR_one (target_tm := target_tm) +abbrev rule_BR_add_two := HasRleStackRules.rule_BR_add_two (target_tm := target_tm) +abbrev rule_DR0_nil := HasRleStackRules.rule_DR0_nil (target_tm := target_tm) +abbrev rule_DR0_zero := HasRleStackRules.rule_DR0_zero (target_tm := target_tm) +abbrev rule_DR0_succ := HasRleStackRules.rule_DR0_succ (target_tm := target_tm) +abbrev rule_C_nil := HasRleStackRules.rule_C_nil (target_tm := target_tm) +abbrev rule_C_zero_nil := HasRleStackRules.rule_C_zero_nil (target_tm := target_tm) +abbrev rule_C_zero_zero := HasRleStackRules.rule_C_zero_zero (target_tm := target_tm) +abbrev rule_C_zero_one := HasRleStackRules.rule_C_zero_one (target_tm := target_tm) +abbrev rule_C_zero_add_two := HasRleStackRules.rule_C_zero_add_two (target_tm := target_tm) +abbrev rule_C_one_nil := HasRleStackRules.rule_C_one_nil (target_tm := target_tm) +abbrev rule_C_one_zero := HasRleStackRules.rule_C_one_zero (target_tm := target_tm) +abbrev rule_C_one_succ := HasRleStackRules.rule_C_one_succ (target_tm := target_tm) +abbrev rule_C_add_two_halt := HasRleStackRules.rule_C_add_two_halt (target_tm := target_tm) + + + + +-- ============================================================================ +-- Section 2: Semantic Multi-Step Contractions on `List ℕ` +-- ============================================================================ + +@[simp] theorem stepStar_refl {M : Machine Γ Λ} (c : Cfg Γ Λ) : c [M]⊢* c := ⟨0, rfl⟩ +theorem pow_zero_list_gen {α : Type*} (l : List α) : l ^ (0 : ℕ) = [] := rfl +theorem pow_succ_list_gen {α : Type*} (l : List α) (n : ℕ) : l ^ (n + 1) = l ++ l ^ n := rfl + +theorem pow_succ_right_list {α : Type*} (l : List α) : ∀ (n : ℕ), + l ^ (n + 1) = l ^ n ++ l + | 0 => List.append_nil l + | n + 1 => by + change l ++ l ^ (n + 1) = (l ++ l ^ n) ++ l + rw [pow_succ_right_list l n, List.append_assoc] + +abbrev rep0 (n : ℕ) : List ℕ := List.replicate n 0 +def blkL (r : ℕ) : List ℕ := rep0 (r + 2) ++ [1] +def blkR (r : ℕ) : List ℕ := rep0 r ++ [2, 1] + +theorem rep0_zero : rep0 0 = [] := rfl +theorem rep0_succ (n : ℕ) : rep0 (n + 1) = 0 :: rep0 n := rfl + +theorem rep0_append_zero_cons (k : ℕ) (L : List ℕ) : + rep0 k ++ (0 :: L) = 0 :: (rep0 k ++ L) := by + induction k with + | zero => rfl + | succ k' ih => simp only [List.replicate_succ, List.cons_append]; rw [ih] + +theorem rep0_add_split (a b : ℕ) : rep0 (a + b) = rep0 a ++ rep0 b := + List.replicate_add a b 0 + +macro "norm_list" : tactic => `(tactic| + simp only [HPow.hPow, List.append_eq, + blkL, blkR, bumpHead, + List.replicate_succ, List.replicate_zero, rep0_add_split, + List.nil_append, List.cons_append, List.append_nil, List.append_assoc, + rep0_append_zero_cons, List.flatten_cons, List.flatten_nil]) + +theorem rule_BR_zeros_all (L R : List ℕ) (k : ℕ) : + (cfg_BR target_tm L (rep0 k ++ R)) [target_tm]⊢* (cfg_BR target_tm (rep0 k ++ L) R) := by + induction k generalizing L with + | zero => exact ⟨0, rfl⟩ + | succ k ih => + have h1 := stepPlus_stepStar (rule_BR_zero (target_tm := target_tm) L (rep0 k ++ R)) + have h2 := ih (0 :: L) + rw [rep0_append_zero_cons k L] at h2 + exact stepStar_trans h1 h2 + +theorem rule_B_zeros_all (L R : List ℕ) (k : ℕ) : + (cfg_B target_tm L (rep0 k ++ R)) [target_tm]⊢* (cfg_B target_tm (rep0 k ++ L) R) := by + induction k generalizing L with + | zero => exact ⟨0, rfl⟩ + | succ k ih => + have h1 := stepPlus_stepStar (rule_B_zero (target_tm := target_tm) L (rep0 k ++ R)) + have h2 := ih (0 :: L) + rw [rep0_append_zero_cons k L] at h2 + exact stepStar_trans h1 h2 + +theorem rule_DR0_zeros_all (L R : List ℕ) (k : ℕ) : + (cfg_DR0 target_tm (rep0 k ++ L) R) [target_tm]⊢* (cfg_DR0 target_tm L (rep0 k ++ R)) := by + induction k generalizing R with + | zero => exact ⟨0, rfl⟩ + | succ k ih => + have h1 := stepPlus_stepStar (rule_DR0_zero (target_tm := target_tm) (rep0 k ++ L) R) + have h2 := ih (0 :: R) + rw [rep0_append_zero_cons k R] at h2 + exact stepStar_trans h1 h2 + +theorem rule_B_succ_step (d : ℕ) (L R : List ℕ) : + (cfg_B target_tm L ((d + 1) :: R)) [target_tm]⊢⁺ (cfg_BR target_tm (0 :: L) (d :: R)) := + stepPlus_trans (rule_B_succ d L R) (rule_BR_zero L (d :: R)) + +theorem rule_C_one_prefix (c0 : ℕ) (L R : List ℕ) : + (cfg_C target_tm (1 :: (rep0 c0 ++ 1 :: L)) R) [target_tm]⊢* + (cfg_C target_tm (0 :: L) (rep0 c0 ++ 2 :: R)) := by + cases c0 with + | zero => exact stepPlus_stepStar (rule_C_one_succ 0 L R) + | succ n => + have h1 := stepPlus_stepStar (rule_C_one_zero (target_tm := target_tm) (rep0 n ++ 1 :: L) R) + have h2 := rule_DR0_zeros_all (target_tm := target_tm) (1 :: L) (2 :: R) n + have h3 := stepPlus_stepStar (rule_DR0_succ (target_tm := target_tm) 0 L (rep0 n ++ 2 :: R)) + exact stepStar_trans h1 (stepStar_trans h2 h3) + +theorem rule_C_r_add_three (r : ℕ) (L R : List ℕ) : + (cfg_C target_tm (rep0 (r + 3) ++ 1 :: L) R) [target_tm]⊢* + (cfg_C target_tm (0 :: L) (blkR r ++ R)) := by + have heq1 : rep0 (r + 3) ++ 1 :: L = 0 :: 0 :: 0 :: (rep0 r ++ 1 :: L) := by norm_list + rw [heq1] + have h1 := stepPlus_stepStar (rule_C_zero_zero (target_tm := target_tm) (0 :: (rep0 r ++ 1 :: L)) + R) + have h2 := rule_C_one_prefix (target_tm := target_tm) r L (1 :: R) + have heq2 : rep0 r ++ 2 :: 1 :: R = blkR r ++ R := by norm_list + rw [heq2] at h2 + exact stepStar_trans h1 h2 + +theorem rule_C_blkL_pow : ∀ (c r : ℕ) (L R : List ℕ), + (cfg_C target_tm (0 :: ((blkL r) ^ c ++ L)) R) [target_tm]⊢* + (cfg_C target_tm (0 :: L) ((blkR r) ^ c ++ R)) + | 0, r, L, R => ⟨0, rfl⟩ + | c + 1, r, L, R => by + have heq : 0 :: ((blkL r) ^ (c + 1) ++ L) = + rep0 (r + 3) ++ 1 :: ((blkL r) ^ c ++ L) := by norm_list + rw [heq] + have h1 := rule_C_r_add_three (target_tm := target_tm) r ((blkL r) ^ c ++ L) R + have h2 := rule_C_blkL_pow c r L (blkR r ++ R) + have h3 : (blkR r) ^ c ++ (blkR r ++ R) = (blkR r) ^ (c + 1) ++ R := by + rw [← List.append_assoc, ← pow_succ_right_list] + rw [h3] at h2 + exact stepStar_trans h1 h2 + +theorem rule_C_bot_four (r : ℕ) (R : List ℕ) : + (cfg_C target_tm (rep0 (r + 4)) R) [target_tm]⊢* + (cfg_DR0 target_tm [] (blkR r ++ R)) := by + have heq : rep0 (r + 4) = 0 :: 0 :: 0 :: 0 :: rep0 r := by norm_list + rw [heq] + have h1 := stepPlus_stepStar (rule_C_zero_zero (target_tm := target_tm) (0 :: 0 :: rep0 r) R) + have h2 := stepPlus_stepStar (rule_C_one_zero (target_tm := target_tm) (rep0 r) (1 :: R)) + have h3 := rule_DR0_zeros_all (target_tm := target_tm) [] (2 :: 1 :: R) r + have heq0 : rep0 r ++ [] = rep0 r := List.append_nil _ + have heq2 : rep0 r ++ 2 :: 1 :: R = blkR r ++ R := by norm_list + rw [heq0, heq2] at h3 + exact stepStar_trans h1 (stepStar_trans h2 h3) + +theorem rule_DR0_bot (k : ℕ) (R : List ℕ) : + (cfg_DR0 target_tm (rep0 k) R) [target_tm]⊢* (cfg_BR target_tm (rep0 (k + 3)) R) := by + have h0 : rep0 k = rep0 k ++ [] := (List.append_nil _).symm + rw [h0] + have h1 := rule_DR0_zeros_all (target_tm := target_tm) [] R k + have h2 := stepPlus_stepStar (rule_DR0_nil (target_tm := target_tm) (rep0 k ++ R)) + have h3 := stepPlus_stepStar (rule_C_one_nil (target_tm := target_tm) (rep0 k ++ R)) + have h4 := stepPlus_stepStar (rule_B_succ_step (target_tm := target_tm) 0 [0] (rep0 k ++ R)) + have h5 := rule_BR_zeros_all (target_tm := target_tm) [0, 0] R (k + 1) + have heqR : 0 :: (rep0 k ++ R) = rep0 (k + 1) ++ R := rfl + have heqL : rep0 (k + 1) ++ [0, 0] = rep0 (k + 3) := by norm_list + rw [heqR] at h4; rw [heqL] at h5 + exact stepStar_trans h1 (stepStar_trans h2 (stepStar_trans h3 (stepStar_trans h4 h5))) + +theorem rule_DR0_bot_zeros : ∀ (q k : ℕ) (R : List ℕ), + (cfg_DR0 target_tm (rep0 k) (1 :: (rep0 q ++ R))) [target_tm]⊢* + (cfg_DR0 target_tm (rep0 (k + 3 * q)) (1 :: R)) + | 0, k, R => by simp + | q + 1, k, R => by + have h1 := rule_DR0_bot (target_tm := target_tm) k (1 :: (0 :: (rep0 q ++ R))) + have h2 := stepPlus_stepStar (rule_BR_one (target_tm := target_tm) (rep0 (k + 3)) + (0 :: (rep0 q ++ R))) + have h3 := rule_DR0_bot_zeros q (k + 3) R + have heq : k + 3 + 3 * q = k + 3 * (q + 1) := by omega + rw [heq] at h3 + exact stepStar_trans h1 (stepStar_trans h2 h3) + +theorem rule_BR_blkR_one (r : ℕ) (L R : List ℕ) : + (cfg_BR target_tm (0 :: L) (blkR r ++ R)) [target_tm]⊢* + (cfg_BR target_tm (rep0 3 ++ 1 :: (rep0 r ++ L)) R) := by + have h0 : blkR r ++ R = rep0 r ++ (2 :: 1 :: R) := by norm_list + rw [h0] + have h1 := rule_BR_zeros_all (target_tm := target_tm) (0 :: L) (2 :: 1 :: R) r + rw [rep0_append_zero_cons r L] at h1 + have h2 := stepPlus_stepStar (rule_BR_add_two (target_tm := target_tm) 0 + (0 :: (rep0 r ++ L)) (1 :: R)) + have h3 := stepPlus_stepStar (rule_B_zero (target_tm := target_tm) (1 :: (rep0 r ++ L)) (1 :: R)) + have h4 := stepPlus_stepStar (rule_B_succ_step (target_tm := target_tm) 0 + (0 :: 1 :: (rep0 r ++ L)) R) + have h5 := stepPlus_stepStar (rule_BR_zero (target_tm := target_tm) + (0 :: 0 :: 1 :: (rep0 r ++ L)) R) + exact stepStar_trans h1 (stepStar_trans h2 (stepStar_trans h3 (stepStar_trans h4 h5))) + +theorem rule_BR_blkR_succ : ∀ (k r : ℕ) (L R : List ℕ), + (cfg_BR target_tm (0 :: L) ((blkR r) ^ (k + 1) ++ R)) [target_tm]⊢* + (cfg_BR target_tm (rep0 3 ++ 1 :: ((blkL r) ^ k ++ (rep0 r ++ L))) R) + | 0, r, L, R => by + simpa [HPow.hPow, List.append_eq, List.replicate_succ, List.replicate_zero, List.flatten_cons + , List.flatten_nil] using rule_BR_blkR_one r L R + | k + 1, r, L, R => by + have heqR : (blkR r) ^ (k + 2) ++ R = blkR r ++ ((blkR r) ^ (k + 1) ++ R) := by + simp [HPow.hPow, List.replicate_succ, List.flatten_cons, List.append_assoc] + rw [heqR] + have h1 := rule_BR_blkR_one (target_tm := target_tm) r L ((blkR r) ^ (k + 1) ++ R) + have h2 := rule_BR_blkR_succ k r (0 :: 0 :: 1 :: (rep0 r ++ L)) R + have heqL1 : rep0 3 ++ 1 :: (rep0 r ++ L) = 0 :: (0 :: 0 :: 1 :: (rep0 r ++ L)) := rfl + rw [heqL1] at h1 + have heqL2 : (blkL r) ^ k ++ (rep0 r ++ (0 :: 0 :: 1 :: (rep0 r ++ L))) = + (blkL r) ^ (k + 1) ++ (rep0 r ++ L) := by + have hb : rep0 r ++ (0 :: 0 :: 1 :: (rep0 r ++ L)) = blkL r ++ (rep0 r ++ L) := by norm_list + rw [hb, ← List.append_assoc, ← pow_succ_right_list] + rw [heqL2] at h2 + exact stepStar_trans h1 h2 + +theorem rule_BR_blkR_clean (c r : ℕ) (L R : List ℕ) : + (cfg_BR target_tm (rep0 3 ++ 1 :: L) ((blkR r) ^ c ++ R)) [target_tm]⊢* + (cfg_BR target_tm (rep0 3 ++ 1 :: ((blkL r) ^ c ++ L)) R) := by + cases c with + | zero => exact ⟨0, rfl⟩ + | succ k => + have h := rule_BR_blkR_succ (target_tm := target_tm) k r (0 :: 0 :: 1 :: L) R + have heq1 : (blkL r) ^ k ++ (rep0 r ++ (0 :: 0 :: 1 :: L)) = + (blkL r) ^ (k + 1) ++ L := by + have hb : rep0 r ++ (0 :: 0 :: 1 :: L) = blkL r ++ L := by norm_list + rw [hb, ← List.append_assoc, ← pow_succ_right_list] + rw [heq1] at h + exact h + +-- ============================================================================ +-- Section 3: Clean-Mode Invariant Structure & O(1) Contraction Theorems +-- ============================================================================ + +def decSegs : List (ℕ × ℕ) → List ℕ + | [] => [] + | (r, c) :: ss => (blkL r) ^ c ++ decSegs ss + +inductive Item where + | z (c : ℕ) + | d (v : ℕ) + | k (r c : ℕ) + +inductive LState where + | raw (items : List Item) + | clean (c0 : ℕ) (segs : List (ℕ × ℕ)) (bot : ℕ) + +def decL : List Item → List ℕ + | [] => [] + | .z c :: xs => rep0 c ++ decL xs + | .d v :: xs => v :: decL xs + | .k r c :: xs => (blkL r) ^ c ++ decL xs + +def decR : List Item → List ℕ + | [] => [] + | .z c :: xs => rep0 c ++ decR xs + | .d v :: xs => v :: decR xs + | .k r c :: xs => (blkR r) ^ c ++ decR xs + +def decLState : LState → List ℕ + | .raw items => decL items + | .clean c0 segs bot => rep0 c0 ++ 1 :: (decSegs segs ++ rep0 (bot + 2)) + +def pushSeg (r c : ℕ) (segs : List (ℕ × ℕ)) : List (ℕ × ℕ) := + if Nat.beq c 0 then segs + else match segs with + | (r2, c2) :: ss => if Nat.beq r r2 then (r, c + c2) :: ss else (r, c) :: segs + | [] => [(r, c)] + +theorem decSegs_pushSeg (r c : ℕ) (segs : List (ℕ × ℕ)) : + decSegs (pushSeg r c segs) = (blkL r) ^ c ++ decSegs segs := by + unfold pushSeg + split + · next h => rw [Nat.beq_eq] at h; subst h; rfl + · cases segs with + | nil => rfl + | cons hd ss => + rcases hd with ⟨r2, c2⟩ + dsimp only + split + · next hr => + rw [Nat.beq_eq] at hr; subst hr + simp [decSegs, list_pow_add, List.append_assoc] + · rfl + +macro "norm_all" : tactic => `(tactic| + simp only [decL, decR, decSegs, decLState, decSegs_pushSeg, + HPow.hPow, List.append_eq, + blkL, blkR, bumpHead, + List.replicate_succ, List.replicate_zero, rep0_add_split, + List.nil_append, List.cons_append, List.append_nil, List.append_assoc, + rep0_append_zero_cons, List.flatten_cons, List.flatten_nil]) + +theorem clean_sweep_core : ∀ (segs : List (ℕ × ℕ)) (bot : ℕ) (R : List ℕ), + (cfg_C target_tm (0 :: (decSegs segs ++ rep0 (bot + 3))) R) [target_tm]⊢* + (cfg_BR target_tm (rep0 3 ++ 1 :: (decSegs segs ++ rep0 (bot + 2))) R) + | [], bot, R => by + dsimp only [decSegs] + have heq : (0 :: ([] ++ rep0 (bot + 3))) = rep0 (bot + 4) := by norm_all + rw [heq] + have h1 := rule_C_bot_four (target_tm := target_tm) bot R + have h2 := rule_DR0_bot (target_tm := target_tm) 0 (blkR bot ++ R) + have h3 := rule_BR_blkR_one (target_tm := target_tm) bot [0, 0] R + have heq2 : rep0 bot ++ [0, 0] = rep0 (bot + 2) := by norm_all + rw [heq2] at h3 + exact stepStar_trans h1 (stepStar_trans h2 h3) + | (r, c) :: ss, bot, R => by + dsimp only [decSegs] + rw [List.append_assoc] + have h1 := rule_C_blkL_pow (target_tm := target_tm) c r (decSegs ss ++ rep0 (bot + 3)) R + have h2 := clean_sweep_core ss bot ((blkR r) ^ c ++ R) + have h3 := rule_BR_blkR_clean (target_tm := target_tm) c r (decSegs ss ++ rep0 (bot + 2)) R + rw [← List.append_assoc] at h3 + exact stepStar_trans h1 (stepStar_trans h2 h3) + +theorem clean_DR0_one (c0 : ℕ) (segs : List (ℕ × ℕ)) (bot : ℕ) (R : List ℕ) : + (cfg_DR0 target_tm (decLState (.clean c0 segs (bot + 1))) R) [target_tm]⊢* + (cfg_BR target_tm (decLState (.clean (c0 + 4) segs bot)) R) := by + dsimp only [decLState] + have h1 := rule_DR0_zeros_all (target_tm := target_tm) + (1 :: (decSegs segs ++ rep0 (bot + 3))) R c0 + have h2 := stepPlus_stepStar (rule_DR0_succ (target_tm := target_tm) 0 + (decSegs segs ++ rep0 (bot + 3)) (rep0 c0 ++ R)) + have h3 := clean_sweep_core (target_tm := target_tm) segs bot (0 :: (rep0 c0 ++ R)) + have h4 := rule_BR_zeros_all (target_tm := target_tm) + (rep0 3 ++ 1 :: (decSegs segs ++ rep0 (bot + 2))) R (c0 + 1) + have heqL : rep0 (c0 + 1) ++ (rep0 3 ++ 1 :: (decSegs segs ++ rep0 (bot + 2))) = + rep0 (c0 + 4) ++ 1 :: (decSegs segs ++ rep0 (bot + 2)) := by norm_all + rw [heqL] at h4 + exact stepStar_trans h1 (stepStar_trans h2 (stepStar_trans h3 h4)) + +theorem clean_DR0_zeros : ∀ (q c0 : ℕ) (segs : List (ℕ × ℕ)) (bot : ℕ) (R : List ℕ), + (cfg_DR0 target_tm (decLState (.clean c0 segs (bot + q))) (1 :: (rep0 q ++ R))) [target_tm]⊢* + (cfg_DR0 target_tm (decLState (.clean (c0 + 4 * q) segs bot)) (1 :: R)) + | 0, c0, segs, bot, R => ⟨0, rfl⟩ + | q + 1, c0, segs, bot, R => by + rw [show bot + (q + 1) = (bot + q) + 1 by omega] + have h1 := clean_DR0_one (target_tm := target_tm) c0 segs (bot + q) (1 :: (0 :: (rep0 q ++ R))) + have h2 := stepPlus_stepStar (rule_BR_one (target_tm := target_tm) + (decLState (.clean (c0 + 4) segs (bot + q))) (0 :: (rep0 q ++ R))) + have h3 := clean_DR0_zeros q (c0 + 4) segs bot R + have heq : c0 + 4 + 4 * q = c0 + 4 * (q + 1) := by omega + rw [heq] at h3 + exact stepStar_trans h1 (stepStar_trans h2 h3) + +theorem clean_RNIL_one (m : StackMode) (hm : m = .B ∨ m = .BR) + (c0 : ℕ) (segs : List (ℕ × ℕ)) (bot : ℕ) : + (evalStackCfg1 target_tm m (decLState (.clean (c0 + 1) segs (bot + 1))) []) [target_tm]⊢* + (cfg_B target_tm (decLState (.clean 1 (pushSeg c0 1 segs) bot)) []) := by + have h0 : (evalStackCfg1 target_tm m (decLState (.clean (c0 + 1) segs (bot + 1))) []) + [target_tm]⊢* + (cfg_C target_tm (1 :: (rep0 c0 ++ 1 :: (decSegs segs ++ rep0 (bot + 3)))) []) := by + have heqL : bumpHead (decLState (.clean (c0 + 1) segs (bot + 1))) = + 1 :: (rep0 c0 ++ 1 :: (decSegs segs ++ rep0 (bot + 3))) := by norm_all + rcases hm with rfl | rfl + · rw [← heqL]; exact stepPlus_stepStar (rule_B_nil _) + · rw [← heqL]; exact stepPlus_stepStar (rule_BR_nil _) + have h1 := rule_C_one_prefix (target_tm := target_tm) c0 (decSegs segs ++ rep0 (bot + 3)) [] + have h2 := clean_sweep_core (target_tm := target_tm) segs bot (rep0 c0 ++ [2]) + have h3 := rule_BR_zeros_all (target_tm := target_tm) + (rep0 3 ++ 1 :: (decSegs segs ++ rep0 (bot + 2))) [2] c0 + have heq3 : rep0 c0 ++ (rep0 3 ++ 1 :: (decSegs segs ++ rep0 (bot + 2))) = + 0 :: (rep0 (c0 + 2) ++ 1 :: (decSegs segs ++ rep0 (bot + 2))) := by norm_all + rw [heq3] at h3 + have h4 := stepPlus_stepStar (rule_BR_add_two (target_tm := target_tm) 0 + (0 :: (rep0 (c0 + 2) ++ 1 :: (decSegs segs ++ rep0 (bot + 2)))) []) + have h5 := stepPlus_stepStar (rule_B_zero (target_tm := target_tm) + (1 :: (rep0 (c0 + 2) ++ 1 :: (decSegs segs ++ rep0 (bot + 2)))) []) + have heq5 : 0 :: 1 :: (rep0 (c0 + 2) ++ 1 :: (decSegs segs ++ rep0 (bot + 2))) = + decLState (.clean 1 (pushSeg c0 1 segs) bot) := by norm_all + rw [heq5] at h5 + exact stepStar_trans h0 (stepStar_trans h1 (stepStar_trans h2 (stepStar_trans h3 (stepStar_trans + h4 h5)))) + +theorem decSegs_pushSeg_succ (r q : ℕ) (segs : List (ℕ × ℕ)) : + decSegs (pushSeg r q (pushSeg r 1 segs)) = decSegs (pushSeg r (q + 1) segs) := by + rw [decSegs_pushSeg, decSegs_pushSeg, decSegs_pushSeg, ← List.append_assoc, + ← list_pow_add] + +theorem clean_RNIL_zero_pow : ∀ (q : ℕ) (segs : List (ℕ × ℕ)) (bot : ℕ), + (cfg_B target_tm (decLState (.clean 1 segs (bot + q))) []) [target_tm]⊢* + (cfg_B target_tm (decLState (.clean 1 (pushSeg 0 q segs) bot)) []) + | 0, segs, bot => by simp [pushSeg] + | q + 1, segs, bot => by + rw [show bot + (q + 1) = (bot + q) + 1 by omega] + have h1 := clean_RNIL_one (target_tm := target_tm) .B (Or.inl rfl) 0 segs (bot + q) + have h2 := clean_RNIL_zero_pow q (pushSeg 0 1 segs) bot + have heqL : decLState (.clean 1 (pushSeg 0 q (pushSeg 0 1 segs)) bot) = + decLState (.clean 1 (pushSeg 0 (q + 1) segs) bot) := by + simp [decLState, decSegs_pushSeg_succ] + rw [heqL] at h2 + exact stepStar_trans h1 h2 + +theorem clean_P1_one (r : ℕ) (segs : List (ℕ × ℕ)) (bot : ℕ) (R : List ℕ) : + (cfg_B target_tm (decLState (.clean 0 segs (bot + 1))) (0 :: (blkR r ++ R))) [target_tm]⊢* + (cfg_B target_tm (decLState (.clean 0 (pushSeg (r + 3) 1 segs) bot)) (0 :: R)) := by + have heqR : 0 :: (blkR r ++ R) = rep0 (r + 1) ++ (2 :: 1 :: R) := by norm_all + rw [heqR] + have h1 := rule_B_zeros_all (target_tm := target_tm) + (decLState (.clean 0 segs (bot + 1))) (2 :: 1 :: R) (r + 1) + have h2 := stepPlus_stepStar (rule_B_succ_step (target_tm := target_tm) 1 + (rep0 (r + 1) ++ decLState (.clean 0 segs (bot + 1))) (1 :: R)) + have heq2 : 0 :: (rep0 (r + 1) ++ decLState (.clean 0 segs (bot + 1))) = + decLState (.clean (r + 2) segs (bot + 1)) := by norm_all + rw [heq2] at h2 + have h3 := stepPlus_stepStar (rule_BR_one (target_tm := target_tm) + (decLState (.clean (r + 2) segs (bot + 1))) (1 :: R)) + have h4 := clean_DR0_one (target_tm := target_tm) (r + 2) segs bot (2 :: R) + have h5 := stepPlus_stepStar (rule_BR_add_two (target_tm := target_tm) 0 + (decLState (.clean (r + 6) segs bot)) R) + have heq5 : bumpHead (decLState (.clean (r + 6) segs bot)) = + decLState (.clean 0 (pushSeg (r + 3) 1 segs) bot) := by norm_all + rw [heq5] at h5 + exact stepStar_trans h1 (stepStar_trans h2 (stepStar_trans h3 (stepStar_trans h4 h5))) + +theorem clean_P1_pow : ∀ (q r : ℕ) (segs : List (ℕ × ℕ)) (bot : ℕ) (R : List ℕ), + (cfg_B target_tm (decLState (.clean 0 segs (bot + q))) (0 :: ((blkR r) ^ q ++ R))) + [target_tm]⊢* + (cfg_B target_tm (decLState (.clean 0 (pushSeg (r + 3) q segs) bot)) (0 :: R)) + | 0, r, segs, bot, R => by simp [pushSeg, HPow.hPow, List.flatten_nil] + | q + 1, r, segs, bot, R => by + rw [show bot + (q + 1) = (bot + q) + 1 by omega] + have heqR : (blkR r) ^ (q + 1) ++ R = blkR r ++ ((blkR r) ^ q ++ R) := by + simp [HPow.hPow, List.replicate_succ, List.flatten_cons, List.append_assoc] + rw [heqR] + have h1 := clean_P1_one (target_tm := target_tm) r segs (bot + q) ((blkR r) ^ q ++ R) + have h2 := clean_P1_pow q r (pushSeg (r + 3) 1 segs) bot R + have heqL : decLState (.clean 0 (pushSeg (r + 3) q (pushSeg (r + 3) 1 segs)) bot) = + decLState (.clean 0 (pushSeg (r + 3) (q + 1) segs) bot) := by + simp [decLState, decSegs_pushSeg_succ] + rw [heqL] at h2 + exact stepStar_trans h1 h2 + +theorem clean_P2_one (r : ℕ) (segs : List (ℕ × ℕ)) (bot : ℕ) (R : List ℕ) : + (cfg_B target_tm (decLState (.clean 0 segs (bot + (r + 1)))) (1 :: 1 :: (blkR r ++ R))) + [target_tm]⊢* + (cfg_B target_tm (decLState (.clean 0 (pushSeg (4 * r + 3) 1 segs) bot)) (1 :: 1 :: R)) := by + cases r with + | zero => + have h1 := stepPlus_stepStar (rule_B_succ_step (target_tm := target_tm) 0 + (decLState (.clean 0 segs (bot + 1))) (1 :: (blkR 0 ++ R))) + have h2 := stepPlus_stepStar (rule_BR_zero (target_tm := target_tm) + (0 :: decLState (.clean 0 segs (bot + 1))) (1 :: (blkR 0 ++ R))) + have heq2 : 0 :: 0 :: decLState (.clean 0 segs (bot + 1)) = + decLState (.clean 2 segs (bot + 1)) := rfl + rw [heq2] at h2 + have h3 := stepPlus_stepStar (rule_BR_one (target_tm := target_tm) + (decLState (.clean 2 segs (bot + 1))) (blkR 0 ++ R)) + have hb0 : bumpHead (blkR 0 ++ R) = 3 :: 1 :: R := rfl + rw [hb0] at h3 + have h4 := clean_DR0_one (target_tm := target_tm) 2 segs bot (3 :: 1 :: R) + have h5 := stepPlus_stepStar (rule_BR_add_two (target_tm := target_tm) 1 + (decLState (.clean 6 segs bot)) (1 :: R)) + have heq5 : bumpHead (decLState (.clean 6 segs bot)) = + decLState (.clean 0 (pushSeg 3 1 segs) bot) := by norm_all + rw [heq5] at h5 + exact stepStar_trans h1 (stepStar_trans h2 (stepStar_trans h3 (stepStar_trans h4 h5))) + | succ r' => + rw [show bot + (r' + 1 + 1) = (bot + 2) + r' by omega] + have h1 := stepPlus_stepStar (rule_B_succ_step (target_tm := target_tm) 0 + (decLState (.clean 0 segs ((bot + 2) + r'))) (1 :: (blkR (r' + 1) ++ R))) + have h2 := stepPlus_stepStar (rule_BR_zero (target_tm := target_tm) + (0 :: decLState (.clean 0 segs ((bot + 2) + r'))) (1 :: (blkR (r' + 1) ++ R))) + have heq2 : 0 :: 0 :: decLState (.clean 0 segs ((bot + 2) + r')) = + decLState (.clean 2 segs ((bot + 2) + r')) := rfl + rw [heq2] at h2 + have h3 := stepPlus_stepStar (rule_BR_one (target_tm := target_tm) + (decLState (.clean 2 segs ((bot + 2) + r'))) (blkR (r' + 1) ++ R)) + have hb : bumpHead (blkR (r' + 1) ++ R) = 1 :: (rep0 r' ++ (2 :: 1 :: R)) := by norm_all + rw [hb] at h3 + have h4 := clean_DR0_zeros (target_tm := target_tm) r' 2 segs (bot + 2) (2 :: 1 :: R) + have h5 := clean_DR0_one (target_tm := target_tm) (2 + 4 * r') segs (bot + 1) (1 :: 2 :: 1 :: R) + have h6 := stepPlus_stepStar (rule_BR_one (target_tm := target_tm) + (decLState (.clean (2 + 4 * r' + 4) segs (bot + 1))) (2 :: 1 :: R)) + have h7 := clean_DR0_one (target_tm := target_tm) (2 + 4 * r' + 4) segs bot (3 :: 1 :: R) + have h8 := stepPlus_stepStar (rule_BR_add_two (target_tm := target_tm) 1 + (decLState (.clean (2 + 4 * r' + 8) segs bot)) (1 :: R)) + have heq8 : bumpHead (decLState (.clean (2 + 4 * r' + 8) segs bot)) = + decLState (.clean 0 (pushSeg (4 * (r' + 1) + 3) 1 segs) bot) := by + rw [show 4 * (r' + 1) + 3 = 4 * r' + 7 by omega] + norm_all + rw [heq8] at h8 + exact stepStar_trans h1 (stepStar_trans h2 (stepStar_trans h3 + (stepStar_trans h4 (stepStar_trans h5 (stepStar_trans h6 (stepStar_trans h7 h8)))))) + +theorem clean_P2_pow : ∀ (q r : ℕ) (segs : List (ℕ × ℕ)) (bot : ℕ) (R : List ℕ), + (cfg_B target_tm (decLState (.clean 0 segs (bot + q * (r + 1)))) (1 :: 1 :: ((blkR r) ^ q ++ + R))) [target_tm]⊢* + (cfg_B target_tm (decLState (.clean 0 (pushSeg (4 * r + 3) q segs) bot)) (1 :: 1 :: R)) + | 0, r, segs, bot, R => by simp [pushSeg, HPow.hPow, List.flatten_nil] + | q + 1, r, segs, bot, R => by + rw [show bot + (q + 1) * (r + 1) = (bot + q * (r + 1)) + (r + 1) by + rw [Nat.succ_mul, Nat.add_assoc]] + have heqR : (blkR r) ^ (q + 1) ++ R = blkR r ++ ((blkR r) ^ q ++ R) := by + simp [HPow.hPow, List.replicate_succ, List.flatten_cons, List.append_assoc] + rw [heqR] + have h1 := clean_P2_one (target_tm := target_tm) r segs (bot + q * (r + 1)) + ((blkR r) ^ q ++ R) + have h2 := clean_P2_pow q r (pushSeg (4 * r + 3) 1 segs) bot R + have heqL : decLState (.clean 0 (pushSeg (4 * r + 3) q (pushSeg (4 * r + 3) 1 segs)) bot) = + decLState (.clean 0 (pushSeg (4 * r + 3) (q + 1) segs) bot) := by + simp [decLState, decSegs_pushSeg_succ] + rw [heqL] at h2 + exact stepStar_trans h1 h2 + +-- ============================================================================ +-- Section 4: Executable RLE Stack Engine & Denotational Soundness +-- ============================================================================ + +def pushL0 (c : ℕ) (L : List Item) : List Item := + if Nat.beq c 0 then L + else match L with + | .z c2 :: xs => .z (c + c2) :: xs + | _ => .z c :: L + +def pushLk2 (r c : ℕ) (L : List Item) : List Item := + if Nat.beq c 0 then L + else match L with + | .k r2 c2 :: xs => if Nat.beq r r2 then .k r (c + c2) :: xs else .k r c :: L + | _ => .k r c :: L + +def pushLd (v : ℕ) (L : List Item) : List Item := + if Nat.beq v 0 then pushL0 1 L + else if Nat.beq v 1 then + match L with + | .z c :: .d v2 :: xs => + if Nat.beq v2 1 && Nat.ble 2 c then .d 1 :: pushLk2 (c - 2) 1 xs + else .d 1 :: L + | _ => .d 1 :: L + else .d v :: L + +def popKTail (r c : ℕ) (xs : List Item) : List Item := + if Nat.beq c 1 then xs else .k r (c - 1) :: xs + +def popL1 : List Item → Option (ℕ × List Item) + | [] => none + | .z c :: xs => + if Nat.beq c 0 then popL1 xs + else if Nat.beq c 1 then some (0, xs) + else some (0, .z (c - 1) :: xs) + | .k r c :: xs => + if Nat.beq c 0 then popL1 xs + else some (0, pushL0 (r + 1) (pushLd 1 (popKTail r c xs))) + | .d v :: xs => some (v, xs) + +def bumpL (L : List Item) : List Item := + match popL1 L with + | none => [.z 1] + | some (a, L1) => pushLd (a + 1) L1 + +def pushR0 (c : ℕ) (R : List Item) : List Item := + if Nat.beq c 0 then R + else match R with + | .z c2 :: xs => .z (c + c2) :: xs + | _ => .z c :: R + +def mergeRk2Pre (r c : ℕ) (R : List Item) : ℕ × List Item := + if Nat.ble 1 r then + match R with + | .z rz :: .d v2 :: .d v1 :: xs => + if Nat.beq rz r && Nat.beq v2 2 && Nat.beq v1 1 then (c + 1, xs) else (c, R) + | _ => (c, R) + else (c, R) + +def pushRk2 (r c : ℕ) (R : List Item) : List Item := + if Nat.beq c 0 then R + else + let p := mergeRk2Pre r c R + match p.2 with + | .k r2 c2 :: xs => if Nat.beq r r2 then .k r (p.1 + c2) :: xs else .k r p.1 :: p.2 + | _ => .k r p.1 :: p.2 + +def pushRd (v : ℕ) (R : List Item) : List Item := + if Nat.beq v 0 then pushR0 1 R + else if Nat.beq v 2 then + match R with + | .d v1 :: xs => if Nat.beq v1 1 then pushRk2 0 1 xs else .d 2 :: R + | _ => .d 2 :: R + else .d v :: R + +def popR1 : List Item → Option (ℕ × List Item) + | [] => none + | .z c :: xs => + if Nat.beq c 0 then popR1 xs + else if Nat.beq c 1 then some (0, xs) + else some (0, .z (c - 1) :: xs) + | .k r c :: xs => + if Nat.beq c 0 then popR1 xs + else if Nat.beq r 0 then some (2, .d 1 :: popKTail r c xs) + else some (0, pushR0 (r - 1) (.d 2 :: .d 1 :: popKTail r c xs)) + | .d v :: xs => some (v, xs) + +def bumpR (R : List Item) : List Item := + match popR1 R with + | none => [.z 1] + | some (d, R1) => pushRd (d + 1) R1 + +def segsToItems : List (ℕ × ℕ) → List Item → List Item + | [], acc => acc + | (r, c) :: ss, acc => + if Nat.beq c 0 then segsToItems ss acc + else .k r c :: segsToItems ss acc + +def unpackClean (c0 : ℕ) (segs : List (ℕ × ℕ)) (bot : ℕ) : List Item := + let tail := segsToItems segs [.z (bot + 2)] + if Nat.beq c0 0 then .d 1 :: tail else .z c0 :: .d 1 :: tail + +def packTail (cur0 : ℕ) : List Item → Option (List (ℕ × ℕ) × ℕ) + | [] => if Nat.ble 2 cur0 then some ([], cur0 - 2) else none + | .z c :: rest => packTail (cur0 + c) rest + | .d v :: rest => + if Nat.beq v 1 && Nat.ble 2 cur0 then + match packTail 0 rest with + | some (segs, bot) => some (pushSeg (cur0 - 2) 1 segs, bot) + | none => none + else none + | .k r c :: rest => + if Nat.beq c 0 then packTail cur0 rest + else + match packTail 0 rest with + | some (segs, bot) => + some (pushSeg (cur0 + r) 1 (pushSeg r (c - 1) segs), bot) + | none => none + +def packHead (cur0 : ℕ) : List Item → Option LState + | [] => none + | .z c :: rest => packHead (cur0 + c) rest + | .d v :: rest => + if Nat.beq v 1 then + match packTail 0 rest with + | some (segs, bot) => some (.clean cur0 segs bot) + | none => none + else none + | .k r c :: rest => + if Nat.beq c 0 then packHead cur0 rest + else + match packTail 0 rest with + | some (segs, bot) => + some (.clean (cur0 + r + 2) (pushSeg r (c - 1) segs) bot) + | none => none + +theorem decL_pushL0 (c : ℕ) (L : List Item) : + decL (pushL0 c L) = rep0 c ++ decL L := by + unfold pushL0 + split + · next h => rw [Nat.beq_eq] at h; subst h; rfl + · cases L with + | nil => rfl + | cons hd xs => + cases hd with + | z c2 => norm_all + | d _ => rfl + | k _ _ => rfl + +theorem decL_pushLk2 (r c : ℕ) (L : List Item) : + decL (pushLk2 r c L) = (blkL r) ^ c ++ decL L := by + unfold pushLk2 + split + · next h => rw [Nat.beq_eq] at h; subst h; rfl + · cases L with + | nil => rfl + | cons hd xs => + cases hd with + | z _ => rfl + | d _ => rfl + | k r2 c2 => + dsimp only; split + · next hr => + rw [Nat.beq_eq] at hr; subst hr + simp [decL, list_pow_add, List.append_assoc] + · rfl + +theorem decL_pushLd (v : ℕ) (L : List Item) : + decL (pushLd v L) = v :: decL L := by + unfold pushLd + split + · next h => rw [Nat.beq_eq] at h; subst h; simpa using decL_pushL0 1 L + · split + · next h => + rw [Nat.beq_eq] at h; subst h + rcases L with _ | ⟨hd1, _ | ⟨hd2, xs⟩⟩ + · rfl + · cases hd1 <;> rfl + · cases hd1 with + | z c => + cases hd2 with + | d v2 => + dsimp only; split + · next hb => + simp only [Bool.and_eq_true, Nat.beq_eq, Nat.ble_eq] at hb + rcases hb with ⟨rfl, hc⟩ + simp only [decL, decL_pushLk2] + conv_rhs => rw [show c = (c - 2) + 2 by omega] + norm_all + · rfl + | _ => rfl + | _ => rfl + · rfl + +theorem decL_popKTail (r c : ℕ) (xs : List Item) : + decL (popKTail r c xs) = (blkL r) ^ (c - 1) ++ decL xs := by + unfold popKTail; split + · next h => rw [Nat.beq_eq] at h; subst h; rfl + · rfl + +theorem decR_popKTail (r c : ℕ) (xs : List Item) : + decR (popKTail r c xs) = (blkR r) ^ (c - 1) ++ decR xs := by + unfold popKTail; split + · next h => rw [Nat.beq_eq] at h; subst h; rfl + · rfl + +theorem decL_popL1_none : ∀ (L : List Item), popL1 L = none → decL L = [] + | [], _ => rfl + | .z c :: xs, h => by + unfold popL1 at h + split at h + · next hc => rw [Nat.beq_eq] at hc; subst hc; exact decL_popL1_none xs h + · split at h <;> cases h + | .d _ :: _, h => by cases h + | .k r c :: xs, h => by + unfold popL1 at h + split at h + · next hc => rw [Nat.beq_eq] at hc; subst hc; exact decL_popL1_none xs h + · cases h + +theorem decL_popL1_some : ∀ (L : List Item) (a : ℕ) (L' : List Item), + popL1 L = some (a, L') → decL L = a :: decL L' + | [], _, _, h => by cases h + | .z c :: xs, a, L', h => by + unfold popL1 at h + split at h + · next hc => rw [Nat.beq_eq] at hc; subst hc; exact decL_popL1_some xs a L' h + · next hc0 => + have hne : c ≠ 0 := fun heq => hc0 (Nat.beq_eq.mpr heq) + split at h + · next hc1 => + rw [Nat.beq_eq] at hc1; subst hc1 + cases h; rfl + · cases h + conv_lhs => rw [decL, show c = (c - 1) + 1 by omega] + norm_all + | .d v :: xs, a, L', h => by cases h; rfl + | .k r c :: xs, a, L', h => by + unfold popL1 at h + split at h + · next hc => rw [Nat.beq_eq] at hc; subst hc; exact decL_popL1_some xs a L' h + · next hc0 => + have hne : c ≠ 0 := fun heq => hc0 (Nat.beq_eq.mpr heq) + cases h + rw [decL_pushL0, decL_pushLd, decL_popKTail] + conv_lhs => rw [decL, show c = (c - 1) + 1 by omega] + norm_all + +theorem decL_bumpL (L : List Item) : decL (bumpL L) = bumpHead (decL L) := by + unfold bumpL + cases hp : popL1 L with + | none => rw [decL_popL1_none L hp]; rfl + | some p => + rcases p with ⟨a, L1⟩ + rw [decL_popL1_some L a L1 hp, decL_pushLd]; rfl + +theorem decR_pushR0 (c : ℕ) (R : List Item) : + decR (pushR0 c R) = rep0 c ++ decR R := by + unfold pushR0 + split + · next h => rw [Nat.beq_eq] at h; subst h; rfl + · cases R with + | nil => rfl + | cons hd xs => + cases hd with + | z c2 => norm_all + | d _ => rfl + | k _ _ => rfl + +theorem mergeRk2Pre_spec (r c : ℕ) (R : List Item) : + (blkR r) ^ (mergeRk2Pre r c R).1 ++ decR (mergeRk2Pre r c R).2 = + (blkR r) ^ c ++ decR R := by + unfold mergeRk2Pre + split + · rcases R with _ | ⟨hd1, _ | ⟨hd2, _ | ⟨hd3, xs⟩⟩⟩ + · rfl + · cases hd1 <;> rfl + · cases hd1 <;> cases hd2 <;> rfl + · cases hd1 with + | z rz => + cases hd2 with + | d v2 => + cases hd3 with + | d v1 => + dsimp only; split + · next hb => + simp only [Bool.and_eq_true, Nat.beq_eq] at hb + rcases hb with ⟨⟨rfl, rfl⟩, rfl⟩ + rw [pow_succ_right_list] + norm_all + · rfl + | _ => rfl + | _ => rfl + | _ => rfl + · rfl + +theorem decR_pushRk2 (r c : ℕ) (R : List Item) : + decR (pushRk2 r c R) = (blkR r) ^ c ++ decR R := by + unfold pushRk2 + split + · next h => rw [Nat.beq_eq] at h; subst h; rfl + · have key := mergeRk2Pre_spec r c R + generalize mergeRk2Pre r c R = p at key ⊢ + rcases p with ⟨c', R'⟩ + dsimp only at key ⊢ + cases R' with + | nil => exact key + | cons hd xs => + cases hd with + | z _ => exact key + | d _ => exact key + | k r2 c2 => + dsimp only; split + · next hr => + rw [Nat.beq_eq] at hr; subst hr + rw [← key]; simp [decR, list_pow_add, List.append_assoc] + · exact key + +theorem decR_pushRd (v : ℕ) (R : List Item) : + decR (pushRd v R) = v :: decR R := by + unfold pushRd + split + · next h => rw [Nat.beq_eq] at h; subst h; simpa using decR_pushR0 1 R + · split + · next h => + rw [Nat.beq_eq] at h; subst h + cases R with + | nil => rfl + | cons hd xs => + cases hd with + | d v1 => + dsimp only; split + · next hv => + rw [Nat.beq_eq] at hv; subst hv + rw [decR_pushRk2]; norm_all + · rfl + | _ => rfl + · rfl + +theorem decR_popR1_none : ∀ (R : List Item), popR1 R = none → decR R = [] + | [], _ => rfl + | .z c :: xs, h => by + unfold popR1 at h; split at h + · next hc => rw [Nat.beq_eq] at hc; subst hc; exact decR_popR1_none xs h + · split at h <;> cases h + | .d _ :: _, h => by cases h + | .k r c :: xs, h => by + unfold popR1 at h; split at h + · next hc => rw [Nat.beq_eq] at hc; subst hc; exact decR_popR1_none xs h + · split at h <;> cases h + +theorem decR_popR1_some : ∀ (R : List Item) (d : ℕ) (R' : List Item), + popR1 R = some (d, R') → decR R = d :: decR R' + | [], _, _, h => by cases h + | .z c :: xs, d, R', h => by + unfold popR1 at h; split at h + · next hc => rw [Nat.beq_eq] at hc; subst hc; exact decR_popR1_some xs d R' h + · next hc0 => + have hne : c ≠ 0 := fun heq => hc0 (Nat.beq_eq.mpr heq) + split at h + · next hc1 => rw [Nat.beq_eq] at hc1; subst hc1; cases h; rfl + · cases h + conv_lhs => rw [decR, show c = (c - 1) + 1 by omega] + norm_all + | .d v :: xs, d, R', h => by cases h; rfl + | .k r c :: xs, d, R', h => by + unfold popR1 at h; split at h + · next hc => rw [Nat.beq_eq] at hc; subst hc; exact decR_popR1_some xs d R' h + · next hc0 => + have hne : c ≠ 0 := fun heq => hc0 (Nat.beq_eq.mpr heq) + split at h + · next hr0 => + rw [Nat.beq_eq] at hr0; subst hr0; cases h + rw [decR, decR_popKTail] + conv_lhs => rw [decR, show c = (c - 1) + 1 by omega] + norm_all + · next hr0 => + have hrne : r ≠ 0 := fun heq => hr0 (Nat.beq_eq.mpr heq) + cases h + have hc : (blkR r) ^ c = rep0 ((r - 1) + 1) ++ ([2, 1] ++ (blkR r) ^ (c - 1)) := by + conv_lhs => + rw [show c = (c - 1) + 1 by omega, pow_succ_list_gen] + arg 1 + rw [blkR, show r = (r - 1) + 1 by omega] + exact List.append_assoc _ _ _ + rw [decR_pushR0, decR, decR, decR_popKTail, decR, hc] + simp only [rep0, List.replicate_succ, List.cons_append, List.nil_append, + List.append_assoc] + +theorem decR_bumpR (R : List Item) : decR (bumpR R) = bumpHead (decR R) := by + unfold bumpR + cases hp : popR1 R with + | none => rw [decR_popR1_none R hp]; rfl + | some p => + rcases p with ⟨d, R1⟩ + rw [decR_popR1_some R d R1 hp, decR_pushRd]; rfl + +theorem decL_segsToItems : ∀ (segs : List (ℕ × ℕ)) (acc : List Item), + decL (segsToItems segs acc) = decSegs segs ++ decL acc + | [], acc => rfl + | (r, c) :: ss, acc => by + unfold segsToItems; split + · next hc => + rw [Nat.beq_eq] at hc; subst hc + simpa [decSegs, HPow.hPow] using decL_segsToItems ss acc + · simp [decL, decSegs, decL_segsToItems ss acc, List.append_assoc] + +theorem decL_unpackClean (c0 : ℕ) (segs : List (ℕ × ℕ)) (bot : ℕ) : + decL (unpackClean c0 segs bot) = decLState (.clean c0 segs bot) := by + unfold unpackClean + split + · next hc => rw [Nat.beq_eq] at hc; subst hc; simp [decL, decLState, decL_segsToItems] + · simp [decL, decLState, decL_segsToItems] + +theorem packTail_spec : ∀ (items : List Item) (cur0 : ℕ) (segs : List (ℕ × ℕ)) (bot : ℕ), + packTail cur0 items = some (segs, bot) → + rep0 cur0 ++ decL items = decSegs segs ++ rep0 (bot + 2) + | [], cur0, segs, bot, h => by + unfold packTail at h; split at h + · next hb => + have hge : 2 ≤ cur0 := Nat.ble_eq.mp hb + cases h + rw [show cur0 - 2 + 2 = cur0 by omega]; norm_all + · cases h + | .z c :: rest, cur0, segs, bot, h => by + unfold packTail at h + have ih := packTail_spec rest (cur0 + c) segs bot h + rw [decL, ← List.append_assoc, ← rep0_add_split]; exact ih + | .d v :: rest, cur0, segs, bot, h => by + unfold packTail at h; split at h + · next hb => + simp only [Bool.and_eq_true, Nat.beq_eq, Nat.ble_eq] at hb + rcases hb with ⟨rfl, hge⟩ + cases hp : packTail 0 rest with + | none => rw [hp] at h; cases h + | some p => + rcases p with ⟨ss, b⟩ + have ih := packTail_spec rest 0 ss b hp + rw [hp] at h; cases h + rw [rep0_zero, List.nil_append] at ih + rw [decSegs_pushSeg] + conv_lhs => rw [decL, show cur0 = (cur0 - 2) + 2 by omega] + rw [ih]; norm_all + · cases h + | .k r c :: rest, cur0, segs, bot, h => by + unfold packTail at h; split at h + · next hc => + rw [Nat.beq_eq] at hc; subst hc + simpa [decL, HPow.hPow] using packTail_spec rest cur0 segs bot h + · next hc0 => + have hne : c ≠ 0 := fun heq => hc0 (Nat.beq_eq.mpr heq) + cases hp : packTail 0 rest with + | none => rw [hp] at h; cases h + | some p => + rcases p with ⟨ss, b⟩ + have ih := packTail_spec rest 0 ss b hp + rw [hp] at h; cases h + rw [rep0_zero, List.nil_append] at ih + conv_lhs => rw [decL, show c = (c - 1) + 1 by omega] + rw [ih]; norm_all + +theorem packHead_spec : ∀ (items : List Item) (cur0 : ℕ) (ls : LState), + packHead cur0 items = some ls → + rep0 cur0 ++ decL items = decLState ls + | [], _, _, h => by cases h + | .z c :: rest, cur0, ls, h => by + unfold packHead at h + have ih := packHead_spec rest (cur0 + c) ls h + rw [decL, ← List.append_assoc, ← rep0_add_split]; exact ih + | .d v :: rest, cur0, ls, h => by + unfold packHead at h; split at h + · next hv => + rw [Nat.beq_eq] at hv; subst hv + cases hp : packTail 0 rest with + | none => rw [hp] at h; cases h + | some p => + rcases p with ⟨ss, b⟩ + rw [hp] at h; cases h + have ih := packTail_spec rest 0 ss b hp + rw [rep0_zero, List.nil_append] at ih + simp [decL, decLState, ih] + · cases h + | .k r c :: rest, cur0, ls, h => by + unfold packHead at h; split at h + · next hc => + rw [Nat.beq_eq] at hc; subst hc + simpa [decL, HPow.hPow] using packHead_spec rest cur0 ls h + · next hc0 => + have hne : c ≠ 0 := fun heq => hc0 (Nat.beq_eq.mpr heq) + cases hp : packTail 0 rest with + | none => rw [hp] at h; cases h + | some p => + rcases p with ⟨ss, b⟩ + rw [hp] at h; cases h + have ih := packTail_spec rest 0 ss b hp + rw [rep0_zero, List.nil_append] at ih + conv_lhs => rw [decL, show c = (c - 1) + 1 by omega] + rw [ih]; norm_all + +-- ============================================================================ +-- Section 5: Modular Transition Engine `rleStep` & Per-Mode Soundness +-- ============================================================================ + +structure RleFullState where + mode : StackMode + ls : LState + R : List Item + halted : Bool + +def CanHalt (target_tm : Machine (Fin 2) (Fin 6)) (c : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ cfg, (c [target_tm]⊢* cfg) ∧ (step target_tm cfg).isNone + +omit [HasRleStackRules target_tm] in +theorem canHalt_of_stepStar {c₁ c₂ : Cfg (Fin 2) (Fin 6)} + (h : c₁ [target_tm]⊢* c₂) (hc : CanHalt target_tm c₂) : CanHalt target_tm c₁ := by + obtain ⟨cfg, h₂, hnone⟩ := hc + exact ⟨cfg, stepStar_trans h h₂, hnone⟩ + +omit [HasRleStackRules target_tm] in +theorem canHalt_of_stepPlus {c₁ c₂ : Cfg (Fin 2) (Fin 6)} + (h : c₁ [target_tm]⊢⁺ c₂) (hc : CanHalt target_tm c₂) : CanHalt target_tm c₁ := + canHalt_of_stepStar (stepPlus_stepStar h) hc + +def evalRle (target_tm : Machine (Fin 2) (Fin 6)) (s : RleFullState) : Cfg (Fin 2) (Fin 6) := + evalStackCfg1 target_tm s.mode (decLState s.ls) (decR s.R) + +def StateHalts (target_tm : Machine (Fin 2) (Fin 6)) (s : RleFullState) : Prop := + s.halted = true ∨ CanHalt target_tm (evalRle target_tm s) + +omit [HasRleStackRules target_tm] in +theorem stateHalts_of_stepStar {c : Cfg (Fin 2) (Fin 6)} {s' : RleFullState} + (hf : s'.halted = false) + (hstep : c [target_tm]⊢* evalRle target_tm s') + (hh : StateHalts target_tm s') : CanHalt target_tm c := by + rcases hh with hh | hh + · rw [hf] at hh; cases hh + · exact canHalt_of_stepStar hstep hh + +def isTopD1 : List Item → Bool + | .d v :: _ => Nat.beq v 1 + | _ => false + +def modeCanPack (m : StackMode) (items R : List Item) : Bool := + match m with + | .B => R.isEmpty || isTopD1 items + | .BR => R.isEmpty + | .DR0 => true + | .C => false + +def minNat (a b : ℕ) : ℕ := if Nat.ble a b then a else b + +theorem minNat_le_left (a b : ℕ) : minNat a b ≤ a := by + unfold minNat; split + · exact le_rfl + · next h => have : ¬ a ≤ b := fun hab => h (Nat.ble_eq.mpr hab); omega + +theorem minNat_le_right (a b : ℕ) : minNat a b ≤ b := by + unfold minNat; split + · next h => exact Nat.ble_eq.mp h + · exact le_rfl + +-- 5.1 Raw B +def stepRawB (items R : List Item) : RleFullState := + match R with + | [] => ⟨.C, .raw (bumpL items), [], false⟩ + | .z c :: R1 => ⟨.B, .raw (pushL0 c items), R1, false⟩ + | _ => + match popR1 R with + | none => ⟨.C, .raw (bumpL items), [], false⟩ + | some (d, R1) => + if Nat.beq d 0 then ⟨.B, .raw (pushL0 1 items), R1, false⟩ + else ⟨.BR, .raw items, pushR0 1 (pushRd (d - 1) R1), false⟩ + +theorem stepRawB_halts (items R : List Item) (hh : StateHalts target_tm (stepRawB items R)) : + CanHalt target_tm (cfg_B target_tm (decL items) (decR R)) := by + unfold stepRawB at hh + cases R with + | nil => + refine stateHalts_of_stepStar rfl ?_ hh + simpa [evalRle, evalStackCfg1, decLState, decL_bumpL, decR] using + stepPlus_stepStar (rule_B_nil (decL items)) + | cons hd R1 => + cases hd with + | z c => + refine stateHalts_of_stepStar rfl ?_ hh + simpa [evalRle, evalStackCfg1, decLState, decL_pushL0, decR] using + rule_B_zeros_all (decL items) (decR R1) c + | d v => + dsimp only at hh + cases hp : popR1 (.d v :: R1) with + | none => cases hp + | some p => + rcases p with ⟨d, R2⟩ + rw [hp] at hh + have hR := decR_popR1_some _ d R2 hp + dsimp only at hh; split at hh + · next hd0 => + rw [Nat.beq_eq] at hd0; subst hd0 + refine stateHalts_of_stepStar rfl ?_ hh + rw [hR] + simpa [evalRle, evalStackCfg1, decLState, decL_pushL0] using + stepPlus_stepStar (rule_B_zero (decL items) (decR R2)) + · next hd0 => + have hdne : d ≠ 0 := fun h => hd0 (Nat.beq_eq.mpr h) + refine stateHalts_of_stepStar rfl ?_ hh + rw [hR, show d = (d - 1) + 1 by omega] + simpa [evalRle, evalStackCfg1, decLState, decR_pushR0, decR_pushRd] + using + stepPlus_stepStar (rule_B_succ (d - 1) (decL items) (decR R2)) + | k r c => + dsimp only at hh + cases hp : popR1 (.k r c :: R1) with + | none => + rw [hp] at hh + refine stateHalts_of_stepStar rfl ?_ hh + rw [decR_popR1_none _ hp] + simpa [evalRle, evalStackCfg1, decLState, decL_bumpL, decR] using + stepPlus_stepStar (rule_B_nil (decL items)) + | some p => + rcases p with ⟨d, R2⟩ + rw [hp] at hh + have hR := decR_popR1_some _ d R2 hp + dsimp only at hh; split at hh + · next hd0 => + rw [Nat.beq_eq] at hd0; subst hd0 + refine stateHalts_of_stepStar rfl ?_ hh + rw [hR] + simpa [evalRle, evalStackCfg1, decLState, decL_pushL0] using + stepPlus_stepStar (rule_B_zero (decL items) (decR R2)) + · next hd0 => + have hdne : d ≠ 0 := fun h => hd0 (Nat.beq_eq.mpr h) + refine stateHalts_of_stepStar rfl ?_ hh + rw [hR, show d = (d - 1) + 1 by omega] + simpa [evalRle, evalStackCfg1, decLState, decR_pushR0, decR_pushRd] + using + stepPlus_stepStar (rule_B_succ (d - 1) (decL items) (decR R2)) + +-- 5.2 Raw BR +def stepRawBRPop (items R : List Item) : RleFullState := + match popR1 R with + | none => ⟨.C, .raw (bumpL items), [], false⟩ + | some (d, R1) => + if Nat.beq d 0 then ⟨.BR, .raw (pushL0 1 items), R1, false⟩ + else if Nat.beq d 1 then ⟨.DR0, .raw items, bumpR R1, false⟩ + else ⟨.B, .raw (bumpL items), pushRd (d - 2) R1, false⟩ + +theorem stepRawBRPop_halts (items R : List Item) (hh : StateHalts target_tm (stepRawBRPop items + R)) : + CanHalt target_tm (cfg_BR target_tm (decL items) (decR R)) := by + unfold stepRawBRPop at hh + cases hp : popR1 R with + | none => + rw [hp] at hh + refine stateHalts_of_stepStar rfl ?_ hh + rw [decR_popR1_none R hp] + simpa [evalRle, evalStackCfg1, decLState, decL_bumpL, decR] using + stepPlus_stepStar (rule_BR_nil (decL items)) + | some p => + rcases p with ⟨d, R1⟩ + rw [hp] at hh + have hR := decR_popR1_some R d R1 hp + dsimp only at hh; split at hh + · next hd0 => + rw [Nat.beq_eq] at hd0; subst hd0 + refine stateHalts_of_stepStar rfl ?_ hh + rw [hR] + simpa [evalRle, evalStackCfg1, decLState, decL_pushL0] using + stepPlus_stepStar (rule_BR_zero (decL items) (decR R1)) + · next hd0 => + have hdne0 : d ≠ 0 := fun h => hd0 (Nat.beq_eq.mpr h) + split at hh + · next hd1 => + rw [Nat.beq_eq] at hd1; subst hd1 + refine stateHalts_of_stepStar rfl ?_ hh + rw [hR] + simpa [evalRle, evalStackCfg1, decLState, decR_bumpR] using + stepPlus_stepStar (rule_BR_one (decL items) (decR R1)) + · next hd1 => + have hdne1 : d ≠ 1 := fun h => hd1 (Nat.beq_eq.mpr h) + refine stateHalts_of_stepStar rfl ?_ hh + rw [hR, show d = (d - 2) + 2 by omega] + simpa [evalRle, evalStackCfg1, decLState, decL_bumpL, decR_pushRd] + using + stepPlus_stepStar (rule_BR_add_two (d - 2) (decL items) (decR R1)) + +def stepRawBR (items R : List Item) : RleFullState := + match R with + | [] => ⟨.C, .raw (bumpL items), [], false⟩ + | .z c :: R1 => ⟨.BR, .raw (pushL0 c items), R1, false⟩ + | .k r m :: R1 => + if Nat.ble 1 m then + match popL1 items with + | some (a, L1) => + if Nat.beq a 0 then + ⟨.BR, .raw (pushL0 3 (pushLd 1 (pushLk2 r (m - 1) (pushL0 r L1)))), R1, false⟩ + else stepRawBRPop items (.k r m :: R1) + | none => stepRawBRPop items (.k r m :: R1) + else ⟨.BR, .raw items, R1, false⟩ + | .d v :: R1 => stepRawBRPop items (.d v :: R1) + +theorem stepRawBR_halts (items R : List Item) (hh : StateHalts target_tm (stepRawBR items R)) : + CanHalt target_tm (cfg_BR target_tm (decL items) (decR R)) := by + unfold stepRawBR at hh + cases R with + | nil => + refine stateHalts_of_stepStar rfl ?_ hh + simpa [evalRle, evalStackCfg1, decLState, decL_bumpL, decR] using + stepPlus_stepStar (rule_BR_nil (decL items)) + | cons hd R1 => + cases hd with + | z c => + refine stateHalts_of_stepStar rfl ?_ hh + simpa [evalRle, evalStackCfg1, decLState, decL_pushL0, decR] using + rule_BR_zeros_all (decL items) (decR R1) c + | d v => exact stepRawBRPop_halts items (.d v :: R1) hh + | k r m => + dsimp only at hh; split at hh + · next hm1 => + have hmge : 1 ≤ m := Nat.ble_eq.mp hm1 + cases hpL : popL1 items with + | none => + rw [hpL] at hh + exact stepRawBRPop_halts items (.k r m :: R1) hh + | some pL => + rcases pL with ⟨a, L1⟩ + rw [hpL] at hh; dsimp only at hh; split at hh + · next ha0 => + rw [Nat.beq_eq] at ha0; subst ha0 + refine stateHalts_of_stepStar rfl ?_ hh + rw [decL_popL1_some items 0 L1 hpL, decR, show m = (m - 1) + 1 by omega] + simpa [evalRle, evalStackCfg1, decLState, decL_pushL0, + decL_pushLd, + decL_pushLk2, List.append_assoc] using + rule_BR_blkR_succ (m - 1) r (decL L1) (decR R1) + · exact stepRawBRPop_halts items (.k r m :: R1) hh + · next hm0 => + have hmeq : m = 0 := by + have : ¬ 1 ≤ m := fun h => hm0 (Nat.ble_eq.mpr h); omega + subst hmeq + refine stateHalts_of_stepStar rfl ?_ hh + exact ⟨0, rfl⟩ + +-- 5.3 Raw DR0 +def stepRawDR0Atomic (items R : List Item) : RleFullState := + match popL1 items with + | none => ⟨.C, .raw [.d 1], R, false⟩ + | some (a, L1) => + if Nat.beq a 0 then + match items with + | .z c :: Lrest => ⟨.DR0, .raw Lrest, pushR0 c R, false⟩ + | _ => ⟨.DR0, .raw L1, pushR0 1 R, false⟩ + else ⟨.C, .raw (pushLd (a - 1) L1), pushR0 1 R, false⟩ + +theorem stepRawDR0Atomic_halts (items R : List Item) (hh : StateHalts target_tm (stepRawDR0Atomic + items R)) : + CanHalt target_tm (cfg_DR0 target_tm (decL items) (decR R)) := by + unfold stepRawDR0Atomic at hh + cases hpL : popL1 items with + | none => + rw [hpL] at hh + refine stateHalts_of_stepStar rfl ?_ hh + rw [decL_popL1_none items hpL] + simpa [evalRle, evalStackCfg1, decLState, decL] using + stepPlus_stepStar (rule_DR0_nil (decR R)) + | some pL => + rcases pL with ⟨a, L1⟩ + rw [hpL] at hh + have hL := decL_popL1_some items a L1 hpL + dsimp only at hh; split at hh + · next ha0 => + rw [Nat.beq_eq] at ha0; subst ha0 + cases items with + | nil => cases hpL + | cons hd Lrest => + cases hd with + | z c => + refine stateHalts_of_stepStar rfl ?_ hh + simpa [evalRle, evalStackCfg1, decLState, decL, decR_pushR0] using + rule_DR0_zeros_all (decL Lrest) (decR R) c + | d _ => + refine stateHalts_of_stepStar rfl ?_ hh + rw [hL] + simpa [evalRle, evalStackCfg1, decLState, decR_pushR0] using + stepPlus_stepStar (rule_DR0_zero (decL L1) (decR R)) + | k _ _ => + refine stateHalts_of_stepStar rfl ?_ hh + rw [hL] + simpa [evalRle, evalStackCfg1, decLState, decR_pushR0] using + stepPlus_stepStar (rule_DR0_zero (decL L1) (decR R)) + · next ha0 => + have hane : a ≠ 0 := fun h => ha0 (Nat.beq_eq.mpr h) + refine stateHalts_of_stepStar rfl ?_ hh + rw [hL, show a = (a - 1) + 1 by omega] + simpa [evalRle, evalStackCfg1, decLState, decL_pushLd, decR_pushR0] + using + stepPlus_stepStar (rule_DR0_succ (a - 1) (decL L1) (decR R)) + +def stepRawDR0 (items R : List Item) : RleFullState := + match items with + | [.z c] => + match R with + | .d v1 :: .z q :: R2 => + if Nat.beq v1 1 then ⟨.DR0, .raw [.z (c + 3 * q)], .d 1 :: R2, false⟩ + else ⟨.BR, .raw [.z (c + 3)], R, false⟩ + | _ => ⟨.BR, .raw [.z (c + 3)], R, false⟩ + | _ => stepRawDR0Atomic items R + +theorem stepRawDR0_halts (items R : List Item) (hh : StateHalts target_tm (stepRawDR0 items R)) : + CanHalt target_tm (cfg_DR0 target_tm (decL items) (decR R)) := by + unfold stepRawDR0 at hh + rcases items with _ | ⟨hd1, _ | ⟨hd2, xs⟩⟩ + · exact stepRawDR0Atomic_halts [] R hh + · cases hd1 with + | z c => + have hbot : ∀ (hhb : StateHalts target_tm ⟨.BR, .raw [.z (c + 3)], R, false⟩), + CanHalt target_tm (cfg_DR0 target_tm (decL [.z c]) (decR R)) := by + intro hhb + refine stateHalts_of_stepStar rfl ?_ hhb + simpa [evalRle, evalStackCfg1, decLState, decL] using rule_DR0_bot c + (decR R) + rcases R with _ | ⟨r1, _ | ⟨r2, R2⟩⟩ + · exact hbot hh + · cases r1 <;> exact hbot hh + · cases r1 with + | d v1 => + cases r2 with + | z q => + dsimp only at hh; split at hh + · next hv1 => + rw [Nat.beq_eq] at hv1; subst hv1 + refine stateHalts_of_stepStar rfl ?_ hh + simpa [evalRle, evalStackCfg1, decLState, decL, decR] using + rule_DR0_bot_zeros q c (decR R2) + · exact hbot hh + | _ => exact hbot hh + | _ => exact hbot hh + | d _ => exact stepRawDR0Atomic_halts _ R hh + | k _ _ => exact stepRawDR0Atomic_halts _ R hh + · cases hd1 <;> exact stepRawDR0Atomic_halts _ R hh + +-- 5.4 Raw C +def stepRawCAtomic (items R : List Item) : RleFullState := + match popL1 items with + | none => ⟨.DR0, .raw [], R, false⟩ + | some (a, L1) => + if Nat.beq a 0 then + match popL1 L1 with + | none => ⟨.C, .raw [], pushRd 1 R, false⟩ + | some (a1, L3) => + if Nat.beq a1 0 then ⟨.C, .raw (bumpL L3), pushRd 1 R, false⟩ + else if Nat.beq a1 1 then ⟨.C, .raw (bumpL (bumpL L3)), pushR0 1 (bumpR R), false⟩ + else ⟨.BR, .raw (pushLd (a1 - 2) L3), pushR0 1 (pushRd 1 R), false⟩ + else if Nat.beq a 1 then + match popL1 L1 with + | none => ⟨.B, .raw [.z 1], pushRd 1 R, false⟩ + | some (a1, L3) => + if Nat.beq a1 0 then ⟨.DR0, .raw L3, pushRd 2 R, false⟩ + else ⟨.C, .raw (pushLd (a1 - 1) L3), pushRd 2 R, false⟩ + else ⟨.C, .raw (pushLd a L1), R, true⟩ + +theorem stepRawCAtomic_halts (items R : List Item) (hh : StateHalts target_tm (stepRawCAtomic + items R)) : + CanHalt target_tm (cfg_C target_tm (decL items) (decR R)) := by + unfold stepRawCAtomic at hh + cases hp1 : popL1 items with + | none => + rw [hp1] at hh + refine stateHalts_of_stepStar rfl ?_ hh + rw [decL_popL1_none items hp1] + exact stepPlus_stepStar (rule_C_nil _) + | some p1 => + rcases p1 with ⟨a, L1⟩ + rw [hp1] at hh + have hL1 := decL_popL1_some items a L1 hp1 + dsimp only at hh; split at hh + · next ha0 => + rw [Nat.beq_eq] at ha0; subst ha0 + cases hp2 : popL1 L1 with + | none => + rw [hp2] at hh + refine stateHalts_of_stepStar rfl ?_ hh + rw [hL1, decL_popL1_none L1 hp2] + simpa [evalRle, evalStackCfg1, decLState, decL, decR_pushRd] using + stepPlus_stepStar (rule_C_zero_nil (decR R)) + | some p2 => + rcases p2 with ⟨a1, L3⟩ + rw [hp2] at hh + have hL2 := decL_popL1_some L1 a1 L3 hp2 + dsimp only at hh; split at hh + · next ha10 => + rw [Nat.beq_eq] at ha10; subst ha10 + refine stateHalts_of_stepStar rfl ?_ hh + rw [hL1, hL2] + simpa [evalRle, evalStackCfg1, decLState, decL_bumpL, decR_pushRd] + using + stepPlus_stepStar (rule_C_zero_zero (decL L3) (decR R)) + · next ha10 => + have hne0 : a1 ≠ 0 := fun h => ha10 (Nat.beq_eq.mpr h) + split at hh + · next ha11 => + rw [Nat.beq_eq] at ha11; subst ha11 + refine stateHalts_of_stepStar rfl ?_ hh + rw [hL1, hL2] + simpa [evalRle, evalStackCfg1, decLState, decL_bumpL, decR_pushR0 + , decR_bumpR] using + stepPlus_stepStar (rule_C_zero_one (decL L3) (decR R)) + · next ha11 => + have hne1 : a1 ≠ 1 := fun h => ha11 (Nat.beq_eq.mpr h) + refine stateHalts_of_stepStar rfl ?_ hh + rw [hL1, hL2, show a1 = (a1 - 2) + 2 by omega] + simpa [evalRle, evalStackCfg1, decLState, decL_pushLd, decR_pushR0 + , decR_pushRd] using + stepPlus_stepStar (rule_C_zero_add_two (a1 - 2) (decL L3) (decR R)) + · next ha0 => + have hane0 : a ≠ 0 := fun h => ha0 (Nat.beq_eq.mpr h) + split at hh + · next ha1 => + rw [Nat.beq_eq] at ha1; subst ha1 + cases hp2 : popL1 L1 with + | none => + rw [hp2] at hh + refine stateHalts_of_stepStar rfl ?_ hh + rw [hL1, decL_popL1_none L1 hp2] + simpa [evalRle, evalStackCfg1, decLState, decL, decR_pushRd] using + stepPlus_stepStar (rule_C_one_nil (decR R)) + | some p2 => + rcases p2 with ⟨a1, L3⟩ + rw [hp2] at hh + have hL2 := decL_popL1_some L1 a1 L3 hp2 + dsimp only at hh; split at hh + · next ha10 => + rw [Nat.beq_eq] at ha10; subst ha10 + refine stateHalts_of_stepStar rfl ?_ hh + rw [hL1, hL2] + simpa [evalRle, evalStackCfg1, decLState, decR_pushRd] using + stepPlus_stepStar (rule_C_one_zero (decL L3) (decR R)) + · next ha10 => + have hne0 : a1 ≠ 0 := fun h => ha10 (Nat.beq_eq.mpr h) + refine stateHalts_of_stepStar rfl ?_ hh + rw [hL1, hL2, show a1 = (a1 - 1) + 1 by omega] + simpa [evalRle, evalStackCfg1, decLState, decL_pushLd, + decR_pushRd] using + stepPlus_stepStar (rule_C_one_succ (a1 - 1) (decL L3) (decR R)) + · next ha1 => + have hane1 : a ≠ 1 := fun h => ha1 (Nat.beq_eq.mpr h) + rw [hL1, show a = (a - 2) + 2 by omega] + obtain ⟨cfg', hstep, hnone⟩ := + rule_C_add_two_halt (target_tm := target_tm) (a - 2) (decL L1) (decR R) + exact ⟨cfg', stepPlus_stepStar hstep, hnone⟩ + +def stepRawC (items R : List Item) : RleFullState := + match items with + | .z cz :: .k r m :: L2 => + if Nat.beq cz 1 then ⟨.C, .raw (pushL0 1 L2), pushRk2 r m R, false⟩ + else stepRawCAtomic items R + | .z cz :: .d v1 :: L2 => + if Nat.ble 4 cz && Nat.beq v1 1 then + ⟨.C, .raw (pushL0 1 L2), pushRk2 (cz - 3) 1 R, false⟩ + else stepRawCAtomic items R + | [.z cz] => + if Nat.ble 4 cz then ⟨.DR0, .raw [], pushRk2 (cz - 4) 1 R, false⟩ + else stepRawCAtomic items R + | _ => stepRawCAtomic items R + +theorem stepRawC_halts (items R : List Item) (hh : StateHalts target_tm (stepRawC items R)) : + CanHalt target_tm (cfg_C target_tm (decL items) (decR R)) := by + unfold stepRawC at hh + rcases items with _ | ⟨hd1, rest1⟩ + · exact stepRawCAtomic_halts [] R hh + · cases hd1 with + | z cz => + rcases rest1 with _ | ⟨hd2, L2⟩ + · dsimp only at hh; split at hh + · next h4 => + have hge4 : 4 ≤ cz := Nat.ble_eq.mp h4 + refine stateHalts_of_stepStar rfl ?_ hh + have heq : decL [.z cz] = rep0 ((cz - 4) + 4) := by + rw [decL, decL, List.append_nil, show cz - 4 + 4 = cz by omega] + rw [heq] + simpa [evalRle, evalStackCfg1, decLState, decL, decR_pushRk2, + HPow.hPow, List.append_eq] using + rule_C_bot_four (cz - 4) (decR R) + · exact stepRawCAtomic_halts [.z cz] R hh + · cases hd2 with + | k r m => + dsimp only at hh; split at hh + · next hcz => + rw [Nat.beq_eq] at hcz; subst hcz + refine stateHalts_of_stepStar rfl ?_ hh + simpa [evalRle, evalStackCfg1, decLState, decL, decL_pushL0, + decR_pushRk2] using + rule_C_blkL_pow m r (decL L2) (decR R) + · exact stepRawCAtomic_halts _ R hh + | d v1 => + dsimp only at hh; split at hh + · next hb => + simp only [Bool.and_eq_true, Nat.ble_eq, Nat.beq_eq] at hb + rcases hb with ⟨hge4, rfl⟩ + refine stateHalts_of_stepStar rfl ?_ hh + have heq : decL (.z cz :: .d 1 :: L2) = rep0 ((cz - 3) + 3) ++ 1 :: decL L2 := by + rw [decL, decL, show cz - 3 + 3 = cz by omega] + rw [heq] + simpa [evalRle, evalStackCfg1, decLState, decL_pushL0, + decR_pushRk2, + HPow.hPow, List.append_eq] using + rule_C_r_add_three (cz - 3) (decL L2) (decR R) + · exact stepRawCAtomic_halts _ R hh + | z _ => exact stepRawCAtomic_halts _ R hh + | d _ => exact stepRawCAtomic_halts _ R hh + | k _ _ => exact stepRawCAtomic_halts _ R hh + +-- 5.5 Clean B +def stepCleanBPop (c0 : ℕ) (segs : List (ℕ × ℕ)) (bot : ℕ) (R : List Item) : RleFullState := + match popR1 R with + | none => ⟨.B, .raw (unpackClean c0 segs bot), R, false⟩ + | some (d, R1) => + if Nat.beq d 0 then ⟨.B, .clean (c0 + 1) segs bot, R1, false⟩ + else ⟨.BR, .clean c0 segs bot, pushR0 1 (pushRd (d - 1) R1), false⟩ + +theorem stepCleanBPop_halts (c0 : ℕ) (segs : List (ℕ × ℕ)) (bot : ℕ) (R : List Item) + (hh : StateHalts target_tm (stepCleanBPop c0 segs bot R)) : + CanHalt target_tm (cfg_B target_tm (decLState (.clean c0 segs bot)) (decR R)) := by + unfold stepCleanBPop at hh + cases hp : popR1 R with + | none => + rw [hp] at hh + refine stateHalts_of_stepStar rfl ?_ hh + simp [evalRle, evalStackCfg1, decLState, decL_unpackClean] + | some p => + rcases p with ⟨d, R1⟩ + rw [hp] at hh + have hR := decR_popR1_some R d R1 hp + dsimp only at hh; split at hh + · next hd0 => + rw [Nat.beq_eq] at hd0; subst hd0 + refine stateHalts_of_stepStar rfl ?_ hh + rw [hR] + have heq : 0 :: decLState (.clean c0 segs bot) = decLState (.clean (c0 + 1) segs bot) := by + norm_all + simpa [evalRle, evalStackCfg1, ← heq] using + stepPlus_stepStar (rule_B_zero (decLState (.clean c0 segs bot)) (decR R1)) + · next hd0 => + have hdne : d ≠ 0 := fun h => hd0 (Nat.beq_eq.mpr h) + refine stateHalts_of_stepStar rfl ?_ hh + rw [hR, show d = (d - 1) + 1 by omega] + simpa [evalRle, evalStackCfg1, decR_pushR0, decR_pushRd] using + stepPlus_stepStar (rule_B_succ (d - 1) (decLState (.clean c0 segs bot)) (decR R1)) + +def stepCleanB (c0 : ℕ) (segs : List (ℕ × ℕ)) (bot : ℕ) (R : List Item) : RleFullState := + match R with + | [] => + if Nat.ble 1 c0 && Nat.ble 1 bot then + ⟨.B, .clean 1 (pushSeg 0 (bot - 1) (pushSeg (c0 - 1) 1 segs)) 0, [], false⟩ + else ⟨.B, .raw (unpackClean c0 segs bot), [], false⟩ + | .z cz :: .k r cnt :: Rrem => + if Nat.beq c0 0 && Nat.ble 1 bot && Nat.beq cz 1 then + let q := minNat cnt bot + if Nat.ble 1 q then + let Rnew := if Nat.beq cnt q then .z 1 :: Rrem else .z 1 :: .k r (cnt - q) :: Rrem + ⟨.B, .clean 0 (pushSeg (r + 3) q segs) (bot - q), Rnew, false⟩ + else ⟨.B, .clean (c0 + cz) segs bot, .k r cnt :: Rrem, false⟩ + else ⟨.B, .clean (c0 + cz) segs bot, .k r cnt :: Rrem, false⟩ + | .z cz :: R1 => + ⟨.B, .clean (c0 + cz) segs bot, R1, false⟩ + | .d v1 :: .d v2 :: .k r cnt :: Rrem => + if Nat.beq c0 0 && Nat.beq v1 1 && Nat.beq v2 1 then + let q := minNat cnt (bot / (r + 1)) + if Nat.ble 1 q then + let Rnew := if Nat.beq cnt q then .d 1 :: .d 1 :: Rrem else .d 1 :: .d 1 :: .k r (cnt - q) + :: Rrem + ⟨.B, .clean 0 (pushSeg (4 * r + 3) q segs) (bot - q * (r + 1)), Rnew, false⟩ + else ⟨.BR, .clean c0 segs bot, pushR0 1 (pushRd 0 (.d v2 :: .k r cnt :: Rrem)), false⟩ + else stepCleanBPop c0 segs bot (.d v1 :: .d v2 :: .k r cnt :: Rrem) + | _ => stepCleanBPop c0 segs bot R + +theorem stepCleanB_halts (c0 : ℕ) (segs : List (ℕ × ℕ)) (bot : ℕ) (R : List Item) + (hh : StateHalts target_tm (stepCleanB c0 segs bot R)) : + CanHalt target_tm (cfg_B target_tm (decLState (.clean c0 segs bot)) (decR R)) := by + unfold stepCleanB at hh + rcases R with _ | ⟨hd1, R1⟩ + · dsimp only at hh; split at hh + · next hb => + simp only [Bool.and_eq_true, Nat.ble_eq] at hb + rcases hb with ⟨hc0, hbot⟩ + refine stateHalts_of_stepStar rfl ?_ hh + have h1 := clean_RNIL_one (target_tm := target_tm) .B (Or.inl rfl) (c0 - 1) segs (bot - 1) + have h2 := clean_RNIL_zero_pow (target_tm := target_tm) (bot - 1) (pushSeg (c0 - 1) 1 segs) 0 + rw [show c0 - 1 + 1 = c0 by omega, show bot - 1 + 1 = bot by omega] at h1 + rw [show 0 + (bot - 1) = bot - 1 by omega] at h2 + exact stepStar_trans h1 h2 + · refine stateHalts_of_stepStar rfl ?_ hh + simp [evalRle, evalStackCfg1, decLState, decL_unpackClean] + · cases hd1 with + | z cz => + have h_zonly : ∀ (Rtail : List Item) + (hhz : StateHalts target_tm ⟨.B, .clean (c0 + cz) segs bot, Rtail, false⟩), + CanHalt target_tm (cfg_B target_tm (decLState (.clean c0 segs bot)) (decR (.z cz :: + Rtail))) := by + intro Rtail hhz + refine stateHalts_of_stepStar rfl ?_ hhz + have hstep := rule_B_zeros_all (target_tm := target_tm) + (decLState (.clean c0 segs bot)) (decR Rtail) cz + have heq : rep0 cz ++ decLState (.clean c0 segs bot) = + decLState (.clean (c0 + cz) segs bot) := by + rw [Nat.add_comm c0 cz]; norm_all + rw [heq] at hstep + exact hstep + rcases R1 with _ | ⟨hd2, Rrem⟩ + · exact h_zonly [] hh + · cases hd2 with + | k r cnt => + dsimp only at hh; split at hh + · next hb => + simp only [Bool.and_eq_true, Nat.beq_eq, Nat.ble_eq] at hb + rcases hb with ⟨⟨rfl, hbot⟩, rfl⟩ + split at hh + · next hq1 => + set q := minNat cnt bot + have hqcnt : q ≤ cnt := minNat_le_left cnt bot + have hqbot : q ≤ bot := minNat_le_right cnt bot + refine stateHalts_of_stepStar rfl ?_ hh + have hstep := clean_P1_pow (target_tm := target_tm) q r segs (bot - q) + ((blkR r) ^ (cnt - q) ++ decR Rrem) + rw [show bot - q + q = bot by omega] at hstep + have heqR1 : 0 :: ((blkR r) ^ q ++ ((blkR r) ^ (cnt - q) ++ decR Rrem)) = + decR (.z 1 :: .k r cnt :: Rrem) := by + rw [← List.append_assoc, ← list_pow_add, show q + (cnt - q) = cnt by omega] + norm_all + have heqR2 : (0 :: ((blkR r) ^ (cnt - q) ++ decR Rrem)) = + decR (if Nat.beq cnt q then .z 1 :: Rrem else .z 1 :: .k r (cnt - q) :: Rrem) := + by + split + · next heq => rw [Nat.beq_eq] at heq; rw [heq, Nat.sub_self]; norm_all + · norm_all + rw [heqR1, heqR2] at hstep + exact hstep + · exact h_zonly _ hh + · exact h_zonly _ hh + | _ => exact h_zonly _ hh + | d v1 => + rcases R1 with _ | ⟨hd2, _ | ⟨hd3, Rrem⟩⟩ + · exact stepCleanBPop_halts c0 segs bot _ hh + · cases hd2 <;> exact stepCleanBPop_halts c0 segs bot _ hh + · cases hd2 with + | d v2 => + cases hd3 with + | k r cnt => + dsimp only at hh; split at hh + · next hb => + simp only [Bool.and_eq_true, Nat.beq_eq] at hb + rcases hb with ⟨⟨rfl, rfl⟩, rfl⟩ + split at hh + · next hq1 => + set q := minNat cnt (bot / (r + 1)) + have hqcnt : q ≤ cnt := minNat_le_left cnt _ + have hqdiv : q ≤ bot / (r + 1) := minNat_le_right cnt _ + have hqmul : q * (r + 1) ≤ bot := + Nat.le_trans (Nat.mul_le_mul_right (r + 1) hqdiv) (Nat.div_mul_le_self bot (r + + 1)) + refine stateHalts_of_stepStar rfl ?_ hh + have hstep := clean_P2_pow (target_tm := target_tm) q r segs (bot - q * (r + 1)) + ((blkR r) ^ (cnt - q) ++ decR Rrem) + rw [show bot - q * (r + 1) + q * (r + 1) = bot by omega] at hstep + have heqR1 : 1 :: 1 :: ((blkR r) ^ q ++ ((blkR r) ^ (cnt - q) ++ decR Rrem)) = + decR (.d 1 :: .d 1 :: .k r cnt :: Rrem) := by + rw [← List.append_assoc, ← list_pow_add, show q + (cnt - q) = cnt by omega] + norm_all + have heqR2 : (1 :: 1 :: ((blkR r) ^ (cnt - q) ++ decR Rrem)) = + decR (if Nat.beq cnt q then .d 1 :: .d 1 :: Rrem else .d 1 :: .d 1 :: .k r + (cnt - q) :: Rrem) := by + split + · next heq => rw [Nat.beq_eq] at heq; rw [heq, Nat.sub_self]; norm_all + · norm_all + rw [heqR1, heqR2] at hstep + exact hstep + · refine stateHalts_of_stepStar rfl ?_ hh + simpa [evalRle, evalStackCfg1, decR_pushR0, decR_pushRd, decR] + using + stepPlus_stepStar (rule_B_succ 0 (decLState (.clean 0 segs bot)) (decR (.d 1 :: + .k r cnt :: Rrem))) + · exact stepCleanBPop_halts c0 segs bot _ hh + | _ => exact stepCleanBPop_halts c0 segs bot _ hh + | _ => exact stepCleanBPop_halts c0 segs bot _ hh + | k _ _ => exact stepCleanBPop_halts c0 segs bot _ hh + +-- 5.6 Clean BR +def stepCleanBR (c0 : ℕ) (segs : List (ℕ × ℕ)) (bot : ℕ) (R : List Item) : RleFullState := + match R with + | [] => + if Nat.ble 1 c0 && Nat.ble 1 bot then + ⟨.B, .clean 1 (pushSeg 0 (bot - 1) (pushSeg (c0 - 1) 1 segs)) 0, [], false⟩ + else ⟨.BR, .raw (unpackClean c0 segs bot), [], false⟩ + | .z cz :: R1 => + ⟨.BR, .clean (c0 + cz) segs bot, R1, false⟩ + | .k r m :: R1 => + if Nat.ble 1 m && Nat.ble 1 c0 && Nat.ble 3 (r + c0) then + ⟨.BR, .clean 3 (pushSeg r (m - 1) (pushSeg (r + c0 - 3) 1 segs)) bot, R1, false⟩ + else ⟨.BR, .raw (unpackClean c0 segs bot), .k r m :: R1, false⟩ + | .d v :: R1 => + match popR1 (.d v :: R1) with + | none => ⟨.BR, .raw (unpackClean c0 segs bot), .d v :: R1, false⟩ + | some (d, R2) => + if Nat.beq d 0 then ⟨.BR, .clean (c0 + 1) segs bot, R2, false⟩ + else if Nat.beq d 1 then ⟨.DR0, .clean c0 segs bot, bumpR R2, false⟩ + else if Nat.ble 3 c0 then + ⟨.B, .clean 0 (pushSeg (c0 - 3) 1 segs) bot, pushRd (d - 2) R2, false⟩ + else ⟨.BR, .raw (unpackClean c0 segs bot), .d v :: R1, false⟩ + +theorem stepCleanBR_halts (c0 : ℕ) (segs : List (ℕ × ℕ)) (bot : ℕ) (R : List Item) + (hh : StateHalts target_tm (stepCleanBR c0 segs bot R)) : + CanHalt target_tm (cfg_BR target_tm (decLState (.clean c0 segs bot)) (decR R)) := by + unfold stepCleanBR at hh + rcases R with _ | ⟨hd1, R1⟩ + · dsimp only at hh; split at hh + · next hb => + simp only [Bool.and_eq_true, Nat.ble_eq] at hb + rcases hb with ⟨hc0, hbot⟩ + refine stateHalts_of_stepStar rfl ?_ hh + have h1 := clean_RNIL_one (target_tm := target_tm) .BR (Or.inr rfl) (c0 - 1) segs (bot - 1) + have h2 := clean_RNIL_zero_pow (target_tm := target_tm) (bot - 1) (pushSeg (c0 - 1) 1 segs) 0 + rw [show c0 - 1 + 1 = c0 by omega, show bot - 1 + 1 = bot by omega] at h1 + rw [show 0 + (bot - 1) = bot - 1 by omega] at h2 + exact stepStar_trans h1 h2 + · refine stateHalts_of_stepStar rfl ?_ hh + simp [evalRle, evalStackCfg1, decLState, decL_unpackClean] + · cases hd1 with + | z cz => + refine stateHalts_of_stepStar rfl ?_ hh + have hstep := rule_BR_zeros_all (target_tm := target_tm) + (decLState (.clean c0 segs bot)) (decR R1) cz + have heq : rep0 cz ++ decLState (.clean c0 segs bot) = + decLState (.clean (c0 + cz) segs bot) := by + rw [Nat.add_comm c0 cz]; norm_all + rw [heq] at hstep + exact hstep + | k r m => + dsimp only at hh; split at hh + · next hb => + simp only [Bool.and_eq_true, Nat.ble_eq] at hb + rcases hb with ⟨⟨hm, hc0⟩, hrc⟩ + refine stateHalts_of_stepStar rfl ?_ hh + have heqL0 : decLState (.clean c0 segs bot) = + 0 :: (rep0 (c0 - 1) ++ 1 :: (decSegs segs ++ rep0 (bot + 2))) := by + conv_lhs => rw [decLState, show c0 = (c0 - 1) + 1 by omega] + norm_all + have hstep := rule_BR_blkR_succ (target_tm := target_tm) (m - 1) r + (rep0 (c0 - 1) ++ 1 :: (decSegs segs ++ rep0 (bot + 2))) (decR R1) + have heqR : decR (.k r m :: R1) = (blkR r) ^ ((m - 1) + 1) ++ decR R1 := by + rw [decR, show m - 1 + 1 = m by omega] + have heqL1 : rep0 3 ++ 1 :: ((blkL r) ^ (m - 1) ++ (rep0 r ++ (rep0 (c0 - 1) ++ 1 :: + (decSegs segs ++ rep0 (bot + 2))))) = + decLState (.clean 3 (pushSeg r (m - 1) (pushSeg (r + c0 - 3) 1 segs)) bot) := by + have hmerge : rep0 r ++ (rep0 (c0 - 1) ++ 1 :: (decSegs segs ++ rep0 (bot + 2))) = + rep0 ((r + c0 - 3) + 2) ++ 1 :: (decSegs segs ++ rep0 (bot + 2)) := by + rw [← List.append_assoc, ← rep0_add_split, show r + (c0 - 1) = (r + c0 - 3) + 2 by + omega] + rw [hmerge] + norm_all + dsimp only [evalRle, evalStackCfg1] + rw [heqL0, heqR, ← heqL1] + exact hstep + · refine stateHalts_of_stepStar rfl ?_ hh + simp [evalRle, evalStackCfg1, decLState, decL_unpackClean] + | d v => + dsimp only at hh + cases hp : popR1 (.d v :: R1) with + | none => cases hp + | some p => + rcases p with ⟨d, R2⟩ + rw [hp] at hh + have hR := decR_popR1_some _ d R2 hp + dsimp only at hh; split at hh + · next hd0 => + rw [Nat.beq_eq] at hd0; subst hd0 + refine stateHalts_of_stepStar rfl ?_ hh + rw [hR] + have heq : 0 :: decLState (.clean c0 segs bot) = decLState (.clean (c0 + 1) segs bot) := + by + norm_all + simpa [evalRle, evalStackCfg1, ← heq] using + stepPlus_stepStar (rule_BR_zero (decLState (.clean c0 segs bot)) (decR R2)) + · next hd0 => + have hdne0 : d ≠ 0 := fun h => hd0 (Nat.beq_eq.mpr h) + split at hh + · next hd1 => + rw [Nat.beq_eq] at hd1; subst hd1 + refine stateHalts_of_stepStar rfl ?_ hh + rw [hR] + simpa [evalRle, evalStackCfg1, decR_bumpR] using + stepPlus_stepStar (rule_BR_one (decLState (.clean c0 segs bot)) (decR R2)) + · next hd1 => + have hdne1 : d ≠ 1 := fun h => hd1 (Nat.beq_eq.mpr h) + split at hh + · next hc3 => + have hcge : 3 ≤ c0 := Nat.ble_eq.mp hc3 + refine stateHalts_of_stepStar rfl ?_ hh + rw [hR, show d = (d - 2) + 2 by omega] + have hstep := stepPlus_stepStar (rule_BR_add_two (target_tm := target_tm) (d - 2) + (decLState (.clean c0 segs bot)) (decR R2)) + have heq : bumpHead (decLState (.clean c0 segs bot)) = + decLState (.clean 0 (pushSeg (c0 - 3) 1 segs) bot) := by + conv_lhs => rw [decLState, show c0 = (c0 - 3) + 3 by omega] + norm_all + rw [heq] at hstep + simpa [evalRle, evalStackCfg1, decR_pushRd] using hstep + · refine stateHalts_of_stepStar rfl ?_ hh + simp [evalRle, evalStackCfg1, decLState, decL_unpackClean] + +-- 5.7 Clean DR0 +def stepCleanDR0 (c0 : ℕ) (segs : List (ℕ × ℕ)) (bot : ℕ) (R : List Item) : RleFullState := + if Nat.ble 1 bot then + match R with + | .d v1 :: .z rz :: R2 => + if Nat.beq v1 1 then + let q := minNat rz bot + if Nat.ble 1 q then + let Rnew := if Nat.beq rz q then .d 1 :: R2 else .d 1 :: .z (rz - q) :: R2 + ⟨.DR0, .clean (c0 + 4 * q) segs (bot - q), Rnew, false⟩ + else ⟨.BR, .clean (c0 + 4) segs (bot - 1), R, false⟩ + else ⟨.BR, .clean (c0 + 4) segs (bot - 1), R, false⟩ + | _ => ⟨.BR, .clean (c0 + 4) segs (bot - 1), R, false⟩ + else ⟨.DR0, .raw (unpackClean c0 segs bot), R, false⟩ + +theorem stepCleanDR0_halts (c0 : ℕ) (segs : List (ℕ × ℕ)) (bot : ℕ) (R : List Item) + (hh : StateHalts target_tm (stepCleanDR0 c0 segs bot R)) : + CanHalt target_tm (cfg_DR0 target_tm (decLState (.clean c0 segs bot)) (decR R)) := by + unfold stepCleanDR0 at hh + split at hh + · next hbot => + have hbge : 1 ≤ bot := Nat.ble_eq.mp hbot + have h_one : ∀ (hh1 : StateHalts target_tm ⟨.BR, .clean (c0 + 4) segs (bot - 1), R, false⟩), + CanHalt target_tm (cfg_DR0 target_tm (decLState (.clean c0 segs bot)) (decR R)) := by + intro hh1 + refine stateHalts_of_stepStar rfl ?_ hh1 + have hstep := clean_DR0_one (target_tm := target_tm) c0 segs (bot - 1) (decR R) + rw [show bot - 1 + 1 = bot by omega] at hstep + exact hstep + rcases R with _ | ⟨r1, _ | ⟨r2, R2⟩⟩ + · exact h_one hh + · cases r1 <;> exact h_one hh + · cases r1 with + | d v1 => + cases r2 with + | z rz => + dsimp only at hh; split at hh + · next hv1 => + rw [Nat.beq_eq] at hv1; subst hv1 + split at hh + · next hq1 => + set q := minNat rz bot + have hqrz : q ≤ rz := minNat_le_left rz bot + have hqbot : q ≤ bot := minNat_le_right rz bot + refine stateHalts_of_stepStar rfl ?_ hh + have hstep := clean_DR0_zeros (target_tm := target_tm) q c0 segs (bot - q) + (rep0 (rz - q) ++ decR R2) + rw [show bot - q + q = bot by omega] at hstep + have heqR1 : 1 :: (rep0 q ++ (rep0 (rz - q) ++ decR R2)) = + decR (.d 1 :: .z rz :: R2) := by + rw [← List.append_assoc, ← rep0_add_split, show q + (rz - q) = rz by omega] + norm_all + have heqR2 : (1 :: (rep0 (rz - q) ++ decR R2)) = + decR (if Nat.beq rz q then .d 1 :: R2 else .d 1 :: .z (rz - q) :: R2) := by + split + · next heq => rw [Nat.beq_eq] at heq; rw [heq, Nat.sub_self]; norm_all + · norm_all + rw [heqR1, heqR2] at hstep + exact hstep + · exact h_one hh + · exact h_one hh + | _ => exact h_one hh + | _ => exact h_one hh + · refine stateHalts_of_stepStar rfl ?_ hh + simp [evalRle, evalStackCfg1, decLState, decL_unpackClean] + +-- 5.8 Top-Level Dispatch `rleStep` +def tryPack (m : StackMode) (items R : List Item) : Option LState := + if modeCanPack m items R then + match packHead 0 items with + | some (LState.clean c0 segs bot) => + if Nat.ble 1 bot then some (LState.clean c0 segs bot) else none + | _ => none + else none + +theorem tryPack_spec (m : StackMode) (items R : List Item) (ls' : LState) + (h : tryPack m items R = some ls') : decL items = decLState ls' := by + unfold tryPack at h + split at h + · cases hph : packHead 0 items with + | none => rw [hph] at h; cases h + | some l0 => + rw [hph] at h + cases l0 with + | raw _ => cases h + | clean c0 segs bot => + dsimp only at h; split at h + · cases h + have hspec := packHead_spec items 0 (LState.clean c0 segs bot) hph + simpa using hspec + · cases h + · cases h + +def rleStep (s : RleFullState) : RleFullState := + match s.ls with + | .raw items => + match tryPack s.mode items s.R with + | some ls' => ⟨s.mode, ls', s.R, false⟩ + | none => + match s.mode with + | .B => stepRawB items s.R + | .BR => stepRawBR items s.R + | .DR0 => stepRawDR0 items s.R + | .C => stepRawC items s.R + | .clean c0 segs bot => + match s.mode with + | .B => stepCleanB c0 segs bot s.R + | .BR => stepCleanBR c0 segs bot s.R + | .DR0 => stepCleanDR0 c0 segs bot s.R + | .C => ⟨.C, .raw (unpackClean c0 segs bot), s.R, false⟩ + +theorem rleStep_halts (s : RleFullState) (hh : StateHalts target_tm (rleStep s)) : + CanHalt target_tm (evalRle target_tm s) := by + rcases s with ⟨mode, ls, R, halted⟩ + unfold rleStep at hh + dsimp only at hh + cases ls with + | raw items => + dsimp only at hh + cases hpk : tryPack mode items R with + | some ls' => + rw [hpk] at hh + refine stateHalts_of_stepStar rfl ?_ hh + simp [evalRle, decLState, tryPack_spec mode items R ls' hpk] + | none => + rw [hpk] at hh + cases mode with + | B => exact stepRawB_halts items R hh + | BR => exact stepRawBR_halts items R hh + | DR0 => exact stepRawDR0_halts items R hh + | C => exact stepRawC_halts items R hh + | clean c0 segs bot => + dsimp only at hh + cases mode with + | B => exact stepCleanB_halts c0 segs bot R hh + | BR => exact stepCleanBR_halts c0 segs bot R hh + | DR0 => exact stepCleanDR0_halts c0 segs bot R hh + | C => + refine stateHalts_of_stepStar rfl ?_ hh + simp [evalRle, evalStackCfg1, decLState, decL_unpackClean] + +-- ============================================================================ +-- Section 6: Strict Evaluation + 19 Checkpointed 500-Step Chunks (`9,500 > 9,101`) +-- ============================================================================ + +def strictNat {α : Type*} (n : ℕ) (f : ℕ → α) : α := + Nat.casesOn (Nat.add n 1) (f 0) (fun m => f m) + +@[simp] theorem strictNat_eq {α : Type*} (n : ℕ) (f : ℕ → α) : + strictNat n f = f n := rfl + +def strictItem {α : Type*} (it : Item) (f : Item → α) : α := + match it with + | .z c => strictNat c (fun c' => f (.z c')) + | .d v => strictNat v (fun v' => f (.d v')) + | .k r c => strictNat r (fun r' => strictNat c (fun c' => f (.k r' c'))) + +@[simp] theorem strictItem_eq {α : Type*} (it : Item) (f : Item → α) : + strictItem it f = f it := by + cases it <;> simp [strictItem] + +def strictItems {α : Type*} : List Item → (List Item → α) → α + | [], f => f [] + | x :: xs, f => strictItem x (fun x' => strictItems xs (fun xs' => f (x' :: xs'))) + +@[simp] theorem strictItems_eq {α : Type*} : + ∀ (xs : List Item) (f : List Item → α), strictItems xs f = f xs + | [], _ => rfl + | x :: xs, f => by simp [strictItems, strictItems_eq xs] + +def strictSegs {α : Type*} : List (ℕ × ℕ) → (List (ℕ × ℕ) → α) → α + | [], f => f [] + | (r, c) :: xs, f => + strictNat r (fun r' => strictNat c (fun c' => strictSegs xs (fun xs' => f ((r', c') :: xs')))) + +@[simp] theorem strictSegs_eq {α : Type*} : + ∀ (xs : List (ℕ × ℕ)) (f : List (ℕ × ℕ) → α), strictSegs xs f = f xs + | [], _ => rfl + | (r, c) :: xs, f => by simp [strictSegs, strictSegs_eq xs] + +def strictLState {α : Type*} (ls : LState) (f : LState → α) : α := + match ls with + | .raw items => strictItems items (fun items' => f (.raw items')) + | .clean c0 segs bot => + strictNat c0 (fun c0' => + strictSegs segs (fun segs' => + strictNat bot (fun bot' => f (.clean c0' segs' bot')))) + +@[simp] theorem strictLState_eq {α : Type*} (ls : LState) (f : LState → α) : + strictLState ls f = f ls := by + cases ls <;> simp [strictLState] + +def strictMode {α : Type*} (m : StackMode) (f : StackMode → α) : α := + match m with + | .B => f .B + | .BR => f .BR + | .DR0 => f .DR0 + | .C => f .C + +@[simp] theorem strictMode_eq {α : Type*} (m : StackMode) (f : StackMode → α) : + strictMode m f = f m := by + cases m <;> rfl + +def strictState {α : Type*} (s : RleFullState) (f : RleFullState → α) : α := + match s with + | ⟨m, ls, R, h⟩ => + strictMode m (fun m' => + strictLState ls (fun ls' => + strictItems R (fun R' => + Bool.casesOn h (f ⟨m', ls', R', false⟩) (f ⟨m', ls', R', true⟩)))) + +@[simp] theorem strictState_eq {α : Type*} (s : RleFullState) (f : RleFullState → α) : + strictState s f = f s := by + rcases s with ⟨m, ls, R, h⟩ + cases h <;> simp [strictState] + +def strictItems4 {α : Type*} : List Item → (List Item → α) → α + | [], f => f [] + | [x0], f => strictItem x0 (fun y0 => f [y0]) + | [x0, x1], f => strictItem x0 (fun y0 => strictItem x1 (fun y1 => f [y0, y1])) + | [x0, x1, x2], f => + strictItem x0 (fun y0 => strictItem x1 (fun y1 => strictItem x2 (fun y2 => f [y0, y1, y2]))) + | x0 :: x1 :: x2 :: x3 :: xs, f => + strictItem x0 (fun y0 => strictItem x1 (fun y1 => strictItem x2 (fun y2 => + strictItem x3 (fun y3 => f (y0 :: y1 :: y2 :: y3 :: xs))))) + +@[simp] theorem strictItems4_eq {α : Type*} (xs : List Item) (f : List Item → α) : + strictItems4 xs f = f xs := by + rcases xs with _ | ⟨x0, _ | ⟨x1, _ | ⟨x2, _ | ⟨x3, xs⟩⟩⟩⟩ <;> simp [strictItems4] + +def strictSegs3 {α : Type*} : List (ℕ × ℕ) → (List (ℕ × ℕ) → α) → α + | [], f => f [] + | [(r0, c0)], f => strictNat r0 (fun r0' => strictNat c0 (fun c0' => f [(r0', c0')])) + | [(r0, c0), (r1, c1)], f => + strictNat r0 (fun r0' => strictNat c0 (fun c0' => + strictNat r1 (fun r1' => strictNat c1 (fun c1' => f [(r0', c0'), (r1', c1')])))) + | (r0, c0) :: (r1, c1) :: (r2, c2) :: xs, f => + strictNat r0 (fun r0' => strictNat c0 (fun c0' => + strictNat r1 (fun r1' => strictNat c1 (fun c1' => + strictNat r2 (fun r2' => strictNat c2 (fun c2' => + f ((r0', c0') :: (r1', c1') :: (r2', c2') :: xs))))))) + +@[simp] theorem strictSegs3_eq {α : Type*} (xs : List (ℕ × ℕ)) (f : List (ℕ × ℕ) → α) : + strictSegs3 xs f = f xs := by + rcases xs with _ | ⟨⟨r0, c0⟩, _ | ⟨⟨r1, c1⟩, _ | ⟨⟨r2, c2⟩, xs⟩⟩⟩ <;> simp [strictSegs3] + +def strictStateFast {α : Type*} (s : RleFullState) (f : RleFullState → α) : α := + match s with + | ⟨m, .raw items, R, h⟩ => + strictMode m (fun m' => + strictItems4 items (fun items' => + strictItems4 R (fun R' => + Bool.casesOn h (f ⟨m', .raw items', R', false⟩) (f ⟨m', .raw items', R', true⟩)))) + | ⟨m, .clean c0 segs bot, R, h⟩ => + strictMode m (fun m' => + strictNat c0 (fun c0' => + strictSegs3 segs (fun segs' => + strictNat bot (fun bot' => + strictItems4 R (fun R' => + Bool.casesOn h (f ⟨m', .clean c0' segs' bot', R', false⟩) + (f ⟨m', .clean c0' segs' bot', R', true⟩)))))) + +@[simp] theorem strictStateFast_eq {α : Type*} (s : RleFullState) (f : RleFullState → α) : + strictStateFast s f = f s := by + rcases s with ⟨m, (_ | ⟨c0, segs, bot⟩), R, h⟩ <;> cases h <;> simp [strictStateFast] + +def runStepsInner (n : ℕ) (s : RleFullState) : RleFullState := + Nat.rec + (fun s => s) + (fun _ ih s => + match s with + | ⟨m, ls, R, true⟩ => ⟨m, ls, R, true⟩ + | ⟨m, ls, R, false⟩ => strictStateFast (rleStep ⟨m, ls, R, false⟩) ih) + n s + +theorem runStepsInner_succ (n : ℕ) (s : RleFullState) : + runStepsInner (n + 1) s = + match s with + | ⟨m, ls, R, true⟩ => ⟨m, ls, R, true⟩ + | ⟨m, ls, R, false⟩ => strictStateFast (rleStep ⟨m, ls, R, false⟩) (runStepsInner n) := rfl + +theorem runStepsInner_halts : ∀ (n : ℕ) (s : RleFullState), + StateHalts target_tm (runStepsInner n s) → StateHalts target_tm s + | 0, _, h => h + | n + 1, ⟨m, ls, R, true⟩, _ => Or.inl rfl + | n + 1, ⟨m, ls, R, false⟩, h => by + rw [runStepsInner_succ] at h + dsimp only at h + rw [strictStateFast_eq] at h + exact Or.inr (rleStep_halts ⟨m, ls, R, false⟩ (runStepsInner_halts n (rleStep ⟨m, ls, R, + false⟩) h)) + +def runBatches (b : ℕ) (s : RleFullState) : RleFullState := + Nat.rec + (fun s => s) + (fun _ ih s => strictState (runStepsInner 25 s) ih) + b s + +theorem runBatches_succ (b : ℕ) (s : RleFullState) : + runBatches (b + 1) s = strictState (runStepsInner 25 s) (runBatches b) := rfl + +theorem runBatches_halts : ∀ (b : ℕ) (s : RleFullState), + StateHalts target_tm (runBatches b s) → StateHalts target_tm s + | 0, _, h => h + | b + 1, s, h => by + rw [runBatches_succ, strictState_eq] at h + exact runStepsInner_halts 25 s (runBatches_halts b (runStepsInner 25 s) h) + +def runSteps (s : RleFullState) : RleFullState := + runBatches 20 s + +theorem runSteps_halts (s : RleFullState) (h : StateHalts target_tm (runSteps s)) : + StateHalts target_tm s := + runBatches_halts 20 s h + +theorem chunk_back {s₁ s₂ : RleFullState} (heq : runSteps s₁ = s₂) (h : StateHalts target_tm s₂) : + StateHalts target_tm s₁ := by + rw [← heq] at h + exact runSteps_halts s₁ h + + +theorem chunk_back_batches {b : ℕ} {s₁ s₂ : RleFullState} + (heq : runBatches b s₁ = s₂) (h : StateHalts target_tm s₂) : + StateHalts target_tm s₁ := by + rw [← heq] at h + exact runBatches_halts b s₁ h + +end BusyBeaver.RleStackEngine + +namespace BusyBeaver.SymRunEngine + +open BusyBeaver.RleStackEngine + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +def encLeft : List (ℕ × ℕ) → ListBlank (Fin 2) + | [] => default + | (a, b) :: L => + (encLeft L <+ (([0] : List (Fin 2)) ^ (1 + b % 1))) <+ + (([1] : List (Fin 2)) ^ (1 * a + 1)) + +def encRight : List (ℕ × ℕ) → ListBlank (Fin 2) + | [] => default + | (d, b) :: R => + (([1] : List (Fin 2)) ^ (1 * d + 1)) +> + ((([0] : List (Fin 2)) ^ (1 + b % 1)) +> encRight R) + +def enc1 : List ℕ → ListBlank (Fin 2) + | [] => default + | a :: R => (([1] : List (Fin 2)) ^ (a + 1)) +> ((0 : Fin 2) >> enc1 R) + +@[simp] theorem encLeft_nil : encLeft [] = default := rfl +@[simp] theorem encRight_nil : encRight [] = default := rfl +@[simp] theorem enc1_nil : enc1 [] = default := rfl +@[simp] theorem enc1_cons (a : ℕ) (R : List ℕ) : + enc1 (a :: R) = (([1] : List (Fin 2)) ^ (a + 1)) +> ((0 : Fin 2) >> enc1 R) := rfl + +theorem encLeft_cons (a b : ℕ) (L : List (ℕ × ℕ)) : + encLeft ((a, b) :: L) = (([1] : List (Fin 2)) ^ (a + 1)) +> ((0 : Fin 2) >> encLeft L) := by + simp only [encLeft, Nat.mod_one, Nat.add_zero, Nat.one_mul] + rfl + +theorem encRight_cons (d b : ℕ) (R : List (ℕ × ℕ)) : + encRight ((d, b) :: R) = (([1] : List (Fin 2)) ^ (d + 1)) +> ((0 : Fin 2) >> encRight R) := by + simp only [encRight, Nat.mod_one, Nat.add_zero, Nat.one_mul] + rfl + +@[simp] theorem encLeft_cons_head (a b : ℕ) (L : List (ℕ × ℕ)) : + (encLeft ((a, b) :: L)).head = (1 : Fin 2) := by + rw [encLeft_cons]; simp + +@[simp] theorem cons_one_encLeft_tail (a b : ℕ) (L : List (ℕ × ℕ)) : + (1 : Fin 2) >> (encLeft ((a, b) :: L)).tail = encLeft ((a, b) :: L) := by + rw [encLeft_cons]; simp + +@[simp] theorem encRight_cons_head (d b : ℕ) (R : List (ℕ × ℕ)) : + (encRight ((d, b) :: R)).head = (1 : Fin 2) := by + rw [encRight_cons]; simp + +@[simp] theorem cons_one_encRight_tail (d b : ℕ) (R : List (ℕ × ℕ)) : + (1 : Fin 2) >> (encRight ((d, b) :: R)).tail = encRight ((d, b) :: R) := by + rw [encRight_cons]; simp + +inductive MItem where + | zero : MItem + | run (d : ℕ) : MItem + deriving DecidableEq + +def encM : List MItem → ListBlank (Fin 2) + | [] => default + | .zero :: M => (0 : Fin 2) >> encM M + | .run d :: M => (([1] : List (Fin 2)) ^ (d + 1)) +> ((0 : Fin 2) >> encM M) + +@[simp] theorem encM_nil : encM [] = default := rfl +@[simp] theorem encM_cons_zero (M : List MItem) : + encM (.zero :: M) = (0 : Fin 2) >> encM M := rfl +@[simp] theorem encM_cons_run (d : ℕ) (M : List MItem) : + encM (.run d :: M) = (([1] : List (Fin 2)) ^ (d + 1)) +> ((0 : Fin 2) >> encM M) := rfl + +@[simp] theorem encM_cons_run_head (d : ℕ) (M : List MItem) : + (encM (.run d :: M)).head = (1 : Fin 2) := by + rw [encM_cons_run]; simp + +@[simp] theorem cons_one_encM_cons_run_tail (d : ℕ) (M : List MItem) : + (1 : Fin 2) >> (encM (.run d :: M)).tail = encM (.run d :: M) := by + rw [encM_cons_run]; simp + +def strictNat {α : Type*} (n : ℕ) (f : ℕ → α) : α := + @Nat.rec (fun _ => α) (f 0) (fun k _ => f k) (Nat.add n 1) + +@[simp] theorem strictNat_eq {α : Type*} (n : ℕ) (f : ℕ → α) : strictNat n f = f n := rfl + +def bumpM : List MItem → List MItem + | [] => [.run 0] + | .zero :: M => .run 0 :: M + | .run d :: M => strictNat (d + 1) (fun d' => .run d' :: M) + +theorem encM_bumpM (M : List MItem) : (1 : Fin 2) >> encM M = encM (bumpM M) := by + cases M with + | nil => simp [bumpM] + | cons x M' => + cases x with + | zero => simp [bumpM] + | run d => simp [bumpM] + +theorem encM_replicate_zero (k : ℕ) (L : List MItem) : + ((([0] : List (Fin 2)) ^ k) +> encM L) = encM (List.replicate k .zero ++ L) := by + induction k with + | zero => rfl + | succ k ih => + simp only [pow_succ_list, nil_append_list, listblank_append_cons, ih, + List.replicate_succ, List.cons_append, encM_cons_zero] + +def isVarA (target_tm : Machine (Fin 2) (Fin 6)) : Bool := + match target_tm 0 1 with + | some (some 2, Stmt.write 0 _) => true + | _ => false + +def cfgBB (target_tm : Machine (Fin 2) (Fin 6)) (L R : List MItem) : Cfg (Fin 2) (Fin 6) := + if isVarA target_tm then + ⟨some 3, ⟨0, encM L, encM R⟩⟩ + else + ⟨some 1, ⟨0, encM L, encM R⟩⟩ + +def cfgCB (target_tm : Machine (Fin 2) (Fin 6)) (L R : List MItem) : Cfg (Fin 2) (Fin 6) := + if isVarA target_tm then + ⟨some 0, ⟨0, encM L, encM R⟩⟩ + else + ⟨some 2, ⟨0, encM L, encM R⟩⟩ + +def cfgDL (target_tm : Machine (Fin 2) (Fin 6)) (L R : List MItem) : Cfg (Fin 2) (Fin 6) := + if isVarA target_tm then + (encM L) <{{(2 : Fin 6)}} (encM R) + else + (encM L) <{{(3 : Fin 6)}} (encM R) + +class HasSymRunRules (target_tm : Machine (Fin 2) (Fin 6)) : Prop where + step_BB_nil (R : List MItem) : + (cfgBB target_tm [] R) [target_tm]⊢⁺ cfgCB target_tm [] (bumpM R) + step_BB_zero (L1 R : List MItem) : + (cfgBB target_tm (.zero :: L1) R) [target_tm]⊢⁺ cfgCB target_tm L1 (bumpM R) + step_BB_run0 (L1 R : List MItem) : + (cfgBB target_tm (.run 0 :: L1) R) [target_tm]⊢⁺ cfgBB target_tm L1 (.run 0 :: R) + step_BB_run1 (L1 R : List MItem) : + (cfgBB target_tm (.run 1 :: L1) R) [target_tm]⊢⁺ cfgBB target_tm L1 (.run 0 :: bumpM R) + step_BB_run2 (L1 R : List MItem) : + (cfgBB target_tm (.run 2 :: L1) R) [target_tm]⊢⁺ + cfgDL target_tm L1 (.run 0 :: .run 0 :: bumpM R) + step_BB_run3 (L1 R : List MItem) : + (cfgBB target_tm (.run 3 :: L1) R) [target_tm]⊢⁺ + cfgBB target_tm (.run 0 :: .zero :: .zero :: L1) (bumpM R) + step_BB_run_ge4 (d : ℕ) (L1 R : List MItem) : + (cfgBB target_tm (.run (d + 4) :: L1) R) [target_tm]⊢⁺ + cfgBB target_tm (.run 0 :: .zero :: .run d :: L1) (bumpM R) + step_DL_run0 (L1 R : List MItem) : + (cfgDL target_tm (.run 0 :: L1) R) [target_tm]⊢⁺ cfgBB target_tm L1 (bumpM R) + step_DL_run1 (L1 R : List MItem) : + (cfgDL target_tm (.run 1 :: L1) R) [target_tm]⊢⁺ cfgDL target_tm L1 (.run 0 :: bumpM R) + step_DL_run2 (d0 : ℕ) (L1 R1 : List MItem) : + (cfgDL target_tm (.run 2 :: L1) (.run d0 :: R1)) [target_tm]⊢⁺ + cfgCB target_tm (.run 0 :: .run 0 :: List.replicate (d0 + 1) .zero ++ L1) R1 + step_CB_nil (L : List MItem) : + (cfgCB target_tm L []) [target_tm]⊢⁺ cfgDL target_tm (bumpM L) [.run 0] + step_CB_zero (L R1 : List MItem) : + (cfgCB target_tm L (.zero :: R1)) [target_tm]⊢⁺ cfgDL target_tm (bumpM L) (bumpM R1) + step_CB_run0_nil (L : List MItem) : + (cfgCB target_tm L [.run 0]) [target_tm]⊢⁺ cfgBB target_tm (.run 0 :: bumpM L) [] + step_CB_run0_zero (L R2 : List MItem) : + (cfgCB target_tm L (.run 0 :: .zero :: R2)) [target_tm]⊢⁺ + cfgBB target_tm (.run 0 :: bumpM L) R2 + step_CB_run0_run0 (L R2 : List MItem) : + (cfgCB target_tm L (.run 0 :: .run 0 :: R2)) [target_tm]⊢⁺ + cfgBB target_tm (.run 0 :: .zero :: bumpM L) R2 + step_CB_run0_run_pos (d2 : ℕ) (L R2 : List MItem) : + (cfgCB target_tm L (.run 0 :: .run (d2 + 1) :: R2)) [target_tm]⊢⁺ + cfgCB target_tm (.run 0 :: .run 0 :: List.replicate d2 .zero ++ bumpM L) R2 + step_CB_run1 (L R1 : List MItem) : + (cfgCB target_tm L (.run 1 :: R1)) [target_tm]⊢⁺ cfgCB target_tm (.run 0 :: bumpM L) R1 + step_CB_run2 (L R1 : List MItem) : + (cfgCB target_tm L (.run 2 :: R1)) [target_tm]⊢⁺ + cfgBB target_tm (bumpM L) (.run 0 :: .zero :: R1) + step_CB_run_ge3 (d : ℕ) (L R1 : List MItem) : + (cfgCB target_tm L (.run (d + 3) :: R1)) [target_tm]⊢⁺ + cfgBB target_tm (bumpM L) (.run 0 :: .run d :: R1) + +variable {target_tm : Machine (Fin 2) (Fin 6)} [HasSymRunRules target_tm] + +abbrev step_BB_nil := HasSymRunRules.step_BB_nil (target_tm := target_tm) +abbrev step_BB_zero := HasSymRunRules.step_BB_zero (target_tm := target_tm) +abbrev step_BB_run0 := HasSymRunRules.step_BB_run0 (target_tm := target_tm) +abbrev step_BB_run1 := HasSymRunRules.step_BB_run1 (target_tm := target_tm) +abbrev step_BB_run2 := HasSymRunRules.step_BB_run2 (target_tm := target_tm) +abbrev step_BB_run3 := HasSymRunRules.step_BB_run3 (target_tm := target_tm) +abbrev step_BB_run_ge4 := HasSymRunRules.step_BB_run_ge4 (target_tm := target_tm) +abbrev step_DL_run0 := HasSymRunRules.step_DL_run0 (target_tm := target_tm) +abbrev step_DL_run1 := HasSymRunRules.step_DL_run1 (target_tm := target_tm) +abbrev step_DL_run2 := HasSymRunRules.step_DL_run2 (target_tm := target_tm) +abbrev step_CB_nil := HasSymRunRules.step_CB_nil (target_tm := target_tm) +abbrev step_CB_zero := HasSymRunRules.step_CB_zero (target_tm := target_tm) +abbrev step_CB_run0_nil := HasSymRunRules.step_CB_run0_nil (target_tm := target_tm) +abbrev step_CB_run0_zero := HasSymRunRules.step_CB_run0_zero (target_tm := target_tm) +abbrev step_CB_run0_run0 := HasSymRunRules.step_CB_run0_run0 (target_tm := target_tm) +abbrev step_CB_run0_run_pos := HasSymRunRules.step_CB_run0_run_pos (target_tm := target_tm) +abbrev step_CB_run1 := HasSymRunRules.step_CB_run1 (target_tm := target_tm) +abbrev step_CB_run2 := HasSymRunRules.step_CB_run2 (target_tm := target_tm) +abbrev step_CB_run_ge3 := HasSymRunRules.step_CB_run_ge3 (target_tm := target_tm) + +inductive SymMode where + | BB : SymMode + | DL : SymMode + | CB : SymMode + | HALT : SymMode + deriving DecidableEq, Repr + +def strictMList {α : Type*} (xs : List MItem) (f : List MItem → α) : α := + match xs with + | [] => f [] + | h :: t => f (h :: t) + +theorem strictMList_eq {α : Type*} (xs : List MItem) (f : List MItem → α) : strictMList xs f = f + xs := by + cases xs <;> rfl + +def prependZeroM : ℕ → List MItem → List MItem + | 0, acc => acc + | n + 1, acc => prependZeroM n (.zero :: acc) + +def stepElemM : SymMode × List MItem × List MItem → SymMode × List MItem × List MItem + | (.BB, [], R) => strictMList (bumpM R) (fun R' => (.CB, [], R')) + | (.BB, .zero :: L1, R) => strictMList (bumpM R) (fun R' => (.CB, L1, R')) + | (.BB, .run 0 :: L1, R) => (.BB, L1, .run 0 :: R) + | (.BB, .run 1 :: L1, R) => strictMList (bumpM R) (fun R' => (.BB, L1, .run 0 :: R')) + | (.BB, .run 2 :: L1, R) => strictMList (bumpM R) (fun R' => (.DL, L1, .run 0 :: .run 0 :: R')) + | (.BB, .run 3 :: L1, R) => strictMList (bumpM R) (fun R' => (.BB, .run 0 :: .zero :: .zero :: + L1, R')) + | (.BB, .run (d + 4) :: L1, R) => + strictNat d (fun d' => strictMList (bumpM R) (fun R' => (.BB, .run 0 :: .zero :: .run d' :: L1 + , R'))) + | (.DL, .zero :: L1, R) => (.HALT, .zero :: L1, R) + | (.DL, .run 0 :: L1, R) => strictMList (bumpM R) (fun R' => (.BB, L1, R')) + | (.DL, .run 1 :: L1, R) => strictMList (bumpM R) (fun R' => (.DL, L1, .run 0 :: R')) + | (.DL, .run 2 :: L1, .run d0 :: R1) => + strictMList (prependZeroM (d0 + 1) L1) (fun L' => (.CB, .run 0 :: .run 0 :: L', R1)) + | (.CB, L, []) => strictMList (bumpM L) (fun L' => (.DL, L', [.run 0])) + | (.CB, L, .zero :: R1) => + strictMList (bumpM L) (fun L' => strictMList (bumpM R1) (fun R' => (.DL, L', R'))) + | (.CB, L, .run 0 :: []) => strictMList (bumpM L) (fun L' => (.BB, .run 0 :: L', [])) + | (.CB, L, .run 0 :: .zero :: R2) => strictMList (bumpM L) (fun L' => (.BB, .run 0 :: L', R2)) + | (.CB, L, .run 0 :: .run 0 :: R2) => strictMList (bumpM L) (fun L' => (.BB, .run 0 :: .zero :: + L', R2)) + | (.CB, L, .run 0 :: .run (d2 + 1) :: R2) => + strictMList (bumpM L) (fun L1 => strictMList (prependZeroM d2 L1) (fun L2 => (.CB, .run 0 :: + .run 0 :: L2, R2))) + | (.CB, L, .run 1 :: R1) => strictMList (bumpM L) (fun L' => (.CB, .run 0 :: L', R1)) + | (.CB, L, .run 2 :: R1) => strictMList (bumpM L) (fun L' => (.BB, L', .run 0 :: .zero :: R1)) + | (.CB, L, .run (d + 3) :: R1) => + strictNat d (fun d' => strictMList (bumpM L) (fun L' => (.BB, L', .run 0 :: .run d' :: R1))) + | s => s + +def iterStep {α : Type*} (f : α → α) : ℕ → α → α + | 0, s => s + | n + 1, s => iterStep f n (f s) + +def stepElem16 := iterStep stepElemM 16 +def stepElem256 := iterStep stepElem16 16 +def stepElem4096 := iterStep stepElem256 16 + + +def runElemFast (a b c d : ℕ) (s : SymMode × List MItem × List MItem) : + SymMode × List MItem × List MItem := + iterStep stepElemM a (iterStep stepElem16 b (iterStep stepElem256 c (iterStep stepElem4096 d s))) + +inductive SymTok where + | item : MItem → SymTok + | repB1 : ℕ → SymTok + | rep2 : ℕ → SymTok + | rep12 : ℕ → SymTok + deriving DecidableEq + +def strictList {α : Type*} (xs : List SymTok) (f : List SymTok → α) : α := + match xs with + | [] => f [] + | h :: t => f (h :: t) + +theorem strictList_eq {α : Type*} (xs : List SymTok) (f : List SymTok → α) : strictList xs f = f + xs := by + cases xs <;> rfl + +def stripPrefixSym : List SymTok → List SymTok → Option (List SymTok) + | [], xs => some xs + | p :: ps, x :: xs => if p = x then stripPrefixSym ps xs else none + | _ :: _, [] => none + +theorem stripPrefixSym_some (pre xs rest : List SymTok) + (h : stripPrefixSym pre xs = some rest) : xs = pre ++ rest := by + induction pre generalizing xs with + | nil => injection h + | cons p ps ih => + cases xs with + | nil => simp [stripPrefixSym] at h + | cons x xs1 => + simp only [stripPrefixSym] at h + split at h + · rename_i heq; subst heq; rw [List.cons_append, ih xs1 h] + · contradiction + +def getRepB1 : SymTok → Option ℕ + | .repB1 k => some k + | _ => none + +def getRep2 : SymTok → Option ℕ + | .rep2 p => some p + | _ => none + +def getRep12 : SymTok → Option ℕ + | .rep12 m => some m + | _ => none + +def eatStep (blk : List SymTok) (getRep : SymTok → Option ℕ) (k : ℕ) (xs : List SymTok) : Option + (ℕ × List SymTok) := + match xs with + | [] => none + | x :: rest => + match getRep x with + | some k2 => some (k + k2, rest) + | none => + match stripPrefixSym blk (x :: rest) with + | some rest2 => some (k + 1, rest2) + | none => none + +def eatFuel (blk : List SymTok) (mkRep : ℕ → SymTok) (getRep : SymTok → Option ℕ) : + ℕ → ℕ → List SymTok → List SymTok + | 0, k, xs => mkRep k :: xs + | fuel + 1, k, xs => + match eatStep blk getRep k xs with + | some (k', rest) => strictNat k' (fun k'' => eatFuel blk mkRep getRep fuel k'' rest) + | none => mkRep k :: xs + +def eatB1 (k : ℕ) (xs : List SymTok) : List SymTok := + eatFuel [.item (.run 0), .item (.run 1)] .repB1 getRepB1 4 k xs + +def eatC2 (p : ℕ) (xs : List SymTok) : List SymTok := + eatFuel [.item (.run 1), .item (.run 0), .item (.run 1)] .rep2 getRep2 4 p xs + +def eatB2 (p : ℕ) (xs : List SymTok) : List SymTok := + eatFuel [.item (.run 0), .item (.run 1), .item (.run 1)] .rep2 getRep2 4 p xs + +def eatC12 (m : ℕ) (xs : List SymTok) : List SymTok := + eatFuel [.item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1)] .rep12 + getRep12 4 m xs + +def eatB12R (m : ℕ) (xs : List SymTok) : List SymTok := + eatFuel [.item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 1)] .rep12 + getRep12 4 m xs + +def peelTok : SymTok → List SymTok → List SymTok + | .repB1 0, xs => .repB1 0 :: xs + | .repB1 1, xs => .item (.run 0) :: .item (.run 1) :: xs + | .repB1 (k + 2), xs => strictNat (k + 1) (fun k' => .item (.run 0) :: .item (.run 1) :: .repB1 + k' :: xs) + | .rep2 0, xs => .rep2 0 :: xs + | .rep2 1, xs => .item (.run 1) :: .item (.run 0) :: .item (.run 1) :: xs + | .rep2 (p + 2), xs => strictNat (p + 1) (fun p' => .item (.run 1) :: .item (.run 0) :: .item + (.run 1) :: .rep2 p' :: xs) + | .rep12 0, xs => .rep12 0 :: xs + | .rep12 1, xs => .item (.run 1) :: .item (.run 0) :: .item (.run 1) :: .item (.run 0) :: .item + (.run 1) :: xs + | .rep12 (m + 2), xs => strictNat (m + 1) (fun m' => .item (.run 1) :: .item (.run 0) :: .item + (.run 1) :: .item (.run 0) :: .item (.run 1) :: .rep12 m' :: xs) + | .item x, xs => .item x :: xs + +def peelL : List SymTok → List SymTok + | [] => [] + | t :: xs => peelTok t xs + +def splitB2Aux : ℕ → ℕ → List SymTok → ℕ × List SymTok + | 0, p, xs => (p, xs) + | fuel + 1, p, xs => + match stripPrefixSym [.item (.run 0), .item (.run 1), .item (.run 1)] xs with + | some rest => strictNat (p + 1) (fun p' => splitB2Aux fuel p' rest) + | none => (p, xs) + +def splitB2 (p : ℕ) (xs : List SymTok) : ℕ × List SymTok := splitB2Aux 32 p xs + +def sep3A : List SymTok := [.item (.run 0), .item (.run 1), .item (.run 2)] +def sep3B : List SymTok := [.item (.run 0), .item .zero, .item (.run 1)] + +def popSep3 (xs : List SymTok) : Option (List SymTok × List SymTok) := + match stripPrefixSym sep3A xs with + | some rest => some (sep3A, rest) + | none => + match stripPrefixSym sep3B xs with + | some rest => some (sep3B, rest) + | none => none + +def popRep2 : List SymTok → Option (ℕ × List SymTok) + | .rep2 p :: rest => some (p, rest) + | _ => none + +def popRep12 : List SymTok → Option (ℕ × List SymTok) + | .rep12 m :: rest => some (m, rest) + | _ => none + +def popRepB1 : List SymTok → Option (ℕ × List SymTok) + | .repB1 k :: rest => some (k, rest) + | _ => none + +def matchEndB1 (xs : List SymTok) : Option ℕ := + match popRepB1 xs with + | some (k, rest) => + match stripPrefixSym [.item (.run 0)] rest with + | some rest2 => + match rest2 with + | [] => some k + | _ :: _ => none + | none => none + | none => none + +def bumpSymL : List SymTok → List SymTok + | [] => [.item (.run 0)] + | .item .zero :: M => .item (.run 0) :: M + | .item (.run d) :: M => strictNat (d + 1) (fun d' => .item (.run d') :: M) + | .repB1 0 :: M => bumpSymL M + | .repB1 1 :: M => .item (.run 1) :: .item (.run 1) :: M + | .repB1 (k + 2) :: M => strictNat (k + 1) (fun k' => .item (.run 1) :: .item (.run 1) :: .repB1 + k' :: M) + | .rep2 0 :: M => bumpSymL M + | .rep2 (p + 1) :: M => strictNat p (fun p' => .item (.run 2) :: .item (.run 0) :: .item (.run + 1) :: .rep2 p' :: M) + | .rep12 0 :: M => bumpSymL M + | .rep12 (m + 1) :: M => strictNat m (fun m' => .item (.run 2) :: .item (.run 0) :: .item (.run + 1) :: .item (.run 0) :: .item (.run 1) :: .rep12 m' :: M) + +def bumpSymR : List SymTok → List SymTok + | [] => [.item (.run 0)] + | .item .zero :: M => .item (.run 0) :: M + | .item (.run d) :: M => strictNat (d + 1) (fun d' => .item (.run d') :: M) + | .repB1 0 :: M => bumpSymR M + | .repB1 1 :: M => .item (.run 1) :: .item (.run 1) :: M + | .repB1 (k + 2) :: M => strictNat (k + 1) (fun k' => .item (.run 1) :: .item (.run 1) :: .repB1 + k' :: M) + | .rep2 0 :: M => bumpSymR M + | .rep2 (p + 1) :: M => strictNat p (fun p' => .item (.run 1) :: .item (.run 1) :: .item (.run + 1) :: .rep2 p' :: M) + | .rep12 0 :: M => bumpSymR M + | .rep12 (m + 1) :: M => strictNat m (fun m' => .item (.run 1) :: .item (.run 1) :: .item (.run + 0) :: .item (.run 1) :: .item (.run 1) :: .rep12 m' :: M) + +def prependZeroSym : ℕ → List SymTok → List SymTok + | 0, acc => acc + | n + 1, acc => prependZeroSym n (.item .zero :: acc) + +def stepElemBB (L R : List SymTok) : SymMode × List SymTok × List SymTok := + match L with + | [] => strictList (bumpSymR R) (fun R' => (.CB, [], R')) + | .item .zero :: L1 => strictList (bumpSymR R) (fun R' => (.CB, L1, R')) + | .item (.run 0) :: L1 => (.BB, L1, .item (.run 0) :: R) + | .item (.run 1) :: L1 => strictList (bumpSymR R) (fun R' => (.BB, L1, .item (.run 0) :: R')) + | .item (.run 2) :: L1 => strictList (bumpSymR R) (fun R' => (.DL, L1, .item (.run 0) :: .item + (.run 0) :: R')) + | .item (.run 3) :: L1 => strictList (bumpSymR R) (fun R' => (.BB, .item (.run 0) :: .item .zero + :: .item .zero :: L1, R')) + | .item (.run (d + 4)) :: L1 => + strictNat d (fun d' => strictList (bumpSymR R) (fun R' => (.BB, .item (.run 0) :: .item .zero + :: .item (.run d') :: L1, R'))) + | .repB1 k :: L1 => (.BB, .repB1 k :: L1, R) + | .rep2 p :: L1 => (.BB, .rep2 p :: L1, R) + | .rep12 m :: L1 => (.BB, .rep12 m :: L1, R) + +def stepElemDL (L R : List SymTok) : SymMode × List SymTok × List SymTok := + match L with + | [] => (.DL, [], R) + | .item .zero :: L1 => (.HALT, .item .zero :: L1, R) + | .item (.run 0) :: L1 => strictList (bumpSymR R) (fun R' => (.BB, L1, R')) + | .item (.run 1) :: L1 => strictList (bumpSymR R) (fun R' => (.DL, L1, .item (.run 0) :: R')) + | .item (.run 2) :: L1 => + match R with + | .item (.run d0) :: R1 => + strictList (prependZeroSym (d0 + 1) L1) (fun L' => (.CB, .item (.run 0) :: .item (.run 0) :: + L', R1)) + | [] => (.DL, .item (.run 2) :: L1, []) + | .item .zero :: R1 => (.DL, .item (.run 2) :: L1, .item .zero :: R1) + | .repB1 k :: R1 => (.DL, .item (.run 2) :: L1, .repB1 k :: R1) + | .rep2 p :: R1 => (.DL, .item (.run 2) :: L1, .rep2 p :: R1) + | .rep12 m :: R1 => (.DL, .item (.run 2) :: L1, .rep12 m :: R1) + | .item (.run (d + 3)) :: L1 => (.DL, .item (.run (d + 3)) :: L1, R) + | .repB1 k :: L1 => (.DL, .repB1 k :: L1, R) + | .rep2 p :: L1 => (.DL, .rep2 p :: L1, R) + | .rep12 m :: L1 => (.DL, .rep12 m :: L1, R) + +def stepElemCB_run0 (L : List SymTok) : List SymTok → SymMode × List SymTok × List SymTok + | [] => strictList (bumpSymL L) (fun L' => (.BB, .item (.run 0) :: L', [])) + | .item .zero :: R2 => strictList (bumpSymL L) (fun L' => (.BB, .item (.run 0) :: L', R2)) + | .item (.run 0) :: R2 => strictList (bumpSymL L) (fun L' => (.BB, .item (.run 0) :: .item .zero + :: L', R2)) + | .item (.run (d2 + 1)) :: R2 => + strictList (bumpSymL L) (fun L1 => strictList (prependZeroSym d2 L1) (fun L2 => (.CB, .item + (.run 0) :: .item (.run 0) :: L2, R2))) + | .repB1 k :: R2 => (.CB, L, .item (.run 0) :: .repB1 k :: R2) + | .rep2 p :: R2 => (.CB, L, .item (.run 0) :: .rep2 p :: R2) + | .rep12 m :: R2 => (.CB, L, .item (.run 0) :: .rep12 m :: R2) + +def stepElemCB (L R : List SymTok) : SymMode × List SymTok × List SymTok := + match R with + | [] => strictList (bumpSymL L) (fun L' => (.DL, L', [.item (.run 0)])) + | .item .zero :: R1 => + strictList (bumpSymL L) (fun L' => strictList (bumpSymR R1) (fun R' => (.DL, L', R'))) + | .item (.run 0) :: R1 => stepElemCB_run0 L R1 + | .item (.run 1) :: R1 => strictList (bumpSymL L) (fun L' => (.CB, .item (.run 0) :: L', R1)) + | .item (.run 2) :: R1 => strictList (bumpSymL L) (fun L' => (.BB, L', .item (.run 0) :: .item + .zero :: R1)) + | .item (.run (d + 3)) :: R1 => + strictNat d (fun d' => strictList (bumpSymL L) (fun L' => (.BB, L', .item (.run 0) :: .item + (.run d') :: R1))) + | .repB1 k :: R1 => (.CB, L, .repB1 k :: R1) + | .rep2 p :: R1 => (.CB, L, .rep2 p :: R1) + | .rep12 m :: R1 => (.CB, L, .rep12 m :: R1) + +def stepElemSym : SymMode → List SymTok → List SymTok → SymMode × List SymTok × List SymTok + | .BB, L, R => stepElemBB L R + | .DL, L, R => stepElemDL L R + | .CB, L, R => stepElemCB L R + | .HALT, L, R => (.HALT, L, R) + +def sweepBB : List SymTok → List SymTok → SymMode × List SymTok × List SymTok + | [], R => stepElemBB [] R + | .item .zero :: L1, R => stepElemBB (.item .zero :: L1) R + | .item (.run 0) :: L1, R => sweepBB L1 (.item (.run 0) :: R) + | .item (.run 1) :: L1, R => strictList (bumpSymR R) (fun R' => sweepBB L1 (.item (.run 0) :: + R')) + | .item (.run (d + 2)) :: L1, R => strictNat (d + 2) (fun d' => stepElemBB (.item (.run d') :: + L1) R) + | .repB1 k :: L1, R => strictList (eatB1 k R) (fun R' => sweepBB L1 R') + | .rep2 p :: L1, R => + match stripPrefixSym [.item (.run 0), .item (.run 1)] R with + | some R2 => strictList (eatB2 p R2) (fun R' => sweepBB L1 (.item (.run 0) :: .item (.run 1) + :: R')) + | none => strictList (peelTok (.rep2 p) L1) (fun L' => stepElemBB L' R) + | .rep12 m :: L1, R => + match stripPrefixSym [.item (.run 0), .item (.run 1)] R with + | some R2 => strictList (eatB12R m R2) (fun R' => sweepBB L1 (.item (.run 0) :: .item (.run 1) + :: R')) + | none => strictList (peelTok (.rep12 m) L1) (fun L' => stepElemBB L' R) + +def sweepCB (L : List SymTok) : List SymTok → List SymTok × List SymTok + | [] => (L, []) + | .item .zero :: R1 => (L, .item .zero :: R1) + | .item (.run 0) :: .item (.run 1) :: R2 => + strictList (bumpSymL L) (fun L' => sweepCB (.item (.run 0) :: .item (.run 0) :: L') R2) + | .item (.run 0) :: R1 => (L, .item (.run 0) :: R1) + | .item (.run 1) :: R1 => + strictList (bumpSymL L) (fun L' => sweepCB (.item (.run 0) :: L') R1) + | .item (.run (d + 2)) :: R1 => strictNat (d + 2) (fun d' => (L, .item (.run d') :: R1)) + | .repB1 k :: R1 => + match stripPrefixSym [.item (.run 0)] L with + | some L1 => strictList (eatB1 k L1) (fun L' => sweepCB (.item (.run 0) :: L') R1) + | none => (L, .repB1 k :: R1) + | .rep2 p :: R1 => + match stripPrefixSym [.item (.run 0)] L with + | some L1 => strictList (eatC2 p L1) (fun L' => sweepCB (.item (.run 0) :: L') R1) + | none => (L, .rep2 p :: R1) + | .rep12 m :: R1 => + match stripPrefixSym [.item (.run 0)] L with + | some L1 => strictList (eatC12 m L1) (fun L' => sweepCB (.item (.run 0) :: L') R1) + | none => (L, .rep12 m :: R1) + +def finishThenBB : SymMode × List SymTok × List SymTok → SymMode × List SymTok × List SymTok + | (.BB, L1, R1) => sweepBB L1 R1 + | (.DL, L1, R1) => (.DL, L1, R1) + | (.CB, L1, R1) => (.CB, L1, R1) + | (.HALT, L1, R1) => (.HALT, L1, R1) + +def stepElemThenBB (m : SymMode) (L R : List SymTok) : SymMode × List SymTok × List SymTok := + finishThenBB (stepElemSym m L R) + +def tryRuleA (L : List SymTok) (d : ℕ) (R_tail : List SymTok) : SymMode × List SymTok × List + SymTok := + match stripPrefixSym [.item (.run 0), .item (.run 0), .item (.run 1), .item (.run 1), .item + (.run 0), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 0), .item .zero, .item (.run 1)] + L with + | some rest => + match matchEndB1 rest with + | some k => + strictNat (d / 6) (fun n1 => + match Nat.ble 2 n1 && Nat.ble n1 k with + | true => + strictNat (n1 - 1) (fun m_new => + strictNat (k - n1) (fun k_new => + strictNat (d - 6 * n1) (fun d_new => + (.CB, + [.item (.run 0), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), + .rep12 m_new, .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), + .item .zero, .item (.run 1), .repB1 k_new, .item (.run 0)], + .item (.run d_new) :: R_tail)))) + | false => stepElemThenBB .CB L (.item (.run d) :: R_tail)) + | none => stepElemThenBB .CB L (.item (.run d) :: R_tail) + | none => stepElemThenBB .CB L (.item (.run d) :: R_tail) + +def afterSplitB2 (L : List SymTok) (d2 : ℕ) (R_tail : List SymTok) (res : ℕ × List SymTok) : + SymMode × List SymTok × List SymTok := + match popSep3 res.2 with + | some (s_sep, rest0) => + match popRep12 rest0 with + | some (m12, rest1) => + match stripPrefixSym [.item (.run 1), .item (.run 0), .item (.run 1)] rest1 with + | some rest2 => + match popSep3 rest2 with + | some (m_sep, rest3) => + match matchEndB1 rest3 with + | some k1 => + let p := res.1 + match Nat.ble 2 p && Nat.ble 2 m12 && Nat.ble m12 k1 with + | true => + strictNat (m12 - 1) (fun n3 => + strictNat (p + 2 * n3 - 1) (fun p_new => + strictNat (k1 - n3) (fun k_new => + strictNat (d2 + 4 * n3) (fun d_new => + (.CB, + [.item (.run 0), .item (.run 0), .item (.run 1), .rep2 p_new, .item (.run 1)] ++ + s_sep ++ [.rep12 1, .item (.run 1), .item (.run 0), .item (.run 1)] ++ + m_sep ++ [.repB1 k_new, .item (.run 0)], + .item .zero :: .item (.run d_new) :: R_tail))))) + | false => stepElemThenBB .CB L (.item .zero :: .item (.run d2) :: R_tail) + | none => stepElemThenBB .CB L (.item .zero :: .item (.run d2) :: R_tail) + | none => stepElemThenBB .CB L (.item .zero :: .item (.run d2) :: R_tail) + | none => stepElemThenBB .CB L (.item .zero :: .item (.run d2) :: R_tail) + | none => stepElemThenBB .CB L (.item .zero :: .item (.run d2) :: R_tail) + | none => stepElemThenBB .CB L (.item .zero :: .item (.run d2) :: R_tail) + +def tryRuleB (L : List SymTok) (d2 : ℕ) (R_tail : List SymTok) : SymMode × List SymTok × List + SymTok := + match stripPrefixSym [.item (.run 0)] L with + | some restL => afterSplitB2 L d2 R_tail (splitB2 0 restL) + | none => stepElemThenBB .CB L (.item .zero :: .item (.run d2) :: R_tail) + +def tryRuleBC (L : List SymTok) (d2 : ℕ) (R_tail : List SymTok) : SymMode × List SymTok × List + SymTok := + match stripPrefixSym [.item (.run 0), .item (.run 0), .item (.run 1)] L with + | some rest1 => + match popRep2 rest1 with + | some (p, restC) => + match stripPrefixSym [.item (.run 0), .item (.run 1), .item (.run 1), .item (.run 1)] restC + with + | some rest2 => + match matchEndB1 rest2 with + | some k1 => + match Nat.ble 3 p && Nat.ble 1 k1 with + | true => + strictNat (p - 2) (fun n4 => + strictNat (k1 + 2 * n4) (fun k_new => + strictNat (d2 + 2 * n4) (fun d_new => + (.CB, + [.item (.run 0), .item (.run 0), .item (.run 1), .rep2 2, + .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 1), + .repB1 k_new, .item (.run 0)], + .item .zero :: .item (.run d_new) :: R_tail)))) + | false => tryRuleB L d2 R_tail + | none => tryRuleB L d2 R_tail + | none => tryRuleB L d2 R_tail + | none => tryRuleB L d2 R_tail + | none => tryRuleB L d2 R_tail + +def afterSweepCB : List SymTok × List SymTok → SymMode × List SymTok × List SymTok + | (L, .item .zero :: .item (.run d2) :: R_tail) => tryRuleBC L d2 R_tail + | (L, .item (.run (d + 12)) :: R_tail) => strictNat (d + 12) (fun d' => tryRuleA L d' R_tail) + | (L, R) => stepElemThenBB .CB L R + +def stepSym : SymMode × List SymTok × List SymTok → SymMode × List SymTok × List SymTok + | (.BB, L, R) => sweepBB L R + | (.DL, L, R) => strictList (peelL L) (fun L' => stepElemThenBB .DL L' R) + | (.HALT, L, R) => (.HALT, L, R) + | (.CB, L0, R0) => afterSweepCB (sweepCB L0 R0) + +def stepSym16 := iterStep stepSym 16 +def stepSym256 := iterStep stepSym16 16 +def stepSym4096 := iterStep stepSym256 16 + +theorem stepStar_refl {M : Machine Γ Λ} {c : Cfg Γ Λ} : c [M]⊢* c := ⟨0, rfl⟩ + +theorem step_BB_r0_r1 (L R : List MItem) : + (cfgBB target_tm (.run 0 :: .run 1 :: L) R) [target_tm]⊢⁺ cfgBB target_tm L (.run 0 :: .run 1 + :: R) := + stepPlus_trans (step_BB_run0 (.run 1 :: L) R) (step_BB_run1 L (.run 0 :: R)) + +theorem step_BB_r1_r0_r1_comm (L R : List MItem) : + (cfgBB target_tm (.run 1 :: .run 0 :: .run 1 :: L) (.run 0 :: .run 1 :: R)) [target_tm]⊢⁺ + cfgBB target_tm L (.run 0 :: .run 1 :: .run 0 :: .run 1 :: .run 1 :: R) := + stepPlus_trans (step_BB_run1 (.run 0 :: .run 1 :: L) (.run 0 :: .run 1 :: R)) + (stepPlus_trans (step_BB_run0 (.run 1 :: L) (.run 0 :: .run 1 :: .run 1 :: R)) + (step_BB_run1 L (.run 0 :: .run 0 :: .run 1 :: .run 1 :: R))) + +def evalM (target_tm : Machine (Fin 2) (Fin 6)) : SymMode × List MItem × List MItem → Cfg (Fin 2) + (Fin 6) + | (.BB, L, R) => cfgBB target_tm L R + | (.DL, L, R) => cfgDL target_tm L R + | (.CB, L, R) => cfgCB target_tm L R + | (.HALT, L, R) => cfgDL target_tm L R + +theorem prependZeroM_eq (n : ℕ) (acc : List MItem) : + prependZeroM n acc = List.replicate n .zero ++ acc := by + induction n generalizing acc with + | zero => rfl + | succ n ih => + rw [prependZeroM, ih, List.replicate_succ', List.append_assoc] + rfl + +theorem stepElemM_sound (s : SymMode × List MItem × List MItem) : + ((evalM target_tm) s) [target_tm]⊢* ((evalM target_tm) (stepElemM s)) := by + rcases s with ⟨m, L, R⟩ + cases m with + | BB => + cases L with + | nil => + simp only [stepElemM, strictMList_eq, evalM] + exact stepPlus_stepStar (step_BB_nil R) + | cons x L1 => + cases x with + | zero => + simp only [stepElemM, strictMList_eq, evalM] + exact stepPlus_stepStar (step_BB_zero L1 R) + | run d => + rcases d with _ | _ | _ | _ | d <;> + simp only [stepElemM, strictMList_eq, strictNat_eq, evalM] + · exact stepPlus_stepStar (step_BB_run0 L1 R) + · exact stepPlus_stepStar (step_BB_run1 L1 R) + · exact stepPlus_stepStar (step_BB_run2 L1 R) + · exact stepPlus_stepStar (step_BB_run3 L1 R) + · exact stepPlus_stepStar (step_BB_run_ge4 d L1 R) + | DL => + cases L with + | nil => exact stepStar_refl + | cons x L1 => + cases x with + | zero => exact stepStar_refl + | run d => + rcases d with _ | _ | _ | d + · simp only [stepElemM, strictMList_eq, evalM] + exact stepPlus_stepStar (step_DL_run0 L1 R) + · simp only [stepElemM, strictMList_eq, evalM] + exact stepPlus_stepStar (step_DL_run1 L1 R) + · cases R with + | nil => exact stepStar_refl + | cons y R1 => + cases y with + | zero => exact stepStar_refl + | run d0 => + simp only [stepElemM, strictMList_eq, evalM, prependZeroM_eq] + exact stepPlus_stepStar (step_DL_run2 d0 L1 R1) + · exact stepStar_refl + | CB => + cases R with + | nil => + simp only [stepElemM, strictMList_eq, evalM] + exact stepPlus_stepStar (step_CB_nil L) + | cons x R1 => + cases x with + | zero => + simp only [stepElemM, strictMList_eq, evalM] + exact stepPlus_stepStar (step_CB_zero L R1) + | run d => + rcases d with _ | _ | _ | d + · cases R1 with + | nil => + simp only [stepElemM, strictMList_eq, evalM] + exact stepPlus_stepStar (step_CB_run0_nil L) + | cons y R2 => + cases y with + | zero => + simp only [stepElemM, strictMList_eq, evalM] + exact stepPlus_stepStar (step_CB_run0_zero L R2) + | run d2 => + rcases d2 with _ | d2 <;> + simp only [stepElemM, strictMList_eq, evalM, prependZeroM_eq] + · exact stepPlus_stepStar (step_CB_run0_run0 L R2) + · exact stepPlus_stepStar (step_CB_run0_run_pos d2 L R2) + · simp only [stepElemM, strictMList_eq, evalM] + exact stepPlus_stepStar (step_CB_run1 L R1) + · simp only [stepElemM, strictMList_eq, evalM] + exact stepPlus_stepStar (step_CB_run2 L R1) + · simp only [stepElemM, strictMList_eq, strictNat_eq, evalM] + exact stepPlus_stepStar (step_CB_run_ge3 d L R1) + | HALT => exact stepStar_refl + +omit [HasSymRunRules target_tm] in +theorem iterStep_sound {α : Type*} (f : α → α) (ev : α → Cfg (Fin 2) (Fin 6)) + (hf : ∀ s, (ev s) [target_tm]⊢* (ev (f s))) (n : ℕ) (s : α) : + (ev s) [target_tm]⊢* (ev (iterStep f n s)) := by + induction n generalizing s with + | zero => exact stepStar_refl + | succ n ih => exact stepStar_trans (hf s) (ih (f s)) + +def repBlock (blk : List MItem) : ℕ → List MItem + | 0 => [] + | k + 1 => blk ++ repBlock blk k + +theorem repBlock_add (blk : List MItem) (k1 k2 : ℕ) : + repBlock blk (k1 + k2) = repBlock blk k1 ++ repBlock blk k2 := by + induction k1 with + | zero => simp [repBlock] + | succ k1 ih => simp [repBlock, Nat.succ_add, ih, List.append_assoc] + +theorem repBlock_succ_right (blk : List MItem) (k : ℕ) : + repBlock blk (k + 1) = repBlock blk k ++ blk := by + rw [repBlock_add] + simp [repBlock] + +def encSymL : List SymTok → List MItem + | [] => [] + | .item x :: xs => x :: encSymL xs + | .repB1 k :: xs => repBlock [.run 0, .run 1] k ++ encSymL xs + | .rep2 p :: xs => repBlock [.run 1, .run 0, .run 1] p ++ encSymL xs + | .rep12 m :: xs => repBlock [.run 1, .run 0, .run 1, .run 0, .run 1] m ++ encSymL xs + +def encSymR : List SymTok → List MItem + | [] => [] + | .item x :: xs => x :: encSymR xs + | .repB1 k :: xs => repBlock [.run 0, .run 1] k ++ encSymR xs + | .rep2 p :: xs => repBlock [.run 0, .run 1, .run 1] p ++ encSymR xs + | .rep12 m :: xs => repBlock [.run 0, .run 1, .run 0, .run 1, .run 1] m ++ encSymR xs + +def evalSym (target_tm : Machine (Fin 2) (Fin 6)) (s : SymMode × List SymTok × List SymTok) : Cfg + (Fin 2) (Fin 6) := + (evalM target_tm) (s.1, encSymL s.2.1, encSymR s.2.2) + +theorem enc_eatFuel (enc : List SymTok → List MItem) (mblk : List MItem) + (blk : List SymTok) (mkRep : ℕ → SymTok) (getRep : SymTok → Option ℕ) + (hmk : ∀ k xs, enc (mkRep k :: xs) = repBlock mblk k ++ enc xs) + (hget : ∀ x k2 rest, getRep x = some k2 → enc (x :: rest) = repBlock mblk k2 ++ enc rest) + (hblk : ∀ rest, enc (blk ++ rest) = mblk ++ enc rest) + (fuel k : ℕ) (xs : List SymTok) : + enc (eatFuel blk mkRep getRep fuel k xs) = repBlock mblk k ++ enc xs := by + induction fuel generalizing k xs with + | zero => exact hmk k xs + | succ fuel ih => + simp only [eatFuel] + cases hstep : eatStep blk getRep k xs with + | none => exact hmk k xs + | some kr => + rcases kr with ⟨k', rest⟩ + simp only [strictNat_eq, ih k' rest] + cases xs with + | nil => simp [eatStep] at hstep + | cons x rest0 => + simp only [eatStep] at hstep + cases hg : getRep x with + | some k2 => + rw [hg] at hstep + simp only [Option.some.injEq, Prod.mk.injEq] at hstep + rcases hstep with ⟨rfl, rfl⟩ + rw [repBlock_add, List.append_assoc, ← hget x k2 rest0 hg] + | none => + rw [hg] at hstep + cases hs : stripPrefixSym blk (x :: rest0) with + | none => rw [hs] at hstep; contradiction + | some rest2 => + rw [hs] at hstep + simp only [Option.some.injEq, Prod.mk.injEq] at hstep + rcases hstep with ⟨rfl, rfl⟩ + have hxs := stripPrefixSym_some blk (x :: rest0) rest2 hs + rw [repBlock_succ_right, List.append_assoc, ← hblk rest2, ← hxs] + +theorem encSymL_eatB1 (k : ℕ) (xs : List SymTok) : + encSymL (eatB1 k xs) = repBlock [.run 0, .run 1] k ++ encSymL xs := + enc_eatFuel encSymL [.run 0, .run 1] [.item (.run 0), .item (.run 1)] .repB1 getRepB1 + (fun _ _ => rfl) + (fun x _ _ h => by + cases x <;> dsimp only [getRepB1] at h <;> try contradiction + injection h with h'; subst h'; rfl) + (fun _ => rfl) 4 k xs + +theorem encSymR_eatB1 (k : ℕ) (xs : List SymTok) : + encSymR (eatB1 k xs) = repBlock [.run 0, .run 1] k ++ encSymR xs := + enc_eatFuel encSymR [.run 0, .run 1] [.item (.run 0), .item (.run 1)] .repB1 getRepB1 + (fun _ _ => rfl) + (fun x _ _ h => by + cases x <;> dsimp only [getRepB1] at h <;> try contradiction + injection h with h'; subst h'; rfl) + (fun _ => rfl) 4 k xs + +theorem encSymL_eatC2 (p : ℕ) (xs : List SymTok) : + encSymL (eatC2 p xs) = repBlock [.run 1, .run 0, .run 1] p ++ encSymL xs := + enc_eatFuel encSymL [.run 1, .run 0, .run 1] [.item (.run 1), .item (.run 0), .item (.run 1)] + .rep2 getRep2 + (fun _ _ => rfl) + (fun x _ _ h => by + cases x <;> dsimp only [getRep2] at h <;> try contradiction + injection h with h'; subst h'; rfl) + (fun _ => rfl) 4 p xs + +theorem encSymR_eatB2 (p : ℕ) (xs : List SymTok) : + encSymR (eatB2 p xs) = repBlock [.run 0, .run 1, .run 1] p ++ encSymR xs := + enc_eatFuel encSymR [.run 0, .run 1, .run 1] [.item (.run 0), .item (.run 1), .item (.run 1)] + .rep2 getRep2 + (fun _ _ => rfl) + (fun x _ _ h => by + cases x <;> dsimp only [getRep2] at h <;> try contradiction + injection h with h'; subst h'; rfl) + (fun _ => rfl) 4 p xs + +theorem encSymL_eatC12 (m : ℕ) (xs : List SymTok) : + encSymL (eatC12 m xs) = repBlock [.run 1, .run 0, .run 1, .run 0, .run 1] m ++ encSymL xs := + enc_eatFuel encSymL [.run 1, .run 0, .run 1, .run 0, .run 1] + [.item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1)] .rep12 + getRep12 + (fun _ _ => rfl) + (fun x _ _ h => by + cases x <;> dsimp only [getRep12] at h <;> try contradiction + injection h with h'; subst h'; rfl) + (fun _ => rfl) 4 m xs + +theorem encSymR_eatB12R (m : ℕ) (xs : List SymTok) : + encSymR (eatB12R m xs) = repBlock [.run 0, .run 1, .run 0, .run 1, .run 1] m ++ encSymR xs := + enc_eatFuel encSymR [.run 0, .run 1, .run 0, .run 1, .run 1] + [.item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 1)] .rep12 + getRep12 + (fun _ _ => rfl) + (fun x _ _ h => by + cases x <;> dsimp only [getRep12] at h <;> try contradiction + injection h with h'; subst h'; rfl) + (fun _ => rfl) 4 m xs + +theorem encSymL_peelTok (t : SymTok) (xs : List SymTok) : + encSymL (peelTok t xs) = encSymL (t :: xs) := by + cases t with + | item x => rfl + | repB1 k => rcases k with _ | _ | k <;> simp [peelTok, strictNat_eq, encSymL, repBlock] + | rep2 p => rcases p with _ | _ | p <;> simp [peelTok, strictNat_eq, encSymL, repBlock] + | rep12 m => rcases m with _ | _ | m <;> simp [peelTok, strictNat_eq, encSymL, repBlock] + +theorem encSymL_peelL (xs : List SymTok) : encSymL (peelL xs) = encSymL xs := by + cases xs with + | nil => rfl + | cons t rest => exact encSymL_peelTok t rest + +theorem encSymL_prependZeroSym (n : ℕ) (acc : List SymTok) : + encSymL (prependZeroSym n acc) = List.replicate n .zero ++ encSymL acc := by + induction n generalizing acc with + | zero => rfl + | succ n ih => + rw [prependZeroSym, ih, encSymL, List.replicate_succ', List.append_assoc] + rfl + +theorem sweep_BB_B1 (k : ℕ) (L R : List MItem) : + (cfgBB target_tm (repBlock [.run 0, .run 1] k ++ L) R) [target_tm]⊢* + (cfgBB target_tm L (repBlock [.run 0, .run 1] k ++ R)) := by + induction k generalizing R with + | zero => exact stepStar_refl + | succ k ih => + have h_eq : repBlock [.run 0, .run 1] (k + 1) ++ R = + repBlock [.run 0, .run 1] k ++ (.run 0 :: .run 1 :: R) := by + rw [repBlock_succ_right, List.append_assoc]; rfl + rw [h_eq] + exact stepStar_trans (stepPlus_stepStar (step_BB_r0_r1 (repBlock [.run 0, .run 1] k ++ L) R)) + (ih (.run 0 :: .run 1 :: R)) + +theorem sweep_BB_C2 (p : ℕ) (L R : List MItem) : + (cfgBB target_tm (repBlock [.run 1, .run 0, .run 1] p ++ L) (.run 0 :: .run 1 :: R)) + [target_tm]⊢* + (cfgBB target_tm L (.run 0 :: .run 1 :: repBlock [.run 0, .run 1, .run 1] p ++ R)) := by + induction p generalizing R with + | zero => exact stepStar_refl + | succ p ih => + have h_eq : (.run 0 :: .run 1 :: repBlock [.run 0, .run 1, .run 1] (p + 1) ++ R) = + (.run 0 :: .run 1 :: repBlock [.run 0, .run 1, .run 1] p ++ (.run 0 :: .run 1 :: .run 1 :: + R)) := by + simp only [repBlock_succ_right, List.cons_append, List.nil_append, List.append_assoc] + rw [h_eq] + exact stepStar_trans (stepPlus_stepStar (step_BB_r1_r0_r1_comm (repBlock [.run 1, .run 0, .run + 1] p ++ L) R)) + (ih (.run 0 :: .run 1 :: .run 1 :: R)) + +theorem sweep_BB_C12 (m : ℕ) (L R : List MItem) : + (cfgBB target_tm (repBlock [.run 1, .run 0, .run 1, .run 0, .run 1] m ++ L) (.run 0 :: .run 1 + :: R)) [target_tm]⊢* + (cfgBB target_tm L (.run 0 :: .run 1 :: repBlock [.run 0, .run 1, .run 0, .run 1, .run 1] m ++ + R)) := by + induction m generalizing R with + | zero => exact stepStar_refl + | succ m ih => + have h_eq : (.run 0 :: .run 1 :: repBlock [.run 0, .run 1, .run 0, .run 1, .run 1] (m + 1) ++ + R) = + (.run 0 :: .run 1 :: repBlock [.run 0, .run 1, .run 0, .run 1, .run 1] m ++ (.run 0 :: + .run 1 :: .run 0 :: .run 1 :: .run 1 :: R)) := by + simp only [repBlock_succ_right, List.cons_append, List.nil_append, List.append_assoc] + rw [h_eq] + have h1 := stepPlus_trans + (step_BB_r1_r0_r1_comm (target_tm := target_tm) + (.run 0 :: .run 1 :: (repBlock [.run 1, .run 0, .run 1, .run 0, .run 1] m ++ L)) R) + (step_BB_r0_r1 (target_tm := target_tm) + (repBlock [.run 1, .run 0, .run 1, .run 0, .run 1] m ++ L) + (.run 0 :: .run 1 :: .run 0 :: .run 1 :: .run 1 :: R)) + exact stepStar_trans (stepPlus_stepStar h1) + (ih (.run 0 :: .run 1 :: .run 0 :: .run 1 :: .run 1 :: R)) + +theorem sweep_CB_B1 (k : ℕ) (L R : List MItem) : + (cfgCB target_tm (.run 0 :: L) (repBlock [.run 0, .run 1] k ++ R)) [target_tm]⊢* + (cfgCB target_tm (.run 0 :: repBlock [.run 0, .run 1] k ++ L) R) := by + induction k generalizing L with + | zero => exact stepStar_refl + | succ k ih => + have h_eq : (.run 0 :: repBlock [.run 0, .run 1] (k + 1) ++ L) = + (.run 0 :: repBlock [.run 0, .run 1] k ++ (.run 0 :: .run 1 :: L)) := by + simp only [repBlock_succ_right, List.cons_append, List.nil_append, List.append_assoc] + rw [h_eq] + have h1 : (cfgCB target_tm (.run 0 :: L) (.run 0 :: .run 1 :: (repBlock [.run 0, .run 1] k ++ + R))) [target_tm]⊢⁺ + cfgCB target_tm (.run 0 :: .run 0 :: .run 1 :: L) (repBlock [.run 0, .run 1] k ++ R) := by + simpa [bumpM] using step_CB_run0_run_pos 0 (.run 0 :: L) (repBlock [.run 0, .run 1] k ++ R) + exact stepStar_trans (stepPlus_stepStar h1) (ih (.run 0 :: .run 1 :: L)) + +theorem sweep_CB_B2 (p : ℕ) (L R : List MItem) : + (cfgCB target_tm (.run 0 :: L) (repBlock [.run 0, .run 1, .run 1] p ++ R)) [target_tm]⊢* + (cfgCB target_tm (.run 0 :: repBlock [.run 1, .run 0, .run 1] p ++ L) R) := by + induction p generalizing L with + | zero => exact stepStar_refl + | succ p ih => + have h_eq : (.run 0 :: repBlock [.run 1, .run 0, .run 1] (p + 1) ++ L) = + (.run 0 :: repBlock [.run 1, .run 0, .run 1] p ++ (.run 1 :: .run 0 :: .run 1 :: L)) := by + simp only [repBlock_succ_right, List.cons_append, List.nil_append, List.append_assoc] + rw [h_eq] + have h1 : (cfgCB target_tm (.run 0 :: L) (.run 0 :: .run 1 :: .run 1 :: (repBlock [.run 0, + .run 1, .run 1] p ++ R))) [target_tm]⊢⁺ + cfgCB target_tm (.run 0 :: .run 0 :: .run 1 :: L) (.run 1 :: (repBlock [.run 0, .run 1, + .run 1] p ++ R)) := by + simpa [bumpM] using step_CB_run0_run_pos 0 (.run 0 :: L) (.run 1 :: (repBlock [.run 0, .run + 1, .run 1] p ++ R)) + have h2 : (cfgCB target_tm (.run 0 :: .run 0 :: .run 1 :: L) (.run 1 :: (repBlock [.run 0, + .run 1, .run 1] p ++ R))) [target_tm]⊢⁺ + cfgCB target_tm (.run 0 :: .run 1 :: .run 0 :: .run 1 :: L) (repBlock [.run 0, .run 1, + .run 1] p ++ R) := by + simpa [bumpM] using step_CB_run1 (.run 0 :: .run 0 :: .run 1 :: L) (repBlock [.run 0, .run 1 + , .run 1] p ++ R) + exact stepStar_trans (stepPlus_stepStar (stepPlus_trans h1 h2)) (ih (.run 1 :: .run 0 :: .run + 1 :: L)) + +theorem sweep_CB_B12R (m : ℕ) (L R : List MItem) : + (cfgCB target_tm (.run 0 :: L) (repBlock [.run 0, .run 1, .run 0, .run 1, .run 1] m ++ R)) + [target_tm]⊢* + (cfgCB target_tm (.run 0 :: repBlock [.run 1, .run 0, .run 1, .run 0, .run 1] m ++ L) R) := by + induction m generalizing L with + | zero => exact stepStar_refl + | succ m ih => + have h_eq : (.run 0 :: repBlock [.run 1, .run 0, .run 1, .run 0, .run 1] (m + 1) ++ L) = + (.run 0 :: repBlock [.run 1, .run 0, .run 1, .run 0, .run 1] m ++ (.run 1 :: .run 0 :: + .run 1 :: .run 0 :: .run 1 :: L)) := by + simp only [repBlock_succ_right, List.cons_append, List.nil_append, List.append_assoc] + rw [h_eq] + have h1 : (cfgCB target_tm (.run 0 :: L) (.run 0 :: .run 1 :: .run 0 :: .run 1 :: .run 1 :: + (repBlock [.run 0, .run 1, .run 0, .run 1, .run 1] m ++ R))) [target_tm]⊢⁺ + cfgCB target_tm (.run 0 :: .run 0 :: .run 1 :: L) (.run 0 :: .run 1 :: .run 1 :: (repBlock + [.run 0, .run 1, .run 0, .run 1, .run 1] m ++ R)) := by + simpa [bumpM] using step_CB_run0_run_pos 0 (.run 0 :: L) (.run 0 :: .run 1 :: .run 1 :: + (repBlock [.run 0, .run 1, .run 0, .run 1, .run 1] m ++ R)) + have h2 : (cfgCB target_tm (.run 0 :: .run 0 :: .run 1 :: L) (.run 0 :: .run 1 :: .run 1 :: + (repBlock [.run 0, .run 1, .run 0, .run 1, .run 1] m ++ R))) [target_tm]⊢⁺ + cfgCB target_tm (.run 0 :: .run 0 :: .run 1 :: .run 0 :: .run 1 :: L) (.run 1 :: (repBlock + [.run 0, .run 1, .run 0, .run 1, .run 1] m ++ R)) := by + simpa [bumpM] using step_CB_run0_run_pos 0 (.run 0 :: .run 0 :: .run 1 :: L) (.run 1 :: + (repBlock [.run 0, .run 1, .run 0, .run 1, .run 1] m ++ R)) + have h3 : (cfgCB target_tm (.run 0 :: .run 0 :: .run 1 :: .run 0 :: .run 1 :: L) (.run 1 :: + (repBlock [.run 0, .run 1, .run 0, .run 1, .run 1] m ++ R))) [target_tm]⊢⁺ + cfgCB target_tm (.run 0 :: .run 1 :: .run 0 :: .run 1 :: .run 0 :: .run 1 :: L) (repBlock + [.run 0, .run 1, .run 0, .run 1, .run 1] m ++ R) := by + simpa [bumpM] using step_CB_run1 (.run 0 :: .run 0 :: .run 1 :: .run 0 :: .run 1 :: L) + (repBlock [.run 0, .run 1, .run 0, .run 1, .run 1] m ++ R) + exact stepStar_trans (stepPlus_stepStar (stepPlus_trans h1 (stepPlus_trans h2 h3))) + (ih (.run 1 :: .run 0 :: .run 1 :: .run 0 :: .run 1 :: L)) + +theorem encSymL_bumpSymL (L : List SymTok) : encSymL (bumpSymL L) = bumpM (encSymL L) := by + induction L with + | nil => rfl + | cons x M ih => + cases x with + | item it => + cases it with + | zero => rfl + | run d => simp [bumpSymL, strictNat_eq, encSymL, bumpM] + | repB1 k => + rcases k with _ | _ | k + · simpa [bumpSymL, encSymL, repBlock] using ih + · rfl + · simp [bumpSymL, strictNat_eq, encSymL, repBlock, bumpM] + | rep2 p => + rcases p with _ | p + · simpa [bumpSymL, encSymL, repBlock] using ih + · simp [bumpSymL, encSymL, repBlock, bumpM] + | rep12 m => + rcases m with _ | m + · simpa [bumpSymL, encSymL, repBlock] using ih + · simp [bumpSymL, encSymL, repBlock, bumpM] + +theorem encSymR_bumpSymR (R : List SymTok) : encSymR (bumpSymR R) = bumpM (encSymR R) := by + induction R with + | nil => rfl + | cons x M ih => + cases x with + | item it => + cases it with + | zero => rfl + | run d => simp [bumpSymR, strictNat_eq, encSymR, bumpM] + | repB1 k => + rcases k with _ | _ | k + · simpa [bumpSymR, encSymR, repBlock] using ih + · rfl + · simp [bumpSymR, strictNat_eq, encSymR, repBlock, bumpM] + | rep2 p => + rcases p with _ | p + · simpa [bumpSymR, encSymR, repBlock] using ih + · simp [bumpSymR, encSymR, repBlock, bumpM] + | rep12 m => + rcases m with _ | m + · simpa [bumpSymR, encSymR, repBlock] using ih + · simp [bumpSymR, encSymR, repBlock, bumpM] + +theorem stepElemBB_sound (L R : List SymTok) : + ((evalSym target_tm) (.BB, L, R)) [target_tm]⊢* ((evalSym target_tm) (stepElemBB L R)) := by + cases L with + | nil => + simp only [stepElemBB, strictList_eq, evalSym, evalM, encSymL, encSymR_bumpSymR] + exact stepPlus_stepStar (step_BB_nil _) + | cons t L1 => + cases t with + | item it => + cases it with + | zero => + simp only [stepElemBB, strictList_eq, evalSym, evalM, encSymL, encSymR_bumpSymR] + exact stepPlus_stepStar (step_BB_zero _ _) + | run d => + rcases d with _ | _ | _ | _ | d <;> + simp only [stepElemBB, strictList_eq, strictNat_eq, evalSym, evalM, encSymL, encSymR, + encSymR_bumpSymR] + · exact stepPlus_stepStar (step_BB_run0 _ _) + · exact stepPlus_stepStar (step_BB_run1 _ _) + · exact stepPlus_stepStar (step_BB_run2 _ _) + · exact stepPlus_stepStar (step_BB_run3 _ _) + · exact stepPlus_stepStar (step_BB_run_ge4 _ _ _) + | repB1 _ => exact stepStar_refl + | rep2 _ => exact stepStar_refl + | rep12 _ => exact stepStar_refl + +theorem stepElemDL_sound (L R : List SymTok) : + ((evalSym target_tm) (.DL, L, R)) [target_tm]⊢* ((evalSym target_tm) (stepElemDL L R)) := by + cases L with + | nil => exact stepStar_refl + | cons t L1 => + cases t with + | item it => + cases it with + | zero => exact stepStar_refl + | run d => + rcases d with _ | _ | _ | d + · simp only [stepElemDL, strictList_eq, evalSym, evalM, encSymL, encSymR_bumpSymR] + exact stepPlus_stepStar (step_DL_run0 _ _) + · simp only [stepElemDL, strictList_eq, evalSym, evalM, encSymL, encSymR, + encSymR_bumpSymR] + exact stepPlus_stepStar (step_DL_run1 _ _) + · cases R with + | nil => exact stepStar_refl + | cons rt R1 => + cases rt with + | item rit => + cases rit with + | zero => exact stepStar_refl + | run d0 => + simp only [stepElemDL, strictList_eq, evalSym, evalM, encSymL, encSymR, + encSymL_prependZeroSym] + exact stepPlus_stepStar (step_DL_run2 _ _ _) + | repB1 _ => exact stepStar_refl + | rep2 _ => exact stepStar_refl + | rep12 _ => exact stepStar_refl + · exact stepStar_refl + | repB1 _ => exact stepStar_refl + | rep2 _ => exact stepStar_refl + | rep12 _ => exact stepStar_refl + +theorem stepElemCB_run0_sound (L R1 : List SymTok) : + ((evalSym target_tm) (.CB, L, .item (.run 0) :: R1)) [target_tm]⊢* ((evalSym target_tm) + (stepElemCB_run0 L R1)) := by + cases R1 with + | nil => + simp only [stepElemCB_run0, strictList_eq, evalSym, evalM, encSymL, encSymR, encSymL_bumpSymL] + exact stepPlus_stepStar (step_CB_run0_nil _) + | cons rt R2 => + cases rt with + | item rit => + cases rit with + | zero => + simp only [stepElemCB_run0, strictList_eq, evalSym, evalM, encSymL, encSymR, + encSymL_bumpSymL] + exact stepPlus_stepStar (step_CB_run0_zero _ _) + | run d2 => + rcases d2 with _ | d2 <;> + simp only [stepElemCB_run0, strictList_eq, evalSym, evalM, encSymL, encSymR, + encSymL_bumpSymL, encSymL_prependZeroSym] + · exact stepPlus_stepStar (step_CB_run0_run0 _ _) + · exact stepPlus_stepStar (step_CB_run0_run_pos _ _ _) + | repB1 _ => exact stepStar_refl + | rep2 _ => exact stepStar_refl + | rep12 _ => exact stepStar_refl + +theorem stepElemCB_sound (L R : List SymTok) : + ((evalSym target_tm) (.CB, L, R)) [target_tm]⊢* ((evalSym target_tm) (stepElemCB L R)) := by + cases R with + | nil => + simp only [stepElemCB, strictList_eq, evalSym, evalM, encSymL_bumpSymL, encSymR] + exact stepPlus_stepStar (step_CB_nil _) + | cons t R1 => + cases t with + | item it => + cases it with + | zero => + simp only [stepElemCB, strictList_eq, evalSym, evalM, encSymL_bumpSymL, encSymR, + encSymR_bumpSymR] + exact stepPlus_stepStar (step_CB_zero _ _) + | run d => + rcases d with _ | _ | _ | d + · exact stepElemCB_run0_sound L R1 + · simp only [stepElemCB, strictList_eq, evalSym, evalM, encSymL, encSymR, + encSymL_bumpSymL] + exact stepPlus_stepStar (step_CB_run1 _ _) + · simp only [stepElemCB, strictList_eq, evalSym, evalM, encSymR, encSymL_bumpSymL] + exact stepPlus_stepStar (step_CB_run2 _ _) + · simp only [stepElemCB, strictList_eq, strictNat_eq, evalSym, evalM, encSymR, + encSymL_bumpSymL] + exact stepPlus_stepStar (step_CB_run_ge3 _ _ _) + | repB1 _ => exact stepStar_refl + | rep2 _ => exact stepStar_refl + | rep12 _ => exact stepStar_refl + +theorem stepElemSym_sound (m : SymMode) (L R : List SymTok) : + ((evalSym target_tm) (m, L, R)) [target_tm]⊢* ((evalSym target_tm) (stepElemSym m L R)) := by + cases m with + | BB => exact stepElemBB_sound L R + | DL => exact stepElemDL_sound L R + | CB => exact stepElemCB_sound L R + | HALT => exact stepStar_refl + +theorem sweepBB_sound (L R : List SymTok) : + ((evalSym target_tm) (.BB, L, R)) [target_tm]⊢* ((evalSym target_tm) (sweepBB L R)) := by + induction L generalizing R with + | nil => exact stepElemBB_sound [] R + | cons t L1 ih => + cases t with + | item it => + cases it with + | zero => exact stepElemBB_sound (.item .zero :: L1) R + | run d => + rcases d with _ | _ | d + · simp only [sweepBB] + exact stepStar_trans (stepPlus_stepStar (step_BB_run0 (encSymL L1) (encSymR R))) (ih + (.item (.run 0) :: R)) + · simp only [sweepBB, strictList_eq] + have h1 : ((evalSym target_tm) (.BB, .item (.run 1) :: L1, R)) [target_tm]⊢* + ((evalSym target_tm) (.BB, L1, .item (.run 0) :: bumpSymR R)) := by + simp only [evalSym, evalM, encSymL, encSymR, encSymR_bumpSymR] + exact stepPlus_stepStar (step_BB_run1 (encSymL L1) (encSymR R)) + exact stepStar_trans h1 (ih (.item (.run 0) :: bumpSymR R)) + · exact stepElemBB_sound (.item (.run (d + 2)) :: L1) R + | repB1 k => + simp only [sweepBB, strictList_eq] + have h1 : ((evalSym target_tm) (.BB, .repB1 k :: L1, R)) [target_tm]⊢* + ((evalSym target_tm) (.BB, L1, eatB1 k R)) := by + simp only [evalSym, evalM, encSymL, encSymR_eatB1] + exact sweep_BB_B1 k (encSymL L1) (encSymR R) + exact stepStar_trans h1 (ih (eatB1 k R)) + | rep2 p => + simp only [sweepBB] + cases hstrip : stripPrefixSym [.item (.run 0), .item (.run 1)] R with + | some R2 => + have hR := stripPrefixSym_some _ R R2 hstrip + simp only [strictList_eq] + have h1 : ((evalSym target_tm) (.BB, .rep2 p :: L1, R)) [target_tm]⊢* + ((evalSym target_tm) (.BB, L1, .item (.run 0) :: .item (.run 1) :: eatB2 p R2)) := by + rw [hR] + simp only [evalSym, evalM, encSymL, encSymR, encSymR_eatB2, List.cons_append, + List.nil_append] + exact sweep_BB_C2 p (encSymL L1) (encSymR R2) + exact stepStar_trans h1 (ih (.item (.run 0) :: .item (.run 1) :: eatB2 p R2)) + | none => + simp only [strictList_eq] + have heq : (evalSym target_tm) (.BB, .rep2 p :: L1, R) = (evalSym target_tm) (.BB, peelTok + (.rep2 p) L1, R) := by + simp only [evalSym, encSymL_peelTok] + rw [heq] + exact stepElemBB_sound (peelTok (.rep2 p) L1) R + | rep12 m => + simp only [sweepBB] + cases hstrip : stripPrefixSym [.item (.run 0), .item (.run 1)] R with + | some R2 => + have hR := stripPrefixSym_some _ R R2 hstrip + simp only [strictList_eq] + have h1 : ((evalSym target_tm) (.BB, .rep12 m :: L1, R)) [target_tm]⊢* + ((evalSym target_tm) (.BB, L1, .item (.run 0) :: .item (.run 1) :: eatB12R m R2)) := + by + rw [hR] + simp only [evalSym, evalM, encSymL, encSymR, encSymR_eatB12R, List.cons_append, + List.nil_append] + exact sweep_BB_C12 m (encSymL L1) (encSymR R2) + exact stepStar_trans h1 (ih (.item (.run 0) :: .item (.run 1) :: eatB12R m R2)) + | none => + simp only [strictList_eq] + have heq : (evalSym target_tm) (.BB, .rep12 m :: L1, R) = (evalSym target_tm) (.BB, + peelTok (.rep12 m) L1, R) := by + simp only [evalSym, encSymL_peelTok] + rw [heq] + exact stepElemBB_sound (peelTok (.rep12 m) L1) R + +theorem sweepCB_sound (L R : List SymTok) : + ((evalSym target_tm) (.CB, L, R)) [target_tm]⊢* ((evalSym target_tm) (.CB, (sweepCB L R).1, + (sweepCB L R).2)) := by + induction L, R using sweepCB.induct with + | case1 L => exact stepStar_refl + | case2 L R1 => exact stepStar_refl + | case3 L R2 ih => + simp only [sweepCB, strictList_eq] + have h1 : ((evalSym target_tm) (.CB, L, .item (.run 0) :: .item (.run 1) :: R2)) [target_tm]⊢* + ((evalSym target_tm) (.CB, .item (.run 0) :: .item (.run 0) :: bumpSymL L, R2)) := by + simp only [evalSym, evalM, encSymL, encSymR, encSymL_bumpSymL] + simpa using stepPlus_stepStar (step_CB_run0_run_pos 0 (encSymL L) (encSymR R2)) + exact stepStar_trans h1 (ih (bumpSymL L)) + | case4 L R1 hnot => + have heq : sweepCB L (.item (.run 0) :: R1) = (L, .item (.run 0) :: R1) := by + cases R1 with + | nil => rfl + | cons y R2 => + cases y with + | item it => + cases it with + | zero => rfl + | run d => + rcases d with _ | _ | d + · rfl + · exfalso; exact hnot R2 rfl + · rfl + | repB1 _ => rfl + | rep2 _ => rfl + | rep12 _ => rfl + rw [heq]; try exact stepStar_refl + | case5 L R1 ih => + simp only [sweepCB, strictList_eq] + have h1 : ((evalSym target_tm) (.CB, L, .item (.run 1) :: R1)) [target_tm]⊢* + ((evalSym target_tm) (.CB, .item (.run 0) :: bumpSymL L, R1)) := by + simp only [evalSym, evalM, encSymL, encSymR, encSymL_bumpSymL] + exact stepPlus_stepStar (step_CB_run1 (encSymL L) (encSymR R1)) + exact stepStar_trans h1 (ih (bumpSymL L)) + | case6 L d R1 => exact stepStar_refl + | case7 L k R1 L1 hstrip ih => + have hL := stripPrefixSym_some _ L L1 hstrip + simp only [sweepCB, hstrip, strictList_eq] + have h1 : ((evalSym target_tm) (.CB, L, .repB1 k :: R1)) [target_tm]⊢* + ((evalSym target_tm) (.CB, .item (.run 0) :: eatB1 k L1, R1)) := by + rw [hL] + simp only [evalSym, evalM, encSymL, encSymR, encSymL_eatB1, List.cons_append, + List.nil_append] + exact sweep_CB_B1 k (encSymL L1) (encSymR R1) + exact stepStar_trans h1 (ih (eatB1 k L1)) + | case8 L k R1 hstrip => + simp only [sweepCB, hstrip]; try exact stepStar_refl + | case9 L p R1 L1 hstrip ih => + have hL := stripPrefixSym_some _ L L1 hstrip + simp only [sweepCB, hstrip, strictList_eq] + have h1 : ((evalSym target_tm) (.CB, L, .rep2 p :: R1)) [target_tm]⊢* + ((evalSym target_tm) (.CB, .item (.run 0) :: eatC2 p L1, R1)) := by + rw [hL] + simp only [evalSym, evalM, encSymL, encSymR, encSymL_eatC2, List.cons_append, + List.nil_append] + exact sweep_CB_B2 p (encSymL L1) (encSymR R1) + exact stepStar_trans h1 (ih (eatC2 p L1)) + | case10 L p R1 hstrip => + simp only [sweepCB, hstrip]; try exact stepStar_refl + | case11 L m R1 L1 hstrip ih => + have hL := stripPrefixSym_some _ L L1 hstrip + simp only [sweepCB, hstrip, strictList_eq] + have h1 : ((evalSym target_tm) (.CB, L, .rep12 m :: R1)) [target_tm]⊢* + ((evalSym target_tm) (.CB, .item (.run 0) :: eatC12 m L1, R1)) := by + rw [hL] + simp only [evalSym, evalM, encSymL, encSymR, encSymL_eatC12, List.cons_append, + List.nil_append] + exact sweep_CB_B12R m (encSymL L1) (encSymR R1) + exact stepStar_trans h1 (ih (eatC12 m L1)) + | case12 L m R1 hstrip => + simp only [sweepCB, hstrip]; try exact stepStar_refl + +theorem finishThenBB_sound (s : SymMode × List SymTok × List SymTok) : + ((evalSym target_tm) s) [target_tm]⊢* ((evalSym target_tm) (finishThenBB s)) := by + rcases s with ⟨m, L, R⟩ + cases m <;> try exact stepStar_refl + exact sweepBB_sound L R + +theorem stepElemThenBB_sound (m : SymMode) (L R : List SymTok) : + ((evalSym target_tm) (m, L, R)) [target_tm]⊢* ((evalSym target_tm) (stepElemThenBB m L R)) := + stepStar_trans (stepElemSym_sound m L R) (finishThenBB_sound (stepElemSym m L R)) + +def peelPureTok : SymTok → List SymTok → List SymTok + | .repB1 0, xs => .repB1 0 :: xs + | .repB1 (k + 1), xs => .item (.run 0) :: .item (.run 1) :: .repB1 k :: xs + | .rep2 0, xs => .rep2 0 :: xs + | .rep2 (p + 1), xs => .item (.run 1) :: .item (.run 0) :: .item (.run 1) :: .rep2 p :: xs + | .rep12 0, xs => .rep12 0 :: xs + | .rep12 (m + 1), xs => .item (.run 1) :: .item (.run 0) :: .item (.run 1) :: .item (.run 0) :: + .item (.run 1) :: .rep12 m :: xs + | .item x, xs => .item x :: xs + +theorem encSymL_peelPureTok (t : SymTok) (xs : List SymTok) : + encSymL (peelPureTok t xs) = encSymL (t :: xs) := by + cases t with + | item x => rfl + | repB1 k => cases k <;> simp [peelPureTok, encSymL, repBlock] + | rep2 p => cases p <;> simp [peelPureTok, encSymL, repBlock] + | rep12 m => cases m <;> simp [peelPureTok, encSymL, repBlock] + +def stepPureBB : List SymTok → List SymTok → SymMode × List SymTok × List SymTok + | [], R => stepElemBB [] R + | .item x :: L1, R => stepElemBB (.item x :: L1) R + | .repB1 k :: L1, R => (.BB, L1, .repB1 k :: R) + | .rep2 p :: L1, R => + match stripPrefixSym [.item (.run 0), .item (.run 1)] R with + | some R2 => (.BB, L1, .item (.run 0) :: .item (.run 1) :: .rep2 p :: R2) + | none => stepElemBB (peelPureTok (.rep2 p) L1) R + | .rep12 m :: L1, R => + match stripPrefixSym [.item (.run 0), .item (.run 1)] R with + | some R2 => (.BB, L1, .item (.run 0) :: .item (.run 1) :: .rep12 m :: R2) + | none => stepElemBB (peelPureTok (.rep12 m) L1) R + +def stepPureDL : List SymTok → List SymTok → SymMode × List SymTok × List SymTok + | [], R => (.DL, [], R) + | t :: L1, R => stepElemDL (peelPureTok t L1) R + +def stepPureCB (L : List SymTok) : List SymTok → SymMode × List SymTok × List SymTok + | [] => stepElemCB L [] + | .item .zero :: R1 => stepElemCB L (.item .zero :: R1) + | .item (.run 0) :: R1 => stepElemCB_run0 L R1 + | .item (.run 1) :: R1 => stepElemCB L (.item (.run 1) :: R1) + | .item (.run 2) :: R1 => stepElemCB L (.item (.run 2) :: R1) + | .item (.run (d + 3)) :: R1 => (.BB, bumpSymL L, .item (.run 0) :: .item (.run d) :: R1) + | .repB1 k :: R1 => + match stripPrefixSym [.item (.run 0), .item (.run 0), .item (.run 1)] L with + | some L2 => (.CB, .item (.run 0) :: .repB1 (k + 1) :: L2, R1) + | none => + match stripPrefixSym [.item (.run 0)] L with + | some L1 => (.CB, .item (.run 0) :: .repB1 k :: L1, R1) + | none => (.CB, L, .repB1 k :: R1) + | .rep2 p :: R1 => + match stripPrefixSym [.item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1)] L with + | some L2 => (.CB, .item (.run 0) :: .rep2 (p + 1) :: L2, R1) + | none => + match stripPrefixSym [.item (.run 0)] L with + | some L1 => (.CB, .item (.run 0) :: .rep2 p :: L1, R1) + | none => (.CB, L, .rep2 p :: R1) + | .rep12 m :: R1 => + match stripPrefixSym [.item (.run 0)] L with + | some L1 => (.CB, .item (.run 0) :: .rep12 m :: L1, R1) + | none => (.CB, L, .rep12 m :: R1) + +def stepPure : SymMode × List SymTok × List SymTok → SymMode × List SymTok × List SymTok + | (.BB, L, R) => stepPureBB L R + | (.DL, L, R) => stepPureDL L R + | (.CB, L, R) => stepPureCB L R + | (.HALT, L, R) => (.HALT, L, R) + +theorem stepPureBB_sound (L R : List SymTok) : + ((evalSym target_tm) (.BB, L, R)) [target_tm]⊢* ((evalSym target_tm) (stepPureBB L R)) := by + cases L with + | nil => exact stepElemBB_sound [] R + | cons t L1 => + cases t with + | item x => exact stepElemBB_sound (.item x :: L1) R + | repB1 k => exact sweep_BB_B1 k (encSymL L1) (encSymR R) + | rep2 p => + simp only [stepPureBB] + cases hs : stripPrefixSym [.item (.run 0), .item (.run 1)] R with + | some R2 => + have hR := stripPrefixSym_some _ R R2 hs + rw [hR] + simp only [evalSym, evalM, encSymL, encSymR, List.cons_append, List.nil_append] + exact sweep_BB_C2 p (encSymL L1) (encSymR R2) + | none => + have heq : (evalSym target_tm) (.BB, .rep2 p :: L1, R) = (evalSym target_tm) (.BB, + peelPureTok (.rep2 p) L1, R) := by + simp only [evalSym, encSymL_peelPureTok] + rw [heq] + exact stepElemBB_sound (peelPureTok (.rep2 p) L1) R + | rep12 m => + simp only [stepPureBB] + cases hs : stripPrefixSym [.item (.run 0), .item (.run 1)] R with + | some R2 => + have hR := stripPrefixSym_some _ R R2 hs + rw [hR] + simp only [evalSym, evalM, encSymL, encSymR, List.cons_append, List.nil_append] + exact sweep_BB_C12 m (encSymL L1) (encSymR R2) + | none => + have heq : (evalSym target_tm) (.BB, .rep12 m :: L1, R) = (evalSym target_tm) (.BB, + peelPureTok (.rep12 m) L1, R) := by + simp only [evalSym, encSymL_peelPureTok] + rw [heq] + exact stepElemBB_sound (peelPureTok (.rep12 m) L1) R + +theorem stepPureDL_sound (L R : List SymTok) : + ((evalSym target_tm) (.DL, L, R)) [target_tm]⊢* ((evalSym target_tm) (stepPureDL L R)) := by + cases L with + | nil => exact stepStar_refl + | cons t L1 => + have heq : (evalSym target_tm) (.DL, t :: L1, R) = (evalSym target_tm) (.DL, peelPureTok t L1 + , R) := by + simp only [evalSym, encSymL_peelPureTok] + rw [heq] + exact stepElemDL_sound (peelPureTok t L1) R + +theorem stepPureCB_sound (L R : List SymTok) : + ((evalSym target_tm) (.CB, L, R)) [target_tm]⊢* ((evalSym target_tm) (stepPureCB L R)) := by + cases R with + | nil => exact stepElemCB_sound L [] + | cons t R1 => + cases t with + | item it => + cases it with + | zero => exact stepElemCB_sound L (.item .zero :: R1) + | run d => + rcases d with _ | _ | _ | d + · exact stepElemCB_run0_sound L R1 + · exact stepElemCB_sound L (.item (.run 1) :: R1) + · exact stepElemCB_sound L (.item (.run 2) :: R1) + · simp only [stepPureCB, evalSym, evalM, encSymR, encSymL_bumpSymL] + exact stepPlus_stepStar (step_CB_run_ge3 d (encSymL L) (encSymR R1)) + | repB1 k => + simp only [stepPureCB] + cases hs2 : stripPrefixSym [.item (.run 0), .item (.run 0), .item (.run 1)] L with + | some L2 => + have hL := stripPrefixSym_some _ L L2 hs2 + rw [hL] + simp only [evalSym, evalM, encSymL, encSymR, List.cons_append, List.nil_append, + repBlock_succ_right, List.append_assoc] + exact sweep_CB_B1 k (.run 0 :: .run 1 :: encSymL L2) (encSymR R1) + | none => + cases hs1 : stripPrefixSym [.item (.run 0)] L with + | some L1 => + have hL := stripPrefixSym_some _ L L1 hs1 + rw [hL] + simp only [evalSym, evalM, encSymL, encSymR, List.cons_append, List.nil_append] + exact sweep_CB_B1 k (encSymL L1) (encSymR R1) + | none => exact stepStar_refl + | rep2 p => + simp only [stepPureCB] + cases hs2 : stripPrefixSym [.item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1)] + L with + | some L2 => + have hL := stripPrefixSym_some _ L L2 hs2 + rw [hL] + simp only [evalSym, evalM, encSymL, encSymR, List.cons_append, List.nil_append, + repBlock_succ_right, List.append_assoc] + exact sweep_CB_B2 p (.run 1 :: .run 0 :: .run 1 :: encSymL L2) (encSymR R1) + | none => + cases hs1 : stripPrefixSym [.item (.run 0)] L with + | some L1 => + have hL := stripPrefixSym_some _ L L1 hs1 + rw [hL] + simp only [evalSym, evalM, encSymL, encSymR, List.cons_append, List.nil_append] + exact sweep_CB_B2 p (encSymL L1) (encSymR R1) + | none => exact stepStar_refl + | rep12 m => + simp only [stepPureCB] + cases hs1 : stripPrefixSym [.item (.run 0)] L with + | some L1 => + have hL := stripPrefixSym_some _ L L1 hs1 + rw [hL] + simp only [evalSym, evalM, encSymL, encSymR, List.cons_append, List.nil_append] + exact sweep_CB_B12R m (encSymL L1) (encSymR R1) + | none => exact stepStar_refl + +theorem stepPure_sound (s : SymMode × List SymTok × List SymTok) : + ((evalSym target_tm) s) [target_tm]⊢* ((evalSym target_tm) (stepPure s)) := by + rcases s with ⟨m, L, R⟩ + cases m with + | BB => exact stepPureBB_sound L R + | DL => exact stepPureDL_sound L R + | CB => exact stepPureCB_sound L R + | HALT => exact stepStar_refl + +theorem repBlock12_snoc (m : ℕ) (xs : List MItem) : + repBlock [.run 1, .run 0, .run 1, .run 0, .run 1] m ++ + (.run 1 :: .run 0 :: .run 1 :: .run 0 :: .run 1 :: xs) = + repBlock [.run 1, .run 0, .run 1, .run 0, .run 1] (m + 1) ++ xs := by + rw [repBlock_succ_right, List.append_assoc]; rfl + +theorem popRepB1_some (xs : List SymTok) (k : ℕ) (rest : List SymTok) + (h : popRepB1 xs = some (k, rest)) : + xs = .repB1 k :: rest := by + rcases xs with _ | ⟨t, tl⟩ + · simp [popRepB1] at h + · cases t <;> try contradiction + injection h with h'; injection h' with h1 h2; subst h1; subst h2; rfl + +theorem matchEndB1_some (xs : List SymTok) (k : ℕ) (h : matchEndB1 xs = some k) : + xs = [.repB1 k, .item (.run 0)] := by + unfold matchEndB1 at h + cases hp : popRepB1 xs with + | none => rw [hp] at h; contradiction + | some kr => + rcases kr with ⟨k', rest⟩ + rw [hp] at h; dsimp only at h + cases hs : stripPrefixSym [.item (.run 0)] rest with + | none => rw [hs] at h; contradiction + | some rest2 => + rw [hs] at h; dsimp only at h + cases rest2 with + | nil => + simp only [Option.some.injEq] at h; subst h + have h1 := popRepB1_some xs k' rest hp + have h2 := stripPrefixSym_some _ rest [] hs + rw [h1, h2]; rfl + | cons _ _ => contradiction + +theorem popRep2_some (xs : List SymTok) (p : ℕ) (rest : List SymTok) (h : popRep2 xs = some (p, + rest)) : + xs = .rep2 p :: rest := by + rcases xs with _ | ⟨t, rest0⟩ <;> try contradiction + cases t <;> try contradiction + injection h with h'; injection h' with h1 h2; subst h1; subst h2; rfl + +theorem popRep12_some (xs : List SymTok) (m : ℕ) (rest : List SymTok) (h : popRep12 xs = some (m, + rest)) : + xs = .rep12 m :: rest := by + rcases xs with _ | ⟨t, rest0⟩ <;> try contradiction + cases t <;> try contradiction + injection h with h'; injection h' with h1 h2; subst h1; subst h2; rfl + +theorem popSep3_some (xs sep rest : List SymTok) (h : popSep3 xs = some (sep, rest)) : + xs = sep ++ rest ∧ (sep = sep3A ∨ sep = sep3B) := by + unfold popSep3 at h + cases hsA : stripPrefixSym sep3A xs with + | some rA => + rw [hsA] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + exact ⟨stripPrefixSym_some _ _ _ hsA, Or.inl rfl⟩ + | none => + rw [hsA] at h + cases hsB : stripPrefixSym sep3B xs with + | some rB => + rw [hsB] at h + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + exact ⟨stripPrefixSym_some _ _ _ hsB, Or.inr rfl⟩ + | none => rw [hsB] at h; contradiction + +def stateA0 (k d : ℕ) (R_tail : List SymTok) : SymMode × List SymTok × List SymTok := + (.CB, + [.item (.run 0), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 0), .item .zero, + .item (.run 1), .repB1 k, .item (.run 0)], + .item (.run d) :: R_tail) + +def stateA (m k d : ℕ) (R_tail : List SymTok) : SymMode × List SymTok × List SymTok := + (.CB, + [.item (.run 0), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), + .rep12 m, .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), + .item .zero, .item (.run 1), .repB1 k, .item (.run 0)], + .item (.run d) :: R_tail) + +theorem ruleA0_sound (k d : ℕ) (R_tail : List SymTok) : + ((evalSym target_tm) (stateA0 (k + 1) (d + 6) R_tail)) [target_tm]⊢* + ((evalSym target_tm) (stateA 0 k d R_tail)) := + iterStep_sound stepPure (evalSym target_tm) (stepPure_sound (target_tm := target_tm)) 46 + (stateA0 (k + 1) (d + 6) R_tail) + +omit [HasSymRunRules target_tm] in +theorem ruleA_step_eq (m k d : ℕ) (R_tail : List SymTok) : + (evalSym target_tm) (iterStep stepPure 66 (stateA m (k + 1) (d + 6) R_tail)) = + (evalSym target_tm) (stateA (m + 1) k d R_tail) := by + have h : iterStep stepPure 66 (stateA m (k + 1) (d + 6) R_tail) = + (.CB, + [.item (.run 0), .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 0), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 0), .item (.run 1), + .rep12 m, .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1), + .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), + .item .zero, .item (.run 1), .repB1 k, .item (.run 0)], + .item (.run d) :: R_tail) := rfl + rw [h] + simp only [stateA, evalSym, encSymL, repBlock12_snoc] + +theorem ruleA_step_sound (m k d : ℕ) (R_tail : List SymTok) : + ((evalSym target_tm) (stateA m (k + 1) (d + 6) R_tail)) [target_tm]⊢* + ((evalSym target_tm) (stateA (m + 1) k d R_tail)) := + ruleA_step_eq m k d R_tail ▸ + iterStep_sound stepPure (evalSym target_tm) (stepPure_sound (target_tm := target_tm)) 66 + (stateA m (k + 1) (d + 6) R_tail) + +theorem ruleA_iter (n m k d : ℕ) (R_tail : List SymTok) : + ((evalSym target_tm) (stateA m (k + n) (d + 6 * n) R_tail)) [target_tm]⊢* + ((evalSym target_tm) (stateA (m + n) k d R_tail)) := by + induction n generalizing m k d with + | zero => simp; try exact stepStar_refl + | succ n ih => + have h1 : k + (n + 1) = (k + n) + 1 := by omega + have h2 : d + 6 * (n + 1) = (d + 6 * n) + 6 := by omega + have h3 : m + (n + 1) = (m + 1) + n := by omega + rw [h1, h2, h3] + exact stepStar_trans (ruleA_step_sound m (k + n) (d + 6 * n) R_tail) (ih (m + 1) k d) + +theorem tryRuleA_sound (L : List SymTok) (d : ℕ) (R_tail : List SymTok) : + ((evalSym target_tm) (.CB, L, .item (.run d) :: R_tail)) [target_tm]⊢* ((evalSym target_tm) + (tryRuleA L d R_tail)) := by + unfold tryRuleA + cases hs : stripPrefixSym [.item (.run 0), .item (.run 0), .item (.run 1), .item (.run 1), .item + (.run 0), + .item (.run 1), .item (.run 1), .item (.run 1), .item (.run 0), .item .zero, .item (.run 1)] + L with + | none => dsimp only; exact stepElemThenBB_sound .CB L (.item (.run d) :: R_tail) + | some rest => + dsimp only + cases hm : matchEndB1 rest with + | none => dsimp only; exact stepElemThenBB_sound .CB L (.item (.run d) :: R_tail) + | some k => + simp only [strictNat_eq] + cases hcond : (Nat.ble 2 (d / 6) && Nat.ble (d / 6) k) + · exact stepElemThenBB_sound .CB L (.item (.run d) :: R_tail) + · have hrest := matchEndB1_some rest k hm + have hL := stripPrefixSym_some _ L rest hs + rw [hrest] at hL + have hble : 2 ≤ d / 6 ∧ d / 6 ≤ k := by + simpa [Bool.and_eq_true, Nat.ble_eq] using hcond + set n1 := d / 6 + set m_new := n1 - 1 + set k_new := k - n1 + set d_new := d - 6 * n1 + have hk_eq : k = (k_new + m_new) + 1 := by omega + have hd_eq : d = (d_new + 6 * m_new) + 6 := by omega + have hlhs : (.CB, L, .item (.run d) :: R_tail) = + stateA0 ((k_new + m_new) + 1) ((d_new + 6 * m_new) + 6) R_tail := by + rw [hL, hk_eq, hd_eq]; rfl + rw [hlhs] + exact stepStar_trans (ruleA0_sound (k_new + m_new) (d_new + 6 * m_new) R_tail) + (by simpa [stateA] using ruleA_iter m_new 0 k_new d_new R_tail) + +def stateC (p k d2 : ℕ) (R_tail : List SymTok) : SymMode × List SymTok × List SymTok := + (.CB, + [.item (.run 0), .item (.run 0), .item (.run 1), .rep2 p, + .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 1), + .repB1 k, .item (.run 0)], + .item .zero :: .item (.run d2) :: R_tail) + +omit [HasSymRunRules target_tm] in +theorem ruleC_step_eq (p k d2 : ℕ) (R_tail : List SymTok) : + (evalSym target_tm) (iterStep stepPure 46 (stateC (p + 3) (k + 1) d2 R_tail)) = + (evalSym target_tm) (stateC (p + 2) (k + 3) (d2 + 2) R_tail) := by + have h : iterStep stepPure 46 (stateC (p + 3) (k + 1) d2 R_tail) = + (.CB, + [.item (.run 0), .item (.run 0), .item (.run 1), .rep2 (p + 2), + .item (.run 0), .item (.run 1), .item (.run 1), .item (.run 1), + .item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1), + .repB1 (k + 1), .item (.run 0)], + .item .zero :: .item (.run (d2 + 2)) :: R_tail) := rfl + rw [h] + simp only [stateC, evalSym, encSymL, repBlock, List.cons_append, List.nil_append] + +theorem ruleC_step_sound (p k d2 : ℕ) (R_tail : List SymTok) : + ((evalSym target_tm) (stateC (p + 3) (k + 1) d2 R_tail)) [target_tm]⊢* + ((evalSym target_tm) (stateC (p + 2) (k + 3) (d2 + 2) R_tail)) := + ruleC_step_eq p k d2 R_tail ▸ + iterStep_sound stepPure (evalSym target_tm) (stepPure_sound (target_tm := target_tm)) 46 + (stateC (p + 3) (k + 1) d2 R_tail) + +theorem ruleC_iter (n p k d2 : ℕ) (R_tail : List SymTok) (hk : 1 ≤ k) : + ((evalSym target_tm) (stateC (p + n + 2) k d2 R_tail)) [target_tm]⊢* + ((evalSym target_tm) (stateC (p + 2) (k + 2 * n) (d2 + 2 * n) R_tail)) := by + induction n generalizing p k d2 with + | zero => simp; try exact stepStar_refl + | succ n ih => + obtain ⟨k0, rfl⟩ : ∃ k0, k = k0 + 1 := ⟨k - 1, by omega⟩ + have h1 : p + (n + 1) + 2 = (p + n) + 3 := by omega + have h2 : k0 + 1 + 2 * (n + 1) = (k0 + 3) + 2 * n := by omega + have h3 : d2 + 2 * (n + 1) = (d2 + 2) + 2 * n := by omega + rw [h1, h2, h3] + exact stepStar_trans (ruleC_step_sound (p + n) k0 d2 R_tail) + (ih p (k0 + 3) (d2 + 2) (by omega)) + +def stateB (s_sep m_sep : List SymTok) (p m k d2 : ℕ) (R_tail : List SymTok) : + SymMode × List SymTok × List SymTok := + (.CB, + [.item (.run 0), .item (.run 0), .item (.run 1), .rep2 p, .item (.run 1)] ++ + s_sep ++ [.rep12 m, .item (.run 1), .item (.run 0), .item (.run 1)] ++ + m_sep ++ [.repB1 k, .item (.run 0)], + .item .zero :: .item (.run d2) :: R_tail) + +set_option maxRecDepth 2000000 in +theorem ruleB_step_AA (p m k d2 : ℕ) (R_tail : List SymTok) : + ((evalSym target_tm) (stateB sep3A sep3A (p + 1) (m + 2) (k + 1) d2 R_tail)) [target_tm]⊢* + ((evalSym target_tm) (stateB sep3A sep3A (p + 3) (m + 1) k (d2 + 4) R_tail)) := by + have h := iterStep_sound stepPure (evalSym target_tm) + (stepPure_sound (target_tm := target_tm)) 126 + (stateB sep3A sep3A (p + 1) (m + 2) (k + 1) d2 R_tail) + have hrfl : iterStep stepPure 126 (stateB sep3A sep3A (p + 1) (m + 2) (k + 1) d2 R_tail) = + (.CB, + [.item (.run 0), .item (.run 0), .item (.run 1), .rep2 (p + 3), .item (.run 1), + .item (.run 0), .item (.run 1), .item (.run 2), .rep12 m, + .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1), + .item (.run 1), .item (.run 0), .item (.run 1), + .item (.run 0), .item (.run 1), .item (.run 2), .repB1 k, .item (.run 0)], + .item .zero :: .item (.run (d2 + 4)) :: R_tail) := rfl + have heq : (evalSym target_tm) (iterStep stepPure 126 (stateB sep3A sep3A (p + 1) (m + 2) (k + + 1) d2 R_tail)) = + (evalSym target_tm) (stateB sep3A sep3A (p + 3) (m + 1) k (d2 + 4) R_tail) := by + rw [hrfl] + simp only [stateB, sep3A, evalSym, encSymL, List.cons_append, List.nil_append, + repBlock12_snoc] + exact heq ▸ h + +set_option maxRecDepth 2000000 in +theorem ruleB_step_AB (p m k d2 : ℕ) (R_tail : List SymTok) : + ((evalSym target_tm) (stateB sep3A sep3B (p + 1) (m + 2) (k + 1) d2 R_tail)) [target_tm]⊢* + ((evalSym target_tm) (stateB sep3A sep3B (p + 3) (m + 1) k (d2 + 4) R_tail)) := by + have h := iterStep_sound stepPure (evalSym target_tm) + (stepPure_sound (target_tm := target_tm)) 118 + (stateB sep3A sep3B (p + 1) (m + 2) (k + 1) d2 R_tail) + have hrfl : iterStep stepPure 118 (stateB sep3A sep3B (p + 1) (m + 2) (k + 1) d2 R_tail) = + (.CB, + [.item (.run 0), .item (.run 0), .item (.run 1), .rep2 (p + 3), .item (.run 1), + .item (.run 0), .item (.run 1), .item (.run 2), .rep12 m, + .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1), + .item (.run 1), .item (.run 0), .item (.run 1), + .item (.run 0), .item .zero, .item (.run 1), .repB1 k, .item (.run 0)], + .item .zero :: .item (.run (d2 + 4)) :: R_tail) := rfl + have heq : (evalSym target_tm) (iterStep stepPure 118 (stateB sep3A sep3B (p + 1) (m + 2) (k + + 1) d2 R_tail)) = + (evalSym target_tm) (stateB sep3A sep3B (p + 3) (m + 1) k (d2 + 4) R_tail) := by + rw [hrfl] + simp only [stateB, sep3A, sep3B, evalSym, encSymL, List.cons_append, List.nil_append, + repBlock12_snoc] + exact heq ▸ h + +set_option maxRecDepth 2000000 in +theorem ruleB_step_BA (p m k d2 : ℕ) (R_tail : List SymTok) : + ((evalSym target_tm) (stateB sep3B sep3A (p + 1) (m + 2) (k + 1) d2 R_tail)) [target_tm]⊢* + ((evalSym target_tm) (stateB sep3B sep3A (p + 3) (m + 1) k (d2 + 4) R_tail)) := by + have h := iterStep_sound stepPure (evalSym target_tm) + (stepPure_sound (target_tm := target_tm)) 106 + (stateB sep3B sep3A (p + 1) (m + 2) (k + 1) d2 R_tail) + have hrfl : iterStep stepPure 106 (stateB sep3B sep3A (p + 1) (m + 2) (k + 1) d2 R_tail) = + (.CB, + [.item (.run 0), .item (.run 0), .item (.run 1), .rep2 (p + 3), .item (.run 1), + .item (.run 0), .item .zero, .item (.run 1), .rep12 m, + .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1), + .item (.run 1), .item (.run 0), .item (.run 1), + .item (.run 0), .item (.run 1), .item (.run 2), .repB1 k, .item (.run 0)], + .item .zero :: .item (.run (d2 + 4)) :: R_tail) := rfl + have heq : (evalSym target_tm) (iterStep stepPure 106 (stateB sep3B sep3A (p + 1) (m + 2) (k + + 1) d2 R_tail)) = + (evalSym target_tm) (stateB sep3B sep3A (p + 3) (m + 1) k (d2 + 4) R_tail) := by + rw [hrfl] + simp only [stateB, sep3A, sep3B, evalSym, encSymL, List.cons_append, List.nil_append, + repBlock12_snoc] + exact heq ▸ h + +set_option maxRecDepth 2000000 in +theorem ruleB_step_BB (p m k d2 : ℕ) (R_tail : List SymTok) : + ((evalSym target_tm) (stateB sep3B sep3B (p + 1) (m + 2) (k + 1) d2 R_tail)) [target_tm]⊢* + ((evalSym target_tm) (stateB sep3B sep3B (p + 3) (m + 1) k (d2 + 4) R_tail)) := by + have h := iterStep_sound stepPure (evalSym target_tm) + (stepPure_sound (target_tm := target_tm)) 98 + (stateB sep3B sep3B (p + 1) (m + 2) (k + 1) d2 R_tail) + have hrfl : iterStep stepPure 98 (stateB sep3B sep3B (p + 1) (m + 2) (k + 1) d2 R_tail) = + (.CB, + [.item (.run 0), .item (.run 0), .item (.run 1), .rep2 (p + 3), .item (.run 1), + .item (.run 0), .item .zero, .item (.run 1), .rep12 m, + .item (.run 1), .item (.run 0), .item (.run 1), .item (.run 0), .item (.run 1), + .item (.run 1), .item (.run 0), .item (.run 1), + .item (.run 0), .item .zero, .item (.run 1), .repB1 k, .item (.run 0)], + .item .zero :: .item (.run (d2 + 4)) :: R_tail) := rfl + have heq : (evalSym target_tm) (iterStep stepPure 98 (stateB sep3B sep3B (p + 1) (m + 2) (k + 1) + d2 R_tail)) = + (evalSym target_tm) (stateB sep3B sep3B (p + 3) (m + 1) k (d2 + 4) R_tail) := by + rw [hrfl] + simp only [stateB, sep3B, evalSym, encSymL, List.cons_append, List.nil_append, + repBlock12_snoc] + exact heq ▸ h + +theorem ruleB_step_sound (s_sep m_sep : List SymTok) (hs : s_sep = sep3A ∨ s_sep = sep3B) + (hm : m_sep = sep3A ∨ m_sep = sep3B) (p m k d2 : ℕ) (R_tail : List SymTok) : + ((evalSym target_tm) (stateB s_sep m_sep (p + 1) (m + 2) (k + 1) d2 R_tail)) [target_tm]⊢* + ((evalSym target_tm) (stateB s_sep m_sep (p + 3) (m + 1) k (d2 + 4) R_tail)) := by + rcases hs with rfl | rfl <;> rcases hm with rfl | rfl + · exact ruleB_step_AA p m k d2 R_tail + · exact ruleB_step_AB p m k d2 R_tail + · exact ruleB_step_BA p m k d2 R_tail + · exact ruleB_step_BB p m k d2 R_tail + +theorem ruleB_iter (s_sep m_sep : List SymTok) (hs : s_sep = sep3A ∨ s_sep = sep3B) + (hm : m_sep = sep3A ∨ m_sep = sep3B) (n p m k d2 : ℕ) (R_tail : List SymTok) : + ((evalSym target_tm) (stateB s_sep m_sep (p + 1) (m + n + 1) (k + n) d2 R_tail)) [target_tm]⊢* + ((evalSym target_tm) (stateB s_sep m_sep (p + 1 + 2 * n) (m + 1) k (d2 + 4 * n) R_tail)) := by + induction n generalizing p m k d2 with + | zero => simp; try exact stepStar_refl + | succ n ih => + have h1 : m + (n + 1) + 1 = (m + n) + 2 := by omega + have h2 : k + (n + 1) = (k + n) + 1 := by omega + have h3 : p + 1 + 2 * (n + 1) = (p + 2) + 1 + 2 * n := by omega + have h4 : d2 + 4 * (n + 1) = (d2 + 4) + 4 * n := by omega + rw [h1, h2, h3, h4] + exact stepStar_trans (ruleB_step_sound s_sep m_sep hs hm p (m + n) (k + n) d2 R_tail) + (ih (p + 2) m k (d2 + 4)) + +theorem splitB2Aux_spec (fuel p : ℕ) (xs : List SymTok) : + repBlock [.run 0, .run 1, .run 1] p ++ encSymL xs = + repBlock [.run 0, .run 1, .run 1] (splitB2Aux fuel p xs).1 ++ encSymL (splitB2Aux fuel p xs).2 + := by + induction fuel generalizing p xs with + | zero => rfl + | succ fuel ih => + simp only [splitB2Aux] + cases hs : stripPrefixSym [.item (.run 0), .item (.run 1), .item (.run 1)] xs with + | none => rfl + | some rest => + have hxs := stripPrefixSym_some _ xs rest hs + simp only [strictNat_eq, ← ih (p + 1) rest, repBlock_succ_right, List.append_assoc, hxs] + rfl + +theorem repBlock_B2_shift (q : ℕ) (tail : List MItem) : + .run 0 :: (repBlock [.run 0, .run 1, .run 1] (q + 1) ++ tail) = + [.run 0, .run 0, .run 1] ++ (repBlock [.run 1, .run 0, .run 1] q ++ (.run 1 :: tail)) := by + induction q generalizing tail with + | zero => rfl + | succ q ih => + have h1 : repBlock [.run 0, .run 1, .run 1] (q + 1 + 1) ++ tail = + repBlock [.run 0, .run 1, .run 1] (q + 1) ++ (.run 0 :: .run 1 :: .run 1 :: tail) := by + rw [repBlock_succ_right, List.append_assoc]; rfl + rw [h1, ih (.run 0 :: .run 1 :: .run 1 :: tail)] + simp [repBlock_succ_right [.run 1, .run 0, .run 1] q, List.append_assoc] + +theorem tryRuleB_sound (L : List SymTok) (d2 : ℕ) (R_tail : List SymTok) : + ((evalSym target_tm) (.CB, L, .item .zero :: .item (.run d2) :: R_tail)) [target_tm]⊢* + ((evalSym target_tm) (tryRuleB L d2 R_tail)) := by + unfold tryRuleB + cases hsL : stripPrefixSym [.item (.run 0)] L with + | none => dsimp only; exact stepElemThenBB_sound .CB L (.item .zero :: .item (.run d2) :: + R_tail) + | some restL => + dsimp only [afterSplitB2] + cases hsep1 : popSep3 (splitB2 0 restL).2 with + | none => dsimp only; exact stepElemThenBB_sound .CB L (.item .zero :: .item (.run d2) :: + R_tail) + | some sr1 => + rcases sr1 with ⟨s_sep, rest0⟩ + dsimp only + cases h12 : popRep12 rest0 with + | none => dsimp only; exact stepElemThenBB_sound .CB L (.item .zero :: .item (.run d2) :: + R_tail) + | some mr1 => + rcases mr1 with ⟨m12, rest1⟩ + dsimp only + cases hs1 : stripPrefixSym [.item (.run 1), .item (.run 0), .item (.run 1)] rest1 with + | none => dsimp only; exact stepElemThenBB_sound .CB L (.item .zero :: .item (.run d2) :: + R_tail) + | some rest2 => + dsimp only + cases hsep2 : popSep3 rest2 with + | none => dsimp only; exact stepElemThenBB_sound .CB L (.item .zero :: .item (.run d2) + :: R_tail) + | some mr2 => + rcases mr2 with ⟨m_sep, rest3⟩ + dsimp only + cases hend : matchEndB1 rest3 with + | none => dsimp only; exact stepElemThenBB_sound .CB L (.item .zero :: .item (.run d2) + :: R_tail) + | some k1 => + dsimp only + cases hcond : (Nat.ble 2 (splitB2 0 restL).1 && Nat.ble 2 m12 && Nat.ble m12 k1) + · exact stepElemThenBB_sound .CB L (.item .zero :: .item (.run d2) :: R_tail) + · simp only [strictNat_eq] + have hL := stripPrefixSym_some _ L restL hsL + have hspec := splitB2Aux_spec 32 0 restL + simp only [repBlock, List.nil_append] at hspec + change encSymL restL = repBlock [.run 0, .run 1, .run 1] (splitB2 0 restL).1 ++ + encSymL (splitB2 0 restL).2 at hspec + obtain ⟨h_s, hs_or⟩ := popSep3_some (splitB2 0 restL).2 s_sep rest0 hsep1 + have h_m12 := popRep12_some rest0 m12 rest1 h12 + have h_r1 := stripPrefixSym_some _ rest1 rest2 hs1 + obtain ⟨h_m, hm_or⟩ := popSep3_some rest2 m_sep rest3 hsep2 + have h_k1 := matchEndB1_some rest3 k1 hend + simp only [Bool.and_eq_true, Nat.ble_eq] at hcond + rcases hcond with ⟨⟨hp, hm12⟩, hk1⟩ + set p := (splitB2 0 restL).1 + set n3 := m12 - 1 + set p0 := p - 2 + set k_new := k1 - n3 + have hp_eq : p = (p0 + 1) + 1 := by omega + have hm_eq : m12 = 0 + n3 + 1 := by omega + have hk_eq : k1 = k_new + n3 := by omega + have hp_new : (splitB2 0 restL).1 + 2 * (m12 - 1) - 1 = p0 + 1 + 2 * n3 := by + omega + have hk_new : k1 - (m12 - 1) = k_new := rfl + have hd_new : d2 + 4 * (m12 - 1) = d2 + 4 * n3 := rfl + have hlhs : (evalSym target_tm) (.CB, L, .item .zero :: .item (.run d2) :: R_tail) + = + (evalSym target_tm) (stateB s_sep m_sep (p0 + 1) (0 + n3 + 1) (k_new + n3) d2 + R_tail) := by + simp only [evalSym, stateB, hL, encSymL, hspec, h_s, h_m12, h_r1, h_m, h_k1, + hp_eq, hm_eq, hk_eq, repBlock_B2_shift (p0 + 1), List.cons_append, + List.nil_append, List.append_assoc] + rw [hlhs, hp_new] + exact ruleB_iter s_sep m_sep hs_or hm_or n3 p0 0 k_new d2 R_tail + +theorem tryRuleBC_sound (L : List SymTok) (d2 : ℕ) (R_tail : List SymTok) : + ((evalSym target_tm) (.CB, L, .item .zero :: .item (.run d2) :: R_tail)) [target_tm]⊢* + ((evalSym target_tm) (tryRuleBC L d2 R_tail)) := by + unfold tryRuleBC + cases hs1 : stripPrefixSym [.item (.run 0), .item (.run 0), .item (.run 1)] L with + | none => dsimp only; exact tryRuleB_sound L d2 R_tail + | some rest1 => + dsimp only + cases hp2 : popRep2 rest1 with + | none => dsimp only; exact tryRuleB_sound L d2 R_tail + | some pr => + rcases pr with ⟨p, restC⟩ + dsimp only + cases hs2 : stripPrefixSym [.item (.run 0), .item (.run 1), .item (.run 1), .item (.run 1)] + restC with + | none => dsimp only; exact tryRuleB_sound L d2 R_tail + | some rest2 => + dsimp only + cases hend : matchEndB1 rest2 with + | none => dsimp only; exact tryRuleB_sound L d2 R_tail + | some k1 => + dsimp only + cases hcond : (Nat.ble 3 p && Nat.ble 1 k1) + · exact tryRuleB_sound L d2 R_tail + · simp only [strictNat_eq] + have hL1 := stripPrefixSym_some _ L rest1 hs1 + have hL2 := popRep2_some rest1 p restC hp2 + have hL3 := stripPrefixSym_some _ restC rest2 hs2 + have hL4 := matchEndB1_some rest2 k1 hend + simp only [Bool.and_eq_true, Nat.ble_eq] at hcond + rcases hcond with ⟨hp, hk1⟩ + set n4 := p - 2 + have hp_eq : p = 0 + n4 + 2 := by omega + have hlhs : (.CB, L, .item .zero :: .item (.run d2) :: R_tail) = + stateC (0 + n4 + 2) k1 d2 R_tail := by + rw [hL1, hL2, hL3, hL4, hp_eq]; rfl + rw [hlhs] + exact ruleC_iter n4 0 k1 d2 R_tail hk1 + +theorem afterSweepCB_sound (p : List SymTok × List SymTok) : + ((evalSym target_tm) (.CB, p.1, p.2)) [target_tm]⊢* ((evalSym target_tm) (afterSweepCB p)) := + by + rcases p with ⟨L, R⟩ + rcases R with _ | ⟨t1, R1⟩ + · exact stepElemThenBB_sound .CB L [] + · cases t1 with + | item it1 => + cases it1 with + | zero => + rcases R1 with _ | ⟨t2, R_tail⟩ + · exact stepElemThenBB_sound .CB L [.item .zero] + · cases t2 with + | item it2 => + cases it2 with + | zero => exact stepElemThenBB_sound .CB L (.item .zero :: .item .zero :: R_tail) + | run d2 => exact tryRuleBC_sound L d2 R_tail + | repB1 k => exact stepElemThenBB_sound .CB L (.item .zero :: .repB1 k :: R_tail) + | rep2 p => exact stepElemThenBB_sound .CB L (.item .zero :: .rep2 p :: R_tail) + | rep12 m => exact stepElemThenBB_sound .CB L (.item .zero :: .rep12 m :: R_tail) + | run d => + rcases d with _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | d + · exact stepElemThenBB_sound .CB L (.item (.run 0) :: R1) + · exact stepElemThenBB_sound .CB L (.item (.run 1) :: R1) + · exact stepElemThenBB_sound .CB L (.item (.run 2) :: R1) + · exact stepElemThenBB_sound .CB L (.item (.run 3) :: R1) + · exact stepElemThenBB_sound .CB L (.item (.run 4) :: R1) + · exact stepElemThenBB_sound .CB L (.item (.run 5) :: R1) + · exact stepElemThenBB_sound .CB L (.item (.run 6) :: R1) + · exact stepElemThenBB_sound .CB L (.item (.run 7) :: R1) + · exact stepElemThenBB_sound .CB L (.item (.run 8) :: R1) + · exact stepElemThenBB_sound .CB L (.item (.run 9) :: R1) + · exact stepElemThenBB_sound .CB L (.item (.run 10) :: R1) + · exact stepElemThenBB_sound .CB L (.item (.run 11) :: R1) + · exact tryRuleA_sound L (d + 12) R1 + | repB1 k => exact stepElemThenBB_sound .CB L (.repB1 k :: R1) + | rep2 p => exact stepElemThenBB_sound .CB L (.rep2 p :: R1) + | rep12 m => exact stepElemThenBB_sound .CB L (.rep12 m :: R1) + +theorem stepSym_sound (s : SymMode × List SymTok × List SymTok) : + ((evalSym target_tm) s) [target_tm]⊢* ((evalSym target_tm) (stepSym s)) := by + rcases s with ⟨m, L, R⟩ + cases m with + | BB => exact sweepBB_sound L R + | DL => + simp only [stepSym, strictList_eq] + have heq : (evalSym target_tm) (.DL, L, R) = (evalSym target_tm) (.DL, peelL L, R) := by + simp only [evalSym, encSymL_peelL] + rw [heq] + exact stepElemThenBB_sound .DL (peelL L) R + | HALT => exact stepStar_refl + | CB => + exact stepStar_trans (sweepCB_sound L R) (afterSweepCB_sound (sweepCB L R)) + +theorem stepSym16_sound (s : SymMode × List SymTok × List SymTok) : + ((evalSym target_tm) s) [target_tm]⊢* ((evalSym target_tm) (stepSym16 s)) := + iterStep_sound stepSym (evalSym target_tm) (stepSym_sound (target_tm := target_tm)) 16 s + +theorem stepSym256_sound (s : SymMode × List SymTok × List SymTok) : + ((evalSym target_tm) s) [target_tm]⊢* ((evalSym target_tm) (stepSym256 s)) := + iterStep_sound stepSym16 (evalSym target_tm) (stepSym16_sound (target_tm := target_tm)) 16 s + +theorem stepSym4096_sound (s : SymMode × List SymTok × List SymTok) : + ((evalSym target_tm) s) [target_tm]⊢* ((evalSym target_tm) (stepSym4096 s)) := + iterStep_sound stepSym256 (evalSym target_tm) (stepSym256_sound (target_tm := target_tm)) 16 s + +theorem stepElem16_sound (s : SymMode × List MItem × List MItem) : + ((evalM target_tm) s) [target_tm]⊢* ((evalM target_tm) (stepElem16 s)) := + iterStep_sound stepElemM (evalM target_tm) (stepElemM_sound (target_tm := target_tm)) 16 s + +theorem stepElem256_sound (s : SymMode × List MItem × List MItem) : + ((evalM target_tm) s) [target_tm]⊢* ((evalM target_tm) (stepElem256 s)) := + iterStep_sound stepElem16 (evalM target_tm) (stepElem16_sound (target_tm := target_tm)) 16 s + +theorem stepElem4096_sound (s : SymMode × List MItem × List MItem) : + ((evalM target_tm) s) [target_tm]⊢* ((evalM target_tm) (stepElem4096 s)) := + iterStep_sound stepElem256 (evalM target_tm) (stepElem256_sound (target_tm := target_tm)) 16 s + +theorem runElemFast_sound (a b c d : ℕ) (s : SymMode × List MItem × List MItem) : + (evalM target_tm s) [target_tm]⊢* (evalM target_tm (runElemFast a b c d s)) := by + unfold runElemFast + exact stepStar_trans + (iterStep_sound stepElem4096 (evalM target_tm) + (stepElem4096_sound (target_tm := target_tm)) d s) + (stepStar_trans + (iterStep_sound stepElem256 (evalM target_tm) + (stepElem256_sound (target_tm := target_tm)) c _) + (stepStar_trans + (iterStep_sound stepElem16 (evalM target_tm) + (stepElem16_sound (target_tm := target_tm)) b _) + (iterStep_sound stepElemM (evalM target_tm) + (stepElemM_sound (target_tm := target_tm)) a _))) + +end BusyBeaver.SymRunEngine + +namespace BusyBeaver.BufferChainEngine + +open Counter SixState + +@[simp] theorem init_nil : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = + ⟨some A, ⟨0, default, default⟩⟩ := rfl + +def encWord : LD → List (Fin 2) + | .W0 => [1, 0, 0] + | .W1 => [1, 1, 1] + +/-- Left tape encoding with the invariant MSB sentinel `[.W1, .W1]` (`[1, 1, 1, 1, 1, 1]`) built +in. -/ +def Lmp (x : List LD) : ListBlank (Fin 2) := + encTape encWord ([1, 1, 1, 1, 1, 1] +> default) x + +@[simp] theorem Lmp_nil : Lmp [] = [1, 1, 1, 1, 1, 1] +> default := rfl + +theorem Lmp_cons (d : LD) (xs : List LD) : Lmp (d :: xs) = encWord d +> Lmp xs := + encTape_cons encWord ([1, 1, 1, 1, 1, 1] +> default) d xs + +@[simp] theorem Lmp_W0 (xs : List LD) : + Lmp (.W0 :: xs) = (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> Lmp xs := by + rw [Lmp_cons]; rfl + +@[simp] theorem Lmp_W1 (xs : List LD) : + Lmp (.W1 :: xs) = (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> Lmp xs := by + rw [Lmp_cons]; rfl + +@[simp] theorem Lmp_head (x : List LD) : (Lmp x).head = 1 := by + cases x with + | nil => rfl + | cons d xs => cases d <;> simp [Lmp_W0, Lmp_W1] + +@[simp] theorem Lmp_cons_tail (x : List LD) : + (1 : Fin 2) >> (Lmp x).tail = Lmp x := by + rw [← Lmp_head x, Turing.ListBlank.cons_head_tail] + +def RC (m : ℕ) : ListBlank (Fin 2) := + [1] +> ((([0, 1, 1] : List (Fin 2)) ^ m) +> ([0, 1] +> default)) + +def cfgL (qL : Fin 6) (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + l <{{qL}} ([0, 1, 0] +> r) + +def cfgR (qR : Fin 6) (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + l {{qR}}> ([1] +> r) + +def x0 : List LD := [.W1, .W0, .W0, .W0, .W1, .W1, .W1, .W0] + +def x1 : List LD := + [.W1, .W0, .W1, .W0, .W1, .W1, .W0, .W0, .W1, .W1, .W0, .W1, .W0, .W1, .W0] + +def ux2 : List LD := + [.W1, .W1, .W0, .W1, .W0, .W1, .W0, .W0, .W1, .W1, .W0, .W0, .W0, .W0, .W1, .W1, .W1, .W0] + +def x2 : List LD := (([.W1, .W0] : List LD) ^ 25) ++ ux2 + +def u0_tail : List LD := + [.W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, + .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, + .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W1, .W0, .W0, .W0, .W0, + .W1, .W1, .W0, .W0, .W0, .W0, .W1, .W1, .W1, .W1, .W0, .W1, .W0, .W1, .W0] + +def u0 : List LD := .W1 :: .W1 :: u0_tail + +def c_init_30 : CCfg (Fin 2) (Fin 6) := ⟨A, 0, [], ([0] : List (Fin 2)) ^ 30⟩ + +def c_x0 (qL : Fin 6) : CCfg (Fin 2) (Fin 6) := + ⟨qL, 1, + [1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1], + [0, 1, 0, 1, 0, 1, 1, 0, 1]⟩ + +set_option maxRecDepth 200000 in +theorem isBuffer_191_B1 : IsBuffer 191 [.W1, .W1, .W0] := by decide + +def msb_17 : List LD := + [.W0, .W1, .W1, .W0, .W1, .W1, .W0, .W1, .W1, .W0, .W1, .W1, .W0, .W1, .W1, .W1, .W1] + +set_option maxRecDepth 200000 in +set_option maxHeartbeats 2000000 in +-- `runU 191 u0` unfolds 191 rounds of finite macro-stepping. +def u191 : List LD := (runU 191 u0).getD [] + +set_option maxRecDepth 200000 in +def u191_pre' : List LD := ((lincspFinite u191).getD []).take 436 + +set_option maxRecDepth 200000 in +set_option maxHeartbeats 2000000 in +-- Kernel verification of the 191-round `runU` trajectory. +theorem runU_191_eq : runU 191 u0 = some u191 := by decide + +set_option maxRecDepth 200000 in +set_option maxHeartbeats 2000000 in +-- Kernel verification of `lincspFinite u191`. +theorem u191_lincsp_eq : lincspFinite u191 = some (u191_pre' ++ msb_17) := by decide + +set_option maxRecDepth 200000 in +theorem u191_pre'_only011 : checkOnly011 u191_pre' = true := by decide + +structure Spec (tm : Machine (Fin 2) (Fin 6)) (qL qR : Fin 6) : Prop where + w0_1 : ∀ xs r, (cfgL qL (Lmp (.W0 :: xs)) ([1] +> r)) [tm]⊢* + (cfgL qL (Lmp xs) ([1, 0, 1, 1] +> r)) + w10 : ∀ xs r, (cfgL qL (Lmp (.W1 :: .W0 :: xs)) ([1] +> r)) [tm]⊢* + (cfgR qR (Lmp (.W1 :: .W1 :: xs)) ([0, 1, 1] +> r)) + w11_1 : ∀ xs r, (cfgL qL (Lmp (.W1 :: .W1 :: xs)) ([1] +> r)) [tm]⊢* + (cfgL qL (Lmp xs) ([1, 0, 1, 0, 1, 0, 1] +> r)) + rw0 : ∀ xs r, (cfgR qR (Lmp xs) ([0, 1, 1] +> r)) [tm]⊢* + (cfgR qR (Lmp (.W0 :: xs)) r) + rw11 : ∀ xs' r, (cfgR qR (Lmp xs') ([0, 1, 1, 0, 1, 0, 1, 0, 1] +> r)) [tm]⊢* + (cfgR qR (Lmp (.W1 :: .W0 :: xs')) ([0, 1, 1] +> r)) + turn : ∀ x, (cfgR qR (Lmp x) ([0, 1] +> default)) [tm]⊢* + (cfgL qL (Lmp x) (RC 0)) + lov_nil : ∀ r, (cfgL qL (Lmp []) ([1] +> r)) [tm]⊢* + ((Lmp [.W0, .W0]) {{qR}}> r) + lov_w0 : ∀ u r, ((Lmp u) {{qR}}> ([0, 1, 1] +> r)) [tm]⊢* + ((Lmp (.W1 :: u)) {{qR}}> r) + lov_w11_0 : ∀ x r, ((Lmp (.W0 :: x)) {{qR}}> ([0, 1, 0, 1, 0, 1] +> r)) [tm]⊢* + ((Lmp (.W0 :: .W0 :: .W1 :: x)) {{qR}}> r) + lov_w11_1_start : ∀ z r, ((Lmp (.W1 :: z)) {{qR}}> ([0, 1, 0, 1, 0, 1] +> r)) [tm]⊢* + (cfgL qL (Lmp z) ([1, 0, 1, 1, 0, 1] +> r)) + lov_w11_1_end : ∀ z' r, (cfgR qR (Lmp z') ([0, 1, 1, 0, 1, 1, 0, 1] +> r)) [tm]⊢* + ((Lmp (.W0 :: .W0 :: .W0 :: z')) {{qR}}> r) + lov_finish : ∀ y, ((Lmp (.W1 :: y)) {{qR}}> ([0, 1] +> default)) [tm]⊢* + (cfgL qL (Lmp y) (RC 0)) + +section WithSpec + +variable {tm : Machine (Fin 2) (Fin 6)} {qL qR : Fin 6} (S : Spec tm qL qR) +include S + +theorem LInc_step {x x' : List LD} (h : LInc x x') : + ∀ (r : ListBlank (Fin 2)), + (cfgL qL (Lmp x) ([1] +> r)) [tm]⊢* (cfgR qR (Lmp x') ([0, 1, 1] +> r)) := by + induction h with + | @w0 xs xs' _ ih => + intro r + exact stepStar_trans (S.w0_1 xs r) + (stepStar_trans (ih ([0, 1, 1] +> r)) (S.rw0 xs' ([0, 1, 1] +> r))) + | w10 xs => + intro r; exact S.w10 xs r + | @w11 xs xs' _ ih => + intro r + exact stepStar_trans (S.w11_1 xs r) + (stepStar_trans (ih ([0, 1, 0, 1, 0, 1] +> r)) (S.rw11 xs' r)) + +theorem RC_return : ∀ (m : ℕ) (x : List LD), + (cfgR qR (Lmp x) ((([0, 1, 1] : List (Fin 2)) ^ m) +> ([0, 1] +> default))) + [tm]⊢* (cfgL qL (Lmp x) (RC m)) + | 0, x => S.turn x + | m + 1, x => by + rw [pow_succ_list, listblank_append_assoc] + exact stepStar_trans (S.rw0 x ((([0, 1, 1] : List (Fin 2)) ^ m) +> ([0, 1] +> default))) + (stepStar_trans (RC_return m (.W0 :: x)) + (S.w0_1 x ((([0, 1, 1] : List (Fin 2)) ^ m) +> ([0, 1] +> default)))) + +theorem LInc_RC {x x' : List LD} (h : LInc x x') (m : ℕ) : + (cfgL qL (Lmp x) (RC m)) [tm]⊢* (cfgL qL (Lmp x') (RC (m + 1))) := by + refine stepStar_trans + (LInc_step S h ((([0, 1, 1] : List (Fin 2)) ^ m) +> ([0, 1] +> default))) ?_ + exact RC_return S (m + 1) x' + +theorem LIncs_RC {n : ℕ} {x x' : List LD} (h : LIncs n x x') : + ∀ (m : ℕ), (cfgL qL (Lmp x) (RC m)) [tm]⊢* (cfgL qL (Lmp x') (RC (m + n))) := + IterRel_lift_rc (fun x m => cfgL qL (Lmp x) (RC m)) (LInc_RC S) h + +theorem LOv2_correct_aux {w u y : List LD} (h : LOv2 w u y) (hu : u = [.W0, .W0]) : + ∀ (r : ListBlank (Fin 2)), + (cfgL qL (Lmp w) ([1] +> r)) [tm]⊢* ((Lmp y) {{qR}}> r) := by + induction h with + | nil => + subst hu; intro r; exact S.lov_nil r + | @w0 xs _ u' _ ih => + intro r + exact stepStar_trans (S.w0_1 xs r) + (stepStar_trans (ih hu ([0, 1, 1] +> r)) (S.lov_w0 u' r)) + | @w11_0 xs _ x _ ih => + intro r + exact stepStar_trans (S.w11_1 xs r) + (stepStar_trans (ih hu ([0, 1, 0, 1, 0, 1] +> r)) (S.lov_w11_0 x r)) + | @w11_1 xs _ z z' _ hz ih => + intro r + exact stepStar_trans (S.w11_1 xs r) + (stepStar_trans (ih hu ([0, 1, 0, 1, 0, 1] +> r)) + (stepStar_trans (S.lov_w11_1_start z r) + (stepStar_trans (LInc_step S hz ([0, 1, 1, 0, 1] +> r)) + (S.lov_w11_1_end z' r)))) + +theorem LOv2_correct {w y : List LD} (h : LOv2 w [.W0, .W0] y) : + ∀ (r : ListBlank (Fin 2)), + (cfgL qL (Lmp w) ([1] +> r)) [tm]⊢* ((Lmp y) {{qR}}> r) := + LOv2_correct_aux S h rfl + +theorem lov_w0_iter : ∀ (m : ℕ) (y : List LD) (r : ListBlank (Fin 2)), + ((Lmp y) {{qR}}> ((([0, 1, 1] : List (Fin 2)) ^ m) +> r)) + [tm]⊢* + ((Lmp ((([.W1] : List LD) ^ m) ++ y)) {{qR}}> r) + | 0, _, _ => stepStar_refl _ _ + | m + 1, y, r => by + rw [pow_succ_right, listblank_append_assoc] + refine stepStar_trans (lov_w0_iter m y ([0, 1, 1] +> r)) ?_ + have h3 := S.lov_w0 ((([.W1] : List LD) ^ m) ++ y) r + rw [pow_succ_list, List.singleton_append, List.cons_append] + exact h3 + +theorem full_overflow_step {w y : List LD} (m : ℕ) (h : LOv2 w [.W0, .W0] y) : + (cfgL qL (Lmp w) (RC (m + 1))) [tm]⊢* + (cfgL qL (Lmp ((([.W1] : List LD) ^ m) ++ y)) (RC 0)) := by + refine stepStar_trans + (LOv2_correct S h ((([0, 1, 1] : List (Fin 2)) ^ (m + 1)) +> ([0, 1] +> default))) ?_ + refine stepStar_trans (lov_w0_iter S (m + 1) y ([0, 1] +> default)) ?_ + rw [pow_succ_list, List.singleton_append, List.cons_append] + exact S.lov_finish ((([.W1] : List LD) ^ m) ++ y) + +theorem round_step {X X' Y Z : List LD} (m : ℕ) + (h1 : LIncsP (2 * m + 1) X X') + (h2 : LOv2 X' [.W0, .W0] Y) + (h3 : LInc ((([.W1] : List LD) ^ (2 * m + 1)) ++ Y) Z) : + (cfgL qL (Lmp X) (RC 1)) [tm]⊢* (cfgL qL (Lmp Z) (RC 1)) := by + have h_incs := LIncs_RC S (LIncsP_to_LIncs h1) 1 + rw [Nat.add_comm 1 (2 * m + 1)] at h_incs + exact stepStar_trans h_incs + (stepStar_trans (full_overflow_step S (2 * m + 1) h2) (LInc_RC S h3 0)) + +set_option maxRecDepth 200000 in +theorem x0_to_x1 : (cfgL qL (Lmp x0) (RC 1)) [tm]⊢* (cfgL qL (Lmp x1) (RC 1)) := by + let x0' : List LD := [.W1, .W1, .W0, .W0, .W1, .W1, .W1, .W1] + let y0 : List LD := [.W0, .W0, .W0, .W1, .W1, .W0, .W1, .W0, .W1, .W0] + have h1 : LIncsP (2 * 2 + 1) x0 x0' := + lincspFinite_sound (by decide : lincspFinite x0 = some x0') + have h2 : LOv2 x0' [.W0, .W0] y0 := + lov2Finite_sound (by decide : lov2Finite x0' [.W0, .W0] = some y0) + have h3 : LInc ((([.W1] : List LD) ^ (2 * 2 + 1)) ++ y0) x1 := + lincFinite_sound (by decide : lincFinite ((([.W1] : List LD) ^ 5) ++ y0) = some x1) + exact round_step S 2 h1 h2 h3 + +set_option maxRecDepth 200000 in +set_option maxHeartbeats 2000000 in +-- `x1_to_x2` verifies a 51-increment round via `decide`. +theorem x1_to_x2 : (cfgL qL (Lmp x1) (RC 1)) [tm]⊢* (cfgL qL (Lmp x2) (RC 1)) := by + let x1' := (lincspFinite x1).getD [] + let y1 := (lov2Finite x1' [.W0, .W0]).getD [] + have h1 : LIncsP (2 * 25 + 1) x1 x1' := + lincspFinite_sound (by decide : lincspFinite x1 = some x1') + have h2 : LOv2 x1' [.W0, .W0] y1 := + lov2Finite_sound (by decide : lov2Finite x1' [.W0, .W0] = some y1) + have h3 : LInc ((([.W1] : List LD) ^ (2 * 25 + 1)) ++ y1) x2 := + lincFinite_sound (by decide : lincFinite ((([.W1] : List LD) ^ 51) ++ y1) = some x2) + exact round_step S 25 h1 h2 h3 + +set_option maxRecDepth 200000 in +set_option maxHeartbeats 2000000 in +-- `x2_to_x3` verifies the `x2` overflow round via `decide`. +theorem x2_to_x3 : + ∃ m3 ≥ 511, + (cfgL qL (Lmp x2) (RC 1)) [tm]⊢* + (cfgL qL (Lmp ((([.W1, .W0] : List LD) ^ m3) ++ u0)) (RC 1)) := by + let ux2' := (lincspFinite ux2).getD [] + have h_ux2 : LIncsP (lincspCount ux2) ux2 ux2' := + lincspFinite_sound (by decide : lincspFinite ux2 = some ux2') + rcases LIncsP_pow_10 15 h_ux2 with ⟨n_suf, h_suf⟩ + have h_10 := LIncsP_pow10_bound h_suf + have hx2_eq : + ((([.W1, .W0] : List LD) ^ 10) ++ ((([.W1, .W0] : List LD) ^ 15) ++ ux2)) = x2 := by + rw [← List.append_assoc, ← list_pow_add]; rfl + let x2' := ((([.W1, .W1] : List LD) ^ 10) ++ ((([.W1, .W1] : List LD) ^ 15) ++ ux2')) + rw [hx2_eq] at h_10 + have h_ov : LOv2 x2' [.W0, .W0] (.W0 :: u0_tail) := + lov2Finite_sound (by decide : lov2Finite x2' [.W0, .W0] = some (.W0 :: u0_tail)) + let m3 := 512 * n_suf + 511 + refine ⟨m3, by omega, ?_⟩ + have h_inc : LInc ((([.W1] : List LD) ^ (2 * m3 + 1)) ++ (.W0 :: u0_tail)) + ((([.W1, .W0] : List LD) ^ m3) ++ u0) := by + rw [pow_W1_odd m3 (.W0 :: u0_tail)] + exact LInc_pow_11_10 m3 u0_tail + exact round_step S m3 h_10 h_ov h_inc + +set_option maxRecDepth 200000 in +theorem chain_round_step {r : ℕ} (hr : r ≤ 191) {T : List LD} (hT : ChainTail (r + 1) T) + {u u' : List LD} (hu : macroStepFinite u = some u') : + ∃ T', ChainTail r T' ∧ + ((cfgL qL (Lmp ((([.W1, .W0] : List LD) ^ 10) ++ (T ++ u))) (RC 1)) + [tm]⊢* + (cfgL qL (Lmp ((([.W1, .W0] : List LD) ^ 10) ++ (T' ++ u'))) (RC 1))) := by + rcases ChainTail_step hT hu with ⟨n, W', T₀', h_lp, h_ov, h_ct0⟩ + have h_10 := LIncsP_pow10_bound h_lp + have h_ov10 : LOv2 ((([.W1, .W1] : List LD) ^ 10) ++ W') [.W0, .W0] + ([.W0, .W0, .W1, .W0] ++ ((([.W1, .W0] : List LD) ^ 10) ++ (T₀' ++ u'))) := + LOv2_append (LOv2_pow_11 10 (T₀' ++ u')) h_ov + let m := 512 * n + 511 + let B1 : List LD := [.W1, .W1, .W0] + let tail_rest := ((([.W1, .W0] : List LD) ^ 11) ++ (T₀' ++ u')) + have h_inc : LInc ((([.W1] : List LD) ^ (2 * m + 1)) ++ + ([.W0, .W0, .W1, .W0] ++ ((([.W1, .W0] : List LD) ^ 10) ++ (T₀' ++ u')))) + ((([.W1, .W0] : List LD) ^ m) ++ (B1 ++ tail_rest)) := by + dsimp only [m, B1, tail_rest] + rw [pow_W1_odd] + exact LInc_pow_11_10 (512 * n + 511) + ([.W0, .W1, .W0] ++ ((([.W1, .W0] : List LD) ^ 10) ++ (T₀' ++ u'))) + have h_step := round_step S m h_10 h_ov10 h_inc + have hm_split : m = 10 + ((m - 10 - 2 * r) + 2 * r) := by omega + let T' := ((([.W1, .W0] : List LD) ^ (m - 10 - 2 * r)) ++ + ((([.W1, .W0] : List LD) ^ (2 * r)) ++ (B1 ++ ((([.W1, .W0] : List LD) ^ 11) ++ T₀')))) + have hB1 : IsBuffer r B1 := isBuffer_le hr isBuffer_191_B1 + have h_ct_T' : ChainTail r T' := + ChainTail_pow_pair (m - 10 - 2 * r) (.buf hB1 (ChainTail_pow_pair 11 h_ct0)) + have h_eq : ((([.W1, .W0] : List LD) ^ m) ++ (B1 ++ tail_rest)) = + ((([.W1, .W0] : List LD) ^ 10) ++ (T' ++ u')) := by + conv_lhs => rw [hm_split, list_pow_add, list_pow_add] + simp only [T', tail_rest, List.append_assoc] + rw [h_eq] at h_step + exact ⟨T', h_ct_T', h_step⟩ + +theorem runU_steps : ∀ (k : ℕ) (r : ℕ), r + k ≤ 191 → + ∀ {T u u' : List LD}, + ChainTail (r + k) T → + runU k u = some u' → + ∃ T', ChainTail r T' ∧ + ((cfgL qL (Lmp ((([.W1, .W0] : List LD) ^ 10) ++ (T ++ u))) (RC 1)) + [tm]⊢* + (cfgL qL (Lmp ((([.W1, .W0] : List LD) ^ 10) ++ (T' ++ u'))) (RC 1))) + | 0, r, _, T, _, _, hT, hu => by + injection hu with hu'; subst hu' + exact ⟨T, hT, stepStar_refl _ _⟩ + | k + 1, r, hrk, T, u, u', hT, hu => by + simp only [runU, Option.bind_eq_some_iff] at hu + rcases hu with ⟨u₁, hu₁, hu₂⟩ + have h_eq : r + (k + 1) = (r + k) + 1 := by omega + rw [h_eq] at hT + rcases chain_round_step S (by omega : r + k ≤ 191) hT hu₁ with ⟨T₁, hT₁, h_step1⟩ + rcases runU_steps k r (by omega) hT₁ hu₂ with ⟨T', hT', h_step2⟩ + exact ⟨T', hT', stepStar_trans h_step1 h_step2⟩ + +theorem Only011_skip_1 {P : List LD} (hP : Only011 P) (s : List LD) : + ∀ (r : ListBlank (Fin 2)), + ∃ r', (cfgL qL (Lmp (P ++ s)) ([1] +> r)) [tm]⊢* + (cfgL qL (Lmp s) ([1] +> r')) := by + induction hP with + | nil => + intro r; exact ⟨r, stepStar_refl _ _⟩ + | @w0 xs _ ih => + intro r + rcases ih ([0, 1, 1] +> r) with ⟨r', hr'⟩ + exact ⟨r', stepStar_trans (S.w0_1 (xs ++ s) r) hr'⟩ + | @w11 xs _ ih => + intro r + rcases ih ([0, 1, 0, 1, 0, 1] +> r) with ⟨r', hr'⟩ + exact ⟨r', stepStar_trans (S.w11_1 (xs ++ s) r) hr'⟩ + +theorem Only011_skip_10 {P : List LD} (hP : Only011 P) (s : List LD) : + ∀ (r : ListBlank (Fin 2)), + ∃ r', (cfgL qL (Lmp (P ++ s)) ([1, 0] +> r)) [tm]⊢* + (cfgL qL (Lmp s) ([1, 0] +> r')) := by + induction hP with + | nil => + intro r; exact ⟨r, stepStar_refl _ _⟩ + | @w0 xs _ ih => + intro r + rcases ih ([1, 1, 0] +> r) with ⟨r', hr'⟩ + exact ⟨r', stepStar_trans (S.w0_1 (xs ++ s) ([0] +> r)) hr'⟩ + | @w11 xs _ ih => + intro r + rcases ih ([1, 0, 1, 0, 1, 0] +> r) with ⟨r', hr'⟩ + exact ⟨r', stepStar_trans (S.w11_1 (xs ++ s) ([0] +> r)) hr'⟩ + +set_option maxRecDepth 200000 in +theorem init_to_msb17 + (h_init : (init []) [tm]⊢* (cfgL qL (Lmp x0) (RC 1))) : + ∃ P_all nAll, Only011 P_all ∧ + ((init []) [tm]⊢* (cfgL qL (Lmp (P_all ++ msb_17)) (RC (1 + nAll)))) := by + have h01 := stepStar_trans h_init (stepStar_trans (x0_to_x1 S) (x1_to_x2 S)) + rcases x2_to_x3 S with ⟨m3, hm3, h23⟩ + have h_init_x3 := stepStar_trans h01 h23 + have hm3_split : m3 = 10 + ((m3 - 392) + 2 * 191) := by omega + let T0 := ((([.W1, .W0] : List LD) ^ (m3 - 392)) ++ (([.W1, .W0] : List LD) ^ (2 * 191))) + have h_T0 : ChainTail (0 + 191) T0 := + ChainTail_pow_pair (m3 - 392) .nil + have h_x3_eq : ((([.W1, .W0] : List LD) ^ m3) ++ u0) = + ((([.W1, .W0] : List LD) ^ 10) ++ (T0 ++ u0)) := by + conv_lhs => rw [hm3_split, list_pow_add, list_pow_add] + simp only [T0, List.append_assoc] + rw [h_x3_eq] at h_init_x3 + rcases runU_steps S 191 0 (by omega) h_T0 runU_191_eq with ⟨T191, h_T191, h_rounds⟩ + have h_to_191 := stepStar_trans h_init_x3 h_rounds + rcases ChainTail_zero_lincsp h_T191 with ⟨_, T191', h_lpT⟩ + have h_lpU := lincspFinite_sound u191_lincsp_eq + rcases LIncsP_append h_lpT h_lpU with ⟨_, h_lpTU⟩ + rcases LIncsP_pow_10 10 h_lpTU with ⟨nAll, h_lpAll⟩ + have h_incs_final := LIncs_RC S (LIncsP_to_LIncs h_lpAll) 1 + have h_to_inc := stepStar_trans h_to_191 h_incs_final + have h_10T_only : Only011 ((([.W1, .W1] : List LD) ^ 10) ++ T191') := by + rcases LIncsP_pow_10 10 h_lpT with ⟨_, h10T⟩ + exact LIncsP_only011 h10T + let P_all := ((([.W1, .W1] : List LD) ^ 10) ++ T191') ++ u191_pre' + have h_P_only : Only011 P_all := + Only011_append h_10T_only (checkOnly011_sound u191_pre'_only011) + have h_assoc : ((([.W1, .W1] : List LD) ^ 10) ++ (T191' ++ (u191_pre' ++ msb_17))) = + P_all ++ msb_17 := by + simp only [P_all, List.append_assoc] + rw [h_assoc] at h_to_inc + exact ⟨P_all, nAll, h_P_only, h_to_inc⟩ + +theorem is_halt_of_msb17_10 + (h_init : (init []) [tm]⊢* (cfgL qL (Lmp x0) (RC 1))) + (h_msb : ∀ r, ∃ cfg, ((cfgL qL (Lmp msb_17) ([1, 0] +> r)) [tm]⊢* cfg) ∧ + (step tm cfg).isNone) : + IsHalt tm := by + rcases init_to_msb17 S h_init with ⟨P_all, nAll, h_P_only, h_to_inc⟩ + have h_rc_eq : RC (1 + nAll) = + [1, 0] +> ([1, 1] +> ((([0, 1, 1] : List (Fin 2)) ^ nAll) +> ([0, 1] +> default))) := by + rw [Nat.add_comm 1 nAll]; rfl + rw [h_rc_eq] at h_to_inc + rcases Only011_skip_10 S h_P_only msb_17 + ([1, 1] +> ((([0, 1, 1] : List (Fin 2)) ^ nAll) +> ([0, 1] +> default))) with ⟨r', h_skip⟩ + rcases h_msb r' with ⟨cfg_halt, h_halt_steps, h_is_none⟩ + exact ⟨cfg_halt, stepStar_trans (stepStar_trans h_to_inc h_skip) h_halt_steps, h_is_none⟩ + +theorem is_halt_of_msb17_1 + (h_init : (init []) [tm]⊢* (cfgL qL (Lmp x0) (RC 1))) + (h_msb : ∀ r, ∃ cfg, ((cfgL qL (Lmp msb_17) ([1] +> r)) [tm]⊢* cfg) ∧ + (step tm cfg).isNone) : + IsHalt tm := by + rcases init_to_msb17 S h_init with ⟨P_all, nAll, h_P_only, h_to_inc⟩ + rcases Only011_skip_1 S h_P_only msb_17 + ((([0, 1, 1] : List (Fin 2)) ^ (1 + nAll)) +> ([0, 1] +> default)) with ⟨r', h_skip⟩ + rcases h_msb r' with ⟨cfg_halt, h_halt_steps, h_is_none⟩ + exact ⟨cfg_halt, stepStar_trans (stepStar_trans h_to_inc h_skip) h_halt_steps, h_is_none⟩ + +end WithSpec + +macro "buf_step1" : tactic => `(tactic| ( + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, cfgL, cfgR, RC, Lmp_W0, + Lmp_W1, Lmp_nil, Lmp_head, Lmp_cons_tail, pow_succ_list, pow_zero_list, + List.singleton_append, List.nil_append, List.cons_append, listblank_append_cons, + listblank_append_nil, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + zero_cons_default, default_head, default_tail] + refine multiStep_step (by rfl) ?_ + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Tape.write, + Lmp_head, Lmp_cons_tail, listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, zero_cons_default, default_head, + default_tail])) + +macro "buf_run_steps" n:num : tactic => `(tactic| ( + iterate $n buf_step1 + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, cfgL, cfgR, RC, Lmp_W0, Lmp_W1, + Lmp_nil, Lmp_head, Lmp_cons_tail, pow_succ_list, pow_zero_list, List.singleton_append, + List.nil_append, List.cons_append, listblank_append_cons, listblank_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, zero_cons_default, default_head, + default_tail, multiStep_zero])) + +theorem init_to_x0_of_cmultiStep {tm : Machine (Fin 2) (Fin 6)} {qL : Fin 6} {k : ℕ} + (h_steps : cmultiStep tm k c_init_30 = some (c_x0 qL)) : + (init []) [tm]⊢* (cfgL qL (Lmp x0) (RC 1)) := by + have h_eq1 : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = evalCCfg default c_init_30 := by + rw [init_nil] + simp [evalCCfg, evalWindow, c_init_30] + have h_eq2 : evalCCfg default (c_x0 qL) = cfgL qL (Lmp x0) (RC 1) := rfl + rw [h_eq1, ← h_eq2] + exact ⟨k, cmultiStep_sound k c_init_30 (c_x0 qL) default h_steps⟩ + +end BusyBeaver.BufferChainEngine + +end diff --git a/BusyBeaver/Calculi/Longitudinal.lean b/BusyBeaver/Calculi/Longitudinal.lean new file mode 100644 index 00000000..607f3199 --- /dev/null +++ b/BusyBeaver/Calculi/Longitudinal.lean @@ -0,0 +1,2293 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. + -/ +module + +public import BusyBeaver.Calculi.Counter + +/-! +# 2D Longitudinal Space-Time Calculus (`BusyBeaver.Calculi.Longitudinal`) + +Polymorphic 2D space-time boundary-trace calculus (`DH0`, `DH`, `toDHCfg`, `SideRL`, `SideLR`, +`SegRR`, `SegLL`, `SegRL`, `SegLR`, `SideRLs`, `SegLRs`, `SegRLs`, `SegLLs`, `SideRLsHalt`), +involutive left/right machine mirroring (`flipTM`, `flipCfg`), unary and binary counter tile +libraries (`UC1`, `UC2`, `UC3`, `BCR`, `BC`), parametric Shift-Overflow Binary Counter closure +(`SBC`), and reflective bounded-configuration tile checkers (`BoundedConfig`). + +All declarations live in `namespace BusyBeaver.Longitudinal` with `@[scoped simp]` attributes so +that importing `BusyBeaver.Basic` never alters the default `simp` set of existing proofs; activate +them in a proof file with `open BusyBeaver.Calculi.Longitudinal` (or `open Longitudinal`). + -/ + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.Longitudinal + + + +set_option linter.unusedSectionVars false + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +-- ============================================================================ +-- 1. Local Multi-Step & Half-Tape Helpers +-- ============================================================================ + +@[scoped simp] private theorem default_head : (default : ListBlank Γ).head = default := rfl + +@[scoped simp] private theorem default_tail : (default : ListBlank Γ).tail = default := rfl + +@[scoped simp] private theorem multiStep_zero (M : Machine Γ Λ) (c : Cfg Γ Λ) : + multiStep M c 0 = some c := rfl + +@[scoped simp] private theorem multiStep_one (M : Machine Γ Λ) (c : Cfg Γ Λ) : + multiStep M c 1 = step M c := rfl + +private theorem multiStep_succ (M : Machine Γ Λ) (c : Cfg Γ Λ) (n : ℕ) : + multiStep M c (n + 1) = (multiStep M c n).bind (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +private theorem multiStep_succ' (M : Machine Γ Λ) (c : Cfg Γ Λ) (n : ℕ) : + multiStep M c (n + 1) = (step M c).bind (fun c' => multiStep M c' n) := by + induction n generalizing c with + | zero => + rw [multiStep_one] + rcases step M c with _ | c' <;> rfl + | succ n ih => + rw [multiStep_succ, ih] + rcases step M c with _ | c' + · rfl + · simp only [Option.bind_some, ← multiStep_succ] + +private theorem multiStep_add (M : Machine Γ Λ) (c : Cfg Γ Λ) (m n : ℕ) : + multiStep M c (m + n) = (multiStep M c m).bind (fun c' => multiStep M c' n) := by + induction n with + | zero => simp + | succ n ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + congr 1 + funext c' + exact (multiStep_succ M c' n).symm + +private theorem multiStep_trans {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} {m n : ℕ} + (h₁ : multiStep M c₁ m = some c₂) (h₂ : multiStep M c₂ n = some c₃) : + multiStep M c₁ (m + n) = some c₃ := by + rw [multiStep_add, h₁, Option.bind_some, h₂] + +theorem stepStar_refl (M : Machine Γ Λ) (c : Cfg Γ Λ) : c [M]⊢* c := + ⟨0, rfl⟩ + +theorem stepStar_trans {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [M]⊢* c₂) (h₂ : c₂ [M]⊢* c₃) : c₁ [M]⊢* c₃ := by + rcases h₁ with ⟨m, hm⟩ + rcases h₂ with ⟨n, hn⟩ + exact ⟨m + n, multiStep_trans hm hn⟩ + +theorem stepPlus_to_stepStar {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} + (h : c₁ [M]⊢⁺ c₂) : c₁ [M]⊢* c₂ := by + rcases h with ⟨n, _, hn⟩ + exact ⟨n, hn⟩ + +theorem stepPlus_trans {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [M]⊢⁺ c₂) (h₂ : c₂ [M]⊢⁺ c₃) : c₁ [M]⊢⁺ c₃ := by + rcases h₁ with ⟨m, hm_pos, hm⟩ + rcases h₂ with ⟨n, _, hn⟩ + exact ⟨m + n, Nat.add_pos_left hm_pos n, multiStep_trans hm hn⟩ + +theorem stepPlus_stepStar_trans {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [M]⊢⁺ c₂) (h₂ : c₂ [M]⊢* c₃) : c₁ [M]⊢⁺ c₃ := by + rcases h₁ with ⟨m, hm_pos, hm⟩ + rcases h₂ with ⟨n, hn⟩ + exact ⟨m + n, Nat.add_pos_left hm_pos n, multiStep_trans hm hn⟩ + +theorem stepStar_stepPlus_trans {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [M]⊢* c₂) (h₂ : c₂ [M]⊢⁺ c₃) : c₁ [M]⊢⁺ c₃ := by + rcases h₁ with ⟨m, hm⟩ + rcases h₂ with ⟨n, hn_pos, hn⟩ + exact ⟨m + n, Nat.add_pos_right m hn_pos, multiStep_trans hm hn⟩ + +@[scoped simp] theorem append_nil (s : ListBlank Γ) : ([] : List Γ) +> s = s := rfl + +@[scoped simp] theorem append_cons (a : Γ) (w : List Γ) (s : ListBlank Γ) : + (a :: w) +> s = a >> (w +> s) := rfl + +@[scoped simp] theorem append_assoc (w₁ w₂ : List Γ) (s : ListBlank Γ) : + (w₁ ++ w₂) +> s = w₁ +> (w₂ +> s) := by + induction w₁ with + | nil => rfl + | cons a w₁ ih => simp only [List.cons_append, append_cons, ih] + +omit [Inhabited Γ] [Inhabited Λ] in +@[scoped simp] theorem pow_zero_list {α : Type*} (l : List α) : l ^ (0 : ℕ) = [] := rfl + +omit [Inhabited Γ] [Inhabited Λ] in +@[scoped simp] theorem pow_succ_list {α : Type*} (l : List α) (n : ℕ) : + l ^ (n + 1) = l ++ l ^ n := rfl + +omit [Inhabited Γ] [Inhabited Λ] in +theorem pow_one_list {α : Type*} (l : List α) : l ^ (1 : ℕ) = l := by + change l ++ [] = l + exact List.append_nil l + +omit [Inhabited Γ] [Inhabited Λ] in +theorem pow_add_list {α : Type*} (l : List α) (m n : ℕ) : + l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => rw [Nat.succ_add, pow_succ_list, pow_succ_list, ih, List.append_assoc] + +omit [Inhabited Γ] [Inhabited Λ] in +theorem pow_succ_list' {α : Type*} (l : List α) (n : ℕ) : + l ^ (n + 1) = l ^ n ++ l := by + rw [pow_add_list, pow_one_list] + +omit [Inhabited Γ] [Inhabited Λ] in +theorem pow_mul_list {α : Type*} (l : List α) (m n : ℕ) : + l ^ (m * n) = (l ^ m) ^ n := by + induction n with + | zero => rfl + | succ n ih => + rw [Nat.mul_succ, pow_add_list, ih, pow_succ_list'] + +-- ============================================================================ +-- 2. Involutive Machine & Configuration Mirroring (`flipTM`, `flipCfg`) +-- ============================================================================ + +/-- Swap left and right tape directions. -/ +def flipDir : Dir → Dir + | .left => .right + | .right => .left + +/-- Mirror a statement's movement direction. -/ +def flipStmt (s : Stmt Γ) : Stmt Γ := + ⟨s.symbol, flipDir s.dir⟩ + +/-- Mirror a Turing machine by flipping all transition directions (`flip tm` in `busycoq`). -/ +def flipTM (M : Machine Γ Λ) : Machine Γ Λ := + fun q a => (M q a).map (fun (q', s) => (q', flipStmt s)) + +/-- Mirror a tape by exchanging its left and right half-tapes. -/ +def flipTape (T : Tape Γ) : Tape Γ := + ⟨T.head, T.right, T.left⟩ + +/-- Mirror a configuration by exchanging its left and right half-tapes. -/ +def flipCfg (c : Cfg Γ Λ) : Cfg Γ Λ := + ⟨c.q, flipTape c.tape⟩ + +@[scoped simp] theorem flipDir_flipDir (d : Dir) : flipDir (flipDir d) = d := by + cases d <;> rfl + +@[scoped simp] theorem flipStmt_flipStmt (s : Stmt Γ) : flipStmt (flipStmt s) = s := by + rcases s with ⟨a, d⟩ + simp [flipStmt] + +@[scoped simp] theorem flipTM_flipTM (M : Machine Γ Λ) : flipTM (flipTM M) = M := by + funext q a + simp only [flipTM, Option.map_map] + rcases M q a with _ | ⟨q', s⟩ + · rfl + · simp [Function.comp] + +@[scoped simp] theorem flipTape_flipTape (T : Tape Γ) : flipTape (flipTape T) = T := by + rcases T with ⟨h, l, r⟩ + rfl + +@[scoped simp] theorem flipCfg_flipCfg (c : Cfg Γ Λ) : flipCfg (flipCfg c) = c := by + rcases c with ⟨q, ⟨h, l, r⟩⟩ + rfl + +@[scoped simp] theorem flipCfg_headRight (q : Λ) (l r : ListBlank Γ) : + flipCfg (l {{q}}> r) = r <{{q}} l := + rfl + +@[scoped simp] theorem flipCfg_headLeft (q : Λ) (l r : ListBlank Γ) : + flipCfg (l <{{q}} r) = r {{q}}> l := + rfl + +theorem step_flipTM (M : Machine Γ Λ) (c : Cfg Γ Λ) : + step (flipTM M) (flipCfg c) = (step M c).map flipCfg := by + rcases c with ⟨_ | q, ⟨h, l, r⟩⟩ + · rfl + · simp only [flipCfg, flipTape, step, flipTM] + rcases M q h with _ | ⟨q', ⟨a, _ | _⟩⟩ <;> rfl + +theorem multiStep_flipTM (M : Machine Γ Λ) (c : Cfg Γ Λ) (n : ℕ) : + multiStep (flipTM M) (flipCfg c) n = (multiStep M c n).map flipCfg := by + induction n generalizing c with + | zero => rfl + | succ n ih => + rw [multiStep_succ, multiStep_succ, ih] + rcases multiStep M c n with _ | c' + · rfl + · exact step_flipTM M c' + +theorem step_flipTM_of_step {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} + (h : c₁ [M]⊢ c₂) : (flipCfg c₁) [flipTM M]⊢ (flipCfg c₂) := by + rw [step_flipTM, h] + rfl + +theorem stepStar_flipTM {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} + (h : c₁ [M]⊢* c₂) : (flipCfg c₁) [flipTM M]⊢* (flipCfg c₂) := by + rcases h with ⟨n, hn⟩ + refine ⟨n, ?_⟩ + rw [multiStep_flipTM, hn] + rfl + +theorem stepPlus_flipTM {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} + (h : c₁ [M]⊢⁺ c₂) : (flipCfg c₁) [flipTM M]⊢⁺ (flipCfg c₂) := by + rcases h with ⟨n, hn_pos, hn⟩ + refine ⟨n, hn_pos, ?_⟩ + rw [multiStep_flipTM, hn] + rfl + +theorem stepStar_unflipTM {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} + (h : (flipCfg c₁) [flipTM M]⊢* (flipCfg c₂)) : c₁ [M]⊢* c₂ := by + simpa using stepStar_flipTM h + +theorem stepPlus_unflipTM {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} + (h : (flipCfg c₁) [flipTM M]⊢⁺ (flipCfg c₂)) : c₁ [M]⊢⁺ c₂ := by + simpa using stepPlus_flipTM h + +-- ============================================================================ +-- 3. Directed-Head Words (`DH0`, `DH`, `toDHCfg`) & 1-Transition Primitives +-- ============================================================================ + +/-- Directed-head boundary state: control state paired with a local tape word. -/ +abbrev DH0 (Γ Λ : Type*) := Λ × List Γ + +/-- Oriented directed-head boundary state: `DH0` paired with a movement direction. -/ +abbrev DH (Γ Λ : Type*) := DH0 Γ Λ × Dir + +/-- Realize an oriented directed-head state `(h, d)` between half-tapes `l` and `r`. -/ +def toDHCfg (x : DH Γ Λ) (l r : ListBlank Γ) : Cfg Γ Λ := + match x with + | ((q, s), .right) => (s +> l) {{q}}> r + | ((q, s), .left) => l <{{q}} (s +> r) + +@[scoped simp] theorem toDHCfg_right (q : Λ) (s : List Γ) (l r : ListBlank Γ) : + toDHCfg ((q, s), .right) l r = (s +> l) {{q}}> r := rfl + +@[scoped simp] theorem toDHCfg_left (q : Λ) (s : List Γ) (l r : ListBlank Γ) : + toDHCfg ((q, s), .left) l r = l <{{q}} (s +> r) := rfl + +@[scoped simp] theorem flipCfg_toDHCfg (h : DH0 Γ Λ) (d : Dir) (l r : ListBlank Γ) : + flipCfg (toDHCfg (h, d) l r) = toDHCfg (h, flipDir d) r l := by + rcases h with ⟨q, s⟩ + cases d <;> rfl + +theorem toDHCfg_stepPlus_flip {M : Machine Γ Λ} {h₁ h₂ : DH0 Γ Λ} {d₁ d₂ : Dir} + {l₁ l₂ r₁ r₂ : ListBlank Γ} + (h : (toDHCfg (h₁, d₁) l₁ r₁) [M]⊢⁺ (toDHCfg (h₂, d₂) l₂ r₂)) : + (toDHCfg (h₁, flipDir d₁) r₁ l₁) [flipTM M]⊢⁺ (toDHCfg (h₂, flipDir d₂) r₂ l₂) := by + have h' := stepPlus_flipTM h + rwa [flipCfg_toDHCfg, flipCfg_toDHCfg] at h' + +theorem toDHCfg_stepPlus_unflip {M : Machine Γ Λ} {h₁ h₂ : DH0 Γ Λ} {d₁ d₂ : Dir} + {l₁ l₂ r₁ r₂ : ListBlank Γ} + (h : (toDHCfg (h₁, d₁) l₁ r₁) [flipTM M]⊢⁺ (toDHCfg (h₂, d₂) l₂ r₂)) : + (toDHCfg (h₁, flipDir d₁) r₁ l₁) [M]⊢⁺ (toDHCfg (h₂, flipDir d₂) r₂ l₂) := by + have h' := toDHCfg_stepPlus_flip h + rwa [flipTM_flipTM] at h' + +theorem toDHCfg_stepStar_flip {M : Machine Γ Λ} {h₁ h₂ : DH0 Γ Λ} {d₁ d₂ : Dir} + {l₁ l₂ r₁ r₂ : ListBlank Γ} + (h : (toDHCfg (h₁, d₁) l₁ r₁) [M]⊢* (toDHCfg (h₂, d₂) l₂ r₂)) : + (toDHCfg (h₁, flipDir d₁) r₁ l₁) [flipTM M]⊢* (toDHCfg (h₂, flipDir d₂) r₂ l₂) := by + have h' := stepStar_flipTM h + rwa [flipCfg_toDHCfg, flipCfg_toDHCfg] at h' + +theorem toDHCfg_stepStar_unflip {M : Machine Γ Λ} {h₁ h₂ : DH0 Γ Λ} {d₁ d₂ : Dir} + {l₁ l₂ r₁ r₂ : ListBlank Γ} + (h : (toDHCfg (h₁, d₁) l₁ r₁) [flipTM M]⊢* (toDHCfg (h₂, d₂) l₂ r₂)) : + (toDHCfg (h₁, flipDir d₁) r₁ l₁) [M]⊢* (toDHCfg (h₂, flipDir d₂) r₂ l₂) := by + have h' := toDHCfg_stepStar_flip h + rwa [flipTM_flipTM] at h' + +/-- Right-half-tape reflection (`sideRL` in `busycoq`): enters `r₁` moving right in `h₁` and exits +left in `h₂` leaving `r₂`, uniformly in the left half-tape `l`. -/ +def SideRL (M : Machine Γ Λ) (h₁ h₂ : DH0 Γ Λ) (r₁ r₂ : ListBlank Γ) : Prop := + ∀ l, (toDHCfg (h₁, .right) l r₁) [M]⊢⁺ (toDHCfg (h₂, .left) l r₂) + +/-- Left-half-tape reflection (`sideLR` in `busycoq`): enters `l₁` moving left in `h₁` and exits +right in `h₂` leaving `l₂`, uniformly in the right half-tape `r`. -/ +def SideLR (M : Machine Γ Λ) (h₁ h₂ : DH0 Γ Λ) (l₁ l₂ : ListBlank Γ) : Prop := + ∀ r, (toDHCfg (h₁, .left) l₁ r) [M]⊢⁺ (toDHCfg (h₂, .right) l₂ r) + +/-- Rightward finite-segment traversal (`segRR` in `busycoq`). -/ +def SegRR (M : Machine Γ Λ) (h₁ h₂ : DH0 Γ Λ) (w₁ w₂ : List Γ) : Prop := + ∀ l r, (toDHCfg (h₁, .right) l (w₁ +> r)) [M]⊢* (toDHCfg (h₂, .right) (w₂ +> l) r) + +/-- Leftward finite-segment traversal (`segLL` in `busycoq`). -/ +def SegLL (M : Machine Γ Λ) (h₁ h₂ : DH0 Γ Λ) (w₁ w₂ : List Γ) : Prop := + ∀ l r, (toDHCfg (h₁, .left) (w₁ +> l) r) [M]⊢* (toDHCfg (h₂, .left) l (w₂ +> r)) + +/-- Right-to-left finite-segment reflection (`segRL` in `busycoq`). -/ +def SegRL (M : Machine Γ Λ) (h₁ h₂ : DH0 Γ Λ) (w₁ w₂ : List Γ) : Prop := + ∀ l r, (toDHCfg (h₁, .right) l (w₁ +> r)) [M]⊢⁺ (toDHCfg (h₂, .left) l (w₂ +> r)) + +/-- Left-to-right finite-segment reflection (`segLR` in `busycoq`). -/ +def SegLR (M : Machine Γ Λ) (h₁ h₂ : DH0 Γ Λ) (w₁ w₂ : List Γ) : Prop := + ∀ l r, (toDHCfg (h₁, .left) (w₁ +> l) r) [M]⊢* (toDHCfg (h₂, .right) (w₂ +> l) r) + +-- ============================================================================ +-- 4. Boundary Signal Lists (`lrcons`, `lcons`, `rcons`) & 2D Tile Relations +-- ============================================================================ + +omit [Inhabited Γ] [Inhabited Λ] in +/-- Interleave a starting right-entry signal `l`, a list of left-to-right bounce pairs `ls`, and a +final left-exit signal `r` into a right-boundary `(entry, exit)` list. -/ +def lrcons {α : Type*} (l : α) : List (α × α) → α → List (α × α) + | [], r => [(l, r)] + | (a, b) :: t, r => (l, a) :: lrcons b t r + +omit [Inhabited Γ] [Inhabited Λ] in +/-- Pair an initial signal `l` with a list of opposite-side bounce pairs `ls`, returning the +paired signal list and the final exit signal. -/ +def lcons {α : Type*} (l : α) : List (α × α) → List (α × α) × α + | [] => ([], l) + | (a, b) :: t => + let (x, y) := lcons b t + ((l, a) :: x, y) + +omit [Inhabited Γ] [Inhabited Λ] in +/-- Split the head signal off `ls` paired with trailing signal `r`. -/ +def rcons {α : Type*} : List (α × α) → α → α × List (α × α) + | [], r => (r, []) + | (a, b) :: t, r => (a, lrcons b t r) + +omit [Inhabited Γ] [Inhabited Λ] in +theorem lrcons_lrcons {α : Type*} (h₁ h₂ : α) (ls : List (α × α)) (h₃ h₄ : α) : + lrcons h₁ (lrcons h₂ ls h₃) h₄ = (h₁, h₂) :: ls ++ [(h₃, h₄)] := by + induction ls generalizing h₁ h₂ h₃ h₄ with + | nil => rfl + | cons ab t ih => + rcases ab with ⟨a, b⟩ + simp only [lrcons, List.cons_append, ih] + +omit [Inhabited Γ] [Inhabited Λ] in +theorem lrcons_app {α : Type*} (h₁ : α) (ls₀ : List (α × α)) (h₂ h₀ : α) + (ls₁ : List (α × α)) (h₃ : α) : + lrcons h₁ ls₀ h₂ ++ lrcons h₀ ls₁ h₃ = lrcons h₁ (ls₀ ++ (h₂, h₀) :: ls₁) h₃ := by + induction ls₀ generalizing h₁ with + | nil => rfl + | cons ab t ih => + rcases ab with ⟨a, b⟩ + simp only [lrcons, List.cons_append, ih] + +omit [Inhabited Γ] [Inhabited Λ] in +theorem lrcons_same {α : Type*} (h₁ h₂ : α) (n : ℕ) : + lrcons h₁ ([(h₂, h₁)] ^ n) h₂ = [(h₁, h₂)] ^ (n + 1) := by + induction n with + | zero => rfl + | succ n ih => + change (h₁, h₂) :: lrcons h₁ ([(h₂, h₁)] ^ n) h₂ = (h₁, h₂) :: ([(h₁, h₂)] ^ (n + 1)) + rw [ih] + +omit [Inhabited Γ] [Inhabited Λ] in +theorem lrcons_lpow1 {α : Type*} (h₁ h₂ : α) {n : ℕ} (hn : n ≠ 0) : + lrcons h₁ ([(h₂, h₁)] ^ (n - 1)) h₂ = [(h₁, h₂)] ^ n := by + rcases n with _ | n + · exact absurd rfl hn + · exact lrcons_same h₁ h₂ n + +/-- Multi-visit right half-tape reflection (`sideRLs` in `busycoq`). -/ +inductive SideRLs (M : Machine Γ Λ) : + List (DH0 Γ Λ × DH0 Γ Λ) → ListBlank Γ → ListBlank Γ → Prop where + | nil (r : ListBlank Γ) : SideRLs M [] r r + | cons {h₁ h₂ : DH0 Γ Λ} {hs : List (DH0 Γ Λ × DH0 Γ Λ)} {r₁ r₂ r₃ : ListBlank Γ} : + SideRL M h₁ h₂ r₁ r₂ → SideRLs M hs r₂ r₃ → SideRLs M ((h₁, h₂) :: hs) r₁ r₃ + +/-- Multi-visit left-to-right segment reflection (`segLRs` in `busycoq`). -/ +inductive SegLRs (M : Machine Γ Λ) : + List (DH0 Γ Λ × DH0 Γ Λ) → List Γ → List Γ → Prop where + | nil (w : List Γ) : SegLRs M [] w w + | cons {h₁ h₂ : DH0 Γ Λ} {ls : List (DH0 Γ Λ × DH0 Γ Λ)} {w₁ w₂ w₃ : List Γ} : + SegLR M h₁ h₂ w₁ w₂ → SegLRs M ls w₂ w₃ → SegLRs M ((h₁, h₂) :: ls) w₁ w₃ + +/-- 2D longitudinal space-time tile relation (`segRLs` in `busycoq`): transforms a left-boundary +signal sequence `ls₁` into a right-boundary signal sequence `ls₂` while evolving the finite tape +segment from `w₁` to `w₂`. -/ +inductive SegRLs (M : Machine Γ Λ) : + List (DH0 Γ Λ × DH0 Γ Λ) → List (DH0 Γ Λ × DH0 Γ Λ) → List Γ → List Γ → Prop where + | nil (w : List Γ) : SegRLs M [] [] w w + | cons {h₁ h₂ : DH0 Γ Λ} {ls₁ ls₂ : List (DH0 Γ Λ × DH0 Γ Λ)} {w₁ w₂ w₃ : List Γ} : + SegRL M h₁ h₂ w₁ w₂ → + SegRLs M ls₁ ls₂ w₂ w₃ → + SegRLs M ((h₁, h₂) :: ls₁) ls₂ w₁ w₃ + | lrcons {h₁ h₂ h₃ h₄ : DH0 Γ Λ} {ls₂ ls₃ ls₄ : List (DH0 Γ Λ × DH0 Γ Λ)} + {w₁ w₂ w₃ w₄ w₅ : List Γ} : + SegRR M h₁ h₃ w₁ w₃ → + SegLL M h₄ h₂ w₄ w₅ → + SegLRs M ls₂ w₃ w₄ → + SegRLs M ls₃ ls₄ w₅ w₂ → + SegRLs M ((h₁, h₂) :: ls₃) (lrcons h₃ ls₂ h₄ ++ ls₄) w₁ w₂ + +/-- Auxiliary left-exit longitudinal tile relation (`segLLs` in `busycoq`) used by the reflective +tile verifier. -/ +inductive SegLLs (M : Machine Γ Λ) : + DH0 Γ Λ → List (DH0 Γ Λ × DH0 Γ Λ) → DH0 Γ Λ → List (DH0 Γ Λ × DH0 Γ Λ) → + List Γ → List Γ → Prop where + | intro {ls₂ ls₃ ls₄ ls₂' : List (DH0 Γ Λ × DH0 Γ Λ)} {w₂ w₃ w₄ w₅ : List Γ} + {h₂ h₄ h₄' : DH0 Γ Λ} : + SegLRs M ls₂ w₃ w₄ → + SegLL M h₄ h₂ w₄ w₅ → + SegRLs M ls₃ ls₄ w₅ w₂ → + rcons ls₂ h₄ = (h₄', ls₂') → + SegLLs M h₂ ls₃ h₄' (ls₂' ++ ls₄) w₃ w₂ + +-- ============================================================================ +-- 5. Horizontal & Vertical Composition, Splitting & Wall Laws +-- ============================================================================ + +theorem SideRLs.single {M : Machine Γ Λ} {h₁ h₂ : DH0 Γ Λ} {r₁ r₂ : ListBlank Γ} + (h : SideRL M h₁ h₂ r₁ r₂) : SideRLs M [(h₁, h₂)] r₁ r₂ := + .cons h (.nil r₂) + +theorem SideRLs.elim_single {M : Machine Γ Λ} {hR hL : DH0 Γ Λ} {r r' : ListBlank Γ} + (h : SideRLs M [(hR, hL)] r r') (l : ListBlank Γ) : + (toDHCfg (hR, .right) l r) [M]⊢⁺ (toDHCfg (hL, .left) l r') := by + cases h with + | cons h₁ h₂ => + cases h₂ + exact h₁ l + +theorem SideRLs.elim_single_left {M : Machine Γ Λ} {hR hL : DH0 Γ Λ} {l l' : ListBlank Γ} + (h : SideRLs (flipTM M) [(hL, hR)] l l') (r : ListBlank Γ) : + (toDHCfg (hL, .left) l r) [M]⊢⁺ (toDHCfg (hR, .right) l' r) := + toDHCfg_stepPlus_unflip (h.elim_single r) + +theorem SideRLs.trans {M : Machine Γ Λ} {ls₁ ls₂ : List (DH0 Γ Λ × DH0 Γ Λ)} + {r₁ r₂ r₃ : ListBlank Γ} + (h₁ : SideRLs M ls₁ r₁ r₂) (h₂ : SideRLs M ls₂ r₂ r₃) : + SideRLs M (ls₁ ++ ls₂) r₁ r₃ := by + induction h₁ with + | nil _ => exact h₂ + | cons hs _ ih => exact .cons hs (ih h₂) + +theorem SideRLs.split {M : Machine Γ Λ} {ls₁ ls₂ : List (DH0 Γ Λ × DH0 Γ Λ)} + {r₁ r₂ : ListBlank Γ} + (h : SideRLs M (ls₁ ++ ls₂) r₁ r₂) : + ∃ r₃, SideRLs M ls₁ r₁ r₃ ∧ SideRLs M ls₂ r₃ r₂ := by + induction ls₁ generalizing r₁ with + | nil => exact ⟨r₁, .nil r₁, h⟩ + | cons ab ls₁ ih => + cases h with + | cons h_first h_rest => + obtain ⟨r₃, h₁, h₂⟩ := ih h_rest + exact ⟨r₃, .cons h_first h₁, h₂⟩ + +theorem SideRLs.trans_add {M : Machine Γ Λ} {h : List (DH0 Γ Λ × DH0 Γ Λ)} {n₁ n₂ : ℕ} + {r₁ r₂ r₃ : ListBlank Γ} + (h₁ : SideRLs M (h ^ n₁) r₁ r₃) (h₂ : SideRLs M (h ^ n₂) r₃ r₂) : + SideRLs M (h ^ (n₁ + n₂)) r₁ r₂ := by + rw [pow_add_list] + exact h₁.trans h₂ + +theorem SideRLs.trans_succ {M : Machine Γ Λ} {h : List (DH0 Γ Λ × DH0 Γ Λ)} {n : ℕ} + {r₁ r₂ r₃ : ListBlank Γ} + (h₁ : SideRLs M (h ^ n) r₁ r₃) (h₂ : SideRLs M h r₃ r₂) : + SideRLs M (h ^ (n + 1)) r₁ r₂ := by + rw [ ← pow_one_list h] at h₂ + exact h₁.trans_add h₂ + +theorem SideRLs.wall {M : Machine Γ Λ} {h : List (DH0 Γ Λ × DH0 Γ Λ)} {r : ListBlank Γ} + (hw : SideRLs M h r r) (k : ℕ) : + SideRLs M (h ^ k) r r := by + induction k with + | zero => exact .nil r + | succ k ih => exact hw.trans ih + +theorem SegLRs.app {M : Machine Γ Λ} {ls : List (DH0 Γ Λ × DH0 Γ Λ)} {w₁ w₂ : List Γ} + (h : SegLRs M ls w₁ w₂) (w₃ : List Γ) : + SegLRs M ls (w₁ ++ w₃) (w₂ ++ w₃) := by + induction h with + | nil _ => exact .nil _ + | cons h_lr _ ih => + refine .cons (fun l r => ?_) ih + rw [append_assoc, append_assoc] + exact h_lr (w₃ +> l) r + +theorem SegLRs.trans {M : Machine Γ Λ} {ls₁ ls₂ : List (DH0 Γ Λ × DH0 Γ Λ)} + {w₁ w₂ w₃ : List Γ} + (h₁ : SegLRs M ls₁ w₁ w₂) (h₂ : SegLRs M ls₂ w₂ w₃) : + SegLRs M (ls₁ ++ ls₂) w₁ w₃ := by + induction h₁ with + | nil _ => exact h₂ + | cons h_lr _ ih => exact .cons h_lr (ih h₂) + +theorem SegRLs.trans {M : Machine Γ Λ} {ls₁ ls₂ ls₃ ls₄ : List (DH0 Γ Λ × DH0 Γ Λ)} + {w₁ w₂ w₃ : List Γ} + (h₁ : SegRLs M ls₁ ls₂ w₁ w₂) (h₂ : SegRLs M ls₃ ls₄ w₂ w₃) : + SegRLs M (ls₁ ++ ls₃) (ls₂ ++ ls₄) w₁ w₃ := by + induction h₁ generalizing ls₃ ls₄ w₃ with + | nil _ => exact h₂ + | cons h_rl _ ih => exact .cons h_rl (ih h₂) + | lrcons h_rr h_ll h_lrs _ ih => + rw [List.append_assoc] + exact .lrcons h_rr h_ll h_lrs (ih h₂) + +theorem SegRLs.split {M : Machine Γ Λ} {ls₁ ls₂ ls₃ : List (DH0 Γ Λ × DH0 Γ Λ)} + {w₁ w₂ : List Γ} + (h : SegRLs M (ls₁ ++ ls₂) ls₃ w₁ w₂) : + ∃ ls₄ ls₅ w₃, + SegRLs M ls₁ ls₄ w₁ w₃ ∧ + SegRLs M ls₂ ls₅ w₃ w₂ ∧ + ls₃ = ls₄ ++ ls₅ := by + induction ls₁ generalizing ls₃ w₁ with + | nil => exact ⟨[], ls₃, w₁, .nil w₁, h, rfl⟩ + | cons ab ls₁ ih => + cases h with + | cons h_rl h_rest => + obtain ⟨ls₄, ls₅, w₃, h₁, h₂, rfl⟩ := ih h_rest + exact ⟨ls₄, ls₅, w₃, .cons h_rl h₁, h₂, rfl⟩ + | lrcons h_rr h_ll h_lrs h_rest => + obtain ⟨ls₄, ls₅, w₃, h₁, h₂, rfl⟩ := ih h_rest + exact ⟨Longitudinal.lrcons _ _ _ ++ ls₄, ls₅, w₃, .lrcons h_rr h_ll h_lrs h₁, h₂, + by rw [List.append_assoc]⟩ + +private theorem segRLs_concat_aux' {M : Machine Γ Λ} + {h₂ h₃ h₄ : DH0 Γ Λ} {w₂ w₃ w₄ w₅ w₆ : List Γ} + {ls₁ ls₂ : List (DH0 Γ Λ × DH0 Γ Λ)} + (hll : SegLL M h₄ h₂ w₄ w₂) + (hlr : SegLRs M ls₁ w₃ w₄) + (hrl : SegRLs M (lrcons h₃ ls₁ h₄) ls₂ w₅ w₆) : + ((∀ l r, (toDHCfg (h₃, .right) (w₃ +> l) (w₅ +> r)) [M]⊢⁺ + (toDHCfg (h₂, .left) l (w₂ +> (w₆ +> r)))) ∧ ls₂ = []) ∨ + ∃ h₅ h₆ w₇ w₈ ls₂', + (∀ l r, (toDHCfg (h₃, .right) (w₃ +> l) (w₅ +> r)) [M]⊢* + (toDHCfg (h₅, .right) (w₇ +> l) r)) ∧ + SegLL M h₆ h₂ w₈ (w₂ ++ w₆) ∧ + SegLRs M ls₂' w₇ w₈ ∧ + ls₂ = lrcons h₅ ls₂' h₆ := by + induction hlr generalizing h₃ w₅ w₆ ls₂ with + | nil w₃ => + cases hrl with + | cons h_rl h_tail => + cases h_tail + refine Or.inl ⟨fun l r => ?_, rfl⟩ + exact stepPlus_stepStar_trans (h_rl (w₃ +> l) r) (hll l (w₆ +> r)) + | lrcons h_rr h_ll h_lrs h_tail => + cases h_tail + refine Or.inr ⟨_, _, _ ++ w₃, _ ++ w₃, _, ?_, ?_, h_lrs.app w₃, List.append_nil _⟩ + · intro l r + rw [append_assoc] + exact h_rr (w₃ +> l) r + · intro l r + rw [append_assoc, append_assoc] + exact stepStar_trans (h_ll (w₃ +> l) r) (hll l (w₆ +> r)) + | @cons a b ls₁ w₃ w_mid w₄ h_lr hlr_rest ih => + cases hrl with + | cons h_rl hrl_rest => + rcases ih hll hrl_rest with ⟨h_step, rfl⟩ | ⟨h₅', h₆', w₇', w₈', ls₂', h_step, h_ll', h_lrs', + h_eq⟩ + · refine Or.inl ⟨fun l r => ?_, rfl⟩ + exact stepPlus_trans + (stepPlus_stepStar_trans (h_rl (w₃ +> l) r) (h_lr l (_ +> r))) + (h_step l r) + · refine Or.inr ⟨h₅', h₆', w₇', w₈', ls₂', fun l r => ?_, h_ll', h_lrs', h_eq⟩ + exact stepStar_trans + (stepPlus_to_stepStar (stepPlus_stepStar_trans (h_rl (w₃ +> l) r) (h_lr l (_ +> r)))) + (h_step l r) + | lrcons h_rr h_ll h_lrs hrl_rest => + rcases ih hll hrl_rest with ⟨h_step, rfl⟩ | ⟨h₅', h₆', w₇', w₈', ls₂', h_step, h_ll', h_lrs', + rfl⟩ + · refine Or.inr ⟨_, _, _ ++ w₃, _ ++ w₃, _, ?_, ?_, h_lrs.app w₃, List.append_nil _⟩ + · intro l r + rw [append_assoc] + exact h_rr (w₃ +> l) r + · intro l r + rw [append_assoc, append_assoc] + exact stepStar_trans (h_ll (w₃ +> l) r) + (stepStar_trans (h_lr l (_ +> r)) (stepPlus_to_stepStar (h_step l r))) + · have h_lrs'' := (h_lrs.app w₃).trans (.cons (fun l r => by + rw [append_assoc] + exact stepStar_trans (h_ll (w₃ +> l) r) + (stepStar_trans (h_lr l (_ +> r)) (h_step l r))) h_lrs') + refine Or.inr ⟨_, h₆', _, w₈', _, ?_, h_ll', h_lrs'', lrcons_app _ _ _ _ _ _⟩ + intro l r + rw [append_assoc] + exact h_rr (w₃ +> l) r + +private theorem segRLs_concat_aux {M : Machine Γ Λ} + {h₁ h₂ h₃ h₄ : DH0 Γ Λ} {w₁ w₂ w₃ w₄ w₅ w₆ : List Γ} + {ls₁ ls₂ : List (DH0 Γ Λ × DH0 Γ Λ)} + (hrr : SegRR M h₁ h₃ w₁ w₃) + (hll : SegLL M h₄ h₂ w₄ w₂) + (hlr : SegLRs M ls₁ w₃ w₄) + (hrl : SegRLs M (lrcons h₃ ls₁ h₄) ls₂ w₅ w₆) : + (SegRL M h₁ h₂ (w₁ ++ w₅) (w₂ ++ w₆) ∧ ls₂ = []) ∨ + ∃ h₅ h₆ w₇ w₈ ls₂', + SegRR M h₁ h₅ (w₁ ++ w₅) w₇ ∧ + SegLL M h₆ h₂ w₈ (w₂ ++ w₆) ∧ + SegLRs M ls₂' w₇ w₈ ∧ + ls₂ = lrcons h₅ ls₂' h₆ := by + rcases segRLs_concat_aux' hll hlr hrl with ⟨h_step, rfl⟩ | ⟨h₅, h₆, w₇, w₈, ls₂', h_step, h_ll', + h_lrs', h_eq⟩ + · refine Or.inl ⟨fun l r => ?_, rfl⟩ + rw [append_assoc, append_assoc] + exact stepStar_stepPlus_trans (hrr l (w₅ +> r)) (h_step l r) + · refine Or.inr ⟨h₅, h₆, w₇, w₈, ls₂', fun l r => ?_, h_ll', h_lrs', h_eq⟩ + rw [append_assoc] + exact stepStar_trans (hrr l (w₅ +> r)) (h_step l r) + +/-- Horizontal composition of two 2D longitudinal space-time tiles (`segRLs_concat` in `busycoq`). +-/ +theorem SegRLs.concat {M : Machine Γ Λ} {ls₁ ls₂ ls₃ : List (DH0 Γ Λ × DH0 Γ Λ)} + {w₁ w₂ w₃ w₄ : List Γ} + (h₁ : SegRLs M ls₁ ls₂ w₁ w₂) (h₂ : SegRLs M ls₂ ls₃ w₃ w₄) : + SegRLs M ls₁ ls₃ (w₁ ++ w₃) (w₂ ++ w₄) := by + induction h₁ generalizing ls₃ w₃ w₄ with + | nil _ => + cases h₂ + exact .nil _ + | cons h_rl _ ih => + refine .cons (fun l r => ?_) (ih h₂) + rw [append_assoc, append_assoc] + exact h_rl l (w₃ +> r) + | lrcons h_rr h_ll h_lrs _ ih => + obtain ⟨ls₅, ls₆, w_mid, h₂_left, h₂_right, rfl⟩ := h₂.split + have ih_res := ih h₂_right + rcases segRLs_concat_aux h_rr h_ll h_lrs h₂_left with + ⟨h_rl, rfl⟩ | ⟨h₅, h₆, w₇, w₈, ls₂', h_rr', h_ll', h_lrs', rfl⟩ + · exact .cons h_rl ih_res + · exact .lrcons h_rr' h_ll' h_lrs' ih_res + +/-- Combine a left-to-right segment bounce sequence `SegLRs` with a right half-tape reflection +sequence `SideRLs`. -/ +theorem SideRLs.segLRs_concat {M : Machine Γ Λ} {ls : List (DH0 Γ Λ × DH0 Γ Λ)} + {h₁ h₂ : DH0 Γ Λ} {w₁ w₂ : List Γ} {r₁ r₂ : ListBlank Γ} + (h_seg : SegLRs M ls w₁ w₂) + (h_side : SideRLs M (lrcons h₁ ls h₂) r₁ r₂) + (l : ListBlank Γ) : + (toDHCfg (h₁, .right) (w₁ +> l) r₁) [M]⊢⁺ (toDHCfg (h₂, .left) (w₂ +> l) r₂) := by + induction h_seg generalizing h₁ h₂ r₁ r₂ with + | nil w => + exact h_side.elim_single (w +> l) + | cons h_lr _ ih => + cases h_side with + | cons h_first h_rest => + exact stepPlus_trans + (stepPlus_stepStar_trans (h_first (_ +> l)) (h_lr l _)) + (ih h_rest) + +/-- Act on a right half-tape reflection `SideRLs M ls₂ r₁ r₂` by prepending a 2D longitudinal tile +`SegRLs M ls₁ ls₂ w₁ w₂` (`segRLs_sideRLs_concat` in `busycoq`). -/ +theorem SegRLs.sideRLs_concat {M : Machine Γ Λ} {ls₁ ls₂ : List (DH0 Γ Λ × DH0 Γ Λ)} + {w₁ w₂ : List Γ} {r₁ r₂ : ListBlank Γ} + (h_seg : SegRLs M ls₁ ls₂ w₁ w₂) + (h_side : SideRLs M ls₂ r₁ r₂) : + SideRLs M ls₁ (w₁ +> r₁) (w₂ +> r₂) := by + induction h_seg generalizing r₁ r₂ with + | nil _ => + cases h_side + exact .nil _ + | cons h_rl _ ih => + exact .cons (fun l => h_rl l r₁) (ih h_side) + | lrcons h_rr h_ll h_lrs _ ih => + obtain ⟨r_mid, h_side_left, h_side_right⟩ := h_side.split + refine .cons (fun l => ?_) (ih h_side_right) + exact stepStar_stepPlus_trans (h_rr l r₁) + (stepPlus_stepStar_trans (h_side_left.segLRs_concat h_lrs l) (h_ll l r_mid)) + +/-- Glue a mirrored left-half-tape reflection `SideRLs (flipTM M)` with a right-half-tape reflection +`SideRLs M` into a full-tape `⊢⁺` transition (`sideRLs_concat` in `busycoq`). -/ +theorem SideRLs.concat {M : Machine Γ Λ} {h₁ h₂ : DH0 Γ Λ} + {ls : List (DH0 Γ Λ × DH0 Γ Λ)} {l₁ l₂ r₁ r₂ : ListBlank Γ} + (hl : SideRLs (flipTM M) ls l₁ l₂) + (hr : SideRLs M (lrcons h₁ ls h₂) r₁ r₂) : + (toDHCfg (h₁, .right) l₁ r₁) [M]⊢⁺ (toDHCfg (h₂, .left) l₂ r₂) := by + induction ls generalizing h₁ h₂ l₁ l₂ r₁ r₂ with + | nil => + cases hl + exact hr.elim_single l₁ + | cons ab ls ih => + rcases ab with ⟨a, b⟩ + cases hl with + | cons hl_first hl_rest => + cases hr with + | cons hr_first hr_rest => + exact stepPlus_trans (hr_first l₁) + (stepPlus_trans (toDHCfg_stepPlus_unflip (hl_first _)) (ih hl_rest hr_rest)) + +/-- Left-entry dual of `SideRLs.concat` (`sideRLs_concat_L` in `busycoq`). -/ +theorem SideRLs.concat_L {M : Machine Γ Λ} {h₁ h₂ : DH0 Γ Λ} + {ls : List (DH0 Γ Λ × DH0 Γ Λ)} {l₁ l₂ r₁ r₂ : ListBlank Γ} + (hl : SideRLs (flipTM M) (lrcons h₁ ls h₂) l₁ l₂) + (hr : SideRLs M ls r₁ r₂) : + (toDHCfg (h₁, .left) l₁ r₁) [M]⊢⁺ (toDHCfg (h₂, .right) l₂ r₂) := by + have hr' : SideRLs (flipTM (flipTM M)) ls r₁ r₂ := by rwa [flipTM_flipTM] + exact toDHCfg_stepPlus_unflip (SideRLs.concat hr' hl) + +/-- Variant of `SideRLs.concat` using `lcons` exiting to the right (`sideRLs_concat_v2` in + `busycoq`). -/ +theorem SideRLs.concat_v2 {M : Machine Γ Λ} {h₁ h₂ : DH0 Γ Λ} + {ls ls' : List (DH0 Γ Λ × DH0 Γ Λ)} {l₁ l₂ r₁ r₂ : ListBlank Γ} + (hlc : lcons h₁ ls = (ls', h₂)) + (hne : ls ≠ []) + (hl : SideRLs (flipTM M) ls l₁ l₂) + (hr : SideRLs M ls' r₁ r₂) : + (toDHCfg (h₁, .right) l₁ r₁) [M]⊢⁺ (toDHCfg (h₂, .right) l₂ r₂) := by + induction ls generalizing h₁ h₂ ls' l₁ l₂ r₁ r₂ with + | nil => exact absurd rfl hne + | cons ab ls ih => + rcases ab with ⟨a, b⟩ + dsimp [lcons] at hlc + rcases h_lcons : lcons b ls with ⟨ls'₀, h₂'⟩ + rw [h_lcons] at hlc + cases hlc + cases hl with + | cons hl_first hl_rest => + cases hr with + | cons hr_first hr_rest => + rcases ls with _ | ⟨cd, ls_tail⟩ + · injection h_lcons with h_nil h_eq + subst h_nil h_eq + cases hl_rest + cases hr_rest + exact stepPlus_trans (hr_first l₁) (toDHCfg_stepPlus_unflip (hl_first _)) + · have h_rec := ih h_lcons (List.cons_ne_nil cd ls_tail) hl_rest hr_rest + exact stepPlus_trans (hr_first l₁) + (stepPlus_trans (toDHCfg_stepPlus_unflip (hl_first _)) h_rec) + +/-- Left-entry dual of `SideRLs.concat_v2` (`sideRLs_concat_v2_L` in `busycoq`). -/ +theorem SideRLs.concat_v2_L {M : Machine Γ Λ} {h₁ h₂ : DH0 Γ Λ} + {ls ls' : List (DH0 Γ Λ × DH0 Γ Λ)} {l₁ l₂ r₁ r₂ : ListBlank Γ} + (hlc : lcons h₁ ls = (ls', h₂)) + (hne : ls ≠ []) + (hl : SideRLs (flipTM M) ls' l₁ l₂) + (hr : SideRLs M ls r₁ r₂) : + (toDHCfg (h₁, .left) l₁ r₁) [M]⊢⁺ (toDHCfg (h₂, .left) l₂ r₂) := by + have hr' : SideRLs (flipTM (flipTM M)) ls r₁ r₂ := by rwa [flipTM_flipTM] + exact toDHCfg_stepPlus_unflip (SideRLs.concat_v2 hlc hne hr' hl) + +/-- Equal-count ping-pong glue (`sideRLs_concat_1` in `busycoq`). -/ +theorem SideRLs.concat_1 {M : Machine Γ Λ} {hR hL : DH0 Γ Λ} {n : ℕ} + {l₁ l₂ r₁ r₂ : ListBlank Γ} + (hr : SideRLs M ([(hR, hL)] ^ n) r₁ r₂) + (hl : SideRLs (flipTM M) ([(hL, hR)] ^ n) l₁ l₂) : + (toDHCfg (hR, .right) l₁ r₁) [M]⊢* (toDHCfg (hR, .right) l₂ r₂) := by + rcases n with _ | n + · cases hr + cases hl + exact stepStar_refl M _ + · rw [← lrcons_same hR hL n] at hr + have h_split : [(hL, hR)] ^ (n + 1) = [(hL, hR)] ^ n ++ [(hL, hR)] := by + rw [pow_add_list, pow_one_list] + rw [h_split] at hl + obtain ⟨l₃, hl₁, hl₂⟩ := hl.split + exact stepStar_trans + (stepPlus_to_stepStar (SideRLs.concat hl₁ hr)) + (stepPlus_to_stepStar (hl₂.elim_single_left r₂)) + +/-- Left-entry equal-count ping-pong glue (`sideRLs_concat_1L` in `busycoq`). -/ +theorem SideRLs.concat_1L {M : Machine Γ Λ} {hR hL : DH0 Γ Λ} {n : ℕ} + {l₁ l₂ r₁ r₂ : ListBlank Γ} + (hr : SideRLs M ([(hR, hL)] ^ n) r₁ r₂) + (hl : SideRLs (flipTM M) ([(hL, hR)] ^ n) l₁ l₂) : + (toDHCfg (hL, .left) l₁ r₁) [M]⊢* (toDHCfg (hL, .left) l₂ r₂) := by + have hr' : SideRLs (flipTM (flipTM M)) ([(hR, hL)] ^ n) r₁ r₂ := by rwa [flipTM_flipTM] + exact toDHCfg_stepStar_unflip (SideRLs.concat_1 hl hr') + +theorem SegRLs.empty (M : Machine Γ Λ) (ls : List (DH0 Γ Λ × DH0 Γ Λ)) : + SegRLs M ls ls [] [] := by + induction ls with + | nil => exact .nil [] + | cons ab ls ih => + rcases ab with ⟨a, b⟩ + exact .lrcons (fun l r => stepStar_refl M _) (fun l r => stepStar_refl M _) (.nil []) ih + +theorem SegRLs.S' {M : Machine Γ Λ} {h₁ h₂ h₃ h₄ : DH0 Γ Λ} + {ls₁ ls₂ : List (DH0 Γ Λ × DH0 Γ Λ)} {w₁ w₂ w₃ w₄ : List Γ} + (h_rr : SegRR M h₁ h₃ w₁ w₂) + (h_ll : SegLL M h₄ h₂ w₂ w₃) + (h_rest : SegRLs M ls₁ ls₂ w₃ w₄) : + SegRLs M ((h₁, h₂) :: ls₁) ((h₃, h₄) :: ls₂) w₁ w₄ := + .lrcons h_rr h_ll (.nil w₂) h_rest + +theorem SegRLs.wall {M : Machine Γ Λ} {h₁ h₂ : DH0 Γ Λ} {w w' : List Γ} + (h_rr : SegRR M h₁ h₁ w w') (h_ll : SegLL M h₂ h₂ w' w) (n : ℕ) : + SegRLs M ([(h₁, h₂)] ^ n) ([(h₁, h₂)] ^ n) w w := by + induction n with + | zero => exact .nil w + | succ n ih => exact .S' h_rr h_ll ih + +theorem SegRLs.wall' {M : Machine Γ Λ} {h₁ h₂ h₁' h₂' : DH0 Γ Λ} {w w' : List Γ} + (h_rr : SegRR M h₁ h₁' w w') (h_ll : SegLL M h₂' h₂ w' w) (n : ℕ) : + SegRLs M ([(h₁, h₂)] ^ n) ([(h₁', h₂')] ^ n) w w := by + induction n with + | zero => exact .nil w + | succ n ih => exact .S' h_rr h_ll ih + +theorem SegRLs.wall_pow {M : Machine Γ Λ} {h₁ h₂ : List (DH0 Γ Λ × DH0 Γ Λ)} {w : List Γ} + (hw : SegRLs M h₁ h₂ w w) (n : ℕ) : + SegRLs M (h₁ ^ n) (h₂ ^ n) w w := by + induction n with + | zero => exact .nil w + | succ n ih => exact hw.trans ih + +theorem SegRLs.trans_add {M : Machine Γ Λ} {h h' : List (DH0 Γ Λ × DH0 Γ Λ)} + {n₁ n₂ n₁' n₂' : ℕ} {w₁ w₂ w₃ : List Γ} + (h₁ : SegRLs M (h ^ n₁) (h' ^ n₁') w₁ w₃) + (h₂ : SegRLs M (h ^ n₂) (h' ^ n₂') w₃ w₂) : + SegRLs M (h ^ (n₁ + n₂)) (h' ^ (n₁' + n₂')) w₁ w₂ := by + rw [pow_add_list, pow_add_list] + exact h₁.trans h₂ + +theorem SegRLs.addmul {M : Machine Γ Λ} {h : List (DH0 Γ Λ × DH0 Γ Λ)} + {a x b c : ℕ} {w₁ w₂ : List Γ} + (hb : SegRLs M (h ^ b) (h ^ c) w₁ w₂) + (ha : SegRLs M (h ^ a) h w₂ w₂) : + SegRLs M (h ^ (x * a + b)) (h ^ (x + c)) w₁ w₂ := by + rw [Nat.add_comm (x * a) b, Nat.add_comm x c, pow_add_list, pow_add_list] + refine hb.trans ?_ + induction x with + | zero => + simp only [Nat.zero_mul, pow_zero_list] + exact .nil w₂ + | succ x ih => + have h₁ : (x + 1) * a = a + x * a := by rw [Nat.succ_mul, Nat.add_comm] + have h₂ : x + 1 = 1 + x := by omega + rw [h₁, h₂, pow_add_list, pow_add_list, pow_one_list] + exact ha.trans ih + +theorem SegRLs.addmul_v2 {M : Machine Γ Λ} {h : List (DH0 Γ Λ × DH0 Γ Λ)} + {a a' x b b' : ℕ} {w₁ w₂ : List Γ} + (hb : SegRLs M (h ^ b) (h ^ b') w₁ w₂) + (ha : SegRLs M (h ^ a) (h ^ a') w₂ w₂) : + SegRLs M (h ^ (x * a + b)) (h ^ (x * a' + b')) w₁ w₂ := by + rw [Nat.add_comm (x * a) b, Nat.add_comm (x * a') b', pow_add_list, pow_add_list] + refine hb.trans ?_ + induction x with + | zero => + simp only [Nat.zero_mul, pow_zero_list] + exact .nil w₂ + | succ x ih => + have h₁ : (x + 1) * a = a + x * a := by rw [Nat.succ_mul, Nat.add_comm] + have h₂ : (x + 1) * a' = a' + x * a' := by rw [Nat.succ_mul, Nat.add_comm] + rw [h₁, h₂, pow_add_list, pow_add_list] + exact ha.trans ih + +theorem SegRLs.of_segRR_segLLs {M : Machine Γ Λ} {ls₃ ls₄ : List (DH0 Γ Λ × DH0 Γ Λ)} + {w₁ w₂ w₃ : List Γ} {h₁ h₂ h₃ h₄ : DH0 Γ Λ} + (h_rr : SegRR M h₁ h₃ w₁ w₃) + (h_lls : SegLLs M h₂ ls₃ h₄ ls₄ w₃ w₂) : + SegRLs M ((h₁, h₂) :: ls₃) ((h₃, h₄) :: ls₄) w₁ w₂ := by + rcases h_lls with ⟨h_lrs, h_ll, h_rls, h_rc⟩ + cases h_lrs with + | nil _ => + injection h_rc with h_eq₁ h_eq₂ + subst h_eq₁ h_eq₂ + exact .lrcons h_rr h_ll (.nil _) h_rls + | cons h_lr h_lrs_tail => + injection h_rc with h_eq₁ h_eq₂ + subst h_eq₁ h_eq₂ + exact .lrcons h_rr h_ll (.cons h_lr h_lrs_tail) h_rls + +theorem SegLLs.of_segLR_segLLs {M : Machine Γ Λ} {ls₁ ls₂ : List (DH0 Γ Λ × DH0 Γ Λ)} + {w₁ w₂ w₃ : List Γ} {h₁ h₂ h₃ h₄ : DH0 Γ Λ} + (h_lr : SegLR M h₂ h₃ w₁ w₃) + (h_lls : SegLLs M h₁ ls₁ h₄ ls₂ w₃ w₂) : + SegLLs M h₁ ls₁ h₂ ((h₃, h₄) :: ls₂) w₁ w₂ := by + rcases h_lls with ⟨h_lrs, h_ll, h_rls, h_rc⟩ + cases h_lrs with + | nil _ => + injection h_rc with h₁' h₂' + subst h₁' h₂' + change SegLLs M h₁ ls₁ h₂ ([(h₃, _)] ++ _) w₁ w₂ + exact ⟨.cons h_lr (.nil _), h_ll, h_rls, rfl⟩ + | cons h_lr' h_lrs' => + injection h_rc with h₁' h₂' + subst h₁' h₂' + rw [← List.cons_append] + exact ⟨.cons h_lr (.cons h_lr' h_lrs'), h_ll, h_rls, rfl⟩ + +theorem SegLLs.of_segLL_segRLs {M : Machine Γ Λ} {ls₁ ls₂ : List (DH0 Γ Λ × DH0 Γ Λ)} + {w₁ w₂ w₃ : List Γ} {h₁ h₂ : DH0 Γ Λ} + (h_ll : SegLL M h₂ h₁ w₁ w₃) + (h_rls : SegRLs M ls₁ ls₂ w₃ w₂) : + SegLLs M h₁ ls₁ h₂ ls₂ w₁ w₂ := + ⟨.nil w₁, h_ll, h_rls, rfl⟩ + +-- ============================================================================ +-- 6. Halting Dual of the 2D Longitudinal Calculus (`SideRLsHalt`) +-- ============================================================================ + +private theorem haltsFrom_of_stepStar {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} + (h : c₁ [M]⊢* c₂) (hh : ∃ cfg, (c₂ [M]⊢* cfg) ∧ (step M cfg).isNone) : + ∃ cfg, (c₁ [M]⊢* cfg) ∧ (step M cfg).isNone := by + obtain ⟨cfg, hreach, hnone⟩ := hh + exact ⟨cfg, stepStar_trans h hreach, hnone⟩ + +/-- Companion predicate to `SideRLs` describing a finite right-boundary signal stream whose +execution halts while processing one of its signals (`sideRLs_halt` in `LongitudinalHalt.v`). -/ +inductive SideRLsHalt (M : Machine Γ Λ) : + List (DH0 Γ Λ × DH0 Γ Λ) → ListBlank Γ → Prop where + | here (hR hL : DH0 Γ Λ) (hs : List (DH0 Γ Λ × DH0 Γ Λ)) (r : ListBlank Γ) : + (∀ l, ∃ cfg, ((toDHCfg (hR, .right) l r) [M]⊢* cfg) ∧ (step M cfg).isNone) → + SideRLsHalt M ((hR, hL) :: hs) r + | next {hR hL : DH0 Γ Λ} {hs : List (DH0 Γ Λ × DH0 Γ Λ)} {r r' : ListBlank Γ} : + SideRL M hR hL r r' → + SideRLsHalt M hs r' → + SideRLsHalt M ((hR, hL) :: hs) r + +theorem SideRLsHalt.app_left {M : Machine Γ Λ} {hs₁ hs₂ : List (DH0 Γ Λ × DH0 Γ Λ)} + {r : ListBlank Γ} (h : SideRLsHalt M hs₁ r) : + SideRLsHalt M (hs₁ ++ hs₂) r := by + induction h with + | here hR hL hs r hh => exact .here hR hL (hs ++ hs₂) r hh + | next h_rl _ ih => exact .next h_rl ih + +theorem SideRLsHalt.app_right {M : Machine Γ Λ} {hs₁ hs₂ : List (DH0 Γ Λ × DH0 Γ Λ)} + {r r' : ListBlank Γ} (h₁ : SideRLs M hs₁ r r') (h₂ : SideRLsHalt M hs₂ r') : + SideRLsHalt M (hs₁ ++ hs₂) r := by + induction h₁ with + | nil _ => exact h₂ + | cons h_rl _ ih => exact .next h_rl (ih h₂) + +theorem SideRLsHalt.split {M : Machine Γ Λ} {hs₁ hs₂ : List (DH0 Γ Λ × DH0 Γ Λ)} + {r : ListBlank Γ} (h : SideRLsHalt M (hs₁ ++ hs₂) r) : + SideRLsHalt M hs₁ r ∨ ∃ r', SideRLs M hs₁ r r' ∧ SideRLsHalt M hs₂ r' := by + induction hs₁ generalizing r with + | nil => exact Or.inr ⟨r, .nil r, h⟩ + | cons ab hs₁ ih => + cases h with + | here hR hL _ r hh => exact Or.inl (.here hR hL hs₁ r hh) + | next h_rl h_rest => + rcases ih h_rest with h_left | ⟨r', h_side, h_halt⟩ + · exact Or.inl (.next h_rl h_left) + · exact Or.inr ⟨r', .cons h_rl h_side, h_halt⟩ + +theorem SideRLsHalt.segLRs_concat {M : Machine Γ Λ} {hs : List (DH0 Γ Λ × DH0 Γ Λ)} + {h₁ h₂ : DH0 Γ Λ} {w₁ w₂ : List Γ} {r : ListBlank Γ} + (h_seg : SegLRs M hs w₁ w₂) + (h_halt : SideRLsHalt M (lrcons h₁ hs h₂) r) + (l : ListBlank Γ) : + ∃ cfg, ((toDHCfg (h₁, .right) (w₁ +> l) r) [M]⊢* cfg) ∧ (step M cfg).isNone := by + induction h_seg generalizing h₁ h₂ r with + | nil _ => + cases h_halt with + | here _ _ _ _ hh => exact hh (_ +> l) + | next _ h_empty => cases h_empty + | cons h_lr _ ih => + cases h_halt with + | here _ _ _ _ hh => exact hh (_ +> l) + | next h_rl h_rest => + exact haltsFrom_of_stepStar + (stepPlus_to_stepStar (stepPlus_stepStar_trans (h_rl (_ +> l)) (h_lr l _))) + (ih h_rest) + +/-- Backward halting propagation across a 2D longitudinal tile (`segRLs_sideRLs_halt_concat` in +`LongitudinalHalt.v`): if a segment emits a signal stream `hs₂` that halts on `r`, then the input +signal stream `hs₁` halts on `w₁ +> r`. -/ +theorem SegRLs.sideRLsHalt_concat {M : Machine Γ Λ} {hs₁ hs₂ : List (DH0 Γ Λ × DH0 Γ Λ)} + {w₁ w₂ : List Γ} {r : ListBlank Γ} + (h_seg : SegRLs M hs₁ hs₂ w₁ w₂) + (h_halt : SideRLsHalt M hs₂ r) : + SideRLsHalt M hs₁ (w₁ +> r) := by + induction h_seg generalizing r with + | nil _ => cases h_halt + | cons h_rl _ ih => + exact .next (fun l => h_rl l r) (ih h_halt) + | lrcons h_rr h_ll h_lrs _ ih => + rcases h_halt.split with h_prefix | ⟨r', h_prefix, h_suffix⟩ + · refine .here _ _ _ _ (fun l => ?_) + exact haltsFrom_of_stepStar (h_rr l r) (h_prefix.segLRs_concat h_lrs l) + · refine .next (fun l => ?_) (ih h_suffix) + exact stepStar_stepPlus_trans (h_rr l r) + (stepPlus_stepStar_trans (h_prefix.segLRs_concat h_lrs l) (h_ll l r')) + +theorem SideRLsHalt.elim_single {M : Machine Γ Λ} {hR hL : DH0 Γ Λ} {r : ListBlank Γ} + (h : SideRLsHalt M [(hR, hL)] r) (l : ListBlank Γ) : + ∃ cfg, ((toDHCfg (hR, .right) l r) [M]⊢* cfg) ∧ (step M cfg).isNone := by + cases h with + | here _ _ _ _ hh => exact hh l + | next _ h_empty => cases h_empty + +/-- Glue a mirrored left-half-tape reflection `SideRLs (flipTM M)` with a halting right-half-tape +signal stream `SideRLsHalt M` to prove halting of the full configuration. -/ +theorem SideRLsHalt.concat {M : Machine Γ Λ} {h₁ h₂ : DH0 Γ Λ} + {ls : List (DH0 Γ Λ × DH0 Γ Λ)} {l₁ l₂ r₁ : ListBlank Γ} + (hl : SideRLs (flipTM M) ls l₁ l₂) + (hr : SideRLsHalt M (lrcons h₁ ls h₂) r₁) : + ∃ cfg, ((toDHCfg (h₁, .right) l₁ r₁) [M]⊢* cfg) ∧ (step M cfg).isNone := by + induction ls generalizing h₁ h₂ l₁ r₁ with + | nil => + exact hr.elim_single l₁ + | cons ab ls ih => + rcases ab with ⟨a, b⟩ + cases hl with + | cons hl_first hl_rest => + cases hr with + | here _ _ _ _ hh => exact hh l₁ + | next hr_first hr_rest => + exact haltsFrom_of_stepStar + (stepPlus_to_stepStar + (stepPlus_trans (hr_first l₁) (toDHCfg_stepPlus_unflip (hl_first _)))) + (ih hl_rest hr_rest) + +-- ============================================================================ +-- 7. Unary & Binary Counter Tile Libraries (`UC1`, `UC2`, `UC3`, `BCR`, `BC`) +-- ============================================================================ + +namespace UC1 + +theorem incs {M : Machine Γ Λ} {hR hL : DH0 Γ Λ} {w₀ w₁ w₁' : List Γ} + (h_inc : SegRL M hR hL w₀ w₁) + (h_ov : SegRR M hR hR w₁ w₁') + (h_rst : SegLL M hL hL w₁' w₁) + (n m : ℕ) : + SegRLs M ([(hR, hL)] ^ (n + m)) ([(hR, hL)] ^ m) (w₀ ^ n) (w₁ ^ n) := by + induction n with + | zero => + simp only [Nat.zero_add, pow_zero_list] + exact SegRLs.empty M _ + | succ n ih => + rw [Nat.succ_add, pow_succ_list, pow_succ_list, pow_succ_list] + refine .cons (fun l r => ?_) ((SegRLs.wall h_ov h_rst _).concat ih) + rw [append_assoc, append_assoc] + exact h_inc l (w₀ ^ n +> r) + +theorem incs' {M : Machine Γ Λ} {hR hL : DH0 Γ Λ} {w₀ w₁ w₁' : List Γ} + (h_inc : SegRL M hR hL w₀ w₁) + (h_ov : SegRR M hR hR w₁ w₁') + (h_rst : SegLL M hL hL w₁' w₁) + (n : ℕ) : + SegRLs M ([(hR, hL)] ^ n) [] (w₀ ^ n) (w₁ ^ n) := + incs h_inc h_ov h_rst n 0 + +end UC1 + +namespace UC2 + +theorem incs {M : Machine Γ Λ} {hR hL : DH0 Γ Λ} {w₀ w₁ w₂ w₂' : List Γ} + (h_inc₀ : SegRL M hR hL w₀ w₁) + (h_inc₁ : SegRL M hR hL w₁ w₂) + (h_ov : SegRR M hR hR w₂ w₂') + (h_rst : SegLL M hL hL w₂' w₂) + (n m : ℕ) : + SegRLs M ([(hR, hL)] ^ (n * 2 + m)) ([(hR, hL)] ^ m) (w₀ ^ n) (w₂ ^ n) := by + induction n with + | zero => + simp only [Nat.zero_mul, Nat.zero_add, pow_zero_list] + exact SegRLs.empty M _ + | succ n ih => + have h_split : (n + 1) * 2 + m = (n * 2 + m) + 1 + 1 := by omega + rw [h_split, pow_succ_list, pow_succ_list, pow_succ_list w₀, pow_succ_list w₂] + have s₀ : SegRL M hR hL (w₀ ++ w₀ ^ n) (w₁ ++ w₀ ^ n) := fun l r => by + rw [append_assoc, append_assoc] + exact h_inc₀ l (w₀ ^ n +> r) + have s₁ : SegRL M hR hL (w₁ ++ w₀ ^ n) (w₂ ++ w₀ ^ n) := fun l r => by + rw [append_assoc, append_assoc] + exact h_inc₁ l (w₀ ^ n +> r) + exact .cons s₀ (.cons s₁ ((SegRLs.wall h_ov h_rst _).concat ih)) + +theorem incs' {M : Machine Γ Λ} {hR hL : DH0 Γ Λ} {w₀ w₁ w₂ w₂' : List Γ} + (h_inc₀ : SegRL M hR hL w₀ w₁) + (h_inc₁ : SegRL M hR hL w₁ w₂) + (h_ov : SegRR M hR hR w₂ w₂') + (h_rst : SegLL M hL hL w₂' w₂) + (n : ℕ) : + SegRLs M ([(hR, hL)] ^ (n * 2)) [] (w₀ ^ n) (w₂ ^ n) := + incs h_inc₀ h_inc₁ h_ov h_rst n 0 + +end UC2 + +namespace UC3 + +theorem incs {M : Machine Γ Λ} {hR hL : DH0 Γ Λ} {w₀ w₁ w₂ w₃ w₃' : List Γ} + (h_inc₀ : SegRL M hR hL w₀ w₁) + (h_inc₁ : SegRL M hR hL w₁ w₂) + (h_inc₂ : SegRL M hR hL w₂ w₃) + (h_ov : SegRR M hR hR w₃ w₃') + (h_rst : SegLL M hL hL w₃' w₃) + (n m : ℕ) : + SegRLs M ([(hR, hL)] ^ (n * 3 + m)) ([(hR, hL)] ^ m) (w₀ ^ n) (w₃ ^ n) := by + induction n with + | zero => + simp only [Nat.zero_mul, Nat.zero_add, pow_zero_list] + exact SegRLs.empty M _ + | succ n ih => + have h_split : (n + 1) * 3 + m = (n * 3 + m) + 1 + 1 + 1 := by omega + rw [h_split, pow_succ_list, pow_succ_list, pow_succ_list, pow_succ_list w₀, pow_succ_list w₃] + have s₀ : SegRL M hR hL (w₀ ++ w₀ ^ n) (w₁ ++ w₀ ^ n) := fun l r => by + rw [append_assoc, append_assoc] + exact h_inc₀ l (w₀ ^ n +> r) + have s₁ : SegRL M hR hL (w₁ ++ w₀ ^ n) (w₂ ++ w₀ ^ n) := fun l r => by + rw [append_assoc, append_assoc] + exact h_inc₁ l (w₀ ^ n +> r) + have s₂ : SegRL M hR hL (w₂ ++ w₀ ^ n) (w₃ ++ w₀ ^ n) := fun l r => by + rw [append_assoc, append_assoc] + exact h_inc₂ l (w₀ ^ n +> r) + exact .cons s₀ (.cons s₁ (.cons s₂ ((SegRLs.wall h_ov h_rst _).concat ih))) + +theorem incs' {M : Machine Γ Λ} {hR hL : DH0 Γ Λ} {w₀ w₁ w₂ w₃ w₃' : List Γ} + (h_inc₀ : SegRL M hR hL w₀ w₁) + (h_inc₁ : SegRL M hR hL w₁ w₂) + (h_inc₂ : SegRL M hR hL w₂ w₃) + (h_ov : SegRR M hR hR w₃ w₃') + (h_rst : SegLL M hL hL w₃' w₃) + (n : ℕ) : + SegRLs M ([(hR, hL)] ^ (n * 3)) [] (w₀ ^ n) (w₃ ^ n) := + incs h_inc₀ h_inc₁ h_inc₂ h_ov h_rst n 0 + +end UC3 + +namespace BCR + +theorem incs {M : Machine Γ Λ} {hR hL : DH0 Γ Λ} {d₀ d₁ d₁' : List Γ} + (h_lr : SegLR M hL hR d₀ d₁) + (h_carry : SegLL M hL hL d₁ d₁') + (h_ret : SegRR M hR hR d₁' d₀) + (n : ℕ) : + SegRLs M ([(hR, hL)] ^ n) ([(hR, hL)] ^ (n * 2)) d₁' d₁' := by + induction n with + | zero => exact .nil d₁' + | succ n ih => + have h_mul : (n + 1) * 2 = 2 + n * 2 := by omega + rw [pow_succ_list, h_mul, pow_add_list] + exact .lrcons h_ret h_carry (.cons h_lr (.nil d₁)) ih + +end BCR + +namespace BC + +theorem incs' {M : Machine Γ Λ} {hR hL : DH0 Γ Λ} {d₀ d₁ d₁' : List Γ} + (h_rl : SegRL M hR hL d₀ d₁) + (h_carry : SegRR M hR hR d₁ d₁') + (h_ret : SegLL M hL hL d₁' d₀) + (n : ℕ) : + SegRLs M ([(hR, hL)] ^ (n * 2 + 1)) ([(hR, hL)] ^ n) d₀ d₁ := by + induction n with + | zero => exact .cons h_rl (.nil d₁) + | succ n ih => + have h_eq : (n + 1) * 2 + 1 = 2 + (n * 2 + 1) := by omega + rw [h_eq, pow_add_list, pow_succ_list ([(hR, hL)]) n] + exact (SegRLs.cons h_rl (SegRLs.S' h_carry h_ret (.nil d₀))).trans ih + +theorem incsOvs {M : Machine Γ Λ} {hR hL : DH0 Γ Λ} {d₀ d₁ d₁' : List Γ} + (h_rl : SegRL M hR hL d₀ d₁) + (h_carry : SegRR M hR hR d₁ d₁') + (h_ret : SegLL M hL hL d₁' d₀) + (n m : ℕ) : + SegRLs M ([(hR, hL)] ^ ((n + 1) * 2 ^ m - 1)) ([(hR, hL)] ^ n) (d₀ ^ m) (d₁ ^ m) := by + induction m generalizing n with + | zero => + have h_eq : (n + 1) * 2 ^ 0 - 1 = n := by omega + rw [h_eq, pow_zero_list, pow_zero_list] + exact SegRLs.empty M _ + | succ m ih => + have h_pos : (n + 1) * 2 ^ m > 0 := Nat.mul_pos (Nat.succ_pos n) (Nat.two_pow_pos m) + have h_eq : (n + 1) * 2 ^ (m + 1) - 1 = ((n + 1) * 2 ^ m - 1) * 2 + 1 := by + rw [Nat.pow_succ, ← Nat.mul_assoc] + omega + rw [h_eq, pow_succ_list d₀, pow_succ_list d₁] + exact (incs' h_rl h_carry h_ret ((n + 1) * 2 ^ m - 1)).concat (ih n) + +theorem mul2 {M : Machine Γ Λ} {hR hL : DH0 Γ Λ} {d₀ d₁ d₁' : List Γ} + (h_rl : SegRL M hR hL d₀ d₁) + (h_carry : SegRR M hR hR d₁ d₁') + (h_ret : SegLL M hL hL d₁' d₀) + (n : ℕ) : + SegRLs M ([(hR, hL)] ^ (n * 2)) ([(hR, hL)] ^ n) d₁ d₁ := by + induction n with + | zero => exact .nil d₁ + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq, pow_add_list, pow_succ_list ([(hR, hL)]) n] + exact SegRLs.S' h_carry h_ret (.cons h_rl ih) + +theorem ovs {M : Machine Γ Λ} {hR hL : DH0 Γ Λ} {d₀ d₁ d₁' : List Γ} + (h_rl : SegRL M hR hL d₀ d₁) + (h_carry : SegRR M hR hR d₁ d₁') + (h_ret : SegLL M hL hL d₁' d₀) + (n m : ℕ) : + SegRLs M ([(hR, hL)] ^ (n * 2 ^ m)) ([(hR, hL)] ^ n) (d₁ ^ m) (d₁ ^ m) := by + induction m generalizing n with + | zero => + rw [Nat.pow_zero, Nat.mul_one] + exact SegRLs.empty M _ + | succ m ih => + have h_eq : n * 2 ^ (m + 1) = (n * 2 ^ m) * 2 := by + rw [Nat.pow_succ, Nat.mul_assoc] + rw [h_eq, pow_succ_list d₁] + exact (mul2 h_rl h_carry h_ret (n * 2 ^ m)).concat (ih n) + +theorem incs {M : Machine Γ Λ} {hR hL : DH0 Γ Λ} {d₀ d₁ d₁' : List Γ} + (h_rl : SegRL M hR hL d₀ d₁) + (h_carry : SegRR M hR hR d₁ d₁') + (h_ret : SegLL M hL hL d₁' d₀) + (n : ℕ) : + SegRLs M ([(hR, hL)] ^ (2 ^ n - 1)) [] (d₀ ^ n) (d₁ ^ n) := by + simpa using incsOvs h_rl h_carry h_ret 0 n + +theorem incsMul2 {M : Machine Γ Λ} {hR hL : DH0 Γ Λ} {d₀ d₁ d₁' : List Γ} + (h_rl : SegRL M hR hL d₀ d₁) + (h_carry : SegRR M hR hR d₁ d₁') + (h_ret : SegLL M hL hL d₁' d₀) + (n : ℕ) : + SegRLs M ([(hR, hL)] ^ (2 ^ n * 2 - 2)) [] (d₁ ++ d₀ ^ n) (d₁ ++ d₁ ^ n) := by + have h_pos : 2 ^ n > 0 := Nat.two_pow_pos n + have h_eq : 2 ^ n * 2 - 2 = (2 ^ n - 1) * 2 := by omega + rw [h_eq] + exact (mul2 h_rl h_carry h_ret (2 ^ n - 1)).concat (incs h_rl h_carry h_ret n) + +end BC + +-- ============================================================================ +-- 8. Parametric Shift-Overflow Binary Counter Closure (`SBC`) +-- ============================================================================ + +namespace SBC + +def RC0 (w u z : List Γ) (a n m : ℕ) : ListBlank Γ := + w ^ a +> (z +> (w ^ n +> (u ^ m +> default))) + +def RC1 (w v : List Γ) (a m : ℕ) : ListBlank Γ := + w ^ (a + 1) +> (v ^ m +> default) + +def RC2 (w u : List Γ) (a m : ℕ) : ListBlank Γ := + w ^ (a + 1) +> (u ^ m +> default) + +theorem RC2_head (w u : List Γ) (a m : ℕ) : + RC2 w u a m = w +> (w ^ a +> (u ^ m +> default)) := by + unfold RC2 + rw [pow_succ_list, append_assoc] + +/-- Parametric Shift-Overflow Binary Counter rule specification (`SBCv13.v`). -/ +structure Rules (M : Machine Γ Λ) (hR hL : DH0 Γ Λ) + (w u v z d₀ d₁ d₁' : List Γ) (dh : ListBlank Γ) : Prop where + rule_wall : SegRLs M ([(hR, hL)] ^ 2) ([(hR, hL)] ^ 2) w w + rule_pair : SegRLs M ([(hR, hL)] ^ 6) ([(hR, hL)] ^ 2) (z ++ w ++ w) (w ++ w ++ z) + rule_R : ∀ n m, SideRLs M ([(hR, hL)] ^ 6) (RC0 w u z 0 (2 + n) m) (RC0 w u z 2 n (1 + m)) + rule_U : ∀ m, SideRLs M ([(hR, hL)] ^ 4) (RC0 w u z 0 0 (1 + m)) (RC0 w u z 1 0 m) + rule_odd : ∀ m, SideRLs M ([(hR, hL)] ^ 2) (RC0 w u z 0 1 m) (RC1 w v 0 (1 + m)) + rule_V : ∀ m, SideRLs M ([(hR, hL)] ^ 2) (RC1 w v 0 (1 + m)) (RC1 w v 1 m) + rule_empty : SideRLs M ([(hR, hL)] ^ 4) (RC0 w u z 0 0 0) (RC2 w u 1 0) + rule_grow : ∀ m, SideRLs M ([(hR, hL)] ^ 2) (RC2 w u 0 m) (RC2 w u 0 (1 + m)) + rule_reset : ∀ k r, + (toDHCfg (hL, .left) (d₁ ^ (1 + k) +> dh) (w +> r)) [M]⊢* + (toDHCfg (hR, .right) (d₀ +> (d₁ +> (d₀ ^ k +> dh))) (z +> r)) + rule_zero : SegRL (flipTM M) hL hR d₀ d₁ + rule_carry : SegRR (flipTM M) hL hL d₁ d₁' + rule_return : SegLL (flipTM M) hR hR d₁' d₀ + +section WithRules + +variable {M : Machine Γ Λ} {hR hL : DH0 Γ Λ} {w u v z d₀ d₁ d₁' : List Γ} {dh : ListBlank Γ} + +def G (M : Machine Γ Λ) (hR hL : DH0 Γ Λ) (n : ℕ) (r s : ListBlank Γ) : Prop := + SideRLs M ([(hR, hL)] ^ n) r s + +def CfgAt (hR : DH0 Γ Λ) (d₀ d₁ : List Γ) (dh : ListBlank Γ) (k : ℕ) (r : ListBlank Γ) : + Cfg Γ Λ := + toDHCfg (hR, .right) (d₀ +> (d₁ +> (d₀ ^ k +> dh))) r + +def S (hR : DH0 Γ Λ) (w u z d₀ d₁ : List Γ) (dh : ListBlank Γ) (k n m : ℕ) : Cfg Γ Λ := + CfgAt hR d₀ d₁ dh k (RC0 w u z 0 n m) + +theorem G_add {a b : ℕ} {r s t : ListBlank Γ} + (h₁ : G M hR hL a r s) (h₂ : G M hR hL b s t) : + G M hR hL (a + b) r t := + SideRLs.trans_add h₁ h₂ + +theorem G_split {a b : ℕ} {r t : ListBlank Γ} + (h : G M hR hL (a + b) r t) : + ∃ s, G M hR hL a r s ∧ G M hR hL b s t := by + unfold G at h ⊢ + rw [pow_add_list] at h + exact h.split + +theorem wp (rules : Rules M hR hL w u v z d₀ d₁ d₁' dh) (n a : ℕ) : + SegRLs M ([(hR, hL)] ^ (n * 2)) ([(hR, hL)] ^ (n * 2)) (w ^ a) (w ^ a) := by + induction a with + | zero => exact SegRLs.empty M _ + | succ a ih => + rw [pow_succ_list w, Nat.mul_comm n 2, pow_mul_list] + exact (rules.rule_wall.wall_pow n).concat (by rw [← pow_mul_list, Nat.mul_comm 2 n]; exact ih) + +theorem G_w (rules : Rules M hR hL w u v z d₀ d₁ d₁' dh) (n a : ℕ) {r s : ListBlank Γ} + (h : G M hR hL (n * 2) r s) : + G M hR hL (n * 2) (w ^ a +> r) (w ^ a +> s) := + (wp rules n a).sideRLs_concat h + +theorem pair (rules : Rules M hR hL w u v z d₀ d₁ d₁' dh) (a : ℕ) : + SegRLs M ([(hR, hL)] ^ 6) ([(hR, hL)] ^ 2) (z ++ w ^ (2 + a)) (w ^ 2 ++ z ++ w ^ a) := by + have h₁ : z ++ w ^ (2 + a) = (z ++ w ++ w) ++ w ^ a := by + have h_add : 2 + a = a + 1 + 1 := by omega + rw [h_add, pow_succ_list, pow_succ_list, List.append_assoc, List.append_assoc] + have h₂ : w ^ 2 ++ z ++ w ^ a = (w ++ w ++ z) ++ w ^ a := by + change (w ++ (w ++ [])) ++ z ++ w ^ a = (w ++ w ++ z) ++ w ^ a + simp only [List.append_nil, List.append_assoc] + rw [h₁, h₂] + exact rules.rule_pair.concat (wp rules 1 a) + +theorem peel (rules : Rules M hR hL w u v z d₀ d₁ d₁' dh) (n a : ℕ) {r s : ListBlank Γ} + (h : G M hR hL (n * 2) r s) : + G M hR hL (n * 6) (z +> (w ^ (n * 2 + a) +> r)) (w ^ (n * 2) +> (z +> (w ^ a +> s))) := by + induction n generalizing r s with + | zero => + cases h + simp only [G, Nat.zero_mul, Nat.zero_add, pow_zero_list, append_nil] + exact .nil _ + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq] at h + obtain ⟨t, h₂, hn⟩ := G_split h + have h_eq6 : (n + 1) * 6 = 6 + n * 6 := by omega + rw [h_eq6] + refine G_add (s := w ^ 2 +> (z +> (w ^ (n * 2 + a) +> t))) ?_ ?_ + · have h_p := (pair rules (n * 2 + a)).sideRLs_concat h₂ + have h_lhs : (z ++ w ^ (2 + (n * 2 + a))) +> r = z +> (w ^ ((n + 1) * 2 + a) +> r) := by + rw [append_assoc, h_eq, Nat.add_assoc] + have h_rhs : (w ^ 2 ++ z ++ w ^ (n * 2 + a)) +> t = + w ^ 2 +> (z +> (w ^ (n * 2 + a) +> t)) := by + rw [List.append_assoc, append_assoc, append_assoc] + rwa [h_lhs, h_rhs] at h_p + · have h_rec := G_w rules (n * 3) 2 (by + have h3 : n * 3 * 2 = n * 6 := by omega + rw [h3] + exact ih hn) + have h3 : n * 3 * 2 = n * 6 := by omega + rw [h3, ← append_assoc (w ^ 2) (w ^ (n * 2)), ← pow_add_list, ← h_eq] at h_rec + exact h_rec + +theorem R_steps (rules : Rules M hR hL w u v z d₀ d₁ d₁' dh) (k a n m : ℕ) : + G M hR hL (k * 6) (RC0 w u z a (k * 2 + n) m) (RC0 w u z (a + k * 2) n (m + k)) := by + induction k generalizing a n m with + | zero => + simp only [Nat.zero_mul, Nat.zero_add, Nat.add_zero] + exact .nil _ + | succ k ih => + have h_eq : (k + 1) * 6 = 6 + k * 6 := by omega + rw [h_eq] + refine G_add (s := RC0 w u z (a + 2) (k * 2 + n) (1 + m)) ?_ ?_ + · have hw := G_w rules 3 a (rules.rule_R (k * 2 + n) m) + unfold RC0 at hw ⊢ + rw [← append_assoc (w ^ a) (w ^ 0), ← append_assoc (w ^ a) (w ^ 2), + ← pow_add_list, ← pow_add_list, Nat.add_zero] at hw + have h_k : (k + 1) * 2 + n = 2 + (k * 2 + n) := by omega + rwa [h_k] + · have ih' := ih (a + 2) n (1 + m) + have h₁ : a + 2 + k * 2 = a + (k + 1) * 2 := by omega + have h₂ : 1 + m + k = m + (k + 1) := by omega + rwa [h₁, h₂] at ih' + +theorem U_steps (rules : Rules M hR hL w u v z d₀ d₁ d₁' dh) (k a m : ℕ) : + G M hR hL (k * 4) (RC0 w u z a 0 (k + m)) (RC0 w u z (a + k) 0 m) := by + induction k generalizing a m with + | zero => + simp only [Nat.zero_mul, Nat.zero_add, Nat.add_zero] + exact .nil _ + | succ k ih => + have h_eq : (k + 1) * 4 = 4 + k * 4 := by omega + rw [h_eq] + refine G_add (s := RC0 w u z (a + 1) 0 (k + m)) ?_ ?_ + · have hw := G_w rules 2 a (rules.rule_U (k + m)) + unfold RC0 at hw ⊢ + rw [← append_assoc (w ^ a) (w ^ 0), ← append_assoc (w ^ a) (w ^ 1), + ← pow_add_list, ← pow_add_list, Nat.add_zero] at hw + have h_k : k + 1 + m = 1 + (k + m) := by omega + rwa [h_k] + · have ih' := ih (a + 1) m + have h₁ : a + 1 + k = a + (k + 1) := by omega + rwa [h₁] at ih' + +theorem V_steps (rules : Rules M hR hL w u v z d₀ d₁ d₁' dh) (k a m : ℕ) : + G M hR hL (k * 2) (RC1 w v a (k + m)) (RC1 w v (a + k) m) := by + induction k generalizing a m with + | zero => + simp only [Nat.zero_mul, Nat.zero_add, Nat.add_zero] + exact .nil _ + | succ k ih => + have h_eq : (k + 1) * 2 = 2 + k * 2 := by omega + rw [h_eq] + refine G_add (s := RC1 w v (a + 1) (k + m)) ?_ ?_ + · have hw := G_w rules 1 a (rules.rule_V (k + m)) + unfold RC1 at hw ⊢ + rw [← append_assoc (w ^ a) (w ^ (0 + 1)), ← append_assoc (w ^ a) (w ^ (1 + 1)), + ← pow_add_list, ← pow_add_list, Nat.zero_add] at hw + have h_k : k + 1 + m = 1 + (k + m) := by omega + have h_a : a + 1 + 1 = a + (1 + 1) := by omega + rwa [h_k, h_a] + · have ih' := ih (a + 1) m + have h₁ : a + 1 + k = a + (k + 1) := by omega + rwa [h₁] at ih' + +theorem grow_steps (rules : Rules M hR hL w u v z d₀ d₁ d₁' dh) (k a m : ℕ) : + G M hR hL (k * 2) (RC2 w u a m) (RC2 w u a (m + k)) := by + induction k generalizing m with + | zero => + simp only [Nat.zero_mul, Nat.add_zero] + exact .nil _ + | succ k ih => + have h_eq : (k + 1) * 2 = 2 + k * 2 := by omega + rw [h_eq] + refine G_add (s := RC2 w u a (1 + m)) ?_ ?_ + · have hw := G_w rules 1 a (rules.rule_grow m) + unfold RC2 at hw ⊢ + rw [← append_assoc (w ^ a) (w ^ (0 + 1)), ← append_assoc (w ^ a) (w ^ (0 + 1)), + ← pow_add_list, Nat.zero_add] at hw + exact hw + · have ih' := ih (1 + m) + have h₁ : 1 + m + k = m + (k + 1) := by omega + rwa [h₁] at ih' + +theorem normal_odd (rules : Rules M hR hL w u v z d₀ d₁ d₁' dh) (a n m t : ℕ) : + G M hR hL (n * 8 + m * 2 + 4 + t * 2) + (RC0 w u z a (n * 2 + 1) m) (RC2 w u (a + 1 + n * 3 + m) t) := by + have h_eq : n * 8 + m * 2 + 4 + t * 2 = n * 6 + (2 + ((1 + m + n) * 2 + t * 2)) := by omega + rw [h_eq] + refine G_add (R_steps rules n a 1 m) (G_add (s := RC1 w v (a + n * 2) (1 + m + n)) ?_ ?_) + · have hw := G_w rules 1 (a + n * 2) (rules.rule_odd (m + n)) + unfold RC0 RC1 at hw ⊢ + rw [← append_assoc (w ^ (a + n * 2)) (w ^ 0), + ← append_assoc (w ^ (a + n * 2)) (w ^ (0 + 1)), + ← pow_add_list, ← pow_add_list, Nat.add_zero, Nat.zero_add, + ← Nat.add_assoc 1 m n] at hw + exact hw + · refine G_add (s := RC1 w v (a + n * 2 + (1 + m + n)) 0) ?_ ?_ + · have hv := V_steps rules (1 + m + n) (a + n * 2) 0 + rwa [Nat.add_zero] at hv + · have h_rc : RC1 w v (a + n * 2 + (1 + m + n)) 0 = RC2 w u (a + 1 + n * 3 + m) 0 := by + unfold RC1 RC2 + have h_idx : a + n * 2 + (1 + m + n) + 1 = a + 1 + n * 3 + m + 1 := by omega + rw [h_idx, pow_zero_list, pow_zero_list] + rw [h_rc] + have hg := grow_steps rules t (a + 1 + n * 3 + m) 0 + rwa [Nat.zero_add] at hg + +theorem normal_even (rules : Rules M hR hL w u v z d₀ d₁ d₁' dh) (a n m t : ℕ) : + G M hR hL (n * 10 + m * 4 + 4 + t * 2) + (RC0 w u z a (n * 2) m) (RC2 w u (a + 1 + n * 3 + m) t) := by + have h_eq : n * 10 + m * 4 + 4 + t * 2 = n * 6 + ((m + n) * 4 + (4 + t * 2)) := by omega + rw [h_eq] + have hR0 := R_steps rules n a 0 m + rw [Nat.add_zero] at hR0 + refine G_add hR0 (G_add (s := RC0 w u z (a + n * 2 + (m + n)) 0 0) ?_ ?_) + · have hU := U_steps rules (m + n) (a + n * 2) 0 + rwa [Nat.add_zero] at hU + · refine G_add (s := RC2 w u (a + n * 2 + (m + n) + 1) 0) ?_ ?_ + · have hw := G_w rules 2 (a + n * 2 + (m + n)) rules.rule_empty + unfold RC0 RC2 at hw ⊢ + rw [← append_assoc (w ^ (a + n * 2 + (m + n))) (w ^ 0), + ← append_assoc (w ^ (a + n * 2 + (m + n))) (w ^ (1 + 1)), + ← pow_add_list, ← pow_add_list, Nat.add_zero, + ← Nat.add_assoc (a + n * 2 + (m + n)) 1 1] at hw + exact hw + · have h_idx : a + n * 2 + (m + n) + 1 = a + 1 + n * 3 + m := by omega + rw [h_idx] + have hg := grow_steps rules t (a + 1 + n * 3 + m) 0 + rwa [Nat.zero_add] at hg + +theorem left_incs (rules : Rules M hR hL w u v z d₀ d₁ d₁' dh) (n : ℕ) : + SideRLs (flipTM M) ([(hL, hR)] ^ ((2 ^ n - 1) * 2 * 2 + 1)) + (d₀ +> (d₁ +> (d₀ ^ n +> dh))) + (d₁ +> (d₁ +> (d₁ ^ n +> dh))) := + (BC.incs' rules.rule_zero rules.rule_carry rules.rule_return ((2 ^ n - 1) * 2)).sideRLs_concat + ((BC.mul2 rules.rule_zero rules.rule_carry rules.rule_return (2 ^ n - 1)).sideRLs_concat + ((BC.incs rules.rule_zero rules.rule_carry rules.rule_return n).sideRLs_concat (.nil dh))) + +theorem round (rules : Rules M hR hL w u v z d₀ d₁ d₁' dh) {k n : ℕ} {r s : ListBlank Γ} + (hn : n + 2 = 2 ^ k * 4) + (hG : G M hR hL n r (w +> s)) : + (CfgAt hR d₀ d₁ dh k r) [M]⊢⁺ (CfgAt hR d₀ d₁ dh (k + 1) (z +> s)) := by + have h_pos : 2 ^ k > 0 := Nat.two_pow_pos k + have h_idx : (2 ^ k - 1) * 2 * 2 + 1 + 1 = n := by omega + have hr : SideRLs M (lrcons hR ([(hL, hR)] ^ ((2 ^ k - 1) * 2 * 2 + 1)) hL) r (w +> s) := by + rw [lrcons_same, h_idx] + exact hG + have h_step₁ := SideRLs.concat (left_incs rules k) hr + have h_lhs : d₁ +> (d₁ +> (d₁ ^ k +> dh)) = d₁ ^ (1 + (k + 1)) +> dh := by + have h_p : 1 + (k + 1) = k + 1 + 1 := by omega + rw [h_p, pow_succ_list, pow_succ_list, append_assoc, append_assoc] + rw [h_lhs] at h_step₁ + exact stepPlus_stepStar_trans h_step₁ (rules.rule_reset (k + 1) s) + +def need (n m : ℕ) (odd : Bool) : ℕ := + if odd then n * 8 + m * 2 + 4 else n * 10 + m * 4 + 4 + +theorem normal (rules : Rules M hR hL w u v z d₀ d₁ d₁' dh) (a n m : ℕ) (odd : Bool) (t : ℕ) : + G M hR hL (need n m odd + t * 2) + (RC0 w u z a (n * 2 + if odd then 1 else 0) m) + (RC2 w u (a + 1 + n * 3 + m) t) := by + cases odd + · simpa [need] using normal_even rules a n m t + · simpa [need] using normal_odd rules a n m t + +theorem normal_round (rules : Rules M hR hL w u v z d₀ d₁ d₁' dh) + (k n m : ℕ) (odd : Bool) (t : ℕ) + (h_clock : need n m odd + t * 2 + 2 = 2 ^ k * 4) : + (S hR w u z d₀ d₁ dh k (n * 2 + if odd then 1 else 0) m) [M]⊢⁺ + (S hR w u z d₀ d₁ dh (k + 1) (1 + n * 3 + m) t) := by + unfold S + have h_norm := normal rules 0 n m odd t + rw [Nat.zero_add, RC2_head] at h_norm + exact round rules h_clock h_norm + +theorem recovery (rules : Rules M hR hL w u v z d₀ d₁ d₁' dh) + (k a b c e q r d n : ℕ) (odd : Bool) (t m : ℕ) + (h_clock₁ : a * 6 + b * 4 + e * 2 + 2 = 2 ^ k * 4) + (h_zero : m + a = b + c) + (h_prefix : a * 2 + b = 1 + q * 2 + r) + (h_tail : c * 4 + 4 + d * 2 = (e + q) * 2) + (h_parity : r + c + 2 = n * 2 + if odd then 1 else 0) + (h_clock₂ : q * 6 + need n d odd + t * 2 + 2 = 2 ^ (k + 1) * 4) : + (S hR w u z d₀ d₁ dh k (a * 2) m) [M]⊢⁺ + (S hR w u z d₀ d₁ dh (k + 2) (q * 2 + 1 + n * 3 + d) t) := by + have h_even : G M hR hL (e * 2 + q * 2) (RC0 w u z 0 0 c) (RC2 w u (c + 1) d) := by + have h₀ := normal_even rules 0 0 c d + have h_cnt : 0 * 10 + c * 4 + 4 + d * 2 = e * 2 + q * 2 := by omega + have h_idx : 0 + 1 + 0 * 3 + c = c + 1 := by omega + rwa [h_cnt, h_idx] at h₀ + obtain ⟨X, he, hq⟩ := G_split h_even + refine stepPlus_trans (c₂ := CfgAt hR d₀ d₁ dh (k + 1) (z +> (w ^ (q * 2 + r) +> X))) ?_ ?_ + · unfold S + refine round rules (n := a * 6 + (b * 4 + e * 2)) (by omega) ?_ + refine G_add (s := RC0 w u z (a * 2) 0 (m + a)) ?_ ?_ + · have hR0 := R_steps rules a 0 0 m + rwa [Nat.zero_add, Nat.add_zero] at hR0 + · refine G_add (s := RC0 w u z (a * 2 + b) 0 c) ?_ ?_ + · have hU := U_steps rules b (a * 2) c + rwa [← h_zero] at hU + · have h_we := G_w rules e (a * 2 + b) he + unfold RC0 at h_we ⊢ + rw [pow_zero_list, append_nil] at h_we + have h_w_split : w ^ (a * 2 + b) +> X = w +> (w ^ (q * 2 + r) +> X) := by + have h_p : a * 2 + b = (q * 2 + r) + 1 := by omega + rw [h_p, pow_succ_list, append_assoc] + rwa [h_w_split] at h_we + · unfold S + have h_k2 : k + 2 = (k + 1) + 1 := by omega + rw [h_k2] + refine round rules (n := q * 6 + (need n d odd + t * 2)) (by omega) ?_ + refine G_add (s := RC0 w u z (q * 2) (r + c + 2) d) ?_ ?_ + · have hp := peel rules q r hq + unfold RC2 at hp + unfold RC0 + have h_w_c : w ^ (r + (c + 1 + 1)) +> (u ^ d +> default) = + w ^ (r + c + 2) +> (u ^ d +> default) := by + have h_rc : r + (c + 1 + 1) = r + c + 2 := by omega + rw [h_rc] + rwa [← append_assoc (w ^ r) (w ^ (c + 1 + 1)), ← pow_add_list, h_w_c] at hp + · rw [h_parity] + have hn := normal rules (q * 2) n d odd t + rw [RC2_head] at hn + exact hn + +theorem closed (rules : Rules M hR hL w u v z d₀ d₁ d₁' dh) {k n m : ℕ} + (hk : 2 ≤ k) (hsum : n + m + 2 ≤ 2 ^ k) : + ∃ k' n' m', + ((S hR w u z d₀ d₁ dh k n m) [M]⊢⁺ (S hR w u z d₀ d₁ dh k' n' m')) ∧ + 2 ≤ k' ∧ n' + m' + 2 ≤ 2 ^ k' := by + have hT : 4 ≤ 2 ^ k := by + have h2 : 2 ^ 2 ≤ 2 ^ k := Nat.pow_le_pow_right (by decide) hk + exact h2 + have h_pow1 : 2 ^ (k + 1) = 2 ^ k * 2 := Nat.pow_succ _ _ + have h_pow2 : 2 ^ (k + 2) = 2 ^ k * 4 := by + rw [Nat.pow_succ, h_pow1] + omega + set a := n / 2 + have hn_div : n = a * 2 + n % 2 := by omega + rcases Nat.mod_two_eq_zero_or_one n with hn_even | hn_odd + · rw [hn_even, Nat.add_zero] at hn_div + by_cases hgood : a * 5 + m * 2 + 3 ≤ 2 ^ k * 2 + · set t := 2 ^ k * 2 - a * 5 - m * 2 - 3 + refine ⟨k + 1, 1 + a * 3 + m, t, ?_, by omega, by omega⟩ + have hn0 : n = a * 2 + if false then 1 else 0 := by dsimp; omega + rw [hn0] + exact normal_round rules k a m false t (by dsimp [need]; omega) + · set D := 2 ^ k * 2 - 1 - a * 3 + set b := D / 2 + set e := D % 2 + set c := m + a - b + set q := (a * 2 + b - 1) / 2 + set r := (a * 2 + b - 1) % 2 + set d := q + e - c * 2 - 2 + set v' := (r + c + 2) / 2 + rcases Nat.mod_two_eq_zero_or_one (r + c + 2) with hs0 | hs1 + · set h_need := v' * 5 + d * 2 + 2 + set t := 2 ^ k * 4 - q * 3 - h_need - 1 + refine ⟨k + 2, q * 2 + 1 + v' * 3 + d, t, ?_, by omega, by omega⟩ + rw [hn_div] + refine recovery rules k a b c e q r d v' false t m + (by omega) (by omega) (by omega) (by omega) (by dsimp; omega) ?_ + dsimp [need] + omega + · set h_need := v' * 4 + d + 2 + set t := 2 ^ k * 4 - q * 3 - h_need - 1 + refine ⟨k + 2, q * 2 + 1 + v' * 3 + d, t, ?_, by omega, by omega⟩ + rw [hn_div] + refine recovery rules k a b c e q r d v' true t m + (by omega) (by omega) (by omega) (by omega) (by dsimp; omega) ?_ + dsimp [need] + omega + · rw [hn_odd] at hn_div + set t := 2 ^ k * 2 - a * 4 - m - 3 + refine ⟨k + 1, 1 + a * 3 + m, t, ?_, by omega, by omega⟩ + have hn1 : n = a * 2 + if true then 1 else 0 := by dsimp; omega + rw [hn1] + exact normal_round rules k a m true t (by dsimp [need]; omega) + +/-- Prove `IsDoesNotHalt M` from an initial reachability witness into `SBC.S` and `SBC.Rules`. -/ +theorem does_not_halt (rules : Rules M hR hL w u v z d₀ d₁ d₁' dh) + {k₀ n₀ m₀ : ℕ} + (h_init : (init []) [M]⊢* (S hR w u z d₀ d₁ dh k₀ n₀ m₀)) + (hk₀ : 2 ≤ k₀) (hsum₀ : n₀ + m₀ + 2 ≤ 2 ^ k₀) : + IsDoesNotHalt M := by + refine Counter.does_not_halt_of_invariant + (Inv := fun c => ∃ k n m, c = S hR w u z d₀ d₁ dh k n m ∧ 2 ≤ k ∧ n + m + 2 ≤ 2 ^ k) + ⟨S hR w u z d₀ d₁ dh k₀ n₀ m₀, h_init, k₀, n₀, m₀, rfl, hk₀, hsum₀⟩ ?_ + rintro _ ⟨k, n, m, rfl, hk, hsum⟩ + obtain ⟨k', n', m', h_step, hk', hsum'⟩ := closed rules hk hsum + exact ⟨S hR w u z d₀ d₁ dh k' n' m', h_step, k', n', m', rfl, hk', hsum'⟩ + +end WithRules + +end SBC + +-- ============================================================================ +-- 9. Reflective 2D Longitudinal Tile & Half-Tape Checker (`BoundedConfig`) +-- ============================================================================ + +namespace BoundedConfig + +/-- Bounded finite-window directed configuration (`BoundedConfig.T` in `Individual.v`). -/ +structure BCfg (Γ Λ : Type*) where + l : List Γ + r : List Γ + s : Λ + sgn : Dir +deriving DecidableEq + +/-- Realize `BCfg` between arbitrary half-tapes `l₀` and `r₀`. -/ +def toCfg (x : BCfg Γ Λ) (l₀ r₀ : ListBlank Γ) : Cfg Γ Λ := + match x.sgn with + | .left => (x.r +> l₀) <{{x.s}} (x.l +> r₀) + | .right => (x.l +> l₀) {{x.s}}> (x.r +> r₀) + +section Decidable + +variable [DecidableEq Γ] [DecidableEq Λ] + +/-- Execute one bounded step inside `x.r` (`BoundedConfig.step` in `Individual.v`). -/ +def step (M : Machine Γ Λ) (x : BCfg Γ Λ) : Option (BCfg Γ Λ) := + match x.r with + | [] => none + | m :: r₀ => + match M x.s m with + | none => none + | some (none, _) => none + | some (some s', Stmt.write m' sgn') => + if x.sgn == sgn' then + some ⟨m' :: x.l, r₀, s', sgn'⟩ + else + some ⟨m' :: r₀, x.l, s', sgn'⟩ + +/-- Iterate `step` up to `n` times until `x.r` is exhausted (`BoundedConfig.steps`). -/ +def steps (M : Machine Γ Λ) : ℕ → BCfg Γ Λ → Option (BCfg Γ Λ) + | 0, x => + match step M x with + | none => some x + | some _ => none + | n + 1, x => + match step M x with + | none => some x + | some x' => steps M n x' + +/-- Run `steps` while recording whether at least one transition occurred (`BoundedConfig.steps1`). +-/ +def steps1 (M : Machine Γ Λ) (n : ℕ) (x : BCfg Γ Λ) : Option (BCfg Γ Λ × Bool) := + match step M x with + | none => some (x, false) + | some x' => (steps M n x').map (fun y => (y, true)) + +/-- Execute one bounded step where a rightward head at `r = []` extends into the blank right +half-tape (`BoundedConfig.step_r0inf`). -/ +def step_r0inf (M : Machine Γ Λ) (x : BCfg Γ Λ) : Option (BCfg Γ Λ) := + match x.r with + | [] => + match x.sgn with + | .right => + match M x.s default with + | none => none + | some (none, _) => none + | some (some s', Stmt.write m' sgn') => + if x.sgn == sgn' then + some ⟨m' :: x.l, [], s', sgn'⟩ + else + some ⟨[m'], x.l, s', sgn'⟩ + | .left => none + | m :: r₀ => + match M x.s m with + | none => none + | some (none, _) => none + | some (some s', Stmt.write m' sgn') => + if x.sgn == sgn' then + some ⟨m' :: x.l, r₀, s', sgn'⟩ + else + some ⟨m' :: r₀, x.l, s', sgn'⟩ + +/-- Iterate `step_r0inf` up to `n` times until the head exits left (`BoundedConfig.steps_r0inf`). -/ +def steps_r0inf (M : Machine Γ Λ) : ℕ → BCfg Γ Λ → Option (BCfg Γ Λ) + | 0, x => + match step_r0inf M x with + | none => some x + | some _ => none + | n + 1, x => + match step_r0inf M x with + | none => some x + | some x' => steps_r0inf M n x' + +/-- Run at least one `step_r0inf` followed by `steps_r0inf` (`BoundedConfig.steps1_r0inf`). -/ +def steps1_r0inf (M : Machine Γ Λ) (n : ℕ) (x : BCfg Γ Λ) : Option (BCfg Γ Λ) := + match step_r0inf M x with + | none => none + | some x' => steps_r0inf M n x' + +omit [DecidableEq Γ] [DecidableEq Λ] in +theorem step_spec (M : Machine Γ Λ) (x : BCfg Γ Λ) {x' : BCfg Γ Λ} + (h : step M x = some x') (l₀ r₀ : ListBlank Γ) : + (toCfg x l₀ r₀) [M]⊢ (toCfg x' l₀ r₀) := by + rcases x with ⟨l₁, _ | ⟨m, r₁⟩, s₁, sgn₁⟩ + · cases h + · dsimp [step] at h + rcases hM : M s₁ m with _ | ⟨_ | s₂, ⟨m₂, sgn₂⟩⟩ <;> rw [hM] at h + · cases h + · cases h + · rcases sgn₁ <;> rcases sgn₂ <;> cases h <;> + simp [toCfg, BusyBeaver.step, hM, Tape.write, Tape.move] + +omit [DecidableEq Γ] [DecidableEq Λ] in +theorem step_r0inf_spec (M : Machine Γ Λ) (x : BCfg Γ Λ) {x' : BCfg Γ Λ} + (h : step_r0inf M x = some x') (l₀ : ListBlank Γ) : + (toCfg x l₀ default) [M]⊢ (toCfg x' l₀ default) := by + rcases x with ⟨l₁, _ | ⟨m, r₁⟩, s₁, sgn₁⟩ + · rcases sgn₁ + · cases h + · dsimp [step_r0inf] at h + rcases hM : M s₁ default with _ | ⟨_ | s₂, ⟨m₂, sgn₂⟩⟩ <;> rw [hM] at h + · cases h + · cases h + · rcases sgn₂ <;> cases h <;> + simp [toCfg, BusyBeaver.step, hM, Tape.write, Tape.move] + · dsimp [step_r0inf] at h + rcases hM : M s₁ m with _ | ⟨_ | s₂, ⟨m₂, sgn₂⟩⟩ <;> rw [hM] at h + · cases h + · cases h + · rcases sgn₁ <;> rcases sgn₂ <;> cases h <;> + simp [toCfg, BusyBeaver.step, hM, Tape.write, Tape.move] + +omit [DecidableEq Γ] [DecidableEq Λ] in +theorem steps_spec (M : Machine Γ Λ) (n : ℕ) (x : BCfg Γ Λ) {x' : BCfg Γ Λ} + (h : steps M n x = some x') (l₀ r₀ : ListBlank Γ) : + (toCfg x l₀ r₀) [M]⊢* (toCfg x' l₀ r₀) := by + induction n generalizing x with + | zero => + dsimp [steps] at h + rcases hstep : step M x with _ | y <;> rw [hstep] at h + · cases h + exact stepStar_refl M _ + · cases h + | succ n ih => + dsimp [steps] at h + rcases hstep : step M x with _ | y <;> rw [hstep] at h + · cases h + exact stepStar_refl M _ + · exact stepStar_trans ⟨1, step_spec M x hstep l₀ r₀⟩ (ih y h) + +omit [DecidableEq Γ] [DecidableEq Λ] in +theorem steps_r0inf_spec (M : Machine Γ Λ) (n : ℕ) (x : BCfg Γ Λ) {x' : BCfg Γ Λ} + (h : steps_r0inf M n x = some x') (l₀ : ListBlank Γ) : + (toCfg x l₀ default) [M]⊢* (toCfg x' l₀ default) := by + induction n generalizing x with + | zero => + dsimp [steps_r0inf] at h + rcases hstep : step_r0inf M x with _ | y <;> rw [hstep] at h + · cases h + exact stepStar_refl M _ + · cases h + | succ n ih => + dsimp [steps_r0inf] at h + rcases hstep : step_r0inf M x with _ | y <;> rw [hstep] at h + · cases h + exact stepStar_refl M _ + · exact stepStar_trans ⟨1, step_r0inf_spec M x hstep l₀⟩ (ih y h) + +omit [DecidableEq Γ] [DecidableEq Λ] in +theorem steps1_spec_true (M : Machine Γ Λ) (n : ℕ) (x : BCfg Γ Λ) {x' : BCfg Γ Λ} + (h : steps1 M n x = some (x', true)) (l₀ r₀ : ListBlank Γ) : + (toCfg x l₀ r₀) [M]⊢⁺ (toCfg x' l₀ r₀) := by + dsimp [steps1] at h + rcases hstep : step M x with _ | y <;> rw [hstep] at h <;> dsimp only at h + · cases h + · rcases hsteps : steps M n y with _ | z <;> rw [hsteps] at h + · cases h + · cases h + exact stepPlus_stepStar_trans ⟨1, by decide, step_spec M x hstep l₀ r₀⟩ + (steps_spec M n y hsteps l₀ r₀) + +omit [DecidableEq Γ] [DecidableEq Λ] in +theorem steps1_spec_star (M : Machine Γ Λ) (n : ℕ) (x : BCfg Γ Λ) {x' : BCfg Γ Λ} {flag : Bool} + (h : steps1 M n x = some (x', flag)) (l₀ r₀ : ListBlank Γ) : + (toCfg x l₀ r₀) [M]⊢* (toCfg x' l₀ r₀) := by + dsimp [steps1] at h + rcases hstep : step M x with _ | y <;> rw [hstep] at h <;> dsimp only at h + · cases h + exact stepStar_refl M _ + · rcases hsteps : steps M n y with _ | z <;> rw [hsteps] at h + · cases h + · cases h + exact stepStar_trans ⟨1, step_spec M x hstep l₀ r₀⟩ (steps_spec M n y hsteps l₀ r₀) + +omit [DecidableEq Γ] [DecidableEq Λ] in +theorem steps1_r0inf_spec (M : Machine Γ Λ) (n : ℕ) (x : BCfg Γ Λ) {x' : BCfg Γ Λ} + (h : steps1_r0inf M n x = some x') (l₀ : ListBlank Γ) : + (toCfg x l₀ default) [M]⊢⁺ (toCfg x' l₀ default) := by + dsimp [steps1_r0inf] at h + rcases hstep : step_r0inf M x with _ | y <;> rw [hstep] at h + · cases h + · exact stepPlus_stepStar_trans ⟨1, by decide, step_r0inf_spec M x hstep l₀⟩ + (steps_r0inf_spec M n y h l₀) + +/-- Strip prefix `r₀` from list `r` if `r₀` is a prefix of `r`. -/ +def skipPrefixList (r₀ r : List Γ) : Option (List Γ) := + let len := r₀.length + if r₀ == r.take len then some (r.drop len) else none + +theorem skipPrefixList_spec {r₀ r r' : List Γ} + (h : skipPrefixList r₀ r = some r') : + r = r₀ ++ r' := by + dsimp [skipPrefixList] at h + split_ifs at h with heq + · cases h + have heq' : r.take r₀.length = r₀ := (beq_iff_eq.mp heq).symm + have h_td := List.take_append_drop r₀.length r + rw [heq'] at h_td + exact h_td.symm + +/-- Check whether every symbol in `a` equals `default`. -/ +def all0 : List Γ → Bool + | [] => true + | a₀ :: a₁ => (a₀ == default) && all0 a₁ + +theorem all0_spec {a : List Γ} (h : all0 a = true) : + a +> (default : ListBlank Γ) = default := by + induction a with + | nil => rfl + | cons a₀ a₁ ih => + dsimp [all0] at h + rw [Bool.and_eq_true, beq_iff_eq] at h + rw [h.1, append_cons, ih h.2] + change ListBlank.cons (default : ListBlank Γ).head (default : ListBlank Γ).tail = default + exact ListBlank.cons_head_tail default + +/-- Check whether `a +> default = b +> default`. -/ +def eqAppR0inf : List Γ → List Γ → Bool + | [], b => all0 b + | a₀ :: a₁, [] => all0 (a₀ :: a₁) + | a₀ :: a₁, b₀ :: b₁ => (a₀ == b₀) && eqAppR0inf a₁ b₁ + +theorem eqAppR0inf_spec {a b : List Γ} (h : eqAppR0inf a b = true) : + a +> (default : ListBlank Γ) = b +> default := by + induction a generalizing b with + | nil => exact (all0_spec h).symm + | cons a₀ a₁ ih => + rcases b with _ | ⟨b₀, b₁⟩ + · exact all0_spec h + · dsimp [eqAppR0inf] at h + rw [Bool.and_eq_true, beq_iff_eq] at h + rw [h.1, append_cons, append_cons, ih h.2] + +/-- Strip prefix `r₀` from `r +> default`. -/ +def skipPrefixListR0inf (r₀ r : List Γ) : Option (List Γ) := + let len₀ := r₀.length + if r₀ == r.take len₀ then + some (r.drop len₀) + else + let len := r.length + if r == r₀.take len then + if all0 (r₀.drop len) then some [] else none + else + none + +theorem skipPrefixListR0inf_spec {r₀ r r' : List Γ} + (h : skipPrefixListR0inf r₀ r = some r') : + r +> (default : ListBlank Γ) = r₀ +> (r' +> default) := by + dsimp [skipPrefixListR0inf] at h + split_ifs at h with h₁ h₂ h₃ + · cases h + have heq : r.take r₀.length = r₀ := (beq_iff_eq.mp h₁).symm + have h_td := List.take_append_drop r₀.length r + rw [heq] at h_td + rw [← append_assoc, h_td] + · cases h + have heq : r = r₀.take r.length := beq_iff_eq.mp h₂ + have hall : r₀.drop r.length +> (default : ListBlank Γ) = default := all0_spec h₃ + conv_rhs => rw [append_nil, ← List.take_append_drop r.length r₀, append_assoc, hall, ← heq] + +mutual + +/-- Decidable reflective verifier for `SegRLs M ls₁ ls₂ w₁ w₂` (`BoundedConfig.segRLs_c`). -/ +def segRLs_c (M : Machine Γ Λ) (ls₁ ls₂ : List (DH0 Γ Λ × DH0 Γ Λ)) + (w₁ w₂ : List Γ) : ℕ → Bool + | 0 => false + | T + 1 => + match ls₁ with + | [] => (ls₂ == []) && (w₁ == w₂) + | ((QR, qR), (QL, qL)) :: ls₁' => + match steps1 M T ⟨qR, w₁, QR, .right⟩ with + | some (⟨l, r, q, .right⟩, _flag) => + match ls₂ with + | [] => false + | ((QR', qR'), hL') :: ls₂' => + (r == []) && (q == QR') && + match skipPrefixList qR' l with + | some w₁' => segLLs_c M (QL, qL) ls₁' hL' ls₂' w₁' w₂ T + | none => false + | some (⟨l, r, q, .left⟩, true) => + (r == []) && (q == QL) && + match skipPrefixList qL l with + | some w₁' => segRLs_c M ls₁' ls₂ w₁' w₂ T + | none => false + | _ => false + +/-- Decidable reflective verifier for `SegLLs M h₁ ls₁ h₂ ls₂ w₁ w₂` (`BoundedConfig.segLLs_c`). -/ +def segLLs_c (M : Machine Γ Λ) (h₁ : DH0 Γ Λ) (ls₁ : List (DH0 Γ Λ × DH0 Γ Λ)) + (h₂ : DH0 Γ Λ) (ls₂ : List (DH0 Γ Λ × DH0 Γ Λ)) (w₁ w₂ : List Γ) : ℕ → Bool + | 0 => false + | T + 1 => + let (QL, qL) := h₂ + match steps1 M T ⟨qL, w₁, QL, .left⟩ with + | some (⟨l, r, q, .right⟩, _flag) => + match ls₂ with + | [] => false + | ((QR', qR'), hL') :: ls₂' => + (r == []) && (q == QR') && + match skipPrefixList qR' l with + | some w₁' => segLLs_c M h₁ ls₁ hL' ls₂' w₁' w₂ T + | none => false + | some (⟨l, r, q, .left⟩, _flag) => + let (QL₀, qL₀) := h₁ + (r == []) && (q == QL₀) && + match skipPrefixList qL₀ l with + | some w₁' => segRLs_c M ls₁ ls₂ w₁' w₂ T + | none => false + | _ => false + +end + +private theorem segRLs_LLs_c_spec (M : Machine Γ Λ) (T : ℕ) : + (∀ ls₁ ls₂ w₁ w₂, segRLs_c M ls₁ ls₂ w₁ w₂ T = true → SegRLs M ls₁ ls₂ w₁ w₂) ∧ + (∀ h₁ ls₁ h₂ ls₂ w₁ w₂, segLLs_c M h₁ ls₁ h₂ ls₂ w₁ w₂ T = true → + SegLLs M h₁ ls₁ h₂ ls₂ w₁ w₂) := by + induction T with + | zero => + constructor + · intro _ _ _ _ h; cases h + · intro _ _ _ _ _ _ h; cases h + | succ T ih => + rcases ih with ⟨ih_rl, ih_ll⟩ + refine ⟨?_, ?_⟩ + · intro ls₁ ls₂ w₁ w₂ h + rcases ls₁ with _ | ⟨⟨⟨QR, qR⟩, ⟨QL, qL⟩⟩, ls₁'⟩ + · rw [segRLs_c] at h + rw [Bool.and_eq_true, beq_iff_eq, beq_iff_eq] at h + rw [h.1, h.2] + exact .nil w₂ + · rw [segRLs_c] at h + rcases h_st : steps1 M T ⟨qR, w₁, QR, .right⟩ with _ | ⟨⟨l, r, q, _ | _⟩, _ | _⟩ <;> + rw [h_st] at h <;> dsimp only at h + · cases h + · cases h + · rw [Bool.and_assoc, Bool.and_eq_true, beq_iff_eq, Bool.and_eq_true, beq_iff_eq] at h + rcases h with ⟨rfl, rfl, h_skip⟩ + rcases h_sp : skipPrefixList qL l with _ | w₁' <;> rw [h_sp] at h_skip + · cases h_skip + · have hl_eq := skipPrefixList_spec h_sp + refine .cons (fun l₀ r₀ => ?_) (ih_rl ls₁' ls₂ w₁' w₂ h_skip) + have h_run := steps1_spec_true M T ⟨qR, w₁, QR, .right⟩ h_st l₀ r₀ + simp only [toCfg, toDHCfg, hl_eq, append_nil, append_assoc] at h_run ⊢ + exact h_run + · rcases ls₂ with _ | ⟨⟨⟨QR', qR'⟩, hL'⟩, ls₂'⟩ + · cases h + · dsimp only at h + rw [Bool.and_assoc, Bool.and_eq_true, beq_iff_eq, Bool.and_eq_true, beq_iff_eq] at h + rcases h with ⟨rfl, rfl, h_skip⟩ + rcases h_sp : skipPrefixList qR' l with _ | w₁' <;> rw [h_sp] at h_skip + · cases h_skip + · have hl_eq := skipPrefixList_spec h_sp + refine SegRLs.of_segRR_segLLs (fun l₀ r₀ => ?_) + (ih_ll (QL, qL) ls₁' hL' ls₂' w₁' w₂ h_skip) + have h_run := steps1_spec_star M T ⟨qR, w₁, QR, .right⟩ h_st l₀ r₀ + simp only [toCfg, toDHCfg, hl_eq, append_nil, append_assoc] at h_run ⊢ + exact h_run + · rcases ls₂ with _ | ⟨⟨⟨QR', qR'⟩, hL'⟩, ls₂'⟩ + · cases h + · dsimp only at h + rw [Bool.and_assoc, Bool.and_eq_true, beq_iff_eq, Bool.and_eq_true, beq_iff_eq] at h + rcases h with ⟨rfl, rfl, h_skip⟩ + rcases h_sp : skipPrefixList qR' l with _ | w₁' <;> rw [h_sp] at h_skip + · cases h_skip + · have hl_eq := skipPrefixList_spec h_sp + refine SegRLs.of_segRR_segLLs (fun l₀ r₀ => ?_) + (ih_ll (QL, qL) ls₁' hL' ls₂' w₁' w₂ h_skip) + have h_run := steps1_spec_star M T ⟨qR, w₁, QR, .right⟩ h_st l₀ r₀ + simp only [toCfg, toDHCfg, hl_eq, append_nil, append_assoc] at h_run ⊢ + exact h_run + · intro h₁ ls₁ h₂ ls₂ w₁ w₂ h + rcases h₂ with ⟨QL, qL⟩ + rw [segLLs_c] at h + dsimp only at h + rcases h_st : steps1 M T ⟨qL, w₁, QL, .left⟩ with _ | ⟨⟨l, r, q, _ | _⟩, flag⟩ <;> + rw [h_st] at h <;> dsimp only at h + · cases h + · rcases h₁ with ⟨QL₀, qL₀⟩ + rw [Bool.and_assoc, Bool.and_eq_true, beq_iff_eq, Bool.and_eq_true, beq_iff_eq] at h + rcases h with ⟨rfl, rfl, h_skip⟩ + rcases h_sp : skipPrefixList qL₀ l with _ | w₁' <;> rw [h_sp] at h_skip + · cases h_skip + · have hl_eq := skipPrefixList_spec h_sp + refine SegLLs.of_segLL_segRLs (fun l₀ r₀ => ?_) (ih_rl ls₁ ls₂ w₁' w₂ h_skip) + have h_run := steps1_spec_star M T ⟨qL, w₁, QL, .left⟩ h_st l₀ r₀ + simp only [toCfg, toDHCfg, hl_eq, append_nil, append_assoc] at h_run ⊢ + exact h_run + · rcases ls₂ with _ | ⟨⟨⟨QR', qR'⟩, hL'⟩, ls₂'⟩ + · cases h + · dsimp only at h + rw [Bool.and_assoc, Bool.and_eq_true, beq_iff_eq, Bool.and_eq_true, beq_iff_eq] at h + rcases h with ⟨rfl, rfl, h_skip⟩ + rcases h_sp : skipPrefixList qR' l with _ | w₁' <;> rw [h_sp] at h_skip + · cases h_skip + · have hl_eq := skipPrefixList_spec h_sp + refine SegLLs.of_segLR_segLLs (fun l₀ r₀ => ?_) + (ih_ll h₁ ls₁ hL' ls₂' w₁' w₂ h_skip) + have h_run := steps1_spec_star M T ⟨qL, w₁, QL, .left⟩ h_st l₀ r₀ + simp only [toCfg, toDHCfg, hl_eq, append_nil, append_assoc] at h_run ⊢ + exact h_run + +/-- Soundness of the reflective 2D tile checker (`BoundedConfig.segRLs_c_spec`): any tile check +that evaluates to `true` by `rfl` or `decide` yields `SegRLs M ls₁ ls₂ w₁ w₂`. -/ +theorem segRLs_c_spec (M : Machine Γ Λ) {ls₁ ls₂ : List (DH0 Γ Λ × DH0 Γ Λ)} + {w₁ w₂ : List Γ} {T : ℕ} + (h : segRLs_c M ls₁ ls₂ w₁ w₂ T = true) : + SegRLs M ls₁ ls₂ w₁ w₂ := + (segRLs_LLs_c_spec M T).1 ls₁ ls₂ w₁ w₂ h + +/-- Decidable reflective verifier for `SideRLs M hs (r +> default) (r' +> default)` +(`BoundedConfig.sideRLs_c`). -/ +def sideRLs_c (M : Machine Γ Λ) : + List (DH0 Γ Λ × DH0 Γ Λ) → List Γ → List Γ → ℕ → Bool + | [], r, r', _ => eqAppR0inf r r' + | ((QR, qR), (QL, qL)) :: hs, r, r', T => + match steps1_r0inf M T ⟨qR, r, QR, .right⟩ with + | some ⟨l, r_rem, QL', .left⟩ => + (r_rem == []) && (QL == QL') && + match skipPrefixListR0inf qL l with + | some r₀ => sideRLs_c M hs r₀ r' T + | none => false + | _ => false + +/-- Soundness of the reflective half-tape checker (`BoundedConfig.sideRLs_c_spec`). -/ +theorem sideRLs_c_spec (M : Machine Γ Λ) {hs : List (DH0 Γ Λ × DH0 Γ Λ)} + {r r' : List Γ} {T : ℕ} + (h : sideRLs_c M hs r r' T = true) : + SideRLs M hs (r +> default) (r' +> default) := by + induction hs generalizing r with + | nil => + rw [eqAppR0inf_spec h] + exact .nil _ + | cons ab hs ih => + rcases ab with ⟨⟨QR, qR⟩, ⟨QL, qL⟩⟩ + dsimp [sideRLs_c] at h + rcases h_st : steps1_r0inf M T ⟨qR, r, QR, .right⟩ with _ | ⟨l, r_rem, QL', _ | _⟩ <;> + rw [h_st] at h <;> dsimp only at h + · cases h + · rw [Bool.and_assoc, Bool.and_eq_true, beq_iff_eq, Bool.and_eq_true, beq_iff_eq] at h + rcases h with ⟨rfl, rfl, h_skip⟩ + rcases h_sp : skipPrefixListR0inf qL l with _ | r₀ <;> rw [h_sp] at h_skip + · cases h_skip + · have hl_eq := skipPrefixListR0inf_spec h_sp + refine .cons (fun l₀ => ?_) (ih h_skip) + have h_run := steps1_r0inf_spec M T ⟨qR, r, QR, .right⟩ h_st l₀ + simp only [toCfg, toDHCfg, hl_eq, append_nil] at h_run ⊢ + exact h_run + · cases h + +end Decidable + +end BoundedConfig + +section NatSim + +open Turing BusyBeaver + +private theorem multiStep_of_step {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] {M : Machine Γ Λ} {c c' + : Cfg Γ Λ} + (h : step M c = some c') (n : ℕ) : + multiStep M c (n + 1) = multiStep M c' n := by + rw [multiStep_succ', h, Option.bind_some] + +/-- Strict evaluation barrier for `Nat` terms inside Lean's call-by-name kernel. + +Because Lean's kernel uses weak-head reduction, evaluating recursive tape updates in `stepsNat` +without forcing eager evaluation would accumulate unreduced thunk trees `w + 2 * (w' + 2 * ...)` +for the tape integers `l` and `r`, leading to quadratic memory blowup and elaborator/kernel stack +overflow over thousands of steps. + +Pattern matching on `Nat.add n 1` forces the kernel's native C++ bignum evaluator (`reduce_nat` via + `lean::mpz`) +to eagerly compute the normal form of `n` before continuing, acting as a kernel-level `seq`. +Mathematically, `withReducedNat n k = k n` by definition (`rfl`). -/ +def withReducedNat {α : Type*} (n : Nat) (k : Nat → α) : α := + Nat.casesOn (Nat.add n 1) (k 0) (fun m => k m) + +@[simp] theorem withReducedNat_eq {α : Type*} (n : Nat) (k : Nat → α) : + withReducedNat n k = k n := rfl + +/-- Decode a binary Nat (head = n % 2, tail = n / 2) into a canonical ListBlank (Fin 2). -/ +def decodeHalf (n : Nat) : ListBlank (Fin 2) := + if n = 0 then default + else ListBlank.cons ⟨n % 2, Nat.mod_lt _ (by decide)⟩ (decodeHalf (n / 2)) +termination_by n + +@[simp] theorem decodeHalf_zero : decodeHalf 0 = default := by + unfold decodeHalf; rfl + +theorem decodeHalf_unfold (n : Nat) : + decodeHalf n = ListBlank.cons ⟨n % 2, Nat.mod_lt _ (by decide)⟩ (decodeHalf (n / 2)) := by + rw [decodeHalf] + split_ifs with h + · subst h + rw [decodeHalf_zero] + have hhead : (⟨0 % 2, Nat.mod_lt 0 (by decide)⟩ : Fin 2) = default := rfl + rw [hhead] + exact (ListBlank.cons_head_tail default).symm + · rfl + +@[simp] theorem decodeHalf_head (n : Nat) : + (decodeHalf n).head = ⟨n % 2, Nat.mod_lt _ (by decide)⟩ := by + rw [decodeHalf_unfold, ListBlank.head_cons] + +@[simp] theorem decodeHalf_tail (n : Nat) : + (decodeHalf n).tail = decodeHalf (n / 2) := by + rw [decodeHalf_unfold, ListBlank.tail_cons] + +@[simp] theorem decodeHalf_cons (b : Fin 2) (n : Nat) : + ListBlank.cons b (decodeHalf n) = decodeHalf (b.val + 2 * n) := by + rw [decodeHalf_unfold (b.val + 2 * n)] + have hm : (b.val + 2 * n) % 2 = b.val := by omega + have hd : (b.val + 2 * n) / 2 = n := by omega + congr 1 + · exact Fin.ext hm.symm + · rw [hd] + +def encodeList (xs : List (Fin 2)) (rest : Nat := 0) : Nat := + xs.foldr (fun b acc => b.val + 2 * acc) rest + +@[simp] theorem decodeHalf_encodeList (xs : List (Fin 2)) (rest : Nat) : + ListBlank.append xs (decodeHalf rest) = decodeHalf (encodeList xs rest) := by + induction xs with + | nil => rfl + | cons b xs ih => + change ListBlank.cons b (ListBlank.append xs (decodeHalf rest)) = _ + rw [ih, decodeHalf_cons] + rfl + +/-- Native bignum 4-Nat shadow configuration for any Machine (Fin 2) (Fin K). + q < K is an active state, q = K is none (halted), and q = K + 1 flags an invalid step. -/ +structure NatCfg where + q : Nat + h : Nat + l : Nat + r : Nat + deriving DecidableEq, Repr + +def NatCfg.toCfg {K : Nat} [NeZero K] (c : NatCfg) : Cfg (Fin 2) (Fin K) := + ⟨if hq : c.q < K then some ⟨c.q, hq⟩ else none, + ⟨⟨c.h % 2, Nat.mod_lt _ (by decide)⟩, decodeHalf c.l, decodeHalf c.r⟩⟩ + +/-- Run n strict bignum shadow steps for arbitrary M : Machine (Fin 2) (Fin K). -/ +def stepsNat {K : Nat} [NeZero K] (M : Machine (Fin 2) (Fin K)) : Nat → NatCfg → NatCfg + | 0, c => c + | n + 1, c => + if hq : c.q < K then + match M ⟨c.q, hq⟩ ⟨c.h % 2, Nat.mod_lt _ (by decide)⟩ with + | none => ⟨K + 1, 0, 0, 0⟩ + | some (oq', Stmt.write w d) => + let q' := match oq' with | some s => s.val | none => K + match d with + | .right => + withReducedNat (c.r % 2) fun h' => + withReducedNat (c.r / 2) fun r' => + withReducedNat (w.val + 2 * c.l) fun l' => + stepsNat M n ⟨q', h', l', r'⟩ + | .left => + withReducedNat (c.l % 2) fun h' => + withReducedNat (c.l / 2) fun l' => + withReducedNat (w.val + 2 * c.r) fun r' => + stepsNat M n ⟨q', h', l', r'⟩ + else + ⟨K + 1, 0, 0, 0⟩ + +theorem stepsNat_sound {K : Nat} [NeZero K] (M : Machine (Fin 2) (Fin K)) : + ∀ (n : Nat) (c c' : NatCfg), + stepsNat M n c = c' → c'.q ≤ K → + multiStep M (c.toCfg (K := K)) n = some (c'.toCfg (K := K)) + | 0, c, c', heq, _ => by subst heq; rfl + | n + 1, c, c', heq, hle => by + dsimp [stepsNat] at heq + split_ifs at heq with hq + · rcases hM : M ⟨c.q, hq⟩ ⟨c.h % 2, Nat.mod_lt _ (by decide)⟩ with _ | ⟨oq', ⟨w, d⟩⟩ + · rw [hM] at heq + subst heq + dsimp only at hle + omega + · rw [hM] at heq + rcases oq' with _ | s <;> rcases d with _ | _ + · have hstep : step M (c.toCfg (K := K)) = + some (NatCfg.toCfg (K := K) ⟨K, c.l % 2, c.l / 2, w.val + 2 * c.r⟩) := by + simp [BusyBeaver.step, NatCfg.toCfg, hq, hM, Tape.write, Tape.move] + rw [multiStep_of_step hstep]; exact stepsNat_sound M n _ c' heq hle + · have hstep : step M (c.toCfg (K := K)) = + some (NatCfg.toCfg (K := K) ⟨K, c.r % 2, w.val + 2 * c.l, c.r / 2⟩) := by + simp [BusyBeaver.step, NatCfg.toCfg, hq, hM, Tape.write, Tape.move] + rw [multiStep_of_step hstep]; exact stepsNat_sound M n _ c' heq hle + · have hstep : step M (c.toCfg (K := K)) = + some (NatCfg.toCfg (K := K) ⟨s.val, c.l % 2, c.l / 2, w.val + 2 * c.r⟩) := by + simp [BusyBeaver.step, NatCfg.toCfg, hq, hM, Tape.write, Tape.move, s.isLt] + rw [multiStep_of_step hstep]; exact stepsNat_sound M n _ c' heq hle + · have hstep : step M (c.toCfg (K := K)) = + some (NatCfg.toCfg (K := K) ⟨s.val, c.r % 2, w.val + 2 * c.l, c.r / 2⟩) := by + simp [BusyBeaver.step, NatCfg.toCfg, hq, hM, Tape.write, Tape.move, s.isLt] + rw [multiStep_of_step hstep]; exact stepsNat_sound M n _ c' heq hle + · subst heq + dsimp only at hle + omega + +theorem toCfg_zero {K : Nat} [NeZero K] : + (NatCfg.toCfg (K := K) ⟨0, 0, 0, 0⟩) = init [] := by + have h0 : 0 < K := by + have := NeZero.ne K + omega + ext + · simp [NatCfg.toCfg, BusyBeaver.init, h0] + try rfl + · simp [NatCfg.toCfg, BusyBeaver.init, Tape.mk₁, decodeHalf_zero] + try rfl + +theorem toCfg_headRight {K : Nat} [NeZero K] (q : Fin K) (l r : Nat) : + NatCfg.toCfg (K := K) ⟨q.val, r % 2, l, r / 2⟩ = + Cfg.headRight q (decodeHalf l) (decodeHalf r) := by + ext <;> simp [NatCfg.toCfg, q.isLt] + +theorem toCfg_headLeft {K : Nat} [NeZero K] (q : Fin K) (l r : Nat) : + NatCfg.toCfg (K := K) ⟨q.val, l % 2, l / 2, r⟩ = + Cfg.headLeft q (decodeHalf l) (decodeHalf r) := by + ext <;> simp [NatCfg.toCfg, q.isLt] + +end NatSim + +end BusyBeaver.Longitudinal diff --git a/BusyBeaver/Calculi/LongitudinalCascade.lean b/BusyBeaver/Calculi/LongitudinalCascade.lean new file mode 100644 index 00000000..b222f358 --- /dev/null +++ b/BusyBeaver/Calculi/LongitudinalCascade.lean @@ -0,0 +1,5825 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.Longitudinal + +/-! +# Longitudinal Cascade Transitions (`BusyBeaver.Calculi.LongitudinalCascade`) + +Cascade tile-transition theorems and composite sweep rules extending +`BusyBeaver.Calculi.Longitudinal` for multi-stage space-time diagrams. +-/ + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver SixState +open BusyBeaver.Longitudinal +open BusyBeaver.Longitudinal.BoundedConfig + +namespace BusyBeaver.LongitudinalCascade + +private theorem if_pos {c : Prop} [Decidable c] (hc : c) {α : Sort*} {t e : α} : + (if c then t else e) = t := by + simp [hc] + +private theorem if_neg {c : Prop} [Decidable c] (hnc : ¬c) {α : Sort*} {t e : α} : + (if c then t else e) = e := by + simp [hnc] + +abbrev Q := Fin 6 +abbrev Sym := Fin 2 + +/-- Shared longitudinal cascade machine `1RB0LC_1LA0RE_0RD0LA_1RE1RA_0LD1RF_0RB---`. -/ +def tm1 : Machine Sym Q + | 0, 0 => some (some 1, ⟨1, .right⟩) + | 0, 1 => some (some 2, ⟨0, .left⟩) + | 1, 0 => some (some 0, ⟨1, .left⟩) + | 1, 1 => some (some 4, ⟨0, .right⟩) + | 2, 0 => some (some 3, ⟨0, .right⟩) + | 2, 1 => some (some 0, ⟨0, .left⟩) + | 3, 0 => some (some 4, ⟨1, .right⟩) + | 3, 1 => some (some 0, ⟨1, .right⟩) + | 4, 0 => some (some 3, ⟨0, .left⟩) + | 4, 1 => some (some 5, ⟨1, .right⟩) + | 5, 0 => some (some 1, ⟨0, .right⟩) + | 5, 1 => none + +abbrev t : List Sym := [1, 0] +abbrev u : List Sym := [1, 0, 1] +abbrev d : List Sym := [1, 1, 0] +abbrev w : List Sym := [1, 0, 1, 1, 0] +abbrev v : List Sym := [1, 1, 0, 1, 0] + +abbrev hp : List (DH0 Sym Q × DH0 Sym Q) := [((B, [0]), (C, [0]))] +abbrev hq : List (DH0 Sym Q × DH0 Sym Q) := [((B, [0]), (A, [0, 0]))] +abbrev hr : List (DH0 Sym Q × DH0 Sym Q) := [((B, [0]), (A, [0, 0, 0, 0]))] +abbrev hi : List (DH0 Sym Q × DH0 Sym Q) := [((B, [1, 1, 0]), (C, [0, 1, 0]))] +abbrev hc : List (DH0 Sym Q × DH0 Sym Q) := [((B, []), (A, []))] +abbrev hm : List (DH0 Sym Q × DH0 Sym Q) := [((B, [1]), (A, [0]))] + +def P (n : ℕ) (r s : ListBlank Sym) : Prop := SideRLs tm1 (hp ^ n) r s +def I (n : ℕ) (r s : ListBlank Sym) : Prop := SideRLs tm1 (hi ^ n) r s + +theorem Pd : SegRLs tm1 hp (hp ^ 2) d u := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem PdQP : SegRLs tm1 hp (hp ++ hq) d [1, 0, 0, 0] := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem PdR : SegRLs tm1 hp hr d (w ++ [1]) := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem Pt : SegRLs tm1 hp hi t t := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem Id : SegRLs tm1 hi hp d d := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem Pw : SegRLs tm1 hp hp w w := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem Iq : SegRLs tm1 hi hq d (d ++ [1]) := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem Pwq : SegRLs tm1 hp hq w (w ++ [1]) := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem Iv : SegRLs tm1 hi hi v v := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem Pv : SegRLs tm1 hp (hi ^ 2) v w := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem Pdw : SegRLs tm1 hp (hp ^ 2) (d ++ w) (w ++ d) := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem Icarry : SegRLs tm1 hi hc [] [] := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem Pcarry0 : SegRLs tm1 hp hc [0, 0] [0, 0] := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem Pcarry1 : SegRLs tm1 hp hc t t := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem carry0 : SegRLs tm1 hc [] [0, 0] [1, 0] := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem carry1 : SegRLs tm1 hc hc [1, 0] [0, 0] := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem carry_bit0 : SegRLs tm1 hc [] [0] [1] := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem carry_word0 : SegRLs tm1 hc [] [0, 1, 0] d := + segRLs_c_spec tm1 (T := 500) (by decide) + +-- Overflow finite rules via hm = [((B, [1]), (A, [0]))] +theorem Iov_t : SegRLs tm1 hi hm t t := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem Qov_00 : SegRLs tm1 hq hm [0, 0] [0] := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem Mov_t : SegRLs tm1 hm hm t [0, 0] := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem Mov_dp : SegRLs tm1 hm hp d [0, 1, 0] := + segRLs_c_spec tm1 (T := 500) (by decide) +theorem Mov_dq : SegRLs tm1 hm hq d [0, 1, 0, 1] := + segRLs_c_spec tm1 (T := 500) (by decide) + +theorem Mov_ts (k : ℕ) : SegRLs tm1 hm hm (t ^ k) ([0, 0] ^ k) := by + induction k with + | zero => exact SegRLs.empty tm1 hm + | succ k ih => + rw [Longitudinal.pow_succ_list, Longitudinal.pow_succ_list] + exact Mov_t.concat ih + +theorem lpow_shift_list {α : Type*} (xs : List α) (k : ℕ) : + xs ^ k ++ xs = xs ++ xs ^ k := by + rw [← pow_succ_list', Longitudinal.pow_succ_list] + +theorem lpow_shift_stream (xs : List Sym) (k : ℕ) (r : ListBlank Sym) : + xs ^ k +> (xs +> r) = xs +> (xs ^ k +> r) := by + rw [← append_assoc, lpow_shift_list, append_assoc] + +theorem lpow_rotate' (a₁ a₀ : List Sym) (b : ListBlank Sym) (n : ℕ) : + (a₁ ++ a₀) ^ n +> (a₁ +> b) = a₁ +> ((a₀ ++ a₁) ^ n +> b) := by + induction n with + | zero => simp + | succ n ih => + rw [Longitudinal.pow_succ_list, Longitudinal.pow_succ_list, append_assoc, append_assoc, ih] + simp only [append_assoc] + +theorem lpow_rotate_list {α : Type*} (a₁ a₀ : List α) (n : ℕ) : + (a₁ ++ a₀) ^ n ++ a₁ = a₁ ++ (a₀ ++ a₁) ^ n := by + induction n with + | zero => simp + | succ n ih => + rw [Longitudinal.pow_succ_list, Longitudinal.pow_succ_list] + simp only [List.append_assoc] + rw [ih] + +theorem zero_pair_shift (k : ℕ) (ys : List Sym) : + ([0] : List Sym) ++ ([0, 0] ^ k ++ (0 :: ys)) = [0, 0] ^ (1 + k) ++ ys := by + induction k with + | zero => rfl + | succ k ih => + have h1 : ([0, 0] : List Sym) ^ (k + 1) = [0, 0] ++ [0, 0] ^ k := rfl + have h2 : ([0, 0] : List Sym) ^ (1 + (k + 1)) = [0, 0] ++ [0, 0] ^ (1 + k) := rfl + rw [h1, h2, List.append_assoc] + change (0 : Sym) :: 0 :: ([0] ++ ([0, 0] ^ k ++ (0 :: ys))) = 0 :: 0 :: ([0, 0] ^ (1 + k) ++ ys) + rw [ih] + +theorem P_add {a b : ℕ} {r s z : ListBlank Sym} (h1 : P a r s) (h2 : P b s z) : + P (a + b) r z := + SideRLs.trans_add h1 h2 + +theorem I_add {a b : ℕ} {r s z : ListBlank Sym} (h1 : I a r s) (h2 : I b s z) : + I (a + b) r z := + SideRLs.trans_add h1 h2 + +theorem P_split (a b : ℕ) {r z : ListBlank Sym} (h : P (a + b) r z) : + ∃ s, P a r s ∧ P b s z := by + unfold P at h ⊢ + rw [pow_add_list] at h + exact h.split + +theorem I_split (a b : ℕ) {r z : ListBlank Sym} (h : I (a + b) r z) : + ∃ s, I a r s ∧ I b s z := by + unfold I at h ⊢ + rw [pow_add_list] at h + exact h.split + +theorem Pws (n k : ℕ) : SegRLs tm1 (hp ^ n) (hp ^ n) (w ^ k) (w ^ k) := by + induction k with + | zero => exact SegRLs.empty tm1 (hp ^ n) + | succ k ih => + rw [Longitudinal.pow_succ_list] + exact (Pw.wall_pow n).concat ih + +theorem Ivs (n k : ℕ) : SegRLs tm1 (hi ^ n) (hi ^ n) (v ^ k) (v ^ k) := by + induction k with + | zero => exact SegRLs.empty tm1 (hi ^ n) + | succ k ih => + rw [Longitudinal.pow_succ_list] + exact (Iv.wall_pow n).concat ih + +theorem Pts (n : ℕ) : SegRLs tm1 (hp ^ n) (hi ^ n) t t := + Pt.wall_pow n + +theorem Ids (n : ℕ) : SegRLs tm1 (hi ^ n) (hp ^ n) d d := + Id.wall_pow n + +theorem Pvs (n k : ℕ) : SegRLs tm1 (hp ^ n) (hi ^ (n * 2)) (v ^ (n + k)) (w ^ n ++ v ^ k) := by + induction n with + | zero => + rw [Nat.zero_add] + exact SegRLs.nil (M := tm1) (v ^ k) + | succ n ih => + have h_hi : hi ^ ((n + 1) * 2) = hi ^ 2 ++ hi ^ (n * 2) := by + have : (n + 1) * 2 = 2 + n * 2 := by omega + rw [this, pow_add_list] + have h_v : v ^ (n + 1 + k) = v ++ v ^ (n + k) := by + have : n + 1 + k = (n + k) + 1 := by omega + rw [this, Longitudinal.pow_succ_list] + have h_hp : hp ^ (n + 1) = hp ++ hp ^ n := rfl + have h_w : w ^ (n + 1) ++ v ^ k = w ++ (w ^ n ++ v ^ k) := by + rw [Longitudinal.pow_succ_list, List.append_assoc] + rw [h_hp, h_hi, h_v, h_w] + exact (Pv.concat (Ivs 2 (n + k))).trans ((Pw.wall_pow n).concat ih) + +theorem P_w (n k : ℕ) {r s : ListBlank Sym} (h : P n r s) : + P n (w ^ k +> r) (w ^ k +> s) := + (Pws n k).sideRLs_concat h + +theorem I_v (n k : ℕ) {r s : ListBlank Sym} (h : I n r s) : + I n (v ^ k +> r) (v ^ k +> s) := + (Ivs n k).sideRLs_concat h + +theorem P_t (n : ℕ) {r s : ListBlank Sym} (h : I n r s) : + P n (t +> r) (t +> s) := + (Pts n).sideRLs_concat h + +theorem I_d (n : ℕ) {r s : ListBlank Sym} (h : P n r s) : + I n (d +> r) (d +> s) := + (Ids n).sideRLs_concat h + +theorem P_d {r s : ListBlank Sym} (h : P 2 r s) : + P 1 (d +> r) (u +> s) := + Pd.sideRLs_concat h + +inductive G1 : ListBlank Sym → ListBlank Sym → Prop where + | GP {r s : ListBlank Sym} : P 1 r s → G1 r s + | GQ {r s : ListBlank Sym} : SideRLs tm1 hq r s → G1 r ([1] +> s) + +inductive G : ℕ → ListBlank Sym → ListBlank Sym → Prop where + | G0 (r : ListBlank Sym) : G 0 r r + | GS {n : ℕ} {r s z : ListBlank Sym} : G1 r s → G n s z → G (n + 1) r z + +theorem G_add {a b : ℕ} {r s z : ListBlank Sym} (h1 : G a r s) (h2 : G b s z) : + G (a + b) r z := by + induction h1 with + | G0 _ => simpa only [Nat.zero_add] using h2 + | @GS n r' s' z' hg1 _ ih => + have : n + 1 + b = (n + b) + 1 := by omega + rw [this] + exact .GS hg1 (ih h2) + +theorem G_w {n : ℕ} {r s : ListBlank Sym} (h : G n r s) : + P n (w +> r) (w +> s) := by + induction h with + | G0 _ => exact .nil _ + | @GS n r' s' z' hg1 _ ih => + have : n + 1 = 1 + n := by omega + rw [this] + refine P_add (a := 1) (b := n) ?_ ih + cases hg1 with + | GP hp1 => exact Pw.sideRLs_concat hp1 + | GQ hq1 => + have : P 1 (w +> r') ((w ++ [1]) +> _) := Pwq.sideRLs_concat hq1 + simpa only [append_assoc] using this + +theorem G_d {n : ℕ} {r s : ListBlank Sym} (h : G n r s) : + I n (d +> r) (d +> s) := by + induction h with + | G0 _ => exact .nil _ + | @GS n r' s' z' hg1 _ ih => + have : n + 1 = 1 + n := by omega + rw [this] + refine I_add (a := 1) (b := n) ?_ ih + cases hg1 with + | GP hp1 => exact Id.sideRLs_concat hp1 + | GQ hq1 => + have : I 1 (d +> r') ((d ++ [1]) +> _) := Iq.sideRLs_concat hq1 + simpa only [append_assoc] using this + +theorem P_G {n : ℕ} {r s : ListBlank Sym} (h : P n r s) : G n r s := by + induction n generalizing r with + | zero => + cases h + exact .G0 _ + | succ n ih => + have h' : P (1 + n) r s := by + have : 1 + n = n + 1 := by omega + rwa [this] + obtain ⟨z, h1, hn⟩ := P_split 1 n h' + exact .GS (.GP h1) (ih hn) + +theorem column1 (b : ℕ) {r x s : ListBlank Sym} (hi2 : I 2 r x) (hg : G (1 + b) x s) : + ∃ z, P b (v +> r) z ∧ P 1 (d +> z) (w +> (d +> s)) := by + have h : P (1 + (1 + b)) (v +> r) (w +> s) := + P_add (Pv.sideRLs_concat hi2) (G_w hg) + have heq : 1 + (1 + b) = b + 2 := by omega + rw [heq] at h + obtain ⟨z, hz, h2⟩ := P_split b 2 h + refine ⟨z, hz, ?_⟩ + have hpd := P_d h2 + simpa only [u, w, d, append_cons, append_nil] using hpd + +theorem column_aux (a b : ℕ) {r x s : ListBlank Sym} + (hi_a : I (a * 2) r x) (hg : G (a + b) x s) : + ∃ z, G b (v ^ a +> r) z ∧ G a (d +> z) (w ^ a +> (d +> s)) := by + induction a generalizing b r x s with + | zero => + cases hi_a + exact ⟨s, by simpa using hg, .G0 _⟩ + | succ a ih => + have hi' : I (2 + a * 2) r x := by + have : 2 + a * 2 = (a + 1) * 2 := by omega + rwa [this] + obtain ⟨y, hy, hx⟩ := I_split 2 (a * 2) hi' + have hg' : G (a + (1 + b)) x s := by + have : a + (1 + b) = a + 1 + b := by omega + rwa [this] + obtain ⟨z, hz, hs⟩ := ih (1 + b) hx hg' + obtain ⟨z', hz', h1⟩ := column1 b (I_v 2 a hy) hz + refine ⟨z', P_G hz', ?_⟩ + have : a + 1 = 1 + a := by omega + rw [Longitudinal.pow_succ_list w, append_assoc, this] + exact P_G (P_add h1 (G_w hs)) + +inductive Run (a b c : ℕ) (r s : ListBlank Sym) : Prop where + | run (x y : ListBlank Sym) : P c r x → I b ([1] +> x) y → G a y s → Run a b c r s + +abbrev Suffix (a b : ℕ) (r s : ListBlank Sym) : Prop := Run a b 2 r s + +theorem column {a b : ℕ} {r s : ListBlank Sym} (h : Suffix (a + b) (a * 2 + 1) r s) : + Suffix a b (w ^ a +> (d +> r)) (w ^ a +> (d +> s)) := by + rcases h with ⟨x, y, hp2, hi_ab, ha⟩ + have hi' : I (1 + a * 2) ([1] +> x) y := by + have : 1 + a * 2 = a * 2 + 1 := by omega + rwa [this] + obtain ⟨z, h1, hz⟩ := I_split 1 (a * 2) hi' + obtain ⟨z', hb, ha'⟩ := column_aux a b hz ha + refine ⟨w ^ a +> (t +> z), d +> z', ?_, ?_, ha'⟩ + · refine P_w 2 a (P_add (a := 1) (b := 1) (P_d hp2) ?_) + have hpt := P_t 1 h1 + simpa only [u, t, append_cons, append_nil] using hpt + · have hrot := lpow_rotate' t d z a + have hgd := G_d hb + have hwv : w = t ++ d := rfl + have hvw : v = d ++ t := rfl + have h_eq : ([1] : List Sym) +> (w ^ a +> (t +> z)) = d +> (v ^ a +> z) := by + rw [hwv, hrot, ← hvw] + rfl + rwa [h_eq] + +theorem PdPd (b : ℕ) {r x s : ListBlank Sym} (hp2 : P 2 r x) (hi1 : I (1 + b) ([1] +> x) s) : + ∃ z, P b (d +> r) z ∧ P 1 (d +> z) (w +> s) := by + have h : P (1 + (1 + b)) (d +> r) (t +> s) := by + refine P_add (a := 1) (b := 1 + b) (P_d hp2) ?_ + have hpt := P_t (1 + b) hi1 + simpa only [u, t, append_cons, append_nil] using hpt + have heq : 1 + (1 + b) = b + 2 := by omega + rw [heq] at h + obtain ⟨z, hz, h2⟩ := P_split b 2 h + refine ⟨z, hz, ?_⟩ + have hpd := P_d h2 + simpa only [u, w, t, append_cons, append_nil] using hpd + +theorem run_w_g {a b c : ℕ} {r x y z s : ListBlank Sym} + (hg : G c r x) (hp2 : P 2 x y) (hi1 : I (1 + b) ([1] +> y) z) (ha : G a z s) : + Run (1 + a) b c (w +> r) (w +> s) := by + obtain ⟨z', hb, h1⟩ := PdPd b hp2 hi1 + exact ⟨w +> x, d +> z', G_w hg, I_d b hb, P_G (P_add h1 (G_w ha))⟩ + +theorem run_w {a b c : ℕ} {r s : ListBlank Sym} (h : Run a (1 + b) (c + 2) r s) : + Run (1 + a) b c (w +> r) (w +> s) := by + rcases h with ⟨x, y, hp_c2, hi1, ha⟩ + obtain ⟨z, hc, h2⟩ := P_split c 2 hp_c2 + exact run_w_g (P_G hc) h2 hi1 ha + +theorem run_ws (j a b c : ℕ) {r s : ListBlank Sym} + (h : Run a (b + j) (c + j * 2) r s) : + Run (a + j) b c (w ^ j +> r) (w ^ j +> s) := by + induction j generalizing b c with + | zero => simpa using h + | succ j ih => + have h' : Run a ((1 + b) + j) ((c + 2) + j * 2) r s := by + have h1 : (1 + b) + j = b + (j + 1) := by omega + have h2 : (c + 2) + j * 2 = c + (j + 1) * 2 := by omega + rwa [h1, h2] + have ih_res := run_w (ih (1 + b) (c + 2) h') + have h3 : 1 + (a + j) = a + (j + 1) := by omega + rw [Longitudinal.pow_succ_list, append_assoc, ← h3] + exact ih_res + +theorem column_partial {a b j : ℕ} {r s : ListBlank Sym} + (hj : j ≤ a) (h : Run (a - j) (b + j) (j * 2 + 2) r s) : + Suffix a b (w ^ j +> r) (w ^ j +> s) := by + have h' : Run (a - j) (b + j) (2 + j * 2) r s := by + have : 2 + j * 2 = j * 2 + 2 := by omega + rwa [this] + have hres := run_ws j (a - j) b 2 h' + have : a - j + j = a := by omega + rwa [this] at hres + +theorem column_early {a b j : ℕ} {r x y z s : ListBlank Sym} + (hj0 : 0 < j) (hja : j ≤ a) + (hg : G (j * 2) r x) (hp2 : P 2 x y) (hi_bj : I (b + j) ([1] +> y) z) (hs : G (a - j) z s) : + Suffix a b (w ^ j +> r) (w ^ j +> s) := by + rcases j with _ | j + · omega + · rw [Longitudinal.pow_succ_list w j, append_assoc w (w ^ j) r, append_assoc w (w ^ j) s, + ← lpow_shift_stream w j r, ← lpow_shift_stream w j s] + refine column_partial (j := j) (by omega) ?_ + have hg' : G (j * 2 + 2) r x := by + have : j * 2 + 2 = (j + 1) * 2 := by omega + rwa [this] + have hi' : I (1 + (b + j)) ([1] +> y) z := by + have : 1 + (b + j) = b + (j + 1) := by omega + rwa [this] + have hrun := run_w_g hg' hp2 hi' hs + have : 1 + (a - (j + 1)) = a - j := by omega + rwa [this] at hrun + +inductive Inner (j : ℕ) (r s : ListBlank Sym) : Prop where + | InnerP : P (j * 2 + 2) r s → Inner j r s + | InnerG (x : ListBlank Sym) : 0 < j → G (j * 2) r x → P 2 x s → Inner j r s + +theorem inner_column {a b j : ℕ} {r x y s : ListBlank Sym} + (hj : j ≤ a) (hin : Inner j r x) (hi_bj : I (b + j) ([1] +> x) y) (hg : G (a - j) y s) : + Suffix a b (w ^ j +> r) (w ^ j +> s) := by + cases hin with + | InnerP hp => exact column_partial hj ⟨x, y, hp, hi_bj, hg⟩ + | InnerG x' hj0 hg_j hp2 => exact column_early hj0 hj hg_j hp2 hi_bj hg + +def cfg (r : ListBlank Sym) : Cfg Sym Q := + default {{C}}> ([0, 0, 1, 0] +> r) + +theorem root_step {r s : ListBlank Sym} (h : P 1 r s) : + (cfg r) [tm1]⊢⁺ (cfg ([1] +> s)) := by + have h1 : (cfg r) [tm1]⊢* (toDHCfg ((B, [0]), .right) ([1, 1, 0] +> default) r) := + steps_spec tm1 10 ⟨[], [0, 0, 1, 0], C, .right⟩ + (x' := ⟨[0, 1, 1, 0], [], B, .right⟩) (by decide) default r + have h2 : (toDHCfg ((B, [0]), .right) ([1, 1, 0] +> default) r) [tm1]⊢⁺ + (toDHCfg ((C, [0]), .left) ([1, 1, 0] +> default) s) := + h.elim_single ([1, 1, 0] +> default) + have h3 : (toDHCfg ((C, [0]), .left) ([1, 1, 0] +> default) s) [tm1]⊢* (cfg ([1] +> s)) := by + have h3' := steps_spec tm1 50 ⟨[0], [1, 1, 0], C, .left⟩ + (x' := ⟨[0, 1, 0, 1], [], C, .left⟩) (by decide) default s + simpa [toDHCfg, toCfg, cfg, append_cons, ListBlank.head_cons, ListBlank.tail_cons] using h3' + exact stepStar_stepPlus_trans h1 (stepPlus_stepStar_trans h2 h3) + +theorem root_base {r s : ListBlank Sym} (h : Suffix 0 1 r s) : + (cfg (d +> (d +> r))) [tm1]⊢⁺ (cfg (d +> (d +> s))) := by + rcases h with ⟨x, y, hp2, hi1, ha⟩ + cases ha + have h1 : P 2 (d +> r) (t +> s) := by + refine P_add (a := 1) (b := 1) (P_d hp2) ?_ + have hpt := P_t 1 hi1 + simpa only [u, t, append_cons, append_nil] using hpt + have h2 : P 1 (d +> (d +> r)) (u +> (t +> s)) := P_d h1 + have h3 := root_step h2 + simpa only [u, d, t, append_cons, append_nil] using h3 + +inductive Frame : ℕ → ℕ → List Sym → Prop where + | Frame0 : Frame 0 1 (d ++ d) + | FrameS {a b : ℕ} {xs : List Sym} : Frame a b xs → Frame (a + b) (a * 2 + 1) (xs ++ w ^ a ++ d) + +theorem Frame_phase {a b : ℕ} {xs : List Sym} (h : Frame a b xs) : + (a = b ∧ a % 4 = 1) ∨ (b = a + 1 ∧ a % 2 = 0) := by + induction h with + | Frame0 => right; omega + | FrameS _ ih => + rcases ih with ⟨h1, h2⟩ | ⟨h1, h2⟩ + · right; omega + · left; omega + +theorem frame_step {a b : ℕ} {xs : List Sym} (hf : Frame a b xs) {r s : ListBlank Sym} + (hs : Suffix a b r s) : + (cfg (xs +> r)) [tm1]⊢⁺ (cfg (xs +> s)) := by + induction hf generalizing r s with + | Frame0 => + simpa only [append_assoc] using root_base hs + | FrameS _ ih => + simpa only [List.append_assoc, append_assoc] using ih (column hs) + +inductive Num : ℕ → ListBlank Sym → Prop where + | Num0 : Num 0 default + | Num00 (n : ℕ) {r : ListBlank Sym} : Num n r → Num (n * 2) ([0, 0] +> r) + | Num10 (n : ℕ) {r : ListBlank Sym} : Num n r → Num (n * 2 + 1) (t +> r) + +theorem carry_num_0 : SideRLs tm1 hc default (t +> default) := + sideRLs_c_spec tm1 (r := []) (r' := t) (T := 500) (by decide) + +theorem P_num_0 : P 1 default ([0, 0, 1, 0] +> default) := + sideRLs_c_spec tm1 (r := []) (r' := [0, 0, 1, 0]) (T := 500) (by decide) + +theorem carry_num {n : ℕ} {r : ListBlank Sym} (h : Num n r) : + ∃ s, Num (1 + n) s ∧ SideRLs tm1 hc r s := by + induction h with + | Num0 => exact ⟨t +> default, .Num10 0 .Num0, carry_num_0⟩ + | Num00 n hn _ => + refine ⟨t +> _, ?_, carry0.sideRLs_concat (.nil _)⟩ + have : 1 + n * 2 = n * 2 + 1 := by omega + rw [this] + exact .Num10 n hn + | Num10 n _ ih => + obtain ⟨s, hs, hc_s⟩ := ih + refine ⟨[0, 0] +> s, ?_, carry1.sideRLs_concat hc_s⟩ + have : 1 + (n * 2 + 1) = (1 + n) * 2 := by omega + rw [this] + exact .Num00 (1 + n) hs + +theorem I_num {n : ℕ} {r : ListBlank Sym} (h : Num n r) : + ∃ s, Num (1 + n) s ∧ I 1 r s := by + obtain ⟨s, hs, hc_s⟩ := carry_num h + exact ⟨s, hs, Icarry.sideRLs_concat hc_s⟩ + +theorem P_num {n : ℕ} {r : ListBlank Sym} (h : Num n r) : + ∃ s, Num (n + 2) s ∧ P 1 r s := by + cases h with + | Num0 => + exact ⟨[0, 0, 1, 0] +> default, .Num00 1 (.Num10 0 .Num0), P_num_0⟩ + | Num00 n hn => + obtain ⟨s, hs, hc_s⟩ := carry_num hn + refine ⟨[0, 0] +> s, ?_, Pcarry0.sideRLs_concat hc_s⟩ + have : n * 2 + 2 = (1 + n) * 2 := by omega + rw [this] + exact .Num00 (1 + n) hs + | Num10 n hn => + obtain ⟨s, hs, hc_s⟩ := carry_num hn + refine ⟨t +> s, ?_, Pcarry1.sideRLs_concat hc_s⟩ + have : n * 2 + 1 + 2 = (1 + n) * 2 + 1 := by omega + rw [this] + exact .Num10 (1 + n) hs + +theorem I_nums (k : ℕ) {n : ℕ} {r : ListBlank Sym} (h : Num n r) : + ∃ s, Num (n + k) s ∧ I k r s := by + induction k generalizing n r with + | zero => exact ⟨r, h, .nil _⟩ + | succ k ih => + obtain ⟨s, hs, h1⟩ := I_num h + obtain ⟨z, hz, hk⟩ := ih hs + refine ⟨z, ?_, ?_⟩ + · have : n + (k + 1) = 1 + n + k := by omega + rwa [this] + · have : k + 1 = 1 + k := by omega + rw [this] + exact I_add h1 hk + +theorem P_nums (k : ℕ) {n : ℕ} {r : ListBlank Sym} (h : Num n r) : + ∃ s, Num (n + k * 2) s ∧ P k r s := by + induction k generalizing n r with + | zero => exact ⟨r, h, .nil _⟩ + | succ k ih => + obtain ⟨s, hs, h1⟩ := P_num h + obtain ⟨z, hz, hk⟩ := ih hs + refine ⟨z, ?_, ?_⟩ + · have : n + (k + 1) * 2 = n + 2 + k * 2 := by omega + rwa [this] + · have : k + 1 = 1 + k := by omega + rw [this] + exact P_add h1 hk + +theorem G_nums (k : ℕ) {n : ℕ} {r : ListBlank Sym} (h : Num n r) : + ∃ s, Num (n + k * 2) s ∧ G k r s := by + obtain ⟨s, hs, hp_s⟩ := P_nums k h + exact ⟨s, hs, P_G hp_s⟩ + +inductive Word : ℕ → ℕ → List Sym → Prop where + | Word0 : Word 0 0 [0, 1, 0] + | Word1 : Word 0 1 d + | Word00 (k n : ℕ) {xs : List Sym} : Word k n xs → Word (k + 1) (n * 2) ([0, 0] ++ xs) + | Word10 (k n : ℕ) {xs : List Sym} : Word k n xs → Word (k + 1) (n * 2 + 1) (t ++ xs) + +theorem Word_bound {k n : ℕ} {xs : List Sym} (h : Word k n xs) : + n < 2 ^ (1 + k) := by + induction h with + | Word0 => decide + | Word1 => decide + | Word00 k n _ ih => + have : 2 ^ (1 + (k + 1)) = 2 ^ (1 + k) * 2 := by ring + omega + | Word10 k n _ ih => + have : 2 ^ (1 + (k + 1)) = 2 ^ (1 + k) * 2 := by ring + omega + +inductive Bin : ℕ → ℕ → List Sym → Prop where + | Bin0 : Bin 0 0 [0] + | Bin1 : Bin 0 1 [1] + | Bin00 (k n : ℕ) {xs : List Sym} : Bin k n xs → Bin (k + 1) (n * 2) ([0, 0] ++ xs) + | Bin10 (k n : ℕ) {xs : List Sym} : Bin k n xs → Bin (k + 1) (n * 2 + 1) (t ++ xs) + +private theorem Bin_unique_aux {k n m : ℕ} {xs ys : List Sym} + (h : Bin k n xs) (h' : Bin k m ys) (heq : n = m) : xs = ys := by + induction h generalizing m ys with + | Bin0 => + cases h' with + | Bin0 => rfl + | Bin1 => omega + | Bin1 => + cases h' with + | Bin0 => omega + | Bin1 => rfl + | Bin00 k n h_xs ih => + cases h' with + | Bin00 _ n' h_ys => + rw [ih h_ys (by omega)] + | Bin10 _ n' _ => omega + | Bin10 k n h_xs ih => + cases h' with + | Bin00 _ n' _ => omega + | Bin10 _ n' h_ys => + rw [ih h_ys (by omega)] + +theorem Bin_unique {k n : ℕ} {xs : List Sym} (h : Bin k n xs) {ys : List Sym} (h' : Bin k n ys) : + xs = ys := + Bin_unique_aux h h' rfl + +theorem Bin_bound {k n : ℕ} {xs : List Sym} (h : Bin k n xs) : + n < 2 ^ (1 + k) := by + induction h with + | Bin0 => decide + | Bin1 => decide + | Bin00 k n _ ih => + have : 2 ^ (1 + (k + 1)) = 2 ^ (1 + k) * 2 := by ring + omega + | Bin10 k n _ ih => + have : 2 ^ (1 + (k + 1)) = 2 ^ (1 + k) * 2 := by ring + omega + +theorem Bin_zero (k : ℕ) : Bin k 0 ([0, 0] ^ k ++ [0]) := by + induction k with + | zero => exact .Bin0 + | succ k ih => + rw [Longitudinal.pow_succ_list, List.append_assoc] + exact .Bin00 k 0 ih + +theorem Bin_top (k : ℕ) : Bin k (2 ^ k) ([0, 0] ^ k ++ [1]) := by + induction k with + | zero => exact .Bin1 + | succ k ih => + have h2 : 2 ^ (k + 1) = 2 ^ k * 2 := by ring + rw [Longitudinal.pow_succ_list, List.append_assoc, h2] + exact .Bin00 k (2 ^ k) ih + +theorem Bin_one {k : ℕ} (hk : 0 < k) : Bin k 1 ([1] ++ [0, 0] ^ k) := by + rcases k with _ | k + · omega + · have h := Bin.Bin10 k 0 (Bin_zero k) + have hrot : ([0, 0] : List Sym) ^ k ++ [0] = [0] ++ [0, 0] ^ k := + lpow_rotate_list ([0] : List Sym) [0] k + have h_eq : t ++ ([0, 0] ^ k ++ [0]) = [1] ++ [0, 0] ^ (k + 1) := by + change (1 : Sym) :: (0 :: ([0, 0] ^ k ++ [0])) = 1 :: ([0, 0] ++ [0, 0] ^ k) + congr 1 + rw [hrot] + rfl + rwa [h_eq] at h + +theorem Bin_inc {k n : ℕ} {xs : List Sym} (h : Bin k n xs) (hn : n + 1 < 2 ^ (1 + k)) : + ∃ ys, Bin k (n + 1) ys ∧ SegRLs tm1 hc [] xs ys := by + induction h with + | Bin0 => exact ⟨[1], .Bin1, carry_bit0⟩ + | Bin1 => omega + | Bin00 k n h_xs _ => + exact ⟨t ++ _, .Bin10 k n h_xs, carry0.concat (.nil _)⟩ + | Bin10 k n h_xs ih => + have hn' : n + 1 < 2 ^ (1 + k) := by + have : 2 ^ (1 + (k + 1)) = 2 ^ (1 + k) * 2 := by ring + omega + obtain ⟨ys, hy, hc_y⟩ := ih hn' + refine ⟨[0, 0] ++ ys, ?_, carry1.concat hc_y⟩ + have : n * 2 + 1 + 1 = (n + 1) * 2 := by omega + rw [this] + exact .Bin00 k (n + 1) hy + +theorem I_Bin {k n : ℕ} {xs : List Sym} (h : Bin k n xs) (hn : n + 1 < 2 ^ (1 + k)) : + ∃ ys, Bin k (n + 1) ys ∧ SegRLs tm1 hi [] xs ys := by + obtain ⟨ys, hy, hc_y⟩ := Bin_inc h hn + exact ⟨ys, hy, Icarry.concat hc_y⟩ + +theorem P_Bin {k n : ℕ} {xs : List Sym} (h : Bin k n xs) (hk : 0 < k) (hn : n + 2 < 2 ^ (1 + k)) : + ∃ ys, Bin k (n + 2) ys ∧ SegRLs tm1 hp [] xs ys := by + cases h with + | Bin0 => omega + | Bin1 => omega + | Bin00 k' n' h_xs => + have hn' : n' + 1 < 2 ^ (1 + k') := by + have : 2 ^ (1 + (k' + 1)) = 2 ^ (1 + k') * 2 := by ring + omega + obtain ⟨ys, hy, hc_y⟩ := Bin_inc h_xs hn' + refine ⟨[0, 0] ++ ys, ?_, Pcarry0.concat hc_y⟩ + have : n' * 2 + 2 = (n' + 1) * 2 := by omega + rw [this] + exact .Bin00 k' (n' + 1) hy + | Bin10 k' n' h_xs => + have hn' : n' + 1 < 2 ^ (1 + k') := by + have : 2 ^ (1 + (k' + 1)) = 2 ^ (1 + k') * 2 := by ring + omega + obtain ⟨ys, hy, hc_y⟩ := Bin_inc h_xs hn' + refine ⟨t ++ ys, ?_, Pcarry1.concat hc_y⟩ + have : n' * 2 + 1 + 2 = (n' + 1) * 2 + 1 := by omega + rw [this] + exact .Bin10 k' (n' + 1) hy + +theorem Bin_repeat (h : List (DH0 Sym Q × DH0 Sym Q)) (s k : ℕ) + (hstep : ∀ n xs, Bin k n xs → n + s < 2 ^ (1 + k) → ∃ ys, Bin k (n + s) ys ∧ + SegRLs tm1 h [] xs ys) + (i : ℕ) {n : ℕ} {xs : List Sym} (hw : Bin k n xs) (hn : n + i * s < 2 ^ (1 + k)) : + ∃ ys, Bin k (n + i * s) ys ∧ SegRLs tm1 (h ^ i) [] xs ys := by + induction i generalizing n xs with + | zero => exact ⟨xs, by simpa using hw, .nil _⟩ + | succ i ih => + have hn1 : n + s < 2 ^ (1 + k) := by + have : (i + 1) * s = s + i * s := by ring + omega + obtain ⟨ys, hy, h1⟩ := hstep n xs hw hn1 + have hn2 : (n + s) + i * s < 2 ^ (1 + k) := by + have : (i + 1) * s = s + i * s := by ring + omega + obtain ⟨zs, hz, hi⟩ := ih hy hn2 + refine ⟨zs, ?_, ?_⟩ + · have : n + (i + 1) * s = n + s + i * s := by ring + rwa [this] + · rw [Longitudinal.pow_succ_list] + exact h1.trans hi + +theorem I_Bins {k : ℕ} (i : ℕ) {n : ℕ} {xs : List Sym} (hw : Bin k n xs) (hn : n + i < 2 ^ (1 + + k)) : + ∃ ys, Bin k (n + i) ys ∧ SegRLs tm1 (hi ^ i) [] xs ys := by + have hn' : n + i * 1 < 2 ^ (1 + k) := by omega + have hres := Bin_repeat hi 1 k (fun _ _ h hlt => I_Bin h hlt) i hw hn' + simpa only [Nat.mul_one] using hres + +theorem P_Bins {k : ℕ} (i : ℕ) {n : ℕ} {xs : List Sym} (hw : Bin k n xs) (hk : 0 < k) + (hn : n + i * 2 < 2 ^ (1 + k)) : + ∃ ys, Bin k (n + i * 2) ys ∧ SegRLs tm1 (hp ^ i) [] xs ys := + Bin_repeat hp 2 k (fun _ _ h hlt => P_Bin h hk hlt) i hw hn + +theorem Word_inc {k n : ℕ} {xs : List Sym} (h : Word k n xs) (hn : n + 1 < 2 ^ (1 + k)) : + ∃ ys, Word k (n + 1) ys ∧ SegRLs tm1 hc [] xs ys := by + induction h with + | Word0 => exact ⟨d, .Word1, carry_word0⟩ + | Word1 => omega + | Word00 k n h_xs _ => + exact ⟨t ++ _, .Word10 k n h_xs, carry0.concat (.nil _)⟩ + | Word10 k n h_xs ih => + have hn' : n + 1 < 2 ^ (1 + k) := by + have : 2 ^ (1 + (k + 1)) = 2 ^ (1 + k) * 2 := by ring + omega + obtain ⟨ys, hy, hc_y⟩ := ih hn' + refine ⟨[0, 0] ++ ys, ?_, carry1.concat hc_y⟩ + have : n * 2 + 1 + 1 = (n + 1) * 2 := by omega + rw [this] + exact .Word00 k (n + 1) hy + +theorem I_word_inc {k n : ℕ} {xs : List Sym} (r : ListBlank Sym) + (h : Word k n xs) (hn : n + 1 < 2 ^ (1 + k)) : + ∃ ys, Word k (n + 1) ys ∧ I 1 (xs +> r) (ys +> r) := by + obtain ⟨ys, hy, hc_y⟩ := Word_inc h hn + exact ⟨ys, hy, (Icarry.concat hc_y).sideRLs_concat (.nil _)⟩ + +def one : ℕ → List Sym + | 0 => d + | k + 1 => t ++ [0, 0] ^ k ++ [0, 1, 0] + +theorem I_overflow_p (k : ℕ) {r s : ListBlank Sym} (h : P 1 r s) : + I 1 (t ^ k +> (d +> r)) (one k +> s) := by + rcases k with _ | k + · exact Id.sideRLs_concat h + · have hseg : SegRLs tm1 hi hp (t ++ (t ^ k ++ d)) (t ++ ([0, 0] ^ k ++ [0, 1, 0])) := + Iov_t.concat ((Mov_ts k).concat Mov_dp) + have hres : I 1 ((t ++ (t ^ k ++ d)) +> r) ((t ++ ([0, 0] ^ k ++ [0, 1, 0])) +> s) := + hseg.sideRLs_concat h + simpa only [one, Longitudinal.pow_succ_list, List.append_assoc, append_assoc] using hres + +theorem I_overflow_q (k : ℕ) {r s : ListBlank Sym} (h : SideRLs tm1 hq r s) : + I 1 (t ^ k +> (d +> r)) (one k +> ([1] +> s)) := by + rcases k with _ | k + · have hres : I 1 (d +> r) ((d ++ [1]) +> s) := Iq.sideRLs_concat h + simpa only [one, Longitudinal.pow_zero_list, append_nil, append_assoc] using hres + · have hseg : SegRLs tm1 hi hq (t ++ (t ^ k ++ d)) (t ++ ([0, 0] ^ k ++ [0, 1, 0, 1])) := + Iov_t.concat ((Mov_ts k).concat Mov_dq) + have hres : I 1 ((t ++ (t ^ k ++ d)) +> r) ((t ++ ([0, 0] ^ k ++ [0, 1, 0, 1])) +> s) := + hseg.sideRLs_concat h + simpa only [one, Longitudinal.pow_succ_list, List.append_assoc, append_assoc, append_cons, + append_nil] using hres + +theorem Q_overflow_p (k : ℕ) {r s : ListBlank Sym} (h : P 1 r s) : + SideRLs tm1 hq ([0, 0] +> (t ^ k +> (d +> r))) ([0, 0] ^ (1 + k) +> (t +> s)) := by + have hseg : SegRLs tm1 hq hp ([0, 0] ++ (t ^ k ++ d)) ([0] ++ ([0, 0] ^ k ++ [0, 1, 0])) := + Qov_00.concat ((Mov_ts k).concat Mov_dp) + rw [zero_pair_shift k t] at hseg + have hres := hseg.sideRLs_concat h + simpa only [append_assoc] using hres + +theorem Q_overflow_q (k : ℕ) {r s : ListBlank Sym} (h : SideRLs tm1 hq r s) : + SideRLs tm1 hq ([0, 0] +> (t ^ k +> (d +> r))) ([0, 0] ^ (1 + k) +> (t +> ([1] +> s))) := by + have hseg : SegRLs tm1 hq hq ([0, 0] ++ (t ^ k ++ d)) ([0] ++ ([0, 0] ^ k ++ [0, 1, 0, 1])) := + Qov_00.concat ((Mov_ts k).concat Mov_dq) + rw [zero_pair_shift k [1, 0, 1]] at hseg + have hres := hseg.sideRLs_concat h + simpa only [append_assoc, append_cons, append_nil] using hres + +theorem Q_R {r s : ListBlank Sym} (h : SideRLs tm1 hq r ([0, 0] +> s)) : + SideRLs tm1 hr r s := by + refine .cons (fun l => ?_) (.nil _) + have h1 := h.elim_single l + simpa only [toDHCfg, append_assoc, append_cons, append_nil] using h1 + +theorem P_d_second_Q {r x s : ListBlank Sym} (hp1 : P 1 r x) (hq1 : SideRLs tm1 hq x s) : + P 1 (d +> r) ([1, 0, 0, 0] +> s) := + PdQP.sideRLs_concat (hp1.trans hq1) + +theorem G_zero0_raw : P 1 (d +> default) ((t ++ one 2) +> default) := + sideRLs_c_spec tm1 (r := d) (r' := t ++ one 2) (T := 500) (by decide) + +theorem G_zero0 : G1 (d +> default) ((t ++ one 2) +> default) := + .GP G_zero0_raw + +theorem G_zero1_raw : P 1 ((d ++ t) +> default) ((w ++ [0, 0, 1, 0]) +> default) := + sideRLs_c_spec tm1 (r := d ++ t) (r' := w ++ [0, 0, 1, 0]) (T := 500) (by decide) + +theorem G_zero1 : G1 (d +> (t +> default)) (w +> ([0, 0, 1, 0] +> default)) := by + have h := G1.GP G_zero1_raw + simpa only [append_assoc] using h + + + +theorem pow2_succ_right (k : ℕ) : 2 ^ (k + 1) = 2 ^ k * 2 := by ring +theorem pow2_succ_left (k : ℕ) : 2 ^ (1 + k) = 2 ^ k * 2 := by ring +theorem pow2_1_succ (k : ℕ) : 2 ^ (1 + (k + 1)) = 2 ^ (1 + k) * 2 := by ring +theorem pow2_pos (k : ℕ) : 0 < 2 ^ k := Nat.pos_of_ne_zero (by positivity) + +theorem Q_overflow (k : ℕ) {r s : ListBlank Sym} (h : G1 r s) : + SideRLs tm1 hq ([0, 0] +> (t ^ k +> (d +> r))) ([0, 0] ^ (1 + k) +> (t +> s)) := by + cases h with + | GP hp1 => exact Q_overflow_p k hp1 + | GQ hq1 => exact Q_overflow_q k hq1 + +theorem Word_zero (k : ℕ) : Word k 0 ([0, 0] ^ k ++ [0, 1, 0]) := by + induction k with + | zero => exact .Word0 + | succ k ih => + rw [Longitudinal.pow_succ_list, List.append_assoc] + exact .Word00 k 0 ih + +theorem Word_one (k : ℕ) : Word k 1 (one k) := by + rcases k with _ | k + · exact .Word1 + · simp only [one, List.append_assoc] + exact .Word10 k 0 (Word_zero k) + +theorem Word_max {k n : ℕ} {xs : List Sym} (h : Word k n xs) (hn : n + 1 = 2 ^ (1 + k)) : + xs = t ^ k ++ d := by + induction h with + | Word0 => omega + | Word1 => rfl + | Word00 k n _ _ => + have := pow2_1_succ k + omega + | Word10 k n h_xs ih => + have h_p := pow2_1_succ k + have hn' : n + 1 = 2 ^ (1 + k) := by omega + rw [Longitudinal.pow_succ_list, List.append_assoc, ih hn'] + +theorem Word_before_Q {k n : ℕ} {xs : List Sym} + (h : Word (k + 1) n xs) (he : n + 2 = 2 ^ (2 + k)) : + xs = [0, 0] ++ t ^ k ++ d := by + have hp1 : 2 ^ (2 + k) = 2 ^ (1 + k) * 2 := by ring + cases h with + | Word00 _ n' hy => + rw [Word_max hy (by omega), List.append_assoc] + | Word10 _ n' _ => omega + +theorem I_overflow (k : ℕ) {r s : ListBlank Sym} (h : G1 r s) : + I 1 (t ^ k +> (d +> r)) (one k +> s) := by + cases h with + | GP hp1 => exact I_overflow_p k hp1 + | GQ hq1 => exact I_overflow_q k hq1 + +theorem P_word_inc {k n : ℕ} {xs : List Sym} (r : ListBlank Sym) + (h : Word k n xs) (hk : 0 < k) (hn : n + 2 < 2 ^ (1 + k)) : + ∃ ys, Word k (n + 2) ys ∧ P 1 (xs +> r) (ys +> r) := by + cases h with + | Word0 => omega + | Word1 => omega + | Word00 k' n' h_xs => + have hn' : n' + 1 < 2 ^ (1 + k') := by + have := pow2_1_succ k' + omega + obtain ⟨ys, hy, hc_y⟩ := Word_inc h_xs hn' + refine ⟨[0, 0] ++ ys, ?_, (Pcarry0.concat hc_y).sideRLs_concat (.nil _)⟩ + have : n' * 2 + 2 = (n' + 1) * 2 := by omega + rw [this] + exact .Word00 k' (n' + 1) hy + | Word10 k' n' h_xs => + have hn' : n' + 1 < 2 ^ (1 + k') := by + have := pow2_1_succ k' + omega + obtain ⟨ys, hy, hc_y⟩ := Word_inc h_xs hn' + refine ⟨t ++ ys, ?_, (Pcarry1.concat hc_y).sideRLs_concat (.nil _)⟩ + have : n' * 2 + 1 + 2 = (n' + 1) * 2 + 1 := by omega + rw [this] + exact .Word10 k' (n' + 1) hy + +theorem P_word_linear {k : ℕ} (i : ℕ) {n : ℕ} {xs : List Sym} (r : ListBlank Sym) + (hw : Word k n xs) (hk : 0 < k) (hbound : n + i * 2 < 2 ^ (1 + k)) : + ∃ ys, Word k (n + i * 2) ys ∧ P i (xs +> r) (ys +> r) := by + induction i generalizing n xs with + | zero => exact ⟨xs, by simpa using hw, .nil _⟩ + | succ i ih => + have hb1 : n + 2 < 2 ^ (1 + k) := by omega + obtain ⟨ys, hy, hp1⟩ := P_word_inc r hw hk hb1 + have hb2 : (n + 2) + i * 2 < 2 ^ (1 + k) := by omega + obtain ⟨zs, hz, hrest⟩ := ih hy hb2 + refine ⟨zs, ?_, ?_⟩ + · have : n + (i + 1) * 2 = n + 2 + i * 2 := by omega + rwa [this] + · have : i + 1 = 1 + i := by omega + rw [this] + exact P_add hp1 hrest + +theorem G_word_odd (k : ℕ) {r s : ListBlank Sym} (h : G1 r s) : + G1 (t ^ (1 + k) +> (d +> r)) ((t ++ one k) +> s) := by + have h1 : t ^ (1 + k) +> (d +> r) = t +> (t ^ k +> (d +> r)) := by + have : 1 + k = k + 1 := by omega + rw [this, Longitudinal.pow_succ_list, append_assoc] + rw [h1, append_assoc] + exact .GP (P_t 1 (I_overflow k h)) + +theorem G_word_even (k : ℕ) {r s : ListBlank Sym} (h : G1 r s) : + G1 ([0, 0] +> (t ^ k +> (d +> r))) (one (k + 1) +> s) := by + have hq_ov := Q_overflow k h + have hgq := G1.GQ hq_ov + have h_eq : ([1] : List Sym) +> ([0, 0] ^ (1 + k) +> (t +> s)) = one (k + 1) +> s := by + have hrot : ([0, 0] : List Sym) ^ k ++ [0] = [0] ++ [0, 0] ^ k := + lpow_rotate_list ([0] : List Sym) [0] k + have h_list : ([1] : List Sym) ++ [0, 0] ^ (1 + k) ++ t = one (k + 1) := by + have : 1 + k = k + 1 := by omega + rw [this, Longitudinal.pow_succ_list, one] + change (1 : Sym) :: 0 :: (0 :: [0, 0] ^ k ++ t) = 1 :: 0 :: ([0, 0] ^ k ++ [0, 1, 0]) + congr 2 + have h2 : (0 : Sym) :: [0, 0] ^ k ++ t = ([0] ++ [0, 0] ^ k) ++ t := rfl + rw [h2, ← hrot, List.append_assoc] + rfl + rw [← h_list] + simp only [List.append_assoc, append_assoc] + rwa [h_eq] at hgq + +theorem G_split (a b : ℕ) {r s : ListBlank Sym} (h : G (a + b) r s) : + ∃ z, G a r z ∧ G b z s := by + induction a generalizing r with + | zero => exact ⟨r, .G0 r, by simpa using h⟩ + | succ a ih => + have h' : G ((a + b) + 1) r s := by + have : (a + b) + 1 = a + 1 + b := by omega + rwa [this] + cases h' with + | GS h1 hn => + obtain ⟨z', ha, hb⟩ := ih hn + exact ⟨z', .GS h1 ha, hb⟩ + +theorem G_single {r s : ListBlank Sym} (h : G1 r s) : G 1 r s := + .GS h (.G0 s) + +theorem G_unone {r s : ListBlank Sym} (h : G 1 r s) : G1 r s := by + cases h with + | GS h1 hn => + cases hn + exact h1 + +inductive ICounter (k : ℕ) : ℕ → ℕ → ℕ → Prop where + | ICinc (n : ℕ) : n + 1 < 2 ^ (1 + k) → ICounter k n (n + 1) 0 + | ICov (n : ℕ) : n + 1 = 2 ^ (1 + k) → ICounter k n 1 1 + +theorem I_counter {k n n' c : ℕ} {xs : List Sym} {r s : ListBlank Sym} + (hw : Word k n xs) (hc : ICounter k n n' c) (hg : G c r s) : + ∃ ys, Word k n' ys ∧ I 1 (xs +> r) (ys +> s) := by + cases hc with + | ICinc hn => + cases hg + exact I_word_inc r hw hn + | ICov hn => + refine ⟨one k, Word_one k, ?_⟩ + rw [Word_max hw hn, append_assoc] + exact I_overflow k (G_unone hg) + +inductive GCounter (k : ℕ) : ℕ → ℕ → ℕ → Prop where + | GCinc (n : ℕ) : n + 2 < 2 ^ (1 + k) → GCounter k n (n + 2) 0 + | GCev (n : ℕ) : n + 2 = 2 ^ (1 + k) → GCounter k n 1 1 + | GCod (n : ℕ) : n + 1 = 2 ^ (1 + k) → GCounter k n 3 1 + +theorem G_counter {k n n' c : ℕ} {xs : List Sym} {r s : ListBlank Sym} + (hw : Word k n xs) (hk : 0 < k) (hc : GCounter k n n' c) (hg : G c r s) : + ∃ ys, Word k n' ys ∧ G1 (xs +> r) (ys +> s) := by + cases hc with + | GCinc hn => + cases hg + obtain ⟨ys, hy, hp1⟩ := P_word_inc r hw hk hn + exact ⟨ys, hy, .GP hp1⟩ + | GCev hn => + cases hw with + | Word0 => omega + | Word1 => omega + | Word00 k' n' hw' => + have hp := pow2_1_succ k' + have en : n' + 1 = 2 ^ (1 + k') := by omega + refine ⟨one (k' + 1), Word_one (k' + 1), ?_⟩ + rw [Word_max hw' en] + simpa only [List.append_assoc, append_assoc] using G_word_even k' (G_unone hg) + | Word10 k' n' _ => + have hp := pow2_1_succ k' + omega + | GCod hn => + rcases k with _ | k' + · omega + · refine ⟨t ++ one k', .Word10 k' 1 (Word_one k'), ?_⟩ + rw [Word_max hw hn, append_assoc] + have h_k : 1 + k' = k' + 1 := by omega + rw [← h_k] + exact G_word_odd k' (G_unone hg) + +theorem GCounter_odd {k n m c : ℕ} (h : GCounter k n m c) (hn : n % 2 = 1) : + m % 2 = 1 := by + cases h <;> omega + +theorem P_counter {k n n' c : ℕ} {xs : List Sym} {r s : ListBlank Sym} + (hw : Word k n xs) (hk : 0 < k) (hodd : n % 2 = 1) + (hc : GCounter k n n' c) (hg : G c r s) : + ∃ ys, Word k n' ys ∧ P 1 (xs +> r) (ys +> s) := by + cases hc with + | GCinc hn => + cases hg + exact P_word_inc r hw hk hn + | GCev hn => + rcases k with _ | k' + · omega + · have hp := pow2_1_succ k' + omega + | GCod hn => + rcases k with _ | k' + · omega + · refine ⟨t ++ one k', .Word10 k' 1 (Word_one k'), ?_⟩ + rw [Word_max hw hn, Longitudinal.pow_succ_list, List.append_assoc, append_assoc, append_assoc] + exact P_t 1 (I_overflow k' (G_unone hg)) + +inductive CounterRun (step : ℕ → ℕ → ℕ → Prop) : ℕ → ℕ → ℕ → ℕ → Prop where + | Counter0 (n : ℕ) : CounterRun step 0 n n 0 + | CounterS {i n m z c d : ℕ} : step n m c → CounterRun step i m z d → + CounterRun step (i + 1) n z (c + d) + +theorem CounterRun_split {step : ℕ → ℕ → ℕ → Prop} (i j : ℕ) {n m c : ℕ} + (h : CounterRun step (i + j) n m c) : + ∃ z c₀ c₁, c = c₀ + c₁ ∧ CounterRun step i n z c₀ ∧ CounterRun step j z m c₁ := by + induction i generalizing n c with + | zero => exact ⟨n, 0, c, by omega, .Counter0 n, by simpa using h⟩ + | succ i ih => + have h' : CounterRun step ((i + j) + 1) n m c := by + have : (i + j) + 1 = i + 1 + j := by omega + rwa [this] + cases h' with + | @CounterS _ _ m' _ c₀ d h0 h1 => + obtain ⟨x, c₂, c₃, he, h2, h3⟩ := ih h1 + exact ⟨x, c₀ + c₂, c₃, by omega, .CounterS h0 h2, h3⟩ + +theorem CounterRun_add {step : ℕ → ℕ → ℕ → Prop} {i j n m z c e : ℕ} + (h1 : CounterRun step i n m c) (h2 : CounterRun step j m z e) : + CounterRun step (i + j) n z (c + e) := by + induction h1 with + | Counter0 _ => simpa using h2 + | @CounterS i' n' m' z' c' d' hs _ ih => + have h_i : i' + 1 + j = (i' + j) + 1 := by omega + have h_c : c' + d' + e = c' + (d' + e) := by omega + rw [h_i, h_c] + exact .CounterS hs (ih h2) + +theorem I_counter_run {k i n m c : ℕ} {xs : List Sym} {r s : ListBlank Sym} + (hw : Word k n xs) (hc : CounterRun (ICounter k) i n m c) (hg : G c r s) : + ∃ ys, Word k m ys ∧ I i (xs +> r) (ys +> s) := by + induction hc generalizing xs r s with + | Counter0 _ => + cases hg + exact ⟨xs, hw, .nil _⟩ + | @CounterS i' n' m' z' c' d' hs _ ih => + obtain ⟨z_r, hg1, hd⟩ := G_split c' d' hg + obtain ⟨ys, hy, hi1⟩ := I_counter hw hs hg1 + obtain ⟨zs, hz, hrest⟩ := ih hy hd + have : i' + 1 = 1 + i' := by omega + rw [this] + exact ⟨zs, hz, I_add hi1 hrest⟩ + +theorem G_counter_run {k i n m c : ℕ} {xs : List Sym} {r s : ListBlank Sym} + (hw : Word k n xs) (hk : 0 < k) (hc : CounterRun (GCounter k) i n m c) (hg : G c r s) : + ∃ ys, Word k m ys ∧ G i (xs +> r) (ys +> s) := by + induction hc generalizing xs r s with + | Counter0 _ => + cases hg + exact ⟨xs, hw, .G0 _⟩ + | @CounterS i' n' m' z' c' d' hs _ ih => + obtain ⟨z_r, hg1, hd⟩ := G_split c' d' hg + obtain ⟨ys, hy, hg_step⟩ := G_counter hw hk hs hg1 + obtain ⟨zs, hz, hrest⟩ := ih hy hd + exact ⟨zs, hz, .GS hg_step hrest⟩ + +theorem P_counter_run {k i n m c : ℕ} {xs : List Sym} {r s : ListBlank Sym} + (hw : Word k n xs) (hk : 0 < k) (hodd : n % 2 = 1) + (hc : CounterRun (GCounter k) i n m c) (hg : G c r s) : + ∃ ys, Word k m ys ∧ P i (xs +> r) (ys +> s) := by + induction hc generalizing xs r s with + | Counter0 _ => + cases hg + exact ⟨xs, hw, .nil _⟩ + | @CounterS i' n' m' z' c' d' hs _ ih => + obtain ⟨z_r, hg1, hd⟩ := G_split c' d' hg + obtain ⟨ys, hy, hp1⟩ := P_counter hw hk hodd hs hg1 + obtain ⟨zs, hz, hrest⟩ := ih hy (GCounter_odd hs hodd) hd + have : i' + 1 = 1 + i' := by omega + rw [this] + exact ⟨zs, hz, P_add hp1 hrest⟩ + +theorem ICounter_total (k n : ℕ) (h : n < 2 ^ (1 + k)) : + ∃ m c, ICounter k n m c ∧ m < 2 ^ (1 + k) := by + by_cases hlt : n + 1 < 2 ^ (1 + k) + · exact ⟨n + 1, 0, .ICinc n hlt, hlt⟩ + · have hp := pow2_pos k + have : 2 ^ (1 + k) = 2 ^ k * 2 := pow2_succ_left k + exact ⟨1, 1, .ICov n (by omega), by omega⟩ + +theorem GCounter_total (k n : ℕ) (hk : 0 < k) (h : n < 2 ^ (1 + k)) : + ∃ m c, GCounter k n m c ∧ m < 2 ^ (1 + k) := by + by_cases hlt : n + 2 < 2 ^ (1 + k) + · exact ⟨n + 2, 0, .GCinc n hlt, hlt⟩ + · by_cases heq : n + 2 = 2 ^ (1 + k) + · have hp := pow2_pos k + have : 2 ^ (1 + k) = 2 ^ k * 2 := pow2_succ_left k + exact ⟨1, 1, .GCev n heq, by omega⟩ + · rcases k with _ | k' + · omega + · have hp := pow2_pos k' + have : 2 ^ (1 + (k' + 1)) = 2 ^ k' * 4 := by ring + exact ⟨3, 1, .GCod n (by omega), by omega⟩ + +theorem CounterRun_total {step : ℕ → ℕ → ℕ → Prop} {bound : ℕ} + (hstep : ∀ n, n < bound → ∃ m c, step n m c ∧ m < bound) + (i n : ℕ) (hn : n < bound) : + ∃ m c, CounterRun step i n m c ∧ m < bound := by + induction i generalizing n with + | zero => exact ⟨n, 0, .Counter0 n, hn⟩ + | succ i ih => + obtain ⟨m, c, hc, hm⟩ := hstep n hn + obtain ⟨z, d, hd, hz⟩ := ih m hm + exact ⟨z, c + d, .CounterS hc hd, hz⟩ + +inductive Tail : ListBlank Sym → Prop where + | TailNum {n : ℕ} {r : ListBlank Sym} : Num n r → Tail r + | TailWord {k n : ℕ} {xs : List Sym} {r : ListBlank Sym} : + 0 < k → Word k n xs → Tail r → Tail (xs +> r) + +theorem G_total {r : ListBlank Sym} (ht : Tail r) (i : ℕ) : + ∃ s, Tail s ∧ G i r s := by + induction ht generalizing i with + | TailNum hn => + obtain ⟨s, hs, hg⟩ := G_nums i hn + exact ⟨s, .TailNum hs, hg⟩ + | @TailWord k n xs r' hk hw _ ih => + obtain ⟨m, c, hc, _⟩ := + CounterRun_total (fun z hz => GCounter_total k z hk hz) i n (Word_bound hw) + obtain ⟨s, hs, hg⟩ := ih c + obtain ⟨ys, hy, hrun⟩ := G_counter_run hw hk hc hg + exact ⟨ys +> s, .TailWord hk hy hs, hrun⟩ + +theorem I_total {r : ListBlank Sym} (ht : Tail r) (i : ℕ) : + ∃ s, Tail s ∧ I i r s := by + cases ht with + | TailNum hn => + obtain ⟨s, hs, hi⟩ := I_nums i hn + exact ⟨s, .TailNum hs, hi⟩ + | @TailWord k n xs r' hk hw htail => + obtain ⟨m, c, hc, _⟩ := CounterRun_total (ICounter_total k) i n (Word_bound hw) + obtain ⟨s, hs, hg⟩ := G_total htail c + obtain ⟨ys, hy, hrun⟩ := I_counter_run hw hc hg + exact ⟨ys +> s, .TailWord hk hy hs, hrun⟩ + +theorem ICounter_balance {k n m c : ℕ} (h : ICounter k n m c) : + m + c * (2 ^ (1 + k) - 1) = n + 1 := by + cases h <;> omega + +theorem ICounterRun_balance {k i n m c : ℕ} (h : CounterRun (ICounter k) i n m c) : + m + c * (2 ^ (1 + k) - 1) = n + i := by + induction h with + | Counter0 _ => omega + | @CounterS i' n' m' z' c' d' hs _ ih => + have hb := ICounter_balance hs + have : (c' + d') * (2 ^ (1 + k) - 1) = c' * (2 ^ (1 + k) - 1) + d' * (2 ^ (1 + k) - 1) := by + ring + omega + +theorem ICounterRun_positive {k i n m c : ℕ} (h : CounterRun (ICounter k) i n m c) (hn : 0 < n) : + 0 < m := by + induction h with + | Counter0 _ => exact hn + | CounterS hs _ ih => + apply ih + cases hs <;> omega + +theorem ICounterRun_bound {k i n m c : ℕ} (h : CounterRun (ICounter k) i n m c) + (hn : n < 2 ^ (1 + k)) : m < 2 ^ (1 + k) := by + induction h with + | Counter0 _ => exact hn + | CounterS hs _ ih => + apply ih + cases hs with + | ICinc hlt => exact hlt + | ICov _ => + have hp := pow2_pos k + have : 2 ^ (1 + k) = 2 ^ k * 2 := pow2_succ_left k + omega + +theorem ICounterRun_linear {k i n m c : ℕ} (h : CounterRun (ICounter k) i n m c) + (hbound : n + i < 2 ^ (1 + k)) : m = n + i ∧ c = 0 := by + induction h with + | Counter0 _ => omega + | CounterS hs _ ih => + cases hs <;> omega + +def phi (n : ℕ) : ℕ := n + n % 2 - 1 + +theorem phi_odd (n : ℕ) : phi (n * 2 + 1) = n * 2 + 1 := by + unfold phi; omega + +theorem phi_bounds {n : ℕ} (hn : 0 < n) : + 0 < phi n ∧ phi n ≤ n ∧ n ≤ phi n + 1 := by + unfold phi; omega + +theorem GCounter_positive {k n m c : ℕ} (h : GCounter k n m c) : 0 < m := by + cases h <;> omega + +theorem GCounter_balance {k n m c : ℕ} (_hk : 0 < k) (hn : 0 < n) (h : GCounter k n m c) : + phi m + c * ((2 ^ k - 1) * 2) = phi n + 2 := by + have hp := pow2_pos k + have hp2 : 2 ^ (1 + k) = 2 ^ k * 2 := pow2_succ_left k + cases h <;> unfold phi <;> omega + +theorem GCounterRun_balance {k i n m c : ℕ} (h : CounterRun (GCounter k) i n m c) + (hk : 0 < k) (hn : 0 < n) : + phi m + c * ((2 ^ k - 1) * 2) = phi n + i * 2 := by + induction h with + | Counter0 _ => omega + | @CounterS i' n' m' z' c' d' hs _ ih => + have hb := GCounter_balance hk hn hs + have ih_res := ih (GCounter_positive hs) + have : (c' + d') * ((2 ^ k - 1) * 2) = c' * ((2 ^ k - 1) * 2) + d' * ((2 ^ k - 1) * 2) := by + ring + omega + +theorem GCounterRun_positive {k i n m c : ℕ} (h : CounterRun (GCounter k) i n m c) (hn : 0 < n) : + 0 < m := by + induction h with + | Counter0 _ => exact hn + | CounterS hs _ ih => exact ih (GCounter_positive hs) + +theorem GCounterRun_linear {k i n m c : ℕ} (h : CounterRun (GCounter k) i n m c) + (hbound : n + i * 2 < 2 ^ (1 + k)) : m = n + i * 2 ∧ c = 0 := by + induction h with + | Counter0 _ => omega + | CounterS hs _ ih => + cases hs <;> omega + +theorem GCounterRun_even {k i n m c : ℕ} (h : CounterRun (GCounter k) i n m c) + (hm : m % 2 = 0) : c = 0 ∧ m = n + i * 2 ∧ n % 2 = 0 := by + induction h with + | Counter0 _ => omega + | CounterS hs _ ih => + obtain ⟨hc, hz, hn'⟩ := ih hm + cases hs <;> omega + +theorem GCounterRun_bound {k i n m c : ℕ} (h : CounterRun (GCounter k) i n m c) + (hk : 0 < k) (hn : n < 2 ^ (1 + k)) : m < 2 ^ (1 + k) := by + induction h with + | Counter0 _ => exact hn + | CounterS hs _ ih => + apply ih + cases hs with + | GCinc hlt => exact hlt + | GCev _ => + have hp := pow2_pos k + have : 2 ^ (1 + k) = 2 ^ k * 2 := pow2_succ_left k + omega + | GCod _ => + rcases k with _ | k' + · omega + · have hp := pow2_pos k' + have : 2 ^ (1 + (k' + 1)) = 2 ^ k' * 4 := by ring + omega + +theorem GCounterRun_saturated {k i n m c : ℕ} (h : CounterRun (GCounter k) i n m c) + (hk : 0 < k) (hn : n < 2 ^ (1 + k)) (hi : 2 ^ (1 + k) ≤ n + i * 2) : + m % 2 = 1 := by + have hb := GCounterRun_bound h hk hn + by_cases he : m % 2 = 0 + · obtain ⟨_, h_eq, _⟩ := GCounterRun_even h he + omega + · omega + +theorem GCounterRun_odd {k i n m c : ℕ} (h : CounterRun (GCounter k) i n m c) (hn : n % 2 = 1) : + m % 2 = 1 := by + induction h with + | Counter0 _ => exact hn + | CounterS hs _ ih => exact ih (GCounter_odd hs hn) + +theorem GCounterRun_three {k i n m c : ℕ} (h : CounterRun (GCounter k) i n m c) + (hi : 0 < i) (hn : n % 2 = 1) : 3 ≤ m := by + induction h with + | Counter0 _ => omega + | @CounterS i' n' m' z' c' d' hs hrest ih => + rcases i' with _ | i'' + · cases hrest + have hp := pow2_pos k + have : 2 ^ (1 + k) = 2 ^ k * 2 := pow2_succ_left k + cases hs <;> omega + · exact ih (by omega) (GCounter_odd hs hn) + +theorem counter_inner {k j n m c : ℕ} {xs : List Sym} {r s : ListBlank Sym} + (hw : Word k n xs) (hk : 0 < k) (hguard : n % 2 = 1 ∨ 2 ^ (1 + k) ≤ n + j * 4) + (hc : CounterRun (GCounter k) (j * 2 + 2) n m c) (hg : G c r s) : + ∃ ys, Word k m ys ∧ Inner j (xs +> r) (ys +> s) := by + rcases hguard with hodd | hsat + · obtain ⟨ys, hy, hp⟩ := P_counter_run hw hk hodd hc hg + exact ⟨ys, hy, .InnerP hp⟩ + · obtain ⟨z, c₀, c₁, rfl, h0, h1⟩ := CounterRun_split (j * 2) 2 hc + obtain ⟨r₀, hg0, hg1⟩ := G_split c₀ c₁ hg + obtain ⟨zs, hz, hgz⟩ := G_counter_run hw hk h0 hg0 + have hodd : z % 2 = 1 := + GCounterRun_saturated h0 hk (Word_bound hw) (by omega) + obtain ⟨ys, hy, hp⟩ := P_counter_run hz hk hodd h1 hg1 + have hj0 : 0 < j := by + have hb := Word_bound hw + omega + exact ⟨ys, hy, .InnerG (zs +> r₀) hj0 hgz hp⟩ + +private theorem Word_odd_inv_aux {k1 m n : ℕ} {xs : List Sym} + (h : Word k1 m xs) (hm : m = n * 2 + 1) : + ∀ k, k1 = k + 1 → ∃ ys, Word k n ys ∧ xs = t ++ ys := by + cases h with + | Word0 => omega + | Word1 => + intro k hk + omega + | Word00 k' n' _ => omega + | Word10 k' n' hy => + intro k hk + have hk_eq : k' = k := by omega + have hn_eq : n' = n := by omega + subst hk_eq hn_eq + exact ⟨_, hy, rfl⟩ + +theorem Word_odd_inv {k n : ℕ} {xs : List Sym} (h : Word (k + 1) (n * 2 + 1) xs) : + ∃ ys, Word k n ys ∧ xs = t ++ ys := + Word_odd_inv_aux h rfl k rfl + +theorem counter_inner_phase {k j n m c : ℕ} (hk : 0 < k) (hn : n < 2 ^ (1 + k)) + (hguard : n % 2 = 1 ∨ 2 ^ (1 + k) ≤ n + j * 4) + (hc : CounterRun (GCounter k) (j * 2 + 2) n m c) : + m % 2 = 1 ∧ 3 ≤ m := by + rcases hguard with hodd | hsat + · exact ⟨GCounterRun_odd hc hodd, GCounterRun_three hc (by omega) hodd⟩ + · obtain ⟨z, c₀, c₁, _, h0, h1⟩ := CounterRun_split (j * 2) 2 hc + have hodd : z % 2 = 1 := GCounterRun_saturated h0 hk hn (by omega) + exact ⟨GCounterRun_odd h1 hodd, GCounterRun_three h1 (by omega) hodd⟩ + +theorem descent_boundary {a b : ℕ} {fs : List Sym} {k n u_val z c₀ c₁ : ℕ} + {xs : List Sym} {r s : ListBlank Sym} + (hf : Frame a b fs) (hw : Word (k + 1) n xs) (hk : 0 < k) + (hguard : n % 2 = 1 ∨ 2 ^ (1 + (k + 1)) ≤ n + a * 4) + (h0 : CounterRun (GCounter (k + 1)) (a * 2 + 2) n (u_val * 2 + 1) c₀) + (h1 : CounterRun (GCounter k) (b + a) u_val z c₁) + (hg : G (c₀ + c₁) r s) : + ∃ ys, Word k z ys ∧ + (cfg (fs +> (w ^ a +> (xs +> r)))) [tm1]⊢⁺ (cfg ((fs ++ w ^ a ++ d) +> (ys +> s))) := by + obtain ⟨r₀, hg0, hg1⟩ := G_split c₀ c₁ hg + obtain ⟨xs₀, hw0, hin⟩ := counter_inner hw (by omega) hguard h0 hg0 + obtain ⟨ys₀, hy0, rfl⟩ := Word_odd_inv hw0 + obtain ⟨ys, hy, hrun⟩ := G_counter_run hy0 hk h1 hg1 + refine ⟨ys, hy, ?_⟩ + simp only [List.append_assoc, append_assoc] + refine frame_step hf ?_ + have h_sub : a - a = 0 := by omega + have hin' : Inner a (xs +> r) (t +> (ys₀ +> r₀)) := by + simpa only [append_assoc] using hin + have hgd : I (b + a) ([1] +> (t +> (ys₀ +> r₀))) (d +> (ys +> s)) := by + simpa only [d, t, append_cons, append_nil] using G_d hrun + exact inner_column (by omega) hin' hgd (by rw [h_sub]; exact .G0 _) + +theorem descent_inside {a b j : ℕ} {fs : List Sym} {k n u_val x y z c₀ c₁ c₂ c₃ : ℕ} + {xs : List Sym} {r s : ListBlank Sym} + (hf : Frame a b fs) (hj : j < a) (hw : Word (k + 2) n xs) (hk : 0 < k) + (hguard : n % 2 = 1 ∨ 2 ^ (1 + (k + 2)) ≤ n + j * 4) (hodd : x % 2 = 1) + (h0 : CounterRun (GCounter (k + 2)) (j * 2 + 2) n (u_val * 2 + 1) c₀) + (h1 : CounterRun (GCounter (k + 1)) (b + j) u_val x c₁) + (h2 : CounterRun (GCounter (k + 1)) 2 x (y * 2 + 1) c₂) + (h3 : CounterRun (GCounter k) (a - j - 1) y z c₃) + (hg : G (c₀ + (c₁ + (c₂ + c₃))) r s) : + ∃ ys, Word k z ys ∧ + (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ (cfg (fs +> (w ^ (j + 1) +> (ys +> s)))) := by + obtain ⟨r₀, hg0, hg'⟩ := G_split c₀ (c₁ + (c₂ + c₃)) hg + obtain ⟨r₁, hg1, hg''⟩ := G_split c₁ (c₂ + c₃) hg' + obtain ⟨r₂, hg2, hg3⟩ := G_split c₂ c₃ hg'' + obtain ⟨xs₀, hw0, hin⟩ := counter_inner hw (by omega) hguard h0 hg0 + obtain ⟨ys₀, hy0, rfl⟩ := Word_odd_inv (k := k + 1) hw0 + obtain ⟨xs₁, hw1, hrun1⟩ := G_counter_run hy0 (by omega) h1 hg1 + obtain ⟨xs₂, hw2, hrun2⟩ := P_counter_run hw1 (by omega) hodd h2 hg2 + obtain ⟨ys₂, hy2, rfl⟩ := Word_odd_inv (k := k) hw2 + obtain ⟨ys, hy, hrun3⟩ := G_counter_run hy2 hk h3 hg3 + refine ⟨ys, hy, ?_⟩ + rw [pow_add_list w j 1, pow_one_list, append_assoc] + refine frame_step hf ?_ + have hin' : Inner j (xs +> r) (t +> (ys₀ +> r₀)) := by + simpa only [append_assoc] using hin + have hgd1 : I (b + j) ([1] +> (t +> (ys₀ +> r₀))) (d +> (xs₁ +> r₁)) := by + simpa only [d, t, append_cons, append_nil] using G_d hrun1 + refine inner_column (by omega) hin' hgd1 ?_ + have h_aj : a - j = 1 + (a - j - 1) := by omega + rw [h_aj] + have hpd2 : G 1 (d +> (xs₁ +> r₁)) (w +> (ys₂ +> r₂)) := by + have hp := P_d hrun2 + exact P_G (by simpa only [u, w, t, append_assoc, append_cons, append_nil] using hp) + exact G_add hpd2 (P_G (G_w hrun3)) + +theorem descent_boundary_balance (a b k n u_val z c₀ c₁ q : ℕ) + (hk : 0 < k) (hn : 0 < n) (hu : 0 < u_val) + (h0 : CounterRun (GCounter (k + 1)) (a * 2 + 2) n (u_val * 2 + 1) c₀) + (h1 : CounterRun (GCounter k) (b + a) u_val z c₁) : + (phi z + (2 ^ k - 1) * (q + (c₀ + c₁) * 2)) * 2 + 1 + q + c₀ * 2 + (u_val - phi u_val) * 2 = + phi n + (2 ^ (k + 1) - 1) * q + (a * 2 + b + 1) * 4 := by + have e0 := GCounterRun_balance h0 (by omega) hn + have e1 := GCounterRun_balance h1 hk hu + have hpu : phi u_val ≤ u_val := (phi_bounds hu).2.1 + rw [phi_odd] at e0 + have hp1 : 2 ^ (k + 1) = 2 ^ k * 2 := by ring + have hp0 : 1 ≤ 2 ^ k := pow2_pos k + have hp01 : 1 ≤ 2 ^ (k + 1) := pow2_pos (k + 1) + zify [hp0, hp01, hpu] at e0 e1 hp1 ⊢ + ring_nf at e0 e1 hp1 ⊢ + linarith + +theorem descent_inside_balance (a b j k n u_val x y z c₀ c₁ c₂ c₃ q : ℕ) + (hj : j < a) (hk : 0 < k) (hn : 0 < n) (hu : 0 < u_val) (hy : 0 < y) + (h0 : CounterRun (GCounter (k + 2)) (j * 2 + 2) n (u_val * 2 + 1) c₀) + (h1 : CounterRun (GCounter (k + 1)) (b + j) u_val x c₁) + (h2 : CounterRun (GCounter (k + 1)) 2 x (y * 2 + 1) c₂) + (h3 : CounterRun (GCounter k) (a - j - 1) y z c₃) : + (phi z + (2 ^ k - 1) * (q + (c₀ + c₁ + c₂ + c₃) * 2)) * 4 + + 3 + q * 3 + c₀ * 6 + (c₁ + c₂) * 4 + (u_val - phi u_val) * 2 + (y - phi y) * 4 = + phi n + (2 ^ (k + 2) - 1) * q + (a * 2 + b + 1) * 4 := by + have e0 := GCounterRun_balance h0 (by omega) hn + have e1 := GCounterRun_balance h1 (by omega) hu + have e2 := GCounterRun_balance h2 (by omega) (GCounterRun_positive h1 hu) + have e3 := GCounterRun_balance h3 hk hy + have hpu : phi u_val ≤ u_val := (phi_bounds hu).2.1 + have hpy : phi y ≤ y := (phi_bounds hy).2.1 + have haj1 : 1 ≤ a - j := by omega + have haj : j ≤ a := by omega + rw [phi_odd] at e0 e2 + have hp1 : 2 ^ (k + 1) = 2 ^ k * 2 := by ring + have hp2 : 2 ^ (k + 2) = 2 ^ k * 4 := by ring + have hp0 : 1 ≤ 2 ^ k := pow2_pos k + have hp01 : 1 ≤ 2 ^ (k + 1) := pow2_pos (k + 1) + have hp02 : 1 ≤ 2 ^ (k + 2) := pow2_pos (k + 2) + zify [hp0, hp01, hp02, hpu, hpy, haj1, haj] at e0 e1 e2 e3 hp1 hp2 ⊢ + ring_nf at e0 e1 e2 e3 hp1 hp2 ⊢ + linarith + +theorem descent_boundary_calls (a b k n u_val z c₀ c₁ L : ℕ) + (hk : 0 < k) (hn : 0 < n) (hu : 0 < u_val) (hz : 0 < z) (hzb : z < 2 ^ (1 + k)) (hL : 2 ≤ L) + (hsize : (a * 2 + b + 1) * 4 = 2 ^ (2 + k) * L) + (h0 : CounterRun (GCounter (k + 1)) (a * 2 + 2) n (u_val * 2 + 1) c₀) + (h1 : CounterRun (GCounter k) (b + a) u_val z c₁) : + L ≤ c₀ + c₁ := by + have e := descent_boundary_balance a b k n u_val z c₀ c₁ 0 hk hn hu h0 h1 + have hphi_n := phi_bounds hn + have hphi_u := phi_bounds hu + have hphi_z := phi_bounds hz + have hp1 : 2 ^ (1 + k) = 2 ^ k * 2 := by ring + have hp2 : 2 ^ (2 + k) = 2 ^ k * 4 := by ring + have hp0 : 1 ≤ 2 ^ k := pow2_pos k + have hpu : phi u_val ≤ u_val := hphi_u.2.1 + by_contra hlt + rcases hphi_n with ⟨hpn1, hpn2, hpn3⟩ + rcases hphi_u with ⟨hpu1, hpu2, hpu3⟩ + rcases hphi_z with ⟨hpz1, hpz2, hpz3⟩ + have h_gap : (2 ^ k * (c₀ + c₁ + 1)) * 4 + 2 ≤ (2 ^ k * L) * 4 + c₀ * 2 + c₁ * 4 := by + by_cases hc : c₀ + c₁ = 0 + · have hle2 : c₀ + c₁ + 2 ≤ L := by omega + have hmul2 := Nat.mul_le_mul_left (2 ^ k) hle2 + ring_nf at hmul2 ⊢ + omega + · have hle1 : c₀ + c₁ + 1 ≤ L := by omega + have hmul1 := Nat.mul_le_mul_left (2 ^ k) hle1 + ring_nf at hmul1 ⊢ + omega + zify [hp0, hpu2] at hp0 e hpn1 hpu3 hpz2 hzb hp1 hp2 hsize h_gap + ring_nf at e hzb hsize h_gap + omega + +theorem descent_inside_calls (a b j k n u_val x y z c₀ c₁ c₂ c₃ L : ℕ) + (hj : j < a) (hk : 0 < k) (hn : 0 < n) (hu : 0 < u_val) (hy : 0 < y) (hz : 0 < z) + (hzb : z < 2 ^ (1 + k)) (hL : 4 ≤ L) + (hsize : (a * 2 + b + 1) * 4 = 2 ^ (3 + k) * L) + (h0 : CounterRun (GCounter (k + 2)) (j * 2 + 2) n (u_val * 2 + 1) c₀) + (h1 : CounterRun (GCounter (k + 1)) (b + j) u_val x c₁) + (h2 : CounterRun (GCounter (k + 1)) 2 x (y * 2 + 1) c₂) + (h3 : CounterRun (GCounter k) (a - j - 1) y z c₃) : + L ≤ c₀ + c₁ + c₂ + c₃ := by + have e := descent_inside_balance a b j k n u_val x y z c₀ c₁ c₂ c₃ 0 hj hk hn hu hy h0 h1 h2 h3 + have hphi_n := phi_bounds hn + have hphi_u := phi_bounds hu + have hphi_y := phi_bounds hy + have hphi_z := phi_bounds hz + have hp1 : 2 ^ (1 + k) = 2 ^ k * 2 := by ring + have hp3 : 2 ^ (3 + k) = 2 ^ k * 8 := by ring + have hp0 : 1 ≤ 2 ^ k := pow2_pos k + have hpu : phi u_val ≤ u_val := hphi_u.2.1 + have hpy : phi y ≤ y := hphi_y.2.1 + by_contra hlt + rcases hphi_n with ⟨hpn1, hpn2, hpn3⟩ + rcases hphi_u with ⟨hpu1, hpu2, hpu3⟩ + rcases hphi_y with ⟨hpy1, hpy2, hpy3⟩ + rcases hphi_z with ⟨hpz1, hpz2, hpz3⟩ + have h_gap : (2 ^ k * (c₀ + c₁ + c₂ + c₃ + 1)) * 8 + 6 ≤ + (2 ^ k * L) * 8 + c₀ * 2 + (c₁ + c₂) * 4 + c₃ * 8 := by + by_cases hc : c₀ + c₁ + c₂ + c₃ ≤ 2 + · have hle2 : c₀ + c₁ + c₂ + c₃ + 2 ≤ L := by omega + have hmul2 := Nat.mul_le_mul_left (2 ^ k) hle2 + ring_nf at hmul2 ⊢ + omega + · have hle1 : c₀ + c₁ + c₂ + c₃ + 1 ≤ L := by omega + have hmul1 := Nat.mul_le_mul_left (2 ^ k) hle1 + ring_nf at hmul1 ⊢ + omega + zify [hp0, hpu2, hpy2] at hp0 e hpn1 hpu3 hpy3 hpz2 hzb hp1 hp3 hsize h_gap + ring_nf at e hzb hsize h_gap + omega + +theorem counter_inner_total (k j n : ℕ) (hk : 0 < k) (hn : n < 2 ^ (1 + k)) + (hguard : n % 2 = 1 ∨ 2 ^ (1 + k) ≤ n + j * 4) : + ∃ u_val c, 0 < u_val ∧ u_val < 2 ^ k ∧ + CounterRun (GCounter k) (j * 2 + 2) n (u_val * 2 + 1) c := by + obtain ⟨m, c, hc, hm⟩ := CounterRun_total (fun z hz => GCounter_total k z hk hz) (j * 2 + 2) n hn + obtain ⟨hodd, hthree⟩ := counter_inner_phase hk hn hguard hc + have em : m = m / 2 * 2 + 1 := by omega + have hp1 : 2 ^ (1 + k) = 2 ^ k * 2 := by ring + refine ⟨m / 2, c, by omega, by omega, ?_⟩ + rwa [← em] + +theorem Num_zero {n : ℕ} {r : ListBlank Sym} (h : Num n r) (hn : n = 0) : + r = default := by + induction h with + | Num0 => rfl + | Num00 n' _ ih => + rw [ih (by omega)] + exact all0_spec (a := [0, 0]) rfl + | Num10 _ _ _ => omega + +theorem Num_one {n : ℕ} {r : ListBlank Sym} (h : Num n r) (hn : n = 1) : + r = t +> default := by + cases h with + | Num0 => omega + | Num00 _ _ => omega + | Num10 n' h' => + rw [Num_zero h' (by omega)] + +inductive Value : ℕ → ListBlank Sym → Prop where + | ValueNum {n : ℕ} {r : ListBlank Sym} : Num n r → Value n r + | ValueEnd {n : ℕ} {r : ListBlank Sym} : Num n r → n ≤ 1 → Value (n * 2 + 1) (d +> r) + | ValueWord {k n : ℕ} {xs : List Sym} {q : ℕ} {r : ListBlank Sym} : + 0 < k → 0 < n → Word k n xs → Value q r → Value (phi n + (2 ^ k - 1) * q) (xs +> r) + +theorem G_value_one {r : ListBlank Sym} {q : ℕ} (h : Value q r) : + ∃ s, Value (q + 2) s ∧ G1 r s := by + induction h with + | ValueNum hn => + obtain ⟨s, hs, hp⟩ := P_num hn + exact ⟨s, .ValueNum hs, .GP hp⟩ + | @ValueEnd n r' hn hle => + by_cases hn0 : n = 0 + · rw [Num_zero hn hn0] + subst hn0 + refine ⟨(t ++ one 2) +> default, ?_, G_zero0⟩ + exact Value.ValueWord (k := 3) (n := 3) (q := 0) (by decide) (by decide) + (.Word10 2 1 (Word_one 2)) (.ValueNum .Num0) + · have hn1 : n = 1 := by omega + rw [Num_one hn hn1] + subst hn1 + refine ⟨w +> ([0, 0, 1, 0] +> default), ?_, G_zero1⟩ + exact Value.ValueWord (k := 1) (n := 3) (q := 2) (by decide) (by decide) + (.Word10 0 1 .Word1) (.ValueNum (.Num00 1 (.Num10 0 .Num0))) + | @ValueWord k n xs q' r' hk hn0 hw hval ih => + obtain ⟨m, c, hc, hm⟩ := GCounter_total k n hk (Word_bound hw) + have htail : ∃ s, Value (q' + c * 2) s ∧ G c r' s := by + have hc_le : c ≤ 1 := by cases hc <;> omega + rcases c with _ | _ | c + · exact ⟨r', hval, .G0 r'⟩ + · obtain ⟨s, hs, hg⟩ := ih + exact ⟨s, hs, G_single hg⟩ + · omega + obtain ⟨s, hs, hg⟩ := htail + obtain ⟨ys, hy, hrun⟩ := G_counter hw hk hc hg + refine ⟨ys +> s, ?_, hrun⟩ + have hb := GCounter_balance hk hn0 hc + have heq : phi n + (2 ^ k - 1) * q' + 2 = phi m + (2 ^ k - 1) * (q' + c * 2) := by + have : (2 ^ k - 1) * (q' + c * 2) = (2 ^ k - 1) * q' + c * ((2 ^ k - 1) * 2) := by ring + omega + rw [heq] + exact .ValueWord hk (GCounter_positive hc) hy hs + +theorem G_value {r : ListBlank Sym} {q : ℕ} (h : Value q r) (i : ℕ) : + ∃ s, Value (q + i * 2) s ∧ G i r s := by + induction i generalizing r q with + | zero => exact ⟨r, by simpa using h, .G0 r⟩ + | succ i ih => + obtain ⟨s, hs, h1⟩ := G_value_one h + obtain ⟨z, hz, hi⟩ := ih hs + refine ⟨z, ?_, .GS h1 hi⟩ + have : q + (i + 1) * 2 = q + 2 + i * 2 := by omega + rwa [this] + +theorem GCounterRun_one {i n m c : ℕ} (h : CounterRun (GCounter 1) (2 + i) n m c) + (hn : 0 < n) (hbound : n < 4) : + m = 3 ∧ i + 1 ≤ c ∧ c ≤ i + 2 := by + have hm : m < 4 := GCounterRun_bound h (by decide) hbound + have hthree : 3 ≤ m := by + by_cases hodd : n % 2 = 1 + · exact GCounterRun_three h (by omega) hodd + · have hn2 : n = 2 := by omega + subst hn2 + have h' : CounterRun (GCounter 1) ((1 + i) + 1) 2 m c := by + have : (1 + i) + 1 = 2 + i := by omega + rwa [this] + cases h' with + | CounterS h0 h1 => + cases h0 with + | GCinc hlt => + have : 2 ^ (1 + 1) = 4 := rfl + omega + | GCev _ => + exact GCounterRun_three h1 (by omega) rfl + | GCod heq => + have : 2 ^ (1 + 1) = 4 := rfl + omega + have e := GCounterRun_balance h (by decide) hn + have hm3 : m = 3 := by omega + subst hm3 + unfold phi at e + have : (2 ^ 1 - 1) * 2 = 2 := rfl + omega + +theorem narrow_inside (R : ℕ → ListBlank Sym → Prop) + {a b j : ℕ} {fs : List Sym} {k n : ℕ} {xs : List Sym} {q : ℕ} {r : ListBlank Sym} + (hf : Frame a b fs) (hj : j < a) (hw : Word (k + 2) n xs) (hk : 0 < k) (hn : 0 < n) + (hv : ∀ c, ∃ s, R c s ∧ G c r s) + (hguard : n % 2 = 1 ∨ 2 ^ (1 + (k + 2)) ≤ n + j * 4) + (hB : 2 ^ (1 + k) ≤ b + j) + (hcap : phi n + (2 ^ (k + 2) - 1) * q ≤ (a * 2 + b + 1) * 4) : + ∃ z c ys s, + Word k z ys ∧ 0 < z ∧ R c s ∧ G c r s ∧ + phi z + (2 ^ k - 1) * (q + c * 2) < (a * 2 + b + 1) * 2 ∧ + (z % 2 = 0 → (a - j) * 2 ≤ z) ∧ + (k = 1 → 3 ≤ a - j → z = 3) ∧ + (∀ L, 4 ≤ L → (a * 2 + b + 1) * 4 = 2 ^ (3 + k) * L → L ≤ c) ∧ + (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ (cfg (fs +> (w ^ (j + 1) +> (ys +> s)))) := by + obtain ⟨u_val, c₀, hu, hub, h0⟩ := + counter_inner_total (k + 2) j n (by omega) (Word_bound hw) hguard + have hub' : u_val < 2 ^ (1 + (k + 1)) := by + have : 1 + (k + 1) = k + 2 := by omega + rwa [this] + obtain ⟨x, c₁, h1, hxb⟩ := + CounterRun_total (fun z hz => GCounter_total (k + 1) z (by omega) hz) (b + j) u_val hub' + have hodd : x % 2 = 1 := by + refine GCounterRun_saturated h1 (by omega) hub' ?_ + have : 2 ^ (1 + (k + 1)) = 2 ^ (1 + k) * 2 := by ring + omega + obtain ⟨y, c₂, hy, hyb, h2⟩ := counter_inner_total (k + 1) 0 x (by omega) hxb (Or.inl hodd) + have hyb' : y < 2 ^ (1 + k) := by + have : 1 + k = k + 1 := by omega + rwa [this] + obtain ⟨z, c₃, h3, hzb⟩ := + CounterRun_total (fun z' hz' => GCounter_total k z' hk hz') (a - j - 1) y hyb' + obtain ⟨s, hs, hg⟩ := hv (c₀ + (c₁ + (c₂ + c₃))) + obtain ⟨ys, hys, hstep⟩ := descent_inside hf hj hw hk hguard hodd h0 h1 h2 h3 hg + have hz_pos : 0 < z := GCounterRun_positive h3 hy + refine ⟨z, c₀ + (c₁ + (c₂ + c₃)), ys, s, hys, hz_pos, hs, hg, ?_, ?_, ?_, ?_, hstep⟩ + · have e := descent_inside_balance a b j k n u_val x y z c₀ c₁ c₂ c₃ q hj hk hn hu hy h0 h1 h2 h3 + have hphi_u := phi_bounds hu + have hphi_y := phi_bounds hy + have h_assoc : c₀ + (c₁ + (c₂ + c₃)) = c₀ + c₁ + c₂ + c₃ := by omega + rw [h_assoc] + omega + · intro heven + obtain ⟨_, he, _⟩ := GCounterRun_even h3 heven + omega + · intro hk1 hU + subst hk1 + have h3' : CounterRun (GCounter 1) (2 + (a - j - 3)) y z c₃ := by + have : 2 + (a - j - 3) = a - j - 1 := by omega + rwa [this] + exact (GCounterRun_one h3' hy hyb').1 + · intro L hL hsize + have hcalls := + descent_inside_calls a b j k n u_val x y z c₀ c₁ c₂ c₃ L hj hk hn hu hy hz_pos hzb hL hsize h0 + h1 h2 h3 + omega + +theorem narrow_boundary (R : ℕ → ListBlank Sym → Prop) + {a b : ℕ} {fs : List Sym} {k n : ℕ} {xs : List Sym} {q : ℕ} {r : ListBlank Sym} + (hf : Frame a b fs) (hw : Word (k + 1) n xs) (hk : 0 < k) (hn : 0 < n) + (hv : ∀ c, ∃ s, R c s ∧ G c r s) + (hguard : n % 2 = 1 ∨ 2 ^ (1 + (k + 1)) ≤ n + a * 4) + (hB : 2 ^ k ≤ b + a) + (hcap : phi n + (2 ^ (k + 1) - 1) * q ≤ (a * 2 + b + 1) * 4) : + ∃ z c ys s, + Word k z ys ∧ z % 2 = 1 ∧ R c s ∧ G c r s ∧ + phi z + (2 ^ k - 1) * (q + c * 2) < (a * 2 + b + 1) * 4 ∧ + (∀ L, 2 ≤ L → (a * 2 + b + 1) * 4 = 2 ^ (2 + k) * L → L ≤ c) ∧ + (cfg (fs +> (w ^ a +> (xs +> r)))) [tm1]⊢⁺ (cfg ((fs ++ w ^ a ++ d) +> (ys +> s))) := by + obtain ⟨u_val, c₀, hu, hub, h0⟩ := + counter_inner_total (k + 1) a n (by omega) (Word_bound hw) hguard + have hub' : u_val < 2 ^ (1 + k) := by + have : 1 + k = k + 1 := by omega + rwa [this] + obtain ⟨z, c₁, h1, hzb⟩ := + CounterRun_total (fun z' hz' => GCounter_total k z' hk hz') (b + a) u_val hub' + obtain ⟨s, hs, hg⟩ := hv (c₀ + c₁) + obtain ⟨ys, hys, hstep⟩ := descent_boundary hf hw hk hguard h0 h1 hg + refine ⟨z, c₀ + c₁, ys, s, hys, ?_, hs, hg, ?_, ?_, hstep⟩ + · refine GCounterRun_saturated h1 hk hub' ?_ + have : 2 ^ (1 + k) = 2 ^ k * 2 := by ring + omega + · have e := descent_boundary_balance a b k n u_val z c₀ c₁ q hk hn hu h0 h1 + have hphi_u := phi_bounds hu + omega + · intro L hL hsize + exact descent_boundary_calls a b k n u_val z c₀ c₁ L hk hn hu (GCounterRun_positive h1 hu) hzb + hL hsize h0 h1 + +theorem odd_d {k n m c : ℕ} {xs : List Sym} {r s : ListBlank Sym} + (hw : Word (k + 1) n xs) (hodd : n % 2 = 1) + (hc : CounterRun (GCounter (k + 1)) 2 n (m * 2 + 1) c) (hg : G c r s) : + ∃ ys, Word k m ys ∧ ∀ i z, G i (ys +> s) z → P (1 + i) (d +> (xs +> r)) (w +> z) := by + obtain ⟨zs, hz, hp⟩ := P_counter_run hw (by omega) hodd hc hg + obtain ⟨ys, hy, rfl⟩ := Word_odd_inv hz + refine ⟨ys, hy, fun i z hrun => ?_⟩ + refine P_add (a := 1) (b := i) ?_ (G_w hrun) + have hpd := P_d hp + simpa only [u, w, t, append_assoc, append_cons, append_nil] using hpd + +theorem odd_d_value (R : ℕ → ListBlank Sym → Prop) + {k n : ℕ} {xs : List Sym} {q : ℕ} {r : ListBlank Sym} (i : ℕ) + (hw : Word (k + 1) n xs) (hk : 0 < k) (hodd : n % 2 = 1) + (hv : ∀ c, ∃ s, R (q + c * 2) s ∧ G c r s) : + ∃ z c ys s, + Word k z ys ∧ 0 < z ∧ R (q + c * 2) s ∧ + (phi z + (2 ^ k - 1) * (q + c * 2)) * 2 ≤ phi n + (2 ^ (k + 1) - 1) * q + 3 + i * 4 ∧ + (z % 2 = 0 → 2 + i * 2 ≤ z) ∧ + (k = 1 → 2 ≤ i → z = 3) ∧ + P (1 + i) (d +> (xs +> r)) (w +> (ys +> s)) ∧ + ∃ child, P 1 (d +> (xs +> r)) (w +> child) ∧ G i child (ys +> s) := by + obtain ⟨u_val, c₀, hu, hub, h0⟩ := + counter_inner_total (k + 1) 0 n (by omega) (Word_bound hw) (Or.inl hodd) + have hub' : u_val < 2 ^ (1 + k) := by + have : 1 + k = k + 1 := by omega + rwa [this] + obtain ⟨z, c₁, h1, hzb⟩ := + CounterRun_total (fun z' hz' => GCounter_total k z' hk hz') i u_val hub' + obtain ⟨s, hs, hg⟩ := hv (c₀ + c₁) + obtain ⟨r₀, hg0, hg1⟩ := G_split c₀ c₁ hg + obtain ⟨ys₀, hy0, hloop⟩ := odd_d hw hodd h0 hg0 + obtain ⟨ys, hy, hrun⟩ := G_counter_run hy0 hk h1 hg1 + refine ⟨z, c₀ + + c₁, ys, s, hy, GCounterRun_positive h1 hu, hs, ?_, ?_, ?_, hloop i (ys +> s) hrun, ?_⟩ + · have hn0 : 0 < n := by omega + have e0 := GCounterRun_balance h0 (by omega) hn0 + have e1 := GCounterRun_balance h1 hk hu + have hphi_u := phi_bounds hu + have hpu : phi u_val ≤ u_val := hphi_u.2.1 + rw [phi_odd] at e0 + have hp1 : 2 ^ (k + 1) = 2 ^ k * 2 := by ring + have hp0 : 1 ≤ 2 ^ k := pow2_pos k + have hp01 : 1 ≤ 2 ^ (k + 1) := pow2_pos (k + 1) + zify [hp0, hp01, hpu] at e0 e1 hp1 hphi_u ⊢ + ring_nf at e0 e1 hp1 ⊢ + linarith + · intro heven + obtain ⟨_, he, _⟩ := GCounterRun_even h1 heven + omega + · intro hk1 hi2 + subst hk1 + have h1' : CounterRun (GCounter 1) (2 + (i - 2)) u_val z c₁ := by + have : 2 + (i - 2) = i := by omega + rwa [this] + exact (GCounterRun_one h1' hu hub').1 + · exact ⟨ys₀ +> r₀, hloop 0 (ys₀ +> r₀) (.G0 _), hrun⟩ + +theorem two_inside {a b j : ℕ} {fs : List Sym} {n u_val c₀ c₁ : ℕ} + {xs : List Sym} {r s z : ListBlank Sym} + (hf : Frame a b fs) (hj : j < a) (hw : Word 2 n xs) + (hguard : n % 2 = 1 ∨ 8 ≤ n + j * 4) + (h0 : CounterRun (GCounter 2) (j * 2 + 2) n (u_val * 2 + 1) c₀) + (h1 : CounterRun (GCounter 1) (b + j) u_val 3 c₁) + (hg : G (c₀ + (c₁ + 2)) r s) (hz : G (a - j - 1) (d +> s) z) : + (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ (cfg (fs +> (w ^ (j + 1) +> z))) := by + obtain ⟨r₀, hg0, hg'⟩ := G_split c₀ (c₁ + 2) hg + obtain ⟨r₁, hg1, hg2⟩ := G_split c₁ 2 hg' + obtain ⟨xs₀, hw0, hin⟩ := counter_inner hw (by decide) hguard h0 hg0 + obtain ⟨ys₀, hy0, rfl⟩ := Word_odd_inv (k := 1) hw0 + obtain ⟨ys, hy, hrun⟩ := G_counter_run hy0 (by decide) h1 hg1 + have hy_eq : ys = w := Word_max hy rfl + subst hy_eq + rw [pow_add_list w j 1, pow_one_list, append_assoc] + refine frame_step hf ?_ + have hin' : Inner j (xs +> r) (t +> (ys₀ +> r₀)) := by + simpa only [append_assoc] using hin + have hgd : I (b + j) ([1] +> (t +> (ys₀ +> r₀))) (d +> (w +> r₁)) := by + simpa only [d, t, append_cons, append_nil] using G_d hrun + refine inner_column (by omega) hin' hgd ?_ + have h_aj : a - j = 1 + (a - j - 1) := by omega + rw [h_aj] + have h1_step : G 1 (d +> (w +> r₁)) (w +> (d +> s)) := by + have hp := P_d (G_w hg2) + exact P_G (by simpa only [u, w, d, append_assoc, append_cons, append_nil] using hp) + exact G_add h1_step (P_G (G_w hz)) + +theorem two_boundary {a b : ℕ} {fs : List Sym} {n u_val c₀ c₁ : ℕ} + {xs : List Sym} {r s : ListBlank Sym} + (hf : Frame a b fs) (hw : Word 2 n xs) + (hguard : n % 2 = 1 ∨ 8 ≤ n + a * 4) + (h0 : CounterRun (GCounter 2) (a * 2 + 2) n (u_val * 2 + 1) c₀) + (h1 : CounterRun (GCounter 1) (b + a) u_val 3 c₁) + (hg : G (c₀ + c₁) r s) : + (cfg (fs +> (w ^ a +> (xs +> r)))) [tm1]⊢⁺ (cfg ((fs ++ w ^ a ++ d) +> (w +> s))) := by + obtain ⟨ys, hy, hstep⟩ := descent_boundary (k := 1) hf hw (by decide) hguard h0 h1 hg + rwa [Word_max hy rfl] at hstep + +theorem one_boundary {a b : ℕ} {fs : List Sym} {n c : ℕ} + {xs : List Sym} {r s z : ListBlank Sym} + (hf : Frame a b fs) (hw : Word 1 n xs) + (hguard : n % 2 = 1 ∨ 4 ≤ n + a * 4) + (hc : CounterRun (GCounter 1) (a * 2 + 2) n 3 c) + (hg : G c r s) (hz : G (b + a) (d +> s) z) : + (cfg (fs +> (w ^ a +> (xs +> r)))) [tm1]⊢⁺ (cfg ((fs ++ w ^ a ++ d) +> z)) := by + obtain ⟨ys, hy, hin⟩ := counter_inner hw (by decide) hguard hc hg + have hy_eq : ys = w := Word_max hy rfl + subst hy_eq + simp only [List.append_assoc, append_assoc] + refine frame_step hf ?_ + have hin' : Inner a (xs +> r) (w +> s) := hin + have hgd : I (b + a) ([1] +> (w +> s)) (d +> z) := by + simpa only [w, d, append_cons, append_nil] using G_d hz + have h_sub : a - a = 0 := by omega + exact inner_column (by omega) hin' hgd (by rw [h_sub]; exact .G0 _) + +theorem counter_one_loop (i : ℕ) : CounterRun (GCounter 1) i 3 3 i := by + induction i with + | zero => exact .Counter0 3 + | succ i ih => + have h := CounterRun.CounterS (.GCod (k := 1) 3 rfl) ih + rwa [Nat.add_comm 1 i] at h + +theorem counter_one_start (i : ℕ) : CounterRun (GCounter 1) (i + 1) 1 3 i := by + simpa using CounterRun.CounterS (.GCinc (k := 1) 1 (by decide)) (counter_one_loop i) + +theorem one_neighbor {b j : ℕ} {fs xs : List Sym} {r s z out : ListBlank Sym} + (hf : Frame (1 + j) b fs) (hw : Word 1 1 xs) + (hg : G (j * 2 + 1) r s) (hz : G (b + j) (d +> s) (w +> z)) (hout : G 2 z out) : + (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ (cfg ((fs ++ w ^ (1 + j) ++ d) +> out)) := by + have hc : CounterRun (GCounter 1) (j * 2 + 2) 1 3 (j * 2 + 1) := + counter_one_start (j * 2 + 1) + obtain ⟨ys, hy, hin⟩ := counter_inner hw (by decide) (Or.inl rfl) hc hg + have hy_eq : ys = w := Word_max hy rfl + subst hy_eq + have h_pow : w ^ (1 + j) = w ^ j ++ w := by + rw [Nat.add_comm 1 j, pow_add_list, pow_one_list] + rw [h_pow] + simp only [List.append_assoc, append_assoc] + refine frame_step hf ?_ + have hgd : I (b + j) ([1] +> (w +> s)) (d +> (w +> z)) := by + simpa only [w, d, append_cons, append_nil] using G_d hz + have h_sub : 1 + j - j = 1 := by omega + refine inner_column (by omega) hin hgd ?_ + rw [h_sub] + have hp := P_d (G_w hout) + exact P_G (by simpa only [u, w, d, append_assoc, append_cons, append_nil] using hp) + +private theorem Num_odd_inv_aux {m n : ℕ} {r : ListBlank Sym} + (h : Num m r) (hm : m = n * 2 + 1) : + ∃ s, Num n s ∧ r = t +> s := by + cases h with + | Num0 => omega + | Num00 _ _ => omega + | Num10 n' hs => + have : n' = n := by omega + subst this + exact ⟨_, hs, rfl⟩ + +theorem Num_odd_inv {n : ℕ} {r : ListBlank Sym} (h : Num (n * 2 + 1) r) : + ∃ s, Num n s ∧ r = t +> s := + Num_odd_inv_aux h rfl + +theorem P_odd_end (k : ℕ) {n : ℕ} {r : ListBlank Sym} (h : Num n r) : + ∃ s, Num (n + (1 + k) * 2) s ∧ P (1 + k) (d +> (t +> r)) (w +> s) := by + obtain ⟨x, hx, hi⟩ := I_nums 2 h + obtain ⟨s, hs, hg⟩ := G_nums k hx + refine ⟨s, ?_, ?_⟩ + · have : n + (1 + k) * 2 = n + 2 + k * 2 := by omega + rwa [this] + · refine P_add (a := 1) (b := k) ?_ (G_w hg) + have hpd := P_d (P_t 2 hi) + simpa only [u, w, t, append_cons, append_nil] using hpd + +theorem pure_odd_boundary {a b : ℕ} {xs : List Sym} {n : ℕ} {r : ListBlank Sym} + (hf : Frame a b xs) (hn : Num n r) : + ∃ s, Num (n + (a * 2 + b + 1) * 2) s ∧ + (cfg (xs +> (w ^ a +> (t +> r)))) [tm1]⊢⁺ (cfg ((xs ++ w ^ a ++ d) +> s)) := by + obtain ⟨x, hx, hi⟩ := I_nums (a * 2 + 2) hn + obtain ⟨s, hs, hg⟩ := G_nums (b + a) hx + refine ⟨s, ?_, ?_⟩ + · have : n + (a * 2 + b + 1) * 2 = n + (a * 2 + 2) + (b + a) * 2 := by omega + rwa [this] + · simp only [List.append_assoc, append_assoc] + refine frame_step hf (column_partial (by omega) ?_) + have h_sub : a - a = 0 := by omega + refine ⟨t +> x, d +> s, P_t (a * 2 + 2) hi, ?_, by rw [h_sub]; exact .G0 _⟩ + simpa only [d, t, append_cons, append_nil] using G_d hg + +theorem pure_three {a b j : ℕ} {xs : List Sym} {n : ℕ} {r : ListBlank Sym} + (hf : Frame a b xs) (hj : j < a) (hn : Num n r) : + ∃ s, Num (n + a * 2 + b + 1) s ∧ + (cfg (xs +> (w ^ j +> (t +> (t +> r))))) [tm1]⊢⁺ (cfg (xs +> (w ^ (j + 1) +> s))) := by + obtain ⟨x, hx, hi⟩ := I_nums (j * 2 + 2) (.Num10 n hn) + have hx' : Num ((n + j + 1) * 2 + 1) x := by + have : (n + j + 1) * 2 + 1 = n * 2 + 1 + (j * 2 + 2) := by omega + rwa [this] + obtain ⟨x', hx'_num, rfl⟩ := Num_odd_inv hx' + obtain ⟨y, hy, hyI⟩ := I_nums (b + j) hx'_num + obtain ⟨s, hs, hp⟩ := P_odd_end (a - j - 1) hy + refine ⟨s, ?_, ?_⟩ + · have : n + a * 2 + b + 1 = n + j + 1 + (b + j) + (1 + (a - j - 1)) * 2 := by omega + rwa [this] + · rw [pow_add_list w j 1, pow_one_list, append_assoc] + refine frame_step hf (column_partial (by omega) ?_) + refine ⟨t +> (t +> x'), d +> (t +> y), P_t (j * 2 + 2) hi, ?_, ?_⟩ + · simpa only [d, t, append_cons, append_nil] using G_d (P_G (P_t (b + j) hyI)) + · have : a - j = 1 + (a - j - 1) := by omega + rw [this] + exact P_G hp + +theorem G_zero {n : ℕ} {r : ListBlank Sym} (h : Num n r) (hn : n ≤ 1) : + ∃ s, Value (n * 2 + 3) s ∧ G1 (d +> r) s := by + have : n * 2 + 3 = (n * 2 + 1) + 2 := by omega + rw [this] + exact G_value_one (.ValueEnd h hn) + +theorem one_prefix (k : ℕ) : ([1] : List Sym) ++ [0, 0] ^ k ++ t = one k := by + rcases k with _ | k + · rfl + · have hrot : ([0, 0] : List Sym) ^ k ++ [0] = [0] ++ [0, 0] ^ k := + lpow_rotate_list ([0] : List Sym) [0] k + simp only [one, Longitudinal.pow_succ_list, List.append_assoc] + change (1 : Sym) :: 0 :: (0 :: ([0, 0] ^ k ++ [1, 0])) = 1 :: 0 :: ([0, 0] ^ k ++ [0, 1, 0]) + congr 2 + have h2 : (0 : Sym) :: ([0, 0] ^ k ++ [1, 0]) = ([0] ++ [0, 0] ^ k) ++ [1, 0] := rfl + rw [h2, ← hrot, List.append_assoc] + rfl + +theorem P_d_first_Q (k : ℕ) {r s : ListBlank Sym} (h : G1 r s) : + P 1 (d +> ([0, 0] +> (t ^ k +> (d +> r)))) (w +> (one k +> s)) := by + rw [← one_prefix k] + have hq := Q_overflow k h + have h_pow : ([0, 0] : List Sym) ^ (1 + k) = [0, 0] ++ [0, 0] ^ k := by + rw [Nat.add_comm 1 k, Longitudinal.pow_succ_list] + rw [h_pow, append_assoc] at hq + have hqr := Q_R hq + have hres := PdR.sideRLs_concat hqr + rw [P, pow_one_list] + simpa only [List.append_assoc, append_assoc] using hres + +theorem P_d_last_Q {k n : ℕ} {xs : List Sym} {r s : ListBlank Sym} + (hw : Word (k + 1) n xs) (he : n + 4 = 2 ^ (2 + k)) (hg : G1 r s) : + P 1 (d +> (xs +> r)) ([1, 0, 0, 0] +> ([0, 0] ^ (1 + k) +> (t +> s))) := by + have hp1 : 2 ^ (2 + k) = 2 ^ (1 + (k + 1)) := by + have : 2 + k = 1 + (k + 1) := by omega + rw [this] + obtain ⟨ys, hy, hp⟩ := P_word_inc r hw (by omega) (by omega) + refine P_d_second_Q hp ?_ + rw [Word_before_Q hy (by omega)] + simpa only [List.append_assoc, append_assoc] using Q_overflow k hg + +theorem Num_zeros (k : ℕ) {n : ℕ} {r : ListBlank Sym} (h : Num n r) : + Num (n * 2 ^ k) ([0, 0] ^ k +> r) := by + induction k with + | zero => simpa using h + | succ k ih => + have : n * 2 ^ (k + 1) = (n * 2 ^ k) * 2 := by ring + rw [this, Longitudinal.pow_succ_list, append_assoc] + exact .Num00 (n * 2 ^ k) ih + +theorem column_late {a b j : ℕ} {r x y s : ListBlank Sym} + (hj : j < a) (h0 : G (j * 2 + 2) r x) (h1 : G (b + j) (d +> x) y) (h2 : G (a - j) (d +> y) s) : + Suffix a b (w ^ (1 + j) +> r) (w ^ j +> s) := by + have h_pow : w ^ (1 + j) = w ^ j ++ w := by + rw [Nat.add_comm 1 j, pow_add_list, pow_one_list] + rw [h_pow, append_assoc] + refine column_partial (by omega) ⟨w +> x, d +> y, G_w h0, ?_, h2⟩ + simpa only [w, d, append_cons, append_nil] using G_d h1 + +theorem late_first_Q {a b j : ℕ} {fs : List Sym} {k n : ℕ} {xs : List Sym} + {r r₁ s out : ListBlank Sym} + (hf : Frame a b fs) (hj : j < a) (hb : 0 < b + j) (hw : Word (k + 1) n xs) + (he : n + j * 4 + 6 = 2 ^ (2 + k)) (htail : G1 r r₁) + (hmid : G (b + j + 1) (one k +> r₁) s) (hout : G (a - j - 1) (d +> s) out) : + (cfg (fs +> (w ^ (1 + j) +> (xs +> r)))) [tm1]⊢⁺ (cfg (fs +> (w ^ (1 + j) +> out))) := by + have hp_bound : n + (j * 2 + 2) * 2 < 2 ^ (1 + (k + 1)) := by + have : 2 ^ (1 + (k + 1)) = 2 ^ (2 + k) := by ring + omega + obtain ⟨ys, hy, hpre⟩ := P_word_linear (j * 2 + 2) r hw (by omega) hp_bound + rw [Word_before_Q hy (by omega)] at hpre + have hmid' : G ((b + j - 1) + 2) (one k +> r₁) s := by + have : (b + j - 1) + 2 = b + j + 1 := by omega + rwa [this] + obtain ⟨z, hz, h2⟩ := G_split (b + j - 1) 2 hmid' + refine frame_step hf ?_ + have h_w : w ^ (1 + j) +> out = w ^ j +> (w +> out) := by + have : 1 + j = j + 1 := by omega + rw [this, pow_add_list, pow_one_list, append_assoc] + rw [h_w] + have hpre' : G (j * 2 + 2) (xs +> r) ([0, 0] +> (t ^ k +> (d +> r))) := by + simpa only [List.append_assoc, append_assoc] using P_G hpre + have hmid_col : G (b + j) (d +> ([0, 0] +> (t ^ k +> (d +> r)))) (w +> z) := by + have : b + j = 1 + (b + j - 1) := by omega + rw [this] + exact G_add (P_G (P_d_first_Q k htail)) (P_G (G_w hz)) + have hout_col : G (a - j) (d +> (w +> z)) (w +> out) := by + have : a - j = 1 + (a - j - 1) := by omega + rw [this] + have hpd2 : G 1 (d +> (w +> z)) (w +> (d +> s)) := by + have hp := P_d (G_w h2) + exact P_G (by simpa only [u, w, d, append_assoc, append_cons, append_nil] using hp) + exact G_add hpd2 (P_G (G_w hout)) + exact column_late hj hpre' hmid_col hout_col + +theorem late_second_Q {a b j : ℕ} {fs : List Sym} {k n : ℕ} {xs : List Sym} + {q : ℕ} {r : ListBlank Sym} + (hf : Frame a b fs) (hj : j < a) (hb : 0 < b + j) (hw : Word (k + 1) n xs) + (he : n + j * 4 + 8 = 2 ^ (2 + k)) (hr : Num q r) : + ∃ out, Num ((q * 2 + 5) * 2 ^ (2 + k) + (b + j - 1) + (a - j) * 2) out ∧ + (cfg (fs +> (w ^ (1 + j) +> (xs +> r)))) [tm1]⊢⁺ (cfg (fs +> (w ^ (1 + j) +> out))) := by + have hp_bound : n + (j * 2 + 2) * 2 < 2 ^ (1 + (k + 1)) := by + have : 2 ^ (1 + (k + 1)) = 2 ^ (2 + k) := by ring + omega + obtain ⟨ys, hy, hpre⟩ := P_word_linear (j * 2 + 2) r hw (by omega) hp_bound + obtain ⟨r₁, hr1, htail⟩ := P_num hr + have hfirst := P_d_last_Q hy (by omega) (.GP htail) + have hnum : Num (((q * 2 + 5) * 2 ^ (2 + k)) * 2 + 1) + ([1, 0, 0, 0] +> ([0, 0] ^ (1 + k) +> (t +> r₁))) := by + have h0 := Num.Num10 (((q + 2) * 2 + 1) * 2 ^ (1 + k) * 2) + (.Num00 (((q + 2) * 2 + 1) * 2 ^ (1 + k)) (Num_zeros (1 + k) (.Num10 (q + 2) hr1))) + have h_eq : (((q + 2) * 2 + 1) * 2 ^ (1 + k) * 2) * 2 + 1 = + ((q * 2 + 5) * 2 ^ (2 + k)) * 2 + 1 := by + have : 2 ^ (2 + k) = 2 ^ (1 + k) * 2 := by ring + ring + rw [← h_eq] + simpa only [t, append_cons, append_nil] using h0 + obtain ⟨s, hs, hmid⟩ := G_nums (b + j - 1) hnum + have hs' : Num ((((q * 2 + 5) * 2 ^ (2 + k) + (b + j - 1)) * 2) + 1) s := by + have : (((q * 2 + 5) * 2 ^ (2 + k) + (b + j - 1)) * 2) + 1 = + (((q * 2 + 5) * 2 ^ (2 + k)) * 2 + 1) + (b + j - 1) * 2 := by ring + rwa [this] + obtain ⟨s₁, hs1, rfl⟩ := Num_odd_inv hs' + obtain ⟨out, hnumout, hout⟩ := P_odd_end (a - j - 1) hs1 + refine ⟨out, ?_, ?_⟩ + · have : (q * 2 + 5) * 2 ^ (2 + k) + (b + j - 1) + (a - j) * 2 = + (q * 2 + 5) * 2 ^ (2 + k) + (b + j - 1) + (1 + (a - j - 1)) * 2 := by omega + rwa [this] + · refine frame_step hf ?_ + have h_w : w ^ (1 + j) +> out = w ^ j +> (w +> out) := by + have : 1 + j = j + 1 := by omega + rw [this, pow_add_list, pow_one_list, append_assoc] + rw [h_w] + have hmid_col : G (b + j) (d +> (ys +> r)) (t +> s₁) := by + have : b + j = 1 + (b + j - 1) := by omega + rw [this] + exact G_add (P_G hfirst) hmid + have hout_col : G (a - j) (d +> (t +> s₁)) (w +> out) := by + have : a - j = 1 + (a - j - 1) := by omega + rw [this] + exact P_G hout + exact column_late hj (P_G hpre) hmid_col hout_col + + + +set_option linter.unusedVariables false + +theorem pow2_mono {a b : ℕ} (h : a ≤ b) : 2 ^ a ≤ 2 ^ b := + Nat.pow_le_pow_right (by decide) h + +theorem pow2_lt_iff {a b : ℕ} : 2 ^ a < 2 ^ b ↔ a < b := + Nat.pow_lt_pow_iff_right (by decide) + +theorem pow2_le_iff {a b : ℕ} : 2 ^ a ≤ 2 ^ b ↔ a ≤ b := + Nat.pow_le_pow_iff_right (by decide) + +abbrev NonHaltFrom (M : Machine Sym Q) (c₀ : Cfg Sym Q) : Prop := + NeverHaltsFrom M c₀ + +theorem nonHaltFrom_of_progress {Inv : Cfg Sym Q → Prop} + (h_prog : ∀ c, Inv c → ∃ c', (c [tm1]⊢⁺ c') ∧ Inv c') + {c₀ : Cfg Sym Q} (hc₀ : Inv c₀) : NonHaltFrom tm1 c₀ := + NeverHaltsFrom.of_reachesPlus_invariant h_prog hc₀ + +theorem late_first_Q_boundary {a : ℕ} {fs : List Sym} {k : ℕ} {xs : List Sym} {q : ℕ} {r : ListBlank + Sym} + (hf : Frame a (a + 1) fs) (ha : 2 ≤ a) (hpow : a * 6 + 4 = 2 ^ (2 + k)) + (hw : Word (k + 1) (a * 2 + 2) xs) (hr : Num q r) : + ∃ ys s, Word k (a + 3) ys ∧ Num (q + 4) s ∧ + (cfg (fs +> (w ^ a +> (xs +> r)))) [tm1]⊢⁺ (cfg ((fs ++ w ^ a ++ d) +> (ys +> s))) := by + have hk : 0 < k := by + rcases k with _ | k' <;> omega + obtain ⟨z, c, hc, hz⟩ := CounterRun_total (fun z' hz' => GCounter_total k z' hk hz') + (a * 2 + 1) 1 (Word_bound (Word_one k)) + have hodd : z % 2 = 1 := GCounterRun_odd hc rfl + have e := GCounterRun_balance hc hk (by decide) + have hp2 : 2 ^ (2 + k) = 2 ^ k * 4 := by ring + have hp1 : 2 ^ (1 + k) = 2 ^ k * 2 := by ring + have epow : (2 ^ k - 1) * 2 = a * 3 := by omega + rw [epow] at e + have ez : z + c * (a * 3) = a * 4 + 3 := by + unfold phi at e + omega + have hz' : z < a * 3 + 2 := by omega + have ec : c = 1 ∧ z = a + 3 := by + rcases c with _ | _ | c + · omega + · constructor <;> omega + · nlinarith + rcases ec with ⟨rfl, rfl⟩ + obtain ⟨r₀, h0, hp⟩ := P_num hr + obtain ⟨s, hs, hp'⟩ := P_num h0 + obtain ⟨ys, hy, hg⟩ := G_counter_run (Word_one k) hk hc (P_G hp') + refine ⟨ys, s, hy, by simpa only [Nat.add_assoc] using hs, ?_⟩ + simp only [List.append_assoc, append_assoc] + have hstep := late_first_Q (a := a) (b := a + 1) (j := a - 1) (k := k) (n := a * 2 + 2) + (r₁ := r₀) (s := ys +> s) (out := d +> (ys +> s)) + hf (by omega) (by omega) hw (by omega) (.GP hp) + (by + have : a + 1 + (a - 1) + 1 = a * 2 + 1 := by omega + rwa [this]) + (by + have : a - (a - 1) - 1 = 0 := by omega + rw [this] + exact .G0 _) + have ha_eq : 1 + (a - 1) = a := by omega + rwa [ha_eq] at hstep + +theorem Word_split {k n : ℕ} {xs : List Sym} (hw : Word k n xs) (hn : 0 < n) (hpow : n ≠ 2 ^ k) : + ∃ a b z ys, k = 1 + a + b ∧ n = 2 ^ a * (z * 2 + 1) ∧ Word b z ys ∧ + xs = [0, 0] ^ a ++ t ++ ys ∧ [1] ++ xs = one a ++ ys := by + induction hw with + | Word0 => omega + | Word1 => + exfalso + exact hpow rfl + | Word00 k' n' h_xs ih => + have hn' : 0 < n' := by omega + have hpow' : n' ≠ 2 ^ k' := by + intro heq + apply hpow + rw [heq] + ring + obtain ⟨a, b, z, ys, hk_eq, hv, hw', hx, hx'⟩ := ih hn' hpow' + refine ⟨1 + a, b, z, ys, by omega, ?_, hw', ?_, ?_⟩ + · rw [hv] + ring + · have h_pow : ([0, 0] : List Sym) ^ (1 + a) = [0, 0] ++ [0, 0] ^ a := by + rw [Nat.add_comm 1 a, Longitudinal.pow_succ_list] + rw [h_pow, hx] + simp only [List.append_assoc] + · rw [hx, ← one_prefix (1 + a)] + have h_pow : ([0, 0] : List Sym) ^ (1 + a) = [0, 0] ++ [0, 0] ^ a := by + rw [Nat.add_comm 1 a, Longitudinal.pow_succ_list] + rw [h_pow] + simp only [List.append_assoc] + | Word10 k' n' h_xs _ => + refine ⟨0, k', n', _, by omega, by omega, h_xs, ?_, ?_⟩ + · simp only [Longitudinal.pow_zero_list, List.nil_append] + · rfl + +theorem split_root {a b j : ℕ} {fs : List Sym} {r : ListBlank Sym} {k : ℕ} {tail : ListBlank Sym} + {n c m e : ℕ} {s : ListBlank Sym} + (hf : Frame a b fs) (hj : j ≤ a) (hk : 0 < k) + (hp : P (j * 2 + 2) r ([0, 0] ^ k +> (t +> tail))) + (hc : CounterRun (ICounter k) (b + j) 1 n c) + (he : CounterRun (GCounter k) (a - j) n m e) + (hg : G (c + e) tail s) : + ∃ xs, Word k m xs ∧ (cfg (fs +> (w ^ j +> r))) [tm1]⊢⁺ (cfg (fs +> (w ^ j +> (xs +> s)))) := by + obtain ⟨r₀, hg0, hg1⟩ := G_split c e hg + obtain ⟨ys, hy, hi⟩ := I_counter_run (Word_one k) hc hg0 + obtain ⟨xs, hx, hrun⟩ := G_counter_run hy hk he hg1 + refine ⟨xs, hx, frame_step hf (column_partial hj ⟨_, _, hp, ?_, hrun⟩)⟩ + rw [← one_prefix k] at hi + simpa only [List.append_assoc, append_assoc] using hi + +theorem split_d {k i n c : ℕ} {tail r s : ListBlank Sym} + (hp : P 2 r ([0, 0] ^ k +> (t +> tail))) + (hc : CounterRun (ICounter k) i 1 n c) + (hg : G c tail s) : + ∃ xs, Word (k + 1) (n * 2 + 1) xs ∧ P (1 + i) (d +> r) (xs +> s) := by + obtain ⟨ys, hy, hi⟩ := I_counter_run (Word_one k) hc hg + refine ⟨t ++ ys, .Word10 k n hy, ?_⟩ + rw [append_assoc] + refine P_add (a := 1) (b := i) ?_ (P_t i hi) + have hpd := P_d hp + rw [← one_prefix k] + simpa only [u, t, List.append_assoc, append_assoc, append_cons, append_nil] using hpd + +theorem split_inside {a b j : ℕ} {fs : List Sym} {r r₀ r₁ : ListBlank Sym} + {k : ℕ} {tail : ListBlank Sym} {n c : ℕ} {s : ListBlank Sym} + (hf : Frame a b fs) (hj : j < a) (hin : Inner j r (t +> r₀)) + (hmid : G (b + j) r₀ r₁) (hp : P 2 r₁ ([0, 0] ^ k +> (t +> tail))) + (hc : CounterRun (ICounter k) (a - j - 1) 1 n c) + (hg : G c tail s) : + ∃ xs, Word (k + 1) (n * 2 + 1) xs ∧ + (cfg (fs +> (w ^ j +> r))) [tm1]⊢⁺ (cfg (fs +> (w ^ j +> (xs +> s)))) := by + obtain ⟨xs, hw, hrun⟩ := split_d hp hc hg + refine ⟨xs, hw, frame_step hf ?_⟩ + have hgd : I (b + j) ([1] +> (t +> r₀)) (d +> r₁) := by + simpa only [d, t, append_cons, append_nil] using G_d hmid + refine inner_column (by omega) hin hgd ?_ + have : a - j = 1 + (a - j - 1) := by omega + rw [this] + exact P_G hrun + +theorem first_Q_inside {a b j : ℕ} {fs : List Sym} {r r₀ : ListBlank Sym} + {k : ℕ} {tail tail' s : ListBlank Sym} + (hf : Frame a b fs) (hj : j < a) (hin : Inner j r (t +> r₀)) + (hmid : G (b + j) r₀ ([0, 0] +> (t ^ k +> (d +> tail)))) + (htail : G1 tail tail') + (hrest : G (a - j - 1) (one k +> tail') s) : + (cfg (fs +> (w ^ j +> r))) [tm1]⊢⁺ (cfg (fs +> (w ^ (j + 1) +> s))) := by + rw [pow_add_list w j 1, pow_one_list, append_assoc] + refine frame_step hf ?_ + have hgd : I (b + j) ([1] +> (t +> r₀)) (d +> ([0, 0] +> (t ^ k +> (d +> tail)))) := by + simpa only [d, t, append_cons, append_nil] using G_d hmid + refine inner_column (by omega) hin hgd ?_ + have : a - j = 1 + (a - j - 1) := by omega + rw [this] + exact G_add (P_G (P_d_first_Q k htail)) (P_G (G_w hrest)) + +theorem Num_factor {n : ℕ} {r : ListBlank Sym} (h : Num n r) (hn : 0 < n) : + ∃ j q s, n = (q * 2 + 1) * 2 ^ j ∧ Num q s ∧ r = [0, 0] ^ j +> (t +> s) := by + induction h with + | Num0 => omega + | Num00 n' h_r ih => + obtain ⟨j, q, s, he, hs, hr⟩ := ih (by omega) + refine ⟨1 + j, q, s, ?_, hs, ?_⟩ + · rw [he] + ring + · have h_pow : ([0, 0] : List Sym) ^ (1 + j) = [0, 0] ++ [0, 0] ^ j := by + rw [Nat.add_comm 1 j, Longitudinal.pow_succ_list] + rw [h_pow, hr, append_assoc] + | Num10 n' h_r _ => + exact ⟨0, n', _, by omega, h_r, rfl⟩ + +theorem P_end_birth {n : ℕ} {r : ListBlank Sym} (h : Num n r) : + ∃ j q s, n + 4 = (q * 2 + 1) * 2 ^ j ∧ Num q s ∧ P 1 (d +> r) ((t ++ one j) +> s) := by + obtain ⟨x, hx, hp⟩ := P_nums 2 h + obtain ⟨j, q, s, he, hs, hr⟩ := Num_factor hx (by omega) + refine ⟨j, q, s, he, hs, ?_⟩ + rw [hr] at hp + rw [← one_prefix j] + have hpd := P_d hp + simpa only [u, t, List.append_assoc, append_assoc, append_cons, append_nil] using hpd + +theorem G_end {n : ℕ} {r : ListBlank Sym} (i : ℕ) (h : Num n r) (hi : 0 < i) : + ∃ q s, Value q s ∧ q ≤ n + i * 2 + 2 ∧ G i (d +> r) s := by + rcases i with _ | i + · omega + · obtain ⟨j, q, s, he, hs, hp⟩ := P_end_birth h + have hv : Value (3 + (2 ^ (1 + j) - 1) * q) ((t ++ one j) +> s) := by + have h_phi : (3 : ℕ) = phi 3 := rfl + rw [h_phi] + have h_1j : 1 + j = j + 1 := by omega + rw [h_1j] + exact Value.ValueWord (k := j + 1) (n := 3) (q := q) (by omega) (by decide) + (.Word10 j 1 (Word_one j)) (.ValueNum hs) + obtain ⟨z, hz, hg⟩ := G_value hv i + refine ⟨_, z, hz, ?_, ?_⟩ + · have h_1j : 2 ^ (1 + j) = 2 ^ j * 2 := by ring + have hp0 : 1 ≤ 2 ^ j := pow2_pos j + have h_3 : 3 ≤ 2 ^ j + q := by + rcases q with _ | _ | q' <;> nlinarith + have hp1 : 1 ≤ 2 ^ (1 + j) := pow2_pos (1 + j) + zify [hp1, hp0] at hp1 hp0 h_1j he h_3 ⊢ + nlinarith + · have : i + 1 = 1 + i := by omega + rw [this] + exact G_add (P_G hp) hg + +theorem G_end_word {n : ℕ} {r : ListBlank Sym} (i : ℕ) (h : Num n r) (hi : 0 < i) : + ∃ k q z c xs s, + n + 4 = (q * 2 + 1) * 2 ^ k ∧ + CounterRun (GCounter (k + 1)) (i - 1) 3 z c ∧ + Word (k + 1) z xs ∧ Num (q + c * 2) s ∧ z % 2 = 1 ∧ + phi z + (2 ^ (k + 1) - 1) * (q + c * 2) ≤ n + i * 2 + 2 ∧ + G i (d +> r) (xs +> s) := by + rcases i with _ | i + · omega + · obtain ⟨k, q, r₀, he, h0, hp⟩ := P_end_birth h + have hw : Word (k + 1) 3 (t ++ one k) := .Word10 k 1 (Word_one k) + obtain ⟨z, c, hc, hz⟩ := CounterRun_total + (fun z' hz' => GCounter_total (k + 1) z' (by omega) hz') i 3 (Word_bound hw) + obtain ⟨s, hs, hg⟩ := G_nums c h0 + obtain ⟨xs, hx, hrun⟩ := G_counter_run hw (by omega) hc hg + refine ⟨k, q, z, c, xs, s, he, by simpa using hc, hx, hs, + GCounterRun_odd hc rfl, ?_, ?_⟩ + · have e := GCounterRun_balance hc (by omega) (by decide) + have h_phi3 : phi 3 = 3 := rfl + rw [h_phi3] at e + have hp0 : 1 ≤ 2 ^ k := pow2_pos k + have hp1 : 1 ≤ 2 ^ (k + 1) := pow2_pos (k + 1) + have h_pow : 2 ^ (k + 1) = 2 ^ k * 2 := by ring + have h_3 : 3 ≤ 2 ^ k + q := by + rcases q with _ | _ | q' <;> nlinarith + zify [hp0, hp1] at hp0 hp1 h_pow e he h_3 ⊢ + nlinarith + · have : i + 1 = 1 + i := by omega + rw [this] + exact G_add (P_G hp) hrun + +theorem pure_even {a b j : ℕ} {fs : List Sym} {n : ℕ} {r : ListBlank Sym} + (hf : Frame a b fs) (hj : j ≤ a) (hn : Num (n * 2) r) : + ∃ k q m c z e xs s, + 0 < k ∧ n * 2 + j * 4 + 4 = (q * 2 + 1) * 2 ^ k ∧ + CounterRun (ICounter k) (b + j) 1 m c ∧ + CounterRun (GCounter k) (a - j) m z e ∧ + Word k z xs ∧ Num (q + (c + e) * 2) s ∧ + (cfg (fs +> (w ^ j +> r))) [tm1]⊢⁺ (cfg (fs +> (w ^ j +> (xs +> s)))) := by + obtain ⟨r₀, h0, hp⟩ := P_nums (j * 2 + 2) hn + obtain ⟨k, q, r₁, he, h1, er⟩ := Num_factor h0 (by omega) + have hk : 0 < k := by + rcases k with _ | k' <;> omega + obtain ⟨m, c, hc, hm⟩ := CounterRun_total (ICounter_total k) (b + j) 1 (Word_bound (Word_one k)) + obtain ⟨z, e, hz, _⟩ := CounterRun_total (fun z' hz' => GCounter_total k z' hk hz') (a - j) m hm + obtain ⟨s, hs, hg⟩ := G_nums (c + e) h1 + rw [er] at hp + obtain ⟨xs, hx, hstep⟩ := split_root hf hj hk hp hc hz hg + exact ⟨k, q, m, c, z, e, xs, s, hk, by omega, hc, hz, hx, hs, hstep⟩ + +theorem pure_one {a b j : ℕ} {fs : List Sym} {n : ℕ} {r : ListBlank Sym} + (hf : Frame a b fs) (hj : j < a) (hn : Num n r) : + ∃ k q z c xs s, + 0 < k ∧ n * 2 + j * 4 + b * 2 + 6 = (q * 2 + 1) * 2 ^ k ∧ + CounterRun (GCounter (k + 1)) (a - j - 1) 3 z c ∧ + Word (k + 1) z xs ∧ Num (q + c * 2) s ∧ + (cfg (fs +> (w ^ j +> (t +> ([0, 0] +> r))))) [tm1]⊢⁺ (cfg (fs +> (w ^ j +> (xs +> s)))) := by + obtain ⟨x, hx, hi⟩ := I_nums (j * 2 + 2) (.Num00 n hn) + obtain ⟨y, hy, hb⟩ := G_nums (b + j) hx + obtain ⟨k, q, r₀, he, h0, hp⟩ := P_end_birth hy + have hk : 0 < k := by + rcases k with _ | k' <;> omega + have hw : Word (k + 1) 3 (t ++ one k) := .Word10 k 1 (Word_one k) + obtain ⟨z, c, hc, hz⟩ := CounterRun_total + (fun z' hz' => GCounter_total (k + 1) z' (by omega) hz') (a - j - 1) 3 (Word_bound hw) + obtain ⟨s, hs, gc⟩ := G_nums c h0 + obtain ⟨xs, hxs, hg⟩ := G_counter_run hw (by omega) hc gc + refine ⟨k, q, z, c, xs, s, hk, by omega, hc, hxs, hs, ?_⟩ + refine frame_step hf (column_partial (by omega) ⟨t +> x, d +> y, P_t (j * 2 + 2) hi, ?_, ?_⟩) + · simpa only [d, t, append_cons, append_nil] using G_d hb + · have : a - j = 1 + (a - j - 1) := by omega + rw [this] + exact G_add (P_G hp) hg + +theorem late_second_Q_pair {a : ℕ} {fs : List Sym} {k : ℕ} {xs : List Sym} {q : ℕ} {r : ListBlank + Sym} + (hf : Frame a a fs) (ha : 2 ≤ a) (hpow : a * 6 + 2 = 2 ^ (2 + k)) + (hw : Word (k + 1) (a * 2 + 2) xs) (hr : Num q r) : + ∃ s, Num ((q * 3 + 11) * a + q + 3) s ∧ + (cfg (fs +> (w ^ (a - 1) +> (xs +> r)))) [tm1]⊢⁺ (cfg (fs +> (w ^ a +> s))) := by + obtain ⟨s₀, h0, hfirst⟩ := late_second_Q (a := a) (b := a) (j := a - 2) + hf (by omega) (by omega) hw (by omega) hr + have h_eq0 : (q * 2 + 5) * 2 ^ (2 + k) + (a + (a - 2) - 1) + (a - (a - 2)) * 2 = + (((q * 3 + 8) * a + q + 2) * 2 + 1) * 2 + 1 := by + have h_sub1 : a + (a - 2) - 1 = a * 2 - 3 := by omega + have h_sub2 : (a - (a - 2)) * 2 = 4 := by omega + rw [← hpow, h_sub1, h_sub2] + have ha3 : 3 ≤ a * 2 := by omega + zify [ha3] at ha3 ⊢ + ring + rw [h_eq0] at h0 + obtain ⟨s₁, h1, rfl⟩ := Num_odd_inv h0 + obtain ⟨s₂, h2, rfl⟩ := Num_odd_inv h1 + obtain ⟨s, hs, hsecond⟩ := pure_three (a := a) (b := a) (j := a - 1) hf (by omega) h2 + refine ⟨s, ?_, ?_⟩ + · have : (q * 3 + 11) * a + q + 3 = (q * 3 + 8) * a + q + 2 + a * 2 + a + 1 := by ring + rwa [this] + · have ha1 : 1 + (a - 2) = a - 1 := by omega + have ha2 : a - 1 + 1 = a := by omega + rw [ha1] at hfirst + rw [ha2] at hsecond + exact ReachesPlus.trans hfirst hsecond + +theorem late_second_Q_recover {a : ℕ} {fs : List Sym} {k : ℕ} {xs : List Sym} {q : ℕ} {r : ListBlank + Sym} + (hf : Frame a a fs) (ha : 5 ≤ a) (hpow : a * 6 + 2 = 2 ^ (2 + k)) + (hw : Word (k + 1) (a * 2 + 2) xs) (hr : Num q r) (hq : q ≤ 3) : + ∃ K z Q ys s, + 0 < K ∧ K ≤ 4 + k ∧ Word K z ys ∧ Num Q s ∧ z % 2 = 1 ∧ + (2 ^ (2 + k) ≤ 2 ^ K → z = a * 4 + 1) ∧ + phi z + (2 ^ K - 1) * Q < (a * 3 + 1) * 8 ∧ + (K = 1 → z = 3 ∧ Q ≤ (a + a) * 8) ∧ + (cfg (fs +> (w ^ (a - 1) +> (xs +> r)))) [tm1]⊢⁺ (cfg ((fs ++ w ^ a ++ d) +> (ys +> s))) := by + have hmod : a % 4 = 1 := by + rcases Frame_phase hf with ⟨_, h⟩ | ⟨h, _⟩ <;> omega + obtain ⟨r₂, h2, hfirst⟩ := late_second_Q_pair hf (by omega) hpow hw hr + have ea : a = a / 4 * 4 + 1 := by omega + have h_even : (q * 3 + 11) * a + q + 3 = ((q * 3 + 11) * (a / 4) * 2 + q * 2 + 7) * 2 := by + nlinarith + rw [h_even] at h2 + obtain ⟨l, q₀, m, c, z₀, e, ys, r₃, hl, he, hc, hz0, hy, h3, hthird⟩ := + pure_even (a := a) (b := a) (j := a) hf (by omega) h2 + have el : l = 1 := by + rcases l with _ | _ | l' + · omega + · rfl + · have : (q₀ * 2 + 1) * 2 ^ (l' + 2) = ((q₀ * 2 + 1) * 2 ^ l') * 4 := by ring + rw [this] at he + omega + subst el + have ha_sub : a - a = 0 := by omega + rw [ha_sub] at hz0 + cases hz0 + have hm : 0 < m := ICounterRun_positive hc (by decide) + have hmb : m < 4 := Word_bound hy + obtain ⟨z₁, c₁, hc1, hzb⟩ := CounterRun_total (fun z' hz' => GCounter_total 1 z' (by decide) hz') + (a * 2 + 2) m hmb + have hc1' : CounterRun (GCounter 1) (2 + a * 2) m z₁ c₁ := by + have : 2 + a * 2 = a * 2 + 2 := by omega + rwa [this] + obtain ⟨rfl, hcl, hcu⟩ := GCounterRun_one hc1' hm hmb + have h3' : Num (q₀ + c * 2) r₃ := by simpa using h3 + obtain ⟨r₄, h4, hg⟩ := G_nums c₁ h3' + obtain ⟨l, q₁, z, c₂, ys', s, ebirth, hc2, hy', hs, hodd, hvalue, hlast⟩ := + G_end_word (a + a) h4 (by omega) + have ecount := ICounterRun_balance hc + have h_2_1 : 2 ^ (1 + 1) - 1 = 3 := rfl + rw [h_2_1] at ecount + have hpm := phi_bounds hm + have hq_a : (q * 3 + 11) * (a / 4) ≤ 20 * (a / 4) := by + rcases q with _ | _ | _ | _ | q' <;> omega + have hbirth : 2 ^ l < 2 ^ (4 + k) := by + have hp4 : 2 ^ (4 + k) = 2 ^ (2 + k) * 4 := by ring + have hle_mul : 1 * 2 ^ l ≤ (q₁ * 2 + 1) * 2 ^ l := Nat.mul_le_mul_right (2 ^ l) (by omega) + omega + refine ⟨l + 1, z, q₁ + c₂ * 2, ys', s, by omega, ?_, hy', hs, hodd, ?_, ?_, ?_, ?_⟩ + · have hlt := pow2_lt_iff.mp hbirth + omega + · intro hwide + have hp_wide : 2 ^ (2 + k) * 2 ≤ 2 ^ (1 + (l + 1)) := by + have : 2 ^ (1 + (l + 1)) = 2 ^ (l + 1) * 2 := by ring + omega + obtain ⟨hz', _⟩ := GCounterRun_linear hc2 (by omega) + omega + · omega + · intro eK + have el0 : l = 0 := by omega + subst el0 + have hzlo := GCounterRun_three hc2 (by omega) rfl + have hzhi := Word_bound hy' + have ez : z = 3 := by + change z < 4 at hzhi + omega + subst ez + refine ⟨rfl, ?_⟩ + have e2 := GCounterRun_balance hc2 (by decide) (by decide) + have h_phi3 : phi 3 = 3 := rfl + have h_21 : (2 ^ 1 - 1) * 2 = 2 := rfl + rw [h_phi3, h_21] at e2 + change q₀ + c * 2 + c₁ * 2 + 4 = (q₁ * 2 + 1) * 1 at ebirth + omega + · exact ReachesPlus.trans hfirst (ReachesPlus.trans hthird + (one_boundary hf hy (Or.inr (by omega)) hc1 hg hlast)) + +theorem translated_step {a j : ℕ} {fs : List Sym} {k : ℕ} {xs : List Sym} {r : ListBlank Sym} + (hf : Frame a a fs) (ha : a = j + 1) (hpow : a * 6 + 2 = 2 ^ k) + (hw : Bin k (a * 2 + 2) xs) : + (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ (cfg (fs +> (w ^ j +> (xs +> ([1] +> r))))) := by + have hk : 0 < k := by + rcases k with _ | k' <;> omega + have hp_1k : 2 ^ (1 + k) = 2 ^ k * 2 := by ring + obtain ⟨ys, hy, hp⟩ := P_Bins (a * 2) hw hk (by omega) + have h_top : a * 2 + 2 + a * 2 * 2 = 2 ^ k := by omega + rw [h_top] at hy + rw [Bin_unique hy (Bin_top k)] at hp + obtain ⟨zs, hz, hi⟩ := I_Bins (a + j) (Bin_one hk) (by omega) + obtain ⟨xs', hx, hlast⟩ := P_Bin hz hk (by omega) + have ex : xs' = xs := by + have : 1 + (a + j) + 2 = a * 2 + 2 := by omega + rw [this] at hx + exact Bin_unique hx hw + subst ex + refine frame_step hf (column_partial (by omega) ⟨[0, 0] ^ k +> ([1] +> r), zs +> ([1] +> r), ?_, + ?_, ?_⟩) + · have h_concat := hp.sideRLs_concat (SideRLs.nil r) + have h_p : j * 2 + 2 = a * 2 := by omega + rw [h_p] + simpa only [P, List.append_assoc, append_assoc, append_nil] using h_concat + · have h_concat := hi.sideRLs_concat (SideRLs.nil ([1] +> r)) + simpa only [I, List.append_assoc, append_assoc, append_nil] using h_concat + · have h_aj : a - j = 1 := by omega + rw [h_aj] + apply P_G + have h_concat := hlast.sideRLs_concat (SideRLs.nil ([1] +> r)) + simpa only [P, pow_one_list, List.append_assoc, append_assoc, append_nil] using h_concat + +theorem translated_nonhalt {a j : ℕ} {fs : List Sym} {k : ℕ} {xs : List Sym} {r : ListBlank Sym} + (hf : Frame a a fs) (ha : a = j + 1) (hpow : a * 6 + 2 = 2 ^ k) + (hw : Bin k (a * 2 + 2) xs) : + NonHaltFrom tm1 (cfg (fs +> (w ^ j +> (xs +> r)))) := by + refine nonHaltFrom_of_progress (Inv := + fun c => ∃ s, c = cfg (fs +> (w ^ j +> (xs +> s)))) ?_ ⟨r, rfl⟩ + rintro c ⟨s, rfl⟩ + exact ⟨cfg (fs +> (w ^ j +> (xs +> ([1] +> s)))), translated_step hf ha hpow hw, ⟨[1] +> s, rfl⟩⟩ + +theorem Word_Bin {k n : ℕ} {xs : List Sym} (hw : Word k n xs) : + ∃ bs, Bin k n bs ∧ xs = bs ++ t := by + induction hw with + | Word0 => exact ⟨[0], .Bin0, rfl⟩ + | Word1 => exact ⟨[1], .Bin1, rfl⟩ + | Word00 k' n' _ ih => + obtain ⟨bs, hb, rfl⟩ := ih + exact ⟨[0, 0] ++ bs, .Bin00 k' n' hb, by simp only [List.append_assoc]⟩ + | Word10 k' n' _ ih => + obtain ⟨bs, hb, rfl⟩ := ih + exact ⟨t ++ bs, .Bin10 k' n' hb, by simp only [List.append_assoc]⟩ + +theorem translated_word_nonhalt {a j : ℕ} {fs : List Sym} {k : ℕ} {xs : List Sym} {r : ListBlank + Sym} + (hf : Frame a a fs) (ha : a = j + 1) (hpow : a * 6 + 2 = 2 ^ k) + (hw : Word k (a * 2 + 2) xs) : + NonHaltFrom tm1 (cfg (fs +> (w ^ j +> (xs +> r)))) := by + obtain ⟨bs, hb, rfl⟩ := Word_Bin hw + rw [append_assoc] + exact translated_nonhalt hf ha hpow hb + +def frame : ℕ → ℕ × ℕ × List Sym + | 0 => (0, 1, d ++ d) + | n + 1 => + let (a, b, xs) := frame n + (a + b, a * 2 + 1, xs ++ w ^ a ++ d) + +theorem frame_spec (n : ℕ) : + let (a, b, xs) := frame n + Frame a b xs := by + induction n with + | zero => exact .Frame0 + | succ n ih => + dsimp [frame] + exact .FrameS ih + +theorem Frame_close {a b : ℕ} {xs : List Sym} (h : Frame a b xs) : + a ≤ b ∧ b ≤ a + 1 := by + induction h with + | Frame0 => omega + | FrameS _ ih => omega + +theorem narrow_next_guard {a b j : ℕ} {fs : List Sym} {k z : ℕ} + (hf : Frame a b fs) (hj : j < a) (hsize : 2 ^ (1 + k) ≤ b + j) + (hlower : z % 2 = 0 → (a - j) * 2 ≤ z) : + z % 2 = 1 ∨ ((a - (j + 1)) * 2 + 2 ≤ z ∧ 2 ^ k - z / 2 ≤ (j + 1) * 2) := by + have hclose := Frame_close hf + by_cases hodd : z % 2 = 1 + · exact Or.inl hodd + · right + have hlow := hlower (by omega) + have : 2 ^ (1 + k) = 2 ^ k * 2 := by ring + omega + +theorem frame_size (n : ℕ) : + let (a, b, _) := frame n + a * 2 + b + 1 = 2 ^ (n + 1) := by + induction n with + | zero => rfl + | succ n ih => + dsimp [frame] at ih ⊢ + have : 2 ^ (n + 1 + 1) = 2 ^ (n + 1) * 2 := by ring + omega + +def prefix_word (n : ℕ) : List Sym := (frame n).2.2 + +def word : ℕ → ℕ → List Sym + | 0, 0 => [0, 1, 0] + | 0, _ => d + | k + 1, n => (if n % 2 == 0 then [0, 0] else t) ++ word k (n / 2) + +theorem word_spec (k n : ℕ) (hn : n < 2 ^ (1 + k)) : Word k n (word k n) := by + induction k generalizing n with + | zero => + rcases n with _ | _ | n' + · exact .Word0 + · exact .Word1 + · change n' + 2 < 2 at hn + omega + | succ k ih => + dsimp [word] + have hp : 2 ^ (1 + (k + 1)) = 2 ^ (1 + k) * 2 := by ring + by_cases he : n % 2 = 0 + · have hbeq : (n % 2 == 0) = true := beq_iff_eq.mpr he + rw [hbeq, if_pos rfl] + have hn_eq : (n / 2) * 2 = n := by omega + have hw0 := Word.Word00 k (n / 2) (ih (n / 2) (by omega)) + rwa [hn_eq] at hw0 + · have hbeq : (n % 2 == 0) = false := by + rcases h : (n % 2 == 0) + · rfl + · exfalso; exact he (beq_iff_eq.mp h) + rw [hbeq, if_neg Bool.false_ne_true] + have hn_eq : (n / 2) * 2 + 1 = n := by omega + have hw1 := Word.Word10 k (n / 2) (ih (n / 2) (by omega)) + rwa [hn_eq] at hw1 + +structure Level (h a b : ℕ) (fs : List Sym) : Prop where + level_frame : Frame a b fs + level_height : 5 ≤ h + level_size : a * 2 + b + 1 = 2 ^ (h - 1) + +theorem Level_bounds {h a b : ℕ} {fs : List Sym} (hl : Level h a b fs) : + 5 ≤ h ∧ 5 ≤ a ∧ a ≤ b ∧ b ≤ a + 1 := by + rcases hl with ⟨hf, hh, hsize⟩ + have hclose := Frame_close hf + have h16 : 16 ≤ 2 ^ (h - 1) := by + have : (16 : ℕ) = 2 ^ 4 := rfl + rw [this] + exact pow2_mono (by omega) + omega + +theorem Level_next {h a b : ℕ} {fs : List Sym} (hl : Level h a b fs) : + Level (1 + h) (a + b) (a * 2 + 1) (fs ++ w ^ a ++ d) := by + rcases hl with ⟨hf, hh, hsize⟩ + refine ⟨.FrameS hf, by omega, ?_⟩ + have h_sub : 1 + h - 1 = (h - 1) + 1 := by omega + rw [h_sub, pow2_succ_right] + omega + +def Narrow (a j k n : ℕ) : Prop := + n % 2 = 1 ∨ ((a - j) * 2 + 2 ≤ n ∧ 2 ^ (1 + k) ≤ n + j * 4) + +def Two (a j n : ℕ) : Prop := + n % 2 = 1 ∨ (a - j) * 2 + 2 ≤ n + +inductive SinglePhase (h a b j : ℕ) : ℕ → ℕ → ℕ → Prop where + | SN (k n q : ℕ) : 3 ≤ k → k + 2 ≤ h → Narrow a j k n → SinglePhase h a b j k n q + | S2 (n q : ℕ) : Two a j n → SinglePhase h a b j 2 n q + | S1 (n q : ℕ) : (j = a ∨ (j + 1 = a ∧ n = 1 ∧ q + 1 ≤ (a * 2 + b + 1) * 2)) → + SinglePhase h a b j 1 n q + | SX (k q : ℕ) : + ((h = k + 1 ∧ q ≤ 1) ∨ (k = h ∧ q = 0) ∨ (k = h + 1 ∧ j = a ∧ a = b ∧ q = 0)) → + SinglePhase h a b j k (a * 2 + b + 1 - j) q + | SY (k q : ℕ) : h ≤ k + 1 → k ≤ h + 1 → (k < h ∨ j < a) → + SinglePhase h a b j k ((a - j) * 2 + 1) q + | SZ (n : ℕ) : n * 2 = (a * 2 + b + 1) * 2 + (a - j) → SinglePhase h a b j (h - 1) n 0 + +inductive Single (h a b j : ℕ) : ListBlank Sym → Prop where + | SNum (n : ℕ) (r : ListBlank Sym) : Num n r → n ≤ a * 8 → Single h a b j r + | SWord (k n q : ℕ) (xs : List Sym) (r : ListBlank Sym) : + 0 < k → 0 < n → Word k n xs → Num q r → + SinglePhase h a b j k n q → phi n + (2 ^ k - 1) * q ≤ (a * 2 + b + 1) * 4 → + Single h a b j (xs +> r) + +inductive SRoot : Cfg Sym Q → Prop where + | sroot (h a b j : ℕ) (fs : List Sym) (r : ListBlank Sym) : + Level h a b fs → j ≤ a → Single h a b j r → SRoot (cfg (fs +> (w ^ j +> r))) + +theorem single_odd_phase {h a b j k n q : ℕ} + (hk : 2 ≤ k) (hmax : k ≤ h + 1) (hodd : n % 2 = 1) + (hwide : h ≤ k + 1 → n = (a - j) * 2 + 1 ∧ (k < h ∨ j < a)) : + SinglePhase h a b j k n q := by + by_cases hge : h ≤ k + 1 + · obtain ⟨rfl, hj⟩ := hwide hge + exact .SY k q hge hmax hj + · rcases k with _ | _ | _ | k' + · omega + · omega + · exact .S2 n q (Or.inl hodd) + · exact .SN (k' + 3) n q (by omega) (by omega) (Or.inl hodd) + +theorem split_capacity {k i j m c z e : ℕ} (q : ℕ) + (hk : 0 < k) (hi : CounterRun (ICounter k) i 1 m c) + (hg : CounterRun (GCounter k) j m z e) : + phi z + (2 ^ k - 1) * (q + (c + e) * 2) + c + (m - phi m) = + 1 + i + j * 2 + (2 ^ k - 1) * q := by + have hm : 0 < m := ICounterRun_positive hi (by decide) + have e0 := ICounterRun_balance hi + have e1 := GCounterRun_balance hg hk hm + have hpm : phi m ≤ m := (phi_bounds hm).2.1 + have hp1 : 2 ^ (1 + k) = 2 ^ k * 2 := by ring + have hp0 : 1 ≤ 2 ^ k := pow2_pos k + have hp01 : 1 ≤ 2 ^ (1 + k) := pow2_pos (1 + k) + zify [hp0, hp01, hpm] at hp0 hp01 hpm e0 e1 hp1 ⊢ + ring_nf at e0 e1 hp1 ⊢ + linarith + +theorem pure_odd_boundary_closed {h a b : ℕ} {fs : List Sym} {n : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hn : Num n r) (hbound : n * 2 + 1 ≤ a * 8) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ a +> (t +> r)))) [tm1]⊢⁺ c := by + have hb := Level_bounds hl + obtain ⟨s, hs, hstep⟩ := pure_odd_boundary hl.level_frame hn + refine ⟨_, ?_, hstep⟩ + have h_w0 : (fs ++ w ^ a ++ d) +> s = (fs ++ w ^ a ++ d) +> (w ^ 0 +> s) := rfl + rw [h_w0] + exact .sroot (1 + h) (a + b) (a * 2 + 1) 0 (fs ++ w ^ a ++ d) s + (Level_next hl) (by omega) (.SNum _ s hs (by omega)) + +theorem pure_three_closed {h a b j : ℕ} {fs : List Sym} {n : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hj : j < a) (hn : Num n r) (hbound : n * 4 + 3 ≤ a * 8) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ j +> (t +> (t +> r))))) [tm1]⊢⁺ c := by + have hb := Level_bounds hl + obtain ⟨s, hs, hstep⟩ := pure_three hl.level_frame hj hn + exact ⟨_, .sroot h a b (j + 1) fs s hl (by omega) (.SNum _ s hs (by omega)), hstep⟩ + +theorem pure_one_closed {h a b j : ℕ} {fs : List Sym} {n : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hj : j < a) (hn : Num n r) (hbound : n * 4 + 1 ≤ a * 8) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ j +> (t +> ([0, 0] +> r))))) [tm1]⊢⁺ c := by + have hb := Level_bounds hl + rcases hl with ⟨hf, hh, hsize⟩ + obtain ⟨k, q, z, c, xs, s, hk, he, hc, hw, hs, hstep⟩ := pure_one hf hj hn + have hwidth : k + 1 ≤ h + 1 := by + have hlt : 2 ^ k < 2 ^ (h + 1) := by + have : h + 1 = (h - 1) + 2 := by omega + rw [this] + have : 2 ^ ((h - 1) + 2) = 2 ^ (h - 1) * 4 := by ring + nlinarith + have := pow2_lt_iff.mp hlt + omega + have hodd : z % 2 = 1 := GCounterRun_odd hc rfl + have hphase : SinglePhase h a b j (k + 1) z (q + c * 2) := by + refine single_odd_phase (by omega) hwidth hodd (fun hwide => ?_) + have hp : 2 ^ (h - 1) ≤ 2 ^ (k + 1) := pow2_mono (by omega) + have h_lin_bound : 3 + (a - j - 1) * 2 < 2 ^ (1 + (k + 1)) := by + have : 2 ^ (1 + (k + 1)) = 2 ^ (k + 1) * 2 := by ring + omega + obtain ⟨hz, _⟩ := GCounterRun_linear hc h_lin_bound + exact ⟨by omega, Or.inr hj⟩ + have hvalue : phi z + (2 ^ (k + 1) - 1) * (q + c * 2) ≤ (a * 2 + b + 1) * 4 := by + have e := GCounterRun_balance hc (by omega) (by decide) + have h_phi3 : phi 3 = 3 := rfl + rw [h_phi3] at e + have hp1 : 2 ^ (k + 1) = 2 ^ k * 2 := by ring + have hp0 : 1 ≤ 2 ^ k := pow2_pos k + have hp01 : 1 ≤ 2 ^ k * 2 := by omega + have haj1 : 1 ≤ a - j := by omega + have haj : j ≤ a := by omega + rw [hp1] at e ⊢ + zify [hp0, hp01, haj1, haj] at hp0 hp01 haj1 haj e he hb hbound ⊢ + nlinarith + have hz_pos : 0 < z := by omega + exact ⟨_, .sroot h a b j fs (xs +> s) ⟨hf, hh, hsize⟩ (by omega) + (.SWord (k + 1) z (q + c * 2) xs s (by omega) hz_pos hw hs hphase hvalue), hstep⟩ + +theorem even_birth_phase {h a b j : ℕ} {fs : List Sym} {n k q m c z e : ℕ} + (hl : Level h a b fs) (hj : j ≤ a) (hn : n ≤ a * 4) (hk : 2 ≤ k) + (he : n * 2 + j * 4 + 4 = (q * 2 + 1) * 2 ^ k) + (hi : CounterRun (ICounter k) (b + j) 1 m c) + (hg : CounterRun (GCounter k) (a - j) m z e) : + SinglePhase h a b j k z (q + (c + e) * 2) := by + have hb := Level_bounds hl + rcases hl with ⟨hf, hh, hsize⟩ + have hm : 0 < m := ICounterRun_positive hi (by decide) + have hwidth : k ≤ h + 1 := by + have hle : 2 ^ k ≤ 2 ^ (h + 1) := by + have : h + 1 = (h - 1) + 2 := by omega + rw [this] + have : 2 ^ ((h - 1) + 2) = 2 ^ (h - 1) * 4 := by ring + nlinarith + exact pow2_le_iff.mp hle + by_cases hwide : h ≤ k + 1 + · have hp : 2 ^ (h - 1) ≤ 2 ^ k := pow2_mono (by omega) + have hp1 : 2 ^ (1 + k) = 2 ^ k * 2 := by ring + obtain ⟨em, ec⟩ := ICounterRun_linear hi (by omega) + obtain ⟨ez, ee⟩ := GCounterRun_linear hg (by omega) + subst em ec ez ee + have h_q : q + (0 + 0) * 2 = q := by omega + have h_z : 1 + (b + j) + (a - j) * 2 = a * 2 + b + 1 - j := by omega + rw [h_q, h_z] + refine .SX k q ?_ + by_cases hlo : h = k + 1 + · left + refine ⟨hlo, ?_⟩ + have hk_sub : h - 1 = k := by omega + rw [hk_sub] at hsize + nlinarith + · right + by_cases hhi : k = h + · left + subst hhi + refine ⟨rfl, ?_⟩ + have ep : 2 ^ k = 2 ^ (k - 1) * 2 := by + have : k = (k - 1) + 1 := by omega + conv_lhs => rw [this] + ring + nlinarith + · right + have ek : k = h + 1 := by omega + subst ek + have ep : 2 ^ (h + 1) = 2 ^ (h - 1) * 4 := by + have : h + 1 = (h - 1) + 2 := by omega + rw [this] + ring + refine ⟨rfl, by nlinarith, by nlinarith, by nlinarith⟩ + · have ht : Two a j z := by + by_cases hz : z % 2 = 0 + · right + obtain ⟨_, ez, _⟩ := GCounterRun_even hg hz + omega + · left; omega + by_cases hk2 : k = 2 + · subst hk2 + exact .S2 z (q + (c + e) * 2) ht + · refine .SN k z (q + (c + e) * 2) (by omega) (by omega) ?_ + by_cases hodd : z % 2 = 1 + · exact Or.inl hodd + · have heven : z % 2 = 0 := by omega + have hlower : (a - j) * 2 + 2 ≤ z := by + rcases ht with h1 | h2 <;> omega + right + refine ⟨hlower, ?_⟩ + by_cases hsmall : k + 3 ≤ h + · have hp : 2 ^ (2 + k) ≤ 2 ^ (h - 1) := pow2_mono (by omega) + have : 2 ^ (2 + k) = 2 ^ (1 + k) * 2 := by ring + omega + · have ek : k + 2 = h := by omega + have hk_sub : h - 1 = 1 + k := by omega + rw [hk_sub] at hsize + obtain ⟨em, ec⟩ := ICounterRun_linear hi (by omega) + obtain ⟨_, ez, _⟩ := GCounterRun_even hg heven + omega + +theorem even_birth_capacity {a b j n k q m c z e : ℕ} + (hab : a ≤ b) (hba : b ≤ a + 1) (hj : j ≤ a) (hn : n ≤ a * 4) (hk : 0 < k) + (he : n * 2 + j * 4 + 4 = (q * 2 + 1) * 2 ^ k) + (hi : CounterRun (ICounter k) (b + j) 1 m c) + (hg : CounterRun (GCounter k) (a - j) m z e) : + phi z + (2 ^ k - 1) * (q + (c + e) * 2) ≤ (a * 2 + b + 1) * 4 := by + have e_cap := split_capacity q hk hi hg + have h1 : 2 ^ k - 1 ≤ 2 ^ k := Nat.sub_le _ _ + have h2 : (2 ^ k - 1) * q * 2 ≤ (q * 2 + 1) * 2 ^ k := by nlinarith + omega + +theorem even_birth_small_root {h a b j : ℕ} {fs : List Sym} {n q m c z e : ℕ} + {xs : List Sym} {s : ListBlank Sym} + (hl : Level h a b fs) (hj : j ≤ a) (hn : n ≤ a * 4) + (he : n * 2 + j * 4 + 4 = (q * 2 + 1) * 2) + (hi : CounterRun (ICounter 1) (b + j) 1 m c) + (hg : CounterRun (GCounter 1) (a - j) m z e) + (hw : Word 1 z xs) (hs : Num (q + (c + e) * 2) s) : + SRoot (cfg (fs +> (w ^ j +> (xs +> s)))) := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hm : 0 < m := ICounterRun_positive hi (by decide) + have hz : 0 < z := GCounterRun_positive hg hm + have hmb : m < 4 := ICounterRun_bound hi (by decide) + have hzb : z < 4 := Word_bound hw + have hvalue : phi z + (2 ^ 1 - 1) * (q + (c + e) * 2) ≤ (a * 2 + b + 1) * 4 := + even_birth_capacity hab hba hj hn (by decide) he hi hg + by_cases hedge : j = a + · exact .sroot h a b j fs (xs +> s) hl hj + (.SWord 1 z (q + (c + e) * 2) xs s (by decide) hz hw hs (.S1 z _ (Or.inl hedge)) hvalue) + · by_cases hz3 : z = 3 + · subst hz3 + have e0 := ICounterRun_balance hi + have e1 := GCounterRun_balance hg (by decide) hm + have hpm := phi_bounds hm + have h_21 : 2 ^ (1 + 1) - 1 = 3 := rfl + have h_20 : (2 ^ 1 - 1) * 2 = 2 := rfl + have h_phi3 : phi 3 = 3 := rfl + rw [h_21] at e0 + rw [h_20, h_phi3] at e1 + have htail : q + (c + e) * 2 ≤ a * 8 := by omega + rw [Word_max hw rfl] + change SRoot (cfg (fs +> (w ^ j +> (w +> s)))) + have en : w ^ j +> (w +> s) = w ^ (j + 1) +> s := by + rw [pow_add_list w j 1, pow_one_list, append_assoc] + rw [en] + exact .sroot h a b (j + 1) fs s hl (by omega) (.SNum _ s hs htail) + · have hu : a - j = 1 := by + by_cases htwo : 2 ≤ a - j + · have hrun : CounterRun (GCounter 1) (2 + (a - j - 2)) m z e := by + have : 2 + (a - j - 2) = a - j := by omega + rwa [this] + obtain ⟨ez, _⟩ := GCounterRun_one hrun hm hmb + omega + · omega + have ez : z = 1 := by + by_cases heven : z % 2 = 0 + · obtain ⟨_, ez', _⟩ := GCounterRun_even hg heven + omega + · omega + subst ez + have htail : q + (c + e) * 2 + 1 ≤ (a * 2 + b + 1) * 2 := by + have e_cap := split_capacity q (by decide) hi hg + have h_phi1 : phi 1 = 1 := rfl + have h_21 : 2 ^ 1 - 1 = 1 := rfl + rw [h_phi1, h_21] at e_cap + omega + exact .sroot h a b j fs (xs +> s) hl hj + (.SWord 1 1 (q + (c + e) * 2) xs s (by decide) (by decide) hw hs + (.S1 1 _ (Or.inr ⟨by omega, rfl, htail⟩)) hvalue) + +theorem pure_even_closed {h a b j : ℕ} {fs : List Sym} {n : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hj : j ≤ a) (hr : Num (n * 2) r) (hn : n ≤ a * 4) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ j +> r))) [tm1]⊢⁺ c := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + obtain ⟨k, q, m, c, z, e, xs, s, hk, he, hi, hg, hw, hs, hstep⟩ := + pure_even hl.level_frame hj hr + refine ⟨_, ?_, hstep⟩ + by_cases hk1 : k = 1 + · subst hk1 + exact even_birth_small_root hl hj hn he hi hg hw hs + · refine .sroot h a b j fs (xs +> s) hl hj (.SWord k z (q + (c + e) * 2) xs s hk ?_ hw hs ?_ ?_) + · exact GCounterRun_positive hg (ICounterRun_positive hi (by decide)) + · exact even_birth_phase hl hj hn (by omega) he hi hg + · exact even_birth_capacity hab hba hj hn hk he hi hg + +theorem pure_closed {h a b j : ℕ} {fs : List Sym} {n : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hj : j ≤ a) (hn : Num n r) (hbound : n ≤ a * 8) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ j +> r))) [tm1]⊢⁺ c := by + cases hn with + | Num0 => + exact pure_even_closed (n := 0) hl hj .Num0 (by omega) + | Num00 n' hr => + exact pure_even_closed hl hj (.Num00 n' hr) (by omega) + | Num10 n' hr => + by_cases hja : j = a + · subst hja + exact pure_odd_boundary_closed hl hr hbound + · cases hr with + | Num0 => + have h00 : ([0, 0] : List Sym) +> (default : ListBlank Sym) = default := + all0_spec (a := [0, 0]) rfl + rw [← h00] + exact pure_one_closed hl (by omega) .Num0 (by omega) + | Num00 n'' hr' => + exact pure_one_closed hl (by omega) hr' (by omega) + | Num10 n'' hr' => + exact pure_three_closed hl (by omega) hr' (by omega) + +theorem small_single_root {h a b j : ℕ} {fs : List Sym} {k n : ℕ} {xs : List Sym} + {q : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hj : j ≤ a) (hk : 0 < k) (hwidth : k + 3 ≤ h) (hn : 0 < n) + (hw : Word k n xs) (hr : Num q r) + (hcap : phi n + (2 ^ k - 1) * q ≤ (a * 2 + b + 1) * 2) + (hlower : n % 2 = 0 → (a - j) * 2 + 2 ≤ n) + (hsmall : k = 1 → j + 2 ≤ a → n = 3) : + SRoot (cfg (fs +> (w ^ j +> (xs +> r)))) := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + by_cases hk1 : k = 1 + · subst hk1 + have hnb : n < 4 := Word_bound hw + by_cases hedge : j = a + · exact .sroot h a b j fs (xs +> r) hl hj + (.SWord 1 n q xs r (by decide) hn hw hr (.S1 n q (Or.inl hedge)) (by omega)) + · by_cases hn3 : n = 3 + · subst hn3 + rw [Word_max hw rfl] + change SRoot (cfg (fs +> (w ^ j +> (w +> r)))) + have en : w ^ j +> (w +> r) = w ^ (j + 1) +> r := by + rw [pow_add_list w j 1, pow_one_list, append_assoc] + rw [en] + refine .sroot h a b (j + 1) fs r hl (by omega) (.SNum q r hr ?_) + have h_phi3 : phi 3 = 3 := rfl + have h_21 : 2 ^ 1 - 1 = 1 := rfl + rw [h_phi3, h_21] at hcap + omega + · have hnear : j + 1 = a := by + have := hsmall rfl + omega + have en : n = 1 := by + by_cases hev : n % 2 = 0 + · have := hlower hev + omega + · omega + subst en + refine .sroot h a b j fs (xs +> r) hl hj + (.SWord 1 1 q xs r (by decide) + (by decide) hw hr (.S1 1 q (Or.inr ⟨hnear, rfl, ?_⟩)) (by omega)) + have h_phi1 : phi 1 = 1 := rfl + have h_21 : 2 ^ 1 - 1 = 1 := rfl + rw [h_phi1, h_21] at hcap + omega + · refine .sroot h a b j fs (xs +> r) hl hj (.SWord k n q xs r hk hn hw hr ?_ (by omega)) + by_cases hk2 : k = 2 + · subst hk2 + refine .S2 n q ?_ + by_cases hodd : n % 2 = 1 + · exact Or.inl hodd + · exact Or.inr (hlower (by omega)) + · refine .SN k n q (by omega) (by omega) ?_ + by_cases hodd : n % 2 = 1 + · exact Or.inl hodd + · right + refine ⟨hlower (by omega), ?_⟩ + have hp : 2 ^ (2 + k) ≤ 2 ^ (h - 1) := pow2_mono (by omega) + rw [← hl.level_size] at hp + have : 2 ^ (2 + k) = 2 ^ (1 + k) * 2 := by ring + omega + +theorem narrow_closed {h a b j : ℕ} {fs : List Sym} {k n : ℕ} {xs : List Sym} + {q : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hj : j ≤ a) (hk : 3 ≤ k) (hwidth : k + 2 ≤ h) (hn : 0 < n) + (hw : Word k n xs) (hr : Num q r) (hguard : Narrow a j k n) + (hcap : phi n + (2 ^ k - 1) * q ≤ (a * 2 + b + 1) * 4) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ c := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hinner : n % 2 = 1 ∨ 2 ^ (1 + k) ≤ n + j * 4 := by + rcases hguard with h | ⟨_, h⟩ + · exact Or.inl h + · exact Or.inr h + have htail : ∀ c, ∃ s, Num (q + c * 2) s ∧ G c r s := fun c => G_nums c hr + rcases k with _ | _ | _ | k + · omega + · omega + · omega + · by_cases hja : j = a + · subst hja + have hb_pow : 2 ^ (2 + k) ≤ b + j := by + have hp : 2 ^ (4 + k) ≤ 2 ^ (h - 1) := pow2_mono (by omega) + rw [← hl.level_size] at hp + have : 2 ^ (4 + k) = 2 ^ (2 + k) * 4 := by ring + omega + have hw' : Word ((2 + k) + 1) n xs := by + have : (2 + k) + 1 = k + 3 := by omega + rwa [this] + have hinner' : n % 2 = 1 ∨ 2 ^ (1 + ((2 + k) + 1)) ≤ n + j * 4 := by + have : 1 + ((2 + k) + 1) = 1 + (k + 3) := by omega + rwa [this] + have hcap' : phi n + (2 ^ ((2 + k) + 1) - 1) * q ≤ (j * 2 + b + 1) * 4 := by + have : (2 + k) + 1 = k + 3 := by omega + rwa [this] + obtain ⟨z, c, ys, s, hys, hodd, hs, hg, hvalue, hcalls, hstep⟩ := + narrow_boundary (fun c => Num (q + c * 2)) (k := 2 + k) + hl.level_frame hw' (by omega) hn htail hinner' hb_pow hcap' + refine ⟨_, ?_, hstep⟩ + have h_w0 : (fs ++ w ^ j ++ d) +> (ys +> s) = (fs ++ w ^ j ++ d) +> (w ^ 0 +> (ys +> s)) := + rfl + rw [h_w0] + exact small_single_root (Level_next hl) (by omega) (by omega) (by omega) (by omega) + hys hs (by omega) (by omega) (by omega) + · have hb_pow : 2 ^ (2 + k) ≤ b + j := by + have hp : 2 ^ (4 + k) ≤ 2 ^ (h - 1) := pow2_mono (by omega) + rw [← hl.level_size] at hp + have : 2 ^ (4 + k) = 2 ^ (2 + k) * 4 := by ring + omega + have hB' : 2 ^ (1 + (1 + k)) ≤ b + j := by + have : 1 + (1 + k) = 2 + k := by omega + rwa [this] + have hw' : Word ((1 + k) + 2) n xs := by + have : (1 + k) + 2 = k + 3 := by omega + rwa [this] + have hinner' : n % 2 = 1 ∨ 2 ^ (1 + ((1 + k) + 2)) ≤ n + j * 4 := by + have : 1 + ((1 + k) + 2) = 1 + (k + 3) := by omega + rwa [this] + have hcap' : phi n + (2 ^ ((1 + k) + 2) - 1) * q ≤ (a * 2 + b + 1) * 4 := by + have : (1 + k) + 2 = k + 3 := by omega + rwa [this] + obtain ⟨z, c, ys, s, hys, hz, hs, hg, hvalue, hlower, hsmall, hcalls, hstep⟩ := + narrow_inside (fun c => Num (q + c * 2)) (k := 1 + k) + hl.level_frame (by omega) hw' (by omega) hn htail hinner' hB' hcap' + refine ⟨_, ?_, hstep⟩ + exact small_single_root hl (by omega) (by omega) (by omega) hz hys hs + (by omega) (fun hev => by have := hlower hev; omega) (fun hk1 h2 => hsmall hk1 (by omega)) + +theorem end_single_root {h a b j : ℕ} {fs : List Sym} {n : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hj : j < a) (hr : Num n r) + (hbirth : n + 4 < (a * 2 + b + 1) * 4) + (hcap : n + (a - j) * 2 + 2 ≤ (a * 2 + b + 1) * 4) : + ∃ s, G (a - j) (d +> r) s ∧ SRoot (cfg (fs +> (w ^ j +> s))) := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + obtain ⟨k, q, z, c, xs, s, he, hc, hw, hs, hodd, hvalue, hg⟩ := + G_end_word (a - j) hr (by omega) + refine ⟨xs +> s, hg, ?_⟩ + have hwidth : k + 1 ≤ h + 1 := by + have hlt : 2 ^ k < 2 ^ (h + 1) := by + have : h + 1 = (h - 1) + 2 := by omega + rw [this] + have : 2 ^ ((h - 1) + 2) = 2 ^ (h - 1) * 4 := by ring + rw [← hl.level_size] at this + nlinarith + have := pow2_lt_iff.mp hlt + omega + rcases k with _ | k + · have ez : z = 3 := by + have hb : z < 4 := Word_bound hw + rcases h_aj : a - j - 1 with _ | i' + · rw [h_aj] at hc + cases hc + rfl + · rw [h_aj] at hc + have := GCounterRun_three hc (by omega) rfl + omega + subst ez + have e := GCounterRun_balance hc (by decide) (by decide) + have h_phi3 : phi 3 = 3 := rfl + have h_21 : (2 ^ 1 - 1) * 2 = 2 := rfl + rw [h_phi3, h_21] at e + have htail : q + c * 2 ≤ a * 8 := by + change n + 4 = (q * 2 + 1) * 1 at he + omega + rw [Word_max hw rfl] + change SRoot (cfg (fs +> (w ^ j +> (w +> s)))) + have en : w ^ j +> (w +> s) = w ^ (j + 1) +> s := by + rw [pow_add_list w j 1, pow_one_list, append_assoc] + rw [en] + exact .sroot h a b (j + 1) fs s hl (by omega) (.SNum _ s hs htail) + · refine .sroot h a b j fs (xs +> s) hl (by omega) + (.SWord (k + 2) z (q + c * 2) xs s (by omega) (by omega) hw hs ?_ (hvalue.trans hcap)) + refine single_odd_phase (by omega) hwidth hodd (fun hwide => ⟨?_, Or.inr hj⟩) + have hp : 2 ^ (h - 1) ≤ 2 ^ (k + 2) := pow2_mono (by omega) + rw [← hl.level_size] at hp + have h_lin_bound : 3 + (a - j - 1) * 2 < 2 ^ (1 + (k + 2)) := by + have : 2 ^ (1 + (k + 2)) = 2 ^ (k + 2) * 2 := by ring + omega + obtain ⟨ez, _⟩ := GCounterRun_linear hc h_lin_bound + omega + +theorem two_closed {h a b j : ℕ} {fs : List Sym} {n : ℕ} {xs : List Sym} + {q : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hj : j ≤ a) (hn : 0 < n) + (hw : Word 2 n xs) (hr : Num q r) (hphase : Two a j n) + (hcap : phi n + 3 * q ≤ (a * 2 + b + 1) * 4) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ c := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hnb : n < 8 := Word_bound hw + have hguard : n % 2 = 1 ∨ 8 ≤ n + j * 4 := by + rcases hphase with h | h <;> [exact Or.inl h; (right; omega)] + obtain ⟨u_val, c₀, hu, hub, h0⟩ := counter_inner_total 2 j n (by decide) hnb hguard + obtain ⟨z, c₁, h1, hzb⟩ := CounterRun_total (fun z' hz' => GCounter_total 1 z' (by decide) hz') + (b + j) u_val hub + have hrun : CounterRun (GCounter 1) (2 + (b + j - 2)) u_val z c₁ := by + have : 2 + (b + j - 2) = b + j := by omega + rwa [this] + obtain ⟨rfl, hc1lo, hc1hi⟩ := GCounterRun_one hrun hu hub + have e0 := GCounterRun_balance h0 (by decide) hn + rw [phi_odd] at e0 + have h_22 : (2 ^ 2 - 1) * 2 = 6 := rfl + rw [h_22] at e0 + have hc0 : c₀ * 6 ≤ phi n + j * 4 + 1 := by omega + by_cases hja : j = a + · subst hja + obtain ⟨s, hs, hg⟩ := G_nums (c₀ + c₁) hr + refine ⟨_, ?_, two_boundary hl.level_frame hw hguard h0 h1 hg⟩ + have h_w1 : (fs ++ w ^ j ++ d) +> (w +> s) = (fs ++ w ^ j ++ d) +> (w ^ 1 +> s) := rfl + rw [h_w1] + exact .sroot (1 + h) (j + b) (j * 2 + 1) 1 (fs ++ w ^ j ++ d) s + (Level_next hl) (by omega) (.SNum _ s hs (by omega)) + · obtain ⟨s, hs, hg⟩ := G_nums (c₀ + (c₁ + 2)) hr + by_cases hedge : j + 1 = a + · have hstep : (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ (cfg (fs +> (w ^ (j + + 1) +> (d +> s)))) := by + refine two_inside hl.level_frame (by omega) hw hguard h0 h1 hg ?_ + have : a - j - 1 = 0 := by omega + rw [this] + exact .G0 _ + refine ⟨_, ?_, hstep⟩ + have h_eq : cfg (fs +> (w ^ (j + 1) +> (d +> s))) = + cfg ((fs ++ w ^ a ++ d) +> (w ^ 0 +> s)) := by + rw [hedge] + simp only [Longitudinal.pow_zero_list, List.append_assoc, append_assoc, append_nil] + rw [h_eq] + exact .sroot (1 + h) (a + b) (a * 2 + 1) 0 (fs ++ w ^ a ++ d) s + (Level_next hl) (by omega) (.SNum _ s hs (by omega)) + · obtain ⟨out, hout, hroot⟩ := end_single_root (j := + j + 1) hl (by omega) hs (by omega) (by omega) + refine ⟨cfg (fs +> (w ^ (j + 1) +> out)), hroot, ?_⟩ + refine two_inside hl.level_frame (by omega) hw hguard h0 h1 hg ?_ + have : a - j - 1 = a - (j + 1) := by omega + rwa [this] + +theorem one_boundary_closed {h a b : ℕ} {fs : List Sym} {n : ℕ} {xs : List Sym} + {q : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hn : 0 < n) (hw : Word 1 n xs) (hr : Num q r) + (hcap : phi n + q ≤ (a * 2 + b + 1) * 4) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ a +> (xs +> r)))) [tm1]⊢⁺ c := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hnb : n < 4 := Word_bound hw + obtain ⟨z, c, hc, hzb⟩ := CounterRun_total (fun z' hz' => GCounter_total 1 z' (by decide) hz') + (a * 2 + 2) n hnb + have hrun : CounterRun (GCounter 1) (2 + a * 2) n z c := by + have : 2 + a * 2 = a * 2 + 2 := by omega + rwa [this] + obtain ⟨rfl, hclo, hchi⟩ := GCounterRun_one hrun hn hnb + obtain ⟨s, hs, hg⟩ := G_nums c hr + obtain ⟨out, hout, hroot⟩ := end_single_root (j := + 0) (Level_next hl) (by omega) hs (by omega) (by omega) + refine ⟨cfg ((fs ++ w ^ a ++ d) +> out), hroot, ?_⟩ + refine one_boundary hl.level_frame hw (Or.inr (by omega)) hc hg ?_ + have : b + a = a + b - 0 := by omega + rwa [this] + +theorem one_neighbor_split {a b j : ℕ} {fs xs : List Sym} {r s : ListBlank Sym} + {k n : ℕ} {ys : List Sym} {tail : ListBlank Sym} {m c : ℕ} {out : ListBlank Sym} + (hf : Frame a b fs) (hj : j + 1 = a) (hw : Word 1 1 xs) + (hg : G (j * 2 + 1) r s) (hmid : G (b + j) (d +> s) (ys +> tail)) + (hy : Word (k + 1) n ys) (hodd : n % 2 = 1) + (hc : CounterRun (GCounter (k + 1)) 2 n (m * 2 + 1) c) + (hout : G c tail out) : + ∃ zs, Word k m zs ∧ + (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ (cfg (fs +> (w ^ (j + 1) +> (zs +> out)))) := by + obtain ⟨vs, hv, hp⟩ := P_counter_run hy (by omega) hodd hc hout + obtain ⟨zs, hz, rfl⟩ := Word_odd_inv hv + have hfirst : CounterRun (GCounter 1) (j * 2 + 2) 1 3 (j * 2 + 1) := + counter_one_start (j * 2 + 1) + obtain ⟨ws, hws, hin⟩ := counter_inner hw (by decide) (Or.inl rfl) hfirst hg + rw [Word_max hws rfl] at hin + refine ⟨zs, hz, ?_⟩ + rw [pow_add_list w j 1, pow_one_list, append_assoc] + refine frame_step hf ?_ + have hin' : Inner j (xs +> r) (t +> (d +> s)) := by + simpa only [w, t, d, Longitudinal.pow_succ_list, Longitudinal.pow_zero_list, + List.append_assoc, append_assoc, append_cons, append_nil] using hin + have hgd : I (b + j) ([1] +> (t +> (d +> s))) (d +> (ys +> tail)) := by + simpa only [d, t, append_cons, append_nil] using G_d hmid + refine inner_column (by omega) hin' hgd ?_ + have : a - j = 1 := by omega + rw [this] + apply P_G + have hpd := P_d hp + simpa only [u, w, t, List.append_assoc, append_assoc, append_cons, append_nil] using hpd + +theorem neighbor_birth_root {h a b : ℕ} {fs : List Sym} {q k t_val m c : ℕ} + {xs : List Sym} {r : ListBlank Sym} + (hl : Level h a b fs) (hq : q + 1 ≤ (a * 2 + b + 1) * 2) + (he : q + a * 4 + 2 = (t_val * 2 + 1) * 2 ^ k) + (hc : CounterRun (GCounter (k + 1)) (a + b) 3 (m * 2 + 1) c) + (hm : 0 < m) (hw : Word k m xs) (hr : Num (t_val + c * 2) r) : + SRoot (cfg (fs +> (w ^ a +> (xs +> r)))) := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have e := GCounterRun_balance hc (by omega) (by decide) + rw [phi_odd] at e + have h_phi3 : phi 3 = 3 := rfl + rw [h_phi3] at e + have ebal : m + (2 ^ (k + 1) - 1) * c = a + b + 1 := by nlinarith + have hbirth : q + a * 4 + 2 < (a * 2 + b + 1) * 4 := by omega + by_cases hk0 : k = 0 + · subst hk0 + have hmb : m < 2 := Word_bound hw + have hm1 : m = 1 := by omega + subst hm1 + rw [Word_max hw rfl] + change SRoot (cfg (fs +> (w ^ a +> (d +> r)))) + have h_eq : cfg (fs +> (w ^ a +> (d +> r))) = cfg ((fs ++ w ^ a ++ d) +> (w ^ 0 +> r)) := by + simp only [Longitudinal.pow_zero_list, List.append_assoc, append_assoc, append_nil] + rw [h_eq] + refine .sroot (1 + h) (a + b) (a * 2 + 1) 0 (fs ++ w ^ a ++ d) r + (Level_next hl) (by omega) (.SNum _ r hr ?_) + have h_21 : 2 ^ 1 - 1 = 1 := rfl + rw [h_21] at ebal + change q + a * 4 + 2 = (t_val * 2 + 1) * 1 at he + omega + · have hwidth : k ≤ h := by + have hlt : 2 ^ k < 2 ^ (h + 1) := by + have : h + 1 = (h - 1) + 2 := by omega + rw [this] + have : 2 ^ ((h - 1) + 2) = 2 ^ (h - 1) * 4 := by ring + rw [← hl.level_size] at this + nlinarith + have := pow2_lt_iff.mp hlt + omega + have hvalue : phi m + (2 ^ k - 1) * (t_val + c * 2) ≤ (a * 2 + b + 1) * 4 := by + have hpm := phi_bounds hm + have hp1 : 2 ^ (k + 1) = 2 ^ k * 2 := by ring + have hp0 : 1 ≤ 2 ^ k := pow2_pos k + have hp01 : 1 ≤ 2 ^ k * 2 := by omega + rw [hp1] at ebal + zify [hp0, hp01] at hp0 hp01 ebal he hq hpm hab hba ⊢ + nlinarith + refine .sroot h a b a fs (xs +> r) hl (by omega) + (.SWord k m (t_val + c * 2) xs r (by omega) hm hw hr ?_ hvalue) + by_cases hwide : h ≤ k + 1 + · have hp : 2 ^ (h - 1) ≤ 2 ^ k := pow2_mono (by omega) + rw [← hl.level_size] at hp + have h_lin : 3 + (a + b) * 2 < 2 ^ (1 + (k + 1)) := by + have : 2 ^ (1 + (k + 1)) = 2 ^ k * 4 := by ring + omega + obtain ⟨em, ec⟩ := GCounterRun_linear hc h_lin + subst ec + have h_t : t_val + 0 * 2 = t_val := by omega + have h_m : m = a * 2 + b + 1 - a := by omega + rw [h_t, h_m] + refine .SX k t_val ?_ + by_cases heq : h = k + 1 + · left + refine ⟨heq, ?_⟩ + have hsize := hl.level_size + have hk_sub : h - 1 = k := by omega + rw [hk_sub] at hsize + nlinarith + · right; left + have ek : k = h := by omega + refine ⟨ek, ?_⟩ + have hp' : 2 ^ k = (a * 2 + b + 1) * 2 := by + rw [ek] + have : h = (h - 1) + 1 := by omega + conv_lhs => rw [this] + rw [pow2_succ_right, ← hl.level_size] + nlinarith + · by_cases hone : k = 1 + · subst hone + exact .S1 m (t_val + c * 2) (Or.inl rfl) + · by_cases htwo : k = 2 + · subst htwo + refine .S2 m (t_val + c * 2) ?_ + by_cases hodd : m % 2 = 1 <;> [exact Or.inl hodd; (right; omega)] + · refine .SN k m (t_val + c * 2) (by omega) (by omega) ?_ + by_cases hodd : m % 2 = 1 + · exact Or.inl hodd + · right + refine ⟨by omega, ?_⟩ + have hp : 2 ^ (1 + k) ≤ 2 ^ (h - 1) := pow2_mono (by omega) + rw [← hl.level_size] at hp + omega + +theorem one_neighbor_closed {h a b j : ℕ} {fs : List Sym} {xs : List Sym} + {q : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hj : j + 1 = a) (hw : Word 1 1 xs) (hr : Num q r) + (hq : q + 1 ≤ (a * 2 + b + 1) * 2) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ c := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + obtain ⟨s, hs, hg⟩ := G_nums (j * 2 + 1) hr + obtain ⟨k, t_val, n, c, ys, tail, he, hc, hy, htail, hodd, hvalue, hmid⟩ := + G_end_word (b + j) hs (by omega) + obtain ⟨m, c', hm, hmb, hlast⟩ := + counter_inner_total (k + 1) 0 n (by omega) (Word_bound hy) (Or.inl hodd) + obtain ⟨out, hout, hfinal⟩ := G_nums c' htail + obtain ⟨zs, hz, hstep⟩ := + one_neighbor_split hl.level_frame hj hw hg hmid hy hodd hlast hfinal + refine ⟨_, ?_, hstep⟩ + rw [hj] + have hrun := CounterRun_add hc hlast + have hrun' : CounterRun (GCounter (k + 1)) (a + b) 3 (m * 2 + 1) (c + c') := by + have : b + j - 1 + (0 * 2 + 2) = a + b := by omega + rwa [this] at hrun + have hout' : Num (t_val + (c + c') * 2) out := by + have : t_val + (c + c') * 2 = t_val + c * 2 + c' * 2 := by omega + rwa [this] + exact neighbor_birth_root hl hq (by omega) hrun' hm hz hout' + +inductive Atom : ℕ → ℕ → ℕ → ListBlank Sym → Prop where + | AtomWord (k tau n q : ℕ) (xs : List Sym) (r : ListBlank Sym) : + 0 < k → 0 < n → Word k n xs → Num q r → + tau ≤ 2 ^ k → (n % 2 = 1 ∨ 2 ^ (1 + k) ≤ n + tau * 2) → + Atom k tau (phi n + (2 ^ k - 1) * q) (xs +> r) + | AtomEnd (q : ℕ) (r : ListBlank Sym) : + Num q r → q ≤ 1 → Atom 1 1 (q * 2 + 1) (d +> r) + +inductive Sat (L : ℕ) : ℕ → ListBlank Sym → Prop where + | SatWord (k n q : ℕ) (xs : List Sym) (r : ListBlank Sym) : + 0 < k → k ≤ L → Word k n xs → Num q r → + n % 2 = 1 → (k = 1 → n = 3) → + Sat L (phi n + (2 ^ k - 1) * q) (xs +> r) + +theorem Atom_value {k tau x : ℕ} {r : ListBlank Sym} (h : Atom k tau x r) : Value x r := by + cases h with + | AtomWord k tau n q xs r hk hn hw hr _ _ => + exact .ValueWord hk hn hw (.ValueNum hr) + | AtomEnd q r hr hq => + exact .ValueEnd hr hq + +theorem Atom_bound {k tau x : ℕ} {r : ListBlank Sym} (h : Atom k tau x r) : + 0 < k ∧ tau ≤ 2 ^ k := by + cases h with + | AtomWord _ _ _ _ _ _ hk _ _ _ htau _ => exact ⟨hk, htau⟩ + | AtomEnd _ _ _ _ => decide + +theorem Sat_value {L x : ℕ} {r : ListBlank Sym} (h : Sat L x r) : Value x r := by + cases h with + | SatWord k n q xs r hk _ hw hr hodd _ => + exact .ValueWord hk (by omega) hw (.ValueNum hr) + +theorem Sat_mono {L M x : ℕ} {r : ListBlank Sym} (h : Sat L x r) (hle : L ≤ M) : + Sat M x r := by + cases h with + | SatWord k n q xs r hk hL hw hr hodd h1 => + exact .SatWord k n q xs r hk (by omega) hw hr hodd h1 + +theorem G_word_data {k n : ℕ} {xs : List Sym} {q : ℕ} {r : ListBlank Sym} (i : ℕ) + (hk : 0 < k) (hw : Word k n xs) (hr : Num q r) : + ∃ m c ys s, CounterRun (GCounter k) i n m c ∧ + Word k m ys ∧ Num (q + c * 2) s ∧ G i (xs +> r) (ys +> s) := by + obtain ⟨m, c, hc, _⟩ := + CounterRun_total (fun n' hn' => GCounter_total k n' hk hn') i n (Word_bound hw) + obtain ⟨s, hs, hg⟩ := G_nums c hr + obtain ⟨ys, hy, hrun⟩ := G_counter_run hw hk hc hg + exact ⟨m, c, ys, s, hc, hy, hs, hrun⟩ + +theorem GCounterRun_one_three {i n m c : ℕ} (h : CounterRun (GCounter 1) i n m c) (hn : n = 3) : + m = 3 := by + induction h with + | Counter0 _ => exact hn + | CounterS hs _ ih => + apply ih + cases hs with + | GCinc hlt => + have : 2 ^ (1 + 1) = 4 := rfl + omega + | GCev heq => + have : 2 ^ (1 + 1) = 4 := rfl + omega + | GCod _ => rfl + +theorem G_sat {L x : ℕ} {r : ListBlank Sym} (i : ℕ) (hsat : Sat L x r) : + ∃ s, Sat L (x + i * 2) s ∧ G i r s := by + rcases hsat with ⟨k, n, q, xs, r, hk, hL, hw, hr, hodd, hsmall⟩ + obtain ⟨m, c, ys, s, hc, hy, hs, hg⟩ := G_word_data i hk hw hr + refine ⟨ys +> s, ?_, hg⟩ + have e := GCounterRun_balance hc hk (by omega) + have h_eq : phi n + (2 ^ k - 1) * q + i * 2 = phi m + (2 ^ k - 1) * (q + c * 2) := by + nlinarith + rw [h_eq] + exact .SatWord k m (q + c * 2) ys s hk hL hy hs (GCounterRun_odd hc hodd) + (fun ek => by subst ek; exact GCounterRun_one_three hc (hsmall rfl)) + +theorem G_atom_sat {k tau x : ℕ} {r : ListBlank Sym} (i : ℕ) + (h : Atom k tau x r) (hi : 2 ≤ i) (htau : tau ≤ i) : + ∃ s, Sat (Nat.max k 3) (x + i * 2) s ∧ G i r s := by + cases h with + | AtomWord k tau n q xs r hk hn hw hr htb hguard => + obtain ⟨m, c, ys, s, hc, hy, hs, hg⟩ := G_word_data i hk hw hr + refine ⟨ys +> s, ?_, hg⟩ + have e := GCounterRun_balance hc hk hn + have h_eq : phi n + (2 ^ k - 1) * q + i * 2 = phi m + (2 ^ k - 1) * (q + c * 2) := by + nlinarith + rw [h_eq] + refine .SatWord k m (q + c * 2) ys s hk (Nat.le_max_left k 3) hy hs ?_ ?_ + · rcases hguard with hodd | hsat + · exact GCounterRun_odd hc hodd + · exact GCounterRun_saturated hc hk (Word_bound hw) (by omega) + · intro ek + subst ek + have hc' : CounterRun (GCounter 1) (2 + (i - 2)) n m c := by + have : 2 + (i - 2) = i := by omega + rwa [this] + exact (GCounterRun_one hc' hn (Word_bound hw)).1 + | AtomEnd q r hr hq => + have hfirst : ∃ s, Sat 3 (q * 2 + 3) s ∧ G1 (d +> r) s := by + by_cases hq0 : q = 0 + · rw [Num_zero hr hq0] + subst hq0 + refine ⟨(t ++ one 2) +> default, ?_, G_zero0⟩ + exact Sat.SatWord (L := 3) 3 3 0 (t ++ one 2) default + (by decide) (by decide) (.Word10 2 1 (Word_one 2)) .Num0 rfl (by decide) + · have hq1 : q = 1 := by omega + rw [Num_one hr hq1] + subst hq1 + refine ⟨w +> ([0, 0, 1, 0] +> default), ?_, G_zero1⟩ + exact Sat.SatWord (L := 3) 1 3 2 w ([0, 0, 1, 0] +> default) + (by decide) + (by decide) (.Word10 0 1 .Word1) (.Num00 1 (.Num10 0 .Num0)) rfl (fun _ => rfl) + obtain ⟨s₀, h0, g0⟩ := hfirst + obtain ⟨s, hs, hg⟩ := G_sat (i - 1) h0 + refine ⟨s, ?_, ?_⟩ + · have : q * 2 + 1 + i * 2 = q * 2 + 3 + (i - 1) * 2 := by omega + rwa [this] + · have : i = (i - 1) + 1 := by omega + rw [this] + exact .GS g0 hg + +theorem sat_single_root {h a b j : ℕ} {fs : List Sym} {x : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hj : j ≤ a) (hsat : Sat (h - 2) x r) + (hcap : x ≤ (a * 2 + b + 1) * 2) : + SRoot (cfg (fs +> (w ^ j +> r))) := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + rcases hsat with ⟨k, n, q, xs, r, hk, hL, hw, hr, hodd, hsmall⟩ + by_cases hk1 : k = 1 + · subst hk1 + have hn3 : n = 3 := hsmall rfl + subst hn3 + by_cases hedge : j = a + · exact .sroot h a b j fs (xs +> r) hl hj + (.SWord 1 3 q xs r (by decide) (by decide) hw hr (.S1 3 q (Or.inl hedge)) (by omega)) + · rw [Word_max hw rfl] + change SRoot (cfg (fs +> (w ^ j +> (w +> r)))) + have en : w ^ j +> (w +> r) = w ^ (j + 1) +> r := by + rw [pow_add_list w j 1, pow_one_list, append_assoc] + rw [en] + refine .sroot h a b (j + 1) fs r hl (by omega) (.SNum q r hr ?_) + have h_phi3 : phi 3 = 3 := rfl + have h_21 : 2 ^ 1 - 1 = 1 := rfl + rw [h_phi3, h_21] at hcap + omega + · refine .sroot h a b j fs (xs +> r) hl hj + (.SWord k n q xs r hk (by omega) hw hr ?_ (by omega)) + by_cases hk2 : k = 2 + · subst hk2 + exact .S2 n q (Or.inl hodd) + · exact .SN k n q (by omega) (by omega) (Or.inl hodd) + +theorem d_sat_finish {h a b j : ℕ} {fs : List Sym} {x : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hj : j ≤ a) (hsat : Sat (h - 2) x r) + (hbirth : x + 5 < (a * 2 + b + 1) * 4) + (hcap : x + (a - j) * 4 + 3 ≤ (a * 2 + b + 1) * 4) : + ∃ child s, P 1 (d +> r) (w +> child) ∧ G (a - j) child s ∧ + SRoot (cfg (fs +> (w ^ j +> s))) := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + rcases hsat with ⟨k, n, q, xs, r, hk, hL, hw, hr, hodd, hsmall⟩ + rcases k with _ | _ | k + · omega + · have hn3 : n = 3 := hsmall rfl + subst hn3 + rw [Word_max hw rfl] + change ∃ child s, P 1 (d +> (w +> r)) (w +> child) ∧ G (a - j) child s ∧ + SRoot (cfg (fs +> (w ^ j +> s))) + obtain ⟨r₀, h0, g0⟩ := G_nums 2 hr + have h_phi3 : phi 3 = 3 := rfl + have h_21 : 2 ^ 1 - 1 = 1 := rfl + rw [h_phi3, h_21, Nat.one_mul] at hbirth hcap + have hfirst : P 1 (d +> (w +> r)) (w +> (d +> r₀)) := by + have hp := P_d (G_w g0) + simpa only [u, w, d, append_assoc, append_cons, append_nil] using hp + by_cases hja : j = a + · subst hja + refine ⟨d +> r₀, d +> r₀, hfirst, ?_, ?_⟩ + · have : j - j = 0 := by omega + rw [this] + exact .G0 _ + · have h_eq : cfg (fs +> (w ^ j +> (d +> r₀))) = cfg ((fs ++ w ^ j ++ d) +> (w ^ 0 +> r₀)) := + by + simp only [Longitudinal.pow_zero_list, List.append_assoc, append_assoc, append_nil] + rw [h_eq] + exact .sroot (1 + h) (j + b) (j * 2 + 1) 0 (fs ++ w ^ j ++ d) r₀ + (Level_next hl) (by omega) (.SNum _ r₀ h0 (by omega)) + · obtain ⟨s, hs, hroot⟩ := end_single_root (j := j) hl (by omega) h0 (by omega) (by omega) + exact ⟨d +> r₀, s, hfirst, hs, hroot⟩ + · have hw' : Word ((k + 1) + 1) n xs := hw + obtain ⟨z, c, ys, s, hy, hz, hs, hvalue, hlower, hsmall', hp, child, hfirst, hrest⟩ := + odd_d_value Num (k := k + 1) (a - j) hw' (by omega) hodd (fun c => G_nums c hr) + refine ⟨child, ys +> s, hfirst, hrest, ?_⟩ + exact small_single_root hl hj (by omega) (by omega) hz hy hs + (by omega) (fun hev => by have := hlower hev; omega) (fun hk1 h2 => hsmall' hk1 (by omega)) + +theorem d_sat_root {h a b j : ℕ} {fs : List Sym} {x : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hj : j < a) (hsat : Sat (h - 2) x r) + (hbirth : x + 5 < (a * 2 + b + 1) * 4) + (hcap : x + (a - j) * 4 ≤ (a * 2 + b + 1) * 4) : + ∃ s, P (a - j) (d +> r) s ∧ SRoot (cfg (fs +> (w ^ j +> s))) := by + obtain ⟨child, s, hfirst, hrest, hroot⟩ := + d_sat_finish (j := j + 1) hl (by omega) hsat hbirth (by omega) + refine ⟨w +> s, ?_, ?_⟩ + · have : a - j = 1 + (a - (j + 1)) := by omega + rw [this] + exact P_add hfirst (G_w hrest) + · rw [pow_add_list w j 1, pow_one_list, append_assoc] at hroot + exact hroot + +theorem atom_level_budget {h a b : ℕ} {fs : List Sym} {l tau x : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hwidth : l + 2 ≤ h) (hr : Atom l tau x r) : + tau ≤ a * 2 - 1 := by + have hb := Level_bounds hl + have hab := Atom_bound hr + have hp : 2 ^ (1 + l) ≤ 2 ^ (h - 1) := pow2_mono (by omega) + rw [← hl.level_size] at hp + have : 2 ^ (1 + l) = 2 ^ l * 2 := by ring + omega + +theorem atom_sat_level {h a b : ℕ} {fs : List Sym} {l tau x : ℕ} {r : ListBlank Sym} (i : ℕ) + (hl : Level h a b fs) (hwidth : l + 2 ≤ h) (hr : Atom l tau x r) + (hi : 2 ≤ i) (htau : tau ≤ i) : + ∃ s, Sat (h - 2) (x + i * 2) s ∧ G i r s := by + have hh := hl.level_height + obtain ⟨s, hs, hg⟩ := G_atom_sat i hr hi htau + exact ⟨s, Sat_mono hs (Nat.max_le.mpr ⟨by omega, by omega⟩), hg⟩ + +theorem two_count_bounds {b j n u_val c₀ c₁ : ℕ} + (hn : 0 < n) (hnb : n < 8) (hguard : n % 2 = 1 ∨ 8 ≤ n + j * 4) + (h0 : CounterRun (GCounter 2) (j * 2 + 2) n (u_val * 2 + 1) c₀) + (h1 : CounterRun (GCounter 1) (b + j) u_val 3 c₁) : + c₀ * 6 ≤ phi n + j * 4 + 1 ∧ b + j - 1 ≤ c₁ ∧ c₁ ≤ b + j := by + have hphase := counter_inner_phase (by decide) hnb hguard h0 + have hub : u_val * 2 + 1 < 8 := GCounterRun_bound h0 (by decide) hnb + have hu : 0 < u_val := by omega + have hpu := phi_bounds hu + have e0 := GCounterRun_balance h0 (by decide) hn + have e1 := GCounterRun_balance h1 (by decide) hu + rw [phi_odd] at e0 + have h_22 : (2 ^ 2 - 1) * 2 = 6 := rfl + have h_21 : (2 ^ 1 - 1) * 2 = 2 := rfl + have h_phi3 : phi 3 = 3 := rfl + rw [h_22] at e0 + rw [h_21, h_phi3] at e1 + exact ⟨by omega, by omega, by omega⟩ + +theorem double_two_closed {h a b j : ℕ} {fs : List Sym} {n : ℕ} {xs : List Sym} + {l tau x : ℕ} {r : ListBlank Sym} {u_val c₀ c₁ : ℕ} + (hl : Level h a b fs) (hj : j ≤ a) (hn : 0 < n) (hw : Word 2 n xs) (hphase : Two a j n) + (hr : Atom l tau x r) (hwidth : l + 2 ≤ h) + (h0 : CounterRun (GCounter 2) (j * 2 + 2) n (u_val * 2 + 1) c₀) + (h1 : CounterRun (GCounter 1) (b + j) u_val 3 c₁) + (hbudget : j = a ∨ tau ≤ c₀ + c₁ + 2) + (hcap : phi n + 3 * x ≤ (a * 2 + b + 1) * 4) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ c := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hnb : n < 8 := Word_bound hw + have hguard : n % 2 = 1 ∨ 8 ≤ n + j * 4 := by + rcases hphase with h | h <;> [exact Or.inl h; (right; omega)] + obtain ⟨hc0, hc1lo, hc1hi⟩ := two_count_bounds hn hnb hguard h0 h1 + by_cases hja : j = a + · subst hja + have htau := atom_level_budget hl hwidth hr + obtain ⟨s, hs, hg⟩ := atom_sat_level (c₀ + c₁) hl hwidth hr (by omega) (by omega) + refine ⟨_, ?_, two_boundary hl.level_frame hw hguard h0 h1 hg⟩ + have h_w1 : (fs ++ w ^ j ++ d) +> (w +> s) = (fs ++ w ^ j ++ d) +> (w ^ 1 +> s) := rfl + rw [h_w1] + exact sat_single_root (Level_next hl) (by omega) (Sat_mono hs (by omega)) (by omega) + · obtain ⟨s, hs, hg⟩ := atom_sat_level (c₀ + (c₁ + 2)) hl hwidth hr (by omega) (by omega) + by_cases hedge : j + 1 = a + · have hstep : (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ (cfg (fs +> (w ^ (j + + 1) +> (d +> s)))) := by + refine two_inside hl.level_frame (by omega) hw hguard h0 h1 hg ?_ + have : a - j - 1 = 0 := by omega + rw [this] + exact .G0 _ + refine ⟨_, ?_, hstep⟩ + have h_eq : cfg (fs +> (w ^ (j + 1) +> (d +> s))) = + cfg ((fs ++ w ^ a ++ d) +> (w ^ 0 +> s)) := by + rw [hedge] + simp only [Longitudinal.pow_zero_list, List.append_assoc, append_assoc, append_nil] + rw [h_eq] + exact sat_single_root (Level_next hl) (by omega) (Sat_mono hs (by omega)) (by omega) + · obtain ⟨out, hout, hroot⟩ := d_sat_root (j := j + 1) hl (by omega) hs (by omega) (by omega) + refine ⟨cfg (fs +> (w ^ (j + 1) +> out)), hroot, ?_⟩ + refine two_inside hl.level_frame (by omega) hw hguard h0 h1 hg ?_ + have : a - j - 1 = a - (j + 1) := by omega + rw [this] + exact P_G hout + +theorem double_one_boundary_closed {h a b : ℕ} {fs : List Sym} {n : ℕ} {xs : List Sym} + {l tau x : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hn : 0 < n) (hw : Word 1 n xs) + (hr : Atom l tau x r) (hwidth : l + 2 ≤ h) + (hcap : phi n + x ≤ (a * 2 + b + 1) * 4) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ a +> (xs +> r)))) [tm1]⊢⁺ c := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hnb : n < 4 := Word_bound hw + obtain ⟨z, c, hc, hzb⟩ := CounterRun_total (fun z' hz' => GCounter_total 1 z' (by decide) hz') + (a * 2 + 2) n hnb + have hrun : CounterRun (GCounter 1) (2 + a * 2) n z c := by + have : 2 + a * 2 = a * 2 + 2 := by omega + rwa [this] + obtain ⟨rfl, hclo, hchi⟩ := GCounterRun_one hrun hn hnb + have htau := atom_level_budget hl hwidth hr + obtain ⟨s, hs, hg⟩ := atom_sat_level c hl hwidth hr (by omega) (by omega) + have hs' : Sat ((1 + h) - 2) (x + c * 2) s := Sat_mono hs (by omega) + obtain ⟨out, hout, hroot⟩ := d_sat_root (j := + 0) (Level_next hl) (by omega) hs' (by omega) (by omega) + refine ⟨cfg ((fs ++ w ^ a ++ d) +> out), hroot, ?_⟩ + refine one_boundary hl.level_frame hw (Or.inr (by omega)) hc hg ?_ + have : b + a = a + b - 0 := by omega + rw [this] + exact P_G hout + +theorem double_one_neighbor_closed {h a b j : ℕ} {fs : List Sym} {xs : List Sym} + {l tau x : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hj : j + 1 = a) (hw : Word 1 1 xs) + (hr : Atom l tau x r) (hwidth : l + 2 ≤ h) + (hcap : 1 + x ≤ (a * 2 + b + 1) * 4) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ c := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have htau := atom_level_budget hl hwidth hr + obtain ⟨s, hs, hg⟩ := atom_sat_level (j * 2 + 1) hl hwidth hr (by omega) (by omega) + have hs' : Sat ((1 + h) - 2) (x + (j * 2 + 1) * 2) s := Sat_mono hs (by omega) + obtain ⟨child, out, hfirst, hrest, hroot⟩ := + d_sat_finish (j := 0) (Level_next hl) (by omega) hs' (by omega) (by omega) + have hsplit : G ((b + j - 1) + 2) child out := by + have : (b + j - 1) + 2 = a + b - 0 := by omega + rwa [this] + obtain ⟨mid, hbefore, hafter⟩ := G_split (b + j - 1) 2 hsplit + have hmid : G (b + j) (d +> s) (w +> mid) := by + apply P_G + have : b + j = 1 + (b + j - 1) := by omega + rw [this] + exact P_add hfirst (G_w hbefore) + refine ⟨cfg ((fs ++ w ^ a ++ d) +> out), hroot, ?_⟩ + have ha_eq : a = 1 + j := by omega + have hf' : Frame (1 + j) b fs := by + rw [← ha_eq] + exact hl.level_frame + have hstep := one_neighbor hf' hw hg hmid hafter + rwa [← ha_eq] at hstep + +inductive DoublePhase (h a b j : ℕ) : ℕ → ℕ → ℕ → ℕ → Prop where + | DN (k n l tau : ℕ) : + 3 ≤ k → k + 2 ≤ h → Narrow a j k n → k + l ≤ h → + DoublePhase h a b j k n l tau + | DY (l tau : ℕ) : + l ≤ 1 → DoublePhase h a b j (h - 1) ((a - j) * 2 + 1) l tau + | D2 (n l tau : ℕ) : + Two a j n → l + 2 ≤ h → (j = a ∨ tau ≤ b + j + 1) → + DoublePhase h a b j 2 n l tau + | D1 (n l tau : ℕ) : + l + 2 ≤ h → (j = a ∨ (j + 1 = a ∧ n = 1)) → + DoublePhase h a b j 1 n l tau + +inductive Double (h a b j : ℕ) : ListBlank Sym → Prop where + | DWord (k n : ℕ) (xs : List Sym) (l tau x : ℕ) (r : ListBlank Sym) : + 0 < k → 0 < n → Word k n xs → Atom l tau x r → + DoublePhase h a b j k n l tau → phi n + (2 ^ k - 1) * x ≤ (a * 2 + b + 1) * 4 → + Double h a b j (xs +> r) + +inductive DRoot : Cfg Sym Q → Prop where + | droot (h a b j : ℕ) (fs : List Sym) (r : ListBlank Sym) : + Level h a b fs → j ≤ a → Double h a b j r → DRoot (cfg (fs +> (w ^ j +> r))) + +def Normal (c : Cfg Sym Q) : Prop := SRoot c ∨ DRoot c + +theorem sat_double_root {h a b j : ℕ} {fs : List Sym} {k n : ℕ} {xs : List Sym} + {L x : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hj : j ≤ a) (hk : 0 < k) (hwidth : k + 3 ≤ h) (hn : 0 < n) + (hw : Word k n xs) (hr : Sat L x r) + (hrank : k + L ≤ h) (hL : L + 2 ≤ h) + (hcap : phi n + (2 ^ k - 1) * x ≤ (a * 2 + b + 1) * 2) + (hlower : n % 2 = 0 → (a - j) * 2 + 2 ≤ n) + (hsmall : k = 1 → j + 2 ≤ a → n = 3) : + Normal (cfg (fs +> (w ^ j +> (xs +> r)))) := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + rcases hr with ⟨l, z, q, ys, s, hlpos, hlL, hy, hs, hodd, hthree⟩ + have hsat_r : Sat L (phi z + (2 ^ l - 1) * q) (ys +> s) := + .SatWord l z q ys s hlpos hlL hy hs hodd hthree + have hat : Atom l 0 (phi z + (2 ^ l - 1) * q) (ys +> s) := + .AtomWord l 0 z q ys s hlpos (by omega) hy hs (Nat.zero_le _) (Or.inl hodd) + by_cases hk1 : k = 1 + · subst hk1 + have hnb : n < 4 := Word_bound hw + by_cases hedge : j = a + · right + exact .droot h a b j fs (xs +> (ys +> s)) hl hj + (.DWord 1 n xs l 0 _ (ys +> s) (by decide) hn hw hat + (.D1 n l 0 (by omega) (Or.inl hedge)) (by omega)) + · by_cases hn3 : n = 3 + · subst hn3 + left + rw [Word_max hw rfl] + change SRoot (cfg (fs +> (w ^ j +> (w +> (ys +> s))))) + have en : w ^ j +> (w +> (ys +> s)) = w ^ (j + 1) +> (ys +> s) := by + rw [pow_add_list w j 1, pow_one_list, append_assoc] + rw [en] + refine sat_single_root hl (by omega) (Sat_mono hsat_r (by omega)) ?_ + have h_phi3 : phi 3 = 3 := rfl + have h_21 : 2 ^ 1 - 1 = 1 := rfl + rw [h_phi3, h_21] at hcap + omega + · have hnear : j + 1 = a := by + have := hsmall rfl + omega + have en : n = 1 := by + by_cases hev : n % 2 = 0 + · have := hlower hev + omega + · omega + subst en + right + exact .droot h a b j fs (xs +> (ys +> s)) hl hj + (.DWord 1 1 xs l 0 _ (ys +> s) (by decide) (by decide) hw hat + (.D1 1 l 0 (by omega) (Or.inr ⟨hnear, rfl⟩)) (by omega)) + · right + refine .droot h a b j fs (xs +> (ys +> s)) hl hj + (.DWord k n xs l 0 _ (ys +> s) hk hn hw hat ?_ (by omega)) + by_cases hk2 : k = 2 + · subst hk2 + refine .D2 n l 0 ?_ (by omega) (Or.inr (by omega)) + by_cases hodd' : n % 2 = 1 + · exact Or.inl hodd' + · exact Or.inr (hlower (by omega)) + · refine .DN k n l 0 (by omega) (by omega) ?_ (by omega) + by_cases hodd' : n % 2 = 1 + · exact Or.inl hodd' + · right + refine ⟨hlower (by omega), ?_⟩ + have hp : 2 ^ (2 + k) ≤ 2 ^ (h - 1) := pow2_mono (by omega) + rw [← hl.level_size] at hp + have : 2 ^ (2 + k) = 2 ^ (1 + k) * 2 := by ring + omega + +theorem G_atom_ready {k tau x : ℕ} {r : ListBlank Sym} (hr : Atom k tau x r) (i : ℕ) : + ∃ s, (tau ≤ i → 2 ≤ i → Sat (Nat.max k 3) (x + i * 2) s) ∧ G i r s := by + by_cases htau : tau ≤ i + · by_cases hi : 2 ≤ i + · obtain ⟨s, hs, hg⟩ := G_atom_sat i hr hi htau + exact ⟨s, fun _ _ => hs, hg⟩ + · obtain ⟨s, _, hg⟩ := G_value (Atom_value hr) i + exact ⟨s, fun _ h2 => by omega, hg⟩ + · obtain ⟨s, _, hg⟩ := G_value (Atom_value hr) i + exact ⟨s, fun ht _ => by omega, hg⟩ + +theorem level_call_scale {h a b : ℕ} {fs : List Sym} (k : ℕ) + (hl : Level h a b fs) (hk : k ≤ h) : + (a * 2 + b + 1) * 4 = 2 ^ (1 + k) * 2 ^ (h - k) := by + have hh := hl.level_height + rw [← Nat.pow_add] + have h_exp : 1 + k + (h - k) = (h - 1) + 2 := by omega + rw [h_exp] + have : 2 ^ ((h - 1) + 2) = 2 ^ (h - 1) * 4 := by ring + rw [this, ← hl.level_size] + +theorem narrow_calls_saturate {h a b : ℕ} {fs : List Sym} {k l tau x : ℕ} {r : ListBlank Sym} {c : + ℕ} + (hl : Level h a b fs) (hwidth : k + 2 ≤ h) (hrank : k + l ≤ h) + (hr : Atom l tau x r) + (hcalls : ∀ L, 4 ≤ L → (a * 2 + b + 1) * 4 = 2 ^ (1 + k) * L → L ≤ c) : + tau ≤ c ∧ 2 ≤ c := by + have hab := Atom_bound hr + have hL : 4 ≤ 2 ^ (h - k) := by + have : (4 : ℕ) = 2 ^ 2 := rfl + rw [this] + exact pow2_mono (by omega) + have hc := hcalls (2 ^ (h - k)) hL (level_call_scale k hl (by omega)) + have hp : 2 ^ l ≤ 2 ^ (h - k) := pow2_mono (by omega) + omega + +theorem double_narrow_closed {h a b j : ℕ} {fs : List Sym} {k n : ℕ} {xs : List Sym} + {l tau x : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hj : j ≤ a) (hk : 3 ≤ k) (hwidth : k + 2 ≤ h) (hn : 0 < n) + (hw : Word k n xs) (hr : Atom l tau x r) (hrank : k + l ≤ h) + (hguard : Narrow a j k n) + (hcap : phi n + (2 ^ k - 1) * x ≤ (a * 2 + b + 1) * 4) : + ∃ c, Normal c ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ c := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hinner : n % 2 = 1 ∨ 2 ^ (1 + k) ≤ n + j * 4 := by + rcases hguard with h | ⟨_, h⟩ + · exact Or.inl h + · exact Or.inr h + have htail := G_atom_ready hr + rcases k with _ | _ | _ | k + · omega + · omega + · omega + · by_cases hja : j = a + · subst hja + have hb_pow : 2 ^ (2 + k) ≤ b + j := by + have hp : 2 ^ (4 + k) ≤ 2 ^ (h - 1) := pow2_mono (by omega) + rw [← hl.level_size] at hp + have : 2 ^ (4 + k) = 2 ^ (2 + k) * 4 := by ring + omega + have hw' : Word ((2 + k) + 1) n xs := by + have : (2 + k) + 1 = k + 3 := by omega + rwa [this] + have hinner' : n % 2 = 1 ∨ 2 ^ (1 + ((2 + k) + 1)) ≤ n + j * 4 := by + have : 1 + ((2 + k) + 1) = 1 + (k + 3) := by omega + rwa [this] + have hcap' : phi n + (2 ^ ((2 + k) + 1) - 1) * x ≤ (j * 2 + b + 1) * 4 := by + have : (2 + k) + 1 = k + 3 := by omega + rwa [this] + obtain ⟨z, c, ys, s, hys, hodd, hs, hg, hvalue, hcalls, hstep⟩ := + narrow_boundary (fun c s => tau ≤ c → 2 ≤ c → Sat (Nat.max l 3) (x + c * 2) s) + (k := 2 + k) hl.level_frame hw' (by omega) hn htail hinner' hb_pow hcap' + obtain ⟨htau, htwo⟩ := narrow_calls_saturate (k := 3 + k) hl + (by omega) (by omega) hr (fun L hL hsize => hcalls L (by omega) + (by simpa only [Nat.add_assoc, Nat.add_comm, Nat.add_left_comm] using hsize)) + have hs' := hs htau htwo + have hmax1 : (2 + k) + Nat.max l 3 ≤ 1 + h := by + have : Nat.max l 3 ≤ h - (1 + k) := Nat.max_le.mpr ⟨by omega, by omega⟩ + omega + have hmax2 : Nat.max l 3 + 2 ≤ 1 + h := by + have : Nat.max l 3 ≤ h - 1 := Nat.max_le.mpr ⟨by omega, by omega⟩ + omega + refine ⟨_, ?_, hstep⟩ + have h_w0 : (fs ++ w ^ j ++ d) +> (ys +> s) = (fs ++ w ^ j ++ d) +> (w ^ 0 +> (ys +> s)) := + rfl + rw [h_w0] + exact sat_double_root (j := 0) (Level_next hl) (by omega) (by omega) (by omega) (by omega) + hys hs' hmax1 hmax2 (by omega) (by omega) (by omega) + · have hb_pow : 2 ^ (2 + k) ≤ b + j := by + have hp : 2 ^ (4 + k) ≤ 2 ^ (h - 1) := pow2_mono (by omega) + rw [← hl.level_size] at hp + have : 2 ^ (4 + k) = 2 ^ (2 + k) * 4 := by ring + omega + have hB' : 2 ^ (1 + (1 + k)) ≤ b + j := by + have : 1 + (1 + k) = 2 + k := by omega + rwa [this] + have hw' : Word ((1 + k) + 2) n xs := by + have : (1 + k) + 2 = k + 3 := by omega + rwa [this] + have hinner' : n % 2 = 1 ∨ 2 ^ (1 + ((1 + k) + 2)) ≤ n + j * 4 := by + have : 1 + ((1 + k) + 2) = 1 + (k + 3) := by omega + rwa [this] + have hcap' : phi n + (2 ^ ((1 + k) + 2) - 1) * x ≤ (a * 2 + b + 1) * 4 := by + have : (1 + k) + 2 = k + 3 := by omega + rwa [this] + obtain ⟨z, c, ys, s, hys, hz, hs, hg, hvalue, hlower, hsmall, hcalls, hstep⟩ := + narrow_inside (fun c s => tau ≤ c → 2 ≤ c → Sat (Nat.max l 3) (x + c * 2) s) + (k := 1 + k) hl.level_frame (by omega) hw' (by omega) hn htail hinner' hB' hcap' + obtain ⟨htau, htwo⟩ := narrow_calls_saturate (k := 3 + k) hl + (by omega) (by omega) hr (fun L hL hsize => hcalls L hL + (by simpa only [Nat.add_assoc, Nat.add_comm, Nat.add_left_comm] using hsize)) + have hs' := hs htau htwo + have hmax1 : (1 + k) + Nat.max l 3 ≤ h := by + have : Nat.max l 3 ≤ h - (1 + k) := Nat.max_le.mpr ⟨by omega, by omega⟩ + omega + have hmax2 : Nat.max l 3 + 2 ≤ h := by + have : Nat.max l 3 ≤ h - 2 := Nat.max_le.mpr ⟨by omega, by omega⟩ + omega + refine ⟨_, ?_, hstep⟩ + exact sat_double_root (j := j + 1) hl (by omega) (by omega) (by omega) hz hys hs' + hmax1 hmax2 (by omega) + (fun hev => by have := hlower hev; omega) (fun hk1 h2 => hsmall hk1 (by omega)) + +theorem descent_y_inside_calls (a b j k u_val v y z c₁ c₂ c₃ : ℕ) + (hj : j < a) (hk : 0 < k) (hsize : a * 2 + b + 1 = 2 ^ (2 + k)) + (hu : 0 < u_val) (hy : 0 < y) (hz : 0 < z) (hzb : z < 2 ^ (1 + k)) + (h0 : CounterRun (GCounter (k + 2)) (j * 2 + 2) ((a - j) * 2 + 1) (u_val * 2 + 1) 0) + (h1 : CounterRun (GCounter (k + 1)) (b + j) u_val v c₁) + (h2 : CounterRun (GCounter (k + 1)) 2 v (y * 2 + 1) c₂) + (h3 : CounterRun (GCounter k) (a - j - 1) y z c₃) : + 2 ≤ c₁ + c₂ + c₃ := by + have e := descent_inside_balance a b j k ((a - j) * 2 + 1) u_val v y z 0 c₁ c₂ c₃ 0 + hj hk (by omega) hu hy h0 h1 h2 h3 + have hphi_u := phi_bounds hu + have hphi_y := phi_bounds hy + have hphi_z := phi_bounds hz + rw [phi_odd] at e + have hp1 : 2 ^ (1 + k) = 2 ^ k * 2 := by ring + have hp2 : 2 ^ (2 + k) = 2 ^ k * 4 := by ring + have hp2' : 2 ^ (k + 2) = 2 ^ k * 4 := by ring + have hp0 : 1 ≤ 2 ^ k := pow2_pos k + have hpu : phi u_val ≤ u_val := hphi_u.2.1 + have hpy : phi y ≤ y := hphi_y.2.1 + have haj : j ≤ a := by omega + by_contra hlt + rcases hphi_u with ⟨hpu1, hpu2, hpu3⟩ + rcases hphi_y with ⟨hpy1, hpy2, hpy3⟩ + rcases hphi_z with ⟨hpz1, hpz2, hpz3⟩ + have h_gap : (2 ^ k * (c₁ + c₂ + c₃ + 1)) * 8 + 4 ≤ + (2 ^ k * 2) * 8 + (c₁ + c₂) * 4 + c₃ * 8 := by + by_cases hc : c₁ + c₂ + c₃ = 0 + · have hle2 : c₁ + c₂ + c₃ + 2 ≤ 2 := by omega + have hmul2 := Nat.mul_le_mul_left (2 ^ k) hle2 + ring_nf at hmul2 ⊢ + omega + · have hle1 : c₁ + c₂ + c₃ + 1 ≤ 2 := by omega + have hmul1 := Nat.mul_le_mul_left (2 ^ k) hle1 + ring_nf at hmul1 ⊢ + omega + zify [hp0, hpu2, hpy2, haj] at hp0 haj e hpu3 hpy3 hpz2 hzb hp1 hp2 hp2' hsize h_gap + ring_nf at e hzb hsize h_gap + omega + +theorem double_y_closed {h a b j : ℕ} {fs : List Sym} {xs : List Sym} + {l tau x : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hj : j ≤ a) + (hw : Word (h - 1) ((a - j) * 2 + 1) xs) + (hr : Atom l tau x r) (hl1 : l ≤ 1) + (hcap : phi ((a - j) * 2 + 1) + (2 ^ (h - 1) - 1) * x ≤ (a * 2 + b + 1) * 4) : + ∃ c, Normal c ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ c := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + obtain ⟨hlpos, htau⟩ := Atom_bound hr + have el : l = 1 := by omega + subst el + change tau ≤ 2 at htau + have eh : h = (h - 4) + 4 := by omega + set k := h - 4 + have hsize : a * 2 + b + 1 = 2 ^ (3 + k) := by + have : h - 1 = 3 + k := by omega + rw [← this, hl.level_size] + have hw' : Word ((2 + k) + 1) ((a - j) * 2 + 1) xs := by + have : (2 + k) + 1 = h - 1 := by omega + rwa [this] + have hcap' : phi ((a - j) * 2 + 1) + (2 ^ ((2 + k) + 1) - 1) * x ≤ (a * 2 + b + 1) * 4 := by + have : (2 + k) + 1 = h - 1 := by omega + rwa [this] + have hguard : ((a - j) * 2 + 1) % 2 = 1 ∨ 2 ^ (1 + ((2 + k) + 1)) ≤ (a - j) * 2 + 1 + j * 4 := + Or.inl (by omega) + by_cases hja : j = a + · subst hja + have hb_pow : 2 ^ (2 + k) ≤ b + j := by + have : 2 ^ (3 + k) = 2 ^ (2 + k) * 2 := by ring + omega + obtain ⟨z, c, ys, s, hys, hodd, hs, hg, hvalue, hcalls, hstep⟩ := + narrow_boundary (fun c s => tau ≤ c → 2 ≤ c → Sat (Nat.max 1 3) (x + c * 2) s) + (k := 2 + k) hl.level_frame hw' (by omega) (by omega) (G_atom_ready hr) + hguard hb_pow hcap' + have htwo : 2 ≤ c := by + refine hcalls 2 (by decide) ?_ + have : 2 ^ (2 + (2 + k)) = 2 ^ (3 + k) * 2 := by ring + omega + have hs' : Sat 3 (x + c * 2) s := hs (by omega) htwo + refine ⟨_, ?_, hstep⟩ + have h_w0 : (fs ++ w ^ j ++ d) +> (ys +> s) = (fs ++ w ^ j ++ d) +> (w ^ 0 +> (ys +> s)) := rfl + rw [h_w0] + exact sat_double_root (j := 0) (L := + 3) (Level_next hl) (by omega) (by omega) (by omega) (by omega) + hys hs' (by omega) (by omega) (by omega) (by omega) (by omega) + · have hw'' : Word ((1 + k) + 2) ((a - j) * 2 + 1) xs := by + have : (1 + k) + 2 = (2 + k) + 1 := by omega + rwa [this] + have hguard' : ((a - j) * 2 + 1) % 2 = 1 ∨ 2 ^ (1 + ((1 + k) + 2)) ≤ (a - j) * 2 + 1 + j * 4 := + Or.inl (by omega) + obtain ⟨u_val, c₀, hu, hub, h0⟩ := counter_inner_total ((1 + k) + 2) j ((a - j) * 2 + 1) + (by omega) (Word_bound hw'') hguard' + have h_lin0 : (a - j) * 2 + 1 + (j * 2 + 2) * 2 < 2 ^ (1 + ((1 + k) + 2)) := by + have : 2 ^ (1 + ((1 + k) + 2)) = 2 ^ (3 + k) * 2 := by ring + omega + obtain ⟨eu, ec0⟩ := GCounterRun_linear h0 h_lin0 + have eu' : u_val = a + j + 2 := by omega + subst eu' ec0 + have hub' : a + j + 2 < 2 ^ (1 + ((1 + k) + 1)) := by + have : 1 + ((1 + k) + 1) = (1 + k) + 2 := by omega + rwa [this] + obtain ⟨v, c₁, h1, hvb⟩ := CounterRun_total + (fun v' hv' => GCounter_total ((1 + k) + 1) v' (by omega) hv') (b + j) (a + j + 2) hub' + have hodd : v % 2 = 1 := by + refine GCounterRun_saturated h1 (by omega) hub' ?_ + have : 2 ^ (1 + ((1 + k) + 1)) = 2 ^ (3 + k) := by + have : 1 + ((1 + k) + 1) = 3 + k := by omega + rw [this] + omega + obtain ⟨y, c₂, hy, hyb, h2⟩ := + counter_inner_total ((1 + k) + 1) 0 v (by omega) hvb (Or.inl hodd) + have hyb' : y < 2 ^ (1 + (1 + k)) := by + have : 1 + (1 + k) = (1 + k) + 1 := by omega + rwa [this] + obtain ⟨z, c₃, h3, hzb⟩ := CounterRun_total + (fun z' hz' => GCounter_total (1 + k) z' (by omega) hz') (a - j - 1) y hyb' + have hz : 0 < z := GCounterRun_positive h3 hy + have hsize' : a * 2 + b + 1 = 2 ^ (2 + (1 + k)) := by + have : 2 + (1 + k) = 3 + k := by omega + rwa [this] + have htwo : 2 ≤ c₁ + c₂ + c₃ := + descent_y_inside_calls a b j (1 + k) (a + j + 2) v y z c₁ c₂ c₃ + (by omega) (by omega) hsize' hu hy hz hzb h0 h1 h2 h3 + obtain ⟨s, hs, hg⟩ := G_atom_sat (c₁ + (c₂ + c₃)) hr (by omega) (by omega) + have hs' : Sat 3 (x + (c₁ + (c₂ + c₃)) * 2) s := hs + have hg' : G (0 + (c₁ + (c₂ + c₃))) r s := by simpa using hg + obtain ⟨ys, hys, hstep⟩ := descent_inside hl.level_frame (by omega) hw'' (by omega) + hguard' hodd h0 h1 h2 h3 hg' + have hvalue : phi z + (2 ^ (1 + k) - 1) * (x + (c₁ + (c₂ + c₃)) * 2) < (a * 2 + b + 1) * 2 := by + have e := + descent_inside_balance a b j (1 + k) ((a - j) * 2 + 1) (a + j + 2) v y z 0 c₁ c₂ c₃ x + (by omega) (by omega) (by omega) hu hy h0 h1 h2 h3 + have hphi_u := phi_bounds hu + have hphi_y := phi_bounds hy + have h_assoc : 0 + c₁ + c₂ + c₃ = c₁ + (c₂ + c₃) := by omega + have h_k : (1 + k) + 2 = (2 + k) + 1 := by omega + rw [h_assoc, h_k] at e + omega + have hlower : z % 2 = 0 → (a - j) * 2 ≤ z := by + intro heven + obtain ⟨_, ez, _⟩ := GCounterRun_even h3 heven + omega + refine ⟨_, ?_, hstep⟩ + exact sat_double_root (j := j + 1) (L := 3) hl (by omega) (by omega) (by omega) hz hys hs' + (by omega) (by omega) (by omega) + (fun hev => by have := hlower hev; omega) (by omega) + +theorem double_phase_progress {h a b j : ℕ} {fs : List Sym} {k n : ℕ} {xs : List Sym} + {l tau x : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hj : j ≤ a) (hk : 0 < k) (hn : 0 < n) + (hw : Word k n xs) (hr : Atom l tau x r) (hp : DoublePhase h a b j k n l tau) + (hcap : phi n + (2 ^ k - 1) * x ≤ (a * 2 + b + 1) * 4) : + ∃ c, Normal c ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ c := by + cases hp with + | DN k n l tau hkn hwidth hphase hrank => + exact double_narrow_closed hl hj hkn hwidth hn hw hr hrank hphase hcap + | DY l tau hl1 => + exact double_y_closed hl hj hw hr hl1 hcap + | D2 n l tau hphase hwidth hbudget => + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hnb : n < 8 := Word_bound hw + have hguard : n % 2 = 1 ∨ 8 ≤ n + j * 4 := by + rcases hphase with h | h <;> [exact Or.inl h; (right; omega)] + obtain ⟨u_val, c₀, hu, hub, h0⟩ := counter_inner_total 2 j n (by decide) hnb hguard + obtain ⟨z, c₁, h1, _⟩ := CounterRun_total (fun z' hz' => GCounter_total 1 z' (by decide) hz') + (b + j) u_val hub + have hrun : CounterRun (GCounter 1) (2 + (b + j - 2)) u_val z c₁ := by + have : 2 + (b + j - 2) = b + j := by omega + rwa [this] + obtain ⟨rfl, hlo, hhi⟩ := GCounterRun_one hrun hu hub + have h_22 : 2 ^ 2 - 1 = 3 := rfl + rw [h_22] at hcap + obtain ⟨c, hroot, hstep⟩ := double_two_closed hl hj hn hw hphase hr hwidth h0 h1 + (by omega) hcap + exact ⟨c, Or.inl hroot, hstep⟩ + | D1 n l tau hwidth hpos => + have h_21 : 2 ^ 1 - 1 = 1 := rfl + rw [h_21, Nat.one_mul] at hcap + rcases hpos with rfl | ⟨hnear, rfl⟩ + · obtain ⟨c, hroot, hstep⟩ := double_one_boundary_closed hl hn hw hr hwidth hcap + exact ⟨c, Or.inl hroot, hstep⟩ + · have h_phi1 : phi 1 = 1 := rfl + rw [h_phi1] at hcap + obtain ⟨c, hroot, hstep⟩ := double_one_neighbor_closed hl hnear hw hr hwidth hcap + exact ⟨c, Or.inl hroot, hstep⟩ + +theorem double_progress {c : Cfg Sym Q} (hd : DRoot c) : + ∃ c', Normal c' ∧ c [tm1]⊢⁺ c' := by + rcases hd with ⟨h, a, b, j, fs, r, hl, hj, hd'⟩ + rcases hd' with ⟨k, n, xs, l, tau, x, r, hk, hn, hw, hr, hp, hcap⟩ + exact double_phase_progress hl hj hk hn hw hr hp hcap + + + + +theorem late_first_Q_boundary_closed {k a : ℕ} {fs xs : List Sym} {q : ℕ} {r : ListBlank Sym} + (hl : Level (2 + k) a (a + 1) fs) (hw : Word (k + 1) (a * 2 + 2) xs) + (hr : Num q r) (hq : q ≤ 1) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ a +> (xs +> r)))) [tm1]⊢⁺ c := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hsize : a * 2 + (a + 1) + 1 = 2 ^ (1 + k) := by + have : 2 + k - 1 = 1 + k := by omega + rw [← this, hl.level_size] + have hpow : a * 6 + 4 = 2 ^ (2 + k) := by + have : 2 ^ (2 + k) = 2 ^ (1 + k) * 2 := by ring + omega + obtain ⟨ys, s, hy, hs, hstep⟩ := + late_first_Q_boundary hl.level_frame (by omega) hpow hw hr + have hodd : (a + 3) % 2 = 1 := by + rcases Frame_phase hl.level_frame with ⟨h1, _⟩ | ⟨_, h2⟩ <;> omega + refine ⟨_, ?_, hstep⟩ + have h_w0 : (fs ++ w ^ a ++ d) +> (ys +> s) = (fs ++ w ^ a ++ d) +> (w ^ 0 +> (ys +> s)) := rfl + rw [h_w0] + refine small_single_root (j := 0) (Level_next hl) (by omega) (by omega) (by omega) (by omega) + hy hs ?_ (by omega) (by omega) + have hphi : phi (a + 3) = a + 3 := by unfold phi; omega + have hp1 : 2 ^ (1 + k) = 2 ^ k * 2 := by ring + rw [hphi] + have hq_mul : (2 ^ k - 1) * (q + 4) ≤ (2 ^ k - 1) * 5 := Nat.mul_le_mul_left _ (by omega) + omega + +theorem late_second_Q_recover_closed {k a : ℕ} {fs xs : List Sym} {q : ℕ} {r : ListBlank Sym} + (hl : Level (2 + k) a a fs) (hw : Word (k + 1) (a * 2 + 2) xs) + (hr : Num q r) (hq : q ≤ 3) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ (a - 1) +> (xs +> r)))) [tm1]⊢⁺ c := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hsize : a * 2 + a + 1 = 2 ^ (1 + k) := by + have : 2 + k - 1 = 1 + k := by omega + rw [← this, hl.level_size] + have hpow : a * 6 + 2 = 2 ^ (2 + k) := by + have : 2 ^ (2 + k) = 2 ^ (1 + k) * 2 := by ring + omega + obtain ⟨K, z, Q, ys, s, hK, hwidth, hy, hs, hodd, hwide, hcap, hsmall, hstep⟩ := + late_second_Q_recover hl.level_frame ha hpow hw hr hq + refine ⟨_, ?_, hstep⟩ + by_cases hK1 : K = 1 + · subst hK1 + obtain ⟨rfl, htail⟩ := hsmall rfl + have eys := Word_max hy rfl + change ys = w at eys + rw [eys] + have h_w1 : (fs ++ w ^ a ++ d) +> (w +> s) = (fs ++ w ^ a ++ d) +> (w ^ 1 +> s) := rfl + rw [h_w1] + exact .sroot (1 + (2 + k)) (a + a) (a * 2 + 1) 1 (fs ++ w ^ a ++ d) s + (Level_next hl) (by omega) (.SNum Q s hs htail) + · have h_w0 : (fs ++ w ^ a ++ d) +> (ys +> s) = (fs ++ w ^ a ++ d) +> (w ^ 0 +> (ys +> s)) := rfl + rw [h_w0] + refine .sroot (1 + (2 + k)) (a + a) (a * 2 + 1) 0 (fs ++ w ^ a ++ d) (ys +> s) + (Level_next hl) (by omega) + (.SWord K z Q ys s hK (by omega) hy hs ?_ (by omega)) + refine single_odd_phase (by omega) (by omega) hodd (fun hwider => ⟨?_, Or.inr (by omega)⟩) + have hp : 2 ^ (2 + k) ≤ 2 ^ K := pow2_mono (by omega) + have hz := hwide hp + omega + +theorem first_Q_x_closed {k a j : ℕ} {fs xs : List Sym} {r : ListBlank Sym} + (hl : Level (2 + k) a a fs) (hj : j * 7 + 4 = a * 5) + (hw : Word (2 + k) (a * 3 + 1 - j) xs) (hr : Num 0 r) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ c := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hsize : a * 2 + a + 1 = 2 ^ (1 + k) := by + have : 2 + k - 1 = 1 + k := by omega + rw [← this, hl.level_size] + have hodd : (a * 3 + 1 - j) % 2 = 1 := by + rcases Frame_phase hl.level_frame with ⟨_, h⟩ | ⟨h, _⟩ <;> omega + have h_lin1 : a * 3 + 1 - j + (j * 2 + 2) * 2 < 2 ^ (1 + (2 + k)) := by + have : 2 ^ (1 + (2 + k)) = 2 ^ (1 + k) * 4 := by ring + omega + obtain ⟨ys, hy, hp⟩ := P_word_linear (j * 2 + 2) r hw (by omega) h_lin1 + set u_val := (a * 3 + 1 - j + j * 4 + 3) / 2 + have hu_eq : a * 3 + 1 - j + (j * 2 + 2) * 2 = u_val * 2 + 1 := by omega + rw [hu_eq] at hy + have hy' : Word ((1 + k) + 1) (u_val * 2 + 1) ys := by + have : (1 + k) + 1 = 2 + k := by omega + rwa [this] + obtain ⟨zs, hz, rfl⟩ := Word_odd_inv hy' + have h_lin2 : u_val + (a + j) * 2 < 2 ^ (1 + (1 + k)) := by + have : 2 ^ (1 + (1 + k)) = 2 ^ (1 + k) * 2 := by ring + omega + obtain ⟨bs, hb, hmid⟩ := P_word_linear (a + j) r hz (by omega) h_lin2 + have etop : u_val + (a + j) * 2 + 2 = 2 ^ (2 + k) := by + have : 2 ^ (2 + k) = 2 ^ (1 + k) * 2 := by ring + omega + have hb' : Word (k + 1) (u_val + (a + j) * 2) bs := by + have : k + 1 = 1 + k := by omega + rwa [this] + rw [Word_before_Q hb' etop] at hmid + obtain ⟨r₁, h1, htail⟩ := P_num hr + have h_lin3 : 1 + (a - j - 1) * 2 < 2 ^ (1 + k) := by omega + obtain ⟨out, hout, hlast⟩ := P_word_linear (a - j - 1) r₁ (Word_one k) (by omega) h_lin3 + have hstep : (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ (cfg (fs +> (w ^ (j + + 1) +> (out +> r₁)))) := by + refine first_Q_inside hl.level_frame (by omega) + (.InnerP (by simpa only [List.append_assoc, append_assoc] using hp)) + (P_G (by simpa only [List.append_assoc, append_assoc] using hmid)) + (.GP htail) (P_G hlast) + refine ⟨_, ?_, hstep⟩ + refine .sroot (2 + k) a a (j + 1) fs (out +> r₁) hl (by omega) + (.SWord k (1 + (a - j - 1) * 2) 2 out r₁ (by omega) (by omega) hout h1 + (.SN k _ 2 (by omega) (by omega) (Or.inl (by omega))) ?_) + unfold phi + have hp1 : 2 ^ (1 + k) = 2 ^ k * 2 := by ring + omega + +set_option maxHeartbeats 2000000 in +-- Multi-step cascade closure requires elevated heartbeats. +theorem late_first_Q_z_closed {k a j : ℕ} {fs : List Sym} {n : ℕ} {xs : List Sym} {r : ListBlank + Sym} + (hl : Level (3 + k) a (a + 1) fs) (hj : j * 7 = a * 5) + (hn : n * 2 = (a * 3 + 2) * 2 + (a - j)) + (hw : Word (2 + k) n xs) (hr : Num 0 r) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ c := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hsize : a * 2 + (a + 1) + 1 = 2 ^ (2 + k) := by + have : 3 + k - 1 = 2 + k := by omega + rw [← this, hl.level_size] + obtain ⟨r₁, h1, htail⟩ := P_num hr + obtain ⟨u_val, c, ys, s, hc, hy, hs, hg⟩ := + G_word_data (a + 1 + j) (by omega) (Word_one (1 + k)) h1 + have hodd : u_val % 2 = 1 := GCounterRun_odd hc rfl + have hub := Word_bound hy + have e := GCounterRun_balance hc (by omega) (by decide) + have ec : c = 1 := by + have hper : (2 ^ (1 + k) - 1) * 2 = a * 3 := by + have : 2 ^ (2 + k) = 2 ^ (1 + k) * 2 := by ring + omega + rw [hper] at e + unfold phi at e + have hub' : u_val < a * 3 + 2 := by + have : 2 ^ (1 + (1 + k)) = 2 ^ (2 + k) := by + have : 1 + (1 + k) = 2 + k := by omega + rw [this] + omega + rcases c with _ | _ | c' + · omega + · rfl + · nlinarith + subst ec + have hs' : Num 4 s := hs + have hy' : Word (k + 1) u_val ys := by + have : k + 1 = 1 + k := by omega + rwa [this] + obtain ⟨z, e_cnt, zs, out, hz, hzpos, hout, hcap, hlower, hsmall, hp, _⟩ := + odd_d_value Num (a - j - 1) hy' (by omega) hodd (fun c => G_nums c hs') + have hstep : (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ (cfg (fs +> (w ^ (j + + 1) +> (zs +> out)))) := by + rw [pow_add_list w j 1, pow_one_list, append_assoc] + have hw' : Word ((1 + k) + 1) n xs := by + have : (1 + k) + 1 = 2 + k := by omega + rwa [this] + have he_pow : n + (j - 1) * 4 + 6 = 2 ^ (2 + (1 + k)) := by + have : 2 ^ (2 + (1 + k)) = 2 ^ (2 + k) * 2 := by ring + omega + have hg' : G (a + 1 + (j - 1) + 1) (one (1 + k) +> r₁) (ys +> s) := by + have : a + 1 + (j - 1) + 1 = a + 1 + j := by omega + rwa [this] + have hout_g : G (a - (j - 1) - 1) (d +> (ys +> s)) (w +> (zs +> out)) := by + have : a - (j - 1) - 1 = 1 + (a - j - 1) := by omega + rw [this] + exact P_G hp + have h_lfq := late_first_Q (a := a) (b := a + 1) (j := j - 1) (k := 1 + k) + hl.level_frame (by omega) (by omega) hw' he_pow (.GP htail) hg' hout_g + have hj_eq : 1 + (j - 1) = j := by omega + rwa [hj_eq] at h_lfq + refine ⟨_, ?_, hstep⟩ + refine small_single_root (j := j + 1) hl (by omega) (by omega) (by omega) hzpos hz hout ?_ + (fun hev => by have := hlower hev; omega) (fun hk1 h2 => hsmall hk1 (by omega)) + have hphi : phi u_val = u_val := by + unfold phi; omega + have h_phi1 : phi 1 = 1 := rfl + rw [hphi] at e hcap + try rw [h_phi1] at e + have hp1 : 2 ^ (2 + k) = 2 ^ (1 + k) * 2 := by ring + have hp2 : 2 ^ (k + 1) = 2 ^ (1 + k) := by + have : k + 1 = 1 + k := by omega + rw [this] + rw [hp2] at hcap + clear hc hy hs hg hy' hz hout hp hstep hlower hsmall h1 htail hl hw hr hs' + omega + +theorem single_low_descent_closed {k a b j : ℕ} {fs : List Sym} {n : ℕ} {xs : List Sym} + {q : ℕ} {r : ListBlank Sym} + (hl : Level (3 + k) a b fs) (hj : j ≤ a) (hn : 0 < n) + (hw : Word (2 + k) n xs) (hr : Num q r) + (hguard : n % 2 = 1 ∨ 2 ^ (3 + k) ≤ n + j * 4) + (hready : ∀ u_val v c₀ c₁, + CounterRun (GCounter (2 + k)) (j * 2 + 2) n (u_val * 2 + 1) c₀ → + CounterRun (GCounter (1 + k)) (b + j) u_val v c₁ → v % 2 = 1) + (hcap : phi n + (2 ^ (2 + k) - 1) * q ≤ (a * 2 + b + 1) * 4) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ c := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hguard1 : n % 2 = 1 ∨ 2 ^ (1 + (2 + k)) ≤ n + j * 4 := by + have : 1 + (2 + k) = 3 + k := by omega + rwa [this] + obtain ⟨u_val, c₀, hu, hub, h0⟩ := + counter_inner_total (2 + k) j n (by omega) (Word_bound hw) hguard1 + have hub' : u_val < 2 ^ (1 + (1 + k)) := by + have : 1 + (1 + k) = 2 + k := by omega + rwa [this] + obtain ⟨v, c₁, h1, hvb⟩ := CounterRun_total + (fun z' hz' => GCounter_total (1 + k) z' (by omega) hz') (b + j) u_val hub' + have hodd : v % 2 = 1 := hready u_val v c₀ c₁ h0 h1 + by_cases hja : j = a + · subst hja + obtain ⟨s, hs, hg⟩ := G_nums (c₀ + c₁) hr + have hw' : Word ((1 + k) + 1) n xs := by + have : (1 + k) + 1 = 2 + k := by omega + rwa [this] + have h0' : CounterRun (GCounter ((1 + k) + 1)) (j * 2 + 2) n (u_val * 2 + 1) c₀ := by + have : (1 + k) + 1 = 2 + k := by omega + rwa [this] + have hguard' : n % 2 = 1 ∨ 2 ^ (1 + ((1 + k) + 1)) ≤ n + j * 4 := by + have : 1 + ((1 + k) + 1) = 3 + k := by omega + rwa [this] + obtain ⟨ys, hys, hstep⟩ := + descent_boundary hl.level_frame hw' (by omega) hguard' h0' h1 hg + have e := descent_boundary_balance j b (1 + k) n u_val v c₀ c₁ q (by omega) hn hu h0' h1 + have hpu := phi_bounds hu + refine ⟨_, ?_, hstep⟩ + have h_w0 : (fs ++ w ^ j ++ d) +> (ys +> s) = (fs ++ w ^ j ++ d) +> (w ^ 0 +> (ys +> s)) := rfl + rw [h_w0] + refine small_single_root (Level_next hl) (by omega) (by omega) (by omega) (by omega) + hys hs ?_ (by omega) (by omega) + have : (1 + k) + 1 = 2 + k := by omega + rw [this] at e + omega + · obtain ⟨y, c₂, hy, hyb, h2⟩ := + counter_inner_total (1 + k) 0 v (by omega) hvb (Or.inl hodd) + have hyb' : y < 2 ^ (1 + k) := hyb + obtain ⟨z, c₃, h3, hzb⟩ := CounterRun_total + (fun z' hz' => GCounter_total k z' (by omega) hz') (a - j - 1) y hyb' + obtain ⟨s, hs, hg⟩ := G_nums (c₀ + (c₁ + (c₂ + c₃))) hr + have hw' : Word (k + 2) n xs := by + have : k + 2 = 2 + k := by omega + rwa [this] + have hguard' : n % 2 = 1 ∨ 2 ^ (1 + (k + 2)) ≤ n + j * 4 := by + have : 1 + (k + 2) = 3 + k := by omega + rwa [this] + have h0' : CounterRun (GCounter (k + 2)) (j * 2 + 2) n (u_val * 2 + 1) c₀ := by + have : k + 2 = 2 + k := by omega + rwa [this] + have h1' : CounterRun (GCounter (k + 1)) (b + j) u_val v c₁ := by + have : k + 1 = 1 + k := by omega + rwa [this] + have h2' : CounterRun (GCounter (k + 1)) 2 v (y * 2 + 1) c₂ := by + have : k + 1 = 1 + k := by omega + rwa [this] + obtain ⟨ys, hys, hstep⟩ := + descent_inside hl.level_frame (by omega) hw' (by omega) hguard' hodd h0' h1' h2' h3 hg + have e := descent_inside_balance a b j k n u_val v y z c₀ c₁ c₂ c₃ q + (by omega) (by omega) hn hu hy h0' h1' h2' h3 + have hpu := phi_bounds hu + have hpy := phi_bounds hy + have hz : 0 < z := GCounterRun_positive h3 hy + refine ⟨_, ?_, hstep⟩ + refine small_single_root hl (by omega) (by omega) (by omega) hz hys hs ?_ ?_ (by omega) + · have h_assoc : c₀ + (c₁ + (c₂ + c₃)) = c₀ + c₁ + c₂ + c₃ := by omega + have h_k : k + 2 = 2 + k := by omega + rw [h_assoc] + rw [h_k] at e + omega + · intro heven + obtain ⟨_, ez, _⟩ := GCounterRun_even h3 heven + omega + +theorem single_y_low_closed {k a b j : ℕ} {fs xs : List Sym} {q : ℕ} {r : ListBlank Sym} + (hl : Level (3 + k) a b fs) (hj : j ≤ a) + (hw : Word (2 + k) ((a - j) * 2 + 1) xs) (hr : Num q r) + (hcap : phi ((a - j) * 2 + 1) + (2 ^ (2 + k) - 1) * q ≤ (a * 2 + b + 1) * 4) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ c := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hsize : a * 2 + b + 1 = 2 ^ (2 + k) := by + have : 3 + k - 1 = 2 + k := by omega + rw [← this, hl.level_size] + refine single_low_descent_closed hl hj (by omega) hw hr (Or.inl (by omega)) ?_ hcap + intro u_val v c₀ c₁ h0 h1 + have h_lin : (a - j) * 2 + 1 + (j * 2 + 2) * 2 < 2 ^ (1 + (2 + k)) := by + have : 2 ^ (1 + (2 + k)) = 2 ^ (2 + k) * 2 := by ring + omega + obtain ⟨eu, ec0⟩ := GCounterRun_linear h0 h_lin + refine GCounterRun_saturated h1 (by omega) ?_ ?_ + · have : 2 ^ (1 + (1 + k)) = 2 ^ (2 + k) := by + have : 1 + (1 + k) = 2 + k := by omega + rw [this] + omega + · have : 2 ^ (1 + (1 + k)) = 2 ^ (2 + k) := by + have : 1 + (1 + k) = 2 + k := by omega + rw [this] + omega + +theorem single_x_low_odd_closed {k a b j : ℕ} {fs xs : List Sym} {q : ℕ} {r : ListBlank Sym} + (hl : Level (3 + k) a b fs) (hj : j ≤ a) + (hodd : (a * 2 + b + 1 - j) % 2 = 1) + (hw : Word (2 + k) (a * 2 + b + 1 - j) xs) (hr : Num q r) + (hcap : phi (a * 2 + b + 1 - j) + (2 ^ (2 + k) - 1) * q ≤ (a * 2 + b + 1) * 4) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ c := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hsize : a * 2 + b + 1 = 2 ^ (2 + k) := by + have : 3 + k - 1 = 2 + k := by omega + rw [← this, hl.level_size] + refine single_low_descent_closed hl hj (by omega) hw hr (Or.inl hodd) ?_ hcap + intro u_val v c₀ c₁ h0 h1 + have hub := GCounterRun_bound h0 (by omega) (Word_bound hw) + have e := GCounterRun_balance h0 (by omega) (by omega) + rw [phi_odd] at e + have hphi : phi (a * 2 + b + 1 - j) = a * 2 + b + 1 - j := by + unfold phi; omega + rw [hphi] at e + have h_pow : 2 ^ (1 + (1 + k)) = 2 ^ (2 + k) := by + have : 1 + (1 + k) = 2 + k := by omega + rw [this] + have h_pow2 : 2 ^ (1 + (2 + k)) = 2 ^ (2 + k) * 2 := by ring + refine GCounterRun_saturated h1 (by omega) (by omega) ?_ + rw [h_pow, ← hsize] + have ep : 2 ^ (2 + k) - 1 = a * 2 + b := by omega + rw [ep] at e + rcases c₀ with _ | _ | c₀' + · omega + · omega + · have : 2 * ((a * 2 + b) * 2) ≤ (c₀' + 1 + 1) * ((a * 2 + b) * 2) := + Nat.mul_le_mul_right _ (by omega) + omega + +theorem single_x_top_closed {k a : ℕ} {fs xs : List Sym} {r : ListBlank Sym} + (hl : Level (3 + k) a a fs) (hw : Word (4 + k) (a * 2 + 1) xs) (hr : Num 0 r) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ a +> (xs +> r)))) [tm1]⊢⁺ c := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hsize : a * 2 + a + 1 = 2 ^ (2 + k) := by + have : 3 + k - 1 = 2 + k := by omega + rw [← this, hl.level_size] + have h_lin1 : a * 2 + 1 + (a * 2 + 2) * 2 < 2 ^ (1 + (4 + k)) := by + have : 2 ^ (1 + (4 + k)) = 2 ^ (2 + k) * 8 := by ring + omega + obtain ⟨ys, hy, hp⟩ := P_word_linear (a * 2 + 2) r hw (by omega) h_lin1 + have h_eq1 : a * 2 + 1 + (a * 2 + 2) * 2 = (a * 3 + 2) * 2 + 1 := by omega + rw [h_eq1] at hy + have hy' : Word ((3 + k) + 1) ((a * 3 + 2) * 2 + 1) ys := by + have : (3 + k) + 1 = 4 + k := by omega + rwa [this] + obtain ⟨zs, hz, rfl⟩ := Word_odd_inv hy' + have h_lin2 : a * 3 + 2 + (a + a) * 2 < 2 ^ (1 + (3 + k)) := by + have : 2 ^ (1 + (3 + k)) = 2 ^ (2 + k) * 4 := by ring + omega + obtain ⟨out, hout, hmid⟩ := P_word_linear (a + a) r hz (by omega) h_lin2 + have hstep : (cfg (fs +> (w ^ a +> (xs +> r)))) [tm1]⊢⁺ (cfg ((fs ++ w ^ a ++ d) +> (out +> + r))) := by + simp only [List.append_assoc, append_assoc] + refine frame_step hl.level_frame ?_ + have hin : Inner a (xs +> r) (t +> (zs +> r)) := + .InnerP (by simpa only [List.append_assoc, append_assoc] using hp) + have hgd : I (a + a) ([1] +> (t +> (zs +> r))) (d +> (out +> r)) := by + simpa only [d, t, append_cons, append_nil] using G_d (P_G hmid) + have h_sub : a - a = 0 := by omega + exact inner_column (by omega) hin hgd (by rw [h_sub]; exact .G0 _) + refine ⟨_, ?_, hstep⟩ + have h_w0 : (fs ++ w ^ a ++ d) +> (out +> r) = (fs ++ w ^ a ++ d) +> (w ^ 0 +> (out +> r)) := rfl + rw [h_w0] + refine .sroot (1 + (3 + k)) (a + a) (a * 2 + 1) 0 (fs ++ w ^ a ++ d) (out +> r) + (Level_next hl) (by omega) + (.SWord (3 + k) (a * 3 + 2 + (a + a) * 2) 0 out r (by omega) (by omega) hout hr ?_ ?_) + · have h_sz := SinglePhase.SZ (h := 1 + (3 + k)) (a := a + a) (b := a * 2 + 1) (j := 0) + (a * 3 + 2 + (a + a) * 2) (by omega) + simpa using h_sz + · unfold phi; omega + +theorem single_y_top_odd_closed {k a b j : ℕ} {fs xs : List Sym} {r : ListBlank Sym} + (hl : Level (3 + k) a b fs) (hj : j < a) + (hodd : (a + b * 2 + j * 3 + 2) % 2 = 1) + (hw : Word (4 + k) ((a - j) * 2 + 1) xs) (hr : Num 0 r) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ c := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hsize : a * 2 + b + 1 = 2 ^ (2 + k) := by + have : 3 + k - 1 = 2 + k := by omega + rw [← this, hl.level_size] + have h_lin1 : (a - j) * 2 + 1 + (j * 2 + 2) * 2 < 2 ^ (1 + (4 + k)) := by + have : 2 ^ (1 + (4 + k)) = 2 ^ (2 + k) * 8 := by ring + omega + obtain ⟨ys, hy, hp⟩ := P_word_linear (j * 2 + 2) r hw (by omega) h_lin1 + have h_eq1 : (a - j) * 2 + 1 + (j * 2 + 2) * 2 = (a + j + 2) * 2 + 1 := by omega + rw [h_eq1] at hy + have hy' : Word ((3 + k) + 1) ((a + j + 2) * 2 + 1) ys := by + have : (3 + k) + 1 = 4 + k := by omega + rwa [this] + obtain ⟨zs, hz, rfl⟩ := Word_odd_inv hy' + have h_lin2 : a + j + 2 + (b + j) * 2 < 2 ^ (1 + (3 + k)) := by + have : 2 ^ (1 + (3 + k)) = 2 ^ (2 + k) * 4 := by ring + omega + obtain ⟨bs, hb, hmid⟩ := P_word_linear (b + j) r hz (by omega) h_lin2 + have h_eq2 : a + j + 2 + (b + j) * 2 = a + b * 2 + j * 3 + 2 := by omega + rw [h_eq2] at hb + have h_lin3 : a + b * 2 + j * 3 + 2 + 2 * 2 < 2 ^ (1 + (3 + k)) := by + have : 2 ^ (1 + (3 + k)) = 2 ^ (2 + k) * 4 := by ring + omega + obtain ⟨cs, hc, htwo⟩ := P_word_linear 2 r hb (by omega) h_lin3 + set y := (a + b * 2 + j * 3 + 5) / 2 + have h_eq3 : a + b * 2 + j * 3 + 2 + 2 * 2 = y * 2 + 1 := by omega + rw [h_eq3] at hc + have hc' : Word ((2 + k) + 1) (y * 2 + 1) cs := by + have : (2 + k) + 1 = 3 + k := by omega + rwa [this] + obtain ⟨ds, hd, rfl⟩ := Word_odd_inv hc' + have h_lin4 : y + (a - j - 1) * 2 < 2 ^ (1 + (2 + k)) := by + have : 2 ^ (1 + (2 + k)) = 2 ^ (2 + k) * 2 := by ring + omega + obtain ⟨out, hout, hlast⟩ := P_word_linear (a - j - 1) r hd (by omega) h_lin4 + have hstep : (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ (cfg (fs +> (w ^ (j + + 1) +> (out +> r)))) := by + rw [pow_add_list w j 1, pow_one_list, append_assoc] + refine frame_step hl.level_frame ?_ + have hin : Inner j (xs +> r) (t +> (zs +> r)) := + .InnerP (by simpa only [List.append_assoc, append_assoc] using hp) + have hgd : I (b + j) ([1] +> (t +> (zs +> r))) (d +> (bs +> r)) := by + simpa only [d, t, append_cons, append_nil] using G_d (P_G hmid) + refine inner_column (by omega) hin hgd ?_ + have : a - j = 1 + (a - j - 1) := by omega + rw [this] + have hpd : G 1 (d +> (bs +> r)) (w +> (ds +> r)) := by + have h_d := P_d htwo + exact P_G + (by simpa only [u, w, t, List.append_assoc, append_assoc, append_cons, append_nil] using + h_d) + exact G_add hpd (P_G (G_w (P_G hlast))) + refine ⟨_, ?_, hstep⟩ + refine .sroot (3 + k) a b (j + 1) fs (out +> r) hl (by omega) + (.SWord (2 + k) (y + (a - j - 1) * 2) 0 out r (by omega) (by omega) hout hr ?_ ?_) + · have h_sz := SinglePhase.SZ (h := 3 + k) (a := a) (b := b) (j := j + 1) + (y + (a - j - 1) * 2) (by omega) + simpa using h_sz + · unfold phi; omega + +theorem single_mid_descent_closed {k a b j : ℕ} {fs : List Sym} {n u_val : ℕ} + {xs : List Sym} {q : ℕ} {r : ListBlank Sym} + (hl : Level (3 + k) a b fs) (hj : j ≤ a) (hn : 0 < n) + (hupper : n ≤ a * 2 + b + 1 - j) (eu : n + (j * 2 + 2) * 2 = u_val * 2 + 1) + (hw : Word (3 + k) n xs) (hr : Num q r) + (hready : u_val % 2 = 1 ∨ 2 ^ (3 + k) ≤ u_val + (b + j) * 2) + (hcap : phi n + (2 ^ (3 + k) - 1) * q ≤ (a * 2 + b + 1) * 4) : + ∃ c, SRoot c ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ c := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hsize : a * 2 + b + 1 = 2 ^ (2 + k) := by + have : 3 + k - 1 = 2 + k := by omega + rw [← this, hl.level_size] + have hguard : n % 2 = 1 ∨ 2 ^ (1 + (3 + k)) ≤ n + j * 4 := Or.inl (by omega) + obtain ⟨u₀, c₀, hu, hub, h0⟩ := + counter_inner_total (3 + k) j n (by omega) (Word_bound hw) hguard + have h_lin0 : n + (j * 2 + 2) * 2 < 2 ^ (1 + (3 + k)) := by + have : 2 ^ (1 + (3 + k)) = 2 ^ (2 + k) * 4 := by ring + omega + obtain ⟨eu0, ec0⟩ := GCounterRun_linear h0 h_lin0 + have euu : u_val = u₀ := by omega + subst u₀ ec0 + have hub' : u_val < 2 ^ (1 + (2 + k)) := by + have : 1 + (2 + k) = 3 + k := by omega + rwa [this] + obtain ⟨v, c₁, h1, hvb⟩ := CounterRun_total + (fun z' hz' => GCounter_total (2 + k) z' (by omega) hz') (b + j) u_val hub' + have hodd : v % 2 = 1 := by + rcases hready with hodd' | hsat + · exact GCounterRun_odd h1 hodd' + · refine GCounterRun_saturated h1 (by omega) hub' ?_ + have : 1 + (2 + k) = 3 + k := by omega + rwa [this] + by_cases hja : j = a + · subst hja + obtain ⟨s, hs, hg⟩ := G_nums c₁ hr + have hw' : Word ((2 + k) + 1) n xs := by + have : (2 + k) + 1 = 3 + k := by omega + rwa [this] + have hguard' : n % 2 = 1 ∨ 2 ^ (1 + ((2 + k) + 1)) ≤ n + j * 4 := Or.inl (by omega) + have h0' : CounterRun (GCounter ((2 + k) + 1)) (j * 2 + 2) n (u_val * 2 + 1) 0 := by + have : (2 + k) + 1 = 3 + k := by omega + rwa [this] + have hg' : G (0 + c₁) r s := by simpa using hg + obtain ⟨ys, hys, hstep⟩ := + descent_boundary hl.level_frame hw' (by omega) hguard' h0' h1 hg' + have e := descent_boundary_balance j b (2 + k) n u_val v 0 c₁ q (by omega) hn hu h0' h1 + have hpu := phi_bounds hu + refine ⟨_, ?_, hstep⟩ + have h_w0 : (fs ++ w ^ j ++ d) +> (ys +> s) = (fs ++ w ^ j ++ d) +> (w ^ 0 +> (ys +> s)) := rfl + rw [h_w0] + refine .sroot (1 + (3 + k)) (j + b) (j * 2 + 1) 0 (fs ++ w ^ j ++ d) (ys +> s) + (Level_next hl) (by omega) + (.SWord (2 + k) v (q + c₁ * 2) ys s (by omega) (GCounterRun_positive h1 hu) hys hs + (.SN (2 + k) v _ (by omega) (by omega) (Or.inl hodd)) ?_) + have : (2 + k) + 1 = 3 + k := by omega + rw [this, Nat.zero_add] at e + omega + · obtain ⟨y, c₂, hy, hyb, h2⟩ := + counter_inner_total (2 + k) 0 v (by omega) hvb (Or.inl hodd) + have hyb' : y < 2 ^ (1 + (1 + k)) := by + have : 1 + (1 + k) = 2 + k := by omega + rwa [this] + obtain ⟨z, c₃, h3, hzb⟩ := CounterRun_total + (fun z' hz' => GCounter_total (1 + k) z' (by omega) hz') (a - j - 1) y hyb' + obtain ⟨s, hs, hg⟩ := G_nums (c₁ + (c₂ + c₃)) hr + have hw' : Word ((1 + k) + 2) n xs := by + have : (1 + k) + 2 = 3 + k := by omega + rwa [this] + have hguard' : n % 2 = 1 ∨ 2 ^ (1 + ((1 + k) + 2)) ≤ n + j * 4 := Or.inl (by omega) + have h0' : CounterRun (GCounter ((1 + k) + 2)) (j * 2 + 2) n (u_val * 2 + 1) 0 := by + have : (1 + k) + 2 = 3 + k := by omega + rwa [this] + have h1' : CounterRun (GCounter ((1 + k) + 1)) (b + j) u_val v c₁ := by + have : (1 + k) + 1 = 2 + k := by omega + rwa [this] + have h2' : CounterRun (GCounter ((1 + k) + 1)) 2 v (y * 2 + 1) c₂ := by + have : (1 + k) + 1 = 2 + k := by omega + rwa [this] + have hg' : G (0 + (c₁ + (c₂ + c₃))) r s := by simpa using hg + obtain ⟨ys, hys, hstep⟩ := + descent_inside hl.level_frame (by omega) hw' (by omega) hguard' hodd h0' h1' h2' h3 hg' + have hz : 0 < z := GCounterRun_positive h3 hy + refine ⟨_, ?_, hstep⟩ + refine .sroot (3 + k) a b (j + 1) fs (ys +> s) hl (by omega) + (.SWord (1 + k) z (q + (c₁ + (c₂ + c₃)) * 2) ys s (by omega) hz hys hs ?_ ?_) + · refine .SN (1 + k) z _ (by omega) (by omega) ?_ + by_cases hzo : z % 2 = 1 + · exact Or.inl hzo + · right + obtain ⟨_, ez, _⟩ := GCounterRun_even h3 (by omega) + refine ⟨by omega, ?_⟩ + have h_pow : 2 ^ (1 + (1 + k)) = 2 ^ (2 + k) := by + have : 1 + (1 + k) = 2 + k := by omega + rw [this] + rw [h_pow, ← hsize] + by_cases hnear : b ≤ j * 2 + 1 + · omega + · have h_lin1 : u_val + (b + j) * 2 < 2 ^ (1 + (2 + k)) := by + have : 2 ^ (1 + (2 + k)) = 2 ^ (2 + k) * 2 := by ring + omega + obtain ⟨ev, ec1⟩ := GCounterRun_linear h1 h_lin1 + have h_lin2 : v + 2 * 2 < 2 ^ (1 + (2 + k)) := by + have : 2 ^ (1 + (2 + k)) = 2 ^ (2 + k) * 2 := by ring + omega + obtain ⟨ey, ec2⟩ := GCounterRun_linear h2 h_lin2 + omega + · have e := descent_inside_balance a b j (1 + k) n u_val v y z 0 c₁ c₂ c₃ q + (by omega) (by omega) hn hu hy h0' h1' h2' h3 + have hpu := phi_bounds hu + have hpy := phi_bounds hy + have h_assoc : 0 + c₁ + c₂ + c₃ = c₁ + (c₂ + c₃) := by omega + have h_k : (1 + k) + 2 = 3 + k := by omega + rw [h_assoc, h_k] at e + omega + +theorem G_word_atom {k n : ℕ} {xs : List Sym} {q : ℕ} {r : ListBlank Sym} (i : ℕ) + (hk : 0 < k) (hn : 0 < n) (hw : Word k n xs) (hr : Num q r) : + ∃ m c ys s, + CounterRun (GCounter k) i n m c ∧ Word k m ys ∧ Num (q + c * 2) s ∧ + Atom k (2 ^ k) (phi n + (2 ^ k - 1) * q + i * 2) (ys +> s) ∧ + G i (xs +> r) (ys +> s) := by + obtain ⟨m, c, ys, s, hc, hy, hs, hg⟩ := G_word_data i hk hw hr + have e := GCounterRun_balance hc hk hn + refine ⟨m, c, ys, s, hc, hy, hs, ?_, hg⟩ + have h_eq : phi n + (2 ^ k - 1) * q + i * 2 = phi m + (2 ^ k - 1) * (q + c * 2) := by + nlinarith + rw [h_eq] + refine .AtomWord k (2 ^ k) m (q + c * 2) ys s hk (GCounterRun_positive hc hn) hy hs (by omega) ?_ + right + have : 2 ^ (1 + k) = 2 ^ k * 2 := by ring + omega + +theorem split_O_capacity {a b j l K z Q m c : ℕ} + (hj : j < a) (hl : 0 < l) (hK : 0 < K) (hz : 0 < z) + (hcap : (2 ^ l * (z * 2 + 1)) * 2 + (2 ^ (2 + l + K) - 1) * Q ≤ + (a * 2 + b + 1) * 4 + b * 4 + j * 8 + 11) + (hi : CounterRun (ICounter l) (a - j - 1) 1 m c) : + phi (m * 2 + 1) + (2 ^ (1 + l) - 1) * (phi z + (2 ^ K - 1) * Q + c * 2) < + (a * 2 + b + 1) * 4 := by + have e := ICounterRun_balance hi + have haj : 1 + (a - j - 1) = a - j := by omega + rw [haj] at e + have ephi : phi (m * 2 + 1) = m * 2 + 1 := phi_odd m + rw [ephi] + have eq_val : m * 2 + 1 + (2 ^ (1 + l) - 1) * (phi z + (2 ^ K - 1) * Q + c * 2) = + (a - j) * 2 + 1 + (2 ^ (1 + l) - 1) * (phi z + (2 ^ K - 1) * Q) := by + nlinarith + rw [eq_val] + have hphi := phi_bounds hz + have hp : 2 ≤ 2 ^ l := by + have : (2 : ℕ) = 2 ^ 1 := rfl + rw [this] + exact pow2_mono (by omega) + have hT : 2 ≤ 2 ^ K := by + have : (2 : ℕ) = 2 ^ 1 := rfl + rw [this] + exact pow2_mono (by omega) + have ep : 2 ^ (2 + l + K) = 4 * 2 ^ l * 2 ^ K := by + rw [Nat.pow_add, Nat.pow_add] + have hp1 : 2 ^ (1 + l) = 2 * 2 ^ l := by ring + rw [ep] at hcap + rw [hp1] + have hp0 : 1 ≤ 2 ^ l := by omega + have hT0 : 1 ≤ 2 ^ K := by omega + have hp2 : 1 ≤ 2 * 2 ^ l := by omega + have hp4 : 1 ≤ 4 * 2 ^ l * 2 ^ K := by nlinarith + have hcoef : 2 * (2 * 2 ^ l - 1) * (2 ^ K - 1) ≤ 4 * 2 ^ l * 2 ^ K - 1 := by + zify [hp0, hT0, hp2, hp4] at hp hT ⊢ + nlinarith + have hQ : 2 * (2 * 2 ^ l - 1) * (2 ^ K - 1) * Q ≤ (4 * 2 ^ l * 2 ^ K - 1) * Q := + Nat.mul_le_mul_right Q hcoef + have hz' : 2 * (2 * 2 ^ l - 1) * phi z + 6 ≤ (2 ^ l * (z * 2 + 1)) * 2 := by + have hpz : phi z ≤ z := hphi.2.1 + zify [hp0, hp2, hpz] at hp hpz hz ⊢ + nlinarith + have h_tot : 2 * ((2 * 2 ^ l - 1) * (phi z + (2 ^ K - 1) * Q)) + 6 ≤ + (2 ^ l * (z * 2 + 1)) * 2 + (4 * 2 ^ l * 2 ^ K - 1) * Q := by + linarith + omega + +theorem split_head_narrow {h a b j : ℕ} {fs : List Sym} {k m c z e : ℕ} + (hl : Level h a b fs) (hj : j ≤ a) (hk : 3 ≤ k) (hwidth : k + 2 ≤ h) + (hi : CounterRun (ICounter k) (b + j) 1 m c) + (hg : CounterRun (GCounter k) (a - j) m z e) : + Narrow a j k z := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + by_cases hodd : z % 2 = 1 + · exact Or.inl hodd + · obtain ⟨_, ez, hm⟩ := GCounterRun_even hg (by omega) + have hpos := ICounterRun_positive hi (by decide) + right + refine ⟨by omega, ?_⟩ + have hsize := hl.level_size + by_cases hsmall : k + 3 ≤ h + · have hp : 2 ^ (2 + k) ≤ 2 ^ (h - 1) := pow2_mono (by omega) + have : 2 ^ (2 + k) = 2 ^ (1 + k) * 2 := by ring + omega + · have eh : h - 1 = 1 + k := by omega + rw [eh] at hsize + obtain ⟨em, ec⟩ := ICounterRun_linear hi (by omega) + omega + +theorem split_E_capacity {a b j n l K z q m c v e : ℕ} + (ha : 5 ≤ a) (hab : a ≤ b) (hba : b ≤ a + 1) (hj : j ≤ a) + (hn : 0 < n) (hl : 0 < l) (hK : 0 < K) (hz : 0 < z) + (he : n + j * 4 + 4 = 2 ^ l * (z * 2 + 1)) + (hcap : phi n + (2 ^ (1 + l + K) - 1) * q ≤ (a * 2 + b + 1) * 4) + (hi : CounterRun (ICounter l) (b + j) 1 m c) + (hg : CounterRun (GCounter l) (a - j) m v e) : + phi v + (2 ^ l - 1) * (phi z + (2 ^ K - 1) * q + (c + e) * 2) < + (a * 2 + b + 1) * 4 := by + have e_cap := split_capacity (phi z + (2 ^ K - 1) * q) hl hi hg + have hpn := phi_bounds hn + have hpz := phi_bounds hz + have ep : 2 ^ (1 + l + K) = 2 * 2 ^ l * 2 ^ K := by + rw [Nat.pow_add, Nat.pow_add] + rw [ep] at hcap + have hp : 2 ≤ 2 ^ l := by + have : (2 : ℕ) = 2 ^ 1 := rfl + rw [this] + exact pow2_mono (by omega) + have hQ : 2 ≤ 2 ^ K := by + have : (2 : ℕ) = 2 ^ 1 := rfl + rw [this] + exact pow2_mono (by omega) + have hp0 : 1 ≤ 2 ^ l := by omega + have hQ0 : 1 ≤ 2 ^ K := by omega + have hp2 : 1 ≤ 2 * 2 ^ l * 2 ^ K := by nlinarith + have hcoef : 2 * (2 ^ l - 1) * (2 ^ K - 1) ≤ 2 * 2 ^ l * 2 ^ K - 1 := by + zify [hp0, hQ0, hp2] at hp hQ ⊢ + nlinarith + have hq : 2 * (2 ^ l - 1) * (2 ^ K - 1) * q ≤ (2 * 2 ^ l * 2 ^ K - 1) * q := + Nat.mul_le_mul_right q hcoef + have hz' : 2 * (2 ^ l - 1) * phi z ≤ n + j * 4 + 4 := by + have hpz_le : phi z ≤ z := hpz.2.1 + zify [hp0, hpz_le] at hp hpz_le he ⊢ + nlinarith + have h_dist : 2 * ((2 ^ l - 1) * (phi z + (2 ^ K - 1) * q)) = + 2 * (2 ^ l - 1) * phi z + 2 * (2 ^ l - 1) * (2 ^ K - 1) * q := by ring + have hx : 2 * ((2 ^ l - 1) * (phi z + (2 ^ K - 1) * q)) ≤ (a * 2 + b + 1) * 4 + j * 4 + 5 := by + omega + omega + +theorem split_E_one_capacity {a b j n K z q m c e : ℕ} + (ha : 5 ≤ a) (hab : a ≤ b) (hba : b ≤ a + 1) (hj : j < a) + (hn : 0 < n) (hK : 0 < K) (hz : 0 < z) + (he : n + j * 4 + 4 = 2 * (z * 2 + 1)) + (hcap : phi n + (2 ^ (2 + K) - 1) * q ≤ (a * 2 + b + 1) * 4) + (hi : CounterRun (ICounter 1) (b + j) 1 m c) + (hg : CounterRun (GCounter 1) (a - j) m 3 e) : + phi z + (2 ^ K - 1) * q + (c + e) * 2 < (a * 2 + b + 1) * 2 := by + have hm_pos := ICounterRun_positive hi (by decide) + have e0 := ICounterRun_balance hi + have e1 := GCounterRun_balance hg (by decide) hm_pos + have hm := ICounterRun_bound hi (by decide) + have hpn := phi_bounds hn + have hpz := phi_bounds hz + have hpm := phi_bounds hm_pos + have h_21 : 2 ^ (1 + 1) - 1 = 3 := rfl + have h_20 : (2 ^ 1 - 1) * 2 = 2 := rfl + have h_phi3 : phi 3 = 3 := rfl + rw [h_21] at e0 + rw [h_20, h_phi3] at e1 + have hp_2K : 2 ^ (2 + K) = 2 ^ K * 4 := by ring + rw [hp_2K] at hcap + have hq_le : (2 ^ K - 1) * 4 * q ≤ (2 ^ K * 4 - 1) * q := + Nat.mul_le_mul_right q (by omega) + have hq_eq : (2 ^ K - 1) * 4 * q = (2 ^ K - 1) * q * 4 := by ring + omega + +theorem split_E_absorb_root {h a b j : ℕ} {fs : List Sym} {K z m c e Z C : ℕ} + {ys : List Sym} {Q : ℕ} {s : ListBlank Sym} + (hl : Level h a b fs) (hj : j < a) (hK : 0 < K) (hwidth : K + 2 ≤ h) + (hz : 0 < z) (hzbound : z < 2 ^ (1 + K)) + (hedge : K + 2 = h → a * 2 + b + 1 + j * 3 + 2 ≤ z * 4) + (hi : CounterRun (ICounter 1) (b + j) 1 m c) + (hg : CounterRun (GCounter 1) (a - j) m 3 e) + (hright : CounterRun (GCounter K) (c + e) z Z C) + (hw : Word K Z ys) (hr : Num Q s) + (hcap : phi Z + (2 ^ K - 1) * Q ≤ (a * 2 + b + 1) * 2) : + SRoot (cfg (fs +> (w ^ (j + 1) +> (ys +> s)))) := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hm := ICounterRun_positive hi (by decide) + have hmb : m < 4 := ICounterRun_bound hi (by decide) + have ei := ICounterRun_balance hi + have eg := GCounterRun_balance hg (by decide) hm + have hphi := phi_bounds hm + have h_21 : 2 ^ (1 + 1) - 1 = 3 := rfl + have h_20 : (2 ^ 1 - 1) * 2 = 2 := rfl + have h_phi3 : phi 3 = 3 := rfl + rw [h_21] at ei + rw [h_20, h_phi3] at eg + have he : a - j - 1 ≤ e := by omega + have hZ : 0 < Z := GCounterRun_positive hright hz + have hlower : Z % 2 = 0 → (a - (j + 1)) * 2 + 2 ≤ Z := by + intro heven + obtain ⟨_, eZ, _⟩ := GCounterRun_even hright heven + omega + by_cases hsmall : K + 3 ≤ h + · refine small_single_root (j := j + 1) hl (by omega) hK hsmall hZ hw hr hcap hlower ?_ + rintro rfl hfar + have hright' : CounterRun (GCounter 1) (2 + (c + e - 2)) z Z C := by + have : 2 + (c + e - 2) = c + e := by omega + rwa [this] + exact (GCounterRun_one hright' hz hzbound).1 + · have eK : K + 2 = h := by omega + have hedge' := hedge eK + refine .sroot h a b (j + 1) fs (ys +> s) hl (by omega) + (.SWord K Z Q ys s hK hZ hw hr ?_ (by omega)) + refine .SN K Z Q (by omega) (by omega) ?_ + by_cases hodd : Z % 2 = 1 + · exact Or.inl hodd + · right + refine ⟨hlower (by omega), ?_⟩ + obtain ⟨_, eZ, _⟩ := GCounterRun_even hright (by omega) + have hsize := hl.level_size + have hk_sub : h - 1 = 1 + K := by omega + rw [hk_sub] at hsize + clear hcap hw hr hright hi hg hl hlower hedge + omega + +theorem split_E_positive_closed {h a b j : ℕ} {fs : List Sym} {n l K z : ℕ} + {ys : List Sym} {q : ℕ} {r input : ListBlank Sym} + (hl : Level h a b fs) (hj : j ≤ a) (hn : 0 < n) (hlpos : 0 < l) + (hlwidth : l + 2 ≤ h) (hK : 0 < K) (hz : 0 < z) (hrank : 1 + l + K ≤ h) + (hedge : l = 1 → K + 2 = h → a * 2 + b + 1 + j * 3 + 2 ≤ z * 4) + (hy : Word K z ys) (hr : Num q r) + (he : n + j * 4 + 4 = 2 ^ l * (z * 2 + 1)) + (hcap : phi n + (2 ^ (1 + l + K) - 1) * q ≤ (a * 2 + b + 1) * 4) + (hp : P (j * 2 + 2) input ([0, 0] ^ l +> (t +> (ys +> r)))) : + ∃ out, Normal out ∧ (cfg (fs +> (w ^ j +> input))) [tm1]⊢⁺ out := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + obtain ⟨m, c, hi, hm⟩ := + CounterRun_total (ICounter_total l) (b + j) 1 (Word_bound (Word_one l)) + obtain ⟨v, e, hg, hv⟩ := + CounterRun_total (fun z' hz' => GCounter_total l z' hlpos hz') (a - j) m hm + obtain ⟨Z, C, zs, s, hright, hzs, hs, hat, hrun⟩ := + G_word_atom (c + e) hK hz hy hr + obtain ⟨xs, hx, hstep⟩ := + split_root hl.level_frame hj hlpos hp hi hg hrun + refine ⟨cfg (fs +> (w ^ j +> (xs +> (zs +> s)))), ?_, hstep⟩ + have htotal := split_E_capacity ha hab hba hj hn hlpos hK hz he hcap hi hg + have hvpos : 0 < v := GCounterRun_positive hg (ICounterRun_positive hi (by decide)) + by_cases hlarge : 3 ≤ l + · right + exact .droot h a b j fs (xs +> (zs +> s)) hl hj + (.DWord l v xs K (2 ^ K) _ (zs +> s) hlpos hvpos hx hat + (.DN l v K (2 ^ K) hlarge hlwidth (split_head_narrow hl hj hlarge hlwidth hi hg) (by omega)) + (by omega)) + · rcases l with _ | _ | _ | l' + · omega + · by_cases hedgej : j = a + · right + exact .droot h a b j fs (xs +> (zs +> s)) hl hj + (.DWord 1 v xs K (2 ^ K) _ (zs +> s) (by decide) hvpos hx hat + (.D1 v K (2 ^ K) (by omega) (Or.inl hedgej)) (by omega)) + · by_cases hv3 : v = 3 + · subst hv3 + left + have ehw := Word_max hx rfl + change xs = w at ehw + rw [ehw] + change SRoot (cfg (fs +> (w ^ j +> (w +> (zs +> s))))) + have ew : w ^ j +> (w +> (zs +> s)) = w ^ (j + 1) +> (zs +> s) := by + rw [pow_add_list w j 1, pow_one_list, append_assoc] + rw [ew] + refine split_E_absorb_root hl (by omega) hK (by omega) hz (Word_bound hy) + (hedge rfl) hi hg hright hzs hs ?_ + have hstrong := split_E_one_capacity ha hab hba (by omega) hn hK hz he hcap hi hg + have e_bal := GCounterRun_balance hright hK hz + nlinarith + · have hnear : j + 1 = a := by + by_cases hfar : j + 2 ≤ a + · have hg' : CounterRun (GCounter 1) (2 + (a - j - 2)) m v e := by + have : 2 + (a - j - 2) = a - j := by omega + rwa [this] + have := (GCounterRun_one hg' (ICounterRun_positive hi (by decide)) hm).1 + omega + · omega + have ev : v = 1 := by + by_cases heven : v % 2 = 0 + · obtain ⟨_, ev', _⟩ := GCounterRun_even hg heven + have := ICounterRun_positive hi (by decide) + change v < 4 at hv + omega + · change v < 4 at hv + omega + subst ev + right + exact .droot h a b j fs (xs +> (zs +> s)) hl hj + (.DWord 1 1 xs K (2 ^ K) _ (zs +> s) (by decide) (by decide) hx hat + (.D1 1 K (2 ^ K) (by omega) (Or.inr ⟨hnear, rfl⟩)) (by omega)) + · right + refine .droot h a b j fs (xs +> (zs +> s)) hl hj + (.DWord 2 v xs K (2 ^ K) _ (zs +> s) (by decide) hvpos hx hat ?_ (by omega)) + refine .D2 v K (2 ^ K) ?_ (by omega) ?_ + · by_cases hodd : v % 2 = 1 + · exact Or.inl hodd + · right + obtain ⟨_, ev, _⟩ := GCounterRun_even hg (by omega) + have := ICounterRun_positive hi (by decide) + omega + · right + have hsize := hl.level_size + have hpow : 2 ^ (K + 2) ≤ 2 ^ (h - 1) := pow2_mono (by omega) + have : 2 ^ (K + 2) = 2 ^ K * 4 := by ring + nlinarith + · omega + +theorem split_E_end_closed {h a b j : ℕ} {fs : List Sym} {l q : ℕ} + {r input : ListBlank Sym} + (hl : Level h a b fs) (hjpos : 0 < j) (hj : j ≤ a) (hwidth : l + 2 = h) + (hr : Num q r) (hq : q ≤ 1) + (hp : P (j * 2 + 2) input ([0, 0] ^ l +> (t +> (d +> r)))) : + ∃ out, DRoot out ∧ (cfg (fs +> (w ^ j +> input))) [tm1]⊢⁺ out := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hsize := hl.level_size + have hk_sub : h - 1 = 1 + l := by omega + rw [hk_sub] at hsize + obtain ⟨m, c, hi, hm⟩ := + CounterRun_total (ICounter_total l) (b + j) 1 (Word_bound (Word_one l)) + obtain ⟨em, ec⟩ := ICounterRun_linear hi (by omega) + subst em ec + obtain ⟨v, e, hg, hv⟩ := + CounterRun_total (fun z' hz' => GCounter_total l z' (by omega) hz') (a - j) (1 + (b + j)) hm + obtain ⟨ev, ee⟩ := GCounterRun_linear hg (by omega) + subst ee + obtain ⟨xs, hx, hstep⟩ := + split_root hl.level_frame hj (by omega) hp hi hg (.G0 (d +> r)) + refine ⟨cfg (fs +> (w ^ j +> (xs +> (d +> r)))), ?_, hstep⟩ + refine .droot h a b j fs (xs +> (d +> r)) hl hj + (.DWord l v xs 1 1 (q * 2 + 1) (d +> r) (by omega) (by omega) hx + (.AtomEnd q r hr hq) + (.DN l v 1 1 (by omega) (by omega) (split_head_narrow hl hj (by omega) (by omega) hi hg) (by + omega)) + ?_) + have hpv := phi_bounds (by omega : 0 < v) + have hp1 : 2 ^ (1 + l) = 2 ^ l * 2 := by ring + have hq3 : (2 ^ l - 1) * (q * 2 + 1) ≤ (2 ^ l - 1) * 3 := Nat.mul_le_mul_left _ (by omega) + omega + +theorem split_O_small_budget {h a b j : ℕ} {fs : List Sym} {K z m c Z C : ℕ} + (hl : Level h a b fs) (hj : j < a) (hK : 0 < K) (hwidth : K + 2 ≤ h) (hz : 0 < z) + (hedge : K + 2 = h → a * 2 + b + 1 + j * 3 + 2 ≤ z * 4) + (hi : CounterRun (ICounter 1) (a - j - 1) 1 m c) + (hg : CounterRun (GCounter K) c z Z C) (heven : Z % 2 = 0) : + 2 ^ (1 + K) ≤ Z + (b + j + 1) * 2 := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hsize := hl.level_size + obtain ⟨_, eZ, _⟩ := GCounterRun_even hg heven + by_cases hsmall : K + 3 ≤ h + · have hp : 2 ^ (2 + K) ≤ 2 ^ (h - 1) := pow2_mono (by omega) + have : 2 ^ (2 + K) = 2 ^ (1 + K) * 2 := by ring + omega + · have eK : K + 2 = h := by omega + have hedge' := hedge eK + have hk_sub : h - 1 = 1 + K := by omega + rw [hk_sub] at hsize + have ei := ICounterRun_balance hi + have hm : m < 4 := ICounterRun_bound hi (by decide) + have h_21 : 2 ^ (1 + 1) - 1 = 3 := rfl + rw [h_21] at ei + omega + +theorem split_O_positive_closed {h a b j : ℕ} {fs : List Sym} {l K z : ℕ} + {ys : List Sym} {Q : ℕ} {r input r₀ r₁ : ListBlank Sym} + (hl : Level h a b fs) (hj : j < a) (hlpos : 0 < l) (hlwidth : l + 2 ≤ h) + (hK : 0 < K) (hz : 0 < z) (hrank : 1 + l + K ≤ h) + (hedge : l = 1 → K + 2 = h → a * 2 + b + 1 + j * 3 + 2 ≤ z * 4) + (hy : Word K z ys) (hr : Num Q r) + (hcap : (2 ^ l * (z * 2 + 1)) * 2 + (2 ^ (2 + l + K) - 1) * Q ≤ + (a * 2 + b + 1) * 4 + b * 4 + j * 8 + 11) + (hin : Inner j input (t +> r₀)) (hmid : G (b + j) r₀ r₁) + (hp : P 2 r₁ ([0, 0] ^ l +> (t +> (ys +> r)))) : + ∃ out, DRoot out ∧ (cfg (fs +> (w ^ j +> input))) [tm1]⊢⁺ out := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + obtain ⟨m, c, hi, hm⟩ := + CounterRun_total (ICounter_total l) (a - j - 1) 1 (Word_bound (Word_one l)) + obtain ⟨Z, C, zs, s, hright, hzs, hs, hat, hrun⟩ := + G_word_atom c hK hz hy hr + obtain ⟨xs, hx, hstep⟩ := + split_inside hl.level_frame hj hin hmid hp hi hrun + refine ⟨cfg (fs +> (w ^ j +> (xs +> (zs +> s)))), ?_, hstep⟩ + have htotal := split_O_capacity hj hlpos hK hz hcap hi + refine .droot h a b j fs (xs +> (zs +> s)) hl (by omega) ?_ + by_cases hl1 : l = 1 + · subst hl1 + have hatom : Atom K (Nat.min (2 ^ K) (b + j + 1)) (phi z + (2 ^ K - 1) * Q + c * 2) (zs +> s) := + by + have e_bal := GCounterRun_balance hright hK hz + have h_eq : phi z + (2 ^ K - 1) * Q + c * 2 = phi Z + (2 ^ K - 1) * (Q + C * 2) := by + nlinarith + rw [h_eq] + refine .AtomWord K (Nat.min (2 ^ K) (b + j + 1)) Z (Q + C * 2) zs s + hK (GCounterRun_positive hright hz) hzs hs (Nat.min_le_left _ _) ?_ + by_cases hodd : Z % 2 = 1 + · exact Or.inl hodd + · right + by_cases hmin : 2 ^ K ≤ b + j + 1 + · have hmin_eq : Nat.min (2 ^ K) (b + j + 1) = 2 ^ K := by unfold Nat.min; omega + rw [hmin_eq] + have : 2 ^ (1 + K) = 2 ^ K * 2 := by ring + omega + · have hmin_eq : Nat.min (2 ^ K) (b + j + 1) = b + j + 1 := by unfold Nat.min; omega + rw [hmin_eq] + exact split_O_small_budget hl hj hK (by omega) hz (hedge rfl) hi hright (by omega) + exact .DWord 2 (m * 2 + 1) xs K (Nat.min (2 ^ K) (b + j + 1)) _ (zs +> s) + (by decide) (by omega) hx hatom + (.D2 (m * 2 + 1) K _ (Or.inl (by omega)) (by omega) (Or.inr (Nat.min_le_right _ _))) + (by omega) + · have hx' : Word (1 + l) (m * 2 + 1) xs := by + have : 1 + l = l + 1 := by omega + rwa [this] + refine .DWord (1 + l) (m * 2 + 1) xs K (2 ^ K) _ (zs +> s) + (by omega) (by omega) hx' hat ?_ (by omega) + by_cases hsmall : l + 3 ≤ h + · exact .DN (1 + l) (m * 2 + 1) K (2 ^ K) (by omega) (by omega) (Or.inl (by omega)) (by omega) + · have el : 1 + l = h - 1 := by omega + have hsize := hl.level_size + rw [← el] at hsize + obtain ⟨em, ec⟩ := ICounterRun_linear hi (by omega) + have hm_eq : m * 2 + 1 = (a - j) * 2 + 1 := by omega + rw [hm_eq, el] + exact .DY K (2 ^ K) (by omega) + +theorem split_O_end_closed {h a b j : ℕ} {fs : List Sym} {l q : ℕ} + {r input r₀ r₁ : ListBlank Sym} + (hl : Level h a b fs) (hj : j < a) (hwidth : l + 2 = h) + (hr : Num q r) (hq : q ≤ 1) + (hin : Inner j input (t +> r₀)) (hmid : G (b + j) r₀ r₁) + (hp : P 2 r₁ ([0, 0] ^ l +> (t +> (d +> r)))) : + ∃ out, DRoot out ∧ (cfg (fs +> (w ^ j +> input))) [tm1]⊢⁺ out := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hsize := hl.level_size + have hk_sub : h - 1 = 1 + l := by omega + rw [hk_sub] at hsize + obtain ⟨m, c, hi, hm⟩ := + CounterRun_total (ICounter_total l) (a - j - 1) 1 (Word_bound (Word_one l)) + obtain ⟨em, ec⟩ := ICounterRun_linear hi (by omega) + subst ec + obtain ⟨xs, hx, hstep⟩ := + split_inside hl.level_frame hj hin hmid hp hi (.G0 (d +> r)) + refine ⟨cfg (fs +> (w ^ j +> (xs +> (d +> r)))), ?_, hstep⟩ + have hx' : Word (h - 1) ((a - j) * 2 + 1) xs := by + have h1 : h - 1 = l + 1 := by omega + have h2 : (a - j) * 2 + 1 = m * 2 + 1 := by omega + rwa [h1, h2] + refine .droot h a b j fs (xs +> (d +> r)) hl (by omega) + (.DWord (h - 1) ((a - j) * 2 + 1) xs 1 1 (q * 2 + 1) (d +> r) + (by omega) (by omega) hx' (.AtomEnd q r hr hq) (.DY 1 1 (by decide)) ?_) + rw [phi_odd, hk_sub, ← hsize] + have hq3 : (a * 2 + b + 1 - 1) * (q * 2 + 1) ≤ (a * 2 + b + 1 - 1) * 3 := + Nat.mul_le_mul_left _ (by omega) + omega + +theorem single_y_split_closed {h a b j : ℕ} {fs : List Sym} {k : ℕ} {xs : List Sym} + {q : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hj : j < a) (hmin : h ≤ k + 1) (hmax : k ≤ h) + (heven : (a + b * 2 + j * 3 + 2) % 2 = 0) + (hw : Word (1 + k) ((a - j) * 2 + 1) xs) (hr : Num q r) + (hcap : phi ((a - j) * 2 + 1) + (2 ^ (1 + k) - 1) * q ≤ (a * 2 + b + 1) * 4) : + ∃ out, DRoot out ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ out := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hsize := hl.level_size + have hpow : a * 2 + b + 1 ≤ 2 ^ k := by + rw [hsize] + exact pow2_mono (by omega) + have hX : a + b * 2 + j * 3 + 6 < (a * 2 + b + 1) * 2 := by omega + have h_lin1 : (a - j) * 2 + 1 + (j * 2 + 2) * 2 < 2 ^ (1 + (1 + k)) := by + have : 2 ^ (1 + (1 + k)) = 2 ^ k * 4 := by ring + omega + obtain ⟨xs₀, h0, hfirst⟩ := P_word_linear (j * 2 + 2) r hw (by omega) h_lin1 + have h_eq1 : (a - j) * 2 + 1 + (j * 2 + 2) * 2 = (a + j + 2) * 2 + 1 := by omega + rw [h_eq1] at h0 + have h0' : Word (k + 1) ((a + j + 2) * 2 + 1) xs₀ := by + have : k + 1 = 1 + k := by omega + rwa [this] + obtain ⟨ys₀, hys0, rfl⟩ := Word_odd_inv h0' + have h_lin2 : a + j + 2 + (b + j) * 2 < 2 ^ (1 + k) := by + have : 2 ^ (1 + k) = 2 ^ k * 2 := by ring + omega + obtain ⟨xs₁, h1, hmid⟩ := P_word_linear (b + j) r hys0 (by omega) h_lin2 + have h_eq2 : a + j + 2 + (b + j) * 2 = a + b * 2 + j * 3 + 2 := by omega + rw [h_eq2] at h1 + have h_lin3 : a + b * 2 + j * 3 + 2 + 2 * 2 < 2 ^ (1 + k) := by + have : 2 ^ (1 + k) = 2 ^ k * 2 := by ring + omega + obtain ⟨xs₂, h2, htwo⟩ := P_word_linear 2 r h1 (by omega) h_lin3 + have h_eq3 : a + b * 2 + j * 3 + 2 + 2 * 2 = a + b * 2 + j * 3 + 6 := by omega + rw [h_eq3] at h2 + have hmark : a + b * 2 + j * 3 + 6 ≠ 2 ^ k := by + by_cases hkh : k = h + · subst hkh + have : k = (k - 1) + 1 := by omega + conv_rhs => rw [this, pow2_succ_right, ← hsize] + omega + · have ek : k = h - 1 := by omega + rw [ek, ← hsize] + omega + obtain ⟨l, K, z, ys, erank, evalue, hy, es, eone⟩ := + Word_split h2 (by omega) hmark + have hlpos : 0 < l := by + rcases l with _ | l' + · change a + b * 2 + j * 3 + 6 = 1 * (z * 2 + 1) at evalue + omega + · omega + have hz : 0 < z := by + rcases z with _ | z' + · have ep : 2 ^ l ≤ 2 ^ (h - 1) := pow2_mono (by omega) + nlinarith + · omega + have hlwidth : l + 2 ≤ h := by + by_contra hlt + have ep : 2 ^ (h - 1) ≤ 2 ^ l := pow2_mono (by omega) + nlinarith + have hq : q ≤ 1 := by + rw [phi_odd] at hcap + have : 2 ^ (1 + k) = 2 ^ k * 2 := by ring + by_contra hgt + have hq2 : (2 ^ (1 + k) - 1) * 2 ≤ (2 ^ (1 + k) - 1) * q := + Nat.mul_le_mul_left _ (by omega) + omega + rw [es] at htwo + rcases K with _ | K + · have el : l + 2 = h := by omega + have hb_hy : z < 2 := Word_bound hy + have ez : z = 1 := by omega + subst ez + have eys := Word_max hy rfl + change ys = d at eys + subst eys + exact split_O_end_closed (l := l) hl hj el hr hq + (.InnerP (by simpa only [List.append_assoc, append_assoc] using hfirst)) + (P_G hmid) (by simpa only [List.append_assoc, append_assoc] using htwo) + · refine split_O_positive_closed (l := l) (K := K + 1) (z := z) (Q := q) + hl hj hlpos hlwidth (by omega) hz (by omega) ?_ hy hr ?_ + (.InnerP (by simpa only [List.append_assoc, append_assoc] using hfirst)) + (P_G hmid) (by simpa only [List.append_assoc, append_assoc] using htwo) + · rintro rfl eK + change a + b * 2 + j * 3 + 6 = 2 * (z * 2 + 1) at evalue + omega + · have h_exp : 2 + l + (K + 1) = 1 + k := by omega + rw [h_exp, ← evalue] + rw [phi_odd] at hcap + omega + +theorem single_y_closed {k a b j : ℕ} {fs : List Sym} {K : ℕ} {xs : List Sym} + {q : ℕ} {r : ListBlank Sym} + (hl : Level (3 + k) a b fs) (hj : j ≤ a) + (hmin : 3 + k ≤ K + 1) (hmax : K ≤ 4 + k) (hinside : K < 3 + k ∨ j < a) + (hw : Word K ((a - j) * 2 + 1) xs) (hr : Num q r) + (hcap : phi ((a - j) * 2 + 1) + (2 ^ K - 1) * q ≤ (a * 2 + b + 1) * 4) : + ∃ out, Normal out ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ out := by + by_cases hK_low : K = 2 + k + · subst hK_low + obtain ⟨out, hout, hstep⟩ := single_y_low_closed hl hj hw hr hcap + exact ⟨out, Or.inl hout, hstep⟩ + · have hj' : j < a := by + rcases hinside with h1 | h2 <;> omega + by_cases hodd : (a + b * 2 + j * 3 + 2) % 2 = 1 + · have hodd0 : (a + j + 2) % 2 = 1 := by omega + by_cases hK_mid : K = 3 + k + · subst hK_mid + obtain ⟨out, hout, hstep⟩ := + single_mid_descent_closed hl hj (by omega) (by omega) (by omega) hw hr (Or.inl hodd0) hcap + exact ⟨out, Or.inl hout, hstep⟩ + · have eK : K = 4 + k := by omega + subst eK + have hsize : a * 2 + b + 1 = 2 ^ (2 + k) := by + have : 3 + k - 1 = 2 + k := by omega + rw [← this, hl.level_size] + have eq0 : q = 0 := by + rw [phi_odd] at hcap + have : 2 ^ (4 + k) = 2 ^ (2 + k) * 4 := by ring + by_contra hgt + have hq1 : (2 ^ (4 + k) - 1) * 1 ≤ (2 ^ (4 + k) - 1) * q := + Nat.mul_le_mul_left _ (by omega) + omega + subst eq0 + obtain ⟨out, hout, hstep⟩ := single_y_top_odd_closed hl hj' hodd hw hr + exact ⟨out, Or.inl hout, hstep⟩ + · have heven' : (a + b * 2 + j * 3 + 2) % 2 = 0 := by omega + rcases K with _ | K' + · omega + · have hw' : Word (1 + K') ((a - j) * 2 + 1) xs := by + have : 1 + K' = K' + 1 := by omega + rwa [this] + have hcap' : phi ((a - j) * 2 + 1) + (2 ^ (1 + K') - 1) * q ≤ (a * 2 + b + 1) * 4 := by + have : 1 + K' = K' + 1 := by omega + rwa [this] + obtain ⟨out, hout, hstep⟩ := + single_y_split_closed hl hj' (by omega) (by omega) heven' hw' hr hcap' + exact ⟨out, Or.inr hout, hstep⟩ + +theorem single_even_split_closed {h a b j : ℕ} {fs : List Sym} {k n : ℕ} + {xs : List Sym} {q : ℕ} {r : ListBlank Sym} + (hl : Level h a b fs) (hj : j ≤ a) (hmin : h ≤ k + 1) (hmax : k ≤ h) + (hn : 0 < n) (heven : n % 2 = 0) + (hlower : a * 2 + b + 1 < n + j * 4 + 4) + (hupper : n + j * 4 + 4 < (a * 2 + b + 1) * 3) + (hlinear : n + j * 4 + 4 < 2 ^ (1 + k)) + (hmarker : n + j * 4 + 4 ≠ 2 ^ k) + (hphase : k = h → a * 2 + b + 1 - j ≤ n) + (hq : k + 1 = h → q ≤ 1) + (hzero : j = 0 → n * 2 + 8 < (a * 2 + b + 1) * 3) + (hw : Word k n xs) (hr : Num q r) + (hcap : phi n + (2 ^ k - 1) * q ≤ (a * 2 + b + 1) * 4) : + ∃ out, Normal out ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ out := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hsize := hl.level_size + obtain ⟨zs, hzs, hp⟩ := P_word_linear (j * 2 + 2) r hw (by omega) (by omega) + have h_eq : n + (j * 2 + 2) * 2 = n + j * 4 + 4 := by omega + rw [h_eq] at hzs + obtain ⟨l, K, z, ys, erank, evalue, hy, es, eone⟩ := + Word_split hzs (by omega) hmarker + have hlpos : 0 < l := by + rcases l with _ | l' + · change n + j * 4 + 4 = 1 * (z * 2 + 1) at evalue + omega + · omega + have hz : 0 < z := by + rcases z with _ | z' + · have ep : 2 ^ l ≤ 2 ^ (h - 1) := pow2_mono (by omega) + nlinarith + · omega + have hlwidth : l + 2 ≤ h := by + by_contra hlt + have ep : 2 ^ (h - 1) ≤ 2 ^ l := pow2_mono (by omega) + nlinarith + rw [es] at hp + rcases K with _ | K + · have el : l + 2 = h := by omega + have hb_hy : z < 2 := Word_bound hy + have ez : z = 1 := by omega + subst ez + have eys := Word_max hy rfl + change ys = d at eys + subst eys + have hjpos : 0 < j := by + rcases j with _ | j' + · have h0 := hzero rfl + have hk_sub : h - 1 = 1 + l := by omega + rw [hk_sub] at hsize + have : 2 ^ (1 + l) = 2 ^ l * 2 := by ring + nlinarith + · omega + obtain ⟨out, hout, hstep⟩ := + split_E_end_closed hl hjpos hj el hr (hq (by omega)) + (by simpa only [List.append_assoc, append_assoc] using hp) + exact ⟨out, Or.inr hout, hstep⟩ + · refine split_E_positive_closed (n := n) (l := l) (K := K + 1) (z := z) (q := q) + hl hj hn hlpos hlwidth (by omega) hz (by omega) ?_ hy hr evalue ?_ + (by simpa only [List.append_assoc, append_assoc] using hp) + · rintro rfl eK + have hph := hphase (by omega) + change n + j * 4 + 4 = 2 * (z * 2 + 1) at evalue + omega + · have : 1 + l + (K + 1) = k := by omega + rwa [this] + +theorem single_x_low_closed {k a b j : ℕ} {fs xs : List Sym} {q : ℕ} {r : ListBlank Sym} + (hl : Level (3 + k) a b fs) (hj : j ≤ a) + (hw : Word (2 + k) (a * 2 + b + 1 - j) xs) (hr : Num q r) (hq : q ≤ 1) + (hcap : phi (a * 2 + b + 1 - j) + (2 ^ (2 + k) - 1) * q ≤ (a * 2 + b + 1) * 4) : + ∃ out, Normal out ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ out := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hsize : a * 2 + b + 1 = 2 ^ (2 + k) := by + have : 3 + k - 1 = 2 + k := by omega + rw [← this, hl.level_size] + by_cases hodd : (a * 2 + b + 1 - j) % 2 = 1 + · obtain ⟨out, hout, hstep⟩ := single_x_low_odd_closed hl hj hodd hw hr hcap + exact ⟨out, Or.inl hout, hstep⟩ + · by_cases hlate : 2 ^ (3 + k) ≤ a * 2 + b + 1 - j + j * 4 + 4 + · have hp : 2 ^ (3 + k) = 2 ^ (2 + k) * 2 := by ring + by_cases hab_eq : a = b + · subst hab_eq + have ej : j = a - 1 := by omega + subst ej + have hw' : Word ((1 + k) + 1) (a * 2 + 2) xs := by + have h1 : (1 + k) + 1 = 2 + k := by omega + have h2 : a * 2 + 2 = a * 2 + a + 1 - (a - 1) := by omega + rwa [h1, h2] + have hl' : Level (2 + (1 + k)) a a fs := by + have : 2 + (1 + k) = 3 + k := by omega + rwa [this] + obtain ⟨out, hout, hstep⟩ := + late_second_Q_recover_closed hl' hw' hr (by omega) + exact ⟨out, Or.inl hout, hstep⟩ + · have eb : b = a + 1 := by omega + subst eb + have ej : j = a := by omega + subst ej + have hw' : Word ((1 + k) + 1) (j * 2 + 2) xs := by + have h1 : (1 + k) + 1 = 2 + k := by omega + have h2 : j * 2 + 2 = j * 2 + (j + 1) + 1 - j := by omega + rwa [h1, h2] + have hl' : Level (2 + (1 + k)) j (j + 1) fs := by + have : 2 + (1 + k) = 3 + k := by omega + rwa [this] + obtain ⟨out, hout, hstep⟩ := + late_first_Q_boundary_closed hl' hw' hr hq + exact ⟨out, Or.inl hout, hstep⟩ + · refine single_even_split_closed (h := 3 + k) (k := 2 + k) (n := a * 2 + b + 1 - j) (q := q) + hl hj (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) + ?_ (by omega) (by omega) (fun _ => hq) (by omega) hw hr hcap + have : 1 + (2 + k) = 3 + k := by omega + rw [this] + omega + +theorem pow2_mod7 (n : ℕ) : 2 ^ n % 7 = 1 ∨ 2 ^ n % 7 = 2 ∨ 2 ^ n % 7 = 4 := by + induction n with + | zero => exact Or.inl rfl + | succ n ih => + have : 2 ^ (n + 1) = 2 ^ n * 2 := by ring + omega + +theorem CounterRun_unique {step : ℕ → ℕ → ℕ → Prop} + (hd : ∀ n m c m' c', step n m c → step n m' c' → m = m' ∧ c = c') + {i n m c : ℕ} (h : CounterRun step i n m c) : + ∀ {m' c'}, CounterRun step i n m' c' → m = m' ∧ c = c' := by + induction h with + | Counter0 _ => + intro m' c' h' + cases h' + exact ⟨rfl, rfl⟩ + | @CounterS i' n' m₀ z c₀ d hs _ ih => + intro m' c' h' + cases h' with + | CounterS hs' hr' => + obtain ⟨rfl, rfl⟩ := hd _ _ _ _ _ hs hs' + obtain ⟨rfl, rfl⟩ := ih hr' + exact ⟨rfl, rfl⟩ + +theorem GCounterRun_unique {k i n m c : ℕ} (h : CounterRun (GCounter k) i n m c) + {m' c' : ℕ} (h' : CounterRun (GCounter k) i n m' c') : m = m' ∧ c = c' := by + refine CounterRun_unique (fun n₀ m₁ c₁ m₂ c₂ h1 h2 => ?_) h h' + cases h1 <;> cases h2 <;> omega + +theorem pow2_mod15 (n : ℕ) : + 2 ^ n % 15 = 1 ∨ 2 ^ n % 15 = 2 ∨ 2 ^ n % 15 = 4 ∨ 2 ^ n % 15 = 8 := by + induction n with + | zero => exact Or.inl rfl + | succ n ih => + have : 2 ^ (n + 1) = 2 ^ n * 2 := by ring + omega + +def RootProgress (c : Cfg Sym Q) : Prop := + (∃ out, Normal out ∧ (c [tm1]⊢⁺ out)) ∨ NonHaltFrom tm1 c + +theorem split_O_word_closed {h a b j : ℕ} {fs : List Sym} {k x : ℕ} + {xs : List Sym} {q : ℕ} {r input r₀ : ListBlank Sym} + (hl : Level h a b fs) (hj : j < a) (hk : 0 < k) (hwidth : k + 1 ≤ h) + (heven : x % 2 = 0) (hlower : 2 ^ k < x + 4) (hupper : x + 4 < 2 ^ (1 + k)) + (hend : (x + 4) * 2 = 2 ^ k * 3 → k + 1 = h ∧ q ≤ 1) + (hw : Word k x xs) (hr : Num q r) + (hcap : (x + 4) * 2 + (2 ^ (1 + k) - 1) * q ≤ (a * 2 + b + 1) * 4 + b * 4 + j * 8 + 11) + (hin : Inner j input (t +> r₀)) (hmid : G (b + j) r₀ (xs +> r)) : + ∃ out, DRoot out ∧ (cfg (fs +> (w ^ j +> input))) [tm1]⊢⁺ out := by + obtain ⟨zs, hzs, hp⟩ := P_word_linear 2 r hw hk (by omega) + obtain ⟨l, K, z, ys, erank, evalue, hy, es, eone⟩ := + Word_split hzs (by omega) (by omega) + have hlpos : 0 < l := by + rcases l with _ | l' + · change x + 2 * 2 = 1 * (z * 2 + 1) at evalue + omega + · omega + have hz : 0 < z := by + rcases z with _ | z' + · have ep : 2 ^ l ≤ 2 ^ k := pow2_mono (by omega) + nlinarith + · omega + rw [es] at hp + rcases K with _ | K + · have hb_hy : z < 2 := Word_bound hy + have ez : z = 1 := by omega + subst ez + have eys := Word_max hy rfl + change ys = d at eys + subst eys + have hk_eq : k = 1 + l := by omega + have h_end_cond : (x + 4) * 2 = 2 ^ k * 3 := by + rw [hk_eq] + have : 2 ^ (1 + l) = 2 ^ l * 2 := by ring + omega + obtain ⟨hkh, hq⟩ := hend h_end_cond + exact split_O_end_closed (l := l) hl hj (by omega) hr hq hin hmid + (by simpa only [List.append_assoc, append_assoc] using hp) + · refine split_O_positive_closed (l := l) (K := K + 1) (z := z) (Q := q) + hl hj hlpos (by omega) (by omega) hz (by omega) (by omega) hy hr ?_ hin hmid + (by simpa only [List.append_assoc, append_assoc] using hp) + have h_exp : 2 + l + (K + 1) = 1 + k := by omega + rw [h_exp, ← evalue] + simpa only [Nat.add_assoc] using hcap + +theorem single_x_mid_closed {k a b j : ℕ} {fs xs : List Sym} {r : ListBlank Sym} + (hl : Level (3 + k) a b fs) (hj : j ≤ a) + (hw : Word (3 + k) (a * 2 + b + 1 - j) xs) (hr : Num 0 r) : + RootProgress (cfg (fs +> (w ^ j +> (xs +> r)))) := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hsize : a * 2 + b + 1 = 2 ^ (2 + k) := by + have : 3 + k - 1 = 2 + k := by omega + rw [← this, hl.level_size] + have hp4 : 2 ^ (2 + k) = 2 ^ k * 4 := by ring + have hmod := pow2_mod7 (2 + k) + rw [← hsize] at hmod + have hcap : phi (a * 2 + b + 1 - j) + (2 ^ (3 + k) - 1) * 0 ≤ (a * 2 + b + 1) * 4 := by + unfold phi; omega + by_cases heven : (a * 2 + b + 1 - j) % 2 = 0 + · by_cases hmark : a * 2 + b + 1 - j + j * 4 + 4 = 2 ^ (3 + k) + · have hp : 2 ^ (3 + k) = 2 ^ (2 + k) * 2 := by ring + have eb : b = a ∧ a = j + 1 := by + clear hmod hw hr hl hcap + omega + rcases eb with ⟨eb_eq, ea⟩ + subst b + right + refine translated_word_nonhalt (k := 3 + k) hl.level_frame ea (by omega) ?_ + have : a * 2 + 2 = a * 2 + a + 1 - j := by omega + rwa [this] + · left + have hp1 : 2 ^ (1 + (3 + k)) = 2 ^ (2 + k) * 4 := by ring + exact single_even_split_closed (h := 3 + k) (k := 3 + k) (n := a * 2 + b + 1 - j) (q := 0) + hl hj (by omega) (by omega) (by omega) heven (by omega) (by omega) + (by omega) hmark (by omega) (by omega) (by omega) hw hr hcap + · obtain ⟨u_val, eu⟩ : ∃ u_val, a * 2 + b + 1 - j + (j * 2 + 2) * 2 = u_val * 2 + 1 := + ⟨(a * 2 + b + j * 3 + 4) / 2, by omega⟩ + by_cases huodd : u_val % 2 = 1 + · obtain ⟨out, hout, hstep⟩ := + single_mid_descent_closed hl hj (by omega) (by omega) eu hw hr (Or.inl huodd) hcap + exact Or.inl ⟨out, Or.inl hout, hstep⟩ + · by_cases hsat : 2 ^ (3 + k) ≤ u_val + (b + j) * 2 + · obtain ⟨out, hout, hstep⟩ := + single_mid_descent_closed hl hj (by omega) (by omega) eu hw hr (Or.inr hsat) hcap + exact Or.inl ⟨out, Or.inl hout, hstep⟩ + · have hp : 2 ^ (3 + k) = 2 ^ (2 + k) * 2 := by ring + have hj' : j < a := by + clear hmod hw hr hl hcap + omega + by_cases hlate : 2 ^ (3 + k) ≤ u_val + (b + j) * 2 + 4 + · have h_lin_cases : u_val + (b + j) * 2 + 2 = (a * 2 + b + 1) * 2 ∨ + u_val + (b + j) * 2 + 4 = (a * 2 + b + 1) * 2 := by + clear hmod hw hr hl hcap + omega + have ecase : b = a ∧ j * 7 + 4 = a * 5 := by + clear huodd hsat hlate heven hsize hp hp4 hw hr hl hcap + omega + rcases ecase with ⟨eb_eq, ej⟩ + subst b + have hl' : Level (2 + (1 + k)) a a fs := by + have : 2 + (1 + k) = 3 + k := by omega + rwa [this] + have hw' : Word (2 + (1 + k)) (a * 3 + 1 - j) xs := by + have h1 : 2 + (1 + k) = 3 + k := by omega + have h2 : a * 3 + 1 - j = a * 2 + a + 1 - j := by omega + rwa [h1, h2] + obtain ⟨out, hout, hstep⟩ := first_Q_x_closed hl' ej hw' hr + exact Or.inl ⟨out, Or.inl hout, hstep⟩ + · have h_lin1 : a * 2 + b + 1 - j + (j * 2 + 2) * 2 < 2 ^ (1 + (3 + k)) := by + have : 2 ^ (1 + (3 + k)) = 2 ^ (2 + k) * 4 := by ring + omega + obtain ⟨bs, hbs, hp_step⟩ := P_word_linear (j * 2 + 2) r hw (by omega) h_lin1 + rw [eu] at hbs + have hbs' : Word ((2 + k) + 1) (u_val * 2 + 1) bs := by + have : (2 + k) + 1 = 3 + k := by omega + rwa [this] + obtain ⟨cs, hcs, rfl⟩ := Word_odd_inv hbs' + have h_lin2 : u_val + (b + j) * 2 < 2 ^ (1 + (2 + k)) := by + have : 1 + (2 + k) = 3 + k := by omega + rw [this] + omega + obtain ⟨ds, hds, hmid⟩ := P_word_linear (b + j) r hcs (by omega) h_lin2 + have h_upper : u_val + (b + j) * 2 + 4 < 2 ^ (1 + (2 + k)) := by + have : 1 + (2 + k) = 3 + k := by omega + rw [this] + omega + obtain ⟨out, hout, hstep⟩ := + split_O_word_closed (h := 3 + k) (k := 2 + k) (x := u_val + (b + j) * 2) (q := 0) + hl hj' (by omega) (by omega) (by omega) (by omega) h_upper + (fun _ => ⟨by omega, by omega⟩) hds hr (by omega) + (.InnerP (by simpa only [List.append_assoc, append_assoc] using hp_step)) + (P_G hmid) + exact Or.inl ⟨out, Or.inr hout, hstep⟩ + +theorem z_middle_bounds {a b j n u_val v c : ℕ} + (ha : 5 ≤ a) (hab : a ≤ b) (hba : b ≤ a + 1) (hj : j ≤ a) + (hn : n * 2 = (a * 2 + b + 1) * 2 + (a - j)) + (hu : 0 < u_val) (hub : u_val < a * 2 + b + 1) + (ev : v = u_val + (b + j) * 2) (hv : v < a * 2 + b + 1) (hevenv : v % 2 = 0) + (e : u_val * 2 + 1 + c * ((a * 2 + b) * 2) = phi n + (j * 2 + 2) * 2) + (hguard : n % 2 = 1 ∨ (a * 2 + b + 1) * 2 ≤ n + j * 4) + (hmod : (a * 2 + b + 1) % 15 = 1 ∨ (a * 2 + b + 1) % 15 = 2 ∨ + (a * 2 + b + 1) % 15 = 4 ∨ (a * 2 + b + 1) % 15 = 8) : + j < a ∧ a * 2 + b + 1 < (v + 4) * 2 ∧ v + 4 < a * 2 + b + 1 ∧ + (v + 4) * 4 ≠ (a * 2 + b + 1) * 3 := by + have hphi : phi n ≤ n := by unfold phi; omega + have hc : c ≤ 1 := by + rcases c with _ | _ | c' + · omega + · omega + · have : 2 * ((a * 2 + b) * 2) ≤ (c' + 1 + 1) * ((a * 2 + b) * 2) := + Nat.mul_le_mul_right _ (by omega) + omega + have hce : n % 2 = 0 → c = 1 := by + intro heven + rcases c with _ | c' + · unfold phi at e + omega + · omega + have hj' : j < a := by omega + have hlower : a * 2 + b + 1 < (v + 4) * 2 := by omega + have hphi_cases : (n % 2 = 1 ∧ phi n = n) ∨ (n % 2 = 0 ∧ phi n = n - 1) := by + unfold phi; omega + refine ⟨hj', hlower, ?_, ?_⟩ + · rcases c with _ | _ | c' + · rcases hphi_cases with ⟨hno, hpe⟩ | ⟨hne, hpe⟩ <;> [rw [hpe] at e; (have := hce hne; omega)] + omega + · rcases hphi_cases with ⟨hno, hpe⟩ | ⟨hne, hpe⟩ <;> rw [hpe] at e <;> omega + · omega + · rcases c with _ | _ | c' + · rcases hphi_cases with ⟨hno, hpe⟩ | ⟨hne, hpe⟩ <;> [rw [hpe] at e; (have := hce hne; omega)] + clear hmod hguard hphi hce + omega + · rcases hphi_cases with ⟨hno, hpe⟩ | ⟨hne, hpe⟩ <;> rw [hpe] at e <;> + (clear hmod hguard hphi hce; omega) + · omega + +theorem single_z_guard_closed {k a b j : ℕ} {fs : List Sym} {n : ℕ} {xs : List Sym} {r : ListBlank + Sym} + (hl : Level (3 + k) a b fs) (hj : j ≤ a) + (hn : n * 2 = (a * 2 + b + 1) * 2 + (a - j)) + (hw : Word (2 + k) n xs) (hr : Num 0 r) + (hguard : n % 2 = 1 ∨ 2 ^ (3 + k) ≤ n + j * 4) : + ∃ out, Normal out ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ out := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hsize : a * 2 + b + 1 = 2 ^ (2 + k) := by + have : 3 + k - 1 = 2 + k := by omega + rw [← this, hl.level_size] + have hnpos : 0 < n := by omega + have hcap : phi n + (2 ^ (2 + k) - 1) * 0 ≤ (a * 2 + b + 1) * 4 := by + have := phi_bounds hnpos + omega + have hguard1 : n % 2 = 1 ∨ 2 ^ (1 + (2 + k)) ≤ n + j * 4 := by + have : 1 + (2 + k) = 3 + k := by omega + rwa [this] + obtain ⟨u_val, c₀, hu, hub, h0⟩ := + counter_inner_total (2 + k) j n (by omega) (Word_bound hw) hguard1 + have hub' : u_val < 2 ^ (1 + (1 + k)) := by + have : 1 + (1 + k) = 2 + k := by omega + rwa [this] + obtain ⟨v, c₁, h1, hvb⟩ := CounterRun_total + (fun z' hz' => GCounter_total (1 + k) z' (by omega) hz') (b + j) u_val hub' + by_cases hodd : v % 2 = 1 + · have hready : ∀ u' v' c₀' c₁', + CounterRun (GCounter (2 + k)) (j * 2 + 2) n (u' * 2 + 1) c₀' → + CounterRun (GCounter (1 + k)) (b + j) u' v' c₁' → v' % 2 = 1 := by + intro u' v' c₀' c₁' h0' h1' + obtain ⟨eu, _⟩ := GCounterRun_unique h0 h0' + have hu_eq : u' = u_val := by omega + subst hu_eq + obtain ⟨rfl, _⟩ := GCounterRun_unique h1 h1' + exact hodd + obtain ⟨out, hout, hstep⟩ := + single_low_descent_closed hl hj hnpos hw hr hguard hready hcap + exact ⟨out, Or.inl hout, hstep⟩ + · obtain ⟨rfl, ev, huo⟩ := GCounterRun_even h1 (by omega) + have e := GCounterRun_balance h0 (by omega) hnpos + rw [phi_odd] at e + have hmod := pow2_mod15 (2 + k) + rw [← hsize] at hmod + have h_sub : 2 ^ (2 + k) - 1 = a * 2 + b := by omega + have e' : u_val * 2 + 1 + c₀ * ((a * 2 + b) * 2) = phi n + (j * 2 + 2) * 2 := by + rw [h_sub] at e + exact e + have hguard' : n % 2 = 1 ∨ (a * 2 + b + 1) * 2 ≤ n + j * 4 := by + have : 2 ^ (3 + k) = 2 ^ (2 + k) * 2 := by ring + omega + have hvb' : v < a * 2 + b + 1 := by + have : 1 + (1 + k) = 2 + k := by omega + rw [this, ← hsize] at hvb + exact hvb + obtain ⟨hj', hlower, hupper, hend⟩ := + z_middle_bounds ha hab hba hj hn hu (by omega) ev hvb' (by omega) e' hguard' hmod + obtain ⟨s, hs, htail⟩ := G_nums c₀ hr + obtain ⟨bs, hbs, hin⟩ := counter_inner hw (by omega) hguard1 h0 htail + have hbs' : Word ((1 + k) + 1) (u_val * 2 + 1) bs := by + have : (1 + k) + 1 = 2 + k := by omega + rwa [this] + obtain ⟨cs, hcs, rfl⟩ := Word_odd_inv hbs' + obtain ⟨ds, hds, hmid⟩ := G_counter_run hcs (by omega) h1 (.G0 s) + have h_low_pow : 2 ^ (1 + k) < v + 4 := by + have : 2 ^ (2 + k) = 2 ^ (1 + k) * 2 := by ring + omega + have h_up_pow : v + 4 < 2 ^ (1 + (1 + k)) := by + have : 1 + (1 + k) = 2 + k := by omega + rw [this, ← hsize] + exact hupper + have h_end_imp : (v + 4) * 2 = 2 ^ (1 + k) * 3 → (1 + k) + 1 = 3 + k ∧ 0 + c₀ * 2 ≤ 1 := by + intro heq + exfalso + have : 2 ^ (2 + k) = 2 ^ (1 + k) * 2 := by ring + omega + have h_cap_word : (v + 4) * 2 + (2 ^ (1 + (1 + k)) - 1) * (0 + c₀ * 2) ≤ + (a * 2 + b + 1) * 4 + b * 4 + j * 8 + 11 := by + have : 1 + (1 + k) = 2 + k := by omega + rw [this, h_sub] + have hphi : phi n ≤ n := by unfold phi; omega + clear hmod hguard hguard1 hguard' hcap hw hr h0 h1 htail hin hmid hbs hbs' hcs hds hs + rcases c₀ with _ | _ | c₀' + · omega + · omega + · have : 2 * ((a * 2 + b) * 2) ≤ (c₀' + 1 + 1) * ((a * 2 + b) * 2) := + Nat.mul_le_mul_right _ (by omega) + omega + obtain ⟨out, hout, hstep⟩ := + split_O_word_closed (h := 3 + k) (k := 1 + k) (x := v) (q := 0 + c₀ * 2) + hl hj' (by omega) (by omega) (by omega) h_low_pow h_up_pow h_end_imp + hds hs h_cap_word + (by simpa only [List.append_assoc, append_assoc] using hin) hmid + exact ⟨out, Or.inr hout, hstep⟩ + +theorem single_z_closed {k a b j : ℕ} {fs : List Sym} {n : ℕ} {xs : List Sym} {r : ListBlank Sym} + (hl : Level (3 + k) a b fs) (hj : j ≤ a) + (hn : n * 2 = (a * 2 + b + 1) * 2 + (a - j)) + (hw : Word (2 + k) n xs) (hr : Num 0 r) : + ∃ out, Normal out ∧ (cfg (fs +> (w ^ j +> (xs +> r)))) [tm1]⊢⁺ out := by + obtain ⟨hh, ha, hab, hba⟩ := Level_bounds hl + have hsize : a * 2 + b + 1 = 2 ^ (2 + k) := by + have : 3 + k - 1 = 2 + k := by omega + rw [← this, hl.level_size] + have hp4 : 2 ^ (2 + k) = 2 ^ k * 4 := by ring + by_cases hodd : n % 2 = 1 + · exact single_z_guard_closed hl hj hn hw hr (Or.inl hodd) + · by_cases hguard : 2 ^ (3 + k) ≤ n + j * 4 + · exact single_z_guard_closed hl hj hn hw hr (Or.inr hguard) + · by_cases hend : 2 ^ (3 + k) ≤ n + j * 4 + 4 + · have hmod := pow2_mod7 (2 + k) + rw [← hsize] at hmod + have hp : 2 ^ (3 + k) = 2 ^ (2 + k) * 2 := by ring + have h_lin_cases : n + j * 4 + 2 = (a * 2 + b + 1) * 2 ∨ + n + j * 4 + 4 = (a * 2 + b + 1) * 2 := by + clear hmod hw hr hl + omega + have ecase : b = a + 1 ∧ j * 7 = a * 5 := by + clear hodd hguard hend hsize hp hp4 hw hr hl + omega + rcases ecase with ⟨eb_eq, ej⟩ + subst b + obtain ⟨out, hout, hstep⟩ := late_first_Q_z_closed hl ej (by omega) hw hr + exact ⟨out, Or.inl hout, hstep⟩ + · have hp : 2 ^ (1 + (2 + k)) = 2 ^ (3 + k) := by + have : 1 + (2 + k) = 3 + k := by omega + rw [this] + have hpn := phi_bounds (by omega : 0 < n) + exact single_even_split_closed (h := 3 + k) (k := 2 + k) (n := n) (q := 0) + hl hj (by omega) (by omega) (by omega) (by omega) (by omega) (by omega) + (by omega) (by omega) (by omega) (by omega) (by omega) hw hr (by omega) + +theorem root_progress_single {c : Cfg Sym Q} (h : ∃ out, SRoot out ∧ (c [tm1]⊢⁺ out)) : + RootProgress c := by + obtain ⟨out, hout, hstep⟩ := h + exact Or.inl ⟨out, Or.inl hout, hstep⟩ + +theorem single_root_progress {c : Cfg Sym Q} (hs_root : SRoot c) : RootProgress c := by + rcases hs_root with ⟨h, a, b, j, fs, r, hl, hj, hs⟩ + have hh := hl.level_height + rcases h with _ | _ | _ | k + · omega + · omega + · omega + · have hl' : Level (3 + k) a b fs := by + have : 3 + k = k + 3 := by omega + rwa [this] + cases hs with + | SNum n r hr hbound => + exact root_progress_single (pure_closed hl' hj hr hbound) + | SWord K n q xs r hK hn hw hr hp hcap => + cases hp with + | SN K n q hK3 hwidth hguard => + exact root_progress_single (narrow_closed hl' hj hK3 (by omega) hn hw hr hguard hcap) + | S2 n q hphase => + have h_22 : 2 ^ 2 - 1 = 3 := rfl + rw [h_22] at hcap + exact root_progress_single (two_closed hl' hj hn hw hr hphase hcap) + | S1 n q hpos => + have h_21 : 2 ^ 1 - 1 = 1 := rfl + rw [h_21, Nat.one_mul] at hcap + rcases hpos with rfl | ⟨hnear, rfl, hq⟩ + · exact root_progress_single (one_boundary_closed hl' hn hw hr hcap) + · exact root_progress_single (one_neighbor_closed hl' hnear hw hr hq) + | SX K q hcases => + rcases hcases with ⟨eK, hq⟩ | ⟨rfl, rfl⟩ | ⟨rfl, ej, eb, rfl⟩ + · have eK' : K = 2 + k := by omega + subst eK' + exact Or.inl (single_x_low_closed hl' hj hw hr hq hcap) + · have hw' : Word (3 + k) (a * 2 + b + 1 - j) xs := by + have : 3 + k = k + 3 := by omega + rwa [this] + exact single_x_mid_closed hl' hj hw' hr + · subst b j + have hw' : Word (4 + k) (a * 2 + 1) xs := by + have h1 : 4 + k = k + 3 + 1 := by omega + have h2 : a * 2 + 1 = a * 2 + a + 1 - a := by omega + rwa [h1, h2] + exact root_progress_single (single_x_top_closed hl' hw' hr) + | SY K q hmin hmax hinside => + exact Or.inl (single_y_closed hl' hj (by omega) (by omega) (by omega) hw hr hcap) + | SZ n hn_eq => + have hw' : Word (2 + k) n xs := by + have : 2 + k = k + 3 - 1 := by omega + rwa [this] + exact Or.inl (single_z_closed hl' hj hn_eq hw' hr) + +theorem normal_nonhalt {c : Cfg Sym Q} (hc : Normal c) : NonHaltFrom tm1 c := by + refine nonHaltFrom_of_progress (Inv := fun x => Normal x ∨ NonHaltFrom tm1 x) ?_ (Or.inl hc) + intro x hx + have hp : RootProgress x := by + rcases hx with (hs | hd) | hnh + · exact single_root_progress hs + · exact Or.inl (double_progress hd) + · exact Or.inr hnh + rcases hp with ⟨y, hy, hstep⟩ | hnh + · exact ⟨y, hstep, Or.inl hy⟩ + · have hsome := hnh x ⟨0, rfl⟩ + rcases hst : step tm1 x with _ | y + · rw [hst] at hsome; cases hsome + · refine ⟨y, ⟨1, by decide, hst⟩, Or.inr (fun z ⟨m, hm⟩ => ?_)⟩ + refine hnh z ⟨1 + m, ?_⟩ + rw [BusyBeaver.multiStep_add, show multiStep tm1 x 1 = + step tm1 x from rfl, hst, Option.bind_some] + exact hm + +theorem initial_level : Level 5 5 5 (prefix_word 3) := + ⟨frame_spec 3, by decide, rfl⟩ + +theorem initial_root : SRoot (cfg (prefix_word 3 +> (t ^ 4 +> default))) := by + have h_eq : prefix_word 3 +> (t ^ 4 +> (default : ListBlank Sym)) = + prefix_word 3 +> (w ^ 0 +> (t +> (t +> (t +> (t +> default))))) := rfl + rw [h_eq] + refine .sroot 5 5 5 0 (prefix_word 3) _ initial_level (by decide) + (.SNum 15 _ (.Num10 7 (.Num10 3 (.Num10 1 (.Num10 0 .Num0)))) (by decide)) + +theorem initial2_root : + SRoot (cfg (prefix_word 3 +> (word 3 11 +> ([0, 0, 1, 0] +> default)))) := by + have h_eq : prefix_word 3 +> (word 3 11 +> ([0, 0, 1, 0] +> (default : ListBlank Sym))) = + prefix_word 3 +> (w ^ 0 +> (word 3 11 +> ([0, 0] +> (t +> default)))) := rfl + rw [h_eq] + exact .sroot 5 5 5 0 (prefix_word 3) _ initial_level (by decide) + (.SWord 3 11 2 (word 3 11) _ (by decide) (by decide) + (word_spec 3 11 (by decide)) (.Num00 1 (.Num10 0 .Num0)) + (.SN 3 11 2 (by decide) (by decide) (Or.inl rfl)) (by decide)) + +theorem initial3_root : + SRoot (cfg (prefix_word 3 +> (word 2 5 +> ([0, 0, 1, 0, 1, 0] +> default)))) := by + have h_eq : prefix_word 3 +> (word 2 5 +> ([0, 0, 1, 0, 1, 0] +> (default : ListBlank Sym))) = + prefix_word 3 +> (w ^ 0 +> (word 2 5 +> ([0, 0] +> (t +> (t +> default))))) := rfl + rw [h_eq] + exact .sroot 5 5 5 0 (prefix_word 3) _ initial_level (by decide) + (.SWord 2 5 6 (word 2 5) _ (by decide) (by decide) + (word_spec 2 5 (by decide)) (.Num00 3 (.Num10 1 (.Num10 0 .Num0))) + (.S2 5 6 (Or.inl rfl)) (by decide)) + + + +def mapCfg (f : Q → Q) (c : Cfg Sym Q) : Cfg Sym Q := + ⟨c.q.map f, c.tape⟩ + +theorem nonHaltFrom_of_stepStar {M : Machine Sym Q} {c₁ c₂ : Cfg Sym Q} + (h₁ : c₁ [M]⊢* c₂) (h₂ : NonHaltFrom M c₂) : NonHaltFrom M c₁ := by + obtain ⟨k₀, hk₀⟩ := h₁ + intro cfg ⟨k, hk⟩ + rcases Nat.lt_or_ge k k₀ with hlt | hge + · rcases hstep_cfg : step M cfg with _ | _ + · have hnone : (step M cfg).isNone := by simp [hstep_cfg] + have hnone_k₀ : multiStep M c₁ k₀ = none := by + have hsplit : k₀ = k + (k₀ - k) := by omega + rw [hsplit] + exact multiStep_eq_none_of_isNone hk hnone (by omega) + rw [hnone_k₀] at hk₀ + cases hk₀ + · rfl + · have hsplit : k = k₀ + (k - k₀) := by omega + rw [hsplit, BusyBeaver.multiStep_add, hk₀, Option.bind_some] at hk + exact h₂ cfg ⟨k - k₀, hk⟩ + +end BusyBeaver.LongitudinalCascade diff --git a/BusyBeaver/Calculi/RleCarryData.lean b/BusyBeaver/Calculi/RleCarryData.lean new file mode 100644 index 00000000..e579aea0 --- /dev/null +++ b/BusyBeaver/Calculi/RleCarryData.lean @@ -0,0 +1,367 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.RleCarryEngine + +/-! +# Run-Length Encoded Carry Data (`BusyBeaver.Calculi.RleCarryData`) + +Precomputed run-length encoded tape patterns and check-point configurations +for multi-digit carry-propagation engines. +-/ + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.RleCarryEngine + +def machine521 : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LB_0LC0RE_1LA1LD_0LB1RF_1RA1RD_HHH1LC" + +abbrev tm521 : Machine (Fin 2) (Fin 6) := machine521.toBB + +set_option maxRecDepth 4000000 in +instance : HasRleCarryRules tm521 where + carry_Z := fun l r => + ⟨54, + Counter.wmultiStep_sound (tm := tm521) 54 ⟨B, 1, [0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, + 1, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + carry_P := fun l r => + ⟨18, + Counter.wmultiStep_sound (tm := tm521) 18 ⟨B, 1, [0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, + 1, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + carry_PMUTM := fun l r => + ⟨78, + Counter.wmultiStep_sound (tm := tm521) 78 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, + 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, + 1]⟩ l r rfl⟩ + carry_PTTW := fun l r => + ⟨120, + Counter.wmultiStep_sound (tm := tm521) 120 ⟨B, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, + 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, + 1]⟩ l r rfl⟩ + carry_PTTT := fun l r => + ⟨84, + Counter.wmultiStep_sound (tm := tm521) 84 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, + 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, + 1]⟩ l r rfl⟩ + carry_PTTTM := fun l r => + ⟨99, + Counter.wmultiStep_sound (tm := tm521) 99 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, + 0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, + 1, 1, 0, 1]⟩ l r rfl⟩ + turn_UM := fun r => + ⟨61, + Counter.cmultiStep_sound (tm := tm521) 61 ⟨B, 1, [0, 1, 1, 0, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, + 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1], []⟩ r rfl⟩ + turn_UMT := fun r => + ⟨97, + Counter.cmultiStep_sound (tm := tm521) 97 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 0, 1], [0, 1, 0, 0, 1, + 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1], []⟩ r rfl⟩ + turn_ZT := fun l r => + ⟨61, + Counter.wmultiStep_sound (tm := tm521) 61 ⟨B, 1, [0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, + 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_WM := fun l r => + ⟨55, + Counter.wmultiStep_sound (tm := tm521) 55 ⟨B, 1, [0, 1, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, + 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_PT := fun l r => + ⟨115, + Counter.wmultiStep_sound (tm := tm521) 115 ⟨B, 1, [0, 1, 1, 1, 0, 1, 0, 0, 1, 1], [0, 1, 0, 0, + 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_ZM := fun l r => + ⟨55, + Counter.wmultiStep_sound (tm := tm521) 55 ⟨B, 1, [0, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, + 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + turn_PTW := fun l r => + ⟨141, + Counter.wmultiStep_sound (tm := tm521) 141 ⟨B, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1], + [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1], []⟩ l r rfl⟩ + turn_PTM := fun l r => + ⟨97, + Counter.wmultiStep_sound (tm := tm521) 97 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1], [0, + 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_PTT := fun l r => + ⟨103, + Counter.wmultiStep_sound (tm := tm521) 103 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1], + [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1], []⟩ l r rfl⟩ + turn_ZMU := fun l r => + ⟨111, + Counter.wmultiStep_sound (tm := tm521) 111 ⟨B, 1, [0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, + 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_ZTM := fun l r => + ⟨121, + Counter.wmultiStep_sound (tm := tm521) 121 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [0, + 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_ZTT := fun l r => + ⟨127, + Counter.wmultiStep_sound (tm := tm521) 127 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1], + [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_ZTW := fun l r => + ⟨127, + Counter.wmultiStep_sound (tm := tm521) 127 ⟨B, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1], + [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_MUTW := fun l r => + ⟨141, + Counter.wmultiStep_sound (tm := tm521) 141 ⟨B, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1], [0, + 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + turn_PTTM := fun l r => + ⟨163, + Counter.wmultiStep_sound (tm := tm521) 163 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, + 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1], + []⟩ l r rfl⟩ + turn_ZTTW := fun l r => + ⟨163, + Counter.wmultiStep_sound (tm := tm521) 163 ⟨B, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, + 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], + []⟩ l r rfl⟩ + turn_ZTTM := fun l r => + ⟨109, + Counter.wmultiStep_sound (tm := tm521) 109 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, + 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], + []⟩ l r rfl⟩ + turn_ZPMU := fun l r => + ⟨163, + Counter.wmultiStep_sound (tm := tm521) 163 ⟨B, 1, [0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, + 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], + []⟩ l r rfl⟩ + turn_ZMUTM := fun l r => + ⟨157, + Counter.wmultiStep_sound (tm := tm521) 157 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, + 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], + []⟩ l r rfl⟩ + turn_PTTTW := fun l r => + ⟨205, + Counter.wmultiStep_sound (tm := tm521) 205 ⟨B, 1, [0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, + 1, 1, 0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, + 0, 1, 1, 1], []⟩ l r rfl⟩ + carry_MU_to_pmuCfg := fun l r => + ⟨17, + Counter.wmultiStep_sound (tm := tm521) 17 ⟨B, 1, [0, 1, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, + 0, 1]⟩ + ⟨D, 1, [], [1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + pmu_step := fun l r => + ⟨60, + Counter.wmultiStep_sound (tm := tm521) 60 ⟨D, 1, [0, 1, 0, 0, 1, 1], [1, 0, 0, 1, 0, 0, 1, 1, + 0, 1]⟩ + ⟨D, 1, [], [1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + pmuCfg_Z_turn := fun l r => + ⟨38, + Counter.wmultiStep_sound (tm := tm521) 38 ⟨D, 1, [0, 0, 0, 0, 1, 1], [1, 0, 0, 1, 0, 0, 1, 1, + 0, 1, 1, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + pmuCfg_M_to_carry := fun l r => + ⟨7, + Counter.wmultiStep_sound (tm := tm521) 7 ⟨D, 1, [0, 1, 1], [1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [0, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + pmuCfg_T_to_carry := fun l r => + ⟨7, + Counter.wmultiStep_sound (tm := tm521) 7 ⟨D, 1, [0, 1, 1, 1], [1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + carry_PTU := fun l r => + ⟨30, + Counter.wmultiStep_sound (tm := tm521) 30 ⟨B, 1, [0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1], [0, 1, + 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + turn_PTMT := fun l r => + ⟨163, + Counter.wmultiStep_sound (tm := tm521) 163 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, + 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1], + []⟩ l r rfl⟩ + turn_ZTTT := fun l r => + ⟨163, + Counter.wmultiStep_sound (tm := tm521) 163 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, + 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], + []⟩ l r rfl⟩ + turn_ZTTTM := fun l r => + ⟨145, + Counter.wmultiStep_sound (tm := tm521) 145 ⟨B, 1, [0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, + 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, + 0, 1, 1], []⟩ l r rfl⟩ + turn_ZTU_halt := fun l r => + ⟨_, ⟨33, + Counter.wmultiStep_sound (tm := tm521) 33 ⟨B, 1, [0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, + 0, 0, 1, 0, 0, 1, 1, 0, 1]⟩ + ⟨F, 0, [1, 1, 0, 1, 1, 0, 1, 1, 1], [0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1]⟩ l r rfl⟩, rfl⟩ + r0_Z := fun l r => + ⟨12, + Counter.wmultiStep_sound (tm := tm521) 12 ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 1, + 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + r0_P := fun l r => + ⟨48, + Counter.wmultiStep_sound (tm := tm521) 48 ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [0, 0, 1, + 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + r0_PTTTM_TAIL := fun l r => + ⟨15, + Counter.wmultiStep_sound (tm := tm521) 15 ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 1, + 0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + r1_Z := fun l r => + ⟨12, + Counter.wmultiStep_sound (tm := tm521) 12 ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], + [1, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + r1_P := fun l r => + ⟨68, + Counter.wmultiStep_sound (tm := tm521) 68 ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], + [0, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + r1OddShort_Z := fun l r => + ⟨12, + Counter.wmultiStep_sound (tm := tm521) 12 ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 1, 1, 0, 1]⟩ + ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + r1Odd_P := fun l r => + ⟨10, + Counter.wmultiStep_sound (tm := tm521) 10 ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], + [0, 0, 1, 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + wSweep_start := fun l => + ⟨2, + Counter.rcmultiStep_sound (tm := tm521) 2 ⟨B, 0, [1, 1], []⟩ + ⟨D, 1, [], [1]⟩ l rfl⟩ + wSweep_step := fun l r => + ⟨6, + Counter.wmultiStep_sound (tm := tm521) 6 ⟨D, 1, [0, 0, 1, 1], [1]⟩ + ⟨D, 1, [], [1, 0, 0, 1, 1]⟩ l r rfl⟩ + dSweep_step := fun l r => + ⟨6, + Counter.wmultiStep_sound (tm := tm521) 6 ⟨E, 1, [0, 1, 1], [0, 0, 1, 1]⟩ + ⟨E, 1, [0, 1, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + dSweep_end := fun l => + ⟨5, + Counter.rcmultiStep_sound (tm := tm521) 5 ⟨E, 1, [0, 1, 1], []⟩ + ⟨B, 0, [1, 1, 0, 0, 1, 1], []⟩ l rfl⟩ + tSweep_step := fun l r => + ⟨24, + Counter.wmultiStep_sound (tm := tm521) 24 ⟨E, 0, [0, 0, 0, 0, 1, 1], [0, 0, 1, 1]⟩ + ⟨E, 0, [0, 0, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + tSweep_end := fun l => + ⟨2, + Counter.rcmultiStep_sound (tm := tm521) 2 ⟨E, 0, [0, 0, 0, 0, 1, 1], []⟩ + ⟨B, 0, [1, 1, 0, 0, 0, 0, 1, 1], []⟩ l rfl⟩ + r0_to_dSweep := fun l r => + ⟨6, + Counter.wmultiStep_sound (tm := tm521) 6 ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 1, + 1]⟩ + ⟨E, 1, [0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + r1_to_dSweep := fun l r => + ⟨6, + Counter.wmultiStep_sound (tm := tm521) 6 ⟨E, 0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], + [1, 0, 1, 1]⟩ + ⟨E, 1, [0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + r1Odd_to_tSweep := fun l r => + ⟨10, + Counter.wmultiStep_sound (tm := tm521) 10 ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], + [1, 0, 1, 1]⟩ + ⟨E, 0, [0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], []⟩ l r rfl⟩ + wSweep_Z_to_dSweep := fun l r => + ⟨11, + Counter.wmultiStep_sound (tm := tm521) 11 ⟨D, 1, [0, 0, 0, 0, 1, 1], [1]⟩ + ⟨E, 1, [0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + wSweep_ZT_to_dSweep := fun l r => + ⟨53, + Counter.wmultiStep_sound (tm := tm521) 53 ⟨D, 1, [0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 0, 1, + 1]⟩ + ⟨E, 1, [0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + wSweep_PT_to_carry := fun l r => + ⟨40, + Counter.wmultiStep_sound (tm := tm521) 40 ⟨D, 1, [0, 1, 1, 1, 0, 1, 0, 0, 1, 1], [1, 0, 0, 1, + 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1]⟩ l r rfl⟩ + wSweep_ZMT_to_tSweep := fun l r => + ⟨77, + Counter.wmultiStep_sound (tm := tm521) 77 ⟨D, 1, [0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1], [1, + 0, 0, 1, 1]⟩ + ⟨E, 0, [0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + cfgR_Z_to_TW := fun l => + ⟨18, + Counter.rcmultiStep_sound (tm := tm521) 18 ⟨B, 0, [1, 1, 0, 0, 0, 0, 1, 1], []⟩ + ⟨B, 0, [1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l rfl⟩ + cfgR_TW_to_t3Cfg := fun l => + ⟨30, + Counter.rcmultiStep_sound (tm := tm521) 30 ⟨B, 0, [1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 1, 0, 1, 1]⟩ l rfl⟩ + t3_step := fun l r => + ⟨66, + Counter.wmultiStep_sound (tm := tm521) 66 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1], [0, 1, + 0, 0, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1]⟩ l r rfl⟩ + t3Cfg_Z_zero_to_carry := fun l => + ⟨120, + Counter.rcmultiStep_sound (tm := tm521) 120 ⟨B, 1, [0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 1, 0, + 1, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1]⟩ l rfl⟩ + t3Cfg_Z_succ_to_r0 := fun l r => + ⟨37, + Counter.wmultiStep_sound (tm := tm521) 37 ⟨B, 1, [0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 1, 0, 1, + 1, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1], []⟩ l r rfl⟩ + t3Cfg_TZ_to_r1OddShort := fun l r => + ⟨51, + Counter.wmultiStep_sound (tm := tm521) 51 ⟨B, 1, [0, 1, 1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, + 1]⟩ + ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + r1OddShortCfg_evalWK0_to_carry := fun l => + ⟨180, + Counter.rcmultiStep_sound (tm := tm521) 180 ⟨B, 1, [1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 1, 1]⟩ + ⟨B, 1, [], [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1]⟩ l rfl⟩ + t3Cfg_TTZ_to_r0 := fun l r => + ⟨79, + Counter.wmultiStep_sound (tm := tm521) 79 ⟨B, 1, [0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1], + [0, 1, 0, 0, 1]⟩ + ⟨E, 0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1], []⟩ l r rfl⟩ + +def ckptRle_0 : Rle := + [([.Z], 6), ([.M], 1), ([.T], 1), ([.Z], 4), ([.P], 5), ([.Z], 1), ([.U], 1)] + +def initRle : Rle := + pushToksLtr [.U, .M, .Z, .Z, .P, .T, .M, .Z, .Z] [] + +set_option maxRecDepth 4000000 in +theorem runCarryTruncChunks_ckpt0 : + runCarryTruncChunks [3746, 3999, 4000, 4000, 4000, 4000, 4000, 3298] 30 ckptRle_0 1 = true := by + decide +kernel + +set_option maxRecDepth 4000000 in +theorem runCarryChunks_28_500 : + runCarryChunks 28 500 initRle 1 = true := by + decide +kernel + +end BusyBeaver.RleCarryEngine diff --git a/BusyBeaver/Calculi/RleCarryEngine.lean b/BusyBeaver/Calculi/RleCarryEngine.lean new file mode 100644 index 00000000..880fe9e2 --- /dev/null +++ b/BusyBeaver/Calculi/RleCarryEngine.lean @@ -0,0 +1,3236 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter + +/-! +# Run-Length Encoded Carry Engine (`BusyBeaver.Calculi.RleCarryEngine`) + +Verification engine for unbounded carry propagation using run-length +compressed tape blocks and inductive checkpoint stepping. +-/ + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver Counter + +namespace BusyBeaver.RleCarryEngine + +inductive Tok + | U | M | W | Z | T | P | PTTTM_TAIL + deriving DecidableEq, Repr + +inductive Mode + | R0 | R1 | R1_ODD + deriving DecidableEq, Repr + +abbrev Rle := List (List Tok × Nat) + +def tokEq (a b : Tok) : Bool := + Tok.casesOn a + (Tok.casesOn b true false false false false false false) + (Tok.casesOn b false true false false false false false) + (Tok.casesOn b false false true false false false false) + (Tok.casesOn b false false false true false false false) + (Tok.casesOn b false false false false true false false) + (Tok.casesOn b false false false false false true false) + (Tok.casesOn b false false false false false false true) + +def modeEq (a b : Mode) : Bool := + Mode.casesOn a + (Mode.casesOn b true false false) + (Mode.casesOn b false true false) + (Mode.casesOn b false false true) + +def wordEq (l1 l2 : List Tok) : Bool := + List.rec + (fun l2 => List.casesOn l2 true (fun _ _ => false)) + (fun a _ ih l2 => + List.casesOn l2 false (fun b bs => + Bool.casesOn (tokEq a b) false (ih bs))) + l1 l2 + +def isZpTok (t : Tok) : Bool := + Tok.casesOn t false false false true false true false + +def isZpWord (l : List Tok) : Bool := + List.rec true (fun t _ ih => Bool.casesOn (isZpTok t) false ih) l + +def strictNat {α : Type} (n : Nat) (k : Nat → α) : α := + Nat.casesOn (Nat.add n 1) (k 0) (fun m => k m) + +def strictTok {α : Type} (t : Tok) (k : Tok → α) : α := + Tok.casesOn t (k .U) (k .M) (k .W) (k .Z) (k .T) (k .P) (k .PTTTM_TAIL) + +def strictWord {α : Type} (w : List Tok) (k : List Tok → α) : α := + List.rec + (fun k => k []) + (fun t _ ih k => strictTok t (fun t' => ih (fun ts' => k (t' :: ts')))) + w k + +theorem tokEq_iff (a b : Tok) : tokEq a b = true ↔ a = b := by + cases a <;> cases b <;> decide + +theorem modeEq_iff (a b : Mode) : modeEq a b = true ↔ a = b := by + cases a <;> cases b <;> decide + +theorem wordEq_iff : ∀ (w1 w2 : List Tok), wordEq w1 w2 = true ↔ w1 = w2 + | [], [] => by decide + | [], _ :: _ => by simp [wordEq] + | _ :: _, [] => by simp [wordEq] + | a :: as, b :: bs => by + change Bool.casesOn (tokEq a b) false (wordEq as bs) = true ↔ a :: as = b :: bs + cases h : tokEq a b + · simp only [Bool.false_eq_true, false_iff, List.cons.injEq, not_and] + intro hab _ + exact Bool.false_ne_true (h.symm.trans ((tokEq_iff a b).mpr hab)) + · simp [(tokEq_iff a b).mp h, wordEq_iff as bs] + +@[simp] theorem strictNat_eq {α : Type} (n : Nat) (k : Nat → α) : + strictNat n k = k n := rfl + +@[simp] theorem strictTok_eq {α : Type} (t : Tok) (k : Tok → α) : + strictTok t k = k t := by + cases t <;> rfl + +@[simp] theorem strictWord_eq : ∀ {α : Type} (w : List Tok) (k : List Tok → α), + strictWord w k = k w + | _, [], _ => rfl + | _, t :: ts, k => by + change strictTok t (fun t' => strictWord ts (fun ts' => k (t' :: ts'))) = k (t :: ts) + rw [strictTok_eq, strictWord_eq ts] + +@[simp] theorem isZpWord_nil : isZpWord [] = true := rfl + +@[simp] theorem isZpWord_cons (t : Tok) (ts : List Tok) : + isZpWord (t :: ts) = (isZpTok t && isZpWord ts) := by + change Bool.casesOn (isZpTok t) false (isZpWord ts) = (isZpTok t && isZpWord ts) + cases isZpTok t <;> rfl + +def revWord : List Tok → List Tok + | [] => [] + | t :: ts => revWord ts ++ [t] + +@[simp] theorem revWord_nil : revWord [] = [] := rfl +@[simp] theorem revWord_cons (t : Tok) (ts : List Tok) : revWord (t :: ts) = revWord ts ++ [t] := + rfl + +@[simp] theorem revWord_append (w₁ w₂ : List Tok) : + revWord (w₁ ++ w₂) = revWord w₂ ++ revWord w₁ := by + induction w₁ with + | nil => simp + | cons t ts ih => simp [ih, List.append_assoc] + +@[simp] theorem revWord_revWord (w : List Tok) : revWord (revWord w) = w := by + induction w with + | nil => rfl + | cons t ts ih => simp [ih] + +@[simp] theorem isZpWord_append (w₁ w₂ : List Tok) : + isZpWord (w₁ ++ w₂) = (isZpWord w₁ && isZpWord w₂) := by + induction w₁ with + | nil => simp + | cons t ts ih => simp [ih, Bool.and_assoc] + +@[simp] theorem isZpWord_revWord (w : List Tok) : + isZpWord (revWord w) = isZpWord w := by + induction w with + | nil => rfl + | cons t ts ih => + simp [isZpWord_append, ih, Bool.and_comm] + +def tokL : Tok → List (Fin 2) + | .U => [0, 1] + | .M => [0, 1, 1] + | .W => [0, 0, 1, 1] + | .Z => [0, 0, 0, 0, 1, 1] + | .T => [0, 1, 1, 1] + | .P => [0, 1, 0, 0, 1, 1] + | .PTTTM_TAIL => [] + +def tokR : Tok → List (Fin 2) + | .Z => [1, 0, 1, 1, 0, 1] + | .P => [0, 0, 1, 1, 0, 1] + | .PTTTM_TAIL => [1, 0, 1, 0, 0, 1, 1, 0, 1] + | _ => [] + +def wordL : List Tok → List (Fin 2) := encWords tokL +def wordR : List Tok → List (Fin 2) := encWords tokR + +@[simp] theorem wordL_nil : wordL [] = [] := encWords_nil tokL +@[simp] theorem wordL_cons (t : Tok) (ts : List Tok) : wordL (t :: ts) = tokL t ++ wordL ts := + encWords_cons tokL t ts +@[simp] theorem wordL_append (w₁ w₂ : List Tok) : wordL (w₁ ++ w₂) = wordL w₁ ++ wordL w₂ := + encWords_append tokL w₁ w₂ +@[simp] theorem wordR_nil : wordR [] = [] := encWords_nil tokR +@[simp] theorem wordR_cons (t : Tok) (ts : List Tok) : wordR (t :: ts) = tokR t ++ wordR ts := + encWords_cons tokR t ts +@[simp] theorem wordR_append (w₁ w₂ : List Tok) : wordR (w₁ ++ w₂) = wordR w₁ ++ wordR w₂ := + encWords_append tokR w₁ w₂ + +def evalRleAux (l_tail : ListBlank (Fin 2)) : Rle → ListBlank (Fin 2) + | [] => l_tail + | (w, c) :: rest => ((wordL w) ^ c) +> evalRleAux l_tail rest + +section WithTail +variable {l_tail : ListBlank (Fin 2)} +local notation "evalRle" => evalRleAux l_tail + +def evalRStack : Rle → ListBlank (Fin 2) → ListBlank (Fin 2) + | [], r_end => r_end + | (w, c) :: rest, r_end => ((wordR (revWord w)) ^ c) +> evalRStack rest r_end + +@[simp] theorem evalRle_nil : evalRle [] = l_tail := rfl +@[simp] theorem evalRle_cons (w : List Tok) (c : Nat) (rest : Rle) : + evalRle ((w, c) :: rest) = ((wordL w) ^ c) +> evalRle rest := rfl + +@[simp] theorem evalRStack_nil (r_end : ListBlank (Fin 2)) : evalRStack [] r_end = r_end := rfl +@[simp] theorem evalRStack_cons (w : List Tok) (c : Nat) (rest : Rle) (r_end : ListBlank (Fin 2)) : + evalRStack ((w, c) :: rest) r_end = ((wordR (revWord w)) ^ c) +> evalRStack rest r_end := rfl + +def pushRlePosK {α : Type} (w : List Tok) (c : Nat) (rle : Rle) (k : Rle → α) : α := + List.casesOn rle (k [(w, c)]) (fun p rest => + Prod.casesOn p (fun w' c' => + Bool.casesOn (wordEq w w') + (k ((w, c) :: (w', c') :: rest)) + (strictNat (Nat.add c c') fun s => k ((w, s) :: rest)))) + +def pushRleK {α : Type} (w : List Tok) (c : Nat) (rle : Rle) (k : Rle → α) : α := + Bool.casesOn (Nat.beq c 0) + (pushRlePosK w c rle k) + (k rle) + +def pushRlePos (w : List Tok) (c : Nat) (rle : Rle) : Rle := + pushRlePosK w c rle (fun r => r) + +def pushRle (w : List Tok) (c : Nat) (rle : Rle) : Rle := + pushRleK w c rle (fun r => r) + +@[simp] theorem pushRlePosK_eq {α : Type} (w : List Tok) (c : Nat) (rle : Rle) (k : Rle → α) : + pushRlePosK w c rle k = k (pushRlePos w c rle) := by + cases rle with + | nil => rfl + | cons p rest => + rcases p with ⟨w', c'⟩ + unfold pushRlePos; unfold pushRlePosK; dsimp -failIfUnchanged only + cases wordEq w w' <;> rfl + +@[simp] theorem pushRleK_eq {α : Type} (w : List Tok) (c : Nat) (rle : Rle) (k : Rle → α) : + pushRleK w c rle k = k (pushRle w c rle) := by + unfold pushRle; unfold pushRleK + cases Nat.beq c 0 + · exact pushRlePosK_eq w c rle k + · rfl + +@[simp] theorem evalRle_pushRlePos (w : List Tok) (c : Nat) (rle : Rle) : + evalRle (pushRlePos w c rle) = ((wordL w) ^ c) +> evalRle rle := by + cases rle with + | nil => rfl + | cons p rest => + rcases p with ⟨w', c'⟩ + unfold pushRlePos; unfold pushRlePosK; dsimp -failIfUnchanged only + cases hw : wordEq w w' + · rfl + · rw [(wordEq_iff w w').mp hw] + change ((wordL w') ^ (c + c')) +> evalRle rest = ((wordL w') ^ c) +> (((wordL w') ^ c') +> + evalRle rest) + rw [list_pow_add, listblank_append_assoc] + +@[simp] theorem evalRle_pushRle (w : List Tok) (c : Nat) (rle : Rle) : + evalRle (pushRle w c rle) = ((wordL w) ^ c) +> evalRle rle := by + unfold pushRle; unfold pushRleK + cases hc : Nat.beq c 0 + · exact evalRle_pushRlePos w c rle + · rw [Nat.beq_eq.mp hc]; simp + +@[simp] theorem evalRStack_pushRlePos (w : List Tok) (c : Nat) (rs : Rle) (r_end : ListBlank + (Fin 2)) : + evalRStack (pushRlePos w c rs) r_end = ((wordR (revWord w)) ^ c) +> evalRStack rs r_end := by + cases rs with + | nil => rfl + | cons p rest => + rcases p with ⟨w', c'⟩ + unfold pushRlePos; unfold pushRlePosK; dsimp -failIfUnchanged only + cases hw : wordEq w w' + · rfl + · rw [(wordEq_iff w w').mp hw] + change ((wordR (revWord w')) ^ (c + c')) +> evalRStack rest r_end = + ((wordR (revWord w')) ^ c) +> (((wordR (revWord w')) ^ c') +> evalRStack rest r_end) + rw [list_pow_add, listblank_append_assoc] + +@[simp] theorem evalRStack_pushRle (w : List Tok) (c : Nat) (rs : Rle) (r_end : ListBlank (Fin 2)) : + evalRStack (pushRle w c rs) r_end = ((wordR (revWord w)) ^ c) +> evalRStack rs r_end := by + unfold pushRle; unfold pushRleK + cases hc : Nat.beq c 0 + · exact evalRStack_pushRlePos w c rs r_end + · rw [Nat.beq_eq.mp hc]; simp + +def pushToksLtr (ts : List Tok) (rle : Rle) : Rle := + List.rec + (fun rle => rle) + (fun t _ ih rle => pushRlePosK [t] 1 rle (fun rle' => ih rle')) + ts rle + +@[simp] theorem pushToksLtr_nil (rle : Rle) : pushToksLtr [] rle = rle := rfl +@[simp] theorem pushToksLtr_cons (t : Tok) (ts : List Tok) (rle : Rle) : + pushToksLtr (t :: ts) rle = pushToksLtr ts (pushRlePos [t] 1 rle) := by + change pushRlePosK [t] 1 rle (fun rle' => pushToksLtr ts rle') = pushToksLtr ts + (pushRlePos [t] 1 rle) + rw [pushRlePosK_eq] + +@[simp] theorem evalRle_pushToksLtr : ∀ (ts : List Tok) (rle : Rle), + evalRle (pushToksLtr ts rle) = wordL (revWord ts) +> evalRle rle + | [], rle => rfl + | t :: ts, rle => by + simp [pushToksLtr_cons, evalRle_pushToksLtr ts, wordL_append, pow_succ_list, + listblank_append_assoc] + +def popLastTok (rle : Rle) : Option (Tok × Rle) := + List.casesOn rle none (fun p rest => + Prod.casesOn p (fun w c => + List.casesOn w none (fun t ts => + List.casesOn ts + (Bool.casesOn (Nat.beq c 1) + (Bool.casesOn (Nat.beq c 0) + (strictNat (Nat.sub c 1) fun cm1 => some (t, ([t], cm1) :: rest)) + none) + (some (t, rest))) + (fun t2 ts2 => + Bool.casesOn (Nat.beq c 1) + (Bool.casesOn (Nat.beq c 0) + (strictNat (Nat.sub c 1) fun cm1 => + pushRlePosK (t2 :: ts2) 1 ((t :: t2 :: ts2, cm1) :: rest) fun rOut => some (t, + rOut)) + none) + (pushRlePosK (t2 :: ts2) 1 rest fun rOut => some (t, rOut)))))) + +theorem popLastTok_sound (rle : Rle) (t : Tok) (rle' : Rle) + (h : popLastTok rle = some (t, rle')) : + evalRle rle = tokL t +> evalRle rle' := by + cases rle with + | nil => nomatch h + | cons p rest => + rcases p with ⟨w, c⟩ + cases w with + | nil => nomatch h + | cons t0 ts => + cases c with + | zero => cases ts <;> nomatch h + | succ c' => + cases ts with + | nil => + cases c' with + | zero => + change some (t0, rest) = some (t, rle') at h + injection h with h'; injection h' with ht hr; subst ht hr + simp [pow_succ_list] + | succ c'' => + change some (t0, ([t0], c'' + 1) :: rest) = some (t, rle') at h + injection h with h'; injection h' with ht hr; subst ht hr + simp [pow_succ_list] + | cons t2 ts2 => + cases c' with + | zero => + change pushRlePosK (t2 :: ts2) 1 rest (fun rOut => some (t0, rOut)) = some (t, + rle') at h + rw [pushRlePosK_eq] at h + injection h with h'; injection h' with ht hr; subst ht hr + simp [pow_succ_list] + | succ c'' => + change pushRlePosK (t2 :: ts2) 1 ((t0 :: t2 :: ts2, c'' + 1) :: rest) + (fun rOut => some (t0, rOut)) = some (t, rle') at h + rw [pushRlePosK_eq] at h + injection h with h'; injection h' with ht hr; subst ht hr + simp [pow_succ_list] + +def popTok (t_exp : Tok) (rle : Rle) : Option Rle := + Option.casesOn (popLastTok rle) none (fun p => + Prod.casesOn p (fun t rle' => + Bool.casesOn (tokEq t t_exp) none (some rle'))) + +theorem popTok_sound (t_exp : Tok) (rle rle' : Rle) (h : popTok t_exp rle = some rle') : + evalRle rle = tokL t_exp +> evalRle rle' := by + unfold popTok at h + cases hp : popLastTok rle with + | none => rw [hp] at h; nomatch h + | some p => + rcases p with ⟨t, r⟩ + rw [hp] at h; dsimp -failIfUnchanged only at h + cases ht : tokEq t t_exp + · rw [ht] at h; nomatch h + · rw [ht] at h; injection h with hr; subst hr + rw [← (tokEq_iff t t_exp).mp ht] + exact popLastTok_sound rle t r hp + +def popToks (ts : List Tok) (rle : Rle) : Option Rle := + List.rec + (fun rle => some rle) + (fun t _ ih rle => + Option.casesOn (popTok t rle) none (fun rle' => ih rle')) + ts rle + +theorem popToks_sound : ∀ (ts : List Tok) (rle rle' : Rle), + popToks ts rle = some rle' → + evalRle rle = wordL ts +> evalRle rle' + | [], rle, rle', h => by + injection h with hr; subst hr; rfl + | t :: ts, rle, rle', h => by + change Option.casesOn (popTok t rle) none (fun r1 => popToks ts r1) = some rle' at h + cases h1 : popTok t rle with + | none => rw [h1] at h; nomatch h + | some r1 => + rw [h1] at h; dsimp -failIfUnchanged only at h + rw [popTok_sound t rle r1 h1, popToks_sound ts r1 rle' h, wordL_cons, listblank_append_assoc] + +def popTokCount (fuel : Nat) (t_exp : Tok) (acc : Nat) (rle : Rle) : Nat × Rle := + Nat.rec + (fun acc rle => (acc, rle)) + (fun _ ih acc rle => + List.casesOn rle (acc, []) (fun p rest => + Prod.casesOn p (fun w c => + List.casesOn w (acc, ([], c) :: rest) (fun t ts => + Bool.casesOn (tokEq t t_exp) + (acc, (t :: ts, c) :: rest) + (Bool.casesOn (Nat.beq c 0) + (List.casesOn ts + (strictNat (Nat.add acc c) fun acc' => ih acc' rest) + (fun t2 ts2 => + strictNat (Nat.add acc 1) fun acc' => + Bool.casesOn (Nat.beq c 1) + (strictNat (Nat.sub c 1) fun cm1 => + pushRlePosK (t2 :: ts2) 1 ((t :: t2 :: ts2, cm1) :: rest) fun rOut => + ih acc' rOut) + (pushRlePosK (t2 :: ts2) 1 rest fun rOut => + ih acc' rOut))) + (acc, (t :: ts, c) :: rest)))))) + fuel acc rle + +theorem popTokCount_succ_cons (fuel : Nat) (t_exp : Tok) (acc : Nat) (t : Tok) (ts : List Tok) + (c : Nat) (rest : Rle) : + popTokCount (fuel + 1) t_exp acc ((t :: ts, c) :: rest) = + if tokEq t t_exp then + if c == 0 then (acc, (t :: ts, c) :: rest) + else match ts with + | [] => popTokCount fuel t_exp (acc + c) rest + | t2 :: ts2 => + if c == 1 then popTokCount fuel t_exp (acc + 1) (pushRlePos (t2 :: ts2) 1 rest) + else popTokCount fuel t_exp (acc + 1) (pushRlePos (t2 :: ts2) 1 ((t :: t2 :: ts2, + c - 1) :: rest)) + else (acc, (t :: ts, c) :: rest) := by + unfold popTokCount; dsimp -failIfUnchanged only + cases tokEq t t_exp + · rfl + · cases c with + | zero => rfl + | succ c' => + cases ts with + | nil => rfl + | cons t2 ts2 => + cases c' <;> simp only [strictNat_eq, pushRlePosK_eq] <;> rfl + +theorem popTokCount_sound : ∀ (fuel : Nat) (t_exp : Tok) (acc : Nat) (rle : Rle), + acc ≤ (popTokCount fuel t_exp acc rle).1 ∧ + ((tokL t_exp) ^ acc) +> evalRle rle = + ((tokL t_exp) ^ (popTokCount fuel t_exp acc rle).1) +> evalRle + (popTokCount fuel t_exp acc rle).2 + | 0, _, acc, _ => ⟨Nat.le_refl acc, rfl⟩ + | fuel + 1, t_exp, acc, [] => ⟨Nat.le_refl acc, rfl⟩ + | fuel + 1, t_exp, acc, ([], c) :: rest => ⟨Nat.le_refl acc, rfl⟩ + | fuel + 1, t_exp, acc, (t :: ts, c) :: rest => by + rw [popTokCount_succ_cons] + cases ht : tokEq t t_exp + · simp + · simp only [↓reduceIte] + rw [(tokEq_iff t t_exp).mp ht] + cases c with + | zero => simp + | succ c' => + have hc0 : (c' + 1 == 0) = false := rfl + rw [hc0]; simp only [Bool.false_eq_true, ↓reduceIte] + cases ts with + | nil => + rcases popTokCount_sound fuel t_exp (acc + (c' + 1)) rest with ⟨hle, heq⟩ + refine ⟨Nat.le_trans (Nat.le_add_right acc (c' + 1)) hle, ?_⟩ + rw [← heq] + change ((tokL t_exp) ^ acc) +> (((wordL [t_exp]) ^ (c' + 1)) +> evalRle rest) = + ((tokL t_exp) ^ (acc + (c' + 1))) +> evalRle rest + have hw : wordL [t_exp] = tokL t_exp := List.append_nil _ + rw [hw, ← listblank_append_assoc, ← list_pow_add] + | cons t2 ts2 => + cases c' with + | zero => + simp only [beq_self_eq_true, ↓reduceIte] + rcases popTokCount_sound fuel t_exp (acc + 1) (pushRlePos + (t2 :: ts2) 1 rest) with ⟨hle, heq⟩ + refine ⟨Nat.le_trans (Nat.le_add_right acc 1) hle, ?_⟩ + rw [← heq, pow_succ_right (tokL t_exp) acc] + simp [pow_succ_list, listblank_append_assoc] + | succ c'' => + have hc1 : (c'' + 1 + 1 == 1) = false := rfl + rw [hc1]; simp only [Bool.false_eq_true, ↓reduceIte, Nat.add_sub_cancel] + rcases popTokCount_sound fuel t_exp (acc + 1) + (pushRlePos (t2 :: ts2) 1 ((t_exp :: t2 :: ts2, c'' + 1) :: rest)) with ⟨hle, heq⟩ + refine ⟨Nat.le_trans (Nat.le_add_right acc 1) hle, ?_⟩ + rw [← heq, pow_succ_right (tokL t_exp) acc] + simp [pow_succ_list, listblank_append_assoc] + + +-- ============================================================================ +-- Section 6.4: Named Configurations & 59 Verified Micro-Step Lemmas +-- ============================================================================ + +def evalWK (k1 : Nat) : ListBlank (Fin 2) := + [1, 0, 1, 1] +> ((([0, 0, 1, 1] : List (Fin 2)) ^ k1) +> default) + + +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 + +def qBOf (tm : Machine (Fin 2) (Fin 6)) : Fin 6 := + match tm A 1 with + | some (some s, _) => if s == B then B else D + | _ => B + +def qDOf (tm : Machine (Fin 2) (Fin 6)) : Fin 6 := + match tm A 1 with + | some (some s, _) => if s == B then D else A + | _ => D + +def cfgR (tm : Machine (Fin 2) (Fin 6)) (l : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some (qBOf tm), ⟨0, [1, 1] +> l, default⟩⟩ + +def carryCfg (tm : Machine (Fin 2) (Fin 6)) (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some (qBOf tm), ⟨1, l, [0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1] +> r⟩⟩ + +def r0Cfg (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some E, ⟨0, [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1] +> l, r⟩⟩ + +def r1Cfg (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some E, ⟨0, [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1] +> l, r⟩⟩ + +def r1OddShortCfg (tm : Machine (Fin 2) (Fin 6)) (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some (qBOf tm), ⟨1, [1, 1, 0, 0, 0, 0, 1, 1] +> l, r⟩⟩ + +def r1OddCfg (tm : Machine (Fin 2) (Fin 6)) (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + r1OddShortCfg tm (tokL .Z +> l) r + +def wSweepCfg (tm : Machine (Fin 2) (Fin 6)) (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some (qDOf tm), ⟨1, l, [1] +> r⟩⟩ + +def dSweepCfg (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some E, ⟨1, [0, 1, 1] +> l, r⟩⟩ + +def tSweepCfg (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some E, ⟨0, [0, 0, 0, 0, 1, 1] +> l, r⟩⟩ + +def t3Cfg (tm : Machine (Fin 2) (Fin 6)) (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some (qBOf tm), ⟨1, l, [0, 1, 0, 0, 1] +> r⟩⟩ + +def pmuCfg (tm : Machine (Fin 2) (Fin 6)) (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + ⟨some (qDOf tm), ⟨1, l, [1, 0, 0, 1, 0, 0, 1, 1, 0, 1] +> r⟩⟩ + +class HasRleCarryRules (target_tm : Machine (Fin 2) (Fin 6)) : Prop where + carry_Z : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .Z +> l) r) [target_tm]⊢* (carryCfg target_tm l (tokR .Z +> r)) + carry_P : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .P +> l) r) [target_tm]⊢* (carryCfg target_tm l (tokR .P +> r)) + carry_PMUTM : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .M +> (tokL .T +> (tokL .U +> (tokL .M +> (tokL .P +> + l))))) r) [target_tm]⊢* (carryCfg target_tm l (((tokR .Z) ^ 2) +> (tokR .P +> r))) + carry_PTTW : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .W +> (((tokL .T) ^ 2) +> (tokL .P +> l))) r) [target_tm]⊢* + (carryCfg target_tm l (((tokR .Z) ^ 3) +> r)) + carry_PTTT : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (((tokL .T) ^ 3) +> (tokL .P +> l)) r) [target_tm]⊢* (carryCfg target_tm l + (((tokR .Z) ^ 2) +> (tokR .P +> r))) + carry_PTTTM : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .M +> (((tokL .T) ^ 3) +> (tokL .P +> l))) r) [target_tm]⊢* + (carryCfg target_tm l (((tokR .Z) ^ 2) +> (tokR .PTTTM_TAIL +> r))) + turn_UM : ∀ (r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .M +> (tokL .U +> default)) r) [target_tm]⊢* (r1Cfg (tokL .M +> + (tokL .U +> default)) r) + turn_UMT : ∀ (r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .T +> (tokL .M +> (tokL .U +> default))) r) [target_tm]⊢* (r1Cfg + (tokL .Z +> (tokL .U +> default)) r) + turn_ZT : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .T +> (tokL .Z +> l)) r) [target_tm]⊢* (r1Cfg (tokL .M +> (tokL .T +> + l)) r) + turn_WM : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .M +> (tokL .W +> l)) r) [target_tm]⊢* (r1Cfg (tokL .T +> l) r) + turn_PT : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .T +> (tokL .P +> l)) r) [target_tm]⊢* (r0Cfg (tokL .P +> (tokL .T +> + l)) r) + turn_ZM : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .M +> (tokL .Z +> l)) r) [target_tm]⊢* (r1Cfg (tokL .P +> l) r) + turn_PTW : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .W +> (tokL .T +> (tokL .P +> l))) r) [target_tm]⊢* + (r1OddCfg target_tm (tokL .Z +> (tokL .U +> (tokL .M +> l))) r) + turn_PTM : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .M +> (tokL .T +> (tokL .P +> l))) r) [target_tm]⊢* (r1Cfg (tokL .Z +> + (tokL .T +> l)) r) + turn_PTT : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .T +> (tokL .T +> (tokL .P +> l))) r) [target_tm]⊢* (r1Cfg (tokL .Z +> + (tokL .U +> (tokL .M +> l))) r) + turn_ZMU : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .U +> (tokL .M +> (tokL .Z +> l))) r) [target_tm]⊢* + (r1OddCfg target_tm (tokL .T +> (tokL .T +> l)) r) + turn_ZTM : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .M +> (tokL .T +> (tokL .Z +> l))) r) [target_tm]⊢* (r0Cfg (tokL .P +> + (tokL .M +> (tokL .T +> l))) r) + turn_ZTT : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .T +> (tokL .T +> (tokL .Z +> l))) r) [target_tm]⊢* (r0Cfg (tokL .P +> + (tokL .W +> (tokL .T +> l))) r) + turn_ZTW : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .W +> (tokL .T +> (tokL .Z +> l))) r) [target_tm]⊢* (r0Cfg (tokL .Z +> + (tokL .W +> (tokL .T +> l))) r) + turn_MUTW : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .W +> (tokL .T +> (tokL .U +> (tokL .M +> l)))) r) [target_tm]⊢* + (r1OddCfg target_tm (tokL .Z +> (tokL .T +> l)) r) + turn_PTTM : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .M +> (tokL .T +> (tokL .T +> (tokL .P +> l)))) r) [target_tm]⊢* + (r0Cfg (tokL .P +> (tokL .Z +> (tokL .U +> (tokL .M +> l)))) r) + turn_ZTTW : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .W +> (tokL .T +> (tokL .T +> (tokL .Z +> l)))) r) [target_tm]⊢* + (r0Cfg (tokL .Z +> (tokL .Z +> (tokL .P +> l))) r) + turn_ZTTM : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .M +> (tokL .T +> (tokL .T +> (tokL .Z +> l)))) r) [target_tm]⊢* + (r1Cfg (tokL .Z +> (tokL .W +> (tokL .T +> l))) r) + turn_ZPMU : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .U +> (tokL .M +> (tokL .P +> (tokL .Z +> l)))) r) [target_tm]⊢* + (r0Cfg (tokL .P +> (tokL .M +> (tokL .W +> (tokL .T +> l)))) r) + turn_ZMUTM : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .M +> (tokL .T +> (tokL .U +> (tokL .M +> (tokL .Z +> + l))))) r) [target_tm]⊢* (r0Cfg (tokL .P +> (tokL .Z +> (tokL .P +> l))) r) + turn_PTTTW : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .W +> (tokL .T +> (tokL .T +> (tokL .T +> (tokL .P +> + l))))) r) [target_tm]⊢* (r0Cfg (tokL .Z +> (tokL .Z +> (tokL .Z +> (tokL .T +> l)))) r) + carry_MU_to_pmuCfg : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .U +> (tokL .M +> l)) r) [target_tm]⊢* (pmuCfg target_tm l (tokR .P +> + r)) + pmu_step : ∀ (l r : ListBlank (Fin 2)) , + (pmuCfg target_tm (tokL .P +> l) r) [target_tm]⊢* (pmuCfg target_tm l (tokR .Z +> r)) + pmuCfg_Z_turn : ∀ (l r : ListBlank (Fin 2)) , + (pmuCfg target_tm (tokL .Z +> l) (tokR .Z +> r)) [target_tm]⊢* (r0Cfg (tokL .M +> (tokL .W +> + (tokL .T +> l))) r) + pmuCfg_M_to_carry : ∀ (l r : ListBlank (Fin 2)) , + (pmuCfg target_tm (tokL .M +> l) r) [target_tm]⊢* (carryCfg target_tm (tokL .U +> l) r) + pmuCfg_T_to_carry : ∀ (l r : ListBlank (Fin 2)) , + (pmuCfg target_tm (tokL .T +> l) r) [target_tm]⊢* (carryCfg target_tm (tokL .M +> l) r) + carry_PTU : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .U +> (tokL .T +> (tokL .P +> l))) r) [target_tm]⊢* + (carryCfg target_tm (tokL .Z +> l) (tokR .P +> r)) + turn_PTMT : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .T +> (tokL .M +> (tokL .T +> (tokL .P +> l)))) r) [target_tm]⊢* + (r0Cfg (tokL .P +> (tokL .Z +> (tokL .U +> (tokL .M +> l)))) r) + turn_ZTTT : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .T +> (tokL .T +> (tokL .T +> (tokL .Z +> l)))) r) [target_tm]⊢* + (r0Cfg (tokL .P +> (tokL .Z +> (tokL .P +> l))) r) + turn_ZTTTM : ∀ (l r : ListBlank (Fin 2)) , + (carryCfg target_tm (tokL .M +> (tokL .T +> (tokL .T +> (tokL .T +> (tokL .Z +> + l))))) r) [target_tm]⊢* (r1Cfg (tokL .Z +> (tokL .Z +> (tokL .P +> l))) r) + turn_ZTU_halt : ∀ (l r : ListBlank (Fin 2)) , + ∃ cfg', ((carryCfg target_tm (tokL .U +> (tokL .T +> (tokL .Z +> l))) r) [target_tm]⊢* cfg') ∧ + (step target_tm cfg').isNone + r0_Z : ∀ (l r : ListBlank (Fin 2)) , + (r0Cfg l (tokR .Z +> r)) [target_tm]⊢* (r0Cfg (tokL .Z +> l) r) + r0_P : ∀ (l r : ListBlank (Fin 2)) , + (r0Cfg l (tokR .P +> r)) [target_tm]⊢* (r0Cfg (tokL .P +> l) r) + r0_PTTTM_TAIL : ∀ (l r : ListBlank (Fin 2)) , + (r0Cfg l (tokR .PTTTM_TAIL +> r)) [target_tm]⊢* (r1Cfg (tokL .Z +> l) r) + r1_Z : ∀ (l r : ListBlank (Fin 2)) , + (r1Cfg l (tokR .Z +> r)) [target_tm]⊢* (r0Cfg (tokL .M +> (tokL .Z +> l)) r) + r1_P : ∀ (l r : ListBlank (Fin 2)) , + (r1Cfg l (tokR .P +> r)) [target_tm]⊢* (r1OddCfg target_tm (tokL .P +> l) r) + r1OddShort_Z : ∀ (l r : ListBlank (Fin 2)) , + (r1OddShortCfg target_tm l (tokR .Z +> r)) [target_tm]⊢* (r1OddShortCfg target_tm (tokL .Z +> + l) r) + r1Odd_P : ∀ (l r : ListBlank (Fin 2)) , + (r1OddCfg target_tm l (tokR .P +> r)) [target_tm]⊢* (r1Cfg (tokL .Z +> l) r) + wSweep_start : ∀ (l : ListBlank (Fin 2)) , + (cfgR target_tm l) [target_tm]⊢* (wSweepCfg target_tm l default) + wSweep_step : ∀ (l r : ListBlank (Fin 2)) , + (wSweepCfg target_tm (tokL .W +> l) r) [target_tm]⊢* (wSweepCfg target_tm l ([0, 0, 1, 1] +> r)) + dSweep_step : ∀ (l r : ListBlank (Fin 2)) , + (dSweepCfg l ([0, 0, 1, 1] +> r)) [target_tm]⊢* (dSweepCfg (tokL .W +> l) r) + dSweep_end : ∀ (l : ListBlank (Fin 2)) , + (dSweepCfg l default) [target_tm]⊢* (cfgR target_tm (tokL .W +> l)) + tSweep_step : ∀ (l r : ListBlank (Fin 2)) , + (tSweepCfg l ([0, 0, 1, 1] +> r)) [target_tm]⊢* (tSweepCfg (tokL .T +> l) r) + tSweep_end : ∀ (l : ListBlank (Fin 2)) , + (tSweepCfg l default) [target_tm]⊢* (cfgR target_tm (tokL .Z +> l)) + r0_to_dSweep : ∀ (l r : ListBlank (Fin 2)) , + (r0Cfg l ([1, 0, 1, 1] +> r)) [target_tm]⊢* (dSweepCfg (tokL .Z +> (tokL .Z +> l)) r) + r1_to_dSweep : ∀ (l r : ListBlank (Fin 2)) , + (r1Cfg l ([1, 0, 1, 1] +> r)) [target_tm]⊢* (dSweepCfg (tokL .Z +> (tokL .M +> (tokL .Z +> + l))) r) + r1Odd_to_tSweep : ∀ (l r : ListBlank (Fin 2)) , + (r1OddCfg target_tm l ([1, 0, 1, 1] +> r)) [target_tm]⊢* (tSweepCfg (tokL .Z +> (tokL .Z +> + l)) r) + wSweep_Z_to_dSweep : ∀ (l r : ListBlank (Fin 2)) , + (wSweepCfg target_tm (tokL .Z +> l) r) [target_tm]⊢* (dSweepCfg (tokL .T +> l) r) + wSweep_ZT_to_dSweep : ∀ (l r : ListBlank (Fin 2)) , + (wSweepCfg target_tm (tokL .T +> (tokL .Z +> l)) ([0, 0, 1, 1] +> r)) [target_tm]⊢* (dSweepCfg + (tokL .Z +> (tokL .P +> l)) r) + wSweep_PT_to_carry : ∀ (l r : ListBlank (Fin 2)) , + (wSweepCfg target_tm (tokL .T +> (tokL .P +> l)) ([0, 0, 1, 1] +> r)) [target_tm]⊢* + (carryCfg target_tm l ([1, 0, 1, 1] +> r)) + wSweep_ZMT_to_tSweep : ∀ (l r : ListBlank (Fin 2)) , + (wSweepCfg target_tm (tokL .T +> (tokL .M +> (tokL .Z +> l))) ([0, 0, 1, 1] +> r)) [target_tm]⊢* + (tSweepCfg (tokL .Z +> (tokL .P +> l)) r) + cfgR_Z_to_TW : ∀ (l : ListBlank (Fin 2)) , + (cfgR target_tm (tokL .Z +> l)) [target_tm]⊢* (cfgR target_tm (tokL .W +> (tokL .T +> l))) + cfgR_TW_to_t3Cfg : ∀ (l : ListBlank (Fin 2)) , + (cfgR target_tm (tokL .W +> (tokL .T +> l))) [target_tm]⊢* (t3Cfg target_tm l (evalWK 0)) + t3_step : ∀ (l r : ListBlank (Fin 2)) , + (t3Cfg target_tm (((tokL .T) ^ 3) +> l) r) [target_tm]⊢* (t3Cfg target_tm l (((tokR .Z) ^ 2) +> + r)) + t3Cfg_Z_zero_to_carry : ∀ (l : ListBlank (Fin 2)) , + (t3Cfg target_tm (tokL .Z +> l) (evalWK 0)) [target_tm]⊢* (carryCfg target_tm l (evalWK 1)) + t3Cfg_Z_succ_to_r0 : ∀ (l r : ListBlank (Fin 2)) , + (t3Cfg target_tm (tokL .Z +> l) (tokR .Z +> r)) [target_tm]⊢* (r0Cfg (tokL .P +> l) r) + t3Cfg_TZ_to_r1OddShort : ∀ (l r : ListBlank (Fin 2)) , + (t3Cfg target_tm (tokL .T +> (tokL .Z +> l)) r) [target_tm]⊢* (r1OddShortCfg target_tm + (tokL .M +> (tokL .T +> l)) r) + r1OddShortCfg_evalWK0_to_carry : ∀ (l : ListBlank (Fin 2)) , + (r1OddShortCfg target_tm l (evalWK 0)) [target_tm]⊢* (carryCfg target_tm l (evalWK 1)) + t3Cfg_TTZ_to_r0 : ∀ (l r : ListBlank (Fin 2)) , + (t3Cfg target_tm (((tokL .T) ^ 2) +> (tokL .Z +> l)) r) [target_tm]⊢* (r0Cfg (tokL .W +> + (tokL .T +> l)) r) + + +abbrev cfgRGen := cfgR +abbrev carryCfgGen := carryCfg +abbrev r1OddShortCfgGen := r1OddShortCfg +abbrev r1OddCfgGen := r1OddCfg +abbrev wSweepCfgGen := wSweepCfg +abbrev t3CfgGen := t3Cfg +abbrev pmuCfgGen := pmuCfg + +def HasRoundtripGen (target_tm : Machine (Fin 2) (Fin 6)) (R : Nat → ListBlank (Fin 2)) : Prop := + ∀ (l : ListBlank (Fin 2)) (k1 : Nat), + (r0Cfg l (R k1)) [target_tm]⊢* (carryCfgGen target_tm l (R (k1 + 2))) + +def r1PhaseCfgGen (target_tm : Machine (Fin 2) (Fin 6)) (phase : Bool) + (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + if phase then r1OddCfgGen target_tm l r else r1Cfg l r + +def modeCfgGen (target_tm : Machine (Fin 2) (Fin 6)) : + Mode → ListBlank (Fin 2) → ListBlank (Fin 2) → Cfg (Fin 2) (Fin 6) + | .R0, l, r => r0Cfg l r + | .R1, l, r => r1Cfg l r + | .R1_ODD, l, r => r1OddCfgGen target_tm l r + +variable {target_tm : Machine (Fin 2) (Fin 6)} +variable [rules : HasRleCarryRules target_tm] +local notation "cfgR" => cfgRGen target_tm +local notation "carryCfg" => carryCfgGen target_tm +local notation "r1OddShortCfg" => r1OddShortCfgGen target_tm +local notation "r1OddCfg" => r1OddCfgGen target_tm +local notation "wSweepCfg" => wSweepCfgGen target_tm +local notation "t3Cfg" => t3CfgGen target_tm +local notation "pmuCfg" => pmuCfgGen target_tm +local notation "HasRoundtrip" => HasRoundtripGen target_tm +local notation "r1PhaseCfg" => r1PhaseCfgGen target_tm +local notation "modeCfg" => modeCfgGen target_tm + +theorem r1Odd_Z (l r : ListBlank (Fin 2)) : + (r1OddCfg l (tokR .Z +> r)) [target_tm]⊢* (r1OddCfg (tokL .Z +> l) r) := + rules.r1OddShort_Z (tokL .Z +> l) r + + +-- ============================================================================ +-- Section 6.5: Loop & Suffix Transition Lemmas +-- ============================================================================ + +theorem wSweep_loop : ∀ (n : Nat) (l r : ListBlank (Fin 2)), + (wSweepCfg (((tokL .W) ^ n) +> l) r) [target_tm]⊢* + (wSweepCfg l ((([0, 0, 1, 1] : List (Fin 2)) ^ n) +> r)) + | 0, l, r => stepStar_refl _ _ + | n + 1, l, r => by + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans (rules.wSweep_step (((tokL .W) ^ n) +> l) r) ?_ + have ih := wSweep_loop n l ([0, 0, 1, 1] +> r) + rwa [pow_succ_right, listblank_append_assoc] + +theorem dSweep_loop : ∀ (n : Nat) (l r : ListBlank (Fin 2)), + (dSweepCfg l ((([0, 0, 1, 1] : List (Fin 2)) ^ n) +> r)) [target_tm]⊢* + (dSweepCfg (((tokL .W) ^ n) +> l) r) + | 0, l, r => stepStar_refl _ _ + | n + 1, l, r => by + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans (rules.dSweep_step l ((([0, 0, 1, 1] : List (Fin 2)) ^ n) +> r)) ?_ + have ih := dSweep_loop n (tokL .W +> l) r + rwa [pow_succ_right, listblank_append_assoc] + +theorem tSweep_loop : ∀ (n : Nat) (l r : ListBlank (Fin 2)), + (tSweepCfg l ((([0, 0, 1, 1] : List (Fin 2)) ^ n) +> r)) [target_tm]⊢* + (tSweepCfg (((tokL .T) ^ n) +> l) r) + | 0, l, r => stepStar_refl _ _ + | n + 1, l, r => by + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans (rules.tSweep_step l ((([0, 0, 1, 1] : List (Fin 2)) ^ n) +> r)) ?_ + have ih := tSweep_loop n (tokL .T +> l) r + rwa [pow_succ_right, listblank_append_assoc] + +theorem t3_loop : ∀ (q : Nat) (l r : ListBlank (Fin 2)), + (t3Cfg (((tokL .T) ^ (3 * q)) +> l) r) [target_tm]⊢* + (t3Cfg l (((tokR .Z) ^ (2 * q)) +> r)) + | 0, l, r => stepStar_refl _ _ + | q + 1, l, r => by + have h3 : 3 * (q + 1) = 3 + 3 * q := by omega + have h2 : 2 * (q + 1) = 2 * q + 2 := by omega + rw [h3, list_pow_add, listblank_append_assoc] + refine stepStar_trans (rules.t3_step (((tokL .T) ^ (3 * q)) +> l) r) ?_ + have ih := t3_loop q l (((tokR .Z) ^ 2) +> r) + rwa [h2, list_pow_add, listblank_append_assoc] + +theorem pmu_loop : ∀ (m : Nat) (l r : ListBlank (Fin 2)), + (pmuCfg (((tokL .P) ^ m) +> l) r) [target_tm]⊢* + (pmuCfg l (((tokR .Z) ^ m) +> r)) + | 0, l, r => stepStar_refl _ _ + | m + 1, l, r => by + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans (rules.pmu_step (((tokL .P) ^ m) +> l) r) ?_ + have ih := pmu_loop m l (tokR .Z +> r) + rwa [pow_succ_right, listblank_append_assoc] + +theorem r0_Z_loop : ∀ (m : Nat) (l r : ListBlank (Fin 2)), + (r0Cfg l (((tokR .Z) ^ m) +> r)) [target_tm]⊢* + (r0Cfg (((tokL .Z) ^ m) +> l) r) + | 0, l, r => stepStar_refl _ _ + | m + 1, l, r => by + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans (rules.r0_Z l (((tokR .Z) ^ m) +> r)) ?_ + have ih := r0_Z_loop m (tokL .Z +> l) r + rwa [pow_succ_right, listblank_append_assoc] + +theorem r0_P_loop : ∀ (m : Nat) (l r : ListBlank (Fin 2)), + (r0Cfg l (((tokR .P) ^ m) +> r)) [target_tm]⊢* + (r0Cfg (((tokL .P) ^ m) +> l) r) + | 0, l, r => stepStar_refl _ _ + | m + 1, l, r => by + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans (rules.r0_P l (((tokR .P) ^ m) +> r)) ?_ + have ih := r0_P_loop m (tokL .P +> l) r + rwa [pow_succ_right, listblank_append_assoc] + +theorem r1OddShort_Z_loop : ∀ (m : Nat) (l r : ListBlank (Fin 2)), + (r1OddShortCfg l (((tokR .Z) ^ m) +> r)) [target_tm]⊢* + (r1OddShortCfg (((tokL .Z) ^ m) +> l) r) + | 0, l, r => stepStar_refl _ _ + | m + 1, l, r => by + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans (rules.r1OddShort_Z l (((tokR .Z) ^ m) +> r)) ?_ + have ih := r1OddShort_Z_loop m (tokL .Z +> l) r + rwa [pow_succ_right, listblank_append_assoc] + +theorem cfgR_ZW_to_TW (n : Nat) (l : ListBlank (Fin 2)) : + (cfgR (((tokL .W) ^ n) +> (tokL .Z +> l))) [target_tm]⊢* + (cfgR (((tokL .W) ^ (n + 1)) +> (tokL .T +> l))) := by + refine stepStar_trans (rules.wSweep_start _) ?_ + refine stepStar_trans (wSweep_loop n (tokL .Z +> l) default) ?_ + refine stepStar_trans (rules.wSweep_Z_to_dSweep l _) ?_ + refine stepStar_trans (dSweep_loop n (tokL .T +> l) default) ?_ + rw [pow_succ_list, listblank_append_assoc] + exact (rules.dSweep_end _) + +theorem r0_end (k1 : Nat) (l : ListBlank (Fin 2)) : + (r0Cfg l (evalWK k1)) [target_tm]⊢* (carryCfg l (evalWK (k1 + 2))) := by + unfold evalWK + refine stepStar_trans (rules.r0_to_dSweep l _) ?_ + refine stepStar_trans (dSweep_loop k1 (tokL .Z +> (tokL .Z +> l)) default) ?_ + refine stepStar_trans (rules.dSweep_end _) ?_ + rw [← listblank_append_assoc, ← pow_succ_list] + refine stepStar_trans (cfgR_ZW_to_TW (k1 + 1) (tokL .Z +> l)) ?_ + refine stepStar_trans (rules.wSweep_start _) ?_ + refine stepStar_trans (wSweep_loop (k1 + 2) (tokL .T +> (tokL .Z +> l)) default) ?_ + rw [pow_succ_list [0, 0, 1, 1] (k1 + 1), listblank_append_assoc] + refine stepStar_trans (rules.wSweep_ZT_to_dSweep l _) ?_ + refine stepStar_trans (dSweep_loop (k1 + 1) (tokL .Z +> (tokL .P +> l)) default) ?_ + refine stepStar_trans (rules.dSweep_end _) ?_ + rw [← listblank_append_assoc, ← pow_succ_list] + refine stepStar_trans (cfgR_ZW_to_TW (k1 + 2) (tokL .P +> l)) ?_ + refine stepStar_trans (rules.wSweep_start _) ?_ + refine stepStar_trans (wSweep_loop (k1 + 3) (tokL .T +> (tokL .P +> l)) default) ?_ + rw [pow_succ_list [0, 0, 1, 1] (k1 + 2), listblank_append_assoc] + exact (rules.wSweep_PT_to_carry l _) + +theorem r1_end (kf1 : Nat) (l : ListBlank (Fin 2)) : + (r1Cfg l (evalWK kf1)) [target_tm]⊢* + (t3Cfg (((tokL .T) ^ (kf1 + 1)) +> (tokL .Z +> (tokL .P +> l))) (evalWK 0)) := by + unfold evalWK + refine stepStar_trans (rules.r1_to_dSweep l _) ?_ + refine stepStar_trans (dSweep_loop kf1 (tokL .Z +> (tokL .M +> (tokL .Z +> l))) default) ?_ + refine stepStar_trans (rules.dSweep_end _) ?_ + rw [← listblank_append_assoc, ← pow_succ_list] + refine stepStar_trans (cfgR_ZW_to_TW (kf1 + 1) (tokL .M +> (tokL .Z +> l))) ?_ + refine stepStar_trans (rules.wSweep_start _) ?_ + refine stepStar_trans (wSweep_loop (kf1 + 2) (tokL .T +> (tokL .M +> (tokL .Z +> l))) default) ?_ + rw [pow_succ_list [0, 0, 1, 1] (kf1 + 1), listblank_append_assoc] + refine stepStar_trans (rules.wSweep_ZMT_to_tSweep l _) ?_ + refine stepStar_trans (tSweep_loop (kf1 + 1) (tokL .Z +> (tokL .P +> l)) default) ?_ + refine stepStar_trans (rules.tSweep_end _) ?_ + refine stepStar_trans (rules.cfgR_Z_to_TW _) ?_ + exact (rules.cfgR_TW_to_t3Cfg _) + +theorem r1Odd_end (kf1 : Nat) (l : ListBlank (Fin 2)) : + (r1OddCfg l (evalWK kf1)) [target_tm]⊢* + (t3Cfg (((tokL .T) ^ kf1) +> (tokL .Z +> (tokL .Z +> l))) (evalWK 0)) := by + unfold evalWK + refine stepStar_trans (rules.r1Odd_to_tSweep l _) ?_ + refine stepStar_trans (tSweep_loop kf1 (tokL .Z +> (tokL .Z +> l)) default) ?_ + refine stepStar_trans (rules.tSweep_end _) ?_ + refine stepStar_trans (rules.cfgR_Z_to_TW _) ?_ + exact (rules.cfgR_TW_to_t3Cfg _) + +def stepZtToCarry (rle2 : Rle) (n : Nat) : Rle × Nat := + strictNat (Nat.div n 3) fun q => + strictNat (Nat.mod n 3) fun rem => + Bool.casesOn (Nat.beq rem 0) + (Bool.casesOn (Nat.beq rem 1) + (strictNat (Nat.mul 2 q) fun zc => + pushRleK [.Z] zc (pushToksLtr [.T, .W] rle2) fun rle4 => + (rle4, 2)) + (strictNat (Nat.mul 2 q) fun zc => + pushRleK [.Z] zc (pushToksLtr [.T, .M] rle2) fun rle4 => + (rle4, 1))) + (Bool.casesOn (Nat.beq q 0) + (strictNat (Nat.sub (Nat.mul 2 q) 1) fun zc => + pushRlePosK [.P] 1 rle2 fun rle3 => + pushRleK [.Z] zc rle3 fun rle4 => + (rle4, 2)) + (rle2, 1)) + +@[simp] theorem nat_mod_eq (a b : Nat) : Nat.mod a b = a % b := rfl +@[simp] theorem nat_div_eq (a b : Nat) : Nat.div a b = a / b := rfl +@[simp] theorem nat_add_eq (a b : Nat) : Nat.add a b = a + b := rfl +@[simp] theorem nat_sub_eq (a b : Nat) : Nat.sub a b = a - b := rfl +@[simp] theorem nat_mul_eq (a b : Nat) : Nat.mul a b = a * b := rfl + +theorem stepZtToCarry_eq (rle2 : Rle) (n : Nat) : + stepZtToCarry rle2 n = + let q := n / 3 + let rem := n % 3 + if Nat.beq rem 0 then + if Nat.beq q 0 then (rle2, 1) + else (pushRle [.Z] (2 * q - 1) (pushRlePos [.P] 1 rle2), 2) + else if Nat.beq rem 1 then + (pushRle [.Z] (2 * q) (pushToksLtr [.T, .M] rle2), 1) + else + (pushRle [.Z] (2 * q) (pushToksLtr [.T, .W] rle2), 2) := by + unfold stepZtToCarry; dsimp -failIfUnchanged only + simp only [strictNat_eq, pushRlePosK_eq, pushRleK_eq, nat_mod_eq, nat_div_eq, nat_mul_eq, + nat_sub_eq] + cases Nat.beq (n % 3) 0 + · cases Nat.beq (n % 3) 1 <;> rfl + · cases Nat.beq (n / 3) 0 <;> rfl + +theorem stepZtToCarry_sound (rle2 : Rle) (n : Nat) : + (t3Cfg (((tokL .T) ^ n) +> (tokL .Z +> evalRle rle2)) (evalWK 0)) [target_tm]⊢* + (carryCfg (evalRle (stepZtToCarry rle2 n).1) (evalWK (stepZtToCarry rle2 n).2)) := by + rw [stepZtToCarry_eq] + dsimp -failIfUnchanged only + generalize hq : n / 3 = q + generalize hrem : n % 3 = rem + have hdiv : n = 3 * q + rem := by omega + have hlt : rem < 3 := by omega + rw [hdiv, list_pow_add, listblank_append_assoc] + refine stepStar_trans (t3_loop q (((tokL .T) ^ rem) +> (tokL .Z +> evalRle rle2)) (evalWK 0)) ?_ + rcases (by omega : rem = 0 ∨ rem = 1 ∨ rem = 2) with rfl | rfl | rfl + · have hr0 : Nat.beq 0 0 = true := rfl + rw [hr0] + simp only [↓reduceIte, pow_zero_list, listblank_append_nil] + cases q with + | zero => + rw [hr0] + simp only [↓reduceIte, Nat.mul_zero, pow_zero_list, listblank_append_nil] + exact (rules.t3Cfg_Z_zero_to_carry (evalRle rle2)) + | succ q' => + have hq_ne : Nat.beq (q' + 1) 0 = false := rfl + have h2q : 2 * (q' + 1) = 1 + (2 * (q' + 1) - 1) := by omega + have h2q_sub : 1 + (2 * (q' + 1) - 1) - 1 = 2 * (q' + 1) - 1 := by omega + rw [hq_ne, h2q, list_pow_add, pow_succ_list, pow_zero_list, List.append_nil, + listblank_append_assoc] + simp only [Bool.false_eq_true, ↓reduceIte, evalRle_pushRle, evalRle_pushRlePos, + pow_succ_list, pow_zero_list, + List.append_nil, wordL_cons, wordL_nil, h2q_sub] + refine stepStar_trans (rules.t3Cfg_Z_succ_to_r0 (evalRle rle2) _) ?_ + refine stepStar_trans (r0_Z_loop (2 * (q' + 1) - 1) (tokL .P +> evalRle rle2) (evalWK 0)) ?_ + exact r0_end 0 _ + · have hr0 : Nat.beq 1 0 = false := rfl + have hr1 : Nat.beq 1 1 = true := rfl + rw [hr0, hr1] + simp only [Bool.false_eq_true, ↓reduceIte, pow_succ_list, pow_zero_list, + List.append_nil, evalRle_pushRle, evalRle_pushToksLtr, revWord_cons, revWord_nil, + wordL_cons, wordL_nil] + refine stepStar_trans (rules.t3Cfg_TZ_to_r1OddShort (evalRle rle2) _) ?_ + refine stepStar_trans (r1OddShort_Z_loop (2 * q) (tokL .M +> (tokL .T +> evalRle rle2)) + (evalWK 0)) ?_ + exact (rules.r1OddShortCfg_evalWK0_to_carry _) + · have hr0 : Nat.beq 2 0 = false := rfl + have hr1 : Nat.beq 2 1 = false := rfl + rw [hr0, hr1] + simp only [Bool.false_eq_true, ↓reduceIte, evalRle_pushRle, evalRle_pushToksLtr, revWord_cons, + revWord_nil, pow_succ_list, pow_zero_list, List.append_nil, wordL_cons, wordL_nil, + listblank_append_assoc] + refine stepStar_trans (rules.t3Cfg_TTZ_to_r0 (evalRle rle2) _) ?_ + refine stepStar_trans (r0_Z_loop (2 * q) (tokL .W +> (tokL .T +> evalRle rle2)) (evalWK 0)) ?_ + exact r0_end 0 _ + +-- ============================================================================ +-- Section 6.6: RLE Combinators & Sweep Soundness Lemmas +-- ============================================================================ + +theorem carry_word : ∀ (w : List Tok) (l r : ListBlank (Fin 2)), + isZpWord w = true → + (carryCfg (wordL w +> l) r) [target_tm]⊢* + (carryCfg l (wordR (revWord w) +> r)) + | [], l, r, _ => stepStar_refl _ _ + | t :: ts, l, r, h => by + simp only [isZpWord_cons, Bool.and_eq_true] at h + rcases h with ⟨ht, hts⟩ + cases t <;> try contradiction + · rw [wordL_cons, listblank_append_assoc] + refine stepStar_trans (rules.carry_Z (wordL ts +> l) r) ?_ + have ih := carry_word ts l (tokR .Z +> r) hts + simpa [revWord_cons, wordR_append, listblank_append_assoc] using ih + · rw [wordL_cons, listblank_append_assoc] + refine stepStar_trans (rules.carry_P (wordL ts +> l) r) ?_ + have ih := carry_word ts l (tokR .P +> r) hts + simpa [revWord_cons, wordR_append, listblank_append_assoc] using ih + +theorem carry_pow : ∀ (c : Nat) (w : List Tok) (l r : ListBlank (Fin 2)), + isZpWord w = true → + (carryCfg (((wordL w) ^ c) +> l) r) [target_tm]⊢* + (carryCfg l (((wordR (revWord w)) ^ c) +> r)) + | 0, _, l, r, _ => stepStar_refl _ _ + | c + 1, w, l, r, hw => by + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans (carry_word w (((wordL w) ^ c) +> l) r hw) ?_ + have ih := carry_pow c w l (wordR (revWord w) +> r) hw + rwa [pow_succ_right, listblank_append_assoc] + +def popCarrySpecial (rle rs : Rle) : Option (Rle × Rle) := + Option.casesOn (popLastTok rle) none (fun p1 => + Prod.casesOn p1 (fun t1 r1 => + Tok.casesOn t1 + (Option.casesOn (popLastTok r1) none (fun p2 => + Prod.casesOn p2 (fun t2 r2 => + Tok.casesOn t2 + none + (Prod.casesOn (popTokCount 8 .P 0 r2) (fun mVal r3 => + Bool.casesOn (Nat.beq mVal 0) + (Option.casesOn (popLastTok r3) none (fun p3 => + Prod.casesOn p3 (fun t3 r4 => + Tok.casesOn t3 + none + (pushRlePosK [.U] 1 r4 fun r5 => + pushRlePosK [.P] 1 rs fun rs1 => + pushRlePosK [.Z] mVal rs1 fun rs2 => some (r5, rs2)) + none none + (pushRlePosK [.M] 1 r4 fun r5 => + pushRlePosK [.P] 1 rs fun rs1 => + pushRlePosK [.Z] mVal rs1 fun rs2 => some (r5, rs2)) + none none))) + none)) + none none + (Option.casesOn (popTok .P r2) none (fun r3 => + pushRlePosK [.Z] 1 r3 fun r4 => + pushRlePosK [.P] 1 rs fun rs1 => some (r4, rs1))) + none none))) + (Option.casesOn (popToks [.T, .U, .M, .P] r1) + (Option.casesOn (popToks [.T, .T, .T, .P] r1) none (fun r5 => + pushRlePosK [.PTTTM_TAIL] 1 rs fun rs1 => + pushRlePosK [.Z] 2 rs1 fun rs2 => some (r5, rs2))) + (fun r5 => + pushRlePosK [.P] 1 rs fun rs1 => + pushRlePosK [.Z] 2 rs1 fun rs2 => some (r5, rs2))) + (Option.casesOn (popToks [.T, .T, .P] r1) none (fun r4 => + pushRlePosK [.Z] 3 rs fun rs1 => some (r4, rs1))) + none + (Option.casesOn (popToks [.T, .T, .P] r1) none (fun r4 => + pushRlePosK [.P] 1 rs fun rs1 => + pushRlePosK [.Z] 2 rs1 fun rs2 => some (r4, rs2))) + none + none)) + +theorem popCarrySpecial_sound (rle rs rle' rs' : Rle) (r_end : ListBlank (Fin 2)) + (h : popCarrySpecial rle rs = some (rle', rs')) : + (carryCfg (evalRle rle) (evalRStack rs r_end)) [target_tm]⊢* + (carryCfg (evalRle rle') (evalRStack rs' r_end)) := by + unfold popCarrySpecial at h + cases hp1 : popLastTok rle with + | none => rw [hp1] at h; nomatch h + | some p1 => + rcases p1 with ⟨t1, r1⟩ + rw [hp1] at h; dsimp -failIfUnchanged only at h + rw [popLastTok_sound rle t1 r1 hp1] + cases t1 with + | Z | P | PTTTM_TAIL => nomatch h + | U => + dsimp -failIfUnchanged only at h + cases hp2 : popLastTok r1 with + | none => rw [hp2] at h; nomatch h + | some p2 => + rcases p2 with ⟨t2, r2⟩ + rw [hp2] at h; dsimp -failIfUnchanged only at h + rw [popLastTok_sound r1 t2 r2 hp2] + cases t2 with + | U | W | Z | P | PTTTM_TAIL => nomatch h + | M => + dsimp -failIfUnchanged only at h + have hpcs := (popTokCount_sound (l_tail := l_tail) 8 .P 0 r2).2 + rcases hpc : popTokCount 8 .P 0 r2 with ⟨mVal, r3⟩ + rw [hpc] at h hpcs; dsimp -failIfUnchanged only at h hpcs + simp only [pow_zero_list, listblank_append_nil] at hpcs + rw [hpcs] + cases hm : Nat.beq mVal 0 + · rw [hm] at h; dsimp -failIfUnchanged only at h + cases hp3 : popLastTok r3 with + | none => rw [hp3] at h; nomatch h + | some p3 => + rcases p3 with ⟨t3, r4⟩ + rw [hp3] at h; dsimp -failIfUnchanged only at h + rw [popLastTok_sound r3 t3 r4 hp3] + cases t3 with + | U | W | Z | P | PTTTM_TAIL => nomatch h + | M => + simp only [pushRlePosK_eq, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + refine stepStar_trans (rules.carry_MU_to_pmuCfg _ _) ?_ + refine stepStar_trans (pmu_loop mVal (tokL .M +> evalRle r4) _) ?_ + refine stepStar_trans (rules.pmuCfg_M_to_carry (evalRle r4) _) ?_ + simp only [evalRle_pushRlePos, evalRStack_pushRlePos, pow_succ_list, pow_zero_list, + List.append_nil, wordL_cons, wordL_nil, revWord_cons, revWord_nil] + try exact stepStar_refl _ _ + | T => + simp only [pushRlePosK_eq, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + refine stepStar_trans (rules.carry_MU_to_pmuCfg _ _) ?_ + refine stepStar_trans (pmu_loop mVal (tokL .T +> evalRle r4) _) ?_ + refine stepStar_trans (rules.pmuCfg_T_to_carry (evalRle r4) _) ?_ + simp only [evalRle_pushRlePos, evalRStack_pushRlePos, pow_succ_list, pow_zero_list, + List.append_nil, wordL_cons, wordL_nil, revWord_cons, revWord_nil] + try exact stepStar_refl _ _ + · rw [hm] at h; nomatch h + | T => + dsimp -failIfUnchanged only at h + cases hp3 : popTok .P r2 with + | none => rw [hp3] at h; nomatch h + | some r3 => + rw [hp3] at h + simp only [pushRlePosK_eq, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + rw [popTok_sound .P r2 r3 hp3] + simp only [evalRle_pushRlePos, evalRStack_pushRlePos, pow_succ_list, pow_zero_list, + List.append_nil, wordL_cons, wordL_nil, revWord_cons, revWord_nil] + exact (rules.carry_PTU (evalRle r3) (evalRStack rs r_end)) + | M => + dsimp -failIfUnchanged only at h + cases hp2 : popToks [.T, .U, .M, .P] r1 with + | some r5 => + rw [hp2] at h + simp only [pushRlePosK_eq, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + rw [popToks_sound _ r1 r5 hp2] + simp only [evalRStack_pushRlePos, pow_succ_list, pow_zero_list, List.append_nil, + wordL_cons, wordL_nil, revWord_cons, revWord_nil, listblank_append_assoc] + exact (rules.carry_PMUTM (evalRle r5) (evalRStack rs r_end)) + | none => + rw [hp2] at h; dsimp -failIfUnchanged only at h + cases hp3 : popToks [.T, .T, .T, .P] r1 with + | none => rw [hp3] at h; nomatch h + | some r5 => + rw [hp3] at h + simp only [pushRlePosK_eq, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + rw [popToks_sound _ r1 r5 hp3] + simp only [evalRStack_pushRlePos, pow_succ_list, pow_zero_list, List.append_nil, + wordL_cons, wordL_nil, revWord_cons, revWord_nil, listblank_append_assoc] + exact (rules.carry_PTTTM (evalRle r5) (evalRStack rs r_end)) + | W => + dsimp -failIfUnchanged only at h + cases hp2 : popToks [.T, .T, .P] r1 with + | none => rw [hp2] at h; nomatch h + | some r4 => + rw [hp2] at h + simp only [pushRlePosK_eq, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + rw [popToks_sound _ r1 r4 hp2] + simp only [evalRStack_pushRlePos, pow_succ_list, pow_zero_list, List.append_nil, + wordL_cons, wordL_nil, revWord_cons, revWord_nil, listblank_append_assoc] + exact (rules.carry_PTTW (evalRle r4) (evalRStack rs r_end)) + | T => + dsimp -failIfUnchanged only at h + cases hp2 : popToks [.T, .T, .P] r1 with + | none => rw [hp2] at h; nomatch h + | some r4 => + rw [hp2] at h + simp only [pushRlePosK_eq, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + rw [popToks_sound _ r1 r4 hp2] + simp only [evalRStack_pushRlePos, pow_succ_list, pow_zero_list, List.append_nil, + wordL_cons, wordL_nil, revWord_cons, revWord_nil, listblank_append_assoc] + exact (rules.carry_PTTT (evalRle r4) (evalRStack rs r_end)) + +def popCarryLoop (fuel : Nat) (rle rs : Rle) : Rle × Rle := + Nat.rec + (fun rle rs => (rle, rs)) + (fun _ ih rle rs => + List.casesOn rle ([], rs) (fun p rest => + Prod.casesOn p (fun w c => + Bool.casesOn (isZpWord w) + (Option.casesOn (popCarrySpecial ((w, c) :: rest) rs) + ((w, c) :: rest, rs) + (fun p' => Prod.casesOn p' (fun rle' rs' => ih rle' rs'))) + (pushRlePosK w c rs fun rs' => ih rest rs')))) + fuel rle rs + +theorem popCarryLoop_sound : ∀ (fuel : Nat) (rle rs : Rle) (r_end : ListBlank (Fin 2)), + (carryCfg (evalRle rle) (evalRStack rs r_end)) [target_tm]⊢* + (carryCfg (evalRle (popCarryLoop fuel rle rs).1) (evalRStack + (popCarryLoop fuel rle rs).2 r_end)) + | 0, rle, rs, r_end => stepStar_refl _ _ + | fuel + 1, [], rs, r_end => stepStar_refl _ _ + | fuel + 1, (w, c) :: rest, rs, r_end => by + unfold popCarryLoop; dsimp -failIfUnchanged only + cases hw : isZpWord w + · dsimp -failIfUnchanged only + cases hp : popCarrySpecial ((w, c) :: rest) rs with + | none => try exact stepStar_refl _ _ + | some p' => + rcases p' with ⟨rle', rs'⟩ + dsimp -failIfUnchanged only + refine stepStar_trans (popCarrySpecial_sound ((w, c) :: rest) rs rle' rs' r_end hp) ?_ + exact popCarryLoop_sound fuel rle' rs' r_end + · dsimp -failIfUnchanged only + rw [pushRlePosK_eq] + simp only [evalRle_cons] + refine stepStar_trans (carry_pow c w (evalRle rest) (evalRStack rs r_end) hw) ?_ + rw [← evalRStack_pushRlePos w c rs r_end] + exact popCarryLoop_sound fuel rest (pushRlePos w c rs) r_end + +theorem r0_word : ∀ (w : List Tok) (l r : ListBlank (Fin 2)), + isZpWord w = true → + (r0Cfg l (wordR w +> r)) [target_tm]⊢* + (r0Cfg (wordL (revWord w) +> l) r) + | [], l, r, _ => stepStar_refl _ _ + | t :: ts, l, r, h => by + simp only [isZpWord_cons, Bool.and_eq_true] at h + rcases h with ⟨ht, hts⟩ + cases t <;> try contradiction + · rw [wordR_cons, listblank_append_assoc] + refine stepStar_trans (rules.r0_Z l (wordR ts +> r)) ?_ + have ih := r0_word ts (tokL .Z +> l) r hts + simpa [revWord_cons, wordL_append, listblank_append_assoc] using ih + · rw [wordR_cons, listblank_append_assoc] + refine stepStar_trans (rules.r0_P l (wordR ts +> r)) ?_ + have ih := r0_word ts (tokL .P +> l) r hts + simpa [revWord_cons, wordL_append, listblank_append_assoc] using ih + +theorem r0_pow : ∀ (c : Nat) (w : List Tok) (l r : ListBlank (Fin 2)), + isZpWord w = true → + (r0Cfg l (((wordR w) ^ c) +> r)) [target_tm]⊢* + (r0Cfg (((wordL (revWord w)) ^ c) +> l) r) + | 0, _, l, r, _ => stepStar_refl _ _ + | c + 1, w, l, r, hw => by + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans (r0_word w l (((wordR w) ^ c) +> r) hw) ?_ + have ih := r0_pow c w (wordL (revWord w) +> l) r hw + rwa [pow_succ_right, listblank_append_assoc] + +def allZpStack (rs : Rle) : Bool := + List.rec true (fun p _ ih => Prod.casesOn p (fun it _ => Bool.casesOn (isZpWord it) false ih)) rs + +@[simp] theorem allZpStack_nil : allZpStack [] = true := rfl +@[simp] theorem allZpStack_cons (w : List Tok) (c : Nat) (rest : Rle) : + allZpStack ((w, c) :: rest) = (isZpWord w && allZpStack rest) := by + change Bool.casesOn (isZpWord w) false (allZpStack rest) = (isZpWord w && allZpStack rest) + cases isZpWord w <;> rfl + +def copyRStack (rle rs : Rle) : Option Rle := + List.rec + (fun rle => some rle) + (fun p _ ih rle => + Prod.casesOn p (fun item count => + Bool.casesOn (isZpWord item) + none + (pushRlePosK item count rle fun rle' => ih rle'))) + rs rle + +theorem copyRStack_sound : ∀ (rs : Rle) (rle rle' : Rle) (r_end : ListBlank (Fin 2)), + copyRStack rle rs = some rle' → + allZpStack rs = true ∧ + (r0Cfg (evalRle rle) (evalRStack rs r_end)) [target_tm]⊢* + (r0Cfg (evalRle rle') r_end) + | [], rle, rle', r_end, h => by + injection h with hr; subst hr + exact ⟨rfl, stepStar_refl _ _⟩ + | (w, c) :: rest, rle, rle', r_end, h => by + unfold copyRStack at h; dsimp -failIfUnchanged only at h + cases hw : isZpWord w + · rw [hw] at h; nomatch h + · rw [hw] at h; dsimp -failIfUnchanged only at h + rw [pushRlePosK_eq] at h + rcases copyRStack_sound rest (pushRlePos w c rle) rle' r_end h with ⟨hrest, hstep⟩ + simp only [allZpStack_cons, hw, hrest, Bool.and_self] + refine ⟨trivial, ?_⟩ + simp only [evalRStack_cons] + have hrev : isZpWord (revWord w) = true := by rw [isZpWord_revWord]; exact hw + refine stepStar_trans (r0_pow c (revWord w) (evalRle rle) (evalRStack rest r_end) hrev) ?_ + simpa [revWord_revWord, evalRle_pushRlePos] using hstep + + + +theorem hasRoundtrip_evalWK : HasRoundtrip evalWK := + fun l k1 => r0_end k1 l + +theorem hasRoundtrip_Z {R : Nat → ListBlank (Fin 2)} (hR : HasRoundtrip R) : + HasRoundtrip (fun k1 => tokR .Z +> R k1) := by + intro l k1 + refine stepStar_trans (rules.r0_Z l (R k1)) ?_ + refine stepStar_trans (hR (tokL .Z +> l) k1) ?_ + exact (rules.carry_Z l (R (k1 + 2))) + +theorem hasRoundtrip_P {R : Nat → ListBlank (Fin 2)} (hR : HasRoundtrip R) : + HasRoundtrip (fun k1 => tokR .P +> R k1) := by + intro l k1 + refine stepStar_trans (rules.r0_P l (R k1)) ?_ + refine stepStar_trans (hR (tokL .P +> l) k1) ?_ + exact (rules.carry_P l (R (k1 + 2))) + +theorem hasRoundtrip_word : ∀ (w : List Tok) {R : Nat → ListBlank (Fin 2)}, + isZpWord w = true → HasRoundtrip R → + HasRoundtrip (fun k1 => wordR w +> R k1) + | [], _, _, hR => hR + | t :: ts, _, hw, hR => by + simp only [isZpWord_cons, Bool.and_eq_true] at hw + rcases hw with ⟨ht, hts⟩ + cases t <;> try contradiction + · intro l k1; dsimp -failIfUnchanged only; rw [wordR_cons, listblank_append_assoc] + exact hasRoundtrip_Z (hasRoundtrip_word ts hts hR) l k1 + · intro l k1; dsimp -failIfUnchanged only; rw [wordR_cons, listblank_append_assoc] + exact hasRoundtrip_P (hasRoundtrip_word ts hts hR) l k1 + +theorem hasRoundtrip_pow : ∀ (c : Nat) (w : List Tok) {R : Nat → ListBlank (Fin 2)}, + isZpWord w = true → HasRoundtrip R → + HasRoundtrip (fun k1 => ((wordR w) ^ c) +> R k1) + | 0, _, _, _, hR => hR + | c + 1, w, _, hw, hR => by + intro l k1 + simp only [pow_succ_list, listblank_append_assoc] + exact hasRoundtrip_word w hw (hasRoundtrip_pow c w hw hR) l k1 + +theorem hasRoundtrip_stack : ∀ (rs : Rle) {R : Nat → ListBlank (Fin 2)}, + allZpStack rs = true → HasRoundtrip R → + HasRoundtrip (fun k1 => evalRStack rs (R k1)) + | [], _, _, hR => hR + | (w, c) :: rest, _, hrs, hR => by + simp only [allZpStack_cons, Bool.and_eq_true] at hrs + rcases hrs with ⟨hw, hrest⟩ + intro l k1 + simp only [evalRStack_cons] + have hrev : isZpWord (revWord w) = true := by rw [isZpWord_revWord]; exact hw + exact hasRoundtrip_pow c (revWord w) hrev (hasRoundtrip_stack rest hrest hR) l k1 + + + +omit rules in +@[simp] theorem r1PhaseCfg_false (l r : ListBlank (Fin 2)) : r1PhaseCfg false l r = r1Cfg l r := rfl +omit rules in +@[simp] theorem r1PhaseCfg_true (l r : ListBlank (Fin 2)) : r1PhaseCfg true l r = r1OddCfg l r := + rfl + +def stepR1StarWordL (w : List Tok) (phase : Bool) : List Tok × Nat × Bool := + List.rec + ([], 0, phase) + (fun t _ ih => + Prod.casesOn ih (fun out rest => + Prod.casesOn rest (fun res p1 => + Bool.casesOn p1 + (Bool.casesOn (tokEq t .Z) + (.P :: out, res, true) + (.P :: out, Nat.add res 1, false)) + (Bool.casesOn (tokEq t .P) + (.Z :: out, res, true) + (.Z :: out, res, false))))) + w + +theorem stepR1StarWordL_cons (t : Tok) (ts : List Tok) (phase : Bool) : + stepR1StarWordL (t :: ts) phase = + let (out, res, p1) := stepR1StarWordL ts phase + if p1 then + if tokEq t .P then (.Z :: out, res, false) else (.Z :: out, res, true) + else + if tokEq t .Z then (.P :: out, res + 1, false) else (.P :: out, res, true) := by + have hstep : stepR1StarWordL (t :: ts) phase = + Prod.casesOn (stepR1StarWordL ts phase) (fun out rest => + Prod.casesOn rest (fun res p1 => + Bool.casesOn p1 + (Bool.casesOn (tokEq t .Z) + (.P :: out, res, true) + (.P :: out, Nat.add res 1, false)) + (Bool.casesOn (tokEq t .P) + (.Z :: out, res, true) + (.Z :: out, res, false)))) := rfl + rw [hstep] + rcases stepR1StarWordL ts phase with ⟨out, res, p1⟩ + cases p1 + · cases tokEq t .Z <;> rfl + · cases tokEq t .P <;> rfl + +theorem stepR1StarWordL_phase_inv : ∀ (w : List Tok) (phase : Bool), + isZpWord w = true → + (stepR1StarWordL w (!phase)).2.2 = !(stepR1StarWordL w phase).2.2 + | [], phase, _ => rfl + | t :: ts, phase, hw => by + simp only [isZpWord_cons, Bool.and_eq_true] at hw + rcases hw with ⟨ht, hts⟩ + have ih := stepR1StarWordL_phase_inv ts phase hts + rw [stepR1StarWordL_cons, stepR1StarWordL_cons] + rcases h1 : stepR1StarWordL ts (!phase) with ⟨o1, r1, p1⟩ + rcases h2 : stepR1StarWordL ts phase with ⟨o2, r2, p2⟩ + rw [h1, h2] at ih; dsimp -failIfUnchanged only at ih ⊢; subst ih + cases t <;> try contradiction + · cases p2 <;> rfl + · cases p2 <;> rfl + +theorem stepR1StarWordL_sound : ∀ (w : List Tok) (phase : Bool) (l : ListBlank (Fin 2)) + {R : Nat → ListBlank (Fin 2)}, + isZpWord w = true → HasRoundtrip R → + ∀ (k1 : Nat), + (r1PhaseCfg phase l (wordR (revWord w) +> R k1)) [target_tm]⊢* + (r1PhaseCfg (stepR1StarWordL w phase).2.2 + (wordL (stepR1StarWordL w phase).1 +> l) + (R (k1 + 2 * (stepR1StarWordL w phase).2.1))) + | [], phase, l, R, _, _, k1 => stepStar_refl _ _ + | t :: ts, phase, l, R, hw, hR, k1 => by + simp only [isZpWord_cons, Bool.and_eq_true] at hw + rcases hw with ⟨ht, hts⟩ + have hRt : HasRoundtrip (fun k => tokR t +> R k) := by + cases t <;> try contradiction + · exact hasRoundtrip_Z hR + · exact hasRoundtrip_P hR + have ih := stepR1StarWordL_sound ts phase l hts hRt k1 + simp only [revWord_cons, wordR_append, wordR_cons, wordR_nil, List.append_nil, + listblank_append_assoc] + rw [stepR1StarWordL_cons] + rcases hs : stepR1StarWordL ts phase with ⟨out, res, p1⟩ + rw [hs] at ih + dsimp -failIfUnchanged only at ih ⊢ + refine stepStar_trans ih ?_ + cases t <;> try contradiction + · cases p1 + · simp only [tokEq, Bool.false_eq_true, ↓reduceIte, r1PhaseCfgGen, wordL_cons] + refine stepStar_trans (rules.r1_Z (wordL out +> l) (R (k1 + 2 * res))) ?_ + refine stepStar_trans (hR (tokL .M +> (tokL .Z +> (wordL out +> l))) (k1 + 2 * res)) ?_ + refine stepStar_trans (rules.turn_ZM (wordL out +> l) (R (k1 + 2 * res + 2))) ?_ + have hadd : k1 + 2 * res + 2 = k1 + 2 * (res + 1) := by omega + rw [hadd, listblank_append_assoc] + try exact stepStar_refl _ _ + · simp only [tokEq, Bool.false_eq_true, ↓reduceIte, r1PhaseCfgGen, wordL_cons, + listblank_append_assoc] + exact (r1Odd_Z (wordL out +> l) (R (k1 + 2 * res))) + · cases p1 + · simp only [tokEq, Bool.false_eq_true, ↓reduceIte, r1PhaseCfgGen, wordL_cons, + listblank_append_assoc] + exact (rules.r1_P (wordL out +> l) (R (k1 + 2 * res))) + · simp only [tokEq, ↓reduceIte, r1PhaseCfgGen, wordL_cons, listblank_append_assoc] + exact (rules.r1Odd_P (wordL out +> l) (R (k1 + 2 * res))) + +def appendWord (w1 w2 : List Tok) : List Tok := + List.rec w2 (fun t _ ih => t :: ih) w1 + +@[simp] theorem appendWord_eq (w1 w2 : List Tok) : appendWord w1 w2 = w1 ++ w2 := by + induction w1 with + | nil => rfl + | cons t ts ih => + change t :: appendWord ts w2 = t :: (ts ++ w2) + rw [ih] + +theorem stepR1Star_same_pow : ∀ (c : Nat) (w : List Tok) (phase : Bool) (l : ListBlank (Fin 2)) + {R : Nat → ListBlank (Fin 2)}, + isZpWord w = true → + (stepR1StarWordL w phase).2.2 = phase → + HasRoundtrip R → + ∀ (k1 : Nat), + (r1PhaseCfg phase l (((wordR (revWord w)) ^ c) +> R k1)) [target_tm]⊢* + (r1PhaseCfg phase (((wordL (stepR1StarWordL w phase).1) ^ c) +> l) + (R (k1 + 2 * (c * (stepR1StarWordL w phase).2.1)))) + | 0, w, phase, l, R, _, _, _, k1 => by + simp + try exact stepStar_refl _ _ + | c + 1, w, phase, l, R, hw, hsame, hR, k1 => by + have hrev : isZpWord (revWord w) = true := by rw [isZpWord_revWord]; exact hw + have hR' : HasRoundtrip (fun k => ((wordR (revWord w)) ^ c) +> R k) := hasRoundtrip_pow c + (revWord w) hrev hR + rw [pow_succ_list, listblank_append_assoc] + have h1 := stepR1StarWordL_sound w phase l hw hR' k1 + rw [hsame] at h1 + refine stepStar_trans h1 ?_ + have ih := stepR1Star_same_pow c w phase (wordL (stepR1StarWordL w phase).1 +> l) hw hsame hR + (k1 + 2 * (stepR1StarWordL w phase).2.1) + have hadd : k1 + 2 * (stepR1StarWordL w phase).2.1 + 2 * (c * (stepR1StarWordL w phase).2.1) = + k1 + 2 * ((c + 1) * (stepR1StarWordL w phase).2.1) := by + have : (c + 1) * (stepR1StarWordL w phase).2.1 = + c * (stepR1StarWordL w phase).2.1 + (stepR1StarWordL w phase).2.1 := Nat.succ_mul c _ + omega + rw [hadd] at ih + rwa [pow_succ_right, listblank_append_assoc] + +theorem stepR1Star_alt_pow : ∀ (q : Nat) (w : List Tok) (phase : Bool) (l : ListBlank (Fin 2)) + {R : Nat → ListBlank (Fin 2)}, + isZpWord w = true → + (stepR1StarWordL w (stepR1StarWordL w phase).2.2).2.2 = phase → + HasRoundtrip R → + ∀ (k1 : Nat), + let s1 := stepR1StarWordL w phase + let s2 := stepR1StarWordL w s1.2.2 + (r1PhaseCfg phase l (((wordR (revWord w)) ^ (2 * q)) +> R k1)) [target_tm]⊢* + (r1PhaseCfg phase (((wordL (s2.1 ++ s1.1)) ^ q) +> l) + (R (k1 + 2 * (q * (s1.2.1 + s2.2.1))))) + | 0, w, phase, l, R, _, _, _, k1 => by + simp + try exact stepStar_refl _ _ + | q + 1, w, phase, l, R, hw, halt, hR, k1 => by + dsimp -failIfUnchanged only + have hrev : isZpWord (revWord w) = true := by rw [isZpWord_revWord]; exact hw + have h2q : 2 * (q + 1) = 1 + (1 + 2 * q) := by omega + rw [h2q, list_pow_add, list_pow_add, pow_succ_list, pow_zero_list, List.append_nil, + listblank_append_assoc, listblank_append_assoc] + have hR2 : HasRoundtrip (fun k => ((wordR (revWord w)) ^ (2 * q)) +> R k) := + hasRoundtrip_pow (2 * q) (revWord w) hrev hR + have hR1 : HasRoundtrip (fun k => wordR (revWord w) +> (((wordR (revWord w)) ^ (2 * q)) +> + R k)) := + hasRoundtrip_word (revWord w) hrev hR2 + refine stepStar_trans (stepR1StarWordL_sound w phase l hw hR1 k1) ?_ + refine stepStar_trans + (stepR1StarWordL_sound w (stepR1StarWordL w phase).2.2 + (wordL (stepR1StarWordL w phase).1 +> l) hw hR2 + (k1 + 2 * (stepR1StarWordL w phase).2.1)) ?_ + rw [halt] + have ih := stepR1Star_alt_pow q w phase + (wordL ((stepR1StarWordL w (stepR1StarWordL w phase).2.2).1 ++ + (stepR1StarWordL w phase).1) +> l) + hw halt hR + (k1 + 2 * (stepR1StarWordL w phase).2.1 + + 2 * (stepR1StarWordL w (stepR1StarWordL w phase).2.2).2.1) + dsimp -failIfUnchanged only at ih + have hadd : + k1 + 2 * (stepR1StarWordL w phase).2.1 + + 2 * (stepR1StarWordL w (stepR1StarWordL w phase).2.2).2.1 + + 2 * (q * ((stepR1StarWordL w phase).2.1 + + (stepR1StarWordL w (stepR1StarWordL w phase).2.2).2.1)) = + k1 + 2 * ((q + 1) * ((stepR1StarWordL w phase).2.1 + + (stepR1StarWordL w (stepR1StarWordL w phase).2.2).2.1)) := by + have : (q + 1) * ((stepR1StarWordL w phase).2.1 + + (stepR1StarWordL w (stepR1StarWordL w phase).2.2).2.1) = + q * ((stepR1StarWordL w phase).2.1 + + (stepR1StarWordL w (stepR1StarWordL w phase).2.2).2.1) + + ((stepR1StarWordL w phase).2.1 + + (stepR1StarWordL w (stepR1StarWordL w phase).2.2).2.1) := Nat.succ_mul q _ + omega + rw [hadd] at ih + have hw_app : + wordL (stepR1StarWordL w (stepR1StarWordL w phase).2.2).1 +> + (wordL (stepR1StarWordL w phase).1 +> l) = + wordL ((stepR1StarWordL w (stepR1StarWordL w phase).2.2).1 ++ + (stepR1StarWordL w phase).1) +> l := by + rw [wordL_append, listblank_append_assoc] + rw [hw_app, pow_succ_right, listblank_append_assoc] + exact ih + +def sweepStarLoop (rle : Rle) (phase : Bool) (totalRes : Nat) (rs : Rle) : Rle × Bool × Nat := + List.rec + (fun rle phase totalRes => (rle, phase, totalRes)) + (fun p _ ih rle phase totalRes => + Prod.casesOn p (fun item count => + Prod.casesOn (stepR1StarWordL item phase) (fun out1 rest1 => + Prod.casesOn rest1 (fun res1 nextPhase => + Bool.casesOn (Bool.casesOn nextPhase (Bool.casesOn phase true false) phase) + (Prod.casesOn (stepR1StarWordL item nextPhase) (fun out2 rest2 => + Prod.casesOn rest2 (fun res2 _ => + strictNat (Nat.div count 2) fun q => + strictNat (Nat.mod count 2) fun rem => + strictWord (appendWord out2 out1) fun w21 => + pushRleK w21 q rle fun rle1 => + strictNat (Nat.add totalRes (Nat.mul q (Nat.add res1 res2))) fun resAfterQ => + Bool.casesOn (Nat.beq rem 1) + (ih rle1 phase resAfterQ) + (strictNat (Nat.add resAfterQ res1) fun resFinal => + pushRlePosK out1 1 rle1 fun rle2 => + ih rle2 nextPhase resFinal)))) + (strictNat (Nat.add totalRes (Nat.mul count res1)) fun tr' => + pushRlePosK out1 count rle fun rle' => + ih rle' phase tr'))))) + rs rle phase totalRes + +theorem sweepStarLoop_cons (rle : Rle) (phase : Bool) (totalRes : Nat) (item : List Tok) + (count : Nat) (rest : Rle) : + sweepStarLoop rle phase totalRes ((item, count) :: rest) = + let (out1, res1, nextPhase) := stepR1StarWordL item phase + if nextPhase == phase then + sweepStarLoop (pushRlePos out1 count rle) phase (totalRes + count * res1) rest + else + let (out2, res2, _) := stepR1StarWordL item nextPhase + let q := count / 2 + let rem := count % 2 + let rle1 := pushRle (out2 ++ out1) q rle + let resAfterQ := totalRes + q * (res1 + res2) + if Nat.beq rem 1 then + sweepStarLoop (pushRlePos out1 1 rle1) nextPhase (resAfterQ + res1) rest + else + sweepStarLoop rle1 phase resAfterQ rest := by + have hstep : sweepStarLoop rle phase totalRes ((item, count) :: rest) = + Prod.casesOn (stepR1StarWordL item phase) (fun out1 rest1 => + Prod.casesOn rest1 (fun res1 nextPhase => + Bool.casesOn (Bool.casesOn nextPhase (Bool.casesOn phase true false) phase) + (Prod.casesOn (stepR1StarWordL item nextPhase) (fun out2 rest2 => + Prod.casesOn rest2 (fun res2 _ => + strictNat (Nat.div count 2) fun q => + strictNat (Nat.mod count 2) fun rem => + strictWord (appendWord out2 out1) fun w21 => + pushRleK w21 q rle fun rle1 => + strictNat (Nat.add totalRes (Nat.mul q (Nat.add res1 res2))) fun resAfterQ => + Bool.casesOn (Nat.beq rem 1) + (sweepStarLoop rle1 phase resAfterQ rest) + (strictNat (Nat.add resAfterQ res1) fun resFinal => + pushRlePosK out1 1 rle1 fun rle2 => + sweepStarLoop rle2 nextPhase resFinal rest)))) + (strictNat (Nat.add totalRes (Nat.mul count res1)) fun tr' => + pushRlePosK out1 count rle fun rle' => + sweepStarLoop rle' phase tr' rest))) := rfl + rw [hstep] + rcases stepR1StarWordL item phase with ⟨out1, res1, nextPhase⟩ + dsimp -failIfUnchanged only + cases nextPhase <;> cases phase + · simp only [strictNat_eq, pushRlePosK_eq]; rfl + · rcases stepR1StarWordL item false with ⟨out2, res2, p2⟩ + dsimp -failIfUnchanged only + simp only [strictNat_eq, strictWord_eq, appendWord_eq, pushRleK_eq, pushRlePosK_eq, nat_mod_eq] + cases Nat.beq (count % 2) 1 <;> rfl + · rcases stepR1StarWordL item true with ⟨out2, res2, p2⟩ + dsimp -failIfUnchanged only + simp only [strictNat_eq, strictWord_eq, appendWord_eq, pushRleK_eq, pushRlePosK_eq, nat_mod_eq] + cases Nat.beq (count % 2) 1 <;> rfl + · simp only [strictNat_eq, pushRlePosK_eq]; rfl + +theorem evalRle_pushRlePos_one (w : List Tok) (rle : Rle) : + evalRle (pushRlePos w 1 rle) = wordL w +> evalRle rle := by + rw [evalRle_pushRlePos, pow_succ_list, pow_zero_list, List.append_nil] + +theorem sweepStarLoop_sound : ∀ (rs : Rle) (rle : Rle) (phase : Bool) (totalRes : Nat) + {R : Nat → ListBlank (Fin 2)}, + allZpStack rs = true → HasRoundtrip R → + ∀ (k1 : Nat), + let res := sweepStarLoop rle phase totalRes rs + (r1PhaseCfg phase (evalRle rle) (evalRStack rs (R (k1 + 2 * totalRes)))) [target_tm]⊢* + (r1PhaseCfg res.2.1 (evalRle res.1) (R (k1 + 2 * res.2.2))) + | [], rle, phase, totalRes, R, _, _, k1 => stepStar_refl _ _ + | (item, count) :: rest, rle, phase, totalRes, R, hrs, hR, k1 => by + simp only [allZpStack_cons, Bool.and_eq_true] at hrs + rcases hrs with ⟨hitem, hrest⟩ + have hrev : isZpWord (revWord item) = true := by rw [isZpWord_revWord]; exact hitem + have hR_rest : HasRoundtrip (fun k => evalRStack rest (R k)) := + hasRoundtrip_stack rest hrest hR + dsimp -failIfUnchanged only + rw [sweepStarLoop_cons] + dsimp -failIfUnchanged only + by_cases hsame : (stepR1StarWordL item phase).2.2 = phase + · have hbeq : ((stepR1StarWordL item phase).2.2 == phase) = true := beq_iff_eq.mpr hsame + rw [hbeq] + simp only [↓reduceIte, evalRStack_cons] + refine stepStar_trans + (stepR1Star_same_pow count item phase (evalRle rle) hitem hsame hR_rest + (k1 + 2 * totalRes)) ?_ + have hadd : k1 + 2 * totalRes + 2 * (count * (stepR1StarWordL item phase).2.1) = + k1 + 2 * (totalRes + count * (stepR1StarWordL item phase).2.1) := by omega + rw [hadd, ← evalRle_pushRlePos] + exact sweepStarLoop_sound rest (pushRlePos (stepR1StarWordL item phase).1 count rle) + phase (totalRes + count * (stepR1StarWordL item phase).2.1) hrest hR k1 + · have hbeq : ((stepR1StarWordL item phase).2.2 == phase) = false := beq_false_of_ne hsame + rw [hbeq] + simp only [Bool.false_eq_true, ↓reduceIte] + have hnot : (stepR1StarWordL item phase).2.2 = !phase := by + cases phase <;> cases h : (stepR1StarWordL item false).2.2 <;> + cases h2 : (stepR1StarWordL item true).2.2 <;> simp_all + have halt : (stepR1StarWordL item (stepR1StarWordL item phase).2.2).2.2 = phase := by + rw [hnot, stepR1StarWordL_phase_inv item phase hitem] + cases phase <;> cases h : (stepR1StarWordL item false).2.2 <;> + cases h2 : (stepR1StarWordL item true).2.2 <;> simp_all + generalize hq : count / 2 = q + generalize hrem : count % 2 = rem + have hdiv : count = 2 * q + rem := by omega + simp only [evalRStack_cons] + rw [hdiv, list_pow_add, listblank_append_assoc] + have hR_rem : HasRoundtrip (fun k => ((wordR (revWord item)) ^ rem) +> evalRStack rest + (R k)) := + hasRoundtrip_pow rem (revWord item) hrev hR_rest + refine stepStar_trans + (stepR1Star_alt_pow q item phase (evalRle rle) hitem halt hR_rem (k1 + 2 * totalRes)) ?_ + rw [← evalRle_pushRle] + have hadd1 : k1 + 2 * totalRes + + 2 * (q * ((stepR1StarWordL item phase).2.1 + + (stepR1StarWordL item (stepR1StarWordL item phase).2.2).2.1)) = + k1 + 2 * (totalRes + q * ((stepR1StarWordL item phase).2.1 + + (stepR1StarWordL item (stepR1StarWordL item phase).2.2).2.1)) := by omega + rw [hadd1] + rcases (by omega : rem = 0 ∨ rem = 1) with rfl | rfl + · have h01 : Nat.beq 0 1 = false := rfl + rw [h01] + simp only [Bool.false_eq_true, ↓reduceIte, pow_zero_list, listblank_append_nil] + exact sweepStarLoop_sound rest _ phase _ hrest hR k1 + · have h11 : Nat.beq 1 1 = true := rfl + rw [h11] + simp only [↓reduceIte, pow_succ_list, pow_zero_list, List.append_nil] + refine stepStar_trans + (stepR1StarWordL_sound item phase _ hitem hR_rest _) ?_ + rw [← evalRle_pushRlePos_one] + have hadd2 : k1 + 2 * (totalRes + q * ((stepR1StarWordL item phase).2.1 + + (stepR1StarWordL item (stepR1StarWordL item phase).2.2).2.1)) + + 2 * (stepR1StarWordL item phase).2.1 = + k1 + 2 * (totalRes + q * ((stepR1StarWordL item phase).2.1 + + (stepR1StarWordL item (stepR1StarWordL item phase).2.2).2.1) + + (stepR1StarWordL item phase).2.1) := by omega + rw [hadd2] + exact sweepStarLoop_sound rest _ _ _ hrest hR k1 + +-- ============================================================================ +-- Section 6.7: Turnaround, Special Loops, and Macro-Step Soundness +-- ============================================================================ + + + +omit rules in +@[simp] theorem modeCfg_R0 (l r : ListBlank (Fin 2)) : modeCfg .R0 l r = r0Cfg l r := rfl +omit rules in +@[simp] theorem modeCfg_R1 (l r : ListBlank (Fin 2)) : modeCfg .R1 l r = r1Cfg l r := rfl +omit rules in +omit rules in +@[simp] theorem modeCfg_R1_ODD (l r : ListBlank (Fin 2)) : modeCfg .R1_ODD l r = r1OddCfg l r := rfl + +def stepOneTokPure (mode : Mode) (t : Tok) : Option (List Tok × Mode) := + Mode.casesOn mode + (Tok.casesOn t none none none (some ([.Z], .R0)) none (some ([.P], .R0)) (some ([.Z], .R1))) + (Tok.casesOn t none none none (some ([.M, .Z], .R0)) none (some ([.P], .R1_ODD)) none) + (Tok.casesOn t none none none (some ([.Z], .R1_ODD)) none (some ([.Z], .R1)) none) + +theorem stepOneTokPure_sound (mode mode' : Mode) (t : Tok) (toks : List Tok) (l r : ListBlank + (Fin 2)) + (h : stepOneTokPure mode t = some (toks, mode')) : + (modeCfg mode l (tokR t +> r)) [target_tm]⊢* + (modeCfg mode' (wordL toks +> l) r) := by + cases mode <;> cases t <;> try contradiction + all_goals + injection h with hp; injection hp with h1 h2; subst h1; subst h2 + simp only [modeCfgGen, wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc] + · exact (rules.r0_Z l r) + · exact (rules.r0_P l r) + · exact (rules.r0_PTTTM_TAIL l r) + · exact (rules.r1_Z l r) + · exact (rules.r1_P l r) + · exact (r1Odd_Z l r) + · exact (rules.r1Odd_P l r) + +def stepOneWordPureL (mode : Mode) (w : List Tok) : Option (List Tok × Mode) := + List.rec + (some ([], mode)) + (fun t _ ih => + Option.casesOn ih none (fun p1 => + Prod.casesOn p1 (fun outRest mode1 => + Option.casesOn (stepOneTokPure mode1 t) none (fun p2 => + Prod.casesOn p2 (fun toks mode2 => + some (appendWord toks outRest, mode2)))))) + w + +theorem stepOneWordPureL_cons (mode : Mode) (t : Tok) (ts : List Tok) : + stepOneWordPureL mode (t :: ts) = + Option.casesOn (stepOneWordPureL mode ts) none (fun p1 => + Prod.casesOn p1 (fun outRest mode1 => + Option.casesOn (stepOneTokPure mode1 t) none (fun p2 => + Prod.casesOn p2 (fun toks mode2 => + some (appendWord toks outRest, mode2))))) := rfl + +theorem stepOneWordPureL_sound : ∀ (w : List Tok) (mode mode' : Mode) (out : List Tok) + (l r : ListBlank (Fin 2)), + stepOneWordPureL mode w = some (out, mode') → + (modeCfg mode l (wordR (revWord w) +> r)) [target_tm]⊢* + (modeCfg mode' (wordL out +> l) r) + | [], mode, mode', out, l, r, h => by + change some ([], mode) = some (out, mode') at h + injection h with hp; injection hp with h1 h2; subst h1; subst h2 + try exact stepStar_refl _ _ + | t :: ts, mode, mode', out, l, r, h => by + rw [stepOneWordPureL_cons] at h + rcases h1 : stepOneWordPureL mode ts with _ | ⟨outRest, mode1⟩ + · rw [h1] at h; contradiction + · rw [h1] at h; dsimp -failIfUnchanged only at h + rcases h2 : stepOneTokPure mode1 t with _ | ⟨toks, mode2⟩ + · rw [h2] at h; contradiction + · rw [h2] at h; dsimp -failIfUnchanged only at h + injection h with hp; injection hp with hout hm; subst hout; subst hm + simp only [revWord_cons, wordR_append, wordR_cons, wordR_nil, List.append_nil, + listblank_append_assoc] + refine stepStar_trans (stepOneWordPureL_sound ts mode mode1 outRest l (tokR t +> r) h1) ?_ + refine stepStar_trans (stepOneTokPure_sound mode1 _ t toks (wordL outRest +> l) r h2) ?_ + rw [appendWord_eq, wordL_append, listblank_append_assoc] + try exact stepStar_refl _ _ + +theorem stepOneWordPureL_same_pow : ∀ (c : Nat) (w out : List Tok) (mode : Mode) (l r : ListBlank + (Fin 2)), + stepOneWordPureL mode w = some (out, mode) → + (modeCfg mode l (((wordR (revWord w)) ^ c) +> r)) [target_tm]⊢* + (modeCfg mode (((wordL out) ^ c) +> l) r) + | 0, _, _, _, _, _, _ => stepStar_refl _ _ + | c + 1, w, out, mode, l, r, h => by + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans (stepOneWordPureL_sound w mode mode out l (((wordR (revWord w)) ^ c) +> + r) h) ?_ + have ih := stepOneWordPureL_same_pow c w out mode (wordL out +> l) r h + rwa [pow_succ_right, listblank_append_assoc] + +theorem stepOneWordPureL_alt_pow : ∀ (q : Nat) (w out1 out2 : List Tok) (mode mode1 : Mode) + (l r : ListBlank (Fin 2)), + stepOneWordPureL mode w = some (out1, mode1) → + stepOneWordPureL mode1 w = some (out2, mode) → + (modeCfg mode l (((wordR (revWord w)) ^ (2 * q)) +> r)) [target_tm]⊢* + (modeCfg mode (((wordL (out2 ++ out1)) ^ q) +> l) r) + | 0, _, _, _, _, _, _, _, _, _ => stepStar_refl _ _ + | q + 1, w, out1, out2, mode, mode1, l, r, h1, h2 => by + have h2q : 2 * (q + 1) = 1 + (1 + 2 * q) := by omega + rw [h2q, list_pow_add, list_pow_add, pow_succ_list, pow_zero_list, List.append_nil, + listblank_append_assoc, listblank_append_assoc] + refine stepStar_trans (stepOneWordPureL_sound w mode mode1 out1 l _ h1) ?_ + refine stepStar_trans (stepOneWordPureL_sound w mode1 mode out2 (wordL out1 +> l) _ h2) ?_ + have ih := stepOneWordPureL_alt_pow q w out1 out2 mode mode1 (wordL (out2 ++ out1) +> l) r h1 h2 + have hw : wordL out2 +> (wordL out1 +> l) = wordL (out2 ++ out1) +> l := by + rw [wordL_append, listblank_append_assoc] + rw [hw, pow_succ_right, listblank_append_assoc] + exact ih + +def stepOneTokL (rle : Rle) (mode : Mode) (t : Tok) : Option (Rle × Mode) := + Mode.casesOn mode + (Tok.casesOn t none none none + (pushRlePosK [.Z] 1 rle fun r => some (r, .R0)) + none + (pushRlePosK [.P] 1 rle fun r => some (r, .R0)) + (pushRlePosK [.Z] 1 rle fun r => some (r, .R1))) + (Tok.casesOn t none none none + (some (pushToksLtr [.Z, .M] rle, .R0)) + none + (pushRlePosK [.P] 1 rle fun r => some (r, .R1_ODD)) + none) + (Tok.casesOn t none none none + (pushRlePosK [.Z] 1 rle fun r => some (r, .R1_ODD)) + none + (pushRlePosK [.Z] 1 rle fun r => some (r, .R1)) + none) + +theorem stepOneTokL_sound (rle rle' : Rle) (mode mode' : Mode) (t : Tok) (r : ListBlank (Fin 2)) + (h : stepOneTokL rle mode t = some (rle', mode')) : + (modeCfg mode (evalRle rle) (tokR t +> r)) [target_tm]⊢* + (modeCfg mode' (evalRle rle') r) := by + cases mode <;> cases t <;> try contradiction + all_goals + simp only [stepOneTokL, pushRlePosK_eq, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + simp only [modeCfgGen, evalRle_pushToksLtr, evalRle_pushRlePos_one, revWord_cons, revWord_nil, + List.nil_append, List.cons_append, wordL_cons, wordL_nil, List.append_nil, + listblank_append_assoc] + · exact (rules.r0_Z (evalRle rle) r) + · exact (rules.r0_P (evalRle rle) r) + · exact (rules.r0_PTTTM_TAIL (evalRle rle) r) + · exact (rules.r1_Z (evalRle rle) r) + · exact (rules.r1_P (evalRle rle) r) + · exact (r1Odd_Z (evalRle rle) r) + · exact (rules.r1Odd_P (evalRle rle) r) + +def stepOneWordL (rle : Rle) (mode : Mode) (w : List Tok) : Option (Rle × Mode) := + List.rec + (some (rle, mode)) + (fun t _ ih => + Option.casesOn ih none (fun p => + Prod.casesOn p (fun rle1 mode1 => stepOneTokL rle1 mode1 t))) + w + +theorem stepOneWordL_cons (rle : Rle) (mode : Mode) (t : Tok) (ts : List Tok) : + stepOneWordL rle mode (t :: ts) = + Option.casesOn (stepOneWordL rle mode ts) none (fun p => + Prod.casesOn p (fun rle1 mode1 => stepOneTokL rle1 mode1 t)) := rfl + +theorem stepOneWordL_sound : ∀ (w : List Tok) (rle rle' : Rle) (mode mode' : Mode) (r : ListBlank + (Fin 2)), + stepOneWordL rle mode w = some (rle', mode') → + (modeCfg mode (evalRle rle) (wordR (revWord w) +> r)) [target_tm]⊢* + (modeCfg mode' (evalRle rle') r) + | [], rle, rle', mode, mode', r, h => by + change some (rle, mode) = some (rle', mode') at h + injection h with hp; injection hp with h1 h2; subst h1; subst h2 + try exact stepStar_refl _ _ + | t :: ts, rle, rle', mode, mode', r, h => by + rw [stepOneWordL_cons] at h + rcases h1 : stepOneWordL rle mode ts with _ | ⟨rle1, mode1⟩ + · rw [h1] at h; contradiction + · rw [h1] at h; dsimp -failIfUnchanged only at h + simp only [revWord_cons, wordR_append, wordR_cons, wordR_nil, List.append_nil, + listblank_append_assoc] + refine stepStar_trans (stepOneWordL_sound ts rle rle1 mode mode1 (tokR t +> r) h1) ?_ + exact stepOneTokL_sound rle1 rle' mode1 mode' t r h + +def stepOneBounceFuel (fuel : Nat) (item : List Tok) (count : Nat) (rle : Rle) + (mode : Mode) : Option (Rle × Mode) := + Nat.rec + (fun count rle mode => + Nat.casesOn count (some (rle, mode)) (fun _ => none)) + (fun _ ih count rle mode => + Nat.casesOn count + (some (rle, mode)) + (fun countPred => + Bool.casesOn (modeEq mode .R0) + (Option.casesOn (stepOneWordPureL mode item) none (fun p1 => + Prod.casesOn p1 (fun out1 mode1 => + strictWord out1 fun out1w => + Bool.casesOn (modeEq mode1 mode) + (Bool.casesOn (Nat.ble 1 countPred) + (Option.casesOn (stepOneWordL rle mode item) none (fun p => + Prod.casesOn p (fun rle' mode' => ih countPred rle' mode'))) + (Option.casesOn (stepOneWordPureL mode1 item) none (fun p2 => + Prod.casesOn p2 (fun out2 mode2 => + Bool.casesOn (modeEq mode2 mode) + (Option.casesOn (stepOneWordL rle mode item) none (fun p => + Prod.casesOn p (fun rle' mode' => ih countPred rle' mode'))) + (strictNat (Nat.div (Nat.add countPred 1) 2) fun q => + strictNat (Nat.mod (Nat.add countPred 1) 2) fun rem => + strictWord (appendWord out2 out1w) fun w21 => + pushRleK w21 q rle fun rle' => + ih rem rle' mode))))) + (pushRlePosK out1w (Nat.add countPred 1) rle fun rle' => + some (rle', mode))))) + (Bool.casesOn (isZpWord item) + (Option.casesOn (stepOneWordL rle mode item) none (fun p => + Prod.casesOn p (fun rle' mode' => ih countPred rle' mode'))) + (pushRlePosK item (Nat.add countPred 1) rle fun rle' => + some (rle', .R0))))) + fuel count rle mode + +theorem stepOneBounceFuel_succ (fuel : Nat) (item : List Tok) (count : Nat) (rle : Rle) + (mode : Mode) : + stepOneBounceFuel (fuel + 1) item (count + 1) rle mode = + Bool.casesOn (modeEq mode .R0) + (Option.casesOn (stepOneWordPureL mode item) none (fun p1 => + Prod.casesOn p1 (fun out1 mode1 => + strictWord out1 fun out1w => + Bool.casesOn (modeEq mode1 mode) + (Bool.casesOn (Nat.ble 1 count) + (Option.casesOn (stepOneWordL rle mode item) none (fun p => + Prod.casesOn p (fun rle' mode' => stepOneBounceFuel fuel item count rle' mode'))) + (Option.casesOn (stepOneWordPureL mode1 item) none (fun p2 => + Prod.casesOn p2 (fun out2 mode2 => + Bool.casesOn (modeEq mode2 mode) + (Option.casesOn (stepOneWordL rle mode item) none (fun p => + Prod.casesOn p (fun rle' mode' => + stepOneBounceFuel fuel item count rle' mode'))) + (strictNat (Nat.div (Nat.add count 1) 2) fun q => + strictNat (Nat.mod (Nat.add count 1) 2) fun rem => + strictWord (appendWord out2 out1w) fun w21 => + pushRleK w21 q rle fun rle' => + stepOneBounceFuel fuel item rem rle' mode))))) + (pushRlePosK out1w (Nat.add count 1) rle fun rle' => + some (rle', mode))))) + (Bool.casesOn (isZpWord item) + (Option.casesOn (stepOneWordL rle mode item) none (fun p => + Prod.casesOn p (fun rle' mode' => stepOneBounceFuel fuel item count rle' mode'))) + (pushRlePosK item (Nat.add count 1) rle fun rle' => + some (rle', .R0))) := rfl + +theorem stepOneBounceFuel_sound : ∀ (fuel : Nat) (item : List Tok) (count : Nat) + (rle rle' : Rle) (mode mode' : Mode) (r : ListBlank (Fin 2)), + stepOneBounceFuel fuel item count rle mode = some (rle', mode') → + (modeCfg mode (evalRle rle) (((wordR (revWord item)) ^ count) +> r)) [target_tm]⊢* + (modeCfg mode' (evalRle rle') r) + | 0, item, 0, rle, rle', mode, mode', r, h => by + change some (rle, mode) = some (rle', mode') at h + injection h with hp; injection hp with h1 h2; subst h1; subst h2 + try exact stepStar_refl _ _ + | 0, _, _ + 1, _, _, _, _, _, h => by contradiction + | fuel + 1, item, 0, rle, rle', mode, mode', r, h => by + change some (rle, mode) = some (rle', mode') at h + injection h with hp; injection hp with h1 h2; subst h1; subst h2 + try exact stepStar_refl _ _ + | fuel + 1, item, count + 1, rle, rle', mode, mode', r, h => by + rw [stepOneBounceFuel_succ] at h + cases hm0 : modeEq mode .R0 + · rw [hm0] at h; dsimp -failIfUnchanged only at h + rcases hp1 : stepOneWordPureL mode item with _ | ⟨out1, mode1⟩ + · rw [hp1] at h; contradiction + · rw [hp1] at h; simp only [strictWord_eq] at h + cases hm1 : modeEq mode1 mode + · rw [hm1] at h; dsimp -failIfUnchanged only at h + cases hble : Nat.ble 1 count + · rw [hble] at h; dsimp -failIfUnchanged only at h + rcases hw : stepOneWordL rle mode item with _ | ⟨rle1, mode1'⟩ + · rw [hw] at h; contradiction + · rw [hw] at h; dsimp -failIfUnchanged only at h + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans (stepOneWordL_sound item rle rle1 mode mode1' _ hw) ?_ + exact stepOneBounceFuel_sound fuel item count rle1 rle' mode1' mode' r h + · rw [hble] at h; dsimp -failIfUnchanged only at h + rcases hp2 : stepOneWordPureL mode1 item with _ | ⟨out2, mode2⟩ + · rw [hp2] at h; contradiction + · rw [hp2] at h; dsimp -failIfUnchanged only at h + cases hm2 : modeEq mode2 mode + · rw [hm2] at h; dsimp -failIfUnchanged only at h + rcases hw : stepOneWordL rle mode item with _ | ⟨rle1, mode1'⟩ + · rw [hw] at h; contradiction + · rw [hw] at h; dsimp -failIfUnchanged only at h + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans (stepOneWordL_sound item rle rle1 mode mode1' _ hw) ?_ + exact stepOneBounceFuel_sound fuel item count rle1 rle' mode1' mode' r h + · rw [hm2] at h + simp only [strictNat_eq, appendWord_eq, pushRleK_eq, + nat_add_eq, nat_div_eq, nat_mod_eq] at h + have hm2_eq : mode2 = mode := (modeEq_iff mode2 mode).mp hm2 + subst mode2 + generalize hq : (count + 1) / 2 = q at h + generalize hrem : (count + 1) % 2 = rem at h + have hdiv : count + 1 = 2 * q + rem := by omega + rw [hdiv, list_pow_add, listblank_append_assoc] + refine stepStar_trans (stepOneWordPureL_alt_pow q item out1 out2 mode mode1 + (evalRle rle) _ hp1 hp2) ?_ + rw [← evalRle_pushRle] + exact stepOneBounceFuel_sound fuel item rem (pushRle + (out2 ++ out1) q rle) rle' mode mode' r h + · rw [hm1] at h; simp only [pushRlePosK_eq, nat_add_eq, Option.some.injEq, + Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + have hm1_eq : mode1 = mode := (modeEq_iff mode1 mode).mp hm1 + subst mode1 + rw [evalRle_pushRlePos] + exact stepOneWordPureL_same_pow (count + 1) item out1 mode (evalRle rle) r hp1 + · rw [hm0] at h; dsimp -failIfUnchanged only at h + cases hzp : isZpWord item + · rw [hzp] at h; dsimp -failIfUnchanged only at h + rcases hw : stepOneWordL rle mode item with _ | ⟨rle1, mode1'⟩ + · rw [hw] at h; contradiction + · rw [hw] at h; dsimp -failIfUnchanged only at h + rw [pow_succ_list, listblank_append_assoc] + refine stepStar_trans (stepOneWordL_sound item rle rle1 mode mode1' _ hw) ?_ + exact stepOneBounceFuel_sound fuel item count rle1 rle' mode1' mode' r h + · rw [hzp] at h; simp only [pushRlePosK_eq, nat_add_eq, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + have hm0_eq : mode = .R0 := (modeEq_iff mode .R0).mp hm0 + subst mode + have hrev : isZpWord (revWord item) = true := by rw [isZpWord_revWord]; exact hzp + simp only [modeCfg_R0, evalRle_pushRlePos] + have hr0 := r0_pow (target_tm := target_tm) (count + 1) (revWord item) (evalRle rle) r hrev + rwa [revWord_revWord] at hr0 + +def simpleOneBounceCarry (rle : Rle) (mode : Mode) (rs : Rle) (k1 : Nat) : Option (Rle × Nat) := + List.rec + (fun rle mode => + Bool.casesOn (modeEq mode .R0) none + (strictNat (Nat.add k1 2) fun kOut => some (rle, kOut))) + (fun p _ ih rle mode => + Prod.casesOn p (fun item count => + Option.casesOn (stepOneBounceFuel 3 item count rle mode) none (fun p' => + Prod.casesOn p' (fun rle' mode' => ih rle' mode')))) + rs rle mode + +theorem simpleOneBounceCarry_cons (rle : Rle) (mode : Mode) (item : List Tok) (count : Nat) + (rest : Rle) (k1 : Nat) : + simpleOneBounceCarry rle mode ((item, count) :: rest) k1 = + Option.casesOn (stepOneBounceFuel 3 item count rle mode) none (fun p' => + Prod.casesOn p' (fun rle' mode' => simpleOneBounceCarry rle' mode' rest k1)) := rfl + +theorem simpleOneBounceCarry_sound : ∀ (rs : Rle) (rle rle' : Rle) (mode : Mode) (k1 kOut : Nat), + simpleOneBounceCarry rle mode rs k1 = some (rle', kOut) → + (modeCfg mode (evalRle rle) (evalRStack rs (evalWK k1))) [target_tm]⊢* + (carryCfg (evalRle rle') (evalWK kOut)) + | [], rle, rle', mode, k1, kOut, h => by + unfold simpleOneBounceCarry at h; dsimp -failIfUnchanged only at h + cases hm : modeEq mode .R0 + · rw [hm] at h; contradiction + · rw [hm] at h; dsimp -failIfUnchanged only [strictNat_eq] at h + injection h with hp; injection hp with h1 h2; subst h1; subst h2 + rw [(modeEq_iff mode .R0).mp hm] + exact r0_end k1 (evalRle rle) + | (item, count) :: rest, rle, rle', mode, k1, kOut, h => by + rw [simpleOneBounceCarry_cons] at h + rcases hb : stepOneBounceFuel 3 item count rle mode with _ | ⟨rle1, mode1⟩ + · rw [hb] at h; contradiction + · rw [hb] at h; dsimp -failIfUnchanged only at h + simp only [evalRStack_cons] + refine stepStar_trans (stepOneBounceFuel_sound 3 item count rle rle1 mode mode1 _ hb) ?_ + exact simpleOneBounceCarry_sound rest rle1 rle' mode1 k1 kOut h + +def hasSpecialWord (w : List Tok) : Bool := + List.casesOn w false (fun t _ => + Tok.casesOn t false false false false false false true) + +def hasSpecial (rs : Rle) : Bool := + List.rec false (fun p _ ih => Prod.casesOn p (fun it _ => Bool.casesOn + (hasSpecialWord it) ih true)) rs + +def runRightSweepStarCarry (rle : Rle) (mode : Mode) (rStack : Rle) (k1 : Nat) : Option + (Rle × Nat) := + Bool.casesOn (hasSpecial rStack) + (Bool.casesOn (modeEq mode .R0) + (Bool.casesOn (allZpStack rStack) + none + (Prod.casesOn (sweepStarLoop rle (Bool.casesOn (modeEq mode .R1) true false) 0 rStack) + (fun rle1 rest => + Prod.casesOn rest (fun finalPhase totalRes => + strictNat (Nat.add k1 (Nat.mul 2 totalRes)) fun kFinal1 => + Bool.casesOn finalPhase + (strictNat (Nat.add kFinal1 1) fun kf => + pushRlePosK [.P] 1 rle1 fun rle2 => + some (stepZtToCarry rle2 kf)) + (pushRlePosK [.Z] 1 rle1 fun rle2 => + some (stepZtToCarry rle2 kFinal1)))))) + (Option.casesOn (copyRStack rle rStack) none (fun rle' => + strictNat (Nat.add k1 2) fun kOut => some (rle', kOut)))) + (simpleOneBounceCarry rle mode rStack k1) + +theorem runRightSweepStarCarry_sound (rle rStack rOut : Rle) (mode : Mode) (k1 kOut : Nat) + (h : runRightSweepStarCarry rle mode rStack k1 = some (rOut, kOut)) : + (modeCfg mode (evalRle rle) (evalRStack rStack (evalWK k1))) [target_tm]⊢* + (carryCfg (evalRle rOut) (evalWK kOut)) := by + unfold runRightSweepStarCarry at h + cases hs : hasSpecial rStack + · rw [hs] at h; dsimp -failIfUnchanged only at h + cases hm : modeEq mode .R0 + · rw [hm] at h; dsimp -failIfUnchanged only at h + cases hall : allZpStack rStack + · rw [hall] at h; contradiction + · rw [hall] at h; dsimp -failIfUnchanged only at h + have hphase : modeCfg mode (evalRle rle) (evalRStack rStack (evalWK k1)) = + r1PhaseCfg (Bool.casesOn (modeEq mode .R1) true false) (evalRle rle) + (evalRStack rStack (evalWK (k1 + 2 * 0))) := by + cases mode with + | R0 => contradiction + | R1 => rfl + | R1_ODD => rfl + rw [hphase] + have hsw_sound := sweepStarLoop_sound (l_tail := l_tail) rStack rle (Bool.casesOn + (modeEq mode .R1) true false) 0 hall (hasRoundtrip_evalWK (target_tm := target_tm)) k1 + dsimp -failIfUnchanged only at hsw_sound + rcases hsw : sweepStarLoop rle (Bool.casesOn + (modeEq mode .R1) true false) 0 rStack with ⟨rle1, finalPhase, totalRes⟩ + rw [hsw] at h hsw_sound + dsimp -failIfUnchanged only at h hsw_sound + refine stepStar_trans hsw_sound ?_ + cases finalPhase + · simp only [strictNat_eq, pushRlePosK_eq, nat_add_eq, nat_mul_eq, Option.some.injEq] at h + have h1 := congrArg Prod.fst h + have h2 := congrArg Prod.snd h + dsimp -failIfUnchanged only at h1 h2 + rw [← h1, ← h2] + simp only [r1PhaseCfg_false] + refine stepStar_trans (r1_end (k1 + 2 * totalRes) (evalRle rle1)) ?_ + have hzt := stepZtToCarry_sound (target_tm := target_tm) (l_tail := l_tail) + (pushRlePos [.P] 1 rle1) + (k1 + 2 * totalRes + 1) + rw [evalRle_pushRlePos_one] at hzt + exact hzt + · simp only [strictNat_eq, pushRlePosK_eq, nat_add_eq, nat_mul_eq, Option.some.injEq] at h + have h1 := congrArg Prod.fst h + have h2 := congrArg Prod.snd h + dsimp -failIfUnchanged only at h1 h2 + rw [← h1, ← h2] + simp only [r1PhaseCfg_true] + refine stepStar_trans (r1Odd_end (k1 + 2 * totalRes) (evalRle rle1)) ?_ + have hzt := stepZtToCarry_sound (target_tm := target_tm) (l_tail := l_tail) + (pushRlePos [.Z] 1 rle1) + (k1 + 2 * totalRes) + rw [evalRle_pushRlePos_one] at hzt + exact hzt + · rw [hm] at h; dsimp -failIfUnchanged only at h + rcases hc : copyRStack rle rStack with _ | rle' + · rw [hc] at h; contradiction + · rw [hc] at h; simp only [strictNat_eq, Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl⟩ + rw [(modeEq_iff mode .R0).mp hm, modeCfg_R0] + refine stepStar_trans (copyRStack_sound (target_tm := target_tm) rStack rle rle' + (evalWK k1) hc).2 ?_ + exact r0_end k1 (evalRle rle') + · rw [hs] at h; dsimp -failIfUnchanged only at h + exact simpleOneBounceCarry_sound rStack rle rOut mode k1 kOut h + +inductive StepCarryRes + | halt + | next (rle : Rle) (k1 : Nat) + | err + deriving DecidableEq, Repr + +def StepCarryValidAuxGen (target_tm : Machine (Fin 2) (Fin 6)) (l_tail : ListBlank (Fin 2)) + (cfg : Cfg (Fin 2) (Fin 6)) : StepCarryRes → Prop + | .halt => ∃ cfg', (cfg [target_tm]⊢* cfg') ∧ (step target_tm cfg').isNone + | .next rOut kOut => cfg [target_tm]⊢* carryCfgGen target_tm (evalRleAux l_tail rOut) + (evalWK kOut) + | .err => False +local notation "StepCarryValidAux" => StepCarryValidAuxGen target_tm +local notation "StepCarryValid" => StepCarryValidAuxGen target_tm l_tail + +omit rules in +theorem stepCarryValid_of_stepStar {cfg₁ cfg₂ : Cfg (Fin 2) (Fin 6)} {res : StepCarryRes} + (hstep : cfg₁ [target_tm]⊢* cfg₂) (hval : StepCarryValid cfg₂ res) : + StepCarryValid cfg₁ res := by + cases res with + | halt => + rcases hval with ⟨cfg', h2, hnone⟩ + exact ⟨cfg', stepStar_trans hstep h2, hnone⟩ + | next rOut kOut => + exact stepStar_trans hstep hval + | err => exact hval + +def finishTurn (rle : Rle) (mode : Mode) (rStack : Rle) (k1 : Nat) : StepCarryRes := + Option.casesOn (runRightSweepStarCarry rle mode rStack k1) .err (fun p => + Prod.casesOn p (fun rOut kOut => .next rOut kOut)) + +theorem finishTurn_sound (rle : Rle) (mode : Mode) (rStack : Rle) (k1 : Nat) + (hne : finishTurn rle mode rStack k1 ≠ .err) : + StepCarryValid (modeCfg mode (evalRle rle) (evalRStack rStack (evalWK k1))) + (finishTurn rle mode rStack k1) := by + unfold finishTurn at hne ⊢ + rcases hr : runRightSweepStarCarry rle mode rStack k1 with _ | ⟨rOut, kOut⟩ + · try rw [hr] at hne + dsimp -failIfUnchanged only at hne; exfalso; exact hne rfl + · try rw [hr] + dsimp -failIfUnchanged only + exact runRightSweepStarCarry_sound rle rStack rOut mode k1 kOut hr + +def matchRule2 (t1 t2 : Tok) : Option (List Tok × Mode) := + Tok.casesOn t1 + none + (Tok.casesOn t2 none none (some ([.T], .R1)) (some ([.P], .R1)) none none none) + none none + (Tok.casesOn t2 none none none (some ([.T, .M], .R1)) none (some ([.T, .P], .R0)) none) + none none + +theorem matchRule2_sound (t1 t2 : Tok) (out : List Tok) (mode : Mode) (r4 : Rle) (r : ListBlank + (Fin 2)) + (h : matchRule2 t1 t2 = some (out, mode)) : + (carryCfg (tokL t1 +> (tokL t2 +> evalRle r4)) r) [target_tm]⊢* + (modeCfg mode (evalRle (pushToksLtr out r4)) r) := by + cases t1 <;> try contradiction + all_goals (cases t2 <;> try contradiction) + all_goals + injection h with hp; injection hp with h1 h2; subst h1; subst h2 + simp only [modeCfgGen, evalRle_pushToksLtr, revWord_cons, revWord_nil, List.nil_append, + List.cons_append, wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc] + · exact (rules.turn_WM (evalRle r4) r) + · exact (rules.turn_ZM (evalRle r4) r) + · exact (rules.turn_ZT (evalRle r4) r) + · exact (rules.turn_PT (evalRle r4) r) + +def matchRule3 (t1 t2 t3 : Tok) : Option (List Tok × Mode) := + Tok.casesOn t1 + (Tok.casesOn t2 none + (Tok.casesOn t3 none none none (some ([.T, .T], .R1_ODD)) none none none) + none none none none none) + (Tok.casesOn t2 none none none none + (Tok.casesOn t3 none none none (some ([.T, .M, .P], .R0)) none (some ([.T, .Z], .R1)) none) + none none) + (Tok.casesOn t2 none none none none + (Tok.casesOn t3 none none none (some ([.T, .W, .Z], .R0)) none (some ([.M, .U, .Z], + .R1_ODD)) none) + none none) + none + (Tok.casesOn t2 none none none none + (Tok.casesOn t3 none none none (some ([.T, .W, .P], .R0)) none (some ([.M, .U, .Z], + .R1)) none) + none none) + none none + +theorem matchRule3_sound (t1 t2 t3 : Tok) (out : List Tok) (mode : Mode) (r5 : Rle) (r : ListBlank + (Fin 2)) + (h : matchRule3 t1 t2 t3 = some (out, mode)) : + (carryCfg (tokL t1 +> (tokL t2 +> (tokL t3 +> evalRle r5))) r) [target_tm]⊢* + (modeCfg mode (evalRle (pushToksLtr out r5)) r) := by + cases t1 <;> try contradiction + all_goals (cases t2 <;> try contradiction) + all_goals (cases t3 <;> try contradiction) + all_goals + injection h with hp; injection hp with h1 h2; subst h1; subst h2 + simp only [modeCfgGen, evalRle_pushToksLtr, revWord_cons, revWord_nil, List.nil_append, + List.cons_append, wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc] + · exact (rules.turn_ZMU (evalRle r5) r) + · exact (rules.turn_ZTM (evalRle r5) r) + · exact (rules.turn_PTM (evalRle r5) r) + · exact (rules.turn_ZTW (evalRle r5) r) + · exact (rules.turn_PTW (evalRle r5) r) + · exact (rules.turn_ZTT (evalRle r5) r) + · exact (rules.turn_PTT (evalRle r5) r) + +def matchRule4 (t1 t2 t3 t4 : Tok) : Option (List Tok × Mode) := + Tok.casesOn t1 + (Tok.casesOn t2 none + (Tok.casesOn t3 none none none none none + (Tok.casesOn t4 none none none (some ([.T, .W, .M, .P], .R0)) none none none) + none) + none none none none none) + (Tok.casesOn t2 none none none none + (Tok.casesOn t3 none none none none + (Tok.casesOn t4 none none none (some ([.T, .W, .Z], .R1)) none (some ([.M, .U, .Z, .P], + .R0)) none) + none none) + none none) + (Tok.casesOn t2 none none none none + (Tok.casesOn t3 + (Tok.casesOn t4 none (some ([.T, .Z], .R1_ODD)) none none none none none) + none none none + (Tok.casesOn t4 none none none (some ([.P, .Z, .Z], .R0)) none none none) + none none) + none none) + none + (Tok.casesOn t2 none + (Tok.casesOn t3 none none none none + (Tok.casesOn t4 none none none none none (some ([.M, .U, .Z, .P], .R0)) none) + none none) + none none + (Tok.casesOn t3 none none none none + (Tok.casesOn t4 none none none (some ([.P, .Z, .P], .R0)) none none none) + none none) + none none) + none none + +theorem matchRule4_sound (t1 t2 t3 t4 : Tok) (out : List Tok) (mode : Mode) (r6 : Rle) + (r : ListBlank (Fin 2)) + (h : matchRule4 t1 t2 t3 t4 = some (out, mode)) : + (carryCfg (tokL t1 +> (tokL t2 +> (tokL t3 +> (tokL t4 +> evalRle r6)))) r) [target_tm]⊢* + (modeCfg mode (evalRle (pushToksLtr out r6)) r) := by + cases t1 <;> try contradiction + all_goals (cases t2 <;> try contradiction) + all_goals (cases t3 <;> try contradiction) + all_goals (cases t4 <;> try contradiction) + all_goals + injection h with hp; injection hp with h1 h2; subst h1; subst h2 + simp only [modeCfgGen, evalRle_pushToksLtr, revWord_cons, revWord_nil, List.nil_append, + List.cons_append, wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc] + · exact (rules.turn_ZPMU (evalRle r6) r) + · exact (rules.turn_ZTTM (evalRle r6) r) + · exact (rules.turn_PTTM (evalRle r6) r) + · exact (rules.turn_MUTW (evalRle r6) r) + · exact (rules.turn_ZTTW (evalRle r6) r) + · exact (rules.turn_PTMT (evalRle r6) r) + · exact (rules.turn_ZTTT (evalRle r6) r) + +def matchRule5 (t1 t2 t3 t4 t5 : Tok) : Option (List Tok × Mode) := + Tok.casesOn t1 + none + (Tok.casesOn t2 none none none none + (Tok.casesOn t3 + (Tok.casesOn t4 none + (Tok.casesOn t5 none none none (some ([.P, .Z, .P], .R0)) none none none) + none none none none none) + none none none + (Tok.casesOn t4 none none none none + (Tok.casesOn t5 none none none (some ([.P, .Z, .Z], .R1)) none none none) + none none) + none none) + none none) + (Tok.casesOn t2 none none none none + (Tok.casesOn t3 none none none none + (Tok.casesOn t4 none none none none + (Tok.casesOn t5 none none none none none (some ([.T, .Z, .Z, .Z], .R0)) none) + none none) + none none) + none none) + none none none none + +theorem matchRule5_sound (t1 t2 t3 t4 t5 : Tok) (out : List Tok) (mode : Mode) (r7 : Rle) + (r : ListBlank (Fin 2)) + (h : matchRule5 t1 t2 t3 t4 t5 = some (out, mode)) : + (carryCfg (tokL t1 +> (tokL t2 +> (tokL t3 +> (tokL t4 +> (tokL t5 +> + evalRle r7))))) r) [target_tm]⊢* + (modeCfg mode (evalRle (pushToksLtr out r7)) r) := by + cases t1 <;> try contradiction + all_goals (cases t2 <;> try contradiction) + all_goals (cases t3 <;> try contradiction) + all_goals (cases t4 <;> try contradiction) + all_goals (cases t5 <;> try contradiction) + all_goals + injection h with hp; injection hp with h1 h2; subst h1; subst h2 + simp only [modeCfgGen, evalRle_pushToksLtr, revWord_cons, revWord_nil, List.nil_append, + List.cons_append, wordL_cons, wordL_nil, List.append_nil, listblank_append_assoc] + · exact (rules.turn_ZMUTM (evalRle r7) r) + · exact (rules.turn_ZTTTM (evalRle r7) r) + · exact (rules.turn_PTTTW (evalRle r7) r) + +def isEmptyRle (r : Rle) : Bool := + List.casesOn r true (fun _ _ => false) + +@[simp] theorem isEmptyRle_iff (r : Rle) : isEmptyRle r = true ↔ r = [] := by + cases r <;> simp [isEmptyRle] + +def stepTurnFrom3 (t1 t2 t3 : Tok) (r5 rStack : Rle) (k1 : Nat) : StepCarryRes := + Option.casesOn (matchRule3 t1 t2 t3) + (Option.casesOn (popLastTok r5) .err (fun p4 => + Prod.casesOn p4 (fun t4 r6 => + Option.casesOn (matchRule4 t1 t2 t3 t4) + (Option.casesOn (popLastTok r6) .err (fun p5 => + Prod.casesOn p5 (fun t5 r7 => + Option.casesOn (matchRule5 t1 t2 t3 t4 t5) .err (fun pm => + Prod.casesOn pm (fun out mode => finishTurn (pushToksLtr out r7) mode rStack k1))))) + (fun pm => Prod.casesOn pm (fun out mode => finishTurn + (pushToksLtr out r6) mode rStack k1))))) + (fun pm => Prod.casesOn pm (fun out mode => finishTurn (pushToksLtr out r5) mode rStack k1)) + +theorem stepTurnFrom3_sound (t1 t2 t3 : Tok) (r5 rStack : Rle) (k1 : Nat) + (hne : stepTurnFrom3 t1 t2 t3 r5 rStack k1 ≠ .err) : + StepCarryValid (carryCfg (tokL t1 +> (tokL t2 +> (tokL t3 +> evalRle r5))) (evalRStack rStack + (evalWK k1))) + (stepTurnFrom3 t1 t2 t3 r5 rStack k1) := by + unfold stepTurnFrom3 at hne ⊢ + rcases hm3 : matchRule3 t1 t2 t3 with _ | ⟨out, mode⟩ + · try rw [hm3] at hne; try rw [hm3] + dsimp -failIfUnchanged only at hne ⊢ + rcases hp4 : popLastTok r5 with _ | ⟨t4, r6⟩ + · try rw [hp4] at hne + dsimp -failIfUnchanged only at hne; exfalso; exact hne rfl + · try rw [hp4] at hne; try rw [hp4] + dsimp -failIfUnchanged only at hne ⊢ + rw [popLastTok_sound r5 t4 r6 hp4] + rcases hm4 : matchRule4 t1 t2 t3 t4 with _ | ⟨out, mode⟩ + · try rw [hm4] at hne; try rw [hm4] + dsimp -failIfUnchanged only at hne ⊢ + rcases hp5 : popLastTok r6 with _ | ⟨t5, r7⟩ + · try rw [hp5] at hne + dsimp -failIfUnchanged only at hne; exfalso; exact hne rfl + · try rw [hp5] at hne; try rw [hp5] + dsimp -failIfUnchanged only at hne ⊢ + rw [popLastTok_sound r6 t5 r7 hp5] + rcases hm5 : matchRule5 t1 t2 t3 t4 t5 with _ | ⟨out, mode⟩ + · try rw [hm5] at hne + dsimp -failIfUnchanged only at hne; exfalso; exact hne rfl + · try rw [hm5] at hne; try rw [hm5] + dsimp -failIfUnchanged only at hne ⊢ + exact stepCarryValid_of_stepStar (matchRule5_sound t1 t2 t3 t4 t5 out mode r7 _ hm5) + (finishTurn_sound (pushToksLtr out r7) mode rStack k1 hne) + · try rw [hm4] at hne; try rw [hm4] + dsimp -failIfUnchanged only at hne ⊢ + exact stepCarryValid_of_stepStar (matchRule4_sound t1 t2 t3 t4 out mode r6 _ hm4) + (finishTurn_sound (pushToksLtr out r6) mode rStack k1 hne) + · try rw [hm3] at hne; try rw [hm3] + dsimp -failIfUnchanged only at hne ⊢ + exact stepCarryValid_of_stepStar (matchRule3_sound t1 t2 t3 out mode r5 _ hm3) + (finishTurn_sound (pushToksLtr out r5) mode rStack k1 hne) + +def stepTurnFrom2 (t1 t2 : Tok) (r4 rStack : Rle) (k1 : Nat) : StepCarryRes := + Option.casesOn (matchRule2 t1 t2) + (Option.casesOn (popLastTok r4) .err (fun p3 => + Prod.casesOn p3 (fun t3 r5 => + Bool.casesOn (tokEq t1 .U) + (stepTurnFrom3 t1 t2 t3 r5 rStack k1) + (Bool.casesOn (tokEq t2 .T) + (stepTurnFrom3 t1 t2 t3 r5 rStack k1) + (Bool.casesOn (tokEq t3 .Z) + (stepTurnFrom3 t1 t2 t3 r5 rStack k1) + .halt))))) + (fun pm => Prod.casesOn pm (fun out mode => finishTurn (pushToksLtr out r4) mode rStack k1)) + +theorem stepTurnFrom2_sound (t1 t2 : Tok) (r4 rStack : Rle) (k1 : Nat) + (hne : stepTurnFrom2 t1 t2 r4 rStack k1 ≠ .err) : + StepCarryValid (carryCfg (tokL t1 +> (tokL t2 +> evalRle r4)) (evalRStack rStack (evalWK k1))) + (stepTurnFrom2 t1 t2 r4 rStack k1) := by + unfold stepTurnFrom2 at hne ⊢ + rcases hm2 : matchRule2 t1 t2 with _ | ⟨out, mode⟩ + · try rw [hm2] at hne; try rw [hm2] + dsimp -failIfUnchanged only at hne ⊢ + rcases hp3 : popLastTok r4 with _ | ⟨t3, r5⟩ + · try rw [hp3] at hne + dsimp -failIfUnchanged only at hne; exfalso; exact hne rfl + · try rw [hp3] at hne; try rw [hp3] + dsimp -failIfUnchanged only at hne ⊢ + rw [popLastTok_sound r4 t3 r5 hp3] + cases hu1 : tokEq t1 .U + · try rw [hu1] at hne; try rw [hu1] + dsimp -failIfUnchanged only at hne ⊢ + exact stepTurnFrom3_sound t1 t2 t3 r5 rStack k1 hne + · try rw [hu1] at hne; try rw [hu1] + dsimp -failIfUnchanged only at hne ⊢ + cases ht2 : tokEq t2 .T + · try rw [ht2] at hne; try rw [ht2] + dsimp -failIfUnchanged only at hne ⊢ + exact stepTurnFrom3_sound t1 t2 t3 r5 rStack k1 hne + · try rw [ht2] at hne; try rw [ht2] + dsimp -failIfUnchanged only at hne ⊢ + cases hz3 : tokEq t3 .Z + · try rw [hz3] at hne; try rw [hz3] + dsimp -failIfUnchanged only at hne ⊢ + exact stepTurnFrom3_sound t1 t2 t3 r5 rStack k1 hne + · try rw [hz3] at hne; try rw [hz3] + dsimp -failIfUnchanged only at hne ⊢ + rw [(tokEq_iff t1 .U).mp hu1, (tokEq_iff t2 .T).mp ht2, (tokEq_iff t3 .Z).mp hz3] + exact rules.turn_ZTU_halt (evalRle r5) (evalRStack rStack (evalWK k1)) + · try rw [hm2] at hne; try rw [hm2] + dsimp -failIfUnchanged only at hne ⊢ + exact stepCarryValid_of_stepStar (matchRule2_sound t1 t2 out mode r4 _ hm2) + (finishTurn_sound (pushToksLtr out r4) mode rStack k1 hne) + +def stepTurnaround (r2 rStack : Rle) (k1 : Nat) : StepCarryRes := + Option.casesOn (popLastTok r2) .err (fun p1 => + Prod.casesOn p1 (fun t1 r3 => + Option.casesOn (popLastTok r3) .err (fun p2 => + Prod.casesOn p2 (fun t2 r4 => + stepTurnFrom2 t1 t2 r4 rStack k1)))) + +theorem stepTurnaround_sound (r2 rStack : Rle) (k1 : Nat) + (hne : stepTurnaround r2 rStack k1 ≠ .err) : + StepCarryValid (carryCfg (evalRle r2) (evalRStack rStack (evalWK k1))) + (stepTurnaround r2 rStack k1) := by + unfold stepTurnaround at hne ⊢ + rcases hp1 : popLastTok r2 with _ | ⟨t1, r3⟩ + · try rw [hp1] at hne + dsimp -failIfUnchanged only at hne; exfalso; exact hne rfl + · try rw [hp1] at hne; try rw [hp1] + dsimp -failIfUnchanged only at hne ⊢ + rw [popLastTok_sound r2 t1 r3 hp1] + rcases hp2 : popLastTok r3 with _ | ⟨t2, r4⟩ + · try rw [hp2] at hne + dsimp -failIfUnchanged only at hne; exfalso; exact hne rfl + · try rw [hp2] at hne; try rw [hp2] + dsimp -failIfUnchanged only at hne ⊢ + rw [popLastTok_sound r3 t2 r4 hp2] + exact stepTurnFrom2_sound t1 t2 r4 rStack k1 hne + +theorem wordL_Z_pow (n : Nat) : (wordL [.Z]) ^ n = (tokL .Z) ^ n := rfl +theorem wordL_P_pow (n : Nat) : (wordL [.P]) ^ n = (tokL .P) ^ n := rfl + +theorem special_ZTM_loop : ∀ (n : Nat) (l : ListBlank (Fin 2)) {R : Nat → ListBlank (Fin 2)}, + HasRoundtrip R → ∀ (k1 : Nat), + (carryCfg (tokL .M +> (tokL .T +> (((tokL .Z) ^ (n + 1)) +> l))) (R k1)) [target_tm]⊢* + (r0Cfg (((tokL .P) ^ (n + 1)) +> (tokL .M +> (tokL .T +> l))) (R (k1 + 2 * n))) + | 0, l, R, _, k1 => by + simp only [Nat.zero_add, pow_succ_list, pow_zero_list, List.append_nil, Nat.mul_zero, + Nat.add_zero] + exact (rules.turn_ZTM l (R k1)) + | n + 1, l, R, hR, k1 => by + rw [pow_succ_list (tokL .Z) (n + 1), listblank_append_assoc] + refine stepStar_trans (rules.turn_ZTM (((tokL .Z) ^ (n + 1)) +> l) (R k1)) ?_ + refine stepStar_trans (hR (tokL .P +> (tokL .M +> (tokL .T +> (((tokL .Z) ^ (n + 1)) +> + l)))) k1) ?_ + refine stepStar_trans (rules.carry_P (tokL .M +> (tokL .T +> (((tokL .Z) ^ (n + 1)) +> l))) (R + (k1 + 2))) ?_ + refine stepStar_trans (special_ZTM_loop n l (hasRoundtrip_P hR) (k1 + 2)) ?_ + refine stepStar_trans (rules.r0_P (((tokL .P) ^ (n + 1)) +> (tokL .M +> (tokL .T +> l))) (R + (k1 + 2 + 2 * n))) ?_ + have hadd : k1 + 2 + 2 * n = k1 + 2 * (n + 1) := by omega + rw [hadd, ← listblank_append_assoc, ← pow_succ_list (tokL .P) (n + 1)] + try exact stepStar_refl _ _ + +theorem special_PT_loop : ∀ (n : Nat) (l : ListBlank (Fin 2)) {R : Nat → ListBlank (Fin 2)}, + HasRoundtrip R → ∀ (k1 : Nat), + (carryCfg (tokL .T +> (((tokL .P) ^ (n + 1)) +> l)) (R k1)) [target_tm]⊢* + (r0Cfg (((tokL .P) ^ (n + 1)) +> (tokL .T +> l)) (R (k1 + 2 * n))) + | 0, l, R, _, k1 => by + simp only [Nat.zero_add, pow_succ_list, pow_zero_list, List.append_nil, Nat.mul_zero, + Nat.add_zero] + exact (rules.turn_PT l (R k1)) + | n + 1, l, R, hR, k1 => by + rw [pow_succ_list (tokL .P) (n + 1), listblank_append_assoc] + refine stepStar_trans (rules.turn_PT (((tokL .P) ^ (n + 1)) +> l) (R k1)) ?_ + refine stepStar_trans (hR (tokL .P +> (tokL .T +> (((tokL .P) ^ (n + 1)) +> l))) k1) ?_ + refine stepStar_trans (rules.carry_P (tokL .T +> (((tokL .P) ^ (n + 1)) +> l)) (R (k1 + 2))) ?_ + refine stepStar_trans (special_PT_loop n l (hasRoundtrip_P hR) (k1 + 2)) ?_ + refine stepStar_trans (rules.r0_P (((tokL .P) ^ (n + 1)) +> (tokL .T +> l)) (R + (k1 + 2 + 2 * n))) ?_ + have hadd : k1 + 2 + 2 * n = k1 + 2 * (n + 1) := by omega + rw [hadd, ← listblank_append_assoc, ← pow_succ_list (tokL .P) (n + 1)] + try exact stepStar_refl _ _ + +theorem special_ZTW_loop : ∀ (n : Nat) (l : ListBlank (Fin 2)) {R : Nat → ListBlank (Fin 2)}, + HasRoundtrip R → ∀ (k1 : Nat), + (carryCfg (tokL .W +> (tokL .T +> (((tokL .Z) ^ (n + 1)) +> l))) (R k1)) [target_tm]⊢* + (r0Cfg (((tokL .Z) ^ (n + 1)) +> (tokL .W +> (tokL .T +> l))) (R (k1 + 2 * n))) + | 0, l, R, _, k1 => by + simp only [Nat.zero_add, pow_succ_list, pow_zero_list, List.append_nil, Nat.mul_zero, + Nat.add_zero] + exact (rules.turn_ZTW l (R k1)) + | n + 1, l, R, hR, k1 => by + rw [pow_succ_list (tokL .Z) (n + 1), listblank_append_assoc] + refine stepStar_trans (rules.turn_ZTW (((tokL .Z) ^ (n + 1)) +> l) (R k1)) ?_ + refine stepStar_trans (hR (tokL .Z +> (tokL .W +> (tokL .T +> (((tokL .Z) ^ (n + 1)) +> + l)))) k1) ?_ + refine stepStar_trans (rules.carry_Z (tokL .W +> (tokL .T +> (((tokL .Z) ^ (n + 1)) +> l))) (R + (k1 + 2))) ?_ + refine stepStar_trans (special_ZTW_loop n l (hasRoundtrip_Z hR) (k1 + 2)) ?_ + refine stepStar_trans (rules.r0_Z (((tokL .Z) ^ (n + 1)) +> (tokL .W +> (tokL .T +> l))) (R + (k1 + 2 + 2 * n))) ?_ + have hadd : k1 + 2 + 2 * n = k1 + 2 * (n + 1) := by omega + rw [hadd, ← listblank_append_assoc, ← pow_succ_list (tokL .Z) (n + 1)] + try exact stepStar_refl _ _ + +def stepSpecialLoops (r2 rStack : Rle) (k1 : Nat) : Option StepCarryRes := + Option.casesOn (popLastTok r2) none (fun p1 => + Prod.casesOn p1 (fun t1 r2a => + Tok.casesOn t1 + (Option.casesOn (popTok .M r2a) none (fun rest => + Prod.casesOn (popTokCount 8 .P 0 rest) (fun mVal r3 => + Bool.casesOn (Nat.beq mVal 0) + (Option.casesOn (popTok .Z r3) (some .err) (fun r4 => + strictNat (Nat.sub mVal 1) fun mm1 => + pushRleK [.Z] mm1 (pushToksLtr [.T, .W, .M] r4) fun r4a => + pushRlePosK [.P] 1 r4a fun r5 => + some (finishTurn r5 .R0 rStack k1))) + none))) + (Option.casesOn (popTok .T r2a) none (fun rest => + Prod.casesOn (popTokCount 8 .Z 0 rest) (fun b r3 => + Bool.casesOn (Nat.beq b 0) + (pushRlePosK [.P] b (pushToksLtr [.T, .M] r3) fun r3' => + Option.casesOn (copyRStack r3' rStack) (some .err) (fun r4 => + strictNat (Nat.add k1 (Nat.mul 2 b)) fun kOut => some (.next r4 kOut))) + none))) + (Option.casesOn (popTok .T r2a) none (fun rest => + Prod.casesOn (popTokCount 8 .Z 0 rest) (fun b r3 => + Bool.casesOn (Nat.beq b 0) + (pushRlePosK [.Z] b (pushToksLtr [.T, .W] r3) fun r3' => + Option.casesOn (copyRStack r3' rStack) (some .err) (fun r4 => + strictNat (Nat.add k1 (Nat.mul 2 b)) fun kOut => some (.next r4 kOut))) + none))) + none + (Prod.casesOn (popTokCount 8 .P 0 r2a) (fun b r3 => + Bool.casesOn (Nat.beq b 0) + (pushRlePosK [.T] 1 r3 fun r3a => + pushRlePosK [.P] b r3a fun r3' => + Option.casesOn (copyRStack r3' rStack) (some .err) (fun r4 => + strictNat (Nat.add k1 (Nat.mul 2 b)) fun kOut => some (.next r4 kOut))) + none)) + none none)) + +theorem stepSpecialLoops_sound (r2 rStack : Rle) (k1 : Nat) (res : StepCarryRes) + (h : stepSpecialLoops r2 rStack k1 = some res) (hne : res ≠ .err) : + StepCarryValid (carryCfg (evalRle r2) (evalRStack rStack (evalWK k1))) res := by + unfold stepSpecialLoops at h + rcases hp1 : popLastTok r2 with _ | ⟨t1, r2a⟩ + · rw [hp1] at h; contradiction + · rw [hp1] at h; dsimp -failIfUnchanged only at h + rw [popLastTok_sound r2 t1 r2a hp1] + cases t1 <;> try contradiction + · -- .U + dsimp -failIfUnchanged only at h + rcases hpm : popTok .M r2a with _ | rest + · rw [hpm] at h; contradiction + · rw [hpm] at h; dsimp -failIfUnchanged only at h + rw [popTok_sound .M r2a rest hpm] + have hcnt := (popTokCount_sound (l_tail := l_tail) 8 .P 0 rest).2 + rcases hpc : popTokCount 8 .P 0 rest with ⟨mVal, r3⟩ + rw [hpc] at h hcnt; dsimp -failIfUnchanged only at h hcnt + simp only [pow_zero_list, listblank_append_nil] at hcnt + cases hm0 : Nat.beq mVal 0 + · rw [hm0] at h; dsimp -failIfUnchanged only at h + have hm_pos : mVal ≥ 1 := by + have hne0 : mVal ≠ 0 := by + intro h0; subst h0; revert hm0; decide + omega + rcases hpz : popTok .Z r3 with _ | r4 + · rw [hpz] at h; injection h with h'; subst h'; exfalso; exact hne rfl + · rw [hpz] at h; simp only [strictNat_eq, pushRleK_eq, pushRlePosK_eq] at h + injection h with h'; subst h' + rw [hcnt, popTok_sound .Z r3 r4 hpz] + refine stepCarryValid_of_stepStar + (rules.carry_MU_to_pmuCfg (((tokL .P) ^ mVal) +> (tokL .Z +> evalRle r4)) + (evalRStack rStack (evalWK k1))) ?_ + refine stepCarryValid_of_stepStar + (pmu_loop mVal (tokL .Z +> evalRle r4) (tokR .P +> evalRStack rStack (evalWK k1))) ?_ + have hm1 : mVal = 1 + (mVal - 1) := by omega + rw [hm1, list_pow_add, pow_succ_list, pow_zero_list, List.append_nil, + listblank_append_assoc] + refine stepCarryValid_of_stepStar + (rules.pmuCfg_Z_turn (evalRle r4) (((tokR .Z) ^ (mVal - 1)) +> (tokR .P +> + evalRStack rStack (evalWK k1)))) ?_ + refine stepCarryValid_of_stepStar + (r0_Z_loop (mVal - 1) (tokL .M +> (tokL .W +> (tokL .T +> evalRle r4))) (tokR .P +> + evalRStack rStack (evalWK k1))) ?_ + refine stepCarryValid_of_stepStar + (rules.r0_P (((tokL .Z) ^ (mVal - 1)) +> (tokL .M +> (tokL .W +> (tokL .T +> + evalRle r4)))) (evalRStack rStack (evalWK k1))) ?_ + have hr5 : tokL .P +> (((tokL .Z) ^ (mVal - 1)) +> (tokL .M +> (tokL .W +> (tokL .T +> + evalRle r4)))) = + evalRle (pushRlePos [.P] 1 (pushRle [.Z] (Nat.sub mVal 1) (pushToksLtr [.T, .W, + .M] r4))) := by + simp [pow_succ_list] + rw [← hm1, hr5] + exact finishTurn_sound _ .R0 rStack k1 hne + · rw [hm0] at h; contradiction + · -- .M + dsimp -failIfUnchanged only at h + rcases hpt : popTok .T r2a with _ | rest + · rw [hpt] at h; contradiction + · rw [hpt] at h; dsimp -failIfUnchanged only at h + rw [popTok_sound .T r2a rest hpt] + have hcnt := (popTokCount_sound (l_tail := l_tail) 8 .Z 0 rest).2 + rcases hpc : popTokCount 8 .Z 0 rest with ⟨b, r3⟩ + rw [hpc] at h hcnt; dsimp -failIfUnchanged only at h hcnt + simp only [pow_zero_list, listblank_append_nil] at hcnt + cases hb0 : Nat.beq b 0 + · rw [hb0] at h; simp only [pushRlePosK_eq] at h + have hb_pos : b ≥ 1 := by + have hne0 : b ≠ 0 := by + intro h0; subst h0; revert hb0; decide + omega + rcases hc : copyRStack (pushRlePos [.P] b (pushToksLtr [.T, .M] r3)) rStack with _ | r4 + · rw [hc] at h; injection h with h'; subst h'; exfalso; exact hne rfl + · rw [hc] at h; simp only [strictNat_eq] at h + injection h with h'; subst h' + rcases copyRStack_sound (target_tm := target_tm) rStack (pushRlePos [.P] b + (pushToksLtr [.T, .M] r3)) r4 (evalWK (k1 + 2 * (b - 1))) hc with ⟨hrs, hcopy⟩ + have hb1 : b = (b - 1) + 1 := by omega + have hR := hasRoundtrip_stack rStack hrs (hasRoundtrip_evalWK (target_tm := target_tm)) + rw [hcnt, hb1] + refine stepStar_trans (special_ZTM_loop (b - 1) (evalRle r3) hR k1) ?_ + rw [← hb1] + simp only [evalRle_pushRlePos, evalRle_pushToksLtr, revWord_cons, revWord_nil, + List.nil_append, List.cons_append, wordL_cons, wordL_nil, List.append_nil, + listblank_append_assoc] at hcopy + refine stepStar_trans hcopy ?_ + have hadd : k1 + 2 * (b - 1) + 2 = Nat.add k1 (Nat.mul 2 b) := by + change k1 + 2 * (b - 1) + 2 = k1 + 2 * b + omega + rw [← hadd] + exact r0_end (k1 + 2 * (b - 1)) (evalRle r4) + · rw [hb0] at h; contradiction + · -- .W + dsimp -failIfUnchanged only at h + rcases hpt : popTok .T r2a with _ | rest + · rw [hpt] at h; contradiction + · rw [hpt] at h; dsimp -failIfUnchanged only at h + rw [popTok_sound .T r2a rest hpt] + have hcnt := (popTokCount_sound (l_tail := l_tail) 8 .Z 0 rest).2 + rcases hpc : popTokCount 8 .Z 0 rest with ⟨b, r3⟩ + rw [hpc] at h hcnt; dsimp -failIfUnchanged only at h hcnt + simp only [pow_zero_list, listblank_append_nil] at hcnt + cases hb0 : Nat.beq b 0 + · rw [hb0] at h; simp only [pushRlePosK_eq] at h + have hb_pos : b ≥ 1 := by + have hne0 : b ≠ 0 := by + intro h0; subst h0; revert hb0; decide + omega + rcases hc : copyRStack (pushRlePos [.Z] b (pushToksLtr [.T, .W] r3)) rStack with _ | r4 + · rw [hc] at h; injection h with h'; subst h'; exfalso; exact hne rfl + · rw [hc] at h; simp only [strictNat_eq] at h + injection h with h'; subst h' + rcases copyRStack_sound (target_tm := target_tm) rStack (pushRlePos [.Z] b + (pushToksLtr [.T, .W] r3)) r4 (evalWK (k1 + 2 * (b - 1))) hc with ⟨hrs, hcopy⟩ + have hb1 : b = (b - 1) + 1 := by omega + have hR := hasRoundtrip_stack rStack hrs (hasRoundtrip_evalWK (target_tm := target_tm)) + rw [hcnt, hb1] + refine stepStar_trans (special_ZTW_loop (b - 1) (evalRle r3) hR k1) ?_ + rw [← hb1] + simp only [evalRle_pushRlePos, evalRle_pushToksLtr, revWord_cons, revWord_nil, + List.nil_append, List.cons_append, wordL_cons, wordL_nil, List.append_nil, + listblank_append_assoc] at hcopy + refine stepStar_trans hcopy ?_ + have hadd : k1 + 2 * (b - 1) + 2 = Nat.add k1 (Nat.mul 2 b) := by + change k1 + 2 * (b - 1) + 2 = k1 + 2 * b + omega + rw [← hadd] + exact r0_end (k1 + 2 * (b - 1)) (evalRle r4) + · rw [hb0] at h; contradiction + · -- .T + dsimp -failIfUnchanged only at h + have hcnt := (popTokCount_sound (l_tail := l_tail) 8 .P 0 r2a).2 + rcases hpc : popTokCount 8 .P 0 r2a with ⟨b, r3⟩ + rw [hpc] at h hcnt; dsimp -failIfUnchanged only at h hcnt + simp only [pow_zero_list, listblank_append_nil] at hcnt + cases hb0 : Nat.beq b 0 + · rw [hb0] at h; simp only [pushRlePosK_eq] at h + have hb_pos : b ≥ 1 := by + have hne0 : b ≠ 0 := by + intro h0; subst h0; revert hb0; decide + omega + rcases hc : copyRStack (pushRlePos [.P] b (pushRlePos [.T] 1 r3)) rStack with _ | r4 + · rw [hc] at h; injection h with h'; subst h'; exfalso; exact hne rfl + · rw [hc] at h; simp only [strictNat_eq] at h + injection h with h'; subst h' + rcases copyRStack_sound (target_tm := target_tm) rStack (pushRlePos [.P] b + (pushRlePos [.T] 1 r3)) r4 (evalWK (k1 + 2 * (b - 1))) hc with ⟨hrs, hcopy⟩ + have hb1 : b = (b - 1) + 1 := by omega + have hR := hasRoundtrip_stack rStack hrs (hasRoundtrip_evalWK (target_tm := target_tm)) + rw [hcnt, hb1] + refine stepStar_trans (special_PT_loop (b - 1) (evalRle r3) hR k1) ?_ + rw [← hb1] + simp only [evalRle_pushRlePos, pow_succ_list, pow_zero_list, wordL_cons, wordL_nil, + List.append_nil] at hcopy + refine stepStar_trans hcopy ?_ + have hadd : k1 + 2 * (b - 1) + 2 = Nat.add k1 (Nat.mul 2 b) := by + change k1 + 2 * (b - 1) + 2 = k1 + 2 * b + omega + rw [← hadd] + exact r0_end (k1 + 2 * (b - 1)) (evalRle r4) + · rw [hb0] at h; contradiction + +def stepCarry (rle : Rle) (k1 : Nat) : StepCarryRes := + Prod.casesOn (popCarryLoop 80 rle []) (fun r2 rStack => + Bool.casesOn (hasSpecial rStack) + (Option.casesOn (stepSpecialLoops r2 rStack k1) + (stepTurnaround r2 rStack k1) + (fun res => res)) + (stepTurnaround r2 rStack k1)) + +theorem stepCarry_sound (rle : Rle) (k1 : Nat) (hne : stepCarry rle k1 ≠ .err) : + StepCarryValid (carryCfg (evalRle rle) (evalWK k1)) (stepCarry rle k1) := by + have hp := popCarryLoop_sound (target_tm := target_tm) (l_tail := l_tail) 80 rle [] (evalWK k1) + simp only [evalRStack_nil] at hp + unfold stepCarry at hne ⊢ + rcases hpop : popCarryLoop 80 rle [] with ⟨r2, rStack⟩ + try rw [hpop] at hp; try rw [hpop] at hne; try rw [hpop] + dsimp -failIfUnchanged only at hp hne ⊢ + refine stepCarryValid_of_stepStar hp ?_ + cases hns : hasSpecial rStack + · try rw [hns] at hne; try rw [hns] + dsimp -failIfUnchanged only at hne ⊢ + rcases hsl : stepSpecialLoops r2 rStack k1 with _ | res + · try rw [hsl] at hne; try rw [hsl] + dsimp -failIfUnchanged only at hne ⊢ + exact stepTurnaround_sound r2 rStack k1 hne + · try rw [hsl] at hne; try rw [hsl] + dsimp -failIfUnchanged only at hne ⊢ + exact stepSpecialLoops_sound r2 rStack k1 res hsl hne + · try rw [hns] at hne; try rw [hns] + dsimp -failIfUnchanged only at hne ⊢ + exact stepTurnaround_sound r2 rStack k1 hne + +def runCarryChunk (n : Nat) (rle : Rle) (k1 : Nat) : StepCarryRes := + Nat.rec + (fun rle k1 => .next rle k1) + (fun _ ih rle k1 => + StepCarryRes.casesOn (stepCarry rle k1) + .halt + (fun rle' k1' => ih rle' k1') + .err) + n rle k1 + +theorem runCarryChunk_succ (n : Nat) (rle : Rle) (k1 : Nat) : + runCarryChunk (n + 1) rle k1 = + StepCarryRes.casesOn (stepCarry rle k1) + .halt + (fun rle' k1' => runCarryChunk n rle' k1') + .err := rfl + +theorem runCarryChunk_sound : ∀ (n : Nat) (rle : Rle) (k1 : Nat), + runCarryChunk n rle k1 ≠ .err → + StepCarryValid (carryCfg (evalRle rle) (evalWK k1)) (runCarryChunk n rle k1) + | 0, rle, k1, _ => stepStar_refl _ _ + | n + 1, rle, k1, hne => by + rw [runCarryChunk_succ] at hne ⊢ + cases hs : stepCarry rle k1 with + | halt => + try rw [hs] + dsimp -failIfUnchanged only + have hv := stepCarry_sound (target_tm := target_tm) (l_tail := l_tail) rle k1 + (by rw [hs]; nofun) + rwa [hs] at hv + | next rle' k1' => + try rw [hs] at hne; try rw [hs] + dsimp -failIfUnchanged only at hne ⊢ + have hv := stepCarry_sound (target_tm := target_tm) (l_tail := l_tail) rle k1 + (by rw [hs]; nofun) + rw [hs] at hv + exact stepCarryValid_of_stepStar hv (runCarryChunk_sound n rle' k1' hne) + | err => + try rw [hs] at hne + dsimp -failIfUnchanged only at hne; exfalso; exact hne rfl + + +end WithTail + +variable {target_tm : Machine (Fin 2) (Fin 6)} +variable [rules : HasRleCarryRules target_tm] +local notation "cfgR" => cfgRGen target_tm +local notation "carryCfg" => carryCfgGen target_tm +local notation "r1OddShortCfg" => r1OddShortCfgGen target_tm +local notation "r1OddCfg" => r1OddCfgGen target_tm +local notation "wSweepCfg" => wSweepCfgGen target_tm +local notation "t3Cfg" => t3CfgGen target_tm +local notation "pmuCfg" => pmuCfgGen target_tm +local notation "HasRoundtrip" => HasRoundtripGen target_tm +local notation "r1PhaseCfg" => r1PhaseCfgGen target_tm +local notation "modeCfg" => modeCfgGen target_tm +local notation "StepCarryValidAux" => StepCarryValidAuxGen target_tm + +def takeRle : Nat → Rle → Rle + | 0, _ => [] + | _ + 1, [] => [] + | n + 1, x :: xs => x :: takeRle n xs + +def dropRle : Nat → Rle → Rle + | 0, rle => rle + | _ + 1, [] => [] + | n + 1, _ :: xs => dropRle n xs + +def truncRes (k : Nat) (res : StepCarryRes) : StepCarryRes := + StepCarryRes.casesOn res .halt (fun rle k1 => .next (takeRle k rle) k1) .err + +theorem evalRleAux_take_drop (l_tail : ListBlank (Fin 2)) : ∀ (k : Nat) (rle : Rle), + evalRleAux l_tail rle = evalRleAux (evalRleAux l_tail (dropRle k rle)) (takeRle k rle) + | 0, rle => rfl + | _ + 1, [] => rfl + | n + 1, (w, c) :: xs => by + simp only [takeRle, dropRle, evalRleAux] + rw [evalRleAux_take_drop l_tail n xs] + +theorem runCarryChunk_trunc_sound (l_tail : ListBlank (Fin 2)) (k d : Nat) (rle : Rle) (k1 : Nat) + (rle' : Rle) (k1' : Nat) + (h : truncRes k (runCarryChunk d rle k1) = .next rle' k1') : + ∃ l_tail', (carryCfg (evalRleAux l_tail rle) (evalWK k1)) [target_tm]⊢* + (carryCfg (evalRleAux l_tail' rle') (evalWK k1')) := by + have hne : runCarryChunk d rle k1 ≠ .err := by + intro herr; rw [herr] at h; nomatch h + have hv := runCarryChunk_sound (target_tm := target_tm) (l_tail := l_tail) d rle k1 hne + cases hres : runCarryChunk d rle k1 with + | halt => rw [hres] at h; nomatch h + | err => rw [hres] at h; nomatch h + | next rle_full k1_full => + rw [hres] at hv h + dsimp -failIfUnchanged only [truncRes, StepCarryRes.casesOn] at h + injection h with hr hk + subst hr hk + refine ⟨evalRleAux l_tail (dropRle k rle_full), ?_⟩ + rw [← evalRleAux_take_drop l_tail k rle_full] + exact hv + +theorem runCarryChunk_halt_sound (l_tail : ListBlank (Fin 2)) (d : Nat) (rle : Rle) (k1 : Nat) + (h : runCarryChunk d rle k1 = .halt) : + ∃ cfg, ((carryCfg (evalRleAux l_tail rle) (evalWK k1)) [target_tm]⊢* cfg) ∧ + (step target_tm cfg).isNone := by + have hne : runCarryChunk d rle k1 ≠ .err := by + intro herr; rw [herr] at h; nomatch h + have hv := runCarryChunk_sound (target_tm := target_tm) (l_tail := l_tail) d rle k1 hne + rwa [h] at hv + + +def takeRleK {α : Type} (k : Nat) (rle : Rle) (f : Rle → α) : α := + Nat.rec + (fun _ f => f []) + (fun _ ih rle f => + List.casesOn rle (f []) (fun p xs => + Prod.casesOn p (fun w c => + strictWord w (fun w' => + strictNat c (fun c' => + ih xs (fun xs' => f ((w', c') :: xs'))))))) + k rle f + +@[simp] theorem takeRleK_eq {α : Type} : ∀ (k : Nat) (rle : Rle) (f : Rle → α), + takeRleK k rle f = f (takeRle k rle) + | 0, _, _ => rfl + | _ + 1, [], _ => rfl + | n + 1, (w, c) :: xs, f => by + change strictWord w (fun w' => strictNat c (fun c' => + takeRleK n xs (fun xs' => f ((w', c') :: xs')))) = f ((w, c) :: takeRle n xs) + rw [strictWord_eq, strictNat_eq, takeRleK_eq n xs] + +def runCarryTruncChunks (ns : List Nat) (k : Nat) (rle : Rle) (k1 : Nat) : Bool := + List.rec + (fun _ _ => false) + (fun n _ ih rle k1 => + StepCarryRes.casesOn (runCarryChunk n rle k1) + true + (fun rle' k1' => + strictNat k1' (fun k1_s => + takeRleK k rle' (fun rle_s => ih rle_s k1_s))) + false) + ns rle k1 + +theorem runCarryTruncChunks_cons (n : Nat) (ns : List Nat) (k : Nat) (rle : Rle) (k1 : Nat) : + runCarryTruncChunks (n :: ns) k rle k1 = + StepCarryRes.casesOn (runCarryChunk n rle k1) + true + (fun rle' k1' => + strictNat k1' (fun k1_s => + takeRleK k rle' (fun rle_s => runCarryTruncChunks ns k rle_s k1_s))) + false := rfl + +theorem runCarryTruncChunks_sound : ∀ (ns : List Nat) (k : Nat) (rle : Rle) (k1 : Nat) + (l_tail : ListBlank (Fin 2)), + runCarryTruncChunks ns k rle k1 = true → + ∃ cfg', ((carryCfg (evalRleAux l_tail rle) (evalWK k1)) [target_tm]⊢* cfg') ∧ + (step target_tm cfg').isNone + | [], _, _, _, _, h => by nomatch h + | n :: ns, k, rle, k1, l_tail, h => by + rw [runCarryTruncChunks_cons] at h + cases hc : runCarryChunk n rle k1 with + | halt => + have hv := runCarryChunk_sound (target_tm := target_tm) (l_tail := l_tail) n rle k1 + (by rw [hc]; nofun) + rwa [hc] at hv + | next rle' k1' => + rw [hc] at h; dsimp -failIfUnchanged only at h + rw [strictNat_eq, takeRleK_eq] at h + have hv := runCarryChunk_sound (target_tm := target_tm) (l_tail := l_tail) n rle k1 + (by rw [hc]; nofun) + rw [hc] at hv + dsimp only [StepCarryValidAuxGen] at hv + rw [evalRleAux_take_drop l_tail k rle'] at hv + rcases runCarryTruncChunks_sound ns k (takeRle k rle') k1' + (evalRleAux l_tail (dropRle k rle')) h with ⟨cfg', h2, hnone⟩ + exact ⟨cfg', stepStar_trans hv h2, hnone⟩ + | err => + rw [hc] at h; nomatch h + +def stepTurnFrom2Full (t1 t2 : Tok) (r4 rStack : Rle) (k1 : Nat) : StepCarryRes := + Option.casesOn (matchRule2 t1 t2) + (Option.casesOn (popLastTok r4) .err (fun p3 => + Prod.casesOn p3 (fun t3 r5 => + Bool.casesOn (tokEq t1 .T) + (Bool.casesOn (tokEq t1 .U) + (stepTurnFrom3 t1 t2 t3 r5 rStack k1) + (Bool.casesOn (tokEq t2 .T) + (stepTurnFrom3 t1 t2 t3 r5 rStack k1) + (Bool.casesOn (tokEq t3 .Z) + (stepTurnFrom3 t1 t2 t3 r5 rStack k1) + .halt))) + (Bool.casesOn (tokEq t2 .M) + (stepTurnFrom3 t1 t2 t3 r5 rStack k1) + (Bool.casesOn (tokEq t3 .U) + (stepTurnFrom3 t1 t2 t3 r5 rStack k1) + (Bool.casesOn (isEmptyRle r5) + .err + (finishTurn [([.Z], 1), ([.U], 1)] .R1 rStack k1))))))) + (fun pm => Prod.casesOn pm (fun out mode => finishTurn (pushToksLtr out r4) mode rStack k1)) + +theorem stepTurnFrom2Full_sound (t1 t2 : Tok) (r4 rStack : Rle) (k1 : Nat) + (hne : stepTurnFrom2Full t1 t2 r4 rStack k1 ≠ .err) : + StepCarryValidAux default + (carryCfg (tokL t1 +> (tokL t2 +> evalRleAux default r4)) (evalRStack rStack (evalWK k1))) + (stepTurnFrom2Full t1 t2 r4 rStack k1) := by + unfold stepTurnFrom2Full at hne ⊢ + rcases hm2 : matchRule2 t1 t2 with _ | ⟨out, mode⟩ + · try rw [hm2] at hne; try rw [hm2] + dsimp -failIfUnchanged only at hne ⊢ + rcases hp3 : popLastTok r4 with _ | ⟨t3, r5⟩ + · try rw [hp3] at hne + dsimp -failIfUnchanged only at hne; exfalso; exact hne rfl + · try rw [hp3] at hne; try rw [hp3] + dsimp -failIfUnchanged only at hne ⊢ + rw [popLastTok_sound r4 t3 r5 hp3] + cases ht1 : tokEq t1 .T + · try rw [ht1] at hne; try rw [ht1] + dsimp -failIfUnchanged only at hne ⊢ + cases hu1 : tokEq t1 .U + · try rw [hu1] at hne; try rw [hu1] + dsimp -failIfUnchanged only at hne ⊢ + exact stepTurnFrom3_sound t1 t2 t3 r5 rStack k1 hne + · try rw [hu1] at hne; try rw [hu1] + dsimp -failIfUnchanged only at hne ⊢ + cases ht2 : tokEq t2 .T + · try rw [ht2] at hne; try rw [ht2] + dsimp -failIfUnchanged only at hne ⊢ + exact stepTurnFrom3_sound t1 t2 t3 r5 rStack k1 hne + · try rw [ht2] at hne; try rw [ht2] + dsimp -failIfUnchanged only at hne ⊢ + cases hz3 : tokEq t3 .Z + · try rw [hz3] at hne; try rw [hz3] + dsimp -failIfUnchanged only at hne ⊢ + exact stepTurnFrom3_sound t1 t2 t3 r5 rStack k1 hne + · try rw [hz3] at hne; try rw [hz3] + dsimp -failIfUnchanged only at hne ⊢ + rw [(tokEq_iff t1 .U).mp hu1, (tokEq_iff t2 .T).mp ht2, (tokEq_iff t3 .Z).mp hz3] + exact rules.turn_ZTU_halt (evalRleAux default r5) (evalRStack rStack (evalWK k1)) + · try rw [ht1] at hne; try rw [ht1] + dsimp -failIfUnchanged only at hne ⊢ + cases hm2' : tokEq t2 .M + · try rw [hm2'] at hne; try rw [hm2'] + dsimp -failIfUnchanged only at hne ⊢ + exact stepTurnFrom3_sound t1 t2 t3 r5 rStack k1 hne + · try rw [hm2'] at hne; try rw [hm2'] + dsimp -failIfUnchanged only at hne ⊢ + cases hu3 : tokEq t3 .U + · try rw [hu3] at hne; try rw [hu3] + dsimp -failIfUnchanged only at hne ⊢ + exact stepTurnFrom3_sound t1 t2 t3 r5 rStack k1 hne + · try rw [hu3] at hne; try rw [hu3] + dsimp -failIfUnchanged only at hne ⊢ + cases he : isEmptyRle r5 + · try rw [he] at hne + dsimp -failIfUnchanged only at hne; exfalso; exact hne rfl + · try rw [he] at hne; try rw [he] + dsimp -failIfUnchanged only at hne ⊢ + rw [(tokEq_iff t1 .T).mp ht1, (tokEq_iff t2 .M).mp hm2', + (tokEq_iff t3 .U).mp hu3, (isEmptyRle_iff r5).mp he] + refine stepCarryValid_of_stepStar ?_ + (finishTurn_sound [([.Z], 1), ([.U], 1)] .R1 rStack k1 hne) + simp only [evalRle_cons, evalRle_nil, pow_succ_list, pow_zero_list, List.append_nil, + wordL_cons, wordL_nil, modeCfg_R1] + exact rules.turn_UMT (evalRStack rStack (evalWK k1)) + · try rw [hm2] at hne; try rw [hm2] + dsimp -failIfUnchanged only at hne ⊢ + exact stepCarryValid_of_stepStar (matchRule2_sound t1 t2 out mode r4 _ hm2) + (finishTurn_sound (pushToksLtr out r4) mode rStack k1 hne) + +def stepTurnaroundFull (r2 rStack : Rle) (k1 : Nat) : StepCarryRes := + Option.casesOn (popLastTok r2) .err (fun p1 => + Prod.casesOn p1 (fun t1 r3 => + Option.casesOn (popLastTok r3) .err (fun p2 => + Prod.casesOn p2 (fun t2 r4 => + Bool.casesOn (tokEq t1 .M) + (stepTurnFrom2Full t1 t2 r4 rStack k1) + (Bool.casesOn (tokEq t2 .U) + (stepTurnFrom2Full t1 t2 r4 rStack k1) + (Bool.casesOn (isEmptyRle r4) + .err + (finishTurn [([.M], 1), ([.U], 1)] .R1 rStack k1))))))) + +theorem stepTurnaroundFull_sound (r2 rStack : Rle) (k1 : Nat) + (hne : stepTurnaroundFull r2 rStack k1 ≠ .err) : + StepCarryValidAux default (carryCfg (evalRleAux default r2) (evalRStack rStack (evalWK k1))) + (stepTurnaroundFull r2 rStack k1) := by + unfold stepTurnaroundFull at hne ⊢ + rcases hp1 : popLastTok r2 with _ | ⟨t1, r3⟩ + · try rw [hp1] at hne + dsimp -failIfUnchanged only at hne; exfalso; exact hne rfl + · try rw [hp1] at hne; try rw [hp1] + dsimp -failIfUnchanged only at hne ⊢ + rw [popLastTok_sound r2 t1 r3 hp1] + rcases hp2 : popLastTok r3 with _ | ⟨t2, r4⟩ + · try rw [hp2] at hne + dsimp -failIfUnchanged only at hne; exfalso; exact hne rfl + · try rw [hp2] at hne; try rw [hp2] + dsimp -failIfUnchanged only at hne ⊢ + rw [popLastTok_sound r3 t2 r4 hp2] + cases hm1 : tokEq t1 .M + · try rw [hm1] at hne; try rw [hm1] + dsimp -failIfUnchanged only at hne ⊢ + exact stepTurnFrom2Full_sound t1 t2 r4 rStack k1 hne + · try rw [hm1] at hne; try rw [hm1] + dsimp -failIfUnchanged only at hne ⊢ + cases hu2 : tokEq t2 .U + · try rw [hu2] at hne; try rw [hu2] + dsimp -failIfUnchanged only at hne ⊢ + exact stepTurnFrom2Full_sound t1 t2 r4 rStack k1 hne + · try rw [hu2] at hne; try rw [hu2] + dsimp -failIfUnchanged only at hne ⊢ + cases he : isEmptyRle r4 + · try rw [he] at hne + dsimp -failIfUnchanged only at hne; exfalso; exact hne rfl + · try rw [he] at hne; try rw [he] + dsimp -failIfUnchanged only at hne ⊢ + rw [(tokEq_iff t1 .M).mp hm1, (tokEq_iff t2 .U).mp hu2, (isEmptyRle_iff r4).mp he] + refine stepCarryValid_of_stepStar ?_ + (finishTurn_sound [([.M], 1), ([.U], 1)] .R1 rStack k1 hne) + simp only [evalRle_cons, evalRle_nil, pow_succ_list, pow_zero_list, List.append_nil, + wordL_cons, wordL_nil, modeCfg_R1] + exact rules.turn_UM (evalRStack rStack (evalWK k1)) + +def stepCarryFull (rle : Rle) (k1 : Nat) : StepCarryRes := + Prod.casesOn (popCarryLoop 80 rle []) (fun r2 rStack => + Bool.casesOn (hasSpecial rStack) + (Option.casesOn (stepSpecialLoops r2 rStack k1) + (stepTurnaroundFull r2 rStack k1) + (fun res => res)) + (stepTurnaroundFull r2 rStack k1)) + +theorem stepCarryFull_sound (rle : Rle) (k1 : Nat) (hne : stepCarryFull rle k1 ≠ .err) : + StepCarryValidAux default (carryCfg (evalRleAux default rle) (evalWK k1)) + (stepCarryFull rle k1) := by + have hp := popCarryLoop_sound (target_tm := target_tm) (l_tail := default) 80 rle [] (evalWK k1) + simp only [evalRStack_nil] at hp + unfold stepCarryFull at hne ⊢ + rcases hpop : popCarryLoop 80 rle [] with ⟨r2, rStack⟩ + try rw [hpop] at hp; try rw [hpop] at hne; try rw [hpop] + dsimp -failIfUnchanged only at hp hne ⊢ + refine stepCarryValid_of_stepStar hp ?_ + cases hns : hasSpecial rStack + · try rw [hns] at hne; try rw [hns] + dsimp -failIfUnchanged only at hne ⊢ + rcases hsl : stepSpecialLoops r2 rStack k1 with _ | res + · try rw [hsl] at hne; try rw [hsl] + dsimp -failIfUnchanged only at hne ⊢ + exact stepTurnaroundFull_sound r2 rStack k1 hne + · try rw [hsl] at hne; try rw [hsl] + dsimp -failIfUnchanged only at hne ⊢ + exact stepSpecialLoops_sound r2 rStack k1 res hsl hne + · try rw [hns] at hne; try rw [hns] + dsimp -failIfUnchanged only at hne ⊢ + exact stepTurnaroundFull_sound r2 rStack k1 hne + +def runCarryChunkFull (n : Nat) (rle : Rle) (k1 : Nat) : StepCarryRes := + Nat.rec + (fun rle k1 => .next rle k1) + (fun _ ih rle k1 => + StepCarryRes.casesOn (stepCarryFull rle k1) + .halt + (fun rle' k1' => ih rle' k1') + .err) + n rle k1 + +theorem runCarryChunkFull_succ (n : Nat) (rle : Rle) (k1 : Nat) : + runCarryChunkFull (n + 1) rle k1 = + StepCarryRes.casesOn (stepCarryFull rle k1) + .halt + (fun rle' k1' => runCarryChunkFull n rle' k1') + .err := rfl + +theorem runCarryChunkFull_sound : ∀ (n : Nat) (rle : Rle) (k1 : Nat), + runCarryChunkFull n rle k1 ≠ .err → + StepCarryValidAux default (carryCfg (evalRleAux default rle) (evalWK k1)) + (runCarryChunkFull n rle k1) + | 0, rle, k1, _ => stepStar_refl _ _ + | n + 1, rle, k1, hne => by + rw [runCarryChunkFull_succ] at hne ⊢ + cases hs : stepCarryFull rle k1 with + | halt => + try rw [hs] + dsimp -failIfUnchanged only + have hv := stepCarryFull_sound (target_tm := target_tm) rle k1 (by rw [hs]; nofun) + rwa [hs] at hv + | next rle' k1' => + try rw [hs] at hne; try rw [hs] + dsimp -failIfUnchanged only at hne ⊢ + have hv := stepCarryFull_sound (target_tm := target_tm) rle k1 (by rw [hs]; nofun) + rw [hs] at hv + exact stepCarryValid_of_stepStar hv (runCarryChunkFull_sound n rle' k1' hne) + | err => + try rw [hs] at hne + dsimp -failIfUnchanged only at hne; exfalso; exact hne rfl + +def runCarryChunks (chunks chunkSize : Nat) (rle : Rle) (k1 : Nat) : Bool := + Nat.rec + (fun _ _ => false) + (fun _ ih rle k1 => + StepCarryRes.casesOn (runCarryChunkFull chunkSize rle k1) + true + (fun rle' k1' => ih rle' k1') + false) + chunks rle k1 + +theorem runCarryChunks_succ (chunks chunkSize : Nat) (rle : Rle) (k1 : Nat) : + runCarryChunks (chunks + 1) chunkSize rle k1 = + StepCarryRes.casesOn (runCarryChunkFull chunkSize rle k1) + true + (fun rle' k1' => runCarryChunks chunks chunkSize rle' k1') + false := rfl + +theorem runCarryChunks_sound : ∀ (chunks chunkSize : Nat) (rle : Rle) (k1 : Nat), + runCarryChunks chunks chunkSize rle k1 = true → + ∃ cfg', ((carryCfg (evalRleAux default rle) (evalWK k1)) [target_tm]⊢* cfg') ∧ + (step target_tm cfg').isNone + | 0, _, _, _, h => by nomatch h + | chunks + 1, chunkSize, rle, k1, h => by + rw [runCarryChunks_succ] at h + cases hc : runCarryChunkFull chunkSize rle k1 with + | halt => + have hv := runCarryChunkFull_sound (target_tm := target_tm) chunkSize rle k1 + (by rw [hc]; nofun) + rwa [hc] at hv + | next rle' k1' => + rw [hc] at h; dsimp -failIfUnchanged only at h + have hv := runCarryChunkFull_sound (target_tm := target_tm) chunkSize rle k1 + (by rw [hc]; nofun) + rw [hc] at hv + rcases runCarryChunks_sound chunks chunkSize rle' k1' h with ⟨cfg', h2, hnone⟩ + exact ⟨cfg', stepStar_trans hv h2, hnone⟩ + | err => + rw [hc] at h; nomatch h + + +end BusyBeaver.RleCarryEngine diff --git a/BusyBeaver/Calculi/SegmentChain.lean b/BusyBeaver/Calculi/SegmentChain.lean new file mode 100644 index 00000000..d52be302 --- /dev/null +++ b/BusyBeaver/Calculi/SegmentChain.lean @@ -0,0 +1,6186 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Basic +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter + +/-! +# Segment-Chain Symbolic Transition System (`BusyBeaver.Calculi.SegmentChain`) + +Symbolic state representation (`ModeState`), multi-step macro transitions, and single-step +invariant preservation (`step_toCfg`, `step_Inv`) for `1RB0RA_0RC0LE_1LD1RF_1LB1RD_1LD1LE_---1RA`. +-/ + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver.SegmentChain + +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +/-- Transition function for `1RB0RA_0RC0LE_1LD1RF_1LB1RD_1LD1LE_---1RA`. -/ +def target_tm : Machine (Fin 2) (Fin 6) + | 0, 0 => some (some 1, Stmt.write 1 Dir.right) + | 0, 1 => some (some 0, Stmt.write 0 Dir.right) + | 1, 0 => some (some 2, Stmt.write 0 Dir.right) + | 1, 1 => some (some 4, Stmt.write 0 Dir.left) + | 2, 0 => some (some 3, Stmt.write 1 Dir.left) + | 2, 1 => some (some 5, Stmt.write 1 Dir.right) + | 3, 0 => some (some 1, Stmt.write 1 Dir.left) + | 3, 1 => some (some 3, Stmt.write 1 Dir.right) + | 4, 0 => some (some 3, Stmt.write 1 Dir.left) + | 4, 1 => some (some 4, Stmt.write 1 Dir.left) + | 5, 0 => none + | 5, 1 => some (some 0, Stmt.write 1 Dir.right) + +open BusyBeaver BusyBeaver.Counter SixState +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 + +set_option maxRecDepth 2000 + +private theorem if_pos {c : Prop} [Decidable c] (hc : c) {α : Sort*} {t e : α} : + (if c then t else e) = t := by + simp [hc] + +private theorem if_neg {c : Prop} [Decidable c] (hnc : ¬c) {α : Sort*} {t e : α} : + (if c then t else e) = e := by + simp [hnc] + +theorem multiStep_zero (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 0 = some config := + rfl +theorem multiStep_one (M : Machine Γ Λ) (config : Cfg Γ Λ) : multiStep M config 1 = step M config := + rfl +theorem multiStep_succ (M : Machine Γ Λ) (config : Cfg Γ Λ) (n : ℕ) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +theorem pow_zero_list (l : List (Fin 2)) : l ^ (0 : Nat) = [] := rfl +theorem pow_succ_list (l : List (Fin 2)) (n : Nat) : l ^ (n + 1) = l ++ (l ^ n) := rfl +theorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ ys) := + rfl +theorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil l +theorem listblank_append_nil (b : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> b = b := rfl +theorem listblank_append_cons (x : Fin 2) (xs : List (Fin 2)) (b : ListBlank (Fin 2)) : (x :: xs) +> + b = x >> (xs +> b) := rfl +theorem zero_cons_default : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +theorem default_head : (default : ListBlank (Fin 2)).head = 0 := rfl +theorem default_tail : (default : ListBlank (Fin 2)).tail = default := rfl + +theorem listblank_append_append (s : ListBlank Γ) (l₁ l₂ : List Γ) : + (s <+ l₁) <+ l₂ = s <+ (l₂ ++ l₁) := by + unfold ListBlank.append + split + · split + · next h => simp_all + · simp_all + · rename_i _ l₂ l₁ + refine (congr_arg _ ?_).symm + exact ListBlank.append_assoc l₁ _ s + +theorem pow_add_append_right (u : List (Fin 2)) (m n : Nat) {r : ListBlank (Fin 2)} : + (u ^ (m + n)) +> r = (u ^ m) +> ((u ^ n) +> r) := by + rw [list_pow_add, ← listblank_append_append] + +theorem pow_succ_append_right (u : List (Fin 2)) (n : Nat) {r : ListBlank (Fin 2)} : + (u ^ (n + 1)) +> r = u +> ((u ^ n) +> r) := by + rw [pow_succ_list, ← listblank_append_append] + +theorem pow_succ_append_right' (u : List (Fin 2)) (k : Nat) (r : ListBlank (Fin 2)) : + (u ^ k) +> (u +> r) = (u ^ (k + 1)) +> r := by + rw [listblank_append_append, list_pow_append_one] + +theorem pow_add_append_left (s : ListBlank (Fin 2)) (u : List (Fin 2)) (m n : Nat) : + s <+ (u ^ (m + n)) = (s <+ (u ^ m)) <+ (u ^ n) := by + rw [listblank_append_append, ← list_pow_add, add_comm] + +theorem step_multiStep {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢^{1} c₂ := by simp [h] + +theorem step_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) (h : c₁ [tm]⊢ c₂) : + c₁ [tm]⊢⁺ c₂ := ⟨1, by decide, step_multiStep tm c₁ c₂ h⟩ + +theorem multiStep_add {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : Nat) : + multiStep tm c₁ (n + m) = (multiStep tm c₁ n).bind (fun c₂ => multiStep tm c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ, ih, Option.bind_assoc] + simp_rw [multiStep_succ] + +theorem multiStep_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + (tm : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : Nat) + (h₁ : c₁ [tm]⊢^{n} c₂) (h₂ : c₂ [tm]⊢^{m} c₃) : + c₁ [tm]⊢^{n+m} c₃ := by + rw [multiStep_add, h₁]; simp [h₂] + +theorem stepStar_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢* c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢* c₃ := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_trans {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢⁺ c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, _, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem stepPlus_stepStar {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [tm]⊢⁺ c₂) : + c₁ [tm]⊢* c₂ := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ + +theorem stepPlus_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), multiStep_trans tm c₁ c₂ c₃ n m hn hm⟩ + +theorem step_stepStar_stepPlus {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + {tm : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [tm]⊢ c₂) (h₂ : c₂ [tm]⊢* c₃) : c₁ [tm]⊢⁺ c₃ := + stepPlus_stepStar_stepPlus (step_stepPlus tm c₁ c₂ h₁) h₂ + +local macro "finish" : tactic => + `(tactic| exists 0 <;> fail) +local macro "gstep" : tactic => + `(tactic| (try refine stepPlus_stepStar ?_) <;> + refine step_stepStar_stepPlus (by (try simp only [BusyBeaver.Cfg.headRight, + BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, default_head]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default, + default_head, default_tail]) +local macro "execute5" : tactic => + `(tactic| (any_goals (first | finish | gstep)) <;> (any_goals (first | finish | gstep)) <;> + (any_goals (first | finish | gstep)) <;> (any_goals (first | finish | gstep)) <;> + (any_goals (first | finish | gstep))) +local macro "execute" : tactic => + `(tactic| execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5 <;> execute5) +local macro "execute60" : tactic => + `(tactic| execute <;> execute) + +abbrev O : List (Fin 2) := [1] +abbrev Z : List (Fin 2) := [0] + +-- ============================================================================ +-- Section 5b: Shift & Macro Lemmas for target_tm +-- ============================================================================ + +theorem shift_A_right_1 (k : Nat) (l r : ListBlank (Fin 2)) : + (l {{A}}> (O ^ k +> r)) [target_tm]⊢* + ((l <+ Z ^ k) {{A}}> r) := by + induction k generalizing l r with + | zero => + simp only [pow_zero_list, listblank_append_nil] + exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_append_right] + have h1 : (l {{A}}> ([1] +> (O ^ k +> r))) + [target_tm]⊢* + ((l <+ [0]) {{A}}> (O ^ k +> r)) := by + dsimp [ListBlank.append]; execute + have h2 := ih (l <+ [0]) r + rw [listblank_append_append, list_pow_append_one] at h2 + exact stepStar_trans h1 h2 + +theorem shift_E_left_1 (k : Nat) (l r : ListBlank (Fin 2)) : + ((l <+ O ^ k) <{{E}} r) [target_tm]⊢* + (l <{{E}} (O ^ k +> r)) := by + induction k generalizing l r with + | zero => + simp only [pow_zero_list, listblank_append_nil] + exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_list, ← listblank_append_append] + have h1 : (((l <+ O ^ k) <+ [1]) <{{E}} r) + [target_tm]⊢* + ((l <+ O ^ k) <{{E}} ([1] +> r)) := by + dsimp [ListBlank.append]; execute + have h2 := ih l ([1] +> r) + rw [listblank_append_append, list_pow_append_one] at h2 + exact stepStar_trans h1 h2 + +theorem shift_D_right_1 (k : Nat) (l r : ListBlank (Fin 2)) : + (l {{D}}> (O ^ k +> r)) [target_tm]⊢* + ((l <+ O ^ k) {{D}}> r) := by + induction k generalizing l r with + | zero => + simp only [pow_zero_list, listblank_append_nil] + exact ⟨0, rfl⟩ + | succ k ih => + rw [pow_succ_append_right] + have h1 : (l {{D}}> ([1] +> (O ^ k +> r))) + [target_tm]⊢* + ((l <+ [1]) {{D}}> (O ^ k +> r)) := by + dsimp [ListBlank.append]; execute + have h2 := ih (l <+ [1]) r + rw [listblank_append_append, list_pow_append_one] at h2 + exact stepStar_trans h1 h2 + +theorem sweep_R (k : Nat) (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0] +> (O ^ (k + 5) +> ([0, 1] +> r)))) [target_tm]⊢⁺ + (((l <+ [1, 1, 0]) <+ Z ^ k) {{B}}> ([0, 1, 1, 1, 0] +> r)) := by + have hk : k + 5 = (k + 3) + 1 + 1 := by omega + rw [hk, pow_succ_append_right O (k + 3 + 1), pow_succ_append_right O (k + 3)] + have h1 : (l {{B}}> ([0] +> (O +> (O +> (O ^ (k + 3) +> ([0, 1] +> r)))))) + [target_tm]⊢⁺ + ((l <+ [1, 1, 0]) {{A}}> (O ^ (k + 3) +> ([0, 1] +> r))) := by + dsimp [O, ListBlank.append]; execute + have h2 := shift_A_right_1 (k + 3) (l <+ [1, 1, 0]) ([0, 1] +> r) + have h12 := stepPlus_stepStar_stepPlus h1 h2 + have hk3 : k + 3 = k + 1 + 1 + 1 := by omega + rw [hk3, pow_add_append_left _ Z (k + 1 + 1) 1, pow_add_append_left _ Z (k + 1) 1, + pow_add_append_left _ Z k 1, pow_succ_list Z 0, pow_zero_list Z, append_nil_list] at h12 + have h3 : ((((((l <+ [1, 1, 0]) <+ Z ^ k) <+ Z) <+ Z) <+ Z) {{A}}> ([0, 1] +> r)) + [target_tm]⊢⁺ + (((l <+ [1, 1, 0]) <+ Z ^ k) {{B}}> ([0, 1, 1, 1, 0] +> r)) := by + dsimp [Z, ListBlank.append]; execute + exact stepPlus_trans h12 h3 + +theorem sweep_blank_R (k : Nat) (l : ListBlank (Fin 2)) : + (l {{B}}> ([0] +> (O ^ (k + 4) +> default))) [target_tm]⊢⁺ + (((l <+ [1, 1, 0]) <+ Z ^ k) {{D}}> ([0, 1, 0, 1, 1] +> default)) := by + have hk : k + 4 = (k + 2) + 1 + 1 := by omega + rw [hk, pow_succ_append_right O (k + 2 + 1), pow_succ_append_right O (k + 2)] + have h1 : (l {{B}}> ([0] +> (O +> (O +> (O ^ (k + 2) +> default))))) + [target_tm]⊢⁺ + ((l <+ [1, 1, 0]) {{A}}> (O ^ (k + 2) +> default)) := by + dsimp [O, ListBlank.append]; execute + have h2 := shift_A_right_1 (k + 2) (l <+ [1, 1, 0]) default + have h12 := stepPlus_stepStar_stepPlus h1 h2 + have hk2 : k + 2 = k + 1 + 1 := by omega + rw [hk2, pow_add_append_left _ Z (k + 1) 1, pow_add_append_left _ Z k 1, + pow_succ_list Z 0, pow_zero_list Z, append_nil_list] at h12 + have h3 : (((((l <+ [1, 1, 0]) <+ Z ^ k) <+ Z) <+ Z) {{A}}> default) + [target_tm]⊢⁺ + (((l <+ [1, 1, 0]) <+ Z ^ k) {{D}}> ([0, 1, 0, 1, 1] +> default)) := by + dsimp [Z, ListBlank.append]; execute + exact stepPlus_trans h12 h3 + +theorem left_sweep_to_hub (k : Nat) (l r : ListBlank (Fin 2)) : + (((l <+ [0, 0]) <+ O ^ (k + 1)) {{D}}> ([0] +> r)) [target_tm]⊢⁺ + (l {{D}}> ([0] +> (O ^ (k + 1) +> ([0, 1] +> r)))) := by + rw [pow_add_append_left (l <+ [0, 0]) O k 1, pow_succ_list O 0, pow_zero_list O, append_nil_list] + have h1 : ((((l <+ [0, 0]) <+ O ^ k) <+ O) {{D}}> ([0] +> r)) + [target_tm]⊢⁺ + (((l <+ [0, 0]) <+ O ^ k) <{{E}} ([0, 1] +> r)) := by + dsimp [O, ListBlank.append]; execute + have h2 := shift_E_left_1 k (l <+ [0, 0]) ([0, 1] +> r) + have h12 := stepPlus_stepStar_stepPlus h1 h2 + have h3 : ((l <+ [0, 0]) <{{E}} (O ^ k +> ([0, 1] +> r))) + [target_tm]⊢⁺ + (l {{D}}> ([0] +> ([1] +> (O ^ k +> ([0, 1] +> r))))) := by + dsimp [ListBlank.append]; execute + have h123 := stepPlus_trans h12 h3 + rw [← pow_succ_append_right O k] at h123 + exact h123 + +theorem left_sweep_to_B (k : Nat) (l r : ListBlank (Fin 2)) : + (((l <+ [0, 0, 0]) <+ O ^ (k + 1)) {{D}}> ([0] +> r)) [target_tm]⊢⁺ + (l {{B}}> ([0] +> (O ^ (k + 2) +> ([0, 1] +> r)))) := by + have heq : l <+ [0, 0, 0] = (l <+ [0]) <+ [0, 0] := rfl + rw [heq] + have h1 := left_sweep_to_hub k (l <+ [0]) r + have h2 : ((l <+ [0]) {{D}}> ([0] +> (O ^ (k + 1) +> ([0, 1] +> r)))) + [target_tm]⊢⁺ + (l {{B}}> ([0] +> ([1] +> (O ^ (k + 1) +> ([0, 1] +> r))))) := by + dsimp [ListBlank.append]; execute + have h12 := stepPlus_trans h1 h2 + rw [← pow_succ_append_right O (k + 1)] at h12 + exact h12 + +theorem merge_011 (k : Nat) (l r : ListBlank (Fin 2)) : + (((l <+ [0, 1, 1, 0]) <+ O ^ (k + 1)) {{D}}> ([0] +> r)) [target_tm]⊢⁺ + (((l <+ [0]) <+ O ^ (k + 3)) {{D}}> ([0, 1] +> r)) := by + rw [pow_add_append_left (l <+ [0, 1, 1, 0]) O k 1, pow_succ_list O 0, pow_zero_list O, + append_nil_list] + have h1 : ((((l <+ [0, 1, 1, 0]) <+ O ^ k) <+ O) {{D}}> ([0] +> r)) + [target_tm]⊢⁺ + (((l <+ [0, 1, 1, 0]) <+ O ^ k) <{{E}} ([0, 1] +> r)) := by + dsimp [O, ListBlank.append]; execute + have h2 := shift_E_left_1 k (l <+ [0, 1, 1, 0]) ([0, 1] +> r) + have h12 := stepPlus_stepStar_stepPlus h1 h2 + have h3 : ((l <+ [0, 1, 1, 0]) <{{E}} (O ^ k +> ([0, 1] +> r))) + [target_tm]⊢⁺ + ((((((l <+ [0]) <+ O) <+ O) <+ O)) {{D}}> (O ^ k +> ([0, 1] +> r))) := by + dsimp [O, ListBlank.append]; execute + have h123 := stepPlus_trans h12 h3 + have ho3 : (((((l <+ [0]) <+ O) <+ O) <+ O)) = ((l <+ [0]) <+ O ^ 3) := by + rw [pow_succ_list O 2, pow_succ_list O 1, pow_succ_list O 0, pow_zero_list O, append_nil_list] + simp only [listblank_append_append]; rfl + rw [ho3] at h123 + have h4 := shift_D_right_1 k ((l <+ [0]) <+ O ^ 3) ([0, 1] +> r) + have h1234 := stepPlus_stepStar_stepPlus h123 h4 + rw [← pow_add_append_left (l <+ [0]) O 3 k] at h1234 + have hk : 3 + k = k + 3 := by omega + rw [hk] at h1234 + exact h1234 + +theorem merge_p5 (k : Nat) (l r : ListBlank (Fin 2)) : + (((l <+ [0, 1, 0, 1, 1, 0]) <+ O ^ (k + 1)) {{D}}> ([0] +> r)) [target_tm]⊢⁺ + (((l <+ [0]) <+ O ^ (k + 4)) {{D}}> ([0, 1, 1] +> r)) := by + rw [pow_add_append_left (l <+ [0, 1, 0, 1, 1, 0]) O k 1, pow_succ_list O 0, pow_zero_list O, + append_nil_list] + have h1 : ((((l <+ [0, 1, 0, 1, 1, 0]) <+ O ^ k) <+ O) {{D}}> ([0] +> r)) + [target_tm]⊢⁺ + (((l <+ [0, 1, 0, 1, 1, 0]) <+ O ^ k) <{{E}} ([0, 1] +> r)) := by + dsimp [O, ListBlank.append]; execute + have h2 := shift_E_left_1 k (l <+ [0, 1, 0, 1, 1, 0]) ([0, 1] +> r) + have h12 := stepPlus_stepStar_stepPlus h1 h2 + have h3 : ((l <+ [0, 1, 0, 1, 1, 0]) <{{E}} (O ^ k +> ([0, 1] +> r))) + [target_tm]⊢⁺ + ((((l <+ [0, 1, 1, 0]) <+ O) <+ O) {{D}}> (O ^ k +> ([0, 1] +> r))) := by + dsimp [O, ListBlank.append]; execute + have h123 := stepPlus_trans h12 h3 + have ho2 : (((l <+ [0, 1, 1, 0]) <+ O) <+ O) = ((l <+ [0, 1, 1, 0]) <+ O ^ 2) := by + rw [pow_succ_list O 1, pow_succ_list O 0, pow_zero_list O, append_nil_list] + simp only [listblank_append_append]; rfl + rw [ho2] at h123 + have h4 := shift_D_right_1 k ((l <+ [0, 1, 1, 0]) <+ O ^ 2) ([0, 1] +> r) + have h1234 := stepPlus_stepStar_stepPlus h123 h4 + rw [← pow_add_append_left (l <+ [0, 1, 1, 0]) O 2 k] at h1234 + have hk : 2 + k = (k + 1) + 1 := by omega + rw [hk] at h1234 + have h5 := merge_011 (k + 1) l ([1] +> r) + exact stepPlus_trans h1234 h5 + +-- ============================================================================ +-- Section 5c: Concrete Finite Bridges for target_tm +-- ============================================================================ + +theorem thm_A_0 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 1, 1, 1, 0, 1] +> r)) [target_tm]⊢⁺ + (((l <+ [0]) <+ O ^ 4) {{D}}> ([0] +> r)) := by + dsimp [O, ListBlank.append]; execute + +theorem step_D_0011 (l r : ListBlank (Fin 2)) : + ((l <+ [1, 1, 0, 0, 0]) {{D}}> ([0, 1] +> r)) [target_tm]⊢⁺ + (((l <+ [0]) <+ O ^ 4) {{D}}> ([0, 1] +> r)) := by + dsimp [O, ListBlank.append]; execute + +theorem step_D_p3z1_pop (l r : ListBlank (Fin 2)) : + ((l <+ [1, 1, 0, 0]) {{D}}> ([0, 1] +> r)) [target_tm]⊢⁺ + (l {{D}}> ([0, 1, 1, 0, 1, 1] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem bridge_b2_m0 (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 1, 1, 1, 1, 1, 0, 1, 1] +> r)) [target_tm]⊢⁺ + (((l <+ [0]) <+ O ^ 6) {{D}}> ([0, 1] +> r)) := by + dsimp [O, ListBlank.append]; execute + +theorem bridge_b2_tail (l r : ListBlank (Fin 2)) : + ((l <+ [0, 0]) {{B}}> ([0, 1, 1, 1, 0, 1] +> r)) [target_tm]⊢⁺ + (l {{B}}> ([0, 1, 1, 1, 1, 1, 0, 1] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem bridge_b5a (l : ListBlank (Fin 2)) : + (l {{B}}> ([0, 1, 1, 1, 1, 1, 0, 1] +> default)) [target_tm]⊢⁺ + (((l <+ [0]) <+ O ^ 5) {{D}}> ([0, 1, 1, 1] +> default)) := by + dsimp [O, ListBlank.append]; execute60 + +theorem bridge_b5b_pre (l r : ListBlank (Fin 2)) : + (l {{B}}> ([0, 1, 1, 1, 1, 1, 0, 1, 0] +> r)) [target_tm]⊢⁺ + (((l <+ [1, 1, 0]) <+ [1, 0, 1, 1, 0]) {{B}}> ([0] +> r)) := by + dsimp [ListBlank.append]; execute + +theorem bridge_b5b_d0_blank (l : ListBlank (Fin 2)) : + (((l <+ [1, 1, 0]) <+ [1, 0, 1, 1, 0]) {{B}}> ([0, 1, 1] +> default)) [target_tm]⊢⁺ + ((((l <+ [1, 1, 0]) <+ [0]) <+ O ^ 6) {{D}}> ([0, 1, 1, 1] +> default)) := by + dsimp [O, ListBlank.append]; execute + +theorem bridge_b5b_d1_blank (l : ListBlank (Fin 2)) : + (((l <+ [1, 1, 0]) <+ [1, 0, 1, 1, 0]) {{B}}> ([0, 1, 1, 1] +> default)) [target_tm]⊢⁺ + (((((l <+ [1, 1, 0]) <+ [1, 1, 0]) <+ [0]) <+ O ^ 4) {{D}}> ([0, 1, 1, 1] +> default)) := by + dsimp [O, ListBlank.append]; execute + +theorem bridge_b5b_d2_blank (l : ListBlank (Fin 2)) : + (((l <+ [1, 1, 0]) <+ [1, 0, 1, 1, 0]) {{B}}> ([0, 1, 1, 1, 1] +> default)) [target_tm]⊢⁺ + ((((l <+ [1, 1, 0]) <+ [0]) <+ O ^ 5) {{D}}> ([0, 1, 1, 1, 0, 1, 1] +> default)) := by + dsimp [O, ListBlank.append]; execute + +theorem bridge_blank_apos_tail (l : ListBlank (Fin 2)) : + ((l <+ [0, 0, 0]) {{D}}> ([0, 1, 0, 1, 1] +> default)) [target_tm]⊢⁺ + (((l <+ [0]) <+ O ^ 5) {{D}}> ([0, 1, 1, 1] +> default)) := by + dsimp [O, ListBlank.append]; execute60 + +-- ============================================================================ +-- Section 5d: Closed State Space & Step Function for target_tm +-- ============================================================================ + +inductive LTok where + | p3z (m : Nat) + | p5 + deriving DecidableEq + +def evalL : List LTok → ListBlank (Fin 2) + | [] => default + | .p3z m :: ls => ((evalL ls <+ [1, 1, 0]) <+ Z ^ m) + | .p5 :: ls => (evalL ls <+ [1, 0, 1, 1, 0]) + +def evalR : List Nat → ListBlank (Fin 2) + | [] => default + | d :: ds => [0] +> (O ^ (d + 2) +> evalR ds) + +inductive ModeState where + | ModeE_c1 (ls : List LTok) (k : Nat) (ds : List Nat) + | ModeE_ge2 (ls : List LTok) (k : Nat) (c : Nat) (ds : List Nat) + | ModeB_ge3 (ls : List LTok) (a : Nat) (c : Nat) (ds : List Nat) + | ModeB_b2 (ls : List LTok) (m : Nat) (ds : List Nat) + | ModeB_blank (ls : List LTok) (a : Nat) + +def k0Of (k : Nat) : Nat := + match k with + | 0 => 0 + | k' + 1 => k' + 2 + +def m0Of (m : Nat) : Nat := + match m with + | 0 => 0 + | m' + 1 => m' + 2 + +def toCfg : ModeState → Cfg (Fin 2) (Fin 6) + | .ModeE_c1 ls k ds => + (((evalL ls <+ [0]) <+ O ^ (k0Of k + 4)) {{D}}> ([0, 1] +> evalR ds)) + | .ModeE_ge2 ls k c ds => + (((evalL ls <+ [0]) <+ O ^ (k + 4)) {{D}}> ([0] +> (O ^ (c + 2) +> evalR ds))) + | .ModeB_ge3 ls a c ds => + ((evalL ls) {{B}}> ([0] +> (O ^ (a + 5) +> ([0] +> (O ^ (c + 3) +> evalR ds))))) + | .ModeB_b2 ls m ds => + ((evalL ls) {{B}}> ([0] +> (O ^ (m0Of m + 5) +> ([0, 1, 1] +> evalR ds)))) + | .ModeB_blank ls a => + ((evalL ls) {{B}}> ([0] +> (O ^ (a + 5) +> default))) + +def nextModeE_p3z1 : List LTok → Nat → List Nat → ModeState + | [], b, ds => .ModeE_ge2 [] 0 b ds + | .p3z 0 :: ls'', b, ds => .ModeE_ge2 ls'' 0 (b + 1) ds + | .p3z 1 :: ls'', b, ds => nextModeE_p3z1 ls'' 0 ((b + 1) :: ds) + | .p3z (m2 + 2) :: ls'', b, ds => .ModeE_ge2 (.p3z m2 :: ls'') 0 b ds + | .p5 :: ls'', b, ds => .ModeE_ge2 ls'' 1 (b + 2) ds + +def nextState : ModeState → ModeState + | .ModeE_c1 [] k ds => .ModeB_b2 [] k ds + | .ModeE_c1 (.p3z 0 :: ls') k ds => .ModeE_ge2 ls' (k0Of k + 2) 0 ds + | .ModeE_c1 (.p3z 1 :: ls') k ds => nextModeE_p3z1 ls' (k0Of k + 2) (0 :: ds) + | .ModeE_c1 (.p3z (m2 + 2) :: ls') k ds => .ModeB_b2 (.p3z m2 :: ls') k ds + | .ModeE_c1 (.p5 :: ls') k ds => .ModeE_ge2 ls' (k0Of k + 3) 1 ds + | .ModeE_ge2 [] k c ds => .ModeB_ge3 [] k c ds + | .ModeE_ge2 (.p3z 0 :: ls') k c ds => .ModeE_ge2 ls' (k + 2) (c + 1) ds + | .ModeE_ge2 (.p3z 1 :: ls') k c ds => nextModeE_p3z1 ls' (k + 2) ((c + 1) :: ds) + | .ModeE_ge2 (.p3z (m2 + 2) :: ls') k c ds => .ModeB_ge3 (.p3z m2 :: ls') k c ds + | .ModeE_ge2 (.p5 :: ls') k c ds => .ModeE_ge2 ls' (k + 3) (c + 2) ds + | .ModeB_ge3 ls a 0 ds => .ModeE_c1 (.p3z a :: ls) 0 ds + | .ModeB_ge3 ls a (c' + 1) ds => .ModeE_ge2 (.p3z a :: ls) 0 c' ds + | .ModeB_b2 ls 0 ds => .ModeE_c1 ls 1 ds + | .ModeB_b2 ls (m' + 1) [] => .ModeE_ge2 (.p3z m' :: ls) 1 1 [] + | .ModeB_b2 ls (m' + 1) [0] => .ModeE_ge2 (.p3z 0 :: .p3z m' :: ls) 2 1 [] + | .ModeB_b2 ls (m' + 1) [1] => .ModeE_ge2 (.p3z 0 :: .p3z 0 :: .p3z m' :: ls) 0 1 [] + | .ModeB_b2 ls (m' + 1) [2] => .ModeE_ge2 (.p3z 0 :: .p3z m' :: ls) 1 1 [0] + | .ModeB_b2 ls (m' + 1) [m'' + 3] => .ModeB_blank (.p5 :: .p3z 0 :: .p3z m' :: ls) m'' + | .ModeB_b2 ls (m' + 1) ((m4 + 5) :: 0 :: ds'') => + .ModeB_b2 (.p5 :: .p3z 0 :: .p3z m' :: ls) (m4 + 1) ds'' + | .ModeB_b2 ls (m' + 1) ((m'' + 3) :: (c' + 1) :: ds'') => + .ModeB_ge3 (.p5 :: .p3z 0 :: .p3z m' :: ls) m'' c' ds'' + | .ModeB_b2 ls (m' + 1) ds => .ModeB_b2 ls (m' + 1) ds + | .ModeB_blank ls (a'' + 2) => .ModeE_ge2 (.p3z a'' :: ls) 1 1 [] + | .ModeB_blank ls a => .ModeB_blank ls a + +-- ============================================================================ +-- Section 5e: Inductive Invariant on ModeState +-- ============================================================================ + +def z0 : List LTok → Nat + | .p3z 0 :: ls => 1 + z0 ls + | _ => 0 + +def dropZ0 : List LTok → List LTok + | .p3z 0 :: ls => dropZ0 ls + | ls => ls + +def z0Rep : Nat → List LTok → List LTok + | 0, rest => rest + | n + 1, rest => .p3z 0 :: z0Rep n rest + +def ep : List LTok → Nat + | .p3z m :: ls => if m % 2 = 1 then 0 else 1 + ep ls + | _ => 0 + +def epW : List LTok → Nat + | .p3z m :: ls => + if m % 2 = 1 then 0 + else match ls with + | .p5 :: _ => 0 + | _ => 1 + epW ls + | _ => 0 + +def prefSumW : List LTok → Nat + | .p3z m :: ls => + if m % 2 = 1 then 0 + else match ls with + | .p5 :: _ => 0 + | _ => m + prefSumW ls + | _ => 0 + +def epSum : List LTok → Nat + | .p3z m :: ls => if m % 2 = 1 then m - 1 else m + epSum ls + | _ => 0 + +def hasOdd : List LTok → Bool + | .p3z m :: ls => if m % 2 = 1 then true else hasOdd ls + | _ => false + +def hasP5 : List LTok → Bool + | [] => false + | .p5 :: _ => true + | .p3z _ :: ls => hasP5 ls + +def preP5Val : List LTok → Nat + | .p3z m :: ls => + match ls with + | .p5 :: _ => m + | _ => preP5Val ls + | _ => 0 + +def MustDrain : List LTok → Bool + | .p3z m :: ls => + if m % 2 = 1 then + match ls with + | .p5 :: _ => false + | _ => true + else MustDrain ls + | _ => false + +def p5Suf : List LTok → List LTok + | [] => [] + | .p5 :: ls => ls + | .p3z _ :: ls => p5Suf ls + +def isHeadP5 : List LTok → Bool + | .p5 :: _ => true + | _ => false + +def isHeadP3z1 : List LTok → Bool + | .p3z 1 :: _ => true + | _ => false + +def headP3zVal : List LTok → Nat + | .p3z m :: _ => m + | _ => 0 + +def isP3zGe1P5 : List LTok → Bool + | .p3z (_ + 1) :: .p5 :: _ => true + | _ => false + +def isP3zP5 : List LTok → Bool + | .p3z _ :: .p5 :: _ => true + | _ => false + +def drop1L : List LTok → List LTok + | [] => [] + | _ :: xs => xs + +def drop2L : List LTok → List LTok + | _ :: _ :: xs => xs + | _ => [] + +def headNat : List Nat → Nat + | [] => 0 + | d :: _ => d + +def ValidP5Chain : List LTok → Bool + | [] => true + | .p3z 0 :: ls => ValidP5Chain ls + | .p5 :: suf => decide (z0 suf ≥ 18) && ValidP5Chain suf + | .p3z (_ + 1) :: .p5 :: suf => decide (z0 suf ≥ 18) && ValidP5Chain suf + | _ => false + +def ValidAfterOdd : List LTok → Bool + | [] => true + | .p5 :: suf => decide (z0 suf ≥ 18) && ValidP5Chain suf + | .p3z _ :: .p5 :: suf => decide (z0 suf ≥ 18) && ValidP5Chain suf + | _ => false + +def ValidEvenLs : List LTok → Bool + | [] => true + | .p5 :: suf => decide (z0 suf ≥ 18) && ValidP5Chain suf + | .p3z m :: rest => + if m % 2 = 0 then ValidEvenLs rest + else ValidAfterOdd rest + +def isOddDrain1 (d : Nat) : Bool := + decide (d = 9 ∨ d = 11 ∨ d = 13 ∨ d = 15 ∨ d = 17) + +def isOddDrainDs : List Nat → Bool + | [d] => isOddDrain1 d + | [d, 0] => isOddDrain1 d + | _ => false + +def GoodDs1 (d : Nat) : Bool := + decide (d ≤ 2 ∨ d ≥ 8) + +def GoodDs2 (d d2 : Nat) : Bool := + if d2 = 0 then decide (d ≥ 8) + else if d2 = 1 then decide (d = 3 ∨ d ≥ 25) + else if d2 < 3 then false + else if isOddDrain1 d2 && decide (d < 19) then false + else if decide (d < 17) || !GoodDs1 d2 then false + else if decide (d % 2 = 0 ∧ d ≤ 2 * d2 + 4) && !GoodDs1 (d2 - 1) then false + else if decide (d % 2 = 0 ∧ d + 14 ≤ 2 * d2) && !GoodDs1 (d2 - 2) then false + else true + +def GoodDsAux : Nat → List Nat → Bool + | d, [] => GoodDs1 d + | d, [d2] => GoodDs2 d d2 + | d, d2 :: d3 :: ds3 => + if d2 < 3 then false + else if decide (d2 = 3 ∧ d3 = 1 ∧ ds3 = [] ∧ d < 19) then false + else if isOddDrainDs (d2 :: d3 :: ds3) && decide (d < 19) then false + else if decide (d2 ≥ 25 ∧ d3 = 1 ∧ ds3 = [] ∧ d < 39) then false + else if decide (d < 17) || !GoodDsAux d2 (d3 :: ds3) then false + else if decide (d % 2 = 0 ∧ d ≤ 2 * d2 + 4) && !GoodDsAux (d2 - 1) (d3 :: ds3) then false + else if decide (d % 2 = 0 ∧ d + 14 ≤ 2 * d2) && !GoodDsAux (d2 - 2) (d3 :: ds3) then false + else true + +def GoodDs : List Nat → Bool + | [] => true + | d :: ds => GoodDsAux d ds + +def GoodPhiW (phiW : Nat) (ds : List Nat) (is_start : Bool) : Bool := + if ds = [2] then decide (phiW = 4) + else if ds = [0] then decide (phiW ≥ 6) + else if ds = [1] then decide (phiW ≥ 1) + else if ds = [] then is_start || decide (phiW ≥ 6) + else if match ds with | [d, 1] => decide (d ≥ 25) | _ => false then decide (phiW ≥ 35) + else if isOddDrainDs ds then decide (phiW ≥ 17) + else decide (phiW ≥ 15) + +def GoodPsi (psi : Nat) (ds : List Nat) : Bool := + GoodDs ((psi + 1) :: ds) + +def checkChainAux : Nat → Bool → List LTok → Nat → Nat → Nat → List Nat → Bool + | 0, _, _, _, _, _, _ => true + | fuel + 1, false, ls, c, k, _, ds => + let cz := c + z0 ls + let kz := k + 2 * z0 ls + let rem := dropZ0 ls + if !isHeadP5 rem && !GoodPhiW (cz - 1) ds false then false + else match rem with + | [] => GoodPsi (cz - 1) ds && checkChainAux fuel true [] (kz + 2) 0 (2 * (kz + 1) + + 4) (cz :: ds) + | .p5 :: suf => checkChainAux fuel true suf (cz + 3) (kz + 3) (2 * (cz + 2) + 4) ds + | .p3z m :: rest => + let suf := drop1L rest + if m = 1 then + GoodPsi cz ds && checkChainAux fuel false suf (kz + 4) 1 0 ((cz + 1) :: ds) + else if !GoodPsi (cz - 1) ds then false + else if m % 2 = 0 ∧ m ≤ 2 * kz + 10 then + checkChainAux fuel false suf (kz + 4) (m + 1) 0 (cz :: ds) + else if m % 2 = 1 ∧ m ≤ 2 * kz + 11 then + GoodDs ((kz + 2) :: cz :: ds) && checkChainAux fuel false suf (m - 1) 1 0 ((kz + + 2) :: cz :: ds) + else + checkChainAux fuel true (.p3z (m - 4) :: .p5 :: suf) (kz + 2) 0 (2 * (kz + 1) + + 4) (cz :: ds) + | fuel + 1, true, ls, cp1, kb, margin, ds => + if hasOdd ls && decide (margin ≥ kb + epSum ls) then + let psip1 := cp1 + ep ls + let xi := kb + epSum ls + 2 * ep ls + let suf := p5Suf ls + if !MustDrain ls then + if !hasP5 ls then + checkChainAux fuel true [] (xi + 3) 0 (2 * (xi + 2) + 4) (psip1 :: ds) + else + GoodDs (psip1 :: ds) && checkChainAux fuel false suf (xi + 4) 1 0 (psip1 :: ds) + else if hasP5 ls then + let m2 := preP5Val ls + if m2 % 2 = 0 ∧ m2 ≤ 2 * xi + 10 then + checkChainAux fuel false suf (xi + 5) (m2 + 3) 0 (psip1 :: ds) + else if m2 % 2 = 1 ∧ m2 ≤ 2 * xi + 11 then + GoodDs ((xi + 3) :: psip1 :: ds) && checkChainAux fuel false suf (m2 + 1) 1 0 ((xi + + 3) :: psip1 :: ds) + else + checkChainAux fuel true (.p3z (m2 - 2) :: .p5 :: suf) (xi + 3) 0 (2 * (xi + 2) + + 4) (psip1 :: ds) + else + checkChainAux fuel true [] (xi + 3) 0 (2 * (xi + 2) + 4) (psip1 :: ds) + else if !hasOdd ls && hasP5 ls && (isHeadP5 ls || decide (margin ≥ kb + epSum ls)) then + checkChainAux fuel false (p5Suf ls) (cp1 + ep ls + 1) (kb + epSum ls + 2 * ep ls + 3) 0 ds + else if match ds with | [d] => decide (d ≥ 8) | [d, 0] => decide (d ≥ 8) | _ => false then + let phiWp1 := cp1 + epW ls + let reqp1 := if isOddDrainDs ds then 18 else 16 + if phiWp1 < reqp1 then false + else + let m_rem := kb + epSum ls + (if hasOdd ls then 1 else 0) - (margin + 2) + let tail_b2 := if hasP5 ls then .p3z m_rem :: .p5 :: p5Suf ls else [] + let suf_b2 := z0Rep (phiWp1 + 2) tail_b2 + let m_rst := headNat ds - 7 + if m_rst = 1 then + checkChainAux fuel false suf_b2 2 1 0 [3, 1] + else + checkChainAux fuel true (.p3z (m_rst - 2) :: .p5 :: suf_b2) 3 0 8 [1] + else if ds = [] ∨ ds = [0] ∨ ds = [1] ∨ ds = [2] then + let phiWp1 := cp1 + epW ls + if phiWp1 < 2 then true + else + let m_rem := kb + epSum ls + (if hasOdd ls then 1 else 0) - (margin + 2) + let tail_b2 := if hasP5 ls then .p3z m_rem :: .p5 :: p5Suf ls else [] + if ds = [] then + checkChainAux fuel false (z0Rep (phiWp1 + 1) tail_b2) 1 1 0 [] + else if ds = [0] then + checkChainAux fuel true (z0Rep (phiWp1 + 2) tail_b2) 2 2 6 [] + else if ds = [1] then + checkChainAux fuel true (z0Rep (phiWp1 + 3) tail_b2) 2 0 6 [] + else + checkChainAux fuel false (z0Rep (phiWp1 + 2) tail_b2) 1 1 0 [0] + else match ds with + | d :: d2 :: ds2 => + if d ≥ 3 ∧ d2 ≥ 1 then + if d % 2 = 0 ∧ d ≤ 2 * d2 + 4 ∧ GoodDs ((d2 - 1) :: ds2) = false then false + else if d % 2 = 0 ∧ d + 14 ≤ 2 * d2 ∧ GoodDs ((d2 - 2) :: ds2) = false then false + else if cp1 + epW ls < 16 then false + else + let phiWp1 := cp1 + epW ls + let m_rem := kb + epSum ls + (if hasOdd ls then 1 else 0) - (margin + 2) + let tail_b2 := if hasP5 ls then .p3z m_rem :: .p5 :: p5Suf ls else [] + let ls_b2 := z0Rep phiWp1 tail_b2 + if d2 = 1 ∧ ds2 = [] ∧ d ≥ 25 then + checkChainAux fuel true (.p3z (d - 11) :: .p5 :: .p3z 0 :: .p3z 0 :: ls_b2) 5 0 12 [2] + else + let nls_pop := .p3z (d - 3) :: .p5 :: .p3z 0 :: .p3z 0 :: ls_b2 + checkChainAux fuel true nls_pop (d2 - 1) 0 (2 * d2) ds2 + else true + | _ => true + +def checkResetSufAux (fuel : Nat) (m : Nat) (suf : List LTok) : Bool := + if m = 1 then + checkChainAux fuel false suf 2 1 0 [3, 1] + else + checkChainAux fuel true (.p3z (m - 2) :: .p5 :: suf) 3 0 8 [1] + +def checkDs2 (s : ModeState) : Bool := + match s with + | .ModeB_blank _ _ => true + | .ModeE_ge2 ls k c ds => + if ds ≠ [2] then true + else hasP5 ls && !MustDrain ls && decide (z0 (p5Suf ls) ≥ 38) && + decide (k % 2 = 0) && !isHeadP5 ls && decide (k + epSum ls ≥ 2 * c + 6) + | .ModeB_ge3 ls a c ds => + if ds ≠ [2] then true + else hasP5 ls && !MustDrain ls && decide (z0 (p5Suf ls) ≥ 38) && + decide (a % 2 = 0) && !isHeadP5 ls && decide (a + epSum ls ≥ 2 * c + 4) + | .ModeE_c1 ls k ds => + if ds ≠ [2] then true + else hasP5 ls && !MustDrain ls && decide (z0 (p5Suf ls) ≥ 38) && + !isHeadP5 ls && decide (2 * k + epSum ls ≥ 4) + | .ModeB_b2 ls m ds => + if ds ≠ [2] then true + else hasP5 ls && !MustDrain ls && decide (z0 (p5Suf ls) ≥ 38) && + !isHeadP5 ls && decide (2 * m + epSum ls ≥ 2) + +def checkDs1Phi1 (s : ModeState) : Bool := + match s with + | .ModeB_blank _ _ => true + | .ModeE_ge2 ls k c ds => + if ds ≠ [1] then true + else + let phi1_case := + if k % 2 = 0 then + let pw := if isHeadP5 ls then c - 1 else c + epW ls + decide (pw = 1) + else false + if !phi1_case then true + else hasP5 ls && !MustDrain ls && !isHeadP5 ls && decide (k + epSum ls ≥ 2 * c + 14) + | .ModeB_ge3 ls a c ds => + if ds ≠ [1] then true + else + let phi1_case := + if a % 2 = 0 then + let pw := if isHeadP5 ls then c - 1 else c + epW ls + decide (pw = 1) + else decide (c = 2) + if !phi1_case then true + else + let nls := .p3z a :: ls + hasP5 nls && !MustDrain nls && !isHeadP5 nls && + (if a % 2 = 0 then decide (a + epSum ls ≥ 2 * c + 12) else decide (a ≥ 2 * c + 13)) + | .ModeE_c1 ls k ds => + if ds ≠ [1] then true + else if epW ls ≠ 2 then true + else hasP5 ls && !MustDrain ls && !isHeadP5 ls && decide (2 * k + epSum ls ≥ 12) + | .ModeB_b2 ls m ds => + if ds ≠ [1] then true + else if epW ls ≠ 2 then true + else hasP5 ls && !MustDrain ls && !isHeadP5 ls && decide (2 * m + epSum ls ≥ 10) + +def invCore (s : ModeState) : Bool := + match s with + | .ModeB_blank ls a => + decide (a ≥ 5) && isHeadP5 ls && + (let suf := drop1L ls; decide (z0 suf ≥ 18) && ValidP5Chain suf) + | .ModeE_ge2 ls k c ds => + if !GoodDs ds || !checkDs2 s || !checkDs1Phi1 s then false + else if k % 2 = 0 then + if !ValidEvenLs ls then false + else if !(k ≤ 2 * c + 4 ∧ k + prefSumW ls ≤ 2 * c + 6) then false + else + let ok_phi := + if !isHeadP5 ls then + let is_start := isHeadP3z1 ls && decide (k = 0 ∧ c = 0 ∧ ds = []) + let is_phi1 := decide (ds = [] ∧ c + epW ls = 1) && MustDrain ls && + decide (c + ep ls = 1 ∧ k + epSum ls + 2 * ep ls = 2) && + hasP5 ls && decide (preP5Val ls ≥ 16 ∧ z0 (p5Suf ls) ≥ 38) + is_phi1 || GoodPhiW (c + epW ls) ds is_start + else + decide (c = 0 ∧ ds = [] ∧ k = 2) || (decide (c ≥ 1) && GoodPhiW (c - 1) ds false) + if !ok_phi then false + else if MustDrain ls && decide (2 * c + 4 < k + epSum ls) then false + else + let is_reset := decide (k = 0 ∧ c = 0 ∧ ds = []) && isHeadP3z1 ls + let ok_rst := + if is_reset then + match drop1L ls with + | [] => true + | rest => isP3zGe1P5 rest + else true + if !ok_rst then false + else if hasOdd ls && decide (2 * c + 4 ≥ k + epSum ls) then + let psi := c + ep ls + let xi := k + epSum ls + 2 * ep ls + if is_reset then true + else + GoodPsi psi ds && + (!decide (ds = [1] ∧ psi ≥ 24) || decide (xi ≥ 36)) && + (!decide ((ds = [] ∨ ds = [0]) ∧ psi ≥ 8 ∧ + (!hasP5 ls ∨ MustDrain ls)) || decide (xi ≥ 16)) && + (!MustDrain ls || decide (xi ≥ 14 ∧ psi ≥ 7) || + decide (ds = [] ∧ psi = 1 ∧ xi = 2 ∧ preP5Val ls ≥ 16 ∧ z0 (p5Suf ls) ≥ 38)) + else true + else + if !ValidP5Chain ls then false + else if !(c ≥ 1 ∧ k ≤ 2 * c + 3) then false + else + let cz := c + z0 ls + let kz := k + 2 * z0 ls + if ds = [] ∧ k = 1 ∧ c = 1 ∧ isP3zP5 ls = true ∧ headP3zVal ls ≥ 3 then true + else if ds = [] ∧ ((k = 1 ∧ c = 1 ∧ z0 ls = 1) ∨ (k = 3 ∧ c = 2 ∧ z0 ls = 0)) ∧ + isP3zP5 (dropZ0 ls) = true ∧ headP3zVal (dropZ0 ls) ≥ 18 ∧ z0 (p5Suf ls) ≥ 38 then true + else + let ok_base := + if match ds with | d :: _ => decide (d ≥ 3) | [] => false then decide (cz ≥ 20 ∧ + kz ≥ 15) + else decide (cz ≥ 8 ∧ kz ≥ 15) + ok_base && + (!decide (((ds = [] ∨ ds = [0]) ∧ + cz ≥ 9) ∨ isOddDrainDs ds = true) || decide (kz ≥ 17)) && + (!decide (ds = [1]) || decide (kz ≥ 37)) && + (!(match ds with | [d, 1] => decide (d ≥ 25) | _ => false) || decide (cz ≥ 36)) + | .ModeB_ge3 ls a c ds => + if !GoodDs ds || !checkDs2 s || !checkDs1Phi1 s then false + else if a % 2 = 0 then + if !ValidEvenLs ls then false + else + let ok_phi := + if !isHeadP5 ls then + let is_phi1 := decide (ds = [] ∧ c + epW ls = 1) && MustDrain ls && + decide (c + ep ls = 1 ∧ a + epSum ls + 2 * ep ls + 2 = 2) && + hasP5 ls && decide (preP5Val ls ≥ 16 ∧ z0 (p5Suf ls) ≥ 38) + decide (a + prefSumW ls ≤ 2 * c + 4) && + (is_phi1 || GoodPhiW (c + epW ls) ds false) && + (!decide (c = 0) || decide (epW (.p3z a :: ls) ≥ 1)) + else + if c = 0 then decide (ds = [] ∧ (a = 0 ∨ (a ≥ 22 ∧ z0 (p5Suf ls) ≥ 38))) + else GoodPhiW (c - 1) ds false + if !ok_phi then false + else if MustDrain ls && decide (2 * c + 2 < a + epSum ls) then false + else if hasOdd ls && decide (2 * c + 2 ≥ a + epSum ls) then + let psi := c + ep ls + let xi := a + epSum ls + 2 * ep ls + 2 + GoodPsi psi ds && + (!decide (ds = [1] ∧ psi ≥ 24) || decide (xi ≥ 36)) && + (!decide ((ds = [] ∨ ds = [0]) ∧ psi ≥ 8 ∧ + (!hasP5 ls ∨ MustDrain ls)) || decide (xi ≥ 16)) && + (!MustDrain ls || decide (xi ≥ 14 ∧ psi ≥ 7) || + decide (ds = [] ∧ psi = 1 ∧ xi = 2 ∧ preP5Val ls ≥ 16 ∧ z0 (p5Suf ls) ≥ 38)) + else true + else + if c = 0 ∧ !(ds = [] ∧ a ≥ 23 ∧ isHeadP5 ls = true ∧ z0 (p5Suf ls) ≥ 38) then false + else + let nls := .p3z a :: ls + if !ValidEvenLs nls then false + else + let is_reset := decide (a = 1 ∧ c = 1 ∧ ds = []) + let ok_c1 := + if c ≥ 1 then + let is_phi1 := decide (ds = [] ∧ c = 2 ∧ a = 3) && MustDrain nls && + hasP5 ls && decide (preP5Val nls ≥ 16 ∧ z0 (p5Suf ls) ≥ 38) + if !is_reset then is_phi1 || GoodPhiW (c - 1) ds false + else match ls with | [] => true | _ => isP3zGe1P5 ls + else true + if !ok_c1 then false + else if MustDrain nls && decide (a > 2 * c + 3) then false + else if a ≤ 2 * c + 3 then + let psi := c - 1 + if is_reset then true + else + GoodPsi psi ds && + (!decide (ds = [1] ∧ psi ≥ 24) || decide (a ≥ 37)) && + (!decide ((ds = [] ∨ ds = [0]) ∧ psi ≥ 8 ∧ + (!hasP5 ls ∨ MustDrain nls)) || decide (a ≥ 17)) && + (!MustDrain nls || decide (a ≥ 15 ∧ psi ≥ 7) || + decide (ds = [] ∧ psi = 1 ∧ a = 3 ∧ preP5Val nls ≥ 16 ∧ z0 (p5Suf ls) ≥ 38)) + else true + | .ModeE_c1 ls k ds => + if !GoodDs ds || !checkDs2 s || !checkDs1Phi1 s || !ValidEvenLs ls then false + else + let ok_phi := + if ds = [] ∧ epW ls = 0 then + decide (k ≤ 1) && isP3zP5 ls && + (let m0 := headP3zVal ls + decide ((k = 0 ∧ m0 = 0) ∨ (m0 ≥ 22 - 2 * k ∧ z0 (p5Suf ls) ≥ 38))) + else + decide (k ≤ 1 ∧ epW ls ≥ 1 ∧ 2 * k + prefSumW ls ≤ 4) && GoodPhiW (epW ls - 1) ds false + if !ok_phi then false + else if MustDrain ls && decide (2 < 2 * k + epSum ls) then false + else if hasOdd ls && decide (2 ≥ 2 * k + epSum ls) then + let psi := ep ls - 1 + let xi := 2 * k + epSum ls + 2 * ep ls + GoodPsi psi ds && + (!decide (ds = [1] ∧ psi ≥ 24) || decide (xi ≥ 36)) && + (!decide ((ds = [] ∨ ds = [0]) ∧ psi ≥ 8 ∧ + (!hasP5 ls ∨ MustDrain ls)) || decide (xi ≥ 16)) && + (!MustDrain ls || decide (xi ≥ 14 ∧ psi ≥ 7)) + else true + | .ModeB_b2 ls m ds => + if !GoodDs ds || !checkDs2 s || !checkDs1Phi1 s || !ValidEvenLs ls then false + else if m ≥ 2 then decide (ds = [] ∧ m ≥ 4) && isHeadP5 ls + else + let ok_phi := + if ds = [] ∧ epW ls = 0 then + decide (m ≤ 1) && isP3zP5 ls && + (let m0 := headP3zVal ls; decide (m0 ≥ 20 - 2 * m ∧ z0 (p5Suf ls) ≥ 38)) + else + decide (m ≤ 1 ∧ epW ls ≥ 1 ∧ 2 * m + prefSumW ls ≤ 2) && GoodPhiW (epW ls - 1) ds false + if !ok_phi then false + else if MustDrain ls && decide (0 < 2 * m + epSum ls) then false + else if hasOdd ls && decide (0 ≥ 2 * m + epSum ls) then + let psi := ep ls - 1 + let xi := 2 * m + epSum ls + 2 * ep ls + 2 + GoodPsi psi ds && + (!decide (ds = [1] ∧ psi ≥ 24) || decide (xi ≥ 36)) && + (!decide ((ds = [] ∨ ds = [0]) ∧ psi ≥ 8 ∧ + (!hasP5 ls ∨ MustDrain ls)) || decide (xi ≥ 16)) && + (!MustDrain ls || decide (xi ≥ 14 ∧ psi ≥ 7)) + else true + +def invChain (fuel : Nat) (s : ModeState) : Bool := + match s with + | .ModeB_blank ls a => + checkResetSufAux fuel (a - 4) (drop1L ls) + | .ModeE_ge2 ls k c ds => + if k % 2 = 0 then + if k = 0 ∧ c = 0 ∧ ds = [] ∧ isHeadP3z1 ls = true then + match drop1L ls with + | [] => checkChainAux fuel true [] 3 0 8 [1] + | rest => checkResetSufAux fuel (headP3zVal rest) (drop2L rest) + else + checkChainAux fuel true ls (c + 1) k (2 * c + 4) ds + else + if ds = [] ∧ k = 1 ∧ c = 1 ∧ isP3zP5 ls = true ∧ headP3zVal ls ≥ 3 then + checkResetSufAux fuel (headP3zVal ls - 2) (drop2L ls) + else if ds = [] ∧ ((k = 1 ∧ c = 1 ∧ z0 ls = 1) ∨ (k = 3 ∧ c = 2 ∧ z0 ls = 0)) ∧ + isP3zP5 (dropZ0 ls) = true ∧ headP3zVal (dropZ0 ls) ≥ 18 ∧ z0 (p5Suf ls) ≥ 38 then + let rem := dropZ0 ls + checkChainAux fuel true (.p3z (headP3zVal rem - 4) :: .p5 :: drop2L rem) 5 0 12 [2] + else + checkChainAux fuel false ls c k 0 ds + | .ModeB_ge3 ls a c ds => + if a % 2 = 0 then + let ok := checkChainAux fuel true (.p3z a :: ls) c 0 (2 * c + 2) ds + if isHeadP5 ls = true ∧ c = 0 ∧ a ≥ 22 then + ok && checkChainAux fuel true (.p3z (a - 8) :: .p5 :: drop1L ls) 5 0 12 [2] + else ok + else + if a = 1 ∧ c = 1 ∧ ds = [] then + match ls with + | [] => checkChainAux fuel true [] 3 0 8 [1] + | _ => checkResetSufAux fuel (headP3zVal ls) (drop2L ls) + else + let ok := checkChainAux fuel true (.p3z a :: ls) c 0 (2 * c + 2) ds + if c = 0 then + ok && checkChainAux fuel true (.p3z (a - 8) :: .p5 :: drop1L ls) 5 0 12 [2] + else ok + | .ModeE_c1 ls k ds => + let ok := checkChainAux fuel true ls 0 (2 * k) 2 ds + if ds = [] ∧ epW ls = 0 then + let m0 := headP3zVal ls + if !(k = 0 ∧ m0 = 0) then + ok && checkChainAux fuel true (.p3z (m0 - 6 - 2 * (1 - k)) :: .p5 :: drop2L ls) 5 0 12 [2] + else ok + else ok + | .ModeB_b2 ls m ds => + if m ≥ 2 then + checkResetSufAux fuel (m - 3) (drop1L ls) + else + let ok := checkChainAux fuel true ls 0 2 (2 - 2 * m) ds + if ds = [] ∧ epW ls = 0 then + let m0 := headP3zVal ls + ok && checkChainAux fuel true (.p3z (m0 - 4 - 2 * (1 - m)) :: .p5 :: drop2L ls) 5 0 12 [2] + else ok + +def Inv (s : ModeState) : Prop := + invCore s = true ∧ ∀ fuel : Nat, invChain fuel s = true + +-- ============================================================================ +-- Section 5f: TM Step Simulation & Invariant Preservation +-- ============================================================================ + +theorem GoodDs_pair_ge3 {d d2 : Nat} {ds2 : List Nat} (h : GoodDs (d :: d2 :: ds2) = + true) : d ≥ 3 := by + cases ds2 with + | nil => + dsimp [GoodDs, GoodDsAux, GoodDs2] at h + by_cases h1 : d2 = 0 + · simp [h1] at h; omega + · by_cases h2 : d2 = 1 + · simp [h2] at h; omega + · by_cases h3 : d2 ≥ 3 + · simp [h1, h2, h3] at h; omega + · simp [h1, h2, h3] at h + | cons d3 ds3 => + by_contra hd + have hd17 : decide (d < 17) = true := decide_eq_true (by omega) + dsimp [GoodDs, GoodDsAux] at h + rw [hd17, Bool.true_or] at h + split_ifs at h; simp_all + +theorem GoodDs_second_zero_ge8 {d : Nat} {ds2 : List Nat} (h : GoodDs (d :: 0 :: ds2) = + true) : d ≥ 8 := by + cases ds2 with + | nil => + dsimp [GoodDs, GoodDsAux, GoodDs2] at h + simp_all + | cons d3 ds3 => + dsimp [GoodDs, GoodDsAux] at h + cases h + +theorem step_ModeE_p3z1_after_sweep (ls' : List LTok) (b : Nat) (ds : List Nat) : + (((evalL ls' <+ [1, 1, 0]) {{D}}> ([0] +> (O ^ (b + 2) +> evalR ds)))) [target_tm]⊢⁺ + toCfg (nextModeE_p3z1 ls' b ds) := by + induction ls' generalizing b ds with + | nil => + dsimp only [nextModeE_p3z1, toCfg, evalL] + have hl : (default : ListBlank (Fin 2)) <+ [1, 1, 0] = default <+ [1, 1, 0, 0, 0] := by + have h0 : (default : ListBlank (Fin 2)) = default <+ [0, 0] := by + calc (default : ListBlank (Fin 2)) = default <+ [0] := zero_cons_default.symm + _ = (default <+ [0]) <+ [0] := congrArg (· <+ [0]) zero_cons_default.symm + _ = default <+ [0, 0] := rfl + exact congrArg (· <+ [1, 1, 0]) h0 + rw [hl] + have hr' : [0] +> (O ^ (b + 2) +> evalR ds) = [0, 1] +> (O ^ (b + 1) +> evalR ds) := by + have hb : b + 2 = 1 + (b + 1) := by omega + rw [hb, pow_add_append_right O 1 (b + 1)]; rfl + rw [hr'] + exact step_D_0011 default (O ^ (b + 1) +> evalR ds) + | cons tok ls'' ih => + cases tok with + | p3z m' => + cases m' with + | zero => + dsimp only [nextModeE_p3z1, toCfg, evalL] + have hl : ((evalL ls'' <+ [1, 1, 0]) <+ Z ^ 0) <+ [1, 1, 0] = + (evalL ls'' <+ [0, 1, 1, 0]) <+ O ^ 2 := rfl + rw [hl] + have h1 := merge_011 1 (evalL ls'') (O ^ (b + 2) +> evalR ds) + have hr' : [0, 1] +> (O ^ (b + 2) +> evalR ds) = [0] +> (O ^ (b + 3) +> evalR ds) := by + rw [pow_succ_append_right O (b + 2)]; rfl + rw [hr'] at h1 + exact h1 + | succ m1 => + cases m1 with + | zero => + dsimp only [nextModeE_p3z1, evalL] + have hl : ((evalL ls'' <+ [1, 1, 0]) <+ Z ^ 1) <+ [1, 1, 0] = + (evalL ls'' <+ [1, 1, 0]) <+ [1, 1, 0, 0] := rfl + rw [hl] + have hr' : [0] +> (O ^ (b + 2) +> evalR ds) = [0, 1] +> (O ^ (b + 1) +> evalR ds) := by + have hb : b + 2 = 1 + (b + 1) := by omega + rw [hb, pow_add_append_right O 1 (b + 1)]; rfl + rw [hr'] + have h1 := step_D_p3z1_pop (evalL ls'' <+ [1, 1, 0]) (O ^ (b + 1) +> evalR ds) + have hr2 : [0, 1, 1, 0, 1, 1] +> (O ^ (b + 1) +> evalR ds) = + [0] +> (O ^ (0 + 2) +> evalR ((b + 1) :: ds)) := by + dsimp only [evalR] + have hb : b + 1 + 2 = 2 + (b + 1) := by omega + rw [hb, pow_add_append_right O 2 (b + 1)]; rfl + rw [hr2] at h1 + exact stepPlus_trans h1 (ih 0 ((b + 1) :: ds)) + | succ m2 => + dsimp only [nextModeE_p3z1, toCfg, evalL] + have hl : ((evalL ls'' <+ [1, 1, 0]) <+ Z ^ (m2 + 2)) <+ [1, 1, 0] = + ((evalL ls'' <+ [1, 1, 0]) <+ Z ^ m2) <+ [1, 1, 0, 0, 0] := by + rw [pow_add_append_left (evalL ls'' <+ [1, 1, 0]) Z m2 2]; rfl + rw [hl] + have hr' : [0] +> (O ^ (b + 2) +> evalR ds) = [0, 1] +> (O ^ (b + 1) +> evalR ds) := by + have hb : b + 2 = 1 + (b + 1) := by omega + rw [hb, pow_add_append_right O 1 (b + 1)]; rfl + rw [hr'] + exact step_D_0011 ((evalL ls'' <+ [1, 1, 0]) <+ Z ^ m2) (O ^ (b + 1) +> evalR ds) + | p5 => + dsimp only [nextModeE_p3z1, toCfg, evalL] + have hl : (evalL ls'' <+ [1, 0, 1, 1, 0]) <+ [1, 1, 0] = + (evalL ls'' <+ [0, 1, 0, 1, 1, 0]) <+ O ^ 2 := rfl + rw [hl] + have h1 := merge_p5 1 (evalL ls'') (O ^ (b + 2) +> evalR ds) + have hr' : [0, 1, 1] +> (O ^ (b + 2) +> evalR ds) = [0] +> (O ^ (b + 4) +> evalR ds) := by + have hb : b + 4 = 2 + (b + 2) := by omega + rw [hb, pow_add_append_right O 2 (b + 2)]; rfl + rw [hr'] at h1 + exact h1 + +theorem step_toCfg (s : ModeState) (hinv : Inv s) : + (toCfg s) [target_tm]⊢⁺ toCfg (nextState s) := by + cases s with + | ModeE_c1 ls k ds => + cases ls with + | nil => + dsimp only [nextState, toCfg, evalL] + have hl : (default : ListBlank (Fin 2)) <+ [0] = default <+ [0, 0, 0] := by + calc (default : ListBlank (Fin 2)) <+ [0] = default := zero_cons_default + _ = default <+ [0] := zero_cons_default.symm + _ = (default <+ [0]) <+ [0] := congrArg (· <+ [0]) zero_cons_default.symm + _ = ((default <+ [0]) <+ [0]) <+ [0] := + congrArg (fun x => (x <+ [0]) <+ [0]) zero_cons_default.symm + _ = default <+ [0, 0, 0] := rfl + rw [hl] + have h1 := left_sweep_to_B (k0Of k + 3) default ([1] +> evalR ds) + have hm : m0Of k + 5 = k0Of k + 5 := by cases k <;> rfl + rw [hm] + exact h1 + | cons tok ls' => + cases tok with + | p3z m => + cases m with + | zero => + dsimp only [nextState, toCfg, evalL] + exact merge_011 (k0Of k + 3) (evalL ls') ([1] +> evalR ds) + | succ m1 => + cases m1 with + | zero => + dsimp only [nextState, toCfg, evalL] + have hl : (((evalL ls' <+ [1, 1, 0]) <+ Z ^ 1) <+ [0]) = + (evalL ls' <+ [1, 1, 0]) <+ [0, 0] := rfl + rw [hl] + have h1 := left_sweep_to_hub (k0Of k + 3) (evalL ls' <+ [1, 1, 0]) ([1] +> evalR ds) + exact stepPlus_trans h1 (step_ModeE_p3z1_after_sweep ls' (k0Of k + 2) (0 :: ds)) + | succ m2 => + dsimp only [nextState, toCfg, evalL] + have hl : (((evalL ls' <+ [1, 1, 0]) <+ Z ^ (m2 + 2)) <+ [0]) = + ((evalL ls' <+ [1, 1, 0]) <+ Z ^ m2) <+ [0, 0, 0] := by + rw [pow_add_append_left (evalL ls' <+ [1, 1, 0]) Z m2 2]; rfl + rw [hl] + have h1 := + left_sweep_to_B (k0Of k + 3) ((evalL ls' <+ [1, 1, 0]) <+ Z ^ m2) ([1] +> evalR ds) + have hm : m0Of k + 5 = k0Of k + 5 := by cases k <;> rfl + rw [hm] + exact h1 + | p5 => + dsimp only [nextState, toCfg, evalL] + exact merge_p5 (k0Of k + 3) (evalL ls') ([1] +> evalR ds) + | ModeE_ge2 ls k c ds => + cases ls with + | nil => + dsimp only [nextState, toCfg, evalL] + have hl : (default : ListBlank (Fin 2)) <+ [0] = default <+ [0, 0, 0] := by + calc (default : ListBlank (Fin 2)) <+ [0] = default := zero_cons_default + _ = default <+ [0] := zero_cons_default.symm + _ = (default <+ [0]) <+ [0] := congrArg (· <+ [0]) zero_cons_default.symm + _ = ((default <+ [0]) <+ [0]) <+ [0] := + congrArg (fun x => (x <+ [0]) <+ [0]) zero_cons_default.symm + _ = default <+ [0, 0, 0] := rfl + rw [hl] + have h1 := left_sweep_to_B (k + 3) default (O ^ (c + 2) +> evalR ds) + have hr : [0, 1] +> (O ^ (c + 2) +> evalR ds) = [0] +> (O ^ (c + 3) +> evalR ds) := by + rw [pow_succ_append_right O (c + 2)]; rfl + rw [hr] at h1 + exact h1 + | cons tok ls' => + cases tok with + | p3z m => + cases m with + | zero => + dsimp only [nextState, toCfg, evalL] + have h1 := merge_011 (k + 3) (evalL ls') (O ^ (c + 2) +> evalR ds) + have hr : [0, 1] +> (O ^ (c + 2) +> evalR ds) = [0] +> (O ^ (c + 3) +> evalR ds) := by + rw [pow_succ_append_right O (c + 2)]; rfl + rw [hr] at h1 + exact h1 + | succ m1 => + cases m1 with + | zero => + dsimp only [nextState, toCfg, evalL] + have hl : (((evalL ls' <+ [1, 1, 0]) <+ Z ^ 1) <+ [0]) = + (evalL ls' <+ [1, 1, 0]) <+ [0, 0] := rfl + rw [hl] + have h1 := left_sweep_to_hub (k + 3) (evalL ls' <+ [1, 1, 0]) (O ^ (c + 2) +> evalR ds) + have hr : [0, 1] +> (O ^ (c + 2) +> evalR ds) = evalR ((c + 1) :: ds) := by + dsimp only [evalR]; rw [pow_succ_append_right O (c + 2)]; rfl + rw [hr] at h1 + exact stepPlus_trans h1 (step_ModeE_p3z1_after_sweep ls' (k + 2) ((c + 1) :: ds)) + | succ m2 => + dsimp only [nextState, toCfg, evalL] + have hl : (((evalL ls' <+ [1, 1, 0]) <+ Z ^ (m2 + 2)) <+ [0]) = + ((evalL ls' <+ [1, 1, 0]) <+ Z ^ m2) <+ [0, 0, 0] := by + rw [pow_add_append_left (evalL ls' <+ [1, 1, 0]) Z m2 2]; rfl + rw [hl] + have h1 := + left_sweep_to_B (k + 3) ((evalL ls' <+ [1, 1, 0]) <+ Z ^ m2) (O ^ (c + 2) +> evalR ds) + have hr : [0, 1] +> (O ^ (c + 2) +> evalR ds) = [0] +> (O ^ (c + 3) +> evalR ds) := by + rw [pow_succ_append_right O (c + 2)]; rfl + rw [hr] at h1 + exact h1 + | p5 => + dsimp only [nextState, toCfg, evalL] + have h1 := merge_p5 (k + 3) (evalL ls') (O ^ (c + 2) +> evalR ds) + have hr : [0, 1, 1] +> (O ^ (c + 2) +> evalR ds) = [0] +> (O ^ (c + 4) +> evalR ds) := by + have hc : c + 4 = 2 + (c + 2) := by omega + rw [hc, pow_add_append_right O 2 (c + 2)]; rfl + rw [hr] at h1 + exact h1 + | ModeB_ge3 ls a c ds => + dsimp only [toCfg] + have hr : [0] +> (O ^ (c + 3) +> evalR ds) = [0, 1] +> ([1] +> (O ^ (c + 1) +> evalR ds)) := by + have hc : c + 3 = 2 + (c + 1) := by omega + rw [hc, pow_add_append_right O 2 (c + 1)]; rfl + rw [hr] + have h1 := sweep_R a (evalL ls) ([1] +> (O ^ (c + 1) +> evalR ds)) + have h2 := thm_A_0 ((evalL ls <+ [1, 1, 0]) <+ Z ^ a) (O ^ (c + 1) +> evalR ds) + have h12 := stepPlus_trans h1 h2 + cases c with + | zero => + dsimp only [nextState, toCfg, evalL, k0Of] + exact h12 + | succ c' => + dsimp only [nextState, toCfg, evalL] + exact h12 + | ModeB_b2 ls m ds => + have hgd : GoodDs ds = true := by + have hc := hinv.1 + dsimp [invCore] at hc + cases h : GoodDs ds + · simp [h] at hc + · rfl + cases m with + | zero => + dsimp only [nextState, toCfg, m0Of, k0Of] + exact bridge_b2_m0 (evalL ls) (evalR ds) + | succ m' => + dsimp only [toCfg, m0Of] + have h1 := sweep_R (m' + 2) (evalL ls) ([1] +> evalR ds) + have hl : (evalL ls <+ [1, 1, 0]) <+ Z ^ (m' + 2) = + ((evalL ls <+ [1, 1, 0]) <+ Z ^ m') <+ [0, 0] := by + rw [pow_add_append_left (evalL ls <+ [1, 1, 0]) Z m' 2]; rfl + rw [hl] at h1 + have h2 := bridge_b2_tail ((evalL ls <+ [1, 1, 0]) <+ Z ^ m') (evalR ds) + have h12 := stepPlus_trans h1 h2 + let l_base := (evalL ls <+ [1, 1, 0]) <+ Z ^ m' + cases ds with + | nil => + dsimp only [nextState, toCfg, evalL, evalR] at h12 ⊢ + exact stepPlus_trans h12 (bridge_b5a l_base) + | cons d' ds' => + dsimp only [evalR] at h12 + have h3 := bridge_b5b_pre l_base (O ^ (d' + 2) +> evalR ds') + have h123 := stepPlus_trans h12 h3 + cases d' with + | zero => + cases ds' with + | nil => + dsimp only [nextState, toCfg, evalL, evalR] at h123 ⊢ + exact stepPlus_trans h123 (bridge_b5b_d0_blank l_base) + | cons d2 ds'' => + have := GoodDs_pair_ge3 hgd; omega + | succ d1 => + cases d1 with + | zero => + cases ds' with + | nil => + dsimp only [nextState, toCfg, evalL, evalR] at h123 ⊢ + exact stepPlus_trans h123 (bridge_b5b_d1_blank l_base) + | cons d2 ds'' => + have := GoodDs_pair_ge3 hgd; omega + | succ d2_idx => + cases d2_idx with + | zero => + cases ds' with + | nil => + dsimp only [nextState, toCfg, evalL, evalR] at h123 ⊢ + exact stepPlus_trans h123 (bridge_b5b_d2_blank l_base) + | cons d2 ds'' => + have := GoodDs_pair_ge3 hgd; omega + | succ m'' => + cases ds' with + | nil => + dsimp only [nextState, toCfg, evalL, evalR] at h123 ⊢ + exact h123 + | cons d_next ds'' => + cases d_next with + | zero => + cases m'' with + | zero => + have := GoodDs_second_zero_ge8 hgd; omega + | succ m3 => + cases m3 with + | zero => + have := GoodDs_second_zero_ge8 hgd; omega + | succ m4 => + dsimp only [nextState, toCfg, evalL, evalR, m0Of] at h123 ⊢ + exact h123 + | succ c' => + dsimp only [nextState, toCfg, evalL, evalR] at h123 ⊢ + exact h123 + | ModeB_blank ls a => + have ha5 : a ≥ 5 := by + have hc := hinv.1 + dsimp [invCore] at hc + simp only [Bool.and_eq_true, decide_eq_true_eq] at hc + exact hc.1.1 + dsimp only [toCfg] + have h1 := sweep_blank_R (a + 1) (evalL ls) + cases a with + | zero => omega + | succ a1 => + cases a1 with + | zero => omega + | succ a'' => + dsimp only [nextState, toCfg, evalL, evalR] + have hl : (evalL ls <+ [1, 1, 0]) <+ Z ^ (a'' + 3) = + ((evalL ls <+ [1, 1, 0]) <+ Z ^ a'') <+ [0, 0, 0] := by + rw [pow_add_append_left (evalL ls <+ [1, 1, 0]) Z a'' 3]; rfl + rw [hl] at h1 + exact stepPlus_trans h1 (bridge_blank_apos_tail ((evalL ls <+ [1, 1, 0]) <+ Z ^ a'')) + +theorem z0_z0Rep (n : Nat) (rest : List LTok) : z0 (z0Rep n rest) = n + z0 rest := by + induction n with + | zero => simp [z0Rep] + | succ n ih => change 1 + z0 (z0Rep n rest) = n + 1 + z0 rest; omega + +theorem ep_z0Rep (n : Nat) (rest : List LTok) : ep (z0Rep n rest) = n + ep rest := by + induction n with + | zero => simp [z0Rep] + | succ n ih => dsimp [z0Rep, ep]; omega + +theorem hasOdd_p3z_add2 (m : Nat) (ls : List LTok) : + hasOdd (.p3z (m + 2) :: ls) = hasOdd (.p3z m :: ls) := by + dsimp [hasOdd] + have h : (m + 2) % 2 = m % 2 := by omega + rw [h] + +theorem ep_p3z_add2 (m : Nat) (ls : List LTok) : + ep (.p3z (m + 2) :: ls) = ep (.p3z m :: ls) := by + dsimp [ep] + have h : (m + 2) % 2 = m % 2 := by omega + rw [h] + +theorem epW_p3z_add2 (m : Nat) (ls : List LTok) : + epW (.p3z (m + 2) :: ls) = epW (.p3z m :: ls) := by + dsimp [epW] + have h : (m + 2) % 2 = m % 2 := by omega + rw [h] + +theorem decide_eq_of_iff {P Q : Prop} [Decidable P] [Decidable Q] (h : P ↔ Q) : + decide P = decide Q := by + by_cases hp : P + · rw [decide_eq_true hp, decide_eq_true (h.mp hp)] + · rw [decide_eq_false hp, decide_eq_false (fun hq => hp (h.mpr hq))] + +theorem GoodPhiW_mono (phiW : Nat) (ds : List Nat) (b : Bool) (h : GoodPhiW phiW ds false = true) : + GoodPhiW phiW ds b = true := by + dsimp [GoodPhiW] at h ⊢ + split_ifs at h ⊢ <;> simp_all + +theorem prefSumW_p3z_add2 (m : Nat) (ls : List LTok) (hm : m % 2 = 0) (hnp5 : isHeadP5 ls = false) : + prefSumW (.p3z (m + 2) :: ls) = prefSumW (.p3z m :: ls) + 2 := by + have hm1 : ¬((m + 2) % 2 = 1) := by omega + have hm2 : ¬(m % 2 = 1) := by omega + cases ls with + | nil => dsimp [prefSumW]; rw [if_neg hm1, if_neg hm2] + | cons t s => + cases t with + | p5 => cases hnp5 + | p3z _ => dsimp [prefSumW]; rw [if_neg hm1, if_neg hm2]; omega + +theorem epSum_p3z_add2 (m : Nat) (ls : List LTok) : + epSum (.p3z (m + 2) :: ls) = epSum (.p3z m :: ls) + 2 := by + dsimp [epSum] + by_cases hm : m % 2 = 1 + · have hm' : (m + 2) % 2 = 1 := by omega + rw [if_pos hm', if_pos hm]; omega + · have hm' : ¬((m + 2) % 2 = 1) := by omega + rw [if_neg hm', if_neg hm]; omega + +theorem MustDrain_p3z_add2 (m : Nat) (ls : List LTok) : + MustDrain (.p3z (m + 2) :: ls) = MustDrain (.p3z m :: ls) := by + dsimp [MustDrain] + have h : (m + 2) % 2 = m % 2 := by omega + rw [h] + +theorem ValidEvenLs_p3z_add2 (m : Nat) (ls : List LTok) : + ValidEvenLs (.p3z (m + 2) :: ls) = ValidEvenLs (.p3z m :: ls) := by + dsimp [ValidEvenLs] + have h : (m + 2) % 2 = m % 2 := by omega + rw [h] + +theorem preP5Val_p3z_add2_of_not_headP5 (m : Nat) (ls : List LTok) (h : isHeadP5 ls = false) : + preP5Val (.p3z (m + 2) :: ls) = preP5Val (.p3z m :: ls) := by + cases ls with + | nil => rfl + | cons t s => cases t with | p5 => cases h | p3z _ => rfl + +theorem not_isHeadP5_of_MustDrain_p3z (m : Nat) (ls : List LTok) (h : MustDrain (.p3z m :: ls) = + true) : + isHeadP5 ls = false := by + cases ls with + | nil => rfl + | cons t s => + cases t with + | p3z _ => rfl + | p5 => + dsimp [MustDrain] at h + split_ifs at h + +theorem hasOdd_p3z_even_cons (k : Nat) (ls : List LTok) (hk : k % 2 = 0) : + hasOdd (.p3z k :: ls) = hasOdd ls := by + have hk1 : ¬(k % 2 = 1) := by omega + dsimp [hasOdd]; rw [if_neg hk1] + +theorem ep_p3z_even_cons (k : Nat) (ls : List LTok) (hk : k % 2 = 0) : + ep (.p3z k :: ls) = 1 + ep ls := by + have hk1 : ¬(k % 2 = 1) := by omega + dsimp [ep]; rw [if_neg hk1] + +theorem epW_p3z_even_cons (k : Nat) (ls : List LTok) (hk : k % 2 = 0) (hnp5 : isHeadP5 ls = false) : + epW (.p3z k :: ls) = 1 + epW ls := by + have hk1 : ¬(k % 2 = 1) := by omega + dsimp [epW]; rw [if_neg hk1] + cases ls with + | nil => rfl + | cons t s => cases t with | p5 => cases hnp5 | p3z _ => rfl + +theorem prefSumW_p3z_even_cons (k : Nat) (ls : List LTok) (hk : k % 2 = 0) (hnp5 : isHeadP5 ls = + false) : + prefSumW (.p3z k :: ls) = k + prefSumW ls := by + have hk1 : ¬(k % 2 = 1) := by omega + dsimp [prefSumW]; rw [if_neg hk1] + cases ls with + | nil => rfl + | cons t s => cases t with | p5 => cases hnp5 | p3z _ => rfl + +theorem epSum_p3z_even_cons (k : Nat) (ls : List LTok) (hk : k % 2 = 0) : + epSum (.p3z k :: ls) = k + epSum ls := by + have hk1 : ¬(k % 2 = 1) := by omega + dsimp [epSum]; rw [if_neg hk1] + +theorem MustDrain_p3z_even_cons (k : Nat) (ls : List LTok) (hk : k % 2 = 0) : + MustDrain (.p3z k :: ls) = MustDrain ls := by + have hk1 : ¬(k % 2 = 1) := by omega + dsimp [MustDrain]; rw [if_neg hk1] + +theorem ValidEvenLs_p3z_even_cons (k : Nat) (ls : List LTok) (hk : k % 2 = 0) : + ValidEvenLs (.p3z k :: ls) = ValidEvenLs ls := by + dsimp [ValidEvenLs]; rw [if_pos hk] + +theorem preP5Val_p3z_cons_of_not_headP5 (k : Nat) (ls : List LTok) (h : isHeadP5 ls = false) : + preP5Val (.p3z k :: ls) = preP5Val ls := by + cases ls with + | nil => rfl + | cons t s => cases t with | p5 => cases h | p3z _ => rfl + +theorem epSum_z0Rep (n : Nat) (rest : List LTok) : epSum (z0Rep n rest) = epSum rest := by + induction n with + | zero => rfl + | succ n ih => dsimp [z0Rep, epSum]; omega + +theorem hasOdd_z0Rep (n : Nat) (rest : List LTok) : hasOdd (z0Rep n rest) = hasOdd rest := by + induction n with + | zero => rfl + | succ n ih => exact ih + +theorem hasP5_z0Rep (n : Nat) (rest : List LTok) : hasP5 (z0Rep n rest) = hasP5 rest := by + induction n with + | zero => rfl + | succ n ih => exact ih + +theorem MustDrain_z0Rep (n : Nat) (rest : List LTok) : MustDrain (z0Rep n rest) = MustDrain rest := + by + induction n with + | zero => rfl + | succ n ih => exact ih + +theorem p5Suf_z0Rep (n : Nat) (rest : List LTok) : p5Suf (z0Rep n rest) = p5Suf rest := by + induction n with + | zero => rfl + | succ n ih => exact ih + +theorem ValidP5Chain_z0Rep (n : Nat) (rest : List LTok) : + ValidP5Chain (z0Rep n rest) = ValidP5Chain rest := by + induction n with + | zero => rfl + | succ n ih => exact ih + +theorem z0Rep_succ_right (n : Nat) (rest : List LTok) : + z0Rep n (.p3z 0 :: rest) = z0Rep (n + 1) rest := by + induction n with + | zero => rfl + | succ n ih => + calc z0Rep (n + 1) (.p3z 0 :: rest) = .p3z 0 :: z0Rep n (.p3z 0 :: rest) := rfl + _ = .p3z 0 :: z0Rep (n + 1) rest := by rw [ih] + _ = z0Rep (n + 2) rest := rfl + +theorem epSum_even (ls : List LTok) : epSum ls % 2 = 0 := by + induction ls with + | nil => rfl + | cons tok rest ih => + cases tok with + | p5 => rfl + | p3z m => + dsimp [epSum] + split_ifs with h <;> omega + +theorem ValidP5Chain_imp_ValidEvenLs (ls : List LTok) (h : ValidP5Chain ls = true) : + ValidEvenLs ls = true := by + induction ls with + | nil => rfl + | cons tok rest ih => + cases tok with + | p5 => exact h + | p3z m => + cases m with + | zero => + dsimp [ValidP5Chain] at h + dsimp [ValidEvenLs] + exact ih h + | succ m' => + cases rest with + | nil => cases h + | cons tok2 suf => + cases tok2 with + | p3z _ => cases h + | p5 => + dsimp [ValidP5Chain] at h + dsimp [ValidEvenLs] + split_ifs with hm + · exact h + · exact h + +theorem ls_eq_z0Rep_of_prefSumW_zero (ls : List LTok) + (heven : ValidEvenLs ls = true) + (hpref : prefSumW ls = 0) + (hmd : MustDrain ls = false) + (hnp5 : isHeadP5 ls = false) : + ls = (if hasP5 ls then + z0Rep (epW ls) (.p3z (epSum ls + (if hasOdd ls then 1 else 0)) :: .p5 :: p5Suf ls) + else + z0Rep (epW ls) []) ∧ + (hasP5 ls = false → hasOdd ls = false) := by + induction ls with + | nil => simp [z0Rep, epW, hasP5, hasOdd] + | cons tok rest ih => + cases tok with + | p5 => cases hnp5 + | p3z m => + by_cases hm : m % 2 = 1 + · have hrest : ∃ suf, rest = .p5 :: suf := by + dsimp [MustDrain] at hmd + rw [if_pos hm] at hmd + cases rest with + | nil => cases hmd + | cons t2 s2 => + cases t2 with + | p3z _ => cases hmd + | p5 => exact ⟨s2, rfl⟩ + obtain ⟨suf, rfl⟩ := hrest + refine ⟨?_, ?_⟩ + · dsimp [hasP5, epW, epSum, hasOdd, p5Suf, z0Rep] + simp only [hm, ↓reduceIte] + congr 2; omega + · intro h_abs; cases h_abs + · have hm0 : m % 2 = 0 := by omega + cases h_rest : rest with + | nil => + subst h_rest + dsimp [prefSumW] at hpref + rw [if_neg hm] at hpref + have hm_z : m = 0 := by omega + subst hm_z + simp [hasP5, epW, hasOdd, z0Rep] + | cons t2 s2 => + cases t2 with + | p5 => + subst h_rest + refine ⟨?_, ?_⟩ + · dsimp [hasP5, epW, epSum, hasOdd, p5Suf, z0Rep] + simp [hm, z0Rep] + · intro h_abs; cases h_abs + | p3z m2 => + subst h_rest + have hpref_unfold : prefSumW (.p3z m :: .p3z m2 :: s2) = m + prefSumW (.p3z m2 :: s2) := + by + dsimp only [prefSumW] + rw [if_neg hm] + rw [hpref_unfold] at hpref + have hm_zero : m = 0 := by omega + have hpref' : prefSumW (.p3z m2 :: s2) = 0 := by omega + subst hm_zero + dsimp [ValidEvenLs] at heven + dsimp [MustDrain] at hmd + obtain ⟨ih1, ih2⟩ := ih heven hpref' hmd rfl + refine ⟨?_, ?_⟩ + · have hepw : epW (.p3z 0 :: .p3z m2 :: s2) = epW (.p3z m2 :: s2) + 1 := by + rw [epW_p3z_even_cons 0 _ rfl rfl]; omega + have hepsum : epSum (.p3z 0 :: .p3z m2 :: s2) = epSum (.p3z m2 :: s2) := by + rw [epSum_p3z_even_cons 0 _ rfl, Nat.zero_add] + have hodd : hasOdd (.p3z 0 :: .p3z m2 :: s2) = hasOdd (.p3z m2 :: s2) := + hasOdd_p3z_even_cons 0 _ rfl + have hp5_eq : hasP5 (.p3z 0 :: .p3z m2 :: s2) = hasP5 (.p3z m2 :: s2) := rfl + have hsuf_eq : p5Suf (.p3z 0 :: .p3z m2 :: s2) = p5Suf (.p3z m2 :: s2) := rfl + rw [hepw, hepsum, hodd, hp5_eq, hsuf_eq] + have h_cons := congrArg (LTok.p3z 0 :: ·) ih1 + exact h_cons.trans (by cases hasP5 (.p3z m2 :: s2) <;> rfl) + · exact ih2 + +theorem checkChainAux_false_p3z0 (fuel : Nat) (ls : List LTok) (c k m_dummy : Nat) (ds : List Nat) : + checkChainAux fuel false (.p3z 0 :: ls) c k m_dummy ds = + checkChainAux fuel false ls (c + 1) (k + 2) m_dummy ds := by + cases fuel with + | zero => rfl + | succ fuel => + have hz : c + z0 (.p3z 0 :: ls) = c + 1 + z0 ls := by + change c + (1 + z0 ls) = c + 1 + z0 ls; omega + have hk : k + 2 * z0 (.p3z 0 :: ls) = k + 2 + 2 * z0 ls := by + change k + 2 * (1 + z0 ls) = k + 2 + 2 * z0 ls; omega + have hd : dropZ0 (.p3z 0 :: ls) = dropZ0 ls := rfl + dsimp only [checkChainAux] + rw [hz, hk, hd] + +theorem checkChainAux_true_congr (fuel : Nat) (ls1 ls2 : List LTok) + (cp1_1 kb_1 margin_1 cp1_2 kb_2 margin_2 : Nat) (ds : List Nat) + (hnp1 : isHeadP5 ls1 = false) + (hnp2 : isHeadP5 ls2 = false) + (hodd : hasOdd ls1 = hasOdd ls2) + (hdec : decide (margin_1 ≥ kb_1 + epSum ls1) = decide (margin_2 ≥ kb_2 + epSum ls2)) + (hep : cp1_1 + ep ls1 = cp1_2 + ep ls2) + (hxi : margin_1 ≥ kb_1 + epSum ls1 → + kb_1 + epSum ls1 + 2 * ep ls1 = kb_2 + epSum ls2 + 2 * ep ls2) + (hsuf : p5Suf ls1 = p5Suf ls2) + (hmd : MustDrain ls1 = MustDrain ls2) + (hp5 : hasP5 ls1 = hasP5 ls2) + (hm2 : MustDrain ls1 = true → preP5Val ls1 = preP5Val ls2) + (hepw : cp1_1 + epW ls1 = cp1_2 + epW ls2) + (hrem : ¬(margin_1 ≥ kb_1 + epSum ls1) → + kb_1 + epSum ls1 + (if hasOdd ls1 then 1 else 0) - (margin_1 + 2) = + kb_2 + epSum ls2 + (if hasOdd ls2 then 1 else 0) - (margin_2 + 2)) : + checkChainAux fuel true ls1 cp1_1 kb_1 margin_1 ds = + checkChainAux fuel true ls2 cp1_2 kb_2 margin_2 ds := by + cases fuel with + | zero => rfl + | succ fuel => + dsimp only [checkChainAux] + rw [hnp1, hnp2, Bool.false_or, Bool.false_or] + by_cases hge1 : margin_1 ≥ kb_1 + epSum ls1 + · have hdec1 : decide (margin_1 ≥ kb_1 + epSum ls1) = true := decide_eq_true hge1 + have hdec2 : decide (margin_2 ≥ kb_2 + epSum ls2) = true := hdec.symm.trans hdec1 + have hxi' := hxi hge1 + cases ho : hasOdd ls1 + · have ho2 : hasOdd ls2 = false := hodd.symm.trans ho + cases hp : hasP5 ls1 + · have hp2 : hasP5 ls2 = false := hp5.symm.trans hp + simp only [hdec1, hdec2, ho2, hp2, hepw, Bool.and_true, Bool.and_false, + Bool.not_false, Bool.false_eq_true, ↓reduceIte] + · have hp2 : hasP5 ls2 = true := hp5.symm.trans hp + simp only [hdec1, hdec2, ho2, hp2, hsuf, hep, hxi', Bool.and_true, + Bool.not_false, Bool.false_eq_true, ↓reduceIte] + · have ho2 : hasOdd ls2 = true := hodd.symm.trans ho + cases hm : MustDrain ls1 + · have hm2_eq : MustDrain ls2 = false := hmd.symm.trans hm + simp only [hdec1, hdec2, ho2, hm2_eq, hp5, hsuf, hep, hxi', Bool.and_true, + Bool.not_false, ↓reduceIte] + · have hm2_eq : MustDrain ls2 = true := hmd.symm.trans hm + have hpre := hm2 hm + simp only [hdec1, hdec2, ho2, hm2_eq, hp5, hpre, hsuf, hep, hxi', Bool.and_true, + Bool.not_true, Bool.false_eq_true, ↓reduceIte] + · have hdec1 : decide (margin_1 ≥ kb_1 + epSum ls1) = false := decide_eq_false hge1 + have hdec2 : decide (margin_2 ≥ kb_2 + epSum ls2) = false := hdec.symm.trans hdec1 + have hrem' := hrem hge1 + rw [hrem'] + simp only [hdec1, hdec2, hodd, hepw, hp5, hsuf, Bool.and_false, Bool.false_eq_true, + ↓reduceIte] + +theorem checkChainAux_true_no_odd_no_p5 (fuel : Nat) (ls1 ls2 : List LTok) + (cp1_1 kb_1 margin_1 cp1_2 kb_2 margin_2 : Nat) (ds : List Nat) + (ho1 : hasOdd ls1 = false) (ho2 : hasOdd ls2 = false) + (hp1 : hasP5 ls1 = false) (hp2 : hasP5 ls2 = false) + (hepw : cp1_1 + epW ls1 = cp1_2 + epW ls2) : + checkChainAux fuel true ls1 cp1_1 kb_1 margin_1 ds = + checkChainAux fuel true ls2 cp1_2 kb_2 margin_2 ds := by + cases fuel with + | zero => rfl + | succ fuel => + dsimp only [checkChainAux] + simp only [ho1, ho2, hp1, hp2, hepw, Bool.false_and, Bool.and_false, Bool.not_false, + Bool.false_eq_true, ↓reduceIte] + +theorem checkChainAux_true_p3z0 (fuel : Nat) (ls : List LTok) (cp1 kb margin : Nat) (ds : List Nat) + (h : isHeadP5 ls = false ∨ margin ≥ kb + epSum ls) : + checkChainAux fuel true (.p3z 0 :: ls) cp1 kb margin ds = + checkChainAux fuel true ls (cp1 + 1) (kb + 2) (margin + 2) ds := by + cases hp5 : isHeadP5 ls with + | false => + apply checkChainAux_true_congr fuel (.p3z 0 :: ls) ls cp1 kb margin (cp1 + 1) (kb + 2) (margin + + 2) ds + rfl hp5 + · exact hasOdd_p3z_even_cons 0 ls rfl + · rw [epSum_p3z_even_cons 0 ls rfl, Nat.zero_add]; exact decide_eq_of_iff (by omega) + · rw [ep_p3z_even_cons 0 ls rfl]; omega + · intro _; rw [epSum_p3z_even_cons 0 ls rfl, ep_p3z_even_cons 0 ls rfl]; omega + · rfl + · exact MustDrain_p3z_even_cons 0 ls rfl + · rfl + · intro _; exact preP5Val_p3z_cons_of_not_headP5 0 ls hp5 + · rw [epW_p3z_even_cons 0 ls rfl hp5]; omega + · intro _; rw [epSum_p3z_even_cons 0 ls rfl, hasOdd_p3z_even_cons 0 ls rfl]; omega + | true => + have hge : margin ≥ kb + epSum ls := by + cases h with + | inl h1 => rw [hp5] at h1; cases h1 + | inr h2 => exact h2 + cases ls with + | nil => cases hp5 + | cons tok suf => + cases tok with + | p3z _ => cases hp5 + | p5 => + dsimp [epSum] at hge + cases fuel with + | zero => rfl + | succ fuel => + have hl : checkChainAux (fuel + 1) true (.p3z 0 :: .p5 :: suf) cp1 kb margin ds = + checkChainAux fuel false suf (cp1 + 2) (kb + 5) 0 ds := by + have hdec : decide (margin ≥ kb + 0) = true := decide_eq_true (by omega) + dsimp only [checkChainAux] + have ho : hasOdd (.p3z 0 :: .p5 :: suf) = false := rfl + have hs : epSum (.p3z 0 :: .p5 :: suf) = 0 := rfl + have hp : hasP5 (.p3z 0 :: .p5 :: suf) = true := rfl + have hnp : isHeadP5 (.p3z 0 :: .p5 :: suf) = false := rfl + have hep : ep (.p3z 0 :: .p5 :: suf) = 1 := rfl + have hsuf : p5Suf (.p3z 0 :: .p5 :: suf) = suf := rfl + rw [ho, hs, hp, hnp, hep, hsuf, hdec] + rfl + have hr : checkChainAux (fuel + 1) true (.p5 :: suf) (cp1 + 1) (kb + 2) (margin + 2) ds = + checkChainAux fuel false suf (cp1 + 2) (kb + 5) 0 ds := by + dsimp only [checkChainAux] + have ho : hasOdd (.p5 :: suf) = false := rfl + have hp : hasP5 (.p5 :: suf) = true := rfl + have hip : isHeadP5 (.p5 :: suf) = true := rfl + have hep : ep (.p5 :: suf) = 0 := rfl + have hs : epSum (.p5 :: suf) = 0 := rfl + have hsuf : p5Suf (.p5 :: suf) = suf := rfl + rw [ho, hp, hip, hep, hs, hsuf] + simp only [Bool.false_and, Bool.false_eq_true, ↓reduceIte, Bool.not_false, + Bool.true_and, Bool.true_or] + rw [hl, hr] + +theorem checkChainAux_true_E_ge2_to_B_ge3_nil (fuel : Nat) (k c : Nat) (ds : List Nat) (hk : k % 2 = + 0) : + checkChainAux fuel true [] (c + 1) k (2 * c + 4) ds = + checkChainAux fuel true [.p3z k] c 0 (2 * c + 2) ds := by + apply checkChainAux_true_no_odd_no_p5 fuel [] [.p3z k] (c + 1) k (2 * c + 4) c 0 (2 * c + 2) ds + rfl (hasOdd_p3z_even_cons k [] hk) rfl rfl + rw [epW_p3z_even_cons k [] hk rfl]; omega + +theorem checkChainAux_true_E_ge2_to_B_ge3_even (fuel : Nat) (m : Nat) (ls' : List LTok) (k c : Nat) + (ds : List Nat) (hk : k % 2 = 0) : + checkChainAux fuel true (.p3z (m + 2) :: ls') (c + 1) k (2 * c + 4) ds = + checkChainAux fuel true (.p3z k :: .p3z m :: ls') c 0 (2 * c + 2) ds := by + apply checkChainAux_true_congr fuel (.p3z (m + 2) :: ls') (.p3z k :: .p3z m :: ls') + (c + 1) k (2 * c + 4) c 0 (2 * c + 2) ds rfl rfl + · rw [hasOdd_p3z_add2, hasOdd_p3z_even_cons k _ hk] + · rw [epSum_p3z_add2, epSum_p3z_even_cons k _ hk]; exact decide_eq_of_iff (by omega) + · rw [ep_p3z_add2, ep_p3z_even_cons k _ hk]; omega + · intro _; rw [epSum_p3z_add2, epSum_p3z_even_cons k _ hk, ep_p3z_add2, + ep_p3z_even_cons k _ hk]; omega + · rfl + · rw [MustDrain_p3z_add2, MustDrain_p3z_even_cons k _ hk] + · rfl + · intro hmd1 + rw [MustDrain_p3z_add2] at hmd1 + have hnp5 := not_isHeadP5_of_MustDrain_p3z m ls' hmd1 + rw [preP5Val_p3z_add2_of_not_headP5 m ls' hnp5, preP5Val_p3z_cons_of_not_headP5 k _ rfl] + · rw [epW_p3z_add2, epW_p3z_even_cons k _ hk rfl]; omega + · intro _ + rw [epSum_p3z_add2, epSum_p3z_even_cons k _ hk, hasOdd_p3z_add2, hasOdd_p3z_even_cons k _ hk] + omega + +theorem checkChainAux_true_E_c1_to_B_b2 (fuel : Nat) (m : Nat) (ls' : List LTok) (k : Nat) + (ds : List Nat) (hk : k ≤ 1) : + checkChainAux fuel true (.p3z (m + 2) :: ls') 0 (2 * k) 2 ds = + checkChainAux fuel true (.p3z m :: ls') 0 2 (2 - 2 * k) ds := by + have heven_sum := epSum_even (.p3z m :: ls') + apply checkChainAux_true_congr fuel (.p3z (m + 2) :: ls') (.p3z m :: ls') + 0 (2 * k) 2 0 2 (2 - 2 * k) ds rfl rfl + · exact hasOdd_p3z_add2 m ls' + · rw [epSum_p3z_add2]; exact decide_eq_of_iff (by omega) + · rw [ep_p3z_add2] + · intro hge + rw [epSum_p3z_add2] at hge ⊢ + rw [ep_p3z_add2] + omega + · rfl + · exact MustDrain_p3z_add2 m ls' + · rfl + · intro hmd1 + rw [MustDrain_p3z_add2] at hmd1 + exact preP5Val_p3z_add2_of_not_headP5 m ls' (not_isHeadP5_of_MustDrain_p3z m ls' hmd1) + · rw [epW_p3z_add2] + · intro hlt + rw [epSum_p3z_add2] at hlt ⊢ + rw [hasOdd_p3z_add2] + omega + +theorem step_Inv_ModeB_blank (ls : List LTok) (a : Nat) (hinv : Inv (.ModeB_blank ls a)) : + Inv (nextState (.ModeB_blank ls a)) := by + have hc := hinv.1 + have hch := hinv.2 + dsimp [invCore] at hc + simp only [Bool.and_eq_true, decide_eq_true_eq] at hc + obtain ⟨⟨ha5, hp5⟩, hz0, hvp5⟩ := hc + cases ls with + | nil => cases hp5 + | cons tok suf => + cases tok with + | p3z _ => cases hp5 + | p5 => + dsimp [drop1L] at hz0 hvp5 + obtain ⟨a'', rfl⟩ : ∃ a'', a = a'' + 2 := ⟨a - 2, by omega⟩ + have ha''3 : a'' ≥ 3 := by omega + obtain ⟨a3, rfl⟩ : ∃ a3, a'' = a3 + 1 := ⟨a'' - 1, by omega⟩ + dsimp only [nextState] + have hvp5' : ValidP5Chain (.p3z (a3 + 1) :: .p5 :: suf) = true := by + dsimp [ValidP5Chain]; simp [hz0, hvp5] + have hcond : ([] : List Nat) = [] ∧ (1 : Nat) = 1 ∧ (1 : Nat) = 1 ∧ + isP3zP5 (.p3z (a3 + 1) :: .p5 :: suf) = true ∧ + headP3zVal (.p3z (a3 + 1) :: .p5 :: suf) ≥ 3 := + ⟨rfl, rfl, rfl, rfl, ha''3⟩ + refine ⟨?_, ?_⟩ + · dsimp [invCore, GoodDs, checkDs2, checkDs1Phi1] + rw [hvp5'] + simp [hcond] + · intro fuel + have hf := hch fuel + dsimp [invChain, drop1L] at hf ⊢ + rw [if_pos hcond] + dsimp [headP3zVal, drop2L] + have heq : a3 + 1 - 2 = a3 + 1 + 2 - 4 := by omega + rw [heq]; exact hf + +theorem not_bool_eq_false {b : Bool} : (!b) = false ↔ b = true := by + cases b <;> simp + +theorem bool_if_false_eq_true {c e : Bool} : + (if c = true then false else e) = true ↔ (c = false ∧ e = true) := by + cases c <;> simp + +theorem prop_if_false_eq_true {P : Prop} [Decidable P] {e : Bool} : + (if P then false else e) = true ↔ (¬P ∧ e = true) := by + by_cases h : P <;> simp [h] + +theorem bool_if_false_eq_self {b e : Bool} (hb : b = false) : + (if b = true then false else e) = e := by + simp [hb] + +theorem not_bool_if_false_eq_true {b e : Bool} (hb : b = true) : + (if (!b) = true then false else e) = e := by + simp [hb] + +theorem not_decide_if_false_eq_true {P : Prop} [Decidable P] {e : Bool} (hP : P) : + (if (!decide P) = true then false else e) = e := by + simp [hP] + +theorem drop2L_cons (t1 t2 : LTok) (ls : List LTok) : + drop2L (t1 :: ls) = drop2L (t2 :: ls) := by + cases ls <;> rfl + +theorem k0Of_eq_two_mul {k : Nat} (hk : k ≤ 1) : k0Of k = 2 * k := by + cases k with + | zero => rfl + | succ k' => + cases k' with + | zero => rfl + | succ _ => omega + +theorem step_Inv_ModeB_b2_m0 (ls : List LTok) (ds : List Nat) (hinv : Inv (.ModeB_b2 ls 0 ds)) : + Inv (.ModeE_c1 ls 1 ds) := by + have hc := hinv.1 + have hch := hinv.2 + have hds2 : checkDs2 (.ModeE_c1 ls 1 ds) = checkDs2 (.ModeB_b2 ls 0 ds) := by + dsimp [checkDs2] + by_cases h : ds = [2] + · simp only [h, not_true_eq_false, ↓reduceIte] + rw [show decide (2 * 1 + epSum ls ≥ 4) = decide (2 * 0 + epSum ls ≥ 2) from + decide_eq_of_iff (by omega)] + · simp [h] + have hds1 : checkDs1Phi1 (.ModeE_c1 ls 1 ds) = checkDs1Phi1 (.ModeB_b2 ls 0 ds) := by + dsimp [checkDs1Phi1] + by_cases h : ds = [1] + · simp only [h, not_true_eq_false, ↓reduceIte] + by_cases he : epW ls = 2 + · simp only [he, not_true_eq_false, ↓reduceIte] + rw [show decide (2 * 1 + epSum ls ≥ 12) = decide (2 * 0 + epSum ls ≥ 10) from + decide_eq_of_iff (by omega)] + · simp [he] + · simp [h] + refine ⟨?_, ?_⟩ + · have hcore_eq : invCore (.ModeE_c1 ls 1 ds) = invCore (.ModeB_b2 ls 0 ds) := by + dsimp only [invCore] + rw [hds2, hds1, if_neg (show ¬((0 : Nat) ≥ 2) by omega)] + have hd1 : decide ((1 : Nat) ≤ 1) = decide ((0 : Nat) ≤ 1) := rfl + have hd2 : decide ((1 = 0 ∧ headP3zVal ls = 0) ∨ (headP3zVal ls ≥ 22 - 2 * 1 ∧ + z0 (p5Suf ls) ≥ 38)) = + decide (headP3zVal ls ≥ 20 - 2 * 0 ∧ z0 (p5Suf ls) ≥ 38) := + decide_eq_of_iff (by omega) + have hd3 : decide (1 ≤ 1 ∧ epW ls ≥ 1 ∧ 2 * 1 + prefSumW ls ≤ 4) = + decide (0 ≤ 1 ∧ epW ls ≥ 1 ∧ 2 * 0 + prefSumW ls ≤ 2) := + decide_eq_of_iff (by omega) + have hd4 : decide (2 < 2 * 1 + epSum ls) = decide (0 < 2 * 0 + epSum ls) := + decide_eq_of_iff (by omega) + have hd5 : decide (2 ≥ 2 * 1 + epSum ls) = decide (0 ≥ 2 * 0 + epSum ls) := + decide_eq_of_iff (by omega) + have hxi : 2 * 1 + epSum ls + 2 * ep ls = 2 * 0 + epSum ls + 2 * ep ls + 2 := by omega + rw [hd1, hd2, hd3, hd4, hd5, hxi] + rw [hcore_eq] + exact hc + · intro fuel + have hf := hch fuel + have hch_eq : invChain fuel (.ModeE_c1 ls 1 ds) = invChain fuel (.ModeB_b2 ls 0 ds) := by + dsimp only [invChain] + rw [if_neg (show ¬((0 : Nat) ≥ 2) by omega)] + by_cases hemp : ds = [] ∧ epW ls = 0 + · rw [if_pos hemp, if_pos hemp] + have hnot : (!(1 = 0 ∧ headP3zVal ls = 0)) = true := rfl + rw [if_pos hnot] + have hm0 : headP3zVal ls - 6 - 2 * (1 - 1) = headP3zVal ls - 4 - 2 * (1 - 0) := by omega + rw [hm0] + · rw [if_neg hemp, if_neg hemp] + rw [hch_eq] + exact hf + +theorem step_Inv_ModeE_c1 (ls : List LTok) (k : Nat) (ds : List Nat) (hinv : Inv (.ModeE_c1 ls k + ds)) : + Inv (nextState (.ModeE_c1 ls k ds)) := by + have hc := hinv.1 + have hch := hinv.2 + dsimp only [invCore] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨h_guards, hc⟩ + simp only [Bool.or_eq_false_iff, not_bool_eq_false] at h_guards + rcases h_guards with ⟨⟨⟨hgd, hds2⟩, hds1⟩, heven⟩ + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hok_phi, hc⟩ + rw [not_bool_eq_false] at hok_phi + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hmd_bound, hodd_branch⟩ + have hk : k ≤ 1 := by + by_cases h_emp : ds = [] ∧ epW ls = 0 + · rw [if_pos h_emp] at hok_phi + simp only [Bool.and_eq_true, decide_eq_true_eq] at hok_phi + exact hok_phi.1.1 + · rw [if_neg h_emp] at hok_phi + simp only [Bool.and_eq_true, decide_eq_true_eq] at hok_phi + exact hok_phi.1.1 + cases ls with + | nil => + exfalso + by_cases h_emp : ds = [] ∧ epW [] = 0 + · rw [if_pos h_emp] at hok_phi + simp [isP3zP5] at hok_phi + · rw [if_neg h_emp] at hok_phi + simp [epW] at hok_phi + | cons tok ls' => + cases tok with + | p5 => + exfalso + by_cases h_emp : ds = [] ∧ epW (.p5 :: ls') = 0 + · rw [if_pos h_emp] at hok_phi + simp [isP3zP5] at hok_phi + · rw [if_neg h_emp] at hok_phi + simp [epW] at hok_phi + | p3z m => + cases m with + | zero => + dsimp only [nextState] + rw [k0Of_eq_two_mul hk] + by_cases h_emp : ds = [] ∧ epW (.p3z 0 :: ls') = 0 + · rcases h_emp with ⟨rfl, hepw0⟩ + have h_p5 : ∃ suf, ls' = .p5 :: suf := by + cases ls' with + | nil => simp [epW] at hepw0 + | cons t2 s2 => + cases t2 with + | p3z _ => simp [epW] at hepw0 + | p5 => exact ⟨s2, rfl⟩ + obtain ⟨suf, rfl⟩ := h_p5 + rw [if_pos ⟨rfl, hepw0⟩] at hok_phi + simp only [Bool.and_eq_true, decide_eq_true_eq, headP3zVal] at hok_phi + have hk0 : k = 0 := by omega + subst hk0 + have heven' : ValidEvenLs (.p5 :: suf) = true := heven + refine ⟨?_, ?_⟩ + · dsimp only [invCore, GoodDs, checkDs2, checkDs1Phi1, isHeadP5, MustDrain, hasOdd, + prefSumW] + rw [if_pos rfl, not_bool_if_false_eq_true heven'] + rfl + · intro fuel + have hf := hch fuel + dsimp [invChain] at hf ⊢ + rw [if_pos ⟨rfl, rfl⟩] at hf + simp only [headP3zVal] at hf + simp only [and_self, decide_true, Bool.not_true, Bool.false_eq_true, ↓reduceIte] at hf + have h_shift := + checkChainAux_true_p3z0 fuel (.p5 :: suf) 0 0 2 [] (Or.inr (by dsimp [epSum]; omega)) + rw [← h_shift] + exact hf + · rw [if_neg h_emp] at hok_phi + simp only [Bool.and_eq_true, decide_eq_true_eq] at hok_phi + rcases hok_phi with ⟨⟨_, hepw_pos, hpref_le⟩, hphiw⟩ + have hnp5 : isHeadP5 ls' = false := by + cases ls' with + | nil => rfl + | cons t2 s2 => + cases t2 with + | p3z _ => rfl + | p5 => simp [epW] at hepw_pos + have hepw_eq := epW_p3z_even_cons 0 ls' rfl hnp5 + have hpref_eq := prefSumW_p3z_even_cons 0 ls' rfl hnp5 + have hepsum_eq := epSum_p3z_even_cons 0 ls' rfl + have hep_eq := ep_p3z_even_cons 0 ls' rfl + have hodd_eq := hasOdd_p3z_even_cons 0 ls' rfl + have hmd_eq := MustDrain_p3z_even_cons 0 ls' rfl + have heven' : ValidEvenLs ls' = true := by + rw [ValidEvenLs_p3z_even_cons 0 ls' rfl] at heven; exact heven + have hds2' : checkDs2 (.ModeE_ge2 ls' (2 * k + 2) 0 ds) = true := by + dsimp [checkDs2] at hds2 ⊢ + by_cases h2 : ds = [2] + · simp only [h2, not_true_eq_false, ↓reduceIte] at hds2 ⊢ + rw [hepsum_eq] at hds2 + have hm0 : (2 * k + 2) % 2 = 0 := by omega + simp only [hasP5, hmd_eq, p5Suf, isHeadP5, Bool.not_false, Bool.and_true] at hds2 + simp only [hm0, decide_true, hnp5, Bool.not_false, Bool.and_true] + rw [show decide (2 * k + 2 + epSum ls' ≥ 2 * 0 + 6) = + decide (2 * k + (0 + epSum ls') ≥ 4) from + decide_eq_of_iff (by omega)] + exact hds2 + · simp [h2] + have hds1' : checkDs1Phi1 (.ModeE_ge2 ls' (2 * k + 2) 0 ds) = true := by + dsimp [checkDs1Phi1] at hds1 ⊢ + by_cases h1 : ds = [1] + · simp only [h1, not_true_eq_false, ↓reduceIte] at hds1 ⊢ + have hm0 : (2 * k + 2) % 2 = 0 := by omega + rw [if_pos hm0, hnp5] + simp only [Bool.false_eq_true, ↓reduceIte] + by_cases he1 : 0 + epW ls' = 1 + · have he2 : epW (.p3z 0 :: ls') = 2 := by omega + simp only [he1, decide_true, Bool.not_true, Bool.false_eq_true, ↓reduceIte] + simp only [he2, not_true_eq_false, ↓reduceIte, hasP5, hmd_eq, isHeadP5, + Bool.not_false, Bool.and_true, hepsum_eq] at hds1 + simp only [Bool.not_false, Bool.and_true] + rw [show decide (2 * k + 2 + epSum ls' ≥ 2 * 0 + 14) = + decide (2 * k + (0 + epSum ls') ≥ 12) from + decide_eq_of_iff (by omega)] + exact hds1 + · rw [decide_eq_false he1]; rfl + · simp [h1] + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs ds || !checkDs2 (.ModeE_ge2 ls' (2 * k + 2) 0 ds) || + !checkDs1Phi1 (.ModeE_ge2 ls' (2 * k + 2) 0 ds)) = false := by + simp [hgd, hds2', hds1'] + rw [bool_if_false_eq_self h_g] + have hm0 : (2 * k + 2) % 2 = 0 := by omega + rw [if_pos hm0] + rw [not_bool_if_false_eq_true heven'] + rw [hpref_eq] at hpref_le + rw [not_decide_if_false_eq_true (by omega)] + have hphi_eq : 0 + epW ls' = epW (.p3z 0 :: ls') - 1 := by omega + have hphiw' : GoodPhiW (0 + epW ls') ds + (isHeadP3z1 ls' && decide (2 * k + 2 = 0 ∧ 0 = 0 ∧ ds = [])) = true := by + rw [hphi_eq] + exact GoodPhiW_mono _ _ _ hphiw + have hok_phi' : (if (!isHeadP5 ls') = true then + (decide (ds = [] ∧ 0 + epW ls' = 1) && MustDrain ls' && + decide (0 + ep ls' = 1 ∧ 2 * k + 2 + epSum ls' + 2 * ep ls' = 2) && + hasP5 ls' && decide (preP5Val ls' ≥ 16 ∧ z0 (p5Suf ls') ≥ 38)) || + GoodPhiW (0 + epW ls') ds (isHeadP3z1 ls' && decide (2 * k + 2 = 0 ∧ 0 = 0 ∧ + ds = [])) + else + decide (0 = 0 ∧ ds = [] ∧ + 2 * k + 2 = 2) || (decide (0 ≥ 1) && GoodPhiW (0 - 1) ds false)) = true := by + rw [if_pos (by rw [hnp5]; rfl), hphiw', Bool.or_true] + rw [not_bool_if_false_eq_true hok_phi'] + rw [hmd_eq, hepsum_eq] at hmd_bound + have hmd_bound' : (MustDrain ls' && decide (2 * 0 + 4 < 2 * k + 2 + epSum ls')) = + false := by + rw [show decide (2 * 0 + 4 < 2 * k + 2 + epSum ls') = + decide (2 < 2 * k + (0 + epSum ls')) from + decide_eq_of_iff (by omega)] + exact hmd_bound + rw [bool_if_false_eq_self hmd_bound'] + have h_rst_false : (decide (2 * k + 2 = 0 ∧ 0 = 0 ∧ + ds = []) && isHeadP3z1 ls') = false := by + simp + rw [h_rst_false] + simp only [Bool.false_eq_true, ↓reduceIte, Bool.not_true] + rw [hodd_eq, hepsum_eq] at hodd_branch + have hd_odd : decide (2 * 0 + 4 ≥ 2 * k + 2 + epSum ls') = + decide (2 ≥ 2 * k + (0 + epSum ls')) := + decide_eq_of_iff (by omega) + rw [hd_odd] + by_cases h_cond : (hasOdd ls' && decide (2 ≥ 2 * k + (0 + epSum ls'))) = true + · rw [if_pos h_cond] at hodd_branch ⊢ + have hpsi_eq : ep (.p3z 0 :: ls') - 1 = 0 + ep ls' := by omega + have hxi_eq : 2 * k + (0 + epSum ls') + 2 * ep (.p3z 0 :: ls') = + 2 * k + 2 + epSum ls' + 2 * ep ls' := by omega + rw [hpsi_eq, hxi_eq, hmd_eq] at hodd_branch + have hp5_eq : hasP5 (.p3z 0 :: ls') = hasP5 ls' := rfl + rw [hp5_eq] at hodd_branch + simp only [Bool.and_eq_true] at hodd_branch ⊢ + rcases hodd_branch with ⟨⟨⟨h1, h2⟩, h3⟩, h4⟩ + refine ⟨⟨⟨h1, h2⟩, h3⟩, ?_⟩ + rw [h4, Bool.true_or] + · rw [if_neg h_cond] + · intro fuel + have hf := hch fuel + dsimp only [invChain] at hf ⊢ + have hm0 : (2 * k + 2) % 2 = 0 := by omega + rw [if_pos hm0, if_neg (show ¬(2 * k + 2 = 0 ∧ 0 = 0 ∧ ds = [] ∧ + isHeadP3z1 ls' = true) by omega)] + rw [if_neg h_emp] at hf + have h_shift := checkChainAux_true_p3z0 fuel ls' 0 (2 * k) 2 ds (Or.inl hnp5) + rw [← h_shift] + exact hf + | succ m1 => + cases m1 with + | zero => + exfalso + by_cases h_emp : ds = [] ∧ epW (.p3z 1 :: ls') = 0 + · rw [if_pos h_emp] at hok_phi + simp only [Bool.and_eq_true, decide_eq_true_eq] at hok_phi + dsimp only [headP3zVal] at hok_phi + omega + · rw [if_neg h_emp] at hok_phi + simp [epW] at hok_phi + | succ m2 => + have hm_eq : m2 + 1 + 1 = m2 + 2 := rfl + rw [hm_eq] at * + dsimp only [nextState] + have hepw_eq := epW_p3z_add2 m2 ls' + have hep_eq := ep_p3z_add2 m2 ls' + have hepsum_eq := epSum_p3z_add2 m2 ls' + have hodd_eq := hasOdd_p3z_add2 m2 ls' + have hmd_eq := MustDrain_p3z_add2 m2 ls' + have heven_eq := ValidEvenLs_p3z_add2 m2 ls' + have hds2' : checkDs2 (.ModeB_b2 (.p3z m2 :: ls') k ds) = true := by + dsimp [checkDs2] at hds2 ⊢ + by_cases h2 : ds = [2] + · simp only [h2, not_true_eq_false, ↓reduceIte] at hds2 ⊢ + rw [hmd_eq, hepsum_eq] at hds2 + rw [show decide (2 * k + epSum (.p3z m2 :: ls') ≥ 2) = + decide (2 * k + (epSum (.p3z m2 :: ls') + 2) ≥ + 4) from decide_eq_of_iff (by omega)] + exact hds2 + · simp [h2] + have hds1' : checkDs1Phi1 (.ModeB_b2 (.p3z m2 :: ls') k ds) = true := by + dsimp [checkDs1Phi1] at hds1 ⊢ + by_cases h1 : ds = [1] + · simp only [h1, not_true_eq_false, ↓reduceIte] at hds1 ⊢ + rw [hepw_eq, hmd_eq, hepsum_eq] at hds1 + by_cases he2 : epW (.p3z m2 :: ls') = 2 + · simp only [he2, not_true_eq_false, ↓reduceIte] at hds1 ⊢ + rw [show decide (2 * k + epSum (.p3z m2 :: ls') ≥ 10) = + decide (2 * k + (epSum (.p3z m2 :: ls') + 2) ≥ + 12) from decide_eq_of_iff (by omega)] + exact hds1 + · simp [he2] + · simp [h1] + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + rw [heven_eq] at heven + have h_g : (!GoodDs ds || !checkDs2 (.ModeB_b2 (.p3z m2 :: ls') k ds) || + !checkDs1Phi1 (.ModeB_b2 (.p3z m2 :: ls') k ds) || !ValidEvenLs (.p3z m2 :: ls')) = + false := by + simp [hgd, hds2', hds1', heven] + rw [bool_if_false_eq_self h_g] + rw [if_neg (show ¬(k ≥ 2) by omega)] + have hok_phi' : (if ds = [] ∧ epW (.p3z m2 :: ls') = 0 then + decide (k ≤ 1) && isP3zP5 (.p3z m2 :: ls') && + decide (headP3zVal (.p3z m2 :: ls') ≥ 20 - 2 * k ∧ + z0 (p5Suf (.p3z m2 :: ls')) ≥ 38) + else + decide (k ≤ 1 ∧ epW (.p3z m2 :: ls') ≥ 1 ∧ 2 * k + prefSumW (.p3z m2 :: ls') ≤ 2) && + GoodPhiW (epW (.p3z m2 :: ls') - 1) ds false) = true := by + rw [hepw_eq] at hok_phi + by_cases h_emp : ds = [] ∧ epW (.p3z m2 :: ls') = 0 + · rw [if_pos h_emp] at hok_phi ⊢ + have hp3zp5 : isP3zP5 (.p3z (m2 + 2) :: ls') = isP3zP5 (.p3z m2 :: ls') := by + cases ls' with + | nil => rfl + | cons t2 _ => cases t2 <;> rfl + rw [hp3zp5] at hok_phi + simp only [Bool.and_eq_true, decide_eq_true_eq] at hok_phi ⊢ + dsimp only [headP3zVal, p5Suf] at hok_phi ⊢ + exact ⟨hok_phi.1, by omega⟩ + · rw [if_neg h_emp] at hok_phi ⊢ + simp only [Bool.and_eq_true, decide_eq_true_eq] at hok_phi + have h_epw_ge1 : epW (.p3z m2 :: ls') ≥ 1 := hok_phi.1.2.1 + have hm2_even : m2 % 2 = 0 := by + dsimp [epW] at h_epw_ge1 + by_cases hm2 : m2 % 2 = 1 + · rw [if_pos hm2] at h_epw_ge1; omega + · omega + have hnp5 : isHeadP5 ls' = false := by + cases ls' with + | nil => rfl + | cons t2 _ => + cases t2 with + | p3z _ => rfl + | p5 => dsimp [epW] at h_epw_ge1; rw [if_neg (by omega)] at h_epw_ge1; omega + have hpref_add2 := prefSumW_p3z_add2 m2 ls' hm2_even hnp5 + rw [hpref_add2] at hok_phi + simp only [Bool.and_eq_true, decide_eq_true_eq] + exact ⟨⟨hk, h_epw_ge1, by omega⟩, hok_phi.2⟩ + rw [not_bool_if_false_eq_true hok_phi'] + rw [hmd_eq, hepsum_eq] at hmd_bound + have hmd_bound' : (MustDrain (.p3z m2 :: ls') && + decide (0 < 2 * k + epSum (.p3z m2 :: ls'))) = false := by + rw [show decide (0 < 2 * k + epSum (.p3z m2 :: ls')) = + decide (2 < 2 * k + (epSum (.p3z m2 :: ls') + + 2)) from decide_eq_of_iff (by omega)] + exact hmd_bound + rw [bool_if_false_eq_self hmd_bound'] + rw [hodd_eq, hepsum_eq, hep_eq, hmd_eq] at hodd_branch + have hd_odd : decide (0 ≥ 2 * k + epSum (.p3z m2 :: ls')) = + decide (2 ≥ 2 * k + (epSum (.p3z m2 :: ls') + 2)) := + decide_eq_of_iff (by omega) + have hxi_eq : 2 * k + epSum (.p3z m2 :: ls') + 2 * ep (.p3z m2 :: ls') + 2 = + 2 * k + (epSum (.p3z m2 :: ls') + 2) + 2 * ep (.p3z m2 :: ls') := by omega + rw [hd_odd, hxi_eq] + have hp5_eq : hasP5 (.p3z (m2 + 2) :: ls') = hasP5 (.p3z m2 :: ls') := rfl + rw [hp5_eq] at hodd_branch + exact hodd_branch + · intro fuel + have hf := hch fuel + dsimp only [invChain] at hf ⊢ + rw [if_neg (show ¬(k ≥ 2) by omega)] + rw [hepw_eq] at hf + have h_shift := checkChainAux_true_E_c1_to_B_b2 fuel m2 ls' k ds hk + rw [h_shift] at hf + by_cases h_emp : ds = [] ∧ epW (.p3z m2 :: ls') = 0 + · rw [if_pos h_emp] at hf ⊢ + have hnot : (!(k = 0 ∧ headP3zVal (.p3z (m2 + 2) :: ls') = 0)) = true := by + dsimp [headP3zVal]; simp + rw [if_pos hnot] at hf + simp only [headP3zVal] at hf ⊢ + rw [drop2L_cons (.p3z (m2 + 2)) (.p3z m2) ls'] at hf + have hm_sub : m2 + 2 - 6 - 2 * (1 - k) = m2 - 4 - 2 * (1 - k) := by omega + rw [hm_sub] at hf + exact hf + · rw [if_neg h_emp] at hf ⊢ + exact hf + +theorem step_Inv_ModeB_ge3_c0 (ls : List LTok) (a : Nat) (ds : List Nat) + (hinv : Inv (.ModeB_ge3 ls a 0 ds)) : + Inv (.ModeE_c1 (.p3z a :: ls) 0 ds) := by + have hc := hinv.1 + have hch := hinv.2 + dsimp only [invCore] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨h_guards, hc⟩ + simp only [Bool.or_eq_false_iff, not_bool_eq_false] at h_guards + rcases h_guards with ⟨⟨hgd, hds2⟩, hds1⟩ + by_cases ha : a % 2 = 0 + · rw [if_pos ha] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨heven, hc⟩ + rw [not_bool_eq_false] at heven + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hok_phi, hc⟩ + rw [not_bool_eq_false] at hok_phi + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hmd_bound, hodd_branch⟩ + have heven' : ValidEvenLs (.p3z a :: ls) = true := by + rw [ValidEvenLs_p3z_even_cons a ls ha]; exact heven + have hmd_eq := MustDrain_p3z_even_cons a ls ha + have hepsum_eq := epSum_p3z_even_cons a ls ha + have hep_eq := ep_p3z_even_cons a ls ha + have hodd_eq := hasOdd_p3z_even_cons a ls ha + have hds2' : checkDs2 (.ModeE_c1 (.p3z a :: ls) 0 ds) = true := by + dsimp [checkDs2] at hds2 ⊢ + by_cases h2 : ds = [2] + · simp only [h2, not_true_eq_false, ↓reduceIte] at hds2 ⊢ + simp only [ha, decide_true, hasP5, hmd_eq, p5Suf, isHeadP5, Bool.not_false, + Bool.and_true, hepsum_eq, Nat.zero_add] at hds2 ⊢ + simp only [Bool.and_eq_true] at hds2 ⊢ + exact ⟨hds2.1.1, hds2.2⟩ + · simp [h2] + have hds1' : checkDs1Phi1 (.ModeE_c1 (.p3z a :: ls) 0 ds) = true := by + dsimp [checkDs1Phi1] at hds1 ⊢ + by_cases h1 : ds = [1] + · simp only [h1, not_true_eq_false, ↓reduceIte] at hds1 ⊢ + rw [if_pos ha, if_pos ha] at hds1 + by_cases he2 : epW (.p3z a :: ls) = 2 + · simp only [he2, not_true_eq_false, ↓reduceIte] + have hnp5 : isHeadP5 ls = false := by + cases ls with + | nil => rfl + | cons t2 _ => + cases t2 with + | p3z _ => rfl + | p5 => dsimp [epW] at he2; rw [if_neg (by omega)] at he2; omega + have hepw_eq := epW_p3z_even_cons a ls ha hnp5 + have he1 : 0 + epW ls = 1 := by omega + rw [hnp5] at hds1 + simp only [Bool.false_eq_true, ↓reduceIte] at hds1 + simp only [he1, decide_true, Bool.not_true, Bool.false_eq_true, ↓reduceIte] at hds1 + simp only [hasP5, hmd_eq, isHeadP5, Bool.not_false, Bool.and_true, hepsum_eq, + Nat.zero_add] at hds1 ⊢ + exact hds1 + · simp [he2] + · simp [h1] + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs ds || !checkDs2 (.ModeE_c1 (.p3z a :: ls) 0 ds) || + !checkDs1Phi1 (.ModeE_c1 (.p3z a :: ls) 0 ds) || !ValidEvenLs (.p3z a :: ls)) = false := + by + simp [hgd, hds2', hds1', heven'] + rw [bool_if_false_eq_self h_g] + by_cases hp5 : isHeadP5 ls = true + · have h_ls : ∃ suf, ls = .p5 :: suf := by + cases ls with + | nil => cases hp5 + | cons t2 s2 => cases t2 with | p3z _ => cases hp5 | p5 => exact ⟨s2, rfl⟩ + obtain ⟨suf, rfl⟩ := h_ls + have hip5 : (!isHeadP5 (.p5 :: suf)) = false := rfl + rw [hip5, if_neg Bool.false_ne_true, if_pos rfl] at hok_phi + simp only [decide_eq_true_eq] at hok_phi + dsimp only [p5Suf] at hok_phi + rcases hok_phi with ⟨rfl, ha_or⟩ + have hepw0 : epW (.p3z a :: .p5 :: suf) = 0 := by + dsimp [epW]; rw [if_neg (by omega)] + have hok_phi' : (if ([] : List Nat) = [] ∧ epW (.p3z a :: .p5 :: suf) = 0 then + decide ((0 : Nat) ≤ 1) && isP3zP5 (.p3z a :: .p5 :: suf) && + decide ((0 = 0 ∧ headP3zVal (.p3z a :: .p5 :: suf) = 0) ∨ + (headP3zVal (.p3z a :: .p5 :: suf) ≥ 22 - 2 * 0 ∧ + z0 (p5Suf (.p3z a :: .p5 :: suf)) ≥ 38)) + else + decide (0 ≤ 1 ∧ epW (.p3z a :: .p5 :: suf) ≥ 1 ∧ + 2 * 0 + prefSumW (.p3z a :: .p5 :: suf) ≤ 4) && + GoodPhiW (epW (.p3z a :: .p5 :: suf) - 1) [] false) = true := by + rw [if_pos ⟨rfl, hepw0⟩] + simp only [isP3zP5, headP3zVal, p5Suf, Bool.and_eq_true, true_and, and_true, + decide_eq_true_eq] + omega + rw [not_bool_if_false_eq_true hok_phi'] + have hmd0 : MustDrain (.p3z a :: .p5 :: suf) = false := by + rw [MustDrain_p3z_even_cons a (.p5 :: suf) ha]; rfl + have hodd0 : hasOdd (.p3z a :: .p5 :: suf) = false := by + rw [hasOdd_p3z_even_cons a (.p5 :: suf) ha]; rfl + rw [bool_if_false_eq_self (by simp [hmd0]), if_neg (by simp [hodd0])] + · have hp5_f : isHeadP5 ls = false := Bool.eq_false_iff.mpr hp5 + rw [if_pos (by rw [hp5_f]; rfl)] at hok_phi + simp only [Bool.and_eq_true, decide_eq_true_eq] at hok_phi + rcases hok_phi with ⟨⟨hpref_le, hphi_or⟩, _⟩ + have h_imp : decide (0 + ep ls = 1 ∧ a + epSum ls + 2 * ep ls + 2 = 2) = false := by + rw [decide_eq_false_iff_not]; omega + have hphi1_false : (decide (ds = [] ∧ 0 + epW ls = 1) && MustDrain ls && + decide (0 + ep ls = 1 ∧ a + epSum ls + 2 * ep ls + 2 = 2) && + hasP5 ls && decide (preP5Val ls ≥ 16 ∧ z0 (p5Suf ls) ≥ 38)) = false := by + rw [h_imp]; simp + rw [hphi1_false, Bool.false_or] at hphi_or + have hepw_eq := epW_p3z_even_cons a ls ha hp5_f + have hpref_eq := prefSumW_p3z_even_cons a ls ha hp5_f + have h_not_emp : ¬(ds = [] ∧ epW (.p3z a :: ls) = 0) := by omega + have hok_phi' : (if ds = [] ∧ epW (.p3z a :: ls) = 0 then + decide ((0 : Nat) ≤ 1) && isP3zP5 (.p3z a :: ls) && + decide ((0 = 0 ∧ headP3zVal (.p3z a :: ls) = 0) ∨ + (headP3zVal (.p3z a :: ls) ≥ 22 - 2 * 0 ∧ z0 (p5Suf (.p3z a :: ls)) ≥ 38)) + else + decide (0 ≤ 1 ∧ epW (.p3z a :: ls) ≥ 1 ∧ 2 * 0 + prefSumW (.p3z a :: ls) ≤ 4) && + GoodPhiW (epW (.p3z a :: ls) - 1) ds false) = true := by + rw [if_neg h_not_emp] + have hsub : epW (.p3z a :: ls) - 1 = 0 + epW ls := by omega + rw [hsub, hphi_or, Bool.and_true, decide_eq_true_eq, hpref_eq, hepw_eq] + omega + rw [not_bool_if_false_eq_true hok_phi'] + have hmd_bound' : (MustDrain (.p3z a :: ls) && + decide (2 < 2 * 0 + epSum (.p3z a :: ls))) = false := by + rw [hmd_eq, hepsum_eq] + rw [show decide (2 < 2 * 0 + (a + epSum ls)) = decide (2 * 0 + 2 < a + epSum ls) from + decide_eq_of_iff (by omega)] + exact hmd_bound + rw [bool_if_false_eq_self hmd_bound'] + rw [hodd_eq, hepsum_eq] + have hd_odd : decide (2 ≥ 2 * 0 + (a + epSum ls)) = decide (2 * 0 + 2 ≥ a + epSum ls) := + decide_eq_of_iff (by omega) + rw [hd_odd] + by_cases h_cond : (hasOdd ls && decide (2 * 0 + 2 ≥ a + epSum ls)) = true + · rw [if_pos h_cond] at hodd_branch ⊢ + have hpsi_eq : ep (.p3z a :: ls) - 1 = 0 + ep ls := by omega + have hxi_eq : 2 * 0 + (a + epSum ls) + 2 * ep (.p3z a :: ls) = + a + epSum ls + 2 * ep ls + 2 := by omega + rw [hpsi_eq, hxi_eq, hmd_eq] + have hp5_eq : hasP5 (.p3z a :: ls) = hasP5 ls := rfl + rw [hp5_eq] + have h_false_disj : decide (ds = [] ∧ 0 + ep ls = 1 ∧ a + epSum ls + 2 * ep ls + 2 = 2 ∧ + preP5Val ls ≥ 16 ∧ z0 (p5Suf ls) ≥ 38) = false := by + rw [decide_eq_false_iff_not] + intro ⟨_, h1, h2, _⟩; omega + rw [h_false_disj, Bool.or_false] at hodd_branch + exact hodd_branch + · rw [if_neg h_cond] + · intro fuel + have hf := hch fuel + dsimp only [invChain] at hf ⊢ + rw [if_pos ha] at hf + by_cases hp5 : isHeadP5 ls = true + · have h_ls : ∃ suf, ls = .p5 :: suf := by + cases ls with + | nil => cases hp5 + | cons t2 s2 => cases t2 with | p3z _ => cases hp5 | p5 => exact ⟨s2, rfl⟩ + obtain ⟨suf, rfl⟩ := h_ls + have hip5 : (!isHeadP5 (.p5 :: suf)) = false := rfl + rw [hip5, if_neg Bool.false_ne_true, if_pos rfl] at hok_phi + simp only [decide_eq_true_eq] at hok_phi + dsimp only [p5Suf] at hok_phi + rcases hok_phi with ⟨rfl, ha_or⟩ + have hepw0 : epW (.p3z a :: .p5 :: suf) = 0 := by + dsimp [epW]; rw [if_neg (by omega)] + rw [if_pos ⟨rfl, hepw0⟩] + rcases ha_or with rfl | ⟨ha22, _⟩ + · simp only [isHeadP5, headP3zVal] at hf ⊢ + rw [if_neg (by omega)] at hf + simp only [and_self, decide_true, Bool.not_true, Bool.false_eq_true, ↓reduceIte] + exact hf + · rw [if_pos ⟨rfl, rfl, ha22⟩] at hf + have hnot : (!((0 : Nat) = 0 ∧ headP3zVal (.p3z a :: .p5 :: suf) = 0)) = true := by + dsimp [headP3zVal]; simp [show a ≠ 0 by omega] + rw [if_pos hnot] + dsimp only [headP3zVal, drop2L, drop1L] at hf ⊢ + exact hf + · have hp5_f : isHeadP5 ls = false := Bool.eq_false_iff.mpr hp5 + have hepw_eq := epW_p3z_even_cons a ls ha hp5_f + have h_not_emp : ¬(ds = [] ∧ epW (.p3z a :: ls) = 0) := by omega + have h_not_p5 : ¬(isHeadP5 ls = true ∧ (0 : Nat) = 0 ∧ a ≥ 22) := by simp [hp5_f] + rw [if_neg h_not_p5] at hf + rw [if_neg h_not_emp] + exact hf + · rw [if_neg ha] at hc + rw [prop_if_false_eq_true] at hc + rcases hc with ⟨h_c0_cond, hc⟩ + have h_c0 : ds = [] ∧ a ≥ 23 ∧ isHeadP5 ls = true ∧ z0 (p5Suf ls) ≥ 38 := by + by_cases h_inner : ds = [] ∧ a ≥ 23 ∧ isHeadP5 ls = true ∧ z0 (p5Suf ls) ≥ 38 + · exact h_inner + · exfalso; apply h_c0_cond; exact ⟨rfl, by simp [h_inner]⟩ + rcases h_c0 with ⟨rfl, ha23, hp5, hz38⟩ + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨heven, _⟩ + rw [not_bool_eq_false] at heven + have h_ls : ∃ suf, ls = .p5 :: suf := by + cases ls with + | nil => cases hp5 + | cons t2 s2 => cases t2 with | p3z _ => cases hp5 | p5 => exact ⟨s2, rfl⟩ + obtain ⟨suf, rfl⟩ := h_ls + have hm1 : a % 2 = 1 := by omega + have hepw0 : epW (.p3z a :: .p5 :: suf) = 0 := by + dsimp [epW]; rw [if_pos hm1] + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs [] || !checkDs2 (.ModeE_c1 (.p3z a :: .p5 :: suf) 0 []) || + !checkDs1Phi1 (.ModeE_c1 (.p3z a :: .p5 :: suf) 0 []) || + !ValidEvenLs (.p3z a :: .p5 :: suf)) = false := by + dsimp [GoodDs, checkDs2, checkDs1Phi1] + simp [heven] + rw [bool_if_false_eq_self h_g] + have hok_phi' : (if ([] : List Nat) = [] ∧ epW (.p3z a :: .p5 :: suf) = 0 then + decide ((0 : Nat) ≤ 1) && isP3zP5 (.p3z a :: .p5 :: suf) && + decide ((0 = 0 ∧ headP3zVal (.p3z a :: .p5 :: suf) = 0) ∨ + (headP3zVal (.p3z a :: .p5 :: suf) ≥ 22 - 2 * 0 ∧ + z0 (p5Suf (.p3z a :: .p5 :: suf)) ≥ 38)) + else + decide (0 ≤ 1 ∧ epW (.p3z a :: .p5 :: suf) ≥ 1 ∧ + 2 * 0 + prefSumW (.p3z a :: .p5 :: suf) ≤ 4) && + GoodPhiW (epW (.p3z a :: .p5 :: suf) - 1) [] false) = true := by + rw [if_pos ⟨rfl, hepw0⟩] + dsimp [p5Suf] at hz38 + simp only [isP3zP5, headP3zVal, p5Suf, Bool.and_eq_true, true_and, and_true, + decide_eq_true_eq] + omega + rw [not_bool_if_false_eq_true hok_phi'] + have hmd0 : MustDrain (.p3z a :: .p5 :: suf) = false := by + dsimp [MustDrain]; rw [if_pos hm1] + have h_not_le : decide (2 ≥ 2 * 0 + epSum (.p3z a :: .p5 :: suf)) = false := by + rw [decide_eq_false_iff_not]; dsimp [epSum]; rw [if_pos hm1]; omega + have h_odd_f : (hasOdd (.p3z a :: .p5 :: suf) && decide (2 ≥ + 2 * 0 + epSum (.p3z a :: .p5 :: suf))) = false := by + rw [h_not_le, Bool.and_false] + rw [bool_if_false_eq_self (by simp [hmd0]), h_odd_f]; rfl + · intro fuel + have hf := hch fuel + dsimp only [invChain] at hf ⊢ + rw [if_neg ha, if_neg (show ¬(a = 1 ∧ 0 = 1 ∧ + ([] : List Nat) = []) by omega), if_pos rfl] at hf + rw [if_pos ⟨rfl, hepw0⟩] + have hnot : (!((0 : Nat) = 0 ∧ headP3zVal (.p3z a :: .p5 :: suf) = 0)) = true := by + dsimp [headP3zVal]; simp [show a ≠ 0 by omega] + rw [if_pos hnot] + dsimp only [headP3zVal, drop2L, drop1L] at hf ⊢ + exact hf + +theorem step_Inv_ModeB_ge3_cpos (ls : List LTok) (a c' : Nat) (ds : List Nat) + (hinv : Inv (.ModeB_ge3 ls a (c' + 1) ds)) : + Inv (.ModeE_ge2 (.p3z a :: ls) 0 c' ds) := by + have hc := hinv.1 + have hch := hinv.2 + dsimp only [invCore] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨h_guards, hc⟩ + simp only [Bool.or_eq_false_iff, not_bool_eq_false] at h_guards + rcases h_guards with ⟨⟨hgd, hds2⟩, hds1⟩ + by_cases ha : a % 2 = 0 + · rw [if_pos ha] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨heven, hc⟩ + rw [not_bool_eq_false] at heven + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hok_phi, hc⟩ + rw [not_bool_eq_false] at hok_phi + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hmd_bound, hodd_branch⟩ + have heven' : ValidEvenLs (.p3z a :: ls) = true := by + rw [ValidEvenLs_p3z_even_cons a ls ha]; exact heven + have hmd_eq := MustDrain_p3z_even_cons a ls ha + have hepsum_eq := epSum_p3z_even_cons a ls ha + have hep_eq := ep_p3z_even_cons a ls ha + have hodd_eq := hasOdd_p3z_even_cons a ls ha + have hds2' : checkDs2 (.ModeE_ge2 (.p3z a :: ls) 0 c' ds) = true := by + dsimp [checkDs2] at hds2 ⊢ + by_cases h2 : ds = [2] + · simp only [h2, not_true_eq_false, ↓reduceIte] at hds2 ⊢ + simp only [ha, decide_true, hasP5, hmd_eq, p5Suf, isHeadP5, Bool.not_false, + Bool.and_true, hepsum_eq, Nat.zero_add] at hds2 ⊢ + rw [show decide (a + epSum ls ≥ 2 * c' + 6) = decide (a + epSum ls ≥ 2 * (c' + 1) + 4) from + decide_eq_of_iff (by omega)] + simp only [Bool.and_eq_true] at hds2 ⊢ + exact ⟨hds2.1.1, hds2.2⟩ + · simp [h2] + have hds1' : checkDs1Phi1 (.ModeE_ge2 (.p3z a :: ls) 0 c' ds) = true := by + dsimp [checkDs1Phi1] at hds1 ⊢ + by_cases h1 : ds = [1] + · simp only [h1, not_true_eq_false, ↓reduceIte] at hds1 ⊢ + rw [if_pos ha, if_pos ha] at hds1 + have hnp5_a : isHeadP5 (.p3z a :: ls) = false := rfl + rw [hnp5_a] at hds1 ⊢ + simp only [Bool.false_eq_true, ↓reduceIte] + by_cases hp5 : isHeadP5 ls = true + · have h_ls : ∃ suf, ls = .p5 :: suf := by + cases ls with + | nil => cases hp5 + | cons t2 s2 => cases t2 with | p3z _ => cases hp5 | p5 => exact ⟨s2, rfl⟩ + obtain ⟨suf, rfl⟩ := h_ls + have hepw0 : epW (.p3z a :: .p5 :: suf) = 0 := by + dsimp [epW]; rw [if_neg (by omega)] + rw [hepw0, Nat.add_zero] + by_cases hc1 : c' = 1 + · subst hc1 + rw [hmd_eq] at hds1 ⊢ + rw [hepsum_eq] + simp only [isHeadP5, hasP5, MustDrain, ↓reduceIte, decide_true, Bool.not_true, + Bool.false_eq_true, + Bool.not_false, Bool.true_and, decide_eq_true_eq] at hds1 ⊢ + dsimp only [epSum] at hds1 ⊢ + omega + · rw [decide_eq_false hc1]; rfl + · have hp5_f : isHeadP5 ls = false := Bool.eq_false_iff.mpr hp5 + have hepw_eq := epW_p3z_even_cons a ls ha hp5_f + rw [hp5_f] at hds1 + simp only [Bool.false_eq_true, ↓reduceIte] at hds1 + have hpw_eq : c' + epW (.p3z a :: ls) = c' + 1 + epW ls := by omega + rw [hpw_eq] + by_cases he1 : c' + 1 + epW ls = 1 + · simp only [he1, decide_true, Bool.not_true, Bool.false_eq_true, ↓reduceIte] at hds1 ⊢ + simp only [hasP5, hmd_eq, Bool.not_false, Bool.and_true, hepsum_eq, + Nat.zero_add] at hds1 ⊢ + rw [show decide (a + epSum ls ≥ 2 * c' + 14) = + decide (a + epSum ls ≥ 2 * (c' + 1) + 12) from + decide_eq_of_iff (by omega)] + exact hds1 + · rw [decide_eq_false he1]; rfl + · simp [h1] + have h_not_p3z1 : isHeadP3z1 (.p3z a :: ls) = false := by + dsimp [isHeadP3z1] + by_cases h1 : a = 1 + · omega + · simp [h1] + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs ds || !checkDs2 (.ModeE_ge2 (.p3z a :: ls) 0 c' ds) || + !checkDs1Phi1 (.ModeE_ge2 (.p3z a :: ls) 0 c' ds)) = false := by + simp [hgd, hds2', hds1'] + rw [bool_if_false_eq_self h_g, if_pos rfl, not_bool_if_false_eq_true heven'] + by_cases hp5 : isHeadP5 ls = true + · have h_ls : ∃ suf, ls = .p5 :: suf := by + cases ls with + | nil => cases hp5 + | cons t2 s2 => cases t2 with | p3z _ => cases hp5 | p5 => exact ⟨s2, rfl⟩ + obtain ⟨suf, rfl⟩ := h_ls + dsimp [isHeadP5] at hok_phi + have hpref0 : prefSumW (.p3z a :: .p5 :: suf) = 0 := by + dsimp [prefSumW]; rw [if_neg (by omega)] + have hepw0 : epW (.p3z a :: .p5 :: suf) = 0 := by + dsimp [epW]; rw [if_neg (by omega)] + rw [hpref0, not_decide_if_false_eq_true (by omega)] + have hphiw' : GoodPhiW (c' + epW (.p3z a :: .p5 :: suf)) ds + (isHeadP3z1 (.p3z a :: .p5 :: suf) && decide (0 = 0 ∧ c' = 0 ∧ ds = [])) = true := by + rw [hepw0, Nat.add_zero] + exact GoodPhiW_mono _ _ _ hok_phi + have hok_phi' : (if (!isHeadP5 (.p3z a :: .p5 :: suf)) = true then + (decide (ds = [] ∧ + c' + epW (.p3z a :: .p5 :: suf) = 1) && MustDrain (.p3z a :: .p5 :: suf) && + decide (c' + ep (.p3z a :: .p5 :: suf) = 1 ∧ + 0 + epSum (.p3z a :: .p5 :: suf) + 2 * ep (.p3z a :: .p5 :: suf) = 2) && + hasP5 (.p3z a :: .p5 :: suf) && decide (preP5Val (.p3z a :: .p5 :: suf) ≥ 16 ∧ + z0 (p5Suf (.p3z a :: .p5 :: suf)) ≥ 38)) || + GoodPhiW (c' + + epW (.p3z a :: .p5 :: suf)) ds (isHeadP3z1 (.p3z a :: .p5 :: suf) && decide (0 = 0 ∧ + c' = 0 ∧ ds = [])) + else + decide (c' = 0 ∧ ds = [] ∧ + (0 : Nat) = 2) || (decide (c' ≥ 1) && GoodPhiW (c' - 1) ds false)) = true := by + have hnp5_t : (!isHeadP5 (.p3z a :: .p5 :: suf)) = true := rfl + rw [if_pos hnp5_t, hphiw', Bool.or_true] + rw [not_bool_if_false_eq_true hok_phi'] + have hmd0 : MustDrain (.p3z a :: .p5 :: suf) = false := by + rw [MustDrain_p3z_even_cons a (.p5 :: suf) ha]; rfl + have hodd0 : hasOdd (.p3z a :: .p5 :: suf) = false := by + rw [hasOdd_p3z_even_cons a (.p5 :: suf) ha]; rfl + have h_rst_false : (decide ((0 : Nat) = 0 ∧ c' = 0 ∧ + ds = []) && isHeadP3z1 (.p3z a :: .p5 :: suf)) = false := by + rw [h_not_p3z1, Bool.and_false] + rw [bool_if_false_eq_self (by simp [hmd0]), h_rst_false] + simp only [Bool.false_eq_true, ↓reduceIte, Bool.not_true] + rw [if_neg (by simp [hodd0])] + · have hp5_f : isHeadP5 ls = false := Bool.eq_false_iff.mpr hp5 + rw [if_pos (by rw [hp5_f]; rfl)] at hok_phi + simp only [Bool.and_eq_true, decide_eq_true_eq] at hok_phi + rcases hok_phi with ⟨⟨hpref_le, hphi_or⟩, _⟩ + have hepw_eq := epW_p3z_even_cons a ls ha hp5_f + have hpref_eq := prefSumW_p3z_even_cons a ls ha hp5_f + have hpre_eq := preP5Val_p3z_cons_of_not_headP5 a ls hp5_f + have h_b_pref : 0 ≤ 2 * c' + 4 ∧ 0 + prefSumW (.p3z a :: ls) ≤ 2 * c' + 6 := by omega + rw [not_decide_if_false_eq_true h_b_pref] + have hok_phi' : (if (!isHeadP5 (.p3z a :: ls)) = true then + (decide (ds = [] ∧ c' + epW (.p3z a :: ls) = 1) && MustDrain (.p3z a :: ls) && + decide (c' + ep (.p3z a :: ls) = 1 ∧ + 0 + epSum (.p3z a :: ls) + 2 * ep (.p3z a :: ls) = 2) && + hasP5 (.p3z a :: ls) && decide (preP5Val (.p3z a :: ls) ≥ 16 ∧ + z0 (p5Suf (.p3z a :: ls)) ≥ 38)) || + GoodPhiW (c' + epW (.p3z a :: ls)) ds (isHeadP3z1 (.p3z a :: ls) && decide (0 = 0 ∧ + c' = 0 ∧ ds = [])) + else + decide (c' = 0 ∧ ds = [] ∧ + (0 : Nat) = 2) || (decide (c' ≥ 1) && GoodPhiW (c' - 1) ds false)) = true := by + have hnp5_t : (!isHeadP5 (.p3z a :: ls)) = true := rfl + rw [if_pos hnp5_t] + cases Bool.or_eq_true_iff.mp hphi_or with + | inl hphi1 => + apply Bool.or_inl + rw [hmd_eq, hpre_eq] + simp only [hasP5, p5Suf] + rw [show decide (ds = [] ∧ c' + epW (.p3z a :: ls) = 1) = decide (ds = [] ∧ + c' + 1 + epW ls = 1) from + decide_eq_of_iff ⟨fun ⟨h1, h2⟩ => ⟨h1, by omega⟩, fun ⟨h1, h2⟩ => ⟨h1, by omega⟩⟩] + rw [show decide (c' + ep (.p3z a :: ls) = 1 ∧ + 0 + epSum (.p3z a :: ls) + 2 * ep (.p3z a :: ls) = 2) = + decide (c' + 1 + ep ls = 1 ∧ a + epSum ls + 2 * ep ls + 2 = 2) from + decide_eq_of_iff (by omega)] + exact hphi1 + | inr hphiw => + apply Bool.or_inr + have hpw_eq : c' + epW (.p3z a :: ls) = c' + 1 + epW ls := by omega + rw [hpw_eq] + exact GoodPhiW_mono _ _ _ hphiw + rw [not_bool_if_false_eq_true hok_phi'] + have hmd_bound' : (MustDrain (.p3z a :: ls) && + decide (2 * c' + 4 < 0 + epSum (.p3z a :: ls))) = false := by + rw [hmd_eq, hepsum_eq] + rw [show decide (2 * c' + 4 < 0 + (a + epSum ls)) = + decide (2 * (c' + 1) + 2 < a + epSum ls) from + decide_eq_of_iff (by omega)] + exact hmd_bound + rw [bool_if_false_eq_self hmd_bound'] + have h_rst_false : (decide ((0 : Nat) = 0 ∧ c' = 0 ∧ + ds = []) && isHeadP3z1 (.p3z a :: ls)) = false := by + rw [h_not_p3z1, Bool.and_false] + rw [h_rst_false] + simp only [Bool.false_eq_true, ↓reduceIte, Bool.not_true] + rw [hodd_eq, hepsum_eq] + have hd_odd : decide (2 * c' + 4 ≥ 0 + (a + epSum ls)) = + decide (2 * (c' + 1) + 2 ≥ a + epSum ls) := + decide_eq_of_iff (by omega) + rw [hd_odd] + by_cases h_cond : (hasOdd ls && decide (2 * (c' + 1) + 2 ≥ a + epSum ls)) = true + · rw [if_pos h_cond] at hodd_branch ⊢ + have hpsi_eq : c' + ep (.p3z a :: ls) = c' + 1 + ep ls := by omega + have hxi_eq : 0 + (a + epSum ls) + 2 * ep (.p3z a :: ls) = + a + epSum ls + 2 * ep ls + 2 := by omega + rw [hpsi_eq, hxi_eq, hmd_eq, hpre_eq] + simp only [hasP5, p5Suf] + exact hodd_branch + · rw [if_neg h_cond] + · intro fuel + have hf := hch fuel + dsimp only [invChain] at hf ⊢ + rw [if_pos ha, if_neg (show ¬(isHeadP5 ls = true ∧ c' + 1 = 0 ∧ a ≥ 22) by omega)] at hf + rw [if_pos rfl, if_neg (by simp [h_not_p3z1])] + have hm_eq : 2 * c' + 4 = 2 * (c' + 1) + 2 := by omega + rw [hm_eq] + exact hf + · have hm1 : a % 2 = 1 := by omega + rw [if_neg ha] at hc + rw [prop_if_false_eq_true] at hc + rcases hc with ⟨_, hc⟩ + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨heven, hc⟩ + rw [not_bool_eq_false] at heven + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hok_c1, hc⟩ + rw [not_bool_eq_false] at hok_c1 + rw [ if_pos (show c' + 1 ≥ 1 by omega) ] at hok_c1 + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hmd_bound, hodd_branch⟩ + have hepw0 : epW (.p3z a :: ls) = 0 := by dsimp [epW]; rw [if_pos hm1] + have hpref0 : prefSumW (.p3z a :: ls) = 0 := by dsimp [prefSumW]; rw [if_pos hm1] + have hep0 : ep (.p3z a :: ls) = 0 := by dsimp [ep]; rw [if_pos hm1] + have hepsum_odd : epSum (.p3z a :: ls) = a - 1 := by dsimp [epSum]; rw [if_pos hm1] + have hodd_true : hasOdd (.p3z a :: ls) = true := by dsimp [hasOdd]; rw [if_pos hm1] + have hds2' : checkDs2 (.ModeE_ge2 (.p3z a :: ls) 0 c' ds) = true := by + dsimp [checkDs2] at hds2 ⊢ + by_cases h2 : ds = [2] + · simp [h2, ha] at hds2 + · simp [h2] + have hds1' : checkDs1Phi1 (.ModeE_ge2 (.p3z a :: ls) 0 c' ds) = true := by + dsimp [checkDs1Phi1] at hds1 ⊢ + by_cases h1 : ds = [1] + · simp only [h1, not_true_eq_false, ↓reduceIte] at hds1 ⊢ + rw [if_neg ha, if_neg ha] at hds1 + have hnp5_a : isHeadP5 (.p3z a :: ls) = false := rfl + rw [hnp5_a] at hds1 ⊢ + simp only [Bool.false_eq_true, ↓reduceIte, Bool.not_false, Bool.and_true] at hds1 ⊢ + rw [hepw0, Nat.add_zero] + by_cases hc1 : c' = 1 + · subst hc1 + simp only [decide_true, Bool.not_true, Bool.false_eq_true, ↓reduceIte] at hds1 ⊢ + rw [hepsum_odd, Nat.zero_add] + rw [show decide (a - 1 ≥ 2 * 1 + 14) = decide (a ≥ 2 * (1 + 1) + 13) from + decide_eq_of_iff (by omega)] + exact hds1 + · rw [decide_eq_false hc1]; rfl + · simp [h1] + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs ds || !checkDs2 (.ModeE_ge2 (.p3z a :: ls) 0 c' ds) || + !checkDs1Phi1 (.ModeE_ge2 (.p3z a :: ls) 0 c' ds)) = false := by + simp [hgd, hds2', hds1'] + rw [bool_if_false_eq_self h_g, if_pos rfl, not_bool_if_false_eq_true heven] + rw [hpref0, not_decide_if_false_eq_true (by omega)] + by_cases hrst : a = 1 ∧ c' = 0 ∧ ds = [] + · rcases hrst with ⟨rfl, rfl, rfl⟩ + have hok_phi' : (if (!isHeadP5 (.p3z 1 :: ls)) = true then + (decide (([] : List Nat) = [] ∧ + 0 + epW (.p3z 1 :: ls) = 1) && MustDrain (.p3z 1 :: ls) && + decide (0 + ep (.p3z 1 :: ls) = 1 ∧ + 0 + epSum (.p3z 1 :: ls) + 2 * ep (.p3z 1 :: ls) = 2) && + hasP5 (.p3z 1 :: ls) && decide (preP5Val (.p3z 1 :: ls) ≥ 16 ∧ + z0 (p5Suf (.p3z 1 :: ls)) ≥ 38)) || + GoodPhiW (0 + epW (.p3z 1 :: ls)) [] (isHeadP3z1 (.p3z 1 :: ls) && decide (0 = 0 ∧ + 0 = 0 ∧ ([] : List Nat) = [])) + else + decide ((0 : Nat) = 0 ∧ ([] : List Nat) = [] ∧ + (0 : Nat) = 2) || (decide (0 ≥ 1) && GoodPhiW (0 - 1) [] false)) = true := by + have hnp5_t : (!isHeadP5 (.p3z 1 :: ls)) = true := rfl + rw [if_pos hnp5_t, hepw0] + dsimp [isHeadP3z1, GoodPhiW] + simp + rw [not_bool_if_false_eq_true hok_phi'] + have hmd_false : (MustDrain (.p3z 1 :: ls) && decide (2 * 0 + 4 < 0 + + epSum (.p3z 1 :: ls))) = false := by + rw [hepsum_odd]; simp + rw [bool_if_false_eq_self hmd_false] + have hrst_true : (decide ((0 : Nat) = 0 ∧ (0 : Nat) = 0 ∧ + ([] : List Nat) = []) && isHeadP3z1 (.p3z 1 :: ls)) = true := rfl + rw [hrst_true] + rw [if_neg (by decide)] at hok_c1 + dsimp only [drop1L] + cases ls <;> simp [hok_c1] + · have hrst_b : decide (a = 1 ∧ c' + 1 = 1 ∧ ds = []) = false := by + rw [decide_eq_false_iff_not] + intro ⟨h1, h2, h3⟩ + exact hrst ⟨h1, by omega, h3⟩ + have hrst_e : (decide ((0 : Nat) = 0 ∧ c' = 0 ∧ + ds = []) && isHeadP3z1 (.p3z a :: ls)) = false := by + dsimp [isHeadP3z1] + by_cases ha1 : a = 1 + · subst ha1 + have hnot : decide ((0 : Nat) = 0 ∧ c' = 0 ∧ ds = []) = false := + decide_eq_false (fun ⟨_, hc0, hds⟩ => hrst ⟨rfl, hc0, hds⟩) + rw [hnot]; rfl + · simp [ha1] + have hstart_e : (isHeadP3z1 (.p3z a :: ls) && decide ((0 : Nat) = 0 ∧ c' = 0 ∧ + ds = [])) = false := by + rw [Bool.and_comm]; exact hrst_e + rw [hrst_b] at hok_c1 + simp only [Bool.not_false, ↓reduceIte] at hok_c1 + have hok_phi' : (if (!isHeadP5 (.p3z a :: ls)) = true then + (decide (ds = [] ∧ c' + epW (.p3z a :: ls) = 1) && MustDrain (.p3z a :: ls) && + decide (c' + ep (.p3z a :: ls) = 1 ∧ + 0 + epSum (.p3z a :: ls) + 2 * ep (.p3z a :: ls) = 2) && + hasP5 (.p3z a :: ls) && decide (preP5Val (.p3z a :: ls) ≥ 16 ∧ + z0 (p5Suf (.p3z a :: ls)) ≥ 38)) || + GoodPhiW (c' + epW (.p3z a :: ls)) ds (isHeadP3z1 (.p3z a :: ls) && decide (0 = 0 ∧ + c' = 0 ∧ ds = [])) + else + decide (c' = 0 ∧ ds = [] ∧ + (0 : Nat) = 2) || (decide (c' ≥ 1) && GoodPhiW (c' - 1) ds false)) = true := by + have hnp5_t : (!isHeadP5 (.p3z a :: ls)) = true := rfl + rw [if_pos hnp5_t, hepw0, hep0, hepsum_odd, hstart_e] + cases Bool.or_eq_true_iff.mp hok_c1 with + | inl hphi1 => + apply Bool.or_inl + simp only [Bool.and_eq_true, decide_eq_true_eq, and_assoc] at hphi1 ⊢ + simp only [Nat.add_zero, Nat.zero_add, Nat.mul_zero, hasP5, p5Suf] at hphi1 ⊢ + rcases hphi1 with ⟨rfl, hc2, rfl, hmd, hp5, hpre, hz⟩ + have hc1 : c' = 1 := by omega + subst hc1 + exact ⟨rfl, rfl, hmd, rfl, rfl, hp5, hpre, hz⟩ + | inr hphiw => + rw [Nat.add_sub_cancel] at hphiw + rw [Nat.add_zero] + exact Bool.or_inr hphiw + rw [not_bool_if_false_eq_true hok_phi'] + have hmd_bound' : (MustDrain (.p3z a :: ls) && + decide (2 * c' + 4 < 0 + epSum (.p3z a :: ls))) = false := by + rw [hepsum_odd] + rw [show decide (2 * c' + 4 < 0 + (a - 1)) = decide (a > 2 * (c' + 1) + 3) from + decide_eq_of_iff (by omega)] + exact hmd_bound + rw [bool_if_false_eq_self hmd_bound'] + rw [hrst_e] + simp only [Bool.false_eq_true, ↓reduceIte, Bool.not_true] + simp only [hodd_true, hepsum_odd, hep0, Nat.add_zero, Nat.zero_add, Nat.mul_zero, + Bool.true_and] + rw [show decide (2 * c' + 4 ≥ a - 1) = decide (a ≤ 2 * (c' + 1) + 3) from + decide_eq_of_iff (by omega)] + by_cases h_le : a ≤ 2 * (c' + 1) + 3 + · rw [if_pos h_le, hrst_b] at hodd_branch + simp only [Bool.false_eq_true, ↓reduceIte, Nat.add_sub_cancel] at hodd_branch + rw [if_pos (decide_eq_true h_le)] + have hp5_eq : hasP5 (.p3z a :: ls) = hasP5 ls := rfl + have hpsuf_eq : p5Suf (.p3z a :: ls) = p5Suf ls := rfl + rw [hp5_eq, hpsuf_eq] + rw [show decide (a - 1 ≥ 36) = decide (a ≥ 37) from decide_eq_of_iff (by omega)] + rw [show decide (a - 1 ≥ 16) = decide (a ≥ 17) from decide_eq_of_iff (by omega)] + rw [show decide (a - 1 ≥ 14 ∧ c' ≥ 7) = decide (a ≥ 15 ∧ c' ≥ 7) from + decide_eq_of_iff (by omega)] + rw [show decide (ds = [] ∧ c' = 1 ∧ a - 1 = 2 ∧ preP5Val (.p3z a :: ls) ≥ 16 ∧ + z0 (p5Suf ls) ≥ 38) = + decide (ds = [] ∧ c' = 1 ∧ a = 3 ∧ preP5Val (.p3z a :: ls) ≥ 16 ∧ + z0 (p5Suf ls) ≥ 38) from + decide_eq_of_iff ⟨fun ⟨h1, h2, h3, h4, h5⟩ => ⟨h1, h2, by omega, h4, h5⟩, + fun ⟨h1, h2, h3, h4, h5⟩ => ⟨h1, h2, by omega, h4, h5⟩⟩] + exact hodd_branch + · rw [decide_eq_false h_le]; rfl + · intro fuel + have hf := hch fuel + dsimp only [invChain] at hf ⊢ + rw [if_neg ha] at hf + rw [if_pos rfl] + by_cases hrst : a = 1 ∧ c' = 0 ∧ ds = [] + · rcases hrst with ⟨rfl, rfl, rfl⟩ + rw [if_pos ⟨rfl, rfl, rfl⟩] at hf + rw [if_pos ⟨rfl, rfl, rfl, rfl⟩] + dsimp only [drop1L] + cases ls <;> exact hf + · rw [if_neg (fun ⟨h1, h2, h3⟩ => hrst ⟨h1, + by omega, h3⟩), if_neg (Nat.succ_ne_zero c')] at hf + have hnot_e : ¬((0 : Nat) = 0 ∧ c' = 0 ∧ ds = [] ∧ isHeadP3z1 (.p3z a :: ls) = true) := by + dsimp [isHeadP3z1] + by_cases ha1 : a = 1 + · subst ha1 + exact fun ⟨_, hc0, hds, _⟩ => hrst ⟨rfl, hc0, hds⟩ + · simp [ha1] + rw [if_neg hnot_e] + have hm_eq : 2 * c' + 4 = 2 * (c' + 1) + 2 := by omega + rw [hm_eq] + exact hf + +theorem ValidEvenLs_p5Suf (ls : List LTok) (heven : ValidEvenLs ls = true) (hp5 : hasP5 ls = true) : + z0 (p5Suf ls) ≥ 18 ∧ ValidP5Chain (p5Suf ls) = true := by + induction ls with + | nil => cases hp5 + | cons tok rest ih => + cases tok with + | p5 => + dsimp [ValidEvenLs, p5Suf] at heven ⊢ + simp only [Bool.and_eq_true, decide_eq_true_eq] at heven + exact heven + | p3z m => + dsimp [ValidEvenLs] at heven + dsimp [hasP5, p5Suf] at hp5 ⊢ + split_ifs at heven with hm + · exact ih heven hp5 + · cases rest with + | nil => cases hp5 + | cons t2 s2 => + cases t2 with + | p5 => + dsimp [ValidAfterOdd] at heven + simp only [Bool.and_eq_true, decide_eq_true_eq] at heven + exact heven + | p3z m2 => + cases s2 with + | nil => cases heven + | cons t3 s3 => + cases t3 with + | p3z _ => cases heven + | p5 => + dsimp [ValidAfterOdd] at heven + simp only [Bool.and_eq_true, decide_eq_true_eq] at heven + exact heven + +theorem ValidP5Chain_p3z_p5 (m : Nat) (suf : List LTok) (hz : z0 suf ≥ 18) (hv : ValidP5Chain suf = + true) : + ValidP5Chain (.p3z m :: .p5 :: suf) = true := by + cases m with + | zero => dsimp [ValidP5Chain]; simp [hz, hv] + | succ m' => dsimp [ValidP5Chain]; simp [hz, hv] + +theorem ValidP5Chain_of_ValidEvenLs_z0Rep (ls : List LTok) + (heven : ValidEvenLs ls = true) (hpref : prefSumW ls = 0) + (hmd : MustDrain ls = false) (hnp5 : isHeadP5 ls = false) : + ValidP5Chain ls = true ∧ z0 ls ≥ epW ls := by + obtain ⟨hls, _⟩ := ls_eq_z0Rep_of_prefSumW_zero ls heven hpref hmd hnp5 + cases hp5 : hasP5 ls with + | false => + rw [hp5, if_neg Bool.false_ne_true] at hls + refine ⟨?_, ?_⟩ + · rw [hls, ValidP5Chain_z0Rep]; rfl + · have hz := congrArg z0 hls + rw [z0_z0Rep] at hz; dsimp [z0] at hz; omega + | true => + rw [hp5, if_pos rfl] at hls + obtain ⟨hz18, hv⟩ := ValidEvenLs_p5Suf ls heven hp5 + refine ⟨?_, ?_⟩ + · rw [hls, ValidP5Chain_z0Rep] + exact ValidP5Chain_p3z_p5 _ _ hz18 hv + · have hz := congrArg z0 hls + rw [z0_z0Rep] at hz; omega + +theorem GoodDs_d1_valid {d : Nat} (hd : d ≥ 3) (h : GoodDs [d] = true) : d ≥ 8 := by + dsimp [GoodDs, GoodDsAux, GoodDs1] at h + simp only [decide_eq_true_eq] at h + omega + +theorem GoodDs_pair_d2_cases {d d2 : Nat} {ds2 : List Nat} (h : GoodDs (d :: d2 :: ds2) = true) : + (d2 = 0 ∧ ds2 = [] ∧ d ≥ 8) ∨ + (d2 = 1 ∧ ds2 = [] ∧ (d = 3 ∨ d ≥ 25)) ∨ + (d2 ≥ 3 ∧ d ≥ 17 ∧ GoodDs (d2 :: ds2) = true ∧ + (d % 2 = 0 ∧ d ≤ 2 * d2 + 4 → GoodDs ((d2 - 1) :: ds2) = true) ∧ + (d % 2 = 0 ∧ d + 14 ≤ 2 * d2 → GoodDs ((d2 - 2) :: ds2) = true)) := by + cases ds2 with + | nil => + dsimp [GoodDs, GoodDsAux, GoodDs2] at h + by_cases h0 : d2 = 0 + · subst h0; simp only [↓reduceIte, decide_eq_true_eq] at h; exact Or.inl ⟨rfl, rfl, h⟩ + · by_cases h1 : d2 = 1 + · subst h1; simp only [Nat.one_ne_zero, ↓reduceIte, + decide_eq_true_eq] at h; exact Or.inr (Or.inl ⟨rfl, rfl, h⟩) + · by_cases h3 : d2 < 3 + · simp [h0, h1, h3] at h + · rw [if_neg h0, if_neg h1, if_neg h3] at h + rw [bool_if_false_eq_true] at h; rcases h with ⟨_, h⟩ + rw [bool_if_false_eq_true] at h; rcases h with ⟨hd17_gd, h⟩ + simp only [Bool.or_eq_false_iff, decide_eq_false_iff_not, not_bool_eq_false] at hd17_gd + rw [bool_if_false_eq_true] at h; rcases h with ⟨hsub1, hsub2⟩ + rw [bool_if_false_eq_true] at hsub2; rcases hsub2 with ⟨hsub2, _⟩ + refine Or.inr (Or.inr ⟨by omega, by omega, hd17_gd.2, ?_, ?_⟩) + · intro hc1 + rw [decide_eq_true hc1, Bool.true_and, not_bool_eq_false] at hsub1 + exact hsub1 + · intro hc2 + rw [decide_eq_true hc2, Bool.true_and, not_bool_eq_false] at hsub2 + exact hsub2 + | cons d3 ds3 => + dsimp [GoodDs, GoodDsAux] at h + by_cases h3 : d2 < 3 + · rw [if_pos h3] at h; cases h + · rw [if_neg h3] at h + rw [bool_if_false_eq_true] at h; rcases h with ⟨_, h⟩ + rw [bool_if_false_eq_true] at h; rcases h with ⟨_, h⟩ + rw [bool_if_false_eq_true] at h; rcases h with ⟨_, h⟩ + rw [bool_if_false_eq_true] at h; rcases h with ⟨hd17_gd, h⟩ + simp only [Bool.or_eq_false_iff, decide_eq_false_iff_not, not_bool_eq_false] at hd17_gd + rw [bool_if_false_eq_true] at h; rcases h with ⟨hsub1, hsub2⟩ + rw [bool_if_false_eq_true] at hsub2; rcases hsub2 with ⟨hsub2, _⟩ + refine Or.inr (Or.inr ⟨by omega, by omega, hd17_gd.2, ?_, ?_⟩) + · intro hc1 + rw [decide_eq_true hc1, Bool.true_and, not_bool_eq_false] at hsub1 + exact hsub1 + · intro hc2 + rw [decide_eq_true hc2, Bool.true_and, not_bool_eq_false] at hsub2 + exact hsub2 + +theorem GoodDs_d31 {d : Nat} (h : GoodDs [d, 3, 1] = true) : d ≥ 19 := by + dsimp [GoodDs, GoodDsAux] at h + by_contra hlt + have hdec : decide (3 = 3 ∧ 1 = 1 ∧ ([] : List Nat) = [] ∧ d < 19) = true := + decide_eq_true ⟨rfl, rfl, rfl, by omega⟩ + rw [if_pos hdec] at h + cases h + +theorem GoodDs_d_ge25_1 {d d2 : Nat} (hd2 : d2 ≥ 25) (h : GoodDs [d, d2, 1] = true) : d ≥ 39 := by + dsimp [GoodDs, GoodDsAux] at h + by_contra hlt + have hdec : decide (d2 ≥ 25 ∧ 1 = 1 ∧ ([] : List Nat) = [] ∧ d < 39) = true := + decide_eq_true ⟨hd2, rfl, rfl, by omega⟩ + rw [if_neg (by omega)] at h + rw [bool_if_false_eq_true] at h; rcases h with ⟨_, h⟩ + rw [bool_if_false_eq_true] at h; rcases h with ⟨_, h⟩ + rw [if_pos hdec] at h + cases h + +theorem GoodDs_isOddDrainDs_ge19 {d2 : Nat} {ds2 : List Nat} (hd2 : d2 ≥ 3) + (hod : isOddDrainDs ds2 = true) (h : GoodDs (d2 :: ds2) = true) : d2 ≥ 19 := by + cases ds2 with + | nil => cases hod + | cons d3 ds3 => + cases ds3 with + | nil => + dsimp [isOddDrainDs] at hod + dsimp [GoodDs, GoodDsAux, GoodDs2] at h + have hd3 : d3 ≥ 3 := by + dsimp [isOddDrain1] at hod; simp only [decide_eq_true_eq] at hod; omega + rw [if_neg (by omega), if_neg (by omega), if_neg (by omega)] at h + by_contra hlt + have hdec : (isOddDrain1 d3 && decide (d2 < 19)) = true := by + simp [hod, show d2 < 19 by omega] + rw [if_pos hdec] at h; cases h + | cons d4 ds4 => + dsimp [GoodDs, GoodDsAux] at h + have hd3 : d3 ≥ 3 := by + cases ds4 with + | nil => + cases d4 with + | zero => dsimp [isOddDrainDs, + isOddDrain1] at hod; simp only [decide_eq_true_eq] at hod; omega + | succ _ => cases hod + | cons _ _ => + cases d4 <;> cases hod + rw [if_neg (by omega)] at h + rw [bool_if_false_eq_true] at h; rcases h with ⟨_, h⟩ + by_contra hlt + have hdec : (isOddDrainDs (d3 :: d4 :: ds4) && decide (d2 < 19)) = true := by + simp [hod, show d2 < 19 by omega] + rw [if_pos hdec] at h; cases h + +theorem GoodPhiW_of_GoodDs_sub2 {d2 : Nat} {ds2 : List Nat} (hd2 : d2 ≥ 3) (h : GoodDs (d2 :: ds2) = + true) : + GoodPhiW (d2 - 2) ds2 false = true := by + cases ds2 with + | nil => + have hd8 := GoodDs_d1_valid hd2 h + dsimp [GoodPhiW]; simp; omega + | cons d3 ds3 => + rcases GoodDs_pair_d2_cases h with ⟨rfl, rfl, hd8⟩ | ⟨rfl, rfl, hd_or⟩ | ⟨hd3_ge3, hd2_17, _, _, + _⟩ + · dsimp [GoodPhiW]; simp; omega + · dsimp [GoodPhiW]; simp; omega + · dsimp [GoodPhiW] + rw [if_neg (by intro heq; injection heq with h1 _; omega)] + rw [if_neg (by intro heq; injection heq with h1 _; omega)] + rw [if_neg (by intro heq; injection heq with h1 _; omega)] + split_ifs with h_25 hod + · cases ds3 with + | nil => + change false = true at h_25; cases h_25 + | cons d4 ds4 => + cases ds4 with + | nil => + cases d4 with + | zero => + change false = true at h_25; cases h_25 + | succ d4' => + cases d4' with + | zero => + have hd3_25 : d3 ≥ 25 := of_decide_eq_true h_25 + have hd39 := GoodDs_d_ge25_1 hd3_25 h + simp; omega + | succ _ => + change false = true at h_25; cases h_25 + | cons _ _ => + cases d4 with + | zero => + change false = true at h_25; cases h_25 + | succ d4' => + cases d4' with + | zero => + change false = true at h_25; cases h_25 + | succ _ => + change false = true at h_25; cases h_25 + · have hd19 := GoodDs_isOddDrainDs_ge19 hd2 hod h + simp; omega + · simp; omega + +theorem checkChainAux_B_ge3_c0_ok_ge22 (fuel a : Nat) (suf : List LTok) (ha : a ≥ 22) : + checkChainAux fuel true (.p3z a :: .p5 :: suf) 0 0 2 [] = true := by + cases fuel with + | zero => rfl + | succ fuel => + have hdec : decide (2 ≥ 0 + epSum (.p3z a :: .p5 :: suf)) = false := by + dsimp [epSum]; split_ifs <;> (rw [decide_eq_false_iff_not]; omega) + have hnp5 : isHeadP5 (.p3z a :: .p5 :: suf) = false := rfl + have hepw0 : epW (.p3z a :: .p5 :: suf) = 0 := by + dsimp [epW]; split_ifs <;> rfl + dsimp only [checkChainAux] + rw [hdec, hnp5, hepw0] + simp + +theorem GoodDs_tail_any {d : Nat} {ds : List Nat} (h : GoodDs (d :: ds) = true) : + GoodDs ds = true ∧ ds ≠ [2] := by + cases ds with + | nil => exact ⟨rfl, by decide⟩ + | cons d2 ds2 => + rcases GoodDs_pair_d2_cases h with ⟨rfl, rfl, _⟩ | ⟨rfl, rfl, _⟩ | ⟨hd2_3, _, hgd2, _, _⟩ + · exact ⟨rfl, by decide⟩ + · exact ⟨rfl, by decide⟩ + · exact ⟨hgd2, by intro heq; injection heq with h1 _; omega⟩ + +theorem step_Inv_ModeB_b2_mge2 (ls : List LTok) (m'' : Nat) (ds : List Nat) + (hinv : Inv (.ModeB_b2 ls (m'' + 2) ds)) : + Inv (nextState (.ModeB_b2 ls (m'' + 2) ds)) := by + have hc := hinv.1 + have hch := hinv.2 + dsimp only [invCore] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨h_guards, hc⟩ + simp only [Bool.or_eq_false_iff, not_bool_eq_false] at h_guards + rcases h_guards with ⟨_, heven⟩ + rw [if_pos (show m'' + 2 ≥ 2 by omega)] at hc + simp only [Bool.and_eq_true, decide_eq_true_eq] at hc + rcases hc with ⟨⟨rfl, hm4⟩, hp5⟩ + cases ls with + | nil => cases hp5 + | cons tok suf => + cases tok with + | p3z _ => cases hp5 + | p5 => + dsimp [ValidEvenLs] at heven + simp only [Bool.and_eq_true, decide_eq_true_eq] at heven + rcases heven with ⟨hz18, hvp5⟩ + have hm'3 : m'' + 1 ≥ 3 := by omega + have h_eq_m : m'' + 2 = (m'' + 1) + 1 := rfl + rw [h_eq_m] + dsimp only [nextState] + have hvp5' : ValidP5Chain (.p3z (m'' + 1) :: .p5 :: suf) = true := + ValidP5Chain_p3z_p5 (m'' + 1) suf hz18 hvp5 + have hcond : ([] : List Nat) = [] ∧ (1 : Nat) = 1 ∧ (1 : Nat) = 1 ∧ + isP3zP5 (.p3z (m'' + 1) :: .p5 :: suf) = true ∧ + headP3zVal (.p3z (m'' + 1) :: .p5 :: suf) ≥ 3 := + ⟨rfl, rfl, rfl, rfl, hm'3⟩ + refine ⟨?_, ?_⟩ + · dsimp [invCore, GoodDs, checkDs2, checkDs1Phi1] + rw [hvp5'] + simp [hcond] + · intro fuel + have hf := hch fuel + dsimp [invChain] at hf ⊢ + rw [if_pos hcond] + dsimp [headP3zVal, drop2L, drop1L] at hf ⊢ + have hm_sub : m'' + 1 - 2 = m'' + 2 - 3 := by omega + rw [hm_sub] + exact hf + +theorem step_Inv_ModeB_b2_m1 (ls : List LTok) (ds : List Nat) + (hinv : Inv (.ModeB_b2 ls 1 ds)) : + Inv (nextState (.ModeB_b2 ls 1 ds)) := by + have hc := hinv.1 + have hch := hinv.2 + dsimp only [invCore] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨h_guards, hc⟩ + simp only [Bool.or_eq_false_iff, not_bool_eq_false] at h_guards + rcases h_guards with ⟨⟨⟨hgd, hds2⟩, hds1⟩, heven⟩ + rw [if_neg (show ¬((1 : Nat) ≥ 2) by omega)] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hok_phi, hc⟩ + rw [not_bool_eq_false] at hok_phi + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hmd_bound, _⟩ + by_cases h_emp : ds = [] ∧ epW ls = 0 + · rcases h_emp with ⟨rfl, hepw0⟩ + rw [if_pos ⟨rfl, hepw0⟩] at hok_phi + simp only [Bool.and_eq_true, decide_eq_true_eq] at hok_phi + rcases hok_phi with ⟨⟨_, hp3zp5⟩, hm0_18, hz38⟩ + have h_ls : ∃ m0 suf, ls = .p3z m0 :: .p5 :: suf := by + cases ls with + | nil => cases hp3zp5 + | cons t1 r1 => + cases t1 with + | p5 => cases hp3zp5 + | p3z m0 => + cases r1 with + | nil => cases hp3zp5 + | cons t2 suf => + cases t2 with + | p3z _ => cases hp3zp5 + | p5 => exact ⟨m0, suf, rfl⟩ + obtain ⟨m0, suf, rfl⟩ := h_ls + dsimp [headP3zVal, p5Suf] at hm0_18 hz38 + obtain ⟨hz18, hvp5⟩ := ValidEvenLs_p5Suf (.p3z m0 :: .p5 :: suf) heven rfl + dsimp [p5Suf] at hz18 hvp5 + dsimp only [nextState] + have hvp5' : ValidP5Chain (.p3z 0 :: .p3z m0 :: .p5 :: suf) = true := by + dsimp [ValidP5Chain]; exact ValidP5Chain_p3z_p5 m0 suf hz18 hvp5 + have hz0_eq : z0 (.p3z 0 :: .p3z m0 :: .p5 :: suf) = 1 := by + obtain ⟨m0', rfl⟩ : ∃ m0', m0 = m0' + 1 := ⟨m0 - 1, by omega⟩ + rfl + have hdrop_eq : dropZ0 (.p3z 0 :: .p3z m0 :: .p5 :: suf) = .p3z m0 :: .p5 :: suf := by + obtain ⟨m0', rfl⟩ : ∃ m0', m0 = m0' + 1 := ⟨m0 - 1, by omega⟩ + rfl + have hcond1_f : ¬(([] : List Nat) = [] ∧ (1 : Nat) = 1 ∧ (1 : Nat) = 1 ∧ + isP3zP5 (.p3z 0 :: .p3z m0 :: .p5 :: suf) = true ∧ + headP3zVal (.p3z 0 :: .p3z m0 :: .p5 :: suf) ≥ 3) := by + dsimp [headP3zVal]; omega + have hcond2 : ([] : List Nat) = [] ∧ + ((1 = 1 ∧ 1 = 1 ∧ z0 (.p3z 0 :: .p3z m0 :: .p5 :: suf) = 1) ∨ + (1 = 3 ∧ 1 = 2 ∧ z0 (.p3z 0 :: .p3z m0 :: .p5 :: suf) = 0)) ∧ + isP3zP5 (dropZ0 (.p3z 0 :: .p3z m0 :: .p5 :: suf)) = true ∧ + headP3zVal (dropZ0 (.p3z 0 :: .p3z m0 :: .p5 :: suf)) ≥ 18 ∧ + z0 (p5Suf (.p3z 0 :: .p3z m0 :: .p5 :: suf)) ≥ 38 := by + rw [hz0_eq, hdrop_eq] + exact ⟨rfl, Or.inl ⟨rfl, rfl, rfl⟩, rfl, hm0_18, hz38⟩ + refine ⟨?_, ?_⟩ + · have h_g : (!GoodDs [] || !checkDs2 (.ModeE_ge2 (.p3z 0 :: .p3z m0 :: .p5 :: suf) 1 1 []) || + !checkDs1Phi1 (.ModeE_ge2 (.p3z 0 :: .p3z m0 :: .p5 :: suf) 1 1 [])) = false := by + dsimp [GoodDs, checkDs2, checkDs1Phi1]; simp + dsimp only [invCore] + rw [bool_if_false_eq_self h_g, if_neg (show ¬((1 : Nat) % 2 = 0) by decide)] + rw [not_bool_if_false_eq_true hvp5'] + rw [not_decide_if_false_eq_true (by omega)] + rw [if_neg hcond1_f, if_pos hcond2] + · intro fuel + have hf := hch fuel + dsimp only [invChain] at hf ⊢ + rw [if_neg (show ¬((1 : Nat) ≥ 2) by omega), if_pos ⟨rfl, hepw0⟩] at hf + simp only [Bool.and_eq_true] at hf + rw [if_neg (by omega), if_neg hcond1_f, if_pos hcond2] + rw [hdrop_eq] + dsimp only [headP3zVal, drop2L] at hf ⊢ + have hm_sub : m0 - 4 = m0 - 4 - 2 * (1 - 1) := by omega + rw [hm_sub] + exact hf.2 + · rw [if_neg h_emp] at hok_phi + simp only [Bool.and_eq_true, decide_eq_true_eq] at hok_phi + rcases hok_phi with ⟨⟨_, hepw_pos, hpref_le⟩, hphiw⟩ + have hpref0 : prefSumW ls = 0 := by omega + have hmd0 : MustDrain ls = false := by + have hdec : decide (0 < 2 * 1 + epSum ls) = true := decide_eq_true (by omega) + rw [hdec, Bool.and_true] at hmd_bound + exact hmd_bound + have hnp5 : isHeadP5 ls = false := by + cases ls with + | nil => rfl + | cons t _ => cases t with | p3z _ => rfl | p5 => simp [epW] at hepw_pos + obtain ⟨hvp5, hz0_ge⟩ := ValidP5Chain_of_ValidEvenLs_z0Rep ls heven hpref0 hmd0 hnp5 + obtain ⟨hls_z0_eq, hodd_imp_p5⟩ := ls_eq_z0Rep_of_prefSumW_zero ls heven hpref0 hmd0 hnp5 + have hep_ge_epw : ep ls ≥ epW ls := by + have h_eq := congrArg ep hls_z0_eq + cases hp : hasP5 ls with + | false => rw [hp, if_neg Bool.false_ne_true, ep_z0Rep] at h_eq; omega + | true => rw [hp, if_pos rfl, ep_z0Rep] at h_eq; omega + have h_mrem_eq : 2 + epSum ls + (if hasOdd ls then 1 else 0) - (0 + 2) = + epSum ls + (if hasOdd ls then 1 else 0) := by omega + have hls_z0_symm : (if hasP5 ls = true then + z0Rep (epW ls) (.p3z (epSum ls + (if hasOdd ls = true then 1 else 0)) :: .p5 :: p5Suf ls) + else z0Rep (epW ls) []) = ls := hls_z0_eq.symm + have h_tail_z0Rep : ∀ n, z0Rep n (if hasP5 ls = true then + .p3z (epSum ls + (if hasOdd ls = true then 1 else 0)) :: .p5 :: p5Suf ls + else []) = + (if hasP5 ls = true then + z0Rep n (.p3z (epSum ls + (if hasOdd ls = true then 1 else 0)) :: .p5 :: p5Suf ls) + else z0Rep n []) := by + intro n; cases hasP5 ls <;> rfl + have hz_ls0 : z0Rep (0 + epW ls) (if hasP5 ls = true then + .p3z (2 + epSum ls + (if hasOdd ls = true then 1 else 0) - (0 + 2)) :: .p5 :: p5Suf ls + else []) = ls := by + rw [Nat.zero_add, h_mrem_eq, h_tail_z0Rep, hls_z0_symm] + have hz_ls1 : z0Rep (0 + epW ls + 1) (if hasP5 ls = true then + .p3z (2 + epSum ls + (if hasOdd ls = true then 1 else 0) - (0 + 2)) :: .p5 :: p5Suf ls + else []) = .p3z 0 :: ls := congrArg (LTok.p3z 0 :: ·) hz_ls0 + have hz_ls2 : z0Rep (0 + epW ls + 2) (if hasP5 ls = true then + .p3z (2 + epSum ls + (if hasOdd ls = true then 1 else 0) - (0 + 2)) :: .p5 :: p5Suf ls + else []) = .p3z 0 :: .p3z 0 :: ls := congrArg (LTok.p3z 0 :: ·) hz_ls1 + have hz_ls3 : z0Rep (0 + epW ls + 3) (if hasP5 ls = true then + .p3z (2 + epSum ls + (if hasOdd ls = true then 1 else 0) - (0 + 2)) :: .p5 :: p5Suf ls + else []) = .p3z 0 :: .p3z 0 :: .p3z 0 :: ls := congrArg (LTok.p3z 0 :: ·) hz_ls2 + have hdec_0_2 : decide (0 ≥ 2 + epSum ls) = false := decide_eq_false (by omega) + have hch_step : ∀ fuel, invChain (fuel + 1) (.ModeB_b2 ls 1 ds) = + checkChainAux (fuel + 1) true ls 0 2 0 ds := by + intro fuel + dsimp only [invChain] + rw [if_neg (show ¬((1 : Nat) ≥ 2) by omega), if_neg h_emp] + cases ds with + | nil => + dsimp only [nextState] + dsimp [GoodPhiW] at hphiw + simp only [Bool.false_or, decide_eq_true_eq] at hphiw + have hepw7 : epW ls ≥ 7 := by omega + have hvp5' : ValidP5Chain (.p3z 0 :: ls) = true := hvp5 + have hz0' : z0 (.p3z 0 :: ls) = 1 + z0 ls := rfl + have hcond1_f : ¬(([] : List Nat) = [] ∧ (1 : Nat) = 1 ∧ (1 : Nat) = 1 ∧ + isP3zP5 (.p3z 0 :: ls) = true ∧ headP3zVal (.p3z 0 :: ls) ≥ 3) := by + dsimp [headP3zVal]; omega + have hcond2_f : ¬(([] : List Nat) = [] ∧ + ((1 = 1 ∧ 1 = 1 ∧ z0 (.p3z 0 :: ls) = 1) ∨ (1 = 3 ∧ 1 = 2 ∧ z0 (.p3z 0 :: ls) = 0)) ∧ + isP3zP5 (dropZ0 (.p3z 0 :: ls)) = true ∧ + headP3zVal (dropZ0 (.p3z 0 :: ls)) ≥ 18 ∧ z0 (p5Suf (.p3z 0 :: ls)) ≥ 38) := by + rw [hz0']; omega + refine ⟨?_, ?_⟩ + · have h_g : (!GoodDs [] || !checkDs2 (.ModeE_ge2 (.p3z 0 :: ls) 1 1 []) || + !checkDs1Phi1 (.ModeE_ge2 (.p3z 0 :: ls) 1 1 [])) = false := by + dsimp [GoodDs, checkDs2, checkDs1Phi1]; simp + dsimp only [invCore] + rw [bool_if_false_eq_self h_g, if_neg (show ¬((1 : Nat) % 2 = 0) by decide)] + rw [not_bool_if_false_eq_true hvp5'] + rw [not_decide_if_false_eq_true (by omega)] + rw [if_neg hcond1_f, if_neg hcond2_f, hz0'] + have hkz17 : decide (1 + 2 * (1 + z0 ls) ≥ 17) = true := decide_eq_true (by omega) + have hbase : decide (1 + (1 + z0 ls) ≥ 8 ∧ 1 + 2 * (1 + z0 ls) ≥ 15) = true := + decide_eq_true ⟨by omega, by omega⟩ + rw [hbase, hkz17] + simp + · intro fuel + have hf := hch (fuel + 1) + rw [hch_step fuel] at hf + dsimp only [checkChainAux] at hf + rw [hdec_0_2, hnp5, Bool.and_false, Bool.or_false, Bool.and_false, + if_neg Bool.false_ne_true, if_neg Bool.false_ne_true, if_neg Bool.false_ne_true, + if_pos (Or.inl rfl), if_neg (show ¬(0 + epW ls < 2) by omega), if_pos rfl, hz_ls1] at hf + dsimp only [invChain] + rw [if_neg (by omega), if_neg hcond1_f, if_neg hcond2_f] + exact hf + | cons d ds' => + cases d with + | zero => + cases ds' with + | cons d2 ds'' => have := GoodDs_pair_ge3 hgd; omega + | nil => + dsimp only [nextState] + dsimp [GoodPhiW] at hphiw + simp only [decide_eq_true_eq] at hphiw + have hepw7 : epW ls ≥ 7 := by omega + have heven2 : ValidEvenLs (.p3z 0 :: .p3z 0 :: ls) = true := heven + have hnp5_2 : isHeadP5 (.p3z 0 :: .p3z 0 :: ls) = false := rfl + have hepw2 : epW (.p3z 0 :: .p3z 0 :: ls) = 2 + epW ls := by + rw [epW_p3z_even_cons 0 _ rfl rfl, epW_p3z_even_cons 0 ls rfl hnp5]; omega + have hpref2 : prefSumW (.p3z 0 :: .p3z 0 :: ls) = 0 := by + rw [prefSumW_p3z_even_cons 0 _ rfl rfl, prefSumW_p3z_even_cons 0 ls rfl hnp5, hpref0] + have hmd2 : MustDrain (.p3z 0 :: .p3z 0 :: ls) = false := hmd0 + have hep2 : ep (.p3z 0 :: .p3z 0 :: ls) = 2 + ep ls := by + rw [ep_p3z_even_cons 0 _ rfl, ep_p3z_even_cons 0 ls rfl]; omega + have hepsum2 : epSum (.p3z 0 :: .p3z 0 :: ls) = epSum ls := by dsimp [epSum]; omega + have hodd2 : hasOdd (.p3z 0 :: .p3z 0 :: ls) = hasOdd ls := rfl + have hp5_2 : hasP5 (.p3z 0 :: .p3z 0 :: ls) = hasP5 ls := rfl + refine ⟨?_, ?_⟩ + · have h_g : (!GoodDs [] || !checkDs2 (.ModeE_ge2 (.p3z 0 :: .p3z 0 :: ls) 2 1 []) || + !checkDs1Phi1 (.ModeE_ge2 (.p3z 0 :: .p3z 0 :: ls) 2 1 [])) = false := by + dsimp [GoodDs, checkDs2, checkDs1Phi1]; simp + dsimp only [invCore] + rw [bool_if_false_eq_self h_g, if_pos (show (2 : Nat) % 2 = 0 by decide)] + rw [not_bool_if_false_eq_true heven2] + rw [hpref2, not_decide_if_false_eq_true (by omega)] + have hphiw2 : GoodPhiW (1 + epW (.p3z 0 :: .p3z 0 :: ls)) [] + (isHeadP3z1 (.p3z 0 :: .p3z 0 :: ls) && decide (2 = 0 ∧ 1 = 0 ∧ + ([] : List Nat) = [])) = true := by + rw [hepw2]; dsimp [GoodPhiW]; simp; omega + have hok_phi2 : (if (!isHeadP5 (.p3z 0 :: .p3z 0 :: ls)) = true then + (decide (([] : List Nat) = [] ∧ + 1 + epW (.p3z 0 :: .p3z 0 :: ls) = 1) && MustDrain (.p3z 0 :: .p3z 0 :: ls) && + decide (1 + ep (.p3z 0 :: .p3z 0 :: ls) = 1 ∧ + 2 + epSum (.p3z 0 :: .p3z 0 :: ls) + 2 * ep (.p3z 0 :: .p3z 0 :: ls) = 2) && + hasP5 (.p3z 0 :: .p3z 0 :: ls) && decide (preP5Val (.p3z 0 :: .p3z 0 :: ls) ≥ 16 ∧ + z0 (p5Suf (.p3z 0 :: .p3z 0 :: ls)) ≥ 38)) || + GoodPhiW (1 + + epW (.p3z 0 :: .p3z 0 :: ls)) [] (isHeadP3z1 (.p3z 0 :: .p3z 0 :: ls) && decide + (2 = 0 ∧ 1 = 0 ∧ ([] : List Nat) = [])) + else + decide (1 = 0 ∧ ([] : List Nat) = [] ∧ + 2 = 2) || (decide (1 ≥ 1) && GoodPhiW (1 - 1) [] false)) = true := by + rw [if_pos (by rfl), hphiw2, Bool.or_true] + rw [not_bool_if_false_eq_true hok_phi2] + rw [hmd2, Bool.false_and, if_neg Bool.false_ne_true] + have hrst_f : (decide ((2 : Nat) = 0 ∧ (1 : Nat) = 0 ∧ + ([] : List Nat) = []) && isHeadP3z1 (.p3z 0 :: .p3z 0 :: ls)) = false := rfl + rw [hrst_f] + simp only [Bool.false_eq_true, ↓reduceIte, Bool.not_true] + by_cases h_odd_c : (hasOdd (.p3z 0 :: .p3z 0 :: ls) && decide (2 * 1 + 4 ≥ + 2 + epSum (.p3z 0 :: .p3z 0 :: ls))) = true + · rw [if_pos h_odd_c] + simp only [Bool.and_eq_true] at h_odd_c + have hp5_t : hasP5 ls = true := by + cases hp : hasP5 ls with + | true => rfl + | false => have := hodd_imp_p5 hp; rw [hodd2, this] at h_odd_c; cases h_odd_c.1 + have hgp : GoodPsi (1 + ep (.p3z 0 :: .p3z 0 :: ls)) [] = true := by + dsimp [GoodPsi, GoodDs, GoodDsAux, GoodDs1]; simp; omega + rw [hgp, hp5_2, hp5_t] + simp + · rw [if_neg h_odd_c] + · intro fuel + have hf := hch (fuel + 1) + rw [hch_step fuel] at hf + dsimp only [checkChainAux] at hf + rw [hdec_0_2, hnp5, Bool.and_false, Bool.or_false, Bool.and_false, + if_neg Bool.false_ne_true, if_neg Bool.false_ne_true, if_neg (by decide), + if_pos (Or.inr (Or.inl rfl)), if_neg (show ¬(0 + epW ls < 2) by omega), + if_neg (by decide), if_pos rfl, hz_ls2] at hf + dsimp only [invChain] + rw [if_pos rfl, if_neg (by intro ⟨h1, _⟩; cases h1)] + exact hf + | succ d1 => + cases d1 with + | zero => + cases ds' with + | cons d2 ds'' => have := GoodDs_pair_ge3 hgd; omega + | nil => + dsimp only [nextState] + dsimp [GoodPhiW] at hphiw + simp only [decide_eq_true_eq] at hphiw + have hepw2_ge : epW ls ≥ 2 := by omega + have heven3 : ValidEvenLs (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls) = true := heven + have hepw3 : epW (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls) = 3 + epW ls := by + rw [epW_p3z_even_cons 0 _ rfl rfl, epW_p3z_even_cons 0 _ rfl rfl, + epW_p3z_even_cons 0 ls rfl hnp5]; omega + have hpref3 : prefSumW (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls) = 0 := by + rw [prefSumW_p3z_even_cons 0 _ rfl rfl, prefSumW_p3z_even_cons 0 _ rfl rfl, + prefSumW_p3z_even_cons 0 ls rfl hnp5, hpref0] + have hmd3 : MustDrain (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls) = false := hmd0 + have hep3 : ep (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls) = 3 + ep ls := by + rw [ep_p3z_even_cons 0 _ rfl, ep_p3z_even_cons 0 _ rfl, + ep_p3z_even_cons 0 ls rfl]; omega + have hepsum3 : epSum (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls) = epSum ls := by + dsimp [epSum]; omega + have hodd3 : hasOdd (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls) = hasOdd ls := rfl + have hp5_3 : hasP5 (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls) = hasP5 ls := rfl + refine ⟨?_, ?_⟩ + · have h_g : (!GoodDs [] || !checkDs2 (.ModeE_ge2 (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls) 0 1 + []) || + !checkDs1Phi1 (.ModeE_ge2 (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls) 0 1 [])) = false := + by + dsimp [GoodDs, checkDs2, checkDs1Phi1]; simp + dsimp only [invCore] + rw [bool_if_false_eq_self h_g, if_pos (show (0 : Nat) % 2 = 0 by decide)] + rw [not_bool_if_false_eq_true heven3] + rw [hpref3, not_decide_if_false_eq_true (by omega)] + have hphiw3 : GoodPhiW (1 + epW (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls)) [] + (isHeadP3z1 (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls) && decide (0 = 0 ∧ 1 = 0 ∧ + ([] : List Nat) = [])) = true := by + rw [hepw3]; dsimp [GoodPhiW]; simp; omega + have hok_phi3 : (if (!isHeadP5 (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls)) = true then + (decide (([] : List Nat) = [] ∧ + 1 + epW (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls) = + 1) && MustDrain (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls) && + decide (1 + ep (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls) = 1 ∧ + 0 + epSum (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls) + + 2 * ep (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls) = 2) && + hasP5 (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls) && decide (preP5Val (.p3z 0 :: .p3z 0 + :: .p3z 0 :: ls) ≥ 16 ∧ + z0 (p5Suf (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls)) ≥ 38)) || + GoodPhiW (1 + + epW (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls)) [] (isHeadP3z1 (.p3z 0 :: .p3z 0 :: + .p3z 0 :: ls) && decide (0 = 0 ∧ 1 = 0 ∧ ([] : List Nat) = [])) + else + decide (1 = 0 ∧ ([] : List Nat) = [] ∧ + 0 = 2) || (decide (1 ≥ 1) && GoodPhiW (1 - 1) [] false)) = true := by + rw [if_pos (by rfl), hphiw3, Bool.or_true] + rw [not_bool_if_false_eq_true hok_phi3] + rw [hmd3, Bool.false_and, if_neg Bool.false_ne_true] + have hrst_f : (decide ((0 : Nat) = 0 ∧ (1 : Nat) = 0 ∧ + ([] : List Nat) = []) && isHeadP3z1 (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls)) = false := + rfl + rw [hrst_f] + simp only [Bool.false_eq_true, ↓reduceIte, Bool.not_true] + by_cases h_odd_c : (hasOdd (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls) && decide (2 * 1 + 4 ≥ + 0 + epSum (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls))) = true + · rw [if_pos h_odd_c] + simp only [Bool.and_eq_true, decide_eq_true_eq] at h_odd_c + have hepw_ge3 : epW ls ≥ 3 := by + by_cases he2 : epW ls = 2 + · dsimp [checkDs1Phi1] at hds1 + simp only [he2, not_true_eq_false, ↓reduceIte, Bool.and_eq_true, + decide_eq_true_eq] at hds1 + rw [hepsum3] at h_odd_c; omega + · omega + have hp5_t : hasP5 ls = true := by + cases hp : hasP5 ls with + | true => rfl + | false => have := hodd_imp_p5 hp; rw [hodd3, this] at h_odd_c; cases h_odd_c.1 + have hgp : GoodPsi (1 + ep (.p3z 0 :: .p3z 0 :: .p3z 0 :: ls)) [] = true := by + dsimp [GoodPsi, GoodDs, GoodDsAux, GoodDs1]; simp; omega + rw [hgp, hp5_3, hp5_t] + simp + · rw [if_neg h_odd_c] + · intro fuel + have hf := hch (fuel + 1) + rw [hch_step fuel] at hf + dsimp only [checkChainAux] at hf + rw [hdec_0_2, hnp5, Bool.and_false, Bool.or_false, Bool.and_false, + if_neg Bool.false_ne_true, if_neg Bool.false_ne_true, if_neg (by decide), + if_pos (Or.inr (Or.inr (Or.inl rfl))), if_neg (show ¬(0 + epW ls < 2) by omega), + if_neg (by decide), if_neg (by decide), if_pos rfl, hz_ls3] at hf + dsimp only [invChain] + rw [if_pos rfl, if_neg (by intro ⟨_, h1, _⟩; cases h1)] + exact hf + | succ d2_idx => + cases d2_idx with + | zero => + have hd_eq : 0 + 1 + 1 = 2 := rfl + rw [hd_eq] at * + cases ds' with + | cons d2 ds'' => have := GoodDs_pair_ge3 hgd; omega + | nil => + dsimp only [nextState] + dsimp [GoodPhiW] at hphiw + simp only [decide_eq_true_eq] at hphiw + have hepw5 : epW ls = 5 := by omega + have hvp5' : ValidP5Chain (.p3z 0 :: .p3z 0 :: ls) = true := hvp5 + have hz0_2 : z0 (.p3z 0 :: .p3z 0 :: ls) = 2 + z0 ls := by + change 1 + (1 + z0 ls) = 2 + z0 ls; omega + have hcond1_f : ¬(([0] : List Nat) = [] ∧ (1 : Nat) = 1 ∧ (1 : Nat) = 1 ∧ + isP3zP5 (.p3z 0 :: .p3z 0 :: ls) = true ∧ + headP3zVal (.p3z 0 :: .p3z 0 :: ls) ≥ 3) := by + intro ⟨h1, _⟩; cases h1 + have hcond2_f : ¬(([0] : List Nat) = [] ∧ + ((1 = 1 ∧ 1 = 1 ∧ z0 (.p3z 0 :: .p3z 0 :: ls) = 1) ∨ (1 = 3 ∧ 1 = 2 ∧ + z0 (.p3z 0 :: .p3z 0 :: ls) = 0)) ∧ + isP3zP5 (dropZ0 (.p3z 0 :: .p3z 0 :: ls)) = true ∧ + headP3zVal (dropZ0 (.p3z 0 :: .p3z 0 :: ls)) ≥ 18 ∧ + z0 (p5Suf (.p3z 0 :: .p3z 0 :: ls)) ≥ 38) := by + intro ⟨h1, _⟩; cases h1 + refine ⟨?_, ?_⟩ + · have h_g : (!GoodDs [0] || !checkDs2 (.ModeE_ge2 (.p3z 0 :: .p3z 0 :: ls) 1 1 [0]) + || + !checkDs1Phi1 (.ModeE_ge2 (.p3z 0 :: .p3z 0 :: ls) 1 1 [0])) = false := by + dsimp [GoodDs, GoodDsAux, GoodDs1, checkDs2, checkDs1Phi1]; simp + dsimp only [invCore] + rw [bool_if_false_eq_self h_g, if_neg (show ¬((1 : Nat) % 2 = 0) by decide)] + rw [not_bool_if_false_eq_true hvp5'] + rw [not_decide_if_false_eq_true (by omega)] + rw [if_neg hcond1_f, if_neg hcond2_f, hz0_2] + have hbase : decide (1 + (2 + z0 ls) ≥ 8 ∧ 1 + 2 * (2 + z0 ls) ≥ 15) = true := + decide_eq_true ⟨by omega, by omega⟩ + have hod_f : isOddDrainDs [0] = false := rfl + rw [hbase, hod_f] + by_cases hz6 : z0 ls ≥ 6 + · have hkz17 : decide (1 + 2 * (2 + z0 ls) ≥ 17) = true := decide_eq_true (by omega) + rw [hkz17]; simp + · have hcz_lt9 : decide (([0] = [] ∨ [0] = [0]) ∧ + 1 + (2 + z0 ls) ≥ 9 ∨ false = true) = false := + decide_eq_false (by intro h_or; rcases h_or with ⟨_, + h9⟩ | h_f <;> first | omega | cases h_f) + rw [hcz_lt9]; simp + · intro fuel + have hf := hch (fuel + 1) + rw [hch_step fuel] at hf + dsimp only [checkChainAux] at hf + rw [hdec_0_2, hnp5, Bool.and_false, Bool.or_false, Bool.and_false, + if_neg Bool.false_ne_true, if_neg Bool.false_ne_true, if_neg (by decide), + if_pos (Or.inr (Or.inr (Or.inr rfl))), if_neg (show ¬(0 + epW ls < 2) by omega), + if_neg (by decide), if_neg (by decide), if_neg (by decide), hz_ls2] at hf + dsimp only [invChain] + rw [if_neg (show ¬((1 : Nat) % 2 = 0) by decide), if_neg hcond1_f, if_neg hcond2_f] + exact hf + | succ m'' => + have hd_eq : m'' + 1 + 1 + 1 = m'' + 3 := rfl + rw [hd_eq] at * + cases ds' with + | nil => + dsimp only [nextState] + have hd8 := GoodDs_d1_valid (by omega) hgd + dsimp [GoodPhiW] at hphiw + have hepw_req : epW ls ≥ if isOddDrainDs [m'' + 3] then 18 else 16 := by + by_cases hod : isOddDrainDs [m'' + 3] = true + · rw [if_pos hod] at hphiw ⊢; simp only [decide_eq_true_eq] at hphiw; omega + · rw [if_neg hod] at hphiw ⊢; simp only [decide_eq_true_eq] at hphiw; omega + have hepw16 : epW ls ≥ 16 := by split_ifs at hepw_req <;> omega + refine ⟨?_, ?_⟩ + · dsimp [invCore, isHeadP5, drop1L] + have hz0_2 : z0 (.p3z 0 :: .p3z 0 :: ls) = 2 + z0 ls := by + change 1 + (1 + z0 ls) = 2 + z0 ls; omega + have hvp5' : ValidP5Chain (.p3z 0 :: .p3z 0 :: ls) = true := hvp5 + rw [hz0_2, hvp5'] + simp only [Bool.and_true, Bool.and_eq_true, decide_eq_true_eq] + exact ⟨by omega, by omega⟩ + · intro fuel + have hf := hch (fuel + 1) + rw [hch_step fuel] at hf + dsimp only [checkChainAux] at hf + rw [hdec_0_2, hnp5, Bool.and_false, Bool.or_false, Bool.and_false, + if_neg Bool.false_ne_true, if_neg Bool.false_ne_true, if_pos (decide_eq_true hd8), + if_neg (show ¬(0 + epW ls < if isOddDrainDs [m'' + 3] = + true then 18 else 16) by omega), + hz_ls2] at hf + have h_hnat : headNat [m'' + 3] = m'' + 3 := rfl + have hm_sub : m'' + 3 - 7 = m'' - 4 := by omega + rw [h_hnat, hm_sub] at hf + dsimp only [invChain, drop1L, checkResetSufAux] + exact hf + | cons d2 ds'' => + cases d2 with + | zero => + rcases GoodDs_pair_d2_cases hgd with ⟨_, rfl, hd8⟩ | ⟨h_abs, _⟩ | ⟨h_abs, _⟩ + · obtain ⟨m4, rfl⟩ : ∃ m4, m'' = m4 + 2 := ⟨m'' - 2, by omega⟩ + have hd_eq2 : m4 + 2 + 3 = m4 + 5 := rfl + rw [hd_eq2] at * + dsimp only [nextState] + dsimp [GoodPhiW] at hphiw + have hepw_req : epW ls ≥ if isOddDrainDs [m4 + 5, 0] then 18 else 16 := by + by_cases hod : isOddDrainDs [m4 + 5, 0] = true + · rw [if_pos hod] at hphiw ⊢; simp only [decide_eq_true_eq] at hphiw; omega + · rw [if_neg hod] at hphiw ⊢; simp only [decide_eq_true_eq] at hphiw; omega + have hepw16 : epW ls ≥ 16 := by split_ifs at hepw_req <;> omega + have hz0_2 : z0 (.p3z 0 :: .p3z 0 :: ls) = 2 + z0 ls := by + change 1 + (1 + z0 ls) = 2 + z0 ls; omega + have heven_new : ValidEvenLs (.p5 :: .p3z 0 :: .p3z 0 :: ls) = true := by + dsimp [ValidEvenLs, ValidP5Chain]; rw [hz0_2]; simp [hvp5]; omega + refine ⟨?_, ?_⟩ + · have h_g : (!GoodDs [] || !checkDs2 (.ModeB_b2 (.p5 :: .p3z 0 :: .p3z 0 :: ls) + (m4 + 1) []) || + !checkDs1Phi1 (.ModeB_b2 (.p5 :: .p3z 0 :: .p3z 0 :: ls) (m4 + 1) []) || + !ValidEvenLs (.p5 :: .p3z 0 :: .p3z 0 :: ls)) = false := by + dsimp [GoodDs, checkDs2, checkDs1Phi1]; simp [heven_new] + dsimp only [invCore] + rw [bool_if_false_eq_self h_g, if_pos (show m4 + 1 ≥ 2 by omega)] + dsimp [isHeadP5]; simp; omega + · intro fuel + have hf := hch (fuel + 1) + rw [hch_step fuel] at hf + dsimp only [checkChainAux] at hf + rw [hdec_0_2, hnp5, Bool.and_false, Bool.or_false, Bool.and_false, + if_neg Bool.false_ne_true, if_neg Bool.false_ne_true, + if_pos (by exact decide_eq_true hd8), + if_neg (show ¬(0 + epW ls < if isOddDrainDs [m4 + 5, 0] = + true then 18 else 16) by omega), + hz_ls2] at hf + have h_hnat : headNat [m4 + 5, 0] = m4 + 5 := rfl + have hm_sub : m4 + 5 - 7 = m4 + 1 - 3 := by omega + rw [h_hnat, hm_sub] at hf + dsimp only [invChain, drop1L, checkResetSufAux] + rw [if_pos (show m4 + 1 ≥ 2 by omega)] + exact hf + · cases h_abs + · omega + | succ c' => + dsimp only [nextState] + have h_or_f : ¬((m'' + 3) :: (c' + 1) :: ds'' = [] ∨ + (m'' + 3) :: (c' + 1) :: ds'' = [0] ∨ + (m'' + 3) :: (c' + 1) :: ds'' = [1] ∨ + (m'' + 3) :: (c' + 1) :: ds'' = [2]) := by simp + dsimp [GoodPhiW] at hphiw + have hepw16 : epW ls ≥ 16 := by + split_ifs at hphiw <;> (simp only [decide_eq_true_eq] at hphiw; omega) + have hz0_2 : z0 (.p3z 0 :: .p3z 0 :: ls) = 2 + z0 ls := by + change 1 + (1 + z0 ls) = 2 + z0 ls; omega + have heven_new : ValidEvenLs (.p5 :: .p3z 0 :: .p3z 0 :: ls) = true := by + dsimp [ValidEvenLs, ValidP5Chain]; rw [hz0_2]; simp [hvp5]; omega + rcases GoodDs_pair_d2_cases hgd with ⟨h_abs, _⟩ | ⟨hc'0, rfl, hd_or⟩ | ⟨hc'2, hd17, + hgd_tail, hsub1, hsub2⟩ + · cases h_abs + · have hc'_z : c' = 0 := by omega + subst hc'_z + have h_d_cond1 : ¬((m'' + 3) % 2 = 0 ∧ m'' + 3 ≤ 2 * 1 + 4 ∧ + GoodDs [1 - 1] = false) := by + intro ⟨_, _, h_f⟩; cases h_f + have h_d_cond2 : ¬((m'' + 3) % 2 = 0 ∧ m'' + 3 + 14 ≤ 2 * 1 ∧ + GoodDs [1 - 2] = false) := by omega + rcases hd_or with hm''0 | hd25 + · have hm''_z : m'' = 0 := by omega + subst hm''_z + refine ⟨?_, ?_⟩ + · have h_g : (!GoodDs [] || !checkDs2 (.ModeB_ge3 (.p5 :: .p3z 0 :: .p3z 0 :: + ls) 0 0 []) || + !checkDs1Phi1 (.ModeB_ge3 (.p5 :: .p3z 0 :: .p3z 0 :: ls) 0 0 [])) = + false := by + dsimp [GoodDs, checkDs2, checkDs1Phi1]; simp + dsimp only [invCore] + rw [bool_if_false_eq_self h_g, if_pos (by decide), + not_bool_if_false_eq_true heven_new] + dsimp [isHeadP5, MustDrain, hasOdd] + · intro fuel + have hf := hch (fuel + 1) + rw [hch_step fuel] at hf + dsimp only [checkChainAux] at hf + rw [hdec_0_2, hnp5, Bool.and_false, Bool.or_false, Bool.and_false, + if_neg Bool.false_ne_true, if_neg Bool.false_ne_true, + if_neg (by exact Bool.false_ne_true), + if_neg h_or_f, if_pos ⟨by omega, + by omega⟩, if_neg h_d_cond1, if_neg h_d_cond2, + if_neg (show ¬(0 + epW ls < 16) by omega), hz_ls0, + if_neg (show ¬((1 : Nat) = 1 ∧ ([] : List Nat) = [] ∧ + 0 + 3 ≥ 25) by omega)] at hf + dsimp only [invChain] + rw [if_pos (by decide), if_neg (by intro ⟨_, _, h22⟩; omega)] + exact hf + · have hm''22 : m'' ≥ 22 := by omega + have hepw36 : epW ls ≥ 36 := by + rw [if_pos (by exact decide_eq_true hd25)] at hphiw + simp only [decide_eq_true_eq] at hphiw + omega + have hz38 : z0 (.p3z 0 :: .p3z 0 :: ls) ≥ 38 := by omega + refine ⟨?_, ?_⟩ + · have h_g : (!GoodDs [] || !checkDs2 (.ModeB_ge3 (.p5 :: .p3z 0 :: .p3z 0 :: + ls) m'' 0 []) || + !checkDs1Phi1 (.ModeB_ge3 (.p5 :: .p3z 0 :: .p3z 0 :: ls) m'' 0 [])) = + false := by + dsimp [GoodDs, checkDs2, checkDs1Phi1]; simp + dsimp only [invCore] + rw [bool_if_false_eq_self h_g] + by_cases hm_ev : m'' % 2 = 0 + · rw [if_pos hm_ev, not_bool_if_false_eq_true heven_new] + dsimp [isHeadP5, p5Suf, MustDrain, hasOdd] + simp [hm''22, hz38] + · have hm''23 : m'' ≥ 23 := by omega + have heven_odd : ValidEvenLs (.p3z m'' :: .p5 :: .p3z 0 :: .p3z 0 :: ls) = + true := by + dsimp [ValidEvenLs]; rw [if_neg hm_ev] + dsimp [ValidAfterOdd, ValidP5Chain]; rw [hz0_2]; simp [hvp5]; omega + rw [if_neg hm_ev] + have h_c0_ok : ¬((0 : Nat) = 0 ∧ (!decide (([] : List Nat) = [] ∧ m'' ≥ 23 ∧ + isHeadP5 (.p5 :: .p3z 0 :: .p3z 0 :: ls) = true ∧ + z0 (p5Suf (.p5 :: .p3z 0 :: .p3z 0 :: ls)) ≥ 38)) = true) := by + dsimp [isHeadP5, p5Suf]; simp [hm''23, hz38] + rw [if_neg h_c0_ok, not_bool_if_false_eq_true heven_odd] + have hmd_f : MustDrain (.p3z m'' :: .p5 :: .p3z 0 :: .p3z 0 :: ls) = + false := by + dsimp [MustDrain]; split_ifs <;> rfl + rw [hmd_f, Bool.false_and, if_neg Bool.false_ne_true, + if_neg (show ¬(m'' ≤ 2 * 0 + 3) by omega)]; simp + · intro fuel + have hf := hch (fuel + 1) + rw [hch_step fuel] at hf + dsimp only [checkChainAux] at hf + rw [hdec_0_2, hnp5, Bool.and_false, Bool.or_false, Bool.and_false, + if_neg Bool.false_ne_true, if_neg Bool.false_ne_true, + if_neg (by exact Bool.false_ne_true), + if_neg h_or_f, if_pos ⟨by omega, + by omega⟩, if_neg h_d_cond1, if_neg h_d_cond2, + if_neg (show ¬(0 + epW ls < 16) by omega), hz_ls0, + if_pos ⟨rfl, rfl, hd25⟩] at hf + have h_ok_t := + checkChainAux_B_ge3_c0_ok_ge22 fuel m'' (.p3z 0 :: .p3z 0 :: ls) hm''22 + have hm_sub : m'' - 8 = m'' + 3 - 11 := by omega + dsimp only [invChain] + by_cases hm_ev : m'' % 2 = 0 + · rw [if_pos hm_ev, if_pos ⟨rfl, rfl, hm''22⟩, h_ok_t, Bool.true_and] + dsimp only [drop1L]; rw [hm_sub]; exact hf + · rw [if_neg hm_ev, if_neg (show ¬(m'' = 1 ∧ (0 : Nat) = 1 ∧ + ([] : List Nat) = []) by omega), + if_pos rfl, h_ok_t, Bool.true_and] + dsimp only [drop1L]; rw [hm_sub]; exact hf + · obtain ⟨hgd_ds'', hds''_ne2⟩ := GoodDs_tail_any hgd_tail + have h_d_cond1 : ¬((m'' + 3) % 2 = 0 ∧ m'' + 3 ≤ 2 * (c' + 1) + 4 ∧ + GoodDs ((c' + 1 - 1) :: ds'') = false) := by + intro ⟨h1, h2, h3⟩; rw [hsub1 ⟨h1, h2⟩] at h3; cases h3 + have h_d_cond2 : ¬((m'' + 3) % 2 = 0 ∧ m'' + 3 + 14 ≤ 2 * (c' + 1) ∧ + GoodDs ((c' + 1 - 2) :: ds'') = false) := by + intro ⟨h1, h2, h3⟩; rw [hsub2 ⟨h1, h2⟩] at h3; cases h3 + have h_not_25_1 : ¬(c' + 1 = 1 ∧ ds'' = [] ∧ m'' + 3 ≥ 25) := by omega + have hds2' : checkDs2 (.ModeB_ge3 (.p5 :: .p3z 0 :: .p3z 0 :: ls) m'' c' ds'') = + true := by + dsimp [checkDs2]; rw [if_pos hds''_ne2] + have hds1' : checkDs1Phi1 (.ModeB_ge3 (.p5 :: .p3z 0 :: .p3z 0 :: ls) m'' c' ds'') + = true := by + dsimp [checkDs1Phi1] + by_cases h1 : ds'' = [1] + · subst h1 + simp only [not_true_eq_false, ↓reduceIte] + rcases GoodDs_pair_d2_cases hgd_tail with ⟨h_abs, _⟩ | ⟨_, _, + hd_c_or⟩ | ⟨h_abs, _⟩ + · cases h_abs + · rcases hd_c_or with hc'2_eq | hc'24 + · have hc'_eq2 : c' = 2 := by omega + subst hc'_eq2 + have hd19 := GoodDs_d31 hgd + by_cases hm_ev : m'' % 2 = 0 + · rw [if_pos hm_ev, if_pos hm_ev] + dsimp [isHeadP5, hasP5, MustDrain, epSum] + rw [if_neg (by omega)] + simp; omega + · rw [if_neg hm_ev, if_neg hm_ev] + dsimp [isHeadP5, hasP5, MustDrain] + rw [if_pos (by omega)] + simp; omega + · by_cases hm_ev : m'' % 2 = 0 + · rw [if_pos hm_ev] + have hip5 : isHeadP5 (.p5 :: .p3z 0 :: .p3z 0 :: ls) = true := rfl + rw [if_pos hip5] + have hne : decide (c' - 1 = 1) = false := decide_eq_false (by omega) + rw [hne]; rfl + · rw [if_neg hm_ev] + have hne : decide (c' = 2) = false := decide_eq_false (by omega) + rw [hne]; rfl + · omega + · simp [h1] + have hphiw_c' : GoodPhiW (c' - 1) ds'' false = true := by + have h_sub : c' - 1 = (c' + 1) - 2 := by omega + rw [h_sub] + exact GoodPhiW_of_GoodDs_sub2 hc'2 hgd_tail + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs ds'' || !checkDs2 (.ModeB_ge3 (.p5 :: .p3z 0 :: .p3z 0 :: + ls) m'' c' ds'') || + !checkDs1Phi1 (.ModeB_ge3 (.p5 :: .p3z 0 :: .p3z 0 :: ls) m'' c' ds'')) = + false := by + simp [hgd_ds'', hds2', hds1'] + rw [bool_if_false_eq_self h_g] + by_cases hm_ev : m'' % 2 = 0 + · rw [if_pos hm_ev, not_bool_if_false_eq_true heven_new] + have hip5_f : (!isHeadP5 (.p5 :: .p3z 0 :: .p3z 0 :: ls)) = false := rfl + rw [hip5_f, if_neg Bool.false_ne_true, + if_neg (show c' ≠ 0 by omega), not_bool_if_false_eq_true hphiw_c'] + rfl + · have heven_odd : ValidEvenLs (.p3z m'' :: .p5 :: .p3z 0 :: .p3z 0 :: ls) = + true := by + dsimp [ValidEvenLs]; rw [if_neg hm_ev] + dsimp [ValidAfterOdd, ValidP5Chain]; rw [hz0_2]; simp [hvp5]; omega + rw [if_neg hm_ev, if_neg (by intro ⟨hc0, _⟩; omega), + not_bool_if_false_eq_true heven_odd] + have hrst_f : decide (m'' = 1 ∧ c' = 1 ∧ ds'' = []) = false := + decide_eq_false (by intro ⟨_, hc1, _⟩; omega) + have hmd_f : MustDrain (.p3z m'' :: .p5 :: .p3z 0 :: .p3z 0 :: ls) = false := + by + dsimp [MustDrain]; split_ifs <;> rfl + have hok_c1' : (if c' ≥ 1 then + if (!decide (m'' = 1 ∧ c' = 1 ∧ ds'' = [])) = true then + (decide (ds'' = [] ∧ c' = 2 ∧ + m'' = 3) && MustDrain (.p3z m'' :: .p5 :: .p3z 0 :: .p3z 0 :: ls) && + hasP5 (.p5 :: .p3z 0 :: .p3z 0 :: ls) && + decide (preP5Val (.p3z m'' :: .p5 :: .p3z 0 :: .p3z 0 :: ls) ≥ 16 ∧ + z0 (p5Suf (.p5 :: .p3z 0 :: .p3z 0 :: ls)) ≥ 38)) || + GoodPhiW (c' - 1) ds'' false + else isP3zGe1P5 (.p5 :: .p3z 0 :: .p3z 0 :: ls) + else true) = true := by + rw [if_pos (by omega), hrst_f, if_pos (by rfl), hphiw_c', Bool.or_true] + rw [not_bool_if_false_eq_true hok_c1', hmd_f, Bool.false_and, + if_neg Bool.false_ne_true] + by_cases h_le : m'' ≤ 2 * c' + 3 + · rw [if_pos h_le, hrst_f, if_neg Bool.false_ne_true] + have hgp : GoodPsi (c' - 1) ds'' = true := by + dsimp [GoodPsi] + have h_eq_c : c' - 1 + 1 = c' + 1 - 1 := by omega + rw [h_eq_c] + exact hsub1 ⟨by omega, by omega⟩ + have h_not_8 : decide ((ds'' = [] ∨ ds'' = [0]) ∧ c' - 1 ≥ 8 ∧ + ((!hasP5 (.p5 :: .p3z 0 :: .p3z 0 :: ls)) = true ∨ + false = true)) = false := by + dsimp [hasP5]; simp + rw [hgp, h_not_8] + simp only [Bool.true_and, Bool.not_false, Bool.true_or, Bool.and_true] + by_cases h_ds1 : (ds'' = [1] ∧ c' - 1 ≥ 24) + · rcases h_ds1 with ⟨rfl, hc'24⟩ + have hd39 := GoodDs_d_ge25_1 (by omega) hgd + have hm37 : decide (m'' ≥ 37) = true := decide_eq_true (by omega) + rw [hm37, Bool.or_true] + · rw [decide_eq_false h_ds1]; rfl + · rw [if_neg h_le] + · intro fuel + have hf := hch (fuel + 1) + rw [hch_step fuel] at hf + dsimp only [checkChainAux] at hf + cases ds'' with + | nil => + rw [hdec_0_2, hnp5, Bool.and_false, Bool.or_false, Bool.and_false, + if_neg Bool.false_ne_true, if_neg Bool.false_ne_true, + if_neg (by exact Bool.false_ne_true), + if_neg h_or_f, if_pos ⟨by omega, + by omega⟩, if_neg h_d_cond1, if_neg h_d_cond2, + if_neg (show ¬(0 + epW ls < 16) by omega), hz_ls0, + if_neg h_not_25_1] at hf + have hm_sub : m'' + 3 - 3 = m'' := by omega + have hc_sub : c' + 1 - 1 = c' := by omega + have hm_mul : 2 * (c' + 1) = 2 * c' + 2 := by omega + rw [hm_sub, hc_sub, hm_mul] at hf + dsimp only [invChain] + by_cases hm_ev : m'' % 2 = 0 + · rw [if_pos hm_ev, if_neg (by intro ⟨_, hc0, _⟩; omega)]; exact hf + · rw [if_neg hm_ev, if_neg (by intro ⟨_, hc1, _⟩; omega), + if_neg (by omega)]; exact hf + | cons d_ds ds_rest => + rw [hdec_0_2, hnp5, Bool.and_false, Bool.or_false, Bool.and_false, + if_neg Bool.false_ne_true, if_neg Bool.false_ne_true, + if_neg (by exact Bool.false_ne_true), + if_neg h_or_f, if_pos ⟨by omega, + by omega⟩, if_neg h_d_cond1, if_neg h_d_cond2, + if_neg (show ¬(0 + epW ls < 16) by omega), hz_ls0, + if_neg h_not_25_1] at hf + have hm_sub : m'' + 3 - 3 = m'' := by omega + have hc_sub : c' + 1 - 1 = c' := by omega + have hm_mul : 2 * (c' + 1) = 2 * c' + 2 := by omega + rw [hm_sub, hc_sub, hm_mul] at hf + dsimp only [invChain] + by_cases hm_ev : m'' % 2 = 0 + · rw [if_pos hm_ev, if_neg (by intro ⟨_, hc0, _⟩; omega)]; exact hf + · rw [if_neg hm_ev, if_neg (by intro ⟨_, hc1, _⟩; omega), + if_neg (by omega)]; exact hf + +theorem step_Inv_ModeB_b2 (ls : List LTok) (m : Nat) (ds : List Nat) + (hinv : Inv (.ModeB_b2 ls m ds)) : + Inv (nextState (.ModeB_b2 ls m ds)) := by + cases m with + | zero => exact step_Inv_ModeB_b2_m0 ls ds hinv + | succ m' => + cases m' with + | zero => exact step_Inv_ModeB_b2_m1 ls ds hinv + | succ m'' => exact step_Inv_ModeB_b2_mge2 ls m'' ds hinv + +theorem prefSumW_of_ValidP5Chain (ls : List LTok) (h : ValidP5Chain ls = true) : + prefSumW ls = 0 := by + induction ls with + | nil => rfl + | cons tok rest ih => + cases tok with + | p5 => rfl + | p3z m => + cases m with + | zero => + dsimp [ValidP5Chain] at h + dsimp [prefSumW] + cases rest with + | nil => rfl + | cons t2 s2 => + cases t2 with + | p5 => rfl + | p3z _ => rw [Nat.zero_add]; exact ih h + | succ m' => + cases rest with + | nil => cases h + | cons t2 s2 => + cases t2 with + | p3z _ => cases h + | p5 => dsimp [prefSumW]; split_ifs <;> rfl + +theorem MustDrain_of_ValidP5Chain (ls : List LTok) (h : ValidP5Chain ls = true) : + MustDrain ls = false := by + induction ls with + | nil => rfl + | cons tok rest ih => + cases tok with + | p5 => rfl + | p3z m => + cases m with + | zero => dsimp [ValidP5Chain] at h; dsimp [MustDrain]; exact ih h + | succ m' => + cases rest with + | nil => cases h + | cons t2 s2 => + cases t2 with + | p3z _ => cases h + | p5 => dsimp [MustDrain]; split_ifs <;> rfl + +theorem ep_ge_z0 (ls : List LTok) : ep ls ≥ z0 ls := by + induction ls with + | nil => simp [z0, ep] + | cons tok rest ih => + cases tok with + | p5 => simp [z0, ep] + | p3z m => + cases m with + | zero => change 1 + z0 rest ≤ 1 + ep rest; omega + | succ _ => simp [z0] + +theorem epW_add1_ge_z0 (ls : List LTok) : epW ls + 1 ≥ z0 ls := by + induction ls with + | nil => simp [z0, epW] + | cons tok rest ih => + cases tok with + | p5 => simp [z0, epW] + | p3z m => + cases m with + | zero => + cases rest with + | nil => simp [z0, epW] + | cons t2 s2 => + cases t2 with + | p5 => simp [z0, epW] + | p3z m2 => + have h1 : epW (.p3z 0 :: .p3z m2 :: s2) = 1 + epW (.p3z m2 :: s2) := rfl + have h2 : z0 (.p3z 0 :: .p3z m2 :: s2) = 1 + z0 (.p3z m2 :: s2) := rfl + omega + | succ _ => simp [z0] + +theorem isHeadP5_false_of_z0_pos {ls : List LTok} (h : z0 ls ≥ 1) : isHeadP5 ls = false := by + cases ls with + | nil => simp [z0] at h + | cons tok _ => + cases tok with + | p5 => simp [z0] at h + | p3z _ => rfl + +theorem isHeadP3z1_false_of_z0_pos {ls : List LTok} (h : z0 ls ≥ 1) : isHeadP3z1 ls = false := by + cases ls with + | nil => simp [z0] at h + | cons tok _ => + cases tok with + | p5 => simp [z0] at h + | p3z m => cases m with | zero => rfl | succ _ => simp [z0] at h + +theorem hasP5_of_ValidP5Chain_hasOdd (ls : List LTok) (hv : ValidP5Chain ls = + true) (ho : hasOdd ls = true) : + hasP5 ls = true := by + induction ls with + | nil => cases ho + | cons tok rest ih => + cases tok with + | p5 => rfl + | p3z m => + cases m with + | zero => dsimp [ValidP5Chain] at hv; dsimp [hasOdd] at ho; dsimp [hasP5]; exact ih hv ho + | succ m' => + cases rest with + | nil => cases hv + | cons t2 s2 => + cases t2 with + | p3z _ => cases hv + | p5 => rfl + +theorem ds_ne_two_of_checkDs2_ModeE_ge2 {ls : List LTok} {k c : Nat} {ds : List Nat} + (h : checkDs2 (.ModeE_ge2 ls k c ds) = true) + (h_imp : hasP5 ls = false ∨ MustDrain ls = true ∨ k % 2 = 1 ∨ isHeadP5 ls = true ∨ + k + epSum ls < 2 * c + 6) : + ds ≠ [2] := by + intro rfl + dsimp [checkDs2] at h + rcases h_imp with hp | hm | hk | hip | hlt + · simp [hp] at h + · simp [hm] at h + · have hk0 : decide (k % 2 = 0) = false := decide_eq_false (by omega) + simp [hk0] at h + · simp [hip] at h + · simp at h; omega + +theorem d25_check_of_ge36 (cz : Nat) (ds : List Nat) : + (∀ d, ds = [d, 1] → d ≥ 25 → cz ≥ 36) → + (!(match ds with | [d, 1] => decide (d ≥ 25) | _ => false) || decide (cz ≥ 36)) = true := by + cases ds with + | nil => intro _; rfl + | cons d ds' => + cases ds' with + | nil => intro _; rfl + | cons d2 ds'' => + cases ds'' with + | nil => + cases d2 with + | zero => intro _; rfl + | succ d2' => + cases d2' with + | zero => + intro h + by_cases hd : d ≥ 25 + · simp [hd, h d rfl hd] + · simp [hd] + | succ _ => intro _; rfl + | cons _ _ => + cases d2 with + | zero => intro _; rfl + | succ d2' => + cases d2' with + | zero => intro _; rfl + | succ _ => intro _; rfl + +theorem d25_ge36_of_check {c : Nat} {ds : List Nat} + (h : (!(match ds with | [d, 1] => decide (d ≥ 25) | _ => false) || decide (c ≥ 36)) = true) : + ∀ d, ds = [d, 1] → d ≥ 25 → c ≥ 36 := by + intro d rfl hd + simpa [hd] using h + +theorem GoodPhiW_d25_ge35 {phiW : Nat} {d : Nat} (hd : d ≥ 25) + (h : GoodPhiW phiW [d, 1] false = true) : phiW ≥ 35 := by + dsimp only [GoodPhiW] at h + split_ifs at h with h1 h2 h3 h4 h5 + · cases h1 + · cases h2 + · cases h3 + · cases h4 + · exact of_decide_eq_true h + · exfalso; apply h5; exact decide_eq_true hd + · exfalso; apply h5; exact decide_eq_true hd + +theorem prefSumW_p3z_m2_bound (m2 : Nat) (ls' : List LTok) (k c : Nat) + (hk1 : k ≤ 2 * c + 4) (hk2 : k + prefSumW (.p3z (m2 + 2) :: ls') ≤ 2 * c + 6) : + k + prefSumW (.p3z m2 :: ls') ≤ 2 * c + 4 := by + by_cases hm : m2 % 2 = 1 + · have h0 : prefSumW (.p3z m2 :: ls') = 0 := by dsimp [prefSumW]; rw [if_pos hm] + omega + · by_cases hp5 : isHeadP5 ls' = true + · have h0 : prefSumW (.p3z m2 :: ls') = 0 := by + dsimp [prefSumW]; rw [if_neg hm] + cases ls' with | nil => cases hp5 | cons t s => cases t with | p3z _ => cases hp5 | p5 => + rfl + omega + · have hp5_f : isHeadP5 ls' = false := Bool.eq_false_iff.mpr hp5 + have := prefSumW_p3z_add2 m2 ls' (by omega) hp5_f + omega + +theorem ValidP5Chain_p3z_succ {m : Nat} {ls' : List LTok} + (h : ValidP5Chain (.p3z (m + 1) :: ls') = true) : + ∃ suf, ls' = .p5 :: suf ∧ z0 suf ≥ 18 ∧ ValidP5Chain suf = true := by + cases ls' with + | nil => cases h + | cons t suf => + cases t with + | p3z _ => cases h + | p5 => + dsimp [ValidP5Chain] at h + simp only [Bool.and_eq_true, decide_eq_true_eq] at h + exact ⟨suf, rfl, h.1, h.2⟩ + +theorem GoodPhiW_of_ge17_and_d25 (phiW : Nat) (ds : List Nat) (hne2 : ds ≠ [2]) + (h17 : phiW ≥ 17) + (hd25 : ∀ d, ds = [d, 1] → d ≥ 25 → phiW ≥ 35) : + GoodPhiW phiW ds false = true := by + dsimp [GoodPhiW] + simp only [Bool.false_or] + rw [if_neg hne2] + split_ifs with h0 h1 h2 h3 h4 + · exact decide_eq_true (by omega) + · exact decide_eq_true (by omega) + · exact decide_eq_true (by omega) + · cases ds with + | nil => cases h2 rfl + | cons d ds' => + cases ds' with + | nil => cases h3 + | cons d2 ds'' => + cases ds'' with + | nil => + cases d2 with + | zero => cases h3 + | succ d2' => + cases d2' with + | zero => + have hd : d ≥ 25 := of_decide_eq_true h3 + have := hd25 d rfl hd + exact decide_eq_true (by omega) + | succ _ => cases h3 + | cons _ _ => + cases d2 with + | zero => cases h3 + | succ d2' => cases d2' <;> cases h3 + · exact decide_eq_true (by omega) + · exact decide_eq_true (by omega) + +theorem step_Inv_ModeE_ge2_nil (k c : Nat) (ds : List Nat) + (hinv : Inv (.ModeE_ge2 [] k c ds)) : + Inv (.ModeB_ge3 [] k c ds) := by + have hc := hinv.1 + have hch := hinv.2 + dsimp only [invCore] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨h_guards, hc⟩ + simp only [Bool.or_eq_false_iff, not_bool_eq_false] at h_guards + rcases h_guards with ⟨⟨hgd, hds2⟩, hds1⟩ + have hne2 : ds ≠ [2] := ds_ne_two_of_checkDs2_ModeE_ge2 hds2 (Or.inl rfl) + have hds2' : checkDs2 (.ModeB_ge3 [] k c ds) = true := by + dsimp [checkDs2]; rw [if_pos hne2] + by_cases hk : k % 2 = 0 + · rw [if_pos hk] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨_, hc⟩ + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hk_le, hc⟩ + rw [not_bool_eq_false, decide_eq_true_eq] at hk_le + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hok_phi, _⟩ + rw [not_bool_eq_false] at hok_phi + have hphiw_c : GoodPhiW c ds false = true := by + dsimp [isHeadP5, isHeadP3z1, epW, MustDrain, hasP5] at hok_phi + simpa using hok_phi + have hds1' : checkDs1Phi1 (.ModeB_ge3 [] k c ds) = true := by + dsimp [checkDs1Phi1] at hds1 ⊢ + by_cases h1 : ds = [1] + · simp [h1, hk, isHeadP5, epW, hasP5] at hds1 ⊢ + by_cases hc1 : c = 1 + · subst hc1; simp at hds1 + · simp [hc1] + · simp [h1] + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs ds || !checkDs2 (.ModeB_ge3 [] k c ds) || !checkDs1Phi1 (.ModeB_ge3 [] k c + ds)) = false := by + simp [hgd, hds2', hds1'] + rw [bool_if_false_eq_self h_g, if_pos hk] + have h_even_nil : (!ValidEvenLs []) = false := rfl + rw [bool_if_false_eq_self h_even_nil] + have hok_all : (if (!isHeadP5 []) = true then + decide (k + prefSumW [] ≤ 2 * c + 4) && + ((decide (ds = [] ∧ c + epW [] = 1) && MustDrain [] && + decide (c + ep [] = 1 ∧ k + epSum [] + 2 * ep [] + 2 = 2) && + hasP5 [] && decide (preP5Val [] ≥ 16 ∧ z0 (p5Suf []) ≥ 38)) || + GoodPhiW (c + epW []) ds false) && + (!decide (c = 0) || decide (epW [.p3z k] ≥ 1)) + else if c = 0 then decide (ds = [] ∧ (k = 0 ∨ k ≥ 22 ∧ z0 (p5Suf []) ≥ 38)) + else GoodPhiW (c - 1) ds false) = true := by + have hepw1 : epW [.p3z k] = 1 := by dsimp [epW]; rw [if_neg (by omega)] + have hpref_nil : prefSumW [] = 0 := rfl + have hd1 : decide ((1 : Nat) ≥ 1) = true := rfl + rw [hepw1, hpref_nil, hd1] + simp only [isHeadP5, epW, hasP5, hphiw_c, Bool.or_true, Bool.and_true, + decide_eq_true_eq, ↓reduceIte, Bool.not_false, Nat.add_zero] + exact hk_le.1 + rw [not_bool_if_false_eq_true hok_all] + dsimp [MustDrain, hasOdd] + · intro fuel + have hf := hch fuel + dsimp only [invChain] at hf ⊢ + rw [if_pos hk, if_neg (by simp [isHeadP3z1])] at hf + rw [if_pos hk, if_neg (by simp [isHeadP5])] + rw [← checkChainAux_true_E_ge2_to_B_ge3_nil fuel k c ds hk] + exact hf + · have hm1 : k % 2 = 1 := by omega + rw [if_neg hk] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨_, hc⟩ + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hck, hc⟩ + rw [not_bool_eq_false, decide_eq_true_eq] at hck + have h_not_b1 : ¬(ds = [] ∧ k = 1 ∧ c = 1 ∧ isP3zP5 [] = true ∧ headP3zVal [] ≥ 3) := by + simp [isP3zP5] + have h_not_b2 : ¬(ds = [] ∧ ((k = 1 ∧ c = 1 ∧ z0 [] = 1) ∨ (k = 3 ∧ c = 2 ∧ z0 [] = 0)) ∧ + isP3zP5 (dropZ0 []) = true ∧ headP3zVal (dropZ0 []) ≥ 18 ∧ z0 (p5Suf []) ≥ 38) := by + simp [dropZ0, isP3zP5] + rw [if_neg h_not_b1, if_neg h_not_b2] at hc + have hz0_nil : z0 [] = 0 := rfl + rw [hz0_nil] at hc + simp only [Nat.add_zero, Nat.mul_zero, Bool.and_eq_true] at hc + rcases hc with ⟨⟨⟨hok_base, hc_9⟩, hc_1⟩, _⟩ + have hck_8_15 : c ≥ 8 ∧ k ≥ 15 := by + split_ifs at hok_base <;> (simp_all; try omega) + have hf1 := hch 1 + dsimp only [invChain] at hf1 + rw [if_neg hk, if_neg h_not_b1, if_neg h_not_b2] at hf1 + dsimp only [checkChainAux, z0, dropZ0, isHeadP5] at hf1 + simp only [Nat.add_zero, Bool.not_false, Bool.true_and] at hf1 + rw [bool_if_false_eq_true] at hf1 + rcases hf1 with ⟨hphiw_f, hf1⟩ + rw [not_bool_eq_false] at hphiw_f + simp only [Bool.and_eq_true] at hf1 + have hgp : GoodPsi (c - 1) ds = true := hf1.1 + have hds1' : checkDs1Phi1 (.ModeB_ge3 [] k c ds) = true := by + dsimp [checkDs1Phi1] + by_cases h1 : ds = [1] + · simp only [h1, not_true_eq_false, ↓reduceIte] + rw [if_neg hk] + have hc2 : decide (c = 2) = false := decide_eq_false (by omega) + rw [hc2]; rfl + · simp [h1] + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs ds || !checkDs2 (.ModeB_ge3 [] k c ds) || !checkDs1Phi1 (.ModeB_ge3 [] k c + ds)) = false := by + simp [hgd, hds2', hds1'] + rw [bool_if_false_eq_self h_g, if_neg hk, if_neg (by omega)] + have heven_k : ValidEvenLs [.p3z k] = true := by + dsimp [ValidEvenLs]; rw [if_neg hk]; rfl + rw [not_bool_if_false_eq_true heven_k] + have hrst_f : decide (k = 1 ∧ c = 1 ∧ ds = []) = false := decide_eq_false (by omega) + have hok_c1 : (if c ≥ 1 then + if (!decide (k = 1 ∧ c = 1 ∧ ds = [])) = true then + (decide (ds = [] ∧ c = 2 ∧ k = 3) && MustDrain [.p3z k] && + hasP5 [] && decide (preP5Val [.p3z k] ≥ 16 ∧ z0 (p5Suf []) ≥ 38)) || + GoodPhiW (c - 1) ds false + else true + else true) = true := by + rw [if_pos (by omega), hrst_f, if_pos (by decide), hphiw_f, Bool.or_true] + rw [not_bool_if_false_eq_true hok_c1] + have hmd_t : MustDrain [.p3z k] = true := by dsimp [MustDrain]; rw [if_pos hm1] + have hdec_gt : decide (k > 2 * c + 3) = false := decide_eq_false (by omega) + rw [hmd_t, hdec_gt, Bool.and_false, if_neg Bool.false_ne_true, if_pos hck.2, hrst_f, + if_neg Bool.false_ne_true] + rw [hgp, Bool.true_and] + have h_ds1_ok : ((!decide (ds = [1] ∧ c - 1 ≥ 24)) || decide (k ≥ 37)) = true := by + by_cases h1 : ds = [1] + · simp [h1] at hc_1; simp [hc_1] + · simp [h1] + have h_ds0_ok : ((!decide ((ds = [] ∨ ds = [0]) ∧ c - 1 ≥ 8 ∧ + ((!hasP5 []) = true ∨ true = true))) || + decide (k ≥ 17)) = true := by + by_cases h0 : (ds = [] ∨ ds = [0]) ∧ c - 1 ≥ 8 + · have hc9 : ((ds = [] ∨ ds = [0]) ∧ + c ≥ 9) ∨ isOddDrainDs ds = true := Or.inl ⟨h0.1, by omega⟩ + have hc9_d : decide (((ds = [] ∨ ds = [0]) ∧ c ≥ 9) ∨ isOddDrainDs ds = true) = true := + decide_eq_true hc9 + rw [hc9_d] at hc_9 + simp only [Bool.not_true, Bool.false_or, decide_eq_true_eq] at hc_9 + simp [hc_9] + · have h_f : decide ((ds = [] ∨ ds = [0]) ∧ c - 1 ≥ 8 ∧ + ((!hasP5 []) = true ∨ true = true)) = false := + decide_eq_false (fun ⟨h_a, h_b, _⟩ => h0 ⟨h_a, h_b⟩) + rw [h_f]; rfl + have h15_7 : decide (k ≥ 15 ∧ c - 1 ≥ 7) = true := decide_eq_true (by omega) + rw [h_ds1_ok, h_ds0_ok, h15_7] + simp + · intro fuel + cases fuel with + | zero => + dsimp [invChain] + rw [if_neg hk, if_neg (by omega), if_neg (by omega)] + rfl + | succ fuel' => + have hf := hch (fuel' + 1) + dsimp only [invChain] at hf ⊢ + rw [if_neg hk, if_neg h_not_b1, if_neg h_not_b2] at hf + rw [if_neg hk, if_neg (show ¬(k = 1 ∧ c = 1 ∧ + ds = []) by omega), if_neg (show c ≠ 0 by omega)] + dsimp only [checkChainAux, z0, dropZ0, isHeadP5] at hf + simp only [Nat.add_zero, Nat.mul_zero, Bool.not_false, Bool.true_and, hphiw_f, + Bool.not_true, Bool.false_eq_true, ↓reduceIte, hgp] at hf + have hodd_k : hasOdd [.p3z k] = true := by dsimp [hasOdd]; rw [if_pos hm1] + have hepsum_k : epSum [.p3z k] = k - 1 := by dsimp [epSum]; rw [if_pos hm1] + have hep_k : ep [.p3z k] = 0 := by dsimp [ep]; rw [if_pos hm1] + have hmd_k : MustDrain [.p3z k] = true := by dsimp [MustDrain]; rw [if_pos hm1] + have hp5_k : hasP5 [.p3z k] = false := rfl + have hdec_m : decide (2 * c + 2 ≥ 0 + (k - 1)) = true := decide_eq_true (by omega) + dsimp only [checkChainAux] + rw [hodd_k, hepsum_k, hep_k, hmd_k, hp5_k, hdec_m] + simp only [Bool.and_true, ↓reduceIte, Bool.not_true, Bool.false_eq_true, Nat.add_zero, + Nat.zero_add, Nat.mul_zero] + have hk3 : k - 1 + 3 = k + 2 := by omega + have hk2 : k - 1 + 2 = k + 1 := by omega + rw [hk3, hk2] + exact hf + +theorem step_Inv_ModeE_ge2_p3z0 (ls' : List LTok) (k c : Nat) (ds : List Nat) + (hinv : Inv (.ModeE_ge2 (.p3z 0 :: ls') k c ds)) : + Inv (.ModeE_ge2 ls' (k + 2) (c + 1) ds) := by + have hc := hinv.1 + have hch := hinv.2 + dsimp only [invCore] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨h_guards, hc⟩ + simp only [Bool.or_eq_false_iff, not_bool_eq_false] at h_guards + rcases h_guards with ⟨⟨hgd, hds2⟩, hds1⟩ + by_cases hk : k % 2 = 0 + · have hk2_ev : (k + 2) % 2 = 0 := by omega + rw [if_pos hk] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨heven, hc⟩ + rw [not_bool_eq_false, ValidEvenLs_p3z_even_cons 0 ls' rfl] at heven + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hk_le, hc⟩ + rw [not_bool_eq_false, decide_eq_true_eq] at hk_le + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hok_phi, hc⟩ + rw [not_bool_eq_false] at hok_phi + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hmd_bound, hc⟩ + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨_, hodd_branch⟩ + have hepsum_eq := epSum_p3z_even_cons 0 ls' rfl + have hep_eq := ep_p3z_even_cons 0 ls' rfl + have hodd_eq := hasOdd_p3z_even_cons 0 ls' rfl + have hmd_eq := MustDrain_p3z_even_cons 0 ls' rfl + by_cases hp5 : isHeadP5 ls' = true + · have h_ls : ∃ suf, ls' = .p5 :: suf := by + cases ls' with + | nil => cases hp5 + | cons t2 s2 => cases t2 with | p3z _ => cases hp5 | p5 => exact ⟨s2, rfl⟩ + obtain ⟨suf, rfl⟩ := h_ls + have hne2 : ds ≠ [2] := by + apply ds_ne_two_of_checkDs2_ModeE_ge2 hds2 + refine Or.inr (Or.inr (Or.inr (Or.inr ?_))) + dsimp [epSum]; omega + have hds2' : checkDs2 (.ModeE_ge2 (.p5 :: suf) (k + 2) (c + 1) ds) = true := by + dsimp [checkDs2]; rw [if_pos hne2] + have hds1' : checkDs1Phi1 (.ModeE_ge2 (.p5 :: suf) (k + 2) (c + 1) ds) = true := by + dsimp [checkDs1Phi1] at hds1 ⊢ + by_cases h1 : ds = [1] + · simp [h1, hk, hk2_ev, isHeadP5, epW] at hds1 ⊢ + by_cases hc1 : c = 1 + · subst hc1 + simp [hasP5, MustDrain, epSum] at hds1 + omega + · simp [hc1] + · simp [h1] + have hphiw_c : GoodPhiW c ds false = true := by + dsimp [isHeadP5, isHeadP3z1, epW, MustDrain] at hok_phi + simpa using hok_phi + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs ds || !checkDs2 (.ModeE_ge2 (.p5 :: suf) (k + 2) (c + 1) ds) || + !checkDs1Phi1 (.ModeE_ge2 (.p5 :: suf) (k + 2) (c + 1) ds)) = false := by + simp [hgd, hds2', hds1'] + rw [bool_if_false_eq_self h_g, if_pos hk2_ev, not_bool_if_false_eq_true heven] + have hpref0 : prefSumW (.p5 :: suf) = 0 := rfl + rw [hpref0, Nat.add_zero, not_decide_if_false_eq_true (by omega)] + have hok_phi' : (if (!isHeadP5 (.p5 :: suf)) = true then + (decide (ds = [] ∧ c + 1 + epW (.p5 :: suf) = 1) && MustDrain (.p5 :: suf) && + decide (c + 1 + ep (.p5 :: suf) = 1 ∧ + k + 2 + epSum (.p5 :: suf) + 2 * ep (.p5 :: suf) = 2) && + hasP5 (.p5 :: suf) && decide (preP5Val (.p5 :: suf) ≥ 16 ∧ + z0 (p5Suf (.p5 :: suf)) ≥ 38)) || + GoodPhiW (c + 1 + epW (.p5 :: suf)) ds (isHeadP3z1 (.p5 :: suf) && decide (k + 2 = 0 ∧ + c + 1 = 0 ∧ ds = [])) + else + decide (c + 1 = 0 ∧ ds = [] ∧ k + 2 = 2) || + (decide (c + 1 ≥ 1) && GoodPhiW (c + 1 - 1) ds false)) = true := by + dsimp [isHeadP5] + simp [hphiw_c] + rw [not_bool_if_false_eq_true hok_phi'] + dsimp [MustDrain, isHeadP3z1, hasOdd] + · intro fuel + have hf := hch fuel + dsimp only [invChain] at hf ⊢ + rw [if_pos hk, if_neg (by simp [isHeadP3z1])] at hf + rw [if_pos hk2_ev, if_neg (by simp [isHeadP3z1])] + have h_shift := checkChainAux_true_p3z0 fuel (.p5 :: suf) (c + 1) k (2 * c + 4) ds + (Or.inr (by dsimp [epSum]; omega)) + have hm_eq : 2 * (c + 1) + 4 = 2 * c + 4 + 2 := by omega + rw [hm_eq, ← h_shift] + exact hf + · have hp5_f : isHeadP5 ls' = false := Bool.eq_false_iff.mpr hp5 + have hepw_eq := epW_p3z_even_cons 0 ls' rfl hp5_f + have hpref_eq := prefSumW_p3z_even_cons 0 ls' rfl hp5_f + have hpre_eq := preP5Val_p3z_cons_of_not_headP5 0 ls' hp5_f + have hip5_0 : isHeadP5 (.p3z 0 :: ls') = false := rfl + have hds2' : checkDs2 (.ModeE_ge2 ls' (k + 2) (c + 1) ds) = true := by + dsimp [checkDs2] at hds2 ⊢ + by_cases h2 : ds = [2] + · rw [if_neg (not_not.mpr h2)] at hds2 ⊢ + have hd_k : decide (k % 2 = 0) = true := decide_eq_true hk + have hd_k2 : decide ((k + 2) % 2 = 0) = true := decide_eq_true hk2_ev + rw [hip5_0, hmd_eq, hepsum_eq, Nat.zero_add, hd_k] at hds2 + rw [hp5_f, hd_k2] + dsimp [hasP5, p5Suf] at hds2 + rw [show decide (k + 2 + epSum ls' ≥ 2 * (c + 1) + 6) = + decide (k + epSum ls' ≥ 2 * c + 6) from + decide_eq_of_iff (by omega)] + exact hds2 + · rw [if_pos h2] + have hds1' : checkDs1Phi1 (.ModeE_ge2 ls' (k + 2) (c + 1) ds) = true := by + dsimp [checkDs1Phi1] at hds1 ⊢ + by_cases h1 : ds = [1] + · simp only [h1, not_true_eq_false, ↓reduceIte] at hds1 ⊢ + rw [if_pos hk, hip5_0] at hds1 + rw [if_pos hk2_ev, hp5_f] + simp only [Bool.false_eq_true, ↓reduceIte] at hds1 ⊢ + have hpw_eq : c + 1 + epW ls' = c + epW (.p3z 0 :: ls') := by omega + rw [hpw_eq] + by_cases he1 : c + epW (.p3z 0 :: ls') = 1 + · rw [decide_eq_true he1] at hds1 ⊢ + simp only [Bool.not_true, Bool.false_eq_true, ↓reduceIte] at hds1 ⊢ + rw [hmd_eq, hepsum_eq, Nat.zero_add] at hds1 + dsimp [hasP5] at hds1 + rw [show decide (k + 2 + epSum ls' ≥ 2 * (c + 1) + 14) = + decide (k + epSum ls' ≥ 2 * c + 14) from + decide_eq_of_iff (by omega)] + exact hds1 + · simp [decide_eq_false he1] + · simp [h1] + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs ds || !checkDs2 (.ModeE_ge2 ls' (k + 2) (c + 1) ds) || + !checkDs1Phi1 (.ModeE_ge2 ls' (k + 2) (c + 1) ds)) = false := by + simp [hgd, hds2', hds1'] + rw [bool_if_false_eq_self h_g, if_pos hk2_ev, not_bool_if_false_eq_true heven] + rw [hpref_eq, Nat.zero_add] at hk_le + rw [not_decide_if_false_eq_true (by omega)] + have h_np5 : (!isHeadP5 ls') = true := by rw [hp5_f]; rfl + have h_np5_0 : (!isHeadP5 (.p3z 0 :: ls')) = true := rfl + rw [if_pos h_np5_0] at hok_phi + have hstart_0 : (isHeadP3z1 (.p3z 0 :: ls') && decide (k = 0 ∧ c = 0 ∧ ds = [])) = false := + rfl + have hstart_1 : (isHeadP3z1 ls' && decide (k + 2 = 0 ∧ c + 1 = 0 ∧ ds = [])) = false := by + have hne : decide (k + 2 = 0 ∧ c + 1 = 0 ∧ ds = []) = false := decide_eq_false (by omega) + rw [hne, Bool.and_false] + rw [hstart_0] at hok_phi + have hok_phi' : (if (!isHeadP5 ls') = true then + (decide (ds = [] ∧ c + 1 + epW ls' = 1) && MustDrain ls' && + decide (c + 1 + ep ls' = 1 ∧ k + 2 + epSum ls' + 2 * ep ls' = 2) && + hasP5 ls' && decide (preP5Val ls' ≥ 16 ∧ z0 (p5Suf ls') ≥ 38)) || + GoodPhiW (c + 1 + epW ls') ds (isHeadP3z1 ls' && decide (k + 2 = 0 ∧ c + 1 = 0 ∧ + ds = [])) + else + decide (c + 1 = 0 ∧ ds = [] ∧ + k + 2 = 2) || (decide (c + 1 ≥ 1) && GoodPhiW (c + 1 - 1) ds false)) = true := by + rw [if_pos h_np5, hstart_1] + have hpw_eq : c + 1 + epW ls' = c + epW (.p3z 0 :: ls') := by omega + have hp_eq : c + 1 + ep ls' = c + ep (.p3z 0 :: ls') := by omega + have hx_eq : k + 2 + epSum ls' + 2 * ep ls' = + k + epSum (.p3z 0 :: ls') + 2 * ep (.p3z 0 :: ls') := by omega + rw [hpw_eq, hp_eq, hx_eq, ← hmd_eq, ← hpre_eq] + exact hok_phi + rw [not_bool_if_false_eq_true hok_phi'] + have hmd_bound' : (MustDrain ls' && decide (2 * (c + 1) + 4 < k + 2 + epSum ls')) = false := + by + rw [hmd_eq, hepsum_eq, Nat.zero_add] at hmd_bound + rw [show decide (2 * (c + 1) + 4 < k + 2 + epSum ls') = + decide (2 * c + 4 < k + epSum ls') from + decide_eq_of_iff (by omega)] + exact hmd_bound + rw [bool_if_false_eq_self hmd_bound'] + have hrst_f : (decide (k + 2 = 0 ∧ c + 1 = 0 ∧ ds = []) && isHeadP3z1 ls') = false := by + have hne : decide (k + 2 = 0 ∧ c + 1 = 0 ∧ ds = []) = false := decide_eq_false (by omega) + rw [hne, Bool.false_and] + rw [hrst_f] + simp only [Bool.false_eq_true, ↓reduceIte, Bool.not_true] + have hrst_0 : (decide (k = 0 ∧ c = 0 ∧ ds = []) && isHeadP3z1 (.p3z 0 :: ls')) = false := by + simp [isHeadP3z1] + have hepsum_0 : epSum (.p3z 0 :: ls') = epSum ls' := by rw [hepsum_eq, Nat.zero_add] + have hp5_0 : hasP5 (.p3z 0 :: ls') = hasP5 ls' := rfl + have hpsuf_0 : p5Suf (.p3z 0 :: ls') = p5Suf ls' := rfl + rw [hodd_eq, hepsum_0, hp5_0, hpsuf_0] at hodd_branch + have hd_odd : decide (2 * (c + 1) + 4 ≥ k + 2 + epSum ls') = + decide (2 * c + 4 ≥ k + epSum ls') := + decide_eq_of_iff (by omega) + rw [hd_odd] + by_cases h_cond : (hasOdd ls' && decide (2 * c + 4 ≥ k + epSum ls')) = true + · rw [if_pos h_cond, hrst_0, if_neg Bool.false_ne_true] at hodd_branch + rw [if_pos h_cond] + have hp_eq : c + 1 + ep ls' = c + ep (.p3z 0 :: ls') := by omega + have hx_eq : k + 2 + epSum ls' + 2 * ep ls' = k + epSum ls' + 2 * ep (.p3z 0 :: ls') := by + omega + rw [hp_eq, hx_eq, ← hmd_eq, ← hpre_eq] + exact hodd_branch + · rw [if_neg h_cond] + · intro fuel + have hf := hch fuel + dsimp only [invChain] at hf ⊢ + rw [if_pos hk, if_neg (by simp [isHeadP3z1])] at hf + rw [if_pos hk2_ev, if_neg (show ¬(k + 2 = 0 ∧ c + 1 = 0 ∧ ds = [] ∧ + isHeadP3z1 ls' = true) by omega)] + have h_shift := checkChainAux_true_p3z0 fuel ls' (c + 1) k (2 * c + 4) ds (Or.inl hp5_f) + have hm_eq : 2 * (c + 1) + 4 = 2 * c + 4 + 2 := by omega + rw [hm_eq, ← h_shift] + exact hf + · have hm1 : k % 2 = 1 := by omega + have hk2_odd : ¬((k + 2) % 2 = 0) := by omega + have hne2 : ds ≠ [2] := ds_ne_two_of_checkDs2_ModeE_ge2 hds2 (Or.inr (Or.inr (Or.inl hm1))) + have hds2' : checkDs2 (.ModeE_ge2 ls' (k + 2) (c + 1) ds) = true := by + dsimp [checkDs2]; rw [if_pos hne2] + have hds1' : checkDs1Phi1 (.ModeE_ge2 ls' (k + 2) (c + 1) ds) = true := by + dsimp [checkDs1Phi1] + by_cases h1 : ds = [1] + · simp only [h1, not_true_eq_false, ↓reduceIte]; rw [if_neg hk2_odd]; rfl + · simp [h1] + rw [if_neg hk] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hvp5, hc⟩ + rw [not_bool_eq_false] at hvp5 + dsimp [ValidP5Chain] at hvp5 + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hck, hc⟩ + rw [not_bool_eq_false, decide_eq_true_eq] at hck + have h_not_b1_0 : ¬(ds = [] ∧ k = 1 ∧ c = 1 ∧ isP3zP5 (.p3z 0 :: ls') = true ∧ + headP3zVal (.p3z 0 :: ls') ≥ 3) := by + dsimp [headP3zVal]; omega + have h_not_b1_1 : ¬(ds = [] ∧ k + 2 = 1 ∧ c + 1 = 1 ∧ isP3zP5 ls' = true ∧ + headP3zVal ls' ≥ 3) := by + omega + rw [if_neg h_not_b1_0] at hc + have hz_eq : c + 1 + z0 ls' = c + z0 (.p3z 0 :: ls') := by + change c + 1 + z0 ls' = c + (1 + z0 ls'); omega + have hk_eq : k + 2 + 2 * z0 ls' = k + 2 * z0 (.p3z 0 :: ls') := by + change k + 2 + 2 * z0 ls' = k + 2 * (1 + z0 ls'); omega + have hb2_iff : (ds = [] ∧ ((k + 2 = 1 ∧ c + 1 = 1 ∧ z0 ls' = 1) ∨ (k + 2 = 3 ∧ c + 1 = 2 ∧ + z0 ls' = 0)) ∧ + isP3zP5 (dropZ0 ls') = true ∧ headP3zVal (dropZ0 ls') ≥ 18 ∧ z0 (p5Suf ls') ≥ 38) ↔ + (ds = [] ∧ ((k = 1 ∧ c = 1 ∧ z0 (.p3z 0 :: ls') = 1) ∨ (k = 3 ∧ c = 2 ∧ + z0 (.p3z 0 :: ls') = 0)) ∧ + isP3zP5 (dropZ0 (.p3z 0 :: ls')) = true ∧ headP3zVal (dropZ0 (.p3z 0 :: ls')) ≥ 18 ∧ + z0 (p5Suf (.p3z 0 :: ls')) ≥ 38) := by + dsimp [z0, dropZ0, p5Suf] + constructor + · rintro ⟨rfl, h_or, hp3, hh, hz⟩ + refine ⟨rfl, ?_, hp3, hh, hz⟩ + rcases h_or with ⟨hk1, _, _⟩ | ⟨hk3, hc2, hz0⟩ + · omega + · exact Or.inl ⟨by omega, by omega, by omega⟩ + · rintro ⟨rfl, h_or, hp3, hh, hz⟩ + refine ⟨rfl, ?_, hp3, hh, hz⟩ + rcases h_or with ⟨rfl, rfl, hz1⟩ | ⟨_, _, hz0⟩ + · exact Or.inr ⟨rfl, rfl, by omega⟩ + · omega + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs ds || !checkDs2 (.ModeE_ge2 ls' (k + 2) (c + 1) ds) || + !checkDs1Phi1 (.ModeE_ge2 ls' (k + 2) (c + 1) ds)) = false := by + simp [hgd, hds2', hds1'] + rw [bool_if_false_eq_self h_g, if_neg hk2_odd, not_bool_if_false_eq_true hvp5] + rw [not_decide_if_false_eq_true (by omega)] + rw [if_neg h_not_b1_1] + by_cases hb2 : ds = [] ∧ ((k + 2 = 1 ∧ c + 1 = 1 ∧ z0 ls' = 1) ∨ (k + 2 = 3 ∧ c + 1 = 2 ∧ + z0 ls' = 0)) ∧ + isP3zP5 (dropZ0 ls') = true ∧ headP3zVal (dropZ0 ls') ≥ 18 ∧ z0 (p5Suf ls') ≥ 38 + · rw [if_pos hb2] + · rw [if_neg hb2] + rw [if_neg (fun h => hb2 (hb2_iff.mpr h))] at hc + rw [hz_eq, hk_eq] + exact hc + · intro fuel + have hf := hch fuel + dsimp only [invChain] at hf ⊢ + rw [if_neg hk, if_neg h_not_b1_0] at hf + rw [if_neg hk2_odd, if_neg h_not_b1_1] + by_cases hb2 : ds = [] ∧ ((k + 2 = 1 ∧ c + 1 = 1 ∧ z0 ls' = 1) ∨ (k + 2 = 3 ∧ c + 1 = 2 ∧ + z0 ls' = 0)) ∧ + isP3zP5 (dropZ0 ls') = true ∧ headP3zVal (dropZ0 ls') ≥ 18 ∧ z0 (p5Suf ls') ≥ 38 + · rw [if_pos hb2] + rw [if_pos (hb2_iff.mp hb2)] at hf + exact hf + · rw [if_neg hb2] + rw [if_neg (fun h => hb2 (hb2_iff.mpr h))] at hf + rw [← checkChainAux_false_p3z0 fuel ls' c k 0 ds] + exact hf + +theorem step_Inv_ModeE_ge2_p5 (ls' : List LTok) (k c : Nat) (ds : List Nat) + (hinv : Inv (.ModeE_ge2 (.p5 :: ls') k c ds)) : + Inv (.ModeE_ge2 ls' (k + 3) (c + 2) ds) := by + have hc := hinv.1 + have hch := hinv.2 + dsimp only [invCore] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨h_guards, hc⟩ + simp only [Bool.or_eq_false_iff, not_bool_eq_false] at h_guards + rcases h_guards with ⟨⟨hgd, hds2⟩, hds1⟩ + have hne2 : ds ≠ [2] := + ds_ne_two_of_checkDs2_ModeE_ge2 hds2 (Or.inr (Or.inr (Or.inr (Or.inl rfl)))) + have hds2' : checkDs2 (.ModeE_ge2 ls' (k + 3) (c + 2) ds) = true := by + dsimp [checkDs2]; rw [if_pos hne2] + by_cases hk : k % 2 = 0 + · have hk3_odd : ¬((k + 3) % 2 = 0) := by omega + have hds1' : checkDs1Phi1 (.ModeE_ge2 ls' (k + 3) (c + 2) ds) = true := by + dsimp [checkDs1Phi1] + by_cases h1 : ds = [1] + · simp [h1, hk3_odd] + · simp [h1] + rw [if_pos hk] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨heven, hc⟩ + rw [not_bool_eq_false] at heven + dsimp [ValidEvenLs] at heven + simp only [Bool.and_eq_true, decide_eq_true_eq] at heven + rcases heven with ⟨hz18, hvp5⟩ + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hk_le, hc⟩ + rw [not_bool_eq_false, decide_eq_true_eq] at hk_le + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hok_phi, _⟩ + rw [not_bool_eq_false] at hok_phi + dsimp [isHeadP5] at hok_phi + have h_not_b1 : ¬(ds = [] ∧ k + 3 = 1 ∧ c + 2 = 1 ∧ isP3zP5 ls' = true ∧ + headP3zVal ls' ≥ 3) := by omega + have h_not_b2 : ¬(ds = [] ∧ ((k + 3 = 1 ∧ c + 2 = 1 ∧ z0 ls' = 1) ∨ (k + 3 = 3 ∧ c + 2 = 2 ∧ + z0 ls' = 0)) ∧ + isP3zP5 (dropZ0 ls') = true ∧ headP3zVal (dropZ0 ls') ≥ 18 ∧ z0 (p5Suf ls') ≥ 38) := by + omega + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs ds || !checkDs2 (.ModeE_ge2 ls' (k + 3) (c + 2) ds) || + !checkDs1Phi1 (.ModeE_ge2 ls' (k + 3) (c + 2) ds)) = false := by + simp [hgd, hds2', hds1'] + rw [bool_if_false_eq_self h_g, if_neg hk3_odd, not_bool_if_false_eq_true hvp5] + rw [not_decide_if_false_eq_true (by omega)] + rw [if_neg h_not_b1, if_neg h_not_b2] + have h20 : decide (c + 2 + z0 ls' ≥ 20 ∧ k + 3 + 2 * z0 ls' ≥ 15) = true := + decide_eq_true (by omega) + have h8 : decide (c + 2 + z0 ls' ≥ 8 ∧ k + 3 + 2 * z0 ls' ≥ 15) = true := + decide_eq_true (by omega) + rw [h20, h8, ite_self] + have h17 : decide (k + 3 + 2 * z0 ls' ≥ 17) = true := decide_eq_true (by omega) + have h37 : decide (k + 3 + 2 * z0 ls' ≥ 37) = true := decide_eq_true (by omega) + rw [h17, h37] + simp only [Bool.true_and, Bool.or_true] + apply d25_check_of_ge36 + intro d hd_eq hd25 + cases Bool.or_eq_true_iff.mp hok_phi with + | inl h0 => + simp only [decide_eq_true_eq] at h0 + rcases h0 with ⟨_, rfl, _⟩ + cases hd_eq + | inr hc1 => + simp only [Bool.and_eq_true, decide_eq_true_eq] at hc1 + rcases hc1 with ⟨_, hphiw⟩ + subst hd_eq + have := GoodPhiW_d25_ge35 hd25 hphiw + omega + · intro fuel + have hf := hch (fuel + 1) + dsimp only [invChain] at hf ⊢ + rw [if_pos hk, if_neg (by simp [isHeadP3z1])] at hf + rw [if_neg hk3_odd, if_neg h_not_b1, if_neg h_not_b2] + dsimp only [checkChainAux, hasOdd, hasP5, isHeadP5, p5Suf, ep, epSum] at hf + simp only [Bool.false_and, Bool.false_eq_true, ↓reduceIte, Bool.not_false, Bool.true_and, + Bool.true_or, Nat.add_zero] at hf + exact hf + · have hm1 : k % 2 = 1 := by omega + have hk3_ev : (k + 3) % 2 = 0 := by omega + rw [if_neg hk] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hvp5_p5, hc⟩ + rw [not_bool_eq_false] at hvp5_p5 + dsimp [ValidP5Chain] at hvp5_p5 + simp only [Bool.and_eq_true, decide_eq_true_eq] at hvp5_p5 + rcases hvp5_p5 with ⟨hz18, hvp5⟩ + have heven' := ValidP5Chain_imp_ValidEvenLs ls' hvp5 + have hpref0 := prefSumW_of_ValidP5Chain ls' hvp5 + have hmd0 := MustDrain_of_ValidP5Chain ls' hvp5 + have hnp5 : isHeadP5 ls' = false := isHeadP5_false_of_z0_pos (by omega) + have hnp3z1 : isHeadP3z1 ls' = false := isHeadP3z1_false_of_z0_pos (by omega) + have hepw17 : epW ls' ≥ 17 := by have := epW_add1_ge_z0 ls'; omega + have hep18 : ep ls' ≥ 18 := by have := ep_ge_z0 ls'; omega + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hck, hc⟩ + rw [not_bool_eq_false, decide_eq_true_eq] at hck + have h_not_b1 : ¬(ds = [] ∧ k = 1 ∧ c = 1 ∧ isP3zP5 (.p5 :: ls') = true ∧ + headP3zVal (.p5 :: ls') ≥ 3) := by + simp [isP3zP5] + have h_not_b2 : ¬(ds = [] ∧ ((k = 1 ∧ c = 1 ∧ z0 (.p5 :: ls') = 1) ∨ (k = 3 ∧ c = 2 ∧ + z0 (.p5 :: ls') = 0)) ∧ + isP3zP5 (dropZ0 (.p5 :: ls')) = true ∧ headP3zVal (dropZ0 (.p5 :: ls')) ≥ 18 ∧ + z0 (p5Suf (.p5 :: ls')) ≥ 38) := by + simp [dropZ0, isP3zP5] + rw [if_neg h_not_b1, if_neg h_not_b2] at hc + have hz0_p5 : z0 (.p5 :: ls') = 0 := rfl + rw [hz0_p5] at hc + simp only [Nat.add_zero, Bool.and_eq_true] at hc + rcases hc with ⟨⟨⟨hok_base, _⟩, _⟩, hc_25⟩ + have hck_8_15 : c ≥ 8 ∧ k ≥ 15 := by + split_ifs at hok_base <;> (simp_all; try omega) + have hds1' : checkDs1Phi1 (.ModeE_ge2 ls' (k + 3) (c + 2) ds) = true := by + dsimp [checkDs1Phi1] + by_cases h1 : ds = [1] + · simp only [h1, not_true_eq_false, ↓reduceIte] + rw [if_pos hk3_ev, hnp5] + simp only [Bool.false_eq_true, ↓reduceIte] + have hne1 : decide (c + 2 + epW ls' = 1) = false := decide_eq_false (by omega) + simp [hne1] + · simp [h1] + have hphiw' : GoodPhiW (c + 2 + epW ls') ds false = true := by + apply GoodPhiW_of_ge17_and_d25 _ _ hne2 (by omega) + intro d hd_eq hd25 + have hc36 := d25_ge36_of_check hc_25 d hd_eq hd25 + omega + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs ds || !checkDs2 (.ModeE_ge2 ls' (k + 3) (c + 2) ds) || + !checkDs1Phi1 (.ModeE_ge2 ls' (k + 3) (c + 2) ds)) = false := by + simp [hgd, hds2', hds1'] + rw [bool_if_false_eq_self h_g, if_pos hk3_ev, not_bool_if_false_eq_true heven'] + rw [hpref0, Nat.add_zero] + rw [not_decide_if_false_eq_true (by omega)] + have hok_phi' : (if (!isHeadP5 ls') = true then + (decide (ds = [] ∧ c + 2 + epW ls' = 1) && MustDrain ls' && + decide (c + 2 + ep ls' = 1 ∧ k + 3 + epSum ls' + 2 * ep ls' = 2) && + hasP5 ls' && decide (preP5Val ls' ≥ 16 ∧ z0 (p5Suf ls') ≥ 38)) || + GoodPhiW (c + 2 + epW ls') ds (isHeadP3z1 ls' && decide (k + 3 = 0 ∧ c + 2 = 0 ∧ + ds = [])) + else + decide (c + 2 = 0 ∧ ds = [] ∧ + k + 3 = 2) || (decide (c + 2 ≥ 1) && GoodPhiW (c + 2 - 1) ds false)) = true := by + have hnp5_t : (!isHeadP5 ls') = true := by rw [hnp5]; rfl + rw [if_pos hnp5_t, GoodPhiW_mono _ _ _ hphiw', Bool.or_true] + rw [not_bool_if_false_eq_true hok_phi'] + rw [hmd0, Bool.false_and, if_neg Bool.false_ne_true] + rw [hnp3z1, Bool.and_false] + simp only [Bool.false_eq_true, ↓reduceIte, Bool.not_true] + by_cases h_cond : (hasOdd ls' && decide (2 * (c + 2) + 4 ≥ k + 3 + epSum ls')) = true + · rw [if_pos h_cond] + simp only [Bool.and_eq_true] at h_cond + rcases h_cond with ⟨hodd_t, hdec_m⟩ + have hp5_t := hasP5_of_ValidP5Chain_hasOdd ls' hvp5 hodd_t + have hf2 := hch 2 + dsimp only [invChain] at hf2 + rw [if_neg hk, if_neg h_not_b1, if_neg h_not_b2] at hf2 + dsimp only [checkChainAux, z0, dropZ0, isHeadP5] at hf2 + simp only [Nat.add_zero, Nat.mul_zero, Bool.not_true, Bool.false_and, Bool.false_eq_true, + ↓reduceIte] at hf2 + rw [hodd_t, hdec_m, hmd0, hp5_t] at hf2 + simp only [Bool.and_true, ↓reduceIte, Bool.not_false, Bool.not_true, + Bool.false_eq_true] at hf2 + have hgp : GoodPsi (c + 2 + ep ls') ds = true := by + unfold GoodPsi + have h_eq : c + 2 + ep ls' + 1 = c + 3 + ep ls' := by omega + rw [h_eq]; exact hf2 + rw [hgp] + have h36 : decide (k + 3 + epSum ls' + 2 * ep ls' ≥ 36) = true := decide_eq_true (by omega) + have h16 : decide (k + 3 + epSum ls' + 2 * ep ls' ≥ 16) = true := decide_eq_true (by omega) + rw [h36, h16] + simp + · rw [if_neg h_cond] + · intro fuel + have hf := hch (fuel + 1) + dsimp only [invChain] at hf ⊢ + rw [if_neg hk, if_neg h_not_b1, if_neg h_not_b2] at hf + rw [if_pos hk3_ev, if_neg (by simp [hnp3z1])] + dsimp only [checkChainAux, z0, dropZ0, isHeadP5] at hf + simp only [Nat.add_zero, Nat.mul_zero, Bool.not_true, Bool.false_and, Bool.false_eq_true, + ↓reduceIte] at hf + exact hf + +theorem step_Inv_ModeE_ge2_p3z_ge2 (m2 : Nat) (ls' : List LTok) (k c : Nat) (ds : List Nat) + (hinv : Inv (.ModeE_ge2 (.p3z (m2 + 2) :: ls') k c ds)) : + Inv (.ModeB_ge3 (.p3z m2 :: ls') k c ds) := by + have hc := hinv.1 + have hch := hinv.2 + dsimp only [invCore] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨h_guards, hc⟩ + simp only [Bool.or_eq_false_iff, not_bool_eq_false] at h_guards + rcases h_guards with ⟨⟨hgd, hds2⟩, hds1⟩ + by_cases hk : k % 2 = 0 + · rw [if_pos hk] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨heven, hc⟩ + rw [not_bool_eq_false, ValidEvenLs_p3z_add2] at heven + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hk_le, hc⟩ + rw [not_bool_eq_false, decide_eq_true_eq] at hk_le + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hok_phi, hc⟩ + rw [not_bool_eq_false] at hok_phi + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hmd_bound, hc⟩ + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨_, hodd_branch⟩ + have hmd_eq := MustDrain_p3z_add2 m2 ls' + have hepsum_eq := epSum_p3z_add2 m2 ls' + have hep_eq := ep_p3z_add2 m2 ls' + have hepw_eq := epW_p3z_add2 m2 ls' + have hodd_eq := hasOdd_p3z_add2 m2 ls' + have hip5_0 : isHeadP5 (.p3z (m2 + 2) :: ls') = false := rfl + have hip5_1 : isHeadP5 (.p3z m2 :: ls') = false := rfl + have hds2' : checkDs2 (.ModeB_ge3 (.p3z m2 :: ls') k c ds) = true := by + dsimp [checkDs2] at hds2 ⊢ + by_cases h2 : ds = [2] + · rw [if_neg (not_not.mpr h2)] at hds2 ⊢ + have hd_k : decide (k % 2 = 0) = true := decide_eq_true hk + rw [hip5_0, hmd_eq, hepsum_eq, hd_k] at hds2 + rw [hip5_1, hd_k] + dsimp [hasP5, p5Suf] at hds2 ⊢ + rw [show decide (k + epSum (.p3z m2 :: ls') ≥ 2 * c + 4) = + decide (k + (epSum (.p3z m2 :: ls') + 2) ≥ 2 * c + 6) from decide_eq_of_iff (by omega)] + exact hds2 + · rw [if_pos h2] + have hds1' : checkDs1Phi1 (.ModeB_ge3 (.p3z m2 :: ls') k c ds) = true := by + dsimp [checkDs1Phi1] at hds1 ⊢ + by_cases h1 : ds = [1] + · simp only [h1, not_true_eq_false, ↓reduceIte] at hds1 ⊢ + rw [if_pos hk, hip5_0, hepw_eq] at hds1 + rw [if_pos hk, hip5_1] + simp only [Bool.false_eq_true, ↓reduceIte] at hds1 ⊢ + by_cases he1 : c + epW (.p3z m2 :: ls') = 1 + · rw [decide_eq_true he1] at hds1 ⊢ + simp only [Bool.not_true, Bool.false_eq_true, ↓reduceIte] at hds1 ⊢ + rw [hmd_eq, hepsum_eq] at hds1 + have hmd_k := MustDrain_p3z_even_cons k (.p3z m2 :: ls') hk + rw [hmd_k, if_pos hk] + dsimp [hasP5, isHeadP5] at hds1 ⊢ + rw [show decide (k + epSum (.p3z m2 :: ls') ≥ 2 * c + 12) = + decide (k + (epSum (.p3z m2 :: ls') + 2) ≥ 2 * c + 14) from decide_eq_of_iff (by omega)] + exact hds1 + · simp [decide_eq_false he1] + · simp [h1] + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs ds || !checkDs2 (.ModeB_ge3 (.p3z m2 :: ls') k c ds) || + !checkDs1Phi1 (.ModeB_ge3 (.p3z m2 :: ls') k c ds)) = false := by + simp [hgd, hds2', hds1'] + rw [bool_if_false_eq_self h_g, if_pos hk, not_bool_if_false_eq_true heven] + have h_np5_0 : (!isHeadP5 (.p3z (m2 + 2) :: ls')) = true := rfl + have h_np5_1 : (!isHeadP5 (.p3z m2 :: ls')) = true := rfl + have hstart_0 : (isHeadP3z1 (.p3z (m2 + 2) :: ls') && decide (k = 0 ∧ c = 0 ∧ + ds = [])) = false := rfl + rw [if_pos h_np5_0, hstart_0] at hok_phi + have hpref_m2 := prefSumW_p3z_m2_bound m2 ls' k c hk_le.1 hk_le.2 + have hepw_ge1 : epW (.p3z k :: .p3z m2 :: ls') ≥ 1 := by + rw [epW_p3z_even_cons k (.p3z m2 :: ls') hk rfl]; omega + have hok_all : (if (!isHeadP5 (.p3z m2 :: ls')) = true then + decide (k + prefSumW (.p3z m2 :: ls') ≤ 2 * c + 4) && + ((decide (ds = [] ∧ c + epW (.p3z m2 :: ls') = 1) && MustDrain (.p3z m2 :: ls') && + decide (c + ep (.p3z m2 :: ls') = 1 ∧ + k + epSum (.p3z m2 :: ls') + 2 * ep (.p3z m2 :: ls') + 2 = 2) && + hasP5 (.p3z m2 :: ls') && decide (preP5Val (.p3z m2 :: ls') ≥ 16 ∧ + z0 (p5Suf (.p3z m2 :: ls')) ≥ 38)) || + GoodPhiW (c + epW (.p3z m2 :: ls')) ds false) && + (!decide (c = 0) || decide (epW (.p3z k :: .p3z m2 :: ls') ≥ 1)) + else if c = 0 then decide (ds = [] ∧ (k = 0 ∨ k ≥ 22 ∧ z0 (p5Suf (.p3z m2 :: ls')) ≥ 38)) + else GoodPhiW (c - 1) ds false) = true := by + rw [if_pos h_np5_1, decide_eq_true hpref_m2, decide_eq_true hepw_ge1, Bool.or_true, + Bool.and_true, Bool.true_and] + rw [hepw_eq, hmd_eq, hep_eq, hepsum_eq] at hok_phi + have h_xi_eq : k + (epSum (.p3z m2 :: ls') + 2) + 2 * ep (.p3z m2 :: ls') = + k + epSum (.p3z m2 :: ls') + 2 * ep (.p3z m2 :: ls') + 2 := by omega + rw [h_xi_eq] at hok_phi + dsimp [hasP5, p5Suf] at hok_phi ⊢ + by_cases hmd : MustDrain (.p3z m2 :: ls') = true + · have hpre := + preP5Val_p3z_add2_of_not_headP5 m2 ls' (not_isHeadP5_of_MustDrain_p3z m2 ls' hmd) + rw [hpre] at hok_phi + exact hok_phi + · have hmd_f : MustDrain (.p3z m2 :: ls') = false := Bool.eq_false_iff.mpr hmd + rw [hmd_f] at hok_phi ⊢ + simpa using hok_phi + rw [not_bool_if_false_eq_true hok_all] + have hmd_bound' : (MustDrain (.p3z m2 :: ls') && decide (2 * c + 2 < k + + epSum (.p3z m2 :: ls'))) = false := by + rw [hmd_eq, hepsum_eq] at hmd_bound + rw [show decide (2 * c + 2 < k + epSum (.p3z m2 :: ls')) = + decide (2 * c + 4 < k + (epSum (.p3z m2 :: ls') + 2)) from decide_eq_of_iff (by omega)] + exact hmd_bound + rw [bool_if_false_eq_self hmd_bound'] + have hrst_0 : (decide (k = 0 ∧ c = 0 ∧ + ds = []) && isHeadP3z1 (.p3z (m2 + 2) :: ls')) = false := by + rw [show isHeadP3z1 (.p3z (m2 + 2) :: ls') = false from rfl, Bool.and_false] + rw [hodd_eq, hepsum_eq] at hodd_branch + have hd_odd : decide (2 * c + 2 ≥ k + epSum (.p3z m2 :: ls')) = + decide (2 * c + 4 ≥ k + (epSum (.p3z m2 :: ls') + 2)) := decide_eq_of_iff (by omega) + rw [hd_odd] + by_cases h_cond : (hasOdd (.p3z m2 :: ls') && decide (2 * c + 4 ≥ + k + (epSum (.p3z m2 :: ls') + 2))) = true + · rw [if_pos h_cond, hrst_0, if_neg Bool.false_ne_true] at hodd_branch + rw [if_pos h_cond] + rw [hep_eq, hmd_eq] at hodd_branch + have h_xi_eq : k + (epSum (.p3z m2 :: ls') + 2) + 2 * ep (.p3z m2 :: ls') = + k + epSum (.p3z m2 :: ls') + 2 * ep (.p3z m2 :: ls') + 2 := by omega + rw [h_xi_eq] at hodd_branch + dsimp [hasP5, p5Suf] at hodd_branch ⊢ + by_cases hmd : MustDrain (.p3z m2 :: ls') = true + · have hpre := + preP5Val_p3z_add2_of_not_headP5 m2 ls' (not_isHeadP5_of_MustDrain_p3z m2 ls' hmd) + rw [hpre] at hodd_branch + exact hodd_branch + · have hmd_f : MustDrain (.p3z m2 :: ls') = false := Bool.eq_false_iff.mpr hmd + rw [hmd_f] at hodd_branch ⊢ + simpa using hodd_branch + · rw [if_neg h_cond] + · intro fuel + have hf := hch fuel + dsimp only [invChain] at hf ⊢ + rw [if_pos hk, if_neg (by simp [isHeadP3z1])] at hf + rw [if_pos hk, if_neg (by simp [isHeadP5])] + rw [← checkChainAux_true_E_ge2_to_B_ge3_even fuel m2 ls' k c ds hk] + exact hf + · have hm1 : k % 2 = 1 := by omega + have hne2 : ds ≠ [2] := ds_ne_two_of_checkDs2_ModeE_ge2 hds2 (Or.inr (Or.inr (Or.inl hm1))) + have hds2' : checkDs2 (.ModeB_ge3 (.p3z m2 :: ls') k c ds) = true := by + dsimp [checkDs2]; rw [if_pos hne2] + rw [if_neg hk] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hvp5_0, hc⟩ + rw [not_bool_eq_false] at hvp5_0 + obtain ⟨suf, rfl, hz18, hvp5⟩ := ValidP5Chain_p3z_succ hvp5_0 + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hck, hc⟩ + rw [not_bool_eq_false, decide_eq_true_eq] at hck + let nls := LTok.p3z k :: .p3z m2 :: .p5 :: suf + have heven_nls : ValidEvenLs nls = true := by + dsimp [nls, ValidEvenLs, ValidAfterOdd] + rw [if_neg hk, decide_eq_true hz18, hvp5, Bool.true_and] + have hmd_nls : MustDrain nls = true := by + dsimp [nls, MustDrain]; rw [if_pos hm1] + have h_gt_f : decide (k > 2 * c + 3) = false := decide_eq_false (by omega) + have hz0_eq : z0 (.p3z (m2 + 2) :: .p5 :: suf) = 0 := rfl + have hdz0_eq : dropZ0 (.p3z (m2 + 2) :: .p5 :: suf) = .p3z (m2 + 2) :: .p5 :: suf := rfl + by_cases hb1 : ds = [] ∧ k = 1 ∧ c = 1 ∧ isP3zP5 (.p3z (m2 + 2) :: .p5 :: suf) = true ∧ + headP3zVal (.p3z (m2 + 2) :: .p5 :: suf) ≥ 3 + · rcases hb1 with ⟨rfl, rfl, rfl, _, hm2_ge⟩ + dsimp [headP3zVal] at hm2_ge + have hds1' : checkDs1Phi1 (.ModeB_ge3 (.p3z m2 :: .p5 :: suf) 1 1 []) = true := rfl + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs [] || !checkDs2 (.ModeB_ge3 (.p3z m2 :: .p5 :: suf) 1 1 []) || + !checkDs1Phi1 (.ModeB_ge3 (.p3z m2 :: .p5 :: suf) 1 1 [])) = false := rfl + rw [bool_if_false_eq_self h_g, if_neg hk, if_neg (by omega), + not_bool_if_false_eq_true heven_nls] + have hm2_pos : ∃ m2', m2 = m2' + 1 := ⟨m2 - 1, by omega⟩ + obtain ⟨m2', rfl⟩ := hm2_pos + dsimp [isP3zGe1P5, MustDrain] + · intro fuel + have hf := hch fuel + dsimp only [invChain] at hf ⊢ + have hb1_t : ([] : List Nat) = [] ∧ (1 : Nat) = 1 ∧ (1 : Nat) = 1 ∧ + isP3zP5 (.p3z (m2 + 2) :: .p5 :: suf) = true ∧ + headP3zVal (.p3z (m2 + 2) :: .p5 :: suf) ≥ 3 := + ⟨rfl, rfl, rfl, rfl, hm2_ge⟩ + rw [if_neg hk, if_pos hb1_t] at hf + rw [if_neg hk, if_pos ⟨rfl, rfl, rfl⟩] + exact hf + · rw [if_neg hb1] at hc + by_cases hb2 : ds = [] ∧ + ((k = 1 ∧ c = 1 ∧ z0 (.p3z (m2 + 2) :: .p5 :: suf) = 1) ∨ + (k = 3 ∧ c = 2 ∧ z0 (.p3z (m2 + 2) :: .p5 :: suf) = 0)) ∧ + isP3zP5 (dropZ0 (.p3z (m2 + 2) :: .p5 :: suf)) = true ∧ + headP3zVal (dropZ0 (.p3z (m2 + 2) :: .p5 :: suf)) ≥ 18 ∧ + z0 (p5Suf (.p3z (m2 + 2) :: .p5 :: suf)) ≥ 38 + · have hb2_orig := hb2 + rw [hz0_eq, hdz0_eq] at hb2 + dsimp [headP3zVal, p5Suf] at hb2 + rcases hb2 with ⟨rfl, h_or, _, hm2_ge, hz38⟩ + have hk3_c2 : k = 3 ∧ c = 2 := by omega + rcases hk3_c2 with ⟨rfl, rfl⟩ + have hds1' : checkDs1Phi1 (.ModeB_ge3 (.p3z m2 :: .p5 :: suf) 3 2 []) = true := rfl + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs [] || !checkDs2 (.ModeB_ge3 (.p3z m2 :: .p5 :: suf) 3 2 []) || + !checkDs1Phi1 (.ModeB_ge3 (.p3z m2 :: .p5 :: suf) 3 2 [])) = false := rfl + rw [bool_if_false_eq_self h_g, if_neg hk, if_neg (by omega), + not_bool_if_false_eq_true heven_nls] + have hok_c1 : (if 2 ≥ 1 then + if (!decide (3 = 1 ∧ 2 = 1 ∧ ([] : List Nat) = [])) = true then + (decide (([] : List Nat) = [] ∧ 2 = 2 ∧ 3 = 3) && MustDrain nls && + hasP5 (.p3z m2 :: .p5 :: suf) && decide (preP5Val nls ≥ 16 ∧ + z0 (p5Suf (.p3z m2 :: .p5 :: suf)) ≥ 38)) || + GoodPhiW (2 - 1) [] false + else isP3zGe1P5 (.p3z m2 :: .p5 :: suf) + else true) = true := by + have h16_38 : decide (m2 ≥ 16 ∧ z0 suf ≥ 38) = true := decide_eq_true ⟨by omega, hz38⟩ + dsimp [nls, MustDrain, hasP5, preP5Val, p5Suf] + simp [h16_38] + rw [not_bool_if_false_eq_true hok_c1] + have h16_38' : decide (([] : List Nat) = [] ∧ 2 - 1 = 1 ∧ 3 = 3 ∧ m2 ≥ 16 ∧ + z0 suf ≥ 38) = true := + decide_eq_true ⟨rfl, rfl, rfl, by omega, hz38⟩ + have hpre_eq : preP5Val nls = m2 := rfl + have hsuf_eq : p5Suf (.p3z m2 :: .p5 :: suf) = suf := rfl + have hp5_eq : hasP5 (.p3z m2 :: .p5 :: suf) = true := rfl + have hgp_t : GoodPsi (2 - 1) [] = true := rfl + rw [hmd_nls, h_gt_f, hp5_eq, hpre_eq, hsuf_eq, hgp_t, h16_38'] + rfl + · intro fuel + cases fuel with + | zero => + dsimp [invChain]; rfl + | succ fuel' => + have hf := hch fuel' + dsimp only [invChain] at hf ⊢ + rw [if_neg hk, if_neg hb1, if_pos hb2_orig] at hf + rw [hdz0_eq] at hf + dsimp only [headP3zVal, drop2L] at hf + rw [if_neg hk, if_neg (by omega), if_neg (by omega)] + dsimp only [checkChainAux] + have hodd3 : hasOdd nls = true := rfl + have hepsum3 : epSum nls = 2 := rfl + have hep3 : ep nls = 0 := rfl + have hp5_3 : hasP5 nls = true := rfl + have hpre3 : preP5Val nls = m2 := rfl + have hsuf3 : p5Suf nls = suf := rfl + have hdec3 : decide (2 * 2 + 2 ≥ 0 + 2) = true := rfl + rw [hodd3, hepsum3, hep3, hmd_nls, hp5_3, hpre3, hsuf3, hdec3] + simp only [Bool.and_true, ↓reduceIte, Bool.not_true, Bool.false_eq_true, Nat.add_zero] + rw [if_neg (by omega), if_neg (by omega)] + have hm_sub : m2 + 2 - 4 = m2 - 2 := by omega + rw [hm_sub] at hf + exact hf + · rw [if_neg hb2] at hc + rw [hz0_eq] at hc + simp only [Nat.add_zero, Nat.mul_zero, Bool.and_eq_true] at hc + rcases hc with ⟨⟨⟨hok_base, hc_9⟩, hc_1⟩, _⟩ + have hck_8_15 : c ≥ 8 ∧ k ≥ 15 := by + split_ifs at hok_base <;> (simp only [decide_eq_true_eq] at hok_base; omega) + have hf1 := hch 1 + dsimp only [invChain] at hf1 + rw [if_neg hk, if_neg hb1, if_neg hb2] at hf1 + dsimp only [checkChainAux] at hf1 + rw [hz0_eq, hdz0_eq] at hf1 + dsimp only [isHeadP5, drop1L] at hf1 + simp only [Nat.add_zero, Nat.mul_zero, Bool.not_false, Bool.true_and] at hf1 + rw [bool_if_false_eq_true] at hf1 + rcases hf1 with ⟨hphiw_f, hf1⟩ + rw [not_bool_eq_false] at hphiw_f + rw [if_neg (by omega), bool_if_false_eq_true] at hf1 + rcases hf1 with ⟨hgp, _⟩ + rw [not_bool_eq_false] at hgp + have hds1' : checkDs1Phi1 (.ModeB_ge3 (.p3z m2 :: .p5 :: suf) k c ds) = true := by + dsimp [checkDs1Phi1] + by_cases h1 : ds = [1] + · simp only [h1, not_true_eq_false, ↓reduceIte]; rw [if_neg hk, + decide_eq_false (by omega)]; rfl + · simp [h1] + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs ds || !checkDs2 (.ModeB_ge3 (.p3z m2 :: .p5 :: suf) k c ds) || + !checkDs1Phi1 (.ModeB_ge3 (.p3z m2 :: .p5 :: suf) k c ds)) = false := by + simp [hgd, hds2', hds1'] + rw [bool_if_false_eq_self h_g, if_neg hk, if_neg (by omega), + not_bool_if_false_eq_true heven_nls] + have hrst_f : decide (k = 1 ∧ c = 1 ∧ ds = []) = false := decide_eq_false (by omega) + have hok_c1 : (if c ≥ 1 then + if (!decide (k = 1 ∧ c = 1 ∧ ds = [])) = true then + (decide (ds = [] ∧ c = 2 ∧ k = 3) && MustDrain nls && + hasP5 (.p3z m2 :: .p5 :: suf) && decide (preP5Val nls ≥ 16 ∧ + z0 (p5Suf (.p3z m2 :: .p5 :: suf)) ≥ 38)) || + GoodPhiW (c - 1) ds false + else isP3zGe1P5 (.p3z m2 :: .p5 :: suf) + else true) = true := by + rw [if_pos (by omega), hrst_f, if_pos (by decide), hphiw_f, Bool.or_true] + rw [not_bool_if_false_eq_true hok_c1] + rw [hmd_nls, h_gt_f, Bool.and_false, if_neg Bool.false_ne_true, if_pos hck.2, hrst_f, + if_neg Bool.false_ne_true] + rw [hgp, Bool.true_and] + have h_ds1_ok : ((!decide (ds = [1] ∧ c - 1 ≥ 24)) || decide (k ≥ 37)) = true := by + by_cases h1 : ds = [1] + · simp [h1] at hc_1; simp [hc_1] + · simp [h1] + have h_ds0_ok : ((!decide ((ds = [] ∨ ds = [0]) ∧ c - 1 ≥ 8 ∧ + ((!hasP5 (.p3z m2 :: .p5 :: suf)) = true ∨ true = true))) || + decide (k ≥ 17)) = true := by + by_cases h0 : (ds = [] ∨ ds = [0]) ∧ c - 1 ≥ 8 + · have hc9 : ((ds = [] ∨ ds = [0]) ∧ + c ≥ 9) ∨ isOddDrainDs ds = true := Or.inl ⟨h0.1, by omega⟩ + rw [decide_eq_true hc9] at hc_9 + simp only [Bool.not_true, Bool.false_or, decide_eq_true_eq] at hc_9 + simp [hc_9] + · have h_f : decide ((ds = [] ∨ ds = [0]) ∧ c - 1 ≥ 8 ∧ + ((!hasP5 (.p3z m2 :: .p5 :: suf)) = true ∨ true = true)) = false := + decide_eq_false (fun ⟨h_a, h_b, _⟩ => h0 ⟨h_a, h_b⟩) + rw [h_f]; rfl + have h15_7 : decide (k ≥ 15 ∧ c - 1 ≥ 7) = true := decide_eq_true (by omega) + rw [h_ds1_ok, h_ds0_ok, h15_7] + simp + · intro fuel + cases fuel with + | zero => + dsimp [invChain] + rw [if_neg hk, if_neg (by omega), if_neg (by omega)] + rfl + | succ fuel' => + have hf := hch (fuel' + 1) + dsimp only [invChain] at hf ⊢ + rw [if_neg hk, if_neg hb1, if_neg hb2] at hf + rw [if_neg hk, if_neg (show ¬(k = 1 ∧ c = 1 ∧ + ds = []) by omega), if_neg (show c ≠ 0 by omega)] + dsimp only [checkChainAux] at hf + rw [hz0_eq, hdz0_eq] at hf + dsimp only [isHeadP5, drop1L] at hf + simp only [Nat.add_zero, Nat.mul_zero, Bool.not_false, Bool.true_and, hphiw_f, + Bool.not_true, Bool.false_eq_true, ↓reduceIte, hgp] at hf + rw [if_neg (by omega)] at hf + have hodd_k : hasOdd nls = true := by dsimp [nls, hasOdd]; rw [if_pos hm1] + have hepsum_k : epSum nls = k - 1 := by dsimp [nls, epSum]; rw [if_pos hm1] + have hep_k : ep nls = 0 := by dsimp [nls, ep]; rw [if_pos hm1] + have hp5_k : hasP5 nls = true := rfl + have hpre_k : preP5Val nls = m2 := rfl + have hsuf_k : p5Suf nls = suf := rfl + have hdec_m : decide (2 * c + 2 ≥ 0 + (k - 1)) = true := decide_eq_true (by omega) + dsimp only [checkChainAux] + rw [hodd_k, hepsum_k, hep_k, hmd_nls, hp5_k, hpre_k, hsuf_k, hdec_m] + simp only [Bool.and_true, ↓reduceIte, Bool.not_true, Bool.false_eq_true, Nat.add_zero, + Nat.zero_add, Nat.mul_zero] + have hk5 : k - 1 + 5 = k + 4 := by omega + have hk3 : k - 1 + 3 = k + 2 := by omega + have hk2 : k - 1 + 2 = k + 1 := by omega + have hm_sub : m2 + 2 - 4 = m2 - 2 := by omega + have hm_add : m2 + 2 + 1 = m2 + 3 := by omega + have hm_m1 : m2 + 2 - 1 = m2 + 1 := by omega + rw [hk5, hk3, hk2] + rw [hm_sub, hm_add, hm_m1] at hf + by_cases h_c1 : m2 % 2 = 0 ∧ m2 ≤ 2 * (k - 1) + 10 + · have h_c1' : (m2 + 2) % 2 = 0 ∧ m2 + 2 ≤ 2 * k + 10 := by omega + rw [if_pos h_c1] + rw [if_pos h_c1'] at hf + exact hf + · have h_c1' : ¬((m2 + 2) % 2 = 0 ∧ m2 + 2 ≤ 2 * k + 10) := by omega + rw [if_neg h_c1] + rw [if_neg h_c1'] at hf + by_cases h_c2 : m2 % 2 = 1 ∧ m2 ≤ 2 * (k - 1) + 11 + · have h_c2' : (m2 + 2) % 2 = 1 ∧ m2 + 2 ≤ 2 * k + 11 := by omega + rw [if_pos h_c2] + rw [if_pos h_c2'] at hf + exact hf + · have h_c2' : ¬((m2 + 2) % 2 = 1 ∧ m2 + 2 ≤ 2 * k + 11) := by omega + rw [if_neg h_c2] + rw [if_neg h_c2'] at hf + exact hf + +theorem isOddDrainDs_cons_imp {d : Nat} {ds : List Nat} (h : isOddDrainDs (d :: ds) = true) : + (ds = [] ∨ ds = [0]) ∧ d ≥ 9 := by + cases ds with + | nil => + dsimp [isOddDrainDs, isOddDrain1] at h + rw [decide_eq_true_eq] at h + exact ⟨Or.inl rfl, by omega⟩ + | cons d2 ds' => + cases d2 with + | zero => + cases ds' with + | nil => + simp only [isOddDrainDs, isOddDrain1, decide_eq_true_eq] at h + exact ⟨Or.inr rfl, by omega⟩ + | cons _ _ => cases h + | succ _ => cases h + +theorem GoodPhiW_push_ge8 (phiW c : Nat) (ds : List Nat) (hc : c ≥ 7) (h15 : phiW ≥ 15) + (hd25 : ds = [1] → c ≥ 24 → phiW ≥ 35) + (hod : (ds = [] ∨ ds = [0]) → c ≥ 8 → phiW ≥ 17) : + GoodPhiW phiW ((c + 1) :: ds) false = true := by + have hne2 : (c + 1) :: ds ≠ [2] := by intro h; injection h with h1 _; omega + have hne0 : (c + 1) :: ds ≠ [0] := by intro h; injection h with h1 _; omega + have hne1 : (c + 1) :: ds ≠ [1] := by intro h; injection h with h1 _; omega + have hnen : (c + 1) :: ds ≠ [] := by intro h; cases h + dsimp only [GoodPhiW] + rw [if_neg hne2, if_neg hne0, if_neg hne1, if_neg hnen] + split_ifs with h_d25 h_od + · cases ds with + | nil => cases h_d25 + | cons d2 ds' => + cases ds' with + | nil => + cases d2 with + | zero => cases h_d25 + | succ d2' => + cases d2' with + | zero => + have hc25 : c + 1 ≥ 25 := of_decide_eq_true h_d25 + exact decide_eq_true (hd25 rfl (by omega)) + | succ _ => cases h_d25 + | cons _ _ => + cases d2 with + | zero => cases h_d25 + | succ d2' => cases d2' <;> cases h_d25 + · obtain ⟨h_ds, hc9⟩ := isOddDrainDs_cons_imp h_od + exact decide_eq_true (hod h_ds (by omega)) + · exact decide_eq_true h15 + +theorem GoodPhiW_c_pos {c : Nat} {ds : List Nat} (hne2 : ds ≠ [2]) (h : GoodPhiW c ds false = + true) : + c ≥ 1 := by + by_contra hc0 + have rfl_c : c = 0 := by omega + subst rfl_c + dsimp [GoodPhiW] at h + rw [if_neg hne2] at h + split_ifs at h + cases h + +theorem GoodPhiW_nil_ge6 {c : Nat} (h : GoodPhiW c [] false = true) : c ≥ 6 := by + dsimp [GoodPhiW] at h + exact of_decide_eq_true h + +theorem ValidAfterOdd_cases {ls' : List LTok} (h : ValidAfterOdd ls' = true) : + ls' = [] ∨ + (∃ suf, ls' = .p5 :: suf ∧ z0 suf ≥ 18 ∧ ValidP5Chain suf = true) ∨ + (∃ m suf, ls' = .p3z m :: .p5 :: suf ∧ z0 suf ≥ 18 ∧ ValidP5Chain suf = true) := by + cases ls' with + | nil => exact Or.inl rfl + | cons t rest => + cases t with + | p5 => + dsimp [ValidAfterOdd] at h + simp only [Bool.and_eq_true, decide_eq_true_eq] at h + exact Or.inr (Or.inl ⟨rest, rfl, h.1, h.2⟩) + | p3z m => + cases rest with + | nil => cases h + | cons t2 suf => + cases t2 with + | p3z _ => cases h + | p5 => + dsimp [ValidAfterOdd] at h + simp only [Bool.and_eq_true, decide_eq_true_eq] at h + exact Or.inr (Or.inr ⟨m, suf, rfl, h.1, h.2⟩) + +theorem epSum_p3z_p5_ge14 {m2 : Nat} {suf : List LTok} (hm : m2 ≥ 14) : + epSum (.p3z m2 :: .p5 :: suf) ≥ 14 := by + dsimp [epSum]; split_ifs <;> omega + +theorem step_Inv_ModeE_ge2_p3z1_odd (ls' : List LTok) (k c : Nat) (ds : List Nat) + (hk : ¬(k % 2 = 0)) + (hinv : Inv (.ModeE_ge2 (.p3z 1 :: ls') k c ds)) : + Inv (nextModeE_p3z1 ls' (k + 2) ((c + 1) :: ds)) := by + have hc := hinv.1 + have hch := hinv.2 + dsimp only [invCore] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨_, hc⟩ + rw [if_neg hk] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hvp5_0, hc⟩ + rw [not_bool_eq_false] at hvp5_0 + obtain ⟨suf, rfl, hz18, hvp5⟩ := ValidP5Chain_p3z_succ hvp5_0 + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hck, hc⟩ + rw [not_bool_eq_false, decide_eq_true_eq] at hck + have hb1 : ¬(ds = [] ∧ k = 1 ∧ c = 1 ∧ isP3zP5 (.p3z 1 :: .p5 :: suf) = true ∧ + headP3zVal (.p3z 1 :: .p5 :: suf) ≥ 3) := by dsimp [headP3zVal]; omega + have hb2 : ¬(ds = [] ∧ + ((k = 1 ∧ c = 1 ∧ z0 (.p3z 1 :: .p5 :: suf) = 1) ∨ + (k = 3 ∧ c = 2 ∧ z0 (.p3z 1 :: .p5 :: suf) = 0)) ∧ + isP3zP5 (dropZ0 (.p3z 1 :: .p5 :: suf)) = true ∧ + headP3zVal (dropZ0 (.p3z 1 :: .p5 :: suf)) ≥ 18 ∧ + z0 (p5Suf (.p3z 1 :: .p5 :: suf)) ≥ 38) := by + have hdz : dropZ0 (.p3z 1 :: .p5 :: suf) = .p3z 1 :: .p5 :: suf := rfl + rw [hdz]; dsimp [headP3zVal]; omega + rw [if_neg hb1, if_neg hb2] at hc + have hz0_eq : z0 (.p3z 1 :: .p5 :: suf) = 0 := rfl + rw [hz0_eq] at hc + simp only [Nat.add_zero, Nat.mul_zero, Bool.and_eq_true] at hc + rcases hc with ⟨⟨⟨hok_base, _⟩, _⟩, _⟩ + have hck_8_15 : c ≥ 8 ∧ k ≥ 15 := by + split_ifs at hok_base <;> (simp only [decide_eq_true_eq] at hok_base; omega) + have hf1 := hch 1 + dsimp only [invChain] at hf1 + rw [if_neg hk, if_neg hb1, if_neg hb2] at hf1 + have hdz : dropZ0 (.p3z 1 :: .p5 :: suf) = .p3z 1 :: .p5 :: suf := rfl + dsimp only [checkChainAux] at hf1 + rw [hz0_eq, hdz] at hf1 + dsimp only [isHeadP5, drop1L] at hf1 + simp only [Nat.add_zero, Nat.mul_zero, Bool.not_false, Bool.true_and] at hf1 + rw [bool_if_false_eq_true] at hf1 + rcases hf1 with ⟨_, hf1⟩ + simp only [↓reduceIte, Bool.and_eq_true] at hf1 + have hgd' : GoodDs ((c + 1) :: ds) = true := hf1.1 + have hne2' : (c + 1) :: ds ≠ [2] := by intro h; injection h with h1 _; omega + have hne1' : (c + 1) :: ds ≠ [1] := by intro h; injection h with h1 _; omega + have hds2' : checkDs2 (.ModeE_ge2 suf 1 (k + 4) ((c + 1) :: ds)) = true := by + dsimp [checkDs2]; rw [if_pos hne2'] + have hds1' : checkDs1Phi1 (.ModeE_ge2 suf 1 (k + 4) ((c + 1) :: ds)) = true := by + dsimp [checkDs1Phi1]; rw [if_pos hne1'] + dsimp only [nextModeE_p3z1] + have h1_odd : ¬(1 % 2 = 0) := by omega + have hb1' : ¬((c + 1) :: ds = [] ∧ 1 = 1 ∧ k + 4 = 1 ∧ isP3zP5 suf = true ∧ headP3zVal suf ≥ 3) := + by + intro ⟨h, _⟩; cases h + have hb2' : ¬((c + 1) :: ds = [] ∧ + ((1 = 1 ∧ k + 4 = 1 ∧ z0 suf = 1) ∨ (1 = 3 ∧ k + 4 = 2 ∧ z0 suf = 0)) ∧ + isP3zP5 (dropZ0 suf) = true ∧ headP3zVal (dropZ0 suf) ≥ 18 ∧ z0 (p5Suf suf) ≥ 38) := by + intro ⟨h, _⟩; cases h + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs ((c + 1) :: ds) || !checkDs2 (.ModeE_ge2 suf 1 (k + 4) ((c + 1) :: ds)) || + !checkDs1Phi1 (.ModeE_ge2 suf 1 (k + 4) ((c + 1) :: ds))) = false := by + simp [hgd', hds2', hds1'] + rw [bool_if_false_eq_self h_g, if_neg h1_odd, not_bool_if_false_eq_true hvp5] + rw [not_decide_if_false_eq_true (by omega)] + rw [if_neg hb1', if_neg hb2'] + have h20 : decide (k + 4 + z0 suf ≥ 20 ∧ 1 + 2 * z0 suf ≥ 15) = true := + decide_eq_true (by omega) + have h8 : decide (k + 4 + z0 suf ≥ 8 ∧ 1 + 2 * z0 suf ≥ 15) = true := decide_eq_true (by omega) + have h17 : decide (1 + 2 * z0 suf ≥ 17) = true := decide_eq_true (by omega) + have h37 : decide (1 + 2 * z0 suf ≥ 37) = true := decide_eq_true (by omega) + rw [h20, h8, ite_self, h17, h37] + simp only [Bool.true_and, Bool.or_true] + apply d25_check_of_ge36 + intro _ _ _; omega + · intro fuel + have hf := hch (fuel + 1) + dsimp only [invChain] at hf ⊢ + rw [if_neg hk, if_neg hb1, if_neg hb2] at hf + rw [if_neg h1_odd, if_neg hb1', if_neg hb2'] + dsimp only [checkChainAux] at hf + rw [hz0_eq, hdz] at hf + dsimp only [isHeadP5, drop1L] at hf + simp only [Nat.add_zero, Nat.mul_zero, Bool.not_false, Bool.true_and] at hf + rw [bool_if_false_eq_true] at hf + rcases hf with ⟨_, hf⟩ + simp only [↓reduceIte, Bool.and_eq_true] at hf + exact hf.2 + +theorem step_Inv_ModeE_ge2_p3z1_reset (ls' : List LTok) + (hinv : Inv (.ModeE_ge2 (.p3z 1 :: ls') 0 0 [])) : + Inv (nextModeE_p3z1 ls' 2 [1]) := by + have hc := hinv.1 + have hch := hinv.2 + dsimp only [invCore] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨_, hc⟩ + rw [if_pos rfl] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨heven, hc⟩ + rw [not_bool_eq_false] at heven + dsimp [ValidEvenLs] at heven + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨_, hc⟩ + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨_, hc⟩ + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨_, hc⟩ + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hok_rst, _⟩ + rw [not_bool_eq_false] at hok_rst + dsimp [isHeadP3z1, drop1L] at hok_rst + rcases ValidAfterOdd_cases heven with rfl | ⟨suf, rfl, _, _⟩ | ⟨m, suf, rfl, hz18, hvp5⟩ + · refine ⟨by decide, ?_⟩ + intro fuel + have hf := hch fuel + dsimp only [invChain, drop1L, nextModeE_p3z1] at hf ⊢ + rw [if_pos rfl, if_pos ⟨rfl, rfl, rfl, rfl⟩] at hf + rw [if_pos rfl, if_neg (by simp [isHeadP3z1])] + exact hf + · cases hok_rst + · cases m with + | zero => cases hok_rst + | succ m' => + cases m' with + | zero => + dsimp only [nextModeE_p3z1] + have h1_odd : ¬(1 % 2 = 0) := by omega + have hb1' : ¬([3, 1] = [] ∧ 1 = 1 ∧ 2 = 1 ∧ isP3zP5 suf = true ∧ headP3zVal suf ≥ 3) := by + intro ⟨h, _⟩; cases h + have hb2' : ¬([3, 1] = [] ∧ + ((1 = 1 ∧ 2 = 1 ∧ z0 suf = 1) ∨ (1 = 3 ∧ 2 = 2 ∧ z0 suf = 0)) ∧ + isP3zP5 (dropZ0 suf) = true ∧ headP3zVal (dropZ0 suf) ≥ 18 ∧ z0 (p5Suf suf) ≥ 38) := by + intro ⟨h, _⟩; cases h + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs [3, 1] || !checkDs2 (.ModeE_ge2 suf 1 2 [3, 1]) || + !checkDs1Phi1 (.ModeE_ge2 suf 1 2 [3, 1])) = false := rfl + rw [bool_if_false_eq_self h_g, if_neg h1_odd, not_bool_if_false_eq_true hvp5] + rw [not_decide_if_false_eq_true (by omega)] + rw [if_neg hb1', if_neg hb2'] + have h20 : decide (2 + z0 suf ≥ 20 ∧ 1 + 2 * z0 suf ≥ 15) = true := + decide_eq_true (by omega) + have h8 : decide (2 + z0 suf ≥ 8 ∧ 1 + 2 * z0 suf ≥ 15) = true := + decide_eq_true (by omega) + have h17 : decide (1 + 2 * z0 suf ≥ 17) = true := decide_eq_true (by omega) + have h37 : decide (1 + 2 * z0 suf ≥ 37) = true := decide_eq_true (by omega) + rw [h20, h8, ite_self, h17, h37] + simp only [Bool.true_and, Bool.or_true] + rfl + · intro fuel + have hf := hch fuel + dsimp only [invChain] at hf ⊢ + rw [if_pos rfl, if_pos ⟨rfl, rfl, rfl, rfl⟩] at hf + dsimp only [drop1L, headP3zVal, drop2L, checkResetSufAux] at hf + rw [if_neg h1_odd, if_neg hb1', if_neg hb2'] + exact hf + | succ m2 => + dsimp only [nextModeE_p3z1] + have heven_m2 : ValidEvenLs (.p3z m2 :: .p5 :: suf) = true := by + dsimp [ValidEvenLs, ValidAfterOdd] + split_ifs <;> simp [hz18, hvp5] + have hds1' : checkDs1Phi1 (.ModeE_ge2 (.p3z m2 :: .p5 :: suf) 0 2 [1]) = true := by + dsimp [checkDs1Phi1, isHeadP5, epW] + by_cases hm2 : m2 % 2 = 1 <;> simp [hm2] + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs [1] || !checkDs2 (.ModeE_ge2 (.p3z m2 :: .p5 :: suf) 0 2 [1]) || + !checkDs1Phi1 (.ModeE_ge2 (.p3z m2 :: .p5 :: suf) 0 2 [1])) = false := by + simp [GoodDs, GoodDsAux, GoodDs1, checkDs2, hds1'] + rw [bool_if_false_eq_self h_g, if_pos rfl, not_bool_if_false_eq_true heven_m2] + have hpref0 : prefSumW (.p3z m2 :: .p5 :: suf) = 0 := by + dsimp [prefSumW]; split_ifs <;> rfl + rw [hpref0, not_decide_if_false_eq_true (by omega)] + have hepw0 : epW (.p3z m2 :: .p5 :: suf) = 0 := by + dsimp [epW]; split_ifs <;> rfl + have hmd0 : MustDrain (.p3z m2 :: .p5 :: suf) = false := by + dsimp [MustDrain]; split_ifs <;> rfl + have hok_phi' : (if (!isHeadP5 (.p3z m2 :: .p5 :: suf)) = true then + (decide ([1] = [] ∧ + 2 + epW (.p3z m2 :: .p5 :: suf) = 1) && MustDrain (.p3z m2 :: .p5 :: suf) && + decide (2 + ep (.p3z m2 :: .p5 :: suf) = 1 ∧ + 0 + epSum (.p3z m2 :: .p5 :: suf) + 2 * ep (.p3z m2 :: .p5 :: suf) = 2) && + hasP5 (.p3z m2 :: .p5 :: suf) && decide (preP5Val (.p3z m2 :: .p5 :: suf) ≥ 16 ∧ + z0 (p5Suf (.p3z m2 :: .p5 :: suf)) ≥ 38)) || + GoodPhiW (2 + + epW (.p3z m2 :: .p5 :: suf)) [1] (isHeadP3z1 (.p3z m2 :: .p5 :: suf) && decide (0 + = 0 ∧ 2 = 0 ∧ [1] = [])) + else + decide (2 = 0 ∧ [1] = [] ∧ + 0 = 2) || (decide (2 ≥ 1) && GoodPhiW (2 - 1) [1] false)) = true := by + dsimp [isHeadP5]; rw [hepw0]; simp [GoodPhiW] + rw [not_bool_if_false_eq_true hok_phi'] + rw [hmd0, Bool.false_and, if_neg Bool.false_ne_true] + have hrst_f : (decide (0 = 0 ∧ 2 = 0 ∧ + [1] = []) && isHeadP3z1 (.p3z m2 :: .p5 :: suf)) = false := rfl + rw [hrst_f] + simp only [Bool.false_eq_true, ↓reduceIte, Bool.not_true] + by_cases h_cond : (hasOdd (.p3z m2 :: .p5 :: suf) && decide (2 * 2 + 4 ≥ + 0 + epSum (.p3z m2 :: .p5 :: suf))) = true + · rw [if_pos h_cond] + have hm2_odd : m2 % 2 = 1 := by + by_contra hm2_ev + have : hasOdd (.p3z m2 :: .p5 :: suf) = false := by dsimp [hasOdd]; rw [if_neg hm2_ev] + rw [this] at h_cond; cases h_cond + have hep0 : ep (.p3z m2 :: .p5 :: suf) = 0 := by dsimp [ep]; rw [if_pos hm2_odd] + simp [hep0, GoodPsi, GoodDs, GoodDsAux, GoodDs2] + · rw [if_neg h_cond] + · intro fuel + have hf := hch fuel + dsimp only [invChain] at hf ⊢ + rw [if_pos rfl, if_pos ⟨rfl, rfl, rfl, rfl⟩] at hf + dsimp only [drop1L, headP3zVal, drop2L, checkResetSufAux] at hf + rw [if_neg (show m2 + 2 ≠ 1 by omega)] at hf + rw [if_pos rfl, if_neg (by omega)] + exact hf + +theorem step_Inv_ModeE_ge2_p3z1_even_nonreset (ls' : List LTok) (k c : Nat) (ds : List Nat) + (hk : k % 2 = 0) (hrst : ¬(k = 0 ∧ c = 0 ∧ ds = [])) + (hinv : Inv (.ModeE_ge2 (.p3z 1 :: ls') k c ds)) : + Inv (nextModeE_p3z1 ls' (k + 2) ((c + 1) :: ds)) := by + have hc := hinv.1 + have hch := hinv.2 + dsimp only [invCore] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨h_guards, hc⟩ + simp only [Bool.or_eq_false_iff, not_bool_eq_false] at h_guards + rcases h_guards with ⟨⟨hgd, hds2⟩, _⟩ + rw [if_pos hk] at hc + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨heven, hc⟩ + rw [not_bool_eq_false] at heven + dsimp [ValidEvenLs] at heven + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hk_le, hc⟩ + rw [not_bool_eq_false, decide_eq_true_eq] at hk_le + dsimp [prefSumW] at hk_le + have hne2 : ds ≠ [2] := by + apply ds_ne_two_of_checkDs2_ModeE_ge2 hds2 + refine Or.inr (Or.inr (Or.inr (Or.inr ?_))) + dsimp [epSum]; omega + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨hok_phi, hc⟩ + rw [not_bool_eq_false] at hok_phi + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨_, hc⟩ + rw [bool_if_false_eq_true] at hc + rcases hc with ⟨_, hodd_branch⟩ + have h_odd_t : (hasOdd (.p3z 1 :: ls') && decide (2 * c + 4 ≥ k + epSum (.p3z 1 :: ls'))) = + true := by + dsimp [hasOdd, epSum]; simp [hk_le.1] + have hrst_f : (decide (k = 0 ∧ c = 0 ∧ ds = []) && isHeadP3z1 (.p3z 1 :: ls')) = false := by + rw [decide_eq_false hrst, Bool.false_and] + rw [if_pos h_odd_t, hrst_f, if_neg Bool.false_ne_true] at hodd_branch + have hep0 : ep (.p3z 1 :: ls') = 0 := rfl + have hepw0 : epW (.p3z 1 :: ls') = 0 := rfl + have hepsum0 : epSum (.p3z 1 :: ls') = 0 := rfl + rw [hep0, hepsum0, Nat.add_zero, Nat.mul_zero, Nat.add_zero] at hodd_branch + simp only [Bool.and_eq_true] at hodd_branch + rcases hodd_branch with ⟨⟨⟨hgp, hc_ds1⟩, hc_ds0⟩, hc_md⟩ + have hgd' : GoodDs ((c + 1) :: ds) = true := hgp + have hd25_imp : ds = [1] → c ≥ 24 → k ≥ 36 := by + intro h1 hc24 + rw [decide_eq_true ⟨h1, hc24⟩, Bool.not_true, Bool.false_or, decide_eq_true_eq] at hc_ds1 + exact hc_ds1 + have hrst_ch : ¬(k = 0 ∧ c = 0 ∧ ds = [] ∧ isHeadP3z1 (.p3z 1 :: ls') = true) := + fun ⟨hk0, hc0, hds0, _⟩ => hrst ⟨hk0, hc0, hds0⟩ + rcases ValidAfterOdd_cases heven with rfl | ⟨suf, rfl, hz18, hvp5⟩ | ⟨m, suf, rfl, hz18, hvp5⟩ + · dsimp only [nextModeE_p3z1] + have hmd_t : MustDrain [.p3z 1] = true := rfl + have hp5_f : hasP5 [.p3z 1] = false := rfl + have hpre0 : preP5Val [.p3z 1] = 0 := rfl + rw [hmd_t, hpre0] at hc_md + have h_f3 : decide (ds = [] ∧ c = 1 ∧ k = 2 ∧ 0 ≥ 16 ∧ z0 (p5Suf [.p3z 1]) ≥ 38) = false := + decide_eq_false (by omega) + rw [h_f3, Bool.or_false, Bool.not_true, Bool.false_or, decide_eq_true_eq] at hc_md + have hod_imp : (ds = [] ∨ ds = [0]) → c ≥ 8 → k ≥ 16 := by + intro h0 hc8 + have h_t : (ds = [] ∨ ds = [0]) ∧ c ≥ 8 ∧ + ((!hasP5 [.p3z 1]) = true ∨ MustDrain [.p3z 1] = true) := + ⟨h0, hc8, Or.inl rfl⟩ + rw [decide_eq_true h_t, Bool.not_true, Bool.false_or, decide_eq_true_eq] at hc_ds0 + exact hc_ds0 + have hphiw' : GoodPhiW (k + 2) ((c + 1) :: ds) false = true := + GoodPhiW_push_ge8 (k + 2) c ds hc_md.2 (by omega) + (fun h1 hc24 => by have := hd25_imp h1 hc24; omega) + (fun h0 hc8 => by have := hod_imp h0 hc8; omega) + have hne2' : (c + 1) :: ds ≠ [2] := by intro h; injection h with h1 _; omega + have hne1' : (c + 1) :: ds ≠ [1] := by intro h; injection h with h1 _; omega + have hds2' : checkDs2 (.ModeE_ge2 [] 0 (k + 2) ((c + 1) :: ds)) = true := by + dsimp [checkDs2]; rw [if_pos hne2'] + have hds1' : checkDs1Phi1 (.ModeE_ge2 [] 0 (k + 2) ((c + 1) :: ds)) = true := by + dsimp [checkDs1Phi1]; rw [if_pos hne1'] + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs ((c + 1) :: ds) || !checkDs2 (.ModeE_ge2 [] 0 (k + 2) ((c + 1) :: ds)) || + !checkDs1Phi1 (.ModeE_ge2 [] 0 (k + 2) ((c + 1) :: ds))) = false := by + simp [hgd', hds2', hds1'] + rw [bool_if_false_eq_self h_g, if_pos rfl] + dsimp [ValidEvenLs, prefSumW] + have hok_phi' : (if (!isHeadP5 []) = true then + (decide ((c + 1) :: ds = [] ∧ k + 2 + epW [] = 1) && MustDrain [] && + decide (k + 2 + ep [] = 1 ∧ 0 + epSum [] + 2 * ep [] = 2) && + hasP5 [] && decide (preP5Val [] ≥ 16 ∧ z0 (p5Suf []) ≥ 38)) || + GoodPhiW (k + 2 + epW []) ((c + 1) :: ds) (isHeadP3z1 [] && decide (0 = 0 ∧ k + 2 = 0 ∧ + (c + 1) :: ds = [])) + else + decide (k + 2 = 0 ∧ (c + 1) :: ds = [] ∧ + 0 = 2) || (decide (k + 2 ≥ 1) && GoodPhiW (k + 1) ((c + 1) :: ds) false)) = true := by + dsimp [isHeadP5, epW, isHeadP3z1] + simp [hphiw'] + rw [not_bool_if_false_eq_true hok_phi'] + dsimp [MustDrain, isHeadP3z1, hasOdd] + · intro fuel + have hf := hch (fuel + 1) + dsimp only [invChain] at hf ⊢ + rw [if_pos hk, if_neg hrst_ch] at hf + rw [if_pos rfl, if_neg (by simp [isHeadP3z1])] + dsimp only [checkChainAux] at hf + have hodd1 : hasOdd [.p3z 1] = true := rfl + have hepsum1 : epSum [.p3z 1] = 0 := rfl + have hep1 : ep [.p3z 1] = 0 := rfl + have hdec1 : decide (2 * c + 4 ≥ k + 0) = true := decide_eq_true (by omega) + rw [hodd1, hepsum1, hep1, hdec1, hmd_t, hp5_f] at hf + simp only [Bool.and_true, ↓reduceIte, Bool.not_true, Bool.false_eq_true, Nat.add_zero, + Nat.mul_zero] at hf + exact hf + · dsimp only [nextModeE_p3z1] + have hmd_f : MustDrain (.p3z 1 :: .p5 :: suf) = false := rfl + have hip5_f : (!isHeadP5 (.p3z 1 :: .p5 :: suf)) = true := rfl + rw [if_pos hip5_f, hmd_f, hepw0, Nat.add_zero, Bool.and_comm (isHeadP3z1 _), hrst_f] at hok_phi + simp only [Bool.and_false, Bool.false_and, Bool.false_or] at hok_phi + have hc_pos : c ≥ 1 := GoodPhiW_c_pos hne2 hok_phi + have hne2' : (c + 1) :: ds ≠ [2] := by + intro h; injection h with h1 h2; subst h2 + have hc6 := GoodPhiW_nil_ge6 hok_phi; omega + have hne1' : (c + 1) :: ds ≠ [1] := by intro h; injection h with h1 _; omega + have hds2' : checkDs2 (.ModeE_ge2 suf 1 (k + 4) ((c + 1) :: ds)) = true := by + dsimp [checkDs2]; rw [if_pos hne2'] + have hds1' : checkDs1Phi1 (.ModeE_ge2 suf 1 (k + 4) ((c + 1) :: ds)) = true := by + dsimp [checkDs1Phi1]; rw [if_pos hne1'] + have h1_odd : ¬(1 % 2 = 0) := by omega + have hb1' : ¬((c + 1) :: ds = [] ∧ 1 = 1 ∧ k + 4 = 1 ∧ isP3zP5 suf = true ∧ + headP3zVal suf ≥ 3) := by + intro ⟨h, _⟩; cases h + have hb2' : ¬((c + 1) :: ds = [] ∧ + ((1 = 1 ∧ k + 4 = 1 ∧ z0 suf = 1) ∨ (1 = 3 ∧ k + 4 = 2 ∧ z0 suf = 0)) ∧ + isP3zP5 (dropZ0 suf) = true ∧ headP3zVal (dropZ0 suf) ≥ 18 ∧ z0 (p5Suf suf) ≥ 38) := by + intro ⟨h, _⟩; cases h + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs ((c + 1) :: ds) || !checkDs2 (.ModeE_ge2 suf 1 (k + 4) ((c + 1) :: ds)) || + !checkDs1Phi1 (.ModeE_ge2 suf 1 (k + 4) ((c + 1) :: ds))) = false := by + simp [hgd', hds2', hds1'] + rw [bool_if_false_eq_self h_g, if_neg h1_odd, not_bool_if_false_eq_true hvp5] + rw [not_decide_if_false_eq_true (by omega)] + rw [if_neg hb1', if_neg hb2'] + have h20 : decide (k + 4 + z0 suf ≥ 20 ∧ 1 + 2 * z0 suf ≥ 15) = true := + decide_eq_true (by omega) + have h8 : decide (k + 4 + z0 suf ≥ 8 ∧ 1 + 2 * z0 suf ≥ 15) = true := + decide_eq_true (by omega) + have h17 : decide (1 + 2 * z0 suf ≥ 17) = true := decide_eq_true (by omega) + have h37 : decide (1 + 2 * z0 suf ≥ 37) = true := decide_eq_true (by omega) + rw [h20, h8, ite_self, h17, h37] + simp only [Bool.true_and, Bool.or_true] + apply d25_check_of_ge36 + intro d hd_eq hd25 + injection hd_eq with hd1 hds_eq + have := hd25_imp hds_eq (by omega) + omega + · intro fuel + have hf := hch (fuel + 1) + dsimp only [invChain] at hf ⊢ + rw [if_pos hk, if_neg hrst_ch] at hf + rw [if_neg h1_odd, if_neg hb1', if_neg hb2'] + dsimp only [checkChainAux] at hf + have hodd1 : hasOdd (.p3z 1 :: .p5 :: suf) = true := rfl + have hepsum1 : epSum (.p3z 1 :: .p5 :: suf) = 0 := rfl + have hep1 : ep (.p3z 1 :: .p5 :: suf) = 0 := rfl + have hp5_1 : hasP5 (.p3z 1 :: .p5 :: suf) = true := rfl + have hsuf1 : p5Suf (.p3z 1 :: .p5 :: suf) = suf := rfl + have hdec1 : decide (2 * c + 4 ≥ k + 0) = true := decide_eq_true (by omega) + rw [hodd1, hepsum1, hep1, hdec1, hmd_f, hp5_1, hsuf1] at hf + simp only [Bool.and_true, ↓reduceIte, Bool.not_false, Bool.not_true, Bool.false_eq_true, + Nat.add_zero, Nat.mul_zero, Bool.and_eq_true] at hf + exact hf.2 + · have hmd_t : MustDrain (.p3z 1 :: .p3z m :: .p5 :: suf) = true := rfl + have hp5_t : hasP5 (.p3z 1 :: .p3z m :: .p5 :: suf) = true := rfl + have hpre_m : preP5Val (.p3z 1 :: .p3z m :: .p5 :: suf) = m := rfl + have hsuf_m : p5Suf (.p3z 1 :: .p3z m :: .p5 :: suf) = suf := rfl + rw [hmd_t, hpre_m, hsuf_m] at hc_md + have hod_imp : (ds = [] ∨ ds = [0]) → c ≥ 8 → k ≥ 16 := by + intro h0 hc8 + have h_t : (ds = [] ∨ ds = [0]) ∧ c ≥ 8 ∧ + ((!hasP5 (.p3z 1 :: .p3z m :: .p5 :: suf)) = true ∨ + MustDrain (.p3z 1 :: .p3z m :: .p5 :: suf) = true) := + ⟨h0, hc8, Or.inr rfl⟩ + rw [decide_eq_true h_t, Bool.not_true, Bool.false_or, decide_eq_true_eq] at hc_ds0 + exact hc_ds0 + cases m with + | zero => + dsimp only [nextModeE_p3z1] + have h_f3 : decide (ds = [] ∧ c = 1 ∧ k = 2 ∧ 0 ≥ 16 ∧ z0 suf ≥ 38) = false := + decide_eq_false (by omega) + rw [h_f3, Bool.or_false, Bool.not_true, Bool.false_or, decide_eq_true_eq] at hc_md + have hphiw' : GoodPhiW (k + 2) ((c + 1) :: ds) false = true := + GoodPhiW_push_ge8 (k + 2) c ds hc_md.2 (by omega) + (fun h1 hc24 => by have := hd25_imp h1 hc24; omega) + (fun h0 hc8 => by have := hod_imp h0 hc8; omega) + have hne2' : (c + 1) :: ds ≠ [2] := by intro h; injection h with h1 _; omega + have hne1' : (c + 1) :: ds ≠ [1] := by intro h; injection h with h1 _; omega + have hds2' : checkDs2 (.ModeE_ge2 (.p5 :: suf) 0 (k + 3) ((c + 1) :: ds)) = true := by + dsimp [checkDs2]; rw [if_pos hne2'] + have hds1' : checkDs1Phi1 (.ModeE_ge2 (.p5 :: suf) 0 (k + 3) ((c + 1) :: ds)) = true := by + dsimp [checkDs1Phi1]; rw [if_pos hne1'] + have heven_p5 : ValidEvenLs (.p5 :: suf) = true := by + dsimp [ValidEvenLs]; simp [hz18, hvp5] + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs ((c + 1) :: ds) || !checkDs2 (.ModeE_ge2 (.p5 :: suf) 0 (k + 3) ((c + + 1) :: ds)) || + !checkDs1Phi1 (.ModeE_ge2 (.p5 :: suf) 0 (k + 3) ((c + 1) :: ds))) = false := by + simp [hgd', hds2', hds1'] + rw [bool_if_false_eq_self h_g, if_pos rfl, not_bool_if_false_eq_true heven_p5] + dsimp [prefSumW] + have hok_phi' : (if (!isHeadP5 (.p5 :: suf)) = true then + (decide ((c + 1) :: ds = [] ∧ + k + 2 + 1 + epW (.p5 :: suf) = 1) && MustDrain (.p5 :: suf) && + decide (k + 2 + 1 + ep (.p5 :: suf) = 1 ∧ + 0 + epSum (.p5 :: suf) + 2 * ep (.p5 :: suf) = 2) && + hasP5 (.p5 :: suf) && decide (preP5Val (.p5 :: suf) ≥ 16 ∧ + z0 (p5Suf (.p5 :: suf)) ≥ 38)) || + GoodPhiW (k + 2 + 1 + epW (.p5 :: suf)) ((c + + 1) :: ds) (isHeadP3z1 (.p5 :: suf) && decide (0 = 0 ∧ k + 2 + 1 = 0 ∧ + (c + 1) :: ds = [])) + else + decide (k + 2 + 1 = 0 ∧ (c + 1) :: ds = [] ∧ + 0 = 2) || (decide (k + 2 + 1 ≥ 1) && GoodPhiW (k + 2) ((c + 1) :: ds) false)) = + true := by + dsimp [isHeadP5] + simp [hphiw'] + rw [not_bool_if_false_eq_true hok_phi'] + dsimp [MustDrain, isHeadP3z1, hasOdd] + · intro fuel + cases fuel with + | zero => + dsimp [invChain]; rfl + | succ fuel' => + have hf := hch (fuel' + 1) + dsimp only [invChain] at hf ⊢ + rw [if_pos hk, if_neg hrst_ch] at hf + rw [if_pos rfl, if_neg (by simp [isHeadP3z1])] + dsimp only [checkChainAux] at hf ⊢ + have hodd1 : hasOdd (.p3z 1 :: .p3z 0 :: .p5 :: suf) = true := rfl + have hepsum1 : epSum (.p3z 1 :: .p3z 0 :: .p5 :: suf) = 0 := rfl + have hep1 : ep (.p3z 1 :: .p3z 0 :: .p5 :: suf) = 0 := rfl + have hdec1 : decide (2 * c + 4 ≥ k + 0) = true := decide_eq_true (by omega) + rw [hodd1, hepsum1, hep1, hdec1, hmd_t, hp5_t, hpre_m, hsuf_m] at hf + simp only [Bool.and_true, ↓reduceIte, Bool.not_true, Bool.false_eq_true, + Nat.add_zero, Nat.mul_zero] at hf + have h_c0 : True ∧ 0 ≤ 2 * k + 10 := ⟨trivial, by omega⟩ + rw [if_pos h_c0] at hf + dsimp [hasOdd, hasP5, isHeadP5, p5Suf, ep, epSum] + exact hf + | succ m' => + cases m' with + | zero => + dsimp only [nextModeE_p3z1] + have h_f3 : decide (ds = [] ∧ c = 1 ∧ k = 2 ∧ 1 ≥ 16 ∧ z0 suf ≥ 38) = false := + decide_eq_false (by omega) + rw [h_f3, Bool.or_false, Bool.not_true, Bool.false_or, decide_eq_true_eq] at hc_md + have hf1 := hch 1 + dsimp only [invChain] at hf1 + rw [if_pos hk, if_neg hrst_ch] at hf1 + dsimp only [checkChainAux] at hf1 + have hodd1 : hasOdd (.p3z 1 :: .p3z 1 :: .p5 :: suf) = true := rfl + have hepsum1 : epSum (.p3z 1 :: .p3z 1 :: .p5 :: suf) = 0 := rfl + have hep1 : ep (.p3z 1 :: .p3z 1 :: .p5 :: suf) = 0 := rfl + have hdec1 : decide (2 * c + 4 ≥ k + 0) = true := decide_eq_true (by omega) + rw [hodd1, hepsum1, hep1, hdec1, hmd_t, hp5_t, hpre_m] at hf1 + simp only [Bool.and_true, ↓reduceIte, Bool.not_true, Bool.false_eq_true, + Nat.add_zero, Nat.mul_zero] at hf1 + have h_c2 : True ∧ 0 + 1 ≤ 2 * k + 11 := ⟨trivial, by omega⟩ + rw [if_pos h_c2] at hf1 + have hgd'' : GoodDs ((k + 3) :: (c + 1) :: ds) = true := hf1 + have hds2' : checkDs2 (.ModeE_ge2 suf 1 2 ((k + 3) :: (c + 1) :: ds)) = true := by + dsimp [checkDs2] + have hds1' : checkDs1Phi1 (.ModeE_ge2 suf 1 2 ((k + 3) :: (c + 1) :: ds)) = true := by + dsimp [checkDs1Phi1] + have h1_odd : ¬(1 % 2 = 0) := by omega + have hb1' : ¬((k + 3) :: (c + 1) :: ds = [] ∧ 1 = 1 ∧ 2 = 1 ∧ isP3zP5 suf = true ∧ + headP3zVal suf ≥ 3) := by + intro ⟨h, _⟩; cases h + have hb2' : ¬((k + 3) :: (c + 1) :: ds = [] ∧ + ((1 = 1 ∧ 2 = 1 ∧ z0 suf = 1) ∨ (1 = 3 ∧ 2 = 2 ∧ z0 suf = 0)) ∧ + isP3zP5 (dropZ0 suf) = true ∧ headP3zVal (dropZ0 suf) ≥ 18 ∧ z0 (p5Suf suf) ≥ 38) := by + intro ⟨h, _⟩; cases h + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs ((k + 3) :: (c + 1) :: ds) || + !checkDs2 (.ModeE_ge2 suf 1 2 ((k + 3) :: (c + 1) :: ds)) || + !checkDs1Phi1 (.ModeE_ge2 suf 1 2 ((k + 3) :: (c + 1) :: ds))) = false := by + simp [hgd'', hds2', hds1'] + rw [bool_if_false_eq_self h_g, if_neg h1_odd, not_bool_if_false_eq_true hvp5] + rw [not_decide_if_false_eq_true (by omega)] + rw [if_neg hb1', if_neg hb2'] + have h20 : decide (2 + z0 suf ≥ 20 ∧ 1 + 2 * z0 suf ≥ 15) = true := + decide_eq_true (by omega) + have h8 : decide (2 + z0 suf ≥ 8 ∧ 1 + 2 * z0 suf ≥ 15) = true := + decide_eq_true (by omega) + have h17 : decide (1 + 2 * z0 suf ≥ 17) = true := decide_eq_true (by omega) + have h37 : decide (1 + 2 * z0 suf ≥ 37) = true := decide_eq_true (by omega) + rw [h20, h8, ite_self, h17, h37] + simp only [Bool.true_and, Bool.or_true] + apply d25_check_of_ge36 + intro d hd_eq _ + injection hd_eq with _ hd2 + injection hd2 with hc1 _ + omega + · intro fuel + have hf := hch (fuel + 1) + dsimp only [invChain] at hf ⊢ + rw [if_pos hk, if_neg hrst_ch] at hf + rw [if_neg h1_odd, if_neg hb1', if_neg hb2'] + dsimp only [checkChainAux] at hf + rw [hodd1, hepsum1, hep1, hdec1, hmd_t, hp5_t, hpre_m, hsuf_m] at hf + simp only [Bool.and_true, ↓reduceIte, Bool.not_true, Bool.false_eq_true, + Nat.add_zero, Nat.mul_zero] at hf + rw [if_pos h_c2] at hf + exact (Bool.and_eq_true _ _).mp hf |>.2 + | succ m2 => + dsimp only [nextModeE_p3z1] + have heven_m2 : ValidEvenLs (.p3z m2 :: .p5 :: suf) = true := by + dsimp [ValidEvenLs, ValidAfterOdd] + split_ifs <;> simp [hz18, hvp5] + have hpref0 : prefSumW (.p3z m2 :: .p5 :: suf) = 0 := by + dsimp [prefSumW]; split_ifs <;> rfl + have hepw0_m2 : epW (.p3z m2 :: .p5 :: suf) = 0 := by + dsimp [epW]; split_ifs <;> rfl + have hmd0_m2 : MustDrain (.p3z m2 :: .p5 :: suf) = false := by + dsimp [MustDrain]; split_ifs <;> rfl + rw [Bool.not_true, Bool.false_or] at hc_md + rcases Bool.or_eq_true_iff.mp hc_md with h14_7 | hphi1 + · rw [decide_eq_true_eq] at h14_7 + have hphiw' : GoodPhiW (k + 2) ((c + 1) :: ds) false = true := + GoodPhiW_push_ge8 (k + 2) c ds h14_7.2 (by omega) + (fun h1 hc24 => by have := hd25_imp h1 hc24; omega) + (fun h0 hc8 => by have := hod_imp h0 hc8; omega) + have hne2' : (c + 1) :: ds ≠ [2] := by intro h; injection h with h1 _; omega + have hne1' : (c + 1) :: ds ≠ [1] := by intro h; injection h with h1 _; omega + have hds2' : checkDs2 (.ModeE_ge2 (.p3z m2 :: .p5 :: suf) 0 (k + 2) ((c + 1) :: ds)) = + true := by + dsimp [checkDs2]; rw [if_pos hne2'] + have hds1' : checkDs1Phi1 (.ModeE_ge2 (.p3z m2 :: .p5 :: suf) 0 (k + 2) ((c + 1) :: ds)) = + true := by + dsimp [checkDs1Phi1]; rw [if_pos hne1'] + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs ((c + 1) :: ds) || + !checkDs2 (.ModeE_ge2 (.p3z m2 :: .p5 :: suf) 0 (k + 2) ((c + 1) :: ds)) || + !checkDs1Phi1 (.ModeE_ge2 (.p3z m2 :: .p5 :: suf) 0 (k + 2) ((c + 1) :: ds))) = + false := by + simp [hgd', hds2', hds1'] + rw [bool_if_false_eq_self h_g, if_pos rfl, not_bool_if_false_eq_true heven_m2] + rw [hpref0, not_decide_if_false_eq_true (by omega)] + have hok_phi' : (if (!isHeadP5 (.p3z m2 :: .p5 :: suf)) = true then + (decide ((c + 1) :: ds = [] ∧ + k + 2 + epW (.p3z m2 :: .p5 :: suf) = 1) && MustDrain (.p3z m2 :: .p5 :: suf) && + decide (k + 2 + ep (.p3z m2 :: .p5 :: suf) = 1 ∧ + 0 + epSum (.p3z m2 :: .p5 :: suf) + 2 * ep (.p3z m2 :: .p5 :: suf) = 2) && + hasP5 (.p3z m2 :: .p5 :: suf) && decide (preP5Val (.p3z m2 :: .p5 :: suf) ≥ 16 ∧ + z0 (p5Suf (.p3z m2 :: .p5 :: suf)) ≥ 38)) || + GoodPhiW (k + 2 + epW (.p3z m2 :: .p5 :: suf)) ((c + 1) :: ds) + (isHeadP3z1 (.p3z m2 :: .p5 :: suf) && decide (0 = 0 ∧ k + 2 = 0 ∧ + (c + 1) :: ds = [])) + else + decide (k + 2 = 0 ∧ (c + 1) :: ds = [] ∧ + 0 = 2) || (decide (k + 2 ≥ 1) && GoodPhiW (k + 2 - 1) ((c + 1) :: ds) false)) = + true := by + dsimp [isHeadP5]; rw [hepw0_m2, Nat.add_zero, GoodPhiW_mono _ _ _ hphiw', + Bool.or_true] + rw [not_bool_if_false_eq_true hok_phi'] + rw [hmd0_m2, Bool.false_and, if_neg Bool.false_ne_true] + have hrst_f' : (decide (0 = 0 ∧ k + 2 = 0 ∧ + (c + 1) :: ds = []) && isHeadP3z1 (.p3z m2 :: .p5 :: suf)) = false := by + rw [decide_eq_false (by omega), Bool.false_and] + rw [hrst_f'] + simp only [Bool.false_eq_true, ↓reduceIte, Bool.not_true] + by_cases h_cond : (hasOdd (.p3z m2 :: .p5 :: suf) && decide (2 * (k + 2) + 4 ≥ + 0 + epSum (.p3z m2 :: .p5 :: suf))) = true + · rw [if_pos h_cond] + simp only [Bool.and_eq_true, decide_eq_true_eq] at h_cond + have hm2_odd : m2 % 2 = 1 := by + by_contra hm2_ev + have : hasOdd (.p3z m2 :: .p5 :: suf) = false := by + dsimp [hasOdd]; rw [if_neg hm2_ev] + rw [this] at h_cond; cases h_cond.1 + have hep0_m2 : ep (.p3z m2 :: .p5 :: suf) = 0 := by dsimp [ep]; rw [if_pos hm2_odd] + have hepsum_m2 : epSum (.p3z m2 :: .p5 :: suf) = m2 - 1 := by + dsimp [epSum]; rw [if_pos hm2_odd] + rw [hepsum_m2] at h_cond + have hf1 := hch 1 + dsimp only [invChain] at hf1 + rw [if_pos hk, if_neg hrst_ch] at hf1 + dsimp only [checkChainAux] at hf1 + have hodd1 : hasOdd (.p3z 1 :: .p3z (m2 + 2) :: .p5 :: suf) = true := rfl + have hepsum1 : epSum (.p3z 1 :: .p3z (m2 + 2) :: .p5 :: suf) = 0 := rfl + have hep1 : ep (.p3z 1 :: .p3z (m2 + 2) :: .p5 :: suf) = 0 := rfl + have hdec1 : decide (2 * c + 4 ≥ k + 0) = true := decide_eq_true (by omega) + rw [hodd1, hepsum1, hep1, hdec1, hmd_t, hp5_t, hpre_m] at hf1 + simp only [Bool.and_true, ↓reduceIte, Bool.not_true, Bool.false_eq_true, + Nat.add_zero, Nat.mul_zero] at hf1 + have hm2_le : 2 * (k + 2) + 4 ≥ m2 - 1 := by have := h_cond.2; omega + have h_c1_m2 : ¬((m2 + 1 + 1) % 2 = 0 ∧ m2 + 1 + 1 ≤ 2 * k + 10) := by omega + have h_c2_m2 : (m2 + 1 + 1) % 2 = 1 ∧ m2 + 1 + 1 ≤ 2 * k + 11 := by omega + rw [if_neg h_c1_m2, if_pos h_c2_m2] at hf1 + have hgp' : GoodPsi (k + 2 + ep (.p3z m2 :: .p5 :: suf)) ((c + 1) :: ds) = true := by + rw [hep0_m2, Nat.add_zero]; exact hf1 + rw [hgp'] + have hf_ds1 : decide ((c + 1) :: ds = [1] ∧ + k + 2 + ep (.p3z m2 :: .p5 :: suf) ≥ 24) = false := + decide_eq_false (fun ⟨h, _⟩ => hne1' h) + have hf_ds0 : decide (((c + 1) :: ds = [] ∨ (c + 1) :: ds = [0]) ∧ + k + 2 + ep (.p3z m2 :: .p5 :: suf) ≥ 8 ∧ + ((!hasP5 (.p3z m2 :: .p5 :: suf)) = true ∨ False)) = false := by + apply decide_eq_false + rintro ⟨h_or, _⟩ + rcases h_or with h | h + · cases h + · injection h with h1 _; omega + rw [hf_ds1, hf_ds0] + simp + · rw [if_neg h_cond] + · intro fuel + have hrst_ch' : ¬(0 = 0 ∧ k + 2 = 0 ∧ (c + 1) :: ds = [] ∧ + isHeadP3z1 (.p3z m2 :: .p5 :: suf) = true) := by + omega + by_cases h_c1 : (m2 + 2) % 2 = 0 ∧ m2 + 2 ≤ 2 * k + 10 + · cases fuel with + | zero => + dsimp [invChain]; rfl + | succ fuel' => + have hf := hch (fuel' + 1) + dsimp only [invChain] at hf ⊢ + rw [if_pos hk, if_neg hrst_ch] at hf + rw [if_pos rfl, if_neg hrst_ch'] + dsimp only [checkChainAux] at hf ⊢ + have hodd1 : hasOdd (.p3z 1 :: .p3z (m2 + 2) :: .p5 :: suf) = true := rfl + have hepsum1 : epSum (.p3z 1 :: .p3z (m2 + 2) :: .p5 :: suf) = 0 := rfl + have hep1 : ep (.p3z 1 :: .p3z (m2 + 2) :: .p5 :: suf) = 0 := rfl + have hdec1 : decide (2 * c + 4 ≥ k + 0) = true := decide_eq_true (by omega) + rw [hodd1, hepsum1, hep1, hdec1, hmd_t, hp5_t, hpre_m, hsuf_m] at hf + simp only [Bool.and_true, ↓reduceIte, Bool.not_true, Bool.false_eq_true, + Nat.add_zero, Nat.mul_zero] at hf + rw [if_pos h_c1] at hf + have hm2_ev : ¬(m2 % 2 = 1) := by omega + have hodd_m2 : hasOdd (.p3z m2 :: .p5 :: suf) = false := by + dsimp [hasOdd]; rw [if_neg hm2_ev] + have hp5_m2 : hasP5 (.p3z m2 :: .p5 :: suf) = true := rfl + have hip5_m2 : isHeadP5 (.p3z m2 :: .p5 :: suf) = false := rfl + have hepsum_m2 : epSum (.p3z m2 :: .p5 :: suf) = m2 := by + dsimp [epSum]; rw [if_neg hm2_ev] + have hep_m2 : ep (.p3z m2 :: .p5 :: suf) = 1 := by dsimp [ep]; rw [if_neg hm2_ev] + have hsuf_m2 : p5Suf (.p3z m2 :: .p5 :: suf) = suf := rfl + have hdec_m2 : decide (2 * (k + 2) + 4 ≥ 0 + m2) = true := decide_eq_true (by omega) + rw [hodd_m2, hepsum_m2, hep_m2, hp5_m2, hip5_m2, hsuf_m2, hdec_m2] + simp only [Bool.false_and, Bool.false_eq_true, ↓reduceIte, Bool.not_false, + Bool.true_and, Bool.false_or, Nat.zero_add] + have hk5 : k + 3 + 1 + 1 = k + 5 := by omega + have hm5 : m2 + 2 * 1 + 3 = m2 + 2 + 3 := by omega + rw [hk5, hm5] + exact hf + · by_cases h_c2 : (m2 + 2) % 2 = 1 ∧ m2 + 2 ≤ 2 * k + 11 + · cases fuel with + | zero => + dsimp [invChain]; rfl + | succ fuel' => + have hf := hch (fuel' + 1) + dsimp only [invChain] at hf ⊢ + rw [if_pos hk, if_neg hrst_ch] at hf + rw [if_pos rfl, if_neg hrst_ch'] + dsimp only [checkChainAux] at hf ⊢ + have hodd1 : hasOdd (.p3z 1 :: .p3z (m2 + 2) :: .p5 :: suf) = true := rfl + have hepsum1 : epSum (.p3z 1 :: .p3z (m2 + 2) :: .p5 :: suf) = 0 := rfl + have hep1 : ep (.p3z 1 :: .p3z (m2 + 2) :: .p5 :: suf) = 0 := rfl + have hdec1 : decide (2 * c + 4 ≥ k + 0) = true := decide_eq_true (by omega) + rw [hodd1, hepsum1, hep1, hdec1, hmd_t, hp5_t, hpre_m, hsuf_m] at hf + simp only [Bool.and_true, ↓reduceIte, Bool.not_true, Bool.false_eq_true, + Nat.add_zero, Nat.mul_zero] at hf + rw [if_neg h_c1, if_pos h_c2] at hf + have hm2_odd : m2 % 2 = 1 := by omega + have hodd_m2 : hasOdd (.p3z m2 :: .p5 :: suf) = true := by + dsimp [hasOdd]; rw [if_pos hm2_odd] + have hp5_m2 : hasP5 (.p3z m2 :: .p5 :: suf) = true := rfl + have hepsum_m2 : epSum (.p3z m2 :: .p5 :: suf) = m2 - 1 := by + dsimp [epSum]; rw [if_pos hm2_odd] + have hep_m2 : ep (.p3z m2 :: .p5 :: suf) = 0 := by dsimp [ep]; rw [if_pos hm2_odd] + have hsuf_m2 : p5Suf (.p3z m2 :: .p5 :: suf) = suf := rfl + have hdec_m2 : decide (2 * (k + 2) + 4 ≥ 0 + (m2 - 1)) = true := + decide_eq_true (by omega) + rw [hodd_m2, hepsum_m2, hep_m2, hmd0_m2, hp5_m2, hsuf_m2, hdec_m2] + simp only [Bool.and_true, ↓reduceIte, Bool.not_false, Bool.not_true, + Bool.false_eq_true, Nat.add_zero, Nat.zero_add, Nat.mul_zero] + have hm3 : m2 - 1 + 4 = m2 + 2 + 1 := by omega + rw [hm3] + exact hf + · have hf := hch (fuel + 1) + dsimp only [invChain] at hf ⊢ + rw [if_pos hk, if_neg hrst_ch] at hf + rw [if_pos rfl, if_neg hrst_ch'] + dsimp only [checkChainAux] at hf + have hodd1 : hasOdd (.p3z 1 :: .p3z (m2 + 2) :: .p5 :: suf) = true := rfl + have hepsum1 : epSum (.p3z 1 :: .p3z (m2 + 2) :: .p5 :: suf) = 0 := rfl + have hep1 : ep (.p3z 1 :: .p3z (m2 + 2) :: .p5 :: suf) = 0 := rfl + have hdec1 : decide (2 * c + 4 ≥ k + 0) = true := decide_eq_true (by omega) + rw [hodd1, hepsum1, hep1, hdec1, hmd_t, hp5_t, hpre_m, hsuf_m] at hf + simp only [Bool.and_true, ↓reduceIte, Bool.not_true, Bool.false_eq_true, + Nat.add_zero, Nat.mul_zero] at hf + rw [if_neg h_c1, if_neg h_c2] at hf + exact hf + · rw [decide_eq_true_eq] at hphi1 + rcases hphi1 with ⟨rfl, rfl, rfl, hm2_ge, hz38⟩ + have hm2_14 : m2 ≥ 14 := by omega + have hepsum_14 : epSum (.p3z m2 :: .p5 :: suf) ≥ 14 := epSum_p3z_p5_ge14 hm2_14 + have hds2' : checkDs2 (.ModeE_ge2 (.p3z m2 :: .p5 :: suf) 0 4 [2]) = true := by + dsimp only [checkDs2] + have hp5_t : hasP5 (.p3z m2 :: .p5 :: suf) = true := rfl + have hsuf_eq : p5Suf (.p3z m2 :: .p5 :: suf) = suf := rfl + have hip5_f : isHeadP5 (.p3z m2 :: .p5 :: suf) = false := rfl + rw [if_neg (by decide), hp5_t, hmd0_m2, hsuf_eq, hip5_f, + decide_eq_true hz38, decide_eq_true (show 0 + epSum (.p3z m2 :: .p5 :: suf) ≥ + 2 * 4 + 6 by omega)] + rfl + have hds1' : checkDs1Phi1 (.ModeE_ge2 (.p3z m2 :: .p5 :: suf) 0 4 [2]) = true := rfl + refine ⟨?_, ?_⟩ + · dsimp only [invCore] + have h_g : (!GoodDs [2] || !checkDs2 (.ModeE_ge2 (.p3z m2 :: .p5 :: suf) 0 4 [2]) || + !checkDs1Phi1 (.ModeE_ge2 (.p3z m2 :: .p5 :: suf) 0 4 [2])) = false := by + simp [GoodDs, GoodDsAux, GoodDs1, hds2', hds1'] + rw [bool_if_false_eq_self h_g, if_pos rfl, not_bool_if_false_eq_true heven_m2] + rw [hpref0, not_decide_if_false_eq_true (by omega)] + have hok_phi' : (if (!isHeadP5 (.p3z m2 :: .p5 :: suf)) = true then + (decide ([2] = [] ∧ + 4 + epW (.p3z m2 :: .p5 :: suf) = 1) && MustDrain (.p3z m2 :: .p5 :: suf) && + decide (4 + ep (.p3z m2 :: .p5 :: suf) = 1 ∧ + 0 + epSum (.p3z m2 :: .p5 :: suf) + 2 * ep (.p3z m2 :: .p5 :: suf) = 2) && + hasP5 (.p3z m2 :: .p5 :: suf) && decide (preP5Val (.p3z m2 :: .p5 :: suf) ≥ 16 ∧ + z0 (p5Suf (.p3z m2 :: .p5 :: suf)) ≥ 38)) || + GoodPhiW (4 + epW (.p3z m2 :: .p5 :: suf)) [2] + (isHeadP3z1 (.p3z m2 :: .p5 :: suf) && decide (0 = 0 ∧ 4 = 0 ∧ [2] = [])) + else + decide (4 = 0 ∧ [2] = [] ∧ + 0 = 2) || (decide (4 ≥ 1) && GoodPhiW (4 - 1) [2] false)) = true := by + dsimp [isHeadP5]; rw [hepw0_m2]; simp [GoodPhiW] + rw [not_bool_if_false_eq_true hok_phi'] + rw [hmd0_m2, Bool.false_and, if_neg Bool.false_ne_true] + have hrst_f' : (decide (0 = 0 ∧ 4 = 0 ∧ + [2] = []) && isHeadP3z1 (.p3z m2 :: .p5 :: suf)) = false := rfl + rw [hrst_f'] + simp only [Bool.false_eq_true, ↓reduceIte, Bool.not_true] + have hdec_f : decide (2 * 4 + 4 ≥ 0 + epSum (.p3z m2 :: .p5 :: suf)) = false := + decide_eq_false (by omega) + rw [hdec_f, Bool.and_false, if_neg Bool.false_ne_true] + · intro fuel + have hf := hch (fuel + 1) + dsimp only [invChain] at hf ⊢ + rw [if_pos hk, if_neg hrst_ch] at hf + rw [if_pos rfl, if_neg (by omega)] + dsimp only [checkChainAux] at hf + have hodd1 : hasOdd (.p3z 1 :: .p3z (m2 + 2) :: .p5 :: suf) = true := rfl + have hepsum1 : epSum (.p3z 1 :: .p3z (m2 + 2) :: .p5 :: suf) = 0 := rfl + have hep1 : ep (.p3z 1 :: .p3z (m2 + 2) :: .p5 :: suf) = 0 := rfl + have hdec1 : decide (2 * 1 + 4 ≥ 2 + 0) = true := rfl + rw [hodd1, hepsum1, hep1, hdec1, hmd_t, hp5_t, hpre_m, hsuf_m] at hf + simp only [Bool.and_true, ↓reduceIte, Bool.not_true, Bool.false_eq_true, + Nat.add_zero, Nat.mul_zero] at hf + have h_n1 : ¬((m2 + 1 + 1) % 2 = 0 ∧ m2 + 1 + 1 ≤ 2 * 2 + 10) := by omega + have h_n2 : ¬((m2 + 1 + 1) % 2 = 1 ∧ m2 + 1 + 1 ≤ 2 * 2 + 11) := by omega + rw [if_neg h_n1, if_neg h_n2] at hf + exact hf + +theorem step_Inv_ModeE_ge2_p3z1 (ls' : List LTok) (k c : Nat) (ds : List Nat) + (hinv : Inv (.ModeE_ge2 (.p3z 1 :: ls') k c ds)) : + Inv (nextModeE_p3z1 ls' (k + 2) ((c + 1) :: ds)) := by + by_cases hk : k % 2 = 0 + · by_cases hrst : k = 0 ∧ c = 0 ∧ ds = [] + · rcases hrst with ⟨rfl, rfl, rfl⟩ + exact step_Inv_ModeE_ge2_p3z1_reset ls' hinv + · exact step_Inv_ModeE_ge2_p3z1_even_nonreset ls' k c ds hk hrst hinv + · exact step_Inv_ModeE_ge2_p3z1_odd ls' k c ds hk hinv + +theorem step_Inv_ModeE_ge2 (ls : List LTok) (k c : Nat) (ds : List Nat) + (hinv : Inv (.ModeE_ge2 ls k c ds)) : + Inv (nextState (.ModeE_ge2 ls k c ds)) := by + cases ls with + | nil => exact step_Inv_ModeE_ge2_nil k c ds hinv + | cons tok ls' => + cases tok with + | p5 => exact step_Inv_ModeE_ge2_p5 ls' k c ds hinv + | p3z m => + cases m with + | zero => exact step_Inv_ModeE_ge2_p3z0 ls' k c ds hinv + | succ m' => + cases m' with + | zero => exact step_Inv_ModeE_ge2_p3z1 ls' k c ds hinv + | succ m2 => exact step_Inv_ModeE_ge2_p3z_ge2 m2 ls' k c ds hinv + +theorem step_Inv (s : ModeState) (hinv : Inv s) : Inv (nextState s) := by + cases s with + | ModeE_c1 ls k ds => exact step_Inv_ModeE_c1 ls k ds hinv + | ModeE_ge2 ls k c ds => exact step_Inv_ModeE_ge2 ls k c ds hinv + | ModeB_ge3 ls a c ds => + cases c with + | zero => exact step_Inv_ModeB_ge3_c0 ls a ds hinv + | succ c' => exact step_Inv_ModeB_ge3_cpos ls a c' ds hinv + | ModeB_b2 ls m ds => exact step_Inv_ModeB_b2 ls m ds hinv + | ModeB_blank ls a => exact step_Inv_ModeB_blank ls a hinv + + +theorem nonhalt_of_state_step_inv {Γ Λ S : Type*} [Inhabited Γ] [Inhabited Λ] + (M : Machine Γ Λ) (toCfg : S → Cfg Γ Λ) (Inv : S → Prop) (nextState : S → S) (s₀ : S) + (h0 : (init []) [M]⊢* toCfg s₀) + (hinv0 : Inv s₀) + (hstep_cfg : ∀ s, Inv s → (toCfg s) [M]⊢⁺ toCfg (nextState s)) + (hstep_inv : ∀ s, Inv s → Inv (nextState s)) : + IsDoesNotHalt M := by + have hreach : ∀ k, ∃ s, Inv s ∧ ∃ m ≥ k, multiStep M (init []) m = some (toCfg s) := by + intro k + induction k with + | zero => + obtain ⟨m, hm⟩ := h0 + exact ⟨s₀, hinv0, m, Nat.zero_le m, hm⟩ + | succ k ih => + obtain ⟨s, hs, m, hge, hm⟩ := ih + obtain ⟨d, hd_pos, hd⟩ := hstep_cfg s hs + exact ⟨nextState s, hstep_inv s hs, m + d, by omega, + multiStep_trans M (init []) (toCfg s) (toCfg (nextState s)) m d hm hd⟩ + intro cfg ⟨n, hn⟩ + rw [Option.isSome_iff_ne_none] + intro hnone + obtain ⟨s, _, m, hge, hm⟩ := hreach (n + 1) + have hm_eq : m = n + (1 + (m - n - 1)) := by omega + rw [hm_eq, multiStep_add M (init []) n (1 + (m - n - 1)), hn] at hm + simp only [Option.bind] at hm + rw [multiStep_add M cfg 1 (m - n - 1), multiStep_one, hnone] at hm + simp only [Option.bind] at hm + cases hm + +theorem init_to_s0 : (init []) [target_tm]⊢⁺ toCfg (.ModeB_ge3 [] 1 1 []) := by + have h_init : (init [] : Cfg (Fin 2) (Fin 6)) = (default {{A}}> default) := rfl + rw [h_init] + dsimp only [toCfg, evalL, evalR] + dsimp [O, ListBlank.append] + execute60 + +theorem nonhalt_of_Inv_s0 (h_s0 : Inv (.ModeB_ge3 [] 1 1 [])) : + IsDoesNotHalt target_tm := by + exact nonhalt_of_state_step_inv target_tm toCfg Inv nextState (.ModeB_ge3 [] 1 1 []) + (stepPlus_stepStar init_to_s0) h_s0 step_toCfg step_Inv + +end BusyBeaver.SegmentChain diff --git a/BusyBeaver/Calculi/SharedDonorsA.lean b/BusyBeaver/Calculi/SharedDonorsA.lean new file mode 100644 index 00000000..21ce980a --- /dev/null +++ b/BusyBeaver/Calculi/SharedDonorsA.lean @@ -0,0 +1,7329 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Bridge +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.Excursion + +/-! +# Shared Donor Machine Proofs A (`BusyBeaver.Calculi.SharedDonorsA`) + +Common donor machine reductions and shared inductive invariant certificates +used across related BB(6) non-halting machines. +-/ + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver SixState + +namespace BusyBeaver + + +namespace TM24Donor + +abbrev HalfTape := ListBlank (Fin 2) +abbrev BitWord := List (Fin 2) + +def donor24_machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LA_1RC0LE_1RD0LF_0LA0RD_1LC0LE_HHH0RE" + +abbrev tm24 : Machine (Fin 2) (Fin 6) := donor24_machine.toBB + +abbrev bit0 : BitWord := [0] +abbrev bit1 : BitWord := [1] + +@[simp] theorem multiStep_zero' (M : Machine (Fin 2) (Fin 6)) (config : Cfg (Fin 2) (Fin 6)) : + multiStep M config 0 = some config := rfl +@[simp] theorem multiStep_one' (M : Machine (Fin 2) (Fin 6)) (config : Cfg (Fin 2) (Fin 6)) : + multiStep M config 1 = step M config := rfl +@[simp] theorem multiStep_succ' (M : Machine (Fin 2) (Fin 6)) (config : Cfg (Fin 2) (Fin 6)) (n : + Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] +@[simp] theorem zero_cons_default' : Turing.ListBlank.cons (0 : Fin 2) default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[simp] theorem default_head' : (default : HalfTape).head = 0 := rfl +@[simp] theorem default_tail' : (default : HalfTape).tail = default := rfl +@[simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = Turing.ListBlank.cons a (l +> s) := rfl +@[simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append, append_cons, ih] + +theorem stepPlus_of_multiStep (tm : Machine (Fin 2) (Fin 6)) (c_1 c_2 : Cfg (Fin 2) (Fin 6)) (h : + c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem step_right_cons (tm : Machine (Fin 2) (Fin 6)) (c_1 c_2 : Cfg (Fin 2) (Fin 6)) (h : c_1 + [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1, by decide, stepPlus_of_multiStep tm c_1 c_2 h⟩ +theorem multiStep_add' (tm : Machine (Fin 2) (Fin 6)) (c_1 : Cfg (Fin 2) (Fin 6)) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ', ih, Option.bind_assoc] + simp_rw [multiStep_succ'] +theorem multiStep_trans' (tm : Machine (Fin 2) (Fin 6)) (c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)) (n m : + Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [multiStep_add', h₁]; simp [h₂] +theorem stepPlus_stepStar' {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 : Cfg (Fin 2) (Fin 6)} (h : c_1 + [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ +theorem stepStar_trans' {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, by omega, multiStep_trans' tm c_1 c_2 c_3 n m hn hm⟩ +theorem step_right_default {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), + multiStep_trans' tm c_1 c_2 c_3 n m hn hm⟩ +theorem stepPlus_of_step {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢* c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, m_pos, hm⟩ := h₂ + exact ⟨n + m, by omega, multiStep_trans' tm c_1 c_2 c_3 n m hn hm⟩ +theorem stepPlus_trans' {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢* c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢* c_3 := by + obtain ⟨n, hn⟩ := h₁; obtain ⟨m, hm⟩ := h₂ + exact ⟨n + m, multiStep_trans' tm c_1 c_2 c_3 n m hn hm⟩ +theorem step_left_cons {tm : Machine (Fin 2) (Fin 6)} {c_1 c_2 c_3 : Cfg (Fin 2) (Fin 6)} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + step_right_default (step_right_cons tm c_1 c_2 h₁) h₂ + +macro "finish" : tactic => + `(tactic| try exact ⟨0, rfl⟩) +macro "step" : tactic => + `(tactic| (try refine stepPlus_stepStar' ?_) <;> + refine step_left_cons (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, + Turing.ListBlank.head_cons, default_head']); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, zero_cons_default', + default_head', default_tail']) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | exact ⟨0, rfl⟩ | step))) + +abbrev A : Fin 6 := 0 +abbrev B : Fin 6 := 1 +abbrev C : Fin 6 := 2 +abbrev D : Fin 6 := 3 +abbrev E : Fin 6 := 4 +abbrev F : Fin 6 := 5 + +@[simp] theorem listPow_zero {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[simp] theorem listPow_succ {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[simp] theorem listPow_succ' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[simp] theorem listPow_one {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l + +theorem listPow_add {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := + BusyBeaver.list_pow_add l m n + +theorem listPow_shift {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ^ n ++ l := by + rw [Nat.add_comm 1 n, BusyBeaver.list_pow_succ'] + +theorem step_left_default (l : BitWord) (n : Nat) (s : HalfTape) : (l ^ (1 + n)) +> s = l +> + ((l ^ n) +> s) := by + rw [listPow_succ', append_assoc] + +theorem step_right_zero_default (l : BitWord) (n : Nat) (s : HalfTape) : (l ^ n) +> (l +> + s) = (l ^ (1 + n)) +> s := by + rw [listPow_shift, append_assoc] + +theorem rot_0 (n : Nat) (r : HalfTape) : + (bit0 ^ n) +> ([0] +> r) = [0] +> ((bit0 ^ n) +> r) := by + rw [step_right_zero_default bit0 n r, step_left_default bit0 n r] + +theorem rot_0_3 (n : Nat) (r : HalfTape) : + (bit0 ^ n) +> ([0, 0, 0] +> r) = [0, 0, 0] +> ((bit0 ^ n) +> r) := by + have h1 : ([0, 0, 0] : BitWord) +> r = [0] +> ([0] +> ([0] +> r)) := rfl + rw [h1, rot_0, rot_0, rot_0] + rfl + +-- ============================================================================ +-- Section 1: Directed-Head Configurations & Local Tape Sweeps (Others_v1.v:13-176) +-- ============================================================================ + +def stepCfg (l r : HalfTape) : Cfg (Fin 2) (Fin 6) := + ([0] +> l) {{D}}> r + +def root (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + stepCfg ([1] +> default) r + +def backCfg (l r : HalfTape) : Cfg (Fin 2) (Fin 6) := + l <{{E}} ([0, 0, 0] +> r) + +def returnCfg (l r : HalfTape) : Cfg (Fin 2) (Fin 6) := + l <{{E}} ([0, 0] +> r) + +theorem shiftL_E_1_step (l r : HalfTape) : + (([1] +> l) <{{E}} r) [tm24]⊢* (l <{{E}} ([0] +> r)) := by + simp only [append_cons, append_nil] + execute + +theorem shiftL_E_1 (n : Nat) (l r : HalfTape) : + (((bit1 ^ n) +> l) <{{E}} r) [tm24]⊢* (l <{{E}} ((bit0 ^ n) +> r)) := by + induction n generalizing r with + | zero => + simp only [listPow_zero, append_nil] + finish + | succ n ih => + have hn : n + 1 = 1 + n := by omega + rw [hn, step_left_default bit1 n l] + refine stepPlus_trans' (shiftL_E_1_step ((bit1 ^ n) +> l) r) ?_ + simpa only [step_right_zero_default bit0 n r] using ih ([0] +> r) + +theorem back_digit_head (l r : HalfTape) : + (backCfg ([0] +> ([1, 1] +> l)) r) [tm24]⊢* (l <{{E}} ([0, 0, 0] +> ([1, 1, 0] +> r))) := by + unfold backCfg + simp only [append_cons, append_nil] + execute + +theorem back_digit (n : Nat) (l r : HalfTape) : + (backCfg ([0] +> ((bit1 ^ (2 + n)) +> l)) r) [tm24]⊢* + (backCfg l (((bit0 ^ n) ++ [1, 1, 0]) +> r)) := by + have h1 : (bit1 ^ (2 + n)) +> l = [1, 1] +> ((bit1 ^ n) +> l) := by + have h2n : 2 + n = 1 + (1 + n) := by omega + rw [h2n, step_left_default bit1 (1 + n) l, step_left_default bit1 n l] + rfl + rw [h1] + refine stepPlus_trans' (back_digit_head ((bit1 ^ n) +> l) r) ?_ + refine stepPlus_trans' (shiftL_E_1 n l ([0, 0, 0] +> ([1, 1, 0] +> r))) ?_ + unfold backCfg + rw [rot_0_3 n ([1, 1, 0] +> r), append_assoc] + + +theorem start_back_head (l r : HalfTape) : + (stepCfg ([0] +> ([1, 1] +> l)) ([0, 0, 0] +> r)) [tm24]⊢⁺ + (l <{{E}} ([0, 0, 0] +> ([0] +> ([1, 1, 0] +> r)))) := by + unfold stepCfg + simp only [append_cons, append_nil] + execute + +theorem start_back (n : Nat) (l r : HalfTape) : + (stepCfg ([0] +> ((bit1 ^ (2 + n)) +> l)) ([0, 0, 0] +> r)) [tm24]⊢⁺ + (backCfg l ((bit0 ^ (1 + n)) +> ([1, 1, 0] +> r))) := by + have h1 : (bit1 ^ (2 + n)) +> l = [1, 1] +> ((bit1 ^ n) +> l) := by + have h2n : 2 + n = 1 + (1 + n) := by omega + rw [h2n, step_left_default bit1 (1 + n) l, step_left_default bit1 n l] + rfl + rw [h1] + refine step_right_default (start_back_head ((bit1 ^ n) +> l) r) ?_ + refine stepPlus_trans' (shiftL_E_1 n l ([0, 0, 0] +> ([0] +> ([1, 1, 0] +> r)))) ?_ + unfold backCfg + rw [rot_0_3 n ([0] +> ([1, 1, 0] +> r)), step_right_zero_default bit0 n ([1, 1, 0] +> r)] + + +def pending (hs : List Nat) (l : HalfTape) : HalfTape := + hs.foldl (fun l h => [0] +> ((bit1 ^ (2 + h)) +> l)) l + +@[simp] theorem pending_nil (l : HalfTape) : pending [] l = l := rfl +@[simp] theorem pending_cons (h : Nat) (hs : List Nat) (l : HalfTape) : + pending (h :: hs) l = pending hs ([0] +> ((bit1 ^ (2 + h)) +> l)) := rfl + +def back_word (hs : List Nat) : BitWord := + hs.flatMap (fun h => (bit0 ^ h) ++ [1, 1, 0]) + +@[simp] theorem back_word_nil : back_word [] = [] := rfl +@[simp] theorem back_word_cons (h : Nat) (hs : List Nat) : + back_word (h :: hs) = (bit0 ^ h) ++ [1, 1, 0] ++ back_word hs := rfl + +theorem pending_back (hs : List Nat) (l r : HalfTape) : + (backCfg (pending hs l) r) [tm24]⊢* (backCfg l (back_word hs +> r)) := by + induction hs generalizing l r with + | nil => + simp only [pending_nil, back_word_nil, append_nil] + finish + | cons h hs ih => + simp only [pending_cons, back_word_cons, append_assoc] + refine stepPlus_trans' (ih ([0] +> ((bit1 ^ (2 + h)) +> l)) r) ?_ + refine stepPlus_trans' (back_digit h l (back_word hs +> r)) ?_ + rw [append_assoc] + + +def digits (ds : List Nat) : BitWord := + ds.flatMap (fun d => (bit0 ^ (1 + d)) ++ [1, 1]) + +@[simp] theorem digits_nil : digits [] = [] := rfl +@[simp] theorem digits_cons (d : Nat) (ds : List Nat) : + digits (d :: ds) = (bit0 ^ (1 + d)) ++ [1, 1] ++ digits ds := rfl + +inductive IsBinary : List Nat → Prop where + | nil : IsBinary [] + | cons {d : Nat} {ds : List Nat} : d ≤ 1 → IsBinary ds → IsBinary (d :: ds) + +theorem isBinary_append {u v : List Nat} : IsBinary (u ++ v) ↔ IsBinary u ∧ IsBinary v := by + induction u with + | nil => + simp only [List.nil_append] + exact ⟨fun h => ⟨IsBinary.nil, h⟩, fun ⟨_, h⟩ => h⟩ + | cons d u ih => + constructor + · intro h + cases h with + | cons hd hrest => + rcases ih.mp hrest with ⟨hu, hv⟩ + exact ⟨IsBinary.cons hd hu, hv⟩ + · rintro ⟨hu, hv⟩ + cases hu with + | cons hd hu' => + exact IsBinary.cons hd (ih.mpr ⟨hu', hv⟩) + +theorem scan_digit_one {d : Nat} (hd : d ≤ 1) (l r : HalfTape) : + (stepCfg l ((bit0 ^ (1 + d)) +> ([1, 1] +> r))) [tm24]⊢* + (stepCfg ([0] +> ((bit1 ^ (2 + d)) +> l)) r) := by + rcases d with _ | _ | d + · unfold stepCfg + simp only [Nat.add_zero, listPow_succ, listPow_zero, bit0, bit1, List.cons_append, + List.nil_append, List.append_nil, append_cons, append_nil] + execute + · unfold stepCfg + simp only [listPow_succ, listPow_zero, bit0, bit1, + List.cons_append, List.nil_append, List.append_nil, append_cons, append_nil] + execute + · omega + +theorem scan_digits {ds : List Nat} (hds : IsBinary ds) (l r : HalfTape) : + (stepCfg l (digits ds +> r)) [tm24]⊢* (stepCfg (pending ds l) r) := by + induction hds generalizing l r with + | nil => + simp only [digits_nil, append_nil, pending_nil] + finish + | @cons d ds hd hds ih => + simp only [digits_cons, pending_cons, append_assoc] + refine stepPlus_trans' (scan_digit_one hd l (digits ds +> r)) ?_ + exact ih ([0] +> ((bit1 ^ (2 + d)) +> l)) r + +theorem ordinary_return {ds : List Nat} {n : Nat} (hds : IsBinary ds) (hn : n ≤ 1) (l r : HalfTape) + : + (stepCfg l (digits ds +> ((bit0 ^ (1 + n)) +> ([1, 1, 0, 0, 0] +> r)))) [tm24]⊢⁺ + (backCfg l (back_word ds +> ((bit0 ^ (1 + n)) +> ([1, 1, 0] +> r)))) := by + refine stepPlus_of_step (scan_digits hds l ((bit0 ^ (1 + n)) +> ([1, 1, 0, 0, 0] +> r))) ?_ + have hsplit : ([1, 1, 0, 0, 0] : BitWord) +> r = [1, 1] +> ([0, 0, 0] +> r) := rfl + rw [hsplit] + refine stepPlus_of_step (scan_digit_one hn (pending ds l) ([0, 0, 0] +> r)) ?_ + refine step_right_default (start_back n (pending ds l) r) ?_ + exact pending_back ds l ((bit0 ^ (1 + n)) +> ([1, 1, 0] +> r)) + +theorem zero_back_word (ds : List Nat) (r : HalfTape) : + [0] +> (back_word ds +> r) = digits ds +> ([0] +> r) := by + induction ds with + | nil => rfl + | cons d ds ih => + simp only [back_word_cons, digits_cons, append_assoc] + have h1 : ([1, 1, 0] : BitWord) +> (back_word ds +> r) = [1, + 1] +> ([0] +> (back_word ds +> r)) := rfl + rw [h1, ih, ← rot_0 d ([1, 1] +> (digits ds +> ([0] +> r))), ← step_right_zero_default bit0 d] + +theorem close6 (l r : HalfTape) : + (backCfg ((bit0 ^ 6) +> l) r) [tm24]⊢* + (stepCfg ([1] +> ([0] +> l)) ([0, 0, 1, 1, 1, 0] +> r)) := by + unfold backCfg stepCfg + simp only [listPow_succ, listPow_zero, bit0, List.cons_append, List.nil_append, List.append_nil, + append_cons, append_nil] + execute + +theorem close2 (l r : HalfTape) : + (backCfg ([0, 0] +> ((bit1 ^ 4) +> l)) r) [tm24]⊢* + (l <{{A}} ((bit1 ^ 8) +> ([0] +> r))) := by + unfold backCfg + simp only [listPow_succ, listPow_zero, bit1, List.cons_append, List.nil_append, List.append_nil, + append_cons, append_nil] + execute + +theorem block_back_head (l r : HalfTape) : + (([0] +> ([1, 1] +> l)) <{{A}} ((bit1 ^ 8) +> r)) [tm24]⊢* + (l <{{E}} ([0, 0, 0] +> ([0] +> ((bit1 ^ 7) +> r)))) := by + simp only [listPow_succ, listPow_zero, bit1, List.cons_append, List.nil_append, List.append_nil, + append_cons, append_nil] + execute + +theorem block_back_one (n : Nat) (l r : HalfTape) : + (([0] +> ((bit1 ^ (2 + n)) +> l)) <{{A}} ((bit1 ^ 8) +> r)) [tm24]⊢* + (backCfg l ((bit0 ^ (1 + n)) +> ((bit1 ^ 7) +> r))) := by + have h1 : (bit1 ^ (2 + n)) +> l = [1, 1] +> ((bit1 ^ n) +> l) := by + have h2n : 2 + n = 1 + (1 + n) := by omega + rw [h2n, step_left_default bit1 (1 + n) l, step_left_default bit1 n l] + rfl + rw [h1] + refine stepPlus_trans' (block_back_head ((bit1 ^ n) +> l) r) ?_ + refine stepPlus_trans' (shiftL_E_1 n l ([0, 0, 0] +> ([0] +> ((bit1 ^ 7) +> r)))) ?_ + unfold backCfg + rw [rot_0_3 n ([0] +> ((bit1 ^ 7) +> r)), step_right_zero_default bit0 n ((bit1 ^ 7) +> r)] + + +theorem block_back (hs : List Nat) (n : Nat) (l r : HalfTape) : + (([0] +> ((bit1 ^ (2 + n)) +> pending hs l)) <{{A}} ((bit1 ^ 8) +> r)) [tm24]⊢* + (backCfg l (back_word hs +> ((bit0 ^ (1 + n)) +> ((bit1 ^ 7) +> r)))) := by + refine stepPlus_trans' (block_back_one n (pending hs l) r) ?_ + exact pending_back hs l ((bit0 ^ (1 + n)) +> ((bit1 ^ 7) +> r)) + +theorem scan_seven {b : Nat} (hb : b = 1 ∨ b = 2) (l r : HalfTape) : + (stepCfg l ((bit0 ^ b) +> ((bit1 ^ 7) +> r))) [tm24]⊢* + (stepCfg ((bit0 ^ 6) +> ((bit1 ^ (1 + b)) +> l)) r) := by + rcases hb with rfl | rfl <;> { + unfold stepCfg + simp only [listPow_succ, listPow_zero, bit0, bit1, + List.cons_append, List.nil_append, List.append_nil, append_cons, append_nil] + execute + } + +theorem last7 (b : Nat) (ds : List Nat) (n : Nat) (l r : HalfTape) + (hb : b = 1 ∨ b = 2) (hds : IsBinary ds) (hn : n ≤ 1) : + (stepCfg l ((bit0 ^ b) +> ((bit1 ^ 7) +> (digits ds +> ((bit0 ^ (1 + n)) +> ([1, 1, 0, 0, + 0] +> r)))))) [tm24]⊢⁺ + (stepCfg ([1] +> ([0] +> ((bit1 ^ (1 + b)) +> l))) + ([0, 0, 1, 1, 1] +> (digits ds +> ((bit0 ^ (2 + n)) +> ([1, 1, 0] +> r))))) := by + refine stepPlus_of_step (scan_seven hb l (digits ds +> ((bit0 ^ (1 + n)) +> ([1, 1, 0, 0, + 0] +> r)))) ?_ + refine step_right_default (ordinary_return hds hn ((bit0 ^ 6) +> ((bit1 ^ (1 + b)) +> l)) r) ?_ + refine stepPlus_trans' (close6 ((bit1 ^ (1 + b)) +> l) (back_word ds +> ((bit0 ^ (1 + n)) +> ([1, + 1, 0] +> r)))) ?_ + have h1 : ([0, 0, 1, 1, 1, 0] : BitWord) +> (back_word ds +> ((bit0 ^ (1 + n)) +> ([1, 1, + 0] +> r))) = + [0, 0, 1, 1, 1] +> ([0] +> (back_word ds +> ((bit0 ^ (1 + n)) +> ([1, 1, 0] +> r)))) := rfl + have h2n : 2 + n = 1 + (1 + n) := by omega + rw [h1, zero_back_word, h2n, step_left_default bit0 (1 + n) ([1, 1, 0] +> r)] + + +theorem active_scan (l r : HalfTape) : + (stepCfg ([1] +> l) ([0, 0, 1, 1, 1] +> r)) [tm24]⊢* + (stepCfg ([0, 0] +> ((bit1 ^ 4) +> l)) r) := by + unfold stepCfg + simp only [listPow_succ, listPow_zero, bit1, List.cons_append, List.nil_append, List.append_nil, + append_cons, append_nil] + execute + +theorem active_turn (l r : HalfTape) : + (stepCfg ([1] +> l) ([0, 0, 1, 1, 1, 0, 0, 0] +> r)) [tm24]⊢⁺ + (stepCfg ([0] +> ((bit1 ^ 3) +> l)) ([0, 0, 1, 1, 0] +> r)) := by + unfold stepCfg + simp only [listPow_succ, listPow_zero, bit1, List.cons_append, List.nil_append, List.append_nil, + append_cons, append_nil] + execute + +def payload (ds : List Nat) : BitWord := + ds.flatMap (fun d => (bit0 ^ d) ++ [1, 1]) + +def put_left (hs : List Nat) (l : HalfTape) : HalfTape := + hs.foldl (fun l h => [0] +> ((bit1 ^ h) +> l)) l + +def seed : List Nat := [2, 2, 1, 2, 2, 1, 2] + +def cap_entry (ds : List Nat) (h : Nat) (r : HalfTape) : Cfg (Fin 2) (Fin 6) := + root ([0, 0] +> (payload ds +> ((bit0 ^ h) +> ((bit1 ^ 7) +> r)))) + +theorem bridge0 (r : HalfTape) : + (cap_entry [] 4 r) [tm24]⊢⁺ + (stepCfg (put_left [3] default) (payload [2] +> ([0, 0] +> ((bit1 ^ 7) +> r)))) := by + unfold cap_entry root stepCfg payload put_left + simp only [List.flatMap_nil, List.flatMap_cons, List.foldl_cons, List.foldl_nil, + listPow_succ, listPow_zero, bit0, bit1, + List.cons_append, List.nil_append, List.append_nil, append_cons, append_nil] + execute + +theorem bridge1 (r : HalfTape) : + (cap_entry [2, 2] 3 r) [tm24]⊢⁺ + (stepCfg (put_left [4, 3] default) (payload [2, 1, 1] +> ([0] +> ((bit1 ^ 7) +> r)))) := by + unfold cap_entry root stepCfg payload put_left + simp only [List.flatMap_nil, List.flatMap_cons, List.foldl_cons, List.foldl_nil, + listPow_succ, listPow_zero, bit0, bit1, + List.cons_append, List.nil_append, List.append_nil, append_cons, append_nil] + execute + +theorem bridge2 (r : HalfTape) : + (cap_entry [3, 2, 2, 1, 1] 2 r) [tm24]⊢⁺ + (stepCfg (put_left [3] default) (payload [2, 1, 2, 2, 1, 1] +> ([0, + 0] +> ((bit1 ^ 7) +> r)))) := by + unfold cap_entry root stepCfg payload put_left + simp only [List.flatMap_nil, List.flatMap_cons, List.foldl_cons, List.foldl_nil, + listPow_succ, listPow_zero, bit0, bit1, + List.cons_append, List.nil_append, List.append_nil, append_cons, append_nil] + execute + +theorem bridge3 (r : HalfTape) : + (cap_entry [2, 2, 1, 2, 2, 1, 1] 3 r) [tm24]⊢⁺ + (root ([0, 0] +> ((bit1 ^ 7) +> (payload seed +> ([0] +> ((bit1 ^ 7) +> r)))))) := by + unfold cap_entry root stepCfg payload seed + simp only [List.flatMap_nil, List.flatMap_cons, + listPow_succ, listPow_zero, bit0, bit1, + List.cons_append, List.nil_append, List.append_nil, append_cons, append_nil] + execute + +-- ============================================================================ +-- Section 2: Prefix Value, Tail, Num, Tags, Segment, Block, Carry, Advance +-- (Others_v1.v:180-665) +-- ============================================================================ + +def prefix_value : Nat → List Nat → Nat + | k + 1, d :: ds => d * 2 ^ k + prefix_value k ds + | _, _ => 0 + +theorem prefix_carry (n : Nat) (u : List Nat) (a : Nat) (t : List Nat) : + prefix_value n (u ++ [a, 3] ++ t) ≤ prefix_value n (u ++ [1 + a, 1] ++ t) ∧ + prefix_value n (u ++ [1 + a, 1] ++ t) ≤ 1 + prefix_value n (u ++ [a, 3] ++ t) := by + induction u generalizing n with + | nil => + rcases n with _ | _ | k + · simp [prefix_value] + · simp [prefix_value] + · simp only [List.nil_append, List.cons_append, prefix_value] + have heq : (1 + a) * 2 ^ (k + 1) + (1 * 2 ^ k + prefix_value k t) = + a * 2 ^ (k + 1) + (3 * 2 ^ k + prefix_value k t) := by + rw [Nat.pow_succ] + ring + omega + | cons d u ih => + rcases n with _ | k + · simp [prefix_value] + · simp only [List.cons_append, prefix_value] + have h := ih k + simp only [List.append_assoc] at h ⊢ + omega + +theorem prefix_last (n : Nat) (u : List Nat) (a : Nat) (h : n ≤ 1 + u.length) : + prefix_value n (u ++ [a]) ≤ prefix_value n (u ++ [1 + a]) ∧ + prefix_value n (u ++ [1 + a]) ≤ 1 + prefix_value n (u ++ [a]) := by + induction u generalizing n with + | nil => + rcases n with _ | _ | k + · simp [prefix_value] + · simp [prefix_value] + · simp at h + | cons d u ih => + rcases n with _ | k + · simp [prefix_value] + · simp only [List.length_cons] at h + simp only [List.cons_append, prefix_value] + have h' := ih k (by omega) + omega + +inductive Tail : List Nat → Prop where + | nil : Tail [] + | zero (ds : List Nat) : Tail ds → Tail (0 :: ds) + | one (ds : List Nat) : Tail ds → Tail (1 :: ds) + | two (n : Nat) : Tail (2 :: List.replicate n 0) + +inductive Num : Bool → List Nat → Prop where + | nil (p : Bool) : Num p [] + | zero (p : Bool) (ds : List Nat) : Tail ds → Num p (0 :: ds) + | one (p : Bool) (ds : List Nat) : Num (!p) ds → Num p (1 :: ds) + | two (n : Nat) : Num false (2 :: List.replicate n 0) + +theorem tail_zeros (n : Nat) : Tail (List.replicate n 0) := by + induction n with + | zero => exact Tail.nil + | succ n ih => exact Tail.zero (List.replicate n 0) ih + +theorem tail_prefix {u t : List Nat} (hu : IsBinary u) (ht : Tail t) : Tail (u ++ t) := by + induction hu with + | nil => exact ht + | @cons d ds hd _ ih => + rcases d with _ | _ | d + · exact Tail.zero (ds ++ t) ih + · exact Tail.one (ds ++ t) ih + · omega + +theorem tail_binary {u : List Nat} (hu : IsBinary u) : Tail u := by + simpa using tail_prefix hu Tail.nil + +theorem num_binary {u : List Nat} (hu : IsBinary u) (p : Bool) : Num p u := by + induction hu generalizing p with + | nil => exact Num.nil p + | @cons d ds hd hds ih => + rcases d with _ | _ | d + · exact Num.zero p ds (tail_binary hds) + · exact Num.one p ds (ih (!p)) + · omega + +theorem num_tail {p : Bool} {ds : List Nat} (h : Num p ds) : Tail ds := by + induction h with + | nil => exact Tail.nil + | zero _ ds ht => exact Tail.zero ds ht + | one _ ds _ ih => exact Tail.one ds ih + | two n => exact Tail.two n + +theorem num_one {p : Bool} {ds : List Nat} (h : Num p (1 :: ds)) : Num (!p) ds := by + cases h with + | one _ _ h' => exact h' + +theorem num_two {p : Bool} {ds : List Nat} (h : Num p (2 :: ds)) : p = false := by + cases h + rfl + +theorem tail_bump {u : List Nat} (a n : Nat) (hu : IsBinary u) (ha : a ≤ 1) : + Tail (u ++ [1 + a] ++ List.replicate n 0) := by + rw [List.append_assoc] + refine tail_prefix hu ?_ + rcases a with _ | _ | a + · exact Tail.one (List.replicate n 0) (tail_zeros n) + · exact Tail.two n + · omega + +theorem num_carry (p : Bool) {u : List Nat} (a n : Nat) + (hu : IsBinary u) (ha : a ≤ 1) + (h : Num p (u ++ [a, 2] ++ List.replicate n 0)) : + Num (!p) (u ++ [1 + a, 0] ++ List.replicate n 0) := by + induction hu generalizing p with + | nil => + rcases a with _ | _ | a + · exact Num.one (!p) (0 :: List.replicate n 0) (Num.zero (!!p) (List.replicate n 0) (tail_zeros + n)) + · simp only [List.nil_append, List.cons_append] at h ⊢ + have hp : (!p) = false := num_two (num_one h) + rcases p with _ | _ + · cases hp + · exact Num.two (n + 1) + · omega + | @cons d ds hd hds ih => + rcases d with _ | _ | d + · simp only [List.cons_append] + have hrep : [1 + a, 0] ++ List.replicate n 0 = [1 + a] ++ List.replicate (n + 1) 0 := rfl + rw [List.append_assoc, hrep, ← List.append_assoc] + exact Num.zero (!p) _ (tail_bump a (n + 1) hds ha) + · simp only [List.cons_append] at h ⊢ + refine Num.one (!p) _ ?_ + have h' := ih (!p) (num_one h) + simpa using h' + · omega + +def mass : List Nat → Nat + | [] => 0 + | d :: ds => 1 + d + mass ds + +theorem mass_app (u v : List Nat) : mass (u ++ v) = mass u + mass v := by + induction u with + | nil => simp [mass] + | cons d u ih => simp only [List.cons_append, mass, ih]; omega + +theorem mass_zeros (n : Nat) : mass (List.replicate n 0) = n := by + induction n with + | zero => rfl + | succ n ih => simp only [List.replicate_succ, mass, ih]; omega + +def oddB : Nat → Bool + | 0 => false + | n + 1 => !(oddB n) + +theorem odd_next (n : Nat) : oddB (1 + n) = !(oddB n) := by + rw [Nat.add_comm 1 n]; rfl + +theorem odd_succ (n : Nat) : oddB (n + 1) = !(oddB n) := rfl + +theorem odd_add (a b : Nat) : oddB (a + b) = xor (oddB a) (oddB b) := by + induction a with + | zero => simp [oddB] + | succ a ih => + rw [Nat.succ_add, odd_succ, odd_succ, ih] + cases oddB a <;> cases oddB b <;> rfl + +inductive AllOnes : List Nat → Prop where + | nil : AllOnes [] + | cons {ds : List Nat} : AllOnes ds → AllOnes (1 :: ds) + +theorem mass_ones {u : List Nat} (h : AllOnes u) : oddB (mass u) = false := by + induction h with + | nil => rfl + | @cons ds _ ih => + simp only [mass] + have h1 : 1 + 1 + mass ds = 1 + (1 + mass ds) := by omega + rw [h1, odd_next, odd_next, Bool.not_not, ih] + +def Tags (p : Bool) (b : Nat) (ds : List Nat) : Prop := + oddB ds.length = !(b == 0) ∧ oddB (mass ds + b) = p + +def Head (p : Bool) (ds : List Nat) : Prop := + match ds with + | [] => False + | d :: _ => d = 1 ∨ (d = 2 ∧ p = false) + +def Segment (p : Bool) (b : Nat) (ds : List Nat) : Prop := + Num p ds ∧ Head p ds ∧ Tags p b ds ∧ + 7 + (if b == 0 then 1 else 0) ≤ ds.length + +theorem num_end (p : Bool) {u : List Nat} (hu : IsBinary u) + (h : AllOnes u → p = oddB u.length) : + Num p (u ++ [2]) := by + induction hu generalizing p with + | nil => + have hp := h AllOnes.nil + subst hp + exact Num.two 0 + | @cons d ds hd hds ih => + rcases d with _ | _ | d + · exact Num.zero p (ds ++ [2]) (tail_prefix hds (Tail.two 0)) + · refine Num.one p (ds ++ [2]) (ih (!p) ?_) + intro hone + have hp := h (AllOnes.cons hone) + simp only [List.length_cons, odd_succ] at hp + rw [hp, Bool.not_not] + · omega + +theorem num_last_tags (p : Bool) (b : Nat) {u : List Nat} (a : Nat) + (hu : IsBinary u) (ha : a ≤ 1) + (ht : Tags p b (u ++ [a])) (hb : b = 0 ∨ b = 3) : + Num (!p) (u ++ [1 + a]) := by + rcases ht with ⟨hlen, hsum⟩ + rcases a with _ | _ | a + · exact num_binary (isBinary_append.mpr ⟨hu, IsBinary.cons (by omega) IsBinary.nil⟩) (!p) + · refine num_end (!p) hu ?_ + intro hone + rw [mass_app] at hsum + simp only [mass] at hsum + have hlen' : (u ++ [1]).length = u.length + 1 := by simp + rw [hlen', odd_succ] at hlen + have hmass1 : mass u + (1 + 1 + 0) + b = mass u + (2 + b) := by omega + rw [hmass1, odd_add, mass_ones hone] at hsum + rcases hb with rfl | rfl + · simp only [Bool.false_xor] at hsum + have ho2 : oddB 2 = false := rfl + rw [ho2] at hsum + subst hsum + simpa using hlen.symm + · simp only [Bool.false_xor] at hsum + have ho5 : oddB 5 = true := rfl + rw [ho5] at hsum + subst hsum + simpa using hlen.symm + · omega + +theorem odd_adjacent (x y : Nat) (h : x = 1 + y ∨ y = 1 + x) : + oddB y = !(oddB x) := by + rcases h with rfl | rfl + · rw [odd_next, Bool.not_not] + · rw [odd_next] + +theorem tags_carry {p : Bool} {b : Nat} {u : List Nat} {a n : Nat} + (ht : Tags p b (u ++ [a, 2] ++ List.replicate n 0)) : + Tags (!p) b (u ++ [1 + a, 0] ++ List.replicate n 0) := by + rcases ht with ⟨hlen, hsum⟩ + refine ⟨?_, ?_⟩ + · simp only [List.length_append, List.length_cons, List.length_nil] at hlen ⊢ + exact hlen + · rw [← hsum] + apply odd_adjacent + left + simp only [List.append_assoc, mass_app, mass] + omega + +theorem head_carry {p : Bool} {u : List Nat} {a n : Nat} + (hu : IsBinary u) (ha : a ≤ 1) + (hnum : Num p (u ++ [a, 2] ++ List.replicate n 0)) + (hhead : Head p (u ++ [a, 2] ++ List.replicate n 0)) : + Head (!p) (u ++ [1 + a, 0] ++ List.replicate n 0) := by + cases hu with + | nil => + simp only [List.nil_append, List.cons_append, Head] at hnum hhead ⊢ + have ha1 : a = 1 := by rcases hhead with h | ⟨h, _⟩ <;> omega + subst ha1 + right + exact ⟨rfl, num_two (num_one hnum)⟩ + | @cons d ds hd _ => + simp only [List.cons_append, Head] at hhead ⊢ + left + rcases hhead with h | ⟨h, _⟩ <;> omega + +theorem segment_carry {p : Bool} {b : Nat} {u : List Nat} {a n : Nat} + (hu : IsBinary u) (ha : a ≤ 1) + (hs : Segment p b (u ++ [a, 2] ++ List.replicate n 0)) : + Segment (!p) b (u ++ [1 + a, 0] ++ List.replicate n 0) := by + rcases hs with ⟨hn, hh, ht, hl⟩ + refine ⟨num_carry p a n hu ha hn, head_carry hu ha hn hh, tags_carry ht, ?_⟩ + simp only [List.length_append, List.length_cons, List.length_nil] at hl ⊢ + exact hl + +theorem tags_last {p : Bool} {b : Nat} {u : List Nat} {a : Nat} + (ht : Tags p b (u ++ [a])) (hb : b = 0 ∨ b = 3) : + Tags (!p) (b - 2) (u ++ [1 + a]) := by + rcases ht with ⟨hlen, hsum⟩ + refine ⟨?_, ?_⟩ + · rcases hb with rfl | rfl <;> { + simp only [List.length_append, List.length_cons, List.length_nil] at hlen ⊢ + exact hlen + } + · rw [← hsum] + apply odd_adjacent + rcases hb with rfl | rfl + · right; simp only [mass_app, mass]; omega + · left; simp only [mass_app, mass]; omega + +theorem segment_last {p : Bool} {b : Nat} {u : List Nat} {a : Nat} + (hu : IsBinary u) (ha : a ≤ 1) + (hs : Segment p b (u ++ [a])) (hb : b = 0 ∨ b = 3) : + Segment (!p) (b - 2) (u ++ [1 + a]) := by + rcases hs with ⟨hn, hh, ht, hl⟩ + refine ⟨num_last_tags p b a hu ha ht hb, ?_, tags_last ht hb, ?_⟩ + · cases hu with + | nil => + simp only [List.nil_append, List.length_singleton] at hl + rcases hb with rfl | rfl <;> omega + | @cons d ds hd _ => + simp only [List.cons_append, Head] at hh ⊢ + left + rcases hh with h | ⟨h, _⟩ <;> omega + · rcases hb with rfl | rfl <;> { + simp only [List.length_append, List.length_cons, List.length_nil] at hl ⊢ + exact hl + } + +theorem head_binary {p : Bool} {ds : List Nat} (h : IsBinary ds) (hh : Head p ds) : + Head true ds := by + cases h with + | nil => exact hh + | @cons d ds hd _ => + simp only [Head] at hh ⊢ + left + rcases hh with h1 | ⟨h2, _⟩ <;> omega + +theorem head_any (p : Bool) {ds : List Nat} (hh : Head true ds) : Head p ds := by + rcases ds with _ | ⟨d, ds⟩ + · exact hh + · simp only [Head] at hh ⊢ + rcases hh with h1 | ⟨_, h2⟩ + · exact Or.inl h1 + · cases h2 + +def Block (p : Bool) (x : List Nat × Nat) : Prop := + IsBinary x.1 ∧ x.2 ≤ 1 ∧ Head true x.1 ∧ + Tags p (1 + x.2) x.1 ∧ 7 ≤ x.1.length + +theorem block_length {p : Bool} {ds : List Nat} {n : Nat} (h : Block p (ds, n)) : + 7 ≤ ds.length := h.2.2.2.2 + +theorem scanned_block (p : Bool) (b : Nat) {ds : List Nat} + (hs : Segment p b ds) (hu : IsBinary ds) (hb : b = 1 ∨ b = 2) : + Block p (ds, b - 1) := by + rcases hs with ⟨_, hh, ⟨hlen, hsum⟩, hl⟩ + dsimp only [Block] + rcases hb with rfl | rfl <;> { + refine ⟨hu, by omega, head_binary hu hh, ⟨hlen, hsum⟩, by omega⟩ + } + +theorem emitted_segment {p : Bool} {ds : List Nat} {n : Nat} + (hb : Block p (ds, n)) : Segment (!p) (2 + n) ds := by + dsimp only [Block] at hb + rcases hb with ⟨hu, hn, hh, ⟨hlen, hsum⟩, hl⟩ + have h1 : (1 + n == 0) = false := by cases n <;> rfl + have h2 : (2 + n == 0) = false := by cases n <;> rfl + refine ⟨num_binary hu (!p), head_any (!p) hh, ⟨?_, ?_⟩, ?_⟩ + · rw [h1] at hlen + rw [h2] + exact hlen + · rw [← hsum] + apply odd_adjacent + right + omega + · rw [h2] + simp only [Bool.false_eq_true, ↓reduceIte] + omega + +theorem tail_split {ds : List Nat} (ht : Tail ds) : + IsBinary ds ∨ ∃ u n, IsBinary u ∧ ds = u ++ 2 :: List.replicate n 0 := by + induction ht with + | nil => exact Or.inl IsBinary.nil + | zero ds _ ih => + rcases ih with hb | ⟨u, n, hu, rfl⟩ + · exact Or.inl (IsBinary.cons (by omega) hb) + · exact Or.inr ⟨0 :: u, n, IsBinary.cons (by omega) hu, rfl⟩ + | one ds _ ih => + rcases ih with hb | ⟨u, n, hu, rfl⟩ + · exact Or.inl (IsBinary.cons (by omega) hb) + · exact Or.inr ⟨1 :: u, n, IsBinary.cons (by omega) hu, rfl⟩ + | two n => + exact Or.inr ⟨[], n, IsBinary.nil, rfl⟩ + +inductive Carry : List Nat → Nat → List Nat → Nat → Prop where + | inside (u : List Nat) (a n b : Nat) : + IsBinary u → a ≤ 1 → + Carry (u ++ [a, 2] ++ List.replicate n 0) b (u ++ [1 + a, 0] ++ List.replicate n 0) b + | last (u : List Nat) (a b : Nat) : + IsBinary u → a ≤ 1 → (b = 0 ∨ b = 3) → + Carry (u ++ [a]) b (u ++ [1 + a]) (b - 2) + +theorem carry_segment (p : Bool) {ds : List Nat} {b : Nat} {ds' : List Nat} {b' : Nat} + (hc : Carry ds b ds' b') (hs : Segment p b ds) : + Segment (!p) b' ds' := by + cases hc with + | inside u a n b hu ha => exact segment_carry hu ha hs + | last u a b hu ha hb => exact segment_last hu ha hs hb + +theorem carry_zero {ds ds' : List Nat} {b' : Nat} (hc : Carry ds 0 ds' b') : b' = 0 := by + cases hc <;> rfl + +theorem carry_header {ds : List Nat} {b : Nat} {ds' : List Nat} {b' : Nat} + (hc : Carry ds b ds' b') (hb : 1 ≤ b ∧ b ≤ 3) : 1 ≤ b' ∧ b' ≤ 3 := by + cases hc with + | inside => exact hb + | last _ _ _ _ _ hb' => omega + +theorem list_snoc {α : Type*} (ds : List α) (hne : ds ≠ []) : + ∃ u a, ds = u ++ [a] := by + induction ds with + | nil => contradiction + | cons d ds ih => + rcases ds with _ | ⟨x, xs⟩ + · exact ⟨[], d, rfl⟩ + · rcases ih (by simp) with ⟨u, a, h⟩ + exact ⟨d :: u, a, by simp [h]⟩ + +theorem word_progress (b : Nat) (ds : List Nat) + (ht : Tail ds) (hh : Head true ds) (hb : b ≤ 3) : + (∃ ds' b', Carry ds b ds' b') ∨ (IsBinary ds ∧ (b = 1 ∨ b = 2)) := by + rcases tail_split ht with hd | ⟨u, n, hu, rfl⟩ + · have hb' : (b = 0 ∨ b = 3) ∨ (b = 1 ∨ b = 2) := by omega + rcases hb' with hb' | hb' + · left + have hne : ds ≠ [] := by rintro rfl; exact hh + rcases list_snoc ds hne with ⟨u, a, rfl⟩ + rcases isBinary_append.mp hd with ⟨hu, ha1⟩ + cases ha1 with + | cons ha _ => exact ⟨u ++ [1 + a], b - 2, Carry.last u a b hu ha hb'⟩ + · exact Or.inr ⟨hd, hb'⟩ + · left + have hne : u ≠ [] := by + rintro rfl + simp only [List.nil_append, Head] at hh + rcases hh with h | ⟨_, h⟩ <;> cases h + rcases list_snoc u hne with ⟨v, a, rfl⟩ + rcases isBinary_append.mp hu with ⟨hv, ha1⟩ + cases ha1 with + | cons ha _ => + have heq : (v ++ [a]) ++ 2 :: List.replicate n 0 = v ++ [a, 2] ++ List.replicate n 0 := by + simp [List.append_assoc] + rw [heq] + exact ⟨v ++ [1 + a, 0] ++ List.replicate n 0, b, Carry.inside v a n b hv ha⟩ + +theorem record_progress (b : Nat) (ds : List Nat) + (hs : Segment true b ds) (hb : b ≤ 3) : + (∃ ds' b', Carry ds b ds' b') ∨ (IsBinary ds ∧ (b = 1 ∨ b = 2)) := + word_progress b ds (num_tail hs.1) hs.2.1 hb + +theorem segment_progress (b : Nat) (ds : List Nat) + (hs : Segment false b ds) (hb : b ≤ 3) : + (∃ k, ds = 2 :: List.replicate k 0) ∨ + (∃ ds' b', Carry ds b ds' b') ∨ + (IsBinary ds ∧ (b = 1 ∨ b = 2)) := by + rcases hs with ⟨hn, hh, _⟩ + rcases ds with _ | ⟨d, ds⟩ + · contradiction + · rcases hh with rfl | ⟨rfl, _⟩ + · exact Or.inr (word_progress b (1 :: ds) (num_tail hn) (Or.inl rfl) hb) + · left + cases hn with + | two k => exact ⟨k, rfl⟩ + +inductive Records where + | REnd (ds : List Nat) + | RMore (ds : List Nat) (b : Nat) (rs : Records) + +open Records + +def Good : Bool → Records → Prop + | p, REnd ds => Segment p 0 ds + | p, RMore ds b rs => Segment p b ds ∧ (1 ≤ b ∧ b ≤ 3) ∧ Good true rs + +inductive Advance : Records → List (List Nat × Nat) → Records → Prop where + | AEnd (ds ds' : List Nat) : + Carry ds 0 ds' 0 → Advance (REnd ds) [] (REnd ds') + | AStop (ds : List Nat) (b : Nat) (ds' : List Nat) (b' : Nat) (rs : Records) : + 0 < b → Carry ds b ds' b' → + Advance (RMore ds b rs) [] (RMore ds' b' rs) + | AGo (ds : List Nat) (b : Nat) (rs : Records) (bs : List (List Nat × Nat)) (rs' : Records) : + IsBinary ds → (b = 1 ∨ b = 2) → + Advance rs bs rs' → + Advance (RMore ds b rs) ((ds, b - 1) :: bs) rs' + +inductive AllBlocks (p : Bool) : List (List Nat × Nat) → Prop where + | nil : AllBlocks p [] + | cons {x : List Nat × Nat} {bs : List (List Nat × Nat)} : + Block p x → AllBlocks p bs → AllBlocks p (x :: bs) + +theorem advance_total (rs : Records) (h : Good true rs) : + ∃ bs rs', Advance rs bs rs' ∧ AllBlocks true bs ∧ Good false rs' := by + induction rs with + | REnd ds => + rcases record_progress 0 ds h (by omega) with ⟨ds', b', hc⟩ | ⟨_, hb⟩ + · have hb' := carry_zero hc + subst hb' + exact ⟨[], REnd ds', Advance.AEnd ds ds' hc, AllBlocks.nil, carry_segment true hc h⟩ + · omega + | RMore ds b rs ih => + rcases h with ⟨hs, hb, hr⟩ + rcases record_progress b ds hs hb.2 with ⟨ds', b', hc⟩ | ⟨hd, hb12⟩ + · exact ⟨[], RMore ds' b' rs, Advance.AStop ds b ds' b' rs (by omega) hc, + AllBlocks.nil, carry_segment true hc hs, carry_header hc hb, hr⟩ + · rcases ih hr with ⟨bs, rs', ha, hbs, hg⟩ + exact ⟨(ds, b - 1) :: bs, rs', Advance.AGo ds b rs bs rs' hd hb12 ha, + AllBlocks.cons (scanned_block true b hs hd hb12) hbs, hg⟩ + +def measure (ds : List Nat) : Nat := prefix_value 7 (ds.map Nat.succ) + +def first_digits : Records → List Nat + | REnd ds => ds + | RMore ds _ _ => ds + +def protected_digits (bs : List (List Nat × Nat)) (rs : Records) : List Nat := + match bs with + | [] => first_digits rs + | (ds, _) :: _ => ds + +theorem segment_length {p : Bool} {b : Nat} {ds : List Nat} (h : Segment p b ds) : + 7 ≤ ds.length := by + have hl := h.2.2.2 + omega + +theorem carry_bound {ds : List Nat} {b : Nat} {ds' : List Nat} {b' : Nat} + (hc : Carry ds b ds' b') (hl : 7 ≤ ds.length) : + measure ds' ≤ 1 + measure ds := by + cases hc with + | inside u a n b hu ha => + unfold measure + simp only [List.map_append, List.map_cons, List.map_nil] + have ha1 : (1 + a).succ = 1 + (a + 1) := by omega + rw [ha1] + have h := (prefix_carry 7 (u.map Nat.succ) (a + 1) ((List.replicate n 0).map Nat.succ)).2 + simpa only [List.append_assoc, List.cons_append, List.nil_append] using h + | last u a b hu ha hb => + unfold measure + simp only [List.map_append, List.map_cons, List.map_nil] + have ha1 : (1 + a).succ = 1 + (a + 1) := by omega + rw [ha1] + refine (prefix_last 7 (u.map Nat.succ) (a + 1) ?_).2 + simp only [List.length_append, List.length_singleton] at hl + simp only [List.length_map] + omega + +theorem advance_bound {rs : Records} {bs : List (List Nat × Nat)} {rs' : Records} + (ha : Advance rs bs rs') (hg : Good true rs) : + measure (protected_digits bs rs') ≤ 1 + measure (first_digits rs) := by + cases ha with + | AEnd ds ds' hc => + exact carry_bound hc (segment_length hg) + | AStop ds b ds' b' rs _ hc => + exact carry_bound hc (segment_length hg.1) + | AGo => + simp only [protected_digits, first_digits] + omega + +theorem carry_not_scan {ds : List Nat} {b : Nat} {ds' : List Nat} {b' : Nat} + (hc : Carry ds b ds' b') (hd : IsBinary ds) (hb : b = 1 ∨ b = 2) : False := by + cases hc with + | inside u a n b _ _ => + rcases isBinary_append.mp hd with ⟨hu2, _⟩ + rcases isBinary_append.mp hu2 with ⟨_, ha2⟩ + cases ha2 with + | cons _ h2 => + cases h2 with + | cons hbad _ => omega + | last _ _ _ _ _ hb' => omega + +theorem advance_go {ds : List Nat} {b : Nat} {rs : Records} {bs : List (List Nat × Nat)} {rs' : + Records} + (ha : Advance (RMore ds b rs) bs rs') (hd : IsBinary ds) (hb : b = 1 ∨ b = 2) : + ∃ bs', bs = (ds, b - 1) :: bs' ∧ Advance rs bs' rs' := by + cases ha with + | AStop _ _ _ _ _ _ hc => + exact False.elim (carry_not_scan hc hd hb) + | AGo _ _ _ bs' _ _ _ ha' => + exact ⟨bs', rfl, ha'⟩ + +def seed_offset : List Nat := [1, 1, 0, 1, 1, 0, 1] + +theorem seed_binary : IsBinary seed_offset := by + repeat (first | exact IsBinary.nil | refine IsBinary.cons (by decide) ?_) + +theorem seed_segment : Segment true 1 seed_offset := by + refine ⟨num_binary seed_binary true, Or.inl rfl, ⟨by decide, by decide⟩, by decide⟩ + +theorem seed_measure : measure seed_offset = 236 := rfl + +-- ============================================================================ +-- Section 3: Record Chains, Cap Rules, Stack & Ready Progress (Others_v1.v:666-1510) +-- ============================================================================ + +theorem digits_app (u v : List Nat) : digits (u ++ v) = digits u ++ digits v := by + unfold digits + exact List.flatMap_append + +theorem last7_snoc (b : Nat) {u : List Nat} (a : Nat) (l r : HalfTape) + (hb : b = 1 ∨ b = 2) (hu : IsBinary u) (ha : a ≤ 1) : + (stepCfg l ((bit0 ^ b) +> ((bit1 ^ 7) +> (digits (u ++ [a]) +> ([0, 0, 0] +> r))))) [tm24]⊢⁺ + (stepCfg ([1] +> ([0] +> ((bit1 ^ (1 + b)) +> l))) + ([0, 0, 1, 1, 1] +> (digits (u ++ [1 + a]) +> ([0] +> r)))) := by + have h_lhs : digits (u ++ [a]) +> ([0, 0, 0] +> r) = + digits u +> ((bit0 ^ (1 + a)) +> ([1, 1, 0, 0, 0] +> r)) := by + rw [digits_app] + simp only [digits_cons, digits_nil, List.append_nil, append_assoc, append_cons, append_nil] + have h_rhs : digits (u ++ [1 + a]) +> ([0] +> r) = + digits u +> ((bit0 ^ (2 + a)) +> ([1, 1, 0] +> r)) := by + rw [digits_app] + have h2a : 2 + a = 1 + (1 + a) := by omega + simp only [digits_cons, digits_nil, List.append_nil, append_assoc, append_cons, append_nil, h2a] + rw [h_lhs, h_rhs] + exact last7 b u a l r hb hu ha + +theorem last7_inside (b : Nat) {u : List Nat} (a n : Nat) (l r : HalfTape) + (hb : b = 1 ∨ b = 2) (hu : IsBinary u) (ha : a ≤ 1) : + (stepCfg l ((bit0 ^ b) +> ((bit1 ^ 7) +> (digits (u ++ [a, + 2] ++ List.replicate n 0) +> r)))) [tm24]⊢⁺ + (stepCfg ([1] +> ([0] +> ((bit1 ^ (1 + b)) +> l))) + ([0, 0, 1, 1, 1] +> (digits (u ++ [1 + a, 0] ++ List.replicate n 0) +> r))) := by + have h_lhs : digits (u ++ [a, 2] ++ List.replicate n 0) +> r = + digits (u ++ [a]) +> ([0, 0, 0] +> ([1, 1] +> (digits (List.replicate n 0) +> r))) := by + simp only [digits_app, digits_cons, digits_nil, listPow_succ, listPow_zero, bit0, + List.cons_append, List.nil_append, List.append_nil, append_assoc, append_cons, append_nil] + have h_rhs : digits (u ++ [1 + a, 0] ++ List.replicate n 0) +> r = + digits (u ++ [1 + a]) +> ([0] +> ([1, 1] +> (digits (List.replicate n 0) +> r))) := by + simp only [digits_app, digits_cons, digits_nil, listPow_succ, listPow_zero, bit0, + List.cons_append, List.nil_append, List.append_nil, append_assoc, append_cons, append_nil] + rw [h_lhs, h_rhs] + exact last7_snoc b a l ([1, 1] +> (digits (List.replicate n 0) +> r)) hb hu ha + +theorem last7_blank (b : Nat) {u : List Nat} (a : Nat) (l : HalfTape) + (hb : b = 1 ∨ b = 2) (hu : IsBinary u) (ha : a ≤ 1) : + (stepCfg l ((bit0 ^ b) +> ((bit1 ^ 7) +> (digits (u ++ [a]) +> default)))) [tm24]⊢⁺ + (stepCfg ([1] +> ([0] +> ((bit1 ^ (1 + b)) +> l))) + ([0, 0, 1, 1, 1] +> (digits (u ++ [1 + a]) +> default))) := by + have h := last7_snoc b a l default hb hu ha + simpa only [append_cons, append_nil, zero_cons_default'] using h + +def records_side : Records → HalfTape + | REnd ds => digits ds +> default + | RMore ds b rs => digits ds +> ((bit0 ^ b) +> ((bit1 ^ 7) +> records_side rs)) + +def record_stack (bs : List (List Nat × Nat)) (l : HalfTape) : HalfTape := + bs.foldl (fun l x => [0] +> ((bit1 ^ (2 + x.2)) +> pending x.1 ((bit0 ^ 5) +> l))) l + +theorem advance_spec {rs : Records} {bs : List (List Nat × Nat)} {rs' : Records} + (ha : Advance rs bs rs') (h : Nat) (l : HalfTape) (hh : h = 1 ∨ h = 2) : + (stepCfg l ((bit0 ^ h) +> ((bit1 ^ 7) +> records_side rs))) [tm24]⊢⁺ + (stepCfg ([1] +> record_stack bs ([0] +> ((bit1 ^ (1 + h)) +> l))) + ([0, 0, 1, 1, 1] +> records_side rs')) := by + induction ha generalizing h l with + | AEnd ds ds' hc => + simp only [records_side, record_stack, List.foldl_nil] + cases hc with + | inside u a n _ hu ha => exact last7_inside h a n l default hh hu ha + | last u a _ hu ha _ => exact last7_blank h a l hh hu ha + | AStop ds b ds' b' rs hbpos hc => + simp only [records_side, record_stack, List.foldl_nil] + cases hc with + | inside u a n _ hu ha => + exact last7_inside h a n l ((bit0 ^ b) +> ((bit1 ^ 7) +> records_side rs)) hh hu ha + | last u a _ hu ha hb03 => + have hb3 : b = 3 := by omega + subst hb3 + exact last7_snoc h a l ((bit1 ^ 7) +> records_side rs) hh hu ha + | AGo ds b rs bs rs' hd hb12 _ ih => + simp only [records_side, record_stack, List.foldl_cons] + refine stepPlus_of_step (scan_seven hh l (digits ds +> ((bit0 ^ b) +> ((bit1 ^ 7) +> + records_side rs)))) ?_ + refine stepPlus_of_step (scan_digits hd ((bit0 ^ 6) +> ((bit1 ^ (1 + h)) +> l)) ((bit0 ^ b) +> + ((bit1 ^ 7) +> records_side rs))) ?_ + have hstep := ih b (pending ds ((bit0 ^ 6) +> ((bit1 ^ (1 + h)) +> l))) hb12 + have h6 : (bit0 ^ 6) +> ((bit1 ^ (1 + h)) +> l) = (bit0 ^ 5) +> ([0] +> ((bit1 ^ (1 + h)) +> + l)) := by + simp [listPow_succ, bit0] + have hb2 : 2 + (b - 1) = 1 + b := by omega + rw [h6] at hstep + rw [hb2] + exact hstep + +theorem reset_rule {rs : Records} (hr : Good true rs) : + ∃ bs rs', AllBlocks true ((seed_offset, 0) :: bs) ∧ Good false rs' ∧ + (cap_entry [2, 2, 1, 2, 2, 1, 1] 3 (records_side rs)) [tm24]⊢⁺ + (stepCfg ([1] +> record_stack ((seed_offset, 0) :: bs) (put_left [4] default)) + ([0, 0, 1, 1, 1] +> records_side rs')) := by + have hg : Good true (RMore seed_offset 1 rs) := ⟨seed_segment, ⟨by omega, by omega⟩, hr⟩ + rcases advance_total (RMore seed_offset 1 rs) hg with ⟨bs, rs', ha, hb, hg'⟩ + rcases advance_go ha seed_binary (Or.inl rfl) with ⟨bs', rfl, _⟩ + refine ⟨bs', rs', hb, hg', ?_⟩ + refine stepStar_trans' (bridge3 (records_side rs)) ?_ + exact advance_spec ha 2 ([1] +> default) (Or.inr rfl) + +inductive Cap where + | C0 + | C1 + | C2 + | C3 + deriving DecidableEq + +open Cap + +def cap_word : Cap → List Nat + | C0 => [4] + | C1 => [3, 3, 3] + | C2 => [4, 3, 3, 2, 2, 2] + | C3 => [3, 3, 2, 3, 3, 2, 2, 3] + +def cap_prefix : Cap → List Nat + | C0 => [] + | C1 => [2, 2] + | C2 => [3, 2, 2, 1, 1] + | C3 => [2, 2, 1, 2, 2, 1, 1] + +def cap_height : Cap → Nat + | C0 => 4 + | C1 => 3 + | C2 => 2 + | C3 => 3 + +def cap_bound : Cap → Nat + | C0 => 236 + | C1 => 238 + | C2 => 240 + | C3 => 242 + +def next_cap : Cap → Cap + | C0 => C1 + | C1 => C2 + | C2 => C3 + | C3 => C0 + +theorem cap_prefix_spec (c : Cap) {rs : Records} {bs : List (List Nat × Nat)} {rs' : Records} + (hc : c ≠ C3) (ha : Advance rs bs rs') : + (cap_entry (cap_prefix c) (cap_height c) (records_side rs)) [tm24]⊢⁺ + (stepCfg ([1] +> record_stack bs (put_left (cap_word (next_cap c)) default)) + ([0, 0, 1, 1, 1] +> records_side rs')) := by + cases c with + | C0 => + refine stepStar_trans' (bridge0 (records_side rs)) ?_ + have hb1 : IsBinary [1] := IsBinary.cons (by decide) IsBinary.nil + refine stepPlus_of_step (scan_digits hb1 (put_left [3] default) ([0, + 0] +> ((bit1 ^ 7) +> records_side rs))) ?_ + exact advance_spec ha 2 (pending [1] (put_left [3] default)) (Or.inr rfl) + | C1 => + refine stepStar_trans' (bridge1 (records_side rs)) ?_ + have hb100 : IsBinary [1, 0, 0] := + IsBinary.cons (by decide) (IsBinary.cons (by decide) (IsBinary.cons (by decide) IsBinary.nil)) + refine stepPlus_of_step (scan_digits hb100 (put_left [4, + 3] default) ([0] +> ((bit1 ^ 7) +> records_side rs))) ?_ + exact advance_spec ha 1 (pending [1, 0, 0] (put_left [4, 3] default)) (Or.inl rfl) + | C2 => + refine stepStar_trans' (bridge2 (records_side rs)) ?_ + have hb101100 : IsBinary [1, 0, 1, 1, 0, 0] := by + repeat (first | exact IsBinary.nil | refine IsBinary.cons (by decide) ?_) + refine stepPlus_of_step (scan_digits hb101100 (put_left [3] default) ([0, + 0] +> ((bit1 ^ 7) +> records_side rs))) ?_ + exact advance_spec ha 2 (pending [1, 0, 1, 1, 0, 0] (put_left [3] default)) (Or.inr rfl) + | C3 => contradiction + +theorem cap_rule (c : Cap) {rs : Records} + (hg : Good true rs) (hm : measure (first_digits rs) ≤ 1 + cap_bound c) : + ∃ bs rs', AllBlocks true bs ∧ Good false rs' ∧ + measure (protected_digits bs rs') ≤ cap_bound (next_cap c) ∧ + (cap_entry (cap_prefix c) (cap_height c) (records_side rs)) [tm24]⊢⁺ + (stepCfg ([1] +> record_stack bs (put_left (cap_word (next_cap c)) default)) + ([0, 0, 1, 1, 1] +> records_side rs')) := by + cases c with + | C0 => + rcases advance_total rs hg with ⟨bs, rs', ha, hb, hr⟩ + have hmb := advance_bound ha hg + exact ⟨bs, rs', hb, hr, by simp [cap_bound, next_cap] at hm ⊢; omega, + cap_prefix_spec C0 (by decide) ha⟩ + | C1 => + rcases advance_total rs hg with ⟨bs, rs', ha, hb, hr⟩ + have hmb := advance_bound ha hg + exact ⟨bs, rs', hb, hr, by simp [cap_bound, next_cap] at hm ⊢; omega, + cap_prefix_spec C1 (by decide) ha⟩ + | C2 => + rcases advance_total rs hg with ⟨bs, rs', ha, hb, hr⟩ + have hmb := advance_bound ha hg + exact ⟨bs, rs', hb, hr, by simp [cap_bound, next_cap] at hm ⊢; omega, + cap_prefix_spec C2 (by decide) ha⟩ + | C3 => + rcases reset_rule hg with ⟨bs, rs', hb, hr, hs⟩ + refine ⟨(seed_offset, 0) :: bs, rs', hb, hr, ?_, hs⟩ + simp only [protected_digits, cap_bound, next_cap, seed_measure, le_refl] + +theorem records_zero {p : Bool} {rs : Records} (h : Good p rs) : + ∃ r, records_side rs = [0] +> r := by + cases rs with + | REnd ds => + rcases ds with _ | ⟨d, ds⟩ + · exact False.elim h.2.1 + · refine ⟨((bit0 ^ d) ++ [1, 1] ++ digits ds) +> default, ?_⟩ + simp only [records_side, digits_cons, listPow_succ', bit0, List.cons_append, List.nil_append, + append_cons, append_nil, append_assoc] + | RMore ds b rs => + rcases ds with _ | ⟨d, ds⟩ + · exact False.elim h.1.2.1 + · refine ⟨((bit0 ^ d) ++ [1, + 1] ++ digits ds) +> ((bit0 ^ b) +> ((bit1 ^ 7) +> records_side rs)), ?_⟩ + simp only [records_side, digits_cons, listPow_succ', bit0, List.cons_append, List.nil_append, + append_cons, append_nil, append_assoc] + +theorem return_separator (l r : HalfTape) (hr : ∃ r', r = [0] +> r') : + (returnCfg ([0, 0] +> ((bit1 ^ 4) +> l)) r) [tm24]⊢* + (l <{{A}} ((bit1 ^ 8) +> r)) := by + rcases hr with ⟨r', rfl⟩ + exact close2 l r' + +theorem return_six (l r : HalfTape) (hr : ∃ r', r = [0] +> r') : + (returnCfg ((bit0 ^ 6) +> l) r) [tm24]⊢* + (stepCfg ([1] +> ([0] +> l)) ([0, 0, 1, 1, 1] +> r)) := by + rcases hr with ⟨r', rfl⟩ + exact close6 l r' + +theorem emit_block (ds : List Nat) (n : Nat) (l r : HalfTape) : + (([0] +> ((bit1 ^ (2 + n)) +> pending ds l)) <{{A}} ((bit1 ^ 8) +> r)) [tm24]⊢* + (returnCfg l (digits ds +> ((bit0 ^ (2 + n)) +> ((bit1 ^ 7) +> r)))) := by + refine stepPlus_trans' (block_back ds n l r) ?_ + unfold backCfg returnCfg + have h1 : ([0, 0, 0] : BitWord) +> (back_word ds +> ((bit0 ^ (1 + n)) +> ((bit1 ^ 7) +> r))) = + [0, 0] +> ([0] +> (back_word ds +> ((bit0 ^ (1 + n)) +> ((bit1 ^ 7) +> r)))) := rfl + have h2n : 2 + n = 1 + (1 + n) := by omega + rw [h1, zero_back_word, h2n, step_left_default bit0 (1 + n) ((bit1 ^ 7) +> r)] + + +inductive Stack where + | SCap (c : Cap) + | SPush (six : Bool) (older : Stack) (ds : List Nat) (n : Nat) + +open Stack + +def stack_good : Stack → Prop + | SCap _ => True + | SPush six older ds n => stack_good older ∧ Block six (ds, n) + +def stack_side : Stack → HalfTape + | SCap c => put_left (cap_word c) default + | SPush six older ds n => + [0] +> ((bit1 ^ (2 + n)) +> pending ds + (if six then (bit0 ^ 5) +> stack_side older + else [0, 0] +> ((bit1 ^ 4) +> stack_side older))) + +def stack_cap : Stack → Cap + | SCap c => c + | SPush _ older _ _ => stack_cap older + +def stack_protected : Stack → List Nat → List Nat + | SCap _, ds => ds + | SPush _ older pfx _, _ => stack_protected older pfx + +theorem stack_zero (st : Stack) : ∃ l, stack_side st = [0] +> l := by + rcases st with ⟨_ | _ | _ | _⟩ | ⟨six, older, ds, n⟩ <;> { + dsimp only [stack_side, cap_word, put_left, List.foldl] + exact ⟨_, rfl⟩ + } + +def active (st : Stack) (rs : Records) : Cfg (Fin 2) (Fin 6) := + stepCfg ([1] +> stack_side st) ([0, 0, 1, 1, 1] +> records_side rs) + +def restored : Stack → Records → Cfg (Fin 2) (Fin 6) + | SCap c, rs => cap_entry (cap_prefix c) (cap_height c) (records_side rs) + | SPush true older ds n, rs => active older (RMore ds (2 + n) rs) + | SPush false older ds n, rs => restored older (RMore ds (2 + n) rs) + +theorem emitted_good (p : Bool) {ds : List Nat} {n : Nat} {rs : Records} + (hb : Block p (ds, n)) (hr : Good true rs) : + Good (!p) (RMore ds (2 + n) rs) := by + refine ⟨emitted_segment hb, ⟨by omega, ?_⟩, hr⟩ + have hn := hb.2.1 + dsimp only at hn + omega + +theorem cap_emit (c : Cap) (r : HalfTape) : + ((put_left (cap_word c) default) <{{A}} ((bit1 ^ 8) +> r)) [tm24]⊢* + (cap_entry (cap_prefix c) (cap_height c) r) := by + cases c <;> { + unfold put_left cap_word cap_entry cap_prefix cap_height root stepCfg payload + simp only [List.foldl_cons, List.foldl_nil, List.flatMap_cons, List.flatMap_nil, + listPow_succ, listPow_zero, bit0, bit1, + List.cons_append, List.nil_append, List.append_nil, append_cons, append_nil] + execute + } + +theorem stack_return (st : Stack) (rs : Records) + (hl : stack_good st) (hr : Good true rs) : + ((stack_side st) <{{A}} ((bit1 ^ 8) +> records_side rs)) [tm24]⊢* (restored st rs) := by + induction st generalizing rs with + | SCap c => exact cap_emit c (records_side rs) + | SPush six older ds n ih => + rcases hl with ⟨hl', hb⟩ + rcases six with _ | _ + · simp only [stack_side, restored] + refine stepPlus_trans' (emit_block ds n ([0, + 0] +> ((bit1 ^ 4) +> stack_side older)) (records_side rs)) ?_ + have hg' := emitted_good false hb hr + refine stepPlus_trans' (return_separator (stack_side older) (records_side (RMore ds (2 + n) + rs)) (records_zero hg')) ?_ + exact ih (RMore ds (2 + n) rs) hl' hg' + · simp only [stack_side, restored, ↓reduceIte] + refine stepPlus_trans' (emit_block ds n ((bit0 ^ 5) +> stack_side older) (records_side rs)) ?_ + have hg' := emitted_good true hb hr + rcases stack_zero older with ⟨l, hst⟩ + unfold active + rw [hst] + have h6 : (bit0 ^ 5) +> ([0] +> l) = (bit0 ^ 6) +> l := by + simp [listPow_succ, bit0] + rw [h6] + exact return_six l (records_side (RMore ds (2 + n) rs)) (records_zero hg') + +theorem restored_good (st : Stack) (rs : Records) + (hl : stack_good st) (hr : Good true rs) : + (∃ st' rs', restored st rs = active st' rs' ∧ + stack_good st' ∧ Good false rs' ∧ stack_cap st' = stack_cap st ∧ + stack_protected st' (first_digits rs') = stack_protected st (first_digits rs)) ∨ + (∃ rs', restored st rs = + cap_entry (cap_prefix (stack_cap st)) (cap_height (stack_cap st)) (records_side rs') ∧ + Good true rs' ∧ first_digits rs' = stack_protected st (first_digits rs)) := by + induction st generalizing rs with + | SCap c => + exact Or.inr ⟨rs, rfl, hr, rfl⟩ + | SPush six older ds n ih => + rcases hl with ⟨hl', hb⟩ + rcases six with _ | _ + · exact ih (RMore ds (2 + n) rs) hl' (emitted_good false hb hr) + · exact Or.inl ⟨older, RMore ds (2 + n) rs, rfl, hl', emitted_good true hb hr, rfl, rfl⟩ + +theorem carry_word {u : List Nat} (a : Nat) (l r : HalfTape) + (hu : IsBinary u) (ha : a ≤ 1) : + (stepCfg l (digits (u ++ [a]) +> ([0, 0, 0] +> r))) [tm24]⊢⁺ + (returnCfg l (digits (u ++ [1 + a]) +> ([0] +> r))) := by + have h_lhs : digits (u ++ [a]) +> ([0, 0, 0] +> r) = + digits u +> ((bit0 ^ (1 + a)) +> ([1, 1, 0, 0, 0] +> r)) := by + rw [digits_app] + simp only [digits_cons, digits_nil, List.append_nil, append_assoc, append_cons, append_nil] + rw [h_lhs] + have h1 := ordinary_return hu ha l r + refine step_right_default h1 ?_ + unfold backCfg returnCfg + have h2 : ([0, 0, 0] : BitWord) +> (back_word u +> ((bit0 ^ (1 + a)) +> ([1, 1, 0] +> r))) = + [0, 0] +> ([0] +> (back_word u +> ((bit0 ^ (1 + a)) +> ([1, 1, 0] +> r)))) := rfl + have h_rhs : digits u +> ([0] +> ((bit0 ^ (1 + a)) +> ([1, 1, 0] +> r))) = + digits (u ++ [1 + a]) +> ([0] +> r) := by + rw [digits_app] + simp only [digits_cons, digits_nil, listPow_succ', bit0, + List.cons_append, List.nil_append, List.append_nil, append_assoc, append_cons, append_nil] + rw [h2, zero_back_word, h_rhs] + + +theorem carry_inside {u : List Nat} (a n : Nat) (l r : HalfTape) + (hu : IsBinary u) (ha : a ≤ 1) : + (stepCfg l (digits (u ++ [a, 2] ++ List.replicate n 0) +> r)) [tm24]⊢⁺ + (returnCfg l (digits (u ++ [1 + a, 0] ++ List.replicate n 0) +> r)) := by + have h_lhs : digits (u ++ [a, 2] ++ List.replicate n 0) +> r = + digits (u ++ [a]) +> ([0, 0, 0] +> ([1, 1] +> (digits (List.replicate n 0) +> r))) := by + simp only [digits_app, digits_cons, digits_nil, listPow_succ, listPow_zero, bit0, + List.cons_append, List.nil_append, List.append_nil, append_assoc, append_cons, append_nil] + have h_rhs : digits (u ++ [1 + a, 0] ++ List.replicate n 0) +> r = + digits (u ++ [1 + a]) +> ([0] +> ([1, 1] +> (digits (List.replicate n 0) +> r))) := by + simp only [digits_app, digits_cons, digits_nil, listPow_succ, listPow_zero, bit0, + List.cons_append, List.nil_append, List.append_nil, append_assoc, append_cons, append_nil] + rw [h_lhs, h_rhs] + exact carry_word a l ([1, 1] +> (digits (List.replicate n 0) +> r)) hu ha + +theorem carry_blank {u : List Nat} (a : Nat) (l : HalfTape) + (hu : IsBinary u) (ha : a ≤ 1) : + (stepCfg l (digits (u ++ [a]) +> default)) [tm24]⊢⁺ + (returnCfg l (digits (u ++ [1 + a]) +> default)) := by + have h := carry_word a l default hu ha + simpa only [append_cons, append_nil, zero_cons_default'] using h + +theorem carry_records_spec {rs rs' : Records} (ha : Advance rs [] rs') (l : HalfTape) : + (stepCfg l (records_side rs)) [tm24]⊢⁺ (returnCfg l (records_side rs')) := by + cases ha with + | AEnd ds ds' hc => + simp only [records_side] + cases hc with + | inside u a n _ hu ha => exact carry_inside a n l default hu ha + | last u a _ hu ha _ => exact carry_blank a l hu ha + | AStop ds b ds' b' tail _ hc => + simp only [records_side] + cases hc with + | inside u a n _ hu ha => + exact carry_inside a n l ((bit0 ^ b) +> ((bit1 ^ 7) +> records_side tail)) hu ha + | last u a _ hu ha hb03 => + have hb3 : b = 3 := by omega + subst hb3 + exact carry_word a l ((bit1 ^ 7) +> records_side tail) hu ha + +theorem carry_records_good (p : Bool) {rs rs' : Records} + (ha : Advance rs [] rs') (hg : Good p rs) : Good (!p) rs' := by + cases ha with + | AEnd ds ds' hc => exact carry_segment p hc hg + | AStop ds b ds' b' tail _ hc => + rcases hg with ⟨hs, hb, hr⟩ + exact ⟨carry_segment p hc hs, carry_header hc hb, hr⟩ + +theorem active_return {st : Stack} {rs rs' : Records} + (hl : stack_good st) (hr : Good false rs) (ha : Advance rs [] rs') : + (active st rs) [tm24]⊢⁺ (restored st rs') := by + have hg : Good true rs' := carry_records_good false ha hr + unfold active + refine stepPlus_of_step (active_scan (stack_side st) (records_side rs)) ?_ + refine step_right_default (carry_records_spec ha ([0, 0] +> ((bit1 ^ 4) +> stack_side st))) ?_ + refine stepPlus_trans' (return_separator (stack_side st) (records_side rs') (records_zero hg)) ?_ + exact stack_return st rs' hl hg + +def extend_stack (bs : List (List Nat × Nat)) (st : Stack) : Stack := + bs.foldl (fun st x => SPush true st x.1 x.2) st + +@[simp] theorem record_stack_nil (l : HalfTape) : record_stack [] l = l := rfl +@[simp] theorem record_stack_cons (x : List Nat × Nat) (bs : List (List Nat × Nat)) (l : HalfTape) : + record_stack (x :: bs) l = + record_stack bs ([0] +> ((bit1 ^ (2 + x.2)) +> pending x.1 ((bit0 ^ 5) +> l))) := rfl +@[simp] theorem extend_stack_nil (st : Stack) : extend_stack [] st = st := rfl +@[simp] theorem extend_stack_cons (x : List Nat × Nat) (bs : List (List Nat × Nat)) (st : Stack) : + extend_stack (x :: bs) st = extend_stack bs (SPush true st x.1 x.2) := rfl + +theorem extend_side (bs : List (List Nat × Nat)) (st : Stack) : + stack_side (extend_stack bs st) = record_stack bs (stack_side st) := by + induction bs generalizing st with + | nil => rfl + | cons x bs ih => + rw [extend_stack_cons, record_stack_cons, ih (SPush true st x.1 x.2)] + rfl + +theorem extend_good {bs : List (List Nat × Nat)} {st : Stack} + (hb : AllBlocks true bs) (hl : stack_good st) : + stack_good (extend_stack bs st) := by + induction hb generalizing st with + | nil => exact hl + | @cons x bs hbx _ ih => exact ih ⟨hl, hbx⟩ + +theorem extend_cap (bs : List (List Nat × Nat)) (st : Stack) : + stack_cap (extend_stack bs st) = stack_cap st := by + induction bs generalizing st with + | nil => rfl + | cons x bs ih => exact ih (SPush true st x.1 x.2) + +theorem extend_protected (bs : List (List Nat × Nat)) (st : Stack) (rs : Records) : + stack_protected (extend_stack bs st) (first_digits rs) = + stack_protected st (protected_digits bs rs) := by + induction bs generalizing st with + | nil => rfl + | cons x bs ih => exact ih (SPush true st x.1 x.2) + +theorem active_constructor {st : Stack} {ds : List Nat} {b : Nat} {rs : Records} + (hl : stack_good st) (hs : Segment false b ds) (hr : Good true rs) + (hd : IsBinary ds) (hb : b = 1 ∨ b = 2) : + ∃ st' rs', stack_good st' ∧ Good false rs' ∧ + stack_cap st' = stack_cap st ∧ + stack_protected st' (first_digits rs') = stack_protected st ds ∧ + (active st (RMore ds b rs)) [tm24]⊢⁺ (active st' rs') := by + rcases advance_total rs hr with ⟨bs, rs', ha, hbs, hg⟩ + refine ⟨extend_stack bs (SPush false st ds (b - 1)), rs', + extend_good hbs ⟨hl, scanned_block false b hs hd hb⟩, hg, + extend_cap bs (SPush false st ds (b - 1)), + extend_protected bs (SPush false st ds (b - 1)) rs', ?_⟩ + unfold active + rw [extend_side] + simp only [records_side, stack_side] + refine stepPlus_of_step (active_scan (stack_side st) (digits ds +> ((bit0 ^ b) +> ((bit1 ^ 7) +> + records_side rs)))) ?_ + refine stepPlus_of_step (scan_digits hd ([0, + 0] +> ((bit1 ^ 4) +> stack_side st)) ((bit0 ^ b) +> ((bit1 ^ 7) +> records_side rs))) ?_ + have hstep := advance_spec ha b (pending ds ([0, 0] +> ((bit1 ^ 4) +> stack_side st))) hb + have hb2 : 2 + (b - 1) = 1 + b := by omega + rw [hb2] + exact hstep + +def Source (st : Stack) (rs : Records) : Prop := + stack_good st ∧ Good false rs ∧ + measure (stack_protected st (first_digits rs)) ≤ cap_bound (stack_cap st) + +theorem prefix_app (n : Nat) (u v : List Nat) (h : n ≤ u.length) : + prefix_value n (u ++ v) = prefix_value n u := by + induction u generalizing n with + | nil => + have hn : n = 0 := by simpa using h + subst hn + rfl + | cons d u ih => + rcases n with _ | k + · rfl + · simp only [List.length_cons] at h + simp only [List.cons_append, prefix_value, ih k (by omega)] + +theorem measure_app (u v : List Nat) (h : 7 ≤ u.length) : + measure (u ++ v) = measure u := by + unfold measure + rw [List.map_append] + exact prefix_app 7 (u.map Nat.succ) (v.map Nat.succ) (by simpa using h) + +theorem long_measure (k : Nat) (hk : 6 ≤ k) : + measure (2 :: List.replicate k 0) = 255 := by + have hk' : k = 6 + (k - 6) := by omega + rw [hk', List.replicate_add, ← List.cons_append] + rw [measure_app (2 :: List.replicate 6 0) (List.replicate (k - 6) 0) (by decide)] + rfl + +theorem long_segment (b k : Nat) (hs : Segment false b (2 :: List.replicate k 0)) (hb : b ≤ 3) : + (b = 0 ∧ oddB k = true) ∨ ((b = 1 ∨ b = 3) ∧ oddB k = false) := by + rcases hs with ⟨_, _, ⟨hl, hm⟩, _⟩ + simp only [List.length_cons, List.length_replicate, mass, mass_zeros] at hl hm + rw [odd_succ] at hl + have hm' : 1 + 2 + k + b = k + (3 + b) := by omega + rw [hm', odd_add] at hm + rcases b with _ | _ | _ | _ | b + · cases hodd : oddB k <;> simp_all [oddB] + · cases hodd : oddB k <;> simp_all [oddB] + · cases hodd : oddB k <;> simp_all [oddB] + · cases hodd : oddB k <;> simp_all [oddB] + · omega + +theorem source_long_marked (st : Stack) (b k : Nat) + (hs : Segment false b (2 :: List.replicate k 0)) + (hm : measure (stack_protected st (2 :: List.replicate k 0)) ≤ cap_bound (stack_cap st)) : + ∃ six older ds n, st = SPush six older ds n := by + rcases st with ⟨c⟩ | ⟨six, older, ds, n⟩ + · have hl := segment_length hs + simp only [List.length_cons, List.length_replicate] at hl + simp only [stack_protected, stack_cap] at hm + rw [long_measure k (by omega)] at hm + cases c <;> simp [cap_bound] at hm + · exact ⟨six, older, ds, n, rfl⟩ + +def merged (ds : List Nat) (n k : Nat) : List Nat := + ds ++ [n, 1, 1, 0] ++ List.replicate k 0 + +theorem merged_succ (ds : List Nat) (n k : Nat) : + merged ds n (1 + k) = merged ds n k ++ [0] := by + unfold merged + have hk : 1 + k = k + 1 := by omega + rw [hk, List.replicate_add] + simp [List.append_assoc] + +theorem zeros_binary (k : Nat) : IsBinary (List.replicate k 0) := by + induction k with + | zero => exact IsBinary.nil + | succ k ih => exact IsBinary.cons (by omega) ih + +theorem merged_binary {ds : List Nat} {n : Nat} (k : Nat) + (hd : IsBinary ds) (hn : n ≤ 1) : IsBinary (merged ds n k) := by + unfold merged + refine isBinary_append.mpr ⟨isBinary_append.mpr ⟨hd, ?_⟩, zeros_binary k⟩ + exact IsBinary.cons hn (IsBinary.cons (by decide) (IsBinary.cons (by decide) (IsBinary.cons (by + decide) IsBinary.nil))) + +theorem merged_length (ds : List Nat) (n k : Nat) : + (merged ds n k).length = ds.length + 4 + k := by + unfold merged + simp only [List.length_append, List.length_cons, List.length_nil, List.length_replicate] + +theorem merged_mass (ds : List Nat) (n k : Nat) : + mass (merged ds n k) = mass ds + 6 + n + k := by + unfold merged + rw [mass_app, mass_app, mass_zeros] + simp only [mass] + omega + +theorem merged_segment (p : Bool) {ds : List Nat} {n : Nat} (b k : Nat) + (hb : Block p (ds, n)) (hs : Segment false b (2 :: List.replicate k 0)) : + Segment p b (merged ds n k) := by + dsimp only [Block] at hb + rcases hb with ⟨hd, hn, hh, ⟨hl, hm⟩, hmin⟩ + rcases hs with ⟨_, _, ⟨hk, hsum⟩, _⟩ + have h1 : (1 + n == 0) = false := by cases n <;> rfl + rw [h1] at hl + simp only [List.length_cons, List.length_replicate, mass, mass_zeros] at hk hsum + refine ⟨num_binary (merged_binary k hd hn) p, ?_, ⟨?_, ?_⟩, ?_⟩ + · rcases ds with _ | ⟨d, ds⟩ + · exact False.elim hh + · simp only [Head, merged, List.cons_append] at hh ⊢ + rcases hh with h | ⟨_, h⟩ + · exact Or.inl h + · cases h + · rw [merged_length] + have hlen_eq : ds.length + 4 + k = k + (1 + (1 + (1 + (1 + ds.length)))) := by omega + rw [hlen_eq, odd_add, odd_next, odd_next, odd_next, odd_next, Bool.not_not, Bool.not_not, hl] + have h2 : (!false) = true := rfl + rw [h2, Bool.xor_true] + rw [odd_succ] at hk + exact hk + · have hmass_eq : mass (merged ds n k) + b = (mass ds + (1 + n)) + (1 + (1 + (1 + 2 + k + b))) := + by + rw [merged_mass]; omega + rw [hmass_eq, odd_add, hm, odd_next, odd_next, Bool.not_not, hsum, Bool.xor_false] + · rw [merged_length] + cases (b == 0) <;> { simp only [Bool.false_eq_true, ↓reduceIte]; omega } + +theorem merged_block (p : Bool) {ds : List Nat} {n : Nat} (k : Nat) + (hb : Block p (ds, n)) (hs : Segment false 1 (2 :: List.replicate k 0)) : + Block p (merged ds n k, 0) := + scanned_block p 1 (merged_segment p 1 k hb hs) (merged_binary k hb.1 hb.2.1) (Or.inl rfl) + +theorem merged_bump_segment (p : Bool) {ds : List Nat} {n : Nat} (b k : Nat) + (hb : Block p (ds, n)) (hs : Segment false b (2 :: List.replicate (1 + k) 0)) + (hb03 : b = 0 ∨ b = 3) : + Segment (!p) (b - 2) (merged ds n k ++ [1]) := by + have hs' := merged_segment p b (1 + k) hb hs + rw [merged_succ] at hs' + exact segment_last (merged_binary k hb.1 hb.2.1) (by omega) hs' hb03 + +theorem stack_measure (st : Stack) {u v : List Nat} (h : measure u = measure v) : + measure (stack_protected st u) = measure (stack_protected st v) := by + cases st <;> simp [stack_protected, h] + +theorem merged_measure (ds : List Nat) (n k : Nat) (h : 7 ≤ ds.length) : + measure (merged ds n k) = measure ds := by + unfold merged + rw [List.append_assoc] + exact measure_app ds ([n, 1, 1, 0] ++ List.replicate k 0) h + +theorem bumped_measure (ds : List Nat) (n k : Nat) (h : 7 ≤ ds.length) : + measure (merged ds n k ++ [1]) = measure ds := by + unfold merged + simp only [List.append_assoc] + exact measure_app ds ([n, 1, 1, 0] ++ (List.replicate k 0 ++ [1])) h + + +theorem initial_source : Source (SCap C0) (REnd (seed_offset ++ [1])) := by + have hbin : IsBinary (seed_offset ++ [1]) := by + unfold seed_offset + repeat (first | exact IsBinary.nil | refine IsBinary.cons (by decide) ?_) + refine ⟨trivial, ⟨num_binary hbin false, Or.inl rfl, ⟨by decide, by decide⟩, by decide⟩, + by decide⟩ + + +theorem pending_app (u v : List Nat) (l : HalfTape) : + pending (u ++ v) l = pending v (pending u l) := by + unfold pending + exact List.foldl_append + +theorem merged_pending (ds : List Nat) (n k : Nat) (l : HalfTape) : + pending (merged ds n k) l = + pending ([1, 0] ++ List.replicate k 0) + ([0] +> ((bit1 ^ 3) +> ([0] +> ((bit1 ^ (2 + n)) +> pending ds l)))) := by + unfold merged + rw [pending_app, pending_app, pending_app] + simp only [pending_cons, pending_nil] + +theorem long_scan (k : Nat) (l r : HalfTape) : + (stepCfg ([1] +> l) ([0, 0, 1, 1, 1] +> (digits (2 :: List.replicate k 0) +> r))) [tm24]⊢⁺ + (stepCfg (pending ([1, 0] ++ List.replicate k 0) ([0] +> ((bit1 ^ 3) +> l))) r) := by + have hd : ([0, 0, 1, 1, 1] : BitWord) +> (digits (2 :: List.replicate k 0) +> r) = + [0, 0, 1, 1, 1, 0, 0, 0] +> ([1, 1] +> (digits (List.replicate k 0) +> r)) := by + simp only [digits_cons, listPow_succ, listPow_zero, bit0, List.cons_append, List.nil_append] + rfl + rw [hd] + refine step_right_default (active_turn l ([1, 1] +> (digits (List.replicate k 0) +> r))) ?_ + have hd2 : ([0, 0, 1, 1, 0] : BitWord) +> ([1, 1] +> (digits (List.replicate k 0) +> r)) = + digits ([1, 0] ++ List.replicate k 0) +> r := by + simp only [List.cons_append, List.nil_append, digits_cons, listPow_succ, listPow_zero, bit0] + rfl + rw [hd2] + have hbin : IsBinary ([1, 0] ++ List.replicate k 0) := + IsBinary.cons (by decide) (IsBinary.cons (by decide) (zeros_binary k)) + exact scan_digits hbin ([0] +> ((bit1 ^ 3) +> l)) r + +theorem long_pending (ds : List Nat) (n k : Nat) (l r : HalfTape) : + (stepCfg ([1] +> ([0] +> ((bit1 ^ (2 + n)) +> pending ds l))) + ([0, 0, 1, 1, 1] +> (digits (2 :: List.replicate k 0) +> r))) [tm24]⊢⁺ + (stepCfg (pending (merged ds n k) l) r) := by + rw [merged_pending] + exact long_scan k ([0] +> ((bit1 ^ (2 + n)) +> pending ds l)) r + +theorem pending_carry (u : List Nat) (a : Nat) (l r : HalfTape) : + (stepCfg (pending (u ++ [a]) l) ([0, 0, 0] +> r)) [tm24]⊢⁺ + (returnCfg l (digits (u ++ [1 + a]) +> ([0] +> r))) := by + rw [pending_app] + simp only [pending_cons, pending_nil] + refine step_right_default (start_back a (pending u l) r) ?_ + refine stepPlus_trans' (pending_back u l ((bit0 ^ (1 + a)) +> ([1, 1, 0] +> r))) ?_ + unfold backCfg returnCfg + have h1 : ([0, 0, 0] : BitWord) +> (back_word u +> ((bit0 ^ (1 + a)) +> ([1, 1, 0] +> r))) = + [0, 0] +> ([0] +> (back_word u +> ((bit0 ^ (1 + a)) +> ([1, 1, 0] +> r)))) := rfl + have h_rhs : digits u +> ([0] +> ((bit0 ^ (1 + a)) +> ([1, 1, 0] +> r))) = + digits (u ++ [1 + a]) +> ([0] +> r) := by + rw [digits_app] + simp only [digits_cons, digits_nil, listPow_succ', bit0, + List.cons_append, List.nil_append, List.append_nil, append_assoc, append_cons, append_nil] + rw [h1, zero_back_word, h_rhs] + + +theorem long_pending_return (ds : List Nat) (n k : Nat) (l r : HalfTape) : + (stepCfg ([1] +> ([0] +> ((bit1 ^ (2 + n)) +> pending ds l))) + ([0, 0, 1, 1, 1] +> (digits (2 :: List.replicate (1 + k) 0) +> ([0, 0, 0] +> r)))) [tm24]⊢⁺ + (returnCfg l (digits (merged ds n k ++ [1]) +> ([0] +> r))) := by + refine stepStar_trans' (long_pending ds n (1 + k) l ([0, 0, 0] +> r)) ?_ + rw [merged_succ] + exact pending_carry (merged ds n k) 0 l r + +theorem long_pending_blank (ds : List Nat) (n k : Nat) (l : HalfTape) : + (stepCfg ([1] +> ([0] +> ((bit1 ^ (2 + n)) +> pending ds l))) + ([0, 0, 1, 1, 1] +> (digits (2 :: List.replicate (1 + k) 0) +> default))) [tm24]⊢⁺ + (returnCfg l (digits (merged ds n k ++ [1]) +> default)) := by + have h := long_pending_return ds n k l default + simpa only [append_cons, append_nil, zero_cons_default'] using h + +def return_to (six : Bool) (older : Stack) (rs : Records) : Cfg (Fin 2) (Fin 6) := + if six then active older rs else restored older rs + +theorem finish_return (six : Bool) (older : Stack) (rs : Records) + (hl : stack_good older) (hr : Good (!six) rs) : + (returnCfg + (if six then (bit0 ^ 5) +> stack_side older else [0, 0] +> ((bit1 ^ 4) +> stack_side older)) + (records_side rs)) [tm24]⊢* (return_to six older rs) := by + rcases six with _ | _ + · simp only [return_to] + refine stepPlus_trans' (return_separator (stack_side older) (records_side rs) (records_zero hr)) + ?_ + exact stack_return older rs hl hr + · simp only [return_to, ↓reduceIte] + unfold active + rcases stack_zero older with ⟨l, hst⟩ + rw [hst] + have h6 : (bit0 ^ 5) +> ([0] +> l) = (bit0 ^ 6) +> l := by + simp [listPow_succ, bit0] + rw [h6] + exact return_six l (records_side rs) (records_zero hr) + +inductive Ready : Cfg (Fin 2) (Fin 6) → Prop where + | ReadyP (st : Stack) (rs : Records) : Source st rs → Ready (active st rs) + | ReadyCap (c : Cap) (rs : Records) : + Good true rs → measure (first_digits rs) ≤ 1 + cap_bound c → + Ready (cap_entry (cap_prefix c) (cap_height c) (records_side rs)) + +open Ready + +theorem cap_progress (c : Cap) (rs : Records) + (hr : Good true rs) (hm : measure (first_digits rs) ≤ 1 + cap_bound c) : + ∃ q, Ready q ∧ (cap_entry (cap_prefix c) (cap_height c) (records_side rs)) [tm24]⊢⁺ q := by + rcases cap_rule c hr hm with ⟨bs, rs', hb, hg, hv, hs⟩ + refine ⟨active (extend_stack bs (SCap (next_cap c))) rs', ?_, ?_⟩ + · refine ReadyP _ _ ⟨extend_good hb trivial, hg, ?_⟩ + rw [extend_protected, extend_cap] + exact hv + · unfold active + rw [extend_side] + exact hs + +theorem restored_ready (st : Stack) (rs : Records) + (hl : stack_good st) (hr : Good true rs) + (hm : measure (stack_protected st (first_digits rs)) ≤ cap_bound (stack_cap st)) : + Ready (restored st rs) := by + rcases restored_good st rs hl hr with ⟨st', rs', he, hl', hr', hc, hp⟩ | ⟨rs', he, hr', hp⟩ + · rw [he] + refine ReadyP st' rs' ⟨hl', hr', ?_⟩ + rw [hc, hp] + exact hm + · rw [he] + refine ReadyCap (stack_cap st) rs' hr' ?_ + rw [hp] + omega + +theorem carry_records_bound (p : Bool) {rs rs' : Records} + (ha : Advance rs [] rs') (hg : Good p rs) : + measure (first_digits rs') ≤ 1 + measure (first_digits rs) := by + cases ha with + | AEnd ds ds' hc => exact carry_bound hc (segment_length hg) + | AStop ds b ds' b' tail _ hc => exact carry_bound hc (segment_length hg.1) + +theorem ordinary_progress (st : Stack) (rs rs' : Records) + (hs : Source st rs) (ha : Advance rs [] rs') : + Ready (restored st rs') ∧ (active st rs) [tm24]⊢⁺ (restored st rs') := by + rcases hs with ⟨hl, hr, hm⟩ + refine ⟨?_, active_return hl hr ha⟩ + have hg : Good true rs' := carry_records_good false ha hr + rcases st with ⟨c⟩ | ⟨six, older, ds, n⟩ + · refine ReadyCap c rs' hg ?_ + have hb := carry_records_bound false ha hr + simp only [stack_protected, stack_cap] at hm + omega + · exact restored_ready (SPush six older ds n) rs' hl hg hm + +theorem constructor_progress (st : Stack) (ds : List Nat) (b : Nat) (rs : Records) + (hs : Source st (RMore ds b rs)) (hd : IsBinary ds) (hb : b = 1 ∨ b = 2) : + ∃ q, Ready q ∧ (active st (RMore ds b rs)) [tm24]⊢⁺ q := by + rcases hs with ⟨hl, ⟨hseg, hb13, hr⟩, hm⟩ + rcases active_constructor hl hseg hr hd hb with ⟨st', rs', hl', hr', hc, hp, ht⟩ + refine ⟨active st' rs', ReadyP st' rs' ⟨hl', hr', ?_⟩, ht⟩ + rw [hc, hp] + exact hm + +theorem return_to_ready (six : Bool) (older : Stack) (rs : Records) + (hl : stack_good older) (hr : Good (!six) rs) + (hm : measure (stack_protected older (first_digits rs)) ≤ cap_bound (stack_cap older)) : + Ready (return_to six older rs) := by + rcases six with _ | _ + · exact restored_ready older rs hl hr hm + · exact ReadyP older rs ⟨hl, hr, hm⟩ + +theorem long_constructor_progress (six : Bool) (older : Stack) (ds : List Nat) (n k : Nat) (rs : + Records) + (hs : Source (SPush six older ds n) (RMore (2 :: List.replicate k 0) 1 rs)) : + ∃ q, Ready q ∧ + (active (SPush six older ds n) (RMore (2 :: List.replicate k 0) 1 rs)) [tm24]⊢⁺ q := by + rcases hs with ⟨⟨hl, hb⟩, ⟨hseg, _, hr⟩, hm⟩ + rcases advance_total rs hr with ⟨bs, rs', ha, hbs, hg⟩ + refine ⟨active (extend_stack bs (SPush six older (merged ds n k) 0)) rs', ?_, ?_⟩ + · refine ReadyP _ _ ⟨extend_good hbs ⟨hl, merged_block six k hb hseg⟩, hg, ?_⟩ + rw [extend_cap, extend_protected] + simp only [stack_cap, stack_protected] at hm ⊢ + rw [stack_measure older (merged_measure ds n k (block_length hb))] + exact hm + · unfold active + rw [extend_side] + simp only [stack_side, records_side] + refine stepStar_trans' (long_pending ds n k + (if six then (bit0 ^ 5) +> stack_side older else [0, 0] +> ((bit1 ^ 4) +> stack_side older)) + ((bit0 ^ 1) +> ((bit1 ^ 7) +> records_side rs))) ?_ + exact advance_spec ha 1 (pending (merged ds n k) + (if six then (bit0 ^ 5) +> stack_side older else [0, + 0] +> ((bit1 ^ 4) +> stack_side older))) (Or.inl rfl) + +theorem long_end_progress (six : Bool) (older : Stack) (ds : List Nat) (n k : Nat) + (hs : Source (SPush six older ds n) (REnd (2 :: List.replicate (1 + k) 0))) : + ∃ q, Ready q ∧ + (active (SPush six older ds n) (REnd (2 :: List.replicate (1 + k) 0))) [tm24]⊢⁺ q := by + rcases hs with ⟨⟨hl, hb⟩, hseg, hm⟩ + have hg : Good (!six) (REnd (merged ds n k ++ [1])) := + merged_bump_segment six 0 k hb hseg (Or.inl rfl) + refine ⟨return_to six older (REnd (merged ds n k ++ [1])), ?_, ?_⟩ + · refine return_to_ready six older (REnd (merged ds n k ++ [1])) hl hg ?_ + simp only [first_digits, stack_protected, stack_cap] at hm ⊢ + rw [stack_measure older (bumped_measure ds n k (block_length hb))] + exact hm + · unfold active + simp only [stack_side, records_side] + refine step_right_default (long_pending_blank ds n k + (if six then (bit0 ^ 5) +> stack_side older else [0, + 0] +> ((bit1 ^ 4) +> stack_side older))) ?_ + exact finish_return six older (REnd (merged ds n k ++ [1])) hl hg + +theorem long_three_progress (six : Bool) (older : Stack) (ds : List Nat) (n k : Nat) (rs : Records) + (hs : Source (SPush six older ds n) (RMore (2 :: List.replicate (1 + k) 0) 3 rs)) : + ∃ q, Ready q ∧ + (active (SPush six older ds n) (RMore (2 :: List.replicate (1 + k) 0) 3 rs)) [tm24]⊢⁺ q := + by + rcases hs with ⟨⟨hl, hb⟩, ⟨hseg, _, hr⟩, hm⟩ + have hg : Good (!six) (RMore (merged ds n k ++ [1]) 1 rs) := + ⟨merged_bump_segment six 3 k hb hseg (Or.inr rfl), ⟨by omega, by omega⟩, hr⟩ + refine ⟨return_to six older (RMore (merged ds n k ++ [1]) 1 rs), ?_, ?_⟩ + · refine return_to_ready six older (RMore (merged ds n k ++ [1]) 1 rs) hl hg ?_ + simp only [first_digits, stack_protected, stack_cap] at hm ⊢ + rw [stack_measure older (bumped_measure ds n k (block_length hb))] + exact hm + · unfold active + simp only [stack_side, records_side] + have h03 : (bit0 ^ 3) +> ((bit1 ^ 7) +> records_side rs) = [0, 0, + 0] +> ((bit1 ^ 7) +> records_side rs) := rfl + rw [h03] + refine step_right_default (long_pending_return ds n k + (if six then (bit0 ^ 5) +> stack_side older else [0, 0] +> ((bit1 ^ 4) +> stack_side older)) + ((bit1 ^ 7) +> records_side rs)) ?_ + exact finish_return six older (RMore (merged ds n k ++ [1]) 1 rs) hl hg + +theorem source_progress (st : Stack) (rs : Records) (h : Source st rs) : + ∃ q, Ready q ∧ (active st rs) [tm24]⊢⁺ q := by + cases rs with + | REnd ds => + rcases h.2 with ⟨hs, hm⟩ + rcases segment_progress 0 ds hs (by omega) with ⟨k, rfl⟩ | ⟨ds', b', hc⟩ | ⟨_, hb⟩ + · rcases source_long_marked st 0 k hs hm with ⟨six, older, ds, n, rfl⟩ + rcases k with _ | k + · have hl := segment_length hs + simp at hl + · have hk1 : k + 1 = 1 + k := by omega + rw [hk1] at h ⊢ + exact long_end_progress six older ds n k h + · have hb' := carry_zero hc + subst hb' + rcases ordinary_progress st (REnd ds) (REnd ds') h (Advance.AEnd ds ds' hc) with ⟨hr, hstep⟩ + exact ⟨restored st (REnd ds'), hr, hstep⟩ + · omega + | RMore ds b rs => + rcases h.2 with ⟨⟨hs, hb, hr⟩, hm⟩ + rcases segment_progress b ds hs hb.2 with ⟨k, rfl⟩ | ⟨ds', b', hc⟩ | ⟨hd, hb12⟩ + · rcases source_long_marked st b k hs hm with ⟨six, older, ds, n, rfl⟩ + rcases long_segment b k hs hb.2 with ⟨rfl, _⟩ | ⟨hb13, _⟩ + · omega + · rcases hb13 with rfl | rfl + · exact long_constructor_progress six older ds n k rs h + · rcases k with _ | k + · have hl := segment_length hs + simp at hl + · have hk1 : k + 1 = 1 + k := by omega + rw [hk1] at h ⊢ + exact long_three_progress six older ds n k rs h + · rcases ordinary_progress st (RMore ds b rs) (RMore ds' b' rs) h + (Advance.AStop ds b ds' b' rs (by omega) hc) with ⟨hr', hstep⟩ + exact ⟨restored st (RMore ds' b' rs), hr', hstep⟩ + · exact constructor_progress st ds b rs h hd hb12 + +theorem ready_progress (q : Cfg (Fin 2) (Fin 6)) (h : Ready q) : + ∃ q', Ready q' ∧ q [tm24]⊢⁺ q' := by + cases h with + | ReadyP st rs hs => exact source_progress st rs hs + | ReadyCap c rs hr hm => exact cap_progress c rs hr hm + +theorem source_nonhalt {st : Stack} {rs : Records} (h : Source st rs) : + NeverHaltsFrom tm24 (active st rs) := by + refine NeverHaltsFrom.of_reachesPlus_invariant ?_ (ReadyP st rs h) + intro c hc + rcases ready_progress c hc with ⟨c', hc', hstep⟩ + exact ⟨c', hstep, hc'⟩ + +theorem neverHaltsFrom_of_reachesStar {M : Machine (Fin 2) (Fin 6)} {c₁ c₀ : Cfg (Fin 2) (Fin 6)} + (hinit : c₁ [M]⊢* c₀) (h_never : NeverHaltsFrom M c₀) : NeverHaltsFrom M c₁ := by + obtain ⟨k₀, hk₀⟩ := hinit + intro cfg ⟨k, hk⟩ + rcases Nat.lt_or_ge k k₀ with hlt | hge + · rcases hstep_cfg : step M cfg with _ | _ + · have hnone : (step M cfg).isNone := by simp [hstep_cfg] + have hnone_k₀ : multiStep M c₁ k₀ = none := by + have hsplit : k₀ = k + (k₀ - k) := by omega + rw [hsplit] + exact multiStep_eq_none_of_isNone hk hnone (by omega) + rw [hnone_k₀] at hk₀ + cases hk₀ + · rfl + · have hsplit : k = k₀ + (k - k₀) := by omega + rw [hsplit, BusyBeaver.multiStep_add, hk₀, Option.bind_some] at hk + exact h_never cfg ⟨k - k₀, hk⟩ + + +theorem isNotHalt_of_neverHaltsFrom {M : Machine (Fin 2) (Fin 6)} {c₀ : Cfg (Fin 2) (Fin 6)} + (hinit : (init []) [M]⊢* c₀) (h_never : NeverHaltsFrom M c₀) : IsNotHalt M := by + obtain ⟨k₀, hk₀⟩ := hinit + intro cfg ⟨k, hk⟩ + rcases Nat.lt_or_ge k k₀ with hlt | hge + · rcases hstep_cfg : step M cfg with _ | _ + · have hnone : (step M cfg).isNone := by simp [hstep_cfg] + have hnone_k₀ : multiStep M (init []) k₀ = none := by + have hsplit : k₀ = k + (k₀ - k) := by omega + rw [hsplit] + exact multiStep_eq_none_of_isNone hk hnone (by omega) + rw [hnone_k₀] at hk₀ + cases hk₀ + · rfl + · have hsplit : k = k₀ + (k - k₀) := by omega + rw [hsplit, BusyBeaver.multiStep_add, hk₀, Option.bind_some] at hk + exact h_never cfg ⟨k - k₀, hk⟩ + + + +end TM24Donor + +namespace M240 + +open BusyBeaver.Excursion +variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ] + +def tm240_machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_0RC0LD_1LA1RF_1LE1LD_1LB1RE_HHH1RA" + +abbrev tm : Machine (Fin 2) (Fin 6) := tm240_machine.toBB + +def qA : Fin 6 := 0 +def qB : Fin 6 := 1 +def qC : Fin 6 := 2 +def qD : Fin 6 := 3 +def qE : Fin 6 := 4 +def qF : Fin 6 := 5 + +abbrev T := ListBlank (Fin 2) + +def K (q : Fin 6) (L : T) (h : Fin 2) (R : T) : Cfg (Fin 2) (Fin 6) := ⟨some q, ⟨h, L, R⟩⟩ + +@[simp] theorem ms_zero (M : Machine Γ Λ) (c : Cfg Γ Λ) : multiStep M c 0 = some c := rfl +@[simp] theorem ms_one (M : Machine Γ Λ) (c : Cfg Γ Λ) : multiStep M c 1 = step M c := rfl +@[simp] theorem ms_succ (M : Machine Γ Λ) (c : Cfg Γ Λ) (n : ℕ) : + multiStep M c (n + 1) = Option.bind (multiStep M c n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +theorem ms_add (M : Machine Γ Λ) (c₁ : Cfg Γ Λ) (n m : ℕ) : + multiStep M c₁ (n + m) = (multiStep M c₁ n).bind (fun c₂ => multiStep M c₂ m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, ms_succ, ih, Option.bind_assoc] + simp_rw [ms_succ] + +theorem ms_trans (M : Machine Γ Λ) (c₁ c₂ c₃ : Cfg Γ Λ) (n m : ℕ) + (h₁ : c₁ [M]⊢^{n} c₂) (h₂ : c₂ [M]⊢^{m} c₃) : c₁ [M]⊢^{n+m} c₃ := by + rw [ms_add, h₁]; simp [h₂] + +theorem ss_refl (M : Machine Γ Λ) (c : Cfg Γ Λ) : c [M]⊢* c := ⟨0, rfl⟩ +theorem step_to_sp {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [M]⊢ c₂) : c₁ [M]⊢⁺ c₂ := + ⟨1, Nat.succ_pos 0, h⟩ +theorem stepN_to_ss {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} {n : ℕ} (h : c₁ [M]⊢^{n} c₂) : + c₁ [M]⊢* c₂ := ⟨n, h⟩ +theorem stepN_to_sp {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} {n : ℕ} (hn : 0 < n) + (h : c₁ [M]⊢^{n} c₂) : c₁ [M]⊢⁺ c₂ := ⟨n, hn, h⟩ +theorem sp_to_ss {M : Machine Γ Λ} {c₁ c₂ : Cfg Γ Λ} (h : c₁ [M]⊢⁺ c₂) : c₁ [M]⊢* c₂ := by + rcases h with ⟨n, _, hn⟩; exact ⟨n, hn⟩ +theorem ss_trans {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [M]⊢* c₂) (h₂ : c₂ [M]⊢* c₃) : c₁ [M]⊢* c₃ := by + rcases h₁ with ⟨n, hn⟩; rcases h₂ with ⟨m, hm⟩ + exact ⟨n + m, ms_trans M c₁ c₂ c₃ n m hn hm⟩ +theorem sp_ss_trans {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [M]⊢⁺ c₂) (h₂ : c₂ [M]⊢* c₃) : c₁ [M]⊢⁺ c₃ := by + rcases h₁ with ⟨n, hn_pos, hn⟩; rcases h₂ with ⟨m, hm⟩ + exact ⟨n + m, Nat.add_pos_left hn_pos m, ms_trans M c₁ c₂ c₃ n m hn hm⟩ +theorem ss_sp_trans {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [M]⊢* c₂) (h₂ : c₂ [M]⊢⁺ c₃) : c₁ [M]⊢⁺ c₃ := by + rcases h₁ with ⟨n, hn⟩; rcases h₂ with ⟨m, hm_pos, hm⟩ + exact ⟨n + m, Nat.add_pos_right n hm_pos, ms_trans M c₁ c₂ c₃ n m hn hm⟩ +theorem sp_trans {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [M]⊢⁺ c₂) (h₂ : c₂ [M]⊢⁺ c₃) : c₁ [M]⊢⁺ c₃ := + sp_ss_trans h₁ (sp_to_ss h₂) +theorem step_sp_trans {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} + (h₁ : c₁ [M]⊢ c₂) (h₂ : c₂ [M]⊢⁺ c₃) : c₁ [M]⊢⁺ c₃ := + sp_trans (step_to_sp h₁) h₂ +theorem ms_step {M : Machine Γ Λ} {c₁ c₂ c₃ : Cfg Γ Λ} {n : ℕ} + (h₁ : c₁ [M]⊢ c₂) (h₂ : c₂ [M]⊢^{n} c₃) : c₁ [M]⊢^{n + 1} c₃ := by + have := ms_trans M c₁ c₂ c₃ 1 n h₁ h₂ + rwa [Nat.add_comm 1 n] at this + +omit [Inhabited Γ] in +@[simp] theorem p_zero_list (l : List Γ) : l ^ (0 : ℕ) = [] := rfl +omit [Inhabited Γ] in +theorem p_succ_list (l : List Γ) (n : ℕ) : l ^ (n + 1) = l ++ l ^ n := rfl +omit [Inhabited Γ] in +@[simp] theorem l_pow_add (l : List Γ) (n m : ℕ) : l ^ (n + m) = l ^ n ++ l ^ m := by + induction n with + | zero => simp + | succ n ih => rw [Nat.succ_add, p_succ_list, p_succ_list, ih, List.append_assoc] +omit [Inhabited Γ] in +theorem p_succ_right (l : List Γ) (n : ℕ) : l ^ (n + 1) = l ^ n ++ l := by + rw [l_pow_add]; simp + +@[simp] theorem lb_append_nil (s : ListBlank Γ) : ([] : List Γ) +> s = s := rfl +@[simp] theorem lb_append_cons (a : Γ) (l : List Γ) (s : ListBlank Γ) : (a :: l) +> s = a >> (l +> + s) := rfl +@[simp] theorem lb_append_assoc (l₁ l₂ : List Γ) (s : ListBlank Γ) : (l₁ ++ l₂) +> s = l₁ +> (l₂ +> + s) := + Turing.ListBlank.append_assoc l₁ l₂ s +@[simp] theorem def_head : (default : T).head = 0 := rfl +@[simp] theorem def_tail : (default : T).tail = default := rfl +@[simp] theorem z_cons_def : (0 : Fin 2) >> (default : T) = default := by + change ListBlank.cons default default = default + exact ListBlank.cons_head_tail default +@[simp] theorem m_init_nil : (init ([] : List (Fin 2)) : Cfg (Fin 2) (Fin 6)) = + K qA default 0 default := rfl + +theorem pow1_succ (x : Fin 2) (n : ℕ) (s : T) : ([x] : List (Fin 2)) ^ (n + 1) +> + s = x >> (([x] : List (Fin 2)) ^ n +> s) := rfl +theorem pow1_succ' (x : Fin 2) (n : ℕ) (s : T) : ([x] : List (Fin 2)) ^ (n + 1) +> + s = ([x] : List (Fin 2)) ^ n +> (x >> s) := by + rw [p_succ_right, lb_append_assoc]; rfl +theorem pow1_add (x : Fin 2) (a b : ℕ) (s : T) : ([x] : List (Fin 2)) ^ (a + b) +> + s = ([x] : List (Fin 2)) ^ a +> (([x] : List (Fin 2)) ^ b +> s) := by + rw [l_pow_add, lb_append_assoc] +theorem pow_blk_succ (u : List (Fin 2)) (n : ℕ) (s : T) : u ^ (n + 1) +> s = u +> (u ^ n +> s) := by + rw [p_succ_list, lb_append_assoc] +theorem pow_blk_succ' (u : List (Fin 2)) (n : ℕ) (s : T) : u ^ (n + 1) +> s = u ^ n +> (u +> s) := + by + rw [p_succ_right, lb_append_assoc] +theorem pow_blk_add (u : List (Fin 2)) (a b : ℕ) (s : T) : u ^ (a + b) +> s = u ^ a +> (u ^ b +> + s) := by + rw [l_pow_add, lb_append_assoc] +@[simp] theorem zeros_default (n : ℕ) : ([0] : List (Fin 2)) ^ n +> (default : T) = default := by + induction n with + | zero => rfl + | succ n ih => rw [pow1_succ, ih, z_cons_def] + +macro "step1" : tactic => `(tactic| ( + try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, K, m_init_nil, p_succ_list, + p_zero_list, Nat.mul_zero, Nat.zero_add, Nat.add_zero, Nat.mul_one, + List.singleton_append, List.nil_append, List.cons_append, + lb_append_cons, lb_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + z_cons_def, def_head, def_tail] + refine ms_step (by rfl) ?_ + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Tape.write, + lb_append_cons, lb_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + z_cons_def, def_head, def_tail])) + +macro "run_steps" n:num : tactic => `(tactic| ( + iterate $n step1 + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, K, p_succ_list, p_zero_list, + Nat.mul_zero, Nat.zero_add, Nat.add_zero, Nat.mul_one, + List.singleton_append, List.nil_append, List.cons_append, + lb_append_cons, lb_append_nil, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, + z_cons_def, def_head, def_tail, ms_zero] + rfl)) + +-- --------------------------------------------------------------------------- +-- Elementary runs & bounce lemmas +-- --------------------------------------------------------------------------- + +theorem a1_run (k : ℕ) (L R : T) : + (K qA L 1 (([1] : List (Fin 2)) ^ k +> + ((0 : Fin 2) >> R))) [tm]⊢⁺ K qA (([0] : List (Fin 2)) ^ (k + 1) +> L) 0 R := by + induction k generalizing L with + | zero => exact ⟨1, by decide, by run_steps 1⟩ + | succ k ih => + have h1 : (K qA L 1 (([1] : List (Fin 2)) ^ (k + 1) +> ((0 : Fin 2) >> R))) [tm]⊢^{1} + K qA ((0 : Fin 2) >> L) 1 (([1] : List (Fin 2)) ^ k +> ((0 : Fin 2) >> R)) := by run_steps 1 + refine step_sp_trans h1 ?_ + have h2 := ih ((0 : Fin 2) >> L) + rwa [← pow1_succ'] at h2 + +theorem d1_run (k : ℕ) (L R : T) (s : Fin 2) : + (K qD (([1] : List (Fin 2)) ^ k +> + (s >> L)) 1 R) [tm]⊢⁺ K qD L s (([1] : List (Fin 2)) ^ (k + 1) +> R) := by + induction k generalizing R with + | zero => exact ⟨1, by decide, by run_steps 1⟩ + | succ k ih => + have h1 : (K qD (([1] : List (Fin 2)) ^ (k + 1) +> (s >> L)) 1 R) [tm]⊢^{1} + K qD (([1] : List (Fin 2)) ^ k +> (s >> L)) 1 ((1 : Fin 2) >> R) := by run_steps 1 + refine step_sp_trans h1 ?_ + have h2 := ih ((1 : Fin 2) >> R) + rwa [← pow1_succ'] at h2 + +theorem e1_run (k : ℕ) (L R : T) : + (K qE L 1 (([1] : List (Fin 2)) ^ k +> + ((0 : Fin 2) >> R))) [tm]⊢⁺ K qE (([1] : List (Fin 2)) ^ (k + 1) +> L) 0 R := by + induction k generalizing L with + | zero => exact ⟨1, by decide, by run_steps 1⟩ + | succ k ih => + have h1 : (K qE L 1 (([1] : List (Fin 2)) ^ (k + 1) +> ((0 : Fin 2) >> R))) [tm]⊢^{1} + K qE ((1 : Fin 2) >> L) 1 (([1] : List (Fin 2)) ^ k +> ((0 : Fin 2) >> R)) := by run_steps 1 + refine step_sp_trans h1 ?_ + have h2 := ih ((1 : Fin 2) >> L) + rwa [← pow1_succ'] at h2 + +theorem b1_walk (a : ℕ) (s : Fin 2) (L R : T) : + (K qB (([1] : List (Fin 2)) ^ a +> (s >> L)) 1 R) [tm]⊢⁺ K qD L s (([1] : List (Fin 2)) ^ a +> + ((0 : Fin 2) >> R)) := by + cases a with + | zero => exact ⟨1, by decide, by run_steps 1⟩ + | succ a => + have h1 : (K qB (([1] : List (Fin 2)) ^ (a + 1) +> (s >> L)) 1 R) [tm]⊢^{1} + K qD (([1] : List (Fin 2)) ^ a +> (s >> L)) 1 ((0 : Fin 2) >> R) := by run_steps 1 + exact step_sp_trans h1 (d1_run a L ((0 : Fin 2) >> R) s) + +theorem b1_zero_one (a : ℕ) (Rest R : T) : + (K qB (([1] : List (Fin 2)) ^ a +> ((0 : Fin 2) >> (1 : Fin 2) >> Rest)) 1 R) [tm]⊢⁺ + K qB (([1] : List (Fin 2)) ^ (a + 1) +> Rest) 1 ((1 : Fin 2) >> R) := by + refine sp_trans (b1_walk a 0 ((1 : Fin 2) >> Rest) R) ?_ + have h1 : (K qD ((1 : Fin 2) >> Rest) 0 (([1] : List (Fin 2)) ^ a +> + ((0 : Fin 2) >> R))) [tm]⊢^{1} + K qE Rest 1 (([1] : List (Fin 2)) ^ (a + 1) +> ((0 : Fin 2) >> R)) := by run_steps 1 + refine step_sp_trans h1 ?_ + refine sp_ss_trans (e1_run (a + 1) Rest R) ?_ + refine stepN_to_ss (n := 1) ?_ + rw [pow1_succ (1 : Fin 2) (a + 1)] + run_steps 1 + +theorem b1_two_zeros_one (a : ℕ) (Rest R : T) : + (K qB (([1] : List (Fin 2)) ^ a +> + ((0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> Rest)) 1 R) [tm]⊢⁺ + K qB Rest 1 (([1] : List (Fin 2)) ^ (a + 2) +> ((0 : Fin 2) >> R)) := by + refine sp_ss_trans (b1_walk a 0 ((0 : Fin 2) >> (1 : Fin 2) >> Rest) R) ?_ + refine stepN_to_ss (n := 2) ?_ + rw [pow1_succ, pow1_succ] + run_steps 2 + +theorem b1_three_zeros (a : ℕ) (Rest R : T) : + (K qB (([1] : List (Fin 2)) ^ (a + 1) +> + ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> Rest)) 1 R) [tm]⊢⁺ + K qA (([0] : List (Fin 2)) ^ (a + 1) +> + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> Rest)) 0 R := by + refine sp_trans (b1_walk (a + 1) 0 ((0 : Fin 2) >> (0 : Fin 2) >> Rest) R) ?_ + have h1 : (K qD ((0 : Fin 2) >> (0 : Fin 2) >> Rest) 0 (([1] : List (Fin 2)) ^ (a + 1) +> + ((0 : Fin 2) >> R))) [tm]⊢^{5} + K qA ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> Rest) 1 (([1] : List (Fin 2)) ^ a +> + ((0 : Fin 2) >> R)) := by + rw [pow1_succ]; run_steps 5 + exact ss_sp_trans (stepN_to_ss h1) (a1_run a _ R) + +theorem a0_zero_R (c : ℕ) (L R : T) : + (K qA L 0 ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (c + 3) +> ((0 : Fin 2) >> R)))) [tm]⊢⁺ + K qA (([0] : List (Fin 2)) ^ (c + 1) +> + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> L)) 0 R := by + have h1 : (K qA L 0 ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (c + 3) +> + ((0 : Fin 2) >> R)))) [tm]⊢^{4} + K qA ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + L) 1 (([1] : List (Fin 2)) ^ c +> ((0 : Fin 2) >> R)) := by + rw [pow1_succ, pow1_succ, pow1_succ]; run_steps 4 + exact ss_sp_trans (stepN_to_ss h1) (a1_run c _ R) + +theorem a0_step (L R : T) : (K qA L 0 ((1 : Fin 2) >> R)) [tm]⊢^{1} K qB ((1 : Fin 2) >> L) 1 R := + by + run_steps 1 + +def EBounce (j : ℕ) (s : Fin 2) (L' R' : T) : Cfg (Fin 2) (Fin 6) := + K qE L' s (([1] : List (Fin 2)) ^ (2 * j + 2) +> ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ j +> + R'))) + +theorem ebounce_to_B1 (j : ℕ) (L' R' : T) : + (EBounce j 1 L' R') [tm]⊢⁺ K qB (([1] : List (Fin 2)) ^ (2 * j + 2) +> + L') 1 (([1] : List (Fin 2)) ^ (j + 1) +> R') := by + unfold EBounce + refine sp_ss_trans (e1_run (2 * j + 2) L' _) ?_ + refine stepN_to_ss (n := 1) ?_ + rw [pow1_succ (1 : Fin 2) (2 * j + 2), pow1_succ (1 : Fin 2) j] + run_steps 1 + +theorem ebounce_one (j : ℕ) (s : Fin 2) (L' R' : T) : + (EBounce j 1 ((1 : Fin 2) >> (0 : Fin 2) >> s >> L') R') [tm]⊢⁺ EBounce (j + 1) s L' R' := by + refine sp_trans (ebounce_to_B1 j _ R') ?_ + rw [← pow1_succ'] + refine sp_ss_trans (b1_walk (2 * j + 3) 0 (s >> L') _) ?_ + refine stepN_to_ss (n := 1) ?_ + unfold EBounce + have e1 : 2 * (j + 1) + 2 = (2 * j + 3) + 1 := by ring + rw [e1, pow1_succ (1 : Fin 2) (2 * j + 3)] + run_steps 1 + +theorem ebounce_zero (j : ℕ) (L₀ R' : T) : + (EBounce j 0 ((0 : Fin 2) >> L₀) R') [tm]⊢⁺ + K qA (([0] : List (Fin 2)) ^ (2 * j + 1) +> + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L₀)) 0 (([1] : List (Fin 2)) ^ j +> R') := + by + unfold EBounce + have h1 : (K qE ((0 : Fin 2) >> L₀) 0 (([1] : List (Fin 2)) ^ (2 * j + 2) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ j +> R')))) [tm]⊢^{4} + K qA ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> L₀) 1 (([1] : List (Fin 2)) ^ (2 * j) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ j +> R'))) := by + rw [pow1_succ (1 : Fin 2) (2 * j + 1), pow1_succ (1 : Fin 2) (2 * j)]; run_steps 4 + exact ss_sp_trans (stepN_to_ss h1) (a1_run (2 * j) _ _) + +theorem e0_to_B1 (j : ℕ) (L' R' : T) : + (EBounce j 0 ((1 : Fin 2) >> L') R') [tm]⊢^{1} K qB L' 1 (([1] : List (Fin 2)) ^ (2 * j + 3) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ j +> R'))) := by + unfold EBounce + rw [pow1_succ (1 : Fin 2) (2 * j + 2)] + run_steps 1 + +theorem a0_odd_zeros (j : ℕ) : ∀ (s : Fin 2) (L' R' : T), + (K qA (([0] : List (Fin 2)) ^ (2 * j + 1) +> (s >> L')) 0 (([1] : List (Fin 2)) ^ (j + 1) +> + R')) [tm]⊢⁺ + EBounce j s L' R' := by + induction j with + | zero => + intro s L' R' + exact ⟨4, by decide, by unfold EBounce; run_steps 4⟩ + | succ j ih => + intro s L' R' + have e1 : 2 * (j + 1) + 1 = (2 * j + 1) + 1 + 1 := by ring + rw [e1, pow1_succ' (0 : Fin 2) (2 * j + 1 + 1), pow1_succ' (0 : Fin 2) (2 * j + 1), + pow1_succ' (1 : Fin 2) (j + 1)] + refine sp_trans (ih 0 ((0 : Fin 2) >> s >> L') ((1 : Fin 2) >> R')) ?_ + refine sp_trans (ebounce_zero j (s >> L') ((1 : Fin 2) >> R')) ?_ + rw [← pow1_succ' (1 : Fin 2) j] + refine sp_trans (ih 1 ((1 : Fin 2) >> (0 : Fin 2) >> s >> L') R') ?_ + exact ebounce_one j s L' R' + +theorem a0_cascade (k : ℕ) : ∀ (Lrem R' : T), + (K qA (([0] : List (Fin 2)) ^ (2 * k + 1) +> + ((1 : Fin 2) >> (1 : Fin 2) >> Lrem)) 0 (([1] : List (Fin 2)) ^ k +> R')) [tm]⊢* + K qA (([0, 1, 1] : List (Fin 2)) ^ (k + 1) +> Lrem) 0 R' := by + induction k with + | zero => intro Lrem R'; exact ss_refl _ _ + | succ k ih => + intro Lrem R' + have e1 : 2 * (k + 1) + 1 = (2 * k + 1) + 1 + 1 := by ring + rw [e1, pow1_succ' (0 : Fin 2) (2 * k + 1 + 1), pow1_succ' (0 : Fin 2) (2 * k + 1)] + refine ss_trans (sp_to_ss (a0_odd_zeros k 0 ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + Lrem) R')) ?_ + refine ss_trans (sp_to_ss (ebounce_zero k ((1 : Fin 2) >> (1 : Fin 2) >> Lrem) R')) ?_ + have h := ih ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> Lrem) R' + rw [pow_blk_succ' ([0, 1, 1] : List (Fin 2)) (k + 1)] + exact h + +theorem b1_zero_one_run (w : ℕ) : ∀ (a m : ℕ) (Rest R' : T), + (K qB (([1] : List (Fin 2)) ^ (a + 1) +> (([0, 1, + 1] : List (Fin 2)) ^ w +> Rest)) 1 (([1] : List (Fin 2)) ^ m +> R')) [tm]⊢* + K qB (([1] : List (Fin 2)) ^ (a + 2 * w + 1) +> Rest) 1 (([1] : List (Fin 2)) ^ (m + w) +> + R') := by + induction w with + | zero => intro a m Rest R'; exact ss_refl _ _ + | succ w ih => + intro a m Rest R' + rw [pow_blk_succ ([0, 1, 1] : List (Fin 2)) w] + simp only [lb_append_cons, lb_append_nil] + refine ss_trans (sp_to_ss (b1_zero_one (a + 1) _ _)) ?_ + rw [← pow1_succ' (1 : Fin 2) (a + 1 + 1), ← pow1_succ (1 : Fin 2) m] + have h := ih (a + 2) (m + 1) Rest R' + have e1 : a + 2 + 2 * w + 1 = a + 2 * (w + 1) + 1 := by ring + have e2 : m + 1 + w = m + (w + 1) := by ring + have e0 : a + 2 + 1 = a + 1 + 1 + 1 := rfl + rw [e0, e1, e2] at h + exact h + +theorem m_round (j : ℕ) (L R : T) : + (K qB (([1] : List (Fin 2)) ^ (2 * j + 1) +> + ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> L)) 1 (([1] : List (Fin 2)) ^ (j + 1) +> + R)) [tm]⊢⁺ + K qB (([1] : List (Fin 2)) ^ (2 * j + 3) +> + ((0 : Fin 2) >> L)) 1 (([1] : List (Fin 2)) ^ (j + 1) +> R) := by + refine sp_trans (b1_three_zeros (2 * j) L _) ?_ + refine sp_trans (a0_odd_zeros j 1 ((1 : Fin 2) >> (0 : Fin 2) >> L) R) ?_ + have h := ebounce_to_B1 j ((1 : Fin 2) >> (0 : Fin 2) >> L) R + rw [← pow1_succ' (1 : Fin 2) (2 * j + 2)] at h + exact h + +theorem m_rounds (n : ℕ) : ∀ (j : ℕ) (L R : T), + (K qB (([1] : List (Fin 2)) ^ (2 * j + 1) +> (([0] : List (Fin 2)) ^ (2 * n + 2) +> + L)) 1 (([1] : List (Fin 2)) ^ (j + n) +> R)) [tm]⊢* + K qB (([1] : List (Fin 2)) ^ (2 * j + 2 * n + 1) +> + ((0 : Fin 2) >> (0 : Fin 2) >> L)) 1 (([1] : List (Fin 2)) ^ (j + n) +> R) := by + induction n with + | zero => intro j L R; exact ss_refl _ _ + | succ n ih => + intro j L R + have e1 : 2 * (n + 1) + 2 = (2 * n + 1) + 1 + 1 + 1 := by ring + rw [e1, pow1_succ (0 : Fin 2), pow1_succ (0 : Fin 2), pow1_succ (0 : Fin 2)] + have e2 : j + (n + 1) = (j + 1) + n := by ring + rw [e2, pow1_add (1 : Fin 2) (j + 1) n] + refine ss_trans (sp_to_ss (m_round j _ _)) ?_ + have h := ih (j + 1) L R + have e3 : 2 * (j + 1) + 1 = 2 * j + 3 := by ring + have e4 : 2 * (j + 1) + 2 * n + 1 = 2 * j + 2 * (n + 1) + 1 := by ring + have e5 : 2 * n + 2 = (2 * n + 1) + 1 := rfl + rw [e3, e4, e5, pow1_succ (0 : Fin 2) (2 * n + 1), pow1_add (1 : Fin 2) (j + 1) n] at h + exact h + +theorem fixed89 (Lrem : T) : + (K qA (([0, 1, 1] : List (Fin 2)) ^ 5 +> Lrem) 0 default) [tm]⊢^{89} + K qB (([1] : List (Fin 2)) ^ 12 +> Lrem) 1 (([1] : List (Fin 2)) ^ 5 +> default) := by + run_steps 89 + +theorem fixed23 (Rest : T) : + (K qA ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> Rest) 0 default) [tm]⊢^{23} + K qB ((1 : Fin 2) >> (0 : Fin 2) >> Rest) 1 (([1] : List (Fin 2)) ^ 4 +> default) := by + run_steps 23 + +-- --------------------------------------------------------------------------- +-- Two-stack configuration family & 17 macro rules +-- --------------------------------------------------------------------------- + +def encL : List (ℕ × ℕ) → T + | [] => default + | (z, w) :: l => ([0] : List (Fin 2)) ^ (z + 1) +> + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (([0, 1, + 1] : List (Fin 2)) ^ (w + 5) +> encL l)) + +def encS : List ℕ → T + | [] => default + | b :: s => (0 : Fin 2) >> (([1] : List (Fin 2)) ^ b +> encS s) + +@[simp] theorem encL_nil : encL [] = default := rfl +@[simp] theorem encL_cons (z w : ℕ) (l : List (ℕ × ℕ)) : encL ((z, + w) :: l) = ([0] : List (Fin 2)) ^ (z + 1) +> + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (([0, 1, + 1] : List (Fin 2)) ^ (w + 5) +> encL l)) := rfl +@[simp] theorem encS_nil : encS [] = default := rfl +@[simp] theorem encS_cons (b : ℕ) (s : List ℕ) : encS (b :: s) = (0 : Fin 2) >> + (([1] : List (Fin 2)) ^ b +> encS s) := rfl + +def Beq (m : ℕ) (l : List (ℕ × ℕ)) : Cfg (Fin 2) (Fin 6) := + K qB (([1] : List (Fin 2)) ^ (2 * m + 2) +> encL l) 1 (([1] : List (Fin 2)) ^ m +> default) +def Bev (j : ℕ) (l : List (ℕ × ℕ)) (m : ℕ) (s : List ℕ) : Cfg (Fin 2) (Fin 6) := + K qB (([1] : List (Fin 2)) ^ (2 * j + 1) +> encL l) 1 (([1] : List (Fin 2)) ^ m +> encS s) +def Bodd (k : ℕ) (l : List (ℕ × ℕ)) (m : ℕ) (s : List ℕ) : Cfg (Fin 2) (Fin 6) := + K qB (([1] : List (Fin 2)) ^ (2 * k + 10) +> encL l) 1 (([1] : List (Fin 2)) ^ m +> encS s) +def Amega (z w : ℕ) (l : List (ℕ × ℕ)) (m : ℕ) (s : List ℕ) : Cfg (Fin 2) (Fin 6) := + K qA (encL ((z, w) :: l)) 0 (([1] : List (Fin 2)) ^ m +> encS s) +def Bounce (w : ℕ) (l : List (ℕ × ℕ)) (s : List ℕ) : Cfg (Fin 2) (Fin 6) := + K qA (([0, 1, 1] : List (Fin 2)) ^ (w + 5) +> encL l) 0 (encS s) + +theorem default3 : (default : T) = (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> default := by simp +theorem zeros3 (n : ℕ) (X : T) : ([0] : List (Fin 2)) ^ (n + 3) +> + X = (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (([0] : List (Fin 2)) ^ n +> X) := rfl +theorem zeros3' (n : ℕ) (X : T) : ([0] : List (Fin 2)) ^ (n + 3) +> X = ([0] : List (Fin 2)) ^ n +> + ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> X) := by + rw [pow1_add]; rfl +theorem zeros2 (n : ℕ) (X : T) : ([0] : List (Fin 2)) ^ (n + 2) +> + X = (0 : Fin 2) >> (0 : Fin 2) >> (([0] : List (Fin 2)) ^ n +> X) := rfl +theorem zeros1 (n : ℕ) (X : T) : ([0] : List (Fin 2)) ^ (n + 1) +> + X = (0 : Fin 2) >> (([0] : List (Fin 2)) ^ n +> X) := rfl +theorem ones1 (n : ℕ) (X : T) : ([1] : List (Fin 2)) ^ (n + 1) +> + X = (1 : Fin 2) >> (([1] : List (Fin 2)) ^ n +> X) := rfl +theorem ones1' (n : ℕ) (X : T) : ([1] : List (Fin 2)) ^ (n + 1) +> X = ([1] : List (Fin 2)) ^ n +> + ((1 : Fin 2) >> X) := pow1_succ' 1 n X +theorem ones_one (X : T) : ([1] : List (Fin 2)) ^ 1 +> X = (1 : Fin 2) >> X := rfl +theorem ones_add (a b : ℕ) (X : T) : ([1] : List (Fin 2)) ^ (a + b) +> + X = ([1] : List (Fin 2)) ^ a +> (([1] : List (Fin 2)) ^ b +> X) := pow1_add 1 a b X +theorem blk_add (a b : ℕ) (X : T) : ([0, 1, 1] : List (Fin 2)) ^ (a + b) +> X = ([0, 1, + 1] : List (Fin 2)) ^ a +> (([0, 1, 1] : List (Fin 2)) ^ b +> X) := pow_blk_add _ a b X + +theorem R4 (j r z w : ℕ) (l' : List (ℕ × ℕ)) (s : List ℕ) : + (Bev j ((z + 2, w) :: l') (j + 1 + r) s) [tm]⊢⁺ Bev (j + 1) ((z, w) :: l') (j + 1 + r) s := by + unfold Bev + rw [encL_cons, encL_cons, zeros3, zeros1, ones_add (j + 1) r] + have h := + m_round j (([0] : List (Fin 2)) ^ z +> + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (([0, 1, + 1] : List (Fin 2)) ^ (w + 5) +> encL l'))) + (([1] : List (Fin 2)) ^ r +> encS s) + have e : 2 * (j + 1) + 1 = 2 * j + 3 := by ring + rw [e]; exact h + +theorem R4nil (j r : ℕ) (s : List ℕ) : + (Bev j [] (j + 1 + r) s) [tm]⊢⁺ Bev (j + 1) [] (j + 1 + r) s := by + unfold Bev + rw [encL_nil, default3, ones_add (j + 1) r] + have h := m_round j default (([1] : List (Fin 2)) ^ r +> encS s) + have e : 2 * (j + 1) + 1 = 2 * j + 3 := by ring + rw [e] + simp only [z_cons_def] at h ⊢ + exact h + +theorem R5 (m z w : ℕ) (l' : List (ℕ × ℕ)) (s : List ℕ) : + (Bev (m + 4) ((z + 2, w) :: l') (m + 4) s) [tm]⊢⁺ Bounce m ((z, w) :: l') s := by + unfold Bev Bounce + rw [encL_cons, encL_cons, zeros3, zeros1] + refine sp_ss_trans (b1_three_zeros (2 * (m + 4)) _ _) ?_ + have h := + a0_cascade (m + 4) ((0 : Fin 2) >> (([0] : List (Fin 2)) ^ z +> + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (([0, 1, + 1] : List (Fin 2)) ^ (w + 5) +> encL l')))) (encS s) + have e : m + 4 + 1 = m + 5 := by ring + rw [e] at h; exact h + +theorem R5nil (m : ℕ) (s : List ℕ) : + (Bev (m + 4) [] (m + 4) s) [tm]⊢⁺ Bounce m [] s := by + unfold Bev Bounce + rw [encL_nil, default3] + refine sp_ss_trans (b1_three_zeros (2 * (m + 4)) _ _) ?_ + have h := a0_cascade (m + 4) ((0 : Fin 2) >> default) (encS s) + have e : m + 4 + 1 = m + 5 := by ring + rw [e] at h + simp only [z_cons_def] at h ⊢ + exact h + +theorem pop_frame0 (a m w : ℕ) (l' : List (ℕ × ℕ)) (R' : T) : + (K qB (([1] : List (Fin 2)) ^ a +> encL ((0, + w) :: l')) 1 (([1] : List (Fin 2)) ^ m +> R')) [tm]⊢⁺ + K qB (([1] : List (Fin 2)) ^ (a + 2 * w + 13) +> + encL l') 1 (([1] : List (Fin 2)) ^ (m + w + 7) +> R') := by + rw [encL_cons, zeros1, p_zero_list, lb_append_nil] + refine sp_trans (b1_zero_one a _ _) ?_ + rw [← ones1' (a + 1)] + refine sp_ss_trans (b1_zero_one (a + 2) _ _) ?_ + rw [← ones1 m, ← ones1 (m + 1)] + have h := b1_zero_one_run (w + 5) (a + 2) (m + 2) (encL l') R' + have e1 : a + 2 + 2 * (w + 5) + 1 = a + 2 * w + 13 := by ring + have e2 : m + 2 + (w + 5) = m + w + 7 := by ring + have e3 : m + 2 = m + 1 + 1 := rfl + rw [e1, e2, e3] at h + exact h + +theorem pop_frame1 (a m w : ℕ) (l' : List (ℕ × ℕ)) (R' : T) : + (K qB (([1] : List (Fin 2)) ^ a +> encL ((1, + w) :: l')) 1 (([1] : List (Fin 2)) ^ m +> R')) [tm]⊢⁺ + K qB (([1] : List (Fin 2)) ^ (2 * w + 12) +> encL l') 1 (([1] : List (Fin 2)) ^ (a + w + 8) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ m +> R'))) := by + rw [encL_cons, zeros2, p_zero_list, lb_append_nil] + refine sp_trans (b1_two_zeros_one a _ _) ?_ + have h1 := + b1_zero_one 1 (([0, 1, + 1] : List (Fin 2)) ^ (w + 5) +> encL l') (([1] : List (Fin 2)) ^ (a + 2) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ m +> R'))) + rw [pow1_succ (1 : Fin 2) 0, p_zero_list, lb_append_nil] at h1 + refine sp_ss_trans h1 ?_ + rw [← ones1 (a + 2)] + have h := + b1_zero_one_run (w + 5) 1 (a + 2 + 1) (encL l') ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ m +> + R')) + have e1 : 1 + 2 * (w + 5) + 1 = 2 * w + 12 := by ring + have e2 : a + 2 + 1 + (w + 5) = a + w + 8 := by ring + rw [e1, e2] at h + exact h + +theorem R2 (m w : ℕ) (l' : List (ℕ × ℕ)) : + (Beq m ((0, w) :: l')) [tm]⊢⁺ Bev (m + w + 7) l' (m + w + 7) [] := by + unfold Beq Bev + have h := pop_frame0 (2 * m + 2) m w l' default + have e : 2 * m + 2 + 2 * w + 13 = 2 * (m + w + 7) + 1 := by ring + rw [e] at h; rw [encS_nil]; exact h + +theorem R3 (m w : ℕ) (l' : List (ℕ × ℕ)) : + (Beq m ((1, w) :: l')) [tm]⊢⁺ Bodd (w + 1) l' (2 * m + w + 10) [m] := by + unfold Beq Bodd + have h := pop_frame1 (2 * m + 2) m w l' default + have e1 : 2 * m + 2 + w + 8 = 2 * m + w + 10 := by ring + have e2 : 2 * w + 12 = 2 * (w + 1) + 10 := by ring + rw [e1, e2] at h; rw [encS_cons, encS_nil]; exact h + +theorem R6 (j m w : ℕ) (l' : List (ℕ × ℕ)) (s : List ℕ) : + (Bev j ((0, w) :: l') m s) [tm]⊢⁺ Bodd (j + w + 2) l' (m + w + 7) s := by + unfold Bev Bodd + have h := pop_frame0 (2 * j + 1) m w l' (encS s) + have e : 2 * j + 1 + 2 * w + 13 = 2 * (j + w + 2) + 10 := by ring + rw [e] at h; exact h + +theorem R7 (j m w : ℕ) (l' : List (ℕ × ℕ)) (s : List ℕ) : + (Bev j ((1, w) :: l') m s) [tm]⊢⁺ Bodd (w + 1) l' (2 * j + w + 9) (m :: s) := by + unfold Bev Bodd + have h := pop_frame1 (2 * j + 1) m w l' (encS s) + have e1 : 2 * j + 1 + w + 8 = 2 * j + w + 9 := by ring + have e2 : 2 * w + 12 = 2 * (w + 1) + 10 := by ring + rw [e1, e2] at h; rw [encS_cons]; exact h + +theorem R8a (k m w : ℕ) (l' : List (ℕ × ℕ)) (s : List ℕ) : + (Bodd k ((0, w) :: l') m s) [tm]⊢⁺ Bev (k + w + 11) l' (m + w + 7) s := by + unfold Bodd Bev + have h := pop_frame0 (2 * k + 10) m w l' (encS s) + have e : 2 * k + 10 + 2 * w + 13 = 2 * (k + w + 11) + 1 := by ring + rw [e] at h; exact h + +theorem R8b (k m w : ℕ) (l' : List (ℕ × ℕ)) (s : List ℕ) : + (Bodd k ((1, w) :: l') m s) [tm]⊢⁺ Bodd (w + 1) l' (2 * k + w + 18) (m :: s) := by + unfold Bodd + have h := pop_frame1 (2 * k + 10) m w l' (encS s) + have e1 : 2 * k + 10 + w + 8 = 2 * k + w + 18 := by ring + have e2 : 2 * w + 12 = 2 * (w + 1) + 10 := by ring + rw [e1, e2] at h; rw [encS_cons]; exact h + +theorem R8 (k r z w : ℕ) (l' : List (ℕ × ℕ)) (s : List ℕ) : + (Bodd k ((z + 2, w) :: l') (k + 5 + r) s) [tm]⊢⁺ Bev 0 ((z, + w) :: l') (2 * k + 11) ((k + 4 + r) :: s) := by + unfold Bodd Bev + rw [encL_cons, encL_cons, zeros3, zeros1, encS_cons] + have e0 : 2 * k + 10 = (2 * k + 9) + 1 := by ring + rw [e0] + refine sp_trans (b1_three_zeros (2 * k + 9) _ _) ?_ + rw [show k + 5 + r = (k + 4 + r) + 1 by ring, ones1 (k + 4 + r)] + refine ss_sp_trans (stepN_to_ss (a0_step _ _)) ?_ + have e1 : 2 * k + 9 + 1 = 2 * (k + 4) + 2 := by ring + rw [e1] + have hr := + m_rounds (k + 4) 0 ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (([0] : List (Fin 2)) ^ z +> + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (([0, 1, + 1] : List (Fin 2)) ^ (w + 5) +> encL l')))) + (([1] : List (Fin 2)) ^ r +> encS s) + rw [← ones_add (0 + (k + 4)) r] at hr + simp only [Nat.zero_add, Nat.mul_zero, ones_one] at hr + refine ss_sp_trans hr ?_ + have h := + b1_two_zeros_one (2 * (k + 4) + 1) ((1 : Fin 2) >> (0 : Fin 2) >> (([0] : List (Fin 2)) ^ z +> + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (([0, 1, + 1] : List (Fin 2)) ^ (w + 5) +> encL l')))) (([1] : List (Fin 2)) ^ (k + 4 + r) +> encS s) + have e2 : 2 * (k + 4) + 1 + 2 = 2 * k + 11 := by ring + rw [e2] at h + simp only [Nat.mul_zero, Nat.zero_add, ones_one] + exact h + +theorem R8nil (k r : ℕ) (s : List ℕ) : + (Bodd k [] (k + 5 + r) s) [tm]⊢⁺ Bev 0 [] (2 * k + 11) ((k + 4 + r) :: s) := by + unfold Bodd Bev + rw [encL_nil, default3, encS_cons] + have e0 : 2 * k + 10 = (2 * k + 9) + 1 := by ring + rw [e0] + refine sp_trans (b1_three_zeros (2 * k + 9) _ _) ?_ + rw [show k + 5 + r = (k + 4 + r) + 1 by ring, ones1 (k + 4 + r)] + refine ss_sp_trans (stepN_to_ss (a0_step _ _)) ?_ + have e1 : 2 * k + 9 + 1 = 2 * (k + 4) + 2 := by ring + rw [e1] + have hr := + m_rounds (k + 4) 0 ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + default) (([1] : List (Fin 2)) ^ r +> encS s) + rw [← ones_add (0 + (k + 4)) r] at hr + simp only [Nat.zero_add, Nat.mul_zero, ones_one] at hr + refine ss_sp_trans hr ?_ + have h := + b1_two_zeros_one (2 * (k + 4) + 1) ((1 : Fin 2) >> (0 : Fin 2) >> + default) (([1] : List (Fin 2)) ^ (k + 4 + r) +> encS s) + have e2 : 2 * (k + 4) + 1 + 2 = 2 * k + 11 := by ring + rw [e2] at h + simp only [Nat.mul_zero, Nat.zero_add, ones_one, z_cons_def] at h ⊢ + exact h + +theorem R1 (m z w : ℕ) (l' : List (ℕ × ℕ)) : + (Beq (m + 5) ((z + 2, w) :: l')) [tm]⊢⁺ Bev 0 ((z, w) :: l') (2 * (m + 5) + 4) [m + 5] := by + unfold Beq Bev + rw [encL_cons, encL_cons, zeros3, zeros1, encS_cons, encS_nil] + have e0 : 2 * (m + 5) + 2 = (2 * m + 11) + 1 := by ring + rw [e0] + refine sp_trans (b1_three_zeros (2 * m + 11) _ _) ?_ + have e1 : 2 * m + 11 + 1 = (2 * (m + 4) + 1) + 3 := by ring + rw [e1, zeros3'] + rw [show m + 5 = (m + 4) + 1 by ring] + set Y : T := + (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (([0] : List (Fin 2)) ^ z +> + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (([0, 1, + 1] : List (Fin 2)) ^ (w + 5) +> encL l'))) with hY + refine sp_trans (a0_odd_zeros (m + 4) 0 ((0 : Fin 2) >> (0 : Fin 2) >> Y) default) ?_ + refine sp_trans (ebounce_zero (m + 4) ((0 : Fin 2) >> Y) default) ?_ + refine ss_sp_trans (a0_cascade (m + 4) ((0 : Fin 2) >> (0 : Fin 2) >> Y) default) ?_ + rw [show m + 4 + 1 = 5 + m by ring, blk_add 5 m] + refine ss_sp_trans (stepN_to_ss (fixed89 _)) ?_ + have hrun := b1_zero_one_run m 11 5 ((0 : Fin 2) >> (0 : Fin 2) >> Y) default + refine ss_sp_trans hrun ?_ + rw [hY] + have h := + b1_two_zeros_one (11 + 2 * m + 1) ((1 : Fin 2) >> (0 : Fin 2) >> (([0] : List (Fin 2)) ^ z +> + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (([0, 1, + 1] : List (Fin 2)) ^ (w + 5) +> encL l')))) (([1] : List (Fin 2)) ^ (5 + m) +> default) + have e2 : 11 + 2 * m + 1 + 2 = 2 * (5 + m) + 4 := by ring + rw [e2] at h + simp only [Nat.mul_zero, Nat.zero_add, ones_one] + exact h + +theorem R1nil (m : ℕ) : + (Beq (m + 5) []) [tm]⊢⁺ Bev 0 [] (2 * (m + 5) + 4) [m + 5] := by + unfold Beq Bev + rw [encL_nil, encS_cons, encS_nil] + rw [show (([1] : List (Fin 2)) ^ (2 * (m + 5) + 2) +> + (default : T)) = ([1] : List (Fin 2)) ^ (2 * (m + 5) + 2) +> + ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> default) by simp] + have e0 : 2 * (m + 5) + 2 = (2 * m + 11) + 1 := by ring + rw [e0] + refine sp_trans (b1_three_zeros (2 * m + 11) _ _) ?_ + have e1 : 2 * m + 11 + 1 = (2 * (m + 4) + 1) + 3 := by ring + rw [e1, zeros3'] + rw [show m + 5 = (m + 4) + 1 by ring] + set Y : T := (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> default with hY + refine sp_trans (a0_odd_zeros (m + 4) 0 ((0 : Fin 2) >> (0 : Fin 2) >> Y) default) ?_ + refine sp_trans (ebounce_zero (m + 4) ((0 : Fin 2) >> Y) default) ?_ + refine ss_sp_trans (a0_cascade (m + 4) ((0 : Fin 2) >> (0 : Fin 2) >> Y) default) ?_ + rw [show m + 4 + 1 = 5 + m by ring, blk_add 5 m] + refine ss_sp_trans (stepN_to_ss (fixed89 _)) ?_ + have hrun := b1_zero_one_run m 11 5 ((0 : Fin 2) >> (0 : Fin 2) >> Y) default + refine ss_sp_trans hrun ?_ + rw [hY] + have h := + b1_two_zeros_one (11 + 2 * m + 1) ((1 : Fin 2) >> (0 : Fin 2) >> + default) (([1] : List (Fin 2)) ^ (5 + m) +> default) + have e2 : 11 + 2 * m + 1 + 2 = 2 * (5 + m) + 4 := by ring + rw [e2] at h + simp only [Nat.mul_zero, Nat.zero_add, ones_one, z_cons_def] at h ⊢ + exact h + +theorem R9 (m z' w : ℕ) (l : List (ℕ × ℕ)) (s : List ℕ) : + (Amega (2 * (m + 5) + z') w l (m + 5) s) [tm]⊢⁺ Bounce m ((z', w) :: l) s := by + unfold Amega Bounce + rw [encL_cons, encL_cons] + have e1 : 2 * (m + 5) + z' + 1 = (2 * (m + 4) + 1) + (z' + 2) := by ring + rw [e1, pow1_add (0 : Fin 2) _ (z' + 2), zeros2 z', zeros1 z'] + rw [show m + 5 = (m + 4) + 1 by ring] + set Z : T := + ([0] : List (Fin 2)) ^ z' +> + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (([0, 1, + 1] : List (Fin 2)) ^ (w + 5) +> encL l)) with hZ + refine sp_trans (a0_odd_zeros (m + 4) 0 ((0 : Fin 2) >> Z) (encS s)) ?_ + refine sp_ss_trans (ebounce_zero (m + 4) Z (encS s)) ?_ + exact a0_cascade (m + 4) ((0 : Fin 2) >> Z) (encS s) + +theorem R10 (k r w : ℕ) (l : List (ℕ × ℕ)) (s : List ℕ) : + (Amega (2 * k) w l (k + 1 + r) s) [tm]⊢⁺ Bodd (k + w + 2) l (k + 1 + r + w + 6) s := by + unfold Amega Bodd + rw [encL_cons, zeros1, ones_add (k + 1) r] + refine sp_trans (a0_odd_zeros k 1 _ _) ?_ + refine sp_trans (ebounce_to_B1 k _ _) ?_ + rw [← ones1' (2 * k + 2)] + refine sp_ss_trans (b1_zero_one (2 * k + 3) _ _) ?_ + rw [← ones_add (k + 1) r, ← ones1 (k + 1 + r)] + have h := b1_zero_one_run (w + 5) (2 * k + 3) (k + 1 + r + 1) (encL l) (encS s) + have e1 : 2 * k + 3 + 2 * (w + 5) + 1 = 2 * (k + w + 2) + 10 := by ring + have e2 : k + 1 + r + 1 + (w + 5) = k + 1 + r + w + 6 := by ring + rw [e1, e2] at h + exact h + +theorem R11 (k r w : ℕ) (l : List (ℕ × ℕ)) (s : List ℕ) : + (Amega (2 * k + 1) w l (k + 1 + r) s) [tm]⊢⁺ Bodd (w + 1) l (2 * k + w + 9) ((k + r) :: s) := by + unfold Amega Bodd + rw [encL_cons, pow1_succ' (0 : Fin 2) (2 * k + 1), ones_add (k + 1) r, encS_cons] + refine sp_trans (a0_odd_zeros k 0 _ _) ?_ + refine ss_sp_trans (stepN_to_ss (e0_to_B1 k _ _)) ?_ + rw [← ones_add k r] + have h1 := + b1_zero_one 1 (([0, 1, + 1] : List (Fin 2)) ^ (w + 5) +> encL l) (([1] : List (Fin 2)) ^ (2 * k + 3) +> + ((0 : Fin 2) >> (([1] : List (Fin 2)) ^ (k + r) +> encS s))) + rw [pow1_succ (1 : Fin 2) 0, p_zero_list, lb_append_nil] at h1 + refine sp_ss_trans h1 ?_ + rw [← ones1 (2 * k + 3)] + have h := + b1_zero_one_run (w + 5) 1 (2 * k + 4) (encL l) ((0 : Fin 2) >> + (([1] : List (Fin 2)) ^ (k + r) +> encS s)) + have e1 : 1 + 2 * (w + 5) + 1 = 2 * (w + 1) + 10 := by ring + have e2 : 2 * k + 4 + (w + 5) = 2 * k + w + 9 := by ring + rw [e1, e2] at h + exact h + +theorem R12 (w : ℕ) (l : List (ℕ × ℕ)) : + (Bounce w l []) [tm]⊢⁺ Beq (w + 5) l := by + unfold Bounce Beq + rw [encS_nil, show w + 5 = 5 + w by ring, blk_add 5 w] + refine sp_ss_trans (stepN_to_sp (n := 89) (by decide) (fixed89 _)) ?_ + have h := b1_zero_one_run w 11 5 (encL l) default + have e1 : 11 + 2 * w + 1 = 2 * (5 + w) + 2 := by ring + rw [e1] at h + exact h + +theorem R13 (w : ℕ) (l : List (ℕ × ℕ)) : + (Bounce w l [5]) [tm]⊢⁺ Bodd (w + 2) l (w + 11) [] := by + unfold Bounce Bodd + rw [encS_cons, encS_nil] + have hz : (([1] : List (Fin 2)) ^ 5 +> default) = ([1] : List (Fin 2)) ^ (2 + 3) +> + ((0 : Fin 2) >> default) := by simp + rw [hz] + refine sp_trans (a0_zero_R 2 _ _) ?_ + rw [zeros3 0, p_zero_list, lb_append_nil] + refine ss_sp_trans (stepN_to_ss (fixed23 _)) ?_ + have h1 := + b1_zero_one 1 ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (([0, 1, + 1] : List (Fin 2)) ^ (w + 5) +> encL l)) (([1] : List (Fin 2)) ^ 4 +> default) + rw [pow1_succ (1 : Fin 2) 0, p_zero_list, lb_append_nil] at h1 + refine sp_trans h1 ?_ + rw [← ones1' 2, ← ones1 4] + refine sp_ss_trans (b1_zero_one 3 _ _) ?_ + rw [← ones1 5] + have h := b1_zero_one_run (w + 5) 3 (5 + 1) (encL l) default + have e1 : 3 + 2 * (w + 5) + 1 = 2 * (w + 2) + 10 := by ring + have e2 : 5 + 1 + (w + 5) = w + 11 := by ring + rw [e1, e2] at h + exact h + +theorem R14 (w b' : ℕ) (l : List (ℕ × ℕ)) : + (Bounce w l [b' + 15]) [tm]⊢⁺ Beq 5 ((b', w) :: l) := by + unfold Bounce Beq + rw [encS_cons, encS_nil, encL_cons] + set X : T := + (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (([0, 1, + 1] : List (Fin 2)) ^ (w + 5) +> encL l) with hX + have hz : (([1] : List (Fin 2)) ^ (b' + 15) +> + default) = ([1] : List (Fin 2)) ^ ((b' + 12) + 3) +> ((0 : Fin 2) >> default) := by + rw [show b' + 12 + 3 = b' + 15 by ring, z_cons_def] + rw [hz] + refine sp_trans (a0_zero_R (b' + 12) _ _) ?_ + rw [show b' + 12 + 1 = (b' + 10) + 3 by ring, zeros3] + refine ss_sp_trans (stepN_to_ss (fixed23 _)) ?_ + have hr := m_rounds 4 0 (([0] : List (Fin 2)) ^ (b' + 1) +> X) default + rw [show (2 : ℕ) * 0 + 1 = 1 by norm_num, show (2 : ℕ) * 4 + 2 = 10 by norm_num, + show (0 : ℕ) + 4 = 4 by norm_num, show (2 : ℕ) * 0 + 2 * 4 + 1 = 9 by norm_num, ones_one, + ← pow1_add (0 : Fin 2) 10 (b' + 1), show 10 + (b' + 1) = (b' + 10) + 1 by ring, + zeros1 (b' + 10)] at hr + refine ss_sp_trans hr ?_ + rw [zeros1 b'] + refine sp_ss_trans (b1_three_zeros 8 _ _) ?_ + refine ss_trans (a0_cascade 4 ((0 : Fin 2) >> (([0] : List (Fin 2)) ^ b' +> X)) default) ?_ + exact stepN_to_ss (fixed89 _) + +theorem R15 (w b₁ b₂ : ℕ) (l : List (ℕ × ℕ)) (s' : List ℕ) : + (Bounce w l ((b₁ + 3) :: b₂ :: s')) [tm]⊢⁺ Amega b₁ w l b₂ s' := by + unfold Bounce Amega + rw [encS_cons, encS_cons, encL_cons] + exact a0_zero_R b₁ _ _ + +-- Iterated R4 / R4nil helpers +theorem R4_iter (d : ℕ) : ∀ (j r z w : ℕ) (l' : List (ℕ × ℕ)) (s : List ℕ), + (Bev j ((z + 2 * d, w) :: l') (j + d + r) s) [tm]⊢* Bev (j + d) ((z, w) :: l') (j + d + r) s := + by + induction d with + | zero => + intro j r z w l' s + simp only [Nat.mul_zero, Nat.add_zero] + exact ss_refl _ _ + | succ d ih => + intro j r z w l' s + have h_step := sp_to_ss (R4 j (d + r) (z + 2 * d) w l' s) + have e_z : (z + 2 * d) + 2 = z + 2 * (d + 1) := by omega + have e_m : j + 1 + (d + r) = j + (d + 1) + r := by omega + rw [e_z, e_m] at h_step + refine ss_trans h_step ?_ + have h2 := ih (j + 1) r z w l' s + have e1 : j + 1 + d = j + (d + 1) := by omega + rw [e1] at h2 + exact h2 + +theorem R4nil_iter (d : ℕ) : ∀ (j r : ℕ) (s : List ℕ), + (Bev j [] (j + d + r) s) [tm]⊢* Bev (j + d) [] (j + d + r) s := by + induction d with + | zero => + intro j r s + simp only [Nat.add_zero] + exact ss_refl _ _ + | succ d ih => + intro j r s + have h_step := sp_to_ss (R4nil j (d + r) s) + have e_m : j + 1 + (d + r) = j + (d + 1) + r := by omega + rw [e_m] at h_step + refine ss_trans h_step ?_ + have h2 := ih (j + 1) r s + have e1 : j + 1 + d = j + (d + 1) := by omega + rw [e1] at h2 + exact h2 + +theorem bev0_nil_bounce (m' : ℕ) (s : List ℕ) : + (Bev 0 [] (m' + 4) s) [tm]⊢⁺ Bounce m' [] s := by + have h1 := R4nil_iter (m' + 4) 0 0 s + simp only [Nat.zero_add, Nat.add_zero] at h1 + exact ss_sp_trans h1 (R5nil m' s) + +-- --------------------------------------------------------------------------- +-- Stack-polymorphic linear excursion calculus & root invariant +-- --------------------------------------------------------------------------- + +def ValidL (l : List (ℕ × ℕ)) : Prop := ∀ p ∈ l, 27 ≤ p.2 + +theorem validL_nil : ValidL [] := by + intro p hp; cases hp + +theorem validL_cons {z w : ℕ} {l : List (ℕ × ℕ)} (hw : 27 ≤ w) (hl : ValidL l) : + ValidL ((z, w) :: l) := by + intro p hp + rcases List.mem_cons.mp hp with rfl | hmem + · exact hw + · exact hl p hmem + +theorem validL_head {z w : ℕ} {l : List (ℕ × ℕ)} (hl : ValidL ((z, w) :: l)) : 27 ≤ w := + hl (z, w) (List.mem_cons_self ..) + +theorem validL_tail {z w : ℕ} {l : List (ℕ × ℕ)} (hl : ValidL ((z, w) :: l)) : ValidL l := + fun p hp => hl p (List.mem_cons_of_mem _ hp) + +@[reducible] def bx (j m : ℕ) : ℕ := m - (5 * m - (4 * j + 165)) / 60 - 1 +@[reducible] def bdw (j m : ℕ) : ℕ := bx j m - 5 +@[reducible] def bxw (j m : ℕ) : ℕ := m + j / 15 + 27 +@[reducible] def ox (k M : ℕ) : ℕ := M - (5 * M - (4 * k + 30)) / 60 - 2 +@[reducible] def odw (k M : ℕ) : ℕ := ox k M - 5 +@[reducible] def oxw (k M : ℕ) : ℕ := M + k / 15 + 55 + +local macro "lin_omega" : tactic => + `(tactic| (dsimp only [bx, bdw, bxw, ox, odw, oxw] at *; omega)) + +theorem div15_spec (n : ℕ) : ∃ q r : ℕ, r < 15 ∧ n = 15 * q + r ∧ n / 15 = q := + ⟨n / 15, n % 15, Nat.mod_lt n (by decide), (Nat.div_add_mod n 15).symm, rfl⟩ + +theorem bx_spec (j m : ℕ) : + ∃ bxv : ℕ, bx j m = bxv ∧ bdw j m = bxv - 5 ∧ + ((5 * m ≤ 4 * j + 165 ∧ bxv = m - 1) ∨ + (∃ q r : ℕ, r < 60 ∧ 5 * m = 4 * j + 165 + 60 * q + r ∧ bxv = m - q - 1)) := by + refine ⟨bx j m, rfl, rfl, ?_⟩ + dsimp only [bx] + rcases Nat.lt_or_ge (4 * j + 165) (5 * m) with hgt | hle + · right + refine ⟨(5 * m - (4 * j + 165)) / 60, (5 * m - (4 * j + 165)) % 60, + Nat.mod_lt _ (by decide), ?_, rfl⟩ + have hdm := Nat.div_add_mod (5 * m - (4 * j + 165)) 60 + omega + · left + exact ⟨hle, by rw [Nat.sub_eq_zero_of_le hle]; omega⟩ + +theorem ox_spec (k M : ℕ) : + ∃ oxv : ℕ, ox k M = oxv ∧ odw k M = oxv - 5 ∧ + ((5 * M ≤ 4 * k + 30 ∧ oxv = M - 2) ∨ + (∃ q r : ℕ, r < 60 ∧ 5 * M = 4 * k + 30 + 60 * q + r ∧ oxv = M - q - 2)) := by + refine ⟨ox k M, rfl, rfl, ?_⟩ + dsimp only [ox] + rcases Nat.lt_or_ge (4 * k + 30) (5 * M) with hgt | hle + · right + refine ⟨(5 * M - (4 * k + 30)) / 60, (5 * M - (4 * k + 30)) % 60, + Nat.mod_lt _ (by decide), ?_, rfl⟩ + have hdm := Nat.div_add_mod (5 * M - (4 * k + 30)) 60 + omega + · left + exact ⟨hle, by rw [Nat.sub_eq_zero_of_le hle]; omega⟩ + +def Exit (tx tdw txw : ℕ) (S : List ℕ) (c : Cfg (Fin 2) (Fin 6)) : Prop := + (∃ w l, ValidL l ∧ 27 ≤ w ∧ tdw ≤ w ∧ c = Bounce w l S) ∨ + (∃ x w l, ValidL l ∧ 27 ≤ w ∧ tx ≤ x ∧ txw ≤ x + w ∧ c = Bounce w l (x :: S)) + +theorem exit_mono {tx₁ tdw₁ txw₁ tx₂ tdw₂ txw₂ : ℕ} {S : List ℕ} {c : Cfg (Fin 2) (Fin 6)} + (h : Exit tx₂ tdw₂ txw₂ S c) (h1 : tx₁ ≤ tx₂) (h2 : tdw₁ ≤ tdw₂) (h3 : txw₁ ≤ txw₂) : + Exit tx₁ tdw₁ txw₁ S c := by + rcases h with ⟨w, l, hl, hw, htdw, rfl⟩ | ⟨x, w, l, hl, hw, htx, htxw, rfl⟩ + · exact Or.inl ⟨w, l, hl, hw, by omega, rfl⟩ + · exact Or.inr ⟨x, w, l, hl, hw, by omega, by omega, rfl⟩ + +def LeadsUpTo (N : ℕ) (c : Cfg (Fin 2) (Fin 6)) (P : Cfg (Fin 2) (Fin 6) → Prop) : Prop := + ∀ n, n ≤ N → HaltsIn tm c n → ∃ m d, m ≤ n ∧ P d ∧ HaltsIn tm d m + +theorem leadsUpTo_here {N : ℕ} {c : Cfg (Fin 2) (Fin 6)} {P : Cfg (Fin 2) (Fin 6) → Prop} + (hc : P c) : LeadsUpTo N c P := + fun n _ hn => ⟨n, c, Nat.le_refl n, hc, hn⟩ + +theorem leadsUpTo_mono {N : ℕ} {c : Cfg (Fin 2) (Fin 6)} {P Q : Cfg (Fin 2) (Fin 6) → Prop} + (h₁ : LeadsUpTo N c P) (h₂ : ∀ d, P d → Q d) : LeadsUpTo N c Q := by + intro n hnN hn + rcases h₁ n hnN hn with ⟨m, d, hmn, hPd, hm⟩ + exact ⟨m, d, hmn, h₂ d hPd, hm⟩ + +theorem leadsUpTo_trans {N : ℕ} {c : Cfg (Fin 2) (Fin 6)} {P Q : Cfg (Fin 2) (Fin 6) → Prop} + (h₁ : LeadsUpTo N c P) (h₂ : ∀ d, P d → LeadsUpTo N d Q) : LeadsUpTo N c Q := by + intro n hnN hn + rcases h₁ n hnN hn with ⟨m, d, hmn, hPd, hm⟩ + rcases h₂ d hPd m (Nat.le_trans hmn hnN) hm with ⟨k, e, hkm, hQe, hk⟩ + exact ⟨k, e, Nat.le_trans hkm hmn, hQe, hk⟩ + +theorem leadsUpTo_stepPlus {N : ℕ} {c₁ c₂ : Cfg (Fin 2) (Fin 6)} {P : Cfg (Fin 2) (Fin 6) → Prop} + (h₁ : c₁ [tm]⊢⁺ c₂) (h₂ : ∀ m, m < N → LeadsUpTo m c₂ P) : LeadsUpTo N c₁ P := by + intro n hnN hn + rcases haltsIn_reduce_stepPlus h₁ hn with ⟨m, hmn, hm⟩ + rcases h₂ m (Nat.lt_of_lt_of_le hmn hnN) m (Nat.le_refl m) hm with ⟨k, d, hkm, hPd, hk⟩ + exact ⟨k, d, Nat.le_trans hkm (Nat.le_of_lt hmn), hPd, hk⟩ + +def BevBound (N : ℕ) : Prop := + ∀ j l m S, ValidL l → j ≤ m → 35 ≤ m → + LeadsUpTo N (Bev j l m S) (Exit (bx j m) (bdw j m) (bxw j m) S) + +def BoddBound (N : ℕ) : Prop := + ∀ k l M S, ValidL l → 28 ≤ k → k + 5 ≤ M → 36 ≤ M → + LeadsUpTo N (Bodd k l M S) (Exit (ox k M) (odw k M) (oxw k M) S) + +def LoopBound (N : ℕ) : Prop := + ∀ kc lc Mc x tx tdw txw S, + ValidL lc → 28 ≤ kc → kc + 5 ≤ Mc → 36 ≤ Mc → + 34 ≤ tx → tdw = tx - 5 → tx ≤ x → + 695 * tx + 27 ≤ 11 * (Mc + 61 * x) → + 60 * tx ≤ 2 * Mc + 55 * x + 200 → + 12 * txw + 72 ≤ 11 * Mc + 12 * x → + 30 * txw ≤ Mc + 30 * x + 1700 → + LeadsUpTo N (Bodd kc lc Mc (x :: S)) (Exit tx tdw txw S) + +theorem amega_bounce_step {N : ℕ} + (ih : ∀ m, m < N → BevBound m ∧ BoddBound m ∧ LoopBound m) + {z0 w1 x tx tdw txw : ℕ} {l1 : List (ℕ × ℕ)} {S : List ℕ} + (hl1 : ValidL l1) (hw1 : 27 ≤ w1) (hz0_ge3 : 3 ≤ z0) + (htx34 : 34 ≤ tx) (htdw : tdw = tx - 5) (htxx : tx ≤ x) + (h_r10_tx : ∀ kp, z0 = 3 + kp * 2 → kp + 1 ≤ x → tx ≤ ox (kp + w1 + 2) (x + w1 + 6)) + (h_r10_txw : ∀ kp, z0 = 3 + kp * 2 → kp + 1 ≤ x → txw ≤ oxw (kp + w1 + 2) (x + w1 + 6)) + (h_r11_x : ∀ kp, z0 = 4 + kp * 2 → kp + 1 ≤ x → tx ≤ x - 1) + (h_r11_i1 : ∀ kp, + z0 = 4 + kp * 2 → kp + 1 ≤ x → 695 * tx + 27 ≤ 11 * ((2 * kp + w1 + 9) + 61 * (x - 1))) + (h_r11_i2 : ∀ kp, + z0 = 4 + kp * 2 → kp + 1 ≤ x → 60 * tx ≤ 2 * (2 * kp + w1 + 9) + 55 * (x - 1) + 200) + (h_r11_i3 : ∀ kp, + z0 = 4 + kp * 2 → kp + 1 ≤ x → 12 * txw + 72 ≤ 11 * (2 * kp + w1 + 9) + 12 * (x - 1)) + (h_r11_i4 : ∀ kp, + z0 = 4 + kp * 2 → kp + 1 ≤ x → 30 * txw ≤ (2 * kp + w1 + 9) + 30 * (x - 1) + 1700) : + LeadsUpTo N (Bounce w1 l1 (z0 :: x :: S)) (Exit tx tdw txw S) := by + rcases Nat.lt_or_ge (z0 - 3) (2 * x) with hlt | hge + · rcases mod2 (z0 - 3) with ⟨kp, hkp⟩ | ⟨kp, hkp⟩ + · have hz_eq : z0 = 3 + kp * 2 := by omega + have hkpx : kp + 1 ≤ x := by omega + have h_step : (Bounce w1 l1 (z0 :: x :: S)) [tm]⊢⁺ Bodd (kp + w1 + 2) l1 (x + w1 + 6) S := by + have h1 : Bounce w1 l1 (z0 :: x :: S) = + Bounce w1 l1 (((2 * kp) + 3) :: (kp + 1 + (x - (kp + 1))) :: S) := by + congr 1; congr 1 + · omega + · congr 1; omega + rw [h1] + have h2 := sp_trans (R15 w1 (2 * kp) (kp + 1 + (x - (kp + 1))) l1 S) + (R10 kp (x - (kp + 1)) w1 l1 S) + have e1 : kp + 1 + (x - (kp + 1)) + w1 + 6 = x + w1 + 6 := by omega + rwa [e1] at h2 + refine leadsUpTo_stepPlus h_step (fun m hm => ?_) + have hb := (ih m hm).2.1 (kp + w1 + 2) l1 (x + w1 + 6) S hl1 (by omega) (by omega) (by omega) + refine leadsUpTo_mono hb (fun d hd => ?_) + have htx' := h_r10_tx kp hz_eq hkpx + have htxw' := h_r10_txw kp hz_eq hkpx + exact exit_mono hd htx' (by dsimp only [odw]; omega) htxw' + · have hz_eq : z0 = 4 + kp * 2 := by omega + have hkpx : kp + 1 ≤ x := by omega + have h_step : (Bounce w1 l1 (z0 :: x :: S)) [tm]⊢⁺ Bodd (w1 + 1) l1 (2 * kp + w1 + 9) ((x - 1) + :: S) := by + have h1 : Bounce w1 l1 (z0 :: x :: S) = + Bounce w1 l1 (((2 * kp + 1) + 3) :: (kp + 1 + (x - (kp + 1))) :: S) := by + congr 1; congr 1 + · omega + · congr 1; omega + rw [h1] + have h2 := sp_trans (R15 w1 (2 * kp + 1) (kp + 1 + (x - (kp + 1))) l1 S) + (R11 kp (x - (kp + 1)) w1 l1 S) + have e1 : kp + (x - (kp + 1)) = x - 1 := by omega + rwa [e1] at h2 + refine leadsUpTo_stepPlus h_step (fun m hm => ?_) + exact (ih m hm).2.2 (w1 + 1) l1 (2 * kp + w1 + 9) (x - 1) tx tdw txw S + hl1 (by omega) (by omega) (by omega) htx34 htdw + (h_r11_x kp hz_eq hkpx) (h_r11_i1 kp hz_eq hkpx) + (h_r11_i2 kp hz_eq hkpx) (h_r11_i3 kp hz_eq hkpx) (h_r11_i4 kp hz_eq hkpx) + · have h_step : (Bounce w1 l1 (z0 :: x :: S)) [tm]⊢⁺ Bounce (x - 5) ((z0 - 3 - 2 * x, + w1) :: l1) S := by + have h1 : Bounce w1 l1 (z0 :: x :: S) = + Bounce w1 l1 (((2 * ((x - 5) + 5) + (z0 - 3 - 2 * x)) + 3) :: ((x - 5) + 5) :: S) := by + congr 1; congr 1 + · omega + · congr 1; omega + rw [h1] + exact sp_trans (R15 w1 (2 * ((x - 5) + 5) + (z0 - 3 - 2 * x)) ((x - 5) + 5) l1 S) + (R9 (x - 5) (z0 - 3 - 2 * x) w1 l1 S) + refine leadsUpTo_stepPlus h_step (fun m _ => ?_) + exact leadsUpTo_here (Or.inl ⟨x - 5, (z0 - 3 - 2 * x, w1) :: l1, + validL_cons hw1 hl1, by omega, by omega, rfl⟩) + +theorem excursion_bundle (N : ℕ) : BevBound N ∧ BoddBound N ∧ LoopBound N := by + induction N using Nat.strong_induction_on with + | h N ih => + have h_bev : BevBound N := by + intro j l m S hl hjm hm35 + rcases l with _ | ⟨⟨z, w⟩, l'⟩ + · rcases Nat.lt_or_ge j m with hlt | hge + · have h_eq : Bev j [] m S = Bev j [] (j + 1 + (m - (j + 1))) S := by congr 1; omega + rw [h_eq] + refine leadsUpTo_stepPlus (R4nil j (m - (j + 1)) S) (fun n' hn' => ?_) + have h_sub : j + 1 + (m - (j + 1)) = m := by omega + rw [h_sub] + refine leadsUpTo_mono ((ih n' hn').1 (j + 1) [] m S validL_nil (by omega) hm35) (fun d hd + => ?_) + exact exit_mono hd (by lin_omega) (by lin_omega) (by lin_omega) + · have hjm_eq : j = m := by omega + subst hjm_eq + have h_eq : Bev j [] j S = Bev ((j - 4) + 4) [] ((j - 4) + 4) S := by congr 1 <;> omega + rw [h_eq] + refine leadsUpTo_stepPlus (R5nil (j - 4) S) (fun _ _ => ?_) + exact leadsUpTo_here (Or.inl ⟨j - 4, [], validL_nil, by omega, by lin_omega, rfl⟩) + · have hw : 27 ≤ w := validL_head hl + have hl' : ValidL l' := validL_tail hl + rcases z with _ | _ | z' + · refine leadsUpTo_stepPlus (R6 j m w l' S) (fun n' hm' => ?_) + refine leadsUpTo_mono ((ih n' hm').2.1 (j + w + 2) l' (m + w + 7) S hl' + (by omega) (by omega) (by omega)) (fun d hd => ?_) + exact exit_mono hd (by lin_omega) (by lin_omega) (by lin_omega) + · refine leadsUpTo_stepPlus (R7 j m w l' S) (fun n' hn' => ?_) + have hb_all : 34 ≤ bx j m ∧ bx j m ≤ m ∧ + 695 * bx j m + 27 ≤ 11 * ((2 * j + w + 9) + 61 * m) ∧ + 60 * bx j m ≤ 2 * (2 * j + w + 9) + 55 * m + 200 ∧ + 12 * bxw j m + 72 ≤ 11 * (2 * j + w + 9) + 12 * m ∧ + 30 * bxw j m ≤ (2 * j + w + 9) + 30 * m + 1700 := by + rcases bx_spec j m with ⟨bxv, hbxv, _, hbx_cases⟩ + rcases div15_spec j with ⟨qj, rj, hrj, hjeq, hjdiv⟩ + dsimp only [bxw] + rw [hbxv, hjdiv] + rcases hbx_cases with ⟨hle, rfl⟩ | ⟨q, r, hr, heq, rfl⟩ + · omega + · refine ⟨by omega, by omega, ?_, by omega, by omega, by omega⟩ + rcases j with _ | _ | _ | _ | j' <;> omega + exact (ih n' hn').2.2 (w + 1) l' (2 * j + w + 9) m (bx j m) (bdw j m) (bxw j m) S + hl' (by omega) (by omega) (by omega) hb_all.1 rfl hb_all.2.1 + hb_all.2.2.1 hb_all.2.2.2.1 hb_all.2.2.2.2.1 hb_all.2.2.2.2.2 + · rcases Nat.lt_or_ge j m with hlt | hge + · have h_eq : Bev j ((z' + 2, w) :: l') m S = + Bev j ((z' + 2, w) :: l') (j + 1 + (m - (j + 1))) S := by congr 1; omega + rw [h_eq] + refine leadsUpTo_stepPlus (R4 j (m - (j + 1)) z' w l' S) (fun n' hn' => ?_) + have h_sub : j + 1 + (m - (j + 1)) = m := by omega + rw [h_sub] + refine leadsUpTo_mono ((ih n' hn').1 (j + 1) ((z', w) :: l') m S + (validL_cons hw hl') (by omega) hm35) (fun d hd => ?_) + exact exit_mono hd (by lin_omega) (by lin_omega) (by lin_omega) + · have hjm_eq : j = m := by omega + subst hjm_eq + have h_eq : Bev j ((z' + 2, w) :: l') j S = + Bev ((j - 4) + 4) ((z' + 2, w) :: l') ((j - 4) + 4) S := by congr 1 <;> omega + rw [h_eq] + refine leadsUpTo_stepPlus (R5 (j - 4) z' w l' S) (fun _ _ => ?_) + exact leadsUpTo_here (Or.inl ⟨j - 4, (z', w) :: l', validL_cons hw hl', + by omega, by lin_omega, rfl⟩) + have h_bodd : BoddBound N := by + intro k l M S hl hk28 hkM hM36 + have h_r8_post : ∀ (l'' : List (ℕ × ℕ)), ValidL l'' → + ∀ m', m' < N → LeadsUpTo m' (Bev 0 l'' (2 * k + 11) ((M - 1) :: S)) + (Exit (ox k M) (odw k M) (oxw k M) S) := by + intro l'' hl'' m' hm' + refine leadsUpTo_trans ((ih m' hm').1 0 l'' (2 * k + 11) ((M - 1) :: S) hl'' (by omega) (by + omega)) ?_ + rintro d (⟨w1, l1, hl1, hw1, hbdw, rfl⟩ | ⟨z0, w1, l1, hl1, hw1, hbx, hbxw, rfl⟩) + · rcases bx_spec 0 (2 * k + 11) with ⟨bxv, _, hbdwv, hbx_c⟩ + rcases ox_spec k M with ⟨oxv, hoxv, _, hox_c⟩ + rcases div15_spec k with ⟨qk, rk, hrk, hkeq, hkdiv⟩ + rw [hbdwv] at hbdw + refine leadsUpTo_here (Or.inr ⟨M - 1, w1, l1, hl1, hw1, ?_, ?_, rfl⟩) + · rw [hoxv] + rcases hox_c with ⟨_, rfl⟩ | ⟨_, _, _, _, rfl⟩ <;> omega + · dsimp only [oxw]; rw [hkdiv] + rcases hbx_c with ⟨_, rfl⟩ | ⟨_, _, _, _, rfl⟩ <;> omega + · have hz3 : 3 ≤ z0 := by lin_omega + have hox34 : 34 ≤ ox k M := by lin_omega + have hoxM : ox k M ≤ M - 1 := by lin_omega + exact amega_bounce_step (fun m'' hm'' => ih m'' (Nat.lt_trans hm'' hm')) + hl1 hw1 hz3 hox34 rfl hoxM + (fun kp hz hkpx => by + rcases bx_spec 0 (2 * k + 11) with ⟨bxv, hbxv, _, hbx_c⟩ + rcases ox_spec k M with ⟨oxv, hoxv, _, hox_c⟩ + rcases ox_spec (kp + w1 + 2) ((M - 1) + w1 + 6) with ⟨ox2, hox2, _, hox2_c⟩ + dsimp only [bxw] at hbxw + have h0 : 0 / 15 = 0 := rfl + rw [h0] at hbxw; rw [hbxv] at hbx; rw [hoxv, hox2] + rcases hbx_c with ⟨_, rfl⟩ | ⟨_, _, _, _, rfl⟩ <;> + rcases hox_c with ⟨_, rfl⟩ | ⟨_, _, _, _, rfl⟩ <;> + rcases hox2_c with ⟨_, rfl⟩ | ⟨_, _, _, _, rfl⟩ <;> omega) + (fun kp hz hkpx => by + rcases div15_spec k with ⟨qk, rk, hrk, hkeq, hkdiv⟩ + rcases div15_spec (kp + w1 + 2) with ⟨qo, ro, hro, hoeq, hodiv⟩ + dsimp only [bxw, oxw] at hbxw ⊢ + have h0 : 0 / 15 = 0 := rfl + rw [h0] at hbxw; rw [hkdiv, hodiv]; omega) + (fun kp hz hkpx => by + rcases bx_spec 0 (2 * k + 11) with ⟨bxv, hbxv, _, hbx_c⟩ + rcases ox_spec k M with ⟨oxv, hoxv, _, hox_c⟩ + rw [hbxv] at hbx; rw [hoxv] + rcases hbx_c with ⟨_, rfl⟩ | ⟨_, _, _, _, rfl⟩ <;> + rcases hox_c with ⟨_, rfl⟩ | ⟨_, _, _, _, rfl⟩ <;> omega) + (fun kp hz hkpx => by + rcases ox_spec k M with ⟨oxv, hoxv, _, hox_c⟩ + dsimp only [bxw] at hbxw + have h0 : 0 / 15 = 0 := rfl + rw [h0] at hbxw; rw [hoxv] + rcases hox_c with ⟨_, rfl⟩ | ⟨_, _, _, _, rfl⟩ <;> omega) + (fun kp hz hkpx => by + rcases ox_spec k M with ⟨oxv, hoxv, _, hox_c⟩ + dsimp only [bxw] at hbxw + have h0 : 0 / 15 = 0 := rfl + rw [h0] at hbxw; rw [hoxv] + rcases hox_c with ⟨_, rfl⟩ | ⟨_, _, _, _, rfl⟩ <;> omega) + (fun kp hz hkpx => by + rcases div15_spec k with ⟨qk, rk, hrk, hkeq, hkdiv⟩ + dsimp only [bxw, oxw] at hbxw ⊢ + have h0 : 0 / 15 = 0 := rfl + rw [h0] at hbxw; rw [hkdiv]; omega) + (fun kp hz hkpx => by + rcases div15_spec k with ⟨qk, rk, hrk, hkeq, hkdiv⟩ + dsimp only [bxw, oxw] at hbxw ⊢ + have h0 : 0 / 15 = 0 := rfl + rw [h0] at hbxw; rw [hkdiv]; omega) + rcases l with _ | ⟨⟨z, w⟩, l'⟩ + · have h_eq : Bodd k [] M S = Bodd k [] (k + 5 + (M - (k + 5))) S := by congr 1; omega + rw [h_eq] + refine leadsUpTo_stepPlus (R8nil k (M - (k + 5)) S) (fun m' hm' => ?_) + have e1 : k + 4 + (M - (k + 5)) = M - 1 := by omega + rw [e1] + exact h_r8_post [] validL_nil m' hm' + · have hw : 27 ≤ w := validL_head hl + have hl' : ValidL l' := validL_tail hl + rcases z with _ | _ | z' + · refine leadsUpTo_stepPlus (R8a k M w l' S) (fun m' hm' => ?_) + refine leadsUpTo_mono ((ih m' hm').1 (k + w + 11) l' (M + w + 7) S hl' + (by omega) (by omega)) (fun d hd => ?_) + exact exit_mono hd (by lin_omega) (by lin_omega) (by lin_omega) + · refine leadsUpTo_stepPlus (R8b k M w l' S) (fun m' hm' => ?_) + have ho_all : 34 ≤ ox k M ∧ ox k M ≤ M ∧ + 695 * ox k M + 27 ≤ 11 * ((2 * k + w + 18) + 61 * M) ∧ + 60 * ox k M ≤ 2 * (2 * k + w + 18) + 55 * M + 200 ∧ + 12 * oxw k M + 72 ≤ 11 * (2 * k + w + 18) + 12 * M ∧ + 30 * oxw k M ≤ (2 * k + w + 18) + 30 * M + 1700 := by + rcases ox_spec k M with ⟨oxv, hoxv, _, hox_c⟩ + rcases div15_spec k with ⟨qk, rk, hrk, hkeq, hkdiv⟩ + dsimp only [oxw] + rw [hoxv, hkdiv] + rcases hox_c with ⟨_, rfl⟩ | ⟨_, _, _, _, rfl⟩ <;> omega + exact (ih m' hm').2.2 (w + 1) l' (2 * k + w + 18) M (ox k M) (odw k M) (oxw k M) S + hl' (by omega) (by omega) (by omega) ho_all.1 rfl ho_all.2.1 + ho_all.2.2.1 ho_all.2.2.2.1 ho_all.2.2.2.2.1 ho_all.2.2.2.2.2 + · have h_eq : Bodd k ((z' + 2, w) :: l') M S = + Bodd k ((z' + 2, w) :: l') (k + 5 + (M - (k + 5))) S := by congr 1; omega + rw [h_eq] + refine leadsUpTo_stepPlus (R8 k (M - (k + 5)) z' w l' S) (fun m' hm' => ?_) + have e1 : k + 4 + (M - (k + 5)) = M - 1 := by omega + rw [e1] + exact h_r8_post ((z', w) :: l') (validL_cons hw hl') m' hm' + have h_loop : LoopBound N := by + intro kc lc Mc x tx tdw txw S hlc hkc28 hkcMc hMc36 htx34 htdw htxx hi1 hi2 hi3 hi4 + refine leadsUpTo_trans (h_bodd kc lc Mc (x :: S) hlc hkc28 hkcMc hMc36) ?_ + rintro d (⟨w1, l1, hl1, hw1, hodw, rfl⟩ | ⟨z0, w1, l1, hl1, hw1, hox, hoxw, rfl⟩) + · rcases ox_spec kc Mc with ⟨oxv, _, hodwv, hox_c⟩ + rw [hodwv] at hodw + refine leadsUpTo_here (Or.inr ⟨x, w1, l1, hl1, hw1, htxx, ?_, rfl⟩) + rcases hox_c with ⟨_, rfl⟩ | ⟨_, _, _, _, rfl⟩ <;> omega + · have hz3 : 3 ≤ z0 := by lin_omega + exact amega_bounce_step ih hl1 hw1 hz3 htx34 htdw htxx + (fun kp hz hkpx => by + rcases ox_spec kc Mc with ⟨oxv, hoxv, _, hox_c⟩ + rcases div15_spec kc with ⟨qkc, rkc, hrkc, hkceq, hkcdiv⟩ + rcases ox_spec (kp + w1 + 2) (x + w1 + 6) with ⟨ox2, hox2, _, hox2_c⟩ + dsimp only [oxw] at hoxw + rw [hoxv] at hox; rw [hkcdiv] at hoxw; rw [hox2] + rcases hox_c with ⟨_, rfl⟩ | ⟨_, _, _, _, rfl⟩ <;> + rcases hox2_c with ⟨_, rfl⟩ | ⟨_, _, _, _, rfl⟩ <;> omega) + (fun kp hz hkpx => by + rcases div15_spec kc with ⟨qkc, rkc, hrkc, hkceq, hkcdiv⟩ + rcases div15_spec (kp + w1 + 2) with ⟨qo, ro, hro, hoeq, hodiv⟩ + dsimp only [oxw] at hoxw ⊢ + rw [hkcdiv] at hoxw; rw [hodiv]; omega) + (fun kp hz hkpx => by + rcases ox_spec kc Mc with ⟨oxv, hoxv, _, hox_c⟩ + rw [hoxv] at hox + rcases hox_c with ⟨_, rfl⟩ | ⟨_, _, _, _, rfl⟩ <;> omega) + (fun kp hz hkpx => by + rcases div15_spec kc with ⟨qkc, rkc, hrkc, hkceq, hkcdiv⟩ + dsimp only [oxw] at hoxw + rw [hkcdiv] at hoxw; omega) + (fun kp hz hkpx => by + rcases div15_spec kc with ⟨qkc, rkc, hrkc, hkceq, hkcdiv⟩ + dsimp only [oxw] at hoxw + rw [hkcdiv] at hoxw; omega) + (fun kp hz hkpx => by + rcases div15_spec kc with ⟨qkc, rkc, hrkc, hkceq, hkcdiv⟩ + dsimp only [oxw] at hoxw + rw [hkcdiv] at hoxw; omega) + (fun kp hz hkpx => by + rcases div15_spec kc with ⟨qkc, rkc, hrkc, hkceq, hkcdiv⟩ + dsimp only [oxw] at hoxw + rw [hkcdiv] at hoxw; omega) + exact ⟨h_bev, h_bodd, h_loop⟩ + +theorem bev_leads {j m : ℕ} {l : List (ℕ × ℕ)} {S : List ℕ} + (hl : ValidL l) (hjm : j ≤ m) (hm35 : 35 ≤ m) : + Leads tm (Bev j l m S) (Exit (bx j m) (bdw j m) (bxw j m) S) := + fun n hn => (excursion_bundle n).1 j l m S hl hjm hm35 n (Nat.le_refl n) hn + +theorem bodd_leads {k M : ℕ} {l : List (ℕ × ℕ)} {S : List ℕ} + (hl : ValidL l) (hk28 : 28 ≤ k) (hkM : k + 5 ≤ M) (hM36 : 36 ≤ M) : + Leads tm (Bodd k l M S) (Exit (ox k M) (odw k M) (oxw k M) S) := + fun n hn => (excursion_bundle n).2.1 k l M S hl hk28 hkM hM36 n (Nat.le_refl n) hn + +theorem loop_leads {kc Mc x tx tdw txw : ℕ} {lc : List (ℕ × ℕ)} {S : List ℕ} + (hlc : ValidL lc) (hkc28 : 28 ≤ kc) (hkcMc : kc + 5 ≤ Mc) (hMc36 : 36 ≤ Mc) + (htx34 : 34 ≤ tx) (htdw : tdw = tx - 5) (htxx : tx ≤ x) + (hi1 : 695 * tx + 27 ≤ 11 * (Mc + 61 * x)) + (hi2 : 60 * tx ≤ 2 * Mc + 55 * x + 200) + (hi3 : 12 * txw + 72 ≤ 11 * Mc + 12 * x) + (hi4 : 30 * txw ≤ Mc + 30 * x + 1700) : + Leads tm (Bodd kc lc Mc (x :: S)) (Exit tx tdw txw S) := + fun n hn => (excursion_bundle n).2.2 kc lc Mc x tx tdw txw S + hlc hkc28 hkcMc hMc36 htx34 htdw htxx hi1 hi2 hi3 hi4 n (Nat.le_refl n) hn + +-- --------------------------------------------------------------------------- +-- Root invariant closure (`RootInv`) +-- --------------------------------------------------------------------------- + +def RootInv (c : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ M l, (M = 5 ∨ 18 ≤ M) ∧ ValidL l ∧ c = Beq M l + +theorem root_of_5 {l : List (ℕ × ℕ)} (hl : ValidL l) : RootInv (Beq 5 l) := + ⟨5, l, Or.inl rfl, hl, rfl⟩ + +theorem root_of_ge18 {M : ℕ} {l : List (ℕ × ℕ)} (hM : 18 ≤ M) (hl : ValidL l) : RootInv (Beq M l) := + ⟨M, l, Or.inr hM, hl, rfl⟩ + +theorem exit_nil_leads_root {tx tdw txw : ℕ} (htx : 15 ≤ tx) {c : Cfg (Fin 2) (Fin 6)} + (hc : Exit tx tdw txw [] c) : Leads tm c RootInv := by + rcases hc with ⟨w, l, hl, hw, _, rfl⟩ | ⟨x, w, l, hl, hw, hxx, _, rfl⟩ + · exact (Advances.of_stepPlus (R12 w l) (root_of_ge18 (by omega) hl)).to_leads + · have h_eq : Bounce w l [x] = Bounce w l [(x - 15) + 15] := by + congr 1; congr 1; omega + rw [h_eq] + exact (Advances.of_stepPlus (R14 w (x - 15) l) (root_of_5 (validL_cons hw hl))).to_leads + +theorem bev_nil_leads_root {j m : ℕ} {l : List (ℕ × ℕ)} + (hl : ValidL l) (hjm : j ≤ m) (hm35 : 35 ≤ m) : + Leads tm (Bev j l m []) RootInv := + (bev_leads hl hjm hm35).trans (fun _ hd => exit_nil_leads_root (by lin_omega) hd) + +theorem bodd_nil_leads_root {k M : ℕ} {l : List (ℕ × ℕ)} + (hl : ValidL l) (hk28 : 28 ≤ k) (hkM : k + 5 ≤ M) (hM36 : 36 ≤ M) : + Leads tm (Bodd k l M []) RootInv := + (bodd_leads hl hk28 hkM hM36).trans (fun _ hd => exit_nil_leads_root (by lin_omega) hd) + +theorem exit_single_forced_r9 {tx tdw txw x : ℕ} (hx18 : 18 ≤ x) (htx_r9 : 2 * x + 3 ≤ tx) + {c : Cfg (Fin 2) (Fin 6)} (hc : Exit tx tdw txw [x] c) : Leads tm c RootInv := by + rcases hc with ⟨w, l, hl, hw, _, rfl⟩ | ⟨z0, w, l, hl, hw, hz0, _, rfl⟩ + · have h_eq : Bounce w l [x] = Bounce w l [(x - 15) + 15] := by + congr 1; congr 1; omega + rw [h_eq] + exact (Advances.of_stepPlus (R14 w (x - 15) l) (root_of_5 (validL_cons hw hl))).to_leads + · have h_step := sp_trans + (sp_trans (R15 w (2 * ((x - 5) + 5) + (z0 - 3 - 2 * x)) ((x - 5) + 5) l []) + (R9 (x - 5) (z0 - 3 - 2 * x) w l [])) + (R12 (x - 5) ((z0 - 3 - 2 * x, w) :: l)) + have e1 : 2 * ((x - 5) + 5) + (z0 - 3 - 2 * x) + 3 = z0 := by omega + have e2 : (x - 5) + 5 = x := by omega + rw [e1, e2] at h_step + exact (Advances.of_stepPlus h_step (root_of_ge18 hx18 (validL_cons hw hl))).to_leads + +theorem exit_5_leads_root {tx tdw txw : ℕ} (htx : 13 ≤ tx) {c : Cfg (Fin 2) (Fin 6)} + (hc : Exit tx tdw txw [5] c) : Leads tm c RootInv := by + rcases hc with ⟨w, l, hl, hw, _, rfl⟩ | ⟨z0, w, l, hl, hw, hz0, _, rfl⟩ + · exact Leads.of_stepPlus_leads (R13 w l) + (bodd_nil_leads_root hl (by omega) (by omega) (by omega)) + · have h1 : Bounce w l [z0, 5] = Bounce w l (((2 * (0 + 5) + (z0 - 13)) + 3) :: (0 + 5) :: []) := + by + congr 1; congr 1; omega + rw [h1] + have h_step := sp_trans + (sp_trans (R15 w (2 * (0 + 5) + (z0 - 13)) (0 + 5) l []) + (R9 0 (z0 - 13) w l [])) + (R12 0 ((z0 - 13, w) :: l)) + exact (Advances.of_stepPlus h_step (root_of_5 (validL_cons hw hl))).to_leads +theorem bev0_35_20_leads_root {l : List (ℕ × ℕ)} (hl : ValidL l) : + Leads tm (Bev 0 l 35 [20]) RootInv := by + refine (bev_leads hl (by omega) (by omega)).trans ?_ + rintro d (⟨w1, l1, hl1, hw1, _, rfl⟩ | ⟨z0, w1, l1, hl1, hw1, hz0, hzw, rfl⟩) + · exact (Advances.of_stepPlus (R14 w1 5 l1) (root_of_5 (validL_cons hw1 hl1))).to_leads + · have hz34 : 34 ≤ z0 := by lin_omega + have hzw62 : 62 ≤ z0 + w1 := by lin_omega + rcases Nat.lt_or_ge (z0 - 3) 40 with hlt | hge + · rcases mod2 (z0 - 3) with ⟨kp, hkp⟩ | ⟨kp, hkp⟩ + · have h1 : Bounce w1 l1 [z0, 20] = + Bounce w1 l1 (((2 * kp) + 3) :: (kp + 1 + (20 - (kp + 1))) :: []) := by + congr 1; congr 1 + · omega + · congr 1; omega + rw [h1] + have h_step := sp_trans (R15 w1 (2 * kp) (kp + 1 + (20 - (kp + 1))) l1 []) + (R10 kp (20 - (kp + 1)) w1 l1 []) + have e1 : kp + 1 + (20 - (kp + 1)) + w1 + 6 = w1 + 26 := by omega + rw [e1] at h_step + exact Leads.of_stepPlus_leads h_step + (bodd_nil_leads_root hl1 (by omega) (by omega) (by omega)) + · have h1 : Bounce w1 l1 [z0, 20] = + Bounce w1 l1 (((2 * kp + 1) + 3) :: (kp + 1 + (20 - (kp + 1))) :: []) := by + congr 1; congr 1 + · omega + · congr 1; omega + rw [h1] + have h_step := sp_trans (R15 w1 (2 * kp + 1) (kp + 1 + (20 - (kp + 1))) l1 []) + (R11 kp (20 - (kp + 1)) w1 l1 []) + have e1 : kp + (20 - (kp + 1)) = 19 := by omega + rw [e1] at h_step + refine Leads.of_stepPlus_leads h_step ?_ + exact (bodd_leads hl1 (by omega) (by omega) (by omega)).trans + (fun _ hd => exit_single_forced_r9 (by omega) (by lin_omega) hd) + · have h1 : Bounce w1 l1 [z0, 20] = + Bounce w1 l1 (((2 * (15 + 5) + (z0 - 43)) + 3) :: (15 + 5) :: []) := by + congr 1; congr 1; omega + rw [h1] + have h_step := sp_trans + (sp_trans (R15 w1 (2 * (15 + 5) + (z0 - 43)) (15 + 5) l1 []) + (R9 15 (z0 - 43) w1 l1 [])) + (R12 15 ((z0 - 43, w1) :: l1)) + exact (Advances.of_stepPlus h_step (root_of_ge18 (by omega) (validL_cons hw1 hl1))).to_leads + +theorem bodd12_21_leads_root {l : List (ℕ × ℕ)} (hl : ValidL l) : + Leads tm (Bodd 12 l 21 []) RootInv := by + rcases l with _ | ⟨⟨z, w⟩, l'⟩ + · exact Leads.of_stepPlus_leads (R8nil 12 4 []) (bev0_35_20_leads_root validL_nil) + · have hw : 27 ≤ w := validL_head hl + have hl' : ValidL l' := validL_tail hl + rcases z with _ | _ | z' + · exact Leads.of_stepPlus_leads (R8a 12 21 w l' []) + (bev_nil_leads_root hl' (by omega) (by omega)) + · refine Leads.of_stepPlus_leads (R8b 12 21 w l' []) ?_ + exact (bodd_leads hl' (by omega) (by omega) (by omega)).trans + (fun _ hd => exit_single_forced_r9 (by omega) (by lin_omega) hd) + · exact Leads.of_stepPlus_leads (R8 12 4 z' w l' []) + (bev0_35_20_leads_root (validL_cons hw hl')) + +theorem bev_33_19_walk (rem : ℕ) : ∀ {j : ℕ} {l : List (ℕ × ℕ)}, + rem = 33 - j → j ≤ 33 → ValidL l → Leads tm (Bev j l 33 [19]) RootInv := by + induction rem with + | zero => + intro j l hrem hj hl + have hj33 : j = 33 := by omega + subst hj33 + rcases l with _ | ⟨⟨z, w⟩, l'⟩ + · exact (Advances.of_stepPlus (sp_trans (R5nil 29 [19]) (R14 29 4 [])) + (root_of_5 (validL_cons (by omega) validL_nil))).to_leads + · have hw : 27 ≤ w := validL_head hl + have hl' : ValidL l' := validL_tail hl + rcases z with _ | _ | z' + · refine Leads.of_stepPlus_leads (R6 33 33 w l' [19]) ?_ + exact (bodd_leads hl' (by omega) (by omega) (by omega)).trans + (fun _ hd => exit_single_forced_r9 (by omega) (by lin_omega) hd) + · refine Leads.of_stepPlus_leads (R7 33 33 w l' [19]) ?_ + refine (bodd_leads hl' (by omega) (by omega) (by omega)).trans ?_ + rintro d (⟨w1, l1, hl1, hw1, _, rfl⟩ | ⟨z0, w1, l1, hl1, hw1, hz0, hzw, rfl⟩) + · have h_step := sp_trans (R15 w1 30 19 l1 []) (R10 15 3 w1 l1 []) + exact Leads.of_stepPlus_leads h_step + (bodd_nil_leads_root hl1 (by omega) (by omega) (by omega)) + · have hz34 : 34 ≤ z0 := by lin_omega + have hzw92 : 92 ≤ z0 + w1 := by lin_omega + rcases Nat.lt_or_ge (z0 - 3) 66 with hlt | hge + · rcases mod2 (z0 - 3) with ⟨kp, hkp⟩ | ⟨kp, hkp⟩ + · have h1 : Bounce w1 l1 [z0, 33, 19] = + Bounce w1 l1 (((2 * kp) + 3) :: (kp + 1 + (33 - (kp + 1))) :: [19]) := by + congr 1; congr 1 + · omega + · congr 1; omega + rw [h1] + have h_step := sp_trans (R15 w1 (2 * kp) (kp + 1 + (33 - (kp + 1))) l1 [19]) + (R10 kp (33 - (kp + 1)) w1 l1 [19]) + have e1 : kp + 1 + (33 - (kp + 1)) + w1 + 6 = w1 + 39 := by omega + rw [e1] at h_step + refine Leads.of_stepPlus_leads h_step ?_ + exact (bodd_leads hl1 (by omega) (by omega) (by omega)).trans + (fun _ hd => exit_single_forced_r9 (by omega) (by lin_omega) hd) + · have h1 : Bounce w1 l1 [z0, 33, 19] = + Bounce w1 l1 (((2 * kp + 1) + 3) :: (kp + 1 + (33 - (kp + 1))) :: [19]) := by + congr 1; congr 1 + · omega + · congr 1; omega + rw [h1] + have h_step := sp_trans (R15 w1 (2 * kp + 1) (kp + 1 + (33 - (kp + 1))) l1 [19]) + (R11 kp (33 - (kp + 1)) w1 l1 [19]) + have e1 : kp + (33 - (kp + 1)) = 32 := by omega + rw [e1] at h_step + refine Leads.of_stepPlus_leads h_step ?_ + refine (bodd_leads hl1 (by omega) (by omega) (by omega)).trans ?_ + rintro d2 (⟨w2, l2, hl2, hw2, hodw2, rfl⟩ | ⟨z2, w2, l2, hl2, hw2, hz2, _, rfl⟩) + · have hw85 : 85 ≤ w2 := by lin_omega + have h_s2 := sp_trans (R15 w2 29 19 l2 []) (R11 14 4 w2 l2 []) + refine Leads.of_stepPlus_leads h_s2 ?_ + exact (bodd_leads hl2 (by omega) (by omega) (by omega)).trans + (fun _ hd => exit_single_forced_r9 (by omega) (by lin_omega) hd) + · have hz90 : 90 ≤ z2 := by lin_omega + have h2 : Bounce w2 l2 [z2, 32, 19] = + Bounce w2 l2 (((2 * (27 + 5) + (z2 - 67)) + 3) :: (27 + 5) :: [19]) := by + congr 1; congr 1; omega + rw [h2] + have h_s2 := sp_trans + (sp_trans (R15 w2 (2 * (27 + 5) + (z2 - 67)) (27 + 5) l2 [19]) + (R9 27 (z2 - 67) w2 l2 [19])) + (R14 27 4 ((z2 - 67, w2) :: l2)) + exact (Advances.of_stepPlus h_s2 + (root_of_5 (validL_cons (by omega) (validL_cons hw2 hl2)))).to_leads + · have h1 : Bounce w1 l1 [z0, 33, 19] = + Bounce w1 l1 (((2 * (28 + 5) + (z0 - 69)) + 3) :: (28 + 5) :: [19]) := by + congr 1; congr 1; omega + rw [h1] + have h_step := sp_trans + (sp_trans (R15 w1 (2 * (28 + 5) + (z0 - 69)) (28 + 5) l1 [19]) + (R9 28 (z0 - 69) w1 l1 [19])) + (R14 28 4 ((z0 - 69, w1) :: l1)) + exact (Advances.of_stepPlus h_step + (root_of_5 (validL_cons (by omega) (validL_cons hw1 hl1)))).to_leads + · exact (Advances.of_stepPlus (sp_trans (R5 29 z' w l' [19]) (R14 29 4 ((z', w) :: l'))) + (root_of_5 (validL_cons (by omega) (validL_cons hw hl')))).to_leads + | succ rem ih => + intro j l hrem hj hl + have hj_lt : j < 33 := by omega + rcases l with _ | ⟨⟨z, w⟩, l'⟩ + · have h_eq : Bev j [] 33 [19] = Bev j [] (j + 1 + (32 - j)) [19] := by congr 1; omega + rw [h_eq] + refine Leads.of_stepPlus_leads (R4nil j (32 - j) [19]) ?_ + have e1 : j + 1 + (32 - j) = 33 := by omega + rw [e1] + exact ih (by omega) (by omega) validL_nil + · have hw : 27 ≤ w := validL_head hl + have hl' : ValidL l' := validL_tail hl + rcases z with _ | _ | z' + · refine Leads.of_stepPlus_leads (R6 j 33 w l' [19]) ?_ + exact (bodd_leads hl' (by omega) (by omega) (by omega)).trans + (fun _ hd => exit_single_forced_r9 (by omega) (by lin_omega) hd) + · refine Leads.of_stepPlus_leads (R7 j 33 w l' [19]) ?_ + refine (bodd_leads hl' (by omega) (by omega) (by omega)).trans ?_ + rintro d (⟨w1, l1, hl1, hw1, _, rfl⟩ | ⟨z0, w1, l1, hl1, hw1, hz0, hzw, rfl⟩) + · have h_step := sp_trans (R15 w1 30 19 l1 []) (R10 15 3 w1 l1 []) + exact Leads.of_stepPlus_leads h_step + (bodd_nil_leads_root hl1 (by omega) (by omega) (by omega)) + · have hz34 : 34 ≤ z0 := by lin_omega + have hzw92 : 92 ≤ z0 + w1 := by lin_omega + rcases Nat.lt_or_ge (z0 - 3) 66 with hlt | hge + · rcases mod2 (z0 - 3) with ⟨kp, hkp⟩ | ⟨kp, hkp⟩ + · have h1 : Bounce w1 l1 [z0, 33, 19] = + Bounce w1 l1 (((2 * kp) + 3) :: (kp + 1 + (33 - (kp + 1))) :: [19]) := by + congr 1; congr 1 + · omega + · congr 1; omega + rw [h1] + have h_step := sp_trans (R15 w1 (2 * kp) (kp + 1 + (33 - (kp + 1))) l1 [19]) + (R10 kp (33 - (kp + 1)) w1 l1 [19]) + have e1 : kp + 1 + (33 - (kp + 1)) + w1 + 6 = w1 + 39 := by omega + rw [e1] at h_step + refine Leads.of_stepPlus_leads h_step ?_ + exact (bodd_leads hl1 (by omega) (by omega) (by omega)).trans + (fun _ hd => exit_single_forced_r9 (by omega) (by lin_omega) hd) + · have h1 : Bounce w1 l1 [z0, 33, 19] = + Bounce w1 l1 (((2 * kp + 1) + 3) :: (kp + 1 + (33 - (kp + 1))) :: [19]) := by + congr 1; congr 1 + · omega + · congr 1; omega + rw [h1] + have h_step := sp_trans (R15 w1 (2 * kp + 1) (kp + 1 + (33 - (kp + 1))) l1 [19]) + (R11 kp (33 - (kp + 1)) w1 l1 [19]) + have e1 : kp + (33 - (kp + 1)) = 32 := by omega + rw [e1] at h_step + refine Leads.of_stepPlus_leads h_step ?_ + refine (bodd_leads hl1 (by omega) (by omega) (by omega)).trans ?_ + rintro d2 (⟨w2, l2, hl2, hw2, hodw2, rfl⟩ | ⟨z2, w2, l2, hl2, hw2, hz2, _, rfl⟩) + · have hw85 : 85 ≤ w2 := by lin_omega + have h_s2 := sp_trans (R15 w2 29 19 l2 []) (R11 14 4 w2 l2 []) + refine Leads.of_stepPlus_leads h_s2 ?_ + exact (bodd_leads hl2 (by omega) (by omega) (by omega)).trans + (fun _ hd => exit_single_forced_r9 (by omega) (by lin_omega) hd) + · have hz90 : 90 ≤ z2 := by lin_omega + have h2 : Bounce w2 l2 [z2, 32, 19] = + Bounce w2 l2 (((2 * (27 + 5) + (z2 - 67)) + 3) :: (27 + 5) :: [19]) := by + congr 1; congr 1; omega + rw [h2] + have h_s2 := sp_trans + (sp_trans (R15 w2 (2 * (27 + 5) + (z2 - 67)) (27 + 5) l2 [19]) + (R9 27 (z2 - 67) w2 l2 [19])) + (R14 27 4 ((z2 - 67, w2) :: l2)) + exact (Advances.of_stepPlus h_s2 + (root_of_5 (validL_cons (by omega) (validL_cons hw2 hl2)))).to_leads + · have h1 : Bounce w1 l1 [z0, 33, 19] = + Bounce w1 l1 (((2 * (28 + 5) + (z0 - 69)) + 3) :: (28 + 5) :: [19]) := by + congr 1; congr 1; omega + rw [h1] + have h_step := sp_trans + (sp_trans (R15 w1 (2 * (28 + 5) + (z0 - 69)) (28 + 5) l1 [19]) + (R9 28 (z0 - 69) w1 l1 [19])) + (R14 28 4 ((z0 - 69, w1) :: l1)) + exact (Advances.of_stepPlus h_step + (root_of_5 (validL_cons (by omega) (validL_cons hw1 hl1)))).to_leads + · have h_eq : Bev j ((z' + 2, w) :: l') 33 [19] = + Bev j ((z' + 2, w) :: l') (j + 1 + (32 - j)) [19] := by congr 1; omega + rw [h_eq] + refine Leads.of_stepPlus_leads (R4 j (32 - j) z' w l' [19]) ?_ + have e1 : j + 1 + (32 - j) = 33 := by omega + rw [e1] + exact ih (by omega) (by omega) (validL_cons hw hl') + +theorem bodd11_20_leads_root {l : List (ℕ × ℕ)} (hl : ValidL l) : + Leads tm (Bodd 11 l 20 []) RootInv := by + rcases l with _ | ⟨⟨z, w⟩, l'⟩ + · exact Leads.of_stepPlus_leads (R8nil 11 4 []) (bev_33_19_walk 33 rfl (by omega) validL_nil) + · have hw : 27 ≤ w := validL_head hl + have hl' : ValidL l' := validL_tail hl + rcases z with _ | _ | z' + · exact Leads.of_stepPlus_leads (R8a 11 20 w l' []) + (bev_nil_leads_root hl' (by omega) (by omega)) + · refine Leads.of_stepPlus_leads (R8b 11 20 w l' []) ?_ + exact (bodd_leads hl' (by omega) (by omega) (by omega)).trans + (fun _ hd => exit_single_forced_r9 (by omega) (by lin_omega) hd) + · exact Leads.of_stepPlus_leads (R8 11 4 z' w l' []) + (bev_33_19_walk 33 rfl (by omega) (validL_cons hw hl')) + +theorem r7_14_5_leads_root {j w : ℕ} {l' : List (ℕ × ℕ)} (hj : j ≤ 14) (hw : 27 ≤ w) (hl' : ValidL + l') : + Leads tm (Bev j ((1, w) :: l') 14 [5]) RootInv := by + refine Leads.of_stepPlus_leads (R7 j 14 w l' [5]) ?_ + refine (bodd_leads hl' (by omega) (by omega) (by omega)).trans ?_ + rintro d (⟨w1, l1, hl1, hw1, _, rfl⟩ | ⟨z0, w1, l1, hl1, hw1, hz0, _, rfl⟩) + · have h_step := sp_trans (sp_trans (R15 w1 11 5 l1 []) (R9 0 1 w1 l1 [])) (R12 0 ((1, w1) :: l1)) + exact (Advances.of_stepPlus h_step (root_of_5 (validL_cons hw1 hl1))).to_leads + · have hz34 : 34 ≤ z0 := by lin_omega + have h1 : Bounce w1 l1 [z0, 14, 5] = + Bounce w1 l1 (((2 * (9 + 5) + (z0 - 31)) + 3) :: (9 + 5) :: [5]) := by + congr 1; congr 1; omega + rw [h1] + have h_step := sp_trans + (sp_trans (R15 w1 (2 * (9 + 5) + (z0 - 31)) (9 + 5) l1 [5]) + (R9 9 (z0 - 31) w1 l1 [5])) + (R13 9 ((z0 - 31, w1) :: l1)) + exact Leads.of_stepPlus_leads h_step (bodd11_20_leads_root (validL_cons hw1 hl1)) + +theorem bev_14_5_walk (rem : ℕ) : ∀ {j : ℕ} {l : List (ℕ × ℕ)}, + rem = 14 - j → j ≤ 14 → ValidL l → Leads tm (Bev j l 14 [5]) RootInv := by + induction rem with + | zero => + intro j l hrem hj hl + have hj14 : j = 14 := by omega + subst hj14 + rcases l with _ | ⟨⟨z, w⟩, l'⟩ + · exact Leads.of_stepPlus_leads (sp_trans (R5nil 10 [5]) (R13 10 [])) + (bodd12_21_leads_root validL_nil) + · have hw : 27 ≤ w := validL_head hl + have hl' : ValidL l' := validL_tail hl + rcases z with _ | _ | z' + · refine Leads.of_stepPlus_leads (R6 14 14 w l' [5]) ?_ + exact (bodd_leads hl' (by omega) (by omega) (by omega)).trans + (fun _ hd => exit_5_leads_root (by lin_omega) hd) + · exact r7_14_5_leads_root (by omega) hw hl' + · exact Leads.of_stepPlus_leads (sp_trans (R5 10 z' w l' [5]) (R13 10 ((z', w) :: l'))) + (bodd12_21_leads_root (validL_cons hw hl')) + | succ rem ih => + intro j l hrem hj hl + rcases l with _ | ⟨⟨z, w⟩, l'⟩ + · have h_eq : Bev j [] 14 [5] = Bev j [] (j + 1 + (13 - j)) [5] := by congr 1; omega + rw [h_eq] + refine Leads.of_stepPlus_leads (R4nil j (13 - j) [5]) ?_ + have e1 : j + 1 + (13 - j) = 14 := by omega + rw [e1] + exact ih (by omega) (by omega) validL_nil + · have hw : 27 ≤ w := validL_head hl + have hl' : ValidL l' := validL_tail hl + rcases z with _ | _ | z' + · refine Leads.of_stepPlus_leads (R6 j 14 w l' [5]) ?_ + exact (bodd_leads hl' (by omega) (by omega) (by omega)).trans + (fun _ hd => exit_5_leads_root (by lin_omega) hd) + · exact r7_14_5_leads_root hj hw hl' + · have h_eq : Bev j ((z' + 2, w) :: l') 14 [5] = + Bev j ((z' + 2, w) :: l') (j + 1 + (13 - j)) [5] := by congr 1; omega + rw [h_eq] + refine Leads.of_stepPlus_leads (R4 j (13 - j) z' w l' [5]) ?_ + have e1 : j + 1 + (13 - j) = 14 := by omega + rw [e1] + exact ih (by omega) (by omega) (validL_cons hw hl') + +theorem bev0_ge18_leads_root {M : ℕ} {l : List (ℕ × ℕ)} (hM18 : 18 ≤ M) (hl : ValidL l) : + Leads tm (Bev 0 l (2 * M + 4) [M]) RootInv := by + refine (bev_leads hl (by omega) (by omega)).trans ?_ + rintro d (⟨w1, l1, hl1, hw1, _, rfl⟩ | ⟨z0, w1, l1, hl1, hw1, hz0, hzw, rfl⟩) + · have h_eq : Bounce w1 l1 [M] = Bounce w1 l1 [(M - 15) + 15] := by + congr 1; congr 1; omega + rw [h_eq] + exact (Advances.of_stepPlus (R14 w1 (M - 15) l1) (root_of_5 (validL_cons hw1 hl1))).to_leads + · have hz34 : 34 ≤ z0 := by lin_omega + rcases Nat.lt_or_ge (z0 - 3) (2 * M) with hlt | hge + · rcases mod2 (z0 - 3) with ⟨kp, hkp⟩ | ⟨kp, hkp⟩ + · have h1 : Bounce w1 l1 [z0, M] = + Bounce w1 l1 (((2 * kp) + 3) :: (kp + 1 + (M - (kp + 1))) :: []) := by + congr 1; congr 1 + · omega + · congr 1; omega + rw [h1] + have h_step := sp_trans (R15 w1 (2 * kp) (kp + 1 + (M - (kp + 1))) l1 []) + (R10 kp (M - (kp + 1)) w1 l1 []) + have e1 : kp + 1 + (M - (kp + 1)) + w1 + 6 = M + w1 + 6 := by omega + rw [e1] at h_step + exact Leads.of_stepPlus_leads h_step + (bodd_nil_leads_root hl1 (by omega) (by omega) (by omega)) + · have hM21 : 21 ≤ M := by lin_omega + have h1 : Bounce w1 l1 [z0, M] = + Bounce w1 l1 (((2 * kp + 1) + 3) :: (kp + 1 + (M - (kp + 1))) :: []) := by + congr 1; congr 1 + · omega + · congr 1; omega + rw [h1] + have h_step := sp_trans (R15 w1 (2 * kp + 1) (kp + 1 + (M - (kp + 1))) l1 []) + (R11 kp (M - (kp + 1)) w1 l1 []) + have e1 : kp + (M - (kp + 1)) = M - 1 := by omega + rw [e1] at h_step + refine Leads.of_stepPlus_leads h_step ?_ + rcases Nat.lt_or_ge M 35 with hsmall | hbig + · exact (bodd_leads hl1 (by omega) (by omega) (by omega)).trans + (fun _ hd => exit_single_forced_r9 (by omega) (by lin_omega) hd) + · exact (loop_leads hl1 (by omega) (by omega) (by omega) + (tx := 34) (tdw := 29) (txw := 63) (by omega) rfl (by omega) + (by lin_omega) (by lin_omega) (by lin_omega) (by lin_omega)).trans + (fun _ hd => exit_nil_leads_root (by omega) hd) + · have h_step := sp_trans + (sp_trans (R15 w1 (2 * ((M - 5) + 5) + (z0 - 3 - 2 * M)) ((M - 5) + 5) l1 []) + (R9 (M - 5) (z0 - 3 - 2 * M) w1 l1 [])) + (R12 (M - 5) ((z0 - 3 - 2 * M, w1) :: l1)) + have e1 : 2 * ((M - 5) + 5) + (z0 - 3 - 2 * M) + 3 = z0 := by omega + have e2 : (M - 5) + 5 = M := by omega + rw [e1, e2] at h_step + exact (Advances.of_stepPlus h_step (root_of_ge18 hM18 (validL_cons hw1 hl1))).to_leads + +theorem root_advances : ∀ c, RootInv c → Advances tm c RootInv := by + rintro _ ⟨M, l, hM_or, hl, rfl⟩ + rcases hM_or with rfl | hM18 + · rcases l with _ | ⟨⟨z, w⟩, l'⟩ + · have h_step : (Beq 5 []) [tm]⊢⁺ Beq 5 [(5, 31)] := by + refine sp_trans (R1nil 0) ?_ + refine sp_trans (bev0_nil_bounce 10 [5]) ?_ + refine sp_trans (R13 10 []) ?_ + refine sp_trans (R8nil 12 4 []) ?_ + refine sp_trans (bev0_nil_bounce 31 [20]) ?_ + exact R14 31 5 [] + exact Advances.of_stepPlus h_step (root_of_5 (validL_cons (by omega) validL_nil)) + · have hw : 27 ≤ w := validL_head hl + have hl' : ValidL l' := validL_tail hl + rcases z with _ | _ | z' + · exact Advances.of_stepPlus_leads (R2 5 w l') + (bev_nil_leads_root hl' (Nat.le_refl _) (by omega)) + · refine Advances.of_stepPlus_leads (R3 5 w l') ?_ + exact (bodd_leads hl' (by omega) (by omega) (by omega)).trans + (fun _ hd => exit_5_leads_root (by lin_omega) hd) + · exact Advances.of_stepPlus_leads (R1 0 z' w l') + (bev_14_5_walk 14 rfl (by omega) (validL_cons hw hl')) + · rcases l with _ | ⟨⟨z, w⟩, l'⟩ + · have h_eq : Beq M [] = Beq ((M - 5) + 5) [] := by congr 1; omega + rw [h_eq] + refine Advances.of_stepPlus_leads (R1nil (M - 5)) ?_ + have e1 : (M - 5) + 5 = M := by omega + rw [e1] + exact bev0_ge18_leads_root hM18 validL_nil + · have hw : 27 ≤ w := validL_head hl + have hl' : ValidL l' := validL_tail hl + rcases z with _ | _ | z' + · exact Advances.of_stepPlus_leads (R2 M w l') + (bev_nil_leads_root hl' (Nat.le_refl _) (by omega)) + · refine Advances.of_stepPlus_leads (R3 M w l') ?_ + rcases Nat.lt_or_ge M 35 with hsmall | hbig + · exact (bodd_leads hl' (by omega) (by omega) (by omega)).trans + (fun _ hd => exit_single_forced_r9 hM18 (by lin_omega) hd) + · exact (loop_leads hl' (by omega) (by omega) (by omega) + (tx := 34) (tdw := 29) (txw := 63) (by omega) rfl (by omega) + (by omega) (by omega) (by omega) (by omega)).trans + (fun _ hd => exit_nil_leads_root (by omega) hd) + · have h_eq : Beq M ((z' + 2, w) :: l') = Beq ((M - 5) + 5) ((z' + 2, w) :: l') := by + congr 1; omega + rw [h_eq] + refine Advances.of_stepPlus_leads (R1 (M - 5) z' w l') ?_ + have e1 : (M - 5) + 5 = M := by omega + rw [e1] + exact bev0_ge18_leads_root hM18 (validL_cons hw hl') + + + +end M240 + +namespace TM311Donor + +open BusyBeaver.Counter + +@[reducible] def donor311_machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RC_1LC0LE_0RA1RD_1RF1LB_1LD0LA_HHH0RC" + +abbrev donor311_tm : Machine (Fin 2) (Fin 6) := donor311_machine.toBB + + +abbrev LocalState := Counter.LocalState (Fin 2) (Fin 6) +@[simp] theorem append_nil (l : ListBlank (Fin 2)) : ([] : List (Fin 2)) +> l = l := rfl +@[simp] theorem append_cons (a : Fin 2) (as : List (Fin 2)) (l : ListBlank (Fin 2)) : + (a :: as) +> l = a >> (as +> l) := rfl + +def cfg_modeC (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + (((1 : Fin 2) >> (0 : Fin 2) >> l) {{2}}> r) + +def cfg_modeE1 (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + (((1 : Fin 2) >> (0 : Fin 2) >> l) <{{4}} ((0 : Fin 2) >> (1 : Fin 2) >> r)) + +def cfg_modeE0_first (l : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + (((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> l) <{{4}} ((0 : Fin 2) >> (1 : Fin 2) >> default)) + +def cfg_modeE0_loop (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + (((0 : Fin 2) >> l) <{{4}} ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> r)) + +def cfg_b101_mid (l : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + (((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> l) <{{4}} ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> default)) + +def cfg_e0f_mid (l : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + (((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + l) {{1}}> ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> default)) + +def cfg_e0l_mid (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + (((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + l) {{1}}> ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> ((1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> r))) + +def cfg_transA_mid (l : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + (((1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + l) {{1}}> ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> default)) + +def cfg_transB_mid (l r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := + (((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> l) {{1}}> ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> r)) + +theorem init_reaches_modeC : + (init []) [donor311_tm]⊢⁺ cfg_modeC ((0 : Fin 2) >> (1 : Fin 2) >> default) default := by + refine run_local_plus_eq (n := 9) (s1 := + ⟨[(0 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (0 : Fin 2)], 0, .right⟩) (s2 := + ⟨[(1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2)], ([] : List (Fin 2)), 2, + .right⟩) default default rfl ?_ ?_ + · simp only [cfg_of, init, Tape.mk₁, append_cons, append_nil, zero_cons_default, default_head, + default_tail]; rfl + · simp only [cfg_of, cfg_modeC, append_cons, append_nil, default_head, default_tail] + +theorem step_modeC_nil (l : ListBlank (Fin 2)) : + (cfg_modeC l default) [donor311_tm]⊢⁺ + cfg_modeE0_first l := by + refine run_local_plus_eq (n := 5) (s1 := + ⟨[(1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (0 : Fin 2), (0 : Fin 2)], 2, .right⟩) (s2 := + ⟨[(0 : Fin 2), (1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2)], 4, + .left⟩) l default rfl ?_ ?_ + · simp only [cfg_of, cfg_modeC, append_cons, append_nil, zero_cons_default, default_head, + default_tail] + · simp only [cfg_of, cfg_modeE0_first, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeC_b01 (l r : ListBlank (Fin 2)) : + (cfg_modeC l ((0 : Fin 2) >> (1 : Fin 2) >> r)) [donor311_tm]⊢⁺ + cfg_modeC ((1 : Fin 2) >> (0 : Fin 2) >> l) r := by + refine run_local_plus_eq (n := 1) (s1 := + ⟨[(1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2)], 2, .right⟩) (s2 := + ⟨[(1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2)], ([] : List (Fin 2)), 2, + .right⟩) l r rfl ?_ ?_ + · simp only [cfg_of, cfg_modeC, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeC, append_cons, append_nil] + +theorem step_modeC_b01_b10101 (l r : ListBlank (Fin 2)) : + (cfg_modeC l ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> r)) [donor311_tm]⊢⁺ + cfg_modeC ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + ((1 : Fin 2) >> (0 : Fin 2) >> l)) r := by + refine run_local_plus_eq (n := 6) (s1 := + ⟨[(1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), + (0 : Fin 2), (1 : Fin 2)], 2, .right⟩) (s2 := + ⟨[(1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (1 : Fin 2), (0 : Fin 2)], ([] : List (Fin 2)), 2, .right⟩) l r rfl ?_ ?_ + · simp only [cfg_of, cfg_modeC, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeC, append_cons, append_nil] + +theorem step_modeC_b11 (l r : ListBlank (Fin 2)) : + (cfg_modeC l ((1 : Fin 2) >> (1 : Fin 2) >> r)) [donor311_tm]⊢⁺ + cfg_modeE1 l r := by + refine run_local_plus_eq (n := 2) (s1 := + ⟨[(1 : Fin 2), (0 : Fin 2)], [(1 : Fin 2), (1 : Fin 2)], 2, .right⟩) (s2 := + ⟨[(1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2)], 4, .left⟩) l r rfl ?_ ?_ + · simp only [cfg_of, cfg_modeC, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeE1, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeC_b01_b000 (l r : ListBlank (Fin 2)) : + (cfg_modeC l ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + r)) [donor311_tm]⊢⁺ + cfg_modeE0_loop l r := by + refine run_local_plus_eq (n := 13) (s1 := + ⟨[(1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), + (0 : Fin 2)], 2, .right⟩) (s2 := + ⟨[(0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (1 : Fin 2)], 4, .left⟩) l r rfl ?_ ?_ + · simp only [cfg_of, cfg_modeC, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeE0_loop, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeC_b01_b101_nil_1 (l : ListBlank (Fin 2)) : + (cfg_modeC ((1 : Fin 2) >> (0 : Fin 2) >> l) ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + default)) [donor311_tm]⊢⁺ + cfg_b101_mid l := by + refine run_local_plus_eq (n := 33) (s1 := + ⟨[(1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2)], [(1 : Fin 2), (0 : Fin 2), (1 : Fin 2), + (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2)], 2, + .right⟩) (s2 := + ⟨[(1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2)], + [(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 4, + .left⟩) l default rfl ?_ ?_ + · simp only [cfg_of, cfg_modeC, append_cons, append_nil, zero_cons_default, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_b101_mid, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeC_b01_b101_nil_2 (l : ListBlank (Fin 2)) : + (cfg_b101_mid l) [donor311_tm]⊢⁺ + cfg_modeE1 ((1 : Fin 2) >> (0 : Fin 2) >> l) ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default) := by + refine run_local_plus_eq (n := 32) (s1 := + ⟨[(1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2)], + [(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 4, + .left⟩) (s2 := + ⟨[(1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 4, + .left⟩) l default rfl ?_ ?_ + · simp only [cfg_of, cfg_b101_mid, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeE1, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeC_b01_b1011101 (l r : ListBlank (Fin 2)) : + (cfg_modeC l ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> r)) [donor311_tm]⊢⁺ + cfg_modeE1 l ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> r) := by + refine run_local_plus_eq (n := 16) (s1 := + ⟨[(1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), + (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 2, .right⟩) (s2 := + ⟨[(1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), + (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 4, .left⟩) l r rfl ?_ ?_ + · simp only [cfg_of, cfg_modeC, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeE1, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeE1_base (r : ListBlank (Fin 2)) : + (cfg_modeE1 ((0 : Fin 2) >> (1 : Fin 2) >> default) r) [donor311_tm]⊢⁺ + cfg_modeC ((0 : Fin 2) >> (1 : Fin 2) >> default) + ((0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> + r))) := by + refine run_local_plus_eq (n := 24) (s1 := + ⟨[(1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), + (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2)], 4, .left⟩) (s2 := + ⟨[(1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 2, .right⟩) default r rfl ?_ ?_ + · simp only [cfg_of, cfg_modeE1, append_cons, append_nil, zero_cons_default, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeC, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeE1_b10 (l r : ListBlank (Fin 2)) : + (cfg_modeE1 ((1 : Fin 2) >> (0 : Fin 2) >> l) r) [donor311_tm]⊢⁺ + cfg_modeE1 l ((0 : Fin 2) >> (1 : Fin 2) >> r) := by + refine run_local_plus_eq (n := 5) (s1 := + ⟨[(1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2)], 4, + .left⟩) (s2 := + ⟨[(1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 4, + .left⟩) l r rfl ?_ ?_ + · simp only [cfg_of, cfg_modeE1, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeE1, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeC_b01_b101_nil (l : ListBlank (Fin 2)) : + (cfg_modeC l ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + default)) [donor311_tm]⊢⁺ + cfg_modeE1 l ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + ((0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> default))) := + stepPlus_stepPlus_stepPlus (step_modeC_b01 l _) + (stepPlus_stepPlus_stepPlus (step_modeC_b01_b101_nil_1 l) + (stepPlus_stepPlus_stepPlus (step_modeC_b01_b101_nil_2 l) (step_modeE1_b10 l _))) + +theorem step_modeE1_b011_10_base (r : ListBlank (Fin 2)) : + (cfg_modeE1 ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + ((0 : Fin 2) >> (1 : Fin 2) >> default)) r) [donor311_tm]⊢⁺ + cfg_modeC ((0 : Fin 2) >> (1 : Fin 2) >> default) + ((0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> r))) := by + refine run_local_plus_eq (n := 33) (s1 := + ⟨[(1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), + (1 : Fin 2)], 4, .left⟩) (s2 := + ⟨[(1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (1 : Fin 2)], 2, .right⟩) default r rfl ?_ ?_ + · simp only [cfg_of, cfg_modeE1, append_cons, append_nil, zero_cons_default, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeC, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeE1_b011_10_b10 (l r : ListBlank (Fin 2)) : + (cfg_modeE1 ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + ((1 : Fin 2) >> (0 : Fin 2) >> l)) r) [donor311_tm]⊢⁺ + cfg_modeE1 l ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> r) := by + refine run_local_plus_eq (n := 14) (s1 := + ⟨[(1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2)], 4, .left⟩) (s2 := + ⟨[(1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), + (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 4, .left⟩) l r rfl ?_ ?_ + · simp only [cfg_of, cfg_modeE1, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeE1, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeE0_first_base : + (cfg_modeE0_first ((0 : Fin 2) >> (1 : Fin 2) >> default)) [donor311_tm]⊢⁺ + cfg_modeC ((0 : Fin 2) >> (1 : Fin 2) >> default) + ((0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> + default))) := by + refine run_local_plus_eq (n := 24) (s1 := + ⟨[(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), + (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2)], 4, .left⟩) (s2 := + ⟨[(1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 2, .right⟩) default default rfl ?_ ?_ + · simp only [cfg_of, cfg_modeE0_first, append_cons, append_nil, zero_cons_default, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeC, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeE0_first_b10 (l : ListBlank (Fin 2)) : + (cfg_modeE0_first ((1 : Fin 2) >> (0 : Fin 2) >> l)) [donor311_tm]⊢⁺ + cfg_modeE0_loop l default := by + refine run_local_plus_eq (n := 5) (s1 := + ⟨[(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), + (1 : Fin 2)], 4, .left⟩) (s2 := + ⟨[(0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (1 : Fin 2)], 4, .left⟩) l default rfl ?_ ?_ + · simp only [cfg_of, cfg_modeE0_first, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeE0_loop, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeE0_first_b011_10_base_1 : + (cfg_modeE0_first ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + ((0 : Fin 2) >> (1 : Fin 2) >> default))) [donor311_tm]⊢⁺ + cfg_modeE1 ((0 : Fin 2) >> (1 : Fin 2) >> default) ((0 : Fin 2) >> (0 : Fin 2) >> + (0 : Fin 2) >> ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default)) := by + refine run_local_plus_eq (n := 35) (s1 := + ⟨[(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), + (0 : Fin 2), (0 : Fin 2), (1 : Fin 2)], [(0 : Fin 2), (1 : Fin 2)], 4, .left⟩) (s2 := + ⟨[(1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 4, + .left⟩) default default rfl ?_ ?_ + · simp only [cfg_of, cfg_modeE0_first, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeE1, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeE0_first_b011_10_base : + (cfg_modeE0_first ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + ((0 : Fin 2) >> (1 : Fin 2) >> default))) [donor311_tm]⊢⁺ + cfg_modeC ((0 : Fin 2) >> (1 : Fin 2) >> default) + ((0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> ((1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> default)))) := + stepPlus_stepPlus_stepPlus step_modeE0_first_b011_10_base_1 (step_modeE1_base _) + +theorem step_modeE0_first_b011_10_b10_1 (l : ListBlank (Fin 2)) : + (cfg_modeE0_first ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + ((1 : Fin 2) >> (0 : Fin 2) >> l))) [donor311_tm]⊢⁺ + cfg_e0f_mid l := by + refine run_local_plus_eq (n := 20) (s1 := + ⟨[(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), + (0 : Fin 2), (1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2)], 4, .left⟩) (s2 := + ⟨[(1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), + (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 1, + .right⟩) l default rfl ?_ ?_ + · simp only [cfg_of, cfg_modeE0_first, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_e0f_mid, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeE0_first_b011_10_b10_2 (l : ListBlank (Fin 2)) : + (cfg_e0f_mid l) [donor311_tm]⊢⁺ + cfg_modeE1 l ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default)) := by + refine run_local_plus_eq (n := 20) (s1 := + ⟨[(1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), + (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 1, .right⟩) (s2 := + ⟨[(1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 4, + .left⟩) l default rfl ?_ ?_ + · simp only [cfg_of, cfg_e0f_mid, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeE1, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeE0_first_b011_10_b10 (l : ListBlank (Fin 2)) : + (cfg_modeE0_first ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + ((1 : Fin 2) >> (0 : Fin 2) >> l))) [donor311_tm]⊢⁺ + cfg_modeE1 l ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default)) := + stepPlus_stepPlus_stepPlus (step_modeE0_first_b011_10_b10_1 l) (step_modeE0_first_b011_10_b10_2 l) + +theorem step_modeE0_loop_base (r : ListBlank (Fin 2)) : + (cfg_modeE0_loop ((0 : Fin 2) >> (1 : Fin 2) >> default) r) [donor311_tm]⊢⁺ + cfg_modeC ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + ((0 : Fin 2) >> (1 : Fin 2) >> default)) + ((0 : Fin 2) >> (1 : Fin 2) >> r) := by + refine run_local_plus_eq (n := 26) (s1 := + ⟨[(0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), + (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 4, .left⟩) (s2 := + ⟨[(1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (0 : Fin 2), (1 : Fin 2)], [(0 : Fin 2), (1 : Fin 2)], 2, .right⟩) default r rfl ?_ ?_ + · simp only [cfg_of, cfg_modeE0_loop, append_cons, append_nil, zero_cons_default, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeC, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeE0_loop_b10_base (r : ListBlank (Fin 2)) : + (cfg_modeE0_loop ((1 : Fin 2) >> (0 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> + default)) r) [donor311_tm]⊢⁺ + cfg_modeC ((0 : Fin 2) >> (1 : Fin 2) >> default) + ((0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> + ((1 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> r))))) := by + refine run_local_plus_eq (n := 24) (s1 := + ⟨[(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), + (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], + 4, .left⟩) (s2 := + ⟨[(1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 2, + .right⟩) default r rfl ?_ ?_ + · simp only [cfg_of, cfg_modeE0_loop, append_cons, append_nil, zero_cons_default, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeC, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeE0_loop_b10_b10 (l r : ListBlank (Fin 2)) : + (cfg_modeE0_loop ((1 : Fin 2) >> (0 : Fin 2) >> ((1 : Fin 2) >> (0 : Fin 2) >> + l)) r) [donor311_tm]⊢⁺ + cfg_modeE0_loop l ((1 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> r)) := by + refine run_local_plus_eq (n := 5) (s1 := + ⟨[(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), + (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 4, .left⟩) (s2 := + ⟨[(0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), + (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 4, .left⟩) l r rfl ?_ ?_ + · simp only [cfg_of, cfg_modeE0_loop, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeE0_loop, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeE0_loop_b10_b011_10_base_1 (r : ListBlank (Fin 2)) : + (cfg_modeE0_loop ((1 : Fin 2) >> (0 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> default))) r) [donor311_tm]⊢⁺ + cfg_modeE1 ((0 : Fin 2) >> (1 : Fin 2) >> default) ((0 : Fin 2) >> (0 : Fin 2) >> + (0 : Fin 2) >> ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> r)) := by + refine run_local_plus_eq (n := 35) (s1 := + ⟨[(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), + (0 : Fin 2), (0 : Fin 2), (1 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), + (0 : Fin 2), (1 : Fin 2)], 4, .left⟩) (s2 := + ⟨[(1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), + (0 : Fin 2), (1 : Fin 2)], 4, .left⟩) default r rfl ?_ ?_ + · simp only [cfg_of, cfg_modeE0_loop, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeE1, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeE0_loop_b10_b011_10_base (r : ListBlank (Fin 2)) : + (cfg_modeE0_loop ((1 : Fin 2) >> (0 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> default))) r) [donor311_tm]⊢⁺ + cfg_modeC ((0 : Fin 2) >> (1 : Fin 2) >> default) + ((0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> ((1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> r)))) := + stepPlus_stepPlus_stepPlus (step_modeE0_loop_b10_b011_10_base_1 r) (step_modeE1_base _) + +theorem step_modeE0_loop_b10_b011_10_b10_1 (l r : ListBlank (Fin 2)) : + (cfg_modeE0_loop ((1 : Fin 2) >> (0 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> ((1 : Fin 2) >> (0 : Fin 2) >> l))) r) [donor311_tm]⊢⁺ + cfg_e0l_mid l r := by + refine run_local_plus_eq (n := 20) (s1 := + ⟨[(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), + (0 : Fin 2), (1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), + (0 : Fin 2), (1 : Fin 2)], 4, .left⟩) (s2 := + ⟨[(1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), + (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), + (0 : Fin 2), (1 : Fin 2)], 1, .right⟩) l r rfl ?_ ?_ + · simp only [cfg_of, cfg_modeE0_loop, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_e0l_mid, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeE0_loop_b10_b011_10_b10_2 (l r : ListBlank (Fin 2)) : + (cfg_e0l_mid l r) [donor311_tm]⊢⁺ + cfg_modeE1 l ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> r)) := by + refine run_local_plus_eq (n := 20) (s1 := + ⟨[(1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), + (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), + (0 : Fin 2), (1 : Fin 2)], 1, .right⟩) (s2 := + ⟨[(1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), + (0 : Fin 2), (1 : Fin 2)], 4, .left⟩) l r rfl ?_ ?_ + · simp only [cfg_of, cfg_e0l_mid, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeE1, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeE0_loop_b10_b011_10_b10 (l r : ListBlank (Fin 2)) : + (cfg_modeE0_loop ((1 : Fin 2) >> (0 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> ((1 : Fin 2) >> (0 : Fin 2) >> l))) r) [donor311_tm]⊢⁺ + cfg_modeE1 l ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> r)) := + stepPlus_stepPlus_stepPlus (step_modeE0_loop_b10_b011_10_b10_1 l r) + (step_modeE0_loop_b10_b011_10_b10_2 l r) + +theorem step_modeE0_loop_b011_10 (l r : ListBlank (Fin 2)) : + (cfg_modeE0_loop ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + l) r) [donor311_tm]⊢⁺ + cfg_modeE1 l ((0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> + (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> r)))) := by + refine run_local_plus_eq (n := 27) (s1 := + ⟨[(0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), + (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 4, .left⟩) (s2 := + ⟨[(1 : Fin 2), (0 : Fin 2)], [(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 4, .left⟩) l r rfl ?_ ?_ + · simp only [cfg_of, cfg_modeE0_loop, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeE1, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeC_b01110_b10_b101_nil_1 (l : ListBlank (Fin 2)) : + (cfg_modeC ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + ((1 : Fin 2) >> (0 : Fin 2) >> l)) + ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default)) [donor311_tm]⊢⁺ + cfg_transA_mid l := by + refine run_local_plus_eq (n := 40) + (s1 := ⟨[(1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), + (0 : Fin 2), (1 : Fin 2), (0 : Fin 2)], + [(1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), + (0 : Fin 2), (0 : Fin 2), (0 : Fin 2)], 2, .right⟩) + (s2 := ⟨[(1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), + (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2)], + [(0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 1, + .right⟩) + l default rfl ?_ ?_ + · simp only [cfg_of, cfg_modeC, append_cons, append_nil, zero_cons_default, + Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_transA_mid, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeC_b01110_b10_b101_nil_2 (l : ListBlank (Fin 2)) : + (cfg_transA_mid l) [donor311_tm]⊢⁺ + cfg_modeE1 l ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> + ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> default)) := by + refine run_local_plus_eq (n := 40) + (s1 := ⟨[(1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), + (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2)], + [(0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 1, + .right⟩) + (s2 := ⟨[(1 : Fin 2), (0 : Fin 2)], + [(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), + (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 4, .left⟩) + l default rfl ?_ ?_ + · simp only [cfg_of, cfg_transA_mid, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeE1, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeC_b01110_b10_b101_nil (l : ListBlank (Fin 2)) : + (cfg_modeC ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + ((1 : Fin 2) >> (0 : Fin 2) >> l)) + ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default)) [donor311_tm]⊢⁺ + cfg_modeE1 l ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> + ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> default)) := + stepPlus_stepPlus_stepPlus (step_modeC_b01110_b10_b101_nil_1 l) (step_modeC_b01110_b10_b101_nil_2 + l) + +theorem step_modeC_b01110_b10_b0000101_1 (l r : ListBlank (Fin 2)) : + (cfg_modeC ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + ((1 : Fin 2) >> (0 : Fin 2) >> l)) + ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> r)) [donor311_tm]⊢⁺ + cfg_transB_mid l r := by + refine run_local_plus_eq (n := 23) + (s1 := ⟨[(1 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (1 : Fin 2), + (0 : Fin 2), (1 : Fin 2), (0 : Fin 2)], + [(0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (1 : Fin 2)], 2, .right⟩) + (s2 := ⟨[(1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), + (0 : Fin 2)], + [(1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 1, .right⟩) + l r rfl ?_ ?_ + · simp only [cfg_of, cfg_modeC, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_transB_mid, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeC_b01110_b10_b0000101_2 (l r : ListBlank (Fin 2)) : + (cfg_transB_mid l r) [donor311_tm]⊢⁺ + cfg_modeE1 l ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> + (1 : Fin 2) >> r)))) := by + refine run_local_plus_eq (n := 23) + (s1 := ⟨[(1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), + (0 : Fin 2)], + [(1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), + (1 : Fin 2), (0 : Fin 2), (1 : Fin 2)], 1, .right⟩) + (s2 := ⟨[(1 : Fin 2), (0 : Fin 2)], + [(0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (0 : Fin 2), + (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), (0 : Fin 2), (1 : Fin 2), + (0 : Fin 2), (1 : Fin 2)], 4, .left⟩) + l r rfl ?_ ?_ + · simp only [cfg_of, cfg_transB_mid, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + · simp only [cfg_of, cfg_modeE1, append_cons, append_nil, Turing.ListBlank.head_cons, + Turing.ListBlank.tail_cons] + +theorem step_modeC_b01110_b10_b0000101 (l r : ListBlank (Fin 2)) : + (cfg_modeC ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + ((1 : Fin 2) >> (0 : Fin 2) >> l)) + ((0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> r)) [donor311_tm]⊢⁺ + cfg_modeE1 l ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> + (1 : Fin 2) >> r)))) := + stepPlus_stepPlus_stepPlus (step_modeC_b01110_b10_b0000101_1 l r) + (step_modeC_b01110_b10_b0000101_2 l r) + +-- ============================================================================ +-- Parametric Left-Tape Encoding and Invariant +-- ============================================================================ + +def prepend10 : ℕ → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, l => l + | k + 1, l => (1 : Fin 2) >> (0 : Fin 2) >> prepend10 k l + +def encL_tail : List ℕ → ListBlank (Fin 2) + | [] => (0 : Fin 2) >> (1 : Fin 2) >> default + | k :: ks => + (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + prepend10 k (encL_tail ks) + +def encL (k₀ : ℕ) (ks : List ℕ) : ListBlank (Fin 2) := + prepend10 k₀ (encL_tail ks) + +@[simp] theorem encL_zero_nil : encL 0 [] = (0 : Fin 2) >> (1 : Fin 2) >> default := rfl +@[simp] theorem encL_succ (k : ℕ) (ks : List ℕ) : + encL (k + 1) ks = (1 : Fin 2) >> (0 : Fin 2) >> encL k ks := rfl +@[simp] theorem encL_zero_cons (k : ℕ) (ks : List ℕ) : + encL 0 (k :: ks) = + (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> encL k ks := rfl + +def prepend01 : ℕ → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, r => r + | k + 1, r => (0 : Fin 2) >> (1 : Fin 2) >> prepend01 k r + +theorem prepend01_add (a b : ℕ) (r : ListBlank (Fin 2)) : + prepend01 (a + b) r = prepend01 a (prepend01 b r) := by + induction a with + | zero => simp [prepend01] + | succ a ih => simp only [Nat.succ_add, prepend01, ih] + +def prepend11_01 : ℕ → ListBlank (Fin 2) → ListBlank (Fin 2) + | 0, r => r + | d + 1, r => (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> prepend11_01 d r + +theorem prepend11_01_add (a b : ℕ) (r : ListBlank (Fin 2)) : + prepend11_01 (a + b) r = prepend11_01 a (prepend11_01 b r) := by + induction a with + | zero => simp [prepend11_01] + | succ a ih => simp only [Nat.succ_add, prepend11_01, ih] + +-- ============================================================================ +-- Macro Transitions (Mode C / E1 / E0_loop) +-- ============================================================================ + +theorem modeC_prepend01_star : ∀ (n k₀ : ℕ) (ks : List ℕ) (r : ListBlank (Fin 2)), + (cfg_modeC (encL k₀ ks) (prepend01 n r)) [donor311_tm]⊢* + cfg_modeC (encL (k₀ + n) ks) r + | 0, k₀, ks, r => ⟨0, by simp [prepend01]⟩ + | n + 1, k₀, ks, r => by + have h1 : (cfg_modeC (encL k₀ ks) ((0 : Fin 2) >> (1 : Fin 2) >> prepend01 n r)) [donor311_tm]⊢⁺ + cfg_modeC (encL (k₀ + 1) ks) (prepend01 n r) := step_modeC_b01 (encL k₀ ks) (prepend01 n r) + have h2 := modeC_prepend01_star n (k₀ + 1) ks r + have heq : k₀ + 1 + n = k₀ + (n + 1) := by omega + rw [heq] at h2 + exact stepPlus_stepStar (stepPlus_stepStar_stepPlus h1 h2) + +theorem e0_loop_drain_pairs : ∀ (d rem : ℕ) (xs : List ℕ) (r : ListBlank (Fin 2)), + (cfg_modeE0_loop (encL (rem + 2 * d) xs) r) [donor311_tm]⊢* + cfg_modeE0_loop (encL rem xs) (prepend11_01 d r) + | 0, rem, xs, r => ⟨0, by simp [prepend11_01]⟩ + | d + 1, rem, xs, r => by + have heq : rem + 2 * (d + 1) = ((rem + 2 * d) + 1) + 1 := by omega + rw [heq] + have h1 : (cfg_modeE0_loop (encL (((rem + 2 * d) + 1) + 1) xs) r) [donor311_tm]⊢⁺ + cfg_modeE0_loop (encL (rem + 2 * d) xs) (prepend11_01 1 r) := + step_modeE0_loop_b10_b10 (encL (rem + 2 * d) xs) r + have h2 := e0_loop_drain_pairs d rem xs (prepend11_01 1 r) + rw [← prepend11_01_add] at h2 + exact stepPlus_stepStar (stepPlus_stepStar_stepPlus h1 h2) + +theorem modeE1_drain_k0 : ∀ (k₀ : ℕ) (ks : List ℕ) (r : ListBlank (Fin 2)), + (cfg_modeE1 (encL k₀ ks) r) [donor311_tm]⊢* + cfg_modeE1 (encL 0 ks) (prepend01 k₀ r) + | 0, ks, r => ⟨0, rfl⟩ + | k₀ + 1, ks, r => by + have h1 : (cfg_modeE1 (encL (k₀ + 1) ks) r) [donor311_tm]⊢⁺ + cfg_modeE1 (encL k₀ ks) (prepend01 1 r) := step_modeE1_b10 (encL k₀ ks) r + have h2 := modeE1_drain_k0 k₀ ks (prepend01 1 r) + rw [← prepend01_add] at h2 + exact stepPlus_stepStar (stepPlus_stepStar_stepPlus h1 h2) + +theorem modeE1_to_modeC : ∀ (ks : List ℕ) (k₀ : ℕ) (r : ListBlank (Fin 2)), + ValidKS ks → + let b := bump_enc k₀ ks + (cfg_modeE1 (encL k₀ ks) r) [donor311_tm]⊢⁺ cfg_modeC (encL b.1 b.2) r + | [], k₀, r, _ => by + dsimp [bump_enc] + have h1 := modeE1_drain_k0 k₀ [] r + have h2 : (cfg_modeE1 (encL 0 []) (prepend01 k₀ r)) [donor311_tm]⊢⁺ + cfg_modeC (encL 0 []) (prepend01 3 (prepend01 k₀ r)) := step_modeE1_base (prepend01 k₀ r) + rw [← prepend01_add, Nat.add_comm 3 k₀] at h2 + have h3 := modeC_prepend01_star (k₀ + 3) 0 [] r + rw [Nat.zero_add] at h3 + exact stepStar_stepPlus_stepPlus h1 (stepPlus_stepStar_stepPlus h2 h3) + | [k₁], k₀, r, _ => by + dsimp [bump_enc, add_last] + have h1 := modeE1_drain_k0 k₀ [k₁] r + cases k₁ with + | zero => + have h2 := step_modeE1_b011_10_base (prepend01 k₀ r) + have h3 := + step_modeC_b01 (encL 0 []) ((0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + prepend01 k₀ r)) + have h4 := + step_modeC_b01 (encL 1 []) ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> prepend01 k₀ r) + have h5 : (cfg_modeC (encL 2 []) ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> prepend01 k₀ r)) + [donor311_tm]⊢⁺ cfg_modeC (encL 0 [3]) (prepend01 k₀ r) := + step_modeC_b01_b10101 (encL 2 []) (prepend01 k₀ r) + have h6 := modeC_prepend01_star k₀ 0 [3] r + rw [Nat.zero_add] at h6 + exact stepStar_stepPlus_stepPlus h1 + (stepPlus_stepPlus_stepPlus h2 + (stepPlus_stepPlus_stepPlus h3 + (stepPlus_stepPlus_stepPlus h4 + (stepPlus_stepStar_stepPlus h5 h6)))) + | succ k₁' => + have h2 : (cfg_modeE1 (encL 0 [k₁' + 1]) (prepend01 k₀ r)) [donor311_tm]⊢⁺ + cfg_modeE1 (encL k₁' []) ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> prepend01 k₀ r) := + step_modeE1_b011_10_b10 (encL k₁' []) (prepend01 k₀ r) + have h3 := + modeE1_to_modeC [] k₁' ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> prepend01 k₀ r) trivial + dsimp [bump_enc] at h3 + have h4 : (cfg_modeC (encL (k₁' + 3) []) ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> prepend01 k₀ r)) + [donor311_tm]⊢⁺ cfg_modeC (encL 0 [k₁' + 4]) (prepend01 k₀ r) := + step_modeC_b01_b10101 (encL (k₁' + 3) []) (prepend01 k₀ r) + have h5 := modeC_prepend01_star k₀ 0 [k₁' + 4] r + rw [Nat.zero_add] at h5 + have heq : k₁' + 1 + 3 = k₁' + 4 := by omega + rw [heq] + exact stepStar_stepPlus_stepPlus h1 + (stepPlus_stepPlus_stepPlus h2 + (stepPlus_stepPlus_stepPlus h3 + (stepPlus_stepStar_stepPlus h4 h5))) + | k₁ :: k₂ :: ks'', k₀, r, ⟨hk1, hval'⟩ => by + dsimp [bump_enc, add_last] + cases k₁ with + | zero => omega + | succ k₁' => + have h1 := modeE1_drain_k0 k₀ ((k₁' + 1) :: k₂ :: ks'') r + have h2 : (cfg_modeE1 (encL 0 ((k₁' + 1) :: k₂ :: ks'')) (prepend01 k₀ r)) [donor311_tm]⊢⁺ + cfg_modeE1 (encL k₁' (k₂ :: ks'')) ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> prepend01 k₀ r) := + step_modeE1_b011_10_b10 (encL k₁' (k₂ :: ks'')) (prepend01 k₀ r) + have h3 := + modeE1_to_modeC (k₂ :: ks'') k₁' ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> prepend01 k₀ r) hval' + dsimp [bump_enc] at h3 + have h4 : (cfg_modeC (encL k₁' (add_last (k₂ :: ks'') 3)) ((0 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + prepend01 k₀ r)) + [donor311_tm]⊢⁺ cfg_modeC (encL 0 ((k₁' + 1) :: add_last (k₂ :: ks'') 3)) (prepend01 k₀ + r) := + step_modeC_b01_b10101 (encL k₁' (add_last (k₂ :: ks'') 3)) (prepend01 k₀ r) + have h5 := modeC_prepend01_star k₀ 0 ((k₁' + 1) :: add_last (k₂ :: ks'') 3) r + rw [Nat.zero_add] at h5 + exact stepStar_stepPlus_stepPlus h1 + (stepPlus_stepPlus_stepPlus h2 + (stepPlus_stepPlus_stepPlus h3 + (stepPlus_stepStar_stepPlus h4 h5))) + +theorem modeC_consume_11_01_nil : ∀ (n k₀ : ℕ) (r : ListBlank (Fin 2)), + (cfg_modeC (encL k₀ []) (prepend11_01 n r)) [donor311_tm]⊢* + cfg_modeC (encL (k₀ + 4 * n) []) r + | 0, k₀, r => ⟨0, by simp [prepend11_01]⟩ + | n + 1, k₀, r => by + have h1 := step_modeC_b11 (encL k₀ []) ((0 : Fin 2) >> (1 : Fin 2) >> prepend11_01 n r) + have h2 := modeE1_to_modeC [] k₀ ((0 : Fin 2) >> (1 : Fin 2) >> prepend11_01 n r) trivial + dsimp [bump_enc] at h2 + have h3 : (cfg_modeC (encL (k₀ + 3) []) ((0 : Fin 2) >> (1 : Fin 2) >> prepend11_01 n r)) + [donor311_tm]⊢⁺ cfg_modeC (encL (k₀ + 4) []) (prepend11_01 n r) := + step_modeC_b01 (encL (k₀ + 3) []) (prepend11_01 n r) + have h4 := modeC_consume_11_01_nil n (k₀ + 4) r + have heq : k₀ + 4 + 4 * n = k₀ + 4 * (n + 1) := by omega + rw [heq] at h4 + exact stepPlus_stepStar (stepPlus_stepPlus_stepPlus h1 (stepPlus_stepPlus_stepPlus h2 + (stepPlus_stepStar_stepPlus h3 h4))) + +theorem modeC_consume_11_01_nonempty : ∀ (n k₀ : ℕ) (ks : List ℕ) (r : ListBlank (Fin 2)), + ks ≠ [] → ValidKS ks → + (cfg_modeC (encL k₀ ks) (prepend11_01 n r)) [donor311_tm]⊢* + cfg_modeC (encL (k₀ + n) (add_last ks (3 * n))) r + | 0, k₀, ks, r, _, _ => ⟨0, by simp [prepend11_01, add_last_zero]⟩ + | n + 1, k₀, ks, r, hne, hval => by + have h1 := step_modeC_b11 (encL k₀ ks) ((0 : Fin 2) >> (1 : Fin 2) >> prepend11_01 n r) + have h2 := modeE1_to_modeC ks k₀ ((0 : Fin 2) >> (1 : Fin 2) >> prepend11_01 n r) hval + rw [bump_enc_nonempty k₀ hne] at h2 + have h3 : (cfg_modeC (encL k₀ (add_last ks 3)) ((0 : Fin 2) >> (1 : Fin 2) >> prepend11_01 n r)) + [donor311_tm]⊢⁺ cfg_modeC (encL (k₀ + 1) (add_last ks 3)) (prepend11_01 n r) := + step_modeC_b01 (encL k₀ (add_last ks 3)) (prepend11_01 n r) + have h4 := modeC_consume_11_01_nonempty n (k₀ + 1) (add_last ks 3) r + (add_last_ne_nil ks 3 hne) (ValidKS_add_last ks 3 hval) + rw [add_last_add] at h4 + have heq1 : k₀ + 1 + n = k₀ + (n + 1) := by omega + have heq2 : 3 + 3 * n = 3 * (n + 1) := by omega + rw [heq1, heq2] at h4 + exact stepPlus_stepStar (stepPlus_stepPlus_stepPlus h1 (stepPlus_stepPlus_stepPlus h2 + (stepPlus_stepStar_stepPlus h3 h4))) + +theorem unwrap_11_01_1011101_step (m₀ : ℕ) (ms : List ℕ) (R : ListBlank (Fin 2)) + (h_valid : ValidKS ms) : + let p := bump_enc_twice m₀ ms + (cfg_modeC (encL m₀ ms) + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> R)) + [donor311_tm]⊢⁺ + cfg_modeC (encL 0 ((p.1 + 1) :: p.2)) R := by + dsimp [bump_enc_twice] + set p1 := bump_enc m₀ ms + set p2 := bump_enc p1.1 p1.2 + have h1 := step_modeC_b11 (encL m₀ ms) + ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> R) + have h2 := modeE1_to_modeC ms m₀ + ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> R) h_valid + have h3 := step_modeC_b01_b1011101 (encL p1.1 p1.2) R + have h4 := modeE1_to_modeC p1.2 p1.1 + ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> R) + (ValidKS_bump_enc m₀ ms h_valid) + have h5 : (cfg_modeC (encL p2.1 p2.2) ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> R)) + [donor311_tm]⊢⁺ cfg_modeC (encL 0 ((p2.1 + 1) :: p2.2)) R := + step_modeC_b01_b10101 (encL p2.1 p2.2) R + exact stepPlus_stepPlus_stepPlus h1 + (stepPlus_stepPlus_stepPlus h2 + (stepPlus_stepPlus_stepPlus h3 + (stepPlus_stepPlus_stepPlus h4 h5))) + +-- ============================================================================ +-- Master Lemma 1: e0_loop_leave1_goodks +-- ============================================================================ + +set_option maxRecDepth 200000 in +theorem e0_loop_leave1_goodks : + ∀ (n : ℕ) (x₀ : ℕ) (xs : List ℕ) (S : ℕ) (R : ListBlank (Fin 2)), + xs.length = n → + S ≥ 36 → + (xs = [] → 2 * S ≤ 35 * x₀) → + (xs ≠ [] → x₀ ≥ 2 ∧ 2 * S ≤ 35 * (x₀ + 3)) → + GoodKS (2 * S + 63 * (x₀ + 3)) xs → + ∃ m₀ ms, + ((cfg_modeE0_loop (encL x₀ xs) R) [donor311_tm]⊢⁺ + cfg_modeC (encL m₀ ms) ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> R)) ∧ + ValidKS ms ∧ + (ms = [] → m₀ ≥ 7) ∧ + (let p := bump_enc_twice m₀ ms; GoodKS S ((p.1 + 1) :: p.2)) ∧ + ((xs = [] → x₀ ≥ 10) → S = 81 → + let p1 := bump_enc m₀ ms; GoodKS 81 ((p1.1 + 1) :: p1.2)) + | 0, x₀, xs, S, R, hlen, hS, h_nil, h_cons, h_gks => by + cases xs with + | cons _ _ => simp at hlen + | nil => + have hx0 : 2 * S ≤ 35 * x₀ := h_nil rfl + have hx0_ge : x₀ ≥ 3 := by omega + set d := x₀ / 2 + set rem := x₀ % 2 + have h_div : rem + 2 * d = x₀ := by omega + have h_rem : rem = 0 ∨ rem = 1 := by omega + rcases h_rem with h_even | h_odd + · -- Case 2: xs = [], x₀ = 2 * d (d ≥ 2) + have hd : d ≥ 2 := by omega + refine ⟨d, [3 * d - 3], ?_, trivial, by simp, ?_, ?_⟩ + · have hd_split : x₀ = 0 + 2 * d := by omega + rw [hd_split] + have h1 := e0_loop_drain_pairs d 0 [] R + have h2 : (cfg_modeE0_loop (encL 0 []) (prepend11_01 d R)) [donor311_tm]⊢⁺ + cfg_modeC (encL 0 [0]) ((0 : Fin 2) >> (1 : Fin 2) >> prepend11_01 d R) := + step_modeE0_loop_base (prepend11_01 d R) + have h3 : (cfg_modeC (encL 0 [0]) ((0 : Fin 2) >> (1 : Fin 2) >> + prepend11_01 d R)) [donor311_tm]⊢⁺ + cfg_modeC (encL 1 [0]) (prepend11_01 d R) := + step_modeC_b01 (encL 0 [0]) (prepend11_01 d R) + have hd_eq : d = (d - 1) + 1 := by omega + have h_p11 : prepend11_01 d R = prepend11_01 (d - 1) ((1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> R) := by + conv_lhs => rw [hd_eq] + rw [prepend11_01_add]; rfl + have h4 := modeC_consume_11_01_nonempty (d - 1) 1 [0] + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> R) (by simp) trivial + simp only [add_last, Nat.zero_add] at h4 + have heq1 : 1 + (d - 1) = d := by omega + have heq2 : 3 * (d - 1) = 3 * d - 3 := by omega + rw [← h_p11, heq1, heq2] at h4 + exact stepStar_stepPlus_stepPlus h1 (stepPlus_stepPlus_stepPlus h2 + (stepPlus_stepStar_stepPlus h3 h4)) + · simp only [bump_enc_twice, bump_enc, add_last, GoodKS] + refine ⟨by omega, ?_, trivial⟩ + omega + · intro hx10 hS81 + have hx10' : x₀ ≥ 10 := hx10 rfl + have hd5 : d ≥ 5 := by omega + simp only [bump_enc, add_last, GoodKS] + refine ⟨by omega, ?_, trivial⟩ + omega + · -- Case 1: xs = [], x₀ = 2 * d + 1 (d ≥ 1) + have hd : d ≥ 1 := by omega + refine ⟨4 * d + 3, [], ?_, trivial, fun _ => by omega, ?_, ?_⟩ + · have hd_split : x₀ = 1 + 2 * d := by omega + rw [hd_split] + have h1 := e0_loop_drain_pairs d 1 [] R + have h2 : (cfg_modeE0_loop (encL 1 []) (prepend11_01 d R)) [donor311_tm]⊢⁺ + cfg_modeC (encL 0 []) (prepend01 3 (prepend11_01 (d + 1) R)) := + step_modeE0_loop_b10_base (prepend11_01 d R) + have h3 := modeC_prepend01_star 3 0 [] (prepend11_01 (d + 1) R) + rw [Nat.zero_add] at h3 + have h_p11 : prepend11_01 (d + 1) R = prepend11_01 d ((1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> R) := by + rw [prepend11_01_add]; rfl + have h4 := + modeC_consume_11_01_nil d 3 ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> R) + have heq : 3 + 4 * d = 4 * d + 3 := by omega + rw [← h_p11, heq] at h4 + exact stepStar_stepPlus_stepPlus h1 (stepPlus_stepStar_stepPlus h2 (stepStar_trans h3 h4)) + · simp only [bump_enc_twice, bump_enc, GoodKS] + exact ⟨by omega, trivial⟩ + · intro _ _ + simp only [bump_enc, GoodKS] + exact ⟨by omega, trivial⟩ + | n' + 1, x₀, xs, S, R, hlen, hS, h_nil, h_cons, h_gks => by + cases xs with + | nil => simp at hlen + | cons x₁ xs_rest => + have hlen' : xs_rest.length = n' := by simpa using hlen + have ⟨hx0_ge, hx0_bound⟩ := h_cons (by simp) + have ⟨h_x1_bound, h_gks_rest⟩ := h_gks + have hx1_ge : x₁ ≥ 1 := by omega + have h_valid_xs : ValidKS (x₁ :: xs_rest) := + GoodKS_valid (x₁ :: xs_rest) (2 * S + 63 * (x₀ + 3)) (by omega) h_gks + have h_valid_rest : ValidKS xs_rest := + GoodKS_valid xs_rest (2 * S + 63 * (x₀ + 3) + 63 * (x₁ + 2)) (by omega) h_gks_rest + set d := x₀ / 2 + set rem := x₀ % 2 + have hd : d ≥ 1 := by omega + have h_rem : rem = 0 ∨ rem = 1 := by omega + rcases h_rem with h_even | h_odd + · -- Case 3: xs = x₁ :: xs_rest, x₀ = 2 * d (d ≥ 1) + have hd_split : x₀ = 0 + 2 * d := by omega + set b := bump_enc x₁ xs_rest + cases h_rest : xs_rest with + | nil => + -- Subcase 3a: xs_rest = [] + have hb : b = (x₁ + 3, []) := by simp [b, h_rest, bump_enc] + refine ⟨x₁ + 4 * d + 3, [], ?_, trivial, fun _ => by omega, ?_, ?_⟩ + · rw [hd_split] + have h1 := e0_loop_drain_pairs d 0 [x₁] R + have h2 : (cfg_modeE0_loop (encL 0 [x₁]) (prepend11_01 d R)) [donor311_tm]⊢⁺ + cfg_modeE1 (encL x₁ []) (prepend01 4 (prepend11_01 d R)) := + step_modeE0_loop_b011_10 (encL x₁ []) (prepend11_01 d R) + have h3 := modeE1_to_modeC [] x₁ (prepend01 4 (prepend11_01 d R)) trivial + dsimp only [bump_enc] at h3 + have h4 := modeC_prepend01_star 4 (x₁ + 3) [] (prepend11_01 d R) + have hd_eq : d = (d - 1) + 1 := by omega + have h_p11 : prepend11_01 d R = prepend11_01 (d - 1) ((1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> R) := by + conv_lhs => rw [hd_eq] + rw [prepend11_01_add]; rfl + have h5 := modeC_consume_11_01_nil (d - 1) (x₁ + 3 + 4) + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> R) + have heq : x₁ + 3 + 4 + 4 * (d - 1) = x₁ + 4 * d + 3 := by omega + rw [← h_p11, heq] at h5 + exact stepStar_stepPlus_stepPlus h1 + (stepPlus_stepPlus_stepPlus h2 + (stepPlus_stepStar_stepPlus h3 (stepStar_trans h4 h5))) + · simp only [bump_enc_twice, bump_enc, GoodKS] + exact ⟨by omega, trivial⟩ + · intro _ _ + simp only [bump_enc, GoodKS] + exact ⟨by omega, trivial⟩ + | cons x₂ rest' => + -- Subcase 3b: xs_rest = x₂ :: rest' + have hne_rest : (x₂ :: rest') ≠ [] := by simp + rw [h_rest] at h_gks_rest h_valid_rest + refine ⟨x₁ + d + 3, add_last (x₂ :: rest') (3 * d), ?_, + ValidKS_add_last (x₂ :: rest') (3 * d) h_valid_rest, + fun h_emp => absurd h_emp (add_last_ne_nil (x₂ :: rest') (3 * d) hne_rest), + ?_, ?_⟩ + · rw [hd_split] + have h1 := e0_loop_drain_pairs d 0 (x₁ :: x₂ :: rest') R + have h2 : (cfg_modeE0_loop (encL 0 (x₁ :: x₂ :: rest')) (prepend11_01 d R)) + [donor311_tm]⊢⁺ + cfg_modeE1 (encL x₁ (x₂ :: rest')) (prepend01 4 (prepend11_01 d R)) := + step_modeE0_loop_b011_10 (encL x₁ (x₂ :: rest')) (prepend11_01 d R) + have h3 := + modeE1_to_modeC (x₂ :: rest') x₁ (prepend01 4 (prepend11_01 d R)) h_valid_rest + rw [bump_enc_nonempty x₁ hne_rest] at h3 + dsimp only at h3 + have h4 := modeC_prepend01_star 4 x₁ (add_last (x₂ :: rest') 3) (prepend11_01 d R) + have hd_eq : d = (d - 1) + 1 := by omega + have h_p11 : prepend11_01 d R = prepend11_01 (d - 1) ((1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> R) := by + conv_lhs => rw [hd_eq] + rw [prepend11_01_add]; rfl + have h5 := modeC_consume_11_01_nonempty (d - 1) (x₁ + 4) (add_last (x₂ :: rest') 3) + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> R) + (add_last_ne_nil (x₂ :: rest') 3 hne_rest) + (ValidKS_add_last (x₂ :: rest') 3 h_valid_rest) + rw [add_last_add] at h5 + have heq1 : x₁ + 4 + (d - 1) = x₁ + d + 3 := by omega + have heq2 : 3 + 3 * (d - 1) = 3 * d := by omega + rw [← h_p11, heq1, heq2] at h5 + exact stepStar_stepPlus_stepPlus h1 + (stepPlus_stepPlus_stepPlus h2 + (stepPlus_stepStar_stepPlus h3 (stepStar_trans h4 h5))) + · rw [bump_enc_twice_nonempty (x₁ + d + 3) (add_last_ne_nil (x₂ :: rest') (3 * d) + hne_rest), add_last_add] + simp only [GoodKS] + refine ⟨by omega, ?_⟩ + apply GoodKS_add_last + exact GoodKS_mono (x₂ :: rest') _ _ (by omega) h_gks_rest + · intro _ hS81 + subst hS81 + rw [bump_enc_nonempty (x₁ + d + 3) (add_last_ne_nil (x₂ :: rest') (3 * d) hne_rest), + add_last_add] + simp only [GoodKS] + refine ⟨by omega, ?_⟩ + apply GoodKS_add_last + exact GoodKS_mono (x₂ :: rest') _ _ (by omega) h_gks_rest + · -- Case 4: xs = x₁ :: xs_rest, x₀ = 2 * d + 1 (d ≥ 1) + have hd_split : x₀ = 1 + 2 * d := by omega + set S_sub := S + 63 * (d + 2) + have hS_sub : S_sub ≥ 36 := by omega + have h_eq_2S : 2 * S + 63 * (x₀ + 3) = 2 * S_sub := by omega + have hx1_ge10 : x₁ ≥ 10 := by omega + set sub := bump_enc (x₁ - 1) xs_rest + have h_sub_len : sub.2.length = n' := by + cases xs_rest with + | nil => simpa [sub, bump_enc] using hlen' + | cons _ _ => simp [sub, bump_enc, add_last_length, hlen'] + have h_sub_nil : sub.2 = [] → 2 * S_sub ≤ 35 * sub.1 := by + cases xs_rest with + | nil => intro _; simp [sub, bump_enc]; omega + | cons y ys => + intro h_emp + exact absurd h_emp (add_last_ne_nil (y :: ys) 3 (by simp)) + have h_sub_cons : sub.2 ≠ [] → sub.1 ≥ 2 ∧ 2 * S_sub ≤ 35 * (sub.1 + 3) := by + cases xs_rest with + | nil => intro h_ne; simp [sub, bump_enc] at h_ne + | cons y ys => + intro _; simp [sub, bump_enc]; omega + have h_sub_gks : GoodKS (2 * S_sub + 63 * (sub.1 + 3)) sub.2 := by + cases xs_rest with + | nil => simp [sub, bump_enc, GoodKS] + | cons y ys => + simp only [sub, bump_enc] + have heq_s : 2 * S_sub + 63 * (x₁ - 1 + 3) = 2 * S + 63 * (x₀ + 3) + 63 * (x₁ + 2) := by + omega + rw [heq_s] + exact GoodKS_add_last (y :: ys) _ 3 h_gks_rest + set R_tail := + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> prepend11_01 d R + rcases e0_loop_leave1_goodks n' sub.1 sub.2 S_sub R_tail h_sub_len hS_sub h_sub_nil + h_sub_cons h_sub_gks + with ⟨y₀, ys, h_step_sub, h_val_ys, h_ys_emp, h_gks_sub, _⟩ + set py := bump_enc_twice y₀ ys + set ks_mid := (py.1 + 1) :: py.2 + have hne_mid : ks_mid ≠ [] := by simp [ks_mid] + have hval_mid : ValidKS ks_mid := GoodKS_succ_valid S_sub py.1 py.2 h_gks_sub + refine ⟨d - 1, add_last ks_mid (3 * (d - 1)), ?_, + ValidKS_add_last ks_mid (3 * (d - 1)) hval_mid, + fun h_emp => absurd h_emp (add_last_ne_nil ks_mid (3 * (d - 1)) hne_mid), + ?_, ?_⟩ + · rw [hd_split] + have h1 := e0_loop_drain_pairs d 1 (x₁ :: xs_rest) R + have hx1_eq : x₁ = (x₁ - 1) + 1 := by omega + have h2 : (cfg_modeE0_loop (encL 1 (x₁ :: xs_rest)) (prepend11_01 d R)) [donor311_tm]⊢⁺ + cfg_modeE1 (encL (x₁ - 1) xs_rest) + ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + R_tail) := by + rw [show encL 1 (x₁ :: xs_rest) = encL 1 (((x₁ - 1) + 1) :: xs_rest) by rw [← hx1_eq]] + exact step_modeE0_loop_b10_b011_10_b10 (encL (x₁ - 1) xs_rest) (prepend11_01 d R) + have h3 := modeE1_to_modeC xs_rest (x₁ - 1) + ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + R_tail) h_valid_rest + have h4 : (cfg_modeC (encL sub.1 sub.2) + ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> R_tail)) + [donor311_tm]⊢⁺ cfg_modeE0_loop (encL sub.1 sub.2) R_tail := + step_modeC_b01_b000 (encL sub.1 sub.2) R_tail + have h5 := unwrap_11_01_1011101_step y₀ ys (prepend11_01 d R) h_val_ys + have hd_eq : d = (d - 1) + 1 := by omega + have h_p11 : prepend11_01 d R = prepend11_01 (d - 1) ((1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> R) := by + conv_lhs => rw [hd_eq] + rw [prepend11_01_add]; rfl + have h6 := modeC_consume_11_01_nonempty (d - 1) 0 ks_mid + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> R) hne_mid hval_mid + rw [← h_p11, Nat.zero_add] at h6 + exact stepStar_stepPlus_stepPlus h1 + (stepPlus_stepPlus_stepPlus h2 + (stepPlus_stepPlus_stepPlus h3 + (stepPlus_stepPlus_stepPlus h4 + (stepPlus_stepPlus_stepPlus h_step_sub + (stepPlus_stepStar_stepPlus h5 h6))))) + · rw [bump_enc_twice_nonempty (d - 1) (add_last_ne_nil ks_mid (3 * (d - 1)) hne_mid), + add_last_add] + dsimp only + have hd1 : d - 1 + 1 = d := by omega + rw [hd1] + simp only [GoodKS] + refine ⟨by omega, ?_⟩ + exact GoodKS_add_last ks_mid S_sub (3 * (d - 1) + 6) h_gks_sub + · intro _ hS81 + subst hS81 + rw [bump_enc_nonempty (d - 1) (add_last_ne_nil ks_mid (3 * (d - 1)) hne_mid), + add_last_add] + dsimp only + have hd1 : d - 1 + 1 = d := by omega + rw [hd1] + simp only [GoodKS] + refine ⟨by omega, ?_⟩ + exact GoodKS_add_last ks_mid S_sub (3 * (d - 1) + 3) h_gks_sub + +-- ============================================================================ +-- Master Lemma 2a: k₀ ≥ 1 Transition (step_k0_pos) +-- ============================================================================ + +theorem step_k0_pos (k₀ : ℕ) (ks : List ℕ) (hk0 : k₀ ≥ 1) (h_inv : InvNil k₀ ks) : + ∃ k₀' ks', + ((cfg_modeC (encL k₀ ks) default) [donor311_tm]⊢⁺ cfg_modeC (encL k₀' ks') default) ∧ + InvNil k₀' ks' := by + set x₀ := k₀ - 1 + have hk0_eq : k₀ = x₀ + 1 := by omega + have h_to_e0 : (cfg_modeC (encL k₀ ks) default) [donor311_tm]⊢⁺ cfg_modeE0_loop (encL x₀ ks) + default := by + rw [hk0_eq] + exact stepPlus_stepPlus_stepPlus (step_modeC_nil (encL (x₀ + 1) ks)) (step_modeE0_first_b10 + (encL x₀ ks)) + set d := x₀ / 2 + set rem := x₀ % 2 + have h_rem : rem = 0 ∨ rem = 1 := by omega + rcases h_inv with ⟨ rfl, hk5 ⟩ | ⟨ hne, h_gks ⟩ + · -- ks = [], k₀ ≥ 5 (so x₀ ≥ 4) + rcases h_rem with h_even | h_odd + · -- Branch 2: ks = [], x₀ = 2 * d (d ≥ 2) + have hd : d ≥ 2 := by omega + have hx_split : x₀ = 0 + 2 * d := by omega + refine ⟨d + 1, [3 * d], ?_, Or.inr ⟨by simp, ?_⟩⟩ + · rw [hx_split] at h_to_e0 + have h1 := e0_loop_drain_pairs d 0 [] default + have h2 := step_modeE0_loop_base (prepend11_01 d default) + have h3 := step_modeC_b01 (encL 0 [0]) (prepend11_01 d default) + have h4 := modeC_consume_11_01_nonempty d 1 [0] default (by simp) trivial + simp only [add_last, Nat.zero_add] at h4 + have heq : 1 + d = d + 1 := by omega + rw [heq] at h4 + exact stepPlus_stepPlus_stepPlus h_to_e0 + (stepStar_stepPlus_stepPlus h1 + (stepPlus_stepPlus_stepPlus h2 + (stepPlus_stepStar_stepPlus h3 h4))) + · have hd1_ne : d + 1 ≠ 1 := by omega + simp only [hd1_ne, ite_false, GoodKS] + exact ⟨by omega, trivial⟩ + · -- Branch 1: ks = [], x₀ = 2 * d + 1 (d ≥ 2) + have hd : d ≥ 2 := by omega + have hx_split : x₀ = 1 + 2 * d := by omega + refine ⟨4 * d + 7, [], ?_, Or.inl ⟨rfl, by omega⟩⟩ + · rw [hx_split] at h_to_e0 + have h1 := e0_loop_drain_pairs d 1 [] default + have h2 : (cfg_modeE0_loop (encL 1 []) (prepend11_01 d default)) [donor311_tm]⊢⁺ + cfg_modeC (encL 0 []) (prepend01 3 (prepend11_01 (d + 1) default)) := + step_modeE0_loop_b10_base (prepend11_01 d default) + have h3 := modeC_prepend01_star 3 0 [] (prepend11_01 (d + 1) default) + rw [Nat.zero_add] at h3 + have h4 := modeC_consume_11_01_nil (d + 1) 3 default + have heq : 3 + 4 * (d + 1) = 4 * d + 7 := by omega + rw [heq] at h4 + exact stepPlus_stepPlus_stepPlus h_to_e0 + (stepStar_stepPlus_stepPlus h1 + (stepPlus_stepStar_stepPlus h2 (stepStar_trans h3 h4))) + · -- ks = k₁ :: ks_rest + cases ks with + | nil => contradiction + | cons k₁ ks_rest => + set S_in := if k₀ = 1 then 81 else 36 * (k₀ + 2) + have hS_in_ge : S_in ≥ 81 := by + dsimp [S_in]; split_ifs <;> omega + have ⟨hk1_bound, h_gks_rest⟩ := h_gks + have hk1_ge : k₁ ≥ 1 := by omega + have h_valid_rest : ValidKS ks_rest := + GoodKS_valid ks_rest (S_in + 63 * (k₁ + 2)) (by omega) h_gks_rest + rcases h_rem with h_even | h_odd + · -- Branch 3: ks = k₁ :: ks_rest, x₀ = 2 * d (d ≥ 0, k₀ = 2 * d + 1) + have hx_split : x₀ = 0 + 2 * d := by omega + cases ks_rest with + | nil => + refine ⟨k₁ + 4 * d + 7, [], ?_, Or.inl ⟨rfl, by omega⟩⟩ + rw [hx_split] at h_to_e0 + have h1 := e0_loop_drain_pairs d 0 [k₁] default + have h2 : (cfg_modeE0_loop (encL 0 [k₁]) (prepend11_01 d default)) [donor311_tm]⊢⁺ + cfg_modeE1 (encL k₁ []) (prepend01 4 (prepend11_01 d default)) := + step_modeE0_loop_b011_10 (encL k₁ []) (prepend11_01 d default) + have h3 := modeE1_to_modeC [] k₁ (prepend01 4 (prepend11_01 d default)) trivial + dsimp [bump_enc] at h3 + have h4 := modeC_prepend01_star 4 (k₁ + 3) [] (prepend11_01 d default) + have h5 := modeC_consume_11_01_nil d (k₁ + 3 + 4) default + have heq : k₁ + 3 + 4 + 4 * d = k₁ + 4 * d + 7 := by omega + rw [heq] at h5 + exact stepPlus_stepPlus_stepPlus h_to_e0 + (stepStar_stepPlus_stepPlus h1 + (stepPlus_stepPlus_stepPlus h2 + (stepPlus_stepStar_stepPlus h3 (stepStar_trans h4 h5)))) + | cons k₂ rest' => + have hne_rest : (k₂ :: rest') ≠ [] := by simp + refine ⟨k₁ + d + 4, add_last (k₂ :: rest') (3 * d + 3), ?_, + Or.inr ⟨add_last_ne_nil (k₂ :: rest') (3 * d + 3) hne_rest, ?_⟩⟩ + · rw [hx_split] at h_to_e0 + have h1 := e0_loop_drain_pairs d 0 (k₁ :: k₂ :: rest') default + have h2 : (cfg_modeE0_loop (encL 0 (k₁ :: k₂ :: rest')) (prepend11_01 d default)) + [donor311_tm]⊢⁺ + cfg_modeE1 (encL k₁ (k₂ :: rest')) (prepend01 4 (prepend11_01 d default)) := + step_modeE0_loop_b011_10 (encL k₁ (k₂ :: rest')) (prepend11_01 d default) + have h3 := + modeE1_to_modeC (k₂ :: rest') k₁ (prepend01 4 (prepend11_01 d default)) h_valid_rest + rw [bump_enc_nonempty k₁ hne_rest] at h3 + have h4 := modeC_prepend01_star 4 k₁ (add_last (k₂ :: rest') 3) (prepend11_01 d default) + have h5 := modeC_consume_11_01_nonempty d (k₁ + 4) (add_last (k₂ :: rest') 3) default + (add_last_ne_nil (k₂ :: rest') 3 hne_rest) + (ValidKS_add_last (k₂ :: rest') 3 h_valid_rest) + rw [add_last_add] at h5 + have heq1 : k₁ + 4 + d = k₁ + d + 4 := by omega + have heq2 : 3 + 3 * d = 3 * d + 3 := by omega + rw [heq1, heq2] at h5 + exact stepPlus_stepPlus_stepPlus h_to_e0 + (stepStar_stepPlus_stepPlus h1 + (stepPlus_stepPlus_stepPlus h2 + (stepPlus_stepStar_stepPlus h3 (stepStar_trans h4 h5)))) + · have h_ne1 : k₁ + d + 4 ≠ 1 := by omega + simp only [h_ne1, ite_false] + apply GoodKS_add_last + apply GoodKS_mono (k₂ :: rest') _ (S_in + 63 * (k₁ + 2)) ?_ h_gks_rest + dsimp [S_in]; split_ifs <;> omega + · -- Branch 4: ks = k₁ :: ks_rest, x₀ = 2 * d + 1 (d ≥ 0, k₀ = 2 * d + 2 ≥ 2) + have hx_split : x₀ = 1 + 2 * d := by omega + have hk0_ne1 : k₀ ≠ 1 := by omega + have hS_in_eq : S_in = 72 * (d + 2) := by + dsimp [S_in]; split_ifs <;> omega + set S_sub := 36 * (d + 2) + have hS_sub : S_sub ≥ 36 := by omega + have hk1_ge3 : k₁ ≥ 3 := by omega + set sub := bump_enc (k₁ - 1) ks_rest + have h_sub_nil : sub.2 = [] → 2 * S_sub ≤ 35 * sub.1 := by + cases ks_rest with + | nil => intro _; simp [sub, bump_enc]; omega + | cons y ys => intro h_emp; exact absurd h_emp (add_last_ne_nil (y :: ys) 3 (by simp)) + have h_sub_cons : sub.2 ≠ [] → sub.1 ≥ 2 ∧ 2 * S_sub ≤ 35 * (sub.1 + 3) := by + cases ks_rest with + | nil => intro h_ne; simp [sub, bump_enc] at h_ne + | cons y ys => intro _; simp [sub, bump_enc]; omega + have h_sub_gks : GoodKS (2 * S_sub + 63 * (sub.1 + 3)) sub.2 := by + cases ks_rest with + | nil => simp [sub, bump_enc, GoodKS] + | cons y ys => + simp only [sub, bump_enc] + have heq_s : 2 * S_sub + 63 * (k₁ - 1 + 3) = S_in + 63 * (k₁ + 2) := by omega + rw [heq_s] + exact GoodKS_add_last (y :: ys) _ 3 h_gks_rest + set R_tail := + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> prepend11_01 d default + rcases e0_loop_leave1_goodks sub.2.length sub.1 sub.2 S_sub R_tail rfl hS_sub h_sub_nil + h_sub_cons h_sub_gks + with ⟨y₀, ys, h_step_sub, h_val_ys, _, h_gks_sub, _⟩ + set py := bump_enc_twice y₀ ys + set ks_mid := (py.1 + 1) :: py.2 + have hne_mid : ks_mid ≠ [] := by simp [ks_mid] + have hval_mid : ValidKS ks_mid := GoodKS_succ_valid S_sub py.1 py.2 h_gks_sub + refine ⟨d, add_last ks_mid (3 * d), ?_, + Or.inr ⟨add_last_ne_nil ks_mid (3 * d) hne_mid, ?_⟩⟩ + · rw [hx_split] at h_to_e0 + have h1 := e0_loop_drain_pairs d 1 (k₁ :: ks_rest) default + have hk1_eq : k₁ = (k₁ - 1) + 1 := by omega + have h2 : (cfg_modeE0_loop (encL 1 (k₁ :: ks_rest)) (prepend11_01 d default)) + [donor311_tm]⊢⁺ + cfg_modeE1 (encL (k₁ - 1) ks_rest) + ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + R_tail) := by + rw [show encL 1 (k₁ :: ks_rest) = encL 1 (((k₁ - 1) + 1) :: ks_rest) by rw [← hk1_eq]] + exact step_modeE0_loop_b10_b011_10_b10 (encL (k₁ - 1) ks_rest) (prepend11_01 d default) + have h3 := modeE1_to_modeC ks_rest (k₁ - 1) + ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + R_tail) h_valid_rest + have h4 : (cfg_modeC (encL sub.1 sub.2) + ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> R_tail)) + [donor311_tm]⊢⁺ cfg_modeE0_loop (encL sub.1 sub.2) R_tail := + step_modeC_b01_b000 (encL sub.1 sub.2) R_tail + have h5 := unwrap_11_01_1011101_step y₀ ys (prepend11_01 d default) h_val_ys + have h6 := modeC_consume_11_01_nonempty d 0 ks_mid default hne_mid hval_mid + rw [Nat.zero_add] at h6 + exact stepPlus_stepPlus_stepPlus h_to_e0 + (stepStar_stepPlus_stepPlus h1 + (stepPlus_stepPlus_stepPlus h2 + (stepPlus_stepPlus_stepPlus h3 + (stepPlus_stepPlus_stepPlus h4 + (stepPlus_stepPlus_stepPlus h_step_sub + (stepPlus_stepStar_stepPlus h5 h6)))))) + · apply GoodKS_add_last + apply GoodKS_mono ks_mid _ S_sub ?_ h_gks_sub + split_ifs <;> omega + +-- ============================================================================ +-- Master Lemma 2b: Drain at R = 01 >> 01 >> default (Cases 0a & 0b of k₀ = 0) +-- ============================================================================ + +set_option maxRecDepth 200000 in +theorem e0_loop_drain_plus2 (w₀ : ℕ) (ws : List ℕ) (S_w : ℕ) + (h_empty : ws = [] → w₀ ≥ 4) + (h_sw : 36 ≤ S_w + 54 * (w₀ / 2)) + (h_gks : GoodKS (S_w + 63 * (w₀ + 3)) ws) : + ∃ k₀' ks', + ((cfg_modeE0_loop (encL w₀ ws) ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + default)) + [donor311_tm]⊢⁺ cfg_modeC (encL k₀' ks') default) ∧ + InvNil k₀' ks' := by + set R0 := (0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default + have hR0 : R0 = prepend01 2 default := rfl + set d := w₀ / 2 + set rem := w₀ % 2 + have h_rem : rem = 0 ∨ rem = 1 := by omega + cases ws with + | nil => + have hw4 : w₀ ≥ 4 := h_empty rfl + rcases h_rem with h_even | h_odd + · -- Case 2: ws = [], w₀ = 2 * d (d ≥ 2) + have hd : d ≥ 2 := by omega + have hw_split : w₀ = 0 + 2 * d := by omega + refine ⟨d + 3, [3 * d], ?_, Or.inr ⟨by simp, ?_⟩⟩ + · rw [hw_split] + have h1 := e0_loop_drain_pairs d 0 [] R0 + have h2 := step_modeE0_loop_base (prepend11_01 d R0) + have h3 := step_modeC_b01 (encL 0 [0]) (prepend11_01 d R0) + have h4 := modeC_consume_11_01_nonempty d 1 [0] R0 (by simp) trivial + simp only [add_last, Nat.zero_add] at h4 + rw [hR0] at h4 + have h5 := modeC_prepend01_star 2 (1 + d) [3 * d] default + have heq : 1 + d + 2 = d + 3 := by omega + rw [heq] at h5 + exact stepStar_stepPlus_stepPlus h1 + (stepPlus_stepPlus_stepPlus h2 + (stepPlus_stepStar_stepPlus h3 (stepStar_trans h4 h5))) + · have hd3_ne : d + 3 ≠ 1 := by omega + simp only [hd3_ne, ite_false, GoodKS] + exact ⟨by omega, trivial⟩ + · -- Case 1: ws = [], w₀ = 2 * d + 1 (d ≥ 1) + have hd : d ≥ 1 := by omega + have hw_split : w₀ = 1 + 2 * d := by omega + refine ⟨4 * d + 9, [], ?_, Or.inl ⟨rfl, by omega⟩⟩ + · rw [hw_split] + have h1 := e0_loop_drain_pairs d 1 [] R0 + have h2 : (cfg_modeE0_loop (encL 1 []) (prepend11_01 d R0)) [donor311_tm]⊢⁺ + cfg_modeC (encL 0 []) (prepend01 3 (prepend11_01 (d + 1) R0)) := + step_modeE0_loop_b10_base (prepend11_01 d R0) + have h3 := modeC_prepend01_star 3 0 [] (prepend11_01 (d + 1) R0) + rw [Nat.zero_add] at h3 + have h4 := modeC_consume_11_01_nil (d + 1) 3 R0 + rw [hR0] at h4 + have h5 := modeC_prepend01_star 2 (3 + 4 * (d + 1)) [] default + have heq : 3 + 4 * (d + 1) + 2 = 4 * d + 9 := by omega + rw [heq] at h5 + exact stepStar_stepPlus_stepPlus h1 + (stepPlus_stepStar_stepPlus h2 (stepStar_trans h3 (stepStar_trans h4 h5))) + | cons w₁ ws_rest => + have ⟨hw1_bound, h_gks_rest⟩ := h_gks + have hw1_ge : w₁ ≥ 4 := by omega + have h_valid_rest : ValidKS ws_rest := + GoodKS_valid ws_rest (S_w + 63 * (w₀ + 3) + 63 * (w₁ + 2)) (by omega) h_gks_rest + rcases h_rem with h_even | h_odd + · -- Case 3: ws = w₁ :: ws_rest, w₀ = 2 * d (d ≥ 0) + have hw_split : w₀ = 0 + 2 * d := by omega + cases ws_rest with + | nil => + refine ⟨w₁ + 4 * d + 9, [], ?_, Or.inl ⟨rfl, by omega⟩⟩ + rw [hw_split] + have h1 := e0_loop_drain_pairs d 0 [w₁] R0 + have h2 : (cfg_modeE0_loop (encL 0 [w₁]) (prepend11_01 d R0)) [donor311_tm]⊢⁺ + cfg_modeE1 (encL w₁ []) (prepend01 4 (prepend11_01 d R0)) := + step_modeE0_loop_b011_10 (encL w₁ []) (prepend11_01 d R0) + have h3 := modeE1_to_modeC [] w₁ (prepend01 4 (prepend11_01 d R0)) trivial + dsimp [bump_enc] at h3 + have h4 := modeC_prepend01_star 4 (w₁ + 3) [] (prepend11_01 d R0) + have h5 := modeC_consume_11_01_nil d (w₁ + 3 + 4) R0 + rw [hR0] at h5 + have h6 := modeC_prepend01_star 2 (w₁ + 3 + 4 + 4 * d) [] default + have heq : w₁ + 3 + 4 + 4 * d + 2 = w₁ + 4 * d + 9 := by omega + rw [heq] at h6 + exact stepStar_stepPlus_stepPlus h1 + (stepPlus_stepPlus_stepPlus h2 + (stepPlus_stepStar_stepPlus h3 (stepStar_trans h4 (stepStar_trans h5 h6)))) + | cons w₂ rest' => + have hne_rest : (w₂ :: rest') ≠ [] := by simp + refine ⟨w₁ + d + 6, add_last (w₂ :: rest') (3 * d + 3), ?_, + Or.inr ⟨add_last_ne_nil (w₂ :: rest') (3 * d + 3) hne_rest, ?_⟩⟩ + · rw [hw_split] + have h1 := e0_loop_drain_pairs d 0 (w₁ :: w₂ :: rest') R0 + have h2 : (cfg_modeE0_loop (encL 0 (w₁ :: w₂ :: rest')) (prepend11_01 d R0)) + [donor311_tm]⊢⁺ + cfg_modeE1 (encL w₁ (w₂ :: rest')) (prepend01 4 (prepend11_01 d R0)) := + step_modeE0_loop_b011_10 (encL w₁ (w₂ :: rest')) (prepend11_01 d R0) + have h3 := modeE1_to_modeC (w₂ :: rest') w₁ (prepend01 4 (prepend11_01 d R0)) h_valid_rest + rw [bump_enc_nonempty w₁ hne_rest] at h3 + have h4 := modeC_prepend01_star 4 w₁ (add_last (w₂ :: rest') 3) (prepend11_01 d R0) + have h5 := modeC_consume_11_01_nonempty d (w₁ + 4) (add_last (w₂ :: rest') 3) R0 + (add_last_ne_nil (w₂ :: rest') 3 hne_rest) + (ValidKS_add_last (w₂ :: rest') 3 h_valid_rest) + have heq1 : w₁ + 4 + d + 2 = w₁ + d + 6 := by omega + have heq2 : 3 + 3 * d = 3 * d + 3 := by omega + rw [add_last_add, heq2, hR0] at h5 + have h6 := + modeC_prepend01_star 2 (w₁ + 4 + d) (add_last (w₂ :: rest') (3 * d + 3)) default + rw [heq1] at h6 + exact stepStar_stepPlus_stepPlus h1 + (stepPlus_stepPlus_stepPlus h2 + (stepPlus_stepStar_stepPlus h3 (stepStar_trans h4 (stepStar_trans h5 h6)))) + · have h_ne1 : w₁ + d + 6 ≠ 1 := by omega + simp only [h_ne1, ite_false] + apply GoodKS_add_last + exact GoodKS_mono (w₂ :: rest') _ _ (by omega) h_gks_rest + · -- Case 4: ws = w₁ :: ws_rest, w₀ = 2 * d + 1 (d ≥ 0) + have hw_split : w₀ = 1 + 2 * d := by omega + set S_sub := 36 * (d + 4) + have hS_sub : S_sub ≥ 36 := by omega + have h_2S_le : 2 * S_sub ≤ S_w + 63 * (w₀ + 3) := by omega + set sub := bump_enc (w₁ - 1) ws_rest + have h_sub_nil : sub.2 = [] → 2 * S_sub ≤ 35 * sub.1 := by + cases ws_rest with + | nil => intro _; simp [sub, bump_enc]; omega + | cons y ys => intro h_emp; exact absurd h_emp (add_last_ne_nil (y :: ys) 3 (by simp)) + have h_sub_cons : sub.2 ≠ [] → sub.1 ≥ 2 ∧ 2 * S_sub ≤ 35 * (sub.1 + 3) := by + cases ws_rest with + | nil => intro h_ne; simp [sub, bump_enc] at h_ne + | cons y ys => intro _; simp [sub, bump_enc]; omega + have h_sub_gks : GoodKS (2 * S_sub + 63 * (sub.1 + 3)) sub.2 := by + cases ws_rest with + | nil => simp [sub, bump_enc, GoodKS] + | cons y ys => + simp only [sub, bump_enc] + apply GoodKS_add_last + exact GoodKS_mono (y :: ys) _ _ (by omega) h_gks_rest + set R_tail := + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> prepend11_01 d R0 + rcases e0_loop_leave1_goodks sub.2.length sub.1 sub.2 S_sub R_tail rfl hS_sub h_sub_nil + h_sub_cons h_sub_gks + with ⟨y₀, ys, h_step_sub, h_val_ys, _, h_gks_sub, _⟩ + set py := bump_enc_twice y₀ ys + set ks_mid := (py.1 + 1) :: py.2 + have hne_mid : ks_mid ≠ [] := by simp [ks_mid] + have hval_mid : ValidKS ks_mid := GoodKS_succ_valid S_sub py.1 py.2 h_gks_sub + refine ⟨d + 2, add_last ks_mid (3 * d), ?_, + Or.inr ⟨add_last_ne_nil ks_mid (3 * d) hne_mid, ?_⟩⟩ + · rw [hw_split] + have h1 := e0_loop_drain_pairs d 1 (w₁ :: ws_rest) R0 + have hw1_eq : w₁ = (w₁ - 1) + 1 := by omega + have h2 : (cfg_modeE0_loop (encL 1 (w₁ :: ws_rest)) (prepend11_01 d R0)) [donor311_tm]⊢⁺ + cfg_modeE1 (encL (w₁ - 1) ws_rest) + ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> R_tail) := + by + rw [show encL 1 (w₁ :: ws_rest) = encL 1 (((w₁ - 1) + 1) :: ws_rest) by rw [← hw1_eq]] + exact step_modeE0_loop_b10_b011_10_b10 (encL (w₁ - 1) ws_rest) (prepend11_01 d R0) + have h3 := modeE1_to_modeC ws_rest (w₁ - 1) + ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + R_tail) h_valid_rest + have h4 : (cfg_modeC (encL sub.1 sub.2) + ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> R_tail)) + [donor311_tm]⊢⁺ cfg_modeE0_loop (encL sub.1 sub.2) R_tail := + step_modeC_b01_b000 (encL sub.1 sub.2) R_tail + have h5 := unwrap_11_01_1011101_step y₀ ys (prepend11_01 d R0) h_val_ys + have h6 := modeC_consume_11_01_nonempty d 0 ks_mid R0 hne_mid hval_mid + rw [Nat.zero_add, hR0] at h6 + have h7 := modeC_prepend01_star 2 d (add_last ks_mid (3 * d)) default + exact stepStar_stepPlus_stepPlus h1 + (stepPlus_stepPlus_stepPlus h2 + (stepPlus_stepPlus_stepPlus h3 + (stepPlus_stepPlus_stepPlus h4 + (stepPlus_stepPlus_stepPlus h_step_sub + (stepPlus_stepStar_stepPlus h5 (stepStar_trans h6 h7)))))) + · have hd2_ne : d + 2 ≠ 1 := by omega + simp only [hd2_ne, ite_false] + exact GoodKS_add_last ks_mid S_sub (3 * d) h_gks_sub + +-- ============================================================================ +-- k₀ = 0 Transition (Cases 0a, 0b, 0c) +-- ============================================================================ + +theorem step_b01_b101_nil_to_e0_loop (p₀ : ℕ) (ps : List ℕ) (h_val : ValidKS ps) : + let w := bump_enc p₀ ps + (cfg_modeC (encL p₀ ps) ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> default)) + [donor311_tm]⊢⁺ + cfg_modeE0_loop (encL w.1 w.2) ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + default) := by + dsimp + set w := bump_enc p₀ ps + have h1 := step_modeC_b01_b101_nil (encL p₀ ps) + have h2 := modeE1_to_modeC ps p₀ + ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> ((0 : Fin 2) >> + (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> default))) + h_val + have h3 := + step_modeC_b01_b000 (encL w.1 w.2) ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> default) + exact stepPlus_stepPlus_stepPlus h1 (stepPlus_stepPlus_stepPlus h2 h3) + +theorem step_k0_zero (ks : List ℕ) (h_inv : InvNil 0 ks) : + ∃ k₀' ks', + ((cfg_modeC (encL 0 ks) default) [donor311_tm]⊢⁺ cfg_modeC (encL k₀' ks') default) ∧ + InvNil k₀' ks' := by + rcases h_inv with ⟨ _, hk5 ⟩ | ⟨ hne, h_gks ⟩ + · omega + · simp only [ Nat.reduceEqDiff, ite_false ] at h_gks + cases ks with + | nil => contradiction + | cons k₁ ks_rest => + have ⟨hk1_bound, h_gks_rest⟩ := h_gks + have hk1_ge : k₁ ≥ 1 := by omega + have h_valid_rest : ValidKS ks_rest := + GoodKS_valid ks_rest (72 + 63 * (k₁ + 2)) (by omega) h_gks_rest + set sub := bump_enc (k₁ - 1) ks_rest + have h_to_sub : (cfg_modeC (encL 0 (k₁ :: ks_rest)) default) [donor311_tm]⊢⁺ + cfg_modeE0_loop (encL sub.1 sub.2) ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + default) := by + have hk1_eq : k₁ = (k₁ - 1) + 1 := by omega + have h1 := step_modeC_nil (encL 0 (k₁ :: ks_rest)) + have h2 : (cfg_modeE0_first (encL 0 (k₁ :: ks_rest))) [donor311_tm]⊢⁺ + cfg_modeE1 (encL (k₁ - 1) ks_rest) + ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default)) := by + rw [show encL 0 (k₁ :: ks_rest) = encL 0 (((k₁ - 1) + 1) :: ks_rest) by rw [← hk1_eq]] + exact step_modeE0_first_b011_10_b10 (encL (k₁ - 1) ks_rest) + have h3 := modeE1_to_modeC ks_rest (k₁ - 1) + ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default)) + h_valid_rest + have h4 := + step_modeC_b01_b000 (encL sub.1 sub.2) ((1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + default) + exact stepPlus_stepPlus_stepPlus h1 (stepPlus_stepPlus_stepPlus h2 + (stepPlus_stepPlus_stepPlus h3 h4)) + -- Split on ks_rest = [] ∨ k₁ ≥ 3 (Case 0a), k₁ = 1 ∧ ks_rest ≠ [] (Case 0b), k₁ = 2 ∧ ks_rest + -- ≠ [] (Case 0c) + by_cases h_0a : ks_rest = [] ∨ k₁ ≥ 3 + · -- Case 0a: leave1(sub.1, sub.2) with S = 36 + have h_sub_nil : sub.2 = [] → 2 * 36 ≤ 35 * sub.1 := by + cases ks_rest with + | nil => intro _; simp [sub, bump_enc]; omega + | cons y ys => intro h_emp; exact absurd h_emp (add_last_ne_nil (y :: ys) 3 (by simp)) + have h_sub_cons : sub.2 ≠ [] → sub.1 ≥ 2 ∧ 2 * 36 ≤ 35 * (sub.1 + 3) := by + cases ks_rest with + | nil => intro h_ne; simp [sub, bump_enc] at h_ne + | cons y ys => + rcases h_0a with h_emp | hk3 + · simp at h_emp + · intro _; simp [sub, bump_enc]; omega + have h_sub_gks : GoodKS (2 * 36 + 63 * (sub.1 + 3)) sub.2 := by + cases ks_rest with + | nil => simp [sub, bump_enc, GoodKS] + | cons y ys => + simp only [sub, bump_enc] + have heq_s : 2 * 36 + 63 * (k₁ - 1 + 3) = 72 + 63 * (k₁ + 2) := by omega + rw [heq_s] + exact GoodKS_add_last (y :: ys) _ 3 h_gks_rest + rcases e0_loop_leave1_goodks sub.2.length sub.1 sub.2 36 ((1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> default) + rfl (by omega) h_sub_nil h_sub_cons h_sub_gks + with ⟨m₀, ms, h_step_l1, h_val_ms, h_ms_emp, h_gks_w, _⟩ + set p1 := bump_enc m₀ ms + set w := bump_enc_twice m₀ ms + have hw_eq : w = bump_enc p1.1 p1.2 := rfl + have h_c11 : (cfg_modeC (encL m₀ ms) + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> default)) + [donor311_tm]⊢⁺ + cfg_modeC (encL p1.1 p1.2) ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> default) := + stepPlus_stepPlus_stepPlus + (step_modeC_b11 (encL m₀ ms) ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> default)) + (modeE1_to_modeC ms m₀ ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> default) h_val_ms) + have h_to_w := step_b01_b101_nil_to_e0_loop p1.1 p1.2 (ValidKS_bump_enc m₀ ms h_val_ms) + have h_w_empty : w.2 = [] → w.1 ≥ 4 := by + cases ms with + | nil => + intro _; dsimp only [w, bump_enc_twice, bump_enc]; omega + | cons u us => + intro h_emp + dsimp only [w] at h_emp + rw [bump_enc_twice_nonempty m₀ (by simp)] at h_emp + exact absurd h_emp (add_last_ne_nil (u :: us) 6 (by simp)) + have h_gks_ws : GoodKS (36 + 63 * (w.1 + 3)) w.2 := by + have h2 := h_gks_w.2 + have heq : 36 + 63 * (w.1 + 1 + 2) = 36 + 63 * (w.1 + 3) := by omega + rw [heq] at h2; exact h2 + rcases e0_loop_drain_plus2 w.1 w.2 36 h_w_empty (by omega) h_gks_ws with ⟨k₀', ks', h_drain, + h_inv'⟩ + exact ⟨k₀', ks', + stepPlus_stepPlus_stepPlus h_to_sub + (stepPlus_stepPlus_stepPlus h_step_l1 + (stepPlus_stepPlus_stepPlus h_c11 + (stepPlus_stepPlus_stepPlus h_to_w h_drain))), + h_inv'⟩ + · -- Not Case 0a: ks_rest ≠ [] and k₁ < 3 (so k₁ = 1 or k₁ = 2) + push Not at h_0a + rcases h_0a with ⟨hne_rest, hk1_lt3⟩ + cases ks_rest with + | nil => contradiction + | cons k₂ ks_tail => + have hk1_cases : k₁ = 1 ∨ k₁ = 2 := by omega + rcases hk1_cases with rfl | rfl + · -- Case 0b: k₁ = 1, ks_rest = k₂ :: ks_tail + have h_sub_eq : sub = (0, add_last (k₂ :: ks_tail) 3) := rfl + have h_gks_sub : GoodKS 261 (add_last (k₂ :: ks_tail) 3) := + GoodKS_add_last (k₂ :: ks_tail) 261 3 h_gks_rest + cases h_al : add_last (k₂ :: ks_tail) 3 with + | nil => exact absurd h_al (add_last_ne_nil (k₂ :: ks_tail) 3 (by simp)) + | cons x₁ xs_rest => + rw [h_al] at h_gks_sub + have ⟨hx1_bound, h_gks_xs⟩ := h_gks_sub + have hx1_ge6 : x₁ ≥ 6 := by omega + have h_val_xs : ValidKS xs_rest := + GoodKS_valid xs_rest (261 + 63 * (x₁ + 2)) (by omega) h_gks_xs + set xb := bump_enc x₁ xs_rest + set p1 : ℕ × List ℕ := (xb.1 + 3, xb.2) + set w := bump_enc p1.1 p1.2 + have h_step_0b : (cfg_modeE0_loop (encL 0 (x₁ :: xs_rest)) ((1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> default)) + [donor311_tm]⊢⁺ + cfg_modeC (encL p1.1 p1.2) ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> default) := by + have h1 : (cfg_modeE0_loop (encL 0 (x₁ :: xs_rest)) ((1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> default)) + [donor311_tm]⊢⁺ + cfg_modeE1 (encL x₁ xs_rest) (prepend01 3 ((0 : Fin 2) >> (1 : Fin 2) >> + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default)) := + step_modeE0_loop_b011_10 (encL x₁ xs_rest) ((1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> default) + have h2 := modeE1_to_modeC xs_rest x₁ + (prepend01 3 ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> default)) h_val_xs + have h3 := + modeC_prepend01_star 3 xb.1 xb.2 ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> default) + exact stepPlus_stepPlus_stepPlus h1 (stepPlus_stepStar_stepPlus h2 h3) + have h_val_p1 : ValidKS p1.2 := ValidKS_bump_enc x₁ xs_rest h_val_xs + have h_to_w := step_b01_b101_nil_to_e0_loop p1.1 p1.2 h_val_p1 + have hw1_ge9 : w.1 ≥ 9 := by + cases xs_rest with + | nil => dsimp only [w, p1, xb, bump_enc]; omega + | cons y ys => + have hw_cons : w = (x₁ + 3, add_last (y :: ys) 6) := by + change bump_enc (x₁ + 3) (add_last (y :: ys) 3) = _ + rw [bump_enc_nonempty (x₁ + 3) (add_last_ne_nil (y :: ys) 3 (by simp)), + add_last_add] + rw [hw_cons]; dsimp only; omega + have h_w_empty : w.2 = [] → w.1 ≥ 4 := fun _ => by omega + have h_sw9 : 36 ≤ 9 + 54 * (w.1 / 2) := by omega + have h_gks_ws : GoodKS (9 + 63 * (w.1 + 3)) w.2 := by + cases xs_rest with + | nil => simp [w, p1, xb, bump_enc, GoodKS] + | cons y ys => + have hw_cons : w = (x₁ + 3, add_last (y :: ys) 6) := by + change bump_enc (x₁ + 3) (add_last (y :: ys) 3) = _ + rw [bump_enc_nonempty (x₁ + 3) (add_last_ne_nil (y :: ys) 3 (by simp)), + add_last_add] + rw [hw_cons] + dsimp only + have heq : 9 + 63 * (x₁ + 3 + 3) = 261 + 63 * (x₁ + 2) := by omega + rw [heq] + exact GoodKS_add_last (y :: ys) _ 6 h_gks_xs + rcases e0_loop_drain_plus2 w.1 w.2 9 h_w_empty h_sw9 h_gks_ws with ⟨k₀', ks', h_drain, + h_inv'⟩ + have h_to_sub' : (cfg_modeC (encL 0 (1 :: k₂ :: ks_tail)) default) [donor311_tm]⊢⁺ + cfg_modeE0_loop (encL 0 (x₁ :: xs_rest)) ((1 : Fin 2) >> (0 : Fin 2) >> + (1 : Fin 2) >> default) := by + simpa [h_sub_eq, h_al] using h_to_sub + exact ⟨k₀', ks', + stepPlus_stepPlus_stepPlus h_to_sub' + (stepPlus_stepPlus_stepPlus h_step_0b + (stepPlus_stepPlus_stepPlus h_to_w h_drain)), + h_inv'⟩ + · -- Case 0c: k₁ = 2, ks_rest = k₂ :: ks_tail + have h_sub_eq : sub = (1, add_last (k₂ :: ks_tail) 3) := rfl + have h_gks_sub : GoodKS 324 (add_last (k₂ :: ks_tail) 3) := + GoodKS_add_last (k₂ :: ks_tail) 324 3 h_gks_rest + cases h_al : add_last (k₂ :: ks_tail) 3 with + | nil => exact absurd h_al (add_last_ne_nil (k₂ :: ks_tail) 3 (by simp)) + | cons x₁ xs_rest => + rw [h_al] at h_gks_sub + have ⟨hx1_bound, h_gks_xs⟩ := h_gks_sub + have hx1_ge8 : x₁ ≥ 8 := by omega + have h_val_xs : ValidKS xs_rest := + GoodKS_valid xs_rest (324 + 63 * (x₁ + 2)) (by omega) h_gks_xs + set sub2 := bump_enc (x₁ - 1) xs_rest + set R_101 := (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> default + set R_1011101_101 := + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> R_101 + -- Step 1 of Case 0c + have h_step1 : (cfg_modeE0_loop (encL 1 (x₁ :: xs_rest)) R_101) [donor311_tm]⊢⁺ + cfg_modeE0_loop (encL sub2.1 sub2.2) R_1011101_101 := by + have hx1_eq : x₁ = (x₁ - 1) + 1 := by omega + have h1 : (cfg_modeE0_loop (encL 1 (x₁ :: xs_rest)) R_101) [donor311_tm]⊢⁺ + cfg_modeE1 (encL (x₁ - 1) xs_rest) + ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + R_1011101_101) := by + rw [show encL 1 (x₁ :: xs_rest) = + encL 1 (((x₁ - 1) + 1) :: xs_rest) by rw [← hx1_eq]] + exact step_modeE0_loop_b10_b011_10_b10 (encL (x₁ - 1) xs_rest) R_101 + have h2 := modeE1_to_modeC xs_rest (x₁ - 1) + ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + R_1011101_101) h_val_xs + have h3 := step_modeC_b01_b000 (encL sub2.1 sub2.2) R_1011101_101 + exact stepPlus_stepPlus_stepPlus h1 (stepPlus_stepPlus_stepPlus h2 h3) + -- Step 2 of Case 0c: leave1(sub2.1, sub2.2) at S = 162 + have h_sub2_nil : sub2.2 = [] → 2 * 162 ≤ 35 * sub2.1 := by + cases xs_rest with + | nil => intro _; simp [sub2, bump_enc]; omega + | cons y ys => + intro h_emp; exact absurd h_emp (add_last_ne_nil (y :: ys) 3 (by simp)) + have h_sub2_cons : sub2.2 ≠ [] → sub2.1 ≥ 2 ∧ 2 * 162 ≤ 35 * (sub2.1 + 3) := by + cases xs_rest with + | nil => intro h_ne; simp [sub2, bump_enc] at h_ne + | cons y ys => intro _; simp [sub2, bump_enc]; omega + have h_sub2_gks : GoodKS (2 * 162 + 63 * (sub2.1 + 3)) sub2.2 := by + cases xs_rest with + | nil => simp [sub2, bump_enc, GoodKS] + | cons y ys => + simp only [sub2, bump_enc] + have heq_s : 2 * 162 + 63 * (x₁ - 1 + 3) = 324 + 63 * (x₁ + 2) := by omega + rw [heq_s] + exact GoodKS_add_last (y :: ys) _ 3 h_gks_xs + rcases e0_loop_leave1_goodks sub2.2.length sub2.1 sub2.2 162 R_1011101_101 + rfl (by omega) h_sub2_nil h_sub2_cons h_sub2_gks + with ⟨y₀, ys, h_step_l2, h_val_ys, h_ys_emp, h_gks_z, _⟩ + have h_unwrap2 := unwrap_11_01_1011101_step y₀ ys R_101 h_val_ys + set pz := bump_enc_twice y₀ ys + set z₁ := pz.1 + 1 + set zs := pz.2 + have ⟨hz1_bound, h_gks_zs⟩ := h_gks_z + have hz1_ge3 : z₁ ≥ 3 := by omega + have h_zs_emp_z1 : zs = [] → z₁ ≥ 14 := by + cases ys with + | nil => + have hy7 : y₀ ≥ 7 := h_ys_emp rfl + intro _; dsimp only [z₁, pz, bump_enc_twice, bump_enc]; omega + | cons u us => + intro h_emp + dsimp only [zs, pz] at h_emp + rw [bump_enc_twice_nonempty y₀ (by simp)] at h_emp + exact absurd h_emp (add_last_ne_nil (u :: us) 6 (by simp)) + have h_val_zs : ValidKS zs := + GoodKS_valid zs (162 + 63 * (z₁ + 2)) (by omega) h_gks_zs + -- Step 3 & 4 of Case 0c: Transition A + Transition B + set zb := bump_enc (z₁ - 1) zs + set w := bump_enc zb.1 zb.2 + set R_0000101 := + (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> default + set R_101_01_01 := + (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> ((0 : Fin 2) >> (1 : Fin 2) >> + ((0 : Fin 2) >> (1 : Fin 2) >> default)) + have h_step34 : (cfg_modeC (encL 0 (z₁ :: zs)) R_101) [donor311_tm]⊢⁺ + cfg_modeE0_loop (encL w.1 w.2) R_101_01_01 := by + have hz1_eq : z₁ = (z₁ - 1) + 1 := by omega + have hA : (cfg_modeC (encL 0 (z₁ :: zs)) R_101) [donor311_tm]⊢⁺ + cfg_modeE1 (encL (z₁ - 1) zs) + ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> R_0000101) := by + rw [show encL 0 (z₁ :: zs) = encL 0 (((z₁ - 1) + 1) :: zs) by rw [← hz1_eq]] + exact step_modeC_b01110_b10_b101_nil (encL (z₁ - 1) zs) + have hA2 := modeE1_to_modeC zs (z₁ - 1) + ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> R_0000101) h_val_zs + have hA3 : (cfg_modeC (encL zb.1 zb.2) + ((0 : Fin 2) >> (1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> + (0 : Fin 2) >> (1 : Fin 2) >> R_0000101)) + [donor311_tm]⊢⁺ cfg_modeC (encL 0 ((zb.1 + 1) :: zb.2)) R_0000101 := + step_modeC_b01_b10101 (encL zb.1 zb.2) R_0000101 + have hB : (cfg_modeC (encL 0 ((zb.1 + 1) :: zb.2)) R_0000101) [donor311_tm]⊢⁺ + cfg_modeE1 (encL zb.1 zb.2) + ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + R_101_01_01) := + step_modeC_b01110_b10_b0000101 (encL zb.1 zb.2) default + have hB2 := modeE1_to_modeC zb.2 zb.1 + ((0 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> (0 : Fin 2) >> + R_101_01_01) + (ValidKS_bump_enc (z₁ - 1) zs h_val_zs) + have hB3 := step_modeC_b01_b000 (encL w.1 w.2) R_101_01_01 + exact stepPlus_stepPlus_stepPlus hA + (stepPlus_stepPlus_stepPlus hA2 + (stepPlus_stepPlus_stepPlus hA3 + (stepPlus_stepPlus_stepPlus hB + (stepPlus_stepPlus_stepPlus hB2 hB3)))) + -- Step 5 of Case 0c: leave1(w.1, w.2) at S = 81 + have hw_def : w = bump_enc_twice (z₁ - 1) zs := rfl + have h_w_nil : w.2 = [] → 2 * 81 ≤ 35 * w.1 := by + rcases h_zs : zs with _ | ⟨y, ys'⟩ + · have hz14 : z₁ ≥ 14 := h_zs_emp_z1 h_zs + have hw_nil : w = (z₁ - 1 + 3 + 3, []) := by rw [hw_def, h_zs]; rfl + rw [hw_nil]; intro _; dsimp only; omega + · have hw_cons : w = (z₁ - 1, add_last (y :: ys') 6) := by + rw [hw_def, h_zs, bump_enc_twice_nonempty (z₁ - 1) (by simp)] + rw [hw_cons]; intro h_emp + exact absurd h_emp (add_last_ne_nil (y :: ys') 6 (by simp)) + have h_w_ge10 : w.2 = [] → w.1 ≥ 10 := by + rcases h_zs : zs with _ | ⟨y, ys'⟩ + · have hz14 : z₁ ≥ 14 := h_zs_emp_z1 h_zs + have hw_nil : w = (z₁ - 1 + 3 + 3, []) := by rw [hw_def, h_zs]; rfl + rw [hw_nil]; intro _; dsimp only; omega + · have hw_cons : w = (z₁ - 1, add_last (y :: ys') 6) := by + rw [hw_def, h_zs, bump_enc_twice_nonempty (z₁ - 1) (by simp)] + rw [hw_cons]; intro h_emp + exact absurd h_emp (add_last_ne_nil (y :: ys') 6 (by simp)) + have h_w_cons : w.2 ≠ [] → w.1 ≥ 2 ∧ 2 * 81 ≤ 35 * (w.1 + 3) := by + rcases h_zs : zs with _ | ⟨y, ys'⟩ + · have hw_nil : w = (z₁ - 1 + 3 + 3, []) := by rw [hw_def, h_zs]; rfl + rw [hw_nil]; intro h_ne; exact absurd rfl h_ne + · have hw_cons : w = (z₁ - 1, add_last (y :: ys') 6) := by + rw [hw_def, h_zs, bump_enc_twice_nonempty (z₁ - 1) (by simp)] + rw [hw_cons]; intro _; dsimp only; omega + have h_w_gks : GoodKS (2 * 81 + 63 * (w.1 + 3)) w.2 := by + rcases h_zs : zs with _ | ⟨y, ys'⟩ + · have hw_nil : w = (z₁ - 1 + 3 + 3, []) := by rw [hw_def, h_zs]; rfl + rw [hw_nil]; trivial + · have hw_cons : w = (z₁ - 1, add_last (y :: ys') 6) := by + rw [hw_def, h_zs, bump_enc_twice_nonempty (z₁ - 1) (by simp)] + rw [hw_cons] + dsimp only + have heq_s : 2 * 81 + 63 * (z₁ - 1 + 3) = 162 + 63 * (z₁ + 2) := by omega + rw [heq_s] + have h_gks_zs' : GoodKS (162 + 63 * (z₁ + 2)) (y :: ys') := by + rw [← h_zs]; exact h_gks_zs + exact GoodKS_add_last (y :: ys') _ 6 h_gks_zs' + rcases e0_loop_leave1_goodks w.2.length w.1 w.2 81 R_101_01_01 + rfl (by omega) h_w_nil h_w_cons h_w_gks + with ⟨m₀, ms, h_step_l5, h_val_ms, _, _, h_gks_81_fn⟩ + have h_gks_b1 := h_gks_81_fn h_w_ge10 rfl + set b1 := bump_enc m₀ ms + -- Step 6 of Case 0c: 4 final steps to cfg_modeC (encL 1 ((b1.1 + 1) :: b1.2)) default + have h_step6 : (cfg_modeC (encL m₀ ms) + ((1 : Fin 2) >> (1 : Fin 2) >> (0 : Fin 2) >> (1 : Fin 2) >> R_101_01_01)) + [donor311_tm]⊢⁺ + cfg_modeC (encL 1 ((b1.1 + 1) :: b1.2)) default := by + have h1 := step_modeC_b11 (encL m₀ ms) ((0 : Fin 2) >> (1 : Fin 2) >> R_101_01_01) + have h2 := + modeE1_to_modeC ms m₀ ((0 : Fin 2) >> (1 : Fin 2) >> R_101_01_01) h_val_ms + have h3 : (cfg_modeC (encL b1.1 b1.2) ((0 : Fin 2) >> (1 : Fin 2) >> R_101_01_01)) + [donor311_tm]⊢⁺ + cfg_modeC (encL 0 ((b1.1 + 1) :: b1.2)) ((0 : Fin 2) >> (1 : Fin 2) >> + default) := + step_modeC_b01_b10101 (encL b1.1 b1.2) ((0 : Fin 2) >> (1 : Fin 2) >> default) + have h4 : (cfg_modeC (encL 0 ((b1.1 + 1) :: b1.2)) ((0 : Fin 2) >> (1 : Fin 2) >> + default)) + [donor311_tm]⊢⁺ + cfg_modeC (encL 1 ((b1.1 + 1) :: b1.2)) default := + step_modeC_b01 (encL 0 ((b1.1 + 1) :: b1.2)) default + exact stepPlus_stepPlus_stepPlus h1 + (stepPlus_stepPlus_stepPlus h2 + (stepPlus_stepPlus_stepPlus h3 h4)) + have h_to_sub' : (cfg_modeC (encL 0 (2 :: k₂ :: ks_tail)) default) [donor311_tm]⊢⁺ + cfg_modeE0_loop (encL 1 (x₁ :: xs_rest)) R_101 := by + simpa [h_sub_eq, h_al] using h_to_sub + exact ⟨1, (b1.1 + 1) :: b1.2, + stepPlus_stepPlus_stepPlus h_to_sub' + (stepPlus_stepPlus_stepPlus h_step1 + (stepPlus_stepPlus_stepPlus h_step_l2 + (stepPlus_stepPlus_stepPlus h_unwrap2 + (stepPlus_stepPlus_stepPlus h_step34 + (stepPlus_stepPlus_stepPlus h_step_l5 h_step6))))), + Or.inr ⟨by simp, by simpa [InvNil] using h_gks_b1⟩⟩ + +-- ============================================================================ +-- Top-Level Invariant and Non-Halting Theorem +-- ============================================================================ + +def Inv (c : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ k₀ ks, c = cfg_modeC (encL k₀ ks) default ∧ InvNil k₀ ks + + +theorem inv_step (c : Cfg (Fin 2) (Fin 6)) (h : Inv c) : + ∃ c', (c [donor311_tm]⊢⁺ c') ∧ Inv c' := by + rcases h with ⟨k₀, ks, rfl, h_inv⟩ + cases k₀ with + | zero => + rcases step_k0_zero ks h_inv with ⟨k₀', ks', h_step, h_inv'⟩ + exact ⟨cfg_modeC (encL k₀' ks') default, h_step, ⟨k₀', ks', rfl, h_inv'⟩⟩ + | succ k₀' => + rcases step_k0_pos (k₀' + 1) ks (by omega) h_inv with ⟨k₀'', ks'', h_step, h_inv'⟩ + exact ⟨cfg_modeC (encL k₀'' ks'') default, h_step, ⟨k₀'', ks'', rfl, h_inv'⟩⟩ + + + + +end TM311Donor + +namespace TM1Donor + +open BusyBeaver.Counter + +def donor1_machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LD_0RC1RC_1LA1RE_HHH1LE_1RF0RC_0RB0LF" + +abbrev tm1 : Machine (Fin 2) (Fin 6) := donor1_machine.toBB + + + +-- ============================================================================ +-- 1. Canonical Configuration Family `Kr n a b c d` & `Ev N X` +-- ============================================================================ + +def G : List (Fin 2) := + [0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, + 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0] + +def l39Bits : List (Fin 2) := + [1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, + 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1] + +def l41Bits : List (Fin 2) := [0, 1] ++ l39Bits + +def krRightList (n a b c d : Nat) : List (Fin 2) := + G ++ [1] ++ ([1, 1] : List (Fin 2)) ^ n ++ + [0] ++ ([1, 1] : List (Fin 2)) ^ a ++ + [0, 1, 1, 0] ++ ([1, 1] : List (Fin 2)) ^ b ++ + [0, 0, 0, 0, 0, 0, 1] ++ ([1, 1] : List (Fin 2)) ^ c ++ + [0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0] ++ ([1, 1] : List (Fin 2)) ^ d ++ + [0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1] + +def Kr (n a b c d : Nat) : Cfg (Fin 2) (Fin 6) := + default <{{5}} (krRightList n a b c d +> default) + +theorem Kr_congr {n1 n2 a1 a2 b1 b2 c1 c2 d1 d2 : Nat} + (hn : n1 = n2) (ha : a1 = a2) (hb : b1 = b2) (hc : c1 = c2) (hd : d1 = d2) : + Kr n1 a1 b1 c1 d1 = Kr n2 a2 b2 c2 d2 := by + subst hn; subst ha; subst hb; subst hc; subst hd; rfl + +def Ev (N X : Nat) : Cfg (Fin 2) (Fin 6) := + Kr N (4 * X + 26) (2 * X + 32) 17 9 + +-- ============================================================================ +-- 2. Elementary 2-Cell Shift Lemmas, Word Commutations & Chaotic-Edge Jumps +-- ============================================================================ + +theorem shiftR_2_11_one (l r : ListBlank (Fin 2)) : + (l {{2}}> ([1, 1] +> r)) [tm1]⊢* (([0, 1] +> l) {{2}}> r) := + run_local_spec (tm := tm1) (n := 2) + (s1 := ⟨[], [1, 1], 2, .right⟩) (s2 := ⟨[0, 1], [], 2, .right⟩) rfl l r + +theorem shiftR_2_11 (k : Nat) (l r : ListBlank (Fin 2)) : + (l {{2}}> (([1, 1] : List (Fin 2)) ^ k +> r)) [tm1]⊢* + ((([0, 1] : List (Fin 2)) ^ k +> l) {{2}}> r) := by + induction k generalizing l with + | zero => try exact stepStar_refl tm1 _ + | succ k ih => + rw [right_pow_succ ([1, 1] : List (Fin 2)) k r, + right_pow_succ_right ([0, 1] : List (Fin 2)) k l] + exact stepStar_trans (shiftR_2_11_one l _) (ih ([0, 1] +> l)) + +theorem shiftR_2_11_plus (l r : ListBlank (Fin 2)) : + (l {{2}}> ([1] +> ([1] +> r))) [tm1]⊢⁺ (([0, 1] +> l) {{2}}> r) := by + have h1 : (l {{2}}> ([1] +> ([1] +> r))) [tm1]⊢ (([1] +> l) {{4}}> ([1] +> r)) := + step_local_spec (tm := tm1) (s1 := ⟨[], [1], 2, .right⟩) (s2 := ⟨[1], [], 4, .right⟩) + rfl l ([1] +> r) + have h2 : (([1] +> l) {{4}}> ([1] +> r)) [tm1]⊢ (([0, 1] +> l) {{2}}> r) := + step_local_spec (tm := tm1) (s1 := ⟨[1], [1], 4, .right⟩) (s2 := ⟨[0, 1], [], 2, .right⟩) + rfl l r + exact stepPlus_trans (step_stepPlus tm1 _ _ h1) (step_stepPlus tm1 _ _ h2) + +theorem shiftR_4_11_one (l r : ListBlank (Fin 2)) : + (l {{4}}> ([1, 1] +> r)) [tm1]⊢* (([1, 0] +> l) {{4}}> r) := + run_local_spec (tm := tm1) (n := 2) + (s1 := ⟨[], [1, 1], 4, .right⟩) (s2 := ⟨[1, 0], [], 4, .right⟩) rfl l r + +theorem shiftR_4_11 (k : Nat) (l r : ListBlank (Fin 2)) : + (l {{4}}> (([1, 1] : List (Fin 2)) ^ k +> r)) [tm1]⊢* + ((([1, 0] : List (Fin 2)) ^ k +> l) {{4}}> r) := by + induction k generalizing l with + | zero => try exact stepStar_refl tm1 _ + | succ k ih => + rw [right_pow_succ ([1, 1] : List (Fin 2)) k r, + right_pow_succ_right ([1, 0] : List (Fin 2)) k l] + exact stepStar_trans (shiftR_4_11_one l _) (ih ([1, 0] +> l)) + +theorem shiftR_4_11_plus (l r : ListBlank (Fin 2)) : + (l {{4}}> ([1] +> ([1] +> r))) [tm1]⊢⁺ (([1, 0] +> l) {{4}}> r) := by + have h1 : (l {{4}}> ([1] +> ([1] +> r))) [tm1]⊢ (([0] +> l) {{2}}> ([1] +> r)) := + step_local_spec (tm := tm1) (s1 := ⟨[], [1], 4, .right⟩) (s2 := ⟨[0], [], 2, .right⟩) + rfl l ([1] +> r) + have h2 : (([0] +> l) {{2}}> ([1] +> r)) [tm1]⊢ (([1, 0] +> l) {{4}}> r) := + step_local_spec (tm := tm1) (s1 := ⟨[0], [1], 2, .right⟩) (s2 := ⟨[1, 0], [], 4, .right⟩) + rfl l r + exact stepPlus_trans (step_stepPlus tm1 _ _ h1) (step_stepPlus tm1 _ _ h2) + +theorem shiftL_5_10_one (l r : ListBlank (Fin 2)) : + (([1, 0] +> l) <{{5}} ([0, 0] +> r)) [tm1]⊢* + (l <{{5}} ([0, 0] +> ([1, 1] +> r))) := + run_local_spec (tm := tm1) (n := 12) + (s1 := ⟨[1, 0], [0, 0], 5, .left⟩) (s2 := ⟨[], [0, 0, 1, 1], 5, .left⟩) rfl l r + +theorem shiftL_5_10 (k : Nat) (l r : ListBlank (Fin 2)) : + ((([1, 0] : List (Fin 2)) ^ k +> l) <{{5}} ([0, 0] +> r)) [tm1]⊢* + (l <{{5}} ([0, 0] +> (([1, 1] : List (Fin 2)) ^ k +> r))) := by + induction k generalizing r with + | zero => try exact stepStar_refl tm1 _ + | succ k ih => + rw [right_pow_succ ([1, 0] : List (Fin 2)) k l, + right_pow_succ_right ([1, 1] : List (Fin 2)) k r] + exact stepStar_trans (shiftL_5_10_one _ r) (ih ([1, 1] +> r)) + +theorem shiftL_5_01_one (l r : ListBlank (Fin 2)) : + (([0, 1] +> l) <{{5}} ([0, 0, 0] +> r)) [tm1]⊢* + (l <{{5}} ([0, 0, 0] +> ([1, 1] +> r))) := + run_local_spec (tm := tm1) (n := 12) + (s1 := ⟨[0, 1], [0, 0, 0], 5, .left⟩) (s2 := ⟨[], [0, 0, 0, 1, 1], 5, .left⟩) rfl l r + +theorem shiftL_5_01 (k : Nat) (l r : ListBlank (Fin 2)) : + ((([0, 1] : List (Fin 2)) ^ k +> l) <{{5}} ([0, 0, 0] +> r)) [tm1]⊢* + (l <{{5}} ([0, 0, 0] +> (([1, 1] : List (Fin 2)) ^ k +> r))) := by + induction k generalizing r with + | zero => try exact stepStar_refl tm1 _ + | succ k ih => + rw [right_pow_succ ([0, 1] : List (Fin 2)) k l, + right_pow_succ_right ([1, 1] : List (Fin 2)) k r] + exact stepStar_trans (shiftL_5_01_one _ r) (ih ([1, 1] +> r)) + +theorem rot_w11 (k : Nat) (s : ListBlank (Fin 2)) : + (([1, 1] : List (Fin 2)) ^ k +> ([1] +> s)) = + [1] +> (([1, 1] : List (Fin 2)) ^ k +> s) := by + induction k with + | zero => rfl + | succ k ih => + rw [right_pow_succ ([1, 1] : List (Fin 2)) k, + right_pow_succ ([1, 1] : List (Fin 2)) k] + simp only [listblank_append_cons, listblank_append_nil] at ih ⊢ + rw [ih] + +theorem rot_w10 (k : Nat) (s : ListBlank (Fin 2)) : + (([1, 0] : List (Fin 2)) ^ k +> ([1] +> s)) = + [1] +> (([0, 1] : List (Fin 2)) ^ k +> s) := by + induction k with + | zero => rfl + | succ k ih => + rw [right_pow_succ ([1, 0] : List (Fin 2)) k, + right_pow_succ ([0, 1] : List (Fin 2)) k] + simp only [listblank_append_cons, listblank_append_nil] at ih ⊢ + rw [ih] + +theorem rot_w01 (k : Nat) (s : ListBlank (Fin 2)) : + (([0, 1] : List (Fin 2)) ^ k +> ([0] +> s)) = + [0] +> (([1, 0] : List (Fin 2)) ^ k +> s) := by + induction k with + | zero => rfl + | succ k ih => + rw [right_pow_succ ([0, 1] : List (Fin 2)) k, + right_pow_succ ([1, 0] : List (Fin 2)) k] + simp only [listblank_append_cons, listblank_append_nil] at ih ⊢ + rw [ih] + +theorem zero_list_default : ([0] : List (Fin 2)) +> (default : ListBlank (Fin 2)) = default := + zero_cons_default + +theorem zeros2_list_default : ([0, 0] : List (Fin 2)) +> (default : ListBlank (Fin 2)) = default := + by + change [0] +> ([0] +> default) = default + rw [zero_list_default, zero_list_default] + +theorem nil_list_default : ([] : List (Fin 2)) +> (default : ListBlank (Fin 2)) = default := rfl + +set_option maxRecDepth 200000 in +theorem edge_in_raw (r : ListBlank (Fin 2)) : + (((l39Bits ++ [0]) +> default) <{{5}} ([0, 0, 0] +> r)) [tm1]⊢* + (([] +> default) <{{5}} (G +> r)) := + run_local_spec (tm := tm1) (n := 524) + (s1 := ⟨l39Bits ++ [0], [0, 0, 0], 5, .left⟩) + (s2 := ⟨[], G, 5, .left⟩) rfl default r + +theorem edge_in (r : ListBlank (Fin 2)) : + ((l39Bits +> default) <{{5}} ([0, 0, 0] +> r)) [tm1]⊢* + (default <{{5}} (G +> r)) := by + have h := edge_in_raw r + rw [listblank_append_assoc l39Bits [0] default, zero_list_default, nil_list_default] at h + exact h + +set_option maxRecDepth 200000 in +theorem edge_out_raw (r : ListBlank (Fin 2)) : + (([0, 0] +> default) <{{5}} ((G ++ [1]) +> r)) [tm1]⊢* + (((l41Bits ++ [0]) +> default) {{2}}> ([1, 1, 1, 1] +> r)) := + run_local_spec (tm := tm1) (n := 237) + (s1 := ⟨[0, 0], G ++ [1], 5, .left⟩) + (s2 := ⟨l41Bits ++ [0], [1, 1, 1, 1], 2, .right⟩) rfl default r + +theorem edge_out (r : ListBlank (Fin 2)) : + (default <{{5}} (G +> ([1] +> r))) [tm1]⊢* + ((l41Bits +> default) {{2}}> ([1, 1, 1, 1] +> r)) := by + have h := edge_out_raw r + rw [zeros2_list_default, listblank_append_assoc l41Bits [0] default, zero_list_default, + listblank_append_assoc G [1] r] at h + exact h + +-- ============================================================================ +-- 3. Compressed Symbolic Bouncer Verifier (`Q6`, `SymTok`, `runSym`, `checkSym`) +-- ============================================================================ + +inductive Q6 where + | q0 | q1 | q2 | q3 | q4 | q5 + deriving DecidableEq + +def q6Eq : Q6 → Q6 → Bool + | .q0, .q0 | .q1, .q1 | .q2, .q2 | .q3, .q3 | .q4, .q4 | .q5, .q5 => true + | _, _ => false + +theorem q6Eq_sound {qa qb : Q6} (h : q6Eq qa qb = true) : qa = qb := by + cases qa <;> cases qb <;> first | rfl | nomatch h + +def dirEq : Dir → Dir → Bool + | .left, .left | .right, .right => true + | _, _ => false + +theorem dirEq_sound {d1 d2 : Dir} (h : dirEq d1 d2 = true) : d1 = d2 := by + cases d1 <;> cases d2 <;> first | rfl | nomatch h + +def evalQ : Q6 → Fin 6 + | .q0 => 0 + | .q1 => 1 + | .q2 => 2 + | .q3 => 3 + | .q4 => 4 + | .q5 => 5 + +def evalBit : Bool → Fin 2 + | false => 0 + | true => 1 + +def stepQ : Q6 → Bool → Option (Q6 × Bool × Dir) + | .q0, false => some (.q1, true, .right) + | .q0, true => some (.q3, true, .left) + | .q1, false => some (.q2, false, .right) + | .q1, true => some (.q2, true, .right) + | .q2, false => some (.q0, true, .left) + | .q2, true => some (.q4, true, .right) + | .q3, false => none + | .q3, true => some (.q4, true, .left) + | .q4, false => some (.q5, true, .right) + | .q4, true => some (.q2, false, .right) + | .q5, false => some (.q1, false, .right) + | .q5, true => some (.q5, false, .left) + +theorem stepQ_sound {q q' : Q6} {x w_bit : Bool} {d' : Dir} + (h : stepQ q x = some (q', w_bit, d')) : + tm1 (evalQ q) (evalBit x) = some (some (evalQ q'), Stmt.write (evalBit w_bit) d') := by + cases q <;> cases x <;> cases h <;> rfl + +inductive W2 where + | w01 + | w10 + | w11 + deriving DecidableEq + +def w2Eq : W2 → W2 → Bool + | .w01, .w01 | .w10, .w10 | .w11, .w11 => true + | _, _ => false + +theorem w2Eq_sound {w1 w2 : W2} (h : w2Eq w1 w2 = true) : w1 = w2 := by + cases w1 <;> cases w2 <;> first | rfl | nomatch h + +def evalW2 : W2 → List (Fin 2) + | .w01 => [0, 1] + | .w10 => [1, 0] + | .w11 => [1, 1] + +inductive Var where + | v0 + | vn + | va + | vb + | vc + | vd + | vbc + deriving DecidableEq + +def varEq : Var → Var → Bool + | .v0, .v0 | .vn, .vn | .va, .va | .vb, .vb | .vc, .vc | .vd, .vd | .vbc, .vbc => true + | _, _ => false + +theorem varEq_sound {v1 v2 : Var} (h : varEq v1 v2 = true) : v1 = v2 := by + cases v1 <;> cases v2 <;> first | rfl | nomatch h + +def evalVar (n a b c d : Nat) : Var → Nat + | .v0 => 0 + | .vn => n + | .va => a + | .vb => b + | .vc => c + | .vd => d + | .vbc => b + c + +def canMergeVars : Var → Var → Option Var + | .v0, v2 => some v2 + | v1, .v0 => some v1 + | .vb, .vc => some .vbc + | .vc, .vb => some .vbc + | _, _ => none + +theorem canMergeVars_sound (n a b c d : Nat) {v1 v2 vm : Var} + (h : canMergeVars v1 v2 = some vm) : + evalVar n a b c d v1 + evalVar n a b c d v2 = evalVar n a b c d vm := by + cases v1 <;> cases v2 <;> cases h <;> simp only [evalVar] <;> omega + +inductive SymTok where + | b0 + | b1 + | pow (w : W2) (k : Nat) (v : Var) + deriving DecidableEq + +def tokEq : SymTok → SymTok → Bool + | .b0, .b0 => true + | .b1, .b1 => true + | .pow w1 k1 v1, .pow w2 k2 v2 => w2Eq w1 w2 && Nat.beq k1 k2 && varEq v1 v2 + | _, _ => false + +theorem tokEq_sound {t1 t2 : SymTok} (h : tokEq t1 t2 = true) : t1 = t2 := by + rcases t1 with _ | _ | ⟨w1, k1, v1⟩ <;> rcases t2 with _ | _ | ⟨w2, k2, v2⟩ + · rfl + · nomatch h + · nomatch h + · nomatch h + · rfl + · nomatch h + · nomatch h + · nomatch h + · dsimp [tokEq] at h + simp only [Bool.and_assoc, Bool.and_eq_true, Nat.beq_eq] at h + rcases h with ⟨hw, rfl, hv⟩ + rw [w2Eq_sound hw, varEq_sound hv] + +def tokListEq : List SymTok → List SymTok → Bool + | [], [] => true + | x :: xs, y :: ys => tokEq x y && tokListEq xs ys + | _, _ => false + +theorem tokListEq_sound {l1 l2 : List SymTok} (h : tokListEq l1 l2 = true) : l1 = l2 := by + induction l1 generalizing l2 with + | nil => + cases l2 with + | nil => rfl + | cons _ _ => nomatch h + | cons x xs ih => + cases l2 with + | nil => nomatch h + | cons y ys => + dsimp [tokListEq] at h + simp only [Bool.and_eq_true] at h + rw [tokEq_sound h.1, ih h.2] + +def bitToTok : Fin 2 → SymTok + | 0 => .b0 + | 1 => .b1 + +def evalTok (n a b c d : Nat) : SymTok → List (Fin 2) + | .b0 => [0] + | .b1 => [1] + | .pow w k v => evalW2 w ^ (k + evalVar n a b c d v) + +theorem evalTok_bitToTok (n a b c d : Nat) : ∀ (x : Fin 2), evalTok n a b c d (bitToTok x) = [x] + | ⟨0, _⟩ => rfl + | ⟨1, _⟩ => rfl + +def evalHalf (n a b c d : Nat) : List SymTok → ListBlank (Fin 2) + | [] => default + | t :: ts => evalTok n a b c d t +> evalHalf n a b c d ts + +theorem evalHalf_map_bit (bs : List (Fin 2)) (rest : List SymTok) (n a b c d : Nat) : + evalHalf n a b c d (bs.map bitToTok ++ rest) = bs +> evalHalf n a b c d rest := by + induction bs with + | nil => rfl + | cons x xs ih => + simp only [List.map_cons, List.cons_append, evalHalf, evalTok_bitToTok, ih] + rfl + +theorem evalHalf_map_bit_end (bs : List (Fin 2)) (n a b c d : Nat) : + evalHalf n a b c d (bs.map bitToTok) = bs +> default := by + simpa only [List.append_nil, evalHalf] using evalHalf_map_bit bs [] n a b c d + +def gToks : List SymTok := + [SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b1, + SymTok.b1, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b1, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b1, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0] + +theorem gToks_eq : gToks = G.map bitToTok := rfl + +def l39Toks : List SymTok := + [SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b1, SymTok.b1, SymTok.b1, + SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b1, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, SymTok.b0, SymTok.b1, SymTok.b1] + +theorem l39Toks_eq : l39Toks = l39Bits.map bitToTok := rfl + +def l41Toks : List SymTok := + [SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b1, + SymTok.b1, SymTok.b1, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b1, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, SymTok.b0, + SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, SymTok.b0, SymTok.b1, + SymTok.b1] + +theorem l41Toks_eq : l41Toks = l41Bits.map bitToTok := rfl + +structure SymState where + q : Q6 + dir : Dir + l : List SymTok + r : List SymTok + prog : Bool + deriving DecidableEq + +def evalState (n a b c d : Nat) (s : SymState) : Cfg (Fin 2) (Fin 6) := + cfg_of (evalQ s.q) s.dir (evalHalf n a b c d s.l) (evalHalf n a b c d s.r) + +def pushBit : Bool → List SymTok → List SymTok + | false, [] => [] + | false, xs => .b0 :: xs + | true, xs => .b1 :: xs + +theorem pushBit_sound (n a b c d : Nat) (x : Bool) (xs : List SymTok) : + evalHalf n a b c d (pushBit x xs) = ([evalBit x] : List (Fin 2)) +> evalHalf n a b c d xs := by + cases x <;> cases xs + · exact zero_cons_default.symm + · rfl + · rfl + · rfl + +def pushPowAux (w : W2) (k : Nat) (v : Var) : List SymTok → List SymTok + | [] => [.pow w k v] + | .pow w2 k2 v2 :: ys => + match w2Eq w w2 with + | true => + match canMergeVars v v2 with + | some vm => pushPowAux w (k + k2) vm ys + | none => .pow w k v :: .pow w2 k2 v2 :: ys + | false => + .pow w k v :: .pow w2 k2 v2 :: ys + | .b0 :: ys => + match w with + | .w01 => .b0 :: pushPowAux .w10 k v ys + | .w10 => .pow .w10 k v :: .b0 :: ys + | .w11 => .pow .w11 k v :: .b0 :: ys + | .b1 :: ys => + match w with + | .w11 => .b1 :: pushPowAux .w11 k v ys + | .w10 => .b1 :: pushPowAux .w01 k v ys + | .w01 => .pow .w01 k v :: .b1 :: ys + +theorem pushPowAux_sound (n a b c d : Nat) (w : W2) (k : Nat) (v : Var) (xs : List SymTok) : + evalHalf n a b c d (pushPowAux w k v xs) = + evalTok n a b c d (.pow w k v) +> evalHalf n a b c d xs := by + induction xs generalizing w k v with + | nil => rfl + | cons y ys ih => + rcases y with _ | _ | ⟨w2, k2, v2⟩ + · cases w <;> dsimp [pushPowAux] + · simp only [evalHalf, evalTok, evalW2, ih .w10 k v] + exact (rot_w01 (k + evalVar n a b c d v) (evalHalf n a b c d ys)).symm + · rfl + · rfl + · cases w <;> dsimp [pushPowAux] + · rfl + · simp only [evalHalf, evalTok, evalW2, ih .w01 k v] + exact (rot_w10 (k + evalVar n a b c d v) (evalHalf n a b c d ys)).symm + · simp only [evalHalf, evalTok, evalW2, ih .w11 k v] + exact (rot_w11 (k + evalVar n a b c d v) (evalHalf n a b c d ys)).symm + · dsimp [pushPowAux] + cases hw : w2Eq w w2 with + | false => rfl + | true => + have hw_eq := w2Eq_sound hw + subst hw_eq + cases hm : canMergeVars v v2 with + | none => rfl + | some vm => + dsimp only + rw [ih w (k + k2) vm] + have hvm := canMergeVars_sound n a b c d hm + have hexp : + (k + evalVar n a b c d v) + (k2 + evalVar n a b c d v2) = + (k + k2) + evalVar n a b c d vm := by omega + simp only [evalHalf, evalTok, ← listblank_append_assoc, ← list_pow_add, hexp] + +def pushPow (w : W2) (k : Nat) (v : Var) (xs : List SymTok) : List SymTok := + match k, v with + | 0, .v0 => xs + | _, _ => pushPowAux w k v xs + +theorem pushPow_sound (n a b c d : Nat) (w : W2) (k : Nat) (v : Var) (xs : List SymTok) : + evalHalf n a b c d (pushPow w k v xs) = + evalTok n a b c d (.pow w k v) +> evalHalf n a b c d xs := by + rcases k with _ | k' <;> cases v <;> try exact pushPowAux_sound n a b c d w _ _ xs + rfl + +def unrollPow1 (w : W2) (k : Nat) (v : Var) (tail : List SymTok) : Option (List SymTok) := + match k with + | 0 => none + | k' + 1 => + match w with + | .w01 => some (.b0 :: .b1 :: pushPow .w01 k' v tail) + | .w10 => some (.b1 :: .b0 :: pushPow .w10 k' v tail) + | .w11 => some (.b1 :: .b1 :: pushPow .w11 k' v tail) + +theorem unrollPow1_sound (n a b c d : Nat) {w : W2} {k : Nat} {v : Var} + {tail ys : List SymTok} (h : unrollPow1 w k v tail = some ys) : + evalHalf n a b c d (.pow w k v :: tail) = evalHalf n a b c d ys := by + rcases k with _ | k' + · nomatch h + · cases w <;> dsimp [unrollPow1] at h <;> injection h with h <;> subst h <;> + simp only [evalHalf, evalTok, evalW2, pushPow_sound, Nat.succ_add] <;> + exact right_pow_succ _ (k' + evalVar n a b c d v) (evalHalf n a b c d tail) + +def rotateHead : List SymTok → Option (List SymTok) + | .pow w1 k1 v1 :: .pow w2 k2 v2 :: ys => + match w2Eq w1 w2 with + | true => + match canMergeVars v1 v2 with + | some vm => some (.pow w1 (k1 + k2) vm :: ys) + | none => unrollPow1 w1 k1 v1 (.pow w2 k2 v2 :: ys) + | false => + unrollPow1 w1 k1 v1 (.pow w2 k2 v2 :: ys) + | .pow w k v :: .b0 :: ys => + match w with + | .w01 => some (.b0 :: pushPow .w10 k v ys) + | .w10 => unrollPow1 .w10 k v (.b0 :: ys) + | .w11 => unrollPow1 .w11 k v (.b0 :: ys) + | .pow w k v :: .b1 :: ys => + match w with + | .w11 => some (.b1 :: pushPow .w11 k v ys) + | .w10 => some (.b1 :: pushPow .w01 k v ys) + | .w01 => unrollPow1 .w01 k v (.b1 :: ys) + | .pow w k v :: [] => unrollPow1 w k v [] + | _ => none + +theorem rotateHead_sound (n a b c d : Nat) {xs ys : List SymTok} + (h : rotateHead xs = some ys) : + evalHalf n a b c d xs = evalHalf n a b c d ys := by + rcases xs with _ | ⟨_ | _ | ⟨w1, k1, v1⟩, tail⟩ + · nomatch h + · nomatch h + · nomatch h + · rcases tail with _ | ⟨_ | _ | ⟨w2, k2, v2⟩, rest⟩ + · exact unrollPow1_sound n a b c d h + · cases w1 + · dsimp [rotateHead] at h + injection h with h'; subst h' + simp only [evalHalf, evalTok, evalW2, pushPow_sound] + exact rot_w01 (k1 + evalVar n a b c d v1) (evalHalf n a b c d rest) + · exact unrollPow1_sound n a b c d h + · exact unrollPow1_sound n a b c d h + · cases w1 + · exact unrollPow1_sound n a b c d h + · dsimp [rotateHead] at h + injection h with h'; subst h' + simp only [evalHalf, evalTok, evalW2, pushPow_sound] + exact rot_w10 (k1 + evalVar n a b c d v1) (evalHalf n a b c d rest) + · dsimp [rotateHead] at h + injection h with h'; subst h' + simp only [evalHalf, evalTok, evalW2, pushPow_sound] + exact rot_w11 (k1 + evalVar n a b c d v1) (evalHalf n a b c d rest) + · dsimp [rotateHead] at h + cases hw : w2Eq w1 w2 with + | false => + rw [hw] at h + exact unrollPow1_sound n a b c d h + | true => + rw [hw] at h + have hw_eq := w2Eq_sound hw + subst hw_eq + cases hm : canMergeVars v1 v2 with + | none => + rw [hm] at h + exact unrollPow1_sound n a b c d h + | some vm => + rw [hm] at h + injection h with h'; subst h' + have hvm := canMergeVars_sound n a b c d hm + have hexp : + (k1 + evalVar n a b c d v1) + (k2 + evalVar n a b c d v2) = + (k1 + k2) + evalVar n a b c d vm := by omega + simp only [evalHalf, evalTok, ← listblank_append_assoc, ← list_pow_add, hexp] + +def popBitOpt : List SymTok → Option (Bool × List SymTok) + | [] => some (false, []) + | .b0 :: xs => some (false, xs) + | .b1 :: xs => some (true, xs) + | .pow w (k' + 1) .v0 :: xs => + match w with + | .w01 => some (false, pushBit true (pushPow .w01 k' .v0 xs)) + | .w10 => some (true, pushBit false (pushPow .w10 k' .v0 xs)) + | .w11 => some (true, pushBit true (pushPow .w11 k' .v0 xs)) + | .pow _ _ _ :: _ => none + +theorem popBitOpt_sound (n a b c d : Nat) {xs : List SymTok} {cur : Bool} {rest : List SymTok} + (h : popBitOpt xs = some (cur, rest)) : + evalHalf n a b c d xs = ([evalBit cur] : List (Fin 2)) +> evalHalf n a b c d rest := by + rcases xs with _ | ⟨_ | _ | ⟨w, _ | k', v⟩, tail⟩ + · dsimp [popBitOpt] at h + injection h with h + rcases h with ⟨rfl, rfl⟩ + exact zero_cons_default.symm + · dsimp [popBitOpt] at h + injection h with h + rcases h with ⟨rfl, rfl⟩ + rfl + · dsimp [popBitOpt] at h + injection h with h + rcases h with ⟨rfl, rfl⟩ + rfl + · nomatch h + · cases v + · cases w <;> dsimp [popBitOpt] at h <;> injection h with h <;> rcases h with ⟨rfl, rfl⟩ <;> + simp only [evalHalf, evalTok, evalVar, evalW2, evalBit, + pushBit_sound, pushPow_sound, Nat.add_zero] <;> + exact right_pow_succ _ k' (evalHalf n a b c d tail) + · nomatch h + · nomatch h + · nomatch h + · nomatch h + · nomatch h + · nomatch h + +def popOne1 : List SymTok → Option (List SymTok) + | .b1 :: rest => some rest + | .pow .w11 (k' + 1) v :: rest => some (.b1 :: pushPow .w11 k' v rest) + | _ => none + +theorem popOne1_sound (n a b c d : Nat) {xs rem : List SymTok} + (h : popOne1 xs = some rem) : + evalHalf n a b c d xs = [1] +> evalHalf n a b c d rem := by + rcases xs with _ | ⟨_ | _ | ⟨w, _ | k', v⟩, rest⟩ + · nomatch h + · nomatch h + · injection h with h'; subst h'; rfl + · cases w <;> nomatch h + · cases w + · nomatch h + · simp only [popOne1] at h; nomatch h + · dsimp [popOne1] at h + injection h with h + subst h + simp only [evalHalf, evalTok, evalW2, pushPow_sound, Nat.succ_add] + exact right_pow_succ [1, 1] (k' + evalVar n a b c d v) (evalHalf n a b c d rest) + +def stripPrefix : List SymTok → List SymTok → Option (List SymTok) + | [], xs => some xs + | p :: ps, x :: xs => + match tokEq p x with + | true => stripPrefix ps xs + | false => none + | _ :: _, [] => none + +theorem stripPrefix_eq {pre xs rem : List SymTok} + (h : stripPrefix pre xs = some rem) : xs = pre ++ rem := by + induction pre generalizing xs with + | nil => simpa [stripPrefix] using h + | cons p ps ih => + rcases xs with _ | ⟨x, rest⟩ + · nomatch h + · dsimp [stripPrefix] at h + cases heq : tokEq p x with + | false => rw [heq] at h; nomatch h + | true => + rw [heq] at h + rw [tokEq_sound heq, ih h] + rfl + +def matchZero1 : List SymTok → Option (List SymTok) + | [] => some [] + | .b0 :: xs => some xs + | _ => none + +theorem matchZero1_sound (n a b c d : Nat) {xs rem : List SymTok} + (h : matchZero1 xs = some rem) : + evalHalf n a b c d xs = [0] +> evalHalf n a b c d rem := by + rcases xs with _ | ⟨_ | _ | ⟨w, k, v⟩, rest⟩ + · injection h with h'; subst h' + exact zero_list_default.symm + · injection h with h'; subst h' + rfl + · nomatch h + · nomatch h + +def matchZeros2 (xs : List SymTok) : Option (List SymTok) := + (matchZero1 xs).bind matchZero1 + +theorem matchZeros2_sound (n a b c d : Nat) {xs rem : List SymTok} + (h : matchZeros2 xs = some rem) : + evalHalf n a b c d xs = [0, 0] +> evalHalf n a b c d rem := by + unfold matchZeros2 at h + rw [Option.bind_eq_some_iff] at h + rcases h with ⟨m1, h1, h2⟩ + rw [matchZero1_sound n a b c d h1, matchZero1_sound n a b c d h2] + rfl + +def matchZeros3 (xs : List SymTok) : Option (List SymTok) := + (matchZeros2 xs).bind matchZero1 + +theorem matchZeros3_sound (n a b c d : Nat) {xs rem : List SymTok} + (h : matchZeros3 xs = some rem) : + evalHalf n a b c d xs = [0, 0, 0] +> evalHalf n a b c d rem := by + unfold matchZeros3 at h + rw [Option.bind_eq_some_iff] at h + rcases h with ⟨m2, h1, h2⟩ + rw [matchZeros2_sound n a b c d h1, matchZero1_sound n a b c d h2] + rfl + +def ReachRel (prog : Bool) (c1 c2 : Cfg (Fin 2) (Fin 6)) : Prop := + if prog then c1 [tm1]⊢⁺ c2 else c1 [tm1]⊢* c2 + +theorem ReachRel_eq {prog : Bool} {c1 c2 c3 : Cfg (Fin 2) (Fin 6)} + (h1 : ReachRel prog c1 c2) (h2 : c2 = c3) : ReachRel prog c1 c3 := + h2 ▸ h1 + +theorem ReachRel_star {prog : Bool} {c1 c2 c3 : Cfg (Fin 2) (Fin 6)} + (h1 : ReachRel prog c1 c2) (h2 : c2 [tm1]⊢* c3) : ReachRel prog c1 c3 := by + cases prog + · exact stepStar_trans h1 h2 + · exact stepPlus_stepStar_trans h1 h2 + +theorem ReachRel_plus {prog : Bool} {c1 c2 c3 : Cfg (Fin 2) (Fin 6)} + (h1 : ReachRel prog c1 c2) (h2 : c2 [tm1]⊢⁺ c3) : ReachRel true c1 c3 := by + cases prog + · exact stepStar_stepPlus_trans h1 h2 + · exact stepPlus_trans h1 h2 + +theorem ReachRel_step {prog : Bool} {c1 c2 c3 : Cfg (Fin 2) (Fin 6)} + (h1 : ReachRel prog c1 c2) (h2 : c2 [tm1]⊢ c3) : ReachRel true c1 c3 := + ReachRel_plus h1 (step_stepPlus tm1 c2 c3 h2) + +def fallbackRightRot (q : Q6) (l r : List SymTok) (prog : Bool) : Option SymState := + match rotateHead r with + | some r' => some ⟨q, .right, l, r', prog⟩ + | none => none + +theorem fallbackRightRot_sound (n a b c d : Nat) {q : Q6} {l r : List SymTok} {prog : Bool} + {s' : SymState} (h : fallbackRightRot q l r prog = some s') + {c0 : Cfg (Fin 2) (Fin 6)} + (h0 : ReachRel prog c0 (evalState n a b c d ⟨q, .right, l, r, prog⟩)) : + ReachRel s'.prog c0 (evalState n a b c d s') := by + unfold fallbackRightRot at h + cases hr : rotateHead r with + | none => rw [hr] at h; cases h + | some r' => + rw [hr] at h; injection h with h; subst h + refine ReachRel_eq h0 ?_ + simp only [evalState] + rw [rotateHead_sound n a b c d hr] + +def fallbackLeftRot (q : Q6) (l r : List SymTok) (prog : Bool) : Option SymState := + match rotateHead l with + | some l' => some ⟨q, .left, l', r, prog⟩ + | none => none + +theorem fallbackLeftRot_sound (n a b c d : Nat) {q : Q6} {l r : List SymTok} {prog : Bool} + {s' : SymState} (h : fallbackLeftRot q l r prog = some s') + {c0 : Cfg (Fin 2) (Fin 6)} + (h0 : ReachRel prog c0 (evalState n a b c d ⟨q, .left, l, r, prog⟩)) : + ReachRel s'.prog c0 (evalState n a b c d s') := by + unfold fallbackLeftRot at h + cases hl : rotateHead l with + | none => rw [hl] at h; cases h + | some l' => + rw [hl] at h; injection h with h; subst h + refine ReachRel_eq h0 ?_ + simp only [evalState] + rw [rotateHead_sound n a b c d hl] + +def tryRightShift (q : Q6) (w : W2) (k : Nat) (v : Var) (l r_rest : List SymTok) (prog : Bool) : + Option SymState := + match q, w with + | .q2, .w11 => some ⟨.q2, .right, pushPow .w01 k v l, r_rest, prog⟩ + | .q4, .w11 => some ⟨.q4, .right, pushPow .w10 k v l, r_rest, prog⟩ + | _, _ => fallbackRightRot q l (.pow w k v :: r_rest) prog + +theorem tryRightShift_sound (n a b c d : Nat) {q : Q6} {w : W2} {k : Nat} {v : Var} + {l r_rest : List SymTok} {prog : Bool} {s' : SymState} + (h : tryRightShift q w k v l r_rest prog = some s') + {c0 : Cfg (Fin 2) (Fin 6)} + (h0 : ReachRel prog c0 (evalState n a b c d ⟨q, .right, l, .pow w k v :: r_rest, prog⟩)) : + ReachRel s'.prog c0 (evalState n a b c d s') := by + cases q <;> cases w <;> try exact fallbackRightRot_sound n a b c d h h0 + · injection h with h'; subst h' + refine ReachRel_star h0 ?_ + simp only [evalState, evalQ, cfg_of, evalHalf, evalTok, evalW2, pushPow_sound] + exact shiftR_2_11 (k + evalVar n a b c d v) (evalHalf n a b c d l) (evalHalf n a b c d r_rest) + · injection h with h'; subst h' + refine ReachRel_star h0 ?_ + simp only [evalState, evalQ, cfg_of, evalHalf, evalTok, evalW2, pushPow_sound] + exact shiftR_4_11 (k + evalVar n a b c d v) (evalHalf n a b c d l) (evalHalf n a b c d r_rest) + +def tryLeftShift01 (k : Nat) (v : Var) (l_rest r : List SymTok) (prog : Bool) : + Option SymState := + match matchZeros3 r with + | some rem_r => + match tokListEq l_rest l39Toks with + | true => + some ⟨.q5, .left, [], List.append gToks (pushPow .w11 k v rem_r), prog⟩ + | false => + some ⟨.q5, .left, l_rest, + pushBit false (pushBit false (pushBit false (pushPow .w11 k v rem_r))), prog⟩ + | none => fallbackLeftRot .q5 (.pow .w01 k v :: l_rest) r prog + +theorem tryLeftShift01_sound (n a b c d : Nat) {k : Nat} {v : Var} + {l_rest r : List SymTok} {prog : Bool} {s' : SymState} + (h : tryLeftShift01 k v l_rest r prog = some s') + {c0 : Cfg (Fin 2) (Fin 6)} + (h0 : ReachRel prog c0 (evalState n a b c d ⟨.q5, .left, .pow .w01 k v :: l_rest, r, prog⟩)) : + ReachRel s'.prog c0 (evalState n a b c d s') := by + unfold tryLeftShift01 at h + cases hm : matchZeros3 r with + | none => + simp only [hm] at h + exact fallbackLeftRot_sound n a b c d h h0 + | some rem_r => + simp only [hm] at h + have hr := matchZeros3_sound n a b c d hm + cases hl39 : tokListEq l_rest l39Toks with + | true => + rw [hl39] at h + have hl_eq := tokListEq_sound hl39 + subst hl_eq + injection h with h'; subst h' + have hsh := shiftL_5_01 (k + evalVar n a b c d v) + (evalHalf n a b c d l39Toks) (evalHalf n a b c d rem_r) + have hl_eval : evalHalf n a b c d l39Toks = l39Bits +> default := by + rw [l39Toks_eq] + exact evalHalf_map_bit_end l39Bits n a b c d + have hg_eval : + evalHalf n a b c d (List.append gToks (pushPow .w11 k v rem_r)) = + G +> (([1, 1] : List (Fin 2)) ^ (k + evalVar n a b c d v) +> + evalHalf n a b c d rem_r) := by + change evalHalf n a b c d (gToks ++ pushPow .w11 k v rem_r) = _ + rw [gToks_eq, evalHalf_map_bit, pushPow_sound, evalTok, evalW2] + have hed := edge_in (([1, 1] : List (Fin 2)) ^ (k + evalVar n a b c d v) +> + evalHalf n a b c d rem_r) + rw [hl_eval] at hsh + refine ReachRel_star h0 ?_ + simp only [evalState, evalQ, cfg_of, evalHalf, evalTok, evalW2, hr, hl_eval, hg_eval] + exact stepStar_trans hsh hed + | false => + rw [hl39] at h + injection h with h'; subst h' + have hsh := shiftL_5_01 (k + evalVar n a b c d v) + (evalHalf n a b c d l_rest) (evalHalf n a b c d rem_r) + refine ReachRel_star h0 ?_ + simpa only [evalState, evalQ, evalBit, cfg_of, evalHalf, evalTok, evalW2, hr, + pushBit_sound, pushPow_sound, listblank_append_cons, listblank_append_nil] using hsh + +def tryLeftShift (q : Q6) (w : W2) (k : Nat) (v : Var) (l_rest r : List SymTok) (prog : Bool) : + Option SymState := + match q, w with + | .q5, .w10 => + match matchZeros2 r with + | some rem_r => + some ⟨.q5, .left, l_rest, pushBit false (pushBit false (pushPow .w11 k v rem_r)), prog⟩ + | none => fallbackLeftRot q (.pow w k v :: l_rest) r prog + | .q5, .w01 => + tryLeftShift01 k v l_rest r prog + | _, _ => + fallbackLeftRot q (.pow w k v :: l_rest) r prog + +theorem tryLeftShift_sound (n a b c d : Nat) {q : Q6} {w : W2} {k : Nat} {v : Var} + {l_rest r : List SymTok} {prog : Bool} {s' : SymState} + (h : tryLeftShift q w k v l_rest r prog = some s') + {c0 : Cfg (Fin 2) (Fin 6)} + (h0 : ReachRel prog c0 (evalState n a b c d ⟨q, .left, .pow w k v :: l_rest, r, prog⟩)) : + ReachRel s'.prog c0 (evalState n a b c d s') := by + cases q <;> cases w <;> try exact fallbackLeftRot_sound n a b c d h h0 + · exact tryLeftShift01_sound n a b c d h h0 + · dsimp [tryLeftShift] at h + cases hm : matchZeros2 r with + | none => + simp only [hm] at h + exact fallbackLeftRot_sound n a b c d h h0 + | some rem_r => + simp only [hm] at h + injection h with h'; subst h' + have hr := matchZeros2_sound n a b c d hm + have hsh := shiftL_5_10 (k + evalVar n a b c d v) + (evalHalf n a b c d l_rest) (evalHalf n a b c d rem_r) + refine ReachRel_star h0 ?_ + simpa only [evalState, evalQ, evalBit, cfg_of, evalHalf, evalTok, evalW2, hr, + pushBit_sound, pushPow_sound, listblank_append_cons, listblank_append_nil] using hsh + +def canCreatePow (usePow : Bool) (l : List SymTok) : Bool := + match usePow, l with + | true, .b0 :: .pow _ _ _ :: _ => false + | true, _ => true + | false, _ => false + +def matchTwoOnes : List SymTok → Option (List SymTok) + | .b1 :: .b1 :: rest => some rest + | _ => none + +theorem matchTwoOnes_sound (n a b c d : Nat) {xs rem : List SymTok} + (h : matchTwoOnes xs = some rem) : + evalHalf n a b c d xs = [1] +> ([1] +> evalHalf n a b c d rem) := by + rcases xs with _ | ⟨t1, rest1⟩ + · nomatch h + · rcases t1 with _ | _ | _ + · nomatch h + · rcases rest1 with _ | ⟨t2, rest⟩ + · nomatch h + · rcases t2 with _ | _ | _ + · nomatch h + · injection h with h'; subst h'; rfl + · nomatch h + · nomatch h + +def stepConcreteRightPop (q : Q6) (l r : List SymTok) : Option SymState := + match popBitOpt r with + | none => none + | some (cur, r_rest) => + match stepQ q cur with + | some (q', w_bit, .right) => + some ⟨q', .right, pushBit w_bit l, r_rest, true⟩ + | some (q', w_bit, .left) => + some ⟨q', .left, l, pushBit w_bit r_rest, true⟩ + | none => none + +theorem stepConcreteRightPop_sound (n a b c d : Nat) {q : Q6} {l r : List SymTok} + {prog : Bool} {s' : SymState} + (h : stepConcreteRightPop q l r = some s') + {c0 : Cfg (Fin 2) (Fin 6)} + (h0 : ReachRel prog c0 (evalState n a b c d ⟨q, .right, l, r, prog⟩)) : + ReachRel s'.prog c0 (evalState n a b c d s') := by + unfold stepConcreteRightPop at h + cases hp : popBitOpt r with + | none => simp [hp] at h + | some pair => + rcases pair with ⟨cur, r_rest⟩ + simp only [hp] at h + have hr := popBitOpt_sound n a b c d hp + cases hsq : stepQ q cur with + | none => rw [hsq] at h; cases h + | some val => + rcases val with ⟨q', w_bit, d'⟩ + have htm := stepQ_sound hsq + cases d' with + | left => + rw [hsq] at h; injection h with h; subst h + have hsl : step_local tm1 ⟨[], [evalBit cur], evalQ q, .right⟩ = + some ⟨[], [evalBit w_bit], evalQ q', .left⟩ := by + simp [step_local, htm] + have hst := step_local_spec hsl (evalHalf n a b c d l) (evalHalf n a b c d r_rest) + simp only [cfg_of, listblank_append_nil] at hst + rw [← hr, ← pushBit_sound n a b c d w_bit r_rest] at hst + exact ReachRel_step h0 hst + | right => + rw [hsq] at h; injection h with h; subst h + have hsl : step_local tm1 ⟨[], [evalBit cur], evalQ q, .right⟩ = + some ⟨[evalBit w_bit], [], evalQ q', .right⟩ := by + simp [step_local, htm] + have hst := step_local_spec hsl (evalHalf n a b c d l) (evalHalf n a b c d r_rest) + simp only [cfg_of, listblank_append_nil] at hst + rw [← hr, ← pushBit_sound n a b c d w_bit l] at hst + exact ReachRel_step h0 hst + +def stepConcreteRight (usePow : Bool) (q : Q6) (l r : List SymTok) : Option SymState := + match matchTwoOnes r with + | some r_rest => + match canCreatePow usePow l, q with + | true, .q2 => some ⟨.q2, .right, pushPow .w01 1 .v0 l, r_rest, true⟩ + | true, .q4 => some ⟨.q4, .right, pushPow .w10 1 .v0 l, r_rest, true⟩ + | _, _ => stepConcreteRightPop q l r + | none => stepConcreteRightPop q l r + +theorem stepConcreteRight_sound (n a b c d : Nat) {usePow : Bool} {q : Q6} {l r : List SymTok} + {prog : Bool} {s' : SymState} + (h : stepConcreteRight usePow q l r = some s') + {c0 : Cfg (Fin 2) (Fin 6)} + (h0 : ReachRel prog c0 (evalState n a b c d ⟨q, .right, l, r, prog⟩)) : + ReachRel s'.prog c0 (evalState n a b c d s') := by + unfold stepConcreteRight at h + cases hm : matchTwoOnes r with + | none => + simp only [hm] at h + exact stepConcreteRightPop_sound n a b c d h h0 + | some r_rest => + simp only [hm] at h + have hr := matchTwoOnes_sound n a b c d hm + cases hcan : canCreatePow usePow l with + | false => + rw [hcan] at h + exact stepConcreteRightPop_sound n a b c d h h0 + | true => + rw [hcan] at h + cases q <;> try exact stepConcreteRightPop_sound n a b c d h h0 + · injection h with h'; subst h' + refine ReachRel_plus h0 ?_ + simp only [evalState, evalQ, cfg_of, evalTok, evalVar, evalW2, hr, pushPow_sound] + exact shiftR_2_11_plus (evalHalf n a b c d l) (evalHalf n a b c d r_rest) + · injection h with h'; subst h' + refine ReachRel_plus h0 ?_ + simp only [evalState, evalQ, cfg_of, evalTok, evalVar, evalW2, hr, pushPow_sound] + exact shiftR_4_11_plus (evalHalf n a b c d l) (evalHalf n a b c d r_rest) + +def stepConcreteLeftPop (q : Q6) (l r : List SymTok) : Option SymState := + match popBitOpt l with + | none => none + | some (cur, l_rest) => + match stepQ q cur with + | some (q', w_bit, .right) => + some ⟨q', .right, pushBit w_bit l_rest, r, true⟩ + | some (q', w_bit, .left) => + some ⟨q', .left, l_rest, pushBit w_bit r, true⟩ + | none => none + +theorem stepConcreteLeftPop_sound (n a b c d : Nat) {q : Q6} {l r : List SymTok} + {prog : Bool} {s' : SymState} + (h : stepConcreteLeftPop q l r = some s') + {c0 : Cfg (Fin 2) (Fin 6)} + (h0 : ReachRel prog c0 (evalState n a b c d ⟨q, .left, l, r, prog⟩)) : + ReachRel s'.prog c0 (evalState n a b c d s') := by + unfold stepConcreteLeftPop at h + cases hp : popBitOpt l with + | none => simp [hp] at h + | some pair => + rcases pair with ⟨cur, l_rest⟩ + simp only [hp] at h + have hl := popBitOpt_sound n a b c d hp + cases hsq : stepQ q cur with + | none => rw [hsq] at h; cases h + | some val => + rcases val with ⟨q', w_bit, d'⟩ + have htm := stepQ_sound hsq + cases d' with + | left => + rw [hsq] at h; injection h with h; subst h + have hsl : step_local tm1 ⟨[evalBit cur], [], evalQ q, .left⟩ = + some ⟨[], [evalBit w_bit], evalQ q', .left⟩ := by + simp [step_local, htm] + have hst := step_local_spec hsl (evalHalf n a b c d l_rest) (evalHalf n a b c d r) + simp only [cfg_of, listblank_append_nil] at hst + rw [← hl, ← pushBit_sound n a b c d w_bit r] at hst + exact ReachRel_step h0 hst + | right => + rw [hsq] at h; injection h with h; subst h + have hsl : step_local tm1 ⟨[evalBit cur], [], evalQ q, .left⟩ = + some ⟨[evalBit w_bit], [], evalQ q', .right⟩ := by + simp [step_local, htm] + have hst := step_local_spec hsl (evalHalf n a b c d l_rest) (evalHalf n a b c d r) + simp only [cfg_of, listblank_append_nil] at hst + rw [← hl, ← pushBit_sound n a b c d w_bit l_rest] at hst + exact ReachRel_step h0 hst + +def stepConcreteLeft (q : Q6) (l r : List SymTok) (prog : Bool) : Option SymState := + match q, l with + | .q5, [] => + match stripPrefix gToks r with + | some r_after_g => + match popOne1 r_after_g with + | some rem_r => some ⟨.q2, .right, l41Toks, pushPow .w11 2 .v0 rem_r, prog⟩ + | none => stepConcreteLeftPop .q5 [] r + | none => stepConcreteLeftPop .q5 [] r + | q, l => stepConcreteLeftPop q l r + +theorem stepConcreteLeft_sound (n a b c d : Nat) {q : Q6} {l r : List SymTok} + {prog : Bool} {s' : SymState} + (h : stepConcreteLeft q l r prog = some s') + {c0 : Cfg (Fin 2) (Fin 6)} + (h0 : ReachRel prog c0 (evalState n a b c d ⟨q, .left, l, r, prog⟩)) : + ReachRel s'.prog c0 (evalState n a b c d s') := by + cases q <;> cases l <;> dsimp [stepConcreteLeft] at h <;> + try exact stepConcreteLeftPop_sound n a b c d h h0 + cases hs : stripPrefix gToks r with + | none => + simp only [hs] at h + exact stepConcreteLeftPop_sound n a b c d h h0 + | some r_after_g => + simp only [hs] at h + cases hp1 : popOne1 r_after_g with + | none => + simp only [hp1] at h + exact stepConcreteLeftPop_sound n a b c d h h0 + | some rem_r => + simp only [hp1] at h + injection h with h'; subst h' + have hr_eq := stripPrefix_eq hs + have hp1_eq := popOne1_sound n a b c d hp1 + have hr_eval : evalHalf n a b c d r = G +> ([1] +> evalHalf n a b c d rem_r) := by + rw [hr_eq, gToks_eq, evalHalf_map_bit, hp1_eq] + have hl41_eval : evalHalf n a b c d l41Toks = l41Bits +> default := by + rw [l41Toks_eq] + exact evalHalf_map_bit_end l41Bits n a b c d + have hr_out : + evalHalf n a b c d (pushPow .w11 2 .v0 rem_r) = + [1, 1, 1, 1] +> evalHalf n a b c d rem_r := by + rw [pushPow_sound] + rfl + refine ReachRel_star h0 ?_ + simp only [evalState, evalQ, cfg_of, evalHalf, hr_eval, hl41_eval, hr_out] + exact edge_out (evalHalf n a b c d rem_r) + +def symStep (usePow : Bool) (s : SymState) : Option SymState := + match s.dir with + | .right => + match s.r with + | .pow w k v :: r_rest => tryRightShift s.q w k v s.l r_rest s.prog + | _ => stepConcreteRight usePow s.q s.l s.r + | .left => + match s.l with + | .pow w k v :: l_rest => tryLeftShift s.q w k v l_rest s.r s.prog + | _ => stepConcreteLeft s.q s.l s.r s.prog + +theorem symStep_sound (n a b c d : Nat) {usePow : Bool} {s s' : SymState} + (h : symStep usePow s = some s') + {c0 : Cfg (Fin 2) (Fin 6)} (h0 : ReachRel s.prog c0 (evalState n a b c d s)) : + ReachRel s'.prog c0 (evalState n a b c d s') := by + rcases s with ⟨q, dir, l, r, prog⟩ + cases dir with + | left => + rcases l with _ | ⟨_ | _ | ⟨w, k, v⟩, l_rest⟩ <;> dsimp [symStep] at h + · exact stepConcreteLeft_sound n a b c d h h0 + · exact stepConcreteLeft_sound n a b c d h h0 + · exact stepConcreteLeft_sound n a b c d h h0 + · exact tryLeftShift_sound n a b c d h h0 + | right => + rcases r with _ | ⟨_ | _ | ⟨w, k, v⟩, r_rest⟩ <;> dsimp [symStep] at h + · exact stepConcreteRight_sound n a b c d h h0 + · exact stepConcreteRight_sound n a b c d h h0 + · exact stepConcreteRight_sound n a b c d h h0 + · exact tryRightShift_sound n a b c d h h0 + +def runSym (usePow : Bool) : Nat → SymState → Option SymState + | 0, s => some s + | k + 1, s => + match symStep usePow s with + | some s' => runSym usePow k s' + | none => none + +theorem runSym_sound (n a b c d : Nat) {usePow : Bool} : + ∀ (k : Nat) {s s' : SymState}, + runSym usePow k s = some s' → + ∀ {c0 : Cfg (Fin 2) (Fin 6)}, + ReachRel s.prog c0 (evalState n a b c d s) → + ReachRel s'.prog c0 (evalState n a b c d s') + | 0, s, s', h, _, h0 => by + injection h with h'; subst h'; exact h0 + | k + 1, s, s', h, _, h0 => by + unfold runSym at h + cases hs : symStep usePow s with + | none => simp [hs] at h + | some sm => + simp only [hs] at h + exact runSym_sound n a b c d k h (symStep_sound n a b c d hs h0) + +def insertCanon (t : SymTok) (xs : List SymTok) : List SymTok := + match t with + | .b0 => pushBit false xs + | .b1 => + match xs with + | .b1 :: rest => pushPow .w11 1 .v0 rest + | _ => pushBit true xs + | .pow w k v => pushPow w k v xs + +theorem evalHalf_insertCanon (n a b c d : Nat) (t : SymTok) (xs : List SymTok) : + evalHalf n a b c d (insertCanon t xs) = + evalTok n a b c d t +> evalHalf n a b c d xs := by + rcases t with _ | _ | ⟨w, k, v⟩ + · exact pushBit_sound n a b c d false xs + · rcases xs with _ | ⟨_ | _ | ⟨w2, k2, v2⟩, rest⟩ + · exact pushBit_sound n a b c d true [] + · exact pushBit_sound n a b c d true (.b0 :: rest) + · dsimp [insertCanon] + rw [pushPow_sound] + rfl + · exact pushBit_sound n a b c d true (.pow w2 k2 v2 :: rest) + · exact pushPow_sound n a b c d w k v xs + +def canonHalf : List SymTok → List SymTok + | [] => [] + | x :: xs => insertCanon x (canonHalf xs) + +theorem evalHalf_canonHalf (n a b c d : Nat) (xs : List SymTok) : + evalHalf n a b c d (canonHalf xs) = evalHalf n a b c d xs := by + induction xs with + | nil => rfl + | cons x xs ih => + simp only [canonHalf, evalHalf_insertCanon, ih, evalHalf] + +def checkMid (usePow : Bool) (fuel : Nat) (s1 s2 : SymState) : Bool := + match runSym usePow fuel { s1 with prog := false } with + | some s' => + s'.prog && + q6Eq s'.q s2.q && + dirEq s'.dir s2.dir && + tokListEq s'.l s2.l && + tokListEq s'.r s2.r + | none => false + +theorem checkMid_sound (n a b c d : Nat) {usePow : Bool} {fuel : Nat} {s1 s2 : SymState} + (h : checkMid usePow fuel s1 s2 = true) : + (evalState n a b c d s1) [tm1]⊢* (evalState n a b c d s2) := by + unfold checkMid at h + cases hr : runSym usePow fuel { s1 with prog := false } with + | none => rw [hr] at h; cases h + | some s' => + simp only [hr, Bool.and_assoc, Bool.and_eq_true] at h + rcases h with ⟨hp, hq, hdir, hl, hr_eq⟩ + have h0 : ReachRel false (evalState n a b c d s1) + (evalState n a b c d { s1 with prog := false }) := + stepStar_refl tm1 _ + have hreach := runSym_sound n a b c d fuel hr h0 + rw [hp] at hreach + have heq : evalState n a b c d s' = evalState n a b c d s2 := by + simp only [evalState, q6Eq_sound hq, dirEq_sound hdir, tokListEq_sound hl, + tokListEq_sound hr_eq] + rw [heq] at hreach + exact stepPlus_stepStar hreach + +def checkSym (usePow : Bool) (fuel : Nat) (s1 s2 : SymState) : Bool := + match runSym usePow fuel { s1 with prog := false } with + | some s' => + s'.prog && + q6Eq s'.q s2.q && + dirEq s'.dir s2.dir && + tokListEq (canonHalf s'.l) (canonHalf s2.l) && + tokListEq (canonHalf s'.r) (canonHalf s2.r) + | none => false + +theorem checkSym_sound (n a b c d : Nat) {usePow : Bool} {fuel : Nat} {s1 s2 : SymState} + (h : checkSym usePow fuel s1 s2 = true) : + (evalState n a b c d s1) [tm1]⊢⁺ (evalState n a b c d s2) := by + unfold checkSym at h + cases hr : runSym usePow fuel { s1 with prog := false } with + | none => rw [hr] at h; cases h + | some s' => + simp only [hr, Bool.and_assoc, Bool.and_eq_true] at h + rcases h with ⟨hp, hq, hdir, hl_c, hr_c⟩ + have h0 : ReachRel false (evalState n a b c d s1) + (evalState n a b c d { s1 with prog := false }) := + stepStar_refl tm1 _ + have hreach := runSym_sound n a b c d fuel hr h0 + rw [hp] at hreach + have heq : evalState n a b c d s' = evalState n a b c d s2 := by + have hl_eq : evalHalf n a b c d s'.l = evalHalf n a b c d s2.l := by + rw [← evalHalf_canonHalf n a b c d s'.l, tokListEq_sound hl_c, evalHalf_canonHalf] + have hr_eq : evalHalf n a b c d s'.r = evalHalf n a b c d s2.r := by + rw [← evalHalf_canonHalf n a b c d s'.r, tokListEq_sound hr_c, evalHalf_canonHalf] + simp only [evalState, q6Eq_sound hq, dirEq_sound hdir, hl_eq, hr_eq] + rwa [heq] at hreach + +-- ============================================================================ +-- 4. Symbolic `Kr` Builders & The Five Macro Transitions (`S_step`, `TE`, `TO`, `T6`, `T8`) +-- ============================================================================ + +def segVar (pre : List (Fin 2)) (k0 : Nat) (v : Var) : List SymTok := + pre.map bitToTok ++ [.pow .w11 k0 v] + +def segConst (pre : List (Fin 2)) (k0 : Nat) : List SymTok := + segVar pre k0 .v0 + +theorem evalHalf_segVar (pre : List (Fin 2)) (k0 : Nat) (v : Var) (rest : List SymTok) + (n a b c d : Nat) : + evalHalf n a b c d (segVar pre k0 v ++ rest) = + pre +> (([1, 1] : List (Fin 2)) ^ (k0 + evalVar n a b c d v) +> evalHalf n a b c d rest) := by + rw [segVar, List.append_assoc, evalHalf_map_bit] + rfl + +theorem evalHalf_segConst (pre : List (Fin 2)) (k0 : Nat) (rest : List SymTok) (n a b c d : Nat) : + evalHalf n a b c d (segConst pre k0 ++ rest) = + pre +> (([1, 1] : List (Fin 2)) ^ k0 +> evalHalf n a b c d rest) := by + rw [segConst, evalHalf_segVar] + rfl + +def krTailToks : List SymTok := + [SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, + SymTok.b1, SymTok.b1, SymTok.b1] + +theorem krTailToks_eq : krTailToks = ([0, 1, 1, 0, 0, 1, 1, 0, 1, 1, + 1] : List (Fin 2)).map bitToTok := rfl + +def mkSymKr (r : List SymTok) : SymState := + ⟨.q5, .left, [], r, false⟩ + +def symS_lhs : SymState := + mkSymKr ( + segVar (G ++ [1]) 0 .vn ++ + segVar [0] 5 .va ++ + segVar [0, 1, 1, 0] 3 .vb ++ + segVar [0, 0, 0, 0, 0, 0, 1] 3 .vc ++ + segVar [0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0] 1 .vd ++ + krTailToks) + +def symS_rhs : SymState := + mkSymKr ( + segVar (G ++ [1]) 24 .vn ++ + segVar [0] 1 .va ++ + segVar [0, 1, 1, 0] 5 .vb ++ + segVar [0, 0, 0, 0, 0, 0, 1] 3 .vc ++ + segVar [0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0] 3 .vd ++ + krTailToks) + +set_option maxRecDepth 200000 in +theorem S_step_cert : checkSym true 2192 symS_lhs symS_rhs = true := by + decide + +theorem S_step (n a b c d : Nat) : + (Kr n (5 + a) (3 + b) (3 + c) (1 + d)) [tm1]⊢⁺ + (Kr (24 + n) (1 + a) (5 + b) (3 + c) (3 + d)) := by + have h := checkSym_sound n a b c d S_step_cert + have h1 : evalState n a b c d symS_lhs = Kr n (5 + a) (3 + b) (3 + c) (1 + d) := by + simp only [symS_lhs, mkSymKr, krTailToks_eq, Kr, krRightList, evalState, evalQ, cfg_of, + List.append_assoc, evalHalf_segVar, evalHalf_map_bit_end, evalHalf, evalVar, Nat.zero_add, + listblank_append_assoc] + have h2 : evalState n a b c d symS_rhs = Kr (24 + n) (1 + a) (5 + b) (3 + c) (3 + d) := by + simp only [symS_rhs, mkSymKr, krTailToks_eq, Kr, krRightList, evalState, evalQ, cfg_of, + List.append_assoc, evalHalf_segVar, evalHalf_map_bit_end, evalHalf, evalVar, + listblank_append_assoc] + rwa [h1, h2] at h + +theorem S_iter (k n a b c d : Nat) : + (Kr n (4 * k + 1 + a) (3 + b) (3 + c) (1 + d)) [tm1]⊢* + (Kr (24 * k + n) (1 + a) (2 * k + 3 + b) (3 + c) (2 * k + 1 + d)) := by + induction k generalizing n b d with + | zero => + have h0 : Kr n (4 * 0 + 1 + a) (3 + b) (3 + c) (1 + d) = + Kr (24 * 0 + n) (1 + a) (2 * 0 + 3 + b) (3 + c) (2 * 0 + 1 + d) := + Kr_congr (by omega) (by omega) (by omega) (by omega) (by omega) + rw [h0] + try exact stepStar_refl tm1 _ + | succ k ih => + have h_lhs : Kr n (4 * (k + 1) + 1 + a) (3 + b) (3 + c) (1 + d) = + Kr n (5 + (4 * k + a)) (3 + b) (3 + c) (1 + d) := + Kr_congr rfl (by omega) rfl rfl rfl + have h1 : (Kr n (5 + (4 * k + a)) (3 + b) (3 + c) (1 + d)) [tm1]⊢* + (Kr (24 + n) (4 * k + 1 + a) (3 + (2 + b)) (3 + c) (1 + (2 + d))) := by + have hs := stepPlus_stepStar (S_step n (4 * k + a) b c d) + have h_mid : Kr (24 + n) (1 + (4 * k + a)) (5 + b) (3 + c) (3 + d) = + Kr (24 + n) (4 * k + 1 + a) (3 + (2 + b)) (3 + c) (1 + (2 + d)) := + Kr_congr rfl (by omega) (by omega) rfl (by omega) + rwa [h_mid] at hs + have h2 := ih (24 + n) (2 + b) (2 + d) + have h_rhs : + Kr (24 * k + (24 + n)) (1 + a) (2 * k + 3 + (2 + b)) (3 + c) (2 * k + 1 + (2 + d)) = + Kr (24 * (k + 1) + n) (1 + a) (2 * (k + 1) + 3 + b) (3 + c) (2 * (k + 1) + 1 + d) := + Kr_congr (by omega) rfl (by omega) rfl (by omega) + rw [h_lhs] + rw [h_rhs] at h2 + exact stepStar_trans h1 h2 + +def symTE_lhs : SymState := + mkSymKr ( + segVar (G ++ [1]) 0 .vn ++ + segConst [0] 2 ++ + segVar [0, 1, 1, 0] 44 .vb ++ + segConst [0, 0, 0, 0, 0, 0, 1] 17 ++ + segVar [0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0] 10 .vd ++ + krTailToks) + +def symTE_rhs : SymState := + mkSymKr ( + segVar (G ++ [1]) 278 .vn ++ + segVar [0] 1 .vb ++ + segConst [0, 1, 1, 0] 41 ++ + segVar [0, 0, 0, 0, 0, 0, 1] 35 .vd ++ + segConst [0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0] 9 ++ + krTailToks) + +def TE_mid1 : SymState := + mkSymKr (List.append gToks [SymTok.b1, SymTok.b1, SymTok.b1, SymTok.pow .w11 91 .vn, SymTok.b0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 30 .vb, SymTok.b0, SymTok.b0, + SymTok.pow .w11 2 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.b1, SymTok.pow .w11 24 .v0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, + SymTok.pow .w11 29 .vd, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 3 .v0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.pow .w11 2 .v0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 1 .v0, + SymTok.b0, SymTok.b1, SymTok.b1]) + +def TE_mid2 : SymState := + mkSymKr (List.append gToks [SymTok.pow .w11 184 .vn, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.pow .w11 16 .vb, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.b1, SymTok.b1, SymTok.pow .w11 31 .v0, SymTok.b0, SymTok.b0, SymTok.pow .w11 1 .v0, + SymTok.b0, SymTok.b0, SymTok.pow .w11 37 .vd, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.pow .w11 1 .v0, SymTok.b0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.pow .w11 6 .v0, SymTok.b0, SymTok.b1, SymTok.b1]) + +def TE_mid3 : SymState := + mkSymKr (List.append gToks [SymTok.b1, SymTok.b1, SymTok.pow .w11 269 .vn, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 0 .vb, SymTok.b0, + SymTok.b0, SymTok.pow .w11 43 .v0, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, + SymTok.pow .w11 34 .vd, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.pow .w11 2 .v0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.pow .w11 2 .v0, SymTok.b0, SymTok.b0, + SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.pow .w11 9 .v0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, + SymTok.pow .w11 1 .v0]) + +set_option maxRecDepth 200000 in +theorem TE_cert1 : checkMid true 8440 symTE_lhs TE_mid1 = true := by + decide + +set_option maxRecDepth 200000 in +theorem TE_cert2 : checkMid true 8286 TE_mid1 TE_mid2 = true := by + decide + +set_option maxRecDepth 200000 in +theorem TE_cert3 : checkMid true 8494 TE_mid2 TE_mid3 = true := by + decide + +set_option maxRecDepth 200000 in +theorem TE_cert_end : checkSym true 226 TE_mid3 symTE_rhs = true := by + decide + +theorem TE (n b d : Nat) : + (Kr n 2 (44 + b) 17 (10 + d)) [tm1]⊢⁺ + (Kr (278 + n) (1 + b) 41 (35 + d) 9) := by + have h := + (stepStar_stepPlus_trans (checkMid_sound n 0 b 0 d TE_cert1) (stepStar_stepPlus_trans + (checkMid_sound n 0 b 0 d TE_cert2) (stepStar_stepPlus_trans (checkMid_sound n 0 b 0 d + TE_cert3) (checkSym_sound n 0 b 0 d TE_cert_end)))) + have h1 : evalState n 0 b 0 d symTE_lhs = Kr n 2 (44 + b) 17 (10 + d) := by + simp only [symTE_lhs, mkSymKr, krTailToks_eq, Kr, krRightList, evalState, evalQ, cfg_of, + List.append_assoc, evalHalf_segVar, evalHalf_segConst, evalHalf_map_bit_end, evalHalf, + evalVar, Nat.zero_add, listblank_append_assoc] + have h2 : evalState n 0 b 0 d symTE_rhs = Kr (278 + n) (1 + b) 41 (35 + d) 9 := by + simp only [symTE_rhs, mkSymKr, krTailToks_eq, Kr, krRightList, evalState, evalQ, cfg_of, + List.append_assoc, evalHalf_segVar, evalHalf_segConst, evalHalf_map_bit_end, evalHalf, + evalVar, listblank_append_assoc] + rwa [h1, h2] at h + +def symTO_lhs : SymState := + mkSymKr ( + segVar (G ++ [1]) 0 .vn ++ + segConst [0] 1 ++ + segVar [0, 1, 1, 0] 41 .vb ++ + segVar [0, 0, 0, 0, 0, 0, 1] 18 .vc ++ + segVar [0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0] 9 .vd ++ + krTailToks) + +def symTO_rhs : SymState := + mkSymKr ( + segVar (G ++ [1]) 294 .vn ++ + segVar [0] 14 .vbc ++ + segVar [0, 1, 1, 0] 40 .vd ++ + segConst [0, 0, 0, 0, 0, 0, 1] 17 ++ + segConst [0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0] 9 ++ + krTailToks) + +def TO_mid1 : SymState := + mkSymKr (List.append gToks [SymTok.b1, SymTok.b1, SymTok.pow .w11 121 .vn, SymTok.b0, SymTok.b0, + SymTok.pow .w11 43 .vbc, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.pow .w11 26 .vd, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.b1, SymTok.pow .w11 17 .v0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, + SymTok.pow .w11 2 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.pow .w11 3 .v0, SymTok.b0, SymTok.b1, SymTok.b1]) + +def TO_mid2 : SymState := + mkSymKr (List.append gToks [SymTok.pow .w11 212 .vn, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.pow .w11 27 .vbc, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 1 .v0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b1, SymTok.pow .w11 31 .vd, SymTok.b0, + SymTok.pow .w11 17 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.pow .w11 3 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.pow .w11 5 .v0, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 1 .v0, + SymTok.b0, SymTok.b1, SymTok.b1]) + +set_option maxRecDepth 200000 in +theorem TO_cert1 : checkMid true 8454 symTO_lhs TO_mid1 = true := by + decide + +set_option maxRecDepth 200000 in +theorem TO_cert2 : checkMid true 8069 TO_mid1 TO_mid2 = true := by + decide + +set_option maxRecDepth 200000 in +theorem TO_cert_end : checkSym true 7854 TO_mid2 symTO_rhs = true := by + decide + +theorem TO (n b c d : Nat) : + (Kr n 1 (41 + b) (18 + c) (9 + d)) [tm1]⊢⁺ + (Kr (294 + n) (14 + b + c) (40 + d) 17 9) := by + have h := + (stepStar_stepPlus_trans (checkMid_sound n 0 b c d TO_cert1) (stepStar_stepPlus_trans + (checkMid_sound n 0 b c d TO_cert2) (checkSym_sound n 0 b c d TO_cert_end))) + have h1 : evalState n 0 b c d symTO_lhs = Kr n 1 (41 + b) (18 + c) (9 + d) := by + simp only [symTO_lhs, mkSymKr, krTailToks_eq, Kr, krRightList, evalState, evalQ, cfg_of, + List.append_assoc, evalHalf_segVar, evalHalf_segConst, evalHalf_map_bit_end, evalHalf, + evalVar, Nat.zero_add, listblank_append_assoc] + have h2 : evalState n 0 b c d symTO_rhs = Kr (294 + n) (14 + b + c) (40 + d) 17 9 := by + rw [show 14 + b + c = 14 + (b + c) from Nat.add_assoc 14 b c] + simp only [symTO_rhs, mkSymKr, krTailToks_eq, Kr, krRightList, evalState, evalQ, cfg_of, + List.append_assoc, evalHalf_segVar, evalHalf_segConst, evalHalf_map_bit_end, evalHalf, + evalVar, listblank_append_assoc] + rwa [h1, h2] at h + +def symT6_lhs : SymState := + mkSymKr ( + segVar (G ++ [1]) 0 .vn ++ + segConst [0] 3 ++ + segVar [0, 1, 1, 0] 41 .vb ++ + segVar [0, 0, 0, 0, 0, 0, 1] 17 .vc ++ + segVar [0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0] 9 .vd ++ + krTailToks) + +def symT6_rhs : SymState := + mkSymKr ( + segVar (G ++ [1]) 296 .vn ++ + segVar [0] 13 .vbc ++ + segVar [0, 1, 1, 0] 40 .vd ++ + segConst [0, 0, 0, 0, 0, 0, 1] 17 ++ + segConst [0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0] 9 ++ + krTailToks) + +def T6_mid1 : SymState := + mkSymKr (List.append gToks [SymTok.pow .w11 118 .vn, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.pow .w11 42 .vbc, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 1 .v0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b1, SymTok.pow .w11 23 .vd, SymTok.b0, + SymTok.pow .w11 10 .v0, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 4 .v0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.pow .w11 2 .v0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 1 .v0, + SymTok.b0, SymTok.b1, SymTok.b1]) + +def T6_mid2 : SymState := + mkSymKr (List.append gToks [SymTok.pow .w11 202 .vn, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.pow .w11 28 .vbc, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.b1, SymTok.b1, SymTok.pow .w11 30 .vd, SymTok.b0, SymTok.b0, SymTok.pow .w11 1 .v0, + SymTok.b0, SymTok.b0, SymTok.pow .w11 19 .v0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.pow .w11 1 .v0, SymTok.b0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.pow .w11 6 .v0, SymTok.b0, SymTok.b1, SymTok.b1]) + +def T6_mid3 : SymState := + mkSymKr (List.append gToks [SymTok.b1, SymTok.b1, SymTok.pow .w11 287 .vn, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 12 .vbc, SymTok.b0, + SymTok.b0, SymTok.pow .w11 42 .vd, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, + SymTok.pow .w11 16 .v0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.pow .w11 2 .v0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.pow .w11 2 .v0, SymTok.b0, SymTok.b0, + SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.pow .w11 9 .v0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, + SymTok.pow .w11 1 .v0]) + +set_option maxRecDepth 200000 in +theorem T6_cert1 : checkMid true 7880 symT6_lhs T6_mid1 = true := by + decide + +set_option maxRecDepth 200000 in +theorem T6_cert2 : checkMid true 8036 T6_mid1 T6_mid2 = true := by + decide + +set_option maxRecDepth 200000 in +theorem T6_cert3 : checkMid true 8494 T6_mid2 T6_mid3 = true := by + decide + +set_option maxRecDepth 200000 in +theorem T6_cert_end : checkSym true 226 T6_mid3 symT6_rhs = true := by + decide + +theorem T6 (n b c d : Nat) : + (Kr n 3 (41 + b) (17 + c) (9 + d)) [tm1]⊢⁺ + (Kr (296 + n) (13 + b + c) (40 + d) 17 9) := by + have h := + (stepStar_stepPlus_trans (checkMid_sound n 0 b c d T6_cert1) (stepStar_stepPlus_trans + (checkMid_sound n 0 b c d T6_cert2) (stepStar_stepPlus_trans (checkMid_sound n 0 b c d + T6_cert3) (checkSym_sound n 0 b c d T6_cert_end)))) + have h1 : evalState n 0 b c d symT6_lhs = Kr n 3 (41 + b) (17 + c) (9 + d) := by + simp only [symT6_lhs, mkSymKr, krTailToks_eq, Kr, krRightList, evalState, evalQ, cfg_of, + List.append_assoc, evalHalf_segVar, evalHalf_segConst, evalHalf_map_bit_end, evalHalf, + evalVar, Nat.zero_add, listblank_append_assoc] + have h2 : evalState n 0 b c d symT6_rhs = Kr (296 + n) (13 + b + c) (40 + d) 17 9 := by + rw [show 13 + b + c = 13 + (b + c) from Nat.add_assoc 13 b c] + simp only [symT6_rhs, mkSymKr, krTailToks_eq, Kr, krRightList, evalState, evalQ, cfg_of, + List.append_assoc, evalHalf_segVar, evalHalf_segConst, evalHalf_map_bit_end, evalHalf, + evalVar, listblank_append_assoc] + rwa [h1, h2] at h + +def symT8_lhs : SymState := + mkSymKr ( + segVar (G ++ [1]) 0 .vn ++ + segConst [0] 4 ++ + segVar [0, 1, 1, 0] 44 .vb ++ + segConst [0, 0, 0, 0, 0, 0, 1] 17 ++ + segVar [0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0] 10 .vd ++ + krTailToks) + +def symT8_rhs : SymState := + mkSymKr ( + segVar (G ++ [1]) 270 .vn ++ + segVar [0] 7 .vb ++ + segConst [0, 1, 1, 0] 43 ++ + segVar [0, 0, 0, 0, 0, 0, 1] 33 .vd ++ + segConst [0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0] 9 ++ + krTailToks) + +def T8_mid1 : SymState := + mkSymKr (List.append gToks [SymTok.pow .w11 92 .vn, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.pow .w11 36 .vb, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 1 .v0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b1, SymTok.pow .w11 26 .v0, SymTok.b0, + SymTok.pow .w11 20 .vd, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 10 .v0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.pow .w11 2 .v0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 1 .v0, + SymTok.b0, SymTok.b1, SymTok.b1]) + +def T8_mid2 : SymState := + mkSymKr (List.append gToks [SymTok.pow .w11 176 .vn, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.pow .w11 22 .vb, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, + SymTok.b1, SymTok.b1, SymTok.pow .w11 33 .v0, SymTok.b0, SymTok.b0, SymTok.pow .w11 1 .v0, + SymTok.b0, SymTok.b0, SymTok.pow .w11 35 .vd, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.pow .w11 1 .v0, SymTok.b0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.pow .w11 6 .v0, SymTok.b0, SymTok.b1, SymTok.b1]) + +def T8_mid3 : SymState := + mkSymKr (List.append gToks [SymTok.b1, SymTok.b1, SymTok.pow .w11 261 .vn, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.pow .w11 6 .vb, SymTok.b0, + SymTok.b0, SymTok.pow .w11 45 .v0, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, + SymTok.pow .w11 32 .vd, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.pow .w11 2 .v0, + SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.pow .w11 2 .v0, SymTok.b0, SymTok.b0, + SymTok.b0, SymTok.b0, SymTok.b0, SymTok.b0, SymTok.pow .w11 9 .v0, SymTok.b0, SymTok.b1, + SymTok.b1, SymTok.b0, SymTok.b0, SymTok.b1, SymTok.b1, SymTok.b0, SymTok.b1, + SymTok.pow .w11 1 .v0]) + +set_option maxRecDepth 200000 in +theorem T8_cert1 : checkMid true 8149 symT8_lhs T8_mid1 = true := by + decide + +set_option maxRecDepth 200000 in +theorem T8_cert2 : checkMid true 8036 T8_mid1 T8_mid2 = true := by + decide + +set_option maxRecDepth 200000 in +theorem T8_cert3 : checkMid true 8494 T8_mid2 T8_mid3 = true := by + decide + +set_option maxRecDepth 200000 in +theorem T8_cert_end : checkSym true 226 T8_mid3 symT8_rhs = true := by + decide + +theorem T8 (n b d : Nat) : + (Kr n 4 (44 + b) 17 (10 + d)) [tm1]⊢⁺ + (Kr (270 + n) (7 + b) 43 (33 + d) 9) := by + have h := + (stepStar_stepPlus_trans (checkMid_sound n 0 b 0 d T8_cert1) (stepStar_stepPlus_trans + (checkMid_sound n 0 b 0 d T8_cert2) (stepStar_stepPlus_trans (checkMid_sound n 0 b 0 d + T8_cert3) (checkSym_sound n 0 b 0 d T8_cert_end)))) + have h1 : evalState n 0 b 0 d symT8_lhs = Kr n 4 (44 + b) 17 (10 + d) := by + simp only [symT8_lhs, mkSymKr, krTailToks_eq, Kr, krRightList, evalState, evalQ, cfg_of, + List.append_assoc, evalHalf_segVar, evalHalf_segConst, evalHalf_map_bit_end, evalHalf, + evalVar, Nat.zero_add, listblank_append_assoc] + have h2 : evalState n 0 b 0 d symT8_rhs = Kr (270 + n) (7 + b) 43 (33 + d) 9 := by + simp only [symT8_rhs, mkSymKr, krTailToks_eq, Kr, krRightList, evalState, evalQ, cfg_of, + List.append_assoc, evalHalf_segVar, evalHalf_segConst, evalHalf_map_bit_end, evalHalf, + evalVar, listblank_append_assoc] + rwa [h1, h2] at h + +theorem DC (N X : Nat) : (Ev N X) [tm1]⊢⁺ Ev (48 * X + 716 + N) (4 + X) := by + have h1 : (Ev N X) [tm1]⊢* + Kr (24 * (X + 6) + N) 2 (44 + 4 * X) 17 (10 + (2 * X + 11)) := by + have hs := S_iter (X + 6) N 1 (2 * X + 29) 14 8 + have hl : Kr N (4 * (X + 6) + 1 + 1) (3 + (2 * X + 29)) (3 + 14) (1 + 8) = Ev N X := + Kr_congr rfl (by omega) (by omega) rfl rfl + have hr : + Kr (24 * (X + 6) + N) (1 + 1) (2 * (X + 6) + 3 + (2 * X + 29)) (3 + 14) + (2 * (X + 6) + 1 + 8) = + Kr (24 * (X + 6) + N) 2 (44 + 4 * X) 17 (10 + (2 * X + 11)) := + Kr_congr rfl rfl (by omega) rfl (by omega) + rwa [hl, hr] at hs + have h2 : (Kr (24 * (X + 6) + N) 2 (44 + 4 * X) 17 (10 + (2 * X + 11))) [tm1]⊢⁺ + Kr (422 + 24 * X + N) (4 * X + 1 + 0) (3 + 38) (3 + (2 * X + 43)) (1 + 8) := by + have hte := TE (24 * (X + 6) + N) (4 * X) (2 * X + 11) + have hr : + Kr (278 + (24 * (X + 6) + N)) (1 + 4 * X) 41 (35 + (2 * X + 11)) 9 = + Kr (422 + 24 * X + N) (4 * X + 1 + 0) (3 + 38) (3 + (2 * X + 43)) (1 + 8) := + Kr_congr (by omega) (by omega) rfl (by omega) rfl + rwa [hr] at hte + have h3 : (Kr (422 + 24 * X + N) (4 * X + 1 + 0) (3 + 38) (3 + (2 * X + 43)) (1 + 8)) + [tm1]⊢* + Kr (422 + 48 * X + N) 1 (41 + 2 * X) (18 + (2 * X + 28)) (9 + 2 * X) := by + have hs := S_iter X (422 + 24 * X + N) 0 38 (2 * X + 43) 8 + have hr : + Kr (24 * X + (422 + 24 * X + N)) (1 + 0) (2 * X + 3 + 38) (3 + (2 * X + 43)) + (2 * X + 1 + 8) = + Kr (422 + 48 * X + N) 1 (41 + 2 * X) (18 + (2 * X + 28)) (9 + 2 * X) := + Kr_congr (by omega) rfl (by omega) (by omega) (by omega) + rwa [hr] at hs + have h4 : + (Kr (422 + 48 * X + N) 1 (41 + 2 * X) (18 + (2 * X + 28)) (9 + 2 * X)) [tm1]⊢⁺ + Ev (48 * X + 716 + N) (4 + X) := by + have hto := TO (422 + 48 * X + N) (2 * X) (2 * X + 28) (2 * X) + have hr : + Kr (294 + (422 + 48 * X + N)) (14 + 2 * X + (2 * X + 28)) (40 + 2 * X) 17 9 = + Ev (48 * X + 716 + N) (4 + X) := by + unfold Ev + exact Kr_congr (by omega) (by omega) (by omega) rfl rfl + rwa [hr] at hto + exact stepPlus_trans (stepStar_stepPlus_trans h1 h2) (stepStar_stepPlus_trans h3 h4) + +-- ============================================================================ + +def Inv (cfg : Cfg (Fin 2) (Fin 6)) : Prop := + ∃ N X : Nat, cfg = Ev N X + + + +end TM1Donor + +end BusyBeaver diff --git a/BusyBeaver/Calculi/WordCalculusA.lean b/BusyBeaver/Calculi/WordCalculusA.lean new file mode 100644 index 00000000..0d48faf3 --- /dev/null +++ b/BusyBeaver/Calculi/WordCalculusA.lean @@ -0,0 +1,1117 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Defs +import Mathlib.Data.List.Induction +import Mathlib.Tactic.Ring +import Mathlib.Tactic.Linarith + +/-! +# Word Calculus Engine A (`BusyBeaver.Calculi.WordCalculusA`) + +Formal word-rewriting calculus for structured tape transformations, +providing verified macro-step reductions and tile segment chains for family A. +-/ + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.WordCalculus +set_option quotPrecheck false +set_option maxRecDepth 4000000 + +variable {α β γ : Type*} +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +local notation "t" => ([1, 1, 0, 0] : BitWord) +local notation "d0" => ([0, 0] : BitWord) +local notation "d1" => ([1, 0] : BitWord) +theorem pow_two_pos (n : Nat) : 0 < 2 ^ n := by + induction n with + | zero => decide + | succ n ih => rw [Nat.pow_succ]; omega +theorem pow_two_one_add (n : Nat) : 2 ^ (1 + n) = 2 ^ n + 2 ^ n := by + rw [Nat.add_comm 1 n, Nat.pow_succ]; omega +theorem even_or_odd_mul_two (n : Nat) : (∃ a, n = a * 2) \/ (∃ a, n = 1 + a * 2) := by + rcases Nat.mod_two_eq_zero_or_one n with h | h + · left; exact ⟨n / 2, by omega⟩ + · right; exact ⟨n / 2, by omega⟩ +inductive Word where + | V + | K + | Q +deriving DecidableEq +open Word +local notation "WordList" => List Word +inductive WordPrefix : Bool -> WordList -> Prop where + | nil (e : Bool) : WordPrefix e [] + | T (e : Bool) {u : WordList} : WordPrefix true u -> WordPrefix e (V :: u) + | short0 {u : WordList} : WordPrefix true u -> WordPrefix true (K :: u) + | short1 {u : WordList} : WordPrefix false u -> WordPrefix true (Q :: u) + | pair0 (e : Bool) {u : WordList} : WordPrefix true u -> WordPrefix e (Q :: K :: u) + | pair1 (e : Bool) {u : WordList} : WordPrefix false u -> WordPrefix e (Q :: Q :: u) +theorem wordPrefix_true_of_false {u : WordList} (h : WordPrefix false u) : WordPrefix true u := by + cases h with + | nil _ => exact WordPrefix.nil true + | T _ hu => exact WordPrefix.T true hu + | pair0 _ hu => exact WordPrefix.pair0 true hu + | pair1 _ hu => exact WordPrefix.pair1 true hu +theorem wordPrefix_true_and_cases (u : WordList) : + WordPrefix true u /\ (WordPrefix false u \/ WordPrefix false (Q :: u)) := by + induction u with + | nil => exact ⟨WordPrefix.nil true, Or.inl (WordPrefix.nil false)⟩ + | cons w u ih => + rcases ih with ⟨hI, hJ⟩ + cases w with + | V => exact ⟨WordPrefix.T true hI, Or.inl (WordPrefix.T false hI)⟩ + | K => exact ⟨WordPrefix.short0 hI, Or.inr (WordPrefix.pair0 false hI)⟩ + | Q => + rcases hJ with hJ | hJ + · exact ⟨WordPrefix.short1 hJ, Or.inr (WordPrefix.pair1 false hJ)⟩ + · exact ⟨wordPrefix_true_of_false hJ, Or.inl hJ⟩ +inductive DigitVal : Nat -> Nat -> WordList -> Prop where + | nil : DigitVal 0 0 [] + | zero {A H : Nat} {u : WordList} : DigitVal A H u -> DigitVal (A * 2) (1 + H) (K :: u) + | one {A H : Nat} {u : WordList} : DigitVal A H u -> DigitVal (1 + A * 2) (1 + H) (Q :: u) +theorem digitVal_not_cons_V {A H : Nat} {u : WordList} (h : DigitVal A H (V :: u)) : False := by + cases h +theorem digitVal_cons_K_inv {A H : Nat} {u : WordList} (h : DigitVal A H (K :: u)) : + ∃ A' H', DigitVal A' H' u /\ A = A' * 2 /\ H = 1 + H' := by + cases h with + | zero hD => exact ⟨_, _, hD, rfl, rfl⟩ +theorem digitVal_cons_Q_inv {A H : Nat} {u : WordList} (h : DigitVal A H (Q :: u)) : + ∃ A' H', DigitVal A' H' u /\ A = 1 + A' * 2 /\ H = 1 + H' := by + cases h with + | one hD => exact ⟨_, _, hD, rfl, rfl⟩ +def hasQKSubword : WordList -> Bool + | Q :: K :: _ => true + | _ :: v => hasQKSubword v + | [] => false +def notEndsWithQ : WordList -> Bool + | [] => true + | [Q] => false + | _ :: v => notEndsWithQ v +theorem notEndsWithQ_of_cons (w : Word) (u : WordList) (h : notEndsWithQ (w :: u) = true) : + notEndsWithQ u = true := by + cases u with + | nil => rfl + | cons x xs => cases w <;> exact h +def SplitCond (p q : WordList) : Prop := + notEndsWithQ p = true \/ ∃ r, q = V :: r +theorem splitCond_of_cons (w : Word) (p q : WordList) (h : SplitCond (w :: p) q) : + SplitCond p q := by + rcases h with h | h + · left; exact notEndsWithQ_of_cons w p h + · right; exact h +theorem notEndsWithQ_append_singleton (u : WordList) (w : Word) : + notEndsWithQ (u ++ [w]) = notEndsWithQ [w] := by + induction u with + | nil => rfl + | cons a u ih => + cases u with + | nil => cases a <;> rfl + | cons b u' => cases a <;> exact ih +theorem notEndsWithQ_replicate_V (p : Nat) : notEndsWithQ (List.replicate p V) = true := by + induction p with + | zero => rfl + | succ p ih => + cases p with + | zero => rfl + | succ p' => exact ih +theorem replicate_succ_append (w : Word) (n : Nat) : + List.replicate (n + 1) w = List.replicate n w ++ [w] := by + induction n with + | zero => rfl + | succ n ih => + conv_lhs => rw [List.replicate_succ, ih] + rfl +theorem split_trailing_Q (u : WordList) : + ∃ p n, u = p ++ List.replicate n Q /\ notEndsWithQ p = true := by + induction u using List.reverseRecOn with + | nil => exact ⟨[], 0, rfl, rfl⟩ + | append_singleton u x ih => + rcases ih with ⟨p, n, rfl, hP⟩ + cases x with + | V => + exact ⟨(p ++ List.replicate n Q) ++ [V], 0, by simp, + by rw [notEndsWithQ_append_singleton]; rfl⟩ + | K => + exact ⟨(p ++ List.replicate n Q) ++ [K], 0, by simp, + by rw [notEndsWithQ_append_singleton]; rfl⟩ + | Q => + refine ⟨p, n + 1, ?_, hP⟩ + rw [replicate_succ_append, List.append_assoc] +def evalWords : WordList -> HalfTape -> HalfTape + | [], r => r + | V :: u, r => t +> evalWords u r + | K :: u, r => d0 +> evalWords u r + | Q :: u, r => d1 +> evalWords u r +theorem evalWords_append (u v : WordList) (r : HalfTape) : + evalWords (u ++ v) r = evalWords u (evalWords v r) := by + induction u with + | nil => rfl + | cons a u ih => cases a <;> simp [evalWords, ih] +def wordsToBits : WordList -> BitWord + | [] => [] + | V :: u => t ++ wordsToBits u + | K :: u => d0 ++ wordsToBits u + | Q :: u => d1 ++ wordsToBits u +theorem wordsToBits_append_tape (u : WordList) (r : HalfTape) : + wordsToBits u +> r = evalWords u r := by + induction u with + | nil => rfl + | cons a u ih => + cases a <;> (dsimp [wordsToBits, evalWords]; rw [ih]) +theorem wordsToBits_append (u v : WordList) : + wordsToBits (u ++ v) = wordsToBits u ++ wordsToBits v := by + induction u with + | nil => rfl + | cons a u ih => + cases a <;> (dsimp [wordsToBits]; rw [ih]) +theorem exists_digitVal_of_lt_pow (H : Nat) : ∀ A, A < 2 ^ H -> ∃ u, DigitVal A H u := by + induction H with + | zero => + intro A hA + have h0 : A = 0 := by simpa using hA + subst h0; exact ⟨[], DigitVal.nil⟩ + | succ H ih => + intro A hA + have hpow : 2 ^ (H + 1) = 2 ^ H * 2 := Nat.pow_succ 2 H + have h1H : H + 1 = 1 + H := by omega + rcases even_or_odd_mul_two A with ⟨a, rfl⟩ | ⟨a, rfl⟩ + · rcases ih a (by omega) with ⟨u, hI⟩ + rw [h1H]; exact ⟨K :: u, DigitVal.zero hI⟩ + · rcases ih a (by omega) with ⟨u, hI⟩ + rw [h1H]; exact ⟨Q :: u, DigitVal.one hI⟩ +theorem digitVal_append {A H : Nat} {u : WordList} (h1 : DigitVal A H u) : + ∀ {B J : Nat} {v : WordList}, DigitVal B J v -> DigitVal (A + B * 2 ^ H) (H + J) (u ++ v) := by + induction h1 with + | nil => + intro B J v h2 + simpa using h2 + | @zero A H u _ ih => + intro B J v h2 + have h3 := DigitVal.zero (ih h2) + have heq1 : (A + B * 2 ^ H) * 2 = A * 2 + B * 2 ^ (1 + H) := by + rw [pow_two_one_add]; ring + have heq2 : 1 + (H + J) = (1 + H) + J := by omega + rwa [heq1, heq2] at h3 + | @one A H u _ ih => + intro B J v h2 + have h3 := DigitVal.one (ih h2) + have heq1 : 1 + (A + B * 2 ^ H) * 2 = (1 + A * 2) + B * 2 ^ (1 + H) := by + rw [pow_two_one_add]; ring + have heq2 : 1 + (H + J) = (1 + H) + J := by omega + rwa [heq1, heq2] at h3 +theorem digitVal_replicate_Q (n : Nat) : DigitVal (2 ^ n - 1) n (List.replicate n Q) := by + induction n with + | zero => exact DigitVal.nil + | succ n ih => + have hpos := pow_two_pos n + have h1 := DigitVal.one ih + have heq1 : 1 + (2 ^ n - 1) * 2 = 2 ^ (n + 1) - 1 := by + rw [Nat.pow_succ]; omega + have heq2 : 1 + n = n + 1 := by omega + simpa [List.replicate, heq1, heq2] using h1 +theorem lt_pow_of_digitVal {A H : Nat} {u : WordList} (h : DigitVal A H u) : A < 2 ^ H := by + induction h with + | nil => decide + | @zero A H u _ ih => rw [pow_two_one_add]; omega + | @one A H u _ ih => rw [pow_two_one_add]; omega +theorem digitVal_unique_aux {A1 H1 : Nat} {u : WordList} (h1 : DigitVal A1 H1 u) : + ∀ {A2 H2 : Nat} {v : WordList}, DigitVal A2 H2 v -> A1 = A2 -> H1 = H2 -> u = v := by + induction h1 with + | nil => + intro A2 H2 v h2 hA hH + cases h2 with + | nil => rfl + | zero _ => omega + | one _ => omega + | @zero A1 H1 u _ ih => + intro A2 H2 v h2 hA hH + cases h2 with + | nil => omega + | @zero A2' H2' v' hD => + rw [ih hD (by omega) (by omega)] + | one _ => omega + | @one A1 H1 u _ ih => + intro A2 H2 v h2 hA hH + cases h2 with + | nil => omega + | zero _ => omega + | @one A2' H2' v' hD => + rw [ih hD (by omega) (by omega)] +theorem digitVal_unique {A H : Nat} {u v : WordList} (h1 : DigitVal A H u) (h2 : DigitVal A H v) : + u = v := + digitVal_unique_aux h1 h2 rfl rfl +def wordMass : WordList -> Rat + | [] => 0 + | V :: v => wordMass v * (1 / 2) + | _ :: v => 1 + wordMass v * 2 +def wordMassK : WordList -> Rat + | [] => 0 + | V :: v => wordMassK v * (1 / 2) + | K :: v => 1 + wordMassK v * 2 + | Q :: v => wordMassK v * 2 +def wordMassQ : WordList -> Rat + | [] => 0 + | V :: v => wordMassQ v * (1 / 2) + | K :: v => wordMassQ v * 2 + | Q :: v => 1 + wordMassQ v * 2 +def wordScale : WordList -> Rat + | [] => 1 + | V :: v => wordScale v * (1 / 2) + | _ :: v => wordScale v * 2 +theorem wordMass_nonneg (u : WordList) : 0 <= wordMass u /\ 0 <= wordMassK u /\ + 0 <= wordMassQ u := by + induction u with + | nil => simp [wordMass, wordMassK, wordMassQ] + | cons a u ih => + cases a <;> + (dsimp [wordMass, wordMassK, wordMassQ]; refine ⟨by linarith, by linarith, by linarith⟩) +theorem wordMass_eq_add (u : WordList) : wordMass u = wordMassK u + wordMassQ u := by + induction u with + | nil => simp [wordMass, wordMassK, wordMassQ] + | cons a u ih => cases a <;> (dsimp [wordMass, wordMassK, wordMassQ]; rw [ih]; ring) +theorem wordScale_pos (u : WordList) : 0 < wordScale u := by + induction u with + | nil => simp [wordScale] + | cons a u ih => cases a <;> (dsimp [wordScale]; linarith) +theorem wordMass_append (u v : WordList) : wordMass (u ++ + v) = wordMass u + wordScale u * wordMass v := by + induction u with + | nil => simp [wordMass, wordScale] + | cons a u ih => cases a <;> (dsimp [wordMass, wordScale]; rw [ih]; ring) +theorem wordMassK_append (u v : WordList) : wordMassK (u ++ + v) = wordMassK u + wordScale u * wordMassK v := by + induction u with + | nil => simp [wordMassK, wordScale] + | cons a u ih => cases a <;> (dsimp [wordMassK, wordScale]; rw [ih]; ring) +theorem wordMassQ_append (u v : WordList) : wordMassQ (u ++ + v) = wordMassQ u + wordScale u * wordMassQ v := by + induction u with + | nil => simp [wordMassQ, wordScale] + | cons a u ih => cases a <;> (dsimp [wordMassQ, wordScale]; rw [ih]; ring) +theorem wordScale_append (u v : WordList) : wordScale (u ++ v) = wordScale u * wordScale v := by + induction u with + | nil => simp [wordScale] + | cons a u ih => cases a <;> (dsimp [wordScale]; rw [ih]; ring) +theorem digitVal_scale_and_mass {A H : Nat} {u : WordList} (h : DigitVal A H u) : + wordScale u = ((2 ^ H : Nat) : Rat) /\ wordMass u + 1 = ((2 ^ H : Nat) : Rat) /\ + wordMassQ u = (A : Rat) := by + induction h with + | nil => simp [wordScale, wordMass, wordMassQ] + | @zero A H u _ ih => + rw [pow_two_one_add H]; dsimp [wordScale, wordMass, wordMassQ] + push_cast at ih ⊢; refine ⟨by linarith, by linarith, by linarith⟩ + | @one A H u _ ih => + rw [pow_two_one_add H]; dsimp [wordScale, wordMass, wordMassQ] + push_cast at ih ⊢; refine ⟨by linarith, by linarith, by linarith⟩ +theorem digitVal_wordMassK_eq {A H : Nat} {u : WordList} (h : DigitVal A H u) : + wordMassK u + (A : Rat) + 1 = ((2 ^ H : Nat) : Rat) := by + have hd := digitVal_scale_and_mass h + have hm := wordMass_eq_add u + linarith +inductive Scan : Nat -> WordList -> Nat -> WordList -> Rat -> Prop where + | nil (k : Nat) : Scan k [] k [] 0 + | T {n : Nat} {u : WordList} {k : Nat} {v : WordList} {l : Rat} : + Scan ((1 + n) * 2) u k v l -> Scan (1 + n) (V :: u) k (V :: v) (l * (1 / 2)) + | pair0 {n : Nat} {u : WordList} {k : Nat} {v : WordList} {l : Rat} : + Scan (n * 2) u k v l -> Scan (1 + n) (Q :: K :: u) k (V :: v) ((1 + l) * (1 / 2)) + | pair1 {n : Nat} {u : WordList} {k : Nat} {v : WordList} {l : Rat} : + Scan (1 + n * 2) u k v l -> Scan (1 + n) (Q :: Q :: u) k (V :: v) ((1 / 4) + l * (1 / 2)) + | short00 {n : Nat} {u : WordList} {k : Nat} {v : WordList} {l : Rat} : + Scan (n * 2) u k v l -> Scan (2 + n * 4) (K :: u) k (K :: v) (1 + l * 2) + | short01 {n : Nat} {u : WordList} {k : Nat} {v : WordList} {l : Rat} : + Scan (1 + n * 2) u k v l -> Scan (2 + n * 4) (Q :: u) k (K :: v) (l * 2) + | short10 {n : Nat} {u : WordList} {k : Nat} {v : WordList} {l : Rat} : + Scan (n * 2) u k v l -> Scan (4 + n * 4) (K :: u) k (Q :: v) (1 + l * 2) + | short11 {n : Nat} {u : WordList} {k : Nat} {v : WordList} {l : Rat} : + Scan (1 + n * 2) u k v l -> Scan (4 + n * 4) (Q :: u) k (Q :: v) (l * 2) +theorem scan_mass_bounds {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) : + 0 <= l /\ wordMass v <= wordMass u /\ wordMass v + l <= wordMass u + wordMassK u := by + induction h with + | nil _ => simp [wordMass, wordMassK] + | T _ ih => + dsimp [wordMass, wordMassK]; refine ⟨by linarith, by linarith, by linarith⟩ + | @pair0 n u k v l _ ih => + have hw := wordMass_nonneg v + dsimp [wordMass, wordMassK]; refine ⟨by linarith, by linarith, by linarith⟩ + | @pair1 n u k v l _ ih => + have hw := wordMass_nonneg v + dsimp [wordMass, wordMassK]; refine ⟨by linarith, by linarith, by linarith⟩ + | short00 _ ih => + dsimp [wordMass, wordMassK]; refine ⟨by linarith, by linarith, by linarith⟩ + | short01 _ ih => + dsimp [wordMass, wordMassK]; refine ⟨by linarith, by linarith, by linarith⟩ + | short10 _ ih => + dsimp [wordMass, wordMassK]; refine ⟨by linarith, by linarith, by linarith⟩ + | short11 _ ih => + dsimp [wordMass, wordMassK]; refine ⟨by linarith, by linarith, by linarith⟩ +theorem exists_scan_of_wordPrefix {e : Bool} {u : WordList} (hI : WordPrefix e u) : + ∀ (k : Nat), (e = true -> ∃ n, k = n * 2) -> + (wordMass u + wordMassK u) * 2 < (k : Rat) -> + ∃ b v l, Scan k u b v l /\ 0 < b := by + induction hI with + | nil e => + intro k _ hk + dsimp [wordMass, wordMassK] at hk + have hk_pos : (0 : Rat) < (k : Rat) := by linarith + have hk_nat : 0 < k := Nat.cast_pos.mp hk_pos + exact ⟨k, [], 0, Scan.nil k, hk_nat⟩ + | @T e u _ ih => + intro k _ hk + have hw := wordMass_nonneg u + dsimp [wordMass, wordMassK] at hk + cases k with + | zero => push_cast at hk; linarith + | succ k => + have h1k : k + 1 = 1 + k := by omega + rw [h1k] at hk ⊢ + rcases ih ((1 + k) * 2) (fun _ => ⟨1 + k, rfl⟩) + (by push_cast at hk ⊢; linarith) with ⟨b, v, l, hS, hB⟩ + exact ⟨b, V :: v, l * (1 / 2), Scan.T hS, hB⟩ + | @short0 u _ ih => + intro k hEk hk + have hw := wordMass_nonneg u + dsimp [wordMass, wordMassK] at hk + rcases hEk rfl with ⟨n, rfl⟩ + rcases even_or_odd_mul_two n with ⟨a, rfl⟩ | ⟨a, rfl⟩ + · cases a with + | zero => push_cast at hk; linarith + | succ a => + rcases ih (a * 2) (fun _ => ⟨a, rfl⟩) + (by push_cast at hk ⊢; linarith) with ⟨b, v, l, hS, hB⟩ + refine ⟨b, Q :: v, 1 + l * 2, ?_, hB⟩ + have heq : (a + 1) * 2 * 2 = 4 + a * 4 := by omega + rw [heq]; exact Scan.short10 hS + · rcases ih (a * 2) (fun _ => ⟨a, rfl⟩) (by push_cast at hk ⊢; linarith) with ⟨b, v, l, hS, hB⟩ + refine ⟨b, K :: v, 1 + l * 2, ?_, hB⟩ + have heq : (1 + a * 2) * 2 = 2 + a * 4 := by omega + rw [heq]; exact Scan.short00 hS + | @short1 u _ ih => + intro k hEk hk + have hw := wordMass_nonneg u + dsimp [wordMass, wordMassK] at hk + rcases hEk rfl with ⟨n, rfl⟩ + rcases even_or_odd_mul_two n with ⟨a, rfl⟩ | ⟨a, rfl⟩ + · cases a with + | zero => push_cast at hk; linarith + | succ a => + rcases ih (1 + a * 2) (fun h => by contradiction) + (by push_cast at hk ⊢; linarith) with ⟨b, v, l, hS, hB⟩ + refine ⟨b, Q :: v, l * 2, ?_, hB⟩ + have heq : (a + 1) * 2 * 2 = 4 + a * 4 := by omega + rw [heq]; exact Scan.short11 hS + · rcases ih (1 + a * 2) (fun h => by contradiction) + (by push_cast at hk ⊢; linarith) with ⟨b, v, l, hS, hB⟩ + refine ⟨b, K :: v, l * 2, ?_, hB⟩ + have heq : (1 + a * 2) * 2 = 2 + a * 4 := by omega + rw [heq]; exact Scan.short01 hS + | @pair0 e u _ ih => + intro k _ hk + have hw := wordMass_nonneg u + dsimp [wordMass, wordMassK] at hk + cases k with + | zero => push_cast at hk; linarith + | succ k => + have h1k : k + 1 = 1 + k := by omega + rw [h1k] at hk ⊢ + rcases ih (k * 2) (fun _ => ⟨k, rfl⟩) (by push_cast at hk ⊢; linarith) with ⟨b, v, l, hS, hB⟩ + exact ⟨b, V :: v, (1 + l) * (1 / 2), Scan.pair0 hS, hB⟩ + | @pair1 e u _ ih => + intro k _ hk + have hw := wordMass_nonneg u + dsimp [wordMass, wordMassK] at hk + cases k with + | zero => push_cast at hk; linarith + | succ k => + have h1k : k + 1 = 1 + k := by omega + rw [h1k] at hk ⊢ + rcases ih (1 + k * 2) (fun h => by contradiction) + (by push_cast at hk ⊢; linarith) with ⟨b, v, l, hS, hB⟩ + exact ⟨b, V :: v, (1 / 4) + l * (1 / 2), Scan.pair1 hS, hB⟩ +theorem exists_scan_of_mass_lt (u : WordList) (k : Nat) (h : (wordMass u + wordMassK u) * 2 < + ((k * 2 : Nat) : Rat)) : + ∃ b v l, Scan (k * 2) u b v l /\ 0 < b := + exists_scan_of_wordPrefix (wordPrefix_true_and_cases u).1 (k * 2) (fun _ => ⟨k, rfl⟩) h +theorem not_scan_odd_cons_K (n : Nat) (u : WordList) (b : Nat) (v : WordList) (l : Rat) : + ¬ Scan (1 + n * 2) (K :: u) b v l := by + intro h; generalize ha : 1 + n * 2 = a at h; cases h <;> omega +theorem not_scan_odd_even_Q_K (r : Nat) : + ∀ (n b : Nat) (v : WordList) (l : Rat), + ¬ Scan (1 + n * 2) (List.replicate (r * 2) Q ++ [K]) b v l := by + induction r with + | zero => + intro n b v l hI + exact not_scan_odd_cons_K n [] b v l hI + | succ r ih => + intro n b v l hI + have heq : (r + 1) * 2 = r * 2 + 2 := by omega + rw [heq] at hI + change Scan (1 + n * 2) (Q :: Q :: (List.replicate (r * 2) Q ++ [K])) b v l at hI + generalize ha : 1 + n * 2 = a at hI + cases hI with + | @pair1 m _ _ _ _ hJ => + exact ih m _ _ _ hJ + | short01 _ => omega + | short11 _ => omega +theorem scan_odd_Q_K_inv (r : Nat) : + ∀ (a b : Nat) (v : WordList) (l : Rat), + Scan a (List.replicate (1 + r * 2) Q ++ [K]) b v l -> + v = List.replicate (1 + r) V /\ b = (a - 1) * 2 ^ (1 + r) /\ l = 1 / 2 := by + induction r with + | zero => + intro a b v l hI + change Scan a [Q, K] b v l at hI + cases hI with + | @pair0 m _ _ _ _ hJ => + generalize hk : m * 2 = k at hJ + cases hJ + exact ⟨rfl, by simp; omega, by ring⟩ + | short01 hJ => exact False.elim (not_scan_odd_cons_K _ [] _ _ _ hJ) + | short11 hJ => exact False.elim (not_scan_odd_cons_K _ [] _ _ _ hJ) + | succ r ih => + intro a b v l hI + have heq : 1 + (r + 1) * 2 = (1 + r * 2) + 2 := by omega + rw [heq] at hI + change Scan a (Q :: Q :: (List.replicate (1 + r * 2) Q ++ [K])) b v l at hI + cases hI with + | @pair1 n _ _ v0 l0 hJ => + rcases ih (1 + n * 2) b v0 l0 hJ with ⟨rfl, rfl, rfl⟩ + refine ⟨rfl, ?_, by ring⟩ + have heq2 : 1 + (r + 1) = (1 + r) + 1 := by omega + rw [heq2, Nat.pow_succ]; simp; ring + | @short01 n _ _ _ _ hJ => + have heq2 : (1 + r * 2) + 1 = (r + 1) * 2 := by omega + change Scan (1 + n * 2) (List.replicate ((1 + r * 2) + 1) Q ++ [K]) _ _ _ at hJ + rw [heq2] at hJ + exact False.elim (not_scan_odd_even_Q_K (r + 1) n _ _ _ hJ) + | @short11 n _ _ _ _ hJ => + have heq2 : (1 + r * 2) + 1 = (r + 1) * 2 := by omega + change Scan (1 + n * 2) (List.replicate ((1 + r * 2) + 1) Q ++ [K]) _ _ _ at hJ + rw [heq2] at hJ + exact False.elim (not_scan_odd_even_Q_K (r + 1) n _ _ _ hJ) +theorem scan_even_Q_K_inv (r a b : Nat) (v : WordList) (l : Rat) + (hI : Scan a (List.replicate (2 + r * 2) Q ++ [K]) b v l) : + ∃ d n, v = d :: List.replicate (1 + r) V /\ b = n * 2 ^ (2 + r) /\ l = 1 := by + have heq0 : 2 + r * 2 = (r * 2) + 2 := by omega + rw [heq0] at hI + change Scan a (Q :: Q :: (List.replicate (r * 2) Q ++ [K])) b v l at hI + cases hI with + | @pair1 n _ _ _ _ hJ => + exact False.elim (not_scan_odd_even_Q_K r n _ _ _ hJ) + | @short01 n _ _ v0 l0 hJ => + have heq1 : 1 + r * 2 = (r * 2) + 1 := by omega + have hJ' : Scan (1 + n * 2) (List.replicate (1 + r * 2) Q ++ [K]) b v0 l0 := by + rw [heq1]; exact hJ + rcases scan_odd_Q_K_inv r (1 + n * 2) b v0 l0 hJ' with ⟨rfl, rfl, rfl⟩ + refine ⟨K, n, rfl, ?_, by ring⟩ + have heq : 2 + r = (1 + r) + 1 := by omega + rw [heq, Nat.pow_succ]; simp; ring + | @short11 n _ _ v0 l0 hJ => + have heq1 : 1 + r * 2 = (r * 2) + 1 := by omega + have hJ' : Scan (1 + n * 2) (List.replicate (1 + r * 2) Q ++ [K]) b v0 l0 := by + rw [heq1]; exact hJ + rcases scan_odd_Q_K_inv r (1 + n * 2) b v0 l0 hJ' with ⟨rfl, rfl, rfl⟩ + refine ⟨Q, n, rfl, ?_, by ring⟩ + have heq : 2 + r = (1 + r) + 1 := by omega + rw [heq, Nat.pow_succ]; simp; ring +theorem scan_add_Q_K_inv (n r a b : Nat) (v : WordList) (l : Rat) + (hI : Scan a (List.replicate (1 + r * 2 + n) Q ++ [K]) b v l) : + ∃ w k, v = w ++ List.replicate (1 + r) V /\ b = k * 2 ^ (1 + r) := by + rcases even_or_odd_mul_two n with ⟨a0, rfl⟩ | ⟨a0, rfl⟩ + · have heq : 1 + r * 2 + a0 * 2 = 1 + (r + a0) * 2 := by omega + rw [heq] at hI + rcases scan_odd_Q_K_inv (r + a0) a b v l hI with ⟨rfl, rfl, _⟩ + refine ⟨List.replicate a0 V, (a - 1) * 2 ^ a0, ?_, ?_⟩ + · have heq2 : 1 + (r + a0) = a0 + (1 + r) := by omega + rw [heq2, List.replicate_add] + · have heq2 : 1 + (r + a0) = a0 + (1 + r) := by omega + rw [heq2, Nat.pow_add]; ring + · have heq : 1 + r * 2 + (1 + a0 * 2) = 2 + (r + a0) * 2 := by omega + rw [heq] at hI + rcases scan_even_Q_K_inv (r + a0) a b v l hI with ⟨d, k, rfl, rfl, _⟩ + refine ⟨d :: List.replicate a0 V, k * 2 ^ (1 + a0), ?_, ?_⟩ + · have heq2 : 1 + (r + a0) = a0 + (1 + r) := by omega + rw [heq2, List.replicate_add]; rfl + · have heq2 : 2 + (r + a0) = (1 + a0) + (1 + r) := by omega + rw [heq2, Nat.pow_add]; ring +inductive TailDefect : WordList -> Rat -> Prop where + | tail_end : TailDefect [K] 0 + | tail_zero {u : WordList} {z : Rat} : TailDefect u z -> TailDefect (K :: u) (1 + z * 2) + | tail_one {u : WordList} {z : Rat} : TailDefect u z -> TailDefect (Q :: u) (z * 2) +theorem tailDefect_nonneg {u : WordList} {z : Rat} (h : TailDefect u z) : 0 <= z := by + induction h with + | tail_end => linarith + | tail_zero _ ih => linarith + | tail_one _ ih => linarith +theorem tailDefect_cons_K_inv {u : WordList} {z : Rat} (h : TailDefect (K :: u) z) : + (u = [] /\ z = 0) \/ ∃ y, TailDefect u y /\ z = 1 + y * 2 := by + cases h with + | tail_end => left; exact ⟨rfl, rfl⟩ + | tail_zero hJ => right; exact ⟨_, hJ, rfl⟩ +theorem tailDefect_cons_Q_inv {u : WordList} {z : Rat} (h : TailDefect (Q :: u) z) : + ∃ y, TailDefect u y /\ z = y * 2 := by + cases h with + | tail_one hJ => exact ⟨_, hJ, rfl⟩ +theorem tailDefect_append_K_of_digitVal {A H : Nat} {u : WordList} (h : DigitVal A H u) : + TailDefect (u ++ [K]) (wordMassK u) := by + induction h with + | nil => exact TailDefect.tail_end + | zero _ ih => exact TailDefect.tail_zero ih + | one _ ih => exact TailDefect.tail_one ih +theorem exists_digitVal_of_tailDefect {u : WordList} {z : Rat} (h : TailDefect u z) : + ∃ A H, DigitVal A H u := by + induction h with + | tail_end => exact ⟨0, 1, DigitVal.zero DigitVal.nil⟩ + | tail_zero _ ih => + rcases ih with ⟨A, H, hD⟩ + exact ⟨A * 2, 1 + H, DigitVal.zero hD⟩ + | tail_one _ ih => + rcases ih with ⟨A, H, hD⟩ + exact ⟨1 + A * 2, 1 + H, DigitVal.one hD⟩ +theorem scan_tailDefect_bound {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) : + ∀ {z : Rat}, TailDefect u z -> + wordMass v <= 1 + z * 2 /\ l <= 1 + z * 2 /\ + (∀ n, a = 1 + n * 2 -> wordMass v <= z * 2 /\ l <= (1 / 2) + z * 2) := by + induction h with + | nil _ => intro z hZ; cases hZ + | T _ _ => intro z hZ; cases hZ + | @pair0 m _ _ _ _ hI ih => + intro z hZ + rcases tailDefect_cons_Q_inv hZ with ⟨y, hJ, rfl⟩ + rcases tailDefect_cons_K_inv hJ with ⟨rfl, rfl⟩ | ⟨x, hJ', rfl⟩ + · generalize hk : m * 2 = k at hI + cases hI + dsimp [wordMass]; refine ⟨by linarith, by linarith, fun _ _ => ⟨by linarith, by linarith⟩⟩ + · rcases ih hJ' with ⟨hM, hL, _⟩ + have hx := tailDefect_nonneg hJ' + dsimp [wordMass]; refine ⟨by linarith, by linarith, fun _ _ => ⟨by linarith, by linarith⟩⟩ + | @pair1 m _ _ _ _ hI ih => + intro z hZ + rcases tailDefect_cons_Q_inv hZ with ⟨y, hJ, rfl⟩ + rcases tailDefect_cons_Q_inv hJ with ⟨x, hJ', rfl⟩ + rcases (ih hJ').2.2 m rfl with ⟨hM, hL⟩ + have hx := tailDefect_nonneg hJ' + dsimp [wordMass]; refine ⟨by linarith, by linarith, fun _ _ => ⟨by linarith, by linarith⟩⟩ + | @short00 m _ _ _ _ hI ih => + intro z hZ + rcases tailDefect_cons_K_inv hZ with ⟨rfl, rfl⟩ | ⟨x, hJ, rfl⟩ + · generalize hk : m * 2 = k at hI + cases hI + dsimp [wordMass]; refine ⟨by linarith, by linarith, fun _ h => by omega⟩ + · rcases ih hJ with ⟨hM, hL, _⟩ + dsimp [wordMass]; refine ⟨by linarith, by linarith, fun _ h => by omega⟩ + | @short01 m _ _ _ _ _ ih => + intro z hZ + rcases tailDefect_cons_Q_inv hZ with ⟨x, hJ, rfl⟩ + rcases (ih hJ).2.2 m rfl with ⟨hM, hL⟩ + dsimp [wordMass]; refine ⟨by linarith, by linarith, fun _ h => by omega⟩ + | @short10 m _ _ _ _ hI ih => + intro z hZ + rcases tailDefect_cons_K_inv hZ with ⟨rfl, rfl⟩ | ⟨x, hJ, rfl⟩ + · generalize hk : m * 2 = k at hI + cases hI + dsimp [wordMass]; refine ⟨by linarith, by linarith, fun _ h => by omega⟩ + · rcases ih hJ with ⟨hM, hL, _⟩ + dsimp [wordMass]; refine ⟨by linarith, by linarith, fun _ h => by omega⟩ + | @short11 m _ _ _ _ _ ih => + intro z hZ + rcases tailDefect_cons_Q_inv hZ with ⟨x, hJ, rfl⟩ + rcases (ih hJ).2.2 m rfl with ⟨hM, hL⟩ + dsimp [wordMass]; refine ⟨by linarith, by linarith, fun _ h => by omega⟩ +theorem scan_append {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h1 : Scan a u b v l) : + ∀ {w : WordList} {c : Nat} {x : WordList} {m : Rat}, + Scan b w c x m -> ∃ p, Scan a (u ++ w) c (v ++ x) p /\ p = l + wordScale v * m := by + induction h1 with + | nil _ => + intro w c x m h2 + exact ⟨m, h2, by simp [wordScale]⟩ + | T _ ih => + intro w c x m h2 + rcases ih h2 with ⟨p, hK, hE⟩ + exact ⟨p * (1 / 2), Scan.T hK, by dsimp [wordScale]; rw [hE]; ring⟩ + | pair0 _ ih => + intro w c x m h2 + rcases ih h2 with ⟨p, hK, hE⟩ + exact ⟨(1 + p) * (1 / 2), Scan.pair0 hK, by dsimp [wordScale]; rw [hE]; ring⟩ + | pair1 _ ih => + intro w c x m h2 + rcases ih h2 with ⟨p, hK, hE⟩ + exact ⟨(1 / 4) + p * (1 / 2), Scan.pair1 hK, by dsimp [wordScale]; rw [hE]; ring⟩ + | short00 _ ih => + intro w c x m h2 + rcases ih h2 with ⟨p, hK, hE⟩ + exact ⟨1 + p * 2, Scan.short00 hK, by dsimp [wordScale]; rw [hE]; ring⟩ + | short01 _ ih => + intro w c x m h2 + rcases ih h2 with ⟨p, hK, hE⟩ + exact ⟨p * 2, Scan.short01 hK, by dsimp [wordScale]; rw [hE]; ring⟩ + | short10 _ ih => + intro w c x m h2 + rcases ih h2 with ⟨p, hK, hE⟩ + exact ⟨1 + p * 2, Scan.short10 hK, by dsimp [wordScale]; rw [hE]; ring⟩ + | short11 _ ih => + intro w c x m h2 + rcases ih h2 with ⟨p, hK, hE⟩ + exact ⟨p * 2, Scan.short11 hK, by dsimp [wordScale]; rw [hE]; ring⟩ +theorem scan_split_of_splitCond {a : Nat} {u : WordList} {c : Nat} {z : WordList} {l : Rat} + (h : Scan a u c z l) : + ∀ (p q : WordList), u = p ++ q -> SplitCond p q -> + ∃ b v w x y, Scan a p b v x /\ Scan b q c w y /\ z = v ++ w /\ l = x + wordScale v * y := by + induction h with + | nil k => + intro p q hE _ + cases p with + | nil => + dsimp at hE; subst hE + exact ⟨k, [], [], 0, 0, Scan.nil k, Scan.nil k, rfl, by simp [wordScale]⟩ + | cons s p => simp at hE + | T hI ih => + intro p q hE hP + cases p with + | nil => + dsimp at hE; subst hE + exact ⟨_, [], _, 0, _, Scan.nil _, Scan.T hI, rfl, by simp [wordScale]⟩ + | cons s p => + simp only [List.cons_append, List.cons.injEq] at hE; rcases hE with ⟨rfl, hE⟩ + rcases ih p q hE (splitCond_of_cons V p q hP) with ⟨b, v0, w, x, y, hJ, hK, rfl, hL⟩ + exact ⟨b, V :: v0, w, x * (1 / 2), y, Scan.T hJ, hK, rfl, + by dsimp [wordScale]; rw [hL]; ring⟩ + | pair0 hI ih => + intro p q hE hP + cases p with + | nil => + dsimp at hE; subst hE + exact ⟨_, [], _, 0, _, Scan.nil _, Scan.pair0 hI, rfl, by simp [wordScale]⟩ + | cons s p => + simp only [List.cons_append, List.cons.injEq] at hE; rcases hE with ⟨rfl, hE⟩ + cases p with + | nil => + dsimp at hE; subst hE + rcases hP with hP | ⟨r, hP⟩ <;> nomatch hP + | cons s2 p => + simp only [List.cons_append, List.cons.injEq] at hE; rcases hE with ⟨rfl, hE⟩ + have hP' := splitCond_of_cons K p q (splitCond_of_cons Q (K :: p) q hP) + rcases ih p q hE hP' with ⟨b, v0, w, x, y, hJ, hK, rfl, hL⟩ + exact ⟨b, V :: v0, w, (1 + x) * (1 / 2), y, Scan.pair0 hJ, hK, rfl, + by dsimp [wordScale]; rw [hL]; ring⟩ + | pair1 hI ih => + intro p q hE hP + cases p with + | nil => + dsimp at hE; subst hE + exact ⟨_, [], _, 0, _, Scan.nil _, Scan.pair1 hI, rfl, by simp [wordScale]⟩ + | cons s p => + simp only [List.cons_append, List.cons.injEq] at hE; rcases hE with ⟨rfl, hE⟩ + cases p with + | nil => + dsimp at hE; subst hE + rcases hP with hP | ⟨r, hP⟩ <;> nomatch hP + | cons s2 p => + simp only [List.cons_append, List.cons.injEq] at hE; rcases hE with ⟨rfl, hE⟩ + have hP' := splitCond_of_cons Q p q (splitCond_of_cons Q (Q :: p) q hP) + rcases ih p q hE hP' with ⟨b, v0, w, x, y, hJ, hK, rfl, hL⟩ + exact ⟨b, V :: v0, w, (1 / 4) + x * (1 / 2), y, Scan.pair1 hJ, hK, rfl, + by dsimp [wordScale]; rw [hL]; ring⟩ + | short00 hI ih => + intro p q hE hP + cases p with + | nil => + dsimp at hE; subst hE + exact ⟨_, [], _, 0, _, Scan.nil _, Scan.short00 hI, rfl, by simp [wordScale]⟩ + | cons s p => + simp only [List.cons_append, List.cons.injEq] at hE; rcases hE with ⟨rfl, hE⟩ + rcases ih p q hE (splitCond_of_cons K p q hP) with ⟨b, v0, w, x, y, hJ, hK, rfl, hL⟩ + exact ⟨b, K :: v0, w, 1 + x * 2, y, Scan.short00 hJ, hK, rfl, + by dsimp [wordScale]; rw [hL]; ring⟩ + | short01 hI ih => + intro p q hE hP + cases p with + | nil => + dsimp at hE; subst hE + exact ⟨_, [], _, 0, _, Scan.nil _, Scan.short01 hI, rfl, by simp [wordScale]⟩ + | cons s p => + simp only [List.cons_append, List.cons.injEq] at hE; rcases hE with ⟨rfl, hE⟩ + rcases ih p q hE (splitCond_of_cons Q p q hP) with ⟨b, v0, w, x, y, hJ, hK, rfl, hL⟩ + exact ⟨b, K :: v0, w, x * 2, y, Scan.short01 hJ, hK, rfl, + by dsimp [wordScale]; rw [hL]; ring⟩ + | short10 hI ih => + intro p q hE hP + cases p with + | nil => + dsimp at hE; subst hE + exact ⟨_, [], _, 0, _, Scan.nil _, Scan.short10 hI, rfl, by simp [wordScale]⟩ + | cons s p => + simp only [List.cons_append, List.cons.injEq] at hE; rcases hE with ⟨rfl, hE⟩ + rcases ih p q hE (splitCond_of_cons K p q hP) with ⟨b, v0, w, x, y, hJ, hK, rfl, hL⟩ + exact ⟨b, Q :: v0, w, 1 + x * 2, y, Scan.short10 hJ, hK, rfl, + by dsimp [wordScale]; rw [hL]; ring⟩ + | short11 hI ih => + intro p q hE hP + cases p with + | nil => + dsimp at hE; subst hE + exact ⟨_, [], _, 0, _, Scan.nil _, Scan.short11 hI, rfl, by simp [wordScale]⟩ + | cons s p => + simp only [List.cons_append, List.cons.injEq] at hE; rcases hE with ⟨rfl, hE⟩ + rcases ih p q hE (splitCond_of_cons Q p q hP) with ⟨b, v0, w, x, y, hJ, hK, rfl, hL⟩ + exact ⟨b, Q :: v0, w, x * 2, y, Scan.short11 hJ, hK, rfl, + by dsimp [wordScale]; rw [hL]; ring⟩ +theorem scan_scale_pow_eight {a : Nat} {u : WordList} {b : Nat} {v : WordList} {l : Rat} + (h : Scan a u b v l) : + ∃ g : Nat, wordScale u = wordScale v * ((8 ^ g : Nat) : Rat) := by + induction h with + | nil _ => exact ⟨0, by simp [wordScale]⟩ + | T _ ih => + rcases ih with ⟨g, hE⟩ + exact ⟨g, by dsimp [wordScale]; rw [hE]; ring⟩ + | pair0 _ ih => + rcases ih with ⟨g, hE⟩ + refine ⟨g + 1, ?_⟩ + rw [Nat.pow_succ, Nat.cast_mul, Nat.cast_ofNat]; dsimp [wordScale]; rw [hE]; ring + | pair1 _ ih => + rcases ih with ⟨g, hE⟩ + refine ⟨g + 1, ?_⟩ + rw [Nat.pow_succ, Nat.cast_mul, Nat.cast_ofNat]; dsimp [wordScale]; rw [hE]; ring + | short00 _ ih => + rcases ih with ⟨g, hE⟩ + exact ⟨g, by dsimp [wordScale]; rw [hE]; ring⟩ + | short01 _ ih => + rcases ih with ⟨g, hE⟩ + exact ⟨g, by dsimp [wordScale]; rw [hE]; ring⟩ + | short10 _ ih => + rcases ih with ⟨g, hE⟩ + exact ⟨g, by dsimp [wordScale]; rw [hE]; ring⟩ + | short11 _ ih => + rcases ih with ⟨g, hE⟩ + exact ⟨g, by dsimp [wordScale]; rw [hE]; ring⟩ +inductive WordEffect : Nat -> WordList -> Nat -> WordList -> Prop where + | nil (n : Nat) : WordEffect n [] n [] + | T {n : Nat} {u : WordList} {b : Nat} {v : WordList} : + WordEffect (1 + n * 2) u b v -> WordEffect n (V :: u) b (V :: v) + | d00 {n : Nat} {u : WordList} {b : Nat} {v : WordList} : + WordEffect n u b v -> WordEffect (n * 2) (K :: u) b (K :: v) + | d01 {n : Nat} {u : WordList} {b : Nat} {v : WordList} : + WordEffect n u b v -> WordEffect (1 + n * 2) (K :: u) b (Q :: v) + | d10 {n : Nat} {u : WordList} {b : Nat} {v : WordList} : + WordEffect n u b v -> WordEffect (n * 2) (Q :: u) b (Q :: v) + | d11 {n : Nat} {u : WordList} {b : Nat} {v : WordList} : + WordEffect (1 + n) u b v -> WordEffect (1 + n * 2) (Q :: u) b (K :: v) +def forceNat (e : Nat) (f : Nat -> α) : α := + Nat.casesOn (e + 1) (f 0) (fun n => f n) + +@[scoped simp] theorem forceNat_eq (e : Nat) (f : Nat -> α) : forceNat e f = f e := rfl + +def forceWord (w : Word) (f : Word -> α) : α := + Word.casesOn w (f V) (f K) (f Q) + +@[scoped simp] theorem forceWord_eq (w : Word) (f : Word -> α) : forceWord w f = f w := by + cases w <;> rfl + +def forceProd (p : α × β) (f : α -> β -> γ) : γ := + Prod.casesOn p f + +@[scoped simp] theorem forceProd_eq (p : α × β) (f : α -> β -> γ) : forceProd p f = f p.1 p.2 := by + cases p; rfl + +def withNatWordList (u : WordList) (f : WordList -> α) : α := + match u with + | [] => f [] + | w :: ws => forceWord w (fun w' => withNatWordList ws (fun ws' => f (w' :: ws'))) + +@[scoped simp] theorem withNatWordList_eq (u : WordList) (f : WordList -> + α) : withNatWordList u f = f u := by + induction u generalizing f with + | nil => rfl + | cons w ws ih => simp [withNatWordList, ih] + +def evalEffect : Nat -> WordList -> Nat × WordList + | n, [] => (n, []) + | n, V :: u => + forceNat (1 + n * 2) (fun m => + forceProd (evalEffect m u) (fun r1 r2 => (r1, V :: r2))) + | n, K :: u => + forceNat (n / 2) (fun m => + forceWord (if n % 2 == 0 then K else Q) (fun w => + forceProd (evalEffect m u) (fun r1 r2 => (r1, w :: r2)))) + | n, Q :: u => + forceNat (if n % 2 == 0 then n / 2 else 1 + n / 2) (fun m => + forceWord (if n % 2 == 0 then Q else K) (fun w => + forceProd (evalEffect m u) (fun r1 r2 => (r1, w :: r2)))) +theorem evalEffect_sound (u : WordList) : + ∀ (n : Nat), WordEffect n u (evalEffect n u).1 (evalEffect n u).2 := by + induction u with + | nil => intro n; exact WordEffect.nil n + | cons w u ih => + intro n + cases w with + | V => + dsimp [evalEffect] + exact WordEffect.T (ih (1 + n * 2)) + | K => + dsimp [evalEffect] + rcases Nat.mod_two_eq_zero_or_one n with hmod | hmod + · have hcond : (n % 2 == 0) = true := beq_iff_eq.mpr hmod + rw [hcond]; dsimp + have h1 := WordEffect.d00 (ih (n / 2)) + have heq : (n / 2) * 2 = n := by omega + rwa [heq] at h1 + · have hcond : (n % 2 == 0) = false := beq_false_of_ne (by omega) + rw [hcond]; dsimp + have h1 := WordEffect.d01 (ih (n / 2)) + have heq : 1 + (n / 2) * 2 = n := by omega + rwa [heq] at h1 + | Q => + dsimp [evalEffect] + rcases Nat.mod_two_eq_zero_or_one n with hmod | hmod + · have hcond : (n % 2 == 0) = true := beq_iff_eq.mpr hmod + rw [hcond]; dsimp + have h1 := WordEffect.d10 (ih (n / 2)) + have heq : (n / 2) * 2 = n := by omega + rwa [heq] at h1 + · have hcond : (n % 2 == 0) = false := beq_false_of_ne (by omega) + rw [hcond]; dsimp + have h1 := WordEffect.d11 (ih (1 + n / 2)) + have heq : 1 + (n / 2) * 2 = n := by omega + rwa [heq] at h1 +theorem exists_wordEffect (u : WordList) (n : Nat) : ∃ b v, WordEffect n u b v := + ⟨(evalEffect n u).1, (evalEffect n u).2, evalEffect_sound u n⟩ +theorem wordEffect_unique {n : Nat} {u : WordList} {b1 : Nat} {v1 : WordList} + (h1 : WordEffect n u b1 v1) : + ∀ {b2 : Nat} {v2 : WordList}, WordEffect n u b2 v2 -> b1 = b2 /\ v1 = v2 := by + induction h1 with + | nil n => + intro b2 v2 h2; cases h2; exact ⟨rfl, rfl⟩ + | T _ ih => + intro b2 v2 h2 + cases h2 with + | T h2' => + rcases ih h2' with ⟨rfl, rfl⟩ + exact ⟨rfl, rfl⟩ + | @d00 n _ _ _ _ ih => + intro b2 v2 h2 + generalize hk : n * 2 = k at h2 + cases h2 with + | @d00 m _ _ _ h2' => + have hnm : n = m := by omega + subst hnm + rcases ih h2' with ⟨rfl, rfl⟩ + exact ⟨rfl, rfl⟩ + | d01 _ => omega + | @d01 n _ _ _ _ ih => + intro b2 v2 h2 + generalize hk : 1 + n * 2 = k at h2 + cases h2 with + | d00 _ => omega + | @d01 m _ _ _ h2' => + have hnm : n = m := by omega + subst hnm + rcases ih h2' with ⟨rfl, rfl⟩ + exact ⟨rfl, rfl⟩ + | @d10 n _ _ _ _ ih => + intro b2 v2 h2 + generalize hk : n * 2 = k at h2 + cases h2 with + | @d10 m _ _ _ h2' => + have hnm : n = m := by omega + subst hnm + rcases ih h2' with ⟨rfl, rfl⟩ + exact ⟨rfl, rfl⟩ + | d11 _ => omega + | @d11 n _ _ _ _ ih => + intro b2 v2 h2 + generalize hk : 1 + n * 2 = k at h2 + cases h2 with + | d10 _ => omega + | @d11 m _ _ _ h2' => + have hnm : n = m := by omega + subst hnm + rcases ih h2' with ⟨rfl, rfl⟩ + exact ⟨rfl, rfl⟩ +theorem wordEffect_append {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (h1 : WordEffect n u b v) : + ∀ {w : WordList} {c : Nat} {x : WordList}, + WordEffect b w c x -> WordEffect n (u ++ w) c (v ++ x) := by + induction h1 with + | nil _ => intro w c x h2; exact h2 + | T _ ih => intro w c x h2; exact WordEffect.T (ih h2) + | d00 _ ih => intro w c x h2; exact WordEffect.d00 (ih h2) + | d01 _ ih => intro w c x h2; exact WordEffect.d01 (ih h2) + | d10 _ ih => intro w c x h2; exact WordEffect.d10 (ih h2) + | d11 _ ih => intro w c x h2; exact WordEffect.d11 (ih h2) +theorem wordEffect_split_input (u : WordList) : + ∀ {n : Nat} {w : WordList} {b : Nat} {out : WordList}, + WordEffect n (u ++ w) b out -> + ∃ m v x, out = v ++ x /\ WordEffect n u m v /\ WordEffect m w b x := by + induction u with + | nil => + intro n w b out hE + exact ⟨n, [], out, rfl, WordEffect.nil n, hE⟩ + | cons s u ih => + intro n w b out hE + cases hE with + | T hSub => + rcases ih hSub with ⟨m, v1, x, rfl, hA, hB⟩ + exact ⟨m, V :: v1, x, rfl, WordEffect.T hA, hB⟩ + | d00 hSub => + rcases ih hSub with ⟨m, v1, x, rfl, hA, hB⟩ + exact ⟨m, K :: v1, x, rfl, WordEffect.d00 hA, hB⟩ + | d01 hSub => + rcases ih hSub with ⟨m, v1, x, rfl, hA, hB⟩ + exact ⟨m, Q :: v1, x, rfl, WordEffect.d01 hA, hB⟩ + | d10 hSub => + rcases ih hSub with ⟨m, v1, x, rfl, hA, hB⟩ + exact ⟨m, Q :: v1, x, rfl, WordEffect.d10 hA, hB⟩ + | d11 hSub => + rcases ih hSub with ⟨m, v1, x, rfl, hA, hB⟩ + exact ⟨m, K :: v1, x, rfl, WordEffect.d11 hA, hB⟩ +theorem wordEffect_split_output (v : WordList) : + ∀ {n : Nat} {u : WordList} {c : Nat} {w : WordList}, + WordEffect n u c (v ++ w) -> + ∃ u1 u2 b, u = u1 ++ u2 /\ WordEffect n u1 b v /\ WordEffect b u2 c w := by + induction v with + | nil => + intro n u c w hE + exact ⟨[], u, n, rfl, WordEffect.nil n, hE⟩ + | cons x v ih => + intro n u c w hE + cases hE with + | T hSub => + rcases ih hSub with ⟨u1, u2, b, rfl, hL, hR⟩ + exact ⟨V :: u1, u2, b, rfl, WordEffect.T hL, hR⟩ + | d00 hSub => + rcases ih hSub with ⟨u1, u2, b, rfl, hL, hR⟩ + exact ⟨K :: u1, u2, b, rfl, WordEffect.d00 hL, hR⟩ + | d01 hSub => + rcases ih hSub with ⟨u1, u2, b, rfl, hL, hR⟩ + exact ⟨K :: u1, u2, b, rfl, WordEffect.d01 hL, hR⟩ + | d10 hSub => + rcases ih hSub with ⟨u1, u2, b, rfl, hL, hR⟩ + exact ⟨Q :: u1, u2, b, rfl, WordEffect.d10 hL, hR⟩ + | d11 hSub => + rcases ih hSub with ⟨u1, u2, b, rfl, hL, hR⟩ + exact ⟨Q :: u1, u2, b, rfl, WordEffect.d11 hL, hR⟩ +theorem wordEffect_digitVal {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ∀ {A H : Nat}, DigitVal A H u -> ∃ B, DigitVal B H v /\ A + n = B + b * 2 ^ H := by + induction hI with + | nil n => + intro A H hD; cases hD + exact ⟨0, DigitVal.nil, by simp⟩ + | T _ _ => + intro A H hD; exact False.elim (digitVal_not_cons_V hD) + | @d00 n _ b _ _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A', H', hD', rfl, rfl⟩ + rcases ih hD' with ⟨B, hBv, hEq⟩ + refine ⟨B * 2, DigitVal.zero hBv, ?_⟩ + rw [pow_two_one_add, Nat.mul_add]; omega + | @d01 n _ b _ _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A', H', hD', rfl, rfl⟩ + rcases ih hD' with ⟨B, hBv, hEq⟩ + refine ⟨1 + B * 2, DigitVal.one hBv, ?_⟩ + rw [pow_two_one_add, Nat.mul_add]; omega + | @d10 n _ b _ _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A', H', hD', rfl, rfl⟩ + rcases ih hD' with ⟨B, hBv, hEq⟩ + refine ⟨1 + B * 2, DigitVal.one hBv, ?_⟩ + rw [pow_two_one_add, Nat.mul_add]; omega + | @d11 n _ b _ _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A', H', hD', rfl, rfl⟩ + rcases ih hD' with ⟨B, hBv, hEq⟩ + refine ⟨B * 2, DigitVal.zero hBv, ?_⟩ + rw [pow_two_one_add, Nat.mul_add]; omega +theorem exists_wordEffect_of_digitVal_add {n : Nat} {ds : WordList} {A H B : Nat} + (hD : DigitVal A H ds) (hSum : A + n = B) (hBound : B < 2 ^ H) : + ∃ v, DigitVal B H v /\ WordEffect n ds 0 v := by + rcases exists_wordEffect ds n with ⟨b, v, hE⟩ + rcases wordEffect_digitVal hE hD with ⟨C, hV, hEq⟩ + have hCb := lt_pow_of_digitVal hV + have hb0 : b = 0 := by + cases b with + | zero => rfl + | succ b' => + have : 1 * 2 ^ H <= (b' + 1) * 2 ^ H := Nat.mul_le_mul_right (2 ^ H) (by omega) + omega + subst hb0 + have hCB : C = B := by omega + subst hCB + exact ⟨v, hV, hE⟩ +theorem wordEffect_preserves_scale_and_mass {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + wordScale v = wordScale u /\ wordMass v = wordMass u := by + induction hI with + | nil _ => simp [wordScale, wordMass] + | T _ ih => dsimp [wordScale, wordMass]; constructor <;> linarith + | d00 _ ih => dsimp [wordScale, wordMass]; constructor <;> linarith + | d01 _ ih => dsimp [wordScale, wordMass]; constructor <;> linarith + | d10 _ ih => dsimp [wordScale, wordMass]; constructor <;> linarith + | d11 _ ih => dsimp [wordScale, wordMass]; constructor <;> linarith +theorem wordEffect_budget_eq {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ((1 + b : Nat) : Rat) * wordScale u = + ((1 + n : Nat) : Rat) + wordMass u + wordMassQ u - wordMassQ v := by + induction hI with + | nil _ => simp [wordScale, wordMass, wordMassQ] + | T _ ih => dsimp [wordScale, wordMass, wordMassQ]; push_cast at ih ⊢; linarith + | d00 _ ih => dsimp [wordScale, wordMass, wordMassQ]; push_cast at ih ⊢; linarith + | d01 _ ih => dsimp [wordScale, wordMass, wordMassQ]; push_cast at ih ⊢; linarith + | d10 _ ih => dsimp [wordScale, wordMass, wordMassQ]; push_cast at ih ⊢; linarith + | d11 _ ih => dsimp [wordScale, wordMass, wordMassQ]; push_cast at ih ⊢; linarith +theorem wordEffect_replicate_V_inv (p : Nat) : + ∀ (n b : Nat) (v : WordList), + WordEffect n (List.replicate p V) b v -> + v = List.replicate p V /\ 1 + b = (1 + n) * 2 ^ p := by + induction p with + | zero => + intro n b v hI + cases hI + exact ⟨rfl, by simp⟩ + | succ p ih => + intro n b v hI + cases hI with + | T hSub => + rcases ih (1 + n * 2) b _ hSub with ⟨rfl, hEq⟩ + refine ⟨rfl, ?_⟩ + rw [Nat.pow_succ]; ring_nf at hEq ⊢; omega +theorem wordEffect_append_replicate_V_inv (u : WordList) : + ∀ (p n b : Nat) (v : WordList), + WordEffect n (u ++ List.replicate p V) b v -> + ∃ w q, v = w ++ List.replicate p V /\ 1 + b = q * 2 ^ p := by + induction u with + | nil => + intro p n b v hI + rcases wordEffect_replicate_V_inv p n b v hI with ⟨rfl, hEq⟩ + exact ⟨[], 1 + n, rfl, hEq⟩ + | cons x u ih => + intro p n b v hI + cases hI with + | T hSub => + rcases ih p (1 + n * 2) b _ hSub with ⟨w, q, rfl, hEq⟩ + exact ⟨V :: w, q, rfl, hEq⟩ + | d00 hSub => + rcases ih p _ b _ hSub with ⟨w, q, rfl, hEq⟩ + exact ⟨K :: w, q, rfl, hEq⟩ + | d01 hSub => + rcases ih p _ b _ hSub with ⟨w, q, rfl, hEq⟩ + exact ⟨Q :: w, q, rfl, hEq⟩ + | d10 hSub => + rcases ih p _ b _ hSub with ⟨w, q, rfl, hEq⟩ + exact ⟨Q :: w, q, rfl, hEq⟩ + | d11 hSub => + rcases ih p _ b _ hSub with ⟨w, q, rfl, hEq⟩ + exact ⟨K :: w, q, rfl, hEq⟩ + +end BusyBeaver.WordCalculus diff --git a/BusyBeaver/Calculi/WordCalculusB.lean b/BusyBeaver/Calculi/WordCalculusB.lean new file mode 100644 index 00000000..c2218aad --- /dev/null +++ b/BusyBeaver/Calculi/WordCalculusB.lean @@ -0,0 +1,1289 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Calculi.WordCalculusA +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +/-! +# Word Calculus Engine B (`BusyBeaver.Calculi.WordCalculusB`) + +Formal word-rewriting calculus for structured tape transformations, +providing verified macro-step reductions and tile segment chains for family B. +-/ + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.WordCalculus +set_option quotPrecheck false +set_option maxRecDepth 4000000 + +variable {α β γ : Type*} +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +private abbrev t : BitWord := [1, 1, 0, 0] +private abbrev d0 : BitWord := [0, 0] +private abbrev d1 : BitWord := [1, 0] +open Word +local notation "WordList" => List Word +inductive PhaseScan : Nat -> WordList -> Nat -> WordList -> Rat -> Rat -> Prop where + | nil (k : Nat) : PhaseScan k [] k [] 0 0 + | T {n : Nat} {u : WordList} {k : Nat} {v : WordList} {a b : Rat} : + PhaseScan (2 + n * 2) u k v a b -> + PhaseScan (3 + n) (V :: u) k (V :: v) (a * (1 / 2)) (b * (1 / 2)) + | pair0 {n : Nat} {u : WordList} {k : Nat} {v : WordList} {a b : Rat} : + PhaseScan (n * 2) u k v a b -> + PhaseScan (1 + n) (Q :: K :: u) k (V :: v) (a * (1 / 2)) ((1 + b) * (1 / 2)) + | pair1 {n : Nat} {u : WordList} {k : Nat} {v : WordList} {a b : Rat} : + PhaseScan (1 + n * 2) u k v a b -> + PhaseScan (1 + n) (Q :: Q :: u) k (V :: v) (a * (1 / 2)) ((3 / 4) + b * (1 / 2)) + | short00 {n : Nat} {u : WordList} {k : Nat} {v : WordList} {a b : Rat} : + PhaseScan (n * 2) u k v a b -> PhaseScan (2 + n * 4) (K :: u) k (K :: v) (3 + a * 2) (b * 2) + | short01 {n : Nat} {u : WordList} {k : Nat} {v : WordList} {a b : Rat} : + PhaseScan (1 + n * 2) u k v a b -> + PhaseScan (2 + n * 4) (Q :: u) k (K :: v) (2 + a * 2) (b * 2) + | short10 {n : Nat} {u : WordList} {k : Nat} {v : WordList} {a b : Rat} : + PhaseScan (n * 2) u k v a b -> PhaseScan (4 + n * 4) (K :: u) k (Q :: v) (4 + a * 2) (b * 2) + | short11 {n : Nat} {u : WordList} {k : Nat} {v : WordList} {a b : Rat} : + PhaseScan (1 + n * 2) u k v a b -> + PhaseScan (4 + n * 4) (Q :: u) k (Q :: v) (3 + a * 2) (b * 2) +theorem phaseScan_pos_of_out_pos {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (h : PhaseScan k u k' v a b) (hk' : 0 < k') : 0 < k := by + cases h <;> omega +theorem phaseScan_budget_eq {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (h : PhaseScan k u k' v a b) : + (k : Rat) - 4 = ((k' : Rat) - 4) * wordScale v + 2 * (a - b) := by + induction h with + | nil k => simp [wordScale] + | T _ ih => dsimp [wordScale]; push_cast at ih ⊢; linarith + | pair0 _ ih => dsimp [wordScale]; push_cast at ih ⊢; linarith + | pair1 _ ih => dsimp [wordScale]; push_cast at ih ⊢; linarith + | short00 _ ih => dsimp [wordScale]; push_cast at ih ⊢; linarith + | short01 _ ih => dsimp [wordScale]; push_cast at ih ⊢; linarith + | short10 _ ih => dsimp [wordScale]; push_cast at ih ⊢; linarith + | short11 _ ih => dsimp [wordScale]; push_cast at ih ⊢; linarith +theorem phaseScan_loss_bounds {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (h : PhaseScan k u k' v a b) : + wordMass v <= wordMass u /\ 0 <= a /\ a <= 4 * wordMass u /\ 0 <= b /\ + b <= wordMass u * (1 / 4) := by + induction h with + | nil _ => simp [wordMass] + | @T n u k v a b _ ih => + have hw := wordMass_nonneg u + dsimp [wordMass]; refine ⟨by linarith, by linarith, by linarith, by linarith, by linarith⟩ + | @pair0 n u k v a b _ ih => + have hw := wordMass_nonneg u + dsimp [wordMass]; refine ⟨by linarith, by linarith, by linarith, by linarith, by linarith⟩ + | @pair1 n u k v a b _ ih => + have hw := wordMass_nonneg u + dsimp [wordMass]; refine ⟨by linarith, by linarith, by linarith, by linarith, by linarith⟩ + | @short00 n u k v a b _ ih => + have hw := wordMass_nonneg u + dsimp [wordMass]; refine ⟨by linarith, by linarith, by linarith, by linarith, by linarith⟩ + | @short01 n u k v a b _ ih => + have hw := wordMass_nonneg u + dsimp [wordMass]; refine ⟨by linarith, by linarith, by linarith, by linarith, by linarith⟩ + | @short10 n u k v a b _ ih => + have hw := wordMass_nonneg u + dsimp [wordMass]; refine ⟨by linarith, by linarith, by linarith, by linarith, by linarith⟩ + | @short11 n u k v a b _ ih => + have hw := wordMass_nonneg u + dsimp [wordMass]; refine ⟨by linarith, by linarith, by linarith, by linarith, by linarith⟩ +theorem phaseScan_append {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (h1 : PhaseScan k u k' v a b) : + ∀ {w : WordList} {k'' : Nat} {x : WordList} {c d : Rat}, + PhaseScan k' w k'' x c d -> + ∃ a' b', PhaseScan k (u ++ w) k'' (v ++ x) a' b' /\ + a' = a + wordScale v * c /\ b' = b + wordScale v * d := by + induction h1 with + | nil _ => + intro w k'' x c d h2 + exact ⟨c, d, h2, by simp [wordScale], by simp [wordScale]⟩ + | T _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a', b', hK, hA, hB⟩ + exact ⟨a' * (1 / 2), b' * (1 / 2), PhaseScan.T hK, + by dsimp [wordScale]; linarith, by dsimp [wordScale]; linarith⟩ + | pair0 _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a', b', hK, hA, hB⟩ + exact ⟨a' * (1 / 2), (1 + b') * (1 / 2), PhaseScan.pair0 hK, + by dsimp [wordScale]; linarith, by dsimp [wordScale]; linarith⟩ + | pair1 _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a', b', hK, hA, hB⟩ + exact ⟨a' * (1 / 2), (3 / 4) + b' * (1 / 2), PhaseScan.pair1 hK, + by dsimp [wordScale]; linarith, by dsimp [wordScale]; linarith⟩ + | short00 _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a', b', hK, hA, hB⟩ + exact ⟨3 + a' * 2, b' * 2, PhaseScan.short00 hK, + by dsimp [wordScale]; linarith, by dsimp [wordScale]; linarith⟩ + | short01 _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a', b', hK, hA, hB⟩ + exact ⟨2 + a' * 2, b' * 2, PhaseScan.short01 hK, + by dsimp [wordScale]; linarith, by dsimp [wordScale]; linarith⟩ + | short10 _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a', b', hK, hA, hB⟩ + exact ⟨4 + a' * 2, b' * 2, PhaseScan.short10 hK, + by dsimp [wordScale]; linarith, by dsimp [wordScale]; linarith⟩ + | short11 _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a', b', hK, hA, hB⟩ + exact ⟨3 + a' * 2, b' * 2, PhaseScan.short11 hK, + by dsimp [wordScale]; linarith, by dsimp [wordScale]; linarith⟩ +theorem exists_phaseScan_of_wordPrefix {e : Bool} {u : WordList} (hI : WordPrefix e u) : + ∀ (k : Nat), (e = true -> ∃ n, k = n * 2) -> + 8 * wordMass u < (k : Rat) - 4 -> + ∃ b v lp lm, PhaseScan k u b v lp lm /\ 4 < b := by + induction hI with + | nil e => + intro k _ hk + dsimp [wordMass] at hk + have hk_gt : (4 : Rat) < (k : Rat) := by linarith + have hk_nat : 4 < k := by exact_mod_cast hk_gt + exact ⟨k, [], 0, 0, PhaseScan.nil k, hk_nat⟩ + | @T e u _ ih => + intro k _ hk + have hw := wordMass_nonneg u + dsimp [wordMass] at hk + rcases k with _ | _ | _ | k + · push_cast at hk; linarith + · push_cast at hk; linarith + · push_cast at hk; linarith + · have h3k : k + 3 = 3 + k := by omega + rw [h3k] at hk ⊢ + rcases ih (2 + k * 2) (fun _ => ⟨1 + k, by omega⟩) + (by push_cast at hk ⊢; linarith) with ⟨b, v, lp, lm, hS, hB⟩ + exact ⟨b, V :: v, lp * (1 / 2), lm * (1 / 2), PhaseScan.T hS, hB⟩ + | @short0 u _ ih => + intro k hEk hk + have hw := wordMass_nonneg u + dsimp [wordMass] at hk + rcases hEk rfl with ⟨n, rfl⟩ + rcases even_or_odd_mul_two n with ⟨a, rfl⟩ | ⟨a, rfl⟩ + · cases a with + | zero => push_cast at hk; linarith + | succ a => + rcases ih (a * 2) (fun _ => ⟨a, rfl⟩) + (by push_cast at hk ⊢; linarith) with ⟨b, v, lp, lm, hS, hB⟩ + refine ⟨b, Q :: v, 4 + lp * 2, lm * 2, ?_, hB⟩ + have heq : (a + 1) * 2 * 2 = 4 + a * 4 := by omega + rw [heq]; exact PhaseScan.short10 hS + · rcases ih (a * 2) (fun _ => ⟨a, rfl⟩) + (by push_cast at hk ⊢; linarith) with ⟨b, v, lp, lm, hS, hB⟩ + refine ⟨b, K :: v, 3 + lp * 2, lm * 2, ?_, hB⟩ + have heq : (1 + a * 2) * 2 = 2 + a * 4 := by omega + rw [heq]; exact PhaseScan.short00 hS + | @short1 u _ ih => + intro k hEk hk + have hw := wordMass_nonneg u + dsimp [wordMass] at hk + rcases hEk rfl with ⟨n, rfl⟩ + rcases even_or_odd_mul_two n with ⟨a, rfl⟩ | ⟨a, rfl⟩ + · cases a with + | zero => push_cast at hk; linarith + | succ a => + rcases ih (1 + a * 2) (fun h => by contradiction) + (by push_cast at hk ⊢; linarith) with ⟨b, v, lp, lm, hS, hB⟩ + refine ⟨b, Q :: v, 3 + lp * 2, lm * 2, ?_, hB⟩ + have heq : (a + 1) * 2 * 2 = 4 + a * 4 := by omega + rw [heq]; exact PhaseScan.short11 hS + · rcases ih (1 + a * 2) (fun h => by contradiction) + (by push_cast at hk ⊢; linarith) with ⟨b, v, lp, lm, hS, hB⟩ + refine ⟨b, K :: v, 2 + lp * 2, lm * 2, ?_, hB⟩ + have heq : (1 + a * 2) * 2 = 2 + a * 4 := by omega + rw [heq]; exact PhaseScan.short01 hS + | @pair0 e u _ ih => + intro k _ hk + have hw := wordMass_nonneg u + dsimp [wordMass] at hk + cases k with + | zero => push_cast at hk; linarith + | succ k => + have h1k : k + 1 = 1 + k := by omega + rw [h1k] at hk ⊢ + rcases ih (k * 2) (fun _ => ⟨k, rfl⟩) + (by push_cast at hk ⊢; linarith) with ⟨b, v, lp, lm, hS, hB⟩ + exact ⟨b, V :: v, lp * (1 / 2), (1 + lm) * (1 / 2), PhaseScan.pair0 hS, hB⟩ + | @pair1 e u _ ih => + intro k _ hk + have hw := wordMass_nonneg u + dsimp [wordMass] at hk + cases k with + | zero => push_cast at hk; linarith + | succ k => + have h1k : k + 1 = 1 + k := by omega + rw [h1k] at hk ⊢ + rcases ih (1 + k * 2) (fun h => by contradiction) + (by push_cast at hk ⊢; linarith) with ⟨b, v, lp, lm, hS, hB⟩ + exact ⟨b, V :: v, lp * (1 / 2), (3 / 4) + lm * (1 / 2), PhaseScan.pair1 hS, hB⟩ +theorem exists_phaseScan_of_mass_lt (u : WordList) (k : Nat) (h : 8 * wordMass u < + ((k * 2 : Nat) : Rat) - 4) : + ∃ b v lp lm, PhaseScan (k * 2) u b v lp lm /\ 4 < b := + exists_phaseScan_of_wordPrefix (wordPrefix_true_and_cases u).1 (k * 2) (fun _ => ⟨k, rfl⟩) h +theorem scan_digitVal_loss_bound {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {l : Rat} + (hI : Scan k u k' v l) : + ∀ {A H : Nat}, DigitVal A H u -> + ∃ a b, PhaseScan k u k' v a b /\ a <= 3 * wordMass v + l /\ b <= 3 * l := by + induction hI with + | nil k => + intro A H _ + exact ⟨0, 0, PhaseScan.nil k, by simp [wordMass], by linarith⟩ + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | pair0 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1, H1, hD1, _, _⟩ + rcases digitVal_cons_K_inv hD1 with ⟨A2, H2, hD2, _, _⟩ + rcases ih hD2 with ⟨a, b, hJ, hP, hM⟩ + exact ⟨a * (1 / 2), (1 + b) * (1 / 2), PhaseScan.pair0 hJ, + by dsimp [wordMass]; linarith, by linarith⟩ + | pair1 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1, H1, hD1, _, _⟩ + rcases digitVal_cons_Q_inv hD1 with ⟨A2, H2, hD2, _, _⟩ + rcases ih hD2 with ⟨a, b, hJ, hP, hM⟩ + exact ⟨a * (1 / 2), (3 / 4) + b * (1 / 2), PhaseScan.pair1 hJ, + by dsimp [wordMass]; linarith, by linarith⟩ + | short00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A1, H1, hD1, _, _⟩ + rcases ih hD1 with ⟨a, b, hJ, hP, hM⟩ + exact ⟨3 + a * 2, b * 2, PhaseScan.short00 hJ, by dsimp [wordMass]; linarith, by linarith⟩ + | short01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1, H1, hD1, _, _⟩ + rcases ih hD1 with ⟨a, b, hJ, hP, hM⟩ + exact ⟨2 + a * 2, b * 2, PhaseScan.short01 hJ, by dsimp [wordMass]; linarith, by linarith⟩ + | short10 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A1, H1, hD1, _, _⟩ + rcases ih hD1 with ⟨a, b, hJ, hP, hM⟩ + exact ⟨4 + a * 2, b * 2, PhaseScan.short10 hJ, by dsimp [wordMass]; linarith, by linarith⟩ + | short11 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1, H1, hD1, _, _⟩ + rcases ih hD1 with ⟨a, b, hJ, hP, hM⟩ + exact ⟨3 + a * 2, b * 2, PhaseScan.short11 hJ, by dsimp [wordMass]; linarith, by linarith⟩ +theorem phaseScan_digitVal_loss_bound {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (hI : PhaseScan k u k' v a b) : + ∀ {A H : Nat}, DigitVal A H u -> + ∃ l, Scan k u k' v l /\ a <= 3 * wordMass v + l /\ b <= 3 * l := by + induction hI with + | nil k => + intro A H _ + exact ⟨0, Scan.nil k, by simp [wordMass], by linarith⟩ + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | pair0 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1, H1, hD1, _, _⟩ + rcases digitVal_cons_K_inv hD1 with ⟨A2, H2, hD2, _, _⟩ + rcases ih hD2 with ⟨l, hJ, hP, hM⟩ + exact ⟨(1 + l) * (1 / 2), Scan.pair0 hJ, by dsimp [wordMass]; linarith, by linarith⟩ + | pair1 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1, H1, hD1, _, _⟩ + rcases digitVal_cons_Q_inv hD1 with ⟨A2, H2, hD2, _, _⟩ + rcases ih hD2 with ⟨l, hJ, hP, hM⟩ + exact ⟨(1 / 4) + l * (1 / 2), Scan.pair1 hJ, by dsimp [wordMass]; linarith, by linarith⟩ + | short00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A1, H1, hD1, _, _⟩ + rcases ih hD1 with ⟨l, hJ, hP, hM⟩ + exact ⟨1 + l * 2, Scan.short00 hJ, by dsimp [wordMass]; linarith, by linarith⟩ + | short01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1, H1, hD1, _, _⟩ + rcases ih hD1 with ⟨l, hJ, hP, hM⟩ + exact ⟨l * 2, Scan.short01 hJ, by dsimp [wordMass]; linarith, by linarith⟩ + | short10 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A1, H1, hD1, _, _⟩ + rcases ih hD1 with ⟨l, hJ, hP, hM⟩ + exact ⟨1 + l * 2, Scan.short10 hJ, by dsimp [wordMass]; linarith, by linarith⟩ + | short11 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1, H1, hD1, _, _⟩ + rcases ih hD1 with ⟨l, hJ, hP, hM⟩ + exact ⟨l * 2, Scan.short11 hJ, by dsimp [wordMass]; linarith, by linarith⟩ +theorem phaseScan_tailDefect_bound {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (hI : PhaseScan k u k' v a b) {z : Rat} (hD : TailDefect u z) : + wordMass v <= 1 + 2 * z /\ a <= 4 * (1 + 2 * z) /\ b <= 3 * (1 + 2 * z) := by + rcases exists_digitVal_of_tailDefect hD with ⟨A, H, hB⟩ + rcases phaseScan_digitVal_loss_bound hI hB with ⟨l, hJ, hP, hM⟩ + rcases scan_tailDefect_bound hJ hD with ⟨hMv, hLv, _⟩ + refine ⟨by linarith, by linarith, by linarith⟩ +theorem phaseScan_scale_le {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (h : PhaseScan k u k' v a b) : wordScale v <= wordScale u := by + induction h with + | nil _ => simp [wordScale] + | T _ ih => dsimp [wordScale]; linarith + | @pair0 _ u _ _ _ _ _ _ => have hp := wordScale_pos u; dsimp [wordScale]; linarith + | @pair1 _ u _ _ _ _ _ _ => have hp := wordScale_pos u; dsimp [wordScale]; linarith + | short00 _ ih => dsimp [wordScale]; linarith + | short01 _ ih => dsimp [wordScale]; linarith + | short10 _ ih => dsimp [wordScale]; linarith + | short11 _ ih => dsimp [wordScale]; linarith +theorem scan_tailDefect_step_bound (u : WordList) (z : Rat) (k : Nat) + (hD : TailDefect u z) + (hBudget : 2 * (wordMass u + wordMassK u) < ((k * 2 : Nat) : Rat)) + (hLoss : 8 * (1 + 2 * z) < ((k * 2 : Nat) : Rat) - 4) : + ∃ k' v a b, PhaseScan (k * 2) u k' v a b /\ 4 < k' := by + have hEx : (wordMass u + wordMassK u) * 2 < ((k * 2 : Nat) : Rat) := by linarith + rcases exists_scan_of_mass_lt u k hEx with ⟨k', v, l, hI, _⟩ + rcases exists_digitVal_of_tailDefect hD with ⟨A, H, hB⟩ + rcases scan_digitVal_loss_bound hI hB with ⟨a, b, hJ, _, _⟩ + refine ⟨k', v, a, b, hJ, ?_⟩ + have hTB := phaseScan_tailDefect_bound hJ hD + have hBud := phaseScan_budget_eq hJ + have hBnd := phaseScan_loss_bounds hJ + have hSv := wordScale_pos v + have hk'_gt : (4 : Rat) < (k' : Rat) := by + have h1 : 2 * (a - b) <= 8 * (1 + 2 * z) := by linarith + have h2 : 0 < ((k' : Rat) - 4) * wordScale v := by linarith + nlinarith + exact_mod_cast hk'_gt +theorem phaseScan_even_out_of_notEndsWithQ {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b + : Rat} + (hI : PhaseScan k u k' v a b) : + notEndsWithQ u = true -> u ≠ [] -> ∃ n, k' = n * 2 := by + induction hI with + | nil _ => intro _ hNe; exact False.elim (hNe rfl) + | @T n u _ _ _ _ hSub ih => + intro hC _ + cases u with + | nil => generalize hk : 2 + n * 2 = k0 at hSub; cases hSub; exact ⟨1 + n, by omega⟩ + | cons x u' => exact ih (notEndsWithQ_of_cons V (x :: u') hC) (by simp) + | @pair0 n u _ _ _ _ hSub ih => + intro hC _ + cases u with + | nil => generalize hk : n * 2 = k0 at hSub; cases hSub; exact ⟨n, by omega⟩ + | cons x u' => + have hC1 := notEndsWithQ_of_cons Q (K :: x :: u') hC + have hC2 := notEndsWithQ_of_cons K (x :: u') hC1 + exact ih hC2 (by simp) + | @pair1 n u _ _ _ _ hSub ih => + intro hC _ + cases u with + | nil => contradiction + | cons x u' => + have hC1 := notEndsWithQ_of_cons Q (Q :: x :: u') hC + have hC2 := notEndsWithQ_of_cons Q (x :: u') hC1 + exact ih hC2 (by simp) + | @short00 n u _ _ _ _ hSub ih => + intro hC _ + cases u with + | nil => generalize hk : n * 2 = k0 at hSub; cases hSub; exact ⟨n, by omega⟩ + | cons x u' => exact ih (notEndsWithQ_of_cons K (x :: u') hC) (by simp) + | @short01 n u _ _ _ _ hSub ih => + intro hC _ + cases u with + | nil => contradiction + | cons x u' => exact ih (notEndsWithQ_of_cons Q (x :: u') hC) (by simp) + | @short10 n u _ _ _ _ hSub ih => + intro hC _ + cases u with + | nil => generalize hk : n * 2 = k0 at hSub; cases hSub; exact ⟨n, by omega⟩ + | cons x u' => exact ih (notEndsWithQ_of_cons K (x :: u') hC) (by simp) + | @short11 n u _ _ _ _ hSub ih => + intro hC _ + cases u with + | nil => contradiction + | cons x u' => exact ih (notEndsWithQ_of_cons Q (x :: u') hC) (by simp) +theorem phaseScan_split_of_splitCond {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (h : PhaseScan k u k' v a b) : + ∀ (p q : WordList), u = p ++ q -> SplitCond p q -> + ∃ m x y a1 b1 a2 b2, PhaseScan k p m x a1 b1 /\ PhaseScan m q k' y a2 b2 /\ + v = x ++ y /\ a = a1 + wordScale x * a2 /\ b = b1 + wordScale x * b2 := by + induction h with + | nil k => + intro p q hE _ + cases p with + | nil => + dsimp at hE; subst hE + exact ⟨k, [], [], 0, 0, 0, 0, PhaseScan.nil k, PhaseScan.nil k, rfl, by simp [wordScale], + by simp [wordScale]⟩ + | cons s p => simp at hE + | T hI ih => + intro p q hE hP + cases p with + | nil => + dsimp at hE; subst hE + exact ⟨_, [], _, 0, 0, _, _, PhaseScan.nil _, PhaseScan.T hI, rfl, by simp [wordScale], + by simp [wordScale]⟩ + | cons s p => + simp only [List.cons_append, List.cons.injEq] at hE; rcases hE with ⟨rfl, hE⟩ + rcases ih p q hE (splitCond_of_cons V p q hP) with ⟨m, x, y, a1, b1, a2, b2, hJ, hK, rfl, + hA, hB⟩ + exact ⟨m, V :: x, y, a1 * (1 / 2), b1 * (1 / 2), a2, b2, PhaseScan.T hJ, hK, rfl, + by dsimp [wordScale]; rw [hA]; ring, by dsimp [wordScale]; rw [hB]; ring⟩ + | pair0 hI ih => + intro p q hE hP + cases p with + | nil => + dsimp at hE; subst hE + exact ⟨_, [], _, 0, 0, _, _, PhaseScan.nil _, PhaseScan.pair0 hI, rfl, by simp [wordScale], + by simp [wordScale]⟩ + | cons s p => + simp only [List.cons_append, List.cons.injEq] at hE; rcases hE with ⟨rfl, hE⟩ + cases p with + | nil => + dsimp at hE; subst hE + rcases hP with hP | ⟨r, hP⟩ <;> nomatch hP + | cons s2 p => + simp only [List.cons_append, List.cons.injEq] at hE; rcases hE with ⟨rfl, hE⟩ + have hP' := splitCond_of_cons K p q (splitCond_of_cons Q (K :: p) q hP) + rcases ih p q hE hP' with ⟨m, x, y, a1, b1, a2, b2, hJ, hK, rfl, hA, hB⟩ + exact ⟨m, V :: x, y, a1 * (1 / 2), (1 + b1) * (1 / 2), a2, b2, PhaseScan.pair0 hJ, hK, rfl, + by dsimp [wordScale]; rw [hA]; ring, by dsimp [wordScale]; rw [hB]; ring⟩ + | pair1 hI ih => + intro p q hE hP + cases p with + | nil => + dsimp at hE; subst hE + exact ⟨_, [], _, 0, 0, _, _, PhaseScan.nil _, PhaseScan.pair1 hI, rfl, by simp [wordScale], + by simp [wordScale]⟩ + | cons s p => + simp only [List.cons_append, List.cons.injEq] at hE; rcases hE with ⟨rfl, hE⟩ + cases p with + | nil => + dsimp at hE; subst hE + rcases hP with hP | ⟨r, hP⟩ <;> nomatch hP + | cons s2 p => + simp only [List.cons_append, List.cons.injEq] at hE; rcases hE with ⟨rfl, hE⟩ + have hP' := splitCond_of_cons Q p q (splitCond_of_cons Q (Q :: p) q hP) + rcases ih p q hE hP' with ⟨m, x, y, a1, b1, a2, b2, hJ, hK, rfl, hA, hB⟩ + exact ⟨m, V :: x, y, a1 * (1 / 2), (3 / 4) + b1 * (1 / 2), a2, b2, PhaseScan.pair1 hJ, hK, + rfl, + by dsimp [wordScale]; rw [hA]; ring, by dsimp [wordScale]; rw [hB]; ring⟩ + | short00 hI ih => + intro p q hE hP + cases p with + | nil => + dsimp at hE; subst hE + exact ⟨_, [], _, 0, 0, _, _, PhaseScan.nil _, PhaseScan.short00 hI, rfl, + by simp [wordScale], by simp [wordScale]⟩ + | cons s p => + simp only [List.cons_append, List.cons.injEq] at hE; rcases hE with ⟨rfl, hE⟩ + rcases ih p q hE (splitCond_of_cons K p q hP) with ⟨m, x, y, a1, b1, a2, b2, hJ, hK, rfl, + hA, hB⟩ + exact ⟨m, K :: x, y, 3 + a1 * 2, b1 * 2, a2, b2, PhaseScan.short00 hJ, hK, rfl, + by dsimp [wordScale]; rw [hA]; ring, by dsimp [wordScale]; rw [hB]; ring⟩ + | short01 hI ih => + intro p q hE hP + cases p with + | nil => + dsimp at hE; subst hE + exact ⟨_, [], _, 0, 0, _, _, PhaseScan.nil _, PhaseScan.short01 hI, rfl, + by simp [wordScale], by simp [wordScale]⟩ + | cons s p => + simp only [List.cons_append, List.cons.injEq] at hE; rcases hE with ⟨rfl, hE⟩ + rcases ih p q hE (splitCond_of_cons Q p q hP) with ⟨m, x, y, a1, b1, a2, b2, hJ, hK, rfl, + hA, hB⟩ + exact ⟨m, K :: x, y, 2 + a1 * 2, b1 * 2, a2, b2, PhaseScan.short01 hJ, hK, rfl, + by dsimp [wordScale]; rw [hA]; ring, by dsimp [wordScale]; rw [hB]; ring⟩ + | short10 hI ih => + intro p q hE hP + cases p with + | nil => + dsimp at hE; subst hE + exact ⟨_, [], _, 0, 0, _, _, PhaseScan.nil _, PhaseScan.short10 hI, rfl, + by simp [wordScale], by simp [wordScale]⟩ + | cons s p => + simp only [List.cons_append, List.cons.injEq] at hE; rcases hE with ⟨rfl, hE⟩ + rcases ih p q hE (splitCond_of_cons K p q hP) with ⟨m, x, y, a1, b1, a2, b2, hJ, hK, rfl, + hA, hB⟩ + exact ⟨m, Q :: x, y, 4 + a1 * 2, b1 * 2, a2, b2, PhaseScan.short10 hJ, hK, rfl, + by dsimp [wordScale]; rw [hA]; ring, by dsimp [wordScale]; rw [hB]; ring⟩ + | short11 hI ih => + intro p q hE hP + cases p with + | nil => + dsimp at hE; subst hE + exact ⟨_, [], _, 0, 0, _, _, PhaseScan.nil _, PhaseScan.short11 hI, rfl, + by simp [wordScale], by simp [wordScale]⟩ + | cons s p => + simp only [List.cons_append, List.cons.injEq] at hE; rcases hE with ⟨rfl, hE⟩ + rcases ih p q hE (splitCond_of_cons Q p q hP) with ⟨m, x, y, a1, b1, a2, b2, hJ, hK, rfl, + hA, hB⟩ + exact ⟨m, Q :: x, y, 3 + a1 * 2, b1 * 2, a2, b2, PhaseScan.short11 hJ, hK, rfl, + by dsimp [wordScale]; rw [hA]; ring, by dsimp [wordScale]; rw [hB]; ring⟩ +theorem phaseScan_append_odd_Q_K_inv (r k : Nat) (u : WordList) (k' : Nat) (v : WordList) (a b : + Rat) + (hI : PhaseScan k (u ++ List.replicate (1 + r * 2) Q ++ [K]) k' v a b) : + ∃ w n, v = w ++ List.replicate (1 + r) V /\ k' = n * 2 ^ (1 + r) := by + rcases split_trailing_Q u with ⟨p, n, rfl, hP⟩ + have hE : (p ++ List.replicate n Q) ++ List.replicate (1 + r * 2) Q ++ [K] = + p ++ (List.replicate (1 + r * 2 + n) Q ++ [K]) := by + have heq : 1 + r * 2 + n = n + (1 + r * 2) := by omega + rw [heq, List.replicate_add n (1 + r * 2)]; simp only [List.append_assoc] + rw [hE] at hI + rcases phaseScan_split_of_splitCond hI p (List.replicate (1 + r * 2 + n) Q ++ [K]) rfl (Or.inl hP) + with ⟨m, x, y, _, _, _, _, _, hK, rfl, _, _⟩ + have hD : DigitVal ((2 ^ (1 + r * 2 + n) - 1) + 0 * 2 ^ (1 + r * 2 + n)) ((1 + r * 2 + n) + 1) + (List.replicate (1 + r * 2 + n) Q ++ [K]) := + digitVal_append (digitVal_replicate_Q (1 + r * 2 + n)) (DigitVal.zero DigitVal.nil) + rcases phaseScan_digitVal_loss_bound hK hD with ⟨l, hL, _, _⟩ + rcases scan_add_Q_K_inv n r m k' y l hL with ⟨w, q, rfl, rfl⟩ + exact ⟨x ++ w, q, by rw [List.append_assoc], rfl⟩ +theorem phaseScan_replicate_V_inv (p : Nat) : + ∀ (k k' : Nat) (v : WordList) (a b : Rat), + PhaseScan k (List.replicate p V) k' v a b -> + v = List.replicate p V /\ k' + 4 * 2 ^ p = k * 2 ^ p + 4 /\ a = 0 /\ b = 0 := by + induction p with + | zero => + intro k k' v a b hI + cases hI + exact ⟨rfl, by simp, rfl, rfl⟩ + | succ p ih => + intro k k' v a b hI + cases hI with + | @T n _ _ v0 a0 b0 hJ => + rcases ih (2 + n * 2) k' v0 a0 b0 hJ with ⟨rfl, hEq, rfl, rfl⟩ + refine ⟨rfl, ?_, by ring, by ring⟩ + rw [Nat.pow_succ]; ring_nf at hEq ⊢; omega +theorem digitVal_high_ones_suffix (n t0 B : Nat) (ds : WordList) + (hD : DigitVal B (n + t0) ds) (hL : 2 ^ (n + t0) <= B + 2 ^ n) : + ∃ u, ds = u ++ List.replicate t0 Q := by + have hBound := lt_pow_of_digitVal hD + have hPos := pow_two_pos t0 + rw [Nat.pow_add] at hL hBound + let a := B - (2 ^ t0 - 1) * 2 ^ n + have hSum : a + (2 ^ t0 - 1) * 2 ^ n = B := by + have : (2 ^ t0 - 1) * 2 ^ n + 2 ^ n = 2 ^ n * 2 ^ t0 := by + have h1 : (2 ^ t0 - 1) + 1 = 2 ^ t0 := by omega + calc (2 ^ t0 - 1) * 2 ^ n + 2 ^ n + _ = ((2 ^ t0 - 1) + 1) * 2 ^ n := by ring + _ = 2 ^ t0 * 2 ^ n := by rw [h1] + _ = 2 ^ n * 2 ^ t0 := by ring + omega + have ha_lt : a < 2 ^ n := by + have : (2 ^ t0 - 1) * 2 ^ n + 2 ^ n = 2 ^ n * 2 ^ t0 := by + have h1 : (2 ^ t0 - 1) + 1 = 2 ^ t0 := by omega + calc (2 ^ t0 - 1) * 2 ^ n + 2 ^ n + _ = ((2 ^ t0 - 1) + 1) * 2 ^ n := by ring + _ = 2 ^ t0 * 2 ^ n := by rw [h1] + _ = 2 ^ n * 2 ^ t0 := by ring + omega + rcases exists_digitVal_of_lt_pow n a ha_lt with ⟨u, hU⟩ + refine ⟨u, digitVal_unique hD ?_⟩ + rw [<- hSum] + exact digitVal_append hU (digitVal_replicate_Q t0) +def stripWordPrefix : WordList -> WordList -> Option (WordList) + | [], u => some u + | V :: p, V :: u => stripWordPrefix p u + | K :: p, K :: u => stripWordPrefix p u + | Q :: p, Q :: u => stripWordPrefix p u + | _, _ => none +theorem stripWordPrefix_sound (p : WordList) : + ∀ (u v : WordList), stripWordPrefix p u = some v -> u = p ++ v := by + induction p with + | nil => intro u v h; injection h + | cons w p ih => + intro u v h + cases u with + | nil => cases w <;> contradiction + | cons x u => + cases w <;> cases x <;> try contradiction + all_goals + dsimp [stripWordPrefix] at h + rw [ih u v h]; rfl +def isWordK : Word -> Bool + | K => true + | _ => false +theorem evalWords_default_of_all_K (u : WordList) (h : u.all isWordK = true) : + evalWords u default = default := by + induction u with + | nil => rfl + | cons w u ih => + cases w <;> try contradiction + dsimp [List.all, isWordK] at h + change d0 +> evalWords u default = default + rw [ih h] + have h0 : (0 : Fin 2) >> (default : HalfTape) = default := ListBlank.cons_head_tail default + simp [h0] +def isDigitWord : Word -> Bool + | V => false + | _ => true +theorem exists_digitVal_of_all_isDigitWord (ds : WordList) (h : ds.all isDigitWord = true) : + ∃ A, DigitVal A ds.length ds := by + induction ds with + | nil => exact ⟨0, DigitVal.nil⟩ + | cons w ds ih => + cases w + · contradiction + · dsimp [List.all, isDigitWord] at h + rcases ih h with ⟨A, hI⟩ + have heq : (K :: ds).length = 1 + ds.length := by simp [Nat.add_comm] + rw [heq]; exact ⟨A * 2, DigitVal.zero hI⟩ + · dsimp [List.all, isDigitWord] at h + rcases ih h with ⟨A, hI⟩ + have heq : (Q :: ds).length = 1 + ds.length := by simp [Nat.add_comm] + rw [heq]; exact ⟨1 + A * 2, DigitVal.one hI⟩ +def bitStepNat (e : Bool) (n : Nat) : Nat := if e then 1 + n * 2 else n * 2 +def halfCeil (n : Nat) : Nat := (n + 1) / 2 +theorem le_halfCeil_mul_two (n : Nat) : n <= (halfCeil n) * 2 := by + unfold halfCeil; omega +theorem rat_le_two_mul_halfCeil (n : Nat) : (n : Rat) <= 2 * ((halfCeil n : Nat) : Rat) := by + have h := le_halfCeil_mul_two n + have hq : (n : Rat) <= (((halfCeil n) * 2 : Nat) : Rat) := by exact_mod_cast h + push_cast at hq + linarith +def massUpperBound (c0 c1 : Nat) : WordList -> Nat -> Nat + | [], n => n + | V :: u, n => forceNat (halfCeil n) (fun m => massUpperBound c0 c1 u m) + | K :: u, n => forceNat (n * 2 + c0) (fun m => massUpperBound c0 c1 u m) + | Q :: u, n => forceNat (n * 2 + c1) (fun m => massUpperBound c0 c1 u m) +theorem massUpperBound_reverse_le (c0 c1 : Nat) (u : WordList) : + ∀ (n : Nat), + (c0 : Rat) * wordMassK u.reverse + (c1 : Rat) * wordMassQ u.reverse + + wordScale u.reverse * (n : Rat) <= + ((massUpperBound c0 c1 u n : Nat) : Rat) := by + induction u with + | nil => + intro n + simp [wordMassK, wordMassQ, wordScale, massUpperBound] + | cons w u ih => + intro n + have hsp := wordScale_pos u.reverse + cases w + · dsimp [massUpperBound, forceNat_eq] + rw [List.reverse_cons, wordMassK_append, wordMassQ_append, wordScale_append] + dsimp [wordMassK, wordMassQ, wordScale] + have hhu := rat_le_two_mul_halfCeil n + have hih := ih (halfCeil n) + nlinarith + · dsimp [massUpperBound, forceNat_eq] + rw [List.reverse_cons, wordMassK_append, wordMassQ_append, wordScale_append] + dsimp [wordMassK, wordMassQ, wordScale] + have hih := ih (n * 2 + c0) + push_cast at hih + nlinarith + · dsimp [massUpperBound, forceNat_eq] + rw [List.reverse_cons, wordMassK_append, wordMassQ_append, wordScale_append] + dsimp [wordMassK, wordMassQ, wordScale] + have hih := ih (n * 2 + c1) + push_cast at hih + nlinarith +theorem massUpperBound_le (c0 c1 : Nat) (u : WordList) (n : Nat) : + (c0 : Rat) * wordMassK u + (c1 : Rat) * wordMassQ u + wordScale u * (n : Rat) <= + ((massUpperBound c0 c1 u.reverse n : Nat) : Rat) := by + have h := massUpperBound_reverse_le c0 c1 u.reverse n + simpa [List.reverse_reverse] using h +def heightShift : WordList -> Nat -> Option Nat + | [], h => some h + | V :: u, h => heightShift u (h + 1) + | _ :: _, 0 => none + | _ :: u, h + 1 => heightShift u h +theorem heightShift_sound (u : WordList) : + ∀ (h H : Nat), heightShift u h = some H -> + wordScale u * ((2 ^ H : Nat) : Rat) = ((2 ^ h : Nat) : Rat) := by + induction u with + | nil => + intro h H hE + injection hE with hE; subst hE + simp [wordScale] + | cons w u ih => + intro h H hE + cases w + · dsimp [heightShift, wordScale] at hE ⊢ + have hih := ih (h + 1) H hE + rw [Nat.pow_succ, Nat.cast_mul, Nat.cast_ofNat] at hih + linarith + · cases h with + | zero => contradiction + | succ h => + dsimp [heightShift, wordScale] at hE ⊢ + have hih := ih h H hE + rw [Nat.pow_succ, Nat.cast_mul, Nat.cast_ofNat] + linarith + · cases h with + | zero => contradiction + | succ h => + dsimp [heightShift, wordScale] at hE ⊢ + have hih := ih h H hE + rw [Nat.pow_succ, Nat.cast_mul, Nat.cast_ofNat] + linarith +def splitLastVRev : WordList -> WordList -> Option (WordList × WordList) + | [], _ => none + | V :: u, ds => some (u.reverseAux [V], ds) + | w :: u, ds => splitLastVRev u (w :: ds) +theorem splitLastVRev_sound (u : WordList) : + ∀ (ds p tail : WordList), splitLastVRev u ds = some (p, tail) -> + ds.all isDigitWord = true -> + u.reverseAux ds = p ++ tail /\ tail.all isDigitWord = true := by + induction u with + | nil => intro ds p tail hE _; contradiction + | cons w u ih => + intro ds p tail hE hD + cases w + · dsimp [splitLastVRev] at hE + injection hE with h1; injection h1 with h1 h2; subst h1; subst h2 + refine ⟨?_, hD⟩ + simp [List.reverseAux_eq] + · dsimp [splitLastVRev] at hE + have hD' : (K :: ds).all isDigitWord = true := by simp [isDigitWord, hD] + exact ih (K :: ds) p tail hE hD' + · dsimp [splitLastVRev] at hE + have hD' : (Q :: ds).all isDigitWord = true := by simp [isDigitWord, hD] + exact ih (Q :: ds) p tail hE hD' +def splitPrefixDigits (u : WordList) : Option (WordList × WordList) := + splitLastVRev u.reverse [] +theorem splitPrefixDigits_sound (u p ds : WordList) (hE : splitPrefixDigits u = some (p, ds)) : + u = p ++ ds /\ ds.all isDigitWord = true := by + rcases splitLastVRev_sound u.reverse [] p ds hE rfl with ⟨hU, hD⟩ + simp only [List.reverseAux_eq, List.append_nil, List.reverse_reverse] at hU + exact ⟨hU, hD⟩ +theorem replicate_reverse (n : Nat) (w : Word) : (List.replicate n w).reverse = + List.replicate n w := by + induction n with + | zero => rfl + | succ n ih => + conv_lhs => rw [replicate_succ_append, List.reverse_append, ih] + rfl +def startsWithKOrNil : WordList -> Bool + | [] => true + | K :: _ => true + | V :: _ => false + | Q :: u => !startsWithKOrNil u +def modFourDigit (k : Nat) : Word := + if (k - 2) % 4 == 0 then K else Q +def evalPhaseScan : Nat -> WordList -> Nat -> Option (Nat × WordList) + | 0, _, _ => none + | _ + 1, [], k => some (k, []) + | fuel + 1, V :: u, k => + if k < 3 then none + else forceNat (2 + (k - 3) * 2) (fun m => match evalPhaseScan fuel u m with + | none => none + | some (k', v) => some (k', V :: v)) + | fuel + 1, K :: u, k => + if k < 2 || k % 2 != 0 then none + else + forceNat (((k - 2) / 4) * 2) (fun m => match evalPhaseScan fuel u m with + | none => none + | some (k', v) => forceWord (modFourDigit k) (fun w => some (k', w :: v))) + | fuel + 1, Q :: u, k => + if k == 0 then none + else if k % 2 == 0 && startsWithKOrNil (Q :: u) then + forceNat (1 + ((k - 2) / 4) * 2) (fun m => match evalPhaseScan fuel u m with + | none => none + | some (k', v) => forceWord (modFourDigit k) (fun w => some (k', w :: v))) + else match u with + | K :: u' => + forceNat ((k - 1) * 2) (fun m => match evalPhaseScan fuel u' m with + | none => none + | some (k', v) => some (k', V :: v)) + | Q :: u' => + forceNat (1 + (k - 1) * 2) (fun m => match evalPhaseScan fuel u' m with + | none => none + | some (k', v) => some (k', V :: v)) + | _ => none +theorem evalPhaseScan_sound (fuel : Nat) : + ∀ (u : WordList) (k k' : Nat) (v : WordList), + evalPhaseScan fuel u k = some (k', v) -> + ∃ a b, PhaseScan k u k' v a b := by + induction fuel with + | zero => intro u k k' v h; contradiction + | succ fuel ih => + intro u k k' v h + cases u with + | nil => + dsimp [evalPhaseScan, forceNat_eq] at h + injection h with h; injection h with hk hv; subst hk; subst hv + exact ⟨0, 0, PhaseScan.nil k⟩ + | cons w u => + cases w with + | V => + dsimp [evalPhaseScan, forceNat_eq] at h + split_ifs at h with hk + cases hrec : evalPhaseScan fuel u (2 + (k - 3) * 2) with + | none => rw [hrec] at h; contradiction + | some kv => + rw [hrec] at h + rcases kv with ⟨k0, v0⟩ + injection h with h; injection h with hk' hv'; subst hk'; subst hv' + rcases ih u (2 + (k - 3) * 2) k0 v0 hrec with ⟨a, b, hSub⟩ + have heq : k = 3 + (k - 3) := by omega + rw [heq]; exact ⟨a * (1 / 2), b * (1 / 2), PhaseScan.T hSub⟩ + | K => + dsimp [evalPhaseScan, forceNat_eq] at h + split_ifs at h with hk + have hk2 : 2 <= k /\ k % 2 = 0 := by + simp only [Bool.or_eq_true, decide_eq_true_eq, bne_iff_ne, ne_eq, not_or, not_lt, + not_not] at hk + exact hk + cases hrec : evalPhaseScan fuel u (((k - 2) / 4) * 2) with + | none => rw [hrec] at h; contradiction + | some kv => + rw [hrec] at h + rcases kv with ⟨k0, v0⟩ + simp only [forceWord_eq] at h + injection h with h; injection h with hk' hv'; subst hk'; subst hv' + rcases ih u (((k - 2) / 4) * 2) k0 v0 hrec with ⟨a, b, hSub⟩ + unfold modFourDigit + have hmod4 : (k - 2) % 4 = 0 \/ (k - 2) % 4 = 2 := by omega + rcases hmod4 with hm | hm + · have hc : ((k - 2) % 4 == 0) = true := beq_iff_eq.mpr hm + rw [hc] + have heq : k = 2 + ((k - 2) / 4) * 4 := by omega + rw [heq]; exact ⟨3 + a * 2, b * 2, PhaseScan.short00 hSub⟩ + · have hc : ((k - 2) % 4 == 0) = false := beq_false_of_ne (by omega) + rw [hc] + have heq : k = 4 + ((k - 2) / 4) * 4 := by omega + rw [heq]; exact ⟨4 + a * 2, b * 2, PhaseScan.short10 hSub⟩ + | Q => + dsimp [evalPhaseScan, forceNat_eq] at h + split_ifs at h with hk0 hks + · have hk2 : 2 <= k /\ k % 2 = 0 := by + simp only [beq_iff_eq] at hk0 + simp only [Bool.and_eq_true, beq_iff_eq] at hks + omega + cases hrec : evalPhaseScan fuel u (1 + ((k - 2) / 4) * 2) with + | none => rw [hrec] at h; contradiction + | some kv => + rw [hrec] at h + rcases kv with ⟨k0, v0⟩ + simp only [forceWord_eq] at h + injection h with h; injection h with hk' hv'; subst hk'; subst hv' + rcases ih u (1 + ((k - 2) / 4) * 2) k0 v0 hrec with ⟨a, b, hSub⟩ + unfold modFourDigit + have hmod4 : (k - 2) % 4 = 0 \/ (k - 2) % 4 = 2 := by omega + rcases hmod4 with hm | hm + · have hc : ((k - 2) % 4 == 0) = true := beq_iff_eq.mpr hm + rw [hc] + have heq : k = 2 + ((k - 2) / 4) * 4 := by omega + rw [heq]; exact ⟨2 + a * 2, b * 2, PhaseScan.short01 hSub⟩ + · have hc : ((k - 2) % 4 == 0) = false := beq_false_of_ne (by omega) + rw [hc] + have heq : k = 4 + ((k - 2) / 4) * 4 := by omega + rw [heq]; exact ⟨3 + a * 2, b * 2, PhaseScan.short11 hSub⟩ + · have hk_pos : 1 <= k := by simp only [beq_iff_eq] at hk0; omega + cases u with + | nil => contradiction + | cons w2 u' => + cases w2 with + | V => contradiction + | K => + dsimp [forceNat_eq] at h + cases hrec : evalPhaseScan fuel u' ((k - 1) * 2) with + | none => rw [hrec] at h; contradiction + | some kv => + rw [hrec] at h + rcases kv with ⟨k0, v0⟩ + injection h with h; injection h with hk' hv'; subst hk'; subst hv' + rcases ih u' ((k - 1) * 2) k0 v0 hrec with ⟨a, b, hSub⟩ + have heq : k = 1 + (k - 1) := by omega + rw [heq]; exact ⟨a * (1 / 2), (1 + b) * (1 / 2), PhaseScan.pair0 hSub⟩ + | Q => + dsimp [forceNat_eq] at h + cases hrec : evalPhaseScan fuel u' (1 + (k - 1) * 2) with + | none => rw [hrec] at h; contradiction + | some kv => + rw [hrec] at h + rcases kv with ⟨k0, v0⟩ + injection h with h; injection h with hk' hv'; subst hk'; subst hv' + rcases ih u' (1 + (k - 1) * 2) k0 v0 hrec with ⟨a, b, hSub⟩ + have heq : k = 1 + (k - 1) := by omega + rw [heq]; exact ⟨a * (1 / 2), (3 / 4) + b * (1 / 2), PhaseScan.pair1 hSub⟩ +theorem splitLastVRev_ends_with_V (u : WordList) : + ∀ (ds p tail : WordList), splitLastVRev u ds = some (p, tail) -> + ∃ v, p = v ++ [V] := by + induction u with + | nil => intro ds p tail hE; contradiction + | cons w u ih => + intro ds p tail hE + cases w + · dsimp [splitLastVRev] at hE + injection hE with h1; injection h1 with h1 h2; subst h1 + exact ⟨u.reverse, by simp [List.reverseAux_eq]⟩ + · exact ih (K :: ds) p tail hE + · exact ih (Q :: ds) p tail hE +theorem splitPrefixDigits_ends_with_V (u p ds : WordList) (hE : splitPrefixDigits u = some (p, + ds)) : + ∃ v, p = v ++ [V] := + splitLastVRev_ends_with_V u.reverse [] p ds hE +theorem all_isDigitWord_of_digitVal {A H : Nat} {u : WordList} (h : DigitVal A H u) : + u.all isDigitWord = true := by + induction h with + | nil => rfl + | zero _ ih => simp [isDigitWord, ih] + | one _ ih => simp [isDigitWord, ih] +theorem rat_pow_two_pos (n : Nat) : (0 : Rat) < ((2 ^ n : Nat) : Rat) := by + exact_mod_cast pow_two_pos n +theorem wordMass_and_scale_replicate_V (n : Nat) : + wordMass (List.replicate n V) = 0 /\ + wordScale (List.replicate n V) * ((2 ^ n : Nat) : Rat) = 1 := by + induction n with + | zero => simp [wordMass, wordScale] + | succ n ih => + rw [List.replicate_succ, Nat.pow_succ, Nat.cast_mul, Nat.cast_ofNat] + dsimp [wordMass, wordScale] + refine ⟨by linarith [ih.1], ?_⟩ + calc wordScale (List.replicate n V) * (1 / 2) * (((2 ^ n : Nat) : Rat) * 2) + _ = wordScale (List.replicate n V) * ((2 ^ n : Nat) : Rat) := by ring + _ = 1 := ih.2 +theorem wordScale_replicate_V_mul_pow (n : Nat) (x : Rat) : + wordScale (List.replicate n V) * x * ((2 ^ n : Nat) : Rat) = x := by + calc wordScale (List.replicate n V) * x * ((2 ^ n : Nat) : Rat) + _ = (wordScale (List.replicate n V) * ((2 ^ n : Nat) : Rat)) * x := by ring + _ = 1 * x := by rw [(wordMass_and_scale_replicate_V n).2] + _ = x := by ring +theorem wordMassQ_replicate_V (q : Nat) : wordMassQ (List.replicate q V) = 0 := by + induction q with + | zero => simp [wordMassQ] + | succ q ih => rw [List.replicate_succ]; dsimp [wordMassQ]; linarith +theorem exists_phaseScan_twelve (u : WordList) (A H : Nat) (ds : WordList) + (hD : DigitVal A H ds) + (hHeight : wordScale u * ((2 ^ H : Nat) : Rat) = 1) + (hCut : notEndsWithQ u = true) (hNe : u ≠ []) + (hBound : wordMass u + wordScale u * (1 + wordMassK ds) <= 1 / 128) : + ∃ k v a b, PhaseScan 12 (u ++ ds ++ [K]) k v a b /\ 4 < k := by + have hWu := wordMass_nonneg u + have hWd := wordMass_nonneg ds + have hSu := wordScale_pos u + have hMu : wordMass u <= 1 / 128 := by nlinarith + rcases exists_phaseScan_of_mass_lt u 6 (by push_cast; linarith) with ⟨k0, v, a, b, hI, hK0⟩ + rcases phaseScan_even_out_of_notEndsWithQ hI hCut hNe with ⟨n, rfl⟩ + have hBudget := phaseScan_budget_eq hI + have hLoss := phaseScan_loss_bounds hI + have hSv := phaseScan_scale_le hI + have hPv := wordScale_pos v + have hCarry : 7 < (((n * 2 : Nat) : Rat) - 4) * wordScale v := by + push_cast at hBudget ⊢; linarith + rcases digitVal_scale_and_mass hD with ⟨hSd, hMd, hOd⟩ + have hRest : 2 * (wordMass (ds ++ [K]) + wordMassK (ds ++ [K])) * wordScale v < 7 := by + rw [wordMass_append, wordMassK_append] + dsimp [wordMass, wordMassK] + have h1 : wordScale u * wordMassK ds <= 1 / 128 := by nlinarith + have h2 : wordScale u * (3 * wordScale ds - 1 + wordMassK ds) < 4 := by nlinarith + have h3 : 0 <= 3 * wordScale ds - 1 + wordMassK ds := by linarith + nlinarith + have hLoss2 : 8 * (1 + 2 * wordMassK ds) * wordScale v < 1 := by + have h1 : wordScale u * wordMassK ds <= 1 / 128 := by nlinarith + have h2 : wordScale u <= 1 / 128 := by nlinarith + nlinarith + rcases scan_tailDefect_step_bound (ds ++ + [K]) (wordMassK ds) n (tailDefect_append_K_of_digitVal hD) + (by nlinarith) (by nlinarith) with ⟨k, w, c, d, hJ, hK'⟩ + rcases phaseScan_append hI hJ with ⟨a', b', hS, _, _⟩ + rw [<- List.append_assoc] at hS + exact ⟨k, v ++ w, a', b', hS, hK'⟩ +theorem scan_odd_Q_K_tailDefect (r a b : Nat) (v : WordList) (l : Rat) (u : WordList) (z : Rat) + (hI : Scan a ((List.replicate (1 + r * 2) Q ++ [K]) ++ u) b v l) + (hZ : TailDefect u z) : + wordMass v * ((2 ^ (1 + r) : Nat) : Rat) <= 1 + 2 * z /\ + (l - 1 / 2) * ((2 ^ (1 + r) : Nat) : Rat) <= 1 + 2 * z := by + have hCut : SplitCond (List.replicate (1 + r * 2) Q ++ [K]) u := by + left; rw [notEndsWithQ_append_singleton]; rfl + rcases scan_split_of_splitCond hI (List.replicate (1 + r * 2) Q ++ [K]) u rfl hCut + with ⟨c, x, y, s, t0, hJ, hK, rfl, hL⟩ + rcases scan_odd_Q_K_inv r a c x s hJ with ⟨rfl, _, rfl⟩ + have hTB := scan_tailDefect_bound hK hZ + have hRT := wordMass_and_scale_replicate_V (1 + r) + have hRF1 := wordScale_replicate_V_mul_pow (1 + r) (wordMass y) + have hRF2 := wordScale_replicate_V_mul_pow (1 + r) t0 + have hPos := rat_pow_two_pos (1 + r) + rw [wordMass_append] + constructor <;> nlinarith +theorem scan_even_Q_K_tailDefect (r a b : Nat) (v : WordList) (l : Rat) (u : WordList) (z : Rat) + (hI : Scan a ((List.replicate (2 + r * 2) Q ++ [K]) ++ u) b v l) + (hZ : TailDefect u z) : + (wordMass v - 1) * ((2 ^ r : Nat) : Rat) <= 1 + 2 * z /\ + (l - 1) * ((2 ^ r : Nat) : Rat) <= 1 + 2 * z := by + have hCut : SplitCond (List.replicate (2 + r * 2) Q ++ [K]) u := by + left; rw [notEndsWithQ_append_singleton]; rfl + rcases scan_split_of_splitCond hI (List.replicate (2 + r * 2) Q ++ [K]) u rfl hCut + with ⟨c, x, y, s, t0, hJ, hK, rfl, hL⟩ + rcases scan_even_Q_K_inv r a c x s hJ with ⟨d, n, rfl, _, rfl⟩ + have hTB := scan_tailDefect_bound hK hZ + have hSB := scan_mass_bounds hK + have hGe1 : (1 : Rat) <= ((2 ^ r : Nat) : Rat) := by exact_mod_cast pow_two_pos r + have hWy := wordMass_nonneg y + set sc := wordScale (List.replicate (1 + r) V) + have hMrep : wordMass (List.replicate (1 + r) V ++ y) = sc * wordMass y := by + rw [wordMass_append, (wordMass_and_scale_replicate_V (1 + r)).1, zero_add] + have hRF1 := wordScale_replicate_V_mul_pow (1 + r) (wordMass y) + have hRF2 := wordScale_replicate_V_mul_pow (1 + r) t0 + have hpow : ((2 ^ (1 + r) : Nat) : Rat) = ((2 ^ r : Nat) : Rat) * 2 := by + rw [pow_two_one_add]; push_cast; ring + rw [hpow] at hRF1 hRF2 + have hRF1' : sc * wordMass y * ((2 ^ r : Nat) : Rat) = wordMass y * (1 / 2) := by + change wordScale (List.replicate (1 + r) V) * wordMass y * ((2 ^ r : Nat) : Rat) = + wordMass y * (1 / 2) + linarith [hRF1] + have hRF2' : sc * t0 * ((2 ^ r : Nat) : Rat) = t0 * (1 / 2) := by + change wordScale (List.replicate (1 + r) V) * t0 * ((2 ^ r : Nat) : Rat) = t0 * (1 / 2) + linarith [hRF2] + simp only [List.cons_append] + cases d with + | V => + change l = 1 + (sc * (1 / 2)) * t0 at hL + have hM : wordMass (V :: (List.replicate (1 + r) V ++ y)) = (sc * wordMass y) * (1 / 2) := by + dsimp [wordMass]; rw [hMrep] + rw [hM, hL] + have h1 : ((sc * wordMass y) * (1 / 2) - 1) * ((2 ^ r : Nat) : Rat) = + (sc * wordMass y * ((2 ^ r : Nat) : Rat)) * (1 / 2) - ((2 ^ r : Nat) : Rat) := by ring + have h2 : (1 + (sc * (1 / 2)) * t0 - 1) * ((2 ^ r : Nat) : Rat) = + (sc * t0 * ((2 ^ r : Nat) : Rat)) * (1 / 2) := by ring + rw [h1, h2, hRF1', hRF2'] + constructor <;> linarith [hWy.1, hSB.1, hGe1, hTB.1, hTB.2.1] + | K => + change l = 1 + (sc * 2) * t0 at hL + have hM : wordMass (K :: (List.replicate (1 + r) V ++ y)) = 1 + (sc * wordMass y) * 2 := by + dsimp [wordMass]; rw [hMrep] + rw [hM, hL] + have h1 : (1 + (sc * wordMass y) * 2 - 1) * ((2 ^ r : Nat) : Rat) = + (sc * wordMass y * ((2 ^ r : Nat) : Rat)) * 2 := by ring + have h2 : (1 + (sc * 2) * t0 - 1) * ((2 ^ r : Nat) : Rat) = + (sc * t0 * ((2 ^ r : Nat) : Rat)) * 2 := by ring + rw [h1, h2, hRF1', hRF2'] + constructor <;> linarith [hWy.1, hSB.1, hGe1, hTB.1, hTB.2.1] + | Q => + change l = 1 + (sc * 2) * t0 at hL + have hM : wordMass (Q :: (List.replicate (1 + r) V ++ y)) = 1 + (sc * wordMass y) * 2 := by + dsimp [wordMass]; rw [hMrep] + rw [hM, hL] + have h1 : (1 + (sc * wordMass y) * 2 - 1) * ((2 ^ r : Nat) : Rat) = + (sc * wordMass y * ((2 ^ r : Nat) : Rat)) * 2 := by ring + have h2 : (1 + (sc * 2) * t0 - 1) * ((2 ^ r : Nat) : Rat) = + (sc * t0 * ((2 ^ r : Nat) : Rat)) * 2 := by ring + rw [h1, h2, hRF1', hRF2'] + constructor <;> linarith [hWy.1, hSB.1, hGe1, hTB.1, hTB.2.1] +theorem scan_replicate_Q_K_tailDefect (c a b : Nat) (v : WordList) (l : Rat) (u : WordList) (z : + Rat) + (hI : Scan a ((List.replicate c Q ++ [K]) ++ u) b v l) + (hZ : TailDefect u z) (hC : 0 < c) : + wordMass v * ((2 ^ (c + c / 2) : Nat) : Rat) <= + ((2 ^ (c + c / 2) : Nat) : Rat) + 2 * ((2 ^ c : Nat) : Rat) * (1 + 2 * z) /\ + l * ((2 ^ (c + c / 2) : Nat) : Rat) <= + ((2 ^ (c + c / 2) : Nat) : Rat) + 2 * ((2 ^ c : Nat) : Rat) * (1 + 2 * z) := by + have hZn := tailDefect_nonneg hZ + rcases even_or_odd_mul_two c with ⟨a0, rfl⟩ | ⟨a0, rfl⟩ + · cases a0 with + | zero => omega + | succ r => + have heq : (r + 1) * 2 = 2 + r * 2 := by omega + rw [heq] at hI ⊢ + have hEven := scan_even_Q_K_tailDefect r a b v l u z hI hZ + have hP : 2 + r * 2 + (2 + r * 2) / 2 = (2 + r * 2) + r + 1 := by omega + have hPow : ((2 ^ (2 + r * 2 + (2 + r * 2) / 2) : Nat) : Rat) = + ((2 ^ (2 + r * 2) : Nat) : Rat) * ((2 ^ r : Nat) : Rat) * 2 := by + rw [hP, Nat.pow_add, Nat.pow_add]; push_cast; ring + have hPos1 := rat_pow_two_pos (2 + r * 2) + have hPos2 := rat_pow_two_pos r + rw [hPow] + constructor <;> nlinarith + · have hOdd := scan_odd_Q_K_tailDefect a0 a b v l u z hI hZ + have hP : 1 + a0 * 2 + (1 + a0 * 2) / 2 = (1 + a0 * 2) + a0 := by omega + have hPow : ((2 ^ (1 + a0 * 2 + (1 + a0 * 2) / 2) : Nat) : Rat) = + ((2 ^ (1 + a0 * 2) : Nat) : Rat) * ((2 ^ a0 : Nat) : Rat) := by + rw [hP, Nat.pow_add]; push_cast; ring + have hPow1 : ((2 ^ (1 + a0) : Nat) : Rat) = ((2 ^ a0 : Nat) : Rat) * 2 := by + rw [pow_two_one_add]; push_cast; ring + rw [hPow1] at hOdd + have hPos1 := rat_pow_two_pos (1 + a0 * 2) + have hPos2 := rat_pow_two_pos a0 + rw [hPow] + constructor <;> nlinarith +theorem tailDefect_replicate_Q_append_inv (c : Nat) : + ∀ (u : WordList) (z : Rat), TailDefect (List.replicate c Q ++ u) z -> + ∃ z', TailDefect u z' /\ z = ((2 ^ c : Nat) : Rat) * z' := by + induction c with + | zero => + intro u z hI + exact ⟨z, hI, by simp⟩ + | succ c ih => + intro u z hI + rw [List.replicate_succ, List.cons_append] at hI + rcases tailDefect_cons_Q_inv hI with ⟨y, hJ, rfl⟩ + rcases ih u y hJ with ⟨x, hK, rfl⟩ + refine ⟨x, hK, ?_⟩ + rw [Nat.pow_succ]; push_cast; ring +theorem mul_le_add_of_le (x z p q : Rat) (hp : 0 < p) (hpq : p <= q) (hz : 0 <= z) + (h : x * q <= q + 2 * z) : x * p <= p + 2 * z := by + by_cases hx : x <= 1 + · nlinarith + · nlinarith +theorem scan_digitVal_carry_bound (s c : Nat) (u : WordList) (A H a b : Nat) (v : WordList) (l : + Rat) + (hD : DigitVal A H (List.replicate c Q ++ K :: u)) + (hI : Scan a ((List.replicate c Q ++ K :: u) ++ [K]) b v l) + (hC : 0 < c) (hSC : s <= c) : + wordMass v * ((2 ^ (s + s / 2) : Nat) : Rat) <= + ((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK (List.replicate c Q ++ K :: u) /\ + l * ((2 ^ (s + s / 2) : Nat) : Rat) <= + ((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK (List.replicate c Q ++ K :: u) := by + have hZ := tailDefect_append_K_of_digitVal hD + rw [List.append_assoc] at hZ + rcases tailDefect_replicate_Q_append_inv c (K :: u ++ [K]) (wordMassK (List.replicate c Q ++ + K :: u)) hZ with ⟨x, hU, hX⟩ + rcases tailDefect_cons_K_inv hU with ⟨hNil, _⟩ | ⟨z, hV, rfl⟩ + · simp at hNil + · have hE : (List.replicate c Q ++ K :: u) ++ [K] = + (List.replicate c Q ++ [K]) ++ (u ++ [K]) := by simp [List.append_assoc] + rw [hE] at hI + rcases scan_replicate_Q_K_tailDefect c a b v l (u ++ [K]) z hI hV hC with ⟨hM, hL⟩ + have hPos := rat_pow_two_pos (s + s / 2) + have hMono : ((2 ^ (s + s / 2) : Nat) : Rat) <= ((2 ^ (c + c / 2) : Nat) : Rat) := by + exact_mod_cast Nat.pow_le_pow_right (by omega) (by omega) + have hW := wordMass_nonneg (List.replicate c Q ++ K :: u) + constructor + · exact mul_le_add_of_le (wordMass v) (wordMassK (List.replicate c Q ++ + K :: u)) _ _ hPos hMono hW.2.1 (by nlinarith) + · exact mul_le_add_of_le l (wordMassK (List.replicate c Q ++ + K :: u)) _ _ hPos hMono hW.2.1 (by nlinarith) +theorem phaseScan_digitVal_carry_bound (s : Nat) (ds : WordList) (A H k k' : Nat) (v : WordList) (a + b : Rat) + (hD : DigitVal A H ds) (hI : PhaseScan k (ds ++ [K]) k' v a b) + (hLow : ∃ c u, (0 < c /\ s <= c) /\ ds = List.replicate c Q ++ K :: u) : + wordMass v * ((2 ^ (s + s / 2) : Nat) : Rat) <= + ((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK ds /\ + a * ((2 ^ (s + s / 2) : Nat) : Rat) <= + 4 * (((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK ds) /\ + b * ((2 ^ (s + s / 2) : Nat) : Rat) <= + 3 * (((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK ds) := by + rcases hLow with ⟨c, u, ⟨hC, hSC⟩, rfl⟩ + have hFull := digitVal_append hD (DigitVal.zero DigitVal.nil) + rcases phaseScan_digitVal_loss_bound hI hFull with ⟨l, hJ, hP, hN⟩ + have hCore := scan_digitVal_carry_bound s c u A H k k' v l hD hJ hC hSC + have hPos := rat_pow_two_pos (s + s / 2) + refine ⟨hCore.1, by nlinarith, by nlinarith⟩ +theorem divisibility_carry_step (r J k b A B : Nat) (hR : r <= J) + (hK : ∃ n, k = n * 2 ^ r) (hB0 : ∃ n, 1 + b = n * 2 ^ r) + (hAsum : A + 2 ^ J = k) (hBsum : B + 2 ^ J = A + b) : + ∃ n, 1 + B = n * 2 ^ r := by + rcases hK with ⟨n, rfl⟩ + rcases hB0 with ⟨m, hM⟩ + have hP : 2 ^ J = 2 ^ (J - r) * 2 ^ r := by + rw [<- Nat.pow_add, Nat.sub_add_cancel hR] + refine ⟨n + m - 2 * 2 ^ (J - r), ?_⟩ + have hpos := pow_two_pos r + have hle : 2 * 2 ^ (J - r) <= n + m := by + have h1 : (2 * 2 ^ (J - r)) * 2 ^ r <= (n + m) * 2 ^ r := by + calc (2 * 2 ^ (J - r)) * 2 ^ r = 2 ^ J + 2 ^ J := by rw [hP]; ring + _ <= n * 2 ^ r + (1 + b) := by omega + _ = (n + m) * 2 ^ r := by rw [hM]; ring + exact Nat.le_of_mul_le_mul_right h1 hpos + rw [Nat.sub_mul] + have h2 : 2 * 2 ^ (J - r) * 2 ^ r = 2 ^ J + 2 ^ J := by rw [hP]; ring + have h3 : (n + m) * 2 ^ r = n * 2 ^ r + (1 + b) := by rw [hM]; ring + omega +theorem digitVal_low_ones_prefix (s : Nat) : + ∀ (B H : Nat) (ds : WordList), DigitVal B H ds -> s <= H -> + (∃ n, 1 + B = n * 2 ^ s) -> ∃ u, ds = List.replicate s Q ++ u := by + induction s with + | zero => + intro B H ds _ _ _ + exact ⟨ds, rfl⟩ + | succ s ih => + intro B H ds hD hSH ⟨n, hN⟩ + have hpow : 2 ^ (s + 1) = 2 ^ s * 2 := Nat.pow_succ 2 s + cases hD with + | nil => omega + | @zero A H' u hSub => + rw [hpow] at hN + have hN2 : 1 + A * 2 = (n * 2 ^ s) * 2 := by rw [hN]; ring + omega + | @one A H' u hSub => + rw [hpow] at hN + have hN2 : 1 + (1 + A * 2) = (n * 2 ^ s) * 2 := by rw [hN]; ring + have hN' : 1 + A = n * 2 ^ s := by omega + rcases ih A H' u hSub (by omega) ⟨n, hN'⟩ with ⟨w, rfl⟩ + refine ⟨w, ?_⟩ + rw [List.replicate_succ, List.cons_append] +theorem phaseScan_effect_split (r k : Nat) (u : WordList) (k' : Nat) (v : WordList) (a b : Rat) + (carry : Nat) (eff : WordList) (A B J : Nat) (ds : WordList) + (hI : PhaseScan k (u ++ List.replicate (1 + r * 2) Q ++ [K]) k' v a b) + (hE : WordEffect 0 (V :: (v ++ [V])) carry eff) + (hD : DigitVal B J ds) (hR : 1 + r <= J) + (hAsum : A + 2 ^ J = k') (hBsum : B + 2 ^ J = A + carry) : + ∃ w, ds = List.replicate (1 + r) Q ++ w := by + rcases phaseScan_append_odd_Q_K_inv r k u k' v a b hI with ⟨w, n, rfl, hK⟩ + have hEq : V :: ((w ++ List.replicate (1 + r) V) ++ [V]) = + (V :: w) ++ List.replicate (2 + r) V := by + have h2 : 2 + r = (1 + r) + 1 := by omega + rw [h2, replicate_succ_append] + simp only [List.cons_append, List.append_assoc] + rw [hEq] at hE + rcases wordEffect_append_replicate_V_inv (V :: w) (2 + r) 0 carry eff hE with ⟨x, m, _, hC⟩ + have hCarry : ∃ n0, 1 + carry = n0 * 2 ^ (1 + r) := by + refine ⟨m * 2, ?_⟩ + have hpow : 2 ^ (2 + r) = 2 * 2 ^ (1 + r) := by + have h2 : 2 + r = 1 + (1 + r) := by omega + rw [h2, pow_two_one_add]; ring + rw [hpow] at hC + calc 1 + carry = m * (2 * 2 ^ (1 + r)) := hC + _ = (m * 2) * 2 ^ (1 + r) := by ring + exact digitVal_low_ones_prefix (1 + r) B J ds hD hR (divisibility_carry_step (1 + + r) J k' carry A B hR ⟨n, hK⟩ hCarry hAsum hBsum) +theorem mul_le_of_CrossMul_le (x p q s f : Rat) (hp : 0 < p) (hs : 0 <= s) + (hxp : x * p <= q) (hsq : s * q <= f * p) : s * x <= f := by + have h1 : (s * x) * p <= f * p := by + calc (s * x) * p = s * (x * p) := by ring + _ <= s * q := mul_le_mul_of_nonneg_left hxp hs + _ <= f * p := hsq + exact le_of_mul_le_mul_right h1 hp +theorem phaseScan_digitVal_weighted_bound (s : Nat) (ds : WordList) (A H k k' : Nat) (v : WordList) + (a b sigma f : Rat) + (hD : DigitVal A H ds) (hI : PhaseScan k (ds ++ [K]) k' v a b) + (hLow : ∃ c u, (0 < c /\ s <= c) /\ ds = List.replicate c Q ++ K :: u) + (hSig : 0 <= sigma) + (hBound : sigma * (((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK ds) <= + f * ((2 ^ (s + s / 2) : Nat) : Rat)) : + sigma * wordMass v <= f /\ sigma * a <= 4 * f /\ sigma * b <= 3 * f := by + rcases phaseScan_digitVal_carry_bound s ds A H k k' v a b hD hI hLow with ⟨hM, hP, hN⟩ + have hPos := rat_pow_two_pos (s + s / 2) + refine ⟨?_, ?_, ?_⟩ + · exact mul_le_of_CrossMul_le (wordMass v) _ _ sigma f hPos hSig hM hBound + · exact mul_le_of_CrossMul_le a _ _ sigma (4 * f) hPos hSig hP (by linarith) + · exact mul_le_of_CrossMul_le b _ _ sigma (3 * f) hPos hSig hN (by linarith) +theorem phaseScan_twelve_scale_eq (u : WordList) (k : Nat) (v : WordList) (a b : Rat) + (hI : PhaseScan 12 u k v a b) : + (k : Rat) * wordScale (V :: (v ++ [V])) = 2 + 4 * wordScale (V :: (v ++ + [V])) - (a - b) * (1 / 2) := by + have hEq := phaseScan_budget_eq hI + dsimp [wordScale] + rw [wordScale_append] + dsimp [wordScale] + push_cast at hEq ⊢ + linarith +theorem phaseScan_twelve_height_sum (u : WordList) (k : Nat) (v : WordList) (a b : Rat) (J A B + carry : Nat) + (hI : PhaseScan 12 u k v a b) + (hHeight : wordScale (V :: (v ++ [V])) * ((2 ^ J : Nat) : Rat) = 1) + (hAsum : A + 2 ^ J = k) (hBsum : B + 2 ^ J = A + carry) : + 1 - ((1 + B : Nat) : Rat) * wordScale (V :: (v ++ [V])) = + (a - b) * (1 / 2) - 4 * wordScale (V :: (v ++ [V])) - + (((1 + carry : Nat) : Rat) * wordScale (V :: (v ++ [V])) - 1) := by + have hBudget := phaseScan_twelve_scale_eq u k v a b hI + have hSum : B + 2 ^ J + 2 ^ J = k + carry := by omega + have hQsum : (B : Rat) + ((2 ^ J : Nat) : Rat) + ((2 ^ J : Nat) : Rat) = + (k : Rat) + (carry : Rat) := by + exact_mod_cast hSum + set s := wordScale (V :: (v ++ [V])) + have hMul : (B : Rat) * s + 1 + 1 = (k : Rat) * s + (carry : Rat) * s := by + calc (B : Rat) * s + 1 + 1 + _ = (B : Rat) * s + (s * ((2 ^ J : Nat) : Rat)) + (s * ((2 ^ J : Nat) : Rat)) := by + rw [hHeight] + _ = ((B : Rat) + ((2 ^ J : Nat) : Rat) + ((2 ^ J : Nat) : Rat)) * s := by ring + _ = ((k : Rat) + (carry : Rat)) * s := by rw [hQsum] + _ = (k : Rat) * s + (carry : Rat) * s := by ring + push_cast + calc 1 - (1 + (B : Rat)) * s + _ = 3 - ((B : Rat) * s + 1 + 1) - s := by ring + _ = 3 - ((k : Rat) * s + (carry : Rat) * s) - s := by rw [hMul] + _ = 3 - ((2 + 4 * s - (a - b) * (1 / 2)) + (carry : Rat) * s) - s := by rw [hBudget] + _ = (a - b) * (1 / 2) - 4 * s - ((1 + (carry : Rat)) * s - 1) := by ring + +end BusyBeaver.WordCalculus diff --git a/BusyBeaver/Calculi/WordCalculusC.lean b/BusyBeaver/Calculi/WordCalculusC.lean new file mode 100644 index 00000000..de84baf4 --- /dev/null +++ b/BusyBeaver/Calculi/WordCalculusC.lean @@ -0,0 +1,1127 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Calculi.WordCalculusB +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +/-! +# Word Calculus Engine C (`BusyBeaver.Calculi.WordCalculusC`) + +Formal word-rewriting calculus for structured tape transformations, +providing verified macro-step reductions and tile segment chains for family C. +-/ + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.WordCalculus +set_option quotPrecheck false +set_option maxRecDepth 4000000 + +variable {α β γ : Type*} +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +private abbrev t : BitWord := [1, 1, 0, 0] +private abbrev d0 : BitWord := [0, 0] +private abbrev d1 : BitWord := [1, 0] +open Word +local notation "WordList" => List Word +inductive Reserve : Nat -> Rat -> Prop where + | even (n : Nat) (tau : Rat) : tau * ((2 ^ n : Nat) : Rat) = 1 -> Reserve ((n + 3) * 2) tau + | odd (n : Nat) (tau : Rat) : tau * ((2 ^ n : Nat) : Rat) = 3 / 4 -> Reserve (1 + (n + 3) * 2) tau +theorem reserve_step_contract {p : Nat} {tau : Rat} (hI : Reserve p tau) : + ∃ tau', Reserve (1 + p) tau' /\ tau' <= (3 / 4) * tau := by + cases hI with + | even n tau hEq => + exact ⟨(3 / 4) * tau, Reserve.odd n ((3 / 4) * tau) (by linarith), le_refl _⟩ + | odd n tau hEq => + have hPos := rat_pow_two_pos n + have hTau : 0 < tau := by nlinarith + refine ⟨(2 / 3) * tau, ?_, by linarith⟩ + have heq : 1 + (1 + (n + 3) * 2) = ((n + 1) + 3) * 2 := by omega + rw [heq] + refine Reserve.even (n + 1) ((2 / 3) * tau) ?_ + rw [Nat.pow_succ, Nat.cast_mul, Nat.cast_ofNat] + linarith +theorem reserve_pos_and_le {p : Nat} {tau : Rat} (hI : Reserve p tau) (hP : 16 <= p) : + 0 < tau /\ tau <= 1 / 32 := by + cases hI with + | even n tau hEq => + have hn : 5 <= n := by omega + have hPos := rat_pow_two_pos n + have hB : (32 : Rat) <= ((2 ^ n : Nat) : Rat) := by + have h1 : 2 ^ 5 <= 2 ^ n := Nat.pow_le_pow_right (by omega) hn + exact_mod_cast h1 + constructor <;> nlinarith + | odd n tau hEq => + have hn : 5 <= n := by omega + have hPos := rat_pow_two_pos n + have hB : (32 : Rat) <= ((2 ^ n : Nat) : Rat) := by + have h1 : 2 ^ 5 <= 2 ^ n := Nat.pow_le_pow_right (by omega) hn + exact_mod_cast h1 + constructor <;> nlinarith +theorem reserve_linear_bound (alpha unit f t0 q tau : Rat) + (ht : 0 < t0) (ha : 0 <= alpha) (_hu : 0 <= unit) + (h1 : 32 * t0 * unit <= alpha) (h2 : 32 * t0 <= q) + (h3 : f * q <= unit * q + 5 * alpha) (h4 : 3 / 4 <= tau * t0) : + f <= alpha * tau * (1 / 4) := by + by_cases hfu : f <= unit + · nlinarith + · nlinarith +theorem reserve_height_bound (p H s : Nat) (alpha unit tau f : Rat) + (hI : Reserve p tau) (hP : 16 <= p) (hH : (3 * p) / 2 + 5 <= H) (hS : s = (p - 2) / 2) + (_hA : 0 < alpha) (hU : 0 < unit) + (hAp : 1 / 2 <= alpha * ((2 ^ p : Nat) : Rat)) + (hUh : unit * ((2 ^ H : Nat) : Rat) = 1) + (hF : f * ((2 ^ (s + s / 2) : Nat) : Rat) <= + unit * ((2 ^ (s + s / 2) : Nat) : Rat) + 5 * alpha) : + f <= alpha * tau * (1 / 4) := by + cases hI with + | even n tau hTau => + have hn : 5 <= n := by omega + have hLow : 32 * ((2 ^ n : Nat) : Rat) <= ((2 ^ (s + s / 2) : Nat) : Rat) := by + have h1 : 2 ^ (5 + n) <= 2 ^ (s + s / 2) := Nat.pow_le_pow_right (by omega) (by omega) + have h2 : 2 ^ (5 + n) = 32 * 2 ^ n := by rw [Nat.pow_add] + rw [h2] at h1; exact_mod_cast h1 + have hHigh : 64 * ((2 ^ ((n + 3) * 2) : Nat) : Rat) * ((2 ^ n : Nat) : Rat) <= + ((2 ^ H : Nat) : Rat) := by + have h1 : 2 ^ (6 + (n + 3) * 2 + n) <= 2 ^ H := Nat.pow_le_pow_right (by omega) (by omega) + have h2 : 2 ^ (6 + (n + 3) * 2 + n) = 64 * 2 ^ ((n + 3) * 2) * 2 ^ n := by + rw [Nat.pow_add, Nat.pow_add] + rw [h2] at h1; exact_mod_cast h1 + have hPosN := rat_pow_two_pos n + have hPosP := rat_pow_two_pos ((n + 3) * 2) + have hGap : 32 * ((2 ^ n : Nat) : Rat) * unit <= alpha := by nlinarith + exact reserve_linear_bound alpha unit f ((2 ^ n : Nat) : Rat) ((2 ^ (s + + s / 2) : Nat) : Rat) tau + hPosN (by linarith) (by linarith) hGap hLow hF (by linarith) + | odd n tau hTau => + have hn : 5 <= n := by omega + have hLow : 32 * ((2 ^ n : Nat) : Rat) <= ((2 ^ (s + s / 2) : Nat) : Rat) := by + have h1 : 2 ^ (5 + n) <= 2 ^ (s + s / 2) := Nat.pow_le_pow_right (by omega) (by omega) + have h2 : 2 ^ (5 + n) = 32 * 2 ^ n := by rw [Nat.pow_add] + rw [h2] at h1; exact_mod_cast h1 + have hHigh : 64 * ((2 ^ (1 + (n + 3) * 2) : Nat) : Rat) * ((2 ^ n : Nat) : Rat) <= + ((2 ^ H : Nat) : Rat) := by + have h1 : 2 ^ (6 + (1 + (n + 3) * 2) + n) <= 2 ^ H := + Nat.pow_le_pow_right (by omega) (by omega) + have h2 : 2 ^ (6 + (1 + (n + 3) * 2) + n) = 64 * 2 ^ (1 + (n + 3) * 2) * 2 ^ n := by + rw [Nat.pow_add, Nat.pow_add] + rw [h2] at h1; exact_mod_cast h1 + have hPosN := rat_pow_two_pos n + have hPosP := rat_pow_two_pos (1 + (n + 3) * 2) + have hGap : 32 * ((2 ^ n : Nat) : Rat) * unit <= alpha := by nlinarith + exact reserve_linear_bound alpha unit f ((2 ^ n : Nat) : Rat) ((2 ^ (s + + s / 2) : Nat) : Rat) tau + hPosN (by linarith) (by linarith) hGap hLow hF (by linarith) +theorem reserve_index_arith (p : Nat) (hP : 16 <= p) : + (3 * (p + 1)) / 2 + 5 <= 1 + 3 * (((p - 2) / 2 + 1) / 2) + 3 * ((p - 1) / 2) := by + omega +theorem reserve_next_step_bound (alpha tau tau' e f e' : Rat) (hA : 0 <= alpha) + (hTau : tau' <= (3 / 4) * tau) (hE : e <= alpha * ((3 / 64) - tau)) + (hF : f <= alpha * tau * (1 / 4)) (hE' : e' <= (e + f) * (1 / 2)) : + e' <= (alpha * (1 / 2)) * ((3 / 64) - tau') := by + nlinarith +theorem phaseScan_scale_pow_eight {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (hI : PhaseScan k u k' v a b) : + ∃ g : Nat, wordScale u = wordScale v * ((8 ^ g : Nat) : Rat) /\ u.length = v.length + g := by + induction hI with + | nil _ => exact ⟨0, by simp [wordScale], rfl⟩ + | T _ ih => + rcases ih with ⟨g, hE, hL⟩ + exact ⟨g, by dsimp [wordScale]; rw [hE]; ring, by simp; omega⟩ + | pair0 _ ih => + rcases ih with ⟨g, hE, hL⟩ + refine ⟨g + 1, ?_, by simp; omega⟩ + rw [Nat.pow_succ, Nat.cast_mul, Nat.cast_ofNat]; dsimp [wordScale]; rw [hE]; ring + | pair1 _ ih => + rcases ih with ⟨g, hE, hL⟩ + refine ⟨g + 1, ?_, by simp; omega⟩ + rw [Nat.pow_succ, Nat.cast_mul, Nat.cast_ofNat]; dsimp [wordScale]; rw [hE]; ring + | short00 _ ih => + rcases ih with ⟨g, hE, hL⟩ + exact ⟨g, by dsimp [wordScale]; rw [hE]; ring, by simp; omega⟩ + | short01 _ ih => + rcases ih with ⟨g, hE, hL⟩ + exact ⟨g, by dsimp [wordScale]; rw [hE]; ring, by simp; omega⟩ + | short10 _ ih => + rcases ih with ⟨g, hE, hL⟩ + exact ⟨g, by dsimp [wordScale]; rw [hE]; ring, by simp; omega⟩ + | short11 _ ih => + rcases ih with ⟨g, hE, hL⟩ + exact ⟨g, by dsimp [wordScale]; rw [hE]; ring, by simp; omega⟩ +theorem phaseScan_length_le {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (hI : PhaseScan k u k' v a b) : v.length <= u.length := by + rcases phaseScan_scale_pow_eight hI with ⟨g, _, hL⟩ + omega +theorem scan_replicate_Q_K_length (c k k' : Nat) (v : WordList) (l : Rat) (hC : 0 < c) + (hI : Scan k (List.replicate c Q ++ [K]) k' v l) : + v.length + (c + 1) / 2 = c + 1 := by + rcases even_or_odd_mul_two c with ⟨r, rfl⟩ | ⟨r, rfl⟩ + · cases r with + | zero => omega + | succ r => + have heq : (r + 1) * 2 = 2 + r * 2 := by omega + rw [heq] at hI ⊢ + rcases scan_even_Q_K_inv r k k' v l hI with ⟨d, n, rfl, _, _⟩ + simp; omega + · rcases scan_odd_Q_K_inv r k k' v l hI with ⟨rfl, _, _⟩ + simp; omega +theorem phaseScan_replicate_Q_K_length (c k k' : Nat) (v : WordList) (a b : Rat) (hC : 0 < c) + (hI : PhaseScan k (List.replicate c Q ++ [K]) k' v a b) : + v.length + (c + 1) / 2 = c + 1 := by + have hD := digitVal_append (digitVal_replicate_Q c) (DigitVal.zero DigitVal.nil) + rcases phaseScan_digitVal_loss_bound hI hD with ⟨l, hJ, _, _⟩ + exact scan_replicate_Q_K_length c k k' v l hC hJ +theorem phaseScan_mid_length_bound (k : Nat) (u : WordList) (c : Nat) (mid : WordList) (t0 k' : Nat) + (v : WordList) (a b : Rat) + (hC : 0 < c) (hT : 0 < t0) (hU : notEndsWithQ u = true) (hM : notEndsWithQ mid = true) + (hI : PhaseScan k (u ++ List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ + [K])) k' v a b) : + ∃ g : Nat, + wordScale (u ++ List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ [K])) = + wordScale v * ((8 ^ g : Nat) : Rat) /\ + (c + 1) / 2 + (t0 + 1) / 2 <= g := by + rcases phaseScan_scale_pow_eight hI with ⟨g, hG, hL⟩ + refine ⟨g, hG, ?_⟩ + have hEq0 : u ++ List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ [K]) = + u ++ (List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ [K])) := by + simp [List.append_assoc] + rw [hEq0] at hI + rcases phaseScan_split_of_splitCond hI u _ rfl (Or.inl hU) with ⟨m, x, y, a1, b1, a2, b2, hJ, + hK, hV, _, _⟩ + have hSplit : List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ [K]) = + (List.replicate c Q ++ [K]) ++ (mid ++ List.replicate t0 Q ++ [K]) := by + simp [List.append_assoc] + rcases phaseScan_split_of_splitCond hK (List.replicate c Q ++ + [K]) _ hSplit (Or.inl (by rw [notEndsWithQ_append_singleton]; rfl)) + with ⟨m1, x1, y1, a3, b3, a4, b4, hJ1, hK1, hV1, _, _⟩ + have hSplit2 : mid ++ List.replicate t0 Q ++ [K] = mid ++ (List.replicate t0 Q ++ [K]) := by + simp [List.append_assoc] + rcases phaseScan_split_of_splitCond hK1 mid (List.replicate t0 Q ++ [K]) hSplit2 (Or.inl hM) + with ⟨m2, x2, y2, a5, b5, a6, b6, hJ2, hK2, hV2, _, _⟩ + have hL1 := phaseScan_length_le hJ + have hL2 := phaseScan_length_le hJ2 + have hO1 := phaseScan_replicate_Q_K_length c m m1 x1 a3 b3 hC hJ1 + have hO2 := phaseScan_replicate_Q_K_length t0 m2 k' y2 a6 b6 hT hK2 + rw [hV, hV1, hV2] at hL + simp only [List.length_append, List.length_replicate, List.length_cons, List.length_nil] at hL + omega +theorem phaseScan_digitVal_length_bound (u ds : WordList) (A H k k' : Nat) (v : WordList) (a b : + Rat) + (p c : Nat) (mid : WordList) (t0 : Nat) + (hD : DigitVal A H ds) (hHeight : wordScale u * ((2 ^ H : Nat) : Rat) = 1) + (hI : PhaseScan k (u ++ ds ++ [K]) k' v a b) + (hU : notEndsWithQ u = true) (hM : notEndsWithQ mid = true) + (hDs : ds = List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q)) + (hP : 16 <= p) (hC : (p - 2) / 2 <= c) (hT : p - 2 <= t0) : + ∃ J : Nat, (3 * (p + 1)) / 2 + 5 <= J /\ + wordScale (V :: (v ++ [V])) * ((2 ^ J : Nat) : Rat) = 1 := by + have hEq : u ++ ds ++ [K] = + u ++ List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ [K]) := by + rw [hDs]; simp [List.append_assoc] + have hI' : PhaseScan k (u ++ List.replicate c Q ++ K :: (mid ++ List.replicate t0 Q ++ + [K])) k' v a b := by + rwa [<- hEq] + rcases phaseScan_mid_length_bound k u c mid t0 k' v a b (by omega) (by omega) hU hM hI' with ⟨g, + hGain, hCount⟩ + refine ⟨1 + 3 * g, ?_, ?_⟩ + · have hArith := reserve_index_arith p hP + omega + · rw [<- hEq] at hGain + have hWidth := (digitVal_scale_and_mass hD).1 + rw [wordScale_append, wordScale_append] at hGain + dsimp [wordScale] at hGain + rw [hWidth] at hGain + dsimp [wordScale] + rw [wordScale_append] + dsimp [wordScale] + have hPow8 : ((2 ^ (1 + 3 * g) : Nat) : Rat) = 2 * ((8 ^ g : Nat) : Rat) := by + have h8 : 2 ^ (1 + 3 * g) = 2 * (2 ^ 3) ^ g := by + rw [pow_two_one_add, Nat.pow_mul]; ring + rw [h8]; push_cast; ring + rw [hPow8] + nlinarith +theorem scale_ratio_pow_two (p H : Nat) (alpha unit : Rat) (hPH : p <= H) + (hA : alpha * ((2 ^ p : Nat) : Rat) = 1) (hU : unit * ((2 ^ H : Nat) : Rat) = 1) : + unit * ((2 ^ (H - p) : Nat) : Rat) = alpha := by + have hPos := rat_pow_two_pos p + have hEq : 2 ^ H = 2 ^ (H - p) * 2 ^ p := by + rw [<- Nat.pow_add, Nat.sub_add_cancel hPH] + have hEqQ : ((2 ^ H : Nat) : Rat) = ((2 ^ (H - p) : Nat) : Rat) * ((2 ^ p : Nat) : Rat) := by + exact_mod_cast hEq + rw [hEqQ] at hU + nlinarith +theorem digitVal_massK_scale_bound (p H B : Nat) (ds : WordList) (alpha unit : Rat) + (hD : DigitVal B H ds) (hP : 2 <= p) (hPH : p <= H) + (_hA : 0 < alpha) (hU : 0 < unit) (hSmall : unit <= alpha) + (hAp : alpha * ((2 ^ p : Nat) : Rat) = 1) (hUh : unit * ((2 ^ H : Nat) : Rat) = 1) + (hDef : unit * wordMassK ds <= (5 / 2) * alpha) : + ∃ u, ds = u ++ List.replicate (p - 2) Q := by + have hShift : unit * ((2 ^ (H - (p - 2)) : Nat) : Rat) = 4 * alpha := by + have heq : H - (p - 2) = (H - p) + 2 := by omega + rw [heq, Nat.pow_add, Nat.cast_mul] + have h4 : ((2 ^ 2 : Nat) : Rat) = 4 := by norm_num + rw [h4] + have hDS := scale_ratio_pow_two p H alpha unit hPH hAp hUh + linarith + have hZ := digitVal_wordMassK_eq hD + have hD' : DigitVal B ((H - (p - 2)) + (p - 2)) ds := by + have heq : (H - (p - 2)) + (p - 2) = H := by omega + rwa [heq] + refine digitVal_high_ones_suffix (H - (p - 2)) (p - 2) B ds hD' ?_ + have heq : (H - (p - 2)) + (p - 2) = H := by omega + rw [heq] + have hle_q : ((2 ^ H : Nat) : Rat) <= (B : Rat) + ((2 ^ (H - (p - 2)) : Nat) : Rat) := by + nlinarith + exact_mod_cast hle_q +theorem digitVal_pos_massK_split {B H : Nat} {ds : WordList} (hI : DigitVal B H ds) (hZ : 0 < + wordMassK ds) : + ∃ c w, ds = List.replicate c Q ++ K :: w := by + induction hI with + | nil => dsimp [wordMassK] at hZ; linarith + | @zero A H u _ _ => exact ⟨0, u, rfl⟩ + | @one A H u _ ih => + dsimp [wordMassK] at hZ + rcases ih (by linarith) with ⟨c, w, rfl⟩ + exact ⟨c + 1, w, by rw [List.replicate_succ, List.cons_append]⟩ +theorem replicate_Q_prefix_le (c : Nat) : + ∀ (s : Nat) (u v : WordList), + List.replicate s Q ++ u = List.replicate c Q ++ K :: v -> s <= c := by + induction c with + | zero => + intro s u v hE + cases s with + | zero => omega + | succ s => + rw [List.replicate_succ, List.cons_append] at hE + simp at hE + | succ c ih => + intro s u v hE + cases s with + | zero => omega + | succ s => + rw [List.replicate_succ, List.cons_append, List.replicate_succ, List.cons_append] at hE + injection hE with _ hE' + have hle := ih s u v hE' + omega +theorem replicate_Q_suffix_le_of_notEndsWithQ (u v : WordList) (c s : Nat) (hC : notEndsWithQ u = + true) + (hE : u ++ List.replicate c Q = v ++ List.replicate s Q) : s <= c := by + by_contra hGt + have hlt : c < s := by omega + have hs : s = (s - c) + c := by omega + rw [hs, List.replicate_add, <- List.append_assoc] at hE + have hEq := List.append_inj_left' hE (by simp) + subst hEq + have hpos : 0 < s - c := by omega + have hsc : s - c = (s - c - 1) + 1 := by omega + rw [hsc, replicate_succ_append, <- List.append_assoc, notEndsWithQ_append_singleton] at hC + contradiction +theorem notEndsWithQ_of_append_left (u v : WordList) (hC : notEndsWithQ (u ++ + v) = true) : notEndsWithQ v = true := by + induction u with + | nil => exact hC + | cons a u ih => + exact ih (notEndsWithQ_of_cons a (u ++ v) hC) +theorem notEndsWithQ_replicate_Q_cons_K (c : Nat) (mid : WordList) (hM : notEndsWithQ mid = true) : + notEndsWithQ (List.replicate c Q ++ K :: mid) = true := by + induction c with + | zero => + cases mid with + | nil => rfl + | cons x xs => exact hM + | succ c ih => + rw [List.replicate_succ, List.cons_append] + cases c with + | zero => exact ih + | succ c' => exact ih +theorem digitVal_sandwich_split {B H : Nat} {ds : WordList} (s t0 : Nat) + (hD : DigitVal B H ds) (hZ : 0 < wordMassK ds) + (hLo : ∃ u, ds = List.replicate s Q ++ u) + (hHi : ∃ u, ds = u ++ List.replicate t0 Q) : + ∃ c mid n, ds = List.replicate c Q ++ K :: (mid ++ List.replicate n Q) /\ + notEndsWithQ mid = true /\ s <= c /\ t0 <= n := by + rcases hLo with ⟨lo, hLo⟩ + rcases hHi with ⟨hi, hHi⟩ + rcases digitVal_pos_massK_split hD hZ with ⟨c, w, hE⟩ + rcases split_trailing_Q w with ⟨mid, n, rfl, hM⟩ + refine ⟨c, mid, n, hE, hM, ?_, ?_⟩ + · exact replicate_Q_prefix_le c s lo (mid ++ List.replicate n Q) (hLo.symm.trans hE) + · have hEq : (List.replicate c Q ++ K :: mid) ++ List.replicate n Q = + hi ++ List.replicate t0 Q := by + simpa [List.append_assoc] using hE.symm.trans hHi + exact replicate_Q_suffix_le_of_notEndsWithQ (List.replicate c Q ++ K :: mid) hi n t0 + (notEndsWithQ_replicate_Q_cons_K c mid hM) hEq +theorem wordEffect_preserves_ends_with_V {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) (hEnd : ∃ w, u = w ++ [V]) : + ∃ w, v = w ++ [V] := by + rcases hEnd with ⟨w, rfl⟩ + change WordEffect n (w ++ List.replicate 1 V) b v at hI + rcases wordEffect_append_replicate_V_inv w 1 n b v hI with ⟨x, _, hEq, _⟩ + exact ⟨x, hEq⟩ +theorem wordScale_replicate_V_le_inv_65536 (p : Nat) (hP : 16 <= p) : + wordScale (List.replicate p V) <= 1 / 65536 := by + have hW := (wordMass_and_scale_replicate_V p).2 + have hPos := wordScale_pos (List.replicate p V) + have hB : (65536 : Rat) <= ((2 ^ p : Nat) : Rat) := by + have h1 : 2 ^ 16 <= 2 ^ p := Nat.pow_le_pow_right (by omega) hP + exact_mod_cast h1 + nlinarith +theorem unit_le_alpha_div_1024 (p H : Nat) (alpha unit : Rat) (hPH : p + 11 <= H) + (_hA : 0 < alpha) (hU : 0 < unit) + (hAp : 1 / 2 <= alpha * ((2 ^ p : Nat) : Rat)) + (hUh : unit * ((2 ^ H : Nat) : Rat) = 1) : + unit <= alpha * (1 / 1024) := by + have hHigh : 2048 * ((2 ^ p : Nat) : Rat) <= ((2 ^ H : Nat) : Rat) := by + have h1 : 2 ^ (11 + p) <= 2 ^ H := Nat.pow_le_pow_right (by omega) (by omega) + have h2 : 2 ^ (11 + p) = 2048 * 2 ^ p := by rw [Nat.pow_add] + rw [h2] at h1; exact_mod_cast h1 + have hPos := rat_pow_two_pos p + nlinarith +theorem step_mass_contraction_ineq (alpha e f unit delta R e' rho : Rat) + (hA : 0 < alpha) (_hE0 : 0 <= e) (_hF0 : 0 <= f) (hU0 : 0 <= unit) + (hE : e <= alpha * (3 / 64)) (hF : f <= alpha * (1 / 128)) (hU : unit <= alpha * (1 / 1024)) + (_hE'0 : 0 <= e') (hE' : e' <= (e + f) * (1 / 2)) + (hRlo : rho * (1 / 2) <= R) (hRhi : R <= rho * (1 / 2) + 2 * e') + (hDlo : 2 * alpha + rho - e * (1 / 4) - 3 * f <= delta) + (hDhi : delta <= 2 * alpha + rho + 4 * e + 4 * f) : + (3 / 4) * alpha <= delta * (1 / 2) - 4 * unit - R /\ + delta * (1 / 2) - 4 * unit - R <= (5 / 4) * alpha := by + constructor <;> linarith +theorem carry_budget_contraction_ineq (J k carry : Nat) (alpha unit delta R rho : Rat) + (_hPos : 0 < alpha) (hSmall : alpha <= 1 / 32) (hUnit : 0 < unit) (hTiny : unit <= + alpha * (1 / 1024)) + (hHeight : unit * ((2 ^ J : Nat) : Rat) = 1) + (hRho0 : 0 <= rho) (hRho : rho <= 2 * alpha) + (hDl : (7 / 4) * alpha + rho <= delta) (hDu : delta <= (9 / 4) * alpha + rho) + (hRl : rho * (1 / 2) <= R) (hRu : R <= rho * (1 / 2) + alpha * (1 / 4)) + (hK : (k : Rat) * unit = 2 + 4 * unit - delta * (1 / 2)) + (hC : ((1 + carry : Nat) : Rat) * unit = 1 + R) : + ∃ A B : Nat, A + 2 ^ J = k /\ B + 2 ^ J = A + carry /\ + 2 ^ J <= A * 2 /\ A < 2 ^ J /\ 2 ^ J <= B * 2 /\ B < 2 ^ J := by + push_cast at hC + have hK_gt : ((2 ^ J : Nat) : Rat) + ((2 ^ J : Nat) : Rat) * (1 / 2) <= (k : Rat) := by nlinarith + have hK_lt : (k : Rat) < ((2 ^ J : Nat) : Rat) * 2 := by nlinarith + have hB_gt : ((2 ^ J : Nat) : Rat) * 2 + ((2 ^ J : Nat) : Rat) * (1 / 2) <= + (k : Rat) + (carry : Rat) := by nlinarith + have hB_lt : (k : Rat) + (carry : Rat) < ((2 ^ J : Nat) : Rat) * 3 := by nlinarith + have hK2 : 2 ^ J * 3 <= k * 2 := by + have h1 : ((2 ^ J : Nat) : Rat) * 3 <= (k : Rat) * 2 := by linarith + exact_mod_cast h1 + have hK3 : k < 2 ^ J * 2 := by + have h1 : (k : Rat) < ((2 ^ J : Nat) : Rat) * 2 := by linarith + exact_mod_cast h1 + have hB2 : 2 ^ J * 5 <= (k + carry) * 2 := by + have h1 : ((2 ^ J : Nat) : Rat) * 5 <= ((k : Rat) + (carry : Rat)) * 2 := by linarith + exact_mod_cast h1 + have hB3 : k + carry < 2 ^ J * 3 := by + have h1 : (k : Rat) + (carry : Rat) < ((2 ^ J : Nat) : Rat) * 3 := by linarith + exact_mod_cast h1 + refine ⟨k - 2 ^ J, k + carry - (2 ^ J + 2 ^ J), by omega, by omega, by omega, by omega, + by omega, by omega⟩ +inductive Copy : Nat -> Nat -> WordList -> WordList -> Nat -> Nat -> Prop where + | nil (n k : Nat) : Copy n k [] [] n k + | T {n k : Nat} {u v : WordList} {b k' : Nat} : + Copy (1 + n * 2) (2 + k * 2) u v b k' -> Copy n (3 + k) (V :: u) (V :: v) b k' + | d00 {n k : Nat} {u v : WordList} {b k' : Nat} : + Copy n (k * 2) u v b k' -> Copy (n * 2) (2 + k * 4) (K :: u) (K :: v) b k' + | d01 {n k : Nat} {u v : WordList} {b k' : Nat} : + Copy n (1 + k * 2) u v b k' -> Copy (1 + n * 2) (2 + k * 4) (K :: u) (Q :: v) b k' + | d10 {n k : Nat} {u v : WordList} {b k' : Nat} : + Copy n (1 + k * 2) u v b k' -> Copy (n * 2) (4 + k * 4) (Q :: u) (Q :: v) b k' + | d11 {n k : Nat} {u v : WordList} {b k' : Nat} : + Copy (1 + n) (k * 2) u v b k' -> Copy (1 + n * 2) (4 + k * 4) (Q :: u) (K :: v) b k' +theorem wordEffect_of_copy {n k : Nat} {u v : WordList} {b k' : Nat} (hI : Copy n k u v b k') : + WordEffect n u b v := by + induction hI with + | nil n k => exact WordEffect.nil n + | T _ ih => exact WordEffect.T ih + | d00 _ ih => exact WordEffect.d00 ih + | d01 _ ih => exact WordEffect.d01 ih + | d10 _ ih => exact WordEffect.d10 ih + | d11 _ ih => exact WordEffect.d11 ih +theorem copy_append {n k : Nat} {u v : WordList} {b k' : Nat} (h1 : Copy n k u v b k') : + ∀ {w x : WordList} {c k'' : Nat}, Copy b k' w x c k'' -> Copy n k (u ++ w) (v ++ x) c k'' := by + induction h1 with + | nil _ _ => intro w x c k'' h2; exact h2 + | T _ ih => intro w x c k'' h2; exact Copy.T (ih h2) + | d00 _ ih => intro w x c k'' h2; exact Copy.d00 (ih h2) + | d01 _ ih => intro w x c k'' h2; exact Copy.d01 (ih h2) + | d10 _ ih => intro w x c k'' h2; exact Copy.d10 (ih h2) + | d11 _ ih => intro w x c k'' h2; exact Copy.d11 (ih h2) +theorem copy_replicate_V (q : Nat) : + ∀ (n k : Nat), + Copy n (4 + k) (List.replicate q V) (List.replicate q V) ((1 + n) * 2 ^ q - 1) (4 + + k * 2 ^ q) := by + induction q with + | zero => + intro n k + have h1 : (1 + n) * 2 ^ 0 - 1 = n := by simp + have h2 : 4 + k * 2 ^ 0 = 4 + k := by simp + rw [h1, h2] + exact Copy.nil n (4 + k) + | succ q ih => + intro n k + rw [List.replicate_succ] + have hpos := pow_two_pos q + have hSub := ih (1 + n * 2) (k * 2) + have h1 : (1 + (1 + n * 2)) * 2 ^ q - 1 = (1 + n) * 2 ^ (q + 1) - 1 := by + rw [Nat.pow_succ]; ring_nf + have h3 : 4 + (k * 2) * 2 ^ q = 4 + k * 2 ^ (q + 1) := by + rw [Nat.pow_succ]; ring + rw [h1, h3] at hSub + have h4 : 4 + k = 3 + (1 + k) := by omega + have h5 : 2 + (1 + k) * 2 = 4 + k * 2 := by omega + rw [h4] + refine Copy.T ?_ + rwa [h5] +theorem wordEffect_excess_bounds {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + 0 <= ((1 + b : Nat) : Rat) * wordScale u - ((1 + n : Nat) : Rat) /\ + ((1 + b : Nat) : Rat) * wordScale u - ((1 + n : Nat) : Rat) <= 2 * wordMass u := by + have hBud := wordEffect_budget_eq hI + have hW := wordEffect_preserves_scale_and_mass hI + have hSu := wordMass_eq_add u + have hSv := wordMass_eq_add v + have hNu := wordMass_nonneg u + have hNv := wordMass_nonneg v + constructor <;> linarith +theorem exists_wordEffect_carry_one {n : Nat} {da : WordList} {A H B : Nat} + (hD : DigitVal A H da) (hSum : A + n = B + 2 ^ H) (hBound : B < 2 ^ H) : + ∃ d, DigitVal B H d /\ WordEffect n (da ++ [Q]) 1 (d ++ [K]) := by + rcases exists_wordEffect da n with ⟨b, d, hE⟩ + rcases wordEffect_digitVal hE hD with ⟨C, hCd, hEq⟩ + have hCb := lt_pow_of_digitVal hCd + have hb1 : b = 1 := by + rcases b with _ | _ | b' + · omega + · rfl + · have : 2 ^ H + 2 ^ H <= (b' + 1 + 1) * 2 ^ H := by + have hmul : (b' + 1 + 1) * 2 ^ H = b' * 2 ^ H + 2 ^ H + 2 ^ H := by ring + omega + omega + subst hb1 + have hCB : C = B := by omega + subst hCB + refine ⟨d, hCd, wordEffect_append hE ?_⟩ + exact @WordEffect.d11 0 [] 1 [] (WordEffect.nil 1) +def copyDefect (u v : WordList) : Rat := 3 * wordMass u + wordMassQ u - wordMassQ v +theorem copy_defect_bound {n k : Nat} {u v : WordList} {b k' : Nat} (hI : Copy n k u v b k') : + copyDefect u v - (((1 + b : Nat) : Rat) * wordScale u - ((1 + n : Nat) : Rat)) = + 2 * wordMass u /\ + 0 <= ((1 + b : Nat) : Rat) * wordScale u - ((1 + n : Nat) : Rat) /\ + ((1 + b : Nat) : Rat) * wordScale u - ((1 + n : Nat) : Rat) <= 2 * wordMass u := by + have hE := wordEffect_of_copy hI + have hBud := wordEffect_budget_eq hE + have hBnd := wordEffect_excess_bounds hE + unfold copyDefect + push_cast at hBud hBnd ⊢ + refine ⟨by linarith, by linarith, by linarith⟩ +theorem copy_split_effect {n k : Nat} {u v : WordList} {b k' : Nat} (hC : Copy n k u v b k') : + ∀ (w : WordList) (c : Nat) (x : WordList), + WordEffect n (u ++ w) c x -> ∃ y, x = v ++ y /\ WordEffect b w c y := by + induction hC with + | nil _ _ => intro w c x hE; exact ⟨x, rfl, hE⟩ + | T _ ih => + intro w c x hE + cases hE with + | T hSub => + rcases ih w c _ hSub with ⟨y, rfl, hY⟩ + exact ⟨y, rfl, hY⟩ + | @d00 n0 k0 u0 v0 b0 k0' _ ih => + intro w c x hE + generalize hm : n0 * 2 = m at hE + cases hE with + | @d00 n1 _ _ _ hSub => + have hn : n0 = n1 := by omega + subst hn + rcases ih w c _ hSub with ⟨y, rfl, hY⟩ + exact ⟨y, rfl, hY⟩ + | d01 _ => omega + | @d01 n0 k0 u0 v0 b0 k0' _ ih => + intro w c x hE + generalize hm : 1 + n0 * 2 = m at hE + cases hE with + | d00 _ => omega + | @d01 n1 _ _ _ hSub => + have hn : n0 = n1 := by omega + subst hn + rcases ih w c _ hSub with ⟨y, rfl, hY⟩ + exact ⟨y, rfl, hY⟩ + | @d10 n0 k0 u0 v0 b0 k0' _ ih => + intro w c x hE + generalize hm : n0 * 2 = m at hE + cases hE with + | @d10 n1 _ _ _ hSub => + have hn : n0 = n1 := by omega + subst hn + rcases ih w c _ hSub with ⟨y, rfl, hY⟩ + exact ⟨y, rfl, hY⟩ + | d11 _ => omega + | @d11 n0 k0 u0 v0 b0 k0' _ ih => + intro w c x hE + generalize hm : 1 + n0 * 2 = m at hE + cases hE with + | d10 _ => omega + | @d11 n1 _ _ _ hSub => + have hn : n0 = n1 := by omega + subst hn + rcases ih w c _ hSub with ⟨y, rfl, hY⟩ + exact ⟨y, rfl, hY⟩ +def isSafePrefix : WordList -> Bool + | [] => true + | Q :: V :: v => isSafePrefix (V :: v) + | Q :: _ => false + | _ :: v => isSafePrefix v +theorem isSafePrefix_replicate_V_append (q : Nat) (v : WordList) (h : isSafePrefix v = true) : + isSafePrefix (List.replicate q V ++ v) = true := by + induction q with + | zero => exact h + | succ q ih => rw [List.replicate_succ, List.cons_append]; exact ih +theorem copy_phaseScan_split {n k : Nat} {u v : WordList} {b k' : Nat} (hC : Copy n k u v b k') : + isSafePrefix v = true -> + ∀ (w : WordList) (k'' : Nat) (x : WordList) (a c : Rat), + PhaseScan k (v ++ w) k'' x a c -> + ∃ y a' c', x = u ++ y /\ PhaseScan k' w k'' y a' c' /\ + a = copyDefect u v + wordScale u * a' /\ c = wordScale u * c' := by + induction hC with + | nil _ _ => + intro _ w k'' x a c hI + exact ⟨x, a, c, rfl, hI, + by unfold copyDefect; simp [wordMass, wordMassQ, wordScale], by simp [wordScale]⟩ + | @T n0 k0 u0 v0 b0 k0' _ ih => + intro hSafe w k'' x a c hI + have hSafe' : isSafePrefix v0 = true := hSafe + generalize hm : 3 + k0 = m at hI + cases hI with + | @T m0 _ _ _ _ _ hSub => + have hk0 : k0 = m0 := by omega + subst hk0 + rcases ih hSafe' w k'' _ _ _ hSub with ⟨y, a', c', rfl, hY, hA, hC'⟩ + refine ⟨y, a', c', rfl, hY, ?_, ?_⟩ + · unfold copyDefect at hA ⊢; dsimp [wordMass, wordMassQ, wordScale]; linarith + · dsimp [wordScale]; linarith + | @d00 n0 k0 u0 v0 b0 k0' _ ih => + intro hSafe w k'' x a c hI + have hSafe' : isSafePrefix v0 = true := hSafe + generalize hm : 2 + k0 * 4 = m at hI + cases hI with + | @short00 m0 _ _ _ _ _ hSub => + have hk0 : k0 = m0 := by omega + subst hk0 + rcases ih hSafe' w k'' _ _ _ hSub with ⟨y, a', c', rfl, hY, hA, hC'⟩ + refine ⟨y, a', c', rfl, hY, ?_, ?_⟩ + · unfold copyDefect at hA ⊢; dsimp [wordMass, wordMassQ, wordScale]; linarith + · dsimp [wordScale]; linarith + | short10 _ => omega + | @d01 n0 k0 u0 v0 b0 k0' _ ih => + intro hSafe w k'' x a c hI + have hSafe' : isSafePrefix v0 = true := by + cases v0 with + | nil => contradiction + | cons z zs => cases z <;> first | exact hSafe | contradiction + have hv0 : ∃ zs, v0 = V :: zs := by + cases v0 with + | nil => contradiction + | cons z zs => cases z <;> first | exact ⟨zs, rfl⟩ | contradiction + rcases hv0 with ⟨zs, rfl⟩ + simp only [List.cons_append] at hI + generalize hm : 2 + k0 * 4 = m at hI + cases hI with + | @short01 m0 _ _ _ _ _ hSub => + have hk0 : k0 = m0 := by omega + subst hk0 + rcases ih hSafe' w k'' _ _ _ hSub with ⟨y, a', c', rfl, hY, hA, hC'⟩ + refine ⟨y, a', c', rfl, hY, ?_, ?_⟩ + · unfold copyDefect at hA ⊢; dsimp [wordMass, wordMassQ, wordScale] at hA ⊢; linarith + · dsimp [wordScale]; linarith + | short11 _ => omega + | @d10 n0 k0 u0 v0 b0 k0' _ ih => + intro hSafe w k'' x a c hI + have hSafe' : isSafePrefix v0 = true := by + cases v0 with + | nil => contradiction + | cons z zs => cases z <;> first | exact hSafe | contradiction + have hv0 : ∃ zs, v0 = V :: zs := by + cases v0 with + | nil => contradiction + | cons z zs => cases z <;> first | exact ⟨zs, rfl⟩ | contradiction + rcases hv0 with ⟨zs, rfl⟩ + simp only [List.cons_append] at hI + generalize hm : 4 + k0 * 4 = m at hI + cases hI with + | short01 _ => omega + | @short11 m0 _ _ _ _ _ hSub => + have hk0 : k0 = m0 := by omega + subst hk0 + rcases ih hSafe' w k'' _ _ _ hSub with ⟨y, a', c', rfl, hY, hA, hC'⟩ + refine ⟨y, a', c', rfl, hY, ?_, ?_⟩ + · unfold copyDefect at hA ⊢; dsimp [wordMass, wordMassQ, wordScale] at hA ⊢; linarith + · dsimp [wordScale]; linarith + | @d11 n0 k0 u0 v0 b0 k0' _ ih => + intro hSafe w k'' x a c hI + have hSafe' : isSafePrefix v0 = true := hSafe + generalize hm : 4 + k0 * 4 = m at hI + cases hI with + | short00 _ => omega + | @short10 m0 _ _ _ _ _ hSub => + have hk0 : k0 = m0 := by omega + subst hk0 + rcases ih hSafe' w k'' _ _ _ hSub with ⟨y, a', c', rfl, hY, hA, hC'⟩ + refine ⟨y, a', c', rfl, hY, ?_, ?_⟩ + · unfold copyDefect at hA ⊢; dsimp [wordMass, wordMassQ, wordScale]; linarith + · dsimp [wordScale]; linarith +set_option maxHeartbeats 2000000 in +-- Justification: Nonlinear rational arithmetic (`nlinarith`) combining phase-scan and copy-defect bounds. +theorem copy_phaseScan_digitVal_bound (pre pe : WordList) (carry budget : Nat) (u ds : WordList) + (A H k : Nat) (v : WordList) (a b : Rat) (s : Nat) (e f : Rat) + (hC : Copy 0 12 pre pe carry budget) (hSafe : isSafePrefix pe = true) + (hI : PhaseScan 12 (pe ++ u ++ ds ++ [K]) k v a b) + (hD : DigitVal A H ds) (hCut : notEndsWithQ u = true) + (hLow : ∃ c w, (0 < c /\ s <= c) /\ ds = List.replicate c Q ++ K :: w) + (hErr : e = wordScale pre * wordMass u) + (hBound : (wordScale pre * wordScale u) * (((2 ^ (s + s / 2) : Nat) : Rat) + + 2 * wordMassK ds) <= + f * ((2 ^ (s + s / 2) : Nat) : Rat)) : + ∃ w, v = pre ++ w /\ + wordMass (V :: (v ++ [V])) <= wordMass pre * (1 / 2) + (e + f) * (1 / 2) /\ + copyDefect pre pe - e * (1 / 4) - 3 * f <= a - b /\ + a - b <= copyDefect pre pe + 4 * e + 4 * f := by + have hEq : pe ++ u ++ ds ++ [K] = pe ++ (u ++ (ds ++ [K])) := by simp [List.append_assoc] + rw [hEq] at hI + rcases copy_phaseScan_split hC hSafe (u ++ (ds ++ [K])) k v a b hI with ⟨w, c, d, rfl, hJ, hPos, + hNeg⟩ + rcases phaseScan_split_of_splitCond hJ u (ds ++ [K]) rfl (Or.inl hCut) + with ⟨m, x, y, a1, b1, a2, b2, hK, hL, rfl, hP, hN⟩ + have hBK := phaseScan_loss_bounds hK + have hBL := phaseScan_loss_bounds hL + have hSK := phaseScan_scale_le hK + have hSpre := wordScale_pos pre + have hSu := wordScale_pos u + have hSx := wordScale_pos x + have hWds := wordMass_nonneg ds + have hPow := rat_pow_two_pos (s + s / 2) + have hSpx : 0 <= wordScale pre * wordScale x := mul_nonneg (le_of_lt hSpre) (le_of_lt hSx) + have hSx_le : wordScale pre * wordScale x <= wordScale pre * wordScale u := by nlinarith + have hZ_pos : 0 <= ((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK ds := by linarith + have hF : (wordScale pre * wordScale x) * (((2 ^ (s + s / 2) : Nat) : Rat) + 2 * wordMassK ds) <= + f * ((2 ^ (s + s / 2) : Nat) : Rat) := by + nlinarith + rcases phaseScan_digitVal_weighted_bound s ds A H m k y a2 b2 (wordScale pre * wordScale x) f hD + hL hLow + hSpx hF with ⟨hMt, hPt, hNt⟩ + have hMt' : wordScale pre * (wordScale x * wordMass y) <= f := by linarith + have hPt' : wordScale pre * (wordScale x * a2) <= 4 * f := by linarith + have hNt' : wordScale pre * (wordScale x * b2) <= 3 * f := by linarith + have hPa : 0 <= wordScale pre * (wordScale x * a2) := by + have := mul_nonneg hSpx hBL.2.1; linarith + have hPb : 0 <= wordScale pre * (wordScale x * b2) := by + have := mul_nonneg hSpx hBL.2.2.2.1; linarith + have hMx : wordScale pre * wordMass x <= e := by nlinarith + have hA1_0 : 0 <= wordScale pre * a1 := by nlinarith + have hA1 : wordScale pre * a1 <= 4 * e := by nlinarith + have hB1_0 : 0 <= wordScale pre * b1 := by nlinarith + have hB1 : wordScale pre * b1 <= e * (1 / 4) := by nlinarith + refine ⟨x ++ y, by simp, ?_, ?_, ?_⟩ + · dsimp [wordMass] + rw [wordMass_append, wordMass_append, wordMass_append] + dsimp [wordMass, wordScale] + linarith + · rw [hP] at hPos; rw [hN] at hNeg + linarith + · rw [hP] at hPos; rw [hN] at hNeg + linarith +theorem copy_effect_phaseScan_combine (pre pe : WordList) (b k : Nat) (u : WordList) (carry : Nat) + (eff : WordList) + (hC : Copy 0 12 pre pe b k) (hE : WordEffect 0 (pre ++ u) carry eff) : + copyDefect pre pe - 2 * wordMass pre <= ((1 + carry : Nat) : Rat) * wordScale (pre ++ u) - 1 /\ + ((1 + carry : Nat) : Rat) * wordScale (pre ++ + u) - 1 <= copyDefect pre pe - 2 * wordMass pre + 2 * wordScale pre * wordMass u := by + rcases copy_split_effect hC u carry eff hE with ⟨v, _, hV⟩ + have hBnd := wordEffect_excess_bounds hV + have hSpre := wordScale_pos pre + have hLed := (copy_defect_bound hC).1 + rw [wordScale_append] + push_cast at hBnd hLed ⊢ + constructor <;> nlinarith +def CopyTwelve (u v : WordList) : Prop := ∃ b k, Copy 0 12 u v b k +inductive Step : WordList -> WordList -> Prop where + | intro (orig eff : WordList) (k : Nat) (v : WordList) (a b : Rat) (J A : Nat) (da : WordList) : + WordEffect 0 orig 1 eff -> PhaseScan 12 eff k v a b -> + DigitVal A J da -> A + 2 ^ J = k -> + Step orig (V :: (v ++ V :: (da ++ [Q]))) +inductive AggState (av : WordList) : Nat -> Nat -> WordList -> Prop where + | intro (p q H : Nat) (u : WordList) (A : Nat) (da : WordList) + (carry : Nat) (eff : WordList) (B : Nat) (db : WordList) (tau alpha : Rat) : + 16 <= p -> 5 <= q -> (3 * p) / 2 + 5 <= H -> + (∃ rest, u = (List.replicate q V ++ av) ++ rest) -> + (∃ rest, u = rest ++ [V]) -> + wordMass (List.replicate q V ++ av) = alpha -> + 1 / 2 <= alpha * ((2 ^ p : Nat) : Rat) -> + alpha * ((2 ^ p : Nat) : Rat) <= 1 -> + wordScale u * ((2 ^ H : Nat) : Rat) = 1 -> + DigitVal A H da -> + WordEffect 0 u carry eff -> + A + carry = B + 2 ^ H -> + DigitVal B H db -> + Reserve p tau -> + wordMass u <= alpha * (1 + (3 / 64) - tau) -> + (3 / 2) * alpha <= wordScale u * wordMassK db -> + wordScale u * wordMassK db <= (5 / 2) * alpha -> + (∃ rest, db = List.replicate ((p - 2) / 2) Q ++ rest) -> + AggState av p q (u ++ da ++ [Q]) +theorem replicate_one_add_cons (q : Nat) (w : Word) : + List.replicate (1 + q) w = w :: List.replicate q w := by + rw [Nat.add_comm 1 q, List.replicate_succ] +set_option maxHeartbeats 4000000 in +-- Justification: Large multi-hypothesis rational arithmetic step combining CopyTwelve, PhaseScan, and Reserve bounds. +theorem aggState_step_of_copyTwelve (av ev : WordList) (hSafe : isSafePrefix ev = true) + (hStable : ∀ q, 5 <= q -> CopyTwelve (List.replicate q V ++ av) (List.replicate q V ++ ev)) : + ∀ (p q : Nat) (orig : WordList), AggState av p q orig -> + ∃ out, Step orig out /\ AggState av (1 + p) (1 + q) out := by + intro p q orig hG + rcases hG with ⟨H, u, A, da, carry, eff, B, db, tau, alpha, + hP, hQ, hHbound, ⟨rest, hStart⟩, hEnd, hMass, hApLow, hApHigh, hHeight, + hDA, hEff, hSum, hDB, hRes, hM, hDlo, hDhi, hLow⟩ + set pre := List.replicate q V ++ av + set pe := List.replicate q V ++ ev + set unit := wordScale u + have hPowP := rat_pow_two_pos p + have hAlpha : 0 < alpha := by nlinarith + have hUnit : 0 < unit := wordScale_pos u + set dyadic := wordScale (List.replicate p V) + have hDP : dyadic * ((2 ^ p : Nat) : Rat) = 1 := (wordMass_and_scale_replicate_V p).2 + have hDyadic : 0 < dyadic := wordScale_pos (List.replicate p V) + have hAupper : alpha <= dyadic := by nlinarith + have hAsmall : dyadic <= 1 / 65536 := wordScale_replicate_V_le_inv_65536 p hP + rcases reserve_pos_and_le hRes hP with ⟨hTau, hTauSmall⟩ + have hUsmall : unit <= alpha * (1 / 1024) := + unit_le_alpha_div_1024 p H alpha unit (by omega) hAlpha hUnit hApLow hHeight + rcases hStable q hQ with ⟨bc, kc, hCopyPre⟩ + have hSafePre : isSafePrefix pe = true := isSafePrefix_replicate_V_append q ev hSafe + rcases copy_defect_bound hCopyPre with ⟨hLedger, hRhoLow, hRhoHigh⟩ + set rho := copyDefect pre pe - 2 * alpha + have hRho : 0 <= rho /\ rho <= 2 * alpha := by + unfold rho; rw [<- hMass]; push_cast at hLedger hRhoLow hRhoHigh; constructor <;> linarith + rcases wordEffect_preserves_scale_and_mass hEff with ⟨hEffScale, hEffMass⟩ + rcases wordEffect_preserves_ends_with_V hEff hEnd with ⟨last_w, hElast⟩ + have hCut : notEndsWithQ eff = true := by rw [hElast, notEndsWithQ_append_singleton]; rfl + have hNe : eff ≠ [] := by rw [hElast]; simp + have hEffHeight : wordScale eff * ((2 ^ H : Nat) : Rat) = 1 := by rw [hEffScale]; exact hHeight + have hEffBound : wordMass eff + wordScale eff * (1 + wordMassK db) <= 1 / 128 := by + rw [hEffScale]; nlinarith + rcases exists_phaseScan_twelve eff B H db hDB hEffHeight hCut hNe hEffBound with ⟨k, v, a, b, + hIscan, hK⟩ + have hZ : 0 < wordMassK db := by nlinarith + rcases digitVal_massK_scale_bound p H B db dyadic unit hDB (by omega) (by omega) + hDyadic hUnit (by linarith) hDP hHeight (by nlinarith) with ⟨hi, hHi⟩ + rcases digitVal_sandwich_split ((p - 2) / 2) (p - 2) hDB hZ hLow ⟨hi, hHi⟩ + with ⟨c, mid, t0, hSplit, hMidCut, hC, hT⟩ + rcases phaseScan_digitVal_length_bound eff db B H 12 k v a b p c mid t0 hDB hEffHeight hIscan + hCut hMidCut hSplit hP hC hT with ⟨J, hJbound, hJheight⟩ + set new_u := V :: (v ++ [V]) + set nu := wordScale new_u + have hNu : 0 < nu := wordScale_pos new_u + have hNuSmall : nu <= alpha * (1 / 1024) := + unit_le_alpha_div_1024 p J alpha nu (by omega) hAlpha hNu hApLow hJheight + have hEffRest : ∃ w, eff = pe ++ w /\ WordEffect bc rest carry w := by + rw [hStart] at hEff + exact copy_split_effect hCopyPre rest carry eff hEff + rcases hEffRest with ⟨w, hEstart, hEw⟩ + rcases wordEffect_preserves_scale_and_mass hEw with ⟨hWscale, hWmass⟩ + have hWcut : notEndsWithQ w = true := by + rw [hEstart] at hCut; exact notEndsWithQ_of_append_left pe w hCut + set e := wordMass u - alpha + have hEeq : e = wordScale pre * wordMass w := by + unfold e; rw [hStart, wordMass_append, <- hWmass, hMass]; ring + have hWw := wordMass_nonneg w + have hSpre := wordScale_pos pre + have hEpos : 0 <= e := by nlinarith + have hEbound : e <= alpha * ((3 / 64) - tau) := by unfold e; linarith + set s := (p - 2) / 2 + set pow := ((2 ^ (s + s / 2) : Nat) : Rat) + have hPow : 0 < pow := rat_pow_two_pos (s + s / 2) + set f := unit + 2 * unit * wordMassK db / pow + have hFeq : f * pow = unit * pow + 2 * unit * wordMassK db := by + unfold f; have hne : pow ≠ 0 := ne_of_gt hPow + calc (unit + 2 * unit * wordMassK db / pow) * pow + _ = unit * pow + (2 * unit * wordMassK db / pow) * pow := by ring + _ = unit * pow + 2 * unit * wordMassK db := by rw [div_mul_cancel₀ _ hne] + have hFpos : 0 <= f := by + have h1 : 0 <= f * pow := by rw [hFeq]; nlinarith + nlinarith + have hFbound : f <= alpha * tau * (1 / 4) := + reserve_height_bound p H s alpha unit tau f hRes hP hHbound rfl hAlpha hUnit hApLow hHeight (by + nlinarith) + have hLow' : ∃ c0 w0, (0 < c0 /\ s <= c0) /\ db = List.replicate c0 Q ++ K :: w0 := + ⟨c, mid ++ List.replicate t0 Q, ⟨by omega, hC⟩, hSplit⟩ + have hFactor : wordScale pre * wordScale w = unit := by + unfold unit; rw [hWscale, hStart, <- wordScale_append] + have hScanStart : PhaseScan 12 (pe ++ w ++ db ++ [K]) k v a b := by + rw [hEstart] at hIscan; simpa [List.append_assoc] using hIscan + rcases copy_phaseScan_digitVal_bound pre pe bc kc w db B H k v a b s e f hCopyPre hSafePre + hScanStart hDB hWcut hLow' hEeq (by rw [hFactor]; nlinarith) + with ⟨tail, hVstart, hMnext, hDl, hDu⟩ + change wordMass new_u <= wordMass pre * (1 / 2) + (e + f) * (1 / 2) at hMnext + rw [hMass] at hMnext + have hDl' : 2 * alpha + rho - e * (1 / 4) - 3 * f <= a - b := by unfold rho; linarith + have hDu' : a - b <= 2 * alpha + rho + 4 * e + 4 * f := by unfold rho; linarith + rcases exists_wordEffect new_u 0 with ⟨carry', eff', hEff'⟩ + have hNewStart : new_u = (V :: pre) ++ (tail ++ [V]) := by + unfold new_u; rw [hVstart]; simp [List.append_assoc] + have hPre_step : List.replicate (1 + q) V ++ av = V :: pre := by + unfold pre; rw [replicate_one_add_cons, List.cons_append] + have hPe_step : List.replicate (1 + q) V ++ ev = V :: pe := by + unfold pe; rw [replicate_one_add_cons, List.cons_append] + rcases hStable (1 + q) (by omega) with ⟨bc', kc', hCopyNew⟩ + rw [hPre_step, hPe_step] at hCopyNew + have hEff'_rw : WordEffect 0 ((V :: pre) ++ (tail ++ [V])) carry' eff' := by + rwa [<- hNewStart] + have hRbounds := + copy_effect_phaseScan_combine (V :: pre) (V :: pe) bc' kc' (tail ++ + [V]) carry' eff' hCopyNew hEff'_rw + rw [<- hNewStart] at hRbounds + have hNewMass : wordMass new_u = + alpha * (1 / 2) + (wordScale pre * (1 / 2)) * wordMass (tail ++ [V]) := by + rw [hNewStart, wordMass_append]; dsimp [wordMass, wordScale]; rw [hMass] + have hCloss_step : copyDefect (V :: pre) (V :: pe) - 2 * wordMass (V :: pre) = rho * (1 / 2) := by + unfold rho copyDefect; dsimp [wordMass, wordMassQ, wordScale]; rw [hMass]; ring + have hScale_step : wordScale (V :: pre) * wordMass (tail ++ + [V]) = wordMass new_u - alpha * (1 / 2) := by + dsimp [wordScale]; linarith + set R := ((1 + carry' : Nat) : Rat) * nu - 1 + have hRb : rho * (1 / 2) <= R /\ R <= rho * (1 / 2) + 2 * (wordMass new_u - alpha * (1 / 2)) := by + unfold R nu; constructor <;> linarith + have hWtail := wordMass_nonneg (tail ++ [V]) + have hEnew : 0 <= wordMass new_u - alpha * (1 / 2) := by nlinarith + have hFtiny : f <= alpha * (1 / 128) := by nlinarith + have hEtiny : e <= alpha * (3 / 64) := by nlinarith + have hBudget := phaseScan_twelve_scale_eq (eff ++ db ++ [K]) k v a b hIscan + rcases carry_budget_contraction_ineq J k carry' alpha nu (a - b) R rho + hAlpha (by linarith) hNu hNuSmall hJheight hRho.1 hRho.2 + (by linarith) (by linarith) hRb.1 (by linarith) hBudget (by unfold R; ring) + with ⟨A', B', hAsum, hBsum, hAl, hAu, hBl, hBu⟩ + rcases exists_digitVal_of_lt_pow J A' hAu with ⟨da', hDA'⟩ + rcases exists_digitVal_of_lt_pow J B' hBu with ⟨db', hDB'⟩ + rcases reserve_step_contract hRes with ⟨tau', hRes', hTauStep⟩ + have hMkeep := reserve_next_step_bound alpha tau tau' e f (wordMass new_u - alpha * (1 / 2)) + (by linarith) hTauStep hEbound hFbound (by linarith) + have hDkeep := + step_mass_contraction_ineq alpha e f nu (a - b) R (wordMass new_u - alpha * (1 / 2)) rho + hAlpha hEpos hFpos (by linarith) hEtiny hFtiny hNuSmall hEnew (by linarith) + hRb.1 hRb.2 hDl' hDu' + have hDef := phaseScan_twelve_height_sum (eff ++ db ++ + [K]) k v a b J A' B' carry' hIscan hJheight hAsum hBsum + have hZnew := digitVal_wordMassK_eq hDB' + have hDnew : nu * wordMassK db' = (a - b) * (1 / 2) - 4 * nu - R := by + have hZ' : nu * wordMassK db' = 1 - ((1 + B' : Nat) : Rat) * nu := by + calc nu * wordMassK db' + _ = nu * ((wordMassK db' + (B' : Rat) + 1) - (1 + (B' : Rat))) := by ring + _ = nu * (((2 ^ J : Nat) : Rat) - (1 + (B' : Rat))) := by rw [hZnew] + _ = nu * ((2 ^ J : Nat) : Rat) - (1 + (B' : Rat)) * nu := by ring + _ = 1 - (1 + (B' : Rat)) * nu := by rw [hJheight] + _ = 1 - ((1 + B' : Nat) : Rat) * nu := by push_cast; ring + rw [hZ'] + exact hDef + have hLowNew : ∃ rest, db' = List.replicate (((1 + p) - 2) / 2) Q ++ rest := by + set r := (((1 + p) - 2) / 2) - 1 + have hHr : 1 + r = ((1 + p) - 2) / 2 /\ 1 + r * 2 <= p - 2 := by omega + have hHighEnd : ∃ z, db = z ++ List.replicate (1 + r * 2) Q := by + refine ⟨hi ++ List.replicate ((p - 2) - (1 + r * 2)) Q, ?_⟩ + have heq : ((p - 2) - (1 + r * 2)) + (1 + r * 2) = p - 2 := by omega + rw [List.append_assoc, <- List.replicate_add, heq, <- hHi] + rcases hHighEnd with ⟨z, hHZ⟩ + have hSC : PhaseScan 12 ((eff ++ z) ++ List.replicate (1 + r * 2) Q ++ [K]) k v a b := by + rw [hHZ] at hIscan; simpa [List.append_assoc] using hIscan + rcases phaseScan_effect_split r 12 (eff ++ z) k v a b carry' eff' A' B' J db' + hSC hEff' hDB' (by omega) hAsum hBsum with ⟨z', hL⟩ + rw [hHr.1] at hL + exact ⟨z', hL⟩ + have hAp_step : (alpha * (1 / 2)) * ((2 ^ (1 + p) : Nat) : Rat) = + alpha * ((2 ^ p : Nat) : Rat) := by + rw [pow_two_one_add, Nat.cast_add]; ring + refine ⟨new_u ++ da' ++ [Q], ?_, ?_⟩ + · have hOut_eq : new_u ++ da' ++ [Q] = V :: (v ++ V :: (da' ++ [Q])) := by + unfold new_u; simp [List.append_assoc] + rw [hOut_eq] + have hOrig_eq : (u ++ da ++ [Q]) = u ++ (da ++ [Q]) := by simp [List.append_assoc] + rw [hOrig_eq] + rcases exists_wordEffect_carry_one hDA hSum (lt_pow_of_digitVal hDB) with ⟨d, hDD, hEE⟩ + have hd_eq : d = db := digitVal_unique hDD hDB + rw [hd_eq] at hEE + have hEffFull : WordEffect 0 (u ++ (da ++ [Q])) 1 (eff ++ db ++ [K]) := by + simpa [List.append_assoc] using wordEffect_append hEff hEE + exact Step.intro (u ++ (da ++ [Q])) (eff ++ db ++ [K]) k v a b J A' da' + hEffFull hIscan hDA' hAsum + · refine AggState.intro (1 + p) (1 + q) J new_u A' da' carry' eff' B' db' tau' (alpha * (1 / 2)) + (by omega) (by omega) (by omega) + ⟨tail ++ [V], by rw [hPre_step]; exact hNewStart⟩ ⟨V :: v, rfl⟩ + (by rw [hPre_step]; dsimp [wordMass]; rw [hMass]) + (by rw [hAp_step]; exact hApLow) + (by rw [hAp_step]; exact hApHigh) + hJheight hDA' hEff' (by omega) hDB' hRes' + (by linarith) (by rw [hDnew]; linarith) (by rw [hDnew]; linarith) hLowNew +theorem copy_step_T {n k n' k' m b k'' : Nat} {u v : WordList} + (hn : n' = 1 + n * 2) (hk : k = 3 + m) (hk' : k' = 2 + m * 2) + (h : Copy n' k' u v b k'') : Copy n k (V :: u) (V :: v) b k'' := by + subst hn hk hk'; exact Copy.T h +theorem copy_step_d00 {n k n' k' m b k'' : Nat} {u v : WordList} + (hn : n = n' * 2) (hk : k = 2 + m * 4) (hk' : k' = m * 2) + (h : Copy n' k' u v b k'') : Copy n k (K :: u) (K :: v) b k'' := by + subst hn hk hk'; exact Copy.d00 h +theorem copy_step_d01 {n k n' k' m b k'' : Nat} {u v : WordList} + (hn : n = 1 + n' * 2) (hk : k = 2 + m * 4) (hk' : k' = 1 + m * 2) + (h : Copy n' k' u v b k'') : Copy n k (K :: u) (Q :: v) b k'' := by + subst hn hk hk'; exact Copy.d01 h +theorem copy_step_d10 {n k n' k' m b k'' : Nat} {u v : WordList} + (hn : n = n' * 2) (hk : k = 4 + m * 4) (hk' : k' = 1 + m * 2) + (h : Copy n' k' u v b k'') : Copy n k (Q :: u) (Q :: v) b k'' := by + subst hn hk hk'; exact Copy.d10 h +theorem copy_step_d11 {n k n' k' m b k'' : Nat} {u v : WordList} + (hn : n = 1 + (n' - 1) * 2) (hn' : n' = 1 + (n' - 1)) (hk : k = 4 + m * 4) (hk' : k' = m * 2) + (h : Copy n' k' u v b k'') : Copy n k (Q :: u) (K :: v) b k'' := by + rw [hn, hk]; rw [hn', hk'] at h; exact Copy.d11 h +def decodeDigits : Nat -> Nat -> Option (WordList) + | 0, _ => none + | fuel + 1, k => + if k == 0 then none + else if k == 1 then some [] + else + match decodeDigits fuel (k / 2) with + | none => none + | some da => some ((if k % 2 == 0 then K else Q) :: da) +theorem decodeDigits_sound (fuel : Nat) : + ∀ (k : Nat) (da : WordList), + decodeDigits fuel k = some da -> + ∃ A J, DigitVal A J da /\ A + 2 ^ J = k := by + induction fuel with + | zero => intro k da h; contradiction + | succ fuel ih => + intro k da h + dsimp [decodeDigits] at h + cases hk0 : (k == 0) with + | true => rw [hk0] at h; contradiction + | false => + rw [hk0] at h + cases hk1 : (k == 1) with + | true => + rw [hk1] at h + simp only [beq_iff_eq] at hk1; subst hk1 + injection h with h; subst h + exact ⟨0, 0, DigitVal.nil, rfl⟩ + | false => + rw [hk1] at h + have hk2 : 2 <= k := by + simp only [beq_eq_false_iff_ne] at hk0 hk1 + omega + cases hrec : decodeDigits fuel (k / 2) with + | none => rw [hrec] at h; contradiction + | some da' => + rw [hrec] at h + injection h with h; subst h + rcases ih (k / 2) da' hrec with ⟨A, J, hD, hSum⟩ + rcases Nat.mod_two_eq_zero_or_one k with hmod | hmod + · have hc : (k % 2 == 0) = true := beq_iff_eq.mpr hmod + rw [hc] + refine ⟨A * 2, 1 + J, DigitVal.zero hD, ?_⟩ + rw [pow_two_one_add]; omega + · have hc : (k % 2 == 0) = false := beq_false_of_ne (by omega) + rw [hc] + refine ⟨1 + A * 2, 1 + J, DigitVal.one hD, ?_⟩ + rw [pow_two_one_add]; omega +def evalStep (orig : WordList) : Option (WordList) := + let (carry, eff) := evalEffect 0 orig + if carry == 1 then + match evalPhaseScan 1024 eff 12 with + | some (k, v) => + match decodeDigits 512 k with + | some da => withNatWordList (V :: (v ++ V :: (da ++ [Q]))) (fun out => some out) + | none => none + | none => none + else none +theorem evalStep_sound (orig out : WordList) (hR : evalStep orig = some out) : + Step orig out := by + unfold evalStep at hR + have hE := evalEffect_sound orig 0 + generalize hEff : evalEffect 0 orig = ce at hR hE + rcases ce with ⟨carry, eff⟩ + dsimp only at hR hE + split_ifs at hR with hc1 + simp only [beq_iff_eq] at hc1; subst hc1 + cases hScan : evalPhaseScan 1024 eff 12 with + | none => rw [hScan] at hR; contradiction + | some kv => + rw [hScan] at hR + rcases kv with ⟨k, v⟩ + dsimp only at hR + cases hPw : decodeDigits 512 k with + | none => rw [hPw] at hR; contradiction + | some da => + rw [hPw] at hR + simp only [withNatWordList_eq] at hR + injection hR with hR; subst hR + rcases evalPhaseScan_sound 1024 eff 12 k v hScan with ⟨a, b, hI⟩ + rcases decodeDigits_sound 512 k da hPw with ⟨A, J, hDA, hSum⟩ + exact Step.intro orig eff k v a b J A da hE hI hDA hSum +inductive Rounds : WordList -> WordList -> Prop where + | refl (u : WordList) : Rounds u u + | next {u v w : WordList} : Step u v -> Rounds v w -> Rounds u w +theorem rounds_trans {u v w : WordList} (h1 : Rounds u v) (h2 : Rounds v w) : Rounds u w := by + induction h1 with + | refl _ => exact h2 + | next hS _ ih => exact Rounds.next hS (ih h2) +def evalRounds : Nat -> WordList -> Option (WordList) + | 0, u => some u + | n + 1, u => + match evalStep u with + | none => none + | some v => evalRounds n v +theorem evalRounds_sound (n : Nat) : + ∀ (u w : WordList), evalRounds n u = some w -> Rounds u w := by + induction n with + | zero => + intro u w h; injection h with h; subst h; exact Rounds.refl u + | succ n ih => + intro u w h + dsimp [evalRounds] at h + cases hV : evalStep u with + | none => rw [hV] at h; contradiction + | some v => + rw [hV] at h + exact Rounds.next (evalStep_sound u v hV) (ih v w h) +theorem good_of_aggState_entry {B H : Nat} {db : WordList} (u high : WordList) (alpha : Rat) + (hD : DigitVal B H db) + (hHeight : wordScale u * ((2 ^ H : Nat) : Rat) = 1) + (hHi : ∃ lo, db = lo ++ high) + (hL : (3 / 2) * alpha * wordScale high <= wordMassK high) + (hR : wordMassK high + 1 <= (5 / 2) * alpha * wordScale high) : + (3 / 2) * alpha <= wordScale u * wordMassK db /\ + wordScale u * wordMassK db <= (5 / 2) * alpha := by + rcases hHi with ⟨lo, rfl⟩ + have hDig := all_isDigitWord_of_digitVal hD + rw [List.all_append, Bool.and_eq_true] at hDig + rcases exists_digitVal_of_all_isDigitWord lo hDig.1 with ⟨A, hDA⟩ + rcases digitVal_scale_and_mass hDA with ⟨hLs, hLm, hLo⟩ + rcases digitVal_scale_and_mass hD with ⟨hDs, _, _⟩ + have hSplit := wordMass_eq_add lo + have hWlo := wordMass_nonneg lo + have hSu := wordScale_pos u + have hSlo := wordScale_pos lo + have hShigh := wordScale_pos high + rw [wordScale_append] at hDs + set x := wordScale u * wordScale lo + have hX : x * wordScale high = 1 := by unfold x; nlinarith + have hXP : 0 < x := by unfold x; nlinarith + have hXL : (3 / 2) * alpha <= x * wordMassK high := by nlinarith + have hXR : x * (wordMassK high + 1) <= (5 / 2) * alpha := by nlinarith + rw [wordMassK_append] + unfold x at * + constructor <;> nlinarith + +end BusyBeaver.WordCalculus diff --git a/BusyBeaver/Calculi/WordCalculusD.lean b/BusyBeaver/Calculi/WordCalculusD.lean new file mode 100644 index 00000000..abdfabf0 --- /dev/null +++ b/BusyBeaver/Calculi/WordCalculusD.lean @@ -0,0 +1,1306 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Calculi.WordCalculusC +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +/-! +# Word Calculus Engine D (`BusyBeaver.Calculi.WordCalculusD`) + +Formal word-rewriting calculus for structured tape transformations, +providing verified macro-step reductions and tile segment chains for family D. +-/ + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.WordCalculus +set_option quotPrecheck false +set_option maxRecDepth 4000000 + +variable {α β γ : Type*} +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +private abbrev t : BitWord := [1, 1, 0, 0] +private abbrev d0 : BitWord := [0, 0] +private abbrev d1 : BitWord := [1, 0] +open Word +local notation "WordList" => List Word +def EntrySpec (q : Nat) (av high : WordList) (lim : Nat) : Prop := + let pre := List.replicate q V ++ av + let alpha := wordMass pre + 5 <= q /\ + wordScale (List.replicate 16 V) * (1 / 2) <= alpha /\ + alpha <= wordScale (List.replicate 16 V) /\ + (3 / 2) * alpha * wordScale high <= wordMassK high /\ + wordMassK high + 1 <= (5 / 2) * alpha * wordScale high /\ + wordScale pre * (lim : Rat) <= alpha * 1024 +theorem entrySpec_scale_bounds (p : Nat) (alpha : Rat) + (hL : wordScale (List.replicate p V) * (1 / 2) <= alpha) + (hR : alpha <= wordScale (List.replicate p V)) : + 1 / 2 <= alpha * ((2 ^ p : Nat) : Rat) /\ alpha * ((2 ^ p : Nat) : Rat) <= 1 := by + have hW := (wordMass_and_scale_replicate_V p).2 + have hPos := rat_pow_two_pos p + constructor <;> nlinarith +def checkEntryOne (q : Nat) (av high : WordList) (lim : Nat) (orig : WordList) : Bool := + match splitPrefixDigits orig with + | none => false + | some (u, tail) => + match stripWordPrefix [Q] tail.reverse with + | none => false + | some rd => + let da := rd.reverse + match stripWordPrefix (List.replicate q V ++ av) u, heightShift u 0 with + | some rest, some H => + if 29 <= H then + if H == da.length then + let (carry, _eff) := evalEffect 0 u + let (last_c, db) := evalEffect carry da + if last_c == 1 then + match stripWordPrefix (List.replicate 7 Q) db, + stripWordPrefix high.reverse db.reverse with + | some _, some _ => + decide (massUpperBound 65536 65536 rest.reverse 0 <= lim) + | _, _ => false + else false + else false + else false + | _, _ => false +theorem good_of_checkEntryOne (q : Nat) (av high : WordList) (lim : Nat) (orig : WordList) + (hEntry : EntrySpec q av high lim) + (hCheck : checkEntryOne q av high lim orig = true) : + AggState av 16 q orig := by + rcases hEntry with ⟨hQ, hAlphaLow, hAlphaHigh, hDlow, hDhigh, hMassLimit⟩ + unfold checkEntryOne at hCheck + cases hC : splitPrefixDigits orig with + | none => rw [hC] at hCheck; contradiction + | some utail => + rcases utail with ⟨u, tail⟩ + rw [hC] at hCheck; dsimp only at hCheck + cases hTop : stripWordPrefix [Q] tail.reverse with + | none => rw [hTop] at hCheck; contradiction + | some rd => + rw [hTop] at hCheck; dsimp only at hCheck + cases hStart : stripWordPrefix (List.replicate q V ++ av) u with + | none => rw [hStart] at hCheck; contradiction + | some rest => + rw [hStart] at hCheck + cases hHeight : heightShift u 0 with + | none => rw [hHeight] at hCheck; contradiction + | some H => + rw [hHeight] at hCheck; dsimp only at hCheck + split_ifs at hCheck with hHbound hWidth hLast + simp only [beq_iff_eq] at hWidth + have hE := evalEffect_sound u 0 + generalize hEff : evalEffect 0 u = ce at hCheck hE hLast + rcases ce with ⟨carry, eff⟩ + dsimp only at hCheck hE hLast + have hF := evalEffect_sound rd.reverse carry + generalize hEffD : evalEffect carry rd.reverse = ldb at hCheck hF hLast + rcases ldb with ⟨last_c, db⟩ + dsimp only at hCheck hF hLast + simp only [beq_iff_eq] at hLast; subst hLast + cases hLow : stripWordPrefix (List.replicate 7 Q) db with + | none => rw [hLow] at hCheck; contradiction + | some lo => + rw [hLow] at hCheck + cases hHigh : stripWordPrefix high.reverse db.reverse with + | none => rw [hHigh] at hCheck; contradiction + | some hi => + rw [hHigh] at hCheck; dsimp only at hCheck + have hMassNat : massUpperBound 65536 65536 rest.reverse 0 <= lim := + of_decide_eq_true hCheck + have hMassQ : ((massUpperBound 65536 65536 rest.reverse 0 : Nat) : Rat) <= + (lim : Rat) := by + exact_mod_cast hMassNat + have hR := massUpperBound_le 65536 65536 rest 0 + have hSplit := wordMass_eq_add rest + have hSpre := wordScale_pos (List.replicate q V ++ av) + have hMassBound : wordScale (List.replicate q V ++ av) * wordMass rest <= + wordMass (List.replicate q V ++ av) * (1 / 64) := by + have h1 : 65536 * wordMass rest <= (lim : Rat) := by push_cast at hR; linarith + nlinarith + rcases splitPrefixDigits_sound orig u tail hC with ⟨hOrig, hDig⟩ + have hEnd := splitPrefixDigits_ends_with_V orig u tail hC + have hTop_eq := stripWordPrefix_sound [Q] tail.reverse rd hTop + have hTail : tail = rd.reverse ++ [Q] := by + have hRev := congrArg List.reverse hTop_eq + simpa using hRev + rw [hTail, List.all_append, Bool.and_eq_true] at hDig + rcases exists_digitVal_of_all_isDigitWord rd.reverse hDig.1 with ⟨A, hDA⟩ + rw [<- hWidth] at hDA + rcases wordEffect_digitVal hF hDA with ⟨B, hDB, hSum⟩ + have hStart_eq := stripWordPrefix_sound (List.replicate q V ++ av) u rest hStart + have hHeight_eq : wordScale u * ((2 ^ H : Nat) : Rat) = 1 := by + have hsp := heightShift_sound u 0 H hHeight + simpa using hsp + have hHigh' : ∃ x, db = x ++ high := by + have hHi_eq := stripWordPrefix_sound high.reverse db.reverse hi hHigh + have hRev := congrArg List.reverse hHi_eq + rw [List.reverse_reverse, List.reverse_append, List.reverse_reverse] at hRev + exact ⟨hi.reverse, hRev⟩ + rcases good_of_aggState_entry u high (wordMass (List.replicate q V ++ av)) + hDB hHeight_eq hHigh' hDlow hDhigh with ⟨hDlo, hDhi⟩ + rcases entrySpec_scale_bounds 16 (wordMass (List.replicate q V ++ + av)) hAlphaLow hAlphaHigh + with ⟨hApLow, hApHigh⟩ + have hOrig_full : orig = u ++ rd.reverse ++ [Q] := by + rw [hOrig, hTail, <- List.append_assoc] + rw [hOrig_full] + refine AggState.intro 16 q H u A rd.reverse carry eff B db (1 / 32) + (wordMass (List.replicate q V ++ av)) + (by omega) hQ hHbound ⟨rest, hStart_eq⟩ hEnd rfl + hApLow hApHigh hHeight_eq hDA hE (by omega) hDB + (Reserve.even 5 (1 / 32) (by norm_num)) + (by rw [hStart_eq, wordMass_append]; linarith) + hDlo hDhi ⟨lo, stripWordPrefix_sound (List.replicate 7 Q) db lo hLow⟩ +def checkEntryTwo (q : Nat) (av high : WordList) (lim : Nat) (orig : WordList) (c1 c2 : Nat) : Bool + := + match splitPrefixDigits orig with + | none => false + | some (u, tail) => + match stripWordPrefix [Q] tail.reverse with + | none => false + | some rd => + let da:=rd.reverse + match stripWordPrefix (List.replicate q V ++ av) u, heightShift u 0 with + | some rest, some H => + if 29 <= H then + if H == da.length then + let u1:=u.take 500 + let u2:=u.drop 500 + if (evalEffect 0 u1).1 == c1 then + if (evalEffect c1 u2).1 == c2 then + let (last_c, db):=evalEffect c2 da + if last_c == 1 then + match stripWordPrefix (List.replicate 7 Q) db, + stripWordPrefix high.reverse db.reverse with + | some _, some _ => + decide (massUpperBound 65536 65536 rest.reverse 0 <= lim) + | _, _ => false + else false + else false + else false + else false + else false + | _, _ => false +theorem good_of_checkEntryTwo (q : Nat) (av high : WordList) (lim : Nat) (orig : WordList) (c1 c2 : + Nat) + (hEntry : EntrySpec q av high lim) + (hCheck : checkEntryTwo q av high lim orig c1 c2 = true) : + AggState av 16 q orig:= by + rcases hEntry with ⟨hQ, hAlphaLow, hAlphaHigh, hDlow, hDhigh, hMassLimit⟩ + unfold checkEntryTwo at hCheck + cases hC : splitPrefixDigits orig with + | none => rw [hC] at hCheck; contradiction + | some utail => + rcases utail with ⟨u, tail⟩ + rw [hC] at hCheck; dsimp only at hCheck + cases hTop : stripWordPrefix [Q] tail.reverse with + | none => rw [hTop] at hCheck; contradiction + | some rd => + rw [hTop] at hCheck; dsimp only at hCheck + cases hStart : stripWordPrefix (List.replicate q V ++ av) u with + | none => rw [hStart] at hCheck; contradiction + | some rest => + rw [hStart] at hCheck + cases hHeight : heightShift u 0 with + | none => rw [hHeight] at hCheck; contradiction + | some H => + rw [hHeight] at hCheck; dsimp only at hCheck + split_ifs at hCheck with hHbound hWidth hc1 hc2 hLast + simp only [beq_iff_eq] at hWidth hc1 hc2 + have hE1:=evalEffect_sound (u.take 500) 0 + rw [hc1] at hE1 + have hE2:=evalEffect_sound (u.drop 500) c1 + rw [hc2] at hE2 + have hE:=wordEffect_append hE1 hE2 + rw [List.take_append_drop] at hE + have hF:=evalEffect_sound rd.reverse c2 + generalize hEffD : evalEffect c2 rd.reverse = ldb at hCheck hF hLast + rcases ldb with ⟨last_c, db⟩ + dsimp only at hCheck hF hLast + simp only [beq_iff_eq] at hLast; subst hLast + cases hLow : stripWordPrefix (List.replicate 7 Q) db with + | none => rw [hLow] at hCheck; contradiction + | some lo => + rw [hLow] at hCheck + cases hHigh : stripWordPrefix high.reverse db.reverse with + | none => rw [hHigh] at hCheck; contradiction + | some hi => + rw [hHigh] at hCheck; dsimp only at hCheck + have hMassNat : massUpperBound 65536 65536 rest.reverse 0 <= + lim:=of_decide_eq_true hCheck + have hMassQ : ((massUpperBound 65536 65536 rest.reverse 0 : Nat) : ℚ) <= + (lim : ℚ):= by + exact_mod_cast hMassNat + have hR:=massUpperBound_le 65536 65536 rest 0 + have hSplit:=wordMass_eq_add rest + have hSpre:=wordScale_pos (List.replicate q V ++ av) + have hMassBound : wordScale (List.replicate q V ++ av) * wordMass rest <= + wordMass (List.replicate q V ++ av) * (1 / 64):= by + have h1 : 65536 * wordMass rest <= (lim : ℚ):= by push_cast at hR; linarith + nlinarith + rcases splitPrefixDigits_sound orig u tail hC with ⟨hOrig, hDig⟩ + have hEnd:=splitPrefixDigits_ends_with_V orig u tail hC + have hTop_eq:=stripWordPrefix_sound [Q] tail.reverse rd hTop + have hTail : tail = rd.reverse ++ [Q]:= by + have hRev:=congrArg List.reverse hTop_eq + simpa using hRev + rw [hTail, List.all_append, Bool.and_eq_true] at hDig + rcases exists_digitVal_of_all_isDigitWord rd.reverse hDig.1 with ⟨A, hDA⟩ + rw [<- hWidth] at hDA + rcases wordEffect_digitVal hF hDA with ⟨B, hDB, hSum⟩ + have hStart_eq:=stripWordPrefix_sound (List.replicate q V ++ av) u rest hStart + have hHeight_eq : wordScale u * ((2 ^ H : Nat) : ℚ) = 1:= by + have hsp:=heightShift_sound u 0 H hHeight + simpa using hsp + have hHigh' : ∃ x, db = x ++ high:= by + have hHi_eq:=stripWordPrefix_sound high.reverse db.reverse hi hHigh + have hRev:=congrArg List.reverse hHi_eq + rw [List.reverse_reverse, List.reverse_append, List.reverse_reverse] at hRev + exact ⟨hi.reverse, hRev⟩ + rcases good_of_aggState_entry u high (wordMass (List.replicate q V ++ av)) + hDB hHeight_eq hHigh' hDlow hDhigh with ⟨hDlo, hDhi⟩ + rcases entrySpec_scale_bounds 16 (wordMass (List.replicate q V ++ + av)) hAlphaLow hAlphaHigh + with ⟨hApLow, hApHigh⟩ + have hOrig_full : orig = u ++ rd.reverse ++ [Q]:= by + rw [hOrig, hTail, <- List.append_assoc] + rw [hOrig_full] + refine AggState.intro 16 q H u A rd.reverse c2 + ((evalEffect 0 (u.take 500)).2 ++ (evalEffect c1 (u.drop 500)).2) B db (1 / 32) + (wordMass (List.replicate q V ++ av)) + (by omega) hQ hHbound ⟨rest, hStart_eq⟩ hEnd rfl + hApLow hApHigh hHeight_eq hDA hE (by omega) hDB + (Reserve.even 5 (1 / 32) (by norm_num)) + (by rw [hStart_eq, wordMass_append]; linarith) + hDlo hDhi ⟨lo, stripWordPrefix_sound (List.replicate 7 Q) db lo hLow⟩ +def wordListBEq : WordList -> WordList -> Bool + | [], [] => true + | V :: a, V :: b => wordListBEq a b + | K :: a, K :: b => wordListBEq a b + | Q :: a, Q :: b => wordListBEq a b + | _, _ => false +theorem wordListBEq_eq (a : WordList) : + ∀ (b : WordList), wordListBEq a b = true -> a = b := by + induction a with + | nil => + intro b h + cases b with + | nil => rfl + | cons _ _ => contradiction + | cons w a ih => + intro b h + cases b with + | nil => cases w <;> contradiction + | cons x b => + cases w <;> cases x <;> try contradiction + all_goals + dsimp [wordListBEq] at h + rw [ih b h] +def optionWordListBEq : Option WordList -> Option WordList -> Bool + | some a, some b => wordListBEq a b + | none, none => true + | _, _ => false +theorem optionWordListBEq_eq (a b : Option WordList) (h : optionWordListBEq a b = true) : a = + b := by + cases a with + | none => cases b <;> first | rfl | contradiction + | some a => + cases b with + | none => contradiction + | some b => exact congrArg some (wordListBEq_eq a b h) +theorem rounds_cons_of_evalStep {u v w : WordList} (h : optionWordListBEq (evalStep u) (some v) = + true) (hr : Rounds v w) : + Rounds u w := + Rounds.next (evalStep_sound u v (optionWordListBEq_eq (evalStep u) (some v) h)) hr +def checkStepTwoPieces (u1 u2 : WordList) (c1 k1 k2 : Nat) (v1 v2 da : WordList) : Bool := + let (c1', eff1) := evalEffect 0 u1 + let (c2', eff2) := evalEffect c1 u2 + if c1' == c1 && c2' == 1 then + match evalPhaseScan 600 eff1 12, evalPhaseScan 600 eff2 k1 with + | some (k1', v1'), some (k2', v2') => + if k1' == k1 && k2' == k2 && v1' == v1 && v2' == v2 then + match decodeDigits 512 k2 with + | some da' => da' == da + | none => false + else false + | _, _ => false + else false +theorem step_of_checkStepTwoPieces (u1 u2 : WordList) (c1 k1 k2 : Nat) (v1 v2 da : WordList) + (hR : checkStepTwoPieces u1 u2 c1 k1 k2 v1 v2 da = true) : + Step (u1 ++ u2) (V :: ((v1 ++ v2) ++ V :: (da ++ [Q]))) := by + unfold checkStepTwoPieces at hR + have hE1 := evalEffect_sound u1 0 + generalize hEff1 : evalEffect 0 u1 = ce1 at hR hE1 + rcases ce1 with ⟨c1', eff1⟩ + have hE2 := evalEffect_sound u2 c1 + generalize hEff2 : evalEffect c1 u2 = ce2 at hR hE2 + rcases ce2 with ⟨c2', eff2⟩ + dsimp only at hR hE1 hE2 + split_ifs at hR with hc + simp only [Bool.and_eq_true, beq_iff_eq] at hc + rcases hc with ⟨hc1, hc2⟩ + subst c1'; subst c2' + cases hS1 : evalPhaseScan 600 eff1 12 with + | none => rw [hS1] at hR; contradiction + | some kv1 => + rw [hS1] at hR + cases hS2 : evalPhaseScan 600 eff2 k1 with + | none => rw [hS2] at hR; contradiction + | some kv2 => + rw [hS2] at hR + rcases kv1 with ⟨k1', v1'⟩ + rcases kv2 with ⟨k2', v2'⟩ + dsimp only at hR + split_ifs at hR with hk + simp only [Bool.and_eq_true, beq_iff_eq] at hk + rcases hk with ⟨⟨⟨hk1, hk2⟩, hv1⟩, hv2⟩ + subst k1'; subst k2'; subst v1'; subst v2' + cases hPw : decodeDigits 512 k2 with + | none => rw [hPw] at hR; contradiction + | some da' => + rw [hPw] at hR + dsimp only at hR + simp only [beq_iff_eq] at hR; subst da' + rcases evalPhaseScan_sound 600 eff1 12 k1 v1 hS1 with ⟨a1, b1, hI1⟩ + rcases evalPhaseScan_sound 600 eff2 k1 k2 v2 hS2 with ⟨a2, b2, hI2⟩ + rcases phaseScan_append hI1 hI2 with ⟨a, b, hI, _, _⟩ + rcases decodeDigits_sound 512 k2 da hPw with ⟨A, J, hDA, hSum⟩ + exact Step.intro (u1 ++ u2) (eff1 ++ eff2) k2 (v1 ++ v2) a b J A da + (wordEffect_append hE1 hE2) hI hDA hSum +def checkStepThreePieces (u1 u2 u3 : WordList) (c1 c2 k1 k2 k3 : Nat) (v1 v2 v3 da1 da2 : WordList) + : Bool := + let (c1', eff1) := evalEffect 0 u1 + let (c2', eff2) := evalEffect c1 u2 + let (c3', eff3) := evalEffect c2 u3 + if c1' == c1 && c2' == c2 && c3' == 1 then + match evalPhaseScan 600 eff1 12, evalPhaseScan 600 eff2 k1, evalPhaseScan 600 eff3 k2 with + | some (k1', v1'), some (k2', v2'), some (k3', v3') => + if k1' == k1 && k2' == k2 && k3' == k3 && v1' == v1 && v2' == v2 && v3' == v3 then + match decodeDigits 512 k3 with + | some da' => da' == (da1 ++ da2) + | none => false + else false + | _, _, _ => false + else false +theorem step_of_checkStepThreePieces (u1 u2 u3 : WordList) (c1 c2 k1 k2 k3 : Nat) (v1 v2 v3 da1 da2 + : WordList) + (hR : checkStepThreePieces u1 u2 u3 c1 c2 k1 k2 k3 v1 v2 v3 da1 da2 = true) : + Step (u1 ++ u2 ++ u3) (V :: ((v1 ++ v2 ++ v3) ++ V :: ((da1 ++ da2) ++ [Q]))) := by + unfold checkStepThreePieces at hR + have hE1 := evalEffect_sound u1 0 + generalize hEff1 : evalEffect 0 u1 = ce1 at hR hE1 + rcases ce1 with ⟨c1', eff1⟩ + have hE2 := evalEffect_sound u2 c1 + generalize hEff2 : evalEffect c1 u2 = ce2 at hR hE2 + rcases ce2 with ⟨c2', eff2⟩ + have hE3 := evalEffect_sound u3 c2 + generalize hEff3 : evalEffect c2 u3 = ce3 at hR hE3 + rcases ce3 with ⟨c3', eff3⟩ + dsimp only at hR hE1 hE2 hE3 + split_ifs at hR with hc + simp only [Bool.and_eq_true, beq_iff_eq] at hc + rcases hc with ⟨⟨hc1, hc2⟩, hc3⟩ + subst c1'; subst c2'; subst c3' + cases hS1 : evalPhaseScan 600 eff1 12 with + | none => rw [hS1] at hR; contradiction + | some kv1 => + rw [hS1] at hR + cases hS2 : evalPhaseScan 600 eff2 k1 with + | none => rw [hS2] at hR; contradiction + | some kv2 => + rw [hS2] at hR + cases hS3 : evalPhaseScan 600 eff3 k2 with + | none => rw [hS3] at hR; contradiction + | some kv3 => + rw [hS3] at hR + rcases kv1 with ⟨k1', v1'⟩ + rcases kv2 with ⟨k2', v2'⟩ + rcases kv3 with ⟨k3', v3'⟩ + dsimp only at hR + split_ifs at hR with hk + simp only [Bool.and_eq_true, beq_iff_eq] at hk + rcases hk with ⟨⟨⟨⟨⟨hk1, hk2⟩, hk3⟩, hv1⟩, hv2⟩, hv3⟩ + subst k1'; subst k2'; subst k3'; subst v1'; subst v2'; subst v3' + cases hPw : decodeDigits 512 k3 with + | none => rw [hPw] at hR; contradiction + | some da' => + rw [hPw] at hR + dsimp only at hR + simp only [beq_iff_eq] at hR; subst da' + rcases evalPhaseScan_sound 600 eff1 12 k1 v1 hS1 with ⟨a1, b1, hI1⟩ + rcases evalPhaseScan_sound 600 eff2 k1 k2 v2 hS2 with ⟨a2, b2, hI2⟩ + rcases evalPhaseScan_sound 600 eff3 k2 k3 v3 hS3 with ⟨a3, b3, hI3⟩ + rcases phaseScan_append hI1 hI2 with ⟨a12, b12, hI12, _, _⟩ + rcases phaseScan_append hI12 hI3 with ⟨a, b, hI, _, _⟩ + rcases decodeDigits_sound 512 k3 (da1 ++ da2) hPw with ⟨A, J, hDA, hSum⟩ + exact Step.intro (u1 ++ u2 ++ u3) (eff1 ++ eff2 ++ eff3) k3 (v1 ++ v2 ++ + v3) a b J A (da1 ++ da2) + (wordEffect_append (wordEffect_append hE1 hE2) hE3) hI hDA hSum +def checkEntryThreePieces (q : Nat) (av high : WordList) (lim : Nat) + (u1 u2 u3 da1 da2 : WordList) (h1 h2 H c1 c2 carry cda r1 r2 : Nat) : Bool := + match stripWordPrefix (List.replicate q V ++ av) u1, + stripWordPrefix [V] u3.reverse, + heightShift u1 0, heightShift u2 h1, heightShift u3 h2 with + | some rest1, some _u3_init_rev, some h1', some h2', some H' => + if h1' == h1 && h2' == h2 && H' == H && decide (29 <= H) then + if H == (da1 ++ da2).length && (da1 ++ da2).all isDigitWord then + let (c1', _) := evalEffect 0 u1 + let (c2', _) := evalEffect c1 u2 + let (c3', _) := evalEffect c2 u3 + let (cda', db1) := evalEffect carry da1 + let (last_c, db2) := evalEffect cda da2 + if c1' == c1 && c2' == c2 && c3' == carry && cda' == cda && last_c == 1 then + match stripWordPrefix (List.replicate 7 Q) (db1 ++ db2), + stripWordPrefix high.reverse (db1 ++ db2).reverse with + | some _, some _ => + let r1' := massUpperBound 65536 65536 u3.reverse 0 + let r2' := massUpperBound 65536 65536 u2.reverse r1 + let r3' := massUpperBound 65536 65536 rest1.reverse r2 + (r1' == r1) && (r2' == r2) && decide (r3' <= lim) + | _, _ => false + else false + else false + else false + | _, _, _, _, _ => false +theorem good_of_checkEntryThreePieces (q : Nat) (av high : WordList) (lim : Nat) + (u1 u2 u3 da1 da2 : WordList) (h1 h2 H c1 c2 carry cda r1 r2 : Nat) + (hEntry : EntrySpec q av high lim) + (hCheck : checkEntryThreePieces q av high lim u1 u2 u3 da1 da2 h1 h2 H c1 c2 carry cda r1 r2 = + true) : + AggState av 16 q ((u1 ++ u2 ++ u3) ++ (da1 ++ da2) ++ [Q]) := by + rcases hEntry with ⟨hQ, hAlphaLow, hAlphaHigh, hDlow, hDhigh, hMassLimit⟩ + unfold checkEntryThreePieces at hCheck + cases hStart : stripWordPrefix (List.replicate q V ++ av) u1 with + | none => rw [hStart] at hCheck; contradiction + | some rest1 => + rw [hStart] at hCheck + cases hEnd : stripWordPrefix [V] u3.reverse with + | none => rw [hEnd] at hCheck; contradiction + | some u3_init_rev => + rw [hEnd] at hCheck + cases hH1 : heightShift u1 0 with + | none => rw [hH1] at hCheck; contradiction + | some h1' => + rw [hH1] at hCheck + cases hH2 : heightShift u2 h1 with + | none => rw [hH2] at hCheck; contradiction + | some h2' => + rw [hH2] at hCheck + cases hH3 : heightShift u3 h2 with + | none => rw [hH3] at hCheck; contradiction + | some H' => + rw [hH3] at hCheck; dsimp only at hCheck + have hE1 := evalEffect_sound u1 0 + generalize hEff1 : evalEffect 0 u1 = ce1 at hCheck hE1 + rcases ce1 with ⟨c1', eff1⟩ + have hE2 := evalEffect_sound u2 c1 + generalize hEff2 : evalEffect c1 u2 = ce2 at hCheck hE2 + rcases ce2 with ⟨c2', eff2⟩ + have hE3 := evalEffect_sound u3 c2 + generalize hEff3 : evalEffect c2 u3 = ce3 at hCheck hE3 + rcases ce3 with ⟨c3', eff3⟩ + have hF1 := evalEffect_sound da1 carry + generalize hEffD1 : evalEffect carry da1 = ldb1 at hCheck hF1 + rcases ldb1 with ⟨cda', db1⟩ + have hF2 := evalEffect_sound da2 cda + generalize hEffD2 : evalEffect cda da2 = ldb2 at hCheck hF2 + rcases ldb2 with ⟨last_c, db2⟩ + dsimp only at hCheck hE1 hE2 hE3 hF1 hF2 + split_ifs at hCheck with hIf1 hIf2 hIf3 + simp only [Bool.and_eq_true, beq_iff_eq, decide_eq_true_eq] at hIf1 hIf2 hIf3 + rcases hIf1 with ⟨⟨⟨hh1, hh2⟩, hH⟩, hHbound⟩ + subst h1'; subst h2'; subst H' + rcases hIf2 with ⟨hWidth, hDig⟩ + rcases hIf3 with ⟨⟨⟨⟨hc1, hc2⟩, hc3⟩, hcda⟩, hlast⟩ + subst c1'; subst c2'; subst c3'; subst cda'; subst last_c + cases hLow : stripWordPrefix (List.replicate 7 Q) (db1 ++ db2) with + | none => rw [hLow] at hCheck; contradiction + | some lo => + rw [hLow] at hCheck + cases hHigh : stripWordPrefix high.reverse (db1 ++ db2).reverse with + | none => rw [hHigh] at hCheck; contradiction + | some hi => + rw [hHigh] at hCheck; dsimp only at hCheck + simp only [Bool.and_eq_true, beq_iff_eq, decide_eq_true_eq] at hCheck + rcases hCheck with ⟨⟨hR1_eq, hR2_eq⟩, hR3_le⟩ + have hRF1 := massUpperBound_le 65536 65536 u3 0 + rw [hR1_eq] at hRF1 + have hRF2 := massUpperBound_le 65536 65536 u2 r1 + rw [hR2_eq] at hRF2 + have hRF3 := massUpperBound_le 65536 65536 rest1 r2 + have hMassQ : ((massUpperBound 65536 65536 rest1.reverse r2 : Nat) : Rat) <= + (lim : Rat) := by + exact_mod_cast hR3_le + have hSp3 := wordMass_eq_add u3 + have hSp2 := wordMass_eq_add u2 + have hSp1 := wordMass_eq_add rest1 + have hSu2 := wordScale_pos u2 + have hSr1 := wordScale_pos rest1 + have hSpre := wordScale_pos (List.replicate q V ++ av) + have hM3 : 65536 * wordMass u3 <= (r1 : Rat) := by push_cast at hRF1; linarith + have hM2 : 65536 * (wordMass u2 + wordScale u2 * wordMass u3) <= (r2 : Rat) := by + push_cast at hRF2; nlinarith + have hM1 : 65536 * (wordMass rest1 + wordScale rest1 * (wordMass u2 + + wordScale u2 * wordMass u3)) <= (lim : Rat) := by + push_cast at hRF3; nlinarith + have hMrest : wordMass (rest1 ++ u2 ++ u3) = + wordMass rest1 + wordScale rest1 * (wordMass u2 + + wordScale u2 * wordMass u3) := by + rw [wordMass_append, wordMass_append, wordScale_append]; ring + have hMassBound : wordScale (List.replicate q V ++ av) * wordMass (rest1 ++ + u2 ++ u3) <= + wordMass (List.replicate q V ++ av) * (1 / 64) := by + rw [hMrest]; nlinarith + have hStart_eq := stripWordPrefix_sound (List.replicate q V ++ av) u1 rest1 hStart + have hU_start : u1 ++ u2 ++ u3 = (List.replicate q V ++ av) ++ (rest1 ++ u2 ++ + u3) := by + rw [hStart_eq]; simp [List.append_assoc] + have hEnd_eq := stripWordPrefix_sound [V] u3.reverse u3_init_rev hEnd + have hU3_end : u3 = u3_init_rev.reverse ++ [V] := by + have hRev := congrArg List.reverse hEnd_eq + simpa using hRev + have hU_end : ∃ rest, u1 ++ u2 ++ u3 = rest ++ [V] := + ⟨u1 ++ u2 ++ u3_init_rev.reverse, by rw [hU3_end]; simp [List.append_assoc]⟩ + have hSpH1 := heightShift_sound u1 0 h1 hH1 + have hSpH2 := heightShift_sound u2 h1 h2 hH2 + have hSpH3 := heightShift_sound u3 h2 H hH3 + have hHeight_eq : wordScale (u1 ++ u2 ++ u3) * ((2 ^ H : Nat) : Rat) = 1 := by + rw [wordScale_append, wordScale_append] + calc (wordScale u1 * wordScale u2 * wordScale u3) * ((2 ^ H : Nat) : Rat) + _ = wordScale u1 * wordScale u2 * (wordScale u3 * ((2 ^ H : Nat) : Rat)) := + by ring + _ = wordScale u1 * (wordScale u2 * ((2 ^ h2 : Nat) : Rat)) := + by rw [hSpH3]; ring + _ = wordScale u1 * ((2 ^ h1 : Nat) : Rat) := by rw [hSpH2] + _ = ((2 ^ 0 : Nat) : Rat) := hSpH1 + _ = 1 := by norm_num + rcases exists_digitVal_of_all_isDigitWord (da1 ++ da2) hDig with ⟨A, hDA⟩ + rw [<- hWidth] at hDA + have hE : WordEffect 0 (u1 ++ u2 ++ u3) carry (eff1 ++ eff2 ++ eff3) := + wordEffect_append (wordEffect_append hE1 hE2) hE3 + have hF : WordEffect carry (da1 ++ da2) 1 (db1 ++ db2) := + wordEffect_append hF1 hF2 + rcases wordEffect_digitVal hF hDA with ⟨B, hDB, hSum⟩ + have hHigh' : ∃ x, db1 ++ db2 = x ++ high := by + have hHi_eq := stripWordPrefix_sound high.reverse (db1 ++ db2).reverse hi hHigh + have hRev := congrArg List.reverse hHi_eq + rw [List.reverse_reverse, List.reverse_append, List.reverse_reverse] at hRev + exact ⟨hi.reverse, hRev⟩ + rcases good_of_aggState_entry (u1 ++ u2 ++ + u3) high (wordMass (List.replicate q V ++ av)) + hDB hHeight_eq hHigh' hDlow hDhigh with ⟨hDlo, hDhi⟩ + rcases entrySpec_scale_bounds 16 (wordMass (List.replicate q V ++ + av)) hAlphaLow hAlphaHigh + with ⟨hApLow, hApHigh⟩ + refine AggState.intro 16 q H (u1 ++ u2 ++ u3) A (da1 ++ da2) carry + (eff1 ++ eff2 ++ eff3) B (db1 ++ db2) (1 / 32) + (wordMass (List.replicate q V ++ av)) + (by omega) hQ hHbound ⟨rest1 ++ u2 ++ u3, hU_start⟩ hU_end rfl + hApLow hApHigh hHeight_eq hDA hE (by omega) hDB + (Reserve.even 5 (1 / 32) (by norm_num)) + (by rw [hU_start, wordMass_append]; linarith) + hDlo hDhi ⟨lo, stripWordPrefix_sound (List.replicate 7 Q) (db1 ++ db2) lo hLow⟩ +def wordScaleDen : WordList -> Nat + | [] => 1 + | V :: v => wordScaleDen v * 2 + | _ :: v => wordScaleDen v +def wordMassNum : WordList -> Nat + | [] => 0 + | V :: v => wordMassNum v + | _ :: v => wordScaleDen v + wordMassNum v * 2 +def wordMassKNum : WordList -> Nat + | [] => 0 + | V :: v => wordMassKNum v + | K :: v => wordScaleDen v + wordMassKNum v * 2 + | Q :: v => wordMassKNum v * 2 +def wordScaleNum : WordList -> Nat + | [] => 1 + | V :: v => wordScaleNum v + | _ :: v => wordScaleNum v * 2 +theorem wordDyadic_sound (u : WordList) : + (0 : Rat) < wordScaleDen u /\ + wordMass u * (wordScaleDen u : Rat) = wordMassNum u /\ + wordMassK u * (wordScaleDen u : Rat) = wordMassKNum u /\ + wordScale u * (wordScaleDen u : Rat) = wordScaleNum u := by + induction u with + | nil => simp [wordScaleDen, wordMass, wordMassNum, wordMassK, wordMassKNum, wordScale, + wordScaleNum] + | cons a v ih => + rcases ih with ⟨hd, he, hf, hh⟩ + cases a <;> ( + simp only [wordScaleDen, wordMass, wordMassNum, wordMassK, wordMassKNum, wordScale, + wordScaleNum, Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat] + refine ⟨by linarith, by nlinarith, by nlinarith, by nlinarith⟩) +def checkEntrySpec (q : Nat) (av high : WordList) (lim : Nat) : Bool := + let pre := List.replicate q V ++ av + let dp := wordScaleDen pre + let ep := wordMassNum pre + let hp := wordScaleNum pre + let dh := wordScaleDen high + let fh := wordMassKNum high + let hh := wordScaleNum high + let d16 := wordScaleDen (List.replicate 16 V) + let h16 := wordScaleNum (List.replicate 16 V) + decide (5 <= q /\ + h16 * dp <= 2 * ep * d16 /\ + ep * d16 <= h16 * dp /\ + 3 * ep * hh <= 2 * fh * dp /\ + 2 * (fh + dh) * dp <= 5 * ep * hh /\ + hp * lim <= ep * 1024) + +theorem checkMassBound_sound (z1e_p z1h_p z1f_k z1h_k z1h_16 : Rat) + (dp dk d16 ep hp fk hk h16 lim : Nat) + (hdp : 0 < dp) (hdk : 0 < dk) (hd16 : 0 < d16) + (hep : z1e_p * dp = ep) (hhp : z1h_p * dp = hp) + (hfk : z1f_k * dk = fk) (hhk : z1h_k * dk = hk) (hh16 : z1h_16 * d16 = h16) + (hN : (h16 * dp : Rat) ≤ 2 * ep * d16 ∧ + (ep * d16 : Rat) ≤ h16 * dp ∧ + (3 * ep * hk : Rat) ≤ 2 * fk * dp ∧ + (2 * (fk + dk) * dp : Rat) ≤ 5 * ep * hk ∧ + (hp * lim : Rat) ≤ ep * 1024) : + z1h_16 ≤ 2 * z1e_p ∧ z1e_p ≤ z1h_16 ∧ 3 * z1e_p * z1h_k ≤ 2 * z1f_k ∧ + 2 * (z1f_k + 1) ≤ 5 * z1e_p * z1h_k ∧ z1h_p * (lim : Rat) ≤ z1e_p * 1024 := by + rcases hN with ⟨c1, c2, c3, c4, c5⟩ + rw [← hep, ← hh16] at c1 c2 + rw [← hep, ← hhk, ← hfk] at c3 c4 + rw [← hep, ← hhp] at c5 + have hdpQ : (0 : Rat) < dp := by exact_mod_cast hdp + have hd16Q : (0 : Rat) < d16 := by exact_mod_cast hd16 + have hdkQ : (0 : Rat) < dk := by exact_mod_cast hdk + refine ⟨?_, ?_, ?_, ?_, ?_⟩ + · nlinarith [mul_pos hdpQ hd16Q] + · nlinarith [mul_pos hdpQ hd16Q] + · nlinarith [mul_pos hdpQ hdkQ] + · nlinarith [mul_pos hdpQ hdkQ] + · nlinarith [hdpQ] + +theorem entrySpec_of_checkEntrySpec {q : Nat} {av high : WordList} {lim : Nat} + (h : checkEntrySpec q av high lim = true) : EntrySpec q av high lim := by + unfold checkEntrySpec at h + dsimp only at h + rcases of_decide_eq_true h with ⟨hq, n1, n2, n3, n4, n5⟩ + unfold EntrySpec + rcases wordDyadic_sound (List.replicate q V ++ av) with ⟨hdp, hep, _, hhp⟩ + rcases wordDyadic_sound high with ⟨hdh, _, hfh, hhh⟩ + rcases wordDyadic_sound (List.replicate 16 V) with ⟨hd16, _, _, hh16⟩ + have c1 : (wordScaleNum (List.replicate 16 V) * wordScaleDen (List.replicate q V ++ + av) : Rat) ≤ 2 * wordMassNum (List.replicate q V ++ + av) * wordScaleDen (List.replicate 16 V) := by exact_mod_cast n1 + have c2 : (wordMassNum (List.replicate q V ++ + av) * wordScaleDen (List.replicate 16 V) : Rat) ≤ + wordScaleNum (List.replicate 16 V) * wordScaleDen (List.replicate q V ++ av) := by + exact_mod_cast n2 + have c3 : (3 * wordMassNum (List.replicate q V ++ + av) * wordScaleNum high : Rat) ≤ 2 * wordMassKNum high * wordScaleDen (List.replicate q V ++ + av) := by exact_mod_cast n3 + have c4 : (2 * (wordMassKNum high + wordScaleDen high) * wordScaleDen (List.replicate q V ++ + av) : Rat) ≤ 5 * wordMassNum (List.replicate q V ++ av) * wordScaleNum high := by + exact_mod_cast n4 + have c5 : (wordScaleNum (List.replicate q V ++ + av) * lim : Rat) ≤ wordMassNum (List.replicate q V ++ av) * 1024 := by exact_mod_cast n5 + rcases checkMassBound_sound + (wordMass (List.replicate q V ++ av)) (wordScale (List.replicate q V ++ + av)) (wordMassK high) (wordScale high) (wordScale (List.replicate 16 V)) + (wordScaleDen (List.replicate q V ++ + av)) (wordScaleDen high) (wordScaleDen (List.replicate 16 V)) + (wordMassNum (List.replicate q V ++ av)) (wordScaleNum (List.replicate q V ++ + av)) (wordMassKNum high) (wordScaleNum high) (wordScaleNum (List.replicate 16 V)) lim + (by exact_mod_cast hdp) (by exact_mod_cast hdh) (by exact_mod_cast hd16) + hep hhp hfh hhh hh16 ⟨c1, c2, c3, c4, c5⟩ with ⟨g1, g2, g3, g4, g5⟩ + exact ⟨hq, by linarith, by linarith, by linarith, by linarith, by linarith⟩ +theorem exists_heightShift_of_mass_lt (u : WordList) : + ∀ (h : Nat), wordMass u < ((2 ^ h : Nat) : ℚ) -> ∃ H, heightShift u h = some H:= by + induction u with + | nil => intro h _; exact ⟨h, rfl⟩ + | cons w u ih => + intro h hM + cases w + · dsimp [wordMass, heightShift] at hM ⊢ + refine ih (h + 1) ?_ + rw [Nat.pow_succ, Nat.cast_mul, Nat.cast_ofNat] + linarith + · cases h with + | zero => + dsimp [wordMass] at hM + have hw:=(wordMass_nonneg u).1 + norm_num at hM + linarith + | succ h => + dsimp [wordMass, heightShift] at hM ⊢ + rw [Nat.pow_succ, Nat.cast_mul, Nat.cast_ofNat] at hM + exact ih h (by linarith) + · cases h with + | zero => + dsimp [wordMass] at hM + have hw:=(wordMass_nonneg u).1 + norm_num at hM + linarith + | succ h => + dsimp [wordMass, heightShift] at hM ⊢ + rw [Nat.pow_succ, Nat.cast_mul, Nat.cast_ofNat] at hM + exact ih h (by linarith) +theorem wordEffect_add_pow_of_heightShift {n : Nat} {u : WordList} {b : Nat} {v : WordList} + (hI : WordEffect n u b v) : + ∀ (h H : Nat), heightShift u h = some H -> WordEffect (n + 2 ^ h) u (b + 2 ^ H) v:= by + induction hI with + | nil n => + intro h H hE + injection hE with hE; subst hE + exact WordEffect.nil (n + 2 ^ h) + | @T n u b v _ ih => + intro h H hE + dsimp [heightShift] at hE + have hIH:=ih (h + 1) H hE + have heq : 1 + (n + 2 ^ h) * 2 = (1 + n * 2) + 2 ^ (h + 1):= by + rw [Nat.pow_succ]; omega + rw [<- heq] at hIH + exact WordEffect.T hIH + | @d00 n u b v _ ih => + intro h H hE + cases h with + | zero => contradiction + | succ h => + dsimp [heightShift] at hE + have hIH:=ih h H hE + have heq : (n + 2 ^ h) * 2 = n * 2 + 2 ^ (h + 1):= by + rw [Nat.pow_succ]; omega + rw [<- heq] + exact WordEffect.d00 hIH + | @d01 n u b v _ ih => + intro h H hE + cases h with + | zero => contradiction + | succ h => + dsimp [heightShift] at hE + have hIH:=ih h H hE + have heq : 1 + (n + 2 ^ h) * 2 = (1 + n * 2) + 2 ^ (h + 1):= by + rw [Nat.pow_succ]; omega + rw [<- heq] + exact WordEffect.d01 hIH + | @d10 n u b v _ ih => + intro h H hE + cases h with + | zero => contradiction + | succ h => + dsimp [heightShift] at hE + have hIH:=ih h H hE + have heq : (n + 2 ^ h) * 2 = n * 2 + 2 ^ (h + 1):= by + rw [Nat.pow_succ]; omega + rw [<- heq] + exact WordEffect.d10 hIH + | @d11 n u b v _ ih => + intro h H hE + cases h with + | zero => contradiction + | succ h => + dsimp [heightShift] at hE + have hIH:=ih h H hE + have heq1 : (1 + n) + 2 ^ h = 1 + (n + 2 ^ h):= by omega + rw [heq1] at hIH + have heq2 : 1 + (n + 2 ^ h) * 2 = (1 + n * 2) + 2 ^ (h + 1):= by + rw [Nat.pow_succ]; omega + rw [<- heq2] + exact WordEffect.d11 hIH +theorem wordEffect_replicate_K_pad {u : WordList} {b : Nat} {v : WordList} {H : Nat} + (hI : WordEffect 0 u b v) (hM : wordMass u < + 1) (hHeight : wordScale u * ((2 ^ H : Nat) : ℚ) = 1) : + WordEffect 1 u (b + 2 ^ H) v:= by + have hM' : wordMass u < ((2 ^ 0 : Nat) : ℚ):= by norm_num; exact hM + rcases exists_heightShift_of_mass_lt u 0 hM' with ⟨J, hJ⟩ + have hSpec:=heightShift_sound u 0 J hJ + have hPos:=wordScale_pos u + have hPowQ : ((2 ^ J : Nat) : ℚ) = ((2 ^ H : Nat) : ℚ):= by + change wordScale u * ((2 ^ J : Nat) : ℚ) = 1 at hSpec + exact mul_left_cancel₀ (ne_of_gt hPos) (hSpec.trans hHeight.symm) + have hPow : 2 ^ J = 2 ^ H:= by exact_mod_cast hPowQ + have hShift:=wordEffect_add_pow_of_heightShift hI 0 J hJ + rwa [hPow] at hShift +theorem exists_wordEffect_carry_of_add_eq {n : Nat} {da : WordList} {A H B : Nat} + (hD : DigitVal A H da) (hSum : A + n = B + 2 ^ H) (hBound : B < 2 ^ H) : + ∃ d, DigitVal B H d /\ WordEffect (n + 2 ^ H) (da ++ [K]) 1 (d ++ [K]):= by + rcases exists_wordEffect da (n + 2 ^ H) with ⟨b, d, hE⟩ + rcases wordEffect_digitVal hE hD with ⟨C, hCd, hEq⟩ + have hCb:=lt_pow_of_digitVal hCd + have hb2 : b = 2:= by + rcases b with _ | _ | _ | b' + · omega + · omega + · rfl + · have : 2 ^ H + 2 ^ H + 2 ^ H <= (b' + 1 + 1 + 1) * 2 ^ H:= by + have hmul : (b' + 1 + 1 + 1) * 2 ^ H = b' * 2 ^ H + 2 ^ H + 2 ^ H + 2 ^ H:= by ring + omega + omega + subst hb2 + have hCB : C = B:= by omega + subst hCB + refine ⟨d, hCd, wordEffect_append hE ?_⟩ + exact @WordEffect.d00 1 [] 1 [] (WordEffect.nil 1) +theorem phaseScan_add_pow_replicate_K {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : ℚ} + (hI : PhaseScan k u k' v a b) : + ∀ (h m : Nat), k = m + 4 * 2 ^ h -> + wordMass v < ((2 ^ h : Nat) : ℚ) -> + 8 * wordMass v < (m : ℚ) - 4 -> + ∃ H m', heightShift v h = some H /\ k'=m' + 4 * 2 ^ H /\ PhaseScan m u m' v a b:= by + induction hI with + | nil k => + intro h m hEq _ _ + exact ⟨h, m, rfl, hEq, PhaseScan.nil m⟩ + | @T n u k v a b _ ih => + intro h m hEq hM hBound + have hw:=(wordMass_nonneg (V :: v)).1 + have hPosQ : (4 : ℚ) < (m : ℚ):= by linarith + have hPos : 4 < m:= by exact_mod_cast hPosQ + set n':=n - 4 * 2 ^ h + have hN : n = 4 * 2 ^ h + n':= by omega + have hE : m = 3 + n':= by omega + subst hE + dsimp [wordMass, heightShift] at hM hBound ⊢ + rcases ih (h + 1) (2 + n' * 2) + (by rw [Nat.pow_succ]; omega) + (by rw [Nat.pow_succ, Nat.cast_mul, Nat.cast_ofNat]; linarith) + (by push_cast at hBound ⊢; linarith) + with ⟨H, m', hHt, hK, hS⟩ + exact ⟨H, m', hHt, hK, PhaseScan.T hS⟩ + | @pair0 n u k v a b _ ih => + intro h m hEq hM hBound + have hw:=(wordMass_nonneg (V :: v)).1 + have hPosQ : (4 : ℚ) < (m : ℚ):= by linarith + have hPos : 4 < m:= by exact_mod_cast hPosQ + set n':=n - 4 * 2 ^ h + have hN : n = 4 * 2 ^ h + n':= by omega + have hE : m = 1 + n':= by omega + subst hE + dsimp [wordMass, heightShift] at hM hBound ⊢ + rcases ih (h + 1) (n' * 2) + (by rw [Nat.pow_succ]; omega) + (by rw [Nat.pow_succ, Nat.cast_mul, Nat.cast_ofNat]; linarith) + (by push_cast at hBound ⊢; linarith) + with ⟨H, m', hHt, hK, hS⟩ + exact ⟨H, m', hHt, hK, PhaseScan.pair0 hS⟩ + | @pair1 n u k v a b _ ih => + intro h m hEq hM hBound + have hw:=(wordMass_nonneg (V :: v)).1 + have hPosQ : (4 : ℚ) < (m : ℚ):= by linarith + have hPos : 4 < m:= by exact_mod_cast hPosQ + set n':=n - 4 * 2 ^ h + have hN : n = 4 * 2 ^ h + n':= by omega + have hE : m = 1 + n':= by omega + subst hE + dsimp [wordMass, heightShift] at hM hBound ⊢ + rcases ih (h + 1) (1 + n' * 2) + (by rw [Nat.pow_succ]; omega) + (by rw [Nat.pow_succ, Nat.cast_mul, Nat.cast_ofNat]; linarith) + (by push_cast at hBound ⊢; linarith) + with ⟨H, m', hHt, hK, hS⟩ + exact ⟨H, m', hHt, hK, PhaseScan.pair1 hS⟩ + | @short00 n u k v a b _ ih => + intro h m hEq hM hBound + have hw:=(wordMass_nonneg v).1 + cases h with + | zero => + dsimp [wordMass] at hM + norm_num at hM + linarith + | succ h => + dsimp [wordMass, heightShift] at hM hBound ⊢ + have hPosQ : (4 : ℚ) < (m : ℚ):= by linarith + have hPos : 4 < m:= by exact_mod_cast hPosQ + rw [Nat.pow_succ] at hEq + set n':=n - 2 * 2 ^ h + have hN : n = 2 * 2 ^ h + n':= by omega + have hE : m = 2 + n' * 4:= by omega + subst hE + rcases ih h (n' * 2) + (by omega) + (by rw [Nat.pow_succ, Nat.cast_mul, Nat.cast_ofNat] at hM; linarith) + (by push_cast at hBound ⊢; linarith) + with ⟨H, m', hHt, hK, hS⟩ + exact ⟨H, m', hHt, hK, PhaseScan.short00 hS⟩ + | @short01 n u k v a b _ ih => + intro h m hEq hM hBound + have hw:=(wordMass_nonneg v).1 + cases h with + | zero => + dsimp [wordMass] at hM + norm_num at hM + linarith + | succ h => + dsimp [wordMass, heightShift] at hM hBound ⊢ + have hPosQ : (4 : ℚ) < (m : ℚ):= by linarith + have hPos : 4 < m:= by exact_mod_cast hPosQ + rw [Nat.pow_succ] at hEq + set n':=n - 2 * 2 ^ h + have hN : n = 2 * 2 ^ h + n':= by omega + have hE : m = 2 + n' * 4:= by omega + subst hE + rcases ih h (1 + n' * 2) + (by omega) + (by rw [Nat.pow_succ, Nat.cast_mul, Nat.cast_ofNat] at hM; linarith) + (by push_cast at hBound ⊢; linarith) + with ⟨H, m', hHt, hK, hS⟩ + exact ⟨H, m', hHt, hK, PhaseScan.short01 hS⟩ + | @short10 n u k v a b _ ih => + intro h m hEq hM hBound + have hw:=(wordMass_nonneg v).1 + cases h with + | zero => + dsimp [wordMass] at hM + norm_num at hM + linarith + | succ h => + dsimp [wordMass, heightShift] at hM hBound ⊢ + have hPosQ : (4 : ℚ) < (m : ℚ):= by linarith + have hPos : 4 < m:= by exact_mod_cast hPosQ + rw [Nat.pow_succ] at hEq + set n':=n - 2 * 2 ^ h + have hN : n = 2 * 2 ^ h + n':= by omega + have hE : m = 4 + n' * 4:= by omega + subst hE + rcases ih h (n' * 2) + (by omega) + (by rw [Nat.pow_succ, Nat.cast_mul, Nat.cast_ofNat] at hM; linarith) + (by push_cast at hBound ⊢; linarith) + with ⟨H, m', hHt, hK, hS⟩ + exact ⟨H, m', hHt, hK, PhaseScan.short10 hS⟩ + | @short11 n u k v a b _ ih => + intro h m hEq hM hBound + have hw:=(wordMass_nonneg v).1 + cases h with + | zero => + dsimp [wordMass] at hM + norm_num at hM + linarith + | succ h => + dsimp [wordMass, heightShift] at hM hBound ⊢ + have hPosQ : (4 : ℚ) < (m : ℚ):= by linarith + have hPos : 4 < m:= by exact_mod_cast hPosQ + rw [Nat.pow_succ] at hEq + set n':=n - 2 * 2 ^ h + have hN : n = 2 * 2 ^ h + n':= by omega + have hE : m = 4 + n' * 4:= by omega + subst hE + rcases ih h (1 + n' * 2) + (by omega) + (by rw [Nat.pow_succ, Nat.cast_mul, Nat.cast_ofNat] at hM; linarith) + (by push_cast at hBound ⊢; linarith) + with ⟨H, m', hHt, hK, hS⟩ + exact ⟨H, m', hHt, hK, PhaseScan.short11 hS⟩ +inductive LowerStep : WordList -> WordList -> Prop where + | intro (orig : WordList) (padding : Nat) (eff : WordList) (k : Nat) (v : WordList) + (a b : ℚ) (J : Nat) (da : WordList) : + WordEffect 1 (orig ++ List.replicate padding K) 1 eff -> + PhaseScan 8 eff k v a b -> + 0 < k -> + DigitVal k J da -> + LowerStep orig (V :: (v ++ V :: da)) +set_option maxHeartbeats 2000000 in +-- Phase-scan + lower-step case analysis requires higher heartbeat budget +theorem aggState_lowerStep_of_copyTwelve (av ev : WordList) (hSafe : isSafePrefix ev = true) + (hStable : ∀ q, 5 <= q -> CopyTwelve (List.replicate q V ++ av) (List.replicate q V ++ ev)) : + ∀ (p q : Nat) (w : WordList), AggState av p q (w ++ [Q]) -> + ∃ out, LowerStep w out /\ AggState av (1 + p) (1 + q) (out ++ [Q]):= by + intro p q w hG + generalize hWhole : w ++ [Q]=orig at hG + rcases hG with ⟨H, u, A, da, carry, eff, B, db, tau, alpha, + hP, hQ, hHbound, ⟨rest, hStart⟩, hEnd, hMass, hApLow, hApHigh, hHeight, + hDA, hEff, hSum, hDB, hRes, hM, hDlo, hDhi, hLow⟩ + have hw_eq : w = u ++ da:= by + have h1 : (u ++ da) ++ [Q]=w ++ [Q]:= by simpa [List.append_assoc] using hWhole.symm + exact (List.append_inj_left' h1 rfl).symm + subst hw_eq + set pre:=List.replicate q V ++ av + set pe:=List.replicate q V ++ ev + set unit:=wordScale u + have hPowP:=rat_pow_two_pos p + have hAlpha : 0 < alpha:= by nlinarith + have hUnit : 0 < unit:=wordScale_pos u + set dyadic:=wordScale (List.replicate p V) + have hDP : dyadic * ((2 ^ p : Nat) : ℚ) = 1:=(wordMass_and_scale_replicate_V p).2 + have hDyadic : 0 < dyadic:=wordScale_pos (List.replicate p V) + have hAupper : alpha <= dyadic:= by nlinarith + have hAsmall : dyadic <= 1 / 65536:=wordScale_replicate_V_le_inv_65536 p hP + rcases reserve_pos_and_le hRes hP with ⟨hTau, hTauSmall⟩ + have hUsmall : unit <= alpha * (1 / 1024) := + unit_le_alpha_div_1024 p H alpha unit (by omega) hAlpha hUnit hApLow hHeight + rcases hStable q hQ with ⟨bc, kc, hCopyPre⟩ + have hSafePre : isSafePrefix pe = true:=isSafePrefix_replicate_V_append q ev hSafe + rcases copy_defect_bound hCopyPre with ⟨hLedger, hRhoLow, hRhoHigh⟩ + set rho:=copyDefect pre pe - 2 * alpha + have hRho : 0 <= rho /\ rho <= 2 * alpha:= by + unfold rho; rw [<- hMass]; push_cast at hLedger hRhoLow hRhoHigh; constructor <;> linarith + rcases wordEffect_preserves_scale_and_mass hEff with ⟨hEffScale, hEffMass⟩ + rcases wordEffect_preserves_ends_with_V hEff hEnd with ⟨last_w, hElast⟩ + have hCut : notEndsWithQ eff = true:= by rw [hElast, notEndsWithQ_append_singleton]; rfl + have hNe : eff ≠ []:= by rw [hElast]; simp + have hEffHeight : wordScale eff * ((2 ^ H : Nat) : ℚ) = 1:= by rw [hEffScale]; exact hHeight + have hEffBound : wordMass eff + wordScale eff * (1 + wordMassK db) <= 1 / 128:= by + rw [hEffScale]; nlinarith + rcases exists_phaseScan_twelve eff B H db hDB hEffHeight hCut hNe hEffBound with ⟨k, v, a, b, + hIscan, hK⟩ + have hZ : 0 < wordMassK db:= by nlinarith + rcases digitVal_massK_scale_bound p H B db dyadic unit hDB (by omega) (by omega) + hDyadic hUnit (by linarith) hDP hHeight (by nlinarith) with ⟨hi, hHi⟩ + rcases digitVal_sandwich_split ((p - 2) / 2) (p - 2) hDB hZ hLow ⟨hi, hHi⟩ + with ⟨c, mid, t0, hSplit, hMidCut, hC, hT⟩ + rcases phaseScan_digitVal_length_bound eff db B H 12 k v a b p c mid t0 hDB hEffHeight hIscan + hCut hMidCut hSplit hP hC hT with ⟨J, hJbound, hJheight⟩ + set new_u:=V :: (v ++ [V]) + set nu:=wordScale new_u + have hNu : 0 < nu:=wordScale_pos new_u + have hNuSmall : nu <= alpha * (1 / 1024) := + unit_le_alpha_div_1024 p J alpha nu (by omega) hAlpha hNu hApLow hJheight + have hEffRest : ∃ w, eff = pe ++ w /\ WordEffect bc rest carry w:= by + rw [hStart] at hEff + exact copy_split_effect hCopyPre rest carry eff hEff + rcases hEffRest with ⟨w, hEstart, hEw⟩ + rcases wordEffect_preserves_scale_and_mass hEw with ⟨hWscale, hWmass⟩ + have hWcut : notEndsWithQ w = true:= by + rw [hEstart] at hCut; exact notEndsWithQ_of_append_left pe w hCut + set e:=wordMass u - alpha + have hEeq : e = wordScale pre * wordMass w:= by + unfold e; rw [hStart, wordMass_append, <- hWmass, hMass]; ring + have hWw:=wordMass_nonneg w + have hSpre:=wordScale_pos pre + have hEpos : 0 <= e:= by nlinarith + have hEbound : e <= alpha * ((3 / 64) - tau):= by unfold e; linarith + set s:=(p - 2) / 2 + set pow:=((2 ^ (s + s / 2) : Nat) : ℚ) + have hPow : 0 < pow:=rat_pow_two_pos (s + s / 2) + set f:=unit + 2 * unit * wordMassK db / pow + have hFeq : f * pow = unit * pow + 2 * unit * wordMassK db:= by + unfold f; have hne : pow ≠ 0:=ne_of_gt hPow + calc (unit + 2 * unit * wordMassK db / pow) * pow + _ = unit * pow + (2 * unit * wordMassK db / pow) * pow:= by ring + _ = unit * pow + 2 * unit * wordMassK db:= by rw [div_mul_cancel₀ _ hne] + have hFpos : 0 <= f:= by + have h1 : 0 <= f * pow:= by rw [hFeq]; nlinarith + nlinarith + have hFbound : f <= alpha * tau * (1 / 4) := + reserve_height_bound p H s alpha unit tau f hRes hP hHbound rfl hAlpha hUnit hApLow hHeight (by + nlinarith) + have hLow' : ∃ c0 w0, (0 < c0 /\ s <= c0) /\ db = List.replicate c0 Q ++ K :: w0 := + ⟨c, mid ++ List.replicate t0 Q, ⟨by omega, hC⟩, hSplit⟩ + have hFactor : wordScale pre * wordScale w = unit:= by + unfold unit; rw [hWscale, hStart, <- wordScale_append] + have hScanStart : PhaseScan 12 (pe ++ w ++ db ++ [K]) k v a b:= by + rw [hEstart] at hIscan; simpa [List.append_assoc] using hIscan + rcases copy_phaseScan_digitVal_bound pre pe bc kc w db B H k v a b s e f hCopyPre hSafePre + hScanStart hDB hWcut hLow' hEeq (by rw [hFactor]; nlinarith) + with ⟨tail, hVstart, hMnext, hDl, hDu⟩ + change wordMass new_u <= wordMass pre * (1 / 2) + (e + f) * (1 / 2) at hMnext + rw [hMass] at hMnext + have hDl' : 2 * alpha + rho - e * (1 / 4) - 3 * f <= a - b:= by unfold rho; linarith + have hDu' : a - b <= 2 * alpha + rho + 4 * e + 4 * f:= by unfold rho; linarith + rcases exists_wordEffect new_u 0 with ⟨carry', eff', hEff'⟩ + have hNewStart : new_u = (V :: pre) ++ (tail ++ [V]):= by + unfold new_u; rw [hVstart]; simp [List.append_assoc] + have hPre_step : List.replicate (1 + q) V ++ av = V :: pre:= by + unfold pre; rw [replicate_one_add_cons, List.cons_append] + have hPe_step : List.replicate (1 + q) V ++ ev = V :: pe:= by + unfold pe; rw [replicate_one_add_cons, List.cons_append] + rcases hStable (1 + q) (by omega) with ⟨bc', kc', hCopyNew⟩ + rw [hPre_step, hPe_step] at hCopyNew + have hEff'_rw : WordEffect 0 ((V :: pre) ++ (tail ++ [V])) carry' eff':= by + rwa [<- hNewStart] + have hRbounds:=copy_effect_phaseScan_combine (V :: pre) (V :: pe) bc' kc' (tail ++ + [V]) carry' eff' hCopyNew hEff'_rw + rw [<- hNewStart] at hRbounds + have hNewMass : wordMass new_u = + alpha * (1 / 2) + (wordScale pre * (1 / 2)) * wordMass (tail ++ [V]):= by + rw [hNewStart, wordMass_append]; dsimp [wordMass, wordScale]; rw [hMass] + have hCloss_step : copyDefect (V :: pre) (V :: pe) - 2 * wordMass (V :: pre) = rho * (1 / 2):= by + unfold rho copyDefect; dsimp [wordMass, wordMassQ, wordScale]; rw [hMass]; ring + have hScale_step : wordScale (V :: pre) * wordMass (tail ++ + [V]) = wordMass new_u - alpha * (1 / 2):= by + dsimp [wordScale]; linarith + set R:=((1 + carry' : Nat) : ℚ) * nu - 1 + have hRb : rho * (1 / 2) <= R /\ R <= rho * (1 / 2) + 2 * (wordMass new_u - alpha * (1 / 2)):= by + unfold R nu; constructor <;> linarith + have hWtail:=wordMass_nonneg (tail ++ [V]) + have hEnew : 0 <= wordMass new_u - alpha * (1 / 2):= by nlinarith + have hFtiny : f <= alpha * (1 / 128):= by nlinarith + have hEtiny : e <= alpha * (3 / 64):= by nlinarith + have hBudget:=phaseScan_twelve_scale_eq (eff ++ db ++ [K]) k v a b hIscan + rcases carry_budget_contraction_ineq J k carry' alpha nu (a - b) R rho + hAlpha (by linarith) hNu hNuSmall hJheight hRho.1 hRho.2 + (by linarith) (by linarith) hRb.1 (by linarith) hBudget (by unfold R; ring) + with ⟨A', B', hAsum, hBsum, hAl, hAu, hBl, hBu⟩ + rcases exists_digitVal_of_lt_pow J A' hAu with ⟨da', hDA'⟩ + rcases exists_digitVal_of_lt_pow J B' hBu with ⟨db', hDB'⟩ + rcases reserve_step_contract hRes with ⟨tau', hRes', hTauStep⟩ + have hMkeep:=reserve_next_step_bound alpha tau tau' e f (wordMass new_u - alpha * (1 / 2)) + (by linarith) hTauStep hEbound hFbound (by linarith) + have hDkeep:=step_mass_contraction_ineq alpha e f nu (a - b) R (wordMass new_u - alpha * (1 / 2)) + rho + hAlpha hEpos hFpos (by linarith) hEtiny hFtiny hNuSmall hEnew (by linarith) + hRb.1 hRb.2 hDl' hDu' + have hDef:=phaseScan_twelve_height_sum (eff ++ db ++ + [K]) k v a b J A' B' carry' hIscan hJheight hAsum hBsum + have hZnew:=digitVal_wordMassK_eq hDB' + have hDnew : nu * wordMassK db'=(a - b) * (1 / 2) - 4 * nu - R:= by + have hZ' : nu * wordMassK db'=1 - ((1 + B' : Nat) : ℚ) * nu:= by + calc nu * wordMassK db' + _ = nu * ((wordMassK db' + (B' : ℚ) + 1) - (1 + (B' : ℚ))):= by ring + _ = nu * (((2 ^ J : Nat) : ℚ) - (1 + (B' : ℚ))):= by rw [hZnew] + _ = nu * ((2 ^ J : Nat) : ℚ) - (1 + (B' : ℚ)) * nu:= by ring + _ = 1 - (1 + (B' : ℚ)) * nu:= by rw [hJheight] + _ = 1 - ((1 + B' : Nat) : ℚ) * nu:= by push_cast; ring + rw [hZ'] + exact hDef + have hLowNew : ∃ rest, db'=List.replicate (((1 + p) - 2) / 2) Q ++ rest:= by + set r:=(((1 + p) - 2) / 2) - 1 + have hHr : 1 + r = ((1 + p) - 2) / 2 /\ 1 + r * 2 <= p - 2:= by omega + have hHighEnd : ∃ z, db = z ++ List.replicate (1 + r * 2) Q:= by + refine ⟨hi ++ List.replicate ((p - 2) - (1 + r * 2)) Q, ?_⟩ + have heq : ((p - 2) - (1 + r * 2)) + (1 + r * 2) = p - 2:= by omega + rw [List.append_assoc, <- List.replicate_add, heq, <- hHi] + rcases hHighEnd with ⟨z, hHZ⟩ + have hSC : PhaseScan 12 ((eff ++ z) ++ List.replicate (1 + r * 2) Q ++ [K]) k v a b:= by + rw [hHZ] at hIscan; simpa [List.append_assoc] using hIscan + rcases phaseScan_effect_split r 12 (eff ++ z) k v a b carry' eff' A' B' J db' + hSC hEff' hDB' (by omega) hAsum hBsum with ⟨z', hL⟩ + rw [hHr.1] at hL + exact ⟨z', hL⟩ + have hAp_step : (alpha * (1 / 2)) * ((2 ^ (1 + p) : Nat) : ℚ) = alpha * ((2 ^ p : Nat) : ℚ):= by + rw [pow_two_one_add, Nat.cast_add]; ring + rcases reserve_pos_and_le hRes' (by omega) with ⟨hTau', _⟩ + have hMv_eq : wordMass new_u = wordMass v * (1 / 2):= by + unfold new_u; dsimp [wordMass]; rw [wordMass_append]; dsimp [wordMass]; ring + have hMv_small : wordMass v < 1 / 64:= by + linarith [hMv_eq, hMnext, hEtiny, hFtiny, hAupper, hAsmall] + rcases phaseScan_add_pow_replicate_K hIscan 0 8 rfl (by norm_num; linarith) + (by norm_num; linarith) + with ⟨Hv, k', hVH, hKS, hSS⟩ + have hVHeight:=heightShift_sound v 0 Hv hVH + have hScale_new : nu = wordScale v * (1 / 4):= by + unfold nu new_u; dsimp [wordScale]; rw [wordScale_append]; dsimp [wordScale]; ring + have hSv_pos:=wordScale_pos v + have hPowQ : ((2 ^ J : Nat) : ℚ) = ((4 * 2 ^ Hv : Nat) : ℚ):= by + change wordScale v * ((2 ^ Hv : Nat) : ℚ) = 1 at hVHeight + rw [Nat.cast_mul, Nat.cast_ofNat] + have h1 : nu * ((2 ^ J : Nat) : ℚ) = nu * (4 * ((2 ^ Hv : Nat) : ℚ)):= by + calc nu * ((2 ^ J : Nat) : ℚ) = 1:=hJheight + _ = wordScale v * ((2 ^ Hv : Nat) : ℚ):=hVHeight.symm + _ = (nu * 4) * ((2 ^ Hv : Nat) : ℚ):= by rw [hScale_new]; ring + _ = nu * (4 * ((2 ^ Hv : Nat) : ℚ)):= by ring + exact mul_left_cancel₀ (ne_of_gt hNu) h1 + have hPowJ : 2 ^ J = 4 * 2 ^ Hv:= by exact_mod_cast hPowQ + have hk'_eq : k'=A':= by omega + rw [hk'_eq] at hSS + have hMu_small : wordMass u < 1:= by + have he_def : e = wordMass u - alpha:=rfl + linarith [he_def, hEtiny, hAupper, hAsmall] + have hEff1 : WordEffect 1 u (carry + 2 ^ H) eff := + wordEffect_replicate_K_pad hEff hMu_small hHeight + rcases exists_wordEffect_carry_of_add_eq hDA hSum (lt_pow_of_digitVal hDB) with ⟨d, hDD, hEE1⟩ + have hd_eq : d = db:=digitVal_unique hDD hDB + rw [hd_eq] at hEE1 + have hEffFull : WordEffect 1 ((u ++ da) ++ List.replicate 1 K) 1 (eff ++ db ++ [K]):= by + simpa [List.append_assoc] using wordEffect_append hEff1 hEE1 + have hPosJ:=pow_two_pos J + have hPosA' : 0 < A':= by omega + refine ⟨new_u ++ da', ?_, ?_⟩ + · have hOut_eq : new_u ++ da'=V :: (v ++ V :: da'):= by + unfold new_u; simp [List.append_assoc] + rw [hOut_eq] + exact LowerStep.intro (u ++ da) 1 (eff ++ db ++ [K]) A' v a b J da' + hEffFull hSS hPosA' hDA' + · refine AggState.intro (1 + p) (1 + q) J new_u A' da' carry' eff' B' db' tau' (alpha * (1 / 2)) + (by omega) (by omega) (by omega) + ⟨tail ++ [V], by rw [hPre_step]; exact hNewStart⟩ ⟨V :: v, rfl⟩ + (by rw [hPre_step]; dsimp [wordMass]; rw [hMass]) + (by rw [hAp_step]; exact hApLow) + (by rw [hAp_step]; exact hApHigh) + hJheight hDA' hEff' (by omega) hDB' hRes' + (by linarith) (by rw [hDnew]; linarith) (by rw [hDnew]; linarith) hLowNew +def evalLowerAfterEffect (eff : WordList) : Option (WordList) := + match evalPhaseScan 1024 eff 8 with + | some (k, v) => + if 0 < k then + match decodeDigits 512 k with + | some da => some (V :: (v ++ V :: (da ++ [Q]))) + | none => none + else none + | none => none +def evalLowerStep (u : WordList) : Option (WordList) := + let (carry, eff):=evalEffect 1 (u ++ [K]) + if carry == 1 then evalLowerAfterEffect eff + else if carry == 2 then evalLowerAfterEffect (eff ++ [K]) + else none +theorem lowerStep_of_evalLowerAfterEffect (u : WordList) (padding : Nat) (eff out : WordList) + (hE : WordEffect 1 (u ++ List.replicate padding K) 1 eff) + (hS : evalLowerAfterEffect eff = some out) : + LowerStep u out:= by + unfold evalLowerAfterEffect at hS + cases hScan : evalPhaseScan 1024 eff 8 with + | none => rw [hScan] at hS; contradiction + | some kv => + rw [hScan] at hS + rcases kv with ⟨k, v⟩ + dsimp only at hS + split_ifs at hS with hk0 + cases hPw : decodeDigits 512 k with + | none => rw [hPw] at hS; contradiction + | some da => + rw [hPw] at hS + injection hS with hS; subst hS + rcases evalPhaseScan_sound 1024 eff 8 k v hScan with ⟨a, b, hI⟩ + rcases decodeDigits_sound 512 k da hPw with ⟨A, J, hDA, hSum⟩ + have hDFull : DigitVal k (J + 1) (da ++ [Q]):= by + have h:=digitVal_append hDA (DigitVal.one DigitVal.nil) + have heq : A + 1 * 2 ^ J = k:= by omega + rwa [heq] at h + exact LowerStep.intro u padding eff k v a b (J + 1) (da ++ [Q]) hE hI hk0 hDFull +theorem evalLowerStep_sound (u out : WordList) (hR : evalLowerStep u = some out) : + LowerStep u out:= by + unfold evalLowerStep at hR + have hE:=evalEffect_sound (u ++ [K]) 1 + generalize hEff : evalEffect 1 (u ++ [K]) = ce at hR hE + rcases ce with ⟨carry, eff⟩ + dsimp only at hR hE + split_ifs at hR with hc1 hc2 + · simp only [beq_iff_eq] at hc1; subst hc1 + exact lowerStep_of_evalLowerAfterEffect u 1 eff out hE hR + · simp only [beq_iff_eq] at hc2; subst hc2 + have hE2 : WordEffect 1 (u ++ List.replicate 2 K) 1 (eff ++ [K]):= by + have h00 : WordEffect 2 [K] 1 [K]:=@WordEffect.d00 1 [] 1 [] (WordEffect.nil 1) + simpa [List.replicate, List.append_assoc] using wordEffect_append hE h00 + exact lowerStep_of_evalLowerAfterEffect u 2 (eff ++ [K]) out hE2 hR +inductive LowerRounds : WordList -> WordList -> Prop where + | refl (u : WordList) : LowerRounds u u + | next {u v w : WordList} : LowerStep u v -> LowerRounds v w -> LowerRounds u w +theorem lowerRounds_trans {u v w : WordList} (h1 : LowerRounds u v) (h2 : LowerRounds v w) : + LowerRounds u w:= by + induction h1 with + | refl _ => exact h2 + | next hS _ ih => exact LowerRounds.next hS (ih h2) +def evalLowerRounds : Nat -> WordList -> Option (WordList) + | 0, u => some u + | n + 1, u => + match evalLowerStep u with + | none => none + | some v => evalLowerRounds n v +theorem evalLowerRounds_sound (n : Nat) : + ∀ (u w : WordList), evalLowerRounds n u = some w -> LowerRounds u w:= by + induction n with + | zero => + intro u w h; injection h with h; subst h; exact LowerRounds.refl u + | succ n ih => + intro u w h + dsimp [evalLowerRounds] at h + cases hR : evalLowerStep u with + | none => rw [hR] at h; contradiction + | some v => + rw [hR] at h + exact LowerRounds.next (evalLowerStep_sound u v hR) (ih v w h) + + +end BusyBeaver.WordCalculus diff --git a/BusyBeaver/Calculi/WordCalculusE.lean b/BusyBeaver/Calculi/WordCalculusE.lean new file mode 100644 index 00000000..61d5aa35 --- /dev/null +++ b/BusyBeaver/Calculi/WordCalculusE.lean @@ -0,0 +1,1208 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Calculi.WordCalculusB +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +/-! +# Word Calculus Engine E (`BusyBeaver.Calculi.WordCalculusE`) + +Formal word-rewriting calculus for structured tape transformations, +providing verified macro-step reductions and tile segment chains for family E. +-/ + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.WordCalculus +set_option quotPrecheck false +set_option maxRecDepth 4000000 + +variable {α β γ : Type*} +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +private abbrev t : BitWord := [1, 1, 0, 0] +private abbrev d0 : BitWord := [0, 0] +private abbrev d1 : BitWord := [1, 0] +open Word +local notation "WordList" => List Word +theorem phaseScan_scale_le_of_hasQKSubword {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b + : Rat} + (hI : PhaseScan k u k' v a b) : + hasQKSubword u = true -> wordScale v * 8 <= wordScale u := by + induction hI with + | nil _ => intro h; contradiction + | T _ ih => intro h; have h1 := ih h; dsimp [wordScale]; linarith + | @pair0 _ u _ v _ _ hSub _ => + intro _ + have h1 := phaseScan_scale_le hSub + dsimp [wordScale]; linarith + | @pair1 _ u _ v _ _ hSub _ => + intro _ + have h1 := phaseScan_scale_le hSub + dsimp [wordScale]; linarith + | short00 _ ih => intro h; have h1 := ih h; dsimp [wordScale]; linarith + | @short01 n u _ _ _ _ hSub ih => + intro h + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => have h1 := ih h; dsimp [wordScale] at h1 ⊢; linarith + | K => + generalize hk : 1 + n * 2 = k0 at hSub + cases hSub <;> omega + | Q => have h1 := ih h; dsimp [wordScale] at h1 ⊢; linarith + | short10 _ ih => intro h; have h1 := ih h; dsimp [wordScale]; linarith + | @short11 n u _ _ _ _ hSub ih => + intro h + cases u with + | nil => contradiction + | cons w u' => + cases w with + | V => have h1 := ih h; dsimp [wordScale] at h1 ⊢; linarith + | K => + generalize hk : 1 + n * 2 = k0 at hSub + cases hSub <;> omega + | Q => have h1 := ih h; dsimp [wordScale] at h1 ⊢; linarith +theorem phaseScan_net_loss_le_three_mass {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : + Rat} + (hI : PhaseScan k u k' v a b) : + a - b - wordMassQ v <= 3 * wordMass u := by + induction hI with + | nil _ => simp [wordMassQ, wordMass] + | @T _ u _ _ _ _ _ ih => have hw := wordMass_nonneg u; dsimp [wordMassQ, wordMass]; linarith + | @pair0 _ u _ _ _ _ _ ih => have hw := wordMass_nonneg u; dsimp [wordMassQ, wordMass]; linarith + | @pair1 _ u _ _ _ _ _ ih => have hw := wordMass_nonneg u; dsimp [wordMassQ, wordMass]; linarith + | @short00 _ u _ _ _ _ _ ih => have hw := wordMass_nonneg u; dsimp [wordMassQ, wordMass]; linarith + | @short01 _ u _ _ _ _ _ ih => have hw := wordMass_nonneg u; dsimp [wordMassQ, wordMass]; linarith + | @short10 _ u _ _ _ _ _ ih => have hw := wordMass_nonneg u; dsimp [wordMassQ, wordMass]; linarith + | @short11 _ u _ _ _ _ _ ih => have hw := wordMass_nonneg u; dsimp [wordMassQ, wordMass]; linarith +theorem phaseScan_digitVal_net_loss_bound {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : + Rat} + (hI : PhaseScan k u k' v a b) : + ∀ {A H : Nat}, DigitVal A H u -> + ∃ l, Scan k u k' v l /\ a - b - wordMassQ v <= 2 * wordMass v + l := by + induction hI with + | nil k => + intro A H _ + exact ⟨0, Scan.nil k, by simp [wordMass, wordMassQ]⟩ + | T _ _ => + intro A H hD + exact False.elim (digitVal_not_cons_V hD) + | pair0 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1, H1, hD1, _, _⟩ + rcases digitVal_cons_K_inv hD1 with ⟨A2, H2, hD2, _, _⟩ + rcases ih hD2 with ⟨l, hJ, hL⟩ + exact ⟨(1 + l) * (1 / 2), Scan.pair0 hJ, by dsimp [wordMass, wordMassQ]; linarith⟩ + | pair1 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1, H1, hD1, _, _⟩ + rcases digitVal_cons_Q_inv hD1 with ⟨A2, H2, hD2, _, _⟩ + rcases ih hD2 with ⟨l, hJ, hL⟩ + exact ⟨(1 / 4) + l * (1 / 2), Scan.pair1 hJ, by dsimp [wordMass, wordMassQ]; linarith⟩ + | short00 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A1, H1, hD1, _, _⟩ + rcases ih hD1 with ⟨l, hJ, hL⟩ + exact ⟨1 + l * 2, Scan.short00 hJ, by dsimp [wordMass, wordMassQ]; linarith⟩ + | short01 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1, H1, hD1, _, _⟩ + rcases ih hD1 with ⟨l, hJ, hL⟩ + exact ⟨l * 2, Scan.short01 hJ, by dsimp [wordMass, wordMassQ]; linarith⟩ + | short10 _ ih => + intro A H hD + rcases digitVal_cons_K_inv hD with ⟨A1, H1, hD1, _, _⟩ + rcases ih hD1 with ⟨l, hJ, hL⟩ + exact ⟨1 + l * 2, Scan.short10 hJ, by dsimp [wordMass, wordMassQ]; linarith⟩ + | short11 _ ih => + intro A H hD + rcases digitVal_cons_Q_inv hD with ⟨A1, H1, hD1, _, _⟩ + rcases ih hD1 with ⟨l, hJ, hL⟩ + exact ⟨l * 2, Scan.short11 hJ, by dsimp [wordMass, wordMassQ]; linarith⟩ +theorem phaseScan_tailDefect_net_loss_bound {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b + z : Rat} + (hI : PhaseScan k u k' v a b) (hT : TailDefect u z) : + a - b - wordMassQ v <= 3 * (1 + 2 * z) := by + rcases exists_digitVal_of_tailDefect hT with ⟨A, H, hD⟩ + rcases phaseScan_digitVal_net_loss_bound hI hD with ⟨l, hJ, hL⟩ + rcases scan_tailDefect_bound hJ hT with ⟨hMv, hLv, _⟩ + linarith +set_option maxHeartbeats 2000000 in +-- Bound the sigma-weighted mass and net loss across the phase scan. +theorem phaseScan_digitVal_sigma_bound (h : Nat) (u : WordList) (B H : Nat) (ds : WordList) (sigma + : Rat) + (hDig : DigitVal B H ds) + (hUnit : sigma * ((2 ^ h : Nat) : Rat) = 1) + (hHeight : wordScale u * ((2 ^ H : Nat) : Rat) = ((2 ^ h : Nat) : Rat)) + (hPair : hasQKSubword u = true) + (hCut : notEndsWithQ u = true) + (hNe : u ≠ []) + (hZ : 7 <= wordMassK ds) + (hPhi : 4 * sigma * wordMass u + sigma * wordScale u * wordMassK ds + 2 * sigma <= 1 / 256) : + ∃ k v a b, + PhaseScan (4 * 2 ^ h) (u ++ ds ++ [K]) k v a b /\ 4 < k /\ + sigma * wordMass v <= sigma * wordMass u + (15 / 56) * (sigma * wordScale u * wordMassK ds) /\ + sigma * (a - b - wordMassQ v) <= + 3 * sigma * wordMass u + (45 / 56) * (sigma * wordScale u * wordMassK ds) := by + have hPh : (0 : Rat) < ((2 ^ h : Nat) : Rat) := by exact_mod_cast pow_two_pos h + have hPH : (0 : Rat) < ((2 ^ H : Nat) : Rat) := by exact_mod_cast pow_two_pos H + have hS : 0 < sigma := by nlinarith + have hSu := wordScale_pos u + have hMu := wordMass_nonneg u + have hMd := wordMass_nonneg ds + have hDpos : 0 <= sigma * wordScale u * wordMassK ds := by positivity + have hSmall : 4 * sigma * wordMass u + 2 * sigma <= 1 / 256 := by linarith + have hDefSmall : sigma * wordScale u * wordMassK ds <= 1 / 256 := by nlinarith + have hBound : 8 * wordMass u < (((2 * 2 ^ h) * 2 : Nat) : Rat) - 4 := by + have hc : (((2 * 2 ^ h) * 2 : Nat) : Rat) = 4 * ((2 ^ h : Nat) : Rat) := by push_cast; ring + rw [hc]; nlinarith + rcases exists_phaseScan_of_mass_lt u (2 * 2 ^ h) hBound with ⟨m, x, a1, b1, hI0, _⟩ + have hI : PhaseScan (4 * 2 ^ h) u m x a1 b1 := by + have heq : (2 * 2 ^ h) * 2 = 4 * 2 ^ h := by ring + rwa [heq] at hI0 + rcases phaseScan_even_out_of_notEndsWithQ hI hCut hNe with ⟨n, rfl⟩ + have hGain := phaseScan_scale_le_of_hasQKSubword hI hPair + have hBudget := phaseScan_budget_eq hI + have hBounds := phaseScan_loss_bounds hI + have hSx := wordScale_pos x + let s := sigma * wordScale x + have hSp : 0 < s := by positivity + have hUnitTail : sigma * wordScale u * ((2 ^ H : Nat) : Rat) = 1 := by + calc sigma * wordScale u * ((2 ^ H : Nat) : Rat) + _ = sigma * (wordScale u * ((2 ^ H : Nat) : Rat)) := by ring + _ = sigma * ((2 ^ h : Nat) : Rat) := by rw [hHeight] + _ = 1 := hUnit + have hGs : 8 * s <= sigma * wordScale u := by + change 8 * (sigma * wordScale x) <= sigma * wordScale u + nlinarith + have hHt : s * ((2 ^ H : Nat) : Rat) <= 1 / 8 := by + have h1 : 8 * s * ((2 ^ H : Nat) : Rat) <= sigma * wordScale u * ((2 ^ H : Nat) : Rat) := + by nlinarith + linarith + have hF : s * (1 + 2 * wordMassK ds) <= (15 / 56) * (sigma * wordScale u * wordMassK ds) := by + have h1 : 7 * s <= s * wordMassK ds := by nlinarith + have h2 : 8 * s * wordMassK ds <= sigma * wordScale u * wordMassK ds := by nlinarith + linarith + have hBudget' : (((n * 2 : Nat) : Rat) - 4) * s = 4 - 4 * sigma - 2 * sigma * (a1 - b1) := by + change (((n * 2 : Nat) : Rat) - 4) * (sigma * wordScale x) = + 4 - 4 * sigma - 2 * sigma * (a1 - b1) + have hc : ((4 * 2 ^ h : Nat) : Rat) = 4 * ((2 ^ h : Nat) : Rat) := by push_cast; ring + rw [hc] at hBudget + nlinarith + have hCarry : 3 < (((n * 2 : Nat) : Rat) - 4) * s := by + nlinarith + rcases digitVal_scale_and_mass hDig with ⟨hSd, hMassD, _⟩ + have hTail : 2 * (wordMass (ds ++ [K]) + wordMassK (ds ++ [K])) * s < 3 := by + rw [wordMass_append, wordMassK_append] + dsimp [wordMass, wordMassK] + have h1 : s * wordScale ds <= 1 / 8 := by rwa [hSd] + have h2 : s * wordMass ds <= 1 / 8 := by nlinarith + have h3 : s * wordMassK ds <= 1 / 256 := by nlinarith + linarith + have hTail1 : 2 * (wordMass (ds ++ [K]) + wordMassK (ds ++ [K])) < ((n * 2 : Nat) : Rat) := by + nlinarith + have hTail2 : 8 * (1 + 2 * wordMassK ds) < ((n * 2 : Nat) : Rat) - 4 := by + nlinarith + rcases scan_tailDefect_step_bound (ds ++ + [K]) (wordMassK ds) n (tailDefect_append_K_of_digitVal hDig) hTail1 hTail2 + with ⟨k, y, a2, b2, hJ, hK⟩ + rcases phaseScan_append hI hJ with ⟨a, b, hIJ, hA, hB⟩ + have hIJ' : PhaseScan (4 * 2 ^ h) (u ++ ds ++ [K]) k (x ++ y) a b := by + simpa [List.append_assoc] using! hIJ + have hTB := phaseScan_tailDefect_bound hJ (tailDefect_append_K_of_digitVal hDig) + have hE1 := phaseScan_net_loss_le_three_mass hI + have hE2 := phaseScan_tailDefect_net_loss_bound hJ (tailDefect_append_K_of_digitVal hDig) + refine ⟨k, x ++ y, a, b, hIJ', hK, ?_, ?_⟩ + · rw [wordMass_append] + have h1 : sigma * (wordScale x * wordMass y) = s * wordMass y := by ring + have h2 : s * wordMass y <= s * (1 + 2 * wordMassK ds) := by nlinarith + nlinarith + · rw [wordMassQ_append, hA, hB] + have h1 : sigma * (a - b - wordMassQ (x ++ + y)) = sigma * (a1 - b1 - wordMassQ x) + s * (a2 - b2 - wordMassQ y) := by + rw [wordMassQ_append, hA, hB]; change _ = _ + (sigma * wordScale x) * _; ring + have h2 : s * (a2 - b2 - wordMassQ y) <= 3 * s * (1 + 2 * wordMassK ds) := by nlinarith + nlinarith +def heightShiftE : WordList -> Nat -> Option Nat + | [], h => some h + | V :: u, h => heightShiftE u (h + 1) + | _ :: _u, 0 => none + | _ :: u, h + 1 => heightShiftE u h +theorem heightShiftE_sound (u : WordList) : + ∀ (h H : Nat), heightShiftE u h = some H -> + wordScale u * ((2 ^ H : Nat) : Rat) = ((2 ^ h : Nat) : Rat) := by + induction u with + | nil => + intro h H hE + injection hE with hE; subst hE + simp [wordScale] + | cons w u ih => + intro h H hE + cases w with + | V => + dsimp [heightShiftE, wordScale] at hE ⊢ + have hIH := ih (h + 1) H hE + rw [Nat.pow_succ] at hIH + push_cast at hIH ⊢; linarith + | K => + cases h with + | zero => contradiction + | succ h => + dsimp [heightShiftE, wordScale] at hE ⊢ + have hIH := ih h H hE + rw [Nat.pow_succ] + push_cast at hIH ⊢; linarith + | Q => + cases h with + | zero => contradiction + | succ h => + dsimp [heightShiftE, wordScale] at hE ⊢ + have hIH := ih h H hE + rw [Nat.pow_succ] + push_cast at hIH ⊢; linarith +theorem heightShiftE_append_inv (u : WordList) : + ∀ (v : WordList) (h H : Nat), heightShiftE (u ++ v) h = some H -> + ∃ j, heightShiftE u h = some j /\ heightShiftE v j = some H := by + induction u with + | nil => + intro v h H hE + exact ⟨h, rfl, hE⟩ + | cons w u ih => + intro v h H hE + cases w with + | V => exact ih v (h + 1) H hE + | K => + cases h with + | zero => contradiction + | succ h => exact ih v h H hE + | Q => + cases h with + | zero => contradiction + | succ h => exact ih v h H hE +theorem heightShiftE_replicate_V (n : Nat) : + ∀ (h : Nat), heightShiftE (List.replicate n V) h = some (h + n) := by + induction n with + | zero => intro h; simp [heightShiftE] + | succ n ih => + intro h + dsimp [List.replicate, heightShiftE] + rw [ih (h + 1)] + congr 1; omega +theorem le_of_heightShiftE_append_replicate_V (u : WordList) (n h H : Nat) + (hE : heightShiftE (u ++ List.replicate n V) h = some H) : n <= H := by + rcases heightShiftE_append_inv u (List.replicate n V) h H hE with ⟨j, _, hJ⟩ + rw [heightShiftE_replicate_V] at hJ + injection hJ with hJ + (try omega) +theorem exists_heightShiftE_of_mass_lt (u : WordList) : + ∀ (h : Nat), wordMass u < ((2 ^ h : Nat) : Rat) -> ∃ H, heightShiftE u h = some H := by + induction u with + | nil => intro h _; exact ⟨h, rfl⟩ + | cons w u ih => + intro h hM + cases w with + | V => + dsimp [wordMass, heightShiftE] at hM ⊢ + apply ih (h + 1) + rw [Nat.pow_succ]; push_cast at hM ⊢; linarith + | K => + cases h with + | zero => + have hw := (wordMass_nonneg u).1 + dsimp [wordMass] at hM; linarith + | succ h => + dsimp [wordMass, heightShiftE] at hM ⊢ + apply ih h + rw [Nat.pow_succ] at hM; push_cast at hM ⊢; linarith + | Q => + cases h with + | zero => + have hw := (wordMass_nonneg u).1 + dsimp [wordMass] at hM; linarith + | succ h => + dsimp [wordMass, heightShiftE] at hM ⊢ + apply ih h + rw [Nat.pow_succ] at hM; push_cast at hM ⊢; linarith +theorem heightShiftE_succ (u : WordList) : + ∀ (h H : Nat), heightShiftE u h = some H -> heightShiftE u (h + 1) = some (H + 1) := by + induction u with + | nil => + intro h H hE + injection hE with hE; subst hE; rfl + | cons w u ih => + intro h H hE + cases w with + | V => exact ih (h + 1) H hE + | K => + cases h with + | zero => contradiction + | succ h => exact ih h H hE + | Q => + cases h with + | zero => contradiction + | succ h => exact ih h H hE +theorem phaseScan_effect_heightShiftE {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (hI : PhaseScan k u k' v a b) : + ∀ (h H n n' : Nat) (eff : WordList), + heightShiftE v h = some H -> WordEffect n v n' eff -> + k + n * 2 + 3 <= 4 * 2 ^ h -> k' + n' * 2 + 3 <= 4 * 2 ^ H := by + induction hI with + | nil k => + intro h H n n' eff hHeight hEff hBound + injection hHeight with hEq; subst hEq + cases hEff + exact hBound + | T _ ih => + intro h H n n' eff hHeight hEff hBound + cases hEff with + | T hSub => + apply ih (h + 1) H (1 + n * 2) n' _ hHeight hSub + rw [Nat.pow_succ]; omega + | pair0 _ ih => + intro h H n n' eff hHeight hEff hBound + cases hEff with + | T hSub => + apply ih (h + 1) H (1 + n * 2) n' _ hHeight hSub + rw [Nat.pow_succ]; omega + | pair1 _ ih => + intro h H n n' eff hHeight hEff hBound + cases hEff with + | T hSub => + apply ih (h + 1) H (1 + n * 2) n' _ hHeight hSub + rw [Nat.pow_succ]; omega + | short00 _ ih => + intro h H n n' eff hHeight hEff hBound + cases h with + | zero => contradiction + | succ h => + rw [Nat.pow_succ] at hBound + cases hEff with + | d00 hSub => apply ih h H _ n' _ hHeight hSub; omega + | d01 hSub => apply ih h H _ n' _ hHeight hSub; omega + | short01 _ ih => + intro h H n n' eff hHeight hEff hBound + cases h with + | zero => contradiction + | succ h => + rw [Nat.pow_succ] at hBound + cases hEff with + | d00 hSub => apply ih h H _ n' _ hHeight hSub; omega + | d01 hSub => apply ih h H _ n' _ hHeight hSub; omega + | short10 _ ih => + intro h H n n' eff hHeight hEff hBound + cases h with + | zero => contradiction + | succ h => + rw [Nat.pow_succ] at hBound + cases hEff with + | d10 hSub => apply ih h H _ n' _ hHeight hSub; omega + | d11 hSub => apply ih h H _ n' _ hHeight hSub; omega + | short11 _ ih => + intro h H n n' eff hHeight hEff hBound + cases h with + | zero => contradiction + | succ h => + rw [Nat.pow_succ] at hBound + cases hEff with + | d10 hSub => apply ih h H _ n' _ hHeight hSub; omega + | d11 hSub => apply ih h H _ n' _ hHeight hSub; omega +theorem wordEffect_replicate_Q_V (n : Nat) : + WordEffect 1 (List.replicate n Q ++ [V]) 3 (List.replicate n K ++ [V]) := by + induction n with + | zero => exact WordEffect.T (WordEffect.nil 3) + | succ n ih => exact @WordEffect.d11 0 _ _ _ ih +theorem phaseScan_replicate_K_V_inv (n : Nat) : + ∀ (h k k' : Nat) (v : WordList) (a b : Rat), + PhaseScan k (List.replicate n K ++ [V]) k' v a b -> + k + 4 = 4 * 2 ^ h -> + ∃ H, v = List.replicate n Q ++ [V] /\ heightShiftE v h = some H /\ k' + 12 = 4 * 2 ^ H := by + induction n with + | zero => + intro h k k' v a b hI hEq + generalize hk : k = k0 at hI + cases hI with + | @T m _ _ v0 a0 b0 hSub => + generalize hkSub : 2 + m * 2 = kSub at hSub + cases hSub + refine ⟨h + 1, rfl, rfl, ?_⟩ + rw [Nat.pow_succ]; omega + | succ n ih => + intro h k k' v a b hI hEq + have hpos := pow_two_pos h + cases h with + | zero => + dsimp at hEq + cases hI <;> omega + | succ h => + rw [Nat.pow_succ] at hEq + cases hI with + | short00 _ => omega + | @short10 m _ _ v0 a0 b0 hSub => + rcases ih h (m * 2) k' v0 a0 b0 hSub (by omega) with ⟨H, rfl, hHt, hK⟩ + exact ⟨H, rfl, hHt, hK⟩ +inductive EGuard : WordList -> Prop where + | T (n : Nat) (w : WordList) : EGuard (V :: (List.replicate n Q ++ V :: w)) + | D (w : WordList) : EGuard (Q :: V :: w) +theorem eGuard_append {u v : WordList} (hG : EGuard u) : EGuard (u ++ v) := by + cases hG with + | T n w => + have heq : (V :: (List.replicate n Q ++ V :: w)) ++ v = + V :: (List.replicate n Q ++ V :: (w ++ v)) := by + simp [List.append_assoc] + rw [heq]; exact EGuard.T n (w ++ v) + | D w => + exact EGuard.D (w ++ v) +theorem eGuard_effect_phaseScan_split (h : Nat) (orig eff : WordList) (carry k : Nat) (v : + WordList) (a b : Rat) + (hG : EGuard orig) (hE : WordEffect 0 orig carry eff) + (hI : PhaseScan (4 * 2 ^ h) eff k v a b) (_hPos : 0 < k) : + ∃ pre rest j m x a' b' c H, + v = pre ++ rest /\ EGuard (pre ++ rest) /\ + heightShiftE pre h = some H /\ WordEffect 0 pre c x /\ + PhaseScan j m k rest a' b' /\ j + c * 2 + 3 <= 4 * 2 ^ H := by + cases hG with + | T n w => + have hEq : V :: (List.replicate n Q ++ V :: w) = + (V :: (List.replicate n Q ++ [V])) ++ w := by + simp [List.append_assoc] + rw [hEq] at hE + rcases wordEffect_split_input (V :: (List.replicate n Q ++ [V])) hE + with ⟨c, pre, tail, rfl, hEP, hET⟩ + have hEG : WordEffect 0 (V :: (List.replicate n Q ++ [V])) 3 (V :: (List.replicate n K ++ + [V])) := + WordEffect.T (wordEffect_replicate_Q_V n) + rcases wordEffect_unique hEP hEG with ⟨rfl, rfl⟩ + have hCut : SplitCond (V :: (List.replicate n K ++ [V])) tail := by + left + have heq_cut : (V :: (List.replicate n K ++ [V])) = (V :: List.replicate n K) ++ [V] := by + simp + rw [heq_cut, notEndsWithQ_append_singleton]; rfl + rcases phaseScan_split_of_splitCond hI (V :: (List.replicate n K ++ [V])) tail rfl hCut + with ⟨j, x, y, a1, b1, a2, b2, hSX, hSY, rfl, _, _⟩ + generalize hkSX : 4 * 2 ^ h = kSX at hSX + cases hSX with + | @T m _ _ v0 a0 b0 hJ => + have hEq_m : (2 + m * 2) + 4 = 4 * 2 ^ (h + 1) := by + rw [Nat.pow_succ]; omega + rcases phaseScan_replicate_K_V_inv n (h + 1) (2 + m * 2) j v0 a0 b0 hJ hEq_m + with ⟨hh, rfl, hHt, hK⟩ + refine ⟨V :: (List.replicate n Q ++ [V]), y, j, tail, V :: (List.replicate n K ++ [V]), a2, + b2, 3, hh, rfl, ?_, hHt, hEG, hSY, by omega⟩ + have heq_g : (V :: (List.replicate n Q ++ [V])) ++ y = V :: (List.replicate n Q ++ + V :: y) := by + simp [List.append_assoc] + rw [heq_g]; exact EGuard.T n y + | D w => + generalize hk0 : (0 : Nat) = k0 at hE + cases hE with + | @d10 m _ _ _ hE1 => + have hm0 : m = 0 := by omega + subst hm0 + generalize hk1 : (0 : Nat) = k1 at hE1 + cases hE1 with + | T hE2 => + subst hk1 + have hpos_h := pow_two_pos h + cases h with + | zero => + dsimp at hI + generalize hkI : (4 : Nat) = kI at hI + cases hI with + | @short01 m' _ _ _ _ _ _ => omega + | @short11 m' _ _ _ _ _ hSub => + have hm'0 : m' = 0 := by omega + subst hm'0 + dsimp at hSub + generalize hkS : (1 : Nat) = kS at hSub + cases hSub with + | T _ => omega + | succ h => + have hpow : 4 * 2 ^ (h + 1) = 4 + (2 * 2 ^ h - 1) * 4 := by + have hp := pow_two_pos h + rw [Nat.pow_succ]; omega + rw [hpow] at hI + generalize hkI : 4 + (2 * 2 ^ h - 1) * 4 = kI at hI + cases hI with + | @short01 m' _ _ _ _ _ _ => omega + | @short11 m' _ _ _ _ _ hSub => + have hm' : m' = 2 * 2 ^ h - 1 := by omega + subst hm' + have h1 : 1 + (2 * 2 ^ h - 1) * 2 = 3 + (4 * 2 ^ h - 4) := by + have hp := pow_two_pos h; omega + rw [h1] at hSub + generalize hkS : 3 + (4 * 2 ^ h - 4) = kS at hSub + cases hSub with + | @T m'' _ _ v0 a0 b0 hSub2 => + have hm'' : m'' = 4 * 2 ^ h - 4 := by omega + subst hm'' + refine ⟨[Q, V], v0, 2 + (4 * 2 ^ h - 4) * 2, _, [Q, V], a0, b0, 1, h + 1, rfl, + EGuard.D v0, rfl, ?_, hSub2, ?_⟩ + · exact WordEffect.d10 (WordEffect.T (WordEffect.nil 1)) + · have hp := pow_two_pos h + rw [Nat.pow_succ]; omega + | d11 _ => omega +theorem eStep_of_eGuard_phaseScan {h : Nat} {orig eff : WordList} {carry k : Nat} {v : WordList} {a + b : Rat} + {H n : Nat} {out : WordList} + (hG : EGuard orig) (hE : WordEffect 0 orig carry eff) + (hI : PhaseScan (4 * 2 ^ h) eff k v a b) (hPos : 0 < k) + (hHeight : heightShiftE v h = some H) (hEff : WordEffect 0 v n out) : + EGuard v /\ k + n * 2 + 3 <= 4 * 2 ^ H := by + rcases eGuard_effect_phaseScan_split h orig eff carry k v a b hG hE hI hPos + with ⟨pre, rest, j, m, x, a', b', c, H', rfl, hG', hHt, hEp, hJ, hBound⟩ + rcases heightShiftE_append_inv pre rest h H hHeight with ⟨hh, hHp, hHr⟩ + rw [hHt] at hHp + injection hHp with hEq; subst hEq + rcases wordEffect_split_input pre hEff with ⟨c', pre', out', _, hEp', hEr⟩ + rcases wordEffect_unique hEp hEp' with ⟨rfl, _⟩ + exact ⟨hG', phaseScan_effect_heightShiftE hJ H' H c n out' hHr hEr hBound⟩ +theorem digitVal_low_zeros_prefix (s : Nat) : + ∀ (B H : Nat) (ds : WordList), + DigitVal B H ds -> s <= H -> (∃ n, B = n * 2 ^ s) -> + ∃ rest, ds = List.replicate s K ++ rest := by + induction s with + | zero => + intro B H ds _ _ _ + exact ⟨ds, rfl⟩ + | succ s ih => + intro B H ds hD hSH ⟨n, hN⟩ + have hN2 : B = (n * 2 ^ s) * 2 := by + rw [Nat.pow_succ] at hN + linarith + cases hD with + | nil => omega + | @zero A' H' u' hSub => + rcases ih A' H' u' hSub (by omega) ⟨n, by omega⟩ with ⟨rest, rfl⟩ + exact ⟨rest, rfl⟩ + | one _ => omega +theorem phaseScan_three_K_div_eight {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (hI : PhaseScan k (K :: K :: K :: u) k' v a b) + (hN : ∃ n, k + 12 = n * 16) : + ∃ w, v = Q :: Q :: K :: w := by + rcases hN with ⟨n, hEq⟩ + generalize hk0 : k = k0 at hI + cases hI with + | short00 _ => omega + | @short10 m1 _ _ _ _ _ hI1 => + generalize hk1 : m1 * 2 = k1 at hI1 + cases hI1 with + | short00 _ => omega + | @short10 m2 _ _ _ _ _ hI2 => + generalize hk2 : m2 * 2 = k2 at hI2 + cases hI2 with + | @short00 m3 _ _ w0 _ _ _ => exact ⟨w0, rfl⟩ + | short10 _ => omega +theorem phaseScan_four_V_three_K_div_eight {k : Nat} {u rest : WordList} {k' : Nat} {v : WordList} + {a b : Rat} + (hI : PhaseScan k ((u ++ List.replicate 4 V) ++ K :: K :: K :: rest) k' v a b) : + ∃ x y, v = (x ++ List.replicate 4 V) ++ Q :: Q :: K :: y := by + have hE1 : (u ++ List.replicate 4 V) ++ K :: K :: K :: rest = + u ++ (List.replicate 4 V ++ K :: K :: K :: rest) := by + simp [List.append_assoc] + rw [hE1] at hI + rcases phaseScan_split_of_splitCond hI u (List.replicate 4 V ++ + K :: K :: K :: rest) rfl (Or.inr ⟨_, rfl⟩) + with ⟨m, x, y, _, _, _, _, _, hB, rfl, _, _⟩ + rcases phaseScan_split_of_splitCond hB (List.replicate 4 V) (K :: K :: K :: rest) rfl (Or.inl + (notEndsWithQ_replicate_V 4)) + with ⟨j, x', y', _, _, _, _, hC, hD, rfl, _, _⟩ + rcases phaseScan_replicate_V_inv 4 m j x' _ _ hC with ⟨rfl, hN, _, _⟩ + have hMod : ∃ q, j + 12 = q * 16 := ⟨m - 3, by omega⟩ + rcases phaseScan_three_K_div_eight hD hMod with ⟨w, rfl⟩ + exact ⟨x, w, by simp [List.append_assoc]⟩ +theorem hasQKSubword_append_right (u v : WordList) (h : hasQKSubword v = + true) : hasQKSubword (u ++ v) = true := by + induction u with + | nil => exact h + | cons w u ih => + cases w with + | V => exact ih + | K => exact ih + | Q => + cases u with + | nil => + cases v with + | nil => contradiction + | cons w2 v' => cases w2 <;> first | rfl | exact h + | cons w2 u' => + cases w2 with + | V => exact ih + | K => rfl + | Q => exact ih +theorem wordEffect_four_V_QQK_hasQKSubword {u rest : WordList} {n : Nat} {eff : WordList} + (hE : WordEffect 0 ((u ++ List.replicate 4 V) ++ Q :: Q :: K :: rest) n eff) : + hasQKSubword eff = true := by + rcases wordEffect_split_input (u ++ List.replicate 4 V) hE with ⟨c, x, y, rfl, hA, hB⟩ + rcases wordEffect_append_replicate_V_inv u 4 0 c x hA with ⟨z, m, _, hC⟩ + have h4 : (2 : Nat) ^ 4 = 16 := rfl + rw [h4] at hC + generalize hk0 : c = k0 at hB + cases hB with + | d10 _ => omega + | @d11 c1 _ _ _ hB1 => + generalize hk1 : 1 + c1 = k1 at hB1 + cases hB1 with + | @d10 c2 _ _ _ hB2 => + generalize hk2 : c2 = k2 at hB2 + cases hB2 with + | @d00 c3 _ _ w0 _ => + exact hasQKSubword_append_right x (K :: Q :: K :: w0) rfl + | d01 _ => omega + | d11 _ => omega +theorem phaseScan_effect_sigma_contraction (h : Nat) (u : WordList) (n : Nat) (v : WordList) (a b : + Rat) (c : Nat) (eff : WordList) (sigma : Rat) + (hI : PhaseScan (4 * 2 ^ h) u (n * 2) v a b) + (hE : WordEffect 0 v c eff) + (hS : 0 < sigma) + (hUnit : sigma * ((2 ^ h : Nat) : Rat) = 1) : + 1 - ((n + c + 2 : Nat) : Rat) * (sigma * wordScale v * (1 / 2)) <= + (sigma + sigma * (a - b - wordMassQ v)) * (1 / 2) - 3 * (sigma * wordScale v * (1 / 2)) := by + have hBudget := phaseScan_budget_eq hI + have hCarry := wordEffect_budget_eq hE + have hMass := (wordEffect_preserves_scale_and_mass hE).2 + have hSplit := wordMass_eq_add eff + have hWeff := wordMass_nonneg eff + have hO : wordMassQ eff <= wordMass v := by linarith + have hSv := wordScale_pos v + have hc4 : ((4 * 2 ^ h : Nat) : Rat) = 4 * ((2 ^ h : Nat) : Rat) := by push_cast; ring + have hn2 : ((n * 2 : Nat) : Rat) = 2 * (n : Rat) := by push_cast; ring + have hc1 : ((1 + c : Nat) : Rat) = 1 + (c : Rat) := by push_cast; ring + have hc0 : ((1 + 0 : Nat) : Rat) = 1 := rfl + have hnc : ((n + c + 2 : Nat) : Rat) = (n : Rat) + (c : Rat) + 2 := by push_cast; ring + rw [hc4, hn2] at hBudget + rw [hc1, hc0] at hCarry + rw [hnc] + have hB0 : (4 * ((2 ^ h : Nat) : Rat) - 4) - ((2 * (n : Rat) - 4) * wordScale v + + 2 * (a - b)) = 0 := by linarith + have hC0 : (1 + (c : Rat)) * wordScale v - (1 + wordMass v + wordMassQ v - wordMassQ eff) = + 0 := by linarith + have hU0 : sigma * ((2 ^ h : Nat) : Rat) - 1 = 0 := by linarith + have h_id : + (sigma + sigma * (a - b - wordMassQ v)) * (1 / 2) - 3 * (sigma * wordScale v * (1 / 2)) - + (1 - ((n : Rat) + (c : Rat) + 2) * (sigma * wordScale v * (1 / 2))) = + (sigma * ((2 ^ h : Nat) : Rat) - 1) - + (1 / 4) * sigma * ((4 * ((2 ^ h : Nat) : Rat) - 4) - ((2 * (n : Rat) - 4) * wordScale v + + 2 * (a - b))) + + (1 / 2) * sigma * ((1 + (c : Rat)) * wordScale v - (1 + wordMass v + + wordMassQ v - wordMassQ eff)) + + (1 / 2) * sigma * (wordMass v - wordMassQ eff) := by ring + rw [hU0, hB0, hC0] at h_id + have h_nonneg : 0 <= (1 / 2) * sigma * (wordMass v - wordMassQ eff) := by nlinarith + linarith +theorem eGood_contraction_ineq (M D sigma M' D' : Rat) + (_ : 0 <= M) (_ : 0 <= sigma) + (hM' : M' <= (M + (15 / 56) * D) * (1 / 2)) + (hD' : D' <= (sigma + 3 * M + (45 / 56) * D) * (1 / 2)) : + 4 * M' + D' + sigma <= (15 / 16) * (4 * M + D + 2 * sigma) := by + linarith +theorem digitVal_high_ones_suffix_E (n t0 B : Nat) (ds : WordList) + (hD : DigitVal B (n + t0) ds) (hL : 2 ^ (n + t0) <= B + 2 ^ n) : + ∃ u, ds = u ++ List.replicate t0 Q := by + have hBound := lt_pow_of_digitVal hD + have hPos := pow_two_pos t0 + rw [Nat.pow_add] at hL hBound + let a := B - (2 ^ t0 - 1) * 2 ^ n + have hSum : a + (2 ^ t0 - 1) * 2 ^ n = B := by + have : (2 ^ t0 - 1) * 2 ^ n + 2 ^ n = 2 ^ n * 2 ^ t0 := by + have h1 : (2 ^ t0 - 1) + 1 = 2 ^ t0 := by omega + calc (2 ^ t0 - 1) * 2 ^ n + 2 ^ n + _ = ((2 ^ t0 - 1) + 1) * 2 ^ n := by ring + _ = 2 ^ t0 * 2 ^ n := by rw [h1] + _ = 2 ^ n * 2 ^ t0 := by ring + (try omega) + have ha_lt : a < 2 ^ n := by + have : (2 ^ t0 - 1) * 2 ^ n + 2 ^ n = 2 ^ n * 2 ^ t0 := by + have h1 : (2 ^ t0 - 1) + 1 = 2 ^ t0 := by omega + calc (2 ^ t0 - 1) * 2 ^ n + 2 ^ n + _ = ((2 ^ t0 - 1) + 1) * 2 ^ n := by ring + _ = 2 ^ t0 * 2 ^ n := by rw [h1] + _ = 2 ^ n * 2 ^ t0 := by ring + (try omega) + rcases exists_digitVal_of_lt_pow n a ha_lt with ⟨u, hU⟩ + refine ⟨u, digitVal_unique hD ?_⟩ + rw [<- hSum] + exact digitVal_append hU (digitVal_replicate_Q t0) +theorem digitVal_unit_massK_bound {B H : Nat} {ds : WordList} {unit : Rat} + (hD : DigitVal B H ds) (hU : 0 < unit) + (hHeight : unit * ((2 ^ H : Nat) : Rat) = 1) + (hZ : 7 <= wordMassK ds) + (hSmall : unit * wordMassK ds <= 1 / 256) : + ∃ rest, ds = rest ++ List.replicate 7 Q := by + have hH7 : 7 <= H := by + by_contra hlt + have hle : H <= 6 := by omega + have hpow_le : 2 ^ H <= 64 := by + calc 2 ^ H <= 2 ^ 6 := Nat.pow_le_pow_right (by decide) hle + _ = 64 := by decide + have hpow_q : ((2 ^ H : Nat) : Rat) <= 64 := by exact_mod_cast hpow_le + nlinarith + have hShift : unit * ((2 ^ (H - 7) : Nat) : Rat) = 1 / 128 := by + have heq : H = (H - 7) + 7 := by omega + have hpow : ((2 ^ H : Nat) : Rat) = ((2 ^ (H - 7) : Nat) : Rat) * 128 := by + have hp : 2 ^ H = 2 ^ (H - 7) * 128 := by rw [heq, Nat.pow_add]; rfl + rw [hp]; push_cast; ring + rw [hpow] at hHeight + linarith + have hEq := digitVal_wordMassK_eq hD + have hH_split : (H - 7) + 7 = H := by omega + have hD' : DigitVal B ((H - 7) + 7) ds := by rwa [hH_split] + apply digitVal_high_ones_suffix_E (H - 7) 7 B ds hD' + have hL_q : ((2 ^ ((H - 7) + 7) : Nat) : Rat) <= ((B + 2 ^ (H - 7) : Nat) : Rat) := by + rw [hH_split] + push_cast at hEq hShift ⊢ + nlinarith + exact_mod_cast hL_q +inductive EGood : Nat -> WordList -> Prop where + | intro (h H : Nat) (u : WordList) (A : Nat) (da : WordList) (carry : Nat) (eff : WordList) + (B : Nat) (db : WordList) (sigma : Rat) : + heightShiftE u h = some H -> + EGuard u -> + (∃ w, u = w ++ List.replicate 4 V) -> + DigitVal A H da -> + WordEffect 0 u carry eff -> + A + carry = B -> + DigitVal B H db -> + hasQKSubword eff = true -> + (∃ w, db = K :: K :: K :: w) -> + (∃ w, db = w ++ List.replicate 7 Q) -> + sigma * ((2 ^ h : Nat) : Rat) = 1 -> + 4 * sigma * wordMass u + sigma * wordScale u * wordMassK db + 2 * sigma <= 1 / 256 -> + EGood h (u ++ da) +inductive EStep : Nat -> WordList -> WordList -> Prop where + | intro (h : Nat) (orig eff : WordList) (n : Nat) (v : WordList) (a b : Rat) (J : Nat) (da : + WordList) : + WordEffect 0 (orig ++ [K]) 0 eff -> + PhaseScan (4 * 2 ^ h) eff (n * 2) v a b -> + 0 < n -> + DigitVal (1 + n) J da -> + EStep h orig (v ++ da) +set_option maxHeartbeats 2000000 in +-- Combine the phase-scan sigma bound with the word-effect contraction. +theorem eGood_progress {h : Nat} {orig : WordList} (hG : EGood h orig) : + ∃ out, EStep h orig out /\ EGood (h + 1) out := by + rcases hG with ⟨H, u, A, da, carry, eff, B, db, sigma, + hHeight, hGuardU, hEnd, hDA, hE, hSum, hDB, hPair, hLow, hHigh, hUnit, hPhi⟩ + have hHt := heightShiftE_sound u h H hHeight + rcases wordEffect_preserves_scale_and_mass hE with ⟨hSe, hMe⟩ + have hPh : (0 : Rat) < ((2 ^ h : Nat) : Rat) := by exact_mod_cast pow_two_pos h + have hSig : 0 < sigma := by nlinarith + have hWu := wordMass_nonneg u + have hWdb := wordMass_nonneg db + have hSu := wordScale_pos u + have hDpos : 0 <= sigma * wordScale u * wordMassK db := + mul_nonneg (mul_nonneg (le_of_lt hSig) (le_of_lt hSu)) hWdb.2.1 + have hMu : 0 <= sigma * wordMass u := + mul_nonneg (le_of_lt hSig) hWu.1 + have hZ : 7 <= wordMassK db := by + rcases hLow with ⟨w, rfl⟩ + have hw := wordMass_nonneg w + dsimp [wordMassK]; linarith + have hEe : ∃ p, eff = p ++ List.replicate 4 V := by + rcases hEnd with ⟨p, rfl⟩ + rcases wordEffect_append_replicate_V_inv p 4 0 carry eff hE with ⟨w, q, hV, _⟩ + exact ⟨w, hV⟩ + have hCut : notEndsWithQ eff = true := by + rcases hEe with ⟨p, rfl⟩ + have heq : p ++ List.replicate 4 V = (p ++ [V, V, V]) ++ [V] := by + simp [List.append_assoc] + rw [heq, notEndsWithQ_append_singleton]; rfl + have hNe : eff ≠ [] := by + rcases hEe with ⟨p, rfl⟩ + simp + have hHt_eff : wordScale eff * ((2 ^ H : Nat) : Rat) = ((2 ^ h : Nat) : Rat) := by rwa [hSe] + have hPhi_eff : 4 * sigma * wordMass eff + sigma * wordScale eff * wordMassK db + 2 * sigma <= + 1 / 256 := by + rwa [hSe, hMe] + rcases phaseScan_digitVal_sigma_bound h eff B H db sigma hDB hUnit hHt_eff hPair hCut hNe hZ + hPhi_eff + with ⟨k, v, a, b, hI, hPos, hMass, hEnergy⟩ + rw [hSe, hMe] at hMass hEnergy + rcases hHigh with ⟨hi, hHi⟩ + have hIH : PhaseScan (4 * 2 ^ h) ((eff ++ hi) ++ List.replicate (1 + 3 * 2) Q ++ + [K]) k v a b := by + have h7 : List.replicate 7 Q = List.replicate (1 + 3 * 2) Q := rfl + rw [hHi, h7] at hI + simpa [List.append_assoc] using! hI + rcases phaseScan_append_odd_Q_K_inv 3 (4 * 2 ^ h) (eff ++ hi) k v a b hIH with ⟨p, n, hV, rfl⟩ + have h16 : 2 ^ (1 + 3) = 16 := rfl + rw [h16] at hI hPos + have hI' : PhaseScan (4 * 2 ^ h) (eff ++ db ++ [K]) ((n * 8) * 2) v a b := by + have heq : (n * 8) * 2 = n * 16 := by ring + rwa [heq] + have hMv : sigma * wordMass v <= 1 / 256 := by linarith + have hMv_pow : wordMass v < ((2 ^ h : Nat) : Rat) := by nlinarith + rcases exists_heightShiftE_of_mass_lt v h hMv_pow with ⟨Hv, hHeightV⟩ + rcases exists_wordEffect v 0 with ⟨carry', eff', hE'⟩ + rcases exists_wordEffect_of_digitVal_add hDA hSum (lt_pow_of_digitVal hDB) with ⟨db0, hDB0, hED⟩ + have hdb_eq : db0 = db := digitVal_unique hDB0 hDB + rw [hdb_eq] at hED + have hFull : WordEffect 0 ((u ++ da) ++ [K]) 0 (eff ++ db ++ [K]) := by + simpa only [List.append_assoc] using! + wordEffect_append hE (wordEffect_append hED (WordEffect.d00 (WordEffect.nil 0))) + have hGuardFull : EGuard ((u ++ da) ++ [K]) := eGuard_append (eGuard_append hGuardU) + rcases eStep_of_eGuard_phaseScan hGuardFull hFull hI (by omega) hHeightV hE' with ⟨hGuardV, + hBarrier⟩ + let J := Hv + 1 + let A' := 1 + n * 8 + let B' := A' + carry' + have hUpper : B' < 2 ^ J := by + change 1 + n * 8 + carry' < 2 ^ (Hv + 1) + rw [Nat.pow_succ]; omega + rcases exists_digitVal_of_lt_pow J A' (by omega) with ⟨da', hDA'⟩ + rcases exists_digitVal_of_lt_pow J B' hUpper with ⟨db', hDB'⟩ + have hHeightNew : heightShiftE v (h + 1) = some J := heightShiftE_succ v h Hv hHeightV + let unit := sigma * wordScale v * (1 / 2) + have hUp : 0 < unit := by + have hSv := wordScale_pos v + positivity + have hUH : unit * ((2 ^ J : Nat) : Rat) = 1 := by + have hHV := heightShiftE_sound v (h + 1) J hHeightNew + have hp : ((2 ^ (h + 1) : Nat) : Rat) = ((2 ^ h : Nat) : Rat) * 2 := by + rw [Nat.pow_succ]; push_cast; ring + rw [hp] at hHV + change (sigma * wordScale v * (1 / 2)) * ((2 ^ J : Nat) : Rat) = 1 + calc (sigma * wordScale v * (1 / 2)) * ((2 ^ J : Nat) : Rat) + _ = sigma * (wordScale v * ((2 ^ J : Nat) : Rat)) * (1 / 2) := by ring + _ = sigma * (((2 ^ h : Nat) : Rat) * 2) * (1 / 2) := by rw [hHV] + _ = sigma * ((2 ^ h : Nat) : Rat) := by ring + _ = 1 := hUnit + have hDnew : unit * wordMassK db' <= + (sigma + 3 * sigma * wordMass u + + (45 / 56) * (sigma * wordScale u * wordMassK db)) * (1 / 2) := by + have hDef := phaseScan_effect_sigma_contraction h (eff ++ db ++ + [K]) (n * 8) v a b carry' eff' sigma hI' hE' hSig hUnit + have hZeros := digitVal_wordMassK_eq hDB' + have hEq_cast : ((n * 8 + carry' + 2 : Nat) : Rat) = (B' : Rat) + 1 := by + change ((n * 8 + carry' + 2 : Nat) : Rat) = ((1 + n * 8 + carry' : Nat) : Rat) + 1 + push_cast; ring + rw [hEq_cast] at hDef + change 1 - ((B' : Rat) + 1) * unit <= + (sigma + sigma * (a - b - wordMassQ v)) * (1 / 2) - 3 * unit at hDef + nlinarith + have hPhiNew : 4 * (sigma * (1 / 2)) * wordMass v + + (sigma * (1 / 2)) * wordScale v * wordMassK db' + 2 * (sigma * (1 / 2)) <= 1 / 256 := by + have hDnew' : unit * wordMassK db' <= + (sigma + 3 * (sigma * wordMass u) + + (45 / 56) * (sigma * wordScale u * wordMassK db)) * (1 / 2) := by + linarith + have hBound := + eGood_contraction_ineq (sigma * wordMass u) (sigma * wordScale u * wordMassK db) sigma + (sigma * wordMass v * (1 / 2)) (unit * wordMassK db') hMu (by linarith) (by linarith) hDnew' + dsimp [unit] at hBound + linarith + have hPairNew : hasQKSubword eff' = true := by + rcases hEe with ⟨ue, rfl⟩ + rcases hLow with ⟨lo, rfl⟩ + have hI_shape : PhaseScan (4 * 2 ^ h) ((ue ++ List.replicate 4 V) ++ K :: K :: K :: (lo ++ + [K])) (n * 16) v a b := by + simpa [List.append_assoc] using! hI + rcases phaseScan_four_V_three_K_div_eight hI_shape with ⟨x, y, hVy⟩ + rw [hVy] at hE' + exact wordEffect_four_V_QQK_hasQKSubword hE' + have hJ4 : 4 <= J := by + have hHv3 : 4 <= Hv := by + apply le_of_heightShiftE_append_replicate_V p 4 h Hv + rw [<- hV]; exact hHeightV + (try omega) + have hLowNew : ∃ w, db' = K :: K :: K :: w := by + have hE'_v : WordEffect 0 (p ++ List.replicate 4 V) carry' eff' := by rwa [<- hV] + rcases wordEffect_append_replicate_V_inv p 4 0 carry' eff' hE'_v with ⟨w, m, _, hCm⟩ + have h4 : (2 : Nat) ^ 4 = 16 := rfl + rw [h4] at hCm + have hDiv8 : ∃ q, B' = q * 2 ^ 3 := + ⟨n + m * 2, by change 1 + n * 8 + carry' = (n + m * 2) * 8; omega⟩ + rcases digitVal_low_zeros_prefix 3 B' J db' hDB' (by omega) hDiv8 with ⟨rest, hRest⟩ + exact ⟨rest, hRest⟩ + have hHighNew : ∃ w, db' = w ++ List.replicate 7 Q := by + refine digitVal_unit_massK_bound hDB' hUp hUH ?_ ?_ + · rcases hLowNew with ⟨w, rfl⟩ + have hw := wordMass_nonneg w + dsimp [wordMassK]; linarith + · have hWv := wordMass_nonneg v + have hSuv : 0 <= (sigma * (1 / 2)) * wordMass v := mul_nonneg (by linarith) hWv.1 + dsimp [unit] + linarith + refine ⟨v ++ da', ?_, ?_⟩ + · exact EStep.intro h (u ++ da) (eff ++ db ++ [K]) (n * 8) v a b J da' hFull hI' (by omega) hDA' + · refine EGood.intro (h + 1) J v A' da' carry' eff' B' db' (sigma * (1 / 2)) + hHeightNew hGuardV ⟨p, hV⟩ hDA' hE' rfl hDB' hPairNew hLowNew hHighNew ?_ hPhiNew + have hUnit' := hUnit + rw [Nat.pow_succ]; push_cast at hUnit' ⊢; linarith +def decodeDigitsE : Nat -> Nat -> Option (WordList) + | 0, _ => none + | _ + 1, 0 => none + | _ + 1, 1 => some [Q] + | fuel + 1, m + 2 => + forceNat ((m + 2) / 2) (fun q => + match decodeDigitsE fuel q with + | none => none + | some ws => forceWord (if (m + 2) % 2 == 0 then K else Q) (fun w => some (w :: ws))) +theorem decodeDigitsE_sound (fuel : Nat) : + ∀ (m : Nat) (ws : WordList), decodeDigitsE fuel m = some ws -> + ∃ H, DigitVal m H ws := by + induction fuel with + | zero => intro m ws h; contradiction + | succ fuel ih => + intro m ws h + rcases m with _ | _ | m + · contradiction + · injection h with h; subst h + exact ⟨1, DigitVal.one DigitVal.nil⟩ + · dsimp [decodeDigitsE, forceNat] at h + simp only [forceWord_eq] at h + cases hrec : decodeDigitsE fuel ((m + 2) / 2) with + | none => rw [hrec] at h; contradiction + | some ws' => + rw [hrec] at h + injection h with h; subst h + rcases ih ((m + 2) / 2) ws' hrec with ⟨H, hD⟩ + rcases Nat.mod_two_eq_zero_or_one (m + 2) with hmod | hmod + · have hcond : ((m + 2) % 2 == 0) = true := beq_iff_eq.mpr hmod + rw [hcond] + refine ⟨1 + H, ?_⟩ + have heq : m + 2 = ((m + 2) / 2) * 2 := by omega + rw [heq]; exact DigitVal.zero hD + · have hcond : ((m + 2) % 2 == 0) = false := beq_false_of_ne (by omega) + rw [hcond] + refine ⟨1 + H, ?_⟩ + have heq : m + 2 = 1 + ((m + 2) / 2) * 2 := by omega + rw [heq]; exact DigitVal.one hD +def stripWordPrefixE : WordList -> WordList -> Option (WordList) + | [], u => some u + | V :: p, V :: u => stripWordPrefixE p u + | K :: p, K :: u => stripWordPrefixE p u + | Q :: p, Q :: u => stripWordPrefixE p u + | _, _ => none +theorem stripWordPrefixE_sound (p : WordList) : + ∀ (u v : WordList), stripWordPrefixE p u = some v -> u = p ++ v := by + induction p with + | nil => intro u v h; injection h + | cons w p ih => + intro u v h + cases u with + | nil => cases w <;> contradiction + | cons x u => + cases w <;> cases x <;> try contradiction + all_goals + dsimp [stripWordPrefixE] at h + rw [ih u v h]; rfl +inductive ChoiceE where + | CT | CP0 | CP1 | CS00 | CS01 | CS10 | CS11 +deriving DecidableEq +open ChoiceE +inductive CodeE where + | Stop (n : Nat) + | More (ch : ChoiceE) (n : Nat) (next : CodeE) +def choiceInCoeffE : ChoiceE -> Nat -> Nat + | CT, n => 3 + n + | CP0, n | CP1, n => 1 + n + | CS00, n | CS01, n => 2 + n * 4 + | CS10, n | CS11, n => 4 + n * 4 +def choiceOutCoeffE : ChoiceE -> Nat -> Nat + | CT, n => 2 + n * 2 + | CP0, n | CS00, n | CS10, n => n * 2 + | CP1, n | CS01, n | CS11, n => 1 + n * 2 +def choiceInWordsE : ChoiceE -> WordList + | CT => [V] + | CP0 => [Q, K] + | CP1 => [Q, Q] + | CS00 | CS10 => [K] + | CS01 | CS11 => [Q] +def choiceOutWordE : ChoiceE -> Word + | CT | CP0 | CP1 => V + | CS00 | CS01 => K + | CS10 | CS11 => Q +def evalCodeScanE : CodeE -> Nat -> WordList -> Option (Nat × WordList) + | .Stop n, k, [] => + if k == n * 2 && 0 < n then some (n, []) else none + | .Stop _, _, _ :: _ => none + | .More ch m c, k, u => + if k == choiceInCoeffE ch m then + match stripWordPrefixE (choiceInWordsE ch) u with + | none => none + | some w => + forceNat (choiceOutCoeffE ch m) (fun k' => + match evalCodeScanE c k' w with + | none => none + | some (n, v) => forceWord (choiceOutWordE ch) (fun wj => some (n, wj :: v))) + else none +theorem evalCodeScanE_sound (c : CodeE) : + ∀ (k : Nat) (u : WordList) (n : Nat) (v : WordList), + evalCodeScanE c k u = some (n, v) -> + ∃ a b, PhaseScan k u (n * 2) v a b /\ 0 < n := by + induction c with + | Stop m => + intro k u n v hE + cases u with + | cons _ _ => contradiction + | nil => + dsimp [evalCodeScanE, forceNat] at hE + cases hcond : (k == m * 2 && decide (0 < m)) with + | false => rw [hcond] at hE; contradiction + | true => + rw [hcond] at hE + injection hE with hE + injection hE with hm hv; subst hm hv + rcases Bool.and_eq_true_iff.mp hcond with ⟨hk, hpos⟩ + have rfl_k : k = m * 2 := beq_iff_eq.mp hk + subst rfl_k + exact ⟨0, 0, PhaseScan.nil (m * 2), of_decide_eq_true hpos⟩ + | More ch m c ih => + intro k u n v hE + dsimp [evalCodeScanE] at hE + cases hk : (k == choiceInCoeffE ch m) with + | false => rw [hk] at hE; contradiction + | true => + rw [hk] at hE; dsimp at hE + have rfl_k : k = choiceInCoeffE ch m := beq_iff_eq.mp hk + subst rfl_k + cases hU : stripWordPrefixE (choiceInWordsE ch) u with + | none => rw [hU] at hE; contradiction + | some w => + rw [hU] at hE; dsimp at hE + cases hC : evalCodeScanE c (choiceOutCoeffE ch m) w with + | none => rw [hC] at hE; contradiction + | some nv => + rw [hC] at hE + rcases nv with ⟨n', x⟩ + dsimp [forceNat] at hE + rw [forceWord_eq] at hE + injection hE with hE + injection hE with hn hv; subst hn hv + have rfl_u := stripWordPrefixE_sound (choiceInWordsE ch) u w hU + subst rfl_u + rcases ih (choiceOutCoeffE ch m) w n' x hC with ⟨a, b, hS, hPos⟩ + cases ch + · exact ⟨a * (1 / 2), b * (1 / 2), PhaseScan.T hS, hPos⟩ + · exact ⟨a * (1 / 2), (1 + b) * (1 / 2), PhaseScan.pair0 hS, hPos⟩ + · exact ⟨a * (1 / 2), (3 / 4) + b * (1 / 2), PhaseScan.pair1 hS, hPos⟩ + · exact ⟨3 + a * 2, b * 2, PhaseScan.short00 hS, hPos⟩ + · exact ⟨2 + a * 2, b * 2, PhaseScan.short01 hS, hPos⟩ + · exact ⟨4 + a * 2, b * 2, PhaseScan.short10 hS, hPos⟩ + · exact ⟨3 + a * 2, b * 2, PhaseScan.short11 hS, hPos⟩ +def evalEStep (h : Nat) (c : CodeE) (orig : WordList) : Option (WordList) := + let (carry, eff) := evalEffect 0 (orig ++ [K]) + if carry == 0 then + forceNat (4 * 2 ^ h) (fun k => + match evalCodeScanE c k eff with + | none => none + | some (n, v) => + forceNat (1 + n) (fun m => + match decodeDigitsE 64 m with + | none => none + | some da => some (v ++ da))) + else none +theorem evalEStep_sound (h : Nat) (c : CodeE) (orig out : WordList) + (hR : evalEStep h c orig = some out) : + EStep h orig out := by + dsimp [evalEStep, forceNat] at hR + have hE := evalEffect_sound (orig ++ [K]) 0 + generalize h_ev : evalEffect 0 (orig ++ [K]) = ce at hR hE + rcases ce with ⟨carry, eff⟩ + dsimp at hE hR + cases hc : (carry == 0) with + | false => rw [hc] at hR; contradiction + | true => + rw [hc] at hR; dsimp at hR + have rfl_c : carry = 0 := beq_iff_eq.mp hc + subst rfl_c + cases hP : evalCodeScanE c (4 * 2 ^ h) eff with + | none => rw [hP] at hR; contradiction + | some nv => + rw [hP] at hR + rcases nv with ⟨n, v⟩ + dsimp at hR + cases hD : decodeDigitsE 64 (1 + n) with + | none => rw [hD] at hR; contradiction + | some da => + rw [hD] at hR + injection hR with hR; subst hR + rcases evalCodeScanE_sound c (4 * 2 ^ h) eff n v hP with ⟨a, b, hS, hPos⟩ + rcases decodeDigitsE_sound 64 (1 + n) da hD with ⟨J, hDig⟩ + exact EStep.intro h orig eff n v a b J da hE hS hPos hDig +inductive ERounds : Nat -> WordList -> Nat -> WordList -> Prop where + | refl (h : Nat) (u : WordList) : ERounds h u h u + | next {h : Nat} {u v : WordList} {j : Nat} {w : WordList} : + EStep h u v -> ERounds (h + 1) v j w -> ERounds h u j w +def evalERounds : Nat -> List CodeE -> WordList -> Option (WordList) + | _, [], u => some u + | h, c :: cs, u => + match evalEStep h c u with + | none => none + | some v => forceNat (h + 1) (fun h' => evalERounds h' cs v) +theorem evalERounds_sound (cs : List CodeE) : + ∀ (h : Nat) (u v : WordList), + evalERounds h cs u = some v -> + ERounds h u (h + cs.length) v := by + induction cs with + | nil => + intro h u v hR + injection hR with hR; subst hR + simpa using! ERounds.refl h u + | cons c cs ih => + intro h u v hR + dsimp [evalERounds, forceNat] at hR + cases hW : evalEStep h c u with + | none => rw [hW] at hR; contradiction + | some w => + rw [hW] at hR + have hStep := evalEStep_sound h c u w hW + have hSub := ih (h + 1) w v hR + have heq : (h + 1) + cs.length = h + (c :: cs).length := by simp; omega + rw [heq] at hSub + exact ERounds.next hStep hSub +def isDigitWordE : Word -> Bool + | V => false + | _ => true +theorem exists_digitVal_of_all_isDigitWordE (ds : WordList) (h : ds.all isDigitWordE = true) : + ∃ A, DigitVal A ds.length ds := by + induction ds with + | nil => exact ⟨0, DigitVal.nil⟩ + | cons w ds ih => + cases w + · contradiction + · dsimp [List.all, isDigitWordE] at h + rcases ih h with ⟨A, hI⟩ + have heq : (K :: ds).length = 1 + ds.length := by simp [Nat.add_comm] + rw [heq]; exact ⟨A * 2, DigitVal.zero hI⟩ + · dsimp [List.all, isDigitWordE] at h + rcases ih h with ⟨A, hI⟩ + have heq : (Q :: ds).length = 1 + ds.length := by simp [Nat.add_comm] + rw [heq]; exact ⟨1 + A * 2, DigitVal.one hI⟩ +theorem eGood_of_check (h : Nat) (u da db : WordList) + (hHt : heightShiftE u h = some da.length) + (hGu : EGuard u) + (hEnd : u = u.take (u.length - 4) ++ List.replicate 4 V) + (hDig : da.all isDigitWordE = true) + (hLast : (evalEffect (evalEffect 0 u).1 da).1 = 0) + (hDB_eq : (evalEffect (evalEffect 0 u).1 da).2 = db) + (hPair : hasQKSubword (evalEffect 0 u).2 = true) + (hLo : db = K :: K :: K :: db.drop 3) + (hHi : db = db.take (db.length - 7) ++ List.replicate 7 Q) + (hPhi : 4 * (1 / ((2 ^ h : Nat) : Rat)) * wordMass u + + (1 / ((2 ^ h : Nat) : Rat)) * wordScale u * wordMassK db + + 2 * (1 / ((2 ^ h : Nat) : Rat)) <= 1 / 256) : + EGood h (u ++ da) := by + rcases exists_digitVal_of_all_isDigitWordE da hDig with ⟨A, hDA⟩ + have hEU := evalEffect_sound u 0 + let carry := (evalEffect 0 u).1 + let eff := (evalEffect 0 u).2 + have hED := evalEffect_sound da carry + rw [hLast, hDB_eq] at hED + rcases wordEffect_digitVal hED hDA with ⟨B, hDB, hSum⟩ + simp only [Nat.zero_mul, Nat.add_zero] at hSum + refine EGood.intro h da.length u A da carry eff B db (1 / ((2 ^ h : Nat) : Rat)) + hHt hGu ⟨u.take (u.length - 4), hEnd⟩ hDA hEU hSum hDB hPair + ⟨db.drop 3, hLo⟩ ⟨db.take (db.length - 7), hHi⟩ ?_ hPhi + have hpos : ((2 ^ h : Nat) : Rat) ≠ 0 := by exact_mod_cast Nat.ne_of_gt (pow_two_pos h) + exact one_div_mul_cancel hpos + +end BusyBeaver.WordCalculus diff --git a/BusyBeaver/Calculi/WordCalculusF.lean b/BusyBeaver/Calculi/WordCalculusF.lean new file mode 100644 index 00000000..bfec4401 --- /dev/null +++ b/BusyBeaver/Calculi/WordCalculusF.lean @@ -0,0 +1,1545 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Calculi.Counter +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +/-! +# Word Calculus Engine F (`BusyBeaver.Calculi.WordCalculusF`) + +Formal word-rewriting calculus for structured tape transformations, +providing verified macro-step reductions and tile segment chains for family F. +-/ + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.WordVKQ +set_option quotPrecheck false +set_option maxRecDepth 4000000 + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) + +@[scoped simp] theorem multiStep_zero_vkq (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M + config 0 = some config := rfl +@[scoped simp] theorem multiStep_one_vkq (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) : multiStep M + config 1 = step M config := rfl +@[scoped simp] theorem multiStep_succ_vkq (M : Machine Γ₀ Λ₀) (config : Cfg Γ₀ Λ₀) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep, Function.iterate_succ', Function.comp_apply, multiStep] + +@[scoped simp] theorem zero_cons_default_vkq : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[scoped simp] theorem default_head_vkq : (default : HalfTape).head = 0 := rfl +@[scoped simp] theorem default_tail_vkq : (default : HalfTape).tail = default := rfl +@[scoped simp] theorem append_nil (s : HalfTape) : ([] : BitWord) +> s = s := rfl +@[scoped simp] theorem append_cons (a : Fin 2) (l : BitWord) (s : HalfTape) : + (a :: l) +> s = a >> (l +> s) := rfl +@[scoped simp] theorem append_assoc (l1 l2 : BitWord) (s : HalfTape) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append, append_cons, ih] + +theorem multiStep_of_step_vkq {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (M : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [M]⊢ c_2) : + c_1 [M]⊢^{1} c_2 := by simp [h] +theorem stepPlus_of_step_vkq {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (M : Machine Γ₀ Λ₀) (c_1 c_2 : Cfg Γ₀ Λ₀) (h : c_1 [M]⊢ c_2) : + c_1 [M]⊢⁺ c_2 := ⟨1, by decide, multiStep_of_step_vkq M c_1 c_2 h⟩ +theorem multiStep_add_vkq {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (M : Machine Γ₀ Λ₀) (c_1 : Cfg Γ₀ Λ₀) (n m : Nat) : + multiStep M c_1 (n + m) = (multiStep M c_1 n).bind (fun c_2 => multiStep M c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ, multiStep_succ_vkq, ih, Option.bind_assoc] + simp_rw [multiStep_succ_vkq] +theorem multiStep_trans_vkq {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + (M : Machine Γ₀ Λ₀) (c_1 c_2 c_3 : Cfg Γ₀ Λ₀) (n m : Nat) + (h1 : c_1 [M]⊢^{n} c_2) (h2 : c_2 [M]⊢^{m} c_3) : + c_1 [M]⊢^{n+m} c_3 := by + rw [multiStep_add_vkq, h1]; simp [h2] +theorem stepStar_of_stepPlus_vkq {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {M : Machine Γ₀ Λ₀} {c_1 c_2 : Cfg Γ₀ Λ₀} (h : c_1 [M]⊢⁺ c_2) : + c_1 [M]⊢* c_2 := by obtain ⟨n, _, hn⟩ := h; exact ⟨n, hn⟩ +theorem stepPlus_trans_vkq {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {M : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h1 : c_1 [M]⊢⁺ c_2) (h2 : c_2 [M]⊢⁺ c_3) : c_1 [M]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h1; obtain ⟨m, m_pos, hm⟩ := h2 + exact ⟨n + m, by omega, multiStep_trans_vkq M c_1 c_2 c_3 n m hn hm⟩ +theorem stepPlus_stepStar_trans_vkq {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {M : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h1 : c_1 [M]⊢⁺ c_2) (h2 : c_2 [M]⊢* c_3) : c_1 [M]⊢⁺ c_3 := by + obtain ⟨n, n_pos, hn⟩ := h1; obtain ⟨m, hm⟩ := h2 + exact ⟨n + m, lt_of_lt_of_le n_pos (Nat.le_add_right n m), + multiStep_trans_vkq M c_1 c_2 c_3 n m hn hm⟩ +theorem stepStar_stepPlus_trans_vkq {Γ₀ Λ₀ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] + {M : Machine Γ₀ Λ₀} {c_1 c_2 c_3 : Cfg Γ₀ Λ₀} + (h1 : c_1 [M]⊢ c_2) (h2 : c_2 [M]⊢* c_3) : c_1 [M]⊢⁺ c_3 := + stepPlus_stepStar_trans_vkq (stepPlus_of_step_vkq M c_1 c_2 h1) h2 + +abbrev CCfg := Counter.CCfg (Fin 2) (Fin 6) +abbrev evalCCfgVKQ (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ + +abbrev V_u : BitWord := [1, 1, 0, 0] +abbrev K_u : BitWord := [0, 0] +abbrev Q_u : BitWord := [1, 0] +abbrev Vp : BitWord := [0, 1, 1, 0] +abbrev Kp : BitWord := [0, 0] +abbrev Qp : BitWord := [0, 1] + +@[scoped simp] theorem ku_append_default : K_u +> (default : HalfTape) = default := by simp +@[scoped simp] theorem kp_append_default : Kp +> (default : HalfTape) = default := by simp + +inductive Call where + | ch + | ca +deriving DecidableEq + +inductive SideP {Call : Type*} (callStep : Call -> HalfTape -> HalfTape -> Prop) : List Call -> + HalfTape -> HalfTape -> Prop where + | nil (w : HalfTape) : SideP callStep [] w w + | cons {c : Call} {ls : List Call} {w1 w2 w3 : HalfTape} : + callStep c w1 w2 -> SideP callStep ls w2 w3 -> SideP callStep (c :: ls) w1 w3 + +abbrev SegP {Call : Type*} (callStep : Call -> HalfTape -> HalfTape -> + Prop) (ls_in ls_out : List Call) (w1 w2 : BitWord) : Prop := + ∀ u1 u2, SideP callStep ls_out u1 u2 -> SideP callStep ls_in (w1 +> u1) (w2 +> u2) + +@[scoped simp] theorem list_pow_zero_vkq {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[scoped simp] theorem list_pow_succ_vkq {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ + l ^ n := rfl +@[scoped simp] theorem list_pow_one_add_vkq {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = + l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[scoped simp] theorem list_pow_one_vkq {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem list_pow_add_vkq {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => rw [Nat.add_right_comm, list_pow_succ_vkq, list_pow_succ_vkq, ih, + List.append_assoc] + + +theorem sideP_append {Call : Type*} {callStep : Call -> HalfTape -> HalfTape -> + Prop} {ls1 ls2 : List Call} {w1 w2 w3 : HalfTape} + (h1 : SideP callStep ls1 w1 w2) (h2 : SideP callStep ls2 w2 w3) : SideP callStep (ls1 ++ + ls2) w1 w3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact SideP.cons hc (ih h2) + +theorem sideP_append_inv {Call : Type*} {callStep : Call -> HalfTape -> HalfTape -> + Prop} {ls1 ls2 : List Call} {w1 w3 : HalfTape} + (h : SideP callStep (ls1 ++ ls2) w1 w3) : ∃ w2, SideP callStep ls1 w1 w2 ∧ + SideP callStep ls2 w2 w3 := by + induction ls1 generalizing w1 with + | nil => exact ⟨w1, SideP.nil w1, h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc, hrest⟩ + rcases ih hrest with ⟨w2, h1, h2⟩ + exact ⟨w2, SideP.cons hc h1, h2⟩ + +theorem segP_nil {Call : Type*} {callStep : Call -> HalfTape -> HalfTape -> + Prop} (w : BitWord) : SegP callStep [] [] w w := by + intro u1 u2 h; cases h; exact SideP.nil (w +> u1) + +theorem segP_id {Call : Type*} {callStep : Call -> HalfTape -> HalfTape -> + Prop} (ls : List Call) : SegP callStep ls ls [] [] := by + intro u1 u2 h; exact h + +theorem sideP_of_segP {Call : Type*} {callStep : Call -> HalfTape -> HalfTape -> + Prop} {ls1 ls2 : List Call} {w1 w2 : BitWord} {u1 u2 : HalfTape} + (h1 : SegP callStep ls1 ls2 w1 w2) (h2 : SideP callStep ls2 u1 u2) : + SideP callStep ls1 (w1 +> u1) (w2 +> u2) := + h1 u1 u2 h2 + +theorem segP_append_calls {Call : Type*} {callStep : Call -> HalfTape -> HalfTape -> + Prop} {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : BitWord} + (h1 : SegP callStep ls1 ls2 w1 w2) (h2 : SegP callStep ls3 ls4 w2 w3) : + SegP callStep (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro u1 u3 h + rcases sideP_append_inv h with ⟨u2, ha, hb⟩ + exact sideP_append (h1 u1 u2 ha) (h2 u2 u3 hb) + +theorem segP_comp_words {Call : Type*} {callStep : Call -> HalfTape -> HalfTape -> + Prop} {ls1 ls2 ls3 : List Call} {w1 w2 v1 v2 : BitWord} + (h1 : SegP callStep ls1 ls2 w1 w2) (h2 : SegP callStep ls2 ls3 v1 v2) : + SegP callStep ls1 ls3 (w1 ++ v1) (w2 ++ v2) := by + intro u1 u2 h + rw [append_assoc, append_assoc] + exact h1 (v1 +> u1) (v2 +> u2) (h2 u1 u2 h) + +theorem segP_of_step_nil {Call : Type*} {tm : Machine (Fin 2) (Fin 6)} + {zCR : HalfTape -> Call -> HalfTape -> Cfg (Fin 2) (Fin 6)} + {zCL : HalfTape -> HalfTape -> Cfg (Fin 2) (Fin 6)} + {c : Call} {w1 w2 : BitWord} + (h1 : ∀ u r, (zCR (w1 +> u) c r) [tm]⊢⁺ (zCL (w2 +> u) r)) : + SegP (fun c w1 w2 => ∀ r, (zCR w1 c r) [tm]⊢⁺ (zCL w2 r)) [c] [] w1 w2 := by + intro u1 u2 h; cases h + exact SideP.cons (fun r => h1 u1 r) (SideP.nil _) + +theorem segP_of_step_one {Call : Type*} {tm : Machine (Fin 2) (Fin 6)} + {zCR : HalfTape -> Call -> HalfTape -> Cfg (Fin 2) (Fin 6)} + {zCL : HalfTape -> HalfTape -> Cfg (Fin 2) (Fin 6)} + {c_in c_out : Call} {w1 w2 mid : BitWord} + (h1 : ∀ u r, (zCR (w1 +> u) c_in r) [tm]⊢⁺ (zCR u c_out (mid +> r))) + (h2 : ∀ u r, (zCL u (mid +> r)) [tm]⊢⁺ (zCL (w2 +> u) r)) : + SegP (fun c w1 w2 => ∀ r, (zCR w1 c r) [tm]⊢⁺ (zCL w2 r)) [c_in] [c_out] w1 w2 := by + intro u1 u2 h + rcases h with _ | ⟨hc1, hnil⟩ + cases hnil + refine SideP.cons (fun r => ?_) (SideP.nil _) + exact stepPlus_trans_vkq (h1 u1 r) (stepPlus_trans_vkq (hc1 (mid +> r)) (h2 u2 r)) + +theorem segP_of_step_two {Call : Type*} {tm : Machine (Fin 2) (Fin 6)} + {zCR : HalfTape -> Call -> HalfTape -> Cfg (Fin 2) (Fin 6)} + {zCL : HalfTape -> HalfTape -> Cfg (Fin 2) (Fin 6)} + {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : BitWord} + (h1 : ∀ u r, (zCR (w1 +> u) c_in r) [tm]⊢⁺ (zCR u c1 (mid1 +> r))) + (h2 : ∀ u r, (zCL u (mid1 +> r)) [tm]⊢⁺ (zCR u c2 (mid2 +> r))) + (h3 : ∀ u r, (zCL u (mid2 +> r)) [tm]⊢⁺ (zCL (w2 +> u) r)) : + SegP (fun c w1 w2 => ∀ r, (zCR w1 c r) [tm]⊢⁺ (zCL w2 r)) [c_in] [c1, c2] w1 w2 := by + intro u1 u3 h + rcases h with _ | ⟨hc1, hrest⟩ + rcases hrest with _ | ⟨hc2, hnil⟩ + cases hnil + refine SideP.cons (fun r => ?_) (SideP.nil _) + exact stepPlus_trans_vkq (h1 u1 r) + (stepPlus_trans_vkq (hc1 (mid1 +> r)) + (stepPlus_trans_vkq (h2 _ r) + (stepPlus_trans_vkq (hc2 (mid2 +> r)) (h3 u3 r)))) + +inductive Word where + | V + | K + | Q +deriving DecidableEq +open Word + +def dVal : Word -> Nat + | V => 0 + | K => 0 + | Q => 1 + +theorem dVal_le_one (w : Word) : dVal w <= 1 := by + cases w <;> decide + +def wordsToBits : List Word -> BitWord + | [] => [] + | V :: u => V_u ++ wordsToBits u + | K :: u => K_u ++ wordsToBits u + | Q :: u => Q_u ++ wordsToBits u + +def wordsToBitsShifted : List Word -> BitWord + | [] => [] + | V :: u => Vp ++ wordsToBitsShifted u + | K :: u => Kp ++ wordsToBitsShifted u + | Q :: u => Qp ++ wordsToBitsShifted u + +def evalWords : List Word -> HalfTape -> HalfTape + | [], r => r + | V :: u, r => V_u +> evalWords u r + | K :: u, r => K_u +> evalWords u r + | Q :: u, r => Q_u +> evalWords u r + +def evalWordsShifted : List Word -> HalfTape -> HalfTape + | [], r => r + | V :: u, r => Vp +> evalWordsShifted u r + | K :: u, r => Kp +> evalWordsShifted u r + | Q :: u, r => Qp +> evalWordsShifted u r + +theorem wordsToBits_cons (w : Word) (u : List Word) : wordsToBits (w :: u) = wordsToBits [w] ++ + wordsToBits u := by + cases w <;> rfl + +theorem wordsToBitsShifted_cons (w : Word) (u : List Word) : wordsToBitsShifted (w :: u) = + wordsToBitsShifted [w] ++ wordsToBitsShifted u := by + cases w <;> rfl + +theorem wordsToBits_append (u v : List Word) : wordsToBits (u ++ v) = wordsToBits u ++ + wordsToBits v := by + induction u with + | nil => rfl + | cons a u ih => cases a <;> (dsimp [wordsToBits]; rw [ih]) + +theorem wordsToBitsShifted_append (u v : List Word) : wordsToBitsShifted (u ++ + v) = wordsToBitsShifted u ++ wordsToBitsShifted v := by + induction u with + | nil => rfl + | cons a u ih => cases a <;> (dsimp [wordsToBitsShifted]; rw [ih]) + +theorem wordsToBits_append_tape (u : List Word) (r : HalfTape) : wordsToBits u +> r = + evalWords u r := by + induction u with + | nil => rfl + | cons a u ih => cases a <;> (dsimp [wordsToBits, evalWords]; rw [ih]) + +theorem wordsToBitsShifted_append_tape (u : List Word) (r : HalfTape) : wordsToBitsShifted u +> r = + evalWordsShifted u r := by + induction u with + | nil => rfl + | cons a u ih => cases a <;> (dsimp [wordsToBitsShifted, evalWordsShifted]; rw [ih]) + +theorem evalWords_append (u v : List Word) (r : HalfTape) : evalWords (u ++ + v) r = evalWords u (evalWords v r) := by + induction u with + | nil => rfl + | cons a u ih => cases a <;> simp [evalWords, ih] + +theorem evalWordsShifted_append (u v : List Word) (r : HalfTape) : evalWordsShifted (u ++ + v) r = evalWordsShifted u (evalWordsShifted v r) := by + induction u with + | nil => rfl + | cons a u ih => cases a <;> simp [evalWordsShifted, ih] + +theorem wordsToBits_shift (v : List Word) : [0] ++ wordsToBits v = wordsToBitsShifted v ++ [0] := by + induction v with + | nil => rfl + | cons a v ih => + cases a <;> (simpa [wordsToBits, wordsToBitsShifted, V_u, K_u, Q_u, Vp, Kp, Qp] using ih) + +theorem evalWords_shift (v : List Word) : [0] +> evalWords v default = + evalWordsShifted v default := by + rw [<- wordsToBits_append_tape, <- append_assoc, wordsToBits_shift, append_assoc] + simp only [append_cons, append_nil, zero_cons_default_vkq, wordsToBitsShifted_append_tape] + +theorem evalWords_V_shift (v : List Word) : [1, 1, + 0] +> evalWordsShifted v default = evalWords (V :: v) default := by + rw [<- evalWords_shift, <- append_assoc] + rfl + +theorem evalWords_replicate_K (n : Nat) : evalWords (List.replicate n K) default = default := by + induction n with + | zero => rfl + | succ n ih => + simp only [List.replicate_succ, evalWords, ih, ku_append_default] + +theorem pow_two_pos (n : Nat) : 0 < 2 ^ n := by + induction n with + | zero => decide + | succ n ih => rw [Nat.pow_succ]; omega + +theorem pow_two_one_add (n : Nat) : 2 ^ (1 + n) = 2 ^ n + 2 ^ n := by + rw [Nat.add_comm 1 n, Nat.pow_succ]; omega + +theorem even_or_odd_mul_two (n : Nat) : (∃ a, n = a * 2) ∨ (∃ a, n = 1 + a * 2) := by + rcases Nat.mod_two_eq_zero_or_one n with h | h + · left; exact ⟨n / 2, by omega⟩ + · right; exact ⟨n / 2, by omega⟩ + +inductive DigitVal : Nat -> Nat -> List Word -> Prop where + | nil : DigitVal 0 0 [] + | zero {A H : Nat} {u : List Word} : DigitVal A H u -> DigitVal (A * 2) (1 + H) (K :: u) + | one {A H : Nat} {u : List Word} : DigitVal A H u -> DigitVal (1 + A * 2) (1 + H) (Q :: u) + +theorem lt_pow_of_digitVal {A H : Nat} {u : List Word} (h : DigitVal A H u) : A < 2 ^ H := by + induction h with + | nil => decide + | zero _ ih => rw [pow_two_one_add]; omega + | one _ ih => rw [pow_two_one_add]; omega + +theorem length_of_digitVal {A H : Nat} {u : List Word} (h : DigitVal A H u) : u.length = H := by + induction h with + | nil => rfl + | zero _ ih => simp [ih]; omega + | one _ ih => simp [ih]; omega + +theorem exists_digitVal_of_lt_pow (H : Nat) : ∀ A, A < 2 ^ H -> ∃ u, DigitVal A H u := by + induction H with + | zero => + intro A hA + have h0 : A = 0 := by simpa using hA + subst h0; exact ⟨[], DigitVal.nil⟩ + | succ H ih => + intro A hA + have hpow : 2 ^ (H + 1) = 2 ^ H * 2 := Nat.pow_succ 2 H + have h1H : H + 1 = 1 + H := by omega + rcases even_or_odd_mul_two A with ⟨a, rfl⟩ | ⟨a, rfl⟩ + · rcases ih a (by omega) with ⟨u, hI⟩ + rw [h1H]; exact ⟨K :: u, DigitVal.zero hI⟩ + · rcases ih a (by omega) with ⟨u, hI⟩ + rw [h1H]; exact ⟨Q :: u, DigitVal.one hI⟩ + +theorem digitVal_append {A H : Nat} {u : List Word} (h1 : DigitVal A H u) : + ∀ {B J : Nat} {v : List Word}, DigitVal B J v -> DigitVal (A + B * 2 ^ H) (H + J) (u ++ v) := by + induction h1 with + | nil => + intro B J v h2; simpa using h2 + | @zero A H u _ ih => + intro B J v h2 + have h3 := DigitVal.zero (ih h2) + have heq1 : (A + B * 2 ^ H) * 2 = A * 2 + B * 2 ^ (1 + H) := by rw [pow_two_one_add]; ring + have heq2 : 1 + (H + J) = (1 + H) + J := by omega + rwa [heq1, heq2] at h3 + | @one A H u _ ih => + intro B J v h2 + have h3 := DigitVal.one (ih h2) + have heq1 : 1 + (A + B * 2 ^ H) * 2 = (1 + A * 2) + B * 2 ^ (1 + H) := by + rw [pow_two_one_add]; ring + have heq2 : 1 + (H + J) = (1 + H) + J := by omega + rwa [heq1, heq2] at h3 + +def checkDg : Nat -> List Word -> Bool + | 0, [] => true + | b, K :: u => (b % 2 == 0) && checkDg (b / 2) u + | b, Q :: u => (b % 2 == 1) && checkDg (b / 2) u + | _, _ => false + +theorem checkDg_sound : ∀ b u, checkDg b u = true -> DigitVal b u.length u + | 0, [], _ => DigitVal.nil + | 0, K :: u, h => by + unfold checkDg at h + have hI := checkDg_sound 0 u h + have hZ := DigitVal.zero hI + simpa [Nat.add_comm 1 u.length] using hZ + | b + 1, K :: u, h => by + unfold checkDg at h + simp only [Bool.and_eq_true, beq_iff_eq] at h + have hI := checkDg_sound ((b + 1) / 2) u h.2 + have hZ := DigitVal.zero hI + have hb : ((b + 1) / 2) * 2 = b + 1 := by omega + rwa [hb, Nat.add_comm 1 u.length] at hZ + | 0, Q :: u, h => by unfold checkDg at h; contradiction + | b + 1, Q :: u, h => by + unfold checkDg at h + simp only [Bool.and_eq_true, beq_iff_eq] at h + have hI := checkDg_sound ((b + 1) / 2) u h.2 + have hO := DigitVal.one hI + have hb : 1 + ((b + 1) / 2) * 2 = b + 1 := by omega + rwa [hb, Nat.add_comm 1 u.length] at hO + | _ + 1, [], h => by unfold checkDg at h; contradiction + | 0, V :: _, h => by unfold checkDg at h; contradiction + | _ + 1, V :: _, h => by unfold checkDg at h; contradiction + +inductive Parse : Nat -> List Word -> Nat -> Nat -> Prop where + | nil (a : Nat) : Parse a [] a 0 + | T {a a' g : Nat} {u : List Word} : + Parse (1 + a * 2) u a' g -> Parse a (V :: u) a' g + | VK {a a' g : Nat} {u : List Word} : + Parse a u a' g -> Parse a (V :: K :: u) a' g + | D {a q1 a' g : Nat} {w0 : Word} {u : List Word} + (hw0 : w0 ≠ V) (hq1 : a + dVal w0 = q1 * 2) : + Parse q1 u a' g -> Parse a (w0 :: u) a' g + | P {a q2 a' g : Nat} {w0 w1 : Word} {u : List Word} + (hw0 : w0 ≠ V) (hw1 : w1 ≠ V) (hq2 : (a + dVal w0) / 2 + dVal w1 = 1 + q2 * 2) : + Parse q2 u a' g -> Parse a (w0 :: w1 :: u) a' (1 + g) + +inductive Scan : Nat -> Nat -> List Word -> Nat -> Nat -> List Word -> Nat -> Prop where + | nil (a b : Nat) (hb : 1 <= b) : + Scan a b [] a b [] 0 + | T {a b a' b' g : Nat} {u v : List Word} (hb : 2 <= b) : + Scan (1 + a * 2) ((b - 1) * 2) u a' b' v g -> + Scan a b (V :: u) a' b' (V :: v) g + | VK0 {a k a' b' g : Nat} {u v : List Word} (hk : 1 <= k) : + Scan a (1 + (k - 1) * 2) u a' b' v g -> + Scan a (k * 2) (V :: K :: u) a' b' (K :: V :: v) g + | VK1 {a k a' b' g : Nat} {u v : List Word} (hk : 1 <= k) : + Scan a (1 + (k - 1) * 2) u a' b' v g -> + Scan a (1 + k * 2) (V :: K :: u) a' b' (Q :: V :: v) g + | D {a b q1 a' b' g : Nat} {w0 : Word} {u v : List Word} + (hw0 : w0 ≠ V) (hq1 : a + dVal w0 = q1 * 2) (_hb : 2 <= b) : + Scan q1 (b / 2) u a' b' v g -> + Scan a b (w0 :: u) a' b' ((if b % 2 == 1 then Q else K) :: v) g + | P0 {a b q1 q2 a' b' g : Nat} {w0 w1 : Word} {u v : List Word} + (hw0 : w0 ≠ V) (hw1 : w1 ≠ V) + (hq1 : a + dVal w0 = q1 * 2) (hq2 : q1 + dVal w1 = 1 + q2 * 2) (hb : 2 <= b) : + Scan q2 ((b - 1) * 2) u a' b' v g -> + Scan a b (w0 :: w1 :: u) a' b' (V :: v) (1 + g) + | P1 {a b q1 q2 a' b' g : Nat} {w0 w1 : Word} {u v : List Word} + (hw0 : w0 ≠ V) (hw1 : w1 ≠ V) + (hq1 : a + dVal w0 = 1 + q1 * 2) (hq2 : q1 + dVal w1 = 1 + q2 * 2) (hb : 2 <= b) : + Scan q2 (1 + (b - 1) * 2) u a' b' v g -> + Scan a b (w0 :: w1 :: u) a' b' (V :: v) (1 + g) + + +abbrev StepB (b0 : Nat) (u u' : List Word) : Prop := + ∃ n b' v da H g, + Scan 0 b0 (u ++ List.replicate n K) 0 b' v g ∧ + DigitVal b' H da ∧ + u' = V :: (v ++ da) + +inductive RoundsB (b0 : Nat) : List Word -> List Word -> Prop where + | refl (u : List Word) : RoundsB b0 u u + | next {u v w : List Word} : StepB b0 u v -> RoundsB b0 v w -> RoundsB b0 u w + +abbrev Step := StepB 6 +abbrev Rounds := RoundsB 6 +abbrev Rounds.refl := @RoundsB.refl 6 +abbrev Rounds.next := @RoundsB.next 6 + +structure SegSpec (callStep : Call -> HalfTape -> HalfTape -> Prop) : Prop where + seg_ch_V : SegP callStep [.ch] [.ch, .ch] V_u V_u + seg_ca_V : SegP callStep [.ca] [.ch] V_u Vp + seg_ca_Vp : SegP callStep [.ca] [.ca, .ca] Vp Vp + seg_ch_K : SegP callStep [.ch] [] K_u Q_u + seg_ch_Q : SegP callStep [.ch] [.ch] Q_u K_u + seg_ca_VpQ : SegP callStep [.ca] [.ca] (Vp ++ Q_u) (Kp ++ Vp) + seg_ca_KpVp : SegP callStep [.ca] [] (Kp ++ Vp) (Qp ++ Vp) + seg_ca_QpVp : SegP callStep [.ca] [.ca, .ca] (Qp ++ Vp) (Kp ++ Vp) + seg_ca_Kp : SegP callStep [.ca] [] Kp Qp + seg_ca_Qp : SegP callStep [.ca] [.ca] Qp Kp + seg_ca_KQ : SegP callStep [.ca] [] (K_u ++ Q_u) Vp + seg_ca_QQ : SegP callStep [.ca] [.ca] (Q_u ++ Q_u) Vp + +theorem seg_ch_V_pow {callStep : Call -> HalfTape -> HalfTape -> + Prop} (S : SegSpec callStep) (n : Nat) : SegP callStep ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) + V_u V_u := by + induction n with + | zero => exact segP_nil V_u + | succ n ih => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [list_pow_succ_vkq, heq, list_pow_add_vkq] + exact segP_append_calls S.seg_ch_V ih + +theorem seg_ca_Vp_pow {callStep : Call -> HalfTape -> HalfTape -> + Prop} (S : SegSpec callStep) (n : Nat) : SegP callStep ([Call.ca] ^ n) ([Call.ca] ^ (n * 2)) Vp + Vp := by + induction n with + | zero => exact segP_nil Vp + | succ n ih => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [list_pow_succ_vkq, heq, list_pow_add_vkq] + exact segP_append_calls S.seg_ca_Vp ih + +theorem seg_double {callStep : Call -> HalfTape -> HalfTape -> + Prop} {c : Call} {w : BitWord} (hw : SegP callStep [c, c] [c] w w) (n : Nat) : + SegP callStep ([c] ^ (n * 2)) ([c] ^ n) w w := by + induction n with + | zero => exact segP_nil w + | succ n ih => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq, list_pow_add_vkq, list_pow_succ_vkq] + exact segP_append_calls hw ih + +theorem seg_ch_K_even {callStep : Call -> HalfTape -> HalfTape -> + Prop} (S : SegSpec callStep) (n : Nat) : SegP callStep ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) + K_u K_u := + seg_double (segP_append_calls S.seg_ch_K S.seg_ch_Q) n + +theorem seg_ch_Q_even {callStep : Call -> HalfTape -> HalfTape -> + Prop} (S : SegSpec callStep) (n : Nat) : SegP callStep ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) + Q_u Q_u := + seg_double (segP_append_calls S.seg_ch_Q S.seg_ch_K) n + +theorem seg_ch_K_odd {callStep : Call -> HalfTape -> HalfTape -> + Prop} (S : SegSpec callStep) (n : Nat) : SegP callStep ([Call.ch] ^ (1 + + n * 2)) ([Call.ch] ^ n) K_u Q_u := by + have heq : 1 + n * 2 = n * 2 + 1 := by omega + rw [heq, list_pow_add_vkq, list_pow_one_vkq] + simpa using segP_append_calls ((seg_ch_K_even S) n) S.seg_ch_K + +theorem seg_ch_Q_odd {callStep : Call -> HalfTape -> HalfTape -> + Prop} (S : SegSpec callStep) (n : Nat) : SegP callStep ([Call.ch] ^ (1 + + n * 2)) ([Call.ch] ^ (1 + n)) Q_u K_u := by + simpa only [list_pow_one_add_vkq, List.cons_append, + List.nil_append] using segP_append_calls S.seg_ch_Q ((seg_ch_K_even S) n) + +theorem seg_ch_d_even {callStep : Call -> HalfTape -> HalfTape -> + Prop} (S : SegSpec callStep) {w0 : Word} {a q1 : Nat} (hw0 : w0 ≠ V) (hq1 : a + dVal w0 = + q1 * 2) : + SegP callStep ([Call.ch] ^ a) ([Call.ch] ^ q1) (wordsToBits [w0]) K_u := by + cases w0 with + | V => contradiction + | K => + have ha : a = q1 * 2 := by dsimp [dVal] at hq1; omega + subst ha; simpa [wordsToBits] using (seg_ch_K_even S) q1 + | Q => + dsimp [dVal] at hq1 + cases q1 with + | zero => omega + | succ m => + have ha : a = 1 + m * 2 := by omega + have h1m : m + 1 = 1 + m := by omega + subst ha; rw [h1m] + simpa [wordsToBits] using (seg_ch_Q_odd S) m + +theorem seg_ch_d_odd {callStep : Call -> HalfTape -> HalfTape -> + Prop} (S : SegSpec callStep) {w0 : Word} {a q1 : Nat} (hw0 : w0 ≠ V) (hq1 : a + dVal w0 = + 1 + q1 * 2) : + SegP callStep ([Call.ch] ^ a) ([Call.ch] ^ q1) (wordsToBits [w0]) Q_u := by + cases w0 with + | V => contradiction + | K => + have ha : a = 1 + q1 * 2 := by dsimp [dVal] at hq1; omega + subst ha; simpa [wordsToBits] using (seg_ch_K_odd S) q1 + | Q => + have ha : a = q1 * 2 := by dsimp [dVal] at hq1; omega + subst ha; simpa [wordsToBits] using (seg_ch_Q_even S) q1 + +theorem seg_ca_Kp_even {callStep : Call -> HalfTape -> HalfTape -> + Prop} (S : SegSpec callStep) (n : Nat) : SegP callStep ([Call.ca] ^ (n * 2)) ([Call.ca] ^ n) Kp + Kp := + seg_double (segP_append_calls S.seg_ca_Kp S.seg_ca_Qp) n + +theorem seg_ca_Kp_odd {callStep : Call -> HalfTape -> HalfTape -> + Prop} (S : SegSpec callStep) (n : Nat) : SegP callStep ([Call.ca] ^ (1 + + n * 2)) ([Call.ca] ^ n) Kp Qp := by + have heq : 1 + n * 2 = n * 2 + 1 := by omega + rw [heq, list_pow_add_vkq, list_pow_one_vkq] + simpa using segP_append_calls ((seg_ca_Kp_even S) n) S.seg_ca_Kp + +theorem seg_ca_KpVp_even {callStep : Call -> HalfTape -> HalfTape -> + Prop} (S : SegSpec callStep) (n : Nat) : + SegP callStep ([Call.ca] ^ (n * 2)) ([Call.ca] ^ (n * 2)) (Kp ++ Vp) (Kp ++ Vp) := by + induction n with + | zero => exact segP_nil (Kp ++ Vp) + | succ n ih => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq, list_pow_add_vkq] + have h2 : SegP callStep [.ca, .ca] [.ca, .ca] (Kp ++ Vp) (Kp ++ Vp) := + segP_append_calls S.seg_ca_KpVp S.seg_ca_QpVp + exact segP_append_calls h2 ih + +theorem Side_ca_default {callStep : Call -> HalfTape -> HalfTape -> + Prop} (S : SegSpec callStep) {b' H : Nat} {da : List Word} (h : DigitVal b' H da) : + SideP callStep ([Call.ca] ^ b') default (evalWordsShifted da default) := by + induction h with + | nil => exact SideP.nil default + | @zero A H u _ ih => + have hS := sideP_of_segP ((seg_ca_Kp_even S) A) ih + simpa [evalWordsShifted, kp_append_default] using hS + | @one A H u _ ih => + have hS := sideP_of_segP ((seg_ca_Kp_odd S) A) ih + simpa [evalWordsShifted, kp_append_default] using hS + +theorem seg_Scan_T {callStep : Call -> HalfTape -> HalfTape -> + Prop} (S : SegSpec callStep) (a b : Nat) (hb : 2 <= b) : + SegP callStep ([Call.ch] ^ a ++ [Call.ca] ^ b) + ([Call.ch] ^ (1 + a * 2) ++ [Call.ca] ^ ((b - 1) * 2)) V_u Vp := by + have hb_pow : [Call.ca] ^ b = [Call.ca] ++ [Call.ca] ^ (b - 1) := by + have hb1 : b = 1 + (b - 1) := by omega + conv_lhs => rw [hb1, list_pow_one_add_vkq] + rw [hb_pow, <- List.append_assoc] + have h1 : SegP callStep ([Call.ch] ^ a ++ [Call.ca]) ([Call.ch] ^ (1 + a * 2)) V_u Vp := by + have heq : 1 + a * 2 = a * 2 + 1 := by omega + rw [heq, list_pow_add_vkq, list_pow_one_vkq] + exact segP_append_calls ((seg_ch_V_pow S) a) S.seg_ca_V + exact segP_append_calls h1 ((seg_ca_Vp_pow S) (b - 1)) + +theorem seg_Scan_VK_base {callStep : Call -> HalfTape -> HalfTape -> + Prop} (S : SegSpec callStep) (a : Nat) : + SegP callStep ([Call.ch] ^ a ++ [Call.ca]) ([Call.ch] ^ a) (V_u ++ K_u) (Vp ++ Q_u) := by + have hV : SegP callStep ([Call.ch] ^ a ++ [Call.ca]) ([Call.ch] ^ (1 + a * 2)) V_u Vp := by + have heq : 1 + a * 2 = a * 2 + 1 := by omega + rw [heq, list_pow_add_vkq, list_pow_one_vkq] + exact segP_append_calls ((seg_ch_V_pow S) a) S.seg_ca_V + exact segP_comp_words hV ((seg_ch_K_odd S) a) + +theorem seg_Scan_VK0 {callStep : Call -> HalfTape -> HalfTape -> + Prop} (S : SegSpec callStep) (a k : Nat) (hk : 1 <= k) : + SegP callStep ([Call.ch] ^ a ++ [Call.ca] ^ (k * 2)) + ([Call.ch] ^ a ++ [Call.ca] ^ (1 + (k - 1) * 2)) (V_u ++ K_u) (Kp ++ Vp) := by + have hk_pow : [Call.ca] ^ (k * 2) = [Call.ca] ++ ([Call.ca] ++ [Call.ca] ^ ((k - 1) * 2)) := by + have hk2 : k * 2 = 1 + (1 + (k - 1) * 2) := by omega + conv_lhs => rw [hk2, list_pow_one_add_vkq, list_pow_one_add_vkq] + rw [hk_pow, <- List.append_assoc] + have h_ca : SegP callStep ([Call.ca] ++ [Call.ca] ^ ((k - 1) * 2)) + ([Call.ca] ^ (1 + (k - 1) * 2)) (Vp ++ Q_u) (Kp ++ Vp) := by + have h_rhs : [Call.ca] ^ (1 + (k - 1) * 2) = [Call.ca] ++ [Call.ca] ^ ((k - 1) * 2) := + list_pow_one_add_vkq [Call.ca] ((k - 1) * 2) + rw [h_rhs] + exact segP_append_calls S.seg_ca_VpQ ((seg_ca_KpVp_even S) (k - 1)) + exact segP_append_calls ((seg_Scan_VK_base S) a) h_ca + +theorem seg_Scan_VK1 {callStep : Call -> HalfTape -> HalfTape -> + Prop} (S : SegSpec callStep) (a k : Nat) (hk : 1 <= k) : + SegP callStep ([Call.ch] ^ a ++ [Call.ca] ^ (1 + k * 2)) + ([Call.ch] ^ a ++ [Call.ca] ^ (1 + (k - 1) * 2)) (V_u ++ K_u) (Qp ++ Vp) := by + have hk_pow : [Call.ca] ^ (1 + k * 2) = [Call.ca] ^ (k * 2) ++ [Call.ca] := by + have hk2 : 1 + k * 2 = k * 2 + 1 := by omega + rw [hk2, list_pow_add_vkq, list_pow_one_vkq] + rw [hk_pow, <- List.append_assoc] + have h_tot := segP_append_calls ((seg_Scan_VK0 S) a k hk) S.seg_ca_KpVp + simpa only [List.append_nil] using h_tot + +theorem seg_Scan_D {callStep : Call -> HalfTape -> HalfTape -> + Prop} (S : SegSpec callStep) {w0 : Word} {a b q1 : Nat} + (hw0 : w0 ≠ V) (hq1 : a + dVal w0 = q1 * 2) (_hb : 2 <= b) : + SegP callStep ([Call.ch] ^ a ++ [Call.ca] ^ b) + ([Call.ch] ^ q1 ++ [Call.ca] ^ (b / 2)) + (wordsToBits [w0]) (wordsToBitsShifted [if b % 2 == 1 then Q else K]) := by + have h_ch := (seg_ch_d_even S) hw0 hq1 + rcases Nat.mod_two_eq_zero_or_one b with hb0 | hb1 + · have hb_pow : [Call.ca] ^ b = [Call.ca] ^ ((b / 2) * 2) := by + have hb_eq : b = (b / 2) * 2 := by omega + conv_lhs => rw [hb_eq] + have h_if : (if b % 2 == 1 then Q else K) = K := by rw [hb0]; rfl + rw [hb_pow, h_if] + simpa [wordsToBitsShifted] using segP_append_calls h_ch ((seg_ca_Kp_even S) (b / 2)) + · have hb_pow : [Call.ca] ^ b = [Call.ca] ^ (1 + (b / 2) * 2) := by + have hb_eq : b = 1 + (b / 2) * 2 := by omega + conv_lhs => rw [hb_eq] + have h_if : (if b % 2 == 1 then Q else K) = Q := by rw [hb1]; rfl + rw [hb_pow, h_if] + simpa [wordsToBitsShifted] using segP_append_calls h_ch ((seg_ca_Kp_odd S) (b / 2)) + +theorem seg_Scan_P0 {callStep : Call -> HalfTape -> HalfTape -> + Prop} (S : SegSpec callStep) {w0 w1 : Word} {a b q1 q2 : Nat} + (hw0 : w0 ≠ V) (hw1 : w1 ≠ V) + (hq1 : a + dVal w0 = q1 * 2) (hq2 : q1 + dVal w1 = 1 + q2 * 2) (hb : 2 <= b) : + SegP callStep ([Call.ch] ^ a ++ [Call.ca] ^ b) + ([Call.ch] ^ q2 ++ [Call.ca] ^ ((b - 1) * 2)) + (wordsToBits [w0, w1]) Vp := by + have h_ch1 := (seg_ch_d_even S) hw0 hq1 + have h_ch2 := (seg_ch_d_odd S) hw1 hq2 + have h_ch : SegP callStep ([Call.ch] ^ a) ([Call.ch] ^ q2) (wordsToBits [w0, + w1]) (K_u ++ Q_u) := by + have h0 := segP_comp_words h_ch1 h_ch2 + rwa [<- wordsToBits_cons] at h0 + have hb_pow : [Call.ca] ^ b = [Call.ca] ++ [Call.ca] ^ (b - 1) := by + have hb1 : b = 1 + (b - 1) := by omega + conv_lhs => rw [hb1, list_pow_one_add_vkq] + rw [hb_pow] + have h_ca : SegP callStep ([Call.ca] ++ + [Call.ca] ^ (b - 1)) ([Call.ca] ^ ((b - 1) * 2)) (K_u ++ Q_u) Vp := by + simpa using segP_append_calls S.seg_ca_KQ ((seg_ca_Vp_pow S) (b - 1)) + exact segP_append_calls h_ch h_ca + +theorem seg_Scan_P1 {callStep : Call -> HalfTape -> HalfTape -> + Prop} (S : SegSpec callStep) {w0 w1 : Word} {a b q1 q2 : Nat} + (hw0 : w0 ≠ V) (hw1 : w1 ≠ V) + (hq1 : a + dVal w0 = 1 + q1 * 2) (hq2 : q1 + dVal w1 = 1 + q2 * 2) (hb : 2 <= b) : + SegP callStep ([Call.ch] ^ a ++ [Call.ca] ^ b) + ([Call.ch] ^ q2 ++ [Call.ca] ^ (1 + (b - 1) * 2)) + (wordsToBits [w0, w1]) Vp := by + have h_ch1 := (seg_ch_d_odd S) hw0 hq1 + have h_ch2 := (seg_ch_d_odd S) hw1 hq2 + have h_ch : SegP callStep ([Call.ch] ^ a) ([Call.ch] ^ q2) (wordsToBits [w0, + w1]) (Q_u ++ Q_u) := by + have h0 := segP_comp_words h_ch1 h_ch2 + rwa [<- wordsToBits_cons] at h0 + have hb_pow : [Call.ca] ^ b = [Call.ca] ++ [Call.ca] ^ (b - 1) := by + have hb1 : b = 1 + (b - 1) := by omega + conv_lhs => rw [hb1, list_pow_one_add_vkq] + rw [hb_pow] + have h_ca : SegP callStep ([Call.ca] ++ + [Call.ca] ^ (b - 1)) ([Call.ca] ^ (1 + (b - 1) * 2)) (Q_u ++ Q_u) Vp := by + have h_rhs : [Call.ca] ^ (1 + (b - 1) * 2) = [Call.ca] ++ [Call.ca] ^ ((b - 1) * 2) := + list_pow_one_add_vkq [Call.ca] ((b - 1) * 2) + rw [h_rhs] + exact segP_append_calls S.seg_ca_QQ ((seg_ca_Vp_pow S) (b - 1)) + exact segP_append_calls h_ch h_ca + +theorem Seg_of_Scan {callStep : Call -> HalfTape -> HalfTape -> + Prop} (S : SegSpec callStep) {a b a' b' g : Nat} {u v : List Word} + (h : Scan a b u a' b' v g) : + SegP callStep ([Call.ch] ^ a ++ [Call.ca] ^ b) ([Call.ch] ^ a' ++ + [Call.ca] ^ b') (wordsToBits u) (wordsToBitsShifted v) := by + induction h with + | nil a b _ => exact segP_id _ + | T hb _ ih => + simpa [wordsToBits, wordsToBitsShifted] using segP_comp_words ((seg_Scan_T S) _ _ hb) ih + | VK0 hk _ ih => + have h0 := segP_comp_words ((seg_Scan_VK0 S) _ _ hk) ih + simpa [wordsToBits, wordsToBitsShifted, List.append_assoc] using h0 + | VK1 hk _ ih => + have h0 := segP_comp_words ((seg_Scan_VK1 S) _ _ hk) ih + simpa [wordsToBits, wordsToBitsShifted, List.append_assoc] using h0 + | D hw0 hq1 hb _ ih => + have h0 := segP_comp_words ((seg_Scan_D S) hw0 hq1 hb) ih + rwa [<- wordsToBits_cons, <- wordsToBitsShifted_cons] at h0 + | P0 hw0 hw1 hq1 hq2 hb _ ih => + have h0 := segP_comp_words ((seg_Scan_P0 S) hw0 hw1 hq1 hq2 hb) ih + rwa [<- wordsToBits_append [_, _] _] at h0 + | P1 hw0 hw1 hq1 hq2 hb _ ih => + have h0 := segP_comp_words ((seg_Scan_P1 S) hw0 hw1 hq1 hq2 hb) ih + rwa [<- wordsToBits_append [_, _] _] at h0 + +-- Section 3: Universal Parse_V_start, Scan_of_Parse, and Trace Evaluators +abbrev CanParse (a : Nat) (u : List Word) : Prop := + ∃ a' g, Parse a u a' g + +theorem Parse_all (u : List Word) : + (∀ a, CanParse a (V :: u)) ∧ + (∀ w0 a q1, w0 ≠ V -> a + dVal w0 = q1 * 2 -> CanParse a (w0 :: u)) ∧ + (∀ w1 k, w1 ≠ V -> CanParse k u ∨ CanParse (2 * k + 1 - dVal w1) (w1 :: u)) := by + induction u with + | nil => + refine ⟨?_, ?_, ?_⟩ + · intro a; exact ⟨1 + a * 2, 0, Parse.T (Parse.nil _)⟩ + · intro w0 a q1 hw0 hq1; exact ⟨q1, 0, Parse.D hw0 hq1 (Parse.nil q1)⟩ + · intro w1 k _; left; exact ⟨k, 0, Parse.nil k⟩ + | cons x u' ih => + rcases ih with ⟨hV, hEven, hChoice⟩ + cases x with + | V => + refine ⟨?_, ?_, ?_⟩ + · intro a + rcases hV (1 + a * 2) with ⟨a', g, hp⟩ + exact ⟨a', g, Parse.T hp⟩ + · intro w0 a q1 hw0 hq1 + rcases hV q1 with ⟨a', g, hp⟩ + exact ⟨a', g, Parse.D hw0 hq1 hp⟩ + · intro w1 k _ + left; exact hV k + | K => + have h_choice_K : ∀ w1 k, w1 ≠ V -> CanParse k (K :: u') ∨ + CanParse (2 * k + 1 - dVal w1) (w1 :: K :: u') := by + intro w1 k hw1 + rcases even_or_odd_mul_two (k + dVal K) with ⟨q2, hq2⟩ | ⟨q2, hq2⟩ + · left; exact hEven K k q2 (by decide) hq2 + · rcases hChoice K q2 (by decide) with ⟨a', g, hp2⟩ | hR + · right + have hdiv : (2 * k + 1 - dVal w1 + dVal w1) / 2 + dVal K = 1 + q2 * 2 := by + cases w1 <;> (dsimp [dVal] at hq2 ⊢; omega) + exact ⟨a', 1 + g, Parse.P hw1 (by decide) hdiv hp2⟩ + · left + have heq : 2 * q2 + 1 - dVal K = k := by dsimp [dVal] at hq2 ⊢; omega + rwa [heq] at hR + have h_even_K : ∀ w0 a q1, w0 ≠ V -> a + dVal w0 = q1 * 2 -> CanParse a (w0 :: K :: u') := by + intro w0 a q1 hw0 hq1 + rcases even_or_odd_mul_two (q1 + dVal K) with ⟨q2, hq2⟩ | ⟨q2, hq2⟩ + · rcases hEven K q1 q2 (by decide) hq2 with ⟨a', g, hp⟩ + exact ⟨a', g, Parse.D hw0 hq1 hp⟩ + · rcases hChoice K q2 (by decide) with ⟨a', g, hp2⟩ | hR + · have hdiv : (a + dVal w0) / 2 + dVal K = 1 + q2 * 2 := by + cases w0 <;> (dsimp [dVal] at hq1 hq2 ⊢; omega) + exact ⟨a', 1 + g, Parse.P hw0 (by decide) hdiv hp2⟩ + · have heq : 2 * q2 + 1 - dVal K = q1 := by dsimp [dVal] at hq2 ⊢; omega + rw [heq] at hR + rcases hR with ⟨a', g, hp⟩ + exact ⟨a', g, Parse.D hw0 hq1 hp⟩ + have h_V_K : ∀ a, CanParse a (V :: K :: u') := by + intro a + rcases hChoice K a (by decide) with ⟨a', g, hp⟩ | hR + · exact ⟨a', g, Parse.VK hp⟩ + · have heq : 2 * a + 1 - dVal K = 1 + a * 2 := by dsimp [dVal]; omega + rw [heq] at hR + rcases hR with ⟨a', g, hp⟩ + exact ⟨a', g, Parse.T hp⟩ + exact ⟨h_V_K, h_even_K, h_choice_K⟩ + | Q => + have h_choice_Q : ∀ w1 k, w1 ≠ V -> CanParse k (Q :: u') ∨ + CanParse (2 * k + 1 - dVal w1) (w1 :: Q :: u') := by + intro w1 k hw1 + rcases even_or_odd_mul_two (k + dVal Q) with ⟨q2, hq2⟩ | ⟨q2, hq2⟩ + · left; exact hEven Q k q2 (by decide) hq2 + · rcases hChoice Q q2 (by decide) with ⟨a', g, hp2⟩ | hR + · right + have hdiv2 : (2 * k + 1 - dVal w1 + dVal w1) / 2 + dVal Q = 1 + q2 * 2 := by + cases w1 <;> (dsimp [dVal] at hq2 ⊢; omega) + exact ⟨a', 1 + g, Parse.P hw1 (by decide) hdiv2 hp2⟩ + · left + have heq : 2 * q2 + 1 - dVal Q = k := by dsimp [dVal] at hq2 ⊢; omega + rwa [heq] at hR + have h_even_Q : ∀ w0 a q1, w0 ≠ V -> a + dVal w0 = q1 * 2 -> CanParse a (w0 :: Q :: u') := by + intro w0 a q1 hw0 hq1 + rcases even_or_odd_mul_two (q1 + dVal Q) with ⟨q2, hq2⟩ | ⟨q2, hq2⟩ + · rcases hEven Q q1 q2 (by decide) hq2 with ⟨a', g, hp⟩ + exact ⟨a', g, Parse.D hw0 hq1 hp⟩ + · rcases hChoice Q q2 (by decide) with ⟨a', g, hp2⟩ | hR + · have hdiv : (a + dVal w0) / 2 + dVal Q = 1 + q2 * 2 := by + cases w0 <;> (dsimp [dVal] at hq1 hq2 ⊢; omega) + exact ⟨a', 1 + g, Parse.P hw0 (by decide) hdiv hp2⟩ + · have heq : 2 * q2 + 1 - dVal Q = q1 := by dsimp [dVal] at hq2 ⊢; omega + rw [heq] at hR + rcases hR with ⟨a', g, hp⟩ + exact ⟨a', g, Parse.D hw0 hq1 hp⟩ + have h_V_Q : ∀ a, CanParse a (V :: Q :: u') := by + intro a + have hev : (1 + a * 2) + dVal Q = (1 + a) * 2 := by dsimp [dVal]; omega + rcases hEven Q (1 + a * 2) (1 + a) (by decide) hev with ⟨a', g, hp⟩ + exact ⟨a', g, Parse.T hp⟩ + exact ⟨h_V_Q, h_even_Q, h_choice_Q⟩ + +theorem Parse_V_start (a : Nat) (u : List Word) : ∃ a' g, Parse a (V :: u) a' g := + (Parse_all u).1 a + +-- Algebraic summaries +def wordVal : List Word -> Rat + | [] => 0 + | V :: u => (1 / 2) * wordVal u + | _ :: u => 1 + 2 * wordVal u + +def wordValQ : List Word -> Rat + | [] => 0 + | V :: u => (1 / 2) * wordValQ u + | K :: u => 2 * wordValQ u + | Q :: u => 1 + 2 * wordValQ u + +def wordScale : List Word -> Rat + | [] => 1 + | V :: u => (1 / 2) * wordScale u + | _ :: u => 2 * wordScale u + +def wordPotPair : List Word -> Rat × Rat + | [] => (0, 0) + | V :: u => + let p := wordPotPair u + (p.2, (1 / 2) * p.2) + | K :: u => + let p := wordPotPair u + (3 / 2 + 2 * p.1, 1 + p.1) + | Q :: u => + let p := wordPotPair u + (3 / 2 + 2 * p.1, 3 / 4 + p.1) + +def wordPot (u : List Word) : Rat := (wordPotPair u).1 +def wordPotV (u : List Word) : Rat := (wordPotPair u).2 + +def dCount : List Word -> Nat + | [] => 0 + | V :: u => dCount u + | _ :: u => 1 + dCount u + +@[scoped simp] theorem wordPot_nil : wordPot [] = 0 := rfl +@[scoped simp] theorem wordPotV_nil : wordPotV [] = 0 := rfl +@[scoped simp] theorem wordPot_cons_V (u : List Word) : wordPot (V :: u) = wordPotV u := rfl +@[scoped simp] theorem wordPotV_cons_V (u : List Word) : wordPotV (V :: u) = + (1 / 2) * wordPotV u := rfl +@[scoped simp] theorem wordPot_cons_K (u : List Word) : wordPot (K :: u) = + 3 / 2 + 2 * wordPot u := rfl +@[scoped simp] theorem wordPotV_cons_K (u : List Word) : wordPotV (K :: u) = 1 + wordPot u := rfl +@[scoped simp] theorem wordPot_cons_Q (u : List Word) : wordPot (Q :: u) = + 3 / 2 + 2 * wordPot u := rfl +@[scoped simp] theorem wordPotV_cons_Q (u : List Word) : wordPotV (Q :: u) = + 3 / 4 + wordPot u := rfl + +theorem wordVal_nonneg (u : List Word) : 0 <= wordVal u := by + induction u with + | nil => simp [wordVal] + | cons a u ih => cases a <;> (dsimp [wordVal]; linarith) + +theorem wordValQ_nonneg (u : List Word) : 0 <= wordValQ u := by + induction u with + | nil => simp [wordValQ] + | cons a u ih => cases a <;> (dsimp [wordValQ]; linarith) + +theorem wordVal_cons_digit {w0 : Word} (hw0 : w0 ≠ V) (u : List Word) : + wordVal (w0 :: u) = 1 + 2 * wordVal u := by + cases w0 with + | V => contradiction + | K => rfl + | Q => rfl + +theorem wordScale_cons_digit {w0 : Word} (hw0 : w0 ≠ V) (u : List Word) : + wordScale (w0 :: u) = 2 * wordScale u := by + cases w0 with + | V => contradiction + | K => rfl + | Q => rfl + +theorem wordPot_cons_digit {w0 : Word} (hw0 : w0 ≠ V) (u : List Word) : + wordPot (w0 :: u) = 3 / 2 + 2 * wordPot u := by + cases w0 with + | V => contradiction + | K => rfl + | Q => rfl + +theorem Scan_of_Parse {a a' g : Nat} {u : List Word} (h : Parse a u a' g) : + ∀ b : Nat, 2 + 4 * wordVal u < (b : Rat) -> ∃ b' v, Scan a b u a' b' v g ∧ 3 <= b' := by + induction h with + | nil a => + intro b hb + dsimp [wordVal] at hb + have hb_rat : (2 : Rat) < (b : Rat) := by linarith + have hb_lt : 2 < b := by exact_mod_cast hb_rat + have hb3 : 3 <= b := by omega + exact ⟨b, [], Scan.nil a b (by omega), hb3⟩ + | @T a a' g u _ ih => + intro b hb + have hz := wordVal_nonneg u + dsimp [wordVal] at hb + have hb_rat : (2 : Rat) < (b : Rat) := by linarith + have hb_lt : 2 < b := by exact_mod_cast hb_rat + have hb2 : 2 <= b := by omega + have hb_next : 2 + 4 * wordVal u < (((b - 1) * 2 : Nat) : Rat) := by + have hcast : (((b - 1) * 2 : Nat) : Rat) = 2 * (b : Rat) - 2 := by + rw [Nat.cast_mul, Nat.cast_sub (by omega : 1 <= b)]; push_cast; ring + linarith + rcases ih ((b - 1) * 2) hb_next with ⟨b', v, hS, hb'⟩ + exact ⟨b', V :: v, Scan.T hb2 hS, hb'⟩ + | @VK a a' g u _ ih => + intro b hb + have hz := wordVal_nonneg u + dsimp [wordVal] at hb + have hb_rat : (4 : Rat) < (b : Rat) := by linarith + have hb_lt : 4 < b := by exact_mod_cast hb_rat + rcases even_or_odd_mul_two b with ⟨k, rfl⟩ | ⟨k, rfl⟩ + · have hk : 1 <= k := by omega + have hb_next : 2 + 4 * wordVal u < ((1 + (k - 1) * 2 : Nat) : Rat) := by + have hcast : ((1 + (k - 1) * 2 : Nat) : Rat) = ((k * 2 : Nat) : Rat) - 1 := by + rw [Nat.cast_add, Nat.cast_mul, Nat.cast_sub hk]; push_cast; ring + linarith + rcases ih (1 + (k - 1) * 2) hb_next with ⟨b', v, hS, hb'⟩ + exact ⟨b', K :: V :: v, Scan.VK0 hk hS, hb'⟩ + · have hk : 1 <= k := by omega + have hb_next : 2 + 4 * wordVal u < ((1 + (k - 1) * 2 : Nat) : Rat) := by + have hcast : ((1 + (k - 1) * 2 : Nat) : Rat) = ((1 + k * 2 : Nat) : Rat) - 2 := by + rw [Nat.cast_add, Nat.cast_mul, Nat.cast_sub hk]; push_cast; ring + linarith + rcases ih (1 + (k - 1) * 2) hb_next with ⟨b', v, hS, hb'⟩ + exact ⟨b', Q :: V :: v, Scan.VK1 hk hS, hb'⟩ + | @D a q1 a' g w0 u hw0 hq1 _ ih => + intro b hb + have hz := wordVal_nonneg u + rw [wordVal_cons_digit hw0] at hb + have hb_rat : (6 : Rat) < (b : Rat) := by linarith + have hb_lt : 6 < b := by exact_mod_cast hb_rat + have hb2 : 2 <= b := by omega + have hb_div : 2 + 4 * wordVal u < ((b / 2 : Nat) : Rat) := by + have hmod : b <= (b / 2) * 2 + 1 := by omega + have hmod_r : (b : Rat) <= ((b / 2 : Nat) : Rat) * 2 + 1 := by exact_mod_cast hmod + linarith + rcases ih (b / 2) hb_div with ⟨b', v, hS, hb'⟩ + exact ⟨b', (if b % 2 == 1 then Q else K) :: v, Scan.D hw0 hq1 hb2 hS, hb'⟩ + | @P a q2 a' g w0 w1 u hw0 hw1 hq2 _ ih => + intro b hb + have hz := wordVal_nonneg u + rw [wordVal_cons_digit hw0, wordVal_cons_digit hw1] at hb + have hb_rat : (14 : Rat) < (b : Rat) := by linarith + have hb_lt : 14 < b := by exact_mod_cast hb_rat + have hb2 : 2 <= b := by omega + rcases even_or_odd_mul_two (a + dVal w0) with ⟨q1, hq1⟩ | ⟨q1, hq1⟩ + · have hq2' : q1 + dVal w1 = 1 + q2 * 2 := by omega + have hb_next : 2 + 4 * wordVal u < (((b - 1) * 2 : Nat) : Rat) := by + have hcast : (((b - 1) * 2 : Nat) : Rat) = 2 * (b : Rat) - 2 := by + rw [Nat.cast_mul, Nat.cast_sub (by omega : 1 <= b)]; push_cast; ring + linarith + rcases ih ((b - 1) * 2) hb_next with ⟨b', v, hS, hb'⟩ + exact ⟨b', V :: v, Scan.P0 hw0 hw1 hq1 hq2' hb2 hS, hb'⟩ + · have hq2' : q1 + dVal w1 = 1 + q2 * 2 := by omega + have hb_next : 2 + 4 * wordVal u < ((1 + (b - 1) * 2 : Nat) : Rat) := by + have hcast : ((1 + (b - 1) * 2 : Nat) : Rat) = 2 * (b : Rat) - 1 := by + rw [Nat.cast_add, Nat.cast_mul, Nat.cast_sub (by omega : 1 <= b)]; push_cast; ring + linarith + rcases ih (1 + (b - 1) * 2) hb_next with ⟨b', v, hS, hb'⟩ + exact ⟨b', V :: v, Scan.P1 hw0 hw1 hq1 hq2' hb2 hS, hb'⟩ + +theorem Scan_append {a b a1 b1 g1 : Nat} {u1 v1 : List Word} + (h1 : Scan a b u1 a1 b1 v1 g1) : + ∀ {a2 b2 g2 : Nat} {u2 v2 : List Word}, + Scan a1 b1 u2 a2 b2 v2 g2 -> + Scan a b (u1 ++ u2) a2 b2 (v1 ++ v2) (g1 + g2) := by + induction h1 with + | nil _ _ _ => intro _ _ _ _ _ h2; simpa using h2 + | T hb _ ih => intro _ _ _ _ _ h2; exact Scan.T hb (ih h2) + | VK0 hk _ ih => intro _ _ _ _ _ h2; exact Scan.VK0 hk (ih h2) + | VK1 hk _ ih => intro _ _ _ _ _ h2; exact Scan.VK1 hk (ih h2) + | D hw0 hq1 hb _ ih => intro _ _ _ _ _ h2; exact Scan.D hw0 hq1 hb (ih h2) + | @P0 _ _ _ _ _ _ g1 _ _ _ _ hw0 hw1 hq1 hq2 hb _ ih => + intro _ _ g2 _ _ h2 + have heq : 1 + g1 + g2 = 1 + (g1 + g2) := by omega + rw [heq]; exact Scan.P0 hw0 hw1 hq1 hq2 hb (ih h2) + | @P1 _ _ _ _ _ _ g1 _ _ _ _ hw0 hw1 hq1 hq2 hb _ ih => + intro _ _ g2 _ _ h2 + have heq : 1 + g1 + g2 = 1 + (g1 + g2) := by omega + rw [heq]; exact Scan.P1 hw0 hw1 hq1 hq2 hb (ih h2) + +-- Trace evaluators +def evalAffineScan : List Nat -> Nat -> Nat -> Nat -> Nat -> List Word -> + Option (Nat × Nat × Nat × Nat × List Word × Nat) + | [], ma, ca, mb, cb, [] => + if 1 <= cb then some (ma, ca, mb, cb, [], 0) else none + | 0 :: ts, ma, ca, mb, cb, V :: u => + if 2 <= cb then + match evalAffineScan ts (ma * 2) (1 + ca * 2) (mb * 2) ((cb - 1) * 2) u with + | some (ma', ca', mb', cb', v, g) => some (ma', ca', mb', cb', V :: v, g) + | none => none + else none + | 1 :: ts, ma, ca, mb, cb, V :: K :: u => + if 2 <= cb && mb % 2 == 0 && cb % 2 == 0 then + match evalAffineScan ts ma ca mb (cb - 1) u with + | some (ma', ca', mb', cb', v, g) => some (ma', ca', mb', cb', K :: V :: v, g) + | none => none + else none + | 2 :: ts, ma, ca, mb, cb, V :: K :: u => + if 3 <= cb && mb % 2 == 0 && cb % 2 == 1 then + match evalAffineScan ts ma ca mb (cb - 2) u with + | some (ma', ca', mb', cb', v, g) => some (ma', ca', mb', cb', Q :: V :: v, g) + | none => none + else none + | 3 :: ts, ma, ca, mb, cb, w0 :: u => + if w0 != V && ma % 2 == 0 && (ca + dVal w0) % 2 == 0 && 2 <= cb && mb % 2 == 0 then + match evalAffineScan ts (ma / 2) ((ca + dVal w0) / 2) (mb / 2) (cb / 2) u with + | some (ma', ca', mb', cb', v, g) => + some (ma', ca', mb', cb', (if cb % 2 == 1 then Q else K) :: v, g) + | none => none + else none + | 4 :: ts, ma, ca, mb, cb, w0 :: w1 :: u => + if w0 != V && w1 != V && ma % 4 == 0 && (ca + dVal w0) % 2 == 0 && + ((ca + dVal w0) / 2 + dVal w1) % 2 == 1 && 2 <= cb then + match evalAffineScan ts (ma / 4) (((ca + dVal w0) / 2 + + dVal w1) / 2) (mb * 2) ((cb - 1) * 2) u with + | some (ma', ca', mb', cb', v, g) => some (ma', ca', mb', cb', V :: v, 1 + g) + | none => none + else none + | 5 :: ts, ma, ca, mb, cb, w0 :: w1 :: u => + if w0 != V && w1 != V && ma % 4 == 0 && (ca + dVal w0) % 2 == 1 && + ((ca + dVal w0) / 2 + dVal w1) % 2 == 1 && 2 <= cb then + match evalAffineScan ts (ma / 4) (((ca + dVal w0) / 2 + dVal w1) / 2) (mb * 2) (1 + + (cb - 1) * 2) u with + | some (ma', ca', mb', cb', v, g) => some (ma', ca', mb', cb', V :: v, 1 + g) + | none => none + else none + | _, _, _, _, _, _ => none + +theorem evalAffineScan_sound : + ∀ ts ma ca mb cb u ma' ca' mb' cb' v g xa xb, + evalAffineScan ts ma ca mb cb u = some (ma', ca', mb', cb', v, g) -> + Scan (ma * xa + ca) (mb * xb + cb) u (ma' * xa + ca') (mb' * xb + cb') v g := by + intro ts + induction ts with + | nil => + intro ma ca mb cb u ma' ca' mb' cb' v g xa xb h + cases u with + | nil => + simp only [evalAffineScan] at h + split_ifs at h with hcb + simp only [Option.some.injEq, Prod.mk.injEq] at h; + rcases h with ⟨rfl, rfl, rfl, rfl, rfl, rfl⟩ + exact Scan.nil _ _ (by omega) + | cons _ _ => unfold evalAffineScan at h; contradiction + | cons t ts ih => + intro ma ca mb cb u ma' ca' mb' cb' v g xa xb h + rcases t with _ | _ | _ | _ | _ | _ | t + · -- t = 0 (T) + cases u with + | nil => unfold evalAffineScan at h; contradiction + | cons w0 u => + cases w0 with + | K => unfold evalAffineScan at h; contradiction + | Q => unfold evalAffineScan at h; contradiction + | V => + change evalAffineScan (0 :: ts) ma ca mb cb (V :: u) = _ at h + simp only [evalAffineScan] at h + split_ifs at h with hcb + cases hrec : evalAffineScan ts (ma * 2) (1 + ca * 2) (mb * 2) ((cb - 1) * 2) u with + | none => rw [hrec] at h; contradiction + | some val => + rw [hrec] at h + rcases val with ⟨ma1, ca1, mb1, cb1, v1, g1⟩ + simp only [Option.some.injEq, Prod.mk.injEq] at h; + rcases h with ⟨rfl, rfl, rfl, rfl, rfl, rfl⟩ + have hI := ih _ _ _ _ _ _ _ _ _ _ _ xa xb hrec + have ha : 1 + (ma * xa + ca) * 2 = ma * 2 * xa + (1 + ca * 2) := by ring + have hb : (mb * xb + cb - 1) * 2 = mb * 2 * xb + (cb - 1) * 2 := by + have hsub : mb * xb + cb - 1 = mb * xb + (cb - 1) := by omega + rw [hsub]; ring + rw [<- ha, <- hb] at hI + exact Scan.T (by omega) hI + · -- t = 1 (VK0) + rcases u with _ | ⟨w0, _ | ⟨w1, u⟩⟩ + · unfold evalAffineScan at h; contradiction + · cases w0 <;> (unfold evalAffineScan at h; contradiction) + · cases w0 <;> try (unfold evalAffineScan at h; contradiction) + cases w1 <;> try (unfold evalAffineScan at h; contradiction) + change evalAffineScan (1 :: ts) ma ca mb cb (V :: K :: u) = _ at h + simp only [evalAffineScan] at h + split_ifs at h with hcond + simp only [Bool.and_eq_true, decide_eq_true_eq, beq_iff_eq] at hcond + rcases hcond with ⟨⟨hcb, hmb⟩, hcb2⟩ + cases hrec : evalAffineScan ts ma ca mb (cb - 1) u with + | none => rw [hrec] at h; contradiction + | some val => + rw [hrec] at h + rcases val with ⟨ma1, ca1, mb1, cb1, v1, g1⟩ + simp only [Option.some.injEq, Prod.mk.injEq] at h; + rcases h with ⟨rfl, rfl, rfl, rfl, rfl, rfl⟩ + have hI := ih _ _ _ _ _ _ _ _ _ _ _ xa xb hrec + let k := (mb / 2) * xb + cb / 2 + have hmb_eq : mb = (mb / 2) * 2 := by omega + have hcb_eq : cb = (cb / 2) * 2 := by omega + have hcb1_eq : cb - 1 = 1 + (cb / 2 - 1) * 2 := by omega + have hcb_div_pos : 1 <= cb / 2 := by omega + have hk : 1 <= k := by dsimp [k]; omega + have hb_in : mb * xb + cb = k * 2 := by + dsimp [k] + calc mb * xb + cb = ((mb / 2) * 2) * xb + (cb / 2) * 2 := by rw [<- hmb_eq, <- hcb_eq] + _ = ((mb / 2) * xb + cb / 2) * 2 := by ring + have hb_out : mb * xb + (cb - 1) = 1 + (k - 1) * 2 := by + have hk_sub : k - 1 = (mb / 2) * xb + (cb / 2 - 1) := by dsimp [k]; omega + calc + mb * xb + (cb - 1) = ((mb / 2) * 2) * xb + (1 + (cb / 2 - 1) * 2) := by + rw [<- hmb_eq, hcb1_eq] + _ = 1 + ((mb / 2) * xb + (cb / 2 - 1)) * 2 := by ring + _ = 1 + (k - 1) * 2 := by rw [<- hk_sub] + rw [hb_out] at hI + rw [hb_in] + exact Scan.VK0 hk hI + · -- t = 2 (VK1) + rcases u with _ | ⟨w0, _ | ⟨w1, u⟩⟩ + · unfold evalAffineScan at h; contradiction + · cases w0 <;> (unfold evalAffineScan at h; contradiction) + · cases w0 <;> try (unfold evalAffineScan at h; contradiction) + cases w1 <;> try (unfold evalAffineScan at h; contradiction) + change evalAffineScan (2 :: ts) ma ca mb cb (V :: K :: u) = _ at h + simp only [evalAffineScan] at h + split_ifs at h with hcond + simp only [Bool.and_eq_true, decide_eq_true_eq, beq_iff_eq] at hcond + rcases hcond with ⟨⟨hcb, hmb⟩, hcb2⟩ + cases hrec : evalAffineScan ts ma ca mb (cb - 2) u with + | none => rw [hrec] at h; contradiction + | some val => + rw [hrec] at h + rcases val with ⟨ma1, ca1, mb1, cb1, v1, g1⟩ + simp only [Option.some.injEq, Prod.mk.injEq] at h; + rcases h with ⟨rfl, rfl, rfl, rfl, rfl, rfl⟩ + have hI := ih _ _ _ _ _ _ _ _ _ _ _ xa xb hrec + let k := (mb / 2) * xb + cb / 2 + have hmb_eq : mb = (mb / 2) * 2 := by omega + have hcb_eq : cb = 1 + (cb / 2) * 2 := by omega + have hcb2_eq : cb - 2 = 1 + (cb / 2 - 1) * 2 := by omega + have hcb_div_pos : 1 <= cb / 2 := by omega + have hk : 1 <= k := by dsimp [k]; omega + have hb_in : mb * xb + cb = 1 + k * 2 := by + dsimp [k] + calc + mb * xb + cb = ((mb / 2) * 2) * xb + (1 + (cb / 2) * 2) := by + rw [<- hmb_eq, <- hcb_eq] + _ = 1 + ((mb / 2) * xb + cb / 2) * 2 := by ring + have hb_out : mb * xb + (cb - 2) = 1 + (k - 1) * 2 := by + have hk_sub : k - 1 = (mb / 2) * xb + (cb / 2 - 1) := by dsimp [k]; omega + calc + mb * xb + (cb - 2) = ((mb / 2) * 2) * xb + (1 + (cb / 2 - 1) * 2) := by + rw [<- hmb_eq, hcb2_eq] + _ = 1 + ((mb / 2) * xb + (cb / 2 - 1)) * 2 := by ring + _ = 1 + (k - 1) * 2 := by rw [<- hk_sub] + rw [hb_out] at hI + rw [hb_in] + exact Scan.VK1 hk hI + · -- t = 3 (D) + cases u with + | nil => unfold evalAffineScan at h; contradiction + | cons w0 u => + change evalAffineScan (3 :: ts) ma ca mb cb (w0 :: u) = _ at h + simp only [evalAffineScan] at h + cases hcond : (w0 != V && ma % 2 == 0 && (ca + dVal w0) % 2 == 0 && 2 <= cb && mb % 2 == 0) + · rw [hcond] at h; simp at h + · simp only [hcond, ↓reduceIte] at h + simp only [Bool.and_eq_true, bne_iff_ne, decide_eq_true_eq, beq_iff_eq] at hcond + rcases hcond with ⟨⟨⟨⟨hw0, hma⟩, hca⟩, hcb⟩, hmb⟩ + cases hrec : evalAffineScan ts (ma / 2) ((ca + dVal w0) / 2) (mb / 2) (cb / 2) u with + | none => rw [hrec] at h; contradiction + | some val => + rw [hrec] at h + rcases val with ⟨ma1, ca1, mb1, cb1, v1, g1⟩ + simp only [Option.some.injEq, Prod.mk.injEq] at h + rcases h with ⟨rfl, rfl, rfl, rfl, rfl, rfl⟩ + have hI := ih _ _ _ _ _ _ _ _ _ _ _ xa xb hrec + have hma_eq : ma = (ma / 2) * 2 := by omega + have hca_eq : ca + dVal w0 = ((ca + dVal w0) / 2) * 2 := by omega + have hmb_eq : mb = (mb / 2) * 2 := by omega + let q1 := (ma / 2) * xa + (ca + dVal w0) / 2 + have hq1 : (ma * xa + ca) + dVal w0 = q1 * 2 := by + dsimp [q1] + calc (ma * xa + ca) + dVal w0 = ma * xa + (ca + dVal w0) := by ring + _ = ((ma / 2) * 2) * xa + ((ca + dVal w0) / 2) * 2 := by rw [<- hma_eq, <- hca_eq] + _ = ((ma / 2) * xa + (ca + dVal w0) / 2) * 2 := by ring + have hb_div : (mb * xb + cb) / 2 = (mb / 2) * xb + cb / 2 := by + have hmb_xb : mb * xb + cb = 2 * ((mb / 2) * xb) + cb := by + calc mb * xb + cb = ((mb / 2) * 2) * xb + cb := by rw [<- hmb_eq] + _ = 2 * ((mb / 2) * xb) + cb := by ring + rw [hmb_xb, Nat.mul_add_div (by decide : 0 < 2)] + have hb_mod : (mb * xb + cb) % 2 = cb % 2 := by + have hmb_xb : mb * xb + cb = cb + 2 * ((mb / 2) * xb) := by + calc mb * xb + cb = ((mb / 2) * 2) * xb + cb := by rw [<- hmb_eq] + _ = cb + 2 * ((mb / 2) * xb) := by ring + rw [hmb_xb, Nat.add_mul_mod_self_left] + rw [<- hb_div] at hI + have hD := Scan.D hw0 hq1 (by omega : 2 <= mb * xb + cb) hI + rwa [hb_mod] at hD + · -- t = 4 (P0) + rcases u with _ | ⟨w0, _ | ⟨w1, u⟩⟩ + · unfold evalAffineScan at h; contradiction + · unfold evalAffineScan at h; contradiction + · change evalAffineScan (4 :: ts) ma ca mb cb (w0 :: w1 :: u) = _ at h + simp only [evalAffineScan] at h + split_ifs at h with hcond + simp only [Bool.and_eq_true, bne_iff_ne, decide_eq_true_eq, beq_iff_eq] at hcond + rcases hcond with ⟨⟨⟨⟨⟨hw0, hw1⟩, hma⟩, hca0⟩, hca1⟩, hcb⟩ + cases hrec : evalAffineScan ts (ma / 4) (((ca + dVal w0) / 2 + + dVal w1) / 2) (mb * 2) ((cb - 1) * 2) u with + | none => rw [hrec] at h; contradiction + | some val => + rw [hrec] at h + rcases val with ⟨ma1, ca1, mb1, cb1, v1, g1⟩ + simp only [Option.some.injEq, Prod.mk.injEq] at h; + rcases h with ⟨rfl, rfl, rfl, rfl, rfl, rfl⟩ + have hI := ih _ _ _ _ _ _ _ _ _ _ _ xa xb hrec + have hma2_eq : ma = (ma / 2) * 2 := by omega + have hma4_eq : ma / 2 = (ma / 4) * 2 := by omega + have hca0_eq : ca + dVal w0 = ((ca + dVal w0) / 2) * 2 := by omega + have hca1_eq : (ca + dVal w0) / 2 + dVal w1 = + 1 + (((ca + dVal w0) / 2 + dVal w1) / 2) * 2 := by omega + let q1 := (ma / 2) * xa + (ca + dVal w0) / 2 + let q2 := (ma / 4) * xa + ((ca + dVal w0) / 2 + dVal w1) / 2 + have hq1 : (ma * xa + ca) + dVal w0 = q1 * 2 := by + dsimp [q1] + calc (ma * xa + ca) + dVal w0 = ma * xa + (ca + dVal w0) := by ring + _ = ((ma / 2) * 2) * xa + ((ca + dVal w0) / 2) * 2 := by rw [<- hma2_eq, <- hca0_eq] + _ = ((ma / 2) * xa + (ca + dVal w0) / 2) * 2 := by ring + have hq2 : q1 + dVal w1 = 1 + q2 * 2 := by + dsimp [q1, q2] + calc (ma / 2) * xa + (ca + dVal w0) / 2 + dVal w1 = + (ma / 2) * xa + ((ca + dVal w0) / 2 + dVal w1) := by ring + _ = ((ma / 4) * 2) * xa + (1 + (((ca + dVal w0) / 2 + dVal w1) / 2) * 2) := by + rw [<- hma4_eq, <- hca1_eq] + _ = 1 + ((ma / 4) * xa + ((ca + dVal w0) / 2 + dVal w1) / 2) * 2 := by ring + have hb : (mb * xb + cb - 1) * 2 = mb * 2 * xb + (cb - 1) * 2 := by + have hsub : mb * xb + cb - 1 = mb * xb + (cb - 1) := by omega + rw [hsub]; ring + rw [<- hb] at hI + exact Scan.P0 hw0 hw1 hq1 hq2 (by omega) hI + · -- t = 5 (P1) + rcases u with _ | ⟨w0, _ | ⟨w1, u⟩⟩ + · unfold evalAffineScan at h; contradiction + · unfold evalAffineScan at h; contradiction + · change evalAffineScan (5 :: ts) ma ca mb cb (w0 :: w1 :: u) = _ at h + simp only [evalAffineScan] at h + split_ifs at h with hcond + simp only [Bool.and_eq_true, bne_iff_ne, decide_eq_true_eq, beq_iff_eq] at hcond + rcases hcond with ⟨⟨⟨⟨⟨hw0, hw1⟩, hma⟩, hca0⟩, hca1⟩, hcb⟩ + cases hrec : evalAffineScan ts (ma / 4) (((ca + dVal w0) / 2 + + dVal w1) / 2) (mb * 2) (1 + (cb - 1) * 2) u with + | none => rw [hrec] at h; contradiction + | some val => + rw [hrec] at h + rcases val with ⟨ma1, ca1, mb1, cb1, v1, g1⟩ + simp only [Option.some.injEq, Prod.mk.injEq] at h; + rcases h with ⟨rfl, rfl, rfl, rfl, rfl, rfl⟩ + have hI := ih _ _ _ _ _ _ _ _ _ _ _ xa xb hrec + have hma2_eq : ma = (ma / 2) * 2 := by omega + have hma4_eq : ma / 2 = (ma / 4) * 2 := by omega + have hca0_eq : ca + dVal w0 = 1 + ((ca + dVal w0) / 2) * 2 := by omega + have hca1_eq : (ca + dVal w0) / 2 + dVal w1 = + 1 + (((ca + dVal w0) / 2 + dVal w1) / 2) * 2 := by omega + let q1 := (ma / 2) * xa + (ca + dVal w0) / 2 + let q2 := (ma / 4) * xa + ((ca + dVal w0) / 2 + dVal w1) / 2 + have hq1 : (ma * xa + ca) + dVal w0 = 1 + q1 * 2 := by + dsimp [q1] + calc (ma * xa + ca) + dVal w0 = ma * xa + (ca + dVal w0) := by ring + _ = ((ma / 2) * 2) * xa + (1 + ((ca + dVal w0) / 2) * 2) := by + rw [<- hma2_eq, <- hca0_eq] + _ = 1 + ((ma / 2) * xa + (ca + dVal w0) / 2) * 2 := by ring + have hq2 : q1 + dVal w1 = 1 + q2 * 2 := by + dsimp [q1, q2] + calc (ma / 2) * xa + (ca + dVal w0) / 2 + dVal w1 = + (ma / 2) * xa + ((ca + dVal w0) / 2 + dVal w1) := by ring + _ = ((ma / 4) * 2) * xa + (1 + (((ca + dVal w0) / 2 + dVal w1) / 2) * 2) := by + rw [<- hma4_eq, <- hca1_eq] + _ = 1 + ((ma / 4) * xa + ((ca + dVal w0) / 2 + dVal w1) / 2) * 2 := by ring + have hb : 1 + (mb * xb + cb - 1) * 2 = mb * 2 * xb + (1 + (cb - 1) * 2) := by + have hsub : mb * xb + cb - 1 = mb * xb + (cb - 1) := by omega + rw [hsub]; ring + rw [<- hb] at hI + exact Scan.P1 hw0 hw1 hq1 hq2 (by omega) hI + · unfold evalAffineScan at h; contradiction + +def checkAffineScan (ts : List Nat) (ma ca mb cb : Nat) (u : List Word) + (ma' ca' mb' cb' : Nat) (v : List Word) (g : Nat) : Bool := + match evalAffineScan ts ma ca mb cb u with + | some (ma1, ca1, mb1, cb1, v1, g1) => + ma1 == ma' && ca1 == ca' && mb1 == mb' && cb1 == cb' && v1 == v && g1 == g + | none => false + +theorem checkAffineScan_sound (ts : List Nat) (ma ca mb cb : Nat) (u : List Word) + (ma' ca' mb' cb' : Nat) (v : List Word) (g xa xb : Nat) + (h : checkAffineScan ts ma ca mb cb u ma' ca' mb' cb' v g = true) : + Scan (ma * xa + ca) (mb * xb + cb) u (ma' * xa + ca') (mb' * xb + cb') v g := by + unfold checkAffineScan at h + cases hrec : evalAffineScan ts ma ca mb cb u with + | none => rw [hrec] at h; contradiction + | some val => + rcases val with ⟨ma1, ca1, mb1, cb1, v1, g1⟩ + rw [hrec] at h + simp only [Bool.and_eq_true, beq_iff_eq] at h + rcases h with ⟨⟨⟨⟨⟨rfl, rfl⟩, rfl⟩, rfl⟩, rfl⟩, rfl⟩ + exact evalAffineScan_sound ts ma ca mb cb u ma1 ca1 mb1 cb1 v1 g1 xa xb hrec + + +def checkStepB (b0 n : Nat) (ts : List Nat) (u da u' : List Word) : Bool := + match evalAffineScan ts 0 0 0 b0 (u ++ List.replicate n K) with + | some (0, 0, 0, b', v, _) => checkDg b' da && (u' == V :: (v ++ da)) + | _ => false + +theorem checkStepB_sound (b0 n : Nat) (ts : List Nat) (u da u' : List Word) + (h : checkStepB b0 n ts u da u' = true) : StepB b0 u u' := by + unfold checkStepB at h + cases hrec : evalAffineScan ts 0 0 0 b0 (u ++ List.replicate n K) with + | none => rw [hrec] at h; contradiction + | some val => + rw [hrec] at h + rcases val with ⟨ma', ca', mb', b', v, g⟩ + rcases ma' with _ | ma' + · rcases ca' with _ | ca' + · rcases mb' with _ | mb' + · simp only [Bool.and_eq_true, beq_iff_eq] at h + have hScan := + evalAffineScan_sound ts 0 0 0 b0 (u ++ List.replicate n K) 0 0 0 b' v g 0 0 hrec + simp only [Nat.zero_mul, Nat.zero_add] at hScan + exact ⟨n, b', v, da, da.length, g, hScan, checkDg_sound b' da h.1, h.2⟩ + · contradiction + · contradiction + · contradiction + +abbrev checkStep := checkStepB 6 +theorem checkStep_sound (n : Nat) (ts : List Nat) (u da u' : List Word) + (h : checkStep n ts u da u' = true) : Step u u' := + checkStepB_sound 6 n ts u da u' h + +def evalTopTrace : List Nat -> Nat -> List Word -> Option (Nat × List Word × Nat) + | [], a, [] => some (a, [], 0) + | 3 :: ts, a, w0 :: u => + if w0 != V && (a + dVal w0) % 2 == 0 then + match evalTopTrace ts ((a + dVal w0) / 2) u with + | some (a', vw, g) => some (a', K :: vw, g) + | none => none + else none + | 4 :: ts, a, w0 :: w1 :: u => + if w0 != V && w1 != V && (a + dVal w0) % 2 == 0 && ((a + dVal w0) / 2 + dVal w1) % 2 == 1 then + match evalTopTrace ts (((a + dVal w0) / 2 + dVal w1) / 2) u with + | some (a', vw, g) => some (a', V :: vw, 1 + g) + | none => none + else none + | 5 :: ts, a, w0 :: w1 :: u => + if w0 != V && w1 != V && (a + dVal w0) % 2 == 1 && ((a + dVal w0) / 2 + dVal w1) % 2 == 1 then + match evalTopTrace ts (((a + dVal w0) / 2 + dVal w1) / 2) u with + | some (a', vw, g) => some (a', V :: vw, 1 + g) + | none => none + else none + | _, _, _ => none + +theorem evalTopTrace_sound : + ∀ ts (a : Nat) (u : List Word) (a' : Nat) (vw : List Word) (g : Nat) (b : Nat), + evalTopTrace ts a u = some (a', vw, g) -> + 2 + 4 * wordVal u < (b : Rat) -> + ∃ b' v, Scan a b u a' b' v g ∧ wordPot v <= wordPot vw ∧ wordPotV v <= wordPotV vw ∧ + 3 <= b' := by + intro ts + induction ts with + | nil => + intro a u a' vw g b h hb + cases u with + | nil => + dsimp [evalTopTrace] at h; simp only [Option.some.injEq, Prod.mk.injEq] at h; + rcases h with ⟨rfl, rfl, rfl⟩ + dsimp [wordVal] at hb + have hb_rat : (2 : Rat) < (b : Rat) := by linarith + have hb_lt : 2 < b := by exact_mod_cast hb_rat + exact ⟨b, [], Scan.nil a b (by omega), le_rfl, le_rfl, by omega⟩ + | cons _ _ => unfold evalTopTrace at h; contradiction + | cons t ts ih => + intro a u a' vw g b h hb + rcases t with _ | _ | _ | _ | _ | _ | t + · unfold evalTopTrace at h; contradiction + · unfold evalTopTrace at h; contradiction + · unfold evalTopTrace at h; contradiction + · -- t = 3 (D) + cases u with + | nil => unfold evalTopTrace at h; contradiction + | cons w0 u => + change evalTopTrace (3 :: ts) a (w0 :: u) = _ at h + simp only [evalTopTrace] at h + split_ifs at h with hcond + simp only [Bool.and_eq_true, bne_iff_ne, beq_iff_eq] at hcond + rcases hcond with ⟨hw0, ha0⟩ + cases hrec : evalTopTrace ts ((a + dVal w0) / 2) u with + | none => rw [hrec] at h; contradiction + | some val => + rw [hrec] at h + rcases val with ⟨a1, vw1, g1⟩ + simp only [Option.some.injEq, Prod.mk.injEq] at h; rcases h with ⟨rfl, rfl, rfl⟩ + have hz := wordVal_nonneg u + rw [wordVal_cons_digit hw0] at hb + have hb_rat : (6 : Rat) < (b : Rat) := by linarith + have hb_lt : 6 < b := by exact_mod_cast hb_rat + have hb_div : 2 + 4 * wordVal u < ((b / 2 : Nat) : Rat) := by + have hmod : b <= (b / 2) * 2 + 1 := by omega + have hmod_r : (b : Rat) <= ((b / 2 : Nat) : Rat) * 2 + 1 := by exact_mod_cast hmod + linarith + rcases ih _ _ _ _ _ (b / 2) hrec hb_div with ⟨b', v1, hS, hW, hWV, hb'⟩ + refine ⟨b', (if b % 2 == 1 then Q else K) :: v1, + Scan.D hw0 (by omega) (by omega) hS, ?_, ?_, hb'⟩ + · split_ifs <;> (simp [wordPot_cons_K, wordPot_cons_Q]; linarith) + · split_ifs <;> (simp [wordPotV_cons_K, wordPotV_cons_Q]; linarith) + · -- t = 4 (P0) + rcases u with _ | ⟨w0, _ | ⟨w1, u⟩⟩ + · unfold evalTopTrace at h; contradiction + · unfold evalTopTrace at h; contradiction + · change evalTopTrace (4 :: ts) a (w0 :: w1 :: u) = _ at h + simp only [evalTopTrace] at h + split_ifs at h with hcond + simp only [Bool.and_eq_true, bne_iff_ne, beq_iff_eq] at hcond + rcases hcond with ⟨⟨⟨hw0, hw1⟩, ha0⟩, ha1⟩ + cases hrec : evalTopTrace ts (((a + dVal w0) / 2 + dVal w1) / 2) u with + | none => rw [hrec] at h; contradiction + | some val => + rw [hrec] at h + rcases val with ⟨a1, vw1, g1⟩ + simp only [Option.some.injEq, Prod.mk.injEq] at h; rcases h with ⟨rfl, rfl, rfl⟩ + have hz := wordVal_nonneg u + rw [wordVal_cons_digit hw0, wordVal_cons_digit hw1] at hb + have hb_rat : (14 : Rat) < (b : Rat) := by linarith + have hb_lt : 14 < b := by exact_mod_cast hb_rat + have hb_next : 2 + 4 * wordVal u < (((b - 1) * 2 : Nat) : Rat) := by + have hcast : (((b - 1) * 2 : Nat) : Rat) = 2 * (b : Rat) - 2 := by + rw [Nat.cast_mul, Nat.cast_sub (by omega : 1 <= b)]; push_cast; ring + linarith + rcases ih _ _ _ _ _ ((b - 1) * 2) hrec hb_next with ⟨b', v1, hS, hW, hWV, hb'⟩ + exact ⟨b', V :: v1, + Scan.P0 hw0 hw1 (q1 := (a + dVal w0) / 2) (by omega) (by omega) (by omega) hS, + by simpa using hWV, by simp [wordPotV_cons_V]; linarith, hb'⟩ + · -- t = 5 (P1) + rcases u with _ | ⟨w0, _ | ⟨w1, u⟩⟩ + · unfold evalTopTrace at h; contradiction + · unfold evalTopTrace at h; contradiction + · change evalTopTrace (5 :: ts) a (w0 :: w1 :: u) = _ at h + simp only [evalTopTrace] at h + split_ifs at h with hcond + simp only [Bool.and_eq_true, bne_iff_ne, beq_iff_eq] at hcond + rcases hcond with ⟨⟨⟨hw0, hw1⟩, ha0⟩, ha1⟩ + cases hrec : evalTopTrace ts (((a + dVal w0) / 2 + dVal w1) / 2) u with + | none => rw [hrec] at h; contradiction + | some val => + rw [hrec] at h + rcases val with ⟨a1, vw1, g1⟩ + simp only [Option.some.injEq, Prod.mk.injEq] at h; rcases h with ⟨rfl, rfl, rfl⟩ + have hz := wordVal_nonneg u + rw [wordVal_cons_digit hw0, wordVal_cons_digit hw1] at hb + have hb_rat : (14 : Rat) < (b : Rat) := by linarith + have hb_lt : 14 < b := by exact_mod_cast hb_rat + have hb_next : 2 + 4 * wordVal u < ((1 + (b - 1) * 2 : Nat) : Rat) := by + have hcast : ((1 + (b - 1) * 2 : Nat) : Rat) = 2 * (b : Rat) - 1 := by + rw [Nat.cast_add, Nat.cast_mul, Nat.cast_sub (by omega : 1 <= b)]; push_cast; ring + linarith + rcases ih _ _ _ _ _ (1 + (b - 1) * 2) hrec hb_next with ⟨b', v1, hS, hW, hWV, hb'⟩ + exact ⟨b', V :: v1, + Scan.P1 hw0 hw1 (q1 := (a + dVal w0) / 2) (by omega) (by omega) (by omega) hS, + by simpa using hWV, by simp [wordPotV_cons_V]; linarith, hb'⟩ + · unfold evalTopTrace at h; contradiction + +def checkTopTrace (ts : List Nat) (a : Nat) (u : List Word) + (a' : Nat) (vw : List Word) (g : Nat) : Bool := + match evalTopTrace ts a u with + | some (a1, vw1, g1) => a1 == a' && vw1 == vw && g1 == g + | none => false + +theorem checkTopTrace_sound (ts : List Nat) (a : Nat) (u : List Word) + (a' : Nat) (vw : List Word) (g b : Nat) + (h : checkTopTrace ts a u a' vw g = true) + (hb : 2 + 4 * wordVal u < (b : Rat)) : + ∃ b' v, Scan a b u a' b' v g ∧ wordPot v <= wordPot vw ∧ wordPotV v <= wordPotV vw ∧ + 3 <= b' := by + unfold checkTopTrace at h + cases hrec : evalTopTrace ts a u with + | none => rw [hrec] at h; contradiction + | some val => + rcases val with ⟨a1, vw1, g1⟩ + rw [hrec] at h + simp only [Bool.and_eq_true, beq_iff_eq] at h + rcases h with ⟨⟨rfl, rfl⟩, rfl⟩ + exact evalTopTrace_sound ts a u a1 vw1 g1 b hrec hb + + +end BusyBeaver.WordVKQ diff --git a/BusyBeaver/Calculi/WordCalculusG.lean b/BusyBeaver/Calculi/WordCalculusG.lean new file mode 100644 index 00000000..5d60c27f --- /dev/null +++ b/BusyBeaver/Calculi/WordCalculusG.lean @@ -0,0 +1,2436 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Calculi.WordCalculusF +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +/-! +# Word Calculus Engine G (`BusyBeaver.Calculi.WordCalculusG`) + +Formal word-rewriting calculus for structured tape transformations, +providing verified macro-step reductions and tile segment chains for family G. +-/ + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver + +namespace BusyBeaver.WordVKQ +set_option quotPrecheck false +set_option maxRecDepth 4000000 + +open Word + +theorem wordPot_nonneg_and_le_two (u : List Word) : + 0 <= wordPot u ∧ 0 <= wordPotV u ∧ wordPot u <= 2 * wordPotV u := by + induction u with + | nil => simp + | cons a u ih => + rcases ih with ⟨h1, h2, h3⟩ + cases a <;> (simp only [wordPot_cons_V, wordPotV_cons_V, wordPot_cons_K, wordPotV_cons_K, + wordPot_cons_Q, wordPotV_cons_Q]; constructor; linarith; constructor <;> linarith) + +theorem wordPot_nonneg (u : List Word) : 0 <= wordPot u := (wordPot_nonneg_and_le_two u).1 +theorem wordPotV_nonneg (u : List Word) : 0 <= wordPotV u := (wordPot_nonneg_and_le_two u).2.1 +theorem wordPot_le_two_wordPotV (u : List Word) : wordPot u <= 2 * wordPotV u := + (wordPot_nonneg_and_le_two u).2.2 + +theorem two_wordVal_add_wordValQ_le (u : List Word) : 2 * wordVal u + wordValQ u <= + 2 * wordPot u := by + induction u with + | nil => simp [wordVal, wordValQ] + | cons a u ih => + have hle := wordPot_le_two_wordPotV u + cases a <;> + (dsimp only [wordVal, wordValQ]; + simp only [wordPot_cons_V, wordPot_cons_K, wordPot_cons_Q]; linarith) + +theorem two_wordVal_add_wordValQ_le_four_wordPotV (u : List Word) : 2 * wordVal u + + wordValQ u <= 4 * wordPotV u := by + have h1 := two_wordVal_add_wordValQ_le u + have h2 := wordPot_le_two_wordPotV u + linarith + +theorem wordScale_pos (u : List Word) : 0 < wordScale u := by + induction u with + | nil => simp [wordScale] + | cons a u ih => cases a <;> (dsimp [wordScale]; linarith) + +theorem wordScale_append (u v : List Word) : wordScale (u ++ v) = wordScale u * wordScale v := by + induction u with + | nil => simp [wordScale] + | cons a u ih => cases a <;> (dsimp [wordScale]; rw [ih]; ring) + +theorem wordPot_append_bounds (u t : List Word) : + (wordPot (u ++ t) <= wordPot u + 2 * wordScale u * wordPotV t) ∧ + (wordPotV (u ++ t) <= wordPotV u + wordScale u * wordPotV t) := by + induction u with + | nil => + simp [wordScale, wordPot_le_two_wordPotV t] + | cons a u ih => + rcases ih with ⟨ihW, ihWV⟩ + cases a <;> ( + dsimp only [wordScale] + simp only [List.cons_append, wordPot_cons_V, wordPotV_cons_V, wordPot_cons_K, + wordPotV_cons_K, wordPot_cons_Q, wordPotV_cons_Q] + constructor <;> linarith + ) + +theorem wordPotV_append_le (u t : List Word) : wordPotV (u ++ + t) <= wordPotV u + wordScale u * wordPotV t := + (wordPot_append_bounds u t).2 + +def cPar (b : Nat) : Rat := + if b % 2 == 1 then 2 / 16 else 3 / 16 + +theorem cPar_bounds (b : Nat) : 2 / 16 <= cPar b ∧ cPar b <= 3 / 16 := by + unfold cPar + split_ifs <;> constructor <;> norm_num + +theorem scan_wordPot_contract {a b a' b' g : Nat} {u v : List Word} + (h : Scan a b u a' b' v g) : + wordPotV v <= (15 / 16) * wordPot u + cPar b := by + induction h with + | nil a b _ => + have hc := (cPar_bounds b).1 + simp; linarith + | @T a b a' b' g u v _ _ ih => + have hc_in := (cPar_bounds b).1 + have hc_next : cPar ((b - 1) * 2) = 3 / 16 := by + unfold cPar; have hmod : ((b - 1) * 2) % 2 = 0 := by omega + rw [hmod]; rfl + rw [hc_next] at ih + have hle := wordPot_le_two_wordPotV u + simp only [wordPotV_cons_V, wordPot_cons_V] + linarith + | @VK0 a k a' b' g u v _ _ ih => + have hc_in : cPar (k * 2) = 3 / 16 := by + unfold cPar; have hmod : (k * 2) % 2 = 0 := by omega + rw [hmod]; rfl + have hc_next : cPar (1 + (k - 1) * 2) = 2 / 16 := by + unfold cPar; have hmod : (1 + (k - 1) * 2) % 2 = 1 := by omega + rw [hmod]; rfl + rw [hc_next] at ih + rw [hc_in] + simp only [wordPotV_cons_K, wordPot_cons_V] + linarith + | @VK1 a k a' b' g u v _ _ ih => + have hc_in : cPar (1 + k * 2) = 2 / 16 := by + unfold cPar; have hmod : (1 + k * 2) % 2 = 1 := by omega + rw [hmod]; rfl + have hc_next : cPar (1 + (k - 1) * 2) = 2 / 16 := by + unfold cPar; have hmod : (1 + (k - 1) * 2) % 2 = 1 := by omega + rw [hmod]; rfl + rw [hc_next] at ih + rw [hc_in] + simp only [wordPotV_cons_Q, wordPot_cons_V, wordPotV_cons_K] + linarith + | @D a b q1 a' b' g w0 u v hw0 _ _ _ ih => + have hc_next := (cPar_bounds (b / 2)).2 + have hle := wordPot_le_two_wordPotV v + rw [wordPot_cons_digit hw0] + unfold cPar + split_ifs <;> (simp only [wordPotV_cons_Q, wordPotV_cons_K]; linarith) + | @P0 a b q1 q2 a' b' g w0 w1 u v hw0 hw1 _ _ _ _ ih => + have hc_in := (cPar_bounds b).1 + have hc_next := (cPar_bounds ((b - 1) * 2)).2 + have hzW := wordPot_nonneg u + rw [wordPot_cons_digit hw0, wordPot_cons_digit hw1] + simp only [wordPotV_cons_V] + linarith + | @P1 a b q1 q2 a' b' g w0 w1 u v hw0 hw1 _ _ _ _ ih => + have hc_in := (cPar_bounds b).1 + have hc_next := (cPar_bounds (1 + (b - 1) * 2)).2 + have hzW := wordPot_nonneg u + rw [wordPot_cons_digit hw0, wordPot_cons_digit hw1] + simp only [wordPotV_cons_V] + linarith + +theorem dCount_bound (v : List Word) : + (wordPot v <= (3 / 2) * (((2 ^ (dCount v) : Nat) : Rat) - 1)) ∧ + (wordPotV v <= ((2 ^ (dCount v) : Nat) : Rat) - 1) := by + induction v with + | nil => simp [dCount] + | cons a v ih => + rcases ih with ⟨ihW, ihWV⟩ + have hpow_pos : (1 : Rat) <= ((2 ^ (dCount v) : Nat) : Rat) := by + exact_mod_cast (pow_two_pos (dCount v)) + cases a with + | V => + dsimp only [dCount]; simp only [wordPot_cons_V, wordPotV_cons_V] + constructor <;> linarith + | K => + dsimp only [dCount]; rw [pow_two_one_add (dCount v), Nat.cast_add] + simp only [wordPot_cons_K, wordPotV_cons_K] + constructor <;> linarith + | Q => + dsimp only [dCount]; rw [pow_two_one_add (dCount v), Nat.cast_add] + simp only [wordPot_cons_Q, wordPotV_cons_Q] + constructor <;> linarith + +theorem digitVal_scan_dCount {a b a' b' g : Nat} {u v : List Word} + (hS : Scan a b u a' b' v g) : + ∀ {A m : Nat}, DigitVal A m u -> dCount v + 2 * g = m := by + induction hS with + | nil _ _ _ => + intro A m hDg; cases hDg; rfl + | T _ _ _ => + intro A m hDg; cases hDg + | VK0 _ _ _ => + intro A m hDg; cases hDg + | VK1 _ _ _ => + intro A m hDg; cases hDg + | @D a b q1 a' b' g w0 u v hw0 _ _ _ ih => + intro A m hDg + have hd_out : dCount ((if b % 2 == 1 then Q else K) :: v) = 1 + dCount v := by + split_ifs <;> rfl + rw [hd_out] + cases hDg with + | zero hD => have hI := ih hD; omega + | one hD => have hI := ih hD; omega + | @P0 a b q1 q2 a' b' g w0 w1 u v hw0 hw1 _ _ _ _ ih => + intro A m hDg + dsimp [dCount] + cases hDg with + | zero hD1 => + cases hD1 with + | zero hD2 => have hI := ih hD2; omega + | one hD2 => have hI := ih hD2; omega + | one hD1 => + cases hD1 with + | zero hD2 => have hI := ih hD2; omega + | one hD2 => have hI := ih hD2; omega + | @P1 a b q1 q2 a' b' g w0 w1 u v hw0 hw1 _ _ _ _ ih => + intro A m hDg + dsimp [dCount] + cases hDg with + | zero hD1 => + cases hD1 with + | zero hD2 => have hI := ih hD2; omega + | one hD2 => have hI := ih hD2; omega + | one hD1 => + cases hD1 with + | zero hD2 => have hI := ih hD2; omega + | one hD2 => have hI := ih hD2; omega + +theorem digitVal_scale_and_val {A m : Nat} {u : List Word} (h : DigitVal A m u) : + wordScale u = ((2 ^ m : Nat) : Rat) ∧ wordVal u = ((2 ^ m : Nat) : Rat) - 1 := by + induction h with + | nil => simp [wordScale, wordVal] + | @zero A m u _ ih => + rw [pow_two_one_add m, Nat.cast_add]; dsimp only [wordScale, wordVal]; constructor <;> linarith + | @one A m u _ ih => + rw [pow_two_one_add m, Nat.cast_add]; dsimp only [wordScale, wordVal]; constructor <;> linarith + +theorem scan_wordScale_eq {a b a' b' g : Nat} {u v : List Word} + (h : Scan a b u a' b' v g) : + wordScale v * ((2 ^ (3 * g) : Nat) : Rat) = wordScale u := by + induction h with + | nil _ _ _ => simp [wordScale] + | T _ _ ih => dsimp [wordScale]; linarith + | VK0 _ _ ih => dsimp [wordScale]; linarith + | VK1 _ _ ih => dsimp [wordScale]; linarith + | @D _ b _ _ _ _ w0 u v hw0 _ _ _ ih => + have hv : wordScale ((if b % 2 == 1 then Q else K) :: v) = 2 * wordScale v := by + split_ifs <;> rfl + rw [hv, wordScale_cons_digit hw0]; linarith + | @P0 _ _ _ _ _ _ g w0 w1 u v hw0 hw1 _ _ _ _ ih => + rw [wordScale_cons_digit hw0, wordScale_cons_digit hw1] + have hpow : 2 ^ (3 * (1 + g)) = 2 ^ (3 * g) * 8 := by + have : 3 * (1 + g) = 3 * g + 3 := by omega + rw [this, Nat.pow_add] + have h8 : ((8 : Nat) : Rat) = 8 := by norm_num + rw [hpow, Nat.cast_mul, h8]; dsimp [wordScale]; linarith + | @P1 _ _ _ _ _ _ g w0 w1 u v hw0 hw1 _ _ _ _ ih => + rw [wordScale_cons_digit hw0, wordScale_cons_digit hw1] + have hpow : 2 ^ (3 * (1 + g)) = 2 ^ (3 * g) * 8 := by + have : 3 * (1 + g) = 3 * g + 3 := by omega + rw [this, Nat.pow_add] + have h8 : ((8 : Nat) : Rat) = 8 := by norm_num + rw [hpow, Nat.cast_mul, h8]; dsimp [wordScale]; linarith + +theorem Parse_la {a a' g : Nat} {u : List Word} (h : Parse a u a' g) : + 0 <= ((a' : Rat) + 1) * wordScale u - ((a : Rat) + 1) ∧ + ((a' : Rat) + 1) * wordScale u - ((a : Rat) + 1) <= 2 * wordVal u := by + induction h with + | nil a => simp [wordScale, wordVal] + | @T a a' g u _ ih => + dsimp [wordScale, wordVal]; push_cast at ih ⊢; constructor <;> linarith + | @VK a a' g u _ ih => + dsimp [wordScale, wordVal]; constructor <;> linarith + | @D a q1 a' g w0 u hw0 hq1 _ ih => + rw [wordScale_cons_digit hw0, wordVal_cons_digit hw0] + have hd := dVal_le_one w0 + have hq1_r : (a : Rat) + (dVal w0 : Rat) = (q1 : Rat) * 2 := by exact_mod_cast hq1 + have hd_r0 : (0 : Rat) <= (dVal w0 : Rat) := Nat.cast_nonneg _ + have hd_r1 : (dVal w0 : Rat) <= 1 := by exact_mod_cast hd + constructor <;> linarith + | @P a q2 a' g w0 w1 u hw0 hw1 hq2 _ ih => + rw [wordScale_cons_digit hw0, wordScale_cons_digit hw1, wordVal_cons_digit hw0, + wordVal_cons_digit hw1] + have hd0 := dVal_le_one w0 + have hd1 := dVal_le_one w1 + let q1 := (a + dVal w0) / 2 + let r1 := (a + dVal w0) % 2 + have hr1 : r1 <= 1 := by omega + have h1 : a + dVal w0 = r1 + q1 * 2 := by omega + have h2 : q1 + dVal w1 = 1 + q2 * 2 := hq2 + have h_rel : 4 * q2 + 2 + r1 = a + dVal w0 + 2 * dVal w1 := by omega + have h_rel_r : 4 * (q2 : Rat) + 2 + (r1 : Rat) = + (a : Rat) + (dVal w0 : Rat) + 2 * (dVal w1 : Rat) := by + exact_mod_cast h_rel + have hr1_0 : (0 : Rat) <= (r1 : Rat) := Nat.cast_nonneg _ + have hr1_1 : (r1 : Rat) <= 1 := by exact_mod_cast hr1 + have hd0_0 : (0 : Rat) <= (dVal w0 : Rat) := Nat.cast_nonneg _ + have hd0_1 : (dVal w0 : Rat) <= 1 := by exact_mod_cast hd0 + have hd1_0 : (0 : Rat) <= (dVal w1 : Rat) := Nat.cast_nonneg _ + have hd1_1 : (dVal w1 : Rat) <= 1 := by exact_mod_cast hd1 + constructor <;> linarith + +theorem digitVal_cons_inv {A m : Nat} {w0 : Word} {u : List Word} + (h : DigitVal A m (w0 :: u)) : + ∃ A' m', DigitVal A' m' u ∧ A = dVal w0 + A' * 2 ∧ m = 1 + m' := by + cases h with + | zero hD => exact ⟨_, _, hD, by dsimp only [dVal]; omega, rfl⟩ + | one hD => exact ⟨_, _, hD, rfl, rfl⟩ + +theorem parse_digitVal_a {a a' g : Nat} {u : List Word} (hP : Parse a u a' g) : + ∀ {A m : Nat}, DigitVal A m u -> a' * 2 ^ m <= a + A ∧ a + A < (a' + 1) * 2 ^ m := by + induction hP with + | nil a => + intro A m hDg; cases hDg; simp + | T _ _ => intro A m hDg; cases hDg + | VK _ _ => intro A m hDg; cases hDg + | @D a q1 a' g w0 u _ hq1 _ ih => + intro A m hDg + rcases digitVal_cons_inv hDg with ⟨A', m', hD', rfl, rfl⟩ + rcases ih hD' with ⟨hL, hR⟩ + rw [pow_two_one_add m'] + simp only [Nat.mul_add, Nat.add_mul, Nat.one_mul] at hL hR ⊢ + omega + | @P a q2 a' g w0 w1 u _ _ hq2 _ ih => + intro A m hDg + rcases digitVal_cons_inv hDg with ⟨A1, m1, hD1, rfl, rfl⟩ + rcases digitVal_cons_inv hD1 with ⟨A2, m2, hD2, rfl, rfl⟩ + rcases ih hD2 with ⟨hL, hR⟩ + rw [pow_two_one_add (1 + m2), pow_two_one_add m2] + simp only [Nat.mul_add, Nat.add_mul, Nat.one_mul] at hL hR ⊢ + let q1 := (a + dVal w0) / 2 + let r1 := (a + dVal w0) % 2 + have hr1 : r1 <= 1 := by omega + have h1 : a + dVal w0 = r1 + q1 * 2 := by omega + have h2 : q1 + dVal w1 = 1 + q2 * 2 := hq2 + omega + +theorem Scan_delta {a b a' b' g : Nat} {u v : List Word} + (h : Scan a b u a' b' v g) : + -1 <= ((b : Rat) - 2) - ((b' : Rat) - 2) * wordScale v ∧ + ((b : Rat) - 2) - ((b' : Rat) - 2) * wordScale v <= 2 * wordVal v + wordValQ v := by + induction h with + | nil _ _ _ => simp [wordScale, wordVal, wordValQ] + | @T a b a' b' g u v hb _ ih => + dsimp [wordScale, wordVal, wordValQ] + have hcast : (((b - 1) * 2 : Nat) : Rat) = 2 * (b : Rat) - 2 := by + rw [Nat.cast_mul, Nat.cast_sub (by omega : 1 <= b)]; push_cast; ring + rw [hcast] at ih + constructor <;> linarith + | @VK0 a k a' b' g u v hk _ ih => + dsimp [wordScale, wordVal, wordValQ] + have hcast : ((1 + (k - 1) * 2 : Nat) : Rat) = ((k * 2 : Nat) : Rat) - 1 := by + rw [Nat.cast_add, Nat.cast_mul, Nat.cast_sub hk]; push_cast; ring + rw [hcast] at ih + constructor <;> linarith + | @VK1 a k a' b' g u v hk _ ih => + dsimp [wordScale, wordVal, wordValQ] + have hcast : ((1 + (k - 1) * 2 : Nat) : Rat) = ((1 + k * 2 : Nat) : Rat) - 2 := by + rw [Nat.cast_add, Nat.cast_mul, Nat.cast_sub hk]; push_cast; ring + rw [hcast] at ih + constructor <;> linarith + | @D a b q1 a' b' g w0 u v _ _ _ _ ih => + rcases Nat.mod_two_eq_zero_or_one b with hb0 | hb1 + · have hb_eq : b = 2 * (b / 2) := by omega + have hcast : (b : Rat) = 2 * ((b / 2 : Nat) : Rat) := by exact_mod_cast hb_eq + have h_if : (if b % 2 == 1 then Q else K) = K := by rw [hb0]; rfl + rw [h_if] + dsimp [wordScale, wordVal, wordValQ] + constructor <;> linarith + · have hb_eq : b = 1 + 2 * (b / 2) := by omega + have hcast : (b : Rat) = 1 + 2 * ((b / 2 : Nat) : Rat) := by exact_mod_cast hb_eq + have h_if : (if b % 2 == 1 then Q else K) = Q := by rw [hb1]; rfl + rw [h_if] + dsimp [wordScale, wordVal, wordValQ] + constructor <;> linarith + | @P0 a b q1 q2 a' b' g w0 w1 u v _ _ _ _ hb _ ih => + dsimp [wordScale, wordVal, wordValQ] + have hcast : (((b - 1) * 2 : Nat) : Rat) = 2 * (b : Rat) - 2 := by + rw [Nat.cast_mul, Nat.cast_sub (by omega : 1 <= b)]; push_cast; ring + rw [hcast] at ih + constructor <;> linarith + | @P1 a b q1 q2 a' b' g w0 w1 u v _ _ _ _ hb _ ih => + dsimp [wordScale, wordVal, wordValQ] + have hcast : ((1 + (b - 1) * 2 : Nat) : Rat) = 2 * (b : Rat) - 1 := by + rw [Nat.cast_add, Nat.cast_mul, Nat.cast_sub (by omega : 1 <= b)]; push_cast; ring + rw [hcast] at ih + constructor <;> linarith + +-- Pure Nat evaluators for concrete word lists (avoids decide on Rat) +def vCount : List Word -> Nat + | [] => 0 + | V :: u => 1 + vCount u + | _ :: u => vCount u + +theorem wordScale_mul_pow_vCount (u : List Word) : + wordScale u * ((2 ^ (vCount u) : Nat) : Rat) = ((2 ^ (dCount u) : Nat) : Rat) := by + induction u with + | nil => simp [wordScale, vCount, dCount] + | cons w u ih => + cases w with + | V => + dsimp only [wordScale, vCount, dCount] + rw [pow_two_one_add (vCount u), Nat.cast_add]; linarith + | K => + dsimp only [wordScale, vCount, dCount] + rw [pow_two_one_add (dCount u), Nat.cast_add]; linarith + | Q => + dsimp only [wordScale, vCount, dCount] + rw [pow_two_one_add (dCount u), Nat.cast_add]; linarith + +def checkScalePow (u : List Word) (L target : Nat) : Bool := + dCount u + L == vCount u + target + +theorem checkScalePow_sound (u : List Word) (L target : Nat) + (h : checkScalePow u L target = true) : + wordScale u * ((2 ^ L : Nat) : Rat) = ((2 ^ target : Nat) : Rat) := by + unfold checkScalePow at h + rw [beq_iff_eq] at h + have h_vc := wordScale_mul_pow_vCount u + have h_pow_pos : (0 : Rat) < ((2 ^ (vCount u) : Nat) : Rat) := by + exact_mod_cast (pow_two_pos (vCount u)) + have h_nat : 2 ^ dCount u * 2 ^ L = 2 ^ vCount u * 2 ^ target := by + rw [<- Nat.pow_add, <- Nat.pow_add, h] + have h_rat : ((2 ^ dCount u : Nat) : Rat) * ((2 ^ L : Nat) : Rat) = + ((2 ^ (vCount u) : Nat) : Rat) * ((2 ^ target : Nat) : Rat) := by exact_mod_cast h_nat + have h_eq : (wordScale u * ((2 ^ L : Nat) : Rat) - ((2 ^ target : Nat) : Rat)) * + ((2 ^ (vCount u) : Nat) : Rat) = 0 := by + calc (wordScale u * ((2 ^ L : Nat) : Rat) - ((2 ^ target : Nat) : Rat)) * ((2 ^ (vCount u) : + Nat) : Rat) + _ = (wordScale u * ((2 ^ (vCount u) : Nat) : Rat)) * ((2 ^ L : Nat) : Rat) - + ((2 ^ (vCount u) : Nat) : Rat) * ((2 ^ target : Nat) : Rat) := by ring + _ = ((2 ^ dCount u : Nat) : Rat) * ((2 ^ L : Nat) : Rat) - + ((2 ^ (vCount u) : Nat) : Rat) * ((2 ^ target : Nat) : Rat) := by rw [h_vc] + _ = 0 := by linarith + rcases mul_eq_zero.mp h_eq with h0 | h0 + · linarith + · linarith + +def wordPotNat : List Word -> Nat × Nat + | [] => (0, 0) + | V :: u => + let p := wordPotNat u + (4 * p.2, 2 * p.2) + | K :: u => + let p := wordPotNat u + (6 * 4 ^ u.length + 8 * p.1, 4 * 4 ^ u.length + 4 * p.1) + | Q :: u => + let p := wordPotNat u + (6 * 4 ^ u.length + 8 * p.1, 3 * 4 ^ u.length + 4 * p.1) + +theorem wordPotNat_sound (u : List Word) : + wordPot u * ((4 ^ u.length : Nat) : Rat) = ((wordPotNat u).1 : Rat) ∧ + wordPotV u * ((4 ^ u.length : Nat) : Rat) = ((wordPotNat u).2 : Rat) := by + induction u with + | nil => simp [wordPotNat] + | cons w u ih => + rcases ih with ⟨hW, hWV⟩ + have hpow : ((4 ^ (u.length + 1) : Nat) : Rat) = 4 * ((4 ^ u.length : Nat) : Rat) := by + rw [Nat.pow_succ, Nat.cast_mul]; simp only [Nat.cast_ofNat]; ring + cases w with + | V => + dsimp only [wordPotNat, List.length] + simp only [wordPot_cons_V, wordPotV_cons_V] + rw [hpow, Nat.cast_mul, Nat.cast_mul]; simp only [Nat.cast_ofNat] + constructor <;> linarith + | K => + dsimp only [wordPotNat, List.length] + simp only [wordPot_cons_K, wordPotV_cons_K] + rw [hpow, Nat.cast_add, Nat.cast_mul, Nat.cast_mul, Nat.cast_add, Nat.cast_mul, + Nat.cast_mul]; simp only [Nat.cast_ofNat] + constructor <;> linarith + | Q => + dsimp only [wordPotNat, List.length] + simp only [wordPot_cons_Q, wordPotV_cons_Q] + rw [hpow, Nat.cast_add, Nat.cast_mul, Nat.cast_mul, Nat.cast_add, Nat.cast_mul, + Nat.cast_mul]; simp only [Nat.cast_ofNat] + constructor <;> linarith + +theorem le_of_mul_pow4_le {x y : Rat} {n : Nat} + (h : x * ((4 ^ n : Nat) : Rat) <= y * ((4 ^ n : Nat) : Rat)) : + x <= y := by + have hp : 0 < 4 ^ n := by + have h4 : 4 ^ n = 2 ^ (2 * n) := by rw [Nat.pow_mul] + rw [h4]; exact pow_two_pos (2 * n) + have hpos : (0 : Rat) < ((4 ^ n : Nat) : Rat) := by exact_mod_cast hp + rcases lt_or_ge y x with hlt | hle + · nlinarith + · exact hle + +def checkWordPotLe (u : List Word) (num den : Nat) : Bool := + (wordPotNat u).1 * den <= num * 4 ^ u.length + +theorem checkWordPotLe_sound (u : List Word) (num den : Nat) + (h : checkWordPotLe u num den = true) : + wordPot u * (den : Rat) <= (num : Rat) := by + unfold checkWordPotLe at h + rw [decide_eq_true_eq] at h + have h_rat : ((wordPotNat u).1 : Rat) * (den : Rat) <= + (num : Rat) * ((4 ^ u.length : Nat) : Rat) := by + exact_mod_cast h + have hW := (wordPotNat_sound u).1 + have h_mul : (wordPot u * (den : Rat)) * ((4 ^ u.length : Nat) : Rat) <= + (num : Rat) * ((4 ^ u.length : Nat) : Rat) := by + calc (wordPot u * (den : Rat)) * ((4 ^ u.length : Nat) : Rat) + _ = (wordPot u * ((4 ^ u.length : Nat) : Rat)) * (den : Rat) := by ring + _ = ((wordPotNat u).1 : Rat) * (den : Rat) := by rw [hW] + _ <= (num : Rat) * ((4 ^ u.length : Nat) : Rat) := h_rat + exact le_of_mul_pow4_le h_mul + +def checkWordPotVLe (u : List Word) (num den : Nat) : Bool := + (wordPotNat u).2 * den <= num * 4 ^ u.length + +theorem checkWordPotVLe_sound (u : List Word) (num den : Nat) + (h : checkWordPotVLe u num den = true) : + wordPotV u * (den : Rat) <= (num : Rat) := by + unfold checkWordPotVLe at h + rw [decide_eq_true_eq] at h + have h_rat : ((wordPotNat u).2 : Rat) * (den : Rat) <= + (num : Rat) * ((4 ^ u.length : Nat) : Rat) := by + exact_mod_cast h + have hWV := (wordPotNat_sound u).2 + have h_mul : (wordPotV u * (den : Rat)) * ((4 ^ u.length : Nat) : Rat) <= + (num : Rat) * ((4 ^ u.length : Nat) : Rat) := by + calc (wordPotV u * (den : Rat)) * ((4 ^ u.length : Nat) : Rat) + _ = (wordPotV u * ((4 ^ u.length : Nat) : Rat)) * (den : Rat) := by ring + _ = ((wordPotNat u).2 : Rat) * (den : Rat) := by rw [hWV] + _ <= (num : Rat) * ((4 ^ u.length : Nat) : Rat) := h_rat + exact le_of_mul_pow4_le h_mul + +theorem wordVal_le_pow_length (u : List Word) : + wordVal u <= ((2 ^ u.length : Nat) : Rat) - 1 := by + induction u with + | nil => simp [wordVal] + | cons w u ih => + have hpow : ((2 ^ (u.length + 1) : Nat) : Rat) = 2 * ((2 ^ u.length : Nat) : Rat) := by + rw [Nat.pow_succ, Nat.cast_mul]; norm_num; ring + have hpos : (1 : Rat) <= ((2 ^ u.length : Nat) : Rat) := by + exact_mod_cast (pow_two_pos u.length) + cases w <;> (dsimp only [wordVal, List.length]; rw [hpow]; linarith) + + +theorem Parse_VV_inv {a a' g : Nat} {u : List Word} (h : Parse a (V :: V :: u) a' g) : + Parse (1 + a * 2) (V :: u) a' g := by + cases h with + | T hp => exact hp + | D hw0 _ _ => exact False.elim (hw0 rfl) + | P hw0 _ _ _ => exact False.elim (hw0 rfl) + +theorem Parse_VQ_inv {a a' g : Nat} {u : List Word} (h : Parse a (V :: Q :: u) a' g) : + Parse (1 + a * 2) (Q :: u) a' g := by + cases h with + | T hp => exact hp + | D hw0 _ _ => exact False.elim (hw0 rfl) + | P hw0 _ _ _ => exact False.elim (hw0 rfl) + +theorem Parse_VK_inv {a a' g : Nat} {u : List Word} (h : Parse a (V :: K :: u) a' g) : + Parse a u a' g ∨ Parse (1 + a * 2) (K :: u) a' g := by + cases h with + | VK hp => exact Or.inl hp + | T hp => exact Or.inr hp + | D hw0 _ _ => exact False.elim (hw0 rfl) + | P hw0 _ _ _ => exact False.elim (hw0 rfl) + + +theorem dCount_bound_WV (v : List Word) : + wordPotV v <= (3 / 4) * ((2 ^ (dCount v) : Nat) : Rat) + 1 / 4 := by + cases v with + | nil => simp [dCount]; norm_num + | cons a u => + have hW := (dCount_bound u).1 + have hWV := (dCount_bound u).2 + have hpow_pos : (1 : Rat) <= ((2 ^ (dCount u) : Nat) : Rat) := by + exact_mod_cast (pow_two_pos (dCount u)) + cases a with + | V => + dsimp only [dCount]; simp only [wordPotV_cons_V] + linarith + | K => + dsimp only [dCount]; rw [pow_two_one_add (dCount u), Nat.cast_add] + simp only [wordPotV_cons_K] + linarith + | Q => + dsimp only [dCount]; rw [pow_two_one_add (dCount u), Nat.cast_add] + simp only [wordPotV_cons_Q] + linarith + +def cPar7 (b : Nat) : Rat := + if b % 2 == 1 then 1 / 7 else 2 / 7 + +theorem cPar77_bounds (b : Nat) : 1 / 7 <= cPar7 b ∧ cPar7 b <= 2 / 7 := by + unfold cPar7 + split_ifs <;> constructor <;> norm_num + +theorem scan_wordPot_contract7 {a b a' b' g : Nat} {u v : List Word} + (h : Scan a b u a' b' v g) : + wordPotV v <= (6 / 7) * wordPot u + cPar7 b := by + induction h with + | nil a b _ => + have hc := (cPar77_bounds b).1 + simp; linarith + | @T a b a' b' g u v _ _ ih => + have hc_in := (cPar77_bounds b).1 + have hc_next : cPar7 ((b - 1) * 2) = 2 / 7 := by + unfold cPar7; have hmod : ((b - 1) * 2) % 2 = 0 := by omega + rw [hmod]; rfl + rw [hc_next] at ih + have hle := wordPot_le_two_wordPotV u + simp only [wordPotV_cons_V, wordPot_cons_V] + linarith + | @VK0 a k a' b' g u v _ _ ih => + have hc_in : cPar7 (k * 2) = 2 / 7 := by + unfold cPar7; have hmod : (k * 2) % 2 = 0 := by omega + rw [hmod]; rfl + have hc_next : cPar7 (1 + (k - 1) * 2) = 1 / 7 := by + unfold cPar7; have hmod : (1 + (k - 1) * 2) % 2 = 1 := by omega + rw [hmod]; rfl + rw [hc_next] at ih + rw [hc_in] + simp only [wordPotV_cons_K, wordPot_cons_V] + linarith + | @VK1 a k a' b' g u v _ _ ih => + have hc_in : cPar7 (1 + k * 2) = 1 / 7 := by + unfold cPar7; have hmod : (1 + k * 2) % 2 = 1 := by omega + rw [hmod]; rfl + have hc_next : cPar7 (1 + (k - 1) * 2) = 1 / 7 := by + unfold cPar7; have hmod : (1 + (k - 1) * 2) % 2 = 1 := by omega + rw [hmod]; rfl + rw [hc_next] at ih + rw [hc_in] + simp only [wordPotV_cons_Q, wordPot_cons_V, wordPotV_cons_K] + linarith + | @D a b q1 a' b' g w0 u v hw0 _ _ _ ih => + have hc_next := (cPar77_bounds (b / 2)).2 + have hle := wordPot_le_two_wordPotV v + rw [wordPot_cons_digit hw0] + unfold cPar7 + split_ifs <;> (simp only [wordPotV_cons_Q, wordPotV_cons_K]; linarith) + | @P0 a b q1 q2 a' b' g w0 w1 u v hw0 hw1 _ _ _ _ ih => + have hc_in := (cPar77_bounds b).1 + have hc_next := (cPar77_bounds ((b - 1) * 2)).2 + have hzW := wordPot_nonneg u + rw [wordPot_cons_digit hw0, wordPot_cons_digit hw1] + simp only [wordPotV_cons_V] + linarith + | @P1 a b q1 q2 a' b' g w0 w1 u v hw0 hw1 _ _ _ _ ih => + have hc_in := (cPar77_bounds b).1 + have hc_next := (cPar77_bounds (1 + (b - 1) * 2)).2 + have hzW := wordPot_nonneg u + rw [wordPot_cons_digit hw0, wordPot_cons_digit hw1] + simp only [wordPotV_cons_V] + linarith + +theorem multiStep_add_intermediate_vkq {tm : Machine (Fin 2) (Fin 6)} {c c' : Cfg (Fin 2) (Fin 6)} + {j d : Nat} + (h : multiStep tm c (j + d) = some c') : + (multiStep tm c j).isSome := by + rw [multiStep_add_vkq] at h + cases h_j : multiStep tm c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl + +namespace Traj114 + +def u_0 : List Word := [V, K, Q, Q] +def tags_0 : List Nat := [1, 5] +def da_0 : List Word := [Q, K, K, Q] +def n_0 : Nat := 0 +def u_1 : List Word := [V, K, V, V, Q, K, K, Q] +def tags_1 : List Nat := [1, 0, 0, 3, 3, 5] +def da_1 : List Word := [Q, K, Q] +def n_1 : Nat := 0 +def u_2 : List Word := [V, K, V, V, V, K, Q, V, Q, K, Q] +def tags_2 : List Nat := [1, 0, 0, 1, 3, 0, 4, 4] +def da_2 : List Word := [K, Q, K, K, K, Q] +def n_2 : Nat := 1 +def u_3 : List Word := [V, K, V, V, V, K, V, Q, V, V, V, K, Q, K, K, K, Q] +def tags_3 : List Nat := [1, 0, 0, 1, 0, 3, 0, 0, 1, 3, 4, 3, 4] +def da_3 : List Word := [K, K, Q, K, K, Q] +def n_3 : Nat := 1 +def u_4 : List Word := [V, K, V, V, V, K, V, V, K, V, V, K, V, Q, V, K, V, K, K, Q, K, K, Q] +def tags_4 : List Nat := [1, 0, 0, 1, 0, 1, 0, 1, 0, 3, 1, 2, 4, 3, 3, 4] +def da_4 : List Word := [K, K, Q, K, K, Q] +def n_4 : Nat := 1 +def u_5 : List Word := + [V, K, V, V, V, K, V, V, K, V, V, K, V, V, K, K, V, Q, V, V, K, K, V, K, K, Q, K, K, Q] +def tags_5 : List Nat := [1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 5, 0, 3, 0, 0, 5, 2, 4, 3, 3, 4] +def da_5 : List Word := [K, Q, Q, Q, Q, Q, K, K, K, Q, K, Q] +def n_5 : Nat := 1 +def u_6 : List Word := + [V, K, V, V, V, K, V, V, K, V, V, K, V, V, V, V, V, K, V, V, V, Q, V, V, K, K, V, K, Q, Q, Q, + Q, Q, K, K, K, Q, K, Q] +def tags_6 : List Nat := + [1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 5, 0, 5, 5, 5, 3, 3, 4, 3, 4] +def da_6 : List Word := [K, K, K, Q, K, K, Q, Q, K, Q, Q, Q, K, K, K, Q, K, Q] +def n_6 : Nat := 1 +def u_7 : List Word := + [V, K, V, V, V, K, V, V, K, V, V, K, V, V, V, V, V, K, V, V, V, V, K, V, V, V, V, V, V, V, Q, + K, V, K, V, K, K, K, Q, K, K, Q, Q, K, Q, Q, Q, K, K, K, Q, K, Q] +def tags_7 : List Nat := + [1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 3, 1, 2, 3, 4, 3, + 3, 5, 4, 5, 3, 3, 4, 3, 4] +def da_7 : List Word := [K, Q, Q, Q, K, K, Q, Q, K, Q, Q, Q, K, K, K, Q, K, Q] +def n_7 : Nat := 1 +def u_8 : List Word := + [V, K, V, V, V, K, V, V, K, V, V, K, V, V, V, V, V, K, V, V, V, V, K, V, V, V, V, V, V, V, V, + K, Q, K, V, Q, V, Q, V, K, Q, V, V, V, Q, Q, V, K, V, K, Q, Q, Q, K, K, Q, Q, K, Q, Q, Q, K, + K, K, Q, K, Q] +def tags_8 : List Nat := + [1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 3, 3, 0, 3, 0, 3, + 0, 5, 0, 0, 0, 4, 1, 2, 5, 4, 3, 5, 4, 5, 3, 3, 4, 3, 4] +def da_8 : List Word := + [K, Q, Q, K, K, Q, Q, K, K, K, K, Q, Q, Q, K, Q, Q, K, Q, Q, Q, K, K, K, Q, K, Q] +def n_8 : Nat := 1 +def u_9 : List Word := + [V, K, V, V, V, K, V, V, K, V, V, K, V, V, V, V, V, K, V, V, V, V, K, V, V, V, V, V, V, V, V, + K, V, Q, K, V, K, V, K, V, V, V, V, V, V, K, V, Q, V, V, V, K, V, V, V, Q, Q, V, K, V, K, Q, + Q, K, K, Q, Q, K, K, K, K, Q, Q, Q, K, Q, Q, K, Q, Q, Q, K, K, K, Q, K, Q] +def tags_9 : List Nat := + [1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 3, 1, 2, 0, + 0, 0, 0, 0, 1, 0, 3, 0, 0, 1, 0, 0, 0, 4, 1, 2, 5, 4, 5, 3, 4, 4, 5, 3, 5, 4, 5, 3, 3, 4, 3, 4] +def da_9 : List Word := + [K, Q, K, Q, K, K, Q, K, Q, Q, K, Q, Q, K, Q, Q, Q, K, Q, K, Q, Q, Q, K, Q, Q, K, Q, Q, Q, K, + K, K, Q, K, Q] +def n_9 : Nat := 1 +def u_10 : List Word := + [V, K, V, V, V, K, V, V, K, V, V, K, V, V, V, V, V, K, V, V, V, V, K, V, V, V, V, V, V, V, V, + K, V, V, K, K, K, V, Q, V, V, V, V, V, V, K, V, V, K, V, V, K, V, V, V, V, V, K, V, Q, V, V, + V, V, Q, V, V, V, Q, V, V, V, Q, Q, V, K, V, K, Q, K, Q, K, K, Q, K, Q, Q, K, Q, Q, K, Q, Q, + Q, K, Q, K, Q, Q, Q, K, Q, Q, K, Q, Q, Q, K, K, K, Q, K, Q] +def tags_10 : List Nat := + [1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 5, 0, 3, 0, + 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 4, 1, 2, + 5, 5, 3, 5, 5, 3, 5, 4, 5, 3, 3, 5, 5, 3, 5, 4, 5, 3, 3, 4, 3, 4] +def da_10 : List Word := + [K, Q, Q, K, Q, Q, K, K, Q, Q, K, Q, K, Q, Q, Q, K, Q, Q, K, K, K, Q, Q, Q, Q, Q, K, K, Q, Q, + Q, Q, Q, Q, K, Q, Q, K, Q, Q, Q, K, K, K, Q, K, Q] +def n_10 : Nat := 1 +def u_11 : List Word := + [V, K, V, V, V, K, V, V, K, V, V, K, V, V, V, V, V, K, V, V, V, V, K, V, V, V, V, V, V, V, V, + K, V, V, K, V, V, V, K, V, V, V, V, V, K, V, V, K, V, V, K, V, V, V, V, V, K, V, V, K, V, V, + V, V, K, V, V, V, K, V, V, V, V, K, V, Q, V, V, V, Q, V, V, Q, V, V, V, Q, Q, V, V, Q, V, V, + V, Q, Q, V, K, V, K, Q, Q, K, Q, Q, K, K, Q, Q, K, Q, K, Q, Q, Q, K, Q, Q, K, K, K, Q, Q, Q, + Q, Q, K, K, Q, Q, Q, Q, Q, Q, K, Q, Q, K, Q, Q, Q, K, K, K, Q, K, Q] +def tags_11 : List Nat := + [1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, + 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, + 3, 0, 0, 3, 0, 0, 0, 4, 0, 0, 3, 0, 0, 0, 4, 1, 0, 5, 3, 3, 5, 5, 5, 4, 4, 5, 3, 5, 3, 3, 4, + 5, 5, 3, 3, 5, 5, 5, 3, 5, 4, 5, 3, 3, 4, 3, 4] +def da_11 : List Word := + [K, Q, Q, K, Q, Q, Q, K, Q, Q, K, Q, Q, K, Q, Q, Q, Q, K, K, Q, Q, K, Q, K, Q, K, Q, Q, K, K, + Q, Q, Q, K, K, K, Q, Q, Q, K, Q, K, K, Q, Q, Q, Q, Q, Q, K, Q, Q, K, Q, Q, Q, K, K, K, Q, K, Q] +def n_11 : Nat := 1 +def u_12 : List Word := + [V, K, V, V, V, K, V, V, K, V, V, K, V, V, V, V, V, K, V, V, V, V, K, V, V, V, V, V, V, V, V, + K, V, V, K, V, V, V, K, V, V, V, V, V, K, V, V, K, V, V, K, V, V, V, V, V, K, V, V, K, V, V, + V, V, K, V, V, V, K, V, V, V, V, K, V, V, K, V, V, V, K, V, V, K, V, V, V, V, V, V, K, V, V, + V, V, K, V, V, V, Q, Q, V, V, V, V, V, V, Q, V, Q, K, V, V, V, Q, K, V, V, V, Q, V, V, V, Q, + Q, V, K, V, K, Q, Q, K, Q, Q, Q, K, Q, Q, K, Q, Q, K, Q, Q, Q, Q, K, K, Q, Q, K, Q, K, Q, K, + Q, Q, K, K, Q, Q, Q, K, K, K, Q, Q, Q, K, Q, K, K, Q, Q, Q, Q, Q, Q, K, Q, Q, K, Q, Q, Q, K, + K, K, Q, K, Q] +def tags_12 : List Nat := + [1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, + 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, + 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 3, 0, 4, 0, 0, 0, 3, 3, 0, + 0, 0, 3, 0, 0, 0, 4, 1, 0, 5, 4, 4, 3, 5, 4, 5, 3, 5, 5, 3, 3, 5, 4, 4, 3, 5, 3, 4, 5, 3, 3, + 4, 5, 4, 3, 3, 5, 5, 5, 3, 5, 4, 5, 3, 3, 4, 3, 4] +def da_12 : List Word := + [K, Q, Q, K, Q, Q, K, Q, Q, K, K, K, Q, Q, Q, Q, K, Q, Q, K, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, K, + Q, Q, K, Q, Q, Q, Q, K, K, Q, K, K, Q, Q, K, Q, K, Q, Q, K, K, Q, Q, Q, K, K, K, Q, Q, Q, K, + Q, K, K, Q, Q, Q, Q, Q, Q, K, Q, Q, K, Q, Q, Q, K, K, K, Q, K, Q] +def n_12 : Nat := 1 +def u_13 : List Word := + [V, K, V, V, V, K, V, V, K, V, V, K, V, V, V, V, V, K, V, V, V, V, K, V, V, V, V, V, V, V, V, + K, V, V, K, V, V, V, K, V, V, V, V, V, K, V, V, K, V, V, K, V, V, V, V, V, K, V, V, K, V, V, + V, V, K, V, V, V, K, V, V, V, V, K, V, V, K, V, V, V, K, V, V, K, V, V, V, V, V, V, K, V, V, + V, V, K, V, V, V, V, V, V, V, V, V, V, V, K, V, V, V, V, V, K, Q, V, V, V, K, V, V, V, V, K, + V, V, V, V, V, K, V, V, V, Q, V, V, Q, K, V, V, V, K, V, Q, V, V, Q, Q, V, V, V, K, K, V, V, + V, Q, V, V, V, Q, Q, V, K, V, K, Q, Q, K, Q, Q, K, Q, Q, K, K, K, Q, Q, Q, Q, K, Q, Q, K, Q, + K, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, K, Q, Q, Q, Q, K, K, Q, K, K, Q, Q, K, Q, K, Q, Q, K, K, + Q, Q, Q, K, K, K, Q, Q, Q, K, Q, K, K, Q, Q, Q, Q, Q, Q, K, Q, Q, K, Q, Q, Q, K, K, K, Q, K, Q] +def tags_13 : List Nat := + [1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, + 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, + 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 3, 0, 0, + 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 3, 3, 0, 0, 1, 0, 3, 0, 0, 4, 0, 0, 0, 5, 0, + 0, 0, 3, 0, 0, 0, 4, 1, 0, 5, 4, 5, 5, 4, 3, 3, 5, 5, 4, 3, 5, 3, 5, 5, 5, 5, 3, 5, 3, 5, 5, + 3, 4, 3, 3, 5, 4, 3, 5, 3, 4, 5, 3, 3, 4, 5, 4, 3, 3, 5, 5, 5, 3, 5, 4, 5, 3, 3, 4, 3, 4] +def da_13 : List Word := + [K, Q, Q, K, Q, K, Q, K, K, Q, K, K, K, Q, K, Q, Q, Q, Q, K, Q, K, K, K, K, K, K, K, K, Q, K, + K, K, Q, Q, Q, K, Q, Q, K, Q, Q, K, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, K, Q, Q, Q, Q, + K, K, Q, K, K, Q, Q, K, Q, K, Q, Q, K, K, Q, Q, Q, K, K, K, Q, Q, Q, K, Q, K, K, Q, Q, Q, Q, + Q, Q, K, Q, Q, K, Q, Q, Q, K, K, K, Q, K, Q] +def n_13 : Nat := 1 +def u_14 : List Word := + [V, K, V, V, V, K, V, V, K, V, V, K, V, V, V, V, V, K, V, V, V, V, K, V, V, V, V, V, V, V, V, + K, V, V, K, V, V, V, K, V, V, V, V, V, K, V, V, K, V, V, K, V, V, V, V, V, K, V, V, K, V, V, + V, V, K, V, V, V, K, V, V, V, V, K, V, V, K, V, V, V, K, V, V, K, V, V, V, V, V, V, K, V, V, + V, V, K, V, V, V, V, V, V, V, V, V, V, V, K, V, V, V, V, V, K, V, Q, V, V, K, V, V, V, V, K, + V, V, V, V, V, K, V, V, V, V, K, V, V, K, Q, V, V, K, V, V, K, V, V, V, V, V, V, V, V, V, V, + K, V, V, V, V, K, V, V, V, V, V, V, V, K, K, V, V, V, K, V, Q, V, V, V, V, Q, V, Q, V, V, Q, + V, K, Q, V, V, K, V, Q, V, V, Q, Q, V, V, V, K, K, V, V, V, Q, V, V, V, Q, Q, V, K, V, K, Q, + Q, K, Q, K, Q, K, K, Q, K, K, K, Q, K, Q, Q, Q, Q, K, Q, K, K, K, K, K, K, K, K, Q, K, K, K, + Q, Q, Q, K, Q, Q, K, Q, Q, K, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, K, Q, Q, Q, Q, K, K, + Q, K, K, Q, Q, K, Q, K, Q, Q, K, K, Q, Q, Q, K, K, K, Q, Q, Q, K, Q, K, K, Q, Q, Q, Q, Q, Q, + K, Q, Q, K, Q, Q, Q, K, K, K, Q, K, Q] + +def head114 : List Word := + [V, K, V, V, V, K, V, V, K, V, V, K, V, V, V, V, V, K, V, V, V, V, K, V, V, V, V, V, V, V, V, + K, V, V, K, V, V, V, K, V, V, V, V, V, K, V, V, K, V, V, K, V, V, V, V, V, K, V, V, K, V, V, + V, V, K, V, V, V, K, V, V, V, V, K, V, V, K, V, V, V, K, V, V, K, V, V, V, V, V, V, K, V, V, + V, V, K, V, V, V, V, V, V, V, V, V, V, V, K, V, V, V, V, V, K] +def tags_head114 : List Nat := + [1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, + 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, + 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] +def v_head114 : List Word := + [K, V, V, V, K, V, V, K, V, V, K, V, V, V, V, V, K, V, V, V, V, K, V, V, V, V, V, V, V, V, K, + V, V, K, V, V, V, K, V, V, V, V, V, K, V, V, K, V, V, K, V, V, V, V, V, K, V, V, K, V, V, V, + V, K, V, V, V, K, V, V, V, V, K, V, V, K, V, V, V, K, V, V, K, V, V, V, V, V, V, K, V, V, V, + V, K, V, V, V, V, V, V, V, V, V, V, V, K, V, V, V, V, V, K, V] +def a_114 : Nat := 73786976294838206463 +def b_114 : Nat := 188754406282887020529 +def A_top64 : Nat := 11797150392680438782 + +def s17 : List Word := [V, V, V, K, K, V, V, V, Q, V, V, V, Q, Q, V, K, V] +def s19 : List Word := s17 ++ [K, Q] +def tags_s19 : List Nat := [0, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 4, 1, 0, 5] +def v_s19 : List Word := [V, V, V, V, V, V, V, K, V, V, V, V, K, V, V, V] + +def top35_ds : List Word := + [Q, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, K, Q, Q, Q, Q, K, K, Q, K, K, Q, Q, K, Q, K, Q, Q, K, K, Q, + Q, Q, K, K] +def tags_top35 : List Nat := [5, 5, 5, 5, 3, 5, 3, 5, 5, 3, 4, 3, 3, 5, 4, 3, 5, 3, 4, 5, 3, 3] +def v_top35_worst : List Word := [V, V, V, V, K, V, K, V, V, K, V, K, K, V, V, K, V, K, V, V, K, K] + +def top27 : List Word := + [K, Q, Q, Q, K, Q, K, K, Q, Q, Q, Q, Q, Q, K, Q, Q, K, Q, Q, Q, K, K, K, Q, K, Q] +def top28 : List Word := top27 ++ [K] +def tags_top28 : List Nat := [4, 5, 4, 3, 3, 5, 5, 5, 3, 5, 4, 5, 3, 3, 4, 3, 4] + +def p_114_init : List Word := + [V, Q, V, V, K, V, V, V, V, K, V, V, V, V, V, K, V, V, V, V, K, V, V, K, Q, V, V, K, V, V, K, + V, V, V, V, V, V, V, V, V, V, K, V, V, V, V, K, V, V, V, V, V, V, V, K, K, V, V, V, K, V, Q, + V, V, V, V, Q, V, Q, V, V, Q, V, K, Q, V, V, K, V, Q, V, V, Q, Q] +def ds_core_init : List Word := + [Q, K, Q, K, K, Q, K, K, K, Q, K, Q, Q, Q, Q, K, Q, K, K, K, K, K, K, K, K, Q, K, K, K, Q, Q, + Q, K, Q, Q, K, Q, Q, K, Q] +def A_core_init : Nat := 785475795493 + + +set_option maxRecDepth 200000 in +theorem step_0 : Step u_0 u_1 := checkStep_sound n_0 tags_0 u_0 da_0 u_1 (by decide) +set_option maxRecDepth 200000 in +theorem step_1 : Step u_1 u_2 := checkStep_sound n_1 tags_1 u_1 da_1 u_2 (by decide) +set_option maxRecDepth 200000 in +theorem step_2 : Step u_2 u_3 := checkStep_sound n_2 tags_2 u_2 da_2 u_3 (by decide) +set_option maxRecDepth 200000 in +theorem step_3 : Step u_3 u_4 := checkStep_sound n_3 tags_3 u_3 da_3 u_4 (by decide) +set_option maxRecDepth 200000 in +theorem step_4 : Step u_4 u_5 := checkStep_sound n_4 tags_4 u_4 da_4 u_5 (by decide) +set_option maxRecDepth 200000 in +theorem step_5 : Step u_5 u_6 := checkStep_sound n_5 tags_5 u_5 da_5 u_6 (by decide) +set_option maxRecDepth 200000 in +theorem step_6 : Step u_6 u_7 := checkStep_sound n_6 tags_6 u_6 da_6 u_7 (by decide) +set_option maxRecDepth 200000 in +theorem step_7 : Step u_7 u_8 := checkStep_sound n_7 tags_7 u_7 da_7 u_8 (by decide) +set_option maxRecDepth 200000 in +theorem step_8 : Step u_8 u_9 := checkStep_sound n_8 tags_8 u_8 da_8 u_9 (by decide) +set_option maxRecDepth 200000 in +theorem step_9 : Step u_9 u_10 := checkStep_sound n_9 tags_9 u_9 da_9 u_10 (by decide) +set_option maxRecDepth 200000 in +theorem step_10 : Step u_10 u_11 := checkStep_sound n_10 tags_10 u_10 da_10 u_11 (by decide) +set_option maxRecDepth 200000 in +theorem step_11 : Step u_11 u_12 := checkStep_sound n_11 tags_11 u_11 da_11 u_12 (by decide) +set_option maxRecDepth 200000 in +theorem step_12 : Step u_12 u_13 := checkStep_sound n_12 tags_12 u_12 da_12 u_13 (by decide) +set_option maxRecDepth 200000 in +theorem step_13 : Step u_13 u_14 := checkStep_sound n_13 tags_13 u_13 da_13 u_14 (by decide) + +theorem rounds_0_14 : Rounds u_0 u_14 := + Rounds.next step_0 (Rounds.next step_1 (Rounds.next step_2 (Rounds.next step_3 + (Rounds.next step_4 (Rounds.next step_5 (Rounds.next step_6 (Rounds.next step_7 + (Rounds.next step_8 (Rounds.next step_9 (Rounds.next step_10 (Rounds.next step_11 + (Rounds.next step_12 (Rounds.next step_13 (Rounds.refl u_14)))))))))))))) + +-- Invariant Good u +def Good (u : List Word) : Prop := + ∃ p_114 ds_core A_core L, + u = head114 ++ p_114 ++ s17 ++ [K, Q, Q, K] ++ ds_core ++ [K, Q] ++ top35_ds ++ top27 ∧ + (∃ p_tail, p_114 = V :: p_tail) ∧ + L = 41 + ds_core.length ∧ + 54 <= L ∧ + DigitVal A_core (L - 41) ds_core ∧ + wordScale p_114 * ((2 ^ L : Nat) : Rat) = ((2 ^ 45 : Nat) : Rat) ∧ + wordPot p_114 <= 29 / 8 + +set_option maxRecDepth 200000 in +theorem good_u14 : Good u_14 := by + refine ⟨p_114_init, ds_core_init, A_core_init, 81, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · decide + · exact ⟨p_114_init.tail, rfl⟩ + · decide + · decide + · exact checkDg_sound A_core_init ds_core_init (by decide) + · exact checkScalePow_sound p_114_init 81 45 (by decide) + · have h := checkWordPotLe_sound p_114_init 29 8 (by decide) + norm_num at h + linarith + +-- Fixed-piece Scan lemmas +set_option maxRecDepth 200000 in +theorem Scan_head114 : Scan 0 6 head114 a_114 b_114 v_head114 0 := by + have h := checkAffineScan_sound tags_head114 0 0 0 6 head114 0 a_114 0 b_114 v_head114 0 0 0 (by + decide) + simpa using h + +theorem v_head114_eq : V :: v_head114 = head114 ++ [V] := rfl + +theorem Scan_s19 (ap bp : Nat) (hbp : 2 <= bp) : + Scan ap bp s19 (8 * ap + 9) (4096 * (bp - 2) + 191) v_s19 3 := by + have h := checkAffineScan_sound tags_s19 1 0 1 2 s19 8 9 4096 191 v_s19 3 ap (bp - 2) (by decide) + have h_bp : 1 * (bp - 2) + 2 = bp := by omega + have h_ap : 1 * ap + 0 = ap := by omega + rwa [h_ap, h_bp] at h + +theorem Scan_top35 (b35 : Nat) (hb35 : 2 + 4 * wordVal top35_ds < (b35 : Rat)) : + ∃ b_top28 v_top35, + Scan (2 ^ 61) b35 top35_ds (2 ^ 26) b_top28 v_top35 13 ∧ + wordPotV v_top35 <= 23 / 64 ∧ + 3 <= b_top28 := by + rcases checkTopTrace_sound tags_top35 (2 ^ 61) top35_ds (2 ^ 26) v_top35_worst 13 b35 (by decide) + hb35 + with ⟨b_top28, v_top35, hS, _, hWV, hb_top28⟩ + have hw0 := checkWordPotVLe_sound v_top35_worst 23 64 (by decide) + have hw : wordPotV v_top35_worst <= 23 / 64 := by norm_num at hw0; linarith + exact ⟨b_top28, v_top35, hS, le_trans hWV hw, hb_top28⟩ + +theorem Scan_top28 (b_top28 : Nat) (hb : 3 <= b_top28) : + Scan (2 ^ 26) b_top28 top28 0 (32 * (b_top28 - 2) - 10) s17 11 := by + have h := checkAffineScan_sound tags_top28 0 (2 ^ 26) 1 3 top28 0 0 32 22 s17 11 0 (b_top28 - 3) + (by decide) + have h_in : 1 * (b_top28 - 3) + 3 = b_top28 := by omega + have h_out : 32 * (b_top28 - 3) + 22 = 32 * (b_top28 - 2) - 10 := by omega + dsimp at h + rwa [h_in, h_out] at h + + +theorem Parse_s19_split {ap a_end g_all : Nat} {rest : List Word} + (h : Parse ap (s19 ++ Q :: rest) a_end g_all) : + ∃ g_mid, Parse (8 * (ap + 1) + 1) (Q :: rest) a_end g_mid := by + change Parse ap ([V, V, V, K, K, V, V, V, Q, V, V, V, Q, Q, V, K, V, K, Q, + Q] ++ rest) a_end g_all at h + simp only [List.cons_append, List.nil_append] at h + -- i = 0, 1 (V :: V :: V) + have h := Parse_VV_inv h + have h := Parse_VV_inv h + -- i = 2 (V :: K :: K :: V) + rcases Parse_VK_inv h with h | h + · cases h with + | D _ hq1 _ => dsimp [dVal] at hq1; omega + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + · -- i = 3 (K :: K :: V) + cases h with + | D _ hq1 _ => dsimp [dVal] at hq1; omega + | @P _ q2_3 _ _ _ _ _ _ _ hq2_3 h => + have hq2_3_eq : q2_3 = 1 + ap * 2 := by dsimp [dVal] at hq2_3; omega + subst hq2_3_eq + -- i = 5, 6, 7 (V :: V :: V :: Q) + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + -- i = 8 (Q :: V) + cases h with + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + | @D _ q1_8 _ _ _ _ _ hq1_8 h => + have hq1_8_eq : q1_8 = 8 + ap * 8 := by dsimp [dVal] at hq1_8; omega + subst hq1_8_eq + -- i = 9, 10, 11 (V :: V :: V :: Q :: Q) + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + -- i = 12 (Q :: Q :: V :: K) + cases h with + | @D _ q1_12 _ _ _ _ _ hq1_12 h => + have hq1_12_eq : q1_12 = 36 + ap * 32 := by dsimp [dVal] at hq1_12; omega + subst hq1_12_eq + cases h with + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + | D _ hq1_13 _ => dsimp [dVal] at hq1_13; omega + | @P _ q2_12 _ _ _ _ _ _ _ hq2_12 h => + have hq2_12_eq : q2_12 = 18 + ap * 16 := by dsimp [dVal] at hq2_12; omega + subst hq2_12_eq + -- i = 14 (V :: K :: V :: K :: Q :: Q) + rcases Parse_VK_inv h with h | h + · -- i = 16 (V :: K :: Q :: Q) + rcases Parse_VK_inv h with h | h + · cases h with + | D _ hq1_18 _ => dsimp [dVal] at hq1_18; omega + | P _ _ hq2_18 _ => dsimp [dVal] at hq2_18; omega + · -- i = 17 (K :: Q :: Q) + cases h with + | D _ hq1_17 _ => dsimp [dVal] at hq1_17; omega + | @P _ q2_17 _ g_mid _ _ _ _ _ hq2_17 h => + have h_end : q2_17 = 8 * (ap + 1) + 1 := by dsimp [dVal] at hq2_17; omega + subst h_end + exact ⟨g_mid, h⟩ + · cases h with + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + | D _ hq1_15 _ => dsimp [dVal] at hq1_15; omega + +-- Section 6: Main Invariant Closure and Goal Proof +theorem digitVal_top64 : DigitVal A_top64 64 ([K, Q] ++ top35_ds ++ top27) := + checkDg_sound A_top64 ([K, Q] ++ top35_ds ++ top27) (by decide) + +theorem digitVal_bot4 : DigitVal 6 4 [K, Q, Q, K] := + checkDg_sound 6 [K, Q, Q, K] (by decide) + +theorem digitVal_mid35 {A_core L : Nat} {ds_core : List Word} + (hL : 54 <= L) (hD : DigitVal A_core (L - 41) ds_core) : + ∃ A_mid35, + DigitVal A_mid35 (L - 37) ([Q, K] ++ ds_core ++ [K, Q]) ∧ + A_mid35 < 3 * 2 ^ (L - 39) := by + have h_qk : DigitVal 1 2 [Q, K] := checkDg_sound 1 [Q, K] (by decide) + have h_kq : DigitVal 2 2 [K, Q] := checkDg_sound 2 [K, Q] (by decide) + have h1 := digitVal_append h_qk hD + have h2 := digitVal_append h1 h_kq + have hlen1 : 2 + (L - 41) = L - 39 := by omega + have hlen2 : (L - 39) + 2 = L - 37 := by omega + rw [hlen1] at h2 + rw [hlen2] at h2 + have h_lt := lt_pow_of_digitVal hD + have h_pow : 2 ^ (L - 39) = 4 * 2 ^ (L - 41) := by + have heq : L - 39 = (L - 41) + 2 := by omega + rw [heq, Nat.pow_add]; ring + exact ⟨1 + A_core * 4 + 2 * 2 ^ (L - 39), + by simpa [List.append_assoc] using h2, + by omega⟩ + +theorem force_a35 {p_114 ds_mid35 : List Word} {ap gp L A_mid35 a35 g_mid : Nat} + (hL : 54 <= L) + (hP_p : Parse a_114 p_114 ap gp) + (hz13 : wordScale p_114 * ((2 ^ L : Nat) : Rat) = ((2 ^ 45 : Nat) : Rat)) + (hzW : wordPot p_114 <= 29 / 8) + (hD_mid : DigitVal A_mid35 (L - 37) ds_mid35) + (hA_mid : A_mid35 < 3 * 2 ^ (L - 39)) + (hP_mid : Parse (8 * (ap + 1) + 1) ds_mid35 a35 g_mid) : + a35 = 2 ^ 61 := by + rcases Parse_la hP_p with ⟨hla_lo, hla_hi⟩ + have hz12 := wordValQ_nonneg p_114 + have hz10_le := two_wordVal_add_wordValQ_le p_114 + have h_diff_hi : ((ap : Rat) + 1) * wordScale p_114 - ((a_114 : Rat) + 1) < 8 := by linarith + have h_powL_pos : (0 : Rat) < ((2 ^ L : Nat) : Rat) := by exact_mod_cast (pow_two_pos L) + have h_mul_lo : ((a_114 : Rat) + 1) * ((2 ^ L : Nat) : Rat) <= + ((ap : Rat) + 1) * (wordScale p_114 * ((2 ^ L : Nat) : Rat)) := by + nlinarith + have h_mul_hi : ((ap : Rat) + 1) * (wordScale p_114 * ((2 ^ L : Nat) : Rat)) < + (((a_114 : Rat) + 1) + 8) * ((2 ^ L : Nat) : Rat) := by + nlinarith + rw [hz13] at h_mul_lo h_mul_hi + have ha114_val : a_114 + 1 = 2 ^ 66 := by decide + have ha114_r : (a_114 : Rat) + 1 = ((2 ^ 66 : Nat) : Rat) := by exact_mod_cast ha114_val + rw [ha114_r] at h_mul_lo h_mul_hi + have h_nat_lo : 2 ^ 66 * 2 ^ L <= (ap + 1) * 2 ^ 45 := by exact_mod_cast h_mul_lo + have h_nat_hi : (ap + 1) * 2 ^ 45 < (2 ^ 66 + 8) * 2 ^ L := by exact_mod_cast h_mul_hi + have h_split1 : 2 ^ 66 * 2 ^ L = 2 ^ (L + 21) * 2 ^ 45 := by + have : 66 + L = (L + 21) + 45 := by omega + rw [<- Nat.pow_add, <- Nat.pow_add, this] + have h_split2 : (2 ^ 66 + 8) * 2 ^ L = (2 ^ (L + 21) + 2 ^ (L - 42)) * 2 ^ 45 := by + have h1 : 66 + L = (L + 21) + 45 := by omega + have h2 : 3 + L = (L - 42) + 45 := by omega + have h8 : (8 : Nat) = 2 ^ 3 := by decide + calc (2 ^ 66 + 8) * 2 ^ L + _ = 2 ^ 66 * 2 ^ L + 2 ^ 3 * 2 ^ L := by rw [h8]; ring + _ = 2 ^ (66 + L) + 2 ^ (3 + L) := by rw [<- Nat.pow_add, <- Nat.pow_add] + _ = 2 ^ ((L + 21) + 45) + 2 ^ ((L - 42) + 45) := by rw [h1, h2] + _ = (2 ^ (L + 21) + 2 ^ (L - 42)) * 2 ^ 45 := by rw [Nat.pow_add, Nat.pow_add]; ring + rw [h_split1] at h_nat_lo + rw [h_split2] at h_nat_hi + have h_pos45 : 0 < 2 ^ 45 := by decide + have hap_lo : 2 ^ (L + 21) <= ap + 1 := Nat.le_of_mul_le_mul_right h_nat_lo h_pos45 + have hap_hi : ap + 1 < 2 ^ (L + 21) + 2 ^ (L - 42) := Nat.lt_of_mul_lt_mul_right h_nat_hi + have h_pow_rel1 : 8 * 2 ^ (L + 21) = 2 ^ 61 * 2 ^ (L - 37) := by + have h1 : (8 : Nat) = 2 ^ 3 := by decide + have h2 : 3 + (L + 21) = 61 + (L - 37) := by omega + rw [h1, <- Nat.pow_add, h2, Nat.pow_add] + have h_pow_rel2 : 8 * 2 ^ (L - 42) = 2 ^ (L - 39) := by + have h1 : (8 : Nat) = 2 ^ 3 := by decide + have h2 : 3 + (L - 42) = L - 39 := by omega + rw [h1, <- Nat.pow_add, h2] + have h_pow_rel3 : 4 * 2 ^ (L - 39) = 2 ^ (L - 37) := by + have h1 : (4 : Nat) = 2 ^ 2 := by decide + have h2 : 2 + (L - 39) = L - 37 := by omega + rw [h1, <- Nat.pow_add, h2] + rcases parse_digitVal_a hP_mid hD_mid with ⟨h_a35_lo, h_a35_hi⟩ + have h_sum_lo : 2 ^ 61 * 2 ^ (L - 37) < 8 * (ap + 1) + 1 + A_mid35 := by omega + have h_sum_hi : 8 * (ap + 1) + 1 + A_mid35 < (2 ^ 61 + 1) * 2 ^ (L - 37) := by + have : (2 ^ 61 + 1) * 2 ^ (L - 37) = 2 ^ 61 * 2 ^ (L - 37) + 4 * 2 ^ (L - 39) := by + rw [h_pow_rel3]; ring + omega + have h_pos_m : 0 < 2 ^ (L - 37) := pow_two_pos (L - 37) + have h_lt1 : a35 < 2 ^ 61 + 1 := Nat.lt_of_mul_lt_mul_right (lt_of_le_of_lt h_a35_lo h_sum_hi) + have h_lt2 : 2 ^ 61 < a35 + 1 := Nat.lt_of_mul_lt_mul_right (lt_trans h_sum_lo h_a35_hi) + omega + +set_option maxHeartbeats 2000000 in +-- Bound the intermediate carries across the 35-digit scan. +theorem bound_b_mid0_and_b35 {p_114 v_p ds_mid35 v_mid : List Word} + {ap bp gp L A_mid35 b_mid0 b35 g_mid : Nat} + (hL : 54 <= L) + (hS_p : Scan a_114 b_114 p_114 ap bp v_p gp) + (hbp : 3 <= bp) + (hz13 : wordScale p_114 * ((2 ^ L : Nat) : Rat) = ((2 ^ 45 : Nat) : Rat)) + (hzW : wordPot p_114 <= 29 / 8) + (hb_mid0 : b_mid0 = 4096 * (bp - 2) + 191) + (hD_mid : DigitVal A_mid35 (L - 37) ds_mid35) : + 2 + 4 * wordVal ds_mid35 < (b_mid0 : Rat) ∧ + (Scan (8 * (ap + 1) + 1) b_mid0 ds_mid35 (2 ^ 61) b35 v_mid g_mid -> + 2 + 4 * wordVal top35_ds < (b35 : Rat)) := by + have h_delta_p := (Scan_delta hS_p).2 + have h_4wv_p := two_wordVal_add_wordValQ_le_four_wordPotV v_p + have h_cw_p := scan_wordPot_contract hS_p + have hc_b114 := (cPar_bounds b_114).2 + have h_wv_p_lt : wordPotV v_p < 4 := by linarith + have h_z13_p := scan_wordScale_eq hS_p + have h_pow_gp_ge1 : (1 : Rat) <= ((2 ^ (3 * gp) : Nat) : Rat) := by + exact_mod_cast (pow_two_pos (3 * gp)) + have h_z13_vp_pos := wordScale_pos v_p + have h_z13_vp_le : wordScale v_p <= wordScale p_114 := by nlinarith + have h_b114_big : ((2 ^ 67 : Nat) : Rat) + 18 < (b_114 : Rat) := by norm_num [b_114] + have h_bp2_pos : (0 : Rat) <= (bp : Rat) - 2 := by + have : (2 : Rat) <= (bp : Rat) := by exact_mod_cast (by omega : 2 <= bp) + linarith + have h_prod_p : ((2 ^ 67 : Nat) : Rat) < ((bp : Rat) - 2) * wordScale p_114 := by nlinarith + have h_powL_pos : (0 : Rat) < ((2 ^ L : Nat) : Rat) := by exact_mod_cast (pow_two_pos L) + have h_mul_L : ((2 ^ 67 : Nat) : Rat) * ((2 ^ L : Nat) : Rat) < + ((bp : Rat) - 2) * (wordScale p_114 * ((2 ^ L : Nat) : Rat)) := by + nlinarith + rw [hz13] at h_mul_L + have h_pow67 : ((2 ^ 67 : Nat) : Rat) = ((2 ^ 22 : Nat) : Rat) * ((2 ^ 45 : Nat) : Rat) := + by norm_num + rw [h_pow67] at h_mul_L + have h_pos45 : (0 : Rat) < ((2 ^ 45 : Nat) : Rat) := by norm_num + have h_bp2_gt : ((2 ^ 22 : Nat) : Rat) * ((2 ^ L : Nat) : Rat) < (bp : Rat) - 2 := by nlinarith + have h_bmid0_r : (b_mid0 : Rat) = 4096 * ((bp : Rat) - 2) + 191 := by + rw [hb_mid0, Nat.cast_add, Nat.cast_mul, Nat.cast_sub (by omega : 2 <= bp)]; push_cast; ring + have h_z10_mid := (digitVal_scale_and_val hD_mid).2 + have h_powL_split : ((2 ^ L : Nat) : Rat) = + ((2 ^ 37 : Nat) : Rat) * ((2 ^ (L - 37) : Nat) : Rat) := by + have h_nat : 2 ^ L = 2 ^ 37 * 2 ^ (L - 37) := by + rw [<- Nat.pow_add, Nat.add_sub_of_le (by omega : 37 <= L)] + exact_mod_cast h_nat + have h_pow37_val : ((2 ^ 37 : Nat) : Rat) = 137438953472 := by norm_num + have h_pow22_val : ((2 ^ 22 : Nat) : Rat) = 4194304 := by norm_num + have h_pow_m_ge1 : (1 : Rat) <= ((2 ^ (L - 37) : Nat) : Rat) := by + exact_mod_cast (pow_two_pos (L - 37)) + have hb_mid0_ok : 2 + 4 * wordVal ds_mid35 < (b_mid0 : Rat) := by + rw [h_z10_mid, h_bmid0_r] + rw [h_powL_split, h_pow37_val, h_pow22_val] at h_bp2_gt + linarith + refine ⟨hb_mid0_ok, ?_⟩ + intro hS_mid + have h_delta_mid := (Scan_delta hS_mid).2 + have h_4wv_mid := two_wordVal_add_wordValQ_le_four_wordPotV v_mid + have h_dc_eq := digitVal_scan_dCount hS_mid hD_mid + have h_dc_le : dCount v_mid <= L - 37 := by omega + have h_pow_dc : 2 ^ (dCount v_mid) <= 2 ^ (L - 37) := Nat.pow_le_pow_right (by decide) h_dc_le + have h_pow_dc_r : ((2 ^ (dCount v_mid) : Nat) : Rat) <= ((2 ^ (L - 37) : Nat) : Rat) := by + exact_mod_cast h_pow_dc + have h_wv_mid_le : wordPotV v_mid <= ((2 ^ (L - 37) : Nat) : Rat) - 1 := by + have hd := (dCount_bound v_mid).2 + linarith + have h_z13_mid := scan_wordScale_eq hS_mid + have h_z13_ds_mid := (digitVal_scale_and_val hD_mid).1 + rw [h_z13_ds_mid] at h_z13_mid + have h_pow_gmid_ge1 : (1 : Rat) <= ((2 ^ (3 * g_mid) : Nat) : Rat) := by + exact_mod_cast (pow_two_pos (3 * g_mid)) + have h_z13_vmid_pos := wordScale_pos v_mid + have h_z13_vmid_le : wordScale v_mid <= ((2 ^ (L - 37) : Nat) : Rat) := by nlinarith + have h_prod_b35 : ((2 ^ 70 : Nat) : Rat) * ((2 ^ (L - 37) : Nat) : Rat) < + ((b35 : Rat) - 2) * wordScale v_mid := by + rw [h_bmid0_r] at h_delta_mid + rw [h_powL_split, h_pow37_val, h_pow22_val] at h_bp2_gt + have h70 : ((2 ^ 70 : Nat) : Rat) = 1180591620717411303424 := by norm_num + rw [h70] + linarith + have h_b35_2_pos : (0 : Rat) < (b35 : Rat) - 2 := by + rcases lt_or_ge (0 : Rat) ((b35 : Rat) - 2) with hpos | hle + · exact hpos + · have : ((b35 : Rat) - 2) * wordScale v_mid <= 0 := + mul_nonpos_of_nonpos_of_nonneg hle (le_of_lt h_z13_vmid_pos) + have h70_pos : (0 : Rat) < ((2 ^ 70 : Nat) : Rat) := by norm_num + nlinarith + have h_b35_gt : ((2 ^ 70 : Nat) : Rat) < (b35 : Rat) - 2 := by nlinarith + have h_top35_z10 : 2 + 4 * wordVal top35_ds < ((2 ^ 70 : Nat) : Rat) := by + have h_len : top35_ds.length = 35 := by decide + have h_z10 := wordVal_le_pow_length top35_ds + rw [h_len] at h_z10 + norm_num at h_z10 ⊢ + linarith + linarith + +theorem bound_wordPot_p114' {p_114 v_p ds_mid35 v_mid v_top35 : List Word} + {ap bp gp L A_mid35 b_mid0 b35 g_mid : Nat} + (hL : 54 <= L) + (hS_p : Scan a_114 b_114 p_114 ap bp v_p gp) + (hz13 : wordScale p_114 * ((2 ^ L : Nat) : Rat) = ((2 ^ 45 : Nat) : Rat)) + (hzW : wordPot p_114 <= 29 / 8) + (hD_mid : DigitVal A_mid35 (L - 37) ds_mid35) + (hS_mid : Scan (8 * (ap + 1) + 1) b_mid0 ds_mid35 (2 ^ 61) b35 v_mid g_mid) + (hWV_top : wordPotV v_top35 <= 23 / 64) : + wordPotV (v_p ++ v_s19 ++ v_mid ++ v_top35) <= 463 / 128 := by + -- Step A: wordPotV v_p <= 451 / 128 + have h_cw_p := scan_wordPot_contract hS_p + have hc_b114 : cPar b_114 = 2 / 16 := by + unfold cPar + have hmod : b_114 % 2 = 1 := by decide + rw [hmod]; rfl + rw [hc_b114] at h_cw_p + have hA : wordPotV v_p <= 451 / 128 := by linarith + -- wordScale bounds + have h_z13_p := scan_wordScale_eq hS_p + have h_z13_mid := scan_wordScale_eq hS_mid + have h_z13_ds_mid := (digitVal_scale_and_val hD_mid).1 + rw [h_z13_ds_mid] at h_z13_mid + have h_z13_s19 : wordScale v_s19 = 1 / 4096 := by + have h := checkScalePow_sound v_s19 12 0 (by decide) + norm_num at h + linarith + have h_wv_s19 : wordPotV v_s19 <= 1 / 64 := by + have h := checkWordPotVLe_sound v_s19 1 64 (by decide) + norm_num at h + linarith + -- Step B: wordScale v_p * wordPotV v_s19 <= 1 / 128 + have h_powL_ge54 : (2 ^ 54 : Nat) <= 2 ^ L := Nat.pow_le_pow_right (by decide) hL + have h_powL_r : ((2 ^ 54 : Nat) : Rat) <= ((2 ^ L : Nat) : Rat) := by exact_mod_cast h_powL_ge54 + have h_z13_p_le : wordScale p_114 <= 1 / 512 := by + have h_pos_p := wordScale_pos p_114 + have h_mul := mul_le_mul_of_nonneg_left h_powL_r (le_of_lt h_pos_p) + rw [hz13] at h_mul + norm_num at h_mul + linarith + have h_pow_gp_ge1 : (1 : Rat) <= ((2 ^ (3 * gp) : Nat) : Rat) := by + exact_mod_cast (pow_two_pos (3 * gp)) + have h_z13_vp_pos := wordScale_pos v_p + have h_z13_vp_le : wordScale v_p <= 1 / 512 := by nlinarith + have hB : wordScale v_p * wordPotV v_s19 <= 1 / 128 := by + have h_wv_nn := wordPotV_nonneg v_s19 + nlinarith + -- Step C: wordScale (v_p ++ v_s19) * wordPotV v_mid <= 8 / 128 + have h_dc_eq := digitVal_scan_dCount hS_mid hD_mid + have h_wv_mid_dc := (dCount_bound v_mid).2 + have h_pow_dc_r : ((2 ^ (dCount v_mid) : Nat) : Rat) * ((2 ^ (2 * g_mid) : Nat) : Rat) = + ((2 ^ (L - 37) : Nat) : Rat) := by + rw [<- h_dc_eq, Nat.pow_add, Nat.cast_mul] + have h_pow_2g_ge1 : (1 : Rat) <= ((2 ^ (2 * g_mid) : Nat) : Rat) := by + exact_mod_cast (pow_two_pos (2 * g_mid)) + have h_pow_3g_ge_2g : ((2 ^ (2 * g_mid) : Nat) : Rat) <= ((2 ^ (3 * g_mid) : Nat) : Rat) := by + exact_mod_cast (Nat.pow_le_pow_right (by decide) (by omega : 2 * g_mid <= 3 * g_mid)) + have h_prod_ps : wordScale v_p * wordScale v_s19 * ((2 ^ (L - 37) : Nat) : Rat) <= 1 / 16 := by + have h_splitL : ((2 ^ L : Nat) : Rat) = + ((2 ^ 37 : Nat) : Rat) * ((2 ^ (L - 37) : Nat) : Rat) := by + have h_nat : 2 ^ L = 2 ^ 37 * 2 ^ (L - 37) := by + rw [<- Nat.pow_add, Nat.add_sub_of_le (by omega : 37 <= L)] + exact_mod_cast h_nat + have h_eq : wordScale v_p * ((2 ^ (3 * gp) : Nat) : Rat) * ((2 ^ 37 : Nat) : Rat) * ((2 ^ (L - + 37) : Nat) : Rat) = ((2 ^ 45 : Nat) : Rat) := by + calc wordScale v_p * ((2 ^ (3 * gp) : Nat) : Rat) * ((2 ^ 37 : Nat) : Rat) * ((2 ^ (L - 37) : + Nat) : Rat) + _ = wordScale p_114 * (((2 ^ 37 : Nat) : Rat) * ((2 ^ (L - 37) : Nat) : Rat)) := by + rw [h_z13_p]; ring + _ = wordScale p_114 * ((2 ^ L : Nat) : Rat) := by rw [<- h_splitL] + _ = ((2 ^ 45 : Nat) : Rat) := hz13 + have h_37_val : ((2 ^ 37 : Nat) : Rat) = 137438953472 := by norm_num + have h_45_val : ((2 ^ 45 : Nat) : Rat) = 35184372088832 := by norm_num + rw [h_37_val, h_45_val] at h_eq + have h_vp_gp_L37 : wordScale v_p * ((2 ^ (L - 37) : Nat) : Rat) * ((2 ^ (3 * gp) : Nat) : Rat) + = 256 := by linarith + have h_vp_L37 : wordScale v_p * ((2 ^ (L - 37) : Nat) : Rat) <= 256 := by + have h_pos_L37 : (0 : Rat) < ((2 ^ (L - 37) : Nat) : Rat) := by + exact_mod_cast (pow_two_pos (L - 37)) + have h_nn : 0 <= wordScale v_p * ((2 ^ (L - 37) : Nat) : Rat) := + mul_nonneg (le_of_lt h_z13_vp_pos) (le_of_lt h_pos_L37) + nlinarith + rw [h_z13_s19] + linarith + have hC : wordScale (v_p ++ v_s19) * wordPotV v_mid <= 8 / 128 := by + rw [wordScale_append] + have h_wv_mid_le : wordPotV v_mid <= ((2 ^ (L - 37) : Nat) : Rat) := by + have h_dc_le_L37 : 2 ^ (dCount v_mid) <= 2 ^ (L - 37) := + Nat.pow_le_pow_right (by decide) (by omega) + have h_dc_r : ((2 ^ (dCount v_mid) : Nat) : Rat) <= ((2 ^ (L - 37) : Nat) : Rat) := by + exact_mod_cast h_dc_le_L37 + linarith + have h_wv_mid_nn := wordPotV_nonneg v_mid + have h_z13_ps_pos : 0 < wordScale v_p * wordScale v_s19 := + mul_pos h_z13_vp_pos (wordScale_pos v_s19) + nlinarith + -- Step D: wordScale (v_p ++ v_s19 ++ v_mid) * wordPotV v_top35 <= 3 / 128 + have h_prod_psm : wordScale v_p * wordScale v_s19 * wordScale v_mid <= 1 / 16 := by + have h_vmid_le : wordScale v_mid <= ((2 ^ (L - 37) : Nat) : Rat) := by + have h_pos_vmid := wordScale_pos v_mid + nlinarith + have h_pos_vmid := wordScale_pos v_mid + have h_z13_ps_pos : 0 < wordScale v_p * wordScale v_s19 := + mul_pos h_z13_vp_pos (wordScale_pos v_s19) + nlinarith + have hD : wordScale (v_p ++ v_s19 ++ v_mid) * wordPotV v_top35 <= 3 / 128 := by + rw [wordScale_append, wordScale_append] + have h_wv_top_nn := wordPotV_nonneg v_top35 + have h_z13_psm_pos : 0 < wordScale v_p * wordScale v_s19 * wordScale v_mid := + mul_pos (mul_pos h_z13_vp_pos (wordScale_pos v_s19)) (wordScale_pos v_mid) + nlinarith + -- Combine A + B + C + D + have h_app1 := wordPotV_append_le v_p v_s19 + have h_app2 := wordPotV_append_le (v_p ++ v_s19) v_mid + have h_app3 := wordPotV_append_le (v_p ++ v_s19 ++ v_mid) v_top35 + linarith + +theorem bound_b_end_digitVal {w_114 v_w114 : List Word} {b_top28 g_w114 k : Nat} + (hk : 8 <= k) + (hb_top28 : 3 <= b_top28) + (hS_w : Scan a_114 b_114 w_114 (2 ^ 26) b_top28 v_w114 g_w114) + (hz13_vw : wordScale v_w114 * ((2 ^ k : Nat) : Rat) = 1) + (hWV_vw : wordPotV v_w114 <= 463 / 128) : + ∃ A_core' ds_core', + DigitVal A_core' (k + 5) ds_core' ∧ + ds_core'.length = k + 5 ∧ + DigitVal (32 * (b_top28 - 2) - 10) (k + 73) + ([K, Q, Q, K] ++ ds_core' ++ [K, Q] ++ top35_ds ++ top27) := by + rcases Scan_delta hS_w with ⟨hd_lo, hd_hi⟩ + have h_4wv := two_wordVal_add_wordValQ_le_four_wordPotV v_w114 + have hd_hi' : ((b_114 : Rat) - 2) - ((b_top28 : Rat) - 2) * wordScale v_w114 <= 463 / 32 := + by linarith + have h_powk_pos : (0 : Rat) < ((2 ^ k : Nat) : Rat) := by exact_mod_cast (pow_two_pos k) + have h_mul_lo : (((b_114 : Rat) - 2) - 463 / 32) * ((2 ^ k : Nat) : Rat) <= + ((b_top28 : Rat) - 2) * (wordScale v_w114 * ((2 ^ k : Nat) : Rat)) := by + nlinarith + have h_mul_hi : ((b_top28 : Rat) - 2) * (wordScale v_w114 * ((2 ^ k : Nat) : Rat)) <= + ((b_114 : Rat) - 1) * ((2 ^ k : Nat) : Rat) := by + nlinarith + rw [hz13_vw, mul_one] at h_mul_lo h_mul_hi + have hb114_r : (b_114 : Rat) - 2 = (A_top64 : Rat) * 16 + 15 := by norm_num [b_114, A_top64] + have hb114_1_r : (b_114 : Rat) - 1 = ((A_top64 : Rat) + 1) * 16 := by norm_num [b_114, A_top64] + rw [hb114_r] at h_mul_lo + rw [hb114_1_r] at h_mul_hi + let b_end := 32 * (b_top28 - 2) - 10 + have hb_end_r : (b_end : Rat) = 32 * ((b_top28 : Rat) - 2) - 10 := by + dsimp [b_end] + rw [Nat.cast_sub (by omega : 10 <= 32 * (b_top28 - 2)), Nat.cast_mul, + Nat.cast_sub (by omega : 2 <= b_top28)] + push_cast; ring + have h_pow_k9 : ((2 ^ (k + 9) : Nat) : Rat) = 512 * ((2 ^ k : Nat) : Rat) := by + have h9 : ((2 ^ 9 : Nat) : Rat) = 512 := by norm_num + rw [Nat.pow_add, Nat.cast_mul, h9]; ring + have h_powk_ge256 : (256 : Rat) <= ((2 ^ k : Nat) : Rat) := by + have h8 : 2 ^ 8 <= 2 ^ k := Nat.pow_le_pow_right (by decide) hk + have h8_r : ((2 ^ 8 : Nat) : Rat) <= ((2 ^ k : Nat) : Rat) := by exact_mod_cast h8 + have h8_val : ((2 ^ 8 : Nat) : Rat) = 256 := by norm_num + rwa [h8_val] at h8_r + have h_bend_lo_r : (A_top64 : Rat) * ((2 ^ (k + 9) : Nat) : Rat) < (b_end : Rat) := by + rw [hb_end_r, h_pow_k9]; linarith + have h_bend_hi_r : (b_end : Rat) < ((A_top64 : Rat) + 1) * ((2 ^ (k + 9) : Nat) : Rat) := by + rw [hb_end_r, h_pow_k9]; linarith + have h_bend_lo : A_top64 * 2 ^ (k + 9) < b_end := by exact_mod_cast h_bend_lo_r + have h_bend_hi : b_end < (A_top64 + 1) * 2 ^ (k + 9) := by exact_mod_cast h_bend_hi_r + have h_bend_mod16 : b_end % 16 = 6 := by dsimp [b_end]; omega + let A_core' := (b_end / 16) % (2 ^ (k + 5)) + have h_Acore'_lt : A_core' < 2 ^ (k + 5) := Nat.mod_lt _ (pow_two_pos (k + 5)) + rcases exists_digitVal_of_lt_pow (k + 5) A_core' h_Acore'_lt with ⟨ds_core', hD_core'⟩ + have h_len_core' := length_of_digitVal hD_core' + have h_bot_mid := digitVal_append digitVal_bot4 hD_core' + have h_all := digitVal_append h_bot_mid digitVal_top64 + have h_len_all : (4 + (k + 5)) + 64 = k + 73 := by omega + have h_pow_k9_eq : 2 ^ (k + 9) = 16 * 2 ^ (k + 5) := by + have : k + 9 = 4 + (k + 5) := by omega + rw [this, Nat.pow_add] + have h_div_top : b_end / (2 ^ (k + 9)) = A_top64 := by + have h_pos_k9 : 0 < 2 ^ (k + 9) := pow_two_pos (k + 9) + have h1 := (Nat.le_div_iff_mul_le h_pos_k9).mpr (le_of_lt h_bend_lo) + have h2 := (Nat.div_lt_iff_lt_mul h_pos_k9).mpr h_bend_hi + omega + have h_val_all : 6 + A_core' * 2 ^ 4 + A_top64 * 2 ^ (4 + (k + 5)) = b_end := by + have h1 : 2 ^ 4 = 16 := by decide + have h2 : 2 ^ (4 + (k + 5)) = 16 * 2 ^ (k + 5) := by rw [Nat.pow_add] + rw [h1, h2] + have h_assoc : A_top64 * (16 * 2 ^ (k + 5)) = 16 * (A_top64 * 2 ^ (k + 5)) := by ring + rw [h_assoc] + dsimp [A_core'] + have h_div16 : (b_end / 16) / (2 ^ (k + 5)) = A_top64 := by + rw [Nat.div_div_eq_div_mul, <- h_pow_k9_eq, h_div_top] + have h_mod_div := Nat.div_add_mod (b_end / 16) (2 ^ (k + 5)) + rw [h_div16, Nat.mul_comm (2 ^ (k + 5)) A_top64] at h_mod_div + have h_mod16 := Nat.div_add_mod b_end 16 + omega + rw [h_len_all, h_val_all] at h_all + exact ⟨A_core', ds_core', hD_core', h_len_core', by simpa [List.append_assoc] using h_all⟩ + +theorem Good_step {u : List Word} (hG : Good u) : + ∃ u', Step u u' ∧ Good u' := by + rcases hG with ⟨p_114, ds_core, A_core, L, rfl, ⟨p_tail, hp_start⟩, hL_def, hL, hD_core, hz13, + hzW⟩ + -- Piece 2: p_114 + have hP_p_ex : ∃ ap gp, Parse a_114 p_114 ap gp := by + rw [hp_start]; exact Parse_V_start a_114 p_tail + rcases hP_p_ex with ⟨ap, gp, hP_p⟩ + have hb_114_ok : 2 + 4 * wordVal p_114 < (b_114 : Rat) := by + have hz12 := wordValQ_nonneg p_114 + have hz10_le := two_wordVal_add_wordValQ_le p_114 + have hb114_gt : (17 : Rat) < (b_114 : Rat) := by norm_num [b_114] + linarith + rcases Scan_of_Parse hP_p b_114 hb_114_ok with ⟨bp, v_p, hS_p, hbp⟩ + -- Piece 3: s19 + have hS_s19 := Scan_s19 ap bp (by omega) + let b_mid0 := 4096 * (bp - 2) + 191 + -- Piece 4: ds_mid35 = [Q, K] ++ ds_core ++ [K, Q] + let ds_mid35 := [Q, K] ++ ds_core ++ [K, Q] + rcases digitVal_mid35 hL hD_core with ⟨A_mid35, hD_mid, hA_mid⟩ + have hP_s19_all : ∃ a35 g_all, Parse ap (s19 ++ ds_mid35) a35 g_all := by + change ∃ a35 g_all, Parse ap (V :: ([V, V, K, K, V, V, V, Q, V, V, V, Q, Q, V, K, V, K, + Q] ++ ds_mid35)) a35 g_all + exact Parse_V_start ap _ + rcases hP_s19_all with ⟨a35, g_all, hP_all⟩ + have hP_mid_ex : ∃ g_mid, Parse (8 * (ap + 1) + 1) ds_mid35 a35 g_mid := by + dsimp [ds_mid35] at hP_all ⊢ + exact Parse_s19_split hP_all + rcases hP_mid_ex with ⟨g_mid, hP_mid⟩ + have ha35_eq := force_a35 hL hP_p hz13 hzW hD_mid hA_mid hP_mid + subst ha35_eq + have hb_bounds := bound_b_mid0_and_b35 (b35 := 0) (v_mid := []) (g_mid := + 0) hL hS_p hbp hz13 hzW rfl hD_mid + rcases Scan_of_Parse hP_mid b_mid0 hb_bounds.1 with ⟨b35, v_mid, hS_mid, hb35_ge3⟩ + have hb35_ok := (bound_b_mid0_and_b35 hL hS_p hbp hz13 hzW rfl hD_mid).2 hS_mid + -- Piece 5: top35_ds + rcases Scan_top35 b35 hb35_ok with ⟨b_top28, v_top35, hS_top35, hWV_top35, hb_top28⟩ + -- Piece 6: top28 + have hS_top28 := Scan_top28 b_top28 hb_top28 + -- Combine Pieces 2 + 3 + 4 + 5 into w_114 + let w_114 := p_114 ++ s19 ++ ds_mid35 ++ top35_ds + let v_w114 := v_p ++ v_s19 ++ v_mid ++ v_top35 + let g_w114 := gp + 3 + g_mid + 13 + have h_ap_eq : 8 * ap + 9 = 8 * (ap + 1) + 1 := by omega + rw [h_ap_eq] at hS_s19 + have hS_w114 : Scan a_114 b_114 w_114 (2 ^ 26) b_top28 v_w114 g_w114 := by + have h23 := Scan_append hS_p hS_s19 + have h234 := Scan_append h23 hS_mid + have h2345 := Scan_append h234 hS_top35 + simpa [w_114, v_w114, g_w114, List.append_assoc, Nat.add_assoc] using h2345 + -- Combine Piece 1 + w_114 + Piece 6 + have h_u_rep1 : + (head114 ++ p_114 ++ s17 ++ [K, Q, Q, K] ++ ds_core ++ [K, + Q] ++ top35_ds ++ top27) ++ List.replicate 1 K = + head114 ++ w_114 ++ top28 := by + dsimp [w_114, s19, ds_mid35, top28, List.replicate] + simp only [List.append_assoc, List.cons_append, List.nil_append] + have hS_full : + Scan 0 6 ((head114 ++ p_114 ++ s17 ++ [K, Q, Q, K] ++ ds_core ++ [K, + Q] ++ top35_ds ++ top27) ++ List.replicate 1 K) + 0 (32 * (b_top28 - 2) - 10) (v_head114 ++ v_w114 ++ s17) (0 + g_w114 + 11) := by + rw [h_u_rep1] + exact Scan_append (Scan_append Scan_head114 hS_w114) hS_top28 + -- Closure bounds for p_114' = V :: v_w114 and b_end + let k := 8 + 3 * gp + 3 * g_mid + have hk : 8 <= k := by omega + have hWV_vw : wordPotV v_w114 <= 463 / 128 := + bound_wordPot_p114' hL hS_p hz13 hzW hD_mid hS_mid hWV_top35 + have hz13_vw : wordScale v_w114 * ((2 ^ k : Nat) : Rat) = 1 := by + have h_z13_w := scan_wordScale_eq hS_w114 + have h_w_eq : wordScale w_114 = ((2 ^ 40 : Nat) : Rat) := by + dsimp only [w_114] + rw [wordScale_append, wordScale_append, wordScale_append] + have h_s19 : wordScale s19 = 1 / 8 := by + have h := checkScalePow_sound s19 3 0 (by decide) + norm_num at h + linarith + have h_top35 : wordScale top35_ds = ((2 ^ 35 : Nat) : Rat) := by + have h := checkScalePow_sound top35_ds 0 35 (by decide) + norm_num at h ⊢ + linarith + have h_mid := (digitVal_scale_and_val hD_mid).1 + have h_splitL : ((2 ^ L : Nat) : Rat) = + ((2 ^ 37 : Nat) : Rat) * ((2 ^ (L - 37) : Nat) : Rat) := by + have h_nat : 2 ^ L = 2 ^ 37 * 2 ^ (L - 37) := by + rw [<- Nat.pow_add, Nat.add_sub_of_le (by omega : 37 <= L)] + exact_mod_cast h_nat + rw [h_s19, h_mid, h_top35] + rw [h_splitL] at hz13 + norm_num at hz13 ⊢ + linarith + rw [h_w_eq] at h_z13_w + have h_3gw : 3 * g_w114 = k + 40 := by dsimp [g_w114, k]; omega + have h40 : ((2 ^ 40 : Nat) : Rat) = 1099511627776 := by norm_num + rw [h_3gw, Nat.pow_add, Nat.cast_mul, h40] at h_z13_w + linarith + rcases bound_b_end_digitVal hk hb_top28 hS_w114 hz13_vw hWV_vw + with ⟨A_core', ds_core', hD_core', hlen_core', hD_bend⟩ + let da := [K, Q, Q, K] ++ ds_core' ++ [K, Q] ++ top35_ds ++ top27 + let u' := V :: (v_head114 ++ v_w114 ++ s17 ++ da) + refine ⟨u', ⟨1, 32 * (b_top28 - 2) - 10, v_head114 ++ v_w114 ++ s17, da, k + 73, + 0 + g_w114 + 11, hS_full, hD_bend, rfl⟩, ?_⟩ + -- Prove Good u' + let p_114' := V :: v_w114 + let L' := k + 46 + refine ⟨p_114', ds_core', A_core', L', ?_, ⟨v_w114, rfl⟩, ?_, ?_, ?_, ?_, ?_⟩ + · dsimp only [u', p_114', da, v_head114, head114] + simp only [List.cons_append, List.nil_append, List.append_assoc] + · dsimp [L']; omega + · dsimp [L']; omega + · have h_L'_41 : L' - 41 = k + 5 := by dsimp [L']; omega + rwa [h_L'_41] + · dsimp only [p_114', L', wordScale] + have h_L'_split : k + 46 = k + 1 + 45 := by omega + have h1 : ((2 ^ 1 : Nat) : Rat) = 2 := by norm_num + have h45 : ((2 ^ 45 : Nat) : Rat) = 35184372088832 := by norm_num + rw [h_L'_split, Nat.pow_add, Nat.pow_add, Nat.cast_mul, Nat.cast_mul, h1, h45] + linarith + · dsimp only [p_114'] + rw [wordPot_cons_V] + linarith + + +end Traj114 + +namespace Traj103 + +def u_0 : List Word := [K, K, Q] +def tags_0 : List Nat := [3, 4] +def da_0 : List Word := [K, K, Q] +def n_0 : Nat := 0 +def u_1 : List Word := [V, K, V, K, K, Q] +def tags_1 : List Nat := [1, 2, 4] +def da_1 : List Word := [K, K, Q] +def n_1 : Nat := 0 +def u_2 : List Word := [V, K, V, Q, V, V, K, K, Q] +def tags_2 : List Nat := [1, 0, 3, 0, 0, 5, 4] +def da_2 : List Word := [K, K, Q, K, K, Q] +def n_2 : Nat := 1 +def u_3 : List Word := [V, K, V, V, K, V, V, V, V, K, K, Q, K, K, Q] +def tags_3 : List Nat := [1, 0, 1, 0, 0, 0, 0, 5, 3, 3, 3, 4] +def da_3 : List Word := [K, Q, Q, K, K, Q] +def n_3 : Nat := 1 +def u_4 : List Word := [V, K, V, V, K, V, V, V, V, V, V, Q, Q, K, V, K, Q, Q, K, K, Q] +def tags_4 : List Nat := [1, 0, 1, 0, 0, 0, 0, 0, 0, 4, 3, 2, 5, 3, 3, 4] +def da_4 : List Word := [K, K, Q, Q, Q, Q, K, K, Q] +def n_4 : Nat := 1 +def u_5 : List Word := + [V, K, V, V, K, V, V, V, V, V, V, V, V, K, Q, V, V, Q, K, V, K, K, Q, Q, Q, Q, K, K, Q] +def tags_5 : List Nat := [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 3, 3, 0, 5, 5, 5, 3, 3, 4] +def da_5 : List Word := [K, Q, K, K, K, Q, Q, Q, Q, K, K, Q] +def n_5 : Nat := 1 +def u_6 : List Word := + [V, K, V, V, K, V, V, V, V, V, V, V, V, K, V, Q, V, V, K, Q, V, V, V, V, Q, K, V, K, Q, K, K, + K, Q, Q, Q, Q, K, K, Q] +def tags_6 : List Nat := + [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 1, 3, 0, 0, 0, 0, 3, 3, 0, 5, 3, 4, 5, 5, 3, 3, 4] +def da_6 : List Word := [K, K, Q, Q, K, Q, Q, K, Q, Q, Q, Q, K, K, Q] +def n_6 : Nat := 1 +def u_7 : List Word := + [V, K, V, V, K, V, V, V, V, V, V, V, V, K, V, V, K, V, K, V, Q, V, V, V, V, K, Q, V, V, Q, V, + V, V, Q, K, V, K, K, Q, Q, K, Q, Q, K, Q, Q, Q, Q, K, K, Q] +def tags_7 : List Nat := + [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2, 0, 3, 0, 0, 0, 1, 3, 0, 0, 3, 0, 0, 0, 3, 3, 1, 3, + 3, 5, 3, 4, 5, 5, 3, 3, 4] +def da_7 : List Word := [K, K, K, Q, K, K, K, Q, Q, Q, Q, Q, K, K, Q] +def n_7 : Nat := 1 +def u_8 : List Word := + [V, K, V, V, K, V, V, V, V, V, V, V, V, K, V, V, K, V, Q, V, V, K, V, V, V, K, V, Q, V, V, K, + V, V, V, K, Q, K, V, Q, K, V, Q, V, V, V, Q, K, V, K, K, K, Q, K, K, K, Q, Q, Q, Q, Q, K, K, Q] +def tags_8 : List Nat := + [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0, 1, 0, 0, 1, 0, 3, 0, 1, 0, 0, 1, 3, 3, 0, 4, + 0, 3, 0, 0, 0, 3, 3, 1, 4, 3, 5, 4, 5, 5, 3, 3, 4] +def da_8 : List Word := [K, K, Q, K, Q, K, K, K, K, K, Q, Q, K, Q, Q, Q, Q, Q, K, K, Q] +def n_8 : Nat := 1 +def u_9 : List Word := + [V, K, V, V, K, V, V, V, V, V, V, V, V, K, V, V, K, V, V, K, V, K, V, V, V, K, V, V, K, V, K, + V, V, V, K, V, Q, K, V, V, V, K, V, V, V, K, Q, K, V, V, K, V, V, V, V, Q, K, V, K, K, Q, K, + Q, K, K, K, K, K, Q, Q, K, Q, Q, Q, Q, Q, K, K, Q] +def tags_9 : List Nat := + [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 2, 0, 0, 1, 0, 1, 2, 0, 0, 1, 0, 3, 3, 0, 0, 1, + 0, 0, 1, 3, 3, 0, 1, 0, 0, 0, 0, 3, 3, 1, 4, 3, 3, 5, 3, 3, 3, 5, 4, 5, 5, 3, 3, 4] +def da_9 : List Word := [K, K, Q, K, Q, K, Q, K, K, K, Q, Q, K, Q, Q, Q, Q, Q, K, K, Q] +def n_9 : Nat := 1 +def u_10 : List Word := + [V, K, V, V, K, V, V, V, V, V, V, V, V, K, V, V, K, V, V, K, V, Q, V, V, V, K, V, V, K, V, Q, + V, V, V, K, V, V, K, K, V, V, K, V, V, V, K, V, Q, K, V, K, V, V, V, V, V, K, Q, K, V, V, K, + K, V, Q, K, K, V, V, V, V, Q, K, V, K, K, Q, K, Q, K, Q, K, K, K, Q, Q, K, Q, Q, Q, Q, Q, K, + K, Q] +def tags_10 : List Nat := + [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 3, 0, 0, 1, 0, 1, 0, 3, 0, 0, 1, 0, 0, 5, 0, + 1, 0, 0, 1, 0, 3, 3, 1, 0, 0, 0, 0, 1, 3, 3, 0, 0, 5, 0, 4, 3, 0, 0, 0, 0, 3, 3, 1, 4, 3, 4, + 5, 3, 3, 3, 3, 5, 5, 5, 3, 3, 4] +def da_10 : List Word := + [K, Q, K, Q, Q, Q, Q, K, K, Q, Q, Q, Q, K, Q, Q, Q, K, Q, Q, Q, K, Q, Q, Q, Q, Q, K, K, Q] +def n_10 : Nat := 1 +def u_11 : List Word := + [V, K, V, V, K, V, V, V, V, V, V, V, V, K, V, V, K, V, V, K, V, V, K, V, V, K, V, V, K, V, V, + K, V, V, K, V, V, V, V, V, K, V, V, V, K, V, V, K, K, K, V, V, V, V, V, K, V, Q, K, V, V, V, + V, V, K, V, V, V, V, K, Q, K, V, V, K, V, V, Q, Q, K, K, V, V, V, Q, K, V, K, Q, K, Q, Q, Q, + Q, K, K, Q, Q, Q, Q, K, Q, Q, Q, K, Q, Q, Q, K, Q, Q, Q, Q, Q, K, K, Q] +def tags_11 : List Nat := + [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, + 0, 1, 0, 1, 5, 0, 0, 0, 0, 1, 0, 3, 3, 0, 0, 0, 0, 1, 0, 0, 0, 1, 3, 3, 0, 1, 0, 0, 4, 4, 0, + 0, 0, 3, 3, 0, 5, 5, 5, 4, 3, 5, 5, 4, 5, 4, 5, 4, 5, 5, 3, 3, 4] +def da_11 : List Word := + [K, K, Q, K, Q, K, Q, Q, K, Q, Q, K, K, Q, Q, Q, Q, K, Q, Q, K, Q, Q, Q, K, Q, K, Q, K, Q, K, + Q, Q, Q, K, K, K, K, K, K, K, K, Q, Q, Q, Q, Q, Q, K, K, Q] +def n_11 : Nat := 1 +def u_12 : List Word := + [V, K, V, V, K, V, V, V, V, V, V, V, V, K, V, V, K, V, V, K, V, V, K, V, V, K, V, V, K, V, V, + K, V, V, K, V, V, V, V, V, K, V, V, V, K, V, V, K, V, V, V, V, V, V, K, V, V, K, K, V, V, V, + V, K, V, V, V, V, K, V, Q, K, V, K, V, V, V, V, V, V, V, V, K, Q, V, V, V, V, V, K, V, V, V, + V, V, V, V, V, V, Q, K, V, K, K, Q, K, Q, K, Q, Q, K, Q, Q, K, K, Q, Q, Q, Q, K, Q, Q, K, Q, + Q, Q, K, Q, K, Q, K, Q, K, Q, Q, Q, K, K, K, K, K, K, K, K, Q, Q, Q, Q, Q, Q, K, K, Q] +def tags_12 : List Nat := + [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, + 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 5, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 3, 1, 0, 0, 0, 0, 0, 0, + 0, 1, 3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 1, 4, 4, 3, 5, 3, 5, 4, 5, 5, 3, 3, + 3, 5, 5, 4, 4, 4, 4, 5, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 3, 3, 4] +def da_12 : List Word := + [K, Q, Q, K, Q, K, Q, Q, Q, Q, K, Q, Q, Q, Q, K, Q, Q, Q, Q, K, K, K, Q, Q, K, K, K, Q, Q, Q, + Q, Q, K, K, Q, K, Q, Q, Q, K, K, K, K, K, K, K, K, Q, Q, Q, Q, Q, Q, K, K, Q] +def n_12 : Nat := 1 +def u_13 : List Word := + [V, K, V, V, K, V, V, V, V, V, V, V, V, K, V, V, K, V, V, K, V, V, K, V, V, K, V, V, K, V, V, + K, V, V, K, V, V, V, V, V, K, V, V, V, K, V, V, K, V, V, V, V, V, V, K, V, V, V, V, V, V, V, + K, V, V, V, V, K, V, V, K, K, K, V, V, V, V, V, V, V, V, K, V, Q, V, V, V, V, K, V, V, V, V, + V, V, V, V, V, V, K, Q, K, V, V, V, K, V, Q, V, V, V, V, Q, K, Q, V, V, V, V, V, V, V, Q, Q, + K, K, K, Q, Q, Q, V, V, V, Q, K, V, K, Q, Q, K, Q, K, Q, Q, Q, Q, K, Q, Q, Q, Q, K, Q, Q, Q, + Q, K, K, K, Q, Q, K, K, K, Q, Q, Q, Q, Q, K, K, Q, K, Q, Q, Q, K, K, K, K, K, K, K, K, Q, Q, + Q, Q, Q, Q, K, K, Q] +def tags_13 : List Nat := + [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, + 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 5, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 3, 0, 0, 1, 0, 3, 0, 0, 0, 0, 3, 4, 0, + 0, 0, 0, 0, 0, 0, 4, 3, 3, 3, 5, 3, 0, 0, 0, 3, 3, 0, 5, 3, 3, 5, 5, 5, 4, 5, 4, 5, 5, 3, 3, + 3, 5, 3, 3, 4, 5, 5, 3, 4, 4, 5, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 3, 3, 4] +def da_13 : List Word := + [K, Q, Q, Q, K, Q, K, Q, Q, Q, K, Q, Q, Q, K, Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, K, Q, Q, Q, Q, + Q, K, Q, K, Q, Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, K, K, Q, K, Q, Q, Q, K, K, K, K, K, K, K, + K, Q, Q, Q, Q, Q, Q, K, K, Q] +def n_13 : Nat := 1 +def u_14 : List Word := + [V, K, V, V, K, V, V, V, V, V, V, V, V, K, V, V, K, V, V, K, V, V, K, V, V, K, V, V, K, V, V, + K, V, V, K, V, V, V, V, V, K, V, V, V, K, V, V, K, V, V, V, V, V, V, K, V, V, V, V, V, V, V, + K, V, V, V, V, K, V, V, K, V, V, V, V, V, V, V, V, V, K, V, V, K, V, V, V, K, V, V, V, V, V, + V, V, V, V, V, K, V, Q, K, V, V, K, V, V, K, V, V, V, V, K, V, V, V, V, V, V, V, V, V, K, Q, + K, V, Q, V, V, V, K, Q, V, V, Q, Q, V, V, V, V, V, V, V, V, Q, K, Q, V, Q, K, V, V, V, Q, V, + V, V, Q, Q, K, K, K, K, K, Q, V, V, V, Q, K, V, K, Q, Q, Q, K, Q, K, Q, Q, Q, K, Q, Q, Q, K, + Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, K, Q, Q, Q, Q, Q, K, Q, K, Q, Q, K, Q, Q, Q, Q, Q, K, Q, Q, + Q, Q, K, K, Q, K, Q, Q, Q, K, K, K, K, K, K, K, K, Q, Q, Q, Q, Q, Q, K, K, Q] +def tags_14 : List Nat := + [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, + 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 3, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 3, 3, 0, 3, 0, 0, 1, 3, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 4, 0, 0, 0, + 3, 0, 0, 0, 4, 4, 4, 4, 0, 0, 0, 3, 3, 0, 5, 3, 3, 4, 5, 5, 4, 5, 3, 3, 5, 5, 5, 4, 5, 4, 5, + 5, 4, 3, 5, 4, 5, 5, 3, 5, 5, 3, 4, 4, 5, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 3, 3, 4] +def da_14 : List Word := + [K, Q, Q, Q, K, K, Q, Q, Q, Q, K, K, K, K, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, + Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, K, Q, Q, K, K, Q, K, Q, Q, Q, Q, Q, Q, K, Q, K, K, Q, Q, Q, + Q, Q, Q, Q, K, K, Q, Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, K, K, Q, K, Q, Q, Q, K, K, K, K, K, + K, K, K, Q, Q, Q, Q, Q, Q, K, K, Q] +def n_14 : Nat := 1 +def u_15 : List Word := + [V, K, V, V, K, V, V, V, V, V, V, V, V, K, V, V, K, V, V, K, V, V, K, V, V, K, V, V, K, V, V, + K, V, V, K, V, V, V, V, V, K, V, V, V, K, V, V, K, V, V, V, V, V, V, K, V, V, V, V, V, V, V, + K, V, V, V, V, K, V, V, K, V, V, V, V, V, V, V, V, V, K, V, V, K, V, V, V, K, V, V, V, V, V, + V, V, V, V, V, K, V, V, K, K, V, K, V, V, K, V, V, V, V, K, V, V, V, V, V, V, V, V, V, K, V, + Q, K, V, K, V, V, K, V, Q, V, V, V, V, V, V, V, V, V, V, V, K, V, V, V, V, V, V, K, V, V, V, + V, V, V, V, V, V, V, K, Q, V, V, Q, Q, V, V, V, V, V, Q, Q, V, V, V, V, V, V, V, V, V, K, V, + V, V, V, Q, V, V, Q, V, V, V, Q, Q, K, K, K, K, Q, K, V, V, V, Q, K, V, K, Q, Q, Q, K, K, Q, + Q, Q, Q, K, K, K, K, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, + K, Q, Q, Q, K, Q, Q, K, K, Q, K, Q, Q, Q, Q, Q, Q, K, Q, K, K, Q, Q, Q, Q, Q, Q, Q, K, K, Q, + Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, K, K, Q, K, Q, Q, Q, K, K, K, K, K, K, K, K, Q, Q, Q, Q, + Q, Q, K, K, Q] +def tags_15 : List Nat := + [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, + 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 5, 2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 3, 3, 1, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 4, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 3, 0, 0, 3, 0, 0, 0, 4, 3, 5, 4, 3, 0, 0, 0, 3, 3, 0, 5, 3, 4, 4, 5, 4, 3, 4, 5, 5, 5, 3, 5, + 5, 4, 5, 5, 5, 5, 4, 3, 5, 5, 3, 5, 3, 4, 3, 5, 5, 5, 4, 3, 4, 5, 5, 5, 3, 3, 5, 4, 5, 5, 3, + 5, 5, 3, 4, 4, 5, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 3, 3, 4] +def da_15 : List Word := + [K, Q, K, Q, K, Q, K, Q, K, Q, Q, K, Q, Q, K, Q, K, K, K, K, Q, Q, K, K, Q, Q, K, K, Q, Q, K, + Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, K, Q, + Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, K, Q, Q, K, K, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, + Q, K, Q, K, K, Q, Q, Q, Q, Q, Q, Q, K, K, Q, Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, K, K, Q, K, + Q, Q, Q, K, K, K, K, K, K, K, K, Q, Q, Q, Q, Q, Q, K, K, Q] +def n_15 : Nat := 1 +def u_16 : List Word := + [V, K, V, V, K, V, V, V, V, V, V, V, V, K, V, V, K, V, V, K, V, V, K, V, V, K, V, V, K, V, V, + K, V, V, K, V, V, V, V, V, K, V, V, V, K, V, V, K, V, V, V, V, V, V, K, V, V, V, V, V, V, V, + K, V, V, V, V, K, V, V, K, V, V, V, V, V, V, V, V, V, K, V, V, K, V, V, V, K, V, V, V, V, V, + V, V, V, V, V, K, V, V, V, V, Q, V, V, K, V, V, V, V, K, V, V, V, V, V, V, V, V, V, K, V, V, + K, K, K, V, V, K, V, V, K, V, V, V, V, V, V, V, V, V, V, K, V, V, V, V, V, V, K, V, V, V, V, + V, V, V, V, V, V, K, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, K, V, V, V, V, + V, K, V, V, K, V, V, V, V, K, V, V, K, V, V, V, K, Q, V, V, Q, V, V, V, V, K, V, V, V, V, Q, + V, V, V, V, V, V, V, V, K, V, V, Q, V, Q, V, K, V, V, V, V, K, V, V, V, V, Q, K, V, V, V, V, + Q, V, V, Q, V, V, V, Q, Q, K, K, K, K, Q, K, V, V, V, Q, K, V, K, Q, K, Q, K, Q, K, Q, K, Q, + Q, K, Q, Q, K, Q, K, K, K, K, Q, Q, K, K, Q, Q, K, K, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, + Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, + Q, K, Q, Q, Q, Q, K, Q, Q, K, K, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, K, K, Q, Q, Q, Q, Q, + Q, Q, K, K, Q, Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, K, K, Q, K, Q, Q, Q, K, K, K, K, K, K, K, + K, Q, Q, Q, Q, Q, Q, K, K, Q] +def tags_16 : List Nat := + [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, + 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 5, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, + 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 3, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 3, 0, 3, 1, 0, 0, 0, 1, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 3, 0, 0, 3, 0, 0, 0, 4, 3, 5, + 3, 5, 0, 0, 0, 3, 3, 0, 5, 5, 4, 3, 4, 5, 3, 5, 5, 3, 3, 3, 3, 3, 5, 3, 5, 3, 3, 5, 3, 5, 5, + 5, 5, 5, 5, 5, 5, 4, 5, 5, 5, 3, 5, 5, 3, 5, 5, 5, 5, 5, 5, 3, 5, 5, 3, 5, 3, 3, 3, 4, 5, 5, + 5, 5, 4, 3, 4, 5, 5, 5, 3, 3, 5, 4, 5, 5, 3, 5, 5, 3, 4, 4, 5, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, + 5, 3, 3, 4] +def da_16 : List Word := + [K, Q, K, Q, K, Q, Q, K, Q, K, Q, Q, K, K, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, K, K, Q, K, Q, K, K, + Q, Q, Q, K, K, Q, Q, K, Q, K, Q, Q, Q, Q, Q, K, Q, Q, K, Q, Q, K, Q, Q, Q, K, Q, K, K, Q, Q, + Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, + K, Q, Q, Q, Q, Q, Q, Q, Q, K, K, K, Q, K, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, K, K, Q, Q, K, Q, Q, + Q, Q, Q, Q, Q, Q, K, Q, K, K, Q, Q, Q, Q, Q, Q, Q, K, K, Q, Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, + Q, K, K, Q, K, Q, Q, Q, K, K, K, K, K, K, K, K, Q, Q, Q, Q, Q, Q, K, K, Q] +def n_16 : Nat := 1 +def u_17 : List Word := + [V, K, V, V, K, V, V, V, V, V, V, V, V, K, V, V, K, V, V, K, V, V, K, V, V, K, V, V, K, V, V, + K, V, V, K, V, V, V, V, V, K, V, V, V, K, V, V, K, V, V, V, V, V, V, K, V, V, V, V, V, V, V, + K, V, V, V, V, K, V, V, K, V, V, V, V, V, V, V, V, V, K, V, V, K, V, V, V, K, V, V, V, V, V, + V, V, V, V, V, K, V, V, V, V, V, K, V, K, V, V, V, V, K, V, V, V, V, V, V, V, V, V, K, V, V, + K, V, V, V, K, V, V, K, V, V, V, V, V, V, V, V, V, V, K, V, V, V, V, V, V, K, V, V, V, V, V, + V, V, V, V, V, K, V, V, K, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, K, V, V, V, V, V, + K, V, V, K, V, V, V, V, K, V, V, K, V, V, V, K, V, Q, V, V, K, V, V, V, K, V, V, V, V, V, K, + V, V, V, V, V, V, V, K, V, V, V, K, V, K, K, V, V, V, V, K, V, V, V, V, V, K, Q, V, V, V, V, + K, V, V, K, V, V, V, V, K, V, Q, V, V, V, V, K, Q, V, V, V, V, K, V, V, Q, V, V, Q, K, K, K, + Q, V, Q, V, Q, K, V, Q, V, V, V, V, V, V, V, V, V, V, V, V, Q, V, V, Q, V, V, V, V, V, V, Q, + V, V, Q, V, Q, Q, K, V, V, V, V, V, V, K, V, V, V, V, Q, K, V, V, V, V, Q, V, V, Q, V, V, V, + Q, Q, K, K, K, K, Q, K, V, V, V, Q, K, V, K, Q, K, Q, K, Q, Q, K, Q, K, Q, Q, K, K, Q, K, Q, + Q, Q, Q, Q, Q, Q, Q, K, K, Q, K, Q, K, K, Q, Q, Q, K, K, Q, Q, K, Q, K, Q, Q, Q, Q, Q, K, Q, + Q, K, Q, Q, K, Q, Q, Q, K, Q, K, K, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, + Q, K, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, K, K, K, Q, K, Q, Q, Q, + Q, Q, Q, Q, K, Q, Q, K, K, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, K, K, Q, Q, Q, Q, Q, Q, Q, + K, K, Q, Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, K, K, Q, K, Q, Q, Q, K, K, K, K, K, K, K, K, Q, + Q, Q, Q, Q, Q, K, K, Q] + +def head103 : List Word := + [V, K, V, V, K, V, V, V, V, V, V, V, V, K, V, V, K, V, V, K, V, V, K, V, V, K, V, V, K, V, V, + K, V, V, K, V, V, V, V, V, K, V, V, V, K, V, V, K, V, V, V, V, V, V, K, V, V, V, V, V, V, V, + K, V, V, V, V, K, V, V, K, V, V, V, V, V, V, V, V, V, K, V, V, K, V, V, V, K, V, V, V, V, V, + V, V, V, V, V, K, V, V, V, V] +def tags_head103 : List Nat := + [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, + 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0] +def v_head103 : List Word := + [K, V, V, K, V, V, V, V, V, V, V, V, K, V, V, K, V, V, K, V, V, K, V, V, K, V, V, K, V, V, K, + V, V, K, V, V, V, V, V, K, V, V, V, K, V, V, K, V, V, V, V, V, V, K, V, V, V, V, V, V, V, K, + V, V, V, V, K, V, V, K, V, V, V, V, V, V, V, V, V, K, V, V, K, V, V, V, K, V, V, V, V, V, V, + V, V, V, V, K, V, V, V, V, V] +def a_103 : Nat := 2305843009213693951 +def b_103 : Nat := 5746657428456234994 +def A_top58 : Nat := 179583044639257343 + +def s36 : List Word := + [V, V, V, V, K, V, V, V, V, Q, K, V, V, V, V, Q, V, V, Q, V, V, V, Q, Q, K, K, K, K, Q, K, V, + V, V, Q, K, V] +def s40 : List Word := s36 ++ [K, Q, K, Q] +def tags_s40 : List Nat := + [0, 0, 0, 1, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 3, 0, 0, 3, 0, 0, 0, 4, 3, 5, 3, 5, 0, 0, 0, 3, 3, + 0, 5, 5] +def v_s40 : List Word := + [V, V, V, K, V, V, V, V, V, K, Q, V, V, V, V, K, V, V, K, V, V, V, V, K, V, Q, V, V, V, V, K, + Q, V, V, V] + +def top56 : List Word := + [Q, Q, Q, Q, Q, Q, K, Q, K, K, Q, Q, Q, Q, Q, Q, Q, K, K, Q, Q, K, Q, Q, Q, Q, Q, K, Q, Q, Q, + Q, K, K, Q, K, Q, Q, Q, K, K, K, K, K, K, K, K, Q, Q, Q, Q, Q, Q, K, K, Q] +def top57 : List Word := top56 ++ [K] +def tags_top57 : List Nat := + [5, 5, 5, 4, 3, 4, 5, 5, 5, 3, 3, 5, 4, 5, 5, 3, 5, 5, 3, 4, 4, 5, 3, 3, 3, 3, 3, 3, 3, 3, 5, + 5, 5, 3, 3, 4] + +def p_103_init : List Word := + [V, K, V, K, V, V, V, V, K, V, V, V, V, V, V, V, V, V, K, V, V, K, V, V, V, K, V, V, K, V, V, + V, V, V, V, V, V, V, V, K, V, V, V, V, V, V, K, V, V, V, V, V, V, V, V, V, V, K, V, V, K, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, K, V, V, V, V, V, K, V, V, K, V, V, V, V, K, V, + V, K, V, V, V, K, V, Q, V, V, K, V, V, V, K, V, V, V, V, V, K, V, V, V, V, V, V, V, K, V, V, + V, K, V, K, K, V, V, V, V, K, V, V, V, V, V, K, Q, V, V, V, V, K, V, V, K, V, V, V, V, K, V, + Q, V, V, V, V, K, Q, V, V, V, V, K, V, V, Q, V, V, Q, K, K, K, Q, V, Q, V, Q, K, V, Q, V, V, + V, V, V, V, V, V, V, V, V, V, Q, V, V, Q, V, V, V, V, V, V, Q, V, V, Q, V, Q, Q, K, V, V] +def ds_core_init : List Word := + [Q, K, Q, K, Q, Q, K, K, Q, K, Q, Q, Q, Q, Q, Q, Q, Q, K, K, Q, K, Q, K, K, Q, Q, Q, K, K, Q, + Q, K, Q, K, Q, Q, Q, Q, Q, K, Q, Q, K, Q, Q, K, Q, Q, Q, K, Q, K, K, Q, Q, Q, K, Q, Q, Q, Q, + Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, Q, Q, K, Q, Q, Q, Q, Q, + Q, Q, Q, K, K, K, Q, K, Q, Q, Q, Q, Q, Q, Q, K, Q, Q, K, K, Q, Q, K] +def A_core_init : Nat := 33423588619483026965005715444596021 + + +set_option maxRecDepth 200000 in +theorem step_0 : Step u_0 u_1 := checkStep_sound n_0 tags_0 u_0 da_0 u_1 (by decide) +set_option maxRecDepth 200000 in +theorem step_1 : Step u_1 u_2 := checkStep_sound n_1 tags_1 u_1 da_1 u_2 (by decide) +set_option maxRecDepth 200000 in +theorem step_2 : Step u_2 u_3 := checkStep_sound n_2 tags_2 u_2 da_2 u_3 (by decide) +set_option maxRecDepth 200000 in +theorem step_3 : Step u_3 u_4 := checkStep_sound n_3 tags_3 u_3 da_3 u_4 (by decide) +set_option maxRecDepth 200000 in +theorem step_4 : Step u_4 u_5 := checkStep_sound n_4 tags_4 u_4 da_4 u_5 (by decide) +set_option maxRecDepth 200000 in +theorem step_5 : Step u_5 u_6 := checkStep_sound n_5 tags_5 u_5 da_5 u_6 (by decide) +set_option maxRecDepth 200000 in +theorem step_6 : Step u_6 u_7 := checkStep_sound n_6 tags_6 u_6 da_6 u_7 (by decide) +set_option maxRecDepth 200000 in +theorem step_7 : Step u_7 u_8 := checkStep_sound n_7 tags_7 u_7 da_7 u_8 (by decide) +set_option maxRecDepth 200000 in +theorem step_8 : Step u_8 u_9 := checkStep_sound n_8 tags_8 u_8 da_8 u_9 (by decide) +set_option maxRecDepth 200000 in +theorem step_9 : Step u_9 u_10 := checkStep_sound n_9 tags_9 u_9 da_9 u_10 (by decide) +set_option maxRecDepth 200000 in +theorem step_10 : Step u_10 u_11 := checkStep_sound n_10 tags_10 u_10 da_10 u_11 (by decide) +set_option maxRecDepth 200000 in +theorem step_11 : Step u_11 u_12 := checkStep_sound n_11 tags_11 u_11 da_11 u_12 (by decide) +set_option maxRecDepth 200000 in +theorem step_12 : Step u_12 u_13 := checkStep_sound n_12 tags_12 u_12 da_12 u_13 (by decide) +set_option maxRecDepth 200000 in +theorem step_13 : Step u_13 u_14 := checkStep_sound n_13 tags_13 u_13 da_13 u_14 (by decide) +set_option maxRecDepth 200000 in +theorem step_14 : Step u_14 u_15 := checkStep_sound n_14 tags_14 u_14 da_14 u_15 (by decide) +set_option maxRecDepth 200000 in +theorem step_15 : Step u_15 u_16 := checkStep_sound n_15 tags_15 u_15 da_15 u_16 (by decide) +set_option maxRecDepth 200000 in +theorem step_16 : Step u_16 u_17 := checkStep_sound n_16 tags_16 u_16 da_16 u_17 (by decide) + +theorem rounds_0_17 : Rounds u_0 u_17 := + Rounds.next step_0 (Rounds.next step_1 (Rounds.next step_2 (Rounds.next step_3 (Rounds.next + step_4 (Rounds.next step_5 (Rounds.next step_6 (Rounds.next step_7 (Rounds.next step_8 + (Rounds.next step_9 (Rounds.next step_10 (Rounds.next step_11 (Rounds.next step_12 (Rounds.next + step_13 (Rounds.next step_14 (Rounds.next step_15 (Rounds.next step_16 (Rounds.refl + u_17))))))))))))))))) +-- Invariant Good u (5-piece decomposition) +abbrev Good (u : List Word) : Prop := + ∃ p_103 ds_core A_core m, + u = head103 ++ p_103 ++ s36 ++ [K, Q, K, Q, K, Q] ++ ds_core ++ [Q, Q] ++ top56 ∧ + (∃ p_tail, p_103 = V :: p_tail) ∧ + m = 4 + ds_core.length ∧ + 18 <= m ∧ + DigitVal A_core (m - 4) ds_core ∧ + A_core * 32 <= 17 * 2 ^ (m - 4) ∧ + wordScale p_103 * ((2 ^ m : Nat) : Rat) = 256 ∧ + wordPot p_103 <= 13 / 4 + +set_option maxRecDepth 200000 in +theorem good_u17 : Good u_17 := by + refine ⟨p_103_init, ds_core_init, A_core_init, 120, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · decide + · exact ⟨p_103_init.tail, rfl⟩ + · decide + · decide + · exact checkDg_sound A_core_init ds_core_init (by decide) + · decide + · have h := checkScalePow_sound p_103_init 120 8 (by decide) + norm_num at h + exact h + · have h := checkWordPotLe_sound p_103_init 13 4 (by decide) + norm_num at h + linarith + +-- Fixed-piece Scan lemmas +set_option maxRecDepth 200000 in +theorem Scan_head103 : Scan 0 6 head103 a_103 b_103 v_head103 0 := by + have h := checkAffineScan_sound tags_head103 0 0 0 6 head103 0 a_103 0 b_103 v_head103 0 0 0 (by + decide) + simpa using h + +theorem v_head103_eq : V :: v_head103 = head103 ++ [V] := rfl + +theorem Scan_s40 (ap bp : Nat) (hbp : 3 <= bp) : + Scan ap bp s40 (4 * ap + 4) (131072 * (bp - 3) + 105669) v_s40 5 := by + have h := checkAffineScan_sound tags_s40 1 0 1 3 s40 4 4 131072 105669 v_s40 5 ap (bp - 3) (by + decide) + have h_bp : 1 * (bp - 3) + 3 = bp := by omega + have h_ap : 1 * ap + 0 = ap := by omega + rwa [h_ap, h_bp] at h + +theorem Scan_top57 (b_top57 : Nat) (hb : 2 <= b_top57) : + Scan (2 ^ 55) b_top57 top57 0 (64 * (b_top57 - 2) + 42) s36 21 := by + have h := checkAffineScan_sound tags_top57 0 (2 ^ 55) 1 2 top57 0 0 64 42 s36 21 0 (b_top57 - 2) + (by decide) + have h_in : 1 * (b_top57 - 2) + 2 = b_top57 := by omega + dsimp at h + rwa [h_in] at h + + +-- Parse_s40_split: any Parse of s40 ++ K :: rest splits right after s40 +theorem Parse_s40_split {ap a_end g_all : Nat} {rest : List Word} + (h : Parse ap (s40 ++ K :: rest) a_end g_all) : + ∃ g_mid, Parse (4 * (ap + 1)) (K :: rest) a_end g_mid := by + change Parse ap ([V, V, V, V, K, V, V, V, V, Q, K, V, V, V, V, Q, V, V, Q, V, V, V, Q, Q, K, K, + K, K, Q, K, V, V, V, Q, K, V, K, Q, K, Q, K] ++ rest) a_end g_all at h + simp only [List.cons_append, List.nil_append] at h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + rcases Parse_VK_inv h with h | h + · -- VK at i = 3 + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + cases h with + | @D _ q1_9 _ _ _ _ _ hq1_9 h => + have hq1_9_eq : q1_9 = 64 + ap * 64 := by dsimp [dVal] at hq1_9; omega + subst hq1_9_eq + cases h with + | @D _ q1_10 _ _ _ _ _ hq1_10 h => + have hq1_10_eq : q1_10 = 32 + ap * 32 := by dsimp [dVal] at hq1_10; omega + subst hq1_10_eq + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + cases h with + | @D _ q1_15 _ _ _ _ _ hq1_15 h => + have hq1_15_eq : q1_15 = 264 + ap * 256 := by dsimp [dVal] at hq1_15; omega + subst hq1_15_eq + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + cases h with + | @D _ q1_18 _ _ _ _ _ hq1_18 h => + have hq1_18_eq : q1_18 = 530 + ap * 512 := by dsimp [dVal] at hq1_18; omega + subst hq1_18_eq + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + cases h with + | @D _ q1_22 _ _ _ _ _ hq1_22 h => + have hq1_22_eq : q1_22 = 2124 + ap * 2048 := by dsimp [dVal] at hq1_22; omega + subst hq1_22_eq + cases h with + | D _ hq1_23 _ => dsimp [dVal] at hq1_23; omega + | P _ _ hq2_23 _ => dsimp [dVal] at hq2_23; omega + | @P _ q2_22 _ _ _ _ _ _ _ hq2_22 h => + have hq2_22_eq : q2_22 = 1062 + ap * 1024 := by dsimp [dVal] at hq2_22; omega + subst hq2_22_eq + cases h with + | @D _ q1_24 _ _ _ _ _ hq1_24 h => + have hq1_24_eq : q1_24 = 531 + ap * 512 := by dsimp [dVal] at hq1_24; omega + subst hq1_24_eq + cases h with + | D _ hq1_25 _ => dsimp [dVal] at hq1_25; omega + | @P _ q2_25 _ _ _ _ _ _ _ hq2_25 h => + have hq2_25_eq : q2_25 = 132 + ap * 128 := by dsimp [dVal] at hq2_25; omega + subst hq2_25_eq + cases h with + | @D _ q1_27 _ _ _ _ _ hq1_27 h => + have hq1_27_eq : q1_27 = 66 + ap * 64 := by dsimp [dVal] at hq1_27; omega + subst hq1_27_eq + cases h with + | D _ hq1_28 _ => dsimp [dVal] at hq1_28; omega + | @P _ q2_28 _ _ _ _ _ _ _ hq2_28 h => + have hq2_28_eq : q2_28 = 16 + ap * 16 := by dsimp [dVal] at hq2_28; omega + subst hq2_28_eq + have h := Parse_VV_inv h + have h := Parse_VV_inv h + have h := Parse_VQ_inv h + cases h with + | @D _ q1_33 _ _ _ _ _ hq1_33 h => + have hq1_33_eq : q1_33 = 68 + ap * 64 := by dsimp [dVal] at hq1_33; omega + subst hq1_33_eq + cases h with + | @D _ q1_34 _ _ _ _ _ hq1_34 h => + have hq1_34_eq : q1_34 = 34 + ap * 32 := by dsimp [dVal] at hq1_34; omega + subst hq1_34_eq + rcases Parse_VK_inv h with h | h + · -- VK at i = 35 + cases h with + | D _ hq1_37 _ => dsimp [dVal] at hq1_37; omega + | @P _ q2_37 _ _ _ _ _ _ _ hq2_37 h => + have hq2_37_eq : q2_37 = 8 + ap * 8 := by + dsimp [dVal] at hq2_37; omega + subst hq2_37_eq + cases h with + | D _ hq1_39 _ => dsimp [dVal] at hq1_39; omega + | P _ _ hq2_39 _ => dsimp [dVal] at hq2_39; omega + · -- T at i = 35 + cases h with + | D _ hq1_36 _ => dsimp [dVal] at hq1_36; omega + | @P _ q2_36 _ _ _ _ _ _ _ hq2_36 h => + have hq2_36_eq : q2_36 = 17 + ap * 16 := by + dsimp [dVal] at hq2_36; omega + subst hq2_36_eq + cases h with + | D _ hq1_38 _ => dsimp [dVal] at hq1_38; omega + | @P _ q2_38 _ _ _ _ _ _ _ hq2_38 h => + have hq2_38_eq : q2_38 = 4 + ap * 4 := by + dsimp [dVal] at hq2_38; omega + subst hq2_38_eq + have h_end : 4 + ap * 4 = 4 * (ap + 1) := by omega + rw [h_end] at h + exact ⟨_, h⟩ + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + | P _ _ hq2_33 _ => dsimp [dVal] at hq2_33; omega + | @P _ q2_27 _ _ _ _ _ _ _ hq2_27 h => + have hq2_27_eq : q2_27 = 33 + ap * 32 := by dsimp [dVal] at hq2_27; omega + subst hq2_27_eq + cases h with + | D _ hq1_29 _ => dsimp [dVal] at hq1_29; omega + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + | @P _ q2_24 _ _ _ _ _ _ _ hq2_24 h => + have hq2_24_eq : q2_24 = 265 + ap * 256 := by dsimp [dVal] at hq2_24; omega + subst hq2_24_eq + cases h with + | D _ hq1_26 _ => dsimp [dVal] at hq1_26; omega + | P _ _ hq2_26 _ => dsimp [dVal] at hq2_26; omega + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + | P _ _ hq2_9 _ => dsimp [dVal] at hq2_9; omega + · -- T at i = 3 + cases h with + | D _ hq1_4 _ => dsimp [dVal] at hq1_4; omega + | P _ hw1 _ _ => exact False.elim (hw1 rfl) + +-- Section 6: Main Invariant Closure and Goal Proof +theorem digitVal_top58 : DigitVal A_top58 58 ([Q, Q] ++ top56) := + checkDg_sound A_top58 ([Q, Q] ++ top56) (by decide) + +theorem digitVal_bot6 : DigitVal 42 6 [K, Q, K, Q, K, Q] := + checkDg_sound 42 [K, Q, K, Q, K, Q] (by decide) + +theorem digitVal_mid {A_core m : Nat} {ds_core : List Word} + (hm : 18 <= m) (hD : DigitVal A_core (m - 4) ds_core) + (hA_core : A_core * 32 <= 17 * 2 ^ (m - 4)) : + ∃ A_mid, + DigitVal A_mid m ([K, Q] ++ ds_core ++ [Q, Q]) ∧ + 2 <= A_mid ∧ + A_mid <= 2 + 113 * 2 ^ (m - 7) := by + have h_kq : DigitVal 2 2 [K, Q] := checkDg_sound 2 [K, Q] (by decide) + have h_qq : DigitVal 3 2 [Q, Q] := checkDg_sound 3 [Q, Q] (by decide) + have h1 := digitVal_append h_kq hD + have h2 := digitVal_append h1 h_qq + have hlen1 : 2 + (m - 4) = m - 2 := by omega + have hlen2 : (m - 2) + 2 = m := by omega + rw [hlen1] at h2 + rw [hlen2] at h2 + have h_pow1 : 2 ^ (m - 4) = 8 * 2 ^ (m - 7) := by + have heq : m - 4 = 3 + (m - 7) := by omega + rw [heq, Nat.pow_add] + have h_pow2 : 2 ^ (m - 2) = 32 * 2 ^ (m - 7) := by + have heq : m - 2 = 5 + (m - 7) := by omega + rw [heq, Nat.pow_add] + exact ⟨2 + A_core * 4 + 3 * 2 ^ (m - 2), + by simpa [List.append_assoc] using h2, + by omega, + by omega⟩ + +theorem force_a55 {p_103 ds_mid : List Word} {ap gp m A_mid a_top g_mid : Nat} + (hm : 18 <= m) + (hP_p : Parse a_103 p_103 ap gp) + (hz13 : wordScale p_103 * ((2 ^ m : Nat) : Rat) = 256) + (hzW : wordPot p_103 <= 13 / 4) + (hD_mid : DigitVal A_mid m ds_mid) + (hA_lo : 2 <= A_mid) + (hA_hi : A_mid <= 2 + 113 * 2 ^ (m - 7)) + (hP_mid : Parse (4 * (ap + 1)) ds_mid a_top g_mid) : + a_top = 2 ^ 55 := by + rcases Parse_la hP_p with ⟨hla_lo, hla_hi⟩ + have hz12 := wordValQ_nonneg p_103 + have hz10_le := two_wordVal_add_wordValQ_le p_103 + have h_diff_hi : ((ap : Rat) + 1) * wordScale p_103 - ((a_103 : Rat) + 1) < 7 := by linarith + have h_powm_pos : (0 : Rat) < ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + have h_mul_lo : ((a_103 : Rat) + 1) * ((2 ^ m : Nat) : Rat) <= + ((ap : Rat) + 1) * (wordScale p_103 * ((2 ^ m : Nat) : Rat)) := by + nlinarith + have h_mul_hi : ((ap : Rat) + 1) * (wordScale p_103 * ((2 ^ m : Nat) : Rat)) < + (((a_103 : Rat) + 1) + 7) * ((2 ^ m : Nat) : Rat) := by + nlinarith + rw [hz13] at h_mul_lo h_mul_hi + have ha103_val : a_103 + 1 = 2 ^ 61 := by decide + have ha103_r : (a_103 : Rat) + 1 = ((2 ^ 61 : Nat) : Rat) := by exact_mod_cast ha103_val + rw [ha103_r] at h_mul_lo h_mul_hi + have h_nat_lo : 2 ^ 61 * 2 ^ m <= (ap + 1) * 256 := by exact_mod_cast h_mul_lo + have h_nat_hi : (ap + 1) * 256 < (2 ^ 61 + 7) * 2 ^ m := by exact_mod_cast h_mul_hi + have h_256 : (ap + 1) * 256 = (4 * (ap + 1)) * 64 := by ring + rw [h_256] at h_nat_lo h_nat_hi + have h_split1 : 2 ^ 61 * 2 ^ m = (2 ^ 55 * 2 ^ m) * 64 := by + have : (2 ^ 61 : Nat) = 2 ^ 55 * 64 := by decide + rw [this]; ring + have h_split2 : (2 ^ 61 + 7) * 2 ^ m = (2 ^ 55 * 2 ^ m + 7 * 2 ^ (m - 6)) * 64 := by + have h61 : (2 ^ 61 : Nat) = 2 ^ 55 * 64 := by decide + have hm6 : 2 ^ m = 2 ^ (m - 6) * 64 := by + have h6 : (64 : Nat) = 2 ^ 6 := rfl + rw [h6, <- Nat.pow_add, Nat.sub_add_cancel (by omega : 6 <= m)] + calc (2 ^ 61 + 7) * 2 ^ m + _ = 2 ^ 61 * 2 ^ m + 7 * 2 ^ m := by ring + _ = (2 ^ 55 * 64) * 2 ^ m + 7 * (2 ^ (m - 6) * 64) := by rw [h61, hm6] + _ = (2 ^ 55 * 2 ^ m + 7 * 2 ^ (m - 6)) * 64 := by ring + rw [h_split1] at h_nat_lo + rw [h_split2] at h_nat_hi + have h_pos64 : 0 < 64 := by decide + have hap_lo : 2 ^ 55 * 2 ^ m <= 4 * (ap + 1) := Nat.le_of_mul_le_mul_right h_nat_lo h_pos64 + have hap_hi : 4 * (ap + 1) < 2 ^ 55 * 2 ^ m + 7 * 2 ^ (m - 6) := + Nat.lt_of_mul_lt_mul_right h_nat_hi + have h_pow_m6 : 2 ^ (m - 6) = 2 * 2 ^ (m - 7) := by + have heq : m - 6 = 1 + (m - 7) := by omega + rw [heq, Nat.pow_add] + have h_pow_m : 2 ^ m = 128 * 2 ^ (m - 7) := by + have h7 : (128 : Nat) = 2 ^ 7 := rfl + rw [h7, <- Nat.pow_add, Nat.add_sub_of_le (by omega : 7 <= m)] + have h_pow_m7_ge : 2048 <= 2 ^ (m - 7) := by + have h11 : 11 <= m - 7 := by omega + have hle := Nat.pow_le_pow_right (by decide : 1 <= 2) h11 + simpa using hle + rcases parse_digitVal_a hP_mid hD_mid with ⟨h_atop_lo, h_atop_hi⟩ + have h_sum_lo : 2 ^ 55 * 2 ^ m < 4 * (ap + 1) + A_mid := by omega + have h_sum_hi : 4 * (ap + 1) + A_mid < (2 ^ 55 + 1) * 2 ^ m := by + have : (2 ^ 55 + 1) * 2 ^ m = 2 ^ 55 * 2 ^ m + 128 * 2 ^ (m - 7) := by + rw [Nat.add_mul, Nat.one_mul, h_pow_m] + omega + have h_pos_m : 0 < 2 ^ m := pow_two_pos m + have h_lt1 : a_top < 2 ^ 55 + 1 := Nat.lt_of_mul_lt_mul_right (lt_of_le_of_lt h_atop_lo h_sum_hi) + have h_lt2 : 2 ^ 55 < a_top + 1 := Nat.lt_of_mul_lt_mul_right (lt_trans h_sum_lo h_atop_hi) + omega + +theorem bound_b_mid0 {p_103 v_p ds_mid : List Word} + {ap bp gp m A_mid b_mid0 : Nat} + (_hm : 18 <= m) + (hS_p : Scan a_103 b_103 p_103 ap bp v_p gp) + (hbp : 3 <= bp) + (hz13 : wordScale p_103 * ((2 ^ m : Nat) : Rat) = 256) + (hzW : wordPot p_103 <= 13 / 4) + (hb_mid0 : b_mid0 = 131072 * (bp - 3) + 105669) + (hD_mid : DigitVal A_mid m ds_mid) : + 2 + 4 * wordVal ds_mid < (b_mid0 : Rat) := by + have h_delta_p := (Scan_delta hS_p).2 + have h_4wv_p := two_wordVal_add_wordValQ_le_four_wordPotV v_p + have h_cw_p := scan_wordPot_contract hS_p + have hc_b103 := (cPar_bounds b_103).2 + have h_wv_p_lt : wordPotV v_p < 4 := by linarith + have h_z13_p := scan_wordScale_eq hS_p + have h_pow_gp_ge1 : (1 : Rat) <= ((2 ^ (3 * gp) : Nat) : Rat) := by + exact_mod_cast (pow_two_pos (3 * gp)) + have h_z13_vp_pos := wordScale_pos v_p + have h_z13_vp_le : wordScale v_p <= wordScale p_103 := by nlinarith + have h_b103_big : ((2 ^ 62 : Nat) : Rat) + 18 < (b_103 : Rat) := by norm_num [b_103] + have h_bp2_pos : (0 : Rat) <= (bp : Rat) - 2 := by + have : (2 : Rat) <= (bp : Rat) := by exact_mod_cast (by omega : 2 <= bp) + linarith + have h_prod_p : ((2 ^ 62 : Nat) : Rat) < ((bp : Rat) - 2) * wordScale p_103 := by nlinarith + have h_powm_pos : (0 : Rat) < ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + have h_mul_m : ((2 ^ 62 : Nat) : Rat) * ((2 ^ m : Nat) : Rat) < + ((bp : Rat) - 2) * (wordScale p_103 * ((2 ^ m : Nat) : Rat)) := by + nlinarith + rw [hz13] at h_mul_m + have h_pow62 : ((2 ^ 62 : Nat) : Rat) = ((2 ^ 54 : Nat) : Rat) * 256 := by norm_num + rw [h_pow62] at h_mul_m + have h_bp2_gt : ((2 ^ 54 : Nat) : Rat) * ((2 ^ m : Nat) : Rat) < (bp : Rat) - 2 := by linarith + have h_bmid0_r : (b_mid0 : Rat) = 131072 * ((bp : Rat) - 3) + 105669 := by + rw [hb_mid0, Nat.cast_add, Nat.cast_mul, Nat.cast_sub hbp]; push_cast; ring + have h_z10_mid := (digitVal_scale_and_val hD_mid).2 + have h_pow54_val : ((2 ^ 54 : Nat) : Rat) = 18014398509481984 := by norm_num + have h_powm_ge1 : (1 : Rat) <= ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + rw [h_z10_mid, h_bmid0_r] + rw [h_pow54_val] at h_bp2_gt + linarith + +theorem bound_wordPot_p103' {p_103 v_p ds_mid v_mid : List Word} + {ap bp gp m A_mid b_mid0 b_top57 g_mid : Nat} + (hm : 18 <= m) + (hS_p : Scan a_103 b_103 p_103 ap bp v_p gp) + (hz13 : wordScale p_103 * ((2 ^ m : Nat) : Rat) = 256) + (hzW : wordPot p_103 <= 13 / 4) + (hD_mid : DigitVal A_mid m ds_mid) + (hS_mid : Scan (4 * (ap + 1)) b_mid0 ds_mid (2 ^ 55) b_top57 v_mid g_mid) : + wordPotV (v_p ++ v_s40 ++ v_mid) <= 13 / 4 := by + -- Step A: wordPotV v_p <= 207 / 64 + have h_cw_p := scan_wordPot_contract hS_p + have hc_b103 : cPar b_103 = 3 / 16 := by + unfold cPar + have hmod : b_103 % 2 = 0 := by decide + rw [hmod]; rfl + rw [hc_b103] at h_cw_p + have hA : wordPotV v_p <= 207 / 64 := by linarith + -- wordScale bounds + have h_z13_p := scan_wordScale_eq hS_p + have h_z13_s40 : wordScale v_s40 = 1 / 131072 := by + have h := checkScalePow_sound v_s40 17 0 (by decide) + norm_num at h + linarith + have h_wv_s40 : wordPotV v_s40 <= 1 / 4 := by + have h := checkWordPotVLe_sound v_s40 1 4 (by decide) + norm_num at h + linarith + -- Step B: wordScale v_p * wordPotV v_s40 <= 1 / 4096 + have h_powm_ge18 : (2 ^ 18 : Nat) <= 2 ^ m := Nat.pow_le_pow_right (by decide) hm + have h_powm_r : ((2 ^ 18 : Nat) : Rat) <= ((2 ^ m : Nat) : Rat) := by exact_mod_cast h_powm_ge18 + have h_z13_p_le : wordScale p_103 <= 1 / 1024 := by + have h_pos_p := wordScale_pos p_103 + have h_mul := mul_le_mul_of_nonneg_left h_powm_r (le_of_lt h_pos_p) + rw [hz13] at h_mul + norm_num at h_mul + linarith + have h_pow_gp_ge1 : (1 : Rat) <= ((2 ^ (3 * gp) : Nat) : Rat) := by + exact_mod_cast (pow_two_pos (3 * gp)) + have h_z13_vp_pos := wordScale_pos v_p + have h_z13_vp_le : wordScale v_p <= 1 / 1024 := by nlinarith + have hB : wordScale v_p * wordPotV v_s40 <= 1 / 4096 := by + have h_wv_nn := wordPotV_nonneg v_s40 + nlinarith + -- Step C: wordScale (v_p ++ v_s40) * wordPotV v_mid <= 1 / 512 + have h_dc_eq := digitVal_scan_dCount hS_mid hD_mid + have h_wv_mid_dc := (dCount_bound v_mid).2 + have h_vp_m : wordScale v_p * ((2 ^ m : Nat) : Rat) <= 256 := by + have h_eq : wordScale v_p * ((2 ^ m : Nat) : Rat) * ((2 ^ (3 * gp) : Nat) : Rat) = 256 := by + calc wordScale v_p * ((2 ^ m : Nat) : Rat) * ((2 ^ (3 * gp) : Nat) : Rat) + _ = (wordScale v_p * ((2 ^ (3 * gp) : Nat) : Rat)) * ((2 ^ m : Nat) : Rat) := by ring + _ = wordScale p_103 * ((2 ^ m : Nat) : Rat) := by rw [h_z13_p] + _ = 256 := hz13 + have h_pos_m : (0 : Rat) < ((2 ^ m : Nat) : Rat) := by exact_mod_cast (pow_two_pos m) + have h_nn : 0 <= wordScale v_p * ((2 ^ m : Nat) : Rat) := + mul_nonneg (le_of_lt h_z13_vp_pos) (le_of_lt h_pos_m) + nlinarith + have h_prod_ps : wordScale v_p * wordScale v_s40 * ((2 ^ m : Nat) : Rat) <= 1 / 512 := by + rw [h_z13_s40] + linarith + have hC : wordScale (v_p ++ v_s40) * wordPotV v_mid <= 1 / 512 := by + rw [wordScale_append] + have h_wv_mid_le : wordPotV v_mid <= ((2 ^ m : Nat) : Rat) := by + have h_dc_le_m : 2 ^ (dCount v_mid) <= 2 ^ m := Nat.pow_le_pow_right (by decide) (by omega) + have h_dc_r : ((2 ^ (dCount v_mid) : Nat) : Rat) <= ((2 ^ m : Nat) : Rat) := by + exact_mod_cast h_dc_le_m + linarith + have h_wv_mid_nn := wordPotV_nonneg v_mid + have h_z13_ps_pos : 0 < wordScale v_p * wordScale v_s40 := + mul_pos h_z13_vp_pos (wordScale_pos v_s40) + nlinarith + -- Combine A + B + C + have h_app1 := wordPotV_append_le v_p v_s40 + have h_app2 := wordPotV_append_le (v_p ++ v_s40) v_mid + linarith + +theorem bound_b_end_digitVal {w_103 v_w103 : List Word} {b_top57 g_w103 k : Nat} + (_hk : 9 <= k) + (hb_top57 : 2 <= b_top57) + (hS_w : Scan a_103 b_103 w_103 (2 ^ 55) b_top57 v_w103 g_w103) + (hz13_vw : wordScale v_w103 * ((2 ^ k : Nat) : Rat) = 1) + (hWV_vw : wordPotV v_w103 <= 13 / 4) : + ∃ A_core' ds_core', + DigitVal A_core' (k + 5) ds_core' ∧ + ds_core'.length = k + 5 ∧ + A_core' * 32 <= 17 * 2 ^ (k + 5) ∧ + DigitVal (64 * (b_top57 - 2) + 42) (k + 69) + ([K, Q, K, Q, K, Q] ++ ds_core' ++ [Q, Q] ++ top56) := by + rcases Scan_delta hS_w with ⟨hd_lo, hd_hi⟩ + have h_4wv := two_wordVal_add_wordValQ_le_four_wordPotV v_w103 + have hd_hi' : ((b_103 : Rat) - 2) - ((b_top57 : Rat) - 2) * wordScale v_w103 <= 13 := by linarith + have h_powk_pos : (0 : Rat) < ((2 ^ k : Nat) : Rat) := by exact_mod_cast (pow_two_pos k) + have h_mul_lo : (((b_103 : Rat) - 2) - 13) * ((2 ^ k : Nat) : Rat) <= + ((b_top57 : Rat) - 2) * (wordScale v_w103 * ((2 ^ k : Nat) : Rat)) := by + nlinarith + have h_mul_hi : ((b_top57 : Rat) - 2) * (wordScale v_w103 * ((2 ^ k : Nat) : Rat)) <= + ((b_103 : Rat) - 1) * ((2 ^ k : Nat) : Rat) := by + nlinarith + rw [hz13_vw, mul_one] at h_mul_lo h_mul_hi + have hb103_r : (b_103 : Rat) - 2 = (A_top58 : Rat) * 32 + 16 := by norm_num [b_103, A_top58] + have hb103_1_r : (b_103 : Rat) - 1 = (A_top58 : Rat) * 32 + 17 := by norm_num [b_103, A_top58] + rw [hb103_r] at h_mul_lo + rw [hb103_1_r] at h_mul_hi + let b_end := 64 * (b_top57 - 2) + 42 + have hb_end_r : (b_end : Rat) = 64 * ((b_top57 : Rat) - 2) + 42 := by + dsimp [b_end] + rw [Nat.cast_add, Nat.cast_mul, Nat.cast_sub hb_top57] + push_cast; ring + have h_pow_k11 : ((2 ^ (k + 11) : Nat) : Rat) = 2048 * ((2 ^ k : Nat) : Rat) := by + have h11 : ((2 ^ 11 : Nat) : Rat) = 2048 := by norm_num + rw [Nat.pow_add, Nat.cast_mul, h11]; ring + have h_powk_ge1 : (1 : Rat) <= ((2 ^ k : Nat) : Rat) := by exact_mod_cast (pow_two_pos k) + have h_bend_lo_r : (A_top58 : Rat) * ((2 ^ (k + 11) : Nat) : Rat) < (b_end : Rat) := by + rw [hb_end_r, h_pow_k11]; linarith + have h_bend_mid_r : (b_end : Rat) <= + (A_top58 : Rat) * ((2 ^ (k + 11) : Nat) : Rat) + 64 * 17 * ((2 ^ k : Nat) : Rat) + 42 := by + rw [hb_end_r, h_pow_k11]; linarith + have h_bend_hi_r : (b_end : Rat) < ((A_top58 : Rat) + 1) * ((2 ^ (k + 11) : Nat) : Rat) := by + rw [hb_end_r, h_pow_k11]; linarith + have h_bend_lo : A_top58 * 2 ^ (k + 11) < b_end := by exact_mod_cast h_bend_lo_r + have h_bend_mid : b_end <= A_top58 * 2 ^ (k + 11) + 64 * 17 * 2 ^ k + 42 := by + exact_mod_cast h_bend_mid_r + have h_bend_hi : b_end < (A_top58 + 1) * 2 ^ (k + 11) := by exact_mod_cast h_bend_hi_r + have h_bend_mod64 : b_end % 64 = 42 := by dsimp [b_end]; omega + let A_core' := (b_end / 64) % (2 ^ (k + 5)) + have h_Acore'_lt : A_core' < 2 ^ (k + 5) := Nat.mod_lt _ (pow_two_pos (k + 5)) + rcases exists_digitVal_of_lt_pow (k + 5) A_core' h_Acore'_lt with ⟨ds_core', hD_core'⟩ + have h_len_core' := length_of_digitVal hD_core' + have h_bot_mid := digitVal_append digitVal_bot6 hD_core' + have h_all := digitVal_append h_bot_mid digitVal_top58 + have h_len_all : (6 + (k + 5)) + 58 = k + 69 := by omega + have h_pow_k11_eq : 2 ^ (k + 11) = 64 * 2 ^ (k + 5) := by + have : k + 11 = 6 + (k + 5) := by omega + rw [this, Nat.pow_add] + have h_div_top : b_end / (2 ^ (k + 11)) = A_top58 := by + have h_pos_k11 : 0 < 2 ^ (k + 11) := pow_two_pos (k + 11) + have h1 := (Nat.le_div_iff_mul_le h_pos_k11).mpr (le_of_lt h_bend_lo) + have h2 := (Nat.div_lt_iff_lt_mul h_pos_k11).mpr h_bend_hi + omega + have h_val_all : 42 + A_core' * 2 ^ 6 + A_top58 * 2 ^ (6 + (k + 5)) = b_end := by + have h1 : 2 ^ 6 = 64 := by decide + have h2 : 2 ^ (6 + (k + 5)) = 64 * 2 ^ (k + 5) := by rw [Nat.pow_add] + rw [h1, h2] + have h_assoc : A_top58 * (64 * 2 ^ (k + 5)) = 64 * (A_top58 * 2 ^ (k + 5)) := by ring + rw [h_assoc] + dsimp [A_core'] + have h_div64 : (b_end / 64) / (2 ^ (k + 5)) = A_top58 := by + rw [Nat.div_div_eq_div_mul, <- h_pow_k11_eq, h_div_top] + have h_mod_div := Nat.div_add_mod (b_end / 64) (2 ^ (k + 5)) + rw [h_div64, Nat.mul_comm (2 ^ (k + 5)) A_top58] at h_mod_div + have h_mod64 := Nat.div_add_mod b_end 64 + omega + have h_Acore'_le_k : A_core' <= 17 * 2 ^ k := by + have h_eq6 : 2 ^ 6 = 64 := by decide + have h_eq_k11 : 2 ^ (6 + (k + 5)) = 2 ^ (k + 11) := by + have : 6 + (k + 5) = k + 11 := by omega + rw [this] + rw [h_eq6, h_eq_k11] at h_val_all + omega + have h_Acore'_32 : A_core' * 32 <= 17 * 2 ^ (k + 5) := by + have h_pow_k5 : 2 ^ (k + 5) = 32 * 2 ^ k := by + have : k + 5 = 5 + k := by omega + rw [this, Nat.pow_add] + omega + rw [h_len_all, h_val_all] at h_all + exact ⟨A_core', ds_core', hD_core', h_len_core', h_Acore'_32, + by simpa [List.append_assoc] using h_all⟩ + +theorem Good_step {u : List Word} (hG : Good u) : + ∃ u', Step u u' ∧ Good u' := by + rcases hG with ⟨p_103, ds_core, A_core, m, rfl, ⟨p_tail, hp_start⟩, hm_def, hm, hD_core, + hA_core, hz13, hzW⟩ + -- Piece 2: p_103 + have hP_p_ex : ∃ ap gp, Parse a_103 p_103 ap gp := by + rw [hp_start]; exact Parse_V_start a_103 p_tail + rcases hP_p_ex with ⟨ap, gp, hP_p⟩ + have hb_103_ok : 2 + 4 * wordVal p_103 < (b_103 : Rat) := by + have hz12 := wordValQ_nonneg p_103 + have hz10_le := two_wordVal_add_wordValQ_le p_103 + have hb103_gt : (17 : Rat) < (b_103 : Rat) := by norm_num [b_103] + linarith + rcases Scan_of_Parse hP_p b_103 hb_103_ok with ⟨bp, v_p, hS_p, hbp⟩ + -- Piece 3: s40 + have hS_s40 := Scan_s40 ap bp hbp + let b_mid0 := 131072 * (bp - 3) + 105669 + -- Piece 4: ds_mid = [K, Q] ++ ds_core ++ [Q, Q] + let ds_mid := [K, Q] ++ ds_core ++ [Q, Q] + rcases digitVal_mid hm hD_core hA_core with ⟨A_mid, hD_mid, hA_lo, hA_hi⟩ + have hP_s40_all : ∃ a_top g_all, Parse ap (s40 ++ ds_mid) a_top g_all := by + change ∃ a_top g_all, Parse ap (V :: (s40.tail ++ ds_mid)) a_top g_all + exact Parse_V_start ap _ + rcases hP_s40_all with ⟨a_top, g_all, hP_all⟩ + have hP_mid_ex : ∃ g_mid, Parse (4 * (ap + 1)) ds_mid a_top g_mid := by + dsimp [ds_mid] at hP_all ⊢ + exact Parse_s40_split hP_all + rcases hP_mid_ex with ⟨g_mid, hP_mid⟩ + have hatop_eq := force_a55 hm hP_p hz13 hzW hD_mid hA_lo hA_hi hP_mid + subst hatop_eq + have hb_mid0_ok := bound_b_mid0 hm hS_p hbp hz13 hzW rfl hD_mid + rcases Scan_of_Parse hP_mid b_mid0 hb_mid0_ok with ⟨b_top57, v_mid, hS_mid, hb_top57_ge3⟩ + -- Piece 5: top57 = top56 ++ [K] + have hb_top57 : 2 <= b_top57 := by omega + have hS_top57 := Scan_top57 b_top57 hb_top57 + -- Combine Pieces 2 + 3 + 4 into w_103 + let w_103 := p_103 ++ s40 ++ ds_mid + let v_w103 := v_p ++ v_s40 ++ v_mid + let g_w103 := gp + 5 + g_mid + have h_ap_eq : 4 * ap + 4 = 4 * (ap + 1) := by omega + rw [h_ap_eq] at hS_s40 + have hS_w103 : Scan a_103 b_103 w_103 (2 ^ 55) b_top57 v_w103 g_w103 := by + have h23 := Scan_append hS_p hS_s40 + have h234 := Scan_append h23 hS_mid + simpa [w_103, v_w103, g_w103, List.append_assoc, Nat.add_assoc] using h234 + -- Combine Piece 1 + w_103 + Piece 5 + have h_u_rep1 : + (head103 ++ p_103 ++ s36 ++ [K, Q, K, Q, K, Q] ++ ds_core ++ [Q, + Q] ++ top56) ++ List.replicate 1 K = + head103 ++ w_103 ++ top57 := by + dsimp [w_103, s40, ds_mid, top57, List.replicate] + simp only [List.append_assoc, List.cons_append, List.nil_append] + have hS_full : + Scan 0 6 ((head103 ++ p_103 ++ s36 ++ [K, Q, K, Q, K, Q] ++ ds_core ++ [Q, + Q] ++ top56) ++ List.replicate 1 K) + 0 (64 * (b_top57 - 2) + 42) (v_head103 ++ v_w103 ++ s36) (0 + g_w103 + 21) := by + rw [h_u_rep1] + exact Scan_append (Scan_append Scan_head103 hS_w103) hS_top57 + -- Closure bounds for p_103' = V :: v_w103 and b_end + let k := 9 + 3 * gp + 3 * g_mid + have hk : 9 <= k := by omega + have hWV_vw : wordPotV v_w103 <= 13 / 4 := + bound_wordPot_p103' hm hS_p hz13 hzW hD_mid hS_mid + have hz13_vw : wordScale v_w103 * ((2 ^ k : Nat) : Rat) = 1 := by + have h_z13_w := scan_wordScale_eq hS_w103 + have h_w_eq : wordScale w_103 = 64 := by + dsimp only [w_103] + rw [wordScale_append, wordScale_append] + have h_s40 : wordScale s40 = 1 / 4 := by + have h := checkScalePow_sound s40 2 0 (by decide) + norm_num at h + linarith + have h_mid := (digitVal_scale_and_val hD_mid).1 + rw [h_s40, h_mid] + linarith + rw [h_w_eq] at h_z13_w + have h_3gw : 3 * g_w103 = k + 6 := by dsimp [g_w103, k]; omega + have h6 : ((2 ^ 6 : Nat) : Rat) = 64 := by norm_num + rw [h_3gw, Nat.pow_add, Nat.cast_mul, h6] at h_z13_w + linarith + rcases bound_b_end_digitVal hk hb_top57 hS_w103 hz13_vw hWV_vw + with ⟨A_core', ds_core', hD_core', hlen_core', hA_core', hD_bend⟩ + let da := [K, Q, K, Q, K, Q] ++ ds_core' ++ [Q, Q] ++ top56 + let u' := V :: (v_head103 ++ v_w103 ++ s36 ++ da) + refine ⟨u', ⟨1, 64 * (b_top57 - 2) + 42, v_head103 ++ v_w103 ++ s36, da, k + 69, + 0 + g_w103 + 21, hS_full, hD_bend, rfl⟩, ?_⟩ + -- Prove Good u' + let p_103' := V :: v_w103 + let m' := k + 9 + refine ⟨p_103', ds_core', A_core', m', ?_, ⟨v_w103, rfl⟩, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · dsimp only [u', p_103', da, v_head103, head103] + simp only [List.cons_append, List.nil_append, List.append_assoc] + · dsimp [m']; omega + · dsimp [m']; omega + · have h_m'_4 : m' - 4 = k + 5 := by dsimp [m']; omega + rwa [h_m'_4] + · have h_m'_4 : m' - 4 = k + 5 := by dsimp [m']; omega + rwa [h_m'_4] + · dsimp only [p_103', m', wordScale] + have h_m'_split : k + 9 = k + 1 + 8 := by omega + have h1 : ((2 ^ 1 : Nat) : Rat) = 2 := by norm_num + have h8 : ((2 ^ 8 : Nat) : Rat) = 256 := by norm_num + rw [h_m'_split, Nat.pow_add, Nat.pow_add, Nat.cast_mul, Nat.cast_mul, h1, h8] + linarith + · dsimp only [p_103'] + rw [wordPot_cons_V] + exact hWV_vw + + +end Traj103 + +end BusyBeaver.WordVKQ diff --git a/BusyBeaver/Calculi/WordCalculusH.lean b/BusyBeaver/Calculi/WordCalculusH.lean new file mode 100644 index 00000000..7375e794 --- /dev/null +++ b/BusyBeaver/Calculi/WordCalculusH.lean @@ -0,0 +1,2147 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Calculi.Counter +public import BusyBeaver.Calculi.WordCalculusA +public import BusyBeaver.Calculi.WordCalculusB + +import BusyBeaver.Calculi.WordCalculusD +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +/-! +# Word Calculus Engine H (`BusyBeaver.Calculi.WordCalculusH`) + +Formal word-rewriting calculus for structured tape transformations, +providing verified macro-step reductions and tile segment chains for family H. +-/ + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver Counter + +namespace BusyBeaver.WordCanonBR + +set_option linter.unusedVariables false +set_option linter.unusedSimpArgs false +set_option linter.deprecated false +set_option linter.dupNamespace false +set_option linter.unreachableTactic false +set_option linter.unusedTactic false +set_option linter.unnecessarySeqFocus false +set_option quotPrecheck false +set_option maxRecDepth 4000000 +set_option maxHeartbeats 8000000 + +variable {zG_ zL_ α β γ : Type*} [Inhabited zG_] [Inhabited zL_] +def A : Fin 6 := 0 +def B : Fin 6 := 1 +def C : Fin 6 := 2 +def D : Fin 6 := 3 +def E : Fin 6 := 4 +def F : Fin 6 := 5 +def canon_tm : Machine (Fin 2) (Fin 6) + | 0,0 => some (some 1,Stmt.write 1 Dir.right) + | 0,1 => some (some 4,Stmt.write 0 Dir.right) + | 1,0 => some (some 2,Stmt.write 1 Dir.left) + | 1,1 => some (some 0,Stmt.write 1 Dir.right) + | 2,0 => some (some 3,Stmt.write 1 Dir.left) + | 2,1 => some (some 2,Stmt.write 0 Dir.left) + | 3,0 => some (some 5,Stmt.write 1 Dir.left) + | 3,1 => some (some 0,Stmt.write 0 Dir.left) + | 4,0 => some (some 0,Stmt.write 1 Dir.right) + | 4,1 => some (some 1,Stmt.write 1 Dir.right) + | 5,0 => some (some 4,Stmt.write 1 Dir.left) + | 5,1 => none +local notation "zB" => ListBlank (Fin 2) +local notation "zF" => List (Fin 2) +set_option linter.unusedSimpArgs false +set_option linter.unusedVariables false +set_option maxHeartbeats 8000000 +set_option maxRecDepth 4000000 +@[scoped simp] theorem zMz (M : Machine zG_ zL_) (config : Cfg zG_ zL_) : multiStep M config 0 = some config := rfl +@[scoped simp] theorem zMo (M : Machine zG_ zL_) (config : Cfg zG_ zL_) : multiStep M config 1 = step M config := rfl +@[scoped simp] theorem zMs (M : Machine zG_ zL_) (config : Cfg zG_ zL_) (n : Nat) : + multiStep M config (n + 1) = Option.bind (multiStep M config n) (step M) := by + rw [multiStep,Function.iterate_succ',Function.comp_apply,multiStep] +@[scoped simp] theorem z00 : (0 : Fin 2) >> default = default := by + apply Turing.ListBlank.ext; intro i; cases i <;> rfl +@[scoped simp] theorem zDh : (default : zB).head = 0 := rfl +@[scoped simp] theorem zDt : (default : zB).tail = default := rfl +@[scoped simp] theorem append_nil (s : zB) : ([] : zF) +> s = s := rfl +@[scoped simp] theorem append_cons (a : Fin 2) (l : zF) (s : zB) : + (a :: l) +> s = a >> (l +> s) := rfl +@[scoped simp] theorem append_assoc (l1 l2 : zF) (s : zB) : + (l1 ++ l2) +> s = l1 +> (l2 +> s) := by + induction l1 with + | nil => rfl + | cons a l1 ih => simp only [List.cons_append,append_cons,ih] +theorem zSm {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + (tm : Machine zG_ zL_) (c_1 c_2 : Cfg zG_ zL_) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢^{1} c_2 := by simp [h] +theorem z01 {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + (tm : Machine zG_ zL_) (c_1 c_2 : Cfg zG_ zL_) (h : c_1 [tm]⊢ c_2) : + c_1 [tm]⊢⁺ c_2 := ⟨1,by decide,zSm tm c_1 c_2 h⟩ +theorem zMa {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + (tm : Machine zG_ zL_) (c_1 : Cfg zG_ zL_) (n m : Nat) : + multiStep tm c_1 (n + m) = (multiStep tm c_1 n).bind (fun c_2 => multiStep tm c_2 m) := by + induction m with + | zero => simp + | succ m' ih => + rw [Nat.add_succ,zMs,ih,Option.bind_assoc] + simp_rw [zMs] +theorem zMt {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + (tm : Machine zG_ zL_) (c_1 c_2 c_3 : Cfg zG_ zL_) (n m : Nat) + (h₁ : c_1 [tm]⊢^{n} c_2) (h₂ : c_2 [tm]⊢^{m} c_3) : + c_1 [tm]⊢^{n+m} c_3 := by + rw [zMa,h₁]; simp [h₂] +theorem zPs {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 : Cfg zG_ zL_} (h : c_1 [tm]⊢⁺ c_2) : + c_1 [tm]⊢* c_2 := by obtain ⟨n,_,hn⟩ := h; exact ⟨n,hn⟩ +theorem zPt {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 c_3 : Cfg zG_ zL_} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢⁺ c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,m_pos,hm⟩ := h₂ + exact ⟨n + m,by omega,zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z02 {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 c_3 : Cfg zG_ zL_} + (h₁ : c_1 [tm]⊢⁺ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := by + obtain ⟨n,n_pos,hn⟩ := h₁; obtain ⟨m,hm⟩ := h₂ + exact ⟨n + m,lt_of_lt_of_le n_pos (Nat.le_add_right n m),zMt tm c_1 c_2 c_3 n m hn hm⟩ +theorem z03 {zG_ zL_ : Type*} [Inhabited zG_] [Inhabited zL_] + {tm : Machine zG_ zL_} {c_1 c_2 c_3 : Cfg zG_ zL_} + (h₁ : c_1 [tm]⊢ c_2) (h₂ : c_2 [tm]⊢* c_3) : c_1 [tm]⊢⁺ c_3 := + z02 (z01 tm c_1 c_2 h₁) h₂ +macro "finish" : tactic => + `(tactic| (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft]) <;> exact ⟨0,rfl⟩) +macro "step" : tactic => + `(tactic| (try refine zPs ?_) <;> + refine z03 (by (try simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.ListBlank.head_cons, zDh]); rfl) ?_ <;> + simp only [BusyBeaver.Cfg.headRight, BusyBeaver.Cfg.headLeft, Turing.Tape.move, Turing.ListBlank.head_cons, Turing.ListBlank.tail_cons, Tape.write, z00, zDh, zDt, append_cons, append_nil]) +macro "execute" : tactic => + `(tactic| repeat (any_goals (first | finish | step))) + +abbrev CCfg := Counter.CCfg (Fin 2) (Fin 6) +abbrev c_to_cfg (c : CCfg) : Cfg (Fin 2) (Fin 6) := + ⟨some c.q, ⟨c.cur, c.l +> default, c.r +> default⟩⟩ +abbrev c_step (c : CCfg) : Option CCfg := Counter.bstep canon_tm c +abbrev zCm (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep canon_tm n c +theorem zTc {c1 c2 : CCfg} {n : Nat} (hn : 0 < n) (h : zCm c1 n = some c2) : + (c_to_cfg c1) [canon_tm]⊢⁺ (c_to_cfg c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ + +abbrev t : zF := [1,1,0,0] +abbrev d0 : zF := [0,0] +abbrev d1 : zF := [1,0] +abbrev one : zF := [1] +abbrev lh : zB := [1,0,1] +> default +abbrev w_word : zF := [0,0,0,1,1,0,1,0] +abbrev w_rest : zF := t ++ t ++ (t ++ d1) ++ t ++ (t ++ d0) ++ t ++ (t ++ d0) ++ t ++ t ++ d1 ++ (t ++ one) +abbrev w_base : zF := w_word ++ w_rest +@[scoped simp] theorem zDd : d0 +> (default : zB) = default := by + simp [d0] +inductive Call where + | ch + | cj + | cp +def zCs : Call -> Fin 6 + | .ch => B + | .cj => A + | .cp => A +def zCw : Call -> zF + | .ch => [1] + | .cj => [1,1] + | .cp => [1,0] +def zCR (l : zB) (c : Call) (r : zB) : Cfg (Fin 2) (Fin 6) := + ((zCw c +> l) {{zCs c}}> r) +def zCL (l : zB) (r : zB) : Cfg (Fin 2) (Fin 6) := + (l <{{C}} ([0] +> r)) +def zCf (r : zB) : Cfg (Fin 2) (Fin 6) := + zCL lh (w_base +> r) +def z04 (c : Call) (r1 r2 : zB) : Prop := + ∀ l,(zCR l c r1) [canon_tm]⊢⁺ (zCL l r2) +inductive Side : List Call -> zB -> zB -> Prop where + | nil (r : zB) : Side [] r r + | cons {c : Call} {ls : List Call} {r1 r2 r3 : zB} : + z04 c r1 r2 -> Side ls r2 r3 -> Side (c :: ls) r1 r3 +def Seg (ls_in ls_out : List Call) (w1 w2 : zF) : Prop := + ∀ r1 r2,Side ls_out r1 r2 -> Side ls_in (w1 +> r1) (w2 +> r2) +@[scoped simp] theorem z05 {α : Type*} (l : List α) : l ^ (0 : Nat) = [] := rfl +@[scoped simp] theorem zLp {α : Type*} (l : List α) (n : Nat) : l ^ (n + 1) = l ++ l ^ n := rfl +@[scoped simp] theorem zLp' {α : Type*} (l : List α) (n : Nat) : l ^ (1 + n) = l ++ l ^ n := by + rw [Nat.add_comm 1 n]; rfl +@[scoped simp] theorem z06 {α : Type*} (l : List α) : l ^ (1 : Nat) = l := by + change l ++ [] = l; exact List.append_nil l +theorem z07 {α : Type*} (l : List α) (m n : Nat) : l ^ (m + n) = l ^ m ++ l ^ n := by + induction m with + | zero => simp + | succ m ih => + rw [Nat.add_right_comm,zLp,zLp,ih,List.append_assoc] +theorem z08 {ls1 ls2 : List Call} {r1 r2 r3 : zB} + (h1 : Side ls1 r1 r2) (h2 : Side ls2 r2 r3) : Side (ls1 ++ ls2) r1 r3 := by + induction h1 with + | nil _ => exact h2 + | cons hc _ ih => exact Side.cons hc (ih h2) +theorem z09 {ls1 ls2 : List Call} {r1 r3 : zB} + (h : Side (ls1 ++ ls2) r1 r3) : ∃ r2,Side ls1 r1 r2 /\ Side ls2 r2 r3 := by + induction ls1 generalizing r1 with + | nil => exact ⟨r1,Side.nil r1,h⟩ + | cons c ls1 ih => + rcases h with _ | ⟨hc,hrest⟩ + rcases ih hrest with ⟨r2,h1,h2⟩ + exact ⟨r2,Side.cons hc h1,h2⟩ +theorem z0a (w : zF) : Seg [] [] w w := by + intro r1 r2 h; cases h; exact Side.nil (w +> r1) +theorem z0m_id (ls : List Call) : Seg ls ls [] [] := by + intro r1 r2 h; exact h +theorem zSc {ls1 ls2 : List Call} {w1 w2 : zF} {r1 r2 : zB} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Side ls2 r1 r2) : + Side ls1 (w1 +> r1) (w2 +> r2) := + h1 r1 r2 h2 +theorem zSg {ls1 ls2 ls3 ls4 : List Call} {w1 w2 w3 : zF} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls3 ls4 w2 w3) : + Seg (ls1 ++ ls3) (ls2 ++ ls4) w1 w3 := by + intro r1 r3 h + rcases z09 h with ⟨r2,ha,hb⟩ + exact z08 (h1 r1 r2 ha) (h2 r2 r3 hb) +theorem zS0 {ls1 ls2 ls3 : List Call} {w1 w2 v1 v2 : zF} + (h1 : Seg ls1 ls2 w1 w2) (h2 : Seg ls2 ls3 v1 v2) : + Seg ls1 ls3 (w1 ++ v1) (w2 ++ v2) := by + intro r1 r2 h + rw [append_assoc,append_assoc] + exact h1 (v1 +> r1) (v2 +> r2) (h2 r1 r2 h) +theorem zS4 {c : Call} {w1 w2 : zF} + (h1 : ∀ l r,(zCR l c (w1 +> r)) [canon_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c] [] w1 w2 := by + intro r1 r2 h; cases h + exact Side.cons (fun l => h1 l r1) (Side.nil _) +theorem zS2 {c_in c_out : Call} {w1 w2 mid : zF} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [canon_tm]⊢⁺ (zCR (mid +> l) c_out r)) + (h2 : ∀ l r,(zCL (mid +> l) r) [canon_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c_out] w1 w2 := by + intro r1 r2 h + rcases h with _ | ⟨hc,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) (zPt (hc (mid +> l)) (h2 l r2)) +theorem zS5 {c_in c1 c2 : Call} {w1 w2 mid1 mid2 : zF} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [canon_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [canon_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [canon_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2] w1 w2 := by + intro r1 r3 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) (h3 l r3)))) +theorem zS6 {c_in c1 c2 c3 : Call} {w1 w2 mid1 mid2 mid3 : zF} + (h1 : ∀ l r,(zCR l c_in (w1 +> r)) [canon_tm]⊢⁺ (zCR (mid1 +> l) c1 r)) + (h2 : ∀ l r,(zCL (mid1 +> l) r) [canon_tm]⊢⁺ (zCR (mid2 +> l) c2 r)) + (h3 : ∀ l r,(zCL (mid2 +> l) r) [canon_tm]⊢⁺ (zCR (mid3 +> l) c3 r)) + (h4 : ∀ l r,(zCL (mid3 +> l) r) [canon_tm]⊢⁺ (zCL l (w2 +> r))) : + Seg [c_in] [c1,c2,c3] w1 w2 := by + intro r1 r4 h + rcases h with _ | ⟨hc1,hrest⟩ + rcases hrest with _ | ⟨hc2,hrest2⟩ + rcases hrest2 with _ | ⟨hc3,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + exact zPt (h1 l r1) + (zPt (hc1 (mid1 +> l)) + (zPt (h2 l _) + (zPt (hc2 (mid2 +> l)) + (zPt (h3 l _) + (zPt (hc3 (mid3 +> l)) (h4 l r4)))))) + +-- Atomic Segs: +theorem z0b : Seg [.cp] [] t [1,1,0,1,0] := + zS4 (fun l r => by unfold zCR zCL zCw zCs t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0c_p : Seg [.ch] [.cp,.ch] [1,1,0,1,0] t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0c : Seg [.cj] [.cp] t t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem zH2 : Seg [.ch] [.cj,.ch] (t ++ one) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0d : Seg [.ch] [.ch,.ch] t t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs t; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0e : Seg [.cp] [] (d1 ++ d0) (t ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d1 d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem z0f : Seg [.cj] [.cj] (d1 ++ d0) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1 d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0g : Seg [.cp] [.cp] (d1 ++ d1) t := + zS2 (mid := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0h : Seg [.cj] [.cp,.ch] (d1 ++ d1) t := + zS5 (mid1 := [1,0,1,1]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem z0i : Seg [.cj] [] d0 (d0 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH1 : Seg [.ch] [] (d0 ++ one) (d1 ++ one) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zH3 : Seg [.ch] [.cj] (d1 ++ one) d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1 one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem z0j : Seg [.cj] [.cp] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem zH0 : Seg [.ch] [] d0 d1 := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 d1; simp only [append_cons,append_nil]; execute) +theorem zH4 : Seg [.ch] [.ch] d1 d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs d1; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) + +-- Additional atomic Segs for chains and w_base: +theorem zC_base : Seg [.cp] [.ch,.cp] [0,1,1,1] t := + zS5 (mid1 := [0,1,1,1,0]) (mid2 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem zO_head : Seg [.cp] [] [1,0,0,0] [1,1,0,0,1] := + zS4 (fun l r => by unfold zCR zCL zCw zCs; simp only [append_cons,append_nil]; execute) +theorem zO_mid : Seg [.ch] [.ch,.cp,.ch] [1,0,1,1,1] t := + zS6 (mid1 := [0,1,1,1,1]) (mid2 := [1,0,1,1]) (mid3 := [1,0,1,0]) + (fun l r => by unfold zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL t; simp only [append_cons,append_nil]; execute) +theorem zO_b0 : Seg [.cp] [.ch] [1,1] [1,1,0] := + zS2 (mid := [0,1,0]) + (fun l r => by unfold zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL; simp only [append_cons,append_nil]; execute) +theorem zO_b2 : Seg [.ch] [.cp] [1,1,0] d0 := + zS2 (mid := [1,1]) + (fun l r => by unfold zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0; simp only [append_cons,append_nil]; execute) +theorem zE_head : Seg [.cj] [] [0,0,1,0,0,0] [0,0,1,1,0,0,0] := + zS4 (fun l r => by unfold zCR zCL zCw zCs; simp only [append_cons,append_nil]; execute) +theorem zE_b0 : Seg [.cj] [] [0,0,1,1] [0,0,1,1,1] := + zS4 (fun l r => by unfold zCR zCL zCw zCs; simp only [append_cons,append_nil]; execute) +theorem zW_td1a : Seg [.cp] [] (t ++ d1) [1,1,0,1,0,1,0] := + zS4 (fun l r => by unfold zCR zCL zCw zCs t d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zW_td1b : Seg [.ch] [.cp] [1,1,0,1,0,1,0] (d0 ++ t) := + zS2 (mid := [1,0,1,0,1,1]) + (fun l r => by unfold zCR zCw zCs; simp only [append_cons,append_nil]; execute) + (fun l r => by unfold zCL d0 t; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zW_td0a : Seg [.cp] [] (t ++ d0) [1,1,0,1,0,0,0] := + zS4 (fun l r => by unfold zCR zCL zCw zCs t d0; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) +theorem zW_td0b : Seg [.ch] [] [1,1,0,1,0,0,0] (d0 ++ (t ++ one)) := + zS4 (fun l r => by unfold zCR zCL zCw zCs d0 t one; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute) + +theorem zS3 (n : Nat) : Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2)) t t := by + induction n with + | zero => exact z0a t + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [zLp,h_eq,z07] + exact zSg z0d ih +theorem zT_pow (r : Nat) : ∀ n,Seg ([Call.ch] ^ n) ([Call.ch] ^ (n * 2 ^ r)) (t ^ r) (t ^ r) := by + induction r with + | zero => + intro n + have h1 : n * 2 ^ 0 = n := by simp + rw [h1] + exact z0m_id _ + | succ r ih => + intro n + have h_eq : n * 2 ^ (r + 1) = (n * 2) * 2 ^ r := by rw [Nat.pow_succ]; ring + rw [zLp,h_eq] + exact zS0 (zS3 n) (ih (n * 2)) +theorem zSa {w2 : zF} (hw : Seg [.ch,.ch] [.ch] w2 w2) (n : Nat) : + Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) w2 w2 := by + induction n with + | zero => exact z0a w2 + | succ n ih => + have h_eq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [h_eq,z07,zLp] + exact zSg hw ih +theorem z0k : Seg [.ch,.ch] [.ch] d0 d0 := + zSg zH0 zH4 +theorem z0l : Seg [.ch,.ch] [.ch] d1 d1 := + zSg zH4 zH0 +theorem zH_d0_even (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d0 d0 := + zSa z0k n +theorem zH_d0_odd (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ n) d0 d1 := by + simpa only [zLp',List.cons_append,List.nil_append] using! zSg zH0 (zSa z0l n) +theorem zH_d1_even (n : Nat) : Seg ([Call.ch] ^ (n * 2)) ([Call.ch] ^ n) d1 d1 := + zSa z0l n + +-- Standard composite Segs: +theorem z0m (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cp] ++ [.ch] ^ (1 + n * 2)) t t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0b z0c_p) (zS3 n) +theorem z0n (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) t t := + zSg z0c (zS3 n) +theorem z0o (n : Nat) : Seg ([.cp] ++ [.ch] ^ (1 + n)) ([.cj] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d0) t := by + simpa only [zLp',List.cons_append,List.nil_append] using! + zSg (zSg z0e zH2) (zS3 n) +theorem z0p (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cj] ++ [.ch] ^ (n * 2)) (d1 ++ d0) t := + zSg z0f (zS3 n) +theorem z0q (n : Nat) : Seg ([.cp] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (n * 2)) (d1 ++ d1) t := + zSg z0g (zS3 n) +theorem z0r (n : Nat) : Seg ([.cj] ++ [.ch] ^ n) ([.cp] ++ [.ch] ^ (1 + n * 2)) (d1 ++ d1) t := by + simpa only [zLp',List.cons_append,List.nil_append] using! zSg z0h (zS3 n) +theorem z0s (n : Nat) : Seg ([.cj] ++ [.ch] ^ (2 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d0 := by + have h0 : Seg [.cj,.ch,.ch] [.cj] d0 d0 := + zSg z0i (zSg zH1 zH3) + have h1 := zSg h0 (zSa z0k n) + have heq : (2 + n * 2) = 1 + (1 + n * 2) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using! h1 +theorem z0t (n : Nat) : Seg ([.cj] ++ [.ch] ^ (n * 2)) ([.cp] ++ [.ch] ^ n) d1 d0 := + zSg z0j (zSa z0k n) +theorem z0u : Seg [.cj,.ch] [] d0 (d1 ++ one) := + zSg z0i zH1 +theorem z0v (n : Nat) : Seg ([.cj] ++ [.ch] ^ (3 + n * 2)) ([.cj] ++ [.ch] ^ n) d0 d1 := by + have h0 : Seg [.cj,.ch,.ch,.ch] [.cj] d0 d1 := + zSg z0i (zSg zH1 (zSg zH3 zH0)) + have h1 := zSg h0 (zSa z0l n) + have heq : (3 + n * 2) = 1 + (1 + (1 + n * 2)) := by omega + simpa only [heq,zLp',List.cons_append,List.nil_append] using! h1 +theorem z0w (n : Nat) : Seg ([.cj] ++ [.ch] ^ (1 + n * 2)) ([.cp] ++ [.ch] ^ n) d1 d1 := by + have h0 : Seg [.cj,.ch] [.cp] d1 d1 := zSg z0j zH0 + have h1 := zSg h0 (zSa z0l n) + simpa only [zLp',List.cons_append,List.nil_append] using! h1 + +-- Chain combinators: zCp_chain, zOdd_base, zEven_base +theorem zCp_step {r r_out : zB} (h : Side [.cp] ([0,1] +> r) r_out) : + Side [.cp] ([0,1,1,0,0,0] +> r) (t +> r_out) := by + rcases h with _ | ⟨hcp,hnil⟩ + cases hnil + refine Side.cons (fun l => ?_) (Side.nil _) + have h1 : (zCR l .cp ([0,1,1,0,0,0] +> r)) [canon_tm]⊢⁺ (zCR ([1,0,1,0] +> l) .cp ([0,1] +> r)) := by + unfold zCR zCw zCs; simp only [append_cons,append_nil]; execute + have h2 : (zCL ([1,0,1,0] +> l) r_out) [canon_tm]⊢⁺ (zCL l (t +> r_out)) := by + unfold zCL t; simp only [append_cons,append_nil]; execute + exact zPt h1 (zPt (hcp ([1,0,1,0] +> l)) h2) + +theorem zCp_chain (m : Nat) : + Seg [.cp] [.ch,.cp] ([0,1] ++ (d1 ++ d0) ^ m ++ [1,1]) (t ^ (1 + m)) := by + induction m with + | zero => + simpa [z05,z06] using! zC_base + | succ m ih => + intro r1 r2 h + have h_sub := ih r1 r2 h + have h_in : ([0,1] ++ (d1 ++ d0) ^ (m + 1) ++ [1,1]) +> r1 = + [0,1,1,0,0,0] +> (((d1 ++ d0) ^ m ++ [1,1]) +> r1) := by + rw [zLp (d1 ++ d0) m] + simp only [d1,d0,List.cons_append,List.nil_append,append_cons,append_nil] + have h_mid : ([0,1] ++ (d1 ++ d0) ^ m ++ [1,1]) +> r1 = + [0,1] +> (((d1 ++ d0) ^ m ++ [1,1]) +> r1) := by + simp only [List.cons_append,List.nil_append,append_cons,append_nil] + rw [h_mid] at h_sub + have h_step := zCp_step h_sub + rw [<- h_in] at h_step + have h_out : t +> (t ^ (1 + m) +> r2) = t ^ (1 + (m + 1)) +> r2 := by + rw [zLp' t (m + 1),Nat.add_comm m 1,append_assoc] + rwa [<- h_out] + +theorem zOdd_base (r : Nat) : + Seg [.cp,.ch] [.ch,.cp] ((d1 ++ d0) ^ r ++ [1,1]) (d0 ++ t ^ r) := by + cases r with + | zero => + simpa [z05,List.append_nil] using! zSg zO_b0 zO_b2 + | succ m => + have h1 : Seg [.cp] [] ([1,0,0,0] ++ ((d1 ++ d0) ^ m ++ [1,1])) ([1,1,0,0,1] ++ ((d1 ++ d0) ^ m ++ [1,1])) := + zS0 zO_head (z0a _) + have h2 : Seg [.ch] [.ch,.cp] ([1,1,0] ++ ([0,1] ++ (d1 ++ d0) ^ m ++ [1,1])) (d0 ++ t ^ (1 + m)) := + zS0 zO_b2 (zCp_chain m) + have h_in : (d1 ++ d0) ^ (m + 1) ++ [1,1] = [1,0,0,0] ++ ((d1 ++ d0) ^ m ++ [1,1]) := by + rw [zLp (d1 ++ d0) m]; rfl + have h_mid : [1,1,0,0,1] ++ ((d1 ++ d0) ^ m ++ [1,1]) = [1,1,0] ++ ([0,1] ++ (d1 ++ d0) ^ m ++ [1,1]) := rfl + have h_out : m + 1 = 1 + m := by omega + rw [h_in,h_out] + rw [h_mid] at h1 + exact zSg h1 h2 + +theorem zEven_ch_step {r r_mid r_out : zB} + (h1 : Side [.cp] ([0,1] +> r) r_mid) + (h2 : Side [.ch] r_mid r_out) : + Side [.ch] ([1,0,1,1,0,0,0] +> r) (t +> r_out) := by + rcases h1 with _ | ⟨hcp,hnil1⟩; cases hnil1 + rcases h2 with _ | ⟨hch,hnil2⟩; cases hnil2 + refine Side.cons (fun l => ?_) (Side.nil _) + have hs1 : (zCR l .ch ([1,0,1,1,0,0,0] +> r)) [canon_tm]⊢⁺ (zCR ([1,0,1,1] +> l) .cp ([0,1] +> r)) := by + unfold zCR zCw zCs; simp only [append_cons,append_nil]; execute + have hs2 : (zCL ([1,0,1,1] +> l) r_mid) [canon_tm]⊢⁺ (zCR ([1,0,1,0] +> l) .ch r_mid) := by + unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute + have hs3 : (zCL ([1,0,1,0] +> l) r_out) [canon_tm]⊢⁺ (zCL l (t +> r_out)) := by + unfold zCL t; simp only [append_cons,append_nil]; execute + exact zPt hs1 (zPt (hcp ([1,0,1,1] +> l)) (zPt hs2 (zPt (hch ([1,0,1,0] +> l)) hs3))) + +theorem zEven_base (r : Nat) : + Seg [.cj,.ch,.ch] ([.ch,.cp] ++ [.ch] ^ (2 ^ r)) (d0 ++ (d1 ++ d0) ^ r ++ [1,1]) (t ^ (1 + r)) := by + cases r with + | zero => + have h1 : Seg [.cj] [] [0,0,1,1] [0,0,1,1,1] := zE_b0 + have h2 : Seg [.ch] [] ([0,0] ++ [1,1,1]) ([1,0] ++ [1,1,1]) := zS0 zH0 (z0a [1,1,1]) + have h3 : Seg [.ch] [.ch,.cp,.ch] [1,0,1,1,1] t := zO_mid + simpa [z05,z06] using! zSg h1 (zSg h2 h3) + | succ m => + intro r1 r2 h + have h_split : ([Call.ch,Call.cp] ++ [Call.ch] ^ (2 ^ (m + 1))) = ([Call.ch,Call.cp] ++ ([Call.ch] ^ (1 * 2 ^ (1 + m)))) := by + rw [Nat.one_mul,Nat.add_comm 1 m] + rw [h_split] at h + rcases z09 h with ⟨r_mid,h_cp,h_ch_pow⟩ + have h_cp_seg := zCp_chain m r1 r_mid h_cp + have h_ch_seg := zT_pow (1 + m) 1 r_mid r2 (by simpa [z06] using! h_ch_pow) + simp only [z06] at h_ch_seg + have h_mid_eq : ([0,1] ++ (d1 ++ d0) ^ m ++ [1,1]) +> r1 = [0,1] +> (((d1 ++ d0) ^ m ++ [1,1]) +> r1) := by + simp only [List.cons_append,List.nil_append,append_cons,append_nil] + rw [h_mid_eq] at h_cp_seg + have h_step3 := zEven_ch_step h_cp_seg h_ch_seg + have h_step2 : Side [.ch,.ch] ([0,0,1,1,0,0,0] +> (((d1 ++ d0) ^ m ++ [1,1]) +> r1)) (t +> (t ^ (1 + m) +> r2)) := by + have h_s2 := (zS0 zH0 (z0a [1,1,0,0,0])) (((d1 ++ d0) ^ m ++ [1,1]) +> r1) _ (Side.nil _) + exact z08 h_s2 h_step3 + have h_step1 : Side [.cj,.ch,.ch] ([0,0,1,0,0,0] +> (((d1 ++ d0) ^ m ++ [1,1]) +> r1)) (t +> (t ^ (1 + m) +> r2)) := by + have h_s1 := zE_head (((d1 ++ d0) ^ m ++ [1,1]) +> r1) _ (Side.nil _) + exact z08 h_s1 h_step2 + have h_in : (d0 ++ (d1 ++ d0) ^ (m + 1) ++ [1,1]) +> r1 = [0,0,1,0,0,0] +> (((d1 ++ d0) ^ m ++ [1,1]) +> r1) := by + rw [zLp (d1 ++ d0) m] + simp only [d0,d1,List.cons_append,List.nil_append,append_cons,append_nil] + have h_out : t ^ (1 + (m + 1)) +> r2 = t +> (t ^ (1 + m) +> r2) := by + rw [zLp' t (m + 1),Nat.add_comm m 1,append_assoc] + rw [h_in,h_out] + exact h_step1 + +-- Turnaround at w_word and w_rest: +theorem zW_turn {r r' : zB} (h : Side [.ch,.cj,.ch] r r') : + (zCL lh (w_word +> r)) [canon_tm]⊢⁺ (zCL lh ((w_word ++ t ++ t ++ (t ++ d1)) +> r')) := by + rcases h with _ | ⟨hc1,hrest1⟩ + rcases hrest1 with _ | ⟨hc2,hrest2⟩ + rcases hrest2 with _ | ⟨hc3,hnil⟩ + cases hnil + have h1a : (zCL lh (w_word +> r)) [canon_tm]⊢⁺ + (([1,1,0,1,1,1,1,0,1] +> default) <{{C}} ([1,1,1,0,0,0,0,1,1,1,0,1,0] +> r)) := by + unfold zCL lh w_word; simp only [append_cons,append_nil]; execute + have h1b : (([1,1,0,1,1,1,1,0,1] +> default) <{{C}} ([1,1,1,0,0,0,0,1,1,1,0,1,0] +> r)) [canon_tm]⊢⁺ + (zCR ([1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,0,1] +> default) .ch r) := by + unfold zCR zCw zCs; simp only [append_cons,append_nil]; execute + have h2a : ∀ s1,(zCL ([1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,0,1] +> default) s1) [canon_tm]⊢⁺ + (([1,0,1,0,1,0,1,1,1,0,1,0,0,1] +> default) {{A}}> ([1,0,1,0,0,0,0,1] +> s1)) := by + intro s1; unfold zCL; simp only [append_cons,append_nil]; execute + have h2b : ∀ s1,(([1,0,1,0,1,0,1,1,1,0,1,0,0,1] +> default) {{A}}> ([1,0,1,0,0,0,0,1] +> s1)) [canon_tm]⊢⁺ + (zCR ([1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,0,1] +> default) .cj s1) := by + intro s1; unfold zCR zCw zCs; simp only [append_cons,append_nil]; execute + have h3 : ∀ s2,(zCL ([1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,0,1] +> default) s2) [canon_tm]⊢⁺ + (zCR ([1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,0,1] +> default) .ch s2) := by + intro s2; unfold zCL zCR zCw zCs; simp only [append_cons,append_nil]; execute + have h4a : (zCL ([1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,0,1] +> default) r') [canon_tm]⊢⁺ + (([1,0,0,1] +> default) <{{D}} ([1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0] +> r')) := by + unfold zCL; simp only [append_cons,append_nil]; execute + have h4b : (([1,0,0,1] +> default) <{{D}} ([1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0] +> r')) [canon_tm]⊢⁺ + (zCL lh ((w_word ++ t ++ t ++ (t ++ d1)) +> r')) := by + unfold zCL lh w_word t d1; simp only [List.cons_append,List.nil_append,append_cons,append_nil]; execute + exact zPt (zPt h1a h1b) + (zPt (hc1 _) + (zPt (zPt (h2a _) (h2b _)) + (zPt (hc2 _) + (zPt (h3 _) + (zPt (hc3 _) (zPt h4a h4b)))))) + +theorem zW_s1 : Seg [.ch,.cj,.ch] ([.ch] ^ 2 ++ [.cp] ++ [.ch] ^ 2) t t := by + simpa only [zLp,z05,z06,List.cons_append,List.nil_append] using! zSg z0d (zSg z0c z0d) +theorem zW_s2 : Seg ([.ch] ^ 2 ++ [.cp] ++ [.ch] ^ 2) ([.ch] ^ 4 ++ [.cp] ++ [.ch] ^ 3) t t := by + simpa only [List.append_assoc] using! zSg (zS3 2) (z0m 1) +theorem zW_s3 : Seg ([.ch] ^ 4 ++ [.cp] ++ [.ch] ^ 3) ([.ch] ^ 4 ++ [.cp] ++ [.ch] ^ 2) (t ++ d1) (d0 ++ t) := by + have ha : Seg ([.ch] ^ 4) ([.ch] ^ 4) (t ++ d1) (t ++ d1) := zS0 (zS3 4) (zH_d1_even 4) + have hb1 : Seg [.cp,.ch] [.cp] (t ++ d1) (d0 ++ t) := zSg zW_td1a zW_td1b + have hb2 : Seg ([.ch] ^ 2) ([.ch] ^ 2) (d0 ++ t) (d0 ++ t) := zS0 (zH_d0_even 1) (zS3 1) + have hb : Seg ([.cp] ++ [.ch] ^ 3) ([.cp] ++ [.ch] ^ 2) (t ++ d1) (d0 ++ t) := by + simpa only [zLp,z05,z06,List.cons_append,List.nil_append] using! zSg hb1 hb2 + simpa only [List.append_assoc] using! zSg ha hb +theorem zW_s4 : Seg ([.ch] ^ 4 ++ [.cp] ++ [.ch] ^ 2) ([.ch] ^ 8 ++ [.cp] ++ [.ch] ^ 3) t t := by + simpa only [List.append_assoc] using! zSg (zS3 4) (z0m 1) +theorem zW_s5 : Seg ([.ch] ^ 8 ++ [.cp] ++ [.ch] ^ 3) ([.ch] ^ 8 ++ [.cj,.ch]) (t ++ d0) (d0 ++ t) := by + have ha : Seg ([.ch] ^ 8) ([.ch] ^ 8) (t ++ d0) (t ++ d0) := zS0 (zS3 8) (zH_d0_even 8) + have hb1 : Seg [.cp,.ch] [] (t ++ d0) (d0 ++ (t ++ one)) := zSg zW_td0a zW_td0b + have hb2 : Seg [.ch] [] (d0 ++ (t ++ one)) (d1 ++ (t ++ one)) := zS0 zH0 (z0a (t ++ one)) + have hb3 : Seg [.ch] [.cj,.ch] (d1 ++ (t ++ one)) (d0 ++ t) := zS0 zH4 zH2 + have hb : Seg ([.cp] ++ [.ch] ^ 3) [.cj,.ch] (t ++ d0) (d0 ++ t) := by + simpa only [zLp,z05,z06,List.cons_append,List.nil_append] using! zSg hb1 (zSg hb2 hb3) + simpa only [List.append_assoc] using! zSg ha hb +theorem zW_s6 : Seg ([.ch] ^ 8 ++ [.cj,.ch]) ([.ch] ^ 16 ++ [.cp] ++ [.ch] ^ 2) t t := by + have h1 : Seg ([.cj] ++ [.ch] ^ 1) ([.cp] ++ [.ch] ^ 2) t t := z0n 1 + simpa only [z06,List.cons_append,List.nil_append,List.append_assoc] using! zSg (zS3 8) h1 +theorem zW_s7 : Seg ([.ch] ^ 16 ++ [.cp] ++ [.ch] ^ 2) ([.ch] ^ 16) (t ++ d0) (d1 ++ (t ++ one)) := by + have ha : Seg ([.ch] ^ 16) ([.ch] ^ 16) (t ++ d0) (t ++ d0) := zS0 (zS3 16) (zH_d0_even 16) + have hb1 : Seg [.cp,.ch] [] (t ++ d0) (d0 ++ (t ++ one)) := zSg zW_td0a zW_td0b + have hb2 : Seg [.ch] [] (d0 ++ (t ++ one)) (d1 ++ (t ++ one)) := zS0 zH0 (z0a (t ++ one)) + have hb : Seg ([.cp] ++ [.ch] ^ 2) [] (t ++ d0) (d1 ++ (t ++ one)) := by + simpa only [zLp,z05,z06,List.cons_append,List.nil_append] using! zSg hb1 hb2 + simpa only [List.append_assoc,List.append_nil] using! zSg ha hb +theorem zW_s8 : Seg ([.ch] ^ 16) ([.ch] ^ 32) t t := zS3 16 +theorem zW_s9 : Seg ([.ch] ^ 32) ([.ch] ^ 64) t t := zS3 32 +theorem zW_s10 : Seg ([.ch] ^ 64) ([.ch] ^ 32) d1 d1 := zH_d1_even 32 +theorem zW_s11 : Seg ([.ch] ^ 32) ([.cj] ++ [.ch] ^ 63) (t ++ one) t := by + have h1 := zSg zH2 (zS3 31) + have heq_in : ([Call.ch] : List Call) ++ [Call.ch] ^ 31 = [Call.ch] ^ 32 := rfl + have heq_out : ([Call.cj,Call.ch] : List Call) ++ [Call.ch] ^ (31 * 2) = [Call.cj] ++ [Call.ch] ^ 63 := rfl + rwa [heq_in,heq_out] at h1 + +theorem zW_rest_seg : + Seg [.ch,.cj,.ch] ([.cj] ++ [.ch] ^ 63) w_rest + (t ++ t ++ (d0 ++ t) ++ t ++ (d0 ++ t) ++ t ++ (d1 ++ (t ++ one)) ++ t ++ t ++ d1 ++ t) := by + unfold w_rest + exact zS0 (zS0 (zS0 (zS0 (zS0 (zS0 (zS0 (zS0 (zS0 (zS0 zW_s1 zW_s2) zW_s3) zW_s4) zW_s5) zW_s6) zW_s7) zW_s8) zW_s9) zW_s10) zW_s11 + +theorem zW_full {r r' : zB} (h : Side ([.cj] ++ [.ch] ^ 63) r r') : + (zCf r) [canon_tm]⊢⁺ (zCf ((t ++ t ++ d1 ++ t) +> r')) := by + have h_side := zW_rest_seg r r' h + have h_turn := zW_turn h_side + have h_in : w_word +> (w_rest +> r) = w_base +> r := by + unfold w_base w_rest; simp only [List.append_assoc,append_assoc] + have h_out : (w_word ++ t ++ t ++ (t ++ d1)) +> + ((t ++ t ++ (d0 ++ t) ++ t ++ (d0 ++ t) ++ t ++ (d1 ++ (t ++ one)) ++ t ++ t ++ d1 ++ t) +> r') = + w_base +> ((t ++ t ++ d1 ++ t) +> r') := by + unfold w_base w_word w_rest t d0 d1 one + simp only [List.cons_append,List.nil_append,append_cons,append_nil] + unfold zCf + rwa [h_in,h_out] at h_turn + +-- Words, zQK, zTs, BRIncs, Num, z2f: + +open WordCalculus Word +local notation "zW" => List Word +local notation "zR" => List.replicate + +abbrev zDg := WordCalculus.DigitVal +abbrev zDg.nil := WordCalculus.DigitVal.nil +abbrev zDg.zero := @WordCalculus.DigitVal.zero +abbrev zDg.one := @WordCalculus.DigitVal.one +abbrev z0X := @WordCalculus.digitVal_not_cons_V + +def z1e : List Word -> Rat + | [] => 0 + | Word.V :: v => z1e v * (1 / 2) + | _ :: v => 1 + z1e v * 2 + +def z1f : List Word -> Rat + | [] => 0 + | Word.V :: v => z1f v * (1 / 2) + | Word.K :: v => 1 + z1f v * 2 + | Word.Q :: v => z1f v * 2 + +def z1g : List Word -> Rat + | [] => 0 + | Word.V :: v => z1g v * (1 / 2) + | Word.K :: v => z1g v * 2 + | Word.Q :: v => 1 + z1g v * 2 + +def z1h : List Word -> Rat + | [] => 1 + | Word.V :: v => z1h v * (1 / 2) + | _ :: v => z1h v * 2 + +theorem z1h_eq_wordScale : z1h = wordScale := by + funext u; induction u with + | nil => rfl + | cons a u ih => cases a <;> (dsimp [z1h, wordScale]; rw [ih]) + +theorem z1e_eq_wordMass : z1e = wordMass := by + funext u; induction u with + | nil => rfl + | cons a u ih => cases a <;> (dsimp [z1e, wordMass]; rw [ih]) + +theorem z1f_eq_wordMassK : z1f = wordMassK := by + funext u; induction u with + | nil => rfl + | cons a u ih => cases a <;> (dsimp [z1f, wordMassK]; rw [ih]) + +theorem z1g_eq_wordMassQ : z1g = wordMassQ := by + funext u; induction u with + | nil => rfl + | cons a u ih => cases a <;> (dsimp [z1g, wordMassQ]; rw [ih]) + +theorem zSp (u : List Word) : 0 < z1h u := by + rw [z1h_eq_wordScale]; exact wordScale_pos u + +theorem z1k (u v : List Word) : z1f (u ++ v) = z1f u + z1h u * z1f v := by + rw [z1f_eq_wordMassK, z1h_eq_wordScale]; exact wordMassK_append u v + +theorem z1v {A H : Nat} {u : List Word} (h : DigitVal A H u) : + TailDefect (u ++ [Word.K]) (z1f u) := by + rw [z1f_eq_wordMassK]; exact tailDefect_append_K_of_digitVal h + +theorem z1x {a : Nat} {u : List Word} {b : Nat} {v : List Word} {l : Rat} + (h : Scan a u b v l) {z : Rat} (hT : TailDefect u z) : + z1e v <= 1 + z * 2 /\ l <= 1 + z * 2 /\ + (∀ n, a = 1 + n * 2 -> z1e v <= z * 2 /\ l <= (1 / 2) + z * 2) := by + rw [z1e_eq_wordMass] + exact scan_tailDefect_bound h hT + +abbrev zSz := @not_scan_odd_cons_K +abbrev zSo := @not_scan_odd_even_Q_K +abbrev zS1 := @scan_odd_Q_K_inv +abbrev z19 := @WordCalculus.digitVal_append +abbrev z0W := @wordPrefix_true_and_cases +abbrev z0Y := @hasQKSubword +abbrev z11 := @notEndsWithQ_append_singleton +abbrev zD0 := @WordCalculus.digitVal_cons_K_inv +abbrev zD1 := @WordCalculus.digitVal_cons_Q_inv +abbrev zP2 := @pow_two_one_add + +abbrev zTs := WordCalculus.evalWords + +abbrev zHn := @heightShift +abbrev z2f := @splitLastVRev + +def zQK : Nat -> zW -> zW + | 0,u => u + | r + 1,u => Q :: K :: zQK r u + +theorem zQK_append (r : Nat) (u v : zW) : + zQK r (u ++ v) = zQK r u ++ v := by + induction r with + | zero => rfl + | succ r ih => simp [zQK,ih] + +theorem zTs_R (r_ch : Nat) (r : zB) : + zTs (zR r_ch V) r = (t ^ r_ch) +> r := by + induction r_ch with + | zero => rfl + | succ r_ch ih => + simp only [List.replicate,WordCalculus.evalWords,ih,zLp,append_assoc] + +theorem zTs_QK (r_ch : Nat) (r : zB) : + zTs (zQK r_ch [V]) r = ((d1 ++ d0) ^ r_ch ++ [1,1]) +> (d0 +> r) := by + induction r_ch with + | zero => + simp only [zQK,WordCalculus.evalWords,z05,t,d0,List.nil_append,List.cons_append,append_cons,append_nil] + | succ r_ch ih => + rw [zLp (d1 ++ d0) r_ch] + simp only [zQK,WordCalculus.evalWords,ih,d1,d0,List.cons_append,List.nil_append,append_cons,append_nil] + +inductive BRIncs : Bool -> Nat -> zB -> zB -> Prop where + | zero (r : zB) : BRIncs false 0 r (one +> r) + | T {n : Nat} {r r' : zB} : + BRIncs false (1 + n * 2) r r' -> BRIncs false (2 + n) (t +> r) (t +> r') + | pair0 {n : Nat} {r r' : zB} : + BRIncs false (n * 2) r r' -> BRIncs false (1 + n) (d1 +> (d0 +> r)) (t +> r') + | pair1 {n : Nat} {r r' : zB} : + BRIncs false (1 + n * 2) r r' -> BRIncs false (1 + n) (d1 +> (d1 +> r)) (t +> r') + | short00 {n : Nat} {r r' : zB} : + BRIncs false (n * 2) r r' -> BRIncs false (2 + n * 4) (d0 +> r) (d0 +> r') + | short01 {n : Nat} {r r' : zB} : + BRIncs false (1 + n * 2) r r' -> BRIncs false (2 + n * 4) (d1 +> r) (d0 +> r') + | short10 {n : Nat} {r r' : zB} : + BRIncs false (n * 2) r r' -> BRIncs false (4 + n * 4) (d0 +> r) (d1 +> r') + | short11 {n : Nat} {r r' : zB} : + BRIncs false (1 + n * 2) r r' -> BRIncs false (4 + n * 4) (d1 +> r) (d1 +> r') + | odd_chain0 (r_ch : Nat) {m : Nat} {r r' : zB} : + BRIncs true (1 + m * 2 ^ (1 + r_ch)) r r' -> + BRIncs false (3 + m * 4) (zTs (zQK r_ch [V]) r) (d0 +> zTs (zR r_ch V) r') + | odd_chain1 (r_ch : Nat) {m : Nat} {r r' : zB} : + BRIncs true (1 + m * 2 ^ (1 + r_ch)) r r' -> + BRIncs false (5 + m * 4) (zTs (zQK r_ch [V]) r) (d1 +> zTs (zR r_ch V) r') + | even_chain (r_ch : Nat) {m : Nat} {r r' : zB} : + BRIncs true (1 + (1 + m * 2) * 2 ^ (1 + r_ch)) r r' -> + BRIncs false (6 + m * 2) (d0 +> zTs (zQK r_ch [V]) r) (zTs (zR (1 + r_ch) V) r') + | shift_pair0 {n : Nat} {r r' : zB} : + BRIncs false (n * 2) r r' -> BRIncs true (1 + n) (d0 +> r) (t +> r') + | shift_pair1 {n : Nat} {r r' : zB} : + BRIncs false (1 + n * 2) r r' -> BRIncs true (1 + n) (d1 +> r) (t +> r') + | shift_chain0 (r_ch : Nat) {m : Nat} {r r' : zB} : + BRIncs true (1 + m * 2 ^ (2 + r_ch)) r r' -> + BRIncs true (3 + m * 4) (d0 +> zTs (zQK r_ch [V]) r) (d0 +> zTs (zR (1 + r_ch) V) r') + | shift_chain1 (r_ch : Nat) {m : Nat} {r r' : zB} : + BRIncs true (1 + m * 2 ^ (2 + r_ch)) r r' -> + BRIncs true (5 + m * 4) (d0 +> zTs (zQK r_ch [V]) r) (d1 +> zTs (zR (1 + r_ch) V) r') + +inductive Num : Bool -> Nat -> zF -> List Call -> Prop where + | zero : Num false 0 one [] + | odd (n : Nat) : Num false (1 + n * 2) [] ([.cp] ++ [.ch] ^ n) + | even (n : Nat) : Num false (2 + n * 2) [] ([.cj] ++ [.ch] ^ n) + | shift (n : Nat) : Num true (1 + n * 2) d0 ([.ch,.cp] ++ [.ch] ^ n) + +def loc_z2f (s : Bool) (k : Nat) (r r' : zB) : Prop := + ∀ w hs,Num s k w hs -> Side hs (w +> r) r' + +theorem loc_z2g {r r' : zB} (h : loc_z2f false 0 r r') : + r' = one +> r := by + have h0 := h one [] Num.zero + cases h0 + rfl + +theorem loc_z2h {n : Nat} {r r' : zB} + (hI : loc_z2f false (1 + n * 2) r r') : loc_z2f false (2 + n) (t +> r) (t +> r') := by + intro w hs hN + generalize hs_eq : false = s0 at hN + generalize hk : 2 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil] + cases m with + | zero => omega + | succ m => + have h1m : m + 1 = 1 + m := by omega + rw [h1m] + refine zSc (z0m m) ?_ + have hN1 : Num false (1 + n * 2) [] ([.cp] ++ [.ch] ^ (1 + m * 2)) := by + have hm : 1 + n * 2 = 1 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.odd (1 + m * 2) + simpa using! hI [] _ hN1 + | @even m => + simp only [append_nil] + refine zSc (z0n m) ?_ + have hN1 : Num false (1 + n * 2) [] ([.cp] ++ [.ch] ^ (m * 2)) := by + have hm : 1 + n * 2 = 1 + (m * 2) * 2 := by omega + rw [hm]; exact Num.odd (m * 2) + simpa using! hI [] _ hN1 + | shift _ => contradiction + +theorem z2i_p0 {n : Nat} {r r' : zB} + (hI : loc_z2f false (n * 2) r r') : loc_z2f false (1 + n) (d1 +> (d0 +> r)) (t +> r') := by + intro w hs hN + generalize hs_eq : false = s0 at hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil,<- append_assoc d1 d0 r] + cases m with + | zero => + have hn0 : n * 2 = 0 := by omega + rw [hn0] at hI + have hr' := loc_z2g hI + subst hr' + rw [<- append_assoc t one r] + exact zSc z0e (Side.nil r) + | succ m => + have h1m : m + 1 = 1 + m := by omega + rw [h1m] + refine zSc (z0o m) ?_ + have hN2 : Num false (n * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : n * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using! hI [] _ hN2 + | @even m => + simp only [append_nil,<- append_assoc d1 d0 r] + refine zSc (z0p m) ?_ + have hN2 : Num false (n * 2) [] ([.cj] ++ [.ch] ^ (m * 2)) := by + have hm : n * 2 = 2 + (m * 2) * 2 := by omega + rw [hm]; exact Num.even (m * 2) + simpa using! hI [] _ hN2 + | shift _ => contradiction + +theorem loc_z2j {n : Nat} {r r' : zB} + (hI : loc_z2f false (1 + n * 2) r r') : loc_z2f false (1 + n) (d1 +> (d1 +> r)) (t +> r') := by + intro w hs hN + generalize hs_eq : false = s0 at hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => omega + | @odd m => + simp only [append_nil,<- append_assoc d1 d1 r] + refine zSc (z0q m) ?_ + have hN1 : Num false (1 + n * 2) [] ([.cp] ++ [.ch] ^ (m * 2)) := by + have hm : 1 + n * 2 = 1 + (m * 2) * 2 := by omega + rw [hm]; exact Num.odd (m * 2) + simpa using! hI [] _ hN1 + | @even m => + simp only [append_nil,<- append_assoc d1 d1 r] + refine zSc (z0r m) ?_ + have hN1 : Num false (1 + n * 2) [] ([.cp] ++ [.ch] ^ (1 + m * 2)) := by + have hm : 1 + n * 2 = 1 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.odd (1 + m * 2) + simpa using! hI [] _ hN1 + | shift _ => contradiction + +theorem loc_z2k {n : Nat} {r r' : zB} + (hI : loc_z2f false (n * 2) r r') : loc_z2f false (2 + n * 4) (d0 +> r) (d0 +> r') := by + intro w hs hN + generalize hs_eq : false = s0 at hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2g hI + subst hr' + rw [<- append_assoc d0 one r] + exact zSc z0i (Side.nil r) + | succ n => + have heq : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq] + refine zSc (z0s n) ?_ + have hN2 : Num false ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + rw [heq]; exact Num.even n + simpa using! hI [] _ hN2 + | shift _ => contradiction + +theorem loc_z2l {n : Nat} {r r' : zB} + (hI : loc_z2f false (1 + n * 2) r r') : loc_z2f false (2 + n * 4) (d1 +> r) (d0 +> r') := by + intro w hs hN + generalize hs_eq : false = s0 at hN + generalize hk : 2 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = n * 2 := by omega + subst hm + refine zSc (z0t n) ?_ + simpa using! hI [] _ (Num.odd n) + | shift _ => contradiction + +theorem loc_z2m {n : Nat} {r r' : zB} + (hI : loc_z2f false (n * 2) r r') : loc_z2f false (4 + n * 4) (d0 +> r) (d1 +> r') := by + intro w hs hN + generalize hs_eq : false = s0 at hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + cases n with + | zero => + have hr' := loc_z2g hI + subst hr' + rw [<- append_assoc d1 one r] + exact zSc z0u (Side.nil r) + | succ n => + have heq : 1 + (n + 1) * 2 = 3 + n * 2 := by omega + rw [heq] + refine zSc (z0v n) ?_ + have hN2 : Num false ((n + 1) * 2) [] ([.cj] ++ [.ch] ^ n) := by + have heq2 : (n + 1) * 2 = 2 + n * 2 := by omega + rw [heq2]; exact Num.even n + simpa using! hI [] _ hN2 + | shift _ => contradiction + +theorem loc_z2n {n : Nat} {r r' : zB} + (hI : loc_z2f false (1 + n * 2) r r') : loc_z2f false (4 + n * 4) (d1 +> r) (d1 +> r') := by + intro w hs hN + generalize hs_eq : false = s0 at hN + generalize hk : 4 + n * 4 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even m => + simp only [append_nil] + have hm : m = 1 + n * 2 := by omega + subst hm + refine zSc (z0w n) ?_ + simpa using! hI [] _ (Num.odd n) + | shift _ => contradiction + +theorem z2_oc0 (r_ch : Nat) {m : Nat} {r r' : zB} + (hI : loc_z2f true (1 + m * 2 ^ (1 + r_ch)) r r') : + loc_z2f false (3 + m * 4) (zTs (zQK r_ch [V]) r) (d0 +> zTs (zR r_ch V) r') := by + intro w hs hN + generalize hs_eq : false = s0 at hN + generalize hk : 3 + m * 4 = k at hN + cases hN with + | zero => omega + | @odd n => + simp only [append_nil] + have hn : n = 1 + m * 2 := by omega + subst hn + rw [zTs_QK,zTs_R,<- append_assoc d0 (t ^ r_ch) r'] + have h_seg : Seg ([.cp] ++ [.ch] ^ (1 + m * 2)) ([.ch,.cp] ++ [.ch] ^ (m * 2 ^ r_ch)) + ((d1 ++ d0) ^ r_ch ++ [1,1]) (d0 ++ t ^ r_ch) := by + have h1 := zOdd_base r_ch + have h2 := zS0 (zH_d0_even m) (zT_pow r_ch m) + simpa only [zLp',List.cons_append,List.nil_append,List.append_assoc] using! zSg h1 h2 + refine zSc h_seg ?_ + have h_num : Num true (1 + m * 2 ^ (1 + r_ch)) d0 ([.ch,.cp] ++ [.ch] ^ (m * 2 ^ r_ch)) := by + have heq : 1 + m * 2 ^ (1 + r_ch) = 1 + (m * 2 ^ r_ch) * 2 := by + rw [Nat.add_comm 1 r_ch,Nat.pow_succ]; ring + rw [heq]; exact Num.shift (m * 2 ^ r_ch) + exact hI d0 _ h_num + | even _ => omega + | shift _ => contradiction + +theorem z2_oc1 (r_ch : Nat) {m : Nat} {r r' : zB} + (hI : loc_z2f true (1 + m * 2 ^ (1 + r_ch)) r r') : + loc_z2f false (5 + m * 4) (zTs (zQK r_ch [V]) r) (d1 +> zTs (zR r_ch V) r') := by + intro w hs hN + generalize hs_eq : false = s0 at hN + generalize hk : 5 + m * 4 = k at hN + cases hN with + | zero => omega + | @odd n => + simp only [append_nil] + have hn : n = 1 + (1 + m * 2) := by omega + subst hn + rw [zTs_QK,zTs_R,<- append_assoc d1 (t ^ r_ch) r'] + have h_seg : Seg ([.cp] ++ [.ch] ^ (1 + (1 + m * 2))) ([.ch,.cp] ++ [.ch] ^ (m * 2 ^ r_ch)) + ((d1 ++ d0) ^ r_ch ++ [1,1]) (d1 ++ t ^ r_ch) := by + have h1 := zOdd_base r_ch + have h2 := zS0 (zH_d0_odd m) (zT_pow r_ch m) + simpa only [zLp',List.cons_append,List.nil_append,List.append_assoc] using! zSg h1 h2 + refine zSc h_seg ?_ + have h_num : Num true (1 + m * 2 ^ (1 + r_ch)) d0 ([.ch,.cp] ++ [.ch] ^ (m * 2 ^ r_ch)) := by + have heq : 1 + m * 2 ^ (1 + r_ch) = 1 + (m * 2 ^ r_ch) * 2 := by + rw [Nat.add_comm 1 r_ch,Nat.pow_succ]; ring + rw [heq]; exact Num.shift (m * 2 ^ r_ch) + exact hI d0 _ h_num + | even _ => omega + | shift _ => contradiction + +theorem z2_ec (r_ch : Nat) {m : Nat} {r r' : zB} + (hI : loc_z2f true (1 + (1 + m * 2) * 2 ^ (1 + r_ch)) r r') : + loc_z2f false (6 + m * 2) (d0 +> zTs (zQK r_ch [V]) r) (zTs (zR (1 + r_ch) V) r') := by + intro w hs hN + generalize hs_eq : false = s0 at hN + generalize hk : 6 + m * 2 = k at hN + cases hN with + | zero => omega + | odd _ => omega + | @even n => + simp only [append_nil] + have hn : n = 1 + (1 + m) := by omega + subst hn + rw [zTs_QK,zTs_R,<- append_assoc d0 ((d1 ++ d0) ^ r_ch ++ [1,1]) (d0 +> r)] + have h_seg : Seg ([.cj] ++ [.ch] ^ (1 + (1 + m))) ([.ch,.cp] ++ [.ch] ^ ((1 + m * 2) * 2 ^ r_ch)) + (d0 ++ ((d1 ++ d0) ^ r_ch ++ [1,1])) (t ^ (1 + r_ch)) := by + have h1 : Seg [.cj,.ch,.ch] ([.ch,.cp] ++ [.ch] ^ (2 ^ r_ch)) (d0 ++ ((d1 ++ d0) ^ r_ch ++ [1,1])) (t ^ (1 + r_ch)) := by + simpa only [List.append_assoc] using! zEven_base r_ch + have h2 := zT_pow (1 + r_ch) m + have h3 := zSg h1 h2 + have heq_in : ([Call.cj,Call.ch,Call.ch] : List Call) ++ [Call.ch] ^ m = [Call.cj] ++ [Call.ch] ^ (1 + (1 + m)) := by + simp only [zLp',List.cons_append,List.nil_append] + have heq_out : ([Call.ch,Call.cp] ++ [Call.ch] ^ (2 ^ r_ch)) ++ [Call.ch] ^ (m * 2 ^ (1 + r_ch)) = + [Call.ch,Call.cp] ++ [Call.ch] ^ ((1 + m * 2) * 2 ^ r_ch) := by + rw [List.append_assoc,<- z07] + congr 2 + rw [Nat.add_comm 1 r_ch,Nat.pow_succ]; ring + rwa [heq_in,heq_out] at h3 + refine zSc h_seg ?_ + have h_num : Num true (1 + (1 + m * 2) * 2 ^ (1 + r_ch)) d0 ([.ch,.cp] ++ [.ch] ^ ((1 + m * 2) * 2 ^ r_ch)) := by + have heq : 1 + (1 + m * 2) * 2 ^ (1 + r_ch) = 1 + ((1 + m * 2) * 2 ^ r_ch) * 2 := by + rw [Nat.add_comm 1 r_ch,Nat.pow_succ]; ring + rw [heq]; exact Num.shift ((1 + m * 2) * 2 ^ r_ch) + exact hI d0 _ h_num + | shift _ => contradiction + +theorem z2_sp0 {n : Nat} {r r' : zB} + (hI : loc_z2f false (n * 2) r r') : loc_z2f true (1 + n) (d0 +> r) (t +> r') := by + intro w hs hN + generalize hs_eq : true = s0 at hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => contradiction + | odd _ => contradiction + | even _ => contradiction + | @shift m => + have hn : n = m * 2 := by omega + subst hn + rw [<- append_assoc d0 d0 r] + cases m with + | zero => + have hn0 : 0 * 2 * 2 = 0 := rfl + rw [hn0] at hI + have hr' := loc_z2g hI + subst hr' + rw [<- append_assoc t one r] + have h_seg : Seg ([.ch,.cp] ++ [.ch] ^ 0) [] (d0 ++ d0) (t ++ one) := by + simpa only [z05,List.append_nil] using! zSg (zS0 zH0 (z0a d0)) z0e + exact zSc h_seg (Side.nil r) + | succ m => + have h1m : m + 1 = 1 + m := by omega + rw [h1m] at hI ⊢ + have h_seg : Seg ([.ch,.cp] ++ [.ch] ^ (1 + m)) ([.cj] ++ [.ch] ^ (1 + m * 2)) (d0 ++ d0) t := by + simpa only [List.cons_append,List.nil_append] using! zSg (zS0 zH0 (z0a d0)) (z0o m) + refine zSc h_seg ?_ + have hN2 : Num false ((1 + m) * 2 * 2) [] ([.cj] ++ [.ch] ^ (1 + m * 2)) := by + have hm : (1 + m) * 2 * 2 = 2 + (1 + m * 2) * 2 := by omega + rw [hm]; exact Num.even (1 + m * 2) + simpa using! hI [] _ hN2 + +theorem z2_sp1 {n : Nat} {r r' : zB} + (hI : loc_z2f false (1 + n * 2) r r') : loc_z2f true (1 + n) (d1 +> r) (t +> r') := by + intro w hs hN + generalize hs_eq : true = s0 at hN + generalize hk : 1 + n = k at hN + cases hN with + | zero => contradiction + | odd _ => contradiction + | even _ => contradiction + | @shift m => + have hn : n = m * 2 := by omega + subst hn + rw [<- append_assoc d0 d1 r] + have h_seg : Seg ([.ch,.cp] ++ [.ch] ^ m) ([.cp] ++ [.ch] ^ (m * 2)) (d0 ++ d1) t := by + simpa only [List.cons_append,List.nil_append] using! zSg (zS0 zH0 (z0a d1)) (z0q m) + refine zSc h_seg ?_ + have hN1 : Num false (1 + m * 2 * 2) [] ([.cp] ++ [.ch] ^ (m * 2)) := by + have hm : 1 + m * 2 * 2 = 1 + (m * 2) * 2 := by omega + rw [hm]; exact Num.odd (m * 2) + simpa using! hI [] _ hN1 + +theorem z2_sc0 (r_ch : Nat) {m : Nat} {r r' : zB} + (hI : loc_z2f true (1 + m * 2 ^ (2 + r_ch)) r r') : + loc_z2f true (3 + m * 4) (d0 +> zTs (zQK r_ch [V]) r) (d0 +> zTs (zR (1 + r_ch) V) r') := by + intro w hs hN + generalize hs_eq : true = s0 at hN + generalize hk : 3 + m * 4 = k at hN + cases hN with + | zero => contradiction + | odd _ => contradiction + | even _ => contradiction + | @shift n => + have hn : n = 1 + m * 2 := by omega + subst hn + rw [zTs_QK,zTs_R,<- append_assoc d0 (t ^ (1 + r_ch)) r'] + have h_in : d0 +> (d0 +> (((d1 ++ d0) ^ r_ch ++ [1,1]) +> (d0 +> r))) = + (d0 ++ ((d0 ++ (d1 ++ d0) ^ r_ch ++ [1,1]))) +> (d0 +> r) := by + simp only [List.append_assoc,append_assoc] + rw [h_in] + have h_seg : Seg ([.ch,.cp] ++ [.ch] ^ (1 + m * 2)) ([.ch,.cp] ++ [.ch] ^ (m * 2 ^ (1 + r_ch))) + (d0 ++ (d0 ++ (d1 ++ d0) ^ r_ch ++ [1,1])) (d0 ++ t ^ (1 + r_ch)) := by + have h0 : Seg [.ch] [] (d0 ++ (d0 ++ (d1 ++ d0) ^ r_ch ++ [1,1])) ((d1 ++ d0) ^ (1 + r_ch) ++ [1,1]) := by + rw [zLp'] + simpa only [List.append_assoc] using! zS0 zH0 (z0a (d0 ++ (d1 ++ d0) ^ r_ch ++ [1,1])) + have h1 := zOdd_base (1 + r_ch) + have h2 := zS0 (zH_d0_even m) (zT_pow (1 + r_ch) m) + simpa only [zLp',List.cons_append,List.nil_append,List.append_assoc] using! zSg h0 (zSg h1 h2) + refine zSc h_seg ?_ + have h_num : Num true (1 + m * 2 ^ (2 + r_ch)) d0 ([.ch,.cp] ++ [.ch] ^ (m * 2 ^ (1 + r_ch))) := by + have heq : 1 + m * 2 ^ (2 + r_ch) = 1 + (m * 2 ^ (1 + r_ch)) * 2 := by + have h2r : 2 + r_ch = (1 + r_ch) + 1 := by omega + rw [h2r,Nat.pow_succ]; ring + rw [heq]; exact Num.shift (m * 2 ^ (1 + r_ch)) + exact hI d0 _ h_num + +theorem z2_sc1 (r_ch : Nat) {m : Nat} {r r' : zB} + (hI : loc_z2f true (1 + m * 2 ^ (2 + r_ch)) r r') : + loc_z2f true (5 + m * 4) (d0 +> zTs (zQK r_ch [V]) r) (d1 +> zTs (zR (1 + r_ch) V) r') := by + intro w hs hN + generalize hs_eq : true = s0 at hN + generalize hk : 5 + m * 4 = k at hN + cases hN with + | zero => contradiction + | odd _ => contradiction + | even _ => contradiction + | @shift n => + have hn : n = 1 + (1 + m * 2) := by omega + subst hn + rw [zTs_QK,zTs_R,<- append_assoc d1 (t ^ (1 + r_ch)) r'] + have h_in : d0 +> (d0 +> (((d1 ++ d0) ^ r_ch ++ [1,1]) +> (d0 +> r))) = + (d0 ++ ((d0 ++ (d1 ++ d0) ^ r_ch ++ [1,1]))) +> (d0 +> r) := by + simp only [List.append_assoc,append_assoc] + rw [h_in] + have h_seg : Seg ([.ch,.cp] ++ [.ch] ^ (1 + (1 + m * 2))) ([.ch,.cp] ++ [.ch] ^ (m * 2 ^ (1 + r_ch))) + (d0 ++ (d0 ++ (d1 ++ d0) ^ r_ch ++ [1,1])) (d1 ++ t ^ (1 + r_ch)) := by + have h0 : Seg [.ch] [] (d0 ++ (d0 ++ (d1 ++ d0) ^ r_ch ++ [1,1])) ((d1 ++ d0) ^ (1 + r_ch) ++ [1,1]) := by + rw [zLp'] + simpa only [List.append_assoc] using! zS0 zH0 (z0a (d0 ++ (d1 ++ d0) ^ r_ch ++ [1,1])) + have h1 := zOdd_base (1 + r_ch) + have h2 := zS0 (zH_d0_odd m) (zT_pow (1 + r_ch) m) + simpa only [zLp',List.cons_append,List.nil_append,List.append_assoc] using! zSg h0 (zSg h1 h2) + refine zSc h_seg ?_ + have h_num : Num true (1 + m * 2 ^ (2 + r_ch)) d0 ([.ch,.cp] ++ [.ch] ^ (m * 2 ^ (1 + r_ch))) := by + have heq : 1 + m * 2 ^ (2 + r_ch) = 1 + (m * 2 ^ (1 + r_ch)) * 2 := by + have h2r : 2 + r_ch = (1 + r_ch) + 1 := by omega + rw [h2r,Nat.pow_succ]; ring + rw [heq]; exact Num.shift (m * 2 ^ (1 + r_ch)) + exact hI d0 _ h_num + +theorem loc_z2o {s : Bool} {k : Nat} {r r' : zB} (hI : BRIncs s k r r') : + loc_z2f s k r r' := by + induction hI with + | zero r => + intro w hs hN + generalize hs_eq : false = s0 at hN + generalize hk : 0 = k0 at hN + cases hN with + | zero => exact Side.nil (one +> r) + | odd _ => omega + | even _ => omega + | shift _ => contradiction + | T _ ih => exact loc_z2h ih + | pair0 _ ih => exact z2i_p0 ih + | pair1 _ ih => exact loc_z2j ih + | short00 _ ih => exact loc_z2k ih + | short01 _ ih => exact loc_z2l ih + | short10 _ ih => exact loc_z2m ih + | short11 _ ih => exact loc_z2n ih + | odd_chain0 r_ch _ ih => exact z2_oc0 r_ch ih + | odd_chain1 r_ch _ ih => exact z2_oc1 r_ch ih + | even_chain r_ch _ ih => exact z2_ec r_ch ih + | shift_pair0 _ ih => exact z2_sp0 ih + | shift_pair1 _ ih => exact z2_sp1 ih + | shift_chain0 r_ch _ ih => exact z2_sc0 r_ch ih + | shift_chain1 r_ch _ ih => exact z2_sc1 r_ch ih + +theorem loc_z2p {r r' : zB} (hI : BRIncs false 128 r r') : + (zCf r) [canon_tm]⊢⁺ (zCf (zTs [V,V,Q,V] r')) := by + have hC := loc_z2o hI [] ([.cj] ++ [.ch] ^ 63) (Num.even 63) + simp only [append_nil] at hC + have hW := zW_full hC + have heq : (t ++ t ++ d1 ++ t) +> r' = zTs [V,V,Q,V] r' := by + simp only [WordCalculus.evalWords,t,d1,List.cons_append,List.nil_append,append_cons,append_nil] + rwa [heq] at hW + +-- Section 7A: Binary, Digits (zDg), Weights (z0Y..z11, z0W), z0L, zHn +inductive Binary : Nat -> Nat -> zB -> Prop where + | one : Binary 1 1 (d1 +> default) + | zero {n H : Nat} {r : zB} : Binary (1 + n) H r -> Binary (2 + n * 2) (1 + H) (d0 +> r) + | two {n H : Nat} {r : zB} : Binary (1 + n) H r -> Binary (3 + n * 2) (1 + H) (d1 +> r) + +theorem z0H {A H : Nat} {r : zB} (h : Binary A H r) : + BRIncs false ((A - 1) * 2) default r := by + induction h with + | one => + have h0 := BRIncs.zero (default : zB) + have hd : d1 +> (default : zB) = one +> default := by simp [d1,one] + rw [hd]; exact h0 + | @zero n H r _ ih => + have ih' : BRIncs false (n * 2) default r := by + have heq : ((1 + n) - 1) * 2 = n * 2 := by omega + rwa [heq] at ih + have hs := BRIncs.short00 ih' + rw [zDd] at hs + have heq : ((2 + n * 2) - 1) * 2 = 2 + n * 4 := by omega + rwa [heq] + | @two n H r _ ih => + have ih' : BRIncs false (n * 2) default r := by + have heq : ((1 + n) - 1) * 2 = n * 2 := by omega + rwa [heq] at ih + have hs := BRIncs.short10 ih' + rw [zDd] at hs + have heq : ((3 + n * 2) - 1) * 2 = 4 + n * 4 := by omega + rwa [heq] + +theorem loc_z0X {A H : Nat} {u : zW} (h1 : zDg A H u) : + ∀ {v : zW},zDg A H v -> u = v := by + induction h1 with + | nil => + intro v h2 + cases v with + | nil => rfl + | cons w v' => + cases w with + | V => exact False.elim (z0X h2) + | K => rcases zD0 h2 with ⟨_,_,_,_,h⟩; omega + | Q => rcases zD1 h2 with ⟨_,_,_,_,h⟩; omega + | @zero A H u _ ih => + intro v h2 + generalize hA_eq : A * 2 = A0 at h2 + generalize hH_eq : 1 + H = H0 at h2 + cases h2 with + | nil => omega + | @zero A' H' v' hD => + have hA : A = A' := by omega + have hH : H = H' := by omega + subst hA hH; rw [ih hD] + | one _ => omega + | @one A H u _ ih => + intro v h2 + generalize hA_eq : 1 + A * 2 = A0 at h2 + generalize hH_eq : 1 + H = H0 at h2 + cases h2 with + | nil => omega + | zero _ => omega + | @one A' H' v' hD => + have hA : A = A' := by omega + have hH : H = H' := by omega + subst hA hH; rw [ih hD] + +def z0L : zW -> Bool + | Q :: K :: _ => true + | Q :: Q :: _ => true + | _ :: v => z0L v + | [] => false + +theorem loc_z1I (u v : zW) (h : z0L v = true) : z0L (u ++ v) = true := by + induction u with + | nil => exact h + | cons w u ih => + cases w with + | V => exact ih + | K => exact ih + | Q => + cases u with + | nil => + cases v with + | nil => contradiction + | cons w2 v' => (cases w2 <;> simp [z0L] at h ⊢); exact h + | cons w2 u' => + cases w2 with + | V => exact ih + | K => rfl + | Q => rfl + +theorem zDg_pos_z0L {A H : Nat} {w : zW} (hD : zDg A H w) (hPos : 0 < A) : + z0L (w ++ [K]) = true := by + induction hD with + | nil => omega + | @zero A1 H1 u1 _ ih => + exact ih (by omega) + | @one A1 H1 u1 hDu _ => + cases hDu with + | nil => rfl + | zero _ => rfl + | one _ => rfl + +@[simp] def loc_z0W : zW -> Rat + | [] => 0 + | V :: v => loc_z0W v * (1 / 2) + | K :: v => (11 / 8) + loc_z0W v * 2 + | Q :: v => 1 + loc_z0W v * 2 + +theorem loc_zWn (u : zW) : 0 <= z1e u /\ 0 <= z1f u /\ 0 <= z1g u /\ 0 <= loc_z0W u := by + induction u with + | nil => simp [z1e,z1f,z1g,loc_z0W] + | cons a u ih => + cases a <;> (dsimp [z1e,z1f,z1g,loc_z0W]; refine ⟨by linarith,by linarith,by linarith,by linarith⟩) + +theorem zWY (u : zW) : z1e u <= loc_z0W u /\ loc_z0W u <= (11 / 8) * z1e u := by + induction u with + | nil => simp [z1e,loc_z0W] + | cons a u ih => + cases a <;> (dsimp [z1e,loc_z0W]; constructor <;> linarith) + +theorem z13W (u v : zW) : loc_z0W (u ++ v) = loc_z0W u + z1h u * loc_z0W v := by + induction u with + | nil => simp [loc_z0W,z1h] + | cons a u ih => cases a <;> (dsimp [loc_z0W,z1h]; rw [ih]; ring) + +theorem loc_z1B (u : zW) : + ∀ (h : Nat),z1e u < ((2 ^ h : Nat) : Rat) -> ∃ H,zHn u h = some H := by + induction u with + | nil => intro h _; exact ⟨h,rfl⟩ + | cons w u ih => + intro h hM + cases w with + | V => + dsimp [z1e,zHn] at hM ⊢ + apply ih (h + 1) + rw [Nat.pow_succ]; push_cast at hM ⊢; linarith + | K => + cases h with + | zero => + have hw := (loc_zWn u).1 + dsimp [z1e] at hM; linarith + | succ h => + dsimp [z1e,zHn] at hM ⊢ + apply ih h + rw [Nat.pow_succ] at hM; push_cast at hM ⊢; linarith + | Q => + cases h with + | zero => + have hw := (loc_zWn u).1 + dsimp [z1e] at hM; linarith + | succ h => + dsimp [z1e,zHn] at hM ⊢ + apply ih h + rw [Nat.pow_succ] at hM; push_cast at hM ⊢; linarith + +theorem loc_z1K {n H : Nat} {ds : zW} (hD : zDg (1 + n * 4) H ds) (hH : 2 <= H) : + ∃ w,ds = Q :: K :: w := by + generalize hA_eq : 1 + n * 4 = A at hD + cases hD with + | nil => omega + | zero _ => omega + | @one A1 H1 u1 hD1 => + have hA1 : A1 = n * 2 := by omega + subst hA1 + generalize hA1_eq : n * 2 = A1' at hD1 + cases hD1 with + | nil => omega + | @zero A2 H2 w _ => exact ⟨w,rfl⟩ + | one _ => omega + +-- Section 7B: Scan on digit words + +theorem z0L_odd_scan {n : Nat} {w : zW} {b : Nat} {v : zW} {l : Rat} + (h : Scan (1 + n * 2) (w ++ [Q,Q,K]) b v l) + (hL : z0L (Q :: w ++ [K]) = true) : + z0L (w ++ [K]) = true := by + cases w with + | nil => + exact False.elim (zSo 1 n b v l h) + | cons t0 w' => + cases t0 with + | V => exact hL + | K => exact False.elim (zSz n (w' ++ [Q,Q,K]) b v l h) + | Q => + cases w' with + | nil => rfl + | cons t1 w'' => + cases t1 with + | K => rfl + | Q => rfl + | V => + change Scan (1 + n * 2) (Q :: V :: (w'' ++ [Q,Q,K])) b v l at h + generalize ha : 1 + n * 2 = a at h + cases h <;> omega + +theorem zScan_qqk {a : Nat} {u : zW} {b : Nat} {v : zW} {l : Rat} + (h : Scan a u b v l) : + ∀ (w0 : zW),u = w0 ++ [Q,Q,K] -> + z1h v <= (1 / 8) * z1h u /\ + (z0L (w0 ++ [K]) = true -> z1h v <= (1 / 64) * z1h u) /\ + (∃ n,b = n * 4) /\ + (∃ v0,v = v0 ++ [V]) := by + induction h with + | nil _ => + intro w0 hu + cases w0 <;> simp at hu + | @T n u0 k v0 l0 _ ih => + intro w0 hu + cases w0 with + | nil => simp at hu + | cons t0 w' => + injection hu with ht0 hu0; subst ht0 + rcases ih w' hu0 with ⟨h1,h2,⟨m,hm⟩,⟨vp,hvp⟩⟩ + refine ⟨by dsimp [z1h]; linarith,fun hL => ?_,⟨m,hm⟩,⟨V :: vp,by simp [hvp]⟩⟩ + have h2' := h2 hL + dsimp [z1h]; linarith + | @pair0 n u0 k v0 l0 _ ih => + intro w0 hu + cases w0 with + | nil => simp at hu + | cons t0 w1 => + cases w1 with + | nil => cases t0 <;> simp at hu + | cons t1 w' => + injection hu with ht0 hu1 + injection hu1 with ht1 hu0 + subst ht0 ht1 + rcases ih w' hu0 with ⟨h1,_,⟨m,hm⟩,⟨vp,hvp⟩⟩ + have hp := zSp u0 + refine ⟨by dsimp [z1h]; linarith,fun _ => by dsimp [z1h]; linarith,⟨m,hm⟩,⟨V :: vp,by simp [hvp]⟩⟩ + | @pair1 n u0 k v0 l0 hSub ih => + intro w0 hu + cases w0 with + | nil => + injection hu with _ hu1 + injection hu1 with _ hu0 + subst hu0 + exact False.elim (zSz n [] k v0 l0 hSub) + | cons t0 w1 => + cases w1 with + | nil => + injection hu with ht0 hu1 + injection hu1 with _ hu0 + subst ht0 hu0 + rcases zS1 0 (1 + n * 2) k v0 l0 hSub with ⟨rfl,hk,_⟩ + refine ⟨by norm_num [z1h],fun _ => by norm_num [z1h],⟨n,by omega⟩,⟨[V],rfl⟩⟩ + | cons t1 w' => + injection hu with ht0 hu1 + injection hu1 with ht1 hu0 + subst ht0 ht1 + rcases ih w' hu0 with ⟨h1,_,⟨m,hm⟩,⟨vp,hvp⟩⟩ + have hp := zSp u0 + refine ⟨by dsimp [z1h]; linarith,fun _ => by dsimp [z1h]; linarith,⟨m,hm⟩,⟨V :: vp,by simp [hvp]⟩⟩ + | @short00 n u0 k v0 l0 _ ih => + intro w0 hu + cases w0 with + | nil => simp at hu + | cons t0 w' => + injection hu with ht0 hu0; subst ht0 + rcases ih w' hu0 with ⟨h1,h2,⟨m,hm⟩,⟨vp,hvp⟩⟩ + refine ⟨by dsimp [z1h]; linarith,fun hL => ?_,⟨m,hm⟩,⟨K :: vp,by simp [hvp]⟩⟩ + have h2' := h2 hL + dsimp [z1h]; linarith + | @short10 n u0 k v0 l0 _ ih => + intro w0 hu + cases w0 with + | nil => simp at hu + | cons t0 w' => + injection hu with ht0 hu0; subst ht0 + rcases ih w' hu0 with ⟨h1,h2,⟨m,hm⟩,⟨vp,hvp⟩⟩ + refine ⟨by dsimp [z1h]; linarith,fun hL => ?_,⟨m,hm⟩,⟨Q :: vp,by simp [hvp]⟩⟩ + have h2' := h2 hL + dsimp [z1h]; linarith + | @short01 n u0 k v0 l0 hSub ih => + intro w0 hu + cases w0 with + | nil => + injection hu with _ hu0; subst hu0 + rcases zS1 0 (1 + n * 2) k v0 l0 hSub with ⟨rfl,hk,_⟩ + refine ⟨by norm_num [z1h],fun hL => by contradiction,⟨n,by omega⟩,⟨[K],rfl⟩⟩ + | cons t0 w' => + injection hu with ht0 hu0; subst ht0 + rcases ih w' hu0 with ⟨h1,h2,⟨m,hm⟩,⟨vp,hvp⟩⟩ + refine ⟨by dsimp [z1h]; linarith,fun hL => ?_,⟨m,hm⟩,⟨K :: vp,by simp [hvp]⟩⟩ + rw [hu0] at hSub + have h2' := h2 (z0L_odd_scan hSub hL) + dsimp [z1h]; linarith + | @short11 n u0 k v0 l0 hSub ih => + intro w0 hu + cases w0 with + | nil => + injection hu with _ hu0; subst hu0 + rcases zS1 0 (1 + n * 2) k v0 l0 hSub with ⟨rfl,hk,_⟩ + refine ⟨by norm_num [z1h],fun hL => by contradiction,⟨n,by omega⟩,⟨[Q],rfl⟩⟩ + | cons t0 w' => + injection hu with ht0 hu0; subst ht0 + rcases ih w' hu0 with ⟨h1,h2,⟨m,hm⟩,⟨vp,hvp⟩⟩ + refine ⟨by dsimp [z1h]; linarith,fun hL => ?_,⟨m,hm⟩,⟨Q :: vp,by simp [hvp]⟩⟩ + rw [hu0] at hSub + have h2' := h2 (z0L_odd_scan hSub hL) + dsimp [z1h]; linarith + +-- Section 7C: BScan (15 constructors) and its lemmas +def zIv : Nat -> Rat + | 0 => 1 + | r + 1 => zIv r * (1 / 2) + +def zP4 : Nat -> Rat + | 0 => 1 + | r + 1 => zP4 r * 4 + +theorem zIv_P4 (r : Nat) : + 0 < zIv r /\ zIv r <= 1 /\ 1 <= zP4 r /\ (1 <= r -> 4 <= zP4 r /\ 8 * zIv r <= zP4 r) := by + induction r with + | zero => + dsimp [zIv,zP4] + refine ⟨by linarith,by linarith,by linarith,fun h => by omega⟩ + | succ r ih => + rcases ih with ⟨h1,h2,h3,h4⟩ + dsimp [zIv,zP4] + cases r with + | zero => + dsimp [zIv,zP4] + refine ⟨by linarith,by linarith,by linarith,fun _ => ⟨by linarith,by linarith⟩⟩ + | succ r' => + rcases h4 (by omega) with ⟨h4a,h4b⟩ + refine ⟨by linarith,by linarith,by linarith,fun _ => ⟨by linarith,by linarith⟩⟩ + +theorem z11_R (r : Nat) (u : zW) : + z1h (zR r V ++ u) = zIv r * z1h u := by + induction r with + | zero => simp [zIv] + | succ r ih => + dsimp [List.replicate,z1h,zIv] + rw [ih]; ring + +theorem z11_QK (r : Nat) (u : zW) : + z1h (zQK r u) = zP4 r * z1h u := by + induction r with + | zero => simp [zQK,zP4] + | succ r ih => + dsimp [zQK,z1h,zP4] + rw [ih]; ring + +theorem z0W_R (r : Nat) (u : zW) : + loc_z0W (zR r V ++ u) = zIv r * loc_z0W u := by + induction r with + | zero => simp [zIv] + | succ r ih => + dsimp [List.replicate,loc_z0W,zIv] + rw [ih]; ring + +theorem z0W_QK (r : Nat) (u : zW) : + loc_z0W (zQK r u) = (5 / 4) * (zP4 r - 1) + zP4 r * loc_z0W u := by + induction r with + | zero => simp [zQK,zP4] + | succ r ih => + dsimp [zQK,loc_z0W,zP4] + rw [ih]; ring + +inductive BScan : Bool -> Nat -> zW -> Nat -> zW -> Rat -> Rat -> Prop where + | nil (k : Nat) : BScan false k [] k [] 0 0 + | T {n : Nat} {u : zW} {k : Nat} {v : zW} {a b : Rat} : + BScan false (1 + n * 2) u k v a b -> + BScan false (2 + n) (V :: u) k (V :: v) (a * (1 / 2)) (b * (1 / 2)) + | pair0 {n : Nat} {u : zW} {k : Nat} {v : zW} {a b : Rat} : + BScan false (n * 2) u k v a b -> + BScan false (1 + n) (Q :: K :: u) k (V :: v) (a * (1 / 2)) ((1 / 4) + b * (1 / 2)) + | pair1 {n : Nat} {u : zW} {k : Nat} {v : zW} {a b : Rat} : + BScan false (1 + n * 2) u k v a b -> + BScan false (1 + n) (Q :: Q :: u) k (V :: v) (a * (1 / 2)) ((1 / 2) + b * (1 / 2)) + | short00 {n : Nat} {u : zW} {k : Nat} {v : zW} {a b : Rat} : + BScan false (n * 2) u k v a b -> + BScan false (2 + n * 4) (K :: u) k (K :: v) ((5 / 2) + a * 2) (b * 2) + | short01 {n : Nat} {u : zW} {k : Nat} {v : zW} {a b : Rat} : + BScan false (1 + n * 2) u k v a b -> + BScan false (2 + n * 4) (Q :: u) k (K :: v) ((3 / 2) + a * 2) (b * 2) + | short10 {n : Nat} {u : zW} {k : Nat} {v : zW} {a b : Rat} : + BScan false (n * 2) u k v a b -> + BScan false (4 + n * 4) (K :: u) k (Q :: v) ((7 / 2) + a * 2) (b * 2) + | short11 {n : Nat} {u : zW} {k : Nat} {v : zW} {a b : Rat} : + BScan false (1 + n * 2) u k v a b -> + BScan false (4 + n * 4) (Q :: u) k (Q :: v) ((5 / 2) + a * 2) (b * 2) + | odd_chain0 (r : Nat) {m : Nat} {u : zW} {k : Nat} {v : zW} {a b : Rat} : + BScan true (1 + m * 2 ^ (1 + r)) u k v a b -> + BScan false (3 + m * 4) (zQK r (V :: u)) k (K :: (zR r V ++ v)) + ((2 + a * 2) * zIv r) (b * 2 * zIv r) + | odd_chain1 (r : Nat) {m : Nat} {u : zW} {k : Nat} {v : zW} {a b : Rat} : + BScan true (1 + m * 2 ^ (1 + r)) u k v a b -> + BScan false (5 + m * 4) (zQK r (V :: u)) k (Q :: (zR r V ++ v)) + (1 + (2 + a * 2) * zIv r) (b * 2 * zIv r) + | even_chain (r : Nat) {m : Nat} {u : zW} {k : Nat} {v : zW} {a b : Rat} : + BScan true (1 + (1 + m * 2) * 2 ^ (1 + r)) u k v a b -> + BScan false (6 + m * 2) (K :: zQK r (V :: u)) k (zR (1 + r) V ++ v) + (1 + (1 + a) * (1 / 2) * zIv r) (b * (1 / 2) * zIv r) + | shift_pair0 {n : Nat} {u : zW} {k : Nat} {v : zW} {a b : Rat} : + BScan false (n * 2) u k v a b -> + BScan true (1 + n) (K :: u) k (V :: v) (a * (1 / 2)) ((1 / 4) + b * (1 / 2)) + | shift_pair1 {n : Nat} {u : zW} {k : Nat} {v : zW} {a b : Rat} : + BScan false (1 + n * 2) u k v a b -> + BScan true (1 + n) (Q :: u) k (V :: v) (a * (1 / 2)) ((1 / 2) + b * (1 / 2)) + | shift_chain0 (r : Nat) {m : Nat} {u : zW} {k : Nat} {v : zW} {a b : Rat} : + BScan true (1 + m * 2 ^ (2 + r)) u k v a b -> + BScan true (3 + m * 4) (K :: zQK r (V :: u)) k (K :: (zR (1 + r) V ++ v)) + ((1 + a) * zIv r) (b * zIv r) + | shift_chain1 (r : Nat) {m : Nat} {u : zW} {k : Nat} {v : zW} {a b : Rat} : + BScan true (1 + m * 2 ^ (2 + r)) u k v a b -> + BScan true (5 + m * 4) (K :: zQK r (V :: u)) k (Q :: (zR (1 + r) V ++ v)) + (1 + (1 + a) * zIv r) (b * zIv r) + +theorem zIv_pow2 (r : Nat) : + ((2 ^ r : Nat) : Rat) * zIv r = 1 := by + induction r with + | zero => simp [zIv] + | succ r ih => + rw [Nat.pow_succ]; dsimp [zIv]; push_cast at ih ⊢; linarith + +theorem loc_z1i {s : Bool} {k : Nat} {u : zW} {k' : Nat} {v : zW} {a b : Rat} + (h : BScan s k u k' v a b) : + (k : Rat) - 3 = ((k' : Rat) - 3) * z1h v + 2 * (a - b) := by + induction h with + | nil k => simp [z1h] + | T _ ih => dsimp [z1h]; push_cast at ih ⊢; linarith + | pair0 _ ih => dsimp [z1h]; push_cast at ih ⊢; linarith + | pair1 _ ih => dsimp [z1h]; push_cast at ih ⊢; linarith + | short00 _ ih => dsimp [z1h]; push_cast at ih ⊢; linarith + | short01 _ ih => dsimp [z1h]; push_cast at ih ⊢; linarith + | short10 _ ih => dsimp [z1h]; push_cast at ih ⊢; linarith + | short11 _ ih => dsimp [z1h]; push_cast at ih ⊢; linarith + | @odd_chain0 r m u k v a b _ ih => + dsimp [z1h]; rw [z11_R] + have hp : ((2 ^ (1 + r) : Nat) : Rat) * zIv r = 2 := by + have hp0 := zIv_pow2 r; rw [zP2 r]; push_cast at hp0 ⊢; linarith + calc ((3 + m * 4 : Nat) : Rat) - 3 + _ = (m : Rat) * 2 * (((2 ^ (1 + r) : Nat) : Rat) * zIv r) := by rw [hp]; push_cast; ring + _ = (((1 + m * 2 ^ (1 + r) : Nat) : Rat) - 3) * (2 * zIv r) + 4 * zIv r := by push_cast; ring + _ = (((k : Rat) - 3) * z1h v + 2 * (a - b)) * (2 * zIv r) + 4 * zIv r := by rw [ih] + _ = ((k : Rat) - 3) * (zIv r * z1h v * 2) + 2 * ((2 + a * 2) * zIv r - b * 2 * zIv r) := by ring + | @odd_chain1 r m u k v a b _ ih => + dsimp [z1h]; rw [z11_R] + have hp : ((2 ^ (1 + r) : Nat) : Rat) * zIv r = 2 := by + have hp0 := zIv_pow2 r; rw [zP2 r]; push_cast at hp0 ⊢; linarith + calc ((5 + m * 4 : Nat) : Rat) - 3 + _ = 2 + (m : Rat) * 2 * (((2 ^ (1 + r) : Nat) : Rat) * zIv r) := by rw [hp]; push_cast; ring + _ = (((1 + m * 2 ^ (1 + r) : Nat) : Rat) - 3) * (2 * zIv r) + 4 * zIv r + 2 := by push_cast; ring + _ = (((k : Rat) - 3) * z1h v + 2 * (a - b)) * (2 * zIv r) + 4 * zIv r + 2 := by rw [ih] + _ = ((k : Rat) - 3) * (zIv r * z1h v * 2) + 2 * (1 + (2 + a * 2) * zIv r - b * 2 * zIv r) := by ring + | @even_chain r m u k v a b _ ih => + have h1r : zR (1 + r) V ++ v = V :: (zR r V ++ v) := by + rw [Nat.add_comm 1 r,List.replicate_succ,List.cons_append] + rw [h1r]; dsimp [z1h]; rw [z11_R] + have hp : ((2 ^ (1 + r) : Nat) : Rat) * zIv r = 2 := by + have hp0 := zIv_pow2 r; rw [zP2 r]; push_cast at hp0 ⊢; linarith + calc ((6 + m * 2 : Nat) : Rat) - 3 + _ = 2 + (1 + (m : Rat) * 2) * (1 / 2) * (((2 ^ (1 + r) : Nat) : Rat) * zIv r) := by rw [hp]; push_cast; ring + _ = (((1 + (1 + m * 2) * 2 ^ (1 + r) : Nat) : Rat) - 3) * ((1 / 2) * zIv r) + zIv r + 2 := by push_cast; ring + _ = (((k : Rat) - 3) * z1h v + 2 * (a - b)) * ((1 / 2) * zIv r) + zIv r + 2 := by rw [ih] + _ = ((k : Rat) - 3) * (zIv r * z1h v * (1 / 2)) + 2 * (1 + (1 + a) * (1 / 2) * zIv r - b * (1 / 2) * zIv r) := by ring + | shift_pair0 _ ih => dsimp [z1h]; push_cast at ih ⊢; linarith + | shift_pair1 _ ih => dsimp [z1h]; push_cast at ih ⊢; linarith + | @shift_chain0 r m u k v a b _ ih => + have h1r : zR (1 + r) V ++ v = V :: (zR r V ++ v) := by + rw [Nat.add_comm 1 r,List.replicate_succ,List.cons_append] + rw [h1r]; dsimp [z1h]; rw [z11_R] + have hp : ((2 ^ (2 + r) : Nat) : Rat) * zIv r = 4 := by + have hp0 := zIv_pow2 r + have h2r : 2 + r = 1 + (1 + r) := by omega + rw [h2r,zP2 (1 + r),zP2 r]; push_cast at hp0 ⊢; linarith + calc ((3 + m * 4 : Nat) : Rat) - 3 + _ = (m : Rat) * (((2 ^ (2 + r) : Nat) : Rat) * zIv r) := by rw [hp]; push_cast; ring + _ = (((1 + m * 2 ^ (2 + r) : Nat) : Rat) - 3) * zIv r + 2 * zIv r := by push_cast; ring + _ = (((k : Rat) - 3) * z1h v + 2 * (a - b)) * zIv r + 2 * zIv r := by rw [ih] + _ = ((k : Rat) - 3) * (zIv r * z1h v * (1 / 2) * 2) + 2 * ((1 + a) * zIv r - b * zIv r) := by ring + | @shift_chain1 r m u k v a b _ ih => + have h1r : zR (1 + r) V ++ v = V :: (zR r V ++ v) := by + rw [Nat.add_comm 1 r,List.replicate_succ,List.cons_append] + rw [h1r]; dsimp [z1h]; rw [z11_R] + have hp : ((2 ^ (2 + r) : Nat) : Rat) * zIv r = 4 := by + have hp0 := zIv_pow2 r + have h2r : 2 + r = 1 + (1 + r) := by omega + rw [h2r,zP2 (1 + r),zP2 r]; push_cast at hp0 ⊢; linarith + calc ((5 + m * 4 : Nat) : Rat) - 3 + _ = 2 + (m : Rat) * (((2 ^ (2 + r) : Nat) : Rat) * zIv r) := by rw [hp]; push_cast; ring + _ = (((1 + m * 2 ^ (2 + r) : Nat) : Rat) - 3) * zIv r + 2 * zIv r + 2 := by push_cast; ring + _ = (((k : Rat) - 3) * z1h v + 2 * (a - b)) * zIv r + 2 * zIv r + 2 := by rw [ih] + _ = ((k : Rat) - 3) * (zIv r * z1h v * (1 / 2) * 2) + 2 * (1 + (1 + a) * zIv r - b * zIv r) := by ring + +theorem loc_z1j {s : Bool} {k : Nat} {u : zW} {k' : Nat} {v : zW} {a b : Rat} + (h : BScan s k u k' v a b) : + (s = false -> + loc_z0W v <= (66 / 19) * loc_z0W u /\ + a - b <= (64 / 11) * loc_z0W u /\ + b - a <= (1 / 2) * loc_z0W u) /\ + (s = true -> + loc_z0W v <= (33 / 38) * loc_z0W u - (11 / 16) /\ + a - b <= (16 / 11) * loc_z0W u - (3 / 2) /\ + b - a <= (1 / 8) * loc_z0W u + (3 / 8)) /\ + (s = true -> (∃ m,k = 1 + m * 4) -> + loc_z0W v <= (33 / 38) * loc_z0W u - (33 / 38)) := by + induction h with + | nil _ => + refine ⟨fun _ => by simp [loc_z0W],fun h => by contradiction,fun h _ => by contradiction⟩ + | @T n u k v a b _ ih => + rcases ih.1 rfl with ⟨h1,h2,h3⟩ + have hw := (loc_zWn u).2.2.2 + refine ⟨fun _ => ?_,fun h => by contradiction,fun h _ => by contradiction⟩ + dsimp [loc_z0W]; refine ⟨by linarith,by linarith,by linarith⟩ + | @pair0 n u k v a b _ ih => + rcases ih.1 rfl with ⟨h1,h2,h3⟩ + have hw := (loc_zWn u).2.2.2 + refine ⟨fun _ => ?_,fun h => by contradiction,fun h _ => by contradiction⟩ + dsimp [loc_z0W]; refine ⟨by linarith,by linarith,by linarith⟩ + | @pair1 n u k v a b _ ih => + rcases ih.1 rfl with ⟨h1,h2,h3⟩ + have hw := (loc_zWn u).2.2.2 + refine ⟨fun _ => ?_,fun h => by contradiction,fun h _ => by contradiction⟩ + dsimp [loc_z0W]; refine ⟨by linarith,by linarith,by linarith⟩ + | @short00 n u k v a b _ ih => + rcases ih.1 rfl with ⟨h1,h2,h3⟩ + have hw := (loc_zWn u).2.2.2 + refine ⟨fun _ => ?_,fun h => by contradiction,fun h _ => by contradiction⟩ + dsimp [loc_z0W]; refine ⟨by linarith,by linarith,by linarith⟩ + | @short01 n u k v a b _ ih => + rcases ih.1 rfl with ⟨h1,h2,h3⟩ + have hw := (loc_zWn u).2.2.2 + refine ⟨fun _ => ?_,fun h => by contradiction,fun h _ => by contradiction⟩ + dsimp [loc_z0W]; refine ⟨by linarith,by linarith,by linarith⟩ + | @short10 n u k v a b _ ih => + rcases ih.1 rfl with ⟨h1,h2,h3⟩ + have hw := (loc_zWn u).2.2.2 + refine ⟨fun _ => ?_,fun h => by contradiction,fun h _ => by contradiction⟩ + dsimp [loc_z0W]; refine ⟨by linarith,by linarith,by linarith⟩ + | @short11 n u k v a b _ ih => + rcases ih.1 rfl with ⟨h1,h2,h3⟩ + have hw := (loc_zWn u).2.2.2 + refine ⟨fun _ => ?_,fun h => by contradiction,fun h _ => by contradiction⟩ + dsimp [loc_z0W]; refine ⟨by linarith,by linarith,by linarith⟩ + | @odd_chain0 r m u k v a b _ ih => + rcases ih.2.1 rfl with ⟨h1,h2,h3⟩ + have hw := (loc_zWn u).2.2.2 + refine ⟨fun _ => ?_,fun h => by contradiction,fun h _ => by contradiction⟩ + dsimp [loc_z0W]; rw [z0W_R,z0W_QK]; dsimp [loc_z0W] + cases r with + | zero => + dsimp [zIv,zP4]; refine ⟨by linarith,by linarith,by linarith⟩ + | succ r' => + rcases zIv_P4 (r' + 1) with ⟨hiv1,hiv2,hp4,hge1⟩ + rcases hge1 (by omega) with ⟨hp4_4,_⟩ + refine ⟨by nlinarith,by nlinarith,by nlinarith⟩ + | @odd_chain1 r m u k v a b _ ih => + rcases ih.2.1 rfl with ⟨h1,h2,h3⟩ + have hw := (loc_zWn u).2.2.2 + refine ⟨fun _ => ?_,fun h => by contradiction,fun h _ => by contradiction⟩ + dsimp [loc_z0W]; rw [z0W_R,z0W_QK]; dsimp [loc_z0W] + cases r with + | zero => + dsimp [zIv,zP4]; refine ⟨by linarith,by linarith,by linarith⟩ + | succ r' => + rcases zIv_P4 (r' + 1) with ⟨hiv1,hiv2,hp4,hge1⟩ + rcases hge1 (by omega) with ⟨hp4_4,_⟩ + refine ⟨by nlinarith,by nlinarith,by nlinarith⟩ + | @even_chain r m u k v a b _ ih => + rcases ih.2.1 rfl with ⟨h1,h2,h3⟩ + have hw := (loc_zWn u).2.2.2 + refine ⟨fun _ => ?_,fun h => by contradiction,fun h _ => by contradiction⟩ + have h1r : zR (1 + r) V ++ v = V :: (zR r V ++ v) := by + rw [Nat.add_comm 1 r,List.replicate_succ,List.cons_append] + rw [h1r]; dsimp [loc_z0W]; rw [z0W_R,z0W_QK]; dsimp [loc_z0W] + rcases zIv_P4 r with ⟨hiv1,hiv2,hp4,_⟩ + refine ⟨by nlinarith,by nlinarith,by nlinarith⟩ + | @shift_pair0 n u k v a b _ ih => + rcases ih.1 rfl with ⟨h1,h2,h3⟩ + have hw := (loc_zWn u).2.2.2 + refine ⟨fun h => by contradiction,fun _ => ?_,fun _ _ => ?_⟩ + · dsimp [loc_z0W]; refine ⟨by linarith,by linarith,by linarith⟩ + · dsimp [loc_z0W]; linarith + | @shift_pair1 n u k v a b _ ih => + rcases ih.1 rfl with ⟨h1,h2,h3⟩ + have hw := (loc_zWn u).2.2.2 + refine ⟨fun h => by contradiction,fun _ => ?_,fun _ _ => ?_⟩ + · dsimp [loc_z0W]; refine ⟨by linarith,by linarith,by linarith⟩ + · dsimp [loc_z0W]; linarith + | @shift_chain0 r m u k v a b _ ih => + have hdiv : ∃ m',1 + m * 2 ^ (2 + r) = 1 + m' * 4 := by + refine ⟨m * 2 ^ r,?_⟩ + have h2r : 2 + r = r + 2 := by omega + rw [h2r,Nat.pow_add]; ring + rcases ih.2.1 rfl with ⟨_,h2,h3⟩ + have h1 := ih.2.2 rfl hdiv + have hw := (loc_zWn u).2.2.2 + refine ⟨fun h => by contradiction,fun _ => ?_,fun _ ⟨q,hq⟩ => by omega⟩ + have h1r : zR (1 + r) V ++ v = V :: (zR r V ++ v) := by + rw [Nat.add_comm 1 r,List.replicate_succ,List.cons_append] + rw [h1r]; dsimp [loc_z0W]; rw [z0W_R,z0W_QK]; dsimp [loc_z0W] + cases r with + | zero => + dsimp [zIv,zP4]; refine ⟨by linarith,by linarith,by linarith⟩ + | succ r' => + rcases zIv_P4 (r' + 1) with ⟨hiv1,hiv2,hp4,hge1⟩ + rcases hge1 (by omega) with ⟨hp4_4,_⟩ + refine ⟨by nlinarith,by nlinarith,by nlinarith⟩ + | @shift_chain1 r m u k v a b _ ih => + rcases ih.2.1 rfl with ⟨h1,h2,h3⟩ + have hw := (loc_zWn u).2.2.2 + refine ⟨fun h => by contradiction,fun _ => ?_,fun _ _ => ?_⟩ + · have h1r : zR (1 + r) V ++ v = V :: (zR r V ++ v) := by + rw [Nat.add_comm 1 r,List.replicate_succ,List.cons_append] + rw [h1r]; dsimp [loc_z0W]; rw [z0W_R,z0W_QK]; dsimp [loc_z0W] + cases r with + | zero => + dsimp [zIv,zP4]; refine ⟨by linarith,by linarith,by linarith⟩ + | succ r' => + rcases zIv_P4 (r' + 1) with ⟨hiv1,hiv2,hp4,hge1⟩ + rcases hge1 (by omega) with ⟨hp4_4,_⟩ + refine ⟨by nlinarith,by nlinarith,by nlinarith⟩ + · have h1r : zR (1 + r) V ++ v = V :: (zR r V ++ v) := by + rw [Nat.add_comm 1 r,List.replicate_succ,List.cons_append] + rw [h1r]; dsimp [loc_z0W]; rw [z0W_R,z0W_QK]; dsimp [loc_z0W] + cases r with + | zero => + dsimp [zIv,zP4]; linarith + | succ r' => + rcases zIv_P4 (r' + 1) with ⟨hiv1,hiv2,hp4,hge1⟩ + rcases hge1 (by omega) with ⟨hp4_4,_⟩ + nlinarith + +theorem loc_z1k {s : Bool} {k : Nat} {u : zW} {k' : Nat} {v : zW} {a b : Rat} + (h1 : BScan s k u k' v a b) : + ∀ {w : zW} {k'' : Nat} {x : zW} {c d : Rat}, + BScan false k' w k'' x c d -> + ∃ a' b',BScan s k (u ++ w) k'' (v ++ x) a' b' /\ + a' = a + z1h v * c /\ b' = b + z1h v * d := by + induction h1 with + | nil _ => + intro w k'' x c d h2 + exact ⟨c,d,h2,by simp [z1h],by simp [z1h]⟩ + | T _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a',b',hK,hA,hB⟩ + exact ⟨a' * (1 / 2),b' * (1 / 2),BScan.T hK,by dsimp [z1h]; linarith,by dsimp [z1h]; linarith⟩ + | pair0 _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a',b',hK,hA,hB⟩ + exact ⟨a' * (1 / 2),(1 / 4) + b' * (1 / 2),BScan.pair0 hK,by dsimp [z1h]; linarith,by dsimp [z1h]; linarith⟩ + | pair1 _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a',b',hK,hA,hB⟩ + exact ⟨a' * (1 / 2),(1 / 2) + b' * (1 / 2),BScan.pair1 hK,by dsimp [z1h]; linarith,by dsimp [z1h]; linarith⟩ + | short00 _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a',b',hK,hA,hB⟩ + exact ⟨(5 / 2) + a' * 2,b' * 2,BScan.short00 hK,by dsimp [z1h]; linarith,by dsimp [z1h]; linarith⟩ + | short01 _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a',b',hK,hA,hB⟩ + exact ⟨(3 / 2) + a' * 2,b' * 2,BScan.short01 hK,by dsimp [z1h]; linarith,by dsimp [z1h]; linarith⟩ + | short10 _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a',b',hK,hA,hB⟩ + exact ⟨(7 / 2) + a' * 2,b' * 2,BScan.short10 hK,by dsimp [z1h]; linarith,by dsimp [z1h]; linarith⟩ + | short11 _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a',b',hK,hA,hB⟩ + exact ⟨(5 / 2) + a' * 2,b' * 2,BScan.short11 hK,by dsimp [z1h]; linarith,by dsimp [z1h]; linarith⟩ + | @odd_chain0 r m u k v a b _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a',b',hK,hA,hB⟩ + have h_in : zQK r (V :: u) ++ w = zQK r (V :: (u ++ w)) := by + rw [<- zQK_append]; rfl + have h_out : K :: (zR r V ++ (v ++ x)) = (K :: (zR r V ++ v)) ++ x := by + simp [List.append_assoc] + refine ⟨(2 + a' * 2) * zIv r,b' * 2 * zIv r,?_ ,?_,?_⟩ + · rw [h_in,<- h_out]; exact BScan.odd_chain0 r hK + · dsimp [z1h]; rw [z11_R,hA]; ring + · dsimp [z1h]; rw [z11_R,hB]; ring + | @odd_chain1 r m u k v a b _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a',b',hK,hA,hB⟩ + have h_in : zQK r (V :: u) ++ w = zQK r (V :: (u ++ w)) := by + rw [<- zQK_append]; rfl + have h_out : Q :: (zR r V ++ (v ++ x)) = (Q :: (zR r V ++ v)) ++ x := by + simp [List.append_assoc] + refine ⟨1 + (2 + a' * 2) * zIv r,b' * 2 * zIv r,?_ ,?_,?_⟩ + · rw [h_in,<- h_out]; exact BScan.odd_chain1 r hK + · dsimp [z1h]; rw [z11_R,hA]; ring + · dsimp [z1h]; rw [z11_R,hB]; ring + | @even_chain r m u k v a b _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a',b',hK,hA,hB⟩ + have h_in : (K :: zQK r (V :: u)) ++ w = K :: zQK r (V :: (u ++ w)) := by + simp [<- zQK_append] + have h_out : zR (1 + r) V ++ (v ++ x) = (zR (1 + r) V ++ v) ++ x := by + simp [List.append_assoc] + have h1r : zR (1 + r) V ++ v = V :: (zR r V ++ v) := by + rw [Nat.add_comm 1 r,List.replicate_succ,List.cons_append] + refine ⟨1 + (1 + a') * (1 / 2) * zIv r,b' * (1 / 2) * zIv r,?_ ,?_,?_⟩ + · rw [h_in,<- h_out]; exact BScan.even_chain r hK + · rw [h1r]; dsimp [z1h]; rw [z11_R,hA]; ring + · rw [h1r]; dsimp [z1h]; rw [z11_R,hB]; ring + | shift_pair0 _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a',b',hK,hA,hB⟩ + exact ⟨a' * (1 / 2),(1 / 4) + b' * (1 / 2),BScan.shift_pair0 hK,by dsimp [z1h]; linarith,by dsimp [z1h]; linarith⟩ + | shift_pair1 _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a',b',hK,hA,hB⟩ + exact ⟨a' * (1 / 2),(1 / 2) + b' * (1 / 2),BScan.shift_pair1 hK,by dsimp [z1h]; linarith,by dsimp [z1h]; linarith⟩ + | @shift_chain0 r m u k v a b _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a',b',hK,hA,hB⟩ + have h_in : (K :: zQK r (V :: u)) ++ w = K :: zQK r (V :: (u ++ w)) := by + simp [<- zQK_append] + have h_out : K :: (zR (1 + r) V ++ (v ++ x)) = (K :: (zR (1 + r) V ++ v)) ++ x := by + simp [List.append_assoc] + have h1r : zR (1 + r) V ++ v = V :: (zR r V ++ v) := by + rw [Nat.add_comm 1 r,List.replicate_succ,List.cons_append] + refine ⟨(1 + a') * zIv r,b' * zIv r,?_ ,?_,?_⟩ + · rw [h_in,<- h_out]; exact BScan.shift_chain0 r hK + · dsimp [z1h]; rw [h1r]; dsimp [z1h]; rw [z11_R,hA]; ring + · dsimp [z1h]; rw [h1r]; dsimp [z1h]; rw [z11_R,hB]; ring + | @shift_chain1 r m u k v a b _ ih => + intro w k'' x c d h2 + rcases ih h2 with ⟨a',b',hK,hA,hB⟩ + have h_in : (K :: zQK r (V :: u)) ++ w = K :: zQK r (V :: (u ++ w)) := by + simp [<- zQK_append] + have h_out : Q :: (zR (1 + r) V ++ (v ++ x)) = (Q :: (zR (1 + r) V ++ v)) ++ x := by + simp [List.append_assoc] + have h1r : zR (1 + r) V ++ v = V :: (zR r V ++ v) := by + rw [Nat.add_comm 1 r,List.replicate_succ,List.cons_append] + refine ⟨1 + (1 + a') * zIv r,b' * zIv r,?_ ,?_,?_⟩ + · rw [h_in,<- h_out]; exact BScan.shift_chain1 r hK + · dsimp [z1h]; rw [h1r]; dsimp [z1h]; rw [z11_R,hA]; ring + · dsimp [z1h]; rw [h1r]; dsimp [z1h]; rw [z11_R,hB]; ring + +theorem loc_z1n {k : Nat} {u : zW} {k' : Nat} {v : zW} {l : Rat} + (hI : Scan k u k' v l) : + ∀ {A H : Nat},zDg A H u -> + ∃ a b,BScan false k u k' v a b /\ a - b <= (5 / 2) * z1e v + l /\ b - a <= 1 := by + induction hI with + | nil k => + intro A H _ + exact ⟨0,0,BScan.nil k,by simp [z1e],by linarith⟩ + | T _ _ => + intro A H hD + exact False.elim (z0X hD) + | pair0 _ ih => + intro A H hD + rcases zD1 hD with ⟨A1,H1,hD1,_,_⟩ + rcases zD0 hD1 with ⟨A2,H2,hD2,_,_⟩ + rcases ih hD2 with ⟨a,b,hJ,hP,hM⟩ + exact ⟨a * (1 / 2),(1 / 4) + b * (1 / 2),BScan.pair0 hJ,by dsimp [z1e]; linarith,by linarith⟩ + | pair1 _ ih => + intro A H hD + rcases zD1 hD with ⟨A1,H1,hD1,_,_⟩ + rcases zD1 hD1 with ⟨A2,H2,hD2,_,_⟩ + rcases ih hD2 with ⟨a,b,hJ,hP,hM⟩ + exact ⟨a * (1 / 2),(1 / 2) + b * (1 / 2),BScan.pair1 hJ,by dsimp [z1e]; linarith,by linarith⟩ + | short00 _ ih => + intro A H hD + rcases zD0 hD with ⟨A1,H1,hD1,_,_⟩ + rcases ih hD1 with ⟨a,b,hJ,hP,hM⟩ + exact ⟨(5 / 2) + a * 2,b * 2,BScan.short00 hJ,by dsimp [z1e]; linarith,by linarith⟩ + | short01 _ ih => + intro A H hD + rcases zD1 hD with ⟨A1,H1,hD1,_,_⟩ + rcases ih hD1 with ⟨a,b,hJ,hP,hM⟩ + exact ⟨(3 / 2) + a * 2,b * 2,BScan.short01 hJ,by dsimp [z1e]; linarith,by linarith⟩ + | short10 _ ih => + intro A H hD + rcases zD0 hD with ⟨A1,H1,hD1,_,_⟩ + rcases ih hD1 with ⟨a,b,hJ,hP,hM⟩ + exact ⟨(7 / 2) + a * 2,b * 2,BScan.short10 hJ,by dsimp [z1e]; linarith,by linarith⟩ + | short11 _ ih => + intro A H hD + rcases zD1 hD with ⟨A1,H1,hD1,_,_⟩ + rcases ih hD1 with ⟨a,b,hJ,hP,hM⟩ + exact ⟨(5 / 2) + a * 2,b * 2,BScan.short11 hJ,by dsimp [z1e]; linarith,by linarith⟩ + +theorem zHi_bscan {m k' : Nat} {w0 y : zW} {l : Rat} {A0 H0 : Nat} + (hS : Scan (m * 2) (w0 ++ [Q,Q,K]) k' y l) + (hD0 : zDg A0 H0 w0) : + ∃ a b,BScan false (1 + m) ((Q :: K :: w0) ++ [Q,Q,K]) k' (V :: y) a b /\ + z1e (V :: y) <= (1 / 4) * z1f (Q :: K :: w0) /\ + a - b <= (7 / 8) * z1f (Q :: K :: w0) /\ + b - a <= 1 := by + have hD_qq : zDg 3 2 [Q,Q] := zDg.one (zDg.one zDg.nil) + have hD_w : zDg (A0 + 3 * 2 ^ H0) (H0 + 2) (w0 ++ [Q,Q]) := z19 hD0 hD_qq + have hS' : Scan (m * 2) ((w0 ++ [Q,Q]) ++ [K]) k' y l := by + simpa [List.append_assoc] using! hS + rcases z1x hS' (z1v hD_w) with ⟨hY,hL,_⟩ + have hZ_eq : z1f (w0 ++ [Q,Q]) = z1f w0 := by + rw [z1k]; simp [z1f] + rw [hZ_eq] at hY hL + have hD_wk : zDg ((A0 + 3 * 2 ^ H0) + 0 * 2 ^ (H0 + 2)) ((H0 + 2) + 1) ((w0 ++ [Q,Q]) ++ [K]) := + z19 hD_w (zDg.zero zDg.nil) + rcases loc_z1n hS' hD_wk with ⟨a0,b0,hB0,hAB0,hBA0⟩ + have hB0' : BScan false (m * 2) (w0 ++ [Q,Q,K]) k' y a0 b0 := by + simpa [List.append_assoc] using! hB0 + refine ⟨a0 * (1 / 2),(1 / 4) + b0 * (1 / 2),BScan.pair0 hB0',?_,?_,?_⟩ + · dsimp [z1e,z1f]; linarith + · dsimp [z1f]; linarith + · linarith + + +abbrev startsWithQKOrQQ := z0L +abbrev powHalf := zIv +abbrev powFour := zP4 +abbrev powHalf_and_powFour_bounds := @zIv_P4 +abbrev prependQK := zQK +abbrev prependQK_append := @zQK_append +abbrev brIncs_of_binary := @z0H +abbrev digitVal_unique_canon := @loc_z0X + +theorem exists_heightShift_canon (v : List Word) (H : Nat) (hY : wordMass v < ((2 ^ H : Nat) : Rat)) : + ∃ J, heightShift v H = some J := by + have hY' : z1e v < ((2 ^ H : Nat) : Rat) := by rwa [z1e_eq_wordMass] + exact loc_z1B v H hY' + +abbrev digitVal_mod_four_one_prefix := @loc_z1K +abbrev startsWithQKOrQQ_append_right := @loc_z1I +abbrev d0_append_default := @zDd +abbrev wordWeightCanon := loc_z0W +abbrev wordWeightCanon_nonneg := @loc_zWn +abbrev stepPlus_of_brIncs_128 := @loc_z2p +abbrev cfgCanon := zCf +abbrev cfgLeft := zCL +abbrev cfgRight := zCR +abbrev stepPlus_of_multiStep := @zMa +abbrev multiStep_trans_canon := @zMt +abbrev stepPlus_trans_canon := @zPt +abbrev multiStep_succ_canon := @zMs +abbrev zero_cons_default_canon := @z00 +abbrev side_append := @z08 +abbrev numSide_of_brIncs := @loc_z2o +abbrev list_pow_one_canon := @z06 +abbrev seg_comp_words := @zS0 +abbrev seg_ch_pow_t := @zS3 +abbrev side_of_seg := @zSc +abbrev seg_word_s1 := @zW_s1 +abbrev seg_word_s2 := @zW_s2 +abbrev seg_word_s3 := @zW_s3 +abbrev seg_word_s4 := @zW_s4 +abbrev seg_word_s5 := @zW_s5 +abbrev seg_word_s6 := @zW_s6 +abbrev seg_word_s7 := @zW_s7 +abbrev seg_ch_even_d0 := @zH_d0_even +abbrev seg_ch_odd_d0 := @zH_d0_odd +abbrev seg_ch_even_d1 := @zH_d1_even +abbrev stepPlus_word_turn := @zW_turn +abbrev list_pow_one_add_canon := @zLp' +abbrev seg_append_calls := @zSg +abbrev seg_ch_d1 := @zH4 +abbrev seg_ch_double_pow := @zSa +abbrev seg_ch_two_d0 := @z0k +abbrev seg_ch_t_one := @zH2 + +theorem wordScale_prependQK (r : Nat) (u : List Word) : + wordScale (prependQK r u) = powFour r * wordScale u := by + simpa only [z1h_eq_wordScale] using z11_QK r u + +theorem wordScale_replicate_V_append (r : Nat) (u : List Word) : + wordScale (List.replicate r V ++ u) = powHalf r * wordScale u := by + simpa only [z1h_eq_wordScale] using z11_R r u + +theorem bScan_loss_bounds {s : Bool} {k : Nat} {u : List Word} {k' : Nat} {v : List Word} {a b : Rat} + (h : BScan s k u k' v a b) : + (s = false -> + wordWeightCanon v <= (66 / 19) * wordWeightCanon u /\ + a - b <= (64 / 11) * wordWeightCanon u /\ + b - a <= (1 / 2) * wordWeightCanon u) /\ + (s = true -> + wordWeightCanon v <= (33 / 38) * wordWeightCanon u - (11 / 16) /\ + a - b <= (16 / 11) * wordWeightCanon u - (3 / 2) /\ + b - a <= (1 / 8) * wordWeightCanon u + (3 / 8)) /\ + (s = true -> (∃ m, k = 1 + m * 4) -> + wordWeightCanon v <= (33 / 38) * wordWeightCanon u - (33 / 38)) := + loc_z1j h + +theorem bScan_budget_eq {s : Bool} {k : Nat} {u : List Word} {k' : Nat} {v : List Word} {a b : Rat} + (h : BScan s k u k' v a b) : + (k : Rat) - 3 = ((k' : Rat) - 3) * wordScale v + 2 * (a - b) := by + simpa only [z1h_eq_wordScale] using loc_z1i h + +theorem bScan_append {s : Bool} {k : Nat} {u : List Word} {k' : Nat} {v : List Word} {a b : Rat} + (h1 : BScan s k u k' v a b) : + ∀ {w : List Word} {k'' : Nat} {x : List Word} {c d : Rat}, + BScan false k' w k'' x c d -> + ∃ a' b', BScan s k (u ++ w) k'' (v ++ x) a' b' /\ + a' = a + wordScale v * c /\ b' = b + wordScale v * d := by + intro w k'' x c d h2 + simpa only [z1h_eq_wordScale] using loc_z1k h1 h2 + +theorem bScan_high_digits {m k' : Nat} {w0 y : List Word} {l : Rat} {A0 H0 : Nat} + (hS : Scan (m * 2) (w0 ++ [Q, Q, K]) k' y l) + (hD0 : DigitVal A0 H0 w0) : + ∃ a b, BScan false (1 + m) ((Q :: K :: w0) ++ [Q, Q, K]) k' (V :: y) a b /\ + wordMass (V :: y) <= (1 / 4) * wordMassK (Q :: K :: w0) /\ + a - b <= (7 / 8) * wordMassK (Q :: K :: w0) /\ + b - a <= 1 := by + simpa only [z1e_eq_wordMass, z1f_eq_wordMassK] using zHi_bscan hS hD0 + +theorem scan_qqk_inv {a : Nat} {u : List Word} {b : Nat} {v : List Word} {l : Rat} + (h : Scan a u b v l) : + ∀ (w0 : List Word), u = w0 ++ [Q, Q, K] -> + wordScale v <= (1 / 8) * wordScale u /\ + (startsWithQKOrQQ (w0 ++ [K]) = true -> wordScale v <= (1 / 64) * wordScale u) /\ + (∃ n, b = n * 4) /\ + (∃ v0, v = v0 ++ [V]) := by + simpa only [z1h_eq_wordScale] using zScan_qqk h + +theorem startsWithQKOrQQ_of_digitVal_pos {A H : Nat} {w : List Word} + (hD : DigitVal A H w) (hPos : 0 < A) : + startsWithQKOrQQ (w ++ [K]) = true := + zDg_pos_z0L hD hPos + +theorem wordWeightCanon_bounds (u : List Word) : + wordMass u <= wordWeightCanon u /\ wordWeightCanon u <= (11 / 8) * wordMass u := by + simpa only [z1e_eq_wordMass] using zWY u + +theorem wordWeightCanon_append (u v : List Word) : + wordWeightCanon (u ++ v) = wordWeightCanon u + wordScale u * wordWeightCanon v := by + simpa only [z1h_eq_wordScale] using z13W u v + +theorem wordWeightCanon_prependQK (r : Nat) (u : List Word) : + wordWeightCanon (prependQK r u) = (5 / 4) * (powFour r - 1) + powFour r * wordWeightCanon u := + z0W_QK r u + +theorem loc_z0W_prependQK (r : Nat) (u : List Word) : + loc_z0W (prependQK r u) = (5 / 4) * (powFour r - 1) + powFour r * loc_z0W u := + z0W_QK r u + +theorem wordWeightCanon_replicate_V_append (r : Nat) (u : List Word) : + wordWeightCanon (List.replicate r V ++ u) = powHalf r * wordWeightCanon u := + z0W_R r u + +end BusyBeaver.WordCanonBR diff --git a/BusyBeaver/Calculi/WordCalculusI.lean b/BusyBeaver/Calculi/WordCalculusI.lean new file mode 100644 index 00000000..599ad718 --- /dev/null +++ b/BusyBeaver/Calculi/WordCalculusI.lean @@ -0,0 +1,1891 @@ +/- +Copyright (c) 2026 Google LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +-/ +module + +public import BusyBeaver.Calculi.WordCalculusH +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +/-! +# Word Calculus Engine I (`BusyBeaver.Calculi.WordCalculusI`) + +Formal word-rewriting calculus for structured tape transformations, +providing verified macro-step reductions and tile segment chains for family I. +-/ + +@[expose] public section + +open Mathlib Relation Nat Turing BusyBeaver Counter + +namespace BusyBeaver.WordCanonBR +set_option quotPrecheck false +set_option maxRecDepth 4000000 + +variable {Γ₀ Λ₀ α β γ : Type*} [Inhabited Γ₀] [Inhabited Λ₀] +local notation "HalfTape" => ListBlank (Fin 2) +local notation "BitWord" => List (Fin 2) +open WordCalculus Word BRIncs +local notation "WordList" => List Word + +def modeScaleWeight : Bool -> Rat + | false => 1 + | true => 1 / 4 + +theorem bScan_scale_le {s : Bool} {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (h : BScan s k u k' v a b) : + wordScale v <= modeScaleWeight s * wordScale u := by + induction h with + | nil _ => simp [wordScale, modeScaleWeight] + | T _ ih => dsimp [wordScale, modeScaleWeight] at ih ⊢; linarith + | @pair0 _ u _ _ _ _ _ ih => + have hp := wordScale_pos u + dsimp [wordScale, modeScaleWeight] at ih ⊢; linarith + | @pair1 _ u _ _ _ _ _ ih => + have hp := wordScale_pos u + dsimp [wordScale, modeScaleWeight] at ih ⊢; linarith + | short00 _ ih => dsimp [wordScale, modeScaleWeight] at ih ⊢; linarith + | short01 _ ih => dsimp [wordScale, modeScaleWeight] at ih ⊢; linarith + | short10 _ ih => dsimp [wordScale, modeScaleWeight] at ih ⊢; linarith + | short11 _ ih => dsimp [wordScale, modeScaleWeight] at ih ⊢; linarith + | @odd_chain0 r m u k v a b _ ih => + dsimp [wordScale, modeScaleWeight] at ih ⊢; + rw [wordScale_replicate_V_append, wordScale_prependQK]; dsimp [wordScale] + have hp := wordScale_pos u + rcases powHalf_and_powFour_bounds r with ⟨hiv1, hiv2, hp4, _⟩ + nlinarith + | @odd_chain1 r m u k v a b _ ih => + dsimp [wordScale, modeScaleWeight] at ih ⊢; + rw [wordScale_replicate_V_append, wordScale_prependQK]; dsimp [wordScale] + have hp := wordScale_pos u + rcases powHalf_and_powFour_bounds r with ⟨hiv1, hiv2, hp4, _⟩ + nlinarith + | @even_chain r m u k v a b _ ih => + have h1r : List.replicate (1 + r) V ++ v = V :: (List.replicate r V ++ v) := by + rw [Nat.add_comm 1 r, List.replicate_succ, List.cons_append] + rw [h1r]; dsimp [wordScale, modeScaleWeight] at ih ⊢; + rw [wordScale_replicate_V_append, wordScale_prependQK]; dsimp [wordScale] + have hp := wordScale_pos u + rcases powHalf_and_powFour_bounds r with ⟨hiv1, hiv2, hp4, _⟩ + nlinarith + | shift_pair0 _ ih => dsimp [wordScale, modeScaleWeight] at ih ⊢; linarith + | shift_pair1 _ ih => dsimp [wordScale, modeScaleWeight] at ih ⊢; linarith + | @shift_chain0 r m u k v a b _ ih => + have h1r : List.replicate (1 + r) V ++ v = V :: (List.replicate r V ++ v) := by + rw [Nat.add_comm 1 r, List.replicate_succ, List.cons_append] + dsimp [wordScale, modeScaleWeight] at ih ⊢; rw [h1r]; dsimp [wordScale]; + rw [wordScale_replicate_V_append, wordScale_prependQK]; dsimp [wordScale] + have hp := wordScale_pos u + rcases powHalf_and_powFour_bounds r with ⟨hiv1, hiv2, hp4, _⟩ + nlinarith + | @shift_chain1 r m u k v a b _ ih => + have h1r : List.replicate (1 + r) V ++ v = V :: (List.replicate r V ++ v) := by + rw [Nat.add_comm 1 r, List.replicate_succ, List.cons_append] + dsimp [wordScale, modeScaleWeight] at ih ⊢; rw [h1r]; dsimp [wordScale]; + rw [wordScale_replicate_V_append, wordScale_prependQK]; dsimp [wordScale] + have hp := wordScale_pos u + rcases powHalf_and_powFour_bounds r with ⟨hiv1, hiv2, hp4, _⟩ + nlinarith + +theorem not_bScan_odd_cons_K (n : Nat) (u : WordList) (k' : Nat) (v : WordList) (a b : Rat) : + ¬ BScan false (1 + n * 2) (K :: u) k' v a b := by + intro h + generalize hs : false = s at h + generalize hk : 1 + n * 2 = k at h + generalize hu : K :: u = w at h + cases h with + | short00 _ => omega + | short10 _ => omega + | odd_chain0 r _ => cases r <;> simp [zQK] at hu + | odd_chain1 r _ => cases r <;> simp [zQK] at hu + | even_chain _ _ => omega + | _ => simp at hs hu + +theorem not_bScan_odd_of_startsWithQKOrQQ {n : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : + Rat} + (h : BScan false (1 + n * 2) u k' v a b) + (hL : startsWithQKOrQQ (Q :: u) = true) : + startsWithQKOrQQ u = true := by + cases u with + | nil => contradiction + | cons t0 u' => + cases t0 with + | V => exact hL + | K => exact False.elim (not_bScan_odd_cons_K n u' k' v a b h) + | Q => + generalize hs : false = s at h + generalize hk : 1 + n * 2 = k at h + generalize hu : Q :: u' = w at h + cases h with + | pair0 _ => simp [startsWithQKOrQQ, z0L] at hu ⊢ + | pair1 _ => simp [startsWithQKOrQQ, z0L] at hu ⊢ + | short01 _ => omega + | short11 _ => omega + | odd_chain0 r _ => + cases r with + | zero => simp [zQK] at hu + | succ r' => simp [zQK, startsWithQKOrQQ, z0L] at hu ⊢ + | odd_chain1 r _ => + cases r with + | zero => simp [zQK] at hu + | succ r' => simp [zQK, startsWithQKOrQQ, z0L] at hu ⊢ + | _ => simp at hs hu + +theorem bScan_scale_le_of_startsWithQKOrQQ {s : Bool} {k : Nat} {u : WordList} {k' : Nat} {v : + WordList} {a b : Rat} + (h : BScan s k u k' v a b) + (hL : startsWithQKOrQQ u = true) : + wordScale v <= (1 / 8) * modeScaleWeight s * wordScale u := by + induction h with + | nil _ => contradiction + | T _ ih => + have hIH := ih hL + dsimp [wordScale, modeScaleWeight] at hIH ⊢; linarith + | pair0 hSub _ => + have hUp := bScan_scale_le hSub + dsimp [wordScale, modeScaleWeight] at hUp ⊢; linarith + | pair1 hSub _ => + have hUp := bScan_scale_le hSub + dsimp [wordScale, modeScaleWeight] at hUp ⊢; linarith + | short00 _ ih => + have hIH := ih hL + dsimp [wordScale, modeScaleWeight] at hIH ⊢; linarith + | short01 hSub ih => + have hIH := ih (not_bScan_odd_of_startsWithQKOrQQ hSub hL) + dsimp [wordScale, modeScaleWeight] at hIH ⊢; linarith + | short10 _ ih => + have hIH := ih hL + dsimp [wordScale, modeScaleWeight] at hIH ⊢; linarith + | short11 hSub ih => + have hIH := ih (not_bScan_odd_of_startsWithQKOrQQ hSub hL) + dsimp [wordScale, modeScaleWeight] at hIH ⊢; linarith + | @odd_chain0 r m u k v a b hSub ih => + cases r with + | zero => + have hIH := ih hL + dsimp [prependQK, zQK, List.replicate, wordScale, modeScaleWeight, powHalf] at hIH ⊢; linarith + | succ r' => + have hUp := bScan_scale_le hSub + dsimp [wordScale, modeScaleWeight] at hUp ⊢; + rw [wordScale_replicate_V_append, wordScale_prependQK]; dsimp [wordScale] + have hp := wordScale_pos u + rcases powHalf_and_powFour_bounds (r' + 1) with ⟨hiv1, hiv2, hp4, hge1⟩ + rcases hge1 (by omega) with ⟨_, h8⟩ + nlinarith + | @odd_chain1 r m u k v a b hSub ih => + cases r with + | zero => + have hIH := ih hL + dsimp [prependQK, zQK, List.replicate, wordScale, modeScaleWeight, powHalf] at hIH ⊢; linarith + | succ r' => + have hUp := bScan_scale_le hSub + dsimp [wordScale, modeScaleWeight] at hUp ⊢; + rw [wordScale_replicate_V_append, wordScale_prependQK]; dsimp [wordScale] + have hp := wordScale_pos u + rcases powHalf_and_powFour_bounds (r' + 1) with ⟨hiv1, hiv2, hp4, hge1⟩ + rcases hge1 (by omega) with ⟨_, h8⟩ + nlinarith + | @even_chain r m u k v a b hSub _ => + have hUp := bScan_scale_le hSub + have h1r : List.replicate (1 + r) V ++ v = V :: (List.replicate r V ++ v) := by + rw [Nat.add_comm 1 r, List.replicate_succ, List.cons_append] + rw [h1r]; dsimp [wordScale, modeScaleWeight] at hUp ⊢; + rw [wordScale_replicate_V_append, wordScale_prependQK]; dsimp [wordScale] + have hp := wordScale_pos u + rcases powHalf_and_powFour_bounds r with ⟨hiv1, hiv2, hp4, _⟩ + nlinarith + | shift_pair0 _ ih => + have hIH := ih hL + dsimp [wordScale, modeScaleWeight] at hIH ⊢; linarith + | shift_pair1 hSub ih => + have hIH := ih (not_bScan_odd_of_startsWithQKOrQQ hSub hL) + dsimp [wordScale, modeScaleWeight] at hIH ⊢; linarith + | @shift_chain0 r m u k v a b hSub ih => + cases r with + | zero => + have hIH := ih hL + dsimp [prependQK, zQK, List.replicate, wordScale, modeScaleWeight, powHalf] at hIH ⊢; linarith + | succ r' => + have hUp := bScan_scale_le hSub + have h1r : List.replicate (1 + (r' + 1)) V ++ v = V :: (List.replicate (r' + 1) V ++ v) := by + rw [Nat.add_comm 1 (r' + 1), List.replicate_succ, List.cons_append] + dsimp [wordScale, modeScaleWeight] at hUp ⊢; rw [h1r]; dsimp [wordScale]; + rw [wordScale_replicate_V_append, wordScale_prependQK]; dsimp [wordScale] + have hp := wordScale_pos u + rcases powHalf_and_powFour_bounds (r' + 1) with ⟨hiv1, hiv2, hp4, hge1⟩ + rcases hge1 (by omega) with ⟨_, h8⟩ + nlinarith + | @shift_chain1 r m u k v a b hSub ih => + cases r with + | zero => + have hIH := ih hL + dsimp [prependQK, zQK, List.replicate, wordScale, modeScaleWeight, powHalf] at hIH ⊢; linarith + | succ r' => + have hUp := bScan_scale_le hSub + have h1r : List.replicate (1 + (r' + 1)) V ++ v = V :: (List.replicate (r' + 1) V ++ v) := by + rw [Nat.add_comm 1 (r' + 1), List.replicate_succ, List.cons_append] + dsimp [wordScale, modeScaleWeight] at hUp ⊢; rw [h1r]; dsimp [wordScale]; + rw [wordScale_replicate_V_append, wordScale_prependQK]; dsimp [wordScale] + have hp := wordScale_pos u + rcases powHalf_and_powFour_bounds (r' + 1) with ⟨hiv1, hiv2, hp4, hge1⟩ + rcases hge1 (by omega) with ⟨_, h8⟩ + nlinarith + +-- ModeU and WordPrefixMode (downward BScan existence on u) +inductive ModeU where + | ME + | MO + | MS +deriving DecidableEq + +open ModeU + +inductive WordPrefixMode : ModeU -> WordList -> Prop where + | base_E : WordPrefixMode ME [V] + | base_O : WordPrefixMode MO [V] + | T_E {u : WordList} : WordPrefixMode MO u -> WordPrefixMode ME (V :: u) + | T_O {u : WordList} : WordPrefixMode MO u -> WordPrefixMode MO (V :: u) + | odd_c (r : Nat) {u : WordList} : WordPrefixMode MS u -> WordPrefixMode MO (prependQK r (V :: u)) + | short_K {u : WordList} : WordPrefixMode ME u -> WordPrefixMode ME (K :: u) + | even_c (r : Nat) {u : WordList} : WordPrefixMode MS u -> + WordPrefixMode ME (K :: prependQK r (V :: u)) + | shift_K {u : WordList} : WordPrefixMode ME u -> WordPrefixMode MS (K :: u) + | shift_c (r : Nat) {u : WordList} : WordPrefixMode MS u -> + WordPrefixMode MS (K :: prependQK r (V :: u)) + | short_Q {u : WordList} : WordPrefixMode MO u -> WordPrefixMode ME (Q :: u) + | shift_Q {u : WordList} : WordPrefixMode MO u -> WordPrefixMode MS (Q :: u) + | pair0_E {u : WordList} : WordPrefixMode ME u -> WordPrefixMode ME (Q :: K :: u) + | pair0_O {u : WordList} : WordPrefixMode ME u -> WordPrefixMode MO (Q :: K :: u) + | pair1_E {u : WordList} : WordPrefixMode MO u -> WordPrefixMode ME (Q :: Q :: u) + | pair1_O {u : WordList} : WordPrefixMode MO u -> WordPrefixMode MO (Q :: Q :: u) + +def WordPrefixChain (w : WordList) : Prop := ∃ r u, w = prependQK r (V :: u) /\ WordPrefixMode MS u + +theorem wordPrefixMode_all (u_pre : WordList) : + let w := u_pre ++ [V] + (WordPrefixMode ME w \/ WordPrefixChain w) /\ + (WordPrefixMode MO w \/ (WordPrefixMode MS w /\ + (WordPrefixMode ME (Q :: w) \/ WordPrefixChain (Q :: w)) /\ WordPrefixMode MO (Q :: w))) := by + induction u_pre with + | nil => + exact ⟨Or.inl WordPrefixMode.base_E, Or.inl WordPrefixMode.base_O⟩ + | cons a u ih => + rcases ih with ⟨hEC, hOS⟩ + cases a with + | V => + rcases hOS with hO | ⟨hS, _, _⟩ + · exact ⟨Or.inl (WordPrefixMode.T_E hO), Or.inl (WordPrefixMode.T_O hO)⟩ + · exact ⟨Or.inr ⟨0, u ++ [V], rfl, hS⟩, Or.inl (WordPrefixMode.odd_c 0 hS)⟩ + | K => + rcases hEC with hE | ⟨r, u0, hw, hS⟩ + · exact ⟨Or.inl (WordPrefixMode.short_K hE), + Or.inr ⟨WordPrefixMode.shift_K hE, Or.inl (WordPrefixMode.pair0_E hE), + WordPrefixMode.pair0_O hE⟩⟩ + · dsimp at hw ⊢; rw [hw] + exact ⟨Or.inl (WordPrefixMode.even_c r hS), + Or.inr ⟨WordPrefixMode.shift_c r hS, Or.inr ⟨r + 1, u0, rfl, hS⟩, + WordPrefixMode.odd_c (r + 1) hS⟩⟩ + | Q => + rcases hOS with hO | ⟨_, hQ_EC, hQ_O⟩ + · exact ⟨Or.inl (WordPrefixMode.short_Q hO), + Or.inr ⟨WordPrefixMode.shift_Q hO, Or.inl (WordPrefixMode.pair1_E hO), + WordPrefixMode.pair1_O hO⟩⟩ + · exact ⟨hQ_EC, Or.inl hQ_O⟩ + +theorem wordPrefixMode_MO_cons_V (w : WordList) : WordPrefixMode MO (V :: (w ++ [V])) := by + rcases (wordPrefixMode_all w).2 with hO | ⟨hS, _, _⟩ + · exact WordPrefixMode.T_O hO + · exact WordPrefixMode.odd_c 0 hS + +theorem wordPrefixMode_ME_cons_V_V (w : WordList) : WordPrefixMode ME (V :: V :: (w ++ [V])) := + WordPrefixMode.T_E (wordPrefixMode_MO_cons_V w) + +theorem one_le_wordWeightCanon_of_MS {u : WordList} (h : WordPrefixMode MS u) : 1 <= + wordWeightCanon u := by + generalize hm : MS = m at h + cases h with + | @shift_K u0 _ => have := (wordWeightCanon_nonneg u0).2.2.2; dsimp [wordWeightCanon]; linarith + | @shift_c r u0 _ => + have := (wordWeightCanon_nonneg u0).2.2.2 + dsimp [wordWeightCanon]; rw [loc_z0W_prependQK]; dsimp [wordWeightCanon] + rcases powHalf_and_powFour_bounds r with ⟨_, _, hp4, _⟩ + nlinarith + | @shift_Q u0 _ => have := (wordWeightCanon_nonneg u0).2.2.2; dsimp [wordWeightCanon]; linarith + | _ => contradiction + +theorem exists_bScan_of_wordPrefixMode {m : ModeU} {w : WordList} (hI : WordPrefixMode m w) : + ((m = ME \/ m = MO) -> + ∀ (k : Nat), + (m = ME -> ∃ n, k = n * 2) -> + (m = MO -> ∃ n, k = 1 + n * 2) -> + 16 * wordWeightCanon w < (k : Rat) - 3 -> + ∃ m' v a b, BScan false k w (1 + m') v a b /\ 0 < m') /\ + (m = MS -> + ∀ (k : Nat), + (∃ n, k = 1 + n * 2) -> + 4 * wordWeightCanon w - 4 < (k : Rat) - 3 -> + ∃ m' v a b, BScan true k w (1 + m') v a b /\ 0 < m') := by + induction hI with + | base_E => + refine ⟨fun _ k hE _ hk => ?_, fun h => by contradiction⟩ + rcases hE rfl with ⟨n, rfl⟩ + dsimp [wordWeightCanon] at hk + have hn2 : 2 <= n := by + by_contra hlt; have : n <= 1 := by omega + have hq : (n : Rat) <= 1 := by exact_mod_cast this + push_cast at hk; linarith + refine ⟨(2 * n - 2) * 2, [V], 0, 0, ?_ , by omega⟩ + have heq1 : n * 2 = 2 + (n - 1) * 2 := by omega + have heq2 : 1 + (2 * n - 2) * 2 = 1 + ((n - 1) * 2) * 2 := by omega + rw [heq1, heq2] + simpa using! BScan.T (BScan.nil _) + | base_O => + refine ⟨fun _ k _ hO hk => ?_, fun h => by contradiction⟩ + rcases hO rfl with ⟨n, rfl⟩ + dsimp [wordWeightCanon] at hk + have hn2 : 2 <= n := by + by_contra hlt; have : n <= 1 := by omega + have hq : (n : Rat) <= 1 := by exact_mod_cast this + push_cast at hk; linarith + refine ⟨(2 * n - 1) * 2, [V], 0, 0, ?_ , by omega⟩ + have heq1 : 1 + n * 2 = 2 + (n * 2 - 1) := by omega + have heq2 : 1 + (2 * n - 1) * 2 = 1 + (n * 2 - 1) * 2 := by omega + rw [heq1, heq2] + simpa using! BScan.T (BScan.nil _) + | @T_E u hO ih => + refine ⟨fun _ k hE _ hk => ?_, fun h => by contradiction⟩ + rcases hE rfl with ⟨n, rfl⟩ + have hw := (wordWeightCanon_nonneg u).2.2.2 + dsimp [wordWeightCanon] at hk + have hn2 : 2 <= n := by + by_contra hlt; have : n <= 1 := by omega + have hq : (n : Rat) <= 1 := by exact_mod_cast this + push_cast at hk; linarith + have hn_q : (n : Rat) * 2 = 2 + ((n * 2 - 2 : Nat) : Rat) := by + exact_mod_cast (by omega : n * 2 = 2 + (n * 2 - 2)) + rcases ih.1 (Or.inr rfl) (1 + + (n * 2 - 2) * 2) (fun h => by contradiction) (fun _ => ⟨n * 2 - 2, rfl⟩) + (by push_cast at hk ⊢; linarith) with ⟨m', v, a, b, hS, hm'⟩ + have heq : n * 2 = 2 + (n * 2 - 2) := by omega + rw [heq] + exact ⟨m', V :: v, a * (1 / 2), b * (1 / 2), BScan.T hS, hm'⟩ + | @T_O u hO ih => + refine ⟨fun _ k _ hO_k hk => ?_, fun h => by contradiction⟩ + rcases hO_k rfl with ⟨n, rfl⟩ + have hw := (wordWeightCanon_nonneg u).2.2.2 + dsimp [wordWeightCanon] at hk + have hn2 : 2 <= n := by + by_contra hlt; have : n <= 1 := by omega + have hq : (n : Rat) <= 1 := by exact_mod_cast this + push_cast at hk; linarith + have hn_q : 1 + (n : Rat) * 2 = 2 + ((n * 2 - 1 : Nat) : Rat) := by + exact_mod_cast (by omega : 1 + n * 2 = 2 + (n * 2 - 1)) + rcases ih.1 (Or.inr rfl) (1 + + (n * 2 - 1) * 2) (fun h => by contradiction) (fun _ => ⟨n * 2 - 1, rfl⟩) + (by push_cast at hk ⊢; linarith) with ⟨m', v, a, b, hS, hm'⟩ + have heq : 1 + n * 2 = 2 + (n * 2 - 1) := by omega + rw [heq] + exact ⟨m', V :: v, a * (1 / 2), b * (1 / 2), BScan.T hS, hm'⟩ + | @odd_c r u hS ih => + refine ⟨fun _ k _ hO_k hk => ?_, fun h => by contradiction⟩ + rcases hO_k rfl with ⟨n, rfl⟩ + have hWu := one_le_wordWeightCanon_of_MS hS + rw [wordWeightCanon_prependQK] at hk; dsimp [wordWeightCanon] at hk + rcases powHalf_and_powFour_bounds r with ⟨_, _, hp4, _⟩ + have hn2 : 2 <= n := by + by_contra hlt; have : n <= 1 := by omega + have hq : (n : Rat) <= 1 := by exact_mod_cast this + push_cast at hk; nlinarith + have hpow_ge : 2 <= 2 ^ (1 + r) := by + rw [pow_two_one_add r]; have := pow_two_pos r; omega + rcases even_or_odd_mul_two (n - 1) with ⟨m, hm⟩ | ⟨m, hm⟩ + · have hk_eq : 1 + n * 2 = 3 + m * 4 := by omega + have hm_pow : m * 2 <= m * 2 ^ (1 + r) := Nat.mul_le_mul_left m hpow_ge + have hm_pow_q : (m : Rat) * 2 <= ((m * 2 ^ (1 + r) : Nat) : Rat) := by exact_mod_cast hm_pow + have hm_q : (n : Rat) = 1 + (m : Rat) * 2 := by exact_mod_cast (by omega : n = 1 + m * 2) + rcases ih.2 rfl (1 + m * 2 ^ (1 + r)) ⟨m * 2 ^ r, by rw [pow_two_one_add r]; ring⟩ + (by push_cast at hk hm_pow_q ⊢; nlinarith) with ⟨m', v, a, b, hSub, hm'⟩ + rw [hk_eq] + exact ⟨m', K :: (List.replicate r V ++ v), (2 + a * 2) * powHalf r, b * 2 * powHalf r, + BScan.odd_chain0 r hSub, hm'⟩ + · have hk_eq : 1 + n * 2 = 5 + m * 4 := by omega + have hm_pow : m * 2 <= m * 2 ^ (1 + r) := Nat.mul_le_mul_left m hpow_ge + have hm_pow_q : (m : Rat) * 2 <= ((m * 2 ^ (1 + r) : Nat) : Rat) := by exact_mod_cast hm_pow + have hm_q : (n : Rat) = 2 + (m : Rat) * 2 := by exact_mod_cast (by omega : n = 2 + m * 2) + rcases ih.2 rfl (1 + m * 2 ^ (1 + r)) ⟨m * 2 ^ r, by rw [pow_two_one_add r]; ring⟩ + (by push_cast at hk hm_pow_q ⊢; nlinarith) with ⟨m', v, a, b, hSub, hm'⟩ + rw [hk_eq] + exact ⟨m', Q :: (List.replicate r V ++ v), 1 + (2 + a * 2) * powHalf r, b * 2 * powHalf r, + BScan.odd_chain1 r hSub, hm'⟩ + | @short_K u hE ih => + refine ⟨fun _ k hE_k _ hk => ?_, fun h => by contradiction⟩ + rcases hE_k rfl with ⟨n, rfl⟩ + have hw := (wordWeightCanon_nonneg u).2.2.2 + dsimp [wordWeightCanon] at hk + have hn2 : 2 <= n := by + by_contra hlt; have : n <= 1 := by omega + have hq : (n : Rat) <= 1 := by exact_mod_cast this + push_cast at hk; linarith + rcases even_or_odd_mul_two n with ⟨m, rfl⟩ | ⟨m, rfl⟩ + · have hm1 : 1 <= m := by omega + have hk_eq : m * 2 * 2 = 4 + (m - 1) * 4 := by omega + have hm_q : (m : Rat) = 1 + ((m - 1 : Nat) : Rat) := by + exact_mod_cast (by omega : m = 1 + (m - 1)) + rcases ih.1 (Or.inl rfl) ((m - 1) * 2) (fun _ => ⟨m - 1, rfl⟩) (fun h => by contradiction) + (by push_cast at hk ⊢; linarith) with ⟨m', v, a, b, hSub, hm'⟩ + rw [hk_eq] + exact ⟨m', Q :: v, (7 / 2) + a * 2, b * 2, BScan.short10 hSub, hm'⟩ + · have hk_eq : (1 + m * 2) * 2 = 2 + m * 4 := by omega + rcases ih.1 (Or.inl rfl) (m * 2) (fun _ => ⟨m, rfl⟩) (fun h => by contradiction) + (by push_cast at hk ⊢; linarith) with ⟨m', v, a, b, hSub, hm'⟩ + rw [hk_eq] + exact ⟨m', K :: v, (5 / 2) + a * 2, b * 2, BScan.short00 hSub, hm'⟩ + | @even_c r u hS ih => + refine ⟨fun _ k hE_k _ hk => ?_, fun h => by contradiction⟩ + rcases hE_k rfl with ⟨n, rfl⟩ + have hWu := one_le_wordWeightCanon_of_MS hS + dsimp [wordWeightCanon] at hk; rw [loc_z0W_prependQK] at hk; + dsimp [wordWeightCanon] at hk + rcases powHalf_and_powFour_bounds r with ⟨_, _, hp4, _⟩ + have hn3 : 3 <= n := by + by_contra hlt; have : n <= 2 := by omega + have hq : (n : Rat) <= 2 := by exact_mod_cast this + push_cast at hk; nlinarith + have hk_eq : n * 2 = 6 + (n - 3) * 2 := by omega + have hn_q : (n : Rat) = 3 + ((n - 3 : Nat) : Rat) := by + exact_mod_cast (by omega : n = 3 + (n - 3)) + have hpow_ge : 2 <= 2 ^ (1 + r) := by + rw [pow_two_one_add r]; have := pow_two_pos r; omega + have hm_pow : (1 + (n - 3) * 2) * 2 <= (1 + (n - 3) * 2) * 2 ^ (1 + r) := + Nat.mul_le_mul_left (1 + (n - 3) * 2) hpow_ge + have hm_pow_q : (((1 + (n - 3) * 2) * 2 : Nat) : Rat) <= + (((1 + (n - 3) * 2) * 2 ^ (1 + r) : Nat) : Rat) := by + exact_mod_cast hm_pow + rcases ih.2 rfl (1 + (1 + (n - 3) * 2) * 2 ^ (1 + r)) ⟨(1 + (n - 3) * 2) * 2 ^ r, + by rw [pow_two_one_add r]; ring⟩ + (by push_cast at hk hm_pow_q ⊢; nlinarith) with ⟨m', v, a, b, hSub, hm'⟩ + rw [hk_eq] + exact ⟨m', List.replicate (1 + r) V ++ v, 1 + (1 + a) * (1 / 2) * powHalf r, + b * (1 / 2) * powHalf r, BScan.even_chain r hSub, hm'⟩ + | @shift_K u hE ih => + refine ⟨fun h => by rcases h with h | h <;> contradiction, fun _ k hO_k hk => ?_⟩ + rcases hO_k with ⟨n, rfl⟩ + have hw := (wordWeightCanon_nonneg u).2.2.2 + dsimp [wordWeightCanon] at hk + rcases ih.1 (Or.inl rfl) ((n * 2) * 2) (fun _ => ⟨n * 2, rfl⟩) (fun h => by contradiction) + (by push_cast at hk ⊢; linarith) with ⟨m', v, a, b, hSub, hm'⟩ + exact ⟨m', V :: v, a * (1 / 2), (1 / 4) + b * (1 / 2), BScan.shift_pair0 hSub, hm'⟩ + | @shift_c r u hS ih => + refine ⟨fun h => by rcases h with h | h <;> contradiction, fun _ k hO_k hk => ?_⟩ + rcases hO_k with ⟨n, rfl⟩ + have hWu := one_le_wordWeightCanon_of_MS hS + dsimp [wordWeightCanon] at hk; rw [loc_z0W_prependQK] at hk; + dsimp [wordWeightCanon] at hk + rcases powHalf_and_powFour_bounds r with ⟨_, _, hp4, _⟩ + have hn4 : 4 <= n := by + by_contra hlt; have : n <= 3 := by omega + have hq : (n : Rat) <= 3 := by exact_mod_cast this + push_cast at hk; nlinarith + have hpow_ge : 4 <= 2 ^ (2 + r) := by + have h2r : 2 + r = 1 + (1 + r) := by omega + rw [h2r, pow_two_one_add (1 + r), pow_two_one_add r]; have := pow_two_pos r; omega + rcases even_or_odd_mul_two (n - 1) with ⟨m, hm⟩ | ⟨m, hm⟩ + · have hk_eq : 1 + n * 2 = 3 + m * 4 := by omega + have hm_q : (n : Rat) = 1 + (m : Rat) * 2 := by exact_mod_cast (by omega : n = 1 + m * 2) + have h_even_sub : ∃ n', 1 + m * 2 ^ (2 + r) = 1 + n' * 2 := by + refine ⟨m * 2 ^ (1 + r), ?_⟩ + have h2r : 2 + r = (1 + r) + 1 := by omega + rw [h2r, Nat.pow_succ]; ring + have hm_pow : m * 4 <= m * 2 ^ (2 + r) := Nat.mul_le_mul_left m hpow_ge + have hm_pow_q : ((m * 4 : Nat) : Rat) <= ((m * 2 ^ (2 + r) : Nat) : Rat) := by + exact_mod_cast hm_pow + rcases ih.2 rfl (1 + m * 2 ^ (2 + r)) h_even_sub + (by push_cast at hk hm_pow_q ⊢; nlinarith) with ⟨m', v, a, b, hSub, hm'⟩ + rw [hk_eq] + exact ⟨m', K :: (List.replicate (1 + r) V ++ v), (1 + a) * powHalf r, b * powHalf r, + BScan.shift_chain0 r hSub, hm'⟩ + · have hk_eq : 1 + n * 2 = 5 + m * 4 := by omega + have hm_q : (n : Rat) = 2 + (m : Rat) * 2 := by exact_mod_cast (by omega : n = 2 + m * 2) + have h_even_sub : ∃ n', 1 + m * 2 ^ (2 + r) = 1 + n' * 2 := by + refine ⟨m * 2 ^ (1 + r), ?_⟩ + have h2r : 2 + r = (1 + r) + 1 := by omega + rw [h2r, Nat.pow_succ]; ring + have hm_pow : m * 4 <= m * 2 ^ (2 + r) := Nat.mul_le_mul_left m hpow_ge + have hm_pow_q : ((m * 4 : Nat) : Rat) <= ((m * 2 ^ (2 + r) : Nat) : Rat) := by + exact_mod_cast hm_pow + rcases ih.2 rfl (1 + m * 2 ^ (2 + r)) h_even_sub + (by push_cast at hk hm_pow_q ⊢; nlinarith) with ⟨m', v, a, b, hSub, hm'⟩ + rw [hk_eq] + exact ⟨m', Q :: (List.replicate (1 + r) V ++ v), 1 + (1 + a) * powHalf r, b * powHalf r, + BScan.shift_chain1 r hSub, hm'⟩ + | @short_Q u hO ih => + refine ⟨fun _ k hE_k _ hk => ?_, fun h => by contradiction⟩ + rcases hE_k rfl with ⟨n, rfl⟩ + have hw := (wordWeightCanon_nonneg u).2.2.2 + dsimp [wordWeightCanon] at hk + have hn2 : 2 <= n := by + by_contra hlt; have : n <= 1 := by omega + have hq : (n : Rat) <= 1 := by exact_mod_cast this + push_cast at hk; linarith + rcases even_or_odd_mul_two n with ⟨m, rfl⟩ | ⟨m, rfl⟩ + · have hm1 : 1 <= m := by omega + have hk_eq : m * 2 * 2 = 4 + (m - 1) * 4 := by omega + have hm_q : (m : Rat) = 1 + ((m - 1 : Nat) : Rat) := by + exact_mod_cast (by omega : m = 1 + (m - 1)) + rcases ih.1 (Or.inr rfl) (1 + (m - 1) * 2) (fun h => by contradiction) (fun _ => ⟨m - 1, rfl⟩) + (by push_cast at hk ⊢; linarith) with ⟨m', v, a, b, hSub, hm'⟩ + rw [hk_eq] + exact ⟨m', Q :: v, (5 / 2) + a * 2, b * 2, BScan.short11 hSub, hm'⟩ + · have hk_eq : (1 + m * 2) * 2 = 2 + m * 4 := by omega + rcases ih.1 (Or.inr rfl) (1 + m * 2) (fun h => by contradiction) (fun _ => ⟨m, rfl⟩) + (by push_cast at hk ⊢; linarith) with ⟨m', v, a, b, hSub, hm'⟩ + rw [hk_eq] + exact ⟨m', K :: v, (3 / 2) + a * 2, b * 2, BScan.short01 hSub, hm'⟩ + | @shift_Q u hO ih => + refine ⟨fun h => by rcases h with h | h <;> contradiction, fun _ k hO_k hk => ?_⟩ + rcases hO_k with ⟨n, rfl⟩ + have hw := (wordWeightCanon_nonneg u).2.2.2 + dsimp [wordWeightCanon] at hk + rcases ih.1 (Or.inr rfl) (1 + (n * 2) * 2) (fun h => by contradiction) (fun _ => ⟨n * 2, rfl⟩) + (by push_cast at hk ⊢; linarith) with ⟨m', v, a, b, hSub, hm'⟩ + exact ⟨m', V :: v, a * (1 / 2), (1 / 2) + b * (1 / 2), BScan.shift_pair1 hSub, hm'⟩ + | @pair0_E u hE ih => + refine ⟨fun _ k hE_k _ hk => ?_, fun h => by contradiction⟩ + rcases hE_k rfl with ⟨n, rfl⟩ + have hw := (wordWeightCanon_nonneg u).2.2.2 + dsimp [wordWeightCanon] at hk + have hn2 : 2 <= n := by + by_contra hlt; have : n <= 1 := by omega + have hq : (n : Rat) <= 1 := by exact_mod_cast this + push_cast at hk; linarith + have hk_eq : n * 2 = 1 + (n * 2 - 1) := by omega + have hn_q : (n : Rat) * 2 = 1 + ((n * 2 - 1 : Nat) : Rat) := by exact_mod_cast hk_eq + rcases ih.1 (Or.inl rfl) ((n * 2 - 1) * 2) (fun _ => ⟨n * 2 - 1, + rfl⟩) (fun h => by contradiction) + (by push_cast at hk ⊢; linarith) with ⟨m', v, a, b, hSub, hm'⟩ + rw [hk_eq] + exact ⟨m', V :: v, a * (1 / 2), (1 / 4) + b * (1 / 2), BScan.pair0 hSub, hm'⟩ + | @pair0_O u hE ih => + refine ⟨fun _ k _ hO_k hk => ?_, fun h => by contradiction⟩ + rcases hO_k rfl with ⟨n, rfl⟩ + have hw := (wordWeightCanon_nonneg u).2.2.2 + dsimp [wordWeightCanon] at hk + rcases ih.1 (Or.inl rfl) ((n * 2) * 2) (fun _ => ⟨n * 2, rfl⟩) (fun h => by contradiction) + (by push_cast at hk ⊢; linarith) with ⟨m', v, a, b, hSub, hm'⟩ + exact ⟨m', V :: v, a * (1 / 2), (1 / 4) + b * (1 / 2), BScan.pair0 hSub, hm'⟩ + | @pair1_E u hO ih => + refine ⟨fun _ k hE_k _ hk => ?_, fun h => by contradiction⟩ + rcases hE_k rfl with ⟨n, rfl⟩ + have hw := (wordWeightCanon_nonneg u).2.2.2 + dsimp [wordWeightCanon] at hk + have hn2 : 2 <= n := by + by_contra hlt; have : n <= 1 := by omega + have hq : (n : Rat) <= 1 := by exact_mod_cast this + push_cast at hk; linarith + have hk_eq : n * 2 = 1 + (n * 2 - 1) := by omega + have hn_q : (n : Rat) * 2 = 1 + ((n * 2 - 1 : Nat) : Rat) := by exact_mod_cast hk_eq + rcases ih.1 (Or.inr rfl) (1 + + (n * 2 - 1) * 2) (fun h => by contradiction) (fun _ => ⟨n * 2 - 1, rfl⟩) + (by push_cast at hk ⊢; linarith) with ⟨m', v, a, b, hSub, hm'⟩ + rw [hk_eq] + exact ⟨m', V :: v, a * (1 / 2), (1 / 2) + b * (1 / 2), BScan.pair1 hSub, hm'⟩ + | @pair1_O u hO ih => + refine ⟨fun _ k _ hO_k hk => ?_, fun h => by contradiction⟩ + rcases hO_k rfl with ⟨n, rfl⟩ + have hw := (wordWeightCanon_nonneg u).2.2.2 + dsimp [wordWeightCanon] at hk + rcases ih.1 (Or.inr rfl) (1 + (n * 2) * 2) (fun h => by contradiction) (fun _ => ⟨n * 2, rfl⟩) + (by push_cast at hk ⊢; linarith) with ⟨m', v, a, b, hSub, hm'⟩ + exact ⟨m', V :: v, a * (1 / 2), (1 / 2) + b * (1 / 2), BScan.pair1 hSub, hm'⟩ + +theorem wordMassK_of_digitVal_zero {A H : Nat} {w : WordList} (h : DigitVal A H w) (h0 : A = 0) : + wordMassK w = ((2 ^ H : Nat) : Rat) - 1 := by + induction h with + | nil => simp [wordMassK] + | @zero A1 H1 u1 _ ih => + have hA1 : A1 = 0 := by omega + rw [pow_two_one_add]; dsimp [wordMassK]; rw [ih hA1]; push_cast; ring + | one _ => omega + +theorem exists_bScan_piece3 {n_mid : Nat} (hn : 2 <= n_mid) : + ∃ m_end d1 a_t b_t, + BScan false (n_mid * 4) [K, Q, Q, Q, Q, K] (m_end * 8) [Q, d1, V, V] a_t b_t /\ + wordScale [Q, d1, V, V] = 1 /\ + wordWeightCanon [Q, d1, V, V] <= 15 / 4 /\ + startsWithQKOrQQ [Q, d1, V, V] = true /\ + a_t - b_t <= 6 /\ + b_t - a_t <= 0 := by + have hm0 : 1 <= n_mid - 1 := by omega + rcases even_or_odd_mul_two (n_mid - 1) with ⟨m1, hm1⟩ | ⟨m1, hm1⟩ + · have hm1_pos : 1 <= m1 := by omega + have hk0 : n_mid * 4 = 4 + ((m1 - 1) * 2 + 2) * 4 := by omega + have hk1 : ((m1 - 1) * 2 + 2) * 2 = 4 + (m1 - 1) * 4 := by omega + have hB0 : BScan false (1 + ((m1 - 1) * 2) * 2) [Q, + K] ((m1 - 1) * 8) [V] (0 * (1 / 2)) ((1 / 4) + 0 * (1 / 2)) := by + have h := BScan.pair0 (BScan.nil (((m1 - 1) * 2) * 2 * 2)) + have heq : ((m1 - 1) * 2) * 2 * 2 = (m1 - 1) * 8 := by ring + rw [heq] at h + exact h + have hB1 := BScan.pair1 hB0 + have hB2 := BScan.short11 hB1 + rw [<- hk1] at hB2 + have hB3 := BScan.short10 hB2 + rw [<- hk0] at hB3 + refine ⟨m1 - 1, Q, _, _, hB3, ?_⟩ + refine ⟨by norm_num [wordScale], by dsimp [wordWeightCanon, loc_z0W]; norm_num, + rfl, by norm_num, by norm_num⟩ + · have hk0 : n_mid * 4 = 4 + (1 + m1 * 2) * 4 := by omega + have hk1 : (1 + m1 * 2) * 2 = 2 + m1 * 4 := by omega + have hB0 : BScan false (1 + (m1 * 2) * 2) [Q, + K] (m1 * 8) [V] (0 * (1 / 2)) ((1 / 4) + 0 * (1 / 2)) := by + have h := BScan.pair0 (BScan.nil ((m1 * 2) * 2 * 2)) + have heq : (m1 * 2) * 2 * 2 = m1 * 8 := by ring + rw [heq] at h + exact h + have hB1 := BScan.pair1 hB0 + have hB2 := BScan.short01 hB1 + rw [<- hk1] at hB2 + have hB3 := BScan.short10 hB2 + rw [<- hk0] at hB3 + refine ⟨m1, K, _, _, hB3, ?_⟩ + refine ⟨by norm_num [wordScale], by dsimp [wordWeightCanon, loc_z0W]; norm_num, + rfl, by norm_num, by norm_num⟩ + +theorem brIncs_of_bScan {s : Bool} {k : Nat} {u : WordList} {k' : Nat} {v : WordList} {a b : Rat} + (h1 : BScan s k u k' v a b) : + ∀ {r r' : HalfTape}, BRIncs false k' r r' -> BRIncs s k (evalWords u r) (evalWords v r') := by + induction h1 with + | nil _ => intro r r' h2; exact h2 + | T _ ih => intro r r' h2; exact BRIncs.T (ih h2) + | pair0 _ ih => intro r r' h2; exact BRIncs.pair0 (ih h2) + | pair1 _ ih => intro r r' h2; exact BRIncs.pair1 (ih h2) + | short00 _ ih => intro r r' h2; exact BRIncs.short00 (ih h2) + | short01 _ ih => intro r r' h2; exact BRIncs.short01 (ih h2) + | short10 _ ih => intro r r' h2; exact BRIncs.short10 (ih h2) + | short11 _ ih => intro r r' h2; exact BRIncs.short11 (ih h2) + | @odd_chain0 r_ch m u k v a b _ ih => + intro r r' h2 + have h_in : evalWords (prependQK r_ch (V :: u)) r = + evalWords (prependQK r_ch [V]) (evalWords u r) := by + rw [<- evalWords_append, <- prependQK_append]; rfl + have h_out : evalWords (K :: (List.replicate r_ch V ++ + v)) r' = d0 +> evalWords (List.replicate r_ch V) (evalWords v r') := by + dsimp [evalWords]; rw [evalWords_append] + rw [h_in, h_out] + exact BRIncs.odd_chain0 r_ch (ih h2) + | @odd_chain1 r_ch m u k v a b _ ih => + intro r r' h2 + have h_in : evalWords (prependQK r_ch (V :: u)) r = + evalWords (prependQK r_ch [V]) (evalWords u r) := by + rw [<- evalWords_append, <- prependQK_append]; rfl + have h_out : evalWords (Q :: (List.replicate r_ch V ++ + v)) r' = d1 +> evalWords (List.replicate r_ch V) (evalWords v r') := by + dsimp [evalWords]; rw [evalWords_append] + rw [h_in, h_out] + exact BRIncs.odd_chain1 r_ch (ih h2) + | @even_chain r_ch m u k v a b _ ih => + intro r r' h2 + have h_in : evalWords (K :: prependQK r_ch (V :: u)) r = + d0 +> evalWords (prependQK r_ch [V]) (evalWords u r) := by + dsimp [evalWords]; rw [<- evalWords_append, <- prependQK_append]; rfl + have h_out : evalWords (List.replicate (1 + r_ch) V ++ + v) r' = evalWords (List.replicate (1 + r_ch) V) (evalWords v r') := by + rw [evalWords_append] + rw [h_in, h_out] + exact BRIncs.even_chain r_ch (ih h2) + | shift_pair0 _ ih => intro r r' h2; exact BRIncs.shift_pair0 (ih h2) + | shift_pair1 _ ih => intro r r' h2; exact BRIncs.shift_pair1 (ih h2) + | @shift_chain0 r_ch m u k v a b _ ih => + intro r r' h2 + have h_in : evalWords (K :: prependQK r_ch (V :: u)) r = + d0 +> evalWords (prependQK r_ch [V]) (evalWords u r) := by + dsimp [evalWords]; rw [<- evalWords_append, <- prependQK_append]; rfl + have h_out : evalWords (K :: (List.replicate (1 + r_ch) V ++ + v)) r' = d0 +> evalWords (List.replicate (1 + r_ch) V) (evalWords v r') := by + dsimp [evalWords]; rw [evalWords_append] + rw [h_in, h_out] + exact BRIncs.shift_chain0 r_ch (ih h2) + | @shift_chain1 r_ch m u k v a b _ ih => + intro r r' h2 + have h_in : evalWords (K :: prependQK r_ch (V :: u)) r = + d0 +> evalWords (prependQK r_ch [V]) (evalWords u r) := by + dsimp [evalWords]; rw [<- evalWords_append, <- prependQK_append]; rfl + have h_out : evalWords (Q :: (List.replicate (1 + r_ch) V ++ + v)) r' = d1 +> evalWords (List.replicate (1 + r_ch) V) (evalWords v r') := by + dsimp [evalWords]; rw [evalWords_append] + rw [h_in, h_out] + exact BRIncs.shift_chain1 r_ch (ih h2) + +theorem binary_of_digitVal {A H : Nat} {ds : WordList} (hD : DigitVal A H ds) : + ∀ (n : Nat), A = 1 + n -> 2 ^ (H - 1) <= 1 + n -> Binary (1 + n) H (evalWords ds default) := by + induction hD with + | nil => intro n hA _; omega + | @zero A' H' u hD' ih => + intro n hA hPow + have hA'_pos : 1 <= A' := by omega + cases H' with + | zero => + have hlt := lt_pow_of_digitVal hD' + omega + | succ H'' => + have hpow_sub : 2 ^ ((1 + (H'' + 1)) - 1) = 2 ^ ((H'' + 1) - 1) * 2 := by + simp [Nat.pow_succ] + have hIH := ih (A' - 1) (by omega) (by omega) + have hB := Binary.zero hIH + have heq1 : 2 + (A' - 1) * 2 = 1 + n := by omega + rw [heq1] at hB + exact hB + | @one A' H' u hD' ih => + intro n hA hPow + cases H' with + | zero => + have hlt := lt_pow_of_digitVal hD' + have hA'0 : A' = 0 := by omega + subst hA'0 + have hu : u = [] := (digitVal_unique_canon DigitVal.nil hD').symm + subst hu + have hn0 : n = 0 := by omega + subst hn0 + exact Binary.one + | succ H'' => + have hpow_sub : 2 ^ ((1 + (H'' + 1)) - 1) = 2 ^ ((H'' + 1) - 1) * 2 := by + simp [Nat.pow_succ] + have h_ge1 : 1 <= 2 ^ ((H'' + 1) - 1) := by + have := pow_two_pos ((H'' + 1) - 1); omega + have hA'_pos : 1 <= A' := by omega + have hIH := ih (A' - 1) (by omega) (by omega) + have hB := Binary.two hIH + have heq1 : 3 + (A' - 1) * 2 = 1 + n := by omega + rw [heq1] at hB + exact hB + +-- Section 7D: P33 prefix, BGood, BStep, phaseScan_budget_eq, finite rounds executor, +-- and machine glue + +def prefix33Words : WordList := + ([V, V, Q, V, V, Q, V, V, K, V, V, K, V, V, Q, V, V, Q, V, V, K, V, V, K, V, V, Q, V, V, Q, V, + V] ++ [K]) + +def out33Words : WordList := + ([V, Q, V, V, K, V, V, K, V, V, Q, V, V, Q, V, V, K, V, V, K, V, V, Q, V, V, Q, V, V, K, V, V, + K] ++ [V]) + +def tail8Words : WordList := [Q, Q, K, K, Q, Q, Q, Q] + +theorem digitVal_tail8Words : DigitVal 243 8 tail8Words := + DigitVal.one (DigitVal.one (DigitVal.zero (DigitVal.zero (DigitVal.one (DigitVal.one + (DigitVal.one (DigitVal.one DigitVal.nil))))))) + +theorem brIncs_step_11 (m : Nat) {k_in k_out : Nat} {r r' : HalfTape} + (h1 : k_in = 4 + m * 2) (h2 : k_out = 1 + m * 4) + (h : BRIncs false k_out r r') : + BRIncs false k_in (t +> (t +> (d1 +> r))) (t +> (d1 +> (t +> r'))) := by + have h_in : k_in = 2 + (2 + m * 2) := by omega + have h_out : k_out = 1 + (m * 2) * 2 := by omega + rw [h_out] at h + have h_sp := BRIncs.shift_pair1 h + have h_oc := BRIncs.odd_chain1 0 h_sp + have h_mid : 5 + m * 4 = 1 + (2 + m * 2) * 2 := by omega + rw [h_mid] at h_oc + rw [h_in] + exact BRIncs.T h_oc + +theorem brIncs_step_01 (m : Nat) {k_in k_out : Nat} {r r' : HalfTape} + (h1 : k_in = 3 + m * 2) (h2 : k_out = 1 + m * 4) + (h : BRIncs false k_out r r') : + BRIncs false k_in (t +> (t +> (d1 +> r))) (t +> (d0 +> (t +> r'))) := by + have h_in : k_in = 2 + (1 + m * 2) := by omega + have h_out : k_out = 1 + (m * 2) * 2 := by omega + rw [h_out] at h + have h_sp := BRIncs.shift_pair1 h + have h_oc := BRIncs.odd_chain0 0 h_sp + have h_mid : 3 + m * 4 = 1 + (1 + m * 2) * 2 := by omega + rw [h_mid] at h_oc + rw [h_in] + exact BRIncs.T h_oc + +theorem brIncs_step_00 (m : Nat) {k_in k_out : Nat} {r r' : HalfTape} + (h1 : k_in = 3 + m * 2) (h2 : k_out = m * 4) + (h : BRIncs false k_out r r') : + BRIncs false k_in (t +> (t +> (d0 +> r))) (t +> (d0 +> (t +> r'))) := by + have h_in : k_in = 2 + (1 + m * 2) := by omega + have h_out : k_out = (m * 2) * 2 := by omega + rw [h_out] at h + have h_sp := BRIncs.shift_pair0 h + have h_oc := BRIncs.odd_chain0 0 h_sp + have h_mid : 3 + m * 4 = 1 + (1 + m * 2) * 2 := by omega + rw [h_mid] at h_oc + rw [h_in] + exact BRIncs.T h_oc + +theorem brIncs_step_10 (m : Nat) {k_in k_out : Nat} {r r' : HalfTape} + (h1 : k_in = 4 + m * 2) (h2 : k_out = m * 4) + (h : BRIncs false k_out r r') : + BRIncs false k_in (t +> (t +> (d0 +> r))) (t +> (d1 +> (t +> r'))) := by + have h_in : k_in = 2 + (2 + m * 2) := by omega + have h_out : k_out = (m * 2) * 2 := by omega + rw [h_out] at h + have h_sp := BRIncs.shift_pair0 h + have h_oc := BRIncs.odd_chain1 0 h_sp + have h_mid : 5 + m * 4 = 1 + (2 + m * 2) * 2 := by omega + rw [h_mid] at h_oc + rw [h_in] + exact BRIncs.T h_oc + +theorem brIncs_prefix33Words {r r' : HalfTape} (h : BRIncs false 249044 r r') : + BRIncs false 128 (evalWords prefix33Words r) (evalWords out33Words r') := by + exact + brIncs_step_11 62 rfl rfl ( + brIncs_step_01 123 rfl rfl ( + brIncs_step_00 245 rfl rfl ( + brIncs_step_10 488 rfl rfl ( + brIncs_step_11 974 rfl rfl ( + brIncs_step_01 1947 rfl rfl ( + brIncs_step_00 3893 rfl rfl ( + brIncs_step_10 7784 rfl rfl ( + brIncs_step_11 15566 rfl rfl ( + brIncs_step_01 31131 rfl rfl ( + brIncs_step_00 62261 rfl rfl h)))))))))) + +inductive BGood : WordList -> Prop where + | intro (H : Nat) (u : WordList) (A : Nat) (hi8 : WordList) : + DigitVal A H hi8 -> + wordScale u * ((2 ^ H : Nat) : Rat) = 128 -> + wordScale u <= 1 / 16 -> + (∃ w, u = V :: V :: (w ++ [V])) -> + startsWithQKOrQQ u = true -> + (∃ w, hi8 = Q :: K :: w) -> + wordWeightCanon u <= 74 / 5 -> + wordScale u * wordMassK hi8 <= 1273 / 10 -> + BGood (u ++ (hi8 ++ tail8Words)) + +inductive BStep : WordList -> WordList -> Prop where + | intro (orig : WordList) (n : Nat) (v : WordList) (a b : Rat) (J : Nat) (ds : WordList) : + BScan false 249044 (orig ++ [K]) (n * 2) v a b -> + DigitVal (1 + n) J ds -> + BStep orig ([V, V, K, V] ++ v ++ ds) + +theorem bGood_progress {orig : WordList} (hG : BGood orig) : + ∃ out, BStep orig out /\ BGood out := by + rcases hG with ⟨H, u, A, hi8, hDig, hHeight, hU11, ⟨wu, hwu⟩, hLu, ⟨w0, hw0⟩, hWu_max, hZ_max⟩ + have hWu_nonneg := (wordWeightCanon_nonneg u).2.2.2 + have hSu := wordScale_pos u + have hPrU : WordPrefixMode ME u := by rw [hwu]; exact wordPrefixMode_ME_cons_V_V wu + have hk_in : 16 * wordWeightCanon u < (249044 : Rat) - 3 := by linarith only [hWu_max] + rcases (exists_bScan_of_wordPrefixMode hPrU).1 (Or.inl rfl) 249044 (fun _ => ⟨124522, + rfl⟩) (fun h => by contradiction) hk_in with ⟨m1, v1, a1, b1, hB1, hm1⟩ + have hSv1 := wordScale_pos v1 + have hWv1_nonneg := (wordWeightCanon_nonneg v1).2.2.2 + have h11_v1 : wordScale v1 <= (1 / 8) * wordScale u := by + have := bScan_scale_le_of_startsWithQKOrQQ hB1 hLu; dsimp [modeScaleWeight] at this; + linarith only [this] + rcases (bScan_loss_bounds hB1).1 rfl with ⟨hW_v1, hAB_1, hBA_1⟩ + have hBud1 := bScan_budget_eq hB1 + subst hw0 + rcases digitVal_cons_Q_inv hDig with ⟨A1, H1, hD1, hA1, hH1⟩ + rcases digitVal_cons_K_inv hD1 with ⟨A0, H0, hD0, hA0, hH0⟩ + have hDw0 := digitVal_scale_and_mass hD0 + have hSw0 := wordScale_pos w0 + have hZw0_nonneg := (wordWeightCanon_nonneg w0).2.1 + have hPowH : ((2 ^ H : Nat) : Rat) = 4 * wordScale w0 := by + have h1 : 2 ^ H = 4 * 2 ^ H0 := by + rw [hH1, hH0, pow_two_one_add (1 + H0), pow_two_one_add H0]; ring + have h2 : ((2 ^ H : Nat) : Rat) = ((4 * 2 ^ H0 : Nat) : Rat) := by exact_mod_cast h1 + rw [Nat.cast_mul] at h2 + change ((2 ^ H : Nat) : Rat) = 4 * ((2 ^ H0 : Nat) : Rat) at h2 + linarith only [h2, hDw0.1] + have hZ_hi8 : wordMassK (Q :: K :: w0) = 2 + 4 * wordMassK w0 := by dsimp [wordMassK]; ring + have hA0_pos : 0 < A0 := by + by_contra hle; have hA0_0 : A0 = 0 := by omega + have hZw0_0 := wordMassK_of_digitVal_zero hD0 hA0_0 + rw [<- hDw0.1] at hZw0_0 + have h_prod : wordScale u * wordMassK (Q :: K :: w0) + 2 * wordScale u = + wordScale u * (4 * wordScale w0) := by + rw [hZ_hi8, hZw0_0]; ring + have h_pow_u : wordScale u * ((2 ^ H : Nat) : Rat) = wordScale u * (4 * wordScale w0) := + by rw [hPowH] + linarith only [h_prod, h_pow_u, hHeight, hU11, hZ_max] + have hLw0 : startsWithQKOrQQ (w0 ++ [K]) = true := startsWithQKOrQQ_of_digitVal_pos hD0 hA0_pos + have hY_w0qqk : wordMass (w0 ++ [Q, Q, K]) = wordMass w0 + 7 * wordScale w0 := by + rw [wordMass_append]; dsimp [wordMass]; ring + have hZ_w0qqk : wordMassK (w0 ++ [Q, Q, K]) = wordMassK w0 + 4 * wordScale w0 := by + rw [wordMassK_append]; dsimp [wordMassK]; ring + have hScan_cond : (wordMass (w0 ++ [Q, Q, K]) + wordMassK (w0 ++ [Q, Q, + K])) * 2 < ((m1 * 2 : Nat) : Rat) := by + have h_yw0 : wordMass w0 = wordScale w0 - 1 := by linarith only [hDw0.1, hDw0.2.1] + push_cast at hBud1 ⊢ + have hm1_nn : (0 : Rat) <= (m1 : Rat) := Nat.cast_nonneg m1 + have hm1_ub : ((m1 : Rat) * 2) * wordScale v1 <= + ((m1 : Rat) * 2) * ((1 / 8) * wordScale u) := by + nlinarith only [hm1_nn, h11_v1] + have h_bud1_exp : (1 + (m1 : Rat) - 3) * wordScale v1 = + (1 / 2) * (((m1 : Rat) * 2) * wordScale v1) - 2 * wordScale v1 := by ring + have h_lhs_u : wordScale u * ((wordMass (w0 ++ [Q, Q, K]) + wordMassK (w0 ++ [Q, Q, K])) * 2) = + 6 * (wordScale u * (4 * wordScale w0)) + + (1 / 2) * (wordScale u * wordMassK (Q :: K :: w0)) - 3 * wordScale u := by + rw [hY_w0qqk, hZ_w0qqk, h_yw0, hZ_hi8]; ring + have h_pow_u : wordScale u * ((2 ^ H : Nat) : Rat) = wordScale u * (4 * wordScale w0) := + by rw [hPowH] + have h_rhs_u : ((m1 : Rat) * 2) * ((1 / 8) * wordScale u) = + (1 / 8) * (wordScale u * ((m1 : Rat) * 2)) := by ring + have h_lt_u : wordScale u * ((wordMass (w0 ++ [Q, Q, K]) + wordMassK (w0 ++ [Q, Q, + K])) * 2) < wordScale u * ((m1 : Rat) * 2) := by + linarith only [h_lhs_u, h_pow_u, hHeight, hZ_max, hSu, hBud1, h_bud1_exp, hm1_ub, h_rhs_u, + hAB_1, hWu_max, hSv1] + nlinarith only [hSu, h_lt_u] + rcases exists_scan_of_mass_lt (w0 ++ [Q, Q, K]) m1 hScan_cond with ⟨b2, y, l2, hS2, _⟩ + rcases scan_qqk_inv hS2 w0 rfl with ⟨_, h11_y_fn, ⟨n_mid, hb2_eq⟩, ⟨y0, hy0⟩⟩ + subst hb2_eq + have h11_y : wordScale (V :: y) <= (1 / 64) * ((2 ^ H : Nat) : Rat) := by + have hy := h11_y_fn hLw0 + have h11_qqk : wordScale (w0 ++ [Q, Q, K]) = 8 * wordScale w0 := by + rw [wordScale_append] + norm_num [wordScale] + ring + have h_vy : wordScale (V :: y) = wordScale y * (1 / 2) := rfl + linarith only [h_vy, hy, h11_qqk, hPowH] + rcases bScan_high_digits hS2 hD0 with ⟨a2, b2_r, hB2, hY_vy, hAB_2, hBA_2⟩ + have hW_vy : wordWeightCanon (V :: y) <= (11 / 32) * wordMassK (Q :: K :: w0) := by + have := (wordWeightCanon_bounds (V :: y)).2; linarith only [this, hY_vy] + rcases bScan_append hB1 hB2 with ⟨a12, b12, hB12, ha12, hb12⟩ + have h11_v12 : wordScale (v1 ++ (V :: y)) <= 1 / 4 := by + rw [wordScale_append]; have hS_vy := wordScale_pos (V :: y) + have h_prod : wordScale v1 * wordScale (V :: y) <= + ((1 / 8) * wordScale u) * ((1 / 64) * ((2 ^ H : Nat) : Rat)) := by + nlinarith only [h11_v1, h11_y, hSv1, hS_vy] + have h_eq : ((1 / 8) * wordScale u) * ((1 / 64) * ((2 ^ H : Nat) : Rat)) = + (1 / 512) * (wordScale u * ((2 ^ H : Nat) : Rat)) := by ring + linarith only [h_prod, h_eq, hHeight] + have hSv12 := wordScale_pos (v1 ++ (V :: y)) + have hBud12 := bScan_budget_eq hB12 + have hZ_hi8_nn : 0 <= wordMassK (Q :: K :: w0) := (wordMass_nonneg (Q :: K :: w0)).2.1 + have hp1_ab : wordScale v1 * (a2 - b2_r) <= + (7 / 64) * (wordScale u * wordMassK (Q :: K :: w0)) := by + have hp : wordScale v1 * (a2 - b2_r) <= + ((1 / 8) * wordScale u) * ((7 / 8) * wordMassK (Q :: K :: w0)) := by + nlinarith only [h11_v1, hAB_2, hSv1, hZ_hi8_nn] + have heq : ((1 / 8) * wordScale u) * ((7 / 8) * wordMassK (Q :: K :: w0)) = + (7 / 64) * (wordScale u * wordMassK (Q :: K :: w0)) := by ring + linarith only [hp, heq] + have h_ab12 : a12 - b12 <= + (64 / 11) * wordWeightCanon u + (7 / 64) * (wordScale u * wordMassK (Q :: K :: w0)) := by + have h_diff : a12 - b12 = (a1 - b1) + wordScale v1 * (a2 - b2_r) := by rw [ha12, hb12]; ring + linarith only [h_diff, hAB_1, hp1_ab] + have hn_mid2 : 2 <= n_mid := by + by_contra hlt; have : n_mid <= 1 := by omega + have hq : (n_mid : Rat) <= 1 := by exact_mod_cast this + push_cast at hBud12 + have h_ub : ((n_mid : Rat) * 4 - 3) * wordScale (v1 ++ (V :: y)) <= 1 := by + nlinarith only [hq, h11_v12, hSv12] + linarith only [hBud12, h_ub, h_ab12, hWu_max, hZ_max] + rcases exists_bScan_piece3 hn_mid2 with ⟨m_end, d1_tok, a3, b3, hB3, h11_p3, hW_p3, hL_p3, + hAB_3, hBA_3⟩ + rcases bScan_append hB12 hB3 with ⟨a, b, hB_all, ha_all, hb_all⟩ + let v := (v1 ++ (V :: y)) ++ [Q, d1_tok, V, V] + have h11_v : wordScale v = wordScale (v1 ++ (V :: y)) := by + dsimp [v] + rw [wordScale_append, h11_p3] + ring + have hSv : 0 < wordScale v := wordScale_pos v + have h11_v_le : wordScale v <= 1 / 4 := by linarith only [h11_v, h11_v12] + have hW_v : wordWeightCanon v <= + (66 / 19) * wordWeightCanon u + (11 / 256) * (wordScale u * wordMassK (Q :: K :: w0)) + + 15 / 16 := by + dsimp [v]; rw [wordWeightCanon_append, wordWeightCanon_append] + have hW_p3_nn := (wordWeightCanon_nonneg [Q, d1_tok, V, V]).2.2.2 + have hW_vy_nn := (wordWeightCanon_nonneg (V :: y)).2.2.2 + have hp1 : wordScale v1 * wordWeightCanon (V :: y) <= + ((1 / 8) * wordScale u) * ((11 / 32) * wordMassK (Q :: K :: w0)) := by + nlinarith only [h11_v1, hW_vy, hSv1, hW_vy_nn] + have hp2 : wordScale (v1 ++ (V :: y)) * wordWeightCanon [Q, d1_tok, V, + V] <= (1 / 4) * (15 / 4) := by + nlinarith only [h11_v12, hW_p3, hSv12, hW_p3_nn] + have hp1_eq : ((1 / 8) * wordScale u) * ((11 / 32) * wordMassK (Q :: K :: w0)) = + (11 / 256) * (wordScale u * wordMassK (Q :: K :: w0)) := by ring + linarith only [hW_v1, hp1, hp1_eq, hp2] + have hAB : a - b <= 508 / 5 := by + have hp2 : wordScale (v1 ++ (V :: y)) * (a3 - b3) <= (1 / 4) * 6 := by + nlinarith only [h11_v12, hAB_3, hSv12] + have h_diff : a - b = (a12 - b12) + wordScale (v1 ++ (V :: y)) * (a3 - b3) := by + rw [ha_all, hb_all]; ring + linarith only [h_diff, h_ab12, hp2, hWu_max, hZ_max] + have hBA : b - a <= 8 := by + have hp1 : wordScale v1 * (b2_r - a2) <= wordScale v1 := by nlinarith only [hSv1, hBA_2] + have hp2 : wordScale (v1 ++ (V :: y)) * (b3 - a3) <= 0 := by nlinarith only [hSv12, hBA_3] + have h_diff : b - a = (b1 - a1) + wordScale v1 * (b2_r - a2) + wordScale (v1 ++ + (V :: y)) * (b3 - a3) := by + rw [ha_all, hb_all, ha12, hb12]; ring + linarith only [h_diff, hBA_1, hp1, hp2, h11_v1, hU11, hWu_max] + have hY_v_lt : wordMass v < ((2 ^ 17 : Nat) : Rat) := by + have := (wordWeightCanon_bounds v).1; push_cast; linarith only [this, hW_v, hWu_max, hZ_max] + rcases exists_heightShift_canon v 17 hY_v_lt with ⟨J, hHn⟩ + have hUnit := heightShift_sound v 17 J hHn + have hJ10 : 10 <= J := by + by_contra hlt; have hJ9 : J <= 9 := by omega + have hpow9 : 2 ^ J <= 2 ^ 9 := Nat.pow_le_pow_right (by decide) hJ9 + have hpow9_q : ((2 ^ J : Nat) : Rat) <= ((2 ^ 9 : Nat) : Rat) := by exact_mod_cast hpow9 + push_cast at hpow9_q hUnit + nlinarith only [hpow9_q, hUnit, h11_v_le, hSv] + let H8' := J - 8 + have hH8'_2 : 2 <= H8' := by omega + have hJ_eq : J = H8' + 8 := by omega + have hUnit_H8' : wordScale v * ((2 ^ H8' : Nat) : Rat) = 512 := by + have hpow : 2 ^ J = 2 ^ H8' * 256 := by rw [hJ_eq, Nat.pow_add] + have hpow_q : ((2 ^ J : Nat) : Rat) = ((2 ^ H8' : Nat) : Rat) * 256 := by + exact_mod_cast hpow + have h_eq : wordScale v * (((2 ^ H8' : Nat) : Rat) * 256) = + 256 * (wordScale v * ((2 ^ H8' : Nat) : Rat)) := by ring + have h17 : ((2 ^ 17 : Nat) : Rat) = 131072 := by norm_num + rw [hpow_q, h_eq, h17] at hUnit + linarith only [hUnit] + have hBud := bScan_budget_eq hB_all + have hBud_v : ((m_end : Rat) * 8) * wordScale v = 249041 + 3 * wordScale v - 2 * (a - b) := by + have h1 : wordScale ((v1 ++ (V :: y)) ++ [Q, d1_tok, V, V]) = wordScale v := rfl + rw [h1] at hBud + push_cast at hBud + have h2 : ((m_end : Rat) * 8 - 3) * wordScale v = + ((m_end : Rat) * 8) * wordScale v - 3 * wordScale v := by ring + linarith only [hBud, h2] + let B := 1 + m_end * 4 + have hB_cast : (B : Rat) = 1 + (m_end : Rat) * 4 := by dsimp [B]; push_cast; rfl + have hB_lo : 243 * 2 ^ H8' <= B := by + have h243_cast : ((243 * 2 ^ H8' : Nat) : Rat) = 243 * ((2 ^ H8' : Nat) : Rat) := by + rw [Nat.cast_mul]; rfl + have h_b_v : ((B : Rat) - ((243 * 2 ^ H8' : Nat) : Rat)) * wordScale v = + wordScale v + + (1 / 2) * (((m_end : Rat) * 8) * wordScale v) - 243 * (wordScale v * ((2 ^ H8' : Nat) : + Rat)) := by + rw [hB_cast, h243_cast]; ring + have h_pos_v : 0 < ((B : Rat) - ((243 * 2 ^ H8' : Nat) : Rat)) * wordScale v := by + linarith only [h_b_v, hBud_v, hUnit_H8', hAB, hSv] + have hq : ((243 * 2 ^ H8' : Nat) : Rat) <= (B : Rat) := by + nlinarith only [h_pos_v, hSv] + exact_mod_cast hq + have hB_hi : B < 244 * 2 ^ H8' := by + have h244_cast : ((244 * 2 ^ H8' : Nat) : Rat) = 244 * ((2 ^ H8' : Nat) : Rat) := by + rw [Nat.cast_mul]; rfl + have h_b_v : (((244 * 2 ^ H8' : Nat) : Rat) - (B : Rat)) * wordScale v = + 244 * (wordScale v * ((2 ^ H8' : Nat) : Rat)) - wordScale v - (1 / 2) * (((m_end : Rat) * + 8) * wordScale v) := by + rw [hB_cast, h244_cast]; ring + have h_pos_v : 0 < (((244 * 2 ^ H8' : Nat) : Rat) - (B : Rat)) * wordScale v := by + linarith only [h_b_v, hBud_v, hUnit_H8', hBA, h11_v_le] + have hq : (B : Rat) < ((244 * 2 ^ H8' : Nat) : Rat) := by + nlinarith only [h_pos_v, hSv] + exact_mod_cast hq + let A8' := B - 243 * 2 ^ H8' + have hA8'_lt : A8' < 2 ^ H8' := by omega + rcases exists_digitVal_of_lt_pow H8' A8' hA8'_lt with ⟨hi8', hD_hi8'⟩ + have hA8'_mod : ∃ m', A8' = 1 + m' * 4 := by + have hpow4 : 2 ^ H8' = 2 ^ (H8' - 2) * 4 := by + have heq : H8' = (H8' - 2) + 2 := by omega + conv_lhs => rw [heq, Nat.pow_add] + refine ⟨m_end - 243 * 2 ^ (H8' - 2), ?_⟩ + dsimp [A8', B]; omega + rcases hA8'_mod with ⟨m_a8, hm_a8⟩ + have hLow' : ∃ w, hi8' = Q :: K :: w := by + rw [hm_a8] at hD_hi8'; exact digitVal_mod_four_one_prefix hD_hi8' hH8'_2 + have hD_ds' : DigitVal (1 + m_end * 4) J (hi8' ++ tail8Words) := by + have hU := digitVal_append hD_hi8' digitVal_tail8Words + have heqA : A8' + 243 * 2 ^ H8' = 1 + m_end * 4 := by dsimp [A8', B]; omega + rw [heqA, <- hJ_eq] at hU; exact hU + let u' := [V, V, K, V] ++ v + have h11_u' : wordScale u' = (1 / 4) * wordScale v := by dsimp [u', wordScale]; ring + have hW_u' : wordWeightCanon u' = (11 / 32) + (1 / 4) * wordWeightCanon v := by + dsimp [u', wordWeightCanon]; ring + have hDef' := digitVal_wordMassK_eq hD_hi8' + have hA8'_q : (A8' : Rat) + 243 * ((2 ^ H8' : Nat) : Rat) = 1 + (m_end : Rat) * 4 := by + have heq : A8' + 243 * 2 ^ H8' = 1 + m_end * 4 := by dsimp [A8', B]; omega + exact_mod_cast heq + have hZ_new : wordScale u' * wordMassK hi8' <= 1273 / 10 := by + have h1 : wordMassK hi8' = ((2 ^ H8' : Nat) : Rat) - 1 - (A8' : Rat) := by linarith only [hDef'] + have h2 : (A8' : Rat) = 1 + (m_end : Rat) * 4 - 243 * ((2 ^ H8' : Nat) : Rat) := by + linarith only [hA8'_q] + have h_z_prod : wordScale u' * wordMassK hi8' = + (244 / 4) * (wordScale v * ((2 ^ H8' : Nat) : Rat)) - (1 / 2) * wordScale v - + (1 / 8) * (((m_end : Rat) * 8) * wordScale v) := by + rw [h11_u', h1, h2]; ring + linarith only [h_z_prod, hUnit_H8', hBud_v, hAB, hSv] + have hHeight' : wordScale u' * ((2 ^ H8' : Nat) : Rat) = 128 := by + have h_eq : wordScale u' * ((2 ^ H8' : Nat) : Rat) = + (1 / 4) * (wordScale v * ((2 ^ H8' : Nat) : Rat)) := by + rw [h11_u']; ring + linarith only [h_eq, hUnit_H8'] + refine ⟨u' ++ (hi8' ++ tail8Words), ?_, ?_⟩ + · have h_in_eq : (u ++ ((Q :: K :: w0) ++ tail8Words)) ++ [K] = + (u ++ ((Q :: K :: w0) ++ [Q, Q, K])) ++ [K, Q, Q, Q, Q, K] := by + dsimp [tail8Words]; simp [List.append_assoc] + have h_out_eq : u' ++ (hi8' ++ tail8Words) = [V, V, K, V] ++ v ++ (hi8' ++ tail8Words) := by + simp [u'] + rw [h_out_eq] + refine BStep.intro _ (m_end * 4) v a b J (hi8' ++ tail8Words) ?_ hD_ds' + have hk_out_eq : (m_end * 4) * 2 = m_end * 8 := by ring + rw [hk_out_eq, h_in_eq]; exact hB_all + · refine BGood.intro H8' u' A8' hi8' hD_hi8' hHeight' (by linarith only [h11_u', + h11_v_le]) ?_ ?_ hLow' (by linarith only [hW_u', hW_v, hWu_max, hZ_max]) hZ_new + · refine ⟨[K, V] ++ v1 ++ (V :: y) ++ [Q, d1_tok, V], ?_⟩ + simp [u', v, List.append_assoc] + · have heq_u' : u' = ([V, V, K, V] ++ (v1 ++ (V :: y))) ++ [Q, d1_tok, V, V] := by + simp [u', v, List.append_assoc] + rw [heq_u']; exact startsWithQKOrQQ_append_right _ _ hL_p3 + +theorem evalWords_default_of_digitVal_zero {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hZ : + A = 0) : + evalWords da default = default := by + induction hD with + | nil => rfl + | @zero A H u _ ih => + have hA0 : A = 0 := by omega + change d0 +> evalWords u default = default + rw [ih hA0, d0_append_default] + | one _ => omega + +theorem brIncs_of_digitVal_pos {A H : Nat} {da : WordList} (hD : DigitVal A H da) (hPos : 0 < A) : + BRIncs false ((A - 1) * 2) default (evalWords da default) := by + induction hD with + | nil => omega + | @zero A H u _ ih => + have hA_pos : 0 < A := by omega + have hIH := ih hA_pos + have hs := BRIncs.short00 hIH + rw [d0_append_default] at hs + have heq : (A * 2 - 1) * 2 = 2 + (A - 1) * 4 := by omega + dsimp [evalWords] + rwa [heq] + | @one A H u hDu ih => + cases A with + | zero => + change BRIncs false 0 default (d1 +> evalWords u default) + rw [evalWords_default_of_digitVal_zero hDu rfl] + have h0 := BRIncs.zero (default : HalfTape) + have hd : d1 +> (default : HalfTape) = one +> default := by + change (1 : Fin 2) >> (0 >> default) = 1 >> default + rw [ListBlank.cons_zero_default] + rw [hd]; exact h0 + | succ A => + have hA_pos : 0 < A + 1 := by omega + have hIH := ih hA_pos + have heq_in : (A + 1 - 1) * 2 = A * 2 := by omega + rw [heq_in] at hIH + have hs := BRIncs.short10 hIH + rw [d0_append_default] at hs + have heq : (1 + (A + 1) * 2 - 1) * 2 = 4 + A * 4 := by omega + dsimp [evalWords] + rwa [heq] + +theorem exists_brIncs_of_bStep {orig out : WordList} (hS : BStep orig out) : + ∃ r, BRIncs false 128 (evalWords (prefix33Words ++ orig) default) r /\ + evalWords (prefix33Words ++ out) default = evalWords [V, V, Q, V] r := by + rcases hS with ⟨n, v, a, b, J, ds, hI, hD⟩ + have hB : BRIncs false (n * 2) default (evalWords ds default) := by + have heq : n * 2 = ((1 + n) - 1) * 2 := by omega + rw [heq]; exact brIncs_of_digitVal_pos hD (by omega) + have hR_orig : BRIncs false 249044 (evalWords orig default) (evalWords (v ++ ds) default) := by + have hR := brIncs_of_bScan hI hB + simpa [evalWords_append, evalWords, d0_append_default] using! hR + have hR_p33 := brIncs_prefix33Words hR_orig + refine ⟨evalWords (out33Words ++ (v ++ ds)) default, ?_ , ?_⟩ + · rw [evalWords_append, evalWords_append]; exact hR_p33 + · have h_eq : prefix33Words ++ ([V, V, K, V] ++ v ++ ds) = [V, V, Q, + V] ++ (out33Words ++ (v ++ ds)) := by + simp [prefix33Words, out33Words] + rw [h_eq, evalWords_append] + +def decodeBinaryWords : Nat -> Nat -> Option WordList + | 0, _ => none + | _ + 1, 0 => none + | _ + 1, 1 => some [Q] + | fuel + 1, m + 2 => + match decodeBinaryWords fuel ((m + 2) / 2) with + | none => none + | some ws => some ((if (m + 2) % 2 == 0 then K else Q) :: ws) + +theorem decodeBinaryWords_sound (fuel : Nat) : + ∀ (m : Nat) (ws : WordList), decodeBinaryWords fuel m = some ws -> + ∃ H, Binary m H (evalWords ws default) := by + induction fuel with + | zero => intro m ws h; contradiction + | succ fuel ih => + intro m ws h + rcases m with _ | _ | m + · contradiction + · injection h with h; subst h + exact ⟨1, Binary.one⟩ + · dsimp [decodeBinaryWords] at h + cases hrec : decodeBinaryWords fuel ((m + 2) / 2) with + | none => rw [hrec] at h; contradiction + | some ws' => + rw [hrec] at h + injection h with h; subst h + rcases ih ((m + 2) / 2) ws' hrec with ⟨H, hB⟩ + have hq : (m + 2) / 2 = 1 + ((m + 2) / 2 - 1) := by omega + rw [hq] at hB + rcases Nat.mod_two_eq_zero_or_one (m + 2) with hmod | hmod + · have hcond : ((m + 2) % 2 == 0) = true := beq_iff_eq.mpr hmod + rw [hcond]; dsimp [evalWords] + refine ⟨1 + H, ?_⟩ + have heq : m + 2 = 2 + ((m + 2) / 2 - 1) * 2 := by omega + rw [heq]; exact Binary.zero hB + · have hcond : ((m + 2) % 2 == 0) = false := beq_false_of_ne (by omega) + rw [hcond]; dsimp [evalWords] + refine ⟨1 + H, ?_⟩ + have heq : m + 2 = 3 + ((m + 2) / 2 - 1) * 2 := by omega + rw [heq]; exact Binary.two hB + +inductive Choice where + | CT | CP0 | CP1 | CS00 | CS01 | CS10 | CS11 + | COC0 (r : Nat) | COC1 (r : Nat) | CEC (r : Nat) + | CSP0 | CSP1 | CSC0 (r : Nat) | CSC1 (r : Nat) +deriving DecidableEq + +open Choice + +def choiceInMode : Choice -> Bool + | CSP0 | CSP1 | CSC0 _ | CSC1 _ => true + | _ => false + +def choiceOutMode : Choice -> Bool + | COC0 _ | COC1 _ | CEC _ | CSC0 _ | CSC1 _ => true + | _ => false + +def choiceNextParam : Choice -> Nat -> Nat + | CT, k => k - 2 + | CP0, k | CP1, k | CSP0, k | CSP1, k => k - 1 + | CS00, k | CS01, k => (k - 2) / 4 + | CS10, k | CS11, k => (k - 4) / 4 + | COC0 _, k | CSC0 _, k => (k - 3) / 4 + | COC1 _, k | CSC1 _, k => (k - 5) / 4 + | CEC _, k => (k - 6) / 2 + +def choiceInMult : Choice -> Nat -> Nat + | CT, n => 2 + n + | CP0, n | CP1, n | CSP0, n | CSP1, n => 1 + n + | CS00, n | CS01, n => 2 + n * 4 + | CS10, n | CS11, n => 4 + n * 4 + | COC0 _, n | CSC0 _, n => 3 + n * 4 + | COC1 _, n | CSC1 _, n => 5 + n * 4 + | CEC _, n => 6 + n * 2 + +def choiceOutMult : Choice -> Nat -> Nat + | CT, n | CP1, n | CS01, n | CS11, n | CSP1, n => 1 + n * 2 + | CP0, n | CS00, n | CS10, n | CSP0, n => n * 2 + | COC0 r, n | COC1 r, n => 1 + n * 2 ^ (1 + r) + | CEC r, n => 1 + (1 + n * 2) * 2 ^ (1 + r) + | CSC0 r, n | CSC1 r, n => 1 + n * 2 ^ (2 + r) + +def choiceInWords : Choice -> WordList + | CT => [V] + | CP0 => [Q, K] + | CP1 => [Q, Q] + | CS00 | CS10 | CSP0 => [K] + | CS01 | CS11 | CSP1 => [Q] + | COC0 r | COC1 r => prependQK r [V] + | CEC r | CSC0 r | CSC1 r => K :: prependQK r [V] + +def choiceOutWords : Choice -> WordList + | CT | CP0 | CP1 | CSP0 | CSP1 => [V] + | CS00 | CS01 => [K] + | CS10 | CS11 => [Q] + | COC0 r => K :: List.replicate r V + | COC1 r => Q :: List.replicate r V + | CEC r => List.replicate (1 + r) V + | CSC0 r => K :: List.replicate (1 + r) V + | CSC1 r => Q :: List.replicate (1 + r) V + +def evalChoiceList : List Choice -> Bool -> Nat -> WordList -> Option WordList + | [], s, k, u => + forceNat (k / 2) (fun n => + if s == false then + if k == n * 2 then + if u.all isWordK then decodeBinaryWords 600 (1 + n) else none + else none + else none) + | ch :: cs, s, k, u => + forceNat (choiceNextParam ch k) (fun n => + if s == choiceInMode ch then + if k == choiceInMult ch n then + match stripWordPrefix (choiceInWords ch) u with + | none => none + | some w => + forceNat (choiceOutMult ch n) (fun k' => + match evalChoiceList cs (choiceOutMode ch) k' w with + | none => none + | some x => some (choiceOutWords ch ++ x)) + else none + else none) + +theorem evalChoiceList_sound (cs : List Choice) : + ∀ (s : Bool) (k : Nat) (u v : WordList), evalChoiceList cs s k u = some v -> + BRIncs s k (evalWords u default) (evalWords v default) := by + induction cs with + | nil => + intro s k u v hE + dsimp [evalChoiceList, forceNat_eq] at hE + cases hs : (s == false) with + | false => rw [hs] at hE; contradiction + | true => + rw [hs] at hE + have rfl_s : s = false := beq_iff_eq.mp hs + subst rfl_s + cases hk : (k == (k / 2) * 2) with + | false => rw [hk] at hE; contradiction + | true => + rw [hk] at hE + have rfl_k : k = (k / 2) * 2 := beq_iff_eq.mp hk + cases hu : u.all isWordK with + | false => rw [hu] at hE; contradiction + | true => + rw [hu] at hE + dsimp at hE + rw [evalWords_default_of_all_K u hu] + rcases decodeBinaryWords_sound 600 (1 + k / 2) v hE with ⟨H, hB⟩ + have hR := brIncs_of_binary hB + have heq : ((1 + k / 2) - 1) * 2 = k := by omega + rwa [heq] at hR + | cons ch cs ih => + intro s k u v hE + dsimp [evalChoiceList, forceNat_eq] at hE + cases hs : (s == choiceInMode ch) with + | false => rw [hs] at hE; contradiction + | true => + rw [hs] at hE + have rfl_s : s = choiceInMode ch := beq_iff_eq.mp hs + subst rfl_s + cases hk : (k == choiceInMult ch (choiceNextParam ch k)) with + | false => rw [hk] at hE; contradiction + | true => + rw [hk] at hE + dsimp at hE + have rfl_k : k = choiceInMult ch (choiceNextParam ch k) := beq_iff_eq.mp hk + cases hU : stripWordPrefix (choiceInWords ch) u with + | none => rw [hU] at hE; contradiction + | some w => + rw [hU] at hE + dsimp at hE + cases hC : evalChoiceList cs (choiceOutMode ch) (choiceOutMult ch (choiceNextParam ch k)) + w with + | none => rw [hC] at hE; contradiction + | some x => + rw [hC] at hE + injection hE with hE; subst hE + have rfl_u := stripWordPrefix_sound (choiceInWords ch) u w hU + subst rfl_u + have hIH := ih (choiceOutMode ch) (choiceOutMult ch (choiceNextParam ch k)) w x hC + rw [rfl_k] + cases ch with + | CT => exact BRIncs.T hIH + | CP0 => exact BRIncs.pair0 hIH + | CP1 => exact BRIncs.pair1 hIH + | CS00 => exact BRIncs.short00 hIH + | CS01 => exact BRIncs.short01 hIH + | CS10 => exact BRIncs.short10 hIH + | CS11 => exact BRIncs.short11 hIH + | COC0 r => + dsimp [choiceInWords, choiceOutWords, choiceInMode, choiceOutMode, choiceInMult, + choiceOutMult] at hIH ⊢ + rw [evalWords_append (prependQK r [V]) w]; dsimp [evalWords]; + rw [evalWords_append (List.replicate r V) x] + exact BRIncs.odd_chain0 r hIH + | COC1 r => + dsimp [choiceInWords, choiceOutWords, choiceInMode, choiceOutMode, choiceInMult, + choiceOutMult] at hIH ⊢ + rw [evalWords_append (prependQK r [V]) w]; dsimp [evalWords]; + rw [evalWords_append (List.replicate r V) x] + exact BRIncs.odd_chain1 r hIH + | CEC r => + dsimp [choiceInWords, choiceOutWords, choiceInMode, choiceOutMode, choiceInMult, + choiceOutMult] at hIH ⊢ + dsimp [evalWords]; + rw [evalWords_append (prependQK r [V]) w, + evalWords_append (List.replicate (1 + r) V) x] + exact BRIncs.even_chain r hIH + | CSP0 => exact BRIncs.shift_pair0 hIH + | CSP1 => exact BRIncs.shift_pair1 hIH + | CSC0 r => + dsimp [choiceInWords, choiceOutWords, choiceInMode, choiceOutMode, choiceInMult, + choiceOutMult] at hIH ⊢ + dsimp [evalWords]; + rw [evalWords_append (prependQK r [V]) w, + evalWords_append (List.replicate (1 + r) V) x] + exact BRIncs.shift_chain0 r hIH + | CSC1 r => + dsimp [choiceInWords, choiceOutWords, choiceInMode, choiceOutMode, choiceInMult, + choiceOutMult] at hIH ⊢ + dsimp [evalWords]; + rw [evalWords_append (prependQK r [V]) w, + evalWords_append (List.replicate (1 + r) V) x] + exact BRIncs.shift_chain1 r hIH + +def evalCanonStep (cs : List Choice) (u : WordList) : Option WordList := + match evalChoiceList cs false 128 (u ++ [K]) with + | some v => some ([V, V, Q, V] ++ v) + | none => none + +theorem evalCanonStep_sound (cs : List Choice) (u v : WordList) (h : evalCanonStep cs u = some v) : + ∃ r, BRIncs false 128 (evalWords u default) r /\ + evalWords v default = evalWords [V, V, Q, V] r := by + dsimp [evalCanonStep] at h + cases hE : evalChoiceList cs false 128 (u ++ [K]) with + | none => rw [hE] at h; contradiction + | some w => + rw [hE] at h + injection h with h; subst h + refine ⟨evalWords w default, ?_, rfl⟩ + have hR := evalChoiceList_sound cs false 128 (u ++ [K]) w hE + simpa [evalWords_append, evalWords, d0_append_default] using! hR + +inductive CanonRounds : HalfTape -> HalfTape -> Prop where + | refl (r : HalfTape) : CanonRounds r r + | next {r s t0 : HalfTape} : + BRIncs false 128 r s -> CanonRounds (evalWords [V, V, Q, V] s) t0 -> CanonRounds r t0 + +def evalCanonRounds : List (List Choice) -> WordList -> Option WordList + | [], u => some u + | c :: cs, u => + match evalCanonStep c u with + | none => none + | some v => evalCanonRounds cs v + +theorem evalCanonRounds_sound (cs : List (List Choice)) : + ∀ (u v : WordList), evalCanonRounds cs u = some v -> + CanonRounds (evalWords u default) (evalWords v default) := by + induction cs with + | nil => + intro u v h + injection h with h; subst h + exact CanonRounds.refl _ + | cons c cs ih => + intro u v h + dsimp [evalCanonRounds] at h + cases hW : evalCanonStep c u with + | none => rw [hW] at h; contradiction + | some w => + rw [hW] at h + rcases evalCanonStep_sound c u w hW with ⟨r, hR, hEq⟩ + refine CanonRounds.next hR ?_ + rw [<- hEq] + exact ih w v h + +def vWordCount : WordList -> Nat + | [] => 0 + | V :: u => 1 + vWordCount u + | K :: u => vWordCount u + | Q :: u => vWordCount u + +def pairWordCount : WordList -> Nat + | [] => 0 + | V :: u => pairWordCount u + | K :: u => 1 + pairWordCount u + | Q :: u => 1 + pairWordCount u + +theorem wordScale_mul_pow_vWordCount (u : WordList) : + wordScale u * ((2 ^ vWordCount u : Nat) : Rat) = ((2 ^ pairWordCount u : Nat) : Rat) := by + induction u with + | nil => simp [wordScale, vWordCount, pairWordCount] + | cons w u ih => + cases w with + | V => + dsimp [wordScale, vWordCount, pairWordCount] + rw [pow_two_one_add (vWordCount u), Nat.cast_add] + have h_eq : wordScale u * (1 / 2) * (((2 ^ vWordCount u : Nat) : Rat) + + ((2 ^ vWordCount u : Nat) : Rat)) = + wordScale u * ((2 ^ vWordCount u : Nat) : Rat) := by ring + linarith only [h_eq, ih] + | K => + dsimp [wordScale, vWordCount, pairWordCount] + rw [pow_two_one_add (pairWordCount u), Nat.cast_add] + have h_eq : wordScale u * 2 * ((2 ^ vWordCount u : Nat) : Rat) = + 2 * (wordScale u * ((2 ^ vWordCount u : Nat) : Rat)) := by ring + linarith only [h_eq, ih] + | Q => + dsimp [wordScale, vWordCount, pairWordCount] + rw [pow_two_one_add (pairWordCount u), Nat.cast_add] + have h_eq : wordScale u * 2 * ((2 ^ vWordCount u : Nat) : Rat) = + 2 * (wordScale u * ((2 ^ vWordCount u : Nat) : Rat)) := by ring + linarith only [h_eq, ih] + +def scaledWeightUpper : WordList -> Nat + | [] => 0 + | V :: u => (scaledWeightUpper u + 1) / 2 + | K :: u => 90112 + 2 * scaledWeightUpper u + | Q :: u => 65536 + 2 * scaledWeightUpper u + +theorem scaledWeightUpper_ge (u : WordList) : + 65536 * wordWeightCanon u <= ((scaledWeightUpper u : Nat) : Rat) := by + induction u with + | nil => simp [wordWeightCanon, loc_z0W, scaledWeightUpper] + | cons w u ih => + cases w with + | V => + dsimp [wordWeightCanon, loc_z0W, scaledWeightUpper] + have hdiv : scaledWeightUpper u <= 2 * ((scaledWeightUpper u + 1) / 2) := by omega + have hdiv_q : ((scaledWeightUpper u : Nat) : Rat) <= + ((2 * ((scaledWeightUpper u + 1) / 2) : Nat) : Rat) := by exact_mod_cast hdiv + push_cast at hdiv_q + linarith only [ih, hdiv_q] + | K => + dsimp [wordWeightCanon, loc_z0W, scaledWeightUpper]; push_cast; linarith only [ih] + | Q => + dsimp [wordWeightCanon, loc_z0W, scaledWeightUpper]; push_cast; linarith only [ih] + +def natOfDigitWords : WordList -> Nat + | [] => 0 + | V :: u => natOfDigitWords u + | K :: u => 1 + 2 * natOfDigitWords u + | Q :: u => 2 * natOfDigitWords u + +theorem wordMassK_eq_natOfDigitWords (u : WordList) (h : u.all isDigitWord = true) : + wordMassK u = ((natOfDigitWords u : Nat) : Rat) := by + induction u with + | nil => simp [wordMassK, natOfDigitWords] + | cons w u ih => + cases w with + | V => contradiction + | K => + dsimp [List.all, isDigitWord] at h + dsimp [wordMassK, natOfDigitWords]; rw [ih h]; push_cast; ring + | Q => + dsimp [List.all, isDigitWord] at h + dsimp [wordMassK, natOfDigitWords]; rw [ih h]; push_cast; ring + +def endsWithV : WordList -> Bool + | [] => false + | [x] => x == V + | _ :: y :: ys => endsWithV (y :: ys) + +theorem endsWithV_eq (u : WordList) (h : endsWithV u = true) : ∃ w, u = w ++ [V] := by + induction u with + | nil => contradiction + | cons x u ih => + cases u with + | nil => + cases x <;> try contradiction + exact ⟨[], rfl⟩ + | cons y ys => + change endsWithV (y :: ys) = true at h + rcases ih h with ⟨w, hw⟩ + exact ⟨x :: w, by rw [hw]; rfl⟩ + +def startsWithVVAndEndsWithV : WordList -> Bool + | V :: V :: u => endsWithV u + | _ => false + +theorem startsWithVVAndEndsWithV_eq (u : WordList) (h : startsWithVVAndEndsWithV u = true) : ∃ w, + u = V :: V :: (w ++ [V]) := by + rcases u with _ | ⟨_ | _ | _, _ | ⟨_ | _ | _, u'⟩⟩ <;> try contradiction + change endsWithV u' = true at h + rcases endsWithV_eq u' h with ⟨w, hw⟩ + exact ⟨w, by rw [hw]⟩ + +def startsWithQK : WordList -> Bool + | Q :: K :: _ => true + | _ => false + +theorem startsWithQK_eq (u v : WordList) (h : startsWithQK u = true) : ∃ w, + u ++ v = Q :: K :: w := by + rcases u with _ | ⟨_ | _ | _, _ | ⟨_ | _ | _, u'⟩⟩ <;> try contradiction + exact ⟨u' ++ v, rfl⟩ + +theorem bGood_of_check (u hi_low hi_top : WordList) + (hD_low : hi_low.all isDigitWord = true) + (hD_top : hi_top.all isDigitWord = true) + (hTopLen : hi_top.length = 16) + (hPow : pairWordCount u + (hi_low.length + 16) = 7 + vWordCount u) + (hU11_nat : 4 + pairWordCount u <= vWordCount u) + (hEnd : startsWithVVAndEndsWithV u = true) + (hLu : startsWithQKOrQQ u = true) + (hLo : startsWithQK hi_low = true) + (hW_nat : scaledWeightUpper u <= 969932) + (hZ_nat : 10 * (1 + natOfDigitWords hi_top) <= 651776) : + BGood (u ++ ((hi_low ++ hi_top) ++ tail8Words)) := by + let hi8 := hi_low ++ hi_top + have hD : hi8.all isDigitWord = true := by dsimp [hi8]; rw [List.all_append, hD_low, hD_top]; rfl + rcases exists_digitVal_of_all_isDigitWord hi8 hD with ⟨A, hI⟩ + have hLen : hi8.length = hi_low.length + 16 := by dsimp [hi8]; rw [List.length_append, hTopLen] + have h11_u := wordScale_mul_pow_vWordCount u + have hPow2 : 2 ^ pairWordCount u * 2 ^ hi8.length = 128 * 2 ^ vWordCount u := by + rw [<- Nat.pow_add, hLen, hPow, Nat.pow_add] + have hPow2_q : ((2 ^ pairWordCount u : Nat) : Rat) * ((2 ^ hi8.length : Nat) : Rat) = + 128 * ((2 ^ vWordCount u : Nat) : Rat) := by + exact_mod_cast hPow2 + have hPos : 0 < ((2 ^ vWordCount u : Nat) : Rat) := by exact_mod_cast pow_two_pos (vWordCount u) + have hHeight : wordScale u * ((2 ^ hi8.length : Nat) : Rat) = 128 := by + nlinarith only [h11_u, hPow2_q, hPos] + have hLe2 : 16 * 2 ^ pairWordCount u <= 2 ^ vWordCount u := by + have := Nat.pow_le_pow_right (by decide : 0 < 2) hU11_nat + rw [Nat.pow_add] at this; omega + have hLe2_q : 16 * ((2 ^ pairWordCount u : Nat) : Rat) <= ((2 ^ vWordCount u : Nat) : Rat) := by + exact_mod_cast hLe2 + have hU11 : wordScale u <= 1 / 16 := by + nlinarith only [h11_u, hLe2_q, hPos] + have hW_q : ((scaledWeightUpper u : Nat) : Rat) <= 969932 := by exact_mod_cast hW_nat + have hW_ge := scaledWeightUpper_ge u + have hW : wordWeightCanon u <= 74 / 5 := by linarith only [hW_q, hW_ge] + rcases exists_digitVal_of_all_isDigitWord hi_low hD_low with ⟨A_low, hI_low⟩ + rcases exists_digitVal_of_all_isDigitWord hi_top hD_top with ⟨A_top, hI_top⟩ + have hDw_low := digitVal_scale_and_mass hI_low + have hDw_top := digitVal_scale_and_mass hI_top + have hZ_low_le : wordMassK hi_low <= wordScale hi_low := by + have h1 := wordMass_eq_add hi_low + have h2 : 0 <= wordMassQ hi_low := by rw [hDw_low.2.2]; exact Nat.cast_nonneg A_low + linarith only [h1, h2, hDw_low.1, hDw_low.2.1] + have h11_top : wordScale hi_top = 65536 := by + have h1 := hDw_top.1; rw [hTopLen] at h1 + have h2 : ((2 ^ 16 : Nat) : Rat) = 65536 := by norm_num + linarith only [h1, h2] + have h11_hi8 : wordScale hi8 = ((2 ^ hi8.length : Nat) : Rat) := (digitVal_scale_and_mass hI).1 + have h11_split : wordScale hi8 = wordScale hi_low * wordScale hi_top := by + dsimp [hi8] + exact wordScale_append hi_low hi_top + have h_u_low : wordScale u * wordScale hi_low = 1 / 512 := by + have h_eq : wordScale u * ((2 ^ hi8.length : Nat) : Rat) = + 65536 * (wordScale u * wordScale hi_low) := by + rw [<- h11_hi8, h11_split, h11_top]; ring + linarith only [hHeight, h_eq] + have hZ_split : wordMassK hi8 = wordMassK hi_low + wordScale hi_low * wordMassK hi_top := by + dsimp [hi8]; exact wordMassK_append hi_low hi_top + have hZ_top_eq := wordMassK_eq_natOfDigitWords hi_top hD_top + have hZ_top_q : 10 * (1 + ((natOfDigitWords hi_top : Nat) : Rat)) <= 651776 := by + exact_mod_cast hZ_nat + have hSu := wordScale_pos u + have hZ : wordScale u * wordMassK hi8 <= 1273 / 10 := by + have h_uz_split : wordScale u * wordMassK hi8 = + wordScale u * wordMassK hi_low + (wordScale u * wordScale hi_low) * wordMassK hi_top := by + rw [hZ_split]; ring + have h_uz_low : wordScale u * wordMassK hi_low <= wordScale u * wordScale hi_low := by + nlinarith only [hSu, hZ_low_le] + have h_uz_top : (wordScale u * wordScale hi_low) * wordMassK hi_top = + (1 / 512) * ((natOfDigitWords hi_top : Nat) : Rat) := by + rw [h_u_low, hZ_top_eq] + linarith only [h_uz_split, h_uz_low, h_u_low, h_uz_top, hZ_top_q] + exact BGood.intro hi8.length u A hi8 hI hHeight hU11 + (startsWithVVAndEndsWithV_eq u hEnd) hLu (startsWithQK_eq hi_low hi_top hLo) hW hZ + +theorem seg_ch_odd_d1 (n : Nat) : Seg ([Call.ch] ^ (1 + n * 2)) ([Call.ch] ^ (1 + n)) d1 d0 := by + simpa only [list_pow_one_add_canon, List.cons_append, + List.nil_append] using! seg_append_calls seg_ch_d1 (seg_ch_double_pow seg_ch_two_d0 n) + +def evalChPow : Nat -> WordList -> Option WordList + | 0, u => some u + | _, [] => none + | k + 1, V :: u => + match evalChPow ((k + 1) * 2) u with + | some v => some (V :: v) + | none => none + | k + 1, K :: u => + let m := (k + 1) / 2 + if k + 1 == m * 2 then + match evalChPow m u with + | some v => some (K :: v) + | none => none + else + match evalChPow m u with + | some v => some (Q :: v) + | none => none + | k + 1, Q :: u => + let m := (k + 1) / 2 + if k + 1 == m * 2 then + match evalChPow m u with + | some v => some (Q :: v) + | none => none + else + match evalChPow (1 + m) u with + | some v => some (K :: v) + | none => none + +theorem evalChPow_sound (u : WordList) : + ∀ (k : Nat) (v : WordList), evalChPow k u = some v -> + Side ([Call.ch] ^ k) (evalWords u default) (evalWords v default) := by + induction u with + | nil => + intro k v h + cases k with + | zero => + injection h with h; subst h + exact Side.nil _ + | succ k => contradiction + | cons w u ih => + intro k v h + cases k with + | zero => + injection h with h; subst h + exact Side.nil _ + | succ k => + cases w with + | V => + dsimp [evalChPow] at h + cases hE : evalChPow ((k + 1) * 2) u with + | none => rw [hE] at h; contradiction + | some v' => + rw [hE] at h + injection h with h; subst h + exact side_of_seg (seg_ch_pow_t (k + 1)) (ih _ _ hE) + | K => + dsimp [evalChPow] at h + cases hk : (k + 1 == ((k + 1) / 2) * 2) with + | true => + rw [hk] at h; dsimp at h + cases hE : evalChPow ((k + 1) / 2) u with + | none => rw [hE] at h; contradiction + | some v' => + rw [hE] at h + injection h with h; subst h + have heq : k + 1 = ((k + 1) / 2) * 2 := beq_iff_eq.mp hk + rw [heq] + exact side_of_seg (seg_ch_even_d0 ((k + 1) / 2)) (ih _ _ hE) + | false => + rw [hk] at h; dsimp at h + cases hE : evalChPow ((k + 1) / 2) u with + | none => rw [hE] at h; contradiction + | some v' => + rw [hE] at h + injection h with h; subst h + have hne : k + 1 ≠ ((k + 1) / 2) * 2 := by + intro hc; have := beq_iff_eq.mpr hc; rw [this] at hk; contradiction + have heq : k + 1 = 1 + ((k + 1) / 2) * 2 := by omega + rw [heq] + exact side_of_seg (seg_ch_odd_d0 ((k + 1) / 2)) (ih _ _ hE) + | Q => + dsimp [evalChPow] at h + cases hk : (k + 1 == ((k + 1) / 2) * 2) with + | true => + rw [hk] at h; dsimp at h + cases hE : evalChPow ((k + 1) / 2) u with + | none => rw [hE] at h; contradiction + | some v' => + rw [hE] at h + injection h with h; subst h + have heq : k + 1 = ((k + 1) / 2) * 2 := beq_iff_eq.mp hk + rw [heq] + exact side_of_seg (seg_ch_even_d1 ((k + 1) / 2)) (ih _ _ hE) + | false => + rw [hk] at h; dsimp at h + cases hE : evalChPow (1 + (k + 1) / 2) u with + | none => rw [hE] at h; contradiction + | some v' => + rw [hE] at h + injection h with h; subst h + have hne : k + 1 ≠ ((k + 1) / 2) * 2 := by + intro hc; have := beq_iff_eq.mpr hc; rw [this] at hk; contradiction + have heq : k + 1 = 1 + ((k + 1) / 2) * 2 := by omega + rw [heq] + exact side_of_seg (seg_ch_odd_d1 ((k + 1) / 2)) (ih _ _ hE) + +abbrev w_pre3_rest : BitWord := t ++ t ++ (t ++ d1) + +abbrev w_pre3 : BitWord := w_word ++ w_pre3_rest + +abbrev w_pre5_rest : BitWord := w_pre3_rest ++ t ++ (t ++ d0) + +abbrev w_pre5 : BitWord := w_word ++ w_pre5_rest + +abbrev w_pre_rest : BitWord := w_pre5_rest ++ t ++ (t ++ d0) + +abbrev w_pre : BitWord := w_word ++ w_pre_rest + +theorem seg_word_pre3 : + Seg [.ch, .cj, .ch] ([.ch] ^ 4 ++ [.cp] ++ [.ch] ^ 2) w_pre3_rest + (t ++ t ++ (d0 ++ t)) := by + unfold w_pre3_rest + exact seg_comp_words (seg_comp_words seg_word_s1 seg_word_s2) seg_word_s3 + +theorem seg_word_pre5 : + Seg [.ch, .cj, .ch] ([.ch] ^ 8 ++ [.cj, .ch]) w_pre5_rest + (t ++ t ++ (d0 ++ t) ++ t ++ (d0 ++ t)) := by + unfold w_pre5_rest + exact seg_comp_words (seg_comp_words seg_word_pre3 seg_word_s4) seg_word_s5 + +theorem seg_word_pre : + Seg [.ch, .cj, .ch] ([.ch] ^ 16) w_pre_rest + (t ++ t ++ (d0 ++ t) ++ t ++ (d0 ++ t) ++ t ++ (d1 ++ (t ++ one))) := by + unfold w_pre_rest + exact seg_comp_words (seg_comp_words seg_word_pre5 seg_word_s6) seg_word_s7 + +theorem stepPlus_word_pre3_full {r r' : HalfTape} (h : Side ([.ch] ^ 4 ++ [.cp] ++ + [.ch] ^ 2) r r') : + (cfgLeft lh (w_pre3 +> r)) [canon_tm]⊢⁺ (cfgLeft lh (w_pre5 +> (t +> r'))) := by + have h_side := seg_word_pre3 r r' h + have h_turn := stepPlus_word_turn h_side + have h_in : w_word +> (w_pre3_rest +> r) = w_pre3 +> r := by + unfold w_pre3 w_pre3_rest; simp only [List.append_assoc, append_assoc] + have h_out : (w_word ++ t ++ t ++ (t ++ d1)) +> + ((t ++ t ++ (d0 ++ t)) +> r') = + w_pre5 +> (t +> r') := by + unfold w_pre5 w_pre5_rest w_pre3_rest w_word t d0 d1 + simp only [List.cons_append, List.nil_append, append_cons, append_nil] + rwa [h_in, h_out] at h_turn + +theorem stepPlus_word_pre5_full {r r' : HalfTape} (h : Side ([.ch] ^ 8 ++ [.cj, .ch]) r r') : + (cfgLeft lh (w_pre5 +> r)) [canon_tm]⊢⁺ (cfgLeft lh (w_pre +> (t +> r'))) := by + have h_side := seg_word_pre5 r r' h + have h_turn := stepPlus_word_turn h_side + have h_in : w_word +> (w_pre5_rest +> r) = w_pre5 +> r := by + unfold w_pre5 w_pre5_rest; simp only [List.append_assoc, append_assoc] + have h_out : (w_word ++ t ++ t ++ (t ++ d1)) +> + ((t ++ t ++ (d0 ++ t) ++ t ++ (d0 ++ t)) +> r') = + w_pre +> (t +> r') := by + unfold w_pre w_pre_rest w_pre5_rest w_pre3_rest w_word t d0 d1 + simp only [List.cons_append, List.nil_append, append_cons, append_nil] + rwa [h_in, h_out] at h_turn + +theorem stepPlus_word_pre_full {r r' : HalfTape} (h : Side ([.ch] ^ 16) r r') : + (cfgLeft lh (w_pre +> r)) [canon_tm]⊢⁺ (cfgCanon r') := by + have h_side := seg_word_pre r r' h + have h_turn := stepPlus_word_turn h_side + have h_in : w_word +> (w_pre_rest +> r) = w_pre +> r := by + unfold w_pre w_pre_rest; simp only [List.append_assoc, append_assoc] + have h_out : (w_word ++ t ++ t ++ (t ++ d1)) +> + ((t ++ t ++ (d0 ++ t) ++ t ++ (d0 ++ t) ++ t ++ (d1 ++ (t ++ one))) +> r') = + w_base +> r' := by + unfold w_base w_word w_rest t d0 d1 one + simp only [List.cons_append, List.nil_append, append_cons, append_nil] + unfold cfgCanon + rwa [h_in, h_out] at h_turn + +theorem seg_ch_16_to_31 : + Seg ([.ch] ^ 16) ([.cj] ++ [.ch] ^ 31) (d0 ++ t ++ (t ++ one)) (d0 ++ t ++ t) := by + have h1 : Seg ([.ch] ^ 16) ([.ch] ^ 8) d0 d0 := seg_ch_even_d0 8 + have h2 : Seg ([.ch] ^ 8) ([.ch] ^ 16) t t := seg_ch_pow_t 8 + have h3 : Seg ([.ch] ^ 16) ([.cj] ++ [.ch] ^ 31) (t ++ one) t := by + have ha := seg_append_calls seg_ch_t_one (seg_ch_pow_t 15) + have heq_in : ([Call.ch] : List Call) ++ [Call.ch] ^ 15 = [Call.ch] ^ 16 := rfl + have heq_out : ([Call.cj, + Call.ch] : List Call) ++ [Call.ch] ^ (15 * 2) = [Call.cj] ++ [Call.ch] ^ 31 := rfl + rwa [heq_in, heq_out] at ha + exact seg_comp_words (seg_comp_words h1 h2) h3 + +abbrev canonBMultiStepFast (c : CCfg) (n : Nat) : Option CCfg := Counter.bmultiStep canon_tm n c + +theorem canonBMultiStepFast_sound {c1 c2 : CCfg} {n : Nat} (hn : 0 < + n) (h : canonBMultiStepFast c1 n = some c2) : + (c_to_cfg c1) [canon_tm]⊢⁺ (c_to_cfg c2) := + ⟨n, hn, Counter.bmultiStep_sound n c1 c2 h⟩ + +theorem stepPlus_of_bStep {orig out : WordList} (hS : BStep orig out) : + (cfgCanon (evalWords (prefix33Words ++ + orig) default)) [canon_tm]⊢⁺ (cfgCanon (evalWords (prefix33Words ++ out) default)) := by + rcases exists_brIncs_of_bStep hS with ⟨r, hI, hEq⟩ + rw [hEq] + exact stepPlus_of_brIncs_128 hI + +theorem stepStar_of_canonRounds {r r' : HalfTape} (h : CanonRounds r r') : + (cfgCanon r) [canon_tm]⊢* (cfgCanon r') := by + induction h with + | refl _ => exact ⟨0, rfl⟩ + | next hR _ ih => + rcases stepPlus_of_brIncs_128 hR with ⟨n, _, hn⟩ + rcases ih with ⟨m, hm⟩ + exact ⟨n + m, multiStep_trans_canon canon_tm _ _ _ n m hn hm⟩ + +theorem multiStep_add_Intermediate {M : Machine (Fin 2) (Fin 6)} {c c' : Cfg (Fin 2) (Fin 6)} {j d + : Nat} + (h : multiStep M c (j + d) = some c') : + (multiStep M c j).isSome := by + rw [BusyBeaver.multiStep_add] at h + cases h_j : multiStep M c j with + | none => rw [h_j] at h; contradiction + | some _ => rfl + + +end BusyBeaver.WordCanonBR diff --git a/BusyBeaver/Defs.lean b/BusyBeaver/Defs.lean index e1ad2be0..5715fed2 100644 --- a/BusyBeaver/Defs.lean +++ b/BusyBeaver/Defs.lean @@ -63,11 +63,11 @@ structure Cfg (Γ Λ : Type*) [Inhabited Γ] where instance Cfg.inhabited : Inhabited (Cfg Γ Λ) := ⟨⟨default, default⟩⟩ /-- Configuration in state `q` with the tape head reading the first symbol of `r`. -/ -def Cfg.headRight {Γ Λ : Type*} [Inhabited Γ] (q : Λ) (l r : ListBlank Γ) : Cfg Γ Λ := +@[reducible] def Cfg.headRight {Γ Λ : Type*} [Inhabited Γ] (q : Λ) (l r : ListBlank Γ) : Cfg Γ Λ := ⟨some q, ⟨r.head, l, r.tail⟩⟩ /-- Configuration in state `q` with the tape head reading the first symbol of `l`. -/ -def Cfg.headLeft {Γ Λ : Type*} [Inhabited Γ] (q : Λ) (l r : ListBlank Γ) : Cfg Γ Λ := +@[reducible] def Cfg.headLeft {Γ Λ : Type*} [Inhabited Γ] (q : Λ) (l r : ListBlank Γ) : Cfg Γ Λ := ⟨some q, ⟨l.head, l.tail, r⟩⟩ /-- Single-step execution semantics of a `BusyBeaver.Machine`. -/ @@ -96,6 +96,20 @@ def ReachesStar (M : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) : Prop := def ReachesPlus (M : Machine Γ Λ) (c₁ c₂ : Cfg Γ Λ) : Prop := ∃ n > 0, multiStep M c₁ n = some c₂ +scoped notation3 c₁ " [" M "]⊢ " c₂ => step M c₁ = some c₂ +scoped notation3 c₁ " [" M "]⊢^{" n "} " c₂ => multiStep M c₁ n = some c₂ +scoped notation3 c₁ " [" M "]⊢* " c₂ => ReachesStar M c₁ c₂ +scoped notation3 c₁ " [" M "]⊢⁺ " c₂ => ReachesPlus M c₁ c₂ + +scoped notation l " {{" s "}} " r => (⟨s, l, r⟩ : Tape _) +scoped notation:67 s:67 " << " a:68 => ListBlank.cons a s +scoped infixr:67 " >> " => ListBlank.cons +scoped notation:67 s:67 " <+ " l:68 => ListBlank.append l s +scoped infixr:67 " +> " => ListBlank.append +scoped notation3 l " {{" q "}}> " r => (⟨some q, ⟨ListBlank.head r, l, ListBlank.tail r⟩⟩ : Cfg _ _) +scoped notation3 l " <{{" q "}} " r => (⟨some q, ⟨ListBlank.head l, ListBlank.tail l, r⟩⟩ : Cfg _ _) + + /-- Repeat finite list `l` `n` times (`l ^ n`). -/ instance instHPowListNat : HPow (List Γ) ℕ (List Γ) := ⟨fun l n => (List.replicate n l).flatten⟩ @@ -682,4 +696,7 @@ def HasTransducerReduction {k : ℕ} {Λ : Type*} [Inhabited Λ] (evalTransducerCfg m_rl L (List.replicate (s₃ * (n + 1)) tR' ++ R)) (evalTransducerCfg m_rl (List.replicate (s₄ * (n + 1)) tL' ++ L) R))) + + + end BusyBeaver diff --git a/BusyBeaver/README.md b/BusyBeaver/README.md index 0ef6dee3..13e7fa3b 100644 --- a/BusyBeaver/README.md +++ b/BusyBeaver/README.md @@ -2,7 +2,7 @@ This library contains formal Lean 4 specifications and kernel-verified behavioral proofs for Busy Beaver 6 (`BB(6)`) and Busy Beaver (3, 3) (`BB(3, 3)`) holdouts, connected to `ConjectureMachines.Machine` via [`BusyBeaver/Bridge.lean`](./Bridge.lean): -- **[`BusyBeaver/BB6/`](./BB6/README.md)** — 89 `BB(6)` (6-state, 2-symbol) holdout Turing machines: 54 holdouts in `BB6/` (the [A6 nonhalting certificate](../artifacts/a6/README.md) and 53 holdouts with certified closed `TapePatternSet` invariants `IsClosedPatternSet`, `HasCollatzReduction` and Collatz-like accelerations `IsValidAcceleration`), plus 35 stacked, odometer, and transducer holdouts (15 machines formalized under `HasStackReduction`, `HasOdometerReduction`, and `HasTransducerReduction`—12 `bbchallenge` Wiki machines and 3 Halving Tower holdouts—and 20 open acceleration problems under `IsValidAcceleration`, 13 of which additionally carry higher-level Poincaré/contraction accelerations `highLevelNext`) in **[`BusyBeaver/BB6/Accelerations/`](./BB6/Accelerations/README.md)**, together with machine-level halting equivalences ([`Equivalences.lean`](./BB6/Equivalences.lean)), hardness classification ([`Hardness.lean`](./BB6/Hardness.lean)), and formal hardness evidence ([`HardnessEvidence.lean`](./BB6/HardnessEvidence.lean)). +- **[`BusyBeaver/BB6/`](./BB6/README.md)** — 269 `BB(6)` (6-state, 2-symbol) Turing machines: 54 holdouts in `BB6/` (the [A6 nonhalting certificate](../artifacts/a6/README.md) and 53 holdouts with certified closed `TapePatternSet` invariants `IsClosedPatternSet`, `HasCollatzReduction` and Collatz-like accelerations `IsValidAcceleration`, including a self-contained, Baker-free 2-adic Laurent-determinant `IsNotHalt` proof for `1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RB---`), plus 35 stacked, odometer, and transducer holdouts (15 machines formalized under `HasStackReduction`, `HasOdometerReduction`, and `HasTransducerReduction`—12 `bbchallenge` Wiki machines and 3 Halving Tower holdouts—and 20 open acceleration problems under `IsValidAcceleration`, 13 of which additionally carry higher-level Poincaré/contraction accelerations `highLevelNext`) in **[`BusyBeaver/BB6/Accelerations/`](./BB6/Accelerations/README.md)**, together with machine-level halting equivalences ([`Equivalences.lean`](./BB6/Equivalences.lean)), hardness classification ([`Hardness.lean`](./BB6/Hardness.lean)), and formal hardness evidence ([`HardnessEvidence.lean`](./BB6/HardnessEvidence.lean)), alongside 180 resolved holdouts in **[`BusyBeaver/BB6/Halt/`](./BB6/Halt/)** (31 `IsHalt` proofs) and **[`BusyBeaver/BB6/NonHalt/`](./BB6/NonHalt/)** (149 `IsNotHalt` proofs) reproducing community and `busycoq` results. - **[`BusyBeaver/BB33/`](./BB33/README.md)** — All 6 remaining unsolved `BB(3, 3)` (3-state, 3-symbol) holdout Turing machines (4 equivalence classes: *Bigfoot* (holdout #829), the *Wily Coyote* pair (holdouts #531 & #532), the holdout #758 / #153 pair (probvious champion), and holdout #397), with certified Collatz-like (`HasCollatzReduction`) or stacked Collatz-like (`HasStackedCollatzReduction`) reductions and exact halting equivalences (`IsValidAcceleration`). ## Cryptids, Collatz-like, and Stacked Collatz Reductions diff --git a/BusyBeaverChallenge.lean b/BusyBeaverChallenge.lean index 0d1b5edf..52915159 100644 --- a/BusyBeaverChallenge.lean +++ b/BusyBeaverChallenge.lean @@ -44,7 +44,8 @@ private def parseRleBlock (block : String) : TermElabM (TSyntax `term) := do let wChar := chars[3 * i]! let dChar := chars[3 * i + 1]! let sChar := chars[3 * i + 2]! - if wChar == '-' && dChar == '-' && sChar == '-' then + if (wChar == '-' && dChar == '-' && sChar == '-') || + (wChar == 'H' && dChar == 'H' && sChar == 'H') then cellStxs := cellStxs.push (← `(none)) else if !wChar.isDigit then @@ -782,71 +783,56 @@ open Turing SixState namespace M_1RB0LB_1LC0RE_1LA1LD_0LCHHH_0RB0RF_1RE1RB def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LB_1LC0RE_1LA1LD_0LC---_0RB0RF_1RE1RB" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def cfg_S0z (a c : ℕ) : Cfg (Fin 2) (Fin 6) := ((Cfg.headRight B (ListBlank.append [0] ((ListBlank.append (([1, 0] : List (Fin 2))^(c)) ((ListBlank.append [0, 1] default))))) (ListBlank.append [1, 0, 1] ((ListBlank.append (([0, 1] : List (Fin 2))^(a)) ((ListBlank.append [1] default))))))) - def cfg_S0p (a b c : ℕ) : Cfg (Fin 2) (Fin 6) := ((Cfg.headRight B (ListBlank.append (([0] : List (Fin 2))^(b)) ((ListBlank.append [1, 0] ((ListBlank.append (([1, 0] : List (Fin 2))^(c)) ((ListBlank.append [0, 1] default))))))) (ListBlank.append [0, 0, 1] ((ListBlank.append (([0, 1] : List (Fin 2))^(a)) ((ListBlank.append [1] default))))))) - def cfg_T1 (j m : ℕ) : Cfg (Fin 2) (Fin 6) := ((Cfg.headRight F (ListBlank.append [0] ((ListBlank.append (([1, 0] : List (Fin 2))^(j)) ((ListBlank.append [1, 0, 0, 1] ((ListBlank.append (([0] : List (Fin 2))^(m)) ((ListBlank.append [1] default))))))))) (ListBlank.append [1] default))) - def cfg_T0 (j m : ℕ) : Cfg (Fin 2) (Fin 6) := ((Cfg.headRight F (ListBlank.append [0] ((ListBlank.append (([1, 0] : List (Fin 2))^(j)) ((ListBlank.append [1, 0, 0, 1] ((ListBlank.append (([0] : List (Fin 2))^(m)) ((ListBlank.append [1, 1] default))))))))) (ListBlank.append [1] default))) - def cfg_T11 (j m : ℕ) : Cfg (Fin 2) (Fin 6) := ((Cfg.headRight F (ListBlank.append [0] ((ListBlank.append (([1, 0] : List (Fin 2))^(j)) ((ListBlank.append [1, 0, 0, 1] ((ListBlank.append (([0] : List (Fin 2))^(m)) ((ListBlank.append [1, 0, 1] default))))))))) (ListBlank.append [1] default))) - def cfg_T3 (j m : ℕ) : Cfg (Fin 2) (Fin 6) := ((Cfg.headRight F (ListBlank.append [0] ((ListBlank.append (([1, 0] : List (Fin 2))^(j)) ((ListBlank.append [1, 0, 0, 1] ((ListBlank.append (([0] : List (Fin 2))^(m)) ((ListBlank.append [1, 0, 0, 0, 1] default))))))))) (ListBlank.append [1] default))) - def cfg_T10 (j m : ℕ) : Cfg (Fin 2) (Fin 6) := ((Cfg.headRight F (ListBlank.append [0] ((ListBlank.append (([1, 0] : List (Fin 2))^(j)) ((ListBlank.append [1, 0, 0, 1] ((ListBlank.append (([0] : List (Fin 2))^(m)) ((ListBlank.append [1, 0, 1, 1] default))))))))) (ListBlank.append [1] default))) - def cfg_Tn (j : ℕ) : Cfg (Fin 2) (Fin 6) := ((Cfg.headRight F (ListBlank.append [0] ((ListBlank.append (([1, 0] : List (Fin 2))^(j)) ((ListBlank.append [1, 0, 0, 1] default))))) (ListBlank.append [1] default))) - def cfg_Ea (n : ℕ) : Cfg (Fin 2) (Fin 6) := ((Cfg.headRight B (ListBlank.append [1, 0, 0, 0, 0, 1, 0] ((ListBlank.append (([1, 0] : List (Fin 2))^(n)) ((ListBlank.append [1, 0, 0, 0, 1, 0, 1] default))))) (ListBlank.append [1] default))) - def cfg_Eb (k t : ℕ) : Cfg (Fin 2) (Fin 6) := ((Cfg.headRight B (ListBlank.append [1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1] ((ListBlank.append (([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1] : List (Fin 2))^(k)) ((ListBlank.append (([0] : List (Fin 2))^(t)) ((ListBlank.append [1, 1, 0, 1] default))))))) (ListBlank.append [1] default))) - def cfg_Ec (n : ℕ) : Cfg (Fin 2) (Fin 6) := ((Cfg.headRight B (ListBlank.append [1, 0, 0, 0, 0, 1, 0] ((ListBlank.append (([1, 0] : List (Fin 2))^(n)) ((ListBlank.append [1] default))))) (ListBlank.append [1] default))) - def cfg_Ed (k t : ℕ) : Cfg (Fin 2) (Fin 6) := ((Cfg.headRight B (ListBlank.append [1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1] ((ListBlank.append (([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1] : List (Fin 2))^(k)) ((ListBlank.append (([0] : List (Fin 2))^(t)) ((ListBlank.append [1] default))))))) (ListBlank.append [1] default))) - def pat_B : TapePattern (Fin 2) (Fin 6) := { left := .rep [0] 2 (.rep [1, 0] 0 (.rep [1, 0] 3 (.rep [0, 1] 0 (.rep [1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1] @@ -855,26 +841,21 @@ def pat_B : TapePattern (Fin 2) (Fin 6) := (.rep [0] 5 (.rep [1, 1, 0] 6 (.rep [1] 1 .default)))))))) head := some B right := .rep [0, 0, 1] 0 (.sym 1 .default) } - def cond_B : VarCond := .or (.and (.ge_const 0 1) (.and (.not (.ge_const 0 2)) (.and (.not (.ge_const 1 1)) (.and (.not (.ge_const 4 1)) (.and (.not (.ge_const 5 1)) (.not (.ge_const 6 1))))))) (.and (.not (.ge_const 0 1)) (.and (.ge_const 1 1) (.and (.not (.ge_const 1 2)) (.and (.not (.ge_const 2 1)) (.and (.not (.ge_const 3 1)) (.not (.ge_const 6 2))))))) - def pat_F : TapePattern (Fin 2) (Fin 6) := { left := .sym 0 (.rep [1, 0] 1 (.sym 1 (.sym 0 (.sym 0 (.sym 1 (.rep [0] 2 (.rep [1] 0 .default))))))) head := some F right := .sym 1 .default } - def cond_F : VarCond := .or (.and (.ge_const 0 1) (.and (.not (.ge_const 0 2)) (.not (.ge_const 1 1)))) (.and (.not (.ge_const 0 1)) (.not (.ge_const 2 1))) - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_B, cond_B), (pat_F, cond_F)] - inductive State where | S0z (a c : ℕ) | S0p (a b c : ℕ) @@ -889,9 +870,7 @@ inductive State where | Ec (n : ℕ) | Ed (k t : ℕ) deriving DecidableEq, Repr - def start : State := .T1 0 1 - def encode : State → Cfg (Fin 2) (Fin 6) | .S0z a c => cfg_S0z a c | .S0p a b c => cfg_S0p a b c @@ -905,7 +884,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) | .Eb k t => cfg_Eb k t | .Ec n => cfg_Ec n | .Ed k t => cfg_Ed k t - def next : State → Option State | .S0z a 0 => some (.T1 0 (2 * a + 3)) | .S0z a (c + 1) => some (.S0p 0 (2 * a + 4) c) @@ -938,12 +916,10 @@ def next : State → Option State | .Eb k t => some (.Eb (k + 1) t) | .Ec n => some (.Ed 0 (2 * n + 1)) | .Ed k t => some (.Ed (k + 1) t) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | S (b c : ℕ) | T (m : ℕ) @@ -951,19 +927,15 @@ inductive HighLevelState where | Eb (k t : ℕ) | Ed (k t : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .T 1 - def toState : HighLevelState → State | .S b c => .S0p 0 b c | .T m => .T1 0 m | .Tn j => .Tn j | .Eb k t => .Eb k t | .Ed k t => .Ed k t - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def highLevelNext : HighLevelState → Option HighLevelState | .S b c => let a := 2 * (b / 3) @@ -998,46 +970,33 @@ def highLevelNext : HighLevelState → Option HighLevelState | .Tn j => some (.Tn (j + 2)) | .Eb k t => some (.Eb (k + 1) t) | .Ed k t => some (.Ed (k + 1) t) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry - end M_1RB0LB_1LC0RE_1LA1LD_0LCHHH_0RB0RF_1RE1RB - namespace M_1RB0LC_0LC0RF_1RD1LC_0RA1LE_HHH0LD_1LF1LA def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LC_0LC0RF_1RD1LC_0RA1LE_---0LD_1LF1LA" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_H : TapePattern (Fin 2) (Fin 6) := { left := .rep [1] 0 .default head := some A right := .rep [1] 1 (.rep [0, 1] 2 .default) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_H, .true)] - inductive State where /-- $H(a, b, c) := 0^\infty\,1^a\,\mathrm{A}{>}\,1^b\,(01)^c\,0^\infty$. -/ | H (a b c : ℕ) - def start : State := .H 0 0 1 - def encode : State → Cfg (Fin 2) (Fin 6) | .H a b c => Cfg.headRight SixState.A (ListBlank.append (([1] : List (Fin 2)) ^ a) default) (ListBlank.append (([1] : List (Fin 2)) ^ b) (ListBlank.append (([0, 1] : List (Fin 2)) ^ c) default)) - def next : State → Option State | .H 0 b 0 => if b % 2 = 0 then some (.H 0 0 (b / 2 + 1)) else none | .H 0 b 1 => some (.H (b + 2) 0 1) @@ -1051,33 +1010,26 @@ def next : State → Option State | .H (a + 1) 2 c => some (.H a 0 (c + 2)) | .H 1 (m + 3) c => some (.H (m + 4) 0 (c + 1)) | .H (a + 2) (m + 3) c => some (.H a (m + 6) c) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB0LC_0LC0RF_1RD1LC_0RA1LE_HHH0LD_1LF1LA - namespace M_1RB0LC_0LC1RF_1LE1RD_0RC1RC_0LA1LA_HHH1RA def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LC_0LC1RF_1LE1RD_0RC1RC_0LA1LA_---1RA" abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB - def ps : TapePatternSet (Fin 2) (Fin 6) := [({ left := .rep [1] 0 .default head := some SixState.A right := .sym 0 (.rep [1, 1] 1 (.sym 0 (.rep [1] 2 .default))) }, .true)] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry - inductive State where | E (a k c : ℕ) | M_1 (a k d : ℕ) | M_0 (n z : ℕ) - def start : State := .E 3 0 2 - def encode : State → Cfg (Fin 2) (Fin 6) | .E a k c => Cfg.headRight SixState.A @@ -1095,7 +1047,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append [0] (ListBlank.append [1] (ListBlank.append (([1] : List (Fin 2)) ^ n) default))) (ListBlank.append (([1] : List (Fin 2)) ^ z) default) - def next : State → Option State | .E a 0 c => some (.M_0 a c) | .E a 1 c => @@ -1119,21 +1070,16 @@ def next : State → Option State else if n % 2 = 0 then some (.E 3 (n / 2 + 1) (d - 1)) else some (.E 4 (n / 2 + 2) (d - 1)) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry inductive HighLevelState where | E (p : Bool) (k c : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .E false 0 2 - def toState : HighLevelState → State | .E p k c => .E (if p then 4 else 3) k c - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def highLevelNext : HighLevelState → Option HighLevelState | .E p k c => if c % 2 = 1 then @@ -1151,24 +1097,17 @@ def highLevelNext : HighLevelState → Option HighLevelState some (.E (!p) 3 (c - 2)) else some (.E p (3 * k + (if p then 2 else 1)) (c - 2 * k - 1)) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB0LC_0LC1RF_1LE1RD_0RC1RC_0LA1LA_HHH1RA - namespace M_1RB0LC_1LC0RD_1LF1LA_1LB1RE_1RB1LE_HHH0LE def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LC_1LC0RD_1LF1LA_1LB1RE_1RB1LE_---0LE" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_C : TapePattern (Fin 2) (Fin 6) := { left := .sym 1 (.rep [1] 0 .default) head := some C @@ -1177,17 +1116,13 @@ def pat_C : TapePattern (Fin 2) (Fin 6) := (.sym 1 (.sym 1 (.sym 1 (.rep [0, 1, 1, 1, 1] 3 (.sym 0 (.sym 1 (.sym 1 .default)))))))))))))) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_C, .true)] - inductive State where /-- $C(a, f, g, d) := 0^\infty\,1^{a+1}\,\mathrm{C}{>}\,00\,1^{f+4}\,(01)^g\,1^3\,(01111)^d\,011\,0^\infty$. -/ | C (a f g d : ℕ) - def start : State := .C 2 0 0 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .C a f g d => Cfg.headRight SixState.C @@ -1198,7 +1133,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append (([1] : List (Fin 2)) ^ 3) (ListBlank.append (([0, 1, 1, 1, 1] : List (Fin 2)) ^ d) (ListBlank.append [0, 1, 1] default)))))) - def next : State → Option State | .C 0 f 0 d => if f % 2 = 0 then some (.C 2 0 (f / 2 + 2) d) @@ -1216,28 +1150,22 @@ def next : State → Option State else some (.C 0 0 (f / 2 + 2) (d + 1)) | .C 1 f (g + 2) d => some (.C (f + 4) 3 g d) | .C (a + 2) f g d => some (.C a (f + 3) g d) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | C0 (g d : ℕ) | C2 (g d : ℕ) | C5 (g d : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .C2 0 0 - def toState : HighLevelState → State | .C0 g d => .C 0 0 g d | .C2 g d => .C 2 0 g d | .C5 g d => .C 5 0 g d - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def scanG (r : Bool) (f g d : ℕ) : Option HighLevelState := if g = 0 then if !r then @@ -1259,56 +1187,43 @@ def scanG (r : Bool) (f g d : ℕ) : Option HighLevelState := scanG (decide (s % 2 = 1)) (3 * (s / 2) + 3) (g - 2) d termination_by g decreasing_by omega - def highLevelNext : HighLevelState → Option HighLevelState | .C0 g d => scanG false 0 g d | .C2 g d => scanG false 3 g d | .C5 g d => scanG true 6 g d - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry - end M_1RB0LC_1LC0RD_1LF1LA_1LB1RE_1RB1LE_HHH0LE - namespace M_1RB0LD_0RC1RB_0RD0RA_1LE0RD_1LFHHH_0LA1LA def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LD_0RC1RB_0RD0RA_1LE0RD_1LF---_0LA1LA" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_P : TapePattern (Fin 2) (Fin 6) := { left := .rep [0] 0 (.sym 1 (.sym 1 (.sym 1 (.sym 1 .default)))) head := some F right := .rep [1, 1, 1] 1 (.sym 0 (.rep [1] 2 (.sym 0 (.sym 1 (.sym 1 .default))))) } - def pat_Q : TapePattern (Fin 2) (Fin 6) := { left := .default head := some F right := .rep [1, 1, 1] 0 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 0 (.sym 1 (.sym 1 .default)))))))))))) } - def pat_R : TapePattern (Fin 2) (Fin 6) := { left := .default head := some F right := .rep [1, 1, 1] 0 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 .default)))))))))))) } - def pat_U : TapePattern (Fin 2) (Fin 6) := { left := .sym 1 (.sym 1 (.sym 1 (.sym 1 .default))) head := some F right := .rep [1, 1, 1] 0 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 0 (.sym 1 (.sym 1 .default)))))))))))) } - def pat_T : TapePattern (Fin 2) (Fin 6) := { left := .rep [0, 0, 0] 0 (.sym 0 (.sym 0 (.sym 0 (.sym 0 (.sym 0 (.sym 0 @@ -1316,16 +1231,12 @@ def pat_T : TapePattern (Fin 2) (Fin 6) := (.sym 1 (.sym 1 (.sym 1 (.sym 1 .default)))))))))))))))) head := some F right := .sym 0 (.sym 1 (.sym 1 (.sym 1 (.sym 1 .default)))) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_P, .true), (pat_Q, .true), (pat_R, .true), (pat_U, .true), (pat_T, .true)] - inductive State where /-- $P(b, k, c) := 0^\infty\,1111\,0^b\,\mathrm{F}{>}\,(111)^k\,0\,1^c\,011\,0^\infty$. -/ | P (b k c : ℕ) - def start : State := .P 4 0 11 - def encode : State → Cfg (Fin 2) (Fin 6) | .P b k c => Cfg.headRight SixState.F @@ -1335,7 +1246,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append [0] (ListBlank.append (([1] : List (Fin 2)) ^ c) (ListBlank.append [0, 1, 1] default)))) - def next : State → Option State | .P 0 k c => some (.P (3 * k + 3) 0 (c + 2)) | .P 1 k 0 => if k = 2 then some (.P 7 2 18) else none @@ -1344,34 +1254,25 @@ def next : State → Option State | .P (b + 2) k 0 => some (.P b 0 (3 * k + 5)) | .P (b + 2) k 1 => some (.P b 0 (3 * k + 8)) | .P (b + 2) k (c + 2) => some (.P (b + 1) (k + 1) c) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB0LD_0RC1RB_0RD0RA_1LE0RD_1LFHHH_0LA1LA - namespace M_1RB0LD_1LC0RA_1RA1LB_1LA1LE_1RF0LC_HHH0RE def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LD_1LC0RA_1RA1LB_1LA1LE_1RF0LC_---0RE" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_A2 : TapePattern (Fin 2) (Fin 6) := { left := .sym 0 (.sym 1 (.rep [0, 1] 0 (.sym 1 (.sym 1 (.rep [0, 1] 1 .default))))) head := some A right := .sym 1 (.rep [1] 2 .default) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_A2, .true)] - inductive State where /-- $A_2(a, b, c) := 0^\infty\,(10)^b\,11\,(10)^{a+1}\,\mathrm{A}{>}\,1^{c+1}\,0^\infty$. -/ | A2 (a b c : ℕ) - def start : State := .A2 0 1 6 - def encode : State → Cfg (Fin 2) (Fin 6) | .A2 a b c => Cfg.headRight A @@ -1380,7 +1281,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.cons 1 (ListBlank.cons 1 (ListBlank.append (([0, 1] : List (Fin 2)) ^ b) default)))))) (ListBlank.cons 1 (ListBlank.append (([1] : List (Fin 2)) ^ c) default)) - def next : State → Option State | .A2 0 b 0 => some (.A2 0 1 (2 * b + 10)) | .A2 (a + 1) b 0 => some (.A2 a b 1) @@ -1391,20 +1291,15 @@ def next : State → Option State | .A2 a 0 5 => some (.A2 0 1 (2 * a + 16)) | .A2 a 0 (c + 6) => some (.A2 0 (a + 4) c) | .A2 a (b + 1) (c + 2) => some (.A2 (a + 2) b c) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB0LD_1LC0RA_1RA1LB_1LA1LE_1RF0LC_HHH0RE - namespace M_1RB0LD_1LC1RA_1RA1LC_1LE1LA_0RF1LD_HHH1RE def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LD_1LC1RA_1RA1LC_1LE1LA_0RF1LD_---1RE" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def ps : TapePatternSet (Fin 2) (Fin 6) := [ -- 1. h = 0 (⟨.rep [1] 1 (.rep [1, 0] 0 .default), some SixState.A, .rep [1] 2 .default⟩, @@ -1422,31 +1317,23 @@ def ps : TapePatternSet (Fin 2) (Fin 6) := [ (⟨.rep [1, 1] 1 (.rep [1, 0] 0 .default), some SixState.A, .rep [1] 2 .default⟩, .and (.ge_const 1 1) (.and (.ge_const 2 1) (.not (.ge_const 2 2)))) ] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry - theorem has_collatz_reduction : HasCollatzReduction target := by sorry - /-! ### Level B: accelerated state machine -/ - def Config_gen (a g h : Nat) : Cfg (Fin 2) (Fin 6) := let left := ListBlank.append (([1] : List (Fin 2)) ^ g) (ListBlank.append (([1, 0] : List (Fin 2)) ^ a) default) let right := ListBlank.append (([1] : List (Fin 2)) ^ h) default ⟨some A, ⟨right.head, left, right.tail⟩⟩ - def S (k : Nat) : Nat := 2^(k+1) - k - 1 - def find_k_fuel (a : Nat) (fuel : Nat) (k : Nat) : Nat := Nat.rec (motive := fun _ => Nat → Nat) (fun k => k) (fun _ ih k => if a < S (k+1) then k else ih (k+1)) fuel k - def find_k (a : Nat) : Nat := find_k_fuel a a 0 - def a_new (a g : Nat) : Nat := let j := find_k a let k_g := (g - 1) / 2 @@ -1454,28 +1341,23 @@ def a_new (a g : Nat) : Nat := 2^(j+1) + k_g else S (j+1) - 1 - a - inductive State where | H0 (a g : ℕ) | H3 (a g h : ℕ) | H2_even (a k : ℕ) | H2_odd0 (k : ℕ) | H1_even (a k : ℕ) - def start : State := .H2_odd0 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .H0 a g => Config_gen a (g + 1) 0 | .H3 a g h => Config_gen a (g + 1) (h + 3) | .H2_even a k => Config_gen a (2 * (k + 1)) 2 | .H2_odd0 k => Config_gen 0 (2 * k + 1) 2 | .H1_even a k => Config_gen a (2 * (k + 1)) 1 - def classifyEven (a k h : ℕ) : State := Nat.casesOn h (.H1_even a k) fun h => Nat.casesOn h (.H2_even a k) fun h' => .H3 a (2 * k + 1) h' - def next : State → Option State | .H0 0 g => some (.H3 0 0 g) | .H0 (a + 1) g => some (.H3 a 0 (g + 1)) @@ -1499,23 +1381,16 @@ def next : State → Option State | .H1_even 0 0 => none | .H1_even (a + 1) 0 => some (.H0 a 3) | .H1_even a (k + 1) => some (.H2_even a k) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | H (a g : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .H 0 3 - def toState : HighLevelState → State | .H a g => .H0 a g - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def drainEven (a k h : ℕ) : Option HighLevelState := if h = 0 then if a = 0 then none else some (.H (a - 1) (2 * k + 3)) @@ -1527,7 +1402,6 @@ def drainEven (a k h : ℕ) : Option HighLevelState := drainEven (a - 1) (k + 2) (h - 2) termination_by h decreasing_by all_goals omega - def highLevelNext : HighLevelState → Option HighLevelState | .H a g => if a = 0 then @@ -1541,40 +1415,28 @@ def highLevelNext : HighLevelState → Option HighLevelState let a_n := a_new a0 1 let k_n := if a0 = S (find_k a0) then 1 else a0 + find_k a0 + 2 - a_n drainEven a_n (k_n - 1) (g + 1) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry - end M_1RB0LD_1LC1RA_1RA1LC_1LE1LA_0RF1LD_HHH1RE - namespace M_1RB0LD_1RC1RA_1LD0RB_1LE1LA_1RF0RC_HHH1RE def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LD_1RC1RA_1LD0RB_1LE1LA_1RF0RC_---1RE" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_A : TapePattern (Fin 2) (Fin 6) := { left := .sym 1 (.sym 1 (.rep [1, 1] 2 (.sym 0 (.rep [1, 0] 1 (.sym 0 (.rep [1] 0 .default)))))) head := some B right := .default } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_A, .true)] - inductive State where /-- $A(a, b, c) := 0^\infty\,1^a\,0\,(10)^b\,0\,(11)^{c+1}\,\mathrm{B}{>}\,0^\infty$. -/ | A (a b c : ℕ) - def start : State := .A 3 0 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .A a b c => Cfg.headRight SixState.B @@ -1584,27 +1446,21 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.cons 0 (ListBlank.append (([1] : List (Fin 2)) ^ a) default))))) default - def next : State → Option State | .A 0 0 _ => none | .A (a + 1) 0 c => some (.A a c 2) | .A 0 1 c => some (.A (2 * c + 9) 0 0) | .A (a + 1) 1 c => some (.A a c 6) | .A a (b + 2) c => some (.A a b (c + 3)) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB0LD_1RC1RA_1LD0RB_1LE1LA_1RF0RC_HHH1RE - namespace M_1RB0LD_1RC1RF_1LA0RA_0LA0LE_1LD1LA_0RBHHH def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LD_1RC1RF_1LA0RA_0LA0LE_1LD1LA_0RB---" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def cfg_S0z (a c : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight SixState.A (ListBlank.append @@ -1617,7 +1473,6 @@ def cfg_S0z (a c : ℕ) : Cfg (Fin 2) (Fin 6) := (ListBlank.append (([1, 0] : List (Fin 2)) ^ c) (ListBlank.append ([0, 1] : List (Fin 2)) default))) - def cfg_S0p (a b c : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight SixState.A (ListBlank.append @@ -1634,7 +1489,6 @@ def cfg_S0p (a b c : ℕ) : Cfg (Fin 2) (Fin 6) := (ListBlank.append (([1, 0] : List (Fin 2)) ^ c) (ListBlank.append ([0, 1] : List (Fin 2)) default))))) - def cfg_T1 (j m : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight E default @@ -1647,7 +1501,6 @@ def cfg_T1 (j m : ℕ) : Cfg (Fin 2) (Fin 6) := (ListBlank.append (([0] : List (Fin 2)) ^ m) (ListBlank.append ([1] : List (Fin 2)) default))))) - def cfg_T0 (j m : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight E default @@ -1660,7 +1513,6 @@ def cfg_T0 (j m : ℕ) : Cfg (Fin 2) (Fin 6) := (ListBlank.append (([0] : List (Fin 2)) ^ m) (ListBlank.append ([1, 1] : List (Fin 2)) default))))) - def cfg_T11 (j m : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight E default @@ -1673,7 +1525,6 @@ def cfg_T11 (j m : ℕ) : Cfg (Fin 2) (Fin 6) := (ListBlank.append (([0] : List (Fin 2)) ^ m) (ListBlank.append ([1, 0, 1] : List (Fin 2)) default))))) - def cfg_T3 (j m : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight E default @@ -1686,7 +1537,6 @@ def cfg_T3 (j m : ℕ) : Cfg (Fin 2) (Fin 6) := (ListBlank.append (([0] : List (Fin 2)) ^ m) (ListBlank.append ([1, 0, 0, 0, 1] : List (Fin 2)) default))))) - def cfg_T10 (j m : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight E default @@ -1699,7 +1549,6 @@ def cfg_T10 (j m : ℕ) : Cfg (Fin 2) (Fin 6) := (ListBlank.append (([0] : List (Fin 2)) ^ m) (ListBlank.append ([1, 0, 1, 1] : List (Fin 2)) default))))) - def cfg_Tn (j : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight E default @@ -1708,7 +1557,6 @@ def cfg_Tn (j : ℕ) : Cfg (Fin 2) (Fin 6) := (ListBlank.append (([1, 0] : List (Fin 2)) ^ j) (ListBlank.append ([1, 0, 0, 1] : List (Fin 2)) default))) - def cfg_Ea (n : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight SixState.A default @@ -1717,7 +1565,6 @@ def cfg_Ea (n : ℕ) : Cfg (Fin 2) (Fin 6) := (ListBlank.append (([1, 0] : List (Fin 2)) ^ n) (ListBlank.append ([1, 0, 0, 0, 1, 0, 1] : List (Fin 2)) default))) - def cfg_Eb (k t : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight SixState.A default @@ -1729,7 +1576,6 @@ def cfg_Eb (k t : ℕ) : Cfg (Fin 2) (Fin 6) := (ListBlank.append (([0] : List (Fin 2)) ^ t) (ListBlank.append ([1, 1, 0, 1] : List (Fin 2)) default)))) - def cfg_Ec (n : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight SixState.A default @@ -1738,7 +1584,6 @@ def cfg_Ec (n : ℕ) : Cfg (Fin 2) (Fin 6) := (ListBlank.append (([1, 0] : List (Fin 2)) ^ n) (ListBlank.append ([1] : List (Fin 2)) default))) - def cfg_Ed (k t : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight SixState.A default @@ -1750,7 +1595,6 @@ def cfg_Ed (k t : ℕ) : Cfg (Fin 2) (Fin 6) := (ListBlank.append (([0] : List (Fin 2)) ^ t) (ListBlank.append ([1] : List (Fin 2)) default)))) - def cfg_T1s (b : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight SixState.A (ListBlank.append @@ -1763,7 +1607,6 @@ def cfg_T1s (b : ℕ) : Cfg (Fin 2) (Fin 6) := (ListBlank.append (([0] : List (Fin 2)) ^ b) (ListBlank.append ([1, 0] : List (Fin 2)) default))) - def cfg_Tns (j : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight SixState.A (ListBlank.append @@ -1772,12 +1615,10 @@ def cfg_Tns (j : ℕ) : Cfg (Fin 2) (Fin 6) := (([0, 1] : List (Fin 2)) ^ (j + 2)) (ListBlank.append ([1] : List (Fin 2)) default))) default - def pat_S0p_T1 : TapePattern (Fin 2) (Fin 6) := { left := .sym 0 (.sym 1 (.rep [0, 1] 0 (.sym 1 .default))) head := some SixState.A right := .sym 0 (.rep [0] 1 (.rep [1, 0] 2 (.rep [0, 1] 3 .default))) } - def cond_S0p_T1 : VarCond := .or (.and (.ge_const 3 1) (.and (.not (.ge_const 3 2)) (.ge_const 2 1))) (.or @@ -1788,7 +1629,6 @@ def cond_S0p_T1 : VarCond := (.and (.not (.ge_const 3 1)) (.and (.not (.ge_const 2 1)) (.and (.not (.ge_const 1 1)) (.ge_const 0 2))))) - def pat_Ebd : TapePattern (Fin 2) (Fin 6) := { left := .default head := some SixState.A @@ -1799,13 +1639,10 @@ def pat_Ebd : TapePattern (Fin 2) (Fin 6) := 3 (.rep [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1] 0 (.rep [0] 1 (.sym 1 (.rep [1, 0, 1] 2 .default))))) } - def cond_Ebd : VarCond := .and (.not (.ge_const 2 2)) (.and (.ge_const 3 1) (.not (.ge_const 3 2))) - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_S0p_T1, cond_S0p_T1), (pat_Ebd, cond_Ebd)] - inductive State where | S0p (a b c : ℕ) | S0z (a c : ℕ) @@ -1819,9 +1656,7 @@ inductive State where | Eb (k t : ℕ) | Ec (n : ℕ) | Ed (k t : ℕ) - def start : State := .S0p 0 1 3 - def encode : State → Cfg (Fin 2) (Fin 6) | .S0p a b c => cfg_S0p a b c | .S0z a c => cfg_S0z a c @@ -1835,7 +1670,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) | .Eb k t => cfg_Eb k t | .Ec n => cfg_Ec n | .Ed k t => cfg_Ed k t - def next : State → Option State | .S0p a 0 c => some (.S0p 0 (2 * a + 1) (c + 4)) | .S0p a 1 c => some (.S0p (a + 2) 0 (c + 2)) @@ -1868,12 +1702,10 @@ def next : State → Option State | .Eb k t => some (.Eb (k + 1) t) | .Ec n => some (.Ed 0 (2 * n + 1)) | .Ed k t => some (.Ed (k + 1) t) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | S (b c : ℕ) | T (m : ℕ) @@ -1881,19 +1713,15 @@ inductive HighLevelState where | Eb (k t : ℕ) | Ed (k t : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .S 1 3 - def toState : HighLevelState → State | .S b c => .S0p 0 b c | .T m => .T1 0 m | .Tn j => .Tn j | .Eb k t => .Eb k t | .Ed k t => .Ed k t - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def highLevelNext : HighLevelState → Option HighLevelState | .S b c => let a := 2 * (b / 3) @@ -1928,65 +1756,49 @@ def highLevelNext : HighLevelState → Option HighLevelState | .Tn j => some (.Tn (j + 2)) | .Eb k t => some (.Eb (k + 1) t) | .Ed k t => some (.Ed (k + 1) t) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry - end M_1RB0LD_1RC1RF_1LA0RA_0LA0LE_1LD1LA_0RBHHH - namespace M_1RB0LE_0RC1RC_0RD1LA_1LD0LA_1LF1LC_HHH0LA def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LE_0RC1RC_0RD1LA_1LD0LA_1LF1LC_---0LA" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_D : TapePattern (Fin 2) (Fin 6) := { left := .default head := some D right := .rep [1, 0] 0 (.rep [1, 1, 0] 1 (.rep [0] 2 (.rep [1] 3 .default))) } def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_D, .not (.ge_const 2 2))] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry - theorem has_collatz_reduction : HasCollatzReduction target := by sorry - /-! ### Level B: accelerated state machine -/ - def D_cfg (a b c d : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight D default (ListBlank.append (([1, 0] : List (Fin 2)) ^ a) (ListBlank.append (([1, 1, 0] : List (Fin 2)) ^ b) (ListBlank.append (([0] : List (Fin 2)) ^ c) (ListBlank.append (([1] : List (Fin 2)) ^ d) default)))) - def H_mid (a b m : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight D (ListBlank.append [0] (ListBlank.append (([1, 1, 1] : List (Fin 2)) ^ b) (ListBlank.append [1] (ListBlank.append (([0, 1] : List (Fin 2)) ^ a) default)))) (ListBlank.append (([1] : List (Fin 2)) ^ m) default) - def B_mid (a k b d : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight B (ListBlank.append (([1] : List (Fin 2)) ^ k) (ListBlank.append (([0, 1] : List (Fin 2)) ^ a) default)) (ListBlank.append [0, 0] (ListBlank.append (([1, 1, 0] : List (Fin 2)) ^ b) (ListBlank.append [0] (ListBlank.append (([1] : List (Fin 2)) ^ d) default)))) - def A_rem (a k q m : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headLeft A (ListBlank.append (([1] : List (Fin 2)) ^ k) (ListBlank.append (([0, 1] : List (Fin 2)) ^ a) default)) (ListBlank.append (([1, 1, 0] : List (Fin 2)) ^ q) (ListBlank.append [0] (ListBlank.append (([1] : List (Fin 2)) ^ m) default))) - inductive State | D0 (a b d : ℕ) | D1 (a b d : ℕ) @@ -1994,9 +1806,7 @@ inductive State | B (a k b d : ℕ) | A_pos (a k q m : ℕ) | A_zero (a q m : ℕ) - def start : State := .D0 0 0 4 - def encode : State → Cfg (Fin 2) (Fin 6) | .D0 a b d => D_cfg a b 0 d | .D1 a b d => D_cfg a b 1 d @@ -2004,7 +1814,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) | .B a k b d => B_mid a (k + 1) b d | .A_pos a k q m => A_rem a (k + 1) q m | .A_zero a q m => A_rem a 0 (q + 1) m - def next : State → Option State | .D1 0 0 d => some (.D1 0 0 (d + 1)) | .D1 0 (b + 1) d => some (.D1 1 b (d + 2)) @@ -2050,22 +1859,16 @@ def next : State → Option State some (.A_pos a q 0 (m + 2 * q + 3)) | .A_pos a 2 q m => some (.A_zero a q m) | .A_pos a (k + 3) q m => some (.A_pos a k (q + 1) m) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry inductive HighLevelState where | D (a d : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .D 0 7 - def toState : HighLevelState → State | .D a d => .D1 (a + 1) 0 d - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def evalA (a k m : ℕ) : Option (ℕ × ℕ × ℕ) := if k % 3 = 2 then some (a + 1, k / 3, m) else if a = 0 then (if k % 3 = 0 then none else some (0, k / 3, m)) @@ -2073,7 +1876,6 @@ def evalA (a k m : ℕ) : Option (ℕ × ℕ × ℕ) := else evalA (a - 1) (k / 3) (m + 2 * (k / 3) + 3) termination_by a decreasing_by omega - def drainB (a b d : ℕ) : Option HighLevelState := if b = 0 then some (.D a d) else @@ -2081,7 +1883,6 @@ def drainB (a b d : ℕ) : Option HighLevelState := if p.2.1 < b then drainB p.1 p.2.1 p.2.2 else none termination_by b decreasing_by omega - def highLevelNext : HighLevelState → Option HighLevelState | .D a d => if a = 0 then @@ -2092,44 +1893,32 @@ def highLevelNext : HighLevelState → Option HighLevelState else if a = d + 2 then drainB 0 a 2 else if d % 2 = 1 then drainB (d + 4 - a) (a - 1) 3 else (evalA (d + 1 - a) a (2 * a + 5)).bind fun p => drainB p.1 p.2.1 p.2.2 - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB0LE_0RC1RC_0RD1LA_1LD0LA_1LF1LC_HHH0LA - namespace M_1RB0LE_0RC1RC_0RD1LA_1LD0LA_1LF1LC_HHH1LC def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LE_0RC1RC_0RD1LA_1LD0LA_1LF1LC_---1LC" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_D : TapePattern (Fin 2) (Fin 6) := { left := .default head := some D right := .rep [1, 0] 0 (.rep [1, 1, 0] 1 (.rep [0] 2 (.rep [1] 3 .default))) } def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_D, .not (.ge_const 2 2))] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry - theorem has_collatz_reduction : HasCollatzReduction target := by sorry - /-! ### Level B: accelerated state machine -/ - def D_cfg (a b c d : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight D default (ListBlank.append (([1, 0] : List (Fin 2)) ^ a) (ListBlank.append (([1, 1, 0] : List (Fin 2)) ^ b) (ListBlank.append (([0] : List (Fin 2)) ^ c) (ListBlank.append (([1] : List (Fin 2)) ^ d) default)))) - def A_ones (a k b d : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headLeft A (ListBlank.append (([1] : List (Fin 2)) ^ (k + 1)) @@ -2137,13 +1926,11 @@ def A_ones (a k b d : Nat) : Cfg (Fin 2) (Fin 6) := (ListBlank.append (([1, 1, 0] : List (Fin 2)) ^ b) (ListBlank.append ([0] : List (Fin 2)) (ListBlank.append (([1] : List (Fin 2)) ^ d) default))) - def H_mid (a b m : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight D (ListBlank.append [0] (ListBlank.append (([1, 1, 1] : List (Fin 2)) ^ b) (ListBlank.append [1] (ListBlank.append (([0, 1] : List (Fin 2)) ^ a) default)))) (ListBlank.append (([1] : List (Fin 2)) ^ m) default) - def B_mid (a k b d : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight B (ListBlank.append (([1] : List (Fin 2)) ^ k) @@ -2151,23 +1938,19 @@ def B_mid (a k b d : Nat) : Cfg (Fin 2) (Fin 6) := (ListBlank.append [0, 0] (ListBlank.append (([1, 1, 0] : List (Fin 2)) ^ b) (ListBlank.append ([0] : List (Fin 2)) (ListBlank.append (([1] : List (Fin 2)) ^ d) default)))) - inductive State | D0 (a b d : ℕ) | D1 (a b d : ℕ) | H (a b m : ℕ) | B (a k b d : ℕ) | A (a k b d : ℕ) - def start : State := .D0 0 0 4 - def encode : State → Cfg (Fin 2) (Fin 6) | .D0 a b d => D_cfg a b 0 d | .D1 a b d => D_cfg a b 1 d | .H a b m => H_mid a (b + 1) (m + 1) | .B a k b d => B_mid a (k + 1) b d | .A a k b d => A_ones a k b d - def next : State → Option State | .D1 0 0 d => some (.D1 0 0 (d + 1)) | .D1 0 (b + 1) d => some (.D1 1 b (d + 2)) @@ -2210,22 +1993,16 @@ def next : State → Option State some (.B a 1 b d) | .A a 2 b d => some (.D1 (a + 2) b d) | .A a (k + 3) b d => some (.A a k (b + 1) d) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry inductive HighLevelState where | D (a d : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .D 0 7 - def toState : HighLevelState → State | .D a d => .D1 (a + 1) 0 d - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def evalA (a k m : ℕ) : Option (ℕ × ℕ × ℕ) := if k % 3 = 2 then some (a + 1, k / 3, m) else if a = 0 then (if k % 3 = 0 then none else some (0, k / 3, m)) @@ -2233,7 +2010,6 @@ def evalA (a k m : ℕ) : Option (ℕ × ℕ × ℕ) := else evalA (a - 1) (k / 3) (m + 2 * (k / 3) + 3) termination_by a decreasing_by omega - def drainB (a b d : ℕ) : Option HighLevelState := if b = 0 then some (.D a d) else @@ -2241,7 +2017,6 @@ def drainB (a b d : ℕ) : Option HighLevelState := if p.2.1 < b then drainB p.1 p.2.1 p.2.2 else none termination_by b decreasing_by omega - def highLevelNext : HighLevelState → Option HighLevelState | .D a d => if a = 0 then @@ -2252,13 +2027,10 @@ def highLevelNext : HighLevelState → Option HighLevelState else if a = d + 2 then drainB 0 a 2 else if d % 2 = 1 then drainB (d + 4 - a) (a - 1) 3 else (evalA (d + 1 - a) a (2 * a + 5)).bind fun p => drainB p.1 p.2.1 p.2.2 - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB0LE_0RC1RC_0RD1LA_1LD0LA_1LF1LC_HHH1LC @@ -2272,31 +2044,23 @@ end BB6 namespace M_1RB0LE_1LC1RA_1RA1LD_0LC0LA_0RE1RF_0RCHHH def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LE_1LC1RA_1RA1LD_0LC0LA_0RE1RF_0RC---" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_C : TapePattern (Fin 2) (Fin 6) := { left := .rep [0, 1] 1 (.rep [1] 0 .default) head := some C right := .rep [1] 2 .default } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_C, .true)] - inductive State where /-- $C(m, k, b) := 0^\infty\,1^m\,(10)^k\,\mathrm{C}{>}\,1^b\,0^\infty$. -/ | C (m k b : ℕ) - def start : State := .C 0 0 2 - def encode : State → Cfg (Fin 2) (Fin 6) | .C m k b => Cfg.headRight SixState.C (ListBlank.append (([0, 1] : List (Fin 2)) ^ k) (ListBlank.append (([1] : List (Fin 2)) ^ m) default)) (ListBlank.append (([1] : List (Fin 2)) ^ b) default) - def next : State → Option State | .C m k 0 => some (.C (m + 1) 0 (2 * k + 2)) | .C 0 k 1 => some (.C (2 * k + 3) 0 2) @@ -2310,57 +2074,44 @@ def next : State → Option State | .C 2 (k + 2) 1 => some (.C (2 * k + 7) 0 2) | .C 2 (k + 2) (b + 2) => some (.C (2 * k + 6) 1 b) | .C (m + 3) k (b + 1) => some (.C m (k + 2) b) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB0LE_1LC1RA_1RA1LD_0LC0LA_0RE1RF_0RCHHH - namespace M_1RB0LF_1LC0LD_1RD1LB_HHH1RE_0RA1RE_1LA0LE def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LF_1LC0LD_1RD1LB_---1RE_0RA1RE_1LA0LE" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_A : TapePattern (Fin 2) (Fin 6) := { left := .rep [1, 0] 1 (.rep [1] 0 .default) head := some F right := .sym 0 (.sym 0 (.rep [1] 2 .default)) } def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_A, .true)] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry - theorem has_collatz_reduction : HasCollatzReduction target := by sorry - /-! ### Level B: accelerated state machine -/ - def F_R (b k : Nat) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := Cfg.headRight F (ListBlank.append (([1, 0] : List (Fin 2)) ^ k) (ListBlank.append (([1] : List (Fin 2)) ^ b) default)) (ListBlank.append [0, 0] r) - def cfg_A (b k c : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight F (ListBlank.append (([1, 0] : List (Fin 2)) ^ k) (ListBlank.append (([1] : List (Fin 2)) ^ b) default)) (ListBlank.append [0, 0] (ListBlank.append (([1] : List (Fin 2)) ^ c) default)) - def Odd_cfg (p k n m c : Nat) : Cfg (Fin 2) (Fin 6) := F_R (2 * p + 1) k (ListBlank.append (([1] : List (Fin 2)) ^ (2 * n)) (ListBlank.append (([0, 1] : List (Fin 2)) ^ (m + 1)) (ListBlank.append (([1] : List (Fin 2)) ^ c) default))) - def ETail_cfg (k m c : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight E (ListBlank.append (([1] : List (Fin 2)) ^ (2 * (k + 4) + 1)) default) (ListBlank.append (([0, 1] : List (Fin 2)) ^ m) (ListBlank.append (([1] : List (Fin 2)) ^ c) default)) - /-- Symbolic configuration state space for `1RB0LF_1LC0LD_1RD1LB_---1RE_0RA1RE_1LA0LE`. -/ inductive State /-- $A(b, k, c) := 0^\infty\,1^b\,(01)^k\,\mathrm{F}{>}\,0\,0\,1^c\,0^\infty$. -/ @@ -2370,16 +2121,13 @@ inductive State | Odd (p k n m c : ℕ) /-- $ETail(k, m, c) := 0^\infty\,1^{2k+9}\,\mathrm{E}{>}\,(01)^m\,1^c\,0^\infty$. -/ | ETail (k m c : ℕ) - /-- Initial symbolic state $A(5, 0, 2)$, reached from the blank tape. -/ def start : State := .A 5 0 2 - /-- Decode a symbolic `State` into a concrete Turing machine configuration. -/ def encode : State → Cfg (Fin 2) (Fin 6) | .A b k c => cfg_A b k c | .Odd p k n m c => Odd_cfg p k n m c | .ETail k m c => ETail_cfg k m c - /-- Accelerated Collatz-like transition function. -/ def next : State → Option State | .A b k 0 => @@ -2416,23 +2164,17 @@ def next : State → Option State | .ETail k 0 c => some (.A (2 * k + c + 7) 0 3) | .ETail k 1 c => some (.A (2 * (k + 4) + 1) 0 c) | .ETail k (m + 2) c => some (.Odd (k + 4) 0 0 m c) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry inductive HighLevelState where /-- $A(b, c) := 0^\infty\,1^b\,\mathrm{F}{>}\,00\,1^c\,0^\infty$. -/ | A (b c : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .A 5 2 - def toState : HighLevelState → State | .A b c => .A b 0 c - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def evalOdd (m p n c : ℕ) : HighLevelState := if m = 0 then if p ≤ n + 1 then .A (4 * n + c + 7) 3 else .A (2 * (p - n - 2) + 1) (4 * n + c + 6) @@ -2443,7 +2185,6 @@ def evalOdd (m p n c : ℕ) : HighLevelState := else evalOdd (m - 1) (p - n - 2) (2 * n + 3) c termination_by m decreasing_by all_goals omega - def highLevelNext : HighLevelState → Option HighLevelState | .A b c => if b = 0 then some (.A (2 * c + 4) 3) @@ -2453,39 +2194,29 @@ def highLevelNext : HighLevelState → Option HighLevelState else if b ≤ 2 * (c / 2) then some (evalOdd (b - 3) 2 0 (c - b + 1)) else if b = 2 * (c / 2) + 2 then some (evalOdd (b - 4 + c % 2) 2 0 0) else none - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB0LF_1LC0LD_1RD1LB_HHH1RE_0RA1RE_1LA0LE - namespace M_1RB0LF_1LC1RA_0RE0RD_HHH1LE_1LF1RC_1LC1LA def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LF_1LC1RA_0RE0RD_---1LE_1LF1RC_1LC1LA" abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB - def pat_A : TapePattern (Fin 2) (Fin 6) := { left := .default head := some E right := .rep [1, 0] 0 (.rep [1] 1 .default) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_A, .ge_const 1 1)] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry - inductive State where | C (a b : ℕ) | P (k n p : ℕ) - def start : State := .C 0 2 - def encode : State → Cfg (Fin 2) (Fin 6) | .C a b => Cfg.headRight SixState.E default @@ -2496,7 +2227,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append (([0, 1] : List (Fin 2)) ^ k) default) (ListBlank.append (([1, 0] : List (Fin 2)) ^ n) (ListBlank.append (([1] : List (Fin 2)) ^ (p + 1)) default)) - def next : State → Option State | .C a 0 => some (.C 2 (2 * a + 1)) | .C _ 1 => none @@ -2507,22 +2237,17 @@ def next : State → Option State | .P (k + 1) n 0 => some (.P k (n + 1) 2) | .P (k + 1) n 1 => some (.P k (n + 1) 0) | .P (k + 1) n (p + 2) => some (.P k (n + 2) p) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry inductive HighLevelState where /-- `.C a b` encodes $C(a, b + 1) := 0^\infty\,\mathrm{E}{>}\,(10)^a\,1^{b+1}\,0^\infty$. -/ | C (a b : ℕ) - /-- Initial state `.C 0 2`, encoding $C(0, 3) = 0^\infty\,\mathrm{E}{>}\,1^3\,0^\infty$. -/ def highLevelStart : HighLevelState := .C 0 2 - def toState : HighLevelState → State | .C a b => .C a b - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def highLevelNext : HighLevelState → Option HighLevelState | .C a 0 => some (.C 2 (2 * a + 1)) | .C _ 1 => none @@ -2532,22 +2257,17 @@ def highLevelNext : HighLevelState → Option HighLevelState some (.C ((6 * a + d + 5) / 4) ((6 * a + d + 5) % 4)) else some (.C ((6 * a + d + 8) / 4) ((6 * a + d + 8) % 4)) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB0LF_1LC1RA_0RE0RD_HHH1LE_1LF1RC_1LC1LA - namespace M_1RB0LF_1RC1RA_0RD0RB_1LEHHH_0LA1LE_1RD1LA def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LF_1RC1RA_0RD0RB_1LE---_0LA1LE_1RD1LA" abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB - def ps : TapePatternSet (Fin 2) (Fin 6) := [({ left := .sym 1 (.rep [0, 1] 0 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 .default)))))) head := some SixState.A @@ -2565,18 +2285,14 @@ def ps : TapePatternSet (Fin 2) (Fin 6) := right := .sym 1 (.rep [1, 1, 0, 1] 1 (.sym 1 (.sym 1 (.sym 1 (.rep [0, 1] 2 (.sym 0 (.sym 1 (.sym 0 (.sym 0 (.sym 1 .default)))))))))) }, .true)] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry - inductive State where | J (u v w : ℕ) | S_E (b m k : ℕ) | S_E0 (b m : ℕ) | S_E1 (b m n : ℕ) - def start : State := .J 0 0 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .J u v w => Cfg.headRight SixState.A @@ -2612,7 +2328,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append [1, 1, 1] (ListBlank.append (([0, 1] : List (Fin 2)) ^ n) (ListBlank.append [0, 1, 0, 0, 1] default))))) - def next : State → Option State | .J 0 v 0 => some (.S_E0 (v + 3) 0) | .J 0 v 1 => some (.S_E1 (v + 2) 0 0) @@ -2633,22 +2348,17 @@ def next : State → Option State | .S_E1 0 m n => some (.S_E 2 0 (2 * m + n + 2)) | .S_E1 1 m n => some (.S_E 0 0 (2 * m + n + 3)) | .S_E1 (b + 2) m n => some (.S_E1 b (m + 1) n) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry inductive HighLevelState where /-- $J(u, w) := 0^\infty\,1^5\,(10)^u\,1\,\mathrm{A}{>}\,1^{w+2}\,01\,0^\infty$. -/ | J (u w : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .J 0 0 - def toState : HighLevelState → State | .J u w => .J u 0 w - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def highLevelNext : HighLevelState → Option HighLevelState | .J u w => let m := w / 2 @@ -2669,45 +2379,33 @@ def highLevelNext : HighLevelState → Option HighLevelState if w = 1 then some (.J 11 (2 * u + 10)) else some (.J (d + 7) (2 * w - 4)) else some (.J (d + 3) (2 * w)) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB0LF_1RC1RA_0RD0RB_1LEHHH_0LA1LE_1RD1LA - namespace M_1RB0RB_1LB0LC_1RD1LC_1RE0RA_0RF1RA_HHH1LB def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0RB_1LB0LC_1RD1LC_1RE0RA_0RF1RA_---1LB" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_D : TapePattern (Fin 2) (Fin 6) := { left := .sym 1 (.rep [1] 0 .default) head := some D right := .rep [1] 1 (.sym 0 (.rep [1] 2 .default)) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_D, .true)] - inductive State where /-- $D(a, b, c) := 0^\infty\,1^{a+1}\,\mathrm{D}{>}\,1^b\,0\,1^c\,0^\infty$. -/ | D (a b c : ℕ) - def start : State := .D 0 3 1 - def encode : State → Cfg (Fin 2) (Fin 6) | .D a b c => Cfg.headRight SixState.D (ListBlank.append [1] (ListBlank.append (([1] : List (Fin 2)) ^ a) default)) (ListBlank.append (([1] : List (Fin 2)) ^ b) (ListBlank.append [0] (ListBlank.append (([1] : List (Fin 2)) ^ c) default))) - def next : State → Option State | .D _ 0 0 => none | .D a 0 1 => some (.D 0 (a + 3) 1) @@ -2724,34 +2422,25 @@ def next : State → Option State if b % 3 = 0 then some (.D (a + 1) (b + 1) (c + 2)) else if b % 3 = 1 then some (.D (a + 1) (b + 3) c) else some (.D (a + 1) b (c + 3)) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB0RB_1LB0LC_1RD1LC_1RE0RA_0RF1RA_HHH1LB - namespace M_1RB0RB_1LC1RE_1LF0LD_1RA1LD_1RC1RB_HHH1LC def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0RB_1LC1RE_1LF0LD_1RA1LD_1RC1RB_---1LC" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_P : TapePattern (Fin 2) (Fin 6) := { left := .rep [1] 0 .default head := some D right := .sym 0 (.rep [1] 1 (.sym 0 (.rep [1] 2 .default))) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_P, .true)] - inductive State where /-- $P(a, b, c) := 0^\infty\,1^a\,\mathrm{D}{>}\,0\,1^b\,0\,1^c\,0^\infty$. -/ | P (a b c : ℕ) - def start : State := .P 0 0 1 - def encode : State → Cfg (Fin 2) (Fin 6) | .P a b c => Cfg.headRight SixState.D @@ -2760,7 +2449,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append (([1] : List (Fin 2)) ^ b) (ListBlank.append [0] (ListBlank.append (([1] : List (Fin 2)) ^ c) default)))) - def next : State → Option State | .P a 0 c => if c % 2 = 0 then some (.P 0 (a + c + 1) 1) @@ -2773,65 +2461,49 @@ def next : State → Option State | .P a (b + 2) (c + 1) => if b % 2 = 0 then some (.P (a + 1) (b + 2) c) else some (.P (a + 1) b (c + 2)) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB0RB_1LC1RE_1LF0LD_1RA1LD_1RC1RB_HHH1LC - namespace M_1RB0RC_1LC1RE_1RA1LD_0LC0LA_1RF1RD_HHH0RD def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0RC_1LC1RE_1RA1LD_0LC0LA_1RF1RD_---0RD" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_A : TapePattern (Fin 2) (Fin 6) := { left := .rep [1] 0 (.rep [0, 1, 1, 1] 1 .default) head := some D right := .sym 1 (.sym 1 (.rep [0, 1] 2 (.rep [1] 3 .default))) } def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_A, .not (.ge_const 1 2))] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry - theorem has_collatz_reduction : HasCollatzReduction target := by sorry - /-! ### Level B: accelerated state machine -/ - abbrev cfg_A (l : ListBlank (Fin 2)) (k j c : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight D (ListBlank.append (([1] : List (Fin 2)) ^ k) l) (ListBlank.append [1, 1] (ListBlank.append (([0, 1] : List (Fin 2)) ^ j) (ListBlank.append (([1] : List (Fin 2)) ^ c) default))) - abbrev l_hat : ListBlank (Fin 2) := ListBlank.append [0] (ListBlank.append (([1] : List (Fin 2)) ^ 3) default) - abbrev l_ones3 : ListBlank (Fin 2) := ListBlank.append (([1] : List (Fin 2)) ^ 3) default - abbrev cfg_C001 (l : ListBlank (Fin 2)) (a b : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight C l (ListBlank.append [0, 0, 1] (ListBlank.append (([0, 1] : List (Fin 2)) ^ a) (ListBlank.append (([1] : List (Fin 2)) ^ b) default))) - inductive State where | S_def (k j c : ℕ) | S_hat (k j c : ℕ) | C_def (a b : ℕ) | C_hat (a b : ℕ) | C_ones3 (a b : ℕ) - def start : State := .S_def 2 0 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .S_def k j c => cfg_A default k j c | .S_hat k j c => cfg_A l_hat k j c | .C_def a b => cfg_C001 default a b | .C_hat a b => cfg_C001 l_hat a b | .C_ones3 a b => cfg_C001 l_ones3 a b - def next : State → Option State | .S_def 0 0 c => some (.C_def 0 (c + 2)) | .S_def 0 (j + 1) c => some (.C_hat j c) @@ -2876,24 +2548,18 @@ def next : State → Option State else Nat.casesOn b (some (.S_def (3 + (4 * (a / 2) + 4)) 0 1)) fun c => some (.S_def (3 + (4 * (a / 2) + 3)) 0 (c + 1)) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry inductive HighLevelState where /-- $S(p, k, c) := 0^\infty\,(1110)^p\,1^k\,\mathrm{D}{>}\,11\,1^c\,0^\infty$. -/ | S (p : Bool) (k c : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .S false 2 0 - def toState : HighLevelState → State | .S false k c => .S_def k 0 c | .S true k c => .S_hat k 0 c - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def highLevelNext : HighLevelState → Option HighLevelState | .S p k c => let q := k / 3 @@ -2935,40 +2601,29 @@ def highLevelNext : HighLevelState → Option HighLevelState else if d = 2 then some (.S false (4 * q + 6) 0) else if d = 3 then some (.S false (4 * q + 6) 3) else some (.S false (4 * q + 8) (d - 4)) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB0RC_1LC1RE_1RA1LD_0LC0LA_1RF1RD_HHH0RD - namespace M_1RB0RD_0RC1RE_1RD0LA_1LE1LC_1RF0LD_HHH0RA def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0RD_0RC1RE_1RD0LA_1LE1LC_1RF0LD_---0RA" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_C : TapePattern (Fin 2) (Fin 6) := { left := .rep [0, 1] 0 (.sym 0 (.sym 1 (.rep [1] 1 (.rep [0, 1, 1, 1] 2 (.rep [0, 1] 3 .default))))) head := some C right := .default } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_C, .true)] - inductive State where /-- $C(c, b, a, d) := 0^\infty\,(10)^d\,(1110)^a\,1^b\,10\,(10)^c\,\mathrm{C}{>}\,0^\infty$. -/ | C (c b a d : ℕ) - def start : State := .C 0 0 0 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .C c b a d => Cfg.headRight SixState.C @@ -2978,7 +2633,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append (([0, 1, 1, 1] : List (Fin 2)) ^ a) (ListBlank.append (([0, 1] : List (Fin 2)) ^ d) default))))) default - def next : State → Option State | .C c 0 0 d => if (c + d) % 2 = 0 then @@ -2995,24 +2649,18 @@ def next : State → Option State | .C c 2 0 (d + 1) => some (.C 0 (2 * c + 6) 0 d) | .C c 2 (a + 1) d => some (.C 0 (2 * c + 8) a d) | .C c (b + 3) a d => some (.C (c + 4) b a d) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | L (p : Bool) (b : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .L false 0 - def toState : HighLevelState → State | .L p b => .C 0 b 0 (if p then 1 else 0) - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def drainA (b a : ℕ) (p : Bool) : HighLevelState := if a = 0 then .L p b @@ -3027,7 +2675,6 @@ def drainA (b a : ℕ) (p : Bool) : HighLevelState := drainA b' (a - (2 - b % 3 / 2)) p termination_by a decreasing_by omega - def highLevelNext : HighLevelState → Option HighLevelState | .L false b => let q := b / 3 @@ -3038,62 +2685,46 @@ def highLevelNext : HighLevelState → Option HighLevelState if b % 3 = 0 then none else if b % 3 = 1 then some (drainA 0 (2 * q + 3) true) else some (.L false (8 * q + 6)) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry - end M_1RB0RD_0RC1RE_1RD0LA_1LE1LC_1RF0LD_HHH0RA - namespace M_1RB0RE_1LC0RA_1RF0RD_HHH1LE_0LB1LE_1LE1RC def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0RE_1LC0RA_1RF0RD_---1LE_0LB1LE_1LE1RC" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_A : TapePattern (Fin 2) (Fin 6) := { left := .sym 0 (.rep [1] 2 .default) head := some A right := .sym 0 (.rep [1, 0] 1 (.rep [1] 0 .default)) } def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_A, .true)] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry - theorem has_collatz_reduction : HasCollatzReduction target := by sorry - /-! ### Level B: accelerated state machine -/ - def F_R (b k : Nat) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := Cfg.headRight F (ListBlank.append (([1, 0] : List (Fin 2)) ^ k) (ListBlank.append (([1] : List (Fin 2)) ^ b) default)) (ListBlank.append [0, 0] r) - def cfg_F (b k c : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight F (ListBlank.append (([1, 0] : List (Fin 2)) ^ k) (ListBlank.append (([1] : List (Fin 2)) ^ b) default)) (ListBlank.append [0, 0] (ListBlank.append (([1] : List (Fin 2)) ^ c) default)) - def Odd_cfg (p k n m c : Nat) : Cfg (Fin 2) (Fin 6) := F_R (2 * p + 1) k (ListBlank.append (([1] : List (Fin 2)) ^ (2 * n)) (ListBlank.append (([0, 1] : List (Fin 2)) ^ (m + 1)) (ListBlank.append (([1] : List (Fin 2)) ^ c) default))) - def ETail_cfg (k m c : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight E (ListBlank.append (([1] : List (Fin 2)) ^ (2 * (k + 4) + 1)) default) (ListBlank.append (([0, 1] : List (Fin 2)) ^ m) (ListBlank.append (([1] : List (Fin 2)) ^ c) default)) - def π : Fin 6 -> Fin 6 | 0 => 1 | 1 => 2 @@ -3101,28 +2732,21 @@ def π : Fin 6 -> Fin 6 | 3 => 3 | 4 => 4 | 5 => 0 - def mirrorTape : Tape (Fin 2) -> Tape (Fin 2) | ⟨head, l, r⟩ => ⟨head, r, l⟩ - def mirrorCfg (c : Cfg (Fin 2) (Fin 6)) : Cfg (Fin 2) (Fin 6) := ⟨c.q.map π, mirrorTape c.tape⟩ - inductive State | A (b k c : ℕ) | Odd (p k n m c : ℕ) | ETail (k m c : ℕ) - def start : State := .A 4 0 3 - def encode_F : State → Cfg (Fin 2) (Fin 6) | .A b k c => cfg_F b k c | .Odd p k n m c => Odd_cfg p k n m c | .ETail k m c => ETail_cfg k m c - def encode (s : State) : Cfg (Fin 2) (Fin 6) := mirrorCfg (encode_F s) - def next : State → Option State | .A b k 0 => Nat.casesOn k @@ -3158,23 +2782,17 @@ def next : State → Option State | .ETail k 0 c => some (.A (2 * k + c + 7) 0 3) | .ETail k 1 c => some (.A (2 * (k + 4) + 1) 0 c) | .ETail k (m + 2) c => some (.Odd (k + 4) 0 0 m c) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry inductive HighLevelState where /-- $A(b, c) := 0^\infty\,1^c\,0\,\mathrm{A}{>}\,0\,1^b\,0^\infty$. -/ | A (b c : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .A 4 3 - def toState : HighLevelState → State | .A b c => .A b 0 c - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def evalOdd (m p n c : ℕ) : HighLevelState := if m = 0 then if p ≤ n + 1 then .A (4 * n + c + 7) 3 else .A (2 * (p - n - 2) + 1) (4 * n + c + 6) @@ -3185,7 +2803,6 @@ def evalOdd (m p n c : ℕ) : HighLevelState := else evalOdd (m - 1) (p - n - 2) (2 * n + 3) c termination_by m decreasing_by all_goals omega - def highLevelNext : HighLevelState → Option HighLevelState | .A b c => if b = 0 then some (.A (2 * c + 4) 3) @@ -3195,44 +2812,32 @@ def highLevelNext : HighLevelState → Option HighLevelState else if b ≤ 2 * (c / 2) then some (evalOdd (b - 3) 2 0 (c - b + 1)) else if b = 2 * (c / 2) + 2 then some (evalOdd (b - 4 + c % 2) 2 0 0) else none - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB0RE_1LC0RA_1RF0RD_HHH1LE_0LB1LE_1LE1RC - namespace M_1RB0RE_1LC1LD_0RA0LD_1LB0LA_1RF1RA_HHH1LB def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0RE_1LC1LD_0RA0LD_1LB0LA_1RF1RA_---1LB" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_A : TapePattern (Fin 2) (Fin 6) := { left := .sym 1 (.sym 0 (.sym 1 (.sym 0 (.rep [1, 0, 1, 0, 1, 0] 0 .default)))) head := some A right := .rep [0, 1] 1 .default } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_A, .true)] - inductive State where /-- $A(n, m) := 0^\infty\,(01)^{3n+2}\,\mathrm{A}{>}\,(01)^m\,0^\infty$. -/ | A (n m : ℕ) - def start : State := .A 0 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .A n m => Cfg.headRight SixState.A (ListBlank.append (([1, 0] : List (Fin 2)) ^ (3 * n + 2)) default) (ListBlank.append (([0, 1] : List (Fin 2)) ^ m) default) - def next : State → Option State | .A n 0 => some (.A 0 (3 * n + 2)) | .A n 1 => @@ -3241,34 +2846,25 @@ def next : State → Option State | .A n (m + 2) => if n % 2 = 0 then some (.A (3 * (n / 2) + 1) m) else some (.A (3 * (n / 2) + 2) (m + 1)) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB0RE_1LC1LD_0RA0LD_1LB0LA_1RF1RA_HHH1LB - namespace M_1RB0RF_1RC1RF_1LD0LE_HHH1LC_1RA1LE_1LC1RB def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0RF_1RC1RF_1LD0LE_---1LC_1RA1LE_1LC1RB" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_P : TapePattern (Fin 2) (Fin 6) := { left := .rep [1] 0 .default head := some E right := .sym 0 (.rep [1] 1 (.sym 0 (.rep [1] 2 .default))) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_P, .true)] - inductive State where /-- $P(a, b, c) := 0^\infty\,1^a\,\mathrm{E}{>}\,0\,1^b\,0\,1^c\,0^\infty$. -/ | P (a b c : ℕ) - def start : State := .P 0 0 2 - def encode : State → Cfg (Fin 2) (Fin 6) | .P a b c => Cfg.headRight SixState.E @@ -3277,7 +2873,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append (([1] : List (Fin 2)) ^ b) (ListBlank.append [0] (ListBlank.append (([1] : List (Fin 2)) ^ c) default)))) - def next : State → Option State | .P a 0 c => if c % 2 = 0 then some (.P 0 (a + c + 1) 2) @@ -3287,40 +2882,30 @@ def next : State → Option State | .P a (b + 2) c => if b % 2 = 0 then some (.P 0 (a + c + 3 * (b / 2) + 4) 2) else some (.P (a + 1) b (c + 1)) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB0RF_1RC1RF_1LD0LE_HHH1LC_1RA1LE_1LC1RB - namespace M_1RB1LA_0LC0RC_1LE1RD_1RE1RC_1LF0LA_HHH1LE def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LA_0LC0RC_1LE1RD_1RE1RC_1LF0LA_---1LE" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_P : TapePattern (Fin 2) (Fin 6) := { left := .rep [1] 0 .default head := some E right := .sym 1 (.rep [1] 1 .default) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_P, .true)] - inductive State where /-- $P(m, k) := 0^\infty\,1^m\,\mathrm{E}{>}\,1\,1^k\,0^\infty$. -/ | P (m k : ℕ) - def start : State := .P 0 2 - def encode : State → Cfg (Fin 2) (Fin 6) | .P m k => Cfg.headRight SixState.E (ListBlank.append (([1] : List (Fin 2)) ^ m) default) (ListBlank.append [1] (ListBlank.append (([1] : List (Fin 2)) ^ k) default)) - def next : State → Option State | .P 0 0 => some (.P 0 2) | .P 0 (k + 1) => some (.P 2 k) @@ -3330,34 +2915,25 @@ def next : State → Option State some (.P (3 * (m / 2) + k + 3) 1) else some (.P (m / 2) (m / 2 + k + 4)) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB1LA_0LC0RC_1LE1RD_1RE1RC_1LF0LA_HHH1LE - namespace M_1RB1LA_1LC0RE_1LF1LD_0RB0LA_1RC1RE_HHH0LD def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LA_1LC0RE_1LF1LD_0RB0LA_1RC1RE_---0LD" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_C : TapePattern (Fin 2) (Fin 6) := { left := .sym 1 (.rep [1] 0 (.sym 0 (.rep [1] 1 .default))) head := some C right := .rep [1] 2 (.sym 0 (.rep [1] 3 .default)) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_C, .true)] - inductive State where /-- $C(d, k, a, b) := 0^\infty\,1^k\,0\,1^{d+1}\,\mathrm{C}{>}\,1^a\,0\,1^b\,0^\infty$. -/ | C (d k a b : ℕ) - def start : State := .C 1 0 0 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .C d k a b => Cfg.headRight SixState.C @@ -3368,7 +2944,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append (([1] : List (Fin 2)) ^ a) (ListBlank.append [0] (ListBlank.append (([1] : List (Fin 2)) ^ b) default))) - def next : State → Option State | .C 0 0 0 _ => none | .C 0 (k + 1) 0 b => some (.C k 0 0 (b + 2)) @@ -3378,24 +2953,18 @@ def next : State → Option State | .C 0 0 (a + 1) b => some (.C (a + 2) 0 b 0) | .C 0 (k + 1) (a + 1) b => some (.C k 0 (a + 3) b) | .C (d + 1) k (a + 1) b => some (.C d (k + 1) (a + 1) b) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | N (d : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .N 1 - def toState : HighLevelState → State | .N d => .C d 0 0 0 - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def scanEven (d b : ℕ) : Option HighLevelState := if d % 2 = 0 then if d = 0 then none @@ -3406,26 +2975,19 @@ def scanEven (d b : ℕ) : Option HighLevelState := some (.N (b + 5 * (d / 2 - 1) + 9)) termination_by d decreasing_by omega - def highLevelNext : HighLevelState → Option HighLevelState | .N d => scanEven d 0 - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry - end M_1RB1LA_1LC0RE_1LF1LD_0RB0LA_1RC1RE_HHH0LD - namespace M_1RB1LA_1LC0RE_1LF1LD_1RE0LC_1LB1RA_HHH0LA def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LA_1LC0RE_1LF1LD_1RE0LC_1LB1RA_---0LA" abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB - def ps : TapePatternSet (Fin 2) (Fin 6) := [({ left := .sym 1 (.rep [1] 0 .default) head := some SixState.C @@ -3438,10 +3000,8 @@ def ps : TapePatternSet (Fin 2) (Fin 6) := (.rep [1] 1 (.rep [0, 1] 2 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 0 (.sym 1 (.sym 1 .default)))))))))))))))) }, .true)] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry - inductive State where | C_3 (a b c : ℕ) | C_6 (a b c : ℕ) @@ -3449,9 +3009,7 @@ inductive State where | M_6_pos (a : Bool) (b c : ℕ) | L_3 (a : Bool) (b : ℕ) | L_6 (a : Bool) (b : ℕ) - def start : State := .C_3 4 0 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .C_3 a b c => Cfg.headRight SixState.C @@ -3503,7 +3061,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append [1] (ListBlank.append (([1] : List (Fin 2)) ^ 6) (ListBlank.append [0, 1, 1] default))) - def next : State → Option State | .C_3 0 b c => some (.M_3 false b c) | .C_3 1 b c => some (.M_3 true b c) @@ -3527,7 +3084,6 @@ def next : State → Option State else if !a then none else if b = 0 then some (.C_3 6 0 3) else some (.C_6 6 3 (b / 2 - 1)) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry inductive HighLevelState where @@ -3536,18 +3092,14 @@ inductive HighLevelState where | C6_0 (r : Bool) (c : ℕ) | C6_12 (c : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .C3_0 false 6 - def toState : HighLevelState → State | .C3_0 r c => .C_3 (if r then 1 else 0) 0 c | .C3_12 c => .C_3 0 12 c | .C6_0 r c => .C_6 (if r then 1 else 0) 0 c | .C6_12 c => .C_6 0 12 c - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def syracuseScan (r : Bool) (b k : ℕ) : Bool × ℕ := if k = 0 then (r, b) else @@ -3555,7 +3107,6 @@ def syracuseScan (r : Bool) (b k : ℕ) : Bool × ℕ := syracuseScan (decide (s % 2 = 1)) (3 * (s / 2) + 9) (k - 1) termination_by k decreasing_by omega - def finishC3 (r : Bool) (b rem : ℕ) : Option HighLevelState := if rem = 0 then if b % 2 = 0 then some (.C3_0 r (b / 2 + 3)) @@ -3566,7 +3117,6 @@ def finishC3 (r : Bool) (b rem : ℕ) : Option HighLevelState := else if !r then none else if b = 0 then some (.C6_0 true 13) else some (.C6_12 (b / 2 - 1)) - def finishC6 (r : Bool) (b rem : ℕ) : Option HighLevelState := if rem = 0 then if b % 2 = 1 then some (.C3_0 r (b / 2 + 5)) @@ -3576,53 +3126,40 @@ def finishC6 (r : Bool) (b rem : ℕ) : Option HighLevelState := let s := b + if r then 1 else 0 let s1 := (3 * (s / 2) + 6) + if s % 2 = 1 then 1 else 0 finishC3 (decide (s1 % 2 = 1)) (3 * (s1 / 2) + 9) 1 - def highLevelNext : HighLevelState → Option HighLevelState | .C3_0 r c => let p := syracuseScan r 0 (c / 2); finishC3 p.1 p.2 (c % 2) | .C3_12 c => let p := syracuseScan false 12 (c / 2); finishC3 p.1 p.2 (c % 2) | .C6_0 r c => let p := syracuseScan r 0 (c / 2); finishC6 p.1 p.2 (c % 2) | .C6_12 c => let p := syracuseScan false 12 (c / 2); finishC6 p.1 p.2 (c % 2) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB1LA_1LC0RE_1LF1LD_1RE0LC_1LB1RA_HHH0LA - namespace M_1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RBHHH def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RB---" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_61 : TapePattern (Fin 2) (Fin 6) := { left := .sym 1 (.rep [1] 0 .default) head := some B right := .sym 1 (.sym 1 (.sym 1 (.rep [1] 1 (.sym 0 (.sym 1 .default))))) } - def pat_270 : TapePattern (Fin 2) (Fin 6) := { left := .sym 1 (.rep [1] 0 .default) head := some D right := .sym 1 (.sym 1 (.sym 0 (.rep [1, 0] 1 (.sym 1 (.sym 1 (.sym 1 (.rep [1] 2 (.sym 0 (.sym 1 .default))))))))) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_61, .true), (pat_270, .true)] - inductive State where /-- $P_{61}(a, c) := 0^\infty\,1^{a+1}\,\mathrm{B}{>}\,1^{c+3}\,01\,0^\infty$. -/ | P61 (a c : ℕ) /-- $P_{270}(a, b, c) := 0^\infty\,1^{a+1}\,\mathrm{D}{>}\,110\,(10)^b\,1^{c+3}\,01\,0^\infty$. -/ | P270 (a b c : ℕ) - def start : State := .P61 0 7 - def encode : State → Cfg (Fin 2) (Fin 6) | .P61 a c => Cfg.headRight B @@ -3638,7 +3175,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.cons 1 (ListBlank.cons 1 (ListBlank.cons 1 (ListBlank.append (([1] : List (Fin 2)) ^ c) (ListBlank.cons 0 (ListBlank.cons 1 default)))))))))) - def next : State → Option State | .P61 a 0 => some (.P61 0 (4 * a + 4 * (a / 2) + 15)) | .P61 a 1 => some (.P61 0 (2 * a + 11)) @@ -3655,24 +3191,18 @@ def next : State → Option State | .P270 1 b (c + 3) => some (.P61 (2 * b + 10) c) | .P270 (_ + 2) _ 3 => none | .P270 (a + 2) b (c + 4) => some (.P270 a (b + 3) c) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | P (c : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .P 7 - def toState : HighLevelState → State | .P c => .P61 0 c - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def drainP (a c : ℕ) : Option HighLevelState := if c = 0 then some (.P (4 * a + 4 * (a / 2) + 15)) else if c = 1 then some (.P (2 * a + 11)) @@ -3700,49 +3230,36 @@ def drainP (a c : ℕ) : Option HighLevelState := termination_by c decreasing_by all_goals exact Nat.lt_of_le_of_lt (Nat.le_trans (Nat.sub_le _ _) (Nat.sub_le _ _)) (by omega) - def highLevelNext : HighLevelState → Option HighLevelState | .P c => drainP 0 c - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry - +theorem is_not_halt : IsNotHalt target := by sorry end M_1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RBHHH - namespace M_1RB1LC_1LC1RD_1LA0LB_0RB1RE_1RF0RA_HHH0RC def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LC_1LC1RD_1LA0LB_0RB1RE_1RF0RA_---0RC" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_B : TapePattern (Fin 2) (Fin 6) := { left := .rep [0, 1] 1 (.rep [1] 0 .default) head := some B right := .rep [1] 2 .default } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_B, .true)] - inductive State where /-- $B(a, k, c) := 0^\infty\,1^a\,(10)^k\,\mathrm{B}{>}\,1^c\,0^\infty$. -/ | B (a k c : ℕ) - def start : State := .B 5 0 1 - def encode : State → Cfg (Fin 2) (Fin 6) | .B a k c => Cfg.headRight SixState.B (ListBlank.append (([0, 1] : List (Fin 2)) ^ k) (ListBlank.append (([1] : List (Fin 2)) ^ a) default)) (ListBlank.append (([1] : List (Fin 2)) ^ c) default) - def next : State → Option State | .B a k 1 => some (.B a (k + 1) 0) | .B _ _ 2 => none @@ -3755,34 +3272,25 @@ def next : State → Option State if k % 2 = 0 then some (.B (4 * (k / 2) + 2) 2 (d + 1)) else some (.B (4 * (k / 2) + 5) 0 (d + 4)) | .B (a + 1) k (d + 4) => some (.B a (k + 1) (d + 3)) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB1LC_1LC1RD_1LA0LB_0RB1RE_1RF0RA_HHH0RC - namespace M_1RB1LC_1RC0LD_1LA0RB_1LB1LE_1RF0LA_HHH0RE def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LC_1RC0LD_1LA0RB_1LB1LE_1RF0LA_---0RE" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_B2 : TapePattern (Fin 2) (Fin 6) := { left := .sym 0 (.sym 1 (.rep [0, 1] 0 (.sym 1 (.sym 1 (.rep [0, 1] 1 .default))))) head := some B right := .sym 1 (.rep [1] 2 .default) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_B2, .true)] - inductive State where /-- $B_2(a, b, c) := 0^\infty\,(10)^b\,11\,(10)^{a+1}\,\mathrm{B}{>}\,1^{c+1}\,0^\infty$. -/ | B2 (a b c : ℕ) - def start : State := .B2 0 1 2 - def encode : State → Cfg (Fin 2) (Fin 6) | .B2 a b c => Cfg.headRight B @@ -3791,7 +3299,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.cons 1 (ListBlank.cons 1 (ListBlank.append (([0, 1] : List (Fin 2)) ^ b) default)))))) (ListBlank.cons 1 (ListBlank.append (([1] : List (Fin 2)) ^ c) default)) - def next : State → Option State | .B2 0 b 0 => some (.B2 0 1 (2 * b + 10)) | .B2 (a + 1) b 0 => some (.B2 a b 1) @@ -3802,25 +3309,19 @@ def next : State → Option State | .B2 a 0 5 => some (.B2 0 1 (2 * a + 16)) | .B2 a 0 (c + 6) => some (.B2 0 (a + 4) c) | .B2 a (b + 1) (c + 2) => some (.B2 (a + 2) b c) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB1LC_1RC0LD_1LA0RB_1LB1LE_1RF0LA_HHH0RE - namespace M_1RB1LC_1RC0RF_1RD0LB_1RE0LD_1LFHHH_0RA1LA def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LC_1RC0RF_1RD0LB_1RE0LD_1LF---_0RA1LA" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_Master : TapePattern (Fin 2) (Fin 6) := { left := .rep [0, 0, 1] 1 (.rep [1] 2 (.rep [0, 0, 1, 1] 0 .default)) head := some A right := .default } - def cond_Master : VarCond := .or (.and (.ge_const 1 1) (.and (.not (.ge_const 1 2)) (.not (.ge_const 2 1)))) (.or (.and (.ge_const 1 2) (.and (.not (.ge_const 1 3)) (.not (.ge_const 2 1)))) @@ -3830,36 +3331,24 @@ def cond_Master : VarCond := (.ge_const 2 4))))) (.and (.ge_const 1 3) (.and (.not (.ge_const 1 4)) (.and (.ge_const 2 5) (.not (.ge_const 2 6)))))))) - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_Master, cond_Master)] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry - theorem has_collatz_reduction : HasCollatzReduction target := by sorry - /-! ### Level B: accelerated state machine -/ - /-- Left stack block `[0, 0, 1, 1]` (representing `1100` from left to right on the tape). -/ abbrev U4 : List (Fin 2) := [0, 0, 1, 1] - /-- Canonical left tape `LA a := [0, 0, 1, 1] ^ a` (blank beyond). -/ def LA (a : Nat) : ListBlank (Fin 2) := ListBlank.append (U4 ^ a) default - def R1_cfg (n : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight A (ListBlank.append [0, 0, 1] (LA n)) default - def R2_cfg (n : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight A (ListBlank.append [0, 0, 1, 0, 0, 1] (LA n)) default - def Q_cfg (n : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight A (ListBlank.append [0, 0, 1, 1, 1, 1] (LA n)) default - def S4_cfg (n : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight A (ListBlank.append [0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1] (LA n)) default - def S6_cfg (n : Nat) : Cfg (Fin 2) (Fin 6) := Cfg.headRight A (ListBlank.append [0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1] (LA n)) default - inductive State where /-- $R_1(n) := 0^\infty\,(1100)^n\,100\,\mathrm{A}{>}\,0^\infty$. -/ | R1 (n : ℕ) @@ -3871,39 +3360,32 @@ inductive State where | S4 (n : ℕ) /-- $S_6(n) := 0^\infty\,(1100)^n\,11111100100100\,\mathrm{A}{>}\,0^\infty$. -/ | S6 (n : ℕ) - def start : State := .S6 1 - def encode : State → Cfg (Fin 2) (Fin 6) | .R1 n => R1_cfg n | .R2 n => R2_cfg n | .Q n => Q_cfg n | .S4 n => S4_cfg n | .S6 n => S6_cfg n - /-- `P_cfg n` (`LA n {{A}}> default`): `P 0 ↦ S6 1`, `P 1 ↦ S4 0`, `P (n + 2) ↦ S6 n`. -/ def next_P (n : ℕ) : Option State := Nat.casesOn n (some (.S6 1)) fun n => Nat.casesOn n (some (.S4 0)) fun n' => some (.S6 n') - /-- `R1 0 ↦ R1 4`, `R1 1 ↦ R1 6`, `R1 (n + 2) ↦ R1 (n + 7)`. -/ def next_R1 (n : ℕ) : Option State := Nat.casesOn n (some (.R1 4)) fun n => Nat.casesOn n (some (.R1 6)) fun n' => some (.R1 (n' + 7)) - /-- `T1_cfg n`: `T1 0 ↦ R1 7`, `T1 (n + 1) ↦ R1 (n + 8)`. -/ def next_T1 (n : ℕ) : Option State := Nat.casesOn n (some (.R1 7)) fun n' => some (.R1 (n' + 8)) - /-- `R3_cfg n`: `R3 0 ↦ T1 4`, `R3 1 ↦ T1 6`, `R3 (n + 2) ↦ T1 (n + 7)`. -/ def next_R3 (n : ℕ) : Option State := Nat.casesOn n (next_T1 4) fun n => Nat.casesOn n (next_T1 6) fun n' => next_T1 (n' + 7) - /-- `HubTail (a + 7) w r_R2`: consume `W8` blocks five at a time (`a ↦ a + 31`), branching on the remainder `w mod 5`. -/ def next_HubTail_r_R2 : ℕ → ℕ → Option State @@ -3913,7 +3395,6 @@ def next_HubTail_r_R2 : ℕ → ℕ → Option State | a, 3 => some (.R2 (a + 26)) | a, 4 => next_R3 (a + 32) | a, w' + 5 => next_HubTail_r_R2 (a + 31) w' - /-- `HubTail (a + 7) w r_3`; the remainder `w = 3` halts. -/ def next_HubTail_r_3 : ℕ → ℕ → Option State | a, 0 => some (.R1 (a + 10)) @@ -3922,7 +3403,6 @@ def next_HubTail_r_3 : ℕ → ℕ → Option State | _, 3 => none | a, 4 => some (.R2 (a + 37)) | a, w' + 5 => next_HubTail_r_3 (a + 31) w' - /-- `HubTail (a + 7) w r_4`. -/ def next_HubTail_r_4 : ℕ → ℕ → Option State | a, 0 => next_T1 (a + 9) @@ -3931,7 +3411,6 @@ def next_HubTail_r_4 : ℕ → ℕ → Option State | a, 3 => some (.S6 (a + 28)) | a, 4 => some (.R2 (a + 41)) | a, w' + 5 => next_HubTail_r_4 (a + 31) w' - /-- `HubTail (a + 7) w r_5`. -/ def next_HubTail_r_5 : ℕ → ℕ → Option State | a, 0 => some (.R1 (a + 12)) @@ -3940,7 +3419,6 @@ def next_HubTail_r_5 : ℕ → ℕ → Option State | a, 3 => some (.Q (a + 34)) | a, 4 => next_T1 (a + 38) | a, w' + 5 => next_HubTail_r_5 (a + 31) w' - /-- Successor maps of the seven `Scan` prefixes `p0`, `p001010`, `p0010`, `p0010110`, `p00`, `p010`, `pnil`, each as a function of the offset `a` of `LA (a + 4)`, together with the two carry components `p0_next`/`p0010_next` giving the `p0`/`p0010` successor maps one `B4` block further @@ -3955,7 +3433,6 @@ structure NextScanBundle where pnil : ℕ → Option State p0_next : ℕ → Option State p0010_next : ℕ → Option State - /-- `HubW8 (a + 7) w b rend`: consume `W8` blocks five at a time, then hand over to the `Scan` prefix selected by the remainder `w mod 5`. -/ def next_HubW8 (nb : NextScanBundle) : ℕ → ℕ → Option State @@ -3965,7 +3442,6 @@ def next_HubW8 (nb : NextScanBundle) : ℕ → ℕ → Option State | a, 3 => nb.p0010 (a + 22) | a, 4 => nb.p001010 (a + 28) | a, w' + 5 => next_HubW8 nb (a + 31) w' - /-- `Scan (a + 4) b pfx r_Q` successor maps, by recursion on the number `b` of `B4` blocks. -/ def next_ScanBundle_r_Q (b : ℕ) : NextScanBundle := Nat.rec @@ -3989,7 +3465,6 @@ def next_ScanBundle_r_Q (b : ℕ) : NextScanBundle := p0_next := fun a => next_HubW8 nb 0 ((a + 3) / 2) p0010_next := fun a => nb.p0010110 (a + 5) }) b - /-- `Scan (a + 4) b pfx r_S6` successor maps; the prefix `p0010110` with `b = 0` halts. -/ def next_ScanBundle_r_S6 (b : ℕ) : NextScanBundle := Nat.rec @@ -4013,7 +3488,6 @@ def next_ScanBundle_r_S6 (b : ℕ) : NextScanBundle := p0_next := fun a => next_HubW8 nb 0 ((a + 3) / 2) p0010_next := fun a => nb.p0010110 (a + 5) }) b - /-- `Scan (a + 4) b pfx r_S4` successor maps. -/ def next_ScanBundle_r_S4 (b : ℕ) : NextScanBundle := Nat.rec @@ -4037,29 +3511,24 @@ def next_ScanBundle_r_S4 (b : ℕ) : NextScanBundle := p0_next := fun a => next_HubW8 nb 0 ((a + 3) / 2) p0010_next := fun a => nb.p0010110 (a + 5) }) b - /-- `R2 0 ↦ R1 4`; `R2 (n + 1)` drains `n` stack blocks in pairs into `HubTail 7 (n / 2) r_R2`. -/ def next_R2 (n : ℕ) : Option State := Nat.casesOn n (some (.R1 4)) fun n' => next_HubTail_r_R2 0 (n' / 2) - /-- `Q 0 ↦ R1 6`; `Q (n + 1)` sweeps into `Scan 6 n p0010110 r_Q`. -/ def next_Q (n : ℕ) : Option State := Nat.casesOn n (some (.R1 6)) fun n' => (next_ScanBundle_r_Q n').p0010110 2 - /-- `S4 0 ↦ R1 10`; `S4 (n + 1)` sweeps into `Scan 6 n p0010110 r_S4`. -/ def next_S4 (n : ℕ) : Option State := Nat.casesOn n (some (.R1 10)) fun n' => (next_ScanBundle_r_S4 n').p0010110 2 - /-- `S6 0 ↦ R1 9`; `S6 1` drains into `HubTail 7 2 r_3`; `S6 (n + 2)` sweeps into `Scan 6 n p0010110 r_S6`. -/ def next_S6 (n : ℕ) : Option State := Nat.casesOn n (some (.R1 9)) fun n => Nat.casesOn n (next_HubTail_r_3 0 2) fun n' => (next_ScanBundle_r_S6 n').p0010110 2 - /-- The accelerated Collatz-like transition function on the five core families. -/ def next : State → Option State | .R1 n => next_R1 n @@ -4067,46 +3536,32 @@ def next : State → Option State | .Q n => next_Q n | .S4 n => next_S4 n | .S6 n => next_S6 n - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry abbrev HighLevelState := State - def highLevelStart : HighLevelState := start - def highLevelEncode : HighLevelState → Cfg (Fin 2) (Fin 6) := encode - def highLevelNext : HighLevelState → Option HighLevelState := next - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB1LC_1RC0RF_1RD0LB_1RE0LD_1LFHHH_0RA1LA - namespace M_1RB1LD_1RC0RA_1LA1RE_0LA0LB_0RB1RF_HHH1RD def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LD_1RC0RA_1LA1RE_0LA0LB_0RB1RF_---1RD" abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB - def ps : TapePatternSet (Fin 2) (Fin 6) := [({ left := .rep [0, 1] 1 (.rep [1] 0 .default) head := some SixState.A right := .rep [0, 1] 2 (.rep [1] 3 .default) }, .true)] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry - inductive State where | A (a b c d : ℕ) - def start : State := .A 0 0 0 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .A a b c d => Cfg.headRight SixState.A @@ -4114,7 +3569,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append (([1] : List (Fin 2)) ^ a) default)) (ListBlank.append (([0, 1] : List (Fin 2)) ^ c) (ListBlank.append (([1] : List (Fin 2)) ^ d) default)) - def next : State → Option State | .A a b (c + 1) d => some (.A a (b + 1) c d) | .A a b 0 0 => some (.A (a + 1) 0 0 (2 * b + 2)) @@ -4130,21 +3584,16 @@ def next : State → Option State else if d = b + 1 then some (.A (3 * b + 2) 0 0 6) else if d = b + 2 then some (.A (3 * b + 4) 0 0 4) else some (.A (3 * b + 3) 2 0 (d - b - 3)) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry inductive HighLevelState where | C (b d : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .C 0 0 - def toState : HighLevelState → State | .C b d => .A 0 b 0 d - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def drainA (a b d : ℕ) : HighLevelState := if a = 0 then .C b d else if a = 1 then @@ -4160,7 +3609,6 @@ def drainA (a b d : ℕ) : HighLevelState := drainA (a1 - 3 * k) (b1 + 2 * k) (d1 - k) termination_by a decreasing_by omega - def highLevelNext : HighLevelState → Option HighLevelState | .C b 0 => some (.C 0 (2 * b + 4)) | .C 0 1 => some (.C 2 5) @@ -4171,45 +3619,33 @@ def highLevelNext : HighLevelState → Option HighLevelState else if d = b + 1 then some (drainA (3 * b + 2) 0 6) else if d = b + 2 then some (drainA (3 * b + 4) 0 4) else some (drainA (3 * b + 3) 2 (d - b - 3)) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB1LD_1RC0RA_1LA1RE_0LA0LB_0RB1RF_HHH1RD - namespace M_1RB1LD_1RC1RE_0LA1LB_0LD1LC_1RF0RA_HHH0RC def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LD_1RC1RE_0LA1LB_0LD1LC_1RF0RA_---0RC" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_Q : TapePattern (Fin 2) (Fin 6) := { left := .default head := some D right := .rep [1, 0] 0 (.rep [1, 1, 0] 1 (.sym 1 (.sym 1 .default))) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_Q, .true)] - inductive State where /-- $Q(a, c) := 0^\infty\,\mathrm{D}{>}\,(10)^a\,(110)^c\,11\,0^\infty$. -/ | Q (a c : ℕ) - def start : State := .Q 0 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .Q a c => Cfg.headRight SixState.D default (ListBlank.append (([1, 0] : List (Fin 2)) ^ a) (ListBlank.append (([1, 1, 0] : List (Fin 2)) ^ c) (ListBlank.append [1, 1] default))) - def next : State → Option State | .Q a c => if a % 3 = 1 then @@ -4226,28 +3662,21 @@ def next : State → Option State some (.Q (12 * (a / 9) + 6) 1) else none - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB1LD_1RC1RE_0LA1LB_0LD1LC_1RF0RA_HHH0RC - namespace M_1RB1LE_1LB1LC_1RD0LE_HHH0RB_1RF1LA_0RA0RD def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LE_1LB1LC_1RD0LE_---0RB_1RF1LA_0RA0RD" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_E : TapePattern (Fin 2) (Fin 6) := { left := .default head := some E right := .sym 0 (.rep [0] 0 (.rep [1] 1 (.sym 0 (.rep [1] 2 (.sym 0 (.rep [1] 3 .default)))))) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_E, .not (.ge_const 0 2))] - inductive State where /-- Canonical hub configuration $E(q, a, b, c) := 0^\infty\,\mathrm{E}{>}\,0\,0^q\,1^a\,0\,1^b\,0\,1^c\,0^\infty$ @@ -4256,9 +3685,7 @@ inductive State where /-- Even-block right-sweep configuration $F(d, 2k, b, c) := 0^\infty\,1^{d+1}\,\mathrm{F}{>}\,1^{2k}\,0\,1^b\,0\,1^c\,0^\infty$. -/ | F_even (d k b c : ℕ) - def start : State := .E true 3 0 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .E q a b c => Cfg.headRight SixState.E default @@ -4277,10 +3704,8 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append (([1] : List (Fin 2)) ^ b) (ListBlank.append [0] (ListBlank.append (([1] : List (Fin 2)) ^ c) default))))) - def mkE (m b c : ℕ) : State := .E (decide (m % 2 = 1)) m b c - def enterF_d0 (a b c : ℕ) : Option State := if a % 2 = 0 then some (.F_even 0 (a / 2) b c) @@ -4290,7 +3715,6 @@ def enterF_d0 (a b c : ℕ) : Option State := some (mkE (b + 2) (c + 3) 0) else none - def enterF_d1 (a b c : ℕ) : Option State := if a % 2 = 0 then some (.F_even 1 (a / 2) b c) @@ -4300,7 +3724,6 @@ def enterF_d1 (a b c : ℕ) : Option State := some (mkE (b + 3) (c + 3) 0) else some (.E true (a - 2) (b + 6) c) - def enterF_c0 (d a b : ℕ) : Option State := if a % 2 = 0 then some (.F_even d (a / 2) b 0) @@ -4310,7 +3733,6 @@ def enterF_c0 (d a b : ℕ) : Option State := some (mkE (d + b + 2) 3 0) else some (mkE (d + 1) (a - 4) (b + 3)) - def next : State → Option State | .E false a b c => enterF_d0 a b c | .E true 0 0 0 => none @@ -4324,24 +3746,18 @@ def next : State → Option State | .F_even 1 1 b c => some (.E true (b + 4) c 0) | .F_even (d + 2) 1 b c => some (mkE (d + 1) (b + 4) c) | .F_even d (k + 2) b c => some (.F_even (d + 1) k (b + 3) c) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | E (a b c : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .E 3 0 0 - def toState : HighLevelState → State | .E a b c => mkE a b c - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def evalFGe2 (d k b c : ℕ) : Option HighLevelState := if k = 0 then if b = 0 then @@ -4357,7 +3773,6 @@ def evalFGe2 (d k b c : ℕ) : Option HighLevelState := evalFGe2 (d + 1) (k - 2) (b + 3) c termination_by 5 * k + 3 * b + 4 * c decreasing_by all_goals omega - def evalF1 (k b c : ℕ) : Option HighLevelState := if k = 0 then if b = 0 then @@ -4372,7 +3787,6 @@ def evalF1 (k b c : ℕ) : Option HighLevelState := else evalFGe2 0 (b / 2) (c + 3) 0 else evalFGe2 0 (k - 2) (b + 3) c - def evalF0 (k b c : ℕ) : Option HighLevelState := if k = 0 then if b = 0 then @@ -4386,47 +3800,34 @@ def evalF0 (k b c : ℕ) : Option HighLevelState := some (.E (b + 2) (c + 3) 0) else evalF1 (k - 2) (b + 3) c - def highLevelNext : HighLevelState → Option HighLevelState | .E a b c => if a % 2 = 0 then evalF0 (a / 2) b c else if a = 1 then none else some (.E (b + 3 * a - 6) (c + 3) 0) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry - end M_1RB1LE_1LB1LC_1RD0LE_HHH0RB_1RF1LA_0RA0RD - namespace M_1RB1LE_1LC0RA_0RF0LD_1LE1LA_1RC0LB_HHH1RC def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LE_1LC0RA_0RF0LD_1LE1LA_1RC0LB_---1RC" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_A : TapePattern (Fin 2) (Fin 6) := { left := .default head := some C right := .sym 0 (.rep [1, 0] 0 (.sym 1 (.sym 1 (.sym 0 (.rep [1, 0] 1 .default))))) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_A, .true)] - inductive State where /-- $A(a, b) := 0^\infty\,{<}\mathrm{C}\,(10)^a\,110\,(10)^b\,0^\infty$. -/ | A (a b : ℕ) /-- $B(a, b, c) := 0^\infty\,{<}\mathrm{C}\,(10)^a\,110\,(10)^b\,110\,(1010)^c\,0^\infty$. -/ | B (a b c : ℕ) - def start : State := .A 2 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .A a b => Cfg.headRight SixState.C default @@ -4449,7 +3850,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.cons 0 (ListBlank.append (([1, 0, 1, 0] : List (Fin 2)) ^ c) default)))))))))) - def next : State → Option State | .A a b => if a < b then @@ -4467,31 +3867,24 @@ def next : State → Option State some (.A 2 (4 * a + 2 * c + 6)) else some (.A 2 (2 * a + 2 * c + 2)) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | A (k b : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .A 0 0 - def toState : HighLevelState → State | .A k b => .A (2 * k + 2) b - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def evalB (a b c : ℕ) : HighLevelState := if a < b then evalB (2 * a + 2) (b - a - 1) c else if a = b then .A 0 (4 * a + 2 * c + 6) else .A 0 (2 * a + 2 * c + 2) termination_by b decreasing_by omega - def drainA (k b : ℕ) : Option HighLevelState := let a := 2 * k + 2 if a < b then drainA (2 * k + 2) (b - a - 1) @@ -4502,54 +3895,40 @@ def drainA (k b : ℕ) : Option HighLevelState := some (evalB 2 (2 * ((a - b - 1) / 2) + 1) (b + 1)) termination_by b decreasing_by omega - def highLevelNext : HighLevelState → Option HighLevelState | .A k b => drainA k b - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry - end M_1RB1LE_1LC0RA_0RF0LD_1LE1LA_1RC0LB_HHH1RC - namespace M_1RB1LE_1RC1RA_0LD1RB_1LE1LD_1RF0LA_HHH0RE def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LE_1RC1RA_0LD1RB_1LE1LD_1RF0LA_---0RE" abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB - def pat_D : TapePattern (Fin 2) (Fin 6) := { left := .sym 1 (.sym 1 (.rep [1, 1] 0 (.rep [0, 1] 1 .default))) head := some D right := .sym 1 (.rep [1] 2 .default) } - def pat_E : TapePattern (Fin 2) (Fin 6) := { left := .sym 1 (.sym 1 (.rep [1, 1] 0 (.rep [0, 1] 1 .default))) head := some E right := .sym 1 (.rep [1] 2 .default) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_D, .true), (pat_E, .true)] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry - inductive State where | D (a b c : ℕ) | E (a b c : ℕ) - def start : State := .D 1 0 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .D a b c => evalTapePattern pat_D fun k => match k with | 0 => a | 1 => b | 2 => c | _ => 0 | .E a b c => evalTapePattern pat_E fun k => match k with | 0 => a | 1 => b | 2 => c | _ => 0 - def next : State → Option State | .D (a + 1) b c => some (.D a b (c + 2)) | .D 0 0 0 => some (.D 2 0 0) @@ -4572,22 +3951,17 @@ def next : State → Option State | .E a (b + 1) 1 => some (.D (a + 2) b 0) | .E a (b + 1) 2 => some (.D (a + 3) b 0) | .E a (b + 1) (c + 3) => some (.E (a + 2) b (c + 1)) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry inductive HighLevelState where /-- $E(b, d) := 0^\infty\,(10)^b\,1111\,\mathrm{E}{>}\,1^{d+2}\,0^\infty$. -/ | E (b d : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .E 0 1 - def toState : HighLevelState → State | .E b d => .E 1 b (d + 1) - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def highLevelNext : HighLevelState → Option HighLevelState | .E b d => let c := d + 1 @@ -4602,39 +3976,29 @@ def highLevelNext : HighLevelState → Option HighLevelState else if rem = 3 then none else if rem ≤ 6 then some (.E (2 * b + 2) (2 * rem - 7)) else some (.E (2 * b + 4) (rem - 7)) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB1LE_1RC1RA_0LD1RB_1LE1LD_1RF0LA_HHH0RE - namespace M_1RB1LF_0RC1RD_1LA1LD_1LE0RA_HHH1LC_0LA1LA def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LF_0RC1RD_1LA1LD_1LE0RA_---1LC_0LA1LA" abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB - def pat_C : TapePattern (Fin 2) (Fin 6) := { left := .sym 0 (.sym 1 (.sym 1 .default)) head := some A right := .rep [1, 1] 0 (.sym 0 (.rep [1] 1 .default)) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_C, .ge_const 1 6)] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry - inductive State where | C (a b : ℕ) | M_3 (a c d : ℕ) | M_4 (a b c d : ℕ) - def start : State := .C 0 3 - def encode : State → Cfg (Fin 2) (Fin 6) | .C a b => Cfg.headRight SixState.A @@ -4654,7 +4018,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append (([1, 1] : List (Fin 2)) ^ b) (ListBlank.append [0, 1] (ListBlank.append (([1, 1] : List (Fin 2)) ^ c) (ListBlank.append [0] (ListBlank.append (([1] : List (Fin 2)) ^ d) default))))) - def next : State → Option State | .C 0 b => if b % 2 = 0 then some (.C (b / 2 + 1) 3) @@ -4672,23 +4035,18 @@ def next : State → Option State | .M_4 (a + 1) 1 0 d => some (.C (a + 1) (d + 6)) | .M_4 a (b + 2) 0 d => some (.M_3 a b (d + 9)) | .M_4 a (b + 1) (c + 1) d => some (.M_4 a b c (d + 6)) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry inductive HighLevelState where /-- `.C a b` encodes $C(a, b + 6) := 0^\infty\,110\,\mathrm{A}{>}\,(11)^a\,0\,1^{b+6}\,0^\infty$. -/ | C (a b : ℕ) - /-- Initial state `.C 0 3`, encoding $C(0, 9) = 0^\infty\,110\,\mathrm{A}{>}\,0\,1^9\,0^\infty$. -/ def highLevelStart : HighLevelState := .C 0 3 - def toState : HighLevelState → State | .C a b => .C a b - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def highLevelNext : HighLevelState → Option HighLevelState | .C 0 b => if b % 2 = 0 then some (.C (b / 2 + 1) 3) @@ -4704,57 +4062,44 @@ def highLevelNext : HighLevelState → Option HighLevelState if k > a then some (.C (k - a) (6 * a + 6)) else if a ≤ k + 1 then none else some (.C (a - k - 1) (6 * k + 9)) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB1LF_0RC1RD_1LA1LD_1LE0RA_HHH1LC_0LA1LA - namespace M_1RB1LF_1RC1RF_0LD1RE_HHH1LC_0RB1RE_1LA0LE def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LF_1RC1RF_0LD1RE_---1LC_0RB1RE_1LA0LE" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB abbrev left_bcd (b c d : ℕ) : ListBlank (Fin 2) := ListBlank.append (([1] : List (Fin 2)) ^ b) (ListBlank.append (([0, 1] : List (Fin 2)) ^ c) (ListBlank.append (([1] : List (Fin 2)) ^ d) default)) - def pat_C : TapePattern (Fin 2) (Fin 6) := { left := .rep [1] 1 (.rep [0, 1] 2 (.rep [1] 3 .default)) head := some C right := .sym 1 (.sym 1 (.sym 0 (.rep [1, 0] 0 (.sym 1 .default)))) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_C, .true)] - def cfg_C (a b c d : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight C (left_bcd b c d) (ListBlank.cons 1 (ListBlank.cons 1 (ListBlank.cons 0 (ListBlank.append (([1, 0] : List (Fin 2)) ^ a) (ListBlank.cons 1 default))))) - def cfg_8 (a u b c d : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight A (ListBlank.cons 0 (ListBlank.append (([1, 0] : List (Fin 2)) ^ u) (ListBlank.cons 1 (left_bcd b c d)))) (ListBlank.cons 1 (ListBlank.cons 1 (ListBlank.cons 1 (ListBlank.cons 1 (ListBlank.append (([1, 1] : List (Fin 2)) ^ a) default))))) - def cfg_57 (a u b c d : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight A (ListBlank.cons 0 (ListBlank.append (([1, 0] : List (Fin 2)) ^ u) (ListBlank.cons 1 (left_bcd b c d)))) (ListBlank.cons 1 (ListBlank.cons 1 (ListBlank.cons 1 (ListBlank.append (([1, 1] : List (Fin 2)) ^ a) default)))) - def cfg_89 (a k b c d : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight E (left_bcd b c d) (ListBlank.cons 1 (ListBlank.cons 1 (ListBlank.cons 1 @@ -4762,7 +4107,6 @@ def cfg_89 (a k b c d : ℕ) : Cfg (Fin 2) (Fin 6) := (ListBlank.cons 1 (ListBlank.cons 0 (ListBlank.append (([1, 0] : List (Fin 2)) ^ k) (ListBlank.cons 1 default)))))))) - def cfg_101 (a k u b c d : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight E (ListBlank.cons 1 (ListBlank.cons 0 @@ -4773,7 +4117,6 @@ def cfg_101 (a k u b c d : ℕ) : Cfg (Fin 2) (Fin 6) := (ListBlank.cons 1 (ListBlank.cons 0 (ListBlank.append (([1, 0] : List (Fin 2)) ^ k) (ListBlank.cons 1 default)))))))) - inductive State where /-- $C(a, b, c, d) := 0^\infty\,1^d\,(10)^c\,1^b\,\mathrm{C}{>}\,110\,(10)^a\,1\,0^\infty$. -/ | C (a b c d : ℕ) @@ -4787,16 +4130,13 @@ inductive State where /-- $R(a, b, c, d) := 0^\infty\,1^d\,(10)^c\,1^{b+1}\,0\,\mathrm{A}{>}\,1111\,(11)^a\,0^\infty$. -/ | R (a b c d : ℕ) - def start : State := .C 0 3 0 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .C a b c d => cfg_C a b c d | .W k b c d => cfg_89 0 k b c d | .M k u b c d => cfg_101 0 k u b c d | .S a b c d => cfg_57 a 0 b c d | .R a b c d => cfg_8 a 0 b c d - def next : State → Option State | .C 0 0 0 0 => some (.C 0 3 0 0) | .C 1 0 0 0 => some (.S 0 1 0 0) @@ -4845,26 +4185,20 @@ def next : State → Option State | .R _ 2 _ 0 => none | .R a 2 c (d + 1) => some (.C (a + c + 3) d 0 0) | .R a (b + 3) c d => some (.C (a + 3) b c d) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | C0 (a b : ℕ) | C1 (a b c : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .C0 0 3 - def toState : HighLevelState → State | .C0 a b => .C a b 0 0 | .C1 a b c => .C a b c 1 - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def evalR (a b c : ℕ) (d1 : Bool) : Option HighLevelState := if b = 0 then if !d1 then some (.C0 0 (2 * a + 7)) @@ -4879,7 +4213,6 @@ def evalR (a b c : ℕ) (d1 : Bool) : Option HighLevelState := else if !d1 then some (.C0 (a + 3) (b - 3)) else some (.C1 (a + 3) (b - 3) c) - def evalS (a b c : ℕ) (d1 : Bool) : Option HighLevelState := if b = 0 then if !d1 then some (.C0 (a + 2) 0) @@ -4890,7 +4223,6 @@ def evalS (a b c : ℕ) (d1 : Bool) : Option HighLevelState := else some (.C1 0 (2 * a + 4) c) else evalR (a + 1) (b - 2) c d1 - def evalM (k u b c : ℕ) (d1 : Bool) : Option HighLevelState := if k = 0 then evalS (u + 2) b c d1 @@ -4923,7 +4255,6 @@ def evalM (k u b c : ℕ) (d1 : Bool) : Option HighLevelState := evalM k' (u + 2) (b - 2) c d1 termination_by k decreasing_by all_goals omega - def evalW (k b c : ℕ) (d1 : Bool) : Option HighLevelState := if k = 0 then if d1 then some (.C1 2 b c) else some (.C0 2 b) @@ -4931,7 +4262,6 @@ def evalW (k b c : ℕ) (d1 : Bool) : Option HighLevelState := evalS 0 (b + 3) c d1 else evalM (k - 2) 0 (b + 1) c d1 - def evalCPos (a b c : ℕ) (d1 : Bool) : Option HighLevelState := if b = 0 then if d1 && c == 0 then @@ -4943,7 +4273,6 @@ def evalCPos (a b c : ℕ) (d1 : Bool) : Option HighLevelState := else if a = 1 then evalS 0 (b + 1) c d1 else evalM (a - 2) 0 (b - 1) c d1 - def highLevelNext : HighLevelState → Option HighLevelState | .C0 a b => if a = 0 then @@ -4963,46 +4292,32 @@ def highLevelNext : HighLevelState → Option HighLevelState evalCPos 2 (b - 2) c true else evalCPos a b c true - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry - end M_1RB1LF_1RC1RF_0LD1RE_HHH1LC_0RB1RE_1LA0LE - namespace M_1RB1RA_0LC0RE_1LF1LD_1LA0LA_1LC1RB_HHH1LC def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RA_0LC0RE_1LF1LD_1LA0LA_1LC1RB_---1LC" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_A : TapePattern (Fin 2) (Fin 6) := { left := .rep [1, 1] 1 (.rep [0, 1] 0 .default) head := some C right := .rep [1, 1] 2 (.rep [1, 0] 3 (.sym 1 (.sym 1 (.sym 1 (.sym 1 .default))))) } def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_A, .true)] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry - theorem has_collatz_reduction : HasCollatzReduction target := by sorry - inductive State /-- $C(a, k, d, c) := 0^\infty\,(10)^a\,(11)^k\,\mathrm{C}{>}\,(11)^d\,(10)^c\,1111\,0^\infty$. -/ | mk (a k d c : ℕ) - def start : State := .mk 0 0 0 1 - def encode : State → Cfg (Fin 2) (Fin 6) | .mk a k d c => evalTapePattern pat_A fun i => if i = 0 then a else if i = 1 then k else if i = 2 then d else if i = 3 then c else 0 - def next : State → Option State | .mk a (k + 1) d (c + 1) => some (.mk a k (d + 2) c) | .mk a (k + 1) d 0 => some (.mk a (k + 1) 0 (d + 1)) @@ -5011,29 +4326,22 @@ def next : State → Option State | .mk (a + 1) 0 d 0 => some (.mk a (d + 2) 0 0) | .mk 0 0 d (c + 1) => some (.mk (d + 1) 0 0 (c + 1)) | .mk 0 0 _ 0 => none - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry inductive HighLevelState where | D (a c : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .D 0 1 - def toState : HighLevelState → State | .D a c => .mk a 0 0 c - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def evalK (k c : ℕ) : ℕ × ℕ := let c1 := max c 1 if c1 ≤ k then evalK (k - c1) (2 * c1 + 1) else (2 * k + 2, c1 - k - 1) termination_by k decreasing_by omega - def drainD (a d c : ℕ) : Option HighLevelState := if a = 0 then if c = 0 then none else some (.D (d + 1) c) @@ -5045,41 +4353,29 @@ def drainD (a d c : ℕ) : Option HighLevelState := drainD (a - 1) nextDC.1 nextDC.2 termination_by a decreasing_by omega - def highLevelNext : HighLevelState → Option HighLevelState | .D a c => drainD a 0 c - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB1RA_0LC0RE_1LF1LD_1LA0LA_1LC1RB_HHH1LC - namespace M_1RB1RA_0LC1LE_1LD1LC_1LA0LB_1LF1RE_HHH0RA def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RA_0LC1LE_1LD1LC_1LA0LB_1LF1RE_---0RA" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_P : TapePattern (Fin 2) (Fin 6) := { left := .rep [1] 1 (.sym 0 (.rep [1] 0 .default)) head := some F right := .sym 1 (.rep [1] 2 .default) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_P, .true)] - inductive State where /-- $P(a, b, c) := 0^\infty\,1^a\,0\,1^b\,\mathrm{F}{>}\,1\,1^c\,0^\infty$. -/ | P (a b c : ℕ) - def start : State := .P 0 3 1 - def encode : State → Cfg (Fin 2) (Fin 6) | .P a b c => Cfg.headRight SixState.F @@ -5087,7 +4383,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append [0] (ListBlank.append (([1] : List (Fin 2)) ^ a) default))) (ListBlank.append [1] (ListBlank.append (([1] : List (Fin 2)) ^ c) default)) - def next : State → Option State | .P 0 0 c => some (.P 0 (c + 3) 1) | .P (a + 1) 0 c => some (.P 0 (a + c + 7) 1) @@ -5095,45 +4390,35 @@ def next : State → Option State | .P 0 2 _ => none | .P (a + 1) 2 c => some (.P a (c + 4) 1) | .P a (b + 3) c => some (.P a (b + 1) (c + 3)) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB1RA_0LC1LE_1LD1LC_1LA0LB_1LF1RE_HHH0RA - namespace M_1RB1RA_0RC1RC_1LD0LF_0LE1LE_1RA0LB_HHH0LC def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RA_0RC1RC_1LD0LF_0LE1LE_1RA0LB_---0LC" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def cfg_D_base (a b : ℕ) (r : ListBlank (Fin 2)) : Cfg (Fin 2) (Fin 6) := Cfg.headRight D (ListBlank.append [1, 1] (ListBlank.append (([1, 1] : List (Fin 2)) ^ a) default)) (ListBlank.append [1, 1] (ListBlank.append (([1, 1] : List (Fin 2)) ^ b) r)) - def cfg_D7 (a b : ℕ) : Cfg (Fin 2) (Fin 6) := cfg_D_base a b (ListBlank.append [1] default) - def cfg_D74 (a b : ℕ) : Cfg (Fin 2) (Fin 6) := cfg_D_base a b (ListBlank.append [0, 1, 0, 1] default) - def cfg_D75 (a b c : ℕ) : Cfg (Fin 2) (Fin 6) := cfg_D_base a b (ListBlank.append [0, 0, 0] (ListBlank.append (([0, 0] : List (Fin 2)) ^ c) (ListBlank.append [1, 0, 1] default))) - def cfg_D76 (a b c : ℕ) : Cfg (Fin 2) (Fin 6) := cfg_D_base a b (ListBlank.append [0, 1, 1, 1] (ListBlank.append (([1, 1] : List (Fin 2)) ^ c) (ListBlank.append [0, 1] default))) - def cfg_D77 (a b c d : ℕ) : Cfg (Fin 2) (Fin 6) := cfg_D_base a b (ListBlank.append [0, 0, 0] @@ -5141,19 +4426,16 @@ def cfg_D77 (a b c d : ℕ) : Cfg (Fin 2) (Fin 6) := (ListBlank.append [1, 1, 1] (ListBlank.append (([1, 1] : List (Fin 2)) ^ d) (ListBlank.append [0, 1] default))))) - def cfg_D158 (a b c : ℕ) : Cfg (Fin 2) (Fin 6) := cfg_D_base a b (ListBlank.append [0, 1, 1] (ListBlank.append (([1, 1] : List (Fin 2)) ^ c) (ListBlank.append [0, 1] default))) - def cfg_D160 (a b c : ℕ) : Cfg (Fin 2) (Fin 6) := cfg_D_base a b (ListBlank.append [0, 1, 0, 0] (ListBlank.append (([0, 0] : List (Fin 2)) ^ c) (ListBlank.append [1, 0, 1] default))) - def cfg_D162 (a b c d : ℕ) : Cfg (Fin 2) (Fin 6) := cfg_D_base a b (ListBlank.append [0, 1, 0, 0] @@ -5161,13 +4443,11 @@ def cfg_D162 (a b c d : ℕ) : Cfg (Fin 2) (Fin 6) := (ListBlank.append [1, 1, 1] (ListBlank.append (([1, 1] : List (Fin 2)) ^ d) (ListBlank.append [0, 1] default))))) - def cfg_D230 (a b c : ℕ) : Cfg (Fin 2) (Fin 6) := cfg_D_base a b (ListBlank.append [0, 0] (ListBlank.append (([0, 0] : List (Fin 2)) ^ c) (ListBlank.append [1] default))) - def cfg_D231 (a b c d : ℕ) : Cfg (Fin 2) (Fin 6) := cfg_D_base a b (ListBlank.append [0, 0, 0] @@ -5175,13 +4455,11 @@ def cfg_D231 (a b c d : ℕ) : Cfg (Fin 2) (Fin 6) := (ListBlank.append [1, 1] (ListBlank.append (([1, 1] : List (Fin 2)) ^ d) (ListBlank.append [0, 1] default))))) - def cfg_D294 (a b c : ℕ) : Cfg (Fin 2) (Fin 6) := cfg_D_base a b (ListBlank.append [0, 1, 0, 0, 0] (ListBlank.append (([0, 0] : List (Fin 2)) ^ c) (ListBlank.append [1] default))) - def cfg_D296 (a b c d : ℕ) : Cfg (Fin 2) (Fin 6) := cfg_D_base a b (ListBlank.append [0, 1, 0, 0] @@ -5189,7 +4467,6 @@ def cfg_D296 (a b c d : ℕ) : Cfg (Fin 2) (Fin 6) := (ListBlank.append [1, 1] (ListBlank.append (([1, 1] : List (Fin 2)) ^ d) (ListBlank.append [0, 1] default))))) - def pat_A_right : TapeExpr (Fin 2) := .sym 1 (.sym 1 (.rep [1, 1] 1 @@ -5200,71 +4477,54 @@ def pat_A_right : TapeExpr (Fin 2) := (.rep [1] 6 (.rep [1, 1] 7 (.rep [0, 1] 8 .default))))))))) - def pat_A : TapePattern (Fin 2) (Fin 6) := { left := .sym 1 (.sym 1 (.rep [1, 1] 0 .default)) head := some D right := pat_A_right } - def eq_const (idx val : ℕ) : VarCond := .and (.ge_const idx val) (.not (.ge_const idx (val + 1))) - def cond_case_7 : VarCond := .and (eq_const 2 1) (.and (eq_const 3 0) (.and (eq_const 4 0) (.and (eq_const 5 0) (.and (eq_const 6 0) (.and (eq_const 7 0) (eq_const 8 0)))))) - def cond_case_74 : VarCond := .and (eq_const 2 0) (.and (eq_const 3 1) (.and (eq_const 4 0) (.and (eq_const 5 0) (.and (eq_const 6 0) (.and (eq_const 7 0) (eq_const 8 1)))))) - def cond_case_75 : VarCond := .and (eq_const 2 0) (.and (eq_const 3 0) (.and (eq_const 4 3) (.and (eq_const 6 1) (.and (eq_const 7 0) (eq_const 8 1))))) - def cond_case_76 : VarCond := .and (eq_const 2 0) (.and (eq_const 3 1) (.and (eq_const 4 0) (.and (eq_const 5 0) (.and (eq_const 6 2) (eq_const 8 1))))) - def cond_case_77 : VarCond := .and (eq_const 2 0) (.and (eq_const 3 0) (.and (eq_const 4 3) (.and (eq_const 6 3) (eq_const 8 1)))) - def cond_case_158 : VarCond := .and (eq_const 2 0) (.and (eq_const 3 1) (.and (eq_const 4 0) (.and (eq_const 5 0) (.and (eq_const 6 1) (eq_const 8 1))))) - def cond_case_160 : VarCond := .and (eq_const 2 0) (.and (eq_const 3 1) (.and (eq_const 4 2) (.and (eq_const 6 1) (.and (eq_const 7 0) (eq_const 8 1))))) - def cond_case_162 : VarCond := .and (eq_const 2 0) (.and (eq_const 3 1) (.and (eq_const 4 2) (.and (eq_const 6 3) (eq_const 8 1)))) - def cond_case_230 : VarCond := .and (eq_const 2 0) (.and (eq_const 3 0) (.and (eq_const 4 2) (.and (eq_const 6 1) (.and (eq_const 7 0) (eq_const 8 0))))) - def cond_case_231 : VarCond := .and (eq_const 2 0) (.and (eq_const 3 0) (.and (eq_const 4 3) (.and (eq_const 6 2) (eq_const 8 1)))) - def cond_case_294 : VarCond := .and (eq_const 2 0) (.and (eq_const 3 1) (.and (eq_const 4 3) (.and (eq_const 6 1) (.and (eq_const 7 0) (eq_const 8 0))))) - def cond_case_296 : VarCond := .and (eq_const 2 0) (.and (eq_const 3 1) (.and (eq_const 4 2) (.and (eq_const 6 2) (eq_const 8 1)))) - def cond_A : VarCond := .or cond_case_7 (.or cond_case_74 (.or cond_case_75 (.or cond_case_76 (.or cond_case_77 (.or cond_case_158 (.or cond_case_160 (.or cond_case_162 (.or cond_case_230 (.or cond_case_231 (.or cond_case_294 cond_case_296)))))))))) - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_A, cond_A)] - inductive State where | D7 (a b : ℕ) | D74 (a b : ℕ) @@ -5278,9 +4538,7 @@ inductive State where | D231 (a b c d : ℕ) | D294 (a b c : ℕ) | D296 (a b c d : ℕ) - def start : State := .D7 0 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .D7 a b => cfg_D7 a b | .D74 a b => cfg_D74 a b @@ -5294,7 +4552,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) | .D231 a b c d => cfg_D231 a b c d | .D294 a b c => cfg_D294 a b c | .D296 a b c d => cfg_D296 a b c d - def next : State → Option State | .D7 0 b => some (.D77 0 0 0 (b + 1)) | .D7 (a + 1) b => some (.D7 a (b + 1)) @@ -5330,25 +4587,19 @@ def next : State → Option State | .D296 0 b 0 d => some (.D158 (b + 2) 0 d) | .D296 0 b (c + 1) d => some (.D231 (b + 2) 0 c d) | .D296 (a + 1) b c d => some (.D296 a (b + 1) c d) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | D (p : Bool) (x d : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .D true 3 1 - def toState : HighLevelState → State | .D false x d => .D76 0 x d | .D true x d => .D231 0 0 x d - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def highLevelNext : HighLevelState → Option HighLevelState | .D false x 0 => let k := (x + 2) / 2 @@ -5368,39 +4619,29 @@ def highLevelNext : HighLevelState → Option HighLevelState if (3 * k + 6) % 2 = 0 then none else some (.D true 3 (3 * ((3 * k + 6) / 2) + 4)) else some (.D true (3 * k + 5) (d - 1)) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry - end M_1RB1RA_0RC1RC_1LD0LF_0LE1LE_1RA0LB_HHH0LC - namespace M_1RB1RB_1LC0RE_HHH1LD_0RA1LB_1RA1LF_0LE1LE def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RB_1LC0RE_---1LD_0RA1LB_1RA1LF_0LE1LE" abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB - def ps : TapePatternSet (Fin 2) (Fin 6) := [({ left := .sym 0 (.rep [1, 1] 1 (.sym 0 (.rep [1, 1] 0 .default))) head := some SixState.D right := .sym 1 (.rep [1] 2 .default) }, .and (.ge_const 0 1) (.and (.ge_const 1 1) (.ge_const 2 1)))] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry - inductive State where /-- $C(k, m, f) := 0^\infty\,(11)^{k+1}\,0\,(11)^{m+1}\,0\,\mathrm{D}{>}\,1^{f+2}\,0^\infty$. -/ | C (k m f : ℕ) - def start : State := .C 2 0 1 - def encode : State → Cfg (Fin 2) (Fin 6) | .C k m f => Cfg.headRight SixState.D @@ -5410,7 +4651,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append (([1, 1] : List (Fin 2)) ^ (k + 1)) default)))) (ListBlank.append [1] (ListBlank.append (([1] : List (Fin 2)) ^ (f + 1)) default)) - def next : State → Option State | .C 0 0 _ => none | .C 0 1 _ => none @@ -5430,22 +4670,17 @@ def next : State → Option State if k < m then some (.C 0 (m - k) (f + 6 * (k + 1))) else if m < k then some (.C (k - m) 0 (f + 6 * (m + 1))) else some (.C 0 0 (f + 6 * (k + 1))) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry inductive HighLevelState where /-- $D_p(a, b) := C(2(a+1), 2(b+1), 2 + 3p)$, i.e. `.C a b (if p then 4 else 1)`. -/ | C (a b : ℕ) (p : Bool) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .C 2 0 false - def toState : HighLevelState → State | .C a b p => .C a b (if p then 4 else 1) - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def highLevelNext : HighLevelState → Option HighLevelState | .C a b p => let r := if p then 1 else 0 @@ -5456,22 +4691,17 @@ def highLevelNext : HighLevelState → Option HighLevelState else if b = a + 2 then if p then some (.C (3 * a + 5) 2 true) else some (.C (3 * a + 5) 0 false) else some (.C (b - a - 3) (3 * a + 2 * r + 5) (!p)) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB1RB_1LC0RE_HHH1LD_0RA1LB_1RA1LF_0LE1LE - namespace M_1RB1RC_1LC1LC_1RE0LD_1LB1RF_HHH1RA_0RD1RD def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RC_1LC1LC_1RE0LD_1LB1RF_---1RA_0RD1RD" abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB - def ps : TapePatternSet (Fin 2) (Fin 6) := [({ left := .sym 1 (.sym 1 (.rep [1, 1] 0 .default)) head := some SixState.E @@ -5481,16 +4711,12 @@ def ps : TapePatternSet (Fin 2) (Fin 6) := head := some SixState.E right := .sym 1 (.sym 1 (.rep [1, 1] 1 (.sym 0 (.sym 1 (.sym 1 (.rep [1, 1] 2 .default)))))) }, .true)] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry - inductive State where | C_0 (a b c : ℕ) | C_1 (a b c : ℕ) - def start : State := .C_1 2 2 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .C_0 a b c => Cfg.headRight SixState.E @@ -5508,7 +4734,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append (([1, 1] : List (Fin 2)) ^ b) (ListBlank.append [0, 1, 1] (ListBlank.append (([1, 1] : List (Fin 2)) ^ c) default)))) - def next : State → Option State | .C_0 _ 0 0 => none | .C_0 a 0 1 => some (.C_1 2 2 (a + 1)) @@ -5520,22 +4745,17 @@ def next : State → Option State | .C_1 a 0 (d + 2) => some (.C_1 2 (a + 3) d) | .C_1 a (b + 1) 0 => some (.C_0 (a + 2) 0 b) | .C_1 a (b + 1) (c + 1) => some (.C_1 (a + 3) b c) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry inductive HighLevelState where /-- $C(a, c) := 0^\infty\,1^{a+2}\,\mathrm{E}{>}\,110\,1^{2c+2}\,0^\infty$. -/ | C (a c : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .C 8 1 - def toState : HighLevelState → State | .C a c => if a % 2 = 0 then .C_0 (a / 2) 0 c else .C_1 (a / 2) 0 c - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def highLevelNext : HighLevelState → Option HighLevelState | .C _ 0 => none | .C a 1 => @@ -5546,39 +4766,28 @@ def highLevelNext : HighLevelState → Option HighLevelState let k := a / 2 if k + 3 ≤ d then some (.C (3 * a + 20) (d - k - 3)) else some (.C (6 * d + 3 * (a % 2) + 5) (k + 2 - d)) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB1RC_1LC1LC_1RE0LD_1LB1RF_HHH1RA_0RD1RD - namespace M_1RB1RC_1LC1LE_1RA1RD_0RF0RE_1LA0LB_HHH1RA def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RC_1LC1LE_1RA1RD_0RF0RE_1LA0LB_---1RA" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_C : TapePattern (Fin 2) (Fin 6) := { left := .default head := some C right := .sym 0 (.sym 1 (.rep [0, 1] 0 (.sym 1 (.rep [0, 1] 1 (.sym 1 (.rep [0, 1] 2 .default)))))) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_C, .true)] - inductive State where /-- $C(a, b, c) := 0^\infty\,{<}\mathrm{C}\,1\,(01)^a\,1\,(01)^b\,1\,(01)^c\,0^\infty$. -/ | C (a b c : ℕ) - def start : State := .C 1 3 1 - def encode : State → Cfg (Fin 2) (Fin 6) | .C a b c => Cfg.headLeft SixState.C default @@ -5588,24 +4797,20 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append (([0, 1] : List (Fin 2)) ^ b) (ListBlank.append [1] (ListBlank.append (([0, 1] : List (Fin 2)) ^ c) default)))))) - def next : State → Option State | .C a 0 0 => if a % 2 = 1 then some (.C 1 (3 * (a / 2) + 6) 1) else none | .C a 0 (c + 1) => some (.C 1 (a + 2) c) | .C a 1 c => some (.C 1 (a + 2) (c + 2)) | .C a (b + 2) c => some (.C (a + 3) b c) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB1RC_1LC1LE_1RA1RD_0RF0RE_1LA0LB_HHH1RA - namespace M_1RB1RD_0LC1RA_0RA1LC_1RA1LE_1RF0LD_HHH0RE def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RD_0LC1RA_0RA1LC_1RA1LE_1RF0LD_---0RE" abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB - def ps : TapePatternSet (Fin 2) (Fin 6) := [({ left := .default head := some SixState.C @@ -5613,19 +4818,15 @@ def ps : TapePatternSet (Fin 2) (Fin 6) := ({ left := .sym 1 (.rep [0, 1] 0 .default) head := some SixState.C right := .sym 0 (.rep [1] 1 .default) }, .ge_const 1 1)] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry - inductive State where | P_1 (c : ℕ) | P_2 (a c : ℕ) | D_0_odd (k w : ℕ) | D_0_even (k w : ℕ) | D_succ_odd (a k w : ℕ) - def start : State := .P_1 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .P_1 c => Cfg.headRight SixState.C default @@ -5649,7 +4850,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append (([1] : List (Fin 2)) ^ (2 * k + 1)) (ListBlank.append (([0, 1] : List (Fin 2)) ^ (a + 1)) default)) (ListBlank.append [1] (ListBlank.append (([1] : List (Fin 2)) ^ w) default)) - def next : State → Option State | .P_1 0 => some (.P_1 2) | .P_1 (w + 1) => some (.D_0_odd 0 w) @@ -5669,22 +4869,17 @@ def next : State → Option State | .D_succ_odd (a + 1) k 1 => some (.P_2 a (2 * k + 6)) | .D_succ_odd 0 k (w + 2) => some (.D_0_odd (k + 2) w) | .D_succ_odd (a + 1) k (w + 2) => some (.D_succ_odd a (k + 2) w) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry inductive HighLevelState where | D (a w : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .D 0 1 - def toState : HighLevelState → State | .D 0 w => .D_0_odd 0 w | .D (a + 1) w => .D_succ_odd a 0 w - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def evalK2 (a w : ℕ) : Option HighLevelState := let m := w / 2 if a > m then some (.D (a - m - 1) (2 * w + 7)) @@ -5694,7 +4889,6 @@ def evalK2 (a w : ℕ) : Option HighLevelState := else evalK2 (2 * a + 4) (w - 2 * a - 6) termination_by w decreasing_by omega - def highLevelNext : HighLevelState → Option HighLevelState | .D a w => let m := w / 2 @@ -5703,54 +4897,39 @@ def highLevelNext : HighLevelState → Option HighLevelState else if w = 2 * a + 2 then none else if w ≤ 2 * a + 5 then some (.D (2 * a + 2) (2 * w - 4 * a - 5)) else evalK2 (2 * a + 2) (w - 2 * a - 6) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB1RD_0LC1RA_0RA1LC_1RA1LE_1RF0LD_HHH0RE - namespace M_1RB1RD_0LC1RA_1LA1LC_1RA1LE_1RF0LD_HHH0RE def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RD_0LC1RA_1LA1LC_1RA1LE_1RF0LD_---0RE" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_P1 : TapePattern (Fin 2) (Fin 6) := { left := .rep [1] 0 .default head := some A right := .rep [1] 1 .default } - /-- Hub Pattern 2: `P2(k, m, c) := 0^∞ (10)^(k+1) (11)^m A> 1^c 0^∞` (`k, m, c ∈ ℕ`). -/ def pat_P2 : TapePattern (Fin 2) (Fin 6) := { left := .rep [1, 1] 1 (.sym 0 (.sym 1 (.rep [0, 1] 0 .default))) head := some A right := .rep [1] 2 .default } - /-- The closed 2-hub pattern set `ps`. -/ def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_P1, .true), (pat_P2, .true)] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry - theorem has_collatz_reduction : HasCollatzReduction target := by sorry - inductive State | P_1 (a c : Nat) | P_2 (k m c : Nat) - def start : State := .P_1 2 1 - def encode : State → Cfg (Fin 2) (Fin 6) | .P_1 a c => evalTapePattern pat_P1 (fun i => if i = 0 then a else if i = 1 then c else 0) | .P_2 k m c => evalTapePattern pat_P2 (fun i => if i = 0 then k else if i = 1 then m else if i = 2 then c else 0) - def next : State → Option State | .P_1 a 0 => some (.P_1 2 (a + 1)) | .P_1 a 1 => some (.P_1 (a + 2) 0) @@ -5765,29 +4944,22 @@ def next : State → Option State | .P_2 (k + 1) m 0 => some (.P_2 k 0 (2 * m + 3)) | .P_2 0 m (d + 2) => some (.P_1 (2 * m + 4) d) | .P_2 (k + 1) m (d + 2) => some (.P_2 k (m + 2) d) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry inductive HighLevelState where /-- $P_1(a, c) := 0^\infty\,1^a\,\mathrm{A}{>}\,1^c\,0^\infty$. -/ | P_1 (a c : ℕ) - def highLevelStart : HighLevelState := .P_1 2 1 - def toState : HighLevelState → State | .P_1 a c => .P_1 a c - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def evalP2 (k c : ℕ) : HighLevelState := if 2 * k ≤ c then if c ≤ 2 * k + 1 then .P_1 0 (2 * c + 3) else .P_1 (4 * k + 4) (c - 2 * k - 2) else evalP2 (k - c / 2 - 1) (2 * c + 3) termination_by k decreasing_by omega - def highLevelNext : HighLevelState → Option HighLevelState | .P_1 a 0 => some (.P_1 2 (a + 1)) | .P_1 a 1 => some (.P_1 (a + 2) 0) @@ -5796,22 +4968,17 @@ def highLevelNext : HighLevelState → Option HighLevelState else if c = 0 then none else if c = 1 then some (evalP2 (a / 2) 1) else some (evalP2 (a / 2 + 1) c) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB1RD_0LC1RA_1LA1LC_1RA1LE_1RF0LD_HHH0RE - namespace M_1RB1RD_0LC1RA_1RA1LC_0RB1LE_1RF0LD_HHH0RE def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RD_0LC1RA_1RA1LC_0RB1LE_1RF0LD_---0RE" abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB - def ps : TapePatternSet (Fin 2) (Fin 6) := [({ left := .default head := some SixState.C @@ -5819,19 +4986,15 @@ def ps : TapePatternSet (Fin 2) (Fin 6) := ({ left := .sym 1 (.rep [0, 1] 0 .default) head := some SixState.C right := .sym 0 (.rep [1] 1 .default) }, .ge_const 1 1)] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry - inductive State where | P_1 (c : ℕ) | P_2 (a c : ℕ) | D_1_0_odd (k w : ℕ) | D_1_0_even (k w : ℕ) | D_1_succ_odd (a k w : ℕ) - def start : State := .P_1 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .P_1 c => Cfg.headRight SixState.C default @@ -5855,7 +5018,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append (([1] : List (Fin 2)) ^ (2 * k + 1)) (ListBlank.append (([0, 1] : List (Fin 2)) ^ (a + 1)) default)) (ListBlank.append [1] (ListBlank.append (([1] : List (Fin 2)) ^ w) default)) - def next : State → Option State | .P_1 0 => some (.P_1 3) | .P_1 (w + 1) => some (.D_1_0_even 0 w) @@ -5877,22 +5039,17 @@ def next : State → Option State | .D_1_succ_odd (a + 1) k 1 => some (.P_2 a (2 * k + 6)) | .D_1_succ_odd 0 k (w + 2) => some (.D_1_0_odd (k + 2) w) | .D_1_succ_odd (a + 1) k (w + 2) => some (.D_1_succ_odd a (k + 2) w) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry inductive HighLevelState where | D (p : Bool) (a w : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .D false 0 3 - def toState : HighLevelState → State | .D p 0 w => .D_1_0_odd (if p then 2 else 1) w | .D p (a + 1) w => .D_1_succ_odd a (if p then 2 else 1) w - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def drainJ1 (a w : ℕ) : Option HighLevelState := let m := w / 2 if a ≥ m + 2 then some (.D false (a - m - 2) (2 * w + 7)) @@ -5903,7 +5060,6 @@ def drainJ1 (a w : ℕ) : Option HighLevelState := else drainJ1 (2 * a + 4) (w - 2 * a - 6) termination_by w decreasing_by omega - def highLevelNext : HighLevelState → Option HighLevelState | .D false a w => let m := w / 2 @@ -5914,24 +5070,17 @@ def highLevelNext : HighLevelState → Option HighLevelState else if w ≤ 2 * a + 5 then some (.D false (2 * a + 2) (2 * w - 4 * a - 5)) else drainJ1 (2 * a + 3) (w - 2 * a - 6) | .D true a w => drainJ1 a w - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB1RD_0LC1RA_1RA1LC_0RB1LE_1RF0LD_HHH0RE - namespace M_1RB1RD_1LC0RD_1RF1RB_1LE0RA_0LB0LE_HHH0RC def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RD_1LC0RD_1RF1RB_1LE0RA_0LB0LE_---0RC" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def drainB (b w : ℕ) : Option (ℕ × ℕ) := if b % 2 = 0 then if b = 0 then some (w + 1, 0) @@ -5946,15 +5095,12 @@ def drainB (b w : ℕ) : Option (ℕ × ℕ) := else if m % 3 = 1 then some (5 * q + w + 6, q + 2) else drainB q (5 * q + w + 12) termination_by b - def pat_C : TapePattern (Fin 2) (Fin 6) := { left := .rep [1, 0, 1, 0, 1] 0 .default head := some C right := .sym 0 (.sym 1 (.sym 0 (.rep [1] 1 (.sym 0 (.rep [1] 2 .default))))) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_C, .true)] - def cfg_C (k a b : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight C (ListBlank.append (([1, 0, 1, 0, 1] : List (Fin 2)) ^ k) default) @@ -5962,16 +5108,12 @@ def cfg_C (k a b : ℕ) : Cfg (Fin 2) (Fin 6) := (ListBlank.append (([1] : List (Fin 2)) ^ a) (ListBlank.append [0] (ListBlank.append (([1] : List (Fin 2)) ^ b) default)))) - inductive State where /-- $C(k, a, b) := 0^\infty\,(10101)^k\,\mathrm{C}{>}\,0\,1\,0\,1^a\,0\,1^b\,0^\infty$. -/ | C (k a b : ℕ) - def start : State := .C 0 2 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .C k a b => cfg_C k a b - def next : State → Option State | .C k a b => if a % 2 = 0 then @@ -5996,95 +5138,73 @@ def next : State → Option State else if a = 3 then some (.C 0 (5 * k + b + 6) 0) else if a = 5 then some (.C 0 (5 * k + 6) (b + 1)) else some (.C (k + 1) (a - 6) (b + 1)) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB1RD_1LC0RD_1RF1RB_1LE0RA_0LB0LE_HHH0RC - namespace M_1RB1RE_1LC0RA_0RD1LB_HHH1RC_1LF1RE_0LB0LE def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RE_1LC0RA_0RD1LB_---1RC_1LF1RE_0LB0LE" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_A : TapePattern (Fin 2) (Fin 6) := { left := .sym 0 (.rep [0, 1] 0 .default) head := some A right := .rep [0, 1] 1 (.rep [1] 2 .default) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_A, .true)] - inductive State where /-- $A(a, b, c) := 0^\infty\,(10)^a\,0\,\mathrm{A}{>}\,(01)^b\,1^c\,0^\infty$. -/ | A (a b c : ℕ) - def start : State := .A 0 0 2 - def encode : State → Cfg (Fin 2) (Fin 6) | .A a b c => Cfg.headRight SixState.A (ListBlank.append [0] (ListBlank.append (([0, 1] : List (Fin 2)) ^ a) default)) (ListBlank.append (([0, 1] : List (Fin 2)) ^ b) (ListBlank.append (([1] : List (Fin 2)) ^ c) default)) - def next : State → Option State | .A a b 0 => some (.A a 0 (2 * b + 2)) | .A 0 _ 1 => none | .A 0 b (d + 2) => some (.A (b + 2) 0 (d + 1)) | .A (a + 1) b (d + 1) => some (.A a (b + 2) d) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB1RE_1LC0RA_0RD1LB_HHH1RC_1LF1RE_0LB0LE - namespace M_1RB1RE_1LC0RA_1RD0LB_1LB1RC_1LF0RD_HHH0LE def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RE_1LC0RA_1RD0LB_1LB1RC_1LF0RD_---0LE" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_C1 : TapePattern (Fin 2) (Fin 6) := { left := .sym 1 (.rep [1] 0 .default) head := some C right := .default } - def pat_D : TapePattern (Fin 2) (Fin 6) := { left := .sym 0 (.sym 1 (.rep [0, 1] 0 (.rep [1] 1 .default))) head := some D right := .sym 0 (.sym 1 (.rep [0, 1] 2 .default)) } - def pat_C2 : TapePattern (Fin 2) (Fin 6) := { left := .sym 1 (.rep [1] 0 .default) head := some C right := .sym 1 (.sym 1 (.sym 0 (.sym 1 (.rep [0, 1] 1 .default)))) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_C1, .true), (pat_D, .true), (pat_C2, .true)] - def cfg_C1 (a : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight C (ListBlank.append [1] (ListBlank.append (([1] : List (Fin 2)) ^ a) default)) default - def cfg_D (a b c : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight D (ListBlank.append [0, 1] (ListBlank.append (([0, 1] : List (Fin 2)) ^ a) (ListBlank.append (([1] : List (Fin 2)) ^ b) default))) (ListBlank.append [0, 1] (ListBlank.append (([0, 1] : List (Fin 2)) ^ c) default)) - def cfg_C2 (a b : ℕ) : Cfg (Fin 2) (Fin 6) := Cfg.headRight C (ListBlank.append [1] (ListBlank.append (([1] : List (Fin 2)) ^ a) default)) (ListBlank.append [1, 1, 0, 1] (ListBlank.append (([0, 1] : List (Fin 2)) ^ b) default)) - inductive State where /-- $C_1(a) := 0^\infty\,1^{a+1}\,\mathrm{C}{>}\,0^\infty$. -/ | C1 (a : ℕ) @@ -6092,14 +5212,11 @@ inductive State where | D (a b c : ℕ) /-- $C_2(a, b) := 0^\infty\,1^{a+1}\,\mathrm{C}{>}\,1101\,(01)^b\,0^\infty$. -/ | C2 (a b : ℕ) - def start : State := .C1 3 - def encode : State → Cfg (Fin 2) (Fin 6) | .C1 a => cfg_C1 a | .D a b c => cfg_D a b c | .C2 a b => cfg_C2 a b - def next : State → Option State | .C1 0 => none | .C1 1 => some (.C2 1 0) @@ -6117,24 +5234,18 @@ def next : State → Option State | .D a 0 (c + 1) => some (.C2 (2 * a + 3) c) | .D a 1 (c + 1) => some (.D (a + 1) 0 c) | .D a (b + 2) (c + 1) => some (.D (a + 2) b c) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | C (a : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .C 3 - def toState : HighLevelState → State | .C a => .C1 a - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def evalD0 (b c : ℕ) : Option HighLevelState := let k := min (b / 2) c let a1 := 2 * k @@ -6152,44 +5263,31 @@ def evalD0 (b c : ℕ) : Option HighLevelState := else evalD0 (b1 - 6) (a1 + 4) termination_by b decreasing_by omega - def highLevelNext : HighLevelState → Option HighLevelState | .C 0 => none | .C 1 => some (.C 9) | .C (a + 2) => evalD0 a 1 - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry - end M_1RB1RE_1LC0RA_1RD0LB_1LB1RC_1LF0RD_HHH0LE - namespace M_1RB1RE_1LC1LD_HHH1LA_1LB1LE_0RF0RA_1LD1RF def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RE_1LC1LD_---1LA_1LB1LE_0RF0RA_1LD1RF" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_A : TapePattern (Fin 2) (Fin 6) := { left := .rep [0, 1] 1 (.sym 0 (.sym 1 (.rep [1] 0 .default))) head := some A right := .default } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_A, .true)] - inductive State where /-- $A(m, n) := 0^\infty\,1^{m+1}\,(01)^n\,0\,\mathrm{A}{>}\,0^\infty$. -/ | A (m n : ℕ) - def start : State := .A 0 1 - def encode : State → Cfg (Fin 2) (Fin 6) | .A m n => Cfg.headRight SixState.A @@ -6197,7 +5295,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append [0] (ListBlank.append (([1] : List (Fin 2)) ^ (m + 1)) default))) default - def next : State → Option State | .A 0 n => if n % 2 = 0 then none @@ -6212,40 +5309,30 @@ def next : State → Option State | .A (m + 4) n => if n % 2 = 0 then some (.A m (3 * (n / 2) + 4)) else some (.A m (3 * (n / 2) + 6)) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB1RE_1LC1LD_HHH1LA_1LB1LE_0RF0RA_1LD1RF - namespace M_1RB1RF_0LC0RF_1RD1LC_HHH0LE_0RC1LF_1RA0LE def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RF_0LC0RF_1RD1LC_---0LE_0RC1LF_1RA0LE" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_A : TapePattern (Fin 2) (Fin 6) := { left := .rep [1] 0 .default head := some A right := .sym 1 (.rep [1] 1 .default) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_A, .true)] - inductive State where /-- $A(a, b) := 0^\infty\,1^a\,\mathrm{A}{>}\,1^{b+1}\,0^\infty$. -/ | A (a b : ℕ) - def start : State := .A 1 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .A a b => Cfg.headRight SixState.A (ListBlank.append (([1] : List (Fin 2)) ^ a) default) (ListBlank.append [1] (ListBlank.append (([1] : List (Fin 2)) ^ b) default)) - def next : State → Option State | .A a b => let k := a / 2 @@ -6269,34 +5356,26 @@ def next : State → Option State some (.A (4 * k + 5) 0) else some (.A (4 * k + 7) (b - 2 * k - 5)) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB1RF_0LC0RF_1RD1LC_HHH0LE_0RC1LF_1RA0LE - namespace M_1RB1RF_1LC1LF_0RE1LD_0LB1LD_HHH1RC_1RA0RD def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RF_1LC1LF_0RE1LD_0LB1LD_---1RC_1RA0RD" - abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB - def pat_64 : TapePattern (Fin 2) (Fin 6) := { left := .sym 1 (.sym 1 (.sym 1 (.rep [1, 1] 0 (.sym 1 (.sym 0 (.rep [1, 0] 1 (.sym 1 .default))))))) head := some A right := .sym 1 (.rep [1] 2 .default) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_64, VarCond.true)] - inductive State where /-- $E(a, b, c) := 0^\infty\,1\,(01)^{b+1}\,(11)^a\,111\,\mathrm{A}{>}\,1^{c+1}\,0^\infty$. -/ | E (a b c : ℕ) - def start : State := .E 0 0 2 - def encode : State → Cfg (Fin 2) (Fin 6) | .E a b c => Cfg.headRight A @@ -6306,7 +5385,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) (ListBlank.append (([1, 0] : List (Fin 2)) ^ b) (ListBlank.cons 1 default)))))))) (ListBlank.cons 1 (ListBlank.append (([1] : List (Fin 2)) ^ c) default)) - def next : State → Option State | .E a 0 0 => some (.E 0 0 (2 * a + 5)) | .E a 0 1 => some (.E 0 0 (2 * a + 3)) @@ -6321,50 +5399,37 @@ def next : State → Option State | .E a (b + 1) (c + 2) => some (.E (a + 2) b c) | .E a (b + 2) 0 => some (.E 0 b (2 * a + 7)) | .E a (b + 2) 1 => some (.E 0 b (2 * a + 5)) - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry theorem has_collatz_reduction : HasCollatzReduction target := by sorry theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB1RF_1LC1LF_0RE1LD_0LB1LD_HHH1RC_1RA0RD - namespace M_1RB1RF_1LCHHH_1LE1RD_1RA0RC_0LF0LA_0LD0RB def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RF_1LC---_1LE1RD_1RA0RC_0LF0LA_0LD0RB" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_P1 : TapePattern (Fin 2) (Fin 6) := { left := .rep [0, 1] 0 (.rep [1, 0] 1 (.sym 1 .default)) head := some C right := .rep [0, 1] 2 (.sym 1 (.sym 1 (.sym 1 .default))) } - def pat_P2 : TapePattern (Fin 2) (Fin 6) := { left := .sym 1 (.rep [0, 1] 0 (.rep [1, 0] 1 (.sym 1 (.sym 1 .default)))) head := some D right := .rep [1, 0] 2 (.sym 1 (.sym 1 (.sym 1 (.sym 1 .default)))) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_P1, .true), (pat_P2, .true)] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry - theorem has_collatz_reduction : HasCollatzReduction target := by sorry - inductive State where | P_1 (a b c : ℕ) | P_2 (a b c : ℕ) deriving DecidableEq, Repr - def start : State := .P_1 1 0 0 - def encode : State → Cfg (Fin 2) (Fin 6) | .P_1 a b c => evalTapePattern pat_P1 (fun i => if i = 0 then a else if i = 1 then b else if i = 2 then c else 0) | .P_2 a b c => evalTapePattern pat_P2 (fun i => if i = 0 then a else if i = 1 then b else if i = 2 then c else 0) - def next : State → Option State | .P_1 0 _ 0 => none | .P_1 (a + 1) b 0 => some (.P_2 2 (b + 1) a) @@ -6376,23 +5441,17 @@ def next : State → Option State | .P_2 _ 0 2 => none | .P_2 a 0 (c + 3) => some (.P_2 2 (a + 2) c) | .P_2 a (b + 1) (c + 1) => some (.P_2 (a + 2) b c) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry inductive HighLevelState where /-- $P(b, c) := 0^\infty\,11\,(01)^b\,10101\,\mathrm{D}{>}\,(10)^c\,1111\,0^\infty$. -/ | P (b c : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .P 1 0 - def toState : HighLevelState → State | .P b c => .P_2 2 b c - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def highLevelNext : HighLevelState → Option HighLevelState | .P b c => if c ≥ b + 3 then some (.P (2 * b + 4) (c - b - 3)) @@ -6401,60 +5460,44 @@ def highLevelNext : HighLevelState → Option HighLevelState else if 3 * c + 1 ≤ b then some (.P (b - 3 * c) (4 * c + 6)) else if (b - c) % 2 = 1 then some (.P 1 (4 * c + 6)) else some (.P 0 (4 * c + 6)) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB1RF_1LCHHH_1LE1RD_1RA0RC_0LF0LA_0LD0RB - namespace M_1RBHHH_1RC1LE_0RD0RF_0RE0LA_1LF0LB_1LA1LD def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB---_1RC1LE_0RD0RF_0RE0LA_1LF0LB_1LA1LD" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def pat_P1 : TapePattern (Fin 2) (Fin 6) := { left := .sym 1 (.rep [1, 0] 0 (.rep [1] 1 .default)) head := some C right := .rep [0, 1] 2 (.sym 1 (.rep [0, 1] 3 (.sym 1 .default))) } - def pat_P2 : TapePattern (Fin 2) (Fin 6) := { left := .sym 1 (.rep [1, 0] 0 (.rep [1] 1 .default)) head := some C right := .rep [0, 1] 2 (.sym 1 .default) } - def pat_P3 : TapePattern (Fin 2) (Fin 6) := { left := .sym 1 (.rep [1, 0] 0 (.rep [1] 1 .default)) head := some C right := .rep [0, 1] 2 .default } - def pat_P4 : TapePattern (Fin 2) (Fin 6) := { left := .sym 1 (.rep [1, 0] 0 (.rep [1] 1 .default)) head := some C right := .rep [0, 1] 2 (.sym 1 (.rep [0, 1] 3 .default)) } - def ps : TapePatternSet (Fin 2) (Fin 6) := [(pat_P1, .true), (pat_P2, .true), (pat_P3, .true), (pat_P4, .true)] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry - theorem has_collatz_reduction : HasCollatzReduction target := by sorry - inductive State where | P_1 (a b c d : ℕ) | P_2 (a b c : ℕ) | P_3 (a b c : ℕ) | P_4 (a b c d : ℕ) deriving DecidableEq, Repr - def start : State := .P_2 0 0 2 - def encode : State → Cfg (Fin 2) (Fin 6) | .P_1 a b c d => evalTapePattern pat_P1 fun i => if i = 0 then a else if i = 1 then b else if i = 2 then c else if i = 3 then d else 0 @@ -6464,7 +5507,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) if i = 0 then a else if i = 1 then b else if i = 2 then c else 0 | .P_4 a b c d => evalTapePattern pat_P4 fun i => if i = 0 then a else if i = 1 then b else if i = 2 then c else if i = 3 then d else 0 - def next : State → Option State | .P_1 0 b c 0 => if b % 2 = 0 then some (.P_2 0 0 (b / 2 + c + 2)) @@ -6504,23 +5546,17 @@ def next : State → Option State if (b' + 1) % 2 = 0 then some (.P_1 (b' / 2 + c) 4 1 (d + 2)) else some (.P_4 0 0 (b' / 2 + c + 2) d) | .P_4 (a + 1) b c (d + 1) => some (.P_4 a b (c + 2) d) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry inductive HighLevelState where /-- $P(a, d) := 0^\infty\,1111\,(01)^a\,1\,\mathrm{C}{>}\,011\,(01)^d\,1\,0^\infty$. -/ | P (a d : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .P 1 1 - def toState : HighLevelState → State | .P a d => .P_1 a 4 1 d - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def highLevelNext : HighLevelState → Option HighLevelState | .P a d => if a ≥ d + 2 then some (.P (a - d - 2) (2 * d + 3)) @@ -6529,36 +5565,25 @@ def highLevelNext : HighLevelState → Option HighLevelState else if 3 * a + 1 ≤ d then some (.P (4 * a + 6) (d - 3 * a)) else if (d - a) % 2 = 0 then some (.P (4 * a + 6) 2) else some (.P (4 * a + 6) 1) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RBHHH_1RC1LE_0RD0RF_0RE0LA_1LF0LB_1LA1LD - namespace M_1RB0LB0RC_2LC2LA1RA_1RA1LCHHH -def machine : ConjectureMachines.Machine 3 3 := - load_rle_machine% "1RB0LB0RC_2LC2LA1RA_1RA1LC---" - -abbrev target : Machine (Fin 3) (Fin 3) := - machine.toBB - +def machine : ConjectureMachines.Machine 3 3 := load_rle_machine% "1RB0LB0RC_2LC2LA1RA_1RA1LC---" +abbrev target : Machine (Fin 3) (Fin 3) := machine.toBB inductive State where | A (a c : ℕ) deriving DecidableEq, Repr - def start : State := .A 1 1 - def encode : State → Cfg (Fin 3) (Fin 3) | .A a c => Cfg.headRight ThreeState.A (ListBlank.append (([1, 0] : List (Fin 3)) ^ c) default) (ListBlank.append (([1] : List (Fin 3)) ^ a) (ListBlank.cons 2 default)) - def next : State → Option State | .A a c => if a ≤ c then @@ -6582,35 +5607,23 @@ def next : State → Option State none else some (.A (a - c - 4) (3 * (c / 2) + 8)) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - def pat_A : TapePattern (Fin 3) (Fin 3) := { left := .rep [1, 0] 1 .default head := some ThreeState.A right := .rep [1] 0 (.sym 2 .default) } - def ps : TapePatternSet (Fin 3) (Fin 3) := [(pat_A, .true)] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry - theorem has_collatz_reduction : HasCollatzReduction target := by sorry end M_1RB0LB0RC_2LC2LA1RA_1RA1LCHHH - namespace M_1RB1LB2LC_1LA2RB1RB_HHH0LA2LA -def machine : ConjectureMachines.Machine 3 3 := - load_rle_machine% "1RB1LB2LC_1LA2RB1RB_---0LA2LA" - -abbrev target : Machine (Fin 3) (Fin 3) := - machine.toBB - +def machine : ConjectureMachines.Machine 3 3 := load_rle_machine% "1RB1LB2LC_1LA2RB1RB_---0LA2LA" +abbrev target : Machine (Fin 3) (Fin 3) := machine.toBB inductive State where | W (w : List Bool) deriving DecidableEq, Repr - inductive Carry where | ca | cb @@ -6619,7 +5632,6 @@ inductive Carry where | ce | cf deriving DecidableEq, Repr - def pass : Carry → List Bool → Option (List Bool) | .ca, [] => some [true] | .ca, false :: zs => List.cons true <$> pass .cc zs @@ -6639,31 +5651,22 @@ def pass : Carry → List Bool → Option (List Bool) | .cf, [] => some [true, false, false, true] | .cf, false :: zs => List.cons false <$> pass .cd zs | .cf, true :: zs => List.cons true <$> pass .ca zs - def start : State := .W [true] - def encode : State → Cfg (Fin 3) (Fin 3) | .W w => Cfg.headRight ThreeState.B (ListBlank.append (w.map fun b => if b then 1 else 2) default) default - def next : State → Option State | .W w => (fun w' => .W (false :: w')) <$> pass .ca w - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - def pat_W : StackPattern (Fin 3) (Fin 3) := { left := [.word [[2], [1]] 0] head := some ThreeState.B right := [] } - def ps : StackPatternSet (Fin 3) (Fin 3) := [(pat_W, .true)] - theorem is_closed_stack_pattern_set : IsClosedStackPatternSet target ps := by sorry - theorem has_stacked_collatz_reduction : HasStackedCollatzReduction target := by sorry end M_1RB1LB2LC_1LA2RB1RB_HHH0LA2LA @@ -6714,12 +5717,8 @@ def ps : StackPatternSet (Fin 3) (Fin 3) := end WilyCoyote namespace M_1RB2LA1LA_2LA0RA2RC_HHH0LC2RA -def machine : ConjectureMachines.Machine 3 3 := - load_rle_machine% "1RB2LA1LA_2LA0RA2RC_---0LC2RA" - -abbrev target : Machine (Fin 3) (Fin 3) := - machine.toBB - +def machine : ConjectureMachines.Machine 3 3 := load_rle_machine% "1RB2LA1LA_2LA0RA2RC_---0LC2RA" +abbrev target : Machine (Fin 3) (Fin 3) := machine.toBB abbrev State := WilyCoyote.State abbrev WilyMode := WilyCoyote.WilyMode abbrev wilyPass := WilyCoyote.wilyPass @@ -6728,23 +5727,14 @@ abbrev encode : State → Cfg (Fin 3) (Fin 3) := WilyCoyote.encode abbrev next : State → Option State := WilyCoyote.next abbrev pat_W : StackPattern (Fin 3) (Fin 3) := WilyCoyote.pat_W abbrev ps : StackPatternSet (Fin 3) (Fin 3) := WilyCoyote.ps - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - theorem is_closed_stack_pattern_set : IsClosedStackPatternSet target ps := by sorry - theorem has_stacked_collatz_reduction : HasStackedCollatzReduction target := by sorry end M_1RB2LA1LA_2LA0RA2RC_HHH0LC2RA - namespace M_1RB2LA1LA_2LA0RA2RC_HHH1RB2RA -def machine : ConjectureMachines.Machine 3 3 := - load_rle_machine% "1RB2LA1LA_2LA0RA2RC_---1RB2RA" - -abbrev target : Machine (Fin 3) (Fin 3) := - machine.toBB - +def machine : ConjectureMachines.Machine 3 3 := load_rle_machine% "1RB2LA1LA_2LA0RA2RC_---1RB2RA" +abbrev target : Machine (Fin 3) (Fin 3) := machine.toBB abbrev State := WilyCoyote.State abbrev WilyMode := WilyCoyote.WilyMode abbrev wilyPass := WilyCoyote.wilyPass @@ -6753,35 +5743,23 @@ abbrev encode : State → Cfg (Fin 3) (Fin 3) := WilyCoyote.encode abbrev next : State → Option State := WilyCoyote.next abbrev pat_W : StackPattern (Fin 3) (Fin 3) := WilyCoyote.pat_W abbrev ps : StackPatternSet (Fin 3) (Fin 3) := WilyCoyote.ps - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - theorem is_closed_stack_pattern_set : IsClosedStackPatternSet target ps := by sorry - theorem has_stacked_collatz_reduction : HasStackedCollatzReduction target := by sorry end M_1RB2LA1LA_2LA0RA2RC_HHH1RB2RA - namespace M_1RB2LC1RC_2LCHHH2RB_2LA0LB0RA -def machine : ConjectureMachines.Machine 3 3 := - load_rle_machine% "1RB2LC1RC_2LC---2RB_2LA0LB0RA" - -abbrev target : Machine (Fin 3) (Fin 3) := - machine.toBB - +def machine : ConjectureMachines.Machine 3 3 := load_rle_machine% "1RB2LC1RC_2LC---2RB_2LA0LB0RA" +abbrev target : Machine (Fin 3) (Fin 3) := machine.toBB inductive State where | A (a c : ℕ) deriving DecidableEq, Repr - def start : State := .A 0 1 - def encode : State → Cfg (Fin 3) (Fin 3) | .A a c => Cfg.headLeft ThreeState.C (ListBlank.append (([2] : List (Fin 3)) ^ a) (ListBlank.append [1] default)) (ListBlank.append (([2, 0] : List (Fin 3)) ^ c) default) - def next : State → Option State | .A a c => if a ≤ c then @@ -6805,49 +5783,34 @@ def next : State → Option State none else some (.A (a - c - 4) (3 * (c / 2) + 8)) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - def pat_A0 : TapePattern (Fin 3) (Fin 3) := { left := .default head := some ThreeState.C right := .sym 1 (.rep [2, 0] 1 .default) } - def pat_AS : TapePattern (Fin 3) (Fin 3) := { left := .rep [2] 0 (.sym 1 .default) head := some ThreeState.C right := .sym 2 (.rep [2, 0] 1 .default) } - def ps : TapePatternSet (Fin 3) (Fin 3) := [(pat_A0, .true), (pat_AS, .true)] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry - theorem has_collatz_reduction : HasCollatzReduction target := by sorry end M_1RB2LC1RC_2LCHHH2RB_2LA0LB0RA - namespace M_1RB2RA1LC_2LC1RB2RB_HHH2LA1LA -def machine : ConjectureMachines.Machine 3 3 := - load_rle_machine% "1RB2RA1LC_2LC1RB2RB_---2LA1LA" - -abbrev target : Machine (Fin 3) (Fin 3) := - machine.toBB - +def machine : ConjectureMachines.Machine 3 3 := load_rle_machine% "1RB2RA1LC_2LC1RB2RB_---2LA1LA" +abbrev target : Machine (Fin 3) (Fin 3) := machine.toBB inductive State where | A (a b c : ℕ) deriving DecidableEq, Repr - def start : State := .A 2 0 0 - def encode : State → Cfg (Fin 3) (Fin 3) | .A a b c => Cfg.headLeft ThreeState.A (ListBlank.append (([1] : List (Fin 3)) ^ (2 * b + 2)) (ListBlank.append (([2, 1] : List (Fin 3)) ^ a) default)) (ListBlank.append (([1] : List (Fin 3)) ^ (2 * (c + 2))) default) - def next : State → Option State | .A a b c => let q := b / 6 @@ -6866,21 +5829,15 @@ def next : State → Option State some (.A a (8 * q + c + 6) 1) else some (.A a (8 * q + c + 8) 0) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - def pat_A : TapePattern (Fin 3) (Fin 3) := { left := .sym 1 (.rep [1, 1] 1 (.rep [2, 1] 0 .default)) head := some ThreeState.A right := .sym 1 (.sym 1 (.sym 1 (.sym 1 (.sym 1 (.rep [1, 1] 2 .default))))) } - def ps : TapePatternSet (Fin 3) (Fin 3) := [(pat_A, .true)] - theorem is_closed_pattern_set : IsClosedPatternSet target ps := by sorry - theorem has_collatz_reduction : HasCollatzReduction target := by sorry end M_1RB2RA1LC_2LC1RB2RB_HHH2LA1LA @@ -6917,100 +5874,66 @@ open Stack namespace M_1RB0LB_0RC0LD_1LD1RE_0LA0RF_0RD1RF_0RCHHH def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LB_0RC0LD_1LD1RE_0LA0RF_0RD1RF_0RC---" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB theorem has_odometer_reduction : HasOdometerReduction target := by sorry end M_1RB0LB_0RC0LD_1LD1RE_0LA0RF_0RD1RF_0RCHHH - namespace M_1RB0LC_1LC0RE_1LD1LC_1LA1RD_HHH0RF_0LB0RD def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LC_1LC0RE_1LD1LC_1LA1RD_---0RF_0LB0RD" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB theorem has_stack_reduction : HasStackReduction target := by sorry end M_1RB0LC_1LC0RE_1LD1LC_1LA1RD_HHH0RF_0LB0RD - namespace M_1RB0LC_1RC1RE_1LA0LD_0RB0RA_1RB1RF_1RDHHH def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LC_1RC1RE_1LA0LD_0RB0RA_1RB1RF_1RD---" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB theorem has_stack_reduction : HasStackReduction target := by sorry end M_1RB0LC_1RC1RE_1LA0LD_0RB0RA_1RB1RF_1RDHHH - namespace M_1RB0LD_0RCHHH_0LD0RF_1LE1LD_0LA0RD_0RB1RA def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LD_0RC---_0LD0RF_1LE1LD_0LA0RD_0RB1RA" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB theorem has_transducer_reduction : HasTransducerReduction target := by sorry end M_1RB0LD_0RCHHH_0LD0RF_1LE1LD_0LA0RD_0RB1RA - namespace M_1RB0LD_0RCHHH_1LD0RF_0LE0RA_0RA1LF_0LA1LB def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LD_0RC---_1LD0RF_0LE0RA_0RA1LF_0LA1LB" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB theorem has_odometer_reduction : HasOdometerReduction target := by sorry end M_1RB0LD_0RCHHH_1LD0RF_0LE0RA_0RA1LF_0LA1LB namespace M_1RB0LD_1LC1RD_0LE1LA_0RB1RD_HHH0LF_1RA1LF def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LD_1LC1RD_0LE1LA_0RB1RD_---0LF_1RA1LF" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB inductive State where | C (a : ℕ) (L R : List ℕ) deriving DecidableEq, Repr - def transferD (a : ℕ) (L R : List ℕ) : State := let p := R.foldl (fun p d => (d, p.1 :: p.2)) (a, L) .C p.1 p.2 [0] - def start : State := .C 0 [0] [1] - def encode : State → Cfg (Fin 2) (Fin 6) | .C a L R => Cfg.headRight C (encStack (a :: L)) (ListBlank.cons 0 (encStack R)) - def next : State → Option State | .C 0 [] _ => none | .C 0 (b :: L) R => some (transferD b L (bumpHead (bumpHead R))) | .C 1 [] R => some (.C 0 [] (0 :: R)) | .C 1 (b :: L) R => some (.C (b + 1) L (0 :: R)) | .C (a + 2) L R => some (.C a (bumpHead L) (bumpHead R)) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | C (a : ℕ) (L : List ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .C 3 [0] - def toState : HighLevelState → State | .C a L => .C a L [0] - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def transferHL (a : ℕ) (L R : List ℕ) : HighLevelState := let p := R.foldl (fun p d => (d, p.1 :: p.2)) (a, L) .C p.1 p.2 - def stepEpoch (a : ℕ) (L R : List ℕ) : Option HighLevelState := let k := a / 2 let R₁ := bumpHeadBy k R @@ -7033,16 +5956,12 @@ decreasing_by apply Prod.Lex.left simp +zetaDelta only [List.length_cons] omega - def highLevelNext : HighLevelState → Option HighLevelState | .C a L => stepEpoch a L [0] - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB0LD_1LC1RD_0LE1LA_0RB1RD_HHH0LF_1RA1LF @@ -7050,20 +5969,15 @@ end M_1RB0LD_1LC1RD_0LE1LA_0RB1RD_HHH0LF_1RA1LF namespace M_1RB0LE_0RC0RA_1RD1RB_0LA0RB_1LFHHH_1LD1LF def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LE_0RC0RA_1RD1RB_0LA0RB_1LF---_1LD1LF" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB inductive RightMode where | ar | br | cr deriving DecidableEq, Repr - inductive State where | E (L R : List ℕ) deriving DecidableEq, Repr - def sweepElem (stepRt : RightMode → List ℕ → State) : ℕ → RightMode → List ℕ → List ℕ → State | 0, .ar, L, Rt => .E L (incRun Rt) @@ -7073,54 +5987,41 @@ def sweepElem (stepRt : RightMode → List ℕ → State) : | d + 1, .br, L, Rt => sweepElem stepRt d .cr (incRun L) Rt | 1, .cr, L, _ => stepRt .br (1 :: L) | d + 2, .cr, L, Rt => .E L ((d + 2) :: Rt) - def sweepRight : RightMode → List ℕ → List ℕ → State | .ar, L, [] => .E (1 :: L) [] | .br, L, [] => .E (incRun L) [] | .cr, L, [] => .E L [] | m, L, d :: Rt => sweepElem (fun m' L' => sweepRight m' L' Rt) d m L Rt - def sweepFL : List ℕ → List ℕ → State | [], R => sweepRight .ar [] (2 :: R) | 0 :: Lt, R => sweepFL Lt (0 :: R) | 1 :: Lt, R => sweepRight .br (incRun Lt) (0 :: R) | 2 :: Lt, R => .E Lt (2 :: R) | (a + 3) :: Lt, R => sweepRight .ar (a :: Lt) (2 :: R) - def start : State := .E [1] [] - def encode : State → Cfg (Fin 2) (Fin 6) | .E L R => Cfg.headLeft SixState.E (encRun L) (encRun R) - def next : State → Option State | .E [] R => some (sweepFL [] (0 :: R)) | .E (0 :: _) _ => none | .E ((a + 1) :: Lt) R => some (sweepFL (a :: Lt) (0 :: R)) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB0LE_0RC0RA_1RD1RB_0LA0RB_1LFHHH_1LD1LF namespace M_1RB0LE_1LB1RC_0RF0RD_1RE0LA_1LA1RE_HHH0RB def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LE_1LB1RC_0RF0RD_1RE0LA_1LA1RE_---0RB" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def bump2 (s : List ℕ) : ℕ × List ℕ := List.casesOn s (1, []) fun b xs => (b + 2, xs) - def d0Out : List ℕ → List ℕ | [] => [0] | [d] => [d + 1] | d :: r :: s => (r + d + 2) :: s - inductive State where | C (a : ℕ) (L R : List ℕ) deriving DecidableEq, Repr - def scanOnes (a : ℕ) (L : List ℕ) : List ℕ → Option State | [] => none | [0] => @@ -7131,36 +6032,25 @@ def scanOnes (a : ℕ) (L : List ℕ) : List ℕ → Option State some (.C b L' ((a + r + 3) :: d0Out R)) | 1 :: R => scanOnes 0 (a :: L) R | (r + 2) :: R => some (.C (a + 2) L (r :: d0Out R)) - def start : State := .C 1 [] [0, 0] - def encode : State → Cfg (Fin 2) (Fin 6) | .C a L R => Cfg.headRight C (encStack2 (a :: L)) (ListBlank.cons 0 (encStack R)) - def next : State → Option State | .C a L R => scanOnes a L R - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | C (a : ℕ) (L R : List ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .C 1 [] [0, 0] - def toState : HighLevelState → State | .C a L R => .C a L R - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def d0Iter (k : ℕ) (R : List ℕ) : List ℕ := if k = 0 then R else d0Iter (k - 1) (d0Out R) termination_by k decreasing_by omega - def scanEpoch (a : ℕ) (L R : List ℕ) : Option HighLevelState := if R = [] then none @@ -7188,16 +6078,12 @@ decreasing_by simp +zetaDelta only [Prod.lex_def, List.headD_eq_head?, List.head?_cons, Option.getD_some, List.tail_cons, List.length_cons] at * omega - def highLevelNext : HighLevelState → Option HighLevelState | .C a L R => scanEpoch a L R - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB0LE_1LB1RC_0RF0RD_1RE0LA_1LA1RE_HHH0RB @@ -7205,17 +6091,12 @@ end M_1RB0LE_1LB1RC_0RF0RD_1RE0LA_1LA1RE_HHH0RB namespace M_1RB0RB_1RC0LE_1LD1LA_HHH0LC_1RF1LE_1RA0RA def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0RB_1RC0LE_1LD1LA_---0LC_1RF1LE_1RA0RA" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB inductive State where | C (a b : ℕ) (L : List ℕ) (r : ℕ) (R : List ℕ) | F (a b : ℕ) (L : List ℕ) (r : ℕ) (R : List ℕ) deriving DecidableEq, Repr - def start : State := .F 1 0 [] 0 [] - def encode : State → Cfg (Fin 2) (Fin 6) | .C a b L r R => Cfg.headRight C (encStack ((a + 1) :: b :: L)) @@ -7225,7 +6106,6 @@ def encode : State → Cfg (Fin 2) (Fin 6) Cfg.headRight F (encStack (a :: b :: L)) (ListBlank.cons 0 (ListBlank.append (([1] : List (Fin 2)) ^ r) (ListBlank.cons 0 (encStack R)))) - def next : State → Option State | .C 0 0 _ _ _ => none | .C 0 (b + 1) L r R => @@ -7251,23 +6131,16 @@ def next : State → Option State else List.casesOn R (some (.C a' b L 0 [0])) fun e R' => some (.F 0 (a' + 1) (b :: L) e R') - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | F (a b : ℕ) (L : List ℕ) (r : ℕ) (R : List ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .F 1 0 [] 0 [] - def toState : HighLevelState → State | .F a b L r R => .F a b L r R - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def exitC (a b : ℕ) (L : List ℕ) (r : ℕ) (R : List ℕ) : Option HighLevelState := List.rec (fun a b r R => @@ -7287,7 +6160,6 @@ def exitC (a b : ℕ) (L : List ℕ) (r : ℕ) (R : List ℕ) : Option HighLevel else if b' = 1 then ih 0 (c + 1) 0 ((r + 1) :: R) else some (.F (2 * (b' / 2) - 1) (c + 1) L' 0 (0 :: (r + 1) :: R))) L a b r R - def highLevelNext : HighLevelState → Option HighLevelState | .F a b L r R => let a' := a + 2 * (r / 2) @@ -7304,13 +6176,10 @@ def highLevelNext : HighLevelState → Option HighLevelState else List.casesOn R (exitC a' b L 0 [0]) fun e R' => some (.F 0 (a' + 1) (b :: L) e R') - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB0RB_1RC0LE_1LD1LA_HHH0LC_1RF1LE_1RA0RA @@ -7318,45 +6187,36 @@ end M_1RB0RB_1RC0LE_1LD1LA_HHH0LC_1RF1LE_1RA0RA namespace M_1RB0RE_0RC1RE_1RD1LE_0LEHHH_1RA1LF_1RF0LC def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0RE_0RC1RE_1RD1LE_0LE---_1RA1LF_1RF0LC" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def encStack : List (ℕ × Bool) → ListBlank (Fin 2) | [] => default | (a, b) :: xs => ListBlank.append (([0] : List (Fin 2)) ^ (a + 1)) (ListBlank.append (if b then [1, 1] else [1]) (encStack xs)) - def incHead : List (ℕ × Bool) → List (ℕ × Bool) | [] => [] | (a, b) :: xs => (a + 1, b) :: xs - inductive RetMode where | r01 | r10 | r11 | r21 deriving DecidableEq, Repr - def unwind01 : RetMode × List (ℕ × Bool) → RetMode × List (ℕ × Bool) | (.r01, R') => (.r01, (0, false) :: R') | (.r10, R') => (.r10, (0, false) :: R') | (.r11, R') => (.r10, (0, true) :: R') | (.r21, R') => (.r11, (0, false) :: incHead R') - def unwind111 : RetMode × List (ℕ × Bool) → RetMode × List (ℕ × Bool) | (.r01, R') => (.r01, (0, true) :: R') | (.r10, R') => (.r11, (0, false) :: R') | (.r11, R') => (.r11, (0, true) :: R') | (.r21, R') => (.r21, (0, true) :: R') - def unwind11 : RetMode × List (ℕ × Bool) → RetMode × List (ℕ × Bool) | (.r01, R') => (.r21, R') | (.r10, R') => (.r01, (0, false) :: R') | (.r11, R') => (.r01, (0, true) :: R') | (.r21, R') => (.r11, (0, true) :: R') - def bounceR : List (ℕ × Bool) → Option (RetMode × List (ℕ × Bool)) | [] => some (.r11, []) | (0, false) :: R₁ => unwind01 <$> bounceR R₁ @@ -7367,11 +6227,9 @@ def bounceR : List (ℕ × Bool) → Option (RetMode × List (ℕ × Bool)) | (2, true) :: R₁ => some (.r21, incHead R₁) | (3, _) :: _ => none | (d + 4, b) :: R₁ => some (.r11, (d + 1, b) :: R₁) - inductive State where | E (L R : List (ℕ × Bool)) deriving DecidableEq, Repr - def closeRet : List (ℕ × Bool) → RetMode × List (ℕ × Bool) → State | L, (.r01, R') => .E L ((0, true) :: R') | [], (.r10, R') => .E [(0, false)] ((0, false) :: R') @@ -7386,7 +6244,6 @@ def closeRet : List (ℕ × Bool) → RetMode × List (ℕ × Bool) → State | (0, false) :: L₁, (.r21, R') => .E (incHead L₁) ((0, true) :: (0, true) :: R') | (0, true) :: L₁, (.r21, R') => .E ((0, false) :: L₁) ((0, true) :: (0, true) :: R') | (a + 1, bL) :: L₁, (.r21, R') => .E ((0, true) :: (a, bL) :: L₁) ((0, true) :: R') - def stepZero : List (ℕ × Bool) → Bool → List (ℕ × Bool) → State | [], false, R₁ => .E [] ((1, false) :: incHead R₁) | [], true, R₁ => .E [] ((1, false) :: (0, false) :: R₁) @@ -7398,52 +6255,38 @@ def stepZero : List (ℕ × Bool) → Bool → List (ℕ × Bool) → State | (1, true) :: L₁, true, R₁ => .E ((0, false) :: L₁) ((0, true) :: (0, false) :: R₁) | (a + 2, bL) :: L₁, false, R₁ => .E ((a, bL) :: L₁) ((1, false) :: incHead R₁) | (a + 2, bL) :: L₁, true, R₁ => .E ((a, bL) :: L₁) ((1, false) :: (0, false) :: R₁) - def start : State := .E [(1, false)] [(0, false)] - def encode : State → Cfg (Fin 2) (Fin 6) | .E L R => Cfg.headRight SixState.E (encStack L).tail (encStack R).tail - def next : State → Option State | .E L [] => some (closeRet L (.r11, [])) | .E L ((0, b) :: R₁) => some (stepZero L b R₁) | .E L ((d + 1, b) :: R₁) => closeRet L <$> bounceR ((d, b) :: R₁) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | E (R : List (ℕ × Bool)) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .E [(0, true)] - def toState : HighLevelState → State | .E R => .E [] R - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def exitRet : RetMode × List (ℕ × Bool) → HighLevelState | (.r01, R') => .E ((0, true) :: R') | (.r10, R') => .E ((0, false) :: (0, false) :: R') | (.r11, R') => .E ((0, false) :: (0, true) :: R') | (.r21, R') => .E ((1, false) :: (0, true) :: R') - def highLevelNext : HighLevelState → Option HighLevelState | .E [] => some (.E [(0, false), (0, true)]) | .E ((d, b) :: R₁) => Nat.casesOn d (some (.E ((1, false) :: (if b then (0, false) :: R₁ else incHead R₁)))) fun d' => exitRet <$> bounceR ((d', b) :: R₁) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB0RE_0RC1RE_1RD1LE_0LEHHH_1RA1LF_1RF0LC @@ -7451,81 +6294,58 @@ end M_1RB0RE_0RC1RE_1RD1LE_0LEHHH_1RA1LF_1RF0LC namespace M_1RB0RE_0RCHHH_1LD1LE_1LE1LD_1RF0LC_1RA1RF def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0RE_0RC---_1LD1LE_1LE1LD_1RF0LC_1RA1RF" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB theorem has_stack_reduction : HasStackReduction target := by sorry end M_1RB0RE_0RCHHH_1LD1LE_1LE1LD_1RF0LC_1RA1RF namespace M_1RB0RE_1LC0RA_1LA1LD_1LC1LF_0LC0LB_1LEHHH def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0RE_1LC0RA_1LA1LD_1LC1LF_0LC0LB_1LE---" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB theorem has_stack_reduction : HasStackReduction target := by sorry end M_1RB0RE_1LC0RA_1LA1LD_1LC1LF_0LC0LB_1LEHHH namespace M_1RB0RE_1RC1RE_1LD1LC_0RB0LC_1RF0RB_HHH1RA def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0RE_1RC1RE_1LD1LC_0RB0LC_1RF0RB_---1RA" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def encStack (s : List ℕ) : ListBlank (Fin 2) := List.rec default (fun a _ ih => ListBlank.append (([1] : List (Fin 2)) ^ (2 * a + 1)) (ListBlank.cons 0 ih)) s - def bounceRight : ℕ → List ℕ → List ℕ | 0, [] => [0, 0] | 0, d :: R => (d + 1) :: R | b + 1, R => 0 :: bounceRight b R - inductive State where | B (L R : List ℕ) deriving DecidableEq, Repr - def scanZeros (a : ℕ) (L : List ℕ) : List ℕ → Option State | [] => none | [0] => some (.B [] (L.reverse ++ [a + 2, 0])) | 0 :: 0 :: R => scanZeros (a + 2) L R | 0 :: (b + 1) :: R => some (.B ((a + 2) :: L) (b :: R)) | (b + 1) :: R => some (.B ((a + 1) :: L) (bounceRight b R)) - def start : State := .B [] [0, 1] - def encode : State → Cfg (Fin 2) (Fin 6) | .B L R => Cfg.headRight B (ListBlank.cons 0 (encStack L)) (encStack R) - def next : State → Option State | .B L [] => some (.B [] (L.reverse ++ [0, 0])) | .B L (d :: R) => scanZeros 0 (List.replicate d 0 ++ L) R - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | B (R : List ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .B [0, 1] - def toState : HighLevelState → State | .B R => .B [] R - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def peelZeroPairs (a : ℕ) : List ℕ → ℕ × List ℕ | d₁ :: d₂ :: R => if d₁ = 0 ∧ d₂ = 0 then peelZeroPairs (a + 2) R else (a, d₁ :: d₂ :: R) | R => (a, R) - def scanEpoch (L R : List ℕ) : Option HighLevelState := if R = [] then some (.B (L.reverse ++ [0, 0])) @@ -7556,16 +6376,12 @@ decreasing_by | cons _ _ => simp +zetaDelta only [List.headD_cons, List.tail_cons, List.sum_cons, List.length_cons] at * omega - def highLevelNext : HighLevelState → Option HighLevelState | .B R => scanEpoch [] R - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB0RE_1RC1RE_1LD1LC_0RB0LC_1RF0RB_HHH1RA @@ -7573,27 +6389,20 @@ end M_1RB0RE_1RC1RE_1LD1LC_0RB0LC_1RF0RB_HHH1RA namespace M_1RB1LA_1LA0RC_1RD1RC_1LE0RC_HHH0LF_1LE0LA def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LA_1LA0RC_1RD1RC_1LE0RC_---0LF_1LE0LA" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB inductive State where | D (a b : ℕ) (L R : List ℕ) | E (a : ℕ) (L R : List ℕ) deriving DecidableEq, Repr - def sweepD (a b : ℕ) (L R : List ℕ) : State := let t := R.foldl (fun t d => (d, t.1, t.2.1 :: t.2.2)) (a, b, L) .D t.1 t.2.1 t.2.2 [] - def start : State := .D 1 0 [] [] - def encode : State → Cfg (Fin 2) (Fin 6) | .D a b L R => Cfg.headRight D (encStack (a :: b :: L)) (ListBlank.cons 0 (encStack R)) | .E a L R => Cfg.headLeft E (ListBlank.append [1, 0] (encStack (a :: L))) (encStack R) - def next : State → Option State | .D a b L R => let k := a / 2 @@ -7609,27 +6418,19 @@ def next : State → Option State | .E 1 (b :: L) R => some (sweepD 0 (b + 2) (bumpHead L) R) | .E (a + 2) [] R => some (.D a 0 [] (0 :: R)) | .E (a + 2) (b :: L) R => some (.D a (b + 1) L (0 :: R)) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | D (a b : ℕ) (L : List ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .D 1 0 [] - def toState : HighLevelState → State | .D a b L => .D a b L [] - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def sweepDHL (a b : ℕ) (L R : List ℕ) : HighLevelState := let t := R.foldl (fun t d => (d, t.1, t.2.1 :: t.2.2)) (a, b, L) .D t.1 t.2.1 t.2.2 - def runE (a : ℕ) (L : List ℕ) (r₀ : ℕ) (R' : List ℕ) : Option HighLevelState := if L = [] then if a = 0 then none @@ -7665,19 +6466,15 @@ decreasing_by apply Prod.Lex.left simp +zetaDelta only [List.length_cons] omega - def highLevelNext : HighLevelState → Option HighLevelState | .D a b L => let k := a / 2 if a % 2 = 1 then some (.D k (b + k + 2) (bumpHead L)) else runE (b + k) L k [] - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB1LA_1LA0RC_1RD1RC_1LE0RC_HHH0LF_1LE0LA @@ -7685,40 +6482,31 @@ end M_1RB1LA_1LA0RC_1RD1RC_1LE0RC_HHH0LF_1LE0LA namespace M_1RB1LA_1LC0RE_HHH0LD_1RE0LF_1RA1RE_1LA0LB def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LA_1LC0RE_---0LD_1RE0LF_1RA1RE_1LA0LB" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def encRight (s : List ℕ) : ListBlank (Fin 2) := List.rec default (fun d _ ih => ListBlank.append (([1] : List (Fin 2)) ^ (d + 1)) (ListBlank.append [0, 0, 0] ih)) s - def toLeft : List ℕ → ℕ → List ℕ | [], bot => [bot] | p :: pre, bot => (p + 1) :: toLeft pre bot - def bumpPosBy (k : ℕ) : List ℕ → ℕ → List ℕ × ℕ | [], bot => ([], bot + k) | p :: pre, bot => ((p + k) :: pre, bot) - def cOneTail : List ℕ → ℕ → List ℕ × ℕ | [], bot => ([bot + 1], 0) | p :: pre, bot => let (pre', bot') := bumpPosBy 1 pre bot ((p + 2) :: pre', bot') - inductive State where | B (pre : List ℕ) (bot : ℕ) (R : List ℕ) deriving DecidableEq, Repr - def drainPos (a : ℕ) (pre : List ℕ) (bot : ℕ) (R : List ℕ) : State := let t := R.foldl (fun t r => let p := bumpPosBy 1 t.2.1 t.2.2; (r, t.1 :: p.1, p.2)) (a, pre, bot) .B ((t.1 + 2) :: t.2.1) t.2.2 [] - def peelOnes : List ℕ → ℕ → ℕ → List ℕ → Option State | [], 2, _, _ => none | [], 0, d, R => some (drainPos d [] 0 R) @@ -7760,48 +6548,35 @@ def peelOnes : List ℕ → ℕ → ℕ → List ℕ → Option State some (List.casesOn pre₂ (drainPos r₂ [bot₂ + 4] 1 R₂') fun q qs => let (pre₃, bot₃) := bumpPosBy 2 qs bot₂ drainPos r₂ ((q + 5) :: pre₃) bot₃ R₂') - def start : State := .B [] 0 [] - def encode : State → Cfg (Fin 2) (Fin 6) | .B pre bot R => Cfg.headRight B (encStack (toLeft pre bot)) (ListBlank.cons 0 (encRight R)) - def next : State → Option State | .B pre bot [] => peelOnes pre bot 0 [] | .B pre bot (r :: R) => peelOnes pre bot (r + 1) R - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB1LA_1LC0RE_HHH0LD_1RE0LF_1RA1RE_1LA0LB namespace M_1RB1LA_1RC0RF_1RDHHH_0LE1RB_HHH0LA_1LD1RF def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LA_1RC0RF_1RD---_0LE1RB_---0LA_1LD1RF" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB theorem has_stack_reduction : HasStackReduction target := by sorry end M_1RB1LA_1RC0RF_1RDHHH_0LE1RB_HHH0LA_1LD1RF namespace M_1RB1LB_1LC1LA_1RD0LB_1RA1RE_1RF0RD_HHH1RD def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LB_1LC1LA_1RD0LB_1RA1RE_1RF0RD_---1RD" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB inductive DrainMode where | A | B | BR deriving DecidableEq, Repr - inductive State where | E (a : ℕ) (L : List ℕ) (d : ℕ) (R : List ℕ) deriving DecidableEq, Repr - def bounceBEmpty : ℕ → List ℕ → Option State | d, [] => if d % 2 = 1 then none @@ -7809,7 +6584,6 @@ def bounceBEmpty : ℕ → List ℕ → Option State | d, e :: R => if d % 2 = 1 then some (.E 0 (List.replicate (d / 2) 0 ++ [1]) e R) else bounceBEmpty (e + d + 4) R - def drainLeft : DrainMode → List ℕ → ℕ → List ℕ → Option State | .A, [], d, R => bounceBEmpty (d + 1) R | .B, [], d, R => bounceBEmpty d R @@ -7822,12 +6596,9 @@ def drainLeft : DrainMode → List ℕ → ℕ → List ℕ → Option State | .BR, 0 :: L, d, R => drainLeft .BR L 0 (d :: R) | .BR, (a + 1) :: L, d, R => drainLeft (if a % 2 = 0 then .A else .B) L a (0 :: d :: R) - def start : State := .E 1 [] 0 [] - def encode : State → Cfg (Fin 2) (Fin 6) | .E a L d R => Cfg.headRight E (encStack (a :: L)) (ListBlank.cons 0 (encStack (d :: R))) - def next : State → Option State | .E a L 0 [] => drainLeft (if (a + 3) % 2 = 0 then .A else .B) L (a + 3) [0] @@ -7842,23 +6613,16 @@ def next : State → Option State List.casesOn R (drainLeft .A (List.replicate (d / 2) 0 ++ (a + 3) :: L) 0 [0]) fun e R' => drainLeft .A (List.replicate (d / 2) 0 ++ (a + 3) :: L) (e + 1) R' - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | E (k d : ℕ) (R : List ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .E 2 0 [] - def toState : HighLevelState → State | .E k d R => .E 0 (List.replicate k 0 ++ [1]) d R - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def bounceBHL : ℕ → List ℕ → Option HighLevelState | d, [] => if d % 2 = 1 then none @@ -7866,7 +6630,6 @@ def bounceBHL : ℕ → List ℕ → Option HighLevelState | d, e :: R => if d % 2 = 1 then some (.E (d / 2) e R) else bounceBHL (e + d + 4) R - def drainPre : DrainMode → List ℕ → ℕ → List ℕ → Option HighLevelState | .A, [], d, R => bounceBHL (d + 3) R | .B, [], d, R => some (.E 0 (d + 1) R) @@ -7879,7 +6642,6 @@ def drainPre : DrainMode → List ℕ → ℕ → List ℕ → Option HighLevelS | .BR, x :: Lpre, d, R => if x = 0 then drainPre .BR Lpre 0 (d :: R) else drainPre (if (x - 1) % 2 = 0 then .A else .B) Lpre (x - 1) (0 :: d :: R) - def scanR (a : ℕ) (Lpre : List ℕ) (d : ℕ) (R : List ℕ) : Option HighLevelState := List.rec (motive := fun _ => ℕ → List ℕ → ℕ → Option HighLevelState) (fun a Lpre d => @@ -7900,16 +6662,12 @@ def scanR (a : ℕ) (Lpre : List ℕ) (d : ℕ) (R : List ℕ) : Option HighLeve else drainPre .A (List.replicate ((d - 1) / 2) 0 ++ (a + 3) :: Lpre) (e + 1) R') R a Lpre d - def highLevelNext : HighLevelState → Option HighLevelState | .E k d R => scanR 0 (List.replicate k 0) d R - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB1LB_1LC1LA_1RD0LB_1RA1RE_1RF0RD_HHH1RD @@ -7917,19 +6675,13 @@ end M_1RB1LB_1LC1LA_1RD0LB_1RA1RE_1RF0RD_HHH1RD namespace M_1RB1LB_1RC0RD_0LA1RE_0RF1LC_1LA0RB_HHH1LC def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LB_1RC0RD_0LA1RE_0RF1LC_1LA0RB_---1LC" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def bump2 (s : List ℕ) : List ℕ := List.casesOn s [1] fun a xs => (a + 2) :: xs - def bump2NE (s : List ℕ) : ℕ × List ℕ := List.casesOn s (1, []) fun a xs => (a + 2, xs) - def add3 (k : ℕ) (L : List ℕ) : List ℕ := ((fun s => bumpHead (bumpHead (bumpHead s)))^[k]) L - def cSweepTail : List ℕ → ℕ → List ℕ → List ℕ | [], a₀, R => let R₁ := List.replicate (a₀ / 2) 0 ++ R @@ -7937,11 +6689,9 @@ def cSweepTail : List ℕ → ℕ → List ℕ → List ℕ | a₁ :: Lp, a₀, R => let R₂ := bump2 (List.replicate (a₀ / 2) 0 ++ R) cSweepTail Lp (if a₀ % 2 = 0 then a₁ else a₁ + 1) R₂ - inductive State where | B (L : List ℕ) (d : ℕ) (R : List ℕ) deriving DecidableEq, Repr - def runCR1 (b : ℕ) (L : List ℕ) : List ℕ → Option State | [] => some (.B [] 0 (cSweepTail L b [1])) | 0 :: R => @@ -7951,12 +6701,9 @@ def runCR1 (b : ℕ) (L : List ℕ) : List ℕ → Option State | [2] => none | 2 :: e :: R => some (.B (0 :: 1 :: b :: L) e R) | (d + 3) :: R => some (.B (2 :: b :: L) d R) - def start : State := .B [0] 0 [] - def encode : State → Cfg (Fin 2) (Fin 6) | .B L d R => Cfg.headRight B (encStack L) (ListBlank.cons 0 (encStack (d :: R))) - def next : State → Option State | .B L d R => let L₁ := add3 (d / 3) L @@ -7969,23 +6716,16 @@ def next : State → Option State runCR1 p.1 p.2 R else List.casesOn R none fun e R' => some (.B (0 :: bump2 L₁) e R') - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | B (R : List ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .B [1] - def toState : HighLevelState → State | .B R => .B [] 0 R - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def scanHL : Bool → ℕ → List ℕ → ℕ → List ℕ → Option HighLevelState | true, a, Lp, _, [] => some (.B (cSweepTail Lp a [1])) | true, a, Lp, _, r :: R' => @@ -8038,18 +6778,14 @@ decreasing_by apply Prod.Lex.left simp only [List.length_cons] omega - def highLevelNext : HighLevelState → Option HighLevelState | .B R => let p := bump2NE R scanHL false 0 [] p.1 p.2 - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB1LB_1RC0RD_0LA1RE_0RF1LC_1LA0RB_HHH1LC @@ -8057,34 +6793,27 @@ end M_1RB1LB_1RC0RD_0LA1RE_0RF1LC_1LA0RB_HHH1LC namespace M_1RB1LD_0RC0LF_1LD1RE_0LA0RB_0RD1RB_0LDHHH def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LD_0RC0LF_1LD1RE_0LA0RB_0RD1RB_0LD---" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB inductive OdomTok where | L0 | L1 | L2 deriving DecidableEq, Repr - @[simp] def odomWord : OdomTok → List (Fin 2) | .L0 => [0, 0, 1, 0] | .L1 => [1, 0, 1, 0] | .L2 => [1, 1, 0] - @[simp] def encOdom : List OdomTok → ListBlank (Fin 2) | [] => ListBlank.append [1] default | t :: l => ListBlank.append (odomWord t) (encOdom l) - @[simp] def cap : List OdomTok → ℕ | [] => 0 | .L0 :: l => 2 * cap l + 1 | .L1 :: l => 2 * cap l | .L2 :: l => cap l / 2 - @[simp] def decFuel : ℕ → List OdomTok → List OdomTok | 0, l => l @@ -8092,31 +6821,23 @@ def decFuel : ℕ → List OdomTok → List OdomTok | _ + 1, .L0 :: l => .L1 :: l | n + 1, .L1 :: l => .L0 :: decFuel n l | n + 1, .L2 :: l => .L2 :: decFuel n (decFuel n l) - def dec (l : List OdomTok) : List OdomTok := decFuel l.length l - @[simp] def drain : List OdomTok → List (Fin 2) | [] => [1, 0] | .L0 :: tl => drain tl ++ [1, 0, 1, 0] | .L1 :: tl => drain tl ++ [1, 0, 1, 0] | .L2 :: tl => drain tl ++ (if cap tl % 2 = 0 then [0, 0, 0] else [1, 0, 0]) - abbrev State : Type := List OdomTok × List (Fin 2) - def start : State := ([], []) - def encode (s : State) : Cfg (Fin 2) (Fin 6) := evalOdomR .leftOdom 2 [0] (encOdom s.1) (ListBlank.append s.2 default) - def stepLWord (l : List OdomTok) (w : List (Fin 2)) : State := if cap l ≥ 1 then (dec l, w) else ([], drain l ++ w) - def popBit : List (Fin 2) → Fin 2 × List (Fin 2) | [] => (0, []) | b :: w => (b, w) - def next (s : State) : Option State := let (l, w) := s let (b₀, w₁) := popBit w @@ -8140,25 +6861,17 @@ def next (s : State) : Option State := some (.L2 :: l, w₃) else none - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - theorem has_odometer_reduction : HasOdometerReduction target := by sorry - inductive HighLevelState where | W (w : List (Fin 2)) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .W [] - def toState : HighLevelState → State | .W w => ([], w) - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def runOdom : List OdomTok → List (Fin 2) → Option HighLevelState | l, [] => if cap l = 0 then some (.W (drain l ++ [1])) @@ -8196,16 +6909,12 @@ termination_by l w => (w.length, cap l) decreasing_by all_goals simp_wf all_goals omega - def highLevelNext : HighLevelState → Option HighLevelState | .W w => runOdom [] w - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB1LD_0RC0LF_1LD1RE_0LA0RB_0RD1RB_0LDHHH @@ -8213,35 +6922,25 @@ end M_1RB1LD_0RC0LF_1LD1RE_0LA0RB_0RD1RB_0LDHHH namespace M_1RB1LD_1RC0LE_1LA1RE_0LF1LA_1RB0RB_HHH0LB def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LD_1RC0LE_1LA1RE_0LF1LA_1RB0RB_---0LB" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB theorem has_stack_reduction : HasStackReduction target := by sorry end M_1RB1LD_1RC0LE_1LA1RE_0LF1LA_1RB0RB_HHH0LB namespace M_1RB1LF_0RC0RB_0LD1RB_1LE0LB_0LA1LC_0LBHHH def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1LF_0RC0RB_0LD1RB_1LE0LB_0LA1LC_0LB---" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB inductive State where | D (L R : List ℕ) deriving DecidableEq, Repr - def sweepB : List ℕ → List ℕ → State | L, [] => .D (incRun L) [] | L, 0 :: Rt => sweepB (incRun L) Rt | L, 1 :: Rt => sweepB (0 :: incRun L) Rt | L, (d + 2) :: Rt => .D (incRun L) ((d + 1) :: Rt) - def start : State := .D [1] [] - def encode : State → Cfg (Fin 2) (Fin 6) | .D L R => Cfg.headLeft SixState.D (encRun L) (encRun R) - def next : State → Option State | .D [] R => some (sweepB [0] (1 :: R)) | .D [0] R => some (sweepB [] (incRun (incRun R))) @@ -8255,53 +6954,38 @@ def next : State → Option State | .D (2 :: 1 :: L'') R => some (sweepB L'' (0 :: 1 :: 1 :: R)) | .D (2 :: (k + 2) :: L'') R => some (sweepB (k :: L'') (2 :: 1 :: R)) | .D ((k + 3) :: L') R => some (sweepB (0 :: k :: L') (1 :: R)) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB1LF_0RC0RB_0LD1RB_1LE0LB_0LA1LC_0LBHHH namespace M_1RB1RA_1LC0RC_1RE0LD_0RE0LF_1RAHHH_1RB1LF def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RA_1LC0RC_1RE0LD_0RE0LF_1RA---_1RB1LF" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB theorem has_stack_reduction : HasStackReduction target := by sorry end M_1RB1RA_1LC0RC_1RE0LD_0RE0LF_1RAHHH_1RB1LF namespace M_1RB1RA_1LC0RC_HHH0LD_0LE0RF_1RE0RA_0LF1LB def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RA_1LC0RC_---0LD_0LE0RF_1RE0RA_0LF1LB" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB theorem has_stack_reduction : HasStackReduction target := by sorry end M_1RB1RA_1LC0RC_HHH0LD_0LE0RF_1RE0RA_0LF1LB namespace M_1RB1RA_1RC1LB_1LD0RA_HHH0LE_1LC0LF_1RE0LB def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RA_1RC1LB_1LD0RA_---0LE_1LC0LF_1RE0LB" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB inductive State where | C (a : ℕ) (L R : List ℕ) deriving DecidableEq, Repr - def transferB : List ℕ → List ℕ → State | [], [] => .C 0 [] [] | a :: L, [] => .C (a + 1) L [] | L, d :: R => transferB (d :: bumpHead L) R - def start : State := .C 3 [0] [] - def encode : State → Cfg (Fin 2) (Fin 6) | .C a L R => Cfg.headRight C (encStack (a :: L)) (ListBlank.cons 0 (encStack2 R).tail) - def next : State → Option State | .C 0 [] _ => none | .C 0 (0 :: L) R => some (transferB ((R.headD 0 + 2) :: 0 :: L) R.tail) @@ -8314,28 +6998,20 @@ def next : State → Option State else List.casesOn L (some (.C k [] (0 :: (r + k) :: R.tail))) fun b L' => some (.C (b + k + 1) L' (0 :: (r + k) :: R.tail)) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | C (a : ℕ) (L : List ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .C 3 [0] - def toState : HighLevelState → State | .C a L => .C a L [] - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def transferBHL : List ℕ → List ℕ → HighLevelState | [], [] => .C 0 [] | a :: L, [] => .C (a + 1) L | L, d :: R => transferBHL (d :: bumpHead L) R - def runEpoch (a : ℕ) (L R : List ℕ) : Option HighLevelState := let r := R.headD 0 if a = 0 then @@ -8360,16 +7036,12 @@ decreasing_by apply Prod.Lex.left simp +zetaDelta only [List.length_cons] omega - def highLevelNext : HighLevelState → Option HighLevelState | .C a L => runEpoch a L [] - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB1RA_1RC1LB_1LD0RA_HHH0LE_1LC0LF_1RE0LB @@ -8377,65 +7049,48 @@ end M_1RB1RA_1RC1LB_1LD0RA_HHH0LE_1LC0LF_1RE0LB namespace M_1RB1RC_1LC0LE_1RD1RC_1LB0RA_HHH0LF_1RD1LF def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RC_1LC0LE_1RD1RC_1LB0RA_---0LF_1RD1LF" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB theorem has_stack_reduction : HasStackReduction target := by sorry end M_1RB1RC_1LC0LE_1RD1RC_1LB0RA_HHH0LF_1RD1LF namespace M_1RB1RD_1LC0LE_1RA0LB_1RA1RF_0RA0RC_1REHHH def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RD_1LC0LE_1RA0LB_1RA1RF_0RA0RC_1RE---" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB theorem has_stack_reduction : HasStackReduction target := by sorry end M_1RB1RD_1LC0LE_1RA0LB_1RA1RF_0RA0RC_1REHHH namespace M_1RB1RE_1LC0RA_HHH1LD_1LA0LF_0LB0LC_1RB0LB def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RE_1LC0RA_---1LD_1LA0LF_0LB0LC_1RB0LB" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def sepRight : Fin 3 → List (Fin 2) | 0 => [0] | 1 => [0, 0] | 2 => [0, 0, 0] - def encLeft : List (ℕ × Bool) → ListBlank (Fin 2) | [] => default | (a, false) :: L => ListBlank.append (([1] : List (Fin 2)) ^ (a + 1)) (ListBlank.cons 0 (encLeft L)) | (a, true) :: L => ListBlank.append (([1] : List (Fin 2)) ^ (a + 1)) (ListBlank.append [0, 0] (encLeft L)) - def encRight : List (ℕ × Fin 3) → ListBlank (Fin 2) | [] => default | (d, c) :: R => ListBlank.append (([1] : List (Fin 2)) ^ (d + 1)) (ListBlank.append (sepRight c) (encRight R)) - def bumpHeadL (s : List (ℕ × Bool)) : List (ℕ × Bool) := List.casesOn s [(0, false)] fun p L => (p.1 + 1, p.2) :: L - def bump2R : List (ℕ × Fin 3) → List (ℕ × Fin 3) | [] => [(1, 0)] | (d, c) :: R => (d + 2, c) :: R - def push01 (s : List (ℕ × Bool)) : List (ℕ × Bool) := List.casesOn s [(0, false)] fun p L => (0, true) :: (p.1, p.2) :: L - def prepend00 : ℕ → List (ℕ × Bool) → List (ℕ × Bool) | 0, L => L | k + 1, L => (0, false) :: prepend00 k L - inductive State where | D (L : List (ℕ × Bool)) (R : List (ℕ × Fin 3)) deriving DecidableEq, Repr - def runB (twoZeros : Bool) : ℕ → Bool → List (ℕ × Bool) → List (ℕ × Fin 3) → Option State | 0, _, [], R => @@ -8470,7 +7125,6 @@ def runB (twoZeros : Bool) : | a + 4, b, L', R => let R₁ := if twoZeros then (1, 1) :: R else bump2R R some (.D ((a, b) :: L') (bump2R R₁)) - def runBR (k : ℕ) (Lrest : List (ℕ × Bool)) : ℕ → Fin 3 → List (ℕ × Fin 3) → Option State | 0, _, [] => runB false 0 false (prepend00 k (push01 Lrest)) [] @@ -8501,12 +7155,9 @@ def runBR (k : ℕ) (Lrest : List (ℕ × Bool)) : some (.D (prepend00 k (push01 (bumpHeadL Lrest))) ((1, 1) :: (d₂, c₂) :: R')) | d₁ + 3, c₁, R' => some (.D (prepend00 k (push01 Lrest)) ((0, 0) :: (d₁, c₁) :: R')) - def start : State := .D [] [(1, 0)] - def encode : State → Cfg (Fin 2) (Fin 6) | .D L R => Cfg.headRight D (encLeft L) (ListBlank.cons 0 (encRight R)) - def next : State → Option State | .D [] [] => some (.D [(0, false)] [(1, 0)]) | .D [] ((d₁, c₁) :: R') => runBR 0 [] (d₁ + 1) c₁ R' @@ -8536,29 +7187,22 @@ def next : State → Option State | [], _ => some (.D [] ((2, 0) :: R₁)) | (a₂, b₂) :: L'', false => some (.D ((a₂ + 1, b₂) :: L'') ((0, 0) :: (0, 0) :: R₁)) | p :: L'', true => some (.D ((0, false) :: p :: L'') ((0, 0) :: (0, 0) :: R₁)) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB1RE_1LC0RA_HHH1LD_1LA0LF_0LB0LC_1RB0LB namespace M_1RB1RE_1LC0RC_1RA1LD_1RB0LA_0LC1RF_HHH1RD def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RE_1LC0RC_1RA1LD_1RB0LA_0LC1RF_---1RD" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def encRight (E : List ℕ) (c : ℕ) : ListBlank (Fin 2) := List.rec (ListBlank.append (([1] : List (Fin 2)) ^ (c + 1)) default) (fun e _ ih => ListBlank.append (([1] : List (Fin 2)) ^ (2 * e + 1)) (ListBlank.cons 0 ih)) E - inductive State where | B (L E : List ℕ) (c : ℕ) deriving DecidableEq, Repr - def drainD : List ℕ → List ℕ → ℕ → State | [], E, c => .B [0] E c | a :: Lt, E, c => @@ -8567,12 +7211,9 @@ def drainD : List ℕ → List ℕ → ℕ → State else List.casesOn (List.replicate (a / 2) 0 ++ E) (drainD Lt [] (c + 2)) fun e Et => drainD Lt ((e + 1) :: Et) c - def start : State := .B [0] [] 1 - def encode : State → Cfg (Fin 2) (Fin 6) | .B L E c => Cfg.headRight B (encStack L) (encRight E c) - def next : State → Option State | .B L [] c => some (drainD (bumpHeadBy c L) [] 3) | .B L [e₀] 0 => some (drainD (bumpHeadBy (2 * e₀) L) [] 2) @@ -8583,33 +7224,24 @@ def next : State → Option State | .B L (e₀ :: 0 :: E₂) c => some (drainD (bumpHeadBy (2 * e₀) L) (1 :: E₂) c) | .B L (e₀ :: 1 :: E₂) c => some (.B (4 :: bumpHeadBy (2 * e₀) L) E₂ c) | .B L (e₀ :: (e₁ + 2) :: E₂) c => some (drainD (4 :: bumpHeadBy (2 * e₀) L) (e₁ :: E₂) c) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | B (E : List ℕ) (c : ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .B [] 1 - def toState : HighLevelState → State | .B E c => .B [0] E c - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def drainEven : List ℕ → List ℕ → ℕ → HighLevelState | [], E, c => .B E c | h :: hs, E, c => List.casesOn (motive := fun _ => HighLevelState) (List.replicate h 0 ++ E) (drainEven hs [] (c + 2)) fun e Et => drainEven hs ((e + 1) :: Et) c - def drainOdd : ℕ → List ℕ → List ℕ → ℕ → HighLevelState | h₀, [], E, c => .B (List.replicate (h₀ + 1) 0 ++ E) c | h₀, h₁ :: hs, E, c => drainOdd h₁ hs (1 :: (List.replicate (h₀ - 1) 0 ++ E)) c - def peelPairs : ℕ → List ℕ → List ℕ → ℕ → Option HighLevelState | h₀, hs, [], c => if c % 2 = 0 then some (drainEven ((h₀ + c / 2) :: hs) [] 3) @@ -8624,16 +7256,12 @@ def peelPairs : ℕ → List ℕ → List ℕ → ℕ → Option HighLevelState if e₁ = 0 then some (drainEven ((h₀ + e₀) :: hs) (1 :: E₂) c) else if e₁ = 1 then peelPairs 2 ((h₀ + e₀) :: hs) E₂ c else some (drainEven (2 :: (h₀ + e₀) :: hs) ((e₁ - 2) :: E₂) c) - def highLevelNext : HighLevelState → Option HighLevelState | .B E c => peelPairs 0 [] E c - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB1RE_1LC0RC_1RA1LD_1RB0LA_0LC1RF_HHH1RD @@ -8641,21 +7269,16 @@ end M_1RB1RE_1LC0RC_1RA1LD_1RB0LA_0LC1RF_HHH1RD namespace M_1RB1RE_1LC1LB_1LE0LD_1LE1LC_0RF1RA_HHH1RA def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RE_1LC1LB_1LE0LD_1LE1LC_0RF1RA_---1RA" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB inductive State where | E (d : ℕ) (R : List ℕ) deriving DecidableEq, Repr - def drainOddB : List ℕ → ℕ → List ℕ → State | [], d, R => .E (d + 2) R | [j], d, R => .E 1 (List.replicate j 0 ++ (d + 1) :: R) | 0 :: j2 :: ks, d, R => drainOddB ks (2 * j2 + d + 6) R | (j1 + 1) :: j2 :: ks, d, R => drainOddB ks (2 * j2 + 5) (List.replicate j1 0 ++ (d + 1) :: R) - def scanE : List ℕ → ℕ → List ℕ → Option State | ks, d, [] => if d % 2 = 1 then none @@ -8665,31 +7288,22 @@ def scanE : List ℕ → ℕ → List ℕ → Option State | ks, d, e :: R => if d % 2 = 1 then scanE ((d / 2) :: ks) e R else some (drainOddB ks (d + e + 2) R) - def start : State := .E 0 [0] - def encode : State → Cfg (Fin 2) (Fin 6) | .E d R => Cfg.headRight E default (ListBlank.cons 0 (encStack (d :: R))) - def next : State → Option State | .E d R => scanE [] d R - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RB1RE_1LC1LB_1LE0LD_1LE1LC_0RF1RA_HHH1RA namespace M_1RB1RF_1LC0RE_1RD0LC_0LB0RA_1LD1RD_1RBHHH def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RF_1LC0RE_1RD0LC_0LB0RA_1LD1RD_1RB---" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def finishRet (s : List ℕ) : List ℕ := List.casesOn s [] fun r₀ R => Nat.casesOn r₀ (List.casesOn R [] fun r2 R' => 0 :: (r2 + 1) :: R') fun r => r :: R - def retPass : Bool → List Bool → List ℕ → List ℕ | false, [], R => finishRet (bumpHead R) | true, [], R => finishRet (0 :: bumpHead R) @@ -8699,7 +7313,6 @@ def retPass : Bool → List Bool → List ℕ → List ℕ | true, [true], R => finishRet (0 :: 0 :: bumpHead R) | true, true :: false :: bs, R => retPass true bs (0 :: 0 :: bumpHead R) | true, true :: true :: bs, R => retPass true bs (1 :: 0 :: bumpHead R) - def scanPass : Bool → List Bool → List ℕ → Option (List ℕ) | false, bs, [] => some (retPass false bs [0]) | true, bs, [] => some (retPass true bs [0, 0]) @@ -8713,38 +7326,27 @@ def scanPass : Bool → List Bool → List ℕ → Option (List ℕ) | true, bs, 2 :: R => scanPass false (false :: true :: false :: bs) R | true, bs, 3 :: R => scanPass true (true :: false :: bs) R | true, _, (_ + 4) :: _ => none - inductive State where | E (R : List ℕ) deriving DecidableEq, Repr - def start : State := .E [] - def encode : State → Cfg (Fin 2) (Fin 6) | .E R => Cfg.headRight E default (ListBlank.cons 0 (ListBlank.cons 1 (encStack R))) - def next : State → Option State | .E [] => some (.E [0, 0]) | .E (0 :: R) => (scanPass false [false, false] R).map .E | .E (1 :: R) => (scanPass true [false] R).map .E | .E ((_ + 2) :: _) => none - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | E (R : List ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .E [0] - def toState : HighLevelState → State | .E R => .E (0 :: R) - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def retHL : Bool → List Bool → List ℕ → List ℕ | false, [], R => bumpHead (bumpHead R) | true, [], R => 3 :: bumpHead R @@ -8754,7 +7356,6 @@ def retHL : Bool → List Bool → List ℕ → List ℕ | true, [true], R => 1 :: 0 :: bumpHead R | true, true :: false :: bs, R => retHL true bs (0 :: 0 :: bumpHead R) | true, true :: true :: bs, R => retHL true bs (1 :: 0 :: bumpHead R) - def scanHL : Bool → List Bool → List ℕ → Option HighLevelState | false, bs, [] => some (.E (retHL false bs [0])) | true, bs, [] => some (.E (retHL true bs [0, 0])) @@ -8765,16 +7366,12 @@ def scanHL : Bool → List Bool → List ℕ → Option HighLevelState else if r = 2 then scanHL false (false :: bm) R else if r = 3 then scanHL true bm R else none - def highLevelNext : HighLevelState → Option HighLevelState | .E R => scanHL false [] R - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB1RF_1LC0RE_1RD0LC_0LB0RA_1LD1RD_1RBHHH @@ -8782,21 +7379,15 @@ end M_1RB1RF_1LC0RE_1RD0LC_0LB0RA_1LD1RD_1RBHHH namespace M_1RB1RF_1LC1LF_HHH1LD_1LE0RA_1RE1LB_1RD0LD def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB1RF_1LC1LF_---1LD_1LE0RA_1RE1LB_1RD0LD" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def bumpNE (s : List ℕ) : ℕ × List ℕ := List.casesOn s (0, []) fun a xs => (a + 1, xs) - def peelEL (k : ℕ) (R : List ℕ) : List ℕ := ((fun s => 0 :: bumpHead (bumpHead s))^[k]) R - inductive State where | EL (a : ℕ) (L : List ℕ) (d : ℕ) (R : List ℕ) | E0 (L R : List ℕ) deriving DecidableEq, Repr - def runF : List ℕ → List ℕ → State | L, [] => let p := bumpNE L @@ -8813,20 +7404,16 @@ def runF : List ℕ → List ℕ → State let pR := bumpNE (bumpHead R) .EL pL.1 pL.2 pR.1 pR.2 | L, (d + 3) :: R => .E0 (bumpHead L) (d :: R) - def runE0 : List ℕ → List ℕ → State | [], R => runF [0, 0] R | [0], R => runF [0, 1, 0] R | 0 :: a :: L, R => .EL a L 0 (1 :: R) | 1 :: L, R => runE0 L (1 :: R) | (a + 2) :: L, R => .EL a L 0 (1 :: R) - def start : State := .EL 1 [] 1 [] - def encode : State → Cfg (Fin 2) (Fin 6) | .EL a L d R => Cfg.headLeft E (encStack (a :: L)) (encStack (d :: R)) | .E0 L R => Cfg.headRight E (encStack L) (ListBlank.cons 0 (encStack (0 :: R))) - def next : State → Option State | .E0 L R => some (runE0 L R) | .EL a L d R => @@ -8856,30 +7443,21 @@ def next : State → Option State List.casesOn L (some (.E0 [] R₂)) fun b L' => some (.EL b L' 0 R₂) else some (.E0 L (bumpHead (bumpHead R₁))) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry - inductive HighLevelState where | EL (a : ℕ) (L : List ℕ) (d : ℕ) (R : List ℕ) deriving DecidableEq, Repr - def highLevelStart : HighLevelState := .EL 1 [] 1 [] - def toState : HighLevelState → State | .EL a L d R => .EL a L d R - def highLevelEncode (s : HighLevelState) : Cfg (Fin 2) (Fin 6) := encode (toState s) - def countOnes (L : List ℕ) : ℕ × List ℕ := List.rec (motive := fun _ => ℕ × List ℕ) (0, []) (fun x xs p => if x = 1 then (p.1 + 1, p.2) else (0, x :: xs)) L - def pushZeroBump (k : ℕ) (L : List ℕ) : List ℕ := ((fun s => 0 :: bumpHead s)^[k]) L - def stepFHead (R' : List ℕ) (ih : List ℕ → HighLevelState) : ℕ → List ℕ → HighLevelState | 0, L => let p := bumpNE L @@ -8900,7 +7478,6 @@ def stepFHead (R' : List ℕ) (ih : List ℕ → HighLevelState) : ℕ → List .EL a Lt' 0 (1 :: (List.replicate c.1 1 ++ (d :: R'))) else .EL (x - 2) Lt 0 (1 :: (List.replicate c.1 1 ++ (d :: R'))) - def runFHL (L R : List ℕ) : HighLevelState := List.rec (motive := fun _ => List ℕ → HighLevelState) (fun L => @@ -8908,7 +7485,6 @@ def runFHL (L R : List ℕ) : HighLevelState := .EL p.1 p.2 0 []) (fun r R' ih L => stepFHead R' ih r L) R L - def runE0HL (L R : List ℕ) : HighLevelState := let c := countOnes L List.casesOn (motive := fun _ => HighLevelState) c.2 @@ -8919,7 +7495,6 @@ def runE0HL (L R : List ℕ) : HighLevelState := .EL a Lt' 0 (1 :: (List.replicate c.1 1 ++ R)) else .EL (x - 2) Lt 0 (1 :: (List.replicate c.1 1 ++ R)) - def highLevelNext : HighLevelState → Option HighLevelState | .EL a L d R => let R₁ := peelEL (a / 4) (d :: R) @@ -8946,13 +7521,10 @@ def highLevelNext : HighLevelState → Option HighLevelState some (.EL b L' 0 R₂) else some (runE0HL L R₂) - theorem is_valid_highLevel_acceleration : IsValidAcceleration target highLevelStart highLevelEncode highLevelNext := by sorry - theorem isHalt_iff_highLevel_acceleration : IsHalt target ↔ CollatzHalts highLevelNext highLevelStart := by sorry - theorem acceleration_iff_highLevel_acceleration : CollatzHalts next start ↔ CollatzHalts highLevelNext highLevelStart := by sorry end M_1RB1RF_1LC1LF_HHH1LD_1LE0RA_1RE1LB_1RD0LD @@ -8960,20 +7532,14 @@ end M_1RB1RF_1LC1LF_HHH1LD_1LE0RA_1RE1LB_1RD0LD namespace M_1RBHHH_0RC0LD_1LB1RC_0LE0LF_1RD1LE_1RF1RA def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB---_0RC0LD_1LB1RC_0LE0LF_1RD1LE_1RF1RA" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB def bump1 (s : List ℕ) : ℕ × List ℕ := List.casesOn s (0, []) fun r xs => (r + 1, xs) - def bump2 (s : List ℕ) : ℕ × List ℕ := List.casesOn s (1, []) fun c xs => (c + 2, xs) - inductive State where | CR (a b : ℕ) (L : List ℕ) (d : ℕ) (R : List ℕ) deriving DecidableEq, Repr - def stepZero (b d : ℕ) (L R : List ℕ) : State := let pL := bump2 L if b = 0 then @@ -8983,7 +7549,6 @@ def stepZero (b d : ℕ) (L R : List ℕ) : State := .CR 0 pL.1 pL.2 (d + 1) R else .CR (b - 2) pL.1 pL.2 0 (d :: R) - def stepOne (b : ℕ) (L R : List ℕ) : State := List.casesOn R (.CR 0 (b + 5) L 0 []) fun r₀ R₂ => Nat.casesOn r₀ @@ -8993,15 +7558,12 @@ def stepOne (b : ℕ) (L R : List ℕ) : State := fun e => let pR := bump1 R₂ .CR e (b + 5) L pR.1 pR.2 - def start : State := .CR 0 0 [] 0 [] - def encode : State → Cfg (Fin 2) (Fin 6) | .CR a b L d R => Cfg.headRight C (encStack (a :: b :: L)) (ListBlank.cons 0 (ListBlank.append (([1] : List (Fin 2)) ^ d) (ListBlank.cons 0 (encStack R)))) - def next : State → Option State | .CR a b L 0 R => let q := a / 3 @@ -9019,107 +7581,83 @@ def next : State → Option State | .CR (a + 2) b L (d + 1) R => let pR := bump1 R some (.CR (d + 1) (a + 1) (b :: L) pR.1 pR.2) - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RBHHH_0RC0LD_1LB1RC_0LE0LF_1RD1LE_1RF1RA namespace M_1RBHHH_0RC0RE_1RD1RF_1LE0LB_1RC0LD_1RC1RA def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB---_0RC0RE_1RD1RF_1LE0LB_1RC0LD_1RC1RA" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB theorem has_stack_reduction : HasStackReduction target := by sorry end M_1RBHHH_0RC0RE_1RD1RF_1LE0LB_1RC0LD_1RC1RA namespace M_1RBHHH_0RC1RD_1LA0LA_1LE0RB_1LF1LE_1LC0LD def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB---_0RC1RD_1LA0LA_1LE0RB_1LF1LE_1LC0LD" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB theorem has_stack_reduction : HasStackReduction target := by sorry end M_1RBHHH_0RC1RD_1LA0LA_1LE0RB_1LF1LE_1LC0LD namespace M_1RBHHH_1LC0RF_0RA0LD_1LE1LA_1RF0LF_0LC0RA def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB---_1LC0RF_0RA0LD_1LE1LA_1RF0LF_0LC0RA" - -abbrev target : Machine (Fin 2) (Fin 6) := - machine.toBB - +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB inductive Sep where | s1 | s2 | s3 | s4 deriving DecidableEq, Repr - def encSep : Sep → List (Fin 2) | .s1 => [0] | .s2 => [0, 0] | .s3 => [0, 0, 0] | .s4 => [0, 0, 0, 0] - def encStack : List (ℕ × Sep) → ListBlank (Fin 2) | [] => default | (a, b) :: xs => ListBlank.append (([1] : List (Fin 2)) ^ (a + 1)) (ListBlank.append (encSep b) (encStack xs)) - inductive State where | M0 (L R : List (ℕ × Sep)) deriving DecidableEq, Repr - def bumpHead : List (ℕ × Sep) → List (ℕ × Sep) | [] => [(0, .s1)] | (a, b) :: xs => (a + 1, b) :: xs - def tailAsRight : List (ℕ × Sep) → List (ℕ × Sep) | [] => [(0, .s1)] | (a, b) :: xs => (a, b) :: xs - def rightAsTail : List (ℕ × Sep) → List (ℕ × Sep) | [] => [] | (a, b) :: xs => (a + 1, b) :: xs - def pushZeroSep (b : Sep) : List (ℕ × Sep) → List (ℕ × Sep) | [] => [] | (a, b') :: xs => (0, b) :: (a, b') :: xs - def peelSep : Sep → List (ℕ × Sep) → List (ℕ × Sep) | _, [] => [] | .s1, (a, b') :: xs => (a + 1, b') :: xs | .s2, (a, b') :: xs => (0, .s1) :: (a, b') :: xs | .s3, (a, b') :: xs => (0, .s2) :: (a, b') :: xs | .s4, (a, b') :: xs => (0, .s3) :: (a, b') :: xs - def peelInner : Sep → List (ℕ × Sep) → List (ℕ × Sep) | _, [] => [(0, .s1)] | .s2, (a₂, b₂) :: rs => (a₂ + 1, b₂) :: rs | .s3, (a₂, b₂) :: rs => (0, .s1) :: (a₂, b₂) :: rs | _, (a₂, b₂) :: rs => (0, .s2) :: (a₂, b₂) :: rs - def popRD : Sep → List (ℕ × Sep) → List (ℕ × Sep) | .s1, R => rightAsTail (tailAsRight R) | .s2, R => (0, .s1) :: tailAsRight R | .s3, R => (0, .s2) :: tailAsRight R | .s4, R => (0, .s3) :: tailAsRight R - def sepParity : Sep → ℕ | .s1 => 0 | .s2 => 1 | .s3 => 0 | .s4 => 1 - def weightR : List (ℕ × Sep) → ℕ | [] => 0 | (a, b) :: rs => if rs.isEmpty then a else a + sepParity b + weightR rs - inductive FState where | f00 | f01 @@ -9128,13 +7666,11 @@ inductive FState where | f04 | f05 deriving DecidableEq, Repr - inductive Stage3Mode where | q0 | qz | qz1 deriving DecidableEq, Repr - def stepBit0 (runZ1 : List (ℕ × Sep) → Option (FState × List (ℕ × Sep))) : FState × List (ℕ × Sep) → Option (FState × List (ℕ × Sep)) | (.f00, R₁) => some (.f01, R₁) @@ -9143,7 +7679,6 @@ def stepBit0 (runZ1 : List (ℕ × Sep) → Option (FState × List (ℕ × Sep)) | (.f03, R₁) => some (.f04, R₁) | (.f04, R₁) => some (.f00, (0, .s1) :: (0, .s1) :: R₁) | (.f05, R₁) => some (.f00, (0, .s1) :: (0, .s1) :: R₁) - def stepBit1 (runZ : List (ℕ × Sep) → Option (FState × List (ℕ × Sep))) : FState × List (ℕ × Sep) → Option (FState × List (ℕ × Sep)) | (.f00, R₁) => runZ R₁ @@ -9152,7 +7687,6 @@ def stepBit1 (runZ : List (ℕ × Sep) → Option (FState × List (ℕ × Sep))) | (.f03, R₁) => some (.f05, R₁) | (.f04, R₁) => some (.f00, (0, .s3) :: R₁) | (.f05, _) => none - def evalQ0Aux (runZ runZ1 : List (ℕ × Sep) → Option (FState × List (ℕ × Sep))) : List (ℕ × Sep) → Option (FState × List (ℕ × Sep)) @@ -9174,7 +7708,6 @@ def evalQ0Aux | (1, .s3) :: Rt => (runZ1 (peelInner .s3 Rt)).bind (stepBit1 runZ) | (1, .s4) :: Rt => (runZ1 (peelInner .s4 Rt)).bind (stepBit1 runZ) | (_ + 2, _) :: _ => none - def evalStage3 : ℕ → Stage3Mode → List (ℕ × Sep) → Option (FState × List (ℕ × Sep)) | 0, _, _ => some (.f00, [(0, .s1)]) | fuel + 1, m, R => @@ -9185,7 +7718,6 @@ def evalStage3 : ℕ → Stage3Mode → List (ℕ × Sep) → Option (FState × | .q0 => res0 | .qz => res0.bind (stepBit0 runZ1) | .qz1 => (res0.bind (stepBit0 runZ1)).bind (stepBit1 runZ) - def exitF (L₂ : List (ℕ × Sep)) : FState × List (ℕ × Sep) → State | (.f00, R) => .M0 ((0, .s4) :: tailAsRight L₂) ((0, .s1) :: R) | (.f01, R) => .M0 ((0, .s1) :: (0, .s3) :: tailAsRight L₂) (rightAsTail (bumpHead R)) @@ -9193,7 +7725,6 @@ def exitF (L₂ : List (ℕ × Sep)) : FState × List (ℕ × Sep) → State | (.f03, R) => .M0 ((0, .s1) :: (0, .s3) :: tailAsRight L₂) ((0, .s2) :: R) | (.f04, R) => .M0 ((0, .s1) :: (0, .s4) :: tailAsRight L₂) ((0, .s2) :: R) | (.f05, R) => .M0 ((0, .s1) :: (0, .s4) :: tailAsRight L₂) ((0, .s2) :: R) - def stepD : Sep → List (ℕ × Sep) → List (ℕ × Sep) → Option State | c, [], R => some (.M0 [(0, .s1), (0, .s1)] (popRD c R)) | c, (0, .s1) :: [], R => some (.M0 [(0, .s1), (0, .s1)] (popRD c R)) @@ -9231,297 +7762,218 @@ def stepD : Sep → List (ℕ × Sep) → List (ℕ × Sep) → Option State | c, (1, b₁) :: L₁, R => some (.M0 (peelSep b₁ L₁) ((1, c) :: tailAsRight R)) | _, (_ + 2, _) :: _, _ => none - def start : State := .M0 [(0, .s1), (0, .s1)] [(1, .s1)] - def encode : State → Cfg (Fin 2) (Fin 6) | .M0 L R => Cfg.headRight SixState.A (encStack L).tail (ListBlank.cons 0 (encStack R).tail) - def next : State → Option State | .M0 L [] => stepD .s1 L [] | .M0 L ((0, bR) :: Rt) => stepD .s1 L (peelSep bR Rt) | .M0 L ((1, bR) :: Rt) => some (.M0 ((0, .s1) :: tailAsRight L) (peelSep bR Rt)) | .M0 L ((2, bR) :: Rt) => some (.M0 ((0, .s2) :: tailAsRight L) (peelSep bR Rt)) | .M0 _ ((_ + 3, _) :: _) => none - theorem is_valid_acceleration : IsValidAcceleration target start encode next := by sorry - theorem isHalt_iff_acceleration : IsHalt target ↔ CollatzHalts next start := by sorry end M_1RBHHH_1LC0RF_0RA0LD_1LE1LA_1RF0LF_0LC0RA namespace BB6.HardnessEvidence namespace M_1RB1LC_1RC0RF_1RD0LB_1RE0LD_1LFHHH_0RA1LA open BusyBeaver.M_1RB1LC_1RC0RF_1RD0LB_1RE0LD_1LFHHH_0RA1LA - theorem halting_state_witness : next (.S6 2) = none := by sorry - theorem halting_state_witness_17 : next (.S6 17) = none := by sorry - theorem halting_state_witness_25 : next (.S6 25) = none := by sorry - theorem halting_residue_class (a k : ℕ) : next_HubTail_r_3 a (5 * k + 3) = none := by sorry end M_1RB1LC_1RC0RF_1RD0LB_1RE0LD_1LFHHH_0RA1LA namespace M_1RB1RD_0LC1RA_1LA1LC_1RA1LE_1RF0LD_HHH0RE open BusyBeaver.M_1RB1RD_0LC1RA_1LA1LC_1RA1LE_1RF0LD_HHH0RE - theorem halting_state_witness : highLevelNext (.P_1 1 2) = none := by sorry - theorem halting_residue_class (k : ℕ) : highLevelNext (.P_1 (2 * k + 1) 2) = none := by sorry - theorem halting_residue_class_iff (a : ℕ) : highLevelNext (.P_1 a 2) = none ↔ a % 2 = 1 := by sorry end M_1RB1RD_0LC1RA_1LA1LC_1RA1LE_1RF0LD_HHH0RE namespace M_1RB1RD_0LC1RA_1RA1LC_0RB1LE_1RF0LD_HHH0RE open BusyBeaver.M_1RB1RD_0LC1RA_1RA1LC_0RB1LE_1RF0LD_HHH0RE - theorem halting_state_witness : highLevelNext (.D false 0 2) = none := by sorry - theorem halting_residue_class (a : ℕ) : highLevelNext (.D false a (2 * a + 2)) = none := by sorry - theorem halting_residue_class_true (a : ℕ) : highLevelNext (.D true a (2 * a + 2)) = none := by sorry - theorem halting_residue_class_two_step (a : ℕ) : highLevelNext (.D true a (6 * a + 16)) = none := by sorry end M_1RB1RD_0LC1RA_1RA1LC_0RB1LE_1RF0LD_HHH0RE namespace M_1RB1RD_0LC1RA_0RA1LC_1RA1LE_1RF0LD_HHH0RE open BusyBeaver.M_1RB1RD_0LC1RA_0RA1LC_1RA1LE_1RF0LD_HHH0RE - theorem halting_state_witness : highLevelNext (.D 0 2) = none := by sorry - theorem halting_residue_class (a : ℕ) : highLevelNext (.D a (2 * a + 2)) = none := by sorry - theorem halting_residue_class_two_step (a : ℕ) : highLevelNext (.D a (6 * a + 12)) = none := by sorry end M_1RB1RD_0LC1RA_0RA1LC_1RA1LE_1RF0LD_HHH0RE namespace M_1RB0LF_1RC1RA_0RD0RB_1LEHHH_0LA1LE_1RD1LA open BusyBeaver.M_1RB0LF_1RC1RA_0RD0RB_1LEHHH_0LA1LE_1RD1LA - theorem halting_state_witness : highLevelNext (.J 1 1) = none := by sorry - theorem halting_residue_class (k : ℕ) : highLevelNext (.J (k + 1) (2 * k + 1)) = none := by sorry end M_1RB0LF_1RC1RA_0RD0RB_1LEHHH_0LA1LE_1RD1LA namespace M_1RB1LF_0RC1RD_1LA1LD_1LE0RA_HHH1LC_0LA1LA open BusyBeaver.M_1RB1LF_0RC1RD_1LA1LD_1LE0RA_HHH1LC_0LA1LA - theorem halting_state_witness : highLevelNext (.C 1 8) = none := by sorry - theorem halting_residue_class (a : ℕ) : highLevelNext (.C (a + 1) (2 * a + 8)) = none := by sorry - theorem halting_residue_class' (a : ℕ) : highLevelNext (.C (a + 1) (2 * a + 10)) = none := by sorry - theorem halting_residue_class_odd (j : ℕ) : highLevelNext (.C (j + 3) (2 * j + 1)) = none := by sorry - theorem halting_residue_class_odd' (j : ℕ) : highLevelNext (.C (j + 4) (2 * j + 1)) = none := by sorry end M_1RB1LF_0RC1RD_1LA1LD_1LE0RA_HHH1LC_0LA1LA namespace M_1RB1RB_1LC0RE_HHH1LD_0RA1LB_1RA1LF_0LE1LE open BusyBeaver.M_1RB1RB_1LC0RE_HHH1LD_0RA1LB_1RA1LF_0LE1LE - theorem halting_state_witness : highLevelNext (.C 0 0 false) = none := by sorry - theorem halting_residue_class (a : ℕ) (p : Bool) : highLevelNext (.C a a p) = none := by sorry - theorem halting_residue_class' (a : ℕ) (p : Bool) : highLevelNext (.C a (a + 1) p) = none := by sorry end M_1RB1RB_1LC0RE_HHH1LD_0RA1LB_1RA1LF_0LE1LE namespace M_1RB0LC_0LC1RF_1LE1RD_0RC1RC_0LA1LA_HHH1RA open BusyBeaver.M_1RB0LC_0LC1RF_1LE1RD_0RC1RC_0LA1LA_HHH1RA - theorem halting_state_witness : highLevelNext (.E false 1 1) = none := by sorry - theorem halting_residue_class (p : Bool) (j : ℕ) : highLevelNext (.E p (2 * j + 1) 1) = none := by sorry end M_1RB0LC_0LC1RF_1LE1RD_0RC1RC_0LA1LA_HHH1RA namespace M_1RB0LF_1LC0LD_1RD1LB_HHH1RE_0RA1RE_1LA0LE open BusyBeaver.M_1RB0LF_1LC0LD_1RD1LB_HHH1RE_0RA1RE_1LA0LE - theorem halting_state_witness : highLevelNext (.A 4 0) = none := by sorry - theorem halting_residue_class (c : ℕ) : highLevelNext (.A (2 * (c / 2) + 4) c) = none := by sorry - theorem halting_residue_class_iff (b c : ℕ) : highLevelNext (.A b c) = none ↔ b = 2 * (c / 2) + 4 := by sorry end M_1RB0LF_1LC0LD_1RD1LB_HHH1RE_0RA1RE_1LA0LE namespace M_1RB0RE_1LC0RA_1RF0RD_HHH1LE_0LB1LE_1LE1RC open BusyBeaver.M_1RB0RE_1LC0RA_1RF0RD_HHH1LE_0LB1LE_1LE1RC - theorem halting_state_witness : highLevelNext (.A 4 0) = none := by sorry - theorem halting_residue_class (c : ℕ) : highLevelNext (.A (2 * (c / 2) + 4) c) = none := by sorry - theorem halting_residue_class_iff (b c : ℕ) : highLevelNext (.A b c) = none ↔ b = 2 * (c / 2) + 4 := by sorry end M_1RB0RE_1LC0RA_1RF0RD_HHH1LE_0LB1LE_1LE1RC namespace M_1RB1LF_1RC1RF_0LD1RE_HHH1LC_0RB1RE_1LA0LE open BusyBeaver.M_1RB1LF_1RC1RF_0LD1RE_HHH1LC_0RB1RE_1LA0LE - theorem halting_state_witness : highLevelNext (.C0 0 1) = none := by sorry - theorem halting_state_witness_C1 : highLevelNext (.C1 0 0 0) = none := by sorry - theorem halting_residue_class (k : ℕ) : highLevelNext (.C0 (k + 1) (2 * k + 3)) = none := by sorry end M_1RB1LF_1RC1RF_0LD1RE_HHH1LC_0RB1RE_1LA0LE namespace M_1RB1LD_1RC0RA_1LA1RE_0LA0LB_0RB1RF_HHH1RD open BusyBeaver.M_1RB1LD_1RC0RA_1LA1RE_0LA0LB_0RB1RF_HHH1RD - theorem halting_state_witness : highLevelNext (.C 0 2) = none := by sorry - theorem halting_residue_class (b : ℕ) : highLevelNext (.C b (b + 2)) = none := by sorry end M_1RB1LD_1RC0RA_1LA1RE_0LA0LB_0RB1RF_HHH1RD namespace M_1RB0RC_1LC1RE_1RA1LD_0LC0LA_1RF1RD_HHH0RD open BusyBeaver.M_1RB0RC_1LC1RE_1RA1LD_0LC0LA_1RF1RD_HHH0RD - theorem halting_state_witness : highLevelNext (.S false 2 1) = none := by sorry - theorem halting_residue_class (q : ℕ) : highLevelNext (.S false (3 * q + 2) (q + 1)) = none := by sorry - theorem halting_residue_class_hat (q : ℕ) : highLevelNext (.S true (3 * q + 2) (q + 2)) = none := by sorry end M_1RB0RC_1LC1RE_1RA1LD_0LC0LA_1RF1RD_HHH0RD namespace M_1RB1RF_1LCHHH_1LE1RD_1RA0RC_0LF0LA_0LD0RB open BusyBeaver.M_1RB1RF_1LCHHH_1LE1RD_1RA0RC_0LF0LA_0LD0RB - theorem halting_state_witness : highLevelNext (.P 0 2) = none := by sorry - theorem halting_residue_class (b : ℕ) : highLevelNext (.P b (b + 2)) = none := by sorry - theorem halting_residue_class_iff (b c : ℕ) : highLevelNext (.P b c) = none ↔ c = b + 2 := by sorry end M_1RB1RF_1LCHHH_1LE1RD_1RA0RC_0LF0LA_0LD0RB namespace M_1RB0LE_0RC1RC_0RD1LA_1LD0LA_1LF1LC_HHH0LA open BusyBeaver.M_1RB0LE_0RC1RC_0RD1LA_1LD0LA_1LF1LC_HHH0LA - theorem halting_state_witness : highLevelNext (.D 1 0) = none := by sorry - theorem halting_residue_class (a d : ℕ) (ha : a % 2 = 1) (had : a < d + 3) : highLevelNext (.D a d) = none := by sorry - theorem halting_residue_class_diag (k : ℕ) : highLevelNext (.D (2 * k + 1) (2 * k + 1)) = none := by sorry end M_1RB0LE_0RC1RC_0RD1LA_1LD0LA_1LF1LC_HHH0LA namespace M_1RB0LE_0RC1RC_0RD1LA_1LD0LA_1LF1LC_HHH1LC open BusyBeaver.M_1RB0LE_0RC1RC_0RD1LA_1LD0LA_1LF1LC_HHH1LC - theorem halting_state_witness : highLevelNext (.D 1 0) = none := by sorry - theorem halting_residue_class (a d : ℕ) (ha : a % 2 = 1) (had : a < d + 3) : highLevelNext (.D a d) = none := by sorry - theorem halting_residue_class_diag (k : ℕ) : highLevelNext (.D (2 * k + 1) (2 * k + 1)) = none := by sorry end M_1RB0LE_0RC1RC_0RD1LA_1LD0LA_1LF1LC_HHH1LC namespace M_1RB1LE_1RC1RA_0LD1RB_1LE1LD_1RF0LA_HHH0RE open BusyBeaver.M_1RB1LE_1RC1RA_0LD1RB_1LE1LD_1RF0LA_HHH0RE - theorem halting_state_witness : highLevelNext (.E 0 2) = none := by sorry - theorem halting_residue_class (b : ℕ) : highLevelNext (.E b (2 * b + 2)) = none := by sorry - theorem halting_residue_class_iff (b d : ℕ) : highLevelNext (.E b d) = none ↔ d = 2 * b + 2 := by sorry end M_1RB1LE_1RC1RA_0LD1RB_1LE1LD_1RF0LA_HHH0RE namespace M_1RB1RF_1LC1LF_0RE1LD_0LB1LD_HHH1RC_1RA0RD open BusyBeaver.M_1RB1RF_1LC1LF_0RE1LD_0LB1LD_HHH1RC_1RA0RD - theorem halting_state_witness : next (.E 0 0 6) = none := by sorry - theorem halting_residue_class (a : ℕ) : next (.E a 0 6) = none := by sorry - theorem halting_residue_class_multi_step (a b : ℕ) : CollatzHalts next (.E a b (2 * b + 6)) := by sorry end M_1RB1RF_1LC1LF_0RE1LD_0LB1LD_HHH1RC_1RA0RD namespace M_1RB1RC_1LC1LC_1RE0LD_1LB1RF_HHH1RA_0RD1RD open BusyBeaver.M_1RB1RC_1LC1LC_1RE0LD_1LB1RF_HHH1RA_0RD1RD - theorem halting_state_witness : highLevelNext (.C 0 0) = none := by sorry - theorem halting_residue_class (a : ℕ) : highLevelNext (.C a 0) = none := by sorry - theorem halting_residue_class_two_step (a : ℕ) : (highLevelNext (.C a (a / 2 + 4))).bind highLevelNext = none := by sorry end M_1RB1RC_1LC1LC_1RE0LD_1LB1RF_HHH1RA_0RD1RD namespace M_1RB0LF_1LC1RA_0RE0RD_HHH1LE_1LF1RC_1LC1LA open BusyBeaver.M_1RB0LF_1LC1RA_0RE0RD_HHH1LE_1LF1RC_1LC1LA - theorem halting_state_witness : highLevelNext (.C 0 1) = none := by sorry - theorem halting_residue_class (a : ℕ) : highLevelNext (.C a 1) = none := by sorry - theorem halting_residue_class_two_step (a : ℕ) : (highLevelNext (.C a (2 * a + 3))).bind highLevelNext = none := by sorry end M_1RB0LF_1LC1RA_0RE0RD_HHH1LE_1LF1RC_1LC1LA namespace M_1RB1LA_1LA0RC_1RD1RC_1LE0RC_HHH0LF_1LE0LA open BusyBeaver.M_1RB1LA_1LA0RC_1RD1RC_1LE0RC_HHH0LF_1LE0LA - theorem halting_state_witness : highLevelNext (.D 0 0 []) = none := by sorry - theorem halting_residue_class (m : ℕ) : highLevelNext (.D 0 (2 ^ (m + 1) - 2) []) = none := by sorry end M_1RB1LA_1LA0RC_1RD1RC_1LE0RC_HHH0LF_1LE0LA namespace M_1RB0RB_1RC0LE_1LD1LA_HHH0LC_1RF1LE_1RA0RA open BusyBeaver.M_1RB0RB_1RC0LE_1LD1LA_HHH0LC_1RF1LE_1RA0RA - theorem halting_state_witness : highLevelNext (.F 0 0 [] 1 []) = none := by sorry - theorem halting_residue_class (L : List ℕ) : highLevelNext (.F 0 0 L 1 []) = none := by sorry end M_1RB0RB_1RC0LE_1LD1LA_HHH0LC_1RF1LE_1RA0RA namespace M_1RB0LD_1LC1RD_0LE1LA_0RB1RD_HHH0LF_1RA1LF open BusyBeaver.M_1RB0LD_1LC1RD_0LE1LA_0RB1RD_HHH0LF_1RA1LF - theorem halting_state_witness : highLevelNext (.C 0 []) = none := by sorry - theorem halting_residue_class (m : ℕ) : highLevelNext (.C (2 ^ m - 1) []) = none := by sorry end M_1RB0LD_1LC1RD_0LE1LA_0RB1RD_HHH0LF_1RA1LF namespace M_1RB1RA_1RC1LB_1LD0RA_HHH0LE_1LC0LF_1RE0LB open BusyBeaver.M_1RB1RA_1RC1LB_1LD0RA_HHH0LE_1LC0LF_1RE0LB - theorem halting_state_witness : highLevelNext (.C 0 []) = none := by sorry - theorem halting_residue_class (m : ℕ) : highLevelNext (.C (2 ^ (m + 1) - 2) []) = none := by sorry end M_1RB1RA_1RC1LB_1LD0RA_HHH0LE_1LC0LF_1RE0LB namespace M_1RBHHH_0RC0LD_1LB1RC_0LE0LF_1RD1LE_1RF1RA open BusyBeaver.M_1RBHHH_0RC0LD_1LB1RC_0LE0LF_1RD1LE_1RF1RA - theorem halting_state_witness : next (.CR 1 0 [] 1 []) = none := by sorry - theorem halting_residue_class (b : ℕ) (L : List ℕ) (d : ℕ) (R : List ℕ) : next (.CR 1 b L (d + 1) R) = none := by sorry - theorem halting_residue_class_two_step (a b : ℕ) (L : List ℕ) (r : ℕ) (R : List ℕ) : (next (.CR (a + 2) b L 1 (r :: R))).bind next = none := by sorry end M_1RBHHH_0RC0LD_1LB1RC_0LE0LF_1RD1LE_1RF1RA namespace M_1RB1RF_1LC1LF_HHH1LD_1LE0RA_1RE1LB_1RD0LD open BusyBeaver.M_1RB1RF_1LC1LF_HHH1LD_1LE0RA_1RE1LB_1RD0LD - theorem halting_state_witness : highLevelNext (.EL 0 [] 0 []) = none := by sorry - theorem halting_residue_class (k d : ℕ) (R : List ℕ) : highLevelNext (.EL (4 * k) [] d R) = none := by sorry end M_1RB1RF_1LC1LF_HHH1LD_1LE0RA_1RE1LB_1RD0LD @@ -9530,12 +7982,1268 @@ end BB6.HardnessEvidence end BusyBeaver namespace BusyBeaver.M_1RB0LF_1RC0RA_1LD0RB_0LE0LC_0LA0LC_0LBHHH - def machine : ConjectureMachines.Machine 6 2 := load_rle_machine% "1RB0LF_1RC0RA_1LD0RB_0LE0LC_0LA0LC_0LB---" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LF_1RC0RA_1LD0RB_0LE0LC_0LA0LC_0LBHHH + +namespace BusyBeaver.M_1RB0LB_0LC0RE_1LA1LD_0LB1LD_1RA0RF_1RAHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LB_0LC0RE_1LA1LD_0LB1LD_1RA0RF_1RAHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB0LB_0LC0RE_1LA1LD_0LB1LD_1RA0RF_1RAHHH + +namespace BusyBeaver.M_1RB0LB_0LC0RE_1LA1LD_0LB1LF_1RA1RD_0LBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LB_0LC0RE_1LA1LD_0LB1LF_1RA1RD_0LBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB0LB_0LC0RE_1LA1LD_0LB1LF_1RA1RD_0LBHHH + +namespace BusyBeaver.M_1RB0LB_0LC0RE_1LA1LD_0LB1RF_1RA1RD_HHH1LC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LB_0LC0RE_1LA1LD_0LB1RF_1RA1RD_HHH1LC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB0LB_0LC0RE_1LA1LD_0LB1RF_1RA1RD_HHH1LC + +namespace BusyBeaver.M_1RB0LC_1LC0RE_1RF1LD_1LA0LB_1RD1RA_1LBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LC_1LC0RE_1RF1LD_1LA0LB_1RD1RA_1LBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB0LC_1LC0RE_1RF1LD_1LA0LB_1RD1RA_1LBHHH + +namespace BusyBeaver.M_1RB0LD_1LC0RD_1RE0RA_1LE0RF_1LA1RC_0LBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LD_1LC0RD_1RE0RA_1LE0RF_1LA1RC_0LBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB0LD_1LC0RD_1RE0RA_1LE0RF_1LA1RC_0LBHHH + +namespace BusyBeaver.M_1RB0LD_1RC0RF_1LC1LA_0LEHHH_1LF0RB_0RC0RE +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LD_1RC0RF_1LC1LA_0LEHHH_1LF0RB_0RC0RE" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB0LD_1RC0RF_1LC1LA_0LEHHH_1LF0RB_0RC0RE + +namespace BusyBeaver.M_1RB0LE_0RC0RB_1LD0LD_1RA1LC_HHH1LF_1LA0LC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LE_0RC0RB_1LD0LD_1RA1LC_HHH1LF_1LA0LC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB0LE_0RC0RB_1LD0LD_1RA1LC_HHH1LF_1LA0LC + +namespace BusyBeaver.M_1RB0LF_1RCHHH_1LD0RF_1RA0LE_0LD1LD_0RD0RB +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LF_1RCHHH_1LD0RF_1RA0LE_0LD1LD_0RD0RB" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB0LF_1RCHHH_1LD0RF_1RA0LE_0LD1LD_0RD0RB + +namespace BusyBeaver.M_1RB0RA_1LC0RE_1LD0LC_1RA1LE_1LC0LF_0RAHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0RE_1LD0LC_1RA1LE_1LC0LF_0RAHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB0RA_1LC0RE_1LD0LC_1RA1LE_1LC0LF_0RAHHH + +namespace BusyBeaver.M_1RB0RB_1RC0RD_1LD1RC_1RF0LE_1LC1LE_HHH0RA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RB_1RC0RD_1LD1RC_1RF0LE_1LC1LE_HHH0RA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB0RB_1RC0RD_1LD1RC_1RF0LE_1LC1LE_HHH0RA + +namespace BusyBeaver.M_1RB0RC_1LC1RF_1RA1LD_1RD0LE_1LD1LC_0REHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RC_1LC1RF_1RA1LD_1RD0LE_1LD1LC_0REHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB0RC_1LC1RF_1RA1LD_1RD0LE_1LD1LC_0REHHH + +namespace BusyBeaver.M_1RB0RC_1RC0LD_1LD1RA_1LF0LE_HHH0RD_1LB0LA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RC_1RC0LD_1LD1RA_1LF0LE_HHH0RD_1LB0LA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB0RC_1RC0LD_1LD1RA_1LF0LE_HHH0RD_1LB0LA + +namespace BusyBeaver.M_1RB0RD_1LC0RA_HHH1RD_1RA1LE_1RC0LF_1LE0LB +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RD_1LC0RA_HHH1RD_1RA1LE_1RC0LF_1LE0LB" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB0RD_1LC0RA_HHH1RD_1RA1LE_1RC0LF_1LE0LB + +namespace BusyBeaver.M_1RB0RD_1LC1RE_1LA0LD_0RE0RF_1LC1RA_0LEHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RD_1LC1RE_1LA0LD_0RE0RF_1LC1RA_0LEHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB0RD_1LC1RE_1LA0LD_0RE0RF_1LC1RA_0LEHHH + +namespace BusyBeaver.M_1RB0RD_1RC0LC_1RE1RA_0LD1LA_0LF0LD_0REHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RD_1RC0LC_1RE1RA_0LD1LA_0LF0LD_0REHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB0RD_1RC0LC_1RE1RA_0LD1LA_0LF0LD_0REHHH + +namespace BusyBeaver.M_1RB0RE_1RC0RA_0LD0LB_0LA1LE_1LC1LF_0LAHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1RC0RA_0LD0LB_0LA1LE_1LC1LF_0LAHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB0RE_1RC0RA_0LD0LB_0LA1LE_1LC1LF_0LAHHH + +namespace BusyBeaver.M_1RB0RF_0RC1RD_0LDHHH_1LE1RA_1LA0LF_0RD0RC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_0RC1RD_0LDHHH_1LE1RA_1LA0LF_0RD0RC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB0RF_0RC1RD_0LDHHH_1LE1RA_1LA0LF_0RD0RC + +namespace BusyBeaver.M_1RB0RF_1LC1RE_1LD0LC_0LE0RE_1RA1LD_1RBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1LC1RE_1LD0LC_0LE0RE_1RA1LD_1RBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB0RF_1LC1RE_1LD0LC_0LE0RE_1RA1LD_1RBHHH + +namespace BusyBeaver.M_1RB0RF_1RC0RB_1LD1RA_1LE0LD_1RB0LA_0LDHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1RC0RB_1LD1RA_1LE0LD_1RB0LA_0LDHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB0RF_1RC0RB_1LD1RA_1LE0LD_1RB0LA_0LDHHH +namespace BusyBeaver.M_1RB1LA_0LB1LC_1RD0LD_0LA0RE_1RC1RF_0LDHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LA_0LB1LC_1RD0LD_0LA0RE_1RC1RF_0LDHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB1LA_0LB1LC_1RD0LD_0LA0RE_1RC1RF_0LDHHH + +namespace BusyBeaver.M_1RB1LC_1RC1RE_0LF1RD_0RA0LD_HHH1RC_1LA0LA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LC_1RC1RE_0LF1RD_0RA0LD_HHH1RC_1LA0LA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB1LC_1RC1RE_0LF1RD_0RA0LD_HHH1RC_1LA0LA + +namespace BusyBeaver.M_1RB1RA_1LC0RD_1LD1LB_1RA0LE_0LB1LF_1RCHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RA_1LC0RD_1LD1LB_1RA0LE_0LB1LF_1RCHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB1RA_1LC0RD_1LD1LB_1RA0LE_0LB1LF_1RCHHH + +namespace BusyBeaver.M_1RB1RA_1LC0RE_1LD1LB_1RA0LE_1RA0LF_0LBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RA_1LC0RE_1LD1LB_1RA0LE_1RA0LF_0LBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB1RA_1LC0RE_1LD1LB_1RA0LE_1RA0LF_0LBHHH + +namespace BusyBeaver.M_1RB1RC_1LC0LF_1RF0LD_0RE1LB_1RCHHH_1LD0RA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RC_1LC0LF_1RF0LD_0RE1LB_1RCHHH_1LD0RA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB1RC_1LC0LF_1RF0LD_0RE1LB_1RCHHH_1LD0RA + +namespace BusyBeaver.M_1RB1RC_1LC1RD_1LD0LE_1LA0LD_0LB1RF_HHH0LF +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RC_1LC1RD_1LD0LE_1LA0LD_0LB1RF_HHH0LF" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB1RC_1LC1RD_1LD0LE_1LA0LD_0LB1RF_HHH0LF + +namespace BusyBeaver.M_1RB1RE_1LC0LB_1LD1LC_0RA1RF_1RD1RE_HHH1LB +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RE_1LC0LB_1LD1LC_0RA1RF_1RD1RE_HHH1LB" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB1RE_1LC0LB_1LD1LC_0RA1RF_1RD1RE_HHH1LB + +namespace BusyBeaver.M_1RB1RE_1LC0RC_0RA0LD_1LB1LE_0RC1LF_HHH1RA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RE_1LC0RC_0RA0LD_1LB1LE_0RC1LF_HHH1RA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB1RE_1LC0RC_0RA0LD_1LB1LE_0RC1LF_HHH1RA + +namespace BusyBeaver.M_1RB1RE_1RC1LE_1LD0RA_1LF0LA_1LB0LC_HHH1RA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RE_1RC1LE_1LD0RA_1LF0LA_1LB0LC_HHH1RA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB1RE_1RC1LE_1LD0RA_1LF0LA_1LB0LC_HHH1RA + +namespace BusyBeaver.M_1RB1RF_0RC0RE_0RD1RA_1LE0LA_1LB0LD_0RDHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_0RC0RE_0RD1RA_1LE0LA_1LB0LD_0RDHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB1RF_0RC0RE_0RD1RA_1LE0LA_1LB0LD_0RDHHH + +namespace BusyBeaver.M_1RB1RF_1LC0RA_HHH0LD_1RE1LD_0LF0LB_1RA1LE +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1LC0RA_HHH0LD_1RE1LD_0LF0LB_1RA1LE" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RB1RF_1LC0RA_HHH0LD_1RE1LD_0LF0LB_1RA1LE + +namespace BusyBeaver.M_1RBHHH_1LC1RE_1LA0LD_0RE1LC_1LC1RF_1RB0RD +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1LC1RE_1LA0LD_0RE1LC_1LC1RF_1RB0RD" abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_halt : IsHalt target := by sorry +end BusyBeaver.M_1RBHHH_1LC1RE_1LA0LD_0RE1LC_1LC1RF_1RB0RD +namespace BusyBeaver.M_1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC -end BusyBeaver.M_1RB0LF_1RC0RA_1LD0RB_0LE0LC_0LA0LC_0LBHHH +namespace BusyBeaver.M_1RB0LA_0RC1LE_0RD1RE_1LA1RF_1RB0LD_1RCHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LA_0RC1LE_0RD1RE_1LA1RF_1RB0LD_1RCHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LA_0RC1LE_0RD1RE_1LA1RF_1RB0LD_1RCHHH + +namespace BusyBeaver.M_1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RCHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RCHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RCHHH + +namespace BusyBeaver.M_1RB0LB_1LC1LB_1RD1LA_0RE0RE_0RA1RF_HHH1RD +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LB_1LC1LB_1RD1LA_0RE0RE_0RA1RF_HHH1RD" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LB_1LC1LB_1RD1LA_0RE0RE_0RA1RF_HHH1RD + +namespace BusyBeaver.M_1RB0LC_0LC1RE_1LD1LC_1LA1RD_HHH1RF_0RA0RF +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LC_0LC1RE_1LD1LC_1LA1RD_HHH1RF_0RA0RF" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LC_0LC1RE_1LD1LC_1LA1RD_HHH1RF_0RA0RF + +namespace BusyBeaver.M_1RB0LC_1LA0RE_0RD0LA_1RE1RA_0LD1RF_0RBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LC_1LA0RE_0RD0LA_1RE1RA_0LD1RF_0RBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LC_1LA0RE_0RD0LA_1RE1RA_0LD1RF_0RBHHH + +namespace BusyBeaver.M_1RB0LC_1LA0RE_0RD1LF_1LC1LB_0LD0RB_0LAHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LC_1LA0RE_0RD1LF_1LC1LB_0LD0RB_0LAHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LC_1LA0RE_0RD1LF_1LC1LB_0LD0RB_0LAHHH + +namespace BusyBeaver.M_1RB0LC_1LC0RB_0LE0LD_1LCHHH_0RA1LF_1LA1LF +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LC_1LC0RB_0LE0LD_1LCHHH_0RA1LF_1LA1LF" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LC_1LC0RB_0LE0LD_1LCHHH_0RA1LF_1LA1LF + +namespace BusyBeaver.M_1RB0LC_1LC0RE_1LA1LD_1LA1LB_0RF1RA_HHH0RE +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LC_1LC0RE_1LA1LD_1LA1LB_0RF1RA_HHH0RE" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LC_1LC0RE_1LA1LD_1LA1LB_0RF1RA_HHH0RE + +namespace BusyBeaver.M_1RB0LC_1LC0RE_1LA1LD_1LA1LF_0RB1RA_1LCHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LC_1LC0RE_1LA1LD_1LA1LF_0RB1RA_1LCHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LC_1LC0RE_1LA1LD_1LA1LF_0RB1RA_1LCHHH + +namespace BusyBeaver.M_1RB0LD_1LC1RB_0LA0LD_1LE0RB_1RF0RE_HHH0RD +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LD_1LC1RB_0LA0LD_1LE0RB_1RF0RE_HHH0RD" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LD_1LC1RB_0LA0LD_1LE0RB_1RF0RE_HHH0RD + +namespace BusyBeaver.M_1RB0LD_1RC0RA_1RD1RF_1LA0LE_1RE1LD_0RBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LD_1RC0RA_1RD1RF_1LA0LE_1RE1LD_0RBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LD_1RC0RA_1RD1RF_1LA0LE_1RE1LD_0RBHHH + +namespace BusyBeaver.M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH + +namespace BusyBeaver.M_1RB0LD_1RC1RF_0RD1RA_1LE1RC_0LA0LD_0RCHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LD_1RC1RF_0RD1RA_1LE1RC_0LA0LD_0RCHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LD_1RC1RF_0RD1RA_1LE1RC_0LA0LD_0RCHHH + +namespace BusyBeaver.M_1RB0LE_1LC1RA_HHH1LD_0RB1LF_1RD1LA_0LA0RD +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LE_1LC1RA_HHH1LD_0RB1LF_1RD1LA_0LA0RD" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LE_1LC1RA_HHH1LD_0RB1LF_1RD1LA_0LA0RD + +namespace BusyBeaver.M_1RB0LE_1LC1RD_1LA0LC_1RA1RE_0RF0RB_1LCHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LE_1LC1RD_1LA0LC_1RA1RE_0RF0RB_1LCHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LE_1LC1RD_1LA0LC_1RA1RE_0RF0RB_1LCHHH + +namespace BusyBeaver.M_1RB0LE_1RC0LF_0LD0RC_1RA1LD_1LB0LE_HHH0RE +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LE_1RC0LF_0LD0RC_1RA1LD_1LB0LE_HHH0RE" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LE_1RC0LF_0LD0RC_1RA1LD_1LB0LE_HHH0RE + +namespace BusyBeaver.M_1RB0LE_1RC0RC_1LD0RB_1LA0LE_1LD1LF_1LDHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LE_1RC0RC_1LD0RB_1LA0LE_1LD1LF_1LDHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LE_1RC0RC_1LD0RB_1LA0LE_1LD1LF_1LDHHH + +namespace BusyBeaver.M_1RB0LE_1RC1LA_1LD1RE_1LB0LD_1RF0RC_1RBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LE_1RC1LA_1LD1RE_1LB0LD_1RF0RC_1RBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LE_1RC1LA_1LD1RE_1LB0LD_1RF0RC_1RBHHH + +namespace BusyBeaver.M_1RB0LF_0RCHHH_1RD0RA_1LE0RC_0LA0LE_1LE1LB +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0LF_0RCHHH_1RD0RA_1LE0RC_0LA0LE_1LE1LB" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0LF_0RCHHH_1RD0RA_1LE0RC_0LA0LE_1LE1LB + +namespace BusyBeaver.M_1RB0RA_0LC0LA_1RF1LD_1LE0LD_1LC1LF_HHH1RA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_0LC0LA_1RF1LD_1LE0LD_1LC1LF_HHH1RA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RA_0LC0LA_1RF1LD_1LE0LD_1LC1LF_HHH1RA + +namespace BusyBeaver.M_1RB0RA_0RC0LD_1LA1RF_1LE1LD_1LB1RE_HHH1RA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_0RC0LD_1LA1RF_1LE1LD_1LB1RE_HHH1RA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RA_0RC0LD_1LA1RF_1LE1LD_1LB1RE_HHH1RA + +namespace BusyBeaver.M_1RB0RA_0RC0LE_1LD1RF_1LB1RD_1LD1LE_HHH1RA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_0RC0LE_1LD1RF_1LB1RD_1LD1LE_HHH1RA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RA_0RC0LE_1LD1RF_1LB1RD_1LD1LE_HHH1RA + +namespace BusyBeaver.M_1RB0RA_0RC0RE_0LDHHH_1LE1LD_1LF0LD_1RA0RD +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_0RC0RE_0LDHHH_1LE1LD_1LF0LD_1RA0RD" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RA_0RC0RE_0LDHHH_1LE1LD_1LF0LD_1RA0RD + +namespace BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA + +namespace BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF1LB_HHH0RA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF1LB_HHH0RA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF1LB_HHH0RA + +namespace BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RF_1RA1LB_1RAHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0LD_1LE1LD_0LB0RF_1RA1LB_1RAHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RF_1RA1LB_1RAHHH + +namespace BusyBeaver.M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LB0RC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LB0RC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LB0RC + +namespace BusyBeaver.M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC + +namespace BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_0LCHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_0LCHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_0LCHHH + +namespace BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH + +namespace BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LCHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LCHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LCHHH + +namespace BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LDHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LDHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LDHHH + +namespace BusyBeaver.M_1RB0RA_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RA_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH + +namespace BusyBeaver.M_1RB0RA_1RC0LC_0LD1RF_1RA1LE_1LD0LB_0REHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1RC0LC_0LD1RF_1RA1LE_1LD0LB_0REHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RA_1RC0LC_0LD1RF_1RA1LE_1LD0LB_0REHHH + +namespace BusyBeaver.M_1RB0RA_1RC0LE_1LD0RA_HHH1LE_0RE0LF_1LB1LC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1RC0LE_1LD0RA_HHH1LE_0RE0LF_1LB1LC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RA_1RC0LE_1LD0RA_HHH1LE_0RE0LF_1LB1LC + +namespace BusyBeaver.M_1RB0RA_1RC0RC_1LD0LE_1RA1LC_1LC1LF_0LCHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1RC0RC_1LD0LE_1RA1LC_1LC1LF_0LCHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RA_1RC0RC_1LD0LE_1RA1LC_1LC1LF_0LCHHH + +namespace BusyBeaver.M_1RB0RA_1RC0RD_1LD1LE_1LF0LC_0LDHHH_1RA1LD +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1RC0RD_1LD1LE_1LF0LC_0LDHHH_1RA1LD" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RA_1RC0RD_1LD1LE_1LF0LC_0LDHHH_1RA1LD + +namespace BusyBeaver.M_1RB0RA_1RC0RE_1RDHHH_1LE1LD_1LF0LD_1RA1LE +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RA_1RC0RE_1RDHHH_1LE1LD_1LF0LD_1RA1LE" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RA_1RC0RE_1RDHHH_1LE1LD_1LF0LD_1RA1LE + +namespace BusyBeaver.M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LAHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LAHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LAHHH + +namespace BusyBeaver.M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LBHHH + +namespace BusyBeaver.M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_1LEHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_1LEHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_1LEHHH + +namespace BusyBeaver.M_1RB0RB_1LC0RA_1LE0LD_1LC1LF_1RA0LD_1LCHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RB_1LC0RA_1LE0LD_1LC1LF_1RA0LD_1LCHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RB_1LC0RA_1LE0LD_1LC1LF_1RA0LD_1LCHHH + +namespace BusyBeaver.M_1RB0RB_1RC1LC_0LD1RA_1LF1LE_0LA1LC_1LBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RB_1RC1LC_0LD1RA_1LF1LE_0LA1LC_1LBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RB_1RC1LC_0LD1RA_1LF1LE_0LA1LC_1LBHHH + +namespace BusyBeaver.M_1RB0RC_1LC0LD_1RA1RC_1RA1LE_0LB1RE_HHH1RA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RC_1LC0LD_1RA1RC_1RA1LE_0LB1RE_HHH1RA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RC_1LC0LD_1RA1RC_1RA1LE_0LB1RE_HHH1RA + +namespace BusyBeaver.M_1RB0RC_1LC1LF_1LD0LB_1RE1LC_1RA0RE_0LCHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RC_1LC1LF_1LD0LB_1RE1LC_1RA0RE_0LCHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RC_1LC1LF_1LD0LB_1RE1LC_1RA0RE_0LCHHH + +namespace BusyBeaver.M_1RB0RC_1LC1RA_0RF0LD_1LE0RB_1LB0LD_HHH1RD +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RC_1LC1RA_0RF0LD_1LE0RB_1LB0LD_HHH1RD" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RC_1LC1RA_0RF0LD_1LE0RB_1LB0LD_HHH1RD + +namespace BusyBeaver.M_1RB0RC_1LC1RD_1RA1LE_1LA0RD_0LE1RF_1LBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RC_1LC1RD_1RA1LE_1LA0RD_0LE1RF_1LBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RC_1LC1RD_1RA1LE_1LA0RD_0LE1RF_1LBHHH + +namespace BusyBeaver.M_1RB0RD_0LC0RA_1LA1LC_1RE0LF_0RA1RF_1LBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RD_0LC0RA_1LA1LC_1RE0LF_0RA1RF_1LBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RD_0LC0RA_1LA1LC_1RE0LF_0RA1RF_1LBHHH + +namespace BusyBeaver.M_1RB0RD_0LC1RA_0RA1LB_1RE1LB_1LF1LB_HHH1LE +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RD_0LC1RA_0RA1LB_1RE1LB_1LF1LB_HHH1LE" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RD_0LC1RA_0RA1LB_1RE1LB_1LF1LB_HHH1LE + +namespace BusyBeaver.M_1RB0RD_0RC0LB_0RD1RD_1LE1RA_1RC1LF_HHH1LA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RD_0RC0LB_0RD1RD_1LE1RA_1RC1LF_HHH1LA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RD_0RC0LB_0RD1RD_1LE1RA_1RC1LF_HHH1LA + +namespace BusyBeaver.M_1RB0RD_1RC1RF_1LD0LE_1RA0LC_1RE1LC_0RAHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RD_1RC1RF_1LD0LE_1RA0LC_1RE1LC_0RAHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RD_1RC1RF_1LD0LE_1RA0LC_1RE1LC_0RAHHH + +namespace BusyBeaver.M_1RB0RD_1RCHHH_1LD1LC_1LE0LC_1RF0RC_1RA0RF +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RD_1RCHHH_1LD1LC_1LE0LC_1RF0RC_1RA0RF" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RD_1RCHHH_1LD1LC_1LE0LC_1RF0RC_1RA0RF + +namespace BusyBeaver.M_1RB0RD_1RCHHH_1LD1LE_1LE0LC_1RF1LD_1RA0RF +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RD_1RCHHH_1LD1LE_1LE0LC_1RF1LD_1RA0RF" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RD_1RCHHH_1LD1LE_1LE0LC_1RF1LD_1RA0RF + +namespace BusyBeaver.M_1RB0RE_1LC0LE_1LD0LC_1RA0LA_1RA1RF_1RAHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC0LE_1LD0LC_1RA0LA_1RA1RF_1RAHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RE_1LC0LE_1LD0LC_1RA0LA_1RA1RF_1RAHHH + +namespace BusyBeaver.M_1RB0RE_1LC0RA_0RA0LD_1LEHHH_1RF0LF_0LC0RA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC0RA_0RA0LD_1LEHHH_1RF0LF_0LC0RA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RE_1LC0RA_0RA0LD_1LEHHH_1RF0LF_0LC0RA + +namespace BusyBeaver.M_1RB0RE_1LC0RA_1LD0LB_1LA1LF_1LE1RA_0LCHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC0RA_1LD0LB_1LA1LF_1LE1RA_0LCHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RE_1LC0RA_1LD0LB_1LA1LF_1LE1RA_0LCHHH + +namespace BusyBeaver.M_1RB0RE_1LC0RE_1LD0LD_1RA0LC_1RA1RF_1RAHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC0RE_1LD0LD_1RA0LC_1RA1RF_1RAHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RE_1LC0RE_1LD0LD_1RA0LC_1RA1RF_1RAHHH + +namespace BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RAHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RAHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RAHHH + +namespace BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RDHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RDHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RDHHH + +namespace BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0LBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0LBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0LBHHH + +namespace BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0RAHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0RAHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0RAHHH + +namespace BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RDHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RDHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RDHHH + +namespace BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1REHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1REHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1REHHH + +namespace BusyBeaver.M_1RB0RE_1LC1RD_1LD0LC_1RA0RF_1RDHHH_0RD0LA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC1RD_1LD0LC_1RA0RF_1RDHHH_0RD0LA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RE_1LC1RD_1LD0LC_1RA0RF_1RDHHH_0RD0LA + +namespace BusyBeaver.M_1RB0RE_1LC1RF_HHH0LD_0LE1LB_1LF1LD_1RD0RA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1LC1RF_HHH0LD_0LE1LB_1LF1LD_1RD0RA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RE_1LC1RF_HHH0LD_0LE1LB_1LF1LD_1RD0RA + +namespace BusyBeaver.M_1RB0RE_1RC0RB_0RD0RF_0LEHHH_1LF1LE_1LA0LE +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1RC0RB_0RD0RF_0LEHHH_1LF1LE_1LA0LE" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RE_1RC0RB_0RD0RF_0LEHHH_1LF1LE_1LA0LE + +namespace BusyBeaver.M_1RB0RE_1RC1LF_0LD0RE_HHH1LE_1RA0LB_1LB0LC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1RC1LF_0LD0RE_HHH1LE_1RA0LB_1LB0LC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RE_1RC1LF_0LD0RE_HHH1LE_1RA0LB_1LB0LC + +namespace BusyBeaver.M_1RB0RE_1RC1RE_1LD1RA_1LA0LD_0RA0LF_1LDHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1RC1RE_1LD1RA_1LA0LD_0RA0LF_1LDHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RE_1RC1RE_1LD1RA_1LA0LD_0RA0LF_1LDHHH + +namespace BusyBeaver.M_1RB0RE_1RCHHH_0LD1LE_0RE1LD_1RF0LC_0RA1RE +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RE_1RCHHH_0LD1LE_0RE1LD_1RF0LC_0RA1RE" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RE_1RCHHH_0LD1LE_0RE1LD_1RF0LC_0RA1RE + +namespace BusyBeaver.M_1RB0RF_1LC0LF_1LD0LC_0LE0LA_1LFHHH_1RA1RF +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1LC0LF_1LD0LC_0LE0LA_1LFHHH_1RA1RF" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RF_1LC0LF_1LD0LC_0LE0LA_1LFHHH_1RA1RF + +namespace BusyBeaver.M_1RB0RF_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RF_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH + +namespace BusyBeaver.M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_0RFHHH_1RA1RF +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1LC1RA_1LD0LC_0LE0LA_0RFHHH_1RA1RF" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_0RFHHH_1RA1RF + +namespace BusyBeaver.M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_1RFHHH_1RA1RE +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1LC1RA_1LD0LC_0LE0LA_1RFHHH_1RA1RE" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_1RFHHH_1RA1RE + +namespace BusyBeaver.M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RB +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RB" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RB + +namespace BusyBeaver.M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RF +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RF" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RF + +namespace BusyBeaver.M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RA0LB +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RA0LB" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RA0LB + +namespace BusyBeaver.M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RE0LB +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RE0LB" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RE0LB + +namespace BusyBeaver.M_1RB0RF_1RC1RF_1LD0RE_HHH0LE_1LA0LE_0RA0LC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1RC1RF_1LD0RE_HHH0LE_1LA0LE_0RA0LC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RF_1RC1RF_1LD0RE_HHH0LE_1LA0LE_0RA0LC + +namespace BusyBeaver.M_1RB0RF_1RC1RF_1LD1RA_HHH0LE_1LA0LE_0RA0LC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB0RF_1RC1RF_1LD1RA_HHH0LE_1LA0LE_0RA0LC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB0RF_1RC1RF_1LD1RA_HHH0LE_1LA0LE_0RA0LC + +namespace BusyBeaver.M_1RB1LA_0RC0RD_1LC1LA_1RE1RD_1LF0LA_HHH0LE +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LA_0RC0RD_1LC1LA_1RE1RD_1LF0LA_HHH0LE" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LA_0RC0RD_1LC1LA_1RE1RD_1LF0LA_HHH0LE + +namespace BusyBeaver.M_1RB1LA_1LA1RC_1RD0RB_1LE0LF_HHH1LD_0LE1LA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LA_1LA1RC_1RD0RB_1LE0LF_HHH1LD_0LE1LA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LA_1LA1RC_1RD0RB_1LE0LF_HHH1LD_0LE1LA + +namespace BusyBeaver.M_1RB1LA_1LC0RA_0LD1RC_HHH0LE_0LF1LE_1RF1LB +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LA_1LC0RA_0LD1RC_HHH0LE_0LF1LE_1RF1LB" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LA_1LC0RA_0LD1RC_HHH0LE_0LF1LE_1RF1LB + +namespace BusyBeaver.M_1RB1LA_1RC0LE_1RD0LF_0LA0RD_1LC0LE_HHH0RE +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LA_1RC0LE_1RD0LF_0LA0RD_1LC0LE_HHH0RE" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LA_1RC0LE_1RD0LF_0LA0RD_1LC0LE_HHH0RE + +namespace BusyBeaver.M_1RB1LB_1LC0LF_1LD0RC_1RE0LA_1RE1RC_HHH0LE +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LB_1LC0LF_1LD0RC_1RE0LA_1RE1RC_HHH0LE" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LB_1LC0LF_1LD0RC_1RE0LA_1RE1RC_HHH0LE + +namespace BusyBeaver.M_1RB1LB_1LC1RB_1RF1LD_0LE0LC_0RCHHH_1LA0RF +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LB_1LC1RB_1RF1LD_0LE0LC_0RCHHH_1LA0RF" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LB_1LC1RB_1RF1LD_0LE0LC_0RCHHH_1LA0RF + +namespace BusyBeaver.M_1RB1LB_1RC0LA_1LD1RF_1RB0LE_HHH1LA_1RD0RD +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LB_1RC0LA_1LD1RF_1RB0LE_HHH1LA_1RD0RD" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LB_1RC0LA_1LD1RF_1RB0LE_HHH1LA_1RD0RD + +namespace BusyBeaver.M_1RB1LC_1LA1RB_1LD0LA_1RE0RF_HHH1RD_0RE1RB +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LC_1LA1RB_1LD0LA_1RE0RF_HHH1RD_0RE1RB" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LC_1LA1RB_1LD0LA_1RE0RF_HHH1RD_0RE1RB + +namespace BusyBeaver.M_1RB1LC_1RC1LB_1LD0RB_0LE1RD_HHH0LF_0LA1LF +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LC_1RC1LB_1LD0RB_0LE1RD_HHH0LF_0LA1LF" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LC_1RC1LB_1LD0RB_0LE1RD_HHH0LF_0LA1LF + +namespace BusyBeaver.M_1RB1LD_0RC0RB_0LD1RE_0LA1LC_0RB0RF_1LCHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LD_0RC0RB_0LD1RE_0LA1LC_0RB0RF_1LCHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LD_0RC0RB_0LD1RE_0LA1LC_0RB0RF_1LCHHH + +namespace BusyBeaver.M_1RB1LD_0RC1RC_1LA1RE_HHH1LE_1RF0RC_0RB0LF +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LD_0RC1RC_1LA1RE_HHH1LE_1RF0RC_0RB0LF" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LD_0RC1RC_1LA1RE_HHH1LE_1RF0RC_0RB0LF + +namespace BusyBeaver.M_1RB1LD_1LC1RA_0LD0LC_0RE1RB_1RD0RF_0RBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LD_1LC1RA_0LD0LC_0RE1RB_1RD0RF_0RBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LD_1LC1RA_0LD0LC_0RE1RB_1RD0RF_0RBHHH + +namespace BusyBeaver.M_1RB1LD_1RC0RB_1LA0RE_1LC1LE_1LF0LA_0REHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LD_1RC0RB_1LA0RE_1LC1LE_1LF0LA_0REHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LD_1RC0RB_1LA0RE_1LC1LE_1LF0LA_0REHHH + +namespace BusyBeaver.M_1RB1LD_1RC0RB_1LA1RE_1LF0LA_1LA0RD_1LCHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LD_1RC0RB_1LA1RE_1LF0LA_1LA0RD_1LCHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LD_1RC0RB_1LA1RE_1LF0LA_1LA0RD_1LCHHH + +namespace BusyBeaver.M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD0LF_1RDHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD0LF_1RDHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD0LF_1RDHHH + +namespace BusyBeaver.M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_0LDHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_0LDHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_0LDHHH + +namespace BusyBeaver.M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_1LAHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_1LAHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_1LAHHH + +namespace BusyBeaver.M_1RB1LE_1LC0RF_1LA0RD_1LC1RC_1LB0LB_HHH1RD +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LE_1LC0RF_1LA0RD_1LC1RC_1LB0LB_HHH1RD" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LE_1LC0RF_1LA0RD_1LC1RC_1LB0LB_HHH1RD + +namespace BusyBeaver.M_1RB1LE_1LC1RD_0LA1LA_HHH1RE_1LF0LA_0LC0RF +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LE_1LC1RD_0LA1LA_HHH1RE_1LF0LA_0LC0RF" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LE_1LC1RD_0LA1LA_HHH1RE_1LF0LA_0LC0RF + +namespace BusyBeaver.M_1RB1LF_0RC0RB_0LD1LA_1LC0LE_0LAHHH_1LA1LF +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LF_0RC0RB_0LD1LA_1LC0LE_0LAHHH_1LA1LF" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LF_0RC0RB_0LD1LA_1LC0LE_0LAHHH_1LA1LF + +namespace BusyBeaver.M_1RB1LF_1LC1RB_1RE1LD_1LB0LC_1LA0RE_1LDHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LF_1LC1RB_1RE1LD_1LB0LC_1LA0RE_1LDHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LF_1LC1RB_1RE1LD_1LB0LC_1LA0RE_1LDHHH + +namespace BusyBeaver.M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LA_1LA0LE +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LA_1LA0LE" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LA_1LA0LE + +namespace BusyBeaver.M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LE_1LA0LE +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LE_1LA0LE" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LE_1LA0LE + +namespace BusyBeaver.M_1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH + +namespace BusyBeaver.M_1RB1RA_1LC1LE_1RF1LD_1RE0LD_0LB0RA_HHH0RC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RA_1LC1LE_1RF1LD_1RE0LD_0LB0RA_HHH0RC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RA_1LC1LE_1RF1LD_1RE0LD_0LB0RA_HHH0RC + +namespace BusyBeaver.M_1RB1RA_1LC1RE_0LD0LD_0LE1LF_1LA0RA_HHH1LC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RA_1LC1RE_0LD0LD_0LE1LF_1LA0RA_HHH1LC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RA_1LC1RE_0LD0LD_0LE1LF_1LA0RA_HHH1LC + +namespace BusyBeaver.M_1RB1RA_1RC0RA_1LD0LA_1LE0LD_1LF0LB_1REHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RA_1RC0RA_1LD0LA_1LE0LD_1LF0LB_1REHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RA_1RC0RA_1LD0LA_1LE0LD_1LF0LB_1REHHH + +namespace BusyBeaver.M_1RB1RA_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RA_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RA_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH + +namespace BusyBeaver.M_1RB1RA_1RC1LB_0LD0RA_1RF1LE_HHH1LF_1LC0LF +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RA_1RC1LB_0LD0RA_1RF1LE_HHH1LF_1LC0LF" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RA_1RC1LB_0LD0RA_1RF1LE_HHH1LF_1LC0LF + +namespace BusyBeaver.M_1RB1RA_1RC1LB_1LD0RA_1LA0LE_HHH0LF_0RC0LB +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RA_1RC1LB_1LD0RA_1LA0LE_HHH0LF_0RC0LB" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RA_1RC1LB_1LD0RA_1LA0LE_HHH0LF_0RC0LB + +namespace BusyBeaver.M_1RB1RC_0LA1RF_1RD0LE_1LC0RB_0RA0LC_0RDHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RC_0LA1RF_1RD0LE_1LC0RB_0RA0LC_0RDHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RC_0LA1RF_1RD0LE_1LC0RB_0RA0LC_0RDHHH + +namespace BusyBeaver.M_1RB1RC_1LC0LE_0RA1RD_1RF1LB_1LD0LA_HHH0RC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RC_1LC0LE_0RA1RD_1RF1LB_1LD0LA_HHH0RC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RC_1LC0LE_0RA1RD_1RF1LB_1LD0LA_HHH0RC + +namespace BusyBeaver.M_1RB1RC_1LC0RA_1RA0LD_0RE0LF_0LBHHH_0RF0RE +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RC_1LC0RA_1RA0LD_0RE0LF_0LBHHH_0RF0RE" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RC_1LC0RA_1RA0LD_0RE0LF_0LBHHH_0RF0RE + +namespace BusyBeaver.M_1RB1RC_1LC0RF_1RE0LD_1LB0LD_HHH1RF_0LF0RA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RC_1LC0RF_1RE0LD_1LB0LD_HHH1RF_0LF0RA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RC_1LC0RF_1RE0LD_1LB0LD_HHH1RF_0LF0RA + +namespace BusyBeaver.M_1RB1RC_1LC1RE_HHH1LD_0LE0LD_1RA0RF_1LD1RB +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RC_1LC1RE_HHH1LD_0LE0LD_1RA0RF_1LD1RB" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RC_1LC1RE_HHH1LD_0LE0LD_1RA0RF_1LD1RB + +namespace BusyBeaver.M_1RB1RC_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RC_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RC_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH + +namespace BusyBeaver.M_1RB1RD_1LC0RB_0RD0LC_1LB0LE_1RF0RE_1RAHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RD_1LC0RB_0RD0LC_1LB0LE_1RF0RE_1RAHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RD_1LC0RB_0RD0LC_1LB0LE_1RF0RE_1RAHHH + +namespace BusyBeaver.M_1RB1RE_0RC0RA_0LD0LF_1LA1LD_0RB0LD_1LCHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RE_0RC0RA_0LD0LF_1LA1LD_0RB0LD_1LCHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RE_0RC0RA_0LD0LF_1LA1LD_0RB0LD_1LCHHH + +namespace BusyBeaver.M_1RB1RE_1LC1RB_1RA0LD_1RC0LB_0RFHHH_0LD1RA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RE_1LC1RB_1RA0LD_1RC0LB_0RFHHH_0LD1RA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RE_1LC1RB_1RA0LD_1RC0LB_0RFHHH_0LD1RA + +namespace BusyBeaver.M_1RB1RE_1LC1RD_1LD0LC_1RA0RF_0RDHHH_0RD0LB +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RE_1LC1RD_1LD0LC_1RA0RF_0RDHHH_0RD0LB" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RE_1LC1RD_1LD0LC_1RA0RF_0RDHHH_0RD0LB + +namespace BusyBeaver.M_1RB1RF_0RC1RE_1LD1RB_0LE0LC_1RA0LC_0RBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_0RC1RE_1LD1RB_0LE0LC_1RA0LC_0RBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RF_0RC1RE_1LD1RB_0LE0LC_1RA0LC_0RBHHH + +namespace BusyBeaver.M_1RB1RF_1LC0LE_1RD0LB_1RA0RC_1RE1LB_0RDHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1LC0LE_1RD0LB_1RA0RC_1RE1LB_0RDHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RF_1LC0LE_1RD0LB_1RA0RC_1RE1LB_0RDHHH + +namespace BusyBeaver.M_1RB1RF_1LC0LF_HHH0LD_0LE1LD_0RF0LB_1RA1RE +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1LC0LF_HHH0LD_0LE1LD_0RF0LB_1RA1RE" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RF_1LC0LF_HHH0LD_0LE1LD_0RF0LB_1RA1RE + +namespace BusyBeaver.M_1RB1RF_1LC0RD_HHH0LD_1LE0LD_1RA0RF_0RE0LB +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1LC0RD_HHH0LD_1LE0LD_1RA0RF_0RE0LB" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RF_1LC0RD_HHH0LD_1LE0LD_1RA0RF_0RE0LB + +namespace BusyBeaver.M_1RB1RF_1LC1RE_HHH0LD_1LE0LD_1RA0RF_0RE0LB +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1LC1RE_HHH0LD_1LE0LD_1RA0RF_0RE0LB" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RF_1LC1RE_HHH0LD_1LE0LD_1RA0RF_0RE0LB + +namespace BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LA0LB_0RBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LA0LB_0RBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LA0LB_0RBHHH + +namespace BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LB0LB_0RBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LB0LB_0RBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LB0LB_0RBHHH + +namespace BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_0RBHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_0RBHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_0RBHHH + +namespace BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RAHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RAHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RAHHH + +namespace BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1REHHH +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1REHHH" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1REHHH + +namespace BusyBeaver.M_1RB1RF_1RC1RA_1LD0LA_HHH0LE_0LF1LE_0RA0LC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RB1RF_1RC1RA_1LD0LA_HHH0LE_0LF1LE_0RA0LC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RB1RF_1RC1RA_1LD0LA_HHH0LE_0LF1LE_0RA0LC + +namespace BusyBeaver.M_1RBHHH_0LC1RF_1LE0RD_0RB1RC_1RD0LE_0RC1RA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_0LC1RF_1LE0RD_0RB1RC_1RD0LE_0RC1RA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RBHHH_0LC1RF_1LE0RD_0RB1RC_1RD0LE_0RC1RA + +namespace BusyBeaver.M_1RBHHH_0RC0LD_1RD1RC_1LB0LE_1LF0RA_0LD1LA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_0RC0LD_1RD1RC_1LB0LE_1LF0RA_0LD1LA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RBHHH_0RC0LD_1RD1RC_1LB0LE_1LF0RA_0LD1LA + +namespace BusyBeaver.M_1RBHHH_0RC0RA_1RD1RC_1LE1LF_0LB0LD_0LE0RC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_0RC0RA_1RD1RC_1LE1LF_0LB0LD_0LE0RC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RBHHH_0RC0RA_1RD1RC_1LE1LF_0LB0LD_0LE0RC + +namespace BusyBeaver.M_1RBHHH_0RC1LF_0RD1RB_1LE1RC_0LB0LE_0LE0LA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_0RC1LF_0RD1RB_1LE1RC_0LB0LE_0LE0LA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RBHHH_0RC1LF_0RD1RB_1LE1RC_0LB0LE_0LE0LA + +namespace BusyBeaver.M_1RBHHH_0RC1LF_1LC1LD_1RE0RA_0RD1RF_0LD0LF +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_0RC1LF_1LC1LD_1RE0RA_0RD1RF_0LD0LF" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RBHHH_0RC1LF_1LC1LD_1RE0RA_0RD1RF_0LD0LF + +namespace BusyBeaver.M_1RBHHH_1LC0LF_1RD1LB_1RE0RD_1LB0RB_1LB0LA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1LC0LF_1RD1LB_1RE0RD_1LB0RB_1LB0LA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RBHHH_1LC0LF_1RD1LB_1RE0RD_1LB0RB_1LB0LA + +namespace BusyBeaver.M_1RBHHH_1LC0RC_0LD0LC_1RE1RA_0RD1LF_0LE0LF +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1LC0RC_0LD0LC_1RE1RA_0RD1LF_0LE0LF" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RBHHH_1LC0RC_0LD0LC_1RE1RA_0RD1LF_0LE0LF + +namespace BusyBeaver.M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_0RA0RC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_0RA0RC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_0RA0RC + +namespace BusyBeaver.M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_1RA0RC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_1RA0RC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_1RA0RC + +namespace BusyBeaver.M_1RBHHH_1LC1LD_1LD0LB_1RE1LC_1RF0RE_1RA0RC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1LC1LD_1LD0LB_1RE1LC_1RF0RE_1RA0RC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RBHHH_1LC1LD_1LD0LB_1RE1LC_1RF0RE_1RA0RC + +namespace BusyBeaver.M_1RBHHH_1LC1RE_1LD0LC_1LE1LC_1RF0RE_1RA0RB +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1LC1RE_1LD0LC_1LE1LC_1RF0RE_1RA0RB" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RBHHH_1LC1RE_1LD0LC_1LE1LC_1RF0RE_1RA0RB + +namespace BusyBeaver.M_1RBHHH_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RBHHH_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA + +namespace BusyBeaver.M_1RBHHH_1RC0RF_1LD1RB_1LE0LD_1RB0LB_1RB1RA +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1RC0RF_1LD1RB_1LE0LD_1RB0LB_1RB1RA" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RBHHH_1RC0RF_1LD1RB_1LE0LD_1RB0LB_1RB1RA + +namespace BusyBeaver.M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC + +namespace BusyBeaver.M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RB0LC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RB0LC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RB0LC + +namespace BusyBeaver.M_1RBHHH_1RC1LF_1LD1RE_1LB0LD_1RA0RC_1RC0LE +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1RC1LF_1LD1RE_1LB0LD_1RA0RC_1RC0LE" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RBHHH_1RC1LF_1LD1RE_1LB0LD_1RA0RC_1RC0LE + +namespace BusyBeaver.M_1RBHHH_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RBHHH_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC + +namespace BusyBeaver.M_1RBHHH_1RC1RE_1LD0RC_0RE0LD_1LC0LF_1RA0RF +def machine : ConjectureMachines.Machine 6 2 := + load_rle_machine% "1RBHHH_1RC1RE_1LD0RC_0RE0LD_1LC0LF_1RA0RF" +abbrev target : Machine (Fin 2) (Fin 6) := machine.toBB +theorem is_not_halt : IsNotHalt target := by sorry +end BusyBeaver.M_1RBHHH_1RC1RE_1LD0RC_0RE0LD_1LC0LF_1RA0RF diff --git a/README.md b/README.md index 1f667e09..979d9ea0 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This repository contains two Lean 4 (`v4.35.0-rc4`) formalization libraries for | Library | Scope | Key Results | Documentation | | :--- | :--- | :--- | :--- | | [`Cryptids/`](Cryptids/) | `(Q, 2)` Turing machines for Goldbach, ZF consistency, the Riemann Hypothesis, and Erdős's ternary conjecture | Certified state reductions (`25 → 21`, `393 → 380`, `120 → 104 → 95`, `15 → 14`) and end-to-end halting equivalences (`Halts M ↔ ¬ GoldbachConjecture`, `ZFInconsistent`, `¬ RiemannHypothesis`, `¬ ErdosTernaryConjecture`) | [`Cryptids/README.md`](Cryptids/README.md), [`Cryptids/Semantics/README.md`](Cryptids/Semantics/README.md) | -| [`BusyBeaver/`](BusyBeaver/) | `BB(6)` `(6, 2)` and `BB(3, 3)` `(3, 3)` holdout Turing machines (some are potential Cryptids, subject to community acceptance) | Shared execution semantics (`BusyBeaver/Defs.lean`), foundational lemmas (`BusyBeaver/Basic.lean`), RLE loader and `ConjectureMachines` bridge (`BusyBeaver/Bridge.lean`), and certified behavioral proofs in [`BusyBeaver/BB6/`](BusyBeaver/BB6/README.md) (54 closed-pattern/reflective holdouts + 35 [`Accelerations/`](BusyBeaver/BB6/Accelerations/README.md), plus halting equivalences and hardness evidence) and [`BusyBeaver/BB33/`](BusyBeaver/BB33/README.md) (6 machines) | [`BusyBeaver/README.md`](BusyBeaver/README.md), [`BusyBeaver/BB6/README.md`](BusyBeaver/BB6/README.md), [`BusyBeaver/BB6/Accelerations/README.md`](BusyBeaver/BB6/Accelerations/README.md), [`BusyBeaver/BB33/README.md`](BusyBeaver/BB33/README.md) | +| [`BusyBeaver/`](BusyBeaver/) | `BB(6)` `(6, 2)` and `BB(3, 3)` `(3, 3)` holdout Turing machines (some are potential Cryptids, subject to community acceptance) | Shared execution semantics (`BusyBeaver/Defs.lean`), foundational lemmas (`BusyBeaver/Basic.lean`), RLE loader and `ConjectureMachines` bridge (`BusyBeaver/Bridge.lean`), and certified behavioral proofs in [`BusyBeaver/BB6/`](BusyBeaver/BB6/README.md) (54 closed-pattern/reflective holdouts + 35 [`Accelerations/`](BusyBeaver/BB6/Accelerations/README.md) + 180 resolved [`Halt/`](BusyBeaver/BB6/Halt/) and [`NonHalt/`](BusyBeaver/BB6/NonHalt/) proofs, plus halting equivalences and hardness evidence) and [`BusyBeaver/BB33/`](BusyBeaver/BB33/README.md) (6 machines) | [`BusyBeaver/README.md`](BusyBeaver/README.md), [`BusyBeaver/BB6/README.md`](BusyBeaver/BB6/README.md), [`BusyBeaver/BB6/Accelerations/README.md`](BusyBeaver/BB6/Accelerations/README.md), [`BusyBeaver/BB33/README.md`](BusyBeaver/BB33/README.md) | All Lean 4 proofs are checked by the kernel without `sorry` and depend only on standard Lean axioms: - **Constructive (`["propext", "Quot.sound"]`, no `Classical.choice`):** All ZF machine-to-proof-search equivalences (`halts_zf393_iff_zfInconsistent`, `Zf380.Semantics.halts_candidate_iff_zfInconsistent`, `halts_zf432_iff_wadeZFInconsistent`), first-order Peano Arithmetic (`PAProvable`) consistency and $\Sigma_1^0$ standard-model adequacy (`not_paProvable_false`, `paHalts_holds_iff_halts`, `paZFInconsistent_holds_iff_zfInconsistent` in [`Cryptids/Semantics/PA/`](Cryptids/Semantics/PA/)), the direct simulation state reductions ([`Goldbach21.lean`](Cryptids/Goldbach21.lean), [`Zf380.lean`](Cryptids/Zf380.lean), [`Riemann104.lean`](Cryptids/Riemann104.lean)), the `erdos_ternary_14` reduction ([`ErdosTernary14.lean`](Cryptids/ErdosTernary14.lean)), and all five `candidate_fewer_states` theorems, audited in CI via [`comparator/constructive.json`](comparator/constructive.json). Because classical Lean (`ZFSet.{0}` in [`Soundness.lean`](Cryptids/Semantics/Zf/Soundness.lean)) proves `¬ ZFInconsistent`—so any non-halting machine would vacuously satisfy `Halts M ↔ ZFInconsistent` under `Classical.choice`—excluding `Classical.choice` blocks classical `Con(ZF)` shortcuts, while deeply embedded `PAProvable` provides a weak first-order metatheory strictly below `ZF` (see [Foundational Note on `Con(ZF)` and Constructive Equivalence](Cryptids/Semantics/README.md#foundational-note-conzf-in-lean-and-constructive-equivalence)). diff --git a/comparator/busy_beaver.json b/comparator/busy_beaver.json index c2d0191a..1448dafc 100644 --- a/comparator/busy_beaver.json +++ b/comparator/busy_beaver.json @@ -507,7 +507,188 @@ "BusyBeaver.BB6.HardnessEvidence.M_1RBHHH_0RC0LD_1LB1RC_0LE0LF_1RD1LE_1RF1RA.halting_residue_class", "BusyBeaver.BB6.HardnessEvidence.M_1RBHHH_0RC0LD_1LB1RC_0LE0LF_1RD1LE_1RF1RA.halting_residue_class_two_step", "BusyBeaver.BB6.HardnessEvidence.M_1RB1RF_1LC1LF_HHH1LD_1LE0RA_1RE1LB_1RD0LD.halting_state_witness", - "BusyBeaver.BB6.HardnessEvidence.M_1RB1RF_1LC1LF_HHH1LD_1LE0RA_1RE1LB_1RD0LD.halting_residue_class" + "BusyBeaver.BB6.HardnessEvidence.M_1RB1RF_1LC1LF_HHH1LD_1LE0RA_1RE1LB_1RD0LD.halting_residue_class", + "BusyBeaver.M_1RB1LA_1RC1RE_1LD0RB_1LA0LC_0RF0RD_0RBHHH.is_not_halt", + "BusyBeaver.M_1RB0LB_0LC0RE_1LA1LD_0LB1LD_1RA0RF_1RAHHH.is_halt", + "BusyBeaver.M_1RB0LB_0LC0RE_1LA1LD_0LB1LF_1RA1RD_0LBHHH.is_halt", + "BusyBeaver.M_1RB0LB_0LC0RE_1LA1LD_0LB1RF_1RA1RD_HHH1LC.is_halt", + "BusyBeaver.M_1RB0LC_1LC0RE_1RF1LD_1LA0LB_1RD1RA_1LBHHH.is_halt", + "BusyBeaver.M_1RB0LD_1LC0RD_1RE0RA_1LE0RF_1LA1RC_0LBHHH.is_halt", + "BusyBeaver.M_1RB0LD_1RC0RF_1LC1LA_0LEHHH_1LF0RB_0RC0RE.is_halt", + "BusyBeaver.M_1RB0LE_0RC0RB_1LD0LD_1RA1LC_HHH1LF_1LA0LC.is_halt", + "BusyBeaver.M_1RB0LF_1RCHHH_1LD0RF_1RA0LE_0LD1LD_0RD0RB.is_halt", + "BusyBeaver.M_1RB0RA_1LC0RE_1LD0LC_1RA1LE_1LC0LF_0RAHHH.is_halt", + "BusyBeaver.M_1RB0RB_1RC0RD_1LD1RC_1RF0LE_1LC1LE_HHH0RA.is_halt", + "BusyBeaver.M_1RB0RC_1LC1RF_1RA1LD_1RD0LE_1LD1LC_0REHHH.is_halt", + "BusyBeaver.M_1RB0RC_1RC0LD_1LD1RA_1LF0LE_HHH0RD_1LB0LA.is_halt", + "BusyBeaver.M_1RB0RD_1LC0RA_HHH1RD_1RA1LE_1RC0LF_1LE0LB.is_halt", + "BusyBeaver.M_1RB0RD_1LC1RE_1LA0LD_0RE0RF_1LC1RA_0LEHHH.is_halt", + "BusyBeaver.M_1RB0RD_1RC0LC_1RE1RA_0LD1LA_0LF0LD_0REHHH.is_halt", + "BusyBeaver.M_1RB0RE_1RC0RA_0LD0LB_0LA1LE_1LC1LF_0LAHHH.is_halt", + "BusyBeaver.M_1RB0RF_0RC1RD_0LDHHH_1LE1RA_1LA0LF_0RD0RC.is_halt", + "BusyBeaver.M_1RB0RF_1LC1RE_1LD0LC_0LE0RE_1RA1LD_1RBHHH.is_halt", + "BusyBeaver.M_1RB0RF_1RC0RB_1LD1RA_1LE0LD_1RB0LA_0LDHHH.is_halt", + "BusyBeaver.M_1RB1LA_0LB1LC_1RD0LD_0LA0RE_1RC1RF_0LDHHH.is_halt", + "BusyBeaver.M_1RB1LC_1RC1RE_0LF1RD_0RA0LD_HHH1RC_1LA0LA.is_halt", + "BusyBeaver.M_1RB1RA_1LC0RD_1LD1LB_1RA0LE_0LB1LF_1RCHHH.is_halt", + "BusyBeaver.M_1RB1RA_1LC0RE_1LD1LB_1RA0LE_1RA0LF_0LBHHH.is_halt", + "BusyBeaver.M_1RB1RC_1LC0LF_1RF0LD_0RE1LB_1RCHHH_1LD0RA.is_halt", + "BusyBeaver.M_1RB1RC_1LC1RD_1LD0LE_1LA0LD_0LB1RF_HHH0LF.is_halt", + "BusyBeaver.M_1RB1RE_1LC0LB_1LD1LC_0RA1RF_1RD1RE_HHH1LB.is_halt", + "BusyBeaver.M_1RB1RE_1LC0RC_0RA0LD_1LB1LE_0RC1LF_HHH1RA.is_halt", + "BusyBeaver.M_1RB1RE_1RC1LE_1LD0RA_1LF0LA_1LB0LC_HHH1RA.is_halt", + "BusyBeaver.M_1RB1RF_0RC0RE_0RD1RA_1LE0LA_1LB0LD_0RDHHH.is_halt", + "BusyBeaver.M_1RB1RF_1LC0RA_HHH0LD_1RE1LD_0LF0LB_1RA1LE.is_halt", + "BusyBeaver.M_1RBHHH_1LC1RE_1LA0LD_0RE1LC_1LC1RF_1RB0RD.is_halt", + "BusyBeaver.M_1RB0LA_0LC0RB_1RA0RD_1LE0LD_1LFHHH_1LA1LC.is_not_halt", + "BusyBeaver.M_1RB0LA_0RC1LE_0RD1RE_1LA1RF_1RB0LD_1RCHHH.is_not_halt", + "BusyBeaver.M_1RB0LA_0RC1RD_0LD1RE_1LA0RB_0RD1RF_1RCHHH.is_not_halt", + "BusyBeaver.M_1RB0LB_1LC1LB_1RD1LA_0RE0RE_0RA1RF_HHH1RD.is_not_halt", + "BusyBeaver.M_1RB0LC_0LC1RE_1LD1LC_1LA1RD_HHH1RF_0RA0RF.is_not_halt", + "BusyBeaver.M_1RB0LC_1LA0RE_0RD0LA_1RE1RA_0LD1RF_0RBHHH.is_not_halt", + "BusyBeaver.M_1RB0LC_1LA0RE_0RD1LF_1LC1LB_0LD0RB_0LAHHH.is_not_halt", + "BusyBeaver.M_1RB0LC_1LC0RB_0LE0LD_1LCHHH_0RA1LF_1LA1LF.is_not_halt", + "BusyBeaver.M_1RB0LC_1LC0RE_1LA1LD_1LA1LB_0RF1RA_HHH0RE.is_not_halt", + "BusyBeaver.M_1RB0LC_1LC0RE_1LA1LD_1LA1LF_0RB1RA_1LCHHH.is_not_halt", + "BusyBeaver.M_1RB0LD_1LC1RB_0LA0LD_1LE0RB_1RF0RE_HHH0RD.is_not_halt", + "BusyBeaver.M_1RB0LD_1RC0RA_1RD1RF_1LA0LE_1RE1LD_0RBHHH.is_not_halt", + "BusyBeaver.M_1RB0LD_1RC0RE_1LD0RE_1LA0LA_1RB1RF_1RBHHH.is_not_halt", + "BusyBeaver.M_1RB0LD_1RC1RF_0RD1RA_1LE1RC_0LA0LD_0RCHHH.is_not_halt", + "BusyBeaver.M_1RB0LE_1LC1RA_HHH1LD_0RB1LF_1RD1LA_0LA0RD.is_not_halt", + "BusyBeaver.M_1RB0LE_1LC1RD_1LA0LC_1RA1RE_0RF0RB_1LCHHH.is_not_halt", + "BusyBeaver.M_1RB0LE_1RC0LF_0LD0RC_1RA1LD_1LB0LE_HHH0RE.is_not_halt", + "BusyBeaver.M_1RB0LE_1RC0RC_1LD0RB_1LA0LE_1LD1LF_1LDHHH.is_not_halt", + "BusyBeaver.M_1RB0LE_1RC1LA_1LD1RE_1LB0LD_1RF0RC_1RBHHH.is_not_halt", + "BusyBeaver.M_1RB0LF_0RCHHH_1RD0RA_1LE0RC_0LA0LE_1LE1LB.is_not_halt", + "BusyBeaver.M_1RB0RA_0LC0LA_1RF1LD_1LE0LD_1LC1LF_HHH1RA.is_not_halt", + "BusyBeaver.M_1RB0RA_0RC0LD_1LA1RF_1LE1LD_1LB1RE_HHH1RA.is_not_halt", + "BusyBeaver.M_1RB0RA_0RC0LE_1LD1RF_1LB1RD_1LD1LE_HHH1RA.is_not_halt", + "BusyBeaver.M_1RB0RA_0RC0RE_0LDHHH_1LE1LD_1LF0LD_1RA0RD.is_not_halt", + "BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF0LA_HHH0RA.is_not_halt", + "BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RE_1RF1LB_HHH0RA.is_not_halt", + "BusyBeaver.M_1RB0RA_1LC0LD_1LE1LD_0LB0RF_1RA1LB_1RAHHH.is_not_halt", + "BusyBeaver.M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LB0RC.is_not_halt", + "BusyBeaver.M_1RB0RA_1LC0LF_1LE0LD_1LBHHH_1RA1LB_0LD0RC.is_not_halt", + "BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_0LCHHH.is_not_halt", + "BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LBHHH.is_not_halt", + "BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LCHHH.is_not_halt", + "BusyBeaver.M_1RB0RA_1LC0RC_1LE0LD_1LC1LF_1RA1LC_1LDHHH.is_not_halt", + "BusyBeaver.M_1RB0RA_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH.is_not_halt", + "BusyBeaver.M_1RB0RA_1RC0LC_0LD1RF_1RA1LE_1LD0LB_0REHHH.is_not_halt", + "BusyBeaver.M_1RB0RA_1RC0LE_1LD0RA_HHH1LE_0RE0LF_1LB1LC.is_not_halt", + "BusyBeaver.M_1RB0RA_1RC0RC_1LD0LE_1RA1LC_1LC1LF_0LCHHH.is_not_halt", + "BusyBeaver.M_1RB0RA_1RC0RD_1LD1LE_1LF0LC_0LDHHH_1RA1LD.is_not_halt", + "BusyBeaver.M_1RB0RA_1RC0RE_1RDHHH_1LE1LD_1LF0LD_1RA1LE.is_not_halt", + "BusyBeaver.M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LAHHH.is_not_halt", + "BusyBeaver.M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_0LBHHH.is_not_halt", + "BusyBeaver.M_1RB0RB_1LC0LE_1RD1LB_1RA0RD_1LB1LF_1LEHHH.is_not_halt", + "BusyBeaver.M_1RB0RB_1LC0RA_1LE0LD_1LC1LF_1RA0LD_1LCHHH.is_not_halt", + "BusyBeaver.M_1RB0RB_1RC1LC_0LD1RA_1LF1LE_0LA1LC_1LBHHH.is_not_halt", + "BusyBeaver.M_1RB0RC_1LC0LD_1RA1RC_1RA1LE_0LB1RE_HHH1RA.is_not_halt", + "BusyBeaver.M_1RB0RC_1LC1LF_1LD0LB_1RE1LC_1RA0RE_0LCHHH.is_not_halt", + "BusyBeaver.M_1RB0RC_1LC1RA_0RF0LD_1LE0RB_1LB0LD_HHH1RD.is_not_halt", + "BusyBeaver.M_1RB0RC_1LC1RD_1RA1LE_1LA0RD_0LE1RF_1LBHHH.is_not_halt", + "BusyBeaver.M_1RB0RD_0LC0RA_1LA1LC_1RE0LF_0RA1RF_1LBHHH.is_not_halt", + "BusyBeaver.M_1RB0RD_0LC1RA_0RA1LB_1RE1LB_1LF1LB_HHH1LE.is_not_halt", + "BusyBeaver.M_1RB0RD_0RC0LB_0RD1RD_1LE1RA_1RC1LF_HHH1LA.is_not_halt", + "BusyBeaver.M_1RB0RD_1RC1RF_1LD0LE_1RA0LC_1RE1LC_0RAHHH.is_not_halt", + "BusyBeaver.M_1RB0RD_1RCHHH_1LD1LC_1LE0LC_1RF0RC_1RA0RF.is_not_halt", + "BusyBeaver.M_1RB0RD_1RCHHH_1LD1LE_1LE0LC_1RF1LD_1RA0RF.is_not_halt", + "BusyBeaver.M_1RB0RE_1LC0LE_1LD0LC_1RA0LA_1RA1RF_1RAHHH.is_not_halt", + "BusyBeaver.M_1RB0RE_1LC0RA_0RA0LD_1LEHHH_1RF0LF_0LC0RA.is_not_halt", + "BusyBeaver.M_1RB0RE_1LC0RA_1LD0LB_1LA1LF_1LE1RA_0LCHHH.is_not_halt", + "BusyBeaver.M_1RB0RE_1LC0RE_1LD0LD_1RA0LC_1RA1RF_1RAHHH.is_not_halt", + "BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RAHHH.is_not_halt", + "BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1LA0LA_1RA1RF_0RDHHH.is_not_halt", + "BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0LBHHH.is_not_halt", + "BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_0RAHHH.is_not_halt", + "BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1RDHHH.is_not_halt", + "BusyBeaver.M_1RB0RE_1LC1RA_1LD0LC_1RA0LA_1RA1RF_1REHHH.is_not_halt", + "BusyBeaver.M_1RB0RE_1LC1RD_1LD0LC_1RA0RF_1RDHHH_0RD0LA.is_not_halt", + "BusyBeaver.M_1RB0RE_1LC1RF_HHH0LD_0LE1LB_1LF1LD_1RD0RA.is_not_halt", + "BusyBeaver.M_1RB0RE_1RC0RB_0RD0RF_0LEHHH_1LF1LE_1LA0LE.is_not_halt", + "BusyBeaver.M_1RB0RE_1RC1LF_0LD0RE_HHH1LE_1RA0LB_1LB0LC.is_not_halt", + "BusyBeaver.M_1RB0RE_1RC1RE_1LD1RA_1LA0LD_0RA0LF_1LDHHH.is_not_halt", + "BusyBeaver.M_1RB0RE_1RCHHH_0LD1LE_0RE1LD_1RF0LC_0RA1RE.is_not_halt", + "BusyBeaver.M_1RB0RF_1LC0LF_1LD0LC_0LE0LA_1LFHHH_1RA1RF.is_not_halt", + "BusyBeaver.M_1RB0RF_1LC0RE_0LC0LD_1RD1LB_0RF1RA_0RBHHH.is_not_halt", + "BusyBeaver.M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_0RFHHH_1RA1RF.is_not_halt", + "BusyBeaver.M_1RB0RF_1LC1RA_1LD0LC_0LE0LA_1RFHHH_1RA1RE.is_not_halt", + "BusyBeaver.M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RB.is_not_halt", + "BusyBeaver.M_1RB0RF_1LC1RA_1LD0LC_1LE0LA_1LFHHH_1RA1RF.is_not_halt", + "BusyBeaver.M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RA0LB.is_not_halt", + "BusyBeaver.M_1RB0RF_1RC0RE_1LD1RA_1LA0LD_1RAHHH_0RE0LB.is_not_halt", + "BusyBeaver.M_1RB0RF_1RC1RF_1LD0RE_HHH0LE_1LA0LE_0RA0LC.is_not_halt", + "BusyBeaver.M_1RB0RF_1RC1RF_1LD1RA_HHH0LE_1LA0LE_0RA0LC.is_not_halt", + "BusyBeaver.M_1RB1LA_0RC0RD_1LC1LA_1RE1RD_1LF0LA_HHH0LE.is_not_halt", + "BusyBeaver.M_1RB1LA_1LA1RC_1RD0RB_1LE0LF_HHH1LD_0LE1LA.is_not_halt", + "BusyBeaver.M_1RB1LA_1LC0RA_0LD1RC_HHH0LE_0LF1LE_1RF1LB.is_not_halt", + "BusyBeaver.M_1RB1LA_1RC0LE_1RD0LF_0LA0RD_1LC0LE_HHH0RE.is_not_halt", + "BusyBeaver.M_1RB1LB_1LC0LF_1LD0RC_1RE0LA_1RE1RC_HHH0LE.is_not_halt", + "BusyBeaver.M_1RB1LB_1LC1RB_1RF1LD_0LE0LC_0RCHHH_1LA0RF.is_not_halt", + "BusyBeaver.M_1RB1LB_1RC0LA_1LD1RF_1RB0LE_HHH1LA_1RD0RD.is_not_halt", + "BusyBeaver.M_1RB1LC_1LA1RB_1LD0LA_1RE0RF_HHH1RD_0RE1RB.is_not_halt", + "BusyBeaver.M_1RB1LC_1RC1LB_1LD0RB_0LE1RD_HHH0LF_0LA1LF.is_not_halt", + "BusyBeaver.M_1RB1LD_0RC0RB_0LD1RE_0LA1LC_0RB0RF_1LCHHH.is_not_halt", + "BusyBeaver.M_1RB1LD_0RC1RC_1LA1RE_HHH1LE_1RF0RC_0RB0LF.is_not_halt", + "BusyBeaver.M_1RB1LD_1LC1RA_0LD0LC_0RE1RB_1RD0RF_0RBHHH.is_not_halt", + "BusyBeaver.M_1RB1LD_1RC0RB_1LA0RE_1LC1LE_1LF0LA_0REHHH.is_not_halt", + "BusyBeaver.M_1RB1LD_1RC0RB_1LA1RE_1LF0LA_1LA0RD_1LCHHH.is_not_halt", + "BusyBeaver.M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD0LF_1RDHHH.is_not_halt", + "BusyBeaver.M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_0LDHHH.is_not_halt", + "BusyBeaver.M_1RB1LD_1RC0RB_1LD0RD_1LA0LE_1LD1LF_1LAHHH.is_not_halt", + "BusyBeaver.M_1RB1LE_1LC0RF_1LA0RD_1LC1RC_1LB0LB_HHH1RD.is_not_halt", + "BusyBeaver.M_1RB1LE_1LC1RD_0LA1LA_HHH1RE_1LF0LA_0LC0RF.is_not_halt", + "BusyBeaver.M_1RB1LF_0RC0RB_0LD1LA_1LC0LE_0LAHHH_1LA1LF.is_not_halt", + "BusyBeaver.M_1RB1LF_1LC1RB_1RE1LD_1LB0LC_1LA0RE_1LDHHH.is_not_halt", + "BusyBeaver.M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LA_1LA0LE.is_not_halt", + "BusyBeaver.M_1RB1LF_1RC0RB_1RD0RF_1REHHH_1LF1LE_1LA0LE.is_not_halt", + "BusyBeaver.M_1RB1RA_1LC1LE_0LD0LB_0RA0RF_0LC0RA_1RDHHH.is_not_halt", + "BusyBeaver.M_1RB1RA_1LC1LE_1RF1LD_1RE0LD_0LB0RA_HHH0RC.is_not_halt", + "BusyBeaver.M_1RB1RA_1LC1RE_0LD0LD_0LE1LF_1LA0RA_HHH1LC.is_not_halt", + "BusyBeaver.M_1RB1RA_1RC0RA_1LD0LA_1LE0LD_1LF0LB_1REHHH.is_not_halt", + "BusyBeaver.M_1RB1RA_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH.is_not_halt", + "BusyBeaver.M_1RB1RA_1RC1LB_0LD0RA_1RF1LE_HHH1LF_1LC0LF.is_not_halt", + "BusyBeaver.M_1RB1RA_1RC1LB_1LD0RA_1LA0LE_HHH0LF_0RC0LB.is_not_halt", + "BusyBeaver.M_1RB1RC_0LA1RF_1RD0LE_1LC0RB_0RA0LC_0RDHHH.is_not_halt", + "BusyBeaver.M_1RB1RC_1LC0LE_0RA1RD_1RF1LB_1LD0LA_HHH0RC.is_not_halt", + "BusyBeaver.M_1RB1RC_1LC0RA_1RA0LD_0RE0LF_0LBHHH_0RF0RE.is_not_halt", + "BusyBeaver.M_1RB1RC_1LC0RF_1RE0LD_1LB0LD_HHH1RF_0LF0RA.is_not_halt", + "BusyBeaver.M_1RB1RC_1LC1RE_HHH1LD_0LE0LD_1RA0RF_1LD1RB.is_not_halt", + "BusyBeaver.M_1RB1RC_1RC0RA_1LD1RB_1LE0LD_1LF0LB_1LAHHH.is_not_halt", + "BusyBeaver.M_1RB1RD_1LC0RB_0RD0LC_1LB0LE_1RF0RE_1RAHHH.is_not_halt", + "BusyBeaver.M_1RB1RE_0RC0RA_0LD0LF_1LA1LD_0RB0LD_1LCHHH.is_not_halt", + "BusyBeaver.M_1RB1RE_1LC1RB_1RA0LD_1RC0LB_0RFHHH_0LD1RA.is_not_halt", + "BusyBeaver.M_1RB1RE_1LC1RD_1LD0LC_1RA0RF_0RDHHH_0RD0LB.is_not_halt", + "BusyBeaver.M_1RB1RF_0RC1RE_1LD1RB_0LE0LC_1RA0LC_0RBHHH.is_not_halt", + "BusyBeaver.M_1RB1RF_1LC0LE_1RD0LB_1RA0RC_1RE1LB_0RDHHH.is_not_halt", + "BusyBeaver.M_1RB1RF_1LC0LF_HHH0LD_0LE1LD_0RF0LB_1RA1RE.is_not_halt", + "BusyBeaver.M_1RB1RF_1LC0RD_HHH0LD_1LE0LD_1RA0RF_0RE0LB.is_not_halt", + "BusyBeaver.M_1RB1RF_1LC1RE_HHH0LD_1LE0LD_1RA0RF_0RE0LB.is_not_halt", + "BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LA0LB_0RBHHH.is_not_halt", + "BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1LB0LB_0RBHHH.is_not_halt", + "BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_0RBHHH.is_not_halt", + "BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1RAHHH.is_not_halt", + "BusyBeaver.M_1RB1RF_1RC0RA_1LD1RB_1LE0LD_1RB0LB_1REHHH.is_not_halt", + "BusyBeaver.M_1RB1RF_1RC1RA_1LD0LA_HHH0LE_0LF1LE_0RA0LC.is_not_halt", + "BusyBeaver.M_1RBHHH_0LC1RF_1LE0RD_0RB1RC_1RD0LE_0RC1RA.is_not_halt", + "BusyBeaver.M_1RBHHH_0RC0LD_1RD1RC_1LB0LE_1LF0RA_0LD1LA.is_not_halt", + "BusyBeaver.M_1RBHHH_0RC0RA_1RD1RC_1LE1LF_0LB0LD_0LE0RC.is_not_halt", + "BusyBeaver.M_1RBHHH_0RC1LF_0RD1RB_1LE1RC_0LB0LE_0LE0LA.is_not_halt", + "BusyBeaver.M_1RBHHH_0RC1LF_1LC1LD_1RE0RA_0RD1RF_0LD0LF.is_not_halt", + "BusyBeaver.M_1RBHHH_1LC0LF_1RD1LB_1RE0RD_1LB0RB_1LB0LA.is_not_halt", + "BusyBeaver.M_1RBHHH_1LC0RC_0LD0LC_1RE1RA_0RD1LF_0LE0LF.is_not_halt", + "BusyBeaver.M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_0RA0RC.is_not_halt", + "BusyBeaver.M_1RBHHH_1LC1LB_1LD0LB_1RE1LC_1RF0RE_1RA0RC.is_not_halt", + "BusyBeaver.M_1RBHHH_1LC1LD_1LD0LB_1RE1LC_1RF0RE_1RA0RC.is_not_halt", + "BusyBeaver.M_1RBHHH_1LC1RE_1LD0LC_1LE1LC_1RF0RE_1RA0RB.is_not_halt", + "BusyBeaver.M_1RBHHH_1RC0LC_1RD0RF_1LE1RC_1LB0LE_1RC1RA.is_not_halt", + "BusyBeaver.M_1RBHHH_1RC0RF_1LD1RB_1LE0LD_1RB0LB_1RB1RA.is_not_halt", + "BusyBeaver.M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RA0LC.is_not_halt", + "BusyBeaver.M_1RBHHH_1RC0RF_1RD0RA_1LE1RB_1LB0LE_0RB0LC.is_not_halt", + "BusyBeaver.M_1RBHHH_1RC1LF_1LD1RE_1LB0LD_1RA0RC_1RC0LE.is_not_halt", + "BusyBeaver.M_1RBHHH_1RC1RA_1RD0RB_1LE1RC_1LF0LE_1RC0LC.is_not_halt", + "BusyBeaver.M_1RBHHH_1RC1RE_1LD0RC_0RE0LD_1LC0LF_1RA0RF.is_not_halt" ], "permitted_axioms": [ "propext",